summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--.travis.yml18
-rw-r--r--3rdparty/dxsdk/Include/d3dcommon.h15
-rw-r--r--3rdparty/jsoncpp/.gitignore25
-rw-r--r--3rdparty/jsoncpp/.travis.yml17
-rw-r--r--3rdparty/jsoncpp/CMakeLists.txt50
-rw-r--r--3rdparty/jsoncpp/NEWS.txt2
-rw-r--r--3rdparty/jsoncpp/README.md104
-rw-r--r--3rdparty/jsoncpp/SConstruct2
-rw-r--r--3rdparty/jsoncpp/amalgamate.py178
-rw-r--r--3rdparty/jsoncpp/appveyor.yml34
-rw-r--r--3rdparty/jsoncpp/dev.makefile27
-rw-r--r--3rdparty/jsoncpp/devtools/__init__.py7
-rw-r--r--3rdparty/jsoncpp/devtools/agent_vmw7.json4
-rw-r--r--3rdparty/jsoncpp/devtools/agent_vmxp.json4
-rw-r--r--3rdparty/jsoncpp/devtools/antglob.py111
-rw-r--r--3rdparty/jsoncpp/devtools/batchbuild.py173
-rw-r--r--3rdparty/jsoncpp/devtools/fixeol.py29
-rw-r--r--3rdparty/jsoncpp/devtools/licenseupdater.py26
-rw-r--r--3rdparty/jsoncpp/devtools/tarball.py47
-rw-r--r--3rdparty/jsoncpp/doc/doxyfile.in5
-rw-r--r--3rdparty/jsoncpp/doc/header.html2
-rw-r--r--3rdparty/jsoncpp/doc/jsoncpp.dox123
-rw-r--r--3rdparty/jsoncpp/doc/web_doxyfile.in2301
-rw-r--r--3rdparty/jsoncpp/doxybuild.py144
-rw-r--r--3rdparty/jsoncpp/include/json/assertions.h39
-rw-r--r--3rdparty/jsoncpp/include/json/config.h19
-rw-r--r--3rdparty/jsoncpp/include/json/forwards.h6
-rw-r--r--3rdparty/jsoncpp/include/json/reader.h131
-rw-r--r--3rdparty/jsoncpp/include/json/value.h606
-rw-r--r--3rdparty/jsoncpp/include/json/version.h6
-rw-r--r--3rdparty/jsoncpp/include/json/writer.h116
-rw-r--r--3rdparty/jsoncpp/makefiles/vs71/lib_json.vcproj9
-rw-r--r--3rdparty/jsoncpp/makerelease.py202
-rw-r--r--3rdparty/jsoncpp/pkg-config/jsoncpp.pc.in4
-rw-r--r--3rdparty/jsoncpp/scons-tools/globtool.py33
-rw-r--r--3rdparty/jsoncpp/scons-tools/srcdist.py20
-rw-r--r--3rdparty/jsoncpp/scons-tools/substinfile.py7
-rw-r--r--3rdparty/jsoncpp/scons-tools/targz.py21
-rw-r--r--3rdparty/jsoncpp/src/jsontestrunner/CMakeLists.txt17
-rw-r--r--3rdparty/jsoncpp/src/jsontestrunner/main.cpp186
-rw-r--r--3rdparty/jsoncpp/src/lib_json/CMakeLists.txt80
-rw-r--r--3rdparty/jsoncpp/src/lib_json/json_batchallocator.h121
-rw-r--r--3rdparty/jsoncpp/src/lib_json/json_internalarray.inl360
-rw-r--r--3rdparty/jsoncpp/src/lib_json/json_internalmap.inl473
-rw-r--r--3rdparty/jsoncpp/src/lib_json/json_reader.cpp1272
-rw-r--r--3rdparty/jsoncpp/src/lib_json/json_value.cpp662
-rw-r--r--3rdparty/jsoncpp/src/lib_json/json_valueiterator.inl129
-rw-r--r--3rdparty/jsoncpp/src/lib_json/json_writer.cpp642
-rw-r--r--3rdparty/jsoncpp/src/test_lib_json/CMakeLists.txt32
-rw-r--r--3rdparty/jsoncpp/src/test_lib_json/jsontest.cpp2
-rw-r--r--3rdparty/jsoncpp/src/test_lib_json/jsontest.h6
-rw-r--r--3rdparty/jsoncpp/src/test_lib_json/main.cpp777
-rw-r--r--3rdparty/jsoncpp/test/cleantests.py12
-rw-r--r--3rdparty/jsoncpp/test/data/test_comment_00.expected4
-rw-r--r--3rdparty/jsoncpp/test/data/test_comment_00.json5
-rw-r--r--3rdparty/jsoncpp/test/data/test_comment_01.expected2
-rw-r--r--3rdparty/jsoncpp/test/data/test_comment_01.json2
-rw-r--r--3rdparty/jsoncpp/test/data/test_comment_02.expected11
-rw-r--r--3rdparty/jsoncpp/test/data/test_comment_02.json11
-rw-r--r--3rdparty/jsoncpp/test/generate_expected.py9
-rw-r--r--3rdparty/jsoncpp/test/pyjsontestrunner.py57
-rw-r--r--3rdparty/jsoncpp/test/runjsontests.py119
-rw-r--r--3rdparty/jsoncpp/test/rununittests.py46
-rw-r--r--3rdparty/jsoncpp/travis.sh29
-rw-r--r--3rdparty/jsoncpp/version2
-rw-r--r--3rdparty/jsoncpp/version.in1
-rw-r--r--3rdparty/lsqlite3/lsqlite3.c8
-rw-r--r--3rdparty/mongoose/README.md32
-rw-r--r--3rdparty/mongoose/docs/ReleaseNotes.md4
-rw-r--r--3rdparty/mongoose/examples/array_vars/Makefile21
-rw-r--r--3rdparty/mongoose/examples/array_vars/array_vars.c45
-rw-r--r--3rdparty/mongoose/examples/cookie_authentication/cookie_auth.c1
-rw-r--r--3rdparty/mongoose/examples/file_upload/file_upload.c14
-rw-r--r--3rdparty/mongoose/examples/web_server/Makefile8
-rw-r--r--3rdparty/mongoose/examples/web_server/web_server.c2
-rw-r--r--3rdparty/mongoose/mongoose.c228
-rw-r--r--3rdparty/mongoose/mongoose.h7
-rw-r--r--3rdparty/mongoose/test/unit_test.c30
-rw-r--r--3rdparty/portaudio/src/hostapi/alsa/pa_linux_alsa.c6
-rw-r--r--3rdparty/unittest-cpp/UnitTest++/DeferredTestReporter.h2
-rw-r--r--3rdparty/unittest-cpp/UnitTest++/DeferredTestResult.h8
-rw-r--r--README.md3
-rw-r--r--docs/config.txt60
-rw-r--r--docs/m6502.txt4
-rw-r--r--docs/newvideo.txt4
-rw-r--r--hash/a7800.xml136
-rw-r--r--hash/c128_flop.xml74
-rw-r--r--hash/cgenie_cart.xml17
-rw-r--r--hash/cgenie_cass.xml874
-rw-r--r--hash/gamegear.xml2
-rw-r--r--hash/guab.xml127
-rw-r--r--hash/i7000_card.xml147
-rw-r--r--hash/m20.xml10
-rw-r--r--hash/msx1_cart.xml148
-rw-r--r--hash/msx2_flop.xml15
-rw-r--r--hash/mz2000_flop.xml30
-rw-r--r--hash/n64.xml108
-rw-r--r--hash/pet_cass.xml1950
-rw-r--r--hash/pet_flop.xml141
-rw-r--r--hash/pet_rom.xml8
-rw-r--r--hash/smc777.xml32
-rw-r--r--hash/snes.xml2
-rw-r--r--hash/svi318_flop.xml46
-rw-r--r--makefile89
-rw-r--r--nl_examples/congo_bongo.c450
-rw-r--r--nl_examples/kidniki.c447
-rw-r--r--nl_examples/mm5837_noise.c36
-rw-r--r--nl_examples/opamp.c31
-rw-r--r--nl_examples/vs_cs.c50
-rw-r--r--scripts/genie.lua121
-rw-r--r--scripts/src/3rdparty.lua80
-rw-r--r--scripts/src/bus.lua219
-rw-r--r--scripts/src/cpu.lua360
-rw-r--r--scripts/src/emu.lua72
-rw-r--r--scripts/src/lib.lua45
-rw-r--r--scripts/src/machine.lua472
-rw-r--r--scripts/src/main.lua70
-rw-r--r--scripts/src/netlist.lua280
-rw-r--r--scripts/src/osd/osdmini.lua4
-rw-r--r--scripts/src/osd/sdl.lua11
-rw-r--r--scripts/src/osd/sdl_cfg.lua5
-rw-r--r--scripts/src/osd/windows.lua4
-rw-r--r--scripts/src/sound.lua254
-rw-r--r--scripts/src/tools.lua271
-rw-r--r--scripts/src/video.lua142
-rw-r--r--scripts/target/ldplayer/ldplayer.lua12
-rw-r--r--scripts/target/mame/arcade.lua19
-rw-r--r--scripts/target/mame/dummy.lua12
-rw-r--r--scripts/target/mame/mess.lua53
-rw-r--r--scripts/target/mame/nl.lua126
-rw-r--r--scripts/target/mame/tiny.lua10
-rw-r--r--src/build/makedep.py314
-rw-r--r--src/build/makelist.py2
-rw-r--r--src/build/png.py74
-rw-r--r--src/emu/bus/a2bus/corvfdc01.c2
-rw-r--r--src/emu/bus/a2bus/corvfdc02.c2
-rw-r--r--src/emu/bus/a7800/a78_slot.c2
-rw-r--r--src/emu/bus/abcbus/fd2.c2
-rw-r--r--src/emu/bus/abcbus/lux10828.c2
-rw-r--r--src/emu/bus/abcbus/lux21046.c2
-rw-r--r--src/emu/bus/adamnet/fdc.c2
-rw-r--r--src/emu/bus/apricot/cards.c15
-rw-r--r--src/emu/bus/apricot/cards.h19
-rw-r--r--src/emu/bus/apricot/expansion.c192
-rw-r--r--src/emu/bus/apricot/expansion.h208
-rw-r--r--src/emu/bus/apricot/ram.c177
-rw-r--r--src/emu/bus/apricot/ram.h89
-rw-r--r--src/emu/bus/bml3/bml3mp1802.c69
-rw-r--r--src/emu/bus/bml3/bml3mp1802.h12
-rw-r--r--src/emu/bus/cbmiec/c1571.c8
-rw-r--r--src/emu/bus/cbmiec/c1581.c2
-rw-r--r--src/emu/bus/centronics/epson_lx810l.h2
-rw-r--r--src/emu/bus/cgenie/expansion/floppy.c4
-rw-r--r--src/emu/bus/coco/coco_fdc.c85
-rw-r--r--src/emu/bus/coco/coco_fdc.h8
-rw-r--r--src/emu/bus/comx35/fdc.c2
-rw-r--r--src/emu/bus/cpc/ddi1.c140
-rw-r--r--src/emu/bus/cpc/ddi1.h47
-rw-r--r--src/emu/bus/cpc/hd20.c131
-rw-r--r--src/emu/bus/cpc/hd20.h50
-rw-r--r--src/emu/bus/cpc/mface2.c2
-rw-r--r--src/emu/bus/cpc/mface2.h2
-rw-r--r--src/emu/bus/ecbbus/grip.c2
-rw-r--r--src/emu/bus/econet/e01.c2
-rw-r--r--src/emu/bus/ep64/exdos.c2
-rw-r--r--src/emu/bus/gameboy/gb_slot.c2
-rw-r--r--src/emu/bus/gameboy/mbc.c33
-rw-r--r--src/emu/bus/gameboy/mbc.h6
-rw-r--r--src/emu/bus/ieee488/c8280.c2
-rw-r--r--src/emu/bus/isa/3c505.c38
-rw-r--r--src/emu/bus/isa/3c505.h2
-rw-r--r--src/emu/bus/isa/gblaster.c37
-rw-r--r--src/emu/bus/isa/gblaster.h3
-rw-r--r--src/emu/bus/isa/hdc.c465
-rw-r--r--src/emu/bus/isa/hdc.h197
-rw-r--r--src/emu/bus/isa/ibm_mfc.c4
-rw-r--r--src/emu/bus/isa/mc1502_fdc.c2
-rw-r--r--src/emu/bus/isa/omti8621.c4
-rw-r--r--src/emu/bus/isa/p1_fdc.c2
-rw-r--r--src/emu/bus/isa/sblaster.c13
-rw-r--r--src/emu/bus/isa/sc499.c2
-rw-r--r--src/emu/bus/isbx/isbx.h4
-rw-r--r--src/emu/bus/kc/d004.h1
-rw-r--r--src/emu/bus/megadrive/md_slot.c4
-rw-r--r--src/emu/bus/msx_cart/cartridge.c2
-rw-r--r--src/emu/bus/msx_cart/disk.c6
-rw-r--r--src/emu/bus/msx_cart/konami.c4
-rw-r--r--src/emu/bus/msx_cart/moonsound.c124
-rw-r--r--src/emu/bus/msx_cart/moonsound.h38
-rw-r--r--src/emu/bus/msx_slot/cartridge.c1
-rw-r--r--src/emu/bus/nasbus/floppy.c2
-rw-r--r--src/emu/bus/nubus/nubus_image.c19
-rw-r--r--src/emu/bus/nubus/nubus_radiustpd.c2
-rw-r--r--src/emu/bus/nubus/nubus_wsportrait.c2
-rw-r--r--src/emu/bus/oricext/jasmin.c2
-rw-r--r--src/emu/bus/oricext/microdisc.c2
-rw-r--r--src/emu/bus/psx/ctlrport.h2
-rw-r--r--src/emu/bus/ql/sandy_superdisk.c2
-rw-r--r--src/emu/bus/ql/sandy_superqboard.c2
-rw-r--r--src/emu/bus/ql/trumpcard.c2
-rw-r--r--src/emu/bus/s100/dj2db.c2
-rw-r--r--src/emu/bus/sega8/mgear.h1
-rw-r--r--src/emu/bus/sega8/sega8_slot.c4
-rw-r--r--src/emu/bus/sega8/sega8_slot.h2
-rw-r--r--src/emu/bus/snes_ctrl/multitap.c14
-rw-r--r--src/emu/bus/ti99_peb/bwg.c505
-rw-r--r--src/emu/bus/ti99_peb/bwg.h108
-rw-r--r--src/emu/bus/ti99_peb/hfdc.c624
-rw-r--r--src/emu/bus/ti99_peb/hfdc.h132
-rw-r--r--src/emu/bus/ti99_peb/peribox.c125
-rw-r--r--src/emu/bus/ti99_peb/peribox.h15
-rw-r--r--src/emu/bus/ti99_peb/ti_fdc.c312
-rw-r--r--src/emu/bus/ti99_peb/ti_fdc.h81
-rw-r--r--src/emu/bus/tvc/hbf.c2
-rw-r--r--src/emu/bus/vboy/slot.c2
-rw-r--r--src/emu/bus/vtech/memexp/floppy.c14
-rw-r--r--src/emu/bus/vtech/memexp/floppy.h4
-rw-r--r--src/emu/bus/wangpc/wdc.c16
-rw-r--r--src/emu/bus/wswan/slot.c2
-rw-r--r--src/emu/cheat.c15
-rw-r--r--src/emu/clifront.c7
-rw-r--r--src/emu/cpu/8x300/8x300.c2
-rw-r--r--src/emu/cpu/adsp2100/adsp2100.c2
-rw-r--r--src/emu/cpu/adsp2100/adsp2100.h2
-rw-r--r--src/emu/cpu/alph8201/alph8201.h4
-rw-r--r--src/emu/cpu/alto2/a2curt.h2
-rw-r--r--src/emu/cpu/alto2/a2dht.h2
-rw-r--r--src/emu/cpu/alto2/a2ksec.h2
-rw-r--r--src/emu/cpu/alto2/a2kwd.h4
-rw-r--r--src/emu/cpu/alto2/alto2cpu.c2
-rw-r--r--src/emu/cpu/am29000/am29000.c4
-rw-r--r--src/emu/cpu/am29000/am29000.h6
-rw-r--r--src/emu/cpu/amis2000/amis2000.c2
-rw-r--r--src/emu/cpu/amis2000/amis2000op.c (renamed from src/emu/cpu/amis2000/amis2000op.inc)4
-rw-r--r--src/emu/cpu/apexc/apexc.c2
-rw-r--r--src/emu/cpu/apexc/apexc.h2
-rw-r--r--src/emu/cpu/apexc/apexcdsm.c2
-rw-r--r--src/emu/cpu/arcompact/arcompact.h60
-rw-r--r--src/emu/cpu/arcompact/arcompactdasm.c2
-rw-r--r--src/emu/cpu/arm/arm.c2
-rw-r--r--src/emu/cpu/arm7/arm7.c8
-rw-r--r--src/emu/cpu/arm7/arm7core.h2
-rw-r--r--src/emu/cpu/arm7/arm7drc.inc12
-rw-r--r--src/emu/cpu/asap/asap.c2
-rw-r--r--src/emu/cpu/avr8/avr8.c54
-rw-r--r--src/emu/cpu/avr8/avr8.h19
-rw-r--r--src/emu/cpu/ccpu/ccpu.c2
-rw-r--r--src/emu/cpu/cop400/cop400.c2
-rw-r--r--src/emu/cpu/cosmac/cosmac.c2
-rw-r--r--src/emu/cpu/cosmac/cosmac.h2
-rw-r--r--src/emu/cpu/cp1610/cp1610.c1612
-rw-r--r--src/emu/cpu/cp1610/cp1610.h1
-rw-r--r--src/emu/cpu/cubeqcpu/cubeqcpu.c24
-rw-r--r--src/emu/cpu/cubeqcpu/cubeqcpu.h6
-rw-r--r--src/emu/cpu/drcbec.c2
-rw-r--r--src/emu/cpu/dsp16/dsp16.c2
-rw-r--r--src/emu/cpu/dsp32/dsp32.c2
-rw-r--r--src/emu/cpu/dsp56k/dsp56k.c27
-rw-r--r--src/emu/cpu/dsp56k/dsp56k.h4
-rw-r--r--src/emu/cpu/dsp56k/dsp56mem.c10
-rw-r--r--src/emu/cpu/e132xs/e132xs.h2
-rw-r--r--src/emu/cpu/esrip/esrip.c34
-rw-r--r--src/emu/cpu/esrip/esrip.h2
-rw-r--r--src/emu/cpu/f8/f8.c12
-rw-r--r--src/emu/cpu/h6280/h6280.c4
-rw-r--r--src/emu/cpu/h6280/h6280.h2
-rw-r--r--src/emu/cpu/h8/h8.c2
-rw-r--r--src/emu/cpu/h8/h8.h10
-rw-r--r--src/emu/cpu/h8/h8_sci.h2
-rw-r--r--src/emu/cpu/h8/h8_timer16.h4
-rw-r--r--src/emu/cpu/hcd62121/hcd62121.h2
-rw-r--r--src/emu/cpu/hd61700/hd61700.h2
-rw-r--r--src/emu/cpu/hd61700/hd61700d.c2
-rw-r--r--src/emu/cpu/hmcs40/hmcs40.c46
-rw-r--r--src/emu/cpu/hmcs40/hmcs40.h20
-rw-r--r--src/emu/cpu/hmcs40/hmcs40d.c4
-rw-r--r--src/emu/cpu/hmcs40/hmcs40op.c (renamed from src/emu/cpu/hmcs40/hmcs40op.inc)5
-rw-r--r--src/emu/cpu/hphybrid/hphybrid.c961
-rw-r--r--src/emu/cpu/hphybrid/hphybrid.h146
-rw-r--r--src/emu/cpu/hphybrid/hphybrid_dasm.c281
-rw-r--r--src/emu/cpu/i386/i386dasm.c2
-rw-r--r--src/emu/cpu/i386/i386priv.h10
-rw-r--r--src/emu/cpu/i4004/i4004.c6
-rw-r--r--src/emu/cpu/i8008/i8008.c6
-rw-r--r--src/emu/cpu/i8085/i8085.c8
-rw-r--r--src/emu/cpu/i8089/i8089.c2
-rw-r--r--src/emu/cpu/i8089/i8089_channel.c20
-rw-r--r--src/emu/cpu/i8089/i8089_channel.h1
-rw-r--r--src/emu/cpu/i86/i186.c4
-rw-r--r--src/emu/cpu/i86/i286.c4
-rw-r--r--src/emu/cpu/i86/i286.h2
-rw-r--r--src/emu/cpu/i86/i86.c12
-rw-r--r--src/emu/cpu/i86/i86.h10
-rw-r--r--src/emu/cpu/i860/i860.h2
-rw-r--r--src/emu/cpu/i960/i960.c10
-rw-r--r--src/emu/cpu/ie15/ie15.c6
-rw-r--r--src/emu/cpu/jaguar/jaguar.c2
-rw-r--r--src/emu/cpu/lc8670/lc8670.c2
-rw-r--r--src/emu/cpu/lh5801/5801dasm.c2
-rw-r--r--src/emu/cpu/lh5801/5801tbl.inc134
-rw-r--r--src/emu/cpu/lh5801/lh5801.h2
-rw-r--r--src/emu/cpu/lr35902/lr35902.h2
-rw-r--r--src/emu/cpu/m37710/m37710cm.h4
-rw-r--r--src/emu/cpu/m37710/m7700ds.c10
-rw-r--r--src/emu/cpu/m6502/deco16.c8
-rw-r--r--src/emu/cpu/m6502/deco16.h2
-rw-r--r--src/emu/cpu/m6502/m4510.c19
-rw-r--r--src/emu/cpu/m6502/m4510.h10
-rw-r--r--src/emu/cpu/m6502/m6502.c42
-rw-r--r--src/emu/cpu/m6502/m6502.h28
-rwxr-xr-xsrc/emu/cpu/m6502/m6502make.py4
-rw-r--r--src/emu/cpu/m6502/m6504.c17
-rw-r--r--src/emu/cpu/m6502/m6504.h10
-rw-r--r--src/emu/cpu/m6502/m6509.c16
-rw-r--r--src/emu/cpu/m6502/m6509.h10
-rw-r--r--src/emu/cpu/m6502/m6510.c26
-rw-r--r--src/emu/cpu/m6502/m6510.h10
-rw-r--r--src/emu/cpu/m6502/m6510t.h2
-rw-r--r--src/emu/cpu/m6502/m65c02.h2
-rw-r--r--src/emu/cpu/m6502/m65ce02.h2
-rw-r--r--src/emu/cpu/m6502/m65sc02.h2
-rw-r--r--src/emu/cpu/m6502/m740.h2
-rw-r--r--src/emu/cpu/m6502/m7501.h2
-rw-r--r--src/emu/cpu/m6502/m8502.h2
-rw-r--r--src/emu/cpu/m6502/n2a03.c14
-rw-r--r--src/emu/cpu/m6502/n2a03.h10
-rw-r--r--src/emu/cpu/m6502/odeco16.lst12
-rw-r--r--src/emu/cpu/m6502/om6502.lst28
-rw-r--r--src/emu/cpu/m6502/om65c02.lst10
-rw-r--r--src/emu/cpu/m6502/om65ce02.lst8
-rw-r--r--src/emu/cpu/m6502/om740.lst14
-rw-r--r--src/emu/cpu/m6502/r65c02.h2
-rw-r--r--src/emu/cpu/m6800/m6800.c19
-rw-r--r--src/emu/cpu/m6800/m6800.h7
-rw-r--r--src/emu/cpu/m68000/m68000.h22
-rw-r--r--src/emu/cpu/m68000/m68kcpu.c124
-rw-r--r--src/emu/cpu/m68000/m68kcpu.h35
-rw-r--r--src/emu/cpu/m6805/m6805.c4
-rw-r--r--src/emu/cpu/m6809/hd6309.c26
-rw-r--r--src/emu/cpu/m6809/hd6309.ops3
-rw-r--r--src/emu/cpu/m6809/konami.c20
-rw-r--r--src/emu/cpu/m6809/m6809.c46
-rw-r--r--src/emu/cpu/m6809/m6809.h68
-rw-r--r--src/emu/cpu/m6809/m6809.ops3
-rw-r--r--src/emu/cpu/m6809/m6809inl.h42
-rw-r--r--src/emu/cpu/mb86233/mb86233.c2
-rw-r--r--src/emu/cpu/mb88xx/mb88xx.c2
-rw-r--r--src/emu/cpu/mc68hc11/hc11dasm.c2
-rw-r--r--src/emu/cpu/mc68hc11/mc68hc11.c4
-rw-r--r--src/emu/cpu/mcs48/mcs48.c4
-rw-r--r--src/emu/cpu/mcs51/mcs51.c12
-rw-r--r--src/emu/cpu/mcs51/mcs51.h4
-rw-r--r--src/emu/cpu/mcs51/mcs51dasm.c2
-rw-r--r--src/emu/cpu/mcs96/i8xc196.c4
-rw-r--r--src/emu/cpu/mcs96/i8xc196.h1
-rw-r--r--src/emu/cpu/mcs96/mcs96.h8
-rw-r--r--src/emu/cpu/melps4/m58846.c75
-rw-r--r--src/emu/cpu/melps4/m58846.h7
-rw-r--r--src/emu/cpu/melps4/melps4.c256
-rw-r--r--src/emu/cpu/melps4/melps4.h153
-rw-r--r--src/emu/cpu/melps4/melps4d.c20
-rw-r--r--src/emu/cpu/melps4/melps4op.c (renamed from src/emu/cpu/melps4/melps4op.inc)158
-rw-r--r--src/emu/cpu/minx/minx.h2
-rw-r--r--src/emu/cpu/mips/mips3.c6
-rw-r--r--src/emu/cpu/mips/mips3.h2
-rw-r--r--src/emu/cpu/mips/mips3drc.c20
-rw-r--r--src/emu/cpu/mips/mips3fe.c2
-rw-r--r--src/emu/cpu/mips/r3000.c2
-rw-r--r--src/emu/cpu/mips/r3000.h2
-rw-r--r--src/emu/cpu/mn10200/mn10200.c203
-rw-r--r--src/emu/cpu/mn10200/mn10200.h96
-rw-r--r--src/emu/cpu/nec/nec.c4
-rw-r--r--src/emu/cpu/nec/necpriv.h6
-rw-r--r--src/emu/cpu/nec/v25.c4
-rw-r--r--src/emu/cpu/pdp1/pdp1.c2
-rw-r--r--src/emu/cpu/pdp1/pdp1.h2
-rw-r--r--src/emu/cpu/pdp1/pdp1dasm.c2
-rw-r--r--src/emu/cpu/pdp1/tx0.c2
-rw-r--r--src/emu/cpu/pdp1/tx0.h2
-rw-r--r--src/emu/cpu/pdp1/tx0dasm.c2
-rw-r--r--src/emu/cpu/pic16c5x/pic16c5x.c2
-rw-r--r--src/emu/cpu/pic16c62x/pic16c62x.c11
-rw-r--r--src/emu/cpu/pic16c62x/pic16c62x.h2
-rw-r--r--src/emu/cpu/powerpc/ppc.h2
-rw-r--r--src/emu/cpu/powerpc/ppc_dasm.c2
-rw-r--r--src/emu/cpu/powerpc/ppcdrc.c8
-rw-r--r--src/emu/cpu/powerpc/ppcfe.c2
-rw-r--r--src/emu/cpu/pps4/pps4.c4
-rw-r--r--src/emu/cpu/psx/psx.c8
-rw-r--r--src/emu/cpu/rsp/clamp.h37
-rw-r--r--src/emu/cpu/rsp/rsp.c8
-rw-r--r--src/emu/cpu/rsp/rsp.h4
-rw-r--r--src/emu/cpu/rsp/rspcp2.c1536
-rw-r--r--src/emu/cpu/rsp/rspcp2.h242
-rw-r--r--src/emu/cpu/rsp/rspcp2d.c209
-rw-r--r--src/emu/cpu/rsp/rspcp2d.h1
-rw-r--r--src/emu/cpu/rsp/rspcp2s.c3630
-rw-r--r--src/emu/cpu/rsp/rspcp2s.h156
-rw-r--r--src/emu/cpu/rsp/rspdrc.c15
-rw-r--r--src/emu/cpu/rsp/rspfe.c2
-rw-r--r--src/emu/cpu/rsp/vabs.h15
-rw-r--r--src/emu/cpu/rsp/vadd.h17
-rw-r--r--src/emu/cpu/rsp/vaddc.h13
-rw-r--r--src/emu/cpu/rsp/vand.h9
-rw-r--r--src/emu/cpu/rsp/vch.h57
-rw-r--r--src/emu/cpu/rsp/vcl.h65
-rw-r--r--src/emu/cpu/rsp/vcmp.h49
-rw-r--r--src/emu/cpu/rsp/vcr.h35
-rw-r--r--src/emu/cpu/rsp/vdivh.h12
-rw-r--r--src/emu/cpu/rsp/vldst.h69
-rw-r--r--src/emu/cpu/rsp/vmac.h57
-rw-r--r--src/emu/cpu/rsp/vmov.h9
-rw-r--r--src/emu/cpu/rsp/vmrg.h13
-rw-r--r--src/emu/cpu/rsp/vmudh.h11
-rw-r--r--src/emu/cpu/rsp/vmul.h39
-rw-r--r--src/emu/cpu/rsp/vmulh.h31
-rw-r--r--src/emu/cpu/rsp/vmull.h44
-rw-r--r--src/emu/cpu/rsp/vmulm.h56
-rw-r--r--src/emu/cpu/rsp/vmuln.h55
-rw-r--r--src/emu/cpu/rsp/vor.h10
-rw-r--r--src/emu/cpu/rsp/vrcpsq.h58
-rw-r--r--src/emu/cpu/rsp/vrsq.h66
-rw-r--r--src/emu/cpu/rsp/vsub.h17
-rw-r--r--src/emu/cpu/rsp/vsubc.h14
-rw-r--r--src/emu/cpu/rsp/vxor.h10
-rw-r--r--src/emu/cpu/s2650/s2650.c4
-rw-r--r--src/emu/cpu/s2650/s2650.h2
-rw-r--r--src/emu/cpu/saturn/satops.inc4
-rw-r--r--src/emu/cpu/saturn/saturn.h2
-rw-r--r--src/emu/cpu/sc61860/scops.inc8
-rw-r--r--src/emu/cpu/scmp/scmp.c4
-rw-r--r--src/emu/cpu/score/score.c2
-rw-r--r--src/emu/cpu/score/score.h2
-rw-r--r--src/emu/cpu/se3208/se3208.c2
-rw-r--r--src/emu/cpu/sh2/sh2.c151
-rw-r--r--src/emu/cpu/sh2/sh2.h50
-rw-r--r--src/emu/cpu/sh2/sh2comn.c144
-rw-r--r--src/emu/cpu/sh2/sh2drc.c13
-rw-r--r--src/emu/cpu/sh2/sh2fe.c2
-rw-r--r--src/emu/cpu/sh4/sh4.c14
-rw-r--r--src/emu/cpu/sharc/sharc.c2
-rw-r--r--src/emu/cpu/sm510/sm510.c376
-rw-r--r--src/emu/cpu/sm510/sm510.h307
-rw-r--r--src/emu/cpu/sm510/sm510core.c136
-rw-r--r--src/emu/cpu/sm510/sm510d.c215
-rw-r--r--src/emu/cpu/sm510/sm510op.c456
-rw-r--r--src/emu/cpu/sm510/sm511core.c162
-rw-r--r--src/emu/cpu/sm8500/sm8500.h2
-rw-r--r--src/emu/cpu/sm8500/sm8500d.c4
-rw-r--r--src/emu/cpu/ssem/ssem.h2
-rw-r--r--src/emu/cpu/ssp1601/ssp1601.c86
-rw-r--r--src/emu/cpu/ssp1601/ssp1601.h4
-rw-r--r--src/emu/cpu/superfx/superfx.h4
-rw-r--r--src/emu/cpu/t11/t11.c2
-rw-r--r--src/emu/cpu/tlcs90/tlcs90.c4
-rw-r--r--src/emu/cpu/tlcs900/900tbl.inc2
-rw-r--r--src/emu/cpu/tlcs900/dasm900.c2
-rw-r--r--src/emu/cpu/tms0980/tms0980.c19
-rw-r--r--src/emu/cpu/tms32010/tms32010.c4
-rw-r--r--src/emu/cpu/tms32025/tms32025.c4
-rw-r--r--src/emu/cpu/tms32031/tms32031.c2
-rw-r--r--src/emu/cpu/tms32031/tms32031.h2
-rw-r--r--src/emu/cpu/tms32051/tms32051.c4
-rw-r--r--src/emu/cpu/tms32082/tms32082.c2
-rw-r--r--src/emu/cpu/tms32082/tms32082.h6
-rw-r--r--src/emu/cpu/tms34010/34010ops.c6
-rw-r--r--src/emu/cpu/tms34010/tms34010.c10
-rw-r--r--src/emu/cpu/tms57002/tms57002.h2
-rw-r--r--src/emu/cpu/tms7000/tms7000.c2
-rw-r--r--src/emu/cpu/tms7000/tms7000.h4
-rw-r--r--src/emu/cpu/tms9900/9900dasm.c2
-rw-r--r--src/emu/cpu/tms9900/99xxcore.h2
-rw-r--r--src/emu/cpu/ucom4/ucom4.c12
-rw-r--r--src/emu/cpu/ucom4/ucom4.h8
-rw-r--r--src/emu/cpu/ucom4/ucom4op.c (renamed from src/emu/cpu/ucom4/ucom4op.inc)3
-rw-r--r--src/emu/cpu/uml.h2
-rw-r--r--src/emu/cpu/unsp/unsp.h2
-rw-r--r--src/emu/cpu/upd7725/upd7725.c2
-rw-r--r--src/emu/cpu/upd7810/upd7810_macros.h4
-rw-r--r--src/emu/cpu/v30mz/v30mz.c4
-rw-r--r--src/emu/cpu/v60/v60.c20
-rw-r--r--src/emu/cpu/v810/v810.c2
-rw-r--r--src/emu/cpu/x86emit.h2
-rw-r--r--src/emu/cpu/z180/z180.c15
-rw-r--r--src/emu/cpu/z180/z180.h5
-rw-r--r--src/emu/cpu/z180/z180dd.inc2
-rw-r--r--src/emu/cpu/z180/z180ed.inc2
-rw-r--r--src/emu/cpu/z180/z180ops.h6
-rw-r--r--src/emu/cpu/z8/z8.c2
-rw-r--r--src/emu/cpu/z8/z8.h252
-rw-r--r--src/emu/cpu/z8/z8ops.inc4
-rw-r--r--src/emu/cpu/z80/z80.c25
-rw-r--r--src/emu/cpu/z80/z80.h19
-rw-r--r--src/emu/cpu/z8000/z8000ops.inc3
-rw-r--r--src/emu/cpu/z8000/z8000tbl.inc4
-rw-r--r--src/emu/debug/debugcmd.c18
-rw-r--r--src/emu/debug/debugcpu.c40
-rw-r--r--src/emu/debug/debugcpu.h2
-rw-r--r--src/emu/debug/dvdisasm.c21
-rw-r--r--src/emu/debug/dvdisasm.h1
-rw-r--r--src/emu/devcpu.h1
-rw-r--r--src/emu/devdelegate.h4
-rw-r--r--src/emu/dimemory.c9
-rw-r--r--src/emu/dimemory.h8
-rw-r--r--src/emu/drivers/testcpu.c4
-rw-r--r--src/emu/drivers/xtal.h1
-rw-r--r--src/emu/emuopts.c7
-rw-r--r--src/emu/emuopts.h12
-rw-r--r--src/emu/imagedev/floppy.c31
-rw-r--r--src/emu/imagedev/floppy.h3
-rw-r--r--src/emu/imagedev/harddriv.c2
-rw-r--r--src/emu/imagedev/harddriv.h2
-rw-r--r--src/emu/info.c17
-rw-r--r--src/emu/ioport.c2
-rw-r--r--src/emu/ioport.h2
-rw-r--r--src/emu/machine/53c7xx.h8
-rw-r--r--src/emu/machine/64h156.c2
-rw-r--r--src/emu/machine/6532riot.c25
-rw-r--r--src/emu/machine/6532riot.h7
-rw-r--r--src/emu/machine/6821pia.c2
-rw-r--r--src/emu/machine/68307.c2
-rw-r--r--src/emu/machine/6840ptm.c2
-rw-r--r--src/emu/machine/6840ptm.h2
-rw-r--r--src/emu/machine/6850acia.c2
-rw-r--r--src/emu/machine/6850acia.h2
-rw-r--r--src/emu/machine/68561mpcc.c6
-rw-r--r--src/emu/machine/68561mpcc.h4
-rw-r--r--src/emu/machine/8530scc.h2
-rw-r--r--src/emu/machine/at29040a.c2
-rw-r--r--src/emu/machine/at29040a.h2
-rw-r--r--src/emu/machine/corvushd.c2
-rw-r--r--src/emu/machine/corvushd.h2
-rw-r--r--src/emu/machine/eeprompar.c2
-rw-r--r--src/emu/machine/eepromser.c2
-rw-r--r--src/emu/machine/hd64610.c2
-rw-r--r--src/emu/machine/hdc9234.c1396
-rw-r--r--src/emu/machine/hdc9234.h66
-rw-r--r--src/emu/machine/i8255.c2
-rw-r--r--src/emu/machine/i8257.c2
-rw-r--r--src/emu/machine/idehd.c11
-rw-r--r--src/emu/machine/idehd.h2
-rw-r--r--src/emu/machine/ins8250.h2
-rw-r--r--src/emu/machine/k053252.c11
-rw-r--r--src/emu/machine/mc146818.h2
-rw-r--r--src/emu/machine/mc68681.c14
-rw-r--r--src/emu/machine/mcf5206e.c112
-rw-r--r--src/emu/machine/microtch.c2
-rw-r--r--src/emu/machine/mm58274c.c4
-rw-r--r--src/emu/machine/mm58274c.h2
-rw-r--r--src/emu/machine/mos6526.c10
-rw-r--r--src/emu/machine/ncr5380n.h8
-rw-r--r--src/emu/machine/ncr5390.h8
-rw-r--r--src/emu/machine/netlist.c77
-rw-r--r--src/emu/machine/netlist.h144
-rw-r--r--src/emu/machine/nmc9306.c2
-rw-r--r--src/emu/machine/nscsi_bus.h20
-rw-r--r--src/emu/machine/pit8253.c2
-rw-r--r--src/emu/machine/rtc65271.c2
-rw-r--r--src/emu/machine/rtc65271.h2
-rw-r--r--src/emu/machine/rtc9701.h2
-rw-r--r--src/emu/machine/saturn.c5
-rw-r--r--src/emu/machine/smc92x4.c2011
-rw-r--r--src/emu/machine/smc92x4.h231
-rw-r--r--src/emu/machine/smpc.c4
-rw-r--r--src/emu/machine/spchrom.c2
-rw-r--r--src/emu/machine/spchrom.h2
-rw-r--r--src/emu/machine/strata.c2
-rw-r--r--src/emu/machine/strata.h2
-rw-r--r--src/emu/machine/t10mmc.h2
-rw-r--r--src/emu/machine/t10spc.h2
-rw-r--r--src/emu/machine/ti99_hd.c1357
-rw-r--r--src/emu/machine/ti99_hd.h291
-rw-r--r--src/emu/machine/tms1024.c8
-rw-r--r--src/emu/machine/tms1024.h2
-rw-r--r--src/emu/machine/tms6100.c12
-rw-r--r--src/emu/machine/tms6100.h1
-rw-r--r--src/emu/machine/tms9902.c2
-rw-r--r--src/emu/machine/upd765.c6
-rw-r--r--src/emu/machine/upd765.h6
-rw-r--r--src/emu/machine/vrc4373.c45
-rw-r--r--src/emu/machine/wd17xx.c2107
-rw-r--r--src/emu/machine/wd17xx.h401
-rw-r--r--src/emu/machine/wd_fdc.c143
-rw-r--r--src/emu/machine/wd_fdc.h146
-rw-r--r--src/emu/machine/x76f041.h2
-rw-r--r--src/emu/machine/z80dart.h10
-rw-r--r--src/emu/mconfig.c1
-rw-r--r--src/emu/mconfig.h8
-rw-r--r--src/emu/memory.c126
-rw-r--r--src/emu/memory.h115
-rw-r--r--src/emu/netlist/analog/nld_bjt.c114
-rw-r--r--src/emu/netlist/analog/nld_bjt.h47
-rw-r--r--src/emu/netlist/analog/nld_fourterm.c67
-rw-r--r--src/emu/netlist/analog/nld_fourterm.h91
-rw-r--r--src/emu/netlist/analog/nld_ms_jakobi.h362
-rw-r--r--src/emu/netlist/analog/nld_ms_sor.h202
-rw-r--r--src/emu/netlist/analog/nld_ms_sor_mat.h305
-rw-r--r--src/emu/netlist/analog/nld_opamps.c118
-rw-r--r--src/emu/netlist/analog/nld_opamps.h33
-rw-r--r--src/emu/netlist/analog/nld_switches.c6
-rw-r--r--src/emu/netlist/analog/nld_switches.h12
-rw-r--r--src/emu/netlist/analog/nld_twoterm.c95
-rw-r--r--src/emu/netlist/analog/nld_twoterm.h157
-rw-r--r--src/emu/netlist/devices/net_lib.c56
-rw-r--r--src/emu/netlist/devices/net_lib.h16
-rw-r--r--src/emu/netlist/devices/nld_4020.c67
-rw-r--r--src/emu/netlist/devices/nld_4020.h31
-rw-r--r--src/emu/netlist/devices/nld_4066.c78
-rw-r--r--src/emu/netlist/devices/nld_4066.h27
-rw-r--r--src/emu/netlist/devices/nld_7400.c20
-rw-r--r--src/emu/netlist/devices/nld_7400.h15
-rw-r--r--src/emu/netlist/devices/nld_7402.c20
-rw-r--r--src/emu/netlist/devices/nld_7402.h10
-rw-r--r--src/emu/netlist/devices/nld_7404.c49
-rw-r--r--src/emu/netlist/devices/nld_7404.h26
-rw-r--r--src/emu/netlist/devices/nld_7408.c20
-rw-r--r--src/emu/netlist/devices/nld_7408.h13
-rw-r--r--src/emu/netlist/devices/nld_7410.c22
-rw-r--r--src/emu/netlist/devices/nld_7410.h14
-rw-r--r--src/emu/netlist/devices/nld_74107.c6
-rw-r--r--src/emu/netlist/devices/nld_74107.h20
-rw-r--r--src/emu/netlist/devices/nld_7411.c22
-rw-r--r--src/emu/netlist/devices/nld_7411.h13
-rw-r--r--src/emu/netlist/devices/nld_74123.c117
-rw-r--r--src/emu/netlist/devices/nld_74123.h56
-rw-r--r--src/emu/netlist/devices/nld_74153.c4
-rw-r--r--src/emu/netlist/devices/nld_74153.h22
-rw-r--r--src/emu/netlist/devices/nld_74175.c6
-rw-r--r--src/emu/netlist/devices/nld_74175.h17
-rw-r--r--src/emu/netlist/devices/nld_74192.c6
-rw-r--r--src/emu/netlist/devices/nld_74192.h22
-rw-r--r--src/emu/netlist/devices/nld_74193.c4
-rw-r--r--src/emu/netlist/devices/nld_74193.h30
-rw-r--r--src/emu/netlist/devices/nld_7420.c20
-rw-r--r--src/emu/netlist/devices/nld_7420.h14
-rw-r--r--src/emu/netlist/devices/nld_7425.c20
-rw-r--r--src/emu/netlist/devices/nld_7425.h12
-rw-r--r--src/emu/netlist/devices/nld_7427.c22
-rw-r--r--src/emu/netlist/devices/nld_7427.h16
-rw-r--r--src/emu/netlist/devices/nld_74279.c24
-rw-r--r--src/emu/netlist/devices/nld_74279.h9
-rw-r--r--src/emu/netlist/devices/nld_7430.c20
-rw-r--r--src/emu/netlist/devices/nld_7430.h15
-rw-r--r--src/emu/netlist/devices/nld_7432.c20
-rw-r--r--src/emu/netlist/devices/nld_7432.h15
-rw-r--r--src/emu/netlist/devices/nld_7437.c20
-rw-r--r--src/emu/netlist/devices/nld_7437.h14
-rw-r--r--src/emu/netlist/devices/nld_7448.c6
-rw-r--r--src/emu/netlist/devices/nld_7448.h26
-rw-r--r--src/emu/netlist/devices/nld_7450.c4
-rw-r--r--src/emu/netlist/devices/nld_7450.h18
-rw-r--r--src/emu/netlist/devices/nld_7474.c9
-rw-r--r--src/emu/netlist/devices/nld_7474.h20
-rw-r--r--src/emu/netlist/devices/nld_7483.c4
-rw-r--r--src/emu/netlist/devices/nld_7483.h36
-rw-r--r--src/emu/netlist/devices/nld_7486.c108
-rw-r--r--src/emu/netlist/devices/nld_7486.h23
-rw-r--r--src/emu/netlist/devices/nld_7490.c36
-rw-r--r--src/emu/netlist/devices/nld_7490.h21
-rw-r--r--src/emu/netlist/devices/nld_7493.c20
-rw-r--r--src/emu/netlist/devices/nld_7493.h17
-rw-r--r--src/emu/netlist/devices/nld_74ls629.c18
-rw-r--r--src/emu/netlist/devices/nld_74ls629.h18
-rw-r--r--src/emu/netlist/devices/nld_82S16.c4
-rw-r--r--src/emu/netlist/devices/nld_82S16.h22
-rw-r--r--src/emu/netlist/devices/nld_9310.c8
-rw-r--r--src/emu/netlist/devices/nld_9310.h36
-rw-r--r--src/emu/netlist/devices/nld_9312.c31
-rw-r--r--src/emu/netlist/devices/nld_9312.h17
-rw-r--r--src/emu/netlist/devices/nld_9316.c8
-rw-r--r--src/emu/netlist/devices/nld_9316.h36
-rw-r--r--src/emu/netlist/devices/nld_cmos.h16
-rw-r--r--src/emu/netlist/devices/nld_legacy.c11
-rw-r--r--src/emu/netlist/devices/nld_legacy.h23
-rw-r--r--src/emu/netlist/devices/nld_log.c4
-rw-r--r--src/emu/netlist/devices/nld_log.h14
-rw-r--r--src/emu/netlist/devices/nld_mm5837.c82
-rw-r--r--src/emu/netlist/devices/nld_mm5837.h54
-rw-r--r--src/emu/netlist/devices/nld_ne555.c13
-rw-r--r--src/emu/netlist/devices/nld_ne555.h12
-rw-r--r--src/emu/netlist/devices/nld_r2r_dac.c4
-rw-r--r--src/emu/netlist/devices/nld_r2r_dac.h14
-rw-r--r--src/emu/netlist/devices/nld_signal.h34
-rw-r--r--src/emu/netlist/devices/nld_system.c135
-rw-r--r--src/emu/netlist/devices/nld_system.h326
-rw-r--r--src/emu/netlist/devices/nld_truthtable.c18
-rw-r--r--src/emu/netlist/devices/nld_truthtable.h130
-rw-r--r--src/emu/netlist/macro/nlm_cd4xxx.c172
-rw-r--r--src/emu/netlist/macro/nlm_cd4xxx.h50
-rw-r--r--src/emu/netlist/macro/nlm_opamp.c47
-rw-r--r--src/emu/netlist/macro/nlm_opamp.h23
-rw-r--r--src/emu/netlist/macro/nlm_ttl74xx.c56
-rw-r--r--src/emu/netlist/macro/nlm_ttl74xx.h26
-rw-r--r--src/emu/netlist/nl_base.c535
-rw-r--r--src/emu/netlist/nl_base.h1743
-rw-r--r--src/emu/netlist/nl_config.h68
-rw-r--r--src/emu/netlist/nl_dice_compat.h14
-rw-r--r--src/emu/netlist/nl_factory.c30
-rw-r--r--src/emu/netlist/nl_factory.h135
-rw-r--r--src/emu/netlist/nl_lists.h197
-rw-r--r--src/emu/netlist/nl_parser.c213
-rw-r--r--src/emu/netlist/nl_parser.h205
-rw-r--r--src/emu/netlist/nl_setup.c543
-rw-r--r--src/emu/netlist/nl_setup.h323
-rw-r--r--src/emu/netlist/nl_time.h151
-rw-r--r--src/emu/netlist/nl_util.h20
-rw-r--r--src/emu/netlist/plib/palloc.c24
-rw-r--r--src/emu/netlist/plib/palloc.h76
-rw-r--r--src/emu/netlist/plib/pconfig.h142
-rw-r--r--src/emu/netlist/plib/plists.h350
-rw-r--r--src/emu/netlist/plib/pparser.c25
-rw-r--r--src/emu/netlist/plib/pparser.h13
-rw-r--r--src/emu/netlist/plib/pstate.c5
-rw-r--r--src/emu/netlist/plib/pstate.h23
-rw-r--r--src/emu/netlist/plib/pstring.c18
-rw-r--r--src/emu/netlist/plib/pstring.h61
-rw-r--r--src/emu/netlist/solver/mat_cr.h135
-rw-r--r--src/emu/netlist/solver/nld_ms_direct.h (renamed from src/emu/netlist/analog/nld_ms_direct.h)329
-rw-r--r--src/emu/netlist/solver/nld_ms_direct1.h (renamed from src/emu/netlist/analog/nld_ms_direct1.h)25
-rw-r--r--src/emu/netlist/solver/nld_ms_direct2.h (renamed from src/emu/netlist/analog/nld_ms_direct2.h)28
-rw-r--r--src/emu/netlist/solver/nld_ms_gmres.h426
-rw-r--r--src/emu/netlist/solver/nld_ms_sor.h196
-rw-r--r--src/emu/netlist/solver/nld_ms_sor_mat.h241
-rw-r--r--src/emu/netlist/solver/nld_solver.c (renamed from src/emu/netlist/analog/nld_solver.c)228
-rw-r--r--src/emu/netlist/solver/nld_solver.h (renamed from src/emu/netlist/analog/nld_solver.h)119
-rw-r--r--src/emu/netlist/solver/vector_base.h108
-rw-r--r--src/emu/netlist/tools/nl_convert.c457
-rw-r--r--src/emu/netlist/tools/nl_convert.h453
-rw-r--r--src/emu/profiler.h2
-rw-r--r--src/emu/rendersw.inc22
-rw-r--r--src/emu/rendlay.c5
-rw-r--r--src/emu/rendlay.h2
-rw-r--r--src/emu/save.h30
-rw-r--r--src/emu/schedule.h2
-rw-r--r--src/emu/screen.c3
-rw-r--r--src/emu/screen.h43
-rw-r--r--src/emu/softlist.c7
-rw-r--r--src/emu/sound.c8
-rw-r--r--src/emu/sound/ay8910.c6
-rw-r--r--src/emu/sound/bsmt2000.c2
-rw-r--r--src/emu/sound/c352.c6
-rw-r--r--src/emu/sound/c352.h8
-rw-r--r--src/emu/sound/disc_sys.inc5
-rw-r--r--src/emu/sound/discrete.c3
-rw-r--r--src/emu/sound/discrete.h2
-rw-r--r--src/emu/sound/es5503.c7
-rw-r--r--src/emu/sound/ics2115.c108
-rw-r--r--src/emu/sound/ics2115.h6
-rw-r--r--src/emu/sound/multipcm.c4
-rw-r--r--src/emu/sound/n63701x.c10
-rw-r--r--src/emu/sound/okim6295.c14
-rw-r--r--src/emu/sound/okim9810.c36
-rw-r--r--src/emu/sound/okim9810.h2
-rw-r--r--src/emu/sound/pokey.c4
-rw-r--r--src/emu/sound/pokey.h2
-rw-r--r--src/emu/sound/qs1000.c44
-rw-r--r--src/emu/sound/qs1000.h2
-rw-r--r--src/emu/sound/rf5c400.c4
-rw-r--r--src/emu/sound/saa1099.c32
-rw-r--r--src/emu/sound/saa1099.h1
-rw-r--r--src/emu/sound/sn76496.c44
-rw-r--r--src/emu/sound/sn76496.h41
-rw-r--r--src/emu/sound/spu.h2
-rw-r--r--src/emu/sound/st0016.c5
-rw-r--r--src/emu/sound/tms36xx.c15
-rw-r--r--src/emu/sound/tms5110.c125
-rw-r--r--src/emu/sound/tms5110.h40
-rw-r--r--src/emu/sound/tms5110r.inc744
-rw-r--r--src/emu/sound/tms5220.c8
-rw-r--r--src/emu/sound/tms5220.h2
-rw-r--r--src/emu/sound/x1_010.c10
-rw-r--r--src/emu/sound/ymf278b.c25
-rw-r--r--src/emu/sound/ymf278b.h1
-rw-r--r--src/emu/sound/zsg2.c8
-rw-r--r--src/emu/ui/filesel.c3
-rw-r--r--src/emu/ui/imgcntrl.c1
-rw-r--r--src/emu/ui/mainmenu.h2
-rw-r--r--src/emu/ui/swlist.h2
-rw-r--r--src/emu/ui/ui.c41
-rw-r--r--src/emu/validity.c18
-rw-r--r--src/emu/validity.h2
-rw-r--r--src/emu/video/315_5124.c9
-rw-r--r--src/emu/video/clgd542x.c133
-rw-r--r--src/emu/video/clgd542x.h2
-rw-r--r--src/emu/video/crt9007.c2
-rw-r--r--src/emu/video/hd44780.h5
-rw-r--r--src/emu/video/i82730.c527
-rw-r--r--src/emu/video/i82730.h157
-rw-r--r--src/emu/video/i8275.c4
-rw-r--r--src/emu/video/mb_vcu.c18
-rw-r--r--src/emu/video/mc6845.c8
-rw-r--r--src/emu/video/mc6845.h5
-rw-r--r--src/emu/video/mc6847.c16
-rw-r--r--src/emu/video/mc6847.h4
-rw-r--r--src/emu/video/pc_vga.c16
-rw-r--r--src/emu/video/pc_vga.h2
-rw-r--r--src/emu/video/rgbgen.c136
-rw-r--r--src/emu/video/rgbgen.h942
-rw-r--r--src/emu/video/rgbsse.c (renamed from src/emu/video/rgbutil.c)192
-rw-r--r--src/emu/video/rgbsse.h895
-rw-r--r--src/emu/video/rgbvmx.c220
-rw-r--r--src/emu/video/rgbvmx.h890
-rw-r--r--src/emu/video/tms3556.c2
-rw-r--r--src/emu/video/tms3556.h2
-rw-r--r--src/emu/video/tms9928a.c28
-rw-r--r--src/emu/video/tms9928a.h21
-rw-r--r--src/emu/video/v9938.c682
-rw-r--r--src/emu/video/v9938.h49
-rw-r--r--src/emu/video/vooddefs.h1459
-rw-r--r--src/emu/video/voodoo.c197
-rw-r--r--src/lib/formats/2d_dsk.c41
-rw-r--r--src/lib/formats/2d_dsk.h33
-rw-r--r--src/lib/formats/ap2_dsk.c5
-rw-r--r--src/lib/formats/apridisk.c271
-rw-r--r--src/lib/formats/apridisk.h48
-rw-r--r--src/lib/formats/atarist_dsk.c86
-rw-r--r--src/lib/formats/atarist_dsk.h20
-rw-r--r--src/lib/formats/camplynx_cas.c15
-rw-r--r--src/lib/formats/cd90_640_dsk.c56
-rw-r--r--src/lib/formats/cd90_640_dsk.h33
-rw-r--r--src/lib/formats/cgenie_dsk.c10
-rw-r--r--src/lib/formats/cgenie_dsk.h4
-rw-r--r--src/lib/formats/cpis_dsk.c99
-rw-r--r--src/lib/formats/cpis_dsk.h8
-rw-r--r--src/lib/formats/d64_dsk.h2
-rw-r--r--src/lib/formats/flopimg.c5
-rw-r--r--src/lib/formats/flopimg.h8
-rw-r--r--src/lib/formats/g64_dsk.c113
-rw-r--r--src/lib/formats/g64_dsk.h20
-rw-r--r--src/lib/formats/guab_dsk.c42
-rw-r--r--src/lib/formats/guab_dsk.h33
-rw-r--r--src/lib/formats/hect_dsk.c32
-rw-r--r--src/lib/formats/hect_tap.c2
-rw-r--r--src/lib/formats/hector_minidisc.c41
-rw-r--r--src/lib/formats/hector_minidisc.h33
-rw-r--r--src/lib/formats/jvc_dsk.c174
-rw-r--r--src/lib/formats/jvc_dsk.h50
-rw-r--r--src/lib/formats/m20_dsk.c166
-rw-r--r--src/lib/formats/m20_dsk.h7
-rw-r--r--src/lib/formats/msx_dsk.c22
-rw-r--r--src/lib/formats/msx_dsk.h11
-rw-r--r--src/lib/formats/pk8020_dsk.c44
-rw-r--r--src/lib/formats/pk8020_dsk.h33
-rw-r--r--src/lib/formats/svi_dsk.c232
-rw-r--r--src/lib/formats/svi_dsk.h37
-rw-r--r--src/lib/formats/ti99_dsk.c2000
-rw-r--r--src/lib/formats/ti99_dsk.h12
-rw-r--r--src/lib/formats/trs80_dsk.c55
-rw-r--r--src/lib/formats/trs80_dsk.h36
-rw-r--r--src/lib/formats/trs_dsk.c80
-rw-r--r--src/lib/formats/trs_dsk.h20
-rw-r--r--src/lib/formats/vdk_dsk.c143
-rw-r--r--src/lib/formats/vdk_dsk.h42
-rw-r--r--src/lib/formats/vector06_dsk.c44
-rw-r--r--src/lib/formats/vector06_dsk.h33
-rw-r--r--src/lib/formats/vtech1_dsk.c41
-rw-r--r--src/lib/formats/vtech1_dsk.h18
-rw-r--r--src/lib/formats/wd177x_dsk.c17
-rw-r--r--src/lib/formats/wd177x_dsk.h5
-rw-r--r--src/lib/util/avhuff.c256
-rw-r--r--src/lib/util/aviio.c909
-rw-r--r--src/lib/util/bitmap.c166
-rw-r--r--src/lib/util/cdrom.c423
-rw-r--r--src/lib/util/chd.c1073
-rw-r--r--src/lib/util/chdcd.c159
-rw-r--r--src/lib/util/chdcodec.c168
-rw-r--r--src/lib/util/corealloc.c14
-rw-r--r--src/lib/util/corefile.c14
-rw-r--r--src/lib/util/corestr.c22
-rw-r--r--src/lib/util/coreutil.c21
-rw-r--r--src/lib/util/cstrpool.c26
-rw-r--r--src/lib/util/delegate.c17
-rw-r--r--src/lib/util/delegate.h75
-rw-r--r--src/lib/util/flac.c15
-rw-r--r--src/lib/util/harddisk.c34
-rw-r--r--src/lib/util/hashing.c30
-rw-r--r--src/lib/util/huffman.c18
-rw-r--r--src/lib/util/jedparse.c12
-rw-r--r--src/lib/util/md5.c10
-rw-r--r--src/lib/util/opresolv.c21
-rw-r--r--src/lib/util/options.c34
-rw-r--r--src/lib/util/palette.c15
-rw-r--r--src/lib/util/plaparse.c12
-rw-r--r--src/lib/util/png.c36
-rw-r--r--src/lib/util/pool.c8
-rw-r--r--src/lib/util/sha1.c54
-rw-r--r--src/lib/util/tagmap.c2
-rw-r--r--src/lib/util/un7z.c8
-rw-r--r--src/lib/util/unicode.c20
-rw-r--r--src/lib/util/unzip.c154
-rw-r--r--src/lib/util/vbiparse.c32
-rw-r--r--src/lib/util/xmlfile.c174
-rw-r--r--src/lib/util/zippath.c250
-rw-r--r--src/mame/arcade.lst172
-rw-r--r--src/mame/audio/cclimber.c4
-rw-r--r--src/mame/audio/depthch.c2
-rw-r--r--src/mame/audio/geebee.c9
-rw-r--r--src/mame/audio/irem.c214
-rw-r--r--src/mame/audio/irem.h19
-rw-r--r--src/mame/audio/m79amb.c2
-rw-r--r--src/mame/audio/mario.c16
-rw-r--r--src/mame/audio/micro3d.c24
-rw-r--r--src/mame/audio/nl_kidniki.c484
-rw-r--r--src/mame/audio/poolshrk.c8
-rw-r--r--src/mame/audio/seibu.c100
-rw-r--r--src/mame/audio/seibu.h27
-rw-r--r--src/mame/audio/spacefb.c8
-rw-r--r--src/mame/audio/suna8.c43
-rw-r--r--src/mame/audio/taito_zm.c8
-rw-r--r--src/mame/audio/turrett.c2
-rw-r--r--src/mame/audio/tx1.c4
-rw-r--r--src/mame/audio/vicdual.c6
-rw-r--r--src/mame/audio/warpwarp.c8
-rw-r--r--src/mame/audio/warpwarp.h2
-rw-r--r--src/mame/drivers/3x3puzzl.c2
-rw-r--r--src/mame/drivers/8080bw.c40
-rw-r--r--src/mame/drivers/acesp.c22
-rw-r--r--src/mame/drivers/aerofgt.c142
-rw-r--r--src/mame/drivers/aleck64.c17
-rw-r--r--src/mame/drivers/aleisttl.c11
-rw-r--r--src/mame/drivers/alpha68k.c4
-rw-r--r--src/mame/drivers/angelkds.c21
-rw-r--r--src/mame/drivers/appoooh.c73
-rw-r--r--src/mame/drivers/argus.c2
-rw-r--r--src/mame/drivers/arkanoid.c67
-rw-r--r--src/mame/drivers/armedf.c2
-rw-r--r--src/mame/drivers/asuka.c2
-rw-r--r--src/mame/drivers/atarisy2.c80
-rw-r--r--src/mame/drivers/atarittl.c134
-rw-r--r--src/mame/drivers/bailey.c3
-rw-r--r--src/mame/drivers/battlera.c38
-rw-r--r--src/mame/drivers/bbusters.c71
-rw-r--r--src/mame/drivers/bfcobra.c80
-rw-r--r--src/mame/drivers/bionicc.c43
-rw-r--r--src/mame/drivers/bmcpokr.c388
-rw-r--r--src/mame/drivers/boogwing.c6
-rw-r--r--src/mame/drivers/bublbobl.c2
-rw-r--r--src/mame/drivers/cabal.c38
-rw-r--r--src/mame/drivers/calorie.c18
-rw-r--r--src/mame/drivers/cbasebal.c17
-rw-r--r--src/mame/drivers/cclimber.c236
-rw-r--r--src/mame/drivers/cdi.c163
-rw-r--r--src/mame/drivers/cheekyms.c2
-rw-r--r--src/mame/drivers/chihiro.c861
-rw-r--r--src/mame/drivers/chinsan.c19
-rw-r--r--src/mame/drivers/chsuper.c65
-rw-r--r--src/mame/drivers/circusc.c3
-rw-r--r--src/mame/drivers/cobra.c12
-rw-r--r--src/mame/drivers/commando.c49
-rw-r--r--src/mame/drivers/coolridr.c267
-rw-r--r--src/mame/drivers/cps1.c58
-rw-r--r--src/mame/drivers/cps2.c654
-rw-r--r--src/mame/drivers/cps3.c57
-rw-r--r--src/mame/drivers/crimfght.c2
-rw-r--r--src/mame/drivers/cshooter.c34
-rw-r--r--src/mame/drivers/csplayh5.c1
-rw-r--r--src/mame/drivers/cv1k.c4
-rw-r--r--src/mame/drivers/darkmist.c21
-rw-r--r--src/mame/drivers/darkseal.c32
-rw-r--r--src/mame/drivers/dblewing.c11
-rw-r--r--src/mame/drivers/ddragon3.c2
-rw-r--r--src/mame/drivers/deadang.c3
-rw-r--r--src/mame/drivers/deco32.c322
-rw-r--r--src/mame/drivers/dietgo.c7
-rw-r--r--src/mame/drivers/dmndrby.c2
-rw-r--r--src/mame/drivers/dreamwld.c278
-rw-r--r--src/mame/drivers/dynax.c98
-rw-r--r--src/mame/drivers/dynduke.c2
-rw-r--r--src/mame/drivers/electra.c13
-rw-r--r--src/mame/drivers/exidy.c4
-rw-r--r--src/mame/drivers/exidyttl.c11
-rw-r--r--src/mame/drivers/expro02.c27
-rw-r--r--src/mame/drivers/exzisus.c2
-rw-r--r--src/mame/drivers/finalizr.c3
-rw-r--r--src/mame/drivers/firebeat.c1124
-rw-r--r--src/mame/drivers/firefox.c4
-rw-r--r--src/mame/drivers/fortecar.c16
-rw-r--r--src/mame/drivers/freekick.c80
-rw-r--r--src/mame/drivers/fungames.c2
-rw-r--r--src/mame/drivers/funworld.c6
-rw-r--r--src/mame/drivers/galaga.c15
-rw-r--r--src/mame/drivers/galaxian.c74
-rw-r--r--src/mame/drivers/gambl186.c13
-rw-r--r--src/mame/drivers/gameplan.c2
-rw-r--r--src/mame/drivers/gaplus.c85
-rw-r--r--src/mame/drivers/gcpinbal.c2
-rw-r--r--src/mame/drivers/gei.c2
-rw-r--r--src/mame/drivers/ghosteo.c2
-rw-r--r--src/mame/drivers/gladiatr.c17
-rw-r--r--src/mame/drivers/goldstar.c176
-rw-r--r--src/mame/drivers/gpworld.c2
-rw-r--r--src/mame/drivers/gradius3.c52
-rw-r--r--src/mame/drivers/grchamp.c49
-rw-r--r--src/mame/drivers/groundfx.c2
-rw-r--r--src/mame/drivers/gstriker.c64
-rw-r--r--src/mame/drivers/guab.c473
-rw-r--r--src/mame/drivers/gunbustr.c2
-rw-r--r--src/mame/drivers/gyruss.c3
-rw-r--r--src/mame/drivers/hexion.c30
-rw-r--r--src/mame/drivers/hyperspt.c3
-rw-r--r--src/mame/drivers/igs017.c18
-rw-r--r--src/mame/drivers/itech8.c160
-rw-r--r--src/mame/drivers/jack.c27
-rw-r--r--src/mame/drivers/jailbrek.c4
-rw-r--r--src/mame/drivers/jankenmn.c92
-rw-r--r--src/mame/drivers/jongkyo.c47
-rw-r--r--src/mame/drivers/jpmsys5.c2
-rw-r--r--src/mame/drivers/junofrst.c5
-rw-r--r--src/mame/drivers/kchamp.c30
-rw-r--r--src/mame/drivers/kurukuru.c1
-rw-r--r--src/mame/drivers/ladybug.c26
-rw-r--r--src/mame/drivers/lastduel.c1
-rw-r--r--src/mame/drivers/legionna.c2
-rw-r--r--src/mame/drivers/liberate.c264
-rw-r--r--src/mame/drivers/lindbergh.c2
-rw-r--r--src/mame/drivers/m107.c29
-rw-r--r--src/mame/drivers/m62.c3
-rw-r--r--src/mame/drivers/madmotor.c47
-rw-r--r--src/mame/drivers/mario.c2
-rw-r--r--src/mame/drivers/maygayv1.c4
-rw-r--r--src/mame/drivers/mazerbla.c20
-rw-r--r--src/mame/drivers/meadwttl.c4
-rw-r--r--src/mame/drivers/megasys1.c153
-rw-r--r--src/mame/drivers/megatech.c8
-rw-r--r--src/mame/drivers/megazone.c3
-rw-r--r--src/mame/drivers/meritm.c49
-rw-r--r--src/mame/drivers/mitchell.c84
-rw-r--r--src/mame/drivers/model1.c15
-rw-r--r--src/mame/drivers/model2.c2
-rw-r--r--src/mame/drivers/model3.c106
-rw-r--r--src/mame/drivers/mouser.c20
-rw-r--r--src/mame/drivers/mpu4hw.c2
-rw-r--r--src/mame/drivers/multigam.c22
-rw-r--r--src/mame/drivers/mustache.c13
-rw-r--r--src/mame/drivers/namcos86.c318
-rw-r--r--src/mame/drivers/naomi.c239
-rw-r--r--src/mame/drivers/naughtyb.c36
-rw-r--r--src/mame/drivers/nbmj8991.c110
-rw-r--r--src/mame/drivers/nbmj9195.c602
-rw-r--r--src/mame/drivers/ninjakd2.c25
-rw-r--r--src/mame/drivers/ninjaw.c2
-rw-r--r--src/mame/drivers/nl_breakout.c4
-rw-r--r--src/mame/drivers/nl_pong.c8
-rw-r--r--src/mame/drivers/nmk16.c76
-rw-r--r--src/mame/drivers/nss.c8
-rw-r--r--src/mame/drivers/nycaptor.c11
-rw-r--r--src/mame/drivers/othunder.c2
-rw-r--r--src/mame/drivers/pacland.c47
-rw-r--r--src/mame/drivers/pacman.c77
-rw-r--r--src/mame/drivers/paradise.c100
-rw-r--r--src/mame/drivers/pbaction.c55
-rw-r--r--src/mame/drivers/pcktgal.c52
-rw-r--r--src/mame/drivers/pengo.c70
-rw-r--r--src/mame/drivers/peplus.c835
-rw-r--r--src/mame/drivers/pktgaldx.c7
-rw-r--r--src/mame/drivers/plygonet.c28
-rw-r--r--src/mame/drivers/pong.c10
-rw-r--r--src/mame/drivers/poolshrk.c39
-rw-r--r--src/mame/drivers/popeye.c4
-rw-r--r--src/mame/drivers/pse.c23
-rw-r--r--src/mame/drivers/psikyosh.c2
-rw-r--r--src/mame/drivers/raiden.c16
-rw-r--r--src/mame/drivers/rainbow.c65
-rw-r--r--src/mame/drivers/ramtek.c4
-rw-r--r--src/mame/drivers/rastersp.c4
-rw-r--r--src/mame/drivers/rocnrope.c7
-rw-r--r--src/mame/drivers/rohga.c28
-rw-r--r--src/mame/drivers/route16.c4
-rw-r--r--src/mame/drivers/royalmah.c183
-rw-r--r--src/mame/drivers/rungun.c47
-rw-r--r--src/mame/drivers/sangho.c1
-rw-r--r--src/mame/drivers/sbasketb.c18
-rw-r--r--src/mame/drivers/sbowling.c70
-rw-r--r--src/mame/drivers/scramble.c6
-rw-r--r--src/mame/drivers/segac2.c99
-rw-r--r--src/mame/drivers/segae.c124
-rw-r--r--src/mame/drivers/segag80r.c64
-rw-r--r--src/mame/drivers/segahang.c22
-rw-r--r--src/mame/drivers/segam1.c111
-rw-r--r--src/mame/drivers/segaorun.c2
-rw-r--r--src/mame/drivers/segas16a.c65
-rw-r--r--src/mame/drivers/segas16b.c95
-rw-r--r--src/mame/drivers/segas18.c14
-rw-r--r--src/mame/drivers/segas24.c24
-rw-r--r--src/mame/drivers/segas32.c1530
-rw-r--r--src/mame/drivers/segaybd.c320
-rw-r--r--src/mame/drivers/seicross.c54
-rw-r--r--src/mame/drivers/senjyo.c96
-rw-r--r--src/mame/drivers/seta.c277
-rw-r--r--src/mame/drivers/sg1000a.c47
-rw-r--r--src/mame/drivers/shisen.c22
-rw-r--r--src/mame/drivers/sidearms.c83
-rw-r--r--src/mame/drivers/slapshot.c4
-rw-r--r--src/mame/drivers/smsmcorp.c2
-rw-r--r--src/mame/drivers/snk.c6
-rw-r--r--src/mame/drivers/snk68.c77
-rw-r--r--src/mame/drivers/snowbros.c80
-rw-r--r--src/mame/drivers/spacefb.c61
-rw-r--r--src/mame/drivers/spbactn.c10
-rw-r--r--src/mame/drivers/spdodgeb.c35
-rw-r--r--src/mame/drivers/sprcros2.c45
-rw-r--r--src/mame/drivers/srmp2.c2
-rw-r--r--src/mame/drivers/srmp5.c11
-rw-r--r--src/mame/drivers/ssingles.c5
-rw-r--r--src/mame/drivers/starcrus.c28
-rw-r--r--src/mame/drivers/stfight.c6
-rw-r--r--src/mame/drivers/suna8.c152
-rw-r--r--src/mame/drivers/superchs.c2
-rw-r--r--src/mame/drivers/suprloco.c36
-rw-r--r--src/mame/drivers/system1.c944
-rw-r--r--src/mame/drivers/system16.c41
-rw-r--r--src/mame/drivers/taito_f2.c2
-rw-r--r--src/mame/drivers/taito_f3.c14
-rw-r--r--src/mame/drivers/taito_h.c2
-rw-r--r--src/mame/drivers/taito_x.c2
-rw-r--r--src/mame/drivers/taito_z.c2
-rw-r--r--src/mame/drivers/taitoair.c250
-rw-r--r--src/mame/drivers/taitottl.c99
-rw-r--r--src/mame/drivers/taitotz.c2
-rw-r--r--src/mame/drivers/tapatune.c9
-rw-r--r--src/mame/drivers/tcl.c3
-rw-r--r--src/mame/drivers/thedealr.c586
-rw-r--r--src/mame/drivers/thunderx.c2
-rw-r--r--src/mame/drivers/timeplt.c7
-rw-r--r--src/mame/drivers/tmaster.c2
-rw-r--r--src/mame/drivers/tmnt.c71
-rw-r--r--src/mame/drivers/tnzs.c43
-rw-r--r--src/mame/drivers/toaplan1.c22
-rw-r--r--src/mame/drivers/toaplan2.c2
-rw-r--r--src/mame/drivers/toki.c29
-rw-r--r--src/mame/drivers/tonton.c1
-rw-r--r--src/mame/drivers/topspeed.c2
-rw-r--r--src/mame/drivers/trackfld.c19
-rw-r--r--src/mame/drivers/ttchamp.c2
-rw-r--r--src/mame/drivers/tumbleb.c10
-rw-r--r--src/mame/drivers/turbo.c225
-rw-r--r--src/mame/drivers/twin16.c2
-rw-r--r--src/mame/drivers/undrfire.c2
-rw-r--r--src/mame/drivers/vamphalf.c144
-rw-r--r--src/mame/drivers/vastar.c28
-rw-r--r--src/mame/drivers/vcombat.c38
-rw-r--r--src/mame/drivers/vendetta.c29
-rw-r--r--src/mame/drivers/vicdual.c380
-rw-r--r--src/mame/drivers/vigilant.c18
-rw-r--r--src/mame/drivers/vlc.c6
-rw-r--r--src/mame/drivers/warpwarp.c35
-rw-r--r--src/mame/drivers/warriorb.c2
-rw-r--r--src/mame/drivers/wgp.c2
-rw-r--r--src/mame/drivers/wiz.c56
-rw-r--r--src/mame/drivers/zaxxon.c133
-rw-r--r--src/mame/etc/doxy_driver.h9
-rw-r--r--src/mame/includes/angelkds.h4
-rw-r--r--src/mame/includes/appoooh.h28
-rw-r--r--src/mame/includes/argus.h2
-rw-r--r--src/mame/includes/asuka.h2
-rw-r--r--src/mame/includes/atarisy2.h7
-rw-r--r--src/mame/includes/battlera.h29
-rw-r--r--src/mame/includes/boogwing.h4
-rw-r--r--src/mame/includes/bublbobl.h2
-rw-r--r--src/mame/includes/cclimber.h39
-rw-r--r--src/mame/includes/cdi.h20
-rw-r--r--src/mame/includes/cheekyms.h2
-rw-r--r--src/mame/includes/commando.h4
-rw-r--r--src/mame/includes/cps1.h6
-rw-r--r--src/mame/includes/cps3.h10
-rw-r--r--src/mame/includes/darkmist.h5
-rw-r--r--src/mame/includes/deco32.h235
-rw-r--r--src/mame/includes/decocrpt.h2
-rw-r--r--src/mame/includes/dietgo.h4
-rw-r--r--src/mame/includes/dynax.h2
-rw-r--r--src/mame/includes/exzisus.h2
-rw-r--r--src/mame/includes/freekick.h5
-rw-r--r--src/mame/includes/galastrm.h6
-rw-r--r--src/mame/includes/galaxian.h4
-rw-r--r--src/mame/includes/gameplan.h2
-rw-r--r--src/mame/includes/gaplus.h57
-rw-r--r--src/mame/includes/gcpinbal.h2
-rw-r--r--src/mame/includes/grchamp.h71
-rw-r--r--src/mame/includes/groundfx.h6
-rw-r--r--src/mame/includes/gstriker.h53
-rw-r--r--src/mame/includes/gunbustr.h6
-rw-r--r--src/mame/includes/hexion.h24
-rw-r--r--src/mame/includes/itech8.h65
-rw-r--r--src/mame/includes/jack.h4
-rw-r--r--src/mame/includes/kchamp.h6
-rw-r--r--src/mame/includes/ladybug.h10
-rw-r--r--src/mame/includes/legionna.h2
-rw-r--r--src/mame/includes/liberate.h4
-rw-r--r--src/mame/includes/m62.h8
-rw-r--r--src/mame/includes/megasys1.h4
-rw-r--r--src/mame/includes/micro3d.h34
-rw-r--r--src/mame/includes/mitchell.h12
-rw-r--r--src/mame/includes/model1.h3
-rw-r--r--src/mame/includes/model3.h30
-rw-r--r--src/mame/includes/mouser.h4
-rw-r--r--src/mame/includes/mustache.h6
-rw-r--r--src/mame/includes/namcos1.h4
-rw-r--r--src/mame/includes/namcos22.h6
-rw-r--r--src/mame/includes/namcos86.h58
-rw-r--r--src/mame/includes/naomi.h2
-rw-r--r--src/mame/includes/naughtyb.h21
-rw-r--r--src/mame/includes/nbmj8991.h40
-rw-r--r--src/mame/includes/nbmj9195.h83
-rw-r--r--src/mame/includes/ninjakd2.h6
-rw-r--r--src/mame/includes/ninjaw.h2
-rw-r--r--src/mame/includes/othunder.h2
-rw-r--r--src/mame/includes/pacland.h47
-rw-r--r--src/mame/includes/pacman.h4
-rw-r--r--src/mame/includes/pbaction.h4
-rw-r--r--src/mame/includes/pcktgal.h24
-rw-r--r--src/mame/includes/pktgaldx.h4
-rw-r--r--src/mame/includes/plygonet.h3
-rw-r--r--src/mame/includes/poolshrk.h48
-rw-r--r--src/mame/includes/segag80r.h4
-rw-r--r--src/mame/includes/segahang.h4
-rw-r--r--src/mame/includes/segas16a.h2
-rw-r--r--src/mame/includes/segas16b.h4
-rw-r--r--src/mame/includes/segas32.h124
-rw-r--r--src/mame/includes/seicross.h4
-rw-r--r--src/mame/includes/senjyo.h4
-rw-r--r--src/mame/includes/shisen.h28
-rw-r--r--src/mame/includes/slapshot.h4
-rw-r--r--src/mame/includes/snk68.h67
-rw-r--r--src/mame/includes/spacefb.h46
-rw-r--r--src/mame/includes/spbactn.h30
-rw-r--r--src/mame/includes/spdodgeb.h48
-rw-r--r--src/mame/includes/sprcros2.h49
-rw-r--r--src/mame/includes/srmp2.h2
-rw-r--r--src/mame/includes/starcrus.h40
-rw-r--r--src/mame/includes/stfight.h4
-rw-r--r--src/mame/includes/suna8.h9
-rw-r--r--src/mame/includes/superchs.h6
-rw-r--r--src/mame/includes/suprloco.h4
-rw-r--r--src/mame/includes/system1.h14
-rw-r--r--src/mame/includes/system16.h4
-rw-r--r--src/mame/includes/taito_f2.h2
-rw-r--r--src/mame/includes/taito_h.h2
-rw-r--r--src/mame/includes/taito_z.h2
-rw-r--r--src/mame/includes/taitoair.h58
-rw-r--r--src/mame/includes/taitoipt.h2
-rw-r--r--src/mame/includes/toaplan2.h2
-rw-r--r--src/mame/includes/topspeed.h2
-rw-r--r--src/mame/includes/turbo.h2
-rw-r--r--src/mame/includes/tx1.h8
-rw-r--r--src/mame/includes/undrfire.h6
-rw-r--r--src/mame/includes/vastar.h39
-rw-r--r--src/mame/includes/vicdual.h39
-rw-r--r--src/mame/includes/warpwarp.h38
-rw-r--r--src/mame/includes/warriorb.h2
-rw-r--r--src/mame/includes/wgp.h2
-rw-r--r--src/mame/includes/wiz.h4
-rw-r--r--src/mame/includes/zaxxon.h4
-rw-r--r--src/mame/layout/chsuper.lay4
-rw-r--r--src/mame/layout/radr.lay4
-rw-r--r--src/mame/layout/superbug.lay5
-rw-r--r--src/mame/machine/315-5838_317-0229_comp.h2
-rw-r--r--src/mame/machine/atarigen.h2
-rw-r--r--src/mame/machine/awboard.c112
-rw-r--r--src/mame/machine/awboard.h10
-rw-r--r--src/mame/machine/bublbobl.c2
-rw-r--r--src/mame/machine/cclimber.c9
-rw-r--r--src/mame/machine/cdicdic.c28
-rw-r--r--src/mame/machine/cdislave.c4
-rw-r--r--src/mame/machine/cps2crpt.c300
-rw-r--r--src/mame/machine/cps2crypt.h225
-rw-r--r--src/mame/machine/deco102.c12
-rw-r--r--src/mame/machine/deco222.c8
-rw-r--r--src/mame/machine/deco222.h4
-rw-r--r--src/mame/machine/decocpu6.c6
-rw-r--r--src/mame/machine/decocpu6.h2
-rw-r--r--src/mame/machine/decocpu7.c4
-rw-r--r--src/mame/machine/decocpu7.h2
-rw-r--r--src/mame/machine/fd1089.c15
-rw-r--r--src/mame/machine/fd1089.h2
-rw-r--r--src/mame/machine/fd1094.c32
-rw-r--r--src/mame/machine/fd1094.h2
-rw-r--r--src/mame/machine/fddebug.c2
-rw-r--r--src/mame/machine/gaplus.c6
-rw-r--r--src/mame/machine/inder_sb.c8
-rw-r--r--src/mame/machine/iteagle_fpga.c11
-rw-r--r--src/mame/machine/kabuki.c73
-rw-r--r--src/mame/machine/kabuki.h30
-rw-r--r--src/mame/machine/konami1.c72
-rw-r--r--src/mame/machine/konami1.h27
-rw-r--r--src/mame/machine/m1comm.c571
-rw-r--r--src/mame/machine/m1comm.h98
-rw-r--r--src/mame/machine/mathbox.c2
-rw-r--r--src/mame/machine/mathbox.h2
-rw-r--r--src/mame/machine/mc8123.c39
-rw-r--r--src/mame/machine/mc8123.h6
-rw-r--r--src/mame/machine/micro3d.c4
-rw-r--r--src/mame/machine/namcoio.h2
-rw-r--r--src/mame/machine/namcos1.c31
-rw-r--r--src/mame/machine/playch10.c2
-rw-r--r--src/mame/machine/s32comm.c1003
-rw-r--r--src/mame/machine/s32comm.h91
-rw-r--r--src/mame/machine/scramble.c4
-rw-r--r--src/mame/machine/segacrp2.c204
-rw-r--r--src/mame/machine/segacrp2.h13
-rw-r--r--src/mame/machine/segacrpt.c843
-rw-r--r--src/mame/machine/segacrpt.h27
-rw-r--r--src/mame/machine/segaic16.c18
-rw-r--r--src/mame/machine/segaic16.h8
-rw-r--r--src/mame/machine/slapstic.c2
-rw-r--r--src/mame/machine/slikshot.c4
-rw-r--r--src/mame/machine/stfight.c6
-rw-r--r--src/mame/machine/tx1.c22
-rw-r--r--src/mame/mess.lst41
-rw-r--r--src/mame/nl.lst31
-rw-r--r--src/mame/video/aerofgt.c18
-rw-r--r--src/mame/video/appoooh.c16
-rw-r--r--src/mame/video/argus.c2
-rw-r--r--src/mame/video/asuka.c2
-rw-r--r--src/mame/video/atarimo.h2
-rw-r--r--src/mame/video/avgdvg.c2
-rw-r--r--src/mame/video/avgdvg.h2
-rw-r--r--src/mame/video/battlera.c3
-rw-r--r--src/mame/video/bublbobl.c2
-rw-r--r--src/mame/video/cclimber.c2
-rw-r--r--src/mame/video/cheekyms.c2
-rw-r--r--src/mame/video/cps1.c2
-rw-r--r--src/mame/video/deco32.c97
-rw-r--r--src/mame/video/dooyong.c18
-rw-r--r--src/mame/video/exzisus.c2
-rw-r--r--src/mame/video/gaelco3d.c30
-rw-r--r--src/mame/video/galastrm.c12
-rw-r--r--src/mame/video/gameplan.c2
-rw-r--r--src/mame/video/gaplus.c24
-rw-r--r--src/mame/video/gcpinbal.c2
-rw-r--r--src/mame/video/grchamp.c8
-rw-r--r--src/mame/video/groundfx.c6
-rw-r--r--src/mame/video/gstriker.c6
-rw-r--r--src/mame/video/gunbustr.c6
-rw-r--r--src/mame/video/hexion.c18
-rw-r--r--src/mame/video/itech8.c86
-rw-r--r--src/mame/video/k001005.h2
-rw-r--r--src/mame/video/kaneko_tmap.c4
-rw-r--r--src/mame/video/legionna.c2
-rw-r--r--src/mame/video/m62.c16
-rw-r--r--src/mame/video/mb60553.c26
-rw-r--r--src/mame/video/mb60553.h3
-rw-r--r--src/mame/video/mcd212.c6
-rw-r--r--src/mame/video/micro3d.c2
-rw-r--r--src/mame/video/midzeus.c21
-rw-r--r--src/mame/video/midzeus2.c11
-rw-r--r--src/mame/video/model2.c6
-rw-r--r--src/mame/video/model2rd.inc4
-rw-r--r--src/mame/video/model3.c944
-rw-r--r--src/mame/video/n64.c1548
-rw-r--r--src/mame/video/n64.h357
-rw-r--r--src/mame/video/n64types.h341
-rw-r--r--src/mame/video/namcos22.c162
-rw-r--r--src/mame/video/namcos86.c93
-rw-r--r--src/mame/video/naughtyb.c31
-rw-r--r--src/mame/video/nbmj8991.c65
-rw-r--r--src/mame/video/nbmj9195.c144
-rw-r--r--src/mame/video/ninjakd2.c2
-rw-r--r--src/mame/video/ninjaw.c2
-rw-r--r--src/mame/video/othunder.c2
-rw-r--r--src/mame/video/pacland.c36
-rw-r--r--src/mame/video/pcktgal.c22
-rw-r--r--src/mame/video/poolshrk.c6
-rw-r--r--src/mame/video/powervr2.c6
-rw-r--r--src/mame/video/rdpblend.c350
-rw-r--r--src/mame/video/rdpblend.h52
-rw-r--r--src/mame/video/rdpfiltr.inc2
-rw-r--r--src/mame/video/rdpspn16.c808
-rw-r--r--src/mame/video/rdptpipe.c905
-rw-r--r--src/mame/video/rdptpipe.h102
-rw-r--r--src/mame/video/rltennis.c4
-rw-r--r--src/mame/video/segas24.c2
-rw-r--r--src/mame/video/segas32.c103
-rw-r--r--src/mame/video/seta.c19
-rw-r--r--src/mame/video/shisen.c21
-rw-r--r--src/mame/video/slapshot.c2
-rw-r--r--src/mame/video/snk68.c68
-rw-r--r--src/mame/video/spacefb.c11
-rw-r--r--src/mame/video/spdodgeb.c39
-rw-r--r--src/mame/video/sprcros2.c18
-rw-r--r--src/mame/video/srmp2.c2
-rw-r--r--src/mame/video/starcrus.c52
-rw-r--r--src/mame/video/suna8.c2
-rw-r--r--src/mame/video/superchs.c6
-rw-r--r--src/mame/video/taito_f2.c2
-rw-r--r--src/mame/video/taito_h.c2
-rw-r--r--src/mame/video/taito_z.c2
-rw-r--r--src/mame/video/taitoair.c382
-rw-r--r--src/mame/video/toaplan2.c2
-rw-r--r--src/mame/video/topspeed.c2
-rw-r--r--src/mame/video/undrfire.c8
-rw-r--r--src/mame/video/vastar.c67
-rw-r--r--src/mame/video/vectrex.c2
-rw-r--r--src/mame/video/vicdual.c14
-rw-r--r--src/mame/video/vs920a.c8
-rw-r--r--src/mame/video/vs920a.h1
-rw-r--r--src/mame/video/vsystem_spr.c80
-rw-r--r--src/mame/video/vsystem_spr.h8
-rw-r--r--src/mame/video/warpwarp.c11
-rw-r--r--src/mame/video/warriorb.c2
-rw-r--r--src/mame/video/wgp.c2
-rw-r--r--src/mess/audio/mac.c2
-rw-r--r--src/mess/audio/mea8000.h2
-rw-r--r--src/mess/drivers/a310.c2
-rw-r--r--src/mess/drivers/abc1600.c2
-rw-r--r--src/mess/drivers/abc80.c20
-rw-r--r--src/mess/drivers/ace.c4
-rw-r--r--src/mess/drivers/advision.c2
-rw-r--r--src/mess/drivers/alphatro.c2
-rw-r--r--src/mess/drivers/altos5.c2
-rw-r--r--src/mess/drivers/ampro.c2
-rw-r--r--src/mess/drivers/amstrad.c103
-rw-r--r--src/mess/drivers/apexc.c2
-rw-r--r--src/mess/drivers/apf.c28
-rw-r--r--src/mess/drivers/apollo.c23
-rw-r--r--src/mess/drivers/apple2.c50
-rw-r--r--src/mess/drivers/apple2e.c24
-rw-r--r--src/mess/drivers/applix.c2
-rw-r--r--src/mess/drivers/apricot.c227
-rw-r--r--src/mess/drivers/apricotf.c92
-rw-r--r--src/mess/drivers/apricotp.c151
-rw-r--r--src/mess/drivers/atarist.c14
-rw-r--r--src/mess/drivers/ax20.c47
-rw-r--r--src/mess/drivers/b2m.c2
-rw-r--r--src/mess/drivers/bbc.c12
-rw-r--r--src/mess/drivers/bigbord2.c2
-rw-r--r--src/mess/drivers/bullet.c4
-rw-r--r--src/mess/drivers/bw2.c2
-rw-r--r--src/mess/drivers/casloopy.c4
-rw-r--r--src/mess/drivers/ccs2810.c2
-rw-r--r--src/mess/drivers/cgenie.c2
-rw-r--r--src/mess/drivers/chessmst.c2
-rw-r--r--src/mess/drivers/coleco.c13
-rw-r--r--src/mess/drivers/concept.c2
-rw-r--r--src/mess/drivers/crvision.c175
-rw-r--r--src/mess/drivers/d6800.c6
-rw-r--r--src/mess/drivers/daruma.c169
-rw-r--r--src/mess/drivers/dectalk.c15
-rw-r--r--src/mess/drivers/dgn_beta.c30
-rw-r--r--src/mess/drivers/dragon.c36
-rw-r--r--src/mess/drivers/dvk_ksm.c4
-rw-r--r--src/mess/drivers/einstein.c2
-rw-r--r--src/mess/drivers/esq1.c4
-rw-r--r--src/mess/drivers/esq5505.c8
-rw-r--r--src/mess/drivers/esqkt.c2
-rw-r--r--src/mess/drivers/excali64.c71
-rw-r--r--src/mess/drivers/exelv.c2
-rw-r--r--src/mess/drivers/fidelz80.c4
-rw-r--r--src/mess/drivers/fm7.c109
-rw-r--r--src/mess/drivers/fmtowns.c2
-rw-r--r--src/mess/drivers/gimix.c2
-rw-r--r--src/mess/drivers/hec2hrp.c24
-rw-r--r--src/mess/drivers/hh_hmcs40.c6
-rw-r--r--src/mess/drivers/hh_melps4.c79
-rw-r--r--src/mess/drivers/hh_sm510.c402
-rw-r--r--src/mess/drivers/hh_tms1k.c115
-rw-r--r--src/mess/drivers/hh_ucom4.c54
-rw-r--r--src/mess/drivers/hp64k.c1212
-rw-r--r--src/mess/drivers/ht68k.c4
-rw-r--r--src/mess/drivers/i7000.c401
-rw-r--r--src/mess/drivers/icatel.c269
-rw-r--r--src/mess/drivers/ie15.c4
-rw-r--r--src/mess/drivers/itt3030.c2
-rw-r--r--src/mess/drivers/jupiter.c4
-rw-r--r--src/mess/drivers/kaypro.c4
-rw-r--r--src/mess/drivers/lisa.c2
-rw-r--r--src/mess/drivers/m20.c217
-rw-r--r--src/mess/drivers/mac.c2
-rw-r--r--src/mess/drivers/mbc200.c77
-rw-r--r--src/mess/drivers/mbc55x.c34
-rw-r--r--src/mess/drivers/mbee.c22
-rw-r--r--src/mess/drivers/mirage.c2
-rw-r--r--src/mess/drivers/monty.c181
-rw-r--r--src/mess/drivers/ms0515.c14
-rw-r--r--src/mess/drivers/msx.c180
-rw-r--r--src/mess/drivers/mtx.c2
-rw-r--r--src/mess/drivers/myb3k.c2
-rw-r--r--src/mess/drivers/mycom.c2
-rw-r--r--src/mess/drivers/mz2000.c102
-rw-r--r--src/mess/drivers/mz2500.c101
-rw-r--r--src/mess/drivers/n64.c4
-rw-r--r--src/mess/drivers/nascom1.c2
-rw-r--r--src/mess/drivers/nes.c1
-rw-r--r--src/mess/drivers/ngen.c4
-rw-r--r--src/mess/drivers/ngp.c2
-rw-r--r--src/mess/drivers/oric.c2
-rw-r--r--src/mess/drivers/orion.c6
-rw-r--r--src/mess/drivers/osbexec.c51
-rw-r--r--src/mess/drivers/osborne1.c50
-rw-r--r--src/mess/drivers/osi.c30
-rw-r--r--src/mess/drivers/partner.c2
-rw-r--r--src/mess/drivers/pc.c7
-rw-r--r--src/mess/drivers/pcd.c21
-rw-r--r--src/mess/drivers/pdp1.c2
-rw-r--r--src/mess/drivers/pentagon.c20
-rw-r--r--src/mess/drivers/peoplepc.c302
-rw-r--r--src/mess/drivers/pk8020.c40
-rw-r--r--src/mess/drivers/psx.c405
-rw-r--r--src/mess/drivers/pt68k4.c2
-rw-r--r--src/mess/drivers/pulsar.c2
-rw-r--r--src/mess/drivers/px8.c2
-rw-r--r--src/mess/drivers/qx10.c68
-rw-r--r--src/mess/drivers/rainbow.c102
-rw-r--r--src/mess/drivers/rambo.c227
-rw-r--r--src/mess/drivers/rc759.c617
-rw-r--r--src/mess/drivers/rm380z.c20
-rw-r--r--src/mess/drivers/rmnimbus.c2
-rw-r--r--src/mess/drivers/samcoupe.c2
-rw-r--r--src/mess/drivers/sbrain.c2
-rw-r--r--src/mess/drivers/sc2.c2
-rw-r--r--src/mess/drivers/scorpion.c2
-rw-r--r--src/mess/drivers/sdk80.c201
-rw-r--r--src/mess/drivers/sgi_ip2.c4
-rw-r--r--src/mess/drivers/slicer.c2
-rw-r--r--src/mess/drivers/smc777.c371
-rw-r--r--src/mess/drivers/sms.c2
-rw-r--r--src/mess/drivers/spc1000.c15
-rw-r--r--src/mess/drivers/special.c4
-rw-r--r--src/mess/drivers/ssem.c4
-rw-r--r--src/mess/drivers/super6.c2
-rw-r--r--src/mess/drivers/super80.c2
-rw-r--r--src/mess/drivers/svi318.c45
-rw-r--r--src/mess/drivers/swtpc09.c102
-rw-r--r--src/mess/drivers/tavernie.c2
-rw-r--r--src/mess/drivers/tb303.c202
-rw-r--r--src/mess/drivers/tdv2324.c2
-rw-r--r--src/mess/drivers/thomson.c20
-rw-r--r--src/mess/drivers/ti990_10.c2
-rw-r--r--src/mess/drivers/ti990_4.c15
-rw-r--r--src/mess/drivers/ti99_2.c2
-rw-r--r--src/mess/drivers/tiki100.c2
-rw-r--r--src/mess/drivers/tispeak.c18
-rw-r--r--src/mess/drivers/tm990189.c2
-rw-r--r--src/mess/drivers/trs80.c67
-rw-r--r--src/mess/drivers/trs80m2.c4
-rw-r--r--src/mess/drivers/ts802.c2
-rw-r--r--src/mess/drivers/tutor.c2
-rw-r--r--src/mess/drivers/tvgame.c133
-rw-r--r--src/mess/drivers/tx0.c2
-rw-r--r--src/mess/drivers/unixpc.c2
-rw-r--r--src/mess/drivers/uzebox.c19
-rw-r--r--src/mess/drivers/v1050.c14
-rw-r--r--src/mess/drivers/v6809.c2
-rw-r--r--src/mess/drivers/vector06.c40
-rw-r--r--src/mess/drivers/victor9k.c49
-rw-r--r--src/mess/drivers/vii.c2
-rw-r--r--src/mess/drivers/vixen.c2
-rw-r--r--src/mess/drivers/vk100.c11
-rw-r--r--src/mess/drivers/vt240.c16
-rw-r--r--src/mess/drivers/wicat.c2
-rw-r--r--src/mess/drivers/wildfire.c2
-rw-r--r--src/mess/drivers/x1.c65
-rw-r--r--src/mess/drivers/x1twin.c33
-rw-r--r--src/mess/drivers/xbox.c224
-rw-r--r--src/mess/drivers/xerox820.c46
-rw-r--r--src/mess/drivers/xor100.c2
-rw-r--r--src/mess/drivers/z100.c96
-rw-r--r--src/mess/drivers/z80ne.c7
-rw-r--r--src/mess/drivers/zorba.c2
-rw-r--r--src/mess/includes/abc80.h2
-rw-r--r--src/mess/includes/amstrad.h2
-rw-r--r--src/mess/includes/apple2gs.h2
-rw-r--r--src/mess/includes/apricotf.h95
-rw-r--r--src/mess/includes/apricotp.h129
-rw-r--r--src/mess/includes/bbc.h2
-rw-r--r--src/mess/includes/cgc7900.h1
-rw-r--r--src/mess/includes/coco.h2
-rw-r--r--src/mess/includes/concept.h2
-rw-r--r--src/mess/includes/crvision.h71
-rw-r--r--src/mess/includes/dgn_beta.h20
-rw-r--r--src/mess/includes/dgnalpha.h17
-rw-r--r--src/mess/includes/fm7.h11
-rw-r--r--src/mess/includes/hec2hrp.h20
-rw-r--r--src/mess/includes/hh_ucom4.h66
-rw-r--r--src/mess/includes/hp48.h2
-rw-r--r--src/mess/includes/lisa.h2
-rw-r--r--src/mess/includes/mac.h2
-rw-r--r--src/mess/includes/macpci.h2
-rw-r--r--src/mess/includes/mbc55x.h17
-rw-r--r--src/mess/includes/mbee.h4
-rw-r--r--src/mess/includes/msx.h1
-rw-r--r--src/mess/includes/mtx.h2
-rw-r--r--src/mess/includes/next.h2
-rw-r--r--src/mess/includes/osborne1.h1
-rw-r--r--src/mess/includes/osi.h22
-rw-r--r--src/mess/includes/pdp1.h2
-rw-r--r--src/mess/includes/pk8020.h14
-rw-r--r--src/mess/includes/rm380z.h10
-rw-r--r--src/mess/includes/sms.h2
-rw-r--r--src/mess/includes/spectrum.h2
-rw-r--r--src/mess/includes/svi318.h15
-rw-r--r--src/mess/includes/swtpc09.h16
-rw-r--r--src/mess/includes/thomson.h3
-rw-r--r--src/mess/includes/trs80.h17
-rw-r--r--src/mess/includes/tx0.h2
-rw-r--r--src/mess/includes/vector06.h11
-rw-r--r--src/mess/includes/victor9k.h21
-rw-r--r--src/mess/includes/x1.h15
-rw-r--r--src/mess/includes/z80ne.h4
-rw-r--r--src/mess/layout/ebaskb2.lay145
-rw-r--r--src/mess/layout/efootb4.lay166
-rw-r--r--src/mess/layout/h2hbaseb.lay205
-rw-r--r--src/mess/layout/hh_sm510_test.lay301
-rw-r--r--src/mess/layout/tbreakup.lay131
-rw-r--r--src/mess/machine/amstrad.c78
-rw-r--r--src/mess/machine/apollo_kbd.c16
-rw-r--r--src/mess/machine/apple2gs.c37
-rw-r--r--src/mess/machine/applefdc.c2
-rw-r--r--src/mess/machine/applefdc.h2
-rw-r--r--src/mess/machine/apricotkb.c4
-rw-r--r--src/mess/machine/apricotkb.h4
-rw-r--r--src/mess/machine/apricotkb_hle.c286
-rw-r--r--src/mess/machine/apricotkb_hle.h73
-rw-r--r--src/mess/machine/bbc.c2
-rw-r--r--src/mess/machine/beta.c11
-rw-r--r--src/mess/machine/beta.h2
-rw-r--r--src/mess/machine/concept.c2
-rw-r--r--src/mess/machine/cx4data.inc2
-rw-r--r--src/mess/machine/cx4fn.inc2
-rw-r--r--src/mess/machine/cx4oam.inc2
-rw-r--r--src/mess/machine/cx4ops.inc2
-rw-r--r--src/mess/machine/dgn_beta.c80
-rw-r--r--src/mess/machine/dgnalpha.c39
-rw-r--r--src/mess/machine/hec2hrp.c82
-rw-r--r--src/mess/machine/lisa.c2
-rw-r--r--src/mess/machine/m20_8086.c119
-rw-r--r--src/mess/machine/m20_8086.h40
-rw-r--r--src/mess/machine/m20_kbd.c225
-rw-r--r--src/mess/machine/m20_kbd.h26
-rw-r--r--src/mess/machine/mac.c4
-rw-r--r--src/mess/machine/mbc55x.c29
-rw-r--r--src/mess/machine/mbee.c10
-rw-r--r--src/mess/machine/msx.c2
-rw-r--r--src/mess/machine/mtx.c2
-rw-r--r--src/mess/machine/osborne1.c16
-rw-r--r--src/mess/machine/pk8020.c60
-rw-r--r--src/mess/machine/rm380z.c39
-rw-r--r--src/mess/machine/rmnimbus.c3
-rw-r--r--src/mess/machine/smartmed.c2
-rw-r--r--src/mess/machine/smartmed.h2
-rw-r--r--src/mess/machine/sms.c2
-rw-r--r--src/mess/machine/snescx4.c2
-rw-r--r--src/mess/machine/snescx4.h2
-rw-r--r--src/mess/machine/sonydriv.c2
-rw-r--r--src/mess/machine/sonydriv.h2
-rw-r--r--src/mess/machine/svi318.c57
-rw-r--r--src/mess/machine/swtpc09.c149
-rw-r--r--src/mess/machine/thomflop.c36
-rw-r--r--src/mess/machine/thomson.c2
-rw-r--r--src/mess/machine/ti99/990_dk.c877
-rw-r--r--src/mess/machine/ti99/990_dk.h12
-rw-r--r--src/mess/machine/ti99/990_hd.c2
-rw-r--r--src/mess/machine/ti99/990_hd.h2
-rw-r--r--src/mess/machine/ti99/990_tap.c2
-rw-r--r--src/mess/machine/ti99/990_tap.h2
-rw-r--r--src/mess/machine/ti99/gromport.c8
-rw-r--r--src/mess/machine/trs80.c106
-rw-r--r--src/mess/machine/upd65031.c2
-rw-r--r--src/mess/machine/vector06.c18
-rw-r--r--src/mess/machine/victor9k_fdc.c2
-rw-r--r--src/mess/machine/z80ne.c2
-rw-r--r--src/mess/machine/zx8302.h6
-rw-r--r--src/mess/tools/imgtool/formats/coco_dsk.c (renamed from src/lib/formats/coco_dsk.c)2
-rw-r--r--src/mess/tools/imgtool/formats/coco_dsk.h (renamed from src/lib/formats/coco_dsk.h)2
-rw-r--r--src/mess/tools/imgtool/formats/vt_dsk.c (renamed from src/lib/formats/vt_dsk.c)0
-rw-r--r--src/mess/tools/imgtool/formats/vt_dsk.h (renamed from src/lib/formats/vt_dsk.h)2
-rw-r--r--src/mess/tools/imgtool/imghd.c2
-rw-r--r--src/mess/tools/imgtool/modules/amiga.c1
-rw-r--r--src/mess/tools/imgtool/modules/concept.c2
-rw-r--r--src/mess/tools/imgtool/modules/fat.c2
-rw-r--r--src/mess/tools/imgtool/modules/fat.h2
-rw-r--r--src/mess/tools/imgtool/modules/mac.c2
-rw-r--r--src/mess/tools/imgtool/modules/macbin.c2
-rw-r--r--src/mess/tools/imgtool/modules/macutil.c2
-rw-r--r--src/mess/tools/imgtool/modules/macutil.h2
-rw-r--r--src/mess/tools/imgtool/modules/pc_flop.c2
-rw-r--r--src/mess/tools/imgtool/modules/pc_hard.c2
-rw-r--r--src/mess/tools/imgtool/modules/prodos.c2
-rw-r--r--src/mess/tools/imgtool/modules/thomson.c1
-rw-r--r--src/mess/tools/imgtool/modules/ti99.c2
-rw-r--r--src/mess/tools/imgtool/modules/ti990hd.c2
-rw-r--r--src/mess/tools/imgtool/modules/vzdos.c4
-rw-r--r--src/mess/video/733_asr.c2
-rw-r--r--src/mess/video/733_asr.h2
-rw-r--r--src/mess/video/911_chr.h2
-rw-r--r--src/mess/video/911_key.h2
-rw-r--r--src/mess/video/911_vdt.c2
-rw-r--r--src/mess/video/911_vdt.h2
-rw-r--r--src/mess/video/abc80.c4
-rw-r--r--src/mess/video/apollo.c2
-rw-r--r--src/mess/video/bbc.c2
-rw-r--r--src/mess/video/cgc7900.c2
-rw-r--r--src/mess/video/crt.c2
-rw-r--r--src/mess/video/crt.h2
-rw-r--r--src/mess/video/gime.c42
-rw-r--r--src/mess/video/mac.c2
-rw-r--r--src/mess/video/mbc55x.c3
-rw-r--r--src/mess/video/mbee.c8
-rw-r--r--src/mess/video/pc1512.c2
-rw-r--r--src/mess/video/pdp1.c2
-rw-r--r--src/mess/video/rmnimbus.c3
-rw-r--r--src/mess/video/spectrum.c7
-rw-r--r--src/mess/video/tx0.c2
-rw-r--r--src/osd/modules/debugger/debugint.c4
-rw-r--r--src/osd/modules/debugger/debugqt.c2
-rw-r--r--src/osd/modules/lib/osdlib_win32.c63
-rw-r--r--src/osd/modules/lib/osdobj_common.c16
-rw-r--r--src/osd/modules/lib/osdobj_common.h21
-rw-r--r--src/osd/modules/midi/portmidi.c4
-rw-r--r--src/osd/modules/opengl/SDL1211_opengl.h2
-rw-r--r--src/osd/modules/opengl/gl_shader_mgr.h2
-rw-r--r--src/osd/modules/opengl/gl_shader_tool.c32
-rw-r--r--src/osd/modules/render/d3d/d3d9intf.c2
-rw-r--r--src/osd/modules/render/d3d/d3dcomm.h2
-rw-r--r--src/osd/modules/render/d3d/d3dhlsl.c2
-rw-r--r--src/osd/modules/render/d3d/d3dhlsl.h6
-rw-r--r--src/osd/modules/render/d3d/d3dintf.h2
-rw-r--r--src/osd/modules/render/drawd3d.c2
-rw-r--r--src/osd/modules/render/drawd3d.h2
-rw-r--r--src/osd/modules/render/drawogl.c70
-rw-r--r--src/osd/sdl/input.c2
-rw-r--r--src/osd/sdl/osdsdl.h2
-rw-r--r--src/osd/sdl/sdlfile.c2
-rw-r--r--src/osd/sdl/sdlmain.c5
-rw-r--r--src/osd/sdl/video.c7
-rw-r--r--src/osd/sdl/window.c4
-rw-r--r--src/osd/windows/input.c312
-rw-r--r--src/osd/windows/video.c10
-rw-r--r--src/osd/windows/video.h4
-rw-r--r--src/osd/windows/winfile.c3
-rw-r--r--src/tools/nltool.c46
-rw-r--r--src/tools/unidasm.c2
-rw-r--r--src/version.c2
1733 files changed, 76226 insertions, 46154 deletions
diff --git a/.gitignore b/.gitignore
index c424556b42f..c5dfc2b31cc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,6 +3,7 @@
!/*/
!/.gitattributes
!/.gitignore
+!/.travis.yml
!/makefile
!/mame.doxygen
!/*.md
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 00000000000..15718c091af
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,18 @@
+language: cpp
+compiler:
+ - gcc
+ - clang
+env:
+ - SUBTARGET=arcade MAME=mamearcade64
+ - SUBTARGET=mess MAME=mess64
+script:
+ - if [ $CC == 'clang' ];
+ then make -j2 linux_x64_clang && ./$MAME -validate;
+ else make -j2 OPTIMIZE=0 && ./$MAME -validate;
+ fi
+sudo: required
+before_install:
+ - sudo add-apt-repository ppa:zoogie/sdl2-snapshots -y
+ - sudo add-apt-repository ppa:shahar-evron/qt-backports -y
+ - sudo apt-get update -qq
+ - sudo apt-get install -y libsdl2-dev libsdl2-ttf-dev libasound2-dev libqt4-dev libqt4-dev-bin
diff --git a/3rdparty/dxsdk/Include/d3dcommon.h b/3rdparty/dxsdk/Include/d3dcommon.h
index 1baa2c262c4..9305a040fc2 100644
--- a/3rdparty/dxsdk/Include/d3dcommon.h
+++ b/3rdparty/dxsdk/Include/d3dcommon.h
@@ -81,6 +81,21 @@ enum D3D_FEATURE_LEVEL
} D3D_FEATURE_LEVEL;
typedef
+#define D3D_FL9_1_REQ_TEXTURE1D_U_DIMENSION 2048
+#define D3D_FL9_3_REQ_TEXTURE1D_U_DIMENSION 4096
+#define D3D_FL9_1_REQ_TEXTURE2D_U_OR_V_DIMENSION 2048
+#define D3D_FL9_3_REQ_TEXTURE2D_U_OR_V_DIMENSION 4096
+#define D3D_FL9_1_REQ_TEXTURECUBE_DIMENSION 512
+#define D3D_FL9_3_REQ_TEXTURECUBE_DIMENSION 4096
+#define D3D_FL9_1_REQ_TEXTURE3D_U_V_OR_W_DIMENSION 256
+#define D3D_FL9_1_DEFAULT_MAX_ANISOTROPY 2
+#define D3D_FL9_1_IA_PRIMITIVE_MAX_COUNT 65535
+#define D3D_FL9_2_IA_PRIMITIVE_MAX_COUNT 1048575
+#define D3D_FL9_1_SIMULTANEOUS_RENDER_TARGET_COUNT 1
+#define D3D_FL9_3_SIMULTANEOUS_RENDER_TARGET_COUNT 4
+#define D3D_FL9_1_MAX_TEXTURE_REPEAT 128
+#define D3D_FL9_2_MAX_TEXTURE_REPEAT 2048
+#define D3D_FL9_3_MAX_TEXTURE_REPEAT 8192
enum D3D_PRIMITIVE_TOPOLOGY
{ D3D_PRIMITIVE_TOPOLOGY_UNDEFINED = 0,
D3D_PRIMITIVE_TOPOLOGY_POINTLIST = 1,
diff --git a/3rdparty/jsoncpp/.gitignore b/3rdparty/jsoncpp/.gitignore
index 60c4a0b9aee..ef226a8875a 100644
--- a/3rdparty/jsoncpp/.gitignore
+++ b/3rdparty/jsoncpp/.gitignore
@@ -10,4 +10,27 @@
/libs/
/doc/doxyfile
/dist/
-/include/json/version.h
+#/version
+#/include/json/version.h
+
+# MSVC project files:
+*.sln
+*.vcxproj
+*.filters
+*.user
+*.sdf
+*.opensdf
+*.suo
+
+# MSVC build files:
+*.lib
+*.obj
+*.tlog/
+*.pdb
+
+# CMake-generated files:
+CMakeFiles/
+CTestTestFile.cmake
+cmake_install.cmake
+pkg-config/jsoncpp.pc
+jsoncpp_lib_static.dir/
diff --git a/3rdparty/jsoncpp/.travis.yml b/3rdparty/jsoncpp/.travis.yml
index a913b095849..17e52dcf89b 100644
--- a/3rdparty/jsoncpp/.travis.yml
+++ b/3rdparty/jsoncpp/.travis.yml
@@ -2,17 +2,24 @@
# http://about.travis-ci.org/docs/user/build-configuration/
# This file can be validated on:
# http://lint.travis-ci.org/
-before_install: sudo apt-get install cmake
+
+#before_install: sudo apt-get install -y cmake
+# cmake is pre-installed in Travis for both linux and osx
+
+before_install:
+ - sudo apt-get update -qq
+ - sudo apt-get install -qq valgrind
+os:
+ - linux
language: cpp
compiler:
- gcc
- clang
-script: cmake -DJSONCPP_LIB_BUILD_SHARED=$SHARED_LIBRARY -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_VERBOSE_MAKEFILE=$VERBOSE_MAKE . && make
+script: ./travis.sh
env:
matrix:
- - SHARED_LIBRARY=ON BUILD_TYPE=release VERBOSE_MAKE=false
- - SHARED_LIBRARY=OFF BUILD_TYPE=release VERBOSE_MAKE=false
- - SHARED_LIBRARY=OFF BUILD_TYPE=debug VERBOSE VERBOSE_MAKE=true
+ - SHARED_LIB=ON STATIC_LIB=ON CMAKE_PKG=ON BUILD_TYPE=release VERBOSE_MAKE=false
+ - SHARED_LIB=OFF STATIC_LIB=ON CMAKE_PKG=OFF BUILD_TYPE=debug VERBOSE_MAKE=true VERBOSE
notifications:
email:
- aaronjjacobs@gmail.com
diff --git a/3rdparty/jsoncpp/CMakeLists.txt b/3rdparty/jsoncpp/CMakeLists.txt
index 3e8f96ecb90..90eb14e30d0 100644
--- a/3rdparty/jsoncpp/CMakeLists.txt
+++ b/3rdparty/jsoncpp/CMakeLists.txt
@@ -1,12 +1,16 @@
+# vim: et ts=4 sts=4 sw=4 tw=0
+
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.5)
PROJECT(jsoncpp)
ENABLE_TESTING()
-OPTION(JSONCPP_WITH_TESTS "Compile and run JsonCpp test executables" ON)
+OPTION(JSONCPP_WITH_TESTS "Compile and (for jsoncpp_check) run JsonCpp test executables" ON)
OPTION(JSONCPP_WITH_POST_BUILD_UNITTEST "Automatically run unit-tests as a post build step" ON)
OPTION(JSONCPP_WITH_WARNING_AS_ERROR "Force compilation to fail if a warning occurs" OFF)
OPTION(JSONCPP_WITH_PKGCONFIG_SUPPORT "Generate and install .pc files" ON)
OPTION(JSONCPP_WITH_CMAKE_PACKAGE "Generate and install cmake package files" OFF)
+OPTION(BUILD_SHARED_LIBS "Build jsoncpp_lib as a shared library." OFF)
+OPTION(BUILD_STATIC_LIBS "Build jsoncpp_lib static library." ON)
# Ensures that CMAKE_BUILD_TYPE is visible in cmake-gui on Unix
IF(NOT WIN32)
@@ -17,30 +21,21 @@ IF(NOT WIN32)
ENDIF(NOT CMAKE_BUILD_TYPE)
ENDIF(NOT WIN32)
+SET(DEBUG_LIBNAME_SUFFIX "" CACHE STRING "Optional suffix to append to the library name for a debug build")
SET(LIB_SUFFIX "" CACHE STRING "Optional arch-dependent suffix for the library installation directory")
SET(RUNTIME_INSTALL_DIR bin
CACHE PATH "Install dir for executables and dlls")
-SET(ARCHIVE_INSTALL_DIR lib${LIB_SUFFIX}
+SET(ARCHIVE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}
CACHE PATH "Install dir for static libraries")
-SET(LIBRARY_INSTALL_DIR lib${LIB_SUFFIX}
+SET(LIBRARY_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}
CACHE PATH "Install dir for shared libraries")
-SET(INCLUDE_INSTALL_DIR include
+SET(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include
CACHE PATH "Install dir for headers")
SET(PACKAGE_INSTALL_DIR lib${LIB_SUFFIX}/cmake
CACHE PATH "Install dir for cmake package config files")
MARK_AS_ADVANCED( RUNTIME_INSTALL_DIR ARCHIVE_INSTALL_DIR INCLUDE_INSTALL_DIR PACKAGE_INSTALL_DIR )
-# This ensures shared DLL are in the same dir as executable on Windows.
-# Put all executables / libraries are in a project global directory.
-SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib
- CACHE PATH "Single directory for all static libraries.")
-SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib
- CACHE PATH "Single directory for all dynamic libraries on Unix.")
-SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin
- CACHE PATH "Single directory for all executable and dynamic libraries on Windows.")
-MARK_AS_ADVANCED( CMAKE_RUNTIME_OUTPUT_DIRECTORY CMAKE_LIBRARY_OUTPUT_DIRECTORY CMAKE_ARCHIVE_OUTPUT_DIRECTORY )
-
# Set variable named ${VAR_NAME} to value ${VALUE}
FUNCTION(set_using_dynamic_name VAR_NAME VALUE)
SET( "${VAR_NAME}" "${VALUE}" PARENT_SCOPE)
@@ -64,17 +59,24 @@ MACRO(jsoncpp_parse_version VERSION_TEXT OUPUT_PREFIX)
ENDMACRO(jsoncpp_parse_version)
# Read out version from "version" file
-FILE(STRINGS "version" JSONCPP_VERSION)
-
+#FILE(STRINGS "version" JSONCPP_VERSION)
+#SET( JSONCPP_VERSION_MAJOR X )
+#SET( JSONCPP_VERSION_MINOR Y )
+#SET( JSONCPP_VERSION_PATCH Z )
+SET( JSONCPP_VERSION 1.6.2 )
jsoncpp_parse_version( ${JSONCPP_VERSION} JSONCPP_VERSION )
-IF(NOT JSONCPP_VERSION_FOUND)
- MESSAGE(FATAL_ERROR "Failed to parse version string properly. Expect X.Y.Z")
-ENDIF(NOT JSONCPP_VERSION_FOUND)
+#IF(NOT JSONCPP_VERSION_FOUND)
+# MESSAGE(FATAL_ERROR "Failed to parse version string properly. Expect X.Y.Z")
+#ENDIF(NOT JSONCPP_VERSION_FOUND)
MESSAGE(STATUS "JsonCpp Version: ${JSONCPP_VERSION_MAJOR}.${JSONCPP_VERSION_MINOR}.${JSONCPP_VERSION_PATCH}")
# File version.h is only regenerated on CMake configure step
CONFIGURE_FILE( "${PROJECT_SOURCE_DIR}/src/lib_json/version.h.in"
- "${PROJECT_SOURCE_DIR}/include/json/version.h" )
+ "${PROJECT_SOURCE_DIR}/include/json/version.h"
+ NEWLINE_STYLE UNIX )
+CONFIGURE_FILE( "${PROJECT_SOURCE_DIR}/version.in"
+ "${PROJECT_SOURCE_DIR}/version"
+ NEWLINE_STYLE UNIX )
macro(UseCompilationWarningAsError)
if ( MSVC )
@@ -93,6 +95,14 @@ if ( MSVC )
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /W4 ")
endif( MSVC )
+if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+ # using regular Clang or AppleClang
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wshorten-64-to-32")
+elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
+ # using GCC
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -Wall -Wextra -pedantic")
+endif()
+
IF(JSONCPP_WITH_WARNING_AS_ERROR)
UseCompilationWarningAsError()
ENDIF(JSONCPP_WITH_WARNING_AS_ERROR)
diff --git a/3rdparty/jsoncpp/NEWS.txt b/3rdparty/jsoncpp/NEWS.txt
index 1be7b8ef894..5733fcd5ef4 100644
--- a/3rdparty/jsoncpp/NEWS.txt
+++ b/3rdparty/jsoncpp/NEWS.txt
@@ -80,7 +80,7 @@ New in SVN
(e.g. MSVC 2008 command prompt in start menu) before running scons.
- Added support for amalgamated source and header generation (a la sqlite).
- Refer to README.txt section "Generating amalgamated source and header"
+ Refer to README.md section "Generating amalgamated source and header"
for detail.
* Value
diff --git a/3rdparty/jsoncpp/README.md b/3rdparty/jsoncpp/README.md
index 099f17fa2fd..93c8d1f593a 100644
--- a/3rdparty/jsoncpp/README.md
+++ b/3rdparty/jsoncpp/README.md
@@ -7,34 +7,62 @@ pairs.
[json-org]: http://json.org/
-JsonCpp is a C++ library that allows manipulating JSON values, including
+[JsonCpp][] is a C++ library that allows manipulating JSON values, including
serialization and deserialization to and from strings. It can also preserve
existing comment in unserialization/serialization steps, making it a convenient
format to store user input files.
+[JsonCpp]: http://open-source-parsers.github.io/jsoncpp-docs/doxygen/index.html
+
## A note on backward-compatibility
-Very soon, we are switching to C++11 only. For older compilers, try the `pre-C++11` branch.
+* `1.y.z` is built with C++11.
+* `0.y.z` can be used with older compilers.
+* Major versions maintain binary-compatibility.
-Using JsonCpp in your project
+# Using JsonCpp in your project
-----------------------------
-
-The recommended approach to integrating JsonCpp in your project is to build
-the amalgamated source (a single `.cpp` file) with your own build system. This
-ensures consistency of compilation flags and ABI compatibility. See the section
-"Generating amalgamated source and header" for instructions.
+The recommended approach to integrating JsonCpp in your project is to include
+the [amalgamated source](#generating-amalgamated-source-and-header) (a single
+`.cpp` file and two `.h` files) in your project, and compile and build as you
+would any other source file. This ensures consistency of compilation flags and
+ABI compatibility, issues which arise when building shared or static
+libraries. See the next section for instructions.
The `include/` should be added to your compiler include path. Jsoncpp headers
should be included as follow:
#include <json/json.h>
-If JsonCpp was build as a dynamic library on Windows, then your project needs to
+If JsonCpp was built as a dynamic library on Windows, then your project needs to
define the macro `JSON_DLL`.
+Generating amalgamated source and header
+----------------------------------------
+JsonCpp is provided with a script to generate a single header and a single
+source file to ease inclusion into an existing project. The amalgamated source
+can be generated at any time by running the following command from the
+top-directory (this requires Python 2.6):
+
+ python amalgamate.py
+
+It is possible to specify header name. See the `-h` option for detail.
+
+By default, the following files are generated:
+* `dist/jsoncpp.cpp`: source file that needs to be added to your project.
+* `dist/json/json.h`: corresponding header file for use in your project. It is
+ equivalent to including `json/json.h` in non-amalgamated source. This header
+ only depends on standard headers.
+* `dist/json/json-forwards.h`: header that provides forward declaration of all
+ JsonCpp types.
+
+The amalgamated sources are generated by concatenating JsonCpp source in the
+correct order and defining the macro `JSON_IS_AMALGAMATION` to prevent inclusion
+of other headers.
-Building and testing with new CMake
------------------------------------
+# Contributing to JsonCpp
+Building and testing with CMake
+-------------------------------
[CMake][] is a C++ Makefiles/Solution generator. It is usually available on most
Linux system as package. On Ubuntu:
@@ -57,7 +85,7 @@ Steps for generating solution/makefiles using `cmake-gui`:
* Make "source code" point to the source directory.
* Make "where to build the binary" point to the directory to use for the build.
* Click on the "Grouped" check box.
-* Review JsonCpp build options (tick `JSONCPP_LIB_BUILD_SHARED` to build as a
+* Review JsonCpp build options (tick `BUILD_SHARED_LIBS` to build as a
dynamic library).
* Click the configure button at the bottom, then the generate button.
* The generated solution/makefiles can be found in the binary directory.
@@ -66,19 +94,17 @@ Alternatively, from the command-line on Unix in the source directory:
mkdir -p build/debug
cd build/debug
- cmake -DCMAKE_BUILD_TYPE=debug -DJSONCPP_LIB_BUILD_SHARED=OFF -G "Unix Makefiles" ../..
+ cmake -DCMAKE_BUILD_TYPE=debug -DBUILD_STATIC_LIBS=ON -DBUILD_SHARED_LIBS=OFF -DARCHIVE_INSTALL_DIR=. -G "Unix Makefiles" ../..
make
-Running `cmake -`" will display the list of available generators (passed using
+Running `cmake -h` will display the list of available generators (passed using
the `-G` option).
By default CMake hides compilation commands. This can be modified by specifying
`-DCMAKE_VERBOSE_MAKEFILE=true` when generating makefiles.
-
Building and testing with SCons
-------------------------------
-
**Note:** The SCons-based build system is deprecated. Please use CMake; see the
section above.
@@ -107,14 +133,7 @@ If you are building with Microsoft Visual Studio 2008, you need to set up the
environment by running `vcvars32.bat` (e.g. MSVC 2008 command prompt) before
running SCons.
-
-Running the tests manually
---------------------------
-
-Note that test can be run using SCons using the `check` target:
-
- scons platform=$PLATFORM check
-
+## Running the tests manually
You need to run tests manually only if you are troubleshooting an issue.
In the instructions below, replace `path/to/jsontest` with the path of the
@@ -137,45 +156,21 @@ In the instructions below, replace `path/to/jsontest` with the path of the
# You can run the tests using valgrind:
python rununittests.py --valgrind path/to/test_lib_json
+## Running the tests using scons
+Note that tests can be run using SCons using the `check` target:
+
+ scons platform=$PLATFORM check
Building the documentation
--------------------------
-
Run the Python script `doxybuild.py` from the top directory:
python doxybuild.py --doxygen=$(which doxygen) --open --with-dot
See `doxybuild.py --help` for options.
-
-Generating amalgamated source and header
-----------------------------------------
-
-JsonCpp is provided with a script to generate a single header and a single
-source file to ease inclusion into an existing project. The amalgamated source
-can be generated at any time by running the following command from the
-top-directory (this requires Python 2.6):
-
- python amalgamate.py
-
-It is possible to specify header name. See the `-h` option for detail.
-
-By default, the following files are generated:
-* `dist/jsoncpp.cpp`: source file that needs to be added to your project.
-* `dist/json/json.h`: corresponding header file for use in your project. It is
- equivalent to including `json/json.h` in non-amalgamated source. This header
- only depends on standard headers.
-* `dist/json/json-forwards.h`: header that provides forward declaration of all
- JsonCpp types.
-
-The amalgamated sources are generated by concatenating JsonCpp source in the
-correct order and defining the macro `JSON_IS_AMALGAMATION` to prevent inclusion
-of other headers.
-
-
Adding a reader/writer test
---------------------------
-
To add a test, you need to create two files in test/data:
* a `TESTNAME.json` file, that contains the input document in JSON format.
@@ -195,10 +190,8 @@ The `TESTNAME.expected` file format is as follows:
See the examples `test_complex_01.json` and `test_complex_01.expected` to better
understand element paths.
-
Understanding reader/writer test output
---------------------------------------
-
When a test is run, output files are generated beside the input test files.
Below is a short description of the content of each file:
@@ -215,10 +208,7 @@ Below is a short description of the content of each file:
* `test_complex_01.process-output`: `jsontest` output, typically useful for
understanding parsing errors.
-
License
-------
-
See the `LICENSE` file for details. In summary, JsonCpp is licensed under the
MIT license, or public domain if desired and recognized in your jurisdiction.
-
diff --git a/3rdparty/jsoncpp/SConstruct b/3rdparty/jsoncpp/SConstruct
index 1c55bcd0986..f3a73f773bf 100644
--- a/3rdparty/jsoncpp/SConstruct
+++ b/3rdparty/jsoncpp/SConstruct
@@ -237,7 +237,7 @@ RunUnitTests = ActionFactory(runUnitTests_action, runUnitTests_string )
env.Alias( 'check' )
srcdist_cmd = env['SRCDIST_ADD']( source = """
- AUTHORS README.txt SConstruct
+ AUTHORS README.md SConstruct
""".split() )
env.Alias( 'src-dist', srcdist_cmd )
diff --git a/3rdparty/jsoncpp/amalgamate.py b/3rdparty/jsoncpp/amalgamate.py
index 550f6a67624..1916bb0d5e7 100644
--- a/3rdparty/jsoncpp/amalgamate.py
+++ b/3rdparty/jsoncpp/amalgamate.py
@@ -1,6 +1,6 @@
"""Amalgate json-cpp library sources into a single source and header file.
-Requires Python 2.6
+Works with python2.6+ and python3.4+.
Example of invocation (must be invoked from json-cpp top directory):
python amalgate.py
@@ -10,46 +10,46 @@ import os.path
import sys
class AmalgamationFile:
- def __init__( self, top_dir ):
+ def __init__(self, top_dir):
self.top_dir = top_dir
self.blocks = []
- def add_text( self, text ):
- if not text.endswith( "\n" ):
+ def add_text(self, text):
+ if not text.endswith("\n"):
text += "\n"
- self.blocks.append( text )
-
- def add_file( self, relative_input_path, wrap_in_comment=False ):
- def add_marker( prefix ):
- self.add_text( "" )
- self.add_text( "// " + "/"*70 )
- self.add_text( "// %s of content of file: %s" % (prefix, relative_input_path.replace("\\","/")) )
- self.add_text( "// " + "/"*70 )
- self.add_text( "" )
- add_marker( "Beginning" )
- f = open( os.path.join( self.top_dir, relative_input_path ), "rt" )
+ self.blocks.append(text)
+
+ def add_file(self, relative_input_path, wrap_in_comment=False):
+ def add_marker(prefix):
+ self.add_text("")
+ self.add_text("// " + "/"*70)
+ self.add_text("// %s of content of file: %s" % (prefix, relative_input_path.replace("\\","/")))
+ self.add_text("// " + "/"*70)
+ self.add_text("")
+ add_marker("Beginning")
+ f = open(os.path.join(self.top_dir, relative_input_path), "rt")
content = f.read()
if wrap_in_comment:
content = "/*\n" + content + "\n*/"
- self.add_text( content )
+ self.add_text(content)
f.close()
- add_marker( "End" )
- self.add_text( "\n\n\n\n" )
-
- def get_value( self ):
- return "".join( self.blocks ).replace("\r\n","\n")
-
- def write_to( self, output_path ):
- output_dir = os.path.dirname( output_path )
- if output_dir and not os.path.isdir( output_dir ):
- os.makedirs( output_dir )
- f = open( output_path, "wb" )
- f.write( str.encode(self.get_value(), 'UTF-8') )
+ add_marker("End")
+ self.add_text("\n\n\n\n")
+
+ def get_value(self):
+ return "".join(self.blocks).replace("\r\n","\n")
+
+ def write_to(self, output_path):
+ output_dir = os.path.dirname(output_path)
+ if output_dir and not os.path.isdir(output_dir):
+ os.makedirs(output_dir)
+ f = open(output_path, "wb")
+ f.write(str.encode(self.get_value(), 'UTF-8'))
f.close()
-def amalgamate_source( source_top_dir=None,
+def amalgamate_source(source_top_dir=None,
target_source_path=None,
- header_include_path=None ):
+ header_include_path=None):
"""Produces amalgated source.
Parameters:
source_top_dir: top-directory
@@ -57,69 +57,73 @@ def amalgamate_source( source_top_dir=None,
header_include_path: generated header path relative to target_source_path.
"""
print("Amalgating header...")
- header = AmalgamationFile( source_top_dir )
- header.add_text( "/// Json-cpp amalgated header (http://jsoncpp.sourceforge.net/)." )
- header.add_text( "/// It is intented to be used with #include <%s>" % header_include_path )
- header.add_file( "LICENSE", wrap_in_comment=True )
- header.add_text( "#ifndef JSON_AMALGATED_H_INCLUDED" )
- header.add_text( "# define JSON_AMALGATED_H_INCLUDED" )
- header.add_text( "/// If defined, indicates that the source file is amalgated" )
- header.add_text( "/// to prevent private header inclusion." )
- header.add_text( "#define JSON_IS_AMALGAMATION" )
- header.add_file( "include/json/version.h" )
- header.add_file( "include/json/config.h" )
- header.add_file( "include/json/forwards.h" )
- header.add_file( "include/json/features.h" )
- header.add_file( "include/json/value.h" )
- header.add_file( "include/json/reader.h" )
- header.add_file( "include/json/writer.h" )
- header.add_file( "include/json/assertions.h" )
- header.add_text( "#endif //ifndef JSON_AMALGATED_H_INCLUDED" )
-
- target_header_path = os.path.join( os.path.dirname(target_source_path), header_include_path )
+ header = AmalgamationFile(source_top_dir)
+ header.add_text("/// Json-cpp amalgated header (http://jsoncpp.sourceforge.net/).")
+ header.add_text('/// It is intended to be used with #include "%s"' % header_include_path)
+ header.add_file("LICENSE", wrap_in_comment=True)
+ header.add_text("#ifndef JSON_AMALGATED_H_INCLUDED")
+ header.add_text("# define JSON_AMALGATED_H_INCLUDED")
+ header.add_text("/// If defined, indicates that the source file is amalgated")
+ header.add_text("/// to prevent private header inclusion.")
+ header.add_text("#define JSON_IS_AMALGAMATION")
+ header.add_file("include/json/version.h")
+ header.add_file("include/json/config.h")
+ header.add_file("include/json/forwards.h")
+ header.add_file("include/json/features.h")
+ header.add_file("include/json/value.h")
+ header.add_file("include/json/reader.h")
+ header.add_file("include/json/writer.h")
+ header.add_file("include/json/assertions.h")
+ header.add_text("#endif //ifndef JSON_AMALGATED_H_INCLUDED")
+
+ target_header_path = os.path.join(os.path.dirname(target_source_path), header_include_path)
print("Writing amalgated header to %r" % target_header_path)
- header.write_to( target_header_path )
+ header.write_to(target_header_path)
- base, ext = os.path.splitext( header_include_path )
+ base, ext = os.path.splitext(header_include_path)
forward_header_include_path = base + "-forwards" + ext
print("Amalgating forward header...")
- header = AmalgamationFile( source_top_dir )
- header.add_text( "/// Json-cpp amalgated forward header (http://jsoncpp.sourceforge.net/)." )
- header.add_text( "/// It is intented to be used with #include <%s>" % forward_header_include_path )
- header.add_text( "/// This header provides forward declaration for all JsonCpp types." )
- header.add_file( "LICENSE", wrap_in_comment=True )
- header.add_text( "#ifndef JSON_FORWARD_AMALGATED_H_INCLUDED" )
- header.add_text( "# define JSON_FORWARD_AMALGATED_H_INCLUDED" )
- header.add_text( "/// If defined, indicates that the source file is amalgated" )
- header.add_text( "/// to prevent private header inclusion." )
- header.add_text( "#define JSON_IS_AMALGAMATION" )
- header.add_file( "include/json/config.h" )
- header.add_file( "include/json/forwards.h" )
- header.add_text( "#endif //ifndef JSON_FORWARD_AMALGATED_H_INCLUDED" )
-
- target_forward_header_path = os.path.join( os.path.dirname(target_source_path),
- forward_header_include_path )
+ header = AmalgamationFile(source_top_dir)
+ header.add_text("/// Json-cpp amalgated forward header (http://jsoncpp.sourceforge.net/).")
+ header.add_text('/// It is intended to be used with #include "%s"' % forward_header_include_path)
+ header.add_text("/// This header provides forward declaration for all JsonCpp types.")
+ header.add_file("LICENSE", wrap_in_comment=True)
+ header.add_text("#ifndef JSON_FORWARD_AMALGATED_H_INCLUDED")
+ header.add_text("# define JSON_FORWARD_AMALGATED_H_INCLUDED")
+ header.add_text("/// If defined, indicates that the source file is amalgated")
+ header.add_text("/// to prevent private header inclusion.")
+ header.add_text("#define JSON_IS_AMALGAMATION")
+ header.add_file("include/json/config.h")
+ header.add_file("include/json/forwards.h")
+ header.add_text("#endif //ifndef JSON_FORWARD_AMALGATED_H_INCLUDED")
+
+ target_forward_header_path = os.path.join(os.path.dirname(target_source_path),
+ forward_header_include_path)
print("Writing amalgated forward header to %r" % target_forward_header_path)
- header.write_to( target_forward_header_path )
+ header.write_to(target_forward_header_path)
print("Amalgating source...")
- source = AmalgamationFile( source_top_dir )
- source.add_text( "/// Json-cpp amalgated source (http://jsoncpp.sourceforge.net/)." )
- source.add_text( "/// It is intented to be used with #include <%s>" % header_include_path )
- source.add_file( "LICENSE", wrap_in_comment=True )
- source.add_text( "" )
- source.add_text( "#include <%s>" % header_include_path )
- source.add_text( "" )
+ source = AmalgamationFile(source_top_dir)
+ source.add_text("/// Json-cpp amalgated source (http://jsoncpp.sourceforge.net/).")
+ source.add_text('/// It is intended to be used with #include "%s"' % header_include_path)
+ source.add_file("LICENSE", wrap_in_comment=True)
+ source.add_text("")
+ source.add_text('#include "%s"' % header_include_path)
+ source.add_text("""
+#ifndef JSON_IS_AMALGAMATION
+#error "Compile with -I PATH_TO_JSON_DIRECTORY"
+#endif
+""")
+ source.add_text("")
lib_json = "src/lib_json"
- source.add_file( os.path.join(lib_json, "json_tool.h") )
- source.add_file( os.path.join(lib_json, "json_reader.cpp") )
- source.add_file( os.path.join(lib_json, "json_batchallocator.h") )
- source.add_file( os.path.join(lib_json, "json_valueiterator.inl") )
- source.add_file( os.path.join(lib_json, "json_value.cpp") )
- source.add_file( os.path.join(lib_json, "json_writer.cpp") )
+ source.add_file(os.path.join(lib_json, "json_tool.h"))
+ source.add_file(os.path.join(lib_json, "json_reader.cpp"))
+ source.add_file(os.path.join(lib_json, "json_valueiterator.inl"))
+ source.add_file(os.path.join(lib_json, "json_value.cpp"))
+ source.add_file(os.path.join(lib_json, "json_writer.cpp"))
print("Writing amalgated source to %r" % target_source_path)
- source.write_to( target_source_path )
+ source.write_to(target_source_path)
def main():
usage = """%prog [options]
@@ -137,12 +141,12 @@ Generate a single amalgated source and header file from the sources.
parser.enable_interspersed_args()
options, args = parser.parse_args()
- msg = amalgamate_source( source_top_dir=options.top_dir,
+ msg = amalgamate_source(source_top_dir=options.top_dir,
target_source_path=options.target_source_path,
- header_include_path=options.header_include_path )
+ header_include_path=options.header_include_path)
if msg:
- sys.stderr.write( msg + "\n" )
- sys.exit( 1 )
+ sys.stderr.write(msg + "\n")
+ sys.exit(1)
else:
print("Source succesfully amalagated")
diff --git a/3rdparty/jsoncpp/appveyor.yml b/3rdparty/jsoncpp/appveyor.yml
new file mode 100644
index 00000000000..546cb7ed13e
--- /dev/null
+++ b/3rdparty/jsoncpp/appveyor.yml
@@ -0,0 +1,34 @@
+# This is a comment.
+
+version: build.{build}
+
+os: Windows Server 2012 R2
+
+clone_folder: c:\projects\jsoncpp
+
+platform:
+ - Win32
+ - x64
+
+configuration:
+ - Debug
+ - Release
+
+# scripts to run before build
+before_build:
+ - echo "Running cmake..."
+ - cd c:\projects\jsoncpp
+ - cmake --version
+ - if %PLATFORM% == Win32 cmake .
+ - if %PLATFORM% == x64 cmake -G "Visual Studio 12 2013 Win64" .
+
+build:
+ project: jsoncpp.sln # path to Visual Studio solution or project
+
+deploy:
+ provider: GitHub
+ auth_token:
+ secure: K2Tp1q8pIZ7rs0Ot24ZMWuwr12Ev6Tc6QkhMjGQxoQG3ng1pXtgPasiJ45IDXGdg
+ on:
+ branch: master
+ appveyor_repo_tag: true
diff --git a/3rdparty/jsoncpp/dev.makefile b/3rdparty/jsoncpp/dev.makefile
index dd16bdd6ef9..d288b166586 100644
--- a/3rdparty/jsoncpp/dev.makefile
+++ b/3rdparty/jsoncpp/dev.makefile
@@ -1,14 +1,35 @@
-all: build test-amalgamate
+# This is only for jsoncpp developers/contributors.
+# We use this to sign releases, generate documentation, etc.
+VER?=$(shell cat version)
+default:
+ @echo "VER=${VER}"
+sign: jsoncpp-${VER}.tar.gz
+ gpg --armor --detach-sign $<
+ gpg --verify $<.asc
+ # Then upload .asc to the release.
+jsoncpp-%.tar.gz:
+ curl https://github.com/open-source-parsers/jsoncpp/archive/$*.tar.gz -o $@
+dox:
+ python doxybuild.py --doxygen=$$(which doxygen) --in doc/web_doxyfile.in
+ rsync -va --delete dist/doxygen/jsoncpp-api-html-${VER}/ ../jsoncpp-docs/doxygen/
+ # Then 'git add -A' and 'git push' in jsoncpp-docs.
build:
mkdir -p build/debug
- cd build/debug; cmake -DCMAKE_BUILD_TYPE=debug -DJSONCPP_LIB_BUILD_SHARED=ON -G "Unix Makefiles" ../..
+ cd build/debug; cmake -DCMAKE_BUILD_TYPE=debug -DBUILD_SHARED_LIBS=ON -G "Unix Makefiles" ../..
make -C build/debug
# Currently, this depends on include/json/version.h generated
# by cmake.
-test-amalgamate: build
+test-amalgamate:
python2.7 amalgamate.py
python3.4 amalgamate.py
+ cd dist; gcc -I. -c jsoncpp.cpp
+
+valgrind:
+ valgrind --error-exitcode=42 --leak-check=full ./build/debug/src/test_lib_json/jsoncpp_test
+
+clean:
+ \rm -rf *.gz *.asc dist/
.PHONY: build
diff --git a/3rdparty/jsoncpp/devtools/__init__.py b/3rdparty/jsoncpp/devtools/__init__.py
index c944e7cb0c0..d18a5216853 100644
--- a/3rdparty/jsoncpp/devtools/__init__.py
+++ b/3rdparty/jsoncpp/devtools/__init__.py
@@ -1 +1,6 @@
-# module \ No newline at end of file
+# Copyright 2010 Baptiste Lepilleur
+# Distributed under MIT license, or public domain if desired and
+# recognized in your jurisdiction.
+# See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
+
+# module
diff --git a/3rdparty/jsoncpp/devtools/agent_vmw7.json b/3rdparty/jsoncpp/devtools/agent_vmw7.json
index a1db7db6f18..0810a99544e 100644
--- a/3rdparty/jsoncpp/devtools/agent_vmw7.json
+++ b/3rdparty/jsoncpp/devtools/agent_vmw7.json
@@ -19,8 +19,8 @@
},
{"name": "shared_dll",
"variables": [
- ["JSONCPP_LIB_BUILD_SHARED=true"],
- ["JSONCPP_LIB_BUILD_SHARED=false"]
+ ["BUILD_SHARED_LIBS=true"],
+ ["BUILD_SHARED_LIBS=false"]
]
},
{"name": "build_type",
diff --git a/3rdparty/jsoncpp/devtools/agent_vmxp.json b/3rdparty/jsoncpp/devtools/agent_vmxp.json
index d34cf86addf..b627a7221a7 100644
--- a/3rdparty/jsoncpp/devtools/agent_vmxp.json
+++ b/3rdparty/jsoncpp/devtools/agent_vmxp.json
@@ -12,8 +12,8 @@
},
{"name": "shared_dll",
"variables": [
- ["JSONCPP_LIB_BUILD_SHARED=true"],
- ["JSONCPP_LIB_BUILD_SHARED=false"]
+ ["BUILD_SHARED_LIBS=true"],
+ ["BUILD_SHARED_LIBS=false"]
]
},
{"name": "build_type",
diff --git a/3rdparty/jsoncpp/devtools/antglob.py b/3rdparty/jsoncpp/devtools/antglob.py
index 8b7b4ca297e..c272f66343f 100644
--- a/3rdparty/jsoncpp/devtools/antglob.py
+++ b/3rdparty/jsoncpp/devtools/antglob.py
@@ -1,6 +1,9 @@
#!/usr/bin/env python
# encoding: utf-8
-# Baptiste Lepilleur, 2009
+# Copyright 2009 Baptiste Lepilleur
+# Distributed under MIT license, or public domain if desired and
+# recognized in your jurisdiction.
+# See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
from __future__ import print_function
from dircache import listdir
@@ -54,9 +57,9 @@ LINKS = DIR_LINK | FILE_LINK
ALL_NO_LINK = DIR | FILE
ALL = DIR | FILE | LINKS
-_ANT_RE = re.compile( r'(/\*\*/)|(\*\*/)|(/\*\*)|(\*)|(/)|([^\*/]*)' )
+_ANT_RE = re.compile(r'(/\*\*/)|(\*\*/)|(/\*\*)|(\*)|(/)|([^\*/]*)')
-def ant_pattern_to_re( ant_pattern ):
+def ant_pattern_to_re(ant_pattern):
"""Generates a regular expression from the ant pattern.
Matching convention:
**/a: match 'a', 'dir/a', 'dir1/dir2/a'
@@ -65,30 +68,30 @@ def ant_pattern_to_re( ant_pattern ):
"""
rex = ['^']
next_pos = 0
- sep_rex = r'(?:/|%s)' % re.escape( os.path.sep )
+ sep_rex = r'(?:/|%s)' % re.escape(os.path.sep)
## print 'Converting', ant_pattern
- for match in _ANT_RE.finditer( ant_pattern ):
+ for match in _ANT_RE.finditer(ant_pattern):
## print 'Matched', match.group()
## print match.start(0), next_pos
if match.start(0) != next_pos:
- raise ValueError( "Invalid ant pattern" )
+ raise ValueError("Invalid ant pattern")
if match.group(1): # /**/
- rex.append( sep_rex + '(?:.*%s)?' % sep_rex )
+ rex.append(sep_rex + '(?:.*%s)?' % sep_rex)
elif match.group(2): # **/
- rex.append( '(?:.*%s)?' % sep_rex )
+ rex.append('(?:.*%s)?' % sep_rex)
elif match.group(3): # /**
- rex.append( sep_rex + '.*' )
+ rex.append(sep_rex + '.*')
elif match.group(4): # *
- rex.append( '[^/%s]*' % re.escape(os.path.sep) )
+ rex.append('[^/%s]*' % re.escape(os.path.sep))
elif match.group(5): # /
- rex.append( sep_rex )
+ rex.append(sep_rex)
else: # somepath
- rex.append( re.escape(match.group(6)) )
+ rex.append(re.escape(match.group(6)))
next_pos = match.end()
rex.append('$')
- return re.compile( ''.join( rex ) )
+ return re.compile(''.join(rex))
-def _as_list( l ):
+def _as_list(l):
if isinstance(l, basestring):
return l.split()
return l
@@ -105,37 +108,37 @@ def glob(dir_path,
dir_path = dir_path.replace('/',os.path.sep)
entry_type_filter = entry_type
- def is_pruned_dir( dir_name ):
+ def is_pruned_dir(dir_name):
for pattern in prune_dirs:
- if fnmatch.fnmatch( dir_name, pattern ):
+ if fnmatch.fnmatch(dir_name, pattern):
return True
return False
- def apply_filter( full_path, filter_rexs ):
+ def apply_filter(full_path, filter_rexs):
"""Return True if at least one of the filter regular expression match full_path."""
for rex in filter_rexs:
- if rex.match( full_path ):
+ if rex.match(full_path):
return True
return False
- def glob_impl( root_dir_path ):
+ def glob_impl(root_dir_path):
child_dirs = [root_dir_path]
while child_dirs:
dir_path = child_dirs.pop()
- for entry in listdir( dir_path ):
- full_path = os.path.join( dir_path, entry )
+ for entry in listdir(dir_path):
+ full_path = os.path.join(dir_path, entry)
## print 'Testing:', full_path,
- is_dir = os.path.isdir( full_path )
- if is_dir and not is_pruned_dir( entry ): # explore child directory ?
+ is_dir = os.path.isdir(full_path)
+ if is_dir and not is_pruned_dir(entry): # explore child directory ?
## print '===> marked for recursion',
- child_dirs.append( full_path )
- included = apply_filter( full_path, include_filter )
- rejected = apply_filter( full_path, exclude_filter )
+ child_dirs.append(full_path)
+ included = apply_filter(full_path, include_filter)
+ rejected = apply_filter(full_path, exclude_filter)
if not included or rejected: # do not include entry ?
## print '=> not included or rejected'
continue
- link = os.path.islink( full_path )
- is_file = os.path.isfile( full_path )
+ link = os.path.islink(full_path)
+ is_file = os.path.isfile(full_path)
if not is_file and not is_dir:
## print '=> unknown entry type'
continue
@@ -146,57 +149,57 @@ def glob(dir_path,
## print '=> type: %d' % entry_type,
if (entry_type & entry_type_filter) != 0:
## print ' => KEEP'
- yield os.path.join( dir_path, entry )
+ yield os.path.join(dir_path, entry)
## else:
## print ' => TYPE REJECTED'
- return list( glob_impl( dir_path ) )
+ return list(glob_impl(dir_path))
if __name__ == "__main__":
import unittest
class AntPatternToRETest(unittest.TestCase):
-## def test_conversion( self ):
-## self.assertEqual( '^somepath$', ant_pattern_to_re( 'somepath' ).pattern )
+## def test_conversion(self):
+## self.assertEqual('^somepath$', ant_pattern_to_re('somepath').pattern)
- def test_matching( self ):
- test_cases = [ ( 'path',
+ def test_matching(self):
+ test_cases = [ ('path',
['path'],
- ['somepath', 'pathsuffix', '/path', '/path'] ),
- ( '*.py',
+ ['somepath', 'pathsuffix', '/path', '/path']),
+ ('*.py',
['source.py', 'source.ext.py', '.py'],
- ['path/source.py', '/.py', 'dir.py/z', 'z.pyc', 'z.c'] ),
- ( '**/path',
+ ['path/source.py', '/.py', 'dir.py/z', 'z.pyc', 'z.c']),
+ ('**/path',
['path', '/path', '/a/path', 'c:/a/path', '/a/b/path', '//a/path', '/a/path/b/path'],
- ['path/', 'a/path/b', 'dir.py/z', 'somepath', 'pathsuffix', 'a/somepath'] ),
- ( 'path/**',
+ ['path/', 'a/path/b', 'dir.py/z', 'somepath', 'pathsuffix', 'a/somepath']),
+ ('path/**',
['path/a', 'path/path/a', 'path//'],
- ['path', 'somepath/a', 'a/path', 'a/path/a', 'pathsuffix/a'] ),
- ( '/**/path',
+ ['path', 'somepath/a', 'a/path', 'a/path/a', 'pathsuffix/a']),
+ ('/**/path',
['/path', '/a/path', '/a/b/path/path', '/path/path'],
- ['path', 'path/', 'a/path', '/pathsuffix', '/somepath'] ),
- ( 'a/b',
+ ['path', 'path/', 'a/path', '/pathsuffix', '/somepath']),
+ ('a/b',
['a/b'],
- ['somea/b', 'a/bsuffix', 'a/b/c'] ),
- ( '**/*.py',
+ ['somea/b', 'a/bsuffix', 'a/b/c']),
+ ('**/*.py',
['script.py', 'src/script.py', 'a/b/script.py', '/a/b/script.py'],
- ['script.pyc', 'script.pyo', 'a.py/b'] ),
- ( 'src/**/*.py',
+ ['script.pyc', 'script.pyo', 'a.py/b']),
+ ('src/**/*.py',
['src/a.py', 'src/dir/a.py'],
- ['a/src/a.py', '/src/a.py'] ),
+ ['a/src/a.py', '/src/a.py']),
]
for ant_pattern, accepted_matches, rejected_matches in list(test_cases):
- def local_path( paths ):
+ def local_path(paths):
return [ p.replace('/',os.path.sep) for p in paths ]
- test_cases.append( (ant_pattern, local_path(accepted_matches), local_path( rejected_matches )) )
+ test_cases.append((ant_pattern, local_path(accepted_matches), local_path(rejected_matches)))
for ant_pattern, accepted_matches, rejected_matches in test_cases:
- rex = ant_pattern_to_re( ant_pattern )
+ rex = ant_pattern_to_re(ant_pattern)
print('ant_pattern:', ant_pattern, ' => ', rex.pattern)
for accepted_match in accepted_matches:
print('Accepted?:', accepted_match)
- self.assertTrue( rex.match( accepted_match ) is not None )
+ self.assertTrue(rex.match(accepted_match) is not None)
for rejected_match in rejected_matches:
print('Rejected?:', rejected_match)
- self.assertTrue( rex.match( rejected_match ) is None )
+ self.assertTrue(rex.match(rejected_match) is None)
unittest.main()
diff --git a/3rdparty/jsoncpp/devtools/batchbuild.py b/3rdparty/jsoncpp/devtools/batchbuild.py
index 6f57945a7c3..0eb0690e8c6 100644
--- a/3rdparty/jsoncpp/devtools/batchbuild.py
+++ b/3rdparty/jsoncpp/devtools/batchbuild.py
@@ -18,62 +18,62 @@ class BuildDesc:
self.build_type = build_type
self.generator = generator
- def merged_with( self, build_desc ):
+ def merged_with(self, build_desc):
"""Returns a new BuildDesc by merging field content.
Prefer build_desc fields to self fields for single valued field.
"""
- return BuildDesc( self.prepend_envs + build_desc.prepend_envs,
+ return BuildDesc(self.prepend_envs + build_desc.prepend_envs,
self.variables + build_desc.variables,
build_desc.build_type or self.build_type,
- build_desc.generator or self.generator )
+ build_desc.generator or self.generator)
- def env( self ):
+ def env(self):
environ = os.environ.copy()
for values_by_name in self.prepend_envs:
for var, value in list(values_by_name.items()):
var = var.upper()
if type(value) is unicode:
- value = value.encode( sys.getdefaultencoding() )
+ value = value.encode(sys.getdefaultencoding())
if var in environ:
environ[var] = value + os.pathsep + environ[var]
else:
environ[var] = value
return environ
- def cmake_args( self ):
+ def cmake_args(self):
args = ["-D%s" % var for var in self.variables]
# skip build type for Visual Studio solution as it cause warning
if self.build_type and 'Visual' not in self.generator:
- args.append( "-DCMAKE_BUILD_TYPE=%s" % self.build_type )
+ args.append("-DCMAKE_BUILD_TYPE=%s" % self.build_type)
if self.generator:
- args.extend( ['-G', self.generator] )
+ args.extend(['-G', self.generator])
return args
- def __repr__( self ):
- return "BuildDesc( %s, build_type=%s )" % (" ".join( self.cmake_args()), self.build_type)
+ def __repr__(self):
+ return "BuildDesc(%s, build_type=%s)" % (" ".join(self.cmake_args()), self.build_type)
class BuildData:
- def __init__( self, desc, work_dir, source_dir ):
+ def __init__(self, desc, work_dir, source_dir):
self.desc = desc
self.work_dir = work_dir
self.source_dir = source_dir
- self.cmake_log_path = os.path.join( work_dir, 'batchbuild_cmake.log' )
- self.build_log_path = os.path.join( work_dir, 'batchbuild_build.log' )
+ self.cmake_log_path = os.path.join(work_dir, 'batchbuild_cmake.log')
+ self.build_log_path = os.path.join(work_dir, 'batchbuild_build.log')
self.cmake_succeeded = False
self.build_succeeded = False
def execute_build(self):
print('Build %s' % self.desc)
- self._make_new_work_dir( )
- self.cmake_succeeded = self._generate_makefiles( )
+ self._make_new_work_dir()
+ self.cmake_succeeded = self._generate_makefiles()
if self.cmake_succeeded:
- self.build_succeeded = self._build_using_makefiles( )
+ self.build_succeeded = self._build_using_makefiles()
return self.build_succeeded
def _generate_makefiles(self):
print(' Generating makefiles: ', end=' ')
- cmd = ['cmake'] + self.desc.cmake_args( ) + [os.path.abspath( self.source_dir )]
- succeeded = self._execute_build_subprocess( cmd, self.desc.env(), self.cmake_log_path )
+ cmd = ['cmake'] + self.desc.cmake_args() + [os.path.abspath(self.source_dir)]
+ succeeded = self._execute_build_subprocess(cmd, self.desc.env(), self.cmake_log_path)
print('done' if succeeded else 'FAILED')
return succeeded
@@ -82,58 +82,58 @@ class BuildData:
cmd = ['cmake', '--build', self.work_dir]
if self.desc.build_type:
cmd += ['--config', self.desc.build_type]
- succeeded = self._execute_build_subprocess( cmd, self.desc.env(), self.build_log_path )
+ succeeded = self._execute_build_subprocess(cmd, self.desc.env(), self.build_log_path)
print('done' if succeeded else 'FAILED')
return succeeded
def _execute_build_subprocess(self, cmd, env, log_path):
- process = subprocess.Popen( cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, cwd=self.work_dir,
- env=env )
- stdout, _ = process.communicate( )
+ process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, cwd=self.work_dir,
+ env=env)
+ stdout, _ = process.communicate()
succeeded = (process.returncode == 0)
- with open( log_path, 'wb' ) as flog:
- log = ' '.join( cmd ) + '\n' + stdout + '\nExit code: %r\n' % process.returncode
- flog.write( fix_eol( log ) )
+ with open(log_path, 'wb') as flog:
+ log = ' '.join(cmd) + '\n' + stdout + '\nExit code: %r\n' % process.returncode
+ flog.write(fix_eol(log))
return succeeded
def _make_new_work_dir(self):
- if os.path.isdir( self.work_dir ):
+ if os.path.isdir(self.work_dir):
print(' Removing work directory', self.work_dir)
- shutil.rmtree( self.work_dir, ignore_errors=True )
- if not os.path.isdir( self.work_dir ):
- os.makedirs( self.work_dir )
+ shutil.rmtree(self.work_dir, ignore_errors=True)
+ if not os.path.isdir(self.work_dir):
+ os.makedirs(self.work_dir)
-def fix_eol( stdout ):
+def fix_eol(stdout):
"""Fixes wrong EOL produced by cmake --build on Windows (\r\r\n instead of \r\n).
"""
- return re.sub( '\r*\n', os.linesep, stdout )
+ return re.sub('\r*\n', os.linesep, stdout)
-def load_build_variants_from_config( config_path ):
- with open( config_path, 'rb' ) as fconfig:
- data = json.load( fconfig )
+def load_build_variants_from_config(config_path):
+ with open(config_path, 'rb') as fconfig:
+ data = json.load(fconfig)
variants = data[ 'cmake_variants' ]
- build_descs_by_axis = collections.defaultdict( list )
+ build_descs_by_axis = collections.defaultdict(list)
for axis in variants:
axis_name = axis["name"]
build_descs = []
if "generators" in axis:
for generator_data in axis["generators"]:
for generator in generator_data["generator"]:
- build_desc = BuildDesc( generator=generator,
- prepend_envs=generator_data.get("env_prepend") )
- build_descs.append( build_desc )
+ build_desc = BuildDesc(generator=generator,
+ prepend_envs=generator_data.get("env_prepend"))
+ build_descs.append(build_desc)
elif "variables" in axis:
for variables in axis["variables"]:
- build_desc = BuildDesc( variables=variables )
- build_descs.append( build_desc )
+ build_desc = BuildDesc(variables=variables)
+ build_descs.append(build_desc)
elif "build_types" in axis:
for build_type in axis["build_types"]:
- build_desc = BuildDesc( build_type=build_type )
- build_descs.append( build_desc )
- build_descs_by_axis[axis_name].extend( build_descs )
+ build_desc = BuildDesc(build_type=build_type)
+ build_descs.append(build_desc)
+ build_descs_by_axis[axis_name].extend(build_descs)
return build_descs_by_axis
-def generate_build_variants( build_descs_by_axis ):
+def generate_build_variants(build_descs_by_axis):
"""Returns a list of BuildDesc generated for the partial BuildDesc for each axis."""
axis_names = list(build_descs_by_axis.keys())
build_descs = []
@@ -141,8 +141,8 @@ def generate_build_variants( build_descs_by_axis ):
if len(build_descs):
# for each existing build_desc and each axis build desc, create a new build_desc
new_build_descs = []
- for prototype_build_desc, axis_build_desc in itertools.product( build_descs, axis_build_descs):
- new_build_descs.append( prototype_build_desc.merged_with( axis_build_desc ) )
+ for prototype_build_desc, axis_build_desc in itertools.product(build_descs, axis_build_descs):
+ new_build_descs.append(prototype_build_desc.merged_with(axis_build_desc))
build_descs = new_build_descs
else:
build_descs = axis_build_descs
@@ -174,60 +174,57 @@ $tr_builds
</table>
</body></html>''')
-def generate_html_report( html_report_path, builds ):
- report_dir = os.path.dirname( html_report_path )
+def generate_html_report(html_report_path, builds):
+ report_dir = os.path.dirname(html_report_path)
# Vertical axis: generator
# Horizontal: variables, then build_type
- builds_by_generator = collections.defaultdict( list )
+ builds_by_generator = collections.defaultdict(list)
variables = set()
- build_types_by_variable = collections.defaultdict( set )
+ build_types_by_variable = collections.defaultdict(set)
build_by_pos_key = {} # { (generator, var_key, build_type): build }
for build in builds:
- builds_by_generator[build.desc.generator].append( build )
+ builds_by_generator[build.desc.generator].append(build)
var_key = tuple(sorted(build.desc.variables))
- variables.add( var_key )
- build_types_by_variable[var_key].add( build.desc.build_type )
+ variables.add(var_key)
+ build_types_by_variable[var_key].add(build.desc.build_type)
pos_key = (build.desc.generator, var_key, build.desc.build_type)
build_by_pos_key[pos_key] = build
- variables = sorted( variables )
+ variables = sorted(variables)
th_vars = []
th_build_types = []
for variable in variables:
- build_types = sorted( build_types_by_variable[variable] )
+ build_types = sorted(build_types_by_variable[variable])
nb_build_type = len(build_types_by_variable[variable])
- th_vars.append( '<th colspan="%d">%s</th>' % (nb_build_type, cgi.escape( ' '.join( variable ) ) ) )
+ th_vars.append('<th colspan="%d">%s</th>' % (nb_build_type, cgi.escape(' '.join(variable))))
for build_type in build_types:
- th_build_types.append( '<th>%s</th>' % cgi.escape(build_type) )
+ th_build_types.append('<th>%s</th>' % cgi.escape(build_type))
tr_builds = []
- for generator in sorted( builds_by_generator ):
- tds = [ '<td>%s</td>\n' % cgi.escape( generator ) ]
+ for generator in sorted(builds_by_generator):
+ tds = [ '<td>%s</td>\n' % cgi.escape(generator) ]
for variable in variables:
- build_types = sorted( build_types_by_variable[variable] )
+ build_types = sorted(build_types_by_variable[variable])
for build_type in build_types:
pos_key = (generator, variable, build_type)
build = build_by_pos_key.get(pos_key)
if build:
cmake_status = 'ok' if build.cmake_succeeded else 'FAILED'
build_status = 'ok' if build.build_succeeded else 'FAILED'
- cmake_log_url = os.path.relpath( build.cmake_log_path, report_dir )
- build_log_url = os.path.relpath( build.build_log_path, report_dir )
- td = '<td class="%s"><a href="%s" class="%s">CMake: %s</a>' % (
- build_status.lower(), cmake_log_url, cmake_status.lower(), cmake_status)
+ cmake_log_url = os.path.relpath(build.cmake_log_path, report_dir)
+ build_log_url = os.path.relpath(build.build_log_path, report_dir)
+ td = '<td class="%s"><a href="%s" class="%s">CMake: %s</a>' % ( build_status.lower(), cmake_log_url, cmake_status.lower(), cmake_status)
if build.cmake_succeeded:
- td += '<br><a href="%s" class="%s">Build: %s</a>' % (
- build_log_url, build_status.lower(), build_status)
+ td += '<br><a href="%s" class="%s">Build: %s</a>' % ( build_log_url, build_status.lower(), build_status)
td += '</td>'
else:
td = '<td></td>'
- tds.append( td )
- tr_builds.append( '<tr>%s</tr>' % '\n'.join( tds ) )
- html = HTML_TEMPLATE.substitute(
- title='Batch build report',
+ tds.append(td)
+ tr_builds.append('<tr>%s</tr>' % '\n'.join(tds))
+ html = HTML_TEMPLATE.substitute( title='Batch build report',
th_vars=' '.join(th_vars),
- th_build_types=' '.join( th_build_types),
- tr_builds='\n'.join( tr_builds ) )
- with open( html_report_path, 'wt' ) as fhtml:
- fhtml.write( html )
+ th_build_types=' '.join(th_build_types),
+ tr_builds='\n'.join(tr_builds))
+ with open(html_report_path, 'wt') as fhtml:
+ fhtml.write(html)
print('HTML report generated in:', html_report_path)
def main():
@@ -246,33 +243,33 @@ python devtools\batchbuild.py e:\buildbots\jsoncpp\build . devtools\agent_vmw7.j
parser.enable_interspersed_args()
options, args = parser.parse_args()
if len(args) < 3:
- parser.error( "Missing one of WORK_DIR SOURCE_DIR CONFIG_JSON_PATH." )
+ parser.error("Missing one of WORK_DIR SOURCE_DIR CONFIG_JSON_PATH.")
work_dir = args[0]
source_dir = args[1].rstrip('/\\')
config_paths = args[2:]
for config_path in config_paths:
- if not os.path.isfile( config_path ):
- parser.error( "Can not read: %r" % config_path )
+ if not os.path.isfile(config_path):
+ parser.error("Can not read: %r" % config_path)
# generate build variants
build_descs = []
for config_path in config_paths:
- build_descs_by_axis = load_build_variants_from_config( config_path )
- build_descs.extend( generate_build_variants( build_descs_by_axis ) )
+ build_descs_by_axis = load_build_variants_from_config(config_path)
+ build_descs.extend(generate_build_variants(build_descs_by_axis))
print('Build variants (%d):' % len(build_descs))
# assign build directory for each variant
- if not os.path.isdir( work_dir ):
- os.makedirs( work_dir )
+ if not os.path.isdir(work_dir):
+ os.makedirs(work_dir)
builds = []
- with open( os.path.join( work_dir, 'matrix-dir-map.txt' ), 'wt' ) as fmatrixmap:
- for index, build_desc in enumerate( build_descs ):
- build_desc_work_dir = os.path.join( work_dir, '%03d' % (index+1) )
- builds.append( BuildData( build_desc, build_desc_work_dir, source_dir ) )
- fmatrixmap.write( '%s: %s\n' % (build_desc_work_dir, build_desc) )
+ with open(os.path.join(work_dir, 'matrix-dir-map.txt'), 'wt') as fmatrixmap:
+ for index, build_desc in enumerate(build_descs):
+ build_desc_work_dir = os.path.join(work_dir, '%03d' % (index+1))
+ builds.append(BuildData(build_desc, build_desc_work_dir, source_dir))
+ fmatrixmap.write('%s: %s\n' % (build_desc_work_dir, build_desc))
for build in builds:
build.execute_build()
- html_report_path = os.path.join( work_dir, 'batchbuild-report.html' )
- generate_html_report( html_report_path, builds )
+ html_report_path = os.path.join(work_dir, 'batchbuild-report.html')
+ generate_html_report(html_report_path, builds)
print('Done')
diff --git a/3rdparty/jsoncpp/devtools/fixeol.py b/3rdparty/jsoncpp/devtools/fixeol.py
index 53af7612bc7..054eb9b227b 100644
--- a/3rdparty/jsoncpp/devtools/fixeol.py
+++ b/3rdparty/jsoncpp/devtools/fixeol.py
@@ -1,10 +1,15 @@
+# Copyright 2010 Baptiste Lepilleur
+# Distributed under MIT license, or public domain if desired and
+# recognized in your jurisdiction.
+# See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
+
from __future__ import print_function
import os.path
-def fix_source_eol( path, is_dry_run = True, verbose = True, eol = '\n' ):
+def fix_source_eol(path, is_dry_run = True, verbose = True, eol = '\n'):
"""Makes sure that all sources have the specified eol sequence (default: unix)."""
- if not os.path.isfile( path ):
- raise ValueError( 'Path "%s" is not a file' % path )
+ if not os.path.isfile(path):
+ raise ValueError('Path "%s" is not a file' % path)
try:
f = open(path, 'rb')
except IOError as msg:
@@ -29,27 +34,27 @@ def fix_source_eol( path, is_dry_run = True, verbose = True, eol = '\n' ):
##
##
##
-##def _do_fix( is_dry_run = True ):
+##def _do_fix(is_dry_run = True):
## from waftools import antglob
-## python_sources = antglob.glob( '.',
+## python_sources = antglob.glob('.',
## includes = '**/*.py **/wscript **/wscript_build',
## excludes = antglob.default_excludes + './waf.py',
-## prune_dirs = antglob.prune_dirs + 'waf-* ./build' )
+## prune_dirs = antglob.prune_dirs + 'waf-* ./build')
## for path in python_sources:
-## _fix_python_source( path, is_dry_run )
+## _fix_python_source(path, is_dry_run)
##
-## cpp_sources = antglob.glob( '.',
+## cpp_sources = antglob.glob('.',
## includes = '**/*.cpp **/*.h **/*.inl',
-## prune_dirs = antglob.prune_dirs + 'waf-* ./build' )
+## prune_dirs = antglob.prune_dirs + 'waf-* ./build')
## for path in cpp_sources:
-## _fix_source_eol( path, is_dry_run )
+## _fix_source_eol(path, is_dry_run)
##
##
##def dry_fix(context):
-## _do_fix( is_dry_run = True )
+## _do_fix(is_dry_run = True)
##
##def fix(context):
-## _do_fix( is_dry_run = False )
+## _do_fix(is_dry_run = False)
##
##def shutdown():
## pass
diff --git a/3rdparty/jsoncpp/devtools/licenseupdater.py b/3rdparty/jsoncpp/devtools/licenseupdater.py
index 8cb71d737b3..6f823618fb9 100644
--- a/3rdparty/jsoncpp/devtools/licenseupdater.py
+++ b/3rdparty/jsoncpp/devtools/licenseupdater.py
@@ -13,7 +13,7 @@ BRIEF_LICENSE = LICENSE_BEGIN + """2007-2010 Baptiste Lepilleur
""".replace('\r\n','\n')
-def update_license( path, dry_run, show_diff ):
+def update_license(path, dry_run, show_diff):
"""Update the license statement in the specified file.
Parameters:
path: path of the C++ source file to update.
@@ -22,28 +22,28 @@ def update_license( path, dry_run, show_diff ):
show_diff: if True, print the path of the file that would be modified,
as well as the change made to the file.
"""
- with open( path, 'rt' ) as fin:
+ with open(path, 'rt') as fin:
original_text = fin.read().replace('\r\n','\n')
newline = fin.newlines and fin.newlines[0] or '\n'
- if not original_text.startswith( LICENSE_BEGIN ):
+ if not original_text.startswith(LICENSE_BEGIN):
# No existing license found => prepend it
new_text = BRIEF_LICENSE + original_text
else:
- license_end_index = original_text.index( '\n\n' ) # search first blank line
+ license_end_index = original_text.index('\n\n') # search first blank line
new_text = BRIEF_LICENSE + original_text[license_end_index+2:]
if original_text != new_text:
if not dry_run:
- with open( path, 'wb' ) as fout:
- fout.write( new_text.replace('\n', newline ) )
+ with open(path, 'wb') as fout:
+ fout.write(new_text.replace('\n', newline))
print('Updated', path)
if show_diff:
import difflib
- print('\n'.join( difflib.unified_diff( original_text.split('\n'),
- new_text.split('\n') ) ))
+ print('\n'.join(difflib.unified_diff(original_text.split('\n'),
+ new_text.split('\n'))))
return True
return False
-def update_license_in_source_directories( source_dirs, dry_run, show_diff ):
+def update_license_in_source_directories(source_dirs, dry_run, show_diff):
"""Updates license text in C++ source files found in directory source_dirs.
Parameters:
source_dirs: list of directory to scan for C++ sources. Directories are
@@ -56,11 +56,11 @@ def update_license_in_source_directories( source_dirs, dry_run, show_diff ):
from devtools import antglob
prune_dirs = antglob.prune_dirs + 'scons-local* ./build* ./libs ./dist'
for source_dir in source_dirs:
- cpp_sources = antglob.glob( source_dir,
+ cpp_sources = antglob.glob(source_dir,
includes = '''**/*.h **/*.cpp **/*.inl''',
- prune_dirs = prune_dirs )
+ prune_dirs = prune_dirs)
for source in cpp_sources:
- update_license( source, dry_run, show_diff )
+ update_license(source, dry_run, show_diff)
def main():
usage = """%prog DIR [DIR2...]
@@ -83,7 +83,7 @@ python devtools\licenseupdater.py include src
help="""On update, show change made to the file.""")
parser.enable_interspersed_args()
options, args = parser.parse_args()
- update_license_in_source_directories( args, options.dry_run, options.show_diff )
+ update_license_in_source_directories(args, options.dry_run, options.show_diff)
print('Done')
if __name__ == '__main__':
diff --git a/3rdparty/jsoncpp/devtools/tarball.py b/3rdparty/jsoncpp/devtools/tarball.py
index ccbda394255..2e72717aba4 100644
--- a/3rdparty/jsoncpp/devtools/tarball.py
+++ b/3rdparty/jsoncpp/devtools/tarball.py
@@ -1,5 +1,10 @@
-import os.path
-import gzip
+# Copyright 2010 Baptiste Lepilleur
+# Distributed under MIT license, or public domain if desired and
+# recognized in your jurisdiction.
+# See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
+
+from contextlib import closing
+import os
import tarfile
TARGZ_DEFAULT_COMPRESSION_LEVEL = 9
@@ -13,41 +18,35 @@ def make_tarball(tarball_path, sources, base_dir, prefix_dir=''):
prefix_dir: all files stored in the tarball be sub-directory of prefix_dir. Set to ''
to make them child of root.
"""
- base_dir = os.path.normpath( os.path.abspath( base_dir ) )
- def archive_name( path ):
+ base_dir = os.path.normpath(os.path.abspath(base_dir))
+ def archive_name(path):
"""Makes path relative to base_dir."""
- path = os.path.normpath( os.path.abspath( path ) )
- common_path = os.path.commonprefix( (base_dir, path) )
+ path = os.path.normpath(os.path.abspath(path))
+ common_path = os.path.commonprefix((base_dir, path))
archive_name = path[len(common_path):]
- if os.path.isabs( archive_name ):
+ if os.path.isabs(archive_name):
archive_name = archive_name[1:]
- return os.path.join( prefix_dir, archive_name )
+ return os.path.join(prefix_dir, archive_name)
def visit(tar, dirname, names):
for name in names:
path = os.path.join(dirname, name)
if os.path.isfile(path):
path_in_tar = archive_name(path)
- tar.add(path, path_in_tar )
+ tar.add(path, path_in_tar)
compression = TARGZ_DEFAULT_COMPRESSION_LEVEL
- tar = tarfile.TarFile.gzopen( tarball_path, 'w', compresslevel=compression )
- try:
+ with closing(tarfile.TarFile.open(tarball_path, 'w:gz',
+ compresslevel=compression)) as tar:
for source in sources:
source_path = source
- if os.path.isdir( source ):
- os.path.walk(source_path, visit, tar)
+ if os.path.isdir(source):
+ for dirpath, dirnames, filenames in os.walk(source_path):
+ visit(tar, dirpath, filenames)
else:
path_in_tar = archive_name(source_path)
- tar.add(source_path, path_in_tar ) # filename, arcname
- finally:
- tar.close()
+ tar.add(source_path, path_in_tar) # filename, arcname
-def decompress( tarball_path, base_dir ):
+def decompress(tarball_path, base_dir):
"""Decompress the gzipped tarball into directory base_dir.
"""
- # !!! This class method is not documented in the online doc
- # nor is bz2open!
- tar = tarfile.TarFile.gzopen(tarball_path, mode='r')
- try:
- tar.extractall( base_dir )
- finally:
- tar.close()
+ with closing(tarfile.TarFile.open(tarball_path)) as tar:
+ tar.extractall(base_dir)
diff --git a/3rdparty/jsoncpp/doc/doxyfile.in b/3rdparty/jsoncpp/doc/doxyfile.in
index a4161865cc7..57c61c27e40 100644
--- a/3rdparty/jsoncpp/doc/doxyfile.in
+++ b/3rdparty/jsoncpp/doc/doxyfile.in
@@ -819,7 +819,7 @@ EXCLUDE_SYMBOLS =
# that contain example code fragments that are included (see the \include
# command).
-EXAMPLE_PATH =
+EXAMPLE_PATH = ..
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
@@ -1946,8 +1946,7 @@ INCLUDE_FILE_PATTERNS = *.h
PREDEFINED = "_MSC_VER=1400" \
_CPPRTTI \
_WIN32 \
- JSONCPP_DOC_EXCLUDE_IMPLEMENTATION \
- JSON_VALUE_USE_INTERNAL_MAP
+ JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
# tag can be used to specify a list of macro names that should be expanded. The
diff --git a/3rdparty/jsoncpp/doc/header.html b/3rdparty/jsoncpp/doc/header.html
index 6bd2ad9e32a..4b2a5e92198 100644
--- a/3rdparty/jsoncpp/doc/header.html
+++ b/3rdparty/jsoncpp/doc/header.html
@@ -16,7 +16,7 @@ JsonCpp - JSON data format manipulation library
</a>
</td>
<td width="40%" align="right" valign="center">
- <a href="https://github.com/open-source-parsers/jsoncpp">JsonCpp home page</a>
+ <a href="http://open-source-parsers.github.io/jsoncpp-docs/doxygen/">JsonCpp home page</a>
</td>
</tr>
</table>
diff --git a/3rdparty/jsoncpp/doc/jsoncpp.dox b/3rdparty/jsoncpp/doc/jsoncpp.dox
index a9ed47ec4e9..47efc8a3576 100644
--- a/3rdparty/jsoncpp/doc/jsoncpp.dox
+++ b/3rdparty/jsoncpp/doc/jsoncpp.dox
@@ -4,11 +4,21 @@
<a HREF="http://www.json.org/">JSON (JavaScript Object Notation)</a>
is a lightweight data-interchange format.
-It can represent integer, real number, string, an ordered sequence of value, and
-a collection of name/value pairs.
Here is an example of JSON data:
\verbatim
+{
+ "encoding" : "UTF-8",
+ "plug-ins" : [
+ "python",
+ "c++",
+ "ruby"
+ ],
+ "indent" : { "length" : 3, "use_space": true }
+}
+\endverbatim
+<b>JsonCpp</b> supports comments as <i>meta-data</i>:
+\code
// Configuration options
{
// Default encoding for text
@@ -17,22 +27,22 @@ Here is an example of JSON data:
// Plug-ins loaded at start-up
"plug-ins" : [
"python",
- "c++",
+ "c++", // trailing comment
"ruby"
],
// Tab indent size
- "indent" : { "length" : 3, "use_space": true }
+ // (multi-line comment)
+ "indent" : { /*embedded comment*/ "length" : 3, "use_space": true }
}
-\endverbatim
-<code>jsoncpp</code> supports comments as <i>meta-data</i>.
+\endcode
\section _features Features
- read and write JSON document
- attach C++ style comments to element during parsing
- rewrite JSON document preserving original comments
-Notes: Comments used to be supported in JSON but where removed for
+Notes: Comments used to be supported in JSON but were removed for
portability (C like comments are not supported in Python). Since
comments are useful in configuration/input file, this feature was
preserved.
@@ -40,47 +50,77 @@ preserved.
\section _example Code example
\code
-Json::Value root; // will contains the root value after parsing.
-Json::Reader reader;
-bool parsingSuccessful = reader.parse( config_doc, root );
-if ( !parsingSuccessful )
-{
- // report to the user the failure and their locations in the document.
- std::cout << "Failed to parse configuration\n"
- << reader.getFormattedErrorMessages();
- return;
-}
+Json::Value root; // 'root' will contain the root value after parsing.
+std::cin >> root;
-// Get the value of the member of root named 'encoding', return 'UTF-8' if there is no
-// such member.
+// You can also read into a particular sub-value.
+std::cin >> root["subtree"];
+
+// Get the value of the member of root named 'encoding',
+// and return 'UTF-8' if there is no such member.
std::string encoding = root.get("encoding", "UTF-8" ).asString();
-// Get the value of the member of root named 'encoding', return a 'null' value if
+
+// Get the value of the member of root named 'plug-ins'; return a 'null' value if
// there is no such member.
const Json::Value plugins = root["plug-ins"];
-for ( int index = 0; index < plugins.size(); ++index ) // Iterates over the sequence elements.
+
+// Iterate over the sequence elements.
+for ( int index = 0; index < plugins.size(); ++index )
loadPlugIn( plugins[index].asString() );
-setIndentLength( root["indent"].get("length", 3).asInt() );
-setIndentUseSpace( root["indent"].get("use_space", true).asBool() );
+// Try other datatypes. Some are auto-convertible to others.
+foo::setIndentLength( root["indent"].get("length", 3).asInt() );
+foo::setIndentUseSpace( root["indent"].get("use_space", true).asBool() );
-// ...
-// At application shutdown to make the new configuration document:
-// Since Json::Value has implicit constructor for all value types, it is not
-// necessary to explicitly construct the Json::Value object:
-root["encoding"] = getCurrentEncoding();
-root["indent"]["length"] = getCurrentIndentLength();
-root["indent"]["use_space"] = getCurrentIndentUseSpace();
-
-Json::StyledWriter writer;
-// Make a new JSON document for the configuration. Preserve original comments.
-std::string outputConfig = writer.write( root );
-
-// You can also use streams. This will put the contents of any JSON
-// stream at a particular sub-value, if you'd like.
-std::cin >> root["subtree"];
+// Since Json::Value has an implicit constructor for all value types, it is not
+// necessary to explicitly construct the Json::Value object.
+root["encoding"] = foo::getCurrentEncoding();
+root["indent"]["length"] = foo::getCurrentIndentLength();
+root["indent"]["use_space"] = foo::getCurrentIndentUseSpace();
-// And you can write to a stream, using the StyledWriter automatically.
+// If you like the defaults, you can insert directly into a stream.
std::cout << root;
+// Of course, you can write to `std::ostringstream` if you prefer.
+
+// If desired, remember to add a linefeed and flush.
+std::cout << std::endl;
+\endcode
+
+\section _advanced Advanced usage
+
+Configure *builders* to create *readers* and *writers*. For
+configuration, we use our own `Json::Value` (rather than
+standard setters/getters) so that we can add
+features without losing binary-compatibility.
+
+\code
+// For convenience, use `writeString()` with a specialized builder.
+Json::StreamWriterBuilder wbuilder;
+wbuilder["indentation"] = "\t";
+std::string document = Json::writeString(wbuilder, root);
+
+// Here, using a specialized Builder, we discard comments and
+// record errors as we parse.
+Json::CharReaderBuilder rbuilder;
+rbuilder["collectComments"] = false;
+std::string errs;
+bool ok = Json::parseFromStream(rbuilder, std::cin, &root, &errs);
+\endcode
+
+Yes, compile-time configuration-checking would be helpful,
+but `Json::Value` lets you
+write and read the builder configuration, which is better! In other words,
+you can configure your JSON parser using JSON.
+
+CharReaders and StreamWriters are not thread-safe, but they are re-usable.
+\code
+Json::CharReaderBuilder rbuilder;
+cfg >> rbuilder.settings_;
+std::unique_ptr<Json::CharReader> const reader(rbuilder.newCharReader());
+reader->parse(start, stop, &value1, &errs);
+// ...
+reader->parse(start, stop, &value2, &errs);
+// etc.
\endcode
\section _pbuild Build instructions
@@ -116,4 +156,9 @@ Basically JsonCpp is licensed under MIT license, or public domain if desired
and recognized in your jurisdiction.
\author Baptiste Lepilleur <blep@users.sourceforge.net> (originator)
+\author Christopher Dunn <cdunn2001@gmail.com> (primary maintainer)
+\version \include version
+We make strong guarantees about binary-compatibility, consistent with
+<a href="http://apr.apache.org/versioning.html">the Apache versioning scheme</a>.
+\sa version.h
*/
diff --git a/3rdparty/jsoncpp/doc/web_doxyfile.in b/3rdparty/jsoncpp/doc/web_doxyfile.in
new file mode 100644
index 00000000000..07d6819a743
--- /dev/null
+++ b/3rdparty/jsoncpp/doc/web_doxyfile.in
@@ -0,0 +1,2301 @@
+# Doxyfile 1.8.5
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project.
+#
+# All text after a double hash (##) is considered a comment and is placed in
+# front of the TAG it is preceding.
+#
+# All text after a single hash (#) is considered a comment and will be ignored.
+# The format is:
+# TAG = value [value, ...]
+# For lists, items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (\" \").
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all text
+# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv
+# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv
+# for the list of possible encodings.
+# The default value is: UTF-8.
+
+DOXYFILE_ENCODING = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by
+# double-quotes, unless you are using Doxywizard) that should identify the
+# project for which the documentation is generated. This name is used in the
+# title of most generated pages and in a few other places.
+# The default value is: My Project.
+
+PROJECT_NAME = "JsonCpp"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
+# could be handy for archiving the generated documentation or if some version
+# control system is used.
+
+PROJECT_NUMBER = %JSONCPP_VERSION%
+
+# Using the PROJECT_BRIEF tag one can provide an optional one line description
+# for a project that appears at the top of each page and should give viewer a
+# quick idea about the purpose of the project. Keep the description short.
+
+PROJECT_BRIEF =
+
+# With the PROJECT_LOGO tag one can specify an logo or icon that is included in
+# the documentation. The maximum height of the logo should not exceed 55 pixels
+# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo
+# to the output directory.
+
+PROJECT_LOGO =
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
+# into which the generated documentation will be written. If a relative path is
+# entered, it will be relative to the location where doxygen was started. If
+# left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = %DOC_TOPDIR%
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub-
+# directories (in 2 levels) under the output directory of each output format and
+# will distribute the generated files over these directories. Enabling this
+# option can be useful when feeding doxygen a huge amount of source files, where
+# putting all generated files in the same directory would otherwise causes
+# performance problems for the file system.
+# The default value is: NO.
+
+CREATE_SUBDIRS = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# Possible values are: Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-
+# Traditional, Croatian, Czech, Danish, Dutch, English, Esperanto, Farsi,
+# Finnish, French, German, Greek, Hungarian, Italian, Japanese, Japanese-en,
+# Korean, Korean-en, Latvian, Norwegian, Macedonian, Persian, Polish,
+# Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish,
+# Turkish, Ukrainian and Vietnamese.
+# The default value is: English.
+
+OUTPUT_LANGUAGE = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member
+# descriptions after the members that are listed in the file and class
+# documentation (similar to Javadoc). Set to NO to disable this.
+# The default value is: YES.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief
+# description of a member or function before the detailed description
+#
+# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+# The default value is: YES.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator that is
+# used to form the text in various listings. Each string in this list, if found
+# as the leading text of the brief description, will be stripped from the text
+# and the result, after processing the whole list, is used as the annotated
+# text. Otherwise, the brief description is used as-is. If left blank, the
+# following values are used ($name is automatically replaced with the name of
+# the entity):The $name class, The $name widget, The $name file, is, provides,
+# specifies, contains, represents, a, an and the.
+
+ABBREVIATE_BRIEF = "The $name class" \
+ "The $name widget" \
+ "The $name file" \
+ is \
+ provides \
+ specifies \
+ contains \
+ represents \
+ a \
+ an \
+ the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# doxygen will generate a detailed section even if there is only a brief
+# description.
+# The default value is: NO.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+# The default value is: NO.
+
+INLINE_INHERITED_MEMB = NO
+
+# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path
+# before files name in the file list and in the header files. If set to NO the
+# shortest path that makes the file name unique will be used
+# The default value is: YES.
+
+FULL_PATH_NAMES = YES
+
+# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.
+# Stripping is only done if one of the specified strings matches the left-hand
+# part of the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the path to
+# strip.
+#
+# Note that you can specify absolute paths here, but also relative paths, which
+# will be relative from the directory where doxygen is started.
+# This tag requires that the tag FULL_PATH_NAMES is set to YES.
+
+STRIP_FROM_PATH = %TOPDIR%
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
+# path mentioned in the documentation of a class, which tells the reader which
+# header file to include in order to use a class. If left blank only the name of
+# the header file containing the class definition is used. Otherwise one should
+# specify the list of include paths that are normally passed to the compiler
+# using the -I flag.
+
+STRIP_FROM_INC_PATH = %TOPDIR%/include
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but
+# less readable) file names. This can be useful is your file systems doesn't
+# support long names like on DOS, Mac, or CD-ROM.
+# The default value is: NO.
+
+SHORT_NAMES = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the
+# first line (until the first dot) of a Javadoc-style comment as the brief
+# description. If set to NO, the Javadoc-style will behave just like regular Qt-
+# style comments (thus requiring an explicit @brief command for a brief
+# description.)
+# The default value is: NO.
+
+JAVADOC_AUTOBRIEF = YES
+
+# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first
+# line (until the first dot) of a Qt-style comment as the brief description. If
+# set to NO, the Qt-style will behave just like regular Qt-style comments (thus
+# requiring an explicit \brief command for a brief description.)
+# The default value is: NO.
+
+QT_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a
+# multi-line C++ special comment block (i.e. a block of //! or /// comments) as
+# a brief description. This used to be the default behavior. The new default is
+# to treat a multi-line C++ comment block as a detailed description. Set this
+# tag to YES if you prefer the old behavior instead.
+#
+# Note that setting this tag to YES also means that rational rose comments are
+# not recognized any more.
+# The default value is: NO.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the
+# documentation from any documented member that it re-implements.
+# The default value is: YES.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a
+# new page for each member. If set to NO, the documentation of a member will be
+# part of the file/class/namespace that contains it.
+# The default value is: NO.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen
+# uses this value to replace tabs by spaces in code fragments.
+# Minimum value: 1, maximum value: 16, default value: 4.
+
+TAB_SIZE = 3
+
+# This tag can be used to specify a number of aliases that act as commands in
+# the documentation. An alias has the form:
+# name=value
+# For example adding
+# "sideeffect=@par Side Effects:\n"
+# will allow you to put the command \sideeffect (or @sideeffect) in the
+# documentation, which will result in a user-defined paragraph with heading
+# "Side Effects:". You can put \n's in the value part of an alias to insert
+# newlines.
+
+ALIASES = "testCaseSetup=\link CppUT::TestCase::setUp() setUp()\endlink" \
+ "testCaseRun=\link CppUT::TestCase::run() run()\endlink" \
+ "testCaseTearDown=\link CppUT::TestCase::tearDown() tearDown()\endlink" \
+ "json_ref=<a HREF='http://www.json.org/'>JSON (JavaScript Object Notation)</a>"
+
+# This tag can be used to specify a number of word-keyword mappings (TCL only).
+# A mapping has the form "name=value". For example adding "class=itcl::class"
+# will allow you to use the command class in the itcl::class meaning.
+
+TCL_SUBST =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
+# only. Doxygen will then generate output that is more tailored for C. For
+# instance, some of the names that are used will be different. The list of all
+# members will be omitted, etc.
+# The default value is: NO.
+
+OPTIMIZE_OUTPUT_FOR_C = NO
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or
+# Python sources only. Doxygen will then generate output that is more tailored
+# for that language. For instance, namespaces will be presented as packages,
+# qualified scopes will look different, etc.
+# The default value is: NO.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources. Doxygen will then generate output that is tailored for Fortran.
+# The default value is: NO.
+
+OPTIMIZE_FOR_FORTRAN = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for VHDL.
+# The default value is: NO.
+
+OPTIMIZE_OUTPUT_VHDL = NO
+
+# Doxygen selects the parser to use depending on the extension of the files it
+# parses. With this tag you can assign which parser to use for a given
+# extension. Doxygen has a built-in mapping, but you can override or extend it
+# using this tag. The format is ext=language, where ext is a file extension, and
+# language is one of the parsers supported by doxygen: IDL, Java, Javascript,
+# C#, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL. For instance to make
+# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C
+# (default is Fortran), use: inc=Fortran f=C.
+#
+# Note For files without extension you can use no_extension as a placeholder.
+#
+# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
+# the files are not read by doxygen.
+
+EXTENSION_MAPPING =
+
+# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
+# according to the Markdown format, which allows for more readable
+# documentation. See http://daringfireball.net/projects/markdown/ for details.
+# The output of markdown processing is further processed by doxygen, so you can
+# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in
+# case of backward compatibilities issues.
+# The default value is: YES.
+
+MARKDOWN_SUPPORT = YES
+
+# When enabled doxygen tries to link words that correspond to documented
+# classes, or namespaces to their corresponding documentation. Such a link can
+# be prevented in individual cases by by putting a % sign in front of the word
+# or globally by setting AUTOLINK_SUPPORT to NO.
+# The default value is: YES.
+
+AUTOLINK_SUPPORT = YES
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should set this
+# tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string);
+# versus func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+# The default value is: NO.
+
+BUILTIN_STL_SUPPORT = YES
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+# The default value is: NO.
+
+CPP_CLI_SUPPORT = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip (see:
+# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen
+# will parse them like normal C++ but will assume all classes use public instead
+# of private inheritance when no explicit protection keyword is present.
+# The default value is: NO.
+
+SIP_SUPPORT = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate
+# getter and setter methods for a property. Setting this option to YES will make
+# doxygen to replace the get and set methods by a property in the documentation.
+# This will only work if the methods are indeed getting or setting a simple
+# type. If this is not the case, or you want to show the methods anyway, you
+# should set this option to NO.
+# The default value is: YES.
+
+IDL_PROPERTY_SUPPORT = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+# The default value is: NO.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# Set the SUBGROUPING tag to YES to allow class member groups of the same type
+# (for instance a group of public functions) to be put as a subgroup of that
+# type (e.g. under the Public Functions section). Set it to NO to prevent
+# subgrouping. Alternatively, this can be done per class using the
+# \nosubgrouping command.
+# The default value is: YES.
+
+SUBGROUPING = YES
+
+# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions
+# are shown inside the group in which they are included (e.g. using \ingroup)
+# instead of on a separate page (for HTML and Man pages) or section (for LaTeX
+# and RTF).
+#
+# Note that this feature does not work in combination with
+# SEPARATE_MEMBER_PAGES.
+# The default value is: NO.
+
+INLINE_GROUPED_CLASSES = NO
+
+# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions
+# with only public data fields or simple typedef fields will be shown inline in
+# the documentation of the scope in which they are defined (i.e. file,
+# namespace, or group documentation), provided this scope is documented. If set
+# to NO, structs, classes, and unions are shown on a separate page (for HTML and
+# Man pages) or section (for LaTeX and RTF).
+# The default value is: NO.
+
+INLINE_SIMPLE_STRUCTS = NO
+
+# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or
+# enum is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically be
+# useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+# The default value is: NO.
+
+TYPEDEF_HIDES_STRUCT = NO
+
+# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This
+# cache is used to resolve symbols given their name and scope. Since this can be
+# an expensive process and often the same symbol appears multiple times in the
+# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small
+# doxygen will become slower. If the cache is too large, memory is wasted. The
+# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range
+# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536
+# symbols. At the end of a run doxygen will report the cache usage and suggest
+# the optimal cache size from a speed point of view.
+# Minimum value: 0, maximum value: 9, default value: 0.
+
+LOOKUP_CACHE_SIZE = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available. Private
+# class members and static file members will be hidden unless the
+# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES.
+# Note: This will also disable the warnings about undocumented members that are
+# normally produced when WARNINGS is set to YES.
+# The default value is: NO.
+
+EXTRACT_ALL = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will
+# be included in the documentation.
+# The default value is: NO.
+
+EXTRACT_PRIVATE = NO
+
+# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal
+# scope will be included in the documentation.
+# The default value is: NO.
+
+EXTRACT_PACKAGE = NO
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file will be
+# included in the documentation.
+# The default value is: NO.
+
+EXTRACT_STATIC = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined
+# locally in source files will be included in the documentation. If set to NO
+# only classes defined in header files are included. Does not have any effect
+# for Java sources.
+# The default value is: YES.
+
+EXTRACT_LOCAL_CLASSES = NO
+
+# This flag is only useful for Objective-C code. When set to YES local methods,
+# which are defined in the implementation section but not in the interface are
+# included in the documentation. If set to NO only methods in the interface are
+# included.
+# The default value is: NO.
+
+EXTRACT_LOCAL_METHODS = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base name of
+# the file that contains the anonymous namespace. By default anonymous namespace
+# are hidden.
+# The default value is: NO.
+
+EXTRACT_ANON_NSPACES = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all
+# undocumented members inside documented classes or files. If set to NO these
+# members will be included in the various overviews, but no documentation
+# section is generated. This option has no effect if EXTRACT_ALL is enabled.
+# The default value is: NO.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy. If set
+# to NO these classes will be included in the various overviews. This option has
+# no effect if EXTRACT_ALL is enabled.
+# The default value is: NO.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend
+# (class|struct|union) declarations. If set to NO these declarations will be
+# included in the documentation.
+# The default value is: NO.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any
+# documentation blocks found inside the body of a function. If set to NO these
+# blocks will be appended to the function's detailed documentation block.
+# The default value is: NO.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation that is typed after a
+# \internal command is included. If the tag is set to NO then the documentation
+# will be excluded. Set it to YES to include the internal documentation.
+# The default value is: NO.
+
+INTERNAL_DOCS = YES
+
+# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file
+# names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+# The default value is: system dependent.
+
+CASE_SENSE_NAMES = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with
+# their full class and namespace scopes in the documentation. If set to YES the
+# scope will be hidden.
+# The default value is: NO.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of
+# the files that are included by a file in the documentation of that file.
+# The default value is: YES.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include
+# files with double quotes in the documentation rather than with sharp brackets.
+# The default value is: NO.
+
+FORCE_LOCAL_INCLUDES = NO
+
+# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the
+# documentation for inline members.
+# The default value is: YES.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the
+# (detailed) documentation of file and class members alphabetically by member
+# name. If set to NO the members will appear in declaration order.
+# The default value is: YES.
+
+SORT_MEMBER_DOCS = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief
+# descriptions of file, namespace and class members alphabetically by member
+# name. If set to NO the members will appear in declaration order.
+# The default value is: NO.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the
+# (brief and detailed) documentation of class members so that constructors and
+# destructors are listed first. If set to NO the constructors will appear in the
+# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS.
+# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief
+# member documentation.
+# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting
+# detailed member documentation.
+# The default value is: NO.
+
+SORT_MEMBERS_CTORS_1ST = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy
+# of group names into alphabetical order. If set to NO the group names will
+# appear in their defined order.
+# The default value is: NO.
+
+SORT_GROUP_NAMES = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by
+# fully-qualified names, including namespaces. If set to NO, the class list will
+# be sorted only by class name, not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the alphabetical
+# list.
+# The default value is: NO.
+
+SORT_BY_SCOPE_NAME = YES
+
+# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper
+# type resolution of all parameters of a function it will reject a match between
+# the prototype and the implementation of a member function even if there is
+# only one candidate or it is obvious which candidate to choose by doing a
+# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still
+# accept a match between prototype and implementation in such cases.
+# The default value is: NO.
+
+STRICT_PROTO_MATCHING = NO
+
+# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the
+# todo list. This list is created by putting \todo commands in the
+# documentation.
+# The default value is: YES.
+
+GENERATE_TODOLIST = YES
+
+# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the
+# test list. This list is created by putting \test commands in the
+# documentation.
+# The default value is: YES.
+
+GENERATE_TESTLIST = NO
+
+# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug
+# list. This list is created by putting \bug commands in the documentation.
+# The default value is: YES.
+
+GENERATE_BUGLIST = NO
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO)
+# the deprecated list. This list is created by putting \deprecated commands in
+# the documentation.
+# The default value is: YES.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional documentation
+# sections, marked by \if <section_label> ... \endif and \cond <section_label>
+# ... \endcond blocks.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the
+# initial value of a variable or macro / define can have for it to appear in the
+# documentation. If the initializer consists of more lines than specified here
+# it will be hidden. Use a value of 0 to hide initializers completely. The
+# appearance of the value of individual variables and macros / defines can be
+# controlled using \showinitializer or \hideinitializer command in the
+# documentation regardless of this setting.
+# Minimum value: 0, maximum value: 10000, default value: 30.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at
+# the bottom of the documentation of classes and structs. If set to YES the list
+# will mention the files that were used to generate the documentation.
+# The default value is: YES.
+
+SHOW_USED_FILES = YES
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This
+# will remove the Files entry from the Quick Index and from the Folder Tree View
+# (if specified).
+# The default value is: YES.
+
+SHOW_FILES = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces
+# page. This will remove the Namespaces entry from the Quick Index and from the
+# Folder Tree View (if specified).
+# The default value is: YES.
+
+SHOW_NAMESPACES = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command command input-file, where command is the value of the
+# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided
+# by doxygen. Whatever the program writes to standard output is used as the file
+# version. For an example see the documentation.
+
+FILE_VERSION_FILTER =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
+# by doxygen. The layout file controls the global structure of the generated
+# output files in an output format independent way. To create the layout file
+# that represents doxygen's defaults, run doxygen with the -l option. You can
+# optionally specify a file name after the option, if omitted DoxygenLayout.xml
+# will be used as the name of the layout file.
+#
+# Note that if you run doxygen from a directory containing a file called
+# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
+# tag is left empty.
+
+LAYOUT_FILE =
+
+# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
+# the reference definitions. This must be a list of .bib files. The .bib
+# extension is automatically appended if omitted. This requires the bibtex tool
+# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info.
+# For LaTeX the style of the bibliography can be controlled using
+# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the
+# search path. Do not use file names with spaces, bibtex cannot handle them. See
+# also \cite for info how to create references.
+
+CITE_BIB_FILES =
+
+#---------------------------------------------------------------------------
+# Configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated to
+# standard output by doxygen. If QUIET is set to YES this implies that the
+# messages are off.
+# The default value is: NO.
+
+QUIET = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES
+# this implies that the warnings are on.
+#
+# Tip: Turn warnings on while writing the documentation.
+# The default value is: YES.
+
+WARNINGS = YES
+
+# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate
+# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag
+# will automatically be disabled.
+# The default value is: YES.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some parameters
+# in a documented function, or documenting parameters that don't exist or using
+# markup commands wrongly.
+# The default value is: YES.
+
+WARN_IF_DOC_ERROR = YES
+
+# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that
+# are documented, but have no documentation for their parameters or return
+# value. If set to NO doxygen will only warn about wrong or incomplete parameter
+# documentation, but not about the absence of documentation.
+# The default value is: NO.
+
+WARN_NO_PARAMDOC = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that doxygen
+# can produce. The string should contain the $file, $line, and $text tags, which
+# will be replaced by the file and line number from which the warning originated
+# and the warning text. Optionally the format may contain $version, which will
+# be replaced by the version of the file (if it could be obtained via
+# FILE_VERSION_FILTER)
+# The default value is: $file:$line: $text.
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning and error
+# messages should be written. If left blank the output is written to standard
+# error (stderr).
+
+WARN_LOGFILE = %WARNING_LOG_PATH%
+
+#---------------------------------------------------------------------------
+# Configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag is used to specify the files and/or directories that contain
+# documented source files. You may enter file names like myfile.cpp or
+# directories like /usr/src/myproject. Separate the files or directories with
+# spaces.
+# Note: If this tag is empty the current directory is searched.
+
+INPUT = ../include \
+ ../src/lib_json \
+ .
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
+# libiconv (or the iconv built into libc) for the transcoding. See the libiconv
+# documentation (see: http://www.gnu.org/software/libiconv) for the list of
+# possible encodings.
+# The default value is: UTF-8.
+
+INPUT_ENCODING = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and
+# *.h) to filter out the source-files in the directories. If left blank the
+# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii,
+# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp,
+# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown,
+# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf,
+# *.qsf, *.as and *.js.
+
+FILE_PATTERNS = *.h \
+ *.cpp \
+ *.inl \
+ *.dox
+
+# The RECURSIVE tag can be used to specify whether or not subdirectories should
+# be searched for input files as well.
+# The default value is: NO.
+
+RECURSIVE = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should be
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+#
+# Note that relative paths are relative to the directory from which doxygen is
+# run.
+
+EXCLUDE =
+
+# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
+# directories that are symbolic links (a Unix file system feature) are excluded
+# from the input.
+# The default value is: NO.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories.
+#
+# Note that the wildcards are matched against the file with absolute path, so to
+# exclude all test directories for example use the pattern */test/*
+
+EXCLUDE_PATTERNS =
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+#
+# Note that the wildcards are matched against the file with absolute path, so to
+# exclude all test directories use the pattern */test/*
+
+EXCLUDE_SYMBOLS =
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or directories
+# that contain example code fragments that are included (see the \include
+# command).
+
+EXAMPLE_PATH = ..
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
+# *.h) to filter out the source-files in the directories. If left blank all
+# files are included.
+
+EXAMPLE_PATTERNS = *
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude commands
+# irrespective of the value of the RECURSIVE tag.
+# The default value is: NO.
+
+EXAMPLE_RECURSIVE = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or directories
+# that contain images that are to be included in the documentation (see the
+# \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command:
+#
+# <filter> <input-file>
+#
+# where <filter> is the value of the INPUT_FILTER tag, and <input-file> is the
+# name of an input file. Doxygen will then use the output that the filter
+# program writes to standard output. If FILTER_PATTERNS is specified, this tag
+# will be ignored.
+#
+# Note that the filter must not add or remove lines; it is applied before the
+# code is scanned, but not when the output code is generated. If lines are added
+# or removed, the anchors will not be placed correctly.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form: pattern=filter
+# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how
+# filters are used. If the FILTER_PATTERNS tag is empty or if none of the
+# patterns match the file name, INPUT_FILTER is applied.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER ) will also be used to filter the input files that are used for
+# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES).
+# The default value is: NO.
+
+FILTER_SOURCE_FILES = NO
+
+# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
+# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and
+# it is also possible to disable source filtering for a specific pattern using
+# *.ext= (so without naming a filter).
+# This tag requires that the tag FILTER_SOURCE_FILES is set to YES.
+
+FILTER_SOURCE_PATTERNS =
+
+# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that
+# is part of the input, its contents will be placed on the main page
+# (index.html). This can be useful if you have a project on for instance GitHub
+# and want to reuse the introduction page also for the doxygen output.
+
+USE_MDFILE_AS_MAINPAGE =
+
+#---------------------------------------------------------------------------
+# Configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will be
+# generated. Documented entities will be cross-referenced with these sources.
+#
+# Note: To get rid of all source code in the generated output, make sure that
+# also VERBATIM_HEADERS is set to NO.
+# The default value is: NO.
+
+SOURCE_BROWSER = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body of functions,
+# classes and enums directly into the documentation.
+# The default value is: NO.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any
+# special comment blocks from generated source code fragments. Normal C, C++ and
+# Fortran comments will always remain visible.
+# The default value is: YES.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES then for each documented
+# function all documented functions referencing it will be listed.
+# The default value is: NO.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES then for each documented function
+# all documented entities called/used by that function will be listed.
+# The default value is: NO.
+
+REFERENCES_RELATION = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set
+# to YES, then the hyperlinks from functions in REFERENCES_RELATION and
+# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will
+# link to the documentation.
+# The default value is: YES.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the
+# source code will show a tooltip with additional information such as prototype,
+# brief description and links to the definition and documentation. Since this
+# will make the HTML file larger and loading of large files a bit slower, you
+# can opt to disable this feature.
+# The default value is: YES.
+# This tag requires that the tag SOURCE_BROWSER is set to YES.
+
+SOURCE_TOOLTIPS = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code will
+# point to the HTML generated by the htags(1) tool instead of doxygen built-in
+# source browser. The htags tool is part of GNU's global source tagging system
+# (see http://www.gnu.org/software/global/global.html). You will need version
+# 4.8.6 or higher.
+#
+# To use it do the following:
+# - Install the latest version of global
+# - Enable SOURCE_BROWSER and USE_HTAGS in the config file
+# - Make sure the INPUT points to the root of the source tree
+# - Run doxygen as normal
+#
+# Doxygen will invoke htags (and that will in turn invoke gtags), so these
+# tools must be available from the command line (i.e. in the search path).
+#
+# The result: instead of the source browser generated by doxygen, the links to
+# source code will now point to the output of htags.
+# The default value is: NO.
+# This tag requires that the tag SOURCE_BROWSER is set to YES.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a
+# verbatim copy of the header file for each class for which an include is
+# specified. Set to NO to disable this.
+# See also: Section \class.
+# The default value is: YES.
+
+VERBATIM_HEADERS = NO
+
+#---------------------------------------------------------------------------
+# Configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all
+# compounds will be generated. Enable this if the project contains a lot of
+# classes, structs, unions or interfaces.
+# The default value is: YES.
+
+ALPHABETICAL_INDEX = NO
+
+# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in
+# which the alphabetical index list will be split.
+# Minimum value: 1, maximum value: 20, default value: 5.
+# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all classes will
+# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag
+# can be used to specify a prefix (or a list of prefixes) that should be ignored
+# while generating the index headers.
+# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output
+# The default value is: YES.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: html.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_OUTPUT = %HTML_OUTPUT%
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each
+# generated HTML page (for example: .htm, .php, .asp).
+# The default value is: .html.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a user-defined HTML header file for
+# each generated HTML page. If the tag is left blank doxygen will generate a
+# standard header.
+#
+# To get valid HTML the header file that includes any scripts and style sheets
+# that doxygen needs, which is dependent on the configuration options used (e.g.
+# the setting GENERATE_TREEVIEW). It is highly recommended to start with a
+# default header using
+# doxygen -w html new_header.html new_footer.html new_stylesheet.css
+# YourConfigFile
+# and then modify the file new_header.html. See also section "Doxygen usage"
+# for information on how to generate the default header that doxygen normally
+# uses.
+# Note: The header is subject to change so you typically have to regenerate the
+# default header when upgrading to a newer version of doxygen. For a description
+# of the possible markers and block names see the documentation.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_HEADER = header.html
+
+# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each
+# generated HTML page. If the tag is left blank doxygen will generate a standard
+# footer. See HTML_HEADER for more information on how to generate a default
+# footer and what special commands can be used inside the footer. See also
+# section "Doxygen usage" for information on how to generate the default footer
+# that doxygen normally uses.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_FOOTER = footer.html
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
+# sheet that is used by each HTML page. It can be used to fine-tune the look of
+# the HTML output. If left blank doxygen will generate a default style sheet.
+# See also section "Doxygen usage" for information on how to generate the style
+# sheet that doxygen normally uses.
+# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as
+# it is more robust and this tag (HTML_STYLESHEET) will in the future become
+# obsolete.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_STYLESHEET =
+
+# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional user-
+# defined cascading style sheet that is included after the standard style sheets
+# created by doxygen. Using this option one can overrule certain style aspects.
+# This is preferred over using HTML_STYLESHEET since it does not replace the
+# standard style sheet and is therefor more robust against future updates.
+# Doxygen will copy the style sheet file to the output directory. For an example
+# see the documentation.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_EXTRA_STYLESHEET =
+
+# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the HTML output directory. Note
+# that these files will be copied to the base HTML output directory. Use the
+# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
+# files. In the HTML_STYLESHEET file, use the file name only. Also note that the
+# files will be copied as-is; there are no commands or markers available.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_EXTRA_FILES =
+
+# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
+# will adjust the colors in the stylesheet and background images according to
+# this color. Hue is specified as an angle on a colorwheel, see
+# http://en.wikipedia.org/wiki/Hue for more information. For instance the value
+# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300
+# purple, and 360 is red again.
+# Minimum value: 0, maximum value: 359, default value: 220.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_COLORSTYLE_HUE = 220
+
+# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors
+# in the HTML output. For a value of 0 the output will use grayscales only. A
+# value of 255 will produce the most vivid colors.
+# Minimum value: 0, maximum value: 255, default value: 100.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_COLORSTYLE_SAT = 100
+
+# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the
+# luminance component of the colors in the HTML output. Values below 100
+# gradually make the output lighter, whereas values above 100 make the output
+# darker. The value divided by 100 is the actual gamma applied, so 80 represents
+# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not
+# change the gamma.
+# Minimum value: 40, maximum value: 240, default value: 80.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_COLORSTYLE_GAMMA = 80
+
+# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
+# page will contain the date and time when the page was generated. Setting this
+# to NO can help when comparing the output of multiple runs.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_TIMESTAMP = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_DYNAMIC_SECTIONS = YES
+
+# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries
+# shown in the various tree structured indices initially; the user can expand
+# and collapse entries dynamically later on. Doxygen will expand the tree to
+# such a level that at most the specified number of entries are visible (unless
+# a fully collapsed tree already exceeds this amount). So setting the number of
+# entries 1 will produce a full collapsed tree by default. 0 is a special value
+# representing an infinite number of entries and will result in a full expanded
+# tree by default.
+# Minimum value: 0, maximum value: 9999, default value: 100.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_INDEX_NUM_ENTRIES = 100
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files will be
+# generated that can be used as input for Apple's Xcode 3 integrated development
+# environment (see: http://developer.apple.com/tools/xcode/), introduced with
+# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a
+# Makefile in the HTML output directory. Running make will produce the docset in
+# that directory and running make install will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at
+# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
+# for more information.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_DOCSET = NO
+
+# This tag determines the name of the docset feed. A documentation feed provides
+# an umbrella under which multiple documentation sets from a single provider
+# (such as a company or product suite) can be grouped.
+# The default value is: Doxygen generated docs.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_FEEDNAME = "Doxygen generated docs"
+
+# This tag specifies a string that should uniquely identify the documentation
+# set bundle. This should be a reverse domain-name style string, e.g.
+# com.mycompany.MyDocSet. Doxygen will append .docset to the name.
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_BUNDLE_ID = org.doxygen.Project
+
+# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify
+# the documentation publisher. This should be a reverse domain-name style
+# string, e.g. com.mycompany.MyDocSet.documentation.
+# The default value is: org.doxygen.Publisher.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_PUBLISHER_ID = org.doxygen.Publisher
+
+# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.
+# The default value is: Publisher.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_PUBLISHER_NAME = Publisher
+
+# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three
+# additional HTML index files: index.hhp, index.hhc, and index.hhk. The
+# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop
+# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on
+# Windows.
+#
+# The HTML Help Workshop contains a compiler that can convert all HTML output
+# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML
+# files are now used as the Windows 98 help format, and will replace the old
+# Windows help format (.hlp) on all Windows platforms in the future. Compressed
+# HTML files also contain an index, a table of contents, and you can search for
+# words in the documentation. The HTML workshop also contains a viewer for
+# compressed HTML files.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_HTMLHELP = %HTML_HELP%
+
+# The CHM_FILE tag can be used to specify the file name of the resulting .chm
+# file. You can add a path in front of the file if the result should not be
+# written to the html output directory.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+CHM_FILE = jsoncpp-%JSONCPP_VERSION%.chm
+
+# The HHC_LOCATION tag can be used to specify the location (absolute path
+# including file name) of the HTML help compiler ( hhc.exe). If non-empty
+# doxygen will try to run the HTML help compiler on the generated index.hhp.
+# The file has to be specified with full path.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+HHC_LOCATION = "c:\Program Files\HTML Help Workshop\hhc.exe"
+
+# The GENERATE_CHI flag controls if a separate .chi index file is generated (
+# YES) or that it should be included in the master .chm file ( NO).
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+GENERATE_CHI = YES
+
+# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc)
+# and project file content.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+CHM_INDEX_ENCODING =
+
+# The BINARY_TOC flag controls whether a binary table of contents is generated (
+# YES) or a normal table of contents ( NO) in the .chm file.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+BINARY_TOC = YES
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members to
+# the table of contents of the HTML help documentation and to the tree view.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+TOC_EXPAND = YES
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
+# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that
+# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help
+# (.qch) of the generated HTML documentation.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_QHP = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify
+# the file name of the resulting .qch file. The path specified is relative to
+# the HTML output folder.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QCH_FILE =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
+# Project output. For more information please see Qt Help Project / Namespace
+# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace).
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_NAMESPACE =
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt
+# Help Project output. For more information please see Qt Help Project / Virtual
+# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual-
+# folders).
+# The default value is: doc.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_VIRTUAL_FOLDER = doc
+
+# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom
+# filter to add. For more information please see Qt Help Project / Custom
+# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
+# filters).
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_CUST_FILTER_NAME =
+
+# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
+# custom filter to add. For more information please see Qt Help Project / Custom
+# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
+# filters).
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_CUST_FILTER_ATTRS =
+
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
+# project's filter section matches. Qt Help Project / Filter Attributes (see:
+# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes).
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_SECT_FILTER_ATTRS =
+
+# The QHG_LOCATION tag can be used to specify the location of Qt's
+# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the
+# generated .qhp file.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHG_LOCATION =
+
+# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be
+# generated, together with the HTML files, they form an Eclipse help plugin. To
+# install this plugin and make it available under the help contents menu in
+# Eclipse, the contents of the directory containing the HTML and XML files needs
+# to be copied into the plugins directory of eclipse. The name of the directory
+# within the plugins directory should be the same as the ECLIPSE_DOC_ID value.
+# After copying Eclipse needs to be restarted before the help appears.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_ECLIPSEHELP = NO
+
+# A unique identifier for the Eclipse help plugin. When installing the plugin
+# the directory name containing the HTML and XML files should also have this
+# name. Each documentation set should have its own identifier.
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES.
+
+ECLIPSE_DOC_ID = org.doxygen.Project
+
+# If you want full control over the layout of the generated HTML pages it might
+# be necessary to disable the index and replace it with your own. The
+# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top
+# of each HTML page. A value of NO enables the index and the value YES disables
+# it. Since the tabs in the index contain the same information as the navigation
+# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+DISABLE_INDEX = NO
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information. If the tag
+# value is set to YES, a side panel will be generated containing a tree-like
+# index structure (just like the one that is generated for HTML Help). For this
+# to work a browser that supports JavaScript, DHTML, CSS and frames is required
+# (i.e. any modern browser). Windows users are probably better off using the
+# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can
+# further fine-tune the look of the index. As an example, the default style
+# sheet generated by doxygen has an example that shows how to put an image at
+# the root of the tree instead of the PROJECT_NAME. Since the tree basically has
+# the same information as the tab index, you could consider setting
+# DISABLE_INDEX to YES when enabling this option.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_TREEVIEW = NO
+
+# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that
+# doxygen will group on one line in the generated HTML documentation.
+#
+# Note that a value of 0 will completely suppress the enum values from appearing
+# in the overview section.
+# Minimum value: 0, maximum value: 20, default value: 4.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+ENUM_VALUES_PER_LINE = 4
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used
+# to set the initial width (in pixels) of the frame in which the tree is shown.
+# Minimum value: 0, maximum value: 1500, default value: 250.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+TREEVIEW_WIDTH = 250
+
+# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to
+# external symbols imported via tag files in a separate window.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+EXT_LINKS_IN_WINDOW = NO
+
+# Use this tag to change the font size of LaTeX formulas included as images in
+# the HTML documentation. When you change the font size after a successful
+# doxygen run you need to manually remove any form_*.png images from the HTML
+# output directory to force them to be regenerated.
+# Minimum value: 8, maximum value: 50, default value: 10.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+FORMULA_FONTSIZE = 10
+
+# Use the FORMULA_TRANPARENT tag to determine whether or not the images
+# generated for formulas are transparent PNGs. Transparent PNGs are not
+# supported properly for IE 6.0, but are supported on all modern browsers.
+#
+# Note that when changing this option you need to delete any form_*.png files in
+# the HTML output directory before the changes have effect.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+FORMULA_TRANSPARENT = YES
+
+# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see
+# http://www.mathjax.org) which uses client side Javascript for the rendering
+# instead of using prerendered bitmaps. Use this if you do not have LaTeX
+# installed or if you want to formulas look prettier in the HTML output. When
+# enabled you may also need to install MathJax separately and configure the path
+# to it using the MATHJAX_RELPATH option.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+USE_MATHJAX = NO
+
+# When MathJax is enabled you can set the default output format to be used for
+# the MathJax output. See the MathJax site (see:
+# http://docs.mathjax.org/en/latest/output.html) for more details.
+# Possible values are: HTML-CSS (which is slower, but has the best
+# compatibility), NativeMML (i.e. MathML) and SVG.
+# The default value is: HTML-CSS.
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_FORMAT = HTML-CSS
+
+# When MathJax is enabled you need to specify the location relative to the HTML
+# output directory using the MATHJAX_RELPATH option. The destination directory
+# should contain the MathJax.js script. For instance, if the mathjax directory
+# is located at the same level as the HTML output directory, then
+# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax
+# Content Delivery Network so you can quickly see the result without installing
+# MathJax. However, it is strongly recommended to install a local copy of
+# MathJax from http://www.mathjax.org before deployment.
+# The default value is: http://cdn.mathjax.org/mathjax/latest.
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest
+
+# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax
+# extension names that should be enabled during MathJax rendering. For example
+# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_EXTENSIONS =
+
+# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces
+# of code that will be used on startup of the MathJax code. See the MathJax site
+# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an
+# example see the documentation.
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_CODEFILE =
+
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box for
+# the HTML output. The underlying search engine uses javascript and DHTML and
+# should work on any modern browser. Note that when using HTML help
+# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET)
+# there is already a search function so this one should typically be disabled.
+# For large projects the javascript based search engine can be slow, then
+# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to
+# search using the keyboard; to jump to the search box use <access key> + S
+# (what the <access key> is depends on the OS and browser, but it is typically
+# <CTRL>, <ALT>/<option>, or both). Inside the search box use the <cursor down
+# key> to jump into the search results window, the results can be navigated
+# using the <cursor keys>. Press <Enter> to select an item or <escape> to cancel
+# the search. The filter options can be selected when the cursor is inside the
+# search box by pressing <Shift>+<cursor down>. Also here use the <cursor keys>
+# to select a filter and <Enter> or <escape> to activate or cancel the filter
+# option.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+SEARCHENGINE = NO
+
+# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
+# implemented using a web server instead of a web client using Javascript. There
+# are two flavours of web server based searching depending on the
+# EXTERNAL_SEARCH setting. When disabled, doxygen will generate a PHP script for
+# searching and an index file used by the script. When EXTERNAL_SEARCH is
+# enabled the indexing and searching needs to be provided by external tools. See
+# the section "External Indexing and Searching" for details.
+# The default value is: NO.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+SERVER_BASED_SEARCH = NO
+
+# When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP
+# script for searching. Instead the search results are written to an XML file
+# which needs to be processed by an external indexer. Doxygen will invoke an
+# external search engine pointed to by the SEARCHENGINE_URL option to obtain the
+# search results.
+#
+# Doxygen ships with an example indexer ( doxyindexer) and search engine
+# (doxysearch.cgi) which are based on the open source search engine library
+# Xapian (see: http://xapian.org/).
+#
+# See the section "External Indexing and Searching" for details.
+# The default value is: NO.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+EXTERNAL_SEARCH = NO
+
+# The SEARCHENGINE_URL should point to a search engine hosted by a web server
+# which will return the search results when EXTERNAL_SEARCH is enabled.
+#
+# Doxygen ships with an example indexer ( doxyindexer) and search engine
+# (doxysearch.cgi) which are based on the open source search engine library
+# Xapian (see: http://xapian.org/). See the section "External Indexing and
+# Searching" for details.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+SEARCHENGINE_URL =
+
+# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed
+# search data is written to a file for indexing by an external tool. With the
+# SEARCHDATA_FILE tag the name of this file can be specified.
+# The default file is: searchdata.xml.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+SEARCHDATA_FILE = searchdata.xml
+
+# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the
+# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is
+# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple
+# projects and redirect the results back to the right project.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+EXTERNAL_SEARCH_ID =
+
+# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen
+# projects other than the one defined by this configuration file, but that are
+# all added to the same external search index. Each project needs to have a
+# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id of
+# to a relative location where the documentation can be found. The format is:
+# EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ...
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+EXTRA_SEARCH_MAPPINGS =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES doxygen will generate LaTeX output.
+# The default value is: YES.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: latex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked.
+#
+# Note that when enabling USE_PDFLATEX this option is only used for generating
+# bitmaps for formulas in the HTML output, but not in the Makefile that is
+# written to the output directory.
+# The default file is: latex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate
+# index for LaTeX.
+# The default file is: makeindex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES doxygen generates more compact LaTeX
+# documents. This may be useful for small projects and may help to save some
+# trees in general.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used by the
+# printer.
+# Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x
+# 14 inches) and executive (7.25 x 10.5 inches).
+# The default value is: a4.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+PAPER_TYPE = a4wide
+
+# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names
+# that should be included in the LaTeX output. To get the times font for
+# instance you can specify
+# EXTRA_PACKAGES=times
+# If left blank no extra packages will be included.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the
+# generated LaTeX document. The header should contain everything until the first
+# chapter. If it is left blank doxygen will generate a standard header. See
+# section "Doxygen usage" for information on how to let doxygen write the
+# default header to a separate file.
+#
+# Note: Only use a user-defined header if you know what you are doing! The
+# following commands have a special meaning inside the header: $title,
+# $datetime, $date, $doxygenversion, $projectname, $projectnumber. Doxygen will
+# replace them by respectively the title of the page, the current date and time,
+# only the current date, the version number of doxygen, the project name (see
+# PROJECT_NAME), or the project number (see PROJECT_NUMBER).
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_HEADER =
+
+# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the
+# generated LaTeX document. The footer should contain everything after the last
+# chapter. If it is left blank doxygen will generate a standard footer.
+#
+# Note: Only use a user-defined footer if you know what you are doing!
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_FOOTER =
+
+# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the LATEX_OUTPUT output
+# directory. Note that the files will be copied as-is; there are no commands or
+# markers available.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_EXTRA_FILES =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is
+# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will
+# contain links (just like the HTML output) instead of page references. This
+# makes the output suitable for online browsing using a PDF viewer.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+PDF_HYPERLINKS = NO
+
+# If the LATEX_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate
+# the PDF file directly from the LaTeX files. Set this option to YES to get a
+# higher quality PDF documentation.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+USE_PDFLATEX = NO
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode
+# command to the generated LaTeX files. This will instruct LaTeX to keep running
+# if errors occur, instead of asking the user for help. This option is also used
+# when generating formulas in HTML.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_BATCHMODE = NO
+
+# If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the
+# index chapters (such as File Index, Compound Index, etc.) in the output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_HIDE_INDICES = NO
+
+# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source
+# code with syntax highlighting in the LaTeX output.
+#
+# Note that which sources are shown also depends on other settings such as
+# SOURCE_BROWSER.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_SOURCE_CODE = NO
+
+# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
+# bibliography, e.g. plainnat, or ieeetr. See
+# http://en.wikipedia.org/wiki/BibTeX and \cite for more info.
+# The default value is: plain.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_BIB_STYLE = plain
+
+#---------------------------------------------------------------------------
+# Configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES doxygen will generate RTF output. The
+# RTF output is optimized for Word 97 and may not look too pretty with other RTF
+# readers/editors.
+# The default value is: NO.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: rtf.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES doxygen generates more compact RTF
+# documents. This may be useful for small projects and may help to save some
+# trees in general.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will
+# contain hyperlink fields. The RTF file will contain links (just like the HTML
+# output) instead of page references. This makes the output suitable for online
+# browsing using Word or some other Word compatible readers that support those
+# fields.
+#
+# Note: WordPad (write) and others do not support links.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's config
+# file, i.e. a series of assignments. You only have to provide replacements,
+# missing definitions are set to their default value.
+#
+# See also section "Doxygen usage" for information on how to generate the
+# default style sheet that doxygen normally uses.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an RTF document. Syntax is
+# similar to doxygen's config file. A template extensions file can be generated
+# using doxygen -e rtf extensionFile.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES doxygen will generate man pages for
+# classes and files.
+# The default value is: NO.
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it. A directory man3 will be created inside the directory specified by
+# MAN_OUTPUT.
+# The default directory is: man.
+# This tag requires that the tag GENERATE_MAN is set to YES.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to the generated
+# man pages. In case the manual section does not start with a number, the number
+# 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is
+# optional.
+# The default value is: .3.
+# This tag requires that the tag GENERATE_MAN is set to YES.
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it
+# will generate one additional man file for each entity documented in the real
+# man page(s). These additional files only source the real man page, but without
+# them the man command would be unable to find the correct page.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_MAN is set to YES.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# Configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES doxygen will generate an XML file that
+# captures the structure of the code including all documentation.
+# The default value is: NO.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: xml.
+# This tag requires that the tag GENERATE_XML is set to YES.
+
+XML_OUTPUT = xml
+
+# The XML_SCHEMA tag can be used to specify a XML schema, which can be used by a
+# validating XML parser to check the syntax of the XML files.
+# This tag requires that the tag GENERATE_XML is set to YES.
+
+XML_SCHEMA =
+
+# The XML_DTD tag can be used to specify a XML DTD, which can be used by a
+# validating XML parser to check the syntax of the XML files.
+# This tag requires that the tag GENERATE_XML is set to YES.
+
+XML_DTD =
+
+# If the XML_PROGRAMLISTING tag is set to YES doxygen will dump the program
+# listings (including syntax highlighting and cross-referencing information) to
+# the XML output. Note that enabling this will significantly increase the size
+# of the XML output.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_XML is set to YES.
+
+XML_PROGRAMLISTING = YES
+
+#---------------------------------------------------------------------------
+# Configuration options related to the DOCBOOK output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_DOCBOOK tag is set to YES doxygen will generate Docbook files
+# that can be used to generate PDF.
+# The default value is: NO.
+
+GENERATE_DOCBOOK = NO
+
+# The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in
+# front of it.
+# The default directory is: docbook.
+# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
+
+DOCBOOK_OUTPUT = docbook
+
+#---------------------------------------------------------------------------
+# Configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES doxygen will generate an AutoGen
+# Definitions (see http://autogen.sf.net) file that captures the structure of
+# the code including all documentation. Note that this feature is still
+# experimental and incomplete at the moment.
+# The default value is: NO.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# Configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES doxygen will generate a Perl module
+# file that captures the structure of the code including all documentation.
+#
+# Note that this feature is still experimental and incomplete at the moment.
+# The default value is: NO.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES doxygen will generate the necessary
+# Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI
+# output from the Perl module output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be nicely
+# formatted so it can be parsed by a human reader. This is useful if you want to
+# understand what is going on. On the other hand, if this tag is set to NO the
+# size of the Perl module output will be much smaller and Perl will parse it
+# just the same.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file are
+# prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful
+# so different doxyrules.make files included by the same Makefile don't
+# overwrite each other's variables.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES doxygen will evaluate all
+# C-preprocessor directives found in the sources and include files.
+# The default value is: YES.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES doxygen will expand all macro names
+# in the source code. If set to NO only conditional compilation will be
+# performed. Macro expansion can be done in a controlled way by setting
+# EXPAND_ONLY_PREDEF to YES.
+# The default value is: NO.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+MACRO_EXPANSION = YES
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then
+# the macro expansion is limited to the macros specified with the PREDEFINED and
+# EXPAND_AS_DEFINED tags.
+# The default value is: NO.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+EXPAND_ONLY_PREDEF = NO
+
+# If the SEARCH_INCLUDES tag is set to YES the includes files in the
+# INCLUDE_PATH will be searched if a #include is found.
+# The default value is: YES.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by the
+# preprocessor.
+# This tag requires that the tag SEARCH_INCLUDES is set to YES.
+
+INCLUDE_PATH = ../include
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will be
+# used.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+INCLUDE_FILE_PATTERNS = *.h
+
+# The PREDEFINED tag can be used to specify one or more macro names that are
+# defined before the preprocessor is started (similar to the -D option of e.g.
+# gcc). The argument of the tag is a list of macros of the form: name or
+# name=definition (no spaces). If the definition and the "=" are omitted, "=1"
+# is assumed. To prevent a macro definition from being undefined via #undef or
+# recursively expanded use the := operator instead of the = operator.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+PREDEFINED = "_MSC_VER=1400" \
+ _CPPRTTI \
+ _WIN32 \
+ JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
+# tag can be used to specify a list of macro names that should be expanded. The
+# macro definition that is found in the sources will be used. Use the PREDEFINED
+# tag if you want to use a different macro definition that overrules the
+# definition found in the source code.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+EXPAND_AS_DEFINED =
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will
+# remove all refrences to function-like macros that are alone on a line, have an
+# all uppercase name, and do not end with a semicolon. Such function macros are
+# typically used for boiler-plate code, and will confuse the parser if not
+# removed.
+# The default value is: YES.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration options related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES tag can be used to specify one or more tag files. For each tag
+# file the location of the external documentation should be added. The format of
+# a tag file without this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where loc1 and loc2 can be relative or absolute paths or URLs. See the
+# section "Linking to external documentation" for more information about the use
+# of tag files.
+# Note: Each tag file must have an unique name (where the name does NOT include
+# the path). If a tag file is not located in the directory in which doxygen is
+# run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create a
+# tag file that is based on the input files it reads. See section "Linking to
+# external documentation" for more information about the usage of tag files.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external class will be listed in the
+# class index. If set to NO only the inherited external classes will be listed.
+# The default value is: NO.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed in
+# the modules index. If set to NO, only the current project's groups will be
+# listed.
+# The default value is: YES.
+
+EXTERNAL_GROUPS = YES
+
+# If the EXTERNAL_PAGES tag is set to YES all external pages will be listed in
+# the related pages index. If set to NO, only the current project's pages will
+# be listed.
+# The default value is: YES.
+
+EXTERNAL_PAGES = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of 'which perl').
+# The default file (with absolute path) is: /usr/bin/perl.
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES doxygen will generate a class diagram
+# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to
+# NO turns the diagrams off. Note that this option also works with HAVE_DOT
+# disabled, but it is recommended to install and use dot, since it yields more
+# powerful graphs.
+# The default value is: YES.
+
+CLASS_DIAGRAMS = NO
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see:
+# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH =
+
+# If set to YES, the inheritance and collaboration graphs will hide inheritance
+# and usage relations if the target is undocumented or is not a class.
+# The default value is: YES.
+
+HIDE_UNDOC_RELATIONS = NO
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz (see:
+# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent
+# Bell Labs. The other options in this section have no effect if this option is
+# set to NO
+# The default value is: NO.
+
+HAVE_DOT = %HAVE_DOT%
+
+# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed
+# to run in parallel. When set to 0 doxygen will base this on the number of
+# processors available in the system. You can set it explicitly to a value
+# larger than 0 to get control over the balance between CPU load and processing
+# speed.
+# Minimum value: 0, maximum value: 32, default value: 0.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_NUM_THREADS = 0
+
+# When you want a differently looking font n the dot files that doxygen
+# generates you can specify the font name using DOT_FONTNAME. You need to make
+# sure dot is able to find the font, which can be done by putting it in a
+# standard location or by setting the DOTFONTPATH environment variable or by
+# setting DOT_FONTPATH to the directory containing the font.
+# The default value is: Helvetica.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_FONTNAME = FreeSans
+
+# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of
+# dot graphs.
+# Minimum value: 4, maximum value: 24, default value: 10.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_FONTSIZE = 10
+
+# By default doxygen will tell dot to use the default font as specified with
+# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set
+# the path where dot can find it using this tag.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_FONTPATH =
+
+# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for
+# each documented class showing the direct and indirect inheritance relations.
+# Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+CLASS_GRAPH = YES
+
+# If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a
+# graph for each documented class showing the direct and indirect implementation
+# dependencies (inheritance, containment, and class references variables) of the
+# class with other documented classes.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+COLLABORATION_GRAPH = YES
+
+# If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for
+# groups, showing the direct groups dependencies.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+GROUP_GRAPHS = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+UML_LOOK = %UML_LOOK%
+
+# If the UML_LOOK tag is enabled, the fields and methods are shown inside the
+# class node. If there are many fields or methods and many nodes the graph may
+# become too big to be useful. The UML_LIMIT_NUM_FIELDS threshold limits the
+# number of items for each type to make the size more manageable. Set this to 0
+# for no limit. Note that the threshold may be exceeded by 50% before the limit
+# is enforced. So when you set the threshold to 10, up to 15 fields may appear,
+# but if the number exceeds 15, the total amount of fields shown is limited to
+# 10.
+# Minimum value: 0, maximum value: 100, default value: 10.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+UML_LIMIT_NUM_FIELDS = 10
+
+# If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and
+# collaboration graphs will show the relations between templates and their
+# instances.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+TEMPLATE_RELATIONS = YES
+
+# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to
+# YES then doxygen will generate a graph for each documented file showing the
+# direct and indirect include dependencies of the file with other documented
+# files.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+INCLUDE_GRAPH = YES
+
+# If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are
+# set to YES then doxygen will generate a graph for each documented file showing
+# the direct and indirect include dependencies of the file with other documented
+# files.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+INCLUDED_BY_GRAPH = YES
+
+# If the CALL_GRAPH tag is set to YES then doxygen will generate a call
+# dependency graph for every global function or class method.
+#
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable call graphs for selected
+# functions only using the \callgraph command.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+CALL_GRAPH = NO
+
+# If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller
+# dependency graph for every global function or class method.
+#
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable caller graphs for selected
+# functions only using the \callergraph command.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+CALLER_GRAPH = YES
+
+# If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical
+# hierarchy of all classes instead of a textual one.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+GRAPHICAL_HIERARCHY = YES
+
+# If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the
+# dependencies a directory has on other directories in a graphical way. The
+# dependency relations are determined by the #include relations between the
+# files in the directories.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DIRECTORY_GRAPH = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot.
+# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order
+# to make the SVG files visible in IE 9+ (other browsers do not have this
+# requirement).
+# Possible values are: png, jpg, gif and svg.
+# The default value is: png.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_IMAGE_FORMAT = png
+
+# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
+# enable generation of interactive SVG images that allow zooming and panning.
+#
+# Note that this requires a modern browser other than Internet Explorer. Tested
+# and working are Firefox, Chrome, Safari, and Opera.
+# Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make
+# the SVG files visible. Older versions of IE do not have SVG support.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+INTERACTIVE_SVG = NO
+
+# The DOT_PATH tag can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_PATH = %DOT_PATH%
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the \dotfile
+# command).
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOTFILE_DIRS =
+
+# The MSCFILE_DIRS tag can be used to specify one or more directories that
+# contain msc files that are included in the documentation (see the \mscfile
+# command).
+
+MSCFILE_DIRS =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes
+# that will be shown in the graph. If the number of nodes in a graph becomes
+# larger than this value, doxygen will truncate the graph, which is visualized
+# by representing a node as a red box. Note that doxygen if the number of direct
+# children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note that
+# the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+# Minimum value: 0, maximum value: 10000, default value: 50.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_GRAPH_MAX_NODES = 50
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs
+# generated by dot. A depth value of 3 means that only nodes reachable from the
+# root by following a path via at most 3 edges will be shown. Nodes that lay
+# further from the root node will be omitted. Note that setting this option to 1
+# or 2 may greatly reduce the computation time needed for large code bases. Also
+# note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+# Minimum value: 0, maximum value: 1000, default value: 0.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+MAX_DOT_GRAPH_DEPTH = 1000
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not seem
+# to support this out of the box.
+#
+# Warning: Depending on the platform used, enabling this option may lead to
+# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
+# read).
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_TRANSPARENT = NO
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10) support
+# this, this feature is disabled by default.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_MULTI_TARGETS = YES
+
+# If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page
+# explaining the meaning of the various boxes and arrows in the dot generated
+# graphs.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES doxygen will remove the intermediate dot
+# files that are used to generate the various graphs.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_CLEANUP = YES
diff --git a/3rdparty/jsoncpp/doxybuild.py b/3rdparty/jsoncpp/doxybuild.py
index 0b61c397e43..f18c9c0697b 100644
--- a/3rdparty/jsoncpp/doxybuild.py
+++ b/3rdparty/jsoncpp/doxybuild.py
@@ -1,22 +1,37 @@
"""Script to generate doxygen documentation.
"""
from __future__ import print_function
+from __future__ import unicode_literals
from devtools import tarball
+from contextlib import contextmanager
+import subprocess
+import traceback
import re
import os
-import os.path
import sys
import shutil
+@contextmanager
+def cd(newdir):
+ """
+ http://stackoverflow.com/questions/431684/how-do-i-cd-in-python
+ """
+ prevdir = os.getcwd()
+ os.chdir(newdir)
+ try:
+ yield
+ finally:
+ os.chdir(prevdir)
+
def find_program(*filenames):
"""find a program in folders path_lst, and sets env[var]
@param filenames: a list of possible names of the program to search for
@return: the full path of the filename if found, or '' if filename could not be found
"""
paths = os.environ.get('PATH', '').split(os.pathsep)
- suffixes = ('win32' in sys.platform ) and '.exe .com .bat .cmd' or ''
+ suffixes = ('win32' in sys.platform) and '.exe .com .bat .cmd' or ''
for filename in filenames:
- for name in [filename+ext for ext in suffixes.split()]:
+ for name in [filename+ext for ext in suffixes.split(' ')]:
for directory in paths:
full_path = os.path.join(directory, name)
if os.path.isfile(full_path):
@@ -28,53 +43,56 @@ def do_subst_in_file(targetfile, sourcefile, dict):
For example, if dict is {'%VERSION%': '1.2345', '%BASE%': 'MyProg'},
then all instances of %VERSION% in the file will be replaced with 1.2345 etc.
"""
- try:
- f = open(sourcefile, 'rb')
+ with open(sourcefile, 'r') as f:
contents = f.read()
- f.close()
- except:
- print("Can't read source file %s"%sourcefile)
- raise
for (k,v) in list(dict.items()):
v = v.replace('\\','\\\\')
contents = re.sub(k, v, contents)
- try:
- f = open(targetfile, 'wb')
+ with open(targetfile, 'w') as f:
f.write(contents)
- f.close()
+
+def getstatusoutput(cmd):
+ """cmd is a list.
+ """
+ try:
+ process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+ output, _ = process.communicate()
+ status = process.returncode
except:
- print("Can't write target file %s"%targetfile)
- raise
+ status = -1
+ output = traceback.format_exc()
+ return status, output
+
+def run_cmd(cmd, silent=False):
+ """Raise exception on failure.
+ """
+ info = 'Running: %r in %r' %(' '.join(cmd), os.getcwd())
+ print(info)
+ sys.stdout.flush()
+ if silent:
+ status, output = getstatusoutput(cmd)
+ else:
+ status, output = subprocess.call(cmd), ''
+ if status:
+ msg = 'Error while %s ...\n\terror=%d, output="""%s"""' %(info, status, output)
+ raise Exception(msg)
+
+def assert_is_exe(path):
+ if not path:
+ raise Exception('path is empty.')
+ if not os.path.isfile(path):
+ raise Exception('%r is not a file.' %path)
+ if not os.access(path, os.X_OK):
+ raise Exception('%r is not executable by this user.' %path)
def run_doxygen(doxygen_path, config_file, working_dir, is_silent):
- config_file = os.path.abspath( config_file )
- doxygen_path = doxygen_path
- old_cwd = os.getcwd()
- try:
- os.chdir( working_dir )
+ assert_is_exe(doxygen_path)
+ config_file = os.path.abspath(config_file)
+ with cd(working_dir):
cmd = [doxygen_path, config_file]
- print('Running:', ' '.join( cmd ))
- try:
- import subprocess
- except:
- if os.system( ' '.join( cmd ) ) != 0:
- print('Documentation generation failed')
- return False
- else:
- if is_silent:
- process = subprocess.Popen( cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT )
- else:
- process = subprocess.Popen( cmd )
- stdout, _ = process.communicate()
- if process.returncode:
- print('Documentation generation failed:')
- print(stdout)
- return False
- return True
- finally:
- os.chdir( old_cwd )
+ run_cmd(cmd, is_silent)
-def build_doc( options, make_release=False ):
+def build_doc(options, make_release=False):
if make_release:
options.make_tarball = True
options.with_dot = True
@@ -83,56 +101,56 @@ def build_doc( options, make_release=False ):
options.open = False
options.silent = True
- version = open('version','rt').read().strip()
+ version = open('version', 'rt').read().strip()
output_dir = 'dist/doxygen' # relative to doc/doxyfile location.
- if not os.path.isdir( output_dir ):
- os.makedirs( output_dir )
- top_dir = os.path.abspath( '.' )
+ if not os.path.isdir(output_dir):
+ os.makedirs(output_dir)
+ top_dir = os.path.abspath('.')
html_output_dirname = 'jsoncpp-api-html-' + version
- tarball_path = os.path.join( 'dist', html_output_dirname + '.tar.gz' )
- warning_log_path = os.path.join( output_dir, '../jsoncpp-doxygen-warning.log' )
- html_output_path = os.path.join( output_dir, html_output_dirname )
- def yesno( bool ):
+ tarball_path = os.path.join('dist', html_output_dirname + '.tar.gz')
+ warning_log_path = os.path.join(output_dir, '../jsoncpp-doxygen-warning.log')
+ html_output_path = os.path.join(output_dir, html_output_dirname)
+ def yesno(bool):
return bool and 'YES' or 'NO'
subst_keys = {
'%JSONCPP_VERSION%': version,
'%DOC_TOPDIR%': '',
'%TOPDIR%': top_dir,
- '%HTML_OUTPUT%': os.path.join( '..', output_dir, html_output_dirname ),
+ '%HTML_OUTPUT%': os.path.join('..', output_dir, html_output_dirname),
'%HAVE_DOT%': yesno(options.with_dot),
'%DOT_PATH%': os.path.split(options.dot_path)[0],
'%HTML_HELP%': yesno(options.with_html_help),
'%UML_LOOK%': yesno(options.with_uml_look),
- '%WARNING_LOG_PATH%': os.path.join( '..', warning_log_path )
+ '%WARNING_LOG_PATH%': os.path.join('..', warning_log_path)
}
- if os.path.isdir( output_dir ):
+ if os.path.isdir(output_dir):
print('Deleting directory:', output_dir)
- shutil.rmtree( output_dir )
- if not os.path.isdir( output_dir ):
- os.makedirs( output_dir )
+ shutil.rmtree(output_dir)
+ if not os.path.isdir(output_dir):
+ os.makedirs(output_dir)
- do_subst_in_file( 'doc/doxyfile', 'doc/doxyfile.in', subst_keys )
- ok = run_doxygen( options.doxygen_path, 'doc/doxyfile', 'doc', is_silent=options.silent )
+ do_subst_in_file('doc/doxyfile', options.doxyfile_input_path, subst_keys)
+ run_doxygen(options.doxygen_path, 'doc/doxyfile', 'doc', is_silent=options.silent)
if not options.silent:
- print(open(warning_log_path, 'rb').read())
+ print(open(warning_log_path, 'r').read())
index_path = os.path.abspath(os.path.join('doc', subst_keys['%HTML_OUTPUT%'], 'index.html'))
print('Generated documentation can be found in:')
print(index_path)
if options.open:
import webbrowser
- webbrowser.open( 'file://' + index_path )
+ webbrowser.open('file://' + index_path)
if options.make_tarball:
print('Generating doc tarball to', tarball_path)
tarball_sources = [
output_dir,
- 'README.txt',
+ 'README.md',
'LICENSE',
'NEWS.txt',
'version'
]
- tarball_basedir = os.path.join( output_dir, html_output_dirname )
- tarball.make_tarball( tarball_path, tarball_sources, tarball_basedir, html_output_dirname )
+ tarball_basedir = os.path.join(output_dir, html_output_dirname)
+ tarball.make_tarball(tarball_path, tarball_sources, tarball_basedir, html_output_dirname)
return tarball_path, html_output_dirname
def main():
@@ -151,6 +169,8 @@ def main():
help="""Path to GraphViz dot tool. Must be full qualified path. [Default: %default]""")
parser.add_option('--doxygen', dest="doxygen_path", action='store', default=find_program('doxygen'),
help="""Path to Doxygen tool. [Default: %default]""")
+ parser.add_option('--in', dest="doxyfile_input_path", action='store', default='doc/doxyfile.in',
+ help="""Path to doxygen inputs. [Default: %default]""")
parser.add_option('--with-html-help', dest="with_html_help", action='store_true', default=False,
help="""Enable generation of Microsoft HTML HELP""")
parser.add_option('--no-uml-look', dest="with_uml_look", action='store_false', default=True,
@@ -163,7 +183,7 @@ def main():
help="""Hides doxygen output""")
parser.enable_interspersed_args()
options, args = parser.parse_args()
- build_doc( options )
+ build_doc(options)
if __name__ == '__main__':
main()
diff --git a/3rdparty/jsoncpp/include/json/assertions.h b/3rdparty/jsoncpp/include/json/assertions.h
index 5ef7e7bb7d4..fbec7ae00e2 100644
--- a/3rdparty/jsoncpp/include/json/assertions.h
+++ b/3rdparty/jsoncpp/include/json/assertions.h
@@ -7,35 +7,48 @@
#define CPPTL_JSON_ASSERTIONS_H_INCLUDED
#include <stdlib.h>
+#include <sstream>
#if !defined(JSON_IS_AMALGAMATION)
#include "config.h"
#endif // if !defined(JSON_IS_AMALGAMATION)
+/** It should not be possible for a maliciously designed file to
+ * cause an abort() or seg-fault, so these macros are used only
+ * for pre-condition violations and internal logic errors.
+ */
#if JSON_USE_EXCEPTION
-#include <stdexcept>
-#define JSON_ASSERT(condition) \
- assert(condition); // @todo <= change this into an exception throw
-#define JSON_FAIL_MESSAGE(message) throw std::runtime_error(message);
+
+// @todo <= add detail about condition in exception
+# define JSON_ASSERT(condition) \
+ {if (!(condition)) {Json::throwLogicError( "assert json failed" );}}
+
+# define JSON_FAIL_MESSAGE(message) \
+ { \
+ std::ostringstream oss; oss << message; \
+ Json::throwLogicError(oss.str()); \
+ abort(); \
+ }
+
#else // JSON_USE_EXCEPTION
-#define JSON_ASSERT(condition) assert(condition);
+
+# define JSON_ASSERT(condition) assert(condition)
// The call to assert() will show the failure message in debug builds. In
-// release bugs we write to invalid memory in order to crash hard, so that a
-// debugger or crash reporter gets the chance to take over. We still call exit()
-// afterward in order to tell the compiler that this macro doesn't return.
-#define JSON_FAIL_MESSAGE(message) \
+// release builds we abort, for a core-dump or debugger.
+# define JSON_FAIL_MESSAGE(message) \
{ \
- assert(false&& message); \
- strcpy(reinterpret_cast<char*>(666), message); \
- exit(123); \
+ std::ostringstream oss; oss << message; \
+ assert(false && oss.str().c_str()); \
+ abort(); \
}
+
#endif
#define JSON_ASSERT_MESSAGE(condition, message) \
if (!(condition)) { \
- JSON_FAIL_MESSAGE(message) \
+ JSON_FAIL_MESSAGE(message); \
}
#endif // CPPTL_JSON_ASSERTIONS_H_INCLUDED
diff --git a/3rdparty/jsoncpp/include/json/config.h b/3rdparty/jsoncpp/include/json/config.h
index afd3a45607c..0dcd8ae600f 100644
--- a/3rdparty/jsoncpp/include/json/config.h
+++ b/3rdparty/jsoncpp/include/json/config.h
@@ -15,17 +15,6 @@
/// std::map
/// as Value container.
//# define JSON_USE_CPPTL_SMALLMAP 1
-/// If defined, indicates that Json specific container should be used
-/// (hash table & simple deque container with customizable allocator).
-/// THIS FEATURE IS STILL EXPERIMENTAL! There is know bugs: See #3177332
-//# define JSON_VALUE_USE_INTERNAL_MAP 1
-/// Force usage of standard new/malloc based allocator instead of memory pool
-/// based allocator.
-/// The memory pools allocator used optimization (initializing Value and
-/// ValueInternalLink
-/// as if it was a POD) that may cause some validation tool to report errors.
-/// Only has effects if JSON_VALUE_USE_INTERNAL_MAP is defined.
-//# define JSON_USE_SIMPLE_INTERNAL_ALLOCATOR 1
// If non-zero, the library uses exceptions to report bad input instead of C
// assertion macros. The default is to use exceptions.
@@ -81,6 +70,14 @@
#if defined(_MSC_VER) && _MSC_VER >= 1500 // MSVC 2008
/// Indicates that the following function is deprecated.
#define JSONCPP_DEPRECATED(message) __declspec(deprecated(message))
+#elif defined(__clang__) && defined(__has_feature)
+#if __has_feature(attribute_deprecated_with_message)
+#define JSONCPP_DEPRECATED(message) __attribute__ ((deprecated(message)))
+#endif
+#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5))
+#define JSONCPP_DEPRECATED(message) __attribute__ ((deprecated(message)))
+#elif defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
+#define JSONCPP_DEPRECATED(message) __attribute__((__deprecated__))
#endif
#if !defined(JSONCPP_DEPRECATED)
diff --git a/3rdparty/jsoncpp/include/json/forwards.h b/3rdparty/jsoncpp/include/json/forwards.h
index 84a26cd2f72..ccfe09abf4b 100644
--- a/3rdparty/jsoncpp/include/json/forwards.h
+++ b/3rdparty/jsoncpp/include/json/forwards.h
@@ -31,12 +31,6 @@ class Value;
class ValueIteratorBase;
class ValueIterator;
class ValueConstIterator;
-#ifdef JSON_VALUE_USE_INTERNAL_MAP
-class ValueMapAllocator;
-class ValueInternalLink;
-class ValueInternalArray;
-class ValueInternalMap;
-#endif // #ifdef JSON_VALUE_USE_INTERNAL_MAP
} // namespace Json
diff --git a/3rdparty/jsoncpp/include/json/reader.h b/3rdparty/jsoncpp/include/json/reader.h
index 98814d50e29..c8ff747e4b1 100644
--- a/3rdparty/jsoncpp/include/json/reader.h
+++ b/3rdparty/jsoncpp/include/json/reader.h
@@ -14,6 +14,7 @@
#include <iosfwd>
#include <stack>
#include <string>
+#include <istream>
// Disable warning C4251: <data member>: <type> needs to have dll-interface to
// be used by...
@@ -27,6 +28,7 @@ namespace Json {
/** \brief Unserialize a <a HREF="http://www.json.org">JSON</a> document into a
*Value.
*
+ * \deprecated Use CharReader and CharReaderBuilder.
*/
class JSON_API Reader {
public:
@@ -78,7 +80,7 @@ public:
document to read.
* \param endDoc Pointer on the end of the UTF-8 encoded string of the
document to read.
- \ Must be >= beginDoc.
+ * Must be >= beginDoc.
* \param root [out] Contains the root value of the document if it was
* successfully parsed.
* \param collectComments \c true to collect comment and allow writing them
@@ -108,7 +110,7 @@ public:
* during parsing.
* \deprecated Use getFormattedErrorMessages() instead (typo fix).
*/
- JSONCPP_DEPRECATED("Use getFormattedErrorMessages instead")
+ JSONCPP_DEPRECATED("Use getFormattedErrorMessages() instead.")
std::string getFormatedErrorMessages() const;
/** \brief Returns a user friendly string that list errors in the parsed
@@ -187,7 +189,6 @@ private:
typedef std::deque<ErrorInfo> Errors;
- bool expectToken(TokenType type, Token& token, const char* message);
bool readToken(Token& token);
void skipSpaces();
bool match(Location pattern, int patternLength);
@@ -239,8 +240,132 @@ private:
std::string commentsBefore_;
Features features_;
bool collectComments_;
+}; // Reader
+
+/** Interface for reading JSON from a char array.
+ */
+class JSON_API CharReader {
+public:
+ virtual ~CharReader() {}
+ /** \brief Read a Value from a <a HREF="http://www.json.org">JSON</a>
+ document.
+ * The document must be a UTF-8 encoded string containing the document to read.
+ *
+ * \param beginDoc Pointer on the beginning of the UTF-8 encoded string of the
+ document to read.
+ * \param endDoc Pointer on the end of the UTF-8 encoded string of the
+ document to read.
+ * Must be >= beginDoc.
+ * \param root [out] Contains the root value of the document if it was
+ * successfully parsed.
+ * \param errs [out] Formatted error messages (if not NULL)
+ * a user friendly string that lists errors in the parsed
+ * document.
+ * \return \c true if the document was successfully parsed, \c false if an
+ error occurred.
+ */
+ virtual bool parse(
+ char const* beginDoc, char const* endDoc,
+ Value* root, std::string* errs) = 0;
+
+ class Factory {
+ public:
+ virtual ~Factory() {}
+ /** \brief Allocate a CharReader via operator new().
+ * \throw std::exception if something goes wrong (e.g. invalid settings)
+ */
+ virtual CharReader* newCharReader() const = 0;
+ }; // Factory
+}; // CharReader
+
+/** \brief Build a CharReader implementation.
+
+Usage:
+\code
+ using namespace Json;
+ CharReaderBuilder builder;
+ builder["collectComments"] = false;
+ Value value;
+ std::string errs;
+ bool ok = parseFromStream(builder, std::cin, &value, &errs);
+\endcode
+*/
+class JSON_API CharReaderBuilder : public CharReader::Factory {
+public:
+ // Note: We use a Json::Value so that we can add data-members to this class
+ // without a major version bump.
+ /** Configuration of this builder.
+ These are case-sensitive.
+ Available settings (case-sensitive):
+ - `"collectComments": false or true`
+ - true to collect comment and allow writing them
+ back during serialization, false to discard comments.
+ This parameter is ignored if allowComments is false.
+ - `"allowComments": false or true`
+ - true if comments are allowed.
+ - `"strictRoot": false or true`
+ - true if root must be either an array or an object value
+ - `"allowDroppedNullPlaceholders": false or true`
+ - true if dropped null placeholders are allowed. (See StreamWriterBuilder.)
+ - `"allowNumericKeys": false or true`
+ - true if numeric object keys are allowed.
+ - `"allowSingleQuotes": false or true`
+ - true if '' are allowed for strings (both keys and values)
+ - `"stackLimit": integer`
+ - Exceeding stackLimit (recursive depth of `readValue()`) will
+ cause an exception.
+ - This is a security issue (seg-faults caused by deeply nested JSON),
+ so the default is low.
+ - `"failIfExtra": false or true`
+ - If true, `parse()` returns false when extra non-whitespace trails
+ the JSON value in the input string.
+ - `"rejectDupKeys": false or true`
+ - If true, `parse()` returns false when a key is duplicated within an object.
+
+ You can examine 'settings_` yourself
+ to see the defaults. You can also write and read them just like any
+ JSON Value.
+ \sa setDefaults()
+ */
+ Json::Value settings_;
+
+ CharReaderBuilder();
+ virtual ~CharReaderBuilder();
+
+ virtual CharReader* newCharReader() const;
+
+ /** \return true if 'settings' are legal and consistent;
+ * otherwise, indicate bad settings via 'invalid'.
+ */
+ bool validate(Json::Value* invalid) const;
+
+ /** A simple way to update a specific setting.
+ */
+ Value& operator[](std::string key);
+
+ /** Called by ctor, but you can use this to reset settings_.
+ * \pre 'settings' != NULL (but Json::null is fine)
+ * \remark Defaults:
+ * \snippet src/lib_json/json_reader.cpp CharReaderBuilderDefaults
+ */
+ static void setDefaults(Json::Value* settings);
+ /** Same as old Features::strictMode().
+ * \pre 'settings' != NULL (but Json::null is fine)
+ * \remark Defaults:
+ * \snippet src/lib_json/json_reader.cpp CharReaderBuilderStrictMode
+ */
+ static void strictMode(Json::Value* settings);
};
+/** Consume entire stream and use its begin/end.
+ * Someday we might have a real StreamReader, but for now this
+ * is convenient.
+ */
+bool JSON_API parseFromStream(
+ CharReader::Factory const&,
+ std::istream&,
+ Value* root, std::string* errs);
+
/** \brief Read from 'sin' into 'root'.
Always keep comments from the input JSON.
diff --git a/3rdparty/jsoncpp/include/json/value.h b/3rdparty/jsoncpp/include/json/value.h
index 197a85614df..2ac94fa8129 100644
--- a/3rdparty/jsoncpp/include/json/value.h
+++ b/3rdparty/jsoncpp/include/json/value.h
@@ -11,6 +11,7 @@
#endif // if !defined(JSON_IS_AMALGAMATION)
#include <string>
#include <vector>
+#include <exception>
#ifndef JSON_USE_CPPTL_SMALLMAP
#include <map>
@@ -32,6 +33,31 @@
*/
namespace Json {
+/** Base class for all exceptions we throw.
+ *
+ * We use nothing but these internally. Of course, STL can throw others.
+ */
+class JSON_API Exception;
+/** Exceptions which the user cannot easily avoid.
+ *
+ * E.g. out-of-memory (when we use malloc), stack-overflow, malicious input
+ *
+ * \remark derived from Json::Exception
+ */
+class JSON_API RuntimeError;
+/** Exceptions thrown by JSON_ASSERT/JSON_FAIL macros.
+ *
+ * These are precondition-violations (user bugs) and internal errors (our bugs).
+ *
+ * \remark derived from Json::Exception
+ */
+class JSON_API LogicError;
+
+/// used internally
+void throwRuntimeError(std::string const& msg);
+/// used internally
+void throwLogicError(std::string const& msg);
+
/** \brief Type of the value held by a Value object.
*/
enum ValueType {
@@ -74,14 +100,14 @@ enum CommentPlacement {
*/
class JSON_API StaticString {
public:
- explicit StaticString(const char* czstring) : str_(czstring) {}
+ explicit StaticString(const char* czstring) : c_str_(czstring) {}
- operator const char*() const { return str_; }
+ operator const char*() const { return c_str_; }
- const char* c_str() const { return str_; }
+ const char* c_str() const { return c_str_; }
private:
- const char* str_;
+ const char* c_str_;
};
/** \brief Represents a <a HREF="http://www.json.org">JSON</a> value.
@@ -99,26 +125,27 @@ private:
* The type of the held value is represented by a #ValueType and
* can be obtained using type().
*
- * values of an #objectValue or #arrayValue can be accessed using operator[]()
- *methods.
- * Non const methods will automatically create the a #nullValue element
+ * Values of an #objectValue or #arrayValue can be accessed using operator[]()
+ * methods.
+ * Non-const methods will automatically create the a #nullValue element
* if it does not exist.
- * The sequence of an #arrayValue will be automatically resize and initialized
+ * The sequence of an #arrayValue will be automatically resized and initialized
* with #nullValue. resize() can be used to enlarge or truncate an #arrayValue.
*
- * The get() methods can be used to obtanis default value in the case the
- *required element
- * does not exist.
+ * The get() methods can be used to obtain default value in the case the
+ * required element does not exist.
*
* It is possible to iterate over the list of a #objectValue values using
* the getMemberNames() method.
+ *
+ * \note #Value string-length fit in size_t, but keys must be < 2^30.
+ * (The reason is an implementation detail.) A #CharReader will raise an
+ * exception if a bound is exceeded to avoid security holes in your app,
+ * but the Value API does *not* check bounds. That is the responsibility
+ * of the caller.
*/
class JSON_API Value {
friend class ValueIteratorBase;
-#ifdef JSON_VALUE_USE_INTERNAL_MAP
- friend class ValueInternalLink;
- friend class ValueInternalMap;
-#endif
public:
typedef std::vector<std::string> Members;
typedef ValueIterator iterator;
@@ -133,7 +160,8 @@ public:
typedef Json::LargestUInt LargestUInt;
typedef Json::ArrayIndex ArrayIndex;
- static const Value& null;
+ static const Value& null; ///< We regret this reference to a global instance; prefer the simpler Value().
+ static const Value& nullRef; ///< just a kludge for binary-compatibility; same as null
/// Minimum signed integer value that can be stored in a Json::Value.
static const LargestInt minLargestInt;
/// Maximum signed integer value that can be stored in a Json::Value.
@@ -159,7 +187,6 @@ public:
private:
#ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
class CZString {
public:
enum DuplicationPolicy {
@@ -168,20 +195,31 @@ private:
duplicateOnCopy
};
CZString(ArrayIndex index);
- CZString(const char* cstr, DuplicationPolicy allocate);
- CZString(const CZString& other);
+ CZString(char const* str, unsigned length, DuplicationPolicy allocate);
+ CZString(CZString const& other);
~CZString();
CZString& operator=(CZString other);
- bool operator<(const CZString& other) const;
- bool operator==(const CZString& other) const;
+ bool operator<(CZString const& other) const;
+ bool operator==(CZString const& other) const;
ArrayIndex index() const;
- const char* c_str() const;
+ //const char* c_str() const; ///< \deprecated
+ char const* data() const;
+ unsigned length() const;
bool isStaticString() const;
private:
void swap(CZString& other);
- const char* cstr_;
- ArrayIndex index_;
+
+ struct StringStorage {
+ unsigned policy_: 2;
+ unsigned length_: 30; // 1GB max
+ };
+
+ char const* cstr_; // actually, a prefixed string, unless policy is noDup
+ union {
+ ArrayIndex index_;
+ StringStorage storage_;
+ };
};
public:
@@ -190,7 +228,6 @@ public:
#else
typedef CppTL::SmallMap<CZString, Value> ObjectValues;
#endif // ifndef JSON_USE_CPPTL_SMALLMAP
-#endif // ifndef JSON_VALUE_USE_INTERNAL_MAP
#endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
public:
@@ -217,47 +254,59 @@ Json::Value obj_value(Json::objectValue); // {}
Value(UInt64 value);
#endif // if defined(JSON_HAS_INT64)
Value(double value);
- Value(const char* value);
- Value(const char* beginValue, const char* endValue);
+ Value(const char* value); ///< Copy til first 0. (NULL causes to seg-fault.)
+ Value(const char* beginValue, const char* endValue); ///< Copy all, incl zeroes.
/** \brief Constructs a value from a static string.
* Like other value string constructor but do not duplicate the string for
* internal storage. The given string must remain alive after the call to this
* constructor.
+ * \note This works only for null-terminated strings. (We cannot change the
+ * size of this class, so we have nowhere to store the length,
+ * which might be computed later for various operations.)
+ *
* Example of usage:
* \code
- * Json::Value aValue( StaticString("some text") );
+ * static StaticString foo("some text");
+ * Json::Value aValue(foo);
* \endcode
*/
Value(const StaticString& value);
- Value(const std::string& value);
+ Value(const std::string& value); ///< Copy data() til size(). Embedded zeroes too.
#ifdef JSON_USE_CPPTL
Value(const CppTL::ConstString& value);
#endif
Value(bool value);
+ /// Deep copy.
Value(const Value& other);
~Value();
+ /// Deep copy, then swap(other).
+ /// \note Over-write existing comments. To preserve comments, use #swapPayload().
Value& operator=(Value other);
- /// Swap values.
- /// \note Currently, comments are intentionally not swapped, for
- /// both logic and efficiency.
+ /// Swap everything.
void swap(Value& other);
+ /// Swap values but leave comments and source offsets in place.
+ void swapPayload(Value& other);
ValueType type() const;
+ /// Compare payload only, not comments etc.
bool operator<(const Value& other) const;
bool operator<=(const Value& other) const;
bool operator>=(const Value& other) const;
bool operator>(const Value& other) const;
-
bool operator==(const Value& other) const;
bool operator!=(const Value& other) const;
-
int compare(const Value& other) const;
- const char* asCString() const;
- std::string asString() const;
+ const char* asCString() const; ///< Embedded zeroes could cause you trouble!
+ std::string asString() const; ///< Embedded zeroes are possible.
+ /** Get raw char* of string-value.
+ * \return false if !string. (Seg-fault if str or end are NULL.)
+ */
+ bool getString(
+ char const** str, char const** end) const;
#ifdef JSON_USE_CPPTL
CppTL::ConstString asConstString() const;
#endif
@@ -348,19 +397,23 @@ Json::Value obj_value(Json::objectValue); // {}
Value& append(const Value& value);
/// Access an object value by name, create a null member if it does not exist.
+ /// \note Because of our implementation, keys are limited to 2^30 -1 chars.
+ /// Exceeding that will cause an exception.
Value& operator[](const char* key);
/// Access an object value by name, returns null if there is no member with
/// that name.
const Value& operator[](const char* key) const;
/// Access an object value by name, create a null member if it does not exist.
+ /// \param key may contain embedded nulls.
Value& operator[](const std::string& key);
/// Access an object value by name, returns null if there is no member with
/// that name.
+ /// \param key may contain embedded nulls.
const Value& operator[](const std::string& key) const;
/** \brief Access an object value by name, create a null member if it does not
exist.
- * If the object as no entry for that name, then the member name used to store
+ * If the object has no entry for that name, then the member name used to store
* the new entry is not duplicated.
* Example of use:
* \code
@@ -378,27 +431,69 @@ Json::Value obj_value(Json::objectValue); // {}
const Value& operator[](const CppTL::ConstString& key) const;
#endif
/// Return the member named key if it exist, defaultValue otherwise.
+ /// \note deep copy
Value get(const char* key, const Value& defaultValue) const;
/// Return the member named key if it exist, defaultValue otherwise.
+ /// \note deep copy
+ /// \param key may contain embedded nulls.
+ Value get(const char* key, const char* end, const Value& defaultValue) const;
+ /// Return the member named key if it exist, defaultValue otherwise.
+ /// \note deep copy
+ /// \param key may contain embedded nulls.
Value get(const std::string& key, const Value& defaultValue) const;
#ifdef JSON_USE_CPPTL
/// Return the member named key if it exist, defaultValue otherwise.
+ /// \note deep copy
Value get(const CppTL::ConstString& key, const Value& defaultValue) const;
#endif
+ /// Most general and efficient version of isMember()const, get()const,
+ /// and operator[]const
+ /// \note As stated elsewhere, behavior is undefined if (end-key) >= 2^30
+ Value const* find(char const* key, char const* end) const;
+ /// Most general and efficient version of object-mutators.
+ /// \note As stated elsewhere, behavior is undefined if (end-key) >= 2^30
+ /// \return non-zero, but JSON_ASSERT if this is neither object nor nullValue.
+ Value const* demand(char const* key, char const* end);
/// \brief Remove and return the named member.
///
/// Do nothing if it did not exist.
/// \return the removed Value, or null.
/// \pre type() is objectValue or nullValue
/// \post type() is unchanged
+ /// \deprecated
Value removeMember(const char* key);
/// Same as removeMember(const char*)
+ /// \param key may contain embedded nulls.
+ /// \deprecated
Value removeMember(const std::string& key);
+ /// Same as removeMember(const char* key, const char* end, Value* removed),
+ /// but 'key' is null-terminated.
+ bool removeMember(const char* key, Value* removed);
+ /** \brief Remove the named map member.
+
+ Update 'removed' iff removed.
+ \param key may contain embedded nulls.
+ \return true iff removed (no exceptions)
+ */
+ bool removeMember(std::string const& key, Value* removed);
+ /// Same as removeMember(std::string const& key, Value* removed)
+ bool removeMember(const char* key, const char* end, Value* removed);
+ /** \brief Remove the indexed array element.
+
+ O(n) expensive operations.
+ Update 'removed' iff removed.
+ \return true iff removed (no exceptions)
+ */
+ bool removeIndex(ArrayIndex i, Value* removed);
/// Return true if the object has a member named key.
+ /// \note 'key' must be null-terminated.
bool isMember(const char* key) const;
/// Return true if the object has a member named key.
+ /// \param key may contain embedded nulls.
bool isMember(const std::string& key) const;
+ /// Same as isMember(std::string const& key)const
+ bool isMember(const char* key, const char* end) const;
#ifdef JSON_USE_CPPTL
/// Return true if the object has a member named key.
bool isMember(const CppTL::ConstString& key) const;
@@ -416,9 +511,12 @@ Json::Value obj_value(Json::objectValue); // {}
// EnumValues enumValues() const;
//# endif
- /// Comments must be //... or /* ... */
+ /// \deprecated Always pass len.
+ JSONCPP_DEPRECATED("Use setComment(std::string const&) instead.")
void setComment(const char* comment, CommentPlacement placement);
/// Comments must be //... or /* ... */
+ void setComment(const char* comment, size_t len, CommentPlacement placement);
+ /// Comments must be //... or /* ... */
void setComment(const std::string& comment, CommentPlacement placement);
bool hasComment(CommentPlacement placement) const;
/// Include delimiters and embedded newlines.
@@ -442,26 +540,14 @@ Json::Value obj_value(Json::objectValue); // {}
private:
void initBasic(ValueType type, bool allocated = false);
- Value& resolveReference(const char* key, bool isStatic);
-
-#ifdef JSON_VALUE_USE_INTERNAL_MAP
- inline bool isItemAvailable() const { return itemIsUsed_ == 0; }
-
- inline void setItemUsed(bool isUsed = true) { itemIsUsed_ = isUsed ? 1 : 0; }
-
- inline bool isMemberNameStatic() const { return memberNameIsStatic_ == 0; }
-
- inline void setMemberNameIsStatic(bool isStatic) {
- memberNameIsStatic_ = isStatic ? 1 : 0;
- }
-#endif // # ifdef JSON_VALUE_USE_INTERNAL_MAP
+ Value& resolveReference(const char* key);
+ Value& resolveReference(const char* key, const char* end);
-private:
struct CommentInfo {
CommentInfo();
~CommentInfo();
- void setComment(const char* text);
+ void setComment(const char* text, size_t len);
char* comment_;
};
@@ -480,20 +566,12 @@ private:
LargestUInt uint_;
double real_;
bool bool_;
- char* string_;
-#ifdef JSON_VALUE_USE_INTERNAL_MAP
- ValueInternalArray* array_;
- ValueInternalMap* map_;
-#else
+ char* string_; // actually ptr to unsigned, followed by str, unless !allocated_
ObjectValues* map_;
-#endif
} value_;
ValueType type_ : 8;
- int allocated_ : 1; // Notes: if declared as bool, bitfield is useless.
-#ifdef JSON_VALUE_USE_INTERNAL_MAP
- unsigned int itemIsUsed_ : 1; // used by the ValueInternalMap container.
- int memberNameIsStatic_ : 1; // used by the ValueInternalMap container.
-#endif
+ unsigned int allocated_ : 1; // Notes: if declared as bool, bitfield is useless.
+ // If not allocated_, string_ must be null-terminated.
CommentInfo* comments_;
// [start, limit) byte offsets in the source JSON text from which this Value
@@ -565,345 +643,6 @@ private:
Args args_;
};
-#ifdef JSON_VALUE_USE_INTERNAL_MAP
-/** \brief Allocator to customize Value internal map.
- * Below is an example of a simple implementation (default implementation
- actually
- * use memory pool for speed).
- * \code
- class DefaultValueMapAllocator : public ValueMapAllocator
- {
- public: // overridden from ValueMapAllocator
- virtual ValueInternalMap *newMap()
- {
- return new ValueInternalMap();
- }
-
- virtual ValueInternalMap *newMapCopy( const ValueInternalMap &other )
- {
- return new ValueInternalMap( other );
- }
-
- virtual void destructMap( ValueInternalMap *map )
- {
- delete map;
- }
-
- virtual ValueInternalLink *allocateMapBuckets( unsigned int size )
- {
- return new ValueInternalLink[size];
- }
-
- virtual void releaseMapBuckets( ValueInternalLink *links )
- {
- delete [] links;
- }
-
- virtual ValueInternalLink *allocateMapLink()
- {
- return new ValueInternalLink();
- }
-
- virtual void releaseMapLink( ValueInternalLink *link )
- {
- delete link;
- }
- };
- * \endcode
- */
-class JSON_API ValueMapAllocator {
-public:
- virtual ~ValueMapAllocator();
- virtual ValueInternalMap* newMap() = 0;
- virtual ValueInternalMap* newMapCopy(const ValueInternalMap& other) = 0;
- virtual void destructMap(ValueInternalMap* map) = 0;
- virtual ValueInternalLink* allocateMapBuckets(unsigned int size) = 0;
- virtual void releaseMapBuckets(ValueInternalLink* links) = 0;
- virtual ValueInternalLink* allocateMapLink() = 0;
- virtual void releaseMapLink(ValueInternalLink* link) = 0;
-};
-
-/** \brief ValueInternalMap hash-map bucket chain link (for internal use only).
- * \internal previous_ & next_ allows for bidirectional traversal.
- */
-class JSON_API ValueInternalLink {
-public:
- enum {
- itemPerLink = 6
- }; // sizeof(ValueInternalLink) = 128 on 32 bits architecture.
- enum InternalFlags {
- flagAvailable = 0,
- flagUsed = 1
- };
-
- ValueInternalLink();
-
- ~ValueInternalLink();
-
- Value items_[itemPerLink];
- char* keys_[itemPerLink];
- ValueInternalLink* previous_;
- ValueInternalLink* next_;
-};
-
-/** \brief A linked page based hash-table implementation used internally by
- *Value.
- * \internal ValueInternalMap is a tradional bucket based hash-table, with a
- *linked
- * list in each bucket to handle collision. There is an addional twist in that
- * each node of the collision linked list is a page containing a fixed amount of
- * value. This provides a better compromise between memory usage and speed.
- *
- * Each bucket is made up of a chained list of ValueInternalLink. The last
- * link of a given bucket can be found in the 'previous_' field of the following
- *bucket.
- * The last link of the last bucket is stored in tailLink_ as it has no
- *following bucket.
- * Only the last link of a bucket may contains 'available' item. The last link
- *always
- * contains at least one element unless is it the bucket one very first link.
- */
-class JSON_API ValueInternalMap {
- friend class ValueIteratorBase;
- friend class Value;
-
-public:
- typedef unsigned int HashKey;
- typedef unsigned int BucketIndex;
-
-#ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
- struct IteratorState {
- IteratorState() : map_(0), link_(0), itemIndex_(0), bucketIndex_(0) {}
- ValueInternalMap* map_;
- ValueInternalLink* link_;
- BucketIndex itemIndex_;
- BucketIndex bucketIndex_;
- };
-#endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
-
- ValueInternalMap();
- ValueInternalMap(const ValueInternalMap& other);
- ValueInternalMap& operator=(ValueInternalMap other);
- ~ValueInternalMap();
-
- void swap(ValueInternalMap& other);
-
- BucketIndex size() const;
-
- void clear();
-
- bool reserveDelta(BucketIndex growth);
-
- bool reserve(BucketIndex newItemCount);
-
- const Value* find(const char* key) const;
-
- Value* find(const char* key);
-
- Value& resolveReference(const char* key, bool isStatic);
-
- void remove(const char* key);
-
- void doActualRemove(ValueInternalLink* link,
- BucketIndex index,
- BucketIndex bucketIndex);
-
- ValueInternalLink*& getLastLinkInBucket(BucketIndex bucketIndex);
-
- Value& setNewItem(const char* key,
- bool isStatic,
- ValueInternalLink* link,
- BucketIndex index);
-
- Value& unsafeAdd(const char* key, bool isStatic, HashKey hashedKey);
-
- HashKey hash(const char* key) const;
-
- int compare(const ValueInternalMap& other) const;
-
-private:
- void makeBeginIterator(IteratorState& it) const;
- void makeEndIterator(IteratorState& it) const;
- static bool equals(const IteratorState& x, const IteratorState& other);
- static void increment(IteratorState& iterator);
- static void incrementBucket(IteratorState& iterator);
- static void decrement(IteratorState& iterator);
- static const char* key(const IteratorState& iterator);
- static const char* key(const IteratorState& iterator, bool& isStatic);
- static Value& value(const IteratorState& iterator);
- static int distance(const IteratorState& x, const IteratorState& y);
-
-private:
- ValueInternalLink* buckets_;
- ValueInternalLink* tailLink_;
- BucketIndex bucketsSize_;
- BucketIndex itemCount_;
-};
-
-/** \brief A simplified deque implementation used internally by Value.
-* \internal
-* It is based on a list of fixed "page", each page contains a fixed number of
-*items.
-* Instead of using a linked-list, a array of pointer is used for fast item
-*look-up.
-* Look-up for an element is as follow:
-* - compute page index: pageIndex = itemIndex / itemsPerPage
-* - look-up item in page: pages_[pageIndex][itemIndex % itemsPerPage]
-*
-* Insertion is amortized constant time (only the array containing the index of
-*pointers
-* need to be reallocated when items are appended).
-*/
-class JSON_API ValueInternalArray {
- friend class Value;
- friend class ValueIteratorBase;
-
-public:
- enum {
- itemsPerPage = 8
- }; // should be a power of 2 for fast divide and modulo.
- typedef Value::ArrayIndex ArrayIndex;
- typedef unsigned int PageIndex;
-
-#ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
- struct IteratorState // Must be a POD
- {
- IteratorState() : array_(0), currentPageIndex_(0), currentItemIndex_(0) {}
- ValueInternalArray* array_;
- Value** currentPageIndex_;
- unsigned int currentItemIndex_;
- };
-#endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
-
- ValueInternalArray();
- ValueInternalArray(const ValueInternalArray& other);
- ValueInternalArray& operator=(ValueInternalArray other);
- ~ValueInternalArray();
- void swap(ValueInternalArray& other);
-
- void clear();
- void resize(ArrayIndex newSize);
-
- Value& resolveReference(ArrayIndex index);
-
- Value* find(ArrayIndex index) const;
-
- ArrayIndex size() const;
-
- int compare(const ValueInternalArray& other) const;
-
-private:
- static bool equals(const IteratorState& x, const IteratorState& other);
- static void increment(IteratorState& iterator);
- static void decrement(IteratorState& iterator);
- static Value& dereference(const IteratorState& iterator);
- static Value& unsafeDereference(const IteratorState& iterator);
- static int distance(const IteratorState& x, const IteratorState& y);
- static ArrayIndex indexOf(const IteratorState& iterator);
- void makeBeginIterator(IteratorState& it) const;
- void makeEndIterator(IteratorState& it) const;
- void makeIterator(IteratorState& it, ArrayIndex index) const;
-
- void makeIndexValid(ArrayIndex index);
-
- Value** pages_;
- ArrayIndex size_;
- PageIndex pageCount_;
-};
-
-/** \brief Experimental: do not use. Allocator to customize Value internal
-array.
- * Below is an example of a simple implementation (actual implementation use
- * memory pool).
- \code
-class DefaultValueArrayAllocator : public ValueArrayAllocator
-{
-public: // overridden from ValueArrayAllocator
-virtual ~DefaultValueArrayAllocator()
-{
-}
-
-virtual ValueInternalArray *newArray()
-{
- return new ValueInternalArray();
-}
-
-virtual ValueInternalArray *newArrayCopy( const ValueInternalArray &other )
-{
- return new ValueInternalArray( other );
-}
-
-virtual void destruct( ValueInternalArray *array )
-{
- delete array;
-}
-
-virtual void reallocateArrayPageIndex( Value **&indexes,
- ValueInternalArray::PageIndex
-&indexCount,
- ValueInternalArray::PageIndex
-minNewIndexCount )
-{
- ValueInternalArray::PageIndex newIndexCount = (indexCount*3)/2 + 1;
- if ( minNewIndexCount > newIndexCount )
- newIndexCount = minNewIndexCount;
- void *newIndexes = realloc( indexes, sizeof(Value*) * newIndexCount );
- if ( !newIndexes )
- throw std::bad_alloc();
- indexCount = newIndexCount;
- indexes = static_cast<Value **>( newIndexes );
-}
-virtual void releaseArrayPageIndex( Value **indexes,
- ValueInternalArray::PageIndex indexCount )
-{
- if ( indexes )
- free( indexes );
-}
-
-virtual Value *allocateArrayPage()
-{
- return static_cast<Value *>( malloc( sizeof(Value) *
-ValueInternalArray::itemsPerPage ) );
-}
-
-virtual void releaseArrayPage( Value *value )
-{
- if ( value )
- free( value );
-}
-};
- \endcode
- */
-class JSON_API ValueArrayAllocator {
-public:
- virtual ~ValueArrayAllocator();
- virtual ValueInternalArray* newArray() = 0;
- virtual ValueInternalArray* newArrayCopy(const ValueInternalArray& other) = 0;
- virtual void destructArray(ValueInternalArray* array) = 0;
- /** \brief Reallocate array page index.
- * Reallocates an array of pointer on each page.
- * \param indexes [input] pointer on the current index. May be \c NULL.
- * [output] pointer on the new index of at least
- * \a minNewIndexCount pages.
- * \param indexCount [input] current number of pages in the index.
- * [output] number of page the reallocated index can handle.
- * \b MUST be >= \a minNewIndexCount.
- * \param minNewIndexCount Minimum number of page the new index must be able
- * to
- * handle.
- */
- virtual void
- reallocateArrayPageIndex(Value**& indexes,
- ValueInternalArray::PageIndex& indexCount,
- ValueInternalArray::PageIndex minNewIndexCount) = 0;
- virtual void
- releaseArrayPageIndex(Value** indexes,
- ValueInternalArray::PageIndex indexCount) = 0;
- virtual Value* allocateArrayPage() = 0;
- virtual void releaseArrayPage(Value* value) = 0;
-};
-#endif // #ifdef JSON_VALUE_USE_INTERNAL_MAP
-
/** \brief base class for Value iterators.
*
*/
@@ -914,32 +653,35 @@ public:
typedef int difference_type;
typedef ValueIteratorBase SelfType;
- ValueIteratorBase();
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- explicit ValueIteratorBase(const Value::ObjectValues::iterator& current);
-#else
- ValueIteratorBase(const ValueInternalArray::IteratorState& state);
- ValueIteratorBase(const ValueInternalMap::IteratorState& state);
-#endif
-
bool operator==(const SelfType& other) const { return isEqual(other); }
bool operator!=(const SelfType& other) const { return !isEqual(other); }
difference_type operator-(const SelfType& other) const {
- return computeDistance(other);
+ return other.computeDistance(*this);
}
/// Return either the index or the member name of the referenced value as a
/// Value.
Value key() const;
- /// Return the index of the referenced Value. -1 if it is not an arrayValue.
+ /// Return the index of the referenced Value, or -1 if it is not an arrayValue.
UInt index() const;
+ /// Return the member name of the referenced Value, or "" if it is not an
+ /// objectValue.
+ /// \note Avoid `c_str()` on result, as embedded zeroes are possible.
+ std::string name() const;
+
/// Return the member name of the referenced Value. "" if it is not an
/// objectValue.
- const char* memberName() const;
+ /// \deprecated This cannot be used for UTF-8 strings, since there can be embedded nulls.
+ JSONCPP_DEPRECATED("Use `key = name();` instead.")
+ char const* memberName() const;
+ /// Return the member name of the referenced Value, or NULL if it is not an
+ /// objectValue.
+ /// \note Better version than memberName(). Allows embedded nulls.
+ char const* memberName(char const** end) const;
protected:
Value& deref() const;
@@ -955,17 +697,15 @@ protected:
void copy(const SelfType& other);
private:
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
Value::ObjectValues::iterator current_;
// Indicates that iterator is for a null value.
bool isNull_;
-#else
- union {
- ValueInternalArray::IteratorState array_;
- ValueInternalMap::IteratorState map_;
- } iterator_;
- bool isArray_;
-#endif
+
+public:
+ // For some reason, BORLAND needs these at the end, rather
+ // than earlier. No idea why.
+ ValueIteratorBase();
+ explicit ValueIteratorBase(const Value::ObjectValues::iterator& current);
};
/** \brief const iterator for object and array value.
@@ -976,8 +716,8 @@ class JSON_API ValueConstIterator : public ValueIteratorBase {
public:
typedef const Value value_type;
- typedef unsigned int size_t;
- typedef int difference_type;
+ //typedef unsigned int size_t;
+ //typedef int difference_type;
typedef const Value& reference;
typedef const Value* pointer;
typedef ValueConstIterator SelfType;
@@ -987,12 +727,7 @@ public:
private:
/*! \internal Use by Value to create an iterator.
*/
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
explicit ValueConstIterator(const Value::ObjectValues::iterator& current);
-#else
- ValueConstIterator(const ValueInternalArray::IteratorState& state);
- ValueConstIterator(const ValueInternalMap::IteratorState& state);
-#endif
public:
SelfType& operator=(const ValueIteratorBase& other);
@@ -1043,12 +778,7 @@ public:
private:
/*! \internal Use by Value to create an iterator.
*/
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
explicit ValueIterator(const Value::ObjectValues::iterator& current);
-#else
- ValueIterator(const ValueInternalArray::IteratorState& state);
- ValueIterator(const ValueInternalMap::IteratorState& state);
-#endif
public:
SelfType& operator=(const SelfType& other);
@@ -1081,6 +811,14 @@ public:
} // namespace Json
+
+namespace std {
+/// Specialize std::swap() for Json::Value.
+template<>
+inline void swap(Json::Value& a, Json::Value& b) { a.swap(b); }
+}
+
+
#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
#pragma warning(pop)
#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
diff --git a/3rdparty/jsoncpp/include/json/version.h b/3rdparty/jsoncpp/include/json/version.h
index 58fca8a9820..a4db8b0ae7f 100644
--- a/3rdparty/jsoncpp/include/json/version.h
+++ b/3rdparty/jsoncpp/include/json/version.h
@@ -4,10 +4,10 @@
#ifndef JSON_VERSION_H_INCLUDED
# define JSON_VERSION_H_INCLUDED
-# define JSONCPP_VERSION_STRING "1.1.0"
+# define JSONCPP_VERSION_STRING "1.6.2"
# define JSONCPP_VERSION_MAJOR 1
-# define JSONCPP_VERSION_MINOR 1
-# define JSONCPP_VERSION_PATCH 0
+# define JSONCPP_VERSION_MINOR 6
+# define JSONCPP_VERSION_PATCH 2
# define JSONCPP_VERSION_QUALIFIER
# define JSONCPP_VERSION_HEXA ((JSONCPP_VERSION_MAJOR << 24) | (JSONCPP_VERSION_MINOR << 16) | (JSONCPP_VERSION_PATCH << 8))
diff --git a/3rdparty/jsoncpp/include/json/writer.h b/3rdparty/jsoncpp/include/json/writer.h
index dc9e46f4bd6..f5f0a389ee8 100644
--- a/3rdparty/jsoncpp/include/json/writer.h
+++ b/3rdparty/jsoncpp/include/json/writer.h
@@ -11,6 +11,7 @@
#endif // if !defined(JSON_IS_AMALGAMATION)
#include <vector>
#include <string>
+#include <ostream>
// Disable warning C4251: <data member>: <type> needs to have dll-interface to
// be used by...
@@ -23,7 +24,115 @@ namespace Json {
class Value;
+/**
+
+Usage:
+\code
+ using namespace Json;
+ void writeToStdout(StreamWriter::Factory const& factory, Value const& value) {
+ std::unique_ptr<StreamWriter> const writer(
+ factory.newStreamWriter());
+ writer->write(value, &std::cout);
+ std::cout << std::endl; // add lf and flush
+ }
+\endcode
+*/
+class JSON_API StreamWriter {
+protected:
+ std::ostream* sout_; // not owned; will not delete
+public:
+ StreamWriter();
+ virtual ~StreamWriter();
+ /** Write Value into document as configured in sub-class.
+ Do not take ownership of sout, but maintain a reference during function.
+ \pre sout != NULL
+ \return zero on success (For now, we always return zero, so check the stream instead.)
+ \throw std::exception possibly, depending on configuration
+ */
+ virtual int write(Value const& root, std::ostream* sout) = 0;
+
+ /** \brief A simple abstract factory.
+ */
+ class JSON_API Factory {
+ public:
+ virtual ~Factory();
+ /** \brief Allocate a CharReader via operator new().
+ * \throw std::exception if something goes wrong (e.g. invalid settings)
+ */
+ virtual StreamWriter* newStreamWriter() const = 0;
+ }; // Factory
+}; // StreamWriter
+
+/** \brief Write into stringstream, then return string, for convenience.
+ * A StreamWriter will be created from the factory, used, and then deleted.
+ */
+std::string JSON_API writeString(StreamWriter::Factory const& factory, Value const& root);
+
+
+/** \brief Build a StreamWriter implementation.
+
+Usage:
+\code
+ using namespace Json;
+ Value value = ...;
+ StreamWriterBuilder builder;
+ builder["commentStyle"] = "None";
+ builder["indentation"] = " "; // or whatever you like
+ std::unique_ptr<Json::StreamWriter> writer(
+ builder.newStreamWriter());
+ writer->write(value, &std::cout);
+ std::cout << std::endl; // add lf and flush
+\endcode
+*/
+class JSON_API StreamWriterBuilder : public StreamWriter::Factory {
+public:
+ // Note: We use a Json::Value so that we can add data-members to this class
+ // without a major version bump.
+ /** Configuration of this builder.
+ Available settings (case-sensitive):
+ - "commentStyle": "None" or "All"
+ - "indentation": "<anything>"
+ - "enableYAMLCompatibility": false or true
+ - slightly change the whitespace around colons
+ - "dropNullPlaceholders": false or true
+ - Drop the "null" string from the writer's output for nullValues.
+ Strictly speaking, this is not valid JSON. But when the output is being
+ fed to a browser's Javascript, it makes for smaller output and the
+ browser can handle the output just fine.
+
+ You can examine 'settings_` yourself
+ to see the defaults. You can also write and read them just like any
+ JSON Value.
+ \sa setDefaults()
+ */
+ Json::Value settings_;
+
+ StreamWriterBuilder();
+ virtual ~StreamWriterBuilder();
+
+ /**
+ * \throw std::exception if something goes wrong (e.g. invalid settings)
+ */
+ virtual StreamWriter* newStreamWriter() const;
+
+ /** \return true if 'settings' are legal and consistent;
+ * otherwise, indicate bad settings via 'invalid'.
+ */
+ bool validate(Json::Value* invalid) const;
+ /** A simple way to update a specific setting.
+ */
+ Value& operator[](std::string key);
+
+ /** Called by ctor, but you can use this to reset settings_.
+ * \pre 'settings' != NULL (but Json::null is fine)
+ * \remark Defaults:
+ * \snippet src/lib_json/json_writer.cpp StreamWriterBuilderDefaults
+ */
+ static void setDefaults(Json::Value* settings);
+};
+
/** \brief Abstract class for writers.
+ * \deprecated Use StreamWriter. (And really, this is an implementation detail.)
*/
class JSON_API Writer {
public:
@@ -39,8 +148,10 @@ public:
*consumption,
* but may be usefull to support feature such as RPC where bandwith is limited.
* \sa Reader, Value
+ * \deprecated Use StreamWriterBuilder.
*/
class JSON_API FastWriter : public Writer {
+
public:
FastWriter();
virtual ~FastWriter() {}
@@ -90,6 +201,7 @@ private:
*#CommentPlacement.
*
* \sa Reader, Value, Value::setComment()
+ * \deprecated Use StreamWriterBuilder.
*/
class JSON_API StyledWriter : public Writer {
public:
@@ -151,6 +263,7 @@ private:
*
* \param indentation Each level will be indented by this amount extra.
* \sa Reader, Value, Value::setComment()
+ * \deprecated Use StreamWriterBuilder.
*/
class JSON_API StyledStreamWriter {
public:
@@ -187,7 +300,8 @@ private:
std::string indentString_;
int rightMargin_;
std::string indentation_;
- bool addChildValues_;
+ bool addChildValues_ : 1;
+ bool indented_ : 1;
};
#if defined(JSON_HAS_INT64)
diff --git a/3rdparty/jsoncpp/makefiles/vs71/lib_json.vcproj b/3rdparty/jsoncpp/makefiles/vs71/lib_json.vcproj
index 1aa5978a1fe..24c5dd411f6 100644
--- a/3rdparty/jsoncpp/makefiles/vs71/lib_json.vcproj
+++ b/3rdparty/jsoncpp/makefiles/vs71/lib_json.vcproj
@@ -179,15 +179,6 @@
RelativePath="..\..\include\json\json.h">
</File>
<File
- RelativePath="..\..\src\lib_json\json_batchallocator.h">
- </File>
- <File
- RelativePath="..\..\src\lib_json\json_internalarray.inl">
- </File>
- <File
- RelativePath="..\..\src\lib_json\json_internalmap.inl">
- </File>
- <File
RelativePath="..\..\src\lib_json\json_reader.cpp">
</File>
<File
diff --git a/3rdparty/jsoncpp/makerelease.py b/3rdparty/jsoncpp/makerelease.py
index 90276d120bb..ea3722de449 100644
--- a/3rdparty/jsoncpp/makerelease.py
+++ b/3rdparty/jsoncpp/makerelease.py
@@ -1,3 +1,8 @@
+# Copyright 2010 Baptiste Lepilleur
+# Distributed under MIT license, or public domain if desired and
+# recognized in your jurisdiction.
+# See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
+
"""Tag the sandbox for release, make source and doc tarballs.
Requires Python 2.6
@@ -14,6 +19,7 @@ python makerelease.py 0.5.0 0.6.0-dev
Note: This was for Subversion. Now that we are in GitHub, we do not
need to build versioned tarballs anymore, so makerelease.py is defunct.
"""
+
from __future__ import print_function
import os.path
import subprocess
@@ -34,57 +40,57 @@ SVN_TAG_ROOT = SVN_ROOT + 'tags/jsoncpp'
SCONS_LOCAL_URL = 'http://sourceforge.net/projects/scons/files/scons-local/1.2.0/scons-local-1.2.0.tar.gz/download'
SOURCEFORGE_PROJECT = 'jsoncpp'
-def set_version( version ):
+def set_version(version):
with open('version','wb') as f:
- f.write( version.strip() )
+ f.write(version.strip())
-def rmdir_if_exist( dir_path ):
- if os.path.isdir( dir_path ):
- shutil.rmtree( dir_path )
+def rmdir_if_exist(dir_path):
+ if os.path.isdir(dir_path):
+ shutil.rmtree(dir_path)
class SVNError(Exception):
pass
-def svn_command( command, *args ):
+def svn_command(command, *args):
cmd = ['svn', '--non-interactive', command] + list(args)
- print('Running:', ' '.join( cmd ))
- process = subprocess.Popen( cmd,
+ print('Running:', ' '.join(cmd))
+ process = subprocess.Popen(cmd,
stdout=subprocess.PIPE,
- stderr=subprocess.STDOUT )
+ stderr=subprocess.STDOUT)
stdout = process.communicate()[0]
if process.returncode:
- error = SVNError( 'SVN command failed:\n' + stdout )
+ error = SVNError('SVN command failed:\n' + stdout)
error.returncode = process.returncode
raise error
return stdout
def check_no_pending_commit():
"""Checks that there is no pending commit in the sandbox."""
- stdout = svn_command( 'status', '--xml' )
- etree = ElementTree.fromstring( stdout )
+ stdout = svn_command('status', '--xml')
+ etree = ElementTree.fromstring(stdout)
msg = []
- for entry in etree.getiterator( 'entry' ):
+ for entry in etree.getiterator('entry'):
path = entry.get('path')
status = entry.find('wc-status').get('item')
if status != 'unversioned' and path != 'version':
- msg.append( 'File "%s" has pending change (status="%s")' % (path, status) )
+ msg.append('File "%s" has pending change (status="%s")' % (path, status))
if msg:
- msg.insert(0, 'Pending change to commit found in sandbox. Commit them first!' )
- return '\n'.join( msg )
+ msg.insert(0, 'Pending change to commit found in sandbox. Commit them first!')
+ return '\n'.join(msg)
-def svn_join_url( base_url, suffix ):
+def svn_join_url(base_url, suffix):
if not base_url.endswith('/'):
base_url += '/'
if suffix.startswith('/'):
suffix = suffix[1:]
return base_url + suffix
-def svn_check_if_tag_exist( tag_url ):
+def svn_check_if_tag_exist(tag_url):
"""Checks if a tag exist.
Returns: True if the tag exist, False otherwise.
"""
try:
- list_stdout = svn_command( 'list', tag_url )
+ list_stdout = svn_command('list', tag_url)
except SVNError as e:
if e.returncode != 1 or not str(e).find('tag_url'):
raise e
@@ -92,82 +98,82 @@ def svn_check_if_tag_exist( tag_url ):
return False
return True
-def svn_commit( message ):
+def svn_commit(message):
"""Commit the sandbox, providing the specified comment.
"""
- svn_command( 'ci', '-m', message )
+ svn_command('ci', '-m', message)
-def svn_tag_sandbox( tag_url, message ):
+def svn_tag_sandbox(tag_url, message):
"""Makes a tag based on the sandbox revisions.
"""
- svn_command( 'copy', '-m', message, '.', tag_url )
+ svn_command('copy', '-m', message, '.', tag_url)
-def svn_remove_tag( tag_url, message ):
+def svn_remove_tag(tag_url, message):
"""Removes an existing tag.
"""
- svn_command( 'delete', '-m', message, tag_url )
+ svn_command('delete', '-m', message, tag_url)
-def svn_export( tag_url, export_dir ):
+def svn_export(tag_url, export_dir):
"""Exports the tag_url revision to export_dir.
Target directory, including its parent is created if it does not exist.
If the directory export_dir exist, it is deleted before export proceed.
"""
- rmdir_if_exist( export_dir )
- svn_command( 'export', tag_url, export_dir )
+ rmdir_if_exist(export_dir)
+ svn_command('export', tag_url, export_dir)
-def fix_sources_eol( dist_dir ):
+def fix_sources_eol(dist_dir):
"""Set file EOL for tarball distribution.
"""
print('Preparing exported source file EOL for distribution...')
prune_dirs = antglob.prune_dirs + 'scons-local* ./build* ./libs ./dist'
- win_sources = antglob.glob( dist_dir,
+ win_sources = antglob.glob(dist_dir,
includes = '**/*.sln **/*.vcproj',
- prune_dirs = prune_dirs )
- unix_sources = antglob.glob( dist_dir,
+ prune_dirs = prune_dirs)
+ unix_sources = antglob.glob(dist_dir,
includes = '''**/*.h **/*.cpp **/*.inl **/*.txt **/*.dox **/*.py **/*.html **/*.in
sconscript *.json *.expected AUTHORS LICENSE''',
excludes = antglob.default_excludes + 'scons.py sconsign.py scons-*',
- prune_dirs = prune_dirs )
+ prune_dirs = prune_dirs)
for path in win_sources:
- fixeol.fix_source_eol( path, is_dry_run = False, verbose = True, eol = '\r\n' )
+ fixeol.fix_source_eol(path, is_dry_run = False, verbose = True, eol = '\r\n')
for path in unix_sources:
- fixeol.fix_source_eol( path, is_dry_run = False, verbose = True, eol = '\n' )
+ fixeol.fix_source_eol(path, is_dry_run = False, verbose = True, eol = '\n')
-def download( url, target_path ):
+def download(url, target_path):
"""Download file represented by url to target_path.
"""
- f = urllib2.urlopen( url )
+ f = urllib2.urlopen(url)
try:
data = f.read()
finally:
f.close()
- fout = open( target_path, 'wb' )
+ fout = open(target_path, 'wb')
try:
- fout.write( data )
+ fout.write(data)
finally:
fout.close()
-def check_compile( distcheck_top_dir, platform ):
+def check_compile(distcheck_top_dir, platform):
cmd = [sys.executable, 'scons.py', 'platform=%s' % platform, 'check']
- print('Running:', ' '.join( cmd ))
- log_path = os.path.join( distcheck_top_dir, 'build-%s.log' % platform )
- flog = open( log_path, 'wb' )
+ print('Running:', ' '.join(cmd))
+ log_path = os.path.join(distcheck_top_dir, 'build-%s.log' % platform)
+ flog = open(log_path, 'wb')
try:
- process = subprocess.Popen( cmd,
+ process = subprocess.Popen(cmd,
stdout=flog,
stderr=subprocess.STDOUT,
- cwd=distcheck_top_dir )
+ cwd=distcheck_top_dir)
stdout = process.communicate()[0]
status = (process.returncode == 0)
finally:
flog.close()
return (status, log_path)
-def write_tempfile( content, **kwargs ):
- fd, path = tempfile.mkstemp( **kwargs )
- f = os.fdopen( fd, 'wt' )
+def write_tempfile(content, **kwargs):
+ fd, path = tempfile.mkstemp(**kwargs)
+ f = os.fdopen(fd, 'wt')
try:
- f.write( content )
+ f.write(content)
finally:
f.close()
return path
@@ -175,34 +181,34 @@ def write_tempfile( content, **kwargs ):
class SFTPError(Exception):
pass
-def run_sftp_batch( userhost, sftp, batch, retry=0 ):
- path = write_tempfile( batch, suffix='.sftp', text=True )
+def run_sftp_batch(userhost, sftp, batch, retry=0):
+ path = write_tempfile(batch, suffix='.sftp', text=True)
# psftp -agent -C blep,jsoncpp@web.sourceforge.net -batch -b batch.sftp -bc
cmd = [sftp, '-agent', '-C', '-batch', '-b', path, '-bc', userhost]
error = None
for retry_index in range(0, max(1,retry)):
heading = retry_index == 0 and 'Running:' or 'Retrying:'
- print(heading, ' '.join( cmd ))
- process = subprocess.Popen( cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT )
+ print(heading, ' '.join(cmd))
+ process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
stdout = process.communicate()[0]
if process.returncode != 0:
- error = SFTPError( 'SFTP batch failed:\n' + stdout )
+ error = SFTPError('SFTP batch failed:\n' + stdout)
else:
break
if error:
raise error
return stdout
-def sourceforge_web_synchro( sourceforge_project, doc_dir,
- user=None, sftp='sftp' ):
+def sourceforge_web_synchro(sourceforge_project, doc_dir,
+ user=None, sftp='sftp'):
"""Notes: does not synchronize sub-directory of doc-dir.
"""
userhost = '%s,%s@web.sourceforge.net' % (user, sourceforge_project)
- stdout = run_sftp_batch( userhost, sftp, """
+ stdout = run_sftp_batch(userhost, sftp, """
cd htdocs
dir
exit
-""" )
+""")
existing_paths = set()
collect = 0
for line in stdout.split('\n'):
@@ -216,15 +222,15 @@ exit
elif collect == 2:
path = line.strip().split()[-1:]
if path and path[0] not in ('.', '..'):
- existing_paths.add( path[0] )
- upload_paths = set( [os.path.basename(p) for p in antglob.glob( doc_dir )] )
+ existing_paths.add(path[0])
+ upload_paths = set([os.path.basename(p) for p in antglob.glob(doc_dir)])
paths_to_remove = existing_paths - upload_paths
if paths_to_remove:
print('Removing the following file from web:')
- print('\n'.join( paths_to_remove ))
- stdout = run_sftp_batch( userhost, sftp, """cd htdocs
+ print('\n'.join(paths_to_remove))
+ stdout = run_sftp_batch(userhost, sftp, """cd htdocs
rm %s
-exit""" % ' '.join(paths_to_remove) )
+exit""" % ' '.join(paths_to_remove))
print('Uploading %d files:' % len(upload_paths))
batch_size = 10
upload_paths = list(upload_paths)
@@ -235,17 +241,17 @@ exit""" % ' '.join(paths_to_remove) )
remaining_files = len(upload_paths) - index
remaining_sec = file_per_sec * remaining_files
print('%d/%d, ETA=%.1fs' % (index+1, len(upload_paths), remaining_sec))
- run_sftp_batch( userhost, sftp, """cd htdocs
+ run_sftp_batch(userhost, sftp, """cd htdocs
lcd %s
mput %s
-exit""" % (doc_dir, ' '.join(paths) ), retry=3 )
+exit""" % (doc_dir, ' '.join(paths)), retry=3)
-def sourceforge_release_tarball( sourceforge_project, paths, user=None, sftp='sftp' ):
+def sourceforge_release_tarball(sourceforge_project, paths, user=None, sftp='sftp'):
userhost = '%s,%s@frs.sourceforge.net' % (user, sourceforge_project)
- run_sftp_batch( userhost, sftp, """
+ run_sftp_batch(userhost, sftp, """
mput %s
exit
-""" % (' '.join(paths),) )
+""" % (' '.join(paths),))
def main():
@@ -286,12 +292,12 @@ Warning: --force should only be used when developping/testing the release script
options, args = parser.parse_args()
if len(args) != 2:
- parser.error( 'release_version missing on command-line.' )
+ parser.error('release_version missing on command-line.')
release_version = args[0]
next_version = args[1]
if not options.platforms and not options.no_test:
- parser.error( 'You must specify either --platform or --no-test option.' )
+ parser.error('You must specify either --platform or --no-test option.')
if options.ignore_pending_commit:
msg = ''
@@ -299,86 +305,86 @@ Warning: --force should only be used when developping/testing the release script
msg = check_no_pending_commit()
if not msg:
print('Setting version to', release_version)
- set_version( release_version )
- svn_commit( 'Release ' + release_version )
- tag_url = svn_join_url( SVN_TAG_ROOT, release_version )
- if svn_check_if_tag_exist( tag_url ):
+ set_version(release_version)
+ svn_commit('Release ' + release_version)
+ tag_url = svn_join_url(SVN_TAG_ROOT, release_version)
+ if svn_check_if_tag_exist(tag_url):
if options.retag_release:
- svn_remove_tag( tag_url, 'Overwriting previous tag' )
+ svn_remove_tag(tag_url, 'Overwriting previous tag')
else:
print('Aborting, tag %s already exist. Use --retag to overwrite it!' % tag_url)
- sys.exit( 1 )
- svn_tag_sandbox( tag_url, 'Release ' + release_version )
+ sys.exit(1)
+ svn_tag_sandbox(tag_url, 'Release ' + release_version)
print('Generated doxygen document...')
## doc_dirname = r'jsoncpp-api-html-0.5.0'
## doc_tarball_path = r'e:\prg\vc\Lib\jsoncpp-trunk\dist\jsoncpp-api-html-0.5.0.tar.gz'
- doc_tarball_path, doc_dirname = doxybuild.build_doc( options, make_release=True )
+ doc_tarball_path, doc_dirname = doxybuild.build_doc(options, make_release=True)
doc_distcheck_dir = 'dist/doccheck'
- tarball.decompress( doc_tarball_path, doc_distcheck_dir )
- doc_distcheck_top_dir = os.path.join( doc_distcheck_dir, doc_dirname )
+ tarball.decompress(doc_tarball_path, doc_distcheck_dir)
+ doc_distcheck_top_dir = os.path.join(doc_distcheck_dir, doc_dirname)
export_dir = 'dist/export'
- svn_export( tag_url, export_dir )
- fix_sources_eol( export_dir )
+ svn_export(tag_url, export_dir)
+ fix_sources_eol(export_dir)
source_dir = 'jsoncpp-src-' + release_version
source_tarball_path = 'dist/%s.tar.gz' % source_dir
print('Generating source tarball to', source_tarball_path)
- tarball.make_tarball( source_tarball_path, [export_dir], export_dir, prefix_dir=source_dir )
+ tarball.make_tarball(source_tarball_path, [export_dir], export_dir, prefix_dir=source_dir)
amalgamation_tarball_path = 'dist/%s-amalgamation.tar.gz' % source_dir
print('Generating amalgamation source tarball to', amalgamation_tarball_path)
amalgamation_dir = 'dist/amalgamation'
- amalgamate.amalgamate_source( export_dir, '%s/jsoncpp.cpp' % amalgamation_dir, 'json/json.h' )
+ amalgamate.amalgamate_source(export_dir, '%s/jsoncpp.cpp' % amalgamation_dir, 'json/json.h')
amalgamation_source_dir = 'jsoncpp-src-amalgamation' + release_version
- tarball.make_tarball( amalgamation_tarball_path, [amalgamation_dir],
- amalgamation_dir, prefix_dir=amalgamation_source_dir )
+ tarball.make_tarball(amalgamation_tarball_path, [amalgamation_dir],
+ amalgamation_dir, prefix_dir=amalgamation_source_dir)
# Decompress source tarball, download and install scons-local
distcheck_dir = 'dist/distcheck'
distcheck_top_dir = distcheck_dir + '/' + source_dir
print('Decompressing source tarball to', distcheck_dir)
- rmdir_if_exist( distcheck_dir )
- tarball.decompress( source_tarball_path, distcheck_dir )
+ rmdir_if_exist(distcheck_dir)
+ tarball.decompress(source_tarball_path, distcheck_dir)
scons_local_path = 'dist/scons-local.tar.gz'
print('Downloading scons-local to', scons_local_path)
- download( SCONS_LOCAL_URL, scons_local_path )
+ download(SCONS_LOCAL_URL, scons_local_path)
print('Decompressing scons-local to', distcheck_top_dir)
- tarball.decompress( scons_local_path, distcheck_top_dir )
+ tarball.decompress(scons_local_path, distcheck_top_dir)
# Run compilation
print('Compiling decompressed tarball')
all_build_status = True
for platform in options.platforms.split(','):
print('Testing platform:', platform)
- build_status, log_path = check_compile( distcheck_top_dir, platform )
+ build_status, log_path = check_compile(distcheck_top_dir, platform)
print('see build log:', log_path)
print(build_status and '=> ok' or '=> FAILED')
all_build_status = all_build_status and build_status
if not build_status:
print('Testing failed on at least one platform, aborting...')
- svn_remove_tag( tag_url, 'Removing tag due to failed testing' )
+ svn_remove_tag(tag_url, 'Removing tag due to failed testing')
sys.exit(1)
if options.user:
if not options.no_web:
print('Uploading documentation using user', options.user)
- sourceforge_web_synchro( SOURCEFORGE_PROJECT, doc_distcheck_top_dir, user=options.user, sftp=options.sftp )
+ sourceforge_web_synchro(SOURCEFORGE_PROJECT, doc_distcheck_top_dir, user=options.user, sftp=options.sftp)
print('Completed documentation upload')
print('Uploading source and documentation tarballs for release using user', options.user)
- sourceforge_release_tarball( SOURCEFORGE_PROJECT,
+ sourceforge_release_tarball(SOURCEFORGE_PROJECT,
[source_tarball_path, doc_tarball_path],
- user=options.user, sftp=options.sftp )
+ user=options.user, sftp=options.sftp)
print('Source and doc release tarballs uploaded')
else:
print('No upload user specified. Web site and download tarbal were not uploaded.')
print('Tarball can be found at:', doc_tarball_path)
# Set next version number and commit
- set_version( next_version )
- svn_commit( 'Released ' + release_version )
+ set_version(next_version)
+ svn_commit('Released ' + release_version)
else:
- sys.stderr.write( msg + '\n' )
+ sys.stderr.write(msg + '\n')
if __name__ == '__main__':
main()
diff --git a/3rdparty/jsoncpp/pkg-config/jsoncpp.pc.in b/3rdparty/jsoncpp/pkg-config/jsoncpp.pc.in
index 9613181b2d1..3ca4a84d027 100644
--- a/3rdparty/jsoncpp/pkg-config/jsoncpp.pc.in
+++ b/3rdparty/jsoncpp/pkg-config/jsoncpp.pc.in
@@ -1,7 +1,7 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
-libdir=${exec_prefix}/@LIBRARY_INSTALL_DIR@
-includedir=${prefix}/@INCLUDE_INSTALL_DIR@
+libdir=@LIBRARY_INSTALL_DIR@
+includedir=@INCLUDE_INSTALL_DIR@
Name: jsoncpp
Description: A C++ library for interacting with JSON
diff --git a/3rdparty/jsoncpp/scons-tools/globtool.py b/3rdparty/jsoncpp/scons-tools/globtool.py
index 811140e8aab..890f1b7b1f4 100644
--- a/3rdparty/jsoncpp/scons-tools/globtool.py
+++ b/3rdparty/jsoncpp/scons-tools/globtool.py
@@ -1,9 +1,14 @@
+# Copyright 2009 Baptiste Lepilleur
+# Distributed under MIT license, or public domain if desired and
+# recognized in your jurisdiction.
+# See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
+
import fnmatch
import os
-def generate( env ):
- def Glob( env, includes = None, excludes = None, dir = '.' ):
- """Adds Glob( includes = Split( '*' ), excludes = None, dir = '.')
+def generate(env):
+ def Glob(env, includes = None, excludes = None, dir = '.'):
+ """Adds Glob(includes = Split('*'), excludes = None, dir = '.')
helper function to environment.
Glob both the file-system files.
@@ -12,36 +17,36 @@ def generate( env ):
excludes: list of file name pattern exluced from the return list.
Example:
- sources = env.Glob( ("*.cpp", '*.h'), "~*.cpp", "#src" )
+ sources = env.Glob(("*.cpp", '*.h'), "~*.cpp", "#src")
"""
def filterFilename(path):
- abs_path = os.path.join( dir, path )
+ abs_path = os.path.join(dir, path)
if not os.path.isfile(abs_path):
return 0
fn = os.path.basename(path)
match = 0
for include in includes:
- if fnmatch.fnmatchcase( fn, include ):
+ if fnmatch.fnmatchcase(fn, include):
match = 1
break
if match == 1 and not excludes is None:
for exclude in excludes:
- if fnmatch.fnmatchcase( fn, exclude ):
+ if fnmatch.fnmatchcase(fn, exclude):
match = 0
break
return match
if includes is None:
includes = ('*',)
- elif type(includes) in ( type(''), type(u'') ):
+ elif type(includes) in (type(''), type(u'')):
includes = (includes,)
- if type(excludes) in ( type(''), type(u'') ):
+ if type(excludes) in (type(''), type(u'')):
excludes = (excludes,)
dir = env.Dir(dir).abspath
- paths = os.listdir( dir )
- def makeAbsFileNode( path ):
- return env.File( os.path.join( dir, path ) )
- nodes = filter( filterFilename, paths )
- return map( makeAbsFileNode, nodes )
+ paths = os.listdir(dir)
+ def makeAbsFileNode(path):
+ return env.File(os.path.join(dir, path))
+ nodes = filter(filterFilename, paths)
+ return map(makeAbsFileNode, nodes)
from SCons.Script import Environment
Environment.Glob = Glob
diff --git a/3rdparty/jsoncpp/scons-tools/srcdist.py b/3rdparty/jsoncpp/scons-tools/srcdist.py
index 864ff408158..fe1d74695a2 100644
--- a/3rdparty/jsoncpp/scons-tools/srcdist.py
+++ b/3rdparty/jsoncpp/scons-tools/srcdist.py
@@ -1,3 +1,8 @@
+# Copyright 2007 Baptiste Lepilleur
+# Distributed under MIT license, or public domain if desired and
+# recognized in your jurisdiction.
+# See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
+
import os
import os.path
from fnmatch import fnmatch
@@ -47,7 +52,7 @@ import targz
## elif token == "=":
## data[key] = list()
## else:
-## append_data( data, key, new_data, token )
+## append_data(data, key, new_data, token)
## new_data = True
##
## last_token = token
@@ -55,7 +60,7 @@ import targz
##
## if last_token == '\\' and token != '\n':
## new_data = False
-## append_data( data, key, new_data, '\\' )
+## append_data(data, key, new_data, '\\')
##
## # compress lists of len 1 into single strings
## for (k, v) in data.items():
@@ -116,7 +121,7 @@ import targz
## else:
## for pattern in file_patterns:
## sources.extend(glob.glob("/".join([node, pattern])))
-## sources = map( lambda path: env.File(path), sources )
+## sources = map(lambda path: env.File(path), sources)
## return sources
##
##
@@ -143,7 +148,7 @@ def srcDistEmitter(source, target, env):
## # add our output locations
## for (k, v) in output_formats.items():
## if data.get("GENERATE_" + k, v[0]) == "YES":
-## targets.append(env.Dir( os.path.join(out_dir, data.get(k + "_OUTPUT", v[1]))) )
+## targets.append(env.Dir(os.path.join(out_dir, data.get(k + "_OUTPUT", v[1]))))
##
## # don't clobber targets
## for node in targets:
@@ -161,14 +166,13 @@ def generate(env):
Add builders and construction variables for the
SrcDist tool.
"""
-## doxyfile_scanner = env.Scanner(
-## DoxySourceScan,
+## doxyfile_scanner = env.Scanner(## DoxySourceScan,
## "DoxySourceScan",
## scan_check = DoxySourceScanCheck,
-## )
+##)
if targz.exists(env):
- srcdist_builder = targz.makeBuilder( srcDistEmitter )
+ srcdist_builder = targz.makeBuilder(srcDistEmitter)
env['BUILDERS']['SrcDist'] = srcdist_builder
diff --git a/3rdparty/jsoncpp/scons-tools/substinfile.py b/3rdparty/jsoncpp/scons-tools/substinfile.py
index ef18b4edbcb..c620442d572 100644
--- a/3rdparty/jsoncpp/scons-tools/substinfile.py
+++ b/3rdparty/jsoncpp/scons-tools/substinfile.py
@@ -1,3 +1,8 @@
+# Copyright 2010 Baptiste Lepilleur
+# Distributed under MIT license, or public domain if desired and
+# recognized in your jurisdiction.
+# See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
+
import re
from SCons.Script import * # the usual scons stuff you get in a SConscript
import collections
@@ -70,7 +75,7 @@ def generate(env):
return target, source
## env.Append(TOOLS = 'substinfile') # this should be automaticaly done by Scons ?!?
- subst_action = SCons.Action.Action( subst_in_file, subst_in_file_string )
+ subst_action = SCons.Action.Action(subst_in_file, subst_in_file_string)
env['BUILDERS']['SubstInFile'] = Builder(action=subst_action, emitter=subst_emitter)
def exists(env):
diff --git a/3rdparty/jsoncpp/scons-tools/targz.py b/3rdparty/jsoncpp/scons-tools/targz.py
index f5432003df7..8e5ba83003b 100644
--- a/3rdparty/jsoncpp/scons-tools/targz.py
+++ b/3rdparty/jsoncpp/scons-tools/targz.py
@@ -1,3 +1,8 @@
+# Copyright 2007 Baptiste Lepilleur
+# Distributed under MIT license, or public domain if desired and
+# recognized in your jurisdiction.
+# See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
+
"""tarball
Tool-specific initialization for tarball.
@@ -27,9 +32,9 @@ TARGZ_DEFAULT_COMPRESSION_LEVEL = 9
if internal_targz:
def targz(target, source, env):
- def archive_name( path ):
- path = os.path.normpath( os.path.abspath( path ) )
- common_path = os.path.commonprefix( (base_dir, path) )
+ def archive_name(path):
+ path = os.path.normpath(os.path.abspath(path))
+ common_path = os.path.commonprefix((base_dir, path))
archive_name = path[len(common_path):]
return archive_name
@@ -37,23 +42,23 @@ if internal_targz:
for name in names:
path = os.path.join(dirname, name)
if os.path.isfile(path):
- tar.add(path, archive_name(path) )
+ tar.add(path, archive_name(path))
compression = env.get('TARGZ_COMPRESSION_LEVEL',TARGZ_DEFAULT_COMPRESSION_LEVEL)
- base_dir = os.path.normpath( env.get('TARGZ_BASEDIR', env.Dir('.')).abspath )
+ base_dir = os.path.normpath(env.get('TARGZ_BASEDIR', env.Dir('.')).abspath)
target_path = str(target[0])
- fileobj = gzip.GzipFile( target_path, 'wb', compression )
+ fileobj = gzip.GzipFile(target_path, 'wb', compression)
tar = tarfile.TarFile(os.path.splitext(target_path)[0], 'w', fileobj)
for source in source:
source_path = str(source)
if source.isdir():
os.path.walk(source_path, visit, tar)
else:
- tar.add(source_path, archive_name(source_path) ) # filename, arcname
+ tar.add(source_path, archive_name(source_path)) # filename, arcname
tar.close()
targzAction = SCons.Action.Action(targz, varlist=['TARGZ_COMPRESSION_LEVEL','TARGZ_BASEDIR'])
- def makeBuilder( emitter = None ):
+ def makeBuilder(emitter = None):
return SCons.Builder.Builder(action = SCons.Action.Action('$TARGZ_COM', '$TARGZ_COMSTR'),
source_factory = SCons.Node.FS.Entry,
source_scanner = SCons.Defaults.DirScanner,
diff --git a/3rdparty/jsoncpp/src/jsontestrunner/CMakeLists.txt b/3rdparty/jsoncpp/src/jsontestrunner/CMakeLists.txt
index dd8e2175f0f..820a7cd3524 100644
--- a/3rdparty/jsoncpp/src/jsontestrunner/CMakeLists.txt
+++ b/3rdparty/jsoncpp/src/jsontestrunner/CMakeLists.txt
@@ -1,20 +1,23 @@
-FIND_PACKAGE(PythonInterp 2.6 REQUIRED)
-
-IF(JSONCPP_LIB_BUILD_SHARED)
- ADD_DEFINITIONS( -DJSON_DLL )
-ENDIF(JSONCPP_LIB_BUILD_SHARED)
+FIND_PACKAGE(PythonInterp 2.6)
ADD_EXECUTABLE(jsontestrunner_exe
main.cpp
)
-TARGET_LINK_LIBRARIES(jsontestrunner_exe jsoncpp_lib)
+
+IF(BUILD_SHARED_LIBS)
+ ADD_DEFINITIONS( -DJSON_DLL )
+ TARGET_LINK_LIBRARIES(jsontestrunner_exe jsoncpp_lib)
+ELSE(BUILD_SHARED_LIBS)
+ TARGET_LINK_LIBRARIES(jsontestrunner_exe jsoncpp_lib_static)
+ENDIF(BUILD_SHARED_LIBS)
+
SET_TARGET_PROPERTIES(jsontestrunner_exe PROPERTIES OUTPUT_NAME jsontestrunner_exe)
IF(PYTHONINTERP_FOUND)
# Run end to end parser/writer tests
SET(TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../test)
SET(RUNJSONTESTS_PATH ${TEST_DIR}/runjsontests.py)
- ADD_CUSTOM_TARGET(jsoncpp_readerwriter_tests ALL
+ ADD_CUSTOM_TARGET(jsoncpp_readerwriter_tests
"${PYTHON_EXECUTABLE}" -B "${RUNJSONTESTS_PATH}" $<TARGET_FILE:jsontestrunner_exe> "${TEST_DIR}/data"
DEPENDS jsontestrunner_exe jsoncpp_test
)
diff --git a/3rdparty/jsoncpp/src/jsontestrunner/main.cpp b/3rdparty/jsoncpp/src/jsontestrunner/main.cpp
index ba985877db4..1ec1fb6fbcd 100644
--- a/3rdparty/jsoncpp/src/jsontestrunner/main.cpp
+++ b/3rdparty/jsoncpp/src/jsontestrunner/main.cpp
@@ -8,12 +8,22 @@
#include <json/json.h>
#include <algorithm> // sort
+#include <sstream>
#include <stdio.h>
#if defined(_MSC_VER) && _MSC_VER >= 1310
#pragma warning(disable : 4996) // disable fopen deprecation warning
#endif
+struct Options
+{
+ std::string path;
+ Json::Features features;
+ bool parseOnly;
+ typedef std::string (*writeFuncType)(Json::Value const&);
+ writeFuncType write;
+};
+
static std::string normalizeFloatingPointStr(double value) {
char buffer[32];
#if defined(_MSC_VER) && defined(__STDC_SECURE_LIB__)
@@ -129,43 +139,67 @@ printValueTree(FILE* fout, Json::Value& value, const std::string& path = ".") {
static int parseAndSaveValueTree(const std::string& input,
const std::string& actual,
const std::string& kind,
- Json::Value& root,
const Json::Features& features,
- bool parseOnly) {
+ bool parseOnly,
+ Json::Value* root)
+{
Json::Reader reader(features);
- bool parsingSuccessful = reader.parse(input, root);
+ bool parsingSuccessful = reader.parse(input, *root);
if (!parsingSuccessful) {
printf("Failed to parse %s file: \n%s\n",
kind.c_str(),
reader.getFormattedErrorMessages().c_str());
return 1;
}
-
if (!parseOnly) {
FILE* factual = fopen(actual.c_str(), "wt");
if (!factual) {
printf("Failed to create %s actual file.\n", kind.c_str());
return 2;
}
- printValueTree(factual, root);
+ printValueTree(factual, *root);
fclose(factual);
}
return 0;
}
-
-static int rewriteValueTree(const std::string& rewritePath,
- const Json::Value& root,
- std::string& rewrite) {
- // Json::FastWriter writer;
- // writer.enableYAMLCompatibility();
+// static std::string useFastWriter(Json::Value const& root) {
+// Json::FastWriter writer;
+// writer.enableYAMLCompatibility();
+// return writer.write(root);
+// }
+static std::string useStyledWriter(
+ Json::Value const& root)
+{
Json::StyledWriter writer;
- rewrite = writer.write(root);
+ return writer.write(root);
+}
+static std::string useStyledStreamWriter(
+ Json::Value const& root)
+{
+ Json::StyledStreamWriter writer;
+ std::ostringstream sout;
+ writer.write(sout, root);
+ return sout.str();
+}
+static std::string useBuiltStyledStreamWriter(
+ Json::Value const& root)
+{
+ Json::StreamWriterBuilder builder;
+ return Json::writeString(builder, root);
+}
+static int rewriteValueTree(
+ const std::string& rewritePath,
+ const Json::Value& root,
+ Options::writeFuncType write,
+ std::string* rewrite)
+{
+ *rewrite = write(root);
FILE* fout = fopen(rewritePath.c_str(), "wt");
if (!fout) {
printf("Failed to create rewrite file: %s\n", rewritePath.c_str());
return 2;
}
- fprintf(fout, "%s\n", rewrite.c_str());
+ fprintf(fout, "%s\n", rewrite->c_str());
fclose(fout);
return 0;
}
@@ -194,84 +228,98 @@ static int printUsage(const char* argv[]) {
return 3;
}
-int parseCommandLine(int argc,
- const char* argv[],
- Json::Features& features,
- std::string& path,
- bool& parseOnly) {
- parseOnly = false;
+static int parseCommandLine(
+ int argc, const char* argv[], Options* opts)
+{
+ opts->parseOnly = false;
+ opts->write = &useStyledWriter;
if (argc < 2) {
return printUsage(argv);
}
-
int index = 1;
- if (std::string(argv[1]) == "--json-checker") {
- features = Json::Features::strictMode();
- parseOnly = true;
+ if (std::string(argv[index]) == "--json-checker") {
+ opts->features = Json::Features::strictMode();
+ opts->parseOnly = true;
++index;
}
-
- if (std::string(argv[1]) == "--json-config") {
+ if (std::string(argv[index]) == "--json-config") {
printConfig();
return 3;
}
-
+ if (std::string(argv[index]) == "--json-writer") {
+ ++index;
+ std::string const writerName(argv[index++]);
+ if (writerName == "StyledWriter") {
+ opts->write = &useStyledWriter;
+ } else if (writerName == "StyledStreamWriter") {
+ opts->write = &useStyledStreamWriter;
+ } else if (writerName == "BuiltStyledStreamWriter") {
+ opts->write = &useBuiltStyledStreamWriter;
+ } else {
+ printf("Unknown '--json-writer %s'\n", writerName.c_str());
+ return 4;
+ }
+ }
if (index == argc || index + 1 < argc) {
return printUsage(argv);
}
-
- path = argv[index];
+ opts->path = argv[index];
return 0;
}
+static int runTest(Options const& opts)
+{
+ int exitCode = 0;
+
+ std::string input = readInputTestFile(opts.path.c_str());
+ if (input.empty()) {
+ printf("Failed to read input or empty input: %s\n", opts.path.c_str());
+ return 3;
+ }
+
+ std::string basePath = removeSuffix(opts.path, ".json");
+ if (!opts.parseOnly && basePath.empty()) {
+ printf("Bad input path. Path does not end with '.expected':\n%s\n",
+ opts.path.c_str());
+ return 3;
+ }
+ std::string const actualPath = basePath + ".actual";
+ std::string const rewritePath = basePath + ".rewrite";
+ std::string const rewriteActualPath = basePath + ".actual-rewrite";
+
+ Json::Value root;
+ exitCode = parseAndSaveValueTree(
+ input, actualPath, "input",
+ opts.features, opts.parseOnly, &root);
+ if (exitCode || opts.parseOnly) {
+ return exitCode;
+ }
+ std::string rewrite;
+ exitCode = rewriteValueTree(rewritePath, root, opts.write, &rewrite);
+ if (exitCode) {
+ return exitCode;
+ }
+ Json::Value rewriteRoot;
+ exitCode = parseAndSaveValueTree(
+ rewrite, rewriteActualPath, "rewrite",
+ opts.features, opts.parseOnly, &rewriteRoot);
+ if (exitCode) {
+ return exitCode;
+ }
+ return 0;
+}
int main(int argc, const char* argv[]) {
- std::string path;
- Json::Features features;
- bool parseOnly;
- int exitCode = parseCommandLine(argc, argv, features, path, parseOnly);
+ Options opts;
+ int exitCode = parseCommandLine(argc, argv, &opts);
if (exitCode != 0) {
+ printf("Failed to parse command-line.");
return exitCode;
}
-
try {
- std::string input = readInputTestFile(path.c_str());
- if (input.empty()) {
- printf("Failed to read input or empty input: %s\n", path.c_str());
- return 3;
- }
-
- std::string basePath = removeSuffix(argv[1], ".json");
- if (!parseOnly && basePath.empty()) {
- printf("Bad input path. Path does not end with '.expected':\n%s\n",
- path.c_str());
- return 3;
- }
-
- std::string actualPath = basePath + ".actual";
- std::string rewritePath = basePath + ".rewrite";
- std::string rewriteActualPath = basePath + ".actual-rewrite";
-
- Json::Value root;
- exitCode = parseAndSaveValueTree(
- input, actualPath, "input", root, features, parseOnly);
- if (exitCode == 0 && !parseOnly) {
- std::string rewrite;
- exitCode = rewriteValueTree(rewritePath, root, rewrite);
- if (exitCode == 0) {
- Json::Value rewriteRoot;
- exitCode = parseAndSaveValueTree(rewrite,
- rewriteActualPath,
- "rewrite",
- rewriteRoot,
- features,
- parseOnly);
- }
- }
+ return runTest(opts);
}
catch (const std::exception& e) {
printf("Unhandled exception:\n%s\n", e.what());
- exitCode = 1;
+ return 1;
}
-
- return exitCode;
}
diff --git a/3rdparty/jsoncpp/src/lib_json/CMakeLists.txt b/3rdparty/jsoncpp/src/lib_json/CMakeLists.txt
index d0f6a5ea5ab..79ffa2ec5fe 100644
--- a/3rdparty/jsoncpp/src/lib_json/CMakeLists.txt
+++ b/3rdparty/jsoncpp/src/lib_json/CMakeLists.txt
@@ -1,20 +1,8 @@
-OPTION(JSONCPP_LIB_BUILD_SHARED "Build jsoncpp_lib as a shared library." OFF)
-IF(BUILD_SHARED_LIBS)
- SET(JSONCPP_LIB_BUILD_SHARED ON)
-ENDIF(BUILD_SHARED_LIBS)
-
-IF(JSONCPP_LIB_BUILD_SHARED)
- SET(JSONCPP_LIB_TYPE SHARED)
- ADD_DEFINITIONS( -DJSON_DLL_BUILD )
-ELSE(JSONCPP_LIB_BUILD_SHARED)
- SET(JSONCPP_LIB_TYPE STATIC)
-ENDIF(JSONCPP_LIB_BUILD_SHARED)
-
if( CMAKE_COMPILER_IS_GNUCXX )
#Get compiler version.
execute_process( COMMAND ${CMAKE_CXX_COMPILER} -dumpversion
OUTPUT_VARIABLE GNUCXX_VERSION )
-
+
#-Werror=* was introduced -after- GCC 4.1.2
if( GNUCXX_VERSION VERSION_GREATER 4.1.2 )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=strict-aliasing")
@@ -36,25 +24,13 @@ SET( PUBLIC_HEADERS
SOURCE_GROUP( "Public API" FILES ${PUBLIC_HEADERS} )
-ADD_LIBRARY( jsoncpp_lib ${JSONCPP_LIB_TYPE}
- ${PUBLIC_HEADERS}
- json_tool.h
- json_reader.cpp
- json_batchallocator.h
- json_valueiterator.inl
- json_value.cpp
- json_writer.cpp
- version.h.in
- )
-SET_TARGET_PROPERTIES( jsoncpp_lib PROPERTIES OUTPUT_NAME jsoncpp )
-SET_TARGET_PROPERTIES( jsoncpp_lib PROPERTIES VERSION ${JSONCPP_VERSION} SOVERSION ${JSONCPP_VERSION_MAJOR} )
-
-IF(NOT CMAKE_VERSION VERSION_LESS 2.8.11)
- TARGET_INCLUDE_DIRECTORIES( jsoncpp_lib PUBLIC
- $<INSTALL_INTERFACE:${INCLUDE_INSTALL_DIR}>
- $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/${JSONCPP_INCLUDE_DIR}>
- )
-ENDIF(NOT CMAKE_VERSION VERSION_LESS 2.8.11)
+SET(jsoncpp_sources
+ json_tool.h
+ json_reader.cpp
+ json_valueiterator.inl
+ json_value.cpp
+ json_writer.cpp
+ version.h.in)
# Install instructions for this target
IF(JSONCPP_WITH_CMAKE_PACKAGE)
@@ -63,8 +39,42 @@ ELSE(JSONCPP_WITH_CMAKE_PACKAGE)
SET(INSTALL_EXPORT)
ENDIF(JSONCPP_WITH_CMAKE_PACKAGE)
-INSTALL( TARGETS jsoncpp_lib ${INSTALL_EXPORT}
+IF(BUILD_SHARED_LIBS)
+ ADD_DEFINITIONS( -DJSON_DLL_BUILD )
+ ADD_LIBRARY(jsoncpp_lib SHARED ${PUBLIC_HEADERS} ${jsoncpp_sources})
+ SET_TARGET_PROPERTIES( jsoncpp_lib PROPERTIES VERSION ${JSONCPP_VERSION} SOVERSION ${JSONCPP_VERSION_MAJOR})
+ SET_TARGET_PROPERTIES( jsoncpp_lib PROPERTIES OUTPUT_NAME jsoncpp
+ DEBUG_OUTPUT_NAME jsoncpp${DEBUG_LIBNAME_SUFFIX} )
+
+ INSTALL( TARGETS jsoncpp_lib ${INSTALL_EXPORT}
RUNTIME DESTINATION ${RUNTIME_INSTALL_DIR}
LIBRARY DESTINATION ${LIBRARY_INSTALL_DIR}
- ARCHIVE DESTINATION ${ARCHIVE_INSTALL_DIR}
-)
+ ARCHIVE DESTINATION ${ARCHIVE_INSTALL_DIR})
+
+ IF(NOT CMAKE_VERSION VERSION_LESS 2.8.11)
+ TARGET_INCLUDE_DIRECTORIES( jsoncpp_lib PUBLIC
+ $<INSTALL_INTERFACE:${INCLUDE_INSTALL_DIR}>
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/${JSONCPP_INCLUDE_DIR}>)
+ ENDIF(NOT CMAKE_VERSION VERSION_LESS 2.8.11)
+
+ENDIF()
+
+IF(BUILD_STATIC_LIBS)
+ ADD_LIBRARY(jsoncpp_lib_static STATIC ${PUBLIC_HEADERS} ${jsoncpp_sources})
+ SET_TARGET_PROPERTIES( jsoncpp_lib_static PROPERTIES VERSION ${JSONCPP_VERSION} SOVERSION ${JSONCPP_VERSION_MAJOR})
+ SET_TARGET_PROPERTIES( jsoncpp_lib_static PROPERTIES OUTPUT_NAME jsoncpp
+ DEBUG_OUTPUT_NAME jsoncpp${DEBUG_LIBNAME_SUFFIX} )
+
+ INSTALL( TARGETS jsoncpp_lib_static ${INSTALL_EXPORT}
+ RUNTIME DESTINATION ${RUNTIME_INSTALL_DIR}
+ LIBRARY DESTINATION ${LIBRARY_INSTALL_DIR}
+ ARCHIVE DESTINATION ${ARCHIVE_INSTALL_DIR})
+
+ IF(NOT CMAKE_VERSION VERSION_LESS 2.8.11)
+ TARGET_INCLUDE_DIRECTORIES( jsoncpp_lib_static PUBLIC
+ $<INSTALL_INTERFACE:${INCLUDE_INSTALL_DIR}>
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/${JSONCPP_INCLUDE_DIR}>
+ )
+ ENDIF(NOT CMAKE_VERSION VERSION_LESS 2.8.11)
+
+ENDIF()
diff --git a/3rdparty/jsoncpp/src/lib_json/json_batchallocator.h b/3rdparty/jsoncpp/src/lib_json/json_batchallocator.h
deleted file mode 100644
index 2fbef7a8601..00000000000
--- a/3rdparty/jsoncpp/src/lib_json/json_batchallocator.h
+++ /dev/null
@@ -1,121 +0,0 @@
-// Copyright 2007-2010 Baptiste Lepilleur
-// Distributed under MIT license, or public domain if desired and
-// recognized in your jurisdiction.
-// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
-
-#ifndef JSONCPP_BATCHALLOCATOR_H_INCLUDED
-#define JSONCPP_BATCHALLOCATOR_H_INCLUDED
-
-#include <stdlib.h>
-#include <assert.h>
-
-#ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
-
-namespace Json {
-
-/* Fast memory allocator.
- *
- * This memory allocator allocates memory for a batch of object (specified by
- * the page size, the number of object in each page).
- *
- * It does not allow the destruction of a single object. All the allocated
- * objects can be destroyed at once. The memory can be either released or reused
- * for future allocation.
- *
- * The in-place new operator must be used to construct the object using the
- * pointer returned by allocate.
- */
-template <typename AllocatedType, const unsigned int objectPerAllocation>
-class BatchAllocator {
-public:
- BatchAllocator(unsigned int objectsPerPage = 255)
- : freeHead_(0), objectsPerPage_(objectsPerPage) {
- // printf( "Size: %d => %s\n", sizeof(AllocatedType),
- // typeid(AllocatedType).name() );
- assert(sizeof(AllocatedType) * objectPerAllocation >=
- sizeof(AllocatedType*)); // We must be able to store a slist in the
- // object free space.
- assert(objectsPerPage >= 16);
- batches_ = allocateBatch(0); // allocated a dummy page
- currentBatch_ = batches_;
- }
-
- ~BatchAllocator() {
- for (BatchInfo* batch = batches_; batch;) {
- BatchInfo* nextBatch = batch->next_;
- free(batch);
- batch = nextBatch;
- }
- }
-
- /// allocate space for an array of objectPerAllocation object.
- /// @warning it is the responsability of the caller to call objects
- /// constructors.
- AllocatedType* allocate() {
- if (freeHead_) // returns node from free list.
- {
- AllocatedType* object = freeHead_;
- freeHead_ = *(AllocatedType**)object;
- return object;
- }
- if (currentBatch_->used_ == currentBatch_->end_) {
- currentBatch_ = currentBatch_->next_;
- while (currentBatch_ && currentBatch_->used_ == currentBatch_->end_)
- currentBatch_ = currentBatch_->next_;
-
- if (!currentBatch_) // no free batch found, allocate a new one
- {
- currentBatch_ = allocateBatch(objectsPerPage_);
- currentBatch_->next_ = batches_; // insert at the head of the list
- batches_ = currentBatch_;
- }
- }
- AllocatedType* allocated = currentBatch_->used_;
- currentBatch_->used_ += objectPerAllocation;
- return allocated;
- }
-
- /// Release the object.
- /// @warning it is the responsability of the caller to actually destruct the
- /// object.
- void release(AllocatedType* object) {
- assert(object != 0);
- *(AllocatedType**)object = freeHead_;
- freeHead_ = object;
- }
-
-private:
- struct BatchInfo {
- BatchInfo* next_;
- AllocatedType* used_;
- AllocatedType* end_;
- AllocatedType buffer_[objectPerAllocation];
- };
-
- // disabled copy constructor and assignement operator.
- BatchAllocator(const BatchAllocator&);
- void operator=(const BatchAllocator&);
-
- static BatchInfo* allocateBatch(unsigned int objectsPerPage) {
- const unsigned int mallocSize =
- sizeof(BatchInfo) - sizeof(AllocatedType) * objectPerAllocation +
- sizeof(AllocatedType) * objectPerAllocation * objectsPerPage;
- BatchInfo* batch = static_cast<BatchInfo*>(malloc(mallocSize));
- batch->next_ = 0;
- batch->used_ = batch->buffer_;
- batch->end_ = batch->buffer_ + objectsPerPage;
- return batch;
- }
-
- BatchInfo* batches_;
- BatchInfo* currentBatch_;
- /// Head of a single linked list within the allocated space of freeed object
- AllocatedType* freeHead_;
- unsigned int objectsPerPage_;
-};
-
-} // namespace Json
-
-#endif // ifndef JSONCPP_DOC_INCLUDE_IMPLEMENTATION
-
-#endif // JSONCPP_BATCHALLOCATOR_H_INCLUDED
diff --git a/3rdparty/jsoncpp/src/lib_json/json_internalarray.inl b/3rdparty/jsoncpp/src/lib_json/json_internalarray.inl
deleted file mode 100644
index 9ee15e9dbf2..00000000000
--- a/3rdparty/jsoncpp/src/lib_json/json_internalarray.inl
+++ /dev/null
@@ -1,360 +0,0 @@
-// Copyright 2007-2010 Baptiste Lepilleur
-// Distributed under MIT license, or public domain if desired and
-// recognized in your jurisdiction.
-// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
-
-// included by json_value.cpp
-
-namespace Json {
-
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// class ValueInternalArray
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-
-ValueArrayAllocator::~ValueArrayAllocator() {}
-
-// //////////////////////////////////////////////////////////////////
-// class DefaultValueArrayAllocator
-// //////////////////////////////////////////////////////////////////
-#ifdef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR
-class DefaultValueArrayAllocator : public ValueArrayAllocator {
-public: // overridden from ValueArrayAllocator
- virtual ~DefaultValueArrayAllocator() {}
-
- virtual ValueInternalArray* newArray() { return new ValueInternalArray(); }
-
- virtual ValueInternalArray* newArrayCopy(const ValueInternalArray& other) {
- return new ValueInternalArray(other);
- }
-
- virtual void destructArray(ValueInternalArray* array) { delete array; }
-
- virtual void
- reallocateArrayPageIndex(Value**& indexes,
- ValueInternalArray::PageIndex& indexCount,
- ValueInternalArray::PageIndex minNewIndexCount) {
- ValueInternalArray::PageIndex newIndexCount = (indexCount * 3) / 2 + 1;
- if (minNewIndexCount > newIndexCount)
- newIndexCount = minNewIndexCount;
- void* newIndexes = realloc(indexes, sizeof(Value*) * newIndexCount);
- JSON_ASSERT_MESSAGE(newIndexes, "Couldn't realloc.");
- indexCount = newIndexCount;
- indexes = static_cast<Value**>(newIndexes);
- }
- virtual void releaseArrayPageIndex(Value** indexes,
- ValueInternalArray::PageIndex indexCount) {
- if (indexes)
- free(indexes);
- }
-
- virtual Value* allocateArrayPage() {
- return static_cast<Value*>(
- malloc(sizeof(Value) * ValueInternalArray::itemsPerPage));
- }
-
- virtual void releaseArrayPage(Value* value) {
- if (value)
- free(value);
- }
-};
-
-#else // #ifdef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR
-/// @todo make this thread-safe (lock when accessign batch allocator)
-class DefaultValueArrayAllocator : public ValueArrayAllocator {
-public: // overridden from ValueArrayAllocator
- virtual ~DefaultValueArrayAllocator() {}
-
- virtual ValueInternalArray* newArray() {
- ValueInternalArray* array = arraysAllocator_.allocate();
- new (array) ValueInternalArray(); // placement new
- return array;
- }
-
- virtual ValueInternalArray* newArrayCopy(const ValueInternalArray& other) {
- ValueInternalArray* array = arraysAllocator_.allocate();
- new (array) ValueInternalArray(other); // placement new
- return array;
- }
-
- virtual void destructArray(ValueInternalArray* array) {
- if (array) {
- array->~ValueInternalArray();
- arraysAllocator_.release(array);
- }
- }
-
- virtual void
- reallocateArrayPageIndex(Value**& indexes,
- ValueInternalArray::PageIndex& indexCount,
- ValueInternalArray::PageIndex minNewIndexCount) {
- ValueInternalArray::PageIndex newIndexCount = (indexCount * 3) / 2 + 1;
- if (minNewIndexCount > newIndexCount)
- newIndexCount = minNewIndexCount;
- void* newIndexes = realloc(indexes, sizeof(Value*) * newIndexCount);
- JSON_ASSERT_MESSAGE(newIndexes, "Couldn't realloc.");
- indexCount = newIndexCount;
- indexes = static_cast<Value**>(newIndexes);
- }
- virtual void releaseArrayPageIndex(Value** indexes,
- ValueInternalArray::PageIndex indexCount) {
- if (indexes)
- free(indexes);
- }
-
- virtual Value* allocateArrayPage() {
- return static_cast<Value*>(pagesAllocator_.allocate());
- }
-
- virtual void releaseArrayPage(Value* value) {
- if (value)
- pagesAllocator_.release(value);
- }
-
-private:
- BatchAllocator<ValueInternalArray, 1> arraysAllocator_;
- BatchAllocator<Value, ValueInternalArray::itemsPerPage> pagesAllocator_;
-};
-#endif // #ifdef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR
-
-static ValueArrayAllocator*& arrayAllocator() {
- static DefaultValueArrayAllocator defaultAllocator;
- static ValueArrayAllocator* arrayAllocator = &defaultAllocator;
- return arrayAllocator;
-}
-
-static struct DummyArrayAllocatorInitializer {
- DummyArrayAllocatorInitializer() {
- arrayAllocator(); // ensure arrayAllocator() statics are initialized before
- // main().
- }
-} dummyArrayAllocatorInitializer;
-
-// //////////////////////////////////////////////////////////////////
-// class ValueInternalArray
-// //////////////////////////////////////////////////////////////////
-bool ValueInternalArray::equals(const IteratorState& x,
- const IteratorState& other) {
- return x.array_ == other.array_ &&
- x.currentItemIndex_ == other.currentItemIndex_ &&
- x.currentPageIndex_ == other.currentPageIndex_;
-}
-
-void ValueInternalArray::increment(IteratorState& it) {
- JSON_ASSERT_MESSAGE(
- it.array_ && (it.currentPageIndex_ - it.array_->pages_) * itemsPerPage +
- it.currentItemIndex_ !=
- it.array_->size_,
- "ValueInternalArray::increment(): moving iterator beyond end");
- ++(it.currentItemIndex_);
- if (it.currentItemIndex_ == itemsPerPage) {
- it.currentItemIndex_ = 0;
- ++(it.currentPageIndex_);
- }
-}
-
-void ValueInternalArray::decrement(IteratorState& it) {
- JSON_ASSERT_MESSAGE(
- it.array_ && it.currentPageIndex_ == it.array_->pages_ &&
- it.currentItemIndex_ == 0,
- "ValueInternalArray::decrement(): moving iterator beyond end");
- if (it.currentItemIndex_ == 0) {
- it.currentItemIndex_ = itemsPerPage - 1;
- --(it.currentPageIndex_);
- } else {
- --(it.currentItemIndex_);
- }
-}
-
-Value& ValueInternalArray::unsafeDereference(const IteratorState& it) {
- return (*(it.currentPageIndex_))[it.currentItemIndex_];
-}
-
-Value& ValueInternalArray::dereference(const IteratorState& it) {
- JSON_ASSERT_MESSAGE(
- it.array_ && (it.currentPageIndex_ - it.array_->pages_) * itemsPerPage +
- it.currentItemIndex_ <
- it.array_->size_,
- "ValueInternalArray::dereference(): dereferencing invalid iterator");
- return unsafeDereference(it);
-}
-
-void ValueInternalArray::makeBeginIterator(IteratorState& it) const {
- it.array_ = const_cast<ValueInternalArray*>(this);
- it.currentItemIndex_ = 0;
- it.currentPageIndex_ = pages_;
-}
-
-void ValueInternalArray::makeIterator(IteratorState& it,
- ArrayIndex index) const {
- it.array_ = const_cast<ValueInternalArray*>(this);
- it.currentItemIndex_ = index % itemsPerPage;
- it.currentPageIndex_ = pages_ + index / itemsPerPage;
-}
-
-void ValueInternalArray::makeEndIterator(IteratorState& it) const {
- makeIterator(it, size_);
-}
-
-ValueInternalArray::ValueInternalArray() : pages_(0), size_(0), pageCount_(0) {}
-
-ValueInternalArray::ValueInternalArray(const ValueInternalArray& other)
- : pages_(0), size_(other.size_), pageCount_(0) {
- PageIndex minNewPages = other.size_ / itemsPerPage;
- arrayAllocator()->reallocateArrayPageIndex(pages_, pageCount_, minNewPages);
- JSON_ASSERT_MESSAGE(pageCount_ >= minNewPages,
- "ValueInternalArray::reserve(): bad reallocation");
- IteratorState itOther;
- other.makeBeginIterator(itOther);
- Value* value;
- for (ArrayIndex index = 0; index < size_; ++index, increment(itOther)) {
- if (index % itemsPerPage == 0) {
- PageIndex pageIndex = index / itemsPerPage;
- value = arrayAllocator()->allocateArrayPage();
- pages_[pageIndex] = value;
- }
- new (value) Value(dereference(itOther));
- }
-}
-
-ValueInternalArray& ValueInternalArray::operator=(ValueInternalArray other) {
- swap(other);
- return *this;
-}
-
-ValueInternalArray::~ValueInternalArray() {
- // destroy all constructed items
- IteratorState it;
- IteratorState itEnd;
- makeBeginIterator(it);
- makeEndIterator(itEnd);
- for (; !equals(it, itEnd); increment(it)) {
- Value* value = &dereference(it);
- value->~Value();
- }
- // release all pages
- PageIndex lastPageIndex = size_ / itemsPerPage;
- for (PageIndex pageIndex = 0; pageIndex < lastPageIndex; ++pageIndex)
- arrayAllocator()->releaseArrayPage(pages_[pageIndex]);
- // release pages index
- arrayAllocator()->releaseArrayPageIndex(pages_, pageCount_);
-}
-
-void ValueInternalArray::swap(ValueInternalArray& other) {
- Value** tempPages = pages_;
- pages_ = other.pages_;
- other.pages_ = tempPages;
- ArrayIndex tempSize = size_;
- size_ = other.size_;
- other.size_ = tempSize;
- PageIndex tempPageCount = pageCount_;
- pageCount_ = other.pageCount_;
- other.pageCount_ = tempPageCount;
-}
-
-void ValueInternalArray::clear() {
- ValueInternalArray dummy;
- swap(dummy);
-}
-
-void ValueInternalArray::resize(ArrayIndex newSize) {
- if (newSize == 0)
- clear();
- else if (newSize < size_) {
- IteratorState it;
- IteratorState itEnd;
- makeIterator(it, newSize);
- makeIterator(itEnd, size_);
- for (; !equals(it, itEnd); increment(it)) {
- Value* value = &dereference(it);
- value->~Value();
- }
- PageIndex pageIndex = (newSize + itemsPerPage - 1) / itemsPerPage;
- PageIndex lastPageIndex = size_ / itemsPerPage;
- for (; pageIndex < lastPageIndex; ++pageIndex)
- arrayAllocator()->releaseArrayPage(pages_[pageIndex]);
- size_ = newSize;
- } else if (newSize > size_)
- resolveReference(newSize);
-}
-
-void ValueInternalArray::makeIndexValid(ArrayIndex index) {
- // Need to enlarge page index ?
- if (index >= pageCount_ * itemsPerPage) {
- PageIndex minNewPages = (index + 1) / itemsPerPage;
- arrayAllocator()->reallocateArrayPageIndex(pages_, pageCount_, minNewPages);
- JSON_ASSERT_MESSAGE(pageCount_ >= minNewPages,
- "ValueInternalArray::reserve(): bad reallocation");
- }
-
- // Need to allocate new pages ?
- ArrayIndex nextPageIndex = (size_ % itemsPerPage) != 0
- ? size_ - (size_ % itemsPerPage) + itemsPerPage
- : size_;
- if (nextPageIndex <= index) {
- PageIndex pageIndex = nextPageIndex / itemsPerPage;
- PageIndex pageToAllocate = (index - nextPageIndex) / itemsPerPage + 1;
- for (; pageToAllocate-- > 0; ++pageIndex)
- pages_[pageIndex] = arrayAllocator()->allocateArrayPage();
- }
-
- // Initialize all new entries
- IteratorState it;
- IteratorState itEnd;
- makeIterator(it, size_);
- size_ = index + 1;
- makeIterator(itEnd, size_);
- for (; !equals(it, itEnd); increment(it)) {
- Value* value = &dereference(it);
- new (value) Value(); // Construct a default value using placement new
- }
-}
-
-Value& ValueInternalArray::resolveReference(ArrayIndex index) {
- if (index >= size_)
- makeIndexValid(index);
- return pages_[index / itemsPerPage][index % itemsPerPage];
-}
-
-Value* ValueInternalArray::find(ArrayIndex index) const {
- if (index >= size_)
- return 0;
- return &(pages_[index / itemsPerPage][index % itemsPerPage]);
-}
-
-ValueInternalArray::ArrayIndex ValueInternalArray::size() const {
- return size_;
-}
-
-int ValueInternalArray::distance(const IteratorState& x,
- const IteratorState& y) {
- return indexOf(y) - indexOf(x);
-}
-
-ValueInternalArray::ArrayIndex
-ValueInternalArray::indexOf(const IteratorState& iterator) {
- if (!iterator.array_)
- return ArrayIndex(-1);
- return ArrayIndex((iterator.currentPageIndex_ - iterator.array_->pages_) *
- itemsPerPage +
- iterator.currentItemIndex_);
-}
-
-int ValueInternalArray::compare(const ValueInternalArray& other) const {
- int sizeDiff(size_ - other.size_);
- if (sizeDiff != 0)
- return sizeDiff;
-
- for (ArrayIndex index = 0; index < size_; ++index) {
- int diff = pages_[index / itemsPerPage][index % itemsPerPage].compare(
- other.pages_[index / itemsPerPage][index % itemsPerPage]);
- if (diff != 0)
- return diff;
- }
- return 0;
-}
-
-} // namespace Json
diff --git a/3rdparty/jsoncpp/src/lib_json/json_internalmap.inl b/3rdparty/jsoncpp/src/lib_json/json_internalmap.inl
deleted file mode 100644
index ef3f3302dc9..00000000000
--- a/3rdparty/jsoncpp/src/lib_json/json_internalmap.inl
+++ /dev/null
@@ -1,473 +0,0 @@
-// Copyright 2007-2010 Baptiste Lepilleur
-// Distributed under MIT license, or public domain if desired and
-// recognized in your jurisdiction.
-// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
-
-// included by json_value.cpp
-
-namespace Json {
-
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// class ValueInternalMap
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-
-/** \internal MUST be safely initialized using memset( this, 0,
- * sizeof(ValueInternalLink) );
- * This optimization is used by the fast allocator.
- */
-ValueInternalLink::ValueInternalLink() : previous_(0), next_(0) {}
-
-ValueInternalLink::~ValueInternalLink() {
- for (int index = 0; index < itemPerLink; ++index) {
- if (!items_[index].isItemAvailable()) {
- if (!items_[index].isMemberNameStatic())
- free(keys_[index]);
- } else
- break;
- }
-}
-
-ValueMapAllocator::~ValueMapAllocator() {}
-
-#ifdef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR
-class DefaultValueMapAllocator : public ValueMapAllocator {
-public: // overridden from ValueMapAllocator
- virtual ValueInternalMap* newMap() { return new ValueInternalMap(); }
-
- virtual ValueInternalMap* newMapCopy(const ValueInternalMap& other) {
- return new ValueInternalMap(other);
- }
-
- virtual void destructMap(ValueInternalMap* map) { delete map; }
-
- virtual ValueInternalLink* allocateMapBuckets(unsigned int size) {
- return new ValueInternalLink[size];
- }
-
- virtual void releaseMapBuckets(ValueInternalLink* links) { delete[] links; }
-
- virtual ValueInternalLink* allocateMapLink() {
- return new ValueInternalLink();
- }
-
- virtual void releaseMapLink(ValueInternalLink* link) { delete link; }
-};
-#else
-/// @todo make this thread-safe (lock when accessign batch allocator)
-class DefaultValueMapAllocator : public ValueMapAllocator {
-public: // overridden from ValueMapAllocator
- virtual ValueInternalMap* newMap() {
- ValueInternalMap* map = mapsAllocator_.allocate();
- new (map) ValueInternalMap(); // placement new
- return map;
- }
-
- virtual ValueInternalMap* newMapCopy(const ValueInternalMap& other) {
- ValueInternalMap* map = mapsAllocator_.allocate();
- new (map) ValueInternalMap(other); // placement new
- return map;
- }
-
- virtual void destructMap(ValueInternalMap* map) {
- if (map) {
- map->~ValueInternalMap();
- mapsAllocator_.release(map);
- }
- }
-
- virtual ValueInternalLink* allocateMapBuckets(unsigned int size) {
- return new ValueInternalLink[size];
- }
-
- virtual void releaseMapBuckets(ValueInternalLink* links) { delete[] links; }
-
- virtual ValueInternalLink* allocateMapLink() {
- ValueInternalLink* link = linksAllocator_.allocate();
- memset(link, 0, sizeof(ValueInternalLink));
- return link;
- }
-
- virtual void releaseMapLink(ValueInternalLink* link) {
- link->~ValueInternalLink();
- linksAllocator_.release(link);
- }
-
-private:
- BatchAllocator<ValueInternalMap, 1> mapsAllocator_;
- BatchAllocator<ValueInternalLink, 1> linksAllocator_;
-};
-#endif
-
-static ValueMapAllocator*& mapAllocator() {
- static DefaultValueMapAllocator defaultAllocator;
- static ValueMapAllocator* mapAllocator = &defaultAllocator;
- return mapAllocator;
-}
-
-static struct DummyMapAllocatorInitializer {
- DummyMapAllocatorInitializer() {
- mapAllocator(); // ensure mapAllocator() statics are initialized before
- // main().
- }
-} dummyMapAllocatorInitializer;
-
-// h(K) = value * K >> w ; with w = 32 & K prime w.r.t. 2^32.
-
-/*
-use linked list hash map.
-buckets array is a container.
-linked list element contains 6 key/values. (memory = (16+4) * 6 + 4 = 124)
-value have extra state: valid, available, deleted
-*/
-
-ValueInternalMap::ValueInternalMap()
- : buckets_(0), tailLink_(0), bucketsSize_(0), itemCount_(0) {}
-
-ValueInternalMap::ValueInternalMap(const ValueInternalMap& other)
- : buckets_(0), tailLink_(0), bucketsSize_(0), itemCount_(0) {
- reserve(other.itemCount_);
- IteratorState it;
- IteratorState itEnd;
- other.makeBeginIterator(it);
- other.makeEndIterator(itEnd);
- for (; !equals(it, itEnd); increment(it)) {
- bool isStatic;
- const char* memberName = key(it, isStatic);
- const Value& aValue = value(it);
- resolveReference(memberName, isStatic) = aValue;
- }
-}
-
-ValueInternalMap& ValueInternalMap::operator=(ValueInternalMap other) {
- swap(other);
- return *this;
-}
-
-ValueInternalMap::~ValueInternalMap() {
- if (buckets_) {
- for (BucketIndex bucketIndex = 0; bucketIndex < bucketsSize_;
- ++bucketIndex) {
- ValueInternalLink* link = buckets_[bucketIndex].next_;
- while (link) {
- ValueInternalLink* linkToRelease = link;
- link = link->next_;
- mapAllocator()->releaseMapLink(linkToRelease);
- }
- }
- mapAllocator()->releaseMapBuckets(buckets_);
- }
-}
-
-void ValueInternalMap::swap(ValueInternalMap& other) {
- ValueInternalLink* tempBuckets = buckets_;
- buckets_ = other.buckets_;
- other.buckets_ = tempBuckets;
- ValueInternalLink* tempTailLink = tailLink_;
- tailLink_ = other.tailLink_;
- other.tailLink_ = tempTailLink;
- BucketIndex tempBucketsSize = bucketsSize_;
- bucketsSize_ = other.bucketsSize_;
- other.bucketsSize_ = tempBucketsSize;
- BucketIndex tempItemCount = itemCount_;
- itemCount_ = other.itemCount_;
- other.itemCount_ = tempItemCount;
-}
-
-void ValueInternalMap::clear() {
- ValueInternalMap dummy;
- swap(dummy);
-}
-
-ValueInternalMap::BucketIndex ValueInternalMap::size() const {
- return itemCount_;
-}
-
-bool ValueInternalMap::reserveDelta(BucketIndex growth) {
- return reserve(itemCount_ + growth);
-}
-
-bool ValueInternalMap::reserve(BucketIndex newItemCount) {
- if (!buckets_ && newItemCount > 0) {
- buckets_ = mapAllocator()->allocateMapBuckets(1);
- bucketsSize_ = 1;
- tailLink_ = &buckets_[0];
- }
- // BucketIndex idealBucketCount = (newItemCount +
- // ValueInternalLink::itemPerLink) / ValueInternalLink::itemPerLink;
- return true;
-}
-
-const Value* ValueInternalMap::find(const char* key) const {
- if (!bucketsSize_)
- return 0;
- HashKey hashedKey = hash(key);
- BucketIndex bucketIndex = hashedKey % bucketsSize_;
- for (const ValueInternalLink* current = &buckets_[bucketIndex]; current != 0;
- current = current->next_) {
- for (BucketIndex index = 0; index < ValueInternalLink::itemPerLink;
- ++index) {
- if (current->items_[index].isItemAvailable())
- return 0;
- if (strcmp(key, current->keys_[index]) == 0)
- return &current->items_[index];
- }
- }
- return 0;
-}
-
-Value* ValueInternalMap::find(const char* key) {
- const ValueInternalMap* constThis = this;
- return const_cast<Value*>(constThis->find(key));
-}
-
-Value& ValueInternalMap::resolveReference(const char* key, bool isStatic) {
- HashKey hashedKey = hash(key);
- if (bucketsSize_) {
- BucketIndex bucketIndex = hashedKey % bucketsSize_;
- ValueInternalLink** previous = 0;
- BucketIndex index;
- for (ValueInternalLink* current = &buckets_[bucketIndex]; current != 0;
- previous = &current->next_, current = current->next_) {
- for (index = 0; index < ValueInternalLink::itemPerLink; ++index) {
- if (current->items_[index].isItemAvailable())
- return setNewItem(key, isStatic, current, index);
- if (strcmp(key, current->keys_[index]) == 0)
- return current->items_[index];
- }
- }
- }
-
- reserveDelta(1);
- return unsafeAdd(key, isStatic, hashedKey);
-}
-
-void ValueInternalMap::remove(const char* key) {
- HashKey hashedKey = hash(key);
- if (!bucketsSize_)
- return;
- BucketIndex bucketIndex = hashedKey % bucketsSize_;
- for (ValueInternalLink* link = &buckets_[bucketIndex]; link != 0;
- link = link->next_) {
- BucketIndex index;
- for (index = 0; index < ValueInternalLink::itemPerLink; ++index) {
- if (link->items_[index].isItemAvailable())
- return;
- if (strcmp(key, link->keys_[index]) == 0) {
- doActualRemove(link, index, bucketIndex);
- return;
- }
- }
- }
-}
-
-void ValueInternalMap::doActualRemove(ValueInternalLink* link,
- BucketIndex index,
- BucketIndex bucketIndex) {
- // find last item of the bucket and swap it with the 'removed' one.
- // set removed items flags to 'available'.
- // if last page only contains 'available' items, then desallocate it (it's
- // empty)
- ValueInternalLink*& lastLink = getLastLinkInBucket(index);
- BucketIndex lastItemIndex = 1; // a link can never be empty, so start at 1
- for (; lastItemIndex < ValueInternalLink::itemPerLink;
- ++lastItemIndex) // may be optimized with dicotomic search
- {
- if (lastLink->items_[lastItemIndex].isItemAvailable())
- break;
- }
-
- BucketIndex lastUsedIndex = lastItemIndex - 1;
- Value* valueToDelete = &link->items_[index];
- Value* valueToPreserve = &lastLink->items_[lastUsedIndex];
- if (valueToDelete != valueToPreserve)
- valueToDelete->swap(*valueToPreserve);
- if (lastUsedIndex == 0) // page is now empty
- { // remove it from bucket linked list and delete it.
- ValueInternalLink* linkPreviousToLast = lastLink->previous_;
- if (linkPreviousToLast != 0) // can not deleted bucket link.
- {
- mapAllocator()->releaseMapLink(lastLink);
- linkPreviousToLast->next_ = 0;
- lastLink = linkPreviousToLast;
- }
- } else {
- Value dummy;
- valueToPreserve->swap(dummy); // restore deleted to default Value.
- valueToPreserve->setItemUsed(false);
- }
- --itemCount_;
-}
-
-ValueInternalLink*&
-ValueInternalMap::getLastLinkInBucket(BucketIndex bucketIndex) {
- if (bucketIndex == bucketsSize_ - 1)
- return tailLink_;
- ValueInternalLink*& previous = buckets_[bucketIndex + 1].previous_;
- if (!previous)
- previous = &buckets_[bucketIndex];
- return previous;
-}
-
-Value& ValueInternalMap::setNewItem(const char* key,
- bool isStatic,
- ValueInternalLink* link,
- BucketIndex index) {
- char* duplicatedKey = makeMemberName(key);
- ++itemCount_;
- link->keys_[index] = duplicatedKey;
- link->items_[index].setItemUsed();
- link->items_[index].setMemberNameIsStatic(isStatic);
- return link->items_[index]; // items already default constructed.
-}
-
-Value&
-ValueInternalMap::unsafeAdd(const char* key, bool isStatic, HashKey hashedKey) {
- JSON_ASSERT_MESSAGE(bucketsSize_ > 0,
- "ValueInternalMap::unsafeAdd(): internal logic error.");
- BucketIndex bucketIndex = hashedKey % bucketsSize_;
- ValueInternalLink*& previousLink = getLastLinkInBucket(bucketIndex);
- ValueInternalLink* link = previousLink;
- BucketIndex index;
- for (index = 0; index < ValueInternalLink::itemPerLink; ++index) {
- if (link->items_[index].isItemAvailable())
- break;
- }
- if (index == ValueInternalLink::itemPerLink) // need to add a new page
- {
- ValueInternalLink* newLink = mapAllocator()->allocateMapLink();
- index = 0;
- link->next_ = newLink;
- previousLink = newLink;
- link = newLink;
- }
- return setNewItem(key, isStatic, link, index);
-}
-
-ValueInternalMap::HashKey ValueInternalMap::hash(const char* key) const {
- HashKey hash = 0;
- while (*key)
- hash += *key++ * 37;
- return hash;
-}
-
-int ValueInternalMap::compare(const ValueInternalMap& other) const {
- int sizeDiff(itemCount_ - other.itemCount_);
- if (sizeDiff != 0)
- return sizeDiff;
- // Strict order guaranty is required. Compare all keys FIRST, then compare
- // values.
- IteratorState it;
- IteratorState itEnd;
- makeBeginIterator(it);
- makeEndIterator(itEnd);
- for (; !equals(it, itEnd); increment(it)) {
- if (!other.find(key(it)))
- return 1;
- }
-
- // All keys are equals, let's compare values
- makeBeginIterator(it);
- for (; !equals(it, itEnd); increment(it)) {
- const Value* otherValue = other.find(key(it));
- int valueDiff = value(it).compare(*otherValue);
- if (valueDiff != 0)
- return valueDiff;
- }
- return 0;
-}
-
-void ValueInternalMap::makeBeginIterator(IteratorState& it) const {
- it.map_ = const_cast<ValueInternalMap*>(this);
- it.bucketIndex_ = 0;
- it.itemIndex_ = 0;
- it.link_ = buckets_;
-}
-
-void ValueInternalMap::makeEndIterator(IteratorState& it) const {
- it.map_ = const_cast<ValueInternalMap*>(this);
- it.bucketIndex_ = bucketsSize_;
- it.itemIndex_ = 0;
- it.link_ = 0;
-}
-
-bool ValueInternalMap::equals(const IteratorState& x,
- const IteratorState& other) {
- return x.map_ == other.map_ && x.bucketIndex_ == other.bucketIndex_ &&
- x.link_ == other.link_ && x.itemIndex_ == other.itemIndex_;
-}
-
-void ValueInternalMap::incrementBucket(IteratorState& iterator) {
- ++iterator.bucketIndex_;
- JSON_ASSERT_MESSAGE(
- iterator.bucketIndex_ <= iterator.map_->bucketsSize_,
- "ValueInternalMap::increment(): attempting to iterate beyond end.");
- if (iterator.bucketIndex_ == iterator.map_->bucketsSize_)
- iterator.link_ = 0;
- else
- iterator.link_ = &(iterator.map_->buckets_[iterator.bucketIndex_]);
- iterator.itemIndex_ = 0;
-}
-
-void ValueInternalMap::increment(IteratorState& iterator) {
- JSON_ASSERT_MESSAGE(iterator.map_,
- "Attempting to iterator using invalid iterator.");
- ++iterator.itemIndex_;
- if (iterator.itemIndex_ == ValueInternalLink::itemPerLink) {
- JSON_ASSERT_MESSAGE(
- iterator.link_ != 0,
- "ValueInternalMap::increment(): attempting to iterate beyond end.");
- iterator.link_ = iterator.link_->next_;
- if (iterator.link_ == 0)
- incrementBucket(iterator);
- } else if (iterator.link_->items_[iterator.itemIndex_].isItemAvailable()) {
- incrementBucket(iterator);
- }
-}
-
-void ValueInternalMap::decrement(IteratorState& iterator) {
- if (iterator.itemIndex_ == 0) {
- JSON_ASSERT_MESSAGE(iterator.map_,
- "Attempting to iterate using invalid iterator.");
- if (iterator.link_ == &iterator.map_->buckets_[iterator.bucketIndex_]) {
- JSON_ASSERT_MESSAGE(iterator.bucketIndex_ > 0,
- "Attempting to iterate beyond beginning.");
- --(iterator.bucketIndex_);
- }
- iterator.link_ = iterator.link_->previous_;
- iterator.itemIndex_ = ValueInternalLink::itemPerLink - 1;
- }
-}
-
-const char* ValueInternalMap::key(const IteratorState& iterator) {
- JSON_ASSERT_MESSAGE(iterator.link_,
- "Attempting to iterate using invalid iterator.");
- return iterator.link_->keys_[iterator.itemIndex_];
-}
-
-const char* ValueInternalMap::key(const IteratorState& iterator,
- bool& isStatic) {
- JSON_ASSERT_MESSAGE(iterator.link_,
- "Attempting to iterate using invalid iterator.");
- isStatic = iterator.link_->items_[iterator.itemIndex_].isMemberNameStatic();
- return iterator.link_->keys_[iterator.itemIndex_];
-}
-
-Value& ValueInternalMap::value(const IteratorState& iterator) {
- JSON_ASSERT_MESSAGE(iterator.link_,
- "Attempting to iterate using invalid iterator.");
- return iterator.link_->items_[iterator.itemIndex_];
-}
-
-int ValueInternalMap::distance(const IteratorState& x, const IteratorState& y) {
- int offset = 0;
- IteratorState it = x;
- while (!equals(it, y))
- increment(it);
- return offset;
-}
-
-} // namespace Json
diff --git a/3rdparty/jsoncpp/src/lib_json/json_reader.cpp b/3rdparty/jsoncpp/src/lib_json/json_reader.cpp
index c5111f8d708..ceff66c3134 100644
--- a/3rdparty/jsoncpp/src/lib_json/json_reader.cpp
+++ b/3rdparty/jsoncpp/src/lib_json/json_reader.cpp
@@ -14,6 +14,9 @@
#include <cassert>
#include <cstring>
#include <istream>
+#include <sstream>
+#include <memory>
+#include <set>
#if defined(_MSC_VER) && _MSC_VER < 1500 // VC++ 8.0 and below
#define snprintf _snprintf
@@ -24,8 +27,17 @@
#pragma warning(disable : 4996)
#endif
+static int const stackLimit_g = 1000;
+static int stackDepth_g = 0; // see readValue()
+
namespace Json {
+#if __cplusplus >= 201103L
+typedef std::unique_ptr<CharReader> CharReaderPtr;
+#else
+typedef std::auto_ptr<CharReader> CharReaderPtr;
+#endif
+
// Implementation of class Features
// ////////////////////////////////
@@ -47,23 +59,6 @@ Features Features::strictMode() {
// Implementation of class Reader
// ////////////////////////////////
-static inline bool in(Reader::Char c,
- Reader::Char c1,
- Reader::Char c2,
- Reader::Char c3,
- Reader::Char c4) {
- return c == c1 || c == c2 || c == c3 || c == c4;
-}
-
-static inline bool in(Reader::Char c,
- Reader::Char c1,
- Reader::Char c2,
- Reader::Char c3,
- Reader::Char c4,
- Reader::Char c5) {
- return c == c1 || c == c2 || c == c3 || c == c4 || c == c5;
-}
-
static bool containsNewLine(Reader::Location begin, Reader::Location end) {
for (; begin < end; ++begin)
if (*begin == '\n' || *begin == '\r')
@@ -125,6 +120,7 @@ bool Reader::parse(const char* beginDoc,
nodes_.pop();
nodes_.push(&root);
+ stackDepth_g = 0; // Yes, this is bad coding, but options are limited.
bool successful = readValue();
Token token;
skipCommentTokens(token);
@@ -147,19 +143,18 @@ bool Reader::parse(const char* beginDoc,
}
bool Reader::readValue() {
+ // This is a non-reentrant way to support a stackLimit. Terrible!
+ // But this deprecated class has a security problem: Bad input can
+ // cause a seg-fault. This seems like a fair, binary-compatible way
+ // to prevent the problem.
+ if (stackDepth_g >= stackLimit_g) throwRuntimeError("Exceeded stackLimit in readValue().");
+ ++stackDepth_g;
+
Token token;
skipCommentTokens(token);
bool successful = true;
if (collectComments_ && !commentsBefore_.empty()) {
- // Remove newline characters at the end of the comments
- size_t lastNonNewline = commentsBefore_.find_last_not_of("\r\n");
- if (lastNonNewline != std::string::npos) {
- commentsBefore_.erase(lastNonNewline + 1);
- } else {
- commentsBefore_.clear();
- }
-
currentValue().setComment(commentsBefore_, commentBefore);
commentsBefore_ = "";
}
@@ -180,31 +175,42 @@ bool Reader::readValue() {
successful = decodeString(token);
break;
case tokenTrue:
- currentValue() = true;
+ {
+ Value v(true);
+ currentValue().swapPayload(v);
currentValue().setOffsetStart(token.start_ - begin_);
currentValue().setOffsetLimit(token.end_ - begin_);
+ }
break;
case tokenFalse:
- currentValue() = false;
+ {
+ Value v(false);
+ currentValue().swapPayload(v);
currentValue().setOffsetStart(token.start_ - begin_);
currentValue().setOffsetLimit(token.end_ - begin_);
+ }
break;
case tokenNull:
- currentValue() = Value();
+ {
+ Value v;
+ currentValue().swapPayload(v);
currentValue().setOffsetStart(token.start_ - begin_);
currentValue().setOffsetLimit(token.end_ - begin_);
+ }
break;
case tokenArraySeparator:
+ case tokenObjectEnd:
+ case tokenArrayEnd:
if (features_.allowDroppedNullPlaceholders_) {
// "Un-read" the current token and mark the current value as a null
// token.
current_--;
- currentValue() = Value();
+ Value v;
+ currentValue().swapPayload(v);
currentValue().setOffsetStart(current_ - begin_ - 1);
currentValue().setOffsetLimit(current_ - begin_);
break;
- }
- // Else, fall through...
+ } // Else, fall through...
default:
currentValue().setOffsetStart(token.start_ - begin_);
currentValue().setOffsetLimit(token.end_ - begin_);
@@ -216,6 +222,7 @@ bool Reader::readValue() {
lastValue_ = &currentValue();
}
+ --stackDepth_g;
return successful;
}
@@ -229,13 +236,6 @@ void Reader::skipCommentTokens(Token& token) {
}
}
-bool Reader::expectToken(TokenType type, Token& token, const char* message) {
- readToken(token);
- if (token.type_ != type)
- return addError(message, token);
- return true;
-}
-
bool Reader::readToken(Token& token) {
skipSpaces();
token.start_ = current_;
@@ -351,14 +351,34 @@ bool Reader::readComment() {
return true;
}
+static std::string normalizeEOL(Reader::Location begin, Reader::Location end) {
+ std::string normalized;
+ normalized.reserve(end - begin);
+ Reader::Location current = begin;
+ while (current != end) {
+ char c = *current++;
+ if (c == '\r') {
+ if (current != end && *current == '\n')
+ // convert dos EOL
+ ++current;
+ // convert Mac EOL
+ normalized += '\n';
+ } else {
+ normalized += c;
+ }
+ }
+ return normalized;
+}
+
void
Reader::addComment(Location begin, Location end, CommentPlacement placement) {
assert(collectComments_);
+ const std::string& normalized = normalizeEOL(begin, end);
if (placement == commentAfterOnSameLine) {
assert(lastValue_ != 0);
- lastValue_->setComment(std::string(begin, end), placement);
+ lastValue_->setComment(normalized, placement);
} else {
- commentsBefore_ += std::string(begin, end);
+ commentsBefore_ += normalized;
}
}
@@ -374,18 +394,38 @@ bool Reader::readCStyleComment() {
bool Reader::readCppStyleComment() {
while (current_ != end_) {
Char c = getNextChar();
- if (c == '\r' || c == '\n')
+ if (c == '\n')
+ break;
+ if (c == '\r') {
+ // Consume DOS EOL. It will be normalized in addComment.
+ if (current_ != end_ && *current_ == '\n')
+ getNextChar();
+ // Break on Moc OS 9 EOL.
break;
+ }
}
return true;
}
void Reader::readNumber() {
- while (current_ != end_) {
- if (!(*current_ >= '0' && *current_ <= '9') &&
- !in(*current_, '.', 'e', 'E', '+', '-'))
- break;
- ++current_;
+ const char *p = current_;
+ char c = '0'; // stopgap for already consumed character
+ // integral part
+ while (c >= '0' && c <= '9')
+ c = (current_ = p) < end_ ? *p++ : 0;
+ // fractional part
+ if (c == '.') {
+ c = (current_ = p) < end_ ? *p++ : 0;
+ while (c >= '0' && c <= '9')
+ c = (current_ = p) < end_ ? *p++ : 0;
+ }
+ // exponential part
+ if (c == 'e' || c == 'E') {
+ c = (current_ = p) < end_ ? *p++ : 0;
+ if (c == '+' || c == '-')
+ c = (current_ = p) < end_ ? *p++ : 0;
+ while (c >= '0' && c <= '9')
+ c = (current_ = p) < end_ ? *p++ : 0;
}
}
@@ -404,7 +444,8 @@ bool Reader::readString() {
bool Reader::readObject(Token& tokenStart) {
Token tokenName;
std::string name;
- currentValue() = Value(objectValue);
+ Value init(objectValue);
+ currentValue().swapPayload(init);
currentValue().setOffsetStart(tokenStart.start_ - begin_);
while (readToken(tokenName)) {
bool initialTokenOk = true;
@@ -457,7 +498,8 @@ bool Reader::readObject(Token& tokenStart) {
}
bool Reader::readArray(Token& tokenStart) {
- currentValue() = Value(arrayValue);
+ Value init(arrayValue);
+ currentValue().swapPayload(init);
currentValue().setOffsetStart(tokenStart.start_ - begin_);
skipSpaces();
if (*current_ == ']') // empty array
@@ -497,20 +539,13 @@ bool Reader::decodeNumber(Token& token) {
Value decoded;
if (!decodeNumber(token, decoded))
return false;
- currentValue() = decoded;
+ currentValue().swapPayload(decoded);
currentValue().setOffsetStart(token.start_ - begin_);
currentValue().setOffsetLimit(token.end_ - begin_);
return true;
}
bool Reader::decodeNumber(Token& token, Value& decoded) {
- bool isDouble = false;
- for (Location inspect = token.start_; inspect != token.end_; ++inspect) {
- isDouble = isDouble || in(*inspect, '.', 'e', 'E', '+') ||
- (*inspect == '-' && inspect != token.start_);
- }
- if (isDouble)
- return decodeDouble(token, decoded);
// Attempts to parse the number as an integer. If the number is
// larger than the maximum supported value of an integer then
// we decode the number as a double.
@@ -518,6 +553,7 @@ bool Reader::decodeNumber(Token& token, Value& decoded) {
bool isNegative = *current == '-';
if (isNegative)
++current;
+ // TODO: Help the compiler do the div and mod at compile time or get rid of them.
Value::LargestUInt maxIntegerValue =
isNegative ? Value::LargestUInt(-Value::minLargestInt)
: Value::maxLargestUInt;
@@ -526,9 +562,7 @@ bool Reader::decodeNumber(Token& token, Value& decoded) {
while (current < token.end_) {
Char c = *current++;
if (c < '0' || c > '9')
- return addError("'" + std::string(token.start_, token.end_) +
- "' is not a number.",
- token);
+ return decodeDouble(token, decoded);
Value::UInt digit(c - '0');
if (value >= threshold) {
// We've hit or exceeded the max value divided by 10 (rounded down). If
@@ -555,7 +589,7 @@ bool Reader::decodeDouble(Token& token) {
Value decoded;
if (!decodeDouble(token, decoded))
return false;
- currentValue() = decoded;
+ currentValue().swapPayload(decoded);
currentValue().setOffsetStart(token.start_ - begin_);
currentValue().setOffsetLimit(token.end_ - begin_);
return true;
@@ -563,6 +597,945 @@ bool Reader::decodeDouble(Token& token) {
bool Reader::decodeDouble(Token& token, Value& decoded) {
double value = 0;
+ std::string buffer(token.start_, token.end_);
+ std::istringstream is(buffer);
+ if (!(is >> value))
+ return addError("'" + std::string(token.start_, token.end_) +
+ "' is not a number.",
+ token);
+ decoded = value;
+ return true;
+}
+
+bool Reader::decodeString(Token& token) {
+ std::string decoded_string;
+ if (!decodeString(token, decoded_string))
+ return false;
+ Value decoded(decoded_string);
+ currentValue().swapPayload(decoded);
+ currentValue().setOffsetStart(token.start_ - begin_);
+ currentValue().setOffsetLimit(token.end_ - begin_);
+ return true;
+}
+
+bool Reader::decodeString(Token& token, std::string& decoded) {
+ decoded.reserve(token.end_ - token.start_ - 2);
+ Location current = token.start_ + 1; // skip '"'
+ Location end = token.end_ - 1; // do not include '"'
+ while (current != end) {
+ Char c = *current++;
+ if (c == '"')
+ break;
+ else if (c == '\\') {
+ if (current == end)
+ return addError("Empty escape sequence in string", token, current);
+ Char escape = *current++;
+ switch (escape) {
+ case '"':
+ decoded += '"';
+ break;
+ case '/':
+ decoded += '/';
+ break;
+ case '\\':
+ decoded += '\\';
+ break;
+ case 'b':
+ decoded += '\b';
+ break;
+ case 'f':
+ decoded += '\f';
+ break;
+ case 'n':
+ decoded += '\n';
+ break;
+ case 'r':
+ decoded += '\r';
+ break;
+ case 't':
+ decoded += '\t';
+ break;
+ case 'u': {
+ unsigned int unicode;
+ if (!decodeUnicodeCodePoint(token, current, end, unicode))
+ return false;
+ decoded += codePointToUTF8(unicode);
+ } break;
+ default:
+ return addError("Bad escape sequence in string", token, current);
+ }
+ } else {
+ decoded += c;
+ }
+ }
+ return true;
+}
+
+bool Reader::decodeUnicodeCodePoint(Token& token,
+ Location& current,
+ Location end,
+ unsigned int& unicode) {
+
+ if (!decodeUnicodeEscapeSequence(token, current, end, unicode))
+ return false;
+ if (unicode >= 0xD800 && unicode <= 0xDBFF) {
+ // surrogate pairs
+ if (end - current < 6)
+ return addError(
+ "additional six characters expected to parse unicode surrogate pair.",
+ token,
+ current);
+ unsigned int surrogatePair;
+ if (*(current++) == '\\' && *(current++) == 'u') {
+ if (decodeUnicodeEscapeSequence(token, current, end, surrogatePair)) {
+ unicode = 0x10000 + ((unicode & 0x3FF) << 10) + (surrogatePair & 0x3FF);
+ } else
+ return false;
+ } else
+ return addError("expecting another \\u token to begin the second half of "
+ "a unicode surrogate pair",
+ token,
+ current);
+ }
+ return true;
+}
+
+bool Reader::decodeUnicodeEscapeSequence(Token& token,
+ Location& current,
+ Location end,
+ unsigned int& unicode) {
+ if (end - current < 4)
+ return addError(
+ "Bad unicode escape sequence in string: four digits expected.",
+ token,
+ current);
+ unicode = 0;
+ for (int index = 0; index < 4; ++index) {
+ Char c = *current++;
+ unicode *= 16;
+ if (c >= '0' && c <= '9')
+ unicode += c - '0';
+ else if (c >= 'a' && c <= 'f')
+ unicode += c - 'a' + 10;
+ else if (c >= 'A' && c <= 'F')
+ unicode += c - 'A' + 10;
+ else
+ return addError(
+ "Bad unicode escape sequence in string: hexadecimal digit expected.",
+ token,
+ current);
+ }
+ return true;
+}
+
+bool
+Reader::addError(const std::string& message, Token& token, Location extra) {
+ ErrorInfo info;
+ info.token_ = token;
+ info.message_ = message;
+ info.extra_ = extra;
+ errors_.push_back(info);
+ return false;
+}
+
+bool Reader::recoverFromError(TokenType skipUntilToken) {
+ int errorCount = int(errors_.size());
+ Token skip;
+ for (;;) {
+ if (!readToken(skip))
+ errors_.resize(errorCount); // discard errors caused by recovery
+ if (skip.type_ == skipUntilToken || skip.type_ == tokenEndOfStream)
+ break;
+ }
+ errors_.resize(errorCount);
+ return false;
+}
+
+bool Reader::addErrorAndRecover(const std::string& message,
+ Token& token,
+ TokenType skipUntilToken) {
+ addError(message, token);
+ return recoverFromError(skipUntilToken);
+}
+
+Value& Reader::currentValue() { return *(nodes_.top()); }
+
+Reader::Char Reader::getNextChar() {
+ if (current_ == end_)
+ return 0;
+ return *current_++;
+}
+
+void Reader::getLocationLineAndColumn(Location location,
+ int& line,
+ int& column) const {
+ Location current = begin_;
+ Location lastLineStart = current;
+ line = 0;
+ while (current < location && current != end_) {
+ Char c = *current++;
+ if (c == '\r') {
+ if (*current == '\n')
+ ++current;
+ lastLineStart = current;
+ ++line;
+ } else if (c == '\n') {
+ lastLineStart = current;
+ ++line;
+ }
+ }
+ // column & line start at 1
+ column = int(location - lastLineStart) + 1;
+ ++line;
+}
+
+std::string Reader::getLocationLineAndColumn(Location location) const {
+ int line, column;
+ getLocationLineAndColumn(location, line, column);
+ char buffer[18 + 16 + 16 + 1];
+#if defined(_MSC_VER) && defined(__STDC_SECURE_LIB__)
+#if defined(WINCE)
+ _snprintf(buffer, sizeof(buffer), "Line %d, Column %d", line, column);
+#else
+ sprintf_s(buffer, sizeof(buffer), "Line %d, Column %d", line, column);
+#endif
+#else
+ snprintf(buffer, sizeof(buffer), "Line %d, Column %d", line, column);
+#endif
+ return buffer;
+}
+
+// Deprecated. Preserved for backward compatibility
+std::string Reader::getFormatedErrorMessages() const {
+ return getFormattedErrorMessages();
+}
+
+std::string Reader::getFormattedErrorMessages() const {
+ std::string formattedMessage;
+ for (Errors::const_iterator itError = errors_.begin();
+ itError != errors_.end();
+ ++itError) {
+ const ErrorInfo& error = *itError;
+ formattedMessage +=
+ "* " + getLocationLineAndColumn(error.token_.start_) + "\n";
+ formattedMessage += " " + error.message_ + "\n";
+ if (error.extra_)
+ formattedMessage +=
+ "See " + getLocationLineAndColumn(error.extra_) + " for detail.\n";
+ }
+ return formattedMessage;
+}
+
+std::vector<Reader::StructuredError> Reader::getStructuredErrors() const {
+ std::vector<Reader::StructuredError> allErrors;
+ for (Errors::const_iterator itError = errors_.begin();
+ itError != errors_.end();
+ ++itError) {
+ const ErrorInfo& error = *itError;
+ Reader::StructuredError structured;
+ structured.offset_start = error.token_.start_ - begin_;
+ structured.offset_limit = error.token_.end_ - begin_;
+ structured.message = error.message_;
+ allErrors.push_back(structured);
+ }
+ return allErrors;
+}
+
+bool Reader::pushError(const Value& value, const std::string& message) {
+ size_t length = end_ - begin_;
+ if(value.getOffsetStart() > length
+ || value.getOffsetLimit() > length)
+ return false;
+ Token token;
+ token.type_ = tokenError;
+ token.start_ = begin_ + value.getOffsetStart();
+ token.end_ = end_ + value.getOffsetLimit();
+ ErrorInfo info;
+ info.token_ = token;
+ info.message_ = message;
+ info.extra_ = 0;
+ errors_.push_back(info);
+ return true;
+}
+
+bool Reader::pushError(const Value& value, const std::string& message, const Value& extra) {
+ size_t length = end_ - begin_;
+ if(value.getOffsetStart() > length
+ || value.getOffsetLimit() > length
+ || extra.getOffsetLimit() > length)
+ return false;
+ Token token;
+ token.type_ = tokenError;
+ token.start_ = begin_ + value.getOffsetStart();
+ token.end_ = begin_ + value.getOffsetLimit();
+ ErrorInfo info;
+ info.token_ = token;
+ info.message_ = message;
+ info.extra_ = begin_ + extra.getOffsetStart();
+ errors_.push_back(info);
+ return true;
+}
+
+bool Reader::good() const {
+ return !errors_.size();
+}
+
+// exact copy of Features
+class OurFeatures {
+public:
+ static OurFeatures all();
+ OurFeatures();
+ bool allowComments_;
+ bool strictRoot_;
+ bool allowDroppedNullPlaceholders_;
+ bool allowNumericKeys_;
+ bool allowSingleQuotes_;
+ bool failIfExtra_;
+ bool rejectDupKeys_;
+ int stackLimit_;
+}; // OurFeatures
+
+// exact copy of Implementation of class Features
+// ////////////////////////////////
+
+OurFeatures::OurFeatures()
+ : allowComments_(true), strictRoot_(false)
+ , allowDroppedNullPlaceholders_(false), allowNumericKeys_(false)
+ , allowSingleQuotes_(false)
+ , failIfExtra_(false)
+{
+}
+
+OurFeatures OurFeatures::all() { return OurFeatures(); }
+
+// Implementation of class Reader
+// ////////////////////////////////
+
+// exact copy of Reader, renamed to OurReader
+class OurReader {
+public:
+ typedef char Char;
+ typedef const Char* Location;
+ struct StructuredError {
+ size_t offset_start;
+ size_t offset_limit;
+ std::string message;
+ };
+
+ OurReader(OurFeatures const& features);
+ bool parse(const char* beginDoc,
+ const char* endDoc,
+ Value& root,
+ bool collectComments = true);
+ std::string getFormattedErrorMessages() const;
+ std::vector<StructuredError> getStructuredErrors() const;
+ bool pushError(const Value& value, const std::string& message);
+ bool pushError(const Value& value, const std::string& message, const Value& extra);
+ bool good() const;
+
+private:
+ OurReader(OurReader const&); // no impl
+ void operator=(OurReader const&); // no impl
+
+ enum TokenType {
+ tokenEndOfStream = 0,
+ tokenObjectBegin,
+ tokenObjectEnd,
+ tokenArrayBegin,
+ tokenArrayEnd,
+ tokenString,
+ tokenNumber,
+ tokenTrue,
+ tokenFalse,
+ tokenNull,
+ tokenArraySeparator,
+ tokenMemberSeparator,
+ tokenComment,
+ tokenError
+ };
+
+ class Token {
+ public:
+ TokenType type_;
+ Location start_;
+ Location end_;
+ };
+
+ class ErrorInfo {
+ public:
+ Token token_;
+ std::string message_;
+ Location extra_;
+ };
+
+ typedef std::deque<ErrorInfo> Errors;
+
+ bool readToken(Token& token);
+ void skipSpaces();
+ bool match(Location pattern, int patternLength);
+ bool readComment();
+ bool readCStyleComment();
+ bool readCppStyleComment();
+ bool readString();
+ bool readStringSingleQuote();
+ void readNumber();
+ bool readValue();
+ bool readObject(Token& token);
+ bool readArray(Token& token);
+ bool decodeNumber(Token& token);
+ bool decodeNumber(Token& token, Value& decoded);
+ bool decodeString(Token& token);
+ bool decodeString(Token& token, std::string& decoded);
+ bool decodeDouble(Token& token);
+ bool decodeDouble(Token& token, Value& decoded);
+ bool decodeUnicodeCodePoint(Token& token,
+ Location& current,
+ Location end,
+ unsigned int& unicode);
+ bool decodeUnicodeEscapeSequence(Token& token,
+ Location& current,
+ Location end,
+ unsigned int& unicode);
+ bool addError(const std::string& message, Token& token, Location extra = 0);
+ bool recoverFromError(TokenType skipUntilToken);
+ bool addErrorAndRecover(const std::string& message,
+ Token& token,
+ TokenType skipUntilToken);
+ void skipUntilSpace();
+ Value& currentValue();
+ Char getNextChar();
+ void
+ getLocationLineAndColumn(Location location, int& line, int& column) const;
+ std::string getLocationLineAndColumn(Location location) const;
+ void addComment(Location begin, Location end, CommentPlacement placement);
+ void skipCommentTokens(Token& token);
+
+ typedef std::stack<Value*> Nodes;
+ Nodes nodes_;
+ Errors errors_;
+ std::string document_;
+ Location begin_;
+ Location end_;
+ Location current_;
+ Location lastValueEnd_;
+ Value* lastValue_;
+ std::string commentsBefore_;
+ int stackDepth_;
+
+ OurFeatures const features_;
+ bool collectComments_;
+}; // OurReader
+
+// complete copy of Read impl, for OurReader
+
+OurReader::OurReader(OurFeatures const& features)
+ : errors_(), document_(), begin_(), end_(), current_(), lastValueEnd_(),
+ lastValue_(), commentsBefore_(), features_(features), collectComments_() {
+}
+
+bool OurReader::parse(const char* beginDoc,
+ const char* endDoc,
+ Value& root,
+ bool collectComments) {
+ if (!features_.allowComments_) {
+ collectComments = false;
+ }
+
+ begin_ = beginDoc;
+ end_ = endDoc;
+ collectComments_ = collectComments;
+ current_ = begin_;
+ lastValueEnd_ = 0;
+ lastValue_ = 0;
+ commentsBefore_ = "";
+ errors_.clear();
+ while (!nodes_.empty())
+ nodes_.pop();
+ nodes_.push(&root);
+
+ stackDepth_ = 0;
+ bool successful = readValue();
+ Token token;
+ skipCommentTokens(token);
+ if (features_.failIfExtra_) {
+ if (token.type_ != tokenError && token.type_ != tokenEndOfStream) {
+ addError("Extra non-whitespace after JSON value.", token);
+ return false;
+ }
+ }
+ if (collectComments_ && !commentsBefore_.empty())
+ root.setComment(commentsBefore_, commentAfter);
+ if (features_.strictRoot_) {
+ if (!root.isArray() && !root.isObject()) {
+ // Set error location to start of doc, ideally should be first token found
+ // in doc
+ token.type_ = tokenError;
+ token.start_ = beginDoc;
+ token.end_ = endDoc;
+ addError(
+ "A valid JSON document must be either an array or an object value.",
+ token);
+ return false;
+ }
+ }
+ return successful;
+}
+
+bool OurReader::readValue() {
+ if (stackDepth_ >= features_.stackLimit_) throwRuntimeError("Exceeded stackLimit in readValue().");
+ ++stackDepth_;
+ Token token;
+ skipCommentTokens(token);
+ bool successful = true;
+
+ if (collectComments_ && !commentsBefore_.empty()) {
+ currentValue().setComment(commentsBefore_, commentBefore);
+ commentsBefore_ = "";
+ }
+
+ switch (token.type_) {
+ case tokenObjectBegin:
+ successful = readObject(token);
+ currentValue().setOffsetLimit(current_ - begin_);
+ break;
+ case tokenArrayBegin:
+ successful = readArray(token);
+ currentValue().setOffsetLimit(current_ - begin_);
+ break;
+ case tokenNumber:
+ successful = decodeNumber(token);
+ break;
+ case tokenString:
+ successful = decodeString(token);
+ break;
+ case tokenTrue:
+ {
+ Value v(true);
+ currentValue().swapPayload(v);
+ currentValue().setOffsetStart(token.start_ - begin_);
+ currentValue().setOffsetLimit(token.end_ - begin_);
+ }
+ break;
+ case tokenFalse:
+ {
+ Value v(false);
+ currentValue().swapPayload(v);
+ currentValue().setOffsetStart(token.start_ - begin_);
+ currentValue().setOffsetLimit(token.end_ - begin_);
+ }
+ break;
+ case tokenNull:
+ {
+ Value v;
+ currentValue().swapPayload(v);
+ currentValue().setOffsetStart(token.start_ - begin_);
+ currentValue().setOffsetLimit(token.end_ - begin_);
+ }
+ break;
+ case tokenArraySeparator:
+ case tokenObjectEnd:
+ case tokenArrayEnd:
+ if (features_.allowDroppedNullPlaceholders_) {
+ // "Un-read" the current token and mark the current value as a null
+ // token.
+ current_--;
+ Value v;
+ currentValue().swapPayload(v);
+ currentValue().setOffsetStart(current_ - begin_ - 1);
+ currentValue().setOffsetLimit(current_ - begin_);
+ break;
+ } // else, fall through ...
+ default:
+ currentValue().setOffsetStart(token.start_ - begin_);
+ currentValue().setOffsetLimit(token.end_ - begin_);
+ return addError("Syntax error: value, object or array expected.", token);
+ }
+
+ if (collectComments_) {
+ lastValueEnd_ = current_;
+ lastValue_ = &currentValue();
+ }
+
+ --stackDepth_;
+ return successful;
+}
+
+void OurReader::skipCommentTokens(Token& token) {
+ if (features_.allowComments_) {
+ do {
+ readToken(token);
+ } while (token.type_ == tokenComment);
+ } else {
+ readToken(token);
+ }
+}
+
+bool OurReader::readToken(Token& token) {
+ skipSpaces();
+ token.start_ = current_;
+ Char c = getNextChar();
+ bool ok = true;
+ switch (c) {
+ case '{':
+ token.type_ = tokenObjectBegin;
+ break;
+ case '}':
+ token.type_ = tokenObjectEnd;
+ break;
+ case '[':
+ token.type_ = tokenArrayBegin;
+ break;
+ case ']':
+ token.type_ = tokenArrayEnd;
+ break;
+ case '"':
+ token.type_ = tokenString;
+ ok = readString();
+ break;
+ case '\'':
+ if (features_.allowSingleQuotes_) {
+ token.type_ = tokenString;
+ ok = readStringSingleQuote();
+ break;
+ } // else continue
+ case '/':
+ token.type_ = tokenComment;
+ ok = readComment();
+ break;
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '-':
+ token.type_ = tokenNumber;
+ readNumber();
+ break;
+ case 't':
+ token.type_ = tokenTrue;
+ ok = match("rue", 3);
+ break;
+ case 'f':
+ token.type_ = tokenFalse;
+ ok = match("alse", 4);
+ break;
+ case 'n':
+ token.type_ = tokenNull;
+ ok = match("ull", 3);
+ break;
+ case ',':
+ token.type_ = tokenArraySeparator;
+ break;
+ case ':':
+ token.type_ = tokenMemberSeparator;
+ break;
+ case 0:
+ token.type_ = tokenEndOfStream;
+ break;
+ default:
+ ok = false;
+ break;
+ }
+ if (!ok)
+ token.type_ = tokenError;
+ token.end_ = current_;
+ return true;
+}
+
+void OurReader::skipSpaces() {
+ while (current_ != end_) {
+ Char c = *current_;
+ if (c == ' ' || c == '\t' || c == '\r' || c == '\n')
+ ++current_;
+ else
+ break;
+ }
+}
+
+bool OurReader::match(Location pattern, int patternLength) {
+ if (end_ - current_ < patternLength)
+ return false;
+ int index = patternLength;
+ while (index--)
+ if (current_[index] != pattern[index])
+ return false;
+ current_ += patternLength;
+ return true;
+}
+
+bool OurReader::readComment() {
+ Location commentBegin = current_ - 1;
+ Char c = getNextChar();
+ bool successful = false;
+ if (c == '*')
+ successful = readCStyleComment();
+ else if (c == '/')
+ successful = readCppStyleComment();
+ if (!successful)
+ return false;
+
+ if (collectComments_) {
+ CommentPlacement placement = commentBefore;
+ if (lastValueEnd_ && !containsNewLine(lastValueEnd_, commentBegin)) {
+ if (c != '*' || !containsNewLine(commentBegin, current_))
+ placement = commentAfterOnSameLine;
+ }
+
+ addComment(commentBegin, current_, placement);
+ }
+ return true;
+}
+
+void
+OurReader::addComment(Location begin, Location end, CommentPlacement placement) {
+ assert(collectComments_);
+ const std::string& normalized = normalizeEOL(begin, end);
+ if (placement == commentAfterOnSameLine) {
+ assert(lastValue_ != 0);
+ lastValue_->setComment(normalized, placement);
+ } else {
+ commentsBefore_ += normalized;
+ }
+}
+
+bool OurReader::readCStyleComment() {
+ while (current_ != end_) {
+ Char c = getNextChar();
+ if (c == '*' && *current_ == '/')
+ break;
+ }
+ return getNextChar() == '/';
+}
+
+bool OurReader::readCppStyleComment() {
+ while (current_ != end_) {
+ Char c = getNextChar();
+ if (c == '\n')
+ break;
+ if (c == '\r') {
+ // Consume DOS EOL. It will be normalized in addComment.
+ if (current_ != end_ && *current_ == '\n')
+ getNextChar();
+ // Break on Moc OS 9 EOL.
+ break;
+ }
+ }
+ return true;
+}
+
+void OurReader::readNumber() {
+ const char *p = current_;
+ char c = '0'; // stopgap for already consumed character
+ // integral part
+ while (c >= '0' && c <= '9')
+ c = (current_ = p) < end_ ? *p++ : 0;
+ // fractional part
+ if (c == '.') {
+ c = (current_ = p) < end_ ? *p++ : 0;
+ while (c >= '0' && c <= '9')
+ c = (current_ = p) < end_ ? *p++ : 0;
+ }
+ // exponential part
+ if (c == 'e' || c == 'E') {
+ c = (current_ = p) < end_ ? *p++ : 0;
+ if (c == '+' || c == '-')
+ c = (current_ = p) < end_ ? *p++ : 0;
+ while (c >= '0' && c <= '9')
+ c = (current_ = p) < end_ ? *p++ : 0;
+ }
+}
+bool OurReader::readString() {
+ Char c = 0;
+ while (current_ != end_) {
+ c = getNextChar();
+ if (c == '\\')
+ getNextChar();
+ else if (c == '"')
+ break;
+ }
+ return c == '"';
+}
+
+
+bool OurReader::readStringSingleQuote() {
+ Char c = 0;
+ while (current_ != end_) {
+ c = getNextChar();
+ if (c == '\\')
+ getNextChar();
+ else if (c == '\'')
+ break;
+ }
+ return c == '\'';
+}
+
+bool OurReader::readObject(Token& tokenStart) {
+ Token tokenName;
+ std::string name;
+ Value init(objectValue);
+ currentValue().swapPayload(init);
+ currentValue().setOffsetStart(tokenStart.start_ - begin_);
+ while (readToken(tokenName)) {
+ bool initialTokenOk = true;
+ while (tokenName.type_ == tokenComment && initialTokenOk)
+ initialTokenOk = readToken(tokenName);
+ if (!initialTokenOk)
+ break;
+ if (tokenName.type_ == tokenObjectEnd && name.empty()) // empty object
+ return true;
+ name = "";
+ if (tokenName.type_ == tokenString) {
+ if (!decodeString(tokenName, name))
+ return recoverFromError(tokenObjectEnd);
+ } else if (tokenName.type_ == tokenNumber && features_.allowNumericKeys_) {
+ Value numberName;
+ if (!decodeNumber(tokenName, numberName))
+ return recoverFromError(tokenObjectEnd);
+ name = numberName.asString();
+ } else {
+ break;
+ }
+
+ Token colon;
+ if (!readToken(colon) || colon.type_ != tokenMemberSeparator) {
+ return addErrorAndRecover(
+ "Missing ':' after object member name", colon, tokenObjectEnd);
+ }
+ if (name.length() >= (1U<<30)) throwRuntimeError("keylength >= 2^30");
+ if (features_.rejectDupKeys_ && currentValue().isMember(name)) {
+ std::string msg = "Duplicate key: '" + name + "'";
+ return addErrorAndRecover(
+ msg, tokenName, tokenObjectEnd);
+ }
+ Value& value = currentValue()[name];
+ nodes_.push(&value);
+ bool ok = readValue();
+ nodes_.pop();
+ if (!ok) // error already set
+ return recoverFromError(tokenObjectEnd);
+
+ Token comma;
+ if (!readToken(comma) ||
+ (comma.type_ != tokenObjectEnd && comma.type_ != tokenArraySeparator &&
+ comma.type_ != tokenComment)) {
+ return addErrorAndRecover(
+ "Missing ',' or '}' in object declaration", comma, tokenObjectEnd);
+ }
+ bool finalizeTokenOk = true;
+ while (comma.type_ == tokenComment && finalizeTokenOk)
+ finalizeTokenOk = readToken(comma);
+ if (comma.type_ == tokenObjectEnd)
+ return true;
+ }
+ return addErrorAndRecover(
+ "Missing '}' or object member name", tokenName, tokenObjectEnd);
+}
+
+bool OurReader::readArray(Token& tokenStart) {
+ Value init(arrayValue);
+ currentValue().swapPayload(init);
+ currentValue().setOffsetStart(tokenStart.start_ - begin_);
+ skipSpaces();
+ if (*current_ == ']') // empty array
+ {
+ Token endArray;
+ readToken(endArray);
+ return true;
+ }
+ int index = 0;
+ for (;;) {
+ Value& value = currentValue()[index++];
+ nodes_.push(&value);
+ bool ok = readValue();
+ nodes_.pop();
+ if (!ok) // error already set
+ return recoverFromError(tokenArrayEnd);
+
+ Token token;
+ // Accept Comment after last item in the array.
+ ok = readToken(token);
+ while (token.type_ == tokenComment && ok) {
+ ok = readToken(token);
+ }
+ bool badTokenType =
+ (token.type_ != tokenArraySeparator && token.type_ != tokenArrayEnd);
+ if (!ok || badTokenType) {
+ return addErrorAndRecover(
+ "Missing ',' or ']' in array declaration", token, tokenArrayEnd);
+ }
+ if (token.type_ == tokenArrayEnd)
+ break;
+ }
+ return true;
+}
+
+bool OurReader::decodeNumber(Token& token) {
+ Value decoded;
+ if (!decodeNumber(token, decoded))
+ return false;
+ currentValue().swapPayload(decoded);
+ currentValue().setOffsetStart(token.start_ - begin_);
+ currentValue().setOffsetLimit(token.end_ - begin_);
+ return true;
+}
+
+bool OurReader::decodeNumber(Token& token, Value& decoded) {
+ // Attempts to parse the number as an integer. If the number is
+ // larger than the maximum supported value of an integer then
+ // we decode the number as a double.
+ Location current = token.start_;
+ bool isNegative = *current == '-';
+ if (isNegative)
+ ++current;
+ // TODO: Help the compiler do the div and mod at compile time or get rid of them.
+ Value::LargestUInt maxIntegerValue =
+ isNegative ? Value::LargestUInt(-Value::minLargestInt)
+ : Value::maxLargestUInt;
+ Value::LargestUInt threshold = maxIntegerValue / 10;
+ Value::LargestUInt value = 0;
+ while (current < token.end_) {
+ Char c = *current++;
+ if (c < '0' || c > '9')
+ return decodeDouble(token, decoded);
+ Value::UInt digit(c - '0');
+ if (value >= threshold) {
+ // We've hit or exceeded the max value divided by 10 (rounded down). If
+ // a) we've only just touched the limit, b) this is the last digit, and
+ // c) it's small enough to fit in that rounding delta, we're okay.
+ // Otherwise treat this number as a double to avoid overflow.
+ if (value > threshold || current != token.end_ ||
+ digit > maxIntegerValue % 10) {
+ return decodeDouble(token, decoded);
+ }
+ }
+ value = value * 10 + digit;
+ }
+ if (isNegative)
+ decoded = -Value::LargestInt(value);
+ else if (value <= Value::LargestUInt(Value::maxInt))
+ decoded = Value::LargestInt(value);
+ else
+ decoded = value;
+ return true;
+}
+
+bool OurReader::decodeDouble(Token& token) {
+ Value decoded;
+ if (!decodeDouble(token, decoded))
+ return false;
+ currentValue().swapPayload(decoded);
+ currentValue().setOffsetStart(token.start_ - begin_);
+ currentValue().setOffsetLimit(token.end_ - begin_);
+ return true;
+}
+
+bool OurReader::decodeDouble(Token& token, Value& decoded) {
+ double value = 0;
const int bufferSize = 32;
int count;
int length = int(token.end_ - token.start_);
@@ -597,17 +1570,18 @@ bool Reader::decodeDouble(Token& token, Value& decoded) {
return true;
}
-bool Reader::decodeString(Token& token) {
- std::string decoded;
- if (!decodeString(token, decoded))
+bool OurReader::decodeString(Token& token) {
+ std::string decoded_string;
+ if (!decodeString(token, decoded_string))
return false;
- currentValue() = decoded;
+ Value decoded(decoded_string);
+ currentValue().swapPayload(decoded);
currentValue().setOffsetStart(token.start_ - begin_);
currentValue().setOffsetLimit(token.end_ - begin_);
return true;
}
-bool Reader::decodeString(Token& token, std::string& decoded) {
+bool OurReader::decodeString(Token& token, std::string& decoded) {
decoded.reserve(token.end_ - token.start_ - 2);
Location current = token.start_ + 1; // skip '"'
Location end = token.end_ - 1; // do not include '"'
@@ -660,7 +1634,7 @@ bool Reader::decodeString(Token& token, std::string& decoded) {
return true;
}
-bool Reader::decodeUnicodeCodePoint(Token& token,
+bool OurReader::decodeUnicodeCodePoint(Token& token,
Location& current,
Location end,
unsigned int& unicode) {
@@ -689,7 +1663,7 @@ bool Reader::decodeUnicodeCodePoint(Token& token,
return true;
}
-bool Reader::decodeUnicodeEscapeSequence(Token& token,
+bool OurReader::decodeUnicodeEscapeSequence(Token& token,
Location& current,
Location end,
unsigned int& unicode) {
@@ -718,7 +1692,7 @@ bool Reader::decodeUnicodeEscapeSequence(Token& token,
}
bool
-Reader::addError(const std::string& message, Token& token, Location extra) {
+OurReader::addError(const std::string& message, Token& token, Location extra) {
ErrorInfo info;
info.token_ = token;
info.message_ = message;
@@ -727,7 +1701,7 @@ Reader::addError(const std::string& message, Token& token, Location extra) {
return false;
}
-bool Reader::recoverFromError(TokenType skipUntilToken) {
+bool OurReader::recoverFromError(TokenType skipUntilToken) {
int errorCount = int(errors_.size());
Token skip;
for (;;) {
@@ -740,22 +1714,22 @@ bool Reader::recoverFromError(TokenType skipUntilToken) {
return false;
}
-bool Reader::addErrorAndRecover(const std::string& message,
+bool OurReader::addErrorAndRecover(const std::string& message,
Token& token,
TokenType skipUntilToken) {
addError(message, token);
return recoverFromError(skipUntilToken);
}
-Value& Reader::currentValue() { return *(nodes_.top()); }
+Value& OurReader::currentValue() { return *(nodes_.top()); }
-Reader::Char Reader::getNextChar() {
+OurReader::Char OurReader::getNextChar() {
if (current_ == end_)
return 0;
return *current_++;
}
-void Reader::getLocationLineAndColumn(Location location,
+void OurReader::getLocationLineAndColumn(Location location,
int& line,
int& column) const {
Location current = begin_;
@@ -778,7 +1752,7 @@ void Reader::getLocationLineAndColumn(Location location,
++line;
}
-std::string Reader::getLocationLineAndColumn(Location location) const {
+std::string OurReader::getLocationLineAndColumn(Location location) const {
int line, column;
getLocationLineAndColumn(location, line, column);
char buffer[18 + 16 + 16 + 1];
@@ -794,12 +1768,7 @@ std::string Reader::getLocationLineAndColumn(Location location) const {
return buffer;
}
-// Deprecated. Preserved for backward compatibility
-std::string Reader::getFormatedErrorMessages() const {
- return getFormattedErrorMessages();
-}
-
-std::string Reader::getFormattedErrorMessages() const {
+std::string OurReader::getFormattedErrorMessages() const {
std::string formattedMessage;
for (Errors::const_iterator itError = errors_.begin();
itError != errors_.end();
@@ -815,13 +1784,13 @@ std::string Reader::getFormattedErrorMessages() const {
return formattedMessage;
}
-std::vector<Reader::StructuredError> Reader::getStructuredErrors() const {
- std::vector<Reader::StructuredError> allErrors;
+std::vector<OurReader::StructuredError> OurReader::getStructuredErrors() const {
+ std::vector<OurReader::StructuredError> allErrors;
for (Errors::const_iterator itError = errors_.begin();
itError != errors_.end();
++itError) {
const ErrorInfo& error = *itError;
- Reader::StructuredError structured;
+ OurReader::StructuredError structured;
structured.offset_start = error.token_.start_ - begin_;
structured.offset_limit = error.token_.end_ - begin_;
structured.message = error.message_;
@@ -830,7 +1799,7 @@ std::vector<Reader::StructuredError> Reader::getStructuredErrors() const {
return allErrors;
}
-bool Reader::pushError(const Value& value, const std::string& message) {
+bool OurReader::pushError(const Value& value, const std::string& message) {
size_t length = end_ - begin_;
if(value.getOffsetStart() > length
|| value.getOffsetLimit() > length)
@@ -847,7 +1816,7 @@ bool Reader::pushError(const Value& value, const std::string& message) {
return true;
}
-bool Reader::pushError(const Value& value, const std::string& message, const Value& extra) {
+bool OurReader::pushError(const Value& value, const std::string& message, const Value& extra) {
size_t length = end_ - begin_;
if(value.getOffsetStart() > length
|| value.getOffsetLimit() > length
@@ -865,19 +1834,142 @@ bool Reader::pushError(const Value& value, const std::string& message, const Val
return true;
}
-bool Reader::good() const {
+bool OurReader::good() const {
return !errors_.size();
}
+
+class OurCharReader : public CharReader {
+ bool const collectComments_;
+ OurReader reader_;
+public:
+ OurCharReader(
+ bool collectComments,
+ OurFeatures const& features)
+ : collectComments_(collectComments)
+ , reader_(features)
+ {}
+ virtual bool parse(
+ char const* beginDoc, char const* endDoc,
+ Value* root, std::string* errs) {
+ bool ok = reader_.parse(beginDoc, endDoc, *root, collectComments_);
+ if (errs) {
+ *errs = reader_.getFormattedErrorMessages();
+ }
+ return ok;
+ }
+};
+
+CharReaderBuilder::CharReaderBuilder()
+{
+ setDefaults(&settings_);
+}
+CharReaderBuilder::~CharReaderBuilder()
+{}
+CharReader* CharReaderBuilder::newCharReader() const
+{
+ bool collectComments = settings_["collectComments"].asBool();
+ OurFeatures features = OurFeatures::all();
+ features.allowComments_ = settings_["allowComments"].asBool();
+ features.strictRoot_ = settings_["strictRoot"].asBool();
+ features.allowDroppedNullPlaceholders_ = settings_["allowDroppedNullPlaceholders"].asBool();
+ features.allowNumericKeys_ = settings_["allowNumericKeys"].asBool();
+ features.allowSingleQuotes_ = settings_["allowSingleQuotes"].asBool();
+ features.stackLimit_ = settings_["stackLimit"].asInt();
+ features.failIfExtra_ = settings_["failIfExtra"].asBool();
+ features.rejectDupKeys_ = settings_["rejectDupKeys"].asBool();
+ return new OurCharReader(collectComments, features);
+}
+static void getValidReaderKeys(std::set<std::string>* valid_keys)
+{
+ valid_keys->clear();
+ valid_keys->insert("collectComments");
+ valid_keys->insert("allowComments");
+ valid_keys->insert("strictRoot");
+ valid_keys->insert("allowDroppedNullPlaceholders");
+ valid_keys->insert("allowNumericKeys");
+ valid_keys->insert("allowSingleQuotes");
+ valid_keys->insert("stackLimit");
+ valid_keys->insert("failIfExtra");
+ valid_keys->insert("rejectDupKeys");
+}
+bool CharReaderBuilder::validate(Json::Value* invalid) const
+{
+ Json::Value my_invalid;
+ if (!invalid) invalid = &my_invalid; // so we do not need to test for NULL
+ Json::Value& inv = *invalid;
+ std::set<std::string> valid_keys;
+ getValidReaderKeys(&valid_keys);
+ Value::Members keys = settings_.getMemberNames();
+ size_t n = keys.size();
+ for (size_t i = 0; i < n; ++i) {
+ std::string const& key = keys[i];
+ if (valid_keys.find(key) == valid_keys.end()) {
+ inv[key] = settings_[key];
+ }
+ }
+ return 0u == inv.size();
+}
+Value& CharReaderBuilder::operator[](std::string key)
+{
+ return settings_[key];
+}
+// static
+void CharReaderBuilder::strictMode(Json::Value* settings)
+{
+//! [CharReaderBuilderStrictMode]
+ (*settings)["allowComments"] = false;
+ (*settings)["strictRoot"] = true;
+ (*settings)["allowDroppedNullPlaceholders"] = false;
+ (*settings)["allowNumericKeys"] = false;
+ (*settings)["allowSingleQuotes"] = false;
+ (*settings)["failIfExtra"] = true;
+ (*settings)["rejectDupKeys"] = true;
+//! [CharReaderBuilderStrictMode]
+}
+// static
+void CharReaderBuilder::setDefaults(Json::Value* settings)
+{
+//! [CharReaderBuilderDefaults]
+ (*settings)["collectComments"] = true;
+ (*settings)["allowComments"] = true;
+ (*settings)["strictRoot"] = false;
+ (*settings)["allowDroppedNullPlaceholders"] = false;
+ (*settings)["allowNumericKeys"] = false;
+ (*settings)["allowSingleQuotes"] = false;
+ (*settings)["stackLimit"] = 1000;
+ (*settings)["failIfExtra"] = false;
+ (*settings)["rejectDupKeys"] = false;
+//! [CharReaderBuilderDefaults]
+}
+
+//////////////////////////////////
+// global functions
+
+bool parseFromStream(
+ CharReader::Factory const& fact, std::istream& sin,
+ Value* root, std::string* errs)
+{
+ std::ostringstream ssin;
+ ssin << sin.rdbuf();
+ std::string doc = ssin.str();
+ char const* begin = doc.data();
+ char const* end = begin + doc.size();
+ // Note that we do not actually need a null-terminator.
+ CharReaderPtr const reader(fact.newCharReader());
+ return reader->parse(begin, end, root, errs);
+}
+
std::istream& operator>>(std::istream& sin, Value& root) {
- Json::Reader reader;
- bool ok = reader.parse(sin, root, true);
+ CharReaderBuilder b;
+ std::string errs;
+ bool ok = parseFromStream(b, sin, &root, &errs);
if (!ok) {
fprintf(stderr,
"Error from reader: %s",
- reader.getFormattedErrorMessages().c_str());
+ errs.c_str());
- JSON_FAIL_MESSAGE("reader error");
+ throwRuntimeError("reader error");
}
return sin;
}
diff --git a/3rdparty/jsoncpp/src/lib_json/json_value.cpp b/3rdparty/jsoncpp/src/lib_json/json_value.cpp
index b73deac1725..cc7d4d3d8ba 100644
--- a/3rdparty/jsoncpp/src/lib_json/json_value.cpp
+++ b/3rdparty/jsoncpp/src/lib_json/json_value.cpp
@@ -7,9 +7,6 @@
#include <json/assertions.h>
#include <json/value.h>
#include <json/writer.h>
-#ifndef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR
-#include "json_batchallocator.h"
-#endif // #ifndef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR
#endif // if !defined(JSON_IS_AMALGAMATION)
#include <math.h>
#include <sstream>
@@ -20,6 +17,7 @@
#include <cpptl/conststring.h>
#endif
#include <cstddef> // size_t
+#include <algorithm> // min()
#define JSON_ASSERT_UNREACHABLE assert(false)
@@ -36,6 +34,7 @@ namespace Json {
static const unsigned char ALIGNAS(8) kNull[sizeof(Value)] = { 0 };
const unsigned char& kNullRef = kNull[0];
const Value& Value::null = reinterpret_cast<const Value&>(kNullRef);
+const Value& Value::nullRef = null;
const Int Value::minInt = Int(~(UInt(-1) / 2));
const Int Value::maxInt = Int(UInt(-1) / 2);
@@ -53,9 +52,6 @@ const LargestInt Value::minLargestInt = LargestInt(~(LargestUInt(-1) / 2));
const LargestInt Value::maxLargestInt = LargestInt(LargestUInt(-1) / 2);
const LargestUInt Value::maxLargestUInt = LargestUInt(-1);
-/// Unknown size marker
-static const unsigned int unknown = (unsigned)-1;
-
#if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
template <typename T, typename U>
static inline bool InRange(double d, T min, U max) {
@@ -84,25 +80,59 @@ static inline bool InRange(double d, T min, U max) {
* @return Pointer on the duplicate instance of string.
*/
static inline char* duplicateStringValue(const char* value,
- unsigned int length = unknown) {
- if (length == unknown)
- length = (unsigned int)strlen(value);
-
+ size_t length) {
// Avoid an integer overflow in the call to malloc below by limiting length
// to a sane value.
- if (length >= (unsigned)Value::maxInt)
+ if (length >= (size_t)Value::maxInt)
length = Value::maxInt - 1;
char* newString = static_cast<char*>(malloc(length + 1));
- JSON_ASSERT_MESSAGE(newString != 0,
- "in Json::Value::duplicateStringValue(): "
- "Failed to allocate string value buffer");
+ if (newString == NULL) {
+ throwRuntimeError(
+ "in Json::Value::duplicateStringValue(): "
+ "Failed to allocate string value buffer");
+ }
memcpy(newString, value, length);
newString[length] = 0;
return newString;
}
-/** Free the string duplicated by duplicateStringValue().
+/* Record the length as a prefix.
+ */
+static inline char* duplicateAndPrefixStringValue(
+ const char* value,
+ unsigned int length)
+{
+ // Avoid an integer overflow in the call to malloc below by limiting length
+ // to a sane value.
+ JSON_ASSERT_MESSAGE(length <= (unsigned)Value::maxInt - sizeof(unsigned) - 1U,
+ "in Json::Value::duplicateAndPrefixStringValue(): "
+ "length too big for prefixing");
+ unsigned actualLength = length + sizeof(unsigned) + 1U;
+ char* newString = static_cast<char*>(malloc(actualLength));
+ if (newString == 0) {
+ throwRuntimeError(
+ "in Json::Value::duplicateAndPrefixStringValue(): "
+ "Failed to allocate string value buffer");
+ }
+ *reinterpret_cast<unsigned*>(newString) = length;
+ memcpy(newString + sizeof(unsigned), value, length);
+ newString[actualLength - 1U] = 0; // to avoid buffer over-run accidents by users later
+ return newString;
+}
+inline static void decodePrefixedString(
+ bool isPrefixed, char const* prefixed,
+ unsigned* length, char const** value)
+{
+ if (!isPrefixed) {
+ *length = static_cast<unsigned>(strlen(prefixed));
+ *value = prefixed;
+ } else {
+ *length = *reinterpret_cast<unsigned const*>(prefixed);
+ *value = prefixed + sizeof(unsigned);
+ }
+}
+/** Free the string duplicated by duplicateStringValue()/duplicateAndPrefixStringValue().
*/
static inline void releaseStringValue(char* value) { free(value); }
@@ -116,16 +146,53 @@ static inline void releaseStringValue(char* value) { free(value); }
// //////////////////////////////////////////////////////////////////
// //////////////////////////////////////////////////////////////////
#if !defined(JSON_IS_AMALGAMATION)
-#ifdef JSON_VALUE_USE_INTERNAL_MAP
-#include "json_internalarray.inl"
-#include "json_internalmap.inl"
-#endif // JSON_VALUE_USE_INTERNAL_MAP
#include "json_valueiterator.inl"
#endif // if !defined(JSON_IS_AMALGAMATION)
namespace Json {
+class JSON_API Exception : public std::exception {
+public:
+ Exception(std::string const& msg);
+ virtual ~Exception() throw();
+ virtual char const* what() const throw();
+protected:
+ std::string const msg_;
+};
+class JSON_API RuntimeError : public Exception {
+public:
+ RuntimeError(std::string const& msg);
+};
+class JSON_API LogicError : public Exception {
+public:
+ LogicError(std::string const& msg);
+};
+
+Exception::Exception(std::string const& msg)
+ : msg_(msg)
+{}
+Exception::~Exception() throw()
+{}
+char const* Exception::what() const throw()
+{
+ return msg_.c_str();
+}
+RuntimeError::RuntimeError(std::string const& msg)
+ : Exception(msg)
+{}
+LogicError::LogicError(std::string const& msg)
+ : Exception(msg)
+{}
+void throwRuntimeError(std::string const& msg)
+{
+ throw RuntimeError(msg);
+}
+void throwLogicError(std::string const& msg)
+{
+ throw LogicError(msg);
+}
+
// //////////////////////////////////////////////////////////////////
// //////////////////////////////////////////////////////////////////
// //////////////////////////////////////////////////////////////////
@@ -141,15 +208,17 @@ Value::CommentInfo::~CommentInfo() {
releaseStringValue(comment_);
}
-void Value::CommentInfo::setComment(const char* text) {
- if (comment_)
+void Value::CommentInfo::setComment(const char* text, size_t len) {
+ if (comment_) {
releaseStringValue(comment_);
+ comment_ = 0;
+ }
JSON_ASSERT(text != 0);
JSON_ASSERT_MESSAGE(
text[0] == '\0' || text[0] == '/',
"in Json::Value::setComment(): Comments must start with /");
// It seems that /**/ style comments are acceptable as well.
- comment_ = duplicateStringValue(text);
+ comment_ = duplicateStringValue(text, len);
}
// //////////////////////////////////////////////////////////////////
@@ -159,28 +228,34 @@ void Value::CommentInfo::setComment(const char* text) {
// //////////////////////////////////////////////////////////////////
// //////////////////////////////////////////////////////////////////
// //////////////////////////////////////////////////////////////////
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
-// Notes: index_ indicates if the string was allocated when
+// Notes: policy_ indicates if the string was allocated when
// a string is stored.
Value::CZString::CZString(ArrayIndex index) : cstr_(0), index_(index) {}
-Value::CZString::CZString(const char* cstr, DuplicationPolicy allocate)
- : cstr_(allocate == duplicate ? duplicateStringValue(cstr) : cstr),
- index_(allocate) {}
+Value::CZString::CZString(char const* str, unsigned length, DuplicationPolicy allocate)
+ : cstr_(str)
+{
+ // allocate != duplicate
+ storage_.policy_ = allocate;
+ storage_.length_ = length;
+}
Value::CZString::CZString(const CZString& other)
- : cstr_(other.index_ != noDuplication && other.cstr_ != 0
- ? duplicateStringValue(other.cstr_)
- : other.cstr_),
- index_(other.cstr_
- ? static_cast<ArrayIndex>(other.index_ == noDuplication
+ : cstr_(other.storage_.policy_ != noDuplication && other.cstr_ != 0
+ ? duplicateStringValue(other.cstr_, other.storage_.length_)
+ : other.cstr_)
+{
+ storage_.policy_ = (other.cstr_
+ ? (other.storage_.policy_ == noDuplication
? noDuplication : duplicate)
- : other.index_) {}
+ : other.storage_.policy_);
+ storage_.length_ = other.storage_.length_;
+}
Value::CZString::~CZString() {
- if (cstr_ && index_ == duplicate)
+ if (cstr_ && storage_.policy_ == duplicate)
releaseStringValue(const_cast<char*>(cstr_));
}
@@ -195,24 +270,35 @@ Value::CZString& Value::CZString::operator=(CZString other) {
}
bool Value::CZString::operator<(const CZString& other) const {
- if (cstr_)
- return strcmp(cstr_, other.cstr_) < 0;
- return index_ < other.index_;
+ if (!cstr_) return index_ < other.index_;
+ //return strcmp(cstr_, other.cstr_) < 0;
+ // Assume both are strings.
+ unsigned this_len = this->storage_.length_;
+ unsigned other_len = other.storage_.length_;
+ unsigned min_len = std::min(this_len, other_len);
+ int comp = memcmp(this->cstr_, other.cstr_, min_len);
+ if (comp < 0) return true;
+ if (comp > 0) return false;
+ return (this_len < other_len);
}
bool Value::CZString::operator==(const CZString& other) const {
- if (cstr_)
- return strcmp(cstr_, other.cstr_) == 0;
- return index_ == other.index_;
+ if (!cstr_) return index_ == other.index_;
+ //return strcmp(cstr_, other.cstr_) == 0;
+ // Assume both are strings.
+ unsigned this_len = this->storage_.length_;
+ unsigned other_len = other.storage_.length_;
+ if (this_len != other_len) return false;
+ int comp = memcmp(this->cstr_, other.cstr_, this_len);
+ return comp == 0;
}
ArrayIndex Value::CZString::index() const { return index_; }
-const char* Value::CZString::c_str() const { return cstr_; }
-
-bool Value::CZString::isStaticString() const { return index_ == noDuplication; }
-
-#endif // ifndef JSON_VALUE_USE_INTERNAL_MAP
+//const char* Value::CZString::c_str() const { return cstr_; }
+const char* Value::CZString::data() const { return cstr_; }
+unsigned Value::CZString::length() const { return storage_.length_; }
+bool Value::CZString::isStaticString() const { return storage_.policy_ == noDuplication; }
// //////////////////////////////////////////////////////////////////
// //////////////////////////////////////////////////////////////////
@@ -241,19 +327,10 @@ Value::Value(ValueType type) {
case stringValue:
value_.string_ = 0;
break;
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
case arrayValue:
case objectValue:
value_.map_ = new ObjectValues();
break;
-#else
- case arrayValue:
- value_.array_ = arrayAllocator()->newArray();
- break;
- case objectValue:
- value_.map_ = mapAllocator()->newMap();
- break;
-#endif
case booleanValue:
value_.bool_ = false;
break;
@@ -289,19 +366,19 @@ Value::Value(double value) {
Value::Value(const char* value) {
initBasic(stringValue, true);
- value_.string_ = duplicateStringValue(value);
+ value_.string_ = duplicateAndPrefixStringValue(value, static_cast<unsigned>(strlen(value)));
}
Value::Value(const char* beginValue, const char* endValue) {
initBasic(stringValue, true);
value_.string_ =
- duplicateStringValue(beginValue, (unsigned int)(endValue - beginValue));
+ duplicateAndPrefixStringValue(beginValue, static_cast<unsigned>(endValue - beginValue));
}
Value::Value(const std::string& value) {
initBasic(stringValue, true);
value_.string_ =
- duplicateStringValue(value.c_str(), (unsigned int)value.length());
+ duplicateAndPrefixStringValue(value.data(), static_cast<unsigned>(value.length()));
}
Value::Value(const StaticString& value) {
@@ -312,7 +389,7 @@ Value::Value(const StaticString& value) {
#ifdef JSON_USE_CPPTL
Value::Value(const CppTL::ConstString& value) {
initBasic(stringValue, true);
- value_.string_ = duplicateStringValue(value, value.length());
+ value_.string_ = duplicateAndPrefixStringValue(value, static_cast<unsigned>(value.length()));
}
#endif
@@ -321,14 +398,11 @@ Value::Value(bool value) {
value_.bool_ = value;
}
-Value::Value(const Value& other)
+Value::Value(Value const& other)
: type_(other.type_), allocated_(false)
-#ifdef JSON_VALUE_USE_INTERNAL_MAP
,
- itemIsUsed_(0)
-#endif
- ,
- comments_(0), start_(other.start_), limit_(other.limit_) {
+ comments_(0), start_(other.start_), limit_(other.limit_)
+{
switch (type_) {
case nullValue:
case intValue:
@@ -338,27 +412,22 @@ Value::Value(const Value& other)
value_ = other.value_;
break;
case stringValue:
- if (other.value_.string_) {
- value_.string_ = duplicateStringValue(other.value_.string_);
+ if (other.value_.string_ && other.allocated_) {
+ unsigned len;
+ char const* str;
+ decodePrefixedString(other.allocated_, other.value_.string_,
+ &len, &str);
+ value_.string_ = duplicateAndPrefixStringValue(str, len);
allocated_ = true;
} else {
- value_.string_ = 0;
+ value_.string_ = other.value_.string_;
allocated_ = false;
}
break;
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
case arrayValue:
case objectValue:
value_.map_ = new ObjectValues(*other.value_.map_);
break;
-#else
- case arrayValue:
- value_.array_ = arrayAllocator()->newArrayCopy(*other.value_.array_);
- break;
- case objectValue:
- value_.map_ = mapAllocator()->newMapCopy(*other.value_.map_);
- break;
-#endif
default:
JSON_ASSERT_UNREACHABLE;
}
@@ -367,7 +436,8 @@ Value::Value(const Value& other)
for (int comment = 0; comment < numberOfCommentPlacement; ++comment) {
const CommentInfo& otherComment = other.comments_[comment];
if (otherComment.comment_)
- comments_[comment].setComment(otherComment.comment_);
+ comments_[comment].setComment(
+ otherComment.comment_, strlen(otherComment.comment_));
}
}
}
@@ -384,19 +454,10 @@ Value::~Value() {
if (allocated_)
releaseStringValue(value_.string_);
break;
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
case arrayValue:
case objectValue:
delete value_.map_;
break;
-#else
- case arrayValue:
- arrayAllocator()->destructArray(value_.array_);
- break;
- case objectValue:
- mapAllocator()->destructMap(value_.map_);
- break;
-#endif
default:
JSON_ASSERT_UNREACHABLE;
}
@@ -410,7 +471,7 @@ Value& Value::operator=(Value other) {
return *this;
}
-void Value::swap(Value& other) {
+void Value::swapPayload(Value& other) {
ValueType temp = type_;
type_ = other.type_;
other.type_ = temp;
@@ -418,6 +479,11 @@ void Value::swap(Value& other) {
int temp2 = allocated_;
allocated_ = other.allocated_;
other.allocated_ = temp2;
+}
+
+void Value::swap(Value& other) {
+ swapPayload(other);
+ std::swap(comments_, other.comments_);
std::swap(start_, other.start_);
std::swap(limit_, other.limit_);
}
@@ -448,10 +514,23 @@ bool Value::operator<(const Value& other) const {
case booleanValue:
return value_.bool_ < other.value_.bool_;
case stringValue:
- return (value_.string_ == 0 && other.value_.string_) ||
- (other.value_.string_ && value_.string_ &&
- strcmp(value_.string_, other.value_.string_) < 0);
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
+ {
+ if ((value_.string_ == 0) || (other.value_.string_ == 0)) {
+ if (other.value_.string_) return true;
+ else return false;
+ }
+ unsigned this_len;
+ unsigned other_len;
+ char const* this_str;
+ char const* other_str;
+ decodePrefixedString(this->allocated_, this->value_.string_, &this_len, &this_str);
+ decodePrefixedString(other.allocated_, other.value_.string_, &other_len, &other_str);
+ unsigned min_len = std::min(this_len, other_len);
+ int comp = memcmp(this_str, other_str, min_len);
+ if (comp < 0) return true;
+ if (comp > 0) return false;
+ return (this_len < other_len);
+ }
case arrayValue:
case objectValue: {
int delta = int(value_.map_->size() - other.value_.map_->size());
@@ -459,12 +538,6 @@ bool Value::operator<(const Value& other) const {
return delta < 0;
return (*value_.map_) < (*other.value_.map_);
}
-#else
- case arrayValue:
- return value_.array_->compare(*(other.value_.array_)) < 0;
- case objectValue:
- return value_.map_->compare(*(other.value_.map_)) < 0;
-#endif
default:
JSON_ASSERT_UNREACHABLE;
}
@@ -497,20 +570,24 @@ bool Value::operator==(const Value& other) const {
case booleanValue:
return value_.bool_ == other.value_.bool_;
case stringValue:
- return (value_.string_ == other.value_.string_) ||
- (other.value_.string_ && value_.string_ &&
- strcmp(value_.string_, other.value_.string_) == 0);
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
+ {
+ if ((value_.string_ == 0) || (other.value_.string_ == 0)) {
+ return (value_.string_ == other.value_.string_);
+ }
+ unsigned this_len;
+ unsigned other_len;
+ char const* this_str;
+ char const* other_str;
+ decodePrefixedString(this->allocated_, this->value_.string_, &this_len, &this_str);
+ decodePrefixedString(other.allocated_, other.value_.string_, &other_len, &other_str);
+ if (this_len != other_len) return false;
+ int comp = memcmp(this_str, other_str, this_len);
+ return comp == 0;
+ }
case arrayValue:
case objectValue:
return value_.map_->size() == other.value_.map_->size() &&
(*value_.map_) == (*other.value_.map_);
-#else
- case arrayValue:
- return value_.array_->compare(*(other.value_.array_)) == 0;
- case objectValue:
- return value_.map_->compare(*(other.value_.map_)) == 0;
-#endif
default:
JSON_ASSERT_UNREACHABLE;
}
@@ -522,7 +599,20 @@ bool Value::operator!=(const Value& other) const { return !(*this == other); }
const char* Value::asCString() const {
JSON_ASSERT_MESSAGE(type_ == stringValue,
"in Json::Value::asCString(): requires stringValue");
- return value_.string_;
+ if (value_.string_ == 0) return 0;
+ unsigned this_len;
+ char const* this_str;
+ decodePrefixedString(this->allocated_, this->value_.string_, &this_len, &this_str);
+ return this_str;
+}
+
+bool Value::getString(char const** str, char const** end) const {
+ if (type_ != stringValue) return false;
+ if (value_.string_ == 0) return false;
+ unsigned length;
+ decodePrefixedString(this->allocated_, this->value_.string_, &length, str);
+ *end = *str + length;
+ return true;
}
std::string Value::asString() const {
@@ -530,7 +620,13 @@ std::string Value::asString() const {
case nullValue:
return "";
case stringValue:
- return value_.string_ ? value_.string_ : "";
+ {
+ if (value_.string_ == 0) return "";
+ unsigned this_len;
+ char const* this_str;
+ decodePrefixedString(this->allocated_, this->value_.string_, &this_len, &this_str);
+ return std::string(this_str, this_len);
+ }
case booleanValue:
return value_.bool_ ? "true" : "false";
case intValue:
@@ -546,7 +642,11 @@ std::string Value::asString() const {
#ifdef JSON_USE_CPPTL
CppTL::ConstString Value::asConstString() const {
- return CppTL::ConstString(asString().c_str());
+ unsigned len;
+ char const* str;
+ decodePrefixedString(allocated_, value_.string_,
+ &len, &str);
+ return CppTL::ConstString(str, len);
}
#endif
@@ -760,7 +860,6 @@ ArrayIndex Value::size() const {
case booleanValue:
case stringValue:
return 0;
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
case arrayValue: // size of the array is highest index + 1
if (!value_.map_->empty()) {
ObjectValues::const_iterator itLast = value_.map_->end();
@@ -770,12 +869,6 @@ ArrayIndex Value::size() const {
return 0;
case objectValue:
return ArrayIndex(value_.map_->size());
-#else
- case arrayValue:
- return Int(value_.array_->size());
- case objectValue:
- return Int(value_.map_->size());
-#endif
}
JSON_ASSERT_UNREACHABLE;
return 0; // unreachable;
@@ -797,19 +890,10 @@ void Value::clear() {
start_ = 0;
limit_ = 0;
switch (type_) {
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- case arrayValue:
- case objectValue:
- value_.map_->clear();
- break;
-#else
case arrayValue:
- value_.array_->clear();
- break;
case objectValue:
value_.map_->clear();
break;
-#endif
default:
break;
}
@@ -820,7 +904,6 @@ void Value::resize(ArrayIndex newSize) {
"in Json::Value::resize(): requires arrayValue");
if (type_ == nullValue)
*this = Value(arrayValue);
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
ArrayIndex oldSize = size();
if (newSize == 0)
clear();
@@ -832,9 +915,6 @@ void Value::resize(ArrayIndex newSize) {
}
assert(size() == newSize);
}
-#else
- value_.array_->resize(newSize);
-#endif
}
Value& Value::operator[](ArrayIndex index) {
@@ -843,18 +923,14 @@ Value& Value::operator[](ArrayIndex index) {
"in Json::Value::operator[](ArrayIndex): requires arrayValue");
if (type_ == nullValue)
*this = Value(arrayValue);
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
CZString key(index);
ObjectValues::iterator it = value_.map_->lower_bound(key);
if (it != value_.map_->end() && (*it).first == key)
return (*it).second;
- ObjectValues::value_type defaultValue(key, null);
+ ObjectValues::value_type defaultValue(key, nullRef);
it = value_.map_->insert(it, defaultValue);
return (*it).second;
-#else
- return value_.array_->resolveReference(index);
-#endif
}
Value& Value::operator[](int index) {
@@ -869,17 +945,12 @@ const Value& Value::operator[](ArrayIndex index) const {
type_ == nullValue || type_ == arrayValue,
"in Json::Value::operator[](ArrayIndex)const: requires arrayValue");
if (type_ == nullValue)
- return null;
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
+ return nullRef;
CZString key(index);
ObjectValues::const_iterator it = value_.map_->find(key);
if (it == value_.map_->end())
- return null;
+ return nullRef;
return (*it).second;
-#else
- Value* value = value_.array_->find(index);
- return value ? *value : null;
-#endif
}
const Value& Value::operator[](int index) const {
@@ -889,149 +960,211 @@ const Value& Value::operator[](int index) const {
return (*this)[ArrayIndex(index)];
}
-Value& Value::operator[](const char* key) {
- return resolveReference(key, false);
-}
-
void Value::initBasic(ValueType type, bool allocated) {
type_ = type;
allocated_ = allocated;
-#ifdef JSON_VALUE_USE_INTERNAL_MAP
- itemIsUsed_ = 0;
-#endif
comments_ = 0;
start_ = 0;
limit_ = 0;
}
-Value& Value::resolveReference(const char* key, bool isStatic) {
+// Access an object value by name, create a null member if it does not exist.
+// @pre Type of '*this' is object or null.
+// @param key is null-terminated.
+Value& Value::resolveReference(const char* key) {
JSON_ASSERT_MESSAGE(
type_ == nullValue || type_ == objectValue,
"in Json::Value::resolveReference(): requires objectValue");
if (type_ == nullValue)
*this = Value(objectValue);
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
CZString actualKey(
- key, isStatic ? CZString::noDuplication : CZString::duplicateOnCopy);
+ key, static_cast<unsigned>(strlen(key)), CZString::noDuplication); // NOTE!
ObjectValues::iterator it = value_.map_->lower_bound(actualKey);
if (it != value_.map_->end() && (*it).first == actualKey)
return (*it).second;
- ObjectValues::value_type defaultValue(actualKey, null);
+ ObjectValues::value_type defaultValue(actualKey, nullRef);
+ it = value_.map_->insert(it, defaultValue);
+ Value& value = (*it).second;
+ return value;
+}
+
+// @param key is not null-terminated.
+Value& Value::resolveReference(char const* key, char const* end)
+{
+ JSON_ASSERT_MESSAGE(
+ type_ == nullValue || type_ == objectValue,
+ "in Json::Value::resolveReference(key, end): requires objectValue");
+ if (type_ == nullValue)
+ *this = Value(objectValue);
+ CZString actualKey(
+ key, static_cast<unsigned>(end-key), CZString::duplicateOnCopy);
+ ObjectValues::iterator it = value_.map_->lower_bound(actualKey);
+ if (it != value_.map_->end() && (*it).first == actualKey)
+ return (*it).second;
+
+ ObjectValues::value_type defaultValue(actualKey, nullRef);
it = value_.map_->insert(it, defaultValue);
Value& value = (*it).second;
return value;
-#else
- return value_.map_->resolveReference(key, isStatic);
-#endif
}
Value Value::get(ArrayIndex index, const Value& defaultValue) const {
const Value* value = &((*this)[index]);
- return value == &null ? defaultValue : *value;
+ return value == &nullRef ? defaultValue : *value;
}
bool Value::isValidIndex(ArrayIndex index) const { return index < size(); }
-const Value& Value::operator[](const char* key) const {
+Value const* Value::find(char const* key, char const* end) const
+{
JSON_ASSERT_MESSAGE(
type_ == nullValue || type_ == objectValue,
- "in Json::Value::operator[](char const*)const: requires objectValue");
- if (type_ == nullValue)
- return null;
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- CZString actualKey(key, CZString::noDuplication);
+ "in Json::Value::find(key, end, found): requires objectValue or nullValue");
+ if (type_ == nullValue) return NULL;
+ CZString actualKey(key, static_cast<unsigned>(end-key), CZString::noDuplication);
ObjectValues::const_iterator it = value_.map_->find(actualKey);
- if (it == value_.map_->end())
- return null;
- return (*it).second;
-#else
- const Value* value = value_.map_->find(key);
- return value ? *value : null;
-#endif
+ if (it == value_.map_->end()) return NULL;
+ return &(*it).second;
+}
+const Value& Value::operator[](const char* key) const
+{
+ Value const* found = find(key, key + strlen(key));
+ if (!found) return nullRef;
+ return *found;
+}
+Value const& Value::operator[](std::string const& key) const
+{
+ Value const* found = find(key.data(), key.data() + key.length());
+ if (!found) return nullRef;
+ return *found;
}
-Value& Value::operator[](const std::string& key) {
- return (*this)[key.c_str()];
+Value& Value::operator[](const char* key) {
+ return resolveReference(key, key + strlen(key));
}
-const Value& Value::operator[](const std::string& key) const {
- return (*this)[key.c_str()];
+Value& Value::operator[](const std::string& key) {
+ return resolveReference(key.data(), key.data() + key.length());
}
Value& Value::operator[](const StaticString& key) {
- return resolveReference(key, true);
+ return resolveReference(key.c_str());
}
#ifdef JSON_USE_CPPTL
Value& Value::operator[](const CppTL::ConstString& key) {
- return (*this)[key.c_str()];
+ return resolveReference(key.c_str(), key.end_c_str());
}
-
-const Value& Value::operator[](const CppTL::ConstString& key) const {
- return (*this)[key.c_str()];
+Value const& Value::operator[](CppTL::ConstString const& key) const
+{
+ Value const* found = find(key.c_str(), key.end_c_str());
+ if (!found) return nullRef;
+ return *found;
}
#endif
Value& Value::append(const Value& value) { return (*this)[size()] = value; }
-Value Value::get(const char* key, const Value& defaultValue) const {
- const Value* value = &((*this)[key]);
- return value == &null ? defaultValue : *value;
+Value Value::get(char const* key, char const* end, Value const& defaultValue) const
+{
+ Value const* found = find(key, end);
+ return !found ? defaultValue : *found;
}
-
-Value Value::get(const std::string& key, const Value& defaultValue) const {
- return get(key.c_str(), defaultValue);
+Value Value::get(char const* key, Value const& defaultValue) const
+{
+ return get(key, key + strlen(key), defaultValue);
+}
+Value Value::get(std::string const& key, Value const& defaultValue) const
+{
+ return get(key.data(), key.data() + key.length(), defaultValue);
}
-Value Value::removeMember(const char* key) {
- JSON_ASSERT_MESSAGE(type_ == nullValue || type_ == objectValue,
- "in Json::Value::removeMember(): requires objectValue");
- if (type_ == nullValue)
- return null;
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- CZString actualKey(key, CZString::noDuplication);
+
+bool Value::removeMember(const char* key, const char* end, Value* removed)
+{
+ if (type_ != objectValue) {
+ return false;
+ }
+ CZString actualKey(key, static_cast<unsigned>(end-key), CZString::noDuplication);
ObjectValues::iterator it = value_.map_->find(actualKey);
if (it == value_.map_->end())
- return null;
- Value old(it->second);
+ return false;
+ *removed = it->second;
value_.map_->erase(it);
- return old;
-#else
- Value* value = value_.map_->find(key);
- if (value) {
- Value old(*value);
- value_.map_.remove(key);
- return old;
- } else {
- return null;
- }
-#endif
+ return true;
+}
+bool Value::removeMember(const char* key, Value* removed)
+{
+ return removeMember(key, key + strlen(key), removed);
+}
+bool Value::removeMember(std::string const& key, Value* removed)
+{
+ return removeMember(key.data(), key.data() + key.length(), removed);
}
+Value Value::removeMember(const char* key)
+{
+ JSON_ASSERT_MESSAGE(type_ == nullValue || type_ == objectValue,
+ "in Json::Value::removeMember(): requires objectValue");
+ if (type_ == nullValue)
+ return nullRef;
-Value Value::removeMember(const std::string& key) {
+ Value removed; // null
+ removeMember(key, key + strlen(key), &removed);
+ return removed; // still null if removeMember() did nothing
+}
+Value Value::removeMember(const std::string& key)
+{
return removeMember(key.c_str());
}
+bool Value::removeIndex(ArrayIndex index, Value* removed) {
+ if (type_ != arrayValue) {
+ return false;
+ }
+ CZString key(index);
+ ObjectValues::iterator it = value_.map_->find(key);
+ if (it == value_.map_->end()) {
+ return false;
+ }
+ *removed = it->second;
+ ArrayIndex oldSize = size();
+ // shift left all items left, into the place of the "removed"
+ for (ArrayIndex i = index; i < (oldSize - 1); ++i){
+ CZString key(i);
+ (*value_.map_)[key] = (*this)[i + 1];
+ }
+ // erase the last one ("leftover")
+ CZString keyLast(oldSize - 1);
+ ObjectValues::iterator itLast = value_.map_->find(keyLast);
+ value_.map_->erase(itLast);
+ return true;
+}
+
#ifdef JSON_USE_CPPTL
Value Value::get(const CppTL::ConstString& key,
const Value& defaultValue) const {
- return get(key.c_str(), defaultValue);
+ return get(key.c_str(), key.end_c_str(), defaultValue);
}
#endif
-bool Value::isMember(const char* key) const {
- const Value* value = &((*this)[key]);
- return value != &null;
+bool Value::isMember(char const* key, char const* end) const
+{
+ Value const* value = find(key, end);
+ return NULL != value;
}
-
-bool Value::isMember(const std::string& key) const {
- return isMember(key.c_str());
+bool Value::isMember(char const* key) const
+{
+ return isMember(key, key + strlen(key));
+}
+bool Value::isMember(std::string const& key) const
+{
+ return isMember(key.data(), key.data() + key.length());
}
#ifdef JSON_USE_CPPTL
bool Value::isMember(const CppTL::ConstString& key) const {
- return isMember(key.c_str());
+ return isMember(key.c_str(), key.end_c_str());
}
#endif
@@ -1043,19 +1176,12 @@ Value::Members Value::getMemberNames() const {
return Value::Members();
Members members;
members.reserve(value_.map_->size());
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
ObjectValues::const_iterator it = value_.map_->begin();
ObjectValues::const_iterator itEnd = value_.map_->end();
- for (; it != itEnd; ++it)
- members.push_back(std::string((*it).first.c_str()));
-#else
- ValueInternalMap::IteratorState it;
- ValueInternalMap::IteratorState itEnd;
- value_.map_->makeBeginIterator(it);
- value_.map_->makeEndIterator(itEnd);
- for (; !ValueInternalMap::equals(it, itEnd); ValueInternalMap::increment(it))
- members.push_back(std::string(ValueInternalMap::key(it)));
-#endif
+ for (; it != itEnd; ++it) {
+ members.push_back(std::string((*it).first.data(),
+ (*it).first.length()));
+ }
return members;
}
//
@@ -1181,14 +1307,22 @@ bool Value::isArray() const { return type_ == arrayValue; }
bool Value::isObject() const { return type_ == objectValue; }
-void Value::setComment(const char* comment, CommentPlacement placement) {
+void Value::setComment(const char* comment, size_t len, CommentPlacement placement) {
if (!comments_)
comments_ = new CommentInfo[numberOfCommentPlacement];
- comments_[placement].setComment(comment);
+ if ((len > 0) && (comment[len-1] == '\n')) {
+ // Always discard trailing newline, to aid indentation.
+ len -= 1;
+ }
+ comments_[placement].setComment(comment, len);
+}
+
+void Value::setComment(const char* comment, CommentPlacement placement) {
+ setComment(comment, strlen(comment), placement);
}
void Value::setComment(const std::string& comment, CommentPlacement placement) {
- setComment(comment.c_str(), placement);
+ setComment(comment.c_str(), comment.length(), placement);
}
bool Value::hasComment(CommentPlacement placement) const {
@@ -1216,28 +1350,11 @@ std::string Value::toStyledString() const {
Value::const_iterator Value::begin() const {
switch (type_) {
-#ifdef JSON_VALUE_USE_INTERNAL_MAP
- case arrayValue:
- if (value_.array_) {
- ValueInternalArray::IteratorState it;
- value_.array_->makeBeginIterator(it);
- return const_iterator(it);
- }
- break;
- case objectValue:
- if (value_.map_) {
- ValueInternalMap::IteratorState it;
- value_.map_->makeBeginIterator(it);
- return const_iterator(it);
- }
- break;
-#else
case arrayValue:
case objectValue:
if (value_.map_)
return const_iterator(value_.map_->begin());
break;
-#endif
default:
break;
}
@@ -1246,28 +1363,11 @@ Value::const_iterator Value::begin() const {
Value::const_iterator Value::end() const {
switch (type_) {
-#ifdef JSON_VALUE_USE_INTERNAL_MAP
- case arrayValue:
- if (value_.array_) {
- ValueInternalArray::IteratorState it;
- value_.array_->makeEndIterator(it);
- return const_iterator(it);
- }
- break;
- case objectValue:
- if (value_.map_) {
- ValueInternalMap::IteratorState it;
- value_.map_->makeEndIterator(it);
- return const_iterator(it);
- }
- break;
-#else
case arrayValue:
case objectValue:
if (value_.map_)
return const_iterator(value_.map_->end());
break;
-#endif
default:
break;
}
@@ -1276,28 +1376,11 @@ Value::const_iterator Value::end() const {
Value::iterator Value::begin() {
switch (type_) {
-#ifdef JSON_VALUE_USE_INTERNAL_MAP
- case arrayValue:
- if (value_.array_) {
- ValueInternalArray::IteratorState it;
- value_.array_->makeBeginIterator(it);
- return iterator(it);
- }
- break;
- case objectValue:
- if (value_.map_) {
- ValueInternalMap::IteratorState it;
- value_.map_->makeBeginIterator(it);
- return iterator(it);
- }
- break;
-#else
case arrayValue:
case objectValue:
if (value_.map_)
return iterator(value_.map_->begin());
break;
-#endif
default:
break;
}
@@ -1306,28 +1389,11 @@ Value::iterator Value::begin() {
Value::iterator Value::end() {
switch (type_) {
-#ifdef JSON_VALUE_USE_INTERNAL_MAP
- case arrayValue:
- if (value_.array_) {
- ValueInternalArray::IteratorState it;
- value_.array_->makeEndIterator(it);
- return iterator(it);
- }
- break;
- case objectValue:
- if (value_.map_) {
- ValueInternalMap::IteratorState it;
- value_.map_->makeEndIterator(it);
- return iterator(it);
- }
- break;
-#else
case arrayValue:
case objectValue:
if (value_.map_)
return iterator(value_.map_->end());
break;
-#endif
default:
break;
}
@@ -1428,7 +1494,7 @@ const Value& Path::resolve(const Value& root) const {
// Error: unable to resolve path (object value expected at position...)
}
node = &((*node)[arg.key_]);
- if (node == &Value::null) {
+ if (node == &Value::nullRef) {
// Error: unable to resolve path (object has no member named '' at
// position...)
}
@@ -1449,7 +1515,7 @@ Value Path::resolve(const Value& root, const Value& defaultValue) const {
if (!node->isObject())
return defaultValue;
node = &((*node)[arg.key_]);
- if (node == &Value::null)
+ if (node == &Value::nullRef)
return defaultValue;
}
}
diff --git a/3rdparty/jsoncpp/src/lib_json/json_valueiterator.inl b/3rdparty/jsoncpp/src/lib_json/json_valueiterator.inl
index a9f7df63a7c..d01d3c018c9 100644
--- a/3rdparty/jsoncpp/src/lib_json/json_valueiterator.inl
+++ b/3rdparty/jsoncpp/src/lib_json/json_valueiterator.inl
@@ -16,68 +16,29 @@ namespace Json {
// //////////////////////////////////////////////////////////////////
ValueIteratorBase::ValueIteratorBase()
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
: current_(), isNull_(true) {
}
-#else
- : isArray_(true), isNull_(true) {
- iterator_.array_ = ValueInternalArray::IteratorState();
-}
-#endif
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
ValueIteratorBase::ValueIteratorBase(
const Value::ObjectValues::iterator& current)
: current_(current), isNull_(false) {}
-#else
-ValueIteratorBase::ValueIteratorBase(
- const ValueInternalArray::IteratorState& state)
- : isArray_(true) {
- iterator_.array_ = state;
-}
-
-ValueIteratorBase::ValueIteratorBase(
- const ValueInternalMap::IteratorState& state)
- : isArray_(false) {
- iterator_.map_ = state;
-}
-#endif
Value& ValueIteratorBase::deref() const {
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
return current_->second;
-#else
- if (isArray_)
- return ValueInternalArray::dereference(iterator_.array_);
- return ValueInternalMap::value(iterator_.map_);
-#endif
}
void ValueIteratorBase::increment() {
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
++current_;
-#else
- if (isArray_)
- ValueInternalArray::increment(iterator_.array_);
- ValueInternalMap::increment(iterator_.map_);
-#endif
}
void ValueIteratorBase::decrement() {
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
--current_;
-#else
- if (isArray_)
- ValueInternalArray::decrement(iterator_.array_);
- ValueInternalMap::decrement(iterator_.map_);
-#endif
}
ValueIteratorBase::difference_type
ValueIteratorBase::computeDistance(const SelfType& other) const {
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
#ifdef JSON_USE_CPPTL_SMALLMAP
- return current_ - other.current_;
+ return other.current_ - current_;
#else
// Iterator for null value are initialized using the default
// constructor, which initialize current_ to the default
@@ -100,80 +61,58 @@ ValueIteratorBase::computeDistance(const SelfType& other) const {
}
return myDistance;
#endif
-#else
- if (isArray_)
- return ValueInternalArray::distance(iterator_.array_,
- other.iterator_.array_);
- return ValueInternalMap::distance(iterator_.map_, other.iterator_.map_);
-#endif
}
bool ValueIteratorBase::isEqual(const SelfType& other) const {
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
if (isNull_) {
return other.isNull_;
}
return current_ == other.current_;
-#else
- if (isArray_)
- return ValueInternalArray::equals(iterator_.array_, other.iterator_.array_);
- return ValueInternalMap::equals(iterator_.map_, other.iterator_.map_);
-#endif
}
void ValueIteratorBase::copy(const SelfType& other) {
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
current_ = other.current_;
isNull_ = other.isNull_;
-#else
- if (isArray_)
- iterator_.array_ = other.iterator_.array_;
- iterator_.map_ = other.iterator_.map_;
-#endif
}
Value ValueIteratorBase::key() const {
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
const Value::CZString czstring = (*current_).first;
- if (czstring.c_str()) {
+ if (czstring.data()) {
if (czstring.isStaticString())
- return Value(StaticString(czstring.c_str()));
- return Value(czstring.c_str());
+ return Value(StaticString(czstring.data()));
+ return Value(czstring.data(), czstring.data() + czstring.length());
}
return Value(czstring.index());
-#else
- if (isArray_)
- return Value(ValueInternalArray::indexOf(iterator_.array_));
- bool isStatic;
- const char* memberName = ValueInternalMap::key(iterator_.map_, isStatic);
- if (isStatic)
- return Value(StaticString(memberName));
- return Value(memberName);
-#endif
}
UInt ValueIteratorBase::index() const {
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
const Value::CZString czstring = (*current_).first;
- if (!czstring.c_str())
+ if (!czstring.data())
return czstring.index();
return Value::UInt(-1);
-#else
- if (isArray_)
- return Value::UInt(ValueInternalArray::indexOf(iterator_.array_));
- return Value::UInt(-1);
-#endif
}
-const char* ValueIteratorBase::memberName() const {
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
- const char* name = (*current_).first.c_str();
+std::string ValueIteratorBase::name() const {
+ char const* key;
+ char const* end;
+ key = memberName(&end);
+ if (!key) return std::string();
+ return std::string(key, end);
+}
+
+char const* ValueIteratorBase::memberName() const {
+ const char* name = (*current_).first.data();
return name ? name : "";
-#else
- if (!isArray_)
- return ValueInternalMap::key(iterator_.map_);
- return "";
-#endif
+}
+
+char const* ValueIteratorBase::memberName(char const** end) const {
+ const char* name = (*current_).first.data();
+ if (!name) {
+ *end = NULL;
+ return NULL;
+ }
+ *end = name + (*current_).first.length();
+ return name;
}
// //////////////////////////////////////////////////////////////////
@@ -186,19 +125,9 @@ const char* ValueIteratorBase::memberName() const {
ValueConstIterator::ValueConstIterator() {}
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
ValueConstIterator::ValueConstIterator(
const Value::ObjectValues::iterator& current)
: ValueIteratorBase(current) {}
-#else
-ValueConstIterator::ValueConstIterator(
- const ValueInternalArray::IteratorState& state)
- : ValueIteratorBase(state) {}
-
-ValueConstIterator::ValueConstIterator(
- const ValueInternalMap::IteratorState& state)
- : ValueIteratorBase(state) {}
-#endif
ValueConstIterator& ValueConstIterator::
operator=(const ValueIteratorBase& other) {
@@ -216,16 +145,8 @@ operator=(const ValueIteratorBase& other) {
ValueIterator::ValueIterator() {}
-#ifndef JSON_VALUE_USE_INTERNAL_MAP
ValueIterator::ValueIterator(const Value::ObjectValues::iterator& current)
: ValueIteratorBase(current) {}
-#else
-ValueIterator::ValueIterator(const ValueInternalArray::IteratorState& state)
- : ValueIteratorBase(state) {}
-
-ValueIterator::ValueIterator(const ValueInternalMap::IteratorState& state)
- : ValueIteratorBase(state) {}
-#endif
ValueIterator::ValueIterator(const ValueConstIterator& other)
: ValueIteratorBase(other) {}
diff --git a/3rdparty/jsoncpp/src/lib_json/json_writer.cpp b/3rdparty/jsoncpp/src/lib_json/json_writer.cpp
index 5113c38be1d..2f940c8a43f 100644
--- a/3rdparty/jsoncpp/src/lib_json/json_writer.cpp
+++ b/3rdparty/jsoncpp/src/lib_json/json_writer.cpp
@@ -7,15 +7,35 @@
#include <json/writer.h>
#include "json_tool.h"
#endif // if !defined(JSON_IS_AMALGAMATION)
-#include <utility>
-#include <assert.h>
-#include <stdio.h>
-#include <string.h>
-#include <sstream>
#include <iomanip>
-#include <math.h>
+#include <memory>
+#include <sstream>
+#include <utility>
+#include <set>
+#include <cassert>
+#include <cstring>
+#include <cstdio>
+
+#if defined(_MSC_VER) && _MSC_VER >= 1200 && _MSC_VER < 1800 // Between VC++ 6.0 and VC++ 11.0
+#include <float.h>
+#define isfinite _finite
+#elif defined(__sun) && defined(__SVR4) //Solaris
+#include <ieeefp.h>
+#define isfinite finite
+#else
+#include <cmath>
+#define isfinite std::isfinite
+#endif
#if defined(_MSC_VER) && _MSC_VER < 1500 // VC++ 8.0 and below
+#define snprintf _snprintf
+#elif defined(__ANDROID__)
+#define snprintf snprintf
+#elif __cplusplus >= 201103L
+#define snprintf std::snprintf
+#endif
+
+#if defined(__BORLANDC__)
#include <float.h>
#define isfinite _finite
#define snprintf _snprintf
@@ -26,13 +46,14 @@
#pragma warning(disable : 4996)
#endif
-#if defined(__sun) && defined(__SVR4) //Solaris
-#include <ieeefp.h>
-#define isfinite finite
-#endif
-
namespace Json {
+#if __cplusplus >= 201103L
+typedef std::unique_ptr<StreamWriter> StreamWriterPtr;
+#else
+typedef std::auto_ptr<StreamWriter> StreamWriterPtr;
+#endif
+
static bool containsControlCharacter(const char* str) {
while (*str) {
if (isControlCharacter(*(str++)))
@@ -41,6 +62,16 @@ static bool containsControlCharacter(const char* str) {
return false;
}
+static bool containsControlCharacter0(const char* str, unsigned len) {
+ char const* end = str + len;
+ while (end != str) {
+ if (isControlCharacter(*str) || 0==*str)
+ return true;
+ ++str;
+ }
+ return false;
+}
+
std::string valueToString(LargestInt value) {
UIntToStringBuffer buffer;
char* current = buffer + sizeof(buffer);
@@ -175,6 +206,84 @@ std::string valueToQuotedString(const char* value) {
return result;
}
+// https://github.com/upcaste/upcaste/blob/master/src/upcore/src/cstring/strnpbrk.cpp
+static char const* strnpbrk(char const* s, char const* accept, size_t n) {
+ assert((s || !n) && accept);
+
+ char const* const end = s + n;
+ for (char const* cur = s; cur < end; ++cur) {
+ int const c = *cur;
+ for (char const* a = accept; *a; ++a) {
+ if (*a == c) {
+ return cur;
+ }
+ }
+ }
+ return NULL;
+}
+static std::string valueToQuotedStringN(const char* value, unsigned length) {
+ if (value == NULL)
+ return "";
+ // Not sure how to handle unicode...
+ if (strnpbrk(value, "\"\\\b\f\n\r\t", length) == NULL &&
+ !containsControlCharacter0(value, length))
+ return std::string("\"") + value + "\"";
+ // We have to walk value and escape any special characters.
+ // Appending to std::string is not efficient, but this should be rare.
+ // (Note: forward slashes are *not* rare, but I am not escaping them.)
+ std::string::size_type maxsize =
+ length * 2 + 3; // allescaped+quotes+NULL
+ std::string result;
+ result.reserve(maxsize); // to avoid lots of mallocs
+ result += "\"";
+ char const* end = value + length;
+ for (const char* c = value; c != end; ++c) {
+ switch (*c) {
+ case '\"':
+ result += "\\\"";
+ break;
+ case '\\':
+ result += "\\\\";
+ break;
+ case '\b':
+ result += "\\b";
+ break;
+ case '\f':
+ result += "\\f";
+ break;
+ case '\n':
+ result += "\\n";
+ break;
+ case '\r':
+ result += "\\r";
+ break;
+ case '\t':
+ result += "\\t";
+ break;
+ // case '/':
+ // Even though \/ is considered a legal escape in JSON, a bare
+ // slash is also legal, so I see no reason to escape it.
+ // (I hope I am not misunderstanding something.)
+ // blep notes: actually escaping \/ may be useful in javascript to avoid </
+ // sequence.
+ // Should add a flag to allow this compatibility mode and prevent this
+ // sequence from occurring.
+ default:
+ if ((isControlCharacter(*c)) || (*c == 0)) {
+ std::ostringstream oss;
+ oss << "\\u" << std::hex << std::uppercase << std::setfill('0')
+ << std::setw(4) << static_cast<int>(*c);
+ result += oss.str();
+ } else {
+ result += *c;
+ }
+ break;
+ }
+ }
+ result += "\"";
+ return result;
+}
+
// Class Writer
// //////////////////////////////////////////////////////////////////
Writer::~Writer() {}
@@ -216,8 +325,14 @@ void FastWriter::writeValue(const Value& value) {
document_ += valueToString(value.asDouble());
break;
case stringValue:
- document_ += valueToQuotedString(value.asCString());
+ {
+ // Is NULL possible for value.string_?
+ char const* str;
+ char const* end;
+ bool ok = value.getString(&str, &end);
+ if (ok) document_ += valueToQuotedStringN(str, static_cast<unsigned>(end-str));
break;
+ }
case booleanValue:
document_ += valueToString(value.asBool());
break;
@@ -239,7 +354,7 @@ void FastWriter::writeValue(const Value& value) {
const std::string& name = *it;
if (it != members.begin())
document_ += ',';
- document_ += valueToQuotedString(name.c_str());
+ document_ += valueToQuotedStringN(name.data(), static_cast<unsigned>(name.length()));
document_ += yamlCompatiblityEnabled_ ? ": " : ":";
writeValue(value[name]);
}
@@ -280,8 +395,15 @@ void StyledWriter::writeValue(const Value& value) {
pushValue(valueToString(value.asDouble()));
break;
case stringValue:
- pushValue(valueToQuotedString(value.asCString()));
+ {
+ // Is NULL possible for value.string_?
+ char const* str;
+ char const* end;
+ bool ok = value.getString(&str, &end);
+ if (ok) pushValue(valueToQuotedStringN(str, static_cast<unsigned>(end-str)));
+ else pushValue("");
break;
+ }
case booleanValue:
pushValue(valueToString(value.asBool()));
break;
@@ -376,6 +498,9 @@ bool StyledWriter::isMultineArray(const Value& value) {
addChildValues_ = true;
int lineLength = 4 + (size - 1) * 2; // '[ ' + ', '*n + ' ]'
for (int index = 0; index < size; ++index) {
+ if (hasCommentForValue(value[index])) {
+ isMultiLine = true;
+ }
writeValue(value[index]);
lineLength += int(childValues_[index].length());
}
@@ -421,26 +546,27 @@ void StyledWriter::writeCommentBeforeValue(const Value& root) {
document_ += "\n";
writeIndent();
- std::string normalizedComment = normalizeEOL(root.getComment(commentBefore));
- std::string::const_iterator iter = normalizedComment.begin();
- while (iter != normalizedComment.end()) {
+ const std::string& comment = root.getComment(commentBefore);
+ std::string::const_iterator iter = comment.begin();
+ while (iter != comment.end()) {
document_ += *iter;
- if (*iter == '\n' && *(iter + 1) == '/')
+ if (*iter == '\n' &&
+ (iter != comment.end() && *(iter + 1) == '/'))
writeIndent();
++iter;
}
- // Comments are stripped of newlines, so add one here
+ // Comments are stripped of trailing newlines, so add one here
document_ += "\n";
}
void StyledWriter::writeCommentAfterValueOnSameLine(const Value& root) {
if (root.hasComment(commentAfterOnSameLine))
- document_ += " " + normalizeEOL(root.getComment(commentAfterOnSameLine));
+ document_ += " " + root.getComment(commentAfterOnSameLine);
if (root.hasComment(commentAfter)) {
document_ += "\n";
- document_ += normalizeEOL(root.getComment(commentAfter));
+ document_ += root.getComment(commentAfter);
document_ += "\n";
}
}
@@ -451,25 +577,6 @@ bool StyledWriter::hasCommentForValue(const Value& value) {
value.hasComment(commentAfter);
}
-std::string StyledWriter::normalizeEOL(const std::string& text) {
- std::string normalized;
- normalized.reserve(text.length());
- const char* begin = text.c_str();
- const char* end = begin + text.length();
- const char* current = begin;
- while (current != end) {
- char c = *current++;
- if (c == '\r') // mac or dos EOL
- {
- if (*current == '\n') // convert dos EOL
- ++current;
- normalized += '\n';
- } else // handle unix EOL & other char
- normalized += c;
- }
- return normalized;
-}
-
// Class StyledStreamWriter
// //////////////////////////////////////////////////////////////////
@@ -481,7 +588,10 @@ void StyledStreamWriter::write(std::ostream& out, const Value& root) {
document_ = &out;
addChildValues_ = false;
indentString_ = "";
+ indented_ = true;
writeCommentBeforeValue(root);
+ if (!indented_) writeIndent();
+ indented_ = true;
writeValue(root);
writeCommentAfterValueOnSameLine(root);
*document_ << "\n";
@@ -503,8 +613,15 @@ void StyledStreamWriter::writeValue(const Value& value) {
pushValue(valueToString(value.asDouble()));
break;
case stringValue:
- pushValue(valueToQuotedString(value.asCString()));
+ {
+ // Is NULL possible for value.string_?
+ char const* str;
+ char const* end;
+ bool ok = value.getString(&str, &end);
+ if (ok) pushValue(valueToQuotedStringN(str, static_cast<unsigned>(end-str)));
+ else pushValue("");
break;
+ }
case booleanValue:
pushValue(valueToString(value.asBool()));
break;
@@ -557,8 +674,10 @@ void StyledStreamWriter::writeArrayValue(const Value& value) {
if (hasChildValue)
writeWithIndent(childValues_[index]);
else {
- writeIndent();
+ if (!indented_) writeIndent();
+ indented_ = true;
writeValue(childValue);
+ indented_ = false;
}
if (++index == size) {
writeCommentAfterValueOnSameLine(childValue);
@@ -599,6 +718,9 @@ bool StyledStreamWriter::isMultineArray(const Value& value) {
addChildValues_ = true;
int lineLength = 4 + (size - 1) * 2; // '[ ' + ', '*n + ' ]'
for (int index = 0; index < size; ++index) {
+ if (hasCommentForValue(value[index])) {
+ isMultiLine = true;
+ }
writeValue(value[index]);
lineLength += int(childValues_[index].length());
}
@@ -616,24 +738,17 @@ void StyledStreamWriter::pushValue(const std::string& value) {
}
void StyledStreamWriter::writeIndent() {
- /*
- Some comments in this method would have been nice. ;-)
-
- if ( !document_.empty() )
- {
- char last = document_[document_.length()-1];
- if ( last == ' ' ) // already indented
- return;
- if ( last != '\n' ) // Comments may add new-line
- *document_ << '\n';
- }
- */
+ // blep intended this to look at the so-far-written string
+ // to determine whether we are already indented, but
+ // with a stream we cannot do that. So we rely on some saved state.
+ // The caller checks indented_.
*document_ << '\n' << indentString_;
}
void StyledStreamWriter::writeWithIndent(const std::string& value) {
- writeIndent();
+ if (!indented_) writeIndent();
*document_ << value;
+ indented_ = false;
}
void StyledStreamWriter::indent() { indentString_ += indentation_; }
@@ -646,19 +761,30 @@ void StyledStreamWriter::unindent() {
void StyledStreamWriter::writeCommentBeforeValue(const Value& root) {
if (!root.hasComment(commentBefore))
return;
- *document_ << normalizeEOL(root.getComment(commentBefore));
- *document_ << "\n";
+
+ if (!indented_) writeIndent();
+ const std::string& comment = root.getComment(commentBefore);
+ std::string::const_iterator iter = comment.begin();
+ while (iter != comment.end()) {
+ *document_ << *iter;
+ if (*iter == '\n' &&
+ (iter != comment.end() && *(iter + 1) == '/'))
+ // writeIndent(); // would include newline
+ *document_ << indentString_;
+ ++iter;
+ }
+ indented_ = false;
}
void StyledStreamWriter::writeCommentAfterValueOnSameLine(const Value& root) {
if (root.hasComment(commentAfterOnSameLine))
- *document_ << " " + normalizeEOL(root.getComment(commentAfterOnSameLine));
+ *document_ << ' ' << root.getComment(commentAfterOnSameLine);
if (root.hasComment(commentAfter)) {
- *document_ << "\n";
- *document_ << normalizeEOL(root.getComment(commentAfter));
- *document_ << "\n";
+ writeIndent();
+ *document_ << root.getComment(commentAfter);
}
+ indented_ = false;
}
bool StyledStreamWriter::hasCommentForValue(const Value& value) {
@@ -667,28 +793,386 @@ bool StyledStreamWriter::hasCommentForValue(const Value& value) {
value.hasComment(commentAfter);
}
-std::string StyledStreamWriter::normalizeEOL(const std::string& text) {
- std::string normalized;
- normalized.reserve(text.length());
- const char* begin = text.c_str();
- const char* end = begin + text.length();
- const char* current = begin;
- while (current != end) {
- char c = *current++;
- if (c == '\r') // mac or dos EOL
+//////////////////////////
+// BuiltStyledStreamWriter
+
+/// Scoped enums are not available until C++11.
+struct CommentStyle {
+ /// Decide whether to write comments.
+ enum Enum {
+ None, ///< Drop all comments.
+ Most, ///< Recover odd behavior of previous versions (not implemented yet).
+ All ///< Keep all comments.
+ };
+};
+
+struct BuiltStyledStreamWriter : public StreamWriter
+{
+ BuiltStyledStreamWriter(
+ std::string const& indentation,
+ CommentStyle::Enum cs,
+ std::string const& colonSymbol,
+ std::string const& nullSymbol,
+ std::string const& endingLineFeedSymbol);
+ virtual int write(Value const& root, std::ostream* sout);
+private:
+ void writeValue(Value const& value);
+ void writeArrayValue(Value const& value);
+ bool isMultineArray(Value const& value);
+ void pushValue(std::string const& value);
+ void writeIndent();
+ void writeWithIndent(std::string const& value);
+ void indent();
+ void unindent();
+ void writeCommentBeforeValue(Value const& root);
+ void writeCommentAfterValueOnSameLine(Value const& root);
+ static bool hasCommentForValue(const Value& value);
+
+ typedef std::vector<std::string> ChildValues;
+
+ ChildValues childValues_;
+ std::string indentString_;
+ int rightMargin_;
+ std::string indentation_;
+ CommentStyle::Enum cs_;
+ std::string colonSymbol_;
+ std::string nullSymbol_;
+ std::string endingLineFeedSymbol_;
+ bool addChildValues_ : 1;
+ bool indented_ : 1;
+};
+BuiltStyledStreamWriter::BuiltStyledStreamWriter(
+ std::string const& indentation,
+ CommentStyle::Enum cs,
+ std::string const& colonSymbol,
+ std::string const& nullSymbol,
+ std::string const& endingLineFeedSymbol)
+ : rightMargin_(74)
+ , indentation_(indentation)
+ , cs_(cs)
+ , colonSymbol_(colonSymbol)
+ , nullSymbol_(nullSymbol)
+ , endingLineFeedSymbol_(endingLineFeedSymbol)
+ , addChildValues_(false)
+ , indented_(false)
+{
+}
+int BuiltStyledStreamWriter::write(Value const& root, std::ostream* sout)
+{
+ sout_ = sout;
+ addChildValues_ = false;
+ indented_ = true;
+ indentString_ = "";
+ writeCommentBeforeValue(root);
+ if (!indented_) writeIndent();
+ indented_ = true;
+ writeValue(root);
+ writeCommentAfterValueOnSameLine(root);
+ *sout_ << endingLineFeedSymbol_;
+ sout_ = NULL;
+ return 0;
+}
+void BuiltStyledStreamWriter::writeValue(Value const& value) {
+ switch (value.type()) {
+ case nullValue:
+ pushValue(nullSymbol_);
+ break;
+ case intValue:
+ pushValue(valueToString(value.asLargestInt()));
+ break;
+ case uintValue:
+ pushValue(valueToString(value.asLargestUInt()));
+ break;
+ case realValue:
+ pushValue(valueToString(value.asDouble()));
+ break;
+ case stringValue:
+ {
+ // Is NULL is possible for value.string_?
+ char const* str;
+ char const* end;
+ bool ok = value.getString(&str, &end);
+ if (ok) pushValue(valueToQuotedStringN(str, static_cast<unsigned>(end-str)));
+ else pushValue("");
+ break;
+ }
+ case booleanValue:
+ pushValue(valueToString(value.asBool()));
+ break;
+ case arrayValue:
+ writeArrayValue(value);
+ break;
+ case objectValue: {
+ Value::Members members(value.getMemberNames());
+ if (members.empty())
+ pushValue("{}");
+ else {
+ writeWithIndent("{");
+ indent();
+ Value::Members::iterator it = members.begin();
+ for (;;) {
+ std::string const& name = *it;
+ Value const& childValue = value[name];
+ writeCommentBeforeValue(childValue);
+ writeWithIndent(valueToQuotedStringN(name.data(), static_cast<unsigned>(name.length())));
+ *sout_ << colonSymbol_;
+ writeValue(childValue);
+ if (++it == members.end()) {
+ writeCommentAfterValueOnSameLine(childValue);
+ break;
+ }
+ *sout_ << ",";
+ writeCommentAfterValueOnSameLine(childValue);
+ }
+ unindent();
+ writeWithIndent("}");
+ }
+ } break;
+ }
+}
+
+void BuiltStyledStreamWriter::writeArrayValue(Value const& value) {
+ unsigned size = value.size();
+ if (size == 0)
+ pushValue("[]");
+ else {
+ bool isMultiLine = (cs_ == CommentStyle::All) || isMultineArray(value);
+ if (isMultiLine) {
+ writeWithIndent("[");
+ indent();
+ bool hasChildValue = !childValues_.empty();
+ unsigned index = 0;
+ for (;;) {
+ Value const& childValue = value[index];
+ writeCommentBeforeValue(childValue);
+ if (hasChildValue)
+ writeWithIndent(childValues_[index]);
+ else {
+ if (!indented_) writeIndent();
+ indented_ = true;
+ writeValue(childValue);
+ indented_ = false;
+ }
+ if (++index == size) {
+ writeCommentAfterValueOnSameLine(childValue);
+ break;
+ }
+ *sout_ << ",";
+ writeCommentAfterValueOnSameLine(childValue);
+ }
+ unindent();
+ writeWithIndent("]");
+ } else // output on a single line
{
- if (*current == '\n') // convert dos EOL
- ++current;
- normalized += '\n';
- } else // handle unix EOL & other char
- normalized += c;
+ assert(childValues_.size() == size);
+ *sout_ << "[";
+ if (!indentation_.empty()) *sout_ << " ";
+ for (unsigned index = 0; index < size; ++index) {
+ if (index > 0)
+ *sout_ << ", ";
+ *sout_ << childValues_[index];
+ }
+ if (!indentation_.empty()) *sout_ << " ";
+ *sout_ << "]";
+ }
+ }
+}
+
+bool BuiltStyledStreamWriter::isMultineArray(Value const& value) {
+ int size = value.size();
+ bool isMultiLine = size * 3 >= rightMargin_;
+ childValues_.clear();
+ for (int index = 0; index < size && !isMultiLine; ++index) {
+ Value const& childValue = value[index];
+ isMultiLine =
+ isMultiLine || ((childValue.isArray() || childValue.isObject()) &&
+ childValue.size() > 0);
}
- return normalized;
+ if (!isMultiLine) // check if line length > max line length
+ {
+ childValues_.reserve(size);
+ addChildValues_ = true;
+ int lineLength = 4 + (size - 1) * 2; // '[ ' + ', '*n + ' ]'
+ for (int index = 0; index < size; ++index) {
+ if (hasCommentForValue(value[index])) {
+ isMultiLine = true;
+ }
+ writeValue(value[index]);
+ lineLength += int(childValues_[index].length());
+ }
+ addChildValues_ = false;
+ isMultiLine = isMultiLine || lineLength >= rightMargin_;
+ }
+ return isMultiLine;
+}
+
+void BuiltStyledStreamWriter::pushValue(std::string const& value) {
+ if (addChildValues_)
+ childValues_.push_back(value);
+ else
+ *sout_ << value;
+}
+
+void BuiltStyledStreamWriter::writeIndent() {
+ // blep intended this to look at the so-far-written string
+ // to determine whether we are already indented, but
+ // with a stream we cannot do that. So we rely on some saved state.
+ // The caller checks indented_.
+
+ if (!indentation_.empty()) {
+ // In this case, drop newlines too.
+ *sout_ << '\n' << indentString_;
+ }
+}
+
+void BuiltStyledStreamWriter::writeWithIndent(std::string const& value) {
+ if (!indented_) writeIndent();
+ *sout_ << value;
+ indented_ = false;
+}
+
+void BuiltStyledStreamWriter::indent() { indentString_ += indentation_; }
+
+void BuiltStyledStreamWriter::unindent() {
+ assert(indentString_.size() >= indentation_.size());
+ indentString_.resize(indentString_.size() - indentation_.size());
+}
+
+void BuiltStyledStreamWriter::writeCommentBeforeValue(Value const& root) {
+ if (cs_ == CommentStyle::None) return;
+ if (!root.hasComment(commentBefore))
+ return;
+
+ if (!indented_) writeIndent();
+ const std::string& comment = root.getComment(commentBefore);
+ std::string::const_iterator iter = comment.begin();
+ while (iter != comment.end()) {
+ *sout_ << *iter;
+ if (*iter == '\n' &&
+ (iter != comment.end() && *(iter + 1) == '/'))
+ // writeIndent(); // would write extra newline
+ *sout_ << indentString_;
+ ++iter;
+ }
+ indented_ = false;
+}
+
+void BuiltStyledStreamWriter::writeCommentAfterValueOnSameLine(Value const& root) {
+ if (cs_ == CommentStyle::None) return;
+ if (root.hasComment(commentAfterOnSameLine))
+ *sout_ << " " + root.getComment(commentAfterOnSameLine);
+
+ if (root.hasComment(commentAfter)) {
+ writeIndent();
+ *sout_ << root.getComment(commentAfter);
+ }
+}
+
+// static
+bool BuiltStyledStreamWriter::hasCommentForValue(const Value& value) {
+ return value.hasComment(commentBefore) ||
+ value.hasComment(commentAfterOnSameLine) ||
+ value.hasComment(commentAfter);
+}
+
+///////////////
+// StreamWriter
+
+StreamWriter::StreamWriter()
+ : sout_(NULL)
+{
+}
+StreamWriter::~StreamWriter()
+{
+}
+StreamWriter::Factory::~Factory()
+{}
+StreamWriterBuilder::StreamWriterBuilder()
+{
+ setDefaults(&settings_);
+}
+StreamWriterBuilder::~StreamWriterBuilder()
+{}
+StreamWriter* StreamWriterBuilder::newStreamWriter() const
+{
+ std::string indentation = settings_["indentation"].asString();
+ std::string cs_str = settings_["commentStyle"].asString();
+ bool eyc = settings_["enableYAMLCompatibility"].asBool();
+ bool dnp = settings_["dropNullPlaceholders"].asBool();
+ CommentStyle::Enum cs = CommentStyle::All;
+ if (cs_str == "All") {
+ cs = CommentStyle::All;
+ } else if (cs_str == "None") {
+ cs = CommentStyle::None;
+ } else {
+ throwRuntimeError("commentStyle must be 'All' or 'None'");
+ }
+ std::string colonSymbol = " : ";
+ if (eyc) {
+ colonSymbol = ": ";
+ } else if (indentation.empty()) {
+ colonSymbol = ":";
+ }
+ std::string nullSymbol = "null";
+ if (dnp) {
+ nullSymbol = "";
+ }
+ std::string endingLineFeedSymbol = "";
+ return new BuiltStyledStreamWriter(
+ indentation, cs,
+ colonSymbol, nullSymbol, endingLineFeedSymbol);
+}
+static void getValidWriterKeys(std::set<std::string>* valid_keys)
+{
+ valid_keys->clear();
+ valid_keys->insert("indentation");
+ valid_keys->insert("commentStyle");
+ valid_keys->insert("enableYAMLCompatibility");
+ valid_keys->insert("dropNullPlaceholders");
+}
+bool StreamWriterBuilder::validate(Json::Value* invalid) const
+{
+ Json::Value my_invalid;
+ if (!invalid) invalid = &my_invalid; // so we do not need to test for NULL
+ Json::Value& inv = *invalid;
+ std::set<std::string> valid_keys;
+ getValidWriterKeys(&valid_keys);
+ Value::Members keys = settings_.getMemberNames();
+ size_t n = keys.size();
+ for (size_t i = 0; i < n; ++i) {
+ std::string const& key = keys[i];
+ if (valid_keys.find(key) == valid_keys.end()) {
+ inv[key] = settings_[key];
+ }
+ }
+ return 0u == inv.size();
+}
+Value& StreamWriterBuilder::operator[](std::string key)
+{
+ return settings_[key];
+}
+// static
+void StreamWriterBuilder::setDefaults(Json::Value* settings)
+{
+ //! [StreamWriterBuilderDefaults]
+ (*settings)["commentStyle"] = "All";
+ (*settings)["indentation"] = "\t";
+ (*settings)["enableYAMLCompatibility"] = false;
+ (*settings)["dropNullPlaceholders"] = false;
+ //! [StreamWriterBuilderDefaults]
+}
+
+std::string writeString(StreamWriter::Factory const& builder, Value const& root) {
+ std::ostringstream sout;
+ StreamWriterPtr const writer(builder.newStreamWriter());
+ writer->write(root, &sout);
+ return sout.str();
}
-std::ostream& operator<<(std::ostream& sout, const Value& root) {
- Json::StyledStreamWriter writer;
- writer.write(sout, root);
+std::ostream& operator<<(std::ostream& sout, Value const& root) {
+ StreamWriterBuilder builder;
+ StreamWriterPtr const writer(builder.newStreamWriter());
+ writer->write(root, &sout);
return sout;
}
diff --git a/3rdparty/jsoncpp/src/test_lib_json/CMakeLists.txt b/3rdparty/jsoncpp/src/test_lib_json/CMakeLists.txt
index 420d659968c..f54c85f6817 100644
--- a/3rdparty/jsoncpp/src/test_lib_json/CMakeLists.txt
+++ b/3rdparty/jsoncpp/src/test_lib_json/CMakeLists.txt
@@ -1,7 +1,4 @@
-
-IF(JSONCPP_LIB_BUILD_SHARED)
- ADD_DEFINITIONS( -DJSON_DLL )
-ENDIF(JSONCPP_LIB_BUILD_SHARED)
+# vim: et ts=4 sts=4 sw=4 tw=0
ADD_EXECUTABLE( jsoncpp_test
jsontest.cpp
@@ -9,14 +6,33 @@ ADD_EXECUTABLE( jsoncpp_test
main.cpp
)
-TARGET_LINK_LIBRARIES(jsoncpp_test jsoncpp_lib)
+
+IF(BUILD_SHARED_LIBS)
+ ADD_DEFINITIONS( -DJSON_DLL )
+ TARGET_LINK_LIBRARIES(jsoncpp_test jsoncpp_lib)
+ELSE(BUILD_SHARED_LIBS)
+ TARGET_LINK_LIBRARIES(jsoncpp_test jsoncpp_lib_static)
+ENDIF(BUILD_SHARED_LIBS)
+
+# another way to solve issue #90
+#set_target_properties(jsoncpp_test PROPERTIES COMPILE_FLAGS -ffloat-store)
# Run unit tests in post-build
# (default cmake workflow hides away the test result into a file, resulting in poor dev workflow?!?)
IF(JSONCPP_WITH_POST_BUILD_UNITTEST)
- ADD_CUSTOM_COMMAND( TARGET jsoncpp_test
- POST_BUILD
- COMMAND $<TARGET_FILE:jsoncpp_test>)
+ IF(BUILD_SHARED_LIBS)
+ # First, copy the shared lib, for Microsoft.
+ # Then, run the test executable.
+ ADD_CUSTOM_COMMAND( TARGET jsoncpp_test
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:jsoncpp_lib> $<TARGET_FILE_DIR:jsoncpp_test>
+ COMMAND $<TARGET_FILE:jsoncpp_test>)
+ ELSE(BUILD_SHARED_LIBS)
+ # Just run the test executable.
+ ADD_CUSTOM_COMMAND( TARGET jsoncpp_test
+ POST_BUILD
+ COMMAND $<TARGET_FILE:jsoncpp_test>)
+ ENDIF(BUILD_SHARED_LIBS)
ENDIF(JSONCPP_WITH_POST_BUILD_UNITTEST)
SET_TARGET_PROPERTIES(jsoncpp_test PROPERTIES OUTPUT_NAME jsoncpp_test)
diff --git a/3rdparty/jsoncpp/src/test_lib_json/jsontest.cpp b/3rdparty/jsoncpp/src/test_lib_json/jsontest.cpp
index ef9c543fa47..bd9463fa589 100644
--- a/3rdparty/jsoncpp/src/test_lib_json/jsontest.cpp
+++ b/3rdparty/jsoncpp/src/test_lib_json/jsontest.cpp
@@ -323,7 +323,7 @@ void Runner::listTests() const {
}
int Runner::runCommandLine(int argc, const char* argv[]) const {
- typedef std::deque<std::string> TestNames;
+ // typedef std::deque<std::string> TestNames;
Runner subrunner;
for (int index = 1; index < argc; ++index) {
std::string opt = argv[index];
diff --git a/3rdparty/jsoncpp/src/test_lib_json/jsontest.h b/3rdparty/jsoncpp/src/test_lib_json/jsontest.h
index 5c56a40b0ff..d6b7cf386a2 100644
--- a/3rdparty/jsoncpp/src/test_lib_json/jsontest.h
+++ b/3rdparty/jsoncpp/src/test_lib_json/jsontest.h
@@ -178,8 +178,8 @@ private:
template <typename T, typename U>
TestResult& checkEqual(TestResult& result,
- const T& expected,
- const U& actual,
+ T expected,
+ U actual,
const char* file,
unsigned int line,
const char* expr) {
@@ -214,7 +214,7 @@ TestResult& checkStringEqual(TestResult& result,
#define JSONTEST_ASSERT_PRED(expr) \
{ \
JsonTest::PredicateContext _minitest_Context = { \
- result_->predicateId_, __FILE__, __LINE__, #expr \
+ result_->predicateId_, __FILE__, __LINE__, #expr, NULL, NULL \
}; \
result_->predicateStackTail_->next_ = &_minitest_Context; \
result_->predicateId_ += 1; \
diff --git a/3rdparty/jsoncpp/src/test_lib_json/main.cpp b/3rdparty/jsoncpp/src/test_lib_json/main.cpp
index 51c5e7442b1..0d4284e5373 100644
--- a/3rdparty/jsoncpp/src/test_lib_json/main.cpp
+++ b/3rdparty/jsoncpp/src/test_lib_json/main.cpp
@@ -6,7 +6,7 @@
#include "jsontest.h"
#include <json/config.h>
#include <json/json.h>
-#include <stdexcept>
+#include <cstring>
// Make numeric limits more convenient to talk about.
// Assumes int type in 32 bits.
@@ -17,8 +17,8 @@
#define kint64min Json::Value::minInt64
#define kuint64max Json::Value::maxUInt64
-static const double kdint64max = double(kint64max);
-static const float kfint64max = float(kint64max);
+//static const double kdint64max = double(kint64max);
+//static const float kfint64max = float(kint64max);
static const float kfint32max = float(kint32max);
static const float kfuint32max = float(kuint32max);
@@ -198,6 +198,18 @@ JSONTEST_FIXTURE(ValueTest, objects) {
object1_["some other id"] = "foo";
JSONTEST_ASSERT_EQUAL(Json::Value("foo"), object1_["some other id"]);
+ JSONTEST_ASSERT_EQUAL(Json::Value("foo"), object1_["some other id"]);
+
+ // Remove.
+ Json::Value got;
+ bool did;
+ did = object1_.removeMember("some other id", &got);
+ JSONTEST_ASSERT_EQUAL(Json::Value("foo"), got);
+ JSONTEST_ASSERT_EQUAL(true, did);
+ got = Json::Value("bar");
+ did = object1_.removeMember("some other id", &got);
+ JSONTEST_ASSERT_EQUAL(Json::Value("bar"), got);
+ JSONTEST_ASSERT_EQUAL(false, did);
}
JSONTEST_FIXTURE(ValueTest, arrays) {
@@ -240,6 +252,24 @@ JSONTEST_FIXTURE(ValueTest, arrays) {
array1_[2] = Json::Value(17);
JSONTEST_ASSERT_EQUAL(Json::Value(), array1_[1]);
JSONTEST_ASSERT_EQUAL(Json::Value(17), array1_[2]);
+ Json::Value got;
+ JSONTEST_ASSERT_EQUAL(true, array1_.removeIndex(2, &got));
+ JSONTEST_ASSERT_EQUAL(Json::Value(17), got);
+ JSONTEST_ASSERT_EQUAL(false, array1_.removeIndex(2, &got)); // gone now
+}
+JSONTEST_FIXTURE(ValueTest, arrayIssue252)
+{
+ int count = 5;
+ Json::Value root;
+ Json::Value item;
+ root["array"] = Json::Value::nullRef;
+ for (int i = 0; i < count; i++)
+ {
+ item["a"] = i;
+ item["b"] = i;
+ root["array"][i] = item;
+ }
+ //JSONTEST_ASSERT_EQUAL(5, root["array"].size());
}
JSONTEST_FIXTURE(ValueTest, null) {
@@ -265,6 +295,8 @@ JSONTEST_FIXTURE(ValueTest, null) {
JSONTEST_ASSERT_EQUAL(0.0, null_.asDouble());
JSONTEST_ASSERT_EQUAL(0.0, null_.asFloat());
JSONTEST_ASSERT_STRING_EQUAL("", null_.asString());
+
+ JSONTEST_ASSERT_EQUAL(Json::Value::null, null_);
}
JSONTEST_FIXTURE(ValueTest, strings) {
@@ -1499,6 +1531,126 @@ JSONTEST_FIXTURE(ValueTest, offsetAccessors) {
JSONTEST_ASSERT(y.getOffsetLimit() == 0);
}
+JSONTEST_FIXTURE(ValueTest, StaticString) {
+ char mutant[] = "hello";
+ Json::StaticString ss(mutant);
+ std::string regular(mutant);
+ mutant[1] = 'a';
+ JSONTEST_ASSERT_STRING_EQUAL("hallo", ss.c_str());
+ JSONTEST_ASSERT_STRING_EQUAL("hello", regular.c_str());
+ {
+ Json::Value root;
+ root["top"] = ss;
+ JSONTEST_ASSERT_STRING_EQUAL("hallo", root["top"].asString());
+ mutant[1] = 'u';
+ JSONTEST_ASSERT_STRING_EQUAL("hullo", root["top"].asString());
+ }
+ {
+ Json::Value root;
+ root["top"] = regular;
+ JSONTEST_ASSERT_STRING_EQUAL("hello", root["top"].asString());
+ mutant[1] = 'u';
+ JSONTEST_ASSERT_STRING_EQUAL("hello", root["top"].asString());
+ }
+}
+
+JSONTEST_FIXTURE(ValueTest, CommentBefore) {
+ Json::Value val; // fill val
+ val.setComment(std::string("// this comment should appear before"), Json::commentBefore);
+ Json::StreamWriterBuilder wbuilder;
+ wbuilder.settings_["commentStyle"] = "All";
+ {
+ char const expected[] = "// this comment should appear before\nnull";
+ std::string result = Json::writeString(wbuilder, val);
+ JSONTEST_ASSERT_STRING_EQUAL(expected, result);
+ std::string res2 = val.toStyledString();
+ std::string exp2 = "\n";
+ exp2 += expected;
+ exp2 += "\n";
+ JSONTEST_ASSERT_STRING_EQUAL(exp2, res2);
+ }
+ Json::Value other = "hello";
+ val.swapPayload(other);
+ {
+ char const expected[] = "// this comment should appear before\n\"hello\"";
+ std::string result = Json::writeString(wbuilder, val);
+ JSONTEST_ASSERT_STRING_EQUAL(expected, result);
+ std::string res2 = val.toStyledString();
+ std::string exp2 = "\n";
+ exp2 += expected;
+ exp2 += "\n";
+ JSONTEST_ASSERT_STRING_EQUAL(exp2, res2);
+ JSONTEST_ASSERT_STRING_EQUAL("null\n", other.toStyledString());
+ }
+ val = "hello";
+ // val.setComment("// this comment should appear before", Json::CommentPlacement::commentBefore);
+ // Assignment over-writes comments.
+ {
+ char const expected[] = "\"hello\"";
+ std::string result = Json::writeString(wbuilder, val);
+ JSONTEST_ASSERT_STRING_EQUAL(expected, result);
+ std::string res2 = val.toStyledString();
+ std::string exp2 = "";
+ exp2 += expected;
+ exp2 += "\n";
+ JSONTEST_ASSERT_STRING_EQUAL(exp2, res2);
+ }
+}
+
+JSONTEST_FIXTURE(ValueTest, zeroes) {
+ char const cstr[] = "h\0i";
+ std::string binary(cstr, sizeof(cstr)); // include trailing 0
+ JSONTEST_ASSERT_EQUAL(4U, binary.length());
+ Json::StreamWriterBuilder b;
+ {
+ Json::Value root;
+ root = binary;
+ JSONTEST_ASSERT_STRING_EQUAL(binary, root.asString());
+ }
+ {
+ char const top[] = "top";
+ Json::Value root;
+ root[top] = binary;
+ JSONTEST_ASSERT_STRING_EQUAL(binary, root[top].asString());
+ Json::Value removed;
+ bool did;
+ did = root.removeMember(top, top + sizeof(top) - 1U,
+ &removed);
+ JSONTEST_ASSERT(did);
+ JSONTEST_ASSERT_STRING_EQUAL(binary, removed.asString());
+ did = root.removeMember(top, top + sizeof(top) - 1U,
+ &removed);
+ JSONTEST_ASSERT(!did);
+ JSONTEST_ASSERT_STRING_EQUAL(binary, removed.asString()); // still
+ }
+}
+
+JSONTEST_FIXTURE(ValueTest, zeroesInKeys) {
+ char const cstr[] = "h\0i";
+ std::string binary(cstr, sizeof(cstr)); // include trailing 0
+ JSONTEST_ASSERT_EQUAL(4U, binary.length());
+ {
+ Json::Value root;
+ root[binary] = "there";
+ JSONTEST_ASSERT_STRING_EQUAL("there", root[binary].asString());
+ JSONTEST_ASSERT(!root.isMember("h"));
+ JSONTEST_ASSERT(root.isMember(binary));
+ JSONTEST_ASSERT_STRING_EQUAL("there", root.get(binary, Json::Value::nullRef).asString());
+ Json::Value removed;
+ bool did;
+ did = root.removeMember(binary.data(), binary.data() + binary.length(),
+ &removed);
+ JSONTEST_ASSERT(did);
+ JSONTEST_ASSERT_STRING_EQUAL("there", removed.asString());
+ did = root.removeMember(binary.data(), binary.data() + binary.length(),
+ &removed);
+ JSONTEST_ASSERT(!did);
+ JSONTEST_ASSERT_STRING_EQUAL("there", removed.asString()); // still
+ JSONTEST_ASSERT(!root.isMember(binary));
+ JSONTEST_ASSERT_STRING_EQUAL("", root.get(binary, Json::Value::nullRef).asString());
+ }
+}
+
struct WriterTest : JsonTest::TestCase {};
JSONTEST_FIXTURE(WriterTest, dropNullPlaceholders) {
@@ -1510,6 +1662,39 @@ JSONTEST_FIXTURE(WriterTest, dropNullPlaceholders) {
JSONTEST_ASSERT(writer.write(nullValue) == "\n");
}
+struct StreamWriterTest : JsonTest::TestCase {};
+
+JSONTEST_FIXTURE(StreamWriterTest, dropNullPlaceholders) {
+ Json::StreamWriterBuilder b;
+ Json::Value nullValue;
+ b.settings_["dropNullPlaceholders"] = false;
+ JSONTEST_ASSERT(Json::writeString(b, nullValue) == "null");
+ b.settings_["dropNullPlaceholders"] = true;
+ JSONTEST_ASSERT(Json::writeString(b, nullValue) == "");
+}
+
+JSONTEST_FIXTURE(StreamWriterTest, writeZeroes) {
+ std::string binary("hi", 3); // include trailing 0
+ JSONTEST_ASSERT_EQUAL(3, binary.length());
+ std::string expected("\"hi\\u0000\""); // unicoded zero
+ Json::StreamWriterBuilder b;
+ {
+ Json::Value root;
+ root = binary;
+ JSONTEST_ASSERT_STRING_EQUAL(binary, root.asString());
+ std::string out = Json::writeString(b, root);
+ JSONTEST_ASSERT_EQUAL(expected.size(), out.size());
+ JSONTEST_ASSERT_STRING_EQUAL(expected, out);
+ }
+ {
+ Json::Value root;
+ root["top"] = binary;
+ JSONTEST_ASSERT_STRING_EQUAL(binary, root["top"].asString());
+ std::string out = Json::writeString(b, root["top"]);
+ JSONTEST_ASSERT_STRING_EQUAL(expected, out);
+ }
+}
+
struct ReaderTest : JsonTest::TestCase {};
JSONTEST_FIXTURE(ReaderTest, parseWithNoErrors) {
@@ -1601,12 +1786,561 @@ JSONTEST_FIXTURE(ReaderTest, parseWithDetailError) {
JSONTEST_ASSERT(errors.at(0).message == "Bad escape sequence in string");
}
+struct CharReaderTest : JsonTest::TestCase {};
+
+JSONTEST_FIXTURE(CharReaderTest, parseWithNoErrors) {
+ Json::CharReaderBuilder b;
+ Json::CharReader* reader(b.newCharReader());
+ std::string errs;
+ Json::Value root;
+ char const doc[] = "{ \"property\" : \"value\" }";
+ bool ok = reader->parse(
+ doc, doc + std::strlen(doc),
+ &root, &errs);
+ JSONTEST_ASSERT(ok);
+ JSONTEST_ASSERT(errs.size() == 0);
+ delete reader;
+}
+
+JSONTEST_FIXTURE(CharReaderTest, parseWithNoErrorsTestingOffsets) {
+ Json::CharReaderBuilder b;
+ Json::CharReader* reader(b.newCharReader());
+ std::string errs;
+ Json::Value root;
+ char const doc[] =
+ "{ \"property\" : [\"value\", \"value2\"], \"obj\" : "
+ "{ \"nested\" : 123, \"bool\" : true}, \"null\" : "
+ "null, \"false\" : false }";
+ bool ok = reader->parse(
+ doc, doc + std::strlen(doc),
+ &root, &errs);
+ JSONTEST_ASSERT(ok);
+ JSONTEST_ASSERT(errs.size() == 0);
+ delete reader;
+}
+
+JSONTEST_FIXTURE(CharReaderTest, parseWithOneError) {
+ Json::CharReaderBuilder b;
+ Json::CharReader* reader(b.newCharReader());
+ std::string errs;
+ Json::Value root;
+ char const doc[] =
+ "{ \"property\" :: \"value\" }";
+ bool ok = reader->parse(
+ doc, doc + std::strlen(doc),
+ &root, &errs);
+ JSONTEST_ASSERT(!ok);
+ JSONTEST_ASSERT(errs ==
+ "* Line 1, Column 15\n Syntax error: value, object or array "
+ "expected.\n");
+ delete reader;
+}
+
+JSONTEST_FIXTURE(CharReaderTest, parseChineseWithOneError) {
+ Json::CharReaderBuilder b;
+ Json::CharReader* reader(b.newCharReader());
+ std::string errs;
+ Json::Value root;
+ char const doc[] =
+ "{ \"prä½è—¤erty\" :: \"value\" }";
+ bool ok = reader->parse(
+ doc, doc + std::strlen(doc),
+ &root, &errs);
+ JSONTEST_ASSERT(!ok);
+ JSONTEST_ASSERT(errs ==
+ "* Line 1, Column 19\n Syntax error: value, object or array "
+ "expected.\n");
+ delete reader;
+}
+
+JSONTEST_FIXTURE(CharReaderTest, parseWithDetailError) {
+ Json::CharReaderBuilder b;
+ Json::CharReader* reader(b.newCharReader());
+ std::string errs;
+ Json::Value root;
+ char const doc[] =
+ "{ \"property\" : \"v\\alue\" }";
+ bool ok = reader->parse(
+ doc, doc + std::strlen(doc),
+ &root, &errs);
+ JSONTEST_ASSERT(!ok);
+ JSONTEST_ASSERT(errs ==
+ "* Line 1, Column 16\n Bad escape sequence in string\nSee "
+ "Line 1, Column 20 for detail.\n");
+ delete reader;
+}
+
+JSONTEST_FIXTURE(CharReaderTest, parseWithStackLimit) {
+ Json::CharReaderBuilder b;
+ Json::Value root;
+ char const doc[] =
+ "{ \"property\" : \"value\" }";
+ {
+ b.settings_["stackLimit"] = 2;
+ Json::CharReader* reader(b.newCharReader());
+ std::string errs;
+ bool ok = reader->parse(
+ doc, doc + std::strlen(doc),
+ &root, &errs);
+ JSONTEST_ASSERT(ok);
+ JSONTEST_ASSERT(errs == "");
+ JSONTEST_ASSERT_EQUAL("value", root["property"]);
+ delete reader;
+ }
+ {
+ b.settings_["stackLimit"] = 1;
+ Json::CharReader* reader(b.newCharReader());
+ std::string errs;
+ JSONTEST_ASSERT_THROWS(reader->parse(
+ doc, doc + std::strlen(doc),
+ &root, &errs));
+ delete reader;
+ }
+}
+
+struct CharReaderStrictModeTest : JsonTest::TestCase {};
+
+JSONTEST_FIXTURE(CharReaderStrictModeTest, dupKeys) {
+ Json::CharReaderBuilder b;
+ Json::Value root;
+ char const doc[] =
+ "{ \"property\" : \"value\", \"key\" : \"val1\", \"key\" : \"val2\" }";
+ {
+ b.strictMode(&b.settings_);
+ Json::CharReader* reader(b.newCharReader());
+ std::string errs;
+ bool ok = reader->parse(
+ doc, doc + std::strlen(doc),
+ &root, &errs);
+ JSONTEST_ASSERT(!ok);
+ JSONTEST_ASSERT_STRING_EQUAL(
+ "* Line 1, Column 41\n"
+ " Duplicate key: 'key'\n",
+ errs);
+ JSONTEST_ASSERT_EQUAL("val1", root["key"]); // so far
+ delete reader;
+ }
+}
+struct CharReaderFailIfExtraTest : JsonTest::TestCase {};
+
+JSONTEST_FIXTURE(CharReaderFailIfExtraTest, issue164) {
+ // This is interpretted as a string value followed by a colon.
+ Json::CharReaderBuilder b;
+ Json::Value root;
+ char const doc[] =
+ " \"property\" : \"value\" }";
+ {
+ b.settings_["failIfExtra"] = false;
+ Json::CharReader* reader(b.newCharReader());
+ std::string errs;
+ bool ok = reader->parse(
+ doc, doc + std::strlen(doc),
+ &root, &errs);
+ JSONTEST_ASSERT(ok);
+ JSONTEST_ASSERT(errs == "");
+ JSONTEST_ASSERT_EQUAL("property", root);
+ delete reader;
+ }
+ {
+ b.settings_["failIfExtra"] = true;
+ Json::CharReader* reader(b.newCharReader());
+ std::string errs;
+ bool ok = reader->parse(
+ doc, doc + std::strlen(doc),
+ &root, &errs);
+ JSONTEST_ASSERT(!ok);
+ JSONTEST_ASSERT_STRING_EQUAL(errs,
+ "* Line 1, Column 13\n"
+ " Extra non-whitespace after JSON value.\n");
+ JSONTEST_ASSERT_EQUAL("property", root);
+ delete reader;
+ }
+ {
+ b.settings_["failIfExtra"] = false;
+ b.strictMode(&b.settings_);
+ Json::CharReader* reader(b.newCharReader());
+ std::string errs;
+ bool ok = reader->parse(
+ doc, doc + std::strlen(doc),
+ &root, &errs);
+ JSONTEST_ASSERT(!ok);
+ JSONTEST_ASSERT_STRING_EQUAL(errs,
+ "* Line 1, Column 13\n"
+ " Extra non-whitespace after JSON value.\n");
+ JSONTEST_ASSERT_EQUAL("property", root);
+ delete reader;
+ }
+}
+JSONTEST_FIXTURE(CharReaderFailIfExtraTest, issue107) {
+ // This is interpretted as an int value followed by a colon.
+ Json::CharReaderBuilder b;
+ Json::Value root;
+ char const doc[] =
+ "1:2:3";
+ b.settings_["failIfExtra"] = true;
+ Json::CharReader* reader(b.newCharReader());
+ std::string errs;
+ bool ok = reader->parse(
+ doc, doc + std::strlen(doc),
+ &root, &errs);
+ JSONTEST_ASSERT(!ok);
+ JSONTEST_ASSERT_STRING_EQUAL(
+ "* Line 1, Column 2\n"
+ " Extra non-whitespace after JSON value.\n",
+ errs);
+ JSONTEST_ASSERT_EQUAL(1, root.asInt());
+ delete reader;
+}
+JSONTEST_FIXTURE(CharReaderFailIfExtraTest, commentAfterObject) {
+ Json::CharReaderBuilder b;
+ Json::Value root;
+ {
+ char const doc[] =
+ "{ \"property\" : \"value\" } //trailing\n//comment\n";
+ b.settings_["failIfExtra"] = true;
+ Json::CharReader* reader(b.newCharReader());
+ std::string errs;
+ bool ok = reader->parse(
+ doc, doc + std::strlen(doc),
+ &root, &errs);
+ JSONTEST_ASSERT(ok);
+ JSONTEST_ASSERT_STRING_EQUAL("", errs);
+ JSONTEST_ASSERT_EQUAL("value", root["property"]);
+ delete reader;
+ }
+}
+JSONTEST_FIXTURE(CharReaderFailIfExtraTest, commentAfterArray) {
+ Json::CharReaderBuilder b;
+ Json::Value root;
+ char const doc[] =
+ "[ \"property\" , \"value\" ] //trailing\n//comment\n";
+ b.settings_["failIfExtra"] = true;
+ Json::CharReader* reader(b.newCharReader());
+ std::string errs;
+ bool ok = reader->parse(
+ doc, doc + std::strlen(doc),
+ &root, &errs);
+ JSONTEST_ASSERT(ok);
+ JSONTEST_ASSERT_STRING_EQUAL("", errs);
+ JSONTEST_ASSERT_EQUAL("value", root[1u]);
+ delete reader;
+}
+JSONTEST_FIXTURE(CharReaderFailIfExtraTest, commentAfterBool) {
+ Json::CharReaderBuilder b;
+ Json::Value root;
+ char const doc[] =
+ " true /*trailing\ncomment*/";
+ b.settings_["failIfExtra"] = true;
+ Json::CharReader* reader(b.newCharReader());
+ std::string errs;
+ bool ok = reader->parse(
+ doc, doc + std::strlen(doc),
+ &root, &errs);
+ JSONTEST_ASSERT(ok);
+ JSONTEST_ASSERT_STRING_EQUAL("", errs);
+ JSONTEST_ASSERT_EQUAL(true, root.asBool());
+ delete reader;
+}
+struct CharReaderAllowDropNullTest : JsonTest::TestCase {};
+
+JSONTEST_FIXTURE(CharReaderAllowDropNullTest, issue178) {
+ Json::CharReaderBuilder b;
+ b.settings_["allowDroppedNullPlaceholders"] = true;
+ Json::Value root;
+ std::string errs;
+ Json::CharReader* reader(b.newCharReader());
+ {
+ char const doc[] = "{\"a\":,\"b\":true}";
+ bool ok = reader->parse(
+ doc, doc + std::strlen(doc),
+ &root, &errs);
+ JSONTEST_ASSERT(ok);
+ JSONTEST_ASSERT_STRING_EQUAL("", errs);
+ JSONTEST_ASSERT_EQUAL(2u, root.size());
+ JSONTEST_ASSERT_EQUAL(Json::nullValue, root.get("a", true));
+ }
+ {
+ char const doc[] = "{\"a\":}";
+ bool ok = reader->parse(
+ doc, doc + std::strlen(doc),
+ &root, &errs);
+ JSONTEST_ASSERT(ok);
+ JSONTEST_ASSERT_STRING_EQUAL("", errs);
+ JSONTEST_ASSERT_EQUAL(1u, root.size());
+ JSONTEST_ASSERT_EQUAL(Json::nullValue, root.get("a", true));
+ }
+ {
+ char const doc[] = "[]";
+ bool ok = reader->parse(
+ doc, doc + std::strlen(doc),
+ &root, &errs);
+ JSONTEST_ASSERT(ok);
+ JSONTEST_ASSERT(errs == "");
+ JSONTEST_ASSERT_EQUAL(0u, root.size());
+ JSONTEST_ASSERT_EQUAL(Json::arrayValue, root);
+ }
+ {
+ char const doc[] = "[null]";
+ bool ok = reader->parse(
+ doc, doc + std::strlen(doc),
+ &root, &errs);
+ JSONTEST_ASSERT(ok);
+ JSONTEST_ASSERT(errs == "");
+ JSONTEST_ASSERT_EQUAL(1u, root.size());
+ }
+ {
+ char const doc[] = "[,]";
+ bool ok = reader->parse(
+ doc, doc + std::strlen(doc),
+ &root, &errs);
+ JSONTEST_ASSERT(ok);
+ JSONTEST_ASSERT_STRING_EQUAL("", errs);
+ JSONTEST_ASSERT_EQUAL(2u, root.size());
+ }
+ {
+ char const doc[] = "[,,,]";
+ bool ok = reader->parse(
+ doc, doc + std::strlen(doc),
+ &root, &errs);
+ JSONTEST_ASSERT(ok);
+ JSONTEST_ASSERT_STRING_EQUAL("", errs);
+ JSONTEST_ASSERT_EQUAL(4u, root.size());
+ }
+ {
+ char const doc[] = "[null,]";
+ bool ok = reader->parse(
+ doc, doc + std::strlen(doc),
+ &root, &errs);
+ JSONTEST_ASSERT(ok);
+ JSONTEST_ASSERT_STRING_EQUAL("", errs);
+ JSONTEST_ASSERT_EQUAL(2u, root.size());
+ }
+ {
+ char const doc[] = "[,null]";
+ bool ok = reader->parse(
+ doc, doc + std::strlen(doc),
+ &root, &errs);
+ JSONTEST_ASSERT(ok);
+ JSONTEST_ASSERT(errs == "");
+ JSONTEST_ASSERT_EQUAL(2u, root.size());
+ }
+ {
+ char const doc[] = "[,,]";
+ bool ok = reader->parse(
+ doc, doc + std::strlen(doc),
+ &root, &errs);
+ JSONTEST_ASSERT(ok);
+ JSONTEST_ASSERT_STRING_EQUAL("", errs);
+ JSONTEST_ASSERT_EQUAL(3u, root.size());
+ }
+ {
+ char const doc[] = "[null,,]";
+ bool ok = reader->parse(
+ doc, doc + std::strlen(doc),
+ &root, &errs);
+ JSONTEST_ASSERT(ok);
+ JSONTEST_ASSERT_STRING_EQUAL("", errs);
+ JSONTEST_ASSERT_EQUAL(3u, root.size());
+ }
+ {
+ char const doc[] = "[,null,]";
+ bool ok = reader->parse(
+ doc, doc + std::strlen(doc),
+ &root, &errs);
+ JSONTEST_ASSERT(ok);
+ JSONTEST_ASSERT_STRING_EQUAL("", errs);
+ JSONTEST_ASSERT_EQUAL(3u, root.size());
+ }
+ {
+ char const doc[] = "[,,null]";
+ bool ok = reader->parse(
+ doc, doc + std::strlen(doc),
+ &root, &errs);
+ JSONTEST_ASSERT(ok);
+ JSONTEST_ASSERT(errs == "");
+ JSONTEST_ASSERT_EQUAL(3u, root.size());
+ }
+ {
+ char const doc[] = "[[],,,]";
+ bool ok = reader->parse(
+ doc, doc + std::strlen(doc),
+ &root, &errs);
+ JSONTEST_ASSERT(ok);
+ JSONTEST_ASSERT_STRING_EQUAL("", errs);
+ JSONTEST_ASSERT_EQUAL(4u, root.size());
+ JSONTEST_ASSERT_EQUAL(Json::arrayValue, root[0u]);
+ }
+ {
+ char const doc[] = "[,[],,]";
+ bool ok = reader->parse(
+ doc, doc + std::strlen(doc),
+ &root, &errs);
+ JSONTEST_ASSERT(ok);
+ JSONTEST_ASSERT_STRING_EQUAL("", errs);
+ JSONTEST_ASSERT_EQUAL(4u, root.size());
+ JSONTEST_ASSERT_EQUAL(Json::arrayValue, root[1u]);
+ }
+ {
+ char const doc[] = "[,,,[]]";
+ bool ok = reader->parse(
+ doc, doc + std::strlen(doc),
+ &root, &errs);
+ JSONTEST_ASSERT(ok);
+ JSONTEST_ASSERT(errs == "");
+ JSONTEST_ASSERT_EQUAL(4u, root.size());
+ JSONTEST_ASSERT_EQUAL(Json::arrayValue, root[3u]);
+ }
+ delete reader;
+}
+
+struct CharReaderAllowSingleQuotesTest : JsonTest::TestCase {};
+
+JSONTEST_FIXTURE(CharReaderAllowSingleQuotesTest, issue182) {
+ Json::CharReaderBuilder b;
+ b.settings_["allowSingleQuotes"] = true;
+ Json::Value root;
+ std::string errs;
+ Json::CharReader* reader(b.newCharReader());
+ {
+ char const doc[] = "{'a':true,\"b\":true}";
+ bool ok = reader->parse(
+ doc, doc + std::strlen(doc),
+ &root, &errs);
+ JSONTEST_ASSERT(ok);
+ JSONTEST_ASSERT_STRING_EQUAL("", errs);
+ JSONTEST_ASSERT_EQUAL(2u, root.size());
+ JSONTEST_ASSERT_EQUAL(true, root.get("a", false));
+ JSONTEST_ASSERT_EQUAL(true, root.get("b", false));
+ }
+ {
+ char const doc[] = "{'a': 'x', \"b\":'y'}";
+ bool ok = reader->parse(
+ doc, doc + std::strlen(doc),
+ &root, &errs);
+ JSONTEST_ASSERT(ok);
+ JSONTEST_ASSERT_STRING_EQUAL("", errs);
+ JSONTEST_ASSERT_EQUAL(2u, root.size());
+ JSONTEST_ASSERT_STRING_EQUAL("x", root["a"].asString());
+ JSONTEST_ASSERT_STRING_EQUAL("y", root["b"].asString());
+ }
+ delete reader;
+}
+
+struct CharReaderAllowZeroesTest : JsonTest::TestCase {};
+
+JSONTEST_FIXTURE(CharReaderAllowZeroesTest, issue176) {
+ Json::CharReaderBuilder b;
+ b.settings_["allowSingleQuotes"] = true;
+ Json::Value root;
+ std::string errs;
+ Json::CharReader* reader(b.newCharReader());
+ {
+ char const doc[] = "{'a':true,\"b\":true}";
+ bool ok = reader->parse(
+ doc, doc + std::strlen(doc),
+ &root, &errs);
+ JSONTEST_ASSERT(ok);
+ JSONTEST_ASSERT_STRING_EQUAL("", errs);
+ JSONTEST_ASSERT_EQUAL(2u, root.size());
+ JSONTEST_ASSERT_EQUAL(true, root.get("a", false));
+ JSONTEST_ASSERT_EQUAL(true, root.get("b", false));
+ }
+ {
+ char const doc[] = "{'a': 'x', \"b\":'y'}";
+ bool ok = reader->parse(
+ doc, doc + std::strlen(doc),
+ &root, &errs);
+ JSONTEST_ASSERT(ok);
+ JSONTEST_ASSERT_STRING_EQUAL("", errs);
+ JSONTEST_ASSERT_EQUAL(2u, root.size());
+ JSONTEST_ASSERT_STRING_EQUAL("x", root["a"].asString());
+ JSONTEST_ASSERT_STRING_EQUAL("y", root["b"].asString());
+ }
+ delete reader;
+}
+
+struct BuilderTest : JsonTest::TestCase {};
+
+JSONTEST_FIXTURE(BuilderTest, settings) {
+ {
+ Json::Value errs;
+ Json::CharReaderBuilder rb;
+ JSONTEST_ASSERT_EQUAL(false, rb.settings_.isMember("foo"));
+ JSONTEST_ASSERT_EQUAL(true, rb.validate(&errs));
+ rb["foo"] = "bar";
+ JSONTEST_ASSERT_EQUAL(true, rb.settings_.isMember("foo"));
+ JSONTEST_ASSERT_EQUAL(false, rb.validate(&errs));
+ }
+ {
+ Json::Value errs;
+ Json::StreamWriterBuilder wb;
+ JSONTEST_ASSERT_EQUAL(false, wb.settings_.isMember("foo"));
+ JSONTEST_ASSERT_EQUAL(true, wb.validate(&errs));
+ wb["foo"] = "bar";
+ JSONTEST_ASSERT_EQUAL(true, wb.settings_.isMember("foo"));
+ JSONTEST_ASSERT_EQUAL(false, wb.validate(&errs));
+ }
+}
+
+struct IteratorTest : JsonTest::TestCase {};
+
+JSONTEST_FIXTURE(IteratorTest, distance) {
+ Json::Value json;
+ json["k1"] = "a";
+ json["k2"] = "b";
+ int dist = 0;
+ std::string str;
+ for (Json::ValueIterator it = json.begin(); it != json.end(); ++it) {
+ dist = it - json.begin();
+ str = it->asString().c_str();
+ }
+ JSONTEST_ASSERT_EQUAL(1, dist);
+ JSONTEST_ASSERT_STRING_EQUAL("b", str);
+}
+
+JSONTEST_FIXTURE(IteratorTest, names) {
+ Json::Value json;
+ json["k1"] = "a";
+ json["k2"] = "b";
+ Json::ValueIterator it = json.begin();
+ JSONTEST_ASSERT(it != json.end());
+ JSONTEST_ASSERT_EQUAL(Json::Value("k1"), it.key());
+ JSONTEST_ASSERT_STRING_EQUAL("k1", it.name());
+ JSONTEST_ASSERT_EQUAL(-1, it.index());
+ ++it;
+ JSONTEST_ASSERT(it != json.end());
+ JSONTEST_ASSERT_EQUAL(Json::Value("k2"), it.key());
+ JSONTEST_ASSERT_STRING_EQUAL("k2", it.name());
+ JSONTEST_ASSERT_EQUAL(-1, it.index());
+ ++it;
+ JSONTEST_ASSERT(it == json.end());
+}
+
+JSONTEST_FIXTURE(IteratorTest, indexes) {
+ Json::Value json;
+ json[0] = "a";
+ json[1] = "b";
+ Json::ValueIterator it = json.begin();
+ JSONTEST_ASSERT(it != json.end());
+ JSONTEST_ASSERT_EQUAL(Json::Value(Json::ArrayIndex(0)), it.key());
+ JSONTEST_ASSERT_STRING_EQUAL("", it.name());
+ JSONTEST_ASSERT_EQUAL(0, it.index());
+ ++it;
+ JSONTEST_ASSERT(it != json.end());
+ JSONTEST_ASSERT_EQUAL(Json::Value(Json::ArrayIndex(1)), it.key());
+ JSONTEST_ASSERT_STRING_EQUAL("", it.name());
+ JSONTEST_ASSERT_EQUAL(1, it.index());
+ ++it;
+ JSONTEST_ASSERT(it == json.end());
+}
+
int main(int argc, const char* argv[]) {
JsonTest::Runner runner;
JSONTEST_REGISTER_FIXTURE(runner, ValueTest, checkNormalizeFloatingPointStr);
JSONTEST_REGISTER_FIXTURE(runner, ValueTest, memberCount);
JSONTEST_REGISTER_FIXTURE(runner, ValueTest, objects);
JSONTEST_REGISTER_FIXTURE(runner, ValueTest, arrays);
+ JSONTEST_REGISTER_FIXTURE(runner, ValueTest, arrayIssue252);
JSONTEST_REGISTER_FIXTURE(runner, ValueTest, null);
JSONTEST_REGISTER_FIXTURE(runner, ValueTest, strings);
JSONTEST_REGISTER_FIXTURE(runner, ValueTest, bools);
@@ -1623,6 +2357,15 @@ int main(int argc, const char* argv[]) {
JSONTEST_REGISTER_FIXTURE(runner, ValueTest, compareType);
JSONTEST_REGISTER_FIXTURE(runner, ValueTest, offsetAccessors);
JSONTEST_REGISTER_FIXTURE(runner, ValueTest, typeChecksThrowExceptions);
+ JSONTEST_REGISTER_FIXTURE(runner, ValueTest, StaticString);
+ JSONTEST_REGISTER_FIXTURE(runner, ValueTest, CommentBefore);
+ //JSONTEST_REGISTER_FIXTURE(runner, ValueTest, nulls);
+ JSONTEST_REGISTER_FIXTURE(runner, ValueTest, zeroes);
+ JSONTEST_REGISTER_FIXTURE(runner, ValueTest, zeroesInKeys);
+
+ JSONTEST_REGISTER_FIXTURE(runner, WriterTest, dropNullPlaceholders);
+ JSONTEST_REGISTER_FIXTURE(runner, StreamWriterTest, dropNullPlaceholders);
+ JSONTEST_REGISTER_FIXTURE(runner, StreamWriterTest, writeZeroes);
JSONTEST_REGISTER_FIXTURE(runner, ReaderTest, parseWithNoErrors);
JSONTEST_REGISTER_FIXTURE(
@@ -1631,7 +2374,33 @@ int main(int argc, const char* argv[]) {
JSONTEST_REGISTER_FIXTURE(runner, ReaderTest, parseChineseWithOneError);
JSONTEST_REGISTER_FIXTURE(runner, ReaderTest, parseWithDetailError);
- JSONTEST_REGISTER_FIXTURE(runner, WriterTest, dropNullPlaceholders);
+ JSONTEST_REGISTER_FIXTURE(runner, CharReaderTest, parseWithNoErrors);
+ JSONTEST_REGISTER_FIXTURE(
+ runner, CharReaderTest, parseWithNoErrorsTestingOffsets);
+ JSONTEST_REGISTER_FIXTURE(runner, CharReaderTest, parseWithOneError);
+ JSONTEST_REGISTER_FIXTURE(runner, CharReaderTest, parseChineseWithOneError);
+ JSONTEST_REGISTER_FIXTURE(runner, CharReaderTest, parseWithDetailError);
+ JSONTEST_REGISTER_FIXTURE(runner, CharReaderTest, parseWithStackLimit);
+
+ JSONTEST_REGISTER_FIXTURE(runner, CharReaderStrictModeTest, dupKeys);
+
+ JSONTEST_REGISTER_FIXTURE(runner, CharReaderFailIfExtraTest, issue164);
+ JSONTEST_REGISTER_FIXTURE(runner, CharReaderFailIfExtraTest, issue107);
+ JSONTEST_REGISTER_FIXTURE(runner, CharReaderFailIfExtraTest, commentAfterObject);
+ JSONTEST_REGISTER_FIXTURE(runner, CharReaderFailIfExtraTest, commentAfterArray);
+ JSONTEST_REGISTER_FIXTURE(runner, CharReaderFailIfExtraTest, commentAfterBool);
+
+ JSONTEST_REGISTER_FIXTURE(runner, CharReaderAllowDropNullTest, issue178);
+
+ JSONTEST_REGISTER_FIXTURE(runner, CharReaderAllowSingleQuotesTest, issue182);
+
+ JSONTEST_REGISTER_FIXTURE(runner, CharReaderAllowZeroesTest, issue176);
+
+ JSONTEST_REGISTER_FIXTURE(runner, BuilderTest, settings);
+
+ JSONTEST_REGISTER_FIXTURE(runner, IteratorTest, distance);
+ JSONTEST_REGISTER_FIXTURE(runner, IteratorTest, names);
+ JSONTEST_REGISTER_FIXTURE(runner, IteratorTest, indexes);
return runner.runCommandLine(argc, argv);
}
diff --git a/3rdparty/jsoncpp/test/cleantests.py b/3rdparty/jsoncpp/test/cleantests.py
index c38fd8ffdd1..9772d542b3a 100644
--- a/3rdparty/jsoncpp/test/cleantests.py
+++ b/3rdparty/jsoncpp/test/cleantests.py
@@ -1,10 +1,16 @@
-# removes all files created during testing
+# Copyright 2007 Baptiste Lepilleur
+# Distributed under MIT license, or public domain if desired and
+# recognized in your jurisdiction.
+# See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
+
+"""Removes all files created during testing."""
+
import glob
import os
paths = []
for pattern in [ '*.actual', '*.actual-rewrite', '*.rewrite', '*.process-output' ]:
- paths += glob.glob( 'data/' + pattern )
+ paths += glob.glob('data/' + pattern)
for path in paths:
- os.unlink( path )
+ os.unlink(path)
diff --git a/3rdparty/jsoncpp/test/data/test_comment_00.expected b/3rdparty/jsoncpp/test/data/test_comment_00.expected
new file mode 100644
index 00000000000..284a797d714
--- /dev/null
+++ b/3rdparty/jsoncpp/test/data/test_comment_00.expected
@@ -0,0 +1,4 @@
+// Comment for array
+.=[]
+// Comment within array
+.[0]="one-element"
diff --git a/3rdparty/jsoncpp/test/data/test_comment_00.json b/3rdparty/jsoncpp/test/data/test_comment_00.json
new file mode 100644
index 00000000000..4df577a8ae2
--- /dev/null
+++ b/3rdparty/jsoncpp/test/data/test_comment_00.json
@@ -0,0 +1,5 @@
+// Comment for array
+[
+ // Comment within array
+ "one-element"
+]
diff --git a/3rdparty/jsoncpp/test/data/test_comment_01.expected b/3rdparty/jsoncpp/test/data/test_comment_01.expected
index 2a7f00c450b..1ed01ba100c 100644
--- a/3rdparty/jsoncpp/test/data/test_comment_01.expected
+++ b/3rdparty/jsoncpp/test/data/test_comment_01.expected
@@ -1,5 +1,7 @@
.={}
+// Comment for array
.test=[]
+// Comment within array
.test[0]={}
.test[0].a="aaa"
.test[1]={}
diff --git a/3rdparty/jsoncpp/test/data/test_comment_01.json b/3rdparty/jsoncpp/test/data/test_comment_01.json
index 7363490a91d..6defe400404 100644
--- a/3rdparty/jsoncpp/test/data/test_comment_01.json
+++ b/3rdparty/jsoncpp/test/data/test_comment_01.json
@@ -1,6 +1,8 @@
{
"test":
+ // Comment for array
[
+ // Comment within array
{ "a" : "aaa" }, // Comment for a
{ "b" : "bbb" }, // Comment for b
{ "c" : "ccc" } // Comment for c
diff --git a/3rdparty/jsoncpp/test/data/test_comment_02.expected b/3rdparty/jsoncpp/test/data/test_comment_02.expected
index 88d2bd0dc1b..8986dbac05e 100644
--- a/3rdparty/jsoncpp/test/data/test_comment_02.expected
+++ b/3rdparty/jsoncpp/test/data/test_comment_02.expected
@@ -11,4 +11,13 @@
// Multiline comment cpp-style
// Second line
.cpp-test.c=3
-.cpp-test.d=4
+// Comment before double
+.cpp-test.d=4.1
+// Comment before string
+.cpp-test.e="e-string"
+// Comment before true
+.cpp-test.f=true
+// Comment before false
+.cpp-test.g=false
+// Comment before null
+.cpp-test.h=null
diff --git a/3rdparty/jsoncpp/test/data/test_comment_02.json b/3rdparty/jsoncpp/test/data/test_comment_02.json
index 297d889036a..f5042e0dd68 100644
--- a/3rdparty/jsoncpp/test/data/test_comment_02.json
+++ b/3rdparty/jsoncpp/test/data/test_comment_02.json
@@ -12,6 +12,15 @@
// Multiline comment cpp-style
// Second line
"c" : 3,
- "d" : 4
+ // Comment before double
+ "d" : 4.1,
+ // Comment before string
+ "e" : "e-string",
+ // Comment before true
+ "f" : true,
+ // Comment before false
+ "g" : false,
+ // Comment before null
+ "h" : null
}
}
diff --git a/3rdparty/jsoncpp/test/generate_expected.py b/3rdparty/jsoncpp/test/generate_expected.py
index f668da23861..0b74f51ceef 100644
--- a/3rdparty/jsoncpp/test/generate_expected.py
+++ b/3rdparty/jsoncpp/test/generate_expected.py
@@ -1,10 +1,15 @@
+# Copyright 2007 Baptiste Lepilleur
+# Distributed under MIT license, or public domain if desired and
+# recognized in your jurisdiction.
+# See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
+
from __future__ import print_function
import glob
import os.path
-for path in glob.glob( '*.json' ):
+for path in glob.glob('*.json'):
text = file(path,'rt').read()
target = os.path.splitext(path)[0] + '.expected'
- if os.path.exists( target ):
+ if os.path.exists(target):
print('skipping:', target)
else:
print('creating:', target)
diff --git a/3rdparty/jsoncpp/test/pyjsontestrunner.py b/3rdparty/jsoncpp/test/pyjsontestrunner.py
index 3f08a8a7325..7f38356ae98 100644
--- a/3rdparty/jsoncpp/test/pyjsontestrunner.py
+++ b/3rdparty/jsoncpp/test/pyjsontestrunner.py
@@ -1,4 +1,11 @@
-# Simple implementation of a json test runner to run the test against json-py.
+# Copyright 2007 Baptiste Lepilleur
+# Distributed under MIT license, or public domain if desired and
+# recognized in your jurisdiction.
+# See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
+
+"""Simple implementation of a json test runner to run the test against
+json-py."""
+
from __future__ import print_function
import sys
import os.path
@@ -15,50 +22,50 @@ actual_path = base_path + '.actual'
rewrite_path = base_path + '.rewrite'
rewrite_actual_path = base_path + '.actual-rewrite'
-def valueTreeToString( fout, value, path = '.' ):
+def valueTreeToString(fout, value, path = '.'):
ty = type(value)
if ty is types.DictType:
- fout.write( '%s={}\n' % path )
+ fout.write('%s={}\n' % path)
suffix = path[-1] != '.' and '.' or ''
names = value.keys()
names.sort()
for name in names:
- valueTreeToString( fout, value[name], path + suffix + name )
+ valueTreeToString(fout, value[name], path + suffix + name)
elif ty is types.ListType:
- fout.write( '%s=[]\n' % path )
- for index, childValue in zip( xrange(0,len(value)), value ):
- valueTreeToString( fout, childValue, path + '[%d]' % index )
+ fout.write('%s=[]\n' % path)
+ for index, childValue in zip(xrange(0,len(value)), value):
+ valueTreeToString(fout, childValue, path + '[%d]' % index)
elif ty is types.StringType:
- fout.write( '%s="%s"\n' % (path,value) )
+ fout.write('%s="%s"\n' % (path,value))
elif ty is types.IntType:
- fout.write( '%s=%d\n' % (path,value) )
+ fout.write('%s=%d\n' % (path,value))
elif ty is types.FloatType:
- fout.write( '%s=%.16g\n' % (path,value) )
+ fout.write('%s=%.16g\n' % (path,value))
elif value is True:
- fout.write( '%s=true\n' % path )
+ fout.write('%s=true\n' % path)
elif value is False:
- fout.write( '%s=false\n' % path )
+ fout.write('%s=false\n' % path)
elif value is None:
- fout.write( '%s=null\n' % path )
+ fout.write('%s=null\n' % path)
else:
assert False and "Unexpected value type"
-def parseAndSaveValueTree( input, actual_path ):
- root = json.loads( input )
- fout = file( actual_path, 'wt' )
- valueTreeToString( fout, root )
+def parseAndSaveValueTree(input, actual_path):
+ root = json.loads(input)
+ fout = file(actual_path, 'wt')
+ valueTreeToString(fout, root)
fout.close()
return root
-def rewriteValueTree( value, rewrite_path ):
- rewrite = json.dumps( value )
+def rewriteValueTree(value, rewrite_path):
+ rewrite = json.dumps(value)
#rewrite = rewrite[1:-1] # Somehow the string is quoted ! jsonpy bug ?
- file( rewrite_path, 'wt').write( rewrite + '\n' )
+ file(rewrite_path, 'wt').write(rewrite + '\n')
return rewrite
-input = file( input_path, 'rt' ).read()
-root = parseAndSaveValueTree( input, actual_path )
-rewrite = rewriteValueTree( json.write( root ), rewrite_path )
-rewrite_root = parseAndSaveValueTree( rewrite, rewrite_actual_path )
+input = file(input_path, 'rt').read()
+root = parseAndSaveValueTree(input, actual_path)
+rewrite = rewriteValueTree(json.write(root), rewrite_path)
+rewrite_root = parseAndSaveValueTree(rewrite, rewrite_actual_path)
-sys.exit( 0 )
+sys.exit(0)
diff --git a/3rdparty/jsoncpp/test/runjsontests.py b/3rdparty/jsoncpp/test/runjsontests.py
index 9422d57d9dc..d21c02f3802 100644
--- a/3rdparty/jsoncpp/test/runjsontests.py
+++ b/3rdparty/jsoncpp/test/runjsontests.py
@@ -1,17 +1,41 @@
+# Copyright 2007 Baptiste Lepilleur
+# Distributed under MIT license, or public domain if desired and
+# recognized in your jurisdiction.
+# See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
+
from __future__ import print_function
+from __future__ import unicode_literals
+from io import open
+from glob import glob
import sys
import os
import os.path
-from glob import glob
import optparse
VALGRIND_CMD = 'valgrind --tool=memcheck --leak-check=yes --undef-value-errors=yes '
-def compareOutputs( expected, actual, message ):
+def getStatusOutput(cmd):
+ """
+ Return int, unicode (for both Python 2 and 3).
+ Note: os.popen().close() would return None for 0.
+ """
+ print(cmd, file=sys.stderr)
+ pipe = os.popen(cmd)
+ process_output = pipe.read()
+ try:
+ # We have been using os.popen(). When we read() the result
+ # we get 'str' (bytes) in py2, and 'str' (unicode) in py3.
+ # Ugh! There must be a better way to handle this.
+ process_output = process_output.decode('utf-8')
+ except AttributeError:
+ pass # python3
+ status = pipe.close()
+ return status, process_output
+def compareOutputs(expected, actual, message):
expected = expected.strip().replace('\r','').split('\n')
actual = actual.strip().replace('\r','').split('\n')
diff_line = 0
- max_line_to_compare = min( len(expected), len(actual) )
+ max_line_to_compare = min(len(expected), len(actual))
for index in range(0,max_line_to_compare):
if expected[index].strip() != actual[index].strip():
diff_line = index + 1
@@ -20,7 +44,7 @@ def compareOutputs( expected, actual, message ):
diff_line = max_line_to_compare+1
if diff_line == 0:
return None
- def safeGetLine( lines, index ):
+ def safeGetLine(lines, index):
index += -1
if index >= len(lines):
return ''
@@ -30,65 +54,65 @@ def compareOutputs( expected, actual, message ):
Actual: '%s'
""" % (message, diff_line,
safeGetLine(expected,diff_line),
- safeGetLine(actual,diff_line) )
+ safeGetLine(actual,diff_line))
-def safeReadFile( path ):
+def safeReadFile(path):
try:
- return file( path, 'rt' ).read()
+ return open(path, 'rt', encoding = 'utf-8').read()
except IOError as e:
return '<File "%s" is missing: %s>' % (path,e)
-def runAllTests( jsontest_executable_path, input_dir = None,
- use_valgrind=False, with_json_checker=False ):
+def runAllTests(jsontest_executable_path, input_dir = None,
+ use_valgrind=False, with_json_checker=False,
+ writerClass='StyledWriter'):
if not input_dir:
- input_dir = os.path.join( os.getcwd(), 'data' )
- tests = glob( os.path.join( input_dir, '*.json' ) )
+ input_dir = os.path.join(os.getcwd(), 'data')
+ tests = glob(os.path.join(input_dir, '*.json'))
if with_json_checker:
- test_jsonchecker = glob( os.path.join( input_dir, '../jsonchecker', '*.json' ) )
+ test_jsonchecker = glob(os.path.join(input_dir, '../jsonchecker', '*.json'))
else:
test_jsonchecker = []
failed_tests = []
valgrind_path = use_valgrind and VALGRIND_CMD or ''
for input_path in tests + test_jsonchecker:
- expect_failure = os.path.basename( input_path ).startswith( 'fail' )
+ expect_failure = os.path.basename(input_path).startswith('fail')
is_json_checker_test = (input_path in test_jsonchecker) or expect_failure
print('TESTING:', input_path, end=' ')
options = is_json_checker_test and '--json-checker' or ''
- pipe = os.popen( '%s%s %s "%s"' % (
- valgrind_path, jsontest_executable_path, options,
- input_path) )
- process_output = pipe.read()
- status = pipe.close()
+ options += ' --json-writer %s'%writerClass
+ cmd = '%s%s %s "%s"' % ( valgrind_path, jsontest_executable_path, options,
+ input_path)
+ status, process_output = getStatusOutput(cmd)
if is_json_checker_test:
if expect_failure:
- if status is None:
+ if not status:
print('FAILED')
- failed_tests.append( (input_path, 'Parsing should have failed:\n%s' %
- safeReadFile(input_path)) )
+ failed_tests.append((input_path, 'Parsing should have failed:\n%s' %
+ safeReadFile(input_path)))
else:
print('OK')
else:
- if status is not None:
+ if status:
print('FAILED')
- failed_tests.append( (input_path, 'Parsing failed:\n' + process_output) )
+ failed_tests.append((input_path, 'Parsing failed:\n' + process_output))
else:
print('OK')
else:
base_path = os.path.splitext(input_path)[0]
- actual_output = safeReadFile( base_path + '.actual' )
- actual_rewrite_output = safeReadFile( base_path + '.actual-rewrite' )
- file(base_path + '.process-output','wt').write( process_output )
+ actual_output = safeReadFile(base_path + '.actual')
+ actual_rewrite_output = safeReadFile(base_path + '.actual-rewrite')
+ open(base_path + '.process-output', 'wt', encoding = 'utf-8').write(process_output)
if status:
print('parsing failed')
- failed_tests.append( (input_path, 'Parsing failed:\n' + process_output) )
+ failed_tests.append((input_path, 'Parsing failed:\n' + process_output))
else:
expected_output_path = os.path.splitext(input_path)[0] + '.expected'
- expected_output = file( expected_output_path, 'rt' ).read()
- detail = ( compareOutputs( expected_output, actual_output, 'input' )
- or compareOutputs( expected_output, actual_rewrite_output, 'rewrite' ) )
+ expected_output = open(expected_output_path, 'rt', encoding = 'utf-8').read()
+ detail = (compareOutputs(expected_output, actual_output, 'input')
+ or compareOutputs(expected_output, actual_rewrite_output, 'rewrite'))
if detail:
print('FAILED')
- failed_tests.append( (input_path, detail) )
+ failed_tests.append((input_path, detail))
else:
print('OK')
@@ -100,7 +124,7 @@ def runAllTests( jsontest_executable_path, input_dir = None,
print(failed_test[1])
print()
print('Test results: %d passed, %d failed.' % (len(tests)-len(failed_tests),
- len(failed_tests) ))
+ len(failed_tests)))
return 1
else:
print('All %d tests passed.' % len(tests))
@@ -108,7 +132,7 @@ def runAllTests( jsontest_executable_path, input_dir = None,
def main():
from optparse import OptionParser
- parser = OptionParser( usage="%prog [options] <path to jsontestrunner.exe> [test case directory]" )
+ parser = OptionParser(usage="%prog [options] <path to jsontestrunner.exe> [test case directory]")
parser.add_option("--valgrind",
action="store_true", dest="valgrind", default=False,
help="run all the tests using valgrind to detect memory leaks")
@@ -119,17 +143,32 @@ def main():
options, args = parser.parse_args()
if len(args) < 1 or len(args) > 2:
- parser.error( 'Must provides at least path to jsontestrunner executable.' )
- sys.exit( 1 )
+ parser.error('Must provides at least path to jsontestrunner executable.')
+ sys.exit(1)
- jsontest_executable_path = os.path.normpath( os.path.abspath( args[0] ) )
+ jsontest_executable_path = os.path.normpath(os.path.abspath(args[0]))
if len(args) > 1:
- input_path = os.path.normpath( os.path.abspath( args[1] ) )
+ input_path = os.path.normpath(os.path.abspath(args[1]))
else:
input_path = None
- status = runAllTests( jsontest_executable_path, input_path,
- use_valgrind=options.valgrind, with_json_checker=options.with_json_checker )
- sys.exit( status )
+ status = runAllTests(jsontest_executable_path, input_path,
+ use_valgrind=options.valgrind,
+ with_json_checker=options.with_json_checker,
+ writerClass='StyledWriter')
+ if status:
+ sys.exit(status)
+ status = runAllTests(jsontest_executable_path, input_path,
+ use_valgrind=options.valgrind,
+ with_json_checker=options.with_json_checker,
+ writerClass='StyledStreamWriter')
+ if status:
+ sys.exit(status)
+ status = runAllTests(jsontest_executable_path, input_path,
+ use_valgrind=options.valgrind,
+ with_json_checker=options.with_json_checker,
+ writerClass='BuiltStyledStreamWriter')
+ if status:
+ sys.exit(status)
if __name__ == '__main__':
main()
diff --git a/3rdparty/jsoncpp/test/rununittests.py b/3rdparty/jsoncpp/test/rununittests.py
index 6279f80e3c6..08850ec1a1d 100644
--- a/3rdparty/jsoncpp/test/rununittests.py
+++ b/3rdparty/jsoncpp/test/rununittests.py
@@ -1,4 +1,11 @@
+# Copyright 2009 Baptiste Lepilleur
+# Distributed under MIT license, or public domain if desired and
+# recognized in your jurisdiction.
+# See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
+
from __future__ import print_function
+from __future__ import unicode_literals
+from io import open
from glob import glob
import sys
import os
@@ -9,37 +16,41 @@ import optparse
VALGRIND_CMD = 'valgrind --tool=memcheck --leak-check=yes --undef-value-errors=yes'
class TestProxy(object):
- def __init__( self, test_exe_path, use_valgrind=False ):
- self.test_exe_path = os.path.normpath( os.path.abspath( test_exe_path ) )
+ def __init__(self, test_exe_path, use_valgrind=False):
+ self.test_exe_path = os.path.normpath(os.path.abspath(test_exe_path))
self.use_valgrind = use_valgrind
- def run( self, options ):
+ def run(self, options):
if self.use_valgrind:
cmd = VALGRIND_CMD.split()
else:
cmd = []
- cmd.extend( [self.test_exe_path, '--test-auto'] + options )
- process = subprocess.Popen( cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT )
+ cmd.extend([self.test_exe_path, '--test-auto'] + options)
+ try:
+ process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+ except:
+ print(cmd)
+ raise
stdout = process.communicate()[0]
if process.returncode:
return False, stdout
return True, stdout
-def runAllTests( exe_path, use_valgrind=False ):
- test_proxy = TestProxy( exe_path, use_valgrind=use_valgrind )
- status, test_names = test_proxy.run( ['--list-tests'] )
+def runAllTests(exe_path, use_valgrind=False):
+ test_proxy = TestProxy(exe_path, use_valgrind=use_valgrind)
+ status, test_names = test_proxy.run(['--list-tests'])
if not status:
print("Failed to obtain unit tests list:\n" + test_names, file=sys.stderr)
return 1
- test_names = [name.strip() for name in test_names.strip().split('\n')]
+ test_names = [name.strip() for name in test_names.decode('utf-8').strip().split('\n')]
failures = []
for name in test_names:
print('TESTING %s:' % name, end=' ')
- succeed, result = test_proxy.run( ['--test', name] )
+ succeed, result = test_proxy.run(['--test', name])
if succeed:
print('OK')
else:
- failures.append( (name, result) )
+ failures.append((name, result))
print('FAILED')
failed_count = len(failures)
pass_count = len(test_names) - failed_count
@@ -47,8 +58,7 @@ def runAllTests( exe_path, use_valgrind=False ):
print()
for name, result in failures:
print(result)
- print('%d/%d tests passed (%d failure(s))' % (
- pass_count, len(test_names), failed_count))
+ print('%d/%d tests passed (%d failure(s))' % ( pass_count, len(test_names), failed_count))
return 1
else:
print('All %d tests passed' % len(test_names))
@@ -56,7 +66,7 @@ def runAllTests( exe_path, use_valgrind=False ):
def main():
from optparse import OptionParser
- parser = OptionParser( usage="%prog [options] <path to test_lib_json.exe>" )
+ parser = OptionParser(usage="%prog [options] <path to test_lib_json.exe>")
parser.add_option("--valgrind",
action="store_true", dest="valgrind", default=False,
help="run all the tests using valgrind to detect memory leaks")
@@ -64,11 +74,11 @@ def main():
options, args = parser.parse_args()
if len(args) != 1:
- parser.error( 'Must provides at least path to test_lib_json executable.' )
- sys.exit( 1 )
+ parser.error('Must provides at least path to test_lib_json executable.')
+ sys.exit(1)
- exit_code = runAllTests( args[0], use_valgrind=options.valgrind )
- sys.exit( exit_code )
+ exit_code = runAllTests(args[0], use_valgrind=options.valgrind)
+ sys.exit(exit_code)
if __name__ == '__main__':
main()
diff --git a/3rdparty/jsoncpp/travis.sh b/3rdparty/jsoncpp/travis.sh
new file mode 100644
index 00000000000..2b25f4766fd
--- /dev/null
+++ b/3rdparty/jsoncpp/travis.sh
@@ -0,0 +1,29 @@
+#!/usr/bin/env sh
+# This is called by `.travis.yml` via Travis CI.
+# Travis supplies $TRAVIS_OS_NAME.
+# http://docs.travis-ci.com/user/multi-os/
+# Our .travis.yml also defines:
+# - SHARED_LIB=ON/OFF
+# - STATIC_LIB=ON/OFF
+# - CMAKE_PKG=ON/OFF
+# - BUILD_TYPE=release/debug
+# - VERBOSE_MAKE=false/true
+# - VERBOSE (set or not)
+
+# -e: fail on error
+# -v: show commands
+# -x: show expanded commands
+set -vex
+
+env | sort
+
+cmake -DJSONCPP_WITH_CMAKE_PACKAGE=$CMAKE_PKG -DBUILD_SHARED_LIBS=$SHARED_LIB -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_VERBOSE_MAKEFILE=$VERBOSE_MAKE .
+make
+
+# Python is not available in Travis for osx.
+# https://github.com/travis-ci/travis-ci/issues/2320
+if [ "$TRAVIS_OS_NAME" != "osx" ]
+then
+ make jsoncpp_check
+ valgrind --error-exitcode=42 --leak-check=full ./src/test_lib_json/jsoncpp_test
+fi
diff --git a/3rdparty/jsoncpp/version b/3rdparty/jsoncpp/version
index 6314daca8b0..fdd3be6df54 100644
--- a/3rdparty/jsoncpp/version
+++ b/3rdparty/jsoncpp/version
@@ -1 +1 @@
-1.1.0 \ No newline at end of file
+1.6.2
diff --git a/3rdparty/jsoncpp/version.in b/3rdparty/jsoncpp/version.in
new file mode 100644
index 00000000000..bfc03f7dd72
--- /dev/null
+++ b/3rdparty/jsoncpp/version.in
@@ -0,0 +1 @@
+@JSONCPP_VERSION@
diff --git a/3rdparty/lsqlite3/lsqlite3.c b/3rdparty/lsqlite3/lsqlite3.c
index 415e9d84776..072d33b59eb 100644
--- a/3rdparty/lsqlite3/lsqlite3.c
+++ b/3rdparty/lsqlite3/lsqlite3.c
@@ -47,7 +47,11 @@
#define luaL_openlib(L,name,reg,nup) luaL_setfuncs(L,reg,nup)
#endif
+#ifndef USE_SYSTEM_SQLITE
#include "sqlite3/sqlite3.h"
+#else
+#include <sqlite3.h>
+#endif
/* compile time features */
#if !defined(SQLITE_OMIT_PROGRESS_CALLBACK)
@@ -260,7 +264,7 @@ static int dbvm_tostring(lua_State *L) {
if (svm->vm == NULL)
strcpy(buff, "closed");
else
- sprintf(buff, "%p", svm);
+ sprintf(buff, "%p", (void *)svm);
lua_pushfstring(L, "sqlite virtual machine (%s)", buff);
return 1;
}
@@ -743,7 +747,7 @@ static int lcontext_tostring(lua_State *L) {
if (ctx->ctx == NULL)
strcpy(buff, "closed");
else
- sprintf(buff, "%p", ctx->ctx);
+ sprintf(buff, "%p", (void *) ctx->ctx);
lua_pushfstring(L, "sqlite function context (%s)", buff);
return 1;
}
diff --git a/3rdparty/mongoose/README.md b/3rdparty/mongoose/README.md
index c0dcc2aaaf8..4b4fc3219ba 100644
--- a/3rdparty/mongoose/README.md
+++ b/3rdparty/mongoose/README.md
@@ -1,5 +1,7 @@
# <img src="http://cesanta.com/images/mongoose_logo.png" width="64" height="64"> Mongoose Web Server
+[![Join the chat at https://gitter.im/cesanta/mongoose](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/cesanta/mongoose?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
+
Mongoose is the most easy to use web server on the planet. A web server of choice for Web developers (PHP, Ruby, Python, etc) and Web designers.
Mongoose is built on top of Libmongoose embedded library, which can turn
@@ -45,24 +47,13 @@ Download, double-click to start, run browser -- that's all!
![shot3](http://cesanta.com/images/tut_sharing/tut3.png)
![shot4](http://cesanta.com/images/tut_sharing/tut4.png)
-# Acknowledgements
-
-Mongoose made better thanks to the contribution of following people:
-
-Arnout Vandecappelle, Benoît Amiaux, Boris Pek, Cody Hanson, Colin Leitner,
-Daniel Oaks, Eric Bakan, Erik Oomen, Filipp Kovalev, Ger Hobbelt,
-Hendrik Polczynski, Igor Okulist, Jay, Joe Mucchiello, John Safranek,
-José Miguel Gonçalves, Shueng Chuan, Katerina Blinova, Konstantin Sorokin,
-Marin Atanasov, Matt Healy, Mitch Hendrickson, Nigel Stewart, Pavel Khlebovich,
-Sebastian Reinhard, Stefan Doehla, abadc0de, nullable.type,
-T.Barmann, D.Hughes, J.C.Sloan, R.Romeo, L.E.Spencer, S.Kotay, R.M.Shorter,
-W.Mar, J.Wilander, Santa from Memphis, S.Davies, C.Beck,
-O.M.Vilhunen, C.Radik, G.Woodcock, M.Szczepkowski,
-Eternal Lands Dev Team, T.Tollet, C.Tangerino, G.Karsai, A.Bourgett,
-C.Blakemore, D.Fonaryov, T.Andrle, O.IJsselmuiden, R.Womack, M.Tomlinson,
-A.Slåttå, L.Farrell, J.D.P.Ballestero, V.Albaev, B.Harker, T.Scheffel, H.Klein,
-R.Merit, T.Bennett, H.Solis, A.Zincenko, M.S., S.Krul, K.Cooke, S.McCallum,
-F.Morenius, and 10 others.
+# Contributions
+
+People who have agreed to the
+[Cesanta CLA](http://cesanta.com/contributors_la.html)
+can make contributions. Note that the CLA isn't a copyright
+_assigment_ but rather a copyright _license_.
+You retain the copyright on your contributions.
# Licensing
@@ -72,11 +63,11 @@ source licenses. The GPLv2 open source License does not generally permit
incorporating this software into non-open source programs.
For those customers who do not wish to comply with the GPLv2 open
source license requirements,
-[Cesanta Software](http://cesanta.com) offers a full,
+[Cesanta](http://cesanta.com) offers a full,
royalty-free commercial license and professional support
without any of the GPL restrictions.
-# Other products by Cesanta Software: simple and effective
+# Other products by Cesanta
- [Fossa](http://github.com/cesanta/fossa) - Multi-protocol networking library
- [SSL Wrapper](https://github.com/cesanta/ssl_wrapper) - application to
@@ -84,3 +75,4 @@ without any of the GPL restrictions.
- [Frozen](https://github.com/cesanta/frozen) - JSON parser and generator
- [SLRE](https://github.com/cesanta/slre) - Super Light Regular Expression
library
+- [V7](https://github.com/cesanta/v7) - Embedded JavaScript engine
diff --git a/3rdparty/mongoose/docs/ReleaseNotes.md b/3rdparty/mongoose/docs/ReleaseNotes.md
index 24874f824a0..10fd4592609 100644
--- a/3rdparty/mongoose/docs/ReleaseNotes.md
+++ b/3rdparty/mongoose/docs/ReleaseNotes.md
@@ -168,7 +168,7 @@ Changes in pre-compiled binaries:
since mongoose buffers all data prior to calling the callback
* keep-alive support is the default
* Dropped SSI support and throttling support
- * Several configuraition parameters are gone:
+ * Several configuration parameters are gone:
* `cgi_environment` (replaced with MONGOOSE_CGI),
* `protect_uri` (not useful)
* `ssi_pattern` (SSI support is gone)
@@ -214,5 +214,5 @@ Changes in pre-compiled binaries:
* Couple of bugfixes, thanks to contributors
-Eearlier release notes could be found by searching
+Earlier release notes could be found by searching
[Mongoose mailing list](https://groups.google.com/forum/#!forum/mongoose-users)
diff --git a/3rdparty/mongoose/examples/array_vars/Makefile b/3rdparty/mongoose/examples/array_vars/Makefile
new file mode 100644
index 00000000000..5ce2d1db6cb
--- /dev/null
+++ b/3rdparty/mongoose/examples/array_vars/Makefile
@@ -0,0 +1,21 @@
+# Copyright (c) 2014 Cesanta Software
+# All rights reserved
+
+PROG = array_vars
+CFLAGS = -W -Wall -I../.. -pthread -g -O0 $(CFLAGS_EXTRA)
+SOURCES = $(PROG).c ../../mongoose.c
+
+all: $(PROG)
+
+run: $(PROG)
+ ./$(PROG)
+
+$(PROG): $(SOURCES) Makefile
+ $(CC) -o $(PROG) $(SOURCES) $(CFLAGS)
+
+win:
+ wine cl $(SOURCES) /MD /nologo /DNDEBUG /O1 /I../.. /Fe$(PROG).exe
+ wine $(PROG).exe
+
+clean:
+ rm -rf $(PROG) *.exe *.dSYM *.obj *.exp .*o *.lib *.gc*
diff --git a/3rdparty/mongoose/examples/array_vars/array_vars.c b/3rdparty/mongoose/examples/array_vars/array_vars.c
new file mode 100644
index 00000000000..d631a7b0c79
--- /dev/null
+++ b/3rdparty/mongoose/examples/array_vars/array_vars.c
@@ -0,0 +1,45 @@
+// Copyright (c) 2014 Cesanta Software
+// All rights reserved
+//
+// This example demostrates how to use array get variables using mg_get_n_var
+// $Date: 2014-09-09 22:20:23 UTC $
+
+#include <stdio.h>
+#include <string.h>
+#include "mongoose.h"
+
+static int ev_handler(struct mg_connection *conn, enum mg_event ev) {
+ switch (ev) {
+ case MG_AUTH: return MG_TRUE;
+ case MG_REQUEST:
+ {
+ mg_printf_data(conn, "Hello! Requested URI is [%s] ", conn->uri);
+ char buffer[1024];
+ int i, ret;
+ for(i=0; (ret = mg_get_var_n(conn, "foo[]", buffer, 1024, i)) > 0; i++)
+ mg_printf_data(conn, "\nfoo[%d] = %s", i, buffer);
+
+ return MG_TRUE;
+ }
+ default: return MG_FALSE;
+ }
+}
+
+int main(void) {
+ struct mg_server *server;
+
+ // Create and configure the server
+ server = mg_create_server(NULL, ev_handler);
+ mg_set_option(server, "listening_port", "8080");
+
+ // Serve request. Hit Ctrl-C to terminate the program
+ printf("Starting on port %s\n", mg_get_option(server, "listening_port"));
+ for (;;) {
+ mg_poll_server(server, 1000);
+ }
+
+ // Cleanup, and free server instance
+ mg_destroy_server(&server);
+
+ return 0;
+}
diff --git a/3rdparty/mongoose/examples/cookie_authentication/cookie_auth.c b/3rdparty/mongoose/examples/cookie_authentication/cookie_auth.c
index f3621faeed7..c35e0445ef2 100644
--- a/3rdparty/mongoose/examples/cookie_authentication/cookie_auth.c
+++ b/3rdparty/mongoose/examples/cookie_authentication/cookie_auth.c
@@ -58,6 +58,7 @@ static int check_login_form_submission(struct mg_connection *conn) {
mg_printf(conn,
"HTTP/1.1 302 Moved\r\n"
"Set-Cookie: ssid=%s; expire=\"%s\"; http-only; HttpOnly;\r\n"
+ "Content-Length: 0\r\n"
"Location: /\r\n\r\n",
ssid, expire);
return MG_TRUE;
diff --git a/3rdparty/mongoose/examples/file_upload/file_upload.c b/3rdparty/mongoose/examples/file_upload/file_upload.c
index f0c6a1a4238..eedfc837c57 100644
--- a/3rdparty/mongoose/examples/file_upload/file_upload.c
+++ b/3rdparty/mongoose/examples/file_upload/file_upload.c
@@ -7,23 +7,25 @@
static int send_index_page(struct mg_connection *conn) {
const char *data;
- int data_len, ofs = 0;
+ int data_len, n1, n2;
char var_name[100], file_name[100];
mg_printf_data(conn, "%s",
"<html><body>Upload example."
"<form method=\"POST\" action=\"/handle_post_request\" "
" enctype=\"multipart/form-data\">"
- "<input type=\"file\" name=\"file\" /> <br/>"
+ "<input type=\"file\" name=\"file1\" /> <br/>"
+ "<input type=\"file\" name=\"file2\" /> <br/>"
"<input type=\"submit\" value=\"Upload\" />"
"</form>");
- while ((ofs = mg_parse_multipart(conn->content + ofs, conn->content_len - ofs,
- var_name, sizeof(var_name),
- file_name, sizeof(file_name),
- &data, &data_len)) > 0) {
+ n1 = n2 = 0;
+ while ((n2 = mg_parse_multipart(conn->content + n1, conn->content_len - n1,
+ var_name, sizeof(var_name), file_name,
+ sizeof(file_name), &data, &data_len)) > 0) {
mg_printf_data(conn, "var: %s, file_name: %s, size: %d bytes<br>",
var_name, file_name, data_len);
+ n1 += n2;
}
mg_printf_data(conn, "%s", "</body></html>");
diff --git a/3rdparty/mongoose/examples/web_server/Makefile b/3rdparty/mongoose/examples/web_server/Makefile
index ee9bc1b0476..4f9eacb6d06 100644
--- a/3rdparty/mongoose/examples/web_server/Makefile
+++ b/3rdparty/mongoose/examples/web_server/Makefile
@@ -2,7 +2,7 @@
# All rights reserved
PROG = web_server
-CFLAGS = -W -Wall -I../.. -pthread -g -O0 -DMONGOOSE_ENABLE_THREADS $(CFLAGS_EXTRA)
+CFLAGS = -W -Wall -I../.. -g -O0 $(CFLAGS_EXTRA)
SOURCES = $(PROG).c ../../mongoose.c
OPENSSL_FLAGS = -DNS_ENABLE_SSL -lssl
@@ -13,16 +13,18 @@ SOURCES_POLAR = $(SOURCES) $(POLARSSLCOMPAT_PATH)/polarssl_compat.c
INCDIR_POLAR = -I$(POLARSSLCOMPAT_PATH) -I$(POLARSSL_PATH)/include
LDFLAGS_POLAR = -L$(POLARSSL_PATH)/lib -lmbedtls
CFLAGS_POLAR = $(CFLAGS) $(INCDIR_POLAR) -DNS_ENABLE_SSL
-#
$(PROG): $(SOURCES)
$(CC) -o $(PROG) $(SOURCES) $(CFLAGS)
+$(PROG).exe: $(SOURCES)
+ cl -Fo $(PROG) $(SOURCES) -nologo -MD -I../..
+
openssl:
$(CC) -o $(PROG) $(SOURCES) $(CFLAGS) $(OPENSSL_FLAGS)
polarssl:
$(CC) -o $(PROG) $(SOURCES_POLAR) $(LDFLAGS_POLAR) $(CFLAGS_POLAR)
-
+
clean:
rm -rf $(PROG) *.exe *.dSYM *.obj *.exp .*o *.lib
diff --git a/3rdparty/mongoose/examples/web_server/web_server.c b/3rdparty/mongoose/examples/web_server/web_server.c
index 03c13d0aab2..4d256a8fedf 100644
--- a/3rdparty/mongoose/examples/web_server/web_server.c
+++ b/3rdparty/mongoose/examples/web_server/web_server.c
@@ -40,7 +40,9 @@
#define DIRSEP '\\'
#define snprintf _snprintf
#define vsnprintf _vsnprintf
+#ifndef sleep
#define sleep(x) Sleep((x) * 1000)
+#endif
#define abs_path(rel, abs, abs_size) _fullpath((abs), (rel), (abs_size))
#define SIGCHLD 0
typedef struct _stat file_stat_t;
diff --git a/3rdparty/mongoose/mongoose.c b/3rdparty/mongoose/mongoose.c
index a12ccdac5d7..fce6e0405b6 100644
--- a/3rdparty/mongoose/mongoose.c
+++ b/3rdparty/mongoose/mongoose.c
@@ -63,6 +63,10 @@
#pragma warning (disable : 4204) // missing c99 support
#endif
+#if defined(_WIN32) && !defined(MONGOOSE_NO_CGI) && !defined(MONGOOSE_ENABLE_THREADS)
+#define MONGOOSE_ENABLE_THREADS /* Windows uses stdio threads for CGI */
+#endif
+
#ifndef MONGOOSE_ENABLE_THREADS
#define NS_DISABLE_THREADS
#endif
@@ -91,6 +95,9 @@
#include <BaseTsd.h>
typedef SSIZE_T ssize_t;
#endif
+#ifndef FD_SETSIZE
+#define FD_SETSIZE 1024
+#endif
#include <winsock2.h>
#include <ws2tcpip.h>
#include <windows.h>
@@ -231,6 +238,7 @@ struct ns_connection {
sock_t sock; // Socket
union socket_address sa; // Peer address
+ size_t recv_iobuf_limit; /* Max size of recv buffer */
struct iobuf recv_iobuf; // Received data
struct iobuf send_iobuf; // Data scheduled for sending
SSL *ssl;
@@ -250,6 +258,7 @@ struct ns_connection {
#define NSF_WANT_WRITE (1 << 6)
#define NSF_LISTENING (1 << 7)
#define NSF_UDP (1 << 8)
+#define NSF_DISCARD (1 << 9)
#define NSF_USER_1 (1 << 20)
#define NSF_USER_2 (1 << 21)
@@ -326,6 +335,7 @@ int ns_resolve(const char *domain_name, char *ip_addr_buf, size_t buf_len);
#define NS_CALLOC calloc
#endif
+#define NS_MAX_SOCKETPAIR_ATTEMPTS 10
#define NS_CTL_MSG_MESSAGE_SIZE (8 * 1024)
#define NS_READ_BUFFER_SIZE 2048
#define NS_UDP_RECEIVE_BUFFER_SIZE 2000
@@ -854,7 +864,17 @@ static int ns_is_error(int n) {
#ifdef _WIN32
&& WSAGetLastError() != WSAEINTR && WSAGetLastError() != WSAEWOULDBLOCK
#endif
- );
+ )
+#ifdef NS_ENABLE_SSL
+ /*
+ * OpenSSL can return an error when the peer is closing the socket.
+ * We don't encounter this error with openssl actually, but it's returned
+ * by our polarssl <-> openssl wrapper who tries to speak the openssl API
+ * as we understood it.
+ */
+ || n == SSL_AD_CLOSE_NOTIFY
+#endif
+ ;
}
void ns_sock_to_str(sock_t sock, char *buf, size_t len, int flags) {
@@ -1056,7 +1076,7 @@ static void ns_handle_udp(struct ns_connection *ls) {
}
static void ns_add_to_set(sock_t sock, fd_set *set, sock_t *max_fd) {
- if (sock != INVALID_SOCKET) {
+ if ( (sock != INVALID_SOCKET) && (sock < FD_SETSIZE) ) {
FD_SET(sock, set);
if (*max_fd == INVALID_SOCKET || sock > *max_fd) {
*max_fd = sock;
@@ -1099,7 +1119,9 @@ time_t ns_mgr_poll(struct ns_mgr *mgr, int milli) {
tv.tv_sec = milli / 1000;
tv.tv_usec = (milli % 1000) * 1000;
- if (select((int) max_fd + 1, &read_set, &write_set, NULL, &tv) > 0) {
+ if (select((int) max_fd + 1, &read_set, &write_set, NULL, &tv) < 0) {
+ return 0;
+ } else {
// select() might have been waiting for a long time, reset current_time
// now to prevent last_io_time being set to the past.
current_time = time(NULL);
@@ -1250,9 +1272,12 @@ void ns_mgr_init(struct ns_mgr *s, void *user_data) {
#endif
#ifndef NS_DISABLE_SOCKETPAIR
- do {
- ns_socketpair2(s->ctl, SOCK_DGRAM);
- } while (s->ctl[0] == INVALID_SOCKET);
+ {
+ int attempts = 0, max_attempts = NS_MAX_SOCKETPAIR_ATTEMPTS;
+ do {
+ ns_socketpair2(s->ctl, SOCK_DGRAM);
+ } while (s->ctl[0] == INVALID_SOCKET && ++attempts < max_attempts);
+ }
#endif
#ifdef NS_ENABLE_SSL
@@ -1404,7 +1429,7 @@ struct dir_entry {
file_stat_t st;
};
-// NOTE(lsm): this enum shoulds be in sync with the config_options.
+// NOTE(lsm): this enum should be in sync with the config_options.
enum {
ACCESS_CONTROL_LIST,
#ifndef MONGOOSE_NO_FILESYSTEM
@@ -1948,13 +1973,21 @@ static void write_chunk(struct connection *conn, const char *buf, int len) {
}
size_t mg_printf(struct mg_connection *conn, const char *fmt, ...) {
- struct connection *c = MG_CONN_2_CONN(conn);
va_list ap;
+ int ret;
va_start(ap, fmt);
- ns_vprintf(c->ns_conn, fmt, ap);
+ ret = mg_vprintf(conn, fmt, ap);
va_end(ap);
+ return ret;
+}
+
+size_t mg_vprintf(struct mg_connection *conn, const char *fmt, va_list ap) {
+ struct connection *c = MG_CONN_2_CONN(conn);
+
+ ns_vprintf(c->ns_conn, fmt, ap);
+
return c->ns_conn->send_iobuf.len;
}
@@ -1973,6 +2006,8 @@ struct threadparam {
static int wait_until_ready(sock_t sock, int for_read) {
fd_set set;
+ if ( (sock == INVALID_SOCKET) || (sock >= FD_SETSIZE) )
+ return 0;
FD_ZERO(&set);
FD_SET(sock, &set);
select(sock + 1, for_read ? &set : 0, for_read ? 0 : &set, 0, 0);
@@ -1992,7 +2027,7 @@ static void *push_to_stdin(void *arg) {
if (!WriteFile(tp->hPipe, buf + sent, n - sent, &k, 0)) stop = 1;
}
}
- DBG(("%s", "FORWARED EVERYTHING TO CGI"));
+ DBG(("%s", "FORWARDED EVERYTHING TO CGI"));
CloseHandle(tp->hPipe);
NS_FREE(tp);
_endthread();
@@ -2312,9 +2347,17 @@ static void open_cgi_endpoint(struct connection *conn, const char *prog) {
// Try to create socketpair in a loop until success. ns_socketpair()
// can be interrupted by a signal and fail.
// TODO(lsm): use sigaction to restart interrupted syscall
- do {
- ns_socketpair(fds);
- } while (fds[0] == INVALID_SOCKET);
+ {
+ int attempts = 0, max_attempts = NS_MAX_SOCKETPAIR_ATTEMPTS;
+ do {
+ ns_socketpair(fds);
+ } while (fds[0] == INVALID_SOCKET && ++attempts < max_attempts);
+
+ if (fds[0] == INVALID_SOCKET) {
+ closesocket(fds[0]);
+ send_http_error(conn, 500, "ns_socketpair() failed");
+ }
+ }
if (start_process(conn->server->config_options[CGI_INTERPRETER],
prog, blk.buf, blk.vars, dir, fds[1]) != 0) {
@@ -2503,7 +2546,7 @@ static size_t parse_http_message(char *buf, size_t len,
buf[len - 1] = '\0';
- // RFC says that all initial whitespaces should be ingored
+ // RFC says that all initial whitespaces should be ignored
while (*buf != '\0' && isspace(* (unsigned char *) buf)) {
buf++;
}
@@ -2677,7 +2720,8 @@ static int convert_uri_to_file_name(struct connection *conn, char *buf,
#endif
const char *uri = conn->mg_conn.uri;
const char *domain = mg_get_header(&conn->mg_conn, "Host");
- size_t match_len, root_len = root == NULL ? 0 : strlen(root);
+ // Important: match_len has to be declared as int, unless rewrites break.
+ int match_len, root_len = root == NULL ? 0 : strlen(root);
// Perform virtual hosting rewrites
if (rewrites != NULL && domain != NULL) {
@@ -2784,16 +2828,24 @@ size_t mg_send_data(struct mg_connection *c, const void *data, int data_len) {
}
size_t mg_printf_data(struct mg_connection *c, const char *fmt, ...) {
- struct connection *conn = MG_CONN_2_CONN(c);
va_list ap;
+ int ret;
+
+ va_start(ap, fmt);
+ ret = mg_vprintf_data(c, fmt, ap);
+ va_end(ap);
+
+ return ret;
+}
+
+size_t mg_vprintf_data(struct mg_connection *c, const char *fmt, va_list ap) {
+ struct connection *conn = MG_CONN_2_CONN(c);
int len;
char mem[IOBUF_SIZE], *buf = mem;
terminate_headers(c);
- va_start(ap, fmt);
len = ns_avprintf(&buf, sizeof(mem), fmt, ap);
- va_end(ap);
if (len >= 0) {
write_chunk((struct connection *) conn, buf, len);
@@ -2816,7 +2868,7 @@ static int is_big_endian(void) {
// Copyright(c) By Steve Reid <steve@edmweb.com>
#define SHA1HANDSOFF
#if defined(__sun)
-//#include "solarisfixes.h"
+#include "solarisfixes.h"
#endif
union char64long16 { unsigned char c[64]; uint32_t l[16]; };
@@ -3033,7 +3085,8 @@ static size_t deliver_websocket_frame(struct connection *conn) {
}
// Call the handler and remove frame from the iobuf
- if (call_user(conn, MG_REQUEST) == MG_FALSE) {
+ if (call_user(conn, MG_REQUEST) == MG_FALSE ||
+ (buf[0] & 0x0f) == WEBSOCKET_OPCODE_CONNECTION_CLOSE) {
conn->ns_conn->flags |= NSF_FINISHED_SENDING_DATA;
}
iobuf_remove(&conn->ns_conn->recv_iobuf, frame_len);
@@ -3314,14 +3367,17 @@ static int find_index_file(struct connection *conn, char *path,
// If no index file exists, restore directory path
if (!found) {
- path[n] = '\0';
+ path[n] = '/';
+ path[n + 1] = '\0';
}
return found;
}
static int parse_range_header(const char *header, int64_t *a, int64_t *b) {
- return sscanf(header, "bytes=%" INT64_FMT "-%" INT64_FMT, a, b);
+// return sscanf(header, "bytes=%" INT64_FMT "-%" INT64_FMT, a, b);
+// return sscanf(header, "bytes=%ld-%ld" INT64_FMT, a, b);
+ return 0;
}
static void gmt_time_string(char *buf, size_t buf_len, time_t *t) {
@@ -3332,7 +3388,7 @@ static void open_file_endpoint(struct connection *conn, const char *path,
file_stat_t *st, const char *extra_headers) {
char date[64], lm[64], etag[64], range[64], headers[1000];
const char *msg = "OK", *hdr;
- time_t curtime = time(NULL);
+ time_t t, curtime = time(NULL);
int64_t r1, r2;
struct vec mime_vec;
int n;
@@ -3362,7 +3418,7 @@ static void open_file_endpoint(struct connection *conn, const char *path,
// Prepare Etag, Date, Last-Modified headers. Must be in UTC, according to
// http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3
gmt_time_string(date, sizeof(date), &curtime);
- time_t t = st->st_mtime;
+ t = st->st_mtime; // store in local variable for NDK compile
gmt_time_string(lm, sizeof(lm), &t);
construct_etag(etag, sizeof(etag), st);
@@ -3512,11 +3568,11 @@ static int scan_directory(struct connection *conn, const char *dir,
}
mg_snprintf(path, sizeof(path), "%s%c%s", dir, '/', dp->d_name);
- // Resize the array if nesessary
+ // Resize the array if necessary
if (arr_ind >= arr_size) {
if ((p = (struct dir_entry *)
NS_REALLOC(*arr, (inc + arr_size) * sizeof(**arr))) != NULL) {
- // Memset new chunk to zero, otherwize st_mtime will have garbage which
+ // Memset new chunk to zero, otherwise st_mtime will have garbage which
// can make strftime() segfault, see
// http://code.google.com/p/mongoose/issues/detail?id=79
memset(p + arr_size, 0, sizeof(**arr) * inc);
@@ -3567,6 +3623,7 @@ static void print_dir_entry(const struct dir_entry *de) {
int64_t fsize = de->st.st_size;
int is_dir = S_ISDIR(de->st.st_mode);
const char *slash = is_dir ? "/" : "";
+ time_t t;
if (is_dir) {
mg_snprintf(size, sizeof(size), "%s", "[DIRECTORY]");
@@ -3583,7 +3640,7 @@ static void print_dir_entry(const struct dir_entry *de) {
mg_snprintf(size, sizeof(size), "%.1fG", (double) fsize / 1073741824);
}
}
- time_t t = de->st.st_mtime;
+ t = de->st.st_mtime; // store in local variable for NDK compile
strftime(mod, sizeof(mod), "%d-%b-%Y %H:%M", localtime(&t));
mg_url_encode(de->file_name, strlen(de->file_name), href, sizeof(href));
mg_printf_data(&de->conn->mg_conn,
@@ -3639,12 +3696,14 @@ static void send_directory_listing(struct connection *conn, const char *dir) {
sort_direction, sort_direction, sort_direction);
num_entries = scan_directory(conn, dir, &arr);
- qsort(arr, num_entries, sizeof(arr[0]), compare_dir_entries);
- for (i = 0; i < num_entries; i++) {
- print_dir_entry(&arr[i]);
- NS_FREE(arr[i].file_name);
+ if (arr) {
+ qsort(arr, num_entries, sizeof(arr[0]), compare_dir_entries);
+ for (i = 0; i < num_entries; i++) {
+ print_dir_entry(&arr[i]);
+ NS_FREE(arr[i].file_name);
+ }
+ NS_FREE(arr);
}
- NS_FREE(arr);
write_terminating_chunk(conn);
close_local_endpoint(conn);
@@ -3655,7 +3714,7 @@ static void send_directory_listing(struct connection *conn, const char *dir) {
static void print_props(struct connection *conn, const char *uri,
file_stat_t *stp) {
char mtime[64];
- time_t t = stp->st_mtime;
+ time_t t = stp->st_mtime; // store in local variable for NDK compile
gmt_time_string(mtime, sizeof(mtime), &t);
mg_printf(&conn->mg_conn,
"<d:response>"
@@ -3861,11 +3920,16 @@ void mg_send_digest_auth_request(struct mg_connection *c) {
c->status_code = 401;
mg_printf(c,
"HTTP/1.1 401 Unauthorized\r\n"
+ "Content-Length: 0\r\n"
"WWW-Authenticate: Digest qop=\"auth\", "
"realm=\"%s\", nonce=\"%lu\"\r\n\r\n",
conn->server->config_options[AUTH_DOMAIN],
(unsigned long) time(NULL));
- close_local_endpoint(conn);
+ if (conn->cl > 0) {
+ conn->ns_conn->flags |= NSF_DISCARD;
+ } else {
+ close_local_endpoint(conn);
+ }
}
// Use the global passwords file, if specified by auth_gpass option,
@@ -4285,7 +4349,7 @@ static void do_ssi_include(struct mg_connection *conn, const char *ssi,
mg_snprintf(path, sizeof(path), "%s", file_name);
} else if (sscanf(tag, " file=\"%[^\"]\"", file_name) == 1 ||
sscanf(tag, " \"%[^\"]\"", file_name) == 1) {
- // File name is relative to the currect document
+ // File name is relative to the current document
mg_snprintf(path, sizeof(path), "%s", ssi);
if ((p = strrchr(path, '/')) != NULL) {
p[1] = '\0';
@@ -4697,6 +4761,10 @@ static void try_parse(struct connection *conn) {
// iobuf could be reallocated, and pointers in parsed request could
// become invalid.
conn->request = (char *) NS_MALLOC(conn->request_len);
+ if (conn->request == NULL) {
+ conn->ns_conn->flags |= NSF_CLOSE_IMMEDIATELY;
+ return;
+ }
memcpy(conn->request, io->buf, conn->request_len);
//DBG(("%p [%.*s]", conn, conn->request_len, conn->request));
iobuf_remove(io, conn->request_len);
@@ -4734,6 +4802,19 @@ static void on_recv_data(struct connection *conn) {
return;
}
+ if (conn->ns_conn->flags & NSF_DISCARD) {
+ size_t n = conn->cl;
+ if (n > io->len) {
+ n = io->len;
+ }
+ iobuf_remove(io, n);
+ conn->cl -= n;
+ if (conn->cl == 0) {
+ close_local_endpoint(conn);
+ }
+ return;
+ }
+
try_parse(conn);
DBG(("%p %d %lu %d", conn, conn->request_len, (unsigned long)io->len,
conn->ns_conn->flags));
@@ -4913,7 +4994,7 @@ static void close_local_endpoint(struct connection *conn) {
conn->endpoint_type = EP_NONE;
conn->cl = conn->num_bytes_recv = conn->request_len = 0;
- conn->ns_conn->flags &= ~(NSF_FINISHED_SENDING_DATA |
+ conn->ns_conn->flags &= ~(NSF_FINISHED_SENDING_DATA | NSF_DISCARD |
NSF_BUFFER_BUT_DONT_SEND | NSF_CLOSE_IMMEDIATELY |
MG_HEADERS_SENT | MG_USING_CHUNKED_API);
@@ -4921,7 +5002,7 @@ static void close_local_endpoint(struct connection *conn) {
// (IP addresses & ports, server_param) must survive. Nullify the rest.
c->request_method = c->uri = c->http_version = c->query_string = NULL;
c->num_headers = c->status_code = c->is_websocket = c->content_len = 0;
- c->connection_param = c->callback_param = NULL;
+ c->callback_param = NULL;
if (keep_alive) {
on_recv_data(conn); // Can call us recursively if pipelining is used
@@ -4983,20 +5064,17 @@ struct mg_connection *mg_next(struct mg_server *s, struct mg_connection *c) {
}
static int get_var(const char *data, size_t data_len, const char *name,
- char *dst, size_t dst_len) {
- const char *p, *e, *s;
+ char *dst, size_t dst_len, int n) {
+ const char *p, *e = data + data_len, *s;
size_t name_len;
- int len;
+ int i = 0, len = -1;
if (dst == NULL || dst_len == 0) {
len = -2;
} else if (data == NULL || name == NULL || data_len == 0) {
- len = -1;
dst[0] = '\0';
} else {
name_len = strlen(name);
- e = data + data_len;
- len = -1;
dst[0] = '\0';
// data is "var1=val1&var2=val2...". Find variable first
@@ -5004,6 +5082,8 @@ static int get_var(const char *data, size_t data_len, const char *name,
if ((p == data || p[-1] == '&') && p[name_len] == '=' &&
!mg_strncasecmp(name, p, name_len)) {
+ if (n != i++) continue;
+
// Point p to variable value
p += name_len + 1;
@@ -5029,16 +5109,21 @@ static int get_var(const char *data, size_t data_len, const char *name,
return len;
}
-int mg_get_var(const struct mg_connection *conn, const char *name,
- char *dst, size_t dst_len) {
+int mg_get_var_n(const struct mg_connection *conn, const char *name,
+ char *dst, size_t dst_len, int n) {
int len = get_var(conn->query_string, conn->query_string == NULL ? 0 :
- strlen(conn->query_string), name, dst, dst_len);
- if (len < 0) {
- len = get_var(conn->content, conn->content_len, name, dst, dst_len);
+ strlen(conn->query_string), name, dst, dst_len, n);
+ if (len == -1) {
+ len = get_var(conn->content, conn->content_len, name, dst, dst_len, n);
}
return len;
}
+int mg_get_var(const struct mg_connection *conn, const char *name,
+ char *dst, size_t dst_len) {
+ return mg_get_var_n(conn, name, dst, dst_len, 0);
+}
+
static int get_line_len(const char *buf, int buf_len) {
int len = 0;
while (len < buf_len && buf[len] != '\n') len++;
@@ -5095,6 +5180,14 @@ void mg_copy_listeners(struct mg_server *s, struct mg_server *to) {
if ((c->flags & NSF_LISTENING) &&
(tmp = (struct ns_connection *) NS_MALLOC(sizeof(*tmp))) != NULL) {
memcpy(tmp, c, sizeof(*tmp));
+
+#if defined(NS_ENABLE_SSL) && defined(HEADER_SSL_H)
+ /* OpenSSL only. See https://github.com/cesanta/mongoose/issues/441 */
+ if (tmp->ssl_ctx != NULL) {
+ tmp->ssl_ctx->references++;
+ }
+#endif
+
tmp->mgr = &to->ns_mgr;
ns_add_conn(tmp->mgr, tmp);
}
@@ -5153,6 +5246,7 @@ const char *mg_set_option(struct mg_server *server, const char *name,
char buf[500] = "";
size_t n = 0;
struct vec vec;
+
/*
* Ports can be specified as 0, meaning that OS has to choose any
* free port that is available. In order to pass chosen port number to
@@ -5247,31 +5341,32 @@ static void process_udp(struct ns_connection *nc) {
//ns_printf(nc, "%s", "HTTP/1.0 200 OK\r\n\r\n");
}
-static void mg_ev_handler(struct ns_connection *nc, int ev, void *p) {
- struct connection *conn = (struct connection *) nc->user_data;
-
- // Send NS event to the handler. Note that call_user won't send an event
- // if conn == NULL. Therefore, repeat this for NS_ACCEPT event as well.
#ifdef MONGOOSE_SEND_NS_EVENTS
- {
- struct connection *conn = (struct connection *) nc->user_data;
+static void send_ns_event(struct ns_connection *nc, int ev, void *p) {
+ struct connection *conn = (struct connection *) nc->user_data;
+ if (conn != NULL) {
void *param[2] = { nc, p };
- if (conn != NULL) conn->mg_conn.callback_param = param;
+ conn->mg_conn.callback_param = param;
call_user(conn, (enum mg_event) ev);
}
+}
+#else
+static void send_ns_event(struct ns_connection *nc, int ev, void *p) {
+ (void) nc; (void) p; (void) ev;
+}
#endif
+static void mg_ev_handler(struct ns_connection *nc, int ev, void *p) {
+ struct connection *conn = (struct connection *) nc->user_data;
+
+ // Send NS event to the handler. Note that call_user won't send an event
+ // if conn == NULL. Therefore, repeat this for NS_ACCEPT event as well.
+ send_ns_event(nc, ev, p);
+
switch (ev) {
case NS_ACCEPT:
on_accept(nc, (union socket_address *) p);
-#ifdef MONGOOSE_SEND_NS_EVENTS
- {
- struct connection *conn = (struct connection *) nc->user_data;
- void *param[2] = { nc, p };
- if (conn != NULL) conn->mg_conn.callback_param = param;
- call_user(conn, (enum mg_event) ev);
- }
-#endif
+ send_ns_event(nc, ev, p);
break;
case NS_CONNECT:
@@ -5343,6 +5438,11 @@ static void mg_ev_handler(struct ns_connection *nc, int ev, void *p) {
write_terminating_chunk(conn);
}
close_local_endpoint(conn);
+ /*
+ * MG_POLL callback returned MG_TRUE,
+ * i.e. data is sent, set corresponding flag
+ */
+ conn->ns_conn->flags |= NSF_FINISHED_SENDING_DATA;
}
if (conn->endpoint_type == EP_FILE) {
diff --git a/3rdparty/mongoose/mongoose.h b/3rdparty/mongoose/mongoose.h
index a434758dea1..f2c47a5ce83 100644
--- a/3rdparty/mongoose/mongoose.h
+++ b/3rdparty/mongoose/mongoose.h
@@ -60,7 +60,8 @@ struct mg_connection {
struct mg_server; // Opaque structure describing server instance
enum mg_result { MG_FALSE, MG_TRUE, MG_MORE };
enum mg_event {
- MG_POLL = 100, // Callback return value is ignored
+ MG_POLL = 100, // If callback returns MG_TRUE connection closes
+ // after all of data is sent
MG_CONNECT, // If callback returns MG_FALSE, connect fails
MG_AUTH, // If callback returns MG_FALSE, authentication fails
MG_REQUEST, // If callback returns MG_FALSE, Mongoose continues with req
@@ -103,8 +104,10 @@ void mg_send_status(struct mg_connection *, int status_code);
void mg_send_header(struct mg_connection *, const char *name, const char *val);
size_t mg_send_data(struct mg_connection *, const void *data, int data_len);
size_t mg_printf_data(struct mg_connection *, const char *format, ...);
+size_t mg_vprintf_data(struct mg_connection *, const char *format, va_list ap);
size_t mg_write(struct mg_connection *, const void *buf, size_t len);
size_t mg_printf(struct mg_connection *conn, const char *fmt, ...);
+size_t mg_vprintf(struct mg_connection *conn, const char *fmt, va_list ap);
size_t mg_websocket_write(struct mg_connection *, int opcode,
const char *data, size_t data_len);
@@ -118,6 +121,8 @@ const char *mg_get_header(const struct mg_connection *, const char *name);
const char *mg_get_mime_type(const char *name, const char *default_mime_type);
int mg_get_var(const struct mg_connection *conn, const char *var_name,
char *buf, size_t buf_len);
+int mg_get_var_n(const struct mg_connection *conn, const char *var_name,
+ char *buf, size_t buf_len, int n);
int mg_parse_header(const char *hdr, const char *var_name, char *buf, size_t);
int mg_parse_multipart(const char *buf, int buf_len,
char *var_name, int var_name_len,
diff --git a/3rdparty/mongoose/test/unit_test.c b/3rdparty/mongoose/test/unit_test.c
index 6492317bcbd..615cb6ad08c 100644
--- a/3rdparty/mongoose/test/unit_test.c
+++ b/3rdparty/mongoose/test/unit_test.c
@@ -169,6 +169,7 @@ static const char *test_match_prefix(void) {
ASSERT(mg_match_prefix("/api", 4, "/api") == 4);
ASSERT(mg_match_prefix("/a/", 3, "/a/b/c") == 3);
ASSERT(mg_match_prefix("/a/", 3, "/ab/c") == -1);
+ ASSERT(mg_match_prefix("/blog/", 6, "/") == -1);
ASSERT(mg_match_prefix("/*/", 3, "/ab/c") == 4);
ASSERT(mg_match_prefix("**", 2, "/a/b/c") == 6);
ASSERT(mg_match_prefix("/*", 2, "/a/b/c") == 2);
@@ -223,29 +224,28 @@ static const char *test_remove_double_dots() {
}
static const char *test_get_var(void) {
- static const char *post[] = {
- "a=1&&b=2&d&=&c=3%20&e=",
- "q=&st=2012%2F11%2F13+17%3A05&et=&team_id=",
- NULL
- };
+ static const char *data = "a=1&&b=2&d&=&c=3%20&e=&k=aa&a=23";
+ static const char *data2 = "q=&st=2012%2F11%2F13+17%3A05&et=&team_id=";
char buf[20];
- ASSERT(get_var(post[0], strlen(post[0]), "a", buf, sizeof(buf)) == 1);
+ ASSERT(get_var(data, strlen(data), "a", buf, sizeof(buf), 0) == 1);
ASSERT(buf[0] == '1' && buf[1] == '\0');
- ASSERT(get_var(post[0], strlen(post[0]), "b", buf, sizeof(buf)) == 1);
+ ASSERT(get_var(data, strlen(data), "a", buf, sizeof(buf), 1) == 2);
+ ASSERT(strcmp(buf, "23") == 0);
+ ASSERT(get_var(data, strlen(data), "b", buf, sizeof(buf), 0) == 1);
ASSERT(buf[0] == '2' && buf[1] == '\0');
- ASSERT(get_var(post[0], strlen(post[0]), "c", buf, sizeof(buf)) == 2);
+ ASSERT(get_var(data, strlen(data), "c", buf, sizeof(buf), 0) == 2);
ASSERT(buf[0] == '3' && buf[1] == ' ' && buf[2] == '\0');
- ASSERT(get_var(post[0], strlen(post[0]), "e", buf, sizeof(buf)) == 0);
+ ASSERT(get_var(data, strlen(data), "e", buf, sizeof(buf), 0) == 0);
ASSERT(buf[0] == '\0');
- ASSERT(get_var(post[0], strlen(post[0]), "d", buf, sizeof(buf)) == -1);
- ASSERT(get_var(post[0], strlen(post[0]), "c", buf, 2) == -2);
+ ASSERT(get_var(data, strlen(data), "d", buf, sizeof(buf), 0) == -1);
+ ASSERT(get_var(data, strlen(data), "c", buf, 2, 0) == -2);
- ASSERT(get_var(post[0], strlen(post[0]), "x", NULL, 10) == -2);
- ASSERT(get_var(post[0], strlen(post[0]), "x", buf, 0) == -2);
- ASSERT(get_var(post[1], strlen(post[1]), "st", buf, 16) == -2);
- ASSERT(get_var(post[1], strlen(post[1]), "st", buf, 17) == 16);
+ ASSERT(get_var(data, strlen(data), "x", NULL, 10, 0) == -2);
+ ASSERT(get_var(data, strlen(data), "x", buf, 0, 0) == -2);
+ ASSERT(get_var(data2, strlen(data2), "st", buf, 16, 0) == -2);
+ ASSERT(get_var(data2, strlen(data2), "st", buf, 17, 0) == 16);
return NULL;
}
diff --git a/3rdparty/portaudio/src/hostapi/alsa/pa_linux_alsa.c b/3rdparty/portaudio/src/hostapi/alsa/pa_linux_alsa.c
index d73f5262420..628a03e7b0f 100644
--- a/3rdparty/portaudio/src/hostapi/alsa/pa_linux_alsa.c
+++ b/3rdparty/portaudio/src/hostapi/alsa/pa_linux_alsa.c
@@ -3697,7 +3697,7 @@ static PaError PaAlsaStream_GetAvailableFrames( PaAlsaStream *self, int queryCap
*available, int *xrunOccurred )
{
PaError result = paNoError;
- unsigned long captureFrames, playbackFrames;
+ unsigned long captureFrames = 0, playbackFrames = 0;
*xrunOccurred = 0;
assert( queryCapture || queryPlayback );
@@ -4579,7 +4579,7 @@ error:
PaError PaAlsa_GetStreamInputCard( PaStream* s, int* card )
{
- PaAlsaStream *stream;
+ PaAlsaStream *stream = NULL;
PaError result = paNoError;
snd_pcm_info_t* pcmInfo;
@@ -4598,7 +4598,7 @@ error:
PaError PaAlsa_GetStreamOutputCard( PaStream* s, int* card )
{
- PaAlsaStream *stream;
+ PaAlsaStream *stream = NULL;
PaError result = paNoError;
snd_pcm_info_t* pcmInfo;
diff --git a/3rdparty/unittest-cpp/UnitTest++/DeferredTestReporter.h b/3rdparty/unittest-cpp/UnitTest++/DeferredTestReporter.h
index 757e53f808e..35425d8754b 100644
--- a/3rdparty/unittest-cpp/UnitTest++/DeferredTestReporter.h
+++ b/3rdparty/unittest-cpp/UnitTest++/DeferredTestReporter.h
@@ -10,7 +10,7 @@
#include <vector>
-UNITTEST_STDVECTOR_LINKAGE(UnitTest::DeferredTestResult);
+UNITTEST_STDVECTOR_LINKAGE(UnitTest::DeferredTestResult)
namespace UnitTest
{
diff --git a/3rdparty/unittest-cpp/UnitTest++/DeferredTestResult.h b/3rdparty/unittest-cpp/UnitTest++/DeferredTestResult.h
index 092956657c5..0f24b4abb9a 100644
--- a/3rdparty/unittest-cpp/UnitTest++/DeferredTestResult.h
+++ b/3rdparty/unittest-cpp/UnitTest++/DeferredTestResult.h
@@ -23,7 +23,7 @@ public:
}
-UNITTEST_STDVECTOR_LINKAGE(UnitTest::DeferredTestFailure);
+UNITTEST_STDVECTOR_LINKAGE(UnitTest::DeferredTestFailure)
namespace UnitTest
{
@@ -34,14 +34,14 @@ public:
DeferredTestResult();
DeferredTestResult(char const* suite, char const* test);
~DeferredTestResult();
-
+
std::string suiteName;
std::string testName;
std::string failureFile;
-
+
typedef std::vector< DeferredTestFailure > FailureVec;
FailureVec failures;
-
+
float timeElapsed;
bool failed;
};
diff --git a/README.md b/README.md
index 9e5d47ec68b..fe413c00873 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,7 @@
# **MAME** #
-[![Join the chat at https://gitter.im/mamedev/mame](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/mamedev/mame?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
-
+[![Build Status](https://travis-ci.org/mamedev/mame.svg)](https://travis-ci.org/mamedev/mame) [![Build status](https://ci.appveyor.com/api/projects/status/te0qy56b72tp5kmo?svg=true)](https://ci.appveyor.com/project/startaq/mame) [![Join the chat at https://gitter.im/mamedev/mame](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/mamedev/mame?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
What is MAME?
=============
diff --git a/docs/config.txt b/docs/config.txt
index 68b591c5bdd..9561ee96ef5 100644
--- a/docs/config.txt
+++ b/docs/config.txt
@@ -159,6 +159,14 @@ Page DN [SDL ONLY]
Alt+ENTER Toggles between full-screen and windowed mode.
+Scroll Lock Default mapping for the uimodekey. This key allows user to
+ disable and enable the emulated keyboard in machines that require
+ it. All emulations which require emulated keyboards will start in
+ that mode and you can only access the internal UI (hitting TAB) by
+ first hitting this key. You can change the initial status of the
+ emulated keyboard is presented upon start by using -ui_active trigger
+ as detailed below.
+
Escape Exits emulator.
@@ -332,9 +340,29 @@ of your command:
in the rompath are verified; however, you can limit this list by specifying a
specific softwarelistname (without .XML) after the -verifysoftlist command.
+
+OSD related options
+-------------------
+
+-uimodekey [keystring]
+
+ Key used to toggle emulated keyboard on and off. Default setting is SCRLOCK.
+
+-uifontprovider
+
+ Chooses provider for UI font: win, none or auto. The Default setting is AUTO.
+
+
+OSD CLI options
+---------------
+
-listmidi
- Create a list of list available MIDI I/O devices for use with emulation.
+ Create a list of available MIDI I/O devices for use with emulation.
+
+-listnetwork
+
+ Create a list of available Network Adapters for use with emulation.
@@ -901,8 +929,8 @@ Core input options
the coin lockout outputs were actually connected to the coin
mechanisms. If this feature is enabled, then attempts to enter a coin
while the lockout is active will fail and will display a popup message
- in the user interface. If this feature is disabled, the coin lockout
- signal will be ignored. The default is ON (-coin_lockout).
+ in the user interface (In debug mode). If this feature is disabled, the
+ coin lockout signal will be ignored. The default is ON (-coin_lockout).
-ctrlr <controller>
@@ -1131,6 +1159,32 @@ Debugging options
(-noupdate_in_pause).
+Core communication options
+--------------------------
+
+-comm_localhost <string>
+
+ Local address to bind to. This can be a traditional xxx.xxx.xxx.xxx
+ address or a string containing a resolvable hostname. The default is
+ value is "0.0.0.0"
+
+-comm_localport <string>
+
+ Local port to bind to. This can be any traditional communications port
+ as an unsigned 16-bit integer (0-65535). The default value is "15122".
+
+-comm_remotehost <string>
+
+ Remote address to connect to. This can be a traditional xxx.xxx.xxx.xxx
+ address or a string containing a resolvable hostname. The default is
+ value is "0.0.0.0"
+
+-comm_remoteport <string>
+
+ Remote port to connect to. This can be any traditional communications port
+ as an unsigned 16-bit integer (0-65535). The default value is "15122".
+
+
Core misc options
-----------------
diff --git a/docs/m6502.txt b/docs/m6502.txt
index c4517a4329a..d09954719bd 100644
--- a/docs/m6502.txt
+++ b/docs/m6502.txt
@@ -233,8 +233,8 @@ subclass has been created. It's called memory_interface, declared in
m6502_device, and provides the following accessors:
- UINT8 read(UINT16 adr) - normal read
-- UINT8 read_direct(UINT16 adr) - direct read
-- UINT8 read_decrypted(UINT16 adr) - decrypted data read
+- UINT8 read_sync(UINT16 adr) - opcode read with sync active (first byte of opcode)
+- UINT8 read_arg(UINT16 adr) - opcode read with sync inactive (rest of opcode)
- void write(UINT16 adr, UINT8 val) - normal write
- UINT8 read_9(UINT16 adr) - special y-indexed 6509 read, defaults to read()
diff --git a/docs/newvideo.txt b/docs/newvideo.txt
index 8eef40441b5..10c752bf2b0 100644
--- a/docs/newvideo.txt
+++ b/docs/newvideo.txt
@@ -105,7 +105,7 @@ disable hardware stretching, otherwise you won't get that "perfect"
So, I recommend starting with these initial options and then tweaking
from there. One additional option you might want to try in
combination with the above is the -prescale option. -prescale takes
-an integer parameter from 1 to 8, and specifies a magnification
+an integer parameter from 1 to 3, and specifies a magnification
amount by which the screen pixels are expanded before they are drawn
to the screen. Why is this useful? And how much of a performance
impact does it have? Well, that depends on the mode you are running
@@ -117,7 +117,7 @@ them to the screen. Depending on the video card, this is usually a
small performance hit, but not too significant. The benefit is that
each prescale factor reduces the blurriness of the pixels.
-prescale 1 is the default, which does no scaling. -prescale 2 will
-double each pixel, -prescale 3 will triple each pixel, etc. For my
+double each pixel, and -prescale 3 will triple each pixel. For my
money, -prescale 2 is sufficient, but people with super high
resolution displays claim that larger -prescale factors work even
better.
diff --git a/hash/a7800.xml b/hash/a7800.xml
index f6cc930eb8b..c9419c1f050 100644
--- a/hash/a7800.xml
+++ b/hash/a7800.xml
@@ -2370,32 +2370,112 @@ almost nothing like the prototype.
</software>
<!-- XM board enhanced -->
-
- <software name="dkongxm">
- <description>Donkey Kong (PAL, Demo, XM enhanced)</description>
- <year>2012</year>
- <publisher>&lt;homebrew&gt;</publisher>
- <info name="programmer" value="TEP392" />
- <sharedfeat name="compatibility" value="PAL"/>
- <part name="cart" interface="a7800_cart">
- <feature name="slot" value="a78_sg9" />
- <dataarea name="rom" size="147456">
- <rom name="dkxm_final_demo_pal.bin" size="147456" crc="d362712e" sha1="118c462d6698bd23c378785f80062fdd7d65ca00" offset="0" />
- </dataarea>
- </part>
- </software>
-
- <software name="dkongxmnu" cloneof="dkongxm" >
- <description>Donkey Kong (NTSC, Demo, XM enhanced)</description>
- <year>2012</year>
- <publisher>&lt;homebrew&gt;</publisher>
- <info name="programmer" value="TEP392" />
- <sharedfeat name="compatibility" value="NTSC"/>
- <part name="cart" interface="a7800_cart">
- <feature name="slot" value="a78_sg9" />
- <dataarea name="rom" size="147456">
- <rom name="dkxm_final_demo_ntsc.bin" size="147456" crc="6e170055" sha1="f4da231312da06ff9e8af5681b5013b14886b455" offset="0" />
- </dataarea>
- </part>
- </software>
+ <!-- from http://atariage.com/forums/topic/204250-donkey-kong-xm-pre-order-and-demo/ -->
+
+ <!-- these ones are listed as 'working in MESS' but are apparently the only images that work on real hardware too -->
+ <software name="dkongxm">
+ <description>Donkey Kong (PAL, Demo, XM enhanced, V1.2)</description>
+ <year>2012</year>
+ <publisher>&lt;homebrew&gt;</publisher>
+ <info name="programmer" value="TEP392" />
+ <sharedfeat name="compatibility" value="PAL"/>
+ <part name="cart" interface="a7800_cart">
+ <feature name="slot" value="a78_sg9" />
+ <dataarea name="rom" size="147456">
+ <rom name="dkxm_demo_v12_pal.bin" size="147456" crc="9f6c0600" sha1="18409eace880dda3646792f9ec050a87a3b1b382" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="dkongxmu" cloneof="dkongxm">
+ <description>Donkey Kong (NTSC, Demo, XM enhanced, V1.2)</description>
+ <year>2012</year>
+ <publisher>&lt;homebrew&gt;</publisher>
+ <info name="programmer" value="TEP392" />
+ <sharedfeat name="compatibility" value="NTSC"/>
+ <part name="cart" interface="a7800_cart">
+ <feature name="slot" value="a78_sg9" />
+ <dataarea name="rom" size="147456">
+ <rom name="dkxm_demo_v12_ntsc.bin" size="147456" crc="8b06bb4b" sha1="3129cbc91dc8f223f00db5c3273a4a330320be99" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <!-- these are listed as 'with HSC emulation' and are designed for the prosystem emulator, they simulate some of the HSC features -->
+ <!-- remove them? -->
+
+ <software name="dkongxmps" cloneof="dkongxm" supported="no">
+ <description>Donkey Kong (PAL, Demo, XM enhanced, V1.2, for prosystem emulator)</description>
+ <year>2012</year>
+ <publisher>&lt;homebrew&gt;</publisher>
+ <info name="programmer" value="TEP392" />
+ <sharedfeat name="compatibility" value="PAL"/>
+ <part name="cart" interface="a7800_cart">
+ <feature name="slot" value="a78_sg9" />
+ <dataarea name="rom" size="147456">
+ <rom name="dkxm_final_demo_pal_hsc.bin" size="147456" crc="6510b674" sha1="65b723b470d287af51e9888813149c43fb11ac26" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="dkongxmups" cloneof="dkongxm" supported="no">
+ <description>Donkey Kong (NTSC, Demo, XM enhanced, V1.2, for prosystem emulator)</description>
+ <year>2012</year>
+ <publisher>&lt;homebrew&gt;</publisher>
+ <info name="programmer" value="TEP392" />
+ <sharedfeat name="compatibility" value="NTSC"/>
+ <part name="cart" interface="a7800_cart">
+ <feature name="slot" value="a78_sg9" />
+ <dataarea name="rom" size="147456">
+ <rom name="dkxm_final_demo_ntsc_hsc.bin" size="147456" crc="2c67fea7" sha1="7825c1946e3c7492fa9bbfae33029cd68c0d1135" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+
+
+ <!-- an older version? sound is broken, did it work on the real hardware? -->
+ <software name="dkongxmo" cloneof="dkongxm" supported="no">
+ <description>Donkey Kong (PAL, Demo, XM enhanced, older)</description>
+ <year>2012</year>
+ <publisher>&lt;homebrew&gt;</publisher>
+ <info name="programmer" value="TEP392" />
+ <sharedfeat name="compatibility" value="PAL"/>
+ <part name="cart" interface="a7800_cart">
+ <feature name="slot" value="a78_sg9" />
+ <dataarea name="rom" size="147456">
+ <rom name="dkxm_final_demo_pal.bin" size="147456" crc="d362712e" sha1="118c462d6698bd23c378785f80062fdd7d65ca00" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="dkongxmou" cloneof="dkongxm" supported="no" >
+ <description>Donkey Kong (NTSC, Demo, XM enhanced, older)</description>
+ <year>2012</year>
+ <publisher>&lt;homebrew&gt;</publisher>
+ <info name="programmer" value="TEP392" />
+ <sharedfeat name="compatibility" value="NTSC"/>
+ <part name="cart" interface="a7800_cart">
+ <feature name="slot" value="a78_sg9" />
+ <dataarea name="rom" size="147456">
+ <rom name="dkxm_final_demo_ntsc.bin" size="147456" crc="6e170055" sha1="f4da231312da06ff9e8af5681b5013b14886b455" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <!-- this one is meant to detect PAL / NTSC and runs on an A7800 CC2 development board, without sound? based off older code? -->
+ <software name="dkongxmcc" cloneof="dkongxm" supported="no">
+ <description>Donkey Kong (PAL/NTSC, Demo, XM enhanced, older, for CC2 board)</description>
+ <year>2012</year>
+ <publisher>&lt;homebrew&gt;</publisher>
+ <info name="programmer" value="TEP392" />
+ <part name="cart" interface="a7800_cart">
+ <feature name="slot" value="a78_sg9" />
+ <dataarea name="rom" size="147456">
+ <rom name="dkxm_final_demo.bin" size="0x20000" crc="fd503bd4" sha1="454d754a0c4603323e476d9418f343a6a1a0d017" offset="0x4000" />
+ <rom size="0x4000" offset="0x0000" loadflag="continue" />
+ </dataarea>
+ </part>
+ </software>
+
</softwarelist>
diff --git a/hash/c128_flop.xml b/hash/c128_flop.xml
index 6cb7ab8e9c7..2217fab2653 100644
--- a/hash/c128_flop.xml
+++ b/hash/c128_flop.xml
@@ -374,6 +374,80 @@
</part>
</software>
+ <software name="pbw128">
+ <description>Paperback Writer 128</description>
+ <year>1985</year>
+ <publisher>Digital Solutions</publisher>
+ <info name="protection" value="none" />
+ <info name="serial" value="KC002264" />
+
+ <part name="flop1" interface="floppy_5_25">
+ <dataarea name="flop" size="287512">
+ <rom name="kc002264.g64" size="287512" crc="ea540ddd" sha1="6e1b1679a4a5525c2b2cd82f7d2ea9115f62ab4c" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="pbw128a" cloneof="pbw128">
+ <description>Paperback Writer 128 (Alt)</description>
+ <year>1985</year>
+ <publisher>Digital Solutions</publisher>
+ <info name="protection" value="none" />
+ <info name="serial" value="UC004217" />
+
+ <part name="flop1" interface="floppy_5_25">
+ <dataarea name="flop" size="287512">
+ <rom name="uc004217.g64" size="287512" crc="63c96e73" sha1="05cf4f02448d72fd57be0b335810b8f429b8d81f" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="tpw">
+ <description>Term Paper Writer</description>
+ <year>1986</year>
+ <publisher>Activision</publisher>
+ <info name="protection" value="xemag" />
+ <info name="serial" value="DD-606-04" />
+
+ <part name="flop1" interface="floppy_5_25">
+ <dataarea name="flop" size="572316">
+ <rom name="dd-606-04.g71" size="572316" crc="d3490406" sha1="8ece5c70dacfc7005a601534f07c9e3e05e3e266" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="greatwar">
+ <description>The Great War</description>
+ <year>1987</year>
+ <publisher>Free Spirit Software</publisher>
+ <info name="protection" value="none" />
+
+ <part name="flop1" interface="floppy_5_25">
+ <dataarea name="flop" size="279582">
+ <rom name="greatwar.g64" size="279582" crc="177ea4f4" sha1="e6f86ba6221ef3676f8560dc13a3b5df3eff2d57" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="ypfp128">
+ <description>Sylvia Porter's Personal Finance Series - Your Personal Financial Planner 128</description>
+ <year>1984</year>
+ <publisher>Timeworks</publisher>
+ <info name="protection" value="none" />
+
+ <part name="flop1" interface="floppy_5_25">
+ <dataarea name="flop" size="287512">
+ <rom name="ypfp128-a.g64" size="287512" crc="5d1ef4c7" sha1="07dcd3c21cd4d3d0be1425f44e701c6d68af4f40" offset="0" />
+ </dataarea>
+ </part>
+
+ <part name="flop2" interface="floppy_5_25">
+ <dataarea name="flop" size="279582">
+ <rom name="ypfp128-b.g64" size="279582" crc="ec4b0485" sha1="4d0820ee76f00a43cf6cae48407b11ba8652274d" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
<software name="1570demo">
<description>Commodore 1570/1571 Test Demo</description>
<year>198?</year>
diff --git a/hash/cgenie_cart.xml b/hash/cgenie_cart.xml
index f33f62e1d63..b3a951723f9 100644
--- a/hash/cgenie_cart.xml
+++ b/hash/cgenie_cart.xml
@@ -1,13 +1,13 @@
<?xml version="1.0"?>
<!DOCTYPE softwarelist SYSTEM "softwarelist.dtd">
-<softwarelist name="cgenie_cart" description="EACA Colour Genie cartridges">
-<!-- Where was this plugged exactly?!? -->
+<softwarelist name="cgenie_cart" description="EACA Colour Genie EG2000 cartridges">
<software name="cdosintf">
<description>Colour DOS Interface</description>
- <year>19??</year>
+ <year>1997</year>
<publisher>&lt;homebrew?&gt;</publisher>
+ <info name="author" value="C. Poetzsch, Jürgen Buchmüller" />
<part name="cart" interface="cgenie_cart">
<dataarea name="rom" size="2772">
<rom name="newe000.bin" size="2772" crc="953491a7" sha1="8d6a739a9058b3834897a15bcda5348b94008f5a" offset="0" />
@@ -15,5 +15,16 @@
</part>
</software>
+ <software name="colmon2">
+ <description>Colour-Monitor 2.0</description>
+ <year>198?</year>
+ <publisher>&lt;unknown&gt;</publisher>
+ <info name="usage" value="Enter CALL E000 to start" />
+ <part name="cart" interface="cgenie_cart">
+ <dataarea name="rom" size="0x1000">
+ <rom name="colour_monitor_2.bin" size="0x1000" crc="a6b08d4d" sha1="2398f8ea430468dbd29fb0fabe89b2c21c2404f7" offset="0" />
+ </dataarea>
+ </part>
+ </software>
</softwarelist>
diff --git a/hash/cgenie_cass.xml b/hash/cgenie_cass.xml
index 136d427bc5a..f77be698f80 100644
--- a/hash/cgenie_cass.xml
+++ b/hash/cgenie_cass.xml
@@ -3,936 +3,964 @@
<!--
- TODO:
- * document basic tapes when they are fixed!
- * add to usage "start with /" for games which need it (those which don't autostart)
- * check which games work and which don't and fix the supported flag accordingly
+TCG is Trommeschläger Computer GmbH, who renamed themselves mid 1983 to TCS. They were the German
+distributor of the Colour Genie EG2000 computers.
+
-->
-<softwarelist name="cgenie_cass" description="EACA Colour Genie/EG2000 cassettes">
- <software name="andromed" supported="no">
- <description>Andromeda</description>
- <year>1982</year>
- <publisher>TGC</publisher>
- <info name="usage" value="Type SYSTEM and load with ANDRO"/>
+<softwarelist name="cgenie_cass" description="EACA Colour Genie EG2000 cassettes">
+ <software name="andromed" supported="yes">
+ <description>Andromeda (32k)</description>
+ <year>1982</year>
+ <publisher>TCG</publisher>
+ <info name="author" value="Jürgen Buchmüller" />
+ <info name="usage" value="Type SYSTEM and load with ANDRO, enter / to start" />
<part name="cass1" interface="cgenie_cass">
<dataarea name="cass" size="12544">
- <rom name="andromeda (1982)(buchmueller, juergen)(de).cas" size="12544" crc="cb10616e" sha1="65e6679e24bb7e946b90961ba20cb522ae29e601" offset="0" />
+ <rom name="andromeda_32k.cas" size="12544" crc="cb10616e" sha1="65e6679e24bb7e946b90961ba20cb522ae29e601" offset="0" />
</dataarea>
</part>
</software>
- <software name="andromeda" cloneof="andromed" supported="no">
- <description>Andromeda (Alt)</description>
+ <software name="andromed16" cloneof="andromed" supported="yes">
+ <description>Andromeda (16k)</description>
<year>1982</year>
- <publisher>TGC</publisher>
- <info name="usage" value="Type SYSTEM and load with ANDRO"/>
-
+ <publisher>TCG</publisher>
+ <info name="author" value="Jürgen Buchmüller" />
+ <info name="usage" value="Type SYSTEM and load with ANDRO" />
<part name="cass1" interface="cgenie_cass">
<dataarea name="cass" size="14938">
- <rom name="andromeda (1982)(buchmueller, juergen)(de)[a].cas" size="14938" crc="be51a28c" sha1="71c474378582f9d522a0047b3d6a83856f5be542" offset="0" />
+ <rom name="andromeda_16k.cas" size="14938" crc="be51a28c" sha1="71c474378582f9d522a0047b3d6a83856f5be542" offset="0" />
</dataarea>
</part>
</software>
- <software name="astrnaut" supported="no">
+ <software name="astrnaut" supported="yes">
<description>Astronaut</description>
<year>1984</year>
- <publisher>N.A. Taylor</publisher>
- <info name="usage" value="Type SYSTEM and load with ASTRO"/>
+ <publisher>N. A. Taylor</publisher>
+ <info name="usage" value="Type SYSTEM and load with ASTRO" />
<part name="cass1" interface="cgenie_cass">
<dataarea name="cass" size="9100">
- <rom name="astronaut (1984)(taylor, n. a.).cas" size="9100" crc="7e57ada8" sha1="d98171f78f2da39ec7ea7c897a78741f1e926bee" offset="0" />
+ <rom name="astronaut.cas" size="9100" crc="7e57ada8" sha1="d98171f78f2da39ec7ea7c897a78741f1e926bee" offset="0" />
</dataarea>
</part>
</software>
- <software name="basicode" supported="no">
+ <!-- Missing: Bäng-Bäng, 1983 TCS -->
+
+ <software name="basicode" supported="yes">
<description>Basicode</description>
<year>1983</year>
<publisher>TCS</publisher>
- <info name="usage" value="Type SYSTEM and load with BASICO"/>
-
+ <info name="author" value="Jürgen Buchmüller" />
+ <info name="usage" value="Type SYSTEM and load with BASICO, enter / to start" />
<part name="cass1" interface="cgenie_cass">
<dataarea name="cass" size="2199">
- <rom name="basicode (1983)(tcs).cas" size="2199" crc="9da86441" sha1="f1b806842c4f0cfa9b4b69c4e45fae2135925712" offset="0" />
+ <rom name="basicode.cas" size="2199" crc="9da86441" sha1="f1b806842c4f0cfa9b4b69c4e45fae2135925712" offset="0" />
</dataarea>
</part>
</software>
- <software name="baspack" supported="no">
- <description>Basic-Packer 2.13</description>
+ <software name="basicp5" supported="yes">
+ <description>Basic +5</description>
<year>1983</year>
<publisher>TCS</publisher>
- <info name="usage" value="Type SYSTEM and load with PACKER"/>
-
- <part name="cass1" interface="cgenie_cass">
- <dataarea name="cass" size="4448">
- <rom name="basic packer v2.13 (1983)(tcs).cas" size="4448" crc="b1074e77" sha1="bcff0ab3e60fac4213342f6e5807d047c6e96f8d" offset="0" />
- </dataarea>
- </part>
- </software>
-
- <software name="chopper" supported="no">
- <description>Chopper</description>
- <year>198?</year>
- <publisher>&lt;unknown&gt;</publisher>
- <info name="usage" value="Type SYSTEM and load with CHOP"/>
-
+ <info name="usage" value="Type SYSTEM and load with BPLUS5, enter / to start" />
<part name="cass1" interface="cgenie_cass">
- <dataarea name="cass" size="27969">
- <rom name="chopper (19xx)(-)[req 32k].cas" size="27969" crc="5e13a90b" sha1="46e9ce8a093f9735b1a31e874a13b1beb79aadd2" offset="0" />
+ <dataarea name="cass" size="5250">
+ <rom name="basic_plus5.cas" size="5250" crc="870865de" sha1="c2b98f33c93fc30a2926fb465d2f21b7ae92d9df" offset="0" />
</dataarea>
</part>
</software>
- <software name="chop83" supported="no">
- <description>Chopper (Autostart)</description>
+ <software name="baspack" supported="yes">
+ <description>Basic-Packer 2.13</description>
<year>1983</year>
- <publisher>Juergen Buchmueller</publisher>
- <info name="usage" value="Type SYSTEM and load with CHOP83"/>
-
+ <publisher>TCS</publisher>
+ <info name="usage" value="Type SYSTEM and load with PACKER, enter / to start (req. 32k memory)" />
<part name="cass1" interface="cgenie_cass">
- <dataarea name="cass" size="12034">
- <rom name="chopper (1983)(buchmueller, juergen)[req 16k].cas" size="12034" crc="190a67fb" sha1="f8f3d6280561d6af2c14feb206d8a55d08948958" offset="0" />
+ <dataarea name="cass" size="4448">
+ <rom name="basic_packer_213.cas" size="4448" crc="b1074e77" sha1="bcff0ab3e60fac4213342f6e5807d047c6e96f8d" offset="0" />
</dataarea>
</part>
</software>
- <software name="colcom" supported="no">
- <description>TCS Colour Basic Compiler Ver. 3.05</description>
+ <!-- Missing: Break Out -->
+ <!-- Missing: Colour-Assembler -->
+
+ <software name="colcom" supported="yes">
+ <description>Colour Basic Compiler 3.05</description>
<year>1982</year>
<publisher>TCS</publisher>
- <info name="usage" value="Type SYSTEM and load with COLCOM"/>
-
+ <info name="usage" value="Type SYSTEM and load with COLCOM, enter / to start (req. 32k memory)" />
<part name="cass1" interface="cgenie_cass">
<dataarea name="cass" size="15340">
- <rom name="colour basic compiler v3.05 (1982)(tcs)(de).cas" size="15340" crc="2628fe32" sha1="143104b746cd959a0c022bd8a8807ad9875f4d8a" offset="0" />
+ <rom name="colour_basic_compiler.cas" size="15340" crc="2628fe32" sha1="143104b746cd959a0c022bd8a8807ad9875f4d8a" offset="0" />
</dataarea>
</part>
</software>
- <software name="colbasp" supported="no">
- <description>Colour Basic +5</description>
- <year>1983</year>
- <publisher>TCS</publisher>
- <info name="usage" value="Type SYSTEM and load with BPLUS5"/>
-
- <part name="cass1" interface="cgenie_cass">
- <dataarea name="cass" size="5250">
- <rom name="colour basic plus (1983)(tcs).cas" size="5250" crc="870865de" sha1="c2b98f33c93fc30a2926fb465d2f21b7ae92d9df" offset="0" />
- </dataarea>
- </part>
- </software>
-
- <software name="colconv" supported="no">
- <description>EG 2000 Tape-Disk Converter Ver. 1.1</description>
- <year>19??</year>
+ <software name="coldemo" supported="yes">
+ <description>Colourdemo</description>
+ <year>198?</year>
<publisher>&lt;unknown&gt;</publisher>
- <info name="usage" value="Type SYSTEM and load with COLOFF"/>
-
+ <info name="author" value="Carsten Schmidt, Kalle Braun" />
+ <info name="usage" value="Load with CLOAD, enter RUN to start" />
<part name="cass1" interface="cgenie_cass">
- <dataarea name="cass" size="1452">
- <rom name="colour office tape-disk converter v1.11 (19xx)(-).cas" size="1452" crc="88fdad97" sha1="6d66db21fb6bfdd0b339a5e4884a9f014c06eb3a" offset="0" />
+ <dataarea name="cass" size="9002">
+ <rom name="colourdemo.cas" size="9002" crc="c70117ee" sha1="29e6874686eb090a3ab3e01787d77e646e2806be" offset="0" />
</dataarea>
</part>
</software>
- <software name="coldesig" supported="no">
+ <software name="coldesig" supported="yes">
<description>Colour Design 3.0</description>
<year>19??</year>
<publisher>&lt;unknown&gt;</publisher>
- <info name="usage" value="Type SYSTEM and load with DESIGN"/>
-
+ <info name="usage" value="Type SYSTEM and load with DESIGN, enter / to start" />
<part name="cass1" interface="cgenie_cass">
<dataarea name="cass" size="849">
- <rom name="colour design v3.0 (19xx)(-).cas" size="849" crc="3cade933" sha1="ad81c5fe7ff6ce162f5a5b51234e2dc41421975b" offset="0" />
+ <rom name="colour_design_30.cas" size="849" crc="3cade933" sha1="ad81c5fe7ff6ce162f5a5b51234e2dc41421975b" offset="0" />
</dataarea>
</part>
</software>
- <software name="coldosin" supported="no">
- <description>Colour DOS - Interface</description>
- <year>1997</year>
- <publisher>Juergen Buchmueller</publisher>
- <info name="usage" value="Type SYSTEM and load with EASY"/>
-
- <part name="cass1" interface="cgenie_cass">
- <dataarea name="cass" size="2889">
- <rom name="colour dos interface (1997)(buchmueller, juergen).cas" size="2889" crc="4a8578a2" sha1="d2d707952b695c065c5a7b400d2314bc921bc15f" offset="0" />
- </dataarea>
- </part>
- </software>
-
- <software name="colforth" supported="no">
- <description>Colour-Forth v2.0</description>
+ <software name="colforth" supported="yes">
+ <description>Colour-Forth 2.0 (with cassette support)</description>
<year>1983</year>
<publisher>TCS</publisher>
- <info name="usage" value="Type SYSTEM and load with BFORTH"/>
-
+ <info name="usage" value="Type SYSTEM and load with BFORTH, enter / to start (req. 32k memory)" />
<part name="cass1" interface="cgenie_cass">
<dataarea name="cass" size="13132">
- <rom name="colour forth v2.0 (1983)(tcs).cas" size="13132" crc="a2f51fc0" sha1="424c3c5be4d1c205499cea371b0f302f40dbdb60" offset="0" />
+ <rom name="colour_forth_20_cas.cas" size="13132" crc="a2f51fc0" sha1="424c3c5be4d1c205499cea371b0f302f40dbdb60" offset="0" />
</dataarea>
</part>
</software>
- <software name="colfortha" cloneof="colforth" supported="no">
- <description>Colour-Forth v2.0 (Alt)</description>
+ <software name="colfortha" cloneof="colforth" supported="yes">
+ <description>Colour-Forth 2.0</description>
<year>1983</year>
<publisher>TCS</publisher>
- <info name="usage" value="Type SYSTEM and load with FORTH"/>
-
+ <info name="usage" value="Type SYSTEM and load with FORTH, enter / to start (req. 32k memory)" />
<part name="cass1" interface="cgenie_cass">
<dataarea name="cass" size="7246">
- <rom name="colour forth v2.0 (1983)(tcs)[a].cas" size="7246" crc="628cc3ce" sha1="8bdaa980d10c3a579f9a40052880f624f11e0eeb" offset="0" />
+ <rom name="colour_forth_20.cas" size="7246" crc="628cc3ce" sha1="8bdaa980d10c3a579f9a40052880f624f11e0eeb" offset="0" />
</dataarea>
</part>
</software>
- <software name="colkong" supported="no">
- <description>Colour Kong (16k)</description>
+ <!-- Missing: Colour-Frogger (or is this Toad Mania?) -->
+
+ <software name="colkong" supported="yes">
+ <description>Colour Kong (32k)</description>
<year>1983</year>
<publisher>TCS</publisher>
- <info name="usage" value="Type SYSTEM and load with KONG"/>
-
+ <info name="author" value="Harald Bögeholz" />
+ <info name="usage" value="Type SYSTEM and load with KONG32, enter / to start" />
<part name="cass1" interface="cgenie_cass">
- <dataarea name="cass" size="8731">
- <rom name="colour kong (1983)(tcs)[req 16k].cas" size="8731" crc="f6ae6158" sha1="319a60dc863eabd05c79a8de261af70b6e5ba74b" offset="0" />
+ <dataarea name="cass" size="12335">
+ <rom name="colour_kong_32k.cas" size="12335" crc="83fba82e" sha1="1799cde3a3fe308cb987df940ee111ad564936c5" offset="0" />
</dataarea>
</part>
</software>
- <software name="colkong32" cloneof="colkong" supported="no">
- <description>Colour Kong (32k)</description>
+ <software name="colkong16" cloneof="colkong" supported="yes">
+ <description>Colour Kong (16k)</description>
<year>1983</year>
<publisher>TCS</publisher>
- <info name="usage" value="Type SYSTEM and load with KONG32"/>
-
+ <info name="author" value="Harald Bögeholz" />
+ <info name="usage" value="Type SYSTEM and load with KONG" />
<part name="cass1" interface="cgenie_cass">
- <dataarea name="cass" size="12335">
- <rom name="colour kong (1983)(tcs)[req 32k].cas" size="12335" crc="83fba82e" sha1="1799cde3a3fe308cb987df940ee111ad564936c5" offset="0" />
+ <dataarea name="cass" size="8731">
+ <rom name="colour_kong_16k.cas" size="8731" crc="f6ae6158" sha1="319a60dc863eabd05c79a8de261af70b6e5ba74b" offset="0" />
</dataarea>
</part>
</software>
- <software name="colkonga" cloneof="colkong" supported="no">
- <description>Colour Kong (16k, Alt)</description>
+ <software name="colkong16a" cloneof="colkong" supported="yes">
+ <description>Colour Kong (16k, no autostart)</description>
<year>1983</year>
<publisher>TCS</publisher>
- <info name="usage" value="Type SYSTEM and load with KONG16"/>
-
+ <info name="author" value="Harald Bögeholz" />
+ <info name="usage" value="Type SYSTEM and load with KONG16, enter / to start" />
<part name="cass1" interface="cgenie_cass">
<dataarea name="cass" size="8742">
- <rom name="colour kong (1983)(tcs)[a][req 16k].cas" size="8742" crc="111deb80" sha1="9a106a73d113851c6a60d401715f96fbbe2d9534" offset="0" />
+ <rom name="colour_kong_16k_noautostart.cas" size="8742" crc="111deb80" sha1="9a106a73d113851c6a60d401715f96fbbe2d9534" offset="0" />
</dataarea>
</part>
</software>
- <software name="colmon2" supported="no">
- <description>Colmon Vers.2</description>
+ <!-- Missing: Colour-Monitor I -->
+
+ <software name="colmon2" supported="yes">
+ <description>Colour-Monitor 2.0</description>
<year>198?</year>
<publisher>&lt;unknown&gt;</publisher>
- <info name="usage" value="Type SYSTEM and load with COLMON"/>
-
+ <info name="usage" value="Type SYSTEM and load with COLMON, enter / to start (req. 32k memory)" />
<part name="cass1" interface="cgenie_cass">
<dataarea name="cass" size="4192">
- <rom name="colour monitor v2.0 (19xx)(-).cas" size="4192" crc="ae8b9163" sha1="ac9bd8ca81036482e73742a2fa1b77747500cf70" offset="0" />
+ <rom name="colour_monitor_2.cas" size="4192" crc="ae8b9163" sha1="ac9bd8ca81036482e73742a2fa1b77747500cf70" offset="0" />
</dataarea>
</part>
</software>
- <software name="monrom" supported="no">
- <description>Unknown program "MONROM"</description>
- <year>19??</year>
- <publisher>&lt;unknown&gt;</publisher>
- <info name="usage" value="Type SYSTEM and load with MONROM"/>
-
- <part name="cass1" interface="cgenie_cass">
- <dataarea name="cass" size="4195">
- <rom name="colour monitor v2.0 (19xx)(-)[a].cas" size="4195" crc="8c96504c" sha1="4f84cb5fa31f2a645217092cfc183acdc8b65c8e" offset="0" />
- </dataarea>
- </part>
- </software>
-
- <software name="colmon30" supported="no">
+ <software name="colmon3" supported="yes">
<description>Colour-Monitor 3.0</description>
<year>1983</year>
<publisher>TCS</publisher>
- <info name="usage" value="Type SYSTEM and load with COLMON"/>
-
+ <info name="usage" value="Type SYSTEM and load with COLMON, enter / to start (req. 32k memory)" />
<part name="cass1" interface="cgenie_cass">
<dataarea name="cass" size="15091">
- <rom name="colour monitor v3.0 (1983)(tcs).cas" size="15091" crc="51f27191" sha1="bb5dce66adc62cf7d4460fa93331132f66b0266e" offset="0" />
+ <rom name="colour_monitor_3.cas" size="15091" crc="51f27191" sha1="bb5dce66adc62cf7d4460fa93331132f66b0266e" offset="0" />
</dataarea>
</part>
</software>
- <software name="colpasc" supported="no">
+ <software name="colpasc" supported="yes">
<description>Colour-PASCAL 2.0</description>
<year>198?</year>
<publisher>&lt;unknown&gt;</publisher>
- <info name="usage" value="Type SYSTEM and load with PASCAL"/>
-
+ <info name="usage" value="Type SYSTEM and load with PASCAL" />
<part name="cass1" interface="cgenie_cass">
<dataarea name="cass" size="11896">
- <rom name="colour pascal v2.0 (19xx)(-).cas" size="11896" crc="463af74d" sha1="8756a8f0ba9bb82b9c1a45ed15e8e1d07dedf6c7" offset="0" />
+ <rom name="colour_pascal_20.cas" size="11896" crc="463af74d" sha1="8756a8f0ba9bb82b9c1a45ed15e8e1d07dedf6c7" offset="0" />
</dataarea>
</part>
</software>
- <software name="colrot" supported="no">
+ <software name="colrot" supported="yes">
<description>Colrot</description>
<year>1983</year>
<publisher>TCS</publisher>
- <info name="usage" value="Type SYSTEM and load with COLROT"/>
-
+ <info name="author" value="Udo Gerber" />
+ <info name="usage" value="Type SYSTEM and load with COLROT (req. 32k memory)" />
<part name="cass1" interface="cgenie_cass">
<dataarea name="cass" size="12132">
- <rom name="colour rot (1983)(tcs)(de).cas" size="12132" crc="d95dc066" sha1="52c112b2e342fcec6faac1a10677e3f1ba2cdc6a" offset="0" />
+ <rom name="colrot.cas" size="12132" crc="d95dc066" sha1="52c112b2e342fcec6faac1a10677e3f1ba2cdc6a" offset="0" />
</dataarea>
</part>
</software>
- <software name="colscha" supported="no">
- <description>Colour-SCHACH</description>
+ <software name="colscha" supported="yes">
+ <description>Colour Schach</description>
<year>1983</year>
<publisher>&lt;unknown&gt;</publisher>
- <info name="usage" value="Type SYSTEM and load with SARGON"/>
-
+ <info name="author" value="Kalle Braun" />
+ <info name="usage" value="Type SYSTEM and load with SARGON, enter / to start (req. 32k memory)" />
<part name="cass1" interface="cgenie_cass">
<dataarea name="cass" size="10161">
- <rom name="colour schach (1983)(-)(de).cas" size="10161" crc="b21c8982" sha1="78bb511ac85cc5b996a2fcfe6ebb9dc9e25e2040" offset="0" />
+ <rom name="colour_schach.cas" size="10161" crc="b21c8982" sha1="78bb511ac85cc5b996a2fcfe6ebb9dc9e25e2040" offset="0" />
</dataarea>
</part>
</software>
- <software name="colsch" supported="no">
- <description>Colour Schach</description>
+ <software name="colsch" supported="yes">
+ <description>Colour Schach (TCS)</description>
<year>1983</year>
<publisher>TCS</publisher>
- <info name="usage" value="Type SYSTEM and load with SCHACH"/>
-
+ <info name="author" value="Kalle Braun" />
+ <info name="usage" value="Type SYSTEM and load with SCHACH, enter / to start (req. 32k memory)" />
<part name="cass1" interface="cgenie_cass">
<dataarea name="cass" size="11127">
- <rom name="colour schach (1983)(tcs)(de).cas" size="11127" crc="997f5271" sha1="ce040beccae0504b169f693bf6a8c17633bfcfb8" offset="0" />
+ <rom name="colour_schach_tcs.cas" size="11127" crc="997f5271" sha1="ce040beccae0504b169f693bf6a8c17633bfcfb8" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <!-- Missing: Colour-Skat -->
+ <!-- Missing: Colour Synthesizer aka Synthi, TCS 1983 (Jürgen Buchmüller) -->
+ <!-- Missing: Colour-Text -->
+ <!-- Missing: Colzap -->
+ <!-- Missing: Composer, TCS 1983 (Carsten Schmidt) -->
+
+ <software name="chopper" supported="yes">
+ <description>Chopper (TCS)</description>
+ <year>198?</year>
+ <publisher>TCS</publisher>
+ <info name="author" value="Jürgen Buchmüller" />
+ <info name="usage" value="Type SYSTEM and load with CHOP, enter / to start (req. 32k memory)" />
+ <part name="cass1" interface="cgenie_cass">
+ <dataarea name="cass" size="27969">
+ <rom name="chopper_tcs.cas" size="27969" crc="5e13a90b" sha1="46e9ce8a093f9735b1a31e874a13b1beb79aadd2" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="chop83" supported="yes">
+ <description>Chopper (1983)</description>
+ <year>1983</year>
+ <publisher>Jürgen Buchmüller</publisher>
+ <info name="author" value="Jürgen Buchmüller" />
+ <info name="usage" value="Type SYSTEM and load with CHOP83" />
+ <part name="cass1" interface="cgenie_cass">
+ <dataarea name="cass" size="12034">
+ <rom name="chopper_83.cas" size="12034" crc="190a67fb" sha1="f8f3d6280561d6af2c14feb206d8a55d08948958" offset="0" />
</dataarea>
</part>
</software>
- <software name="cosmicat" supported="no">
+ <!-- Missing: Conquer -->
+
+ <software name="cosmicat" supported="yes">
<description>Cosmic Attack</description>
<year>198?</year>
<publisher>Kansas Software</publisher>
- <info name="usage" value="Type SYSTEM and load with COSMIC"/>
-
+ <info name="author" value="Wal Mansell" />
+ <info name="usage" value="Type SYSTEM and load with COSMIC, enter / to start (req. 32k memory)" />
<part name="cass1" interface="cgenie_cass">
<dataarea name="cass" size="9775">
- <rom name="cosmic attack (19xx)(kansas software).cas" size="9775" crc="a0231790" sha1="5b9fec64e2f46e8240ed1416c2e3a7c12e489251" offset="0" />
+ <rom name="cosmic_attack.cas" size="9775" crc="a0231790" sha1="5b9fec64e2f46e8240ed1416c2e3a7c12e489251" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="crzpaint" supported="yes">
+ <description>Crazy Paint</description>
+ <year>1983</year>
+ <publisher>TCS</publisher>
+ <info name="author" value="Jürgen Buchmüller" />
+ <info name="usage" value="Type SYSTEM and load with PAINT, enter / to start" />
+ <part name="cass1" interface="cgenie_cass">
+ <dataarea name="cass" size="12539">
+ <rom name="crazy_paint.cas" size="12539" crc="4665242c" sha1="07bfc1328c12f81cb7bf18c0e3bf8f1d5983222b" offset="0" />
</dataarea>
</part>
</software>
- <software name="crzpaintb" cloneof="crzpaint" supported="no">
- <description>Crazy Paint (Later, Alt)</description>
+ <software name="crzpaintc" cloneof="crzpaint" supported="yes">
+ <description>Crazy Paint (The Colour Connection)</description>
<year>1984</year>
<publisher>The Colour Connection</publisher>
- <info name="usage" value="Type SYSTEM and load with CRAZY2"/>
+ <info name="author" value="Jürgen Buchmüller" />
+ <info name="usage" value="Type SYSTEM and load with PAINT2, enter / to start (req. 32k memory)" />
+ <part name="cass1" interface="cgenie_cass">
+ <dataarea name="cass" size="13583">
+ <rom name="crazy_paint_tcc.cas" size="13583" crc="b5d90e32" sha1="734678f6fa49d7f2263b6633bb191dc0c241ec1a" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+ <software name="crzpaintca" cloneof="crzpaint" supported="yes">
+ <description>Crazy Paint (The Colour Connection, alternate)</description>
+ <year>1984</year>
+ <publisher>The Colour Connection</publisher>
+ <info name="author" value="Jürgen Buchmüller" />
+ <info name="usage" value="Type SYSTEM and load with CRAZY2, enter / to start (req. 32k memory)" />
<part name="cass1" interface="cgenie_cass">
<dataarea name="cass" size="13654">
- <rom name="crazy paint (19xx)(-).cas" size="13654" crc="75202477" sha1="465b440db5c9acc46ef5186a5b1cad0f0938d3d4" offset="0" />
+ <rom name="crazy_paint_tcc_a.cas" size="13654" crc="75202477" sha1="465b440db5c9acc46ef5186a5b1cad0f0938d3d4" offset="0" />
</dataarea>
</part>
</software>
- <software name="eagle" supported="no">
+ <!-- Missing: Death-Trap -->
+ <!-- Missing: Dig-Boy, TCS 1983 -->
+ <!-- Missing: Doppelwurm, TCS 1983 -->
+
+ <software name="eagle" supported="yes">
<description>Eagle</description>
<year>1983</year>
<publisher>TCS</publisher>
- <info name="usage" value="Type SYSTEM and load with EAGLE"/>
-
+ <info name="author" value="Thomas M. Binzinger" />
+ <info name="usage" value="Type SYSTEM and load with EAGLE, enter / to start" />
<part name="cass1" interface="cgenie_cass">
<dataarea name="cass" size="14910">
- <rom name="eagle (1983)(tcs)(de).cas" size="14910" crc="3453cd15" sha1="fb4089ad9dc2df0d5120eae7256b8354cda9696f" offset="0" />
+ <rom name="eagle.cas" size="14910" crc="3453cd15" sha1="fb4089ad9dc2df0d5120eae7256b8354cda9696f" offset="0" />
</dataarea>
</part>
</software>
- <software name="eatman" supported="no">
+ <software name="eatman" supported="yes">
<description>Eatman</description>
<year>1983</year>
<publisher>Computer Service W. Neumann - Molimerx Ltd.</publisher>
- <info name="usage" value="Type SYSTEM and load with EATMAN"/>
-
+ <info name="author" value="Bernd Herd" />
+ <info name="usage" value="Type SYSTEM and load with EATMAN, enter / to start" />
<part name="cass1" interface="cgenie_cass">
<dataarea name="cass" size="4003">
- <rom name="eatman (1983)(computer service).cas" size="4003" crc="eaa18750" sha1="641ee74cf5e19dfd69955e153a309030e47b6284" offset="0" />
+ <rom name="eatman.cas" size="4003" crc="eaa18750" sha1="641ee74cf5e19dfd69955e153a309030e47b6284" offset="0" />
</dataarea>
</part>
</software>
- <software name="eis" supported="no">
+ <software name="eis" supported="yes">
<description>Eis</description>
<year>1983</year>
<publisher>TCS</publisher>
- <info name="usage" value="Type SYSTEM and load with EIS"/>
-
+ <info name="author" value="Klaus Weber" />
+ <info name="usage" value="Type SYSTEM and load with EIS, enter / to start" />
<part name="cass1" interface="cgenie_cass">
<dataarea name="cass" size="14908">
- <rom name="eis (1983)(tcs)(de).cas" size="14908" crc="36ae9438" sha1="45046f1ec0b7111179858996d15e3eea6f85f17e" offset="0" />
+ <rom name="eis.cas" size="14908" crc="36ae9438" sha1="45046f1ec0b7111179858996d15e3eea6f85f17e" offset="0" />
</dataarea>
</part>
</software>
- <software name="eliminat" supported="no">
+ <software name="eliminat" supported="yes">
<description>Eliminator</description>
<year>1984</year>
- <publisher>The Colour Connection</publisher>
- <info name="usage" value="Type SYSTEM and load with ELIMIN"/>
-
+ <publisher>TCC</publisher>
+ <info name="author" value="Harald Bögeholz" />
+ <info name="usage" value="Type SYSTEM and load with ELIMIN, enter / to start (req. 32k memory)" />
<part name="cass1" interface="cgenie_cass">
<dataarea name="cass" size="12451">
- <rom name="eliminator (1984)(tcs).cas" size="12451" crc="e1e5e436" sha1="86cc1030fc256cd16149003d5b66725ac0f3da5d" offset="0" />
+ <rom name="eliminator.cas" size="12451" crc="e1e5e436" sha1="86cc1030fc256cd16149003d5b66725ac0f3da5d" offset="0" />
</dataarea>
</part>
</software>
- <software name="fgr" supported="no">
- <description>Unknown program "FGR"</description>
- <year>19??</year>
- <publisher>&lt;unknown&gt;</publisher>
- <info name="usage" value="Type SYSTEM and load with FGR"/>
-
- <part name="cass1" interface="cgenie_cass">
- <dataarea name="cass" size="17">
- <rom name="fgr (19xx)(-).cas" size="17" crc="3a132301" sha1="d28f49d820906046968d1f0f89c62b1f40ae17b5" offset="0" />
- </dataarea>
- </part>
- </software>
+ <!-- Missing: Empire -->
+ <!-- Missing: ExNimroid, TCS 1983 -->
+ <!-- Missing: ExReversic, TCS 1983 -->
- <software name="firebird" supported="no">
+ <software name="firebird" supported="yes">
<description>Firebird</description>
<year>1983</year>
- <publisher>Heinz Hubben Software</publisher>
- <info name="usage" value="Type SYSTEM and load with FIREB"/>
-
+ <publisher>Heinz Hübben Software</publisher>
+ <info name="author" value="Thomas M. Binzinger" />
+ <info name="usage" value="Type SYSTEM and load with FIREB, enter / to start (req. 32k memory)" />
<part name="cass1" interface="cgenie_cass">
<dataarea name="cass" size="13899">
- <rom name="firebird (1983)(binzinger, thomas m.)(de).cas" size="13899" crc="a102563d" sha1="7006f67ed89269de733997022c5998e402d774fb" offset="0" />
+ <rom name="firebird.cas" size="13899" crc="a102563d" sha1="7006f67ed89269de733997022c5998e402d774fb" offset="0" />
</dataarea>
</part>
</software>
- <software name="flugsim" supported="no">
+ <software name="flugsim" supported="yes">
<description>Colour Genie Flugsimulator</description>
- <year>198?</year>
+ <year>1984</year>
<publisher>TCS</publisher>
- <info name="usage" value="Type SYSTEM and load with FLUG"/>
-
+ <info name="usage" value="Type SYSTEM and load with FLUG, enter / to start (req. 32k memory)" />
<part name="cass1" interface="cgenie_cass">
<dataarea name="cass" size="15755">
- <rom name="flugsimulator (19xx)(-)(de).cas" size="15755" crc="091cc8bd" sha1="02ebb664e9335035a68419b92193114da5caacc1" offset="0" />
+ <rom name="flugsimulator.cas" size="15755" crc="091cc8bd" sha1="02ebb664e9335035a68419b92193114da5caacc1" offset="0" />
</dataarea>
</part>
</software>
- <software name="fraggles" supported="no">
- <description>Im Reich der Fraggles</description>
+ <software name="fraggles" supported="yes">
+ <description>Im Reich der Fraggels</description>
<year>19??</year>
<publisher>&lt;unknown&gt;</publisher>
- <info name="usage" value="Type SYSTEM and load with FRAGGL"/>
-
+ <info name="usage" value="Type SYSTEM and load with FRAGGL (req. 32k memory and floppy drive)"/>
<part name="cass1" interface="cgenie_cass">
<dataarea name="cass" size="12619">
- <rom name="im reich aer fraggles (19xx)(-).cas" size="12619" crc="4a107aaf" sha1="4664d6bcf7ae86558b598a576c6249b7612b00c3" offset="0" />
+ <rom name="im_reich_der_fraggels.cas" size="12619" crc="4a107aaf" sha1="4664d6bcf7ae86558b598a576c6249b7612b00c3" offset="0" />
</dataarea>
</part>
</software>
- <software name="glueck" supported="no">
- <description>Glueckspilz</description>
- <year>1983</year>
- <publisher>TCS?</publisher>
- <info name="usage" value="Type SYSTEM and load with GLUECK"/>
+ <!-- Missing: Galactic Attack, Klaus Weber -->
+ <software name="glueck" supported="yes">
+ <description>Glückspilz</description>
+ <year>1983</year>
+ <publisher>&lt;unknown&gt;</publisher>
+ <info name="author" value="Udo Gronostay, Klaus Kunze" />
+ <info name="usage" value="Type SYSTEM and load with GLUECK, enter / to start (req. 32k memory)" />
<part name="cass1" interface="cgenie_cass">
<dataarea name="cass" size="14655">
- <rom name="glueckspilz (1983)(gronostay, udo - kunze, klaus)(de).cas" size="14655" crc="92c71078" sha1="b118e0da5824e55df8268a3bbc10be64f7d7499e" offset="0" />
+ <rom name="glueckspilz.cas" size="14655" crc="92c71078" sha1="b118e0da5824e55df8268a3bbc10be64f7d7499e" offset="0" />
</dataarea>
</part>
</software>
- <software name="grafiked" supported="no">
- <description>Grafik Editor</description>
+ <software name="grafiked" supported="yes">
+ <description>Grafik-Editor</description>
<year>1983</year>
- <publisher>TCS?</publisher>
- <info name="usage" value="Type SYSTEM and load with GRAFIK"/>
-
+ <publisher>TCS</publisher>
+ <info name="author" value="Udo Gerber" />
+ <info name="usage" value="Type SYSTEM and load with GRAFIK" />
<part name="cass1" interface="cgenie_cass">
<dataarea name="cass" size="41555">
- <rom name="grafik editor (1983)(gerber, udo)(de).cas" size="41555" crc="7cbf2726" sha1="7e0b4e3dd1363a68324f50408f827e685aaab286" offset="0" />
+ <!-- Aborts with a syntax error, bad? -->
+ <rom name="grafik_editor.cas" size="41555" crc="7cbf2726" sha1="7e0b4e3dd1363a68324f50408f827e685aaab286" offset="0" status="baddump" />
</dataarea>
</part>
</software>
- <software name="helikopt" supported="no">
- <description>Helikopter</description>
+ <software name="hektik" supported="yes">
+ <description>Hektik</description>
<year>1983</year>
- <publisher>Heinz Hubben Software</publisher>
- <info name="usage" value="Type SYSTEM and load with HELIKO"/>
+ <publisher>TCS</publisher>
+ <info name="author" value="Jürgen Buchmüller" />
+ <info name="usage" value="Type SYSTEM and load with HEKTIK, enter / to start (req. 32k memory)" />
+ <part name="cass1" interface="cgenie_cass">
+ <dataarea name="cass" size="14668">
+ <rom name="hektik.cas" size="14668" crc="37475957" sha1="0a79c39ef04f46993e440ffd842f125ac43140e7" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+ <software name="helikopt" supported="yes">
+ <description>Helikopter</description>
+ <year>1983</year>
+ <publisher>Heinz Hübben Software</publisher>
+ <info name="author" value="Thomas M. Binzinger" />
+ <info name="usage" value="Type SYSTEM and load with HELIKO" />
<part name="cass1" interface="cgenie_cass">
<dataarea name="cass" size="18148">
- <rom name="helikopter (1983)(binzinger, thomas m.)(de).cas" size="18148" crc="5c046ce2" sha1="606560daa74dd39b06e89881918b730bd19f2442" offset="0" />
+ <rom name="helikopter.cas" size="18148" crc="5c046ce2" sha1="606560daa74dd39b06e89881918b730bd19f2442" offset="0" />
</dataarea>
</part>
</software>
- <software name="invasion" supported="no">
+ <software name="invasion" supported="partial">
<description>Invasion aus dem Weltraum</description>
<year>1982</year>
- <publisher>Harald Boegeholz</publisher>
- <info name="usage" value="Type SYSTEM and load with INVASI"/>
-
+ <publisher>TCS</publisher>
+ <info name="author" value="Harald Bögeholz" />
+ <info name="usage" value="Type SYSTEM and load with INVASI, enter / to start (req. 32k memory)" />
<part name="cass1" interface="cgenie_cass">
<dataarea name="cass" size="8450">
- <rom name="invasion aus dem weltraum (1982)(boegeholz, harald)(de).cas" size="8450" crc="8fd27759" sha1="445198d22d8d7b2dafd747006ffd156fede301bc" offset="0" />
+ <rom name="invasion_aus_dem_weltraum.cas" size="8450" crc="8fd27759" sha1="445198d22d8d7b2dafd747006ffd156fede301bc" offset="0" />
</dataarea>
</part>
</software>
<software name="jetset" supported="no">
- <description>Jet Set Billy 16K Version</description>
+ <description>Jet Set Billy (16k)</description>
<year>1984</year>
<publisher>Arcade Games</publisher>
- <info name="usage" value="Type SYSTEM and load with JETSET"/>
-
+ <info name="author" value="R. Hamilton" />
+ <info name="usage" value="Type SYSTEM and load with JETSET" />
<part name="cass1" interface="cgenie_cass">
<dataarea name="cass" size="2123">
- <rom name="jet set billy (1984)(hamilton, r.)(part 1 of 2)[req 16k].cas" size="2123" crc="883161e8" sha1="6062a05ccde2e8b8165575c902f2109ca83e95f2" offset="0" />
+ <rom name="jet_set_billy_part1.cas" size="2123" crc="883161e8" sha1="6062a05ccde2e8b8165575c902f2109ca83e95f2" offset="0" />
</dataarea>
</part>
<part name="cass2" interface="cgenie_cass">
<dataarea name="cass" size="9197">
- <rom name="jet set billy (1984)(hamilton, r.)(part 2 of 2)[req 16k].cas" size="9197" crc="98c7a0da" sha1="74d0a79f9a931df03df2b06350521d7d390786c9" offset="0" />
+ <!-- Displays "Loading error" after a while -->
+ <rom name="jet_set_billy_part2.cas" size="9197" crc="98c7a0da" sha1="74d0a79f9a931df03df2b06350521d7d390786c9" offset="0" status="baddump" />
+ </dataarea>
+ </part>
+ </software>
+
+ <!-- Missing: Joker-Poker, TCS 1983 -->
+
+ <software name="kaefer" supported="yes">
+ <description>Marienkäfer</description>
+ <year>1984</year>
+ <publisher>&lt;unknown&gt;</publisher>
+ <info name="author" value="Klaus Weber" />
+ <info name="usage" value="Type SYSTEM and load with KAEFER, enter / to start (req. 32k memory)" />
+ <part name="cass1" interface="cgenie_cass">
+ <dataarea name="cass" size="17118">
+ <rom name="marienkaefer.cas" size="17118" crc="38422db1" sha1="a3aabab4aa5166b18846186a5565eca47f4d62e9" offset="0" />
</dataarea>
</part>
</software>
- <software name="life" supported="no">
+ <!-- Missing: Kings -->
+
+ <software name="life" supported="yes">
<description>Life</description>
<year>1983</year>
<publisher>TCS</publisher>
- <info name="usage" value="Type SYSTEM and load with LIFE"/>
-
+ <info name="author" value="Jürgen Buchmüller" />
+ <info name="usage" value="Type SYSTEM and load with LIFE, enter / to start" />
<part name="cass1" interface="cgenie_cass">
<dataarea name="cass" size="5625">
- <rom name="life (1983)(tcs)(de).cas" size="5625" crc="18d97fe6" sha1="166e8cc82883ebf5afa64db8acb7fbd7121a2175" offset="0" />
+ <rom name="life.cas" size="5625" crc="18d97fe6" sha1="166e8cc82883ebf5afa64db8acb7fbd7121a2175" offset="0" />
</dataarea>
</part>
</software>
- <software name="lunarlan" supported="no">
+ <!-- Missing: Länder-Quiz, Klaus Weber -->
+
+ <software name="lunarlan" supported="yes">
<description>Lunar Lander</description>
<year>1983</year>
<publisher>TCS</publisher>
- <info name="usage" value="Type SYSTEM and load with LUNA L"/>
-
+ <info name="author" value="Klaus Weber" />
+ <info name="usage" value="Type SYSTEM and load with LUNA L, enter / to start (req. 32k memory)" />
<part name="cass1" interface="cgenie_cass">
<dataarea name="cass" size="15493">
- <rom name="lunar lander (1983)(weber, klaus).cas" size="15493" crc="916ceeb1" sha1="c1662e927629668e8dbdf1a2b4f955e27894474a" offset="0" />
+ <rom name="lunar_lander.cas" size="15493" crc="916ceeb1" sha1="c1662e927629668e8dbdf1a2b4f955e27894474a" offset="0" />
</dataarea>
</part>
</software>
- <software name="mampf2" supported="no">
+ <!-- Missing: Madtree, TCS 1983 -->
+ <!-- Missing: Mau-Mau, TCS 1982 (Carsten Schmidt, Kalle Braun) -->
+ <!-- Missing: Mampf (Mampfman?), TCS 1983 -->
+
+ <software name="mampf2" supported="yes">
<description>Mampf Man II</description>
<year>1983</year>
<publisher>TCS</publisher>
- <info name="usage" value="Type SYSTEM and load with MAMPF2"/>
-
+ <info name="author" value="Klaus Weber" />
+ <info name="usage" value="Type SYSTEM and load with MAMPF2, enter / to start (req. 32k memory)" />
<part name="cass1" interface="cgenie_cass">
<dataarea name="cass" size="17055">
- <rom name="mampf man ii (1983)(weber, klaus).cas" size="17055" crc="e6ffd933" sha1="c1952444e8d99e367058ddd0b70ecb0eb3ce8834" offset="0" />
+ <rom name="mampfman2.cas" size="17055" crc="e6ffd933" sha1="c1952444e8d99e367058ddd0b70ecb0eb3ce8834" offset="0" />
</dataarea>
</part>
</software>
- <software name="kaefer" supported="no">
- <description>Marien Kaefer</description>
- <year>1984</year>
- <publisher>TCS?</publisher>
- <info name="usage" value="Type SYSTEM and load with KAEFER"/>
+ <!-- Missing: Mathematik-Lernprogramm -->
+ <!-- Missing: Mausi, TCS 1983 -->
+ <!-- Missing: Memory -->
- <part name="cass1" interface="cgenie_cass">
- <dataarea name="cass" size="17118">
- <rom name="marien kaefer (1984)(weber, klaus).cas" size="17118" crc="38422db1" sha1="a3aabab4aa5166b18846186a5565eca47f4d62e9" offset="0" />
- </dataarea>
- </part>
- </software>
-
- <software name="meteor" supported="no">
+ <software name="meteor" supported="yes">
<description>Meteor</description>
<year>1983</year>
<publisher>TCS</publisher>
- <info name="usage" value="Type SYSTEM and load with METEOR"/>
-
+ <info name="author" value="Harald Bögeholz" />
+ <info name="usage" value="Type SYSTEM and load with METEOR" />
<part name="cass1" interface="cgenie_cass">
<dataarea name="cass" size="8628">
- <rom name="meteor (1983)(tcs)(de).cas" size="8628" crc="5683a102" sha1="78ba24d6eda120ede404e3c6fb4fb4d7cb7fd019" offset="0" />
+ <rom name="meteor.cas" size="8628" crc="5683a102" sha1="78ba24d6eda120ede404e3c6fb4fb4d7cb7fd019" offset="0" />
</dataarea>
</part>
</software>
<software name="monroe" supported="no">
- <description>Unknown program "MONROE"</description>
- <year>19??</year>
+ <description>Unknown (data?)</description>
+ <year>198?</year>
<publisher>&lt;unknown&gt;</publisher>
- <info name="usage" value="Type SYSTEM and load with MONROE"/>
-
+ <info name="usage" value="Type SYSTEM and load with MONROE" />
<part name="cass1" interface="cgenie_cass">
<dataarea name="cass" size="4198">
- <rom name="monroe (19xx)(-).cas" size="4198" crc="820b662f" sha1="0c2ccf61ee673384a05d1012fca09e215fd7880d" offset="0" />
+ <rom name="monroe.cas" size="4198" crc="820b662f" sha1="0c2ccf61ee673384a05d1012fca09e215fd7880d" offset="0" />
</dataarea>
</part>
</software>
- <software name="motten" supported="no">
+ <software name="motten" supported="yes">
<description>Motten</description>
<year>1982</year>
<publisher>TCS</publisher>
- <info name="usage" value="Type SYSTEM and load with MOTTEN"/>
-
+ <info name="author" value="Jürgen Buchmüller" />
+ <info name="usage" value="Type SYSTEM and load with MOTTEN, enter / to start" />
<part name="cass1" interface="cgenie_cass">
<dataarea name="cass" size="14630">
- <rom name="motten (1982)(tcs)(de).cas" size="14630" crc="fb5efa13" sha1="75fe474ec2ab0ebf7d300e95561788b4d91b8637" offset="0" />
+ <rom name="motten.cas" size="14630" crc="fb5efa13" sha1="75fe474ec2ab0ebf7d300e95561788b4d91b8637" offset="0" />
</dataarea>
</part>
</software>
- <software name="musik" supported="no">
+ <software name="musik" supported="yes">
<description>Musik</description>
<year>1983</year>
<publisher>TCS</publisher>
- <info name="usage" value="Type SYSTEM and load with MUSIK"/>
-
+ <info name="usage" value="Type SYSTEM and load with MUSIK, enter / to start (req. 32k memory)" />
<part name="cass1" interface="cgenie_cass">
<dataarea name="cass" size="15639">
- <rom name="musik demo (1983)(tcs).cas" size="15639" crc="ac9a24d8" sha1="7d035d6f2b523e87462f41812352634bfee9397e" offset="0" />
+ <rom name="musik.cas" size="15639" crc="ac9a24d8" sha1="7d035d6f2b523e87462f41812352634bfee9397e" offset="0" />
</dataarea>
</part>
</software>
- <software name="netzo" supported="no">
+ <!-- Missing: NE555 -->
+
+ <software name="netzo" supported="yes">
<description>Netzo</description>
<year>1983</year>
<publisher>TCS</publisher>
- <info name="usage" value="Type SYSTEM and load with NETZO"/>
-
+ <info name="author" value="Thomas M. Binzinger" />
+ <info name="usage" value="Type SYSTEM and load with NETZO, enter / to start (req. 32k memory)" />
<part name="cass1" interface="cgenie_cass">
<dataarea name="cass" size="14990">
- <rom name="netzo (1983)(tcs)(de).cas" size="14990" crc="63eac136" sha1="fa35faff66988c94ed7caff0c9f593075d2dcbb0" offset="0" />
+ <rom name="netzo.cas" size="14990" crc="63eac136" sha1="fa35faff66988c94ed7caff0c9f593075d2dcbb0" offset="0" />
</dataarea>
</part>
</software>
- <software name="pacboy" supported="no">
+ <!-- Missing: Opamp (Operationsverstärker Applikationen), Uwe Gerber -->
+ <!-- Missing: Optik (Grundeigenschaften des Lichts) -->
+ <!-- Missing: Orgel, TCS 1982 -->
+
+ <software name="pacboy" supported="yes">
<description>Pac Boy</description>
<year>1984</year>
- <publisher>Heinz Hubben Software</publisher>
- <info name="usage" value="Type SYSTEM and load with PACBOY"/>
-
+ <publisher>Heinz Hübben Software</publisher>
+ <info name="developer" value="Spectra-Games" />
+ <info name="usage" value="Type SYSTEM and load with PACBOY (req. 32k memory)" />
<part name="cass1" interface="cgenie_cass">
<dataarea name="cass" size="13376">
- <rom name="pac boy (1984)(spectra games)(de).cas" size="13376" crc="515b36d4" sha1="a3945e5dda04f0964880acacd2778dd99ff200d3" offset="0" />
- </dataarea>
- </part>
- </software>
-
- <software name="crzpaint" supported="no">
- <description>Crazy Paint</description>
- <year>1983</year>
- <publisher>TCS</publisher>
- <info name="usage" value="Type SYSTEM and load with PAINT"/>
-
- <part name="cass1" interface="cgenie_cass">
- <dataarea name="cass" size="12539">
- <rom name="painter (19xx)(-).cas" size="12539" crc="4665242c" sha1="07bfc1328c12f81cb7bf18c0e3bf8f1d5983222b" offset="0" />
+ <rom name="pac_boy.cas" size="13376" crc="515b36d4" sha1="a3945e5dda04f0964880acacd2778dd99ff200d3" offset="0" />
</dataarea>
</part>
</software>
- <software name="crzpainta" cloneof="crzpaint" supported="no">
- <description>Crazy Paint (Later)</description>
- <year>1984</year>
- <publisher>The Colour Connection</publisher>
- <info name="usage" value="Type SYSTEM and load with PAINT2"/>
-
- <part name="cass1" interface="cgenie_cass">
- <dataarea name="cass" size="13583">
- <rom name="painter 2 (19xx)(-).cas" size="13583" crc="b5d90e32" sha1="734678f6fa49d7f2263b6633bb191dc0c241ec1a" offset="0" />
- </dataarea>
- </part>
- </software>
+ <!-- Missing: Panik, TCS 1982 -->
+ <!-- Missing: Panzerkampf, TCS 1983 -->
+ <!-- Missing: Physik des Transistors -->
+ <!-- Missing: Plotter, TCS 1983 -->
+ <!-- Missing: Punktejagd -->
- <software name="rs232" supported="no">
+ <software name="rs232" supported="yes">
<description>RS-232 Treiberprogramm</description>
- <year>19??</year>
+ <year>198?</year>
<publisher>&lt;unknown&gt;</publisher>
- <info name="usage" value="Type SYSTEM and load with RS232"/>
-
+ <info name="usage" value="Type SYSTEM and load with RS232, enter / to start (req. 32k memory)" />
<part name="cass1" interface="cgenie_cass">
<dataarea name="cass" size="209">
- <rom name="rs-232 treiber programm (19xx)(-)(de).cas" size="209" crc="53f5b980" sha1="8d192995c5ac6e4a7241ae8200f78ab26647b3c4" offset="0" />
+ <rom name="rs232_treiber_programm.cas" size="209" crc="53f5b980" sha1="8d192995c5ac6e4a7241ae8200f78ab26647b3c4" offset="0" />
</dataarea>
</part>
</software>
- <software name="saug" supported="no">
+ <software name="saug" supported="yes">
<description>Saug</description>
<year>1983</year>
<publisher>TCS</publisher>
- <info name="usage" value="Type SYSTEM and load with SAUG"/>
-
+ <info name="author" value="Jürgen Buchmüller" />
+ <info name="usage" value="Type SYSTEM and load with SAUG, enter / to start (req. 32k memory)" />
<part name="cass1" interface="cgenie_cass">
<dataarea name="cass" size="11885">
- <rom name="saug (1982)(tcs).cas" size="11885" crc="f477896c" sha1="34fa2c2ce143785eb9ebda1b3889f86ee2fa81ab" offset="0" />
- </dataarea>
- </part>
- </software>
-
- <software name="scrprint" supported="no">
- <description>Screen Printer</description>
- <year>1983</year>
- <publisher>TCS</publisher>
- <info name="usage" value="Type SYSTEM and load with FONTS"/>
-
- <part name="cass1" interface="cgenie_cass">
- <dataarea name="cass" size="12071">
- <rom name="screen printer (1983)(tcs).cas" size="12071" crc="ea427be8" sha1="6a4f8d8858a0a8859d21eb2bab658fbc25526319" offset="0" />
+ <rom name="saug.cas" size="11885" crc="f477896c" sha1="34fa2c2ce143785eb9ebda1b3889f86ee2fa81ab" offset="0" />
</dataarea>
</part>
</software>
- <software name="scuttle" supported="no">
+ <software name="scuttle" supported="yes">
<description>Scuttle</description>
- <year>1982</year>
- <publisher>TGC?</publisher>
- <info name="usage" value="Type SYSTEM and load with SCUTTL"/>
-
+ <year>198?</year>
+ <publisher>&lt;unknown&gt;</publisher>
+ <info name="author" value="T. Schwertfeger" />
+ <info name="usage" value="Type SYSTEM and load with SCUTTL, enter / to start" />
<part name="cass1" interface="cgenie_cass">
<dataarea name="cass" size="14906">
- <rom name="scuttle (1982)(schwertfeger, t.)(de).cas" size="14906" crc="2fb32641" sha1="c0bab5873e9ac16e853d98a2eab374afeebb1dd2" offset="0" />
+ <rom name="scuttle.cas" size="14906" crc="2fb32641" sha1="c0bab5873e9ac16e853d98a2eab374afeebb1dd2" offset="0" />
</dataarea>
</part>
</software>
- <software name="skramble" supported="no">
+ <!-- Missing: Shaper -->
+
+ <software name="skramble" supported="yes">
<description>Skramble</description>
<year>1983</year>
<publisher>Algray Software</publisher>
- <info name="usage" value="Type SYSTEM and load with SKRMBL"/>
-
+ <info name="author" value="Stuart Sampson" />
+ <info name="usage" value="Type SYSTEM and load with SKRMBL, enter / to start" />
<part name="cass1" interface="cgenie_cass">
<dataarea name="cass" size="21939">
- <rom name="skramble (1983)(sampson, stuart).cas" size="21939" crc="249df317" sha1="f9ebd7d63ec8d018eef5ac351de75aa615cf70a7" offset="0" />
+ <!-- Seems to be twice on tape? -->
+ <rom name="skramble.cas" size="21939" crc="249df317" sha1="f9ebd7d63ec8d018eef5ac351de75aa615cf70a7" offset="0" />
</dataarea>
</part>
</software>
- <software name="softschu" supported="no">
+ <!-- Missing: Sound-Editor -->
+
+ <software name="softschu" supported="yes">
<description>Software-Schutz</description>
<year>1983</year>
- <publisher>Harald Boegeholz</publisher>
- <info name="usage" value="Type SYSTEM and load with EGPROT"/>
-
+ <publisher>Harald Bögeholz</publisher>
+ <info name="usage" value="Type SYSTEM and load with EGPROT, enter / to start" />
<part name="cass1" interface="cgenie_cass">
<dataarea name="cass" size="978">
- <rom name="software-schutz (1983)(boegeholz, harald)(de).cas" size="978" crc="4baa38a3" sha1="5efc2ab9b44da3d2c3cf743808e7a20b9e8e595c" offset="0" />
+ <rom name="software_schutz.cas" size="978" crc="4baa38a3" sha1="5efc2ab9b44da3d2c3cf743808e7a20b9e8e595c" offset="0" />
</dataarea>
</part>
</software>
- <software name="spaceatt" supported="no">
+ <software name="spaceatt" supported="yes">
<description>Space Attack</description>
<year>1984</year>
- <publisher>The Colour Connection</publisher>
- <info name="usage" value="Type SYSTEM and load with SPACE"/>
-
+ <publisher>TCC</publisher>
+ <info name="author" value="A. Mueller" />
+ <info name="usage" value="Type SYSTEM and load with SPACE, enter / to start" />
<part name="cass1" interface="cgenie_cass">
<dataarea name="cass" size="7606">
- <rom name="space attack (1984)(mueller, a.).cas" size="7606" crc="8f1c0271" sha1="9230b416d6928cb2616d3e5176589ec6c76d00ca" offset="0" />
+ <rom name="space_attack.cas" size="7606" crc="8f1c0271" sha1="9230b416d6928cb2616d3e5176589ec6c76d00ca" offset="0" />
</dataarea>
</part>
</software>
- <software name="spaceman" supported="no">
+ <software name="spaceman" supported="yes">
<description>Spaceman</description>
<year>198?</year>
- <publisher>TCS?</publisher>
- <info name="usage" value="Type SYSTEM and load with SPACE"/>
-
+ <publisher>&lt;unknown&gt;</publisher>
+ <info name="author" value="Alexander Drawe" />
+ <info name="usage" value="Type SYSTEM and load with SPACE, enter / to start (req. 32k memory)" />
<part name="cass1" interface="cgenie_cass">
<dataarea name="cass" size="11618">
- <rom name="spaceman (19xx)(drawe, alexander)(de).cas" size="11618" crc="3de8d663" sha1="19da6f30c6f254c2bb01b6ce52a9bad4d7022858" offset="0" />
+ <rom name="spaceman.cas" size="11618" crc="3de8d663" sha1="19da6f30c6f254c2bb01b6ce52a9bad4d7022858" offset="0" />
</dataarea>
</part>
</software>
- <software name="superbas" supported="no">
- <description>Super-Basic</description>
- <year>19??</year>
- <publisher>Heinz Hubben Software</publisher>
- <info name="usage" value="Type SYSTEM and load with BASCOM"/>
+ <!-- Missing: Screen-Printer (standalone) -->
+ <software name="superbas" supported="yes">
+ <description>Super-Basic</description>
+ <year>198?</year>
+ <publisher>Heinz Hübben Software</publisher>
+ <info name="usage" value="Type SYSTEM and load with BASCOM (req. 32k memory)" />
<part name="cass1" interface="cgenie_cass">
<dataarea name="cass" size="7577">
- <rom name="super basic (19xx)(huebben, heinz)(de).cas" size="7577" crc="1da95676" sha1="ab79434eed8f98bb0336a37c65a19c15af11f660" offset="0" />
+ <rom name="super_basic.cas" size="7577" crc="1da95676" sha1="ab79434eed8f98bb0336a37c65a19c15af11f660" offset="0" />
</dataarea>
</part>
</software>
- <software name="superhrn" supported="no">
+ <software name="supergra" supported="yes">
+ <description>Super-Grafik</description>
+ <year>1984</year>
+ <publisher>The Colour Connection</publisher>
+ <info name="author" value="Ralf Steffenhagen" />
+ <info name="usage" value="Type SYSTEM and load with SPLOT (req. 32k memory)" />
+ <part name="cass1" interface="cgenie_cass">
+ <dataarea name="cass" size="24370">
+ <rom name="super_grafik.cas" size="24370" crc="5f49eda1" sha1="733c7b7f0b032cf0e6e6c07831c9fa5227e191d8" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="superhrn" supported="yes">
<description>Superhirn</description>
- <year>1982</year>
+ <year>198?</year>
<publisher>TTS</publisher>
- <info name="usage" value="Type SYSTEM and load with MASTER"/>
-
+ <info name="usage" value="Type SYSTEM and load with MASTER, enter / to start" />
<part name="cass1" interface="cgenie_cass">
<dataarea name="cass" size="7938">
- <rom name="super hirn (1982)(-).cas" size="7938" crc="b2fa4ace" sha1="ec05875e6a5d63faa01778fc51880a2a32920e1d" offset="0" />
+ <rom name="superhirn.cas" size="7938" crc="b2fa4ace" sha1="ec05875e6a5d63faa01778fc51880a2a32920e1d" offset="0" />
</dataarea>
</part>
</software>
- <software name="supergra" supported="no">
- <description>Super-Grafik</description>
- <year>1984</year>
- <publisher>The Colour Connection</publisher>
- <info name="usage" value="Type SYSTEM and load with SPLOT"/>
-
+ <software name="syscopy" supported="yes">
+ <description>System Copy</description>
+ <year>198?</year>
+ <publisher>&lt;unknown&gt;</publisher>
+ <info name="author" value="Gerber" />
+ <info name="usage" value="Type SYSTEM and load with SYSCOP, enter / to start" />
<part name="cass1" interface="cgenie_cass">
- <dataarea name="cass" size="24370">
- <rom name="super plot (1984)(steffenhagen, ralf)(de).cas" size="24370" crc="5f49eda1" sha1="733c7b7f0b032cf0e6e6c07831c9fa5227e191d8" offset="0" />
+ <dataarea name="cass" size="2003">
+ <rom name="system_copy.cas" size="2003" crc="1fa35da3" sha1="0b7e18b1c1898b047fe867d10a5e0138113510e0" offset="0" />
</dataarea>
</part>
</software>
- <software name="syscopy" supported="no">
- <description>System Copy</description>
- <year>19??</year>
+ <software name="tapedisk" supported="yes">
+ <description>Tape-Disk Converter 1.11</description>
+ <year>198?</year>
<publisher>&lt;unknown&gt;</publisher>
- <info name="usage" value="Type SYSTEM and load with SYSCOP"/>
-
+ <info name="usage" value="Type SYSTEM and load with COLOFF, enter / to start (req. floppy drive)" />
<part name="cass1" interface="cgenie_cass">
- <dataarea name="cass" size="2003">
- <rom name="system copy (19xx)(-)(de).cas" size="2003" crc="1fa35da3" sha1="0b7e18b1c1898b047fe867d10a5e0138113510e0" offset="0" />
+ <dataarea name="cass" size="1452">
+ <rom name="tape-disk_converter_111.cas" size="1452" crc="88fdad97" sha1="6d66db21fb6bfdd0b339a5e4884a9f014c06eb3a" offset="0" />
</dataarea>
</part>
</software>
- <software name="tausend" supported="no">
- <description>Tausend Fuss</description>
+ <software name="tausend" supported="yes">
+ <description>Tausendfuss</description>
<year>1983</year>
<publisher>TCS</publisher>
- <info name="usage" value="Type SYSTEM and load with FUSS"/>
-
+ <info name="usage" value="Type SYSTEM and load with FUSS, enter / to start" />
<part name="cass1" interface="cgenie_cass">
<dataarea name="cass" size="3822">
- <rom name="tausend fuss (1983)(tcs)(de).cas" size="3822" crc="41504360" sha1="ea0449594a28ce73df36a7bbf643e89e26abc223" offset="0" />
+ <rom name="tausendfuss.cas" size="3822" crc="41504360" sha1="ea0449594a28ce73df36a7bbf643e89e26abc223" offset="0" />
</dataarea>
</part>
</software>
- <software name="toadman" supported="no">
+ <software name="toadman" supported="yes">
<description>Toad Mania</description>
<year>1983</year>
<publisher>Gumboot Software</publisher>
- <info name="usage" value="Type SYSTEM and load with TOAD"/>
-
+ <info name="author" value="Tony Parkin, Marc J. Leduc" />
+ <info name="usage" value="Type SYSTEM and load with TOAD" />
<part name="cass1" interface="cgenie_cass">
<dataarea name="cass" size="9359">
- <rom name="toad mania (1983)(gumboot).cas" size="9359" crc="e91c4c81" sha1="c221592c09df5f44284e6ded42df3fcc7e5ff088" offset="0" />
+ <rom name="toad_mania.cas" size="9359" crc="e91c4c81" sha1="c221592c09df5f44284e6ded42df3fcc7e5ff088" offset="0" />
</dataarea>
</part>
</software>
- <software name="tracemon" supported="no">
+ <software name="tracemon" supported="yes">
<description>Tracemon</description>
<year>1983</year>
<publisher>Juergen Buchmueller</publisher>
- <info name="usage" value="Type SYSTEM and load with TRACEM"/>
-
+ <info name="author" value="Jürgen Buchmüller" />
+ <info name="usage" value="Type SYSTEM and load with TRACEM, enter / to start (req. 32k memory)" />
<part name="cass1" interface="cgenie_cass">
<dataarea name="cass" size="8382">
- <rom name="tracemon (1983)(buchmueller, juergen).cas" size="8382" crc="6b0bf332" sha1="a2f354850c0b5e6a55273ce726a52010eb33ca4f" offset="0" />
+ <rom name="tracemon.cas" size="8382" crc="6b0bf332" sha1="a2f354850c0b5e6a55273ce726a52010eb33ca4f" offset="0" />
</dataarea>
</part>
</software>
- <software name="triton" supported="no">
+ <software name="triton" supported="yes">
<description>Triton Battle</description>
<year>19??</year>
<publisher>Schmidtke Electronic</publisher>
- <info name="usage" value="Type SYSTEM and load with TRIBAT"/>
-
+ <info name="author" value="M. Gergeleit, H. C. Steinbeck" />
+ <info name="usage" value="Type SYSTEM and load with TRIBAT, enter / to start (req. 32k memory)" />
<part name="cass1" interface="cgenie_cass">
<dataarea name="cass" size="11743">
- <rom name="triton battle (19xx)(gergeleit, m. - steinbeck, h.c.).cas" size="11743" crc="1bbab68f" sha1="4744ce3b7e2c6912fd9ddfd6dfba4007eebca62c" offset="0" />
+ <rom name="triton_battle.cas" size="11743" crc="1bbab68f" sha1="4744ce3b7e2c6912fd9ddfd6dfba4007eebca62c" offset="0" />
</dataarea>
</part>
</software>
- <software name="ubootjag" supported="no">
+ <software name="ubootjag" supported="yes">
<description>U-Boot-Jagd</description>
<year>198?</year>
- <publisher>TGC?</publisher>
- <info name="usage" value="Type SYSTEM and load with U-BOOT"/>
-
+ <publisher>&lt;unknown&gt;</publisher>
+ <info name="usage" value="Type SYSTEM and load with U-BOOT, enter / to start" />
<part name="cass1" interface="cgenie_cass">
<dataarea name="cass" size="11497">
- <rom name="u boot jagd (19xx)(-)(de).cas" size="11497" crc="5caa9b13" sha1="e1c10245217b5f8e23a3a966fb40f809e105c1a2" offset="0" />
+ <rom name="uboot_jagd.cas" size="11497" crc="5caa9b13" sha1="e1c10245217b5f8e23a3a966fb40f809e105c1a2" offset="0" />
</dataarea>
</part>
</software>
<software name="unkmulti" supported="no">
<description>Unknown multi-program tape</description>
- <year>19??</year>
+ <year>198?</year>
<publisher>&lt;unknown&gt;</publisher>
- <info name="usage" value="Type SYSTEM and load with UHRCOP or SCRPRT"/>
-
+ <info name="usage" value="Type SYSTEM and load with UHRCOP or SCRPRT" />
<part name="cass1" interface="cgenie_cass">
<dataarea name="cass" size="1481">
- <rom name="uhr copy (19xx)(-)(de).cas" size="1481" crc="27938748" sha1="c1e87c3e7aa2842b5b95ce4fbac24d6cb9a287fd" offset="0" />
+ <rom name="uhrcop_scrnprt.cas" size="1481" crc="27938748" sha1="c1e87c3e7aa2842b5b95ce4fbac24d6cb9a287fd" offset="0" />
</dataarea>
</part>
</software>
- <software name="zeichen" supported="no">
- <description>Zeichen Editor</description>
+ <!-- Missing: Wurm -->
+
+ <software name="zeichene" supported="yes">
+ <description>Zeicheneditor +</description>
<year>1983</year>
<publisher>TCS</publisher>
- <info name="usage" value="Type SYSTEM and load with EDITO2"/>
+ <info name="usage" value="Type SYSTEM and load with EDITOR, enter / to start (req. 32k memory)" />
+ <part name="cass1" interface="cgenie_cass">
+ <dataarea name="cass" size="9233">
+ <rom name="zeicheneditor_plus.cas" size="9233" crc="dff8308e" sha1="b3cb291e5f96141187d19b18edc048aba544d7be" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+ <software name="zeichen2" supported="yes">
+ <description>Zeicheneditor + (incl. SCREEN-Editor)</description>
+ <year>1983</year>
+ <publisher>TCS</publisher>
+ <info name="usage" value="Type SYSTEM and load with EDITO2, enter / to start (req. 32k memory)" />
<part name="cass1" interface="cgenie_cass">
<dataarea name="cass" size="11131">
- <rom name="definierbare zeichen editor (1983)(tcs).cas" size="11131" crc="a21e5f61" sha1="57ce7c921e8a773de0f30dde65f2320e114bbe71" offset="0" />
+ <rom name="zeicheneditor_plus_2.cas" size="11131" crc="a21e5f61" sha1="57ce7c921e8a773de0f30dde65f2320e114bbe71" offset="0" />
</dataarea>
</part>
</software>
- <software name="zeichena" cloneof="zeichen" supported="no">
- <description>Zeichen Editor (Alt)</description>
+ <software name="zeichens" supported="yes">
+ <description>Zeichensätze (incl. Screen-Printer)</description>
<year>1983</year>
<publisher>TCS</publisher>
- <info name="usage" value="Type SYSTEM and load with EDITOR"/>
-
+ <info name="author" value="Jürgen Buchmüller" />
+ <info name="usage" value="Type SYSTEM and load with FONTS, enter / to start (req. 32k memory)" />
<part name="cass1" interface="cgenie_cass">
- <dataarea name="cass" size="9233">
- <rom name="definierbare zeichen editor (1983)(tcs)[a].cas" size="9233" crc="dff8308e" sha1="b3cb291e5f96141187d19b18edc048aba544d7be" offset="0" />
+ <dataarea name="cass" size="12071">
+ <rom name="zeichensaetze_with_screen_printer.cas" size="12071" crc="ea427be8" sha1="6a4f8d8858a0a8859d21eb2bab658fbc25526319" offset="0" />
</dataarea>
</part>
</software>
diff --git a/hash/gamegear.xml b/hash/gamegear.xml
index 2818c50119e..1caac2b5e7c 100644
--- a/hash/gamegear.xml
+++ b/hash/gamegear.xml
@@ -3909,7 +3909,7 @@ a certain item) -->
<description>Lemmings 2 - The Tribes (Euro, Prototype)</description>
<year>1994</year>
<publisher>Psygnosis</publisher>
- <part name="cart" interface="sms_cart">
+ <part name="cart" interface="gamegear_cart">
<dataarea name="rom" size="524288">
<rom name="lemmings 2 - the tribes [proto].bin" size="524288" crc="fbc807e1" sha1="ad0ce8fc8ce9e5ef9b68b76fb7f3eced4245d5c4" offset="000000" />
</dataarea>
diff --git a/hash/guab.xml b/hash/guab.xml
new file mode 100644
index 00000000000..038f337375d
--- /dev/null
+++ b/hash/guab.xml
@@ -0,0 +1,127 @@
+<?xml version="1.0"?>
+<!DOCTYPE softwarelist SYSTEM "softwarelist.dtd">
+
+<softwarelist name="guab" description="JPM Give us a Break floppy disks">
+
+ <software name="guab3">
+ <description>Give us a Break (3rd edition)</description>
+ <year>1986</year>
+ <publisher>JPM</publisher>
+ <part name="flop1" interface="floppy_3_5">
+ <dataarea name="flop" size="737280">
+ <rom name="guab3.dsk" size="737280" crc="ecb41e06" sha1="2900a95046b38312c6035ea394b04b62c1d29f42" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="guab3a">
+ <description>Give us a Break (3rd edition alt?)</description>
+ <year>1986</year>
+ <publisher>JPM</publisher>
+ <part name="flop1" interface="floppy_3_5">
+ <dataarea name="flop" size="737280">
+ <rom name="guab7c.dsk" size="737280" crc="f5f10f87" sha1="80e540339efbfe59b656d6cd4f466a17df84c123" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="guab4">
+ <description>Give us a Break (4th edition)</description>
+ <year>1986</year>
+ <publisher>JPM</publisher>
+ <part name="flop1" interface="floppy_3_5">
+ <dataarea name="flop" size="737280">
+ <rom name="guab8d.dsk" size="737280" crc="b87c55ce" sha1="20debbefae194276b0813518634cf52bed093e73" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="guab6">
+ <description>Give us a Break (6th edition)</description>
+ <year>1986</year>
+ <publisher>JPM</publisher>
+ <part name="flop1" interface="floppy_3_5">
+ <dataarea name="flop" size="737280">
+ <rom name="guabf6.dsk" size="737280" crc="08804c28" sha1="608d89d598b7acb133814540dba98cea29c6cad6" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="guab6a">
+ <description>Give us a Break (6th edition alt?)</description>
+ <year>1986</year>
+ <publisher>JPM</publisher>
+ <part name="flop1" interface="floppy_3_5">
+ <dataarea name="flop" size="737280">
+ <rom name="guab9f.dsk" size="737280" crc="85329fe9" sha1="f5ca1956c37b786fa0a4f8f0607a0a2b19d3fbb0" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="guab7">
+ <description>Give us a Break (7th edition)</description>
+ <year>1986</year>
+ <publisher>JPM</publisher>
+ <part name="flop1" interface="floppy_3_5">
+ <dataarea name="flop" size="737280">
+ <rom name="guab9g.dsk" size="737280" crc="6b8c36f9" sha1="1d9f4d943f2962603bbe39e5b58befe15954a6d6" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="guab21">
+ <description>Give us a Break (21st edition)</description>
+ <year>1986</year>
+ <publisher>JPM</publisher>
+ <part name="flop1" interface="floppy_3_5">
+ <dataarea name="flop" size="737280">
+ <rom name="guab21.dsk" size="737280" crc="558ee009" sha1="d2a02662216e10f80a215044f1929df7255b6136" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="guab43">
+ <description>Give us a Break (43rd edition)</description>
+ <year>1986</year>
+ <publisher>JPM</publisher>
+ <part name="flop1" interface="floppy_3_5">
+ <dataarea name="flop" size="737280">
+ <rom name="guab43.dsk" size="737280" crc="1fd8f614" sha1="656ce33c93a9d0e81ec7fcdd8f4e4b2f9ad1e485" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="crisscrs">
+ <description>Criss Cross (Sweden)</description>
+ <year>1986</year>
+ <publisher>JPM</publisher>
+ <part name="flop1" interface="floppy_3_5">
+ <dataarea name="flop" size="737280">
+ <rom name="crisscrs.dsk" size="737280" status="nodump" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="tenup">
+ <description>Ten Up (compendium 17)</description>
+ <year>1988</year>
+ <publisher>JPM</publisher>
+ <part name="flop1" interface="floppy_3_5">
+ <dataarea name="flop" size="737280">
+ <rom name="10up17.dsk" size="737280" crc="7bc328df" sha1="5f8e40d8ffc370fb19be9e386befa5fcd1f35a75" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="tenup3">
+ <description>Ten Up (compendium 3)</description>
+ <year>1988</year>
+ <publisher>JPM</publisher>
+ <part name="flop1" interface="floppy_3_5">
+ <dataarea name="flop" size="737280">
+ <rom name="10up3.dsk" size="737280" crc="2767f017" sha1="1c6551b089c3e3df48e0c03bd502b91fd88f0e94" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+</softwarelist>
diff --git a/hash/i7000_card.xml b/hash/i7000_card.xml
new file mode 100644
index 00000000000..8ea5feb708c
--- /dev/null
+++ b/hash/i7000_card.xml
@@ -0,0 +1,147 @@
+<?xml version="1.0"?>
+<!DOCTYPE softwarelist SYSTEM "softwarelist.dtd">
+<!--
+Thanks to Alexandre Souza (Tabajara) for contributing the initial
+cartridges data available in this softlist.
+-->
+<softwarelist name="i7000_card" description="Itautec I-7000 cartridges">
+ <software name="set78">
+ <description>I-7101 SET 78 COML v1.3 R01</description>
+ <year>198?</year>
+ <publisher>Itautec</publisher>
+ <part name="card" interface="i7000_card">
+ <dataarea name="rom" size="0x2000">
+ <rom name="i-7101_set_78_coml_v1.3_r01_703d.rom" size="0x2000" crc="12da1687" sha1="b370c2b7718cf89d69e37fc7d1d3c4d80dc5f1cc" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="telex">
+ <description>I-7104 TELEX v1.0 R4 (Aug 31st, 1987)</description>
+ <year>1987</year>
+ <publisher>Itautec</publisher>
+ <part name="card" interface="i7000_card">
+ <dataarea name="rom" size="0x8000">
+ <rom name="i-7104_cart_telex_v1.0_r4_a5e5_31_08_87_1.rom" size="0x2000" crc="5ae6b20d" sha1="f3cbfa81bdc828872790290a53e62750d720b457" offset="0x0000" />
+ <rom name="i-7104_cart_telex_v1.0_r4_632c_31_08_87_2.rom" size="0x2000" crc="e95dd757" sha1="f90886b8c36063643509fcad4df1061de1dc7a90" offset="0x2000" />
+ <rom name="i-7104_cart_telex_v1.0_r4_a3b4_31_08_87_3.rom" size="0x2000" crc="ef884b22" sha1="bbc3688a64292dd15fe8103bf6cadfd4a991abb9" offset="0x4000" />
+ <rom name="i-7104_cart_telex_v1.0_r4_fdcc_31_08_87_4.rom" size="0x2000" crc="82202eb9" sha1="ee2018b5b58a656630c5057b3a65316f38099265" offset="0x6000" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="redator">
+ <description>I-7105 REDATOR v1.2 R02 (Sept 16th, 1983)</description>
+ <year>1983</year>
+ <publisher>Itautec</publisher>
+ <part name="card" interface="i7000_card">
+ <dataarea name="rom" size="0x8000">
+ <rom name="i-7105_redator_v1.2_r02_16_09_83_1.rom" size="0x2000" crc="2b5bf15f" sha1="1384cab00e1596619e1ae5ae072bd23af6fe6b2e" offset="0x0000" />
+ <rom name="i-7105_redator_v1.2_r02_16_09_83_2.rom" size="0x2000" crc="22c64fc2" sha1="ef4fbe93deeea65f1705e9b5fb2ad4d376650215" offset="0x2000" />
+ <rom name="i-7105_redator_v1.2_r02_16_09_83_3.rom" size="0x2000" crc="cfb8e70b" sha1="08683feafbe28e009458a0cfb1301bedd7e03aaa" offset="0x4000" />
+ <rom name="i-7105_redator_v1.2_r02_16_09_83_4.rom" size="0x2000" crc="f8510fee" sha1="275528441d4c4a410e6be45d0ecbe465aef2afe1" offset="0x6000" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="set3278">
+ <description>I-7106 SET 3278 v1.2 R00 (Mar 21st, 1985) IBM-3278 terminal emulation</description>
+ <year>1985</year>
+ <publisher>Itautec</publisher>
+ <part name="card" interface="i7000_card">
+ <dataarea name="rom" size="0x2000">
+ <rom name="i-7106_set_3278_v1.2_r00_21_03_85.rom" size="0x2000" crc="004275c8" sha1="ff42eb526f6142cff0d6ecfef8e41ef17bfac2c7" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="setvt52">
+ <description>I-7107 SET VT52 v1.0 R02 (Feb 25th, 1986)</description>
+ <year>1986</year>
+ <publisher>Itautec</publisher>
+ <part name="card" interface="i7000_card">
+ <dataarea name="rom" size="0x6000">
+ <rom name="i-7107_set_vt52_v1.0_r02_25_02_86_1.rom" size="0x2000" crc="ead3f48e" sha1="ec7951591cab8e8c2cb22f7e6352c709d24b9706" offset="0x0000" />
+ <!-- the 2nd EPROM connector is unpopulated -->
+ <rom name="i-7107_set_vt52_v1.0_r02_25_02_86_2.rom" size="0x2000" crc="da848ec0" sha1="7ed1898de94c7382c081ec3a78f60a6850daa25a" offset="0x4000" />
+ <!-- the 4th EPROM connector is unpopulated -->
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="i7113">
+ <description>I-7113 v1.2 R02 (Mar 4th, 1986)</description>
+ <year>1986</year>
+ <publisher>Itautec</publisher>
+ <part name="card" interface="i7000_card">
+ <dataarea name="rom" size="0x2000">
+ <rom name="i-7113_v1.2_r02_04_03_86.rom" size="0x2000" crc="865da8b7" sha1="da65dc6d65bbe0b8e84c0eeda15021e2575fd696" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="redelocl">
+ <description>I-7119 REDE LOCAL v1.0 R01 (Mar 21st, 1987)</description>
+ <year>1987</year>
+ <publisher>Itautec</publisher>
+ <part name="card" interface="i7000_card">
+ <dataarea name="rom" size="0x4000">
+ <rom name="i-7119_rede_local_v1.0_r01_21_03_87_1.rom" size="0x2000" crc="f0e95bc4" sha1="fa4482b005d8647dca411911b0f7048c940632c8" offset="0x0000" />
+ <rom name="i-7119_rede_local_v1.0_r01_21_03_87_2.rom" size="0x2000" crc="3b9461bf" sha1="958a71e61a91433645d402c31955fe4f64efcba0" offset="0x2000" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="telex2">
+ <description>I-7120 TELEX II v1.0 R04 (Aug 31st, 1987)</description>
+ <year>1987</year>
+ <publisher>Itautec</publisher>
+ <part name="card" interface="i7000_card">
+ <dataarea name="rom" size="0x8000">
+ <rom name="i-7120_telex_ii_v1.0_r04_31_08_87_1.rom" size="0x2000" crc="5ae6b20d" sha1="f3cbfa81bdc828872790290a53e62750d720b457" offset="0x0000" />
+ <rom name="i-7120_telex_ii_v1.0_r04_31_08_87_2.rom" size="0x2000" crc="e95dd757" sha1="f90886b8c36063643509fcad4df1061de1dc7a90" offset="0x2000" />
+ <rom name="i-7120_telex_ii_v1.0_r04_31_08_87_3.rom" size="0x2000" crc="ef884b22" sha1="bbc3688a64292dd15fe8103bf6cadfd4a991abb9" offset="0x4000" />
+ <rom name="i-7120_telex_ii_v1.0_r04_31_08_87_4.rom" size="0x2000" crc="82202eb9" sha1="ee2018b5b58a656630c5057b3a65316f38099265" offset="0x6000" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="redtrv12">
+ <description>I-71XX REDATOR v1.2 R04</description>
+ <year>198?</year>
+ <publisher>Itautec</publisher>
+ <part name="card" interface="i7000_card">
+ <dataarea name="rom" size="0x8000">
+ <rom name="i-71xx_redator_v1.2_r04_1.rom" size="0x2000" crc="98105005" sha1="3cbd9de8c7e37e16d1dd143a7e735f582cf303c8" offset="0x0000" />
+ <rom name="i-71xx_redator_v1.2_r04_2.rom" size="0x2000" crc="848d665c" sha1="2095c9007f090d4510265fd3da6ef0d037c7ee86" offset="0x2000" />
+ <rom name="i-71xx_redator_v1.2_r04_3.rom" size="0x2000" crc="1e61ff21" sha1="d8e28264e7020e912774fd9bda6bacd4b227a14d" offset="0x4000" />
+ <rom name="i-71xx_redator_v1.2_r04_4.rom" size="0x2000" crc="6c6b96a6" sha1="26bac8e902d40490fcd2e9021a5de3753c0fc26a" offset="0x6000" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="setdisc">
+ <description>I-71XX SETDISC</description>
+ <year>198?</year>
+ <publisher>Itautec</publisher>
+ <part name="card" interface="i7000_card">
+ <dataarea name="rom" size="0x4000">
+ <rom name="i-71xx_setdisc_1.rom" size="0x2000" crc="0ad7d534" sha1="aecf5f01b8ffb4120f3cd4752705f6538ef70f4e" offset="0x0000" />
+ <rom name="i-71xx_setdisc_2.rom" size="0x2000" crc="51e24c2b" sha1="172699394690ee46096d9395f6894ebaa26ea6ac" offset="0x2000" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="vdeotxto">
+ <description>I-71XX VIDEOTEXTO</description>
+ <year>198?</year>
+ <publisher>Itautec</publisher>
+ <part name="card" interface="i7000_card">
+ <dataarea name="rom" size="0x6000">
+ <rom name="i-71xx_videotexto_1.rom" size="0x2000" crc="28dda7db" sha1="ced755c40fcdf2dc2cd5263a494d51917e1010d1" offset="0x0000" />
+ <rom name="i-71xx_videotexto_2.rom" size="0x2000" crc="b4293435" sha1="5e2b96c19c4f5c63a5afa2de504d29fe64a4c908" offset="0x2000" />
+ <rom name="i-71xx_videotexto_3.rom" size="0x2000" crc="07486b26" sha1="e54e32a789e73b772516759ac26badf5805abd95" offset="0x4000" />
+ </dataarea>
+ </part>
+ </software>
+</softwarelist>
diff --git a/hash/m20.xml b/hash/m20.xml
index f57d5028cfc..52d634133f9 100644
--- a/hash/m20.xml
+++ b/hash/m20.xml
@@ -144,7 +144,7 @@
<software name="msdos20" supported="no">
<!-- "This is a standard 360k MS-DOS disk image, 512 bytes/sector, 9 sectors, 2 sides, 40 tracks." -->
- <!-- MESS complains about "Unable to identify the image format" -->
+ <!-- Use with BIOS 2.0 and the 8086 APB -->
<description>MS-DOS 2.0</description>
<year>19??</year>
<publisher>Microsoft</publisher>
@@ -298,7 +298,7 @@
</part>
</software>
- <software name="olinum" supported="no"> <!-- Invalid in M20 -->
+ <software name="olinum" supported="no"> <!-- Collection of BASIC programs, boot PCOS and run basic to use -->
<description>OliNum</description>
<year>19??</year>
<publisher>Olivetti</publisher>
@@ -310,7 +310,7 @@
</part>
</software>
- <software name="olisort" supported="no"> <!-- Invalid in M20 -->
+ <software name="olisort" supported="no"> <!-- Collection of BASIC programs, boot PCOS and run basic to use -->
<description>OliSort 2.0.6</description>
<year>19??</year>
<publisher>Olivetti</publisher>
@@ -322,7 +322,7 @@
</part>
</software>
- <software name="olistat" supported="no"> <!-- Invalid in M20 -->
+ <software name="olistat" supported="no"> <!-- Collection of BASIC programs, boot PCOS and run basic to use -->
<description>OliStat</description>
<year>19??</year>
<publisher>Olivetti</publisher>
@@ -455,7 +455,7 @@
<!-- This is a user disk with high school math programs -->
- <software name="m20utent" supported="no"> <!-- Invalid in M20 -->
+ <software name="m20utent" supported="no"> <!-- Collection of BASIC programs, boot PCOS and run basic to use -->
<description>M20 Utente</description>
<year>19??</year>
<publisher>&lt;unknown&gt;</publisher>
diff --git a/hash/msx1_cart.xml b/hash/msx1_cart.xml
index 28b6f0b63d6..fd1bd25201e 100644
--- a/hash/msx1_cart.xml
+++ b/hash/msx1_cart.xml
@@ -1379,8 +1379,11 @@ kept for now until finding out what those bytes affect...
<info name="serial" value="R48X5513" />
<info name="alt_title" value="アルカザール" />
<part name="cart" interface="msx_cart">
- <dataarea name="rom" size="16384">
+ <dataarea name="rom" size="65536">
<rom name="alcazar - the forgotten fortress (japan).rom" size="16384" crc="3ee454b0" sha1="807676038cbba043b8099eba9c5840a4811a7e59" offset="0" />
+ <rom size="16384" offset="0x4000" loadflag="reload" />
+ <rom size="16384" offset="0x8000" loadflag="reload" />
+ <rom size="16384" offset="0xc000" loadflag="reload" />
</dataarea>
</part>
</software>
@@ -2211,21 +2214,11 @@ kept for now until finding out what those bytes affect...
<info name="serial" value="R48X5502" />
<info name="alt_title" value="ビームライダー" />
<part name="cart" interface="msx_cart">
- <dataarea name="rom" size="32768">
- <rom name="beam rider (japan).rom" size="32768" crc="1553e408" sha1="1231984ae24bf35f9f38596b864420d8ccd3f30b" offset="0" />
- </dataarea>
- </part>
- </software>
-
- <software name="beamridra" cloneof="beamridr">
- <description>Beam Rider (Jpn, Alt)</description>
- <year>1984</year>
- <publisher>Pony Canyon</publisher>
- <info name="serial" value="R48X5502" />
- <info name="alt_title" value="ビームライダー" />
- <part name="cart" interface="msx_cart">
- <dataarea name="rom" size="16384">
+ <dataarea name="rom" size="65536">
<rom name="beam rider (japan) (alt 1).rom" size="16384" crc="d6a6bee6" sha1="f51f936887498d21f6ee9fe8a7701633be67e79d" offset="0" />
+ <rom size="16384" offset="0x4000" loadflag="reload" />
+ <rom size="16384" offset="0x8000" loadflag="reload" />
+ <rom size="16384" offset="0xc000" loadflag="reload" />
</dataarea>
</part>
</software>
@@ -4155,20 +4148,11 @@ kept for now until finding out what those bytes affect...
<publisher>Pony Canyon</publisher>
<info name="serial" value="R48X5506" />
<part name="cart" interface="msx_cart">
- <dataarea name="rom" size="32768">
- <rom name="decathlon (japan).rom" size="32768" crc="cd016b93" sha1="a1656f612360a126e09ef2baaa8002d92054125d" offset="0" />
- </dataarea>
- </part>
- </software>
-
- <software name="decathlna" cloneof="decathln">
- <description>Decathlon (Jpn, Alt)</description>
- <year>1984</year>
- <publisher>Pony Canyon</publisher>
- <info name="serial" value="R48X5506" />
- <part name="cart" interface="msx_cart">
- <dataarea name="rom" size="16384">
- <rom name="decathlon (japan) (alt 1).rom" size="16384" crc="f99b1c22" sha1="5d43cb6ca89f31d5f543e4dcd3fa9987b9769602" offset="0" />
+ <dataarea name="rom" size="65536">
+ <rom name="decathlon (japan).rom" size="16384" crc="f99b1c22" sha1="5d43cb6ca89f31d5f543e4dcd3fa9987b9769602" offset="0" />
+ <rom size="16384" offset="0x4000" loadflag="reload" />
+ <rom size="16384" offset="0x8000" loadflag="reload" />
+ <rom size="16384" offset="0xc000" loadflag="reload" />
</dataarea>
</part>
</software>
@@ -5983,8 +5967,11 @@ kept for now until finding out what those bytes affect...
<info name="serial" value="R48X5505" />
<info name="alt_title" value="ヒーロー" />
<part name="cart" interface="msx_cart">
- <dataarea name="rom" size="32768">
- <rom name="h.e.r.o. (japan).rom" size="32768" crc="8fdad3af" sha1="ebb70722f75279911cce79e6bd78b8f514561b0f" offset="0" />
+ <dataarea name="rom" size="65536">
+ <rom name="h.e.r.o. (japan).rom" size="16384" crc="97ab0d70" sha1="6fbb385147a939a7e6b47f5945d8e3b671a8c065" offset="0" />
+ <rom size="16384" offset="0x4000" loadflag="reload" />
+ <rom size="16384" offset="0x8000" loadflag="reload" />
+ <rom size="16384" offset="0xc000" loadflag="reload" />
</dataarea>
</part>
</software>
@@ -7016,21 +7003,11 @@ kept for now until finding out what those bytes affect...
<info name="serial" value="R48X5503" />
<info name="alt_title" value="キーストンケーパーズ" />
<part name="cart" interface="msx_cart">
- <dataarea name="rom" size="32768">
- <rom name="keystone kapers (japan).rom" size="32768" crc="7ff117f9" sha1="fb4724b8159beae132f89f394f71ce3934a61ae2" offset="0" />
- </dataarea>
- </part>
- </software>
-
- <software name="keykapera" cloneof="keykaper">
- <description>Keystone Kapers (Jpn, Alt)</description>
- <year>1984</year>
- <publisher>Pony Canyon</publisher>
- <info name="serial" value="R48X5503" />
- <info name="alt_title" value="キーストンケーパーズ" />
- <part name="cart" interface="msx_cart">
- <dataarea name="rom" size="16384">
- <rom name="keystone kapers (japan) (alt 1).rom" size="16384" crc="b1cf2097" sha1="3d5160331beb1c5cc54ba6ecef6b3ce2ff4660b6" offset="0" />
+ <dataarea name="rom" size="65536">
+ <rom name="keystone kapers (japan).rom" size="16384" crc="b1cf2097" sha1="3d5160331beb1c5cc54ba6ecef6b3ce2ff4660b6" offset="0" />
+ <rom size="16384" offset="0x4000" loadflag="reload" />
+ <rom size="16384" offset="0x8000" loadflag="reload" />
+ <rom size="16384" offset="0xc000" loadflag="reload" />
</dataarea>
</part>
</software>
@@ -9659,8 +9636,11 @@ kept for now until finding out what those bytes affect...
<publisher>Pony Canyon</publisher>
<info name="alt_title" value="パストファインダー" />
<part name="cart" interface="msx_cart">
- <dataarea name="rom" size="16384">
+ <dataarea name="rom" size="65536">
<rom name="pastfinder (japan).rom" size="16384" crc="d6d8d1d7" sha1="8117ec66c0645a54422841a632cfd6602f35c4f9" offset="0" />
+ <rom size="16384" offset="0x4000" loadflag="reload" />
+ <rom size="16384" offset="0x8000" loadflag="reload" />
+ <rom size="16384" offset="0xc000" loadflag="reload" />
</dataarea>
</part>
</software>
@@ -9981,8 +9961,11 @@ kept for now until finding out what those bytes affect...
<info name="serial" value="R48X5508" />
<info name="alt_title" value="ピットフォールII" />
<part name="cart" interface="msx_cart">
- <dataarea name="rom" size="16384">
+ <dataarea name="rom" size="65536">
<rom name="pitfall ii - lost caverns (japan).rom" size="16384" crc="d307a7b8" sha1="78079266711e60420480e4d95a39f0d7d974ad32" offset="0" />
+ <rom size="16384" offset="0x4000" loadflag="reload" />
+ <rom size="16384" offset="0x8000" loadflag="reload" />
+ <rom size="16384" offset="0xc000" loadflag="reload" />
</dataarea>
</part>
</software>
@@ -9994,8 +9977,11 @@ kept for now until finding out what those bytes affect...
<info name="serial" value="R48X5508" />
<info name="alt_title" value="ピットフォールII" />
<part name="cart" interface="msx_cart">
- <dataarea name="rom" size="16384">
+ <dataarea name="rom" size="65536">
<rom name="pitfall ii - lost caverns (japan) (alt 1).rom" size="16384" crc="71c59868" sha1="ae8c7355c829248305384243f78a870453367e77" offset="0" />
+ <rom size="16384" offset="0x4000" loadflag="reload" />
+ <rom size="16384" offset="0x8000" loadflag="reload" />
+ <rom size="16384" offset="0xc000" loadflag="reload" />
</dataarea>
</part>
</software>
@@ -10007,8 +9993,11 @@ kept for now until finding out what those bytes affect...
<info name="serial" value="R48X5501" />
<info name="alt_title" value="ピットフォール" />
<part name="cart" interface="msx_cart">
- <dataarea name="rom" size="16384">
+ <dataarea name="rom" size="65536">
<rom name="pitfall! (japan).rom" size="16384" crc="5a009c55" sha1="b88e9c548873dcfd190e0e38f7b279344eea41ec" offset="0" />
+ <rom size="16384" offset="0x4000" loadflag="reload" />
+ <rom size="16384" offset="0x8000" loadflag="reload" />
+ <rom size="16384" offset="0xc000" loadflag="reload" />
</dataarea>
</part>
</software>
@@ -10020,8 +10009,11 @@ kept for now until finding out what those bytes affect...
<info name="serial" value="R48X5501" />
<info name="alt_title" value="ピットフォール" />
<part name="cart" interface="msx_cart">
- <dataarea name="rom" size="16384">
+ <dataarea name="rom" size="65536">
<rom name="pitfall! (japan) (alt 1).rom" size="16384" crc="930aeb2c" sha1="5fb4b6c3735e4d9415565a856bb69f9fb4857161" offset="0" />
+ <rom size="16384" offset="0x4000" loadflag="reload" />
+ <rom size="16384" offset="0x8000" loadflag="reload" />
+ <rom size="16384" offset="0xc000" loadflag="reload" />
</dataarea>
</part>
</software>
@@ -10033,8 +10025,11 @@ kept for now until finding out what those bytes affect...
<info name="serial" value="R48X5501" />
<info name="alt_title" value="ピットフォール" />
<part name="cart" interface="msx_cart">
- <dataarea name="rom" size="16384">
+ <dataarea name="rom" size="65536">
<rom name="pitfall! (japan) (alt 2).rom" size="16384" crc="2cb24473" sha1="2fa9c0f016efc2d1752a272c632393f5063ea06c" offset="0" />
+ <rom size="16384" offset="0x4000" loadflag="reload" />
+ <rom size="16384" offset="0x8000" loadflag="reload" />
+ <rom size="16384" offset="0xc000" loadflag="reload" />
</dataarea>
</part>
</software>
@@ -10508,21 +10503,11 @@ kept for now until finding out what those bytes affect...
<info name="serial" value="R48X5504" />
<info name="alt_title" value="リãƒãƒ¼ãƒ¬ã‚¤ãƒ‰" />
<part name="cart" interface="msx_cart">
- <dataarea name="rom" size="32768">
- <rom name="river raid (japan).rom" size="32768" crc="0f22a553" sha1="a1e14912d45944b9a6baef1d4d3a04c1ae8df923" offset="0" />
- </dataarea>
- </part>
- </software>
-
- <software name="riveraida" cloneof="riveraid">
- <description>River Raid (Jpn, Alt)</description>
- <year>1985</year>
- <publisher>Pony Canyon</publisher>
- <info name="serial" value="R48X5504" />
- <info name="alt_title" value="リãƒãƒ¼ãƒ¬ã‚¤ãƒ‰" />
- <part name="cart" interface="msx_cart">
- <dataarea name="rom" size="16384">
- <rom name="river raid (japan) (alt 1).rom" size="16384" crc="2fc1d75b" sha1="33be9017faf173eae04d0c91ca8d42d1c20596c0" offset="0" />
+ <dataarea name="rom" size="65536">
+ <rom name="river raid (japan).rom" size="16384" crc="2fc1d75b" sha1="33be9017faf173eae04d0c91ca8d42d1c20596c0" offset="0" />
+ <rom size="16384" offset="0x4000" loadflag="reload" />
+ <rom size="16384" offset="0x8000" loadflag="reload" />
+ <rom size="16384" offset="0xc000" loadflag="reload" />
</dataarea>
</part>
</software>
@@ -10608,8 +10593,11 @@ kept for now until finding out what those bytes affect...
<info name="serial" value="R48X5511" />
<info name="alt_title" value="ロックンボルト" />
<part name="cart" interface="msx_cart">
- <dataarea name="rom" size="16384">
+ <dataarea name="rom" size="65536">
<rom name="rock'n bolt (japan).rom" size="16384" crc="430e5789" sha1="1edabc3226648b54ae98d524b31f37ca47c8c88b" offset="0" />
+ <rom size="16384" offset="0x4000" loadflag="reload" />
+ <rom size="16384" offset="0x8000" loadflag="reload" />
+ <rom size="16384" offset="0xc000" loadflag="reload" />
</dataarea>
</part>
</software>
@@ -13171,20 +13159,11 @@ kept for now until finding out what those bytes affect...
<publisher>Pony Canyon</publisher>
<info name="alt_title" value="ゼンジー" />
<part name="cart" interface="msx_cart">
- <dataarea name="rom" size="32768">
- <rom name="zenji (japan).rom" size="32768" crc="1a4aebb2" sha1="2f4404d141acc40e48af0b12c70cd44b066ece10" offset="0" />
- </dataarea>
- </part>
- </software>
-
- <software name="zenjia" cloneof="zenji">
- <description>Zenji (Jpn, Alt)</description>
- <year>1984</year>
- <publisher>Pony Canyon</publisher>
- <info name="alt_title" value="ゼンジー" />
- <part name="cart" interface="msx_cart">
- <dataarea name="rom" size="16384">
- <rom name="zenji (japan) (alt 1).rom" size="16384" crc="77b3b0b9" sha1="c9440172802818cc5b9ae559fbd3f346a263605c" offset="0" />
+ <dataarea name="rom" size="65536">
+ <rom name="zenji (japan).rom" size="16384" crc="77b3b0b9" sha1="c9440172802818cc5b9ae559fbd3f346a263605c" offset="0" />
+ <rom size="16384" offset="0x4000" loadflag="reload" />
+ <rom size="16384" offset="0x8000" loadflag="reload" />
+ <rom size="16384" offset="0xc000" loadflag="reload" />
</dataarea>
</part>
</software>
@@ -13289,8 +13268,11 @@ kept for now until finding out what those bytes affect...
<year>1984</year>
<publisher>Activision?</publisher>
<part name="cart" interface="msx_cart">
- <dataarea name="rom" size="16384">
+ <dataarea name="rom" size="65536">
<rom name="designer's pencil, the (europe) (program).rom" size="16384" crc="ce588c20" sha1="4b4a58a310a1138b95192d7fe0881bbdc45601d4" offset="0" />
+ <rom size="16384" offset="0x4000" loadflag="reload" />
+ <rom size="16384" offset="0x8000" loadflag="reload" />
+ <rom size="16384" offset="0xc000" loadflag="reload" />
</dataarea>
</part>
</software>
diff --git a/hash/msx2_flop.xml b/hash/msx2_flop.xml
index 10a2cb31e3d..00c7bc7c54e 100644
--- a/hash/msx2_flop.xml
+++ b/hash/msx2_flop.xml
@@ -11175,6 +11175,21 @@ The following floppies came with the machines.
<description>The Tower? of Cabin - Cabin Panic (Jpn)</description>
<year>1992</year>
<publisher>Micro Cabin</publisher>
+ <part name="flop1" interface="floppy_3_5">
+ <dataarea name="flop" size="737280">
+ <rom name="tower of cabin, the (1992)(micro cabin)(jp)(disk 1 of 3).dsk" size="737280" crc="0471dbee" sha1="0e8d2b0177bd601e84c71735b4b498be2818085f" offset="0" />
+ </dataarea>
+ </part>
+ <part name="flop2" interface="floppy_3_5">
+ <dataarea name="flop" size="737280">
+ <rom name="tower of cabin, the (1992)(micro cabin)(jp)(disk 2 of 3).dsk" size="737280" crc="0d3afd17" sha1="d8cb95e558065b19f21f434a97a4a59b1892fc1a" offset="0" />
+ </dataarea>
+ </part>
+ <part name="flop3" interface="floppy_3_5">
+ <dataarea name="flop" size="737280">
+ <rom name="tower of cabin, the (1992)(micro cabin)(jp)(disk 3 of 3).dsk" size="737280" crc="9ad7d280" sha1="ed0e55d97817e9d98d563fdeb634cc6443564840" offset="0" />
+ </dataarea>
+ </part>
</software>
<software name="towercaba" cloneof="towercab">
diff --git a/hash/mz2000_flop.xml b/hash/mz2000_flop.xml
index 694cd60c0dd..9740d9cc175 100644
--- a/hash/mz2000_flop.xml
+++ b/hash/mz2000_flop.xml
@@ -18,14 +18,14 @@
<year>2002</year>
<publisher>Toshio Fukui</publisher>
- <part name="flop1" interface="floppy_3_5">
+ <part name="flop1" interface="floppy_5_25">
<feature name="part_id" value="System Disk" />
<dataarea name="flop" size="348848">
<rom name="cpmbin.d88" size="348848" crc="040f32e8" sha1="c6d09ed529c23fcbdc9b0468b0481a521a5240e5" offset="0" />
</dataarea>
</part>
- <part name="flop2" interface="floppy_3_5">
+ <part name="flop2" interface="floppy_5_25">
<feature name="part_id" value="Source Disk (w/ TF-DOS)" />
<dataarea name="flop" size="348848">
<rom name="cpmsrc.d88" size="348848" crc="ce3fbee1" sha1="fd6f8d1f8ffea8e33f24d5241ee3deb3f471c313" offset="0" />
@@ -48,14 +48,14 @@
<year>2011?</year>
<publisher>Toshio Fukui</publisher>
- <part name="flop1" interface="floppy_3_5">
+ <part name="flop1" interface="floppy_5_25">
<feature name="part_id" value="System Disk" />
<dataarea name="flop" size="348848">
<rom name="mz64cpmb.d88" size="348848" crc="0e65fc85" sha1="10194f69a9e399d4822026026c1a6d0c8de1ab9a" offset="0" />
</dataarea>
</part>
- <part name="flop2" interface="floppy_3_5">
+ <part name="flop2" interface="floppy_5_25">
<feature name="part_id" value="Source Disk (w/ TF-DOS)" />
<dataarea name="flop" size="348848">
<rom name="mz64cpms.d88" size="348848" crc="5d76a801" sha1="a05cd4b99030685d7878e44f9bd1a82d8161de1a" offset="0" />
@@ -67,7 +67,7 @@
<description>TF-DOS Ver2.1C (TF)</description>
<year>200?</year>
<publisher>Toshio Fukui</publisher>
- <part name="flop1" interface="floppy_3_5">
+ <part name="flop1" interface="floppy_5_25">
<feature name="part_id" value="Master Disk" />
<dataarea name="flop" size="348848">
<rom name="tfds21cmr.d88" size="348848" crc="dca59c9f" sha1="313465c15b9046104c70202a46e3e7454c8d095e" offset="0" />
@@ -79,14 +79,14 @@
<description>TF-DOS Ver2.1 (TF)</description>
<year>200?</year>
<publisher>Toshio Fukui</publisher>
- <part name="flop1" interface="floppy_3_5">
+ <part name="flop1" interface="floppy_5_25">
<feature name="part_id" value="Master Disk" />
<dataarea name="flop" size="348848">
<rom name="tfds21mr.d88" size="348848" crc="ffa75514" sha1="11b13d487dfb6fa3e77e329b32e7f23bcb67609c" offset="0" />
</dataarea>
</part>
- <part name="flop2" interface="floppy_3_5">
+ <part name="flop2" interface="floppy_5_25">
<dataarea name="flop" size="348848">
<rom name="tfds21sr.d88" size="348848" crc="4b324606" sha1="35026012f38a2402a948c9c73630b9a46a7f1a6d" offset="0" />
</dataarea>
@@ -97,13 +97,13 @@
<description>TF-DOS Ver2.0B (TS)</description>
<year>200?</year>
<publisher>Toshio Fukui</publisher>
- <part name="flop1" interface="floppy_3_5">
+ <part name="flop1" interface="floppy_5_25">
<dataarea name="flop" size="348848">
<rom name="tfd2ts2e.d88" size="348848" crc="a8bb3380" sha1="f0d2e58f97f4bd8abf8c3b066d2ed4ce751985e3" offset="0" />
</dataarea>
</part>
- <part name="flop2" interface="floppy_3_5">
+ <part name="flop2" interface="floppy_5_25">
<dataarea name="flop" size="348848">
<rom name="tfd2ts2r.d88" size="348848" crc="5bbbe5dc" sha1="e0162ed833bc8dcd691bcf6d2b18e9d7a7a11714" offset="0" />
</dataarea>
@@ -114,7 +114,7 @@
<description>Graphic Editor III "Art Magic"</description>
<year>200?</year>
<publisher>Toshio Fukui</publisher>
- <part name="flop1" interface="floppy_3_5">
+ <part name="flop1" interface="floppy_5_25">
<dataarea name="flop" size="348848">
<rom name="gred3_tf.d88" size="348848" crc="82e0843e" sha1="5f6b13dbeaf781b09a157778799da2811cac1624" offset="0" />
</dataarea>
@@ -125,7 +125,7 @@
<description>Brave</description>
<year>200?</year>
<publisher>Toshio Fukui</publisher>
- <part name="flop1" interface="floppy_3_5">
+ <part name="flop1" interface="floppy_5_25">
<dataarea name="flop" size="348848">
<rom name="brave.d88" size="348848" crc="8a9bc713" sha1="1747b68b188b0c25b78a2ebb9b9184e82fc2531f" offset="0" />
</dataarea>
@@ -136,7 +136,7 @@
<description>Lilas</description>
<year>200?</year>
<publisher>Toshio Fukui</publisher>
- <part name="flop1" interface="floppy_3_5">
+ <part name="flop1" interface="floppy_5_25">
<dataarea name="flop" size="348848">
<rom name="lilascmp.d88" size="348848" crc="ac570829" sha1="15e927727d3498660c1dc3f3ea55409aad4eeef8" offset="0" />
</dataarea>
@@ -147,7 +147,7 @@
<description>TF-DOS Programs 1</description>
<year>200?</year>
<publisher>Toshio Fukui</publisher>
- <part name="flop1" interface="floppy_3_5">
+ <part name="flop1" interface="floppy_5_25">
<dataarea name="flop" size="348848">
<rom name="cdosprg1.d88" size="348848" crc="7176ce03" sha1="2ee08c47c4071e03d942ed166253382d0d380780" offset="0" />
</dataarea>
@@ -158,7 +158,7 @@
<description>TF-DOS Programs 2</description>
<year>200?</year>
<publisher>Toshio Fukui</publisher>
- <part name="flop1" interface="floppy_3_5">
+ <part name="flop1" interface="floppy_5_25">
<dataarea name="flop" size="348848">
<rom name="cdosprg2.d88" size="348848" crc="4f0a38c6" sha1="fafaee86a65883b7270ff247802220777468c9fc" offset="0" />
</dataarea>
@@ -170,7 +170,7 @@
<description>Sharp BASIC Programs 1</description>
<year>200?</year>
<publisher>&lt;unknown&gt;</publisher>
- <part name="flop1" interface="floppy_3_5">
+ <part name="flop1" interface="floppy_5_25">
<dataarea name="flop" size="348848">
<rom name="sbasprg1.d88" size="348848" crc="c92c42ca" sha1="c87a02c9ba94b70f26727b018b82ecb9bfe4c41a" offset="0" />
</dataarea>
diff --git a/hash/n64.xml b/hash/n64.xml
index 2b591f8e46a..3a88303a2d5 100644
--- a/hash/n64.xml
+++ b/hash/n64.xml
@@ -12,10 +12,10 @@ There appear to exist some undumped N64 protos
- Wild Waters (a more complete version than the available proto was shown)
Canceled games (possibly never got to the proto stage)
- - Acclaim Sports Soccer / Ultra Soccer,
- - Addams Family Pinball,
- - Freak Boy,
- - Ikazuchi No Go Toku,
+ - Acclaim Sports Soccer / Ultra Soccer
+ - Addams Family Pinball
+ - Freak Boy
+ - Ikazuchi No Go Toku
- X-Men Mutant Academy
-->
@@ -54,6 +54,7 @@ Info on N64 chip labels (from The Cart Scan Repository)
<!-- List of confirmed carts (info from pictures) -->
<softwarelist name="n64" description="Nintendo 64 cartridges">
+
<software name="007goldnu" cloneof="007goldn">
<description>007 - GoldenEye (USA)</description>
<year>1997</year>
@@ -5877,12 +5878,12 @@ patched out (+ a fix for internal checksum)
<!-- Original release, in .z64 format -->
<!-- rom name="mm_debug.rom" size="67108864" crc="687d8395" sha1="b38b71d2961dffb523020a67f4807a4b704e347a" offset="000000" /-->
<!-- .v64 version -->
- <rom name="mm_debug.bin" size="67108864" crc="ea2e7abb" sha1="c790b3de31196645034c76e326640ccf3b8c91dd" offset="000000" />
+ <rom name="legend of zelda, the - majora's mask (europe) (en,fr,de,es) (debug edition).bin" size="67108864" crc="ea2e7abb" sha1="c790b3de31196645034c76e326640ccf3b8c91dd" offset="000000" />
</dataarea>
</part>
</software>
- <software name="zeldamaju1" cloneof="zeldamaj">
+ <software name="zeldamaju2" cloneof="zeldamaj">
<description>The Legend of Zelda - Majora's Mask (USA, Demo)</description>
<year>2000</year>
<publisher>Nintendo</publisher>
@@ -6480,7 +6481,7 @@ patched out (+ a fix for internal checksum)
</part>
</software>
- <software name="miahamm">
+ <software name="miahamm" cloneof="mikeowen">
<description>Mia Hamm Soccer 64 (USA)</description>
<year>2000</year>
<publisher>South Peak</publisher>
@@ -9969,7 +9970,7 @@ patched out (+ a fix for internal checksum)
</part>
</software>
- <software name="tazexpru">
+ <software name="tazexpru" cloneof="tazexpr">
<description>Taz Express (USA, Prototype)</description>
<year>2000?</year>
<publisher>Infogrames</publisher>
@@ -9991,7 +9992,7 @@ patched out (+ a fix for internal checksum)
</part>
</software>
- <software name="tetris64" cloneof="ntetris">
+ <software name="tetris64">
<description>Tetris 64 (Jpn)</description>
<year>1998</year>
<publisher>Seta Corporation</publisher>
@@ -11662,8 +11663,9 @@ patched out (+ a fix for internal checksum)
</part>
</software>
- <!-- to be verified -->
- <software name="zeldaootmq" cloneof="zeldaoot">
+<!-- to be verified -->
+
+ <software name="zeldaootmqd" cloneof="zeldaoot">
<description>The Legend of Zelda - Ocarina of Time - Master Quest (USA, Debug Edition, Ripped from GC)</description>
<year>2003</year>
<publisher>Nintendo</publisher>
@@ -11674,39 +11676,104 @@ patched out (+ a fix for internal checksum)
</part>
</software>
- <software name="zeldaootmq1" cloneof="zeldaoot">
- <description>The Legend of Zelda - Ocarina of Time - Master Quest (Euro, Debug Edition?, Ripped from GC)</description>
+ <software name="zeldaootmqu" cloneof="zeldaoot">
+ <description>The Legend of Zelda - Ocarina of Time - Master Quest (USA, Ripped from GC)</description>
<year>2003</year>
<publisher>Nintendo</publisher>
<part name="cart" interface="n64_cart">
<dataarea name="rom" size="33554432">
- <rom name="legend of zelda, the - ocarina of time - master quest (2003)(nintendo)[gamecube version].bin" size="33554432" crc="177fa73a" sha1="8ebf2e29313f44f2d49e5b4191971d09919e8e48" offset="000000" />
+ <rom name="legend of zelda, the - ocarina of time - master quest (usa)(2003)(nintendo)(ntsc)[gamecube version].bin" size="33554432" crc="7b89b13f" sha1="e1d070ad7b017de9f992b362164dcd9d7f820f7e" offset="000000" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="zeldaootmq" cloneof="zeldaoot">
+ <description>The Legend of Zelda - Ocarina of Time - Master Quest (Euro, Ripped from GC)</description>
+ <year>2003</year>
+ <publisher>Nintendo</publisher>
+ <part name="cart" interface="n64_cart">
+ <dataarea name="rom" size="33554432">
+ <rom name="legend of zelda, the - ocarina of time - master quest (europe)(2003)(nintendo)(pal)[gamecube version].bin" size="33554432" crc="177fa73a" sha1="8ebf2e29313f44f2d49e5b4191971d09919e8e48" offset="000000" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="zeldaootmqj" cloneof="zeldaoot">
+ <description>Zelda no Densetsu - Toki no Ocarina Ura (Jpn, Ripped from GC)</description>
+ <year>2003</year>
+ <publisher>Nintendo</publisher>
+ <part name="cart" interface="n64_cart">
+ <dataarea name="rom" size="33554432">
+ <rom name="zelda no densetsu - toki no ocarina ura (japan)(2003)(nintendo)(ntsc)[gamecube version].bin" size="33554432" crc="d97c20ba" sha1="06c3c098f0e14ed61811dfaf0e8e4519d7d7a826" offset="000000" />
</dataarea>
</part>
</software>
<software name="zeldaootu3" cloneof="zeldaoot">
+ <description>The Legend of Zelda - Ocarina of Time (USA, Ripped from GC)</description>
+ <year>2003</year>
+ <publisher>Nintendo</publisher>
+ <part name="cart" interface="n64_cart">
+ <dataarea name="rom" size="33554432">
+ <rom name="legend of zelda, the - ocarina of time (usa)(2003)(nintendo)(ntsc)[gamecube version].bin" size="33554432" crc="84bbc39f" sha1="44c75962911e13bdfdc31b35e0b8e3be6a6a49ab" offset="000000" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="zeldaoot2" cloneof="zeldaoot">
<description>The Legend of Zelda - Ocarina of Time (Euro, Ripped from GC)</description>
<year>2003</year>
<publisher>Nintendo</publisher>
<part name="cart" interface="n64_cart">
<dataarea name="rom" size="33554432">
- <rom name="legend of zelda, the - ocarina of time (2003)(nintendo)(pal)[gamecube version].v64" size="33554432" crc="6e658036" sha1="580dd0bd1b6d2c51cc20a764eece84dba558964c" offset="000000" />
+ <rom name="legend of zelda, the - ocarina of time (europe)(2003)(nintendo)(pal)[gamecube version].bin" size="33554432" crc="6e658036" sha1="580dd0bd1b6d2c51cc20a764eece84dba558964c" offset="000000" />
</dataarea>
</part>
</software>
- <software name="zeldamaju2" cloneof="zeldamaj">
+ <software name="zeldaootj3" cloneof="zeldaoot">
+ <description>Zelda no Densetsu - Toki no Ocarina (Jpn, Ripped from GC)</description>
+ <year>2003</year>
+ <publisher>Nintendo</publisher>
+ <part name="cart" interface="n64_cart">
+ <dataarea name="rom" size="33554432">
+ <rom name="zelda no densetsu - toki no ocarina (japan)(2003)(nintendo)(ntsc)[gamecube version].bin" size="33554432" crc="0ac22de8" sha1="245410280d152f28d5b1c0c0fc37f384db0020cd" offset="000000" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="zeldamaju1" cloneof="zeldamaj">
<description>The Legend of Zelda - Majora's Mask (USA, Ripped from GC)</description>
- <year>2003?</year>
+ <year>2003</year>
+ <publisher>Nintendo</publisher>
+ <part name="cart" interface="n64_cart">
+ <dataarea name="rom" size="33554432">
+ <rom name="legend of zelda, the - majora's mask (2003)(nintendo)(us)[gamecube version].bin" size="33554432" crc="52245acb" sha1="8c378b87c83b3f4de20b14accf91e7590399f5dc" offset="000000" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="zeldamaj2" cloneof="zeldamaj">
+ <description>The Legend of Zelda - Majora's Mask (Euro, Ripped from GC)</description>
+ <year>2003</year>
<publisher>Nintendo</publisher>
<part name="cart" interface="n64_cart">
<dataarea name="rom" size="33554432">
- <rom name="legend of zelda, the - majora's mask (2003)(nintendo)(us)[gamecube version].v64" size="33554432" crc="52245acb" sha1="8c378b87c83b3f4de20b14accf91e7590399f5dc" offset="000000" />
+ <rom name="legend of zelda, the - majora's mask (2003)(nintendo)(europe)[gamecube version].bin" size="33554432" crc="19139e89" sha1="f4b0bedafc45c78c4428882036d46d691b650d8b" offset="000000" />
</dataarea>
</part>
</software>
+ <software name="zeldamajj2" cloneof="zeldamaj">
+ <description>Zelda no Densetsu - Mujura no Kamen (Jpn, Ripped from GC)</description>
+ <year>2003</year>
+ <publisher>Nintendo</publisher>
+ <part name="cart" interface="n64_cart">
+ <dataarea name="rom" size="33554432">
+ <rom name="zelda no densetsu - mujura no kamen (2003)(nintendo)(japan)[gamecube version].bin" size="33554432" crc="766ebdeb" sha1="7beadea493f24f77b5be85bf2c1dbd813481549b" offset="000000" />
+ </dataarea>
+ </part>
+ </software>
<!-- Non game cartridges -->
@@ -11754,7 +11821,7 @@ patched out (+ a fix for internal checksum)
</part>
</software>
- <software name="gsharka" cloneof="gshark" supported="no">
+ <software name="gsharka" cloneof="arp64" supported="no">
<description>GameShark Pro (USA, v2.0)</description>
<year>19??</year>
<publisher>&lt;unknown&gt;</publisher>
@@ -11765,7 +11832,7 @@ patched out (+ a fix for internal checksum)
</part>
</software>
- <software name="gshark" supported="no">
+ <software name="gshark" cloneof="arp64" supported="no">
<description>GameShark Pro (USA, v3.3)</description>
<year>19??</year>
<publisher>&lt;unknown&gt;</publisher>
@@ -11834,5 +11901,4 @@ patched out (+ a fix for internal checksum)
</part>
</software>
-
</softwarelist>
diff --git a/hash/pet_cass.xml b/hash/pet_cass.xml
index 0d9268ebab5..09179d09a33 100644
--- a/hash/pet_cass.xml
+++ b/hash/pet_cass.xml
@@ -8,7 +8,7 @@
<year>1982</year>
<publisher>Microcomputer Games</publisher>
- <!-- pet2001n16 Side A: Acquire -->
+ <!-- pet2001n16 Side A: ACQUIRE -->
<part name="cass" interface="cbm_cass">
<dataarea name="cass" size="24368704">
<rom name="acquire (1982)(avalon hill).wav" size="24368704" crc="65ceaa57" sha1="e8b1d072356526c31a509a267507e9aaa74f17fa" offset="0" />
@@ -20,7 +20,7 @@
<description>Andromeda Conquest</description>
<year>1982</year>
- <!-- pet2001n16 Side A: Andromeda -->
+ <!-- pet2001n16 Side A: ANDROMEDA -->
<publisher>Microcomputer Games</publisher>
<part name="cass" interface="cbm_cass">
<dataarea name="cass" size="22685838">
@@ -29,11 +29,24 @@
</part>
</software>
+ <software name="apshai">
+ <description>Temple of Apshai</description>
+ <year>1979</year>
+ <publisher>Automated Simulations</publisher>
+
+ <!-- pet2001n32 Side A: APSHAI, LEVEL 1.SEQ, LEVEL 2.SEQ, LEVEL 3.SEQ, LEVEL 4.SEQ -->
+ <part name="cass1" interface="cbm_cass">
+ <dataarea name="cass" size="76924190">
+ <rom name="temple of apshai (1979)(automated simulations).wav" size="76924190" crc="faecb03c" sha1="be38fb082fa74c33f280bda401b215001670d54f" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
<software name="b1bomb">
<description>B-1 Bomber Game</description>
<year>1982</year>
- <!-- pet2001n16 Side A: B-1 Bomber -->
+ <!-- pet2001n16 Side A: B-1 BOMBER -->
<publisher>Microcomputer Games</publisher>
<part name="cass" interface="cbm_cass">
<dataarea name="cass" size="15154010">
@@ -42,11 +55,24 @@
</part>
</software>
+ <software name="batter">
+ <description>Batter Up</description>
+ <year>1980</year>
+
+ <!-- pet2001n Side A: BATTER UP -->
+ <publisher>Hayden Book Company</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="10156812">
+ <rom name="batter up (1980)(hayden book company).wav" size="10156812" crc="0f19de37" sha1="6b9467fd834eb38310edb07935f5246026ad3cdf" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
<software name="bbstrat">
<description>Baseball Strategy</description>
<year>1982</year>
- <!-- pet4032 Side A: Baseball Strateg -->
+ <!-- pet4032 Side A: BASEBALL STRATEG -->
<publisher>Microcomputer Games</publisher>
<part name="cass" interface="cbm_cass">
<dataarea name="cass" size="30735222">
@@ -60,7 +86,7 @@
<description>Blackjack</description>
<year>1978</year>
- <!-- pet20018 Side A: Blackjack -->
+ <!-- pet20018 Side A: BLACKJACK -->
<publisher>Commodore Business Machines, Inc.</publisher>
<part name="cass" interface="cbm_cass">
<dataarea name="cass" size="11284678">
@@ -69,11 +95,24 @@
</part>
</software>
+ <software name="bjack1">
+ <description>Casino Blackjack 5.7</description>
+ <year>1979</year>
+
+ <!-- pet20018 Side A: BLACKJACK -->
+ <publisher>Speakeasy Software</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="11929950">
+ <rom name="casino blackjack 5.7 (1979)(cms software systems).wav" size="11929950" crc="de4f4383" sha1="2ac7ee53dc74a4696bf9dd72103e4ef569d94ec4" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
<software name="bomba">
<description>Arcade Pak #3 Bomber Attack</description>
<year>1982</year>
- <!-- pet2001n Side A: Bomber Attack -->
+ <!-- pet2001n cb2snd Side A: BOMBER ATTACK -->
<publisher>Avalon Hill</publisher>
<part name="cass" interface="cbm_cass">
<dataarea name="cass" size="10001002">
@@ -82,11 +121,24 @@
</part>
</software>
+ <software name="bridge">
+ <description>Bridge</description>
+ <year>1978</year>
+
+ <!-- pet20018 Side A: BRIDGE -->
+ <publisher>Petsoft</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="11119154">
+ <rom name="bridge (1978)(petsoft).wav" size="11119154" crc="1d874549" sha1="71e74fcb0c1b20533bee1371c0213e05db24c4c7" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
<software name="bullb">
<description>Bulls and Bears</description>
<year>1978</year>
- <!-- pet20018 Side A: Bulls and Bears -->
+ <!-- pet20018 Side A: BULLS AND BEARS -->
<publisher>Speakeasy Software</publisher>
<part name="cass" interface="cbm_cass">
<dataarea name="cass" size="10926558">
@@ -95,15 +147,15 @@
</part>
</software>
- <software name="bjack1">
- <description>Casino Blackjack 5.7</description>
- <year>1979</year>
+ <software name="checkers">
+ <description>PET Checkers</description>
+ <year>1980</year>
- <!-- pet20018 Side A: Blackjack -->
- <publisher>Speakeasy Software</publisher>
+ <!-- pet20018 Side A: CHECKERS -->
+ <publisher>CMS Software Systems</publisher>
<part name="cass" interface="cbm_cass">
- <dataarea name="cass" size="11929950">
- <rom name="casino blackjack 5.7 (1979)(cms software systems).wav" size="11929950" crc="de4f4383" sha1="2ac7ee53dc74a4696bf9dd72103e4ef569d94ec4" offset="0" />
+ <dataarea name="cass" size="10467148">
+ <rom name="pet checkers (1980)(cms software systems).wav" size="10467148" crc="e3529a46" sha1="3fa8de3a8374e14f0d2b3bd97ff2d8393b3797f0" offset="0" />
</dataarea>
</part>
</software>
@@ -112,7 +164,7 @@
<description>Conflict 2500</description>
<year>1981</year>
- <!-- pet2001n16 Side A: Conflict 2500 -->
+ <!-- pet2001n32 Side A: CONFLICT 2500 -->
<publisher>Microcomputer Games</publisher>
<part name="cass" interface="cbm_cass">
<dataarea name="cass" size="23419766">
@@ -125,7 +177,7 @@
<description>Cursor 1</description>
<year>1978</year>
- <!-- pet20018 Side A: Cover, Brick, Wander, Shark, Plot, Typer -->
+ <!-- pet20018 Side A: COVER, BRICK, WANDER, SHARK, PLOT, TYPER -->
<publisher>The Code Works</publisher>
<part name="cass" interface="cbm_cass">
<dataarea name="cass" size="34540096">
@@ -138,7 +190,7 @@
<description>Cursor 2</description>
<year>1978</year>
- <!-- pet20018 Side A: Cover, Race, Zap, Est, Guess, Mad -->
+ <!-- pet20018 Side A: COVER, RACE, ZAP, EST, GUESS, MAD -->
<publisher>The Code Works</publisher>
<part name="cass" interface="cbm_cass">
<dataarea name="cass" size="38802738">
@@ -151,7 +203,7 @@
<description>Cursor 3</description>
<year>1978</year>
- <!-- pet20018 Side A: Cover, Bar, Dots, Quix!, Flash, Cards -->
+ <!-- pet20018 cb2snd Side A: Cover, BAR, DOTS, QUIX!, FLASH, CARDS -->
<publisher>The Code Works</publisher>
<part name="cass" interface="cbm_cass">
<dataarea name="cass" size="47849882">
@@ -164,7 +216,7 @@
<description>Cursor 4</description>
<year>1978</year>
- <!-- pet20018 Side A: Cover!, Bop, Calc, Clock!, Inp, Ced -->
+ <!-- pet20018 cn2snd Side A: COVER!, BOP, CALC, CLOCK!, INP, CED -->
<publisher>The Code Works</publisher>
<part name="cass" interface="cbm_cass">
<dataarea name="cass" size="55455514">
@@ -178,7 +230,7 @@
<description>Cursor 5</description>
<year>1978</year>
- <!-- pet20018 Side A: Cover, Hanoi, Shoot, Bship, Face, Hman -->
+ <!-- pet20018 Side A: COVER, HANOI, SHOOT, BSHIP, FACE, HMAN -->
<publisher>The Code Works</publisher>
<part name="cass" interface="cbm_cass">
<dataarea name="cass" size="46403528">
@@ -191,7 +243,7 @@
<description>Cursor 6</description>
<year>1979</year>
- <!-- pet2001n Side A: Cover, Box, Bjack, pet20018: Pack, List, Cedpr -->
+ <!-- pet2001n Side A: COVER, BOX, BJACK, pet20018: PACK, LIST, CEDPR -->
<publisher>The Code Works</publisher>
<part name="cass" interface="cbm_cass">
<dataarea name="cass" size="46753010">
@@ -204,7 +256,7 @@
<description>Cursor 7</description>
<year>1979</year>
- <!-- pet2001n Side A: Cover, Pricer, Sound!, Mind, Fball, Paper -->
+ <!-- pet2001n Side A: COVER, PRICER, SOUND!, MIND, FBALL, PAPER -->
<publisher>The Code Works</publisher>
<part name="cass" interface="cbm_cass">
<dataarea name="cass" size="54620302">
@@ -217,7 +269,7 @@
<description>Cursor 8</description>
<year>1979</year>
- <!-- pet2001n Side A: Cover, Revers!, Dbook, Space!, Maze, Add, X -->
+ <!-- pet2001n Side A: COVER, REVERS!, DBOOK, SPACE!, MAZE, ADD, X -->
<publisher>The Code Works</publisher>
<part name="cass" interface="cbm_cass">
<dataarea name="cass" size="58017788">
@@ -230,7 +282,7 @@
<description>Cursor 9</description>
<year>1979</year>
- <!-- pet2001n16 Side A: pet2001n: Cover, Yahtzee, Slot!, Flip, Circle, pet2001n16: Gammon -->
+ <!-- pet2001n16 Side A: pet2001n: COVER, YAHTZEE, SLOT!, FLIP, CIRCLE, pet2001n16: GAMMON -->
<publisher>The Code Works</publisher>
<part name="cass" interface="cbm_cass">
<dataarea name="cass" size="69494314">
@@ -243,7 +295,7 @@
<description>Cursor 10</description>
<year>1979</year>
- <!-- pet2001n Side A: Cover!, pet20018: Titrate, pet2001n: Finance, Course, pet20018: Asm, Reader -->
+ <!-- pet2001n Side A: COVER!, pet20018: TITRATE, pet2001n: FINANCE, COURSE, pet20018: ASM, READER -->
<publisher>The Code Works</publisher>
<part name="cass" interface="cbm_cass">
<dataarea name="cass" size="52635502">
@@ -252,11 +304,11 @@
</part>
</software>
- <software name="cur11">
+ <software name="cur11" supported="partial">
<description>Cursor 11</description>
<year>1979</year>
- <!-- pet2001n Side A: Cover, Demon!, Hi calc, Wipeout, Peg, States -->
+ <!-- pet2001n Side A: COVER, DEMON!, HI CALC, WIPEOUT, PEG, STATES -->
<publisher>The Code Works</publisher>
<part name="cass" interface="cbm_cass">
<dataarea name="cass" size="52073122">
@@ -265,11 +317,11 @@
</part>
</software>
- <software name="cur12">
+ <software name="cur12" supported="partial">
<description>Cursor 12</description>
<year>1979</year>
- <!-- pet2001n Side A: Cover12, Canyon!, Gauss!, Pickup, Piegram, Flight! -->
+ <!-- pet2001n Side A: COVER12, CANYON!, GAUSS!, PICKUP, PIEGRAM, FLIGHT! -->
<publisher>The Code Works</publisher>
<part name="cass" interface="cbm_cass">
<dataarea name="cass" size="60014980">
@@ -317,11 +369,11 @@
</part>
</software>
- <software name="cur16">
+ <software name="cur16" supported="partial">
<description>Cursor 16</description>
<year>1980</year>
- <!-- pet2001n Side A: Cover16, Nab!, Fire!, Aliens!, Bonzo!, Catch! -->
+ <!-- pet2001n Side A: COVER16, NAB!, FIRE!, ALIENS!, BONZO!, CATCH! -->
<publisher>The Code Works</publisher>
<part name="cass" interface="cbm_cass">
<dataarea name="cass" size="45885486">
@@ -513,13 +565,12 @@
</software>
<software name="dpoker">
- <!-- 321008 -->
<description>Draw Poker</description>
<year>1978</year>
- <publisher>Commodore Business Machines, Inc.</publisher>
- <!-- pet20018 -->
- <part name="cass" interface="cbm_cass">
+ <!-- pet20018 Side A: DRAW POKER 1 -->
+ <publisher>Commodore Business Machines, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
<dataarea name="cass" size="10220420">
<rom name="draw poker (1978)(commodore busines machines).wav" size="10220420" crc="82f7871d" sha1="973cdc5d8ede2dffa6fb25abfadf8b5daabe6949" offset="0" />
</dataarea>
@@ -968,6 +1019,20 @@
</part>
</software>
+ <software name="escape">
+ <description>Escape from the Death Planet</description>
+ <year>1979</year>
+
+ <!-- pet4032 cb2snd Side A: DEATH PLANET -->
+ <publisher>Fantasy Games Software</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="12746666">
+ <rom name="escape from the death planet (1979)(fantasy games software).wav" size="12746666" crc="4fc9abf2" sha1="572feaa721b687f77a4fcc69147a7e3cab810cc8" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+
<software name="galaxy">
<description>GALAXY!</description>
<year>1982</year>
@@ -1009,6 +1074,253 @@
</part>
</software>
+ <software name="ksm01">
+ <description>College Board Math Part 1</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: CBN M1+ -->
+ <publisher>Krell Software</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="14099000">
+ <rom name="college board math part 1+ (1980)(krell software).wav" size="14099000" crc="2b0daf17" sha1="94c22b79b199b65b5739106cad9d305819cff408" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="ksm02">
+ <description>College Board Math Part 2</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: CBN M2+ -->
+ <publisher>Krell Software</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="19368642">
+ <rom name="college board math part 2+ (1980)(krell software).wav" size="19368642" crc="111bc02c" sha1="033792da31836d8d057a50fcb602fc495746a240" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="ksm03">
+ <description>College Board Math Part 3</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: CBN M3+ -->
+ <publisher>Krell Software</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="13871032">
+ <rom name="college board math part 3+ (1980)(krell software).wav" size="13871032" crc="e7a7d47c" sha1="aad3517292885d582cbd74b63726c1c5d1c4bead" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="ksm04">
+ <description>College Board Math Part 4</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: CBN M4+ -->
+ <publisher>Krell Software</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="19069232">
+ <rom name="college board math part 4+ (1980)(krell software).wav" size="19069232" crc="e4dea20f" sha1="9357c5725e78141ebdff4f995aee3b544762cd87" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="ksm05">
+ <description>College Board Math Part 5</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: CBN M5+ -->
+ <publisher>Krell Software</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="17746636">
+ <rom name="college board math part 5+ (1980)(krell software).wav" size="17746636" crc="837d92df" sha1="4f07e353ea346a3c78c0adeb8299b428cbb1d545" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="ksm09">
+ <description>College Board Math Part 9</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: CBN M9+ -->
+ <publisher>Krell Software</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="12317246">
+ <rom name="college board math part 9+ (1980)(krell software).wav" size="12317246" crc="b8e265da" sha1="d6fe4acb04ee8e1c48915a8cea5c75a1083d58c3" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="ksm10">
+ <description>College Board Math Part 10</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: CBN M10+ -->
+ <publisher>Krell Software</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="13791288">
+ <rom name="college board math part 10+ (1980)(krell software).wav" size="13791288" crc="4623f2b0" sha1="6071ff88a1eb9c8834c7bca9ec563bc54c26f31d" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="ksm11">
+ <description>College Board Math Part 11</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: CBN M11+ -->
+ <publisher>Krell Software</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="11918766">
+ <rom name="college board math part 11+ (1980)(krell software).wav" size="11918766" crc="d9c5ee3c" sha1="75470dde606d08b0057ed9eed2360d75082b719a" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="ksm12">
+ <description>College Board Math Part 12</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: CBN M12+ -->
+ <publisher>Krell Software</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="14271262">
+ <rom name="college board math part 12+ (1980)(krell software).wav" size="14271262" crc="3a5e5f37" sha1="3a76a189e31bc4dca1c4fe48ba237ff91cef506b" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="ksm13">
+ <description>College Board Math Part 13</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: CBN M13+ -->
+ <publisher>Krell Software</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="13718180">
+ <rom name="college board math part 13+ (1980)(krell software).wav" size="13718180" crc="980e026c" sha1="da8aa15385c06336b5c463c368ae6ebcd1662497" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="ksv01">
+ <description>College Board Vocabulary Part 1</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: CBN V1+ -->
+ <publisher>Krell Software</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="11861270">
+ <rom name="college board vocabulary part 1+ (1980)(krell software).wav" size="11861270" crc="b9e2864e" sha1="0f618d783a6f49b6b9b9381b8a38979877b87a89" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="ksv02">
+ <description>College Board Vocabulary Part 2</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: CBN V2+ -->
+ <publisher>Krell Software</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="12765386">
+ <rom name="college board vocabulary part 2+ (1980)(krell software).wav" size="12765386" crc="a4e73944" sha1="f9268276ca9e9491b78414de629375ab7a0cbb6f" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="ksv03">
+ <description>College Board Vocabulary Part 3</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: CBN V3+ -->
+ <publisher>Krell Software</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="12829774">
+ <rom name="college board vocabulary part 3+ (1980)(krell software).wav" size="12829774" crc="efd8deed" sha1="79b1da7e0affc4a7a8b0c6f3524641287134fcb8" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="ksv04">
+ <description>College Board Vocabulary Part 4</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: CBN V4+ -->
+ <publisher>Krell Software</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="12757712">
+ <rom name="college board vocabulary part 4+ (1980)(krell software).wav" size="12757712" crc="f80f4e82" sha1="ebf14fb9b40e991a207fd2a2de091ee1591b7a56" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="ksv05">
+ <description>College Board Vocabulary Part 5</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: CBN V5+ -->
+ <publisher>Krell Software</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="12986898">
+ <rom name="college board vocabulary part 5+ (1980)(krell software).wav" size="12986898" crc="e749abd8" sha1="f0827496c27ea213f6545fd69b26b4d85a5a00ca" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="ksv06">
+ <description>College Board Vocabulary Part 6</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: CBN V6+ -->
+ <publisher>Krell Software</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="12798454">
+ <rom name="college board vocabulary part 6+ (1980)(krell software).wav" size="12798454" crc="77eb8793" sha1="78aba3db6fbbfdc24a4b43630880cf646cc264b8" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="ksv07">
+ <description>College Board Vocabulary Part 7</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: CBN V7+ -->
+ <publisher>Krell Software</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="9986504">
+ <rom name="college board vocabulary part 7+ (1980)(krell software).wav" size="9986504" crc="91721613" sha1="2e2595428e4861a24c64a8af02891ac007795e37" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="ksw01">
+ <description>College Board Word Relationships Part 1</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: CBN WR1+ -->
+ <publisher>Krell Software</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="16797924">
+ <rom name="college board word relationships part 1+ (1980)(krell software).wav" size="16797924" crc="b446fc5d" sha1="d1db2ef611ce80f5cf338c816e0e79794a41d706" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="ksw02">
+ <description>College Board Word Relationships Part 2</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: CBN WR2+ -->
+ <publisher>Krell Software</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="18448346">
+ <rom name="college board word relationships part 2+ (1980)(krell software).wav" size="18448346" crc="508c57c2" sha1="196df31d9548b0da85381dc53e3a589ceb7feffa" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
<software name="mchess2">
<description>Microchess 2.0</description>
<year>1978</year>
@@ -1022,12 +1334,1014 @@
</part>
</software>
+ <software name="miead">
+ <description>Add-Facts 0-5</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: ADD FACTS 0-5 -->
+ <publisher>Microcomputers in Education</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="9586212">
+ <rom name="add-facts 0-5 (1980)(microcomputers in education).wav" size="9586212" crc="e6a993a5" sha1="ed2be67e0d3e43083c571c7ddcecd45e717c1a21" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mieal">
+ <description>Alphabet</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: ALPHABET -->
+ <publisher>Microcomputers in Education</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="5242866">
+ <rom name="alphabet (1980)(microcomputers in education).wav" size="5242866" crc="8d757151" sha1="dced7629b88c4af59b36397e5941325280b69ffd" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="miebo">
+ <description>Book Shelf</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: BOOKSHELF -->
+ <publisher>Microcomputers in Education</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="10760580">
+ <rom name="bookshelf (1980)(microcomputers in education).wav" size="10760580" crc="92b92df5" sha1="ed9cc8c68c010c07bdaf593fb594c89cc8d830fd" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mieca">
+ <description>Careers</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: CAREERS -->
+ <publisher>Microcomputers in Education</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="11462148">
+ <rom name="careers (1980)(microcomputers in education).wav" size="11462148" crc="3c7f32b0" sha1="0a8e78fa2125eb8442a31234dd628df88d1f59eb" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mieco">
+ <description>Column Add</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: COLUMN ADD -->
+ <publisher>Microcomputers in Education</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="10387018">
+ <rom name="column add (1980)(microcomputers in education).wav" size="10387018" crc="bcb30870" sha1="12aba9347328f7ed8fccd548f45ae23ae67b0de3" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="miefr">
+ <description>Fractions</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: FRACTION EQUIV 1 -->
+ <publisher>Microcomputers in Education</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="9350666">
+ <rom name="fractions 1 (1980)(microcomputers in education).wav" size="9350666" crc="34497eb3" sha1="a3851e20b974be30a3530a6ec770ecc5aac71ecd" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mieli">
+ <description>Lightbulbs</description>
+ <year>1979</year>
+
+ <!-- pet2001n16 Side A: LIGHT BULBS -->
+ <publisher>Microcomputers in Education</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="11726992">
+ <rom name="lightbulbs 1 (1979)(microcomputers in education).wav" size="11726992" crc="4229aa6c" sha1="a9b17aa07cfcbc18c699f70a62e3f3bea8331257" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mieru">
+ <description>Ruler - Fractions</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: RULER FRACTIONS -->
+ <publisher>Microcomputers in Education</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="10218784">
+ <rom name="ruler - fractions (1980)(microcomputers in education).wav" size="10218784" crc="774caab9" sha1="3a564d02f74944b0f4624f14d4de6c2218efb577" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="miesy">
+ <description>Synonyms</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: SYNONYMS -->
+ <publisher>Microcomputers in Education</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="10377506">
+ <rom name="synonyms (1980)(microcomputers in education).wav" size="10377506" crc="4da7f52a" sha1="5447205b152443c5294664e505b2ce8faada4b30" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mieve">
+ <description>Verbs - Being</description>
+ <year>1981</year>
+
+ <!-- pet2001n16 Side A: VERBS-BEING -->
+ <publisher>Microcomputers in Education</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="11060680">
+ <rom name="ruler - verbs-being (1981)(microcomputers in education).wav" size="11060680" crc="1f6ebb0f" sha1="b548e1a002c47f9bce59349945859e4b0a11cc5f" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="miewo">
+ <description>Word Scrambler</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: WORD SCRAMBLER -->
+ <publisher>Microcomputers in Education</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="10503278">
+ <rom name="word scrambler (1980)(microcomputers in education).wav" size="10503278" crc="d162ac07" sha1="2d38734101193a75b6c841cd72a337ac08090e12" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="micros">
+ <description>Microsail</description>
+ <year>1980</year>
+
+ <!-- pet2001n Side A: Microsail -->
+ <publisher>Micro-ware</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="11487312">
+ <rom name="microsail (1980)(hayden book company).wav" size="11487312" crc="98cbccfe" sha1="b72881d5d192e917a2f1066f5d14f0d54f1d1223" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="meadd">
+ <description>Adding with Objects</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: ADD W/OBJS -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="6555666">
+ <rom name="adding with objects (1980)(micro-ed, inc.).wav" size="6555666" crc="12856524" sha1="3ed6e22a6c41e7d1792397e25745076adbc1cef9" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="meagr">
+ <description>Agreement of Subject and Verb</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: AGREE SUB&VERB -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="9462158">
+ <rom name="agreement of subject and verb (1980)(micro-ed, inc.).wav" size="9462158" crc="f1cb1a8b" sha1="e1f9dfa609ca3658fd88aeea0711a1deffdf4bf7" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="meant">
+ <description>The Antonym Machine</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: ANTONYM MACHINE -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="7777350">
+ <rom name="antonym machine (1980)(micro-ed, inc.).wav" size="7777350" crc="93a9b797" sha1="8cb83adbefc31f1c2ffdea3fc363863b32193a48" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mecou">
+ <description>Count 'Em</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: COUNT'EM -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="4665288">
+ <rom name="count'em (1980)(micro-ed, inc.).wav" size="4665288" crc="f907724c" sha1="2a1d57a3c3493cc1629cacda3b890426c503d34b" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="medir">
+ <description>Direction and Distance</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: DIR.& DIST. -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="11304042">
+ <rom name="direction and distance (1980)(micro-ed, inc.).wav" size="11304042" crc="e5427fa9" sha1="714ae1638c7eb935c4c92d889600ed0195fd7cf9" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mehai">
+ <description>H A I K U</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: HAIKU -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="7779092">
+ <rom name="haiku (1980)(micro-ed, inc.).wav" size="7779092" crc="3e3a59ff" sha1="63682033497e003ccdc7de355eeaba37be72ee3c" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mehat">
+ <description>Hat in the Ring - A Presidential Election Game</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: HAT IN THE RING -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="9908016">
+ <rom name="hat in the ring - a presidential election game (1980)(micro-ed, inc.).wav" size="9908016" crc="4634edc1" sha1="532e386e5b04526ded6ea9a3ef033eb14f41dc55" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mehig">
+ <description>Higher Same Lower</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 cb2snd Side A: HIGH-SAME-LOW -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="9332600">
+ <rom name="higher same lower (1980)(micro-ed, inc.).wav" size="9332600" crc="d45a188a" sha1="709d1b24fa3f5f83e3ddde9bca7dcc24ef798af1" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mehom">
+ <description>The Homonym Machine</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: HOMONYM PRINT -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="7706736">
+ <rom name="homonym machine (1980)(micro-ed, inc.).wav" size="7706736" crc="1abc077b" sha1="90fb702e83fcb4d239fc63ab48389336f247c78c" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="meide">
+ <description>Identifying Complete Sentences</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: I.D.COMP.SENT -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="8523762">
+ <rom name="identifying complete sentences (1980)(micro-ed, inc.).wav" size="8523762" crc="cd3df5f6" sha1="a3f784b4fe54cce3e91f7c70797553669aae134f" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="meits">
+ <description>Its - It's Your - Your're</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: ITS-ITS'S -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="8014530">
+ <rom name="its - it's your - your're (1980)(micro-ed, inc.).wav" size="8014530" crc="80c8c061" sha1="7cde83c1cdb2d3886b9f6e2feceb2c77d6bd7d0b" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="memac">
+ <description>Marching Capital Letters</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: MATCH CAP.LET -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="11208928">
+ <rom name="matching capital letters (1980)(micro-ed, inc.).wav" size="11208928" crc="05ac62a3" sha1="9b95b252036fbecfdc2e77ff2f104ea7b8cac8f8" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="memacl" supported="partial">
+ <description>Matching Capital Letters Light Pen</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: MATCH W/LT PEN -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="11469566">
+ <rom name="matching capital letters light pen (1980)(micro-ed, inc.).wav" size="11469566" crc="0dcb9651" sha1="e633c9493ce2b309021ca9045c988a6a93636776" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="memak">
+ <description>Making an Outline</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: MAKING -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="11393146">
+ <rom name="making an outline (1980)(micro-ed, inc.).wav" size="11393146" crc="94e7c72e" sha1="c6c064dd41338771ca09cb43749bb1e85118f5ca" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="memat">
+ <description>Matching Rhythms</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 cb2snd Side A: MATCHING RHYTHMS -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="6274548">
+ <rom name="matching rhythms (1980)(micro-ed, inc.).wav" size="6274548" crc="9b3a4fc7" sha1="43bee456a7052d07f9b3feb1a25393263aed69b1" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="memath">
+ <description>The Math Bid Game</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: MATH BID -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="12270988">
+ <rom name="math bid game (1980)(micro-ed, inc.).wav" size="12270988" crc="cd21011f" sha1="d5e0e111492d5f2c57381404fc62dd4880b82a41" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+
+ <software name="mepet">
+ <description>The Friendly Shrink</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: PET COUNSELOR -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="11888514">
+ <rom name="pet counselor (1980)(micro-ed, inc.).wav" size="11888514" crc="861a580a" sha1="f3edb3b7effe5a023dece84a87b14360066b74b0" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mesa1">
+ <description>Spelling Words in Context A1</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: A1 SPELLING -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="12120440">
+ <rom name="spelling words in context a1 (1980)(micro-ed, inc.).wav" size="12120440" crc="915488f0" sha1="3a3d8b59f508713e34453980f3965b1915620c16" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mesa2">
+ <description>Spelling Words in Context A2</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: A2 SPELLING -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="10854988">
+ <rom name="spelling words in context a2 (1980)(micro-ed, inc.).wav" size="10854988" crc="6fa8535b" sha1="e8dd75ff0a58d7b5a4bc0c5b03401c68024f1d9f" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mesa3">
+ <description>Spelling Words in Context A3</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: A3 SPELLING -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="10371380">
+ <rom name="spelling words in context a3 (1980)(micro-ed, inc.).wav" size="10371380" crc="2ad1f48f" sha1="a79f7d05c53526187f162b81bbbeb03d2d408029" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mesa4">
+ <description>Spelling Words in Context A4</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: A4 SPELLING -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="10754692">
+ <rom name="spelling words in context a4 (1980)(micro-ed, inc.).wav" size="10754692" crc="83712190" sha1="be763ebc4280f43afe8bce4c3f33e12452dd573f" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mesa5">
+ <description>Spelling Words in Context A5</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: A5 SPELLING -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="10738816">
+ <rom name="spelling words in context a5 (1980)(micro-ed, inc.).wav" size="10738816" crc="4c0e5869" sha1="52fd4a653009ccf7b0acd54c5ae34970898fb91f" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mesa6">
+ <description>Spelling Words in Context A6</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: A6 SPELLING -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="10716836">
+ <rom name="spelling words in context a6 (1980)(micro-ed, inc.).wav" size="10716836" crc="579bb2f1" sha1="48e3aa42481ddf8d34cb8f7bf0b96b098a32f246" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mesa7">
+ <description>Spelling Words in Context A7</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: A7 SPELLING -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="11128438">
+ <rom name="spelling words in context a7 (1980)(micro-ed, inc.).wav" size="11128438" crc="bda9a189" sha1="d04fe6a79d8d62483c65757376b2dec49e3a44fc" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mesb1">
+ <description>Spelling Words in Context B1</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: B1 SPELLING -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="11797214">
+ <rom name="spelling words in context b1 (1980)(micro-ed, inc.).wav" size="11797214" crc="79d0cdd3" sha1="7083e257da67384e7dc7d8a21aab0e92694c12ba" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mesb2">
+ <description>Spelling Words in Context B2</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: B2 SPELLING -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="10602204">
+ <rom name="spelling words in context b2 (1980)(micro-ed, inc.).wav" size="10602204" crc="a121a9c6" sha1="482e4dfa9e667f4a26d944526bb170bf8104eb59" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mesb3">
+ <description>Spelling Words in Context B3</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: B3 SPELLING -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="11332420">
+ <rom name="spelling words in context b3 (1980)(micro-ed, inc.).wav" size="11332420" crc="335ce6d5" sha1="53200df400e1a898d6a1f2ab031921cd2cb33152" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mesb4">
+ <description>Spelling Words in Context B4</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: B4 SPELLING -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="11035652">
+ <rom name="spelling words in context b4 (1980)(micro-ed, inc.).wav" size="11035652" crc="ed719a01" sha1="bc1f27ed1160e18d5ec9077f94b78259c9b17d13" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mesb5">
+ <description>Spelling Words in Context B5</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: B5 SPELLING -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="10844138">
+ <rom name="spelling words in context b5 (1980)(micro-ed, inc.).wav" size="10844138" crc="a823a8c7" sha1="ccbe6ac92eee9465f37b17c5ef11b0231e5aafe7" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mesb6">
+ <description>Spelling Words in Context B6</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: B6 SPELLING -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="10975902">
+ <rom name="spelling words in context b6 (1980)(micro-ed, inc.).wav" size="10975902" crc="407dd504" sha1="c2db0a891b219f7c3e16539d847f22c72213da55" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mesb7">
+ <description>Spelling Words in Context B7</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: B7 SPELLING -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="11032540">
+ <rom name="spelling words in context b7 (1980)(micro-ed, inc.).wav" size="11032540" crc="d826f234" sha1="c54c4920a860d95c008d8db3086a706eef787a94" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mesc1">
+ <description>Spelling Words in Context C1</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: C1 SPELLING -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="11604010">
+ <rom name="spelling words in context c1 (1980)(micro-ed, inc.).wav" size="11604010" crc="6f80e116" sha1="ea1381ae215f49afee7057c3cb8c76dcc1db4216" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mesc2">
+ <description>Spelling Words in Context C2</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: C2 SPELLING -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="11282154">
+ <rom name="spelling words in context c2 (1980)(micro-ed, inc.).wav" size="11282154" crc="83d8b273" sha1="02517f3aee060bb350abd070011ba36f87806c2b" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mesc3">
+ <description>Spelling Words in Context C3</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: C3 SPELLING -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="11200692">
+ <rom name="spelling words in context c3 (1980)(micro-ed, inc.).wav" size="11200692" crc="48b4014c" sha1="5a2f1ca9445b6d34f3186998989c7406067685bb" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mesc4">
+ <description>Spelling Words in Context C4</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: C4 SPELLING -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="10836300">
+ <rom name="spelling words in context c4 (1980)(micro-ed, inc.).wav" size="10836300" crc="992f2985" sha1="5922baf4c62062d884fdfde88892759987f1e391" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mesc5">
+ <description>Spelling Words in Context C5</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: C5 SPELLING -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="11478520">
+ <rom name="spelling words in context c5 (1980)(micro-ed, inc.).wav" size="11478520" crc="477c148a" sha1="46928c9e373930cb80515747b21d1df2d35e7e08" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mesc6">
+ <description>Spelling Words in Context C6</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: C6 SPELLING -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="11550666">
+ <rom name="spelling words in context c6 (1980)(micro-ed, inc.).wav" size="11550666" crc="8aacfd96" sha1="cfae446f3a0fdfb835b589471ffbc8520a76d1f3" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mesc7">
+ <description>Spelling Words in Context C7</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: C7 SPELLING -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="11618096">
+ <rom name="spelling words in context c7 (1980)(micro-ed, inc.).wav" size="11618096" crc="b4ab1719" sha1="7a7b55fe3626ba99451539d34f94260244104ffa" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mesd1">
+ <description>Spelling Words in Context D1</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: D1 SPELLING -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="11567928">
+ <rom name="spelling words in context d1 (1980)(micro-ed, inc.).wav" size="11567928" crc="2ea51e3c" sha1="a5e4db0c6675575d906d135be3941a1b30b8c28c" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mesd2">
+ <description>Spelling Words in Context D2</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: D2 SPELLING -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="11090568">
+ <rom name="spelling words in context d2 (1980)(micro-ed, inc.).wav" size="11090568" crc="a31ec81e" sha1="31a601c1e34dbe3122b78c14c0fa21f471eb4671" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mesd3">
+ <description>Spelling Words in Context D3</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: D3 SPELLING -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="11197486">
+ <rom name="spelling words in context d3 (1980)(micro-ed, inc.).wav" size="11197486" crc="83e07dec" sha1="c06ebfea59d2ee7f3829a08dd175c39d9fb31125" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mesd4">
+ <description>Spelling Words in Context D4</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: D4 SPELLING -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="11436024">
+ <rom name="spelling words in context d4 (1980)(micro-ed, inc.).wav" size="11436024" crc="d35528aa" sha1="8977552165e5d44faebe111363f686cdfd59b9e3" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mesd5">
+ <description>Spelling Words in Context D5</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: D5 SPELLING -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="11616560">
+ <rom name="spelling words in context d5 (1980)(micro-ed, inc.).wav" size="11616560" crc="4c8be6d8" sha1="1fcf3055be2ee8c5f8e09012d878ceddb4bddd87" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mesd6">
+ <description>Spelling Words in Context D6</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: D6 SPELLING -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="12204042">
+ <rom name="spelling words in context d6 (1980)(micro-ed, inc.).wav" size="12204042" crc="7fc3fbfe" sha1="a07603d2e1683a73f4c2bbc4b73494d098cb1e4a" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mesd7">
+ <description>Spelling Words in Context D7</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: D7 SPELLING -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="11786164">
+ <rom name="spelling words in context d7 (1980)(micro-ed, inc.).wav" size="11786164" crc="4eecec97" sha1="05983873115aff52f6da96cc470dfde6a239c896" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mese1">
+ <description>Spelling Words in Context E1</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: E1 SPELLING -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="12089150">
+ <rom name="spelling words in context e1 (1980)(micro-ed, inc.).wav" size="12089150" crc="8a93b48d" sha1="0e7238f4582f23aa0e5bdc1366e3dc95e5be2820" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mese2">
+ <description>Spelling Words in Context E2</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: E2 SPELLING -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="11365468">
+ <rom name="spelling words in context e2 (1980)(micro-ed, inc.).wav" size="11365468" crc="92772642" sha1="ab8af4dcd1ff959f697c635e56deaed381a14b40" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mese3">
+ <description>Spelling Words in Context E3</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: E3 SPELLING -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="11266374">
+ <rom name="spelling words in context e3 (1980)(micro-ed, inc.).wav" size="11266374" crc="3f5a3729" sha1="1ef3b6b1d8030b373910ad9cf98e57599708e9a5" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mese4">
+ <description>Spelling Words in Context E4</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: E4 SPELLING -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="11533462">
+ <rom name="spelling words in context e4 (1980)(micro-ed, inc.).wav" size="11533462" crc="18f953b6" sha1="9bef1105cc88a4dadef36a61630bb3125cc1d493" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mese5">
+ <description>Spelling Words in Context E5</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: E5 SPELLING -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="11426528">
+ <rom name="spelling words in context e5 (1980)(micro-ed, inc.).wav" size="11426528" crc="244bb119" sha1="cb7f8a9cd42f7cc29320463efdee860be798aaee" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mese6">
+ <description>Spelling Words in Context E6</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: E6 SPELLING -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="11772280">
+ <rom name="spelling words in context e6 (1980)(micro-ed, inc.).wav" size="11772280" crc="d2f899d4" sha1="431db5d9aba9099b0a0d54f77babee5a54585c35" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mese7">
+ <description>Spelling Words in Context E7</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: E7 SPELLING -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="12145764">
+ <rom name="spelling words in context e7 (1980)(micro-ed, inc.).wav" size="12145764" crc="36c66eaa" sha1="271b8b67c33d190569c9ca4f25e530ab99adb2c2" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mesto">
+ <description>Story Problems in Addition Subtraction</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: STORY PROBS+&- -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="10107624">
+ <rom name="story problems in addition subtraction (1980)(micro-ed, inc.).wav" size="10107624" crc="c8dcaa52" sha1="2b249c31ec9b7143ded741586dde2bcaafbe8610" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mesyn">
+ <description>Synonym Game</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: SYNONYMS 1 -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="8982972">
+ <rom name="synonym game (1980)(micro-ed, inc.).wav" size="8982972" crc="c67f525c" sha1="d27ea0c6861891f2d72887a8283301cbd1a334e5" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="metot">
+ <description>To Too Two</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: TO-TOO-TWO -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="8146668">
+ <rom name="to too two (1980)(micro-ed, inc.).wav" size="8146668" crc="e31418b3" sha1="536c1f802a6967082e3e413ec67de588ccdd49ba" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="meusa">
+ <description>Usage - Exercise Thirteen</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: USAGE BONERS 13 -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="9461248">
+ <rom name="usage - exercise thirteen (1980)(micro-ed, inc.).wav" size="9461248" crc="b3a85d58" sha1="128cd4c463112d0db0eb8743b536a7b435a21bf7" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mewoa">
+ <description>Working With Basic Addition Facts</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: WORK BAS. + FACTS -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="10474678">
+ <rom name="working with basic addition facts (1980)(micro-ed, inc.).wav" size="10474678" crc="f9e35031" sha1="cf34f97ec208b69ad9233f9691f05bd6d4772148" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mewom">
+ <description>Working With Basic Multiplication Facts</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 Side A: WORK BAS.X FACTS -->
+ <publisher>Micro-Ed, Inc.</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="10496564">
+ <rom name="working with basic multiplication facts (1980)(micro-ed, inc.).wav" size="10496564" crc="f2d5c183" sha1="afef2c1feec1ae1b7e1bd25ff67a33849165dbd2" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mpbar">
+ <description>Bar Graphs</description>
+ <year>1979</year>
+
+ <!-- pet2001n16 Side A: BAR GRAPHS -->
+ <publisher>Microphys</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="8926802">
+ <rom name="bar graphs (1979)(microphys).wav" size="8926802" crc="f6e36ed4" sha1="1c153e02aee40803a8d9fe24e446c3c01c5d3a5a" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mpcoo">
+ <description>Coord. Geometry I</description>
+ <year>1979</year>
+
+ <!-- pet2001n16 Side A: COORD. GEO. I -->
+ <publisher>Microphys</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="9515994">
+ <rom name="coord. geometry i (1979)(microphys).wav" size="9515994" crc="5b42f826" sha1="8d6e5adcb5cb357679dd257fb8de7eecb03fa6c5" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mpgeo">
+ <description>Geometrical Areas</description>
+ <year>1979</year>
+
+ <!-- pet2001n16 Side A: Geometrical Areas -->
+ <publisher>Microphys</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="9645178">
+ <rom name="geometrical areas (1979)(microphys).wav" size="9645178" crc="c298319e" sha1="7c6286bb9c5edb16a8e37d0aa6d2cbd4490f30fb" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mppro">
+ <description>Projectile Motion Analyis</description>
+ <year>1979</year>
+
+ <!-- pet2001n16 Side A: PROJECTILE MOTIO -->
+ <publisher>Microphys</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="11769800">
+ <rom name="projectile motion analysis (1979)(microphys).wav" size="11769800" crc="3a28bd64" sha1="69368891a924ed75068f2b5f4e1d0aa6f8a6f6e7" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mptr1">
+ <description>Trigonometry I</description>
+ <year>1979</year>
+
+ <!-- pet2001n16 Side A: TRIGONOMETRY I -->
+ <publisher>Microphys</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="6706460">
+ <rom name="trigonometry i (1979)(microphys).wav" size="6706460" crc="6f8e1e85" sha1="a5f5592d63ac044171f5982a2d5419d6aa37639e" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mptr2">
+ <description>Trigonometry II</description>
+ <year>1979</year>
+
+ <!-- pet2001n16 Side A: TRIGONOMETRY II -->
+ <publisher>Microphys</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="8181926">
+ <rom name="trigonometry ii (1979)(microphys).wav" size="8181926" crc="3ab0afb9" sha1="affb87f923f2967b91f537d0cbae7d44002d2642" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mptyp">
+ <description>Types of Variation</description>
+ <year>1979</year>
+
+ <!-- pet2001n16 Side A: TYPES OF VARIATN -->
+ <publisher>Microphys</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="9272584">
+ <rom name="types of variation (1979)(microphys).wav" size="9272584" crc="9e136f0c" sha1="7e427ea30a1892a48c4327d53780a60f74901e4e" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
<software name="midway">
<description>Midway Campaign</description>
<year>1980</year>
<publisher>Microcomputer Games</publisher>
- <!-- pet2001n16 Side A: Midway -->
+ <!-- pet2001n16 Side A: MIDWAY -->
<part name="cass" interface="cbm_cass">
<dataarea name="cass" size="23443232">
<rom name="midway campaign (1980)(avalon hill).wav" size="23443232" crc="7aa50725" sha1="420fadf2b52613860e5496284e97da229d67447e" offset="0" />
@@ -1039,7 +2353,7 @@
<description>North Atlantic Convoy Raider</description>
<year>1980</year>
- <!-- pet2001n16 Side A: North Atlant.c.r -->
+ <!-- pet2001n16 Side A: NORTH ATLANT.C.R -->
<publisher>Microcomputer Games</publisher>
<part name="cass" interface="cbm_cass">
<dataarea name="cass" size="12074650">
@@ -1049,35 +2363,167 @@
</software>
<software name="oserev">
- <!-- 321001 -->
<description>Osero / Reverse</description>
<year>1978</year>
<publisher>Commodore Business Machines, Inc.</publisher>
- <!-- pet20018 Side A: Osero -->
+ <!-- pet20018 Side A: OSERO, REVERSE -->
<part name="cass1" interface="cbm_cass">
- <dataarea name="cass" size="9777552">
- <rom name="osero (1978)(commodore business machines).wav" size="9777552" crc="f52d600f" sha1="57b0e42a4eb3dd7587f5a248bb549be752109f24" offset="0" />
+ <dataarea name="cass" size="15091952">
+ <rom name="osero, reverse (1978)(commodore business machines).wav" size="15091952" crc="e9fedf09" sha1="2b272e1c222d1d0fdc435f0bd21ef331715a5e3f" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="owww1">
+ <description>Just Rolling Along / Smile for a Picture</description>
+ <year>1980</year>
+ <publisher>Our Weird and Wacky World</publisher>
+
+ <!-- pet2001b16 Side A: lit comp1-owww -->
+ <part name="cass1" interface="cbm_cass">
+ <dataarea name="cass" size="10705738">
+ <rom name="1-1 just rolling along (1980)(our weird and wacky world).wav" size="10705738" crc="75219099" sha1="ff4f0af779b54b6a05ff95a533b3e819edbabee6" offset="0" />
</dataarea>
</part>
- <!-- pet20018 Side B: Reverse -->
+ <!-- pet2001b16 Side B: lit comp2-owww -->
<part name="cass2" interface="cbm_cass">
- <dataarea name="cass" size="5270380">
- <rom name="reverse (1978)(commodore business machines).wav" size="5270380" crc="890a53ec" sha1="a2280df2113b2aa250850eadb9247ca1a0d06079" offset="0" />
+ <dataarea name="cass" size="11895282">
+ <rom name="1-2 smile for a picture (1980)(our weird and wacky world).wav" size="11895282" crc="7149a806" sha1="3723983ce1e94e32a3816f0b9e1f67f0d4ad3091" offset="0" />
</dataarea>
</part>
</software>
- <software name="checkers">
- <description>PET Checkers</description>
+ <software name="owww2">
+ <description>A Mile Wide Pie / Take Me Out To The Ball Game For Some Salad !</description>
<year>1980</year>
+ <publisher>Our Weird and Wacky World</publisher>
- <!-- pet20018 Side A: Checkers -->
- <publisher>CMS Software Systems</publisher>
+ <!-- pet2001b16 Side A: lit comp3-owww -->
+ <part name="cass1" interface="cbm_cass">
+ <dataarea name="cass" size="11358248">
+ <rom name="2-1 a mile wide pie (1980)(our weird and wacky world).wav" size="11358248" crc="9230fdd0" sha1="854c92d3351ce620b1298606e6a1c4e62ab5ddf9" offset="0" />
+ </dataarea>
+ </part>
+
+ <!-- pet2001b16 Side B: lit comp4-owww -->
+ <part name="cass2" interface="cbm_cass">
+ <dataarea name="cass" size="11977626">
+ <rom name="2-2 take me out to the ball game for some salad ! (1980)(our weird and wacky world).wav" size="11977626" crc="f3bd4a97" sha1="02436bc9dd373e9fd7fa278467215e3b37ac99b0" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="owww3">
+ <description>Beware of Attack Rabbit! / A Pet That's Hard to Pat</description>
+ <year>1980</year>
+ <publisher>Our Weird and Wacky World</publisher>
+
+ <!-- pet2001b16 Side A: lit comp5-owww -->
+ <part name="cass1" interface="cbm_cass">
+ <dataarea name="cass" size="11871006">
+ <rom name="3-1 beware of attack rabbit! (1980)(our weird and wacky world).wav" size="11871006" crc="7005e1ff" sha1="5246327dd9e8dfcf911eabf773e9ab79648e7f1f" offset="0" />
+ </dataarea>
+ </part>
+
+ <!-- pet2001b16 Side B: lit comp6-owww -->
+ <part name="cass2" interface="cbm_cass">
+ <dataarea name="cass" size="12052388">
+ <rom name="3-2 a pet that's hard to pat (1980)(our weird and wacky world).wav" size="12052388" crc="48ff8b12" sha1="9eb80e2e9957ff7fe459ff4d0c643e7d6539eabf" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="owww4">
+ <description>A Sneaky Snake / The Moscow Circus</description>
+ <year>1980</year>
+ <publisher>Our Weird and Wacky World</publisher>
+
+ <!-- pet2001b16 Side A: lit comp7-owww -->
+ <part name="cass1" interface="cbm_cass">
+ <dataarea name="cass" size="11740388">
+ <rom name="4-1 a sneaky snake (1980)(our weird and wacky world).wav" size="11740388" crc="738ddc18" sha1="92135888f95dd0b40e2f2f74e53b9d3501aed566" offset="0" />
+ </dataarea>
+ </part>
+
+ <!-- pet2001b16 Side B: lit comp8-owww -->
+ <part name="cass2" interface="cbm_cass">
+ <dataarea name="cass" size="10573446">
+ <rom name="4-2 the moscow circus (1980)(our weird and wacky world).wav" size="10573446" crc="98f70cec" sha1="019ac1fe4387b9d3fb3cd0cc52a6078a81576565" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="owww5">
+ <description>Very Lost in Space / Who Says '7' is a Lucky Number</description>
+ <year>1980</year>
+ <publisher>Our Weird and Wacky World</publisher>
+
+ <!-- pet2001b16 Side A: crit rdg1-owww -->
+ <part name="cass1" interface="cbm_cass">
+ <dataarea name="cass" size="12213128">
+ <rom name="5-1 very lost in space (1980)(our weird and wacky world).wav" size="12213128" crc="6f34e1f4" sha1="2e98e372245b0c905706acdbb0c68fd32ea21b2e" offset="0" />
+ </dataarea>
+ </part>
+
+ <!-- pet2001b16 Side B: crit rdg2-owww -->
+ <part name="cass2" interface="cbm_cass">
+ <dataarea name="cass" size="11264656">
+ <rom name="5-2 who says '7' is a lucky number (1980)(our weird and wacky world).wav" size="11264656" crc="d1757fb1" sha1="2693558e4243b49d5a4d8035d543a00ba972bc27" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="owww6">
+ <description>Sherlock Bones, Dog Detective / Crazy, Crumbling Creations</description>
+ <year>1980</year>
+ <publisher>Our Weird and Wacky World</publisher>
+
+ <!-- pet2001b16 Side A: crit rdg3-owww -->
+ <part name="cass1" interface="cbm_cass">
+ <dataarea name="cass" size="11492412">
+ <rom name="6-1 sherlock bones, dog detective (1980)(our weird and wacky world).wav" size="11492412" crc="d72cfdfd" sha1="f72f7e0308472c9005f6124c48058ad5be5814db" offset="0" />
+ </dataarea>
+ </part>
+
+ <!-- pet2001b16 Side B: crit rdg4-owww -->
+ <part name="cass2" interface="cbm_cass">
+ <dataarea name="cass" size="11462590">
+ <rom name="6-2 crazy, crumbling creations (1980)(our weird and wacky world).wav" size="11462590" crc="98040b0d" sha1="b602914d4b61e66c03d7c36aa8a66ca5e67c67b7" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="owww7">
+ <description>A Cup of Coffee for $141,000 / Bite Right</description>
+ <year>1980</year>
+ <publisher>Our Weird and Wacky World</publisher>
+
+ <!-- pet2001b16 Side A: crit rdg5-owww -->
+ <part name="cass1" interface="cbm_cass">
+ <dataarea name="cass" size="11153230">
+ <rom name="7-1 a cup of coffee for $141,000 (1980)(our weird and wacky world).wav" size="11153230" crc="8f95d56c" sha1="6666ae2b8b9100c742a42330deb77990ed77e673" offset="0" />
+ </dataarea>
+ </part>
+
+ <!-- pet2001b16 Side B: crit rdg6-owww -->
+ <part name="cass2" interface="cbm_cass">
+ <dataarea name="cass" size="11352614">
+ <rom name="7-2 bite right (1980)(our weird and wacky world).wav" size="11352614" crc="e3553a6b" sha1="9c316f0373b0d552c8c92a60b900355b6b58e64d" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="petches">
+ <description>PET Chess 8000</description>
+ <year>1981</year>
+
+ <!-- pet8032 Side A: PETCHESS -->
+ <publisher>Philidor Software</publisher>
<part name="cass" interface="cbm_cass">
- <dataarea name="cass" size="10467148">
- <rom name="pet checkers (1980)(cms software systems).wav" size="10467148" crc="e3529a46" sha1="3fa8de3a8374e14f0d2b3bd97ff2d8393b3797f0" offset="0" />
+ <dataarea name="cass" size="50070702">
+ <rom name="petchess (1981)(philidor software).wav" size="50070702" crc="6d9fc6a0" sha1="f71b165918b9c62add08aae62cfe822cb121f32e" offset="0" />
</dataarea>
</part>
</software>
@@ -1086,7 +2532,7 @@
<description>The Planet Miners</description>
<year>1979</year>
- <!-- pet2001n16 Side A: Planet Miners -->
+ <!-- pet2001n16 Side A: PLANET MINERS -->
<publisher>Microcomputer Games</publisher>
<part name="cass" interface="cbm_cass">
<dataarea name="cass" size="22746580">
@@ -1095,11 +2541,232 @@
</part>
</software>
+ <software name="ppda1">
+ <description>The Pet Professor Whole Numbers Fractions Decimals D-A-1</description>
+ <year>1979</year>
+
+ <!-- pet2001n16 Side A: DEC.ADD.1-PP -->
+ <publisher>Cow Bay Computing</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="10359896">
+ <rom name="pet professor - whole numbers fractions decimals d-a-1 (1979)(cow bay computing).wav" size="10359896" crc="9271f796" sha1="389c661a6f6b827801865950dcc93e6905db125e" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="ppda2">
+ <description>The Pet Professor Whole Numbers Fractions Decimals D-A-2</description>
+ <year>1979</year>
+
+ <!-- pet2001n16 Side A: DEC.ADD.2-PP -->
+ <publisher>Cow Bay Computing</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="9562660">
+ <rom name="pet professor - whole numbers fractions decimals d-a-2 (1979)(cow bay computing).wav" size="9562660" crc="c441bbeb" sha1="8f1b229b77e41152e36aefd31a1493ad390ce476" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="ppda3">
+ <description>The Pet Professor Whole Numbers Fractions Decimals D-A-3</description>
+ <year>1979</year>
+
+ <!-- pet2001n16 Side A: DEC.ADD.3-PP -->
+ <publisher>Cow Bay Computing</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="9630124">
+ <rom name="pet professor - whole numbers fractions decimals d-a-3 (1979)(cow bay computing).wav" size="9630124" crc="d1c336ff" sha1="69625a1420f16cc9d9a455374c4750972d07b29e" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="ppda4">
+ <description>The Pet Professor Whole Numbers Fractions Decimals D-A-4</description>
+ <year>1979</year>
+
+ <!-- pet2001n16 Side A: DEC.ADD.4-PP -->
+ <publisher>Cow Bay Computing</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="11228732">
+ <rom name="pet professor - whole numbers fractions decimals d-a-4 (1979)(cow bay computing).wav" size="11228732" crc="f9feb984" sha1="18efacfe0d7b69072e18731c95af2f4cdbd5c4e4" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="ppdd1">
+ <description>The Pet Professor Whole Numbers Fractions Decimals D-D-1</description>
+ <year>1979</year>
+
+ <!-- pet2001n16 Side A: DEC.DIV.1-PP -->
+ <publisher>Cow Bay Computing</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="10799888">
+ <rom name="pet professor - whole numbers fractions decimals d-d-1 (1979)(cow bay computing).wav" size="10799888" crc="728b1e79" sha1="3614c014c7e9700e9b91cb07c1021e1fc62ed796" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="ppdd2">
+ <description>The Pet Professor Whole Numbers Fractions Decimals D-D-2</description>
+ <year>1979</year>
+
+ <!-- pet2001n16 Side A: DEC.DIV.2-PP -->
+ <publisher>Cow Bay Computing</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="12181706">
+ <rom name="pet professor - whole numbers fractions decimals d-d-2 (1979)(cow bay computing).wav" size="12181706" crc="266dcc46" sha1="10ce0f8995b7779721e9baeb9f0097f37f3f101a" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="ppdm1">
+ <description>The Pet Professor Whole Numbers Fractions Decimals D-M-1</description>
+ <year>1979</year>
+
+ <!-- pet2001n16 Side A: DEC.MULT.1-PP -->
+ <publisher>Cow Bay Computing</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="9411830">
+ <rom name="pet professor - whole numbers fractions decimals d-m-1 (1979)(cow bay computing).wav" size="9411830" crc="a63a1dc2" sha1="90df55a142b8baff081c74830828f0f473f06a09" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="ppdm2">
+ <description>The Pet Professor Whole Numbers Fractions Decimals D-M-2</description>
+ <year>1979</year>
+
+ <!-- pet2001n16 Side A: DEC.MULT.2-PP -->
+ <publisher>Cow Bay Computing</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="9694542">
+ <rom name="pet professor - whole numbers fractions decimals d-m-2 (1979)(cow bay computing).wav" size="9694542" crc="5639c8be" sha1="34893ff033a5bf936cf98cdb74ea8b5b05a55f1e" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="ppdm3">
+ <description>The Pet Professor Whole Numbers Fractions Decimals D-M-3</description>
+ <year>1979</year>
+
+ <!-- pet2001n16 Side A: DEC.MULT.3-PP -->
+ <publisher>Cow Bay Computing</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="11436858">
+ <rom name="pet professor - whole numbers fractions decimals d-m-3 (1979)(cow bay computing).wav" size="11436858" crc="0031e057" sha1="c1cc0af5161b33815b927030f834015875eb8932" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="ppdm4">
+ <description>The Pet Professor Whole Numbers Fractions Decimals D-M-4</description>
+ <year>1979</year>
+
+ <!-- pet2001n16 Side A: DEC.MULT.4-PP -->
+ <publisher>Cow Bay Computing</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="11319234">
+ <rom name="pet professor - whole numbers fractions decimals d-m-4 (1979)(cow bay computing).wav" size="11319234" crc="3badc5e4" sha1="bf147fea84ff76f42306c33c43be216b5871dbd8" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="ppdm5">
+ <description>The Pet Professor Whole Numbers Fractions Decimals D-M-5</description>
+ <year>1979</year>
+
+ <!-- pet2001n16 Side A: DEC.MULT.5-PP -->
+ <publisher>Cow Bay Computing</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="11696222">
+ <rom name="pet professor - whole numbers fractions decimals d-m-5 (1979)(cow bay computing).wav" size="11696222" crc="c0750704" sha1="41b2cf2df4ce493a72a0294e907d4682edb5a66c" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="ppds1">
+ <description>The Pet Professor Whole Numbers Fractions Decimals D-S-1</description>
+ <year>1979</year>
+
+ <!-- pet2001n16 Side A: DEC.SUB.1-PP -->
+ <publisher>Cow Bay Computing</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="7747416">
+ <rom name="pet professor - whole numbers fractions decimals d-s-1 (1979)(cow bay computing).wav" size="7747416" crc="41727566" sha1="56498c2c14585a92b083df5b0b8055a2c5c67d78" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="ppds2">
+ <description>The Pet Professor Whole Numbers Fractions Decimals D-S-2</description>
+ <year>1979</year>
+
+ <!-- pet2001n16 Side A: DEC.SUB.2-PP -->
+ <publisher>Cow Bay Computing</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="9045996">
+ <rom name="pet professor - whole numbers fractions decimals d-s-2 (1979)(cow bay computing).wav" size="9045996" crc="68a6967f" sha1="db14c083f6d34d1d73ed491d4c32e8cb69e08133" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="ppds3">
+ <description>The Pet Professor Whole Numbers Fractions Decimals D-S-3</description>
+ <year>1979</year>
+
+ <!-- pet2001n16 Side A: DEC.SUB.3-PP -->
+ <publisher>Cow Bay Computing</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="9680506">
+ <rom name="pet professor - whole numbers fractions decimals d-s-3 (1979)(cow bay computing).wav" size="9680506" crc="83b7ccb1" sha1="50945fac8f4c36c2eddc95ef54ec8bf443c0bc5d" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="ppds4">
+ <description>The Pet Professor Whole Numbers Fractions Decimals D-S-4</description>
+ <year>1979</year>
+
+ <!-- pet2001n16 Side A: DEC.SUB.4-PP -->
+ <publisher>Cow Bay Computing</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="9542338">
+ <rom name="pet professor - whole numbers fractions decimals d-s-4 (1979)(cow bay computing).wav" size="9542338" crc="b5a70f35" sha1="f9adfcf9b4fe9cc17bf17dba3fa0b8c2ed835f88" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="ppwns5">
+ <description>The Pet Professor Whole Numbers Fractions Decimals WN-S-5</description>
+ <year>1979</year>
+
+ <!-- pet2001n16 Side A: SUBT. SAMPLE -->
+ <publisher>Cow Bay Computing</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="10884784">
+ <rom name="pet professor - whole numbers fractions decimals wn-s-5 (1981)(cow bay computing).wav" size="10884784" crc="b4006536" sha1="f076f5f1ac073b7d252f4365dc1adac7d456832b" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="prosp">
+ <description>Prospector</description>
+ <year>1979</year>
+
+ <!-- pet2001n Side A: PROSPECTOR -->
+ <publisher>Cascade Computerware</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="12014784">
+ <rom name="prospector (1979)(cascade computerware).wav" size="12014784" crc="63547f4d" sha1="55bd7712c2614d2a9cf0f93b62ac3315244d5e9a" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
<software name="santap">
<description>Santa Paravia and Fiumaccio</description>
<year>1978</year>
- <!-- pet2001n16 Side A: Santa Paravia -->
+ <!-- pet2001n16 Side A: SANTA PARAVIA -->
<publisher>Folklife Terminal Club</publisher>
<part name="cass" interface="cbm_cass">
<dataarea name="cass" size="22263674">
@@ -1108,13 +2775,38 @@
</part>
</software>
+ <software name="seawolf">
+ <description>Seawolf</description>
+ <year>1978</year>
+
+ <!-- pet2001b joystick Side A: seawolf -->
+ <publisher>Creative Software</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="9137146">
+ <rom name="seawolf (1978)(creative software).wav" size="9137146" crc="dd02f1d6" sha1="c0ede58b4daf80071497fb10f90237d92f73a2dd" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="spacea">
+ <description>Space Ace</description>
+ <year>1982</year>
+
+ <!-- pet8032 cb2snd Side A: space ace -->
+ <publisher>PerSoft</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="25415382">
+ <rom name="space ace (1982)(petsoft).wav" size="25415382" crc="ccfafd10" sha1="7821370eb794c452d362257bab9a896d098c07b4" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
<software name="spacef">
- <!-- 321010 -->
<description>Space Fight</description>
<year>1978</year>
<publisher>Commodore Business Machines, Inc.</publisher>
- <!-- pet20018 Side A: Space Fight -->
+ <!-- pet20018 Side A: SPACE FIGHT -->
<part name="cass" interface="cbm_cass">
<dataarea name="cass" size="6234532">
<rom name="space fight (1978)(commodore business machines).wav" size="6234532" crc="38618c0a" sha1="f100e751f41899ed6e157ed7a0d1d7d569676c7f" offset="0" />
@@ -1122,11 +2814,82 @@
</part>
</software>
+ <software name="spacei">
+ <description>Space Invaders</description>
+ <year>19??</year>
+ <publisher>Unknown</publisher>
+
+ <!-- pet8032 cb2snd Side A: invaders -->
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="12670134">
+ <rom name="space invaders.wav" size="12670134" crc="e8cb4314" sha1="d21d40d4512811a59256add8fabbbb25443968e5" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="sqbtmon">
+ <description>Squiggle, Big Time / Monitor</description>
+ <year>1978</year>
+ <publisher>Commodore Business Machines, Inc.</publisher>
+
+ <!-- pet2001 Side A: SQUIGGLE, BIG TIME -->
+ <part name="cass1" interface="cbm_cass">
+ <dataarea name="cass" size="8627574">
+ <rom name="squiggle, big time (1978)(commodore business machines).wav" size="8627574" crc="6c15e344" sha1="2aaebd15ab532f7423f0624a1dd3ca816fe55a34" offset="0" />
+ </dataarea>
+ </part>
+
+ <!-- pet2001 Side B: MONITOR -->
+ <part name="cass2" interface="cbm_cass">
+ <dataarea name="cass" size="2751568">
+ <rom name="monitor (1978)(commodore business machines).wav" size="2751568" crc="22c03872" sha1="b6dc48fcb9a82f10730dacb8da6978a419b008e0" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="swback">
+ <description>Soundware Backgammon</description>
+ <year>1978</year>
+ <publisher>Cap Electronics</publisher>
+
+ <!-- pet20018 cb2snd Side A: BACKGAMMON -->
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="9936838">
+ <rom name="soundware backgammon (1978)(cap electronics).wav" size="9936838" crc="215d487d" sha1="0c41408eac777844530886337e84eddb7286ba54" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="swchec">
+ <description>Soundware Checkers</description>
+ <year>1978</year>
+ <publisher>Cap Electronics</publisher>
+
+ <!-- pet20018 cb2snd Side A: CHECKERS! -->
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="11297260">
+ <rom name="soundware checkers (1978)(cap electronics).wav" size="11297260" crc="493a09a5" sha1="f95ec9c735a35c08a9e592d24eb70dcd98b23ebd" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+ <software name="swminu">
+ <description>Soundware Minute Waltz</description>
+ <year>19798</year>
+ <publisher>Cap Electronics</publisher>
+
+ <!-- pet20018 cb2snd Side A: MINUTE WALTZ -->
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="8091962">
+ <rom name="soundware minute waltz (1979)(cap electronics).wav" size="8091962" crc="7961de96" sha1="c80d220c98bfcbd0a54578853d6742a02e686ffd" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
<software name="tankt">
<description>Tanktics</description>
<year>1981</year>
- <!-- pet2001n16 Side A: Tanktics -->
+ <!-- pet2001n16 Side A: TANKTICS -->
<publisher>Microcomputer Games</publisher>
<part name="cass" interface="cbm_cass">
<dataarea name="cass" size="22165844">
@@ -1136,22 +2899,14 @@
</software>
<software name="targoff">
- <!-- 321002 -->
<description>Target Pong/Off-The-Wall</description>
<year>1978</year>
<publisher>Commodore Business Machines, Inc.</publisher>
- <!-- pet20018 Side A: Target Pong -->
+ <!-- pet20018 Side A: TARGET PONG, OFF-THE-WALL -->
<part name="cass1" interface="cbm_cass">
- <dataarea name="cass" size="6928406">
- <rom name="target pong (1978)(commodore business machines).wav" size="6928406" crc="a9b1fc5b" sha1="449149f0e5312b66b7296535e5b4840b0fd28556" offset="0" />
- </dataarea>
- </part>
-
- <!-- pet20018 Side B: Off-The-Wall -->
- <part name="cass2" interface="cbm_cass">
- <dataarea name="cass" size="7515688">
- <rom name="off-the-wall (1978)(commodore business machines).wav" size="7515688" crc="afd30b2d" sha1="cc0c4c10fc6ad1dda4012740a20406693c1aa271" offset="0" />
+ <dataarea name="cass" size="14488110">
+ <rom name="target pong, off-the-wall (1978)(commodore business machines).wav" size="14488110" crc="177ae42e" sha1="b348b4b48d87f49626cbdb246bc239eb0afb2304" offset="0" />
</dataarea>
</part>
</software>
@@ -1160,7 +2915,7 @@
<description>Telengard</description>
<year>1982</year>
- <!-- pet2001n32 Side A: Telengard -->
+ <!-- pet2001n32 Side A: TELENGARD -->
<publisher>Microcomputer Games</publisher>
<part name="cass" interface="cbm_cass">
<dataarea name="cass" size="49824646">
@@ -1169,36 +2924,67 @@
</part>
</software>
- <software name="apshai">
- <description>Temple of Apshai</description>
+ <software name="timec">
+ <description>Time Chess</description>
+ <year>198?</year>
+
+ <!-- pet8032 Side A: time chess -->
+ <publisher>Unknown</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="14278250">
+ <rom name="time chess (mike singleton).wav" size="14278250" crc="001ed26d" sha1="8be49dac03b1043e641bd6ec9d9aacda35cab7da" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="timet">
+ <description>Time Trek</description>
<year>1979</year>
- <publisher>Automated Simulations</publisher>
- <!-- pet2001n32 Side A: Apshai, level 1.seq, level 2.seq, level 3.seq, level 4.seq -->
- <part name="cass1" interface="cbm_cass">
- <dataarea name="cass" size="76924190">
- <rom name="temple of apshai (1979)(automated simulations).wav" size="76924190" crc="faecb03c" sha1="be38fb082fa74c33f280bda401b215001670d54f" offset="0" />
+ <!-- pet2001n Side A: TIME TREK -->
+ <publisher>Programma International</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="11411630">
+ <rom name="time trek (1979)(programma international).wav" size="11411630" crc="88d4124f" sha1="79e352fa7f0c675962e013ebce90d05425249929" offset="0" />
</dataarea>
</part>
</software>
<software name="ttgames">
- <!-- 321004 -->
<description>A Treasure Trove of Games</description>
<year>1978</year>
<publisher>Commodore Business Machines, Inc.</publisher>
- <!-- pet20018 Side A: Lunar Lander, Rotate -->
+ <!-- pet20018 Side A: LUNAR LANDER, ROTATE, WUMPUS, TIC TAC TOE -->
<part name="cass1" interface="cbm_cass">
- <dataarea name="cass" size="14443032">
- <rom name="lunar lander, rotate (1978)(commodore business machines).wav" size="14443032" crc="9ec18354" sha1="5099624623d83a38bc211be86213d493e672291d" offset="0" />
+ <dataarea name="cass" size="31208000">
+ <rom name="lunar lander, rotate, wumpus, tic tac toe (1978)(commodore business machines).wav" size="31208000" crc="fd363be2" sha1="93178dc977c6fee82a68cea20b6e8712f77cd682" offset="0" />
</dataarea>
</part>
+ </software>
- <!-- pet20018 Side B: Wumpus, Tic Tac Toe -->
- <part name="cass2" interface="cbm_cass">
- <dataarea name="cass" size="16588594">
- <rom name="wumpus, tic-tac-toe (1978)(commodore business machines).wav" size="16588594" crc="5345b9be" sha1="2c9ec6f68468b608f68926285f4367b6677e76e0" offset="0" />
+ <software name="vmm">
+ <description>Visible Music Monitor</description>
+ <year>1980</year>
+
+ <!-- pet2001n16 cb2snd Side A: VMM -->
+ <publisher>A B Computers</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="12666020">
+ <rom name="vmm (1980)(a b computers).wav" size="12666020" crc="e40a3528" sha1="ff855214d3a6714325f1b4bc94f25978b7758e5e" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="wordproc">
+ <description>Word Processor</description>
+ <year>1979</year>
+
+ <!-- pet2001n Side A: WORD PROCESSOR -->
+ <publisher>Programma International</publisher>
+ <part name="cass" interface="cbm_cass">
+ <dataarea name="cass" size="6877542">
+ <rom name="word processor (1979)(programma international).wav" size="6877542" crc="88535acd" sha1="f43d299d808855ccd8f8361335554b48038bf270" offset="0" />
</dataarea>
</part>
</software>
diff --git a/hash/pet_flop.xml b/hash/pet_flop.xml
index b39cfd569ea..54425074044 100644
--- a/hash/pet_flop.xml
+++ b/hash/pet_flop.xml
@@ -26,6 +26,18 @@
</part>
</software>
+ <software name="1001demoa" cloneof="1001demo">
+ <description>Commodore SFD-1001 Test/Demo</description>
+ <year>198?</year>
+ <publisher>Commodore</publisher>
+
+ <part name="flop1" interface="floppy_5_25">
+ <dataarea name="flop" size="1066496">
+ <rom name="commodore sfd-1001 test demo.d82" size="1066496" crc="87f79d8c" sha1="6f73fd233871fae7e16a9eda9f628c907606ce9d" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
<software name="2040demov1" cloneof="2040demo">
<description>Commodore 2040 Floppy Disk Drive Test/Demo Disk (DOS v1)</description>
<year>197?</year>
@@ -38,6 +50,115 @@
</part>
</software>
+ <software name="apshaid">
+ <description>Temple of Apshai</description>
+ <year>1979</year>
+ <publisher>Automated Simulations</publisher>
+
+ <part name="flop1" interface="floppy_5_25">
+ <dataarea name="flop" size="174848">
+ <rom name="temple of apshai (1979)(automated simulations).d64" size="174848" crc="cf6b2a6f" sha1="c40fefc57db4d8eb13d575e8f3731a299104482c" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="dateston">
+ <description>The Datestones of Ryn A Microquest</description>
+ <year>1979</year>
+ <publisher>Automated Simulations</publisher>
+
+ <part name="flop1" interface="floppy_5_25">
+ <dataarea name="flop" size="174848">
+ <rom name="datestones of ryn (1979)(automated simulations).d64" size="174848" crc="1fbcf28a" sha1="936099e06ff1843db92956e8647f89f553ae7b89" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="escaped">
+ <description>Escape from the Death Planet</description>
+ <year>1979</year>
+ <publisher>Fantasy Games Software</publisher>
+
+ <part name="flop1" interface="floppy_5_25">
+ <dataarea name="flop" size="174848">
+ <rom name="escape from the death planet (1979)(fantasy games software).d64" size="174848" crc="b6a5e95f" sha1="d2dd418a3b7803ffdeef1572c498307a01cb2db0" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="galaxyd">
+ <description>Galaxy!</description>
+ <year>1981</year>
+ <publisher>Microcomputer Games, Inc.</publisher>
+
+ <part name="flop1" interface="floppy_5_25">
+ <dataarea name="flop" size="174848">
+ <rom name="galaxy! (1981)(avalon hill).d64" size="174848" crc="ee09100e" sha1="e94add6ab81d706cf2812e23eb6039715bdad126" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="hellfire">
+ <description>Hellfire Warrior</description>
+ <year>1980</year>
+ <publisher>Automated Simulations</publisher>
+
+ <part name="flop1" interface="floppy_5_25">
+ <dataarea name="flop" size="174848">
+ <rom name="hellfire warrior (1980)(automated simulations).d64" size="174848" crc="19ff4a71" sha1="f155ed22c781a6883bf5119056ba7a1870a9fb2e" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="mapscaps">
+ <description>Maps and Capitals</description>
+ <year>1978</year>
+ <publisher>Solomon</publisher>
+
+ <part name="flop1" interface="floppy_5_25">
+ <dataarea name="flop" size="174848">
+ <rom name="maps and capitals (1978)(solomon).d64" size="174848" crc="6d3111dd" sha1="7730b5cff7afb01efedf0f3cece7fe596b22c0cd" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="oriond">
+ <description>Invasion Orion</description>
+ <year>1979</year>
+ <publisher>Automated Simulations</publisher>
+
+ <part name="flop1" interface="floppy_5_25">
+ <dataarea name="flop" size="174848">
+ <rom name="invasion orion (1979)(automated simulations).d64" size="174848" crc="2fa76e5c" sha1="bf1b41364962cd1fb7faa805536740ef3b96b5f4" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="states">
+ <description>The States</description>
+ <year>1978</year>
+ <publisher>Solomon</publisher>
+
+ <part name="flop1" interface="floppy_5_25">
+ <dataarea name="flop" size="174848">
+ <rom name="states (1978)(solomon).d64" size="174848" crc="4b45669d" sha1="df769e3d302b6ed0229174b19f825d4515d15574" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+
+ <software name="tunvkatm">
+ <description>Tunnel Vision and Cat and Mouse</description>
+ <year>1978</year>
+ <publisher>Solomon</publisher>
+
+ <part name="flop1" interface="floppy_5_25">
+ <dataarea name="flop" size="174848">
+ <rom name="tunnel vision and kat and mouse (1978)(michael riley).d64" size="174848" crc="5a26138d" sha1="a20b52cb9c086d8acfbd063814c412e6d04bf259" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
<software name="visicalc">
<description>VisiCalc</description>
<year>1981</year>
@@ -47,16 +168,16 @@
<!--
VisiCalc(R) PET 2001, CBM 2001
Program Diskette and CBM 8032 32K
- [VisiCorp logo] for 2040 and 4040
+ [VisiCorp logo] for 2040 and 4040
One of the VisiTM programs Diskette Drives
from VisiCorp by Software Arts, Inc.
- VisiCorpTM
- PERSONAL SOFTWARETM
+ VisiCorpTM
+ PERSONAL SOFTWARETM
Program Copyright (C) 1979, 1981
Software Arts, Inc. All Rights Reserved
- 20910-5511
+ 20910-5511
-->
<part name="flop1" interface="floppy_5_25">
<dataarea name="flop" size="174848">
@@ -80,16 +201,16 @@
<!--
VisiCalc(R) PET 2001, CBM 2001
Program Diskette CBM 8032 and CBM 8096
- [VisiCorp logo] for 8050 Diskette Drive
+ [VisiCorp logo] for 8050 Diskette Drive
One of the VisiTM programs by Software Arts, Inc.
from VisiCorp
- VisiCorpTM
- PERSONAL SOFTWARETM
+ VisiCorpTM
+ PERSONAL SOFTWARETM
Program Copyright (C) 1979, 1982
Software Arts, Inc. All Rights Reserved
- 20910-5612
+ 20910-5612
-->
<part name="flop1" interface="floppy_5_25">
<dataarea name="flop" size="533248">
@@ -704,7 +825,7 @@
<info name="serial" value="CP2-620-580" />
<!--
- C P / M ( R ) V e r s i o n 2 . 2
+ C P / M ( R ) V e r s i o n 2 . 2
( C ) 1 9 7 6 - 1 9 8 0 D i g i t a l R e s e a r c h
s e r i a l # C P 2 - 6 2 0 - 5 8 0 # #
8050 format / 4040 on back (C) 1982 Madison Computer
@@ -728,7 +849,7 @@
<year>2012</year>
<publisher>Steve Gray</publisher>
<!-- These disks contain some programs typed in from the HSG manual,
- along with new programs that were written in 2012. -->
+ along with new programs that were written in 2012. -->
<part name="flop1" interface="floppy_5_25">
<dataarea name="flop" size="174848">
diff --git a/hash/pet_rom.xml b/hash/pet_rom.xml
index 57a77be8060..94cbcf4ec16 100644
--- a/hash/pet_rom.xml
+++ b/hash/pet_rom.xml
@@ -290,6 +290,14 @@
<publisher>Palo Alto ICs Inc.</publisher>
<part name="rom" interface="pet_b000_rom">
+ <!--
+ TODO: The screen fills with garbage when run like this:
+ $ mame64 pet2001n32 toolkit2
+ and started with:
+ SYS 45056
+ We need to check this and should add notes with the emulator
+ options required to run the various versions of Toolkit.
+ -->
<dataarea name="rom" size="0x800">
<rom name="toolkit2-b000.bin" size="0x800" crc="bf8d29f3" sha1="324508c0cec374c80387b4286ed1b0fee9159486" offset="0" />
</dataarea>
diff --git a/hash/smc777.xml b/hash/smc777.xml
index 03ec6029521..6a689237353 100644
--- a/hash/smc777.xml
+++ b/hash/smc777.xml
@@ -140,7 +140,7 @@ Known to be dumped, but no longer available: (If you do have any of these please
<year>198?</year>
<publisher>Sony Corp.</publisher>
- <part name="flop1" interface="floppy_5_25">
+ <part name="flop1" interface="floppy_3_5">
<dataarea name="flop" size="121414">
<rom name="cpm22.imd" size="121414" crc="02db74fe" sha1="3f27609dd2d17e983bc337a5530e95883140e5b7" offset="0x0000" />
</dataarea>
@@ -153,7 +153,7 @@ Known to be dumped, but no longer available: (If you do have any of these please
<year>198?</year>
<publisher>&lt;unknown&gt;</publisher>
- <part name="flop1" interface="floppy_5_25">
+ <part name="flop1" interface="floppy_3_5">
<dataarea name="flop" size="305328">
<rom name="develop.1dd" size="305328" crc="13e5971a" sha1="c15d61e00ea2495ef5406a0a6f637ab2746e91cc" offset="0x0000" />
</dataarea>
@@ -166,7 +166,7 @@ Known to be dumped, but no longer available: (If you do have any of these please
<year>198?</year>
<publisher>&lt;unknown&gt;</publisher>
- <part name="flop1" interface="floppy_5_25">
+ <part name="flop1" interface="floppy_3_5">
<dataarea name="flop" size="261808">
<rom name="system 12j.1dd" size="261808" crc="c66e1a07" sha1="44e5ffb697c20f3652d6673885c9824f49a307bb" offset="0x0000" />
</dataarea>
@@ -178,7 +178,7 @@ Known to be dumped, but no longer available: (If you do have any of these please
<year>198?</year>
<publisher>&lt;unknown&gt;</publisher>
- <part name="flop1" interface="floppy_5_25">
+ <part name="flop1" interface="floppy_3_5">
<dataarea name="flop" size="305328">
<rom name="system 11.1dd" size="305328" crc="fcf54a39" sha1="d5aa09c73cef0cf639ef3adbe6e64a109f883ad6" offset="0x0000" />
</dataarea>
@@ -190,7 +190,7 @@ Known to be dumped, but no longer available: (If you do have any of these please
<year>198?</year>
<publisher>&lt;unknown&gt;</publisher>
- <part name="flop1" interface="floppy_5_25">
+ <part name="flop1" interface="floppy_3_5">
<dataarea name="flop" size="305328">
<rom name="system 10.1dd" size="305328" crc="89a0c347" sha1="2d3fdacef43d6b89861b90997715a80d784dd2d9" offset="0x0000" />
</dataarea>
@@ -202,7 +202,7 @@ Known to be dumped, but no longer available: (If you do have any of these please
<year>198?</year>
<publisher>Sony</publisher>
- <part name="flop1" interface="floppy_5_25">
+ <part name="flop1" interface="floppy_3_5">
<dataarea name="flop" size="211808">
<rom name="choplifter.1dd" size="211808" crc="bf2ea51c" sha1="4610f7456ca6bd1740b9c98fb3d2bd67aadffb5c" offset="0x0000" />
</dataarea>
@@ -215,7 +215,7 @@ Known to be dumped, but no longer available: (If you do have any of these please
<publisher>Sony</publisher>
<info name="alt_title" value="ストリッツb.h." />
- <part name="flop1" interface="floppy_5_25">
+ <part name="flop1" interface="floppy_3_5">
<dataarea name="flop" size="305328">
<rom name="strizbh.1dd" size="305328" crc="efa24635" sha1="c2308afeb555197c6d583e6cd46e6c5c5c9b4ea9" offset="0x0000" />
</dataarea>
@@ -228,7 +228,7 @@ Known to be dumped, but no longer available: (If you do have any of these please
<year>198?</year>
<publisher>&lt;unknown&gt;</publisher>
- <part name="flop1" interface="floppy_5_25">
+ <part name="flop1" interface="floppy_3_5">
<dataarea name="flop" size="305056">
<rom name="floppy magazine.1dd" size="305056" crc="44f18e58" sha1="dc4d8bda72d408e53edd4be4f1d9497d9179d35e" offset="0x0000" />
</dataarea>
@@ -243,7 +243,7 @@ Known to be dumped, but no longer available: (If you do have any of these please
<year>1987</year>
<publisher>Y. Sato</publisher>
- <part name="flop1" interface="floppy_5_25">
+ <part name="flop1" interface="floppy_3_5">
<dataarea name="flop" size="305328">
<rom name="corewars.1dd" size="305328" crc="4bbc1e35" sha1="22d1ba809d69d7e1679842f1d348cc9d6da850c5" offset="0x0000" />
</dataarea>
@@ -256,7 +256,7 @@ Known to be dumped, but no longer available: (If you do have any of these please
<year>1987</year>
<publisher>M &amp; M / Alines Soft</publisher>
- <part name="flop1" interface="floppy_5_25">
+ <part name="flop1" interface="floppy_3_5">
<dataarea name="flop" size="305328">
<rom name="dragon.1dd" size="305328" crc="dc23c4bc" sha1="45c0d8510f660108d20c82ef116e8dfa8b66b9c2" offset="0x0000" />
</dataarea>
@@ -270,7 +270,7 @@ Known to be dumped, but no longer available: (If you do have any of these please
<year>1987</year>
<publisher>M &amp; M</publisher>
- <part name="flop1" interface="floppy_5_25">
+ <part name="flop1" interface="floppy_3_5">
<dataarea name="flop" size="305328">
<rom name="dragon (freeware).1dd" size="305328" crc="168925c7" sha1="cf5b4b3f3ae0b77787613c7168eb8cb25dabbe52" offset="0x0000" />
</dataarea>
@@ -282,7 +282,7 @@ Known to be dumped, but no longer available: (If you do have any of these please
<year>1987</year>
<publisher>Kawaguchiya</publisher>
- <part name="flop1" interface="floppy_5_25">
+ <part name="flop1" interface="floppy_3_5">
<dataarea name="flop" size="305328">
<rom name="develop.1dd" size="305328" crc="b7605b47" sha1="927d173f5d08c7a0ad178af1c191cba7d5435a05" offset="0x0000" />
</dataarea>
@@ -295,7 +295,7 @@ Known to be dumped, but no longer available: (If you do have any of these please
<year>198?</year>
<publisher>&lt;unknown&gt;</publisher>
- <part name="flop1" interface="floppy_5_25">
+ <part name="flop1" interface="floppy_3_5">
<dataarea name="flop" size="305328">
<rom name="s-os sword monitor 2.0.1dd" size="305328" crc="27bc0b34" sha1="18840fab993716e7929b6e0600c446d8fba93059" offset="0x0000" />
</dataarea>
@@ -308,7 +308,7 @@ Known to be dumped, but no longer available: (If you do have any of these please
<year>198?</year>
<publisher>&lt;unknown&gt;</publisher>
- <part name="flop1" interface="floppy_5_25">
+ <part name="flop1" interface="floppy_3_5">
<dataarea name="flop" size="348848">
<rom name="s-os sword monitor 2.2.1dd" size="348848" crc="6e3215ce" sha1="1fffac3db3005e3de750c63ce1285f6b8a40310a" offset="0x0000" />
</dataarea>
@@ -322,7 +322,7 @@ Known to be dumped, but no longer available: (If you do have any of these please
<year>198?</year>
<publisher>&lt;unknown&gt;</publisher>
- <part name="flop1" interface="floppy_5_25">
+ <part name="flop1" interface="floppy_3_5">
<dataarea name="flop" size="261808">
<rom name="compilation 1.1dd" size="261808" crc="cc7827f5" sha1="8c24ec40cab047cff716d57ce44066709d238f5a" offset="0x0000" />
</dataarea>
@@ -334,7 +334,7 @@ Known to be dumped, but no longer available: (If you do have any of these please
<year>198?</year>
<publisher>&lt;unknown&gt;</publisher>
- <part name="flop1" interface="floppy_5_25">
+ <part name="flop1" interface="floppy_3_5">
<dataarea name="flop" size="261808">
<rom name="compilation 2.1dd" size="261808" crc="6be3d020" sha1="9398acca8f44c868abc3a837f91c56833962c17f" offset="0x0000" />
</dataarea>
diff --git a/hash/snes.xml b/hash/snes.xml
index cc6faa06efa..e6cb40cff2b 100644
--- a/hash/snes.xml
+++ b/hash/snes.xml
@@ -3692,7 +3692,7 @@ Beyond that last category are the roms waiting to be classified.
<part name="cart" interface="snes_cart">
<feature name="slot" value="lorom" />
<dataarea name="rom" size="1048576">
- <rom name="spellcraft (usa) (proto).sfc" size="1048576" crc="3daea8a1" sha1="fe4dcca5c3cb2e721f4dbf971cc06fe10f78e629" offset="0x000000" />
+ <rom name="spellcraft (usa) (proto).sfc" size="1048576" crc="47e900bf" sha1="67107c028eb23b830c9fdfc4136c416d793dd98f" offset="0x000000" />
</dataarea>
</part>
</software>
diff --git a/hash/svi318_flop.xml b/hash/svi318_flop.xml
index 8af9aace0fd..cec4a987cd9 100644
--- a/hash/svi318_flop.xml
+++ b/hash/svi318_flop.xml
@@ -6,7 +6,6 @@ Info Taken from here: http://www.samdal.com/svsoftware.htm
These disks are not dumped:
Wordstar
dBase II
-CP/M-80 2.22 Single Sided Disk
According to http://www.tosecdev.org/forum/errors-contributions/spectravideo-svi-318-and-svi-328-(tosec)-549/
@@ -26,7 +25,7 @@ Rädda disketten (198x)(sv)
-->
-<softwarelist name="svi318_flop" description="Spectravision SVI-318 disk images">
+<softwarelist name="svi318_flop" description="Spectravision SVI-318/328 disk images">
<software name="cpm224dd">
<description>CP/M-80 version 2.24</description>
@@ -45,7 +44,50 @@ Rädda disketten (198x)(sv)
<rom name="cpm224sd.imd" size="145870" crc="96bb2a7b" sha1="9cc4d5501abb83c586ede91161750b8718394b9a" offset="0x0000" />
</dataarea>
</part>
+ </software>
+ <software name="cpm222ss">
+ <description>CP/M-80 2.22</description>
+ <year>1983</year>
+ <publisher>Spectravideo</publisher>
+ <part name="flop1" interface="floppy_5_25">
+ <dataarea name="flop" size="172032">
+ <rom name="cpmss.dsk" size="172032" crc="cb7f1edb" sha1="676b5752141acaba7f1056909ed75be53ff388ff" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="cpm224ds">
+ <description>CP/M-80 2.24 for SV-605B</description>
+ <year>1984</year>
+ <publisher>Spectravideo</publisher>
+ <part name="flop1" interface="floppy_5_25">
+ <dataarea name="flop" size="346112">
+ <rom name="cpmds.dsk" size="346112" crc="f7323e1a" sha1="7bfd8c46f8361cb31e9f4f640448cddaad91c55b" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="diskbas">
+ <description>Disk Basic 1.0</description>
+ <year>1983?</year>
+ <publisher>Spectravideo</publisher>
+ <part name="flop1" interface="floppy_5_25">
+ <dataarea name="flop" size="346112">
+ <rom name="diskbasic10.dsk" size="346112" crc="0744ac56" sha1="eef7d033263d1cc2703d019bf062b1a02b641570" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="zcpr3">
+ <description>Z-CPR3</description>
+ <year>1985?</year>
+ <publisher>&lt;unknown&gt;</publisher>
+ <part name="flop1" interface="floppy_5_25">
+ <dataarea name="flop" size="172032">
+ <rom name="zcpr3.dsk" size="172032" crc="a6ea5b81" sha1="c08a6743e713fe8f3b8b694cd92fc70680fc6f66" offset="0" />
+ </dataarea>
+ </part>
</software>
</softwarelist>
diff --git a/makefile b/makefile
index ba0279ef2f1..68e610dcc69 100644
--- a/makefile
+++ b/makefile
@@ -4,9 +4,6 @@
#
# Core makefile for building MAME and derivatives
#
-# Copyright (c) Nicola Salmoria and the MAME Team.
-# Visit http://mamedev.org for licensing and usage restrictions.
-#
###########################################################################
@@ -30,6 +27,7 @@
# USE_DISPATCH_GL = 0
# DIRECTINPUT = 7
# USE_SDL = 1
+# SDL_INI_PATH = .;$HOME/.mame/;ini;
# SDL2_MULTIAPI = 1
# NO_USE_MIDI = 1
# DONT_USE_NETWORK = 1
@@ -52,9 +50,17 @@
# MAP = 1
# PROFILE = 1
# ARCHOPTS =
+# OPT_FLAGS =
# LDOPTS =
# USE_SYSTEM_LIB_EXPAT = 1
+# USE_SYSTEM_LIB_ZLIB = 1
+# USE_SYSTEM_LIB_JPEG = 1
+# USE_SYSTEM_LIB_FLAC = 1
+# USE_SYSTEM_LIB_LUA = 1
+# USE_SYSTEM_LIB_SQLITE3 = 1
+# USE_SYSTEM_LIB_PORTMIDI = 1
+# USE_SYSTEM_LIB_PORTAUDIO = 1
# MESA_INSTALL_ROOT = /opt/mesa
# SDL_INSTALL_ROOT = /opt/sdl2
@@ -84,6 +90,8 @@
# QT_HOME = /usr/lib64/qt48/
+# DRIVERS = src/mame/drivers/1942.c,src/mame/drivers/cops.c
+
-include useroptions.mak
###########################################################################
@@ -232,6 +240,16 @@ endif
endif
ifeq ($(findstring arm,$(UNAME)),arm)
+ARCHITECTURE :=
+ifndef NOASM
+ NOASM := 1
+endif
+endif
+
+# Emscripten
+ifeq ($(findstring emcc,$(CC)),emcc)
+TARGETOS := asmjs
+ARCHITECTURE :=
ifndef NOASM
NOASM := 1
endif
@@ -296,6 +314,34 @@ ifndef USE_SYSTEM_LIB_EXPAT
PARAMS += --with-bundled-expat
endif
+ifndef USE_SYSTEM_LIB_ZLIB
+PARAMS += --with-bundled-zlib
+endif
+
+ifndef USE_SYSTEM_LIB_JPEG
+PARAMS += --with-bundled-jpeg
+endif
+
+ifndef USE_SYSTEM_LIB_FLAC
+PARAMS += --with-bundled-flac
+endif
+
+ifndef USE_SYSTEM_LIB_LUA
+PARAMS += --with-bundled-lua
+endif
+
+ifndef USE_SYSTEM_LIB_SQLITE3
+PARAMS += --with-bundled-sqlite3
+endif
+
+ifndef USE_SYSTEM_LIB_PORTMIDI
+PARAMS += --with-bundled-portmidi
+endif
+
+ifndef USE_SYSTEM_LIB_PORTAUDIO
+PARAMS += --with-bundled-portaudio
+endif
+
#-------------------------------------------------
# distribution may change things
#-------------------------------------------------
@@ -396,10 +442,18 @@ ifdef OPTIMIZE
PARAMS += --OPTIMIZE=$(OPTIMIZE)
endif
+ifdef SHLIB
+PARAMS += --SHLIB=$(SHLIB)
+endif
+
ifdef ARCHOPTS
PARAMS += --ARCHOPTS='$(ARCHOPTS)'
endif
+ifdef OPT_FLAGS
+PARAMS += --OPT_FLAGS='$(OPT_FLAGS)'
+endif
+
ifdef MAP
PARAMS += --MAP='$(MAP)'
endif
@@ -468,6 +522,10 @@ ifdef USE_SDL
PARAMS += --USE_SDL='$(USE_SDL)'
endif
+ifdef SDL_INI_PATH
+PARAMS += --SDL_INI_PATH='$(SDL_INI_PATH)'
+endif
+
ifdef CYGWIN_BUILD
PARAMS += --CYGWIN_BUILD='$(CYGWIN_BUILD)'
endif
@@ -556,6 +614,10 @@ ifdef QT_HOME
PARAMS += --QT_HOME='$(QT_HOME)'
endif
+ifdef DRIVERS
+PARAMS += --DRIVERS='$(DRIVERS)'
+endif
+
#-------------------------------------------------
# All scripts
#-------------------------------------------------
@@ -578,9 +640,13 @@ SCRIPTS = scripts/genie.lua \
scripts/src/netlist.lua \
scripts/toolchain.lua \
scripts/src/osd/modules.lua \
- scripts/target/$(TARGET)/$(SUBTARGET).lua \
$(wildcard src/osd/$(OSD)/$(OSD).mak) \
$(wildcard src/$(TARGET)/$(SUBTARGET).mak)
+
+ifndef DRIVERS
+SCRIPTS += scripts/target/$(TARGET)/$(SUBTARGET).lua
+endif
+
ifdef REGENIE
SCRIPTS+= regenie
endif
@@ -631,7 +697,7 @@ CHECK_CLANG :=
else
GCC_VERSION := $(shell $(subst @,,$(CC)) -dumpversion 2> /dev/null)
ifneq ($(OS),solaris)
-CLANG_VERSION := $(shell clang --version 2> /dev/null | grep 'LLVM [0-9]\.[0-9]' -o | grep '[0-9]\.[0-9]' -o | head -n 1)
+CLANG_VERSION := $(shell clang --version 2> /dev/null | head -n 1 | grep '[0-9]\.[0-9]' -o | tail -n 1)
endif
PYTHON_AVAILABLE := $(shell $(PYTHON) --version > /dev/null 2>&1 && echo python)
CHECK_CLANG := $(shell gcc --version 2> /dev/null | grep 'clang' | head -n 1)
@@ -838,13 +904,14 @@ $(PROJECTDIR)/gmake-linux/Makefile: makefile $(SCRIPTS) $(GENIE)
linux_x64: generate $(PROJECTDIR)/gmake-linux/Makefile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/gmake-linux config=$(CONFIG)64
-.PHONY: linux
-linux: linux_x86
-
.PHONY: linux_x86
linux_x86: generate $(PROJECTDIR)/gmake-linux/Makefile
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/gmake-linux config=$(CONFIG)32
+.PHONY: linux
+linux: generate $(PROJECTDIR)/gmake-linux/Makefile
+ $(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/gmake-linux config=$(CONFIG)
+
#-------------------------------------------------
# gmake-linux-clang
#-------------------------------------------------
@@ -1042,8 +1109,12 @@ CPPCHECK_PARAMS += -Isrc/osd/modules/render
CPPCHECK_PARAMS += -Isrc/osd/windows
CPPCHECK_PARAMS += -Isrc/emu/cpu/m68000
CPPCHECK_PARAMS += -I3rdparty
+ifndef USE_SYSTEM_LIB_LUA
CPPCHECK_PARAMS += -I3rdparty/lua/src
+endif
+ifndef USE_SYSTEM_LIB_ZLIB
CPPCHECK_PARAMS += -I3rdparty/zlib
+endif
CPPCHECK_PARAMS += -I3rdparty/bgfx/include
CPPCHECK_PARAMS += -I3rdparty/bx/include
CPPCHECK_PARAMS += -Ibuild/generated/emu
@@ -1056,7 +1127,9 @@ CPPCHECK_PARAMS += -DMAME_DEBUG
CPPCHECK_PARAMS += -DMAME_PROFILER
CPPCHECK_PARAMS += -DCRLF=3
CPPCHECK_PARAMS += -DLSB_FIRST
+ifndef USE_SYSTEM_LIB_FLAC
CPPCHECK_PARAMS += -DFLAC__NO_DLL
+endif
CPPCHECK_PARAMS += -DNATIVE_DRC=drcbe_x64
CPPCHECK_PARAMS += -DLUA_COMPAT_APIINTCASTS
CPPCHECK_PARAMS += -DWIN32
diff --git a/nl_examples/congo_bongo.c b/nl_examples/congo_bongo.c
new file mode 100644
index 00000000000..d9f40c9859a
--- /dev/null
+++ b/nl_examples/congo_bongo.c
@@ -0,0 +1,450 @@
+#include "netlist/devices/net_lib.h"
+#include "netlist/devices/nld_system.h"
+#include "netlist/analog/nld_bjt.h"
+#include "netlist/analog/nld_twoterm.h"
+
+/* ----------------------------------------------------------------------------
+ * Library section header START
+ * ---------------------------------------------------------------------------*/
+
+#ifndef __PLIB_PREPROCESSOR__
+
+#define LM358_DIP(_name) \
+ NET_REGISTER_DEV_X(LM358_DIP, _name)
+
+#define G501534_DIP(_name) \
+ NET_REGISTER_DEV_X(G501534_DIP, _name)
+
+
+NETLIST_EXTERNAL(congob_lib)
+
+#endif
+
+/* ----------------------------------------------------------------------------
+ * Library section header END
+ * ---------------------------------------------------------------------------*/
+
+
+NETLIST_START(dummy)
+// EESCHEMA NETLIST VERSION 1.1 (SPICE FORMAT) CREATION DATE: WED 01 JUL 2015 11:09:25 PM CEST
+// TO EXCLUDE A COMPONENT FROM THE SPICE NETLIST ADD [SPICE_NETLIST_ENABLED] USER FIELD SET TO: N
+// TO REORDER THE COMPONENT SPICE NODE SEQUENCE ADD [SPICE_NODE_SEQUENCE] USER FIELD AND DEFINE SEQUENCE: 2,1,0
+// SHEET NAME:/
+// IGNORED O_AUDIO0: O_AUDIO0 64 0
+// .END
+
+ SOLVER(Solver, 24000)
+ PARAM(Solver.ACCURACY, 1e-7)
+ PARAM(Solver.NR_LOOPS, 90)
+ PARAM(Solver.SOR_FACTOR, 0.001)
+ PARAM(Solver.GS_LOOPS, 1)
+ //PARAM(Solver.GS_THRESHOLD, 99)
+ PARAM(Solver.ITERATIVE, "SOR")
+
+ LOCAL_SOURCE(congob_lib)
+ INCLUDE(congob_lib)
+
+ TTL_INPUT(I_BASS_DRUM0, 0)
+ //CLOCK(I_BASS_DRUM0, 2)
+ TTL_INPUT(I_CONGA_H0, 0)
+ //CLOCK(I_CONGA_H0, 2)
+ TTL_INPUT(I_CONGA_L0, 0)
+ //CLOCK(I_CONGA_L0, 2)
+ //TTL_INPUT(I_GORILLA0, 0)
+ CLOCK(I_GORILLA0, 2)
+ TTL_INPUT(I_RIM0, 0)
+ //CLOCK(I_RIM0, 2)
+
+ ALIAS(I_V0.Q, GND.Q)
+
+ ANALOG_INPUT(I_V12, 12)
+ ANALOG_INPUT(I_V5, 5)
+ ANALOG_INPUT(I_V6, 6)
+
+ /* temporary output stage */
+ RES(RO, RES_K(50))
+ CAP(CO, CAP_U(10))
+
+ NET_C(R94.1, CO.1)
+ NET_C(CO.2, RO.1)
+ NET_C(RO.2, GND)
+
+ // FIXME: Same as 1N4148
+ NET_MODEL(".model 1S2075 D(Is=2.52n Rs=.568 N=1.752 Cjo=4p M=.4 tt=20n Iave=200m Vpk=75)")
+ NET_MODEL(".model 2SC1941 NPN(IS=46.416f BF=210 NF=1.0022 VAF=600 IKF=500m ISE=60f NE=1.5 BR=2.0122 NR=1.0022 VAR=10G IKR=10G ISC=300p NC=2 RB=13.22 IRB=10G RBM=13.22 RE=100m RC=790m CJE=26.52p VJE=900m MJE=518m TF=1.25n XTF=10 VTF=10 ITF=500m PTF=0 CJC=4.89p VJC=750m MJC=237m XCJC=500m TR=100n CJS=0 VJS=750m MJS=500m XTB=1.5 EG=1.11 XTI=3 KF=0 AF=1 FC=500m)")
+
+ INCLUDE(CongoBongo_schematics)
+
+ /* The opamp actually has an FPF of about 500k. This doesn't work here and causes oscillations.
+ * FPF here therefore about half the Solver clock.
+ */
+ PARAM(XU16.B.model, "MB3614_SLOW")
+ PARAM(XU17.C.model, "MB3614_SLOW")
+
+ OPTIMIZE_FRONTIER(C51.1, RES_K(20), 50)
+ OPTIMIZE_FRONTIER(R77.2, RES_K(20), 50)
+
+ OPTIMIZE_FRONTIER(C25.2, RES_K(240), 50)
+ OPTIMIZE_FRONTIER(C29.2, RES_K(390), 50)
+ OPTIMIZE_FRONTIER(C37.2, RES_K(390), 50)
+ OPTIMIZE_FRONTIER(C44.2, RES_K(200), 50)
+
+ OPTIMIZE_FRONTIER(R90.2, RES_K(100), 50)
+ OPTIMIZE_FRONTIER(R92.2, RES_K(15), 50)
+
+NETLIST_END()
+
+NETLIST_START(CongoBongo_schematics)
+ CAP(C20, CAP_N(68))
+ CAP(C21, CAP_U(1))
+ CAP(C22, CAP_U(47))
+ CAP(C23, CAP_N(100))
+ CAP(C24, CAP_N(100))
+ CAP(C25, CAP_U(1))
+ CAP(C26, CAP_N(68))
+ CAP(C27, CAP_N(33))
+ CAP(C28, CAP_U(47))
+ CAP(C29, CAP_U(1))
+ CAP(C30, CAP_N(33))
+ CAP(C31, CAP_N(33))
+ CAP(C32, CAP_N(68))
+ CAP(C33, CAP_N(33))
+ CAP(C34, CAP_U(47))
+ CAP(C35, CAP_N(33))
+ CAP(C36, CAP_N(33))
+ CAP(C37, CAP_U(1))
+ CAP(C38, CAP_N(10))
+ CAP(C39, CAP_N(3.3))
+ CAP(C40, CAP_U(2.2))
+ CAP(C41, CAP_N(6.8))
+ CAP(C42, CAP_N(6.8))
+ CAP(C43, CAP_N(47))
+ CAP(C44, CAP_U(1))
+ CAP(C45, CAP_U(33))
+ CAP(C46, CAP_N(100))
+ CAP(C47, CAP_P(470))
+ CAP(C48, CAP_N(1.5))
+ CAP(C49, CAP_P(220))
+ CAP(C50, CAP_N(3.9))
+ CAP(C51, CAP_U(1))
+ CAP(C52, CAP_U(1))
+ CAP(C53, CAP_U(1))
+ CAP(C54, CAP_U(1))
+ CAP(C55, CAP_U(1))
+ CAP(C56, CAP_U(10))
+ CAP(C57, CAP_N(47))
+ CAP(C58, CAP_N(22))
+ CAP(C59, CAP_U(10))
+ CAP(C60, CAP_N(22))
+ CAP(C62, CAP_N(22))
+ CAP(C61, CAP_U(1))
+ DIODE(D1, "1S2075")
+ DIODE(D2, "1S2075")
+ DIODE(D3, "1S2075")
+ DIODE(D4, "1S2075")
+ DIODE(D5, "1S2075")
+ DIODE(D6, "1S2075")
+ DIODE(D7, "1S2075")
+ DIODE(D8, "1S2075")
+ QBJT_EB(Q2, "2SC1941")
+ RES(R21, RES_K(10))
+ RES(R22, RES_K(47))
+ RES(R23, RES_K(47))
+ RES(R24, RES_K(10))
+ RES(R25, RES_K(47))
+ RES(R26, RES_K(22))
+ RES(R27, RES_K(10))
+ RES(R28, RES_K(470))
+ RES(R29, RES_K(1))
+ RES(R30, RES_K(240))
+ RES(R31, RES_K(10))
+ RES(R32, RES_K(47))
+ RES(R33, RES_K(47))
+ RES(R34, RES_K(47))
+ RES(R35, RES_K(47))
+ RES(R36, RES_K(22))
+ RES(R37, RES_K(10))
+ RES(R38, RES_M(1))
+ RES(R39, 330)
+ RES(R40, RES_K(390))
+ RES(R41, RES_K(10))
+ RES(R42, RES_K(47))
+ RES(R43, RES_K(47))
+ RES(R44, RES_K(47))
+ RES(R45, RES_K(47))
+ RES(R46, RES_K(22))
+ RES(R47, RES_K(10))
+ RES(R48, RES_M(1))
+ RES(R49, 220)
+ RES(R50, RES_K(390))
+ RES(R51, RES_K(10))
+ RES(R52, RES_K(22))
+ RES(R53, RES_K(22))
+ RES(R54, RES_K(22))
+ RES(R55, RES_K(22))
+ RES(R56, RES_K(10))
+ RES(R57, RES_K(4.7))
+ RES(R58, RES_M(1))
+ RES(R59, 470)
+ RES(R60, RES_M(2.2))
+ RES(R61, RES_M(2.2))
+ RES(R62, RES_K(200))
+ RES(R63, RES_K(22))
+ RES(R64, RES_K(22))
+ RES(R65, RES_K(20))
+ RES(R66, RES_K(20))
+ RES(R67, RES_K(20))
+ RES(R68, RES_K(20))
+ RES(R69, RES_K(20))
+ RES(R70, RES_K(100))
+ RES(R71, RES_K(150))
+ RES(R72, RES_K(330))
+ RES(R73, RES_K(1))
+ RES(R74, RES_K(1))
+ RES(R75, RES_K(470))
+ RES(R76, RES_K(10))
+ RES(R77, RES_K(20))
+ RES(R78, RES_K(47))
+ RES(R79, RES_K(22))
+ RES(R80, RES_K(20))
+ RES(R81, RES_K(10))
+ RES(R82, RES_K(100))
+ RES(R83, RES_K(51))
+ RES(R84, RES_K(51))
+ RES(R85, RES_K(51))
+ RES(R86, RES_K(51))
+ RES(R87, RES_K(100))
+ RES(R88, RES_K(2.2))
+ RES(R89, RES_K(10))
+ RES(R90, RES_K(100))
+ RES(R91, RES_K(10))
+ RES(R92, RES_K(15))
+ RES(R93, RES_K(15))
+ RES(R94, RES_K(51))
+ MB3614_DIP(XU13)
+ G501534_DIP(XU15)
+ MB3614_DIP(XU16)
+ MB3614_DIP(XU17)
+ CD4001_DIP(XU18)
+ CD4538_DIP(XU19)
+ MM5837_DIP(XU20)
+ TTL_7416_DIP(XU6)
+
+ NET_C(D1.A, C21.2, R23.1)
+ NET_C(D1.K, C20.1, R22.1)
+ NET_C(XU13.1, C37.2, C36.1, R48.1)
+ NET_C(XU13.2, C35.2, R48.2)
+ NET_C(XU13.3, R44.1, R46.2, R45.1)
+ NET_C(XU13.4, R27.1, R21.1, R37.1, R31.1, R47.1, R41.1, R57.1, R51.1, C46.2, C45.2, XU17.4, R80.2, XU16.4, XU20.4, XU15.12, I_V12.Q)
+ NET_C(XU13.5, R54.1, R56.2, R55.1)
+ NET_C(XU13.6, C41.2, R58.2, R60.2)
+ NET_C(XU13.7, C44.2, C42.1, R58.1, R61.1)
+ NET_C(XU13.8, C29.2, C31.1, R38.1)
+ NET_C(XU13.9, C30.2, R38.2)
+ NET_C(XU13.10, R34.1, R36.2, R35.1)
+ NET_C(XU13.11, C22.2, R29.2, R25.2, R23.2, R22.2, XU6.1, XU6.3, XU6.7, C28.2, R39.2, R35.2, R33.2, R32.2, C34.2, R49.2, R45.2, R43.2, R42.2, C40.2, R59.2, R55.2, R53.2, R52.2, C43.2, R69.1, R64.1, C49.2, C48.2, C47.2, C46.1, C45.1, XU17.11, XU19.1, XU19.4, XU19.8, XU19.12, XU19.15, R81.1, C56.2, C55.2, C53.2, C52.2, XU18.1, XU18.2, XU18.7, XU18.12, XU18.13, C54.2, XU16.11, R84.1, R88.1, Q2.E, C58.2, C60.2, XU20.1, XU20.2, XU15.4, I_V0.Q)
+ NET_C(XU13.12, R24.1, R26.2, R25.1)
+ NET_C(XU13.13, C23.2, R28.2)
+ NET_C(XU13.14, C25.2, C24.1, R28.1)
+ NET_C(C25.1, R30.2)
+ NET_C(C24.2, C23.1, R29.1)
+ NET_C(C21.1, R24.2)
+ NET_C(C20.2, R21.2, XU6.8)
+ NET_C(C22.1, R27.2, R26.1)
+ NET_C(R30.1, R40.1, R50.1, R62.1, R94.1)
+ //NET_C(XU6.2, XU6.4, XU19.7, XU18.3, XU18.11, XU15.5, XU15.6, XU15.7, XU15.8, XU15.9, XU15.10, XU15.11, XU15.14)
+ NET_C(XU6.5, I_CONGA_L0.Q)
+ NET_C(XU6.6, C26.2, R31.2)
+ NET_C(XU6.9, I_BASS_DRUM0.Q)
+ NET_C(XU6.10, C38.2, R51.2)
+ NET_C(XU6.11, I_RIM0.Q)
+ NET_C(XU6.12, C32.2, R41.2)
+ NET_C(XU6.13, I_CONGA_H0.Q)
+ NET_C(XU6.14, D5.K, XU19.16, R70.2, R76.2, R71.2, XU18.14, I_V5.Q)
+ NET_C(D2.A, C27.2, R33.1)
+ NET_C(D2.K, C26.1, R32.1)
+ NET_C(C29.1, R40.2)
+ NET_C(C31.2, C30.1, R39.1)
+ NET_C(C27.1, R34.2)
+ NET_C(C28.1, R37.2, R36.1)
+ NET_C(D3.A, C33.2, R43.1)
+ NET_C(D3.K, C32.1, R42.1)
+ NET_C(C37.1, R50.2)
+ NET_C(C36.2, C35.1, R49.1)
+ NET_C(C33.1, R44.2)
+ NET_C(C34.1, R47.2, R46.1)
+ NET_C(D4.A, C39.2, R53.1)
+ NET_C(D4.K, C38.1, R52.1)
+ NET_C(C44.1, R62.2)
+ NET_C(C42.2, C41.1, R59.1)
+ NET_C(C39.1, R54.2)
+ NET_C(C40.1, R57.2, R56.1)
+ NET_C(R60.1, R61.2, C43.1)
+ NET_C(R63.1, R64.2, C47.1, D5.A, XU18.5, XU18.6)
+ NET_C(R63.2, XU20.3)
+ NET_C(R65.1, R66.2, C48.1)
+ NET_C(R65.2, XU18.4)
+ NET_C(R66.1, R67.2, C50.2)
+ NET_C(R67.1, C49.1, XU17.10)
+ NET_C(R68.1, R69.2, XU17.9)
+ NET_C(R68.2, C50.1, XU17.8, C51.1)
+ NET_C(XU17.1, XU16.6, C62.1)
+ NET_C(XU17.2, R82.1, C62.2, R85.2)
+ NET_C(XU17.3, R83.1, R84.2)
+ NET_C(XU17.5, C55.1, R72.1, R73.1)
+ NET_C(XU17.6, XU17.7, R77.2)
+ NET_C(XU17.12, R80.1, R81.2, C56.1)
+ NET_C(XU17.13, R78.1, R79.2, R77.1)
+ NET_C(XU17.14, R79.1, R82.2, R83.2)
+ NET_C(C51.2, R78.2)
+ NET_C(XU19.2, R70.1, C52.1)
+ NET_C(XU19.3, XU19.13, R76.1)
+ NET_C(XU19.5, XU19.11, I_GORILLA0.Q)
+ NET_C(XU19.6, XU18.9)
+ NET_C(XU19.9, XU18.8)
+ NET_C(XU19.10, D7.A, R75.2)
+ NET_C(XU19.14, R71.1, C53.1)
+ NET_C(R72.2, D6.A, XU18.10)
+ NET_C(R73.2, D6.K)
+ NET_C(D7.K, R74.2)
+ NET_C(R74.1, R75.1, C54.1, XU16.10)
+ NET_C(XU16.1, R91.1, R92.2)
+ NET_C(XU16.2, R90.1, R91.2)
+ NET_C(XU16.3, R86.2, I_V6.Q)
+ NET_C(XU16.5, R86.1, R87.2)
+ NET_C(XU16.7, R87.1, D8.A, R90.2)
+ NET_C(XU16.8, XU16.9, XU15.13)
+ NET_C(XU16.12, R93.1, C58.1)
+ NET_C(XU16.13, XU16.14, C57.1, C59.2)
+ NET_C(R85.1, Q2.C)
+ NET_C(R89.1, D8.K)
+ NET_C(R89.2, R88.2, Q2.B)
+ NET_C(R92.1, C57.2, R93.2)
+ NET_C(C59.1, XU15.1)
+ NET_C(C60.1, XU15.2)
+ NET_C(XU15.3, C61.2)
+ NET_C(C61.1, R94.2)
+NETLIST_END()
+
+NETLIST_START(opamp_mod)
+
+ /* Opamp model from
+ *
+ * http://www.ecircuitcenter.com/Circuits/opmodel1/opmodel1.htm
+ *
+ * MB3614 Unit Gain frequency is about 500 kHz and the first pole frequency
+ * about 5 Hz. We have to keep the Unity Gain Frequency below our sampling
+ * frequency of 24 Khz.
+ *
+ * Simple Opamp Model Calculation
+ *
+ * First Pole Frequency 5 Hz
+ * Unity Gain Frequency 11,000 Hz
+ * RP 100,000 Ohm
+ * DC Gain / Aol 2200
+ * CP 0.318 uF
+ * KG 0.022
+ *
+ */
+
+ /* Terminal definitions for calling netlists */
+
+ ALIAS(PLUS, G1.IP) // Positive input
+ ALIAS(MINUS, G1.IN) // Negative input
+ ALIAS(OUT, EBUF.OP) // Opamp output ...
+
+ AFUNC(fUH, 1, "A0 1.2 -")
+ AFUNC(fUL, 1, "A0 1.2 +")
+
+ ALIAS(VCC, fUH.A0) // VCC terminal
+ ALIAS(GND, fUL.A0) // VGND terminal
+
+ AFUNC(fVREF, 2, "A0 A1 + 0.5 *")
+ NET_C(fUH.A0, fVREF.A0)
+ NET_C(fUL.A0, fVREF.A1)
+
+ NET_C(EBUF.ON, fVREF)
+ /* The opamp model */
+
+ LVCCS(G1)
+ PARAM(G1.RI, RES_K(1000))
+#if 0
+ PARAM(G1.G, 0.0022)
+ RES(RP1, 1e6)
+ CAP(CP1, 0.0318e-6)
+#else
+ PARAM(G1.G, 0.002)
+ PARAM(G1.CURLIM, 0.002)
+ RES(RP1, 9.5e6)
+ CAP(CP1, 0.0033e-6)
+#endif
+ VCVS(EBUF)
+ PARAM(EBUF.RO, 50)
+ PARAM(EBUF.G, 1)
+
+ NET_C(G1.ON, fVREF)
+ NET_C(RP1.2, fVREF)
+ NET_C(CP1.2, fVREF)
+ NET_C(EBUF.IN, fVREF)
+
+ NET_C(RP1.1, G1.OP)
+ NET_C(CP1.1, RP1.1)
+
+ DIODE(DP,".model tt D(IS=1e-15 N=1)")
+ DIODE(DN,".model tt D(IS=1e-15 N=1)")
+#if 1
+ NET_C(DP.K, fUH.Q)
+ NET_C(fUL.Q, DN.A)
+ NET_C(DP.A, DN.K, RP1.1)
+#else
+ /*
+ * This doesn't add any performance by decreasing iteration loops.
+ * To the contrary, it significantly decreases iterations
+ */
+ RES(RH1, 0.1)
+ RES(RL1, 0.1)
+ NET_C(DP.K, RH1.1)
+ NET_C(RH1.2, fUH.Q)
+ NET_C(fUL.Q, RL1.1)
+ NET_C(RL1.2, DN.A)
+ NET_C(DP.A, DN.K, RP1.1)
+
+#endif
+ NET_C(EBUF.IP, RP1.1)
+
+NETLIST_END()
+
+
+NETLIST_START(G501534_DIP)
+ AFUNC(f, 2, "A0 A1 0.2 * *")
+
+ /*
+ * 12: VCC
+ * 4: GND
+ * 1: IN
+ * 3: OUT
+ * 13: CV
+ * 2: RDL - connected via Capacitor to ground
+ */
+
+ DUMMY_INPUT(DU1)
+ DUMMY_INPUT(DU2)
+ DUMMY_INPUT(DU3)
+
+ RES(RO, 1000)
+
+ ALIAS(12, DU1.I)
+ ALIAS(4, DU2.I)
+ ALIAS(2, DU3.I)
+ ALIAS(1, f.A0)
+ ALIAS(13, f.A1)
+ NET_C(f.Q, RO.1)
+ ALIAS(3, RO.2)
+
+NETLIST_END()
+
+NETLIST_START(congob_lib)
+
+ LOCAL_LIB_ENTRY(G501534_DIP)
+
+NETLIST_END()
diff --git a/nl_examples/kidniki.c b/nl_examples/kidniki.c
new file mode 100644
index 00000000000..dfe1b057e5e
--- /dev/null
+++ b/nl_examples/kidniki.c
@@ -0,0 +1,447 @@
+
+#include "netlist/devices/net_lib.h"
+#include "netlist/devices/nld_system.h"
+#include "netlist/analog/nld_bjt.h"
+
+#define USE_FRONTIERS 0
+#define USE_FIXED_STV 0
+
+NETLIST_START(dummy)
+ SOLVER(Solver, 12000)
+ PARAM(Solver.ACCURACY, 1e-7)
+ PARAM(Solver.NR_LOOPS, 300)
+ PARAM(Solver.GS_LOOPS, 23)
+ //PARAM(Solver.GS_THRESHOLD, 99) // Force Gaussian elimination here
+ PARAM(Solver.SOR_FACTOR, 1.05)
+ PARAM(Solver.ITERATIVE, "GMRES")
+ #if 0
+ //PARAM(Solver.SOR_FACTOR, 1)
+ PARAM(Solver.DYNAMIC_TS, 1)
+ PARAM(Solver.LTE, 1e-1)
+ #endif
+ //FIXME proper models!
+ NET_MODEL(".model 2SC945 NPN(Is=2.04f Xti=3 Eg=1.11 Vaf=6 Bf=400 Ikf=20m Xtb=1.5 Br=3.377 Rc=1 Cjc=1p Mjc=.3333 Vjc=.75 Fc=.5 Cje=25p Mje=.3333 Vje=.75 Tr=450n Tf=20n Itf=0 Vtf=0 Xtf=0 VCEO=45V ICrating=150M MFG=Toshiba)")
+ NET_MODEL(".model 1S1588 D(Is=2.52n Rs=.568 N=1.752 Cjo=4p M=.4 tt=20n Iave=200m Vpk=75 mfg=OnSemi type=silicon)")
+
+ //NET_C(R44.1, XU1.7)
+
+ /*
+ * Workaround: The simplified opamp model does not correctly
+ * model the internals of the inputs.
+ */
+
+ ANALOG_INPUT(VWORKAROUND, 2.061)
+ RES(RWORKAROUND, RES_K(27))
+ NET_C(VWORKAROUND.Q, RWORKAROUND.1)
+ NET_C(XU1.6, RWORKAROUND.2)
+
+ ANALOG_INPUT(I_V5, 5)
+ //ANALOG_INPUT(I_V0, 0)
+ ALIAS(I_V0.Q, GND)
+ #if 0
+ ANALOG_INPUT(I_SD0, 0)
+ ANALOG_INPUT(I_BD0, 0)
+ ANALOG_INPUT(I_CH0, 0)
+ ANALOG_INPUT(I_OH0, 0)
+ ANALOG_INPUT(I_SOUNDIC0, 0)
+ ANALOG_INPUT(I_OKI0, 0)
+ ANALOG_INPUT(I_SOUND0, 0)
+ ANALOG_INPUT(I_SINH0, 0)
+ #else
+ TTL_INPUT(I_SD0, 1)
+ //CLOCK(I_SD0, 5)
+ TTL_INPUT(I_BD0, 1)
+ //CLOCK(I_BD0, 5)
+ TTL_INPUT(I_CH0, 1)
+ //CLOCK(I_CH0, 5 )
+ //TTL_INPUT(I_OH0, 1)
+ CLOCK(I_OH0, 5)
+ TTL_INPUT(I_SOUNDIC0, 1)
+ ANALOG_INPUT(I_MSM2K0, 0)
+ ANALOG_INPUT(I_MSM3K0, 0)
+ TTL_INPUT(I_SOUND0, 1)
+ TTL_INPUT(I_SINH0, 1)
+ #endif
+
+ INCLUDE(kidniki_schematics)
+
+ #if (USE_FRONTIERS)
+ OPTIMIZE_FRONTIER(C63.2, RES_K(27), RES_K(1))
+ OPTIMIZE_FRONTIER(R31.2, RES_K(5.1), 50)
+ OPTIMIZE_FRONTIER(R29.2, RES_K(2.7), 50)
+ #endif
+
+NETLIST_END()
+
+NETLIST_START(kidniki_schematics)
+ // EESCHEMA NETLIST VERSION 1.1 (SPICE FORMAT) CREATION DATE: SAT 06 JUN 2015 01:06:26 PM CEST
+ // TO EXCLUDE A COMPONENT FROM THE SPICE NETLIST ADD [SPICE_NETLIST_ENABLED] USER FIELD SET TO: N
+ // TO REORDER THE COMPONENT SPICE NODE SEQUENCE ADD [SPICE_NODE_SEQUENCE] USER FIELD AND DEFINE SEQUENCE: 2,1,0
+ // SHEET NAME:/
+ // IGNORED O_AUDIO0: O_AUDIO0 49 0
+ // .END
+
+ CAP(C200, CAP_N(100))
+ CAP(C28, CAP_U(1))
+ CAP(C31, CAP_N(470))
+ CAP(C32, CAP_N(3.3))
+ CAP(C33, CAP_U(1))
+ CAP(C34, CAP_N(1))
+ CAP(C35, CAP_N(1))
+ CAP(C36, CAP_N(6.5))
+ CAP(C37, CAP_N(22))
+ CAP(C38, CAP_N(1))
+ CAP(C39, CAP_N(1))
+ CAP(C40, CAP_P(12))
+ CAP(C41, CAP_U(1))
+ CAP(C42, CAP_N(1.2))
+ CAP(C43, CAP_N(1.2))
+ CAP(C44, CAP_U(1))
+ CAP(C45, CAP_N(22))
+ CAP(C47, CAP_U(1))
+ CAP(C48, CAP_N(470))
+ CAP(C49, CAP_N(3.3))
+ CAP(C50, CAP_N(22))
+ CAP(C51, CAP_N(22))
+ CAP(C52, CAP_N(27))
+ CAP(C53, CAP_N(27))
+ CAP(C56, CAP_N(6.8))
+ CAP(C57, CAP_N(6.8))
+ CAP(C59, CAP_N(6.8))
+ CAP(C60, CAP_N(22))
+ CAP(C61, CAP_N(22))
+ CAP(C62, CAP_N(6.8))
+ CAP(C63, CAP_N(1))
+ CAP(C64, CAP_N(68))
+ CAP(C65, CAP_N(68))
+ CAP(C66, CAP_N(68))
+ CAP(C67, CAP_N(15))
+ CAP(C68, CAP_N(15))
+ CAP(C69, CAP_N(10))
+ CAP(C70, CAP_N(22))
+ CAP(C72, CAP_N(12))
+ CAP(C73, CAP_N(10))
+ CAP(C76, CAP_N(68))
+ CAP(C77, CAP_N(12))
+
+ DIODE(D3, "1S1588")
+ DIODE(D4, "1S1588")
+ DIODE(D5, "1S1588")
+
+ POT(RV1, RES_K(50))
+
+ QBJT_EB(Q10, "2SC945")
+ QBJT_EB(Q3, "2SC945")
+ QBJT_EB(Q4, "2SC945")
+ QBJT_EB(Q5, "2SC945")
+ QBJT_EB(Q6, "2SC945")
+ QBJT_EB(Q7, "2SC945")
+ QBJT_EB(Q9, "2SC945")
+
+ SUBMODEL(LM324_DIP,XU1)
+ SUBMODEL(LM358_DIP,XU2)
+
+ TTL_7404_DIP(XU3)
+
+ RES(R100, RES_K(560))
+ RES(R101, RES_K(150))
+ RES(R102, RES_K(150))
+ RES(R103, RES_K(470))
+ RES(R104, RES_K(22))
+ RES(R105, RES_K(470))
+ RES(R106, RES_K(150))
+ RES(R107, RES_K(150))
+ RES(R108, RES_K(560))
+ RES(R119, RES_K(22))
+ RES(R200, RES_K(100))
+ RES(R201, RES_K(100))
+ RES(R27, RES_K(6.8))
+ RES(R28, RES_K(150))
+ RES(R29, RES_K(2.7))
+ RES(R30, RES_K(10))
+ RES(R31, RES_K(5.1))
+ RES(R32, RES_K(4.7))
+ RES(R34, RES_K(100))
+ RES(R35, RES_K(100))
+ RES(R36, RES_K(100))
+ RES(R37, RES_K(47))
+ RES(R38, 820)
+ RES(R39, RES_K(22))
+ RES(R40, RES_K(10))
+ RES(R41, RES_K(10))
+ RES(R42, RES_K(150))
+ RES(R43, 470)
+ RES(R44, RES_K(100))
+ RES(R45, RES_K(1))
+ RES(R46, RES_K(12))
+ RES(R48, 470)
+ RES(R48_2, RES_K(100))
+ RES(R49, RES_K(10))
+ RES(R50, RES_K(22))
+ RES(R51, RES_K(150))
+ RES(R52, RES_K(100))
+ RES(R53, RES_K(100))
+ RES(R54, RES_K(680))
+ RES(R55, RES_K(510))
+ RES(R57, 560)
+ RES(R58, RES_K(39))
+ RES(R59, 560)
+ RES(R60, RES_K(39))
+ RES(R61, RES_K(100))
+ RES(R62, RES_K(100))
+ RES(R63, RES_K(1))
+ RES(R65, RES_K(1))
+ RES(R65_1, RES_K(27))
+ RES(R66, RES_M(1))
+ RES(R67, RES_K(100))
+ RES(R68, RES_K(100))
+ RES(R69, RES_K(1))
+ RES(R70, RES_K(10))
+ RES(R71, RES_K(100))
+ RES(R72, RES_K(100))
+ RES(R73, RES_K(10))
+ RES(R74, RES_K(10))
+ RES(R75, RES_K(10))
+ RES(R76, RES_K(10))
+ RES(R81, 220)
+ RES(R82, RES_M(2.2))
+ RES(R83, RES_K(12))
+ RES(R84, RES_K(1))
+ RES(R85, RES_M(2.2))
+ RES(R86, RES_K(10))
+ RES(R87, RES_K(68))
+ RES(R89, RES_K(22))
+ RES(R90, RES_K(390))
+ RES(R91, RES_K(100))
+ RES(R92, RES_K(22))
+ RES(R93, RES_K(1))
+ RES(R94, RES_K(22))
+ RES(R95, RES_K(330))
+ RES(R96, RES_K(150))
+ RES(R97, RES_K(150))
+ RES(R98, RES_K(650))
+
+ #if USE_FIXED_STV
+ ANALOG_INPUT(STV, 2)
+ #else
+ RES(R78, RES_K(3.3))
+ RES(R77, RES_K(2.2))
+ CAP(C58, CAP_U(47))
+ #endif
+
+ NET_C(R95.1, XU3.2, R96.2)
+ NET_C(R95.2, XU3.1, C69.1)
+ NET_C(XU3.3, R103.2, C73.1)
+ NET_C(XU3.4, R103.1, R102.2)
+ NET_C(XU3.5, R105.2, C72.1)
+ NET_C(XU3.6, R105.1, R106.2)
+ #if USE_FIXED_STV
+ //FIXME: We should have a NET_C_REMOVE
+ NET_C(/*XU3.7,*/ C69.2, C73.2, C72.2, C77.2, C67.2, C68.2, R65.2, R38.2, XU1.11, R54.2, Q4.E, R63.2, C47.2, R72.2, R67.2, R71.2, R68.2, C48.2, R46.2, C28.1, C32.1, R43.2, XU2.4, C56.1, C52.1,/* R77.2, C58.1, */ R48.2, R93.2, R94.2, R119.2, R104.2, R53.2, R34.2, R81.2, R92.2, R89.2, C33.1, R37.2, R36.1, R91.1, I_V0.Q, RV1.3)
+ #else
+ NET_C(/*XU3.7,*/ C69.2, C73.2, C72.2, C77.2, C67.2, C68.2, R65.2, R38.2, XU1.11, R54.2, Q4.E, R63.2, C47.2, R72.2, R67.2, R71.2, R68.2, C48.2, R46.2, C28.1, C32.1, R43.2, XU2.4, C56.1, C52.1, R77.2, C58.1, R48.2, R93.2, R94.2, R119.2, R104.2, R53.2, R34.2, R81.2, R92.2, R89.2, C33.1, R37.2, R36.1, R91.1, I_V0.Q, RV1.3)
+ #endif
+ NET_C(XU3.8, R108.1, R107.2)
+ NET_C(XU3.9, R108.2, C77.1)
+ NET_C(XU3.10, R100.1, R101.2)
+ NET_C(XU3.11, R100.2, C67.1)
+ NET_C(XU3.12, R98.1, R97.2)
+ NET_C(XU3.13, R98.2, C68.1)
+ #if USE_FIXED_STV
+ NET_C(/*XU3.14,*/ XU1.4, R66.1, R70.1, Q6.C, Q5.C, XU2.8, /* R78.1, */ R86.1, R83.1, Q3.C, I_V5.Q)
+ #else
+ NET_C(/*XU3.14,*/ XU1.4, R66.1, R70.1, Q6.C, Q5.C, XU2.8, R78.1, R86.1, R83.1, Q3.C, I_V5.Q)
+ #endif
+ NET_C(R96.1, R102.1, R106.1, R107.1, R101.1, R97.1, R65.1, C63.2)
+ NET_C(C63.1, R65_1.2)
+ NET_C(R65_1.1, R44.2, C38.2, C40.2, XU1.6)
+ #if USE_FIXED_STV
+ NET_C(R30.1, R41.1, R40.1, STV, R76.2, /* R78.2, R77.1, C58.2*/ STV)
+ #else
+ NET_C(R30.1, R41.1, R40.1, R76.2, R78.2, R77.1, C58.2)
+ #endif
+ NET_C(R30.2, XU1.5)
+ NET_C(R44.1, C39.1, C40.1, R48_2.2)
+ NET_C(C38.1, C39.2, R38.1)
+ NET_C(XU1.1, XU1.2, R39.1, R32.2)
+ NET_C(XU1.3, C34.1, R41.2)
+ NET_C(XU1.7, R45.2)
+ NET_C(XU1.8, XU1.9, R31.2, C36.2)
+ NET_C(XU1.10, R42.1, C32.2)
+ NET_C(XU1.12, C49.1, C31.1, R40.2, C61.1, C60.1)
+ NET_C(XU1.13, R27.1, R28.2)
+ NET_C(XU1.14, R28.1, R29.2, I_SINH0.Q)
+ NET_C(R48_2.1, C45.2, R54.1)
+ NET_C(C45.1, R55.1, Q7.B)
+ NET_C(R55.2, R90.2, C33.2, R37.1, Q3.E)
+ NET_C(R45.1, C44.2)
+ NET_C(C44.1, R66.2, Q4.B)
+ NET_C(Q4.C, C42.1, C43.1, R46.1, C35.2, D4.K, D5.K)
+ NET_C(R70.2, R69.2, Q7.C)
+ NET_C(R63.1, Q7.E)
+ NET_C(R69.1, C49.2)
+ NET_C(C42.2, R58.1, D5.A)
+ NET_C(R58.2, R57.1, C47.1)
+ NET_C(R57.2, Q6.E)
+ NET_C(Q6.B, R61.1)
+ NET_C(C50.1, R67.1, R61.2)
+ NET_C(C50.2, R72.1, I_OH0.Q)
+ NET_C(C51.1, R68.1, R62.2)
+ NET_C(C51.2, R71.1, I_CH0.Q)
+ NET_C(R62.1, Q5.B)
+ NET_C(Q5.E, R59.2)
+ NET_C(R60.1, C43.2, D4.A)
+ NET_C(R60.2, R59.1, C48.1)
+ NET_C(C35.1, C34.2, R39.2)
+ NET_C(R32.1, C31.2)
+ NET_C(R27.2, C28.2)
+ NET_C(R29.1, R31.1, R50.2, R49.1, RV1.1)
+ NET_C(R42.2, R51.1, C36.1)
+ NET_C(R51.2, C41.1)
+ NET_C(C41.2, R43.1, I_SOUNDIC0.Q)
+ NET_C(XU2.1, XU2.2, R73.1)
+ NET_C(XU2.3, R76.1, C200.2)
+ NET_C(XU2.5, C56.2, R75.1)
+ NET_C(XU2.6, XU2.7, R50.1, C53.2)
+ NET_C(R75.2, R74.1, C53.1)
+ NET_C(R74.2, C52.2, R73.2)
+ NET_C(R49.2, R48.1, I_SOUND0.Q)
+ NET_C(Q9.E, R81.1)
+ NET_C(Q9.C, R84.2, R83.2, R82.1, C59.1)
+ NET_C(Q9.B, R82.2, C62.1)
+ NET_C(Q10.E, R93.1)
+ NET_C(Q10.C, R87.2, R86.2, R85.1, C76.1)
+ NET_C(Q10.B, R85.2, C64.1)
+ NET_C(R84.1, C61.2)
+ NET_C(C60.2, R87.1)
+ NET_C(C64.2, C65.1, R94.1, D3.K)
+ NET_C(C65.2, C66.1, R119.1)
+ NET_C(C66.2, C76.2, R104.1)
+ NET_C(R53.1, R52.2, C37.1)
+ NET_C(R34.1, C37.2, I_BD0.Q)
+ NET_C(R52.1, D3.A)
+ NET_C(R92.1, C62.2, C57.1)
+ NET_C(R89.1, C57.2, C59.2, R90.1)
+ NET_C(Q3.B, R35.1)
+ NET_C(R35.2, R36.2, C70.1)
+ NET_C(R91.2, C70.2, I_SD0.Q)
+ NET_C(I_MSM3K0.Q, R200.2)
+ NET_C(I_MSM2K0.Q, R201.2)
+ NET_C(R200.1, R201.1, C200.1)
+NETLIST_END()
+
+NETLIST_START(opamp)
+
+ /* Opamp model from
+ *
+ * http://www.ecircuitcenter.com/Circuits/opmodel1/opmodel1.htm
+ *
+ * Bandwidth 1Mhz
+ *
+ */
+
+ /* Terminal definitions for calling netlists */
+
+ ALIAS(PLUS, G1.IP) // Positive input
+ ALIAS(MINUS, G1.IN) // Negative input
+ ALIAS(OUT, EBUF.OP) // Opamp output ...
+
+ ALIAS(GND, EBUF.ON) // GND terminal
+ ALIAS(VCC, DUMMY.I) // VCC terminal
+ DUMMY_INPUT(DUMMY)
+
+ /* The opamp model */
+
+ VCCS(G1)
+ PARAM(G1.RI, RES_K(1000))
+#if 1
+ PARAM(G1.G, 100) // typical OP-AMP amplification 100 * 1000 = 100000
+ RES(RP1, 1000)
+ CAP(CP1, 1.59e-5) // <== change to 1.59e-3 for 10Khz bandwidth
+#else
+ PARAM(G1.G, 1) // typical OP-AMP amplification 100 * 1000 = 100000
+ RES(RP1, 100000)
+ CAP(CP1, 1.59e-7) // <== change to 1.59e-3 for 10Khz bandwidth
+#endif
+ VCVS(EBUF)
+ PARAM(EBUF.RO, 50)
+ PARAM(EBUF.G, 1)
+
+// PARAM(EBUF.RI, 1e20)
+// NET_C(EBUF.ON, GND)
+
+ NET_C(G1.ON, GND)
+ NET_C(RP1.2, GND)
+ NET_C(CP1.2, GND)
+ NET_C(EBUF.IN, GND)
+
+ NET_C(RP1.1, G1.OP)
+ NET_C(CP1.1, RP1.1)
+
+ DIODE(DP,"1N914")
+ DIODE(DN,"1N914")
+
+ NET_C(DP.K, VCC)
+#if 1
+ NET_C(DP.A, DN.K, RP1.1)
+#else
+ RES(RDP, 1000)
+ RES(RDN, 1000)
+ NET_C(RDP.1, DP.A)
+ NET_C(RDN.1, DN.K)
+ NET_C(RDP.2, RDN.2, RP1.1)
+#endif
+ NET_C(DN.A, GND)
+
+ NET_C(EBUF.IP, RP1.1)
+
+NETLIST_END()
+
+NETLIST_START(LM324_DIP)
+ SUBMODEL(opamp, op1)
+ SUBMODEL(opamp, op2)
+ SUBMODEL(opamp, op3)
+ SUBMODEL(opamp, op4)
+
+ ALIAS( 1, op1.OUT)
+ ALIAS( 2, op1.MINUS)
+ ALIAS( 3, op1.PLUS)
+
+ ALIAS( 7, op2.OUT)
+ ALIAS( 6, op2.MINUS)
+ ALIAS( 5, op2.PLUS)
+
+ ALIAS( 8, op3.OUT)
+ ALIAS( 9, op3.MINUS)
+ ALIAS(10, op3.PLUS)
+
+ ALIAS(14, op4.OUT)
+ ALIAS(13, op4.MINUS)
+ ALIAS(12, op4.PLUS)
+
+ NET_C(op1.GND, op2.GND, op3.GND, op4.GND)
+ NET_C(op1.VCC, op2.VCC, op3.VCC, op4.VCC)
+
+ ALIAS(11, op1.GND)
+ ALIAS( 4, op1.VCC)
+NETLIST_END()
+
+NETLIST_START(LM358_DIP)
+ SUBMODEL(opamp, op1)
+ SUBMODEL(opamp, op2)
+
+ ALIAS( 1, op1.OUT)
+ ALIAS( 2, op1.MINUS)
+ ALIAS( 3, op1.PLUS)
+
+ ALIAS( 7, op2.OUT)
+ ALIAS( 6, op2.MINUS)
+ ALIAS( 5, op2.PLUS)
+
+
+ NET_C(op1.GND, op2.GND)
+ NET_C(op1.VCC, op2.VCC)
+
+ ALIAS( 4, op1.GND)
+ ALIAS( 8, op1.VCC)
+NETLIST_END()
diff --git a/nl_examples/mm5837_noise.c b/nl_examples/mm5837_noise.c
new file mode 100644
index 00000000000..7afe2b6e54d
--- /dev/null
+++ b/nl_examples/mm5837_noise.c
@@ -0,0 +1,36 @@
+/*
+ * mm5837_noise.c
+ *
+ */
+
+#include "netlist/devices/net_lib.h"
+
+NETLIST_START(ne555_astable)
+
+ /*
+ * Astable ne555
+ *
+ */
+
+ /* Standard stuff */
+
+ SOLVER(Solver, 48000)
+
+ ANALOG_INPUT(V12, 12) // 5V
+
+ /* Wiring up the ne555 */
+
+ // astable NE555, 1.13 ms period
+
+ MM5837_DIP(NOISE)
+
+ RES(R, 10000)
+
+ NET_C(NOISE.1, NOISE.2, R.2, GND)
+ NET_C(NOISE.4, V12)
+
+ NET_C(NOISE.3, R.1)
+
+ LOG(log3, NOISE.3)
+
+NETLIST_END()
diff --git a/nl_examples/opamp.c b/nl_examples/opamp.c
index 0073ddb35b0..ce347c21c64 100644
--- a/nl_examples/opamp.c
+++ b/nl_examples/opamp.c
@@ -11,19 +11,27 @@ NETLIST_START(main)
/* Standard stuff */
CLOCK(clk, 1000) // 1000 Hz
- SOLVER(Solver, 48000)
- //PARAM(Solver.ACCURACY, 1e-3)
+ SOLVER(Solver, 480000)
+ PARAM(Solver.ACCURACY, 1e-10)
+ PARAM(Solver.NR_LOOPS, 30000 )
//PARAM(Solver.CONVERG, 1.0)
- //PARAM(Solver.GS_LOOPS, 30)
+ PARAM(Solver.GS_LOOPS, 30)
+ PARAM(Solver.GS_THRESHOLD, 99)
+
+ // Tie up +5 to opamps thought it's not currently needed
+ // Stay compatible
+ ANALOG_INPUT(V5, 5)
+ NET_C(op.VCC, V5)
+ NET_C(op1.VCC, V5)
/* Opamp wired as impedance changer */
- SUBMODEL(op, opamp)
+ SUBMODEL(opamp, op)
NET_C(op.GND, GND)
NET_C(op.PLUS, clk)
NET_C(op.MINUS, op.OUT)
- SUBMODEL(op1, opamp)
+ SUBMODEL(opamp, op1)
/* Wired as inverting amplifier connected to output of first opamp */
RES(R1, 100000)
@@ -42,7 +50,7 @@ NETLIST_START(main)
NET_C(RL.1, op1.OUT)
LOG(logX, op1.OUT)
- //LOG(logY, clk)
+ LOG(logY, clk)
NETLIST_END()
NETLIST_START(opamp)
@@ -62,13 +70,16 @@ NETLIST_START(opamp)
ALIAS(OUT, EBUF.OP) // Opamp output ...
ALIAS(GND, EBUF.ON) // GND terminal
+ ALIAS(VCC, DUMMY.I) // VCC terminal
+ DUMMY_INPUT(DUMMY)
/* The opamp model */
- VCCS(G1)
- PARAM(G1.G, 100) // typical OP-AMP amplification 100 * 1000 = 100000
- RES(RP1, 1000)
- CAP(CP1, 1.59e-6) // <== change to 1.59e-3 for 10Khz bandwidth
+ LVCCS(G1)
+ PARAM(G1.G, 0.0021)
+ PARAM(G1.CURLIM, 0.002)
+ RES(RP1, 1e7)
+ CAP(CP1, 0.00333e-6)
VCVS(EBUF)
PARAM(EBUF.RO, 50)
PARAM(EBUF.G, 1)
diff --git a/nl_examples/vs_cs.c b/nl_examples/vs_cs.c
new file mode 100644
index 00000000000..4e6bb9615fe
--- /dev/null
+++ b/nl_examples/vs_cs.c
@@ -0,0 +1,50 @@
+/*
+ * vs_cs.c
+ *
+ * Voltage and current source test
+ *
+ */
+
+#include "netlist/devices/net_lib.h"
+
+NETLIST_START(rc)
+
+ /*
+ * delay circuit
+ *
+ */
+
+ /* Standard stuff */
+
+ SOLVER(Solver, 48000)
+ PARAM(Solver.ACCURACY, 1e-6)
+ CLOCK(clk, 20000)
+
+ /* Voltage source. Inner resistance will make clock visible */
+
+ RES(R1, 1000)
+ VS(VS1, 1)
+ NET_C(R1.1, clk)
+ NET_C(R1.2, VS1.P)
+ NET_C(GND, VS1.N)
+
+ /* Current source. Current flows from "+" to "-", thus for a source we
+ * need negative current
+ */
+
+ RES(R2, 1000)
+ RES(R3, 1000)
+ CS(CS1, -0.001)
+ NET_C(CS1.P, R2.1)
+ NET_C(R2.2, R3.1)
+ NET_C(GND, CS1.N, R3.2)
+
+ CAP(C1, CAP_U(1))
+ NET_C(C1.1, R3.1)
+ NET_C(C1.2, R3.2)
+
+
+ LOG(tt, VS1.P)
+ LOG(tx, R2.2)
+
+NETLIST_END()
diff --git a/scripts/genie.lua b/scripts/genie.lua
index 356d4d8d3dc..cfe0efeff9e 100644
--- a/scripts/genie.lua
+++ b/scripts/genie.lua
@@ -99,6 +99,41 @@ newoption {
}
newoption {
+ trigger = 'with-bundled-zlib',
+ description = 'Build bundled Zlib library',
+}
+
+newoption {
+ trigger = 'with-bundled-jpeg',
+ description = 'Build bundled JPEG library',
+}
+
+newoption {
+ trigger = 'with-bundled-flac',
+ description = 'Build bundled FLAC library',
+}
+
+newoption {
+ trigger = 'with-bundled-lua',
+ description = 'Build bundled LUA library',
+}
+
+newoption {
+ trigger = 'with-bundled-sqlite3',
+ description = 'Build bundled SQLite library',
+}
+
+newoption {
+ trigger = 'with-bundled-portmidi',
+ description = 'Build bundled PortMidi library',
+}
+
+newoption {
+ trigger = 'with-bundled-portaudio',
+ description = 'Build bundled PortAudio library',
+}
+
+newoption {
trigger = "distro",
description = "Choose distribution",
allowed = {
@@ -169,6 +204,11 @@ newoption {
}
newoption {
+ trigger = "OPT_FLAGS",
+ description = "OPT_FLAGS.",
+}
+
+newoption {
trigger = "LDOPTS",
description = "Additional linker options",
}
@@ -311,6 +351,26 @@ newoption {
}
+newoption {
+ trigger = "SHLIB",
+ description = "Generate shared libs.",
+ allowed = {
+ { "0", "Static libs" },
+ { "1", "Shared libs" },
+ }
+}
+
+newoption {
+ trigger = "DRIVERS",
+ description = "List of drivers to compile.",
+}
+
+if _OPTIONS["SHLIB"]=="1" then
+ LIBTYPE = "SharedLib"
+else
+ LIBTYPE = "StaticLib"
+end
+
PYTHON = "python"
if _OPTIONS["PYTHON_EXECUTABLE"]~=nil then
@@ -438,11 +498,16 @@ msgarchiving ("Archiving $(notdir $@)...")
messageskip { "SkipCreatingMessage", "SkipBuildingMessage", "SkipCleaningMessage" }
-if (not os.isfile(path.join("target", _OPTIONS["target"],_OPTIONS["subtarget"] .. ".lua"))) then
- error("File definition for TARGET=" .. _OPTIONS["target"] .. " SUBTARGET=" .. _OPTIONS["subtarget"] .. " does not exist")
+if (_OPTIONS["DRIVERS"] == nil) then
+ if (not os.isfile(path.join("target", _OPTIONS["target"],_OPTIONS["subtarget"] .. ".lua"))) then
+ error("File definition for TARGET=" .. _OPTIONS["target"] .. " SUBTARGET=" .. _OPTIONS["subtarget"] .. " does not exist")
+ end
+ dofile (path.join("target", _OPTIONS["target"],_OPTIONS["subtarget"] .. ".lua"))
+else
+ OUT_STR = os.outputof( PYTHON .. " " .. MAME_DIR .. "src/build/makedep.py " .. MAME_DIR .. " " .. _OPTIONS["DRIVERS"] .. " target " .. _OPTIONS["subtarget"])
+ load(OUT_STR)()
+ os.outputof( PYTHON .. " " .. MAME_DIR .. "src/build/makedep.py " .. MAME_DIR .. " " .. _OPTIONS["DRIVERS"] .. " drivers " .. _OPTIONS["subtarget"] .. " > ".. GEN_DIR .. _OPTIONS["target"] .. "/" .. _OPTIONS["subtarget"].."/drivlist.c")
end
-dofile (path.join("target", _OPTIONS["target"],_OPTIONS["subtarget"] .. ".lua"))
-
configuration { "gmake" }
flags {
"SingleOutputDir",
@@ -576,9 +641,29 @@ else
end
-- need to ensure FLAC functions are statically linked
-defines {
- "FLAC__NO_DLL",
-}
+if _OPTIONS["with-bundled-flac"] then
+ defines {
+ "FLAC__NO_DLL",
+ }
+ end
+
+if not _OPTIONS["with-bundled-jpeg"] then
+ defines {
+ "USE_SYSTEM_JPEGLIB",
+ }
+ end
+
+if not _OPTIONS["with-bundled-portmidi"] then
+ defines {
+ "USE_SYSTEM_PORTMIDI",
+ }
+ end
+
+if not _OPTIONS["with-bundled-sqlite3"] then
+ defines {
+ "USE_SYSTEM_SQLITE",
+ }
+ end
if _OPTIONS["NOASM"]=="1" then
defines {
@@ -650,7 +735,7 @@ end
}
end
-- add -g if we need symbols, and ensure we have frame pointers
-if _OPTIONS["SYMBOLS"]~=nil then
+if _OPTIONS["SYMBOLS"]~=nil and _OPTIONS["SYMBOLS"]~="0" then
buildoptions {
"-g" .. _OPTIONS["SYMLEVEL"],
"-fno-omit-frame-pointer",
@@ -695,7 +780,7 @@ if _OPTIONS["PROFILE"] then
}
end
-if _OPTIONS["SYMBOLS"]~=nil then
+if _OPTIONS["SYMBOLS"]~=nil and _OPTIONS["SYMBOLS"]~="0" then
flags {
"Symbols",
}
@@ -724,8 +809,13 @@ if _OPTIONS["OPTIMIZE"] then
_OPTIONS["ARCHOPTS"]
}
end
+ if _OPTIONS["OPT_FLAGS"] then
+ buildoptions {
+ _OPTIONS["OPT_FLAGS"]
+ }
+ end
if _OPTIONS["LTO"]=="1" then
--- -flto=4 -> 4 threads
+-- -flto=4 -> 4 threads, reduce if you are low on memory (less than 8G)
buildoptions {
"-flto=4",
}
@@ -743,9 +833,16 @@ if _OPTIONS["OPTIMIZE"] then
end
end
+if _OPTIONS["SHLIB"] then
+ buildoptions {
+ "-fPIC"
+ }
+end
+
if _OPTIONS["SSE2"]=="1" then
buildoptions {
- "-msse2",
+ "-msse",
+ "-msse2"
}
end
@@ -842,6 +939,7 @@ end
end
if (version >= 30400) then
buildoptions {
+ "-Wno-inline-new-delete",
"-Wno-constant-logical-operand",
}
end
@@ -873,7 +971,6 @@ end
if (version >= 40800) then
-- array bounds checking seems to be buggy in 4.8.1 (try it on video/stvvdp1.c and video/model1.c without -Wno-array-bounds)
buildoptions {
- "-Wno-unused-variable",
"-Wno-array-bounds"
}
end
diff --git a/scripts/src/3rdparty.lua b/scripts/src/3rdparty.lua
index bba91c7835e..889a6737cd5 100644
--- a/scripts/src/3rdparty.lua
+++ b/scripts/src/3rdparty.lua
@@ -34,6 +34,7 @@ end
-- zlib library objects
--------------------------------------------------
+if _OPTIONS["with-bundled-zlib"] then
project "zlib"
uuid "3d78bd2a-2bd0-4449-8087-42ddfaef7ec9"
kind "StaticLib"
@@ -71,6 +72,11 @@ project "zlib"
"-Wshadow"
}
end
+else
+links {
+ "z",
+}
+end
--------------------------------------------------
-- SoftFloat library objects
@@ -112,6 +118,7 @@ project "softfloat"
-- libJPEG library objects
--------------------------------------------------
+if _OPTIONS["with-bundled-jpeg"] then
project "jpeg"
uuid "447c6800-dcfd-4c48-b72a-a8223bb409ca"
kind "StaticLib"
@@ -169,11 +176,17 @@ project "jpeg"
"-Wshadow"
}
end
+else
+links {
+ "jpeg",
+}
+end
--------------------------------------------------
-- libflac library objects
--------------------------------------------------
+if _OPTIONS["with-bundled-flac"] then
project "flac"
uuid "b6fc19e8-073a-4541-bb7b-d24b548d424a"
kind "StaticLib"
@@ -223,6 +236,11 @@ project "flac"
"-Wshadow"
}
end
+else
+links {
+ "FLAC",
+}
+end
--------------------------------------------------
-- lib7z library objects
@@ -268,6 +286,7 @@ project "7z"
-- LUA library objects
--------------------------------------------------
+if _OPTIONS["with-bundled-lua"] then
project "lua"
uuid "d9e2eed1-f1ab-4737-a6ac-863700b1a5a9"
kind "StaticLib"
@@ -342,6 +361,11 @@ project "lua"
"-Wshadow"
}
end
+else
+links {
+ "lua",
+}
+end
--------------------------------------------------
-- sqlite3 lua library objects
@@ -362,8 +386,12 @@ project "lsqlite3"
includedirs {
MAME_DIR .. "3rdparty",
- MAME_DIR .. "3rdparty/lua/src",
}
+ if _OPTIONS["with-bundled-lua"] then
+ includedirs {
+ MAME_DIR .. "3rdparty/lua/src",
+ }
+ end
files {
MAME_DIR .. "3rdparty/lsqlite3/lsqlite3.c",
@@ -435,6 +463,7 @@ project "jsoncpp"
-- SQLite3 library objects
--------------------------------------------------
+if _OPTIONS["with-bundled-sqlite3"] then
project "sqllite3"
uuid "5cb3d495-57ed-461c-81e5-80dc0857517d"
kind "StaticLib"
@@ -455,11 +484,17 @@ project "sqllite3"
"-Wshadow"
}
end
+else
+links {
+ "sqlite3",
+}
+end
--------------------------------------------------
-- portmidi library objects
--------------------------------------------------
if _OPTIONS["NO_USE_MIDI"]~="1" then
+if _OPTIONS["with-bundled-portmidi"] then
project "portmidi"
uuid "587f2da6-3274-4a65-86a2-f13ea315bb98"
kind "StaticLib"
@@ -514,6 +549,11 @@ project "portmidi"
"-Wshadow"
}
end
+else
+links {
+ "portmidi",
+}
+end
end
--------------------------------------------------
-- BGFX library objects
@@ -554,6 +594,7 @@ project "bgfx"
configuration { "gmake" }
buildoptions {
"-Wno-uninitialized",
+ "-Wno-unused-function",
}
configuration { }
@@ -609,6 +650,7 @@ end
-- PortAudio library objects
--------------------------------------------------
+if _OPTIONS["with-bundled-portaudio"] then
project "portaudio"
uuid "0755c5f5-eccf-47f3-98a9-df67018a94d4"
kind "StaticLib"
@@ -619,23 +661,32 @@ project "portaudio"
"-Wno-bad-function-cast",
"-Wno-undef",
"-Wno-missing-braces",
- "-Wno-unused-but-set-variable",
- "-Wno-maybe-uninitialized",
+ "-Wno-unused-variable",
"-Wno-unused-value",
"-Wno-unused-function",
"-Wno-unknown-pragmas",
- "-Wno-sometimes-uninitialized",
}
- local version = str_to_version(_OPTIONS["gcc_version"])
- if (_OPTIONS["gcc"]~=nil) and string.find(_OPTIONS["gcc"], "clang") then
- buildoptions_c {
- "-Wno-unknown-warning-option",
- "-Wno-absolute-value",
- "-Wno-unused-variable",
- }
+ local version = str_to_version(_OPTIONS["gcc_version"])
+ if (_OPTIONS["gcc"]~=nil) then
+ if string.find(_OPTIONS["gcc"], "clang") then
+ buildoptions_c {
+ "-Wno-unknown-warning-option",
+ "-Wno-absolute-value",
+ "-Wno-unused-but-set-variable",
+ "-Wno-maybe-uninitialized",
+ "-Wno-sometimes-uninitialized",
+ }
+ else
+ if (version >= 40600) then
+ buildoptions_c {
+ "-Wno-unused-but-set-variable",
+ "-Wno-maybe-uninitialized",
+ "-Wno-sometimes-uninitialized",
+ }
+ end
+ end
end
-
configuration { "vs*" }
buildoptions {
"/wd4204", -- warning C4204: nonstandard extension used : non-constant aggregate initializer
@@ -725,6 +776,11 @@ project "portaudio"
"-Wshadow"
}
end
+else
+links {
+ "portaudio",
+}
+end
--------------------------------------------------
-- UnitTest++ library objects
diff --git a/scripts/src/bus.lua b/scripts/src/bus.lua
index 74ee8ac027e..59efdf1ad09 100644
--- a/scripts/src/bus.lua
+++ b/scripts/src/bus.lua
@@ -11,7 +11,7 @@
-------------------------------------------------
--
---@src/emu/bus/a7800/a78_slot.h,BUSES += A7800
+--@src/emu/bus/a7800/a78_slot.h,BUSES["A7800"] = true
---------------------------------------------------
if (BUSES["A7800"]~=null) then
@@ -33,7 +33,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/a800/a800_slot.h,BUSES += A800
+--@src/emu/bus/a800/a800_slot.h,BUSES["A800"] = true
---------------------------------------------------
if (BUSES["A800"]~=null) then
@@ -53,7 +53,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/a8sio/a8sio.h,BUSES += A8SIO
+--@src/emu/bus/a8sio/a8sio.h,BUSES["A8SIO"] = true
---------------------------------------------------
if (BUSES["A8SIO"]~=null) then
@@ -68,7 +68,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/abcbus/abcbus.h,BUSES += ABCBUS
+--@src/emu/bus/abcbus/abcbus.h,BUSES["ABCBUS"] = true
---------------------------------------------------
if (BUSES["ABCBUS"]~=null) then
@@ -107,7 +107,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/adam/exp.h,BUSES += ADAM
+--@src/emu/bus/adam/exp.h,BUSES["ADAM"] = true
---------------------------------------------------
if (BUSES["ADAM"]~=null) then
@@ -126,7 +126,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/adamnet/adamnet.h,BUSES += ADAMNET
+--@src/emu/bus/adamnet/adamnet.h,BUSES["ADAMNET"] = true
---------------------------------------------------
if (BUSES["ADAMNET"]~=null) then
@@ -149,7 +149,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/apf/slot.h,BUSES += APF
+--@src/emu/bus/apf/slot.h,BUSES["APF"] = true
---------------------------------------------------
if (BUSES["APF"]~=null) then
@@ -164,7 +164,24 @@ end
---------------------------------------------------
--
---@src/emu/bus/arcadia/slot.h,BUSES += ARCADIA
+--@src/emu/bus/apricot/expansion.h,BUSES["APRICOT_EXPANSION"] = true
+---------------------------------------------------
+
+if (BUSES["APRICOT_EXPANSION"]~=null) then
+ files {
+ MAME_DIR .. "src/emu/bus/apricot/expansion.c",
+ MAME_DIR .. "src/emu/bus/apricot/expansion.h",
+ MAME_DIR .. "src/emu/bus/apricot/cards.c",
+ MAME_DIR .. "src/emu/bus/apricot/cards.h",
+ MAME_DIR .. "src/emu/bus/apricot/ram.c",
+ MAME_DIR .. "src/emu/bus/apricot/ram.h",
+ }
+end
+
+
+---------------------------------------------------
+--
+--@src/emu/bus/arcadia/slot.h,BUSES["ARCADIA"] = true
---------------------------------------------------
if (BUSES["ARCADIA"]~=null) then
@@ -179,7 +196,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/astrocde/slot.h,BUSES += ASTROCADE
+--@src/emu/bus/astrocde/slot.h,BUSES["ASTROCADE"] = true
---------------------------------------------------
if (BUSES["ASTROCADE"]~=null) then
@@ -198,7 +215,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/bw2/exp.h,BUSES += BW2
+--@src/emu/bus/bw2/exp.h,BUSES["BW2"] = true
---------------------------------------------------
if (BUSES["BW2"]~=null) then
@@ -213,8 +230,8 @@ end
---------------------------------------------------
--
---@src/emu/bus/c64/exp.h,BUSES += C64
---@src/emu/bus/c64/user.h,BUSES += C64
+--@src/emu/bus/c64/exp.h,BUSES["C64"] = true
+--@src/emu/bus/c64/user.h,BUSES["C64"] = true
---------------------------------------------------
if (BUSES["C64"]~=null) then
@@ -367,8 +384,8 @@ end
---------------------------------------------------
--
---@src/emu/bus/cbm2/exp.h,BUSES += CBM2
---@src/emu/bus/cbm2/user.h,BUSES += CBM2
+--@src/emu/bus/cbm2/exp.h,BUSES["CBM2"] = true
+--@src/emu/bus/cbm2/user.h,BUSES["CBM2"] = true
---------------------------------------------------
if (BUSES["CBM2"]~=null) then
@@ -389,7 +406,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/cbmiec/cbmiec.h,BUSES += CBMIEC
+--@src/emu/bus/cbmiec/cbmiec.h,BUSES["CBMIEC"] = true
---------------------------------------------------
if (BUSES["CBMIEC"]~=null) then
@@ -420,7 +437,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/chanf/slot.h,BUSES += CHANNELF
+--@src/emu/bus/chanf/slot.h,BUSES["CHANNELF"] = true
---------------------------------------------------
if (BUSES["CHANNELF"]~=null) then
@@ -435,7 +452,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/comx35/exp.h,BUSES += COMX35
+--@src/emu/bus/comx35/exp.h,BUSES["COMX35"] = true
---------------------------------------------------
if (BUSES["COMX35"]~=null) then
@@ -464,7 +481,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/coleco/ctrl.h,BUSES += COLECO
+--@src/emu/bus/coleco/ctrl.h,BUSES["COLECO"] = true
---------------------------------------------------
if (BUSES["COLECO"]~=null) then
@@ -485,7 +502,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/crvision/slot.h,BUSES += CRVISION
+--@src/emu/bus/crvision/slot.h,BUSES["CRVISION"] = true
---------------------------------------------------
if (BUSES["CRVISION"]~=null) then
@@ -500,7 +517,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/dmv/dmv.h,BUSES += DMV
+--@src/emu/bus/dmv/dmv.h,BUSES["DMV"] = true
---------------------------------------------------
if (BUSES["DMV"]~=null) then
@@ -529,7 +546,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/ecbbus/ecbbus.h,BUSES += ECBBUS
+--@src/emu/bus/ecbbus/ecbbus.h,BUSES["ECBBUS"] = true
---------------------------------------------------
if (BUSES["ECBBUS"]~=null) then
@@ -544,7 +561,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/econet/econet.h,BUSES += ECONET
+--@src/emu/bus/econet/econet.h,BUSES["ECONET"] = true
---------------------------------------------------
if (BUSES["ECONET"]~=null) then
@@ -559,7 +576,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/ep64/exp.h,BUSES += EP64
+--@src/emu/bus/ep64/exp.h,BUSES["EP64"] = true
---------------------------------------------------
if (BUSES["EP64"]~=null) then
@@ -574,7 +591,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/generic/slot.h,BUSES += GENERIC
+--@src/emu/bus/generic/slot.h,BUSES["GENERIC"] = true
---------------------------------------------------
if (BUSES["GENERIC"]~=null) then
@@ -593,7 +610,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/ieee488/ieee488.h,BUSES += IEEE488
+--@src/emu/bus/ieee488/ieee488.h,BUSES["IEEE488"] = true
---------------------------------------------------
if (BUSES["IEEE488"]~=null) then
@@ -626,7 +643,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/iq151/iq151.h,BUSES += IQ151
+--@src/emu/bus/iq151/iq151.h,BUSES["IQ151"] = true
---------------------------------------------------
if (BUSES["IQ151"]~=null) then
@@ -655,7 +672,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/isbx/isbx.h,BUSES += IMI7000
+--@src/emu/bus/isbx/isbx.h,BUSES["IMI7000"] = true
---------------------------------------------------
if (BUSES["IMI7000"]~=null) then
@@ -670,7 +687,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/intv/slot.h,BUSES += INTV
+--@src/emu/bus/intv/slot.h,BUSES["INTV"] = true
---------------------------------------------------
if (BUSES["INTV"]~=null) then
@@ -689,7 +706,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/isa/isa.h,BUSES += ISA
+--@src/emu/bus/isa/isa.h,BUSES["ISA"] = true
---------------------------------------------------
if (BUSES["ISA"]~=null) then
@@ -801,7 +818,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/isbx/isbx.h,BUSES += ISBX
+--@src/emu/bus/isbx/isbx.h,BUSES["ISBX"] = true
---------------------------------------------------
if (BUSES["ISBX"]~=null) then
@@ -818,7 +835,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/msx_slot/slot.h,BUSES += MSX_SLOT
+--@src/emu/bus/msx_slot/slot.h,BUSES["MSX_SLOT"] = true
---------------------------------------------------
if (BUSES["MSX_SLOT"]~=null) then
@@ -873,6 +890,8 @@ if (BUSES["MSX_SLOT"]~=null) then
MAME_DIR .. "src/emu/bus/msx_cart/korean.h",
MAME_DIR .. "src/emu/bus/msx_cart/majutsushi.c",
MAME_DIR .. "src/emu/bus/msx_cart/majutsushi.h",
+ MAME_DIR .. "src/emu/bus/msx_cart/moonsound.h",
+ MAME_DIR .. "src/emu/bus/msx_cart/moonsound.c",
MAME_DIR .. "src/emu/bus/msx_cart/msx_audio.c",
MAME_DIR .. "src/emu/bus/msx_cart/msx_audio.h",
MAME_DIR .. "src/emu/bus/msx_cart/msx_audio_kb.c",
@@ -895,7 +914,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/kc/kc.h,BUSES += KC
+--@src/emu/bus/kc/kc.h,BUSES["KC"] = true
---------------------------------------------------
if (BUSES["KC"]~=null) then
@@ -915,7 +934,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/odyssey2/slot.h,BUSES += O2
+--@src/emu/bus/odyssey2/slot.h,BUSES["O2"] = true
---------------------------------------------------
if (BUSES["O2"]~=null) then
@@ -934,7 +953,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/pc_joy/pc_joy.h,BUSES += PC_JOY
+--@src/emu/bus/pc_joy/pc_joy.h,BUSES["PC_JOY"] = true
---------------------------------------------------
if (BUSES["PC_JOY"]~=null) then
@@ -949,7 +968,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/pc_kbd/pc_kbdc.h,BUSES += PC_KBD
+--@src/emu/bus/pc_kbd/pc_kbdc.h,BUSES["PC_KBD"] = true
---------------------------------------------------
if (BUSES["PC_KBD"]~=null) then
@@ -978,9 +997,9 @@ end
---------------------------------------------------
--
---@src/emu/bus/pet/cass.h,BUSES += PET
---@src/emu/bus/pet/exp.h,BUSES += PET
---@src/emu/bus/pet/user.h,BUSES += PET
+--@src/emu/bus/pet/cass.h,BUSES["PET"] = true
+--@src/emu/bus/pet/exp.h,BUSES["PET"] = true
+--@src/emu/bus/pet/user.h,BUSES["PET"] = true
---------------------------------------------------
if (BUSES["PET"]~=null) then
@@ -1013,8 +1032,8 @@ end
---------------------------------------------------
--
---@src/emu/bus/plus4/exp.h,BUSES += PLUS4
---@src/emu/bus/plus4/user.h,BUSES += PLUS4
+--@src/emu/bus/plus4/exp.h,BUSES["PLUS4"] = true
+--@src/emu/bus/plus4/user.h,BUSES["PLUS4"] = true
---------------------------------------------------
if (BUSES["PLUS4"]~=null) then
@@ -1037,7 +1056,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/s100/s100.h,BUSES += S100
+--@src/emu/bus/s100/s100.h,BUSES["S100"] = true
---------------------------------------------------
if (BUSES["S100"]~=null) then
@@ -1062,7 +1081,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/spc1000/exp.h,BUSES += SPC1000
+--@src/emu/bus/spc1000/exp.h,BUSES["SPC1000"] = true
---------------------------------------------------
if (BUSES["SPC1000"]~=null) then
@@ -1079,7 +1098,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/tvc/tvc.h,BUSES += TVC
+--@src/emu/bus/tvc/tvc.h,BUSES["TVC"] = true
---------------------------------------------------
if (BUSES["TVC"]~=null) then
@@ -1094,7 +1113,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/vc4000/slot.h,BUSES += VC4000
+--@src/emu/bus/vc4000/slot.h,BUSES["VC4000"] = true
---------------------------------------------------
if (BUSES["VC4000"]~=null) then
@@ -1109,7 +1128,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/vcs/vcs_slot.h,BUSES += VCS
+--@src/emu/bus/vcs/vcs_slot.h,BUSES["VCS"] = true
---------------------------------------------------
if (BUSES["VCS"]~=null) then
@@ -1130,7 +1149,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/vcs/ctrl.h,BUSES += VCS_CTRL
+--@src/emu/bus/vcs/ctrl.h,BUSES["VCS_CTRL"] = true
---------------------------------------------------
if (BUSES["VCS_CTRL"]~=null) then
@@ -1155,7 +1174,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/vectrex/slot.h,BUSES += VECTREX
+--@src/emu/bus/vectrex/slot.h,BUSES["VECTREX"] = true
---------------------------------------------------
if (BUSES["VECTREX"]~=null) then
@@ -1170,7 +1189,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/vic10/exp.h,BUSES += VIC10
+--@src/emu/bus/vic10/exp.h,BUSES["VIC10"] = true
---------------------------------------------------
if (BUSES["VIC10"]~=null) then
@@ -1185,8 +1204,8 @@ end
---------------------------------------------------
--
---@src/emu/bus/vic20/exp.h,BUSES += VIC20
---@src/emu/bus/vic20/user.h,BUSES += VIC20
+--@src/emu/bus/vic20/exp.h,BUSES["VIC20"] = true
+--@src/emu/bus/vic20/user.h,BUSES["VIC20"] = true
---------------------------------------------------
if (BUSES["VIC20"]~=null) then
@@ -1221,7 +1240,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/vidbrain/exp.h,BUSES += VIDBRAIN
+--@src/emu/bus/vidbrain/exp.h,BUSES["VIDBRAIN"] = true
---------------------------------------------------
if (BUSES["VIDBRAIN"]~=null) then
@@ -1240,8 +1259,8 @@ end
---------------------------------------------------
--
---@src/emu/bus/vip/byteio.h,BUSES += VIP
---@src/emu/bus/vip/exp.h,BUSES += VIP
+--@src/emu/bus/vip/byteio.h,BUSES["VIP"] = true
+--@src/emu/bus/vip/exp.h,BUSES["VIP"] = true
---------------------------------------------------
if (BUSES["VIP"]~=null) then
@@ -1272,7 +1291,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/wangpc/wangpc.h,BUSES += WANGPC
+--@src/emu/bus/wangpc/wangpc.h,BUSES["WANGPC"] = true
---------------------------------------------------
if (BUSES["WANGPC"]~=null) then
@@ -1301,7 +1320,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/z88/z88.h,BUSES += Z88
+--@src/emu/bus/z88/z88.h,BUSES["Z88"] = true
---------------------------------------------------
if (BUSES["Z88"]~=null) then
@@ -1319,7 +1338,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/a2bus/a2bus.h,BUSES += A2BUS
+--@src/emu/bus/a2bus/a2bus.h,BUSES["A2BUS"] = true
---------------------------------------------------
if (BUSES["A2BUS"]~=null) then
@@ -1409,7 +1428,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/nubus/nubus.h,BUSES += NUBUS
+--@src/emu/bus/nubus/nubus.h,BUSES["NUBUS"] = true
---------------------------------------------------
if (BUSES["NUBUS"]~=null) then
@@ -1453,7 +1472,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/centronics/ctronics.h,BUSES += CENTRONICS
+--@src/emu/bus/centronics/ctronics.h,BUSES["CENTRONICS"] = true
---------------------------------------------------
if (BUSES["CENTRONICS"]~=null) then
@@ -1492,7 +1511,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/rs232/rs232.h,BUSES += RS232
+--@src/emu/bus/rs232/rs232.h,BUSES["RS232"] = true
---------------------------------------------------
if (BUSES["RS232"]~=null) then
@@ -1518,7 +1537,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/midi/midi.h,BUSES += MIDI
+--@src/emu/bus/midi/midi.h,BUSES["MIDI"] = true
---------------------------------------------------
if (BUSES["MIDI"]~=null) then
@@ -1534,7 +1553,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/lpci/pci.h,BUSES += LPCI
+--@src/emu/bus/lpci/pci.h,BUSES["LPCI"] = true
---------------------------------------------------
if (BUSES["LPCI"]~=null) then
@@ -1560,7 +1579,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/nes/nes_slot.h,BUSES += NES
+--@src/emu/bus/nes/nes_slot.h,BUSES["NES"] = true
---------------------------------------------------
if (BUSES["NES"]~=null) then
@@ -1673,7 +1692,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/nes_ctrl/ctrl.h,BUSES += NES_CTRL
+--@src/emu/bus/nes_ctrl/ctrl.h,BUSES["NES_CTRL"] = true
---------------------------------------------------
if (BUSES["NES_CTRL"]~=null) then
@@ -1715,7 +1734,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/snes/snes_slot.h,BUSES += SNES
+--@src/emu/bus/snes/snes_slot.h,BUSES["SNES"] = true
---------------------------------------------------
if (BUSES["SNES"]~=null) then
@@ -1751,7 +1770,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/snes_ctrl/ctrl.h,BUSES += SNES_CTRL
+--@src/emu/bus/snes_ctrl/ctrl.h,BUSES["SNES_CTRL"] = true
---------------------------------------------------
if (BUSES["SNES_CTRL"]~=null) then
@@ -1779,7 +1798,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/vboy/slot.h,BUSES += VBOY
+--@src/emu/bus/vboy/slot.h,BUSES["VBOY"] = true
---------------------------------------------------
if (BUSES["VBOY"]~=null) then
files {
@@ -1792,7 +1811,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/megadrive/md_slot.h,BUSES += MEGADRIVE
+--@src/emu/bus/megadrive/md_slot.h,BUSES["MEGADRIVE"] = true
---------------------------------------------------
if (BUSES["MEGADRIVE"]~=null) then
@@ -1820,7 +1839,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/neogeo/neogeo_slot.h,BUSES += NEOGEO
+--@src/emu/bus/neogeo/neogeo_slot.h,BUSES["NEOGEO"] = true
---------------------------------------------------
if (BUSES["NEOGEO"]~=null) then
@@ -1885,7 +1904,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/saturn/sat_slot.h,BUSES += SATURN
+--@src/emu/bus/saturn/sat_slot.h,BUSES["SATURN"] = true
---------------------------------------------------
if (BUSES["SATURN"]~=null) then
@@ -1903,7 +1922,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/sega8/sega8_slot.h,BUSES += SEGA8
+--@src/emu/bus/sega8/sega8_slot.h,BUSES["SEGA8"] = true
---------------------------------------------------
if (BUSES["SEGA8"]~=null) then
@@ -1921,7 +1940,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/sms_ctrl/smsctrl.h,BUSES += SMS_CTRL
+--@src/emu/bus/sms_ctrl/smsctrl.h,BUSES["SMS_CTRL"] = true
---------------------------------------------------
if (BUSES["SMS_CTRL"]~=null) then
@@ -1949,7 +1968,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/sms_exp/smsexp.h,BUSES += SMS_EXP
+--@src/emu/bus/sms_exp/smsexp.h,BUSES["SMS_EXP"] = true
---------------------------------------------------
if (BUSES["SMS_EXP"]~=null) then
@@ -1963,7 +1982,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/ti99_peb/peribox.h,BUSES += TI99PEB
+--@src/emu/bus/ti99_peb/peribox.h,BUSES["TI99PEB"] = true
---------------------------------------------------
if (BUSES["TI99PEB"]~=null) then
@@ -2005,7 +2024,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/gameboy/gb_slot.h,BUSES += GAMEBOY
+--@src/emu/bus/gameboy/gb_slot.h,BUSES["GAMEBOY"] = true
---------------------------------------------------
if (BUSES["GAMEBOY"]~=null) then
@@ -2021,7 +2040,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/gamegear/ggext.h,BUSES += GAMEGEAR
+--@src/emu/bus/gamegear/ggext.h,BUSES["GAMEGEAR"] = true
---------------------------------------------------
if (BUSES["GAMEGEAR"]~=null) then
@@ -2035,7 +2054,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/gba/gba_slot.h,BUSES += GBA
+--@src/emu/bus/gba/gba_slot.h,BUSES["GBA"] = true
---------------------------------------------------
if (BUSES["GBA"]~=null) then
@@ -2049,7 +2068,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/bml3/bml3bus.h,BUSES += BML3
+--@src/emu/bus/bml3/bml3bus.h,BUSES["BML3"] = true
---------------------------------------------------
if (BUSES["BML3"]~=null) then
files {
@@ -2066,7 +2085,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/coco/cococart.h,BUSES += COCO
+--@src/emu/bus/coco/cococart.h,BUSES["COCO"] = true
---------------------------------------------------
if (BUSES["COCO"]~=null) then
files {
@@ -2089,7 +2108,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/cpc/cpcexp.h,BUSES += CPC
+--@src/emu/bus/cpc/cpcexp.h,BUSES["CPC"] = true
---------------------------------------------------
if (BUSES["CPC"]~=null) then
files {
@@ -2115,12 +2134,16 @@ if (BUSES["CPC"]~=null) then
MAME_DIR .. "src/emu/bus/cpc/smartwatch.h",
MAME_DIR .. "src/emu/bus/cpc/brunword4.c",
MAME_DIR .. "src/emu/bus/cpc/brunword4.h",
+ MAME_DIR .. "src/emu/bus/cpc/hd20.c",
+ MAME_DIR .. "src/emu/bus/cpc/hd20.h",
+ MAME_DIR .. "src/emu/bus/cpc/ddi1.c",
+ MAME_DIR .. "src/emu/bus/cpc/ddi1.h",
}
end
---------------------------------------------------
--
---@src/emu/bus/epson_sio/epson_sio.h,BUSES += EPSON_SIO
+--@src/emu/bus/epson_sio/epson_sio.h,BUSES["EPSON_SIO"] = true
---------------------------------------------------
if (BUSES["EPSON_SIO"]~=null) then
files {
@@ -2135,7 +2158,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/pce/pce_slot.h,BUSES += PCE
+--@src/emu/bus/pce/pce_slot.h,BUSES["PCE"] = true
---------------------------------------------------
if (BUSES["PCE"]~=null) then
files {
@@ -2148,7 +2171,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/scv/slot.h,BUSES += SCV
+--@src/emu/bus/scv/slot.h,BUSES["SCV"] = true
---------------------------------------------------
if (BUSES["SCV"]~=null) then
files {
@@ -2161,7 +2184,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/x68k/x68kexp.h,BUSES += X68K
+--@src/emu/bus/x68k/x68kexp.h,BUSES["X68K"] = true
---------------------------------------------------
if (BUSES["X68K"]~=null) then
files {
@@ -2176,7 +2199,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/abckb/abckb.h,BUSES += ABCKB
+--@src/emu/bus/abckb/abckb.h,BUSES["ABCKB"] = true
---------------------------------------------------
if (BUSES["ABCKB"]~=null) then
files {
@@ -2193,7 +2216,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/compucolor/compclr_flp.h,BUSES += COMPUCOLOR
+--@src/emu/bus/compucolor/compclr_flp.h,BUSES["COMPUCOLOR"] = true
---------------------------------------------------
if (BUSES["COMPUCOLOR"]~=null) then
files {
@@ -2204,7 +2227,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/scsi/scsi.h,BUSES += SCSI
+--@src/emu/bus/scsi/scsi.h,BUSES["SCSI"] = true
---------------------------------------------------
if (BUSES["SCSI"]~=null) then
files {
@@ -2235,7 +2258,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/macpds/macpds.h,BUSES += MACPDS
+--@src/emu/bus/macpds/macpds.h,BUSES["MACPDS"] = true
---------------------------------------------------
if (BUSES["MACPDS"]~=null) then
files {
@@ -2248,7 +2271,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/oricext/oricext.h,BUSES += ORICEXT
+--@src/emu/bus/oricext/oricext.h,BUSES["ORICEXT"] = true
---------------------------------------------------
if (BUSES["ORICEXT"]~=null) then
files {
@@ -2263,7 +2286,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/a1bus/a1bus.h,BUSES += A1BUS
+--@src/emu/bus/a1bus/a1bus.h,BUSES["A1BUS"] = true
---------------------------------------------------
if (BUSES["A1BUS"]~=null) then
@@ -2279,7 +2302,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/amiga/zorro/zorro.h,BUSES += ZORRO
+--@src/emu/bus/amiga/zorro/zorro.h,BUSES["ZORRO"] = true
---------------------------------------------------
if (BUSES["ZORRO"]~=null) then
@@ -2303,7 +2326,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/ql/exp.h,BUSES += QL
+--@src/emu/bus/ql/exp.h,BUSES["QL"] = true
---------------------------------------------------
if (BUSES["QL"]~=null) then
@@ -2345,7 +2368,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/vtech/memexp/memexp.h,BUSES += VTECH_MEMEXP
+--@src/emu/bus/vtech/memexp/memexp.h,BUSES["VTECH_MEMEXP"] = true
---------------------------------------------------
if (BUSES["VTECH_MEMEXP"]~=null) then
@@ -2367,7 +2390,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/vtech/ioexp/ioexp.h,BUSES += VTECH_IOEXP
+--@src/emu/bus/vtech/ioexp/ioexp.h,BUSES["VTECH_IOEXP"] = true
---------------------------------------------------
if (BUSES["VTECH_IOEXP"]~=null) then
@@ -2385,7 +2408,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/wswan/slot.h,BUSES += WSWAN
+--@src/emu/bus/wswan/slot.h,BUSES["WSWAN"] = true
---------------------------------------------------
if (BUSES["WSWAN"]~=null) then
@@ -2399,7 +2422,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/psx/ctlrport.h,BUSES += PSX_CONTROLLER
+--@src/emu/bus/psx/ctlrport.h,BUSES["PSX_CONTROLLER"] = true
---------------------------------------------------
if (BUSES["PSX_CONTROLLER"]~=null) then
@@ -2417,7 +2440,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/nasbus/nasbus.h,BUSES += NASBUS
+--@src/emu/bus/nasbus/nasbus.h,BUSES["NASBUS"] = true
---------------------------------------------------
if (BUSES["NASBUS"]~=null) then
@@ -2435,7 +2458,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/cgenie/expansion.h,BUSES += CGENIE_EXPANSION
+--@src/emu/bus/cgenie/expansion.h,BUSES["CGENIE_EXPANSION"] = true
---------------------------------------------------
if (BUSES["CGENIE_EXPANSION"]~=null) then
@@ -2451,7 +2474,7 @@ end
---------------------------------------------------
--
---@src/emu/bus/cgenie/parallel.h,BUSES += CGENIE_PARALLEL
+--@src/emu/bus/cgenie/parallel.h,BUSES["CGENIE_PARALLEL"] = true
---------------------------------------------------
if (BUSES["CGENIE_PARALLEL"]~=null) then
diff --git a/scripts/src/cpu.lua b/scripts/src/cpu.lua
index 68d93da6ec5..5092c86044d 100644
--- a/scripts/src/cpu.lua
+++ b/scripts/src/cpu.lua
@@ -21,7 +21,7 @@ files {
-- Dynamic recompiler objects
--------------------------------------------------
-if (CPUS["SH2"]~=null or CPUS["MIPS"]~=null or CPUS["POWERPC"]~=null or CPUS["RSP"]~=null) then
+if (CPUS["SH2"]~=null or CPUS["MIPS"]~=null or CPUS["POWERPC"]~=null or CPUS["RSP"]~=null or CPUS["ARM7"]~=null) then
files {
MAME_DIR .. "src/emu/cpu/drcbec.c",
MAME_DIR .. "src/emu/cpu/drcbec.h",
@@ -50,7 +50,7 @@ end
--------------------------------------------------
-- Signetics 8X300 / Scientific Micro Systems SMS300
---@src/emu/cpu/8x300/8x300.h,CPUS += 8X300
+--@src/emu/cpu/8x300/8x300.h,CPUS["8X300"] = true
--------------------------------------------------
if (CPUS["8X300"]~=null) then
@@ -66,7 +66,7 @@ end
--------------------------------------------------
-- ARCangent A4
---@src/emu/cpu/arc/arc.h,CPUS += ARC
+--@src/emu/cpu/arc/arc.h,CPUS["ARC"] = true
--------------------------------------------------
if (CPUS["ARC"]~=null) then
@@ -82,7 +82,7 @@ end
--------------------------------------------------
-- ARcompact (ARCtangent-A5, ARC 600, ARC 700)
---@src/emu/cpu/arc/arc.h,CPUS += ARCOMPACT
+--@src/emu/cpu/arc/arc.h,CPUS["ARCOMPACT"] = true
--------------------------------------------------
if (CPUS["ARCOMPACT"]~=null) then
@@ -111,8 +111,8 @@ end
--------------------------------------------------
-- Acorn ARM series
--
----@src/emu/cpu/arm/arm.h,CPUS += ARM
----@src/emu/cpu/arm7/arm7.h,CPUS += ARM7
+--@src/emu/cpu/arm/arm.h,CPUS["ARM"] = true
+--@src/emu/cpu/arm7/arm7.h,CPUS["ARM7"] = true
--------------------------------------------------
if (CPUS["ARM"]~=null) then
@@ -141,7 +141,7 @@ end
--------------------------------------------------
-- Advanced Digital Chips SE3208
----@src/emu/cpu/se3208/se3208.h,CPUS += SE3208
+--@src/emu/cpu/se3208/se3208.h,CPUS["SE3208"] = true
--------------------------------------------------
if (CPUS["SE3208"]~=null) then
@@ -157,13 +157,14 @@ end
--------------------------------------------------
-- American Microsystems, Inc.(AMI) S2000 series
----@src/emu/cpu/amis2000/amis2000.h,CPUS += AMIS2000
+--@src/emu/cpu/amis2000/amis2000.h,CPUS["AMIS2000"] = true
--------------------------------------------------
if (CPUS["AMIS2000"]~=null) then
files {
MAME_DIR .. "src/emu/cpu/amis2000/amis2000.c",
MAME_DIR .. "src/emu/cpu/amis2000/amis2000.h",
+ MAME_DIR .. "src/emu/cpu/amis2000/amis2000op.c",
}
end
@@ -173,7 +174,7 @@ end
--------------------------------------------------
-- Alpha 8201
----@src/emu/cpu/alph8201/alph8201.h,CPUS += ALPHA8201
+--@src/emu/cpu/alph8201/alph8201.h,CPUS["ALPHA8201"] = true
--------------------------------------------------
if (CPUS["ALPHA8201"]~=null) then
@@ -189,7 +190,7 @@ end
--------------------------------------------------
-- Analog Devices ADSP21xx series
----@src/emu/cpu/adsp2100/adsp2100.h,CPUS += ADSP21XX
+--@src/emu/cpu/adsp2100/adsp2100.h,CPUS["ADSP21XX"] = true
--------------------------------------------------
if (CPUS["ADSP21XX"]~=null) then
@@ -205,7 +206,7 @@ end
--------------------------------------------------
-- Analog Devices "Sharc" ADSP21062
----@src/emu/cpu/sharc/sharc.h,CPUS += ADSP21062
+--@src/emu/cpu/sharc/sharc.h,CPUS["ADSP21062"] = true
--------------------------------------------------
if (CPUS["ADSP21062"]~=null) then
@@ -221,7 +222,7 @@ end
--------------------------------------------------
-- APEXC
----@src/emu/cpu/apexc/apexc.h,CPUS += APEXC
+--@src/emu/cpu/apexc/apexc.h,CPUS["APEXC"] = true
--------------------------------------------------
if (CPUS["APEXC"]~=null) then
@@ -237,7 +238,7 @@ end
--------------------------------------------------
-- AT&T DSP16A
----@src/emu/cpu/dsp16/dsp16.h,CPUS += DSP16A
+--@src/emu/cpu/dsp16/dsp16.h,CPUS["DSP16A"] = true
--------------------------------------------------
if (CPUS["DSP16A"]~=null) then
@@ -253,7 +254,7 @@ end
--------------------------------------------------
-- AT&T DSP32C
----@src/emu/cpu/dsp32/dsp32.h,CPUS += DSP32C
+--@src/emu/cpu/dsp32/dsp32.h,CPUS["DSP32C"] = true
--------------------------------------------------
if (CPUS["DSP32C"]~=null) then
@@ -269,7 +270,7 @@ end
--------------------------------------------------
-- Atari custom RISC processor
----@src/emu/cpu/asap/asap.h,CPUS += ASAP
+--@src/emu/cpu/asap/asap.h,CPUS["ASAP"] = true
--------------------------------------------------
if (CPUS["ASAP"]~=null) then
@@ -285,7 +286,7 @@ end
--------------------------------------------------
-- AMD Am29000
----@src/emu/cpu/am29000/am29000.h,CPUS += AM29000
+--@src/emu/cpu/am29000/am29000.h,CPUS["AM29000"] = true
--------------------------------------------------
if (CPUS["AM29000"]~=null) then
@@ -301,7 +302,7 @@ end
--------------------------------------------------
-- Atari Jaguar custom DSPs
----@src/emu/cpu/jaguar/jaguar.h,CPUS += JAGUAR
+--@src/emu/cpu/jaguar/jaguar.h,CPUS["JAGUAR"] = true
--------------------------------------------------
if (CPUS["JAGUAR"]~=null) then
@@ -317,7 +318,7 @@ end
--------------------------------------------------
-- Simutrek Cube Quest bit-sliced CPUs
----@src/emu/cpu/cubeqcpu/cubeqcpu.h,CPUS += CUBEQCPU
+--@src/emu/cpu/cubeqcpu/cubeqcpu.h,CPUS["CUBEQCPU"] = true
--------------------------------------------------
if (CPUS["CUBEQCPU"]~=null) then
@@ -333,7 +334,7 @@ end
--------------------------------------------------
-- Ensoniq ES5510 ('ESP') DSP
----@src/emu/cpu/es5510/es5510.h,CPUS += ES5510
+--@src/emu/cpu/es5510/es5510.h,CPUS["ES5510"] = true
--------------------------------------------------
if (CPUS["ES5510"]~=null) then
@@ -345,7 +346,7 @@ end
--------------------------------------------------
-- Entertainment Sciences AM29116-based RIP
----@src/emu/cpu/esrip/esrip.h,CPUS += ESRIP
+--@src/emu/cpu/esrip/esrip.h,CPUS["ESRIP"] = true
--------------------------------------------------
if (CPUS["ESRIP"]~=null) then
@@ -361,7 +362,7 @@ end
--------------------------------------------------
-- Seiko Epson E0C6200 series
----@src/emu/cpu/e0c6200/e0c6200.h,CPUS += E0C6200
+--@src/emu/cpu/e0c6200/e0c6200.h,CPUS["E0C6200"] = true
--------------------------------------------------
if (CPUS["E0C6200"]~=null) then
@@ -379,7 +380,7 @@ end
--------------------------------------------------
-- RCA COSMAC
----@src/emu/cpu/cosmac/cosmac.h,CPUS += COSMAC
+--@src/emu/cpu/cosmac/cosmac.h,CPUS["COSMAC"] = true
--------------------------------------------------
if (CPUS["COSMAC"]~=null) then
@@ -395,7 +396,7 @@ end
--------------------------------------------------
-- National Semiconductor COP400 family
----@src/emu/cpu/cop400/cop400.h,CPUS += COP400
+--@src/emu/cpu/cop400/cop400.h,CPUS["COP400"] = true
--------------------------------------------------
if (CPUS["COP400"]~=null) then
@@ -413,7 +414,7 @@ end
--------------------------------------------------
-- CP1610
----@src/emu/cpu/cp1610/cp1610.h,CPUS += CP1610
+--@src/emu/cpu/cp1610/cp1610.h,CPUS["CP1610"] = true
--------------------------------------------------
if (CPUS["CP1610"]~=null) then
@@ -429,7 +430,7 @@ end
--------------------------------------------------
-- Cinematronics vector "CPU"
----@src/emu/cpu/ccpu/ccpu.h,CPUS += CCPU
+--@src/emu/cpu/ccpu/ccpu.h,CPUS["CCPU"] = true
--------------------------------------------------
if (CPUS["CCPU"]~=null) then
@@ -445,7 +446,7 @@ end
--------------------------------------------------
-- DEC T-11
----@src/emu/cpu/t11/t11.h,CPUS += T11
+--@src/emu/cpu/t11/t11.h,CPUS["T11"] = true
--------------------------------------------------
if (CPUS["T11"]~=null) then
@@ -461,7 +462,7 @@ end
--------------------------------------------------
-- F8
----@src/emu/cpu/f8/f8.h,CPUS += F8
+--@src/emu/cpu/f8/f8.h,CPUS["F8"] = true
--------------------------------------------------
if (CPUS["F8"]~=null) then
@@ -477,7 +478,7 @@ end
--------------------------------------------------
-- G65816
----@src/emu/cpu/g65816/g65816.h,CPUS += G65816
+--@src/emu/cpu/g65816/g65816.h,CPUS["G65816"] = true
--------------------------------------------------
if (CPUS["G65816"]~=null) then
@@ -498,7 +499,7 @@ end
--------------------------------------------------
-- Hitachi H8 (16/32-bit H8/300, H8/300H, H8S2000 and H8S2600 series)
----@src/emu/cpu/h8/h8.h,CPUS += H8
+--@src/emu/cpu/h8/h8.h,CPUS["H8"] = true
--------------------------------------------------
if (CPUS["H8"]~=null) then
@@ -560,7 +561,7 @@ end
--------------------------------------------------
-- Hitachi HCD62121
----@src/emu/cpu/hcd62121/hcd62121.h,CPUS += HCD62121
+--@src/emu/cpu/hcd62121/hcd62121.h,CPUS["HCD62121"] = true
--------------------------------------------------
if (CPUS["HCD62121"]~=null) then
@@ -576,13 +577,14 @@ end
--------------------------------------------------
-- Hitachi HMCS40 series
----@src/emu/cpu/hmcs40/hmcs40.h,CPUS += HMCS40
+--@src/emu/cpu/hmcs40/hmcs40.h,CPUS["HMCS40"] = true
--------------------------------------------------
if (CPUS["HMCS40"]~=null) then
files {
MAME_DIR .. "src/emu/cpu/hmcs40/hmcs40.c",
MAME_DIR .. "src/emu/cpu/hmcs40/hmcs40.h",
+ MAME_DIR .. "src/emu/cpu/hmcs40/hmcs40op.c",
}
end
@@ -592,7 +594,7 @@ end
--------------------------------------------------
-- Hitachi SH1/SH2
----@src/emu/cpu/sh2/sh2.h,CPUS += SH2
+--@src/emu/cpu/sh2/sh2.h,CPUS["SH2"] = true
--------------------------------------------------
if (CPUS["SH2"]~=null) then
@@ -609,7 +611,7 @@ end
--------------------------------------------------
-- Hitachi SH4
----@src/emu/cpu/sh4/sh4.h,CPUS += SH4
+--@src/emu/cpu/sh4/sh4.h,CPUS["SH4"] = true
--------------------------------------------------
if (CPUS["SH4"]~=null) then
@@ -632,8 +634,24 @@ if (CPUS["SH4"]~=null or _OPTIONS["with-tools"]) then
end
--------------------------------------------------
+-- HP Hybrid processor
+--@src/emu/cpu/hphybrid/hphybrid.h,CPUS["HPHYBRID"] = true
+--------------------------------------------------
+
+if (CPUS["HPHYBRID"]~=null) then
+ files {
+ MAME_DIR .. "src/emu/cpu/hphybrid/hphybrid.c",
+ MAME_DIR .. "src/emu/cpu/hphybrid/hphybrid.h",
+ }
+end
+
+if (CPUS["HPHYBRID"]~=null or _OPTIONS["with-tools"]) then
+ table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/hphybrid/hphybrid_dasm.c")
+end
+
+--------------------------------------------------
-- Hudsonsoft 6280
----@src/emu/cpu/h6280/h6280.h,CPUS += H6280
+--@src/emu/cpu/h6280/h6280.h,CPUS["H6280"] = true
--------------------------------------------------
if (CPUS["H6280"]~=null) then
@@ -649,7 +667,7 @@ end
--------------------------------------------------
-- Hyperstone E1 series
----@src/emu/cpu/e132xs/e132xs.h,CPUS += E1
+--@src/emu/cpu/e132xs/e132xs.h,CPUS["E1"] = true
--------------------------------------------------
if (CPUS["E1"]~=null) then
@@ -665,7 +683,7 @@ end
--------------------------------------------------
-- 15IE-00-013 CPU ("Microprogrammed Control Device")
----@src/emu/cpu/ie15/ie15.h,CPUS += IE15
+--@src/emu/cpu/ie15/ie15.h,CPUS["IE15"] = true
--------------------------------------------------
if (CPUS["IE15"]~=null) then
@@ -681,7 +699,7 @@ end
--------------------------------------------------
-- Intel 4004
----@src/emu/cpu/i4004/i4004.h,CPUS += I4004
+--@src/emu/cpu/i4004/i4004.h,CPUS["I4004"] = true
--------------------------------------------------
if (CPUS["I4004"]~=null) then
@@ -697,7 +715,7 @@ end
--------------------------------------------------
-- Intel 8008
----@src/emu/cpu/i8008/i8008.h,CPUS += I8008
+--@src/emu/cpu/i8008/i8008.h,CPUS["I8008"] = true
--------------------------------------------------
if (CPUS["I8008"]~=null) then
@@ -713,7 +731,7 @@ end
--------------------------------------------------
-- National Semiconductor SC/MP
----@src/emu/cpu/scmp/scmp.h,CPUS += SCMP
+--@src/emu/cpu/scmp/scmp.h,CPUS["SCMP"] = true
--------------------------------------------------
if (CPUS["SCMP"]~=null) then
@@ -729,7 +747,7 @@ end
--------------------------------------------------
-- Intel 8080/8085A
----@src/emu/cpu/i8085/i8085.h,CPUS += I8085
+--@src/emu/cpu/i8085/i8085.h,CPUS["I8085"] = true
--------------------------------------------------
if (CPUS["I8085"]~=null) then
@@ -745,7 +763,7 @@ end
--------------------------------------------------
-- Intel 8089
----@src/emu/cpu/i8085/i8089.h,CPUS += I8089
+--@src/emu/cpu/i8089/i8089.h,CPUS["I8089"] = true
--------------------------------------------------
if (CPUS["I8089"]~=null) then
@@ -764,7 +782,7 @@ end
--------------------------------------------------
-- Intel MCS-48 (8039 and derivatives)
----@src/emu/cpu/mcs48/mcs48.h,CPUS += MCS48
+--@src/emu/cpu/mcs48/mcs48.h,CPUS["MCS48"] = true
--------------------------------------------------
if (CPUS["MCS48"]~=null) then
@@ -780,7 +798,7 @@ end
--------------------------------------------------
-- Intel 8051 and derivatives
----@src/emu/cpu/mcs51/mcs51.h,CPUS += MCS51
+--@src/emu/cpu/mcs51/mcs51.h,CPUS["MCS51"] = true
--------------------------------------------------
if (CPUS["MCS51"]~=null) then
@@ -796,7 +814,7 @@ end
--------------------------------------------------
-- Intel MCS-96
----@src/emu/cpu/mcs96/mcs96.h,CPUS += MCS96
+--@src/emu/cpu/mcs96/mcs96.h,CPUS["MCS96"] = true
--------------------------------------------------
if (CPUS["MCS96"]~=null) then
@@ -823,9 +841,9 @@ end
--------------------------------------------------
-- Intel 80x86 series
----@src/emu/cpu/i86/i86.h,CPUS += I86
----@src/emu/cpu/i86/i286.h,CPUS += I86
----@src/emu/cpu/i386/i386.h,CPUS += I386
+--@src/emu/cpu/i86/i86.h,CPUS["I86"] = true
+--@src/emu/cpu/i86/i286.h,CPUS["I86"] = true
+--@src/emu/cpu/i386/i386.h,CPUS["I386"] = true
--------------------------------------------------
if (CPUS["I86"]~=null) then
@@ -856,7 +874,7 @@ end
--------------------------------------------------
-- Intel i860
----@src/emu/cpu/i860/i860.h,CPUS += I860
+--@src/emu/cpu/i860/i860.h,CPUS["I860"] = true
--------------------------------------------------
if (CPUS["I860"]~=null) then
@@ -872,7 +890,7 @@ end
--------------------------------------------------
-- Intel i960
----@src/emu/cpu/i960/i960.h,CPUS += I960
+--@src/emu/cpu/i960/i960.h,CPUS["I960"] = true
--------------------------------------------------
if (CPUS["I960"]~=null) then
@@ -888,7 +906,7 @@ end
--------------------------------------------------
-- LH5801
----@src/emu/cpu/lh5801/lh5801.h,CPUS += LH5801
+--@src/emu/cpu/lh5801/lh5801.h,CPUS["LH5801"] = true
--------------------------------------------------
if (CPUS["LH5801"]~=null) then
@@ -904,7 +922,7 @@ end
--------
------------------------------------------
-- Manchester Small-Scale Experimental Machine
----@src/emu/cpu/ssem/ssem.h,CPUS += SSEM
+--@src/emu/cpu/ssem/ssem.h,CPUS["SSEM"] = true
--------------------------------------------------
if (CPUS["SSEM"]~=null) then
@@ -920,7 +938,7 @@ end
--------------------------------------------------
-- Fujitsu MB88xx
----@src/emu/cpu/mb88xx/mb88xx.h,CPUS += MB88XX
+--@src/emu/cpu/mb88xx/mb88xx.h,CPUS["MB88XX"] = true
--------------------------------------------------
if (CPUS["MB88XX"]~=null) then
@@ -936,7 +954,7 @@ end
--------------------------------------------------
-- Fujitsu MB86233
----@src/emu/cpu/mb86233/mb86233.h,CPUS += MB86233
+--@src/emu/cpu/mb86233/mb86233.h,CPUS["MB86233"] = true
--------------------------------------------------
if (CPUS["MB86233"]~=null) then
@@ -952,7 +970,7 @@ end
--------------------------------------------------
-- Fujitsu MB86235
----@src/emu/cpu/mb86233/mb86235.h,CPUS += MB86235
+--@src/emu/cpu/mb86233/mb86235.h,CPUS["MB86235"] = true
--------------------------------------------------
if (CPUS["MB86235"]~=null) then
@@ -968,7 +986,7 @@ end
--------------------------------------------------
-- Microchip PIC16C5x
----@src/emu/cpu/pic16c5x/pic16c5x.h,CPUS += PIC16C5X
+--@src/emu/cpu/pic16c5x/pic16c5x.h,CPUS["PIC16C5X"] = true
--------------------------------------------------
if (CPUS["PIC16C5X"]~=null) then
@@ -984,7 +1002,7 @@ end
--------------------------------------------------
-- Microchip PIC16C62x
----@src/emu/cpu/pic16c62x/pic16c62x.h,CPUS += PIC16C62X
+--@src/emu/cpu/pic16c62x/pic16c62x.h,CPUS["PIC16C62X"] = true
--------------------------------------------------
if (CPUS["PIC16C62X"]~=null) then
@@ -1001,7 +1019,7 @@ end
--------------------------------------------------
-- MIPS R3000 (MIPS I/II) series
-- MIPS R4000 (MIPS III/IV) series
----@src/emu/cpu/mips/mips3.h,CPUS += MIPS
+--@src/emu/cpu/mips/mips3.h,CPUS["MIPS"] = true
--------------------------------------------------
if (CPUS["MIPS"]~=null) then
@@ -1025,7 +1043,7 @@ end
--------------------------------------------------
-- Sony PlayStation CPU (R3000-based + GTE)
----@src/emu/cpu/psx/psx.h,CPUS += PSX
+--@src/emu/cpu/psx/psx.h,CPUS["PSX"] = true
--------------------------------------------------
if (CPUS["PSX"]~=null) then
@@ -1053,13 +1071,14 @@ end
--------------------------------------------------
-- Mitsubishi MELPS 4 series
----@src/emu/cpu/melps4/melps4.h,CPUS += MELPS4
+--@src/emu/cpu/melps4/melps4.h,CPUS["MELPS4"] = true
--------------------------------------------------
if (CPUS["MELPS4"]~=null) then
files {
MAME_DIR .. "src/emu/cpu/melps4/melps4.c",
MAME_DIR .. "src/emu/cpu/melps4/melps4.h",
+ MAME_DIR .. "src/emu/cpu/melps4/melps4op.c",
MAME_DIR .. "src/emu/cpu/melps4/m58846.c",
MAME_DIR .. "src/emu/cpu/melps4/m58846.h",
}
@@ -1071,7 +1090,7 @@ end
--------------------------------------------------
-- Mitsubishi M37702 and M37710 (based on 65C816)
----@src/emu/cpu/m37710/m37710.h,CPUS += M37710
+--@src/emu/cpu/m37710/m37710.h,CPUS["M37710"] = true
--------------------------------------------------
if (CPUS["M37710"]~=null) then
@@ -1091,23 +1110,23 @@ end
--------------------------------------------------
-- Mostek 6502 and its many derivatives
----@src/emu/cpu/m6502/m6502.h,CPUS += M6502
----@src/emu/cpu/m6502/deco16.h,CPUS += M6502
----@src/emu/cpu/m6502/m4510.h,CPUS += M6502
----@src/emu/cpu/m6502/m65ce02.h,CPUS += M6502
----@src/emu/cpu/m6502/m65c02.h,CPUS += M6502
----@src/emu/cpu/m6502/r65c02.h,CPUS += M6502
----@src/emu/cpu/m6502/m65sc02.h,CPUS += M6502
----@src/emu/cpu/m6502/m6504.h,CPUS += M6502
----@src/emu/cpu/m6502/m6509.h,CPUS += M6502
----@src/emu/cpu/m6502/m6510.h,CPUS += M6502
----@src/emu/cpu/m6502/m6510t.h,CPUS += M6502
----@src/emu/cpu/m6502/m7501.h,CPUS += M6502
----@src/emu/cpu/m6502/m8502.h,CPUS += M6502
----@src/emu/cpu/m6502/n2a03.h,CPUS += M6502
----@src/emu/cpu/m6502/m740.h,CPUS += M6502
----@src/emu/cpu/m6502/m3745x.h,CPUS += M6502
----@src/emu/cpu/m6502/m5074x.h,CPUS += M6502
+--@src/emu/cpu/m6502/m6502.h,CPUS["M6502"] = true
+--@src/emu/cpu/m6502/deco16.h,CPUS["M6502"] = true
+--@src/emu/cpu/m6502/m4510.h,CPUS["M6502"] = true
+--@src/emu/cpu/m6502/m65ce02.h,CPUS["M6502"] = true
+--@src/emu/cpu/m6502/m65c02.h,CPUS["M6502"] = true
+--@src/emu/cpu/m6502/r65c02.h,CPUS["M6502"] = true
+--@src/emu/cpu/m6502/m65sc02.h,CPUS["M6502"] = true
+--@src/emu/cpu/m6502/m6504.h,CPUS["M6502"] = true
+--@src/emu/cpu/m6502/m6509.h,CPUS["M6502"] = true
+--@src/emu/cpu/m6502/m6510.h,CPUS["M6502"] = true
+--@src/emu/cpu/m6502/m6510t.h,CPUS["M6502"] = true
+--@src/emu/cpu/m6502/m7501.h,CPUS["M6502"] = true
+--@src/emu/cpu/m6502/m8502.h,CPUS["M6502"] = true
+--@src/emu/cpu/m6502/n2a03.h,CPUS["M6502"] = true
+--@src/emu/cpu/m6502/m740.h,CPUS["M6502"] = true
+--@src/emu/cpu/m6502/m3745x.h,CPUS["M6502"] = true
+--@src/emu/cpu/m6502/m5074x.h,CPUS["M6502"] = true
--------------------------------------------------
@@ -1179,7 +1198,7 @@ end
--------------------------------------------------
-- Motorola 680x
----@src/emu/cpu/m6800/m6800.h,CPUS += M6800
+--@src/emu/cpu/m6800/m6800.h,CPUS["M6800"] = true
--------------------------------------------------
if (CPUS["M6800"]~=null) then
@@ -1195,7 +1214,7 @@ end
--------------------------------------------------
-- Motorola 6805
----@src/emu/cpu/m6805/m6805.h,CPUS += M6805
+--@src/emu/cpu/m6805/m6805.h,CPUS["M6805"] = true
--------------------------------------------------
if (CPUS["M6805"]~=null) then
@@ -1211,9 +1230,9 @@ end
--------------------------------------------------
-- Motorola 6809
----@src/emu/cpu/m6809/m6809.h,CPUS += M6809
----@src/emu/cpu/m6809/hd6309.h,CPUS += M6809
----@src/emu/cpu/m6809/konami.h,CPUS += M6809
+--@src/emu/cpu/m6809/m6809.h,CPUS["M6809"] = true
+--@src/emu/cpu/m6809/hd6309.h,CPUS["M6809"] = true
+--@src/emu/cpu/m6809/konami.h,CPUS["M6809"] = true
--------------------------------------------------
if (CPUS["M6809"]~=null) then
@@ -1247,7 +1266,7 @@ end
--------------------------------------------------
-- Motorola 68HC11
----@src/emu/cpu/mc68hc11/mc68hc11.h,CPUS += MC68HC11
+--@src/emu/cpu/mc68hc11/mc68hc11.h,CPUS["MC68HC11"] = true
--------------------------------------------------
if (CPUS["MC68HC11"]~=null) then
@@ -1263,7 +1282,7 @@ end
--------------------------------------------------
-- Motorola 68000 series
----@src/emu/cpu/m68000/m68000.h,CPUS += M680X0
+--@src/emu/cpu/m68000/m68000.h,CPUS["M680X0"] = true
--------------------------------------------------
if (CPUS["M680X0"]~=null) then
@@ -1281,7 +1300,7 @@ end
--------------------------------------------------
-- Motorola/Freescale dsp56k
----@src/emu/cpu/dsp56k/dsp56k.h,CPUS += DSP56156
+--@src/emu/cpu/dsp56k/dsp56k.h,CPUS["DSP56156"] = true
--------------------------------------------------
if (CPUS["DSP56156"]~=null) then
@@ -1306,8 +1325,8 @@ end
--------------------------------------------------
-- PDP-1
-- TX0
----@src/emu/cpu/pdp1/pdp1.h,CPUS += PDP1
----@src/emu/cpu/pdp1/tx0.h,CPUS += PDP1
+--@src/emu/cpu/pdp1/pdp1.h,CPUS["PDP1"] = true
+--@src/emu/cpu/pdp1/tx0.h,CPUS["PDP1"] = true
--------------------------------------------------
if (CPUS["PDP1"]~=null) then
@@ -1326,7 +1345,7 @@ end
--------------------------------------------------
-- Motorola PowerPC series
----@src/emu/cpu/powerpc/ppc.h,CPUS += POWERPC
+--@src/emu/cpu/powerpc/ppc.h,CPUS["POWERPC"] = true
--------------------------------------------------
if (CPUS["POWERPC"]~=null) then
@@ -1345,8 +1364,8 @@ end
--------------------------------------------------
-- NEC V-series Intel-compatible
----@src/emu/cpu/nec/nec.h,CPUS += NEC
----@src/emu/cpu/v30mz/v30mz.h,CPUS += V30MZ
+--@src/emu/cpu/nec/nec.h,CPUS["NEC"] = true
+--@src/emu/cpu/v30mz/v30mz.h,CPUS["V30MZ"] = true
--------------------------------------------------
if (CPUS["NEC"]~=null) then
@@ -1378,7 +1397,7 @@ end
--------------------------------------------------
-- NEC V60/V70
----@src/emu/cpu/v60/v60.h,CPUS += V60
+--@src/emu/cpu/v60/v60.h,CPUS["V60"] = true
--------------------------------------------------
if (CPUS["V60"]~=null) then
@@ -1394,7 +1413,7 @@ end
--------------------------------------------------
-- NEC V810 (uPD70732)
----@src/emu/cpu/v810/v810.h,CPUS += V810
+--@src/emu/cpu/v810/v810.h,CPUS["V810"] = true
--------------------------------------------------
if (CPUS["V810"]~=null) then
@@ -1410,7 +1429,7 @@ end
--------------------------------------------------
-- NEC uPD7725
----@src/emu/cpu/upd7725/upd7725.h,CPUS += UPD7725
+--@src/emu/cpu/upd7725/upd7725.h,CPUS["UPD7725"] = true
--------------------------------------------------
if (CPUS["UPD7725"]~=null) then
@@ -1426,7 +1445,7 @@ end
--------------------------------------------------
-- NEC uPD7810 series
----@src/emu/cpu/upd7810/upd7810.h,CPUS += UPD7810
+--@src/emu/cpu/upd7810/upd7810.h,CPUS["UPD7810"] = true
--------------------------------------------------
if (CPUS["UPD7810"]~=null) then
@@ -1444,13 +1463,14 @@ end
--------------------------------------------------
-- NEC uCOM-4 series
----@src/emu/cpu/ucom4/ucom4.h,CPUS += UCOM4
+--@src/emu/cpu/ucom4/ucom4.h,CPUS["UCOM4"] = true
--------------------------------------------------
if (CPUS["UCOM4"]~=null) then
files {
MAME_DIR .. "src/emu/cpu/ucom4/ucom4.c",
MAME_DIR .. "src/emu/cpu/ucom4/ucom4.h",
+ MAME_DIR .. "src/emu/cpu/ucom4/ucom4op.c",
}
end
@@ -1460,7 +1480,7 @@ end
--------------------------------------------------
-- Nintendo Minx
----@src/emu/cpu/minx/minx.h,CPUS += MINX
+--@src/emu/cpu/minx/minx.h,CPUS["MINX"] = true
--------------------------------------------------
if (CPUS["MINX"]~=null) then
@@ -1476,7 +1496,7 @@ end
--------------------------------------------------
-- Nintendo/SGI RSP (R3000-based + vector processing)
----@src/emu/cpu/rsp/rsp.h,CPUS += RSP
+--@src/emu/cpu/rsp/rsp.h,CPUS["RSP"] = true
--------------------------------------------------
if (CPUS["RSP"]~=null) then
@@ -1490,6 +1510,32 @@ if (CPUS["RSP"]~=null) then
MAME_DIR .. "src/emu/cpu/rsp/rspcp2.h",
MAME_DIR .. "src/emu/cpu/rsp/rspcp2d.c",
MAME_DIR .. "src/emu/cpu/rsp/rspcp2d.h",
+ MAME_DIR .. "src/emu/cpu/rsp/clamp.h",
+ MAME_DIR .. "src/emu/cpu/rsp/vabs.h",
+ MAME_DIR .. "src/emu/cpu/rsp/vadd.h",
+ MAME_DIR .. "src/emu/cpu/rsp/vaddc.h",
+ MAME_DIR .. "src/emu/cpu/rsp/vand.h",
+ MAME_DIR .. "src/emu/cpu/rsp/vch.h",
+ MAME_DIR .. "src/emu/cpu/rsp/vcl.h",
+ MAME_DIR .. "src/emu/cpu/rsp/vcmp.h",
+ MAME_DIR .. "src/emu/cpu/rsp/vcr.h",
+ MAME_DIR .. "src/emu/cpu/rsp/vdivh.h",
+ MAME_DIR .. "src/emu/cpu/rsp/vldst.h",
+ MAME_DIR .. "src/emu/cpu/rsp/vmac.h",
+ MAME_DIR .. "src/emu/cpu/rsp/vmov.h",
+ MAME_DIR .. "src/emu/cpu/rsp/vmrg.h",
+ MAME_DIR .. "src/emu/cpu/rsp/vmudh.h",
+ MAME_DIR .. "src/emu/cpu/rsp/vmul.h",
+ MAME_DIR .. "src/emu/cpu/rsp/vmulh.h",
+ MAME_DIR .. "src/emu/cpu/rsp/vmull.h",
+ MAME_DIR .. "src/emu/cpu/rsp/vmulm.h",
+ MAME_DIR .. "src/emu/cpu/rsp/vmuln.h",
+ MAME_DIR .. "src/emu/cpu/rsp/vor.h",
+ MAME_DIR .. "src/emu/cpu/rsp/vrcpsq.h",
+ MAME_DIR .. "src/emu/cpu/rsp/vrsq.h",
+ MAME_DIR .. "src/emu/cpu/rsp/vsub.h",
+ MAME_DIR .. "src/emu/cpu/rsp/vsubc.h",
+ MAME_DIR .. "src/emu/cpu/rsp/vxor.h",
}
end
@@ -1499,7 +1545,7 @@ end
--------------------------------------------------
-- Panasonic MN10200
----@src/emu/cpu/mn10200/mn10200.h,CPUS += MN10200
+--@src/emu/cpu/mn10200/mn10200.h,CPUS["MN10200"] = true
--------------------------------------------------
if (CPUS["MN10200"]~=null) then
@@ -1515,7 +1561,7 @@ end
--------------------------------------------------
-- Saturn
----@src/emu/cpu/saturn/saturn.h,CPUS += SATURN
+--@src/emu/cpu/saturn/saturn.h,CPUS["SATURN"] = true
--------------------------------------------------
if (CPUS["SATURN"]~=null) then
@@ -1530,8 +1576,43 @@ if (CPUS["SATURN"]~=null or _OPTIONS["with-tools"]) then
end
--------------------------------------------------
+-- Sharp SM510 series
+--@src/emu/cpu/sm510/sm510.h,CPUS["SM510"] = true
+--------------------------------------------------
+
+if (CPUS["SM510"]~=null) then
+ files {
+ MAME_DIR .. "src/emu/cpu/sm510/sm510.c",
+ MAME_DIR .. "src/emu/cpu/sm510/sm510.h",
+ MAME_DIR .. "src/emu/cpu/sm510/sm510op.c",
+ MAME_DIR .. "src/emu/cpu/sm510/sm510core.c",
+ MAME_DIR .. "src/emu/cpu/sm510/sm511core.c",
+ }
+end
+
+if (CPUS["SM510"]~=null or _OPTIONS["with-tools"]) then
+ table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/sm510/sm510d.c")
+end
+
+--------------------------------------------------
+-- Sharp SM8500
+--@src/emu/cpu/sm8500/sm8500.h,CPUS["SM8500"] = true
+--------------------------------------------------
+
+if (CPUS["SM8500"]~=null) then
+ files {
+ MAME_DIR .. "src/emu/cpu/sm8500/sm8500.c",
+ MAME_DIR .. "src/emu/cpu/sm8500/sm8500.h",
+ }
+end
+
+if (CPUS["SM8500"]~=null or _OPTIONS["with-tools"]) then
+ table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/sm8500/sm8500d.c")
+end
+
+--------------------------------------------------
-- Signetics 2650
----@src/emu/cpu/s2650/s2650.h,CPUS += S2650
+--@src/emu/cpu/s2650/s2650.h,CPUS["S2650"] = true
--------------------------------------------------
if (CPUS["S2650"]~=null) then
@@ -1547,7 +1628,7 @@ end
--------------------------------------------------
-- SC61860
----@src/emu/cpu/sc61860/sc61860.h,CPUS += SC61860
+--@src/emu/cpu/sc61860/sc61860.h,CPUS["SC61860"] = true
--------------------------------------------------
if (CPUS["SC61860"]~=null) then
@@ -1562,24 +1643,8 @@ if (CPUS["SC61860"]~=null or _OPTIONS["with-tools"]) then
end
--------------------------------------------------
--- SM8500
----@src/emu/cpu/sm8500/sm8500.h,CPUS += SM8500
---------------------------------------------------
-
-if (CPUS["SM8500"]~=null) then
- files {
- MAME_DIR .. "src/emu/cpu/sm8500/sm8500.c",
- MAME_DIR .. "src/emu/cpu/sm8500/sm8500.h",
- }
-end
-
-if (CPUS["SM8500"]~=null or _OPTIONS["with-tools"]) then
- table.insert(disasm_files , MAME_DIR .. "src/emu/cpu/sm8500/sm8500d.c")
-end
-
---------------------------------------------------
-- Sony/Nintendo SPC700
----@src/emu/cpu/spc700/spc700.h,CPUS += SPC700
+--@src/emu/cpu/spc700/spc700.h,CPUS["SPC700"] = true
--------------------------------------------------
if (CPUS["SPC700"]~=null) then
@@ -1595,7 +1660,7 @@ end
--------------------------------------------------
-- SSP1601
----@src/emu/cpu/ssp1601/ssp1601.h,CPUS += SSP1601
+--@src/emu/cpu/ssp1601/ssp1601.h,CPUS["SSP1601"] = true
--------------------------------------------------
if (CPUS["SSP1601"]~=null) then
@@ -1611,7 +1676,7 @@ end
--------------------------------------------------
-- SunPlus u'nSP
----@src/emu/cpu/unsp/unsp.h,CPUS += UNSP
+--@src/emu/cpu/unsp/unsp.h,CPUS["UNSP"] = true
--------------------------------------------------
if (CPUS["UNSP"]~=null) then
@@ -1627,7 +1692,7 @@ end
--------------------------------------------------
-- Atmel 8-bit AVR
----@src/emu/cpu/avr8/avr8.h,CPUS += AVR8
+--@src/emu/cpu/avr8/avr8.h,CPUS["AVR8"] = true
--------------------------------------------------
if (CPUS["AVR8"]~=null) then
@@ -1643,7 +1708,7 @@ end
--------------------------------------------------
-- Texas Instruments TMS0980
----@src/emu/cpu/tms0980/tms0980.h,CPUS += TMS0980
+--@src/emu/cpu/tms0980/tms0980.h,CPUS["TMS0980"] = true
--------------------------------------------------
if (CPUS["TMS0980"]~=null) then
@@ -1659,7 +1724,7 @@ end
--------------------------------------------------
-- Texas Instruments TMS7000 series
----@src/emu/cpu/tms7000/tms7000.h,CPUS += TMS7000
+--@src/emu/cpu/tms7000/tms7000.h,CPUS["TMS7000"] = true
--------------------------------------------------
if (CPUS["TMS7000"]~=null) then
@@ -1675,9 +1740,9 @@ end
--------------------------------------------------
-- Texas Instruments TMS99xx series
----@src/emu/cpu/tms9900/tms9900.h,CPUS += TMS9900
----@src/emu/cpu/tms9900/tms9980a.h,CPUS += TMS9900
----@src/emu/cpu/tms9900/tms9995.h,CPUS += TMS9900
+--@src/emu/cpu/tms9900/tms9900.h,CPUS["TMS9900"] = true
+--@src/emu/cpu/tms9900/tms9980a.h,CPUS["TMS9900"] = true
+--@src/emu/cpu/tms9900/tms9995.h,CPUS["TMS9900"] = true
--------------------------------------------------
@@ -1700,7 +1765,7 @@ end
--------------------------------------------------
-- Texas Instruments TMS340x0 graphics controllers
----@src/emu/cpu/tms34010/tms34010.h,CPUS += TMS340X0
+--@src/emu/cpu/tms34010/tms34010.h,CPUS["TMS340X0"] = true
--------------------------------------------------
if (CPUS["TMS340X0"]~=null) then
@@ -1716,7 +1781,7 @@ end
--------------------------------------------------
-- Texas Instruments TMS3201x DSP
----@src/emu/cpu/tms32010/tms32010.h,CPUS += TMS32010
+--@src/emu/cpu/tms32010/tms32010.h,CPUS["TMS32010"] = true
--------------------------------------------------
if (CPUS["TMS32010"]~=null) then
@@ -1732,7 +1797,7 @@ end
--------------------------------------------------
-- Texas Instruments TMS3202x DSP
----@src/emu/cpu/tms32025/tms32025.h,CPUS += TMS32025
+--@src/emu/cpu/tms32025/tms32025.h,CPUS["TMS32025"] = true
--------------------------------------------------
if (CPUS["TMS32025"]~=null) then
@@ -1748,7 +1813,7 @@ end
--------------------------------------------------
-- Texas Instruments TMS3203x DSP
----@src/emu/cpu/tms32031/tms32031.h,CPUS += TMS32031
+--@src/emu/cpu/tms32031/tms32031.h,CPUS["TMS32031"] = true
--------------------------------------------------
if (CPUS["TMS32031"]~=null) then
@@ -1764,7 +1829,7 @@ end
--------------------------------------------------
-- Texas Instruments TMS3205x DSP
----@src/emu/cpu/tms32051/tms32051.h,CPUS += TMS32051
+--@src/emu/cpu/tms32051/tms32051.h,CPUS["TMS32051"] = true
--------------------------------------------------
if (CPUS["TMS32051"]~=null) then
@@ -1780,7 +1845,7 @@ end
--------------------------------------------------
-- Texas Instruments TMS3208x DSP
----@src/emu/cpu/tms32082/tms32082.h,CPUS += TMS32082_MP
+--@src/emu/cpu/tms32082/tms32082.h,CPUS["TMS32082"] = true
--------------------------------------------------
if (CPUS["TMS32082"]~=null) then
@@ -1798,7 +1863,7 @@ end
--------------------------------------------------
-- Texas Instruments TMS57002 DSP
----@src/emu/cpu/tms57002/tms57002.h,CPUS += TMS57002
+--@src/emu/cpu/tms57002/tms57002.h,CPUS["TMS57002"] = true
--------------------------------------------------
if (CPUS["TMS57002"]~=null) then
@@ -1824,7 +1889,7 @@ end
--------------------------------------------------
-- Toshiba TLCS-90 Series
----@src/emu/cpu/tlcs90/tlcs90.h,CPUS += TLCS90
+--@src/emu/cpu/tlcs90/tlcs90.h,CPUS["TLCS90"] = true
--------------------------------------------------
if (CPUS["TLCS90"]~=null) then
@@ -1836,7 +1901,7 @@ end
--------------------------------------------------
-- Toshiba TLCS-900 Series
----@src/emu/cpu/tlcs900/tlcs900.h,CPUS += TLCS900
+--@src/emu/cpu/tlcs900/tlcs900.h,CPUS["TLCS900"] = true
--------------------------------------------------
if (CPUS["TLCS900"]~=null) then
@@ -1852,7 +1917,8 @@ end
--------------------------------------------------
-- Zilog Z80
----@src/emu/cpu/z80/z80.h,CPUS += Z80
+--@src/emu/cpu/z80/z80.h,CPUS["Z80"] = true
+--@src/emu/cpu/z80/z80daisy.h,CPUS["Z80"] = true
--------------------------------------------------
if (CPUS["Z80"]~=null) then
@@ -1876,7 +1942,7 @@ end
--------------------------------------------------
-- Sharp LR35902 (Game Boy CPU)
----@src/emu/cpu/lr35902/lr35902.h,CPUS += LR35902
+--@src/emu/cpu/lr35902/lr35902.h,CPUS["LR35902"] = true
--------------------------------------------------
if (CPUS["LR35902"]~=null) then
@@ -1892,7 +1958,7 @@ end
--------------------------------------------------
-- Zilog Z180
----@src/emu/cpu/z180/z180.h,CPUS += Z180
+--@src/emu/cpu/z180/z180.h,CPUS["Z180"] = true
--------------------------------------------------
if (CPUS["Z180"]~=null) then
@@ -1910,7 +1976,7 @@ end
--------------------------------------------------
-- Zilog Z8000
----@src/emu/cpu/z8000/z8000.h,CPUS += Z8000
+--@src/emu/cpu/z8000/z8000.h,CPUS["Z8000"] = true
--------------------------------------------------
if (CPUS["Z8000"]~=null) then
@@ -1926,7 +1992,7 @@ end
--------------------------------------------------
-- Zilog Z8
----@src/emu/cpu/z8/z8.h,CPUS += Z8
+--@src/emu/cpu/z8/z8.h,CPUS["Z8"] = true
--------------------------------------------------
if (CPUS["Z8"]~=null) then
@@ -1942,7 +2008,7 @@ end
--------------------------------------------------
-- Argonaut SuperFX
----@src/emu/cpu/superfx/superfx.h,CPUS += SUPERFX
+--@src/emu/cpu/superfx/superfx.h,CPUS["SUPERFX"] = true
--------------------------------------------------
if (CPUS["SUPERFX"]~=null) then
@@ -1958,7 +2024,7 @@ end
--------------------------------------------------
-- Rockwell PPS-4
----@src/emu/cpu/pps4/pps4.h,CPUS += PPS4
+--@src/emu/cpu/pps4/pps4.h,CPUS["PPS4"] = true
--------------------------------------------------
if (CPUS["PPS4"]~=null) then
@@ -1974,7 +2040,7 @@ end
--------------------------------------------------
-- Hitachi HD61700
----@src/emu/cpu/hd61700/hd61700.h,CPUS += HD61700
+--@src/emu/cpu/hd61700/hd61700.h,CPUS["HD61700"] = true
--------------------------------------------------
if (CPUS["HD61700"]~=null) then
@@ -1990,7 +2056,7 @@ end
--------------------------------------------------
-- Sanyo LC8670
----@src/emu/cpu/lc8670/lc8670.h,CPUS += LC8670
+--@src/emu/cpu/lc8670/lc8670.h,CPUS["LC8670"] = true
--------------------------------------------------
if (CPUS["LC8670"]~=null) then
@@ -2006,7 +2072,7 @@ end
--------------------------------------------------
-- Sega SCU DSP
----@src/emu/cpu/scudsp/scudsp.h,CPUS += SCUDSP
+--@src/emu/cpu/scudsp/scudsp.h,CPUS["SCUDSP"] = true
--------------------------------------------------
if (CPUS["SCUDSP"]~=null) then
@@ -2022,7 +2088,7 @@ end
--------------------------------------------------
-- Sunplus Technology S+core
----@src/emu/cpu/score/score.h,CPUS += SCORE
+--@src/emu/cpu/score/score.h,CPUS["SCORE"] = true
--------------------------------------------------
if (CPUS["SCORE"]~=null) then
@@ -2038,7 +2104,7 @@ end
--------------------------------------------------
-- Xerox Alto-II
----@src/emu/cpu/alto2/alto2cpu.h,CPUS += ALTO2
+--@src/emu/cpu/alto2/alto2cpu.h,CPUS["ALTO2"] = true
--------------------------------------------------
if (CPUS["ALTO2"]~=null) then
diff --git a/scripts/src/emu.lua b/scripts/src/emu.lua
index 3b020839b14..26c5f9edd28 100644
--- a/scripts/src/emu.lua
+++ b/scripts/src/emu.lua
@@ -2,8 +2,9 @@
-- copyright-holders:MAMEdev Team
project ("emu")
+targetsubdir(_OPTIONS["target"] .."_" .. _OPTIONS["subtarget"])
uuid ("e6fa15e4-a354-4526-acef-13c8e80fcacf")
-kind "StaticLib"
+kind (LIBTYPE)
options {
"ForceCPP",
}
@@ -14,8 +15,6 @@ includedirs {
MAME_DIR .. "src/lib",
MAME_DIR .. "src/lib/util",
MAME_DIR .. "3rdparty",
- MAME_DIR .. "3rdparty/lua/src",
- MAME_DIR .. "3rdparty/zlib",
GEN_DIR .. "emu",
GEN_DIR .. "emu/layout",
}
@@ -24,6 +23,16 @@ if _OPTIONS["with-bundled-expat"] then
MAME_DIR .. "3rdparty/expat/lib",
}
end
+if _OPTIONS["with-bundled-zlib"] then
+ includedirs {
+ MAME_DIR .. "3rdparty/zlib",
+ }
+end
+if _OPTIONS["with-bundled-lua"] then
+ includedirs {
+ MAME_DIR .. "3rdparty/lua/src",
+ }
+end
files {
MAME_DIR .. "src/emu/emu.h",
@@ -265,8 +274,6 @@ files {
MAME_DIR .. "src/emu/machine/laserdsc.h",
MAME_DIR .. "src/emu/machine/latch.c",
MAME_DIR .. "src/emu/machine/latch.h",
- MAME_DIR .. "src/emu/machine/netlist.c",
- MAME_DIR .. "src/emu/machine/netlist.h",
MAME_DIR .. "src/emu/machine/nvram.c",
MAME_DIR .. "src/emu/machine/nvram.h",
MAME_DIR .. "src/emu/machine/ram.c",
@@ -301,10 +308,12 @@ files {
MAME_DIR .. "src/emu/video/generic.h",
MAME_DIR .. "src/emu/video/resnet.c",
MAME_DIR .. "src/emu/video/resnet.h",
- MAME_DIR .. "src/emu/video/rgbutil.c",
MAME_DIR .. "src/emu/video/rgbutil.h",
+ MAME_DIR .. "src/emu/video/rgbgen.c",
MAME_DIR .. "src/emu/video/rgbgen.h",
+ MAME_DIR .. "src/emu/video/rgbsse.c",
MAME_DIR .. "src/emu/video/rgbsse.h",
+ MAME_DIR .. "src/emu/video/rgbvmx.c",
MAME_DIR .. "src/emu/video/rgbvmx.h",
MAME_DIR .. "src/emu/video/vector.c",
MAME_DIR .. "src/emu/video/vector.h",
@@ -358,7 +367,7 @@ function emuProject(_target, _subtarget)
project ("optional")
uuid (os.uuid("optional-" .. _target .."_" .. _subtarget))
- kind "StaticLib"
+ kind (LIBTYPE)
targetsubdir(_target .."_" .. _subtarget)
options {
"ForceCPP",
@@ -372,8 +381,6 @@ function emuProject(_target, _subtarget)
MAME_DIR .. "src/lib",
MAME_DIR .. "src/lib/util",
MAME_DIR .. "3rdparty",
- MAME_DIR .. "3rdparty/lua/src",
- MAME_DIR .. "3rdparty/zlib",
GEN_DIR .. "emu",
GEN_DIR .. "emu/layout",
MAME_DIR .. "src/emu/cpu/m68000",
@@ -383,21 +390,30 @@ function emuProject(_target, _subtarget)
MAME_DIR .. "3rdparty/expat/lib",
}
end
+ if _OPTIONS["with-bundled-zlib"] then
+ includedirs {
+ MAME_DIR .. "3rdparty/zlib",
+ }
+ end
+ if _OPTIONS["with-bundled-lua"] then
+ includedirs {
+ MAME_DIR .. "3rdparty/lua/src",
+ }
+ end
dofile(path.join("src", "cpu.lua"))
dofile(path.join("src", "sound.lua"))
- dofile(path.join("src", "netlist.lua"))
dofile(path.join("src", "video.lua"))
dofile(path.join("src", "machine.lua"))
-
+if (_OPTIONS["DRIVERS"] == nil) then
project ("bus")
uuid ("5d782c89-cf7e-4cfe-8f9f-0d4bfc16c91d")
- kind "StaticLib"
+ kind (LIBTYPE)
targetsubdir(_target .."_" .. _subtarget)
options {
"ForceCPP",
@@ -410,8 +426,6 @@ function emuProject(_target, _subtarget)
MAME_DIR .. "src/lib",
MAME_DIR .. "src/lib/util",
MAME_DIR .. "3rdparty",
- MAME_DIR .. "3rdparty/lua/src",
- MAME_DIR .. "3rdparty/zlib",
MAME_DIR .. "src/mess", -- some mess bus devices need this
MAME_DIR .. "src/mame", -- used for nes bus devices
GEN_DIR .. "emu",
@@ -422,13 +436,29 @@ function emuProject(_target, _subtarget)
MAME_DIR .. "3rdparty/expat/lib",
}
end
+ if _OPTIONS["with-bundled-zlib"] then
+ includedirs {
+ MAME_DIR .. "3rdparty/zlib",
+ }
+ end
+ if _OPTIONS["with-bundled-lua"] then
+ includedirs {
+ MAME_DIR .. "3rdparty/lua/src",
+ }
+ end
dofile(path.join("src", "bus.lua"))
+else
+ dofile(path.join("src", "bus.lua"))
+end
+ -- netlist now defines a project
+ dofile(path.join("src", "netlist.lua"))
+
project ("dasm")
uuid ("f2d28b0a-6da5-4f78-b629-d834aa00429d")
- kind "StaticLib"
+ kind (LIBTYPE)
targetsubdir(_target .."_" .. _subtarget)
options {
"ForceCPP",
@@ -440,8 +470,6 @@ function emuProject(_target, _subtarget)
MAME_DIR .. "src/lib",
MAME_DIR .. "src/lib/util",
MAME_DIR .. "3rdparty",
- MAME_DIR .. "3rdparty/lua/src",
- MAME_DIR .. "3rdparty/zlib",
GEN_DIR .. "emu",
}
if _OPTIONS["with-bundled-expat"] then
@@ -449,6 +477,16 @@ function emuProject(_target, _subtarget)
MAME_DIR .. "3rdparty/expat/lib",
}
end
+ if _OPTIONS["with-bundled-zlib"] then
+ includedirs {
+ MAME_DIR .. "3rdparty/zlib",
+ }
+ end
+ if _OPTIONS["with-bundled-lua"] then
+ includedirs {
+ MAME_DIR .. "3rdparty/lua/src",
+ }
+ end
files {
disasm_files
diff --git a/scripts/src/lib.lua b/scripts/src/lib.lua
index 166ab4beddb..b445f71a994 100644
--- a/scripts/src/lib.lua
+++ b/scripts/src/lib.lua
@@ -3,7 +3,7 @@
project "utils"
uuid "22489ad0-4cb2-4d91-ad81-24b0d80ca30a"
- kind "StaticLib"
+ kind (LIBTYPE)
options {
"ForceCPP",
@@ -13,13 +13,17 @@ project "utils"
MAME_DIR .. "src/osd",
MAME_DIR .. "src/lib/util",
MAME_DIR .. "3rdparty",
- MAME_DIR .. "3rdparty/zlib",
}
if _OPTIONS["with-bundled-expat"] then
includedirs {
MAME_DIR .. "3rdparty/expat/lib",
}
end
+ if _OPTIONS["with-bundled-zlib"] then
+ includedirs {
+ MAME_DIR .. "3rdparty/zlib",
+ }
+ end
files {
MAME_DIR .. "src/lib/util/bitstream.h",
@@ -95,7 +99,7 @@ project "utils"
project "formats"
uuid "f69636b1-fcce-45ce-b09a-113e371a2d7a"
- kind "StaticLib"
+ kind (LIBTYPE)
options {
"ForceCPP",
@@ -108,10 +112,17 @@ project "formats"
MAME_DIR .. "src/lib",
MAME_DIR .. "src/lib/util",
MAME_DIR .. "3rdparty",
- MAME_DIR .. "3rdparty/zlib",
}
+ if _OPTIONS["with-bundled-zlib"] then
+ includedirs {
+ MAME_DIR .. "3rdparty/zlib",
+ }
+ end
+
files {
+ MAME_DIR .. "src/lib/formats/2d_dsk.c",
+ MAME_DIR .. "src/lib/formats/2d_dsk.h",
MAME_DIR .. "src/lib/formats/cassimg.c",
MAME_DIR .. "src/lib/formats/cassimg.h",
MAME_DIR .. "src/lib/formats/flopimg.c",
@@ -154,8 +165,6 @@ project "formats"
MAME_DIR .. "src/lib/formats/asst128_dsk.h",
MAME_DIR .. "src/lib/formats/atari_dsk.c",
MAME_DIR .. "src/lib/formats/atari_dsk.h",
- MAME_DIR .. "src/lib/formats/atarist_dsk.c",
- MAME_DIR .. "src/lib/formats/atarist_dsk.h",
MAME_DIR .. "src/lib/formats/atom_tap.c",
MAME_DIR .. "src/lib/formats/atom_tap.h",
MAME_DIR .. "src/lib/formats/bbc_dsk.c",
@@ -178,14 +187,14 @@ project "formats"
MAME_DIR .. "src/lib/formats/cbm_tap.h",
MAME_DIR .. "src/lib/formats/ccvf_dsk.c",
MAME_DIR .. "src/lib/formats/ccvf_dsk.h",
+ MAME_DIR .. "src/lib/formats/cd90_640_dsk.c",
+ MAME_DIR .. "src/lib/formats/cd90_640_dsk.h",
MAME_DIR .. "src/lib/formats/cgen_cas.c",
MAME_DIR .. "src/lib/formats/cgen_cas.h",
MAME_DIR .. "src/lib/formats/cgenie_dsk.c",
MAME_DIR .. "src/lib/formats/cgenie_dsk.h",
MAME_DIR .. "src/lib/formats/coco_cas.c",
MAME_DIR .. "src/lib/formats/coco_cas.h",
- MAME_DIR .. "src/lib/formats/coco_dsk.c",
- MAME_DIR .. "src/lib/formats/coco_dsk.h",
MAME_DIR .. "src/lib/formats/comx35_dsk.c",
MAME_DIR .. "src/lib/formats/comx35_dsk.h",
MAME_DIR .. "src/lib/formats/concept_dsk.c",
@@ -249,16 +258,22 @@ project "formats"
MAME_DIR .. "src/lib/formats/g64_dsk.h",
MAME_DIR .. "src/lib/formats/gtp_cas.c",
MAME_DIR .. "src/lib/formats/gtp_cas.h",
+ MAME_DIR .. "src/lib/formats/guab_dsk.c",
+ MAME_DIR .. "src/lib/formats/guab_dsk.h",
MAME_DIR .. "src/lib/formats/hect_dsk.c",
MAME_DIR .. "src/lib/formats/hect_dsk.h",
MAME_DIR .. "src/lib/formats/hect_tap.c",
MAME_DIR .. "src/lib/formats/hect_tap.h",
+ MAME_DIR .. "src/lib/formats/hector_minidisc.c",
+ MAME_DIR .. "src/lib/formats/hector_minidisc.h",
MAME_DIR .. "src/lib/formats/iq151_dsk.c",
MAME_DIR .. "src/lib/formats/iq151_dsk.h",
MAME_DIR .. "src/lib/formats/imd_dsk.c",
MAME_DIR .. "src/lib/formats/imd_dsk.h",
MAME_DIR .. "src/lib/formats/ipf_dsk.c",
MAME_DIR .. "src/lib/formats/ipf_dsk.h",
+ MAME_DIR .. "src/lib/formats/jvc_dsk.c",
+ MAME_DIR .. "src/lib/formats/jvc_dsk.h",
MAME_DIR .. "src/lib/formats/kaypro_dsk.c",
MAME_DIR .. "src/lib/formats/kaypro_dsk.h",
MAME_DIR .. "src/lib/formats/kc_cas.c",
@@ -311,6 +326,8 @@ project "formats"
MAME_DIR .. "src/lib/formats/pc98fdi_dsk.h",
MAME_DIR .. "src/lib/formats/phc25_cas.c",
MAME_DIR .. "src/lib/formats/phc25_cas.h",
+ MAME_DIR .. "src/lib/formats/pk8020_dsk.c",
+ MAME_DIR .. "src/lib/formats/pk8020_dsk.h",
MAME_DIR .. "src/lib/formats/pmd_cas.c",
MAME_DIR .. "src/lib/formats/pmd_cas.h",
MAME_DIR .. "src/lib/formats/primoptp.c",
@@ -361,8 +378,8 @@ project "formats"
MAME_DIR .. "src/lib/formats/trd_dsk.h",
MAME_DIR .. "src/lib/formats/trs_cas.c",
MAME_DIR .. "src/lib/formats/trs_cas.h",
- MAME_DIR .. "src/lib/formats/trs_dsk.c",
- MAME_DIR .. "src/lib/formats/trs_dsk.h",
+ MAME_DIR .. "src/lib/formats/trs80_dsk.c",
+ MAME_DIR .. "src/lib/formats/trs80_dsk.h",
MAME_DIR .. "src/lib/formats/tvc_cas.c",
MAME_DIR .. "src/lib/formats/tvc_cas.h",
MAME_DIR .. "src/lib/formats/tvc_dsk.c",
@@ -373,16 +390,16 @@ project "formats"
MAME_DIR .. "src/lib/formats/uef_cas.h",
MAME_DIR .. "src/lib/formats/upd765_dsk.c",
MAME_DIR .. "src/lib/formats/upd765_dsk.h",
+ MAME_DIR .. "src/lib/formats/vdk_dsk.c",
+ MAME_DIR .. "src/lib/formats/vdk_dsk.h",
+ MAME_DIR .. "src/lib/formats/vector06_dsk.c",
+ MAME_DIR .. "src/lib/formats/vector06_dsk.h",
MAME_DIR .. "src/lib/formats/victor9k_dsk.c",
MAME_DIR .. "src/lib/formats/victor9k_dsk.h",
MAME_DIR .. "src/lib/formats/vg5k_cas.c",
MAME_DIR .. "src/lib/formats/vg5k_cas.h",
MAME_DIR .. "src/lib/formats/vt_cas.c",
MAME_DIR .. "src/lib/formats/vt_cas.h",
- MAME_DIR .. "src/lib/formats/vt_dsk.c",
- MAME_DIR .. "src/lib/formats/vt_dsk.h",
- MAME_DIR .. "src/lib/formats/vtech1_dsk.c",
- MAME_DIR .. "src/lib/formats/vtech1_dsk.h",
MAME_DIR .. "src/lib/formats/wavfile.c",
MAME_DIR .. "src/lib/formats/wavfile.h",
MAME_DIR .. "src/lib/formats/wd177x_dsk.c",
diff --git a/scripts/src/machine.lua b/scripts/src/machine.lua
index 528cebbd3d2..cc729cd11bc 100644
--- a/scripts/src/machine.lua
+++ b/scripts/src/machine.lua
@@ -12,7 +12,7 @@
---------------------------------------------------
--
---@src/emu/machine/akiko.h,MACHINES += AKIKO
+--@src/emu/machine/akiko.h,MACHINES["AKIKO"] = true
---------------------------------------------------
if (MACHINES["AKIKO"]~=null) then
@@ -25,7 +25,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/autoconfig.h,MACHINES += AUTOCONFIG
+--@src/emu/machine/autoconfig.h,MACHINES["AUTOCONFIG"] = true
---------------------------------------------------
if (MACHINES["AUTOCONFIG"]~=null) then
@@ -38,7 +38,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/cr511b.h,MACHINES += CR511B
+--@src/emu/machine/cr511b.h,MACHINES["CR511B"] = true
---------------------------------------------------
if (MACHINES["CR511B"]~=null) then
@@ -51,7 +51,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/dmac.h,MACHINES += DMAC
+--@src/emu/machine/dmac.h,MACHINES["DMAC"] = true
---------------------------------------------------
if (MACHINES["DMAC"]~=null) then
@@ -64,7 +64,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/gayle.h,MACHINES += GAYLE
+--@src/emu/machine/gayle.h,MACHINES["GAYLE"] = true
---------------------------------------------------
if (MACHINES["GAYLE"]~=null) then
@@ -77,7 +77,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/40105.h,MACHINES += CMOS40105
+--@src/emu/machine/40105.h,MACHINES["CMOS40105"] = true
---------------------------------------------------
if (MACHINES["CMOS40105"]~=null) then
@@ -90,7 +90,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/53c7xx.h,MACHINES += NCR53C7XX
+--@src/emu/machine/53c7xx.h,MACHINES["NCR53C7XX"] = true
---------------------------------------------------
if (MACHINES["NCR53C7XX"]~=null) then
@@ -103,7 +103,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/53c810.h,MACHINES += LSI53C810
+--@src/emu/machine/53c810.h,MACHINES["LSI53C810"] = true
---------------------------------------------------
if (MACHINES["LSI53C810"]~=null) then
@@ -116,7 +116,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/6522via.h,MACHINES += 6522VIA
+--@src/emu/machine/6522via.h,MACHINES["6522VIA"] = true
---------------------------------------------------
if (MACHINES["6522VIA"]~=null) then
@@ -128,7 +128,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/6525tpi.h,MACHINES += TPI6525
+--@src/emu/machine/6525tpi.h,MACHINES["TPI6525"] = true
---------------------------------------------------
if (MACHINES["TPI6525"]~=null) then
@@ -140,7 +140,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/6532riot.h,MACHINES += RIOT6532
+--@src/emu/machine/6532riot.h,MACHINES["RIOT6532"] = true
---------------------------------------------------
if (MACHINES["RIOT6532"]~=null) then
@@ -152,7 +152,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/6821pia.h,MACHINES += 6821PIA
+--@src/emu/machine/6821pia.h,MACHINES["6821PIA"] = true
---------------------------------------------------
if (MACHINES["6821PIA"]~=null) then
@@ -164,7 +164,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/6840ptm.h,MACHINES += 6840PTM
+--@src/emu/machine/6840ptm.h,MACHINES["6840PTM"] = true
---------------------------------------------------
if (MACHINES["6840PTM"]~=null) then
@@ -176,7 +176,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/6850acia.h,MACHINES += ACIA6850
+--@src/emu/machine/6850acia.h,MACHINES["ACIA6850"] = true
---------------------------------------------------
if (MACHINES["ACIA6850"]~=null) then
@@ -188,7 +188,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/68561mpcc.h,MACHINES += 68561MPCC
+--@src/emu/machine/68561mpcc.h,MACHINES["68561MPCC"] = true
---------------------------------------------------
if (MACHINES["68561MPCC"]~=null) then
@@ -200,7 +200,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/mc68681.h,MACHINES += 68681
+--@src/emu/machine/mc68681.h,MACHINES["68681"] = true
---------------------------------------------------
if (MACHINES["68681"]~=null) then
@@ -212,7 +212,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/7200fifo.h,MACHINES += 7200FIFO
+--@src/emu/machine/7200fifo.h,MACHINES["7200FIFO"] = true
---------------------------------------------------
if (MACHINES["7200FIFO"]~=null) then
@@ -224,7 +224,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/74123.h,MACHINES += TTL74123
+--@src/emu/machine/74123.h,MACHINES["TTL74123"] = true
---------------------------------------------------
if (MACHINES["TTL74123"]~=null) then
@@ -237,7 +237,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/74145.h,MACHINES += TTL74145
+--@src/emu/machine/74145.h,MACHINES["TTL74145"] = true
---------------------------------------------------
if (MACHINES["TTL74145"]~=null) then
@@ -249,7 +249,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/74148.h,MACHINES += TTL74148
+--@src/emu/machine/74148.h,MACHINES["TTL74148"] = true
---------------------------------------------------
if (MACHINES["TTL74148"]~=null) then
@@ -261,7 +261,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/74153.h,MACHINES += TTL74153
+--@src/emu/machine/74153.h,MACHINES["TTL74153"] = true
---------------------------------------------------
if (MACHINES["TTL74153"]~=null) then
@@ -273,7 +273,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/74181.h,MACHINES += TTL74181
+--@src/emu/machine/74181.h,MACHINES["TTL74181"] = true
---------------------------------------------------
if (MACHINES["TTL74181"]~=null) then
@@ -285,7 +285,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/7474.h,MACHINES += TTL7474
+--@src/emu/machine/7474.h,MACHINES["TTL7474"] = true
---------------------------------------------------
if (MACHINES["TTL7474"]~=null) then
@@ -297,7 +297,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/8042kbdc.h,MACHINES += KBDC8042
+--@src/emu/machine/8042kbdc.h,MACHINES["KBDC8042"] = true
---------------------------------------------------
if (MACHINES["KBDC8042"]~=null) then
@@ -309,7 +309,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/8530scc.h,MACHINES += 8530SCC
+--@src/emu/machine/8530scc.h,MACHINES["8530SCC"] = true
---------------------------------------------------
if (MACHINES["8530SCC"]~=null) then
@@ -321,7 +321,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/aakart.h,MACHINES += AAKARTDEV
+--@src/emu/machine/aakart.h,MACHINES["AAKARTDEV"] = true
---------------------------------------------------
if (MACHINES["AAKARTDEV"]~=null) then
@@ -333,7 +333,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/adc0808.h,MACHINES += ADC0808
+--@src/emu/machine/adc0808.h,MACHINES["ADC0808"] = true
---------------------------------------------------
if (MACHINES["ADC0808"]~=null) then
@@ -345,7 +345,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/adc083x.h,MACHINES += ADC083X
+--@src/emu/machine/adc083x.h,MACHINES["ADC083X"] = true
---------------------------------------------------
if (MACHINES["ADC083X"]~=null) then
@@ -357,7 +357,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/adc1038.h,MACHINES += ADC1038
+--@src/emu/machine/adc1038.h,MACHINES["ADC1038"] = true
---------------------------------------------------
if (MACHINES["ADC1038"]~=null) then
@@ -369,7 +369,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/adc1213x.h,MACHINES += ADC1213X
+--@src/emu/machine/adc1213x.h,MACHINES["ADC1213X"] = true
---------------------------------------------------
if (MACHINES["ADC1213X"]~=null) then
@@ -381,7 +381,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/aicartc.h,MACHINES += AICARTC
+--@src/emu/machine/aicartc.h,MACHINES["AICARTC"] = true
---------------------------------------------------
if (MACHINES["AICARTC"]~=null) then
@@ -393,7 +393,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/am53cf96.h,MACHINES += AM53CF96
+--@src/emu/machine/am53cf96.h,MACHINES["AM53CF96"] = true
---------------------------------------------------
if (MACHINES["AM53CF96"]~=null) then
@@ -405,7 +405,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/am9517a.h,MACHINES += AM9517A
+--@src/emu/machine/am9517a.h,MACHINES["AM9517A"] = true
---------------------------------------------------
if (MACHINES["AM9517A"]~=null) then
@@ -417,7 +417,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/amigafdc.h,MACHINES += AMIGAFDC
+--@src/emu/machine/amigafdc.h,MACHINES["AMIGAFDC"] = true
---------------------------------------------------
if (MACHINES["AMIGAFDC"]~=null) then
@@ -429,7 +429,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/at28c16.h,MACHINES += AT28C16
+--@src/emu/machine/at28c16.h,MACHINES["AT28C16"] = true
---------------------------------------------------
if (MACHINES["AT28C16"]~=null) then
@@ -441,7 +441,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/at29040a.h,MACHINES += AT29040
+--@src/emu/machine/at29040a.h,MACHINES["AT29040"] = true
---------------------------------------------------
if (MACHINES["AT29040"]~=null) then
@@ -453,7 +453,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/at45dbxx.h,MACHINES += AT45DBXX
+--@src/emu/machine/at45dbxx.h,MACHINES["AT45DBXX"] = true
---------------------------------------------------
if (MACHINES["AT45DBXX"]~=null) then
@@ -465,7 +465,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/ataflash.h,MACHINES += ATAFLASH
+--@src/emu/machine/ataflash.h,MACHINES["ATAFLASH"] = true
---------------------------------------------------
if (MACHINES["ATAFLASH"]~=null) then
@@ -479,7 +479,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/ay31015.h,MACHINES += AY31015
+--@src/emu/machine/ay31015.h,MACHINES["AY31015"] = true
---------------------------------------------------
if (MACHINES["AY31015"]~=null) then
@@ -491,7 +491,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/bankdev.h,MACHINES += BANKDEV
+--@src/emu/machine/bankdev.h,MACHINES["BANKDEV"] = true
---------------------------------------------------
if (MACHINES["BANKDEV"]~=null) then
@@ -503,7 +503,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/cdp1852.h,MACHINES += CDP1852
+--@src/emu/machine/cdp1852.h,MACHINES["CDP1852"] = true
---------------------------------------------------
if (MACHINES["CDP1852"]~=null) then
@@ -515,7 +515,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/cdp1871.h,MACHINES += CDP1871
+--@src/emu/machine/cdp1871.h,MACHINES["CDP1871"] = true
---------------------------------------------------
if (MACHINES["CDP1871"]~=null) then
@@ -527,7 +527,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/com8116.h,MACHINES += COM8116
+--@src/emu/machine/com8116.h,MACHINES["COM8116"] = true
---------------------------------------------------
if (MACHINES["COM8116"]~=null) then
@@ -539,7 +539,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/cr589.h,MACHINES += CR589
+--@src/emu/machine/cr589.h,MACHINES["CR589"] = true
---------------------------------------------------
if (MACHINES["CR589"]~=null) then
@@ -551,7 +551,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/cs4031.h,MACHINES += CS4031
+--@src/emu/machine/cs4031.h,MACHINES["CS4031"] = true
---------------------------------------------------
if (MACHINES["CS4031"]~=null) then
@@ -563,7 +563,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/cs8221.h,MACHINES += CS8221
+--@src/emu/machine/cs8221.h,MACHINES["CS8221"] = true
---------------------------------------------------
if (MACHINES["CS8221"]~=null) then
@@ -575,7 +575,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/ds1204.h,MACHINES += DS1204
+--@src/emu/machine/ds1204.h,MACHINES["DS1204"] = true
---------------------------------------------------
if (MACHINES["DS1204"]~=null) then
@@ -587,7 +587,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/ds1302.h,MACHINES += DS1302
+--@src/emu/machine/ds1302.h,MACHINES["DS1302"] = true
---------------------------------------------------
if (MACHINES["DS1302"]~=null) then
@@ -599,7 +599,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/ds1315.h,MACHINES += DS1315
+--@src/emu/machine/ds1315.h,MACHINES["DS1315"] = true
---------------------------------------------------
if (MACHINES["DS1315"]~=null) then
@@ -611,7 +611,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/ds2401.h,MACHINES += DS2401
+--@src/emu/machine/ds2401.h,MACHINES["DS2401"] = true
---------------------------------------------------
if (MACHINES["DS2401"]~=null) then
@@ -623,7 +623,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/ds2404.h,MACHINES += DS2404
+--@src/emu/machine/ds2404.h,MACHINES["DS2404"] = true
---------------------------------------------------
if (MACHINES["DS2404"]~=null) then
@@ -635,7 +635,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/ds75160a.h,MACHINES += DS75160A
+--@src/emu/machine/ds75160a.h,MACHINES["DS75160A"] = true
---------------------------------------------------
if (MACHINES["DS75160A"]~=null) then
@@ -647,7 +647,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/ds75161a.h,MACHINES += DS75161A
+--@src/emu/machine/ds75161a.h,MACHINES["DS75161A"] = true
---------------------------------------------------
if (MACHINES["DS75161A"]~=null) then
@@ -659,7 +659,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/e0516.h,MACHINES += E0516
+--@src/emu/machine/e0516.h,MACHINES["E0516"] = true
---------------------------------------------------
if (MACHINES["E0516"]~=null) then
@@ -671,7 +671,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/e05a03.h,MACHINES += E05A03
+--@src/emu/machine/e05a03.h,MACHINES["E05A03"] = true
---------------------------------------------------
if (MACHINES["E05A03"]~=null) then
@@ -683,7 +683,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/e05a30.h,MACHINES += E05A30
+--@src/emu/machine/e05a30.h,MACHINES["E05A30"] = true
---------------------------------------------------
if (MACHINES["E05A30"]~=null) then
@@ -695,9 +695,9 @@ end
---------------------------------------------------
--
---@src/emu/machine/eeprom.h,MACHINES += EEPROMDEV
---@src/emu/machine/eepromser.h,MACHINES += EEPROMDEV
---@src/emu/machine/eeprompar.h,MACHINES += EEPROMDEV
+--@src/emu/machine/eeprom.h,MACHINES["EEPROMDEV"] = true
+--@src/emu/machine/eepromser.h,MACHINES["EEPROMDEV"] = true
+--@src/emu/machine/eeprompar.h,MACHINES["EEPROMDEV"] = true
---------------------------------------------------
if (MACHINES["EEPROMDEV"]~=null) then
@@ -713,7 +713,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/er2055.h,MACHINES += ER2055
+--@src/emu/machine/er2055.h,MACHINES["ER2055"] = true
---------------------------------------------------
if (MACHINES["ER2055"]~=null) then
@@ -725,7 +725,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/f3853.h,MACHINES += F3853
+--@src/emu/machine/f3853.h,MACHINES["F3853"] = true
---------------------------------------------------
if (MACHINES["F3853"]~=null) then
@@ -737,7 +737,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/hd63450.h,MACHINES += HD63450
+--@src/emu/machine/hd63450.h,MACHINES["HD63450"] = true
---------------------------------------------------
if (MACHINES["HD63450"]~=null) then
@@ -749,7 +749,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/hd64610.h,MACHINES += HD64610
+--@src/emu/machine/hd64610.h,MACHINES["HD64610"] = true
---------------------------------------------------
if (MACHINES["HD64610"]~=null) then
@@ -761,7 +761,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/i2cmem.h,MACHINES += I2CMEM
+--@src/emu/machine/i2cmem.h,MACHINES["I2CMEM"] = true
---------------------------------------------------
if (MACHINES["I2CMEM"]~=null) then
@@ -773,7 +773,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/i8155.h,MACHINES += I8155
+--@src/emu/machine/i8155.h,MACHINES["I8155"] = true
---------------------------------------------------
if (MACHINES["I8155"]~=null) then
@@ -785,7 +785,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/i8212.h,MACHINES += I8212
+--@src/emu/machine/i8212.h,MACHINES["I8212"] = true
---------------------------------------------------
if (MACHINES["I8212"]~=null) then
@@ -797,7 +797,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/i8214.h,MACHINES += I8214
+--@src/emu/machine/i8214.h,MACHINES["I8214"] = true
---------------------------------------------------
if (MACHINES["I8214"]~=null) then
@@ -809,7 +809,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/i8243.h,MACHINES += I8243
+--@src/emu/machine/i8243.h,MACHINES["I8243"] = true
---------------------------------------------------
if (MACHINES["I8243"]~=null) then
@@ -821,7 +821,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/i8251.h,MACHINES += I8251
+--@src/emu/machine/i8251.h,MACHINES["I8251"] = true
---------------------------------------------------
if (MACHINES["I8251"]~=null) then
@@ -833,7 +833,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/i8257.h,MACHINES += I8257
+--@src/emu/machine/i8257.h,MACHINES["I8257"] = true
---------------------------------------------------
if (MACHINES["I8257"]~=null) then
@@ -846,7 +846,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/i8271.h,MACHINES += I8271
+--@src/emu/machine/i8271.h,MACHINES["I8271"] = true
---------------------------------------------------
if (MACHINES["I8271"]~=null) then
@@ -858,7 +858,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/i8279.h,MACHINES += I8279
+--@src/emu/machine/i8279.h,MACHINES["I8279"] = true
---------------------------------------------------
if (MACHINES["I8279"]~=null) then
@@ -870,7 +870,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/i8355.h,MACHINES += I8355
+--@src/emu/machine/i8355.h,MACHINES["I8355"] = true
---------------------------------------------------
if (MACHINES["I8355"]~=null) then
@@ -882,7 +882,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/i80130.h,MACHINES += I80130
+--@src/emu/machine/i80130.h,MACHINES["I80130"] = true
---------------------------------------------------
if (MACHINES["I80130"]~=null) then
@@ -894,8 +894,8 @@ end
---------------------------------------------------
--
---@src/emu/machine/atadev.h,MACHINES += IDE
---@src/emu/machine/ataintf.h,MACHINES += IDE
+--@src/emu/machine/atadev.h,MACHINES["IDE"] = true
+--@src/emu/machine/ataintf.h,MACHINES["IDE"] = true
---------------------------------------------------
if (MACHINES["IDE"]~=null) then
@@ -922,7 +922,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/im6402.h,MACHINES += IM6402
+--@src/emu/machine/im6402.h,MACHINES["IM6402"] = true
---------------------------------------------------
if (MACHINES["IM6402"]~=null) then
@@ -934,7 +934,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/ins8154.h,MACHINES += INS8154
+--@src/emu/machine/ins8154.h,MACHINES["INS8154"] = true
---------------------------------------------------
if (MACHINES["INS8154"]~=null) then
@@ -946,7 +946,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/ins8250.h,MACHINES += INS8250
+--@src/emu/machine/ins8250.h,MACHINES["INS8250"] = true
---------------------------------------------------
if (MACHINES["INS8250"]~=null) then
@@ -958,7 +958,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/intelfsh.h,MACHINES += INTELFLASH
+--@src/emu/machine/intelfsh.h,MACHINES["INTELFLASH"] = true
---------------------------------------------------
if (MACHINES["INTELFLASH"]~=null) then
@@ -970,8 +970,8 @@ end
---------------------------------------------------
--
---@src/emu/machine/jvsdev.h,MACHINES += JVS
---@src/emu/machine/jvshost.h,MACHINES += JVS
+--@src/emu/machine/jvsdev.h,MACHINES["JVS"] = true
+--@src/emu/machine/jvshost.h,MACHINES["JVS"] = true
---------------------------------------------------
if (MACHINES["JVS"]~=null) then
@@ -985,7 +985,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/k033906.h,MACHINES += K033906
+--@src/emu/machine/k033906.h,MACHINES["K033906"] = true
---------------------------------------------------
if (MACHINES["K033906"]~=null) then
@@ -997,7 +997,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/k053252.h,MACHINES += K053252
+--@src/emu/machine/k053252.h,MACHINES["K053252"] = true
---------------------------------------------------
if (MACHINES["K053252"]~=null) then
@@ -1009,7 +1009,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/k056230.h,MACHINES += K056230
+--@src/emu/machine/k056230.h,MACHINES["K056230"] = true
---------------------------------------------------
if (MACHINES["K056230"]~=null) then
@@ -1021,7 +1021,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/kb3600.h,MACHINES += KB3600
+--@src/emu/machine/kb3600.h,MACHINES["KB3600"] = true
---------------------------------------------------
if (MACHINES["KB3600"]~=null) then
@@ -1033,7 +1033,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/kr2376.h,MACHINES += KR2376
+--@src/emu/machine/kr2376.h,MACHINES["KR2376"] = true
---------------------------------------------------
if (MACHINES["KR2376"]~=null) then
@@ -1045,7 +1045,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/latch8.h,MACHINES += LATCH8
+--@src/emu/machine/latch8.h,MACHINES["LATCH8"] = true
---------------------------------------------------
if (MACHINES["LATCH8"]~=null) then
@@ -1057,7 +1057,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/lc89510.h,MACHINES += LC89510
+--@src/emu/machine/lc89510.h,MACHINES["LC89510"] = true
---------------------------------------------------
if (MACHINES["LC89510"]~=null) then
@@ -1069,7 +1069,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/ldpr8210.h,MACHINES += LDPR8210
+--@src/emu/machine/ldpr8210.h,MACHINES["LDPR8210"] = true
---------------------------------------------------
if (MACHINES["LDPR8210"]~=null) then
@@ -1081,7 +1081,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/ldstub.h,MACHINES += LDSTUB
+--@src/emu/machine/ldstub.h,MACHINES["LDSTUB"] = true
---------------------------------------------------
if (MACHINES["LDSTUB"]~=null) then
@@ -1093,7 +1093,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/ldv1000.h,MACHINES += LDV1000
+--@src/emu/machine/ldv1000.h,MACHINES["LDV1000"] = true
---------------------------------------------------
if (MACHINES["LDV1000"]~=null) then
@@ -1107,7 +1107,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/ldvp931.h,MACHINES += LDVP931
+--@src/emu/machine/ldvp931.h,MACHINES["LDVP931"] = true
---------------------------------------------------
if (MACHINES["LDVP931"]~=null) then
@@ -1119,7 +1119,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/lh5810.h,MACHINES += LH5810
+--@src/emu/machine/lh5810.h,MACHINES["LH5810"] = true
---------------------------------------------------
if (MACHINES["LH5810"]~=null) then
@@ -1131,7 +1131,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/linflash.h,MACHINES += LINFLASH
+--@src/emu/machine/linflash.h,MACHINES["LINFLASH"] = true
---------------------------------------------------
if (MACHINES["LINFLASH"]~=null) then
@@ -1143,7 +1143,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/m6m80011ap.h,MACHINES += M6M80011AP
+--@src/emu/machine/m6m80011ap.h,MACHINES["M6M80011AP"] = true
---------------------------------------------------
if (MACHINES["M6M80011AP"]~=null) then
@@ -1155,7 +1155,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/matsucd.h,MACHINES += MATSUCD
+--@src/emu/machine/matsucd.h,MACHINES["MATSUCD"] = true
---------------------------------------------------
if (MACHINES["MATSUCD"]~=null) then
@@ -1167,7 +1167,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/mb14241.h,MACHINES += MB14241
+--@src/emu/machine/mb14241.h,MACHINES["MB14241"] = true
---------------------------------------------------
if (MACHINES["MB14241"]~=null) then
@@ -1179,7 +1179,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/mb3773.h,MACHINES += MB3773
+--@src/emu/machine/mb3773.h,MACHINES["MB3773"] = true
---------------------------------------------------
if (MACHINES["MB3773"]~=null) then
@@ -1191,7 +1191,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/mb8421.h,MACHINES += MB8421
+--@src/emu/machine/mb8421.h,MACHINES["MB8421"] = true
---------------------------------------------------
if (MACHINES["MB8421"]~=null) then
@@ -1203,7 +1203,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/mb87078.h,MACHINES += MB87078
+--@src/emu/machine/mb87078.h,MACHINES["MB87078"] = true
---------------------------------------------------
if (MACHINES["MB87078"]~=null) then
@@ -1215,7 +1215,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/mb8795.h,MACHINES += MB8795
+--@src/emu/machine/mb8795.h,MACHINES["MB8795"] = true
---------------------------------------------------
if (MACHINES["MB8795"]~=null) then
@@ -1227,7 +1227,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/mb89352.h,MACHINES += MB89352
+--@src/emu/machine/mb89352.h,MACHINES["MB89352"] = true
---------------------------------------------------
if (MACHINES["MB89352"]~=null) then
@@ -1239,7 +1239,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/mb89371.h,MACHINES += MB89371
+--@src/emu/machine/mb89371.h,MACHINES["MB89371"] = true
---------------------------------------------------
if (MACHINES["MB89371"]~=null) then
@@ -1251,7 +1251,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/mc146818.h,MACHINES += MC146818
+--@src/emu/machine/mc146818.h,MACHINES["MC146818"] = true
---------------------------------------------------
if (MACHINES["MC146818"]~=null) then
@@ -1265,7 +1265,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/mc2661.h,MACHINES += MC2661
+--@src/emu/machine/mc2661.h,MACHINES["MC2661"] = true
---------------------------------------------------
if (MACHINES["MC2661"]~=null) then
@@ -1277,7 +1277,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/mc6843.h,MACHINES += MC6843
+--@src/emu/machine/mc6843.h,MACHINES["MC6843"] = true
---------------------------------------------------
if (MACHINES["MC6843"]~=null) then
@@ -1289,7 +1289,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/mc6846.h,MACHINES += MC6846
+--@src/emu/machine/mc6846.h,MACHINES["MC6846"] = true
---------------------------------------------------
if (MACHINES["MC6846"]~=null) then
@@ -1301,7 +1301,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/mc6852.h,MACHINES += MC6852
+--@src/emu/machine/mc6852.h,MACHINES["MC6852"] = true
---------------------------------------------------
if (MACHINES["MC6852"]~=null) then
@@ -1313,7 +1313,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/mc6854.h,MACHINES += MC6854
+--@src/emu/machine/mc6854.h,MACHINES["MC6854"] = true
---------------------------------------------------
if (MACHINES["MC6854"]~=null) then
@@ -1325,7 +1325,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/mc68328.h,MACHINES += MC68328
+--@src/emu/machine/mc68328.h,MACHINES["MC68328"] = true
---------------------------------------------------
if (MACHINES["MC68328"]~=null) then
@@ -1337,7 +1337,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/mc68901.h,MACHINES += MC68901
+--@src/emu/machine/mc68901.h,MACHINES["MC68901"] = true
---------------------------------------------------
if (MACHINES["MC68901"]~=null) then
@@ -1349,7 +1349,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/mccs1850.h,MACHINES += MCCS1850
+--@src/emu/machine/mccs1850.h,MACHINES["MCCS1850"] = true
---------------------------------------------------
if (MACHINES["MCCS1850"]~=null) then
@@ -1361,7 +1361,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/68307.h,MACHINES += M68307
+--@src/emu/machine/68307.h,MACHINES["M68307"] = true
---------------------------------------------------
if (MACHINES["M68307"]~=null) then
@@ -1379,7 +1379,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/68340.h,MACHINES += M68340
+--@src/emu/machine/68340.h,MACHINES["M68340"] = true
---------------------------------------------------
if (MACHINES["M68340"]~=null) then
@@ -1399,7 +1399,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/mcf5206e.h,MACHINES += MCF5206E
+--@src/emu/machine/mcf5206e.h,MACHINES["MCF5206E"] = true
---------------------------------------------------
if (MACHINES["MCF5206E"]~=null) then
@@ -1411,7 +1411,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/microtch.h,MACHINES += MICROTOUCH
+--@src/emu/machine/microtch.h,MACHINES["MICROTOUCH"] = true
---------------------------------------------------
if (MACHINES["MICROTOUCH"]~=null) then
@@ -1423,7 +1423,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/mm58274c.h,MACHINES += MM58274C
+--@src/emu/machine/mm58274c.h,MACHINES["MM58274C"] = true
---------------------------------------------------
if (MACHINES["MM58274C"]~=null) then
@@ -1435,7 +1435,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/mm74c922.h,MACHINES += MM74C922
+--@src/emu/machine/mm74c922.h,MACHINES["MM74C922"] = true
---------------------------------------------------
if (MACHINES["MM74C922"]~=null) then
@@ -1447,7 +1447,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/mos6526.h,MACHINES += MOS6526
+--@src/emu/machine/mos6526.h,MACHINES["MOS6526"] = true
---------------------------------------------------
if (MACHINES["MOS6526"]~=null) then
@@ -1459,7 +1459,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/mos6529.h,MACHINES += MOS6529
+--@src/emu/machine/mos6529.h,MACHINES["MOS6529"] = true
---------------------------------------------------
if (MACHINES["MOS6529"]~=null) then
@@ -1471,7 +1471,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/mos6702.h,MACHINES += MOS6702
+--@src/emu/machine/mos6702.h,MACHINES["MOS6702"] = true
---------------------------------------------------
if (MACHINES["MOS6702"]~=null) then
@@ -1483,7 +1483,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/mos8706.h,MACHINES += MOS8706
+--@src/emu/machine/mos8706.h,MACHINES["MOS8706"] = true
---------------------------------------------------
if (MACHINES["MOS8706"]~=null) then
@@ -1495,7 +1495,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/mos8722.h,MACHINES += MOS8722
+--@src/emu/machine/mos8722.h,MACHINES["MOS8722"] = true
---------------------------------------------------
if (MACHINES["MOS8722"]~=null) then
@@ -1507,7 +1507,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/mos8726.h,MACHINES += MOS8726
+--@src/emu/machine/mos8726.h,MACHINES["MOS8726"] = true
---------------------------------------------------
if (MACHINES["MOS8726"]~=null) then
@@ -1519,7 +1519,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/mos6530.h,MACHINES += MIOT6530
+--@src/emu/machine/mos6530.h,MACHINES["MIOT6530"] = true
---------------------------------------------------
if (MACHINES["MIOT6530"]~=null) then
@@ -1533,7 +1533,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/mos6551.h,MACHINES += MOS6551
+--@src/emu/machine/mos6551.h,MACHINES["MOS6551"] = true
---------------------------------------------------
if (MACHINES["MOS6551"]~=null) then
@@ -1545,7 +1545,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/msm5832.h,MACHINES += MSM5832
+--@src/emu/machine/msm5832.h,MACHINES["MSM5832"] = true
---------------------------------------------------
if (MACHINES["MSM5832"]~=null) then
@@ -1557,7 +1557,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/msm58321.h,MACHINES += MSM58321
+--@src/emu/machine/msm58321.h,MACHINES["MSM58321"] = true
---------------------------------------------------
if (MACHINES["MSM58321"]~=null) then
@@ -1569,7 +1569,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/msm6242.h,MACHINES += MSM6242
+--@src/emu/machine/msm6242.h,MACHINES["MSM6242"] = true
---------------------------------------------------
if (MACHINES["MSM6242"]~=null) then
@@ -1581,7 +1581,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/ncr539x.h,MACHINES += NCR539x
+--@src/emu/machine/ncr539x.h,MACHINES["NCR539x"] = true
---------------------------------------------------
if (MACHINES["NCR539x"]~=null) then
@@ -1594,7 +1594,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/nmc9306.h,MACHINES += NMC9306
+--@src/emu/machine/nmc9306.h,MACHINES["NMC9306"] = true
---------------------------------------------------
if (MACHINES["NMC9306"]~=null) then
@@ -1606,11 +1606,11 @@ end
---------------------------------------------------
--
---@src/emu/machine/nscsi_bus.h,MACHINES += NSCSI
---@src/emu/machine/nscsi_cb.h,MACHINES += NSCSI
---@src/emu/machine/nscsi_cd.h,MACHINES += NSCSI
---@src/emu/machine/nscsi_hd.h,MACHINES += NSCSI
---@src/emu/machine/nscsi_s1410.h,MACHINES += NSCSI
+--@src/emu/machine/nscsi_bus.h,MACHINES["NSCSI"] = true
+--@src/emu/machine/nscsi_cb.h,MACHINES["NSCSI"] = true
+--@src/emu/machine/nscsi_cd.h,MACHINES["NSCSI"] = true
+--@src/emu/machine/nscsi_hd.h,MACHINES["NSCSI"] = true
+--@src/emu/machine/nscsi_s1410.h,MACHINES["NSCSI"] = true
---------------------------------------------------
if (MACHINES["NSCSI"]~=null) then
@@ -1630,7 +1630,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/pcf8593.h,MACHINES += PCF8593
+--@src/emu/machine/pcf8593.h,MACHINES["PCF8593"] = true
---------------------------------------------------
if (MACHINES["PCF8593"]~=null) then
@@ -1642,7 +1642,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/lpci.h,MACHINES += LPCI
+--@src/emu/machine/lpci.h,MACHINES["LPCI"] = true
---------------------------------------------------
if (MACHINES["LPCI"]~=null) then
@@ -1654,7 +1654,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/pci.h,MACHINES += PCI
+--@src/emu/machine/pci.h,MACHINES["PCI"] = true
---------------------------------------------------
if (MACHINES["PCI"]~=null) then
@@ -1690,7 +1690,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/pckeybrd.h,MACHINES += PCKEYBRD
+--@src/emu/machine/pckeybrd.h,MACHINES["PCKEYBRD"] = true
---------------------------------------------------
if (MACHINES["PCKEYBRD"]~=null) then
@@ -1702,7 +1702,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/pic8259.h,MACHINES += PIC8259
+--@src/emu/machine/pic8259.h,MACHINES["PIC8259"] = true
---------------------------------------------------
if (MACHINES["PIC8259"]~=null) then
@@ -1714,7 +1714,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/pit8253.h,MACHINES += PIT8253
+--@src/emu/machine/pit8253.h,MACHINES["PIT8253"] = true
---------------------------------------------------
if (MACHINES["PIT8253"]~=null) then
@@ -1726,7 +1726,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/pla.h,MACHINES += PLA
+--@src/emu/machine/pla.h,MACHINES["PLA"] = true
---------------------------------------------------
if (MACHINES["PLA"]~=null) then
@@ -1738,7 +1738,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/r10696.h,MACHINES += R10696
+--@src/emu/machine/r10696.h,MACHINES["R10696"] = true
---------------------------------------------------
if (MACHINES["R10696"]~=null) then
@@ -1750,7 +1750,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/r10788.h,MACHINES += R10788
+--@src/emu/machine/r10788.h,MACHINES["R10788"] = true
---------------------------------------------------
if (MACHINES["R10788"]~=null) then
@@ -1762,7 +1762,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/ra17xx.h,MACHINES += RA17XX
+--@src/emu/machine/ra17xx.h,MACHINES["RA17XX"] = true
---------------------------------------------------
if (MACHINES["RA17XX"]~=null) then
@@ -1774,12 +1774,12 @@ end
---------------------------------------------------
--
---@src/emu/machine/rf5c296.h,MACHINES += RF5C296
+--@src/emu/machine/rf5c296.h,MACHINES["RF5C296"] = true
---------------------------------------------------
if (MACHINES["RF5C296"]~=null) then
MACHINES["PCCARD"] = true
- files {
+ files {
MAME_DIR .. "src/emu/machine/rf5c296.c",
MAME_DIR .. "src/emu/machine/rf5c296.h",
}
@@ -1787,7 +1787,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/roc10937.h,MACHINES += ROC10937
+--@src/emu/machine/roc10937.h,MACHINES["ROC10937"] = true
---------------------------------------------------
if (MACHINES["ROC10937"]~=null) then
@@ -1799,7 +1799,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/rp5c01.h,MACHINES += RP5C01
+--@src/emu/machine/rp5c01.h,MACHINES["RP5C01"] = true
---------------------------------------------------
if (MACHINES["RP5C01"]~=null) then
@@ -1811,7 +1811,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/rp5c15.h,MACHINES += RP5C15
+--@src/emu/machine/rp5c15.h,MACHINES["RP5C15"] = true
---------------------------------------------------
if (MACHINES["RP5C15"]~=null) then
@@ -1823,7 +1823,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/rp5h01.h,MACHINES += RP5H01
+--@src/emu/machine/rp5h01.h,MACHINES["RP5H01"] = true
---------------------------------------------------
if (MACHINES["RP5H01"]~=null) then
@@ -1835,7 +1835,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/64h156.h,MACHINES += R64H156
+--@src/emu/machine/64h156.h,MACHINES["R64H156"] = true
---------------------------------------------------
if (MACHINES["R64H156"]~=null) then
@@ -1847,7 +1847,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/rtc4543.h,MACHINES += RTC4543
+--@src/emu/machine/rtc4543.h,MACHINES["RTC4543"] = true
---------------------------------------------------
if (MACHINES["RTC4543"]~=null) then
@@ -1859,7 +1859,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/rtc65271.h,MACHINES += RTC65271
+--@src/emu/machine/rtc65271.h,MACHINES["RTC65271"] = true
---------------------------------------------------
if (MACHINES["RTC65271"]~=null) then
@@ -1871,7 +1871,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/rtc9701.h,MACHINES += RTC9701
+--@src/emu/machine/rtc9701.h,MACHINES["RTC9701"] = true
---------------------------------------------------
if (MACHINES["RTC9701"]~=null) then
@@ -1883,7 +1883,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/s2636.h,MACHINES += S2636
+--@src/emu/machine/s2636.h,MACHINES["S2636"] = true
---------------------------------------------------
if (MACHINES["S2636"]~=null) then
@@ -1895,7 +1895,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/s3520cf.h,MACHINES += S3520CF
+--@src/emu/machine/s3520cf.h,MACHINES["S3520CF"] = true
---------------------------------------------------
if (MACHINES["S3520CF"]~=null) then
@@ -1907,7 +1907,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/s3c2400.h,MACHINES += S3C2400
+--@src/emu/machine/s3c2400.h,MACHINES["S3C2400"] = true
---------------------------------------------------
if (MACHINES["S3C2400"]~=null) then
@@ -1920,7 +1920,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/s3c2410.h,MACHINES += S3C2410
+--@src/emu/machine/s3c2410.h,MACHINES["S3C2410"] = true
---------------------------------------------------
if (MACHINES["S3C2410"]~=null) then
@@ -1933,7 +1933,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/s3c44b0.h,MACHINES += S3C44B0
+--@src/emu/machine/s3c44b0.h,MACHINES["S3C44B0"] = true
---------------------------------------------------
if (MACHINES["S3C44B0"]~=null) then
@@ -1945,7 +1945,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/s3c2440.h,MACHINES += S3C2440
+--@src/emu/machine/s3c2440.h,MACHINES["S3C2440"] = true
---------------------------------------------------
if (MACHINES["S3C2440"]~=null) then
@@ -1958,7 +1958,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/saturn.h,MACHINES += SATURN
+--@src/emu/machine/saturn.h,MACHINES["SATURN"] = true
---------------------------------------------------
if (MACHINES["SATURN"]~=null) then
@@ -1969,7 +1969,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/serflash.h,MACHINES += SERFLASH
+--@src/emu/machine/serflash.h,MACHINES["SERFLASH"] = true
---------------------------------------------------
if (MACHINES["SERFLASH"]~=null) then
@@ -1981,7 +1981,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/smc91c9x.h,MACHINES += SMC91C9X
+--@src/emu/machine/smc91c9x.h,MACHINES["SMC91C9X"] = true
---------------------------------------------------
if (MACHINES["SMC91C9X"]~=null) then
@@ -1993,7 +1993,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/smpc.h,MACHINES += SMPC
+--@src/emu/machine/smpc.h,MACHINES["SMPC"] = true
---------------------------------------------------
if (MACHINES["SMPC"]~=null) then
@@ -2005,7 +2005,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/stvcd.h,MACHINES += STVCD
+--@src/emu/machine/stvcd.h,MACHINES["STVCD"] = true
---------------------------------------------------
if (MACHINES["STVCD"]~=null) then
@@ -2036,7 +2036,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/tc009xlvc.h,MACHINES += TC0091LVC
+--@src/emu/machine/tc009xlvc.h,MACHINES["TC0091LVC"] = true
---------------------------------------------------
if (MACHINES["TC0091LVC"]~=null) then
@@ -2048,7 +2048,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/timekpr.h,MACHINES += TIMEKPR
+--@src/emu/machine/timekpr.h,MACHINES["TIMEKPR"] = true
---------------------------------------------------
if (MACHINES["TIMEKPR"]~=null) then
@@ -2060,7 +2060,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/tmp68301.h,MACHINES += TMP68301
+--@src/emu/machine/tmp68301.h,MACHINES["TMP68301"] = true
---------------------------------------------------
if (MACHINES["TMP68301"]~=null) then
@@ -2072,7 +2072,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/tms1024.h,MACHINES += TMS1024
+--@src/emu/machine/tms1024.h,MACHINES["TMS1024"] = true
---------------------------------------------------
if (MACHINES["TMS1024"]~=null) then
@@ -2084,7 +2084,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/tms5501.h,MACHINES += TMS5501
+--@src/emu/machine/tms5501.h,MACHINES["TMS5501"] = true
---------------------------------------------------
if (MACHINES["TMS5501"]~=null) then
@@ -2096,7 +2096,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/tms6100.h,MACHINES += TMS6100
+--@src/emu/machine/tms6100.h,MACHINES["TMS6100"] = true
---------------------------------------------------
if (MACHINES["TMS6100"]~=null) then
@@ -2108,7 +2108,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/tms9901.h,MACHINES += TMS9901
+--@src/emu/machine/tms9901.h,MACHINES["TMS9901"] = true
---------------------------------------------------
if (MACHINES["TMS9901"]~=null) then
@@ -2120,7 +2120,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/tms9902.h,MACHINES += TMS9902
+--@src/emu/machine/tms9902.h,MACHINES["TMS9902"] = true
---------------------------------------------------
if (MACHINES["TMS9902"]~=null) then
@@ -2132,7 +2132,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/upd1990a.h,MACHINES += UPD1990A
+--@src/emu/machine/upd1990a.h,MACHINES["UPD1990A"] = true
---------------------------------------------------
if (MACHINES["UPD1990A"]~=null) then
@@ -2144,7 +2144,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/upd4992.h,MACHINES += UPD4992
+--@src/emu/machine/upd4992.h,MACHINES["UPD4992"] = true
---------------------------------------------------
if (MACHINES["UPD4992"]~=null) then
@@ -2157,7 +2157,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/upd4701.h,MACHINES += UPD4701
+--@src/emu/machine/upd4701.h,MACHINES["UPD4701"] = true
---------------------------------------------------
if (MACHINES["UPD4701"]~=null) then
@@ -2169,7 +2169,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/upd7002.h,MACHINES += UPD7002
+--@src/emu/machine/upd7002.h,MACHINES["UPD7002"] = true
---------------------------------------------------
if (MACHINES["UPD7002"]~=null) then
@@ -2181,7 +2181,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/upd71071.h,MACHINES += UPD71071
+--@src/emu/machine/upd71071.h,MACHINES["UPD71071"] = true
---------------------------------------------------
if (MACHINES["UPD71071"]~=null) then
@@ -2193,19 +2193,21 @@ end
---------------------------------------------------
--
---@src/emu/machine/upd765.h,MACHINES += UPD765
+--@src/emu/machine/upd765.h,MACHINES["UPD765"] = true
---------------------------------------------------
if (MACHINES["UPD765"]~=null) then
files {
MAME_DIR .. "src/emu/machine/upd765.c",
MAME_DIR .. "src/emu/machine/upd765.h",
+ MAME_DIR .. "src/emu/machine/fdc_pll.c",
+ MAME_DIR .. "src/emu/machine/fdc_pll.h",
}
end
---------------------------------------------------
--
---@src/emu/machine/v3021.h,MACHINES += V3021
+--@src/emu/machine/v3021.h,MACHINES["V3021"] = true
---------------------------------------------------
if (MACHINES["V3021"]~=null) then
@@ -2217,7 +2219,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/wd_fdc.h,MACHINES += WD_FDC
+--@src/emu/machine/wd_fdc.h,MACHINES["WD_FDC"] = true
---------------------------------------------------
if (MACHINES["WD_FDC"]~=null) then
@@ -2231,7 +2233,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/wd11c00_17.h,MACHINES += WD11C00_17
+--@src/emu/machine/wd11c00_17.h,MACHINES["WD11C00_17"] = true
---------------------------------------------------
if (MACHINES["WD11C00_17"]~=null) then
@@ -2243,19 +2245,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/wd17xx.h,MACHINES += WD17XX
----------------------------------------------------
-
-if (MACHINES["WD17XX"]~=null) then
- files {
- MAME_DIR .. "src/emu/machine/wd17xx.c",
- MAME_DIR .. "src/emu/machine/wd17xx.h",
- }
-end
-
----------------------------------------------------
---
---@src/emu/machine/wd2010.h,MACHINES += WD2010
+--@src/emu/machine/wd2010.h,MACHINES["WD2010"] = true
---------------------------------------------------
if (MACHINES["WD2010"]~=null) then
@@ -2267,7 +2257,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/wd33c93.h,MACHINES += WD33C93
+--@src/emu/machine/wd33c93.h,MACHINES["WD33C93"] = true
---------------------------------------------------
if (MACHINES["WD33C93"]~=null) then
@@ -2280,7 +2270,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/wd7600.h,MACHINES += WD7600
+--@src/emu/machine/wd7600.h,MACHINES["WD7600"] = true
---------------------------------------------------
if (MACHINES["WD7600"]~=null) then
@@ -2292,7 +2282,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/x2212.h,MACHINES += X2212
+--@src/emu/machine/x2212.h,MACHINES["X2212"] = true
---------------------------------------------------
if (MACHINES["X2212"]~=null) then
@@ -2304,7 +2294,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/x76f041.h,MACHINES += X76F041
+--@src/emu/machine/x76f041.h,MACHINES["X76F041"] = true
---------------------------------------------------
if (MACHINES["X76F041"]~=null) then
@@ -2316,7 +2306,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/x76f100.h,MACHINES += X76F100
+--@src/emu/machine/x76f100.h,MACHINES["X76F100"] = true
---------------------------------------------------
if (MACHINES["X76F100"]~=null) then
@@ -2328,7 +2318,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/ym2148.h,MACHINES += YM2148
+--@src/emu/machine/ym2148.h,MACHINES["YM2148"] = true
---------------------------------------------------
if (MACHINES["YM2148"]~=null) then
@@ -2340,7 +2330,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/z80ctc.h,MACHINES += Z80CTC
+--@src/emu/machine/z80ctc.h,MACHINES["Z80CTC"] = true
---------------------------------------------------
if (MACHINES["Z80CTC"]~=null) then
@@ -2352,7 +2342,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/z80dart.h,MACHINES += Z80DART
+--@src/emu/machine/z80dart.h,MACHINES["Z80DART"] = true
---------------------------------------------------
if (MACHINES["Z80DART"]~=null) then
@@ -2364,7 +2354,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/z80dma.h,MACHINES += Z80DMA
+--@src/emu/machine/z80dma.h,MACHINES["Z80DMA"] = true
---------------------------------------------------
if (MACHINES["Z80DMA"]~=null) then
@@ -2376,7 +2366,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/z80pio.h,MACHINES += Z80PIO
+--@src/emu/machine/z80pio.h,MACHINES["Z80PIO"] = true
---------------------------------------------------
if (MACHINES["Z80PIO"]~=null) then
@@ -2388,7 +2378,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/z80sti.h,MACHINES += Z80STI
+--@src/emu/machine/z80sti.h,MACHINES["Z80STI"] = true
---------------------------------------------------
if (MACHINES["Z80STI"]~=null) then
@@ -2400,7 +2390,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/z8536.h,MACHINES += Z8536
+--@src/emu/machine/z8536.h,MACHINES["Z8536"] = true
---------------------------------------------------
if (MACHINES["Z8536"]~=null) then
@@ -2412,7 +2402,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/pccard.h,MACHINES += PCCARD
+--@src/emu/machine/pccard.h,MACHINES["PCCARD"] = true
---------------------------------------------------
if (MACHINES["PCCARD"]~=null) then
@@ -2424,7 +2414,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/i8255.h,MACHINES += I8255
+--@src/emu/machine/i8255.h,MACHINES["I8255"] = true
---------------------------------------------------
if (MACHINES["I8255"]~=null) then
@@ -2438,7 +2428,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/ncr5380.h,MACHINES += NCR5380
+--@src/emu/machine/ncr5380.h,MACHINES["NCR5380"] = true
---------------------------------------------------
if (MACHINES["NCR5380"]~=null) then
@@ -2450,7 +2440,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/ncr5380n.h,MACHINES += NCR5380N
+--@src/emu/machine/ncr5380n.h,MACHINES["NCR5380N"] = true
---------------------------------------------------
if (MACHINES["NCR5380N"]~=null) then
@@ -2462,7 +2452,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/ncr5389.h,MACHINES += NCR5390
+--@src/emu/machine/ncr5389.h,MACHINES["NCR5390"] = true
---------------------------------------------------
if (MACHINES["NCR5390"]~=null) then
@@ -2474,7 +2464,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/mm58167.h,MACHINES += MM58167
+--@src/emu/machine/mm58167.h,MACHINES["MM58167"] = true
---------------------------------------------------
if (MACHINES["MM58167"]~=null) then
@@ -2487,7 +2477,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/dp8390.h,MACHINES += DP8390
+--@src/emu/machine/dp8390.h,MACHINES["DP8390"] = true
---------------------------------------------------
if (MACHINES["DP8390"]~=null) then
@@ -2499,7 +2489,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/pc_lpt.h,MACHINES += PC_LPT
+--@src/emu/machine/pc_lpt.h,MACHINES["PC_LPT"] = true
---------------------------------------------------
if (MACHINES["PC_LPT"]~=null) then
@@ -2511,7 +2501,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/pc_fdc.h,MACHINES += PC_FDC
+--@src/emu/machine/pc_fdc.h,MACHINES["PC_FDC"] = true
---------------------------------------------------
if (MACHINES["PC_FDC"]~=null) then
@@ -2523,7 +2513,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/mpu401.h,MACHINES += MPU401
+--@src/emu/machine/mpu401.h,MACHINES["MPU401"] = true
---------------------------------------------------
if (MACHINES["MPU401"]~=null) then
@@ -2535,7 +2525,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/at_keybc.h,MACHINES += AT_KEYBC
+--@src/emu/machine/at_keybc.h,MACHINES["AT_KEYBC"] = true
---------------------------------------------------
if (MACHINES["AT_KEYBC"]~=null) then
@@ -2545,21 +2535,10 @@ if (MACHINES["AT_KEYBC"]~=null) then
}
end
----------------------------------------------------
---
---@src/emu/machine/smc92x4.h,MACHINES += SMC92X4
----------------------------------------------------
-
-if (MACHINES["SMC92X4"]~=null) then
- files {
- MAME_DIR .. "src/emu/machine/smc92x4.c",
- MAME_DIR .. "src/emu/machine/smc92x4.h",
- }
-end
---------------------------------------------------
--
---@src/emu/machine/hdc9234.h,MACHINES += HDC9234
+--@src/emu/machine/hdc9234.h,MACHINES["HDC9234"] = true
---------------------------------------------------
if (MACHINES["HDC9234"]~=null) then
@@ -2571,7 +2550,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/ti99_hd.h,MACHINES += TI99_HD
+--@src/emu/machine/ti99_hd.h,MACHINES["TI99_HD"] = true
---------------------------------------------------
if (MACHINES["TI99_HD"]~=null) then
@@ -2583,7 +2562,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/strata.h,MACHINES += STRATA
+--@src/emu/machine/strata.h,MACHINES["STRATA"] = true
---------------------------------------------------
if (MACHINES["STRATA"]~=null) then
@@ -2595,7 +2574,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/steppers.h,MACHINES += STEPPERS
+--@src/emu/machine/steppers.h,MACHINES["STEPPERS"] = true
---------------------------------------------------
if (MACHINES["STEPPERS"]~=null) then
@@ -2607,7 +2586,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/corvushd.h,MACHINES += CORVUSHD
+--@src/emu/machine/corvushd.h,MACHINES["CORVUSHD"] = true
---------------------------------------------------
if (MACHINES["CORVUSHD"]~=null) then
files {
@@ -2618,7 +2597,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/wozfdc.h,MACHINES += WOZFDC
+--@src/emu/machine/wozfdc.h,MACHINES["WOZFDC"] = true
---------------------------------------------------
if (MACHINES["WOZFDC"]~=null) then
files {
@@ -2629,7 +2608,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/diablo_hd.h,MACHINES += DIABLO_HD
+--@src/emu/machine/diablo_hd.h,MACHINES["DIABLO_HD"] = true
---------------------------------------------------
if (MACHINES["DIABLO_HD"]~=null) then
files {
@@ -2640,7 +2619,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/fdc37c665gt.h,MACHINES += FDC37C665GT
+--@src/emu/machine/fdc37c665gt.h,MACHINES["FDC37C665GT"] = true
---------------------------------------------------
if (MACHINES["FDC37C665GT"]~=null) then
@@ -2652,7 +2631,7 @@ end
---------------------------------------------------
--
---@src/emu/machine/pci9050.h,MACHINES += PCI9050
+--@src/emu/machine/pci9050.h,MACHINES["PCI9050"] = true
---------------------------------------------------
if (MACHINES["PCI9050"]~=null) then
@@ -2662,3 +2641,14 @@ if (MACHINES["PCI9050"]~=null) then
}
end
+---------------------------------------------------
+--
+--@src/emu/machine/netlist.h,MACHINES["NETLIST"] = true
+---------------------------------------------------
+
+if (MACHINES["NETLIST"]~=null) then
+ files {
+ MAME_DIR .. "src/emu/machine/netlist.c",
+ MAME_DIR .. "src/emu/machine/netlist.h",
+ }
+end
diff --git a/scripts/src/main.lua b/scripts/src/main.lua
index 9559eb1f594..25cc1a32ca7 100644
--- a/scripts/src/main.lua
+++ b/scripts/src/main.lua
@@ -2,6 +2,7 @@
-- copyright-holders:MAMEdev Team
function mainProject(_target, _subtarget)
+if (_OPTIONS["DRIVERS"] == nil) then
if (_target == _subtarget) then
project (_target)
else
@@ -11,6 +12,9 @@ function mainProject(_target, _subtarget)
project (_target .. _subtarget)
end
end
+else
+ project (_subtarget)
+end
uuid (os.uuid(_target .."_" .. _subtarget))
kind "ConsoleApp"
@@ -34,7 +38,7 @@ function mainProject(_target, _subtarget)
flags {
"Unicode",
}
-
+if (_OPTIONS["DRIVERS"] == nil) then
configuration { "x64", "Release" }
targetsuffix "64"
if _OPTIONS["PROFILE"] then
@@ -70,7 +74,7 @@ function mainProject(_target, _subtarget)
if _OPTIONS["PROFILE"] then
targetsuffix "dp"
end
-
+end
configuration { "mingw*" or "vs*" }
targetextension ".exe"
@@ -86,24 +90,59 @@ function mainProject(_target, _subtarget)
findfunction("linkProjects_" .. _OPTIONS["target"] .. "_" .. _OPTIONS["subtarget"])(_OPTIONS["target"], _OPTIONS["subtarget"])
links {
"osd_" .. _OPTIONS["osd"],
- "bus",
+ }
+ if (_OPTIONS["DRIVERS"] == nil) then
+ links {
+ "bus",
+ }
+ end
+ links {
+ "netlist",
"optional",
"emu",
+ "formats",
"dasm",
"utils",
"expat",
"softfloat",
"jpeg",
- "flac",
"7z",
- "formats",
"lua",
"lsqlite3",
- "sqllite3",
- "zlib",
"jsoncpp",
"mongoose",
}
+
+ if _OPTIONS["with-bundled-zlib"] then
+ links {
+ "zlib",
+ }
+ else
+ links {
+ "z",
+ }
+ end
+
+ if _OPTIONS["with-bundled-flac"] then
+ links {
+ "flac",
+ }
+ else
+ links {
+ "FLAC",
+ }
+ end
+
+ if _OPTIONS["with-bundled-sqlite3"] then
+ links {
+ "sqllite3",
+ }
+ else
+ links {
+ "sqlite3",
+ }
+ end
+
if _OPTIONS["NO_USE_MIDI"]~="1" then
links {
"portmidi",
@@ -129,11 +168,16 @@ function mainProject(_target, _subtarget)
MAME_DIR .. "src/lib",
MAME_DIR .. "src/lib/util",
MAME_DIR .. "3rdparty",
- MAME_DIR .. "3rdparty/zlib",
GEN_DIR .. _target .. "/layout",
GEN_DIR .. "resource",
}
+ if _OPTIONS["with-bundled-zlib"] then
+ includedirs {
+ MAME_DIR .. "3rdparty/zlib",
+ }
+ end
+
if _OPTIONS["targetos"]=="macosx" and (not override_resources) then
linkoptions {
"-sectcreate __TEXT __info_plist " .. GEN_DIR .. "/resource/" .. _subtarget .. "-Info.plist"
@@ -180,6 +224,8 @@ function mainProject(_target, _subtarget)
MAME_DIR .. "src/version.c",
GEN_DIR .. _target .. "/" .. _subtarget .."/drivlist.c",
}
+
+if (_OPTIONS["DRIVERS"] == nil) then
dependency {
{ "../../../../generated/mame/mame/drivlist.c", MAME_DIR .. "src/mame/mess.lst", true },
{ "../../../../generated/mame/mame/drivlist.c" , MAME_DIR .. "src/mame/arcade.lst", true},
@@ -187,7 +233,13 @@ function mainProject(_target, _subtarget)
custombuildtask {
{ MAME_DIR .. "src/".._target .."/" .. _subtarget ..".lst" , GEN_DIR .. _target .. "/" .. _subtarget .."/drivlist.c", { MAME_DIR .. "src/build/makelist.py" }, {"@echo Building driver list...", PYTHON .. " $(1) $(<) > $(@)" }},
}
-
+end
+ configuration { "gmake" }
+ dependency {
+ { ".PHONY", ".FORCE", true },
+ { "$(OBJDIR)/src/version.o", ".FORCE", true },
+ }
+
configuration { "mingw*" }
custombuildtask {
{ MAME_DIR .. "src/version.c" , GEN_DIR .. "/resource/" .. rctarget .. "vers.rc", { MAME_DIR .. "src/build/verinfo.py" }, {"@echo Emitting " .. rctarget .. "vers.rc" .. "...", PYTHON .. " $(1) -r -b " .. rctarget .. " $(<) > $(@)" }},
diff --git a/scripts/src/netlist.lua b/scripts/src/netlist.lua
index 9d61b0d4892..d79ec5ecd58 100644
--- a/scripts/src/netlist.lua
+++ b/scripts/src/netlist.lua
@@ -1,127 +1,161 @@
-- license:BSD-3-Clause
-- copyright-holders:MAMEdev Team
-files {
- MAME_DIR .. "src/emu/netlist/nl_config.h",
- MAME_DIR .. "src/emu/netlist/nl_dice_compat.h",
- MAME_DIR .. "src/emu/netlist/nl_lists.h",
- MAME_DIR .. "src/emu/netlist/nl_time.h",
- MAME_DIR .. "src/emu/netlist/nl_util.h",
- MAME_DIR .. "src/emu/netlist/nl_base.c",
- MAME_DIR .. "src/emu/netlist/nl_base.h",
- MAME_DIR .. "src/emu/netlist/nl_parser.c",
- MAME_DIR .. "src/emu/netlist/nl_parser.h",
- MAME_DIR .. "src/emu/netlist/nl_setup.c",
- MAME_DIR .. "src/emu/netlist/nl_setup.h",
- MAME_DIR .. "src/emu/netlist/nl_factory.c",
- MAME_DIR .. "src/emu/netlist/nl_factory.h",
- MAME_DIR .. "src/emu/netlist/plib/pconfig.h",
- MAME_DIR .. "src/emu/netlist/plib/palloc.c",
- MAME_DIR .. "src/emu/netlist/plib/palloc.h",
- MAME_DIR .. "src/emu/netlist/plib/plists.h",
- MAME_DIR .. "src/emu/netlist/plib/poptions.h",
- MAME_DIR .. "src/emu/netlist/plib/pparser.c",
- MAME_DIR .. "src/emu/netlist/plib/pparser.h",
- MAME_DIR .. "src/emu/netlist/plib/pstate.c",
- MAME_DIR .. "src/emu/netlist/plib/pstate.h",
- MAME_DIR .. "src/emu/netlist/plib/pstring.c",
- MAME_DIR .. "src/emu/netlist/plib/pstring.h",
- MAME_DIR .. "src/emu/netlist/analog/nld_bjt.c",
- MAME_DIR .. "src/emu/netlist/analog/nld_bjt.h",
- MAME_DIR .. "src/emu/netlist/analog/nld_fourterm.c",
- MAME_DIR .. "src/emu/netlist/analog/nld_fourterm.h",
- MAME_DIR .. "src/emu/netlist/analog/nld_solver.c",
- MAME_DIR .. "src/emu/netlist/analog/nld_solver.h",
- MAME_DIR .. "src/emu/netlist/analog/nld_switches.c",
- MAME_DIR .. "src/emu/netlist/analog/nld_switches.h",
- MAME_DIR .. "src/emu/netlist/analog/nld_twoterm.c",
- MAME_DIR .. "src/emu/netlist/analog/nld_twoterm.h",
- MAME_DIR .. "src/emu/netlist/analog/nld_opamps.c",
- MAME_DIR .. "src/emu/netlist/analog/nld_opamps.h",
- MAME_DIR .. "src/emu/netlist/analog/nld_ms_direct.h",
- MAME_DIR .. "src/emu/netlist/analog/nld_ms_direct1.h",
- MAME_DIR .. "src/emu/netlist/analog/nld_ms_direct2.h",
- MAME_DIR .. "src/emu/netlist/analog/nld_ms_gauss_seidel.h",
- MAME_DIR .. "src/emu/netlist/devices/nld_4020.c",
- MAME_DIR .. "src/emu/netlist/devices/nld_4020.h",
- MAME_DIR .. "src/emu/netlist/devices/nld_4066.c",
- MAME_DIR .. "src/emu/netlist/devices/nld_4066.h",
- MAME_DIR .. "src/emu/netlist/devices/nld_7400.c",
- MAME_DIR .. "src/emu/netlist/devices/nld_7400.h",
- MAME_DIR .. "src/emu/netlist/devices/nld_7402.c",
- MAME_DIR .. "src/emu/netlist/devices/nld_7402.h",
- MAME_DIR .. "src/emu/netlist/devices/nld_7404.c",
- MAME_DIR .. "src/emu/netlist/devices/nld_7404.h",
- MAME_DIR .. "src/emu/netlist/devices/nld_7408.c",
- MAME_DIR .. "src/emu/netlist/devices/nld_7408.h",
- MAME_DIR .. "src/emu/netlist/devices/nld_7410.c",
- MAME_DIR .. "src/emu/netlist/devices/nld_7410.h",
- MAME_DIR .. "src/emu/netlist/devices/nld_7411.c",
- MAME_DIR .. "src/emu/netlist/devices/nld_7411.h",
- MAME_DIR .. "src/emu/netlist/devices/nld_7420.c",
- MAME_DIR .. "src/emu/netlist/devices/nld_7420.h",
- MAME_DIR .. "src/emu/netlist/devices/nld_7425.c",
- MAME_DIR .. "src/emu/netlist/devices/nld_7425.h",
- MAME_DIR .. "src/emu/netlist/devices/nld_7427.c",
- MAME_DIR .. "src/emu/netlist/devices/nld_7427.h",
- MAME_DIR .. "src/emu/netlist/devices/nld_7430.c",
- MAME_DIR .. "src/emu/netlist/devices/nld_7430.h",
- MAME_DIR .. "src/emu/netlist/devices/nld_7432.c",
- MAME_DIR .. "src/emu/netlist/devices/nld_7432.h",
- MAME_DIR .. "src/emu/netlist/devices/nld_7437.c",
- MAME_DIR .. "src/emu/netlist/devices/nld_7437.h",
- MAME_DIR .. "src/emu/netlist/devices/nld_7448.c",
- MAME_DIR .. "src/emu/netlist/devices/nld_7448.h",
- MAME_DIR .. "src/emu/netlist/devices/nld_7450.c",
- MAME_DIR .. "src/emu/netlist/devices/nld_7450.h",
- MAME_DIR .. "src/emu/netlist/devices/nld_7474.c",
- MAME_DIR .. "src/emu/netlist/devices/nld_7474.h",
- MAME_DIR .. "src/emu/netlist/devices/nld_7483.c",
- MAME_DIR .. "src/emu/netlist/devices/nld_7483.h",
- MAME_DIR .. "src/emu/netlist/devices/nld_7486.c",
- MAME_DIR .. "src/emu/netlist/devices/nld_7486.h",
- MAME_DIR .. "src/emu/netlist/devices/nld_7490.c",
- MAME_DIR .. "src/emu/netlist/devices/nld_7490.h",
- MAME_DIR .. "src/emu/netlist/devices/nld_7493.c",
- MAME_DIR .. "src/emu/netlist/devices/nld_7493.h",
- MAME_DIR .. "src/emu/netlist/devices/nld_74107.c",
- MAME_DIR .. "src/emu/netlist/devices/nld_74107.h",
- MAME_DIR .. "src/emu/netlist/devices/nld_74123.c",
- MAME_DIR .. "src/emu/netlist/devices/nld_74123.h",
- MAME_DIR .. "src/emu/netlist/devices/nld_74153.c",
- MAME_DIR .. "src/emu/netlist/devices/nld_74153.h",
- MAME_DIR .. "src/emu/netlist/devices/nld_74175.c",
- MAME_DIR .. "src/emu/netlist/devices/nld_74175.h",
- MAME_DIR .. "src/emu/netlist/devices/nld_74192.c",
- MAME_DIR .. "src/emu/netlist/devices/nld_74192.h",
- MAME_DIR .. "src/emu/netlist/devices/nld_74193.c",
- MAME_DIR .. "src/emu/netlist/devices/nld_74193.h",
- MAME_DIR .. "src/emu/netlist/devices/nld_74279.c",
- MAME_DIR .. "src/emu/netlist/devices/nld_74279.h",
- MAME_DIR .. "src/emu/netlist/devices/nld_74ls629.c",
- MAME_DIR .. "src/emu/netlist/devices/nld_74ls629.h",
- MAME_DIR .. "src/emu/netlist/devices/nld_82S16.c",
- MAME_DIR .. "src/emu/netlist/devices/nld_82S16.h",
- MAME_DIR .. "src/emu/netlist/devices/nld_9310.c",
- MAME_DIR .. "src/emu/netlist/devices/nld_9310.h",
- MAME_DIR .. "src/emu/netlist/devices/nld_9312.c",
- MAME_DIR .. "src/emu/netlist/devices/nld_9312.h",
- MAME_DIR .. "src/emu/netlist/devices/nld_9316.c",
- MAME_DIR .. "src/emu/netlist/devices/nld_9316.h",
- MAME_DIR .. "src/emu/netlist/devices/nld_ne555.c",
- MAME_DIR .. "src/emu/netlist/devices/nld_ne555.h",
- MAME_DIR .. "src/emu/netlist/devices/nld_r2r_dac.c",
- MAME_DIR .. "src/emu/netlist/devices/nld_r2r_dac.h",
- MAME_DIR .. "src/emu/netlist/devices/nld_legacy.c",
- MAME_DIR .. "src/emu/netlist/devices/nld_legacy.h",
- MAME_DIR .. "src/emu/netlist/devices/net_lib.c",
- MAME_DIR .. "src/emu/netlist/devices/net_lib.h",
- MAME_DIR .. "src/emu/netlist/devices/nld_log.c",
- MAME_DIR .. "src/emu/netlist/devices/nld_log.h",
- MAME_DIR .. "src/emu/netlist/devices/nld_system.c",
- MAME_DIR .. "src/emu/netlist/devices/nld_system.h",
- MAME_DIR .. "src/emu/netlist/devices/nld_cmos.h",
- MAME_DIR .. "src/emu/netlist/devices/nld_signal.h",
- MAME_DIR .. "src/emu/netlist/devices/nld_truthtable.c",
- MAME_DIR .. "src/emu/netlist/devices/nld_truthtable.h",
+project "netlist"
+ uuid "665ef8ac-2a4c-4c3e-a05f-fd1e5db11de9"
+ kind (LIBTYPE)
+
+ options {
+ "ForceCPP",
+ }
+
+ includedirs {
+ MAME_DIR .. "src/emu/netlist",
+ MAME_DIR .. "src/osd",
+ MAME_DIR .. "src/lib/util",
+ }
+ -- if _OPTIONS["with-bundled-expat"] then
+ -- includedirs {
+ -- MAME_DIR .. "3rdparty/expat/lib",
+ -- }
+ --end
+
+
+ files {
+ MAME_DIR .. "src/emu/netlist/nl_config.h",
+ MAME_DIR .. "src/emu/netlist/nl_dice_compat.h",
+ MAME_DIR .. "src/emu/netlist/nl_lists.h",
+ MAME_DIR .. "src/emu/netlist/nl_time.h",
+ MAME_DIR .. "src/emu/netlist/nl_util.h",
+ MAME_DIR .. "src/emu/netlist/nl_base.c",
+ MAME_DIR .. "src/emu/netlist/nl_base.h",
+ MAME_DIR .. "src/emu/netlist/nl_parser.c",
+ MAME_DIR .. "src/emu/netlist/nl_parser.h",
+ MAME_DIR .. "src/emu/netlist/nl_setup.c",
+ MAME_DIR .. "src/emu/netlist/nl_setup.h",
+ MAME_DIR .. "src/emu/netlist/nl_factory.c",
+ MAME_DIR .. "src/emu/netlist/nl_factory.h",
+ MAME_DIR .. "src/emu/netlist/plib/pconfig.h",
+ MAME_DIR .. "src/emu/netlist/plib/palloc.c",
+ MAME_DIR .. "src/emu/netlist/plib/palloc.h",
+ MAME_DIR .. "src/emu/netlist/plib/plists.h",
+ MAME_DIR .. "src/emu/netlist/plib/poptions.h",
+ MAME_DIR .. "src/emu/netlist/plib/pparser.c",
+ MAME_DIR .. "src/emu/netlist/plib/pparser.h",
+ MAME_DIR .. "src/emu/netlist/plib/pstate.c",
+ MAME_DIR .. "src/emu/netlist/plib/pstate.h",
+ MAME_DIR .. "src/emu/netlist/plib/pstring.c",
+ MAME_DIR .. "src/emu/netlist/plib/pstring.h",
+ MAME_DIR .. "src/emu/netlist/plib/pstring.c",
+ MAME_DIR .. "src/emu/netlist/plib/pstring.h",
+ MAME_DIR .. "src/emu/netlist/tools/nl_convert.c",
+ MAME_DIR .. "src/emu/netlist/tools/nl_convert.h",
+ MAME_DIR .. "src/emu/netlist/analog/nld_bjt.c",
+ MAME_DIR .. "src/emu/netlist/analog/nld_bjt.h",
+ MAME_DIR .. "src/emu/netlist/analog/nld_fourterm.c",
+ MAME_DIR .. "src/emu/netlist/analog/nld_fourterm.h",
+ MAME_DIR .. "src/emu/netlist/analog/nld_switches.c",
+ MAME_DIR .. "src/emu/netlist/analog/nld_switches.h",
+ MAME_DIR .. "src/emu/netlist/analog/nld_twoterm.c",
+ MAME_DIR .. "src/emu/netlist/analog/nld_twoterm.h",
+ MAME_DIR .. "src/emu/netlist/analog/nld_opamps.c",
+ MAME_DIR .. "src/emu/netlist/analog/nld_opamps.h",
+ MAME_DIR .. "src/emu/netlist/solver/nld_solver.c",
+ MAME_DIR .. "src/emu/netlist/solver/nld_solver.h",
+ MAME_DIR .. "src/emu/netlist/solver/nld_ms_direct.h",
+ MAME_DIR .. "src/emu/netlist/solver/nld_ms_direct1.h",
+ MAME_DIR .. "src/emu/netlist/solver/nld_ms_direct2.h",
+ MAME_DIR .. "src/emu/netlist/solver/nld_ms_sor.h",
+ MAME_DIR .. "src/emu/netlist/solver/nld_ms_sor_math.h",
+ MAME_DIR .. "src/emu/netlist/solver/nld_ms_gmres.h",
+ MAME_DIR .. "src/emu/netlist/devices/nld_4020.c",
+ MAME_DIR .. "src/emu/netlist/devices/nld_4020.h",
+ MAME_DIR .. "src/emu/netlist/devices/nld_4066.c",
+ MAME_DIR .. "src/emu/netlist/devices/nld_4066.h",
+ MAME_DIR .. "src/emu/netlist/devices/nld_7400.c",
+ MAME_DIR .. "src/emu/netlist/devices/nld_7400.h",
+ MAME_DIR .. "src/emu/netlist/devices/nld_7402.c",
+ MAME_DIR .. "src/emu/netlist/devices/nld_7402.h",
+ MAME_DIR .. "src/emu/netlist/devices/nld_7404.c",
+ MAME_DIR .. "src/emu/netlist/devices/nld_7404.h",
+ MAME_DIR .. "src/emu/netlist/devices/nld_7408.c",
+ MAME_DIR .. "src/emu/netlist/devices/nld_7408.h",
+ MAME_DIR .. "src/emu/netlist/devices/nld_7410.c",
+ MAME_DIR .. "src/emu/netlist/devices/nld_7410.h",
+ MAME_DIR .. "src/emu/netlist/devices/nld_7411.c",
+ MAME_DIR .. "src/emu/netlist/devices/nld_7411.h",
+ MAME_DIR .. "src/emu/netlist/devices/nld_7420.c",
+ MAME_DIR .. "src/emu/netlist/devices/nld_7420.h",
+ MAME_DIR .. "src/emu/netlist/devices/nld_7425.c",
+ MAME_DIR .. "src/emu/netlist/devices/nld_7425.h",
+ MAME_DIR .. "src/emu/netlist/devices/nld_7427.c",
+ MAME_DIR .. "src/emu/netlist/devices/nld_7427.h",
+ MAME_DIR .. "src/emu/netlist/devices/nld_7430.c",
+ MAME_DIR .. "src/emu/netlist/devices/nld_7430.h",
+ MAME_DIR .. "src/emu/netlist/devices/nld_7432.c",
+ MAME_DIR .. "src/emu/netlist/devices/nld_7432.h",
+ MAME_DIR .. "src/emu/netlist/devices/nld_7437.c",
+ MAME_DIR .. "src/emu/netlist/devices/nld_7437.h",
+ MAME_DIR .. "src/emu/netlist/devices/nld_7448.c",
+ MAME_DIR .. "src/emu/netlist/devices/nld_7448.h",
+ MAME_DIR .. "src/emu/netlist/devices/nld_7450.c",
+ MAME_DIR .. "src/emu/netlist/devices/nld_7450.h",
+ MAME_DIR .. "src/emu/netlist/devices/nld_7474.c",
+ MAME_DIR .. "src/emu/netlist/devices/nld_7474.h",
+ MAME_DIR .. "src/emu/netlist/devices/nld_7483.c",
+ MAME_DIR .. "src/emu/netlist/devices/nld_7483.h",
+ MAME_DIR .. "src/emu/netlist/devices/nld_7486.c",
+ MAME_DIR .. "src/emu/netlist/devices/nld_7486.h",
+ MAME_DIR .. "src/emu/netlist/devices/nld_7490.c",
+ MAME_DIR .. "src/emu/netlist/devices/nld_7490.h",
+ MAME_DIR .. "src/emu/netlist/devices/nld_7493.c",
+ MAME_DIR .. "src/emu/netlist/devices/nld_7493.h",
+ MAME_DIR .. "src/emu/netlist/devices/nld_74107.c",
+ MAME_DIR .. "src/emu/netlist/devices/nld_74107.h",
+ MAME_DIR .. "src/emu/netlist/devices/nld_74123.c",
+ MAME_DIR .. "src/emu/netlist/devices/nld_74123.h",
+ MAME_DIR .. "src/emu/netlist/devices/nld_74153.c",
+ MAME_DIR .. "src/emu/netlist/devices/nld_74153.h",
+ MAME_DIR .. "src/emu/netlist/devices/nld_74175.c",
+ MAME_DIR .. "src/emu/netlist/devices/nld_74175.h",
+ MAME_DIR .. "src/emu/netlist/devices/nld_74192.c",
+ MAME_DIR .. "src/emu/netlist/devices/nld_74192.h",
+ MAME_DIR .. "src/emu/netlist/devices/nld_74193.c",
+ MAME_DIR .. "src/emu/netlist/devices/nld_74193.h",
+ MAME_DIR .. "src/emu/netlist/devices/nld_74279.c",
+ MAME_DIR .. "src/emu/netlist/devices/nld_74279.h",
+ MAME_DIR .. "src/emu/netlist/devices/nld_74ls629.c",
+ MAME_DIR .. "src/emu/netlist/devices/nld_74ls629.h",
+ MAME_DIR .. "src/emu/netlist/devices/nld_82S16.c",
+ MAME_DIR .. "src/emu/netlist/devices/nld_82S16.h",
+ MAME_DIR .. "src/emu/netlist/devices/nld_9310.c",
+ MAME_DIR .. "src/emu/netlist/devices/nld_9310.h",
+ MAME_DIR .. "src/emu/netlist/devices/nld_9312.c",
+ MAME_DIR .. "src/emu/netlist/devices/nld_9312.h",
+ MAME_DIR .. "src/emu/netlist/devices/nld_9316.c",
+ MAME_DIR .. "src/emu/netlist/devices/nld_9316.h",
+ MAME_DIR .. "src/emu/netlist/devices/nld_ne555.c",
+ MAME_DIR .. "src/emu/netlist/devices/nld_ne555.h",
+ MAME_DIR .. "src/emu/netlist/devices/nld_mm5837.c",
+ MAME_DIR .. "src/emu/netlist/devices/nld_mm5837.h",
+ MAME_DIR .. "src/emu/netlist/devices/nld_r2r_dac.c",
+ MAME_DIR .. "src/emu/netlist/devices/nld_r2r_dac.h",
+ MAME_DIR .. "src/emu/netlist/devices/nld_legacy.c",
+ MAME_DIR .. "src/emu/netlist/devices/nld_legacy.h",
+ MAME_DIR .. "src/emu/netlist/devices/net_lib.c",
+ MAME_DIR .. "src/emu/netlist/devices/net_lib.h",
+ MAME_DIR .. "src/emu/netlist/devices/nld_log.c",
+ MAME_DIR .. "src/emu/netlist/devices/nld_log.h",
+ MAME_DIR .. "src/emu/netlist/devices/nld_system.c",
+ MAME_DIR .. "src/emu/netlist/devices/nld_system.h",
+ MAME_DIR .. "src/emu/netlist/devices/nld_cmos.h",
+ MAME_DIR .. "src/emu/netlist/devices/nld_signal.h",
+ MAME_DIR .. "src/emu/netlist/devices/nld_truthtable.c",
+ MAME_DIR .. "src/emu/netlist/devices/nld_truthtable.h",
+ MAME_DIR .. "src/emu/netlist/macro/nlm_ttl74xx.c",
+ MAME_DIR .. "src/emu/netlist/macro/nlm_ttl74xx.h",
+ MAME_DIR .. "src/emu/netlist/macro/nlm_cd4xxx.c",
+ MAME_DIR .. "src/emu/netlist/macro/nlm_cd4xxx.h",
+ MAME_DIR .. "src/emu/netlist/macro/nlm_opamp.c",
+ MAME_DIR .. "src/emu/netlist/macro/nlm_opamp.h",
}
diff --git a/scripts/src/osd/osdmini.lua b/scripts/src/osd/osdmini.lua
index a1b19f9cb2a..b4afaaa6532 100644
--- a/scripts/src/osd/osdmini.lua
+++ b/scripts/src/osd/osdmini.lua
@@ -7,7 +7,7 @@ end
project ("osd_" .. _OPTIONS["osd"])
uuid (os.uuid("osd_" .. _OPTIONS["osd"]))
- kind "StaticLib"
+ kind (LIBTYPE)
removeflags {
"SingleOutputDir",
@@ -54,7 +54,7 @@ project ("osd_" .. _OPTIONS["osd"])
project ("ocore_" .. _OPTIONS["osd"])
uuid (os.uuid("ocore_" .. _OPTIONS["osd"]))
- kind "StaticLib"
+ kind (LIBTYPE)
options {
"ForceCPP",
diff --git a/scripts/src/osd/sdl.lua b/scripts/src/osd/sdl.lua
index 2c8e2ed51c5..0358881562f 100644
--- a/scripts/src/osd/sdl.lua
+++ b/scripts/src/osd/sdl.lua
@@ -102,6 +102,11 @@ newoption {
}
newoption {
+ trigger = "SDL_INI_PATH",
+ description = "Default search path for .ini files",
+}
+
+newoption {
trigger = "NO_X11",
description = "Disable use of X11",
allowed = {
@@ -293,8 +298,9 @@ end
project ("osd_" .. _OPTIONS["osd"])
+ targetsubdir(_OPTIONS["target"] .."_" .._OPTIONS["subtarget"])
uuid (os.uuid("osd_" .. _OPTIONS["osd"]))
- kind "StaticLib"
+ kind (LIBTYPE)
dofile("sdl_cfg.lua")
osdmodulesbuild()
@@ -361,8 +367,9 @@ project ("osd_" .. _OPTIONS["osd"])
project ("ocore_" .. _OPTIONS["osd"])
+ targetsubdir(_OPTIONS["target"] .."_" .. _OPTIONS["subtarget"])
uuid (os.uuid("ocore_" .. _OPTIONS["osd"]))
- kind "StaticLib"
+ kind (LIBTYPE)
options {
"ForceCPP",
diff --git a/scripts/src/osd/sdl_cfg.lua b/scripts/src/osd/sdl_cfg.lua
index a26d80f197b..a204201d6f5 100644
--- a/scripts/src/osd/sdl_cfg.lua
+++ b/scripts/src/osd/sdl_cfg.lua
@@ -18,6 +18,11 @@ if _OPTIONS["NO_OPENGL"]~="1" and _OPTIONS["USE_DISPATCH_GL"]~="1" and _OPTIONS[
}
end
+if _OPTIONS["SDL_INI_PATH"]~=nil then
+ defines {
+ "'INI_PATH=\"" .. _OPTIONS["SDL_INI_PATH"] .. "\"'",
+ }
+end
if _OPTIONS["NO_X11"]=="1" then
defines {
diff --git a/scripts/src/osd/windows.lua b/scripts/src/osd/windows.lua
index 33176ff43fc..e9965017933 100644
--- a/scripts/src/osd/windows.lua
+++ b/scripts/src/osd/windows.lua
@@ -90,7 +90,7 @@ end
project ("osd_" .. _OPTIONS["osd"])
uuid (os.uuid("osd_" .. _OPTIONS["osd"]))
- kind "StaticLib"
+ kind (LIBTYPE)
dofile("windows_cfg.lua")
osdmodulesbuild()
@@ -153,7 +153,7 @@ project ("osd_" .. _OPTIONS["osd"])
project ("ocore_" .. _OPTIONS["osd"])
uuid (os.uuid("ocore_" .. _OPTIONS["osd"]))
- kind "StaticLib"
+ kind (LIBTYPE)
options {
"ForceCPP",
diff --git a/scripts/src/sound.lua b/scripts/src/sound.lua
index 3ddb7e9bd13..1c94d013c21 100644
--- a/scripts/src/sound.lua
+++ b/scripts/src/sound.lua
@@ -12,10 +12,10 @@
---------------------------------------------------
-- DACs
---@src/emu/sound/dac.h,SOUNDS += DAC
---@src/emu/sound/dmadac.h,SOUNDS += DMADAC
---@src/emu/sound/speaker.h,SOUNDS += SPEAKER
---@src/emu/sound/beep.h,SOUNDS += BEEP
+--@src/emu/sound/dac.h,SOUNDS["DAC"] = true
+--@src/emu/sound/dmadac.h,SOUNDS["DMADAC"] = true
+--@src/emu/sound/speaker.h,SOUNDS["SPEAKER"] = true
+--@src/emu/sound/beep.h,SOUNDS["BEEP"] = true
---------------------------------------------------
if (SOUNDS["DAC"]~=null) then
@@ -50,7 +50,7 @@ end
---------------------------------------------------
-- CD audio
---@src/emu/sound/cdda.h,SOUNDS += CDDA
+--@src/emu/sound/cdda.h,SOUNDS["CDDA"] = true
---------------------------------------------------
if (SOUNDS["CDDA"]~=null) then
@@ -64,7 +64,7 @@ end
---------------------------------------------------
-- Discrete component audio
---@src/emu/sound/discrete.h,SOUNDS += DISCRETE
+--@src/emu/sound/discrete.h,SOUNDS["DISCRETE"] = true
---------------------------------------------------
if (SOUNDS["DISCRETE"]~=null) then
@@ -87,7 +87,7 @@ end
---------------------------------------------------
-- AC97
---@src/emu/sound/pic-ac97.h,SOUNDS += AC97
+--@src/emu/sound/pic-ac97.h,SOUNDS["AC97"] = true
---------------------------------------------------
if (SOUNDS["AC97"]~=null) then
@@ -101,8 +101,8 @@ end
---------------------------------------------------
-- Apple custom sound chips
---@src/emu/sound/asc.h,SOUNDS += ASC
---@src/emu/sound/awacs.h,SOUNDS += AWACS
+--@src/emu/sound/asc.h,SOUNDS["ASC"] = true
+--@src/emu/sound/awacs.h,SOUNDS["AWACS"] = true
---------------------------------------------------
if (SOUNDS["ASC"]~=null) then
@@ -122,8 +122,8 @@ end
---------------------------------------------------
-- Atari custom sound chips
---@src/emu/sound/pokey.h,SOUNDS += POKEY
---@src/emu/sound/tiaintf.h,SOUNDS += TIA
+--@src/emu/sound/pokey.h,SOUNDS["POKEY"] = true
+--@src/emu/sound/tiaintf.h,SOUNDS["TIA"] = true
---------------------------------------------------
if (SOUNDS["POKEY"]~=null) then
@@ -146,7 +146,7 @@ end
---------------------------------------------------
-- Amiga audio hardware
---@src/emu/sound/amiga.h,SOUNDS += AMIGA
+--@src/emu/sound/amiga.h,SOUNDS["AMIGA"] = true
---------------------------------------------------
if (SOUNDS["AMIGA"]~=null) then
@@ -160,7 +160,7 @@ end
---------------------------------------------------
-- Bally Astrocade sound system
---@src/emu/sound/astrocde.h,SOUNDS += ASTROCADE
+--@src/emu/sound/astrocde.h,SOUNDS["ASTROCADE"] = true
---------------------------------------------------
if (SOUNDS["ASTROCADE"]~=null) then
@@ -175,7 +175,7 @@ end
---------------------------------------------------
---------------------------------------------------
-- AC97
---@src/emu/sound/pic-ac97.h,SOUNDS += AC97
+--@src/emu/sound/pic-ac97.h,SOUNDS["AC97"] = true
---------------------------------------------------
if (SOUNDS["AC97"]~=null) then
@@ -185,7 +185,7 @@ if (SOUNDS["AC97"]~=null) then
}
end
-- CEM 3394 analog synthesizer chip
---@src/emu/sound/cem3394.h,SOUNDS += CEM3394
+--@src/emu/sound/cem3394.h,SOUNDS["CEM3394"] = true
---------------------------------------------------
if (SOUNDS["CEM3394"]~=null) then
@@ -199,7 +199,7 @@ end
---------------------------------------------------
-- Creative Labs SB0400 Audigy2 Value
---@src/emu/sound/sb0400.h,SOUNDS += AC97
+--@src/emu/sound/sb0400.h,SOUNDS["SB0400"] = true
---------------------------------------------------
if (SOUNDS["SB0400"]~=null) then
@@ -212,7 +212,7 @@ end
--------------------------------------------------
-- Creative Labs Ensonic AudioPCI97 ES1373
---@src/emu/sound/es1373.h,SOUNDS += ES1373
+--@src/emu/sound/es1373.h,SOUNDS["ES1373"] = true
--------------------------------------------------
if (SOUNDS["ES1373"]~=null) then
@@ -224,7 +224,7 @@ end
---------------------------------------------------
-- Data East custom sound chips
---@src/emu/sound/bsmt2000.h,SOUNDS += BSMT2000
+--@src/emu/sound/bsmt2000.h,SOUNDS["BSMT2000"] = true
---------------------------------------------------
if (SOUNDS["BSMT2000"]~=null) then
@@ -238,7 +238,7 @@ end
---------------------------------------------------
-- Ensoniq 5503 (Apple IIgs)
---@src/emu/sound/es5503.h,SOUNDS += ES5503
+--@src/emu/sound/es5503.h,SOUNDS["ES5503"] = true
---------------------------------------------------
if (SOUNDS["ES5503"]~=null) then
@@ -252,7 +252,7 @@ end
---------------------------------------------------
-- Ensoniq 5505/5506
---@src/emu/sound/es5506.h,SOUNDS += ES5505
+--@src/emu/sound/es5506.h,SOUNDS["ES5505"] = true
---------------------------------------------------
if (SOUNDS["ES5505"]~=null or SOUNDS["ES5506"]~=null) then
@@ -265,7 +265,7 @@ end
---------------------------------------------------
-- Ensoniq "pump" device, interfaces 5505/5506 with 5510
---@src/emu/sound/esqpump.h,SOUNDS += ESQPUMP
+--@src/emu/sound/esqpump.h,SOUNDS["ESQPUMP"] = true
---------------------------------------------------
if (SOUNDS["ESQPUMP"]~=null) then
@@ -278,7 +278,7 @@ end
---------------------------------------------------
-- Excellent Systems ADPCM sound chip
---@src/emu/sound/es8712.h,SOUNDS += ES8712
+--@src/emu/sound/es8712.h,SOUNDS["ES8712"] = true
---------------------------------------------------
if (SOUNDS["ES8712"]~=null) then
@@ -292,7 +292,7 @@ end
---------------------------------------------------
-- Gaelco custom sound chips
---@src/emu/sound/gaelco.h,SOUNDS += GAELCO_CG1V
+--@src/emu/sound/gaelco.h,SOUNDS["GAELCO_CG1V"] = true
---------------------------------------------------
if (SOUNDS["GAELCO_CG1V"]~=null or SOUNDS["GAELCO_GAE1"]~=null) then
@@ -305,7 +305,7 @@ end
---------------------------------------------------
-- RCA CDP1863
---@src/emu/sound/cdp1863.h,SOUNDS += CDP1863
+--@src/emu/sound/cdp1863.h,SOUNDS["CDP1863"] = true
---------------------------------------------------
if (SOUNDS["CDP1863"]~=null) then
@@ -319,7 +319,7 @@ end
---------------------------------------------------
-- RCA CDP1864
---@src/emu/sound/cdp1864.h,SOUNDS += CDP1864
+--@src/emu/sound/cdp1864.h,SOUNDS["CDP1864"] = true
---------------------------------------------------
if (SOUNDS["CDP1864"]~=null) then
@@ -333,7 +333,7 @@ end
---------------------------------------------------
-- RCA CDP1869
---@src/emu/sound/cdp1869.h,SOUNDS += CDP1869
+--@src/emu/sound/cdp1869.h,SOUNDS["CDP1869"] = true
---------------------------------------------------
if (SOUNDS["CDP1869"]~=null) then
@@ -347,7 +347,7 @@ end
---------------------------------------------------
-- GI AY-8910
---@src/emu/sound/ay8910.h,SOUNDS += AY8910
+--@src/emu/sound/ay8910.h,SOUNDS["AY8910"] = true
---------------------------------------------------
if (SOUNDS["AY8910"]~=null) then
@@ -361,7 +361,7 @@ end
---------------------------------------------------
-- Harris HC55516 CVSD
---@src/emu/sound/hc55516.h,SOUNDS += HC55516
+--@src/emu/sound/hc55516.h,SOUNDS["HC55516"] = true
---------------------------------------------------
if (SOUNDS["HC55516"]~=null) then
@@ -375,7 +375,7 @@ end
---------------------------------------------------
-- Hudsonsoft C6280 sound chip
---@src/emu/sound/c6280.h,SOUNDS += C6280
+--@src/emu/sound/c6280.h,SOUNDS["C6280"] = true
---------------------------------------------------
if (SOUNDS["C6280"]~=null) then
@@ -389,7 +389,7 @@ end
---------------------------------------------------
-- ICS2115 sound chip
---@src/emu/sound/ics2115.h,SOUNDS += ICS2115
+--@src/emu/sound/ics2115.h,SOUNDS["ICS2115"] = true
---------------------------------------------------
if (SOUNDS["ICS2115"]~=null) then
@@ -403,7 +403,7 @@ end
---------------------------------------------------
-- Imagetek I5000 sound
---@src/emu/sound/i5000.h,SOUNDS += I5000_SND
+--@src/emu/sound/i5000.h,SOUNDS["I5000_SND"] = true
---------------------------------------------------
if (SOUNDS["I5000_SND"]~=null) then
@@ -417,7 +417,7 @@ end
---------------------------------------------------
-- Irem custom sound chips
---@src/emu/sound/iremga20.h,SOUNDS += IREMGA20
+--@src/emu/sound/iremga20.h,SOUNDS["IREMGA20"] = true
---------------------------------------------------
if (SOUNDS["IREMGA20"]~=null) then
@@ -431,12 +431,12 @@ end
---------------------------------------------------
-- Konami custom sound chips
---@src/emu/sound/k005289.h,SOUNDS += K005289
---@src/emu/sound/k007232.h,SOUNDS += K007232
---@src/emu/sound/k051649.h,SOUNDS += K051649
---@src/emu/sound/k053260.h,SOUNDS += K053260
---@src/emu/sound/k054539.h,SOUNDS += K054539
---@src/emu/sound/k056800.h,SOUNDS += K056800
+--@src/emu/sound/k005289.h,SOUNDS["K005289"] = true
+--@src/emu/sound/k007232.h,SOUNDS["K007232"] = true
+--@src/emu/sound/k051649.h,SOUNDS["K051649"] = true
+--@src/emu/sound/k053260.h,SOUNDS["K053260"] = true
+--@src/emu/sound/k054539.h,SOUNDS["K054539"] = true
+--@src/emu/sound/k056800.h,SOUNDS["K056800"] = true
---------------------------------------------------
if (SOUNDS["K005289"]~=null) then
@@ -484,7 +484,7 @@ end
---------------------------------------------------
-- L7A1045 L6028 DSP-A
---@src/emu/sound/l7a1045_l6028_dsp_a.h,SOUNDS += L7A1045
+--@src/emu/sound/l7a1045_l6028_dsp_a.h,SOUNDS["L7A1045"] = true
---------------------------------------------------
if (SOUNDS["L7A1045"]~=null) then
@@ -497,7 +497,7 @@ end
---------------------------------------------------
-- LMC1992 mixer chip
---@src/emu/sound/lmc1992.h,SOUNDS += LMC1992
+--@src/emu/sound/lmc1992.h,SOUNDS["LMC1992"] = true
---------------------------------------------------
if (SOUNDS["LMC1992"]~=null) then
@@ -511,7 +511,7 @@ end
---------------------------------------------------
-- MAS 3507D MPEG 1/2 Layer 2/3 Audio Decoder
---@src/emu/sound/mas3507d.h,SOUNDS += MAS3507D
+--@src/emu/sound/mas3507d.h,SOUNDS["MAS3507D"] = true
---------------------------------------------------
if (SOUNDS["MAS3507D"]~=null) then
@@ -525,7 +525,7 @@ end
---------------------------------------------------
-- MOS 6560VIC
---@src/emu/sound/mos6560.h,SOUNDS += MOS656X
+--@src/emu/sound/mos6560.h,SOUNDS["MOS656X"] = true
---------------------------------------------------
if (SOUNDS["MOS656X"]~=null) then
@@ -539,7 +539,7 @@ end
---------------------------------------------------
-- MOS 7360 TED
---@src/emu/sound/mos7360.h,SOUNDS += MOS7360
+--@src/emu/sound/mos7360.h,SOUNDS["MOS7360"] = true
---------------------------------------------------
if (SOUNDS["MOS7360"]~=null) then
@@ -553,10 +553,10 @@ end
---------------------------------------------------
-- Namco custom sound chips
---@src/emu/sound/namco.h,SOUNDS += NAMCO
---@src/emu/sound/n63701x.h,SOUNDS += NAMCO_63701X
---@src/emu/sound/c140.h,SOUNDS += C140
---@src/emu/sound/c352.h,SOUNDS += C352
+--@src/emu/sound/namco.h,SOUNDS["NAMCO"] = true
+--@src/emu/sound/n63701x.h,SOUNDS["NAMCO_63701X"] = true
+--@src/emu/sound/c140.h,SOUNDS["C140"] = true
+--@src/emu/sound/c352.h,SOUNDS["C352"] = true
---------------------------------------------------
if (SOUNDS["NAMCO"]~=null or SOUNDS["NAMCO_15XX"]~=null or SOUNDS["NAMCO_CUS30"]~=null) then
@@ -591,7 +591,7 @@ end
---------------------------------------------------
-- National Semiconductor Digitalker
---@src/emu/sound/digitalk.h,SOUNDS += DIGITALKER
+--@src/emu/sound/digitalk.h,SOUNDS["DIGITALKER"] = true
---------------------------------------------------
if (SOUNDS["DIGITALKER"]~=null) then
@@ -605,7 +605,7 @@ end
---------------------------------------------------
-- Nintendo custom sound chips
---@src/emu/sound/nes_apu.h,SOUNDS += NES_APU
+--@src/emu/sound/nes_apu.h,SOUNDS["NES_APU"] = true
---------------------------------------------------
if (SOUNDS["NES_APU"]~=null) then
@@ -620,7 +620,7 @@ end
---------------------------------------------------
-- NEC uPD7759 ADPCM sample player
---@src/emu/sound/upd7759.h,SOUNDS += UPD7759
+--@src/emu/sound/upd7759.h,SOUNDS["UPD7759"] = true
---------------------------------------------------
if (SOUNDS["UPD7759"]~=null) then
@@ -634,12 +634,12 @@ end
---------------------------------------------------
-- OKI ADPCM sample players
---@src/emu/sound/okim6258.h,SOUNDS += OKIM6258
---@src/emu/sound/msm5205.h,SOUNDS += MSM5205
---@src/emu/sound/msm5232.h,SOUNDS += MSM5232
---@src/emu/sound/okim6376.h,SOUNDS += OKIM6376
---@src/emu/sound/okim6295.h,SOUNDS += OKIM6295
---@src/emu/sound/okim9810.h,SOUNDS += OKIM9810
+--@src/emu/sound/okim6258.h,SOUNDS["OKIM6258"] = true
+--@src/emu/sound/msm5205.h,SOUNDS["MSM5205"] = true
+--@src/emu/sound/msm5232.h,SOUNDS["MSM5232"] = true
+--@src/emu/sound/okim6376.h,SOUNDS["OKIM6376"] = true
+--@src/emu/sound/okim6295.h,SOUNDS["OKIM6295"] = true
+--@src/emu/sound/okim9810.h,SOUNDS["OKIM9810"] = true
---------------------------------------------------
if (SOUNDS["OKIM6258"]~=null or SOUNDS["OKIM6295"]~=null or SOUNDS["OKIM9810"]~=null or SOUNDS["I5000_SND"]~=null) then
@@ -695,7 +695,7 @@ end
---------------------------------------------------
-- Philips SAA1099
---@src/emu/sound/saa1099.h,SOUNDS += SAA1099
+--@src/emu/sound/saa1099.h,SOUNDS["SAA1099"] = true
---------------------------------------------------
if (SOUNDS["SAA1099"]~=null) then
@@ -709,7 +709,7 @@ end
---------------------------------------------------
-- AdMOS QS1000
---@src/emu/sound/qs1000.h,SOUNDS += QS1000
+--@src/emu/sound/qs1000.h,SOUNDS["QS1000"] = true
---------------------------------------------------
if (SOUNDS["QS1000"]~=null) then
@@ -723,7 +723,7 @@ end
---------------------------------------------------
-- QSound sample player
---@src/emu/sound/qsound.h,SOUNDS += QSOUND
+--@src/emu/sound/qsound.h,SOUNDS["QSOUND"] = true
---------------------------------------------------
if (SOUNDS["QSOUND"]~=null) then
@@ -740,8 +740,8 @@ end
---------------------------------------------------
-- Ricoh sample players
---@src/emu/sound/rf5c68.h,SOUNDS += RF5C68
---@src/emu/sound/rf5c400.h,SOUNDS += RF5C400
+--@src/emu/sound/rf5c68.h,SOUNDS["RF5C68"] = true
+--@src/emu/sound/rf5c400.h,SOUNDS["RF5C400"] = true
---------------------------------------------------
if (SOUNDS["RF5C68"]~=null) then
@@ -762,10 +762,10 @@ end
---------------------------------------------------
-- Sega custom sound chips
---@src/emu/sound/segapcm.h,SOUNDS += SEGAPCM
---@src/emu/sound/multipcm.h,SOUNDS += MULTIPCM
---@src/emu/sound/scsp.h,SOUNDS += SCSP
---@src/emu/sound/aica.h,SOUNDS += AICA
+--@src/emu/sound/segapcm.h,SOUNDS["SEGAPCM"] = true
+--@src/emu/sound/multipcm.h,SOUNDS["MULTIPCM"] = true
+--@src/emu/sound/scsp.h,SOUNDS["SCSP"] = true
+--@src/emu/sound/aica.h,SOUNDS["AICA"] = true
---------------------------------------------------
if (SOUNDS["SEGAPCM"]~=null) then
@@ -802,9 +802,9 @@ end
---------------------------------------------------
-- Seta custom sound chips
---@src/emu/sound/st0016.h,SOUNDS += ST0016
---@src/emu/sound/nile.h,SOUNDS += NILE
---@src/emu/sound/x1_010.h,SOUNDS += X1_010
+--@src/emu/sound/st0016.h,SOUNDS["ST0016"] = true
+--@src/emu/sound/nile.h,SOUNDS["NILE"] = true
+--@src/emu/sound/x1_010.h,SOUNDS["X1_010"] = true
---------------------------------------------------
if (SOUNDS["ST0016"]~=null) then
@@ -832,7 +832,7 @@ end
---------------------------------------------------
-- SID custom sound chips
---@src/emu/sound/mos6581.h,SOUNDS += SID6581
+--@src/emu/sound/mos6581.h,SOUNDS["SID6581"] = true
---------------------------------------------------
if (SOUNDS["SID6581"]~=null or SOUNDS["SID8580"]~=null) then
@@ -854,7 +854,7 @@ end
---------------------------------------------------
-- SNK(?) custom stereo sn76489a clone
---@src/emu/sound/t6w28.h,SOUNDS += T6W28
+--@src/emu/sound/t6w28.h,SOUNDS["T6W28"] = true
---------------------------------------------------
if (SOUNDS["T6W28"]~=null) then
@@ -868,7 +868,7 @@ end
---------------------------------------------------
-- SNK custom wave generator
---@src/emu/sound/snkwave.h,SOUNDS += SNKWAVE
+--@src/emu/sound/snkwave.h,SOUNDS["SNKWAVE"] = true
---------------------------------------------------
if (SOUNDS["SNKWAVE"]~=null) then
@@ -882,7 +882,7 @@ end
---------------------------------------------------
-- Sony custom sound chips
---@src/emu/sound/spu.h,SOUNDS += SPU
+--@src/emu/sound/spu.h,SOUNDS["SPU"] = true
---------------------------------------------------
if (SOUNDS["SPU"]~=null) then
@@ -898,7 +898,7 @@ end
---------------------------------------------------
-- SP0256 speech synthesizer
---@src/emu/sound/sp0256.h,SOUNDS += SP0256
+--@src/emu/sound/sp0256.h,SOUNDS["SP0256"] = true
---------------------------------------------------
if (SOUNDS["SP0256"]~=null) then
@@ -912,7 +912,7 @@ end
---------------------------------------------------
-- SP0250 speech synthesizer
---@src/emu/sound/sp0250.h,SOUNDS += SP0250
+--@src/emu/sound/sp0250.h,SOUNDS["SP0250"] = true
---------------------------------------------------
if (SOUNDS["SP0250"]~=null) then
@@ -925,7 +925,7 @@ end
---------------------------------------------------
-- S14001A speech synthesizer
---@src/emu/sound/s14001a.h,SOUNDS += S14001A
+--@src/emu/sound/s14001a.h,SOUNDS["S14001A"] = true
---------------------------------------------------
if (SOUNDS["S14001A"]~=null) then
@@ -939,7 +939,7 @@ end
---------------------------------------------------
-- Texas Instruments SN76477 analog chip
---@src/emu/sound/sn76477.h,SOUNDS += SN76477
+--@src/emu/sound/sn76477.h,SOUNDS["SN76477"] = true
---------------------------------------------------
if (SOUNDS["SN76477"]~=null) then
@@ -953,7 +953,7 @@ end
---------------------------------------------------
-- Texas Instruments SN76496
---@src/emu/sound/sn76496.h,SOUNDS += SN76496
+--@src/emu/sound/sn76496.h,SOUNDS["SN76496"] = true
---------------------------------------------------
if (SOUNDS["SN76496"]~=null) then
@@ -967,7 +967,7 @@ end
---------------------------------------------------
-- Texas Instruments TMS36xx doorbell chime
---@src/emu/sound/tms36xx.h,SOUNDS += TMS36XX
+--@src/emu/sound/tms36xx.h,SOUNDS["TMS36XX"] = true
---------------------------------------------------
if (SOUNDS["TMS36XX"]~=null) then
@@ -981,7 +981,7 @@ end
---------------------------------------------------
-- Texas Instruments TMS3615 Octave Multiple Tone Synthesizer
---@src/emu/sound/tms3615.h,SOUNDS += TMS3615
+--@src/emu/sound/tms3615.h,SOUNDS["TMS3615"] = true
---------------------------------------------------
if (SOUNDS["TMS3615"]~=null) then
@@ -995,7 +995,7 @@ end
---------------------------------------------------
-- Texas Instruments TMS5100-series speech synthesizers
---@src/emu/sound/tms5110.h,SOUNDS += TMS5110
+--@src/emu/sound/tms5110.h,SOUNDS["TMS5110"] = true
---------------------------------------------------
if (SOUNDS["TMS5110"]~=null) then
@@ -1008,7 +1008,7 @@ end
---------------------------------------------------
-- Texas Instruments TMS5200-series speech synthesizers
---@src/emu/sound/tms5220.h,SOUNDS += TMS5220
+--@src/emu/sound/tms5220.h,SOUNDS["TMS5220"] = true
---------------------------------------------------
if (SOUNDS["TMS5220"]~=null) then
files {
@@ -1023,7 +1023,7 @@ end
---------------------------------------------------
-- Toshiba T6721A voice synthesizer
---@src/emu/sound/t6721a.h,SOUNDS += T6721A
+--@src/emu/sound/t6721a.h,SOUNDS["T6721A"] = true
---------------------------------------------------
if (SOUNDS["T6721A"]~=null) then
@@ -1037,7 +1037,7 @@ end
---------------------------------------------------
-- Toshiba TC8830F sample player/recorder
---@src/emu/sound/tc8830f.h,SOUNDS += TC8830F
+--@src/emu/sound/tc8830f.h,SOUNDS["TC8830F"] = true
---------------------------------------------------
if (SOUNDS["TC8830F"]~=null) then
@@ -1050,7 +1050,7 @@ end
---------------------------------------------------
-- NEC uPD7752
---@src/emu/sound/upd7752.h,SOUNDS += UPD7752
+--@src/emu/sound/upd7752.h,SOUNDS["UPD7752"] = true
---------------------------------------------------
if (SOUNDS["UPD7752"]~=null) then
@@ -1063,7 +1063,7 @@ end
---------------------------------------------------
-- VLM5030 speech synthesizer
---@src/emu/sound/vlm5030.h,SOUNDS += VLM5030
+--@src/emu/sound/vlm5030.h,SOUNDS["VLM5030"] = true
---------------------------------------------------
if (SOUNDS["VLM5030"]~=null) then
@@ -1076,7 +1076,7 @@ end
---------------------------------------------------
-- Votrax speech synthesizer
---@src/emu/sound/votrax.h,SOUNDS += VOTRAX
+--@src/emu/sound/votrax.h,SOUNDS["VOTRAX"] = true
---------------------------------------------------
if (SOUNDS["VOTRAX"]~=null) then
@@ -1090,7 +1090,7 @@ end
---------------------------------------------------
-- VRender0 custom sound chip
---@src/emu/sound/vrender0.h,SOUNDS += VRENDER0
+--@src/emu/sound/vrender0.h,SOUNDS["VRENDER0"] = true
---------------------------------------------------
if (SOUNDS["VRENDER0"]~=null) then
@@ -1104,7 +1104,7 @@ end
---------------------------------------------------
-- WAVE file (used for MESS cassette)
---@src/emu/sound/wave.h,SOUNDS += WAVE
+--@src/emu/sound/wave.h,SOUNDS["WAVE"] = true
---------------------------------------------------
if (SOUNDS["WAVE"]~=null) then
@@ -1118,18 +1118,19 @@ end
---------------------------------------------------
-- Yamaha FM synthesizers
---@src/emu/sound/2151intf.h,SOUNDS += YM2151
---@src/emu/sound/2203intf.h,SOUNDS += YM2203
---@src/emu/sound/2413intf.h,SOUNDS += YM2413
---@src/emu/sound/2608intf.h,SOUNDS += YM2608
---@src/emu/sound/2610intf.h,SOUNDS += YM2610
---@src/emu/sound/2612intf.h,SOUNDS += YM2612
---@src/emu/sound/3812intf.h,SOUNDS += YM3812
---@src/emu/sound/3526intf.h,SOUNDS += YM3526
---@src/emu/sound/8950intf.h,SOUNDS += Y8950
---@src/emu/sound/ymf262.h,SOUNDS += YMF262
---@src/emu/sound/ymf271.h,SOUNDS += YMF271
---@src/emu/sound/ymf278b.h,SOUNDS += YMF278B
+--@src/emu/sound/2151intf.h,SOUNDS["YM2151"] = true
+--@src/emu/sound/2203intf.h,SOUNDS["YM2203"] = true
+--@src/emu/sound/2413intf.h,SOUNDS["YM2413"] = true
+--@src/emu/sound/2608intf.h,SOUNDS["YM2608"] = true
+--@src/emu/sound/2610intf.h,SOUNDS["YM2610"] = true
+--@src/emu/sound/2612intf.h,SOUNDS["YM2612"] = true
+--@src/emu/sound/3812intf.h,SOUNDS["YM3812"] = true
+--@src/emu/sound/3526intf.h,SOUNDS["YM3526"] = true
+--@src/emu/sound/8950intf.h,SOUNDS["Y8950"] = true
+--@src/emu/sound/ymf262.h,SOUNDS["YMF262"] = true
+--@src/emu/sound/ymf271.h,SOUNDS["YMF271"] = true
+--@src/emu/sound/ymf278b.h,SOUNDS["YMF278B"] = true
+--@src/emu/sound/262intf.h,SOUNDS["YMF262"] = true
---------------------------------------------------
if (SOUNDS["YM2151"]~=null) then
@@ -1141,7 +1142,17 @@ if (SOUNDS["YM2151"]~=null) then
}
end
-if (SOUNDS["YM2203"]~=null) then
+if (SOUNDS["YM2413"]~=null) then
+ files {
+ MAME_DIR .. "src/emu/sound/2413intf.c",
+ MAME_DIR .. "src/emu/sound/2413intf.h",
+ MAME_DIR .. "src/emu/sound/ym2413.c",
+ MAME_DIR .. "src/emu/sound/ym2413.h",
+ }
+end
+
+if (SOUNDS["YM2203"]~=null or SOUNDS["YM2608"]~=null or SOUNDS["YM2610"]~=null or SOUNDS["YM2610B"]~=null or SOUNDS["YM2612"]~=null or SOUNDS["YM3438"]~=null) then
+--if (SOUNDS["YM2203"]~=null) then
files {
MAME_DIR .. "src/emu/sound/2203intf.c",
MAME_DIR .. "src/emu/sound/2203intf.h",
@@ -1150,18 +1161,10 @@ if (SOUNDS["YM2203"]~=null) then
MAME_DIR .. "src/emu/sound/fm.c",
MAME_DIR .. "src/emu/sound/fm.h",
}
-end
+--end
-if (SOUNDS["YM2413"]~=null) then
- files {
- MAME_DIR .. "src/emu/sound/2413intf.c",
- MAME_DIR .. "src/emu/sound/2413intf.h",
- MAME_DIR .. "src/emu/sound/ym2413.c",
- MAME_DIR .. "src/emu/sound/ym2413.h",
- }
-end
-if (SOUNDS["YM2608"]~=null) then
+--if (SOUNDS["YM2608"]~=null) then
files {
MAME_DIR .. "src/emu/sound/2608intf.c",
MAME_DIR .. "src/emu/sound/2608intf.h",
@@ -1172,9 +1175,9 @@ if (SOUNDS["YM2608"]~=null) then
MAME_DIR .. "src/emu/sound/ymdeltat.c",
MAME_DIR .. "src/emu/sound/ymdeltat.h",
}
-end
+--end
-if (SOUNDS["YM2610"]~=null or SOUNDS["YM2610B"]~=null) then
+--if (SOUNDS["YM2610"]~=null or SOUNDS["YM2610B"]~=null) then
files {
MAME_DIR .. "src/emu/sound/2610intf.c",
MAME_DIR .. "src/emu/sound/2610intf.h",
@@ -1185,9 +1188,9 @@ if (SOUNDS["YM2610"]~=null or SOUNDS["YM2610B"]~=null) then
MAME_DIR .. "src/emu/sound/ymdeltat.c",
MAME_DIR .. "src/emu/sound/ymdeltat.h",
}
-end
+--end
-if (SOUNDS["YM2612"]~=null or SOUNDS["YM3438"]~=null) then
+--if (SOUNDS["YM2612"]~=null or SOUNDS["YM3438"]~=null) then
files {
MAME_DIR .. "src/emu/sound/2612intf.c",
MAME_DIR .. "src/emu/sound/2612intf.h",
@@ -1195,9 +1198,11 @@ if (SOUNDS["YM2612"]~=null or SOUNDS["YM3438"]~=null) then
MAME_DIR .. "src/emu/sound/ay8910.h",
MAME_DIR .. "src/emu/sound/fm2612.c",
}
+--end
end
-if (SOUNDS["YM3812"]~=null) then
+if (SOUNDS["YM3812"]~=null or SOUNDS["YM3526"]~=null or SOUNDS["Y8950"]~=null) then
+--if (SOUNDS["YM3812"]~=null) then
files {
MAME_DIR .. "src/emu/sound/3812intf.c",
MAME_DIR .. "src/emu/sound/3812intf.h",
@@ -1206,9 +1211,9 @@ if (SOUNDS["YM3812"]~=null) then
MAME_DIR .. "src/emu/sound/ymdeltat.c",
MAME_DIR .. "src/emu/sound/ymdeltat.h",
}
-end
+--end
-if (SOUNDS["YM3526"]~=null) then
+--if (SOUNDS["YM3526"]~=null) then
files {
MAME_DIR .. "src/emu/sound/3526intf.c",
MAME_DIR .. "src/emu/sound/3526intf.h",
@@ -1217,9 +1222,9 @@ if (SOUNDS["YM3526"]~=null) then
MAME_DIR .. "src/emu/sound/ymdeltat.c",
MAME_DIR .. "src/emu/sound/ymdeltat.h",
}
-end
+--end
-if (SOUNDS["Y8950"]~=null) then
+--if (SOUNDS["Y8950"]~=null) then
files {
MAME_DIR .. "src/emu/sound/8950intf.c",
MAME_DIR .. "src/emu/sound/8950intf.h",
@@ -1228,6 +1233,7 @@ if (SOUNDS["Y8950"]~=null) then
MAME_DIR .. "src/emu/sound/ymdeltat.c",
MAME_DIR .. "src/emu/sound/ymdeltat.h",
}
+--end
end
if (SOUNDS["YMF262"]~=null) then
@@ -1257,7 +1263,7 @@ end
---------------------------------------------------
-- Yamaha YMZ280B ADPCM
---@src/emu/sound/ymz280b.h,SOUNDS += YMZ280B
+--@src/emu/sound/ymz280b.h,SOUNDS["YMZ280B"] = true
---------------------------------------------------
if (SOUNDS["YMZ280B"]~=null) then
@@ -1269,7 +1275,7 @@ end
---------------------------------------------------
-- Yamaha YMZ770 AMM
---@src/emu/sound/ymz770.h,SOUNDS += YMZ770
+--@src/emu/sound/ymz770.h,SOUNDS["YMZ770"] = true
---------------------------------------------------
if (SOUNDS["YMZ770"]~=null) then
@@ -1283,7 +1289,7 @@ end
---------------------------------------------------
-- ZOOM ZSG-2
---@src/emu/sound/zsg2.h,SOUNDS += ZSG2
+--@src/emu/sound/zsg2.h,SOUNDS["ZSG2"] = true
---------------------------------------------------
if (SOUNDS["ZSG2"]~=null) then
@@ -1295,7 +1301,7 @@ end
---------------------------------------------------
-- VRC6
---@src/emu/sound/vrc6.h,SOUNDS += VRC6
+--@src/emu/sound/vrc6.h,SOUNDS["VRC6"] = true
---------------------------------------------------
if (SOUNDS["VRC6"]~=null) then
diff --git a/scripts/src/tools.lua b/scripts/src/tools.lua
index 936afb54346..55f966eed2e 100644
--- a/scripts/src/tools.lua
+++ b/scripts/src/tools.lua
@@ -24,10 +24,19 @@ end
links {
"utils",
"expat",
- "zlib",
"ocore_" .. _OPTIONS["osd"],
}
+if _OPTIONS["with-bundled-zlib"] then
+ links {
+ "zlib",
+ }
+else
+ links {
+ "z",
+ }
+end
+
includedirs {
MAME_DIR .. "src/osd",
MAME_DIR .. "src/lib/util",
@@ -60,12 +69,30 @@ end
links {
"utils",
"expat",
- "zlib",
- "flac",
"7z",
"ocore_" .. _OPTIONS["osd"],
}
+if _OPTIONS["with-bundled-zlib"] then
+ links {
+ "zlib",
+ }
+else
+ links {
+ "z",
+ }
+end
+
+if _OPTIONS["with-bundled-flac"] then
+ links {
+ "flac",
+ }
+else
+ links {
+ "FLAC",
+ }
+end
+
includedirs {
MAME_DIR .. "src/osd",
MAME_DIR .. "src/lib/util",
@@ -100,10 +127,19 @@ end
links {
"utils",
"expat",
- "zlib",
"ocore_" .. _OPTIONS["osd"],
}
+if _OPTIONS["with-bundled-zlib"] then
+ links {
+ "zlib",
+ }
+else
+ links {
+ "z",
+ }
+end
+
includedirs {
MAME_DIR .. "src/osd",
MAME_DIR .. "src/lib/util",
@@ -138,12 +174,30 @@ links {
"emu",
"utils",
"expat",
- "zlib",
- "flac",
"7z",
"ocore_" .. _OPTIONS["osd"],
}
+if _OPTIONS["with-bundled-zlib"] then
+ links {
+ "zlib",
+ }
+else
+ links {
+ "z",
+ }
+end
+
+if _OPTIONS["with-bundled-flac"] then
+ links {
+ "flac",
+ }
+else
+ links {
+ "FLAC",
+ }
+end
+
includedirs {
MAME_DIR .. "src/osd",
MAME_DIR .. "src/emu",
@@ -179,12 +233,30 @@ end
links {
"utils",
"expat",
- "zlib",
- "flac",
"7z",
"ocore_" .. _OPTIONS["osd"],
}
+if _OPTIONS["with-bundled-zlib"] then
+ links {
+ "zlib",
+ }
+else
+ links {
+ "z",
+ }
+end
+
+if _OPTIONS["with-bundled-flac"] then
+ links {
+ "flac",
+ }
+else
+ links {
+ "FLAC",
+ }
+end
+
includedirs {
MAME_DIR .. "src/osd",
MAME_DIR .. "src/lib/util",
@@ -218,12 +290,30 @@ end
links {
"utils",
"expat",
- "zlib",
- "flac",
"7z",
"ocore_" .. _OPTIONS["osd"],
}
+if _OPTIONS["with-bundled-zlib"] then
+ links {
+ "zlib",
+ }
+else
+ links {
+ "z",
+ }
+end
+
+if _OPTIONS["with-bundled-flac"] then
+ links {
+ "flac",
+ }
+else
+ links {
+ "FLAC",
+ }
+end
+
includedirs {
MAME_DIR .. "src/osd",
MAME_DIR .. "src/lib/util",
@@ -257,10 +347,19 @@ end
links {
"utils",
"expat",
- "zlib",
"ocore_" .. _OPTIONS["osd"],
}
+if _OPTIONS["with-bundled-zlib"] then
+ links {
+ "zlib",
+ }
+else
+ links {
+ "z",
+ }
+end
+
includedirs {
MAME_DIR .. "src/osd",
MAME_DIR .. "src/lib/util",
@@ -293,10 +392,19 @@ end
links {
"utils",
"expat",
- "zlib",
"ocore_" .. _OPTIONS["osd"],
}
+if _OPTIONS["with-bundled-zlib"] then
+ links {
+ "zlib",
+ }
+else
+ links {
+ "z",
+ }
+end
+
includedirs {
MAME_DIR .. "src/osd",
MAME_DIR .. "src/lib/util",
@@ -329,10 +437,19 @@ end
links {
"utils",
"expat",
- "zlib",
"ocore_" .. _OPTIONS["osd"],
}
+if _OPTIONS["with-bundled-zlib"] then
+ links {
+ "zlib",
+ }
+else
+ links {
+ "z",
+ }
+end
+
includedirs {
MAME_DIR .. "src/osd",
MAME_DIR .. "src/lib/util",
@@ -365,12 +482,30 @@ end
links {
"utils",
"expat",
- "zlib",
- "flac",
"7z",
"ocore_" .. _OPTIONS["osd"],
}
+if _OPTIONS["with-bundled-zlib"] then
+ links {
+ "zlib",
+ }
+else
+ links {
+ "z",
+ }
+end
+
+if _OPTIONS["with-bundled-flac"] then
+ links {
+ "flac",
+ }
+else
+ links {
+ "FLAC",
+ }
+end
+
includedirs {
MAME_DIR .. "src/osd",
MAME_DIR .. "src/lib/util",
@@ -403,10 +538,19 @@ end
links {
"utils",
"expat",
- "zlib",
"ocore_" .. _OPTIONS["osd"],
}
+if _OPTIONS["with-bundled-zlib"] then
+ links {
+ "zlib",
+ }
+else
+ links {
+ "z",
+ }
+end
+
includedirs {
MAME_DIR .. "src/osd",
MAME_DIR .. "src/lib/util",
@@ -439,12 +583,31 @@ end
links {
"utils",
"expat",
- "zlib",
- "flac",
"7z",
"ocore_" .. _OPTIONS["osd"],
+ "netlist",
}
+if _OPTIONS["with-bundled-zlib"] then
+ links {
+ "zlib",
+ }
+else
+ links {
+ "z",
+ }
+end
+
+if _OPTIONS["with-bundled-flac"] then
+ links {
+ "flac",
+ }
+else
+ links {
+ "FLAC",
+ }
+end
+
includedirs {
MAME_DIR .. "src/osd",
MAME_DIR .. "src/lib/util",
@@ -455,8 +618,6 @@ files {
MAME_DIR .. "src/tools/nltool.c",
}
-dofile("netlist.lua")
-
--------------------------------------------------
-- castool
--------------------------------------------------
@@ -481,12 +642,30 @@ links {
"formats",
"utils",
"expat",
- "zlib",
- "flac",
"7z",
"ocore_" .. _OPTIONS["osd"],
}
+if _OPTIONS["with-bundled-zlib"] then
+ links {
+ "zlib",
+ }
+else
+ links {
+ "z",
+ }
+end
+
+if _OPTIONS["with-bundled-flac"] then
+ links {
+ "flac",
+ }
+else
+ links {
+ "FLAC",
+ }
+end
+
includedirs {
MAME_DIR .. "src/osd",
MAME_DIR .. "src/lib",
@@ -522,12 +701,30 @@ links {
"emu",
"utils",
"expat",
- "zlib",
- "flac",
"7z",
"ocore_" .. _OPTIONS["osd"],
}
+if _OPTIONS["with-bundled-zlib"] then
+ links {
+ "zlib",
+ }
+else
+ links {
+ "z",
+ }
+end
+
+if _OPTIONS["with-bundled-flac"] then
+ links {
+ "flac",
+ }
+else
+ links {
+ "FLAC",
+ }
+end
+
includedirs {
MAME_DIR .. "src/osd",
MAME_DIR .. "src/lib",
@@ -563,12 +760,30 @@ links {
"emu",
"utils",
"expat",
- "zlib",
- "flac",
"7z",
"ocore_" .. _OPTIONS["osd"],
}
+if _OPTIONS["with-bundled-zlib"] then
+ links {
+ "zlib",
+ }
+else
+ links {
+ "z",
+ }
+end
+
+if _OPTIONS["with-bundled-flac"] then
+ links {
+ "flac",
+ }
+else
+ links {
+ "FLAC",
+ }
+end
+
includedirs {
MAME_DIR .. "src/osd",
MAME_DIR .. "src/lib",
@@ -590,6 +805,10 @@ files {
MAME_DIR .. "src/mess/tools/imgtool/imgterrs.c",
MAME_DIR .. "src/mess/tools/imgtool/imghd.c",
MAME_DIR .. "src/mess/tools/imgtool/charconv.c",
+ MAME_DIR .. "src/mess/tools/imgtool/formats/vt_dsk.c",
+ MAME_DIR .. "src/mess/tools/imgtool/formats/vt_dsk.h",
+ MAME_DIR .. "src/mess/tools/imgtool/formats/coco_dsk.c",
+ MAME_DIR .. "src/mess/tools/imgtool/formats/coco_dsk.h",
MAME_DIR .. "src/mess/tools/imgtool/modules/amiga.c",
MAME_DIR .. "src/mess/tools/imgtool/modules/macbin.c",
MAME_DIR .. "src/mess/tools/imgtool/modules/rsdos.c",
diff --git a/scripts/src/video.lua b/scripts/src/video.lua
index 107def93f61..e37fda6dd5a 100644
--- a/scripts/src/video.lua
+++ b/scripts/src/video.lua
@@ -11,7 +11,7 @@
--------------------------------------------------
--
---@src/emu/video/315_5124.h,VIDEOS += SEGA315_5124
+--@src/emu/video/315_5124.h,VIDEOS["SEGA315_5124"] = true
--------------------------------------------------
if (VIDEOS["SEGA315_5124"]~=null) then
@@ -23,7 +23,7 @@ end
--------------------------------------------------
--
---@src/emu/video/315_5313.h,VIDEOS += SEGA315_5313
+--@src/emu/video/315_5313.h,VIDEOS["SEGA315_5313"] = true
--------------------------------------------------
if (VIDEOS["SEGA315_5313"]~=null) then
@@ -35,7 +35,7 @@ end
--------------------------------------------------
--
---@src/emu/video/bufsprite.h,VIDEOS += BUFSPRITE
+--@src/emu/video/bufsprite.h,VIDEOS["BUFSPRITE"] = true
--------------------------------------------------
if (VIDEOS["BUFSPRITE"]~=null) then
@@ -47,7 +47,7 @@ end
--------------------------------------------------
--
---@src/emu/video/cdp1861.h,VIDEOS += CDP1861
+--@src/emu/video/cdp1861.h,VIDEOS["CDP1861"] = true
--------------------------------------------------
if (VIDEOS["CDP1861"]~=null) then
@@ -59,7 +59,7 @@ end
--------------------------------------------------
--
---@src/emu/video/cdp1862.h,VIDEOS += CDP1862
+--@src/emu/video/cdp1862.h,VIDEOS["CDP1862"] = true
--------------------------------------------------
if (VIDEOS["CDP1862"]~=null) then
@@ -71,7 +71,7 @@ end
--------------------------------------------------
--
---@src/emu/video/crt9007.h,VIDEOS += CRT9007
+--@src/emu/video/crt9007.h,VIDEOS["CRT9007"] = true
--------------------------------------------------
if (VIDEOS["CRT9007"]~=null) then
@@ -83,7 +83,7 @@ end
--------------------------------------------------
--
---@src/emu/video/crt9021.h,VIDEOS += CRT9021
+--@src/emu/video/crt9021.h,VIDEOS["CRT9021"] = true
--------------------------------------------------
if (VIDEOS["CRT9021"]~=null) then
@@ -95,7 +95,7 @@ end
--------------------------------------------------
--
---@src/emu/video/crt9212.h,VIDEOS += CRT9212
+--@src/emu/video/crt9212.h,VIDEOS["CRT9212"] = true
--------------------------------------------------
if (VIDEOS["CRT9212"]~=null) then
@@ -107,7 +107,7 @@ end
--------------------------------------------------
--
---@src/emu/video/dl1416.h,VIDEOS += DL1416
+--@src/emu/video/dl1416.h,VIDEOS["DL1416"] = true
--------------------------------------------------
if (VIDEOS["DL1416"]~=null) then
@@ -119,7 +119,7 @@ end
--------------------------------------------------
--
---@src/emu/video/dm9368.h,VIDEOS += DM9368
+--@src/emu/video/dm9368.h,VIDEOS["DM9368"] = true
--------------------------------------------------
if (VIDEOS["DM9368"]~=null) then
@@ -131,7 +131,7 @@ end
--------------------------------------------------
--
---@src/emu/video/ef9340_1.h,VIDEOS += EF9340_1
+--@src/emu/video/ef9340_1.h,VIDEOS["EF9340_1"] = true
--------------------------------------------------
if (VIDEOS["EF9340_1"]~=null) then
@@ -144,7 +144,7 @@ end
--------------------------------------------------
--
---@src/emu/video/ef9345.h,VIDEOS += EF9345
+--@src/emu/video/ef9345.h,VIDEOS["EF9345"] = true
--------------------------------------------------
if (VIDEOS["EF9345"]~=null) then
@@ -155,7 +155,7 @@ if (VIDEOS["EF9345"]~=null) then
end
--------------------------------------------------
---@src/emu/video/epic12.h,VIDEOS += EPIC12
+--@src/emu/video/epic12.h,VIDEOS["EPIC12"] = true
--------------------------------------------------
if (VIDEOS["EPIC12"]~=null) then
@@ -178,7 +178,7 @@ end
--------------------------------------------------
--
---@src/emu/video/fixfreq.h,VIDEOS += FIXFREQ
+--@src/emu/video/fixfreq.h,VIDEOS["FIXFREQ"] = true
--------------------------------------------------
if (VIDEOS["FIXFREQ"]~=null) then
@@ -190,7 +190,7 @@ end
--------------------------------------------------
--
---@src/emu/video/gf4500.h,VIDEOS += GF4500
+--@src/emu/video/gf4500.h,VIDEOS["GF4500"] = true
--------------------------------------------------
if (VIDEOS["GF4500"]~=null) then
@@ -202,7 +202,7 @@ end
--------------------------------------------------
--
---@src/emu/video/gf7600gs.h,VIDEOS += GF7600GS
+--@src/emu/video/gf7600gs.h,VIDEOS["GF7600GS"] = true
--------------------------------------------------
if (VIDEOS["GF7600GS"]~=null) then
@@ -214,7 +214,7 @@ end
--------------------------------------------------
--
---@src/emu/video/h63484.h,VIDEOS += H63484
+--@src/emu/video/h63484.h,VIDEOS["H63484"] = true
--------------------------------------------------
if (VIDEOS["H63484"]~=null) then
@@ -226,7 +226,7 @@ end
--------------------------------------------------
--
---@src/emu/video/hd44102.h,VIDEOS += HD44102
+--@src/emu/video/hd44102.h,VIDEOS["HD44102"] = true
--------------------------------------------------
if (VIDEOS["HD44102"]~=null) then
@@ -238,7 +238,7 @@ end
--------------------------------------------------
--
---@src/emu/video/hd44352.h,VIDEOS += HD44352
+--@src/emu/video/hd44352.h,VIDEOS["HD44352"] = true
--------------------------------------------------
if (VIDEOS["HD44352"]~=null) then
@@ -250,7 +250,7 @@ end
--------------------------------------------------
--
---@src/emu/video/hd44780.h,VIDEOS += HD44780
+--@src/emu/video/hd44780.h,VIDEOS["HD44780"] = true
--------------------------------------------------
if (VIDEOS["HD44780"]~=null) then
@@ -262,7 +262,7 @@ end
--------------------------------------------------
--
---@src/emu/video/hd61830.h,VIDEOS += HD61830
+--@src/emu/video/hd61830.h,VIDEOS["HD61830"] = true
--------------------------------------------------
if (VIDEOS["HD61830"]~=null) then
@@ -274,7 +274,7 @@ end
--------------------------------------------------
--
---@src/emu/video/hd63484.h,VIDEOS += HD63484
+--@src/emu/video/hd63484.h,VIDEOS["HD63484"] = true
--------------------------------------------------
if (VIDEOS["HD63484"]~=null) then
@@ -286,7 +286,7 @@ end
--------------------------------------------------
--
---@src/emu/video/hd66421.h,VIDEOS += HD66421
+--@src/emu/video/hd66421.h,VIDEOS["HD66421"] = true
--------------------------------------------------
if (VIDEOS["HD66421"]~=null) then
@@ -298,7 +298,7 @@ end
--------------------------------------------------
--
---@src/emu/video/huc6202.h,VIDEOS += HUC6202
+--@src/emu/video/huc6202.h,VIDEOS["HUC6202"] = true
--------------------------------------------------
if (VIDEOS["HUC6202"]~=null) then
@@ -310,7 +310,7 @@ end
--------------------------------------------------
--
---@src/emu/video/huc6260.h,VIDEOS += HUC6260
+--@src/emu/video/huc6260.h,VIDEOS["HUC6260"] = true
--------------------------------------------------
if (VIDEOS["HUC6260"]~=null) then
@@ -322,7 +322,7 @@ end
--------------------------------------------------
--
---@src/emu/video/huc6261.h,VIDEOS += HUC6261
+--@src/emu/video/huc6261.h,VIDEOS["HUC6261"] = true
--------------------------------------------------
if (VIDEOS["HUC6261"]~=null) then
@@ -334,7 +334,7 @@ end
--------------------------------------------------
--
---@src/emu/video/huc6270.h,VIDEOS += HUC6270
+--@src/emu/video/huc6270.h,VIDEOS["HUC6270"] = true
--------------------------------------------------
if (VIDEOS["HUC6270"]~=null) then
@@ -346,7 +346,7 @@ end
--------------------------------------------------
--
---@src/emu/video/huc6272.h,VIDEOS += HUC6272
+--@src/emu/video/huc6272.h,VIDEOS["HUC6272"] = true
--------------------------------------------------
if (VIDEOS["HUC6272"]~=null) then
@@ -358,7 +358,7 @@ end
--------------------------------------------------
--
---@src/emu/video/i8244.h,VIDEOS += I8244
+--@src/emu/video/i8244.h,VIDEOS["I8244"] = true
--------------------------------------------------
if (VIDEOS["I8244"]~=null) then
@@ -370,7 +370,19 @@ end
--------------------------------------------------
--
---@src/emu/video/i8275.h,VIDEOS += I8275
+--@src/emu/video/i82730.h,VIDEOS["I82730"] = true
+--------------------------------------------------
+
+if (VIDEOS["I82730"]~=null) then
+ files {
+ MAME_DIR .. "src/emu/video/i82730.c",
+ MAME_DIR .. "src/emu/video/i82730.h",
+ }
+end
+
+--------------------------------------------------
+--
+--@src/emu/video/i8275.h,VIDEOS["I8275"] = true
--------------------------------------------------
if (VIDEOS["I8275"]~=null) then
@@ -382,7 +394,7 @@ end
--------------------------------------------------
--
---@src/emu/video/m50458.h,VIDEOS += M50458
+--@src/emu/video/m50458.h,VIDEOS["M50458"] = true
--------------------------------------------------
if (VIDEOS["M50458"]~=null) then
@@ -394,7 +406,7 @@ end
--------------------------------------------------
--
---@src/emu/video/mb90082.h,VIDEOS += MB90082
+--@src/emu/video/mb90082.h,VIDEOS["MB90082"] = true
--------------------------------------------------
if (VIDEOS["MB90082"]~=null) then
@@ -406,7 +418,7 @@ end
--------------------------------------------------
--
---@src/emu/video/mb_vcu.h,VIDEOS += MB_VCU
+--@src/emu/video/mb_vcu.h,VIDEOS["MB_VCU"] = true
--------------------------------------------------
if (VIDEOS["MB_VCU"]~=null) then
@@ -418,7 +430,7 @@ end
--------------------------------------------------
--
---@src/emu/video/mc6845.h,VIDEOS += MC6845
+--@src/emu/video/mc6845.h,VIDEOS["MC6845"] = true
--------------------------------------------------
if (VIDEOS["MC6845"]~=null) then
@@ -430,7 +442,7 @@ end
--------------------------------------------------
--
---@src/emu/video/mc6847.h,VIDEOS += MC6847
+--@src/emu/video/mc6847.h,VIDEOS["MC6847"] = true
--------------------------------------------------
if (VIDEOS["MC6847"]~=null) then
@@ -442,7 +454,7 @@ end
--------------------------------------------------
--
---@src/emu/video/msm6222b.h,VIDEOS += MSM6222B
+--@src/emu/video/msm6222b.h,VIDEOS["MSM6222B"] = true
--------------------------------------------------
if (VIDEOS["MSM6222B"]~=null) then
@@ -454,7 +466,7 @@ end
--------------------------------------------------
--
---@src/emu/video/msm6255.h,VIDEOS += MSM6255
+--@src/emu/video/msm6255.h,VIDEOS["MSM6255"] = true
--------------------------------------------------
if (VIDEOS["MSM6255"]~=null) then
@@ -466,7 +478,7 @@ end
--------------------------------------------------
--
---@src/emu/video/mos6566.h,VIDEOS += MOS6566
+--@src/emu/video/mos6566.h,VIDEOS["MOS6566"] = true
--------------------------------------------------
if (VIDEOS["MOS6566"]~=null) then
@@ -484,7 +496,7 @@ files {
--------------------------------------------------
--
---@src/emu/video/pc_vga.h,VIDEOS += PC_VGA
+--@src/emu/video/pc_vga.h,VIDEOS["PC_VGA"] = true
--------------------------------------------------
if (VIDEOS["PC_VGA"]~=null) then
@@ -500,7 +512,7 @@ end
--------------------------------------------------
--
---@src/emu/video/polylgcy.h,VIDEOS += POLY
+--@src/emu/video/polylgcy.h,VIDEOS["POLY"] = true
--------------------------------------------------
if (VIDEOS["POLY"]~=null) then
@@ -512,7 +524,7 @@ end
--------------------------------------------------
--
---@src/emu/video/psx.h,VIDEOS += PSX
+--@src/emu/video/psx.h,VIDEOS["PSX"] = true
--------------------------------------------------
if (VIDEOS["PSX"]~=null) then
@@ -524,7 +536,7 @@ end
--------------------------------------------------
--
---@src/emu/video/ramdac.h,VIDEOS += RAMDAC
+--@src/emu/video/ramdac.h,VIDEOS["RAMDAC"] = true
--------------------------------------------------
if (VIDEOS["RAMDAC"]~=null) then
@@ -536,7 +548,7 @@ end
--------------------------------------------------
--
---@src/emu/video/saa5050.h,VIDEOS += SAA5050
+--@src/emu/video/saa5050.h,VIDEOS["SAA5050"] = true
--------------------------------------------------
if (VIDEOS["SAA5050"]~=null) then
@@ -548,7 +560,7 @@ end
--------------------------------------------------
--
---@src/emu/video/sed1200.h,VIDEOS += SED1200
+--@src/emu/video/sed1200.h,VIDEOS["SED1200"] = true
--------------------------------------------------
if (VIDEOS["SED1200"]~=null) then
files {
@@ -559,7 +571,7 @@ end
--------------------------------------------------
--
---@src/emu/video/sed1330.h,VIDEOS += SED1330
+--@src/emu/video/sed1330.h,VIDEOS["SED1330"] = true
--------------------------------------------------
if (VIDEOS["SED1330"]~=null) then
files {
@@ -570,7 +582,7 @@ end
--------------------------------------------------
--
---@src/emu/video/sed1520.h,VIDEOS += SED1520
+--@src/emu/video/sed1520.h,VIDEOS["SED1520"] = true
--------------------------------------------------
if (VIDEOS["SED1520"]~=null) then
files {
@@ -581,7 +593,7 @@ end
--------------------------------------------------
--
---@src/emu/video/scn2674.h,VIDEOS += SCN2674
+--@src/emu/video/scn2674.h,VIDEOS["SCN2674"] = true
--------------------------------------------------
if (VIDEOS["SCN2674"]~=null) then
files {
@@ -592,7 +604,7 @@ end
--------------------------------------------------
--
---@src/emu/video/snes_ppu.h,VIDEOS += SNES_PPU
+--@src/emu/video/snes_ppu.h,VIDEOS["SNES_PPU"] = true
--------------------------------------------------
if (VIDEOS["SNES_PPU"]~=null) then
files {
@@ -603,8 +615,8 @@ end
--------------------------------------------------
--
---@src/emu/video/stvvdp1.h,VIDEOS += STVVDP
---@src/emu/video/stvvdp2.h,VIDEOS += STVVDP
+--@src/emu/video/stvvdp1.h,VIDEOS["STVVDP"] = true
+--@src/emu/video/stvvdp2.h,VIDEOS["STVVDP"] = true
--------------------------------------------------
if (VIDEOS["STVVDP"]~=null) then
@@ -616,7 +628,7 @@ end
--------------------------------------------------
--
---@src/emu/video/t6a04.h,VIDEOS += T6A04
+--@src/emu/video/t6a04.h,VIDEOS["T6A04"] = true
--------------------------------------------------
if (VIDEOS["T6A04"]~=null) then
@@ -628,7 +640,7 @@ end
--------------------------------------------------
--
---@src/emu/video/tea1002.h,VIDEOS += TEA1002
+--@src/emu/video/tea1002.h,VIDEOS["TEA1002"] = true
--------------------------------------------------
if (VIDEOS["TEA1002"]~=null) then
@@ -640,7 +652,7 @@ end
--------------------------------------------------
--
---@src/emu/video/tlc34076.h,VIDEOS += TLC34076
+--@src/emu/video/tlc34076.h,VIDEOS["TLC34076"] = true
--------------------------------------------------
if (VIDEOS["TLC34076"]~=null) then
@@ -652,7 +664,7 @@ end
--------------------------------------------------
--
---@src/emu/video/tms34061.h,VIDEOS += TMS34061
+--@src/emu/video/tms34061.h,VIDEOS["TMS34061"] = true
--------------------------------------------------
if (VIDEOS["TMS34061"]~=null) then
@@ -664,7 +676,7 @@ end
--------------------------------------------------
--
---@src/emu/video/tms3556.h,VIDEOS += TMS3556
+--@src/emu/video/tms3556.h,VIDEOS["TMS3556"] = true
--------------------------------------------------
if (VIDEOS["TMS3556"]~=null) then
@@ -676,7 +688,7 @@ end
--------------------------------------------------
--
---@src/emu/video/tms9927.h,VIDEOS += TMS9927
+--@src/emu/video/tms9927.h,VIDEOS["TMS9927"] = true
--------------------------------------------------
if (VIDEOS["TMS9927"]~=null) then
@@ -688,7 +700,7 @@ end
--------------------------------------------------
--
---@src/emu/video/tms9928a.h,VIDEOS += TMS9928A
+--@src/emu/video/tms9928a.h,VIDEOS["TMS9928A"] = true
--------------------------------------------------
if (VIDEOS["TMS9928A"]~=null) then
@@ -700,7 +712,7 @@ end
--------------------------------------------------
--
---@src/emu/video/upd3301.h,VIDEOS += UPD3301
+--@src/emu/video/upd3301.h,VIDEOS["UPD3301"] = true
--------------------------------------------------
if (VIDEOS["UPD3301"]~=null) then
@@ -712,7 +724,7 @@ end
--------------------------------------------------
--
---@src/emu/video/upd7220.h,VIDEOS += UPD7220
+--@src/emu/video/upd7220.h,VIDEOS["UPD7220"] = true
--------------------------------------------------
if (VIDEOS["UPD7220"]~=null) then
@@ -724,7 +736,7 @@ end
--------------------------------------------------
--
---@src/emu/video/upd7227.h,VIDEOS += UPD7227
+--@src/emu/video/upd7227.h,VIDEOS["UPD7227"] = true
--------------------------------------------------
if (VIDEOS["UPD7227"]~=null) then
@@ -736,7 +748,7 @@ end
--------------------------------------------------
--
---@src/emu/video/vic4567.h,VIDEOS += VIC4567
+--@src/emu/video/vic4567.h,VIDEOS["VIC4567"] = true
--------------------------------------------------
if (VIDEOS["VIC4567"]~=null) then
@@ -748,7 +760,7 @@ end
--------------------------------------------------
--
---@src/emu/video/v9938.h,VIDEOS += V9938
+--@src/emu/video/v9938.h,VIDEOS["V9938"] = true
--------------------------------------------------
if (VIDEOS["V9938"]~=null) then
@@ -760,7 +772,7 @@ end
--------------------------------------------------
--
---@src/emu/video/voodoo.h,VIDEOS += VOODOO
+--@src/emu/video/voodoo.h,VIDEOS["VOODOO"] = true
--------------------------------------------------
if (VIDEOS["VOODOO"]~=null) then
@@ -773,7 +785,7 @@ end
--------------------------------------------------
--
---@src/emu/video/voodoo_pci.h,VIDEOS += VOODOO_PCI
+--@src/emu/video/voodoo_pci.h,VIDEOS["VOODOO_PCI"] = true
--------------------------------------------------
if (VIDEOS["VOODOO_PCI"]~=null) then
@@ -785,7 +797,7 @@ end
--------------------------------------------------
--
---@src/emu/video/crtc_ega.h,VIDEOS += CRTC_EGA
+--@src/emu/video/crtc_ega.h,VIDEOS["CRTC_EGA"] = true
--------------------------------------------------
if (VIDEOS["CRTC_EGA"]~=null) then
diff --git a/scripts/target/ldplayer/ldplayer.lua b/scripts/target/ldplayer/ldplayer.lua
index 3660b87cba9..c8435c4a8ab 100644
--- a/scripts/target/ldplayer/ldplayer.lua
+++ b/scripts/target/ldplayer/ldplayer.lua
@@ -54,7 +54,7 @@ BUSES["MIDI"] = true
function createProjects_ldplayer_ldplayer(_target, _subtarget)
project ("drvldplayer")
targetsubdir(_target .."_" .. _subtarget)
- kind "StaticLib"
+ kind (LIBTYPE)
uuid (os.uuid("drvldplayer"))
options {
@@ -68,9 +68,13 @@ function createProjects_ldplayer_ldplayer(_target, _subtarget)
MAME_DIR .. "src/lib",
MAME_DIR .. "src/lib/util",
MAME_DIR .. "3rdparty",
- MAME_DIR .. "3rdparty/zlib",
GEN_DIR .. "mame/layout",
- }
+ }
+ if _OPTIONS["with-bundled-zlib"] then
+ includedirs {
+ MAME_DIR .. "3rdparty/zlib",
+ }
+ end
files{
MAME_DIR .. "src/emu/drivers/emudummy.c",
@@ -89,4 +93,4 @@ function linkProjects_ldplayer_ldplayer(_target, _subtarget)
links {
"drvldplayer",
}
-end \ No newline at end of file
+end
diff --git a/scripts/target/mame/arcade.lua b/scripts/target/mame/arcade.lua
index eff03dac309..4bed9740440 100644
--- a/scripts/target/mame/arcade.lua
+++ b/scripts/target/mame/arcade.lua
@@ -128,6 +128,8 @@ CPUS["ARCOMPACT"] = true
CPUS["HMCS40"] = true
--CPUS["E0C6200"] = true
--CPUS["MELPS4"] = true
+--CPUS["HPHYBRID"] = true
+--CPUS["SM510"] = true
--------------------------------------------------
-- specify available sound cores
@@ -470,6 +472,7 @@ MACHINES["MSM6242"] = true
--MACHINES["NCR5380N"] = true
--MACHINES["NCR5390"] = true
MACHINES["NCR539x"] = true
+MACHINES["NETLIST"] = true
--MACHINES["NCR53C7XX"] = true
MACHINES["NMC9306"] = true
--MACHINES["NSC810"] = true
@@ -534,7 +537,6 @@ MACHINES["UPD765"] = true
MACHINES["V3021"] = true
MACHINES["WD_FDC"] = true
MACHINES["WD11C00_17"] = true
-MACHINES["WD17XX"] = true
MACHINES["WD2010"] = true
MACHINES["WD33C93"] = true
MACHINES["X2212"] = true
@@ -760,7 +762,7 @@ end
function createMAMEProjects(_target, _subtarget, _name)
project (_name)
targetsubdir(_target .."_" .. _subtarget)
- kind "StaticLib"
+ kind (LIBTYPE)
uuid (os.uuid("drv-" .. _target .."_" .. _subtarget .. "_" .._name))
options {
@@ -774,9 +776,14 @@ function createMAMEProjects(_target, _subtarget, _name)
MAME_DIR .. "src/lib",
MAME_DIR .. "src/lib/util",
MAME_DIR .. "3rdparty",
- MAME_DIR .. "3rdparty/zlib",
GEN_DIR .. "mame/layout",
}
+
+ if _OPTIONS["with-bundled-zlib"] then
+ includedirs {
+ MAME_DIR .. "3rdparty/zlib",
+ }
+end
end
function createProjects_mame_arcade(_target, _subtarget)
@@ -1238,7 +1245,6 @@ files {
MAME_DIR .. "src/mame/audio/astrof.c",
MAME_DIR .. "src/mame/drivers/backfire.c",
MAME_DIR .. "src/mame/drivers/battlera.c",
- MAME_DIR .. "src/mame/video/battlera.c",
MAME_DIR .. "src/mame/drivers/boogwing.c",
MAME_DIR .. "src/mame/video/boogwing.c",
MAME_DIR .. "src/mame/drivers/brkthru.c",
@@ -2421,6 +2427,8 @@ files {
MAME_DIR .. "src/mame/drivers/model1.c",
MAME_DIR .. "src/mame/machine/model1.c",
MAME_DIR .. "src/mame/video/model1.c",
+ MAME_DIR .. "src/mame/machine/s32comm.c",
+ MAME_DIR .. "src/mame/machine/m1comm.c",
MAME_DIR .. "src/mame/audio/dsbz80.c",
MAME_DIR .. "src/mame/drivers/model2.c",
MAME_DIR .. "src/mame/video/model2.c",
@@ -2474,6 +2482,7 @@ files {
MAME_DIR .. "src/mame/video/segas18.c",
MAME_DIR .. "src/mame/drivers/segas24.c",
MAME_DIR .. "src/mame/video/segas24.c",
+ MAME_DIR .. "src/mame/drivers/segam1.c",
MAME_DIR .. "src/mame/drivers/segas32.c",
MAME_DIR .. "src/mame/machine/segas32.c",
MAME_DIR .. "src/mame/video/segas32.c",
@@ -2575,7 +2584,6 @@ files {
MAME_DIR .. "src/mame/machine/n64.c",
MAME_DIR .. "src/mame/video/n64.c",
MAME_DIR .. "src/mame/video/rdpblend.c",
- MAME_DIR .. "src/mame/video/rdpspn16.c",
MAME_DIR .. "src/mame/video/rdptpipe.c",
MAME_DIR .. "src/mame/drivers/hanaawas.c",
MAME_DIR .. "src/mame/video/hanaawas.c",
@@ -2598,6 +2606,7 @@ files {
MAME_DIR .. "src/mame/machine/st0016.c",
MAME_DIR .. "src/mame/drivers/simple_st0016.c",
MAME_DIR .. "src/mame/video/seta001.c",
+ MAME_DIR .. "src/mame/drivers/thedealr.c",
}
createMAMEProjects(_target, _subtarget, "sigma")
diff --git a/scripts/target/mame/dummy.lua b/scripts/target/mame/dummy.lua
index bd207bf41c8..dba163b35f8 100644
--- a/scripts/target/mame/dummy.lua
+++ b/scripts/target/mame/dummy.lua
@@ -15,7 +15,7 @@ dofile("mess.lua")
function createProjects_mame_dummy(_target, _subtarget)
project ("mame_dummy")
targetsubdir(_target .."_" .. _subtarget)
- kind "StaticLib"
+ kind (LIBTYPE)
uuid (os.uuid("drv-mame_dummy"))
options {
@@ -29,9 +29,13 @@ function createProjects_mame_dummy(_target, _subtarget)
MAME_DIR .. "src/lib",
MAME_DIR .. "src/lib/util",
MAME_DIR .. "3rdparty",
- MAME_DIR .. "3rdparty/zlib",
GEN_DIR .. "mess/layout",
- }
+ }
+ if _OPTIONS["with-bundled-zlib"] then
+ includedirs {
+ MAME_DIR .. "3rdparty/zlib",
+ }
+ end
files{
MAME_DIR .. "src/mess/drivers/coleco.c",
@@ -43,4 +47,4 @@ function linkProjects_mame_dummy(_target, _subtarget)
links {
"mame_dummy",
}
-end \ No newline at end of file
+end
diff --git a/scripts/target/mame/mess.lua b/scripts/target/mame/mess.lua
index 84bed8d6c66..9b21024d72d 100644
--- a/scripts/target/mame/mess.lua
+++ b/scripts/target/mame/mess.lua
@@ -128,6 +128,8 @@ CPUS["UCOM4"] = true
CPUS["HMCS40"] = true
CPUS["E0C6200"] = true
CPUS["MELPS4"] = true
+CPUS["HPHYBRID"] = true
+CPUS["SM510"] = true
--------------------------------------------------
-- specify available sound cores; some of these are
@@ -154,7 +156,7 @@ SOUNDS["YM3526"] = true
SOUNDS["Y8950"] = true
SOUNDS["YMF262"] = true
--SOUNDS["YMF271"] = true
---SOUNDS["YMF278B"] = true
+SOUNDS["YMF278B"] = true
--SOUNDS["YMZ280B"] = true
SOUNDS["SN76477"] = true
SOUNDS["SN76496"] = true
@@ -286,6 +288,7 @@ VIDEOS["HUC6261"] = true
VIDEOS["HUC6270"] = true
VIDEOS["HUC6272"] = true
VIDEOS["I8244"] = true
+VIDEOS["I82730"] = true
VIDEOS["I8275"] = true
--VIDEOS+= M50458"] = true
--VIDEOS+= MB90082"] = true
@@ -471,6 +474,7 @@ MACHINES["NCR5380N"] = true
MACHINES["NCR5390"] = true
MACHINES["NCR539x"] = true
MACHINES["NCR53C7XX"] = true
+MACHINES["NETLIST"] = true
MACHINES["NMC9306"] = true
MACHINES["NSC810"] = true
MACHINES["NSCSI"] = true
@@ -532,7 +536,6 @@ MACHINES["UPD765"] = true
MACHINES["V3021"] = true
MACHINES["WD_FDC"] = true
MACHINES["WD11C00_17"] = true
-MACHINES["WD17XX"] = true
MACHINES["WD2010"] = true
MACHINES["WD33C93"] = true
MACHINES["WD7600"] = true
@@ -572,6 +575,7 @@ BUSES["ABCKB"] = true
BUSES["ADAM"] = true
BUSES["ADAMNET"] = true
BUSES["APF"] = true
+BUSES["APRICOT_EXPANSION"] = true
BUSES["ARCADIA"] = true
BUSES["ASTROCADE"] = true
BUSES["BML3"] = true
@@ -751,6 +755,7 @@ function linkProjects_mame_mess(_target, _subtarget)
"memotech",
"mgu",
"microkey",
+ "microsoft",
"mit",
"mits",
"mitsubishi",
@@ -770,6 +775,7 @@ function linkProjects_mame_mess(_target, _subtarget)
"novag",
"ns",
"olivetti",
+ "olympia",
"omnibyte",
"orion",
"osborne",
@@ -785,6 +791,7 @@ function linkProjects_mame_mess(_target, _subtarget)
"psion",
"radio",
"rca",
+ "regnecentralen",
"ritam",
"rm",
"robotron",
@@ -831,6 +838,7 @@ function linkProjects_mame_mess(_target, _subtarget)
"toshiba",
"trainer",
"trs",
+ "ultimachine",
"ultratec",
"unisys",
"veb",
@@ -859,7 +867,7 @@ end
function createMESSProjects(_target, _subtarget, _name)
project (_name)
targetsubdir(_target .."_" .. _subtarget)
- kind "StaticLib"
+ kind (LIBTYPE)
uuid (os.uuid("drv-" .. _target .."_" .. _subtarget .. "_" .._name))
options {
@@ -874,11 +882,15 @@ function createMESSProjects(_target, _subtarget, _name)
MAME_DIR .. "src/lib",
MAME_DIR .. "src/lib/util",
MAME_DIR .. "3rdparty",
- MAME_DIR .. "3rdparty/zlib",
GEN_DIR .. "mess/layout",
GEN_DIR .. "mame/layout",
MAME_DIR .. "src/emu/cpu/m68000",
}
+ if _OPTIONS["with-bundled-zlib"] then
+ includedirs {
+ MAME_DIR .. "3rdparty/zlib",
+ }
+ end
end
function createProjects_mame_mess(_target, _subtarget)
@@ -931,7 +943,6 @@ files {
MAME_DIR .. "src/mame/video/n64.c",
MAME_DIR .. "src/mame/video/rdpblend.c",
MAME_DIR .. "src/mame/video/rdptpipe.c",
- MAME_DIR .. "src/mame/video/rdpspn16.c",
MAME_DIR .. "src/mame/machine/megadriv.c",
MAME_DIR .. "src/mame/drivers/naomi.c",
MAME_DIR .. "src/mame/machine/awboard.c",
@@ -1016,6 +1027,7 @@ files {
MAME_DIR .. "src/mess/drivers/apricotf.c",
MAME_DIR .. "src/mess/drivers/apricotp.c",
MAME_DIR .. "src/mess/machine/apricotkb.c",
+ MAME_DIR .. "src/mess/machine/apricotkb_hle.c",
MAME_DIR .. "src/mess/drivers/victor9k.c",
MAME_DIR .. "src/mess/machine/victor9kb.c",
MAME_DIR .. "src/mess/machine/victor9k_fdc.c",
@@ -1597,6 +1609,7 @@ files {
MAME_DIR .. "src/mess/drivers/hp9845.c",
MAME_DIR .. "src/mess/drivers/hp9k.c",
MAME_DIR .. "src/mess/drivers/hp9k_3xx.c",
+ MAME_DIR .. "src/mess/drivers/hp64k.c",
}
createMESSProjects(_target, _subtarget, "hec2hrp")
@@ -1617,6 +1630,7 @@ files {
MAME_DIR .. "src/mess/drivers/isbc.c",
MAME_DIR .. "src/mess/machine/isbc_215g.c",
MAME_DIR .. "src/mess/drivers/rex6000.c",
+ MAME_DIR .. "src/mess/drivers/sdk80.c",
MAME_DIR .. "src/mess/drivers/sdk85.c",
MAME_DIR .. "src/mess/drivers/sdk86.c",
MAME_DIR .. "src/mess/drivers/imds2.c",
@@ -1740,6 +1754,11 @@ files {
MAME_DIR .. "src/mess/video/primo.c",
}
+createMESSProjects(_target, _subtarget, "microsoft")
+files {
+ MAME_DIR .. "src/mess/drivers/xbox.c",
+}
+
createMESSProjects(_target, _subtarget, "mit")
files {
MAME_DIR .. "src/mess/drivers/tx0.c",
@@ -1880,11 +1899,18 @@ files {
createMESSProjects(_target, _subtarget, "olivetti")
files {
MAME_DIR .. "src/mess/drivers/m20.c",
+ MAME_DIR .. "src/mess/machine/m20_kbd.c",
+ MAME_DIR .. "src/mess/machine/m20_8086.c",
MAME_DIR .. "src/mess/drivers/m24.c",
MAME_DIR .. "src/mess/machine/m24_kbd.c",
MAME_DIR .. "src/mess/machine/m24_z8000.c"
}
+createMESSProjects(_target, _subtarget, "olympia")
+files {
+ MAME_DIR .. "src/mess/drivers/peoplepc.c"
+}
+
createMESSProjects(_target, _subtarget, "ns")
files {
MAME_DIR .. "src/mess/drivers/hh_cop400.c",
@@ -1999,6 +2025,11 @@ files {
MAME_DIR .. "src/mess/drivers/vip.c",
}
+createMESSProjects(_target, _subtarget, "regnecentralen")
+files {
+ MAME_DIR .. "src/mess/drivers/rc759.c",
+}
+
createMESSProjects(_target, _subtarget, "ritam")
files {
MAME_DIR .. "src/mess/drivers/monty.c",
@@ -2096,6 +2127,7 @@ files {
createMESSProjects(_target, _subtarget, "sharp")
files {
+ MAME_DIR .. "src/mess/drivers/hh_sm510.c",
MAME_DIR .. "src/mess/video/mz700.c",
MAME_DIR .. "src/mess/drivers/mz700.c",
MAME_DIR .. "src/mess/drivers/pc1500.c",
@@ -2420,6 +2452,11 @@ files {
MAME_DIR .. "src/mess/machine/tandy2kb.c",
}
+createMESSProjects(_target, _subtarget, "ultimachine")
+files {
+ MAME_DIR .. "src/mess/drivers/rambo.c",
+}
+
createMESSProjects(_target, _subtarget, "ultratec")
files {
MAME_DIR .. "src/mess/drivers/minicom.c",
@@ -2574,7 +2611,8 @@ files {
MAME_DIR .. "src/mess/drivers/cxhumax.c",
MAME_DIR .. "src/mess/drivers/czk80.c",
MAME_DIR .. "src/mess/drivers/d6800.c",
- MAME_DIR .. "src/mess/drivers/d6809.c",
+ MAME_DIR .. "src/mess/drivers/d6809.c",
+ MAME_DIR .. "src/mess/drivers/daruma.c",
MAME_DIR .. "src/mess/drivers/digel804.c",
MAME_DIR .. "src/mess/drivers/dim68k.c",
MAME_DIR .. "src/mess/drivers/dm7000.c",
@@ -2604,7 +2642,9 @@ files {
MAME_DIR .. "src/mess/drivers/hunter2.c",
MAME_DIR .. "src/emu/machine/nsc810.c",
MAME_DIR .. "src/emu/machine/nsc810.h",
+ MAME_DIR .. "src/mess/drivers/i7000.c",
MAME_DIR .. "src/mess/drivers/ibm6580.c",
+ MAME_DIR .. "src/mess/drivers/icatel.c",
MAME_DIR .. "src/mess/drivers/ie15.c",
MAME_DIR .. "src/mess/machine/ie15_kbd.c",
MAME_DIR .. "src/mess/drivers/if800.c",
@@ -2665,6 +2705,7 @@ files {
MAME_DIR .. "src/mess/drivers/terak.c",
MAME_DIR .. "src/mess/drivers/ti630.c",
MAME_DIR .. "src/mess/drivers/tsispch.c",
+ MAME_DIR .. "src/mess/drivers/tvgame.c",
MAME_DIR .. "src/mess/drivers/unistar.c",
MAME_DIR .. "src/mess/drivers/v6809.c",
MAME_DIR .. "src/mess/drivers/vector4.c",
diff --git a/scripts/target/mame/nl.lua b/scripts/target/mame/nl.lua
new file mode 100644
index 00000000000..0ba36789c5b
--- /dev/null
+++ b/scripts/target/mame/nl.lua
@@ -0,0 +1,126 @@
+-- license:BSD-3-Clause
+-- copyright-holders:MAMEdev Team
+
+---------------------------------------------------------------------------
+--
+-- nl.lua
+--
+-- Compiles all drivers using netlist code
+-- Use make SUBTARGET=nl to build
+--
+---------------------------------------------------------------------------
+
+
+--------------------------------------------------
+-- Specify all the CPU cores necessary for the
+-- drivers referenced in nl.lst.
+--------------------------------------------------
+
+CPUS["Z80"] = true
+--CPUS["M6502"] = true
+--CPUS["MCS48"] = true
+--CPUS["MCS51"] = true
+--CPUS["M6800"] = true
+--CPUS["M6809"] = true
+--CPUS["M680X0"] = true
+--CPUS["TMS9900"] = true
+--CPUS["COP400"] = true
+
+--------------------------------------------------
+-- Specify all the sound cores necessary for the
+-- drivers referenced in nl.lst.
+--------------------------------------------------
+
+--SOUNDS["SAMPLES"] = true
+SOUNDS["DAC"] = true
+--SOUNDS["DISCRETE"] = true
+SOUNDS["AY8910"] = true
+--SOUNDS["YM2151"] = true
+--SOUNDS["ASTROCADE"] = true
+--SOUNDS["TMS5220"] = true
+--SOUNDS["OKIM6295"] = true
+--SOUNDS["HC55516"] = true
+--SOUNDS["YM3812"] = true
+--SOUNDS["CEM3394"] = true
+--SOUNDS["VOTRAX"] = true
+
+--------------------------------------------------
+-- specify available video cores
+--------------------------------------------------
+
+VIDEOS["FIXFREQ"] = true
+
+--------------------------------------------------
+-- specify available machine cores
+--------------------------------------------------
+
+MACHINES["NETLIST"] = true
+--MACHINES["6821PIA"] = true
+--MACHINES["TTL74148"] = true
+--MACHINES["TTL74153"] = true
+--MACHINES["TTL7474"] = true
+--MACHINES["RIOT6532"] = true
+--MACHINES["PIT8253"] = true
+--MACHINES["Z80CTC"] = true
+--MACHINES["68681"] = true
+--MACHINES["BANKDEV"] = true
+
+
+--------------------------------------------------
+-- specify available bus cores
+--------------------------------------------------
+
+-- not needed by nl.lua but build system wants at least one bus
+BUSES["CENTRONICS"] = true
+
+--------------------------------------------------
+-- This is the list of files that are necessary
+-- for building all of the drivers referenced
+-- in nl.lst
+--------------------------------------------------
+
+function createProjects_mame_nl(_target, _subtarget)
+ project ("mame_netlist")
+ targetsubdir(_target .."_" .. _subtarget)
+ kind (LIBTYPE)
+ uuid (os.uuid("drv-mame-nl"))
+
+ options {
+ "ForceCPP",
+ }
+
+ includedirs {
+ MAME_DIR .. "src/osd",
+ MAME_DIR .. "src/emu",
+ MAME_DIR .. "src/mame",
+ MAME_DIR .. "src/lib",
+ MAME_DIR .. "src/lib/util",
+ MAME_DIR .. "3rdparty",
+ GEN_DIR .. "mame/layout",
+ }
+
+ if _OPTIONS["with-bundled-zlib"] then
+ includedirs {
+ MAME_DIR .. "3rdparty/zlib",
+ }
+ end
+
+ files{
+ MAME_DIR .. "src/mame/drivers/pong.c",
+ MAME_DIR .. "src/mame/drivers/nl_pong.c",
+ MAME_DIR .. "src/mame/drivers/nl_pongd.c",
+ MAME_DIR .. "src/mame/drivers/nl_breakout.c",
+
+ MAME_DIR .. "src/mame/drivers/1942.c",
+ MAME_DIR .. "src/mame/video/1942.c",
+ MAME_DIR .. "src/mame/drivers/popeye.c",
+ MAME_DIR .. "src/mame/video/popeye.c",
+
+ }
+end
+
+function linkProjects_mame_nl(_target, _subtarget)
+ links {
+ "mame_netlist",
+ }
+end
diff --git a/scripts/target/mame/tiny.lua b/scripts/target/mame/tiny.lua
index 350dfd5847c..5594593d113 100644
--- a/scripts/target/mame/tiny.lua
+++ b/scripts/target/mame/tiny.lua
@@ -78,7 +78,7 @@ BUSES["CENTRONICS"] = true
function createProjects_mame_tiny(_target, _subtarget)
project ("mame_tiny")
targetsubdir(_target .."_" .. _subtarget)
- kind "StaticLib"
+ kind (LIBTYPE)
uuid (os.uuid("drv-mame-tiny"))
options {
@@ -92,9 +92,13 @@ function createProjects_mame_tiny(_target, _subtarget)
MAME_DIR .. "src/lib",
MAME_DIR .. "src/lib/util",
MAME_DIR .. "3rdparty",
- MAME_DIR .. "3rdparty/zlib",
GEN_DIR .. "mame/layout",
- }
+ }
+ if _OPTIONS["with-bundled-zlib"] then
+ includedirs {
+ MAME_DIR .. "3rdparty/zlib",
+ }
+ end
files{
MAME_DIR .. "src/mame/machine/ticket.c",
diff --git a/src/build/makedep.py b/src/build/makedep.py
new file mode 100644
index 00000000000..d877dfe100e
--- /dev/null
+++ b/src/build/makedep.py
@@ -0,0 +1,314 @@
+#!/usr/bin/python
+##
+## license:BSD-3-Clause
+## copyright-holders:Miodrag Milanovic
+
+from __future__ import with_statement
+
+import sys
+## to ignore include of emu.h add it always to list
+
+files_included = ['src/emu/emu.h']
+
+include_dirs = ['src/emu/', 'src/mame/', 'src/mess/']
+
+mappings = dict()
+
+deps_files_included = [ ]
+
+deps_include_dirs = ['src/mame/', 'src/mess/']
+
+components = [ ]
+
+drivers = [ ]
+
+def file_exists(root, srcfile, folder, inc_dir):
+ includes = [ folder ]
+ includes.extend(inc_dir)
+ for line in includes:
+ try:
+ fp = open(root + line + srcfile, 'rb')
+ fp.close()
+ return line + srcfile
+ except IOError:
+ pass
+ return ''
+
+def add_c_if_exists(root, fullname):
+ try:
+ fp = open(root + fullname, 'rb')
+ fp.close()
+ deps_files_included.append(fullname)
+ except IOError:
+ pass
+
+def add_rest_if_exists(root, srcfile,folder):
+ t = srcfile.rsplit('/', 2)
+ if t[1]=='includes':
+ t[2] = t[2].replace('.h','.c')
+ t[1] = 'drivers'
+ add_c_if_exists(root,"/".join(t))
+ parse_file_for_deps(root, "/".join(t), folder)
+ t[1] = 'machine'
+ add_c_if_exists(root,"/".join(t))
+ parse_file_for_deps(root, "/".join(t), folder)
+ t[1] = 'video'
+ add_c_if_exists(root,"/".join(t))
+ parse_file_for_deps(root, "/".join(t), folder)
+ t[1] = 'audio'
+ add_c_if_exists(root,"/".join(t))
+ parse_file_for_deps(root, "/".join(t), folder)
+
+def parse_file_for_deps(root, srcfile, folder):
+ try:
+ fp = open(root + srcfile, 'rb')
+ except IOError:
+ return 1
+ in_comment = 0
+ linenum = 0
+ for line in fp.readlines():
+ content = ''
+ linenum+=1
+ srcptr = 0
+ while srcptr < len(line):
+ c = line[srcptr]
+ srcptr+=1
+ if c==13 or c==10:
+ if c==13 and line[srcptr]==10:
+ srcptr+=1
+ continue
+ if c==' ' or c==9:
+ continue
+ if in_comment==1 and c=='*' and line[srcptr]=='/' :
+ srcptr+=1
+ in_comment = 0
+ continue
+ if in_comment:
+ continue
+ if c=='/' and line[srcptr]=='*' :
+ srcptr+=1
+ in_comment = 1
+ continue
+ if c=='/' and line[srcptr]=='/' :
+ break
+ content += c
+ content = content.strip()
+ if len(content)>0:
+ if content.startswith('#include'):
+ name = content[8:]
+ name = name.replace('"','')
+ fullname = file_exists(root, name, folder,deps_include_dirs)
+ if fullname in deps_files_included:
+ continue
+ if fullname!='':
+ deps_files_included.append(fullname)
+ add_c_if_exists(root, fullname.replace('.h','.c'))
+ add_rest_if_exists(root, fullname,folder)
+ newfolder = fullname.rsplit('/', 1)[0] + '/'
+ parse_file_for_deps(root, fullname, newfolder)
+ continue
+ fp.close()
+ return 0
+
+def parse_file(root, srcfile, folder):
+ try:
+ fp = open(root + srcfile, 'rb')
+ except IOError:
+ return 1
+ in_comment = 0
+ linenum = 0
+ for line in fp.readlines():
+ content = ''
+ linenum+=1
+ srcptr = 0
+ while srcptr < len(line):
+ c = line[srcptr]
+ srcptr+=1
+ if c==13 or c==10:
+ if c==13 and line[srcptr]==10:
+ srcptr+=1
+ continue
+ if c==' ' or c==9:
+ continue
+ if in_comment==1 and c=='*' and line[srcptr]=='/' :
+ srcptr+=1
+ in_comment = 0
+ continue
+ if in_comment:
+ continue
+ if c=='/' and line[srcptr]=='*' :
+ srcptr+=1
+ in_comment = 1
+ continue
+ if c=='/' and line[srcptr]=='/' :
+ break
+ content += c
+ content = content.strip()
+ if len(content)>0:
+ if content.startswith('#include'):
+ name = content[8:]
+ name = name.replace('"','')
+ fullname = file_exists(root, name, folder,include_dirs)
+ if fullname in files_included:
+ continue
+ if "src/emu/netlist/" in fullname:
+ continue
+ if fullname!='':
+ if fullname in mappings.keys():
+ if not(mappings[fullname] in components):
+ components.append(mappings[fullname])
+ files_included.append(fullname)
+ newfolder = fullname.rsplit('/', 1)[0] + '/'
+ parse_file(root, fullname, newfolder)
+ if (fullname.endswith('.h')):
+ parse_file(root, fullname.replace('.h','.c'), newfolder)
+ continue
+ fp.close()
+ return 0
+
+def parse_file_for_drivers(root, srcfile):
+ try:
+ fp = open(root + srcfile, 'rb')
+ except IOError:
+ sys.stderr.write("Unable to open source file '%s'\n" % srcfile)
+ return 1
+ in_comment = 0
+ linenum = 0
+ for line in fp.readlines():
+ content = ''
+ linenum+=1
+ srcptr = 0
+ while srcptr < len(line):
+ c = line[srcptr]
+ srcptr+=1
+ if c==13 or c==10:
+ if c==13 and line[srcptr]==10:
+ srcptr+=1
+ continue
+ if c==' ' or c==9:
+ continue
+ if in_comment==1 and c=='*' and line[srcptr]=='/' :
+ srcptr+=1
+ in_comment = 0
+ continue
+ if in_comment:
+ continue
+ if c=='/' and line[srcptr]=='*' :
+ srcptr+=1
+ in_comment = 1
+ continue
+ if c=='/' and line[srcptr]=='/' :
+ break
+ content += c
+ content = content.strip()
+ if len(content)>0:
+ if content.startswith('COMP') or content.startswith('CONS') or content.startswith('GAME') or content.startswith('SYST') or content.startswith('GAMEL'):
+ name = content[4:]
+ drivers.append(name.rsplit(',', 14)[1])
+ return 0
+
+def parse_lua_file(srcfile):
+ try:
+ fp = open(srcfile, 'rb')
+ except IOError:
+ sys.stderr.write("Unable to open source file '%s'\n" % srcfile)
+ return 1
+ for line in fp.readlines():
+ content = line.strip()
+ if len(content)>0:
+ if content.startswith('--@'):
+ name = content[3:]
+ mappings[name.rsplit(',', 1)[0]] = name.rsplit(',', 1)[1]
+ return 0
+
+if len(sys.argv) < 5:
+ print('Usage:')
+ print(' makedep <root> <source.c> <type> <target>')
+ sys.exit(0)
+
+root = sys.argv[1] + '/'
+
+parse_lua_file(root +'scripts/src/bus.lua')
+parse_lua_file(root +'scripts/src/cpu.lua')
+parse_lua_file(root +'scripts/src/machine.lua')
+parse_lua_file(root +'scripts/src/sound.lua')
+parse_lua_file(root +'scripts/src/video.lua')
+
+for filename in sys.argv[2].rsplit(',') :
+ deps_files_included.append(filename.replace('\\','/'))
+ parse_file_for_deps(root,filename,'')
+
+for filename in deps_files_included:
+ parse_file(root,filename,'')
+
+for filename in sys.argv[2].rsplit(',') :
+ parse_file_for_drivers(root,filename)
+
+
+# display output
+if sys.argv[3]=='drivers':
+ # add a reference to the ___empty driver
+ drivers.append("___empty")
+
+ # start with a header
+ print('#include "emu.h"\n')
+ print('#include "drivenum.h"\n')
+
+ #output the list of externs first
+ for drv in sorted(drivers):
+ print("GAME_EXTERN(%s);" % drv)
+ print("")
+
+ # then output the array
+ print("const game_driver * const driver_list::s_drivers_sorted[%d] =" % len(drivers))
+ print("{")
+ for drv in sorted(drivers):
+ print("\t&GAME_NAME(%s)," % drv)
+ print("};")
+ print("")
+
+ # also output a global count
+ print("int driver_list::s_driver_count = %d;\n" % len(drivers))
+
+if sys.argv[3]=='target':
+ for line in components:
+ sys.stdout.write("%s\n" % line)
+ sys.stdout.write('\n')
+ sys.stdout.write('function createProjects_mame_%s(_target, _subtarget)\n' % sys.argv[4])
+ sys.stdout.write(' project ("mame_%s")\n' % sys.argv[4])
+ sys.stdout.write(' targetsubdir(_target .."_" .. _subtarget)\n')
+ sys.stdout.write(' kind (LIBTYPE)\n')
+ sys.stdout.write(' uuid (os.uuid("drv-mame-%s"))\n' % sys.argv[4])
+ sys.stdout.write(' \n')
+ sys.stdout.write(' options {\n')
+ sys.stdout.write(' "ForceCPP",\n')
+ sys.stdout.write(' }\n')
+ sys.stdout.write(' \n')
+ sys.stdout.write(' includedirs {\n')
+ sys.stdout.write(' MAME_DIR .. "src/osd",\n')
+ sys.stdout.write(' MAME_DIR .. "src/emu",\n')
+ sys.stdout.write(' MAME_DIR .. "src/mame",\n')
+ sys.stdout.write(' MAME_DIR .. "src/mess",\n')
+ sys.stdout.write(' MAME_DIR .. "src/lib",\n')
+ sys.stdout.write(' MAME_DIR .. "src/lib/util",\n')
+ sys.stdout.write(' MAME_DIR .. "3rdparty",\n')
+ sys.stdout.write(' GEN_DIR .. "mame/layout",\n')
+ sys.stdout.write(' GEN_DIR .. "mess/layout",\n')
+ sys.stdout.write(' }\n')
+ sys.stdout.write(' if _OPTIONS["with-bundled-zlib"] then\n')
+ sys.stdout.write(' includedirs {\n')
+ sys.stdout.write(' MAME_DIR .. "3rdparty/zlib",\n')
+ sys.stdout.write(' }\n')
+ sys.stdout.write(' end\n')
+ sys.stdout.write('\n')
+ sys.stdout.write(' files{\n')
+ for line in deps_files_included:
+ sys.stdout.write(' MAME_DIR .. "%s",\n' % line)
+ sys.stdout.write(' }\n')
+ sys.stdout.write('end\n')
+ sys.stdout.write('\n')
+ sys.stdout.write('function linkProjects_mame_%s(_target, _subtarget)\n' % sys.argv[4])
+ sys.stdout.write(' links {\n')
+ sys.stdout.write(' "mame_%s",\n' % sys.argv[4])
+ sys.stdout.write(' }\n')
+ sys.stdout.write('end\n')
diff --git a/src/build/makelist.py b/src/build/makelist.py
index eeaac070427..1f94814bf88 100644
--- a/src/build/makelist.py
+++ b/src/build/makelist.py
@@ -28,7 +28,7 @@ def parse_file(srcfile):
if c==13 and line[srcptr]==10:
srcptr+=1
continue
- if c==' ':
+ if c==' ' or c==9:
continue
if in_comment==1 and c=='*' and line[srcptr]=='/' :
srcptr+=1
diff --git a/src/build/png.py b/src/build/png.py
index f10210ed08d..f096a1dbdf5 100644
--- a/src/build/png.py
+++ b/src/build/png.py
@@ -325,7 +325,7 @@ def check_color(c, greyscale, which):
return c
if greyscale:
try:
- l = len(c)
+ len(c)
except TypeError:
c = (c,)
if len(c) != 1:
@@ -376,7 +376,10 @@ class Writer:
planes=None,
colormap=None,
maxval=None,
- chunk_limit=2**20):
+ chunk_limit=2**20,
+ x_pixels_per_unit = None,
+ y_pixels_per_unit = None,
+ unit_is_meter = False):
"""
Create a PNG encoder object.
@@ -407,6 +410,13 @@ class Writer:
Create an interlaced image.
chunk_limit
Write multiple ``IDAT`` chunks to save memory.
+ x_pixels_per_unit (pHYs chunk)
+ Number of pixels a unit along the x axis
+ y_pixels_per_unit (pHYs chunk)
+ Number of pixels a unit along the y axis
+ With x_pixel_unit, give the pixel size ratio
+ unit_is_meter (pHYs chunk)
+ Indicates if unit is meter or not
The image size (in pixels) can be specified either by using the
`width` and `height` arguments, or with the single `size`
@@ -527,10 +537,11 @@ class Writer:
bitdepth = int(8*bytes_per_sample)
del bytes_per_sample
if not isinteger(bitdepth) or bitdepth < 1 or 16 < bitdepth:
- raise ValueError("bitdepth (%r) must be a postive integer <= 16" %
+ raise ValueError("bitdepth (%r) must be a positive integer <= 16" %
bitdepth)
self.rescale = None
+ palette = check_palette(palette)
if palette:
if bitdepth not in (1,2,4,8):
raise ValueError("with palette, bitdepth must be 1, 2, 4, or 8")
@@ -588,7 +599,10 @@ class Writer:
self.compression = compression
self.chunk_limit = chunk_limit
self.interlace = bool(interlace)
- self.palette = check_palette(palette)
+ self.palette = palette
+ self.x_pixels_per_unit = x_pixels_per_unit
+ self.y_pixels_per_unit = y_pixels_per_unit
+ self.unit_is_meter = bool(unit_is_meter)
self.color_type = 4*self.alpha + 2*(not greyscale) + 1*self.colormap
assert self.color_type in (0,2,3,4,6)
@@ -637,12 +651,12 @@ class Writer:
fmt = 'BH'[self.bitdepth > 8]
a = array(fmt, itertools.chain(*rows))
return self.write_array(outfile, a)
- else:
- nrows = self.write_passes(outfile, rows)
- if nrows != self.height:
- raise ValueError(
- "rows supplied (%d) does not match height (%d)" %
- (nrows, self.height))
+
+ nrows = self.write_passes(outfile, rows)
+ if nrows != self.height:
+ raise ValueError(
+ "rows supplied (%d) does not match height (%d)" %
+ (nrows, self.height))
def write_passes(self, outfile, rows, packed=False):
"""
@@ -715,6 +729,11 @@ class Writer:
write_chunk(outfile, 'bKGD',
struct.pack("!3H", *self.background))
+ # http://www.w3.org/TR/PNG/#11pHYs
+ if self.x_pixels_per_unit is not None and self.y_pixels_per_unit is not None:
+ tup = (self.x_pixels_per_unit, self.y_pixels_per_unit, int(self.unit_is_meter))
+ write_chunk(outfile, 'pHYs', struct.pack("!LLB",*tup))
+
# http://www.w3.org/TR/PNG/#11IDAT
if self.compression is not None:
compressor = zlib.compressobj(self.compression)
@@ -1030,9 +1049,12 @@ def filter_scanline(type, line, fo, prev=None):
pa = abs(p - a)
pb = abs(p - b)
pc = abs(p - c)
- if pa <= pb and pa <= pc: Pr = a
- elif pb <= pc: Pr = b
- else: Pr = c
+ if pa <= pb and pa <= pc:
+ Pr = a
+ elif pb <= pc:
+ Pr = b
+ else:
+ Pr = c
x = (x - Pr) & 0xff
out.append(x)
@@ -1413,7 +1435,7 @@ class Reader:
% (type, length))
checksum = self.file.read(4)
if len(checksum) != 4:
- raise ValueError('Chunk %s too short for checksum.', tag)
+ raise ChunkError('Chunk %s too short for checksum.' % type)
if seek and type != seek:
continue
verify = zlib.crc32(strtobytes(type))
@@ -1747,7 +1769,7 @@ class Reader:
def process_chunk(self, lenient=False):
"""Process the next chunk and its data. This only processes the
following chunk types, all others are ignored: ``IHDR``,
- ``PLTE``, ``bKGD``, ``tRNS``, ``gAMA``, ``sBIT``.
+ ``PLTE``, ``bKGD``, ``tRNS``, ``gAMA``, ``sBIT``, ``pHYs``.
If the optional `lenient` argument evaluates to True,
checksum failures will raise warnings rather than exceptions.
@@ -1866,6 +1888,15 @@ class Reader:
not self.colormap and len(data) != self.planes):
raise FormatError("sBIT chunk has incorrect length.")
+ def _process_pHYs(self, data):
+ # http://www.w3.org/TR/PNG/#11pHYs
+ self.phys = data
+ fmt = "!LLB"
+ if len(data) != struct.calcsize(fmt):
+ raise FormatError("pHYs chunk has incorrect length.")
+ self.x_pixels_per_unit, self.y_pixels_per_unit, unit = struct.unpack(fmt,data)
+ self.unit_is_meter = bool(unit)
+
def read(self, lenient=False):
"""
Read the PNG file and decode it. Returns (`width`, `height`,
@@ -1902,8 +1933,8 @@ class Reader:
be an iterator that yields the ``IDAT`` chunk data.
"""
- # Currently, with no max_length paramter to decompress, this
- # routine will do one yield per IDAT chunk. So not very
+ # Currently, with no max_length parameter to decompress,
+ # this routine will do one yield per IDAT chunk: Not very
# incremental.
d = zlib.decompressobj()
# Each IDAT chunk is passed to the decompressor, then any
@@ -2590,7 +2621,7 @@ def write_pnm(file, width, height, pixels, meta):
else:
# PPM
fmt = 'P6'
- file.write('%s %d %d %d\n' % (fmt, width, height, maxval))
+ header = '%s %d %d %d\n' % (fmt, width, height, maxval)
if planes in (2,4):
# PAM
# See http://netpbm.sourceforge.net/doc/pam.html
@@ -2598,9 +2629,10 @@ def write_pnm(file, width, height, pixels, meta):
tupltype = 'GRAYSCALE_ALPHA'
else:
tupltype = 'RGB_ALPHA'
- file.write('P7\nWIDTH %d\nHEIGHT %d\nDEPTH %d\nMAXVAL %d\n'
- 'TUPLTYPE %s\nENDHDR\n' %
- (width, height, planes, maxval, tupltype))
+ header = ('P7\nWIDTH %d\nHEIGHT %d\nDEPTH %d\nMAXVAL %d\n'
+ 'TUPLTYPE %s\nENDHDR\n' %
+ (width, height, planes, maxval, tupltype))
+ file.write(header.encode('ascii'))
# Values per row
vpr = planes * width
# struct format
diff --git a/src/emu/bus/a2bus/corvfdc01.c b/src/emu/bus/a2bus/corvfdc01.c
index 335774af6ae..fc1adf2e269 100644
--- a/src/emu/bus/a2bus/corvfdc01.c
+++ b/src/emu/bus/a2bus/corvfdc01.c
@@ -35,7 +35,7 @@ static SLOT_INTERFACE_START( corv_floppies )
SLOT_INTERFACE_END
MACHINE_CONFIG_FRAGMENT( fdc01 )
- MCFG_FD1793x_ADD(FDC01_FDC_TAG, XTAL_16MHz / 8)
+ MCFG_FD1793_ADD(FDC01_FDC_TAG, XTAL_16MHz / 8)
MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(a2bus_corvfdc01_device, intrq_w))
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(a2bus_corvfdc01_device, drq_w))
MCFG_FLOPPY_DRIVE_ADD(FDC01_FDC_TAG":0", corv_floppies, "8sssd", a2bus_corvfdc01_device::corv_floppy_formats)
diff --git a/src/emu/bus/a2bus/corvfdc02.c b/src/emu/bus/a2bus/corvfdc02.c
index 38669039137..eaad8725d1f 100644
--- a/src/emu/bus/a2bus/corvfdc02.c
+++ b/src/emu/bus/a2bus/corvfdc02.c
@@ -221,7 +221,7 @@ void a2bus_corvfdc02_device::write_c0nx(address_space &space, UINT8 offset, UINT
break;
}
- logerror("corvfdc02: selecting drive %d: %p\n", data & 3, floppy);
+ logerror("corvfdc02: selecting drive %d: %p\n", data & 3, (void *) floppy);
if (floppy != m_curfloppy)
{
diff --git a/src/emu/bus/a7800/a78_slot.c b/src/emu/bus/a7800/a78_slot.c
index e7f6da4f6cb..6332492a6c2 100644
--- a/src/emu/bus/a7800/a78_slot.c
+++ b/src/emu/bus/a7800/a78_slot.c
@@ -488,7 +488,7 @@ void a78_partialhash(hash_collection &dest, const unsigned char *data,
void a78_cart_slot_device::call_unload()
{
- if (m_cart && m_cart->get_nvram_size())
+ if (m_cart && m_cart->get_nvram_base() && m_cart->get_nvram_size())
battery_save(m_cart->get_nvram_base(), 0x800);
}
diff --git a/src/emu/bus/abcbus/fd2.c b/src/emu/bus/abcbus/fd2.c
index 73ddeba54df..7faeefb97c4 100644
--- a/src/emu/bus/abcbus/fd2.c
+++ b/src/emu/bus/abcbus/fd2.c
@@ -246,7 +246,7 @@ static MACHINE_CONFIG_FRAGMENT( abc_fd2 )
MCFG_Z80PIO_IN_PB_CB(READ8(abc_fd2_t, pio_pb_r))
MCFG_Z80PIO_OUT_PB_CB(WRITE8(abc_fd2_t, pio_pb_w))
- MCFG_FD1771x_ADD(FD1771_TAG, XTAL_4MHz/4)
+ MCFG_FD1771_ADD(FD1771_TAG, XTAL_4MHz/4)
MCFG_WD_FDC_INTRQ_CALLBACK(DEVWRITELINE(Z80PIO_TAG, z80pio_device, pb7_w))
MCFG_WD_FDC_DRQ_CALLBACK(DEVWRITELINE(Z80PIO_TAG, z80pio_device, pb5_w))
MCFG_WD_FDC_HLD_CALLBACK(DEVWRITELINE(Z80PIO_TAG, z80pio_device, pb6_w))
diff --git a/src/emu/bus/abcbus/lux10828.c b/src/emu/bus/abcbus/lux10828.c
index f809d8fe13d..705a9e8035b 100644
--- a/src/emu/bus/abcbus/lux10828.c
+++ b/src/emu/bus/abcbus/lux10828.c
@@ -338,7 +338,7 @@ static MACHINE_CONFIG_FRAGMENT( luxor_55_10828 )
MCFG_Z80PIO_IN_PB_CB(READ8(luxor_55_10828_device, pio_pb_r))
MCFG_Z80PIO_OUT_PB_CB(WRITE8(luxor_55_10828_device, pio_pb_w))
- MCFG_MB8876x_ADD(MB8876_TAG, XTAL_4MHz/2)
+ MCFG_MB8876_ADD(MB8876_TAG, XTAL_4MHz/2)
MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(luxor_55_10828_device, fdc_intrq_w))
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(luxor_55_10828_device, fdc_drq_w))
diff --git a/src/emu/bus/abcbus/lux21046.c b/src/emu/bus/abcbus/lux21046.c
index e5cd3b001b6..67396d81139 100644
--- a/src/emu/bus/abcbus/lux21046.c
+++ b/src/emu/bus/abcbus/lux21046.c
@@ -298,7 +298,7 @@ static MACHINE_CONFIG_FRAGMENT( luxor_55_21046 )
MCFG_Z80DMA_IN_IORQ_CB(READ8(luxor_55_21046_device, io_read_byte))
MCFG_Z80DMA_OUT_IORQ_CB(WRITE8(luxor_55_21046_device, io_write_byte))
- MCFG_FD1793x_ADD(SAB1793_TAG, XTAL_16MHz/16)
+ MCFG_FD1793_ADD(SAB1793_TAG, XTAL_16MHz/16)
MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(luxor_55_21046_device, fdc_intrq_w))
MCFG_WD_FDC_DRQ_CALLBACK(DEVWRITELINE(Z80DMA_TAG, z80dma_device, rdy_w))
MACHINE_CONFIG_END
diff --git a/src/emu/bus/adamnet/fdc.c b/src/emu/bus/adamnet/fdc.c
index f915c227f03..afe93d74a29 100644
--- a/src/emu/bus/adamnet/fdc.c
+++ b/src/emu/bus/adamnet/fdc.c
@@ -128,7 +128,7 @@ static MACHINE_CONFIG_FRAGMENT( adam_fdc )
MCFG_CPU_PROGRAM_MAP(adam_fdc_mem)
MCFG_CPU_IO_MAP(adam_fdc_io)
- MCFG_WD2793x_ADD(WD2793_TAG, XTAL_4MHz/4)
+ MCFG_WD2793_ADD(WD2793_TAG, XTAL_4MHz/4)
MCFG_WD_FDC_INTRQ_CALLBACK(INPUTLINE(M6801_TAG, INPUT_LINE_NMI))
MCFG_FLOPPY_DRIVE_ADD(WD2793_TAG":0", adam_fdc_floppies, "525ssdd", adam_fdc_device::floppy_formats)
diff --git a/src/emu/bus/apricot/cards.c b/src/emu/bus/apricot/cards.c
new file mode 100644
index 00000000000..9a97adffca6
--- /dev/null
+++ b/src/emu/bus/apricot/cards.c
@@ -0,0 +1,15 @@
+// license:GPL-2.0+
+// copyright-holders:Dirk Best
+/***************************************************************************
+
+ ACT Apricot Expansion Slot Devices
+
+***************************************************************************/
+
+#include "cards.h"
+
+SLOT_INTERFACE_START( apricot_expansion_cards )
+ SLOT_INTERFACE("128k", APRICOT_128K_RAM)
+ SLOT_INTERFACE("256k", APRICOT_256K_RAM)
+ SLOT_INTERFACE("512k", APRICOT_512K_RAM)
+SLOT_INTERFACE_END
diff --git a/src/emu/bus/apricot/cards.h b/src/emu/bus/apricot/cards.h
new file mode 100644
index 00000000000..67766d51a8e
--- /dev/null
+++ b/src/emu/bus/apricot/cards.h
@@ -0,0 +1,19 @@
+// license:GPL-2.0+
+// copyright-holders:Dirk Best
+/***************************************************************************
+
+ ACT Apricot Expansion Slot Devices
+
+***************************************************************************/
+
+#pragma once
+
+#ifndef __APRICOT_CARDS_H__
+#define __APRICOT_CARDS_H__
+
+#include "emu.h"
+#include "ram.h"
+
+SLOT_INTERFACE_EXTERN( apricot_expansion_cards );
+
+#endif // __APRICOT_CARDS_H__
diff --git a/src/emu/bus/apricot/expansion.c b/src/emu/bus/apricot/expansion.c
new file mode 100644
index 00000000000..7fe2b2a721c
--- /dev/null
+++ b/src/emu/bus/apricot/expansion.c
@@ -0,0 +1,192 @@
+// license:GPL-2.0+
+// copyright-holders:Dirk Best
+/***************************************************************************
+
+ ACT Apricot Expansion Slot
+
+***************************************************************************/
+
+#include "expansion.h"
+
+
+//**************************************************************************
+// EXPANSION SLOT DEVICE
+//**************************************************************************
+
+const device_type APRICOT_EXPANSION_SLOT = &device_creator<apricot_expansion_slot_device>;
+
+//-------------------------------------------------
+// apricot_expansion_slot_device - constructor
+//-------------------------------------------------
+
+apricot_expansion_slot_device::apricot_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ device_t(mconfig, APRICOT_EXPANSION_SLOT, "Apricot Expansion Slot", tag, owner, clock, "apricot_exp_slot", __FILE__),
+ device_slot_interface(mconfig, *this)
+{
+}
+
+apricot_expansion_slot_device::apricot_expansion_slot_device(const machine_config &mconfig, device_type type, const char *name,
+ const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
+ device_t(mconfig, type, name, tag, owner, clock, shortname, source),
+ device_slot_interface(mconfig, *this)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void apricot_expansion_slot_device::device_start()
+{
+ device_apricot_expansion_card_interface *dev = dynamic_cast<device_apricot_expansion_card_interface *>(get_card_device());
+
+ if (dev)
+ {
+ apricot_expansion_bus_device *bus = downcast<apricot_expansion_bus_device *>(m_owner);
+ bus->add_card(dev);
+ }
+}
+
+
+//**************************************************************************
+// EXPANSION BUS DEVICE
+//**************************************************************************
+
+const device_type APRICOT_EXPANSION_BUS = &device_creator<apricot_expansion_bus_device>;
+
+//-------------------------------------------------
+// apricot_expansion_bus_device - constructor
+//-------------------------------------------------
+
+apricot_expansion_bus_device::apricot_expansion_bus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ device_t(mconfig, APRICOT_EXPANSION_BUS, "Apricot Expansion Bus", tag, owner, clock, "apricot_exp_bus", __FILE__),
+ m_program(NULL),
+ m_io(NULL),
+ m_program_iop(NULL),
+ m_io_iop(NULL),
+ m_dma1_handler(*this),
+ m_dma2_handler(*this),
+ m_ext1_handler(*this),
+ m_ext2_handler(*this),
+ m_int2_handler(*this),
+ m_int3_handler(*this)
+{
+}
+
+//-------------------------------------------------
+// apricot_expansion_bus_device - destructor
+//-------------------------------------------------
+
+apricot_expansion_bus_device::~apricot_expansion_bus_device()
+{
+ m_dev.detach_all();
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void apricot_expansion_bus_device::device_start()
+{
+ // resolve callbacks
+ m_dma1_handler.resolve_safe();
+ m_dma2_handler.resolve_safe();
+ m_ext1_handler.resolve_safe();
+ m_ext2_handler.resolve_safe();
+ m_int2_handler.resolve_safe();
+ m_int3_handler.resolve_safe();
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void apricot_expansion_bus_device::device_reset()
+{
+ cpu_device *cpu = m_owner->subdevice<cpu_device>(m_cpu_tag);
+ m_program = &cpu->space(AS_PROGRAM);
+ m_io = &cpu->space(AS_IO);
+
+ cpu_device *iop = m_owner->subdevice<cpu_device>(m_iop_tag);
+ m_program_iop = &iop->space(AS_PROGRAM);
+ m_io_iop = &iop->space(AS_IO);
+}
+
+//-------------------------------------------------
+// add_card - add new card to our bus
+//-------------------------------------------------
+
+void apricot_expansion_bus_device::add_card(device_apricot_expansion_card_interface *card)
+{
+ card->set_bus_device(this);
+ m_dev.append(*card);
+}
+
+//-------------------------------------------------
+// set_cpu_tag - set cpu we are attached to
+//-------------------------------------------------
+
+void apricot_expansion_bus_device::set_cpu_tag(device_t &device, device_t *owner, const char *tag)
+{
+ apricot_expansion_bus_device &bus = dynamic_cast<apricot_expansion_bus_device &>(device);
+ bus.m_cpu_tag = tag;
+}
+
+//-------------------------------------------------
+// set_iop_tag - set iop we are attached to
+//-------------------------------------------------
+
+void apricot_expansion_bus_device::set_iop_tag(device_t &device, device_t *owner, const char *tag)
+{
+ apricot_expansion_bus_device &bus = dynamic_cast<apricot_expansion_bus_device &>(device);
+ bus.m_iop_tag = tag;
+}
+
+// callbacks from slot device to the host
+WRITE_LINE_MEMBER( apricot_expansion_bus_device::dma1_w ) { m_dma1_handler(state); }
+WRITE_LINE_MEMBER( apricot_expansion_bus_device::dma2_w ) { m_dma2_handler(state); }
+WRITE_LINE_MEMBER( apricot_expansion_bus_device::ext1_w ) { m_ext1_handler(state); }
+WRITE_LINE_MEMBER( apricot_expansion_bus_device::ext2_w ) { m_ext2_handler(state); }
+WRITE_LINE_MEMBER( apricot_expansion_bus_device::int2_w ) { m_int2_handler(state); }
+WRITE_LINE_MEMBER( apricot_expansion_bus_device::int3_w ) { m_int3_handler(state); }
+
+//-------------------------------------------------
+// install_ram - attach ram to cpu/iop
+//-------------------------------------------------
+
+void apricot_expansion_bus_device::install_ram(offs_t addrstart, offs_t addrend, void *baseptr)
+{
+ m_program->install_ram(addrstart, addrend, baseptr);
+
+ if (m_program_iop)
+ m_program_iop->install_ram(addrstart, addrend, baseptr);
+}
+
+
+//**************************************************************************
+// CARTRIDGE INTERFACE
+//**************************************************************************
+
+//-------------------------------------------------
+// device_apricot_expansion_card_interface - constructor
+//-------------------------------------------------
+
+device_apricot_expansion_card_interface::device_apricot_expansion_card_interface(const machine_config &mconfig, device_t &device) :
+ device_slot_card_interface(mconfig, device),
+ m_next(NULL),
+ m_bus(NULL)
+{
+}
+
+//-------------------------------------------------
+// ~device_apricot_expansion_card_interface - destructor
+//-------------------------------------------------
+
+device_apricot_expansion_card_interface::~device_apricot_expansion_card_interface()
+{
+}
+
+void device_apricot_expansion_card_interface::set_bus_device(apricot_expansion_bus_device *bus)
+{
+ m_bus = bus;
+}
diff --git a/src/emu/bus/apricot/expansion.h b/src/emu/bus/apricot/expansion.h
new file mode 100644
index 00000000000..38687db4399
--- /dev/null
+++ b/src/emu/bus/apricot/expansion.h
@@ -0,0 +1,208 @@
+// license:GPL-2.0+
+// copyright-holders:Dirk Best
+/***************************************************************************
+
+ ACT Apricot Expansion Slot
+
+ A B
+
+ -12V 32 +12V
+ +5V 31 +5V
+ DB0 30 DB1
+ DB2 29 DB3
+ DB4 28 DB5
+ DB6 27 DB7
+ AB10 26 AB9
+ AB11 25 AB12
+ /AMWC 24 /MRDC
+ /DMA2 23 DT/R
+ /DMA1 22 /IORC
+ /MWTC 21 /RES
+ /IOWC 20 /AIOWC
+ GND 19 GND
+ /CLK5 18 DEN
+ /IRDY 17 /MRDY
+ /EXT1 16 /EXT2
+ /INT3 15 /ALE
+ AB6 14 /INT2
+ AB8 13 AB7
+ DB9 12 DB8
+ DB11 11 DB10
+ DB13 10 DB12
+ DB15 9 DB14
+ AB2 8 AB1
+ AB4 7 AB3
+ AB0 6 AB5
+ AB14 5 AB13
+ AB15 4 AB16
+ AB17 3 AB18
+ AB19 2 /BHE
+ NMI 1 CLK15
+
+***************************************************************************/
+
+#pragma once
+
+#ifndef __APRICOT_EXPANSION_H__
+#define __APRICOT_EXPANSION_H__
+
+#include "emu.h"
+
+
+//**************************************************************************
+// INTERFACE CONFIGURATION MACROS
+//**************************************************************************
+
+#define MCFG_EXPANSION_ADD(_tag, _cpu_tag) \
+ MCFG_DEVICE_ADD(_tag, APRICOT_EXPANSION_BUS, 0) \
+ apricot_expansion_bus_device::set_cpu_tag(*device, owner, _cpu_tag);
+
+#define MCFG_EXPANSION_IOP_ADD(_tag) \
+ apricot_expansion_bus_device::set_iop_tag(*device, owner, _tag);
+
+#define MCFG_EXPANSION_SLOT_ADD(_tag, _slot_intf, _def_slot) \
+ MCFG_DEVICE_ADD(_tag, APRICOT_EXPANSION_SLOT, 0) \
+ MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
+
+#define MCFG_EXPANSION_DMA1_HANDLER(_devcb) \
+ devcb = &apricot_expansion_bus_device::set_dma1_handler(*device, DEVCB_##_devcb);
+
+#define MCFG_EXPANSION_DMA2_HANDLER(_devcb) \
+ devcb = &apricot_expansion_bus_device::set_dma2_handler(*device, DEVCB_##_devcb);
+
+#define MCFG_EXPANSION_EXT1_HANDLER(_devcb) \
+ devcb = &apricot_expansion_bus_device::set_ext1_handler(*device, DEVCB_##_devcb);
+
+#define MCFG_EXPANSION_EXT2_HANDLER(_devcb) \
+ devcb = &apricot_expansion_bus_device::set_ext2_handler(*device, DEVCB_##_devcb);
+
+#define MCFG_EXPANSION_INT2_HANDLER(_devcb) \
+ devcb = &apricot_expansion_bus_device::set_int2_handler(*device, DEVCB_##_devcb);
+
+#define MCFG_EXPANSION_INT3_HANDLER(_devcb) \
+ devcb = &apricot_expansion_bus_device::set_int3_handler(*device, DEVCB_##_devcb);
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// forward declaration
+class device_apricot_expansion_card_interface;
+
+
+// ======================> apricot_expansion_slot_device
+
+class apricot_expansion_slot_device : public device_t, public device_slot_interface
+{
+public:
+ // construction/destruction
+ apricot_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ apricot_expansion_slot_device(const machine_config &mconfig, device_type type, const char *name,
+ const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
+
+ // device-level overrides
+ virtual void device_start();
+};
+
+// device type definition
+extern const device_type APRICOT_EXPANSION_SLOT;
+
+
+// ======================> apricot_expansion_bus_device
+
+class apricot_expansion_bus_device : public device_t
+{
+public:
+ // construction/destruction
+ apricot_expansion_bus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ virtual ~apricot_expansion_bus_device();
+
+ template<class _Object> static devcb_base &set_dma1_handler(device_t &device, _Object object)
+ { return downcast<apricot_expansion_bus_device &>(device).m_dma1_handler.set_callback(object); }
+
+ template<class _Object> static devcb_base &set_dma2_handler(device_t &device, _Object object)
+ { return downcast<apricot_expansion_bus_device &>(device).m_dma2_handler.set_callback(object); }
+
+ template<class _Object> static devcb_base &set_ext1_handler(device_t &device, _Object object)
+ { return downcast<apricot_expansion_bus_device &>(device).m_ext1_handler.set_callback(object); }
+
+ template<class _Object> static devcb_base &set_ext2_handler(device_t &device, _Object object)
+ { return downcast<apricot_expansion_bus_device &>(device).m_ext2_handler.set_callback(object); }
+
+ template<class _Object> static devcb_base &set_int2_handler(device_t &device, _Object object)
+ { return downcast<apricot_expansion_bus_device &>(device).m_int2_handler.set_callback(object); }
+
+ template<class _Object> static devcb_base &set_int3_handler(device_t &device, _Object object)
+ { return downcast<apricot_expansion_bus_device &>(device).m_int3_handler.set_callback(object); }
+
+ // inline configuration
+ static void set_cpu_tag(device_t &device, device_t *owner, const char *tag);
+ static void set_iop_tag(device_t &device, device_t *owner, const char *tag);
+
+ void add_card(device_apricot_expansion_card_interface *card);
+
+ // from cards
+ DECLARE_WRITE_LINE_MEMBER( dma1_w );
+ DECLARE_WRITE_LINE_MEMBER( dma2_w );
+ DECLARE_WRITE_LINE_MEMBER( ext1_w );
+ DECLARE_WRITE_LINE_MEMBER( ext2_w );
+ DECLARE_WRITE_LINE_MEMBER( int2_w );
+ DECLARE_WRITE_LINE_MEMBER( int3_w );
+
+ void install_ram(offs_t addrstart, offs_t addrend, void *baseptr);
+
+protected:
+ // device-level overrides
+ virtual void device_start();
+ virtual void device_reset();
+
+private:
+ simple_list<device_apricot_expansion_card_interface> m_dev;
+
+ // address spaces we have access to
+ address_space *m_program;
+ address_space *m_io;
+ address_space *m_program_iop;
+ address_space *m_io_iop;
+
+ devcb_write_line m_dma1_handler;
+ devcb_write_line m_dma2_handler;
+ devcb_write_line m_ext1_handler;
+ devcb_write_line m_ext2_handler;
+ devcb_write_line m_int2_handler;
+ devcb_write_line m_int3_handler;
+
+ // configuration
+ const char *m_cpu_tag;
+ const char *m_iop_tag;
+};
+
+// device type definition
+extern const device_type APRICOT_EXPANSION_BUS;
+
+
+// ======================> device_apricot_expansion_card_interface
+
+class device_apricot_expansion_card_interface : public device_slot_card_interface
+{
+public:
+ // construction/destruction
+ device_apricot_expansion_card_interface(const machine_config &mconfig, device_t &device);
+ virtual ~device_apricot_expansion_card_interface();
+
+ void set_bus_device(apricot_expansion_bus_device *bus);
+
+ device_apricot_expansion_card_interface *next() const { return m_next; }
+ device_apricot_expansion_card_interface *m_next;
+
+protected:
+ apricot_expansion_bus_device *m_bus;
+};
+
+
+// include here so drivers don't need to
+#include "cards.h"
+
+
+#endif // __APRICOT_EXPANSION_H__
diff --git a/src/emu/bus/apricot/ram.c b/src/emu/bus/apricot/ram.c
new file mode 100644
index 00000000000..2221ae37227
--- /dev/null
+++ b/src/emu/bus/apricot/ram.c
@@ -0,0 +1,177 @@
+// license:GPL-2.0+
+// copyright-holders:Dirk Best
+/***************************************************************************
+
+ ACT Apricot RAM Expansions
+
+***************************************************************************/
+
+#include "ram.h"
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+const device_type APRICOT_256K_RAM = &device_creator<apricot_256k_ram_device>;
+const device_type APRICOT_128K_RAM = &device_creator<apricot_128k_ram_device>;
+const device_type APRICOT_512K_RAM = &device_creator<apricot_512k_ram_device>;
+
+
+//**************************************************************************
+// APRICOT 256K RAM DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// input_ports - device-specific input ports
+//-------------------------------------------------
+
+static INPUT_PORTS_START( apricot_256k )
+ PORT_START("sw")
+ PORT_DIPNAME(0x01, 0x00, "Base Address")
+ PORT_DIPSETTING(0x00, "40000H")
+ PORT_DIPSETTING(0x01, "80000H")
+INPUT_PORTS_END
+
+ioport_constructor apricot_256k_ram_device::device_input_ports() const
+{
+ return INPUT_PORTS_NAME( apricot_256k );
+}
+
+//-------------------------------------------------
+// apricot_256k_ram_device - constructor
+//-------------------------------------------------
+
+apricot_256k_ram_device::apricot_256k_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ device_t(mconfig, APRICOT_256K_RAM, "Apricot 256K RAM Expansion Board", tag, owner, clock, "apricot_256k_ram", __FILE__),
+ device_apricot_expansion_card_interface(mconfig, *this),
+ m_sw(*this, "sw")
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void apricot_256k_ram_device::device_start()
+{
+ m_ram.resize(0x40000 / 2);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void apricot_256k_ram_device::device_reset()
+{
+ if (m_sw->read() == 0)
+ m_bus->install_ram(0x40000, 0x7ffff, &m_ram[0]);
+ else
+ m_bus->install_ram(0x80000, 0xbffff, &m_ram[0]);
+}
+
+
+//**************************************************************************
+// APRICOT 128K RAM DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// input_ports - device-specific input ports
+//-------------------------------------------------
+
+static INPUT_PORTS_START( apricot_128k )
+ PORT_START("strap")
+ PORT_DIPNAME(0x03, 0x01, "Base Address")
+ PORT_DIPSETTING(0x00, "512K")
+ PORT_DIPSETTING(0x01, "256K - 384K")
+ PORT_DIPSETTING(0x02, "384K - 512K")
+INPUT_PORTS_END
+
+ioport_constructor apricot_128k_ram_device::device_input_ports() const
+{
+ return INPUT_PORTS_NAME( apricot_128k );
+}
+
+//-------------------------------------------------
+// apricot_128_512k_ram_device - constructor
+//-------------------------------------------------
+
+apricot_128k_ram_device::apricot_128k_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ device_t(mconfig, APRICOT_128K_RAM, "Apricot 128/512K RAM Expansion Board (128K)", tag, owner, clock, "apricot_128k_ram", __FILE__),
+ device_apricot_expansion_card_interface(mconfig, *this),
+ m_strap(*this, "strap")
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void apricot_128k_ram_device::device_start()
+{
+ m_ram.resize(0x20000 / 2);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void apricot_128k_ram_device::device_reset()
+{
+ if (m_strap->read() == 1)
+ m_bus->install_ram(0x40000, 0x5ffff, &m_ram[0]);
+ else if (m_strap->read() == 2)
+ m_bus->install_ram(0x60000, 0x7ffff, &m_ram[0]);
+}
+
+
+//**************************************************************************
+// APRICOT 512K RAM DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// input_ports - device-specific input ports
+//-------------------------------------------------
+
+static INPUT_PORTS_START( apricot_512k )
+ PORT_START("strap")
+ PORT_DIPNAME(0x03, 0x00, "Base Address")
+ PORT_DIPSETTING(0x00, "512K")
+ PORT_DIPSETTING(0x01, "256K - 384K")
+ PORT_DIPSETTING(0x02, "384K - 512K")
+INPUT_PORTS_END
+
+ioport_constructor apricot_512k_ram_device::device_input_ports() const
+{
+ return INPUT_PORTS_NAME( apricot_512k );
+}
+
+//-------------------------------------------------
+// apricot_128_512k_ram_device - constructor
+//-------------------------------------------------
+
+apricot_512k_ram_device::apricot_512k_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ device_t(mconfig, APRICOT_512K_RAM, "Apricot 128/512K RAM Expansion Board (512K)", tag, owner, clock, "apricot_512k_ram", __FILE__),
+ device_apricot_expansion_card_interface(mconfig, *this),
+ m_strap(*this, "strap")
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void apricot_512k_ram_device::device_start()
+{
+ m_ram.resize(0x80000 / 2);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void apricot_512k_ram_device::device_reset()
+{
+ if (m_strap->read() == 0)
+ m_bus->install_ram(0x40000, 0xbffff, &m_ram[0]);
+}
diff --git a/src/emu/bus/apricot/ram.h b/src/emu/bus/apricot/ram.h
new file mode 100644
index 00000000000..20ac01f2867
--- /dev/null
+++ b/src/emu/bus/apricot/ram.h
@@ -0,0 +1,89 @@
+// license:GPL-2.0+
+// copyright-holders:Dirk Best
+/***************************************************************************
+
+ ACT Apricot RAM Expansions
+
+***************************************************************************/
+
+#pragma once
+
+#ifndef __APRICOT_RAM__
+#define __APRICOT_RAM__
+
+#include "emu.h"
+#include "expansion.h"
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+
+// ======================> apricot_256k_ram_device
+
+class apricot_256k_ram_device : public device_t, public device_apricot_expansion_card_interface
+{
+public:
+ // construction/destruction
+ apricot_256k_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+protected:
+ virtual ioport_constructor device_input_ports() const;
+ virtual void device_start();
+ virtual void device_reset();
+
+private:
+ required_ioport m_sw;
+
+ std::vector<UINT16> m_ram;
+};
+
+
+// ======================> apricot_128k_ram_device
+
+class apricot_128k_ram_device : public device_t, public device_apricot_expansion_card_interface
+{
+public:
+ // construction/destruction
+ apricot_128k_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+protected:
+ virtual ioport_constructor device_input_ports() const;
+ virtual void device_start();
+ virtual void device_reset();
+
+private:
+ required_ioport m_strap;
+
+ std::vector<UINT16> m_ram;
+};
+
+
+// ======================> apricot_512k_ram_device
+
+class apricot_512k_ram_device : public device_t, public device_apricot_expansion_card_interface
+{
+public:
+ // construction/destruction
+ apricot_512k_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+protected:
+ virtual ioport_constructor device_input_ports() const;
+ virtual void device_start();
+ virtual void device_reset();
+
+private:
+ required_ioport m_strap;
+
+ std::vector<UINT16> m_ram;
+};
+
+
+// device type definition
+extern const device_type APRICOT_256K_RAM;
+extern const device_type APRICOT_128K_RAM;
+extern const device_type APRICOT_512K_RAM;
+
+
+#endif // __APRICOT_RAM__
diff --git a/src/emu/bus/bml3/bml3mp1802.c b/src/emu/bus/bml3/bml3mp1802.c
index af061edbab9..64db414fa21 100644
--- a/src/emu/bus/bml3/bml3mp1802.c
+++ b/src/emu/bus/bml3/bml3mp1802.c
@@ -23,12 +23,9 @@
const device_type BML3BUS_MP1802 = &device_creator<bml3bus_mp1802_device>;
-static const floppy_interface bml3_mp1802_floppy_interface =
-{
- FLOPPY_STANDARD_5_25_DSDD,
- LEGACY_FLOPPY_OPTIONS_NAME(default),
- NULL
-};
+static SLOT_INTERFACE_START( mp1802_floppies )
+ SLOT_INTERFACE("dd", FLOPPY_525_DD)
+SLOT_INTERFACE_END
WRITE_LINE_MEMBER( bml3bus_mp1802_device::bml3_wd17xx_intrq_w )
{
@@ -46,11 +43,13 @@ ROM_START( mp1802 )
ROM_END
MACHINE_CONFIG_FRAGMENT( mp1802 )
- MCFG_DEVICE_ADD("wd17xx", MB8866, 0)
- MCFG_WD17XX_DEFAULT_DRIVE2_TAGS
- MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(bml3bus_mp1802_device, bml3_wd17xx_intrq_w))
+ MCFG_MB8866_ADD("fdc", XTAL_1MHz)
+ MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(bml3bus_mp1802_device, bml3_wd17xx_intrq_w))
- MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(bml3_mp1802_floppy_interface)
+ MCFG_FLOPPY_DRIVE_ADD("fdc:0", mp1802_floppies, "dd", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("fdc:1", mp1802_floppies, "dd", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("fdc:2", mp1802_floppies, "", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("fdc:3", mp1802_floppies, "", floppy_image_device::default_floppy_formats)
MACHINE_CONFIG_END
/***************************************************************************
@@ -78,34 +77,28 @@ const rom_entry *bml3bus_mp1802_device::device_rom_region() const
READ8_MEMBER( bml3bus_mp1802_device::bml3_mp1802_r)
{
- return m_wd17xx->drq_r() ? 0x00 : 0x80;
+ return m_fdc->drq_r() ? 0x00 : 0x80;
}
WRITE8_MEMBER( bml3bus_mp1802_device::bml3_mp1802_w)
{
- int drive = data & 0x03;
- int side = BIT(data, 4);
- int motor = BIT(data, 3);
- const char *floppy_name = NULL;
- switch (drive) {
- case 0:
- floppy_name = FLOPPY_0;
- break;
- case 1:
- floppy_name = FLOPPY_1;
- break;
- case 2:
- floppy_name = FLOPPY_2;
- break;
- case 3:
- floppy_name = FLOPPY_3;
- break;
+ floppy_image_device *floppy = NULL;
+
+ switch (data & 0x03)
+ {
+ case 0: floppy = m_floppy0->get_device(); break;
+ case 1: floppy = m_floppy1->get_device(); break;
+ case 2: floppy = m_floppy2->get_device(); break;
+ case 3: floppy = m_floppy3->get_device(); break;
+ }
+
+ m_fdc->set_floppy(floppy);
+
+ if (floppy)
+ {
+ floppy->mon_w(!BIT(data, 3));
+ floppy->ss_w(BIT(data, 4));
}
- legacy_floppy_image_device *floppy = subdevice<legacy_floppy_image_device>(floppy_name);
- m_wd17xx->set_drive(drive);
- floppy->floppy_mon_w(!motor);
- floppy->floppy_drive_set_ready_state(ASSERT_LINE, 0);
- m_wd17xx->set_side(side);
}
@@ -116,7 +109,11 @@ WRITE8_MEMBER( bml3bus_mp1802_device::bml3_mp1802_w)
bml3bus_mp1802_device::bml3bus_mp1802_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
device_t(mconfig, BML3BUS_MP1802, "Hitachi MP-1802 Floppy Controller Card", tag, owner, clock, "bml3mp1802", __FILE__),
device_bml3bus_card_interface(mconfig, *this),
- m_wd17xx(*this, "wd17xx")
+ m_fdc(*this, "fdc"),
+ m_floppy0(*this, "fdc:0"),
+ m_floppy1(*this, "fdc:1"),
+ m_floppy2(*this, "fdc:2"),
+ m_floppy3(*this, "fdc:3")
{
}
@@ -134,8 +131,8 @@ void bml3bus_mp1802_device::device_start()
// install into memory
address_space &space_prg = machine().firstcpu->space(AS_PROGRAM);
- space_prg.install_readwrite_handler(0xff00, 0xff03, read8_delegate(FUNC(mb8866_device::read),(mb8866_device*)m_wd17xx), write8_delegate(FUNC(mb8866_device::write),(mb8866_device*)m_wd17xx));
- space_prg.install_readwrite_handler(0xff04, 0xff04, read8_delegate(FUNC(bml3bus_mp1802_device::bml3_mp1802_r), this), write8_delegate(FUNC(bml3bus_mp1802_device::bml3_mp1802_w), this) );
+ space_prg.install_readwrite_handler(0xff00, 0xff03, read8_delegate(FUNC(mb8866_t::read),(mb8866_t*)m_fdc), write8_delegate(FUNC(mb8866_t::write),(mb8866_t*)m_fdc));
+ space_prg.install_readwrite_handler(0xff04, 0xff04, read8_delegate(FUNC(bml3bus_mp1802_device::bml3_mp1802_r), this), write8_delegate(FUNC(bml3bus_mp1802_device::bml3_mp1802_w), this));
// overwriting the main ROM (rather than using e.g. install_rom) should mean that bank switches for RAM expansion still work...
UINT8 *mainrom = device().machine().root_device().memregion("maincpu")->base();
memcpy(mainrom + 0xf800, m_rom + 0xf800, 0x800);
diff --git a/src/emu/bus/bml3/bml3mp1802.h b/src/emu/bus/bml3/bml3mp1802.h
index 6569171a199..0c4088c0d4f 100644
--- a/src/emu/bus/bml3/bml3mp1802.h
+++ b/src/emu/bus/bml3/bml3mp1802.h
@@ -15,7 +15,8 @@
#include "emu.h"
#include "bml3bus.h"
#include "imagedev/flopdrv.h"
-#include "machine/wd17xx.h"
+#include "machine/wd_fdc.h"
+
//**************************************************************************
// TYPE DEFINITIONS
@@ -36,13 +37,18 @@ public:
DECLARE_READ8_MEMBER(bml3_mp1802_r);
DECLARE_WRITE8_MEMBER(bml3_mp1802_w);
DECLARE_WRITE_LINE_MEMBER(bml3_wd17xx_intrq_w);
+
protected:
virtual void device_start();
virtual void device_reset();
- required_device<mb8866_device> m_wd17xx;
-
private:
+ required_device<mb8866_t> m_fdc;
+ required_device<floppy_connector> m_floppy0;
+ required_device<floppy_connector> m_floppy1;
+ required_device<floppy_connector> m_floppy2;
+ required_device<floppy_connector> m_floppy3;
+
UINT8 *m_rom;
};
diff --git a/src/emu/bus/cbmiec/c1571.c b/src/emu/bus/cbmiec/c1571.c
index 44001fd13c8..a08e88fb696 100644
--- a/src/emu/bus/cbmiec/c1571.c
+++ b/src/emu/bus/cbmiec/c1571.c
@@ -628,7 +628,7 @@ static MACHINE_CONFIG_FRAGMENT( c1570 )
MCFG_MOS6526_PB_OUTPUT_CALLBACK(WRITE8(c1571_t, cia_pb_w))
MCFG_MOS6526_PC_CALLBACK(WRITELINE(c1571_t, cia_pc_w))
- MCFG_WD1770x_ADD(WD1770_TAG, XTAL_16MHz/2)
+ MCFG_WD1770_ADD(WD1770_TAG, XTAL_16MHz/2)
MCFG_DEVICE_ADD(C64H156_TAG, C64H156, XTAL_16MHz)
MCFG_64H156_BYTE_CALLBACK(WRITELINE(c1571_t, byte_w))
MCFG_FLOPPY_DRIVE_ADD(C64H156_TAG":0", c1571_floppies, "525qd", c1571_t::floppy_formats)
@@ -679,7 +679,7 @@ static MACHINE_CONFIG_FRAGMENT( c1571 )
MCFG_MOS6526_PB_OUTPUT_CALLBACK(WRITE8(c1571_t, cia_pb_w))
MCFG_MOS6526_PC_CALLBACK(WRITELINE(c1571_t, cia_pc_w))
- MCFG_WD1770x_ADD(WD1770_TAG, XTAL_16MHz/2)
+ MCFG_WD1770_ADD(WD1770_TAG, XTAL_16MHz/2)
MCFG_DEVICE_ADD(C64H156_TAG, C64H156, XTAL_16MHz)
MCFG_64H156_BYTE_CALLBACK(WRITELINE(c1571_t, byte_w))
MCFG_FLOPPY_DRIVE_ADD(C64H156_TAG":0", c1571_floppies, "525qd", c1571_t::floppy_formats)
@@ -724,7 +724,7 @@ static MACHINE_CONFIG_FRAGMENT( c1571cr )
//MCFG_MOS5710_ADD(M5710_TAG, XTAL_16MHz/16, 0)
- MCFG_WD1770x_ADD(WD1770_TAG, XTAL_16MHz/2)
+ MCFG_WD1770_ADD(WD1770_TAG, XTAL_16MHz/2)
MCFG_DEVICE_ADD(C64H156_TAG, C64H156, XTAL_16MHz)
MCFG_64H156_BYTE_CALLBACK(WRITELINE(c1571_t, byte_w))
MCFG_FLOPPY_DRIVE_ADD(C64H156_TAG":0", c1571_floppies, "525qd", c1571_t::floppy_formats)
@@ -775,7 +775,7 @@ static MACHINE_CONFIG_FRAGMENT( mini_chief )
MCFG_MOS6526_PB_OUTPUT_CALLBACK(WRITE8(c1571_t, cia_pb_w))
MCFG_MOS6526_PC_CALLBACK(WRITELINE(c1571_t, cia_pc_w))
- MCFG_WD1770x_ADD(WD1770_TAG, XTAL_16MHz/2)
+ MCFG_WD1770_ADD(WD1770_TAG, XTAL_16MHz/2)
MCFG_DEVICE_ADD(C64H156_TAG, C64H156, XTAL_16MHz)
MCFG_64H156_BYTE_CALLBACK(WRITELINE(c1571_t, byte_w))
MCFG_FLOPPY_DRIVE_ADD(C64H156_TAG":0", c1571_floppies, "525qd", c1571_t::floppy_formats)
diff --git a/src/emu/bus/cbmiec/c1581.c b/src/emu/bus/cbmiec/c1581.c
index ce9e661b198..33bc082241e 100644
--- a/src/emu/bus/cbmiec/c1581.c
+++ b/src/emu/bus/cbmiec/c1581.c
@@ -277,7 +277,7 @@ static MACHINE_CONFIG_FRAGMENT( c1581 )
MCFG_MOS6526_PB_INPUT_CALLBACK(READ8(c1581_t, cia_pb_r))
MCFG_MOS6526_PB_OUTPUT_CALLBACK(WRITE8(c1581_t, cia_pb_w))
- MCFG_WD1772x_ADD(WD1772_TAG, XTAL_16MHz/2)
+ MCFG_WD1772_ADD(WD1772_TAG, XTAL_16MHz/2)
MCFG_FLOPPY_DRIVE_ADD(WD1772_TAG":0", c1581_floppies, "35dd", c1581_t::floppy_formats)
MACHINE_CONFIG_END
diff --git a/src/emu/bus/centronics/epson_lx810l.h b/src/emu/bus/centronics/epson_lx810l.h
index 972805438bc..71bcc68db6a 100644
--- a/src/emu/bus/centronics/epson_lx810l.h
+++ b/src/emu/bus/centronics/epson_lx810l.h
@@ -116,7 +116,7 @@ private:
UINT8 m_fakemem;
enum {
- TIMER_CR,
+ TIMER_CR
};
};
diff --git a/src/emu/bus/cgenie/expansion/floppy.c b/src/emu/bus/cgenie/expansion/floppy.c
index 7f7475a2211..6941ae33ad3 100644
--- a/src/emu/bus/cgenie/expansion/floppy.c
+++ b/src/emu/bus/cgenie/expansion/floppy.c
@@ -5,8 +5,6 @@
EACA Colour Genie Floppy Disc Controller
TODO:
- - Plain sector files are not working (some sectors are marked DDM),
- maybe support the .cgd format?
- What's the exact FD1793 model?
- How does it turn off the motor?
- What's the source of the timer and the exact timings?
@@ -74,7 +72,7 @@ const rom_entry *cgenie_fdc_device::device_rom_region() const
static MACHINE_CONFIG_FRAGMENT( cgenie_fdc )
MCFG_TIMER_DRIVER_ADD_PERIODIC("timer", cgenie_fdc_device, timer_callback, attotime::from_msec(25))
- MCFG_FD1793x_ADD("fd1793", XTAL_1MHz)
+ MCFG_FD1793_ADD("fd1793", XTAL_1MHz)
MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(cgenie_fdc_device, intrq_w))
MCFG_FLOPPY_DRIVE_ADD("fd1793:0", cgenie_floppies, "ssdd", cgenie_fdc_device::floppy_formats)
diff --git a/src/emu/bus/coco/coco_fdc.c b/src/emu/bus/coco/coco_fdc.c
index 49da5302b22..bf165df42f5 100644
--- a/src/emu/bus/coco/coco_fdc.c
+++ b/src/emu/bus/coco/coco_fdc.c
@@ -73,7 +73,9 @@
#include "imagedev/flopdrv.h"
#include "includes/coco.h"
#include "imagedev/flopdrv.h"
-#include "formats/coco_dsk.h"
+#include "formats/dmk_dsk.h"
+#include "formats/jvc_dsk.h"
+#include "formats/vdk_dsk.h"
/***************************************************************************
@@ -94,12 +96,15 @@
LOCAL VARIABLES
***************************************************************************/
-static const floppy_interface coco_floppy_interface =
-{
- FLOPPY_STANDARD_5_25_DSHD,
- LEGACY_FLOPPY_OPTIONS_NAME(coco),
- "floppy_5_25"
-};
+FLOPPY_FORMATS_MEMBER( coco_fdc_device::floppy_formats )
+ FLOPPY_DMK_FORMAT,
+ FLOPPY_JVC_FORMAT,
+ FLOPPY_VDK_FORMAT
+FLOPPY_FORMATS_END
+
+static SLOT_INTERFACE_START( coco_fdc_floppies )
+ SLOT_INTERFACE("qd", FLOPPY_525_QD)
+SLOT_INTERFACE_END
/***************************************************************************
@@ -149,15 +154,17 @@ WRITE_LINE_MEMBER( coco_fdc_device::fdc_drq_w )
//**************************************************************************
static MACHINE_CONFIG_FRAGMENT(coco_fdc)
- MCFG_DEVICE_ADD(WD_TAG, WD1773, 0)
- MCFG_WD17XX_DEFAULT_DRIVE4_TAGS
- MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(coco_fdc_device, fdc_intrq_w))
- MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(coco_fdc_device, fdc_drq_w))
+ MCFG_WD1773_ADD(WD_TAG, XTAL_8MHz)
+ MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(coco_fdc_device, fdc_intrq_w))
+ MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(coco_fdc_device, fdc_drq_w))
+
+ MCFG_FLOPPY_DRIVE_ADD(WD_TAG ":0", coco_fdc_floppies, "qd", coco_fdc_device::floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD(WD_TAG ":1", coco_fdc_floppies, "qd", coco_fdc_device::floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD(WD_TAG ":2", coco_fdc_floppies, "", coco_fdc_device::floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD(WD_TAG ":3", coco_fdc_floppies, "", coco_fdc_device::floppy_formats)
MCFG_DEVICE_ADD(DISTO_TAG, MSM6242, XTAL_32_768kHz)
MCFG_DS1315_ADD(CLOUD9_TAG)
-
- MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(coco_floppy_interface)
MACHINE_CONFIG_END
ROM_START( coco_fdc )
@@ -291,16 +298,17 @@ void coco_fdc_device::dskreg_w(UINT8 data)
else if (data & 0x40)
drive = 3;
- legacy_floppy_image_device *floppy[4];
+ floppy_image_device *floppy[4];
- floppy[0] = subdevice<legacy_floppy_image_device>(FLOPPY_0);
- floppy[1] = subdevice<legacy_floppy_image_device>(FLOPPY_1);
- floppy[2] = subdevice<legacy_floppy_image_device>(FLOPPY_2);
- floppy[3] = subdevice<legacy_floppy_image_device>(FLOPPY_3);
+ floppy[0] = subdevice<floppy_connector>(WD_TAG ":0")->get_device();
+ floppy[1] = subdevice<floppy_connector>(WD_TAG ":1")->get_device();
+ floppy[2] = subdevice<floppy_connector>(WD_TAG ":2")->get_device();
+ floppy[3] = subdevice<floppy_connector>(WD_TAG ":3")->get_device();
for (int i = 0; i < 4; i++)
{
- floppy[i]->floppy_mon_w(i == drive ? CLEAR_LINE : ASSERT_LINE);
+ if (floppy[i])
+ floppy[i]->mon_w(i == drive ? CLEAR_LINE : ASSERT_LINE);
}
head = ((data & 0x40) && (drive != 3)) ? 1 : 0;
@@ -309,8 +317,11 @@ void coco_fdc_device::dskreg_w(UINT8 data)
update_lines();
- m_wd17xx->set_drive(drive);
- m_wd17xx->set_side(head);
+ m_wd17xx->set_floppy(floppy[drive]);
+
+ if (floppy[drive])
+ floppy[drive]->ss_w(head);
+
m_wd17xx->dden_w(!BIT(m_dskreg, 5));
}
@@ -379,7 +390,7 @@ WRITE8_MEMBER(coco_fdc_device::write)
dskreg_w(data);
break;
case 8:
- m_wd17xx->command_w(space, 0, data);
+ m_wd17xx->cmd_w(space, 0, data);
break;
case 9:
m_wd17xx->track_w(space, 0, data);
@@ -388,6 +399,7 @@ WRITE8_MEMBER(coco_fdc_device::write)
m_wd17xx->sector_w(space, 0, data);
break;
case 11:
+ //printf("data w %02x\n", data);
m_wd17xx->data_w(space, 0, data);
break;
};
@@ -413,10 +425,12 @@ WRITE8_MEMBER(coco_fdc_device::write)
//**************************************************************************
static MACHINE_CONFIG_FRAGMENT(dragon_fdc)
- MCFG_DEVICE_ADD(WD2797_TAG, WD2797, 0)
- MCFG_WD17XX_DEFAULT_DRIVE4_TAGS
+ MCFG_WD2797_ADD(WD2797_TAG, XTAL_1MHz)
- MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(coco_floppy_interface)
+ MCFG_FLOPPY_DRIVE_ADD(WD2797_TAG ":0", coco_fdc_floppies, "qd", coco_fdc_device::floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD(WD2797_TAG ":1", coco_fdc_floppies, "qd", coco_fdc_device::floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD(WD2797_TAG ":2", coco_fdc_floppies, "", coco_fdc_device::floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD(WD2797_TAG ":3", coco_fdc_floppies, "", coco_fdc_device::floppy_formats)
MACHINE_CONFIG_END
@@ -511,10 +525,20 @@ void dragon_fdc_device::dskreg_w(UINT8 data)
data);
}
- if (data & 0x04)
- m_wd2797->set_drive(data & 0x03);
+ floppy_image_device *floppy = NULL;
+
+ switch (data & 0x03)
+ {
+ case 0: floppy = subdevice<floppy_connector>(WD2797_TAG ":0")->get_device(); break;
+ case 1: floppy = subdevice<floppy_connector>(WD2797_TAG ":1")->get_device(); break;
+ case 2: floppy = subdevice<floppy_connector>(WD2797_TAG ":2")->get_device(); break;
+ case 3: floppy = subdevice<floppy_connector>(WD2797_TAG ":3")->get_device(); break;
+ }
+
+ m_wd2797->set_floppy(floppy);
m_wd2797->dden_w(BIT(data, 3));
+
m_dskreg = data;
}
@@ -556,12 +580,7 @@ WRITE8_MEMBER(dragon_fdc_device::write)
switch(offset & 0xEF)
{
case 0:
- m_wd2797->command_w(space, 0, data);
-
- /* disk head is encoded in the command byte */
- /* Only for type 3 & 4 commands */
- if (data & 0x80)
- m_wd2797->set_side((data & 0x02) ? 1 : 0);
+ m_wd2797->cmd_w(space, 0, data);
break;
case 1:
m_wd2797->track_w(space, 0, data);
diff --git a/src/emu/bus/coco/coco_fdc.h b/src/emu/bus/coco/coco_fdc.h
index 3456b00054f..8773a48bea4 100644
--- a/src/emu/bus/coco/coco_fdc.h
+++ b/src/emu/bus/coco/coco_fdc.h
@@ -9,7 +9,7 @@
#include "cococart.h"
#include "machine/msm6242.h"
#include "machine/ds1315.h"
-#include "machine/wd17xx.h"
+#include "machine/wd_fdc.h"
//**************************************************************************
@@ -37,6 +37,8 @@ public:
coco_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
coco_fdc_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
+ DECLARE_FLOPPY_FORMATS(floppy_formats);
+
// optional information overrides
virtual machine_config_constructor device_mconfig_additions() const;
virtual const rom_entry *device_rom_region() const;
@@ -66,8 +68,8 @@ protected:
UINT8 m_drq : 1;
UINT8 m_intrq : 1;
- optional_device<wd1773_device> m_wd17xx; /* WD17xx */
- optional_device<wd2797_device> m_wd2797; /* WD2797 */
+ optional_device<wd1773_t> m_wd17xx; /* WD17xx */
+ optional_device<wd2797_t> m_wd2797; /* WD2797 */
optional_device<ds1315_device> m_ds1315; /* DS1315 */
/* Disto RTC */
diff --git a/src/emu/bus/comx35/fdc.c b/src/emu/bus/comx35/fdc.c
index 0c50673cc0f..0c83d5bed29 100644
--- a/src/emu/bus/comx35/fdc.c
+++ b/src/emu/bus/comx35/fdc.c
@@ -95,7 +95,7 @@ SLOT_INTERFACE_END
//-------------------------------------------------
static MACHINE_CONFIG_FRAGMENT( comx_fd )
- MCFG_WD1770x_ADD(WD1770_TAG, XTAL_8MHz)
+ MCFG_WD1770_ADD(WD1770_TAG, XTAL_8MHz)
MCFG_FLOPPY_DRIVE_ADD(WD1770_TAG":0", comx_fd_floppies, "525sd35t", comx_fd_device::floppy_formats)
MCFG_FLOPPY_DRIVE_ADD(WD1770_TAG":1", comx_fd_floppies, NULL, comx_fd_device::floppy_formats)
diff --git a/src/emu/bus/cpc/ddi1.c b/src/emu/bus/cpc/ddi1.c
new file mode 100644
index 00000000000..b2440021310
--- /dev/null
+++ b/src/emu/bus/cpc/ddi1.c
@@ -0,0 +1,140 @@
+// license:BSD-3-Clause
+// copyright-holders:Barry Rodewald
+/*
+ * ddi1.c -- Amstrad DDI-1 Floppy Disk Drive interface
+ */
+
+#include "emu.h"
+#include "ddi1.h"
+#include "includes/amstrad.h"
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+const device_type CPC_DDI1 = &device_creator<cpc_ddi1_device>;
+
+static SLOT_INTERFACE_START( ddi1_floppies )
+ SLOT_INTERFACE( "3ssdd", FLOPPY_3_SSDD )
+SLOT_INTERFACE_END
+
+//-------------------------------------------------
+// Device ROM definition
+//-------------------------------------------------
+
+ROM_START( cpc_ddi1 )
+ ROM_REGION( 0x4000, "exp_rom", 0 )
+ ROM_LOAD("cpcados.rom", 0x0000, 0x4000, CRC(1fe22ecd) SHA1(39102c8e9cb55fcc0b9b62098780ed4a3cb6a4bb))
+ROM_END
+
+//-------------------------------------------------
+// rom_region - device-specific ROM region
+//-------------------------------------------------
+
+const rom_entry *cpc_ddi1_device::device_rom_region() const
+{
+ return ROM_NAME( cpc_ddi1 );
+}
+
+// device machine config
+static MACHINE_CONFIG_FRAGMENT( cpc_ddi1 )
+ MCFG_UPD765A_ADD("upd765", true, true)
+ MCFG_FLOPPY_DRIVE_ADD("upd765:0", ddi1_floppies, "3ssdd", floppy_image_device::default_floppy_formats)
+ MCFG_SOFTWARE_LIST_ADD("flop_list","cpc_flop")
+
+ // pass-through
+ MCFG_DEVICE_ADD("exp", CPC_EXPANSION_SLOT, 0)
+ MCFG_DEVICE_SLOT_INTERFACE(cpc_exp_cards, NULL, false)
+ MCFG_CPC_EXPANSION_SLOT_OUT_IRQ_CB(DEVWRITELINE("^", cpc_expansion_slot_device, irq_w))
+ MCFG_CPC_EXPANSION_SLOT_OUT_NMI_CB(DEVWRITELINE("^", cpc_expansion_slot_device, nmi_w))
+ MCFG_CPC_EXPANSION_SLOT_OUT_ROMDIS_CB(DEVWRITELINE("^", cpc_expansion_slot_device, romdis_w)) // ROMDIS
+
+MACHINE_CONFIG_END
+
+machine_config_constructor cpc_ddi1_device::device_mconfig_additions() const
+{
+ return MACHINE_CONFIG_NAME( cpc_ddi1 );
+}
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+cpc_ddi1_device::cpc_ddi1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ device_t(mconfig, CPC_DDI1, "DDI-1", tag, owner, clock, "cpc_ddi1", __FILE__),
+ device_cpc_expansion_card_interface(mconfig, *this),
+ m_fdc(*this,"upd765"),
+ m_connector(*this,"upd765:0")
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void cpc_ddi1_device::device_start()
+{
+ device_t* cpu = machine().device("maincpu");
+ address_space& space = cpu->memory().space(AS_IO);
+ m_slot = dynamic_cast<cpc_expansion_slot_device *>(owner());
+
+ space.install_write_handler(0xfa7e,0xfa7f,0,0,write8_delegate(FUNC(cpc_ddi1_device::motor_w),this));
+ space.install_readwrite_handler(0xfb7e,0xfb7f,0,0,read8_delegate(FUNC(cpc_ddi1_device::fdc_r),this),write8_delegate(FUNC(cpc_ddi1_device::fdc_w),this));
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void cpc_ddi1_device::device_reset()
+{
+}
+
+WRITE8_MEMBER(cpc_ddi1_device::motor_w)
+{
+ switch(offset)
+ {
+ case 0x00:
+ case 0x01:
+ {
+ /* FDC Motor Control - Bit 0 defines the state of the FDD motor:
+ * "1" the FDD motor will be active.
+ * "0" the FDD motor will be in-active.*/
+ floppy_image_device *floppy;
+ if(m_connector)
+ {
+ floppy = m_connector->get_device();
+ if(floppy)
+ floppy->mon_w(!BIT(data, 0));
+ }
+ break;
+ }
+ }
+}
+
+WRITE8_MEMBER(cpc_ddi1_device::fdc_w)
+{
+ switch(offset)
+ {
+ case 0x01:
+ m_fdc->fifo_w(space, 0,data);
+ break;
+ }
+}
+
+READ8_MEMBER(cpc_ddi1_device::fdc_r)
+{
+ UINT8 data = 0xff;
+
+ switch(offset)
+ {
+ case 0x00:
+ data = m_fdc->msr_r(space, 0);
+ break;
+ case 0x01:
+ data = m_fdc->fifo_r(space, 0);
+ break;
+ }
+ return data;
+}
+
diff --git a/src/emu/bus/cpc/ddi1.h b/src/emu/bus/cpc/ddi1.h
new file mode 100644
index 00000000000..8f813e8c09a
--- /dev/null
+++ b/src/emu/bus/cpc/ddi1.h
@@ -0,0 +1,47 @@
+// license:BSD-3-Clause
+// copyright-holders:Barry Rodewald
+/*
+ * ddi1.h -- Amstrad DDI-1 Floppy Disk Drive interface
+ *
+ * Provides uPD765A FDC, AMSDOS ROM, and 3" floppy disk drive.
+ * CPC464 only, 664/6128/464+/6128+ already has this hardware built-in (AMSDOS is on the included Burnin' Rubber / BASIC cartridge for the 464+ and 6128+)
+ *
+ */
+
+#ifndef CPC_DDI1_H_
+#define CPC_DDI1_H_
+
+#include "emu.h"
+#include "cpcexp.h"
+#include "machine/upd765.h"
+
+class cpc_ddi1_device : public device_t,
+ public device_cpc_expansion_card_interface
+{
+public:
+ // construction/destruction
+ cpc_ddi1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ // optional information overrides
+ virtual const rom_entry *device_rom_region() const;
+ virtual machine_config_constructor device_mconfig_additions() const;
+
+ DECLARE_WRITE8_MEMBER(motor_w);
+ DECLARE_WRITE8_MEMBER(fdc_w);
+ DECLARE_READ8_MEMBER(fdc_r);
+protected:
+ // device-level overrides
+ virtual void device_start();
+ virtual void device_reset();
+
+private:
+ cpc_expansion_slot_device *m_slot;
+
+ required_device<upd765_family_device> m_fdc;
+ required_device<floppy_connector> m_connector;
+};
+
+// device type definition
+extern const device_type CPC_DDI1;
+
+#endif /* CPC_DDI1_H_ */
diff --git a/src/emu/bus/cpc/hd20.c b/src/emu/bus/cpc/hd20.c
new file mode 100644
index 00000000000..a6cb2772719
--- /dev/null
+++ b/src/emu/bus/cpc/hd20.c
@@ -0,0 +1,131 @@
+// license:BSD-3-Clause
+// copyright-holders:Barry Rodewald
+/*
+
+ Dobbertin HD20 hard disk
+
+*/
+
+#include "emu.h"
+#include "hd20.h"
+#include "includes/amstrad.h"
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+const device_type CPC_HD20 = &device_creator<cpc_hd20_device>;
+
+static MACHINE_CONFIG_FRAGMENT( cpc_hd20 )
+ MCFG_DEVICE_ADD("hdc",ST11M_HDC,0)
+ MCFG_XTHDC_IRQ_HANDLER(WRITELINE(cpc_hd20_device,irq_w))
+ MCFG_HARDDISK_ADD("hdc:primary")
+ // no pass-through (?)
+MACHINE_CONFIG_END
+
+machine_config_constructor cpc_hd20_device::device_mconfig_additions() const
+{
+ return MACHINE_CONFIG_NAME( cpc_hd20 );
+}
+
+ROM_START( cpc_hd20 )
+ ROM_REGION( 0x4000, "exp_rom", 0 )
+ ROM_DEFAULT_BIOS("xddos210")
+
+ ROM_SYSTEM_BIOS( 0, "xddos210", "X-DDOS 2.10" )
+ ROMX_LOAD( "xddos210.rom", 0x0000, 0x4000, CRC(5477fdb4) SHA1(2f1bd4d6e2d2e62818b01e6e7a26488362a7a8ee), ROM_BIOS(1) )
+ ROM_SYSTEM_BIOS( 1, "xddos200", "X-DDOS 2.00" )
+ ROMX_LOAD( "x-ddos20.rom", 0x0000, 0x4000, CRC(c2d9cc03) SHA1(8a20788be5f957e84e849c226aa97b55b2a3aab9), ROM_BIOS(2) )
+ROM_END
+
+const rom_entry *cpc_hd20_device::device_rom_region() const
+{
+ return ROM_NAME( cpc_hd20 );
+}
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+cpc_hd20_device::cpc_hd20_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ device_t(mconfig, CPC_HD20, "Dobbertin HD20", tag, owner, clock, "cpc_hd20", __FILE__),
+ device_cpc_expansion_card_interface(mconfig, *this),
+ m_hdc(*this,"hdc")
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void cpc_hd20_device::device_start()
+{
+ device_t* cpu = machine().device("maincpu");
+ address_space& space = cpu->memory().space(AS_IO);
+ m_slot = dynamic_cast<cpc_expansion_slot_device *>(owner());
+
+ space.install_write_handler(0xfbe0,0xfbe4,0,0,write8_delegate(FUNC(cpc_hd20_device::hdc_w),this));
+ space.install_read_handler(0xfbe0,0xfbe4,0,0,read8_delegate(FUNC(cpc_hd20_device::hdc_r),this));
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void cpc_hd20_device::device_reset()
+{
+ // TODO
+}
+
+READ8_MEMBER(cpc_hd20_device::hdc_r)
+{
+ UINT8 ret = 0x00;
+
+ switch(offset)
+ {
+ case 0:
+ ret = m_hdc->data_r();
+ break;
+ case 1:
+ ret = m_hdc->status_r();
+ break;
+ case 2:
+ m_hdc->set_ready();
+ ret = 0x01;
+ break;
+ case 4:
+ m_hdc->reset_w(0); // reset on read also?
+ break;
+ }
+
+ return ret;
+}
+
+WRITE8_MEMBER(cpc_hd20_device::hdc_w)
+{
+ switch(offset)
+ {
+ case 0:
+ m_hdc->data_w(data);
+ break;
+ case 1:
+ m_hdc->reset_w(data);
+ break;
+ case 2:
+ m_hdc->select_w(data);
+ break;
+ case 3:
+ m_hdc->control_w(data);
+ break;
+ case 4:
+ m_hdc->reset_w(data);
+ break;
+ }
+}
+
+WRITE_LINE_MEMBER(cpc_hd20_device::irq_w)
+{
+// if(state)
+// m_hdc->set_ready();
+}
diff --git a/src/emu/bus/cpc/hd20.h b/src/emu/bus/cpc/hd20.h
new file mode 100644
index 00000000000..0926e6bd5be
--- /dev/null
+++ b/src/emu/bus/cpc/hd20.h
@@ -0,0 +1,50 @@
+// license:BSD-3-Clause
+// copyright-holders:Barry Rodewald
+/*
+
+ Dobbertin HD20 hard disk
+
+ Fixed disk interface for the Amstrad CPC
+
+ Controller: Seagate ST11M XT HD Controller
+ Disk: 3.5" 20MB Seagate, Kyocera, NEC or Miniscribe (Geometry: 615 cylinders/4 heads/17 sectors)
+
+*/
+
+#ifndef HD20_H_
+#define HD20_H_
+
+#include "emu.h"
+#include "cpcexp.h"
+#include "bus/isa/hdc.h"
+
+class cpc_hd20_device : public device_t,
+ public device_cpc_expansion_card_interface
+{
+public:
+ // construction/destruction
+ cpc_hd20_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ // optional information overrides
+ virtual machine_config_constructor device_mconfig_additions() const;
+ virtual const rom_entry *device_rom_region() const;
+
+ DECLARE_READ8_MEMBER(hdc_r);
+ DECLARE_WRITE8_MEMBER(hdc_w);
+ DECLARE_WRITE_LINE_MEMBER(irq_w);
+
+protected:
+ // device-level overrides
+ virtual void device_start();
+ virtual void device_reset();
+
+private:
+ cpc_expansion_slot_device *m_slot;
+
+ required_device<xt_hdc_device> m_hdc;
+};
+
+// device type definition
+extern const device_type CPC_HD20;
+
+#endif /* HD20_H_ */
diff --git a/src/emu/bus/cpc/mface2.c b/src/emu/bus/cpc/mface2.c
index 3c8ba73c641..122f97fe46a 100644
--- a/src/emu/bus/cpc/mface2.c
+++ b/src/emu/bus/cpc/mface2.c
@@ -1,5 +1,5 @@
// license:BSD-3-Clause
-// copyright-holders:Barry Rodewald
+// copyright-holders:Kevin Thacker, Barry Rodewald
/*
* mface2.c -- Romantic Robot Multiface II expansion device for the Amstrad CPC/CPC+
*
diff --git a/src/emu/bus/cpc/mface2.h b/src/emu/bus/cpc/mface2.h
index fae584e54ce..56eb017b208 100644
--- a/src/emu/bus/cpc/mface2.h
+++ b/src/emu/bus/cpc/mface2.h
@@ -1,5 +1,5 @@
// license:BSD-3-Clause
-// copyright-holders:Barry Rodewald
+// copyright-holders:Kevin Thacker, Barry Rodewald
/*
* mface2.h -- Romantic Robot Multiface II expansion device for the Amstrad CPC/CPC+
*
diff --git a/src/emu/bus/ecbbus/grip.c b/src/emu/bus/ecbbus/grip.c
index 4bf0bdefca4..f2db25938d8 100644
--- a/src/emu/bus/ecbbus/grip.c
+++ b/src/emu/bus/ecbbus/grip.c
@@ -879,7 +879,7 @@ UINT8 grip_device::ecbbus_io_r(offs_t offset)
}
return data;
-};
+}
//-------------------------------------------------
diff --git a/src/emu/bus/econet/e01.c b/src/emu/bus/econet/e01.c
index 41b2483c068..bcb9b4b6bae 100644
--- a/src/emu/bus/econet/e01.c
+++ b/src/emu/bus/econet/e01.c
@@ -250,7 +250,7 @@ static MACHINE_CONFIG_FRAGMENT( e01 )
MCFG_DEVICE_ADD(MC6854_TAG, MC6854, 0)
MCFG_MC6854_OUT_IRQ_CB(WRITELINE(e01_device, adlc_irq_w))
MCFG_MC6854_OUT_TXD_CB(WRITELINE(e01_device, econet_data_w))
- MCFG_WD2793x_ADD(WD2793_TAG, XTAL_8MHz/4)
+ MCFG_WD2793_ADD(WD2793_TAG, XTAL_8MHz/4)
MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(e01_device, fdc_irq_w))
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(e01_device, fdc_drq_w))
MCFG_FLOPPY_DRIVE_ADD(WD2793_TAG":0", e01_floppies, "35dd", floppy_image_device::default_floppy_formats)
diff --git a/src/emu/bus/ep64/exdos.c b/src/emu/bus/ep64/exdos.c
index 4cc31ed30b1..f0813ff8d7e 100644
--- a/src/emu/bus/ep64/exdos.c
+++ b/src/emu/bus/ep64/exdos.c
@@ -102,7 +102,7 @@ SLOT_INTERFACE_END
//-------------------------------------------------
static MACHINE_CONFIG_FRAGMENT( ep64_exdos )
- MCFG_WD1770x_ADD(WD1770_TAG, XTAL_8MHz)
+ MCFG_WD1770_ADD(WD1770_TAG, XTAL_8MHz)
MCFG_FLOPPY_DRIVE_ADD(WD1770_TAG":0", ep64_exdos_floppies, "35dd", ep64_exdos_device::floppy_formats)
MCFG_FLOPPY_DRIVE_ADD(WD1770_TAG":1", ep64_exdos_floppies, NULL, ep64_exdos_device::floppy_formats)
diff --git a/src/emu/bus/gameboy/gb_slot.c b/src/emu/bus/gameboy/gb_slot.c
index 60c98447591..922dc91cce2 100644
--- a/src/emu/bus/gameboy/gb_slot.c
+++ b/src/emu/bus/gameboy/gb_slot.c
@@ -438,7 +438,7 @@ bool megaduck_cart_slot_device::call_load()
void base_gb_cart_slot_device::call_unload()
{
- if (m_cart && m_cart->get_ram_size() && m_cart->get_has_battery())
+ if (m_cart && m_cart->get_ram_base() && m_cart->get_ram_size() && m_cart->get_has_battery())
battery_save(m_cart->get_ram_base(), m_cart->get_ram_size());
}
diff --git a/src/emu/bus/gameboy/mbc.c b/src/emu/bus/gameboy/mbc.c
index b6f31714a3a..4c0a81459b6 100644
--- a/src/emu/bus/gameboy/mbc.c
+++ b/src/emu/bus/gameboy/mbc.c
@@ -368,8 +368,7 @@ WRITE8_MEMBER(gb_rom_mbc1_device::write_bank)
m_ram_bank = data & 0x3;
break;
case 0x6000: // MBC1 Mode Register
- default:
- m_mode = (data & 0x1) ? MODE_4M_256k : MODE_16M_8k;
+ m_mode = (data & 0x1) ? MODE_4M_256k : MODE_16M_64k;
break;
}
}
@@ -399,31 +398,29 @@ WRITE8_MEMBER(gb_rom_mbc1_device::write_ram)
READ8_MEMBER(gb_rom_mbc2_device::read_rom)
{
- if (offset < 0x4000)
- return m_rom[rom_bank_map[m_latch_bank] * 0x4000 + (offset & 0x3fff)];
- else
+ if (offset & 0x4000) /* RB1 */
return m_rom[rom_bank_map[m_latch_bank2] * 0x4000 + (offset & 0x3fff)];
+ else /* RB0 */
+ return m_rom[rom_bank_map[m_latch_bank] * 0x4000 + (offset & 0x3fff)];
}
WRITE8_MEMBER(gb_rom_mbc2_device::write_bank)
{
- if (offset < 0x2000)
- m_ram_enable = ((data & 0x0f) == 0x0a) ? 1 : 0;
- else if (offset < 0x4000)
- {
- // 4bits only
- data &= 0x0f;
- // bank = 0 => bank = 1
- if (data == 0)
- data = 1;
+ // the mapper only has data lines D3..D0
+ data &= 0x0f;
- // The least significant bit of the upper address byte must be 1
- if (offset & 0x0100)
- m_latch_bank2 = (m_latch_bank2 & 0x100) | data;
+ // the mapper only uses inputs A15..A14, A8 for register accesses
+ switch (offset & 0xc100)
+ {
+ case 0x0000: // RAM Enable Register
+ m_ram_enable = (data == 0x0a) ? 1 : 0;
+ break;
+ case 0x0100: // ROM Bank Register
+ m_latch_bank2 = (data == 0x00) ? 0x01 : data;
+ break;
}
}
-// 1 bank only??
READ8_MEMBER(gb_rom_mbc2_device::read_ram)
{
if (!m_ram.empty() && m_ram_enable)
diff --git a/src/emu/bus/gameboy/mbc.h b/src/emu/bus/gameboy/mbc.h
index f1596cbd0a6..3ad27d2cdee 100644
--- a/src/emu/bus/gameboy/mbc.h
+++ b/src/emu/bus/gameboy/mbc.h
@@ -37,8 +37,8 @@ class gb_rom_mbc1_device : public gb_rom_mbc_device
public:
enum {
- MODE_16M_8k = 0, /// 16Mbit ROM, 8kBit RAM
- MODE_4M_256k = 1, /// 4Mbit ROM, 256kBit RAM
+ MODE_16M_64k = 0, /// 16Mbit ROM, 64kBit RAM
+ MODE_4M_256k = 1 /// 4Mbit ROM, 256kBit RAM
};
// construction/destruction
@@ -47,7 +47,7 @@ public:
// device-level overrides
virtual void device_start() { shared_start(); save_item(NAME(m_mode)); };
- virtual void device_reset() { shared_reset(); m_mode = MODE_16M_8k; };
+ virtual void device_reset() { shared_reset(); m_mode = MODE_16M_64k; };
virtual void set_additional_wirings(UINT8 mask, int shift) { m_mask = mask; m_shift = shift; } // these get set at cart loading
virtual DECLARE_READ8_MEMBER(read_rom);
diff --git a/src/emu/bus/ieee488/c8280.c b/src/emu/bus/ieee488/c8280.c
index 188f7bcbb3a..1dd1c679c5d 100644
--- a/src/emu/bus/ieee488/c8280.c
+++ b/src/emu/bus/ieee488/c8280.c
@@ -306,7 +306,7 @@ static MACHINE_CONFIG_FRAGMENT( c8280 )
MCFG_CPU_ADD(M6502_FDC_TAG, M6502, XTAL_12MHz/8)
MCFG_CPU_PROGRAM_MAP(c8280_fdc_mem)
- MCFG_FD1797x_ADD(WD1797_TAG, XTAL_12MHz/6)
+ MCFG_FD1797_ADD(WD1797_TAG, XTAL_12MHz/6)
MCFG_WD_FDC_INTRQ_CALLBACK(INPUTLINE(M6502_FDC_TAG, M6502_IRQ_LINE))
MCFG_WD_FDC_DRQ_CALLBACK(INPUTLINE(M6502_FDC_TAG, M6502_SET_OVERFLOW))
MCFG_FLOPPY_DRIVE_ADD(WD1797_TAG ":0", c8280_floppies, "8dsdd", c8280_t::floppy_formats)
diff --git a/src/emu/bus/isa/3c505.c b/src/emu/bus/isa/3c505.c
index c08f91ff002..98328c41683 100644
--- a/src/emu/bus/isa/3c505.c
+++ b/src/emu/bus/isa/3c505.c
@@ -185,6 +185,12 @@ enum
#define INT_LOOPBACK 0x08
#define EXT_LOOPBACK 0x10
+ROM_START( threecom3c505 )
+ ROM_REGION( 0x02000, "threecom3c505", 0 )
+ ROM_LOAD_OPTIONAL( "3000_3c505_010728-00.bin", 0x00000, 0x02000, CRC(69b77ec6) SHA1(7ac36cc6fc90b90ddfc56c45303b514cbe18ae58) )
+ // see http://www.bitsavers.org/bits/Apollo/firmware/
+ROM_END
+
static INPUT_PORTS_START( tc3c505_port )
PORT_START("IO_BASE")
PORT_DIPNAME( 0x3f0, 0x300, "3C505 I/O base")
@@ -266,13 +272,24 @@ static INPUT_PORTS_START( tc3c505_port )
PORT_DIPSETTING( 0x0e, "IRQ 14" )
PORT_DIPSETTING( 0x0f, "IRQ 15" )
- PORT_DIPNAME( 0x70, 0x00, "3C505 DMA")
+ PORT_DIPNAME( 0x70, 0x60, "3C505 DMA")
+ PORT_DIPSETTING( 0x00, "none" )
PORT_DIPSETTING( 0x10, "DRQ 1" )
PORT_DIPSETTING( 0x30, "DRQ 3" )
PORT_DIPSETTING( 0x50, "DRQ 5" )
PORT_DIPSETTING( 0x60, "DRQ 6" )
PORT_DIPSETTING( 0x70, "DRQ 7" )
+ PORT_START("ROM_OPTS")
+ PORT_DIPNAME( 0x01, 0x01, "ROM control")
+ PORT_DIPSETTING( 0x00, "Disabled" )
+ PORT_DIPSETTING( 0x01, "Enabled" )
+ PORT_DIPNAME( 0x06, 0x00, "ROM base")
+ PORT_DIPSETTING( 0x00, "80000h" )
+ PORT_DIPSETTING( 0x02, "82000h" )
+ PORT_DIPSETTING( 0x04, "84000h" )
+ PORT_DIPSETTING( 0x06, "86000h" )
+
INPUT_PORTS_END
/***************************************************************************
@@ -291,7 +308,8 @@ threecom3c505_device::threecom3c505_device(const machine_config &mconfig, const
device_network_interface(mconfig, *this, 10.0f),
device_isa16_card_interface(mconfig, *this),
m_iobase(*this, "IO_BASE"),
- m_irqdrq(*this, "IRQ_DRQ")
+ m_irqdrq(*this, "IRQ_DRQ"),
+ m_romopts(*this, "ROM_OPTS")
{
}
@@ -300,7 +318,8 @@ threecom3c505_device::threecom3c505_device(const machine_config &mconfig, device
device_network_interface(mconfig, *this, 10.0f),
device_isa16_card_interface(mconfig, *this),
m_iobase(*this, "IO_BASE"),
- m_irqdrq(*this, "IRQ_DRQ")
+ m_irqdrq(*this, "IRQ_DRQ"),
+ m_romopts(*this, "ROM_OPTS")
{
}
@@ -309,6 +328,11 @@ ioport_constructor threecom3c505_device::device_input_ports() const
return INPUT_PORTS_NAME( tc3c505_port );
}
+const rom_entry *threecom3c505_device::device_rom_region() const
+{
+ return ROM_NAME( threecom3c505 );
+}
+
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@@ -380,6 +404,14 @@ void threecom3c505_device::device_reset()
m_isa->install16_device(base, base + ELP_IO_EXTENT - 1, 0, 0, read16_delegate(FUNC(threecom3c505_device::read), this), write16_delegate(FUNC(threecom3c505_device::write), this));
+ if (m_romopts->read() & 1)
+ {
+ // host ROM is enabled, get base address
+ static const int rom_bases[4] = { 0x0000, 0x2000, 0x4000, 0x6000 };
+ int rom_base = rom_bases[(m_romopts->read() >> 1) & 3];
+ m_isa->install_rom(this, rom_base, rom_base + 0x01fff, 0, 0, "threecom3c505", "threecom3c505");
+ }
+
m_installed = true;
}
}
diff --git a/src/emu/bus/isa/3c505.h b/src/emu/bus/isa/3c505.h
index 1ea3d042722..929089628ef 100644
--- a/src/emu/bus/isa/3c505.h
+++ b/src/emu/bus/isa/3c505.h
@@ -134,6 +134,7 @@ public:
required_ioport m_iobase;
required_ioport m_irqdrq;
+ required_ioport m_romopts;
virtual void recv_cb(UINT8 *data, int length);
@@ -145,6 +146,7 @@ protected:
// device-level overrides
virtual void device_start();
+ virtual const rom_entry *device_rom_region() const;
private:
// device-level overrides
diff --git a/src/emu/bus/isa/gblaster.c b/src/emu/bus/isa/gblaster.c
index 7cfe3a9b42b..6ee9600cdb6 100644
--- a/src/emu/bus/isa/gblaster.c
+++ b/src/emu/bus/isa/gblaster.c
@@ -20,9 +20,9 @@
*/
static MACHINE_CONFIG_FRAGMENT( game_blaster_config )
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SAA1099_ADD("saa1099.1", 4772720)
+ MCFG_SAA1099_ADD("saa1099.1", 7159000)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
- MCFG_SAA1099_ADD("saa1099.2", 4772720)
+ MCFG_SAA1099_ADD("saa1099.2", 7159000)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
MACHINE_CONFIG_END
@@ -35,8 +35,8 @@ WRITE8_MEMBER( isa8_gblaster_device::saa1099_1_16_w )
{
switch(offset)
{
- case 0 : m_saa1099_1->control_w( space, offset, data ); break;
- case 1 : m_saa1099_1->data_w( space, offset, data ); break;
+ case 0 : m_saa1099_1->data_w( space, offset, data ); break;
+ case 1 : m_saa1099_1->control_w( space, offset, data ); break;
}
}
@@ -44,8 +44,29 @@ WRITE8_MEMBER( isa8_gblaster_device::saa1099_2_16_w )
{
switch(offset)
{
- case 0 : m_saa1099_2->control_w( space, offset, data ); break;
- case 1 : m_saa1099_2->data_w( space, offset, data ); break;
+ case 0 : m_saa1099_2->data_w( space, offset, data ); break;
+ case 1 : m_saa1099_2->control_w( space, offset, data ); break;
+ }
+}
+
+READ8_MEMBER( isa8_gblaster_device::detect_r )
+{
+ switch(offset)
+ {
+ case 0:
+ case 1: return 0x7f; break; // this register reportedly returns 0x3f on a Tandy 1000 TL, and 0x7f on a generic 486 PC.
+ case 6:
+ case 7: return detect_reg; break;
+ default: return 0xff;
+ }
+}
+
+WRITE8_MEMBER( isa8_gblaster_device::detect_w )
+{
+ switch(offset)
+ {
+ case 2:
+ case 3: detect_reg = (data & 0xff); break;
}
}
@@ -77,7 +98,8 @@ isa8_gblaster_device::isa8_gblaster_device(const machine_config &mconfig, const
device_t(mconfig, ISA8_GAME_BLASTER, "Game Blaster Sound Card", tag, owner, clock, "isa_gblaster", __FILE__),
device_isa8_card_interface(mconfig, *this),
m_saa1099_1(*this, "saa1099.1"),
- m_saa1099_2(*this, "saa1099.2")
+ m_saa1099_2(*this, "saa1099.2"),
+ detect_reg(0xFF)
{
}
@@ -90,6 +112,7 @@ void isa8_gblaster_device::device_start()
set_isa_device();
m_isa->install_device(0x0220, 0x0221, 0, 0, read8_delegate( FUNC(isa8_gblaster_device::saa1099_16_r), this ), write8_delegate( FUNC(isa8_gblaster_device::saa1099_1_16_w), this ) );
m_isa->install_device(0x0222, 0x0223, 0, 0, read8_delegate( FUNC(isa8_gblaster_device::saa1099_16_r), this ), write8_delegate( FUNC(isa8_gblaster_device::saa1099_2_16_w), this ) );
+ m_isa->install_device(0x0224, 0x022F, 0, 0, read8_delegate( FUNC(isa8_gblaster_device::detect_r), this ), write8_delegate( FUNC(isa8_gblaster_device::detect_w), this ) );
}
//-------------------------------------------------
diff --git a/src/emu/bus/isa/gblaster.h b/src/emu/bus/isa/gblaster.h
index 2388f5bbd36..b2625e98975 100644
--- a/src/emu/bus/isa/gblaster.h
+++ b/src/emu/bus/isa/gblaster.h
@@ -29,6 +29,8 @@ public:
DECLARE_READ8_MEMBER(saa1099_16_r);
DECLARE_WRITE8_MEMBER(saa1099_1_16_w);
DECLARE_WRITE8_MEMBER(saa1099_2_16_w);
+ DECLARE_READ8_MEMBER(detect_r);
+ DECLARE_WRITE8_MEMBER(detect_w);
protected:
// device-level overrides
virtual void device_start();
@@ -37,6 +39,7 @@ private:
// internal state
required_device<saa1099_device> m_saa1099_1;
required_device<saa1099_device> m_saa1099_2;
+ UINT8 detect_reg;
};
diff --git a/src/emu/bus/isa/hdc.c b/src/emu/bus/isa/hdc.c
index 594cd686cb2..45b6bc334dd 100644
--- a/src/emu/bus/isa/hdc.c
+++ b/src/emu/bus/isa/hdc.c
@@ -1,5 +1,5 @@
// license:BSD-3-Clause
-// copyright-holders:Miodrag Milanovic
+// copyright-holders:Wilbert Pol
/**********************************************************************
ISA 8 bit XT Hard Disk Controller
@@ -112,9 +112,20 @@ static const char *const hdc_command_names[] =
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL /* 0xF8-0xFF */
};
-static MACHINE_CONFIG_FRAGMENT( hdc_config )
- MCFG_HARDDISK_ADD("primary")
- MCFG_HARDDISK_ADD("slave")
+static MACHINE_CONFIG_FRAGMENT( xt_hdc_config )
+ MCFG_DEVICE_ADD("hdc",XT_HDC,0)
+ MCFG_XTHDC_IRQ_HANDLER(WRITELINE(isa8_hdc_device,irq_w))
+ MCFG_XTHDC_DRQ_HANDLER(WRITELINE(isa8_hdc_device,drq_w))
+ MCFG_HARDDISK_ADD("hdc:primary")
+ MCFG_HARDDISK_ADD("hdc:slave")
+MACHINE_CONFIG_END
+
+static MACHINE_CONFIG_FRAGMENT( ec1841_hdc_config )
+ MCFG_DEVICE_ADD("hdc",EC1841_HDC,0)
+ MCFG_XTHDC_IRQ_HANDLER(WRITELINE(isa8_hdc_ec1841_device,irq_w))
+ MCFG_XTHDC_DRQ_HANDLER(WRITELINE(isa8_hdc_ec1841_device,drq_w))
+ MCFG_HARDDISK_ADD("hdc:primary")
+ MCFG_HARDDISK_ADD("hdc:slave")
MACHINE_CONFIG_END
ROM_START( hdc )
@@ -146,86 +157,50 @@ static INPUT_PORTS_START( isa_hdc )
PORT_DIPSETTING( 0x00, DEF_STR(No) )
INPUT_PORTS_END
-//**************************************************************************
-// GLOBAL VARIABLES
-//**************************************************************************
-
-const device_type ISA8_HDC = &device_creator<isa8_hdc_device>;
-const device_type ISA8_HDC_EC1841 = &device_creator<isa8_hdc_ec1841_device>;
-
-//-------------------------------------------------
-// machine_config_additions - device-specific
-// machine configurations
-//-------------------------------------------------
-
-machine_config_constructor isa8_hdc_device::device_mconfig_additions() const
-{
- return MACHINE_CONFIG_NAME( hdc_config );
-}
-
-//-------------------------------------------------
-// rom_region - device-specific ROM region
-//-------------------------------------------------
+const device_type XT_HDC = &device_creator<xt_hdc_device>;
+const device_type EC1841_HDC = &device_creator<ec1841_device>;
+const device_type ST11M_HDC = &device_creator<st11m_device>;
-const rom_entry *isa8_hdc_device::device_rom_region() const
-{
- return ROM_NAME( hdc );
-}
-
-//-------------------------------------------------
-// input_ports - device-specific input ports
-//-------------------------------------------------
-
-ioport_constructor isa8_hdc_device::device_input_ports() const
-{
- return INPUT_PORTS_NAME( isa_hdc );
-}
-
-//**************************************************************************
-// LIVE DEVICE
-//**************************************************************************
-
-//-------------------------------------------------
-// isa8_hdc_device - constructor
-//-------------------------------------------------
-
-isa8_hdc_device::isa8_hdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
- device_t(mconfig, ISA8_HDC, "Fixed Disk Controller Card", tag, owner, clock, "hdc", __FILE__),
- device_isa8_card_interface(mconfig, *this)
+xt_hdc_device::xt_hdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ device_t(mconfig, XT_HDC, "Generic PC-XT Fixed Disk Controller", tag, owner, clock, "xt_hdc", __FILE__),
+ m_irq_handler(*this),
+ m_drq_handler(*this)
{
m_type = STANDARD;
}
-isa8_hdc_device::isa8_hdc_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
+xt_hdc_device::xt_hdc_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
device_t(mconfig, type, name, tag, owner, clock, shortname, source),
- device_isa8_card_interface(mconfig, *this)
+ m_irq_handler(*this),
+ m_drq_handler(*this)
{
}
-isa8_hdc_ec1841_device::isa8_hdc_ec1841_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
- isa8_hdc_device( mconfig, ISA8_HDC_EC1841, "EC1841 HDC", tag, owner, clock, "hdc_ec1841", __FILE__)
+ec1841_device::ec1841_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ xt_hdc_device(mconfig, EC1841_HDC, "EC1841 Fixed Disk Controller", tag, owner, clock, "ec1481", __FILE__),
+ m_irq_handler(*this),
+ m_drq_handler(*this)
{
m_type = EC1841;
}
-//-------------------------------------------------
-// device_start - device-specific startup
-//-------------------------------------------------
+st11m_device::st11m_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ xt_hdc_device(mconfig, EC1841_HDC, "Seagate ST11M Fixed Disk Controller", tag, owner, clock, "st11m", __FILE__),
+ m_irq_handler(*this),
+ m_drq_handler(*this)
+{
+ m_type = ST11M;
+}
-void isa8_hdc_device::device_start()
+void xt_hdc_device::device_start()
{
- set_isa_device();
- m_isa->install_device(0x0320, 0x0323, 0, 0, read8_delegate( FUNC(isa8_hdc_device::pc_hdc_r), this ), write8_delegate( FUNC(isa8_hdc_device::pc_hdc_w), this ) );
- m_isa->set_dma_channel(3, this, FALSE);
- buffer.resize(17*4*512);
+ buffer.resize(256*512); // maximum possible transfer
timer = timer_alloc();
+ m_irq_handler.resolve_safe();
+ m_drq_handler.resolve_safe();
}
-//-------------------------------------------------
-// device_reset - device-specific reset
-//-------------------------------------------------
-
-void isa8_hdc_device::device_reset()
+void xt_hdc_device::device_reset()
{
drv = 0;
data_cnt = 0;
@@ -250,13 +225,9 @@ void isa8_hdc_device::device_reset()
csb = 0;
status = 0;
error = 0;
- dip = ioport("HDD")->read();
-
- if (ioport("ROM")->read() == 1)
- m_isa->install_rom(this, 0xc8000, 0xc9fff, 0, 0, "hdc", "hdc");
}
-hard_disk_file *isa8_hdc_device::pc_hdc_file(int id)
+hard_disk_file *xt_hdc_device::pc_hdc_file(int id)
{
harddisk_image_device *img = NULL;
switch( id )
@@ -277,14 +248,12 @@ hard_disk_file *isa8_hdc_device::pc_hdc_file(int id)
return img->get_hard_disk_file();
}
-void isa8_hdc_device::pc_hdc_result(int set_error_info)
+void xt_hdc_device::pc_hdc_result(int set_error_info)
{
- if ( ( hdc_control & 0x02 )) {
+ if ( ( hdc_control & 0x02 ))
+ {
// dip switch selected IRQ 5 or 2
- if (BIT(dip, 6))
- m_isa->irq5_w(1);
- else
- m_isa->irq2_w(1);
+ m_irq_handler(1);
}
if (LOG_HDC_STATUS)
@@ -318,14 +287,14 @@ void isa8_hdc_device::pc_hdc_result(int set_error_info)
-int isa8_hdc_device::no_dma(void)
+int xt_hdc_device::no_dma(void)
{
return (hdc_control & CTL_DMA) == 0;
}
-int isa8_hdc_device::get_lbasector()
+int xt_hdc_device::get_lbasector()
{
hard_disk_info *info;
hard_disk_file *file;
@@ -342,8 +311,6 @@ int isa8_hdc_device::get_lbasector()
return lbasector;
}
-
-
/********************************************************************
*
* Read a number of sectors to the address set up for DMA chan #3
@@ -354,7 +321,7 @@ int isa8_hdc_device::get_lbasector()
* implementation that threw the idea of "emulating the hardware" to the wind
*/
-int isa8_hdc_device::pc_hdc_dack_r()
+int xt_hdc_device::dack_r()
{
UINT8 result;
hard_disk_info *info;
@@ -392,7 +359,7 @@ int isa8_hdc_device::pc_hdc_dack_r()
if (!no_dma())
{
- m_isa->drq3_w((hdcdma_read || hdcdma_size ) ? 1 : 0);
+ m_drq_handler((hdcdma_read || hdcdma_size ) ? 1 : 0);
if(!(hdcdma_read || hdcdma_size)) pc_hdc_result(0);
}
@@ -401,7 +368,7 @@ int isa8_hdc_device::pc_hdc_dack_r()
-void isa8_hdc_device::pc_hdc_dack_w(int data)
+void xt_hdc_device::dack_w(int data)
{
hard_disk_info *info;
hard_disk_file *file;
@@ -434,14 +401,14 @@ void isa8_hdc_device::pc_hdc_dack_w(int data)
if (!no_dma())
{
- m_isa->drq3_w(hdcdma_size ? 1 : 0);
+ m_drq_handler(hdcdma_size ? 1 : 0);
if(!hdcdma_size) pc_hdc_result(1);
}
}
-void isa8_hdc_device::pc_hdc_dack_ws(int data)
+void xt_hdc_device::dack_ws(int data)
{
*(hdcdma_dst++) = data;
@@ -454,95 +421,91 @@ void isa8_hdc_device::pc_hdc_dack_ws(int data)
if (!no_dma())
{
- m_isa->drq3_w(hdcdma_size ? 1 : 0);
+ m_drq_handler(hdcdma_size ? 1 : 0);
if(!hdcdma_size) pc_hdc_result(1);
}
}
-void isa8_hdc_device::execute_read()
+void xt_hdc_device::execute_read()
{
hard_disk_file *disk = NULL;
int size = sector_cnt[drv] * 512;
int read_ = 0;
+ if(sector_cnt[drv] == 0)
+ size = 256 * 512;
+
disk = pc_hdc_file(drv);
if (!disk)
return;
+ status |= STA_READY; // ready to recieve data
+ status &= ~STA_INPUT;
+ status &= ~STA_COMMAND;
+
hdcdma_src = hdcdma_data;
hdcdma_read = read_;
hdcdma_size = size;
- if (no_dma())
+ if(!no_dma())
{
- do
- {
- buffer[data_cnt++] = pc_hdc_dack_r();
- } while (hdcdma_read || hdcdma_size);
- }
- else
- {
- m_isa->drq3_w(1);
+ m_drq_handler(1);
+ if(!hdcdma_size) pc_hdc_result(0);
}
}
-void isa8_hdc_device::execute_write()
+void xt_hdc_device::execute_write()
{
hard_disk_file *disk = NULL;
int size = sector_cnt[drv] * 512;
int write_ = 512;
+ if(sector_cnt[drv] == 0)
+ size = 256 * 512;
+
disk = pc_hdc_file(drv);
if (!disk)
return;
+ status |= STA_READY; // ready to recieve data
+ status |= STA_INPUT;
+ status &= ~STA_COMMAND;
+
hdcdma_dst = hdcdma_data;
hdcdma_write = write_;
hdcdma_size = size;
- if (no_dma())
- {
- do
- {
- pc_hdc_dack_w(buffer[data_cnt++]);
- }
- while (hdcdma_write || hdcdma_size);
- }
- else
+ if (!no_dma())
{
- m_isa->drq3_w(1);
+ m_drq_handler(1);
}
}
-void isa8_hdc_device::execute_writesbuff()
+void xt_hdc_device::execute_writesbuff()
{
hdcdma_dst = hdcdma_data;
hdcdma_write = 512;
hdcdma_size = 512;
- if (no_dma())
- {
- do
- {
- pc_hdc_dack_ws(buffer[data_cnt++]);
- }
- while (hdcdma_write || hdcdma_size);
- }
- else
+ status |= STA_READY; // ready to recieve data
+ status |= STA_INPUT;
+ status &= ~STA_COMMAND;
+
+ if (!no_dma())
{
- m_isa->drq3_w(1);
+ m_drq_handler(1);
}
}
-void isa8_hdc_device::get_drive()
+void xt_hdc_device::get_drive()
{
drv = (buffer[1] >> 5) & 1;
csb = (drv) ? CSB_LUN : 0x00;
@@ -550,7 +513,7 @@ void isa8_hdc_device::get_drive()
-void isa8_hdc_device::get_chsn()
+void xt_hdc_device::get_chsn()
{
head[drv] = buffer[1] & 0x1f;
sector[drv] = buffer[2] & 0x3f;
@@ -562,7 +525,7 @@ void isa8_hdc_device::get_chsn()
error = 0x80; /* a potential error has C/H/S/N info */
}
-int isa8_hdc_device::test_ready()
+int xt_hdc_device::test_ready()
{
if( !pc_hdc_file(drv) )
{
@@ -573,33 +536,33 @@ int isa8_hdc_device::test_ready()
return 1;
}
-void isa8_hdc_device::hdc_command()
+void xt_hdc_device::command()
{
int set_error_info = 1;
int old_error = error; /* Previous error data is needed for CMD_SENSE */
- UINT8 cmd;
const char *command_name;
csb = 0x00;
error = 0;
buffer_ptr = &buffer[0];
- cmd = buffer[0];
get_drive();
+ data_cnt = 0;
if (LOG_HDC_STATUS)
{
- command_name = hdc_command_names[cmd] ? hdc_command_names[cmd] : "Unknown";
+ command_name = hdc_command_names[m_current_cmd] ? hdc_command_names[m_current_cmd] : "Unknown";
logerror("%s pc_hdc_command(): Executing command; cmd=0x%02x (%s) drv=%d\n",
- machine().describe_context(), cmd, command_name, drv);
+ machine().describe_context(), m_current_cmd, command_name, drv);
}
- switch (cmd)
+ switch (m_current_cmd)
{
case CMD_TESTREADY:
set_error_info = 0;
test_ready();
+ if(no_dma()) pc_hdc_result(set_error_info);
break;
case CMD_SENSE:
/* Perform error code translation. This may need to be expanded in the future. */
@@ -608,9 +571,11 @@ void isa8_hdc_device::hdc_command()
buffer[data_cnt++] = ((cylinder[drv] >> 2) & 0xc0) | sector[drv];
buffer[data_cnt++] = cylinder[drv] & 0xff;
set_error_info = 0;
+ if(no_dma()) pc_hdc_result(set_error_info);
break;
case CMD_RECALIBRATE:
get_chsn();
+ if(no_dma()) pc_hdc_result(set_error_info);
break;
case CMD_FORMATDRV:
@@ -621,6 +586,7 @@ void isa8_hdc_device::hdc_command()
case CMD_DRIVEDIAG:
get_chsn();
test_ready();
+ if(no_dma()) pc_hdc_result(set_error_info);
break;
case CMD_READ:
@@ -635,6 +601,8 @@ void isa8_hdc_device::hdc_command()
if (test_ready())
execute_read();
+ else
+ pc_hdc_result(1);
set_error_info = 0;
break;
@@ -668,25 +636,25 @@ void isa8_hdc_device::hdc_command()
rwc[drv] = ((buffer[9]&3)<<8) | buffer[10];
wp[drv] = ((buffer[11]&3)<<8) | buffer[12];
ecc[drv] = buffer[13];
+ if(no_dma()) pc_hdc_result(set_error_info);
break;
case CMD_GETECC:
buffer[data_cnt++] = ecc[drv];
+ if(no_dma()) pc_hdc_result(set_error_info);
break;
case CMD_READSBUFF:
case CMD_RAMDIAG:
case CMD_INTERNDIAG:
+ if(no_dma()) pc_hdc_result(set_error_info);
break;
-
}
- if(no_dma()) pc_hdc_result(set_error_info);
}
-
-void isa8_hdc_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
+void xt_hdc_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
- hdc_command();
+ command();
}
@@ -710,14 +678,36 @@ void isa8_hdc_device::device_timer(emu_timer &timer, device_timer_id id, int par
* cccccccc write precomp l
* eeeeeeee ecc
*/
-void isa8_hdc_device::pc_hdc_data_w(int data)
+void xt_hdc_device::data_w(int data)
{
- if( data_cnt == 0 )
+ if(!(status & STA_COMMAND) && m_current_cmd != CMD_SETPARAM)
{
if (LOG_HDC_DATA)
- logerror("hdc_data_w $%02x: ", data);
+ logerror("hdc_data_w PIO $%02x (%i) (%s): \n", data,data_cnt,hdc_command_names[m_current_cmd] ? hdc_command_names[m_current_cmd] : "Unknown");
+ // PIO data transfer
+ buffer[data_cnt++] = data;
+ if(data_cnt >= hdcdma_size)
+ {
+ data_cnt = 0;
+ // write to disk
+ do
+ {
+ if(m_current_cmd == CMD_WRITESBUFF)
+ dack_ws(buffer[data_cnt++]);
+ else
+ dack_w(buffer[data_cnt++]);
+ }
+ while (hdcdma_size);
+ data_cnt = 0;
+ pc_hdc_result(1);
+ }
+ return;
+ }
+ if( data_cnt == 0 )
+ {
buffer_ptr = &buffer[0];
+ m_current_cmd = data;
data_cnt = 6; /* expect 6 bytes including this one */
status &= ~STA_READY;
status &= ~STA_INPUT;
@@ -761,14 +751,16 @@ void isa8_hdc_device::pc_hdc_data_w(int data)
if (data_cnt)
{
if (LOG_HDC_DATA)
- logerror("hdc_data_w $%02x\n", data);
+ logerror("hdc_data_w $%02x (%i) (%s): \n", data,data_cnt,hdc_command_names[m_current_cmd] ? hdc_command_names[m_current_cmd] : "Unknown");
*buffer_ptr++ = data;
// XXX ec1841 wants this
- if (buffer[0] == CMD_SETPARAM && data_cnt == 9 && (m_type == EC1841)) {
+ if (m_current_cmd == CMD_SETPARAM && data_cnt == 9 && (m_type == EC1841)) {
status &= ~STA_READY;
} else {
status |= STA_READY;
+ if(m_current_cmd == CMD_SETPARAM && data_cnt == 9) // some controllers want geometry info as data, not as a command (true for the Seagate ST11M?)
+ status &= ~STA_COMMAND;
}
if (--data_cnt == 0)
{
@@ -786,7 +778,7 @@ void isa8_hdc_device::pc_hdc_data_w(int data)
-void isa8_hdc_device::pc_hdc_reset_w(int data)
+void xt_hdc_device::reset_w(int data)
{
cylinder[0] = cylinder[1] = 0;
head[0] = head[1] = 0;
@@ -800,7 +792,7 @@ void isa8_hdc_device::pc_hdc_reset_w(int data)
-void isa8_hdc_device::pc_hdc_select_w(int data)
+void xt_hdc_device::select_w(int data)
{
status &= ~STA_INTERRUPT;
status |= STA_SELECT;
@@ -808,7 +800,7 @@ void isa8_hdc_device::pc_hdc_select_w(int data)
-void isa8_hdc_device::pc_hdc_control_w(int data)
+void xt_hdc_device::control_w(int data)
{
if (LOG_HDC_STATUS)
logerror("%s: pc_hdc_control_w(): control write %d\n", machine().describe_context(), data);
@@ -817,18 +809,38 @@ void isa8_hdc_device::pc_hdc_control_w(int data)
if (!(hdc_control & 0x02))
{
- if (BIT(dip, 6))
- m_isa->irq5_w(0);
- else
- m_isa->irq2_w(0);
+ m_irq_handler(0);
}
}
-UINT8 isa8_hdc_device::pc_hdc_data_r()
+UINT8 xt_hdc_device::data_r()
{
UINT8 data = 0xff;
+
+ if(!(status & STA_COMMAND) && (m_current_cmd == CMD_READ || m_current_cmd == CMD_READLONG || m_current_cmd == CMD_READSBUFF))
+ {
+ // PIO data transfer
+ if(data_cnt == 0)
+ {
+ do
+ {
+ buffer[data_cnt++] = dack_r();
+ } while (hdcdma_read);
+ data_cnt = 0;
+ }
+ data = buffer[data_cnt++];
+ if(data_cnt >= ((sector_cnt[drv] * 512) ? (sector_cnt[drv] * 512) : (256 * 512)))
+ {
+ data_cnt = 0;
+ pc_hdc_result(1);
+ }
+ if (LOG_HDC_DATA)
+ logerror("hdc_data_r PIO $%02x (%i): \n", data,data_cnt);
+ return data;
+ }
+
if( data_cnt )
{
data = *buffer_ptr++;
@@ -840,43 +852,114 @@ UINT8 isa8_hdc_device::pc_hdc_data_r()
status &= ~STA_SELECT;
status |= STA_COMMAND;
}
+ if (LOG_HDC_DATA)
+ logerror("hdc_data_r $%02x (%i): \n", data,data_cnt);
}
return data;
}
-UINT8 isa8_hdc_device::pc_hdc_status_r()
+UINT8 xt_hdc_device::status_r()
{
return status;
}
+void xt_hdc_device::set_ready()
+{
+ status |= STA_READY; // XXX
+}
+//**************************************************************************
+// GLOBAL VARIABLES
+//**************************************************************************
-/*
- Dipswitch configuration
+const device_type ISA8_HDC = &device_creator<isa8_hdc_device>;
+const device_type ISA8_HDC_EC1841 = &device_creator<isa8_hdc_ec1841_device>;
+//-------------------------------------------------
+// machine_config_additions - device-specific
+// machine configurations
+//-------------------------------------------------
- Tandon/Western Digital Fixed Disk Controller
- bit0-1 : Determine disk size(?)
- Causes geometry data to be read from c8043, c8053, c8063, c8073 (?)
- 00 - 40 Mbytes
- 01 - 30 Mbytes
- 10 - 10 Mbytes
- 11 - 20 Mbytes
- bit2-7 : unknown
+machine_config_constructor isa8_hdc_device::device_mconfig_additions() const
+{
+ return MACHINE_CONFIG_NAME( xt_hdc_config );
+}
- */
+machine_config_constructor isa8_hdc_ec1841_device::device_mconfig_additions() const
+{
+ return MACHINE_CONFIG_NAME( ec1841_hdc_config );
+}
-UINT8 isa8_hdc_device::pc_hdc_dipswitch_r()
+//-------------------------------------------------
+// rom_region - device-specific ROM region
+//-------------------------------------------------
+
+const rom_entry *isa8_hdc_device::device_rom_region() const
+{
+ return ROM_NAME( hdc );
+}
+
+//-------------------------------------------------
+// input_ports - device-specific input ports
+//-------------------------------------------------
+
+ioport_constructor isa8_hdc_device::device_input_ports() const
+{
+ return INPUT_PORTS_NAME( isa_hdc );
+}
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// isa8_hdc_device - constructor
+//-------------------------------------------------
+
+isa8_hdc_device::isa8_hdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ device_t(mconfig, ISA8_HDC, "Fixed Disk Controller Card", tag, owner, clock, "hdc", __FILE__),
+ device_isa8_card_interface(mconfig, *this),
+ m_hdc(*this,"hdc")
{
- status |= STA_READY; // XXX
- if (LOG_HDC_STATUS)
- logerror("%s: pc_hdc_dipswitch_r: status $%02X\n", machine().describe_context(), status);
- return dip;
}
+isa8_hdc_device::isa8_hdc_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
+ device_t(mconfig, type, name, tag, owner, clock, shortname, source),
+ device_isa8_card_interface(mconfig, *this),
+ m_hdc(*this,"hdc")
+{
+}
+
+isa8_hdc_ec1841_device::isa8_hdc_ec1841_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ isa8_hdc_device( mconfig, ISA8_HDC_EC1841, "EC1841 HDC", tag, owner, clock, "hdc_ec1841", __FILE__),
+ m_hdc(*this,"hdc")
+{
+}
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void isa8_hdc_device::device_start()
+{
+ set_isa_device();
+ m_isa->install_device(0x0320, 0x0323, 0, 0, read8_delegate( FUNC(isa8_hdc_device::pc_hdc_r), this ), write8_delegate( FUNC(isa8_hdc_device::pc_hdc_w), this ) );
+ m_isa->set_dma_channel(3, this, FALSE);
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void isa8_hdc_device::device_reset()
+{
+ dip = ioport("HDD")->read();
+
+ if (ioport("ROM")->read() == 1)
+ m_isa->install_rom(this, 0xc8000, 0xc9fff, 0, 0, "hdc", "hdc");
+}
/*************************************************************************
*
@@ -890,8 +973,8 @@ READ8_MEMBER( isa8_hdc_device::pc_hdc_r )
switch( offset )
{
- case 0: data = pc_hdc_data_r(); break;
- case 1: data = pc_hdc_status_r(); break;
+ case 0: data = m_hdc->data_r(); break;
+ case 1: data = m_hdc->status_r(); break;
case 2: data = pc_hdc_dipswitch_r(); break;
case 3: break;
}
@@ -909,23 +992,59 @@ WRITE8_MEMBER( isa8_hdc_device::pc_hdc_w )
switch( offset )
{
- case 0: pc_hdc_data_w(data); break;
- case 1: pc_hdc_reset_w(data); break;
- case 2: pc_hdc_select_w(data); break;
- case 3: pc_hdc_control_w(data); break;
+ case 0: m_hdc->data_w(data); break;
+ case 1: m_hdc->reset_w(data); break;
+ case 2: m_hdc->select_w(data); break;
+ case 3: m_hdc->control_w(data); break;
}
}
UINT8 isa8_hdc_device::dack_r(int line)
{
- return pc_hdc_dack_r();
+ return m_hdc->dack_r();
}
void isa8_hdc_device::dack_w(int line,UINT8 data)
{
- if (buffer[0] == CMD_WRITESBUFF)
- pc_hdc_dack_ws(data);
+ if (m_hdc->get_command() == CMD_WRITESBUFF)
+ m_hdc->dack_ws(data);
else
- pc_hdc_dack_w(data);
+ m_hdc->dack_w(data);
+}
+
+/*
+ Dipswitch configuration
+
+
+ Tandon/Western Digital Fixed Disk Controller
+ bit0-1 : Determine disk size(?)
+ Causes geometry data to be read from c8043, c8053, c8063, c8073 (?)
+ 00 - 40 Mbytes
+ 01 - 30 Mbytes
+ 10 - 10 Mbytes
+ 11 - 20 Mbytes
+ bit2-7 : unknown
+
+ */
+
+UINT8 isa8_hdc_device::pc_hdc_dipswitch_r()
+{
+ m_hdc->set_ready();
+ if (LOG_HDC_STATUS)
+ logerror("%s: pc_hdc_dipswitch_r: status $%02X\n", machine().describe_context(), m_hdc->status_r());
+ return dip;
+}
+
+WRITE_LINE_MEMBER( isa8_hdc_device::irq_w )
+{
+ if (BIT(dip, 6))
+ m_isa->irq5_w(state);
+ else
+ m_isa->irq2_w(state);
+}
+
+WRITE_LINE_MEMBER( isa8_hdc_device::drq_w )
+{
+ m_isa->drq3_w(state);
}
diff --git a/src/emu/bus/isa/hdc.h b/src/emu/bus/isa/hdc.h
index e8c6f68ce52..21a47707e69 100644
--- a/src/emu/bus/isa/hdc.h
+++ b/src/emu/bus/isa/hdc.h
@@ -1,5 +1,5 @@
// license:BSD-3-Clause
-// copyright-holders:Miodrag Milanovic
+// copyright-holders:Wilbert Pol
/**********************************************************************
ISA 8 bit XT Hard Disk Controller
@@ -18,6 +18,122 @@
// TYPE DEFINITIONS
//**************************************************************************
+// XT HD controller device
+
+#define MCFG_XTHDC_IRQ_HANDLER(_devcb) \
+ devcb = &xt_hdc_device::set_irq_handler(*device, DEVCB_##_devcb);
+
+#define MCFG_XTHDC_DRQ_HANDLER(_devcb) \
+ devcb = &xt_hdc_device::set_drq_handler(*device, DEVCB_##_devcb);
+
+class xt_hdc_device :
+ public device_t
+{
+public:
+ // construction/destruction
+ xt_hdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ xt_hdc_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
+
+ template<class _Object> static devcb_base &set_irq_handler(device_t &device, _Object object) { return downcast<xt_hdc_device &>(device).m_irq_handler.set_callback(object); }
+ template<class _Object> static devcb_base &set_drq_handler(device_t &device, _Object object) { return downcast<xt_hdc_device &>(device).m_drq_handler.set_callback(object); }
+
+ int dack_r();
+ void dack_w(int data);
+ void dack_ws(int data);
+
+ virtual void command();
+ void data_w(int data);
+ void reset_w(int data);
+ void select_w(int data);
+ void control_w(int data);
+ UINT8 data_r();
+ UINT8 status_r();
+ void set_ready();
+ UINT8 get_command() { return buffer[0]; }
+
+protected:
+ // device-level overrides
+ virtual void device_start();
+ virtual void device_reset();
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
+ hard_disk_file *pc_hdc_file(int id);
+ void pc_hdc_result(int set_error_info);
+ int no_dma(void);
+ int get_lbasector();
+ void execute_read();
+ void execute_write();
+ void execute_writesbuff();
+ void get_drive();
+ void get_chsn();
+ int test_ready();
+
+ dynamic_buffer buffer; /* data buffer */
+ UINT8 *buffer_ptr; /* data pointer */
+ int csb; /* command status byte */
+ int status; /* drive status */
+ int error; /* error code */
+
+ enum {
+ STANDARD,
+ EC1841,
+ ST11M
+ };
+ int m_type;
+ UINT8 m_current_cmd;
+ devcb_write_line m_irq_handler;
+ devcb_write_line m_drq_handler;
+
+private:
+ int drv; /* 0 master, 1 slave drive */
+ int cylinders[2]; /* number of cylinders */
+ int rwc[2]; /* reduced write current from cyl */
+ int wp[2]; /* write precompensation from cyl */
+ int heads[2]; /* heads */
+ int ecc[2]; /* ECC bytes */
+
+ /* indexes */
+ int cylinder[2]; /* current cylinder */
+ int head[2]; /* current head */
+ int sector[2]; /* current sector */
+ int sector_cnt[2]; /* sector count */
+ int control[2]; /* control */
+
+ emu_timer *timer;
+
+ int data_cnt; /* data count */
+ UINT8 hdc_control;
+
+ UINT8 hdcdma_data[512];
+ UINT8 *hdcdma_src;
+ UINT8 *hdcdma_dst;
+ int hdcdma_read;
+ int hdcdma_write;
+ int hdcdma_size;
+};
+
+class ec1841_device : public xt_hdc_device
+{
+public:
+ ec1841_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+protected:
+ devcb_write_line m_irq_handler;
+ devcb_write_line m_drq_handler;
+};
+
+class st11m_device : public xt_hdc_device
+{
+public:
+ st11m_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+protected:
+ devcb_write_line m_irq_handler;
+ devcb_write_line m_drq_handler;
+};
+
+extern const device_type XT_HDC;
+extern const device_type EC1841_HDC;
+extern const device_type ST11M_HDC;
+
// ======================> isa8_hdc_device
class isa8_hdc_device :
@@ -29,84 +145,26 @@ public:
isa8_hdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
isa8_hdc_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
+ DECLARE_READ8_MEMBER(pc_hdc_r);
+ DECLARE_WRITE8_MEMBER(pc_hdc_w);
+ DECLARE_WRITE_LINE_MEMBER(irq_w);
+ DECLARE_WRITE_LINE_MEMBER(drq_w);
+ required_device<xt_hdc_device> m_hdc;
+
// optional information overrides
virtual machine_config_constructor device_mconfig_additions() const;
virtual const rom_entry *device_rom_region() const;
- DECLARE_READ8_MEMBER(pc_hdc_r);
- DECLARE_WRITE8_MEMBER(pc_hdc_w);
virtual ioport_constructor device_input_ports() const;
-
protected:
// device-level overrides
virtual void device_start();
virtual void device_reset();
- virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
-private:
- int drv; /* 0 master, 1 slave drive */
- int cylinders[2]; /* number of cylinders */
- int rwc[2]; /* reduced write current from cyl */
- int wp[2]; /* write precompensation from cyl */
- int heads[2]; /* heads */
- int ecc[2]; /* ECC bytes */
-
- /* indexes */
- int cylinder[2]; /* current cylinder */
- int head[2]; /* current head */
- int sector[2]; /* current sector */
- int sector_cnt[2]; /* sector count */
- int control[2]; /* control */
-
- int csb; /* command status byte */
- int status; /* drive status */
- int error; /* error code */
- int dip; /* dip switches */
- emu_timer *timer;
-
- int data_cnt; /* data count */
- dynamic_buffer buffer; /* data buffer */
- UINT8 *buffer_ptr; /* data pointer */
- UINT8 hdc_control;
-
- UINT8 hdcdma_data[512];
- UINT8 *hdcdma_src;
- UINT8 *hdcdma_dst;
- int hdcdma_read;
- int hdcdma_write;
- int hdcdma_size;
-
- // internal state
public:
virtual UINT8 dack_r(int line);
virtual void dack_w(int line,UINT8 data);
-protected:
- hard_disk_file *pc_hdc_file(int id);
- void pc_hdc_result(int set_error_info);
- int no_dma(void);
- int get_lbasector();
- int pc_hdc_dack_r();
- void pc_hdc_dack_w(int data);
- void pc_hdc_dack_ws(int data);
- void execute_read();
- void execute_write();
- void execute_writesbuff();
- void get_drive();
- void get_chsn();
- int test_ready();
-
- enum {
- STANDARD,
- EC1841
- };
- int m_type;
-public:
- void hdc_command();
- void pc_hdc_data_w(int data);
- void pc_hdc_reset_w(int data);
- void pc_hdc_select_w(int data);
- void pc_hdc_control_w(int data);
- UINT8 pc_hdc_data_r();
- UINT8 pc_hdc_status_r();
UINT8 pc_hdc_dipswitch_r();
+
+ int dip; /* dip switches */
};
@@ -114,6 +172,11 @@ class isa8_hdc_ec1841_device : public isa8_hdc_device
{
public:
isa8_hdc_ec1841_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ // optional information overrides
+ virtual machine_config_constructor device_mconfig_additions() const;
+
+ required_device<ec1841_device> m_hdc;
};
// device type definition
diff --git a/src/emu/bus/isa/ibm_mfc.c b/src/emu/bus/isa/ibm_mfc.c
index bfe265f9e10..293162aa70a 100644
--- a/src/emu/bus/isa/ibm_mfc.c
+++ b/src/emu/bus/isa/ibm_mfc.c
@@ -44,7 +44,7 @@ enum
PC_IRQ_TIMERA,
PC_IRQ_TIMERB,
PC_IRQ_RXRDY,
- PC_IRQ_TXRDY,
+ PC_IRQ_TXRDY
};
enum
@@ -53,7 +53,7 @@ enum
Z80_IRQ_RXRDY,
Z80_IRQ_TXRDY,
Z80_IRQ_MIDI_RXRDY,
- Z80_IRQ_MIDI_TXRDY,
+ Z80_IRQ_MIDI_TXRDY
};
diff --git a/src/emu/bus/isa/mc1502_fdc.c b/src/emu/bus/isa/mc1502_fdc.c
index a24e487e43c..ada13d1d4ec 100644
--- a/src/emu/bus/isa/mc1502_fdc.c
+++ b/src/emu/bus/isa/mc1502_fdc.c
@@ -39,7 +39,7 @@ static SLOT_INTERFACE_START( mc1502_floppies )
SLOT_INTERFACE_END
static MACHINE_CONFIG_FRAGMENT( mc1502_fdc )
- MCFG_FD1793x_ADD("fdc", XTAL_16MHz / 16)
+ MCFG_FD1793_ADD("fdc", XTAL_16MHz / 16)
MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(mc1502_fdc_device, mc1502_fdc_irq_drq))
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(mc1502_fdc_device, mc1502_fdc_irq_drq))
MCFG_FLOPPY_DRIVE_ADD("fdc:0", mc1502_floppies, "525qd", mc1502_fdc_device::floppy_formats)
diff --git a/src/emu/bus/isa/omti8621.c b/src/emu/bus/isa/omti8621.c
index 5478737a38d..96b1214ff85 100644
--- a/src/emu/bus/isa/omti8621.c
+++ b/src/emu/bus/isa/omti8621.c
@@ -140,7 +140,7 @@ enum {
OMTI_STATE_SELECTION,
OMTI_STATE_COMMAND,
OMTI_STATE_DATA,
- OMTI_STATE_STATUS,
+ OMTI_STATE_STATUS
};
// OMTI commands
@@ -1285,7 +1285,7 @@ omti_disk_image_device::omti_disk_image_device(const machine_config &mconfig, co
void omti_disk_image_device::device_config_complete()
{
update_names(OMTI_DISK, "disk", "disk");
-};
+}
/***************************************************************************
diff --git a/src/emu/bus/isa/p1_fdc.c b/src/emu/bus/isa/p1_fdc.c
index 80e2ebb77c9..4ba01ed47da 100644
--- a/src/emu/bus/isa/p1_fdc.c
+++ b/src/emu/bus/isa/p1_fdc.c
@@ -39,7 +39,7 @@ static SLOT_INTERFACE_START( poisk1_floppies )
SLOT_INTERFACE_END
static MACHINE_CONFIG_FRAGMENT( fdc_b504 )
- MCFG_FD1793x_ADD("fdc", XTAL_16MHz / 16)
+ MCFG_FD1793_ADD("fdc", XTAL_16MHz / 16)
MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(p1_fdc_device, p1_fdc_irq_drq))
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(p1_fdc_device, p1_fdc_irq_drq))
MCFG_FLOPPY_DRIVE_ADD("fdc:0", poisk1_floppies, "525qd", p1_fdc_device::floppy_formats)
diff --git a/src/emu/bus/isa/sblaster.c b/src/emu/bus/isa/sblaster.c
index b37067a2923..9b02d91b5c4 100644
--- a/src/emu/bus/isa/sblaster.c
+++ b/src/emu/bus/isa/sblaster.c
@@ -29,6 +29,7 @@
pro audio spectrum 16: 1 OPL3
2 x saa1099 chips
+ inherited from game blaster
also on sound blaster 1.0
option on sound blaster 1.5
@@ -65,10 +66,10 @@ static MACHINE_CONFIG_FRAGMENT( sblaster1_0_config )
MCFG_SOUND_ADD("ym3812", YM3812, ym3812_StdClock)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 3.00)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 3.00)
- MCFG_SAA1099_ADD("saa1099.1", 4772720)
+ MCFG_SAA1099_ADD("saa1099.1", 7159000)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50)
- MCFG_SAA1099_ADD("saa1099.2", 4772720)
+ MCFG_SAA1099_ADD("saa1099.2", 7159000)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50)
@@ -150,8 +151,8 @@ WRITE8_MEMBER( isa8_sblaster1_0_device::saa1099_1_16_w )
{
switch(offset)
{
- case 0 : m_saa1099_1->control_w( space, offset, data ); break;
- case 1 : m_saa1099_1->data_w( space, offset, data ); break;
+ case 0 : m_saa1099_1->data_w( space, offset, data ); break;
+ case 1 : m_saa1099_1->control_w( space, offset, data ); break;
}
}
@@ -159,8 +160,8 @@ WRITE8_MEMBER( isa8_sblaster1_0_device::saa1099_2_16_w )
{
switch(offset)
{
- case 0 : m_saa1099_2->control_w( space, offset, data ); break;
- case 1 : m_saa1099_2->data_w( space, offset, data ); break;
+ case 0 : m_saa1099_2->data_w( space, offset, data ); break;
+ case 1 : m_saa1099_2->control_w( space, offset, data ); break;
}
}
diff --git a/src/emu/bus/isa/sc499.c b/src/emu/bus/isa/sc499.c
index 6289044e261..ea6969afe1a 100644
--- a/src/emu/bus/isa/sc499.c
+++ b/src/emu/bus/isa/sc499.c
@@ -1287,7 +1287,7 @@ sc499_ctape_image_device::sc499_ctape_image_device(const machine_config &mconfig
void sc499_ctape_image_device::device_config_complete()
{
update_names(SC499_CTAPE, "ctape", "ct");
-};
+}
UINT8 *sc499_ctape_image_device::read_block(int block_num)
diff --git a/src/emu/bus/isbx/isbx.h b/src/emu/bus/isbx/isbx.h
index d3f15098ee7..5124b4fde60 100644
--- a/src/emu/bus/isbx/isbx.h
+++ b/src/emu/bus/isbx/isbx.h
@@ -83,7 +83,9 @@ public:
virtual void mcs1_w(address_space &space, offs_t offset, UINT8 data) { }
virtual UINT8 mdack_r(address_space &space, offs_t offset) { return 0xff; }
virtual void mdack_w(address_space &space, offs_t offset, UINT8 data) { }
+ virtual int opt0_r() { return 1; }
virtual void opt0_w(int state) { }
+ virtual int opt1_r() { return 1; }
virtual void opt1_w(int state) { }
virtual void tdma_w(int state) { }
virtual void mclk_w(int state) { }
@@ -115,7 +117,9 @@ public:
DECLARE_READ8_MEMBER( mdack_r ) { return m_card ? m_card->mdack_r(space, offset) : 0xff; }
DECLARE_WRITE8_MEMBER( mdack_w ) { if (m_card) m_card->mdack_w(space, offset, data); }
DECLARE_READ_LINE_MEMBER( mpst_r ) { return m_card == NULL; }
+ DECLARE_READ_LINE_MEMBER( opt0_r ) { return m_card ? m_card->opt0_r() : 1; }
DECLARE_WRITE_LINE_MEMBER( opt0_w ) { if (m_card) m_card->opt0_w(state); }
+ DECLARE_READ_LINE_MEMBER( opt1_r ) { return m_card ? m_card->opt1_r() : 1; }
DECLARE_WRITE_LINE_MEMBER( opt1_w ) { if (m_card) m_card->opt1_w(state); }
DECLARE_WRITE_LINE_MEMBER( tdma_w ) { if (m_card) m_card->tdma_w(state); }
DECLARE_WRITE_LINE_MEMBER( mclk_w ) { if (m_card) m_card->mclk_w(state); }
diff --git a/src/emu/bus/kc/d004.h b/src/emu/bus/kc/d004.h
index 6f120ecfe71..79f45cba03a 100644
--- a/src/emu/bus/kc/d004.h
+++ b/src/emu/bus/kc/d004.h
@@ -11,7 +11,6 @@
#include "cpu/z80/z80.h"
#include "machine/upd765.h"
#include "machine/ataintf.h"
-#include "formats/basicdsk.h"
#include "imagedev/harddriv.h"
diff --git a/src/emu/bus/megadrive/md_slot.c b/src/emu/bus/megadrive/md_slot.c
index b53419b5528..6caa7df817f 100644
--- a/src/emu/bus/megadrive/md_slot.c
+++ b/src/emu/bus/megadrive/md_slot.c
@@ -552,7 +552,7 @@ int base_md_cart_slot_device::load_nonlist()
void base_md_cart_slot_device::call_unload()
{
- if (m_cart && m_cart->get_nvram_size())
+ if (m_cart && m_cart->get_nvram_base() && m_cart->get_nvram_size())
battery_save(m_cart->get_nvram_base(), m_cart->get_nvram_size());
}
@@ -995,7 +995,7 @@ void base_md_cart_slot_device::file_logging(UINT8 *ROM8, UINT32 rom_len, UINT32
logerror("FILE DETAILS\n");
logerror("============\n");
logerror("Name: %s\n", basename());
- logerror("File Size: 0x%" I64FMT "x\n", (software_entry() == NULL) ? length() : get_software_region_length("rom"));
+ logerror("File Size: 0x%08x\n", (software_entry() == NULL) ? (int)length() : (int)get_software_region_length("rom"));
logerror("Detected type: %s\n", md_get_slot(m_type));
logerror("ROM (Allocated) Size: 0x%X\n", rom_len);
logerror("NVRAM: %s\n", nvram_len ? "Yes" : "No");
diff --git a/src/emu/bus/msx_cart/cartridge.c b/src/emu/bus/msx_cart/cartridge.c
index c8dfb3da9b8..9415ab2f3c0 100644
--- a/src/emu/bus/msx_cart/cartridge.c
+++ b/src/emu/bus/msx_cart/cartridge.c
@@ -16,6 +16,7 @@
#include "konami.h"
#include "korean.h"
#include "majutsushi.h"
+#include "moonsound.h"
#include "msx_audio.h"
#include "msxdos2.h"
#include "nomapper.h"
@@ -61,6 +62,7 @@ SLOT_INTERFACE_START(msx_cart)
SLOT_INTERFACE_INTERNAL("disk_fsfd1a", MSX_CART_FSFD1A)
SLOT_INTERFACE_INTERNAL("disk_fscf351", MSX_CART_FSCF351)
SLOT_INTERFACE("bm_012", MSX_CART_BM_012)
+ SLOT_INTERFACE("moonsound", MSX_CART_MOONSOUND)
SLOT_INTERFACE_END
diff --git a/src/emu/bus/msx_cart/disk.c b/src/emu/bus/msx_cart/disk.c
index 44c3db577b5..64bc061ba35 100644
--- a/src/emu/bus/msx_cart/disk.c
+++ b/src/emu/bus/msx_cart/disk.c
@@ -198,7 +198,7 @@ static MACHINE_CONFIG_FRAGMENT( vy0010 )
// HLT pulled high
// SSO/-ENMF + -DDEN + ENP + -5/8 - pulled low
// READY inverted in VY-0010 cartridge and pulled low on VY-0010/VY-0011 floppy drive
- MCFG_WD2793x_ADD("fdc", XTAL_4MHz / 4)
+ MCFG_WD2793_ADD("fdc", XTAL_4MHz / 4)
MCFG_WD_FDC_FORCE_READY
// Single sided 3.5" floppy drive
@@ -220,7 +220,7 @@ machine_config_constructor msx_cart_vy0010::device_mconfig_additions() const
static MACHINE_CONFIG_FRAGMENT( fsfd1 )
- MCFG_WD2793x_ADD("fdc", XTAL_4MHz / 4)
+ MCFG_WD2793_ADD("fdc", XTAL_4MHz / 4)
// Double sided 3.5" floppy drive
MCFG_FLOPPY_DRIVE_ADD("fdc:0", msx_floppies, "35dd", msx_cart_disk::floppy_formats)
@@ -262,7 +262,7 @@ machine_config_constructor msx_cart_fsfd1a::device_mconfig_additions() const
static MACHINE_CONFIG_FRAGMENT( fscf351 )
- MCFG_MB8877x_ADD("fdc", XTAL_4MHz / 4)
+ MCFG_MB8877_ADD("fdc", XTAL_4MHz / 4)
MCFG_WD_FDC_FORCE_READY
// Double sided 3.5" floppy drive
diff --git a/src/emu/bus/msx_cart/konami.c b/src/emu/bus/msx_cart/konami.c
index 19378d18066..66045d4b39d 100644
--- a/src/emu/bus/msx_cart/konami.c
+++ b/src/emu/bus/msx_cart/konami.c
@@ -19,7 +19,7 @@ msx_cart_konami::msx_cart_konami(const machine_config &mconfig, const char *tag,
{
for (int i = 0; i < 4; i++)
{
- m_selected_bank[i] = 0;
+ m_selected_bank[i] = i;
}
for (int i = 0; i < 8; i++)
{
@@ -128,7 +128,7 @@ msx_cart_konami_scc::msx_cart_konami_scc(const machine_config &mconfig, const ch
{
for (int i = 0; i < 4; i++)
{
- m_selected_bank[i] = 0;
+ m_selected_bank[i] = i;
}
for (int i = 0; i < 8; i++)
{
diff --git a/src/emu/bus/msx_cart/moonsound.c b/src/emu/bus/msx_cart/moonsound.c
new file mode 100644
index 00000000000..b8601335917
--- /dev/null
+++ b/src/emu/bus/msx_cart/moonsound.c
@@ -0,0 +1,124 @@
+// license:BSD-3-Clause
+// copyright-holders:Wilbert Pol
+/**********************************************************************************
+
+TODO:
+- Properly hook up correct SRAM sizes for different moonsound compatible
+ cartridges. (Original moonsound has 128KB SRAM)
+- Fix FM support (ymf262 support needs to be added to ymf278b).
+
+**********************************************************************************/
+
+#include "emu.h"
+#include "moonsound.h"
+
+
+#define VERBOSE 0
+#define LOG(x) do { if (VERBOSE) logerror x; } while (0)
+
+
+const device_type MSX_CART_MOONSOUND = &device_creator<msx_cart_moonsound>;
+
+
+msx_cart_moonsound::msx_cart_moonsound(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, MSX_CART_MOONSOUND, "MSX Cartridge - MoonSound", tag, owner, clock, "msx_cart_moonsound", __FILE__)
+ , msx_cart_interface(mconfig, *this)
+ , m_ymf278b(*this, "ymf278b")
+{
+}
+
+
+static ADDRESS_MAP_START( ymf278b_map, AS_0, 8, msx_cart_moonsound )
+ AM_RANGE(0x000000, 0x1fffff) AM_ROM
+ AM_RANGE(0x200000, 0x3fffff) AM_RAM // 2MB sram for testing
+ADDRESS_MAP_END
+
+
+static MACHINE_CONFIG_FRAGMENT( moonsound )
+ // The moonsound cartridge has a separate stereo output.
+ MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_SOUND_ADD("ymf278b", YMF278B, YMF278B_STD_CLOCK)
+ MCFG_DEVICE_ADDRESS_MAP(AS_0, ymf278b_map)
+ MCFG_YMF278B_IRQ_HANDLER(WRITELINE(msx_cart_moonsound,irq_w))
+ MCFG_SOUND_ROUTE(0, "lspeaker", 0.50)
+ MCFG_SOUND_ROUTE(1, "rspeaker", 0.50)
+MACHINE_CONFIG_END
+
+
+machine_config_constructor msx_cart_moonsound::device_mconfig_additions() const
+{
+ return MACHINE_CONFIG_NAME( moonsound );
+}
+
+
+ROM_START( msx_cart_moonsound )
+ ROM_REGION(0x400000, "ymf278b", 0)
+ ROM_LOAD("yrw801.rom", 0x0, 0x200000, CRC(2a9d8d43) SHA1(32760893ce06dbe3930627755ba065cc3d8ec6ca))
+ROM_END
+
+
+const rom_entry *msx_cart_moonsound::device_rom_region() const
+{
+ return ROM_NAME( msx_cart_moonsound );
+}
+
+
+void msx_cart_moonsound::device_start()
+{
+ m_out_irq_cb.resolve_safe();
+
+ // Install IO read/write handlers
+ address_space &space = machine().device<cpu_device>("maincpu")->space(AS_IO);
+ space.install_readwrite_handler(0x7e, 0x7f, read8_delegate(FUNC(msx_cart_moonsound::read_ymf278b_pcm), this), write8_delegate(FUNC(msx_cart_moonsound::write_ymf278b_pcm), this));
+ space.install_readwrite_handler(0xc4, 0xc7, read8_delegate(FUNC(msx_cart_moonsound::read_ymf278b_fm), this), write8_delegate(FUNC(msx_cart_moonsound::write_ymf278b_fm), this));
+ space.install_read_handler(0xc0, 0xc0, read8_delegate(FUNC(msx_cart_moonsound::read_c0), this));
+}
+
+
+void msx_cart_moonsound::device_reset()
+{
+}
+
+
+WRITE_LINE_MEMBER(msx_cart_moonsound::irq_w)
+{
+ LOG(("moonsound: irq state %d\n", state));
+ m_out_irq_cb(state);
+}
+
+
+WRITE8_MEMBER(msx_cart_moonsound::write_ymf278b_fm)
+{
+ LOG(("moonsound: write 0x%02x, data 0x%02x\n", 0xc4 + offset, data));
+ m_ymf278b->write(space, offset, data);
+}
+
+
+READ8_MEMBER(msx_cart_moonsound::read_ymf278b_fm)
+{
+ LOG(("moonsound: read 0x%02x\n", 0xc4 + offset));
+ return m_ymf278b->read(space, offset);
+}
+
+
+WRITE8_MEMBER(msx_cart_moonsound::write_ymf278b_pcm)
+{
+ LOG(("moonsound: write 0x%02x, data 0x%02x\n", 0x7e + offset, data));
+ m_ymf278b->write(space, 4 + offset, data);
+}
+
+
+READ8_MEMBER(msx_cart_moonsound::read_ymf278b_pcm)
+{
+ LOG(("moonsound: read 0x%02x\n", 0x7e + offset));
+ return m_ymf278b->read(space, 4 + offset);
+}
+
+
+// For detecting presence of moonsound cartridge
+READ8_MEMBER(msx_cart_moonsound::read_c0)
+{
+ LOG(("moonsound: read 0xc0\n"));
+ return 0x00;
+}
+
diff --git a/src/emu/bus/msx_cart/moonsound.h b/src/emu/bus/msx_cart/moonsound.h
new file mode 100644
index 00000000000..930fedb363c
--- /dev/null
+++ b/src/emu/bus/msx_cart/moonsound.h
@@ -0,0 +1,38 @@
+// license:BSD-3-Clause
+// copyright-holders:Wilbert Pol
+#ifndef __MSX_CART_MOONSOUND_H
+#define __MSX_CART_MOONSOUND_H
+
+#include "bus/msx_cart/cartridge.h"
+#include "sound/ymf278b.h"
+
+
+extern const device_type MSX_CART_MOONSOUND;
+
+
+class msx_cart_moonsound : public device_t
+ , public msx_cart_interface
+{
+public:
+ msx_cart_moonsound(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ // device-level overrides
+ virtual void device_start();
+ virtual void device_reset();
+ virtual machine_config_constructor device_mconfig_additions() const;
+ virtual const rom_entry *device_rom_region() const;
+
+ DECLARE_WRITE8_MEMBER(write_ymf278b_fm);
+ DECLARE_READ8_MEMBER(read_ymf278b_fm);
+ DECLARE_WRITE8_MEMBER(write_ymf278b_pcm);
+ DECLARE_READ8_MEMBER(read_ymf278b_pcm);
+ DECLARE_READ8_MEMBER(read_c0);
+ DECLARE_WRITE_LINE_MEMBER(irq_w);
+
+private:
+ required_device<ymf278b_device> m_ymf278b;
+
+};
+
+
+#endif
diff --git a/src/emu/bus/msx_slot/cartridge.c b/src/emu/bus/msx_slot/cartridge.c
index d6ddbe5bda8..a7d79be1a51 100644
--- a/src/emu/bus/msx_slot/cartridge.c
+++ b/src/emu/bus/msx_slot/cartridge.c
@@ -328,6 +328,7 @@ void msx_slot_cartridge_device::get_default_card_software(std::string &result)
if (type == NOMAPPER)
{
// Not identified through hashfile, try automatic detection
+ core_fread(m_file, &rom[0], length);
type = get_cart_type(&rom[0], length);
}
diff --git a/src/emu/bus/nasbus/floppy.c b/src/emu/bus/nasbus/floppy.c
index e47e67224c5..cf68765a0ae 100644
--- a/src/emu/bus/nasbus/floppy.c
+++ b/src/emu/bus/nasbus/floppy.c
@@ -39,7 +39,7 @@ SLOT_INTERFACE_END
//-------------------------------------------------
static MACHINE_CONFIG_FRAGMENT( nascom_fdc )
- MCFG_FD1793x_ADD("fd1793", XTAL_16MHz / 4 / 4)
+ MCFG_FD1793_ADD("fd1793", XTAL_16MHz / 4 / 4)
MCFG_FLOPPY_DRIVE_ADD("fd1793:0", nascom_floppies, "55f", nascom_fdc_device::floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("fd1793:1", nascom_floppies, "55f", nascom_fdc_device::floppy_formats)
diff --git a/src/emu/bus/nubus/nubus_image.c b/src/emu/bus/nubus/nubus_image.c
index 4a49cdac04c..6b929c98270 100644
--- a/src/emu/bus/nubus/nubus_image.c
+++ b/src/emu/bus/nubus/nubus_image.c
@@ -77,7 +77,7 @@ messimg_disk_image_device::messimg_disk_image_device(const machine_config &mconf
void messimg_disk_image_device::device_config_complete()
{
update_names(MESSIMG_DISK, "disk", "disk");
-};
+}
/*-------------------------------------------------
@@ -215,6 +215,8 @@ void nubus_image_device::device_start()
filectx.curdir[0] = '.';
filectx.curdir[1] = '\0';
+ filectx.dirp = NULL;
+ filectx.fd = NULL;
}
//-------------------------------------------------
@@ -280,7 +282,7 @@ WRITE32_MEMBER( nubus_image_device::file_cmd_w )
strcpy((char*)filectx.filename, (char*)filectx.curdir);
break;
case kFileCmdSetDir:
- if(filectx.filename[0] == '/') {
+ if ((filectx.filename[0] == '/') || (filectx.filename[0] == '$')) {
strcpy((char*)filectx.curdir, (char*)filectx.filename);
} else {
strcat((char*)filectx.curdir, "/");
@@ -291,10 +293,15 @@ WRITE32_MEMBER( nubus_image_device::file_cmd_w )
if(filectx.dirp) osd_closedir(filectx.dirp);
filectx.dirp = osd_opendir((const char *)filectx.curdir);
case kFileCmdGetNextListing:
- dp = osd_readdir(filectx.dirp);
- if(dp) {
- strncpy((char*)filectx.filename, dp->name, sizeof(filectx.filename));
- } else {
+ if (filectx.dirp) {
+ dp = osd_readdir(filectx.dirp);
+ if(dp) {
+ strncpy((char*)filectx.filename, dp->name, sizeof(filectx.filename));
+ } else {
+ memset(filectx.filename, 0, sizeof(filectx.filename));
+ }
+ }
+ else {
memset(filectx.filename, 0, sizeof(filectx.filename));
}
break;
diff --git a/src/emu/bus/nubus/nubus_radiustpd.c b/src/emu/bus/nubus/nubus_radiustpd.c
index 1ace166e020..3b30fc4a384 100644
--- a/src/emu/bus/nubus/nubus_radiustpd.c
+++ b/src/emu/bus/nubus/nubus_radiustpd.c
@@ -97,7 +97,7 @@ void nubus_radiustpd_device::device_start()
slotspace = get_slotspace();
- printf("[radiustpd %p] slotspace = %x\n", this, slotspace);
+ printf("[radiustpd %p] slotspace = %x\n", (void *)this, slotspace);
m_vram.resize(VRAM_SIZE);
m_vram32 = (UINT32 *)&m_vram[0];
diff --git a/src/emu/bus/nubus/nubus_wsportrait.c b/src/emu/bus/nubus/nubus_wsportrait.c
index 5dfaf45f6a2..3f00160ba40 100644
--- a/src/emu/bus/nubus/nubus_wsportrait.c
+++ b/src/emu/bus/nubus/nubus_wsportrait.c
@@ -100,7 +100,7 @@ void nubus_wsportrait_device::device_start()
slotspace = get_slotspace();
- printf("[wsportrait %p] slotspace = %x\n", this, slotspace);
+ printf("[wsportrait %p] slotspace = %x\n", (void *)this, slotspace);
m_vram.resize(VRAM_SIZE);
m_vram32 = (UINT32 *)&m_vram[0];
diff --git a/src/emu/bus/oricext/jasmin.c b/src/emu/bus/oricext/jasmin.c
index f8ddceddeec..c8fd1d81081 100644
--- a/src/emu/bus/oricext/jasmin.c
+++ b/src/emu/bus/oricext/jasmin.c
@@ -19,7 +19,7 @@ static SLOT_INTERFACE_START( jasmin_floppies )
SLOT_INTERFACE_END
static MACHINE_CONFIG_FRAGMENT( jasmin )
- MCFG_WD1770x_ADD("fdc", XTAL_8MHz)
+ MCFG_WD1770_ADD("fdc", XTAL_8MHz)
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(oricext_device, irq_w))
MCFG_FLOPPY_DRIVE_ADD("fdc:0", jasmin_floppies, "3dsdd", jasmin_device::floppy_formats)
diff --git a/src/emu/bus/oricext/microdisc.c b/src/emu/bus/oricext/microdisc.c
index 884cfb9c271..c66adfa555a 100644
--- a/src/emu/bus/oricext/microdisc.c
+++ b/src/emu/bus/oricext/microdisc.c
@@ -19,7 +19,7 @@ static SLOT_INTERFACE_START( microdisc_floppies )
SLOT_INTERFACE_END
static MACHINE_CONFIG_FRAGMENT( microdisc )
- MCFG_FD1793x_ADD("fdc", XTAL_8MHz/8)
+ MCFG_FD1793_ADD("fdc", XTAL_8MHz/8)
MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(microdisc_device, fdc_irq_w))
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(microdisc_device, fdc_drq_w))
MCFG_WD_FDC_HLD_CALLBACK(WRITELINE(microdisc_device, fdc_hld_w))
diff --git a/src/emu/bus/psx/ctlrport.h b/src/emu/bus/psx/ctlrport.h
index 2d02cf31c14..2e7a35d2d9d 100644
--- a/src/emu/bus/psx/ctlrport.h
+++ b/src/emu/bus/psx/ctlrport.h
@@ -39,7 +39,7 @@ protected:
enum
{
QUERY_PAD_STATE = 0x42,
- CONFIG_MODE = 0x43,
+ CONFIG_MODE = 0x43
};
private:
diff --git a/src/emu/bus/ql/sandy_superdisk.c b/src/emu/bus/ql/sandy_superdisk.c
index 548268edfef..cf334d6db67 100644
--- a/src/emu/bus/ql/sandy_superdisk.c
+++ b/src/emu/bus/ql/sandy_superdisk.c
@@ -81,7 +81,7 @@ WRITE_LINE_MEMBER( sandy_super_disk_t::busy_w )
//-------------------------------------------------
static MACHINE_CONFIG_FRAGMENT( sandy_super_disk )
- MCFG_DEVICE_ADD(WD1772_TAG, WD1772x, 8000000)
+ MCFG_DEVICE_ADD(WD1772_TAG, WD1772, 8000000)
MCFG_FLOPPY_DRIVE_ADD(WD1772_TAG":0", sandy_super_disk_floppies, "35dd", sandy_super_disk_t::floppy_formats)
MCFG_FLOPPY_DRIVE_ADD(WD1772_TAG":1", sandy_super_disk_floppies, NULL, sandy_super_disk_t::floppy_formats)
diff --git a/src/emu/bus/ql/sandy_superqboard.c b/src/emu/bus/ql/sandy_superqboard.c
index 51e338ea76c..3e5558302db 100644
--- a/src/emu/bus/ql/sandy_superqboard.c
+++ b/src/emu/bus/ql/sandy_superqboard.c
@@ -102,7 +102,7 @@ WRITE_LINE_MEMBER( sandy_superqboard_t::busy_w )
//-------------------------------------------------
static MACHINE_CONFIG_FRAGMENT( sandy_superqboard )
- MCFG_DEVICE_ADD(WD1772_TAG, WD1772x, XTAL_16MHz/2)
+ MCFG_DEVICE_ADD(WD1772_TAG, WD1772, XTAL_16MHz/2)
MCFG_FLOPPY_DRIVE_ADD(WD1772_TAG":0", sandy_superqboard_floppies, "35hd", sandy_superqboard_t::floppy_formats)
MCFG_FLOPPY_DRIVE_ADD(WD1772_TAG":1", sandy_superqboard_floppies, NULL, sandy_superqboard_t::floppy_formats)
diff --git a/src/emu/bus/ql/trumpcard.c b/src/emu/bus/ql/trumpcard.c
index 08217f04950..fa77ed23d53 100644
--- a/src/emu/bus/ql/trumpcard.c
+++ b/src/emu/bus/ql/trumpcard.c
@@ -85,7 +85,7 @@ FLOPPY_FORMATS_END
//-------------------------------------------------
static MACHINE_CONFIG_FRAGMENT( ql_trump_card )
- MCFG_DEVICE_ADD(WD1772_TAG, WD1772x, 8000000)
+ MCFG_DEVICE_ADD(WD1772_TAG, WD1772, 8000000)
MCFG_FLOPPY_DRIVE_ADD(WD1772_TAG":0", ql_trump_card_floppies, "35dd", ql_trump_card_t::floppy_formats)
MCFG_FLOPPY_DRIVE_ADD(WD1772_TAG":1", ql_trump_card_floppies, NULL, ql_trump_card_t::floppy_formats)
MACHINE_CONFIG_END
diff --git a/src/emu/bus/s100/dj2db.c b/src/emu/bus/s100/dj2db.c
index 061a0c07880..f32d32e3eb2 100644
--- a/src/emu/bus/s100/dj2db.c
+++ b/src/emu/bus/s100/dj2db.c
@@ -104,7 +104,7 @@ static MACHINE_CONFIG_FRAGMENT( s100_dj2db )
MCFG_DEVICE_ADD(BR1941_TAG, COM8116, XTAL_5_0688MHz)
MCFG_COM8116_FR_HANDLER(WRITELINE(s100_dj2db_device, fr_w))
- MCFG_MB8866x_ADD(MB8866_TAG, XTAL_10MHz/5)
+ MCFG_MB8866_ADD(MB8866_TAG, XTAL_10MHz/5)
MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(s100_dj2db_device, fdc_intrq_w))
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(s100_dj2db_device, fdc_drq_w))
diff --git a/src/emu/bus/sega8/mgear.h b/src/emu/bus/sega8/mgear.h
index ea8a9bce362..2e4afa40466 100644
--- a/src/emu/bus/sega8/mgear.h
+++ b/src/emu/bus/sega8/mgear.h
@@ -23,6 +23,7 @@ public:
virtual DECLARE_READ8_MEMBER(read_cart) { return m_subslot->read_cart(space, offset); }
virtual DECLARE_WRITE8_MEMBER(write_cart) { m_subslot->write_cart(space, offset, data); }
virtual DECLARE_WRITE8_MEMBER(write_mapper) { m_subslot->write_mapper(space, offset, data); }
+ virtual int get_lphaser_xoffs() { return m_subslot->m_cart ? m_subslot->m_cart->get_lphaser_xoffs() : -1; }
virtual machine_config_constructor device_mconfig_additions() const;
diff --git a/src/emu/bus/sega8/sega8_slot.c b/src/emu/bus/sega8/sega8_slot.c
index 0aa73d2c6c2..ac696a0ac95 100644
--- a/src/emu/bus/sega8/sega8_slot.c
+++ b/src/emu/bus/sega8/sega8_slot.c
@@ -410,7 +410,7 @@ bool sega8_cart_slot_device::call_load()
void sega8_cart_slot_device::call_unload()
{
- if (m_cart && m_cart->get_ram_size() && m_cart->get_has_battery())
+ if (m_cart && m_cart->get_ram_base() && m_cart->get_ram_size() && m_cart->get_has_battery())
battery_save(m_cart->get_ram_base(), m_cart->get_ram_size());
}
@@ -731,7 +731,7 @@ void sega8_cart_slot_device::internal_header_logging(UINT8 *ROM, UINT32 len, UIN
logerror("FILE DETAILS\n" );
logerror("============\n" );
logerror("Name: %s\n", basename());
- logerror("File Size: 0x%" I64FMT "x\n", (software_entry() == NULL) ? length() : get_software_region_length("rom"));
+ logerror("File Size: 0x%08x\n", (software_entry() == NULL) ? (int)length() : (int)get_software_region_length("rom"));
logerror("Detected type: %s\n", sega8_get_slot(m_type));
logerror("ROM (Allocated) Size: 0x%X\n", len);
logerror("RAM: %s\n", nvram_len ? "Yes" : "No");
diff --git a/src/emu/bus/sega8/sega8_slot.h b/src/emu/bus/sega8/sega8_slot.h
index 095dc6261f6..ac0fdd406cd 100644
--- a/src/emu/bus/sega8/sega8_slot.h
+++ b/src/emu/bus/sega8/sega8_slot.h
@@ -47,6 +47,7 @@ public:
virtual DECLARE_READ8_MEMBER(read_cart) { return 0xff; }
virtual DECLARE_WRITE8_MEMBER(write_cart) {}
virtual DECLARE_WRITE8_MEMBER(write_mapper) {}
+ virtual int get_lphaser_xoffs() { return m_lphaser_xoffs; }
// a few carts (for SG1000) acts as a RAM expansion, taking control of the system RAM in 0xc000-0xffff
virtual DECLARE_READ8_MEMBER(read_ram) { return 0xff; }
virtual DECLARE_WRITE8_MEMBER(write_ram) {}
@@ -61,7 +62,6 @@ public:
void set_late_battery(bool val) { m_late_battery_enable = val; }
bool get_late_battery() { return m_late_battery_enable; }
void set_lphaser_xoffs(int val) { m_lphaser_xoffs = val; }
- int get_lphaser_xoffs() { return m_lphaser_xoffs; }
void set_sms_mode(int val) { m_sms_mode = val; }
int get_sms_mode() { return m_sms_mode; }
diff --git a/src/emu/bus/snes_ctrl/multitap.c b/src/emu/bus/snes_ctrl/multitap.c
index a5c344a1147..7b5ad87bfbc 100644
--- a/src/emu/bus/snes_ctrl/multitap.c
+++ b/src/emu/bus/snes_ctrl/multitap.c
@@ -68,13 +68,13 @@ machine_config_constructor snes_multitap_device::device_mconfig_additions() cons
//-------------------------------------------------
snes_multitap_device::snes_multitap_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
- device_t(mconfig, SNES_MULTITAP, "Nintendo SNES / SFC Multitap Adapter", tag, owner, clock, "snes_joypad", __FILE__),
- device_snes_control_port_interface(mconfig, *this),
- m_port1(*this, "port1"),
- m_port2(*this, "port2"),
- m_port3(*this, "port3"),
- m_port4(*this, "port4"),
- m_cfg(*this, "CONFIG")
+ device_t(mconfig, SNES_MULTITAP, "Nintendo SNES / SFC Multitap Adapter", tag, owner, clock, "snes_multitap", __FILE__),
+ device_snes_control_port_interface(mconfig, *this),
+ m_port1(*this, "port1"),
+ m_port2(*this, "port2"),
+ m_port3(*this, "port3"),
+ m_port4(*this, "port4"),
+ m_cfg(*this, "CONFIG")
{
}
diff --git a/src/emu/bus/ti99_peb/bwg.c b/src/emu/bus/ti99_peb/bwg.c
index c4776777da0..d5504ff2283 100644
--- a/src/emu/bus/ti99_peb/bwg.c
+++ b/src/emu/bus/ti99_peb/bwg.c
@@ -31,7 +31,7 @@
Known issues (Feb 2014):
- 1. The BwG controller cannot run with the Geneve or other non-9900 computers.
+ - The BwG controller cannot run with the Geneve or other non-9900 computers.
The reason for that is the wait state logic. It assumes that when
executing MOVB @>5FF6,*R2, first a value from 5FF7 is attempted to be read,
just as the TI console does. In that case, wait states are inserted if
@@ -39,12 +39,6 @@
only and therefore circumvent the wait state generation. This is in fact
not an emulation glitch but the behavior of the real expansion card.
- Resolved issues (Feb 2014):
-
- 1. The BwG controller failed to read single-density disks. This only occurs
- with the legacy implementation because the modern floppy implementation
- reproduces the correct recording format on the medium, so the controller
- actually detects FM or MFM.
*******************************************************************************/
@@ -667,7 +661,7 @@ static SLOT_INTERFACE_START( bwg_floppies )
SLOT_INTERFACE_END
MACHINE_CONFIG_FRAGMENT( bwg_fdc )
- MCFG_WD1773x_ADD(FDC_TAG, XTAL_8MHz)
+ MCFG_WD1773_ADD(FDC_TAG, XTAL_8MHz)
MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(snug_bwg_device, fdc_irq_w))
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(snug_bwg_device, fdc_drq_w))
@@ -704,498 +698,3 @@ const rom_entry *snug_bwg_device::device_rom_region() const
}
const device_type TI99_BWG = &device_creator<snug_bwg_device>;
-
-// ==========================================================================
-
-#define FDCLEG_TAG "wd1773"
-
-/*
- Legacy implementation
-*/
-snug_bwg_legacy_device::snug_bwg_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : ti_expansion_card_device(mconfig, TI99_BWG_LEG, "SNUG BwG Floppy Controller LEGACY", tag, owner, clock, "ti99_bwg_leg", __FILE__),
- m_wd1773(*this, FDCLEG_TAG),
- m_clock(*this, CLOCK_TAG) { }
-
-/*
- Callback called at the end of DVENA pulse
-*/
-void snug_bwg_legacy_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
-{
- m_DVENA = CLEAR_LINE;
- set_ready_line();
-}
-
-
-/*
- Operate the wait state logic.
-*/
-void snug_bwg_legacy_device::set_ready_line()
-{
- // This is the wait state logic
- if (TRACE_SIGNALS) logerror("bwg: address=%04x, DRQ=%d, INTRQ=%d, MOTOR=%d\n", m_address & 0xffff, m_DRQ, m_IRQ, m_DVENA);
- line_state nready = (m_dataregLB && // Are we accessing 5ff7
- m_WAITena && // and the wait state generation is active (SBO 2)
- (m_DRQ==CLEAR_LINE) && // and we are waiting for a byte
- (m_IRQ==CLEAR_LINE) && // and there is no interrupt yet
- (m_DVENA==ASSERT_LINE) // and the motor is turning?
- )? ASSERT_LINE : CLEAR_LINE; // In that case, clear READY and thus trigger wait states
-
- if (TRACE_READY) if (nready==ASSERT_LINE) logerror("bwg: READY line = %d\n", (nready==CLEAR_LINE)? 1:0);
- m_slot->set_ready((nready==CLEAR_LINE)? ASSERT_LINE : CLEAR_LINE);
-}
-
-/*
- Callback, called from the controller chip whenever DRQ/IRQ state change
-*/
-WRITE_LINE_MEMBER( snug_bwg_legacy_device::intrq_w )
-{
- if (TRACE_SIGNALS) logerror("bwg: set intrq = %d\n", state);
- m_IRQ = (line_state)state;
-
- // Note that INTB is actually not used in the TI-99 family. But the
- // controller asserts the line nevertheless, probably intended for
- // use in another planned TI system
- m_slot->set_intb(state==ASSERT_LINE);
-
- // We need to explicitly set the READY line to release the datamux
- set_ready_line();
-}
-
-WRITE_LINE_MEMBER( snug_bwg_legacy_device::drq_w )
-{
- if (TRACE_SIGNALS) logerror("bwg: set drq = %d\n", state);
- m_DRQ = (line_state)state;
-
- // We need to explicitly set the READY line to release the datamux
- set_ready_line();
-}
-
-SETADDRESS_DBIN_MEMBER( snug_bwg_legacy_device::setaddress_dbin )
-{
- // Selection login in the PAL and some circuits on the board
-
- // Is the card being selected?
- m_address = offset;
- m_inDsrArea = ((m_address & m_select_mask)==m_select_value);
-
- if (!m_inDsrArea) return;
-
- if (TRACE_ADDRESS) logerror("bwg: set address = %04x\n", offset & 0xffff);
-
- // Is the WD chip on the card being selected?
- // We need the even and odd addresses for the wait state generation,
- // but only the even addresses when we access it
- m_WDsel0 = m_inDsrArea && !m_rtc_enabled
- && ((state==ASSERT_LINE && ((m_address & 0x1ff8)==0x1ff0)) // read
- || (state==CLEAR_LINE && ((m_address & 0x1ff8)==0x1ff8))); // write
-
- m_WDsel = m_WDsel0 && ((m_address & 1)==0);
-
- // Is the RTC selected on the card? (even addr)
- m_RTCsel = m_inDsrArea && m_rtc_enabled && ((m_address & 0x1fe1)==0x1fe0);
-
- // RTC disabled:
- // 5c00 - 5fef: RAM
- // 5ff0 - 5fff: Controller (f0 = status, f2 = track, f4 = sector, f6 = data)
-
- // RTC enabled:
- // 5c00 - 5fdf: RAM
- // 5fe0 - 5fff: Clock (even addr)
-
- // Is RAM selected? We just check for the last 1K and let the RTC or WD
- // just take control before
- m_lastK = m_inDsrArea && ((m_address & 0x1c00)==0x1c00);
-
- // Is the data register port of the WD being selected?
- // In fact, the address to read the data from is 5FF6, but the TI-99 datamux
- // fetches both bytes from 5FF7 and 5FF6, the odd one first. The BwG uses
- // the odd address to operate the READY line
- m_dataregLB = m_WDsel0 && ((m_address & 0x07)==0x07);
-
- // Clear or assert the outgoing READY line
- set_ready_line();
-}
-
-/*
- Read a byte from ROM, RAM, FDC, or RTC. See setaddress_dbin for selection
- logic.
-*/
-READ8Z_MEMBER(snug_bwg_legacy_device::readz)
-{
- if (m_inDsrArea && m_selected)
- {
- // 010x xxxx xxxx xxxx
- if (m_lastK)
- {
- // ...1 11xx xxxx xxxx
- if (m_rtc_enabled)
- {
- if (m_RTCsel)
- {
- // .... ..11 111x xxx0
- if (!space.debugger_access()) *value = m_clock->read(space, (m_address & 0x001e) >> 1);
- if (TRACE_RW) logerror("bwg: read RTC: %04x -> %02x\n", m_address & 0xffff, *value);
- }
- else
- {
- *value = m_buffer_ram[(m_ram_page<<10) | (m_address & 0x03ff)];
- if (TRACE_RW) logerror("bwg: read ram: %04x (page %d)-> %02x\n", m_address & 0xffff, m_ram_page, *value);
- }
- }
- else
- {
- if (m_WDsel)
- {
- // .... ..11 1111 0xx0
- // Note that the value is inverted again on the board,
- // so we can drop the inversion
- if (!space.debugger_access()) *value = m_wd1773->read(space, (m_address >> 1)&0x03);
- if (TRACE_RW) logerror("bwg: read FDC: %04x -> %02x\n", m_address & 0xffff, *value);
- if (TRACE_DATA)
- {
- if ((m_address & 0xffff)==0x5ff6) logerror("%02x ", *value);
- else logerror("\n%04x: %02x", m_address&0xffff, *value);
- }
- }
- else
- {
- *value = m_buffer_ram[(m_ram_page<<10) | (m_address & 0x03ff)];
- if (TRACE_RW) logerror("bwg: read ram: %04x (page %d)-> %02x\n", m_address & 0xffff, m_ram_page, *value);
- }
- }
- }
- else
- {
- *value = m_dsrrom[(m_rom_page<<13) | (m_address & 0x1fff)];
- if (TRACE_RW) logerror("bwg: read dsr: %04x (page %d)-> %02x\n", m_address & 0xffff, m_rom_page, *value);
- }
- }
-}
-
-/*
- Resets the drive geometry. This is required because the heuristic of
- the default implementation sets the drive geometry to the geometry
- of the medium.
-*/
-void snug_bwg_legacy_device::set_geometry(legacy_floppy_image_device *drive, floppy_type_t type)
-{
- // This assertion may fail when the names of the floppy devices change.
- // Unfortunately, the wd17xx device assumes the floppy drives at root
- // level, so we use an explicitly qualified tag. See peribox.h.
- assert(drive != NULL);
- drive->floppy_drive_set_geometry(type);
-}
-
-void snug_bwg_legacy_device::set_all_geometries(floppy_type_t type)
-{
- set_geometry(machine().device<legacy_floppy_image_device>(PFLOPPY_0), type);
- set_geometry(machine().device<legacy_floppy_image_device>(PFLOPPY_1), type);
- set_geometry(machine().device<legacy_floppy_image_device>(PFLOPPY_2), type);
-}
-
-/*
- Write a byte
- 4000 - 5bff: ROM, ignore write (4 banks)
-
- rtc disabled:
- 5c00 - 5fef: RAM
- 5ff0 - 5fff: Controller (f8 = command, fa = track, fc = sector, fe = data)
-
- rtc enabled:
- 5c00 - 5fdf: RAM
- 5fe0 - 5fff: Clock (even addr)
-*/
-WRITE8_MEMBER(snug_bwg_legacy_device::write)
-{
- if (m_inDsrArea && m_selected)
- {
- if (m_lastK)
- {
- if (m_rtc_enabled)
- {
- if (m_RTCsel)
- {
- // .... ..11 111x xxx0
- if (TRACE_RW) logerror("bwg: write RTC: %04x <- %02x\n", m_address & 0xffff, data);
- if (!space.debugger_access()) m_clock->write(space, (m_address & 0x001e) >> 1, data);
- }
- else
- {
- if (TRACE_RW) logerror("bwg: write ram: %04x (page %d) <- %02x\n", m_address & 0xffff, m_ram_page, data);
- m_buffer_ram[(m_ram_page<<10) | (m_address & 0x03ff)] = data;
- }
- }
- else
- {
- if (m_WDsel)
- {
- // .... ..11 1111 1xx0
- // Note that the value is inverted again on the board,
- // so we can drop the inversion
- if (TRACE_RW) logerror("bwg: write FDC: %04x <- %02x\n", m_address & 0xffff, data);
- if (!space.debugger_access()) m_wd1773->write(space, (m_address >> 1)&0x03, data);
- }
- else
- {
- if (TRACE_RW) logerror("bwg: write ram: %04x (page %d) <- %02x\n", m_address & 0xffff, m_ram_page, data);
- m_buffer_ram[(m_ram_page<<10) | (m_address & 0x03ff)] = data;
- }
- }
- }
- }
-}
-
-/*
- CRU read handler. *=inverted.
- bit 0: DSK4 connected*
- bit 1: DSK1 connected*
- bit 2: DSK2 connected*
- bit 3: DSK3 connected*
- bit 4: Dip 1
- bit 5: Dip 2
- bit 6: Dip 3
- bit 7: Dip 4
-*/
-READ8Z_MEMBER(snug_bwg_legacy_device::crureadz)
-{
- UINT8 reply = 0;
-
- if ((offset & 0xff00)==m_cru_base)
- {
- if ((offset & 0x00ff)==0)
- {
- // Assume that we have 4 drives connected
- // If we want to do that properly, we need to check the actually
- // available drives (not the images!). But why should we connect less?
- reply = 0x00;
-
- // DIP switches. Note that a closed switch means 0
- // xx01 1111 11 = only dsk1; 10 = 1+2, 01=1/2/3, 00=1-4
-
- if (m_dip1 != 0) reply |= 0x10;
- if (m_dip2 != 0) reply |= 0x20;
- reply |= (m_dip34 << 6);
- *value = ~reply;
- }
- else
- *value = 0;
- if (TRACE_CRU) logerror("bwg: Read CRU = %02x\n", *value);
- }
-}
-
-WRITE8_MEMBER(snug_bwg_legacy_device::cruwrite)
-{
- int drive, drivebit;
-
- if ((offset & 0xff00)==m_cru_base)
- {
- int bit = (offset >> 1) & 0x0f;
- switch (bit)
- {
- case 0:
- /* (De)select the card. Indicated by a LED on the board. */
- m_selected = (data != 0);
- if (TRACE_CRU) logerror("bwg: Map DSR (bit 0) = %d\n", m_selected);
- break;
-
- case 1:
- /* Activate motor */
- if (data && !m_strobe_motor)
- { /* on rising edge, set motor_running for 4.23s */
- if (TRACE_CRU) logerror("bwg: trigger motor (bit 1)\n");
- m_DVENA = ASSERT_LINE;
- m_motor_on_timer->adjust(attotime::from_msec(4230));
- }
- m_strobe_motor = (data != 0);
- break;
-
- case 2:
- /* Set disk ready/hold (bit 2) */
- // 0: ignore IRQ and DRQ
- // 1: TMS9900 is stopped until IRQ or DRQ are set
- // OR the motor stops rotating - rotates for 4.23s after write
- // to CRU bit 1
- if (TRACE_CRU) logerror("bwg: arm wait state logic (bit 2) = %d\n", data);
- m_WAITena = (data != 0);
- break;
-
- case 4:
- case 5:
- case 6:
- case 8:
- /* Select drive 0-2 (DSK1-DSK3) (bits 4-6) */
- /* Select drive 3 (DSK4) (bit 8) */
- drive = (bit == 8) ? 3 : (bit - 4); /* drive # (0-3) */
- if (TRACE_CRU) logerror("bwg: set drive (bit %d) = %d\n", bit, data);
- drivebit = 1<<drive;
-
- if (data != 0)
- {
- if ((m_DSEL & drivebit) == 0) /* select drive */
- {
- if (m_DSEL != 0)
- logerror("bwg: Multiple drives selected, %02x\n", m_DSEL);
- m_DSEL |= drivebit;
- m_wd1773->set_drive(drive);
- }
- }
- else
- m_DSEL &= ~drivebit;
- break;
-
- case 7:
- /* Select side of disk (bit 7) */
- m_SIDE = data;
- if (TRACE_CRU) logerror("bwg: set side (bit 7) = %d\n", data);
- m_wd1773->set_side(m_SIDE);
- break;
-
- case 10:
- /* double density enable (active low) */
- if (TRACE_CRU) logerror("bwg: set double density (bit 10) = %d\n", data);
- m_wd1773->dden_w((data != 0) ? ASSERT_LINE : CLEAR_LINE);
- break;
-
- case 11:
- /* EPROM A13 */
- if (data != 0)
- m_rom_page |= 1;
- else
- m_rom_page &= 0xfe; // 11111110
- if (TRACE_CRU) logerror("bwg: set ROM page (bit 11) = %d, page = %d\n", bit, m_rom_page);
- break;
-
- case 13:
- /* RAM A10 */
- m_ram_page = data;
- if (TRACE_CRU) logerror("bwg: set RAM page (bit 13) = %d, page = %d\n", bit, m_ram_page);
- break;
-
- case 14:
- /* Override FDC with RTC (active high) */
- if (TRACE_CRU) logerror("bwg: turn on RTC (bit 14) = %d\n", data);
- m_rtc_enabled = (data != 0);
- break;
-
- case 15:
- /* EPROM A14 */
- if (data != 0)
- m_rom_page |= 2;
- else
- m_rom_page &= 0xfd; // 11111101
- if (TRACE_CRU) logerror("bwg: set ROM page (bit 15) = %d, page = %d\n", bit, m_rom_page);
- break;
-
- case 3:
- if (TRACE_CRU) logerror("bwg: set head load (bit 3) = %d\n", data);
- break;
- case 9:
- case 12:
- /* Unused (bit 3, 9 & 12) */
- if (TRACE_CRU) logerror("bwg: set unknown bit %d = %d\n", bit, data);
- break;
- }
- }
-}
-
-void snug_bwg_legacy_device::device_start(void)
-{
- logerror("bwg: BWG start\n");
- m_dsrrom = memregion(DSRROM)->base();
- m_buffer_ram = memregion(BUFFER)->base();
- m_motor_on_timer = timer_alloc(MOTOR_TIMER);
- m_cru_base = 0x1100;
-}
-
-void snug_bwg_legacy_device::device_reset()
-{
- logerror("bwg: BWG reset\n");
-
- if (m_genmod)
- {
- m_select_mask = 0x1fe000;
- m_select_value = 0x174000;
- }
- else
- {
- m_select_mask = 0x7e000;
- m_select_value = 0x74000;
- }
-
- m_strobe_motor = false;
- m_DVENA = CLEAR_LINE;
- m_DSEL = 0;
- m_SIDE = 0;
- ti99_set_80_track_drives(FALSE);
- floppy_type_t type = FLOPPY_STANDARD_5_25_DSDD_40;
- set_all_geometries(type);
- m_DRQ = CLEAR_LINE;
- m_IRQ = CLEAR_LINE;
- m_WAITena = false;
- m_rtc_enabled = false;
- m_selected = false;
- m_dataregLB = false;
- m_inDsrArea = false;
-
- m_dip1 = ioport("BWGDIP1")->read();
- m_dip2 = ioport("BWGDIP2")->read();
- m_dip34 = ioport("BWGDIP34")->read();
-
- m_rom_page = 0;
- m_ram_page = 0;
-}
-
-INPUT_PORTS_START( bwg_fdc_legacy )
- PORT_START( "BWGDIP1" )
- PORT_DIPNAME( 0x01, 0x00, "BwG step rate" )
- PORT_DIPSETTING( 0x00, "6 ms")
- PORT_DIPSETTING( 0x01, "20 ms")
-
- PORT_START( "BWGDIP2" )
- PORT_DIPNAME( 0x01, 0x00, "BwG date/time display" )
- PORT_DIPSETTING( 0x00, "Hide")
- PORT_DIPSETTING( 0x01, "Show")
-
- PORT_START( "BWGDIP34" )
- PORT_DIPNAME( 0x03, 0x03, "BwG drives" )
- PORT_DIPSETTING( 0x00, "DSK1 only")
- PORT_DIPSETTING( 0x01, "DSK1-DSK2")
- PORT_DIPSETTING( 0x02, "DSK1-DSK3")
- PORT_DIPSETTING( 0x03, "DSK1-DSK4")
-INPUT_PORTS_END
-
-MACHINE_CONFIG_FRAGMENT( bwg_fdc_legacy )
- MCFG_DEVICE_ADD(FDCLEG_TAG, WD1773, 0)
- MCFG_WD17XX_DEFAULT_DRIVE4_TAGS
- MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(snug_bwg_legacy_device, intrq_w))
- MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(snug_bwg_legacy_device, drq_w))
-
- MCFG_DEVICE_ADD(CLOCK_TAG, MM58274C, 0)
- MCFG_MM58274C_MODE24(1) // 24 hour
- MCFG_MM58274C_DAY1(0) // sunday
-MACHINE_CONFIG_END
-
-ROM_START( bwg_fdc_legacy )
- ROM_REGION(0x8000, DSRROM, 0)
- ROM_LOAD("bwg.bin", 0x0000, 0x8000, CRC(06f1ec89) SHA1(6ad77033ed268f986d9a5439e65f7d391c4b7651)) /* BwG disk DSR ROM */
- ROM_REGION(0x0800, BUFFER, 0) /* BwG RAM buffer */
- ROM_FILL(0x0000, 0x0400, 0x00)
-ROM_END
-
-machine_config_constructor snug_bwg_legacy_device::device_mconfig_additions() const
-{
- return MACHINE_CONFIG_NAME( bwg_fdc_legacy );
-}
-
-const rom_entry *snug_bwg_legacy_device::device_rom_region() const
-{
- return ROM_NAME( bwg_fdc_legacy );
-}
-
-ioport_constructor snug_bwg_legacy_device::device_input_ports() const
-{
- return INPUT_PORTS_NAME( bwg_fdc_legacy );
-}
-
-const device_type TI99_BWG_LEG = &device_creator<snug_bwg_legacy_device>;
diff --git a/src/emu/bus/ti99_peb/bwg.h b/src/emu/bus/ti99_peb/bwg.h
index 28e2f2f6dc6..a1012e06257 100644
--- a/src/emu/bus/ti99_peb/bwg.h
+++ b/src/emu/bus/ti99_peb/bwg.h
@@ -20,9 +20,6 @@
extern const device_type TI99_BWG;
-/*
- Implementation for modern floppy system.
-*/
class snug_bwg_device : public ti_expansion_card_device
{
public:
@@ -142,109 +139,4 @@ private:
// Debugging
bool m_debug_dataout;
};
-
-// =========================================================================
-
-/*
- Legacy implementation.
-*/
-
-#include "machine/wd17xx.h"
-
-extern const device_type TI99_BWG_LEG;
-
-class snug_bwg_legacy_device : public ti_expansion_card_device
-{
-public:
- snug_bwg_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
- DECLARE_READ8Z_MEMBER(readz);
- DECLARE_WRITE8_MEMBER(write);
- DECLARE_SETADDRESS_DBIN_MEMBER(setaddress_dbin);
-
- DECLARE_WRITE_LINE_MEMBER( intrq_w );
- DECLARE_WRITE_LINE_MEMBER( drq_w );
-
- DECLARE_READ8Z_MEMBER(crureadz);
- DECLARE_WRITE8_MEMBER(cruwrite);
-
-protected:
- virtual void device_start(void);
- virtual void device_reset(void);
- virtual const rom_entry *device_rom_region() const;
- virtual machine_config_constructor device_mconfig_additions() const;
- virtual ioport_constructor device_input_ports() const;
-
-private:
- void set_ready_line();
- void set_all_geometries(floppy_type_t type);
- void set_geometry(legacy_floppy_image_device *drive, floppy_type_t type);
- virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
-
- // Holds the status of the DRQ and IRQ lines.
- line_state m_DRQ, m_IRQ;
-
- // DIP switch state
- int m_dip1, m_dip2, m_dip34;
-
- // Page selection for ROM and RAM
- int m_ram_page; // 0-1
- int m_rom_page; // 0-3
-
- // When true, the READY line will be cleared (create wait states) when
- // waiting for data from the controller.
- bool m_WAITena;
-
- // Address in card area
- bool m_inDsrArea;
-
- // WD selected
- bool m_WDsel, m_WDsel0;
-
- // RTC selected
- bool m_RTCsel;
-
- // last 1K area selected
- bool m_lastK;
-
- // Data register +1 selected
- bool m_dataregLB;
-
- /* Indicates whether the clock is mapped into the address space. */
- bool m_rtc_enabled;
-
- /* When TRUE, keeps DVENA high. */
- bool m_strobe_motor;
-
- // Signal DVENA. When TRUE, makes some drive turning.
- line_state m_DVENA;
-
- // Recent address
- int m_address;
-
- /* Indicates which drive has been selected. Values are 0, 1, 2, and 4. */
- // 000 = no drive
- // 001 = drive 1
- // 010 = drive 2
- // 100 = drive 3
- int m_DSEL;
-
- /* Signal SIDSEL. 0 or 1, indicates the selected head. */
- int m_SIDE;
-
- // Link to the WD1773 controller on the board.
- required_device<wd1773_device> m_wd1773;
-
- // Link to the real-time clock on the board.
- required_device<mm58274c_device> m_clock;
-
- // count 4.23s from rising edge of motor_on
- emu_timer* m_motor_on_timer;
-
- // DSR ROM
- UINT8* m_dsrrom;
-
- // Buffer RAM
- UINT8* m_buffer_ram;
-};
-
#endif
diff --git a/src/emu/bus/ti99_peb/hfdc.c b/src/emu/bus/ti99_peb/hfdc.c
index e67172342ac..ed73221837a 100644
--- a/src/emu/bus/ti99_peb/hfdc.c
+++ b/src/emu/bus/ti99_peb/hfdc.c
@@ -46,13 +46,11 @@
HM 6264-LP15 - SRAM 8K x 8 (may also be 32K x 8)
27C128 - EPROM 16K x 8
- Author: Michael Zapf
- September 2014: Rewritten for modern floppy implementation
-
References:
[1] Myarc Inc.: Hard and Floppy Disk Controller / Users Manual
- WORK IN PROGRESS
+ Michael Zapf
+ July 2015
*****************************************************************************/
@@ -74,12 +72,12 @@
#define CLK_ADDR 0x0fe0
#define RAM_ADDR 0x1000
-#define TRACE_EMU 1
+#define TRACE_EMU 0
#define TRACE_CRU 0
#define TRACE_COMP 0
#define TRACE_RAM 0
#define TRACE_ROM 0
-#define TRACE_LINES 1
+#define TRACE_LINES 0
#define TRACE_MOTOR 0
#define TRACE_DMA 0
#define TRACE_INT 0
@@ -87,10 +85,10 @@
// =========================================================================
/*
- Modern implementation.
+ Constructor for the HFDC card.
*/
myarc_hfdc_device::myarc_hfdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : ti_expansion_card_device(mconfig, TI99_HFDC, "Myarc Hard and Floppy Disk Controller", tag, owner, clock, "ti99_hfdc_new", __FILE__),
+ : ti_expansion_card_device(mconfig, TI99_HFDC, "Myarc Hard and Floppy Disk Controller", tag, owner, clock, "ti99_hfdc", __FILE__),
m_hdc9234(*this, FDC_TAG),
m_clock(*this, CLOCK_TAG)
{
@@ -227,7 +225,9 @@ READ8Z_MEMBER(myarc_hfdc_device::readz)
// 0101 10xx xxxx xxxx bank 2
// 0101 11xx xxxx xxxx bank 3
int bank = (m_address & 0x0c00) >> 10;
- *value = m_buffer_ram[(m_ram_page[bank]<<10) | (m_address & 0x03ff)];
+
+ // If a DMA is in progress, do not respond
+ if (m_dip == CLEAR_LINE) *value = m_buffer_ram[(m_ram_page[bank]<<10) | (m_address & 0x03ff)];
if (TRACE_RAM)
{
if ((m_address & 1)==0) // only show even addresses with words
@@ -305,7 +305,9 @@ WRITE8_MEMBER( myarc_hfdc_device::write )
// 0101 11xx xxxx xxxx bank 3
int bank = (m_address & 0x0c00) >> 10;
if (TRACE_RAM) logerror("%s: %04x[%02x] <- %02x\n", tag(), m_address & 0xffff, m_ram_page[bank], data);
- m_buffer_ram[(m_ram_page[bank]<<10) | (m_address & 0x03ff)] = data;
+
+ // When a DMA is in progress, do not change anything
+ if (m_dip == CLEAR_LINE) m_buffer_ram[(m_ram_page[bank]<<10) | (m_address & 0x03ff)] = data;
return;
}
// The rest is ROM
@@ -510,17 +512,27 @@ void myarc_hfdc_device::floppy_index_callback(floppy_image_device *floppy, int s
*/
void myarc_hfdc_device::harddisk_index_callback(mfm_harddisk_device *harddisk, int state)
{
- /* if (TRACE_LINES) */ if (state==1) logerror("%s: HD index pulse\n", tag());
+ if (TRACE_LINES) if (state==1) logerror("%s: HD index pulse\n", tag());
set_bits(m_status_latch, HDC_DS_INDEX, (state==ASSERT_LINE));
signal_drive_status();
}
/*
+ This is called back from the hard disk when READY becomes asserted.
+*/
+void myarc_hfdc_device::harddisk_ready_callback(mfm_harddisk_device *harddisk, int state)
+{
+ if (TRACE_LINES) logerror("%s: HD READY = %d\n", tag(), state);
+ set_bits(m_status_latch, HDC_DS_READY, (state==ASSERT_LINE));
+ signal_drive_status();
+}
+
+/*
This is called back from the hard disk when seek_complete becomes asserted.
*/
void myarc_hfdc_device::harddisk_skcom_callback(mfm_harddisk_device *harddisk, int state)
{
- /* if (TRACE_LINES) */ if (state==1) logerror("%s: HD seek complete\n", tag());
+ if (TRACE_LINES) logerror("%s: HD seek complete = %d\n", tag(), state);
set_bits(m_status_latch, HDC_DS_SKCOM, (state==ASSERT_LINE));
signal_drive_status();
}
@@ -674,6 +686,7 @@ WRITE8_MEMBER( myarc_hfdc_device::auxbus_out )
// Dir = 0 -> outward
m_current_harddisk->direction_in_w((data & 0x20)? ASSERT_LINE : CLEAR_LINE);
m_current_harddisk->step_w((data & 0x10)? ASSERT_LINE : CLEAR_LINE);
+ m_current_harddisk->headsel_w(data & 0x0f);
}
// We are pushing the drive status after OUTPUT2
@@ -693,6 +706,8 @@ void myarc_hfdc_device::connect_floppy_unit(int index)
// Check if we have a new floppy
if (m_floppy_unit[index] != m_current_floppy)
{
+ // Clear all latched flags from other drives
+ m_status_latch = 0;
disconnect_floppy_drives();
if (TRACE_LINES) logerror("%s: Select floppy drive DSK%d\n", tag(), index+1);
@@ -718,6 +733,8 @@ void myarc_hfdc_device::connect_harddisk_unit(int index)
{
if (m_harddisk_unit[index] != m_current_harddisk)
{
+ // Clear all latched flags form other drives
+ m_status_latch = 0;
disconnect_hard_drives();
if (TRACE_LINES) logerror("%s: Select hard disk WDS%d\n", tag(), index+1);
@@ -728,6 +745,7 @@ void myarc_hfdc_device::connect_harddisk_unit(int index)
if (m_current_harddisk != NULL)
{
m_current_harddisk->setup_index_pulse_cb(mfm_harddisk_device::index_pulse_cb(FUNC(myarc_hfdc_device::harddisk_index_callback), this));
+ m_current_harddisk->setup_ready_cb(mfm_harddisk_device::ready_cb(FUNC(myarc_hfdc_device::harddisk_ready_callback), this));
m_current_harddisk->setup_seek_complete_cb(mfm_harddisk_device::seek_complete_cb(FUNC(myarc_hfdc_device::harddisk_skcom_callback), this));
}
else
@@ -820,7 +838,7 @@ WRITE_LINE_MEMBER( myarc_hfdc_device::dip_w )
}
/*
- Read a byte from the onboard SRAM
+ Read a byte from the onboard SRAM. This is called from the HDC9234.
*/
READ8_MEMBER( myarc_hfdc_device::read_buffer )
{
@@ -832,7 +850,7 @@ READ8_MEMBER( myarc_hfdc_device::read_buffer )
}
/*
- Write a byte to the onboard SRAM
+ Write a byte to the onboard SRAM. This is called from the HDC9234.
*/
WRITE8_MEMBER( myarc_hfdc_device::write_buffer )
{
@@ -993,8 +1011,10 @@ static SLOT_INTERFACE_START( hfdc_floppies )
SLOT_INTERFACE_END
static SLOT_INTERFACE_START( hfdc_harddisks )
- SLOT_INTERFACE( "generic", MFM_HD_GENERIC ) // Generic high-level emulation
-// SLOT_INTERFACE( "seagatemfm", MFM_HD_SEAGATE ) // Seagate ST-225 and others
+ SLOT_INTERFACE( "generic", MFMHD_GENERIC ) // Generic high-level emulation
+ SLOT_INTERFACE( "st213", MFMHD_ST213 ) // Seagate ST-213 (10 MB)
+ SLOT_INTERFACE( "st225", MFMHD_ST225 ) // Seagate ST-225 (20 MB)
+ SLOT_INTERFACE( "st251", MFMHD_ST251 ) // Seagate ST-251 (40 MB)
SLOT_INTERFACE_END
MACHINE_CONFIG_FRAGMENT( ti99_hfdc )
@@ -1012,9 +1032,9 @@ MACHINE_CONFIG_FRAGMENT( ti99_hfdc )
MCFG_FLOPPY_DRIVE_ADD("f4", hfdc_floppies, NULL, myarc_hfdc_device::floppy_formats)
// NB: Hard disks don't go without image (other than floppy drives)
- MCFG_MFM_HARDDISK_ADD("h1", hfdc_harddisks, NULL)
- MCFG_MFM_HARDDISK_ADD("h2", hfdc_harddisks, NULL)
- MCFG_MFM_HARDDISK_ADD("h3", hfdc_harddisks, NULL)
+ MCFG_MFM_HARDDISK_CONN_ADD("h1", hfdc_harddisks, NULL, MFM_BYTE, 3000, 20, MFMHD_TI99_FORMAT)
+ MCFG_MFM_HARDDISK_CONN_ADD("h2", hfdc_harddisks, NULL, MFM_BYTE, 2000, 20, MFMHD_TI99_FORMAT)
+ MCFG_MFM_HARDDISK_CONN_ADD("h3", hfdc_harddisks, NULL, MFM_BYTE, 2000, 20, MFMHD_TI99_FORMAT)
MCFG_DEVICE_ADD(CLOCK_TAG, MM58274C, 0)
MCFG_MM58274C_MODE24(1) // 24 hour
@@ -1045,569 +1065,3 @@ ioport_constructor myarc_hfdc_device::device_input_ports() const
}
const device_type TI99_HFDC = &device_creator<myarc_hfdc_device>;
-
-mfm_harddisk_connector::mfm_harddisk_connector(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock):
- device_t(mconfig, MFM_HD_CONNECTOR, "MFM hard disk connector", tag, owner, clock, "mfm_hd_connector", __FILE__),
- device_slot_interface(mconfig, *this)
-{
-}
-
-mfm_harddisk_connector::~mfm_harddisk_connector()
-{
-}
-
-mfm_harddisk_device *mfm_harddisk_connector::get_device()
-{
- return dynamic_cast<mfm_harddisk_device *>(get_card_device());
-}
-
-void mfm_harddisk_connector::device_start()
-{
-}
-
-const device_type MFM_HD_CONNECTOR = &device_creator<mfm_harddisk_connector>;
-
-// =========================================================================
-
-/*
- Legacy implementation.
-*/
-#define VERBOSE 1
-#define LOG logerror
-
-myarc_hfdc_legacy_device::myarc_hfdc_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : ti_expansion_card_device(mconfig, TI99_HFDC_LEG, "Myarc Hard and Floppy Disk Controller LEGACY", tag, owner, clock, "ti99_hfdc", __FILE__),
- m_hdc9234(*this, FDC_TAG),
- m_clock(*this, CLOCK_TAG)
-{
-}
-
-/*
- read a byte in disk DSR space
- HFDC manual, p. 44
- Memory map as seen by the 99/4A PEB
-
- 0x4000 - 0x4fbf one of four possible ROM pages
- 0x4fc0 - 0x4fcf tape select
- 0x4fd0 - 0x4fdf disk controller select
- 0x4fe0 - 0x4fff time chip select
-
- 0x5000 - 0x53ff static RAM page 0x10
- 0x5400 - 0x57ff static RAM page any of 32 pages
- 0x5800 - 0x5bff static RAM page any of 32 pages
- 0x5c00 - 0x5fff static RAM page any of 32 pages
-*/
-READ8Z_MEMBER(myarc_hfdc_legacy_device::readz)
-{
- if (m_selected && ((offset & m_select_mask)==m_select_value))
- {
- /* DSR region */
- if ((offset & 0x1000)==0x0000)
- {
- if ((offset & 0x0fc0)==0x0fc0)
- {
- // Tape: 4fc0...4fcf
- if ((offset & 0x1ff0)==TAPE_ADDR)
- {
- if (VERBOSE>0) LOG("ti99: HFDC: Tape support not available (access to address %04x)\n", offset&0xffff);
- return;
- }
-
- // HDC9234: 4fd0..4fdf / read: 4fd0,4 (mirror 8,c)
- // read: 0100 1111 1101 xx00
- if ((offset & 0x1ff3)==HDC_R_ADDR)
- {
- if (!space.debugger_access()) *value = m_hdc9234->read(space, (offset>>2)&1, mem_mask);
- if (VERBOSE>7) LOG("hfdc: read %04x: %02x\n", offset & 0xffff, *value);
- return;
- }
-
- if ((offset & 0x1fe1)==CLK_ADDR)
- {
- if (!space.debugger_access()) *value = m_clock->read(space, (offset & 0x001e) >> 1);
- if (VERBOSE>7) LOG("hfdc: read from clock address %04x: %02x\n", offset & 0xffff, *value);
- return;
- }
- }
- else
- {
- // ROM
- *value = m_dsrrom[(m_rom_page << 12) | (offset & 0x0fff)];
- if (VERBOSE>7) LOG("hfdc: reado %04x (%02x): %02x\n", offset & 0xffff, m_rom_page, *value);
- return;
- }
- }
-
- // RAM: 0101 xxxx xxxx xxxx
- if ((offset & 0x1000)==RAM_ADDR)
- {
- // 0101 00xx xxxx xxxx static 0x08
- // 0101 01xx xxxx xxxx bank 1
- // 0101 10xx xxxx xxxx bank 2
- // 0101 11xx xxxx xxxx bank 3
- int bank = (offset & 0x0c00) >> 10;
- *value = m_buffer_ram[(m_ram_page[bank]<<10) | (offset & 0x03ff)];
- if (VERBOSE>7) LOG("hfdc: read %04x (%02x): %02x\n", offset & 0xffff, m_ram_page[bank], *value);
- }
- }
-}
-
-/*
- Write a byte to the controller.
-*/
-WRITE8_MEMBER( myarc_hfdc_legacy_device::write )
-{
- if (m_selected && ((offset & m_select_mask)==m_select_value))
- {
- // Tape: 4fc0...4fcf
- if ((offset & 0x1ff0)==TAPE_ADDR)
- {
- if (VERBOSE>0) LOG("ti99: HFDC: Tape support not available (access to address %04x)\n", offset & 0xffff);
- return;
- }
-
- // HDC9234: 4fd0..4fdf / write: 4fd2,6 (mirror a,e)
- // write: 0100 1111 1101 xx10
- if ((offset & 0x1ff3)==HDC_W_ADDR)
- {
- if (VERBOSE>7) LOG("hfdc: write to controller address %04x: %02x\n", offset & 0xffff, data);
- if (!space.debugger_access()) m_hdc9234->write(space, (offset>>2)&1, data, mem_mask);
- return;
- }
-
- if ((offset & 0x1fe1)==CLK_ADDR)
- {
- if (VERBOSE>7) LOG("hfdc: write to clock address %04x: %02x\n", offset & 0xffff, data);
- if (!space.debugger_access()) m_clock->write(space, (offset & 0x001e) >> 1, data);
- return;
- }
-
- // RAM: 0101 xxxx xxxx xxxx
- if ((offset & 0x1000)==RAM_ADDR)
- {
- // 0101 00xx xxxx xxxx static 0x08
- // 0101 01xx xxxx xxxx bank 1
- // 0101 10xx xxxx xxxx bank 2
- // 0101 11xx xxxx xxxx bank 3
- int bank = (offset & 0x0c00) >> 10;
- if (VERBOSE>7) LOG("hfdc: WRITE %04x (%02x): %02x\n", (offset & 0xffff), m_ram_page[bank], data);
- m_buffer_ram[(m_ram_page[bank]<<10) | (offset & 0x03ff)] = data;
- }
- }
-}
-
-READ8Z_MEMBER(myarc_hfdc_legacy_device::crureadz)
-{
- UINT8 reply;
- if ((offset & 0xff00)==m_cru_base)
- {
- if ((offset & 0x00ff)==0) /* CRU bits 0-7 */
- {
- /* CRU bits */
- if (m_cru_select)
- {
- // DIP switches. Logic levels are inverted (on->0, off->1). CRU
- // bit order is the reverse of DIP-switch order, too (dip 1 -> bit 7,
- // dip 8 -> bit 0).
- // MZ: 00 should not be used since there is a bug in the
- // DSR of the HFDC which causes problems with SD disks
- // (controller tries DD and then fails to fall back to SD) */
- reply = ~(ioport("HFDCDIP")->read());
- }
- else
- {
- reply = 0;
-
- if (m_irq) reply |= 0x01;
- if (m_dip) reply |= 0x02;
- if (m_motor_running) reply |= 0x04;
- }
- *value = reply;
- }
- else /* CRU bits 8+ */
- *value = 0;
- if (VERBOSE>7) LOG("hfdc: reading from CRU %04x: %02x\n", offset, *value);
- }
-}
-
-/*
- Write disk CRU interface
- HFDC manual p. 43
-
- CRU rel. address Definition Active
- 00 Device Service Routine Select HIGH
- 02 Reset to controller chip LOW
- 04 Floppy Motor on / CD0 HIGH
- 06 ROM page select 0 / CD1
- 08 ROM page select 1 / CRU input select
- 12/4/6/8/A RAM page select at 0x5400
- 1C/E/0/2/4 RAM page select at 0x5800
- 26/8/A/C/E RAM page select at 0x5C00
-
- RAM bank select: bank 0..31; 12 = LSB (accordingly for other two areas)
- ROM bank select: bank 0..3; 06 = MSB, 07 = LSB
- Bit number = (CRU_rel_address - base_address)/2
- CD0 and CD1 are Clock Divider selections for the Floppy Data Separator (FDC9216)
-*/
-WRITE8_MEMBER(myarc_hfdc_legacy_device::cruwrite)
-{
- if ((offset & 0xff00)==m_cru_base)
- {
- if (VERBOSE>7) LOG("hfdc: writing to CRU %04x: %02x\n", offset, data);
- int bit = (offset >> 1) & 0x1f;
-
- if (bit >= 9 && bit < 24)
- {
- if (data)
- // we leave index 0 unchanged; modify indices 1-3
- m_ram_page[(bit-4)/5] |= 1 << ((bit-9)%5);
- else
- m_ram_page[(bit-4)/5] &= ~(1 << ((bit-9)%5));
-
- return;
- }
-
- switch (bit)
- {
- case 0:
- m_selected = (data!=0);
- if (VERBOSE>7) LOG("hfdc: selected = %d\n", m_selected);
- break;
-
- case 1:
- if (data==0) m_hdc9234->reset(); // active low
- break;
-
- case 2:
- m_CD0 = data;
- if (data != 0) m_motor_running = true;
- else
- {
- if (m_motor_running)
- {
- m_motor_on_timer->adjust(attotime::from_msec(4230));
- }
- }
- break;
-
- case 3:
- m_CD1 = data;
- if (data!=0) m_rom_page |= 2;
- else m_rom_page &= 0xfd;
- break;
-
- case 4:
- m_cru_select = (data!=0);
- if (data!=0) m_rom_page |= 1;
- else m_rom_page &= 0xfe;
- break;
-
- default:
- if (VERBOSE>1) LOG("ti99: HFDC: Attempt to set undefined CRU bit %d\n", bit);
- }
- }
-}
-
-
-int myarc_hfdc_legacy_device::slog2(int value)
-{
- int i=-1;
- while (value!=0)
- {
- value >>= 1;
- i++;
- }
- return i;
-}
-
-READ8_MEMBER( myarc_hfdc_legacy_device::auxbus_in )
-{
- UINT8 reply = 0;
- int index = 0;
-
- if ((m_output1_latch & 0xf0)==0)
- {
- if (VERBOSE>4) LOG("hfdc: no drive selected, returning 0\n");
- // No HD and no floppy
- return 0; /* is that the correct default value? */
- }
-
- // If a floppy is selected, we have one line set among the four programmable outputs.
- // Floppy selected <=> latch & 0x10 != 0; floppy number in last four bits
- if ((m_output1_latch & 0x10)!=0)
- {
- index = slog2(m_output1_latch & 0x0f);
- if (index==-1) return 0;
-
- /* Get floppy status. */
- if (m_floppy_unit[index]->floppy_drive_get_flag_state(FLOPPY_DRIVE_INDEX) == FLOPPY_DRIVE_INDEX)
- reply |= DS_INDEX;
- if (m_floppy_unit[index]->floppy_tk00_r() == CLEAR_LINE)
- reply |= DS_TRK00;
- if (m_floppy_unit[index]->floppy_wpt_r() == CLEAR_LINE)
- reply |= DS_WRPROT;
-
- /* if (image_exists(disk_img)) */
-
- reply |= DS_READY; /* Floppies don't have a READY line; line is pulled up */
- reply |= DS_SKCOM; /* Same here. */
- if (VERBOSE>4) LOG("hfdc: floppy selected, returning status %02x\n", reply);
- }
- else // one of the first three lines must be selected
- {
- UINT8 state;
- index = slog2((m_output1_latch>>4) & 0x0f)-1;
- mfm_harddisk_legacy_device *hd = m_harddisk_unit[index];
- state = hd->get_status();
-
- if (state & MFMHD_TRACK00) reply |= DS_TRK00;
- if (state & MFMHD_SEEKCOMP) reply |= DS_SKCOM;
- if (state & MFMHD_WRFAULT) reply |= DS_WRFAULT;
- if (state & MFMHD_INDEX) reply |= DS_INDEX;
- if (state & MFMHD_READY) reply |= DS_READY;
- if (VERBOSE>4) LOG("hfdc: hd selected, returning status %02x\n", reply);
- }
-
- return reply;
-}
-
-WRITE8_MEMBER( myarc_hfdc_legacy_device::auxbus_out )
-{
- int index;
- switch (offset)
- {
- case INPUT_STATUS:
- if (VERBOSE>1) LOG("ti99: HFDC: Invalid operation: S0=S1=0, but tried to write (expected: read drive status)\n");
- break;
-
- case OUTPUT_DMA_ADDR:
- /* Value is dma address byte. Shift previous contents to the left. */
- m_dma_address = ((m_dma_address << 8) + (data&0xff))&0xffffff;
- break;
-
- case OUTPUT_OUTPUT1:
- // value is output1
- // The HFDC interprets the value as follows:
- // WDS = Winchester Drive System, old name for hard disk
- // +------+------+------+------+------+------+------+------+
- // | WDS3 | WDS2 | WDS1 | DSKx | x=4 | x=3 | x=2 | x=1 |
- // +------+------+------+------+------+------+------+------+
- // Accordingly, drive 0 is always the floppy; selected by the low nibble
- if (data & 0x10)
- {
- // Floppy selected
- index = slog2(data & 0x0f);
- if (index>=0) m_hdc9234->connect_floppy_drive(m_floppy_unit[index]);
- }
- else
- {
- // HD selected
- index = slog2((data>>4) & 0x0f);
- if (index>=0) m_hdc9234->connect_hard_drive(m_harddisk_unit[index-1]);
- }
-
- m_output1_latch = data;
- break;
-
- case OUTPUT_OUTPUT2:
- /* value is output2 */
- m_output2_latch = data;
- break;
- }
-}
-
-/*
- Read a byte from buffer in DMA mode
-*/
-READ8_MEMBER( myarc_hfdc_legacy_device::read_buffer )
-{
- UINT8 value = m_buffer_ram[m_dma_address & 0x7fff];
- m_dma_address++;
- return value;
-}
-
-/*
- Write a byte to buffer in DMA mode
-*/
-WRITE8_MEMBER( myarc_hfdc_legacy_device::write_buffer )
-{
- m_buffer_ram[m_dma_address & 0x7fff] = data;
- m_dma_address++;
-}
-
-/*
- Called whenever the state of the sms9234 interrupt pin changes.
-*/
-WRITE_LINE_MEMBER( myarc_hfdc_legacy_device::intrq_w )
-{
- m_irq = state;
-
- // Set INTA*
- // Signal from SMC is active high, INTA* is active low; board inverts signal
- // Anyway, we keep with ASSERT_LINE and CLEAR_LINE
- m_slot->set_inta(state);
-}
-
-/*
- Called whenever the state of the sms9234 DMA in progress changes.
-*/
-WRITE_LINE_MEMBER( myarc_hfdc_legacy_device::dip_w )
-{
- m_dip = state;
-}
-
-/*
- Callback called at the end of DVENA pulse
-*/
-void myarc_hfdc_legacy_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
-{
- m_motor_running = false;
- if (VERBOSE>6) LOG("hfdc: motor off\n");
-}
-
-MACHINE_CONFIG_FRAGMENT( ti99_hfdc_legacy )
- MCFG_DEVICE_ADD(FDC_TAG, SMC92X4, 0)
- MCFG_SMC92X4_INTRQ_CALLBACK(WRITELINE(myarc_hfdc_legacy_device, intrq_w))
- MCFG_SMC92X4_DIP_CALLBACK(WRITELINE(myarc_hfdc_legacy_device, dip_w))
- MCFG_SMC92X4_AUXBUS_OUT_CALLBACK(WRITE8(myarc_hfdc_legacy_device, auxbus_out))
- MCFG_SMC92X4_AUXBUS_IN_CALLBACK(READ8(myarc_hfdc_legacy_device, auxbus_in))
- MCFG_SMC92X4_DMA_IN_CALLBACK(READ8(myarc_hfdc_legacy_device, read_buffer))
- MCFG_SMC92X4_DMA_OUT_CALLBACK(WRITE8(myarc_hfdc_legacy_device, write_buffer))
- MCFG_SMC92X4_FULL_TRACK_LAYOUT(FALSE) /* do not use the full track layout */
-
- MCFG_DEVICE_ADD(CLOCK_TAG, MM58274C, 0)
- MCFG_MM58274C_MODE24(1) // 24 hour
- MCFG_MM58274C_DAY1(0) // sunday
-
- MCFG_MFMHD_3_DRIVES_ADD() // add hard disks
-MACHINE_CONFIG_END
-
-ROM_START( ti99_hfdc_legacy )
- ROM_REGION(0x4000, DSRROM, 0)
- ROM_LOAD("hfdc.bin", 0x0000, 0x4000, CRC(66fbe0ed) SHA1(11df2ecef51de6f543e4eaf8b2529d3e65d0bd59)) /* HFDC disk DSR ROM */
- ROM_REGION(0x8000, BUFFER, 0) /* HFDC RAM buffer 32 KiB */
- ROM_FILL(0x0000, 0x8000, 0x00)
-ROM_END
-
-INPUT_PORTS_START( ti99_hfdc_legacy )
- PORT_START( "CRUHFDC" )
- PORT_DIPNAME( 0x1f00, 0x1100, "HFDC CRU base" )
- PORT_DIPSETTING( 0x1000, "1000" )
- PORT_DIPSETTING( 0x1100, "1100" )
- PORT_DIPSETTING( 0x1200, "1200" )
- PORT_DIPSETTING( 0x1300, "1300" )
- PORT_DIPSETTING( 0x1400, "1400" )
- PORT_DIPSETTING( 0x1500, "1500" )
- PORT_DIPSETTING( 0x1600, "1600" )
- PORT_DIPSETTING( 0x1700, "1700" )
- PORT_DIPSETTING( 0x1800, "1800" )
- PORT_DIPSETTING( 0x1900, "1900" )
- PORT_DIPSETTING( 0x1a00, "1A00" )
- PORT_DIPSETTING( 0x1b00, "1B00" )
- PORT_DIPSETTING( 0x1c00, "1C00" )
- PORT_DIPSETTING( 0x1d00, "1D00" )
- PORT_DIPSETTING( 0x1e00, "1E00" )
- PORT_DIPSETTING( 0x1f00, "1F00" )
-
- PORT_START( "HFDCDIP" )
- PORT_DIPNAME( 0xff, 0x55, "HFDC drive config" )
- PORT_DIPSETTING( 0x00, "40 track, 16 ms")
- PORT_DIPSETTING( 0xaa, "40 track, 8 ms")
- PORT_DIPSETTING( 0x55, "80 track, 2 ms")
- PORT_DIPSETTING( 0xff, "80 track HD, 2 ms")
-
- PORT_START( "DRVSPD" )
- PORT_CONFNAME( 0x01, 0x01, "Floppy and HD speed" )
- PORT_CONFSETTING( 0x00, "No delay")
- PORT_CONFSETTING( 0x01, "Realistic")
-INPUT_PORTS_END
-
-void myarc_hfdc_legacy_device::device_start()
-{
- if (VERBOSE>5) LOG("hfdc: start\n");
- m_dsrrom = memregion(DSRROM)->base();
- m_buffer_ram = memregion(BUFFER)->base();
-
- m_motor_on_timer = timer_alloc(MOTOR_TIMER);
-
- // The HFDC does not use READY; it has on-board RAM for DMA
-}
-
-void myarc_hfdc_legacy_device::device_reset()
-{
- if (VERBOSE>5) LOG("hfdc: reset\n");
- if (m_genmod)
- {
- m_select_mask = 0x1fe000;
- m_select_value = 0x174000;
- }
- else
- {
- m_select_mask = 0x7e000;
- m_select_value = 0x74000;
- }
-
- m_cru_base = ioport("CRUHFDC")->read();
-
- // Resetting values
- m_rom_page = 0;
-
- m_ram_page[0] = 0x08; // static page 0x08
- for (int i=1; i < 4; i++) m_ram_page[i] = 0;
- m_dma_address = 0;
- m_output1_latch = m_output2_latch = 0;
- m_dip = m_irq = 0;
- m_cru_select = false;
- m_CD0 = m_CD1 = 0;
- m_motor_running = false;
- m_selected = false;
-
- // Find the floppies and hard disks
- m_floppy_unit[0] = static_cast<legacy_floppy_image_device *>(m_slot->get_drive(FLOPPY_0));
- m_floppy_unit[1] = static_cast<legacy_floppy_image_device *>(m_slot->get_drive(FLOPPY_1));
- m_floppy_unit[2] = static_cast<legacy_floppy_image_device *>(m_slot->get_drive(FLOPPY_2));
- m_floppy_unit[3] = static_cast<legacy_floppy_image_device *>(m_slot->get_drive(FLOPPY_3));
-
- m_harddisk_unit[0] = static_cast<mfm_harddisk_legacy_device *>(subdevice(MFMHD_0));
- m_harddisk_unit[1] = static_cast<mfm_harddisk_legacy_device *>(subdevice(MFMHD_1));
- m_harddisk_unit[2] = static_cast<mfm_harddisk_legacy_device *>(subdevice(MFMHD_2));
-
- if (ioport("HFDCDIP")->read()&0x55)
- ti99_set_80_track_drives(TRUE);
- else
- ti99_set_80_track_drives(FALSE);
-
- m_hdc9234->set_timing(ioport("DRVSPD")->read()!=0);
-
- floppy_type_t floptype = FLOPPY_STANDARD_5_25_DSHD;
- // Again, need to re-adjust the floppy geometries
- for (int i=0; i < HFDC_MAX_FLOPPY; i++)
- {
- if (m_floppy_unit[i] != NULL)
- {
- // floppy_drive_set_controller(card->floppy_unit[i], device);
- // floppy_drive_set_index_pulse_callback(floppy_unit[i], smc92x4_index_pulse_callback);
- m_floppy_unit[i]->floppy_drive_set_geometry(floptype);
- }
- }
-
- if (VERBOSE>2) LOG("hfdc: CRU base = %04x\n", m_cru_base);
- // TODO: Check how to make use of floppy_mon_w(w->drive, CLEAR_LINE);
-}
-
-machine_config_constructor myarc_hfdc_legacy_device::device_mconfig_additions() const
-{
- return MACHINE_CONFIG_NAME( ti99_hfdc_legacy );
-}
-
-const rom_entry *myarc_hfdc_legacy_device::device_rom_region() const
-{
- return ROM_NAME( ti99_hfdc_legacy );
-}
-
-ioport_constructor myarc_hfdc_legacy_device::device_input_ports() const
-{
- return INPUT_PORTS_NAME(ti99_hfdc_legacy);
-}
-
-const device_type TI99_HFDC_LEG = &device_creator<myarc_hfdc_legacy_device>;
diff --git a/src/emu/bus/ti99_peb/hfdc.h b/src/emu/bus/ti99_peb/hfdc.h
index f7d7e9053b5..d27a9f4c8bc 100644
--- a/src/emu/bus/ti99_peb/hfdc.h
+++ b/src/emu/bus/ti99_peb/hfdc.h
@@ -5,21 +5,17 @@
Myarc Hard and Floppy Disk Controller
See hfdc.c for documentation
- Michael Zapf, September 2010
-
January 2012: rewritten as class
June 2014: rewritten for modern floppy implementation
- WORK IN PROGRESS
+ Michael Zapf
+ July 2015
****************************************************************************/
#ifndef __HFDC__
#define __HFDC__
-#define HFDC_MAX_FLOPPY 4
-#define HFDC_MAX_HARD 3
-
#include "imagedev/floppy.h"
#include "machine/mm58274c.h"
#include "machine/hdc9234.h"
@@ -69,6 +65,7 @@ private:
// Callbacks for the index hole and seek complete
void floppy_index_callback(floppy_image_device *floppy, int state);
void harddisk_index_callback(mfm_harddisk_device *harddisk, int state);
+ void harddisk_ready_callback(mfm_harddisk_device *harddisk, int state);
void harddisk_skcom_callback(mfm_harddisk_device *harddisk, int state);
// Operate the floppy motors
@@ -141,6 +138,9 @@ private:
// Recent address
int m_address;
+ // DMA in progress
+ bool m_dma_in_progress;
+
// Device Service Routine ROM (firmware)
UINT8* m_dsrrom;
@@ -181,124 +181,4 @@ private:
void set_ready(int dev, bool ready);
int m_readyflags;
};
-
-/* Connector for a MFM hard disk. See also floppy.c */
-class mfm_harddisk_connector : public device_t,
- public device_slot_interface
-{
-public:
- mfm_harddisk_connector(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
- ~mfm_harddisk_connector();
-
- mfm_harddisk_device *get_device();
-
-protected:
- void device_start();
-};
-
-extern const device_type MFM_HD_CONNECTOR;
-
-#define MCFG_MFM_HARDDISK_ADD(_tag, _slot_intf, _def_slot) \
- MCFG_DEVICE_ADD(_tag, MFM_HD_CONNECTOR, 0) \
- MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false);
-
-// =========================================================================
-
-/*
- Legacy implementation.
-*/
-extern const device_type TI99_HFDC_LEG;
-
-#include "machine/smc92x4.h"
-
-class myarc_hfdc_legacy_device : public ti_expansion_card_device
-{
-public:
- myarc_hfdc_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
- DECLARE_READ8Z_MEMBER(readz);
- DECLARE_WRITE8_MEMBER(write);
- DECLARE_READ8Z_MEMBER(crureadz);
- DECLARE_WRITE8_MEMBER(cruwrite);
-
- DECLARE_WRITE_LINE_MEMBER( intrq_w );
- DECLARE_WRITE_LINE_MEMBER( drq_w );
- DECLARE_WRITE_LINE_MEMBER( dip_w );
- DECLARE_READ8_MEMBER( auxbus_in );
- DECLARE_WRITE8_MEMBER( auxbus_out );
- DECLARE_READ8_MEMBER( read_buffer );
- DECLARE_WRITE8_MEMBER( write_buffer );
-
-protected:
- virtual void device_start(void);
- virtual void device_reset(void);
- virtual const rom_entry *device_rom_region() const;
- virtual machine_config_constructor device_mconfig_additions() const;
- virtual ioport_constructor device_input_ports() const;
- virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
-
-
-private:
- // Calculates a simple version of a binary logarithm
- int slog2(int value);
-
- // When true, triggers motor monoflop.
- bool m_trigger_motor;
-
- // When true, motor monoflop is high
- bool m_motor_running;
-
- /* Clock divider bit 0. Unused in this emulation. */
- int m_CD0;
-
- /* Clock divider bit 1. Unused in this emulation. */
- int m_CD1;
-
- /* count 4.23s from rising edge of motor_on */
- emu_timer* m_motor_on_timer;
-
- // Link to the HDC9234 controller on the board. In fact, the proper name
- // is HDC 9234, the manufacturer is Standard Microsystems Corp.
- required_device<smc92x4_device> m_hdc9234;
-
- /* Link to the clock chip on the board. */
- required_device<mm58274c_device> m_clock;
-
- /* Determines whether we have access to the CRU bits. */
- bool m_cru_select;
-
- /* IRQ state */
- bool m_irq;
-
- /* DMA in Progress state */
- bool m_dip;
-
- /* Output 1 latch */
- UINT8 m_output1_latch;
-
- /* Output 2 latch */
- UINT8 m_output2_latch;
-
- /* Connected floppy drives. */
- legacy_floppy_image_device* m_floppy_unit[HFDC_MAX_FLOPPY];
-
- /* Connected harddisk drives. */
- mfm_harddisk_legacy_device* m_harddisk_unit[HFDC_MAX_HARD];
-
- /* DMA address latch */
- UINT32 m_dma_address;
-
- // Device Service Routine ROM
- UINT8* m_dsrrom;
-
- // ROM banks.
- int m_rom_page;
-
- // HFDC RAM
- UINT8* m_buffer_ram;
-
- // RAM page registers
- int m_ram_page[4];
-};
-
-
#endif
diff --git a/src/emu/bus/ti99_peb/peribox.c b/src/emu/bus/ti99_peb/peribox.c
index 800acc9121f..9d5024e7fa6 100644
--- a/src/emu/bus/ti99_peb/peribox.c
+++ b/src/emu/bus/ti99_peb/peribox.c
@@ -179,9 +179,6 @@ CRUCLK* 51||52 DBIN
#include "emu.h"
#include "peribox.h"
-// MFM hard drives
-#include "machine/ti99_hd.h"
-
// The cards
#include "ti_32kmem.h"
#include "ti_fdc.h"
@@ -199,9 +196,6 @@ CRUCLK* 51||52 DBIN
#include "memex.h"
#include "horizon.h"
-// Disk formats
-#include "formats/ti99_dsk.h"
-
/*
Debugging flags. Set to 0 or 1.
*/
@@ -222,14 +216,6 @@ CRUCLK* 51||52 DBIN
#define PEBSLOT7 "slot7"
#define PEBSLOT8 "slot8"
-// TODO: Connect other lines (think about how to propagate to the controller)
-static const floppy_interface ti99_4_floppy_interface =
-{
- FLOPPY_STANDARD_5_25_DSHD, // type
- LEGACY_FLOPPY_OPTIONS_NAME(ti99), // image formats
- NULL // interface
-};
-
peribox_device::peribox_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: bus8z_device(mconfig, PERIBOX, "Peripheral expansion box", tag, owner, clock, "peribox", __FILE__),
m_console_inta(*this),
@@ -237,6 +223,8 @@ peribox_device::peribox_device(const machine_config &mconfig, const char *tag, d
m_datamux_ready(*this)
{
for (int i=2; i <= 8; i++) m_slot[i] = NULL;
+ // The address prefix is actually created by the "Flex cable interface"
+ // which sits in slot 1.
m_address_prefix = 0x70000;
}
@@ -383,11 +371,6 @@ void peribox_device::device_start(void)
{
if (TRACE_EMU) logerror("%s: started\n", tag());
- subdevice<legacy_floppy_image_device>(FLOPPY_0)->floppy_drive_set_rpm(300.);
- subdevice<legacy_floppy_image_device>(FLOPPY_1)->floppy_drive_set_rpm(300.);
- subdevice<legacy_floppy_image_device>(FLOPPY_2)->floppy_drive_set_rpm(300.);
- subdevice<legacy_floppy_image_device>(FLOPPY_3)->floppy_drive_set_rpm(300.);
-
// Resolve the callback lines to the console
m_console_inta.resolve();
m_console_intb.resolve();
@@ -431,19 +414,14 @@ SLOT_INTERFACE_END
SLOT_INTERFACE_START( peribox_slot7 )
SLOT_INTERFACE("ide", TI99_IDE)
SLOT_INTERFACE("usbsm", TI99_USBSM)
- SLOT_INTERFACE("bwgleg", TI99_BWG_LEG)
SLOT_INTERFACE("bwg", TI99_BWG)
- SLOT_INTERFACE("hfdc", TI99_HFDC_LEG)
- SLOT_INTERFACE("hfdcnew", TI99_HFDC)
+ SLOT_INTERFACE("hfdc", TI99_HFDC)
SLOT_INTERFACE_END
SLOT_INTERFACE_START( peribox_slot8 )
- SLOT_INTERFACE("tifdcleg", TI99_FDC_LEG)
SLOT_INTERFACE("tifdc", TI99_FDC)
- SLOT_INTERFACE("bwgleg", TI99_BWG_LEG)
SLOT_INTERFACE("bwg", TI99_BWG)
- SLOT_INTERFACE("hfdc", TI99_HFDC_LEG)
- SLOT_INTERFACE("hfdcnew", TI99_HFDC)
+ SLOT_INTERFACE("hfdc", TI99_HFDC)
SLOT_INTERFACE_END
MACHINE_CONFIG_FRAGMENT( peribox_device )
@@ -454,19 +432,6 @@ MACHINE_CONFIG_FRAGMENT( peribox_device )
MCFG_PERIBOX_SLOT_ADD( PEBSLOT6, peribox_slot6 )
MCFG_PERIBOX_SLOT_ADD( PEBSLOT7, peribox_slot7 )
MCFG_PERIBOX_SLOT_ADD( PEBSLOT8, peribox_slot8 )
-
- MCFG_DEVICE_ADD(FLOPPY_0, LEGACY_FLOPPY, 0)
- MCFG_DEVICE_CONFIG(ti99_4_floppy_interface)
- MCFG_LEGACY_FLOPPY_IDX_CB(WRITELINE(peribox_device, indexhole))
- MCFG_DEVICE_ADD(FLOPPY_1, LEGACY_FLOPPY, 0)
- MCFG_DEVICE_CONFIG(ti99_4_floppy_interface)
- MCFG_LEGACY_FLOPPY_IDX_CB(WRITELINE(peribox_device, indexhole))
- MCFG_DEVICE_ADD(FLOPPY_2, LEGACY_FLOPPY, 0)
- MCFG_DEVICE_CONFIG(ti99_4_floppy_interface)
- MCFG_LEGACY_FLOPPY_IDX_CB(WRITELINE(peribox_device, indexhole))
- MCFG_DEVICE_ADD(FLOPPY_3, LEGACY_FLOPPY, 0)
- MCFG_DEVICE_CONFIG(ti99_4_floppy_interface)
- MCFG_LEGACY_FLOPPY_IDX_CB(WRITELINE(peribox_device, indexhole))
MACHINE_CONFIG_END
machine_config_constructor peribox_device::device_mconfig_additions() const
@@ -481,8 +446,11 @@ machine_config_constructor peribox_device::device_mconfig_additions() const
peribox_gen_device::peribox_gen_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: peribox_device(mconfig, PERIBOX_GEN, "Peripheral expansion box Geneve", tag, owner, clock, "peribox_gen", __FILE__)
{
+ // The Geneve sits in slot 1; there is no prefix here - it can control
+ // a maximum address space of 512 KiB in the box. With the Genmod
+ // modification, the full 2 MiB space is available.
m_address_prefix = 0x00000;
-};
+}
// The BwG controller will not run with the Geneve due to its wait state
// logic; it assumes that before reading 5FF6 (data register), address 5FF7
@@ -492,15 +460,12 @@ peribox_gen_device::peribox_gen_device(const machine_config &mconfig, const char
SLOT_INTERFACE_START( peribox_slot7nobwg )
SLOT_INTERFACE("ide", TI99_IDE)
SLOT_INTERFACE("usbsm", TI99_USBSM)
- SLOT_INTERFACE("hfdc", TI99_HFDC_LEG)
- SLOT_INTERFACE("hfdcnew", TI99_HFDC)
+ SLOT_INTERFACE("hfdc", TI99_HFDC)
SLOT_INTERFACE_END
SLOT_INTERFACE_START( peribox_slot8nobwg )
- SLOT_INTERFACE("tifdcleg", TI99_FDC_LEG)
SLOT_INTERFACE("tifdc", TI99_FDC)
- SLOT_INTERFACE("hfdc", TI99_HFDC_LEG)
- SLOT_INTERFACE("hfdcnew", TI99_HFDC)
+ SLOT_INTERFACE("hfdc", TI99_HFDC)
SLOT_INTERFACE_END
SLOT_INTERFACE_START( peribox_slotg )
@@ -521,19 +486,6 @@ MACHINE_CONFIG_FRAGMENT( peribox_gen_device )
MCFG_PERIBOX_SLOT_ADD( PEBSLOT6, peribox_slot6 )
MCFG_PERIBOX_SLOT_ADD( PEBSLOT7, peribox_slot7nobwg )
MCFG_PERIBOX_SLOT_ADD( PEBSLOT8, peribox_slot8nobwg )
-
- MCFG_DEVICE_ADD(FLOPPY_0, LEGACY_FLOPPY, 0)
- MCFG_DEVICE_CONFIG(ti99_4_floppy_interface)
- MCFG_LEGACY_FLOPPY_IDX_CB(WRITELINE(peribox_device, indexhole))
- MCFG_DEVICE_ADD(FLOPPY_1, LEGACY_FLOPPY, 0)
- MCFG_DEVICE_CONFIG(ti99_4_floppy_interface)
- MCFG_LEGACY_FLOPPY_IDX_CB(WRITELINE(peribox_device, indexhole))
- MCFG_DEVICE_ADD(FLOPPY_2, LEGACY_FLOPPY, 0)
- MCFG_DEVICE_CONFIG(ti99_4_floppy_interface)
- MCFG_LEGACY_FLOPPY_IDX_CB(WRITELINE(peribox_device, indexhole))
- MCFG_DEVICE_ADD(FLOPPY_3, LEGACY_FLOPPY, 0)
- MCFG_DEVICE_CONFIG(ti99_4_floppy_interface)
- MCFG_LEGACY_FLOPPY_IDX_CB(WRITELINE(peribox_device, indexhole))
MACHINE_CONFIG_END
machine_config_constructor peribox_gen_device::device_mconfig_additions() const
@@ -549,7 +501,7 @@ peribox_998_device::peribox_998_device(const machine_config &mconfig, const char
: peribox_device(mconfig, PERIBOX_998, "Peripheral expansion box 99/8", tag, owner, clock, "peribox_998", __FILE__)
{
m_address_prefix = 0x70000;
-};
+}
// The BwG controller will not run with the TI-99/8 for the same reason why
// it won't work with the Geneve.
@@ -573,19 +525,6 @@ MACHINE_CONFIG_FRAGMENT( peribox_998_device )
MCFG_PERIBOX_SLOT_ADD( PEBSLOT6, peribox_slot998 )
MCFG_PERIBOX_SLOT_ADD( PEBSLOT7, peribox_slot998 )
MCFG_PERIBOX_SLOT_ADD( PEBSLOT8, peribox_slot8nobwg )
-
- MCFG_DEVICE_ADD(FLOPPY_0, LEGACY_FLOPPY, 0)
- MCFG_DEVICE_CONFIG(ti99_4_floppy_interface)
- MCFG_LEGACY_FLOPPY_IDX_CB(WRITELINE(peribox_device, indexhole))
- MCFG_DEVICE_ADD(FLOPPY_1, LEGACY_FLOPPY, 0)
- MCFG_DEVICE_CONFIG(ti99_4_floppy_interface)
- MCFG_LEGACY_FLOPPY_IDX_CB(WRITELINE(peribox_device, indexhole))
- MCFG_DEVICE_ADD(FLOPPY_2, LEGACY_FLOPPY, 0)
- MCFG_DEVICE_CONFIG(ti99_4_floppy_interface)
- MCFG_LEGACY_FLOPPY_IDX_CB(WRITELINE(peribox_device, indexhole))
- MCFG_DEVICE_ADD(FLOPPY_3, LEGACY_FLOPPY, 0)
- MCFG_DEVICE_CONFIG(ti99_4_floppy_interface)
- MCFG_LEGACY_FLOPPY_IDX_CB(WRITELINE(peribox_device, indexhole))
MACHINE_CONFIG_END
machine_config_constructor peribox_998_device::device_mconfig_additions() const
@@ -601,7 +540,7 @@ peribox_sg_device::peribox_sg_device(const machine_config &mconfig, const char *
: peribox_device(mconfig, PERIBOX_SG, "Peripheral expansion box SGCPU", tag, owner, clock, "peribox_sg", __FILE__)
{
m_address_prefix = 0x70000;
-};
+}
SLOT_INTERFACE_START( peribox_slotp )
SLOT_INTERFACE("pcode", TI99_P_CODE)
@@ -625,20 +564,7 @@ MACHINE_CONFIG_FRAGMENT( peribox_sg_device )
MCFG_PERIBOX_SLOT_ADD( PEBSLOT5, peribox_slotp )
MCFG_PERIBOX_SLOT_ADD( PEBSLOT6, peribox_slot6 )
MCFG_PERIBOX_SLOT_ADD( PEBSLOT7, peribox_slot7 )
- MCFG_PERIBOX_SLOT_ADD( PEBSLOT8, peribox_slot7 )
-
- MCFG_DEVICE_ADD(FLOPPY_0, LEGACY_FLOPPY, 0)
- MCFG_DEVICE_CONFIG(ti99_4_floppy_interface)
- MCFG_LEGACY_FLOPPY_IDX_CB(WRITELINE(peribox_device, indexhole))
- MCFG_DEVICE_ADD(FLOPPY_1, LEGACY_FLOPPY, 0)
- MCFG_DEVICE_CONFIG(ti99_4_floppy_interface)
- MCFG_LEGACY_FLOPPY_IDX_CB(WRITELINE(peribox_device, indexhole))
- MCFG_DEVICE_ADD(FLOPPY_2, LEGACY_FLOPPY, 0)
- MCFG_DEVICE_CONFIG(ti99_4_floppy_interface)
- MCFG_LEGACY_FLOPPY_IDX_CB(WRITELINE(peribox_device, indexhole))
- MCFG_DEVICE_ADD(FLOPPY_3, LEGACY_FLOPPY, 0)
- MCFG_DEVICE_CONFIG(ti99_4_floppy_interface)
- MCFG_LEGACY_FLOPPY_IDX_CB(WRITELINE(peribox_device, indexhole))
+ MCFG_PERIBOX_SLOT_ADD( PEBSLOT8, peribox_slot8 )
MACHINE_CONFIG_END
machine_config_constructor peribox_sg_device::device_mconfig_additions() const
@@ -655,7 +581,7 @@ peribox_ev_device::peribox_ev_device(const machine_config &mconfig, const char *
: peribox_device(mconfig, PERIBOX_EV, "Peripheral expansion box EVPC", tag, owner, clock, "peribox_ev", __FILE__)
{
m_address_prefix = 0x70000;
-};
+}
MACHINE_CONFIG_FRAGMENT( peribox_ev_device )
MCFG_PERIBOX_SLOT_ADD_DEF( PEBSLOT2, peribox_ev_slot, "evpc" )
@@ -665,19 +591,6 @@ MACHINE_CONFIG_FRAGMENT( peribox_ev_device )
MCFG_PERIBOX_SLOT_ADD( PEBSLOT6, peribox_slot6 )
MCFG_PERIBOX_SLOT_ADD( PEBSLOT7, peribox_slot7 )
MCFG_PERIBOX_SLOT_ADD( PEBSLOT8, peribox_slot8 )
-
- MCFG_DEVICE_ADD(FLOPPY_0, LEGACY_FLOPPY, 0)
- MCFG_DEVICE_CONFIG(ti99_4_floppy_interface)
- MCFG_LEGACY_FLOPPY_IDX_CB(WRITELINE(peribox_device, indexhole))
- MCFG_DEVICE_ADD(FLOPPY_1, LEGACY_FLOPPY, 0)
- MCFG_DEVICE_CONFIG(ti99_4_floppy_interface)
- MCFG_LEGACY_FLOPPY_IDX_CB(WRITELINE(peribox_device, indexhole))
- MCFG_DEVICE_ADD(FLOPPY_2, LEGACY_FLOPPY, 0)
- MCFG_DEVICE_CONFIG(ti99_4_floppy_interface)
- MCFG_LEGACY_FLOPPY_IDX_CB(WRITELINE(peribox_device, indexhole))
- MCFG_DEVICE_ADD(FLOPPY_3, LEGACY_FLOPPY, 0)
- MCFG_DEVICE_CONFIG(ti99_4_floppy_interface)
- MCFG_LEGACY_FLOPPY_IDX_CB(WRITELINE(peribox_device, indexhole))
MACHINE_CONFIG_END
machine_config_constructor peribox_ev_device::device_mconfig_additions() const
@@ -686,16 +599,6 @@ machine_config_constructor peribox_ev_device::device_mconfig_additions() const
}
/***************************************************************************
- Floppy interface
-****************************************************************************/
-
-// TODO: won't be called unless motor_on is triggered
-WRITE_LINE_MEMBER( peribox_device::indexhole )
-{
- logerror("peribox_device: indexhole\n");
-}
-
-/***************************************************************************
Implementation of a slot within the box.
****************************************************************************/
diff --git a/src/emu/bus/ti99_peb/peribox.h b/src/emu/bus/ti99_peb/peribox.h
index a1638549114..85c8bfcbdbc 100644
--- a/src/emu/bus/ti99_peb/peribox.h
+++ b/src/emu/bus/ti99_peb/peribox.h
@@ -56,9 +56,6 @@ public:
// Part of configuration
void set_prefix(int prefix) { m_address_prefix = prefix; }
- // Floppy interface
- DECLARE_WRITE_LINE_MEMBER( indexhole );
-
// Genmod support
DECLARE_INPUT_CHANGED_MEMBER( genmod_changed );
void set_genmod(bool set);
@@ -246,16 +243,4 @@ protected:
#define MCFG_PERIBOX_READY_HANDLER( _ready ) \
devcb = &peribox_device::static_set_ready_callback( *device, DEVCB_##_ready );
-
-/*
- The following defines are required because the WD17xx device start implementation
- assumes that the floppy devices are either at root level or at the parent
- level. Our floppy devices, however, are at the grandparent level as seen from
- the controller.
-*/
-#define PFLOPPY_0 ":peb:floppy0"
-#define PFLOPPY_1 ":peb:floppy1"
-#define PFLOPPY_2 ":peb:floppy2"
-#define PFLOPPY_3 ":peb:floppy3"
-
#endif /* __PBOX__ */
diff --git a/src/emu/bus/ti99_peb/ti_fdc.c b/src/emu/bus/ti99_peb/ti_fdc.c
index 44062149051..610832e2539 100644
--- a/src/emu/bus/ti99_peb/ti_fdc.c
+++ b/src/emu/bus/ti99_peb/ti_fdc.c
@@ -403,7 +403,7 @@ static SLOT_INTERFACE_START( tifdc_floppies )
SLOT_INTERFACE_END
MACHINE_CONFIG_FRAGMENT( ti_fdc )
- MCFG_FD1771x_ADD(FDC_TAG, XTAL_1MHz)
+ MCFG_FD1771_ADD(FDC_TAG, XTAL_1MHz)
MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(ti_fdc_device, fdc_irq_w))
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(ti_fdc_device, fdc_drq_w))
MCFG_FLOPPY_DRIVE_ADD("0", tifdc_floppies, "525dd", ti_fdc_device::floppy_formats)
@@ -427,313 +427,3 @@ const rom_entry *ti_fdc_device::device_rom_region() const
}
const device_type TI99_FDC = &device_creator<ti_fdc_device>;
-//===========================================================================
-
-/***********************************************
-
- Legacy implementation, to be removed
-
-***********************************************/
-
-#define TI_FDCLEG_TAG "ti_dssd_controller_legacy"
-#define FDCLEG_TAG "wd1771"
-
-ti_fdc_legacy_device::ti_fdc_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : ti_expansion_card_device(mconfig, TI99_FDC_LEG, "TI-99 Standard DSSD Floppy Controller LEGACY", tag, owner, clock, "ti99_fdc_leg", __FILE__),
- m_fd1771(*this, FDCLEG_TAG) { }
-
-/*
- callback called at the end of DVENA pulse
-*/
-void ti_fdc_legacy_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
-{
- m_DVENA = CLEAR_LINE;
- if (TRACE_MOTOR) logerror("tifdc: Motor off\n");
- set_ready_line();
-}
-
-/*
- Operate the wait state logic.
-*/
-void ti_fdc_legacy_device::set_ready_line()
-{
- // This is the wait state logic
- if (TRACE_SIGNALS) logerror("tifdc: address=%04x, DRQ=%d, INTRQ=%d, MOTOR=%d\n", m_address & 0xffff, m_DRQ, m_IRQ, m_DVENA);
- line_state nready = (m_WDsel && // Are we accessing 5ffx (even addr)?
- m_WAITena && // and the wait state generation is active (SBO 2)
- (m_DRQ==CLEAR_LINE) && // and we are waiting for a byte
- (m_IRQ==CLEAR_LINE) && // and there is no interrupt yet
- (m_DVENA==ASSERT_LINE) // and the motor is turning?
- )? ASSERT_LINE : CLEAR_LINE; // In that case, clear READY and thus trigger wait states
-
- if (TRACE_READY) logerror("tifdc: READY line = %d\n", (nready==CLEAR_LINE)? 1:0);
- m_slot->set_ready((nready==CLEAR_LINE)? ASSERT_LINE : CLEAR_LINE);
-}
-
-SETADDRESS_DBIN_MEMBER( ti_fdc_legacy_device::setaddress_dbin )
-{
- // Selection login in the PAL and some circuits on the board
-
- // Is the card being selected?
- m_address = offset;
- m_inDsrArea = ((m_address & m_select_mask)==m_select_value);
-
- if (!m_inDsrArea) return;
-
- if (TRACE_ADDRESS) logerror("tifdc: set address = %04x\n", offset & 0xffff);
-
- // Is the WD chip on the card being selected?
- m_WDsel = m_inDsrArea && ((m_address & 0x1ff1)==0x1ff0);
-
- // Clear or assert the outgoing READY line
- set_ready_line();
-}
-
-READ8Z_MEMBER(ti_fdc_legacy_device::readz)
-{
- if (m_inDsrArea && m_selected)
- {
- // only use the even addresses from 1ff0 to 1ff6.
- // Note that data is inverted.
- // 0101 1111 1111 0xx0
- UINT8 reply = 0;
-
- if (m_WDsel && ((m_address & 9)==0))
- {
- if (!space.debugger_access()) reply = m_fd1771->read(space, (offset >> 1)&0x03);
- if (TRACE_DATA)
- {
- if ((m_address & 0xffff)==0x5ff6) logerror("%02x ", ~reply & 0xff);
- else logerror("\n%04x: %02x", m_address&0xffff, ~reply & 0xff);
- }
- }
- else
- {
- reply = m_dsrrom[m_address & 0x1fff];
- }
- *value = reply;
- if (TRACE_RW) logerror("ti_fdc: %04x -> %02x\n", offset & 0xffff, *value);
- }
-}
-
-WRITE8_MEMBER(ti_fdc_legacy_device::write)
-{
- if (m_inDsrArea && m_selected)
- {
- if (TRACE_RW) logerror("ti_fdc: %04x <- %02x\n", offset & 0xffff, ~data & 0xff);
- // only use the even addresses from 1ff8 to 1ffe.
- // Note that data is inverted.
- // 0101 1111 1111 1xx0
- if (m_WDsel && ((m_address & 9)==8))
- {
- if (!space.debugger_access()) m_fd1771->write(space, (offset >> 1)&0x03, data);
- }
- }
-}
-
-/*
- The CRU read handler.
- bit 0: HLD pin
- bit 1-3: drive n active
- bit 4: 0: motor strobe on
- bit 5: always 0
- bit 6: always 1
- bit 7: selected side
-*/
-READ8Z_MEMBER(ti_fdc_legacy_device::crureadz)
-{
- if ((offset & 0xff00)==m_cru_base)
- {
- int addr = offset & 0x07;
- UINT8 reply = 0;
- if (addr == 0)
- {
- // deliver bits 0-7
- // TODO: HLD pin
- // The DVENA state is returned inverted
- if (m_DVENA==ASSERT_LINE) reply |= ((m_DSEL)<<1);
- else reply |= 0x10;
- reply |= 0x40;
- if (m_SIDSEL) reply |= 0x80;
- }
- *value = reply;
- if (TRACE_CRU) logerror("tifdc: Read CRU = %02x\n", *value);
- }
-}
-
-WRITE8_MEMBER(ti_fdc_legacy_device::cruwrite)
-{
- int drive, drivebit;
-
- if ((offset & 0xff00)==m_cru_base)
- {
- int bit = (offset >> 1) & 0x07;
- switch (bit)
- {
- case 0:
- /* (De)select the card. Indicated by a LED on the board. */
- m_selected = (data!=0);
- if (TRACE_CRU) logerror("tifdc: Map DSR (bit 0) = %d\n", m_selected);
- break;
- case 1:
- /* Activate motor */
- if (data==1 && m_lastval==0)
- { /* on rising edge, set motor_running for 4.23s */
- if (TRACE_CRU) logerror("tifdc: trigger motor (bit 1)\n");
- m_DVENA = ASSERT_LINE;
- if (TRACE_MOTOR) logerror("tifdc: motor on\n");
- set_ready_line();
- m_motor_on_timer->adjust(attotime::from_msec(4230));
- }
- m_lastval = data;
- break;
-
- case 2:
- /* Set disk ready/hold (bit 2) */
- // 0: ignore IRQ and DRQ
- // 1: TMS9900 is stopped until IRQ or DRQ are set
- // OR the motor stops rotating - rotates for 4.23s after write
- // to CRU bit 1
- m_WAITena = (data != 0);
- if (TRACE_CRU) logerror("tifdc: arm wait state logic (bit 2) = %d\n", data);
- break;
-
- case 3:
- /* Load disk heads (HLT pin) (bit 3). Not implemented. */
- if (TRACE_CRU) logerror("tifdc: set head load (bit 3) = %d\n", data);
- break;
-
- case 4:
- case 5:
- case 6:
- /* Select drive X (bits 4-6) */
- drive = bit-4; /* drive # (0-2) */
- if (TRACE_CRU) logerror("tifdc: set drive (bit %d) = %d\n", bit, data);
- drivebit = 1<<drive;
-
- if (data != 0)
- {
- if ((m_DSEL & drivebit) == 0) /* select drive */
- {
- if (m_DSEL != 0)
- logerror("tifdc: Multiple drives selected, %02x\n", m_DSEL);
- m_DSEL |= drivebit;
- m_fd1771->set_drive(drive);
- }
- }
- else
- m_DSEL &= ~drivebit;
- break;
-
- case 7:
- /* Select side of disk (bit 7) */
- m_SIDSEL = data;
- if (TRACE_CRU) logerror("tifdc: set side (bit 7) = %d\n", data);
- m_fd1771->set_side(data);
- break;
- }
- }
-}
-
-/*
- Resets the drive geometry. This is required because the heuristic of
- the default implementation sets the drive geometry to the geometry
- of the medium.
-*/
-void ti_fdc_legacy_device::set_geometry(legacy_floppy_image_device *drive, floppy_type_t type)
-{
- // This assertion may fail when the names of the floppy devices change.
- // Unfortunately, the wd17xx device assumes the floppy drives at root
- // level, so we use an explicitly qualified tag. See peribox.h.
- assert (drive!=NULL);
- drive->floppy_drive_set_geometry(type);
-}
-
-void ti_fdc_legacy_device::set_all_geometries(floppy_type_t type)
-{
- set_geometry(machine().device<legacy_floppy_image_device>(PFLOPPY_0), type);
- set_geometry(machine().device<legacy_floppy_image_device>(PFLOPPY_1), type);
- set_geometry(machine().device<legacy_floppy_image_device>(PFLOPPY_2), type);
-}
-
-/*
- Callback, called from the controller chip whenever DRQ/IRQ state change
-*/
-WRITE_LINE_MEMBER( ti_fdc_legacy_device::intrq_w )
-{
- if (TRACE_SIGNALS) logerror("ti_fdc: set irq = %d\n", state);
- m_IRQ = (line_state)state;
- // Note that INTB is actually not used in the TI-99 family. But the
- // controller asserts the line nevertheless, probably intended for
- // use in another planned TI system
- m_slot->set_intb(state);
- set_ready_line();
-}
-
-WRITE_LINE_MEMBER( ti_fdc_legacy_device::drq_w )
-{
- if (TRACE_SIGNALS) logerror("ti_fdc: set drq = %d\n", state);
- m_DRQ = (line_state)state;
- set_ready_line();
-}
-
-void ti_fdc_legacy_device::device_start(void)
-{
- logerror("ti_fdc: TI FDC (legacy) start\n");
- m_dsrrom = memregion(DSRROM)->base();
- m_motor_on_timer = timer_alloc(MOTOR_TIMER);
- m_cru_base = 0x1100;
-}
-
-void ti_fdc_legacy_device::device_reset(void)
-{
- logerror("ti_fdc: TI FDC (legacy) reset\n");
- m_DSEL = 0;
- m_SIDSEL = 0;
- m_DVENA = CLEAR_LINE;
- m_lastval = 0;
- if (m_genmod)
- {
- m_select_mask = 0x1fe000;
- m_select_value = 0x174000;
- }
- else
- {
- m_select_mask = 0x7e000;
- m_select_value = 0x74000;
- }
- m_DRQ = CLEAR_LINE;
- m_IRQ = CLEAR_LINE;
- m_WAITena = false;
- m_selected = false;
- m_inDsrArea = false;
- m_WDsel = false;
-
- ti99_set_80_track_drives(FALSE);
- floppy_type_t type = FLOPPY_STANDARD_5_25_DSDD_40;
- set_all_geometries(type);
-}
-
-MACHINE_CONFIG_FRAGMENT( ti_fdc_legacy )
- MCFG_DEVICE_ADD(FDCLEG_TAG, FD1771, 0)
- MCFG_WD17XX_DRIVE_TAGS(PFLOPPY_0, PFLOPPY_1, PFLOPPY_2, NULL)
- MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(ti_fdc_legacy_device, intrq_w))
- MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(ti_fdc_legacy_device, drq_w))
-MACHINE_CONFIG_END
-
-ROM_START( ti_fdc_legacy )
- ROM_REGION(0x2000, DSRROM, 0)
- ROM_LOAD("disk.bin", 0x0000, 0x2000, CRC(8f7df93f) SHA1(ed91d48c1eaa8ca37d5055bcf67127ea51c4cad5)) /* TI disk DSR ROM */
-ROM_END
-
-machine_config_constructor ti_fdc_legacy_device::device_mconfig_additions() const
-{
- return MACHINE_CONFIG_NAME( ti_fdc_legacy );
-}
-
-const rom_entry *ti_fdc_legacy_device::device_rom_region() const
-{
- return ROM_NAME( ti_fdc_legacy );
-}
-
-const device_type TI99_FDC_LEG = &device_creator<ti_fdc_legacy_device>;
diff --git a/src/emu/bus/ti99_peb/ti_fdc.h b/src/emu/bus/ti99_peb/ti_fdc.h
index 10a2f1cf737..9fedb1c2590 100644
--- a/src/emu/bus/ti99_peb/ti_fdc.h
+++ b/src/emu/bus/ti99_peb/ti_fdc.h
@@ -108,85 +108,4 @@ private:
// Debugging
bool m_debug_dataout;
};
-
-//===========================================================================
-
-/***********************************************
-
- Legacy implementation
-
-***********************************************/
-
-#include "machine/wd17xx.h"
-#include "imagedev/flopdrv.h"
-
-extern const device_type TI99_FDC_LEG;
-
-class ti_fdc_legacy_device : public ti_expansion_card_device
-{
-public:
- ti_fdc_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
- DECLARE_READ8Z_MEMBER(readz);
- DECLARE_WRITE8_MEMBER(write);
- DECLARE_SETADDRESS_DBIN_MEMBER(setaddress_dbin);
-
- DECLARE_WRITE_LINE_MEMBER( intrq_w );
- DECLARE_WRITE_LINE_MEMBER( drq_w );
-
- DECLARE_READ8Z_MEMBER(crureadz);
- DECLARE_WRITE8_MEMBER(cruwrite);
-
-protected:
- virtual void device_start(void);
- virtual void device_reset(void);
- virtual const rom_entry *device_rom_region() const;
- virtual machine_config_constructor device_mconfig_additions() const;
- virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
-
-private:
- void set_ready_line();
- void set_all_geometries(floppy_type_t type);
- void set_geometry(legacy_floppy_image_device *drive, floppy_type_t type);
-
- // Recent address
- int m_address;
-
- // Holds the status of the DRQ and IRQ lines.
- line_state m_DRQ, m_IRQ;
-
- // Needed for triggering the motor monoflop
- UINT8 m_lastval;
-
- // Signal DVENA. When TRUE, makes some drive turning.
- line_state m_DVENA;
-
- // When TRUE the CPU is halted while DRQ/IRQ are true.
- bool m_WAITena;
-
- // WD chip selected
- bool m_WDsel;
-
- // Set when address is in card area
- bool m_inDsrArea;
-
- // Indicates which drive has been selected. Values are 0, 1, 2, and 4.
- // 000 = no drive
- // 001 = drive 1
- // 010 = drive 2
- // 100 = drive 3
- int m_DSEL;
-
- // Signal SIDSEL. 0 or 1, indicates the selected head.
- int m_SIDSEL;
-
- // count 4.23s from rising edge of motor_on
- emu_timer* m_motor_on_timer;
-
- // Link to the FDC1771 controller on the board.
- required_device<fd1771_device> m_fd1771;
-
- // DSR ROM
- UINT8* m_dsrrom;
-};
-
#endif
diff --git a/src/emu/bus/tvc/hbf.c b/src/emu/bus/tvc/hbf.c
index 7d87477172e..760226a2cfb 100644
--- a/src/emu/bus/tvc/hbf.c
+++ b/src/emu/bus/tvc/hbf.c
@@ -23,7 +23,7 @@ static SLOT_INTERFACE_START( tvc_hbf_floppies )
SLOT_INTERFACE_END
static MACHINE_CONFIG_FRAGMENT(tvc_hbf)
- MCFG_FD1793x_ADD("fdc", XTAL_16MHz / 16)
+ MCFG_FD1793_ADD("fdc", XTAL_16MHz / 16)
MCFG_FLOPPY_DRIVE_ADD("fdc:0", tvc_hbf_floppies, "525qd", tvc_hbf_device::floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("fdc:1", tvc_hbf_floppies, "525qd", tvc_hbf_device::floppy_formats)
MACHINE_CONFIG_END
diff --git a/src/emu/bus/vboy/slot.c b/src/emu/bus/vboy/slot.c
index 0cbbb618419..da00aeaca04 100644
--- a/src/emu/bus/vboy/slot.c
+++ b/src/emu/bus/vboy/slot.c
@@ -213,7 +213,7 @@ bool vboy_cart_slot_device::call_load()
void vboy_cart_slot_device::call_unload()
{
- if (m_cart && m_cart->get_eeprom_size())
+ if (m_cart && m_cart->get_eeprom_base() && m_cart->get_eeprom_size())
battery_save(m_cart->get_eeprom_base(), m_cart->get_eeprom_size() * 4);
}
diff --git a/src/emu/bus/vtech/memexp/floppy.c b/src/emu/bus/vtech/memexp/floppy.c
index dccba3f09b5..ef169703035 100644
--- a/src/emu/bus/vtech/memexp/floppy.c
+++ b/src/emu/bus/vtech/memexp/floppy.c
@@ -1,5 +1,5 @@
// license:GPL-2.0+
-// copyright-holders:Dirk Best
+// copyright-holders:Dirk Best, Olivier Galibert
/***************************************************************************
VTech Laser/VZ Floppy Controller Cartridge
@@ -10,7 +10,7 @@
***************************************************************************/
#include "floppy.h"
-#include "formats/vtech1_dsk.h"
+
//**************************************************************************
// DEVICE DEFINITIONS
@@ -44,18 +44,14 @@ const rom_entry *floppy_controller_device::device_rom_region() const
// machine configurations
//-------------------------------------------------
-FLOPPY_FORMATS_MEMBER( floppy_controller_device::floppy_formats )
- FLOPPY_MFI_FORMAT
-FLOPPY_FORMATS_END
-
static SLOT_INTERFACE_START( laser_floppies )
- SLOT_INTERFACE( "525", FLOPPY_525_SSSD )
+ SLOT_INTERFACE("525", FLOPPY_525_SSSD)
SLOT_INTERFACE_END
static MACHINE_CONFIG_FRAGMENT( floppy_controller )
MCFG_MEMEXP_SLOT_ADD("mem")
- MCFG_FLOPPY_DRIVE_ADD("0", laser_floppies, "525", floppy_controller_device::floppy_formats)
- MCFG_FLOPPY_DRIVE_ADD("1", laser_floppies, "525", floppy_controller_device::floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("0", laser_floppies, "525", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("1", laser_floppies, "525", floppy_image_device::default_floppy_formats)
MACHINE_CONFIG_END
machine_config_constructor floppy_controller_device::device_mconfig_additions() const
diff --git a/src/emu/bus/vtech/memexp/floppy.h b/src/emu/bus/vtech/memexp/floppy.h
index 940c6abc2ea..91c332332c1 100644
--- a/src/emu/bus/vtech/memexp/floppy.h
+++ b/src/emu/bus/vtech/memexp/floppy.h
@@ -1,5 +1,5 @@
// license:GPL-2.0+
-// copyright-holders:Dirk Best
+// copyright-holders:Dirk Best, Olivier Galibert
/***************************************************************************
VTech Laser/VZ Floppy Controller Cartridge
@@ -38,8 +38,6 @@ public:
DECLARE_READ8_MEMBER(rd_r);
DECLARE_READ8_MEMBER(wpt_r);
- DECLARE_FLOPPY_FORMATS( floppy_formats );
-
protected:
virtual const rom_entry *device_rom_region() const;
virtual machine_config_constructor device_mconfig_additions() const;
diff --git a/src/emu/bus/wangpc/wdc.c b/src/emu/bus/wangpc/wdc.c
index cfb0307473d..4e4e8fb92bc 100644
--- a/src/emu/bus/wangpc/wdc.c
+++ b/src/emu/bus/wangpc/wdc.c
@@ -332,11 +332,11 @@ WRITE8_MEMBER( wangpc_wdc_device::status_w )
}
-READ8_MEMBER( wangpc_wdc_device::ctc_ch0_r ) { return m_ctc->read(space, 0); };
-WRITE8_MEMBER( wangpc_wdc_device::ctc_ch0_w ) { m_ctc->write(space, 0, data); };
-READ8_MEMBER( wangpc_wdc_device::ctc_ch1_r ) { return m_ctc->read(space, 1); };
-WRITE8_MEMBER( wangpc_wdc_device::ctc_ch1_w ) { m_ctc->write(space, 1, data); };
-READ8_MEMBER( wangpc_wdc_device::ctc_ch2_r ) { return m_ctc->read(space, 2); };
-WRITE8_MEMBER( wangpc_wdc_device::ctc_ch2_w ) { m_ctc->write(space, 2, data); };
-READ8_MEMBER( wangpc_wdc_device::ctc_ch3_r ) { return m_ctc->read(space, 3); };
-WRITE8_MEMBER( wangpc_wdc_device::ctc_ch3_w ) { m_ctc->write(space, 3, data); };
+READ8_MEMBER( wangpc_wdc_device::ctc_ch0_r ) { return m_ctc->read(space, 0); }
+WRITE8_MEMBER( wangpc_wdc_device::ctc_ch0_w ) { m_ctc->write(space, 0, data); }
+READ8_MEMBER( wangpc_wdc_device::ctc_ch1_r ) { return m_ctc->read(space, 1); }
+WRITE8_MEMBER( wangpc_wdc_device::ctc_ch1_w ) { m_ctc->write(space, 1, data); }
+READ8_MEMBER( wangpc_wdc_device::ctc_ch2_r ) { return m_ctc->read(space, 2); }
+WRITE8_MEMBER( wangpc_wdc_device::ctc_ch2_w ) { m_ctc->write(space, 2, data); }
+READ8_MEMBER( wangpc_wdc_device::ctc_ch3_r ) { return m_ctc->read(space, 3); }
+WRITE8_MEMBER( wangpc_wdc_device::ctc_ch3_w ) { m_ctc->write(space, 3, data); }
diff --git a/src/emu/bus/wswan/slot.c b/src/emu/bus/wswan/slot.c
index 6e22ab1b40b..8da5f6e694d 100644
--- a/src/emu/bus/wswan/slot.c
+++ b/src/emu/bus/wswan/slot.c
@@ -232,7 +232,7 @@ bool ws_cart_slot_device::call_load()
void ws_cart_slot_device::call_unload()
{
- if (m_cart && m_cart->get_nvram_size())
+ if (m_cart && m_cart->get_nvram_base() && m_cart->get_nvram_size())
battery_save(m_cart->get_nvram_base(), m_cart->get_nvram_size());
}
diff --git a/src/emu/cheat.c b/src/emu/cheat.c
index fc19df4e83c..08f86957eac 100644
--- a/src/emu/cheat.c
+++ b/src/emu/cheat.c
@@ -1134,25 +1134,30 @@ void cheat_manager::reload()
m_lastline = 0;
m_disabled = false;
- // load the cheat file, MESS will load a crc32.xml ( eg. 01234567.xml )
- // and MAME will load gamename.xml
+ // load the cheat file, if it's a system that has a software list then try softlist_name/shortname.xml first,
+ // if it fails to load then try to load via crc32 - basename/crc32.xml ( eg. 01234567.xml )
image_interface_iterator iter(machine().root_device());
for (device_image_interface *image = iter.first(); image != NULL; image = iter.next())
if (image->exists())
{
- // if we are loading through software lists, try to load shortname.xml
+ // if we are loading through a software list, try to load softlist_name/shortname.xml
+ // this allows the coexistence of arcade cheats with cheats for home conversions which
+ // have the same shortname
if (image->software_entry() != NULL)
{
- load_cheats(image->basename());
+ std::string filename;
+ strprintf(filename, "%s%s%s", image->software_list_name(), PATH_SEPARATOR, image->basename());
+ load_cheats(filename.c_str());
break;
}
+ // else we are loading outside the software list, try to load machine_basename/crc32.xml
else
{
UINT32 crc = image->crc();
if (crc != 0)
{
std::string filename;
- strprintf(filename,"%08X", crc);
+ strprintf(filename, "%s%s%08X", machine().basename(), PATH_SEPARATOR, crc);
load_cheats(filename.c_str());
break;
}
diff --git a/src/emu/clifront.c b/src/emu/clifront.c
index 094353041cc..90f63bde35e 100644
--- a/src/emu/clifront.c
+++ b/src/emu/clifront.c
@@ -110,6 +110,8 @@ int cli_frontend::execute(int argc, char **argv)
std::string option_errors;
m_options.parse_command_line(argc, argv, option_errors);
+ m_options.parse_standard_inis(option_errors);
+
if (*(m_options.software_name()) != 0)
{
const game_driver *system = m_options.system();
@@ -175,7 +177,6 @@ int cli_frontend::execute(int argc, char **argv)
}
}
- m_options.parse_standard_inis(option_errors);
// parse the command line, adding any system-specific options
if (!m_options.parse_command_line(argc, argv, option_errors))
{
@@ -1549,7 +1550,9 @@ void cli_frontend::execute_commands(const char *exename)
if (strcmp(m_options.command(), CLICOMMAND_VALIDATE) == 0)
{
validity_checker valid(m_options);
- valid.check_all();
+ bool result = valid.check_all();
+ if (!result)
+ throw emu_fatalerror(MAMERR_FAILED_VALIDITY, "Validity check failed!\n");
return;
}
diff --git a/src/emu/cpu/8x300/8x300.c b/src/emu/cpu/8x300/8x300.c
index 0bbc7eec3d6..bf6a5148ca5 100644
--- a/src/emu/cpu/8x300/8x300.c
+++ b/src/emu/cpu/8x300/8x300.c
@@ -12,7 +12,7 @@
#include "debugger.h"
#include "8x300.h"
-#define FETCHOP(a) (m_direct->read_decrypted_word(a))
+#define FETCHOP(a) (m_direct->read_word(a))
#define CYCLES(x) do { m_icount -= (x); } while (0)
#define READPORT(a) (m_io->read_byte(a))
#define WRITEPORT(a,v) (m_io->write_byte((a), (v)))
diff --git a/src/emu/cpu/adsp2100/adsp2100.c b/src/emu/cpu/adsp2100/adsp2100.c
index 3c3a5e7049c..8142a6a7a34 100644
--- a/src/emu/cpu/adsp2100/adsp2100.c
+++ b/src/emu/cpu/adsp2100/adsp2100.c
@@ -811,7 +811,7 @@ inline void adsp21xx_device::program_write(UINT32 addr, UINT32 data)
inline UINT32 adsp21xx_device::opcode_read()
{
- return m_direct->read_decrypted_dword(m_pc << 2);
+ return m_direct->read_dword(m_pc << 2);
}
diff --git a/src/emu/cpu/adsp2100/adsp2100.h b/src/emu/cpu/adsp2100/adsp2100.h
index ee5e6b23871..4b84d6e1b2a 100644
--- a/src/emu/cpu/adsp2100/adsp2100.h
+++ b/src/emu/cpu/adsp2100/adsp2100.h
@@ -208,7 +208,7 @@ protected:
CHIP_TYPE_ADSP2104,
CHIP_TYPE_ADSP2105,
CHIP_TYPE_ADSP2115,
- CHIP_TYPE_ADSP2181,
+ CHIP_TYPE_ADSP2181
};
// construction/destruction
diff --git a/src/emu/cpu/alph8201/alph8201.h b/src/emu/cpu/alph8201/alph8201.h
index 3431627a6ee..16555803988 100644
--- a/src/emu/cpu/alph8201/alph8201.h
+++ b/src/emu/cpu/alph8201/alph8201.h
@@ -72,8 +72,8 @@ protected:
UINT8 M_RDMEM(UINT16 A) { return m_program->read_byte(A); }
void M_WRMEM(UINT16 A,UINT8 V) { m_program->write_byte(A, V); }
- UINT8 M_RDOP(UINT16 A) { return m_direct->read_decrypted_byte(A); }
- UINT8 M_RDOP_ARG(UINT16 A) { return m_direct->read_raw_byte(A); }
+ UINT8 M_RDOP(UINT16 A) { return m_direct->read_byte(A); }
+ UINT8 M_RDOP_ARG(UINT16 A) { return m_direct->read_byte(A); }
UINT8 RD_REG(UINT8 x) { return m_RAM[(m_regPtr<<3)+(x)]; }
void WR_REG(UINT8 x, UINT8 d) { m_RAM[(m_regPtr<<3)+(x)]=(d); }
diff --git a/src/emu/cpu/alto2/a2curt.h b/src/emu/cpu/alto2/a2curt.h
index 937f1b4d450..cdfc6a22973 100644
--- a/src/emu/cpu/alto2/a2curt.h
+++ b/src/emu/cpu/alto2/a2curt.h
@@ -14,7 +14,7 @@
//! F2 functions for cursor task
enum {
f2_curt_load_xpreg = f2_task_10, //!< f2 10: load x position register
- f2_curt_load_csr = f2_task_11, //!< f2 11: load cursor shift register
+ f2_curt_load_csr = f2_task_11 //!< f2 11: load cursor shift register
};
void f1_early_curt_block(); //!< f1_curt_block early: disable the cursor task and set the curt_blocks flag
diff --git a/src/emu/cpu/alto2/a2dht.h b/src/emu/cpu/alto2/a2dht.h
index 615c3d7d86b..9ff7acc17f4 100644
--- a/src/emu/cpu/alto2/a2dht.h
+++ b/src/emu/cpu/alto2/a2dht.h
@@ -14,7 +14,7 @@
//! F2 functions for display horizontal task
enum {
f2_dht_evenfield = f2_task_10, //!< f2 10: load even field
- f2_dht_setmode = f2_task_11, //!< f2 11: set mode
+ f2_dht_setmode = f2_task_11 //!< f2 11: set mode
};
void f1_early_dht_block(); //!< F1 func: disable the display word task
diff --git a/src/emu/cpu/alto2/a2ksec.h b/src/emu/cpu/alto2/a2ksec.h
index e0660bf70b1..96c2530a2a5 100644
--- a/src/emu/cpu/alto2/a2ksec.h
+++ b/src/emu/cpu/alto2/a2ksec.h
@@ -36,7 +36,7 @@ enum {
f2_ksec_xfrdat = f2_task_13, //!< f2 13: branches NEXT[9] on !SEEKONLY
f2_ksec_swrnrdy = f2_task_14, //!< f2 14: branches NEXT[9] on !SWRDY
f2_ksec_nfer = f2_task_15, //!< f2 15: branches NEXT[9] on !KFER
- f2_ksec_strobon = f2_task_16, //!< f2 16: branches NEXT[9] on STROBE
+ f2_ksec_strobon = f2_task_16 //!< f2 16: branches NEXT[9] on STROBE
//!< f2 17: undefined
};
diff --git a/src/emu/cpu/alto2/a2kwd.h b/src/emu/cpu/alto2/a2kwd.h
index 7bd7a824a3b..678408501d2 100644
--- a/src/emu/cpu/alto2/a2kwd.h
+++ b/src/emu/cpu/alto2/a2kwd.h
@@ -26,7 +26,7 @@ enum {
f1_kwd_clrstat = f1_task_14, //!< f1 14: clear status register
f1_kwd_load_kcom = f1_task_15, //!< f1 15: load kcom register
f1_kwd_load_kadr = f1_task_16, //!< f1 16: load kadr register
- f1_kwd_load_kdata = f1_task_17, //!< f1 17: load kdata register
+ f1_kwd_load_kdata = f1_task_17 //!< f1 17: load kdata register
};
//! F2 functions for disk word task
@@ -37,7 +37,7 @@ enum {
f2_kwd_xfrdat = f2_task_13, //!< f2 13: branches NEXT[9] on !SEEKONLY
f2_kwd_swrnrdy = f2_task_14, //!< f2 14: branches NEXT[9] on !SWRDY
f2_kwd_nfer = f2_task_15, //!< f2 15: branches NEXT[9] on !KFER
- f2_kwd_strobon = f2_task_16, //!< f2 16: branches NEXT[9] on STROBE
+ f2_kwd_strobon = f2_task_16 //!< f2 16: branches NEXT[9] on STROBE
//!< f2 17: undefined
};
diff --git a/src/emu/cpu/alto2/alto2cpu.c b/src/emu/cpu/alto2/alto2cpu.c
index 70cef3061b1..9c62096b5dd 100644
--- a/src/emu/cpu/alto2/alto2cpu.c
+++ b/src/emu/cpu/alto2/alto2cpu.c
@@ -250,7 +250,7 @@ alto2_cpu_device::~alto2_cpu_device()
void alto2_cpu_device::set_diablo(int unit, diablo_hd_device* ptr)
{
- logerror("%s: unit=%d diablo_hd_device=%p\n", __FUNCTION__, unit, ptr);
+ logerror("%s: unit=%d diablo_hd_device=%p\n", __FUNCTION__, unit, (void *) ptr);
m_drive[unit] = ptr;
}
diff --git a/src/emu/cpu/am29000/am29000.c b/src/emu/cpu/am29000/am29000.c
index ee0dd825a60..27924fa163f 100644
--- a/src/emu/cpu/am29000/am29000.c
+++ b/src/emu/cpu/am29000/am29000.c
@@ -479,7 +479,7 @@ UINT32 am29000_cpu_device::read_program_word(UINT32 address)
{
/* TODO: ROM enable? */
if (m_cps & CPS_PI || m_cps & CPS_RE)
- return m_direct->read_decrypted_dword(address);
+ return m_direct->read_dword(address);
else
{
fatalerror("Am29000 instruction MMU translation enabled!\n");
@@ -626,7 +626,7 @@ void am29000_cpu_device::execute_run()
if (m_cfg & CFG_VF)
{
UINT32 vaddr = m_vab | m_exception_queue[0] * 4;
- UINT32 vect = m_datadirect->read_decrypted_dword(vaddr);
+ UINT32 vect = m_datadirect->read_dword(vaddr);
m_pc = vect & ~3;
m_next_pc = m_pc;
diff --git a/src/emu/cpu/am29000/am29000.h b/src/emu/cpu/am29000/am29000.h
index ff83dacddea..c47d87fd7ce 100644
--- a/src/emu/cpu/am29000/am29000.h
+++ b/src/emu/cpu/am29000/am29000.h
@@ -273,7 +273,7 @@ enum
SPR_CR = 135,
SPR_FPE = 160,
SPR_INTE = 161,
- SPR_FPS = 162,
+ SPR_FPS = 162
};
@@ -282,7 +282,7 @@ enum
SPACE_INSTRUCTION = 0,
SPACE_DATA,
SPACE_IO,
- SPACE_COPROCESSOR,
+ SPACE_COPROCESSOR
};
@@ -319,7 +319,7 @@ enum
EXCEPTION_MULTMU = 31,
EXCEPTION_MULTIPLY = 32,
EXCEPTION_DIVIDE = 33,
- EXCEPTION_MULTIPLU = 44, // TODO: FINISH ME
+ EXCEPTION_MULTIPLU = 44 // TODO: FINISH ME
};
diff --git a/src/emu/cpu/amis2000/amis2000.c b/src/emu/cpu/amis2000/amis2000.c
index 1d3c198952f..3082b09f14b 100644
--- a/src/emu/cpu/amis2000/amis2000.c
+++ b/src/emu/cpu/amis2000/amis2000.c
@@ -21,8 +21,6 @@
#include "amis2000.h"
#include "debugger.h"
-#include "amis2000op.inc"
-
// S2000 is the most basic one, 64 nibbles internal RAM and 1KB internal ROM
// S2150 increased RAM to 80 nibbles and ROM to 1.5KB
diff --git a/src/emu/cpu/amis2000/amis2000op.inc b/src/emu/cpu/amis2000/amis2000op.c
index f561b67f5eb..02f23ebed0a 100644
--- a/src/emu/cpu/amis2000/amis2000op.inc
+++ b/src/emu/cpu/amis2000/amis2000op.c
@@ -1,7 +1,11 @@
// license:BSD-3-Clause
// copyright-holders:hap
+
// AMI S2000 opcode handlers
+#include "amis2000.h"
+
+
// internal helpers
inline UINT8 amis2000_base_device::ram_r()
diff --git a/src/emu/cpu/apexc/apexc.c b/src/emu/cpu/apexc/apexc.c
index 7a982e01f53..77e5c919f44 100644
--- a/src/emu/cpu/apexc/apexc.c
+++ b/src/emu/cpu/apexc/apexc.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Raphael Nabet
/*
cpu/apexc/apexc.c: APE(X)C CPU emulation
diff --git a/src/emu/cpu/apexc/apexc.h b/src/emu/cpu/apexc/apexc.h
index 98ebc825f35..538d903ab44 100644
--- a/src/emu/cpu/apexc/apexc.h
+++ b/src/emu/cpu/apexc/apexc.h
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Raphael Nabet
/* register names for apexc_get_reg & apexc_set_reg */
#pragma once
diff --git a/src/emu/cpu/apexc/apexcdsm.c b/src/emu/cpu/apexc/apexcdsm.c
index c79359c7025..81effc58b0e 100644
--- a/src/emu/cpu/apexc/apexcdsm.c
+++ b/src/emu/cpu/apexc/apexcdsm.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Raphael Nabet
/*
cpu/apexc/apexcsm.c : APE(X)C CPU disassembler
diff --git a/src/emu/cpu/arcompact/arcompact.h b/src/emu/cpu/arcompact/arcompact.h
index c7b2b32f7fb..09f1cf708c2 100644
--- a/src/emu/cpu/arcompact/arcompact.h
+++ b/src/emu/cpu/arcompact/arcompact.h
@@ -31,7 +31,7 @@ ARCOMPACT_RETTYPE arcompact_handle##name##_p11(OPS_32) \
} \
\
return 0; \
-};
+}
#define ARCOMPACT_HANDLER04_TYPE(name) \
ARCOMPACT_RETTYPE arcompact_handle##name(OPS_32) \
{ \
@@ -46,7 +46,7 @@ ARCOMPACT_RETTYPE arcompact_handle##name(OPS_32) \
} \
\
return 0; \
-};
+}
#define ARCOMPACT_HANDLER04_TYPE_PM(name) \
ARCOMPACT_RETTYPE arcompact_handle##name##_p00(OPS_32); \
@@ -779,34 +779,34 @@ protected:
ARCOMPACT_RETTYPE get_insruction(OPS_32);
- ARCOMPACT_HANDLER04_TYPE_PM(04_00);
- ARCOMPACT_HANDLER04_TYPE_PM(04_02);
- ARCOMPACT_HANDLER04_TYPE_PM(04_04);
- ARCOMPACT_HANDLER04_TYPE_PM(04_05);
- ARCOMPACT_HANDLER04_TYPE_PM(04_06);
- ARCOMPACT_HANDLER04_TYPE_PM(04_07);
- ARCOMPACT_HANDLER04_TYPE_PM(04_0a);
- ARCOMPACT_HANDLER04_TYPE_PM(04_0e);
- ARCOMPACT_HANDLER04_TYPE_PM(04_0f);
- ARCOMPACT_HANDLER04_TYPE_PM(04_13);
- ARCOMPACT_HANDLER04_TYPE_PM(04_14);
- ARCOMPACT_HANDLER04_TYPE_PM(04_15);
- ARCOMPACT_HANDLER04_TYPE_PM(04_16);
- ARCOMPACT_HANDLER04_TYPE_PM(04_17);
- ARCOMPACT_HANDLER04_TYPE_PM(04_18);
- ARCOMPACT_HANDLER04_TYPE_PM(04_19);
- ARCOMPACT_HANDLER04_TYPE_PM(04_20);
- ARCOMPACT_HANDLER04_TYPE_PM(04_21);
- ARCOMPACT_HANDLER04_TYPE_PM(04_2a);
- ARCOMPACT_HANDLER04_TYPE_PM(04_2b);
-
- ARCOMPACT_HANDLER04_TYPE_PM(04_2f_02);
- ARCOMPACT_HANDLER04_TYPE_PM(04_2f_03);
- ARCOMPACT_HANDLER04_TYPE_PM(04_2f_07);
- ARCOMPACT_HANDLER04_TYPE_PM(04_2f_08);
-
- ARCOMPACT_HANDLER04_TYPE_PM(05_00);
- ARCOMPACT_HANDLER04_TYPE_PM(05_01);
+ ARCOMPACT_HANDLER04_TYPE_PM(04_00)
+ ARCOMPACT_HANDLER04_TYPE_PM(04_02)
+ ARCOMPACT_HANDLER04_TYPE_PM(04_04)
+ ARCOMPACT_HANDLER04_TYPE_PM(04_05)
+ ARCOMPACT_HANDLER04_TYPE_PM(04_06)
+ ARCOMPACT_HANDLER04_TYPE_PM(04_07)
+ ARCOMPACT_HANDLER04_TYPE_PM(04_0a)
+ ARCOMPACT_HANDLER04_TYPE_PM(04_0e)
+ ARCOMPACT_HANDLER04_TYPE_PM(04_0f)
+ ARCOMPACT_HANDLER04_TYPE_PM(04_13)
+ ARCOMPACT_HANDLER04_TYPE_PM(04_14)
+ ARCOMPACT_HANDLER04_TYPE_PM(04_15)
+ ARCOMPACT_HANDLER04_TYPE_PM(04_16)
+ ARCOMPACT_HANDLER04_TYPE_PM(04_17)
+ ARCOMPACT_HANDLER04_TYPE_PM(04_18)
+ ARCOMPACT_HANDLER04_TYPE_PM(04_19)
+ ARCOMPACT_HANDLER04_TYPE_PM(04_20)
+ ARCOMPACT_HANDLER04_TYPE_PM(04_21)
+ ARCOMPACT_HANDLER04_TYPE_PM(04_2a)
+ ARCOMPACT_HANDLER04_TYPE_PM(04_2b)
+
+ ARCOMPACT_HANDLER04_TYPE_PM(04_2f_02)
+ ARCOMPACT_HANDLER04_TYPE_PM(04_2f_03)
+ ARCOMPACT_HANDLER04_TYPE_PM(04_2f_07)
+ ARCOMPACT_HANDLER04_TYPE_PM(04_2f_08)
+
+ ARCOMPACT_HANDLER04_TYPE_PM(05_00)
+ ARCOMPACT_HANDLER04_TYPE_PM(05_01)
private:
diff --git a/src/emu/cpu/arcompact/arcompactdasm.c b/src/emu/cpu/arcompact/arcompactdasm.c
index aeb0c8747ac..0b917a05d56 100644
--- a/src/emu/cpu/arcompact/arcompactdasm.c
+++ b/src/emu/cpu/arcompact/arcompactdasm.c
@@ -22,7 +22,7 @@
#define ARCOMPACT_OPERATION ((op & 0xf800) >> 11)
-extern char *output;;
+extern char *output;
CPU_DISASSEMBLE(arcompact)
{
diff --git a/src/emu/cpu/arm/arm.c b/src/emu/cpu/arm/arm.c
index 3b2b410bf58..8d9b420486d 100644
--- a/src/emu/cpu/arm/arm.c
+++ b/src/emu/cpu/arm/arm.c
@@ -345,7 +345,7 @@ void arm_cpu_device::execute_run()
/* load instruction */
pc = R15;
- insn = m_direct->read_decrypted_dword( pc & ADDRESS_MASK );
+ insn = m_direct->read_dword( pc & ADDRESS_MASK );
switch (insn >> INSN_COND_SHIFT)
{
diff --git a/src/emu/cpu/arm7/arm7.c b/src/emu/cpu/arm7/arm7.c
index 65125f265f6..346dcb1020d 100644
--- a/src/emu/cpu/arm7/arm7.c
+++ b/src/emu/cpu/arm7/arm7.c
@@ -168,14 +168,14 @@ void arm7_cpu_device::set_cpsr(UINT32 val)
enum
{
TLB_COARSE = 0,
- TLB_FINE,
+ TLB_FINE
};
enum
{
FAULT_NONE = 0,
FAULT_DOMAIN,
- FAULT_PERMISSION,
+ FAULT_PERMISSION
};
@@ -641,7 +641,7 @@ void arm7_cpu_device::execute_run()
}
}
- insn = m_direct->read_decrypted_word(raddr);
+ insn = m_direct->read_word(raddr);
(this->*thumb_handler[(insn & 0xffc0) >> 6])(pc, insn);
}
@@ -672,7 +672,7 @@ void arm7_cpu_device::execute_run()
}
#endif
- insn = m_direct->read_decrypted_dword(raddr);
+ insn = m_direct->read_dword(raddr);
/* process condition codes for this instruction */
switch (insn >> INSN_COND_SHIFT)
diff --git a/src/emu/cpu/arm7/arm7core.h b/src/emu/cpu/arm7/arm7core.h
index 0883bae8291..2bdd15d7ba3 100644
--- a/src/emu/cpu/arm7/arm7core.h
+++ b/src/emu/cpu/arm7/arm7core.h
@@ -148,7 +148,7 @@ enum
eARM_ARCHFLAGS_MMU = 8, // has on-board MMU (traditional ARM style like the SA1110)
eARM_ARCHFLAGS_SA = 16, // StrongARM extensions (enhanced TLB)
eARM_ARCHFLAGS_XSCALE = 32, // XScale extensions (CP14, enhanced TLB)
- eARM_ARCHFLAGS_MODE26 = 64, // supports 26-bit backwards compatibility mode
+ eARM_ARCHFLAGS_MODE26 = 64 // supports 26-bit backwards compatibility mode
};
diff --git a/src/emu/cpu/arm7/arm7drc.inc b/src/emu/cpu/arm7/arm7drc.inc
index fc97e35da1f..d31eee5a632 100644
--- a/src/emu/cpu/arm7/arm7drc.inc
+++ b/src/emu/cpu/arm7/arm7drc.inc
@@ -671,7 +671,7 @@ void arm7_cpu_device::static_generate_check_irq()
UML_LABEL(block, done); // done:
block->end();
-};
+}
/*-------------------------------------------------
static_generate_nocode_handler - generate an
@@ -1203,12 +1203,12 @@ void arm7_cpu_device::generate_checksum_block(drcuml_block *block, compiler_stat
if (!(seqhead->flags & OPFLAG_VIRTUAL_NOOP))
{
UINT32 sum = seqhead->opptr.l[0];
- void *base = m_direct->read_decrypted_ptr(seqhead->physpc);
+ void *base = m_direct->read_ptr(seqhead->physpc);
UML_LOAD(block, uml::I0, base, 0, uml::SIZE_DWORD, uml::SCALE_x4); // load i0,base,0,dword
if (seqhead->delay.first() != NULL && seqhead->physpc != seqhead->delay.first()->physpc)
{
- base = m_direct->read_decrypted_ptr(seqhead->delay.first()->physpc);
+ base = m_direct->read_ptr(seqhead->delay.first()->physpc);
UML_LOAD(block, uml::I1, base, 0, uml::SIZE_DWORD, uml::SCALE_x4); // load i1,base,dword
UML_ADD(block, uml::I0, uml::I0, uml::I1); // add i0,i0,i1
@@ -1224,20 +1224,20 @@ void arm7_cpu_device::generate_checksum_block(drcuml_block *block, compiler_stat
else
{
UINT32 sum = 0;
- void *base = m_direct->read_decrypted_ptr(seqhead->physpc);
+ void *base = m_direct->read_ptr(seqhead->physpc);
UML_LOAD(block, uml::I0, base, 0, uml::SIZE_DWORD, uml::SCALE_x4); // load i0,base,0,dword
sum += seqhead->opptr.l[0];
for (curdesc = seqhead->next(); curdesc != seqlast->next(); curdesc = curdesc->next())
if (!(curdesc->flags & OPFLAG_VIRTUAL_NOOP))
{
- base = m_direct->read_decrypted_ptr(curdesc->physpc);
+ base = m_direct->read_ptr(curdesc->physpc);
UML_LOAD(block, uml::I1, base, 0, uml::SIZE_DWORD, uml::SCALE_x4); // load i1,base,dword
UML_ADD(block, uml::I0, uml::I0, uml::I1); // add i0,i0,i1
sum += curdesc->opptr.l[0];
if (curdesc->delay.first() != NULL && (curdesc == seqlast || (curdesc->next() != NULL && curdesc->next()->physpc != curdesc->delay.first()->physpc)))
{
- base = m_direct->read_decrypted_ptr(curdesc->delay.first()->physpc);
+ base = m_direct->read_ptr(curdesc->delay.first()->physpc);
UML_LOAD(block, uml::I1, base, 0, uml::SIZE_DWORD, uml::SCALE_x4); // load i1,base,dword
UML_ADD(block, uml::I0, uml::I0, uml::I1); // add i0,i0,i1
sum += curdesc->delay.first()->opptr.l[0];
diff --git a/src/emu/cpu/asap/asap.c b/src/emu/cpu/asap/asap.c
index 1402ef8e442..21133e46975 100644
--- a/src/emu/cpu/asap/asap.c
+++ b/src/emu/cpu/asap/asap.c
@@ -343,7 +343,7 @@ offs_t asap_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *opr
inline UINT32 asap_device::readop(offs_t pc)
{
- return m_direct->read_decrypted_dword(pc);
+ return m_direct->read_dword(pc);
}
diff --git a/src/emu/cpu/avr8/avr8.c b/src/emu/cpu/avr8/avr8.c
index 976b2ff8856..0f15c655cb4 100644
--- a/src/emu/cpu/avr8/avr8.c
+++ b/src/emu/cpu/avr8/avr8.c
@@ -12,9 +12,12 @@
the existing opcodes has been shown to wildly corrupt the video output in Craft, so one can assume that the
existing timing is 100% correct.
- Unimplemented opcodes: SPM, SPM Z+, EIJMP, SLEEP, BREAK, WDR, EICALL, JMP, CALL
+ Unimplemented opcodes: SPM, SPM Z+, SLEEP, BREAK, WDR, EICALL, JMP, CALL
- Changelist -
+ 05 Jul. 2015 [Felipe Sanches]
+ - Implemented EIJMP instruction
+
29 Dec. 2013 [Felipe Sanches]
- Added crude boilerplate code for Timer/Counter #4
@@ -92,7 +95,7 @@ enum
AVR8_SREG_S,
AVR8_SREG_H,
AVR8_SREG_T,
- AVR8_SREG_I,
+ AVR8_SREG_I
};
// I/O Enums
@@ -621,7 +624,7 @@ atmega1280_device::atmega1280_device(const machine_config &mconfig, const char *
//-------------------------------------------------
atmega2560_device::atmega2560_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : avr8_device(mconfig, "ATMEGA2560", tag, owner, clock, ATMEGA2560, 0x3ffff, ADDRESS_MAP_NAME(atmega2560_internal_map), CPU_TYPE_ATMEGA2560, "atmega2560", __FILE__)
+ : avr8_device(mconfig, "ATMEGA2560", tag, owner, clock, ATMEGA2560, 0x1ffff, ADDRESS_MAP_NAME(atmega2560_internal_map), CPU_TYPE_ATMEGA2560, "atmega2560", __FILE__)
{
}
@@ -869,6 +872,7 @@ void avr8_device::device_reset()
m_timer_prescale_count[t] = 0;
}
+ m_ocr2_not_reached_yet = true;
m_interrupt_pending = false;
m_elapsed_cycles = 0;
}
@@ -1173,11 +1177,11 @@ void avr8_device::timer0_tick()
switch(AVR8_WGM0)
{
case WGM02_NORMAL:
- printf("WGM02_NORMAL: Unimplemented timer#0 waveform generation mode\n");
+ //printf("WGM02_NORMAL: Unimplemented timer#0 waveform generation mode\n");
break;
case WGM02_PWM_PC:
- printf("WGM02_PWM_PC: Unimplemented timer#0 waveform generation mode\n");
+ //printf("WGM02_PWM_PC: Unimplemented timer#0 waveform generation mode\n");
break;
case WGM02_CTC_CMP:
@@ -1553,22 +1557,26 @@ void avr8_device::timer2_tick()
switch(wgm2)
{
case WGM02_FAST_PWM:
- if(count == ocr2[reg])
+ if (reg==0)
{
- if (reg == 0)
+ if (count >= m_r[AVR8_REGIDX_OCR2A])
{
- m_r[AVR8_REGIDX_TIFR2] |= AVR8_TIFR2_TOV2_MASK;
- count = 0;
- increment = 0;
- }
-
- m_r[AVR8_REGIDX_TIFR2] |= ocf2[reg];
- }
- else if(count == 0)
- {
- if (reg == 0)
- {
- m_r[AVR8_REGIDX_TIFR2] &= ~AVR8_TIFR2_TOV2_MASK;
+ if (count >= 0xFF)
+ {
+ //Turn on
+ m_io->write_byte(AVR8_IO_PORTD, m_io->read_byte(AVR8_IO_PORTD) | (1 << 7));
+ m_r[AVR8_REGIDX_TCNT2] = 0;
+ m_ocr2_not_reached_yet = true;
+ }
+ else
+ {
+ if (m_ocr2_not_reached_yet)
+ {
+ //Turn off
+ m_io->write_byte(AVR8_IO_PORTD, m_io->read_byte(AVR8_IO_PORTD) & ~(1 << 7));
+ m_ocr2_not_reached_yet = false;
+ }
+ }
}
}
break;
@@ -1585,7 +1593,7 @@ void avr8_device::timer2_tick()
m_r[AVR8_REGIDX_TIFR2] |= ocf2[reg];
}
- else if(count == 0)
+ else if (count == 0)
{
if (reg == 0)
{
@@ -1616,7 +1624,7 @@ void avr8_device::timer2_tick()
*/
}
- m_r[AVR8_REGIDX_TCNT2] = count + increment;
+ m_r[AVR8_REGIDX_TCNT2] += increment;
update_interrupt(AVR8_INTIDX_OCF2A);
update_interrupt(AVR8_INTIDX_OCF2B);
@@ -3533,8 +3541,8 @@ void avr8_device::execute_run()
opcycles = 2;
break;
case 0x0010: // EIJMP
- //output += sprintf( output, "EIJMP" );
- unimplemented_opcode(op);
+ m_pc = (m_r[AVR8_REGIDX_EIND] << 16 | ZREG) - 1;
+ opcycles = 2;
break;
default:
//output += sprintf( output, "Undefined (%04x)", op );
diff --git a/src/emu/cpu/avr8/avr8.h b/src/emu/cpu/avr8/avr8.h
index 2384c585804..3b3cbd8f6a0 100644
--- a/src/emu/cpu/avr8/avr8.h
+++ b/src/emu/cpu/avr8/avr8.h
@@ -162,6 +162,7 @@ protected:
UINT8 m_timer_increment[6];
UINT16 m_timer_prescale[6];
UINT16 m_timer_prescale_count[6];
+ bool m_ocr2_not_reached_yet;
// SPI
bool m_spi_active;
@@ -353,7 +354,7 @@ enum
AVR8_Y,
AVR8_Z,
AVR8_SPH,
- AVR8_SPL,
+ AVR8_SPL
};
enum
@@ -413,7 +414,7 @@ enum
ATMEGA644_INT_EE_RDY,
ATMEGA644_INT_ANALOG_COMP,
ATMEGA644_INT_TWI,
- ATMEGA644_INT_SPM_RDY,
+ ATMEGA644_INT_SPM_RDY
};
// Used by I/O register handling
@@ -730,7 +731,7 @@ enum
//0x133: Reserved
AVR8_REGIDX_UBRR3L = 0x134,
AVR8_REGIDX_UBRR3H,
- AVR8_REGIDX_UDR3,
+ AVR8_REGIDX_UDR3
//0x137: Reserved
// .
// . up to
@@ -765,7 +766,7 @@ enum
AVR8_REG_H,
AVR8_REG_J,
AVR8_REG_K,
- AVR8_REG_L,
+ AVR8_REG_L
};
enum
@@ -800,7 +801,7 @@ enum
AVR8_INTIDX_TOV5,
//---------------------------------
- AVR8_INTIDX_COUNT,
+ AVR8_INTIDX_COUNT
};
//lock bit masks
@@ -811,7 +812,7 @@ enum
BLB01 = (1 << 2),
BLB02 = (1 << 3),
BLB11 = (1 << 4),
- BLB12 = (1 << 5),
+ BLB12 = (1 << 5)
};
//extended fuses bit masks
@@ -819,7 +820,7 @@ enum
{
BODLEVEL0 = (1 << 0),
BODLEVEL1 = (1 << 1),
- BODLEVEL2 = (1 << 2),
+ BODLEVEL2 = (1 << 2)
};
//high fuses bit masks
@@ -832,7 +833,7 @@ enum
WDTON = (1 << 4),
SPIEN = (1 << 5),
JTAGEN = (1 << 6),
- OCDEN = (1 << 7),
+ OCDEN = (1 << 7)
};
//low fuses bit masks
@@ -845,7 +846,7 @@ enum
SUT0 = (1 << 4),
SUT1 = (1 << 5),
CKOUT = (1 << 6),
- CKDIV8 = (1 << 7),
+ CKDIV8 = (1 << 7)
};
#define AVR8_EEARH_MASK 0x01
diff --git a/src/emu/cpu/ccpu/ccpu.c b/src/emu/cpu/ccpu/ccpu.c
index a06ac8e003e..e8893580f0c 100644
--- a/src/emu/cpu/ccpu/ccpu.c
+++ b/src/emu/cpu/ccpu/ccpu.c
@@ -22,7 +22,7 @@ const device_type CCPU = &device_creator<ccpu_cpu_device>;
MACROS
***************************************************************************/
-#define READOP(a) (m_direct->read_decrypted_byte(a))
+#define READOP(a) (m_direct->read_byte(a))
#define RDMEM(a) (m_data->read_word((a) * 2) & 0xfff)
#define WRMEM(a,v) (m_data->write_word((a) * 2, (v)))
diff --git a/src/emu/cpu/cop400/cop400.c b/src/emu/cpu/cop400/cop400.c
index c52c1d18299..eca60705b2c 100644
--- a/src/emu/cpu/cop400/cop400.c
+++ b/src/emu/cpu/cop400/cop400.c
@@ -97,7 +97,7 @@ const device_type COP445 = &device_creator<cop445_cpu_device>;
MACROS
***************************************************************************/
-#define ROM(a) m_direct->read_decrypted_byte(a)
+#define ROM(a) m_direct->read_byte(a)
#define RAM_R(a) m_data->read_byte(a)
#define RAM_W(a, v) m_data->write_byte(a, v)
diff --git a/src/emu/cpu/cosmac/cosmac.c b/src/emu/cpu/cosmac/cosmac.c
index f33e5869725..f011e37a47a 100644
--- a/src/emu/cpu/cosmac/cosmac.c
+++ b/src/emu/cpu/cosmac/cosmac.c
@@ -533,7 +533,7 @@ offs_t cdp1802_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *
inline UINT8 cosmac_device::read_opcode(offs_t pc)
{
- return m_direct->read_decrypted_byte(pc);
+ return m_direct->read_byte(pc);
}
diff --git a/src/emu/cpu/cosmac/cosmac.h b/src/emu/cpu/cosmac/cosmac.h
index 139ff858e57..c80a8e9ab6c 100644
--- a/src/emu/cpu/cosmac/cosmac.h
+++ b/src/emu/cpu/cosmac/cosmac.h
@@ -165,7 +165,7 @@ enum
COSMAC_INPUT_LINE_EF1,
COSMAC_INPUT_LINE_EF2,
COSMAC_INPUT_LINE_EF3,
- COSMAC_INPUT_LINE_EF4,
+ COSMAC_INPUT_LINE_EF4
};
diff --git a/src/emu/cpu/cp1610/cp1610.c b/src/emu/cpu/cp1610/cp1610.c
index 1279a2cdd91..fd6fd5eceb7 100644
--- a/src/emu/cpu/cp1610/cp1610.c
+++ b/src/emu/cpu/cp1610/cp1610.c
@@ -46,7 +46,7 @@ const device_type CP1610 = &device_creator<cp1610_cpu_device>;
/* set sign and zero flags */
#define SET_SZ(n) \
if (n == 0) \
- m_flags |= Z; \
+ m_flags |= Z; \
else \
if (n & 0x8000) \
m_flags |= S
@@ -54,45 +54,32 @@ const device_type CP1610 = &device_creator<cp1610_cpu_device>;
/* set sign zero, and carry flags */
#define SET_SZC(n,m) \
if (n == 0) \
- m_flags |= Z; \
+ m_flags |= Z; \
else \
if (n & 0x8000) \
- m_flags |= S; \
+ m_flags |= S; \
if ((n + m) & 0x10000) \
m_flags |= C
/* set carry and overflow flags */
#define SET_COV(n,m,qq) \
- { unsigned int pp = n + m; \
+{ \
+ unsigned int pp = n + m; \
if (pp & 0x10000) \
- m_flags |= C; \
+ m_flags |= C; \
if (qq) \
{ \
if ((n^pp)&(~(m^n))&0x8000) \
- m_flags |= OV; \
+ m_flags |= OV; \
if (m == 0x8000) \
- m_flags ^= OV; \
+ m_flags ^= OV; \
} \
else \
{ \
if ((n^pp)&(~(m^n))&0x8000) \
m_flags |= OV; \
} \
- }
-
-#if 0
-#define SET_COV(n,m) \
- if ((n&0x7fff)+(m&0x7fff) > 0x7fff) \
- { \
- if (!(m_flags & C))\
- m_flags |= OV; \
- } \
- else \
- { \
- if (m_flags & C) \
- m_flags |= OV; \
- }
-#endif
+}
/***********************************
* illegal opcodes
@@ -368,16 +355,16 @@ void cp1610_cpu_device::cp1610_rlc_2(int r)
{
case 0:
offset = 0;
- break;
+ break;
case OV:
offset = 1;
- break;
+ break;
case C:
offset = 2;
- break;
+ break;
case (C | OV):
offset = 3;
- break;
+ break;
}
CLR_SZOC;
@@ -1098,10 +1085,6 @@ void cp1610_cpu_device::cp1610_mviat_i(int m, int d)
m_r[m]++;
m_r[d] = temp;
m_icount -= 8;
-
- //m_r[d] = cp1610_readmem16(m_r[m]);
- //m_r[m]++;
- //m_icount -= 8;
}
/***************************************************
@@ -1527,13 +1510,6 @@ void cp1610_cpu_device::cp1610_xori(int d)
m_icount -= 8;
}
-
-void cp1610_cpu_device::device_reset()
-{
- /* This is how we set the reset vector */
- set_input_line(CP1610_RESET, PULSE_LINE);
-}
-
/***************************************************
* S Z C OV 0x001 1 010 mmm ddd (mmm = 0xx)
* - - - - SDBD, MVI@ Rm, Rd
@@ -2040,61 +2016,61 @@ void cp1610_cpu_device::cp1610_do_sdbd()
case 0x260:
case 0x268:
case 0x270:
- case 0x278: /* 1 001 xxx xxx */ cp1610_illegal(); break;
-
- case 0x280: /* 1 010 000 xxx */ cp1610_sdbd_mviat(0,dest); break;
- case 0x288: /* 1 010 001 xxx */ cp1610_sdbd_mviat(1,dest); break;
- case 0x290: /* 1 010 010 xxx */ cp1610_sdbd_mviat(2,dest); break;
- case 0x298: /* 1 010 011 xxx */ cp1610_sdbd_mviat(3,dest); break;
- case 0x2a0: /* 1 010 100 xxx */ cp1610_sdbd_mviat_i(4,dest); break;
- case 0x2a8: /* 1 010 101 xxx */ cp1610_sdbd_mviat_i(5,dest); break;
- case 0x2b0: /* 1 010 110 xxx */ cp1610_sdbd_mviat_d(6,dest); break; /* ??? */
- case 0x2b8: /* 1 010 111 xxx */ cp1610_sdbd_mvii(dest); break;
-
- case 0x2c0: /* 1 011 000 xxx */ cp1610_sdbd_addat(0,dest); break;
- case 0x2c8: /* 1 011 001 xxx */ cp1610_sdbd_addat(1,dest); break;
- case 0x2d0: /* 1 011 010 xxx */ cp1610_sdbd_addat(2,dest); break;
- case 0x2d8: /* 1 011 011 xxx */ cp1610_sdbd_addat(3,dest); break;
- case 0x2e0: /* 1 011 100 xxx */ cp1610_sdbd_addat_i(4,dest); break;
- case 0x2e8: /* 1 011 101 xxx */ cp1610_sdbd_addat_i(5,dest); break;
- case 0x2f0: /* 1 011 110 xxx */ cp1610_sdbd_addat_d(6,dest); break; /* ??? */
- case 0x2f8: /* 1 011 111 xxx */ cp1610_sdbd_addi(dest); break;
-
- case 0x300: /* 1 100 000 xxx */ cp1610_sdbd_subat(0,dest); break;
- case 0x308: /* 1 100 001 xxx */ cp1610_sdbd_subat(1,dest); break;
- case 0x310: /* 1 100 010 xxx */ cp1610_sdbd_subat(2,dest); break;
- case 0x318: /* 1 100 011 xxx */ cp1610_sdbd_subat(3,dest); break;
- case 0x320: /* 1 100 100 xxx */ cp1610_sdbd_subat_i(4,dest); break;
- case 0x328: /* 1 100 101 xxx */ cp1610_sdbd_subat_i(5,dest); break;
- case 0x330: /* 1 100 110 xxx */ cp1610_sdbd_subat_d(6,dest); break; /* ??? */
- case 0x338: /* 1 100 111 xxx */ cp1610_sdbd_subi(dest); break;
-
- case 0x340: /* 1 101 000 xxx */ cp1610_sdbd_cmpat(0,dest); break;
- case 0x348: /* 1 101 001 xxx */ cp1610_sdbd_cmpat(1,dest); break;
- case 0x350: /* 1 101 010 xxx */ cp1610_sdbd_cmpat(2,dest); break;
- case 0x358: /* 1 101 011 xxx */ cp1610_sdbd_cmpat(3,dest); break;
- case 0x360: /* 1 101 100 xxx */ cp1610_sdbd_cmpat_i(4,dest); break;
- case 0x368: /* 1 101 101 xxx */ cp1610_sdbd_cmpat_i(5,dest); break;
- case 0x370: /* 1 101 110 xxx */ cp1610_sdbd_cmpat_d(6,dest); break; /* ??? */
- case 0x378: /* 1 101 111 xxx */ cp1610_sdbd_cmpi(dest); break;
-
- case 0x380: /* 1 110 000 xxx */ cp1610_sdbd_andat(0,dest); break;
- case 0x388: /* 1 110 001 xxx */ cp1610_sdbd_andat(1,dest); break;
- case 0x390: /* 1 110 010 xxx */ cp1610_sdbd_andat(2,dest); break;
- case 0x398: /* 1 110 011 xxx */ cp1610_sdbd_andat(3,dest); break;
- case 0x3a0: /* 1 110 100 xxx */ cp1610_sdbd_andat_i(4,dest); break;
- case 0x3a8: /* 1 110 101 xxx */ cp1610_sdbd_andat_i(5,dest); break;
- case 0x3b0: /* 1 110 110 xxx */ cp1610_sdbd_andat_d(6,dest); break; /* ??? */
- case 0x3b8: /* 1 110 111 xxx */ cp1610_sdbd_andi(dest); break;
-
- case 0x3c0: /* 1 110 000 xxx */ cp1610_sdbd_xorat(0,dest); break;
- case 0x3c8: /* 1 110 001 xxx */ cp1610_sdbd_xorat(1,dest); break;
- case 0x3d0: /* 1 110 010 xxx */ cp1610_sdbd_xorat(2,dest); break;
- case 0x3d8: /* 1 110 011 xxx */ cp1610_sdbd_xorat(3,dest); break;
- case 0x3e0: /* 1 110 100 xxx */ cp1610_sdbd_xorat_i(4,dest); break;
- case 0x3e8: /* 1 110 101 xxx */ cp1610_sdbd_xorat_i(5,dest); break;
- case 0x3f0: /* 1 110 110 xxx */ cp1610_sdbd_xorat_d(6,dest); break; /* ??? */
- case 0x3f8: /* 1 110 111 xxx */ cp1610_sdbd_xori(dest); break;
+ case 0x278: /* 1 001 xxx xxx */ cp1610_illegal(); break;
+
+ case 0x280: /* 1 010 000 xxx */ cp1610_sdbd_mviat(0,dest); break;
+ case 0x288: /* 1 010 001 xxx */ cp1610_sdbd_mviat(1,dest); break;
+ case 0x290: /* 1 010 010 xxx */ cp1610_sdbd_mviat(2,dest); break;
+ case 0x298: /* 1 010 011 xxx */ cp1610_sdbd_mviat(3,dest); break;
+ case 0x2a0: /* 1 010 100 xxx */ cp1610_sdbd_mviat_i(4,dest); break;
+ case 0x2a8: /* 1 010 101 xxx */ cp1610_sdbd_mviat_i(5,dest); break;
+ case 0x2b0: /* 1 010 110 xxx */ cp1610_sdbd_mviat_d(6,dest); break; /* ??? */
+ case 0x2b8: /* 1 010 111 xxx */ cp1610_sdbd_mvii(dest); break;
+
+ case 0x2c0: /* 1 011 000 xxx */ cp1610_sdbd_addat(0,dest); break;
+ case 0x2c8: /* 1 011 001 xxx */ cp1610_sdbd_addat(1,dest); break;
+ case 0x2d0: /* 1 011 010 xxx */ cp1610_sdbd_addat(2,dest); break;
+ case 0x2d8: /* 1 011 011 xxx */ cp1610_sdbd_addat(3,dest); break;
+ case 0x2e0: /* 1 011 100 xxx */ cp1610_sdbd_addat_i(4,dest); break;
+ case 0x2e8: /* 1 011 101 xxx */ cp1610_sdbd_addat_i(5,dest); break;
+ case 0x2f0: /* 1 011 110 xxx */ cp1610_sdbd_addat_d(6,dest); break; /* ??? */
+ case 0x2f8: /* 1 011 111 xxx */ cp1610_sdbd_addi(dest); break;
+
+ case 0x300: /* 1 100 000 xxx */ cp1610_sdbd_subat(0,dest); break;
+ case 0x308: /* 1 100 001 xxx */ cp1610_sdbd_subat(1,dest); break;
+ case 0x310: /* 1 100 010 xxx */ cp1610_sdbd_subat(2,dest); break;
+ case 0x318: /* 1 100 011 xxx */ cp1610_sdbd_subat(3,dest); break;
+ case 0x320: /* 1 100 100 xxx */ cp1610_sdbd_subat_i(4,dest); break;
+ case 0x328: /* 1 100 101 xxx */ cp1610_sdbd_subat_i(5,dest); break;
+ case 0x330: /* 1 100 110 xxx */ cp1610_sdbd_subat_d(6,dest); break; /* ??? */
+ case 0x338: /* 1 100 111 xxx */ cp1610_sdbd_subi(dest); break;
+
+ case 0x340: /* 1 101 000 xxx */ cp1610_sdbd_cmpat(0,dest); break;
+ case 0x348: /* 1 101 001 xxx */ cp1610_sdbd_cmpat(1,dest); break;
+ case 0x350: /* 1 101 010 xxx */ cp1610_sdbd_cmpat(2,dest); break;
+ case 0x358: /* 1 101 011 xxx */ cp1610_sdbd_cmpat(3,dest); break;
+ case 0x360: /* 1 101 100 xxx */ cp1610_sdbd_cmpat_i(4,dest); break;
+ case 0x368: /* 1 101 101 xxx */ cp1610_sdbd_cmpat_i(5,dest); break;
+ case 0x370: /* 1 101 110 xxx */ cp1610_sdbd_cmpat_d(6,dest); break; /* ??? */
+ case 0x378: /* 1 101 111 xxx */ cp1610_sdbd_cmpi(dest); break;
+
+ case 0x380: /* 1 110 000 xxx */ cp1610_sdbd_andat(0,dest); break;
+ case 0x388: /* 1 110 001 xxx */ cp1610_sdbd_andat(1,dest); break;
+ case 0x390: /* 1 110 010 xxx */ cp1610_sdbd_andat(2,dest); break;
+ case 0x398: /* 1 110 011 xxx */ cp1610_sdbd_andat(3,dest); break;
+ case 0x3a0: /* 1 110 100 xxx */ cp1610_sdbd_andat_i(4,dest); break;
+ case 0x3a8: /* 1 110 101 xxx */ cp1610_sdbd_andat_i(5,dest); break;
+ case 0x3b0: /* 1 110 110 xxx */ cp1610_sdbd_andat_d(6,dest); break; /* ??? */
+ case 0x3b8: /* 1 110 111 xxx */ cp1610_sdbd_andi(dest); break;
+
+ case 0x3c0: /* 1 110 000 xxx */ cp1610_sdbd_xorat(0,dest); break;
+ case 0x3c8: /* 1 110 001 xxx */ cp1610_sdbd_xorat(1,dest); break;
+ case 0x3d0: /* 1 110 010 xxx */ cp1610_sdbd_xorat(2,dest); break;
+ case 0x3d8: /* 1 110 011 xxx */ cp1610_sdbd_xorat(3,dest); break;
+ case 0x3e0: /* 1 110 100 xxx */ cp1610_sdbd_xorat_i(4,dest); break;
+ case 0x3e8: /* 1 110 101 xxx */ cp1610_sdbd_xorat_i(5,dest); break;
+ case 0x3f0: /* 1 110 110 xxx */ cp1610_sdbd_xorat_d(6,dest); break; /* ??? */
+ case 0x3f8: /* 1 110 111 xxx */ cp1610_sdbd_xori(dest); break;
default: cp1610_illegal(); break;
}
}
@@ -2115,25 +2091,25 @@ void cp1610_cpu_device::cp1610_do_jumps()
switch( jumptype )
{
- case 0x000: /* 0 0xx xxx x00 */ cp1610_jsr(4,addr); break;
- case 0x001: /* 0 0xx xxx x01 */ cp1610_jsre(4,addr); break;
- case 0x002: /* 0 0xx xxx x10 */ cp1610_jsrd(4,addr); break;
- case 0x003: /* 0 0xx xxx x11 */ cp1610_illegal(); break;
-
- case 0x100: /* 0 1xx xxx x00 */ cp1610_jsr(5,addr); break;
- case 0x101: /* 0 1xx xxx x01 */ cp1610_jsre(5,addr); break;
- case 0x102: /* 0 1xx xxx x10 */ cp1610_jsrd(5,addr); break;
- case 0x103: /* 0 1xx xxx x11 */ cp1610_illegal(); break;
-
- case 0x200: /* 1 0xx xxx x00 */ cp1610_jsr(6,addr); break;
- case 0x201: /* 1 0xx xxx x01 */ cp1610_jsre(6,addr); break;
- case 0x202: /* 1 0xx xxx x10 */ cp1610_jsrd(6,addr); break;
- case 0x203: /* 1 0xx xxx x11 */ cp1610_illegal(); break;
-
- case 0x300: /* 1 1xx xxx x00 */ cp1610_j(addr); break;
- case 0x301: /* 1 1xx xxx x01 */ cp1610_je(addr); break;
- case 0x302: /* 1 1xx xxx x10 */ cp1610_jd(addr); break;
- case 0x303: /* 1 1xx xxx x11 */ cp1610_illegal(); break;
+ case 0x000: /* 0 0xx xxx x00 */ cp1610_jsr(4,addr); break;
+ case 0x001: /* 0 0xx xxx x01 */ cp1610_jsre(4,addr); break;
+ case 0x002: /* 0 0xx xxx x10 */ cp1610_jsrd(4,addr); break;
+ case 0x003: /* 0 0xx xxx x11 */ cp1610_illegal(); break;
+
+ case 0x100: /* 0 1xx xxx x00 */ cp1610_jsr(5,addr); break;
+ case 0x101: /* 0 1xx xxx x01 */ cp1610_jsre(5,addr); break;
+ case 0x102: /* 0 1xx xxx x10 */ cp1610_jsrd(5,addr); break;
+ case 0x103: /* 0 1xx xxx x11 */ cp1610_illegal(); break;
+
+ case 0x200: /* 1 0xx xxx x00 */ cp1610_jsr(6,addr); break;
+ case 0x201: /* 1 0xx xxx x01 */ cp1610_jsre(6,addr); break;
+ case 0x202: /* 1 0xx xxx x10 */ cp1610_jsrd(6,addr); break;
+ case 0x203: /* 1 0xx xxx x11 */ cp1610_illegal(); break;
+
+ case 0x300: /* 1 1xx xxx x00 */ cp1610_j(addr); break;
+ case 0x301: /* 1 1xx xxx x01 */ cp1610_je(addr); break;
+ case 0x302: /* 1 1xx xxx x10 */ cp1610_jd(addr); break;
+ case 0x303: /* 1 1xx xxx x11 */ cp1610_illegal(); break;
}
m_icount -= 12;
@@ -2166,104 +2142,104 @@ void cp1610_cpu_device::execute_run()
switch( opcode )
{
/* opcode bitmask */
- case 0x000: /* 0 000 000 000 */ cp1610_hlt(); break; /* TBD */
- case 0x001: /* 0 000 000 001 */ cp1610_do_sdbd(); break;
- case 0x002: /* 0 000 000 010 */ cp1610_eis(); break; /* TBD */
- case 0x003: /* 0 000 000 011 */ cp1610_dis(); break; /* TBD */
- case 0x004: /* 0 000 000 100 */ cp1610_do_jumps(); break;
- case 0x005: /* 0 000 000 101 */ cp1610_tci(); break; /* TBD */
- case 0x006: /* 0 000 000 110 */ cp1610_clrc(); break;
- case 0x007: /* 0 000 000 111 */ cp1610_setc(); break;
-
- case 0x008: /* 0 000 001 000 */ cp1610_incr(0); break;
- case 0x009: /* 0 000 001 001 */ cp1610_incr(1); break;
- case 0x00a: /* 0 000 001 010 */ cp1610_incr(2); break;
- case 0x00b: /* 0 000 001 011 */ cp1610_incr(3); break;
- case 0x00c: /* 0 000 001 100 */ cp1610_incr(4); break;
- case 0x00d: /* 0 000 001 101 */ cp1610_incr(5); break;
- case 0x00e: /* 0 000 001 110 */ cp1610_incr(6); break;
- case 0x00f: /* 0 000 001 111 */ cp1610_incr(7); break;
-
- case 0x010: /* 0 000 010 000 */ cp1610_decr(0); break;
- case 0x011: /* 0 000 010 001 */ cp1610_decr(1); break;
- case 0x012: /* 0 000 010 010 */ cp1610_decr(2); break;
- case 0x013: /* 0 000 010 011 */ cp1610_decr(3); break;
- case 0x014: /* 0 000 010 100 */ cp1610_decr(4); break;
- case 0x015: /* 0 000 010 101 */ cp1610_decr(5); break;
- case 0x016: /* 0 000 010 110 */ cp1610_decr(6); break;
- case 0x017: /* 0 000 010 111 */ cp1610_decr(7); break;
-
- case 0x018: /* 0 000 011 000 */ cp1610_comr(0); break;
- case 0x019: /* 0 000 011 001 */ cp1610_comr(1); break;
- case 0x01a: /* 0 000 011 010 */ cp1610_comr(2); break;
- case 0x01b: /* 0 000 011 011 */ cp1610_comr(3); break;
- case 0x01c: /* 0 000 011 100 */ cp1610_comr(4); break;
- case 0x01d: /* 0 000 011 101 */ cp1610_comr(5); break;
- case 0x01e: /* 0 000 011 110 */ cp1610_comr(6); break;
- case 0x01f: /* 0 000 011 111 */ cp1610_comr(7); break;
-
- case 0x020: /* 0 000 100 000 */ cp1610_negr(0); break;
- case 0x021: /* 0 000 100 001 */ cp1610_negr(1); break;
- case 0x022: /* 0 000 100 010 */ cp1610_negr(2); break;
- case 0x023: /* 0 000 100 011 */ cp1610_negr(3); break;
- case 0x024: /* 0 000 100 100 */ cp1610_negr(4); break;
- case 0x025: /* 0 000 100 101 */ cp1610_negr(5); break;
- case 0x026: /* 0 000 100 110 */ cp1610_negr(6); break;
- case 0x027: /* 0 000 100 111 */ cp1610_negr(7); break;
-
- case 0x028: /* 0 000 101 000 */ cp1610_adcr(0); break;
- case 0x029: /* 0 000 101 001 */ cp1610_adcr(1); break;
- case 0x02a: /* 0 000 101 010 */ cp1610_adcr(2); break;
- case 0x02b: /* 0 000 101 011 */ cp1610_adcr(3); break;
- case 0x02c: /* 0 000 101 100 */ cp1610_adcr(4); break;
- case 0x02d: /* 0 000 101 101 */ cp1610_adcr(5); break;
- case 0x02e: /* 0 000 101 110 */ cp1610_adcr(6); break;
- case 0x02f: /* 0 000 101 111 */ cp1610_adcr(7); break;
-
- case 0x030: /* 0 000 110 000 */ cp1610_gswd(0); break;
- case 0x031: /* 0 000 110 001 */ cp1610_gswd(1); break;
- case 0x032: /* 0 000 110 010 */ cp1610_gswd(2); break;
- case 0x033: /* 0 000 110 011 */ cp1610_gswd(3); break;
- case 0x034: /* 0 000 110 100 */ cp1610_nop(); break;
- case 0x035: /* 0 000 110 101 */ cp1610_nop(); break;
- case 0x036: /* 0 000 110 110 */ cp1610_sin(); break; /* TBD */
- case 0x037: /* 0 000 110 111 */ cp1610_sin(); break; /* TBD */
-
- case 0x038: /* 0 000 111 000 */ cp1610_rswd(0); break;
- case 0x039: /* 0 000 111 001 */ cp1610_rswd(1); break;
- case 0x03a: /* 0 000 111 010 */ cp1610_rswd(2); break;
- case 0x03b: /* 0 000 111 011 */ cp1610_rswd(3); break;
- case 0x03c: /* 0 000 111 100 */ cp1610_rswd(4); break;
- case 0x03d: /* 0 000 111 101 */ cp1610_rswd(5); break;
- case 0x03e: /* 0 000 111 110 */ cp1610_rswd(6); break;
- case 0x03f: /* 0 000 111 111 */ cp1610_rswd(7); break;
-
- case 0x040: /* 0 001 000 000 */ cp1610_swap(0); break;
- case 0x041: /* 0 001 000 001 */ cp1610_swap(1); break;
- case 0x042: /* 0 001 000 010 */ cp1610_swap(2); break;
- case 0x043: /* 0 001 000 011 */ cp1610_swap(3); break;
- case 0x044: /* 0 001 000 100 */ cp1610_dswap(0); break;
- case 0x045: /* 0 001 000 101 */ cp1610_dswap(1); break;
- case 0x046: /* 0 001 000 110 */ cp1610_dswap(2); break;
- case 0x047: /* 0 001 000 111 */ cp1610_dswap(3); break;
-
- case 0x048: /* 0 001 001 000 */ cp1610_sll_1(0); break;
- case 0x049: /* 0 001 001 001 */ cp1610_sll_1(1); break;
- case 0x04a: /* 0 001 001 010 */ cp1610_sll_1(2); break;
- case 0x04b: /* 0 001 001 011 */ cp1610_sll_1(3); break;
- case 0x04c: /* 0 001 001 100 */ cp1610_sll_2(0); break;
- case 0x04d: /* 0 001 001 101 */ cp1610_sll_2(1); break;
- case 0x04e: /* 0 001 001 110 */ cp1610_sll_2(2); break;
- case 0x04f: /* 0 001 001 111 */ cp1610_sll_2(3); break;
-
- case 0x050: /* 0 001 010 000 */ cp1610_rlc_1(0); break;
- case 0x051: /* 0 001 010 001 */ cp1610_rlc_1(1); break;
- case 0x052: /* 0 001 010 010 */ cp1610_rlc_1(2); break;
- case 0x053: /* 0 001 010 011 */ cp1610_rlc_1(3); break;
- case 0x054: /* 0 001 010 100 */ cp1610_rlc_2(0); break;
- case 0x055: /* 0 001 010 101 */ cp1610_rlc_2(1); break;
- case 0x056: /* 0 001 010 110 */ cp1610_rlc_2(2); break;
- case 0x057: /* 0 001 010 111 */ cp1610_rlc_2(3); break;
+ case 0x000: /* 0 000 000 000 */ cp1610_hlt(); break; /* TBD */
+ case 0x001: /* 0 000 000 001 */ cp1610_do_sdbd(); break;
+ case 0x002: /* 0 000 000 010 */ cp1610_eis(); break; /* TBD */
+ case 0x003: /* 0 000 000 011 */ cp1610_dis(); break; /* TBD */
+ case 0x004: /* 0 000 000 100 */ cp1610_do_jumps(); break;
+ case 0x005: /* 0 000 000 101 */ cp1610_tci(); break; /* TBD */
+ case 0x006: /* 0 000 000 110 */ cp1610_clrc(); break;
+ case 0x007: /* 0 000 000 111 */ cp1610_setc(); break;
+
+ case 0x008: /* 0 000 001 000 */ cp1610_incr(0); break;
+ case 0x009: /* 0 000 001 001 */ cp1610_incr(1); break;
+ case 0x00a: /* 0 000 001 010 */ cp1610_incr(2); break;
+ case 0x00b: /* 0 000 001 011 */ cp1610_incr(3); break;
+ case 0x00c: /* 0 000 001 100 */ cp1610_incr(4); break;
+ case 0x00d: /* 0 000 001 101 */ cp1610_incr(5); break;
+ case 0x00e: /* 0 000 001 110 */ cp1610_incr(6); break;
+ case 0x00f: /* 0 000 001 111 */ cp1610_incr(7); break;
+
+ case 0x010: /* 0 000 010 000 */ cp1610_decr(0); break;
+ case 0x011: /* 0 000 010 001 */ cp1610_decr(1); break;
+ case 0x012: /* 0 000 010 010 */ cp1610_decr(2); break;
+ case 0x013: /* 0 000 010 011 */ cp1610_decr(3); break;
+ case 0x014: /* 0 000 010 100 */ cp1610_decr(4); break;
+ case 0x015: /* 0 000 010 101 */ cp1610_decr(5); break;
+ case 0x016: /* 0 000 010 110 */ cp1610_decr(6); break;
+ case 0x017: /* 0 000 010 111 */ cp1610_decr(7); break;
+
+ case 0x018: /* 0 000 011 000 */ cp1610_comr(0); break;
+ case 0x019: /* 0 000 011 001 */ cp1610_comr(1); break;
+ case 0x01a: /* 0 000 011 010 */ cp1610_comr(2); break;
+ case 0x01b: /* 0 000 011 011 */ cp1610_comr(3); break;
+ case 0x01c: /* 0 000 011 100 */ cp1610_comr(4); break;
+ case 0x01d: /* 0 000 011 101 */ cp1610_comr(5); break;
+ case 0x01e: /* 0 000 011 110 */ cp1610_comr(6); break;
+ case 0x01f: /* 0 000 011 111 */ cp1610_comr(7); break;
+
+ case 0x020: /* 0 000 100 000 */ cp1610_negr(0); break;
+ case 0x021: /* 0 000 100 001 */ cp1610_negr(1); break;
+ case 0x022: /* 0 000 100 010 */ cp1610_negr(2); break;
+ case 0x023: /* 0 000 100 011 */ cp1610_negr(3); break;
+ case 0x024: /* 0 000 100 100 */ cp1610_negr(4); break;
+ case 0x025: /* 0 000 100 101 */ cp1610_negr(5); break;
+ case 0x026: /* 0 000 100 110 */ cp1610_negr(6); break;
+ case 0x027: /* 0 000 100 111 */ cp1610_negr(7); break;
+
+ case 0x028: /* 0 000 101 000 */ cp1610_adcr(0); break;
+ case 0x029: /* 0 000 101 001 */ cp1610_adcr(1); break;
+ case 0x02a: /* 0 000 101 010 */ cp1610_adcr(2); break;
+ case 0x02b: /* 0 000 101 011 */ cp1610_adcr(3); break;
+ case 0x02c: /* 0 000 101 100 */ cp1610_adcr(4); break;
+ case 0x02d: /* 0 000 101 101 */ cp1610_adcr(5); break;
+ case 0x02e: /* 0 000 101 110 */ cp1610_adcr(6); break;
+ case 0x02f: /* 0 000 101 111 */ cp1610_adcr(7); break;
+
+ case 0x030: /* 0 000 110 000 */ cp1610_gswd(0); break;
+ case 0x031: /* 0 000 110 001 */ cp1610_gswd(1); break;
+ case 0x032: /* 0 000 110 010 */ cp1610_gswd(2); break;
+ case 0x033: /* 0 000 110 011 */ cp1610_gswd(3); break;
+ case 0x034: /* 0 000 110 100 */ cp1610_nop(); break;
+ case 0x035: /* 0 000 110 101 */ cp1610_nop(); break;
+ case 0x036: /* 0 000 110 110 */ cp1610_sin(); break; /* TBD */
+ case 0x037: /* 0 000 110 111 */ cp1610_sin(); break; /* TBD */
+
+ case 0x038: /* 0 000 111 000 */ cp1610_rswd(0); break;
+ case 0x039: /* 0 000 111 001 */ cp1610_rswd(1); break;
+ case 0x03a: /* 0 000 111 010 */ cp1610_rswd(2); break;
+ case 0x03b: /* 0 000 111 011 */ cp1610_rswd(3); break;
+ case 0x03c: /* 0 000 111 100 */ cp1610_rswd(4); break;
+ case 0x03d: /* 0 000 111 101 */ cp1610_rswd(5); break;
+ case 0x03e: /* 0 000 111 110 */ cp1610_rswd(6); break;
+ case 0x03f: /* 0 000 111 111 */ cp1610_rswd(7); break;
+
+ case 0x040: /* 0 001 000 000 */ cp1610_swap(0); break;
+ case 0x041: /* 0 001 000 001 */ cp1610_swap(1); break;
+ case 0x042: /* 0 001 000 010 */ cp1610_swap(2); break;
+ case 0x043: /* 0 001 000 011 */ cp1610_swap(3); break;
+ case 0x044: /* 0 001 000 100 */ cp1610_dswap(0); break;
+ case 0x045: /* 0 001 000 101 */ cp1610_dswap(1); break;
+ case 0x046: /* 0 001 000 110 */ cp1610_dswap(2); break;
+ case 0x047: /* 0 001 000 111 */ cp1610_dswap(3); break;
+
+ case 0x048: /* 0 001 001 000 */ cp1610_sll_1(0); break;
+ case 0x049: /* 0 001 001 001 */ cp1610_sll_1(1); break;
+ case 0x04a: /* 0 001 001 010 */ cp1610_sll_1(2); break;
+ case 0x04b: /* 0 001 001 011 */ cp1610_sll_1(3); break;
+ case 0x04c: /* 0 001 001 100 */ cp1610_sll_2(0); break;
+ case 0x04d: /* 0 001 001 101 */ cp1610_sll_2(1); break;
+ case 0x04e: /* 0 001 001 110 */ cp1610_sll_2(2); break;
+ case 0x04f: /* 0 001 001 111 */ cp1610_sll_2(3); break;
+
+ case 0x050: /* 0 001 010 000 */ cp1610_rlc_1(0); break;
+ case 0x051: /* 0 001 010 001 */ cp1610_rlc_1(1); break;
+ case 0x052: /* 0 001 010 010 */ cp1610_rlc_1(2); break;
+ case 0x053: /* 0 001 010 011 */ cp1610_rlc_1(3); break;
+ case 0x054: /* 0 001 010 100 */ cp1610_rlc_2(0); break;
+ case 0x055: /* 0 001 010 101 */ cp1610_rlc_2(1); break;
+ case 0x056: /* 0 001 010 110 */ cp1610_rlc_2(2); break;
+ case 0x057: /* 0 001 010 111 */ cp1610_rlc_2(3); break;
case 0x058: /* 0 001 011 000 */ cp1610_sllc_1(0); break;
case 0x059: /* 0 001 011 001 */ cp1610_sllc_1(1); break;
@@ -2274,32 +2250,32 @@ void cp1610_cpu_device::execute_run()
case 0x05e: /* 0 001 011 110 */ cp1610_sllc_2(2); break;
case 0x05f: /* 0 001 011 111 */ cp1610_sllc_2(3); break;
- case 0x060: /* 0 001 100 000 */ cp1610_slr_1(0); break;
- case 0x061: /* 0 001 100 001 */ cp1610_slr_1(1); break;
- case 0x062: /* 0 001 100 010 */ cp1610_slr_1(2); break;
- case 0x063: /* 0 001 100 011 */ cp1610_slr_1(3); break;
- case 0x064: /* 0 001 100 100 */ cp1610_slr_2(0); break;
- case 0x065: /* 0 001 100 101 */ cp1610_slr_2(1); break;
- case 0x066: /* 0 001 100 110 */ cp1610_slr_2(2); break;
- case 0x067: /* 0 001 100 111 */ cp1610_slr_2(3); break;
-
- case 0x068: /* 0 001 101 000 */ cp1610_sar_1(0); break;
- case 0x069: /* 0 001 101 001 */ cp1610_sar_1(1); break;
- case 0x06a: /* 0 001 101 010 */ cp1610_sar_1(2); break;
- case 0x06b: /* 0 001 101 011 */ cp1610_sar_1(3); break;
- case 0x06c: /* 0 001 101 100 */ cp1610_sar_2(0); break;
- case 0x06d: /* 0 001 101 101 */ cp1610_sar_2(1); break;
- case 0x06e: /* 0 001 101 110 */ cp1610_sar_2(2); break;
- case 0x06f: /* 0 001 101 111 */ cp1610_sar_2(3); break;
-
- case 0x070: /* 0 001 110 000 */ cp1610_rrc_1(0); break;
- case 0x071: /* 0 001 110 001 */ cp1610_rrc_1(1); break;
- case 0x072: /* 0 001 110 010 */ cp1610_rrc_1(2); break;
- case 0x073: /* 0 001 110 011 */ cp1610_rrc_1(3); break;
- case 0x074: /* 0 001 110 100 */ cp1610_rrc_2(0); break;
- case 0x075: /* 0 001 110 101 */ cp1610_rrc_2(1); break;
- case 0x076: /* 0 001 110 110 */ cp1610_rrc_2(2); break;
- case 0x077: /* 0 001 110 111 */ cp1610_rrc_2(3); break;
+ case 0x060: /* 0 001 100 000 */ cp1610_slr_1(0); break;
+ case 0x061: /* 0 001 100 001 */ cp1610_slr_1(1); break;
+ case 0x062: /* 0 001 100 010 */ cp1610_slr_1(2); break;
+ case 0x063: /* 0 001 100 011 */ cp1610_slr_1(3); break;
+ case 0x064: /* 0 001 100 100 */ cp1610_slr_2(0); break;
+ case 0x065: /* 0 001 100 101 */ cp1610_slr_2(1); break;
+ case 0x066: /* 0 001 100 110 */ cp1610_slr_2(2); break;
+ case 0x067: /* 0 001 100 111 */ cp1610_slr_2(3); break;
+
+ case 0x068: /* 0 001 101 000 */ cp1610_sar_1(0); break;
+ case 0x069: /* 0 001 101 001 */ cp1610_sar_1(1); break;
+ case 0x06a: /* 0 001 101 010 */ cp1610_sar_1(2); break;
+ case 0x06b: /* 0 001 101 011 */ cp1610_sar_1(3); break;
+ case 0x06c: /* 0 001 101 100 */ cp1610_sar_2(0); break;
+ case 0x06d: /* 0 001 101 101 */ cp1610_sar_2(1); break;
+ case 0x06e: /* 0 001 101 110 */ cp1610_sar_2(2); break;
+ case 0x06f: /* 0 001 101 111 */ cp1610_sar_2(3); break;
+
+ case 0x070: /* 0 001 110 000 */ cp1610_rrc_1(0); break;
+ case 0x071: /* 0 001 110 001 */ cp1610_rrc_1(1); break;
+ case 0x072: /* 0 001 110 010 */ cp1610_rrc_1(2); break;
+ case 0x073: /* 0 001 110 011 */ cp1610_rrc_1(3); break;
+ case 0x074: /* 0 001 110 100 */ cp1610_rrc_2(0); break;
+ case 0x075: /* 0 001 110 101 */ cp1610_rrc_2(1); break;
+ case 0x076: /* 0 001 110 110 */ cp1610_rrc_2(2); break;
+ case 0x077: /* 0 001 110 111 */ cp1610_rrc_2(3); break;
case 0x078: /* 0 001 111 000 */ cp1610_sarc_1(0); break;
case 0x079: /* 0 001 111 001 */ cp1610_sarc_1(1); break;
@@ -2310,7 +2286,7 @@ void cp1610_cpu_device::execute_run()
case 0x07e: /* 0 001 111 110 */ cp1610_sarc_2(2); break;
case 0x07f: /* 0 001 111 111 */ cp1610_sarc_2(3); break;
- case 0x080: /* 0 010 000 000 */ cp1610_tstr(0); break;
+ case 0x080: /* 0 010 000 000 */ cp1610_tstr(0); break;
case 0x081: /* 0 010 000 001 */ cp1610_movr(0,1); break;
case 0x082: /* 0 010 000 010 */ cp1610_movr(0,2); break;
case 0x083: /* 0 010 000 011 */ cp1610_movr(0,3); break;
@@ -2320,7 +2296,7 @@ void cp1610_cpu_device::execute_run()
case 0x087: /* 0 010 000 111 */ cp1610_movr(0,7); break; /* jr */
case 0x088: /* 0 010 001 000 */ cp1610_movr(1,0); break;
- case 0x089: /* 0 010 001 001 */ cp1610_tstr(1); break;
+ case 0x089: /* 0 010 001 001 */ cp1610_tstr(1); break;
case 0x08a: /* 0 010 001 010 */ cp1610_movr(1,2); break;
case 0x08b: /* 0 010 001 011 */ cp1610_movr(1,3); break;
case 0x08c: /* 0 010 001 100 */ cp1610_movr(1,4); break;
@@ -2330,7 +2306,7 @@ void cp1610_cpu_device::execute_run()
case 0x090: /* 0 010 010 000 */ cp1610_movr(2,0); break;
case 0x091: /* 0 010 010 001 */ cp1610_movr(2,1); break;
- case 0x092: /* 0 010 010 010 */ cp1610_tstr(2); break;
+ case 0x092: /* 0 010 010 010 */ cp1610_tstr(2); break;
case 0x093: /* 0 010 010 011 */ cp1610_movr(2,3); break;
case 0x094: /* 0 010 010 100 */ cp1610_movr(2,4); break;
case 0x095: /* 0 010 010 101 */ cp1610_movr(2,5); break;
@@ -2340,7 +2316,7 @@ void cp1610_cpu_device::execute_run()
case 0x098: /* 0 010 011 000 */ cp1610_movr(3,0); break;
case 0x099: /* 0 010 011 001 */ cp1610_movr(3,1); break;
case 0x09a: /* 0 010 011 010 */ cp1610_movr(3,2); break;
- case 0x09b: /* 0 010 011 011 */ cp1610_tstr(3); break;
+ case 0x09b: /* 0 010 011 011 */ cp1610_tstr(3); break;
case 0x09c: /* 0 010 011 100 */ cp1610_movr(3,4); break;
case 0x09d: /* 0 010 011 101 */ cp1610_movr(3,5); break;
case 0x09e: /* 0 010 011 110 */ cp1610_movr(3,6); break;
@@ -2350,7 +2326,7 @@ void cp1610_cpu_device::execute_run()
case 0x0a1: /* 0 010 100 001 */ cp1610_movr(4,1); break;
case 0x0a2: /* 0 010 100 010 */ cp1610_movr(4,2); break;
case 0x0a3: /* 0 010 100 011 */ cp1610_movr(4,3); break;
- case 0x0a4: /* 0 010 100 100 */ cp1610_tstr(4); break;
+ case 0x0a4: /* 0 010 100 100 */ cp1610_tstr(4); break;
case 0x0a5: /* 0 010 100 101 */ cp1610_movr(4,5); break;
case 0x0a6: /* 0 010 100 110 */ cp1610_movr(4,6); break;
case 0x0a7: /* 0 010 100 111 */ cp1610_movr(4,7); break; /* jr */
@@ -2360,7 +2336,7 @@ void cp1610_cpu_device::execute_run()
case 0x0aa: /* 0 010 101 010 */ cp1610_movr(5,2); break;
case 0x0ab: /* 0 010 101 011 */ cp1610_movr(5,3); break;
case 0x0ac: /* 0 010 101 100 */ cp1610_movr(5,4); break;
- case 0x0ad: /* 0 010 101 101 */ cp1610_tstr(5); break;
+ case 0x0ad: /* 0 010 101 101 */ cp1610_tstr(5); break;
case 0x0ae: /* 0 010 101 110 */ cp1610_movr(5,6); break;
case 0x0af: /* 0 010 101 111 */ cp1610_movr(5,7); break; /* jr */
@@ -2370,7 +2346,7 @@ void cp1610_cpu_device::execute_run()
case 0x0b3: /* 0 010 110 011 */ cp1610_movr(6,3); break;
case 0x0b4: /* 0 010 110 100 */ cp1610_movr(6,4); break;
case 0x0b5: /* 0 010 110 101 */ cp1610_movr(6,5); break;
- case 0x0b6: /* 0 010 110 110 */ cp1610_tstr(6); break;
+ case 0x0b6: /* 0 010 110 110 */ cp1610_tstr(6); break;
case 0x0b7: /* 0 010 110 111 */ cp1610_movr(6,7); break; /* jr */
case 0x0b8: /* 0 010 111 000 */ cp1610_movr(7,0); break;
@@ -2380,7 +2356,7 @@ void cp1610_cpu_device::execute_run()
case 0x0bc: /* 0 010 111 100 */ cp1610_movr(7,4); break;
case 0x0bd: /* 0 010 111 101 */ cp1610_movr(7,5); break;
case 0x0be: /* 0 010 111 110 */ cp1610_movr(7,6); break;
- case 0x0bf: /* 0 010 111 111 */ cp1610_tstr(7); break;
+ case 0x0bf: /* 0 010 111 111 */ cp1610_tstr(7); break;
case 0x0c0: /* 0 011 000 000 */ cp1610_addr(0,0); break;
case 0x0c1: /* 0 011 000 001 */ cp1610_addr(0,1); break;
@@ -2670,7 +2646,7 @@ void cp1610_cpu_device::execute_run()
case 0x1be: /* 0 110 111 110 */ cp1610_andr(7,6); break;
case 0x1bf: /* 0 110 111 111 */ cp1610_andr(7,7); break;
- case 0x1c0: /* 0 111 000 000 */ cp1610_clrr(0); break;
+ case 0x1c0: /* 0 111 000 000 */ cp1610_clrr(0); break;
case 0x1c1: /* 0 111 000 001 */ cp1610_xorr(0,1); break;
case 0x1c2: /* 0 111 000 010 */ cp1610_xorr(0,2); break;
case 0x1c3: /* 0 111 000 011 */ cp1610_xorr(0,3); break;
@@ -2680,7 +2656,7 @@ void cp1610_cpu_device::execute_run()
case 0x1c7: /* 0 111 000 111 */ cp1610_xorr(0,7); break;
case 0x1c8: /* 0 111 001 000 */ cp1610_xorr(1,0); break;
- case 0x1c9: /* 0 111 001 001 */ cp1610_clrr(1); break;
+ case 0x1c9: /* 0 111 001 001 */ cp1610_clrr(1); break;
case 0x1ca: /* 0 111 001 010 */ cp1610_xorr(1,2); break;
case 0x1cb: /* 0 111 001 011 */ cp1610_xorr(1,3); break;
case 0x1cc: /* 0 111 001 100 */ cp1610_xorr(1,4); break;
@@ -2690,7 +2666,7 @@ void cp1610_cpu_device::execute_run()
case 0x1d0: /* 0 111 010 000 */ cp1610_xorr(2,0); break;
case 0x1d1: /* 0 111 010 001 */ cp1610_xorr(2,1); break;
- case 0x1d2: /* 0 111 010 010 */ cp1610_clrr(2); break;
+ case 0x1d2: /* 0 111 010 010 */ cp1610_clrr(2); break;
case 0x1d3: /* 0 111 010 011 */ cp1610_xorr(2,3); break;
case 0x1d4: /* 0 111 010 100 */ cp1610_xorr(2,4); break;
case 0x1d5: /* 0 111 010 101 */ cp1610_xorr(2,5); break;
@@ -2700,7 +2676,7 @@ void cp1610_cpu_device::execute_run()
case 0x1d8: /* 0 111 011 000 */ cp1610_xorr(3,0); break;
case 0x1d9: /* 0 111 011 001 */ cp1610_xorr(3,1); break;
case 0x1da: /* 0 111 011 010 */ cp1610_xorr(3,2); break;
- case 0x1db: /* 0 111 011 011 */ cp1610_clrr(3); break;
+ case 0x1db: /* 0 111 011 011 */ cp1610_clrr(3); break;
case 0x1dc: /* 0 111 011 100 */ cp1610_xorr(3,4); break;
case 0x1dd: /* 0 111 011 101 */ cp1610_xorr(3,5); break;
case 0x1de: /* 0 111 011 110 */ cp1610_xorr(3,6); break;
@@ -2710,7 +2686,7 @@ void cp1610_cpu_device::execute_run()
case 0x1e1: /* 0 111 100 001 */ cp1610_xorr(4,1); break;
case 0x1e2: /* 0 111 100 010 */ cp1610_xorr(4,2); break;
case 0x1e3: /* 0 111 100 011 */ cp1610_xorr(4,3); break;
- case 0x1e4: /* 0 111 100 100 */ cp1610_clrr(4); break;
+ case 0x1e4: /* 0 111 100 100 */ cp1610_clrr(4); break;
case 0x1e5: /* 0 111 100 101 */ cp1610_xorr(4,5); break;
case 0x1e6: /* 0 111 100 110 */ cp1610_xorr(4,6); break;
case 0x1e7: /* 0 111 100 111 */ cp1610_xorr(4,7); break;
@@ -2720,7 +2696,7 @@ void cp1610_cpu_device::execute_run()
case 0x1ea: /* 0 111 101 010 */ cp1610_xorr(5,2); break;
case 0x1eb: /* 0 111 101 011 */ cp1610_xorr(5,3); break;
case 0x1ec: /* 0 111 101 100 */ cp1610_xorr(5,4); break;
- case 0x1ed: /* 0 111 101 101 */ cp1610_clrr(5); break;
+ case 0x1ed: /* 0 111 101 101 */ cp1610_clrr(5); break;
case 0x1ee: /* 0 111 101 110 */ cp1610_xorr(5,6); break;
case 0x1ef: /* 0 111 101 111 */ cp1610_xorr(5,7); break;
@@ -2730,7 +2706,7 @@ void cp1610_cpu_device::execute_run()
case 0x1f3: /* 0 111 110 011 */ cp1610_xorr(6,3); break;
case 0x1f4: /* 0 111 110 100 */ cp1610_xorr(6,4); break;
case 0x1f5: /* 0 111 110 101 */ cp1610_xorr(6,5); break;
- case 0x1f6: /* 0 111 110 110 */ cp1610_clrr(6); break;
+ case 0x1f6: /* 0 111 110 110 */ cp1610_clrr(6); break;
case 0x1f7: /* 0 111 110 111 */ cp1610_xorr(6,7); break;
case 0x1f8: /* 0 111 111 000 */ cp1610_xorr(7,0); break;
@@ -2740,25 +2716,25 @@ void cp1610_cpu_device::execute_run()
case 0x1fc: /* 0 111 111 100 */ cp1610_xorr(7,4); break;
case 0x1fd: /* 0 111 111 101 */ cp1610_xorr(7,5); break;
case 0x1fe: /* 0 111 111 110 */ cp1610_xorr(7,6); break;
- case 0x1ff: /* 0 110 111 111 */ cp1610_clrr(7); break;
-
- case 0x200: /* 1 000 000 000 */ cp1610_b(0); break;
- case 0x201: /* 1 000 000 001 */ cp1610_bc(0); break; /* aka BLGE */
- case 0x202: /* 1 000 000 010 */ cp1610_bov(0); break;
- case 0x203: /* 1 000 000 011 */ cp1610_bpl(0); break;
- case 0x204: /* 1 000 000 100 */ cp1610_bze(0); break; /* aka BEQ */
- case 0x205: /* 1 000 000 101 */ cp1610_blt(0); break;
- case 0x206: /* 1 000 000 110 */ cp1610_ble(0); break;
- case 0x207: /* 1 000 000 111 */ cp1610_busc(0); break;
-
- case 0x208: /* 1 000 001 000 */ cp1610_nopp(0); break;
- case 0x209: /* 1 000 001 001 */ cp1610_bnc(0); break; /* aka BLLT */
- case 0x20a: /* 1 000 001 010 */ cp1610_bnov(0); break;
- case 0x20b: /* 1 000 001 011 */ cp1610_bmi(0); break;
- case 0x20c: /* 1 000 001 100 */ cp1610_bnze(0); break; /* aka BNEQ */
- case 0x20d: /* 1 000 001 101 */ cp1610_bge(0); break;
- case 0x20e: /* 1 000 001 110 */ cp1610_bgt(0); break;
- case 0x20f: /* 1 000 001 111 */ cp1610_besc(0); break;
+ case 0x1ff: /* 0 110 111 111 */ cp1610_clrr(7); break;
+
+ case 0x200: /* 1 000 000 000 */ cp1610_b(0); break;
+ case 0x201: /* 1 000 000 001 */ cp1610_bc(0); break; /* aka BLGE */
+ case 0x202: /* 1 000 000 010 */ cp1610_bov(0); break;
+ case 0x203: /* 1 000 000 011 */ cp1610_bpl(0); break;
+ case 0x204: /* 1 000 000 100 */ cp1610_bze(0); break; /* aka BEQ */
+ case 0x205: /* 1 000 000 101 */ cp1610_blt(0); break;
+ case 0x206: /* 1 000 000 110 */ cp1610_ble(0); break;
+ case 0x207: /* 1 000 000 111 */ cp1610_busc(0); break;
+
+ case 0x208: /* 1 000 001 000 */ cp1610_nopp(0); break;
+ case 0x209: /* 1 000 001 001 */ cp1610_bnc(0); break; /* aka BLLT */
+ case 0x20a: /* 1 000 001 010 */ cp1610_bnov(0); break;
+ case 0x20b: /* 1 000 001 011 */ cp1610_bmi(0); break;
+ case 0x20c: /* 1 000 001 100 */ cp1610_bnze(0); break; /* aka BNEQ */
+ case 0x20d: /* 1 000 001 101 */ cp1610_bge(0); break;
+ case 0x20e: /* 1 000 001 110 */ cp1610_bgt(0); break;
+ case 0x20f: /* 1 000 001 111 */ cp1610_besc(0); break;
case 0x210: /* 1 000 010 000 */ cp1610_bext(0,0); break;
case 0x211: /* 1 000 010 001 */ cp1610_bext(1,0); break;
@@ -2771,552 +2747,552 @@ void cp1610_cpu_device::execute_run()
case 0x218: /* 1 000 011 000 */ cp1610_bext(8,0); break;
case 0x219: /* 1 000 011 001 */ cp1610_bext(9,0); break;
- case 0x21a: /* 1 000 011 010 */ cp1610_bext(10,0); break;
- case 0x21b: /* 1 000 011 011 */ cp1610_bext(11,0); break;
- case 0x21c: /* 1 000 011 100 */ cp1610_bext(12,0); break;
- case 0x21d: /* 1 000 011 101 */ cp1610_bext(13,0); break;
- case 0x21e: /* 1 000 011 110 */ cp1610_bext(14,0); break;
- case 0x21f: /* 1 000 011 111 */ cp1610_bext(15,0); break;
-
- case 0x220: /* 1 000 100 000 */ cp1610_b(0xffff); break;
- case 0x221: /* 1 000 100 001 */ cp1610_bc(0xffff); break; /* aka BLGE */
- case 0x222: /* 1 000 100 010 */ cp1610_bov(0xffff); break;
- case 0x223: /* 1 000 100 011 */ cp1610_bpl(0xffff); break;
- case 0x224: /* 1 000 100 100 */ cp1610_bze(0xffff); break; /* aka BEQ */
- case 0x225: /* 1 000 100 101 */ cp1610_blt(0xffff); break;
- case 0x226: /* 1 000 100 110 */ cp1610_ble(0xffff); break;
- case 0x227: /* 1 000 100 111 */ cp1610_busc(0xffff); break;
-
- case 0x228: /* 1 000 101 000 */ cp1610_nopp(0xffff); break;
- case 0x229: /* 1 000 101 001 */ cp1610_bnc(0xffff); break; /* aka BLLT */
- case 0x22a: /* 1 000 101 010 */ cp1610_bnov(0xffff); break;
- case 0x22b: /* 1 000 101 011 */ cp1610_bmi(0xffff); break;
- case 0x22c: /* 1 000 101 100 */ cp1610_bnze(0xffff); break; /* aka BNEQ */
- case 0x22d: /* 1 000 101 101 */ cp1610_bge(0xffff); break;
- case 0x22e: /* 1 000 101 110 */ cp1610_bgt(0xffff); break;
- case 0x22f: /* 1 000 101 111 */ cp1610_besc(0xffff); break;
-
- case 0x230: /* 1 000 110 000 */ cp1610_bext(0,0xffff); break;
- case 0x231: /* 1 000 110 001 */ cp1610_bext(1,0xffff); break;
- case 0x232: /* 1 000 110 010 */ cp1610_bext(2,0xffff); break;
- case 0x233: /* 1 000 110 011 */ cp1610_bext(3,0xffff); break;
- case 0x234: /* 1 000 110 100 */ cp1610_bext(4,0xffff); break;
- case 0x235: /* 1 000 110 101 */ cp1610_bext(5,0xffff); break;
- case 0x236: /* 1 000 110 110 */ cp1610_bext(6,0xffff); break;
- case 0x237: /* 1 000 110 111 */ cp1610_bext(7,0xffff); break;
-
- case 0x238: /* 1 000 111 000 */ cp1610_bext(8,0xffff); break;
- case 0x239: /* 1 000 111 001 */ cp1610_bext(9,0xffff); break;
- case 0x23a: /* 1 000 111 010 */ cp1610_bext(10,0xffff); break;
- case 0x23b: /* 1 000 111 011 */ cp1610_bext(11,0xffff); break;
- case 0x23c: /* 1 000 111 100 */ cp1610_bext(12,0xffff); break;
- case 0x23d: /* 1 000 111 101 */ cp1610_bext(13,0xffff); break;
- case 0x23e: /* 1 000 111 110 */ cp1610_bext(14,0xffff); break;
- case 0x23f: /* 1 000 111 111 */ cp1610_bext(15,0xffff); break;
-
- case 0x240: /* 1 001 000 000 */ cp1610_mvo(0); break;
- case 0x241: /* 1 001 000 001 */ cp1610_mvo(1); break;
- case 0x242: /* 1 001 000 010 */ cp1610_mvo(2); break;
- case 0x243: /* 1 001 000 011 */ cp1610_mvo(3); break;
- case 0x244: /* 1 001 000 100 */ cp1610_mvo(4); break;
- case 0x245: /* 1 001 000 101 */ cp1610_mvo(5); break;
- case 0x246: /* 1 001 000 110 */ cp1610_mvo(6); break;
- case 0x247: /* 1 001 000 111 */ cp1610_mvo(7); break;
-
- case 0x248: /* 1 001 001 000 */ cp1610_mvoat(0,1); break;
- case 0x249: /* 1 001 001 001 */ cp1610_mvoat(1,1); break;
- case 0x24a: /* 1 001 001 010 */ cp1610_mvoat(2,1); break;
- case 0x24b: /* 1 001 001 011 */ cp1610_mvoat(3,1); break;
- case 0x24c: /* 1 001 001 100 */ cp1610_mvoat(4,1); break;
- case 0x24d: /* 1 001 001 101 */ cp1610_mvoat(5,1); break;
- case 0x24e: /* 1 001 001 110 */ cp1610_mvoat(6,1); break;
- case 0x24f: /* 1 001 001 111 */ cp1610_mvoat(7,1); break;
-
- case 0x250: /* 1 001 010 000 */ cp1610_mvoat(0,2); break;
- case 0x251: /* 1 001 010 001 */ cp1610_mvoat(1,2); break;
- case 0x252: /* 1 001 010 010 */ cp1610_mvoat(2,2); break;
- case 0x253: /* 1 001 010 011 */ cp1610_mvoat(3,2); break;
- case 0x254: /* 1 001 010 100 */ cp1610_mvoat(4,2); break;
- case 0x255: /* 1 001 010 101 */ cp1610_mvoat(5,2); break;
- case 0x256: /* 1 001 010 110 */ cp1610_mvoat(6,2); break;
- case 0x257: /* 1 001 010 111 */ cp1610_mvoat(7,2); break;
-
- case 0x258: /* 1 001 011 000 */ cp1610_mvoat(0,3); break;
- case 0x259: /* 1 001 011 001 */ cp1610_mvoat(1,3); break;
- case 0x25a: /* 1 001 011 010 */ cp1610_mvoat(2,3); break;
- case 0x25b: /* 1 001 011 011 */ cp1610_mvoat(3,3); break;
- case 0x25c: /* 1 001 011 100 */ cp1610_mvoat(4,3); break;
- case 0x25d: /* 1 001 011 101 */ cp1610_mvoat(5,3); break;
- case 0x25e: /* 1 001 011 110 */ cp1610_mvoat(6,3); break;
- case 0x25f: /* 1 001 011 111 */ cp1610_mvoat(7,3); break;
-
- case 0x260: /* 1 001 100 000 */ cp1610_mvoat_i(0,4); break;
- case 0x261: /* 1 001 100 001 */ cp1610_mvoat_i(1,4); break;
- case 0x262: /* 1 001 100 010 */ cp1610_mvoat_i(2,4); break;
- case 0x263: /* 1 001 100 011 */ cp1610_mvoat_i(3,4); break;
- case 0x264: /* 1 001 100 100 */ cp1610_mvoat_i(4,4); break;
- case 0x265: /* 1 001 100 101 */ cp1610_mvoat_i(5,4); break;
- case 0x266: /* 1 001 100 110 */ cp1610_mvoat_i(6,4); break;
- case 0x267: /* 1 001 100 111 */ cp1610_mvoat_i(7,4); break;
-
- case 0x268: /* 1 001 101 000 */ cp1610_mvoat_i(0,5); break;
- case 0x269: /* 1 001 101 001 */ cp1610_mvoat_i(1,5); break;
- case 0x26a: /* 1 001 101 010 */ cp1610_mvoat_i(2,5); break;
- case 0x26b: /* 1 001 101 011 */ cp1610_mvoat_i(3,5); break;
- case 0x26c: /* 1 001 101 100 */ cp1610_mvoat_i(4,5); break;
- case 0x26d: /* 1 001 101 101 */ cp1610_mvoat_i(5,5); break;
- case 0x26e: /* 1 001 101 110 */ cp1610_mvoat_i(6,5); break;
- case 0x26f: /* 1 001 101 111 */ cp1610_mvoat_i(7,5); break;
-
- case 0x270: /* 1 001 110 000 */ cp1610_mvoat_i(0,6); break; /* pshr */
- case 0x271: /* 1 001 110 001 */ cp1610_mvoat_i(1,6); break; /* pshr */
- case 0x272: /* 1 001 110 010 */ cp1610_mvoat_i(2,6); break; /* pshr */
- case 0x273: /* 1 001 110 011 */ cp1610_mvoat_i(3,6); break; /* pshr */
- case 0x274: /* 1 001 110 100 */ cp1610_mvoat_i(4,6); break; /* pshr */
- case 0x275: /* 1 001 110 101 */ cp1610_mvoat_i(5,6); break; /* pshr */
- case 0x276: /* 1 001 110 110 */ cp1610_mvoat_i(6,6); break; /* pshr */
- case 0x277: /* 1 001 110 111 */ cp1610_mvoat_i(7,6); break; /* pshr */
-
- case 0x278: /* 1 001 111 000 */ cp1610_mvoi(0); break;
- case 0x279: /* 1 001 111 001 */ cp1610_mvoi(1); break;
- case 0x27a: /* 1 001 111 010 */ cp1610_mvoi(2); break;
- case 0x27b: /* 1 001 111 011 */ cp1610_mvoi(3); break;
- case 0x27c: /* 1 001 111 100 */ cp1610_mvoi(4); break;
- case 0x27d: /* 1 001 111 101 */ cp1610_mvoi(5); break;
- case 0x27e: /* 1 001 111 110 */ cp1610_mvoi(6); break;
- case 0x27f: /* 1 001 111 111 */ cp1610_mvoi(7); break;
-
- case 0x280: /* 1 010 000 000 */ cp1610_mvi(0); break;
- case 0x281: /* 1 010 000 001 */ cp1610_mvi(1); break;
- case 0x282: /* 1 010 000 010 */ cp1610_mvi(2); break;
- case 0x283: /* 1 010 000 011 */ cp1610_mvi(3); break;
- case 0x284: /* 1 010 000 100 */ cp1610_mvi(4); break;
- case 0x285: /* 1 010 000 101 */ cp1610_mvi(5); break;
- case 0x286: /* 1 010 000 110 */ cp1610_mvi(6); break;
- case 0x287: /* 1 010 000 111 */ cp1610_mvi(7); break;
-
- case 0x288: /* 1 010 001 000 */ cp1610_mviat(1,0); break;
- case 0x289: /* 1 010 001 001 */ cp1610_mviat(1,1); break;
- case 0x28a: /* 1 010 001 010 */ cp1610_mviat(1,2); break;
- case 0x28b: /* 1 010 001 011 */ cp1610_mviat(1,3); break;
- case 0x28c: /* 1 010 001 100 */ cp1610_mviat(1,4); break;
- case 0x28d: /* 1 010 001 101 */ cp1610_mviat(1,5); break;
- case 0x28e: /* 1 010 001 110 */ cp1610_mviat(1,6); break;
- case 0x28f: /* 1 010 001 111 */ cp1610_mviat(1,7); break;
-
- case 0x290: /* 1 010 010 000 */ cp1610_mviat(2,0); break;
- case 0x291: /* 1 010 010 001 */ cp1610_mviat(2,1); break;
- case 0x292: /* 1 010 010 010 */ cp1610_mviat(2,2); break;
- case 0x293: /* 1 010 010 011 */ cp1610_mviat(2,3); break;
- case 0x294: /* 1 010 010 100 */ cp1610_mviat(2,4); break;
- case 0x295: /* 1 010 010 101 */ cp1610_mviat(2,5); break;
- case 0x296: /* 1 010 010 110 */ cp1610_mviat(2,6); break;
- case 0x297: /* 1 010 010 111 */ cp1610_mviat(2,7); break;
-
- case 0x298: /* 1 010 011 000 */ cp1610_mviat(3,0); break;
- case 0x299: /* 1 010 011 001 */ cp1610_mviat(3,1); break;
- case 0x29a: /* 1 010 011 010 */ cp1610_mviat(3,2); break;
- case 0x29b: /* 1 010 011 011 */ cp1610_mviat(3,3); break;
- case 0x29c: /* 1 010 011 100 */ cp1610_mviat(3,4); break;
- case 0x29d: /* 1 010 011 101 */ cp1610_mviat(3,5); break;
- case 0x29e: /* 1 010 011 110 */ cp1610_mviat(3,6); break;
- case 0x29f: /* 1 010 011 111 */ cp1610_mviat(3,7); break;
-
- case 0x2a0: /* 1 010 100 000 */ cp1610_mviat_i(4,0); break;
- case 0x2a1: /* 1 010 100 001 */ cp1610_mviat_i(4,1); break;
- case 0x2a2: /* 1 010 100 010 */ cp1610_mviat_i(4,2); break;
- case 0x2a3: /* 1 010 100 011 */ cp1610_mviat_i(4,3); break;
- case 0x2a4: /* 1 010 100 100 */ cp1610_mviat_i(4,4); break;
- case 0x2a5: /* 1 010 100 101 */ cp1610_mviat_i(4,5); break;
- case 0x2a6: /* 1 010 100 110 */ cp1610_mviat_i(4,6); break;
- case 0x2a7: /* 1 010 100 111 */ cp1610_mviat_i(4,7); break;
-
- case 0x2a8: /* 1 010 101 000 */ cp1610_mviat_i(5,0); break;
- case 0x2a9: /* 1 010 101 001 */ cp1610_mviat_i(5,1); break;
- case 0x2aa: /* 1 010 101 010 */ cp1610_mviat_i(5,2); break;
- case 0x2ab: /* 1 010 101 011 */ cp1610_mviat_i(5,3); break;
- case 0x2ac: /* 1 010 101 100 */ cp1610_mviat_i(5,4); break;
- case 0x2ad: /* 1 010 101 101 */ cp1610_mviat_i(5,5); break;
- case 0x2ae: /* 1 010 101 110 */ cp1610_mviat_i(5,6); break;
- case 0x2af: /* 1 010 101 111 */ cp1610_mviat_i(5,7); break;
-
- case 0x2b0: /* 1 010 110 000 */ cp1610_pulr(0); break;
- case 0x2b1: /* 1 010 110 001 */ cp1610_pulr(1); break;
- case 0x2b2: /* 1 010 110 010 */ cp1610_pulr(2); break;
- case 0x2b3: /* 1 010 110 011 */ cp1610_pulr(3); break;
- case 0x2b4: /* 1 010 110 100 */ cp1610_pulr(4); break;
- case 0x2b5: /* 1 010 110 101 */ cp1610_pulr(5); break;
- case 0x2b6: /* 1 010 110 110 */ cp1610_pulr(6); break;
- case 0x2b7: /* 1 010 110 111 */ cp1610_pulr(7); break;
-
- case 0x2b8: /* 1 010 111 000 */ cp1610_mvii(0); break;
- case 0x2b9: /* 1 010 111 001 */ cp1610_mvii(1); break;
- case 0x2ba: /* 1 010 111 010 */ cp1610_mvii(2); break;
- case 0x2bb: /* 1 010 111 011 */ cp1610_mvii(3); break;
- case 0x2bc: /* 1 010 111 100 */ cp1610_mvii(4); break;
- case 0x2bd: /* 1 010 111 101 */ cp1610_mvii(5); break;
- case 0x2be: /* 1 010 111 110 */ cp1610_mvii(6); break;
- case 0x2bf: /* 1 010 111 111 */ cp1610_mvii(7); break;
-
- case 0x2c0: /* 1 011 000 000 */ cp1610_add(0); break;
- case 0x2c1: /* 1 011 000 001 */ cp1610_add(1); break;
- case 0x2c2: /* 1 011 000 010 */ cp1610_add(2); break;
- case 0x2c3: /* 1 011 000 011 */ cp1610_add(3); break;
- case 0x2c4: /* 1 011 000 100 */ cp1610_add(4); break;
- case 0x2c5: /* 1 011 000 101 */ cp1610_add(5); break;
- case 0x2c6: /* 1 011 000 110 */ cp1610_add(6); break;
- case 0x2c7: /* 1 011 000 111 */ cp1610_add(7); break;
-
- case 0x2c8: /* 1 011 001 000 */ cp1610_addat(1,0); break;
- case 0x2c9: /* 1 011 001 001 */ cp1610_addat(1,1); break;
- case 0x2ca: /* 1 011 001 010 */ cp1610_addat(1,2); break;
- case 0x2cb: /* 1 011 001 011 */ cp1610_addat(1,3); break;
- case 0x2cc: /* 1 011 001 100 */ cp1610_addat(1,4); break;
- case 0x2cd: /* 1 011 001 101 */ cp1610_addat(1,5); break;
- case 0x2ce: /* 1 011 001 110 */ cp1610_addat(1,6); break;
- case 0x2cf: /* 1 011 001 111 */ cp1610_addat(1,7); break;
-
- case 0x2d0: /* 1 011 010 000 */ cp1610_addat(2,0); break;
- case 0x2d1: /* 1 011 010 001 */ cp1610_addat(2,1); break;
- case 0x2d2: /* 1 011 010 010 */ cp1610_addat(2,2); break;
- case 0x2d3: /* 1 011 010 011 */ cp1610_addat(2,3); break;
- case 0x2d4: /* 1 011 010 100 */ cp1610_addat(2,4); break;
- case 0x2d5: /* 1 011 010 101 */ cp1610_addat(2,5); break;
- case 0x2d6: /* 1 011 010 110 */ cp1610_addat(2,6); break;
- case 0x2d7: /* 1 011 010 111 */ cp1610_addat(2,7); break;
-
- case 0x2d8: /* 1 011 011 000 */ cp1610_addat(3,0); break;
- case 0x2d9: /* 1 011 011 001 */ cp1610_addat(3,1); break;
- case 0x2da: /* 1 011 011 010 */ cp1610_addat(3,2); break;
- case 0x2db: /* 1 011 011 011 */ cp1610_addat(3,3); break;
- case 0x2dc: /* 1 011 011 100 */ cp1610_addat(3,4); break;
- case 0x2dd: /* 1 011 011 101 */ cp1610_addat(3,5); break;
- case 0x2de: /* 1 011 011 110 */ cp1610_addat(3,6); break;
- case 0x2df: /* 1 011 011 111 */ cp1610_addat(3,7); break;
-
- case 0x2e0: /* 1 011 100 000 */ cp1610_addat_i(4,0); break;
- case 0x2e1: /* 1 011 100 001 */ cp1610_addat_i(4,1); break;
- case 0x2e2: /* 1 011 100 010 */ cp1610_addat_i(4,2); break;
- case 0x2e3: /* 1 011 100 011 */ cp1610_addat_i(4,3); break;
- case 0x2e4: /* 1 011 100 100 */ cp1610_addat_i(4,4); break;
- case 0x2e5: /* 1 011 100 101 */ cp1610_addat_i(4,5); break;
- case 0x2e6: /* 1 011 100 110 */ cp1610_addat_i(4,6); break;
- case 0x2e7: /* 1 011 100 111 */ cp1610_addat_i(4,7); break;
-
- case 0x2e8: /* 1 011 101 000 */ cp1610_addat_i(5,0); break;
- case 0x2e9: /* 1 011 101 001 */ cp1610_addat_i(5,1); break;
- case 0x2ea: /* 1 011 101 010 */ cp1610_addat_i(5,2); break;
- case 0x2eb: /* 1 011 101 011 */ cp1610_addat_i(5,3); break;
- case 0x2ec: /* 1 011 101 100 */ cp1610_addat_i(5,4); break;
- case 0x2ed: /* 1 011 101 101 */ cp1610_addat_i(5,5); break;
- case 0x2ee: /* 1 011 101 110 */ cp1610_addat_i(5,6); break;
- case 0x2ef: /* 1 011 101 111 */ cp1610_addat_i(5,7); break;
-
- case 0x2f0: /* 1 011 110 000 */ cp1610_addat_d(6,0); break;
- case 0x2f1: /* 1 011 110 001 */ cp1610_addat_d(6,1); break;
- case 0x2f2: /* 1 011 110 010 */ cp1610_addat_d(6,2); break;
- case 0x2f3: /* 1 011 110 011 */ cp1610_addat_d(6,3); break;
- case 0x2f4: /* 1 011 110 100 */ cp1610_addat_d(6,4); break;
- case 0x2f5: /* 1 011 110 101 */ cp1610_addat_d(6,5); break;
- case 0x2f6: /* 1 011 110 110 */ cp1610_addat_d(6,6); break;
- case 0x2f7: /* 1 011 110 111 */ cp1610_addat_d(6,7); break;
-
- case 0x2f8: /* 1 011 111 000 */ cp1610_addi(0); break;
- case 0x2f9: /* 1 011 111 001 */ cp1610_addi(1); break;
- case 0x2fa: /* 1 011 111 010 */ cp1610_addi(2); break;
- case 0x2fb: /* 1 011 111 011 */ cp1610_addi(3); break;
- case 0x2fc: /* 1 011 111 100 */ cp1610_addi(4); break;
- case 0x2fd: /* 1 011 111 101 */ cp1610_addi(5); break;
- case 0x2fe: /* 1 011 111 110 */ cp1610_addi(6); break;
- case 0x2ff: /* 1 011 111 111 */ cp1610_addi(7); break;
-
- case 0x300: /* 1 100 000 000 */ cp1610_sub(0); break;
- case 0x301: /* 1 100 000 001 */ cp1610_sub(1); break;
- case 0x302: /* 1 100 000 010 */ cp1610_sub(2); break;
- case 0x303: /* 1 100 000 011 */ cp1610_sub(3); break;
- case 0x304: /* 1 100 000 100 */ cp1610_sub(4); break;
- case 0x305: /* 1 100 000 101 */ cp1610_sub(5); break;
- case 0x306: /* 1 100 000 110 */ cp1610_sub(6); break;
- case 0x307: /* 1 100 000 111 */ cp1610_sub(7); break;
-
- case 0x308: /* 1 100 001 000 */ cp1610_subat(1,0); break;
- case 0x309: /* 1 100 001 001 */ cp1610_subat(1,1); break;
- case 0x30a: /* 1 100 001 010 */ cp1610_subat(1,2); break;
- case 0x30b: /* 1 100 001 011 */ cp1610_subat(1,3); break;
- case 0x30c: /* 1 100 001 100 */ cp1610_subat(1,4); break;
- case 0x30d: /* 1 100 001 101 */ cp1610_subat(1,5); break;
- case 0x30e: /* 1 100 001 110 */ cp1610_subat(1,6); break;
- case 0x30f: /* 1 100 001 111 */ cp1610_subat(1,7); break;
-
- case 0x310: /* 1 100 010 000 */ cp1610_subat(2,0); break;
- case 0x311: /* 1 100 010 001 */ cp1610_subat(2,1); break;
- case 0x312: /* 1 100 010 010 */ cp1610_subat(2,2); break;
- case 0x313: /* 1 100 010 011 */ cp1610_subat(2,3); break;
- case 0x314: /* 1 100 010 100 */ cp1610_subat(2,4); break;
- case 0x315: /* 1 100 010 101 */ cp1610_subat(2,5); break;
- case 0x316: /* 1 100 010 110 */ cp1610_subat(2,6); break;
- case 0x317: /* 1 100 010 111 */ cp1610_subat(2,7); break;
-
- case 0x318: /* 1 100 011 000 */ cp1610_subat(3,0); break;
- case 0x319: /* 1 100 011 001 */ cp1610_subat(3,1); break;
- case 0x31a: /* 1 100 011 010 */ cp1610_subat(3,2); break;
- case 0x31b: /* 1 100 011 011 */ cp1610_subat(3,3); break;
- case 0x31c: /* 1 100 011 100 */ cp1610_subat(3,4); break;
- case 0x31d: /* 1 100 011 101 */ cp1610_subat(3,5); break;
- case 0x31e: /* 1 100 011 110 */ cp1610_subat(3,6); break;
- case 0x31f: /* 1 100 011 111 */ cp1610_subat(3,7); break;
-
- case 0x320: /* 1 100 100 000 */ cp1610_subat_i(4,0); break;
- case 0x321: /* 1 100 100 001 */ cp1610_subat_i(4,1); break;
- case 0x322: /* 1 100 100 010 */ cp1610_subat_i(4,2); break;
- case 0x323: /* 1 100 100 011 */ cp1610_subat_i(4,3); break;
- case 0x324: /* 1 100 100 100 */ cp1610_subat_i(4,4); break;
- case 0x325: /* 1 100 100 101 */ cp1610_subat_i(4,5); break;
- case 0x326: /* 1 100 100 110 */ cp1610_subat_i(4,6); break;
- case 0x327: /* 1 100 100 111 */ cp1610_subat_i(4,7); break;
-
- case 0x328: /* 1 100 101 000 */ cp1610_subat_i(5,0); break;
- case 0x329: /* 1 100 101 001 */ cp1610_subat_i(5,1); break;
- case 0x32a: /* 1 100 101 010 */ cp1610_subat_i(5,2); break;
- case 0x32b: /* 1 100 101 011 */ cp1610_subat_i(5,3); break;
- case 0x32c: /* 1 100 101 100 */ cp1610_subat_i(5,4); break;
- case 0x32d: /* 1 100 101 101 */ cp1610_subat_i(5,5); break;
- case 0x32e: /* 1 100 101 110 */ cp1610_subat_i(5,6); break;
- case 0x32f: /* 1 100 101 111 */ cp1610_subat_i(5,7); break;
-
- case 0x330: /* 1 100 110 000 */ cp1610_subat_d(6,0); break;
- case 0x331: /* 1 100 110 001 */ cp1610_subat_d(6,1); break;
- case 0x332: /* 1 100 110 010 */ cp1610_subat_d(6,2); break;
- case 0x333: /* 1 100 110 011 */ cp1610_subat_d(6,3); break;
- case 0x334: /* 1 100 110 100 */ cp1610_subat_d(6,4); break;
- case 0x335: /* 1 100 110 101 */ cp1610_subat_d(6,5); break;
- case 0x336: /* 1 100 110 110 */ cp1610_subat_d(6,6); break;
- case 0x337: /* 1 100 110 111 */ cp1610_subat_d(6,7); break;
-
- case 0x338: /* 1 100 111 000 */ cp1610_subi(0); break;
- case 0x339: /* 1 100 111 001 */ cp1610_subi(1); break;
- case 0x33a: /* 1 100 111 010 */ cp1610_subi(2); break;
- case 0x33b: /* 1 100 111 011 */ cp1610_subi(3); break;
- case 0x33c: /* 1 100 111 100 */ cp1610_subi(4); break;
- case 0x33d: /* 1 100 111 101 */ cp1610_subi(5); break;
- case 0x33e: /* 1 100 111 110 */ cp1610_subi(6); break;
- case 0x33f: /* 1 100 111 111 */ cp1610_subi(7); break;
-
- case 0x340: /* 1 101 000 000 */ cp1610_cmp(0); break;
- case 0x341: /* 1 101 000 001 */ cp1610_cmp(1); break;
- case 0x342: /* 1 101 000 010 */ cp1610_cmp(2); break;
- case 0x343: /* 1 101 000 011 */ cp1610_cmp(3); break;
- case 0x344: /* 1 101 000 100 */ cp1610_cmp(4); break;
- case 0x345: /* 1 101 000 101 */ cp1610_cmp(5); break;
- case 0x346: /* 1 101 000 110 */ cp1610_cmp(6); break;
- case 0x347: /* 1 101 000 111 */ cp1610_cmp(7); break;
-
- case 0x348: /* 1 101 001 000 */ cp1610_cmpat(1,0); break;
- case 0x349: /* 1 101 001 001 */ cp1610_cmpat(1,1); break;
- case 0x34a: /* 1 101 001 010 */ cp1610_cmpat(1,2); break;
- case 0x34b: /* 1 101 001 011 */ cp1610_cmpat(1,3); break;
- case 0x34c: /* 1 101 001 100 */ cp1610_cmpat(1,4); break;
- case 0x34d: /* 1 101 001 101 */ cp1610_cmpat(1,5); break;
- case 0x34e: /* 1 101 001 110 */ cp1610_cmpat(1,6); break;
- case 0x34f: /* 1 101 001 111 */ cp1610_cmpat(1,7); break;
-
- case 0x350: /* 1 101 010 000 */ cp1610_cmpat(2,0); break;
- case 0x351: /* 1 101 010 001 */ cp1610_cmpat(2,1); break;
- case 0x352: /* 1 101 010 010 */ cp1610_cmpat(2,2); break;
- case 0x353: /* 1 101 010 011 */ cp1610_cmpat(2,3); break;
- case 0x354: /* 1 101 010 100 */ cp1610_cmpat(2,4); break;
- case 0x355: /* 1 101 010 101 */ cp1610_cmpat(2,5); break;
- case 0x356: /* 1 101 010 110 */ cp1610_cmpat(2,6); break;
- case 0x357: /* 1 101 010 111 */ cp1610_cmpat(2,7); break;
-
- case 0x358: /* 1 101 011 000 */ cp1610_cmpat(3,0); break;
- case 0x359: /* 1 101 011 001 */ cp1610_cmpat(3,1); break;
- case 0x35a: /* 1 101 011 010 */ cp1610_cmpat(3,2); break;
- case 0x35b: /* 1 101 011 011 */ cp1610_cmpat(3,3); break;
- case 0x35c: /* 1 101 011 100 */ cp1610_cmpat(3,4); break;
- case 0x35d: /* 1 101 011 101 */ cp1610_cmpat(3,5); break;
- case 0x35e: /* 1 101 011 110 */ cp1610_cmpat(3,6); break;
- case 0x35f: /* 1 101 011 111 */ cp1610_cmpat(3,7); break;
-
- case 0x360: /* 1 101 100 000 */ cp1610_cmpat_i(4,0); break;
- case 0x361: /* 1 101 100 001 */ cp1610_cmpat_i(4,1); break;
- case 0x362: /* 1 101 100 010 */ cp1610_cmpat_i(4,2); break;
- case 0x363: /* 1 101 100 011 */ cp1610_cmpat_i(4,3); break;
- case 0x364: /* 1 101 100 100 */ cp1610_cmpat_i(4,4); break;
- case 0x365: /* 1 101 100 101 */ cp1610_cmpat_i(4,5); break;
- case 0x366: /* 1 101 100 110 */ cp1610_cmpat_i(4,6); break;
- case 0x367: /* 1 101 100 111 */ cp1610_cmpat_i(4,7); break;
-
- case 0x368: /* 1 101 101 000 */ cp1610_cmpat_i(5,0); break;
- case 0x369: /* 1 101 101 001 */ cp1610_cmpat_i(5,1); break;
- case 0x36a: /* 1 101 101 010 */ cp1610_cmpat_i(5,2); break;
- case 0x36b: /* 1 101 101 011 */ cp1610_cmpat_i(5,3); break;
- case 0x36c: /* 1 101 101 100 */ cp1610_cmpat_i(5,4); break;
- case 0x36d: /* 1 101 101 101 */ cp1610_cmpat_i(5,5); break;
- case 0x36e: /* 1 101 101 110 */ cp1610_cmpat_i(5,6); break;
- case 0x36f: /* 1 101 101 111 */ cp1610_cmpat_i(5,7); break;
-
- case 0x370: /* 1 101 110 000 */ cp1610_cmpat_d(6,0); break;
- case 0x371: /* 1 101 110 001 */ cp1610_cmpat_d(6,1); break;
- case 0x372: /* 1 101 110 010 */ cp1610_cmpat_d(6,2); break;
- case 0x373: /* 1 101 110 011 */ cp1610_cmpat_d(6,3); break;
- case 0x374: /* 1 101 110 100 */ cp1610_cmpat_d(6,4); break;
- case 0x375: /* 1 101 110 101 */ cp1610_cmpat_d(6,5); break;
- case 0x376: /* 1 101 110 110 */ cp1610_cmpat_d(6,6); break;
- case 0x377: /* 1 101 110 111 */ cp1610_cmpat_d(6,7); break;
-
- case 0x378: /* 1 101 111 000 */ cp1610_cmpi(0); break;
- case 0x379: /* 1 101 111 001 */ cp1610_cmpi(1); break;
- case 0x37a: /* 1 101 111 010 */ cp1610_cmpi(2); break;
- case 0x37b: /* 1 101 111 011 */ cp1610_cmpi(3); break;
- case 0x37c: /* 1 101 111 100 */ cp1610_cmpi(4); break;
- case 0x37d: /* 1 101 111 101 */ cp1610_cmpi(5); break;
- case 0x37e: /* 1 101 111 110 */ cp1610_cmpi(6); break;
- case 0x37f: /* 1 101 111 111 */ cp1610_cmpi(7); break;
-
- case 0x380: /* 1 110 000 000 */ cp1610_and(0); break;
- case 0x381: /* 1 110 000 001 */ cp1610_and(1); break;
- case 0x382: /* 1 110 000 010 */ cp1610_and(2); break;
- case 0x383: /* 1 110 000 011 */ cp1610_and(3); break;
- case 0x384: /* 1 110 000 100 */ cp1610_and(4); break;
- case 0x385: /* 1 110 000 101 */ cp1610_and(5); break;
- case 0x386: /* 1 110 000 110 */ cp1610_and(6); break;
- case 0x387: /* 1 110 000 111 */ cp1610_and(7); break;
-
- case 0x388: /* 1 110 001 000 */ cp1610_andat(1,0); break;
- case 0x389: /* 1 110 001 001 */ cp1610_andat(1,1); break;
- case 0x38a: /* 1 110 001 010 */ cp1610_andat(1,2); break;
- case 0x38b: /* 1 110 001 011 */ cp1610_andat(1,3); break;
- case 0x38c: /* 1 110 001 100 */ cp1610_andat(1,4); break;
- case 0x38d: /* 1 110 001 101 */ cp1610_andat(1,5); break;
- case 0x38e: /* 1 110 001 110 */ cp1610_andat(1,6); break;
- case 0x38f: /* 1 110 001 111 */ cp1610_andat(1,7); break;
-
- case 0x390: /* 1 110 010 000 */ cp1610_andat(2,0); break;
- case 0x391: /* 1 110 010 001 */ cp1610_andat(2,1); break;
- case 0x392: /* 1 110 010 010 */ cp1610_andat(2,2); break;
- case 0x393: /* 1 110 010 011 */ cp1610_andat(2,3); break;
- case 0x394: /* 1 110 010 100 */ cp1610_andat(2,4); break;
- case 0x395: /* 1 110 010 101 */ cp1610_andat(2,5); break;
- case 0x396: /* 1 110 010 110 */ cp1610_andat(2,6); break;
- case 0x397: /* 1 110 010 111 */ cp1610_andat(2,7); break;
-
- case 0x398: /* 1 110 011 000 */ cp1610_andat(3,0); break;
- case 0x399: /* 1 110 011 001 */ cp1610_andat(3,1); break;
- case 0x39a: /* 1 110 011 010 */ cp1610_andat(3,2); break;
- case 0x39b: /* 1 110 011 011 */ cp1610_andat(3,3); break;
- case 0x39c: /* 1 110 011 100 */ cp1610_andat(3,4); break;
- case 0x39d: /* 1 110 011 101 */ cp1610_andat(3,5); break;
- case 0x39e: /* 1 110 011 110 */ cp1610_andat(3,6); break;
- case 0x39f: /* 1 110 011 111 */ cp1610_andat(3,7); break;
-
- case 0x3a0: /* 1 110 100 000 */ cp1610_andat_i(4,0); break;
- case 0x3a1: /* 1 110 100 001 */ cp1610_andat_i(4,1); break;
- case 0x3a2: /* 1 110 100 010 */ cp1610_andat_i(4,2); break;
- case 0x3a3: /* 1 110 100 011 */ cp1610_andat_i(4,3); break;
- case 0x3a4: /* 1 110 100 100 */ cp1610_andat_i(4,4); break;
- case 0x3a5: /* 1 110 100 101 */ cp1610_andat_i(4,5); break;
- case 0x3a6: /* 1 110 100 110 */ cp1610_andat_i(4,6); break;
- case 0x3a7: /* 1 110 100 111 */ cp1610_andat_i(4,7); break;
-
- case 0x3a8: /* 1 110 101 000 */ cp1610_andat_i(5,0); break;
- case 0x3a9: /* 1 110 101 001 */ cp1610_andat_i(5,1); break;
- case 0x3aa: /* 1 110 101 010 */ cp1610_andat_i(5,2); break;
- case 0x3ab: /* 1 110 101 011 */ cp1610_andat_i(5,3); break;
- case 0x3ac: /* 1 110 101 100 */ cp1610_andat_i(5,4); break;
- case 0x3ad: /* 1 110 101 101 */ cp1610_andat_i(5,5); break;
- case 0x3ae: /* 1 110 101 110 */ cp1610_andat_i(5,6); break;
- case 0x3af: /* 1 110 101 111 */ cp1610_andat_i(5,7); break;
-
- case 0x3b0: /* 1 110 110 000 */ cp1610_andat_d(6,0); break;
- case 0x3b1: /* 1 110 110 001 */ cp1610_andat_d(6,1); break;
- case 0x3b2: /* 1 110 110 010 */ cp1610_andat_d(6,2); break;
- case 0x3b3: /* 1 110 110 011 */ cp1610_andat_d(6,3); break;
- case 0x3b4: /* 1 110 110 100 */ cp1610_andat_d(6,4); break;
- case 0x3b5: /* 1 110 110 101 */ cp1610_andat_d(6,5); break;
- case 0x3b6: /* 1 110 110 110 */ cp1610_andat_d(6,6); break;
- case 0x3b7: /* 1 110 110 111 */ cp1610_andat_d(6,7); break;
-
- case 0x3b8: /* 1 110 111 000 */ cp1610_andi(0); break;
- case 0x3b9: /* 1 110 111 001 */ cp1610_andi(1); break;
- case 0x3ba: /* 1 110 111 010 */ cp1610_andi(2); break;
- case 0x3bb: /* 1 110 111 011 */ cp1610_andi(3); break;
- case 0x3bc: /* 1 110 111 100 */ cp1610_andi(4); break;
- case 0x3bd: /* 1 110 111 101 */ cp1610_andi(5); break;
- case 0x3be: /* 1 110 111 110 */ cp1610_andi(6); break;
- case 0x3bf: /* 1 110 111 111 */ cp1610_andi(7); break;
-
- case 0x3c0: /* 1 111 000 000 */ cp1610_xor(0); break;
- case 0x3c1: /* 1 111 000 001 */ cp1610_xor(1); break;
- case 0x3c2: /* 1 111 000 010 */ cp1610_xor(2); break;
- case 0x3c3: /* 1 111 000 011 */ cp1610_xor(3); break;
- case 0x3c4: /* 1 111 000 100 */ cp1610_xor(4); break;
- case 0x3c5: /* 1 111 000 101 */ cp1610_xor(5); break;
- case 0x3c6: /* 1 111 000 110 */ cp1610_xor(6); break;
- case 0x3c7: /* 1 111 000 111 */ cp1610_xor(7); break;
-
- case 0x3c8: /* 1 111 001 000 */ cp1610_xorat(1,0); break;
- case 0x3c9: /* 1 111 001 001 */ cp1610_xorat(1,1); break;
- case 0x3ca: /* 1 111 001 010 */ cp1610_xorat(1,2); break;
- case 0x3cb: /* 1 111 001 011 */ cp1610_xorat(1,3); break;
- case 0x3cc: /* 1 111 001 100 */ cp1610_xorat(1,4); break;
- case 0x3cd: /* 1 111 001 101 */ cp1610_xorat(1,5); break;
- case 0x3ce: /* 1 111 001 110 */ cp1610_xorat(1,6); break;
- case 0x3cf: /* 1 111 001 111 */ cp1610_xorat(1,7); break;
-
- case 0x3d0: /* 1 111 010 000 */ cp1610_xorat(2,0); break;
- case 0x3d1: /* 1 111 010 001 */ cp1610_xorat(2,1); break;
- case 0x3d2: /* 1 111 010 010 */ cp1610_xorat(2,2); break;
- case 0x3d3: /* 1 111 010 011 */ cp1610_xorat(2,3); break;
- case 0x3d4: /* 1 111 010 100 */ cp1610_xorat(2,4); break;
- case 0x3d5: /* 1 111 010 101 */ cp1610_xorat(2,5); break;
- case 0x3d6: /* 1 111 010 110 */ cp1610_xorat(2,6); break;
- case 0x3d7: /* 1 111 010 111 */ cp1610_xorat(2,7); break;
-
- case 0x3d8: /* 1 111 011 000 */ cp1610_xorat(3,0); break;
- case 0x3d9: /* 1 111 011 001 */ cp1610_xorat(3,1); break;
- case 0x3da: /* 1 111 011 010 */ cp1610_xorat(3,2); break;
- case 0x3db: /* 1 111 011 011 */ cp1610_xorat(3,3); break;
- case 0x3dc: /* 1 111 011 100 */ cp1610_xorat(3,4); break;
- case 0x3dd: /* 1 111 011 101 */ cp1610_xorat(3,5); break;
- case 0x3de: /* 1 111 011 110 */ cp1610_xorat(3,6); break;
- case 0x3df: /* 1 111 011 111 */ cp1610_xorat(3,7); break;
-
- case 0x3e0: /* 1 111 100 000 */ cp1610_xorat_i(4,0); break;
- case 0x3e1: /* 1 111 100 001 */ cp1610_xorat_i(4,1); break;
- case 0x3e2: /* 1 111 100 010 */ cp1610_xorat_i(4,2); break;
- case 0x3e3: /* 1 111 100 011 */ cp1610_xorat_i(4,3); break;
- case 0x3e4: /* 1 111 100 100 */ cp1610_xorat_i(4,4); break;
- case 0x3e5: /* 1 111 100 101 */ cp1610_xorat_i(4,5); break;
- case 0x3e6: /* 1 111 100 110 */ cp1610_xorat_i(4,6); break;
- case 0x3e7: /* 1 111 100 111 */ cp1610_xorat_i(4,7); break;
-
- case 0x3e8: /* 1 111 101 000 */ cp1610_xorat_i(5,0); break;
- case 0x3e9: /* 1 111 101 001 */ cp1610_xorat_i(5,1); break;
- case 0x3ea: /* 1 111 101 010 */ cp1610_xorat_i(5,2); break;
- case 0x3eb: /* 1 111 101 011 */ cp1610_xorat_i(5,3); break;
- case 0x3ec: /* 1 111 101 100 */ cp1610_xorat_i(5,4); break;
- case 0x3ed: /* 1 111 101 101 */ cp1610_xorat_i(5,5); break;
- case 0x3ee: /* 1 111 101 110 */ cp1610_xorat_i(5,6); break;
- case 0x3ef: /* 1 111 101 111 */ cp1610_xorat_i(5,7); break;
-
- case 0x3f0: /* 1 111 110 000 */ cp1610_xorat_d(6,0); break;
- case 0x3f1: /* 1 111 110 001 */ cp1610_xorat_d(6,1); break;
- case 0x3f2: /* 1 111 110 010 */ cp1610_xorat_d(6,2); break;
- case 0x3f3: /* 1 111 110 011 */ cp1610_xorat_d(6,3); break;
- case 0x3f4: /* 1 111 110 100 */ cp1610_xorat_d(6,4); break;
- case 0x3f5: /* 1 111 110 101 */ cp1610_xorat_d(6,5); break;
- case 0x3f6: /* 1 111 110 110 */ cp1610_xorat_d(6,6); break;
- case 0x3f7: /* 1 111 110 111 */ cp1610_xorat_d(6,7); break;
-
- case 0x3f8: /* 1 111 111 000 */ cp1610_xori(0); break;
- case 0x3f9: /* 1 111 111 001 */ cp1610_xori(1); break;
- case 0x3fa: /* 1 111 111 010 */ cp1610_xori(2); break;
- case 0x3fb: /* 1 111 111 011 */ cp1610_xori(3); break;
- case 0x3fc: /* 1 111 111 100 */ cp1610_xori(4); break;
- case 0x3fd: /* 1 111 111 101 */ cp1610_xori(5); break;
- case 0x3fe: /* 1 111 111 110 */ cp1610_xori(6); break;
- case 0x3ff: /* 1 111 111 111 */ cp1610_xori(7); break;
+ case 0x21a: /* 1 000 011 010 */ cp1610_bext(10,0); break;
+ case 0x21b: /* 1 000 011 011 */ cp1610_bext(11,0); break;
+ case 0x21c: /* 1 000 011 100 */ cp1610_bext(12,0); break;
+ case 0x21d: /* 1 000 011 101 */ cp1610_bext(13,0); break;
+ case 0x21e: /* 1 000 011 110 */ cp1610_bext(14,0); break;
+ case 0x21f: /* 1 000 011 111 */ cp1610_bext(15,0); break;
+
+ case 0x220: /* 1 000 100 000 */ cp1610_b(0xffff); break;
+ case 0x221: /* 1 000 100 001 */ cp1610_bc(0xffff); break; /* aka BLGE */
+ case 0x222: /* 1 000 100 010 */ cp1610_bov(0xffff); break;
+ case 0x223: /* 1 000 100 011 */ cp1610_bpl(0xffff); break;
+ case 0x224: /* 1 000 100 100 */ cp1610_bze(0xffff); break; /* aka BEQ */
+ case 0x225: /* 1 000 100 101 */ cp1610_blt(0xffff); break;
+ case 0x226: /* 1 000 100 110 */ cp1610_ble(0xffff); break;
+ case 0x227: /* 1 000 100 111 */ cp1610_busc(0xffff); break;
+
+ case 0x228: /* 1 000 101 000 */ cp1610_nopp(0xffff); break;
+ case 0x229: /* 1 000 101 001 */ cp1610_bnc(0xffff); break; /* aka BLLT */
+ case 0x22a: /* 1 000 101 010 */ cp1610_bnov(0xffff); break;
+ case 0x22b: /* 1 000 101 011 */ cp1610_bmi(0xffff); break;
+ case 0x22c: /* 1 000 101 100 */ cp1610_bnze(0xffff); break; /* aka BNEQ */
+ case 0x22d: /* 1 000 101 101 */ cp1610_bge(0xffff); break;
+ case 0x22e: /* 1 000 101 110 */ cp1610_bgt(0xffff); break;
+ case 0x22f: /* 1 000 101 111 */ cp1610_besc(0xffff); break;
+
+ case 0x230: /* 1 000 110 000 */ cp1610_bext(0,0xffff); break;
+ case 0x231: /* 1 000 110 001 */ cp1610_bext(1,0xffff); break;
+ case 0x232: /* 1 000 110 010 */ cp1610_bext(2,0xffff); break;
+ case 0x233: /* 1 000 110 011 */ cp1610_bext(3,0xffff); break;
+ case 0x234: /* 1 000 110 100 */ cp1610_bext(4,0xffff); break;
+ case 0x235: /* 1 000 110 101 */ cp1610_bext(5,0xffff); break;
+ case 0x236: /* 1 000 110 110 */ cp1610_bext(6,0xffff); break;
+ case 0x237: /* 1 000 110 111 */ cp1610_bext(7,0xffff); break;
+
+ case 0x238: /* 1 000 111 000 */ cp1610_bext(8,0xffff); break;
+ case 0x239: /* 1 000 111 001 */ cp1610_bext(9,0xffff); break;
+ case 0x23a: /* 1 000 111 010 */ cp1610_bext(10,0xffff); break;
+ case 0x23b: /* 1 000 111 011 */ cp1610_bext(11,0xffff); break;
+ case 0x23c: /* 1 000 111 100 */ cp1610_bext(12,0xffff); break;
+ case 0x23d: /* 1 000 111 101 */ cp1610_bext(13,0xffff); break;
+ case 0x23e: /* 1 000 111 110 */ cp1610_bext(14,0xffff); break;
+ case 0x23f: /* 1 000 111 111 */ cp1610_bext(15,0xffff); break;
+
+ case 0x240: /* 1 001 000 000 */ cp1610_mvo(0); break;
+ case 0x241: /* 1 001 000 001 */ cp1610_mvo(1); break;
+ case 0x242: /* 1 001 000 010 */ cp1610_mvo(2); break;
+ case 0x243: /* 1 001 000 011 */ cp1610_mvo(3); break;
+ case 0x244: /* 1 001 000 100 */ cp1610_mvo(4); break;
+ case 0x245: /* 1 001 000 101 */ cp1610_mvo(5); break;
+ case 0x246: /* 1 001 000 110 */ cp1610_mvo(6); break;
+ case 0x247: /* 1 001 000 111 */ cp1610_mvo(7); break;
+
+ case 0x248: /* 1 001 001 000 */ cp1610_mvoat(0,1); break;
+ case 0x249: /* 1 001 001 001 */ cp1610_mvoat(1,1); break;
+ case 0x24a: /* 1 001 001 010 */ cp1610_mvoat(2,1); break;
+ case 0x24b: /* 1 001 001 011 */ cp1610_mvoat(3,1); break;
+ case 0x24c: /* 1 001 001 100 */ cp1610_mvoat(4,1); break;
+ case 0x24d: /* 1 001 001 101 */ cp1610_mvoat(5,1); break;
+ case 0x24e: /* 1 001 001 110 */ cp1610_mvoat(6,1); break;
+ case 0x24f: /* 1 001 001 111 */ cp1610_mvoat(7,1); break;
+
+ case 0x250: /* 1 001 010 000 */ cp1610_mvoat(0,2); break;
+ case 0x251: /* 1 001 010 001 */ cp1610_mvoat(1,2); break;
+ case 0x252: /* 1 001 010 010 */ cp1610_mvoat(2,2); break;
+ case 0x253: /* 1 001 010 011 */ cp1610_mvoat(3,2); break;
+ case 0x254: /* 1 001 010 100 */ cp1610_mvoat(4,2); break;
+ case 0x255: /* 1 001 010 101 */ cp1610_mvoat(5,2); break;
+ case 0x256: /* 1 001 010 110 */ cp1610_mvoat(6,2); break;
+ case 0x257: /* 1 001 010 111 */ cp1610_mvoat(7,2); break;
+
+ case 0x258: /* 1 001 011 000 */ cp1610_mvoat(0,3); break;
+ case 0x259: /* 1 001 011 001 */ cp1610_mvoat(1,3); break;
+ case 0x25a: /* 1 001 011 010 */ cp1610_mvoat(2,3); break;
+ case 0x25b: /* 1 001 011 011 */ cp1610_mvoat(3,3); break;
+ case 0x25c: /* 1 001 011 100 */ cp1610_mvoat(4,3); break;
+ case 0x25d: /* 1 001 011 101 */ cp1610_mvoat(5,3); break;
+ case 0x25e: /* 1 001 011 110 */ cp1610_mvoat(6,3); break;
+ case 0x25f: /* 1 001 011 111 */ cp1610_mvoat(7,3); break;
+
+ case 0x260: /* 1 001 100 000 */ cp1610_mvoat_i(0,4); break;
+ case 0x261: /* 1 001 100 001 */ cp1610_mvoat_i(1,4); break;
+ case 0x262: /* 1 001 100 010 */ cp1610_mvoat_i(2,4); break;
+ case 0x263: /* 1 001 100 011 */ cp1610_mvoat_i(3,4); break;
+ case 0x264: /* 1 001 100 100 */ cp1610_mvoat_i(4,4); break;
+ case 0x265: /* 1 001 100 101 */ cp1610_mvoat_i(5,4); break;
+ case 0x266: /* 1 001 100 110 */ cp1610_mvoat_i(6,4); break;
+ case 0x267: /* 1 001 100 111 */ cp1610_mvoat_i(7,4); break;
+
+ case 0x268: /* 1 001 101 000 */ cp1610_mvoat_i(0,5); break;
+ case 0x269: /* 1 001 101 001 */ cp1610_mvoat_i(1,5); break;
+ case 0x26a: /* 1 001 101 010 */ cp1610_mvoat_i(2,5); break;
+ case 0x26b: /* 1 001 101 011 */ cp1610_mvoat_i(3,5); break;
+ case 0x26c: /* 1 001 101 100 */ cp1610_mvoat_i(4,5); break;
+ case 0x26d: /* 1 001 101 101 */ cp1610_mvoat_i(5,5); break;
+ case 0x26e: /* 1 001 101 110 */ cp1610_mvoat_i(6,5); break;
+ case 0x26f: /* 1 001 101 111 */ cp1610_mvoat_i(7,5); break;
+
+ case 0x270: /* 1 001 110 000 */ cp1610_mvoat_i(0,6); break; /* pshr */
+ case 0x271: /* 1 001 110 001 */ cp1610_mvoat_i(1,6); break; /* pshr */
+ case 0x272: /* 1 001 110 010 */ cp1610_mvoat_i(2,6); break; /* pshr */
+ case 0x273: /* 1 001 110 011 */ cp1610_mvoat_i(3,6); break; /* pshr */
+ case 0x274: /* 1 001 110 100 */ cp1610_mvoat_i(4,6); break; /* pshr */
+ case 0x275: /* 1 001 110 101 */ cp1610_mvoat_i(5,6); break; /* pshr */
+ case 0x276: /* 1 001 110 110 */ cp1610_mvoat_i(6,6); break; /* pshr */
+ case 0x277: /* 1 001 110 111 */ cp1610_mvoat_i(7,6); break; /* pshr */
+
+ case 0x278: /* 1 001 111 000 */ cp1610_mvoi(0); break;
+ case 0x279: /* 1 001 111 001 */ cp1610_mvoi(1); break;
+ case 0x27a: /* 1 001 111 010 */ cp1610_mvoi(2); break;
+ case 0x27b: /* 1 001 111 011 */ cp1610_mvoi(3); break;
+ case 0x27c: /* 1 001 111 100 */ cp1610_mvoi(4); break;
+ case 0x27d: /* 1 001 111 101 */ cp1610_mvoi(5); break;
+ case 0x27e: /* 1 001 111 110 */ cp1610_mvoi(6); break;
+ case 0x27f: /* 1 001 111 111 */ cp1610_mvoi(7); break;
+
+ case 0x280: /* 1 010 000 000 */ cp1610_mvi(0); break;
+ case 0x281: /* 1 010 000 001 */ cp1610_mvi(1); break;
+ case 0x282: /* 1 010 000 010 */ cp1610_mvi(2); break;
+ case 0x283: /* 1 010 000 011 */ cp1610_mvi(3); break;
+ case 0x284: /* 1 010 000 100 */ cp1610_mvi(4); break;
+ case 0x285: /* 1 010 000 101 */ cp1610_mvi(5); break;
+ case 0x286: /* 1 010 000 110 */ cp1610_mvi(6); break;
+ case 0x287: /* 1 010 000 111 */ cp1610_mvi(7); break;
+
+ case 0x288: /* 1 010 001 000 */ cp1610_mviat(1,0); break;
+ case 0x289: /* 1 010 001 001 */ cp1610_mviat(1,1); break;
+ case 0x28a: /* 1 010 001 010 */ cp1610_mviat(1,2); break;
+ case 0x28b: /* 1 010 001 011 */ cp1610_mviat(1,3); break;
+ case 0x28c: /* 1 010 001 100 */ cp1610_mviat(1,4); break;
+ case 0x28d: /* 1 010 001 101 */ cp1610_mviat(1,5); break;
+ case 0x28e: /* 1 010 001 110 */ cp1610_mviat(1,6); break;
+ case 0x28f: /* 1 010 001 111 */ cp1610_mviat(1,7); break;
+
+ case 0x290: /* 1 010 010 000 */ cp1610_mviat(2,0); break;
+ case 0x291: /* 1 010 010 001 */ cp1610_mviat(2,1); break;
+ case 0x292: /* 1 010 010 010 */ cp1610_mviat(2,2); break;
+ case 0x293: /* 1 010 010 011 */ cp1610_mviat(2,3); break;
+ case 0x294: /* 1 010 010 100 */ cp1610_mviat(2,4); break;
+ case 0x295: /* 1 010 010 101 */ cp1610_mviat(2,5); break;
+ case 0x296: /* 1 010 010 110 */ cp1610_mviat(2,6); break;
+ case 0x297: /* 1 010 010 111 */ cp1610_mviat(2,7); break;
+
+ case 0x298: /* 1 010 011 000 */ cp1610_mviat(3,0); break;
+ case 0x299: /* 1 010 011 001 */ cp1610_mviat(3,1); break;
+ case 0x29a: /* 1 010 011 010 */ cp1610_mviat(3,2); break;
+ case 0x29b: /* 1 010 011 011 */ cp1610_mviat(3,3); break;
+ case 0x29c: /* 1 010 011 100 */ cp1610_mviat(3,4); break;
+ case 0x29d: /* 1 010 011 101 */ cp1610_mviat(3,5); break;
+ case 0x29e: /* 1 010 011 110 */ cp1610_mviat(3,6); break;
+ case 0x29f: /* 1 010 011 111 */ cp1610_mviat(3,7); break;
+
+ case 0x2a0: /* 1 010 100 000 */ cp1610_mviat_i(4,0); break;
+ case 0x2a1: /* 1 010 100 001 */ cp1610_mviat_i(4,1); break;
+ case 0x2a2: /* 1 010 100 010 */ cp1610_mviat_i(4,2); break;
+ case 0x2a3: /* 1 010 100 011 */ cp1610_mviat_i(4,3); break;
+ case 0x2a4: /* 1 010 100 100 */ cp1610_mviat_i(4,4); break;
+ case 0x2a5: /* 1 010 100 101 */ cp1610_mviat_i(4,5); break;
+ case 0x2a6: /* 1 010 100 110 */ cp1610_mviat_i(4,6); break;
+ case 0x2a7: /* 1 010 100 111 */ cp1610_mviat_i(4,7); break;
+
+ case 0x2a8: /* 1 010 101 000 */ cp1610_mviat_i(5,0); break;
+ case 0x2a9: /* 1 010 101 001 */ cp1610_mviat_i(5,1); break;
+ case 0x2aa: /* 1 010 101 010 */ cp1610_mviat_i(5,2); break;
+ case 0x2ab: /* 1 010 101 011 */ cp1610_mviat_i(5,3); break;
+ case 0x2ac: /* 1 010 101 100 */ cp1610_mviat_i(5,4); break;
+ case 0x2ad: /* 1 010 101 101 */ cp1610_mviat_i(5,5); break;
+ case 0x2ae: /* 1 010 101 110 */ cp1610_mviat_i(5,6); break;
+ case 0x2af: /* 1 010 101 111 */ cp1610_mviat_i(5,7); break;
+
+ case 0x2b0: /* 1 010 110 000 */ cp1610_pulr(0); break;
+ case 0x2b1: /* 1 010 110 001 */ cp1610_pulr(1); break;
+ case 0x2b2: /* 1 010 110 010 */ cp1610_pulr(2); break;
+ case 0x2b3: /* 1 010 110 011 */ cp1610_pulr(3); break;
+ case 0x2b4: /* 1 010 110 100 */ cp1610_pulr(4); break;
+ case 0x2b5: /* 1 010 110 101 */ cp1610_pulr(5); break;
+ case 0x2b6: /* 1 010 110 110 */ cp1610_pulr(6); break;
+ case 0x2b7: /* 1 010 110 111 */ cp1610_pulr(7); break;
+
+ case 0x2b8: /* 1 010 111 000 */ cp1610_mvii(0); break;
+ case 0x2b9: /* 1 010 111 001 */ cp1610_mvii(1); break;
+ case 0x2ba: /* 1 010 111 010 */ cp1610_mvii(2); break;
+ case 0x2bb: /* 1 010 111 011 */ cp1610_mvii(3); break;
+ case 0x2bc: /* 1 010 111 100 */ cp1610_mvii(4); break;
+ case 0x2bd: /* 1 010 111 101 */ cp1610_mvii(5); break;
+ case 0x2be: /* 1 010 111 110 */ cp1610_mvii(6); break;
+ case 0x2bf: /* 1 010 111 111 */ cp1610_mvii(7); break;
+
+ case 0x2c0: /* 1 011 000 000 */ cp1610_add(0); break;
+ case 0x2c1: /* 1 011 000 001 */ cp1610_add(1); break;
+ case 0x2c2: /* 1 011 000 010 */ cp1610_add(2); break;
+ case 0x2c3: /* 1 011 000 011 */ cp1610_add(3); break;
+ case 0x2c4: /* 1 011 000 100 */ cp1610_add(4); break;
+ case 0x2c5: /* 1 011 000 101 */ cp1610_add(5); break;
+ case 0x2c6: /* 1 011 000 110 */ cp1610_add(6); break;
+ case 0x2c7: /* 1 011 000 111 */ cp1610_add(7); break;
+
+ case 0x2c8: /* 1 011 001 000 */ cp1610_addat(1,0); break;
+ case 0x2c9: /* 1 011 001 001 */ cp1610_addat(1,1); break;
+ case 0x2ca: /* 1 011 001 010 */ cp1610_addat(1,2); break;
+ case 0x2cb: /* 1 011 001 011 */ cp1610_addat(1,3); break;
+ case 0x2cc: /* 1 011 001 100 */ cp1610_addat(1,4); break;
+ case 0x2cd: /* 1 011 001 101 */ cp1610_addat(1,5); break;
+ case 0x2ce: /* 1 011 001 110 */ cp1610_addat(1,6); break;
+ case 0x2cf: /* 1 011 001 111 */ cp1610_addat(1,7); break;
+
+ case 0x2d0: /* 1 011 010 000 */ cp1610_addat(2,0); break;
+ case 0x2d1: /* 1 011 010 001 */ cp1610_addat(2,1); break;
+ case 0x2d2: /* 1 011 010 010 */ cp1610_addat(2,2); break;
+ case 0x2d3: /* 1 011 010 011 */ cp1610_addat(2,3); break;
+ case 0x2d4: /* 1 011 010 100 */ cp1610_addat(2,4); break;
+ case 0x2d5: /* 1 011 010 101 */ cp1610_addat(2,5); break;
+ case 0x2d6: /* 1 011 010 110 */ cp1610_addat(2,6); break;
+ case 0x2d7: /* 1 011 010 111 */ cp1610_addat(2,7); break;
+
+ case 0x2d8: /* 1 011 011 000 */ cp1610_addat(3,0); break;
+ case 0x2d9: /* 1 011 011 001 */ cp1610_addat(3,1); break;
+ case 0x2da: /* 1 011 011 010 */ cp1610_addat(3,2); break;
+ case 0x2db: /* 1 011 011 011 */ cp1610_addat(3,3); break;
+ case 0x2dc: /* 1 011 011 100 */ cp1610_addat(3,4); break;
+ case 0x2dd: /* 1 011 011 101 */ cp1610_addat(3,5); break;
+ case 0x2de: /* 1 011 011 110 */ cp1610_addat(3,6); break;
+ case 0x2df: /* 1 011 011 111 */ cp1610_addat(3,7); break;
+
+ case 0x2e0: /* 1 011 100 000 */ cp1610_addat_i(4,0); break;
+ case 0x2e1: /* 1 011 100 001 */ cp1610_addat_i(4,1); break;
+ case 0x2e2: /* 1 011 100 010 */ cp1610_addat_i(4,2); break;
+ case 0x2e3: /* 1 011 100 011 */ cp1610_addat_i(4,3); break;
+ case 0x2e4: /* 1 011 100 100 */ cp1610_addat_i(4,4); break;
+ case 0x2e5: /* 1 011 100 101 */ cp1610_addat_i(4,5); break;
+ case 0x2e6: /* 1 011 100 110 */ cp1610_addat_i(4,6); break;
+ case 0x2e7: /* 1 011 100 111 */ cp1610_addat_i(4,7); break;
+
+ case 0x2e8: /* 1 011 101 000 */ cp1610_addat_i(5,0); break;
+ case 0x2e9: /* 1 011 101 001 */ cp1610_addat_i(5,1); break;
+ case 0x2ea: /* 1 011 101 010 */ cp1610_addat_i(5,2); break;
+ case 0x2eb: /* 1 011 101 011 */ cp1610_addat_i(5,3); break;
+ case 0x2ec: /* 1 011 101 100 */ cp1610_addat_i(5,4); break;
+ case 0x2ed: /* 1 011 101 101 */ cp1610_addat_i(5,5); break;
+ case 0x2ee: /* 1 011 101 110 */ cp1610_addat_i(5,6); break;
+ case 0x2ef: /* 1 011 101 111 */ cp1610_addat_i(5,7); break;
+
+ case 0x2f0: /* 1 011 110 000 */ cp1610_addat_d(6,0); break;
+ case 0x2f1: /* 1 011 110 001 */ cp1610_addat_d(6,1); break;
+ case 0x2f2: /* 1 011 110 010 */ cp1610_addat_d(6,2); break;
+ case 0x2f3: /* 1 011 110 011 */ cp1610_addat_d(6,3); break;
+ case 0x2f4: /* 1 011 110 100 */ cp1610_addat_d(6,4); break;
+ case 0x2f5: /* 1 011 110 101 */ cp1610_addat_d(6,5); break;
+ case 0x2f6: /* 1 011 110 110 */ cp1610_addat_d(6,6); break;
+ case 0x2f7: /* 1 011 110 111 */ cp1610_addat_d(6,7); break;
+
+ case 0x2f8: /* 1 011 111 000 */ cp1610_addi(0); break;
+ case 0x2f9: /* 1 011 111 001 */ cp1610_addi(1); break;
+ case 0x2fa: /* 1 011 111 010 */ cp1610_addi(2); break;
+ case 0x2fb: /* 1 011 111 011 */ cp1610_addi(3); break;
+ case 0x2fc: /* 1 011 111 100 */ cp1610_addi(4); break;
+ case 0x2fd: /* 1 011 111 101 */ cp1610_addi(5); break;
+ case 0x2fe: /* 1 011 111 110 */ cp1610_addi(6); break;
+ case 0x2ff: /* 1 011 111 111 */ cp1610_addi(7); break;
+
+ case 0x300: /* 1 100 000 000 */ cp1610_sub(0); break;
+ case 0x301: /* 1 100 000 001 */ cp1610_sub(1); break;
+ case 0x302: /* 1 100 000 010 */ cp1610_sub(2); break;
+ case 0x303: /* 1 100 000 011 */ cp1610_sub(3); break;
+ case 0x304: /* 1 100 000 100 */ cp1610_sub(4); break;
+ case 0x305: /* 1 100 000 101 */ cp1610_sub(5); break;
+ case 0x306: /* 1 100 000 110 */ cp1610_sub(6); break;
+ case 0x307: /* 1 100 000 111 */ cp1610_sub(7); break;
+
+ case 0x308: /* 1 100 001 000 */ cp1610_subat(1,0); break;
+ case 0x309: /* 1 100 001 001 */ cp1610_subat(1,1); break;
+ case 0x30a: /* 1 100 001 010 */ cp1610_subat(1,2); break;
+ case 0x30b: /* 1 100 001 011 */ cp1610_subat(1,3); break;
+ case 0x30c: /* 1 100 001 100 */ cp1610_subat(1,4); break;
+ case 0x30d: /* 1 100 001 101 */ cp1610_subat(1,5); break;
+ case 0x30e: /* 1 100 001 110 */ cp1610_subat(1,6); break;
+ case 0x30f: /* 1 100 001 111 */ cp1610_subat(1,7); break;
+
+ case 0x310: /* 1 100 010 000 */ cp1610_subat(2,0); break;
+ case 0x311: /* 1 100 010 001 */ cp1610_subat(2,1); break;
+ case 0x312: /* 1 100 010 010 */ cp1610_subat(2,2); break;
+ case 0x313: /* 1 100 010 011 */ cp1610_subat(2,3); break;
+ case 0x314: /* 1 100 010 100 */ cp1610_subat(2,4); break;
+ case 0x315: /* 1 100 010 101 */ cp1610_subat(2,5); break;
+ case 0x316: /* 1 100 010 110 */ cp1610_subat(2,6); break;
+ case 0x317: /* 1 100 010 111 */ cp1610_subat(2,7); break;
+
+ case 0x318: /* 1 100 011 000 */ cp1610_subat(3,0); break;
+ case 0x319: /* 1 100 011 001 */ cp1610_subat(3,1); break;
+ case 0x31a: /* 1 100 011 010 */ cp1610_subat(3,2); break;
+ case 0x31b: /* 1 100 011 011 */ cp1610_subat(3,3); break;
+ case 0x31c: /* 1 100 011 100 */ cp1610_subat(3,4); break;
+ case 0x31d: /* 1 100 011 101 */ cp1610_subat(3,5); break;
+ case 0x31e: /* 1 100 011 110 */ cp1610_subat(3,6); break;
+ case 0x31f: /* 1 100 011 111 */ cp1610_subat(3,7); break;
+
+ case 0x320: /* 1 100 100 000 */ cp1610_subat_i(4,0); break;
+ case 0x321: /* 1 100 100 001 */ cp1610_subat_i(4,1); break;
+ case 0x322: /* 1 100 100 010 */ cp1610_subat_i(4,2); break;
+ case 0x323: /* 1 100 100 011 */ cp1610_subat_i(4,3); break;
+ case 0x324: /* 1 100 100 100 */ cp1610_subat_i(4,4); break;
+ case 0x325: /* 1 100 100 101 */ cp1610_subat_i(4,5); break;
+ case 0x326: /* 1 100 100 110 */ cp1610_subat_i(4,6); break;
+ case 0x327: /* 1 100 100 111 */ cp1610_subat_i(4,7); break;
+
+ case 0x328: /* 1 100 101 000 */ cp1610_subat_i(5,0); break;
+ case 0x329: /* 1 100 101 001 */ cp1610_subat_i(5,1); break;
+ case 0x32a: /* 1 100 101 010 */ cp1610_subat_i(5,2); break;
+ case 0x32b: /* 1 100 101 011 */ cp1610_subat_i(5,3); break;
+ case 0x32c: /* 1 100 101 100 */ cp1610_subat_i(5,4); break;
+ case 0x32d: /* 1 100 101 101 */ cp1610_subat_i(5,5); break;
+ case 0x32e: /* 1 100 101 110 */ cp1610_subat_i(5,6); break;
+ case 0x32f: /* 1 100 101 111 */ cp1610_subat_i(5,7); break;
+
+ case 0x330: /* 1 100 110 000 */ cp1610_subat_d(6,0); break;
+ case 0x331: /* 1 100 110 001 */ cp1610_subat_d(6,1); break;
+ case 0x332: /* 1 100 110 010 */ cp1610_subat_d(6,2); break;
+ case 0x333: /* 1 100 110 011 */ cp1610_subat_d(6,3); break;
+ case 0x334: /* 1 100 110 100 */ cp1610_subat_d(6,4); break;
+ case 0x335: /* 1 100 110 101 */ cp1610_subat_d(6,5); break;
+ case 0x336: /* 1 100 110 110 */ cp1610_subat_d(6,6); break;
+ case 0x337: /* 1 100 110 111 */ cp1610_subat_d(6,7); break;
+
+ case 0x338: /* 1 100 111 000 */ cp1610_subi(0); break;
+ case 0x339: /* 1 100 111 001 */ cp1610_subi(1); break;
+ case 0x33a: /* 1 100 111 010 */ cp1610_subi(2); break;
+ case 0x33b: /* 1 100 111 011 */ cp1610_subi(3); break;
+ case 0x33c: /* 1 100 111 100 */ cp1610_subi(4); break;
+ case 0x33d: /* 1 100 111 101 */ cp1610_subi(5); break;
+ case 0x33e: /* 1 100 111 110 */ cp1610_subi(6); break;
+ case 0x33f: /* 1 100 111 111 */ cp1610_subi(7); break;
+
+ case 0x340: /* 1 101 000 000 */ cp1610_cmp(0); break;
+ case 0x341: /* 1 101 000 001 */ cp1610_cmp(1); break;
+ case 0x342: /* 1 101 000 010 */ cp1610_cmp(2); break;
+ case 0x343: /* 1 101 000 011 */ cp1610_cmp(3); break;
+ case 0x344: /* 1 101 000 100 */ cp1610_cmp(4); break;
+ case 0x345: /* 1 101 000 101 */ cp1610_cmp(5); break;
+ case 0x346: /* 1 101 000 110 */ cp1610_cmp(6); break;
+ case 0x347: /* 1 101 000 111 */ cp1610_cmp(7); break;
+
+ case 0x348: /* 1 101 001 000 */ cp1610_cmpat(1,0); break;
+ case 0x349: /* 1 101 001 001 */ cp1610_cmpat(1,1); break;
+ case 0x34a: /* 1 101 001 010 */ cp1610_cmpat(1,2); break;
+ case 0x34b: /* 1 101 001 011 */ cp1610_cmpat(1,3); break;
+ case 0x34c: /* 1 101 001 100 */ cp1610_cmpat(1,4); break;
+ case 0x34d: /* 1 101 001 101 */ cp1610_cmpat(1,5); break;
+ case 0x34e: /* 1 101 001 110 */ cp1610_cmpat(1,6); break;
+ case 0x34f: /* 1 101 001 111 */ cp1610_cmpat(1,7); break;
+
+ case 0x350: /* 1 101 010 000 */ cp1610_cmpat(2,0); break;
+ case 0x351: /* 1 101 010 001 */ cp1610_cmpat(2,1); break;
+ case 0x352: /* 1 101 010 010 */ cp1610_cmpat(2,2); break;
+ case 0x353: /* 1 101 010 011 */ cp1610_cmpat(2,3); break;
+ case 0x354: /* 1 101 010 100 */ cp1610_cmpat(2,4); break;
+ case 0x355: /* 1 101 010 101 */ cp1610_cmpat(2,5); break;
+ case 0x356: /* 1 101 010 110 */ cp1610_cmpat(2,6); break;
+ case 0x357: /* 1 101 010 111 */ cp1610_cmpat(2,7); break;
+
+ case 0x358: /* 1 101 011 000 */ cp1610_cmpat(3,0); break;
+ case 0x359: /* 1 101 011 001 */ cp1610_cmpat(3,1); break;
+ case 0x35a: /* 1 101 011 010 */ cp1610_cmpat(3,2); break;
+ case 0x35b: /* 1 101 011 011 */ cp1610_cmpat(3,3); break;
+ case 0x35c: /* 1 101 011 100 */ cp1610_cmpat(3,4); break;
+ case 0x35d: /* 1 101 011 101 */ cp1610_cmpat(3,5); break;
+ case 0x35e: /* 1 101 011 110 */ cp1610_cmpat(3,6); break;
+ case 0x35f: /* 1 101 011 111 */ cp1610_cmpat(3,7); break;
+
+ case 0x360: /* 1 101 100 000 */ cp1610_cmpat_i(4,0); break;
+ case 0x361: /* 1 101 100 001 */ cp1610_cmpat_i(4,1); break;
+ case 0x362: /* 1 101 100 010 */ cp1610_cmpat_i(4,2); break;
+ case 0x363: /* 1 101 100 011 */ cp1610_cmpat_i(4,3); break;
+ case 0x364: /* 1 101 100 100 */ cp1610_cmpat_i(4,4); break;
+ case 0x365: /* 1 101 100 101 */ cp1610_cmpat_i(4,5); break;
+ case 0x366: /* 1 101 100 110 */ cp1610_cmpat_i(4,6); break;
+ case 0x367: /* 1 101 100 111 */ cp1610_cmpat_i(4,7); break;
+
+ case 0x368: /* 1 101 101 000 */ cp1610_cmpat_i(5,0); break;
+ case 0x369: /* 1 101 101 001 */ cp1610_cmpat_i(5,1); break;
+ case 0x36a: /* 1 101 101 010 */ cp1610_cmpat_i(5,2); break;
+ case 0x36b: /* 1 101 101 011 */ cp1610_cmpat_i(5,3); break;
+ case 0x36c: /* 1 101 101 100 */ cp1610_cmpat_i(5,4); break;
+ case 0x36d: /* 1 101 101 101 */ cp1610_cmpat_i(5,5); break;
+ case 0x36e: /* 1 101 101 110 */ cp1610_cmpat_i(5,6); break;
+ case 0x36f: /* 1 101 101 111 */ cp1610_cmpat_i(5,7); break;
+
+ case 0x370: /* 1 101 110 000 */ cp1610_cmpat_d(6,0); break;
+ case 0x371: /* 1 101 110 001 */ cp1610_cmpat_d(6,1); break;
+ case 0x372: /* 1 101 110 010 */ cp1610_cmpat_d(6,2); break;
+ case 0x373: /* 1 101 110 011 */ cp1610_cmpat_d(6,3); break;
+ case 0x374: /* 1 101 110 100 */ cp1610_cmpat_d(6,4); break;
+ case 0x375: /* 1 101 110 101 */ cp1610_cmpat_d(6,5); break;
+ case 0x376: /* 1 101 110 110 */ cp1610_cmpat_d(6,6); break;
+ case 0x377: /* 1 101 110 111 */ cp1610_cmpat_d(6,7); break;
+
+ case 0x378: /* 1 101 111 000 */ cp1610_cmpi(0); break;
+ case 0x379: /* 1 101 111 001 */ cp1610_cmpi(1); break;
+ case 0x37a: /* 1 101 111 010 */ cp1610_cmpi(2); break;
+ case 0x37b: /* 1 101 111 011 */ cp1610_cmpi(3); break;
+ case 0x37c: /* 1 101 111 100 */ cp1610_cmpi(4); break;
+ case 0x37d: /* 1 101 111 101 */ cp1610_cmpi(5); break;
+ case 0x37e: /* 1 101 111 110 */ cp1610_cmpi(6); break;
+ case 0x37f: /* 1 101 111 111 */ cp1610_cmpi(7); break;
+
+ case 0x380: /* 1 110 000 000 */ cp1610_and(0); break;
+ case 0x381: /* 1 110 000 001 */ cp1610_and(1); break;
+ case 0x382: /* 1 110 000 010 */ cp1610_and(2); break;
+ case 0x383: /* 1 110 000 011 */ cp1610_and(3); break;
+ case 0x384: /* 1 110 000 100 */ cp1610_and(4); break;
+ case 0x385: /* 1 110 000 101 */ cp1610_and(5); break;
+ case 0x386: /* 1 110 000 110 */ cp1610_and(6); break;
+ case 0x387: /* 1 110 000 111 */ cp1610_and(7); break;
+
+ case 0x388: /* 1 110 001 000 */ cp1610_andat(1,0); break;
+ case 0x389: /* 1 110 001 001 */ cp1610_andat(1,1); break;
+ case 0x38a: /* 1 110 001 010 */ cp1610_andat(1,2); break;
+ case 0x38b: /* 1 110 001 011 */ cp1610_andat(1,3); break;
+ case 0x38c: /* 1 110 001 100 */ cp1610_andat(1,4); break;
+ case 0x38d: /* 1 110 001 101 */ cp1610_andat(1,5); break;
+ case 0x38e: /* 1 110 001 110 */ cp1610_andat(1,6); break;
+ case 0x38f: /* 1 110 001 111 */ cp1610_andat(1,7); break;
+
+ case 0x390: /* 1 110 010 000 */ cp1610_andat(2,0); break;
+ case 0x391: /* 1 110 010 001 */ cp1610_andat(2,1); break;
+ case 0x392: /* 1 110 010 010 */ cp1610_andat(2,2); break;
+ case 0x393: /* 1 110 010 011 */ cp1610_andat(2,3); break;
+ case 0x394: /* 1 110 010 100 */ cp1610_andat(2,4); break;
+ case 0x395: /* 1 110 010 101 */ cp1610_andat(2,5); break;
+ case 0x396: /* 1 110 010 110 */ cp1610_andat(2,6); break;
+ case 0x397: /* 1 110 010 111 */ cp1610_andat(2,7); break;
+
+ case 0x398: /* 1 110 011 000 */ cp1610_andat(3,0); break;
+ case 0x399: /* 1 110 011 001 */ cp1610_andat(3,1); break;
+ case 0x39a: /* 1 110 011 010 */ cp1610_andat(3,2); break;
+ case 0x39b: /* 1 110 011 011 */ cp1610_andat(3,3); break;
+ case 0x39c: /* 1 110 011 100 */ cp1610_andat(3,4); break;
+ case 0x39d: /* 1 110 011 101 */ cp1610_andat(3,5); break;
+ case 0x39e: /* 1 110 011 110 */ cp1610_andat(3,6); break;
+ case 0x39f: /* 1 110 011 111 */ cp1610_andat(3,7); break;
+
+ case 0x3a0: /* 1 110 100 000 */ cp1610_andat_i(4,0); break;
+ case 0x3a1: /* 1 110 100 001 */ cp1610_andat_i(4,1); break;
+ case 0x3a2: /* 1 110 100 010 */ cp1610_andat_i(4,2); break;
+ case 0x3a3: /* 1 110 100 011 */ cp1610_andat_i(4,3); break;
+ case 0x3a4: /* 1 110 100 100 */ cp1610_andat_i(4,4); break;
+ case 0x3a5: /* 1 110 100 101 */ cp1610_andat_i(4,5); break;
+ case 0x3a6: /* 1 110 100 110 */ cp1610_andat_i(4,6); break;
+ case 0x3a7: /* 1 110 100 111 */ cp1610_andat_i(4,7); break;
+
+ case 0x3a8: /* 1 110 101 000 */ cp1610_andat_i(5,0); break;
+ case 0x3a9: /* 1 110 101 001 */ cp1610_andat_i(5,1); break;
+ case 0x3aa: /* 1 110 101 010 */ cp1610_andat_i(5,2); break;
+ case 0x3ab: /* 1 110 101 011 */ cp1610_andat_i(5,3); break;
+ case 0x3ac: /* 1 110 101 100 */ cp1610_andat_i(5,4); break;
+ case 0x3ad: /* 1 110 101 101 */ cp1610_andat_i(5,5); break;
+ case 0x3ae: /* 1 110 101 110 */ cp1610_andat_i(5,6); break;
+ case 0x3af: /* 1 110 101 111 */ cp1610_andat_i(5,7); break;
+
+ case 0x3b0: /* 1 110 110 000 */ cp1610_andat_d(6,0); break;
+ case 0x3b1: /* 1 110 110 001 */ cp1610_andat_d(6,1); break;
+ case 0x3b2: /* 1 110 110 010 */ cp1610_andat_d(6,2); break;
+ case 0x3b3: /* 1 110 110 011 */ cp1610_andat_d(6,3); break;
+ case 0x3b4: /* 1 110 110 100 */ cp1610_andat_d(6,4); break;
+ case 0x3b5: /* 1 110 110 101 */ cp1610_andat_d(6,5); break;
+ case 0x3b6: /* 1 110 110 110 */ cp1610_andat_d(6,6); break;
+ case 0x3b7: /* 1 110 110 111 */ cp1610_andat_d(6,7); break;
+
+ case 0x3b8: /* 1 110 111 000 */ cp1610_andi(0); break;
+ case 0x3b9: /* 1 110 111 001 */ cp1610_andi(1); break;
+ case 0x3ba: /* 1 110 111 010 */ cp1610_andi(2); break;
+ case 0x3bb: /* 1 110 111 011 */ cp1610_andi(3); break;
+ case 0x3bc: /* 1 110 111 100 */ cp1610_andi(4); break;
+ case 0x3bd: /* 1 110 111 101 */ cp1610_andi(5); break;
+ case 0x3be: /* 1 110 111 110 */ cp1610_andi(6); break;
+ case 0x3bf: /* 1 110 111 111 */ cp1610_andi(7); break;
+
+ case 0x3c0: /* 1 111 000 000 */ cp1610_xor(0); break;
+ case 0x3c1: /* 1 111 000 001 */ cp1610_xor(1); break;
+ case 0x3c2: /* 1 111 000 010 */ cp1610_xor(2); break;
+ case 0x3c3: /* 1 111 000 011 */ cp1610_xor(3); break;
+ case 0x3c4: /* 1 111 000 100 */ cp1610_xor(4); break;
+ case 0x3c5: /* 1 111 000 101 */ cp1610_xor(5); break;
+ case 0x3c6: /* 1 111 000 110 */ cp1610_xor(6); break;
+ case 0x3c7: /* 1 111 000 111 */ cp1610_xor(7); break;
+
+ case 0x3c8: /* 1 111 001 000 */ cp1610_xorat(1,0); break;
+ case 0x3c9: /* 1 111 001 001 */ cp1610_xorat(1,1); break;
+ case 0x3ca: /* 1 111 001 010 */ cp1610_xorat(1,2); break;
+ case 0x3cb: /* 1 111 001 011 */ cp1610_xorat(1,3); break;
+ case 0x3cc: /* 1 111 001 100 */ cp1610_xorat(1,4); break;
+ case 0x3cd: /* 1 111 001 101 */ cp1610_xorat(1,5); break;
+ case 0x3ce: /* 1 111 001 110 */ cp1610_xorat(1,6); break;
+ case 0x3cf: /* 1 111 001 111 */ cp1610_xorat(1,7); break;
+
+ case 0x3d0: /* 1 111 010 000 */ cp1610_xorat(2,0); break;
+ case 0x3d1: /* 1 111 010 001 */ cp1610_xorat(2,1); break;
+ case 0x3d2: /* 1 111 010 010 */ cp1610_xorat(2,2); break;
+ case 0x3d3: /* 1 111 010 011 */ cp1610_xorat(2,3); break;
+ case 0x3d4: /* 1 111 010 100 */ cp1610_xorat(2,4); break;
+ case 0x3d5: /* 1 111 010 101 */ cp1610_xorat(2,5); break;
+ case 0x3d6: /* 1 111 010 110 */ cp1610_xorat(2,6); break;
+ case 0x3d7: /* 1 111 010 111 */ cp1610_xorat(2,7); break;
+
+ case 0x3d8: /* 1 111 011 000 */ cp1610_xorat(3,0); break;
+ case 0x3d9: /* 1 111 011 001 */ cp1610_xorat(3,1); break;
+ case 0x3da: /* 1 111 011 010 */ cp1610_xorat(3,2); break;
+ case 0x3db: /* 1 111 011 011 */ cp1610_xorat(3,3); break;
+ case 0x3dc: /* 1 111 011 100 */ cp1610_xorat(3,4); break;
+ case 0x3dd: /* 1 111 011 101 */ cp1610_xorat(3,5); break;
+ case 0x3de: /* 1 111 011 110 */ cp1610_xorat(3,6); break;
+ case 0x3df: /* 1 111 011 111 */ cp1610_xorat(3,7); break;
+
+ case 0x3e0: /* 1 111 100 000 */ cp1610_xorat_i(4,0); break;
+ case 0x3e1: /* 1 111 100 001 */ cp1610_xorat_i(4,1); break;
+ case 0x3e2: /* 1 111 100 010 */ cp1610_xorat_i(4,2); break;
+ case 0x3e3: /* 1 111 100 011 */ cp1610_xorat_i(4,3); break;
+ case 0x3e4: /* 1 111 100 100 */ cp1610_xorat_i(4,4); break;
+ case 0x3e5: /* 1 111 100 101 */ cp1610_xorat_i(4,5); break;
+ case 0x3e6: /* 1 111 100 110 */ cp1610_xorat_i(4,6); break;
+ case 0x3e7: /* 1 111 100 111 */ cp1610_xorat_i(4,7); break;
+
+ case 0x3e8: /* 1 111 101 000 */ cp1610_xorat_i(5,0); break;
+ case 0x3e9: /* 1 111 101 001 */ cp1610_xorat_i(5,1); break;
+ case 0x3ea: /* 1 111 101 010 */ cp1610_xorat_i(5,2); break;
+ case 0x3eb: /* 1 111 101 011 */ cp1610_xorat_i(5,3); break;
+ case 0x3ec: /* 1 111 101 100 */ cp1610_xorat_i(5,4); break;
+ case 0x3ed: /* 1 111 101 101 */ cp1610_xorat_i(5,5); break;
+ case 0x3ee: /* 1 111 101 110 */ cp1610_xorat_i(5,6); break;
+ case 0x3ef: /* 1 111 101 111 */ cp1610_xorat_i(5,7); break;
+
+ case 0x3f0: /* 1 111 110 000 */ cp1610_xorat_d(6,0); break;
+ case 0x3f1: /* 1 111 110 001 */ cp1610_xorat_d(6,1); break;
+ case 0x3f2: /* 1 111 110 010 */ cp1610_xorat_d(6,2); break;
+ case 0x3f3: /* 1 111 110 011 */ cp1610_xorat_d(6,3); break;
+ case 0x3f4: /* 1 111 110 100 */ cp1610_xorat_d(6,4); break;
+ case 0x3f5: /* 1 111 110 101 */ cp1610_xorat_d(6,5); break;
+ case 0x3f6: /* 1 111 110 110 */ cp1610_xorat_d(6,6); break;
+ case 0x3f7: /* 1 111 110 111 */ cp1610_xorat_d(6,7); break;
+
+ case 0x3f8: /* 1 111 111 000 */ cp1610_xori(0); break;
+ case 0x3f9: /* 1 111 111 001 */ cp1610_xori(1); break;
+ case 0x3fa: /* 1 111 111 010 */ cp1610_xori(2); break;
+ case 0x3fb: /* 1 111 111 011 */ cp1610_xori(3); break;
+ case 0x3fc: /* 1 111 111 100 */ cp1610_xori(4); break;
+ case 0x3fd: /* 1 111 111 101 */ cp1610_xori(5); break;
+ case 0x3fe: /* 1 111 111 110 */ cp1610_xori(6); break;
+ case 0x3ff: /* 1 111 111 111 */ cp1610_xori(7); break;
}
if (m_mask_interrupts == 0)
@@ -3389,6 +3365,12 @@ void cp1610_cpu_device::device_start()
m_icountptr = &m_icount;
}
+void cp1610_cpu_device::device_reset()
+{
+ /* This is how we set the reset vector */
+ set_input_line(CP1610_RESET, PULSE_LINE);
+}
+
void cp1610_cpu_device::execute_set_input(int irqline, int state)
{
switch(irqline)
diff --git a/src/emu/cpu/cp1610/cp1610.h b/src/emu/cpu/cp1610/cp1610.h
index 670fb0deac8..d3d7c9a78a4 100644
--- a/src/emu/cpu/cp1610/cp1610.h
+++ b/src/emu/cpu/cp1610/cp1610.h
@@ -205,7 +205,6 @@ private:
void cp1610_jd(UINT16 addr);
void cp1610_do_sdbd();
void cp1610_do_jumps();
-
};
diff --git a/src/emu/cpu/cubeqcpu/cubeqcpu.c b/src/emu/cpu/cubeqcpu/cubeqcpu.c
index 7b79940c998..2a1678396c2 100644
--- a/src/emu/cpu/cubeqcpu/cubeqcpu.c
+++ b/src/emu/cpu/cubeqcpu/cubeqcpu.c
@@ -32,7 +32,7 @@ enum alu_src
ZA = 4,
DA = 5,
DQ = 6,
- DZ = 7,
+ DZ = 7
};
enum alu_ins
@@ -44,7 +44,7 @@ enum alu_ins
AND = 4,
NOTRS = 5,
EXOR = 6,
- EXNOR = 7,
+ EXNOR = 7
};
enum alu_dst
@@ -56,7 +56,7 @@ enum alu_dst
RAMQD = 4,
RAMD = 5,
RAMQU = 6,
- RAMU = 7,
+ RAMU = 7
};
/***************************************************************************
@@ -496,7 +496,7 @@ enum snd_latch_type
{
PLTCH = 0,
DAC = 1,
- ADLATCH = 2,
+ ADLATCH = 2
};
int cquestsnd_cpu_device::do_sndjmp(int jmp)
@@ -520,7 +520,7 @@ void cquestsnd_cpu_device::execute_run()
do
{
/* Decode the instruction */
- UINT64 inst = m_direct->read_decrypted_qword(SND_PC << 3);
+ UINT64 inst = m_direct->read_qword(SND_PC << 3);
UINT32 inslow = inst & 0xffffffff;
UINT32 inshig = inst >> 32;
@@ -728,7 +728,7 @@ enum rot_spf
SPF_DIV = 6,
SPF_MULT = 7,
SPF_DRED = 8,
- SPF_DWRT = 9,
+ SPF_DWRT = 9
};
enum rot_yout
@@ -740,7 +740,7 @@ enum rot_yout
YOUT_Y2DAD = 4,
YOUT_Y2DYN = 5,
YOUT_Y2R = 6,
- YOUT_Y2D = 7,
+ YOUT_Y2D = 7
};
/* Sync is asserted for the duration of every fourth cycle */
@@ -776,7 +776,7 @@ void cquestrot_cpu_device::execute_run()
do
{
/* Decode the instruction */
- UINT64 inst = m_direct->read_decrypted_qword(ROT_PC << 3);
+ UINT64 inst = m_direct->read_qword(ROT_PC << 3);
UINT32 inslow = inst & 0xffffffff;
UINT32 inshig = inst >> 32;
@@ -1098,7 +1098,7 @@ enum line_spf
LSPF_PWRT = 4,
LSPF_MULT = 5,
LSPF_LSTOP = 6,
- LSPF_BRES = 7,
+ LSPF_BRES = 7
};
enum line_latch
@@ -1110,7 +1110,7 @@ enum line_latch
LLATCH_BADLATCH = 4,
LLATCH_FADLATCH = 5,
LLATCH_CLATCH = 6,
- LLATCH_ZLATCH = 7,
+ LLATCH_ZLATCH = 7
};
enum sreg_bits
@@ -1122,7 +1122,7 @@ enum sreg_bits
SREG_LE0 = 4,
SREG_LDX_DY = 5,
SREG_LDY = 6,
- SREG_LDX = 7,
+ SREG_LDX = 7
};
int cquestlin_cpu_device::do_linjmp(int jmp)
@@ -1196,7 +1196,7 @@ void cquestlin_cpu_device::execute_run()
int prog = (m_clkcnt & 3) ? BACKGROUND : FOREGROUND;
m_curpc = LINE_PC;
- UINT64 inst = m_direct->read_decrypted_qword(LINE_PC << 3);
+ UINT64 inst = m_direct->read_qword(LINE_PC << 3);
UINT32 inslow = inst & 0xffffffff;
UINT32 inshig = inst >> 32;
diff --git a/src/emu/cpu/cubeqcpu/cubeqcpu.h b/src/emu/cpu/cubeqcpu/cubeqcpu.h
index 4a6926e3cee..4befd97d662 100644
--- a/src/emu/cpu/cubeqcpu/cubeqcpu.h
+++ b/src/emu/cpu/cubeqcpu/cubeqcpu.h
@@ -48,7 +48,7 @@ enum
CQUESTSND_RAMF,
CQUESTSND_RTNLATCH,
CQUESTSND_ADRCNTR,
- CQUESTSND_DINLATCH,
+ CQUESTSND_DINLATCH
};
enum
@@ -80,7 +80,7 @@ enum
CQUESTROT_DSRCLATCH,
CQUESTROT_RSRCLATCH,
CQUESTROT_LDADDR,
- CQUESTROT_LDDATA,
+ CQUESTROT_LDDATA
};
enum
@@ -110,7 +110,7 @@ enum
CQUESTLIN_XCNT,
CQUESTLIN_YCNT,
CQUESTLIN_CLATCH,
- CQUESTLIN_ZLATCH,
+ CQUESTLIN_ZLATCH
};
diff --git a/src/emu/cpu/drcbec.c b/src/emu/cpu/drcbec.c
index 93e2d655ecf..d3e1538c1ba 100644
--- a/src/emu/cpu/drcbec.c
+++ b/src/emu/cpu/drcbec.c
@@ -127,7 +127,7 @@ enum
OP_FFRI4,
OP_FFRI8,
OP_FFRFS,
- OP_FFRFD,
+ OP_FFRFD
};
diff --git a/src/emu/cpu/dsp16/dsp16.c b/src/emu/cpu/dsp16/dsp16.c
index 565377eb714..9f1de0c79f6 100644
--- a/src/emu/cpu/dsp16/dsp16.c
+++ b/src/emu/cpu/dsp16/dsp16.c
@@ -373,7 +373,7 @@ inline void dsp16_device::data_write(const UINT16& addr, const UINT16& data)
inline UINT32 dsp16_device::opcode_read(const UINT8 pcOffset)
{
const UINT16 readPC = m_pc + pcOffset;
- return m_direct->read_decrypted_dword(readPC << 1);
+ return m_direct->read_dword(readPC << 1);
}
diff --git a/src/emu/cpu/dsp32/dsp32.c b/src/emu/cpu/dsp32/dsp32.c
index 2de5e6f50d6..21de1f18a74 100644
--- a/src/emu/cpu/dsp32/dsp32.c
+++ b/src/emu/cpu/dsp32/dsp32.c
@@ -437,7 +437,7 @@ offs_t dsp32c_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *o
inline UINT32 dsp32c_device::ROPCODE(offs_t pc)
{
- return m_direct->read_decrypted_dword(pc);
+ return m_direct->read_dword(pc);
}
inline UINT8 dsp32c_device::RBYTE(offs_t addr)
diff --git a/src/emu/cpu/dsp56k/dsp56k.c b/src/emu/cpu/dsp56k/dsp56k.c
index 408521ea8fc..9e151019c7e 100644
--- a/src/emu/cpu/dsp56k/dsp56k.c
+++ b/src/emu/cpu/dsp56k/dsp56k.c
@@ -108,7 +108,7 @@ const device_type DSP56156 = &device_creator<dsp56k_device>;
* Internal Memory Maps
****************************************************************************/
static ADDRESS_MAP_START( dsp56156_program_map, AS_PROGRAM, 16, dsp56k_device )
- AM_RANGE(0x0000,0x07ff) AM_READWRITE(program_r, program_w) /* 1-5 */
+ AM_RANGE(0x0000,0x07ff) AM_RAM AM_SHARE("dsk56k_program_ram") /* 1-5 */
// AM_RANGE(0x2f00,0x2fff) AM_ROM /* 1-5 PROM reserved memory. Is this the right spot for it? */
ADDRESS_MAP_END
@@ -122,29 +122,14 @@ dsp56k_device::dsp56k_device(const machine_config &mconfig, const char *tag, dev
: cpu_device(mconfig, DSP56156, "DSP56156", tag, owner, clock, "dsp56156", __FILE__)
, m_program_config("program", ENDIANNESS_LITTLE, 16, 16, -1, ADDRESS_MAP_NAME(dsp56156_program_map))
, m_data_config("data", ENDIANNESS_LITTLE, 16, 16, -1, ADDRESS_MAP_NAME(dsp56156_x_data_map))
+ , m_program_ram(*this, "dsk56k_program_ram")
{
}
-
-/***************************************************************************
- Direct Update Handler
-***************************************************************************/
-DIRECT_UPDATE_MEMBER( dsp56k_device::dsp56k_direct_handler )
-{
- if (address <= (0x07ff<<1))
- {
- direct.explicit_configure(0x0000<<1, 0x07ff<<1, (0x07ff<<1) | 1, m_dsp56k_core.program_ram);
- return ~0;
- }
-
- return address;
-}
-
-
/***************************************************************************
MEMORY ACCESSORS
***************************************************************************/
-#define ROPCODE(pc) cpustate->direct->read_decrypted_word(pc)
+#define ROPCODE(pc) cpustate->direct->read_word(pc)
/***************************************************************************
@@ -255,6 +240,7 @@ void dsp56k_device::device_start()
memset(&m_dsp56k_core, 0, sizeof(m_dsp56k_core));
m_dsp56k_core.device = this;
+ m_dsp56k_core.program_ram = m_program_ram;
/* Call specific module inits */
pcu_init(&m_dsp56k_core, this);
@@ -292,16 +278,11 @@ void dsp56k_device::device_start()
save_item(NAME(m_dsp56k_core.HI.bootstrap_offset));
save_item(NAME(m_dsp56k_core.peripheral_ram));
- save_item(NAME(m_dsp56k_core.program_ram));
m_dsp56k_core.program = &space(AS_PROGRAM);
m_dsp56k_core.direct = &m_dsp56k_core.program->direct();
m_dsp56k_core.data = &space(AS_DATA);
- /* Setup the direct memory handler for this CPU */
- /* NOTE: Be sure to grab this guy and call him if you ever install another direct_update_hander in a driver! */
- m_dsp56k_core.program->set_direct_update_handler(direct_update_delegate(FUNC(dsp56k_device::dsp56k_direct_handler), this));
-
state_add(DSP56K_PC, "PC", m_dsp56k_core.PCU.pc).formatstr("%04X");
state_add(DSP56K_SR, "SR", m_dsp56k_core.PCU.sr).formatstr("%04X");
state_add(DSP56K_LC, "LC", m_dsp56k_core.PCU.lc).formatstr("%04X");
diff --git a/src/emu/cpu/dsp56k/dsp56k.h b/src/emu/cpu/dsp56k/dsp56k.h
index c8d8c948a90..fc461dbcb16 100644
--- a/src/emu/cpu/dsp56k/dsp56k.h
+++ b/src/emu/cpu/dsp56k/dsp56k.h
@@ -195,7 +195,7 @@ struct dsp56k_core
address_space *data;
UINT16 peripheral_ram[0x40];
- UINT16 program_ram[0x800];
+ UINT16 *program_ram;
};
@@ -204,7 +204,6 @@ class dsp56k_device : public cpu_device
public:
dsp56k_device(const machine_config &mconfig, const char *_tag, device_t *_owner, UINT32 _clock);
- DECLARE_DIRECT_UPDATE_MEMBER(dsp56k_direct_handler);
DECLARE_READ16_MEMBER( program_r );
DECLARE_WRITE16_MEMBER( program_w );
DECLARE_READ16_MEMBER( peripheral_register_r );
@@ -244,6 +243,7 @@ protected:
private:
address_space_config m_program_config;
address_space_config m_data_config;
+ required_shared_ptr<UINT16> m_program_ram;
dsp56k_core m_dsp56k_core;
diff --git a/src/emu/cpu/dsp56k/dsp56mem.c b/src/emu/cpu/dsp56k/dsp56mem.c
index a6c4c61b9fe..6ec2251df64 100644
--- a/src/emu/cpu/dsp56k/dsp56mem.c
+++ b/src/emu/cpu/dsp56k/dsp56mem.c
@@ -488,16 +488,6 @@ void dsp56k_io_reset(dsp56k_core* cpustate)
} // namespace DSP56K
-READ16_MEMBER( dsp56k_device::program_r )
-{
- return m_dsp56k_core.program_ram[offset];
-}
-
-WRITE16_MEMBER( dsp56k_device::program_w )
-{
- m_dsp56k_core.program_ram[offset] = data;
-}
-
/* Work */
READ16_MEMBER( dsp56k_device::peripheral_register_r )
{
diff --git a/src/emu/cpu/e132xs/e132xs.h b/src/emu/cpu/e132xs/e132xs.h
index f10c9983d50..c8f43641ff5 100644
--- a/src/emu/cpu/e132xs/e132xs.h
+++ b/src/emu/cpu/e132xs/e132xs.h
@@ -199,7 +199,7 @@ extern unsigned dasm_hyperstone(char *buffer, unsigned pc, const UINT8 *oprom, u
#define IO_WRITE_W(addr, data) m_io->write_dword(((addr) >> 11) & 0x7ffc, data)
-#define READ_OP(addr) m_direct->read_decrypted_word((addr), m_opcodexor)
+#define READ_OP(addr) m_direct->read_word((addr), m_opcodexor)
//**************************************************************************
// TYPE DEFINITIONS
diff --git a/src/emu/cpu/esrip/esrip.c b/src/emu/cpu/esrip/esrip.c
index 22570346fc8..fa7ab139b08 100644
--- a/src/emu/cpu/esrip/esrip.c
+++ b/src/emu/cpu/esrip/esrip.c
@@ -514,7 +514,7 @@ enum
ACC,
Y_BUS,
STATUS,
- RAM,
+ RAM
};
/*************************************
@@ -652,7 +652,7 @@ enum
SOI = 0x7,
SOZ = 0x8,
SOZE = 0x9,
- SOSE = 0xa,
+ SOSE = 0xa
};
enum
@@ -660,7 +660,7 @@ enum
NRY = 0,
NRA = 1,
NRS = 4,
- NRAS = 5,
+ NRAS = 5
};
void esrip_device::sonr(UINT16 inst)
@@ -842,7 +842,7 @@ void esrip_device::tor1(UINT16 inst)
TODRY = 0xb,
TORAR = 0xc,
TORIR = 0xe,
- TODRR = 0xf,
+ TODRR = 0xf
};
switch (SRC)
@@ -932,7 +932,7 @@ void esrip_device::tor2(UINT16 inst)
{
TODAR = 0x1,
TOAIR = 0x2,
- TODIR = 0x5,
+ TODIR = 0x5
};
switch (SRC)
@@ -1072,7 +1072,7 @@ void esrip_device::bonr(UINT16 inst)
A2NDY = 0x14,
S2NDY = 0x15,
LD2NY = 0x16,
- LDC2NY = 0x17,
+ LDC2NY = 0x17
};
UINT16 res = 0;
@@ -1189,7 +1189,7 @@ void esrip_device::bor1(UINT16 inst)
{
SETNR = 0xd,
RSTNR = 0xe,
- TSTNR = 0xf,
+ TSTNR = 0xf
};
UINT16 res = 0;
@@ -1234,7 +1234,7 @@ void esrip_device::bor2(UINT16 inst)
LD2NR = 0xc,
LDC2NR = 0xd,
A2NR = 0xe,
- S2NR = 0xf,
+ S2NR = 0xf
};
UINT32 res = 0;
@@ -1300,7 +1300,7 @@ void esrip_device::rotr1(UINT16 inst)
{
RTRA = 0xc,
RTRY = 0xd,
- RTRR = 0xf,
+ RTRR = 0xf
};
UINT16 u = 0;
@@ -1335,7 +1335,7 @@ void esrip_device::rotr2(UINT16 inst)
enum
{
RTAR = 0,
- RTDR = 1,
+ RTDR = 1
};
UINT16 u = 0;
@@ -1364,7 +1364,7 @@ void esrip_device::rotnr(UINT16 inst)
RTDY = 0x18,
RTDA = 0x19,
RTAY = 0x1c,
- RTAA = 0x1d,
+ RTAA = 0x1d
};
UINT16 u = 0;
@@ -1466,7 +1466,7 @@ enum
SHDN1 = 5,
SHDNL = 6,
SHDNC = 7,
- SHDNOV = 8,
+ SHDNOV = 8
};
#define SET_LINK_flag(x) (m_new_status &= ~L_FLAG); \
@@ -1522,7 +1522,7 @@ void esrip_device::shftr(UINT16 inst)
enum
{
SHRR = 6,
- SHDR = 7,
+ SHDR = 7
};
UINT16 u = 0;
@@ -1547,7 +1547,7 @@ void esrip_device::shftnr(UINT16 inst)
enum
{
SHA = 6,
- SHD = 7,
+ SHD = 7
};
UINT16 u = 0;
@@ -1591,7 +1591,7 @@ void esrip_device::rstst(UINT16 inst)
RL = 0x5,
RF1 = 0x6,
RF2 = 0x9,
- RF3 = 0xa,
+ RF3 = 0xa
};
switch (inst & 0x1f)
@@ -1614,7 +1614,7 @@ void esrip_device::setst(UINT16 inst)
SL = 0x5,
SF1 = 0x6,
SF2 = 0x9,
- SF3 = 0xa,
+ SF3 = 0xa
};
switch (inst & 0x1f)
@@ -1901,7 +1901,7 @@ void esrip_device::execute_run()
m_pl7 = m_l7;
/* Latch instruction */
- inst = m_direct->read_decrypted_qword(RIP_PC << 3);
+ inst = m_direct->read_qword(RIP_PC << 3);
in_h = inst >> 32;
in_l = inst & 0xffffffff;
diff --git a/src/emu/cpu/esrip/esrip.h b/src/emu/cpu/esrip/esrip.h
index f0f93d1a598..ecfba10975d 100644
--- a/src/emu/cpu/esrip/esrip.h
+++ b/src/emu/cpu/esrip/esrip.h
@@ -97,7 +97,7 @@ enum
ESRIP_ADRL,
ESRIP_ADRR,
ESRIP_COLR,
- ESRIP_IADDR,
+ ESRIP_IADDR
};
diff --git a/src/emu/cpu/f8/f8.c b/src/emu/cpu/f8/f8.c
index 0199c54b743..182638543d7 100644
--- a/src/emu/cpu/f8/f8.c
+++ b/src/emu/cpu/f8/f8.c
@@ -96,7 +96,7 @@ void f8_cpu_device::ROMC_00(int insttim) /* SKR - added parameter to tell if */
* of PC0.
*/
- m_dbus = m_direct->read_decrypted_byte(m_pc0);
+ m_dbus = m_direct->read_byte(m_pc0);
m_pc0 += 1;
m_icount -= insttim; /* SKR - ROMC00 is usually short, not short+long, */
/* but DS is long */
@@ -110,7 +110,7 @@ void f8_cpu_device::ROMC_01()
* location addressed by PC0; then all devices add the 8-bit value
* on the data bus as signed binary number to PC0.
*/
- m_dbus = m_direct->read_raw_byte(m_pc0);
+ m_dbus = m_direct->read_byte(m_pc0);
m_pc0 += (INT8)m_dbus;
m_icount -= cL;
}
@@ -134,7 +134,7 @@ void f8_cpu_device::ROMC_03(int insttim) /* SKR - added parameter to tell if */
* Similiar to 0x00, except that it is used for immediate operands
* fetches (using PC0) instead of instruction fetches.
*/
- m_dbus = m_io = m_direct->read_raw_byte(m_pc0);
+ m_dbus = m_io = m_direct->read_byte(m_pc0);
m_pc0 += 1;
m_icount -= insttim;
}
@@ -228,7 +228,7 @@ void f8_cpu_device::ROMC_0C()
* by PC0 into the data bus; then all devices move the value that
* has just been placed on the data bus into the low order byte of PC0.
*/
- m_dbus = m_direct->read_raw_byte(m_pc0);
+ m_dbus = m_direct->read_byte(m_pc0);
m_pc0 = (m_pc0 & 0xff00) | m_dbus;
m_icount -= cL;
}
@@ -251,7 +251,7 @@ void f8_cpu_device::ROMC_0E()
* The value on the data bus is then moved to the low order byte
* of DC0 by all devices.
*/
- m_dbus = m_direct->read_raw_byte(m_pc0);
+ m_dbus = m_direct->read_byte(m_pc0);
m_dc0 = (m_dc0 & 0xff00) | m_dbus;
m_icount -= cL;
}
@@ -289,7 +289,7 @@ void f8_cpu_device::ROMC_11()
* data bus. All devices must then move the contents of the
* data bus to the upper byte of DC0.
*/
- m_dbus = m_direct->read_raw_byte(m_pc0);
+ m_dbus = m_direct->read_byte(m_pc0);
m_dc0 = (m_dc0 & 0x00ff) | (m_dbus << 8);
m_icount -= cL;
}
diff --git a/src/emu/cpu/h6280/h6280.c b/src/emu/cpu/h6280/h6280.c
index 0740ba7e8ad..f92e0520a12 100644
--- a/src/emu/cpu/h6280/h6280.c
+++ b/src/emu/cpu/h6280/h6280.c
@@ -2388,7 +2388,7 @@ void h6280_device::pull(UINT8 &value)
***************************************************************/
UINT8 h6280_device::read_opcode()
{
- return m_direct->read_decrypted_byte(translated(PCW));
+ return m_direct->read_byte(translated(PCW));
}
/***************************************************************
@@ -2396,7 +2396,7 @@ UINT8 h6280_device::read_opcode()
***************************************************************/
UINT8 h6280_device::read_opcode_arg()
{
- return m_direct->read_raw_byte(translated(PCW));
+ return m_direct->read_byte(translated(PCW));
}
diff --git a/src/emu/cpu/h6280/h6280.h b/src/emu/cpu/h6280/h6280.h
index 070052ed935..dccf221abf7 100644
--- a/src/emu/cpu/h6280/h6280.h
+++ b/src/emu/cpu/h6280/h6280.h
@@ -179,7 +179,7 @@ protected:
void prefix##_f8(); void prefix##_f9(); void prefix##_fa(); void prefix##_fb(); \
void prefix##_fc(); void prefix##_fd(); void prefix##_fe(); void prefix##_ff();
- PROTOTYPES(op);
+ PROTOTYPES(op)
UINT32 translated(UINT16 addr);
void h6280_cycles(int cyc);
diff --git a/src/emu/cpu/h8/h8.c b/src/emu/cpu/h8/h8.c
index fb6b9875fd0..9084c0b76fa 100644
--- a/src/emu/cpu/h8/h8.c
+++ b/src/emu/cpu/h8/h8.c
@@ -511,7 +511,7 @@ offs_t h8_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom
UINT16 h8_device::read16i(UINT32 adr)
{
icount--;
- return direct->read_decrypted_word(adr & ~1);
+ return direct->read_word(adr & ~1);
}
UINT16 h8_device::fetch()
diff --git a/src/emu/cpu/h8/h8.h b/src/emu/cpu/h8/h8.h
index 231901ae2a6..b1880c23b4d 100644
--- a/src/emu/cpu/h8/h8.h
+++ b/src/emu/cpu/h8/h8.h
@@ -43,7 +43,7 @@ public:
ADC_4,
ADC_5,
ADC_6,
- ADC_7,
+ ADC_7
};
h8_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source, bool mode_a16, address_map_delegate map_delegate);
@@ -65,7 +65,7 @@ protected:
enum {
STATE_RESET = 0x10000,
STATE_IRQ = 0x10001,
- STATE_TRACE = 0x10002,
+ STATE_TRACE = 0x10002
};
enum {
@@ -80,7 +80,7 @@ protected:
EXR_T = 0x80,
EXR_NC = 0x78,
- EXR_I = 0x07,
+ EXR_I = 0x07
};
enum {
@@ -138,7 +138,7 @@ protected:
DASM_ccr, /* internal register ccr */
DASM_exr, /* internal register exr */
DASM_macl, /* internal register macl */
- DASM_mach, /* internal register mach */
+ DASM_mach /* internal register mach */
};
// device-level overrides
@@ -469,7 +469,7 @@ enum {
H8_E6,
H8_E7,
H8_CCR,
- H8_EXR,
+ H8_EXR
};
#endif
diff --git a/src/emu/cpu/h8/h8_sci.h b/src/emu/cpu/h8/h8_sci.h
index 0bde697bc4a..7e93f14dc14 100644
--- a/src/emu/cpu/h8/h8_sci.h
+++ b/src/emu/cpu/h8/h8_sci.h
@@ -59,7 +59,7 @@ public:
protected:
enum {
- ST_IDLE, ST_START, ST_BIT, ST_PARITY, ST_STOP, ST_LAST_TICK,
+ ST_IDLE, ST_START, ST_BIT, ST_PARITY, ST_STOP, ST_LAST_TICK
};
static const char *const state_names[];
diff --git a/src/emu/cpu/h8/h8_timer16.h b/src/emu/cpu/h8/h8_timer16.h
index 165bc0559dc..e187999625e 100644
--- a/src/emu/cpu/h8/h8_timer16.h
+++ b/src/emu/cpu/h8/h8_timer16.h
@@ -54,7 +54,7 @@ public:
DIV_512,
DIV_1024,
DIV_2048,
- DIV_4096,
+ DIV_4096
};
enum {
@@ -69,7 +69,7 @@ public:
IRQ_D = 0x08,
IRQ_V = 0x10,
IRQ_U = 0x20,
- IRQ_TRIG = 0x40,
+ IRQ_TRIG = 0x40
};
diff --git a/src/emu/cpu/hcd62121/hcd62121.h b/src/emu/cpu/hcd62121/hcd62121.h
index 0f91cbd3890..feaa1bf6533 100644
--- a/src/emu/cpu/hcd62121/hcd62121.h
+++ b/src/emu/cpu/hcd62121/hcd62121.h
@@ -16,7 +16,7 @@ enum
HCD62121_R40, HCD62121_R44, HCD62121_R48, HCD62121_R4C,
HCD62121_R50, HCD62121_R54, HCD62121_R58, HCD62121_R5C,
HCD62121_R60, HCD62121_R64, HCD62121_R68, HCD62121_R6C,
- HCD62121_R70, HCD62121_R74, HCD62121_R78, HCD62121_R7C,
+ HCD62121_R70, HCD62121_R74, HCD62121_R78, HCD62121_R7C
};
diff --git a/src/emu/cpu/hd61700/hd61700.h b/src/emu/cpu/hd61700/hd61700.h
index 1b928e57922..d903b8ecff7 100644
--- a/src/emu/cpu/hd61700/hd61700.h
+++ b/src/emu/cpu/hd61700/hd61700.h
@@ -46,7 +46,7 @@ enum
{
HD61700_PC=1, HD61700_F, HD61700_SX, HD61700_SY, HD61700_SZ, HD61700_PE, HD61700_PD,
HD61700_IB, HD61700_UA, HD61700_IA, HD61700_IE, HD61700_TM, HD61700_IX,
- HD61700_IY, HD61700_IZ, HD61700_US, HD61700_SS, HD61700_KY, HD61700_MAINREG,
+ HD61700_IY, HD61700_IZ, HD61700_US, HD61700_SS, HD61700_KY, HD61700_MAINREG
};
// input lines
diff --git a/src/emu/cpu/hd61700/hd61700d.c b/src/emu/cpu/hd61700/hd61700d.c
index 6f1e29cd90f..719fade4f49 100644
--- a/src/emu/cpu/hd61700/hd61700d.c
+++ b/src/emu/cpu/hd61700/hd61700d.c
@@ -38,7 +38,7 @@ enum
OP_REG8_,
OP_REGIM8,
OP_RMSIM3,
- OP_RSIR,
+ OP_RSIR
};
struct hd61700_dasm
diff --git a/src/emu/cpu/hmcs40/hmcs40.c b/src/emu/cpu/hmcs40/hmcs40.c
index 1adef6ea242..d76385cf2ba 100644
--- a/src/emu/cpu/hmcs40/hmcs40.c
+++ b/src/emu/cpu/hmcs40/hmcs40.c
@@ -11,23 +11,12 @@
*/
-enum
-{
- FAMILY_HMCS42 = 0,
- FAMILY_HMCS43,
- FAMILY_HMCS44,
- FAMILY_HMCS45,
- FAMILY_HMCS46,
- FAMILY_HMCS47,
-};
-
#define IS_PMOS 0
#define IS_CMOS ~0
#include "hmcs40.h"
#include "debugger.h"
-#include "hmcs40op.inc"
// MCU types
@@ -90,7 +79,7 @@ ADDRESS_MAP_END
// device definitions
hmcs43_cpu_device::hmcs43_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT16 polarity, const char *shortname)
- : hmcs40_cpu_device(mconfig, type, name, tag, owner, clock, FAMILY_HMCS43, polarity, 3, 10, 11, ADDRESS_MAP_NAME(program_1k), 7, ADDRESS_MAP_NAME(data_80x4), shortname, __FILE__)
+ : hmcs40_cpu_device(mconfig, type, name, tag, owner, clock, HMCS40_FAMILY_HMCS43, polarity, 3 /* stack levels */, 10 /* pc width */, 11 /* prg width */, ADDRESS_MAP_NAME(program_1k), 7 /* data width */, ADDRESS_MAP_NAME(data_80x4), shortname, __FILE__)
{ }
hd38750_device::hd38750_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
@@ -108,7 +97,7 @@ hd44758_device::hd44758_device(const machine_config &mconfig, const char *tag, d
hmcs44_cpu_device::hmcs44_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT16 polarity, const char *shortname)
- : hmcs40_cpu_device(mconfig, type, name, tag, owner, clock, FAMILY_HMCS44, polarity, 4, 11, 12, ADDRESS_MAP_NAME(program_2k), 8, ADDRESS_MAP_NAME(data_160x4), shortname, __FILE__)
+ : hmcs40_cpu_device(mconfig, type, name, tag, owner, clock, HMCS40_FAMILY_HMCS44, polarity, 4, 11, 12, ADDRESS_MAP_NAME(program_2k), 8, ADDRESS_MAP_NAME(data_160x4), shortname, __FILE__)
{ }
hd38800_device::hd38800_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
@@ -126,7 +115,7 @@ hd44808_device::hd44808_device(const machine_config &mconfig, const char *tag, d
hmcs45_cpu_device::hmcs45_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT16 polarity, const char *shortname)
- : hmcs40_cpu_device(mconfig, type, name, tag, owner, clock, FAMILY_HMCS45, polarity, 4, 11, 12, ADDRESS_MAP_NAME(program_2k), 8, ADDRESS_MAP_NAME(data_160x4), shortname, __FILE__)
+ : hmcs40_cpu_device(mconfig, type, name, tag, owner, clock, HMCS40_FAMILY_HMCS45, polarity, 4, 11, 12, ADDRESS_MAP_NAME(program_2k), 8, ADDRESS_MAP_NAME(data_160x4), shortname, __FILE__)
{ }
hd38820_device::hd38820_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
@@ -188,6 +177,7 @@ void hmcs40_cpu_device::device_start()
m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(hmcs40_cpu_device::simple_timer_cb), this));
reset_prescaler();
+ // resolve callbacks
m_read_r0.resolve_safe(0);
m_read_r1.resolve_safe(0);
m_read_r2.resolve_safe(0);
@@ -215,6 +205,7 @@ void hmcs40_cpu_device::device_start()
m_prev_op = 0;
m_i = 0;
m_eint_line = 0;
+ m_halt = 0;
m_pc = 0;
m_prev_pc = 0;
m_page = 0;
@@ -242,6 +233,8 @@ void hmcs40_cpu_device::device_start()
save_item(NAME(m_prev_op));
save_item(NAME(m_i));
save_item(NAME(m_eint_line));
+ save_item(NAME(m_halt));
+ save_item(NAME(m_timer_halted_remain));
save_item(NAME(m_pc));
save_item(NAME(m_prev_pc));
save_item(NAME(m_page));
@@ -477,9 +470,25 @@ void hmcs40_cpu_device::do_interrupt()
void hmcs40_cpu_device::execute_set_input(int line, int state)
{
+ state = (state) ? 1 : 0;
+
+ // halt/unhalt mcu
+ if (line == HMCS40_INPUT_LINE_HLT && state != m_halt)
+ {
+ if (state)
+ {
+ m_timer_halted_remain = m_timer->remaining();
+ m_timer->reset();
+ }
+ else
+ m_timer->adjust(m_timer_halted_remain);
+
+ m_halt = state;
+ return;
+ }
+
if (line != 0 && line != 1)
return;
- state = (state) ? 1 : 0;
// external interrupt request on rising edge
if (state && !m_int[line])
@@ -551,6 +560,13 @@ inline void hmcs40_cpu_device::increment_pc()
void hmcs40_cpu_device::execute_run()
{
+ // in HLT state, the internal clock is not running
+ if (m_halt)
+ {
+ m_icount = 0;
+ return;
+ }
+
while (m_icount > 0)
{
// LPU is handled 1 cycle later
diff --git a/src/emu/cpu/hmcs40/hmcs40.h b/src/emu/cpu/hmcs40/hmcs40.h
index 9e722f595a6..c7862ec76b5 100644
--- a/src/emu/cpu/hmcs40/hmcs40.h
+++ b/src/emu/cpu/hmcs40/hmcs40.h
@@ -26,7 +26,6 @@
#define MCFG_HMCS40_WRITE_D_CB(_devcb) \
hmcs40_cpu_device::set_write_d_callback(*device, DEVCB_##_devcb);
-
enum
{
HMCS40_PORT_R0X = 0,
@@ -39,6 +38,23 @@ enum
HMCS40_PORT_R7X
};
+enum
+{
+ HMCS40_INPUT_LINE_INT0 = 0,
+ HMCS40_INPUT_LINE_INT1,
+ HMCS40_INPUT_LINE_HLT
+};
+
+enum
+{
+ HMCS40_FAMILY_HMCS42 = 0,
+ HMCS40_FAMILY_HMCS43,
+ HMCS40_FAMILY_HMCS44,
+ HMCS40_FAMILY_HMCS45,
+ HMCS40_FAMILY_HMCS46,
+ HMCS40_FAMILY_HMCS47
+};
+
// pinout reference
@@ -181,6 +197,8 @@ protected:
UINT8 m_i; // 4-bit immediate opcode param
int m_eint_line; // which input_line caused an interrupt
emu_timer *m_timer;
+ int m_halt; // internal HLT state
+ attotime m_timer_halted_remain;
int m_icount;
UINT16 m_pc; // Program Counter
diff --git a/src/emu/cpu/hmcs40/hmcs40d.c b/src/emu/cpu/hmcs40/hmcs40d.c
index 4ab55866d5d..b63ba1fde4d 100644
--- a/src/emu/cpu/hmcs40/hmcs40d.c
+++ b/src/emu/cpu/hmcs40/hmcs40d.c
@@ -82,10 +82,10 @@ static const UINT32 s_flags[] =
};
// next program counter in sequence (relative)
-static const INT16 s_next_pc[0x40] =
+static const INT8 s_next_pc[0x40] =
{
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
- 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 32+0x40,
+ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 32+0x40 /* rollback */,
-32, -31, -30, -29, -28, -27, -26, -25, -24, -23, -22, -21, -20, -19, -18, -17,
-15, -14, -13, -12, -11, -10, -9, -8, -7, -6, -5, -4, -3, -2, -1, -1
};
diff --git a/src/emu/cpu/hmcs40/hmcs40op.inc b/src/emu/cpu/hmcs40/hmcs40op.c
index 6e905c71796..f6faab90360 100644
--- a/src/emu/cpu/hmcs40/hmcs40op.inc
+++ b/src/emu/cpu/hmcs40/hmcs40op.c
@@ -3,6 +3,9 @@
// HMCS40 opcode handlers
+#include "hmcs40.h"
+
+
// internal helpers
inline UINT8 hmcs40_cpu_device::ram_r()
@@ -82,7 +85,7 @@ void hmcs40_cpu_device::op_xamr()
// HMCS42: MR0 on file 0, MR4-MR15 on file 4 (there is no file 1-3)
// HMCS43: MR0-MR3 on file 0-3, MR4-MR15 on file 4
- if (m_family == FAMILY_HMCS42 || m_family == FAMILY_HMCS43)
+ if (m_family == HMCS40_FAMILY_HMCS42 || m_family == HMCS40_FAMILY_HMCS43)
address |= (address < 4) ? (address << 4) : 0x40;
// HMCS44/45/46/47: all on last file
diff --git a/src/emu/cpu/hphybrid/hphybrid.c b/src/emu/cpu/hphybrid/hphybrid.c
new file mode 100644
index 00000000000..03a36549b60
--- /dev/null
+++ b/src/emu/cpu/hphybrid/hphybrid.c
@@ -0,0 +1,961 @@
+// license:BSD-3-Clause
+// copyright-holders:F. Ulivi
+
+#include "emu.h"
+#include "debugger.h"
+#include "hphybrid.h"
+
+enum {
+ HPHYBRID_A,
+ HPHYBRID_B,
+ HPHYBRID_C,
+ HPHYBRID_D,
+ HPHYBRID_P,
+ HPHYBRID_R,
+ HPHYBRID_IV,
+ HPHYBRID_PA,
+ HPHYBRID_DMAPA,
+ HPHYBRID_DMAMA,
+ HPHYBRID_DMAC,
+ HPHYBRID_I
+};
+
+#define BIT_MASK(n) (1U << (n))
+
+// Macros to clear/set single bits
+#define BIT_CLR(w , n) ((w) &= ~BIT_MASK(n))
+#define BIT_SET(w , n) ((w) |= BIT_MASK(n))
+
+// Bits in m_flags
+#define HPHYBRID_C_BIT 0 // Carry/extend
+#define HPHYBRID_O_BIT 1 // Overflow
+#define HPHYBRID_CB_BIT 2 // Cb
+#define HPHYBRID_DB_BIT 3 // Db
+#define HPHYBRID_INTEN_BIT 4 // Interrupt enable
+#define HPHYBRID_DMAEN_BIT 5 // DMA enable
+#define HPHYBRID_DMADIR_BIT 6 // DMA direction (1 = OUT)
+#define HPHYBRID_HALT_BIT 7 // Halt flag
+#define HPHYBRID_IRH_BIT 8 // IRH requested
+#define HPHYBRID_IRL_BIT 9 // IRL requested
+#define HPHYBRID_IRH_SVC_BIT 10 // IRH in service
+#define HPHYBRID_IRL_SVC_BIT 11 // IRL in service
+#define HPHYBRID_DMAR_BIT 12 // DMA request
+
+#define HPHYBRID_IV_MASK 0xfff0 // IV mask
+
+#define CURRENT_PA (m_reg_PA[ 0 ])
+
+#define HP_RESET_ADDR 0x0020
+
+const device_type HP_5061_3011 = &device_creator<hp_5061_3011_cpu_device>;
+
+WRITE_LINE_MEMBER(hp_hybrid_cpu_device::dmar_w)
+{
+ if (state) {
+ BIT_SET(m_flags , HPHYBRID_DMAR_BIT);
+ } else {
+ BIT_CLR(m_flags , HPHYBRID_DMAR_BIT);
+ }
+}
+
+hp_hybrid_cpu_device::hp_hybrid_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname)
+: cpu_device(mconfig, type, name, tag, owner, clock, shortname, __FILE__),
+ m_program_config("program", ENDIANNESS_BIG, 16, 16, -1),
+ m_io_config("io", ENDIANNESS_BIG, 16, 6, -1)
+{
+}
+
+void hp_hybrid_cpu_device::device_start()
+{
+ m_reg_A = 0;
+ m_reg_B = 0;
+ m_reg_P = HP_RESET_ADDR;
+ m_reg_R = 0;
+ m_reg_C = 0;
+ m_reg_D = 0;
+ m_reg_IV = 0;
+ m_reg_PA[ 0 ] = 0;
+ m_reg_PA[ 1 ] = 0;
+ m_reg_PA[ 2 ] = 0;
+ m_flags = 0;
+ m_dmapa = 0;
+ m_dmama = 0;
+ m_dmac = 0;
+ m_reg_I = 0;
+
+ {
+ state_add(HPHYBRID_A, "A", m_reg_A);
+ state_add(HPHYBRID_B, "B", m_reg_B);
+ state_add(HPHYBRID_C, "C", m_reg_C);
+ state_add(HPHYBRID_D, "D", m_reg_D);
+ state_add(HPHYBRID_P, "P", m_reg_P);
+ state_add(STATE_GENPC, "GENPC", m_reg_P).noshow();
+ state_add(HPHYBRID_R, "R", m_reg_R);
+ state_add(STATE_GENSP, "GENSP", m_reg_R).noshow();
+ state_add(HPHYBRID_IV, "IV", m_reg_IV);
+ state_add(HPHYBRID_PA, "PA", m_reg_PA[ 0 ]);
+ state_add(STATE_GENFLAGS, "GENFLAGS", m_flags).noshow().formatstr("%9s");
+ state_add(HPHYBRID_DMAPA , "DMAPA" , m_dmapa).noshow();
+ state_add(HPHYBRID_DMAMA , "DMAMA" , m_dmama).noshow();
+ state_add(HPHYBRID_DMAC , "DMAC" , m_dmac).noshow();
+ state_add(HPHYBRID_I , "I" , m_reg_I).noshow();
+ }
+
+ m_program = &space(AS_PROGRAM);
+ m_direct = &m_program->direct();
+ m_io = &space(AS_IO);
+
+ save_item(NAME(m_reg_A));
+ save_item(NAME(m_reg_B));
+ save_item(NAME(m_reg_C));
+ save_item(NAME(m_reg_D));
+ save_item(NAME(m_reg_P));
+ save_item(NAME(m_reg_R));
+ save_item(NAME(m_reg_IV));
+ save_item(NAME(m_reg_PA[0]));
+ save_item(NAME(m_reg_PA[1]));
+ save_item(NAME(m_reg_PA[2]));
+ save_item(NAME(m_flags));
+ save_item(NAME(m_dmapa));
+ save_item(NAME(m_dmama));
+ save_item(NAME(m_dmac));
+ save_item(NAME(m_reg_I));
+
+ m_icountptr = &m_icount;
+}
+
+void hp_hybrid_cpu_device::device_reset()
+{
+ m_reg_P = HP_RESET_ADDR;
+ m_reg_I = RM(m_reg_P);
+ m_flags = 0;
+}
+
+void hp_hybrid_cpu_device::execute_run()
+{
+ do {
+ if (BIT(m_flags , HPHYBRID_DMAEN_BIT) && BIT(m_flags , HPHYBRID_DMAR_BIT)) {
+ handle_dma();
+ } else {
+ debugger_instruction_hook(this, m_reg_P);
+
+ // Check for interrupts
+ check_for_interrupts();
+
+ m_reg_I = execute_one(m_reg_I);
+ }
+ } while (m_icount > 0);
+}
+
+void hp_hybrid_cpu_device::execute_set_input(int inputnum, int state)
+{
+ if (inputnum < HPHYBRID_INT_LVLS) {
+ if (state) {
+ BIT_SET(m_flags , HPHYBRID_IRH_BIT + inputnum);
+ } else {
+ BIT_CLR(m_flags , HPHYBRID_IRH_BIT + inputnum);
+ }
+ }
+}
+
+/**
+ * Execute 1 instruction
+ *
+ * @param opcode Opcode to be executed
+ *
+ * @return Next opcode to be executed
+ */
+UINT16 hp_hybrid_cpu_device::execute_one(UINT16 opcode)
+{
+ if ((opcode & 0x7fe0) == 0x7000) {
+ // EXE
+ m_icount -= 8;
+ return RM(opcode & 0x1f);
+ } else {
+ m_reg_P = execute_one_sub(opcode);
+ return RM(m_reg_P);
+ }
+}
+
+/**
+ * Execute 1 instruction (except EXE)
+ *
+ * @param opcode Opcode to be executed (no EXE instructions)
+ *
+ * @return new value of P register
+ */
+UINT16 hp_hybrid_cpu_device::execute_one_sub(UINT16 opcode)
+{
+ UINT16 ea;
+ UINT16 tmp;
+
+ switch (opcode & 0x7800) {
+ case 0x0000:
+ // LDA
+ m_icount -= 13;
+ m_reg_A = RM(get_ea(opcode));
+ break;
+
+ case 0x0800:
+ // LDB
+ m_icount -= 13;
+ m_reg_B = RM(get_ea(opcode));
+ break;
+
+ case 0x1000:
+ // CPA
+ m_icount -= 16;
+ if (m_reg_A != RM(get_ea(opcode))) {
+ // Skip next instruction
+ return m_reg_P + 2;
+ }
+ break;
+
+ case 0x1800:
+ // CPB
+ m_icount -= 16;
+ if (m_reg_B != RM(get_ea(opcode))) {
+ // Skip next instruction
+ return m_reg_P + 2;
+ }
+ break;
+
+ case 0x2000:
+ // ADA
+ m_icount -= 13;
+ do_add(m_reg_A , RM(get_ea(opcode)));
+ break;
+
+ case 0x2800:
+ // ADB
+ m_icount -= 13;
+ do_add(m_reg_B , RM(get_ea(opcode)));
+ break;
+
+ case 0x3000:
+ // STA
+ m_icount -= 13;
+ WM(get_ea(opcode) , m_reg_A);
+ break;
+
+ case 0x3800:
+ // STB
+ m_icount -= 13;
+ WM(get_ea(opcode) , m_reg_B);
+ break;
+
+ case 0x4000:
+ // JSM
+ m_icount -= 17;
+ WM(++m_reg_R , m_reg_P);
+ return get_ea(opcode);
+
+ case 0x4800:
+ // ISZ
+ m_icount -= 19;
+ ea = get_ea(opcode);
+ tmp = RM(ea) + 1;
+ WM(ea , tmp);
+ if (tmp == 0) {
+ // Skip next instruction
+ return m_reg_P + 2;
+ }
+ break;
+
+ case 0x5000:
+ // AND
+ m_icount -= 13;
+ m_reg_A &= RM(get_ea(opcode));
+ break;
+
+ case 0x5800:
+ // DSZ
+ m_icount -= 19;
+ ea = get_ea(opcode);
+ tmp = RM(ea) - 1;
+ WM(ea , tmp);
+ if (tmp == 0) {
+ // Skip next instruction
+ return m_reg_P + 2;
+ }
+ break;
+
+ case 0x6000:
+ // IOR
+ m_icount -= 13;
+ m_reg_A |= RM(get_ea(opcode));
+ break;
+
+ case 0x6800:
+ // JMP
+ m_icount -= 8;
+ return get_ea(opcode);
+
+ default:
+ switch (opcode & 0xfec0) {
+ case 0x7400:
+ // RZA
+ // SZA
+ m_icount -= 14;
+ return get_skip_addr(opcode , m_reg_A == 0);
+
+ case 0x7440:
+ // RIA
+ // SIA
+ m_icount -= 14;
+ return get_skip_addr(opcode , m_reg_A++ == 0);
+
+ case 0x7480:
+ // SFS
+ // SFC
+ m_icount -= 14;
+ // TODO: read flag bit
+ return get_skip_addr(opcode , true);
+
+ case 0x7C00:
+ // RZB
+ // SZB
+ m_icount -= 14;
+ return get_skip_addr(opcode , m_reg_B == 0);
+
+ case 0x7C40:
+ // RIB
+ // SIB
+ m_icount -= 14;
+ return get_skip_addr(opcode , m_reg_B++ == 0);
+
+ case 0x7c80:
+ // SSS
+ // SSC
+ m_icount -= 14;
+ // TODO: read status bit
+ return get_skip_addr(opcode , true);
+
+ case 0x7cc0:
+ // SHS
+ // SHC
+ m_icount -= 14;
+ return get_skip_addr(opcode , !BIT(m_flags , HPHYBRID_HALT_BIT));
+
+ default:
+ switch (opcode & 0xfe00) {
+ case 0x7600:
+ // SLA
+ // RLA
+ m_icount -= 14;
+ return get_skip_addr_sc(opcode , m_reg_A , 0);
+
+ case 0x7e00:
+ // SLB
+ // RLB
+ m_icount -= 14;
+ return get_skip_addr_sc(opcode , m_reg_B , 0);
+
+ case 0xf400:
+ // SAP
+ // SAM
+ m_icount -= 14;
+ return get_skip_addr_sc(opcode , m_reg_A , 15);
+
+ case 0xf600:
+ // SOC
+ // SOS
+ m_icount -= 14;
+ return get_skip_addr_sc(opcode , m_flags , HPHYBRID_O_BIT);
+
+ case 0xfc00:
+ // SBP
+ // SBM
+ m_icount -= 14;
+ return get_skip_addr_sc(opcode , m_reg_B , 15);
+
+ case 0xfe00:
+ // SEC
+ // SES
+ m_icount -= 14;
+ return get_skip_addr_sc(opcode , m_flags , HPHYBRID_C_BIT);
+
+ default:
+ switch (opcode & 0xfff0) {
+ case 0xf100:
+ // AAR
+ tmp = (opcode & 0xf) + 1;
+ m_icount -= (9 + tmp);
+ // A shift by 16 positions is equivalent to a shift by 15
+ tmp = tmp > 15 ? 15 : tmp;
+ m_reg_A = ((m_reg_A ^ 0x8000) >> tmp) - (0x8000 >> tmp);
+ break;
+
+ case 0xf900:
+ // ABR
+ tmp = (opcode & 0xf) + 1;
+ m_icount -= (9 + tmp);
+ tmp = tmp > 15 ? 15 : tmp;
+ m_reg_B = ((m_reg_B ^ 0x8000) >> tmp) - (0x8000 >> tmp);
+ break;
+
+ case 0xf140:
+ // SAR
+ tmp = (opcode & 0xf) + 1;
+ m_icount -= (9 + tmp);
+ m_reg_A >>= tmp;
+ break;
+
+ case 0xf940:
+ // SBR
+ tmp = (opcode & 0xf) + 1;
+ m_icount -= (9 + tmp);
+ m_reg_B >>= tmp;
+ break;
+
+ case 0xf180:
+ // SAL
+ tmp = (opcode & 0xf) + 1;
+ m_icount -= (9 + tmp);
+ m_reg_A <<= tmp;
+ break;
+
+ case 0xf980:
+ // SBL
+ tmp = (opcode & 0xf) + 1;
+ m_icount -= (9 + tmp);
+ m_reg_B <<= tmp;
+ break;
+
+ case 0xf1c0:
+ // RAR
+ tmp = (opcode & 0xf) + 1;
+ m_icount -= (9 + tmp);
+ m_reg_A = (m_reg_A >> tmp) | (m_reg_A << (16 - tmp));
+ break;
+
+ case 0xf9c0:
+ // RBR
+ tmp = (opcode & 0xf) + 1;
+ m_icount -= (9 + tmp);
+ m_reg_B = (m_reg_B >> tmp) | (m_reg_B << (16 - tmp));
+ break;
+
+ default:
+ if ((opcode & 0xf760) == 0x7160) {
+ // Place/withdraw instructions
+ m_icount -= 23;
+ do_pw(opcode);
+ } else if ((opcode & 0xff80) == 0xf080) {
+ // RET
+ m_icount -= 16;
+ if (BIT(opcode , 6)) {
+ // Pop PA stack
+ if (BIT(m_flags , HPHYBRID_IRH_SVC_BIT)) {
+ BIT_CLR(m_flags , HPHYBRID_IRH_SVC_BIT);
+ memmove(&m_reg_PA[ 0 ] , &m_reg_PA[ 1 ] , HPHYBRID_INT_LVLS);
+ } else if (BIT(m_flags , HPHYBRID_IRL_SVC_BIT)) {
+ BIT_CLR(m_flags , HPHYBRID_IRL_SVC_BIT);
+ memmove(&m_reg_PA[ 0 ] , &m_reg_PA[ 1 ] , HPHYBRID_INT_LVLS);
+ }
+ }
+ tmp = RM(m_reg_R--) + (opcode & 0x1f);
+ return BIT(opcode , 5) ? tmp - 0x20 : tmp;
+ } else {
+ switch (opcode) {
+ case 0x7100:
+ // SDO
+ m_icount -= 12;
+ BIT_SET(m_flags , HPHYBRID_DMADIR_BIT);
+ break;
+
+ case 0x7108:
+ // SDI
+ m_icount -= 12;
+ BIT_CLR(m_flags , HPHYBRID_DMADIR_BIT);
+ break;
+
+ case 0x7110:
+ // EIR
+ m_icount -= 12;
+ BIT_SET(m_flags , HPHYBRID_INTEN_BIT);
+ break;
+
+ case 0x7118:
+ // DIR
+ m_icount -= 12;
+ BIT_CLR(m_flags , HPHYBRID_INTEN_BIT);
+ break;
+
+ case 0x7120:
+ // DMA
+ m_icount -= 12;
+ BIT_SET(m_flags , HPHYBRID_DMAEN_BIT);
+ break;
+
+ case 0x7138:
+ // DDR
+ m_icount -= 12;
+ BIT_CLR(m_flags , HPHYBRID_DMAEN_BIT);
+ break;
+
+ case 0x7140:
+ // DBL
+ m_icount -= 12;
+ BIT_CLR(m_flags , HPHYBRID_DB_BIT);
+ break;
+
+ case 0x7148:
+ // CBL
+ m_icount -= 12;
+ BIT_CLR(m_flags , HPHYBRID_CB_BIT);
+ break;
+
+ case 0x7150:
+ // DBU
+ m_icount -= 12;
+ BIT_SET(m_flags , HPHYBRID_DB_BIT);
+ break;
+
+ case 0x7158:
+ // CBU
+ m_icount -= 12;
+ BIT_SET(m_flags , HPHYBRID_CB_BIT);
+ break;
+
+ case 0xf020:
+ // TCA
+ m_icount -= 9;
+ m_reg_A = ~m_reg_A;
+ do_add(m_reg_A , 1);
+ break;
+
+ case 0xf060:
+ // CMA
+ m_icount -= 9;
+ m_reg_A = ~m_reg_A;
+ break;
+
+ case 0xf820:
+ // TCB
+ m_icount -= 9;
+ m_reg_B = ~m_reg_B;
+ do_add(m_reg_B , 1);
+ break;
+
+ case 0xf860:
+ // CMB
+ m_icount -= 9;
+ m_reg_B = ~m_reg_B;
+ break;
+
+ default:
+ // Unrecognized instructions: NOP
+ // Execution time is fictional
+ m_icount -= 6;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return m_reg_P + 1;
+}
+
+void hp_hybrid_cpu_device::state_string_export(const device_state_entry &entry, std::string &str)
+{
+ if (entry.index() == STATE_GENFLAGS) {
+ strprintf(str, "%s %s %c %c",
+ BIT(m_flags , HPHYBRID_DB_BIT) ? "Db":"..",
+ BIT(m_flags , HPHYBRID_CB_BIT) ? "Cb":"..",
+ BIT(m_flags , HPHYBRID_O_BIT) ? 'O':'.',
+ BIT(m_flags , HPHYBRID_C_BIT) ? 'E':'.');
+ }
+}
+
+offs_t hp_hybrid_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options)
+{
+ extern CPU_DISASSEMBLE(hp_hybrid);
+ return CPU_DISASSEMBLE_NAME(hp_hybrid)(this, buffer, pc, oprom, opram, options);
+}
+
+UINT16 hp_hybrid_cpu_device::get_ea(UINT16 opcode)
+{
+ UINT16 base;
+ UINT16 off;
+
+ if (BIT(opcode , 10)) {
+ // Current page
+ base = m_reg_P;
+ } else {
+ // Base page
+ base = 0;
+ }
+
+ off = opcode & 0x3ff;
+ if (off & 0x200) {
+ off -= 0x400;
+ }
+
+ base += off;
+
+ if (BIT(opcode , 15)) {
+ // Indirect addressing
+ m_icount -= 6;
+ return RM(base);
+ } else {
+ // Direct addressing
+ return base;
+ }
+}
+
+void hp_hybrid_cpu_device::do_add(UINT16& addend1 , UINT16 addend2)
+{
+ UINT32 tmp = addend1 + addend2;
+
+ if (BIT(tmp , 16)) {
+ // Carry
+ BIT_SET(m_flags , HPHYBRID_C_BIT);
+ }
+
+ if (BIT((tmp ^ addend1) & (tmp ^ addend2) , 15)) {
+ // Overflow
+ BIT_SET(m_flags , HPHYBRID_O_BIT);
+ }
+
+ addend1 = (UINT16)tmp;
+}
+
+UINT16 hp_hybrid_cpu_device::get_skip_addr(UINT16 opcode , bool condition) const
+{
+ bool skip_val = BIT(opcode , 8) != 0;
+
+ if (condition == skip_val) {
+ UINT16 off = opcode & 0x1f;
+
+ if (BIT(opcode , 5)) {
+ off -= 0x20;
+ }
+ return m_reg_P + off;
+ } else {
+ return m_reg_P + 1;
+ }
+}
+
+UINT16 hp_hybrid_cpu_device::get_skip_addr_sc(UINT16 opcode , UINT16& v , unsigned n)
+{
+ bool val = BIT(v , n);
+
+ if (BIT(opcode , 7)) {
+ if (BIT(opcode , 6)) {
+ BIT_SET(v , n);
+ } else {
+ BIT_CLR(v , n);
+ }
+ }
+
+ return get_skip_addr(opcode , val);
+}
+
+void hp_hybrid_cpu_device::do_pw(UINT16 opcode)
+{
+ UINT16 tmp;
+ UINT16 reg_addr = opcode & 7;
+ UINT16 *ptr_reg;
+ UINT16 b_mask;
+
+ if (BIT(opcode , 3)) {
+ ptr_reg = &m_reg_D;
+ b_mask = BIT_MASK(HPHYBRID_DB_BIT);
+ } else {
+ ptr_reg = &m_reg_C;
+ b_mask = BIT_MASK(HPHYBRID_CB_BIT);
+ }
+
+ if (BIT(opcode , 4)) {
+ // Withdraw
+ if (BIT(opcode , 11)) {
+ // Byte
+ UINT32 tmp_addr = (UINT32)(*ptr_reg);
+ if (m_flags & b_mask) {
+ tmp_addr |= 0x10000;
+ }
+ tmp = RM((UINT16)(tmp_addr >> 1));
+ if (BIT(tmp_addr , 0)) {
+ tmp &= 0xff;
+ } else {
+ tmp >>= 8;
+ }
+ } else {
+ // Word
+ tmp = RM(*ptr_reg);
+ }
+ WM(reg_addr , tmp);
+
+ if (BIT(opcode , 7)) {
+ // Post-decrement
+ if ((*ptr_reg)-- == 0) {
+ m_flags ^= b_mask;
+ }
+ } else {
+ // Post-increment
+ if (++(*ptr_reg) == 0) {
+ m_flags ^= b_mask;
+ }
+ }
+ } else {
+ // Place
+ if (BIT(opcode , 7)) {
+ // Pre-decrement
+ if ((*ptr_reg)-- == 0) {
+ m_flags ^= b_mask;
+ }
+ } else {
+ // Pre-increment
+ if (++(*ptr_reg) == 0) {
+ m_flags ^= b_mask;
+ }
+ }
+ tmp = RM(reg_addr);
+ if (BIT(opcode , 11)) {
+ // Byte
+ UINT32 tmp_addr = (UINT32)(*ptr_reg);
+ if (m_flags & b_mask) {
+ tmp_addr |= 0x10000;
+ }
+ WMB(tmp_addr , (UINT8)tmp);
+ } else {
+ // Word
+ WM(*ptr_reg , tmp);
+ }
+ }
+}
+
+void hp_hybrid_cpu_device::check_for_interrupts(void)
+{
+ if (!BIT(m_flags , HPHYBRID_INTEN_BIT) || BIT(m_flags , HPHYBRID_IRH_SVC_BIT)) {
+ return;
+ }
+
+ int irqline;
+
+ if (BIT(m_flags , HPHYBRID_IRH_BIT)) {
+ // Service high-level interrupt
+ BIT_SET(m_flags , HPHYBRID_IRH_SVC_BIT);
+ irqline = HPHYBRID_IRH;
+ } else if (BIT(m_flags , HPHYBRID_IRL_BIT) && !BIT(m_flags , HPHYBRID_IRL_SVC_BIT)) {
+ // Service low-level interrupt
+ BIT_SET(m_flags , HPHYBRID_IRL_SVC_BIT);
+ irqline = HPHYBRID_IRL;
+ } else {
+ return;
+ }
+
+ // Get interrupt vector in low byte
+ UINT8 vector = (UINT8)standard_irq_callback(irqline);
+ UINT8 new_PA;
+
+ // Get highest numbered 1
+ // Don't know what happens if vector is 0, here we assume bit 7 = 1
+ if (vector == 0) {
+ new_PA = 7;
+ } else {
+ for (new_PA = 7; new_PA && !BIT(vector , 7); new_PA--, vector <<= 1) {
+ }
+ }
+ if (irqline == HPHYBRID_IRH) {
+ BIT_SET(new_PA , 3);
+ }
+
+ // Push PA stack
+ memmove(&m_reg_PA[ 1 ] , &m_reg_PA[ 0 ] , HPHYBRID_INT_LVLS);
+
+ CURRENT_PA = new_PA;
+
+ // Is this correct? Patent @ pg 210 suggests that the whole interrupt recognition sequence
+ // lasts for 32 cycles (6 are already accounted for in get_ea for one indirection)
+ m_icount -= 26;
+
+ // Do a double-indirect JSM IV,I instruction
+ WM(++m_reg_R , m_reg_P);
+ m_reg_P = RM(get_ea(0xc008));
+ m_reg_I = RM(m_reg_P);
+}
+
+void hp_hybrid_cpu_device::handle_dma(void)
+{
+ // Patent hints at the fact that terminal count is detected by bit 15 of dmac being 1 after decrementing
+ bool tc = BIT(--m_dmac , 15) != 0;
+ UINT16 tmp;
+
+ if (BIT(m_flags , HPHYBRID_DMADIR_BIT)) {
+ // "Outward" DMA: memory -> peripheral
+ tmp = RM(m_dmama++);
+ WIO(m_dmapa , tc ? 2 : 0 , tmp);
+ m_icount -= 10;
+ } else {
+ // "Inward" DMA: peripheral -> memory
+ tmp = RIO(m_dmapa , tc ? 2 : 0);
+ WM(m_dmama++ , tmp);
+ m_icount -= 9;
+ }
+
+ // This is the one of the biggest question marks: is the DMA automatically disabled on TC?
+ // Here we assume it is. After all it would make no difference because there is no way
+ // to read the DMA enable flag back, so each time the DMA is needed it has to be enabled again.
+ if (tc) {
+ BIT_CLR(m_flags , HPHYBRID_DMAEN_BIT);
+ }
+}
+
+UINT16 hp_hybrid_cpu_device::RM(UINT16 addr)
+{
+ UINT16 tmp;
+
+ if (addr <= HP_REG_LAST_ADDR) {
+ // Memory mapped registers
+ switch (addr) {
+ case HP_REG_A_ADDR:
+ return m_reg_A;
+
+ case HP_REG_B_ADDR:
+ return m_reg_B;
+
+ case HP_REG_P_ADDR:
+ return m_reg_P;
+
+ case HP_REG_R_ADDR:
+ return m_reg_R;
+
+ case HP_REG_R4_ADDR:
+ case HP_REG_R5_ADDR:
+ case HP_REG_R6_ADDR:
+ case HP_REG_R7_ADDR:
+ return RIO(CURRENT_PA , addr - HP_REG_R4_ADDR);
+
+ case HP_REG_IV_ADDR:
+ // Correct?
+ if (!BIT(m_flags , HPHYBRID_IRH_SVC_BIT) && !BIT(m_flags , HPHYBRID_IRL_SVC_BIT)) {
+ return m_reg_IV;
+ } else {
+ return m_reg_IV | CURRENT_PA;
+ }
+
+ case HP_REG_PA_ADDR:
+ return CURRENT_PA;
+
+ case HP_REG_DMAPA_ADDR:
+ tmp = m_dmapa & HP_REG_PA_MASK;
+ if (BIT(m_flags , HPHYBRID_CB_BIT)) {
+ BIT_SET(tmp , 15);
+ }
+ if (BIT(m_flags , HPHYBRID_DB_BIT)) {
+ BIT_SET(tmp , 14);
+ }
+ return tmp;
+
+ case HP_REG_DMAMA_ADDR:
+ return m_dmama;
+
+ case HP_REG_DMAC_ADDR:
+ return m_dmac;
+
+ case HP_REG_C_ADDR:
+ return m_reg_C;
+
+ case HP_REG_D_ADDR:
+ return m_reg_D;
+
+ default:
+ // Unknown registers are returned as 0
+ return 0;
+ }
+ } else {
+ return m_direct->read_word((offs_t)addr << 1);
+ }
+}
+
+void hp_hybrid_cpu_device::WM(UINT16 addr , UINT16 v)
+{
+ if (addr <= HP_REG_LAST_ADDR) {
+ // Memory mapped registers
+ switch (addr) {
+ case HP_REG_A_ADDR:
+ m_reg_A = v;
+ break;
+
+ case HP_REG_B_ADDR:
+ m_reg_B = v;
+ break;
+
+ case HP_REG_P_ADDR:
+ m_reg_P = v;
+ break;
+
+ case HP_REG_R_ADDR:
+ m_reg_R = v;
+ break;
+
+ case HP_REG_R4_ADDR:
+ case HP_REG_R5_ADDR:
+ case HP_REG_R6_ADDR:
+ case HP_REG_R7_ADDR:
+ WIO(CURRENT_PA , addr - HP_REG_R4_ADDR , v);
+ break;
+
+ case HP_REG_IV_ADDR:
+ m_reg_IV = v & HP_REG_IV_MASK;
+ break;
+
+ case HP_REG_PA_ADDR:
+ CURRENT_PA = v & HP_REG_PA_MASK;
+ break;
+
+ case HP_REG_DMAPA_ADDR:
+ m_dmapa = v & HP_REG_PA_MASK;
+ break;
+
+ case HP_REG_DMAMA_ADDR:
+ m_dmama = v;
+ break;
+
+ case HP_REG_DMAC_ADDR:
+ m_dmac = v;
+ break;
+
+ case HP_REG_C_ADDR:
+ m_reg_C = v;
+ break;
+
+ case HP_REG_D_ADDR:
+ m_reg_D = v;
+ break;
+
+ default:
+ // Unknown registers are silently discarded
+ break;
+ }
+ } else {
+ m_program->write_word((offs_t)addr << 1 , v);
+ }
+}
+
+void hp_hybrid_cpu_device::WMB(UINT32 addr , UINT8 v)
+{
+ if (addr <= (HP_REG_LAST_ADDR * 2 + 1)) {
+ // Cannot write bytes to registers
+ } else {
+ m_program->write_byte(addr , v);
+ }
+}
+
+UINT16 hp_hybrid_cpu_device::RIO(UINT8 pa , UINT8 ic)
+{
+ return m_io->read_word(HP_MAKE_IOADDR(pa, ic) << 1);
+}
+
+void hp_hybrid_cpu_device::WIO(UINT8 pa , UINT8 ic , UINT16 v)
+{
+ m_io->write_word(HP_MAKE_IOADDR(pa, ic) << 1 , v);
+}
+
+hp_5061_3011_cpu_device::hp_5061_3011_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+: hp_hybrid_cpu_device(mconfig, HP_5061_3011, "HP_5061_3011", tag, owner, clock, "5061-3011")
+{
+}
diff --git a/src/emu/cpu/hphybrid/hphybrid.h b/src/emu/cpu/hphybrid/hphybrid.h
new file mode 100644
index 00000000000..5ef9f927d0e
--- /dev/null
+++ b/src/emu/cpu/hphybrid/hphybrid.h
@@ -0,0 +1,146 @@
+// license:BSD-3-Clause
+// copyright-holders:F. Ulivi
+//
+// *****************************************
+// Emulator for HP "hybrid" processor series
+// *****************************************
+//
+// The HP hybrid processor series is composed of a few different models with different
+// capabilities. The series was derived from HP's own 2116 processor by translating a
+// discrete implementation of the 1960s into a multi-chip module (hence the "hybrid" name).
+// This emulator currently supports the 5061-3011 version only.
+//
+// For this emulator I mainly relied on these sources:
+// - http://www.hp9845.net/ website
+// - HP manual "Assembly development ROM manual for the HP9845": this is the most precious
+// and "enabling" resource of all
+// - US Patent 4,180,854 describing the HP9845 system
+// - Study of disassembly of firmware of HP64000 system
+// - A lot of "educated" guessing
+
+#ifndef _HPHYBRID_H_
+#define _HPHYBRID_H_
+
+// Input lines
+#define HPHYBRID_IRH 0 // High-level interrupt
+#define HPHYBRID_IRL 1 // Low-level interrupt
+#define HPHYBRID_INT_LVLS 2 // Levels of interrupt
+
+#define HPHYBRID_DMAR 2 // DMA request
+#define HPHYBRID_HALT 3 // "Halt" input
+#define HPHYBRID_STS 4 // "Status" input
+#define HPHYBRID_FLG 5 // "Flag" input
+
+// I/O addressing space (16-bit wide)
+// Addresses into this space are composed as follows:
+// b[5..2] = Peripheral address 0..15
+// b[1..0] = Register address (IC) 0..3
+#define HP_IOADDR_PA_SHIFT 2
+#define HP_IOADDR_IC_SHIFT 0
+
+// Compose an I/O address from PA & IC
+#define HP_MAKE_IOADDR(pa , ic) (((pa) << HP_IOADDR_PA_SHIFT) | ((ic) << HP_IOADDR_IC_SHIFT))
+
+// Addresses of memory mapped registers
+#define HP_REG_A_ADDR 0x0000
+#define HP_REG_B_ADDR 0x0001
+#define HP_REG_P_ADDR 0x0002
+#define HP_REG_R_ADDR 0x0003
+#define HP_REG_R4_ADDR 0x0004
+#define HP_REG_R5_ADDR 0x0005
+#define HP_REG_R6_ADDR 0x0006
+#define HP_REG_R7_ADDR 0x0007
+#define HP_REG_IV_ADDR 0x0008
+#define HP_REG_PA_ADDR 0x0009
+#define HP_REG_DMAPA_ADDR 0x000B
+#define HP_REG_DMAMA_ADDR 0x000C
+#define HP_REG_DMAC_ADDR 0x000D
+#define HP_REG_C_ADDR 0x000e
+#define HP_REG_D_ADDR 0x000f
+#define HP_REG_LAST_ADDR 0x001f
+
+#define HP_REG_IV_MASK 0xfff0
+#define HP_REG_PA_MASK 0x000f
+
+class hp_hybrid_cpu_device : public cpu_device
+{
+public:
+ DECLARE_WRITE_LINE_MEMBER(dmar_w);
+
+protected:
+ hp_hybrid_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname);
+
+ // device-level overrides
+ virtual void device_start();
+ virtual void device_reset();
+
+ // device_execute_interface overrides
+ virtual UINT32 execute_min_cycles() const { return 6; }
+ virtual UINT32 execute_max_cycles() const { return 25; }
+ virtual UINT32 execute_input_lines() const { return 2; }
+ virtual UINT32 execute_default_irq_vector() const { return 0xffff; }
+ virtual void execute_run();
+ virtual void execute_set_input(int inputnum, int state);
+
+ UINT16 execute_one(UINT16 opcode);
+ UINT16 execute_one_sub(UINT16 opcode);
+
+ // device_memory_interface overrides
+ virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const { return (spacenum == AS_PROGRAM) ? &m_program_config : ( (spacenum == AS_IO) ? &m_io_config : NULL ); }
+
+ // device_state_interface overrides
+ void state_string_export(const device_state_entry &entry, std::string &str);
+
+ // device_disasm_interface overrides
+ virtual UINT32 disasm_min_opcode_bytes() const { return 2; }
+ virtual UINT32 disasm_max_opcode_bytes() const { return 2; }
+ virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options);
+
+private:
+ address_space_config m_program_config;
+ address_space_config m_io_config;
+
+ address_space *m_program;
+ direct_read_data *m_direct;
+ address_space *m_io;
+ int m_icount;
+
+ // State of processor
+ UINT16 m_reg_A; // Register A
+ UINT16 m_reg_B; // Register B
+ UINT16 m_reg_P; // Register P
+ UINT16 m_reg_R; // Register R
+ UINT16 m_reg_C; // Register C
+ UINT16 m_reg_D; // Register D
+ UINT16 m_reg_IV; // Register IV
+ UINT8 m_reg_PA[ HPHYBRID_INT_LVLS + 1 ]; // Stack of register PA (4 bit-long)
+ UINT16 m_flags; // Flags (carry, overflow, cb, db, int en, dma en, dma dir)
+ UINT8 m_dmapa; // DMA peripheral address (4 bits)
+ UINT16 m_dmama; // DMA address
+ UINT16 m_dmac; // DMA counter
+ UINT16 m_reg_I; // Instruction register
+
+ UINT16 get_ea(UINT16 opcode);
+ void do_add(UINT16& addend1 , UINT16 addend2);
+ UINT16 get_skip_addr(UINT16 opcode , bool condition) const;
+ UINT16 get_skip_addr_sc(UINT16 opcode , UINT16& v , unsigned n);
+ void do_pw(UINT16 opcode);
+ void check_for_interrupts(void);
+ void handle_dma(void);
+
+ UINT16 RM(UINT16 addr);
+ void WM(UINT16 addr , UINT16 v);
+ void WMB(UINT32 addr , UINT8 v);
+ UINT16 RIO(UINT8 pa , UINT8 ic);
+ void WIO(UINT8 pa , UINT8 ic , UINT16 v);
+};
+
+class hp_5061_3011_cpu_device : public hp_hybrid_cpu_device
+{
+public:
+ hp_5061_3011_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+extern const device_type HP_5061_3011;
+
+#endif /* _HPHYBRID_H_ */
diff --git a/src/emu/cpu/hphybrid/hphybrid_dasm.c b/src/emu/cpu/hphybrid/hphybrid_dasm.c
new file mode 100644
index 00000000000..e9eddf49a96
--- /dev/null
+++ b/src/emu/cpu/hphybrid/hphybrid_dasm.c
@@ -0,0 +1,281 @@
+// license:BSD-3-Clause
+// copyright-holders:F. Ulivi
+// ********************************************************************************
+// * HP "hybrid" processor disassembler
+// ********************************************************************************
+
+#include "emu.h"
+#include "debugger.h"
+#include "hphybrid.h"
+
+typedef void (*fn_dis_param)(char *buffer , offs_t pc , UINT16 opcode);
+
+typedef struct {
+ UINT16 m_op_mask;
+ UINT16 m_opcode;
+ const char *m_mnemonic;
+ fn_dis_param m_param_fn;
+ UINT32 m_dasm_flags;
+} dis_entry_t;
+
+static void addr_2_str(char *buffer , UINT16 addr , bool indirect)
+{
+ char *s = buffer + strlen(buffer);
+
+ s += sprintf(s , "$%04x" , addr);
+
+ switch (addr) {
+ case HP_REG_A_ADDR:
+ strcpy(s , "(A)");
+ break;
+
+ case HP_REG_B_ADDR:
+ strcpy(s , "(B)");
+ break;
+
+ case HP_REG_P_ADDR:
+ strcpy(s , "(P)");
+ break;
+
+ case HP_REG_R_ADDR:
+ strcpy(s , "(R)");
+ break;
+
+ case HP_REG_R4_ADDR:
+ strcpy(s , "(R4)");
+ break;
+
+ case HP_REG_R5_ADDR:
+ strcpy(s , "(R5)");
+ break;
+
+ case HP_REG_R6_ADDR:
+ strcpy(s , "(R6)");
+ break;
+
+ case HP_REG_R7_ADDR:
+ strcpy(s , "(R7)");
+ break;
+
+ case HP_REG_IV_ADDR:
+ strcpy(s , "(IV)");
+ break;
+
+ case HP_REG_PA_ADDR:
+ strcpy(s , "(PA)");
+ break;
+
+ case HP_REG_DMAPA_ADDR:
+ strcpy(s , "(DMAPA)");
+ break;
+
+ case HP_REG_DMAMA_ADDR:
+ strcpy(s , "(DMAMA)");
+ break;
+
+ case HP_REG_DMAC_ADDR:
+ strcpy(s , "(DMAC)");
+ break;
+
+ case HP_REG_C_ADDR:
+ strcpy(s , "(C)");
+ break;
+
+ case HP_REG_D_ADDR:
+ strcpy(s , "(D)");
+ break;
+ }
+
+ if (indirect) {
+ strcat(s , ",I");
+ }
+}
+
+static void param_none(char *buffer , offs_t pc , UINT16 opcode)
+{
+}
+
+static void param_loc(char *buffer , offs_t pc , UINT16 opcode)
+{
+ UINT16 base;
+ UINT16 off;
+
+ if (opcode & 0x0400) {
+ // Current page
+ base = pc;
+ } else {
+ // Base page
+ base = 0;
+ }
+
+ off = opcode & 0x3ff;
+ if (off & 0x200) {
+ off -= 0x400;
+ }
+
+ addr_2_str(buffer , base + off , (opcode & 0x8000) != 0);
+}
+
+static void param_addr32(char *buffer , offs_t pc , UINT16 opcode)
+{
+ addr_2_str(buffer , opcode & 0x1f , (opcode & 0x8000) != 0);
+}
+
+static void param_skip(char *buffer , offs_t pc , UINT16 opcode)
+{
+ UINT16 off = opcode & 0x3f;
+ if (off & 0x20) {
+ off -= 0x40;
+ }
+ addr_2_str(buffer , pc + off , false);
+}
+
+static void param_skip_sc(char *buffer , offs_t pc , UINT16 opcode)
+{
+ param_skip(buffer, pc, opcode);
+
+ if (opcode & 0x80) {
+ if (opcode & 0x40) {
+ strcat(buffer , ",S");
+ } else {
+ strcat(buffer , ",C");
+ }
+ }
+}
+
+static void param_ret(char *buffer , offs_t pc , UINT16 opcode)
+{
+ char *s = buffer + strlen(buffer);
+
+ int off = opcode & 0x3f;
+
+ if (off & 0x20) {
+ off -= 0x40;
+ }
+
+ s += sprintf(s , "%d" , off);
+ if (opcode & 0x40) {
+ strcpy(s , ",P");
+ }
+}
+
+static void param_n16(char *buffer , offs_t pc , UINT16 opcode)
+{
+ char *s = buffer + strlen(buffer);
+
+ sprintf(s , "%u" , (opcode & 0xf) + 1);
+}
+
+static void param_reg_id(char *buffer , offs_t pc , UINT16 opcode)
+{
+ addr_2_str(buffer, opcode & 7, false);
+
+ if (opcode & 0x80) {
+ strcat(buffer , ",D");
+ } else {
+ strcat(buffer , ",I");
+ }
+}
+
+static const dis_entry_t dis_table[] = {
+ // *** BPC Instructions ***
+ {0xffff , 0x0000 , "NOP" , param_none , 0 },
+ {0x7800 , 0x0000 , "LDA" , param_loc , 0 },
+ {0x7800 , 0x0800 , "LDB" , param_loc , 0 },
+ {0x7800 , 0x1000 , "CPA" , param_loc , 0 },
+ {0x7800 , 0x1800 , "CPB" , param_loc , 0 },
+ {0x7800 , 0x2000 , "ADA" , param_loc , 0 },
+ {0x7800 , 0x2800 , "ADB" , param_loc , 0 },
+ {0x7800 , 0x3000 , "STA" , param_loc , 0 },
+ {0x7800 , 0x3800 , "STB" , param_loc , 0 },
+ {0x7800 , 0x4000 , "JSM" , param_loc , DASMFLAG_STEP_OVER },
+ {0x7800 , 0x4800 , "ISZ" , param_loc , 0 },
+ {0x7800 , 0x5000 , "AND" , param_loc , 0 },
+ {0x7800 , 0x5800 , "DSZ" , param_loc , 0 },
+ {0x7800 , 0x6000 , "IOR" , param_loc , 0 },
+ {0x7800 , 0x6800 , "JMP" , param_loc , 0 },
+ {0x7fe0 , 0x7000 , "EXE" , param_addr32 , 0 },
+ {0xffc0 , 0x7400 , "RZA" , param_skip , 0 },
+ {0xffc0 , 0x7C00 , "RZB" , param_skip , 0 },
+ {0xffc0 , 0x7440 , "RIA" , param_skip , 0 },
+ {0xffc0 , 0x7C40 , "RIB" , param_skip , 0 },
+ {0xffc0 , 0x7500 , "SZA" , param_skip , 0 },
+ {0xffc0 , 0x7D00 , "SZB" , param_skip , 0 },
+ {0xffc0 , 0x7540 , "SIA" , param_skip , 0 },
+ {0xffc0 , 0x7D40 , "SIB" , param_skip , 0 },
+ {0xffc0 , 0x7480 , "SFS" , param_skip , 0 },
+ {0xffc0 , 0x7580 , "SFC" , param_skip , 0 },
+ {0xffc0 , 0x7c80 , "SSS" , param_skip , 0 },
+ {0xffc0 , 0x7d80 , "SSC" , param_skip , 0 },
+ {0xffc0 , 0x7cc0 , "SHS" , param_skip , 0 },
+ {0xffc0 , 0x7dc0 , "SHC" , param_skip , 0 },
+ {0xff00 , 0x7600 , "SLA" , param_skip_sc , 0 },
+ {0xff00 , 0x7e00 , "SLB" , param_skip_sc , 0 },
+ {0xff00 , 0x7700 , "RLA" , param_skip_sc , 0 },
+ {0xff00 , 0x7f00 , "RLB" , param_skip_sc , 0 },
+ {0xff00 , 0xf400 , "SAP" , param_skip_sc , 0 },
+ {0xff00 , 0xfc00 , "SBP" , param_skip_sc , 0 },
+ {0xff00 , 0xf500 , "SAM" , param_skip_sc , 0 },
+ {0xff00 , 0xfd00 , "SBM" , param_skip_sc , 0 },
+ {0xff00 , 0xf600 , "SOC" , param_skip_sc , 0 },
+ {0xff00 , 0xf700 , "SOS" , param_skip_sc , 0 },
+ {0xff00 , 0xfe00 , "SEC" , param_skip_sc , 0 },
+ {0xff00 , 0xff00 , "SES" , param_skip_sc , 0 },
+ {0xffff , 0xf020 , "TCA" , param_none , 0 },
+ {0xffff , 0xf820 , "TCB" , param_none , 0 },
+ {0xffff , 0xf060 , "CMA" , param_none , 0 },
+ {0xffff , 0xf860 , "CMB" , param_none , 0 },
+ {0xff80 , 0xf080 , "RET" , param_ret , DASMFLAG_STEP_OUT },
+ {0xfff0 , 0xf100 , "AAR" , param_n16 , 0 },
+ {0xfff0 , 0xf900 , "ABR" , param_n16 , 0 },
+ {0xffff , 0xf14f , "CLA" , param_none , 0 },
+ {0xfff0 , 0xf140 , "SAR" , param_n16 , 0 },
+ {0xffff , 0xf94f , "CLB" , param_none , 0 },
+ {0xfff0 , 0xf940 , "SBR" , param_n16 , 0 },
+ {0xfff0 , 0xf180 , "SAL" , param_n16 , 0 },
+ {0xfff0 , 0xf980 , "SBL" , param_n16 , 0 },
+ {0xfff0 , 0xf1c0 , "RAR" , param_n16 , 0 },
+ {0xfff0 , 0xf9c0 , "RBR" , param_n16 , 0 },
+ // *** IOC Instructions ***
+ {0xffff , 0x7100 , "SDO" , param_none , 0 },
+ {0xffff , 0x7108 , "SDI" , param_none , 0 },
+ {0xffff , 0x7110 , "EIR" , param_none , 0 },
+ {0xffff , 0x7118 , "DIR" , param_none , 0 },
+ {0xffff , 0x7120 , "DMA" , param_none , 0 },
+ {0xffff , 0x7128 , "PCM" , param_none , 0 },
+ {0xffff , 0x7138 , "DDR" , param_none , 0 },
+ {0xffff , 0x7140 , "DBL" , param_none , 0 },
+ {0xffff , 0x7148 , "CBL" , param_none , 0 },
+ {0xffff , 0x7150 , "DBU" , param_none , 0 },
+ {0xffff , 0x7158 , "CBU" , param_none , 0 },
+ {0xff78 , 0x7160 , "PWC" , param_reg_id , 0 },
+ {0xff78 , 0x7168 , "PWD" , param_reg_id , 0 },
+ {0xff78 , 0x7960 , "PBC" , param_reg_id , 0 },
+ {0xff78 , 0x7968 , "PBD" , param_reg_id , 0 },
+ {0xff78 , 0x7170 , "WWC" , param_reg_id , 0 },
+ {0xff78 , 0x7178 , "WWD" , param_reg_id , 0 },
+ {0xff78 , 0x7970 , "WBC" , param_reg_id , 0 },
+ {0xff78 , 0x7978 , "WBD" , param_reg_id , 0 },
+ // *** END ***
+ {0 , 0 , NULL , NULL , 0 }
+};
+
+CPU_DISASSEMBLE(hp_hybrid)
+{
+ UINT16 opcode = ((UINT16)oprom[ 0 ] << 8) | oprom[ 1 ];
+ const dis_entry_t *p;
+
+ for (p = dis_table; p->m_op_mask; p++) {
+ if ((opcode & p->m_op_mask) == p->m_opcode) {
+ strcpy(buffer , p->m_mnemonic);
+ strcat(buffer , " ");
+ p->m_param_fn(buffer , pc , opcode);
+ return 1 | p->m_dasm_flags | DASMFLAG_SUPPORTED;
+ }
+ }
+
+ // Unknown opcode
+ strcpy(buffer , "???");
+
+ return 1 | DASMFLAG_SUPPORTED;
+}
diff --git a/src/emu/cpu/i386/i386dasm.c b/src/emu/cpu/i386/i386dasm.c
index 66ef63ed62f..18e5557b4b5 100644
--- a/src/emu/cpu/i386/i386dasm.c
+++ b/src/emu/cpu/i386/i386dasm.c
@@ -70,7 +70,7 @@ enum
PARAM_XMM0,
PARAM_XMM64, /* 64-bit memory or XMM register */
PARAM_XMM32, /* 32-bit memory or XMM register */
- PARAM_XMM16, /* 16-bit memory or XMM register */
+ PARAM_XMM16 /* 16-bit memory or XMM register */
};
enum
diff --git a/src/emu/cpu/i386/i386priv.h b/src/emu/cpu/i386/i386priv.h
index c7bb5d6ffb5..c1f6ecea94c 100644
--- a/src/emu/cpu/i386/i386priv.h
+++ b/src/emu/cpu/i386/i386priv.h
@@ -209,7 +209,7 @@ enum smram
SMRAM_EIP = 0x1F0,
SMRAM_EFLAGS = 0x1F4,
SMRAM_CR3 = 0x1F8,
- SMRAM_CR0 = 0x1FC,
+ SMRAM_CR0 = 0x1FC
};
enum smram_intel_p5
@@ -245,7 +245,7 @@ enum smram_intel_p5
SMRAM_IP5_IDTACC = 0x198,
SMRAM_IP5_TRLIM = 0x19C,
SMRAM_IP5_TRBASE = 0x1A0,
- SMRAM_IP5_TRACC = 0x1A4,
+ SMRAM_IP5_TRACC = 0x1A4
};
/* Protected mode exceptions */
@@ -543,7 +543,7 @@ UINT8 i386_device::FETCH()
if(!translate_address(m_CPL,TRANSLATE_FETCH,&address,&error))
PF_THROW(error);
- value = m_direct->read_decrypted_byte(address & m_a20_mask);
+ value = m_direct->read_byte(address & m_a20_mask);
#ifdef DEBUG_MISSING_OPCODE
m_opcode_bytes[m_opcode_bytes_length] = value;
m_opcode_bytes_length = (m_opcode_bytes_length + 1) & 15;
@@ -564,7 +564,7 @@ UINT16 i386_device::FETCH16()
if(!translate_address(m_CPL,TRANSLATE_FETCH,&address,&error))
PF_THROW(error);
address &= m_a20_mask;
- value = m_direct->read_decrypted_word(address);
+ value = m_direct->read_word(address);
m_eip += 2;
m_pc += 2;
}
@@ -585,7 +585,7 @@ UINT32 i386_device::FETCH32()
PF_THROW(error);
address &= m_a20_mask;
- value = m_direct->read_decrypted_dword(address);
+ value = m_direct->read_dword(address);
m_eip += 4;
m_pc += 4;
}
diff --git a/src/emu/cpu/i4004/i4004.c b/src/emu/cpu/i4004/i4004.c
index 23b1721df3a..c6e65cb27ee 100644
--- a/src/emu/cpu/i4004/i4004.c
+++ b/src/emu/cpu/i4004/i4004.c
@@ -36,7 +36,7 @@ i4004_cpu_device::i4004_cpu_device(const machine_config &mconfig, const char *ta
UINT8 i4004_cpu_device::ROP()
{
- UINT8 retVal = m_direct->read_decrypted_byte(GET_PC.w.l);
+ UINT8 retVal = m_direct->read_byte(GET_PC.w.l);
GET_PC.w.l = (GET_PC.w.l + 1) & 0x0fff;
m_PC = GET_PC;
return retVal;
@@ -44,7 +44,7 @@ UINT8 i4004_cpu_device::ROP()
UINT8 i4004_cpu_device::READ_ROM()
{
- return m_direct->read_decrypted_byte((GET_PC.w.l & 0x0f00) | m_R[0]);
+ return m_direct->read_byte((GET_PC.w.l & 0x0f00) | m_R[0]);
}
void i4004_cpu_device::WPM()
@@ -56,7 +56,7 @@ void i4004_cpu_device::WPM()
UINT8 i4004_cpu_device::ARG()
{
- UINT8 retVal = m_direct->read_raw_byte(GET_PC.w.l);
+ UINT8 retVal = m_direct->read_byte(GET_PC.w.l);
GET_PC.w.l = (GET_PC.w.l + 1) & 0x0fff;
m_PC = GET_PC;
return retVal;
diff --git a/src/emu/cpu/i8008/i8008.c b/src/emu/cpu/i8008/i8008.c
index 2bb5b9cf4b7..9527185339a 100644
--- a/src/emu/cpu/i8008/i8008.c
+++ b/src/emu/cpu/i8008/i8008.c
@@ -42,7 +42,7 @@ i8008_device::i8008_device(const machine_config &mconfig, const char *tag, devic
{
// set our instruction counter
m_icountptr = &m_icount;
-};
+}
//-------------------------------------------------
// device_start - start up the device
@@ -620,7 +620,7 @@ inline void i8008_device::pop_stack()
inline UINT8 i8008_device::rop()
{
- UINT8 retVal = m_direct->read_decrypted_byte(GET_PC.w.l);
+ UINT8 retVal = m_direct->read_byte(GET_PC.w.l);
GET_PC.w.l = (GET_PC.w.l + 1) & 0x3fff;
m_PC = GET_PC;
return retVal;
@@ -658,7 +658,7 @@ inline void i8008_device::set_reg(UINT8 reg, UINT8 val)
inline UINT8 i8008_device::arg()
{
- UINT8 retVal = m_direct->read_raw_byte(GET_PC.w.l);
+ UINT8 retVal = m_direct->read_byte(GET_PC.w.l);
GET_PC.w.l = (GET_PC.w.l + 1) & 0x3fff;
m_PC = GET_PC;
return retVal;
diff --git a/src/emu/cpu/i8085/i8085.c b/src/emu/cpu/i8085/i8085.c
index 904c4d3771d..3e278f64d6c 100644
--- a/src/emu/cpu/i8085/i8085.c
+++ b/src/emu/cpu/i8085/i8085.c
@@ -293,20 +293,20 @@ void i8085a_cpu_device::break_halt_for_interrupt()
UINT8 i8085a_cpu_device::ROP()
{
set_status(0xa2); // instruction fetch
- return m_direct->read_decrypted_byte(m_PC.w.l++);
+ return m_direct->read_byte(m_PC.w.l++);
}
UINT8 i8085a_cpu_device::ARG()
{
- return m_direct->read_raw_byte(m_PC.w.l++);
+ return m_direct->read_byte(m_PC.w.l++);
}
UINT16 i8085a_cpu_device::ARG16()
{
UINT16 w;
- w = m_direct->read_raw_byte(m_PC.d);
+ w = m_direct->read_byte(m_PC.d);
m_PC.w.l++;
- w += m_direct->read_raw_byte(m_PC.d) << 8;
+ w += m_direct->read_byte(m_PC.d) << 8;
m_PC.w.l++;
return w;
}
diff --git a/src/emu/cpu/i8089/i8089.c b/src/emu/cpu/i8089/i8089.c
index 23b25d891a0..b81869bda1d 100644
--- a/src/emu/cpu/i8089/i8089.c
+++ b/src/emu/cpu/i8089/i8089.c
@@ -33,7 +33,7 @@ const device_type I8089 = &device_creator<i8089_device>;
//-------------------------------------------------
i8089_device::i8089_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
- cpu_device(mconfig, I8089, "Intel 8089", tag, owner, clock, "i8089", __FILE__),
+ cpu_device(mconfig, I8089, "I8089", tag, owner, clock, "i8089", __FILE__),
m_icount(0),
m_ch1(*this, "1"),
m_ch2(*this, "2"),
diff --git a/src/emu/cpu/i8089/i8089_channel.c b/src/emu/cpu/i8089/i8089_channel.c
index 171a7ce0d24..fe7666ac17c 100644
--- a/src/emu/cpu/i8089/i8089_channel.c
+++ b/src/emu/cpu/i8089/i8089_channel.c
@@ -51,10 +51,13 @@ const device_type I8089_CHANNEL = &device_creator<i8089_channel>;
i8089_channel::i8089_channel(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
device_t(mconfig, I8089_CHANNEL, "Intel 8089 I/O Channel", tag, owner, clock, "i8089_channel", __FILE__),
m_write_sintr(*this),
+ m_iop(NULL),
m_icount(0),
m_xfer_pending(false),
m_dma_value(0),
- m_dma_state(DMA_IDLE)
+ m_dma_state(DMA_IDLE),
+ m_drq(0),
+ m_prio(PRIO_IDLE)
{
}
@@ -74,6 +77,7 @@ void i8089_channel::device_start()
save_item(NAME(m_xfer_pending));
save_item(NAME(m_dma_value));
save_item(NAME(m_dma_state));
+ save_item(NAME(m_drq));
save_item(NAME(m_prio));
for (int i = 0; i < ARRAY_LENGTH(m_r); i++)
@@ -246,11 +250,13 @@ int i8089_channel::execute_run()
break;
case DMA_WAIT_FOR_SOURCE_DRQ:
- fatalerror("%s('%s'): wait for source drq not supported\n", shortname(), tag());
+ if (m_drq)
+ m_dma_state = DMA_FETCH;
+ break;
case DMA_FETCH:
if (VERBOSE_DMA)
- logerror("%s('%s'): entering state: DMA_FETCH", shortname(), tag());
+ logerror("%s('%s'): entering state: DMA_FETCH\n", shortname(), tag());
// source is 16-bit?
if (BIT(m_r[PSW].w, 1))
@@ -306,7 +312,9 @@ int i8089_channel::execute_run()
fatalerror("%s('%s'): dma translate requested\n", shortname(), tag());
case DMA_WAIT_FOR_DEST_DRQ:
- fatalerror("%s('%s'): wait for destination drq not supported\n", shortname(), tag());
+ if (m_drq)
+ m_dma_state = DMA_STORE;
+ break;
case DMA_STORE:
if (VERBOSE_DMA)
@@ -834,5 +842,7 @@ WRITE_LINE_MEMBER( i8089_channel::ext_w )
WRITE_LINE_MEMBER( i8089_channel::drq_w )
{
if (VERBOSE)
- logerror("%s('%s'): ext_w: %d\n", shortname(), tag(), state);
+ logerror("%s('%s'): drq_w: %d\n", shortname(), tag(), state);
+
+ m_drq = state;
}
diff --git a/src/emu/cpu/i8089/i8089_channel.h b/src/emu/cpu/i8089/i8089_channel.h
index 9b4034603e5..7c1f5a6e445 100644
--- a/src/emu/cpu/i8089/i8089_channel.h
+++ b/src/emu/cpu/i8089/i8089_channel.h
@@ -186,6 +186,7 @@ private:
bool m_xfer_pending;
UINT16 m_dma_value;
int m_dma_state;
+ bool m_drq;
// dma state
enum
diff --git a/src/emu/cpu/i86/i186.c b/src/emu/cpu/i86/i186.c
index 9bc8c222fa5..072d70a95bb 100644
--- a/src/emu/cpu/i86/i186.c
+++ b/src/emu/cpu/i86/i186.c
@@ -155,14 +155,14 @@ i80186_cpu_device::i80186_cpu_device(const machine_config &mconfig, device_type
UINT8 i80186_cpu_device::fetch_op()
{
- UINT8 data = m_direct->read_decrypted_byte(pc(), m_fetch_xor);
+ UINT8 data = m_direct->read_byte(pc(), m_fetch_xor);
m_ip++;
return data;
}
UINT8 i80186_cpu_device::fetch()
{
- UINT8 data = m_direct->read_raw_byte(pc(), m_fetch_xor);
+ UINT8 data = m_direct->read_byte(pc(), m_fetch_xor);
m_ip++;
return data;
}
diff --git a/src/emu/cpu/i86/i286.c b/src/emu/cpu/i86/i286.c
index 0c45370255b..e6314b9cf83 100644
--- a/src/emu/cpu/i86/i286.c
+++ b/src/emu/cpu/i86/i286.c
@@ -965,7 +965,7 @@ UINT8 i80286_cpu_device::fetch_op()
if(m_ip > m_limit[CS])
throw TRAP(FAULT_GP, 0);
- data = m_direct->read_decrypted_byte( pc() & m_amask, m_fetch_xor );
+ data = m_direct->read_byte( pc() & m_amask, m_fetch_xor );
m_ip++;
return data;
}
@@ -976,7 +976,7 @@ UINT8 i80286_cpu_device::fetch()
if(m_ip > m_limit[CS])
throw TRAP(FAULT_GP, 0);
- data = m_direct->read_raw_byte( pc() & m_amask, m_fetch_xor );
+ data = m_direct->read_byte( pc() & m_amask, m_fetch_xor );
m_ip++;
return data;
}
diff --git a/src/emu/cpu/i86/i286.h b/src/emu/cpu/i86/i286.h
index e1088609996..64a0355bf6b 100644
--- a/src/emu/cpu/i86/i286.h
+++ b/src/emu/cpu/i86/i286.h
@@ -57,7 +57,7 @@ enum
I286_LDTR,
I286_LDTR_BASE,
I286_LDTR_LIMIT,
- I286_LDTR_FLAGS,
+ I286_LDTR_FLAGS
};
class i80286_cpu_device : public i8086_common_cpu_device
diff --git a/src/emu/cpu/i86/i86.c b/src/emu/cpu/i86/i86.c
index 7a308da61a9..9c8d5a75465 100644
--- a/src/emu/cpu/i86/i86.c
+++ b/src/emu/cpu/i86/i86.c
@@ -116,7 +116,7 @@ i8086_cpu_device::i8086_cpu_device(const machine_config &mconfig, device_type ty
UINT8 i8086_cpu_device::fetch_op()
{
UINT8 data;
- data = m_direct->read_decrypted_byte(pc(), m_fetch_xor);
+ data = m_direct->read_byte(pc(), m_fetch_xor);
m_ip++;
return data;
}
@@ -124,7 +124,7 @@ UINT8 i8086_cpu_device::fetch_op()
UINT8 i8086_cpu_device::fetch()
{
UINT8 data;
- data = m_direct->read_raw_byte(pc(), m_fetch_xor);
+ data = m_direct->read_byte(pc(), m_fetch_xor);
m_ip++;
return data;
}
@@ -282,6 +282,8 @@ i8086_common_cpu_device::i8086_common_cpu_device(const machine_config &mconfig,
, m_irq_state(0)
, m_test_state(1)
, m_pc(0)
+ , m_lock(false)
+ , m_lock_handler(*this)
{
static const BREGS reg_name[8]={ AL, CL, DL, BL, AH, CH, DH, BH };
@@ -391,6 +393,8 @@ void i8086_common_cpu_device::device_start()
state_add(STATE_GENFLAGS, "GENFLAGS", m_TF).callimport().callexport().formatstr("%16s").noshow();
m_icountptr = &m_icount;
+
+ m_lock_handler.resolve_safe();
}
@@ -438,6 +442,7 @@ void i8086_common_cpu_device::device_reset()
m_dst = 0;
m_src = 0;
m_halt = false;
+ m_lock = false;
}
@@ -1910,7 +1915,9 @@ bool i8086_common_cpu_device::common_op(UINT8 op)
break;
case 0xe4: // i_inal
+ if (m_lock) m_lock_handler(1);
m_regs.b[AL] = read_port_byte( fetch() );
+ if (m_lock) { m_lock_handler(0); m_lock = false; }
CLK(IN_IMM8);
break;
@@ -2011,6 +2018,7 @@ bool i8086_common_cpu_device::common_op(UINT8 op)
case 0xf0: // i_lock
logerror("%s: %06x: Warning - BUSLOCK\n", tag(), pc());
+ m_lock = true;
m_no_interrupt = 1;
CLK(NOP);
break;
diff --git a/src/emu/cpu/i86/i86.h b/src/emu/cpu/i86/i86.h
index ff1c56c2e92..6e48fecd71e 100644
--- a/src/emu/cpu/i86/i86.h
+++ b/src/emu/cpu/i86/i86.h
@@ -14,6 +14,10 @@ extern const device_type I8088;
#define INPUT_LINE_TEST 20
+#define MCFG_I8086_LOCK_HANDLER(_write) \
+ devcb = &i8086_common_cpu_device::set_lock_handler(*device, DEVCB_##_write);
+
+
enum
{
I8086_PC=0,
@@ -29,6 +33,9 @@ public:
// construction/destruction
i8086_common_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
+ template<class _Object> static devcb_base &set_lock_handler(device_t &device, _Object object)
+ { return downcast<i8086_common_cpu_device &>(device).m_lock_handler.set_callback(object); }
+
protected:
enum
{
@@ -325,6 +332,9 @@ protected:
UINT8 m_timing[200];
bool m_halt;
+
+ bool m_lock;
+ devcb_write_line m_lock_handler;
};
class i8086_cpu_device : public i8086_common_cpu_device
diff --git a/src/emu/cpu/i860/i860.h b/src/emu/cpu/i860/i860.h
index f44901406ee..1079d46b479 100644
--- a/src/emu/cpu/i860/i860.h
+++ b/src/emu/cpu/i860/i860.h
@@ -39,7 +39,7 @@ enum
I860_F0, I860_F1, I860_F2, I860_F3, I860_F4, I860_F5, I860_F6, I860_F7, I860_F8, I860_F9,
I860_F10, I860_F11, I860_F12, I860_F13, I860_F14, I860_F15, I860_F16, I860_F17, I860_F18, I860_F19,
I860_F20, I860_F21, I860_F22, I860_F23, I860_F24, I860_F25, I860_F26, I860_F27, I860_F28, I860_F29,
- I860_F30, I860_F31,
+ I860_F30, I860_F31
};
diff --git a/src/emu/cpu/i960/i960.c b/src/emu/cpu/i960/i960.c
index 4dd29e45940..8b00a58d4c6 100644
--- a/src/emu/cpu/i960/i960.c
+++ b/src/emu/cpu/i960/i960.c
@@ -109,22 +109,22 @@ UINT32 i960_cpu_device::get_ea(UINT32 opcode)
return m_r[abase] + (m_r[index] << scale);
case 0xc:
- ret = m_direct->read_decrypted_dword(m_IP);
+ ret = m_direct->read_dword(m_IP);
m_IP += 4;
return ret;
case 0xd:
- ret = m_direct->read_decrypted_dword(m_IP) + m_r[abase];
+ ret = m_direct->read_dword(m_IP) + m_r[abase];
m_IP += 4;
return ret;
case 0xe:
- ret = m_direct->read_decrypted_dword(m_IP) + (m_r[index] << scale);
+ ret = m_direct->read_dword(m_IP) + (m_r[index] << scale);
m_IP += 4;
return ret;
case 0xf:
- ret = m_direct->read_decrypted_dword(m_IP) + m_r[abase] + (m_r[index] << scale);
+ ret = m_direct->read_dword(m_IP) + m_r[abase] + (m_r[index] << scale);
m_IP += 4;
return ret;
@@ -1932,7 +1932,7 @@ void i960_cpu_device::execute_run()
m_bursting = 0;
- opcode = m_direct->read_decrypted_dword(m_IP);
+ opcode = m_direct->read_dword(m_IP);
m_IP += 4;
execute_op(opcode);
diff --git a/src/emu/cpu/ie15/ie15.c b/src/emu/cpu/ie15/ie15.c
index c2e3356432b..cae9bc8db1d 100644
--- a/src/emu/cpu/ie15/ie15.c
+++ b/src/emu/cpu/ie15/ie15.c
@@ -37,7 +37,7 @@ ie15_device::ie15_device(const machine_config &mconfig, const char *tag, device_
{
// set our instruction counter
m_icountptr = &m_icount;
-};
+}
//-------------------------------------------------
// device_start - start up the device
@@ -414,14 +414,14 @@ inline void ie15_device::execute_one(int opcode)
inline UINT8 ie15_device::rop()
{
- UINT8 retVal = m_direct->read_decrypted_byte(m_PC.w.l);
+ UINT8 retVal = m_direct->read_byte(m_PC.w.l);
m_PC.w.l = (m_PC.w.l + 1) & 0x0fff;
return retVal;
}
inline UINT8 ie15_device::arg()
{
- UINT8 retVal = m_direct->read_raw_byte(m_PC.w.l);
+ UINT8 retVal = m_direct->read_byte(m_PC.w.l);
return retVal;
}
diff --git a/src/emu/cpu/jaguar/jaguar.c b/src/emu/cpu/jaguar/jaguar.c
index 6c1dd97b821..976ab4f5983 100644
--- a/src/emu/cpu/jaguar/jaguar.c
+++ b/src/emu/cpu/jaguar/jaguar.c
@@ -137,7 +137,7 @@ const jaguar_cpu_device::op_func jaguar_cpu_device::dsp_op_table[64] =
MEMORY ACCESSORS
***************************************************************************/
-#define ROPCODE(pc) (m_direct->read_decrypted_word(pc, WORD_XOR_BE(0)))
+#define ROPCODE(pc) (m_direct->read_word(pc, WORD_XOR_BE(0)))
const device_type JAGUARGPU = &device_creator<jaguargpu_cpu_device>;
diff --git a/src/emu/cpu/lc8670/lc8670.c b/src/emu/cpu/lc8670/lc8670.c
index ac1fd1960d1..96bcfaa0348 100644
--- a/src/emu/cpu/lc8670/lc8670.c
+++ b/src/emu/cpu/lc8670/lc8670.c
@@ -1071,7 +1071,7 @@ WRITE8_MEMBER(lc8670_cpu_device::regs_w)
inline UINT8 lc8670_cpu_device::fetch()
{
- UINT8 data = m_direct->read_decrypted_byte(m_pc);
+ UINT8 data = m_direct->read_byte(m_pc);
set_pc(m_pc + 1);
diff --git a/src/emu/cpu/lh5801/5801dasm.c b/src/emu/cpu/lh5801/5801dasm.c
index ef812756d4e..b622bda9de6 100644
--- a/src/emu/cpu/lh5801/5801dasm.c
+++ b/src/emu/cpu/lh5801/5801dasm.c
@@ -85,7 +85,7 @@ enum Ins
OFF, // clears bf flip flop
RDP, SDP,// reset display flip flop
RPU, SPU,// flip flop pu off
- RPV, SPV,// flip flop pv off
+ RPV, SPV // flip flop pv off
};
static const char *const InsNames[]={
diff --git a/src/emu/cpu/lh5801/5801tbl.inc b/src/emu/cpu/lh5801/5801tbl.inc
index 352e0d64d05..98a8d7b1d02 100644
--- a/src/emu/cpu/lh5801/5801tbl.inc
+++ b/src/emu/cpu/lh5801/5801tbl.inc
@@ -26,8 +26,8 @@ UINT8 lh5801_cpu_device::lh5801_add_generic(int left, int right, int carry)
UINT16 lh5801_cpu_device::lh5801_readop_word()
{
UINT16 r;
- r=m_direct->read_decrypted_byte(P++)<<8;
- r|=m_direct->read_decrypted_byte(P++);
+ r=m_direct->read_byte(P++)<<8;
+ r|=m_direct->read_byte(P++);
return r;
}
@@ -221,7 +221,7 @@ void lh5801_cpu_device::lh5801_jmp(UINT16 adr)
void lh5801_cpu_device::lh5801_branch_plus(int doit)
{
- UINT8 t=m_direct->read_decrypted_byte(P++);
+ UINT8 t=m_direct->read_byte(P++);
if (doit) {
m_icount-=3;
P+=t;
@@ -230,7 +230,7 @@ void lh5801_cpu_device::lh5801_branch_plus(int doit)
void lh5801_cpu_device::lh5801_branch_minus(int doit)
{
- UINT8 t=m_direct->read_decrypted_byte(P++);
+ UINT8 t=m_direct->read_byte(P++);
if (doit) {
m_icount-=3;
P-=t;
@@ -239,7 +239,7 @@ void lh5801_cpu_device::lh5801_branch_minus(int doit)
void lh5801_cpu_device::lh5801_lop()
{
- UINT8 t=m_direct->read_decrypted_byte(P++);
+ UINT8 t=m_direct->read_byte(P++);
m_icount-=8;
if (UL--) {
m_icount-=3;
@@ -355,7 +355,7 @@ void lh5801_cpu_device::lh5801_instruction_fd()
int oper;
int adr;
- oper=m_direct->read_decrypted_byte(P++);
+ oper=m_direct->read_byte(P++);
switch (oper) {
case 0x01: lh5801_sbc(m_io->read_byte(X)); m_icount-=11;break;
case 0x03: lh5801_adc(m_io->read_byte(X)); m_icount-=11;break;
@@ -396,29 +396,29 @@ void lh5801_cpu_device::lh5801_instruction_fd()
case 0x40: lh5801_inc(&XH);m_icount-=9;break;
case 0x42: lh5801_dec(&XH);m_icount-=9;break;
case 0x48: X=S;m_icount-=11;break;
- case 0x49: lh5801_and_mem(*m_io, X, m_direct->read_decrypted_byte(P++)); m_icount-=17;break;
+ case 0x49: lh5801_and_mem(*m_io, X, m_direct->read_byte(P++)); m_icount-=17;break;
case 0x4a: X=X;m_icount-=11;break; //!!!
- case 0x4b: lh5801_ora_mem(*m_io, X, m_direct->read_decrypted_byte(P++)); m_icount-=17;break;
+ case 0x4b: lh5801_ora_mem(*m_io, X, m_direct->read_byte(P++)); m_icount-=17;break;
case 0x4c: m_bf=0;/*off !*/ m_icount-=8;break;
- case 0x4d: lh5801_bit(m_io->read_byte(X), m_direct->read_decrypted_byte(P++));m_icount-=14;break;
+ case 0x4d: lh5801_bit(m_io->read_byte(X), m_direct->read_byte(P++));m_icount-=14;break;
case 0x4e: S=X;m_icount-=11;break;
- case 0x4f: lh5801_add_mem(*m_io, X, m_direct->read_decrypted_byte(P++)); m_icount-=17;break;
+ case 0x4f: lh5801_add_mem(*m_io, X, m_direct->read_byte(P++)); m_icount-=17;break;
case 0x50: lh5801_inc(&YH);m_icount-=9;break;
case 0x52: lh5801_dec(&YH);m_icount-=9;break;
case 0x58: X=P;m_icount-=11;break;
- case 0x59: lh5801_and_mem(*m_io, Y, m_direct->read_decrypted_byte(P++)); m_icount-=17;break;
+ case 0x59: lh5801_and_mem(*m_io, Y, m_direct->read_byte(P++)); m_icount-=17;break;
case 0x5a: Y=X;m_icount-=11;break;
- case 0x5b: lh5801_ora_mem(*m_io, Y, m_direct->read_decrypted_byte(P++)); m_icount-=17;break;
- case 0x5d: lh5801_bit(m_io->read_byte(Y), m_direct->read_decrypted_byte(P++));m_icount-=14;break;
+ case 0x5b: lh5801_ora_mem(*m_io, Y, m_direct->read_byte(P++)); m_icount-=17;break;
+ case 0x5d: lh5801_bit(m_io->read_byte(Y), m_direct->read_byte(P++));m_icount-=14;break;
case 0x5e: lh5801_jmp(X);m_icount-=11;break; // P=X
- case 0x5f: lh5801_add_mem(*m_io, Y, m_direct->read_decrypted_byte(P++)); m_icount-=17;break;
+ case 0x5f: lh5801_add_mem(*m_io, Y, m_direct->read_byte(P++)); m_icount-=17;break;
case 0x60: lh5801_inc(&UH);m_icount-=9;break;
case 0x62: lh5801_dec(&UH);m_icount-=9;break;
- case 0x69: lh5801_and_mem(*m_io, U, m_direct->read_decrypted_byte(P++)); m_icount-=17;break;
+ case 0x69: lh5801_and_mem(*m_io, U, m_direct->read_byte(P++)); m_icount-=17;break;
case 0x6a: U=X;m_icount-=11;break;
- case 0x6b: lh5801_ora_mem(*m_io, U, m_direct->read_decrypted_byte(P++)); m_icount-=17;break;
- case 0x6d: lh5801_bit(m_io->read_byte(X), m_direct->read_decrypted_byte(P++));m_icount-=14;break;
- case 0x6f: lh5801_add_mem(*m_io, U, m_direct->read_decrypted_byte(P++)); m_icount-=17;break;
+ case 0x6b: lh5801_ora_mem(*m_io, U, m_direct->read_byte(P++)); m_icount-=17;break;
+ case 0x6d: lh5801_bit(m_io->read_byte(X), m_direct->read_byte(P++));m_icount-=14;break;
+ case 0x6f: lh5801_add_mem(*m_io, U, m_direct->read_byte(P++)); m_icount-=17;break;
case 0x81: m_t|=IE; /*sie !*/m_icount-=8;break;
case 0x88: lh5801_push_word(X); m_icount-=14;break;
case 0x8a: lh5801_pop(); m_icount-=12; break;
@@ -454,20 +454,20 @@ void lh5801_cpu_device::lh5801_instruction_fd()
case 0xea: lh5801_adr(&m_u);m_icount-=11;break;
case 0xe9:
adr=lh5801_readop_word();
- lh5801_and_mem(*m_io, adr, m_direct->read_decrypted_byte(P++)); m_icount-=23;
+ lh5801_and_mem(*m_io, adr, m_direct->read_byte(P++)); m_icount-=23;
break;
case 0xeb:
adr=lh5801_readop_word();
- lh5801_ora_mem(*m_io, adr, m_direct->read_decrypted_byte(P++)); m_icount-=23;
+ lh5801_ora_mem(*m_io, adr, m_direct->read_byte(P++)); m_icount-=23;
break;
case 0xec: m_t=m_a; m_icount-=9;break;
case 0xed:
adr=lh5801_readop_word();
- lh5801_bit(m_io->read_byte(adr), m_direct->read_decrypted_byte(P++));
+ lh5801_bit(m_io->read_byte(adr), m_direct->read_byte(P++));
m_icount-=20;break;
case 0xef:
adr=lh5801_readop_word();
- lh5801_add_mem(*m_io, adr, m_direct->read_decrypted_byte(P++)); m_icount-=23;
+ lh5801_add_mem(*m_io, adr, m_direct->read_byte(P++)); m_icount-=23;
break;
default:
@@ -480,7 +480,7 @@ void lh5801_cpu_device::lh5801_instruction()
int oper;
int adr;
- oper=m_direct->read_decrypted_byte(P++);
+ oper=m_direct->read_byte(P++);
switch (oper) {
case 0x00: lh5801_sbc(XL); m_icount-=6;break;
case 0x01: lh5801_sbc(m_program->read_byte(X)); m_icount-=7;break;
@@ -539,14 +539,14 @@ void lh5801_cpu_device::lh5801_instruction()
case 0x45: lh5801_lin(&m_x);m_icount-=6;break;
case 0x46: X--;m_icount-=5;break;
case 0x47: lh5801_lde(&m_x);m_icount-=6;break;
- case 0x48: XH=m_direct->read_decrypted_byte(P++);m_icount-=6;break;
- case 0x49: lh5801_and_mem(*m_program, X, m_direct->read_decrypted_byte(P++)); m_icount-=13;break;
- case 0x4a: XL=m_direct->read_decrypted_byte(P++);m_icount-=6;break;
- case 0x4b: lh5801_ora_mem(*m_program, X, m_direct->read_decrypted_byte(P++)); m_icount-=13;break;
- case 0x4c: lh5801_cpa(XH, m_direct->read_decrypted_byte(P++)); m_icount-=7;break;
- case 0x4d: lh5801_bit(m_program->read_byte(X), m_direct->read_decrypted_byte(P++));m_icount-=10;break;
- case 0x4e: lh5801_cpa(XL, m_direct->read_decrypted_byte(P++)); m_icount-=7;break;
- case 0x4f: lh5801_add_mem(*m_program, X, m_direct->read_decrypted_byte(P++)); m_icount-=13;break;
+ case 0x48: XH=m_direct->read_byte(P++);m_icount-=6;break;
+ case 0x49: lh5801_and_mem(*m_program, X, m_direct->read_byte(P++)); m_icount-=13;break;
+ case 0x4a: XL=m_direct->read_byte(P++);m_icount-=6;break;
+ case 0x4b: lh5801_ora_mem(*m_program, X, m_direct->read_byte(P++)); m_icount-=13;break;
+ case 0x4c: lh5801_cpa(XH, m_direct->read_byte(P++)); m_icount-=7;break;
+ case 0x4d: lh5801_bit(m_program->read_byte(X), m_direct->read_byte(P++));m_icount-=10;break;
+ case 0x4e: lh5801_cpa(XL, m_direct->read_byte(P++)); m_icount-=7;break;
+ case 0x4f: lh5801_add_mem(*m_program, X, m_direct->read_byte(P++)); m_icount-=13;break;
case 0x50: lh5801_inc(&YL);m_icount-=5;break;
case 0x51: lh5801_sin(&m_y); m_icount-=6;break;
case 0x52: lh5801_dec(&YL);m_icount-=5;break;
@@ -555,14 +555,14 @@ void lh5801_cpu_device::lh5801_instruction()
case 0x55: lh5801_lin(&m_y);m_icount-=6;break;
case 0x56: Y--;m_icount-=5;break;
case 0x57: lh5801_lde(&m_y);m_icount-=6;break;
- case 0x58: YH=m_direct->read_decrypted_byte(P++);m_icount-=6;break;
- case 0x59: lh5801_and_mem(*m_program, Y, m_direct->read_decrypted_byte(P++)); m_icount-=13;break;
- case 0x5a: YL=m_direct->read_decrypted_byte(P++);m_icount-=6;break;
- case 0x5b: lh5801_ora_mem(*m_program, Y, m_direct->read_decrypted_byte(P++)); m_icount-=13;break;
- case 0x5c: lh5801_cpa(YH, m_direct->read_decrypted_byte(P++)); m_icount-=7;break;
- case 0x5d: lh5801_bit(m_program->read_byte(Y), m_direct->read_decrypted_byte(P++));m_icount-=10;break;
- case 0x5e: lh5801_cpa(YL, m_direct->read_decrypted_byte(P++)); m_icount-=7;break;
- case 0x5f: lh5801_add_mem(*m_program, Y, m_direct->read_decrypted_byte(P++)); m_icount-=13;break;
+ case 0x58: YH=m_direct->read_byte(P++);m_icount-=6;break;
+ case 0x59: lh5801_and_mem(*m_program, Y, m_direct->read_byte(P++)); m_icount-=13;break;
+ case 0x5a: YL=m_direct->read_byte(P++);m_icount-=6;break;
+ case 0x5b: lh5801_ora_mem(*m_program, Y, m_direct->read_byte(P++)); m_icount-=13;break;
+ case 0x5c: lh5801_cpa(YH, m_direct->read_byte(P++)); m_icount-=7;break;
+ case 0x5d: lh5801_bit(m_program->read_byte(Y), m_direct->read_byte(P++));m_icount-=10;break;
+ case 0x5e: lh5801_cpa(YL, m_direct->read_byte(P++)); m_icount-=7;break;
+ case 0x5f: lh5801_add_mem(*m_program, Y, m_direct->read_byte(P++)); m_icount-=13;break;
case 0x60: lh5801_inc(&UL);m_icount-=5;break;
case 0x61: lh5801_sin(&m_u); m_icount-=6;break;
case 0x62: lh5801_dec(&UL);m_icount-=5;break;
@@ -571,14 +571,14 @@ void lh5801_cpu_device::lh5801_instruction()
case 0x65: lh5801_lin(&m_u);m_icount-=6;break;
case 0x66: U--;m_icount-=5;break;
case 0x67: lh5801_lde(&m_u);m_icount-=6;break;
- case 0x68: UH=m_direct->read_decrypted_byte(P++);m_icount-=6;break;
- case 0x69: lh5801_and_mem(*m_program, U, m_direct->read_decrypted_byte(P++)); m_icount-=13;break;
- case 0x6a: UL=m_direct->read_decrypted_byte(P++);m_icount-=6;break;
- case 0x6b: lh5801_ora_mem(*m_program, U, m_direct->read_decrypted_byte(P++)); m_icount-=13;break;
- case 0x6c: lh5801_cpa(UH, m_direct->read_decrypted_byte(P++)); m_icount-=7;break;
- case 0x6d: lh5801_bit(m_program->read_byte(U), m_direct->read_decrypted_byte(P++));m_icount-=10;break;
- case 0x6e: lh5801_cpa(UL, m_direct->read_decrypted_byte(P++)); m_icount-=7;break;
- case 0x6f: lh5801_add_mem(*m_program, U, m_direct->read_decrypted_byte(P++)); m_icount-=13;break;
+ case 0x68: UH=m_direct->read_byte(P++);m_icount-=6;break;
+ case 0x69: lh5801_and_mem(*m_program, U, m_direct->read_byte(P++)); m_icount-=13;break;
+ case 0x6a: UL=m_direct->read_byte(P++);m_icount-=6;break;
+ case 0x6b: lh5801_ora_mem(*m_program, U, m_direct->read_byte(P++)); m_icount-=13;break;
+ case 0x6c: lh5801_cpa(UH, m_direct->read_byte(P++)); m_icount-=7;break;
+ case 0x6d: lh5801_bit(m_program->read_byte(U), m_direct->read_byte(P++));m_icount-=10;break;
+ case 0x6e: lh5801_cpa(UL, m_direct->read_byte(P++)); m_icount-=7;break;
+ case 0x6f: lh5801_add_mem(*m_program, U, m_direct->read_byte(P++)); m_icount-=13;break;
case 0x80: lh5801_sbc(XH); m_icount-=6;break;
case 0x81: lh5801_branch_plus(!(m_t&C)); m_icount-=8; break;
case 0x82: lh5801_adc(XH); m_icount-=6;break;
@@ -626,25 +626,25 @@ void lh5801_cpu_device::lh5801_instruction()
case 0xad: lh5801_eor(m_program->read_byte(lh5801_readop_word())); m_icount-=13;break;
case 0xae: m_program->write_byte(lh5801_readop_word(),m_a); m_icount-=12;break;
case 0xaf: lh5801_bit(m_program->read_byte(lh5801_readop_word()),m_a); m_icount-=13;break;
- case 0xb1: lh5801_sbc(m_direct->read_decrypted_byte(P++)); m_icount-=7;break;
- case 0xb3: lh5801_adc(m_direct->read_decrypted_byte(P++)); m_icount-=7;break;
- case 0xb5: lh5801_lda(m_direct->read_decrypted_byte(P++)); m_icount-=6;break;
- case 0xb7: lh5801_cpa(m_a, m_direct->read_decrypted_byte(P++)); m_icount-=7;break;
+ case 0xb1: lh5801_sbc(m_direct->read_byte(P++)); m_icount-=7;break;
+ case 0xb3: lh5801_adc(m_direct->read_byte(P++)); m_icount-=7;break;
+ case 0xb5: lh5801_lda(m_direct->read_byte(P++)); m_icount-=6;break;
+ case 0xb7: lh5801_cpa(m_a, m_direct->read_byte(P++)); m_icount-=7;break;
case 0xb8: m_pv=0;/*rpv!*/ m_icount-=4; break;
- case 0xb9: lh5801_and(m_direct->read_decrypted_byte(P++)); m_icount-=7;break;
+ case 0xb9: lh5801_and(m_direct->read_byte(P++)); m_icount-=7;break;
case 0xba: lh5801_jmp(lh5801_readop_word()); m_icount-=12;break;
- case 0xbb: lh5801_ora(m_direct->read_decrypted_byte(P++)); m_icount-=7;break;
- case 0xbd: lh5801_eor(m_direct->read_decrypted_byte(P++)); m_icount-=7;break;
+ case 0xbb: lh5801_ora(m_direct->read_byte(P++)); m_icount-=7;break;
+ case 0xbd: lh5801_eor(m_direct->read_byte(P++)); m_icount-=7;break;
case 0xbe: lh5801_sjp(); m_icount-=19; break;
- case 0xbf: lh5801_bit(m_a, m_direct->read_decrypted_byte(P++));m_icount-=7;break;
- case 0xc1: lh5801_vector(!(m_t&C), m_direct->read_decrypted_byte(P++)); m_icount-=8;break;
- case 0xc3: lh5801_vector(m_t&C, m_direct->read_decrypted_byte(P++)); m_icount-=8;break;
- case 0xc5: lh5801_vector(!(m_t&H), m_direct->read_decrypted_byte(P++)); m_icount-=8;break;
- case 0xc7: lh5801_vector(m_t&H, m_direct->read_decrypted_byte(P++)); m_icount-=8;break;
- case 0xc9: lh5801_vector(!(m_t&Z), m_direct->read_decrypted_byte(P++)); m_icount-=8;break;
- case 0xcb: lh5801_vector(m_t&Z, m_direct->read_decrypted_byte(P++)); m_icount-=8;break;
- case 0xcd: lh5801_vector(1, m_direct->read_decrypted_byte(P++)); m_icount-=7;break;
- case 0xcf: lh5801_vector(m_t&V, m_direct->read_decrypted_byte(P++)); m_icount-=8;break;
+ case 0xbf: lh5801_bit(m_a, m_direct->read_byte(P++));m_icount-=7;break;
+ case 0xc1: lh5801_vector(!(m_t&C), m_direct->read_byte(P++)); m_icount-=8;break;
+ case 0xc3: lh5801_vector(m_t&C, m_direct->read_byte(P++)); m_icount-=8;break;
+ case 0xc5: lh5801_vector(!(m_t&H), m_direct->read_byte(P++)); m_icount-=8;break;
+ case 0xc7: lh5801_vector(m_t&H, m_direct->read_byte(P++)); m_icount-=8;break;
+ case 0xc9: lh5801_vector(!(m_t&Z), m_direct->read_byte(P++)); m_icount-=8;break;
+ case 0xcb: lh5801_vector(m_t&Z, m_direct->read_byte(P++)); m_icount-=8;break;
+ case 0xcd: lh5801_vector(1, m_direct->read_byte(P++)); m_icount-=7;break;
+ case 0xcf: lh5801_vector(m_t&V, m_direct->read_byte(P++)); m_icount-=8;break;
case 0xd1: lh5801_ror(); m_icount-=6; break;
case 0xd3: lh5801_drr(*m_program, X); m_icount-=12; break;
case 0xd5: lh5801_shr(); m_icount-=6; break;
@@ -656,17 +656,17 @@ void lh5801_cpu_device::lh5801_instruction()
case 0xe1: m_pu=1;/*spu!*/ m_icount-=4; break;
case 0xe3: m_pu=0;/*rpu!*/ m_icount-=4; break;
case 0xe9:
- adr=lh5801_readop_word();lh5801_and_mem(*m_program, adr, m_direct->read_decrypted_byte(P++));
+ adr=lh5801_readop_word();lh5801_and_mem(*m_program, adr, m_direct->read_byte(P++));
m_icount-=19;break;
case 0xeb:
- adr=lh5801_readop_word();lh5801_ora_mem(*m_program, adr, m_direct->read_decrypted_byte(P++));
+ adr=lh5801_readop_word();lh5801_ora_mem(*m_program, adr, m_direct->read_byte(P++));
m_icount-=19;break;
case 0xed:
- adr=lh5801_readop_word();lh5801_bit(m_program->read_byte(adr), m_direct->read_decrypted_byte(P++));
+ adr=lh5801_readop_word();lh5801_bit(m_program->read_byte(adr), m_direct->read_byte(P++));
m_icount-=16;break;
case 0xef:
adr=lh5801_readop_word();
- lh5801_add_mem(*m_program, adr, m_direct->read_decrypted_byte(P++)); m_icount-=19;
+ lh5801_add_mem(*m_program, adr, m_direct->read_byte(P++)); m_icount-=19;
break;
case 0xf1: lh5801_aex(); m_icount-=6; break;
case 0xf5: m_program->write_byte(Y++, m_program->read_byte(X++)); m_icount-=7; break; //tin
diff --git a/src/emu/cpu/lh5801/lh5801.h b/src/emu/cpu/lh5801/lh5801.h
index 45977d05e0c..e5c6aa74690 100644
--- a/src/emu/cpu/lh5801/lh5801.h
+++ b/src/emu/cpu/lh5801/lh5801.h
@@ -56,7 +56,7 @@ pc 8bit
// input lines
enum
{
- LH5801_LINE_MI, //maskable interrupt
+ LH5801_LINE_MI //maskable interrupt
};
diff --git a/src/emu/cpu/lr35902/lr35902.h b/src/emu/cpu/lr35902/lr35902.h
index a7667825aad..509f06e77f5 100644
--- a/src/emu/cpu/lr35902/lr35902.h
+++ b/src/emu/cpu/lr35902/lr35902.h
@@ -29,7 +29,7 @@ enum
/* Pseudo registers to keep track of the interrupt statuses */
LR35902_IE, LR35902_IF,
/* Pseudo register to change and check the cpu operating speed */
- LR35902_SPEED,
+ LR35902_SPEED
};
diff --git a/src/emu/cpu/m37710/m37710cm.h b/src/emu/cpu/m37710/m37710cm.h
index 8c784b9ca05..aa691b2e9aa 100644
--- a/src/emu/cpu/m37710/m37710cm.h
+++ b/src/emu/cpu/m37710/m37710cm.h
@@ -23,10 +23,10 @@
#define M37710_CALL_DEBUGGER(x) debugger_instruction_hook(this, x)
#define m37710_read_8(addr) m_program->read_byte(addr)
#define m37710_write_8(addr,data) m_program->write_byte(addr,data)
-#define m37710_read_8_immediate(A) m_direct->read_decrypted_byte(A, BYTE_XOR_LE(0))
+#define m37710_read_8_immediate(A) m_direct->read_byte(A, BYTE_XOR_LE(0))
#define m37710_read_16(addr) m_program->read_word_unaligned(addr)
#define m37710_write_16(addr,data) m_program->write_word_unaligned(addr,data)
-#define m37710_read_16_immediate(A) m_direct->read_decrypted_word(A)
+#define m37710_read_16_immediate(A) m_direct->read_word(A)
/* ======================================================================== */
diff --git a/src/emu/cpu/m37710/m7700ds.c b/src/emu/cpu/m37710/m7700ds.c
index 07bc981e9d0..f6b77932b1e 100644
--- a/src/emu/cpu/m37710/m7700ds.c
+++ b/src/emu/cpu/m37710/m7700ds.c
@@ -18,7 +18,7 @@ Based on G65C816 CPU Emulator by Karl Stenerud
#define ADDRESS_24BIT(A) ((A)&0xffffff)
-struct opcode_struct
+struct m7700_opcode_struct
{
unsigned char name;
unsigned char flag;
@@ -72,7 +72,7 @@ static const char *const g_opnames[] =
"BBC", "BBS", "TBY", "ANDB","PUL", "PSH", "PLB", "XAB", "PHB",
};
-static const opcode_struct g_opcodes[256] =
+static const m7700_opcode_struct g_opcodes[256] =
{
{BRK, I, SIG }, {ORA, M, DXI }, {UNK, I, SIG }, {ORA, M, S },
{SEB, M, LDM4 }, {ORA, M, D }, {ASL, M, D }, {ORA, M, DLI },
@@ -155,7 +155,7 @@ static const opcode_struct g_opcodes[256] =
{JSR, I, AXI }, {SBC, M, AX }, {INC, M, AX }, {SBC, M, ALX }
};
-static const opcode_struct g_opcodes_prefix42[256] =
+static const m7700_opcode_struct g_opcodes_prefix42[256] =
{
{BRK, I, SIG }, {ORB, M, DXI }, {COP, I, SIG }, {ORB, M, S },
{TSB, M, D }, {ORB, M, D }, {ASL, M, D }, {ORB, M, DLI },
@@ -238,7 +238,7 @@ static const opcode_struct g_opcodes_prefix42[256] =
{JSR, I, AXI }, {SBCB, M, AX }, {INC, M, AX }, {SBCB, M, ALX }
};
-static const opcode_struct g_opcodes_prefix89[256] =
+static const m7700_opcode_struct g_opcodes_prefix89[256] =
{
{BRK, I, SIG }, {MPY, M, DXI }, {COP, I, SIG }, {MPY, M, S },
{TSB, M, D }, {MPY, M, D }, {ASL, M, D }, {MPY, M, DLI },
@@ -371,7 +371,7 @@ INLINE char* int_16_str(unsigned int val)
int m7700_disassemble(char* buff, unsigned int pc, unsigned int pb, const UINT8 *oprom, int m_flag, int x_flag)
{
unsigned int instruction;
- const opcode_struct *opcode;
+ const m7700_opcode_struct *opcode;
char* ptr;
int var;
signed char varS;
diff --git a/src/emu/cpu/m6502/deco16.c b/src/emu/cpu/m6502/deco16.c
index 681ae5dcc42..a500b287d7a 100644
--- a/src/emu/cpu/m6502/deco16.c
+++ b/src/emu/cpu/m6502/deco16.c
@@ -41,7 +41,13 @@ void deco16_device::device_start()
const address_space_config *deco16_device::memory_space_config(address_spacenum spacenum) const
{
- return spacenum == AS_PROGRAM ? &program_config : spacenum == AS_IO ? &io_config : NULL;
+ switch(spacenum)
+ {
+ case AS_PROGRAM: return &program_config;
+ case AS_IO: return &io_config;
+ case AS_DECRYPTED_OPCODES: return has_configured_map(AS_DECRYPTED_OPCODES) ? &sprogram_config : NULL;
+ default: return NULL;
+ }
}
#include "cpu/m6502/deco16.inc"
diff --git a/src/emu/cpu/m6502/deco16.h b/src/emu/cpu/m6502/deco16.h
index 334867efd7c..d82087477f7 100644
--- a/src/emu/cpu/m6502/deco16.h
+++ b/src/emu/cpu/m6502/deco16.h
@@ -54,7 +54,7 @@ protected:
enum {
DECO16_IRQ_LINE = m6502_device::IRQ_LINE,
DECO16_NMI_LINE = m6502_device::NMI_LINE,
- DECO16_SET_OVERFLOW = m6502_device::V_LINE,
+ DECO16_SET_OVERFLOW = m6502_device::V_LINE
};
extern const device_type DECO16;
diff --git a/src/emu/cpu/m6502/m4510.c b/src/emu/cpu/m6502/m4510.c
index 329734f692e..2a7eb10ee1e 100644
--- a/src/emu/cpu/m6502/m4510.c
+++ b/src/emu/cpu/m6502/m4510.c
@@ -19,6 +19,9 @@ m4510_device::m4510_device(const machine_config &mconfig, const char *tag, devic
program_config.m_addrbus_width = 20;
program_config.m_logaddr_width = 16;
program_config.m_page_shift = 13;
+ sprogram_config.m_addrbus_width = 20;
+ sprogram_config.m_logaddr_width = 16;
+ sprogram_config.m_page_shift = 13;
}
offs_t m4510_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options)
@@ -71,14 +74,14 @@ UINT8 m4510_device::mi_4510_normal::read(UINT16 adr)
return program->read_byte(base->map(adr));
}
-UINT8 m4510_device::mi_4510_normal::read_direct(UINT16 adr)
+UINT8 m4510_device::mi_4510_normal::read_sync(UINT16 adr)
{
- return direct->read_raw_byte(base->map(adr));
+ return sdirect->read_byte(base->map(adr));
}
-UINT8 m4510_device::mi_4510_normal::read_decrypted(UINT16 adr)
+UINT8 m4510_device::mi_4510_normal::read_arg(UINT16 adr)
{
- return direct->read_decrypted_byte(base->map(adr));
+ return direct->read_byte(base->map(adr));
}
void m4510_device::mi_4510_normal::write(UINT16 adr, UINT8 val)
@@ -90,14 +93,14 @@ m4510_device::mi_4510_nd::mi_4510_nd(m4510_device *_base) : mi_4510_normal(_base
{
}
-UINT8 m4510_device::mi_4510_nd::read_direct(UINT16 adr)
+UINT8 m4510_device::mi_4510_nd::read_sync(UINT16 adr)
{
- return read(adr);
+ return sprogram->read_byte(base->map(adr));
}
-UINT8 m4510_device::mi_4510_nd::read_decrypted(UINT16 adr)
+UINT8 m4510_device::mi_4510_nd::read_arg(UINT16 adr)
{
- return read(adr);
+ return program->read_byte(base->map(adr));
}
#include "cpu/m6502/m4510.inc"
diff --git a/src/emu/cpu/m6502/m4510.h b/src/emu/cpu/m6502/m4510.h
index 46a95a1eb72..492572fddb6 100644
--- a/src/emu/cpu/m6502/m4510.h
+++ b/src/emu/cpu/m6502/m4510.h
@@ -37,8 +37,8 @@ protected:
mi_4510_normal(m4510_device *base);
virtual ~mi_4510_normal() {}
virtual UINT8 read(UINT16 adr);
- virtual UINT8 read_direct(UINT16 adr);
- virtual UINT8 read_decrypted(UINT16 adr);
+ virtual UINT8 read_sync(UINT16 adr);
+ virtual UINT8 read_arg(UINT16 adr);
virtual void write(UINT16 adr, UINT8 val);
};
@@ -46,8 +46,8 @@ protected:
public:
mi_4510_nd(m4510_device *base);
virtual ~mi_4510_nd() {}
- virtual UINT8 read_direct(UINT16 adr);
- virtual UINT8 read_decrypted(UINT16 adr);
+ virtual UINT8 read_sync(UINT16 adr);
+ virtual UINT8 read_arg(UINT16 adr);
};
virtual void device_start();
@@ -74,7 +74,7 @@ protected:
enum {
M4510_IRQ_LINE = m6502_device::IRQ_LINE,
- M4510_NMI_LINE = m6502_device::NMI_LINE,
+ M4510_NMI_LINE = m6502_device::NMI_LINE
};
extern const device_type M4510;
diff --git a/src/emu/cpu/m6502/m6502.c b/src/emu/cpu/m6502/m6502.c
index c1a84b2fd9c..01b2b8f0f98 100644
--- a/src/emu/cpu/m6502/m6502.c
+++ b/src/emu/cpu/m6502/m6502.c
@@ -17,7 +17,8 @@ const device_type M6502 = &device_creator<m6502_device>;
m6502_device::m6502_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
cpu_device(mconfig, M6502, "M6502", tag, owner, clock, "m6502", __FILE__),
sync_w(*this),
- program_config("program", ENDIANNESS_LITTLE, 8, 16)
+ program_config("program", ENDIANNESS_LITTLE, 8, 16),
+ sprogram_config("decrypted_opcodes", ENDIANNESS_LITTLE, 8, 16)
{
direct_disabled = false;
}
@@ -25,7 +26,8 @@ m6502_device::m6502_device(const machine_config &mconfig, const char *tag, devic
m6502_device::m6502_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
cpu_device(mconfig, type, name, tag, owner, clock, shortname, source),
sync_w(*this),
- program_config("program", ENDIANNESS_LITTLE, 8, 16)
+ program_config("program", ENDIANNESS_LITTLE, 8, 16),
+ sprogram_config("decrypted_opcodes", ENDIANNESS_LITTLE, 8, 16)
{
direct_disabled = false;
}
@@ -42,8 +44,11 @@ void m6502_device::device_start()
void m6502_device::init()
{
- mintf->program = &space(AS_PROGRAM);
- mintf->direct = &mintf->program->direct();
+ mintf->program = &space(AS_PROGRAM);
+ mintf->sprogram = has_space(AS_DECRYPTED_OPCODES) ? &space(AS_DECRYPTED_OPCODES) : mintf->program;
+
+ mintf->direct = &mintf->program->direct();
+ mintf->sdirect = &mintf->sprogram->direct();
sync_w.resolve_safe();
@@ -402,7 +407,12 @@ void m6502_device::execute_set_input(int inputnum, int state)
const address_space_config *m6502_device::memory_space_config(address_spacenum spacenum) const
{
- return (spacenum == AS_PROGRAM) ? &program_config : NULL;
+ switch(spacenum)
+ {
+ case AS_PROGRAM: return &program_config;
+ case AS_DECRYPTED_OPCODES: return has_configured_map(AS_DECRYPTED_OPCODES) ? &sprogram_config : NULL;
+ default: return NULL;
+ }
}
@@ -621,7 +631,7 @@ void m6502_device::prefetch()
sync = true;
sync_w(ASSERT_LINE);
NPC = PC;
- IR = mintf->read_decrypted(PC);
+ IR = mintf->read_sync(PC);
sync = false;
sync_w(CLEAR_LINE);
@@ -637,7 +647,7 @@ void m6502_device::prefetch_noirq()
sync = true;
sync_w(ASSERT_LINE);
NPC = PC;
- IR = mintf->read_decrypted(PC);
+ IR = mintf->read_sync(PC);
sync = false;
sync_w(CLEAR_LINE);
PC++;
@@ -674,31 +684,33 @@ UINT8 m6502_device::mi_default_normal::read(UINT16 adr)
return program->read_byte(adr);
}
-UINT8 m6502_device::mi_default_normal::read_direct(UINT16 adr)
+UINT8 m6502_device::mi_default_normal::read_sync(UINT16 adr)
{
- return direct->read_raw_byte(adr);
+ return sdirect->read_byte(adr);
}
-UINT8 m6502_device::mi_default_normal::read_decrypted(UINT16 adr)
+UINT8 m6502_device::mi_default_normal::read_arg(UINT16 adr)
{
- return direct->read_decrypted_byte(adr);
+ return direct->read_byte(adr);
}
+
void m6502_device::mi_default_normal::write(UINT16 adr, UINT8 val)
{
program->write_byte(adr, val);
}
-UINT8 m6502_device::mi_default_nd::read_direct(UINT16 adr)
+UINT8 m6502_device::mi_default_nd::read_sync(UINT16 adr)
{
- return read(adr);
+ return sprogram->read_byte(adr);
}
-UINT8 m6502_device::mi_default_nd::read_decrypted(UINT16 adr)
+UINT8 m6502_device::mi_default_nd::read_arg(UINT16 adr)
{
- return read(adr);
+ return program->read_byte(adr);
}
+
WRITE_LINE_MEMBER( m6502_device::irq_line )
{
set_input_line( M6502_IRQ_LINE, state );
diff --git a/src/emu/cpu/m6502/m6502.h b/src/emu/cpu/m6502/m6502.h
index 240509f21ea..33b13f3afb6 100644
--- a/src/emu/cpu/m6502/m6502.h
+++ b/src/emu/cpu/m6502/m6502.h
@@ -42,14 +42,14 @@ public:
protected:
class memory_interface {
public:
- address_space *program;
- direct_read_data *direct;
+ address_space *program, *sprogram;
+ direct_read_data *direct, *sdirect;
virtual ~memory_interface() {}
virtual UINT8 read(UINT16 adr) = 0;
virtual UINT8 read_9(UINT16 adr);
- virtual UINT8 read_direct(UINT16 adr) = 0;
- virtual UINT8 read_decrypted(UINT16 adr) = 0;
+ virtual UINT8 read_sync(UINT16 adr) = 0;
+ virtual UINT8 read_arg(UINT16 adr) = 0;
virtual void write(UINT16 adr, UINT8 val) = 0;
virtual void write_9(UINT16 adr, UINT8 val);
};
@@ -58,16 +58,16 @@ protected:
public:
virtual ~mi_default_normal() {}
virtual UINT8 read(UINT16 adr);
- virtual UINT8 read_direct(UINT16 adr);
- virtual UINT8 read_decrypted(UINT16 adr);
+ virtual UINT8 read_sync(UINT16 adr);
+ virtual UINT8 read_arg(UINT16 adr);
virtual void write(UINT16 adr, UINT8 val);
};
class mi_default_nd : public mi_default_normal {
public:
virtual ~mi_default_nd() {}
- virtual UINT8 read_direct(UINT16 adr);
- virtual UINT8 read_decrypted(UINT16 adr);
+ virtual UINT8 read_sync(UINT16 adr);
+ virtual UINT8 read_arg(UINT16 adr);
};
struct disasm_entry {
@@ -77,7 +77,7 @@ protected:
};
enum {
- STATE_RESET = 0xff00,
+ STATE_RESET = 0xff00
};
enum {
@@ -151,7 +151,7 @@ protected:
virtual UINT32 disasm_max_opcode_bytes() const;
virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options);
- address_space_config program_config;
+ address_space_config program_config, sprogram_config;
UINT16 PPC; /* previous program counter */
UINT16 NPC; /* next start-of-instruction program counter */
@@ -179,9 +179,9 @@ protected:
UINT8 read_9(UINT16 adr) { return mintf->read_9(adr); }
void write(UINT16 adr, UINT8 val) { mintf->write(adr, val); }
void write_9(UINT16 adr, UINT8 val) { mintf->write_9(adr, val); }
- UINT8 read_direct(UINT16 adr) { return mintf->read_direct(adr); }
- UINT8 read_pc() { return mintf->read_direct(PC++); }
- UINT8 read_pc_noinc() { return mintf->read_direct(PC); }
+ UINT8 read_arg(UINT16 adr) { return mintf->read_arg(adr); }
+ UINT8 read_pc() { return mintf->read_arg(PC++); }
+ UINT8 read_pc_noinc() { return mintf->read_arg(PC); }
void prefetch();
void prefetch_noirq();
void set_nz(UINT8 v);
@@ -327,7 +327,7 @@ enum {
enum {
M6502_IRQ_LINE = m6502_device::IRQ_LINE,
M6502_NMI_LINE = m6502_device::NMI_LINE,
- M6502_SET_OVERFLOW = m6502_device::V_LINE,
+ M6502_SET_OVERFLOW = m6502_device::V_LINE
};
extern const device_type M6502;
diff --git a/src/emu/cpu/m6502/m6502make.py b/src/emu/cpu/m6502/m6502make.py
index 514af0e8fb8..591d01268ca 100755
--- a/src/emu/cpu/m6502/m6502make.py
+++ b/src/emu/cpu/m6502/m6502make.py
@@ -68,7 +68,7 @@ FULL_EAT_ALL="""\
"""
FULL_MEMORY="""\
-\tif(icount <= 0) { inst_substate = %(substate)s; return; }
+\tif(icount == 0) { inst_substate = %(substate)s; return; }
%(ins)s
\ticount--;
"""
@@ -97,7 +97,7 @@ case %(substate)s:;
"""
PARTIAL_MEMORY="""\
-\tif(icount <= 0) { inst_substate = %(substate)s; return; }
+\tif(icount == 0) { inst_substate = %(substate)s; return; }
case %(substate)s:
%(ins)s
\ticount--;
diff --git a/src/emu/cpu/m6502/m6504.c b/src/emu/cpu/m6502/m6504.c
index 383d0f1fecd..f2ae2c4b6d9 100644
--- a/src/emu/cpu/m6502/m6504.c
+++ b/src/emu/cpu/m6502/m6504.c
@@ -17,6 +17,7 @@ m6504_device::m6504_device(const machine_config &mconfig, const char *tag, devic
m6502_device(mconfig, M6504, "M6504", tag, owner, clock, "m6504", __FILE__)
{
program_config.m_addrbus_width = 13;
+ sprogram_config.m_addrbus_width = 13;
}
void m6504_device::device_start()
@@ -34,14 +35,14 @@ UINT8 m6504_device::mi_6504_normal::read(UINT16 adr)
return program->read_byte(adr & 0x1fff);
}
-UINT8 m6504_device::mi_6504_normal::read_direct(UINT16 adr)
+UINT8 m6504_device::mi_6504_normal::read_sync(UINT16 adr)
{
- return direct->read_raw_byte(adr & 0x1fff);
+ return sdirect->read_byte(adr & 0x1fff);
}
-UINT8 m6504_device::mi_6504_normal::read_decrypted(UINT16 adr)
+UINT8 m6504_device::mi_6504_normal::read_arg(UINT16 adr)
{
- return direct->read_decrypted_byte(adr & 0x1fff);
+ return direct->read_byte(adr & 0x1fff);
}
void m6504_device::mi_6504_normal::write(UINT16 adr, UINT8 val)
@@ -49,12 +50,12 @@ void m6504_device::mi_6504_normal::write(UINT16 adr, UINT8 val)
program->write_byte(adr & 0x1fff, val);
}
-UINT8 m6504_device::mi_6504_nd::read_direct(UINT16 adr)
+UINT8 m6504_device::mi_6504_nd::read_sync(UINT16 adr)
{
- return read(adr);
+ return sprogram->read_byte(adr & 0x1fff);
}
-UINT8 m6504_device::mi_6504_nd::read_decrypted(UINT16 adr)
+UINT8 m6504_device::mi_6504_nd::read_arg(UINT16 adr)
{
- return read(adr);
+ return program->read_byte(adr & 0x1fff);
}
diff --git a/src/emu/cpu/m6502/m6504.h b/src/emu/cpu/m6502/m6504.h
index e325240d8e9..f272b059333 100644
--- a/src/emu/cpu/m6502/m6504.h
+++ b/src/emu/cpu/m6502/m6504.h
@@ -22,16 +22,16 @@ protected:
public:
virtual ~mi_6504_normal() {}
virtual UINT8 read(UINT16 adr);
- virtual UINT8 read_direct(UINT16 adr);
- virtual UINT8 read_decrypted(UINT16 adr);
+ virtual UINT8 read_sync(UINT16 adr);
+ virtual UINT8 read_arg(UINT16 adr);
virtual void write(UINT16 adr, UINT8 val);
};
class mi_6504_nd : public mi_6504_normal {
public:
virtual ~mi_6504_nd() {}
- virtual UINT8 read_direct(UINT16 adr);
- virtual UINT8 read_decrypted(UINT16 adr);
+ virtual UINT8 read_sync(UINT16 adr);
+ virtual UINT8 read_arg(UINT16 adr);
};
virtual void device_start();
@@ -41,7 +41,7 @@ protected:
enum {
M6504_IRQ_LINE = m6502_device::IRQ_LINE,
M6504_NMI_LINE = m6502_device::NMI_LINE,
- M6504_SET_OVERFLOW = m6502_device::V_LINE,
+ M6504_SET_OVERFLOW = m6502_device::V_LINE
};
extern const device_type M6504;
diff --git a/src/emu/cpu/m6502/m6509.c b/src/emu/cpu/m6502/m6509.c
index 3c8c3436e25..77af9e8f1f7 100644
--- a/src/emu/cpu/m6502/m6509.c
+++ b/src/emu/cpu/m6502/m6509.c
@@ -18,6 +18,8 @@ m6509_device::m6509_device(const machine_config &mconfig, const char *tag, devic
{
program_config.m_addrbus_width = 20;
program_config.m_logaddr_width = 20;
+ sprogram_config.m_addrbus_width = 20;
+ sprogram_config.m_logaddr_width = 20;
}
void m6509_device::device_start()
@@ -71,9 +73,9 @@ UINT8 m6509_device::mi_6509_normal::read(UINT16 adr)
return res;
}
-UINT8 m6509_device::mi_6509_normal::read_direct(UINT16 adr)
+UINT8 m6509_device::mi_6509_normal::read_sync(UINT16 adr)
{
- UINT8 res = direct->read_raw_byte(base->adr_in_bank_i(adr));
+ UINT8 res = sdirect->read_byte(base->adr_in_bank_i(adr));
if(adr == 0x0000)
res = base->bank_i_r();
else if(adr == 0x0001)
@@ -81,9 +83,9 @@ UINT8 m6509_device::mi_6509_normal::read_direct(UINT16 adr)
return res;
}
-UINT8 m6509_device::mi_6509_normal::read_decrypted(UINT16 adr)
+UINT8 m6509_device::mi_6509_normal::read_arg(UINT16 adr)
{
- UINT8 res = direct->read_decrypted_byte(base->adr_in_bank_i(adr));
+ UINT8 res = direct->read_byte(base->adr_in_bank_i(adr));
if(adr == 0x0000)
res = base->bank_i_r();
else if(adr == 0x0001)
@@ -123,9 +125,9 @@ m6509_device::mi_6509_nd::mi_6509_nd(m6509_device *_base) : mi_6509_normal(_base
{
}
-UINT8 m6509_device::mi_6509_nd::read_direct(UINT16 adr)
+UINT8 m6509_device::mi_6509_nd::read_sync(UINT16 adr)
{
- UINT8 res = program->read_byte(base->adr_in_bank_i(adr));
+ UINT8 res = sprogram->read_byte(base->adr_in_bank_i(adr));
if(adr == 0x0000)
res = base->bank_i_r();
else if(adr == 0x0001)
@@ -133,7 +135,7 @@ UINT8 m6509_device::mi_6509_nd::read_direct(UINT16 adr)
return res;
}
-UINT8 m6509_device::mi_6509_nd::read_decrypted(UINT16 adr)
+UINT8 m6509_device::mi_6509_nd::read_arg(UINT16 adr)
{
UINT8 res = program->read_byte(base->adr_in_bank_i(adr));
if(adr == 0x0000)
diff --git a/src/emu/cpu/m6502/m6509.h b/src/emu/cpu/m6502/m6509.h
index 561a31449a4..2bfee01981a 100644
--- a/src/emu/cpu/m6502/m6509.h
+++ b/src/emu/cpu/m6502/m6509.h
@@ -32,8 +32,8 @@ protected:
virtual ~mi_6509_normal() {}
virtual UINT8 read(UINT16 adr);
virtual UINT8 read_9(UINT16 adr);
- virtual UINT8 read_direct(UINT16 adr);
- virtual UINT8 read_decrypted(UINT16 adr);
+ virtual UINT8 read_sync(UINT16 adr);
+ virtual UINT8 read_arg(UINT16 adr);
virtual void write(UINT16 adr, UINT8 val);
virtual void write_9(UINT16 adr, UINT8 val);
};
@@ -42,8 +42,8 @@ protected:
public:
mi_6509_nd(m6509_device *base);
virtual ~mi_6509_nd() {}
- virtual UINT8 read_direct(UINT16 adr);
- virtual UINT8 read_decrypted(UINT16 adr);
+ virtual UINT8 read_sync(UINT16 adr);
+ virtual UINT8 read_arg(UINT16 adr);
};
virtual void device_start();
@@ -74,7 +74,7 @@ protected:
enum {
M6509_IRQ_LINE = m6502_device::IRQ_LINE,
M6509_NMI_LINE = m6502_device::NMI_LINE,
- M6509_SET_OVERFLOW = m6502_device::V_LINE,
+ M6509_SET_OVERFLOW = m6502_device::V_LINE
};
enum {
diff --git a/src/emu/cpu/m6502/m6510.c b/src/emu/cpu/m6502/m6510.c
index dfab818bd60..10e57fb27b8 100644
--- a/src/emu/cpu/m6502/m6510.c
+++ b/src/emu/cpu/m6502/m6510.c
@@ -119,9 +119,9 @@ UINT8 m6510_device::mi_6510_normal::read(UINT16 adr)
return res;
}
-UINT8 m6510_device::mi_6510_normal::read_direct(UINT16 adr)
+UINT8 m6510_device::mi_6510_normal::read_sync(UINT16 adr)
{
- UINT8 res = direct->read_raw_byte(adr);
+ UINT8 res = sdirect->read_byte(adr);
if(adr == 0x0000)
res = base->dir_r();
else if(adr == 0x0001)
@@ -129,9 +129,9 @@ UINT8 m6510_device::mi_6510_normal::read_direct(UINT16 adr)
return res;
}
-UINT8 m6510_device::mi_6510_normal::read_decrypted(UINT16 adr)
+UINT8 m6510_device::mi_6510_normal::read_arg(UINT16 adr)
{
- UINT8 res = direct->read_decrypted_byte(adr);
+ UINT8 res = direct->read_byte(adr);
if(adr == 0x0000)
res = base->dir_r();
else if(adr == 0x0001)
@@ -152,14 +152,24 @@ m6510_device::mi_6510_nd::mi_6510_nd(m6510_device *_base) : mi_6510_normal(_base
{
}
-UINT8 m6510_device::mi_6510_nd::read_direct(UINT16 adr)
+UINT8 m6510_device::mi_6510_nd::read_sync(UINT16 adr)
{
- return read(adr);
+ UINT8 res = sprogram->read_byte(adr);
+ if(adr == 0x0000)
+ res = base->dir_r();
+ else if(adr == 0x0001)
+ res = base->port_r();
+ return res;
}
-UINT8 m6510_device::mi_6510_nd::read_decrypted(UINT16 adr)
+UINT8 m6510_device::mi_6510_nd::read_arg(UINT16 adr)
{
- return read(adr);
+ UINT8 res = program->read_byte(adr);
+ if(adr == 0x0000)
+ res = base->dir_r();
+ else if(adr == 0x0001)
+ res = base->port_r();
+ return res;
}
#include "cpu/m6502/m6510.inc"
diff --git a/src/emu/cpu/m6502/m6510.h b/src/emu/cpu/m6502/m6510.h
index 76b8a405f30..86aaa60ffaa 100644
--- a/src/emu/cpu/m6502/m6510.h
+++ b/src/emu/cpu/m6502/m6510.h
@@ -47,8 +47,8 @@ protected:
mi_6510_normal(m6510_device *base);
virtual ~mi_6510_normal() {}
virtual UINT8 read(UINT16 adr);
- virtual UINT8 read_direct(UINT16 adr);
- virtual UINT8 read_decrypted(UINT16 adr);
+ virtual UINT8 read_sync(UINT16 adr);
+ virtual UINT8 read_arg(UINT16 adr);
virtual void write(UINT16 adr, UINT8 val);
};
@@ -56,8 +56,8 @@ protected:
public:
mi_6510_nd(m6510_device *base);
virtual ~mi_6510_nd() {}
- virtual UINT8 read_direct(UINT16 adr);
- virtual UINT8 read_decrypted(UINT16 adr);
+ virtual UINT8 read_sync(UINT16 adr);
+ virtual UINT8 read_arg(UINT16 adr);
};
devcb_read8 read_port;
@@ -91,7 +91,7 @@ protected:
enum {
M6510_IRQ_LINE = m6502_device::IRQ_LINE,
- M6510_NMI_LINE = m6502_device::NMI_LINE,
+ M6510_NMI_LINE = m6502_device::NMI_LINE
};
extern const device_type M6510;
diff --git a/src/emu/cpu/m6502/m6510t.h b/src/emu/cpu/m6502/m6510t.h
index f71b9ee7287..f580ed6aef3 100644
--- a/src/emu/cpu/m6502/m6510t.h
+++ b/src/emu/cpu/m6502/m6510t.h
@@ -26,7 +26,7 @@ public:
enum {
M6510T_IRQ_LINE = m6502_device::IRQ_LINE,
- M6510T_SET_OVERFLOW = m6502_device::V_LINE,
+ M6510T_SET_OVERFLOW = m6502_device::V_LINE
};
extern const device_type M6510T;
diff --git a/src/emu/cpu/m6502/m65c02.h b/src/emu/cpu/m6502/m65c02.h
index 136664a55b5..5eda5593fee 100644
--- a/src/emu/cpu/m6502/m65c02.h
+++ b/src/emu/cpu/m6502/m65c02.h
@@ -68,7 +68,7 @@ protected:
enum {
M65C02_IRQ_LINE = m6502_device::IRQ_LINE,
M65C02_NMI_LINE = m6502_device::NMI_LINE,
- M65C02_SET_OVERFLOW = m6502_device::V_LINE,
+ M65C02_SET_OVERFLOW = m6502_device::V_LINE
};
extern const device_type M65C02;
diff --git a/src/emu/cpu/m6502/m65ce02.h b/src/emu/cpu/m6502/m65ce02.h
index c3c77d56bb8..f8e03867d82 100644
--- a/src/emu/cpu/m6502/m65ce02.h
+++ b/src/emu/cpu/m6502/m65ce02.h
@@ -139,7 +139,7 @@ protected:
enum {
M65CE02_IRQ_LINE = m6502_device::IRQ_LINE,
- M65CE02_NMI_LINE = m6502_device::NMI_LINE,
+ M65CE02_NMI_LINE = m6502_device::NMI_LINE
};
diff --git a/src/emu/cpu/m6502/m65sc02.h b/src/emu/cpu/m6502/m65sc02.h
index 7c0969cfa2a..f754fc3de89 100644
--- a/src/emu/cpu/m6502/m65sc02.h
+++ b/src/emu/cpu/m6502/m65sc02.h
@@ -21,7 +21,7 @@ public:
enum {
M65SC02_IRQ_LINE = m6502_device::IRQ_LINE,
M65SC02_NMI_LINE = m6502_device::NMI_LINE,
- M65SC02_SET_OVERFLOW = m6502_device::V_LINE,
+ M65SC02_SET_OVERFLOW = m6502_device::V_LINE
};
extern const device_type M65SC02;
diff --git a/src/emu/cpu/m6502/m740.h b/src/emu/cpu/m6502/m740.h
index 2524ffe8b30..728fea5a074 100644
--- a/src/emu/cpu/m6502/m740.h
+++ b/src/emu/cpu/m6502/m740.h
@@ -33,7 +33,7 @@ public:
M740_INT13_LINE, // (ffe2)
M740_INT14_LINE, // (ffe0)
M740_MAX_INT_LINE = M740_INT14_LINE,
- M740_SET_OVERFLOW = m6502_device::V_LINE,
+ M740_SET_OVERFLOW = m6502_device::V_LINE
};
m740_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
diff --git a/src/emu/cpu/m6502/m7501.h b/src/emu/cpu/m6502/m7501.h
index ea8c0a9b5b6..7ded4caffe2 100644
--- a/src/emu/cpu/m6502/m7501.h
+++ b/src/emu/cpu/m6502/m7501.h
@@ -26,7 +26,7 @@ public:
enum {
M7501_IRQ_LINE = m6502_device::IRQ_LINE,
- M7501_NMI_LINE = m6502_device::NMI_LINE,
+ M7501_NMI_LINE = m6502_device::NMI_LINE
};
extern const device_type M7501;
diff --git a/src/emu/cpu/m6502/m8502.h b/src/emu/cpu/m6502/m8502.h
index 2e3f4507fb3..1969ba6ffad 100644
--- a/src/emu/cpu/m6502/m8502.h
+++ b/src/emu/cpu/m6502/m8502.h
@@ -26,7 +26,7 @@ public:
enum {
M8502_IRQ_LINE = m6502_device::IRQ_LINE,
- M8502_NMI_LINE = m6502_device::NMI_LINE,
+ M8502_NMI_LINE = m6502_device::NMI_LINE
};
extern const device_type M8502;
diff --git a/src/emu/cpu/m6502/n2a03.c b/src/emu/cpu/m6502/n2a03.c
index dd29182f53c..b3b2cb31808 100644
--- a/src/emu/cpu/m6502/n2a03.c
+++ b/src/emu/cpu/m6502/n2a03.c
@@ -38,14 +38,14 @@ UINT8 n2a03_device::mi_2a03_normal::read(UINT16 adr)
return program->read_byte(adr);
}
-UINT8 n2a03_device::mi_2a03_normal::read_direct(UINT16 adr)
+UINT8 n2a03_device::mi_2a03_normal::read_sync(UINT16 adr)
{
- return direct->read_raw_byte(adr);
+ return sdirect->read_byte(adr);
}
-UINT8 n2a03_device::mi_2a03_normal::read_decrypted(UINT16 adr)
+UINT8 n2a03_device::mi_2a03_normal::read_arg(UINT16 adr)
{
- return direct->read_decrypted_byte(adr);
+ return direct->read_byte(adr);
}
void n2a03_device::mi_2a03_normal::write(UINT16 adr, UINT8 val)
@@ -58,12 +58,12 @@ UINT8 n2a03_device::mi_2a03_nd::read(UINT16 adr)
return program->read_byte(adr);
}
-UINT8 n2a03_device::mi_2a03_nd::read_direct(UINT16 adr)
+UINT8 n2a03_device::mi_2a03_nd::read_sync(UINT16 adr)
{
- return program->read_byte(adr);
+ return sprogram->read_byte(adr);
}
-UINT8 n2a03_device::mi_2a03_nd::read_decrypted(UINT16 adr)
+UINT8 n2a03_device::mi_2a03_nd::read_arg(UINT16 adr)
{
return program->read_byte(adr);
}
diff --git a/src/emu/cpu/m6502/n2a03.h b/src/emu/cpu/m6502/n2a03.h
index c2f8a7f511b..6d56a42e9b7 100644
--- a/src/emu/cpu/m6502/n2a03.h
+++ b/src/emu/cpu/m6502/n2a03.h
@@ -28,8 +28,8 @@ protected:
public:
virtual ~mi_2a03_normal() {}
virtual UINT8 read(UINT16 adr);
- virtual UINT8 read_direct(UINT16 adr);
- virtual UINT8 read_decrypted(UINT16 adr);
+ virtual UINT8 read_sync(UINT16 adr);
+ virtual UINT8 read_arg(UINT16 adr);
virtual void write(UINT16 adr, UINT8 val);
};
@@ -37,8 +37,8 @@ protected:
public:
virtual ~mi_2a03_nd() {}
virtual UINT8 read(UINT16 adr);
- virtual UINT8 read_direct(UINT16 adr);
- virtual UINT8 read_decrypted(UINT16 adr);
+ virtual UINT8 read_sync(UINT16 adr);
+ virtual UINT8 read_arg(UINT16 adr);
virtual void write(UINT16 adr, UINT8 val);
};
@@ -62,7 +62,7 @@ enum {
N2A03_IRQ_LINE = m6502_device::IRQ_LINE,
N2A03_APU_IRQ_LINE = m6502_device::APU_IRQ_LINE,
N2A03_NMI_LINE = m6502_device::NMI_LINE,
- N2A03_SET_OVERFLOW = m6502_device::V_LINE,
+ N2A03_SET_OVERFLOW = m6502_device::V_LINE
};
extern const device_type N2A03;
diff --git a/src/emu/cpu/m6502/odeco16.lst b/src/emu/cpu/m6502/odeco16.lst
index cf8b75455d6..6cea2fa7282 100644
--- a/src/emu/cpu/m6502/odeco16.lst
+++ b/src/emu/cpu/m6502/odeco16.lst
@@ -13,13 +13,13 @@ brk_16_imp
write(SP, irq_taken ? P & ~F_B : P);
dec_SP();
if(nmi_state) {
- PC = read_direct(0xfff7);
- PC = set_h(PC, read_direct(0xfff6));
+ PC = read_arg(0xfff7);
+ PC = set_h(PC, read_arg(0xfff6));
nmi_state = false;
standard_irq_callback(NMI_LINE);
} else {
- PC = read_direct(0xfff3);
- PC = set_h(PC, read_direct(0xfff2));
+ PC = read_arg(0xfff3);
+ PC = set_h(PC, read_arg(0xfff2));
if(irq_taken)
standard_irq_callback(IRQ_LINE);
}
@@ -95,7 +95,7 @@ vbl_zpg
# exceptions
reset_16
- PC = read_direct(0xfff1);
- PC = set_h(PC, read_direct(0xfff0));
+ PC = read_arg(0xfff1);
+ PC = set_h(PC, read_arg(0xfff0));
prefetch();
inst_state = -1;
diff --git a/src/emu/cpu/m6502/om6502.lst b/src/emu/cpu/m6502/om6502.lst
index f76884b554f..24c560c02fa 100644
--- a/src/emu/cpu/m6502/om6502.lst
+++ b/src/emu/cpu/m6502/om6502.lst
@@ -184,7 +184,7 @@ bcc_rel
if(!(P & F_C)) {
read_pc_noinc();
if(page_changing(PC, INT8(TMP))) {
- read_direct(set_l(PC, PC+INT8(TMP)));
+ read_arg(set_l(PC, PC+INT8(TMP)));
}
PC += INT8(TMP);
}
@@ -195,7 +195,7 @@ bcs_rel
if(P & F_C) {
read_pc_noinc();
if(page_changing(PC, INT8(TMP))) {
- read_direct(set_l(PC, PC+INT8(TMP)));
+ read_arg(set_l(PC, PC+INT8(TMP)));
}
PC += INT8(TMP);
}
@@ -206,7 +206,7 @@ beq_rel
if(P & F_Z) {
read_pc_noinc();
if(page_changing(PC, INT8(TMP))) {
- read_direct(set_l(PC, PC+INT8(TMP)));
+ read_arg(set_l(PC, PC+INT8(TMP)));
}
PC += INT8(TMP);
}
@@ -228,7 +228,7 @@ bmi_rel
if(P & F_N) {
read_pc_noinc();
if(page_changing(PC, INT8(TMP))) {
- read_direct(set_l(PC, PC+INT8(TMP)));
+ read_arg(set_l(PC, PC+INT8(TMP)));
}
PC += INT8(TMP);
}
@@ -239,7 +239,7 @@ bne_rel
if(!(P & F_Z)) {
read_pc_noinc();
if(page_changing(PC, INT8(TMP))) {
- read_direct(set_l(PC, PC+INT8(TMP)));
+ read_arg(set_l(PC, PC+INT8(TMP)));
}
PC += INT8(TMP);
}
@@ -250,7 +250,7 @@ bpl_rel
if(!(P & F_N)) {
read_pc_noinc();
if(page_changing(PC, INT8(TMP))) {
- read_direct(set_l(PC, PC+INT8(TMP)));
+ read_arg(set_l(PC, PC+INT8(TMP)));
}
PC += INT8(TMP);
}
@@ -270,13 +270,13 @@ brk_imp
write(SP, irq_taken ? P & ~F_B : P);
dec_SP();
if(nmi_state) {
- PC = read_direct(0xfffa);
- PC = set_h(PC, read_direct(0xfffb));
+ PC = read_arg(0xfffa);
+ PC = set_h(PC, read_arg(0xfffb));
nmi_state = false;
standard_irq_callback(NMI_LINE);
} else {
- PC = read_direct(0xfffe);
- PC = set_h(PC, read_direct(0xffff));
+ PC = read_arg(0xfffe);
+ PC = set_h(PC, read_arg(0xffff));
if(irq_taken)
standard_irq_callback(IRQ_LINE);
}
@@ -290,7 +290,7 @@ bvc_rel
if(!(P & F_V)) {
read_pc_noinc();
if(page_changing(PC, INT8(TMP))) {
- read_direct(set_l(PC, PC+INT8(TMP)));
+ read_arg(set_l(PC, PC+INT8(TMP)));
}
PC += INT8(TMP);
}
@@ -301,7 +301,7 @@ bvs_rel
if(P & F_V) {
read_pc_noinc();
if(page_changing(PC, INT8(TMP))) {
- read_direct(set_l(PC, PC+INT8(TMP)));
+ read_arg(set_l(PC, PC+INT8(TMP)));
}
PC += INT8(TMP);
}
@@ -1216,8 +1216,8 @@ tya_imp
# exceptions
reset
- PC = read_direct(0xfffc);
- PC = set_h(PC, read_direct(0xfffd));
+ PC = read_arg(0xfffc);
+ PC = set_h(PC, read_arg(0xfffd));
prefetch();
inst_state = -1;
diff --git a/src/emu/cpu/m6502/om65c02.lst b/src/emu/cpu/m6502/om65c02.lst
index 21bc1d4e726..d64ddcdc409 100644
--- a/src/emu/cpu/m6502/om65c02.lst
+++ b/src/emu/cpu/m6502/om65c02.lst
@@ -181,7 +181,7 @@ bra_rel
TMP = read_pc();
read_pc_noinc();
if(page_changing(PC, INT8(TMP))) {
- read_direct(set_l(PC, PC+INT8(TMP)));
+ read_arg(set_l(PC, PC+INT8(TMP)));
}
PC += INT8(TMP);
prefetch();
@@ -199,13 +199,13 @@ brk_c_imp
write(SP, irq_taken || nmi_state ? P & ~F_B : P);
dec_SP();
if(irq_taken && nmi_state) {
- PC = read_direct(0xfffa);
- PC = set_h(PC, read_direct(0xfffb));
+ PC = read_arg(0xfffa);
+ PC = set_h(PC, read_arg(0xfffb));
nmi_state = false;
standard_irq_callback(NMI_LINE);
} else {
- PC = read_direct(0xfffe);
- PC = set_h(PC, read_direct(0xffff));
+ PC = read_arg(0xfffe);
+ PC = set_h(PC, read_arg(0xffff));
if(irq_taken)
standard_irq_callback(IRQ_LINE);
}
diff --git a/src/emu/cpu/m6502/om65ce02.lst b/src/emu/cpu/m6502/om65ce02.lst
index 6fdf244a8b1..049097fded8 100644
--- a/src/emu/cpu/m6502/om65ce02.lst
+++ b/src/emu/cpu/m6502/om65ce02.lst
@@ -360,12 +360,12 @@ brk_ce_imp
write(SP, irq_taken || nmi_state ? P & ~F_B : P);
dec_SP_ce();
if(nmi_state) {
- PC = read_direct(0xfffa);
- PC = set_h(PC, read_direct(0xfffb));
+ PC = read_arg(0xfffa);
+ PC = set_h(PC, read_arg(0xfffb));
nmi_state = false;
} else {
- PC = read_direct(0xfffe);
- PC = set_h(PC, read_direct(0xffff));
+ PC = read_arg(0xfffe);
+ PC = set_h(PC, read_arg(0xffff));
}
irq_taken = false;
P = (P | F_I) & ~F_D; // Do *not* move after the prefetch
diff --git a/src/emu/cpu/m6502/om740.lst b/src/emu/cpu/m6502/om740.lst
index d944a0cbcb5..9f17dc639bf 100644
--- a/src/emu/cpu/m6502/om740.lst
+++ b/src/emu/cpu/m6502/om740.lst
@@ -99,7 +99,7 @@ bra_rel
TMP = read_pc();
read_pc_noinc();
if(page_changing(PC, INT8(TMP))) {
- read_direct(set_l(PC, PC+INT8(TMP)));
+ read_arg(set_l(PC, PC+INT8(TMP)));
}
PC += INT8(TMP);
prefetch();
@@ -112,8 +112,8 @@ jmp_zpi
prefetch();
reset740
- PC = read_direct(0xfffe);
- PC = set_h(PC, read_direct(0xffff));
+ PC = read_arg(0xfffe);
+ PC = set_h(PC, read_arg(0xffff));
prefetch();
inst_state = -1;
@@ -131,13 +131,13 @@ brk740_imp
write(SP, irq_taken ? P & ~F_B : P);
dec_SP();
if(nmi_state) {
- PC = read_direct(0xfffa);
- PC = set_h(PC, read_direct(0xfffb));
+ PC = read_arg(0xfffa);
+ PC = set_h(PC, read_arg(0xfffb));
nmi_state = false;
standard_irq_callback(NMI_LINE);
} else {
- PC = read_direct(m_irq_vector);
- PC = set_h(PC, read_direct(m_irq_vector+1));
+ PC = read_arg(m_irq_vector);
+ PC = set_h(PC, read_arg(m_irq_vector+1));
if(irq_taken)
standard_irq_callback(IRQ_LINE);
}
diff --git a/src/emu/cpu/m6502/r65c02.h b/src/emu/cpu/m6502/r65c02.h
index 19226a97b33..ed3f65f40ad 100644
--- a/src/emu/cpu/m6502/r65c02.h
+++ b/src/emu/cpu/m6502/r65c02.h
@@ -28,7 +28,7 @@ public:
enum {
R65C02_IRQ_LINE = m6502_device::IRQ_LINE,
R65C02_NMI_LINE = m6502_device::NMI_LINE,
- R65C02_SET_OVERFLOW = m6502_device::V_LINE,
+ R65C02_SET_OVERFLOW = m6502_device::V_LINE
};
extern const device_type R65C02;
diff --git a/src/emu/cpu/m6800/m6800.c b/src/emu/cpu/m6800/m6800.c
index 3cb68924929..46a7cc4a99a 100644
--- a/src/emu/cpu/m6800/m6800.c
+++ b/src/emu/cpu/m6800/m6800.c
@@ -160,14 +160,14 @@ static UINT32 timer_next;
/* opcodes. In case of system with memory mapped I/O, this function can be */
/* used to greatly speed up emulation */
/****************************************************************************/
-#define M_RDOP(Addr) ((unsigned)m_direct->read_decrypted_byte(Addr))
+#define M_RDOP(Addr) ((unsigned)m_decrypted_opcodes_direct->read_byte(Addr))
/****************************************************************************/
/* M6800_RDOP_ARG() is identical to M6800_RDOP() but it's used for reading */
/* opcode arguments. This difference can be used to support systems that */
/* use different encoding mechanisms for opcodes and opcode arguments */
/****************************************************************************/
-#define M_RDOP_ARG(Addr) ((unsigned)m_direct->read_raw_byte(Addr))
+#define M_RDOP_ARG(Addr) ((unsigned)m_direct->read_byte(Addr))
/* macros to access memory */
#define IMMBYTE(b) b = M_RDOP_ARG(PCD); PC++
@@ -535,6 +535,7 @@ const device_type HD6303Y = &device_creator<hd6303y_cpu_device>;
m6800_cpu_device::m6800_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: cpu_device(mconfig, M6800, "M6800", tag, owner, clock, "m6800", __FILE__)
, m_program_config("program", ENDIANNESS_BIG, 8, 16, 0)
+ , m_decrypted_opcodes_config("program", ENDIANNESS_BIG, 8, 16, 0)
, m_io_config("io", ENDIANNESS_BIG, 8, 9, 0)
, m_has_io(false)
, m_out_sc2_func(*this)
@@ -548,6 +549,7 @@ m6800_cpu_device::m6800_cpu_device(const machine_config &mconfig, const char *ta
m6800_cpu_device::m6800_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source, bool has_io, int clock_divider, const op_func *insn, const UINT8 *cycles, address_map_constructor internal)
: cpu_device(mconfig, type, name, tag, owner, clock, shortname, source)
, m_program_config("program", ENDIANNESS_BIG, 8, 16, 0, internal)
+ , m_decrypted_opcodes_config("program", ENDIANNESS_BIG, 8, 16, 0)
, m_io_config("io", ENDIANNESS_BIG, 8, 9, 0)
, m_has_io(has_io)
, m_out_sc2_func(*this)
@@ -625,6 +627,17 @@ hd6303y_cpu_device::hd6303y_cpu_device(const machine_config &mconfig, const char
{
}
+const address_space_config *m6800_cpu_device::memory_space_config(address_spacenum spacenum) const
+{
+ switch(spacenum)
+ {
+ case AS_PROGRAM: return &m_program_config;
+ case AS_IO: return m_has_io ? &m_io_config : NULL;
+ case AS_DECRYPTED_OPCODES: return has_configured_map(AS_DECRYPTED_OPCODES) ? &m_decrypted_opcodes_config : NULL;
+ default: return NULL;
+ }
+}
+
UINT32 m6800_cpu_device::RM16(UINT32 Addr )
{
@@ -1039,6 +1052,8 @@ void m6800_cpu_device::device_start()
{
m_program = &space(AS_PROGRAM);
m_direct = &m_program->direct();
+ m_decrypted_opcodes = has_space(AS_DECRYPTED_OPCODES) ? &space(AS_DECRYPTED_OPCODES) : m_program;
+ m_decrypted_opcodes_direct = &m_decrypted_opcodes->direct();
if ( m_has_io )
m_io = &space(AS_IO);
diff --git a/src/emu/cpu/m6800/m6800.h b/src/emu/cpu/m6800/m6800.h
index 1f7d668861b..af02be492d8 100644
--- a/src/emu/cpu/m6800/m6800.h
+++ b/src/emu/cpu/m6800/m6800.h
@@ -84,7 +84,7 @@ protected:
virtual void execute_set_input(int inputnum, int state);
// device_memory_interface overrides
- virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const { return (spacenum == AS_PROGRAM) ? &m_program_config : ( (spacenum == AS_IO && m_has_io) ? &m_io_config : NULL ); }
+ virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
// device_state_interface overrides
void state_string_export(const device_state_entry &entry, std::string &str);
@@ -95,6 +95,7 @@ protected:
virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options);
address_space_config m_program_config;
+ address_space_config m_decrypted_opcodes_config;
address_space_config m_io_config;
bool m_has_io;
@@ -115,8 +116,8 @@ protected:
int m_sc1_state;
/* Memory spaces */
- address_space *m_program;
- direct_read_data *m_direct;
+ address_space *m_program, *m_decrypted_opcodes;
+ direct_read_data *m_direct, *m_decrypted_opcodes_direct;
address_space *m_io;
const op_func *m_insn;
diff --git a/src/emu/cpu/m68000/m68000.h b/src/emu/cpu/m68000/m68000.h
index d5ab6b16b84..5279ad655ec 100644
--- a/src/emu/cpu/m68000/m68000.h
+++ b/src/emu/cpu/m68000/m68000.h
@@ -166,7 +166,7 @@ public:
virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
// address spaces
- const address_space_config m_program_config;
+ const address_space_config m_program_config, m_oprogram_config;
void define_state(void);
@@ -175,7 +175,6 @@ public:
void set_rte_callback(write_line_delegate callback);
void set_tas_write_callback(write8_delegate callback);
UINT16 get_fc();
- void set_encrypted_opcode_range(offs_t start, offs_t end);
void set_hmmu_enable(int enable);
void set_instruction_hook(read32_delegate ihook);
void set_buserror_details(UINT32 fault_addr, UINT8 rw, UINT8 fc);
@@ -263,7 +262,7 @@ public:
allowing writeback to be disabled globally or selectively
or other side effects to be implemented */
- address_space *program;
+ address_space *program, *oprogram;
/* Redirect memory calls */
@@ -278,11 +277,11 @@ public:
// class m68k_memory_interface
// {
public:
- void init8(address_space &space);
- void init16(address_space &space);
- void init32(address_space &space);
- void init32mmu(address_space &space);
- void init32hmmu(address_space &space);
+ void init8(address_space &space, address_space &ospace);
+ void init16(address_space &space, address_space &ospace);
+ void init32(address_space &space, address_space &ospace);
+ void init32mmu(address_space &space, address_space &ospace);
+ void init32hmmu(address_space &space, address_space &ospace);
offs_t opcode_xor; // Address Calculation
m68k_readimm16_delegate readimm16; // Immediate read 16 bit
@@ -322,11 +321,8 @@ public:
public:
// m68k_memory_interface memory;
- address_space *m_space;
- direct_read_data *m_direct;
-
- offs_t encrypted_start;
- offs_t encrypted_end;
+ address_space *m_space, *m_ospace;
+ direct_read_data *m_direct, *m_odirect;
UINT32 iotemp;
diff --git a/src/emu/cpu/m68000/m68kcpu.c b/src/emu/cpu/m68000/m68kcpu.c
index 62e14a0cf79..b925594825d 100644
--- a/src/emu/cpu/m68000/m68kcpu.c
+++ b/src/emu/cpu/m68000/m68kcpu.c
@@ -956,6 +956,7 @@ void m68000_base_device::init_cpu_common(void)
//this = device;//deviceparam;
program = &space(AS_PROGRAM);
+ oprogram = has_space(AS_DECRYPTED_OPCODES) ? &space(AS_DECRYPTED_OPCODES) : program;
int_ack_callback = device_irq_acknowledge_delegate(FUNC(m68000_base_device::standard_irq_callback_member), this);
/* disable all MMUs */
@@ -1230,12 +1231,6 @@ void m68000_base_device::state_string_export(const device_state_entry &entry, st
/* global access */
-void m68000_base_device::set_encrypted_opcode_range(offs_t start, offs_t end)
-{
- encrypted_start = start;
- encrypted_end = end;
-}
-
void m68000_base_device::set_hmmu_enable(int enable)
{
hmmu_enabled = enable;
@@ -1252,13 +1247,15 @@ void m68000_base_device::set_instruction_hook(read32_delegate ihook)
UINT16 m68000_base_device::m68008_read_immediate_16(offs_t address)
{
- return (m_direct->read_decrypted_byte(address) << 8) | (m_direct->read_decrypted_byte(address + 1));
+ return (m_odirect->read_byte(address) << 8) | (m_odirect->read_byte(address + 1));
}
-void m68000_base_device::init8(address_space &space)
+void m68000_base_device::init8(address_space &space, address_space &ospace)
{
m_space = &space;
m_direct = &space.direct();
+ m_ospace = &ospace;
+ m_odirect = &ospace.direct();
// m_cpustate = this;
opcode_xor = 0;
@@ -1277,12 +1274,12 @@ void m68000_base_device::init8(address_space &space)
UINT16 m68000_base_device::read_immediate_16(offs_t address)
{
- return m_direct->read_decrypted_word((address), opcode_xor);
+ return m_odirect->read_word((address), opcode_xor);
}
UINT16 m68000_base_device::simple_read_immediate_16(offs_t address)
{
- return m_direct->read_decrypted_word(address);
+ return m_odirect->read_word(address);
}
void m68000_base_device::m68000_write_byte(offs_t address, UINT8 data)
@@ -1292,10 +1289,13 @@ void m68000_base_device::m68000_write_byte(offs_t address, UINT8 data)
m_space->write_word(address & ~1, data | (data << 8), masks[address & 1]);
}
-void m68000_base_device::init16(address_space &space)
+void m68000_base_device::init16(address_space &space, address_space &ospace)
{
m_space = &space;
m_direct = &space.direct();
+ m_ospace = &ospace;
+ m_odirect = &ospace.direct();
+
opcode_xor = 0;
readimm16 = m68k_readimm16_delegate(FUNC(m68000_base_device::simple_read_immediate_16), this);
@@ -1316,10 +1316,12 @@ void m68000_base_device::init16(address_space &space)
****************************************************************************/
/* interface for 32-bit data bus (68EC020, 68020) */
-void m68000_base_device::init32(address_space &space)
+void m68000_base_device::init32(address_space &space, address_space &ospace)
{
m_space = &space;
m_direct = &space.direct();
+ m_ospace = &ospace;
+ m_odirect = &ospace.direct();
opcode_xor = WORD_XOR_BE(0);
readimm16 = m68k_readimm16_delegate(FUNC(m68000_base_device::read_immediate_16), this);
@@ -1368,7 +1370,7 @@ UINT16 m68000_base_device::read_immediate_16_mmu(offs_t address)
}
}
- return m_direct->read_decrypted_word((address), opcode_xor);
+ return m_odirect->read_word((address), opcode_xor);
}
/* potentially misaligned 16-bit reads with a 32-bit data bus (and 24-bit address bus) */
@@ -1533,10 +1535,12 @@ void m68000_base_device::writelong_d32_mmu(offs_t address, UINT32 data)
m_space->write_byte(address + 3, data);
}
-void m68000_base_device::init32mmu(address_space &space)
+void m68000_base_device::init32mmu(address_space &space, address_space &ospace)
{
m_space = &space;
m_direct = &space.direct();
+ m_ospace = &ospace;
+ m_odirect = &ospace.direct();
opcode_xor = WORD_XOR_BE(0);
readimm16 = m68k_readimm16_delegate(FUNC(m68000_base_device::read_immediate_16_mmu), this);
@@ -1577,7 +1581,7 @@ UINT16 m68000_base_device::read_immediate_16_hmmu(offs_t address)
address = hmmu_translate_addr(this, address);
}
- return m_direct->read_decrypted_word((address), opcode_xor);
+ return m_odirect->read_word((address), opcode_xor);
}
/* potentially misaligned 16-bit reads with a 32-bit data bus (and 24-bit address bus) */
@@ -1659,10 +1663,12 @@ void m68000_base_device::writelong_d32_hmmu(offs_t address, UINT32 data)
m_space->write_byte(address + 3, data);
}
-void m68000_base_device::init32hmmu(address_space &space)
+void m68000_base_device::init32hmmu(address_space &space, address_space &ospace)
{
m_space = &space;
m_direct = &space.direct();
+ m_ospace = &ospace;
+ m_odirect = &ospace.direct();
opcode_xor = WORD_XOR_BE(0);
readimm16 = m68k_readimm16_delegate(FUNC(m68000_base_device::read_immediate_16_hmmu), this);
@@ -1780,7 +1786,7 @@ void m68000_base_device::init_cpu_m68000(void)
cpu_type = CPU_TYPE_000;
// dasm_type = M68K_CPU_TYPE_68000;
- init16(*program);
+ init16(*program, *oprogram);
sr_mask = 0xa71f; /* T1 -- S -- -- I2 I1 I0 -- -- -- X N Z V C */
jump_table = m68ki_instruction_jump_table[0];
cyc_instruction = m68ki_cycles[0];
@@ -1810,7 +1816,7 @@ void m68000_base_device::init_cpu_m68008(void)
cpu_type = CPU_TYPE_008;
// dasm_type = M68K_CPU_TYPE_68008;
- init8(*program);
+ init8(*program, *oprogram);
sr_mask = 0xa71f; /* T1 -- S -- -- I2 I1 I0 -- -- -- X N Z V C */
jump_table = m68ki_instruction_jump_table[0];
cyc_instruction = m68ki_cycles[0];
@@ -1838,7 +1844,7 @@ void m68000_base_device::init_cpu_m68010(void)
cpu_type = CPU_TYPE_010;
// dasm_type = M68K_CPU_TYPE_68010;
- init16(*program);
+ init16(*program, *oprogram);
sr_mask = 0xa71f; /* T1 -- S -- -- I2 I1 I0 -- -- -- X N Z V C */
jump_table = m68ki_instruction_jump_table[1];
cyc_instruction = m68ki_cycles[1];
@@ -1865,7 +1871,7 @@ void m68000_base_device::init_cpu_m68020(void)
cpu_type = CPU_TYPE_020;
// dasm_type = M68K_CPU_TYPE_68020;
- init32(*program);
+ init32(*program, *oprogram);
sr_mask = 0xf71f; /* T1 T0 S M -- I2 I1 I0 -- -- -- X N Z V C */
jump_table = m68ki_instruction_jump_table[2];
cyc_instruction = m68ki_cycles[2];
@@ -1898,7 +1904,7 @@ void m68000_base_device::init_cpu_m68020pmmu(void)
has_fpu = 1;
- init32mmu(*program);
+ init32mmu(*program, *oprogram);
}
@@ -1911,7 +1917,7 @@ void m68000_base_device::init_cpu_m68020hmmu(void)
has_fpu = 1;
- init32hmmu(*program);
+ init32hmmu(*program, *oprogram);
}
void m68000_base_device::init_cpu_m68ec020(void)
@@ -1922,7 +1928,7 @@ void m68000_base_device::init_cpu_m68ec020(void)
// dasm_type = M68K_CPU_TYPE_68EC020;
- init32(*program);
+ init32(*program, *oprogram);
sr_mask = 0xf71f; /* T1 T0 S M -- I2 I1 I0 -- -- -- X N Z V C */
jump_table = m68ki_instruction_jump_table[2];
cyc_instruction = m68ki_cycles[2];
@@ -1951,7 +1957,7 @@ void m68000_base_device::init_cpu_m68030(void)
// dasm_type = M68K_CPU_TYPE_68030;
- init32mmu(*program);
+ init32mmu(*program, *oprogram);
sr_mask = 0xf71f; /* T1 T0 S M -- I2 I1 I0 -- -- -- X N Z V C */
jump_table = m68ki_instruction_jump_table[3];
cyc_instruction = m68ki_cycles[3];
@@ -1981,7 +1987,7 @@ void m68000_base_device::init_cpu_m68ec030(void)
// dasm_type = M68K_CPU_TYPE_68EC030;
- init32(*program);
+ init32(*program, *oprogram);
sr_mask = 0xf71f; /* T1 T0 S M -- I2 I1 I0 -- -- -- X N Z V C */
jump_table = m68ki_instruction_jump_table[3];
cyc_instruction = m68ki_cycles[3];
@@ -2011,7 +2017,7 @@ void m68000_base_device::init_cpu_m68040(void)
// dasm_type = M68K_CPU_TYPE_68040;
- init32mmu(*program);
+ init32mmu(*program, *oprogram);
sr_mask = 0xf71f; /* T1 T0 S M -- I2 I1 I0 -- -- -- X N Z V C */
jump_table = m68ki_instruction_jump_table[4];
cyc_instruction = m68ki_cycles[4];
@@ -2040,7 +2046,7 @@ void m68000_base_device::init_cpu_m68ec040(void)
// dasm_type = M68K_CPU_TYPE_68EC040;
- init32(*program);
+ init32(*program, *oprogram);
sr_mask = 0xf71f; /* T1 T0 S M -- I2 I1 I0 -- -- -- X N Z V C */
jump_table = m68ki_instruction_jump_table[4];
cyc_instruction = m68ki_cycles[4];
@@ -2069,7 +2075,7 @@ void m68000_base_device::init_cpu_m68lc040(void)
// dasm_type = M68K_CPU_TYPE_68LC040;
- init32mmu(*program);
+ init32mmu(*program, *oprogram);
sr_mask = 0xf71f; /* T1 T0 S M -- I2 I1 I0 -- -- -- X N Z V C */
jump_table = m68ki_instruction_jump_table[4];
cyc_instruction = m68ki_cycles[4];
@@ -2105,7 +2111,7 @@ void m68000_base_device::init_cpu_fscpu32(void)
// dasm_type = M68K_CPU_TYPE_FSCPU32;
- init32(*program);
+ init32(*program, *oprogram);
sr_mask = 0xf71f; /* T1 T0 S M -- I2 I1 I0 -- -- -- X N Z V C */
jump_table = m68ki_instruction_jump_table[5];
cyc_instruction = m68ki_cycles[5];
@@ -2133,7 +2139,7 @@ void m68000_base_device::init_cpu_coldfire(void)
// dasm_type = M68K_CPU_TYPE_COLDFIRE;
- init32(*program);
+ init32(*program, *oprogram);
sr_mask = 0xf71f; /* T1 T0 S M -- I2 I1 I0 -- -- -- X N Z V C */
jump_table = m68ki_instruction_jump_table[6];
cyc_instruction = m68ki_cycles[6];
@@ -2239,25 +2245,25 @@ CPU_DISASSEMBLE( dasm_coldfire )
return m68k_disassemble_raw(buffer, pc, oprom, opram, M68K_CPU_TYPE_COLDFIRE);
}
-offs_t m68000_base_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { return CPU_DISASSEMBLE_NAME(dasm_m68000)(this, buffer, pc, oprom, opram, options); };
-offs_t m68000_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { return CPU_DISASSEMBLE_NAME(dasm_m68000)(this, buffer, pc, oprom, opram, options); };
-offs_t m68301_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { return CPU_DISASSEMBLE_NAME(dasm_m68000)(this, buffer, pc, oprom, opram, options); };
-offs_t m68008_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { return CPU_DISASSEMBLE_NAME(dasm_m68008)(this, buffer, pc, oprom, opram, options); };
-offs_t m68008plcc_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { return CPU_DISASSEMBLE_NAME(dasm_m68008)(this, buffer, pc, oprom, opram, options); };
-offs_t m68010_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { return CPU_DISASSEMBLE_NAME(dasm_m68010)(this, buffer, pc, oprom, opram, options); };
-offs_t m68ec020_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { return CPU_DISASSEMBLE_NAME(dasm_m68020)(this, buffer, pc, oprom, opram, options); };
-offs_t m68020_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { return CPU_DISASSEMBLE_NAME(dasm_m68020)(this, buffer, pc, oprom, opram, options); };
-offs_t m68020fpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { return CPU_DISASSEMBLE_NAME(dasm_m68020)(this, buffer, pc, oprom, opram, options); };
-offs_t m68020pmmu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { return CPU_DISASSEMBLE_NAME(dasm_m68020)(this, buffer, pc, oprom, opram, options); };
-offs_t m68020hmmu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { return CPU_DISASSEMBLE_NAME(dasm_m68020)(this, buffer, pc, oprom, opram, options); };
-offs_t m68ec030_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { return CPU_DISASSEMBLE_NAME(dasm_m68ec030)(this, buffer, pc, oprom, opram, options); };
-offs_t m68030_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { return CPU_DISASSEMBLE_NAME(dasm_m68030)(this, buffer, pc, oprom, opram, options); };
-offs_t m68ec040_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { return CPU_DISASSEMBLE_NAME(dasm_m68ec040)(this, buffer, pc, oprom, opram, options); };
-offs_t m68lc040_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { return CPU_DISASSEMBLE_NAME(dasm_m68lc040)(this, buffer, pc, oprom, opram, options); };
-offs_t m68040_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { return CPU_DISASSEMBLE_NAME(dasm_m68040)(this, buffer, pc, oprom, opram, options); };
-offs_t scc68070_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { return CPU_DISASSEMBLE_NAME(dasm_m68000)(this, buffer, pc, oprom, opram, options); };
-offs_t fscpu32_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { return CPU_DISASSEMBLE_NAME(dasm_fscpu32)(this, buffer, pc, oprom, opram, options); };
-offs_t mcf5206e_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { return CPU_DISASSEMBLE_NAME(dasm_coldfire)(this, buffer, pc, oprom, opram, options); };
+offs_t m68000_base_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { return CPU_DISASSEMBLE_NAME(dasm_m68000)(this, buffer, pc, oprom, opram, options); }
+offs_t m68000_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { return CPU_DISASSEMBLE_NAME(dasm_m68000)(this, buffer, pc, oprom, opram, options); }
+offs_t m68301_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { return CPU_DISASSEMBLE_NAME(dasm_m68000)(this, buffer, pc, oprom, opram, options); }
+offs_t m68008_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { return CPU_DISASSEMBLE_NAME(dasm_m68008)(this, buffer, pc, oprom, opram, options); }
+offs_t m68008plcc_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { return CPU_DISASSEMBLE_NAME(dasm_m68008)(this, buffer, pc, oprom, opram, options); }
+offs_t m68010_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { return CPU_DISASSEMBLE_NAME(dasm_m68010)(this, buffer, pc, oprom, opram, options); }
+offs_t m68ec020_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { return CPU_DISASSEMBLE_NAME(dasm_m68020)(this, buffer, pc, oprom, opram, options); }
+offs_t m68020_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { return CPU_DISASSEMBLE_NAME(dasm_m68020)(this, buffer, pc, oprom, opram, options); }
+offs_t m68020fpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { return CPU_DISASSEMBLE_NAME(dasm_m68020)(this, buffer, pc, oprom, opram, options); }
+offs_t m68020pmmu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { return CPU_DISASSEMBLE_NAME(dasm_m68020)(this, buffer, pc, oprom, opram, options); }
+offs_t m68020hmmu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { return CPU_DISASSEMBLE_NAME(dasm_m68020)(this, buffer, pc, oprom, opram, options); }
+offs_t m68ec030_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { return CPU_DISASSEMBLE_NAME(dasm_m68ec030)(this, buffer, pc, oprom, opram, options); }
+offs_t m68030_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { return CPU_DISASSEMBLE_NAME(dasm_m68030)(this, buffer, pc, oprom, opram, options); }
+offs_t m68ec040_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { return CPU_DISASSEMBLE_NAME(dasm_m68ec040)(this, buffer, pc, oprom, opram, options); }
+offs_t m68lc040_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { return CPU_DISASSEMBLE_NAME(dasm_m68lc040)(this, buffer, pc, oprom, opram, options); }
+offs_t m68040_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { return CPU_DISASSEMBLE_NAME(dasm_m68040)(this, buffer, pc, oprom, opram, options); }
+offs_t scc68070_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { return CPU_DISASSEMBLE_NAME(dasm_m68000)(this, buffer, pc, oprom, opram, options); }
+offs_t fscpu32_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { return CPU_DISASSEMBLE_NAME(dasm_fscpu32)(this, buffer, pc, oprom, opram, options); }
+offs_t mcf5206e_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) { return CPU_DISASSEMBLE_NAME(dasm_coldfire)(this, buffer, pc, oprom, opram, options); }
/* Service an interrupt request and start exception processing */
@@ -2330,7 +2336,8 @@ const device_type M68K = &device_creator<m68000_base_device>;
m68000_base_device::m68000_base_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: cpu_device(mconfig, M68K, "M68K", tag, owner, clock, "m68k", __FILE__),
- m_program_config("program", ENDIANNESS_BIG, 16, 24)
+ m_program_config("program", ENDIANNESS_BIG, 16, 24),
+ m_oprogram_config("decrypted_opcodes", ENDIANNESS_BIG, 16, 24)
{
clear_all();
}
@@ -2341,7 +2348,8 @@ m68000_base_device::m68000_base_device(const machine_config &mconfig, const char
m68000_base_device::m68000_base_device(const machine_config &mconfig, const char *name, const char *tag, device_t *owner, UINT32 clock,
const device_type type, UINT32 prg_data_width, UINT32 prg_address_bits, address_map_constructor internal_map, const char *shortname, const char *source)
: cpu_device(mconfig, type, name, tag, owner, clock, shortname, source),
- m_program_config("program", ENDIANNESS_BIG, prg_data_width, prg_address_bits, 0, internal_map)
+ m_program_config("program", ENDIANNESS_BIG, prg_data_width, prg_address_bits, 0, internal_map),
+ m_oprogram_config("decrypted_opcodes", ENDIANNESS_BIG, prg_data_width, prg_address_bits, 0, internal_map)
{
clear_all();
}
@@ -2350,7 +2358,8 @@ m68000_base_device::m68000_base_device(const machine_config &mconfig, const char
m68000_base_device::m68000_base_device(const machine_config &mconfig, const char *name, const char *tag, device_t *owner, UINT32 clock,
const device_type type, UINT32 prg_data_width, UINT32 prg_address_bits, const char *shortname, const char *source)
: cpu_device(mconfig, type, name, tag, owner, clock, shortname, source),
- m_program_config("program", ENDIANNESS_BIG, prg_data_width, prg_address_bits)
+ m_program_config("program", ENDIANNESS_BIG, prg_data_width, prg_address_bits),
+ m_oprogram_config("decrypted_opcodes", ENDIANNESS_BIG, prg_data_width, prg_address_bits)
{
clear_all();
}
@@ -2443,9 +2452,6 @@ void m68000_base_device::clear_all()
m_direct = 0;
- encrypted_start = 0;
- encrypted_end = 0;
-
iotemp = 0;
save_sr = 0;
@@ -2536,12 +2542,12 @@ void m68000_base_device::execute_set_input(int inputnum, int state)
const address_space_config *m68000_base_device::memory_space_config(address_spacenum spacenum) const
{
- if (spacenum == AS_PROGRAM)
+ switch(spacenum)
{
- return &m_program_config;
+ case AS_PROGRAM: return &m_program_config;
+ case AS_DECRYPTED_OPCODES: return has_configured_map(AS_DECRYPTED_OPCODES) ? &m_oprogram_config : NULL;
+ default: return NULL;
}
-
- return NULL;
}
diff --git a/src/emu/cpu/m68000/m68kcpu.h b/src/emu/cpu/m68000/m68kcpu.h
index 03909114628..2c30bf78a98 100644
--- a/src/emu/cpu/m68000/m68kcpu.h
+++ b/src/emu/cpu/m68000/m68kcpu.h
@@ -619,33 +619,35 @@ char* m68ki_disassemble_quick(unsigned int pc, unsigned int cpu_type);
/* ======================================================================== */
-INLINE unsigned int m68k_read_immediate_32(m68000_base_device *m68k, unsigned int address)
-{
- return (m68k->/*memory.*/readimm16(address) << 16) | m68k->/*memory.*/readimm16(address + 2);
-}
-
INLINE unsigned int m68k_read_pcrelative_8(m68000_base_device *m68k, unsigned int address)
{
- if (address >= m68k->encrypted_start && address < m68k->encrypted_end)
- return ((m68k->/*memory.*/readimm16(address&~1)>>(8*(1-(address & 1))))&0xff);
-
- return m68k->/*memory.*/read8(address);
+ return ((m68k->readimm16(address&~1)>>(8*(1-(address & 1))))&0xff);
}
INLINE unsigned int m68k_read_pcrelative_16(m68000_base_device *m68k, unsigned int address)
{
- if (address >= m68k->encrypted_start && address < m68k->encrypted_end)
- return m68k->/*memory.*/readimm16(address);
+ if(address & 1)
+ return
+ (m68k->readimm16(address-1) << 8) |
+ (m68k->readimm16(address+1) >> 8);
- return m68k->/*memory.*/read16(address);
+ else
+ return
+ (m68k->readimm16(address ) );
}
INLINE unsigned int m68k_read_pcrelative_32(m68000_base_device *m68k, unsigned int address)
{
- if (address >= m68k->encrypted_start && address < m68k->encrypted_end)
- return m68k_read_immediate_32(m68k, address);
+ if(address & 1)
+ return
+ (m68k->readimm16(address-1) << 24) |
+ (m68k->readimm16(address+1) << 8) |
+ (m68k->readimm16(address+3) >> 8);
- return m68k->/*memory.*/read32(address);
+ else
+ return
+ (m68k->readimm16(address ) << 16) |
+ (m68k->readimm16(address+2) );
}
@@ -687,7 +689,7 @@ INLINE UINT32 m68ki_ic_readimm16(m68000_base_device *m68k, UINT32 address)
// do a cache fill if the line is invalid or the tags don't match
if ((!m68k->ic_valid[idx]) || (m68k->ic_address[idx] != tag))
{
- m68k->ic_data[idx] = m68k->read32(address & ~3);
+ UINT32 data = m68k->read32(address & ~3);
// printf("m68k: doing cache fill at %08x (tag %08x idx %d)\n", address, tag, idx);
@@ -695,6 +697,7 @@ INLINE UINT32 m68ki_ic_readimm16(m68000_base_device *m68k, UINT32 address)
if (!m68k->mmu_tmp_buserror_occurred)
{
m68k->ic_address[idx] = tag;
+ m68k->ic_data[idx] = data;
m68k->ic_valid[idx] = true;
}
else
diff --git a/src/emu/cpu/m6805/m6805.c b/src/emu/cpu/m6805/m6805.c
index 8df8c9416ac..b7fc47c8dfc 100644
--- a/src/emu/cpu/m6805/m6805.c
+++ b/src/emu/cpu/m6805/m6805.c
@@ -53,14 +53,14 @@
/* opcodes. In case of system with memory mapped I/O, this function can be */
/* used to greatly speed up emulation */
/****************************************************************************/
-#define M6805_RDOP(addr) ((unsigned)m_direct->read_decrypted_byte(addr))
+#define M6805_RDOP(addr) ((unsigned)m_direct->read_byte(addr))
/****************************************************************************/
/* M6805_RDOP_ARG() is identical to M6805_RDOP() but it's used for reading */
/* opcode arguments. This difference can be used to support systems that */
/* use different encoding mechanisms for opcodes and opcode arguments */
/****************************************************************************/
-#define M6805_RDOP_ARG(addr) ((unsigned)m_direct->read_raw_byte(addr))
+#define M6805_RDOP_ARG(addr) ((unsigned)m_direct->read_byte(addr))
#define SP_MASK m_sp_mask /* stack pointer mask */
#define SP_LOW m_sp_low /* stack pointer low water mark */
diff --git a/src/emu/cpu/m6809/hd6309.c b/src/emu/cpu/m6809/hd6309.c
index 027c9b7511b..5b270d26c90 100644
--- a/src/emu/cpu/m6809/hd6309.c
+++ b/src/emu/cpu/m6809/hd6309.c
@@ -313,7 +313,7 @@ offs_t hd6309_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *o
// read_operand
//-------------------------------------------------
-ATTR_FORCE_INLINE UINT8 hd6309_device::read_operand()
+inline UINT8 hd6309_device::read_operand()
{
switch(m_addressing_mode)
{
@@ -332,7 +332,7 @@ ATTR_FORCE_INLINE UINT8 hd6309_device::read_operand()
// read_operand
//-------------------------------------------------
-ATTR_FORCE_INLINE UINT8 hd6309_device::read_operand(int ordinal)
+inline UINT8 hd6309_device::read_operand(int ordinal)
{
switch(m_addressing_mode)
{
@@ -356,7 +356,7 @@ ATTR_FORCE_INLINE UINT8 hd6309_device::read_operand(int ordinal)
// write_operand
//-------------------------------------------------
-ATTR_FORCE_INLINE void hd6309_device::write_operand(UINT8 data)
+inline void hd6309_device::write_operand(UINT8 data)
{
switch(m_addressing_mode)
{
@@ -375,7 +375,7 @@ ATTR_FORCE_INLINE void hd6309_device::write_operand(UINT8 data)
// write_operand
//-------------------------------------------------
-ATTR_FORCE_INLINE void hd6309_device::write_operand(int ordinal, UINT8 data)
+inline void hd6309_device::write_operand(int ordinal, UINT8 data)
{
switch(m_addressing_mode)
{
@@ -398,7 +398,7 @@ ATTR_FORCE_INLINE void hd6309_device::write_operand(int ordinal, UINT8 data)
// bittest_register
//-------------------------------------------------
-ATTR_FORCE_INLINE UINT8 &hd6309_device::bittest_register()
+inline UINT8 &hd6309_device::bittest_register()
{
switch(m_temp_im & 0xC0)
{
@@ -414,7 +414,7 @@ ATTR_FORCE_INLINE UINT8 &hd6309_device::bittest_register()
// bittest_source
//-------------------------------------------------
-ATTR_FORCE_INLINE bool hd6309_device::bittest_source()
+inline bool hd6309_device::bittest_source()
{
return (m_temp.b.l & (1 << ((m_temp_im >> 3) & 0x07))) ? true : false;
}
@@ -424,7 +424,7 @@ ATTR_FORCE_INLINE bool hd6309_device::bittest_source()
// bittest_dest
//-------------------------------------------------
-ATTR_FORCE_INLINE bool hd6309_device::bittest_dest()
+inline bool hd6309_device::bittest_dest()
{
return (bittest_register() & (1 << ((m_temp_im >> 0) & 0x07))) ? true : false;
}
@@ -434,7 +434,7 @@ ATTR_FORCE_INLINE bool hd6309_device::bittest_dest()
// bittest_set
//-------------------------------------------------
-ATTR_FORCE_INLINE void hd6309_device::bittest_set(bool result)
+inline void hd6309_device::bittest_set(bool result)
{
if (result)
bittest_register() |= (1 << ((m_temp_im >> 0) & 0x07));
@@ -448,7 +448,7 @@ ATTR_FORCE_INLINE void hd6309_device::bittest_set(bool result)
// read_exgtfr_register
//-------------------------------------------------
-ATTR_FORCE_INLINE m6809_base_device::exgtfr_register hd6309_device::read_exgtfr_register(UINT8 reg)
+inline m6809_base_device::exgtfr_register hd6309_device::read_exgtfr_register(UINT8 reg)
{
UINT16 value = 0;
@@ -486,7 +486,7 @@ ATTR_FORCE_INLINE m6809_base_device::exgtfr_register hd6309_device::read_exgtfr_
// write_exgtfr_register
//-------------------------------------------------
-ATTR_FORCE_INLINE void hd6309_device::write_exgtfr_register(UINT8 reg, m6809_base_device::exgtfr_register value)
+inline void hd6309_device::write_exgtfr_register(UINT8 reg, m6809_base_device::exgtfr_register value)
{
switch(reg & 0x0F)
{
@@ -517,7 +517,7 @@ ATTR_FORCE_INLINE void hd6309_device::write_exgtfr_register(UINT8 reg, m6809_bas
// tfr_read
//-------------------------------------------------
-ATTR_FORCE_INLINE bool hd6309_device::tfr_read(UINT8 opcode, UINT8 arg, UINT8 &data)
+inline bool hd6309_device::tfr_read(UINT8 opcode, UINT8 arg, UINT8 &data)
{
PAIR16 *reg;
@@ -550,7 +550,7 @@ ATTR_FORCE_INLINE bool hd6309_device::tfr_read(UINT8 opcode, UINT8 arg, UINT8 &d
// tfr_write
//-------------------------------------------------
-ATTR_FORCE_INLINE bool hd6309_device::tfr_write(UINT8 opcode, UINT8 arg, UINT8 data)
+inline bool hd6309_device::tfr_write(UINT8 opcode, UINT8 arg, UINT8 data)
{
PAIR16 *reg;
@@ -789,7 +789,7 @@ bool hd6309_device::divd()
// execute_one - try to execute a single instruction
//-------------------------------------------------
-ATTR_FORCE_INLINE void hd6309_device::execute_one()
+inline void hd6309_device::execute_one()
{
switch(pop_state())
{
diff --git a/src/emu/cpu/m6809/hd6309.ops b/src/emu/cpu/m6809/hd6309.ops
index cddde7318d4..6da3a904d2b 100644
--- a/src/emu/cpu/m6809/hd6309.ops
+++ b/src/emu/cpu/m6809/hd6309.ops
@@ -14,9 +14,6 @@ MAIN:
// opcode fetch
@m_opcode = read_opcode();
- // burn delay loops
- burn_any_delay_loops();
-
// dispatch opcode
switch(m_opcode)
{
diff --git a/src/emu/cpu/m6809/konami.c b/src/emu/cpu/m6809/konami.c
index d86f44651d2..8dc2bf3ab78 100644
--- a/src/emu/cpu/m6809/konami.c
+++ b/src/emu/cpu/m6809/konami.c
@@ -120,7 +120,7 @@ offs_t konami_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT
// read_operand
//-------------------------------------------------
-inline ATTR_FORCE_INLINE UINT8 konami_cpu_device::read_operand()
+inline UINT8 konami_cpu_device::read_operand()
{
return super::read_operand();
}
@@ -130,7 +130,7 @@ inline ATTR_FORCE_INLINE UINT8 konami_cpu_device::read_operand()
// read_operand
//-------------------------------------------------
-inline ATTR_FORCE_INLINE UINT8 konami_cpu_device::read_operand(int ordinal)
+inline UINT8 konami_cpu_device::read_operand(int ordinal)
{
switch(m_addressing_mode)
{
@@ -146,7 +146,7 @@ inline ATTR_FORCE_INLINE UINT8 konami_cpu_device::read_operand(int ordinal)
// write_operand
//-------------------------------------------------
-ATTR_FORCE_INLINE void konami_cpu_device::write_operand(UINT8 data)
+inline void konami_cpu_device::write_operand(UINT8 data)
{
super::write_operand(data);
}
@@ -157,7 +157,7 @@ ATTR_FORCE_INLINE void konami_cpu_device::write_operand(UINT8 data)
// write_operand
//-------------------------------------------------
-ATTR_FORCE_INLINE void konami_cpu_device::write_operand(int ordinal, UINT8 data)
+inline void konami_cpu_device::write_operand(int ordinal, UINT8 data)
{
switch(m_addressing_mode)
{
@@ -173,7 +173,7 @@ ATTR_FORCE_INLINE void konami_cpu_device::write_operand(int ordinal, UINT8 data)
// ireg
//-------------------------------------------------
-ATTR_FORCE_INLINE UINT16 &konami_cpu_device::ireg()
+inline UINT16 &konami_cpu_device::ireg()
{
switch(m_opcode & 0x70)
{
@@ -194,7 +194,7 @@ ATTR_FORCE_INLINE UINT16 &konami_cpu_device::ireg()
// read_exgtfr_register
//-------------------------------------------------
-ATTR_FORCE_INLINE m6809_base_device::exgtfr_register konami_cpu_device::read_exgtfr_register(UINT8 reg)
+inline m6809_base_device::exgtfr_register konami_cpu_device::read_exgtfr_register(UINT8 reg)
{
exgtfr_register result;
result.word_value = 0x00FF;
@@ -217,7 +217,7 @@ ATTR_FORCE_INLINE m6809_base_device::exgtfr_register konami_cpu_device::read_exg
// write_exgtfr_register
//-------------------------------------------------
-ATTR_FORCE_INLINE void konami_cpu_device::write_exgtfr_register(UINT8 reg, m6809_base_device::exgtfr_register value)
+inline void konami_cpu_device::write_exgtfr_register(UINT8 reg, m6809_base_device::exgtfr_register value)
{
switch(reg & 0x07)
{
@@ -287,7 +287,7 @@ template<class T> T konami_cpu_device::safe_shift_left(T value, UINT32 shift)
// lmul
//-------------------------------------------------
-ATTR_FORCE_INLINE void konami_cpu_device::lmul()
+inline void konami_cpu_device::lmul()
{
PAIR result;
@@ -313,7 +313,7 @@ ATTR_FORCE_INLINE void konami_cpu_device::lmul()
// divx
//-------------------------------------------------
-ATTR_FORCE_INLINE void konami_cpu_device::divx()
+inline void konami_cpu_device::divx()
{
UINT16 result;
UINT8 remainder;
@@ -357,7 +357,7 @@ void konami_cpu_device::set_lines(UINT8 data)
// execute_one - try to execute a single instruction
//-------------------------------------------------
-ATTR_FORCE_INLINE void konami_cpu_device::execute_one()
+inline void konami_cpu_device::execute_one()
{
switch(pop_state())
{
diff --git a/src/emu/cpu/m6809/m6809.c b/src/emu/cpu/m6809/m6809.c
index 3b7fc33d94f..d69b0417453 100644
--- a/src/emu/cpu/m6809/m6809.c
+++ b/src/emu/cpu/m6809/m6809.c
@@ -113,8 +113,10 @@ m6809_base_device::m6809_base_device(const machine_config &mconfig, const char *
: cpu_device(mconfig, type, name, tag, owner, clock, shortname, source),
m_lic_func(*this),
m_program_config("program", ENDIANNESS_BIG, 8, 16),
+ m_sprogram_config("decrypted_opcodes", ENDIANNESS_BIG, 8, 16),
m_clock_divider(divider)
{
+ m_mintf = NULL;
}
@@ -124,7 +126,14 @@ m6809_base_device::m6809_base_device(const machine_config &mconfig, const char *
void m6809_base_device::device_start()
{
- m_direct = &m_addrspace[AS_PROGRAM]->direct();
+ if (!m_mintf)
+ m_mintf = new mi_default;
+
+ m_mintf->m_program = &space(AS_PROGRAM);
+ m_mintf->m_sprogram = has_space(AS_DECRYPTED_OPCODES) ? &space(AS_DECRYPTED_OPCODES) : m_mintf->m_program;
+
+ m_mintf->m_direct = &m_mintf->m_program->direct();
+ m_mintf->m_sdirect = &m_mintf->m_sprogram->direct();
m_lic_func.resolve_safe();
@@ -280,11 +289,12 @@ void m6809_base_device::device_post_load()
const address_space_config *m6809_base_device::memory_space_config(address_spacenum spacenum) const
{
- if (spacenum == AS_PROGRAM)
+ switch(spacenum)
{
- return &m_program_config;
+ case AS_PROGRAM: return &m_program_config;
+ case AS_DECRYPTED_OPCODES: return has_configured_map(AS_DECRYPTED_OPCODES) ? &m_sprogram_config : NULL;
+ default: return NULL;
}
- return NULL;
}
@@ -456,7 +466,7 @@ const char *m6809_base_device::inputnum_string(int inputnum)
// read_exgtfr_register
//-------------------------------------------------
-ATTR_FORCE_INLINE m6809_base_device::exgtfr_register m6809_base_device::read_exgtfr_register(UINT8 reg)
+m6809_base_device::exgtfr_register m6809_base_device::read_exgtfr_register(UINT8 reg)
{
exgtfr_register result;
result.byte_value = 0xFF;
@@ -483,7 +493,7 @@ ATTR_FORCE_INLINE m6809_base_device::exgtfr_register m6809_base_device::read_exg
// write_exgtfr_register
//-------------------------------------------------
-ATTR_FORCE_INLINE void m6809_base_device::write_exgtfr_register(UINT8 reg, m6809_base_device::exgtfr_register value)
+void m6809_base_device::write_exgtfr_register(UINT8 reg, m6809_base_device::exgtfr_register value)
{
switch(reg & 0x0F)
{
@@ -516,7 +526,7 @@ void m6809_base_device::log_illegal()
// execute_one - try to execute a single instruction
//-------------------------------------------------
-ATTR_FORCE_INLINE void m6809_base_device::execute_one()
+void m6809_base_device::execute_one()
{
switch(pop_state())
{
@@ -539,6 +549,28 @@ void m6809_base_device::execute_run()
}
+UINT8 m6809_base_device::mi_default::read(UINT16 adr)
+{
+ return m_program->read_byte(adr);
+}
+
+UINT8 m6809_base_device::mi_default::read_opcode(UINT16 adr)
+{
+ return m_sdirect->read_byte(adr);
+}
+
+UINT8 m6809_base_device::mi_default::read_opcode_arg(UINT16 adr)
+{
+ return m_direct->read_byte(adr);
+}
+
+
+void m6809_base_device::mi_default::write(UINT16 adr, UINT8 val)
+{
+ m_program->write_byte(adr, val);
+}
+
+
//-------------------------------------------------
// m6809_device
diff --git a/src/emu/cpu/m6809/m6809.h b/src/emu/cpu/m6809/m6809.h
index eb0633af44c..595585cd098 100644
--- a/src/emu/cpu/m6809/m6809.h
+++ b/src/emu/cpu/m6809/m6809.h
@@ -39,6 +39,27 @@ public:
DECLARE_WRITE_LINE_MEMBER( nmi_line );
protected:
+ class memory_interface {
+ public:
+ address_space *m_program, *m_sprogram;
+ direct_read_data *m_direct, *m_sdirect;
+
+ virtual ~memory_interface() {}
+ virtual UINT8 read(UINT16 adr) = 0;
+ virtual UINT8 read_opcode(UINT16 adr) = 0;
+ virtual UINT8 read_opcode_arg(UINT16 adr) = 0;
+ virtual void write(UINT16 adr, UINT8 val) = 0;
+ };
+
+ class mi_default : public memory_interface {
+ public:
+ virtual ~mi_default() {}
+ virtual UINT8 read(UINT16 adr);
+ virtual UINT8 read_opcode(UINT16 adr);
+ virtual UINT8 read_opcode_arg(UINT16 adr);
+ virtual void write(UINT16 adr, UINT8 val);
+ };
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
@@ -119,6 +140,9 @@ protected:
VECTOR_RESET_FFFE = 0xFFFE
};
+ // Memory interface
+ memory_interface * m_mintf;
+
// CPU registers
PAIR16 m_pc; // program counter
PAIR16 m_ppc; // previous program counter
@@ -147,27 +171,27 @@ protected:
devcb_write_line m_lic_func; // LIC pin on the 6809E
// eat cycles
- ATTR_FORCE_INLINE void eat(int cycles) { m_icount -= cycles; }
+ inline void eat(int cycles) { m_icount -= cycles; }
void eat_remaining();
// read a byte from given memory location
- ATTR_FORCE_INLINE UINT8 read_memory(UINT16 address) { eat(1); return m_addrspace[AS_PROGRAM]->read_byte(address); }
+ inline UINT8 read_memory(UINT16 address) { eat(1); return m_mintf->read(address); }
// write a byte to given memory location
- ATTR_FORCE_INLINE void write_memory(UINT16 address, UINT8 data) { eat(1); m_addrspace[AS_PROGRAM]->write_byte(address, data); }
+ inline void write_memory(UINT16 address, UINT8 data) { eat(1); m_mintf->write(address, data); }
// read_opcode() is like read_memory() except it is used for reading opcodes. In the case of a system
// with memory mapped I/O, this function can be used to greatly speed up emulation.
- ATTR_FORCE_INLINE UINT8 read_opcode(UINT16 address) { eat(1); return m_direct->read_decrypted_byte(address); }
+ inline UINT8 read_opcode(UINT16 address) { eat(1); return m_mintf->read_opcode(address); }
// read_opcode_arg() is identical to read_opcode() except it is used for reading opcode arguments. This
// difference can be used to support systems that use different encoding mechanisms for opcodes
// and opcode arguments.
- ATTR_FORCE_INLINE UINT8 read_opcode_arg(UINT16 address) { eat(1); return m_direct->read_raw_byte(address); }
+ inline UINT8 read_opcode_arg(UINT16 address) { eat(1); return m_mintf->read_opcode_arg(address); }
// read_opcode() and bump the program counter
- ATTR_FORCE_INLINE UINT8 read_opcode() { return read_opcode(m_pc.w++); }
- ATTR_FORCE_INLINE UINT8 read_opcode_arg() { return read_opcode_arg(m_pc.w++); }
+ inline UINT8 read_opcode() { return read_opcode(m_pc.w++); }
+ inline UINT8 read_opcode_arg() { return read_opcode_arg(m_pc.w++); }
// state stack - implemented as a UINT32
void push_state(UINT8 state) { m_state = (m_state << 8) | state; }
@@ -187,10 +211,6 @@ protected:
void write_operand(UINT8 data);
void write_operand(int ordinal, UINT8 data);
- // delay loops
- bool match_target_bytes(UINT16 address, const UINT8 *bytes, int length);
- void burn_any_delay_loops();
-
// instructions
void daa();
void mul();
@@ -219,15 +239,15 @@ protected:
template<class T> T set_flags(UINT8 mask, T r);
// branch conditions
- ATTR_FORCE_INLINE bool cond_hi() { return !(m_cc & CC_ZC); } // BHI/BLS
- ATTR_FORCE_INLINE bool cond_cc() { return !(m_cc & CC_C); } // BCC/BCS
- ATTR_FORCE_INLINE bool cond_ne() { return !(m_cc & CC_Z); } // BNE/BEQ
- ATTR_FORCE_INLINE bool cond_vc() { return !(m_cc & CC_V); } // BVC/BVS
- ATTR_FORCE_INLINE bool cond_pl() { return !(m_cc & CC_N); } // BPL/BMI
- ATTR_FORCE_INLINE bool cond_ge() { return (m_cc & CC_N ? true : false) == (m_cc & CC_V ? true : false); } // BGE/BLT
- ATTR_FORCE_INLINE bool cond_gt() { return cond_ge() && !(m_cc & CC_Z); } // BGT/BLE
- ATTR_FORCE_INLINE void set_cond(bool cond) { m_cond = cond; }
- ATTR_FORCE_INLINE bool branch_taken() { return m_cond; }
+ inline bool cond_hi() { return !(m_cc & CC_ZC); } // BHI/BLS
+ inline bool cond_cc() { return !(m_cc & CC_C); } // BCC/BCS
+ inline bool cond_ne() { return !(m_cc & CC_Z); } // BNE/BEQ
+ inline bool cond_vc() { return !(m_cc & CC_V); } // BVC/BVS
+ inline bool cond_pl() { return !(m_cc & CC_N); } // BPL/BMI
+ inline bool cond_ge() { return (m_cc & CC_N ? true : false) == (m_cc & CC_V ? true : false); } // BGE/BLT
+ inline bool cond_gt() { return cond_ge() && !(m_cc & CC_Z); } // BGT/BLE
+ inline void set_cond(bool cond) { m_cond = cond; }
+ inline bool branch_taken() { return m_cond; }
// interrupt registers
bool firq_saves_entire_state() { return false; }
@@ -235,8 +255,8 @@ protected:
UINT16 entire_state_registers() { return 0xFF; }
// miscellaneous
- exgtfr_register read_exgtfr_register(UINT8 reg);
- void write_exgtfr_register(UINT8 reg, exgtfr_register value);
+ inline exgtfr_register read_exgtfr_register(UINT8 reg);
+ inline void write_exgtfr_register(UINT8 reg, exgtfr_register value);
bool is_register_addressing_mode();
bool is_ea_addressing_mode() { return m_addressing_mode == ADDRESSING_MODE_EA; }
UINT16 get_pending_interrupt();
@@ -245,7 +265,7 @@ protected:
private:
// address spaces
const address_space_config m_program_config;
- direct_read_data * m_direct;
+ const address_space_config m_sprogram_config;
// other state
UINT32 m_state;
@@ -255,7 +275,7 @@ private:
int m_clock_divider;
// functions
- void execute_one();
+ inline void execute_one();
const char *inputnum_string(int inputnum);
};
diff --git a/src/emu/cpu/m6809/m6809.ops b/src/emu/cpu/m6809/m6809.ops
index 49fe45644b9..96b9f6c11a7 100644
--- a/src/emu/cpu/m6809/m6809.ops
+++ b/src/emu/cpu/m6809/m6809.ops
@@ -16,9 +16,6 @@ MAIN:
@m_opcode = read_opcode();
m_lic_func(CLEAR_LINE);
- // burn delay loops
- burn_any_delay_loops();
-
// dispatch opcode
switch(m_opcode)
{
diff --git a/src/emu/cpu/m6809/m6809inl.h b/src/emu/cpu/m6809/m6809inl.h
index 4959bcb7fda..8fd1cfe330d 100644
--- a/src/emu/cpu/m6809/m6809inl.h
+++ b/src/emu/cpu/m6809/m6809inl.h
@@ -126,48 +126,6 @@ inline ATTR_FORCE_INLINE void m6809_base_device::write_operand(int ordinal, UINT
//-------------------------------------------------
-// match_target_bytes
-//-------------------------------------------------
-
-inline ATTR_FORCE_INLINE bool m6809_base_device::match_target_bytes(UINT16 address, const UINT8 *bytes, int length)
-{
- UINT8 *start_raw = (UINT8 *) m_direct->read_raw_ptr(address);
- UINT8 *start_decrypted = (UINT8 *) m_direct->read_decrypted_ptr(address);
- UINT8 *end_raw = (UINT8 *) m_direct->read_raw_ptr(address + length - 1);
- UINT8 *end_decrypted = (UINT8 *) m_direct->read_decrypted_ptr(address + length - 1);
-
- return (start_raw != NULL)
- && (end_raw != NULL)
- && (start_raw == start_decrypted)
- && (end_raw == end_decrypted)
- && (start_raw + length - 1 == end_raw)
- && !memcmp(start_raw, bytes, length);
-}
-
-
-//-------------------------------------------------
-// burn_any_delay_loops - optimization for delay
-// loops
-//-------------------------------------------------
-
-inline ATTR_FORCE_INLINE void m6809_base_device::burn_any_delay_loops()
-{
- static const UINT8 target_bytes[] = { 0x30, 0x1F, 0x26, 0xFC };
-
- if ((m_opcode == 0x26)
- && !(m_cc & CC_Z)
- && !(machine().debug_flags & DEBUG_FLAG_CALL_HOOK)
- && match_target_bytes(m_pc.w - 3, target_bytes, ARRAY_LENGTH(target_bytes)))
- {
- // LEAX -1,X ; BNE *
- UINT16 burned_loops = MIN((int) m_x.w - 1, m_icount / 8);
- m_x.w -= burned_loops;
- eat(burned_loops * 8);
- }
-}
-
-
-//-------------------------------------------------
// daa - decimal arithmetic adjustment instruction
//-------------------------------------------------
diff --git a/src/emu/cpu/mb86233/mb86233.c b/src/emu/cpu/mb86233/mb86233.c
index c9ccd6e31ad..0ad34296064 100644
--- a/src/emu/cpu/mb86233/mb86233.c
+++ b/src/emu/cpu/mb86233/mb86233.c
@@ -69,7 +69,7 @@ offs_t mb86233_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UIN
#define GETBRAM() m_BRAM
#define GETREPCNT() m_repcnt
-#define ROPCODE(a) m_direct->read_decrypted_dword(a<<2)
+#define ROPCODE(a) m_direct->read_dword(a<<2)
#define RDMEM(a) m_program->read_dword((a<<2))
#define WRMEM(a,v) m_program->write_dword((a<<2), v)
diff --git a/src/emu/cpu/mb88xx/mb88xx.c b/src/emu/cpu/mb88xx/mb88xx.c
index 2bd49a6374d..0508bfad1d4 100644
--- a/src/emu/cpu/mb88xx/mb88xx.c
+++ b/src/emu/cpu/mb88xx/mb88xx.c
@@ -47,7 +47,7 @@ const device_type MB8844 = &device_creator<mb8844_cpu_device>;
MACROS
***************************************************************************/
-#define READOP(a) (m_direct->read_decrypted_byte(a))
+#define READOP(a) (m_direct->read_byte(a))
#define RDMEM(a) (m_data->read_byte(a))
#define WRMEM(a,v) (m_data->write_byte((a), (v)))
diff --git a/src/emu/cpu/mc68hc11/hc11dasm.c b/src/emu/cpu/mc68hc11/hc11dasm.c
index bab28c654bc..eed3df13c5e 100644
--- a/src/emu/cpu/mc68hc11/hc11dasm.c
+++ b/src/emu/cpu/mc68hc11/hc11dasm.c
@@ -25,7 +25,7 @@ enum
EA_IND_Y_IMM8_REL,
PAGE2,
PAGE3,
- PAGE4,
+ PAGE4
};
struct M68HC11_OPCODE {
diff --git a/src/emu/cpu/mc68hc11/mc68hc11.c b/src/emu/cpu/mc68hc11/mc68hc11.c
index 1ead2b94fdf..f05d9126334 100644
--- a/src/emu/cpu/mc68hc11/mc68hc11.c
+++ b/src/emu/cpu/mc68hc11/mc68hc11.c
@@ -300,13 +300,13 @@ void mc68hc11_cpu_device::hc11_regs_w(UINT32 address, UINT8 value)
UINT8 mc68hc11_cpu_device::FETCH()
{
- return m_direct->read_decrypted_byte(m_pc++);
+ return m_direct->read_byte(m_pc++);
}
UINT16 mc68hc11_cpu_device::FETCH16()
{
UINT16 w;
- w = (m_direct->read_decrypted_byte(m_pc) << 8) | (m_direct->read_decrypted_byte(m_pc+1));
+ w = (m_direct->read_byte(m_pc) << 8) | (m_direct->read_byte(m_pc+1));
m_pc += 2;
return w;
}
diff --git a/src/emu/cpu/mcs48/mcs48.c b/src/emu/cpu/mcs48/mcs48.c
index 6025ffe07cd..a24cf72f0d6 100644
--- a/src/emu/cpu/mcs48/mcs48.c
+++ b/src/emu/cpu/mcs48/mcs48.c
@@ -348,7 +348,7 @@ offs_t upi41_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8
UINT8 mcs48_cpu_device::opcode_fetch()
{
- return m_direct->read_decrypted_byte(m_pc++);
+ return m_direct->read_byte(m_pc++);
}
@@ -359,7 +359,7 @@ UINT8 mcs48_cpu_device::opcode_fetch()
UINT8 mcs48_cpu_device::argument_fetch()
{
- return m_direct->read_raw_byte(m_pc++);
+ return m_direct->read_byte(m_pc++);
}
diff --git a/src/emu/cpu/mcs51/mcs51.c b/src/emu/cpu/mcs51/mcs51.c
index d3c73ecf0c6..3b791f2b78c 100644
--- a/src/emu/cpu/mcs51/mcs51.c
+++ b/src/emu/cpu/mcs51/mcs51.c
@@ -145,7 +145,7 @@ enum
FEATURE_I8052 = 0x01,
FEATURE_CMOS = 0x02,
FEATURE_I80C52 = 0x04,
- FEATURE_DS5002FP = 0x08,
+ FEATURE_DS5002FP = 0x08
};
/* Internal address in SFR of registers */
@@ -198,7 +198,7 @@ enum
ADDR_TA = 0xc7,
ADDR_RNR = 0xcf,
ADDR_RPCTL = 0xd8,
- ADDR_RPS = 0xda,
+ ADDR_RPS = 0xda
};
@@ -217,7 +217,7 @@ enum
V_TF2 = 0x02b, /* Timer 2 Overflow */
/* DS5002FP */
- V_PFI = 0x02b, /* Power Failure Interrupt */
+ V_PFI = 0x02b /* Power Failure Interrupt */
};
@@ -379,8 +379,8 @@ ds5002fp_device::ds5002fp_device(const machine_config &mconfig, const char *tag,
***************************************************************************/
/* Read Opcode/Opcode Arguments from Program Code */
-#define ROP(pc) m_direct->read_decrypted_byte(pc)
-#define ROP_ARG(pc) m_direct->read_raw_byte(pc)
+#define ROP(pc) m_direct->read_byte(pc)
+#define ROP_ARG(pc) m_direct->read_byte(pc)
/* Read a byte from External Code Memory (Usually Program Rom(s) Space) */
#define CODEMEM_R(a) (UINT8)m_program->read_byte(a)
@@ -1996,7 +1996,7 @@ void mcs51_cpu_device::execute_run()
/* Read next opcode */
PPC = PC;
debugger_instruction_hook(this, PC);
- op = m_direct->read_decrypted_byte(PC++);
+ op = m_direct->read_byte(PC++);
/* process opcode and count cycles */
m_inst_cycles = mcs51_cycles[op];
diff --git a/src/emu/cpu/mcs51/mcs51.h b/src/emu/cpu/mcs51/mcs51.h
index 89caacafa49..e8effbbd950 100644
--- a/src/emu/cpu/mcs51/mcs51.h
+++ b/src/emu/cpu/mcs51/mcs51.h
@@ -48,7 +48,7 @@ enum
MCS51_T2_LINE, /* P1.0: Timer 2 External Input */
MCS51_T2EX_LINE, /* P1.1: Timer 2 Capture Reload Trigger */
- DS5002FP_PFI_LINE, /* DS5002FP Power fail interrupt */
+ DS5002FP_PFI_LINE /* DS5002FP Power fail interrupt */
};
/* special I/O space ports */
@@ -59,7 +59,7 @@ enum
MCS51_PORT_P1 = 0x20001,
MCS51_PORT_P2 = 0x20002,
MCS51_PORT_P3 = 0x20003,
- MCS51_PORT_TX = 0x20004, /* P3.1 */
+ MCS51_PORT_TX = 0x20004 /* P3.1 */
};
/* At least CMOS devices may be forced to read from ports configured as output.
diff --git a/src/emu/cpu/mcs51/mcs51dasm.c b/src/emu/cpu/mcs51/mcs51dasm.c
index 0d16048855f..9c0758c4e35 100644
--- a/src/emu/cpu/mcs51/mcs51dasm.c
+++ b/src/emu/cpu/mcs51/mcs51dasm.c
@@ -34,7 +34,7 @@ enum
FEATURE_CMOS = 0x02,
FEATURE_I80C52 = 0x04,
FEATURE_DS5002FP = 0x08,
- FEATURE_I83C751 = 0x08,
+ FEATURE_I83C751 = 0x08
};
diff --git a/src/emu/cpu/mcs96/i8xc196.c b/src/emu/cpu/mcs96/i8xc196.c
index 8e80da19cdb..19553280de2 100644
--- a/src/emu/cpu/mcs96/i8xc196.c
+++ b/src/emu/cpu/mcs96/i8xc196.c
@@ -69,4 +69,8 @@ UINT16 i8xc196_device::io_r16(UINT8 adr)
return data;
}
+void i8xc196_device::do_exec_partial()
+{
+}
+
#include "cpu/mcs96/i8xc196.inc"
diff --git a/src/emu/cpu/mcs96/i8xc196.h b/src/emu/cpu/mcs96/i8xc196.h
index cb41e693fe8..299f6c9128d 100644
--- a/src/emu/cpu/mcs96/i8xc196.h
+++ b/src/emu/cpu/mcs96/i8xc196.h
@@ -23,7 +23,6 @@ public:
virtual void do_exec_full();
virtual void do_exec_partial();
- virtual void next(int cycles);
virtual void io_w8(UINT8 adr, UINT8 data);
virtual void io_w16(UINT8 adr, UINT16 data);
virtual UINT8 io_r8(UINT8 adr);
diff --git a/src/emu/cpu/mcs96/mcs96.h b/src/emu/cpu/mcs96/mcs96.h
index 3f91c0b64ea..31e90d137ca 100644
--- a/src/emu/cpu/mcs96/mcs96.h
+++ b/src/emu/cpu/mcs96/mcs96.h
@@ -22,7 +22,7 @@ public:
protected:
enum {
STATE_FETCH = 0x200,
- STATE_FETCH_NOIRQ = 0x201,
+ STATE_FETCH_NOIRQ = 0x201
};
enum {
@@ -32,7 +32,7 @@ protected:
F_VT = 0x1000,
F_V = 0x2000,
F_N = 0x4000,
- F_Z = 0x8000,
+ F_Z = 0x8000
};
struct disasm_entry {
@@ -65,7 +65,7 @@ protected:
DASM_indirect_3, /* Indirect, normal or auto-incrementing, 3 operators */
DASM_indexed_1, /* Indexed, short or long, 1 operator */
DASM_indexed_2, /* Indexed, short or long, 2 operators */
- DASM_indexed_3, /* Indexed, short or long, 3 operators */
+ DASM_indexed_3 /* Indexed, short or long, 3 operators */
};
// device-level overrides
@@ -119,7 +119,7 @@ protected:
inline void next(int cycles) { icount -= cycles_scaling*cycles; inst_state = STATE_FETCH; }
inline void next_noirq(int cycles) { icount -= cycles_scaling*cycles; inst_state = STATE_FETCH_NOIRQ; }
void check_irq();
- inline UINT8 read_pc() { return direct->read_decrypted_byte(PC++); }
+ inline UINT8 read_pc() { return direct->read_byte(PC++); }
void reg_w8(UINT8 adr, UINT8 data);
void reg_w16(UINT8 adr, UINT16 data);
diff --git a/src/emu/cpu/melps4/m58846.c b/src/emu/cpu/melps4/m58846.c
index e4842d28a6a..4d892d38307 100644
--- a/src/emu/cpu/melps4/m58846.c
+++ b/src/emu/cpu/melps4/m58846.c
@@ -4,14 +4,9 @@
Mitsubishi M58846 MCU
- TODO:
- - o hai
-
*/
#include "m58846.h"
-#include "debugger.h"
-
const device_type M58846 = &device_creator<m58846_device>;
@@ -30,7 +25,7 @@ ADDRESS_MAP_END
// device definitions
m58846_device::m58846_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : melps4_cpu_device(mconfig, M58846, "M58846", tag, owner, clock, 11, ADDRESS_MAP_NAME(program_2kx9), 7, ADDRESS_MAP_NAME(data_128x4), "m58846", __FILE__)
+ : melps4_cpu_device(mconfig, M58846, "M58846", tag, owner, clock, 11, ADDRESS_MAP_NAME(program_2kx9), 7, ADDRESS_MAP_NAME(data_128x4), 12 /* number of D pins */, 2 /* subroutine page */, 1 /* interrupt page */, "m58846", __FILE__)
{ }
@@ -50,10 +45,7 @@ offs_t m58846_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *o
void m58846_device::device_start()
{
melps4_cpu_device::device_start();
-
- // set fixed state
- m_bm_page = 2;
- m_int_page = 1;
+ m_timer = timer_alloc(0);
}
@@ -65,6 +57,58 @@ void m58846_device::device_start()
void m58846_device::device_reset()
{
melps4_cpu_device::device_reset();
+ reset_timer();
+}
+
+
+
+//-------------------------------------------------
+// timers
+//-------------------------------------------------
+
+void m58846_device::reset_timer()
+{
+ attotime base = attotime::from_ticks(6, unscaled_clock());
+ m_timer->adjust(base);
+}
+
+void m58846_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
+{
+ if (id != 0)
+ return;
+
+ // timer 1: 7-bit fixed counter (manual specifically says 127)
+ if (++m_tmr_count[0] == 127)
+ {
+ m_tmr_count[0] = 0;
+ m_irqflag[1] = true;
+ m_possible_irq = true;
+ }
+
+ // timer 2: 8-bit user defined counter with auto-reload
+ if (m_v & 8 && ++m_tmr_count[1] == 0)
+ {
+ m_tmr_count[1] = m_tmr_reload;
+ m_irqflag[2] = true;
+ m_possible_irq = true;
+ m_port_t ^= 1;
+ m_write_t(m_port_t);
+ }
+
+ // schedule next timeout
+ reset_timer();
+}
+
+void m58846_device::write_v(UINT8 data)
+{
+ // d0: enable timer 1 irq
+ // d1: enable timer 2 irq? (TODO)
+ // d2: ?
+ // d3: timer 2 enable
+ m_tmr_irq_enabled[0] = (data & 1) ? true : false;
+ m_possible_irq = true;
+
+ m_v = data;
}
@@ -76,7 +120,7 @@ void m58846_device::device_reset()
void m58846_device::execute_one()
{
// handle one opcode
- switch (m_op & 0xf0)
+ switch (m_op & 0x1f0)
{
case 0x30: op_sey(); break;
case 0x70: op_sp(); break;
@@ -86,7 +130,7 @@ void m58846_device::execute_one()
case 0xc0: case 0xd0: case 0xe0: case 0xf0: op_lxy(); break;
default:
- switch (m_op & 0xfc)
+ switch (m_op & 0x1fc)
{
case 0x20: op_szb(); break;
case 0x4c: op_sb(); break;
@@ -111,6 +155,7 @@ void m58846_device::execute_one()
case 0x03: op_dey(); break;
case 0x04: op_di(); break;
case 0x05: op_ei(); break;
+ case 0x09: op_tabe(); break; // undocumented
case 0x0a: op_am(); break;
case 0x0b: op_ose(); break;
case 0x0c: op_tya(); break;
@@ -123,6 +168,8 @@ void m58846_device::execute_one()
case 0x15: op_sd(); break;
case 0x16: op_tepa(); break;
case 0x17: op_ospa(); break;
+ case 0x18: op_rl(); break; // undocumented
+ case 0x19: op_rr(); break; // undocumented
case 0x1a: op_teab(); break;
case 0x1b: op_osab(); break;
case 0x1c: op_tba(); break;
@@ -157,10 +204,10 @@ void m58846_device::execute_one()
break;
}
- break; // 0xff
+ break; // 0x1ff
}
- break; // 0xfc
+ break; // 0x1fc
} // big switch
}
diff --git a/src/emu/cpu/melps4/m58846.h b/src/emu/cpu/melps4/m58846.h
index 7ee094df568..25d850b455e 100644
--- a/src/emu/cpu/melps4/m58846.h
+++ b/src/emu/cpu/melps4/m58846.h
@@ -29,6 +29,13 @@ protected:
// device_disasm_interface overrides
virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options);
+
+ // timers
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
+ virtual void write_v(UINT8 data);
+
+ emu_timer *m_timer;
+ void reset_timer();
};
diff --git a/src/emu/cpu/melps4/melps4.c b/src/emu/cpu/melps4/melps4.c
index b9172f7745d..b7390eaccf5 100644
--- a/src/emu/cpu/melps4/melps4.c
+++ b/src/emu/cpu/melps4/melps4.c
@@ -23,19 +23,23 @@
*M58496: 72-pin QFP CMOS, 2Kx10 ROM, 128x4 internal + 256x4 external RAM, 1 timer, low-power
*M58497: almost same as M58496
- MELPS 760 subfamily has more differences, document them when needed.
+ MELPS 760 family has more differences, document them when needed.
+ MELPS 720 family as well
References:
- - 1982 Mitsubishi LSI Data Book
+ - 1980 and 1982 Mitsubishi LSI Data Books
+ - M34550Mx-XXXFP datasheet (this one is MELPS 720 family)
+
+ TODO:
+ - need more drivers that use this, to be sure that emulation is accurate
+ - add output PLA
*/
#include "melps4.h"
#include "debugger.h"
-#include "melps4op.inc"
-
// disasm
void melps4_cpu_device::state_string_export(const device_state_entry &entry, std::string &str)
@@ -44,11 +48,15 @@ void melps4_cpu_device::state_string_export(const device_state_entry &entry, std
{
// obviously not from a single flags register, letters are made up
case STATE_GENFLAGS:
- strprintf(str, "%c%c%c%c",
+ strprintf(str, "%c%c%c%c%c %c%c%c",
m_intp ? 'P':'p',
m_inte ? 'I':'i',
+ m_sm ? 'S':'s',
m_cps ? 'D':'d',
- m_cy ? 'C':'c'
+ m_cy ? 'C':'c',
+ m_irqflag[0] ? 'X':'.', // exf
+ m_irqflag[1] ? '1':'.', // 1f
+ m_irqflag[2] ? '2':'.' // 2f
);
break;
@@ -74,6 +82,20 @@ void melps4_cpu_device::device_start()
m_data = &space(AS_DATA);
m_prgmask = (1 << m_prgwidth) - 1;
m_datamask = (1 << m_datawidth) - 1;
+ m_d_mask = (1 << m_d_pins) - 1;
+
+ // resolve callbacks
+ m_read_k.resolve_safe(0);
+ m_read_d.resolve_safe(0);
+ m_read_s.resolve_safe(0);
+ m_read_f.resolve_safe(0);
+
+ m_write_d.resolve_safe();
+ m_write_s.resolve_safe();
+ m_write_f.resolve_safe();
+ m_write_g.resolve_safe();
+ m_write_u.resolve_safe();
+ m_write_t.resolve_safe();
// zerofill
m_pc = 0;
@@ -83,10 +105,27 @@ void melps4_cpu_device::device_start()
m_prev_op = 0;
m_bitmask = 0;
+ m_port_d = 0;
+ m_port_s = 0;
+ m_port_f = 0;
+ m_port_t = 0;
+
+ m_sm = m_sms = false;
+ m_ba_flag = false;
+ m_sp_param = 0;
m_cps = 0;
m_skip = false;
m_inte = 0;
m_intp = 1;
+ m_irqflag[0] = m_irqflag[1] = m_irqflag[2] = false;
+ m_int_state = 0;
+ m_t_in_state = 0;
+ m_prohibit_irq = false;
+ m_possible_irq = false;
+
+ memset(m_tmr_count, 0, sizeof(m_tmr_count));
+ m_tmr_reload = 0;
+ m_tmr_irq_enabled[0] = m_tmr_irq_enabled[1] = false;
m_a = 0;
m_b = 0;
@@ -110,10 +149,28 @@ void melps4_cpu_device::device_start()
save_item(NAME(m_prev_op));
save_item(NAME(m_bitmask));
+ save_item(NAME(m_port_d));
+ save_item(NAME(m_port_s));
+ save_item(NAME(m_port_f));
+ save_item(NAME(m_port_t));
+
+ save_item(NAME(m_sm));
+ save_item(NAME(m_sms));
+ save_item(NAME(m_ba_flag));
+ save_item(NAME(m_sp_param));
save_item(NAME(m_cps));
save_item(NAME(m_skip));
save_item(NAME(m_inte));
save_item(NAME(m_intp));
+ save_item(NAME(m_irqflag));
+ save_item(NAME(m_int_state));
+ save_item(NAME(m_t_in_state));
+ save_item(NAME(m_prohibit_irq));
+ save_item(NAME(m_possible_irq));
+
+ save_item(NAME(m_tmr_count));
+ save_item(NAME(m_tmr_reload));
+ save_item(NAME(m_tmr_irq_enabled));
save_item(NAME(m_a));
save_item(NAME(m_b));
@@ -131,7 +188,7 @@ void melps4_cpu_device::device_start()
// register state for debugger
state_add(STATE_GENPC, "curpc", m_pc).formatstr("%04X").noshow();
- state_add(STATE_GENFLAGS, "GENFLAGS", m_cy).formatstr("%4s").noshow();
+ state_add(STATE_GENFLAGS, "GENFLAGS", m_cy).formatstr("%9s").noshow();
state_add(MELPS4_PC, "PC", m_pc).formatstr("%04X");
state_add(MELPS4_A, "A", m_a).formatstr("%2d"); // show in decimal
@@ -158,14 +215,171 @@ void melps4_cpu_device::device_start()
void melps4_cpu_device::device_reset()
{
+ m_sm = m_sms = false;
+ m_ba_flag = false;
+ m_skip = false;
m_op = m_prev_op = 0;
m_pc = m_prev_pc = 0;
+ op_lcps(); // CPS=0
+
+ // clear interrupts
m_inte = 0;
m_intp = 1;
- op_lcps(); // CPS=0
+ write_v(0);
+ write_w(0);
+ m_irqflag[0] = m_irqflag[1] = m_irqflag[2] = false;
+ m_prohibit_irq = false;
+ m_possible_irq = false;
+
+ // clear ports
+ write_d_pin(MELPS4_PORTD_CLR, 0);
+ write_gen_port(MELPS4_PORTS, 0);
+ write_gen_port(MELPS4_PORTF, 0);
+ write_gen_port(MELPS4_PORTG, 0);
+ write_gen_port(MELPS4_PORTU, 0);
+ m_write_t(0); m_port_t = 0;
+}
- m_v = 0;
- m_w = 0;
+
+
+//-------------------------------------------------
+// i/o handling
+//-------------------------------------------------
+
+UINT8 melps4_cpu_device::read_gen_port(int port)
+{
+ // input generic port
+ switch (port)
+ {
+ case MELPS4_PORTS:
+ return m_port_s | m_read_s(port, 0xff);
+ case MELPS4_PORTF:
+ return m_port_f | (m_read_f(port, 0xff) & 0xf);
+
+ default:
+ break;
+ }
+
+ return 0;
+}
+
+void melps4_cpu_device::write_gen_port(int port, UINT8 data)
+{
+ // output generic port
+ switch (port)
+ {
+ case MELPS4_PORTS:
+ m_port_s = data;
+ m_write_s(port, data, 0xff);
+ break;
+ case MELPS4_PORTF:
+ m_port_f = data & 0xf;
+ m_write_f(port, data & 0xf, 0xff);
+ break;
+ case MELPS4_PORTG:
+ m_write_g(port, data & 0xf, 0xff);
+ break;
+ case MELPS4_PORTU:
+ m_write_u(port, data & 1, 0xff);
+ break;
+
+ default:
+ break;
+ }
+}
+
+int melps4_cpu_device::read_d_pin(int bit)
+{
+ // read port D, return state of selected pin
+ bit &= 0xf;
+ UINT16 d = (m_port_d | m_read_d(bit, 0xffff)) & m_d_mask;
+ return d >> bit & 1;
+}
+
+void melps4_cpu_device::write_d_pin(int bit, int state)
+{
+ // clear all port D pins
+ if (bit == MELPS4_PORTD_CLR)
+ {
+ m_port_d = 0;
+ m_write_d(bit, 0, 0xffff);
+ }
+
+ // set/reset one port D pin
+ else
+ {
+ bit &= 0xf;
+ m_port_d = ((m_port_d & (~(1 << bit))) | (state << bit)) & m_d_mask;
+ m_write_d(bit, m_port_d, 0xffff);
+ }
+}
+
+
+
+//-------------------------------------------------
+// interrupts
+//-------------------------------------------------
+
+void melps4_cpu_device::execute_set_input(int line, int state)
+{
+ state = (state) ? 1 : 0;
+
+ switch (line)
+ {
+ // external interrupt
+ case MELPS4_INPUT_LINE_INT:
+ // irq on rising/falling edge
+ if (state != m_int_state && state == m_intp)
+ {
+ m_irqflag[0] = true;
+ m_possible_irq = true;
+ }
+ m_int_state = state;
+ break;
+
+ // timer input pin
+ case MELPS4_INPUT_LINE_T:
+ write_t_in(state);
+ break;
+
+ default:
+ break;
+ }
+}
+
+void melps4_cpu_device::do_interrupt(int which)
+{
+ m_inte = 0;
+ m_irqflag[which] = false;
+
+ m_icount--;
+ push_pc();
+ m_sms = m_sm;
+ m_sm = false;
+ m_op = 0; // fake nop
+ m_pc = m_int_page << 7 | (which * 2);
+
+ standard_irq_callback(which);
+}
+
+void melps4_cpu_device::check_interrupt()
+{
+ if (!m_inte)
+ return;
+
+ int which = 0;
+
+ // assume that lower irq vectors have higher priority
+ if (m_irqflag[0])
+ which = 0;
+ else if (m_irqflag[1] && m_tmr_irq_enabled[0])
+ which = 1;
+ else if (m_irqflag[2] && m_tmr_irq_enabled[1])
+ which = 2;
+ else
+ return;
+
+ do_interrupt(which);
}
@@ -193,6 +407,16 @@ void melps4_cpu_device::execute_run()
m_prev_op = m_op;
m_prev_pc = m_pc;
+ // Interrupts are not accepted during skips or LXY, LA, EI, DI, RT/RTS/RTI or any branch.
+ // Documentation is conflicting here: older docs say that it is allowed during skips,
+ // newer docs specifically say when interrupts are prohibited.
+ if (m_possible_irq && !m_prohibit_irq && !m_skip)
+ {
+ m_possible_irq = false;
+ check_interrupt();
+ }
+ m_prohibit_irq = false;
+
// fetch next opcode
debugger_instruction_hook(this, m_pc);
m_icount--;
@@ -201,6 +425,16 @@ void melps4_cpu_device::execute_run()
m_pc = (m_pc & ~0x7f) | ((m_pc + 1) & 0x7f); // stays in the same page
// handle opcode if it's not skipped
- execute_one();
+ if (m_skip)
+ {
+ // if it's a long jump, skip next one as well
+ if (m_op != m_ba_op && (m_op & ~0xf) != m_sp_mask)
+ {
+ m_skip = false;
+ m_op = 0; // fake nop
+ }
+ }
+ else
+ execute_one();
}
}
diff --git a/src/emu/cpu/melps4/melps4.h b/src/emu/cpu/melps4/melps4.h
index d8b9380f7d7..329ea035b13 100644
--- a/src/emu/cpu/melps4/melps4.h
+++ b/src/emu/cpu/melps4/melps4.h
@@ -12,6 +12,62 @@
#include "emu.h"
+// I/O ports setup
+
+// K input or A/D input port, up to 16 pins
+#define MCFG_MELPS4_READ_K_CB(_devcb) \
+ melps4_cpu_device::set_read_k_callback(*device, DEVCB_##_devcb);
+
+// D discrete I/O port, up to 16 pins - offset 0-15 for bit, 16 for all pins clear
+#define MCFG_MELPS4_READ_D_CB(_devcb) \
+ melps4_cpu_device::set_read_d_callback(*device, DEVCB_##_devcb);
+#define MCFG_MELPS4_WRITE_D_CB(_devcb) \
+ melps4_cpu_device::set_write_d_callback(*device, DEVCB_##_devcb);
+
+// 8-bit S generic I/O port
+#define MCFG_MELPS4_READ_S_CB(_devcb) \
+ melps4_cpu_device::set_read_s_callback(*device, DEVCB_##_devcb);
+#define MCFG_MELPS4_WRITE_S_CB(_devcb) \
+ melps4_cpu_device::set_write_s_callback(*device, DEVCB_##_devcb);
+
+// 4-bit F generic I/O port
+#define MCFG_MELPS4_READ_F_CB(_devcb) \
+ melps4_cpu_device::set_read_f_callback(*device, DEVCB_##_devcb);
+#define MCFG_MELPS4_WRITE_F_CB(_devcb) \
+ melps4_cpu_device::set_write_f_callback(*device, DEVCB_##_devcb);
+
+// 4-bit G generic output port
+#define MCFG_MELPS4_WRITE_G_CB(_devcb) \
+ melps4_cpu_device::set_write_g_callback(*device, DEVCB_##_devcb);
+
+// 1-bit U generic output port
+#define MCFG_MELPS4_WRITE_U_CB(_devcb) \
+ melps4_cpu_device::set_write_u_callback(*device, DEVCB_##_devcb);
+
+// T timer I/O pin (use execute_set_input for reads)
+#define MCFG_MELPS4_WRITE_T_CB(_devcb) \
+ melps4_cpu_device::set_write_t_callback(*device, DEVCB_##_devcb);
+
+
+#define MELPS4_PORTD_CLR 16
+
+// only generic ports here
+enum
+{
+ MELPS4_PORTS = 0,
+ MELPS4_PORTF,
+ MELPS4_PORTG,
+ MELPS4_PORTU
+};
+
+enum
+{
+ MELPS4_INPUT_LINE_INT = 0,
+ MELPS4_INPUT_LINE_T
+};
+
+
+
// pinout reference
/*
@@ -45,18 +101,44 @@ class melps4_cpu_device : public cpu_device
{
public:
// construction/destruction
- melps4_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source)
+ melps4_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, int d_pins, UINT8 sm_page, UINT8 int_page, const char *shortname, const char *source)
: cpu_device(mconfig, type, name, tag, owner, clock, shortname, source)
, m_program_config("program", ENDIANNESS_LITTLE, 16, prgwidth, -1, program)
, m_data_config("data", ENDIANNESS_LITTLE, 8, datawidth, 0, data)
, m_prgwidth(prgwidth)
, m_datawidth(datawidth)
- , m_stack_levels(3)
- , m_bm_page(14)
- , m_int_page(12)
+ , m_d_pins(d_pins)
+ , m_sm_page(sm_page)
+ , m_int_page(int_page)
, m_xami_mask(0xf)
+ , m_sp_mask(0x7<<4)
+ , m_ba_op(0x01)
+ , m_stack_levels(3)
+ , m_read_k(*this)
+ , m_read_d(*this)
+ , m_read_s(*this)
+ , m_read_f(*this)
+ , m_write_d(*this)
+ , m_write_s(*this)
+ , m_write_f(*this)
+ , m_write_g(*this)
+ , m_write_u(*this)
+ , m_write_t(*this)
{ }
+ // static configuration helpers
+ template<class _Object> static devcb_base &set_read_k_callback(device_t &device, _Object object) { return downcast<melps4_cpu_device &>(device).m_read_k.set_callback(object); }
+ template<class _Object> static devcb_base &set_read_d_callback(device_t &device, _Object object) { return downcast<melps4_cpu_device &>(device).m_read_d.set_callback(object); }
+ template<class _Object> static devcb_base &set_read_s_callback(device_t &device, _Object object) { return downcast<melps4_cpu_device &>(device).m_read_s.set_callback(object); }
+ template<class _Object> static devcb_base &set_read_f_callback(device_t &device, _Object object) { return downcast<melps4_cpu_device &>(device).m_read_f.set_callback(object); }
+
+ template<class _Object> static devcb_base &set_write_d_callback(device_t &device, _Object object) { return downcast<melps4_cpu_device &>(device).m_write_d.set_callback(object); }
+ template<class _Object> static devcb_base &set_write_s_callback(device_t &device, _Object object) { return downcast<melps4_cpu_device &>(device).m_write_s.set_callback(object); }
+ template<class _Object> static devcb_base &set_write_f_callback(device_t &device, _Object object) { return downcast<melps4_cpu_device &>(device).m_write_f.set_callback(object); }
+ template<class _Object> static devcb_base &set_write_g_callback(device_t &device, _Object object) { return downcast<melps4_cpu_device &>(device).m_write_g.set_callback(object); }
+ template<class _Object> static devcb_base &set_write_u_callback(device_t &device, _Object object) { return downcast<melps4_cpu_device &>(device).m_write_u.set_callback(object); }
+ template<class _Object> static devcb_base &set_write_t_callback(device_t &device, _Object object) { return downcast<melps4_cpu_device &>(device).m_write_t.set_callback(object); }
+
protected:
// device-level overrides
virtual void device_start();
@@ -66,8 +148,9 @@ protected:
virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const { return (clocks + 6 - 1) / 6; } // 6 t-states per machine cycle
virtual UINT64 execute_cycles_to_clocks(UINT64 cycles) const { return (cycles * 6); } // "
virtual UINT32 execute_min_cycles() const { return 1; }
- virtual UINT32 execute_max_cycles() const { return 1; }
+ virtual UINT32 execute_max_cycles() const { return 1+1; } // max opcode cycles + interrupt duration
virtual UINT32 execute_input_lines() const { return 3; } // up to 3 (some internal)
+ virtual void execute_set_input(int line, int state);
virtual void execute_run();
virtual void execute_one();
@@ -86,29 +169,50 @@ protected:
int m_icount;
- // fixed settings or mask options
- int m_prgwidth; // number of bits and bitmask for ROM/RAM size
+ // fixed settings or mask options that differ between MCU type
+ int m_prgwidth; // number of bits and bitmask for ROM/RAM size: see melps4.c for info
int m_datawidth; // "
int m_prgmask; // "
int m_datamask; // "
+ int m_d_pins; // number of D port pins and bitmask: 11 on '40,'41,'42,'44, 8 on '43, 12 on '45,'46, 16 on '47
+ int m_d_mask; // "
- UINT8 m_stack_levels; // 3 levels on MELPS 4, 12 levels on MELPS 41/42
- UINT8 m_bm_page; // short BM default page: 14 on '40 to '44, 2 on '45,'46, 0 on '47
+ UINT8 m_sm_page; // subroutine default page: 14 on '40 to '44, 2 on '45,'46, 0 on '47
UINT8 m_int_page; // interrupt routine page: 12 on '40 to '44, 1 on '45,'46, 2 on '47
UINT8 m_xami_mask; // mask option for XAMI opcode on '40,'41,'45 (0xf for others)
+ UINT16 m_sp_mask; // SP opcode location(middle 4 bits): 7 on '40 to '46, 3 on '47
+ UINT16 m_ba_op; // BA opcode location: 1 on '40 to '46, N/A on '47
+ UINT8 m_stack_levels; // 3 levels on MELPS 4, 12 levels on MELPS 41/42
// internal state, misc regs
UINT16 m_pc; // program counter (11 or 10-bit)
UINT16 m_prev_pc;
- UINT16 m_stack[12]; // callstack
+ UINT16 m_stack[12]; // callstack (SK0-SKx, same size as PC)
UINT16 m_op;
UINT16 m_prev_op;
UINT8 m_bitmask; // opcode bit argument
+ UINT16 m_port_d; // last written port data
+ UINT8 m_port_s; // "
+ UINT8 m_port_f; // "
+ UINT8 m_port_t; // "
+
+ bool m_sm, m_sms; // subroutine mode flag + irq stack
+ bool m_ba_flag; // temp flag indicates BA opcode was executed
+ UINT8 m_sp_param; // temp register holding SP opcode parameter
UINT8 m_cps; // DP,CY or DP',CY' selected
bool m_skip; // skip next opcode
UINT8 m_inte; // interrupt enable flag
- UINT8 m_intp; // external interrupt polarity ('40 to '44)
+ int m_intp; // external interrupt polarity ('40 to '44)
+ bool m_irqflag[3]; // irq flags: exf, 1f, 2f (external, timer 1, timer 2)
+ int m_int_state; // INT pin state
+ int m_t_in_state; // T input pin state
+ bool m_prohibit_irq; // interrupt is prohibited during certain opcodes
+ bool m_possible_irq; // indicate that irq needs to be rechecked
+
+ UINT8 m_tmr_count[2]; // timer active count
+ UINT8 m_tmr_reload; // timer(2) auto reload
+ bool m_tmr_irq_enabled[2];
// work registers (unless specified, each is 4-bit)
UINT8 m_a; // accumulator
@@ -125,6 +229,30 @@ protected:
UINT8 m_v; // timer control V
UINT8 m_w; // timer control W
+ // i/o handlers
+ devcb_read16 m_read_k;
+ devcb_read16 m_read_d;
+ devcb_read8 m_read_s;
+ devcb_read8 m_read_f;
+
+ devcb_write16 m_write_d;
+ devcb_write8 m_write_s;
+ devcb_write8 m_write_f;
+ devcb_write8 m_write_g;
+ devcb_write8 m_write_u;
+ devcb_write_line m_write_t;
+
+ virtual void write_t_in(int state) { m_t_in_state = state; }
+ virtual void write_v(UINT8 data) { m_v = data; }
+ virtual void write_w(UINT8 data) { m_w = data; }
+ virtual void do_interrupt(int which);
+ virtual void check_interrupt();
+
+ UINT8 read_gen_port(int port);
+ void write_gen_port(int port, UINT8 data);
+ int read_d_pin(int bit);
+ void write_d_pin(int bit, int state);
+
// misc internal helpers
UINT8 ram_r();
void ram_w(UINT8 data);
@@ -137,6 +265,7 @@ protected:
void op_tay();
void op_tya();
void op_teab();
+ void op_tabe();
void op_tepa();
void op_txa();
void op_tax();
@@ -162,6 +291,8 @@ protected:
void op_rc();
void op_szc();
void op_cma();
+ void op_rl();
+ void op_rr();
void op_sb();
void op_rb();
diff --git a/src/emu/cpu/melps4/melps4d.c b/src/emu/cpu/melps4/melps4d.c
index 01d9b51f5ce..4c2ca2fd9d4 100644
--- a/src/emu/cpu/melps4/melps4d.c
+++ b/src/emu/cpu/melps4/melps4d.c
@@ -18,10 +18,10 @@
enum e_mnemonics
{
em_ILL,
- em_TAB, em_TBA, em_TAY, em_TYA, em_TEAB, em_TEPA, em_TXA, em_TAX,
+ em_TAB, em_TBA, em_TAY, em_TYA, em_TEAB, em_TABE, em_TEPA, em_TXA, em_TAX,
em_LXY, em_LZ, em_INY, em_DEY, em_LCPS, em_SADR,
em_TAM, em_XAM, em_XAMD, em_XAMI,
- em_LA, em_AM, em_AMC, em_AMCS, em_A, em_SC, em_RC, em_SZC, em_CMA,
+ em_LA, em_AM, em_AMC, em_AMCS, em_A, em_SC, em_RC, em_SZC, em_CMA, em_RL, em_RR,
em_SB, em_RB, em_SZB, em_SEAM, em_SEY,
em_TLA, em_THA, em_TAJ, em_XAL, em_XAH, em_LC7, em_DEC, em_SHL, em_RHL, em_CPA, em_CPAS, em_CPAE, em_SZJ,
em_T1AB, em_TRAB, em_T2AB, em_TAB1, em_TABR, em_TAB2, em_TVA, em_TWA, em_SNZ1, em_SNZ2,
@@ -33,10 +33,10 @@ enum e_mnemonics
static const char *const em_name[] =
{
"?",
- "TAB", "TBA", "TAY", "TYA", "TEAB", "TEPA", "TXA", "TAX",
+ "TAB", "TBA", "TAY", "TYA", "TEAB", "TABE", "TEPA", "TXA", "TAX",
"LXY", "LZ", "INY", "DEY", "LCPS", "SADR",
"TAM", "XAM", "XAMD", "XAMI",
- "LA", "AM", "AMC", "AMCS", "A", "SC", "RC", "SZC", "CMA",
+ "LA", "AM", "AMC", "AMCS", "A", "SC", "RC", "SZC", "CMA", "RL", "RR",
"SB", "RB", "SZB", "SEAM", "SEY",
"TLA", "THA", "TAJ", "XAL", "XAH", "LC7", "DEC", "SHL", "RHL", "CPA", "CPAS", "CPAE", "SZJ",
"T1AB", "TRAB", "T2AB", "TAB1", "TABR", "TAB2", "TVA", "TWA", "SNZ1", "SNZ2",
@@ -49,10 +49,10 @@ static const char *const em_name[] =
static const UINT8 em_bits[] =
{
0,
- 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0,
6, 1, 0, 0, 1, 2,
2, 2, 2, 2,
- 4, 0, 0, 0, 4, 0, 0, 0, 0,
+ 4, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0,
2, 2, 2, 0, 4,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -67,10 +67,10 @@ static const UINT8 em_bits[] =
static const UINT32 em_flags[] =
{
0,
- 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -86,8 +86,8 @@ static const UINT32 em_flags[] =
static const UINT8 m58846_opmap[0xc0] =
{
// 0 1 2 3 4 5 6 7 8 9 A B C D E F
- em_NOP, em_BA, em_INY, em_DEY, em_DI, em_EI, em_RU, em_SU, 0, 0, em_AM, em_OSE, em_TYA, 0, 0, em_CMA, // 0x
- em_CLS, em_CLDS, 0, em_CLD, em_RD, em_SD, em_TEPA, em_OSPA, 0, 0, em_TEAB, em_OSAB, em_TBA, em_TAY, em_TAB, 0, // 1x
+ em_NOP, em_BA, em_INY, em_DEY, em_DI, em_EI, em_RU, em_SU, 0, em_TABE, em_AM, em_OSE, em_TYA, 0, 0, em_CMA, // 0x
+ em_CLS, em_CLDS, 0, em_CLD, em_RD, em_SD, em_TEPA, em_OSPA, em_RL, em_RR, em_TEAB, em_OSAB, em_TBA, em_TAY, em_TAB, 0, // 1x
em_SZB, em_SZB, em_SZB, em_SZB, 0, 0, em_SEAM, 0, 0, 0, 0, em_SZD, 0, 0, 0, em_SZC, // 2x
em_SEY, em_SEY, em_SEY, em_SEY, em_SEY, em_SEY, em_SEY, em_SEY, em_SEY, em_SEY, em_SEY, em_SEY, em_SEY, em_SEY, em_SEY, em_SEY, // 3x
em_LCPS, em_LCPS, 0, em_AMC, em_RT, em_RTS, em_RTI, 0, em_RC, em_SC, em_LZ, em_LZ, em_SB, em_SB, em_SB, em_SB, // 4x
diff --git a/src/emu/cpu/melps4/melps4op.inc b/src/emu/cpu/melps4/melps4op.c
index 296a5b1a39a..4f77764a66b 100644
--- a/src/emu/cpu/melps4/melps4op.inc
+++ b/src/emu/cpu/melps4/melps4op.c
@@ -3,6 +3,9 @@
// MELPS 4 opcode handlers
+#include "melps4.h"
+
+
// internal helpers
inline UINT8 melps4_cpu_device::ram_r()
@@ -19,10 +22,16 @@ inline void melps4_cpu_device::ram_w(UINT8 data)
void melps4_cpu_device::pop_pc()
{
+ m_pc = m_stack[0];
+ for (int i = 0; i < m_stack_levels-1; i++)
+ m_stack[i] = m_stack[i+1];
}
void melps4_cpu_device::push_pc()
{
+ for (int i = m_stack_levels-1; i >= 1; i--)
+ m_stack[i] = m_stack[i-1];
+ m_stack[0] = m_pc;
}
@@ -58,6 +67,13 @@ void melps4_cpu_device::op_teab()
m_e = m_b << 4 | m_a;
}
+void melps4_cpu_device::op_tabe()
+{
+ // TABE(undocumented): transfer E to A and B
+ m_a = m_e & 0xf;
+ m_b = m_e >> 4;
+}
+
void melps4_cpu_device::op_tepa()
{
// TEPA: decode A by PLA and transfer to E
@@ -82,6 +98,7 @@ void melps4_cpu_device::op_tax()
void melps4_cpu_device::op_lxy()
{
// LXY x,y: load immediate into X,Y, skip any next LXY
+ m_prohibit_irq = true;
if ((m_op & ~0x3f) != (m_prev_op & ~0x3f))
{
m_x = m_op >> 4 & 3;
@@ -162,14 +179,14 @@ void melps4_cpu_device::op_xam()
void melps4_cpu_device::op_xamd()
{
- // XAMD j: XAM J, DEY
+ // XAMD j: XAM j, DEY
op_xam();
op_dey();
}
void melps4_cpu_device::op_xami()
{
- // XAMI j: XAM J, skip next on Y mask(default 0xf), increment Y
+ // XAMI j: XAM j, skip next on Y mask(default 0xf), increment Y
op_xam();
m_skip = ((m_y & m_xami_mask) == m_xami_mask);
m_y = (m_y + 1) & 0xf;
@@ -181,6 +198,7 @@ void melps4_cpu_device::op_xami()
void melps4_cpu_device::op_la()
{
// LA n: load immediate into A, skip any next LA
+ m_prohibit_irq = true;
if ((m_op & ~0xf) != (m_prev_op & ~0xf))
m_a = m_op & 0xf;
}
@@ -239,6 +257,22 @@ void melps4_cpu_device::op_cma()
m_a ^= 0xf;
}
+void melps4_cpu_device::op_rl()
+{
+ // RL(undocumented): rotate A left through carry
+ UINT8 c = m_a >> 3 & 1;
+ m_a = (m_a << 1 | m_cy) & 0xf;
+ m_cy = c;
+}
+
+void melps4_cpu_device::op_rr()
+{
+ // RR(undocumented): rotate A right through carry
+ UINT8 c = m_a & 1;
+ m_a = m_a >> 1 | m_cy << 3;
+ m_cy = c;
+}
+
// Bit operations
@@ -375,61 +409,66 @@ void melps4_cpu_device::op_szj()
void melps4_cpu_device::op_t1ab()
{
// T1AB: transfer A and B to timer 1
- op_illegal();
+ m_tmr_count[0] = m_b << 4 | m_a;
}
void melps4_cpu_device::op_trab()
{
// TRAB: transfer A and B to timer 2 reload
- op_illegal();
+ m_tmr_reload = m_b << 4 | m_a;
}
void melps4_cpu_device::op_t2ab()
{
// T2AB: transfer A and B to timer 2 and timer 2 reload
- op_illegal();
+ m_tmr_reload = m_tmr_count[1] = m_b << 4 | m_a;
}
void melps4_cpu_device::op_tab1()
{
// TAB1: transfer timer 1 to A and B
- op_illegal();
+ m_a = m_tmr_count[0] & 0xf;
+ m_b = m_tmr_count[0] >> 4;
}
void melps4_cpu_device::op_tabr()
{
// TABR: transfer timer 2 reload to A and B
- op_illegal();
+ m_a = m_tmr_reload & 0xf;
+ m_b = m_tmr_reload >> 4;
}
void melps4_cpu_device::op_tab2()
{
// TAB2: transfer timer 2 to A and B
- op_illegal();
+ m_a = m_tmr_count[1] & 0xf;
+ m_b = m_tmr_count[1] >> 4;
}
void melps4_cpu_device::op_tva()
{
// TVA: transfer A to timer control V
- op_illegal();
+ write_v(m_a);
}
void melps4_cpu_device::op_twa()
{
// TWA: transfer A to timer control W
- op_illegal();
+ write_w(m_a);
}
void melps4_cpu_device::op_snz1()
{
// SNZ1: skip next on flag 1F
- op_illegal();
+ m_skip = m_irqflag[1];
+ m_irqflag[1] = false;
}
void melps4_cpu_device::op_snz2()
{
// SNZ2: skip next on flag 2F
- op_illegal();
+ m_skip = m_irqflag[2];
+ m_irqflag[2] = false;
}
@@ -437,26 +476,57 @@ void melps4_cpu_device::op_snz2()
void melps4_cpu_device::op_ba()
{
- // BA: x
- op_illegal();
+ // BA: indicate next branch is indirect
+ m_prohibit_irq = true;
+ m_ba_flag = true;
}
void melps4_cpu_device::op_sp()
{
- // SP: set page
- op_illegal();
+ // SP: set page for next branch
+ // note: mnemonic is guessed, manual names it BL or BML
+ m_prohibit_irq = true;
+ m_sp_param = m_op & 0xf;
}
void melps4_cpu_device::op_b()
{
- // B xy: branch in current page
- op_illegal();
+ // B xy: branch
+ m_prohibit_irq = true;
+
+ // determine new page:
+ // - short call: subroutine page
+ // - short jump: current page, or sub. page + 1 when in sub. mode
+ // - long jump/call(B/BM preceded by SP): temp SP register
+ UINT8 page = m_pc >> 7;
+ if ((m_prev_op & ~0xf) == m_sp_mask)
+ {
+ m_sm = false;
+ page = m_sp_param;
+ }
+ else if (m_sm)
+ page = m_sm_page | (m_op >> 7 & 1);
+
+ m_pc = page << 7 | (m_op & 0x7f);
+
+ // if BA opcode was executed, set PC low 4 bits to A
+ if (m_ba_flag)
+ {
+ m_ba_flag = false;
+ m_pc = (m_pc & ~0xf) | m_a;
+ }
}
void melps4_cpu_device::op_bm()
{
- // BM xy call subroutine on page 14
- op_illegal();
+ // BM xy call subroutine
+ // don't push stack on short calls when in subroutine mode
+ if (!m_sm || (m_prev_op & ~0xf) == m_sp_mask)
+ push_pc();
+
+ // set subroutine mode - it is reset after long jump/call or return
+ m_sm = true;
+ op_b();
}
@@ -465,7 +535,9 @@ void melps4_cpu_device::op_bm()
void melps4_cpu_device::op_rt()
{
// RT: return from subroutine
- op_illegal();
+ m_prohibit_irq = true;
+ m_sm = false;
+ pop_pc();
}
void melps4_cpu_device::op_rts()
@@ -478,7 +550,8 @@ void melps4_cpu_device::op_rts()
void melps4_cpu_device::op_rti()
{
// RTI: return from interrupt routine
- op_illegal();
+ op_rt();
+ m_sm = m_sms;
}
@@ -487,43 +560,44 @@ void melps4_cpu_device::op_rti()
void melps4_cpu_device::op_cld()
{
// CLD: clear port D
- op_illegal();
+ write_d_pin(MELPS4_PORTD_CLR, 0);
}
void melps4_cpu_device::op_cls()
{
// CLS: clear port S
- op_illegal();
+ write_gen_port(MELPS4_PORTS, 0);
}
void melps4_cpu_device::op_clds()
{
// CLDS: CLD, CLS
- op_illegal();
+ op_cld();
+ op_cls();
}
void melps4_cpu_device::op_sd()
{
- // SD: set port D bit designated by Y
- op_illegal();
+ // SD: set port D pin designated by Y
+ write_d_pin(m_y, 1);
}
void melps4_cpu_device::op_rd()
{
- // RD: reset port D bit designated by Y
- op_illegal();
+ // RD: reset port D pin designated by Y
+ write_d_pin(m_y, 0);
}
void melps4_cpu_device::op_szd()
{
- // SZD: skip next if port D bit designated by Y is 0
- op_illegal();
+ // SZD: skip next if port D pin designated by Y is 0
+ m_skip = !read_d_pin(m_y);
}
void melps4_cpu_device::op_osab()
{
// OSAB: output A and B to port S
- op_illegal();
+ write_gen_port(MELPS4_PORTS, m_b << 4 | m_a);
}
void melps4_cpu_device::op_ospa()
@@ -535,49 +609,50 @@ void melps4_cpu_device::op_ospa()
void melps4_cpu_device::op_ose()
{
// OSE: output E to port S
- op_illegal();
+ write_gen_port(MELPS4_PORTS, m_e);
}
void melps4_cpu_device::op_ias()
{
// IAS i: transfer port S(hi/lo) to A
- op_illegal();
+ int shift = (m_op & 1) ? 0 : 4;
+ m_a = read_gen_port(MELPS4_PORTS) >> shift & 0xf;
}
void melps4_cpu_device::op_ofa()
{
// OFA: output A to port F
- op_illegal();
+ write_gen_port(MELPS4_PORTF, m_a);
}
void melps4_cpu_device::op_iaf()
{
// IAF: input port F to A
- op_illegal();
+ m_a = read_gen_port(MELPS4_PORTF);
}
void melps4_cpu_device::op_oga()
{
// OGA: output A to port G
- op_illegal();
+ write_gen_port(MELPS4_PORTG, m_a);
}
void melps4_cpu_device::op_iak()
{
// IAK: input port K to A
- op_illegal();
+ m_a = m_read_k(0, 0xffff) & 0xf;
}
void melps4_cpu_device::op_szk()
{
// SZK j: skip next if port K bit is reset
- op_illegal();
+ m_skip = !(m_read_k(0, 0xffff) & m_bitmask);
}
void melps4_cpu_device::op_su()
{
// SU/RU: set/reset port U
- op_illegal();
+ write_gen_port(MELPS4_PORTU, m_op & 1);
}
@@ -586,12 +661,15 @@ void melps4_cpu_device::op_su()
void melps4_cpu_device::op_ei()
{
// EI: enable interrupt flag
+ m_prohibit_irq = true;
+ m_possible_irq = true;
m_inte = 1;
}
void melps4_cpu_device::op_di()
{
// DI: disable interrupt flag
+ m_prohibit_irq = true;
m_inte = 0;
}
diff --git a/src/emu/cpu/minx/minx.h b/src/emu/cpu/minx/minx.h
index 6e99bc06cf5..836b76026cc 100644
--- a/src/emu/cpu/minx/minx.h
+++ b/src/emu/cpu/minx/minx.h
@@ -10,7 +10,7 @@ enum
{
MINX_PC=1, MINX_SP, MINX_BA, MINX_HL, MINX_X, MINX_Y,
MINX_U, MINX_V, MINX_F, MINX_E, MINX_N, MINX_I,
- MINX_XI, MINX_YI,
+ MINX_XI, MINX_YI
};
diff --git a/src/emu/cpu/mips/mips3.c b/src/emu/cpu/mips/mips3.c
index 3b377dfa64f..ce8466b2b21 100644
--- a/src/emu/cpu/mips/mips3.c
+++ b/src/emu/cpu/mips/mips3.c
@@ -101,7 +101,7 @@ static const UINT8 fpmode_source[4] =
MEMORY ACCESSORS
***************************************************************************/
-#define ROPCODE(pc) direct->read_decrypted_dword(pc)
+#define ROPCODE(pc) direct->read_dword(pc)
const device_type VR4300BE = &device_creator<vr4300be_device>;
@@ -191,8 +191,6 @@ mips3_device::mips3_device(const machine_config &mconfig, device_type type, cons
}
memset(m_fastram, 0, sizeof(m_fastram));
memset(m_hotspot, 0, sizeof(m_hotspot));
-
- m_isdrc = mconfig.options().drc() ? true : false;
}
@@ -323,6 +321,8 @@ void mips3_device::check_irqs()
void mips3_device::device_start()
{
+ m_isdrc = (mconfig().options().drc() && !mconfig().m_force_no_drc) ? true : false;
+
/* allocate the implementation-specific state from the full cache */
m_core = (internal_mips3_state *)m_cache.alloc_near(sizeof(internal_mips3_state));
diff --git a/src/emu/cpu/mips/mips3.h b/src/emu/cpu/mips/mips3.h
index 2cbdf93c28f..b8d9330cffb 100644
--- a/src/emu/cpu/mips/mips3.h
+++ b/src/emu/cpu/mips/mips3.h
@@ -421,7 +421,7 @@ private:
UINT32 * offset_base32; /* base in memory where the RAM lives, 32-bit pointer, with the start offset pre-applied */
} m_fastram[MIPS3_MAX_FASTRAM];
- UINT64 m_debugger_temp;
+ UINT32 m_debugger_temp;
/* core state */
drc_cache m_cache; /* pointer to the DRC code cache */
diff --git a/src/emu/cpu/mips/mips3drc.c b/src/emu/cpu/mips/mips3drc.c
index 70c31df2220..22af8e16063 100644
--- a/src/emu/cpu/mips/mips3drc.c
+++ b/src/emu/cpu/mips/mips3drc.c
@@ -150,7 +150,7 @@ inline void mips3_device::save_fast_iregs(drcuml_block *block)
void mips3_device::mips3drc_set_options(UINT32 options)
{
- if (!machine().options().drc()) return;
+ if (!(mconfig().options().drc() && !mconfig().m_force_no_drc)) return;
m_drcoptions = options;
}
@@ -196,7 +196,7 @@ void mips3_device::add_fastram(offs_t start, offs_t end, UINT8 readonly, void *b
void mips3_device::mips3drc_add_hotspot(offs_t pc, UINT32 opcode, UINT32 cycles)
{
- if (!machine().options().drc()) return;
+ if (!(mconfig().options().drc() && !mconfig().m_force_no_drc)) return;
if (m_hotspot_select < ARRAY_LENGTH(m_hotspot))
{
m_hotspot[m_hotspot_select].pc = pc;
@@ -778,7 +778,7 @@ void mips3_device::static_generate_exception(UINT8 exception, int recover, const
/* choose our target PC */
UML_ADD(block, I0, I3, 0xbfc00200); // add i0,i3,0xbfc00200
- UML_TEST(block, I1, SR_BEV); // test i1,SR_BEV
+ UML_TEST(block, CPR032(COP0_Status), SR_BEV); // test CPR032(COP0_Status),SR_BEV
UML_JMPc(block, COND_NZ, skip); // jnz <skip>
UML_ADD(block, I0, I3, 0x80000000); // add i0,i3,0x80000000,z
UML_LABEL(block, skip); // <skip>:
@@ -1095,12 +1095,12 @@ void mips3_device::generate_checksum_block(drcuml_block *block, compiler_state *
if (!(seqhead->flags & OPFLAG_VIRTUAL_NOOP))
{
UINT32 sum = seqhead->opptr.l[0];
- void *base = m_direct->read_decrypted_ptr(seqhead->physpc);
+ void *base = m_direct->read_ptr(seqhead->physpc);
UML_LOAD(block, I0, base, 0, SIZE_DWORD, SCALE_x4); // load i0,base,0,dword
if (seqhead->delay.first() != NULL && seqhead->physpc != seqhead->delay.first()->physpc)
{
- base = m_direct->read_decrypted_ptr(seqhead->delay.first()->physpc);
+ base = m_direct->read_ptr(seqhead->delay.first()->physpc);
assert(base != NULL);
UML_LOAD(block, I1, base, 0, SIZE_DWORD, SCALE_x4); // load i1,base,dword
UML_ADD(block, I0, I0, I1); // add i0,i0,i1
@@ -1120,20 +1120,20 @@ void mips3_device::generate_checksum_block(drcuml_block *block, compiler_state *
for (curdesc = seqhead->next(); curdesc != seqlast->next(); curdesc = curdesc->next())
if (!(curdesc->flags & OPFLAG_VIRTUAL_NOOP))
{
- void *base = m_direct->read_decrypted_ptr(seqhead->physpc);
+ void *base = m_direct->read_ptr(seqhead->physpc);
UML_LOAD(block, I0, base, 0, SIZE_DWORD, SCALE_x4); // load i0,base,0,dword
UML_CMP(block, I0, curdesc->opptr.l[0]); // cmp i0,opptr[0]
UML_EXHc(block, COND_NE, *m_nocode, epc(seqhead)); // exne nocode,seqhead->pc
}
#else
UINT32 sum = 0;
- void *base = m_direct->read_decrypted_ptr(seqhead->physpc);
+ void *base = m_direct->read_ptr(seqhead->physpc);
UML_LOAD(block, I0, base, 0, SIZE_DWORD, SCALE_x4); // load i0,base,0,dword
sum += seqhead->opptr.l[0];
for (curdesc = seqhead->next(); curdesc != seqlast->next(); curdesc = curdesc->next())
if (!(curdesc->flags & OPFLAG_VIRTUAL_NOOP))
{
- base = m_direct->read_decrypted_ptr(curdesc->physpc);
+ base = m_direct->read_ptr(curdesc->physpc);
assert(base != NULL);
UML_LOAD(block, I1, base, 0, SIZE_DWORD, SCALE_x4); // load i1,base,dword
UML_ADD(block, I0, I0, I1); // add i0,i0,i1
@@ -1141,7 +1141,7 @@ void mips3_device::generate_checksum_block(drcuml_block *block, compiler_state *
if (curdesc->delay.first() != NULL && (curdesc == seqlast || (curdesc->next() != NULL && curdesc->next()->physpc != curdesc->delay.first()->physpc)))
{
- base = m_direct->read_decrypted_ptr(curdesc->delay.first()->physpc);
+ base = m_direct->read_ptr(curdesc->delay.first()->physpc);
assert(base != NULL);
UML_LOAD(block, I1, base, 0, SIZE_DWORD, SCALE_x4); // load i1,base,dword
UML_ADD(block, I0, I0, I1); // add i0,i0,i1
@@ -2791,7 +2791,7 @@ int mips3_device::generate_cop1(drcuml_block *block, compiler_state *compiler, c
else /* NEG.D - MIPS I */
{
UML_FDNEG(block, FPR64(FDREG), FPR64(FSREG)); // fdneg <fdreg>,<fsreg>
- UML_CMP(block, FPR64(FSREG), 0); // cmp <fsreg>,0.0
+ UML_DCMP(block, FPR64(FSREG), 0); // cmp <fsreg>,0.0
UML_DMOVc(block, COND_E, FPR64(FDREG), U64(0x8000000000000000));// dmov <fdreg>,-0.0,e
}
return TRUE;
diff --git a/src/emu/cpu/mips/mips3fe.c b/src/emu/cpu/mips/mips3fe.c
index 7d031c32407..42055c39e24 100644
--- a/src/emu/cpu/mips/mips3fe.c
+++ b/src/emu/cpu/mips/mips3fe.c
@@ -49,7 +49,7 @@ bool mips3_frontend::describe(opcode_desc &desc, const opcode_desc *prev)
// fetch the opcode
assert((desc.physpc & 3) == 0);
- op = desc.opptr.l[0] = m_mips3->m_direct->read_decrypted_dword(desc.physpc);
+ op = desc.opptr.l[0] = m_mips3->m_direct->read_dword(desc.physpc);
// all instructions are 4 bytes and default to a single cycle each
desc.length = 4;
diff --git a/src/emu/cpu/mips/r3000.c b/src/emu/cpu/mips/r3000.c
index 5e6fa280884..1b64e05799c 100644
--- a/src/emu/cpu/mips/r3000.c
+++ b/src/emu/cpu/mips/r3000.c
@@ -498,7 +498,7 @@ offs_t r3000_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *op
inline UINT32 r3000_device::readop(offs_t pc)
{
- return m_direct->read_decrypted_dword(pc);
+ return m_direct->read_dword(pc);
}
UINT8 r3000_device::readmem(offs_t offset)
diff --git a/src/emu/cpu/mips/r3000.h b/src/emu/cpu/mips/r3000.h
index da008d2b213..a29ea5cd163 100644
--- a/src/emu/cpu/mips/r3000.h
+++ b/src/emu/cpu/mips/r3000.h
@@ -73,7 +73,7 @@ protected:
CHIP_TYPE_R3051,
CHIP_TYPE_R3052,
CHIP_TYPE_R3071,
- CHIP_TYPE_R3081,
+ CHIP_TYPE_R3081
};
// construction/destruction
diff --git a/src/emu/cpu/mn10200/mn10200.c b/src/emu/cpu/mn10200/mn10200.c
index e05c032c91c..bf00be5b984 100644
--- a/src/emu/cpu/mn10200/mn10200.c
+++ b/src/emu/cpu/mn10200/mn10200.c
@@ -35,28 +35,88 @@ enum mn10200_flag
FLAG_D15 = 0x8000 // ?
};
-const device_type MN1020012A = &device_creator<mn10200_device>;
-static ADDRESS_MAP_START( mn1020012_internal_map, AS_PROGRAM, 16, mn10200_device )
+const device_type MN1020012A = &device_creator<mn1020012a_device>;
+
+// internal memory maps
+static ADDRESS_MAP_START( mn1020012a_internal_map, AS_PROGRAM, 16, mn10200_device )
AM_RANGE(0x00fc00, 0x00ffff) AM_READWRITE8(io_control_r, io_control_w, 0xffff)
ADDRESS_MAP_END
-mn10200_device::mn10200_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : cpu_device(mconfig, MN1020012A, "MN1020012A", tag, owner, clock, "mn1020012a", __FILE__),
- m_program_config("program", ENDIANNESS_LITTLE, 16, 24, 0, ADDRESS_MAP_NAME(mn1020012_internal_map)),
- m_io_config("data", ENDIANNESS_LITTLE, 8, 8, 0)
+
+// device definitions
+mn1020012a_device::mn1020012a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : mn10200_device(mconfig, MN1020012A, "MN1020012A", tag, owner, clock, ADDRESS_MAP_NAME(mn1020012a_internal_map), "mn1020012a", __FILE__)
+{ }
+
+
+// disasm
+void mn10200_device::state_string_export(const device_state_entry &entry, std::string &str)
{
+ switch (entry.index())
+ {
+ case STATE_GENFLAGS:
+ strprintf(str, "S=%d irq=%s im=%d %c%c%c%c %c%c%c%c",
+ (m_psw >> 12) & 3,
+ m_psw & FLAG_IE ? "on " : "off",
+ (m_psw >> 8) & 7,
+ m_psw & FLAG_VX ? 'V' : '-',
+ m_psw & FLAG_CX ? 'C' : '-',
+ m_psw & FLAG_NX ? 'N' : '-',
+ m_psw & FLAG_ZX ? 'Z' : '-',
+ m_psw & FLAG_VF ? 'v' : '-',
+ m_psw & FLAG_CF ? 'c' : '-',
+ m_psw & FLAG_NF ? 'n' : '-',
+ m_psw & FLAG_ZF ? 'z' : '-');
+ break;
+ }
+}
+
+offs_t mn10200_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options)
+{
+ extern CPU_DISASSEMBLE( mn10200 );
+ return CPU_DISASSEMBLE_NAME(mn10200)(this, buffer, pc, oprom, opram, options);
}
+
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
+enum
+{
+ MN10200_PC = 0,
+ MN10200_PSW,
+ MN10200_MDR,
+ MN10200_D0,
+ MN10200_D1,
+ MN10200_D2,
+ MN10200_D3,
+ MN10200_A0,
+ MN10200_A1,
+ MN10200_A2,
+ MN10200_A3,
+ MN10200_NMICR,
+ MN10200_IAGR
+};
+
void mn10200_device::device_start()
{
m_program = &space(AS_PROGRAM);
- m_io = &space(AS_IO);
+
+ // resolve callbacks
+ m_read_port0.resolve_safe(0xff);
+ m_read_port1.resolve_safe(0xff);
+ m_read_port2.resolve_safe(0xff);
+ m_read_port3.resolve_safe(0xff);
+ m_read_port4.resolve_safe(0xff);
+
+ m_write_port0.resolve_safe();
+ m_write_port1.resolve_safe();
+ m_write_port2.resolve_safe();
+ m_write_port3.resolve_safe();
+ m_write_port4.resolve_safe();
// init and register for savestates
save_item(NAME(m_pc));
@@ -176,34 +236,6 @@ void mn10200_device::device_start()
}
-void mn10200_device::state_string_export(const device_state_entry &entry, std::string &str)
-{
- switch (entry.index())
- {
- case STATE_GENFLAGS:
- strprintf(str, "S=%d irq=%s im=%d %c%c%c%c %c%c%c%c",
- (m_psw >> 12) & 3,
- m_psw & FLAG_IE ? "on " : "off",
- (m_psw >> 8) & 7,
- m_psw & FLAG_VX ? 'V' : '-',
- m_psw & FLAG_CX ? 'C' : '-',
- m_psw & FLAG_NX ? 'N' : '-',
- m_psw & FLAG_ZX ? 'Z' : '-',
- m_psw & FLAG_VF ? 'v' : '-',
- m_psw & FLAG_CF ? 'c' : '-',
- m_psw & FLAG_NF ? 'n' : '-',
- m_psw & FLAG_ZF ? 'z' : '-');
- break;
- }
-}
-
-
-offs_t mn10200_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options)
-{
- extern CPU_DISASSEMBLE( mn10200 );
- return CPU_DISASSEMBLE_NAME(mn10200)(this, buffer, pc, oprom, opram, options);
-}
-
//-------------------------------------------------
// device_reset - device-specific reset
@@ -234,7 +266,10 @@ void mn10200_device::device_reset()
}
-// interrupts
+
+//-------------------------------------------------
+// interrupts
+//-------------------------------------------------
void mn10200_device::take_irq(int level, int group)
{
@@ -332,7 +367,10 @@ void mn10200_device::execute_set_input(int irqnum, int state)
}
-// 8-bit timers
+
+//-------------------------------------------------
+// timers
+//-------------------------------------------------
int mn10200_device::timer_tick_simple(int tmr)
{
@@ -405,7 +443,10 @@ TIMER_CALLBACK_MEMBER( mn10200_device::simple_timer_cb )
}
-// opcode handlers
+
+//-------------------------------------------------
+// opcode helpers
+//-------------------------------------------------
void mn10200_device::illegal(UINT8 prefix, UINT8 op)
{
@@ -479,9 +520,9 @@ void mn10200_device::do_jsr(UINT32 to, UINT32 ret)
change_pc(to);
}
-void mn10200_device::do_branch(bool state)
+void mn10200_device::do_branch(int condition)
{
- if (state)
+ if (condition)
{
m_cycles -= 1;
change_pc(m_pc + (INT8)read_arg8(m_pc));
@@ -490,6 +531,10 @@ void mn10200_device::do_branch(bool state)
+//-------------------------------------------------
+// execute loop
+//-------------------------------------------------
+
void mn10200_device::execute_run()
{
while (m_cycles > 0)
@@ -579,13 +624,13 @@ void mn10200_device::execute_run()
// add dn, dm
case 0x90: case 0x91: case 0x92: case 0x93: case 0x94: case 0x95: case 0x96: case 0x97:
case 0x98: case 0x99: case 0x9a: case 0x9b: case 0x9c: case 0x9d: case 0x9e: case 0x9f:
- m_d[op&3] = do_add(m_d[op&3], m_d[op>>2&3], 0);
+ m_d[op&3] = do_add(m_d[op&3], m_d[op>>2&3]);
break;
// sub dn, dm
case 0xa0: case 0xa1: case 0xa2: case 0xa3: case 0xa4: case 0xa5: case 0xa6: case 0xa7:
case 0xa8: case 0xa9: case 0xaa: case 0xab: case 0xac: case 0xad: case 0xae: case 0xaf:
- m_d[op&3] = do_sub(m_d[op&3], m_d[op>>2&3], 0);
+ m_d[op&3] = do_sub(m_d[op&3], m_d[op>>2&3]);
break;
// extx dn
@@ -634,19 +679,19 @@ void mn10200_device::execute_run()
// add imm8, an
case 0xd0: case 0xd1: case 0xd2: case 0xd3:
- m_a[op&3] = do_add(m_a[op&3], (INT8)read_arg8(m_pc), 0);
+ m_a[op&3] = do_add(m_a[op&3], (INT8)read_arg8(m_pc));
m_pc += 1;
break;
// add imm8, dn
case 0xd4: case 0xd5: case 0xd6: case 0xd7:
- m_d[op&3] = do_add(m_d[op&3], (INT8)read_arg8(m_pc), 0);
+ m_d[op&3] = do_add(m_d[op&3], (INT8)read_arg8(m_pc));
m_pc += 1;
break;
// cmp imm8, dn
case 0xd8: case 0xd9: case 0xda: case 0xdb:
- do_sub(m_d[op&3], (INT8)read_arg8(m_pc), 0);
+ do_sub(m_d[op&3], (INT8)read_arg8(m_pc));
m_pc += 1;
break;
@@ -718,7 +763,7 @@ void mn10200_device::execute_run()
// bra label8
case 0xea:
- do_branch(true);
+ do_branch();
m_pc += 1;
break;
@@ -733,7 +778,7 @@ void mn10200_device::execute_run()
// cmp imm16, an
case 0xec: case 0xed: case 0xee: case 0xef:
- do_sub(m_a[op&3], read_arg16(m_pc), 0);
+ do_sub(m_a[op&3], read_arg16(m_pc));
m_pc += 2;
break;
@@ -904,17 +949,17 @@ void mn10200_device::execute_run()
{
// add dm, an
case 0x00:
- m_a[op&3] = do_add(m_a[op&3], m_d[op>>2&3], 0);
+ m_a[op&3] = do_add(m_a[op&3], m_d[op>>2&3]);
break;
// sub dm, an
case 0x10:
- m_a[op&3] = do_sub(m_a[op&3], m_d[op>>2&3], 0);
+ m_a[op&3] = do_sub(m_a[op&3], m_d[op>>2&3]);
break;
// cmp dm, an
case 0x20:
- do_sub(m_a[op&3], m_d[op>>2&3], 0);
+ do_sub(m_a[op&3], m_d[op>>2&3]);
break;
// mov dm, an
@@ -924,17 +969,17 @@ void mn10200_device::execute_run()
// add an, am
case 0x40:
- m_a[op&3] = do_add(m_a[op&3], m_a[op>>2&3], 0);
+ m_a[op&3] = do_add(m_a[op&3], m_a[op>>2&3]);
break;
// sub an, am
case 0x50:
- m_a[op&3] = do_sub(m_a[op&3], m_a[op>>2&3], 0);
+ m_a[op&3] = do_sub(m_a[op&3], m_a[op>>2&3]);
break;
// cmp an, am
case 0x60:
- do_sub(m_a[op&3], m_a[op>>2&3], 0);
+ do_sub(m_a[op&3], m_a[op>>2&3]);
break;
// mov an, am
@@ -962,17 +1007,17 @@ void mn10200_device::execute_run()
// add an, dm
case 0xc0:
- m_d[op&3] = do_add(m_d[op&3], m_a[op>>2&3], 0);
+ m_d[op&3] = do_add(m_d[op&3], m_a[op>>2&3]);
break;
// sub an, dm
case 0xd0:
- m_d[op&3] = do_sub(m_d[op&3], m_a[op>>2&3], 0);
+ m_d[op&3] = do_sub(m_d[op&3], m_a[op>>2&3]);
break;
// cmp an, dm
case 0xe0:
- do_sub(m_d[op&3], m_a[op>>2&3], 0);
+ do_sub(m_d[op&3], m_a[op>>2&3]);
break;
// mov an, dm
@@ -1123,7 +1168,7 @@ void mn10200_device::execute_run()
// cmp dn, dm
case 0x90: case 0x91: case 0x92: case 0x93: case 0x94: case 0x95: case 0x96: case 0x97:
case 0x98: case 0x99: case 0x9a: case 0x9b: case 0x9c: case 0x9d: case 0x9e: case 0x9f:
- do_sub(m_d[op&3], m_d[op>>2&3], 0);
+ do_sub(m_d[op&3], m_d[op>>2&3]);
break;
// mov dn, mdr
@@ -1221,22 +1266,22 @@ void mn10200_device::execute_run()
// add imm24, dn
case 0x60: case 0x61: case 0x62: case 0x63:
- m_d[op&3] = do_add(m_d[op&3], read_arg24(m_pc), 0);
+ m_d[op&3] = do_add(m_d[op&3], read_arg24(m_pc));
break;
// add imm24, an
case 0x64: case 0x65: case 0x66: case 0x67:
- m_a[op&3] = do_add(m_a[op&3], read_arg24(m_pc), 0);
+ m_a[op&3] = do_add(m_a[op&3], read_arg24(m_pc));
break;
// sub imm24, dn
case 0x68: case 0x69: case 0x6a: case 0x6b:
- m_d[op&3] = do_sub(m_d[op&3], read_arg24(m_pc), 0);
+ m_d[op&3] = do_sub(m_d[op&3], read_arg24(m_pc));
break;
// sub imm24, an
case 0x6c: case 0x6d: case 0x6e: case 0x6f:
- m_a[op&3] = do_sub(m_a[op&3], read_arg24(m_pc), 0);
+ m_a[op&3] = do_sub(m_a[op&3], read_arg24(m_pc));
break;
// mov imm24, dn
@@ -1251,12 +1296,12 @@ void mn10200_device::execute_run()
// cmp imm24, dn
case 0x78: case 0x79: case 0x7a: case 0x7b:
- do_sub(m_d[op&3], read_arg24(m_pc), 0);
+ do_sub(m_d[op&3], read_arg24(m_pc));
break;
// cmp imm24, an
case 0x7c: case 0x7d: case 0x7e: case 0x7f:
- do_sub(m_a[op&3], read_arg24(m_pc), 0);
+ do_sub(m_a[op&3], read_arg24(m_pc));
break;
// mov (d24, an), dm
@@ -1514,12 +1559,12 @@ void mn10200_device::execute_run()
// add imm16, an
case 0x08: case 0x09: case 0x0a: case 0x0b:
- m_a[op&3] = do_add(m_a[op&3], (INT16)read_arg16(m_pc), 0);
+ m_a[op&3] = do_add(m_a[op&3], (INT16)read_arg16(m_pc));
break;
// sub imm16, an
case 0x0c: case 0x0d: case 0x0e: case 0x0f:
- m_a[op&3] = do_sub(m_a[op&3], (INT16)read_arg16(m_pc), 0);
+ m_a[op&3] = do_sub(m_a[op&3], (INT16)read_arg16(m_pc));
break;
// and imm16, psw
@@ -1537,12 +1582,12 @@ void mn10200_device::execute_run()
// add imm16, dn
case 0x18: case 0x19: case 0x1a: case 0x1b:
- m_d[op&3] = do_add(m_d[op&3], (INT16)read_arg16(m_pc), 0);
+ m_d[op&3] = do_add(m_d[op&3], (INT16)read_arg16(m_pc));
break;
// sub imm16, dn
case 0x1c: case 0x1d: case 0x1e: case 0x1f:
- m_d[op&3] = do_sub(m_d[op&3], (INT16)read_arg16(m_pc), 0);
+ m_d[op&3] = do_sub(m_d[op&3], (INT16)read_arg16(m_pc));
break;
// mov an, (abs16)
@@ -1564,7 +1609,7 @@ void mn10200_device::execute_run()
// cmp imm16, dn
case 0x48: case 0x49: case 0x4a: case 0x4b:
- do_sub(m_d[op&3], (INT16)read_arg16(m_pc), 0);
+ do_sub(m_d[op&3], (INT16)read_arg16(m_pc));
break;
// xor imm16, dn
@@ -1644,7 +1689,10 @@ void mn10200_device::execute_run()
}
-// internal i/o
+
+//-------------------------------------------------
+// internal i/o
+//-------------------------------------------------
WRITE8_MEMBER(mn10200_device::io_control_w)
{
@@ -2007,19 +2055,19 @@ WRITE8_MEMBER(mn10200_device::io_control_w)
// outputs
case 0x3c0:
m_port[0].out = data;
- m_io->write_byte(MN10200_PORT0, m_port[0].out | (m_port[0].dir ^ 0xff));
+ m_write_port0(MN10200_PORT0, m_port[0].out | (m_port[0].dir ^ 0xff), 0xff);
break;
case 0x264:
m_port[1].out = data;
- m_io->write_byte(MN10200_PORT1, m_port[1].out | (m_port[1].dir ^ 0xff));
+ m_write_port1(MN10200_PORT1, m_port[1].out | (m_port[1].dir ^ 0xff), 0xff);
break;
case 0x3c2:
m_port[2].out = data & 0x0f;
- m_io->write_byte(MN10200_PORT2, m_port[2].out | (m_port[2].dir ^ 0x0f));
+ m_write_port2(MN10200_PORT2, m_port[2].out | (m_port[2].dir ^ 0x0f), 0xff);
break;
case 0x3c3:
m_port[3].out = data & 0x1f;
- m_io->write_byte(MN10200_PORT3, m_port[3].out | (m_port[3].dir ^ 0x1f));
+ m_write_port3(MN10200_PORT3, m_port[3].out | (m_port[3].dir ^ 0x1f), 0xff);
break;
// directions (0=input, 1=output)
@@ -2049,7 +2097,6 @@ WRITE8_MEMBER(mn10200_device::io_control_w)
}
-
READ8_MEMBER(mn10200_device::io_control_r)
{
switch (offset)
@@ -2151,13 +2198,13 @@ READ8_MEMBER(mn10200_device::io_control_r)
// inputs
case 0x3d0:
- return m_io->read_byte(MN10200_PORT0) | m_port[0].dir;
+ return m_read_port0(MN10200_PORT0, 0xff) | m_port[0].dir;
case 0x3d1:
- return m_io->read_byte(MN10200_PORT1) | m_port[1].dir;
+ return m_read_port1(MN10200_PORT1, 0xff) | m_port[1].dir;
case 0x3d2:
- return (m_io->read_byte(MN10200_PORT2) & 0x0f) | m_port[2].dir;
+ return (m_read_port2(MN10200_PORT2, 0xff) & 0x0f) | m_port[2].dir;
case 0x3d3:
- return (m_io->read_byte(MN10200_PORT3) & 0x1f) | m_port[3].dir;
+ return (m_read_port3(MN10200_PORT3, 0xff) & 0x1f) | m_port[3].dir;
// directions (0=input, 1=output)
case 0x3e0:
diff --git a/src/emu/cpu/mn10200/mn10200.h b/src/emu/cpu/mn10200/mn10200.h
index 61ebb96fb0c..59be253f852 100644
--- a/src/emu/cpu/mn10200/mn10200.h
+++ b/src/emu/cpu/mn10200/mn10200.h
@@ -8,27 +8,14 @@
*/
-#pragma once
-
#ifndef MN10200_H
#define MN10200_H
-enum
-{
- MN10200_PC = 0,
- MN10200_PSW,
- MN10200_MDR,
- MN10200_D0,
- MN10200_D1,
- MN10200_D2,
- MN10200_D3,
- MN10200_A0,
- MN10200_A1,
- MN10200_A2,
- MN10200_A3,
- MN10200_NMICR,
- MN10200_IAGR
-};
+// port setup
+#define MCFG_MN10200_READ_PORT_CB(X, _devcb) \
+ mn10200_device::set_read_port##X##_callback(*device, DEVCB_##_devcb);
+#define MCFG_MN10200_WRITE_PORT_CB(X, _devcb) \
+ mn10200_device::set_write_port##X##_callback(*device, DEVCB_##_devcb);
enum
{
@@ -50,9 +37,6 @@ enum
};
-extern const device_type MN1020012A;
-
-
#define MN10200_NUM_PRESCALERS (2)
#define MN10200_NUM_TIMERS_8BIT (10)
#define MN10200_NUM_IRQ_GROUPS (31)
@@ -62,7 +46,25 @@ class mn10200_device : public cpu_device
{
public:
// construction/destruction
- mn10200_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ mn10200_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, address_map_constructor program, const char *shortname, const char *source)
+ : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source)
+ , m_program_config("program", ENDIANNESS_LITTLE, 16, 24, 0, program)
+ , m_read_port0(*this), m_read_port1(*this), m_read_port2(*this), m_read_port3(*this), m_read_port4(*this)
+ , m_write_port0(*this), m_write_port1(*this), m_write_port2(*this), m_write_port3(*this), m_write_port4(*this)
+ { }
+
+ // static configuration helpers
+ template<class _Object> static devcb_base &set_read_port0_callback(device_t &device, _Object object) { return downcast<mn10200_device &>(device).m_read_port0.set_callback(object); }
+ template<class _Object> static devcb_base &set_read_port1_callback(device_t &device, _Object object) { return downcast<mn10200_device &>(device).m_read_port1.set_callback(object); }
+ template<class _Object> static devcb_base &set_read_port2_callback(device_t &device, _Object object) { return downcast<mn10200_device &>(device).m_read_port2.set_callback(object); }
+ template<class _Object> static devcb_base &set_read_port3_callback(device_t &device, _Object object) { return downcast<mn10200_device &>(device).m_read_port3.set_callback(object); }
+ template<class _Object> static devcb_base &set_read_port4_callback(device_t &device, _Object object) { return downcast<mn10200_device &>(device).m_read_port4.set_callback(object); }
+
+ template<class _Object> static devcb_base &set_write_port0_callback(device_t &device, _Object object) { return downcast<mn10200_device &>(device).m_write_port0.set_callback(object); }
+ template<class _Object> static devcb_base &set_write_port1_callback(device_t &device, _Object object) { return downcast<mn10200_device &>(device).m_write_port1.set_callback(object); }
+ template<class _Object> static devcb_base &set_write_port2_callback(device_t &device, _Object object) { return downcast<mn10200_device &>(device).m_write_port2.set_callback(object); }
+ template<class _Object> static devcb_base &set_write_port3_callback(device_t &device, _Object object) { return downcast<mn10200_device &>(device).m_write_port3.set_callback(object); }
+ template<class _Object> static devcb_base &set_write_port4_callback(device_t &device, _Object object) { return downcast<mn10200_device &>(device).m_write_port4.set_callback(object); }
DECLARE_READ8_MEMBER(io_control_r);
DECLARE_WRITE8_MEMBER(io_control_w);
@@ -76,16 +78,13 @@ protected:
virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const { return (clocks + 2 - 1) / 2; } // internal /2 divider
virtual UINT64 execute_cycles_to_clocks(UINT64 cycles) const { return (cycles * 2); } // internal /2 divider
virtual UINT32 execute_min_cycles() const { return 1; }
- virtual UINT32 execute_max_cycles() const { return 13; }
+ virtual UINT32 execute_max_cycles() const { return 13+7; } // max opcode cycles + interrupt duration
virtual UINT32 execute_input_lines() const { return 4; }
virtual void execute_run();
virtual void execute_set_input(int inputnum, int state);
// device_memory_interface overrides
- virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const
- {
- return (spacenum == AS_PROGRAM) ? &m_program_config : ( (spacenum == AS_IO) ? &m_io_config : NULL );
- }
+ virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const { return (spacenum == AS_PROGRAM) ? &m_program_config : NULL; }
// device_state_interface overrides
void state_string_export(const device_state_entry &entry, std::string &str);
@@ -97,10 +96,11 @@ protected:
private:
address_space_config m_program_config;
- address_space_config m_io_config;
-
address_space *m_program;
- address_space *m_io;
+
+ // i/o handlers
+ devcb_read8 m_read_port0, m_read_port1, m_read_port2, m_read_port3, m_read_port4;
+ devcb_write8 m_write_port0, m_write_port1, m_write_port2, m_write_port3, m_write_port4;
int m_cycles;
@@ -112,6 +112,10 @@ private:
UINT16 m_mdr;
// interrupts
+ void take_irq(int level, int group);
+ void check_irq();
+ void check_ext_irq();
+
UINT8 m_icrl[MN10200_NUM_IRQ_GROUPS];
UINT8 m_icrh[MN10200_NUM_IRQ_GROUPS];
@@ -122,6 +126,11 @@ private:
bool m_possible_irq;
// timers
+ void refresh_timer(int tmr);
+ void refresh_all_timers();
+ int timer_tick_simple(int tmr);
+ TIMER_CALLBACK_MEMBER( simple_timer_cb );
+
attotime m_sysclock_base;
emu_timer *m_timer_timers[MN10200_NUM_TIMERS_8BIT];
@@ -185,20 +194,25 @@ private:
inline void change_pc(UINT32 pc) { m_pc = pc & 0xffffff; }
- void take_irq(int level, int group);
- void check_irq();
- void check_ext_irq();
- void refresh_timer(int tmr);
- void refresh_all_timers();
- int timer_tick_simple(int tmr);
- TIMER_CALLBACK_MEMBER( simple_timer_cb );
+ // opcode helpers
void illegal(UINT8 prefix, UINT8 op);
- UINT32 do_add(UINT32 a, UINT32 b, UINT32 c);
- UINT32 do_sub(UINT32 a, UINT32 b, UINT32 c);
+ UINT32 do_add(UINT32 a, UINT32 b, UINT32 c = 0);
+ UINT32 do_sub(UINT32 a, UINT32 b, UINT32 c = 0);
void test_nz16(UINT16 v);
void do_jsr(UINT32 to, UINT32 ret);
- void do_branch(bool state);
+ void do_branch(int condition = 1);
};
-#endif
+class mn1020012a_device : public mn10200_device
+{
+public:
+ mn1020012a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+
+
+extern const device_type MN1020012A;
+
+
+#endif // MN10200_H
diff --git a/src/emu/cpu/nec/nec.c b/src/emu/cpu/nec/nec.c
index 173e18fdebd..6c53cfa677a 100644
--- a/src/emu/cpu/nec/nec.c
+++ b/src/emu/cpu/nec/nec.c
@@ -210,7 +210,7 @@ void nec_common_device::do_prefetch(int previous_ICount)
UINT8 nec_common_device::fetch()
{
prefetch();
- return m_direct->read_raw_byte((Sreg(PS)<<4)+m_ip++, m_fetch_xor);
+ return m_direct->read_byte((Sreg(PS)<<4)+m_ip++, m_fetch_xor);
}
UINT16 nec_common_device::fetchword()
@@ -230,7 +230,7 @@ static UINT8 parity_table[256];
UINT8 nec_common_device::fetchop()
{
prefetch();
- return m_direct->read_decrypted_byte(( Sreg(PS)<<4)+m_ip++, m_fetch_xor);
+ return m_direct->read_byte(( Sreg(PS)<<4)+m_ip++, m_fetch_xor);
}
diff --git a/src/emu/cpu/nec/necpriv.h b/src/emu/cpu/nec/necpriv.h
index 79457f5523a..bee9426cf8d 100644
--- a/src/emu/cpu/nec/necpriv.h
+++ b/src/emu/cpu/nec/necpriv.h
@@ -17,7 +17,7 @@ enum
NEC_TRAP_VECTOR = 1,
NEC_NMI_VECTOR = 2,
NEC_BRKV_VECTOR = 4,
- NEC_CHKIND_VECTOR = 5,
+ NEC_CHKIND_VECTOR = 5
};
/* interrupt sources */
@@ -25,7 +25,7 @@ enum INTSOURCES
{
BRK = 0,
INT_IRQ = 1,
- NMI_IRQ = 2,
+ NMI_IRQ = 2
};
@@ -39,7 +39,7 @@ enum BREGS {
DL = NATIVE_ENDIAN_VALUE_LE_BE(0x4, 0x5),
DH = NATIVE_ENDIAN_VALUE_LE_BE(0x5, 0x4),
BL = NATIVE_ENDIAN_VALUE_LE_BE(0x6, 0x7),
- BH = NATIVE_ENDIAN_VALUE_LE_BE(0x7, 0x6),
+ BH = NATIVE_ENDIAN_VALUE_LE_BE(0x7, 0x6)
};
#define Sreg(x) m_sregs[x]
diff --git a/src/emu/cpu/nec/v25.c b/src/emu/cpu/nec/v25.c
index bf4ee0ab6ed..384043c8f9c 100644
--- a/src/emu/cpu/nec/v25.c
+++ b/src/emu/cpu/nec/v25.c
@@ -122,7 +122,7 @@ void v25_common_device::do_prefetch(int previous_ICount)
UINT8 v25_common_device::fetch()
{
prefetch();
- return m_direct->read_raw_byte((Sreg(PS)<<4)+m_ip++, m_fetch_xor);
+ return m_direct->read_byte((Sreg(PS)<<4)+m_ip++, m_fetch_xor);
}
UINT16 v25_common_device::fetchword()
@@ -146,7 +146,7 @@ UINT8 v25_common_device::fetchop()
UINT8 ret;
prefetch();
- ret = m_direct->read_decrypted_byte(( Sreg(PS)<<4)+m_ip++, m_fetch_xor);
+ ret = m_direct->read_byte(( Sreg(PS)<<4)+m_ip++, m_fetch_xor);
if (m_MF == 0)
if (m_v25v35_decryptiontable)
diff --git a/src/emu/cpu/pdp1/pdp1.c b/src/emu/cpu/pdp1/pdp1.c
index 3c414bd5ed6..bb7beee4128 100644
--- a/src/emu/cpu/pdp1/pdp1.c
+++ b/src/emu/cpu/pdp1/pdp1.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Raphael Nabet
/*
* Note: Original Java source written by:
diff --git a/src/emu/cpu/pdp1/pdp1.h b/src/emu/cpu/pdp1/pdp1.h
index c4c9c8c465e..f4d1281aa07 100644
--- a/src/emu/cpu/pdp1/pdp1.h
+++ b/src/emu/cpu/pdp1/pdp1.h
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Raphael Nabet
#pragma once
diff --git a/src/emu/cpu/pdp1/pdp1dasm.c b/src/emu/cpu/pdp1/pdp1dasm.c
index 036aa3e2f22..c8682ca1491 100644
--- a/src/emu/cpu/pdp1/pdp1dasm.c
+++ b/src/emu/cpu/pdp1/pdp1dasm.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Raphael Nabet
#include "emu.h"
#include "cpu/pdp1/pdp1.h"
diff --git a/src/emu/cpu/pdp1/tx0.c b/src/emu/cpu/pdp1/tx0.c
index 1a3ab230f4b..03c8441d88f 100644
--- a/src/emu/cpu/pdp1/tx0.c
+++ b/src/emu/cpu/pdp1/tx0.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Raphael Nabet
/*
TX-0 emulator
diff --git a/src/emu/cpu/pdp1/tx0.h b/src/emu/cpu/pdp1/tx0.h
index bdb492bbfc3..e88172bc8ff 100644
--- a/src/emu/cpu/pdp1/tx0.h
+++ b/src/emu/cpu/pdp1/tx0.h
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Raphael Nabet
#pragma once
diff --git a/src/emu/cpu/pdp1/tx0dasm.c b/src/emu/cpu/pdp1/tx0dasm.c
index 8eef06f832e..3d8a1daf9e1 100644
--- a/src/emu/cpu/pdp1/tx0dasm.c
+++ b/src/emu/cpu/pdp1/tx0dasm.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Raphael Nabet
#include "emu.h"
#include "cpu/pdp1/tx0.h"
diff --git a/src/emu/cpu/pic16c5x/pic16c5x.c b/src/emu/cpu/pic16c5x/pic16c5x.c
index 0c78f34eebd..3acd46944f7 100644
--- a/src/emu/cpu/pic16c5x/pic16c5x.c
+++ b/src/emu/cpu/pic16c5x/pic16c5x.c
@@ -167,7 +167,7 @@ void pic16c5x_device::update_internalram_ptr()
-#define PIC16C5x_RDOP(A) (m_direct->read_decrypted_word((A)<<1))
+#define PIC16C5x_RDOP(A) (m_direct->read_word((A)<<1))
#define PIC16C5x_RAM_RDMEM(A) ((UINT8)m_data->read_byte(A))
#define PIC16C5x_RAM_WRMEM(A,V) (m_data->write_byte(A,V))
diff --git a/src/emu/cpu/pic16c62x/pic16c62x.c b/src/emu/cpu/pic16c62x/pic16c62x.c
index 42e92b0addf..2a38bcd5f93 100644
--- a/src/emu/cpu/pic16c62x/pic16c62x.c
+++ b/src/emu/cpu/pic16c62x/pic16c62x.c
@@ -57,6 +57,15 @@
#include "pic16c62x.h"
+const device_type PIC16C620 = &device_creator<pic16c620_device>;
+const device_type PIC16C620A = &device_creator<pic16c620a_device>;
+const device_type PIC16C621 = &device_creator<pic16c621_device>;
+const device_type PIC16C621A = &device_creator<pic16c621a_device>;
+const device_type PIC16C622 = &device_creator<pic16c622_device>;
+const device_type PIC16C622A = &device_creator<pic16c622a_device>;
+
+
+
/****************************************************************************
* Internal Memory Map
****************************************************************************/
@@ -161,7 +170,7 @@ void pic16c62x_device::update_internalram_ptr()
m_internalram = (UINT8 *)m_data->get_write_ptr(0x00);
}
-#define PIC16C62x_RDOP(A) (m_direct->read_decrypted_word((A)<<1))
+#define PIC16C62x_RDOP(A) (m_direct->read_word((A)<<1))
#define PIC16C62x_RAM_RDMEM(A) ((UINT8)m_data->read_byte(A))
#define PIC16C62x_RAM_WRMEM(A,V) (m_data->write_byte(A,V))
#define PIC16C62x_In(Port) ((UINT8)m_io->read_byte((Port)))
diff --git a/src/emu/cpu/pic16c62x/pic16c62x.h b/src/emu/cpu/pic16c62x/pic16c62x.h
index 55e78a9a081..f7ac6fd43ae 100644
--- a/src/emu/cpu/pic16c62x/pic16c62x.h
+++ b/src/emu/cpu/pic16c62x/pic16c62x.h
@@ -231,7 +231,7 @@ class pic16cr620a_device : public pic16c62x_device
public:
// construction/destruction
pic16cr620a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-}*/;
+}*/
class pic16c621_device : public pic16c62x_device
{
diff --git a/src/emu/cpu/powerpc/ppc.h b/src/emu/cpu/powerpc/ppc.h
index 3b0129627c7..73bcb0b470b 100644
--- a/src/emu/cpu/powerpc/ppc.h
+++ b/src/emu/cpu/powerpc/ppc.h
@@ -209,7 +209,7 @@ protected:
PPC_MODEL_7457 = 0x80020101, /* "Apollo 7", version 1.1 */
PPC_MODEL_MPC8240 = 0x00810101, /* "Kahlua" */
PPC_MODEL_MPC8241 = 0x80811014, /* "Kahlua Lt" */
- PPC_MODEL_MPC8245 = 0x80811014, /* "Kahlua II" */
+ PPC_MODEL_MPC8245 = 0x80811014 /* "Kahlua II" */
};
public:
diff --git a/src/emu/cpu/powerpc/ppc_dasm.c b/src/emu/cpu/powerpc/ppc_dasm.c
index e1ccb28591c..d80f800c89b 100644
--- a/src/emu/cpu/powerpc/ppc_dasm.c
+++ b/src/emu/cpu/powerpc/ppc_dasm.c
@@ -80,7 +80,7 @@ enum
F_FRT_FRA_FRC, // frT, frA, frC
F_RA_RT_SH_MB_ME, // rA, rT, SH, MB, ME
F_RLWNMx, // rT, rA, rB, MB, ME only used by RLWNMx
- F_RT_RB, // rT, rB
+ F_RT_RB // rT, rB
};
/*
diff --git a/src/emu/cpu/powerpc/ppcdrc.c b/src/emu/cpu/powerpc/ppcdrc.c
index 561dec685bf..088eab855aa 100644
--- a/src/emu/cpu/powerpc/ppcdrc.c
+++ b/src/emu/cpu/powerpc/ppcdrc.c
@@ -1595,7 +1595,7 @@ void ppc_device::generate_checksum_block(drcuml_block *block, compiler_state *co
{
if (!(seqhead->flags & OPFLAG_VIRTUAL_NOOP))
{
- void *base = m_direct->read_decrypted_ptr(seqhead->physpc, m_codexor);
+ void *base = m_direct->read_ptr(seqhead->physpc, m_codexor);
UML_LOAD(block, I0, base, 0, SIZE_DWORD, SCALE_x4); // load i0,base,dword
UML_CMP(block, I0, seqhead->opptr.l[0]); // cmp i0,*opptr
UML_EXHc(block, COND_NE, *m_nocode, seqhead->pc); // exne nocode,seqhead->pc
@@ -1609,20 +1609,20 @@ void ppc_device::generate_checksum_block(drcuml_block *block, compiler_state *co
for (curdesc = seqhead->next(); curdesc != seqlast->next(); curdesc = curdesc->next())
if (!(curdesc->flags & OPFLAG_VIRTUAL_NOOP))
{
- void *base = m_direct->read_decrypted_ptr(seqhead->physpc, m_codexor);
+ void *base = m_direct->read_ptr(seqhead->physpc, m_codexor);
UML_LOAD(block, I0, base, 0, SIZE_DWORD, SCALE_x4); // load i0,base,dword
UML_CMP(block, I0, curdesc->opptr.l[0]); // cmp i0,*opptr
UML_EXHc(block, COND_NE, *m_nocode, seqhead->pc); // exne nocode,seqhead->pc
}
#else
UINT32 sum = 0;
- void *base = m_direct->read_decrypted_ptr(seqhead->physpc, m_codexor);
+ void *base = m_direct->read_ptr(seqhead->physpc, m_codexor);
UML_LOAD(block, I0, base, 0, SIZE_DWORD, SCALE_x4); // load i0,base,dword
sum += seqhead->opptr.l[0];
for (curdesc = seqhead->next(); curdesc != seqlast->next(); curdesc = curdesc->next())
if (!(curdesc->flags & OPFLAG_VIRTUAL_NOOP))
{
- base = m_direct->read_decrypted_ptr(curdesc->physpc, m_codexor);
+ base = m_direct->read_ptr(curdesc->physpc, m_codexor);
UML_LOAD(block, I1, base, 0, SIZE_DWORD, SCALE_x4); // load i1,base,dword
UML_ADD(block, I0, I0, I1); // add i0,i0,i1
sum += curdesc->opptr.l[0];
diff --git a/src/emu/cpu/powerpc/ppcfe.c b/src/emu/cpu/powerpc/ppcfe.c
index 94037f7e137..8ba5a90eb4e 100644
--- a/src/emu/cpu/powerpc/ppcfe.c
+++ b/src/emu/cpu/powerpc/ppcfe.c
@@ -83,7 +83,7 @@ bool ppc_frontend::describe(opcode_desc &desc, const opcode_desc *prev)
}
// fetch the opcode
- op = desc.opptr.l[0] = m_ppc->m_direct->read_decrypted_dword(desc.physpc, m_ppc->m_codexor);
+ op = desc.opptr.l[0] = m_ppc->m_direct->read_dword(desc.physpc, m_ppc->m_codexor);
// all instructions are 4 bytes and default to a single cycle each
desc.length = 4;
diff --git a/src/emu/cpu/pps4/pps4.c b/src/emu/cpu/pps4/pps4.c
index bd04a900030..5be986f2c3d 100644
--- a/src/emu/cpu/pps4/pps4.c
+++ b/src/emu/cpu/pps4/pps4.c
@@ -115,7 +115,7 @@ offs_t pps4_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *opr
*/
inline UINT8 pps4_device::ROP()
{
- const UINT8 op = m_direct->read_decrypted_byte(m_P & 0xFFF);
+ const UINT8 op = m_direct->read_byte(m_P & 0xFFF);
m_Ip = m_I1; // save previous opcode
m_P = (m_P + 1) & 0xFFF;
m_icount -= 1;
@@ -131,7 +131,7 @@ inline UINT8 pps4_device::ROP()
*/
inline UINT8 pps4_device::ARG()
{
- const UINT8 arg = m_direct->read_raw_byte(m_P & 0xFFF);
+ const UINT8 arg = m_direct->read_byte(m_P & 0xFFF);
m_P = (m_P + 1) & 0xFFF;
m_icount -= 1;
return arg;
diff --git a/src/emu/cpu/psx/psx.c b/src/emu/cpu/psx/psx.c
index 271c419c479..a60a1204b9f 100644
--- a/src/emu/cpu/psx/psx.c
+++ b/src/emu/cpu/psx/psx.c
@@ -1437,7 +1437,7 @@ void psxcpu_device::update_cop0( int reg )
( m_cp0r[ CP0_SR ] & SR_IEC ) != 0 &&
( m_cp0r[ CP0_SR ] & m_cp0r[ CP0_CAUSE ] & CAUSE_IP ) != 0 )
{
- m_op = m_direct->read_decrypted_dword( m_pc );
+ m_op = m_direct->read_dword( m_pc );
execute_unstoppable_instructions( 1 );
exception( EXC_INT );
}
@@ -1470,11 +1470,11 @@ void psxcpu_device::fetch_next_op()
{
UINT32 safepc = m_delayv & ~m_bad_word_address_mask;
- m_op = m_direct->read_decrypted_dword( safepc );
+ m_op = m_direct->read_dword( safepc );
}
else
{
- m_op = m_direct->read_decrypted_dword( m_pc + 4 );
+ m_op = m_direct->read_dword( m_pc + 4 );
}
}
@@ -2289,7 +2289,7 @@ void psxcpu_device::execute_run()
if( LOG_BIOSCALL ) log_bioscall();
debugger_instruction_hook( this, m_pc );
- m_op = m_direct->read_decrypted_dword( m_pc );
+ m_op = m_direct->read_dword( m_pc );
if( m_berr )
{
diff --git a/src/emu/cpu/rsp/clamp.h b/src/emu/cpu/rsp/clamp.h
new file mode 100644
index 00000000000..5b69b746a7d
--- /dev/null
+++ b/src/emu/cpu/rsp/clamp.h
@@ -0,0 +1,37 @@
+// license:BSD-3-Clause
+// copyright-holders:Tyler J. Stachecki,Ryan Holtz
+
+static inline rsp_vec_t sclamp_acc_to_mid(rsp_vec_t acc_mid, rsp_vec_t acc_hi)
+{
+ return _mm_packs_epi32(
+ _mm_unpacklo_epi16(acc_mid, acc_hi),
+ _mm_unpackhi_epi16(acc_mid, acc_hi)
+ );
+}
+
+static inline rsp_vec_t uclamp_acc(rsp_vec_t val, rsp_vec_t acc_mid, rsp_vec_t acc_hi, rsp_vec_t zero)
+{
+ rsp_vec_t hi_negative = _mm_srai_epi16(acc_hi, 15); // 0x0000
+ rsp_vec_t mid_negative = _mm_srai_epi16(acc_mid, 15); // 0xffff
+
+ // We don't have to clamp if the HI part of the
+ // accumulator is sign-extended down to the MD part.
+ rsp_vec_t hi_sign_check = _mm_cmpeq_epi16(hi_negative, acc_hi); // 0x0000
+ rsp_vec_t mid_sign_check = _mm_cmpeq_epi16(hi_negative, mid_negative); // 0x0000
+ rsp_vec_t clamp_mask = _mm_and_si128(mid_sign_check, hi_sign_check); // 0x0000
+
+ // Generate the value in the event we need to clamp.
+ // * hi_negative, mid_sign => xxxx
+ // * hi_negative, !mid_sign => 0000
+ // * !hi_negative, mid_sign => FFFF
+ // * !hi_negative, !mid_sign => xxxx
+ rsp_vec_t clamped_val = _mm_cmpeq_epi16(hi_negative, zero); // 0xffff
+
+#if (defined(__SSE4_1__) || defined(_MSC_VER))
+ return _mm_blendv_epi8(clamped_val, val, clamp_mask);
+#else
+ clamped_val = _mm_and_si128(clamp_mask, val);
+ val = _mm_andnot_si128(clamp_mask, clamped_val);
+ return _mm_or_si128(val, clamped_val);
+#endif
+}
diff --git a/src/emu/cpu/rsp/rsp.c b/src/emu/cpu/rsp/rsp.c
index 1bb36af0612..edea79ac688 100644
--- a/src/emu/cpu/rsp/rsp.c
+++ b/src/emu/cpu/rsp/rsp.c
@@ -139,7 +139,6 @@ rsp_device::rsp_device(const machine_config &mconfig, const char *tag, device_t
, m_sp_reg_w_func(*this)
, m_sp_set_status_func(*this)
{
- m_isdrc = mconfig.options().drc() ? true : false;
}
offs_t rsp_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options)
@@ -362,6 +361,7 @@ void rsp_device::resolve_cb()
void rsp_device::device_start()
{
+ m_isdrc = (mconfig().options().drc() && !mconfig().m_force_no_drc) ? true : false;
m_rsp_state = (internal_rsp_state *)m_cache.alloc_near(sizeof(internal_rsp_state));
if (LOG_INSTRUCTION_EXECUTION)
@@ -800,6 +800,10 @@ void rsp_device::execute_run()
{
m_rsp_state->icount = MIN(m_rsp_state->icount, 0);
}
-
+ /*m_cop2->dump(op);
+ if (((op >> 26) & 0x3f) == 0x3a)
+ {
+ m_cop2->dump_dmem();
+ }*/
}
}
diff --git a/src/emu/cpu/rsp/rsp.h b/src/emu/cpu/rsp/rsp.h
index 564f1652109..6bc588c2f01 100644
--- a/src/emu/cpu/rsp/rsp.h
+++ b/src/emu/cpu/rsp/rsp.h
@@ -14,6 +14,7 @@
#ifndef __RSP_H__
#define __RSP_H__
+#include "emu.h"
#include "cpu/drcfe.h"
#include "cpu/drcuml.h"
@@ -133,7 +134,6 @@ class rsp_device : public cpu_device
friend class rsp_frontend;
friend class rsp_cop2;
friend class rsp_cop2_drc;
- friend class rsp_cop2_simd;
public:
// construction/destruction
@@ -163,6 +163,8 @@ public:
void ccfunc_sp_set_status_cb();
void ccfunc_unimplemented();
+ UINT8* get_dmem() { return m_dmem8; }
+
protected:
// device-level overrides
virtual void device_start();
diff --git a/src/emu/cpu/rsp/rspcp2.c b/src/emu/cpu/rsp/rspcp2.c
index 8371583c948..cde6f3b5be8 100644
--- a/src/emu/cpu/rsp/rspcp2.c
+++ b/src/emu/cpu/rsp/rspcp2.c
@@ -1,23 +1,591 @@
// license:BSD-3-Clause
-// copyright-holders:Ryan Holtz
+// copyright-holders:Ryan Holtz,Tyler J. Stachecki
/***************************************************************************
rspcp2.c
Universal machine language-based Nintendo/SGI RSP COP2 emulator.
- Written by Harmony of the MESS team.
+ Written by Ryan Holtz of the MAME team.
***************************************************************************/
#include "emu.h"
#include "rsp.h"
-#include "rspdiv.h"
#include "rspcp2.h"
-#include "cpu/drcfe.h"
-#include "cpu/drcuml.h"
-#include "cpu/drcumlsh.h"
-using namespace uml;
+#if USE_SIMD
+#include <emmintrin.h>
+
+const rsp_cop2::vec_helpers_t rsp_cop2::m_vec_helpers = {
+ { 0 },
+ { // logic_mask
+ { 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff }
+ },
+ { // vrsq_mask_table
+ { 0xffff, 0, 0, 0, 0, 0, 0, 0 },
+ { 0, 0xffff, 0, 0, 0, 0, 0, 0 },
+ { 0, 0, 0xffff, 0, 0, 0, 0, 0 },
+ { 0, 0, 0, 0xffff, 0, 0, 0, 0 },
+ { 0, 0, 0, 0, 0xffff, 0, 0, 0 },
+ { 0, 0, 0, 0, 0, 0xffff, 0, 0 },
+ { 0, 0, 0, 0, 0, 0, 0xffff, 0 },
+ { 0, 0, 0, 0, 0, 0, 0, 0xffff }
+ },
+ { // shuffle_keys
+ { 0x0100, 0x0302, 0x0504, 0x0706, 0x0908, 0x0b0a, 0x0d0c, 0x0f0e }, /* -- */
+ { 0x0100, 0x0302, 0x0504, 0x0706, 0x0908, 0x0b0a, 0x0d0c, 0x0f0e }, /* -- */
+
+ { 0x0100, 0x0100, 0x0504, 0x0504, 0x0908, 0x0908, 0x0d0c, 0x0d0c }, /* 0q */
+ { 0x0302, 0x0302, 0x0706, 0x0706, 0x0b0a, 0x0b0a, 0x0f0e, 0x0f0e }, /* 1q */
+
+ { 0x0100, 0x0100, 0x0100, 0x0100, 0x0908, 0x0908, 0x0908, 0x0908 }, /* 0h */
+ { 0x0302, 0x0302, 0x0302, 0x0302, 0x0b0a, 0x0b0a, 0x0b0a, 0x0b0a }, /* 1h */
+ { 0x0504, 0x0504, 0x0504, 0x0504, 0x0d0c, 0x0d0c, 0x0d0c, 0x0d0c }, /* 2h */
+ { 0x0706, 0x0706, 0x0706, 0x0706, 0x0f0e, 0x0f0e, 0x0f0e, 0x0f0e }, /* 3h */
+
+ { 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100 }, /* 0w */
+ { 0x0302, 0x0302, 0x0302, 0x0302, 0x0302, 0x0302, 0x0302, 0x0302 }, /* 1w */
+ { 0x0504, 0x0504, 0x0504, 0x0504, 0x0504, 0x0504, 0x0504, 0x0504 }, /* 2w */
+ { 0x0706, 0x0706, 0x0706, 0x0706, 0x0706, 0x0706, 0x0706, 0x0706 }, /* 3w */
+ { 0x0908, 0x0908, 0x0908, 0x0908, 0x0908, 0x0908, 0x0908, 0x0908 }, /* 4w */
+ { 0x0b0a, 0x0b0a, 0x0b0a, 0x0b0a, 0x0b0a, 0x0b0a, 0x0b0a, 0x0b0a }, /* 5w */
+ { 0x0d0c, 0x0d0c, 0x0d0c, 0x0d0c, 0x0d0c, 0x0d0c, 0x0d0c, 0x0d0c }, /* 6w */
+ { 0x0f0e, 0x0f0e, 0x0f0e, 0x0f0e, 0x0f0e, 0x0f0e, 0x0f0e, 0x0f0e } /* 7w */
+ },
+ { // sll_b2l_keys
+ { 0x0302, 0x0100, 0x0706, 0x0504, 0x0b0a, 0x0908, 0x0f0e, 0x0d0c },
+ { 0x8003, 0x0201, 0x0007, 0x0605, 0x040b, 0x0a09, 0x080f, 0x0e0d },
+ { 0x8080, 0x0302, 0x0100, 0x0706, 0x0504, 0x0b0a, 0x0908, 0x0f0e },
+ { 0x8080, 0x8003, 0x0201, 0x0007, 0x0605, 0x040b, 0x0a09, 0x080f },
+
+ { 0x8080, 0x8080, 0x0302, 0x0100, 0x0706, 0x0504, 0x0b0a, 0x0908 },
+ { 0x8080, 0x8080, 0x8003, 0x0201, 0x0007, 0x0605, 0x040b, 0x0a09 },
+ { 0x8080, 0x8080, 0x8080, 0x0302, 0x0100, 0x0706, 0x0504, 0x0b0a },
+ { 0x8080, 0x8080, 0x8080, 0x8003, 0x0201, 0x0007, 0x0605, 0x040b },
+
+ { 0x8080, 0x8080, 0x8080, 0x8080, 0x0302, 0x0100, 0x0706, 0x0504 },
+ { 0x8080, 0x8080, 0x8080, 0x8080, 0x8003, 0x0201, 0x0007, 0x0605 },
+ { 0x8080, 0x8080, 0x8080, 0x8080, 0x8080, 0x0302, 0x0100, 0x0706 },
+ { 0x8080, 0x8080, 0x8080, 0x8080, 0x8080, 0x8003, 0x0201, 0x0007 },
+
+ { 0x8080, 0x8080, 0x8080, 0x8080, 0x8080, 0x8080, 0x0302, 0x0100 },
+ { 0x8080, 0x8080, 0x8080, 0x8080, 0x8080, 0x8080, 0x8003, 0x0201 },
+ { 0x8080, 0x8080, 0x8080, 0x8080, 0x8080, 0x8080, 0x8080, 0x0302 },
+ { 0x8080, 0x8080, 0x8080, 0x8080, 0x8080, 0x8080, 0x8080, 0x8003 },
+ },
+ { // sll_l2b_keys
+ { 0x0100, 0x0302, 0x0504, 0x0706, 0x0908, 0x0b0a, 0x0d0c, 0x0f0e },
+ { 0x0201, 0x8003, 0x0605, 0x0007, 0x0a09, 0x040b, 0x0e0d, 0x080f },
+ { 0x0302, 0x8080, 0x0706, 0x0100, 0x0b0a, 0x0504, 0x0f0e, 0x0908 },
+ { 0x8003, 0x8080, 0x0007, 0x0201, 0x040b, 0x0605, 0x080f, 0x0a09 },
+
+ { 0x8080, 0x8080, 0x0100, 0x0302, 0x0504, 0x0706, 0x0908, 0x0b0a },
+ { 0x8080, 0x8080, 0x0201, 0x8003, 0x0605, 0x0007, 0x0a09, 0x040b },
+ { 0x8080, 0x8080, 0x0302, 0x8080, 0x0706, 0x0100, 0x0b0a, 0x0504 },
+ { 0x8080, 0x8080, 0x8003, 0x8080, 0x0007, 0x0201, 0x040b, 0x0605 },
+
+ { 0x8080, 0x8080, 0x8080, 0x8080, 0x0100, 0x0302, 0x0504, 0x0706 },
+ { 0x8080, 0x8080, 0x8080, 0x8080, 0x0201, 0x8003, 0x0605, 0x0007 },
+ { 0x8080, 0x8080, 0x8080, 0x8080, 0x0302, 0x8080, 0x0706, 0x0100 },
+ { 0x8080, 0x8080, 0x8080, 0x8080, 0x8003, 0x8080, 0x0007, 0x0201 },
+
+ { 0x8080, 0x8080, 0x8080, 0x8080, 0x8080, 0x8080, 0x0100, 0x0302 },
+ { 0x8080, 0x8080, 0x8080, 0x8080, 0x8080, 0x8080, 0x0201, 0x8003 },
+ { 0x8080, 0x8080, 0x8080, 0x8080, 0x8080, 0x8080, 0x0302, 0x8080 },
+ { 0x8080, 0x8080, 0x8080, 0x8080, 0x8080, 0x8080, 0x8003, 0x8080 },
+ },
+ { // srl_b2l_keys
+ { 0x0302, 0x0100, 0x0706, 0x0504, 0x0b0a, 0x0908, 0x0f0e, 0x0d0c },
+ { 0x0201, 0x0007, 0x0605, 0x040b, 0x0a09, 0x080f, 0x0e0d, 0x0c80 },
+ { 0x0100, 0x0706, 0x0504, 0x0b0a, 0x0908, 0x0f0e, 0x0d0c, 0x8080 },
+ { 0x0007, 0x0605, 0x040b, 0x0a09, 0x080f, 0x0e0d, 0x0c80, 0x8080 },
+
+ { 0x0706, 0x0504, 0x0b0a, 0x0908, 0x0f0e, 0x0d0c, 0x8080, 0x8080 },
+ { 0x0605, 0x040b, 0x0a09, 0x080f, 0x0e0d, 0x0c80, 0x8080, 0x8080 },
+ { 0x0504, 0x0b0a, 0x0908, 0x0f0e, 0x0d0c, 0x8080, 0x8080, 0x8080 },
+ { 0x040b, 0x0a09, 0x080f, 0x0e0d, 0x0c80, 0x8080, 0x8080, 0x8080 },
+
+ { 0x0b0a, 0x0908, 0x0f0e, 0x0d0c, 0x8080, 0x8080, 0x8080, 0x8080 },
+ { 0x0a09, 0x080f, 0x0e0d, 0x0c80, 0x8080, 0x8080, 0x8080, 0x8080 },
+ { 0x0908, 0x0f0e, 0x0d0c, 0x8080, 0x8080, 0x8080, 0x8080, 0x8080 },
+ { 0x080f, 0x0e0d, 0x0c80, 0x8080, 0x8080, 0x8080, 0x8080, 0x8080 },
+
+ { 0x0f0e, 0x0d0c, 0x8080, 0x8080, 0x8080, 0x8080, 0x8080, 0x8080 },
+ { 0x0e0d, 0x0c80, 0x8080, 0x8080, 0x8080, 0x8080, 0x8080, 0x8080 },
+ { 0x0d0c, 0x8080, 0x8080, 0x8080, 0x8080, 0x8080, 0x8080, 0x8080 },
+ { 0x0c80, 0x8080, 0x8080, 0x8080, 0x8080, 0x8080, 0x8080, 0x8080 },
+ },
+ { // ror_b2l_keys
+ { 0x0302, 0x0100, 0x0706, 0x0504, 0x0b0a, 0x0908, 0x0f0e, 0x0d0c },
+ { 0x0201, 0x0007, 0x0605, 0x040b, 0x0a09, 0x080f, 0x0e0d, 0x0c03 },
+ { 0x0100, 0x0706, 0x0504, 0x0b0a, 0x0908, 0x0f0e, 0x0d0c, 0x0302 },
+ { 0x0007, 0x0605, 0x040b, 0x0a09, 0x080f, 0x0e0d, 0x0c03, 0x0201 },
+
+ { 0x0706, 0x0504, 0x0b0a, 0x0908, 0x0f0e, 0x0d0c, 0x0302, 0x0100 },
+ { 0x0605, 0x040b, 0x0a09, 0x080f, 0x0e0d, 0x0c03, 0x0201, 0x0007 },
+ { 0x0504, 0x0b0a, 0x0908, 0x0f0e, 0x0d0c, 0x0302, 0x0100, 0x0706 },
+ { 0x040b, 0x0a09, 0x080f, 0x0e0d, 0x0c03, 0x0201, 0x0007, 0x0605 },
+
+ { 0x0b0a, 0x0908, 0x0f0e, 0x0d0c, 0x0302, 0x0100, 0x0706, 0x0504 },
+ { 0x0a09, 0x080f, 0x0e0d, 0x0c03, 0x0201, 0x0007, 0x0605, 0x040b },
+ { 0x0908, 0x0f0e, 0x0d0c, 0x0302, 0x0100, 0x0706, 0x0504, 0x0b0a },
+ { 0x080f, 0x0e0d, 0x0c03, 0x0201, 0x0007, 0x0605, 0x040b, 0x0a09 },
+
+ { 0x0f0e, 0x0d0c, 0x0302, 0x0100, 0x0706, 0x0504, 0x0b0a, 0x0908 },
+ { 0x0e0d, 0x0c03, 0x0201, 0x0007, 0x0605, 0x040b, 0x0a09, 0x080f },
+ { 0x0d0c, 0x0302, 0x0100, 0x0706, 0x0504, 0x0b0a, 0x0908, 0x0f0e },
+ { 0x0c03, 0x0201, 0x0007, 0x0605, 0x040b, 0x0a09, 0x080f, 0x0e0d },
+ },
+ { // rol_l2b_keys
+ { 0x0302, 0x0100, 0x0706, 0x0504, 0x0b0a, 0x0908, 0x0f0e, 0x0d0c },
+ { 0x0003, 0x0e01, 0x0407, 0x0205, 0x080b, 0x0609, 0x0c0f, 0x0a0d },
+ { 0x0100, 0x0f0e, 0x0504, 0x0302, 0x0908, 0x0706, 0x0d0c, 0x0b0a },
+ { 0x0e01, 0x0c0f, 0x0205, 0x0003, 0x0609, 0x0407, 0x0a0d, 0x080b },
+
+ { 0x0f0e, 0x0d0c, 0x0302, 0x0100, 0x0706, 0x0504, 0x0b0a, 0x0908 },
+ { 0x0c0f, 0x0a0d, 0x0003, 0x0e01, 0x0407, 0x0205, 0x080b, 0x0609 },
+ { 0x0d0c, 0x0b0a, 0x0100, 0x0f0e, 0x0504, 0x0302, 0x0908, 0x0706 },
+ { 0x0a0d, 0x080b, 0x0e01, 0x0c0f, 0x0205, 0x0003, 0x0609, 0x0407 },
+
+ { 0x0b0a, 0x0908, 0x0f0e, 0x0d0c, 0x0302, 0x0100, 0x0706, 0x0504 },
+ { 0x080b, 0x0609, 0x0c0f, 0x0a0d, 0x0003, 0x0e01, 0x0407, 0x0205 },
+ { 0x0908, 0x0706, 0x0d0c, 0x0b0a, 0x0100, 0x0f0e, 0x0504, 0x0302 },
+ { 0x0609, 0x0407, 0x0a0d, 0x080b, 0x0e01, 0x0c0f, 0x0205, 0x0003 },
+
+ { 0x0706, 0x0504, 0x0b0a, 0x0908, 0x0f0e, 0x0d0c, 0x0302, 0x0100 },
+ { 0x0407, 0x0205, 0x080b, 0x0609, 0x0c0f, 0x0a0d, 0x0003, 0x0e01 },
+ { 0x0504, 0x0302, 0x0908, 0x0706, 0x0d0c, 0x0b0a, 0x0100, 0x0f0e },
+ { 0x0205, 0x0003, 0x0609, 0x0407, 0x0a0d, 0x080b, 0x0e01, 0x0c0f },
+ },
+ { // ror_l2b_keys
+ { 0x0302, 0x0100, 0x0706, 0x0504, 0x0b0a, 0x0908, 0x0f0e, 0x0d0c },
+ { 0x0205, 0x0003, 0x0609, 0x0407, 0x0a0d, 0x080b, 0x0e01, 0x0c0f },
+ { 0x0504, 0x0302, 0x0908, 0x0706, 0x0d0c, 0x0b0a, 0x0100, 0x0f0e },
+ { 0x0407, 0x0205, 0x080b, 0x0609, 0x0c0f, 0x0a0d, 0x0003, 0x0e01 },
+
+ { 0x0706, 0x0504, 0x0b0a, 0x0908, 0x0f0e, 0x0d0c, 0x0302, 0x0100 },
+ { 0x0609, 0x0407, 0x0a0d, 0x080b, 0x0e01, 0x0c0f, 0x0205, 0x0003 },
+ { 0x0908, 0x0706, 0x0d0c, 0x0b0a, 0x0100, 0x0f0e, 0x0504, 0x0302 },
+ { 0x080b, 0x0609, 0x0c0f, 0x0a0d, 0x0003, 0x0e01, 0x0407, 0x0205 },
+
+ { 0x0b0a, 0x0908, 0x0f0e, 0x0d0c, 0x0302, 0x0100, 0x0706, 0x0504 },
+ { 0x0a0d, 0x080b, 0x0e01, 0x0c0f, 0x0205, 0x0003, 0x0609, 0x0407 },
+ { 0x0d0c, 0x0b0a, 0x0100, 0x0f0e, 0x0504, 0x0302, 0x0908, 0x0706 },
+ { 0x0c0f, 0x0a0d, 0x0003, 0x0e01, 0x0407, 0x0205, 0x080b, 0x0609 },
+
+ { 0x0f0e, 0x0d0c, 0x0302, 0x0100, 0x0706, 0x0504, 0x0b0a, 0x0908 },
+ { 0x0e01, 0x0c0f, 0x0205, 0x0003, 0x0609, 0x0407, 0x0a0d, 0x080b },
+ { 0x0100, 0x0f0e, 0x0504, 0x0302, 0x0908, 0x0706, 0x0d0c, 0x0b0a },
+ { 0x0003, 0x0e01, 0x0407, 0x0205, 0x080b, 0x0609, 0x0c0f, 0x0a0d },
+ },
+ { // qr_lut
+ { 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff },
+ { 0xffff, 0xff00, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff },
+ { 0xffff, 0x0000, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff },
+ { 0xff00, 0x0000, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff },
+
+ { 0x0000, 0x0000, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff},
+ { 0x0000, 0x0000, 0xffff, 0xff00, 0xffff, 0xffff, 0xffff, 0xffff },
+ { 0x0000, 0x0000, 0xffff, 0x0000, 0xffff, 0xffff, 0xffff, 0xffff },
+ { 0x0000, 0x0000, 0xff00, 0x0000, 0xffff, 0xffff, 0xffff, 0xffff },
+
+ { 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, 0xffff, 0xffff, 0xffff },
+ { 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, 0xff00, 0xffff, 0xffff },
+ { 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, 0x0000, 0xffff, 0xffff },
+ { 0x0000, 0x0000, 0x0000, 0x0000, 0xff00, 0x0000, 0xffff, 0xffff },
+
+ { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, 0xffff },
+ { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, 0xff00 },
+ { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, 0x0000 },
+ { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xff00, 0x0000 }
+ },
+ { // bdls_lut - mask to denote which part of the vector to load/store.
+ { 0x0000, 0xff00, 0x0000, 0x0000 }, // B
+ { 0x0000, 0xffff, 0x0000, 0x0000 }, // S
+ { 0xffff, 0xffff, 0x0000, 0x0000 }, // L
+ { 0xffff, 0xffff, 0xffff, 0xffff } // D
+ },
+ { // word_reverse
+ 0x0203, 0x0001, 0x0607, 0x0405, 0x0a0b, 0x0809, 0x0e0f, 0x0c0d
+ }
+};
+
+#if !(defined(__SSSE3__) || defined(_MSC_VER))
+// TODO: Highly optimized. More of a stopgap measure.
+static inline rsp_vec_t sse2_pshufb(rsp_vec_t v, const UINT16 *keys)
+{
+ UINT8 dest[16];
+ UINT8 temp[16];
+
+ _mm_storeu_si128((rsp_vec_t *) temp, v);
+
+ for (UINT32 j = 0; j < 8; j++)
+ {
+ UINT16 key = keys[j];
+ UINT8 key_hi = key >> 8;
+ UINT8 key_lo = key >> 0;
+
+ dest[(j << 1) + 1] = key_hi == 0x80 ? 0x00 : temp[key_hi];
+ dest[(j << 1) + 0] = key_lo == 0x80 ? 0x00 : temp[key_lo];
+ }
+
+ return _mm_loadu_si128((rsp_vec_t *) dest);
+}
+
+rsp_vec_t rsp_cop2::vec_load_and_shuffle_operand(const UINT16* src, UINT32 element)
+{
+ if (element >= 8) // element => 0w ... 7w
+ {
+ UINT16 word_lo;
+
+ memcpy(&word_lo, src + (element - 8), sizeof(word_lo));
+ UINT64 dword = word_lo | ((UINT32) word_lo << 16);
+
+ return _mm_shuffle_epi32(_mm_loadl_epi64((rsp_vec_t*) &dword), _MM_SHUFFLE(0,0,0,0));
+ }
+ else if (element >= 4) // element => 0h ... 3h
+ {
+ UINT16 word_lo;
+ UINT16 word_hi;
+
+ memcpy(&word_hi, src + element - 0, sizeof(word_hi));
+ memcpy(&word_lo, src + element - 4, sizeof(word_lo));
+ UINT64 dword = word_lo | ((UINT32) word_hi << 16);
+
+ rsp_vec_t v = _mm_loadl_epi64((rsp_vec_t*) &dword);
+ v = _mm_shufflelo_epi16(v, _MM_SHUFFLE(1,1,0,0));
+ return _mm_shuffle_epi32(v, _MM_SHUFFLE(1,1,0,0));
+ }
+ else if (element >= 2) // element => 0q ... 1q
+ {
+ rsp_vec_t v = vec_load_unshuffled_operand(src);
+
+ if (element == 2) {
+ v = _mm_shufflelo_epi16(v, _MM_SHUFFLE(3,3,1,1));
+ v = _mm_shufflehi_epi16(v, _MM_SHUFFLE(3,3,1,1));
+ }
+ else
+ {
+ v = _mm_shufflelo_epi16(v, _MM_SHUFFLE(2,2,0,0));
+ v = _mm_shufflehi_epi16(v, _MM_SHUFFLE(2,2,0,0));
+ }
+
+ return v;
+ }
+
+ return vec_load_unshuffled_operand(src);
+}
+#else
+rsp_vec_t rsp_cop2::vec_load_and_shuffle_operand(const UINT16* src, UINT32 element)
+{
+ rsp_vec_t operand = _mm_load_si128((rsp_vec_t*) src);
+ rsp_vec_t key = _mm_load_si128((rsp_vec_t*) m_vec_helpers.shuffle_keys[element]);
+
+ return _mm_shuffle_epi8(operand, key);
+}
+#endif
+//
+// SSSE3+ accelerated loads for group I. Byteswap big-endian to 2-byte
+// little-endian vector. Start at vector element offset, discarding any
+// wraparound as necessary.
+//
+// TODO: Reverse-engineer what happens when loads to vector elements must
+// wraparound. Do we just discard the data, as below, or does the
+// data effectively get rotated around the edge of the vector?
+//
+void rsp_cop2::vec_load_group1(UINT32 addr, UINT32 element, UINT16 *regp, rsp_vec_t reg, rsp_vec_t dqm)
+{
+ UINT32 offset = addr & 0x7;
+ UINT32 ror = offset - element;
+
+ // Always load in 8-byte chunks to emulate wraparound.
+ rsp_vec_t data;
+ if (offset) {
+ UINT32 aligned_addr_lo = addr & ~0x7;
+ UINT32 aligned_addr_hi = (aligned_addr_lo + 8) & 0xFFF;
+
+ data = _mm_loadl_epi64((rsp_vec_t *) (m_rsp.get_dmem() + aligned_addr_lo));
+ rsp_vec_t temp = _mm_loadl_epi64((rsp_vec_t *) (m_rsp.get_dmem() + aligned_addr_hi));
+ data = _mm_unpacklo_epi64(data, temp);
+ }
+ else
+ {
+ data = _mm_loadl_epi64((rsp_vec_t *) (m_rsp.get_dmem() + addr));
+ }
+
+ // Shift the DQM up to the point where we mux in the data.
+#if !(defined(__SSSE3__) || defined(_MSC_VER))
+ dqm = sse2_pshufb(dqm, m_vec_helpers.sll_b2l_keys[element]);
+#else
+ rsp_vec_t ekey = _mm_load_si128((rsp_vec_t *) (m_vec_helpers.sll_b2l_keys[element]));
+ dqm = _mm_shuffle_epi8(dqm, ekey);
+#endif
+
+ // Align the data to the DQM so we can mask it in.
+#if !(defined(__SSSE3__) || defined(_MSC_VER))
+ data = sse2_pshufb(data, m_vec_helpers.ror_b2l_keys[ror & 0xF]);
+#else
+ ekey = _mm_load_si128((rsp_vec_t *) (m_vec_helpers.ror_b2l_keys[ror & 0xF]));
+ data = _mm_shuffle_epi8(data, ekey);
+#endif
+
+ // Mask and mux in the data.
+#if (defined(__SSE4_1__) || defined(_MSC_VER))
+ reg = _mm_blendv_epi8(reg, data, dqm);
+#else
+ data = _mm_and_si128(dqm, data);
+ reg = _mm_andnot_si128(dqm, reg);
+ reg = _mm_or_si128(data, reg);
+#endif
+
+ _mm_store_si128((rsp_vec_t *) regp, reg);
+}
+
+//
+// SSSE3+ accelerated loads for group II.
+//
+// TODO: Reverse-engineer what happens when loads to vector elements must
+// wraparound. Do we just discard the data, as below, or does the
+// data effectively get rotated around the edge of the vector?
+//
+// TODO: Reverse-engineer what happens when element != 0.
+//
+void rsp_cop2::vec_load_group2(UINT32 addr, UINT32 element, UINT16 *regp, rsp_vec_t reg, rsp_vec_t dqm, rsp_mem_request_type request_type) {
+ UINT32 offset = addr & 0x7;
+ rsp_vec_t data;
+
+ // Always load in 8-byte chunks to emulate wraparound.
+ if (offset) {
+ UINT32 aligned_addr_lo = addr & ~0x7;
+ UINT32 aligned_addr_hi = (aligned_addr_lo + 8) & 0xFFF;
+ UINT64 datalow, datahigh;
+
+ memcpy(&datalow, m_rsp.get_dmem() + aligned_addr_lo, sizeof(datalow));
+ memcpy(&datahigh, m_rsp.get_dmem() + aligned_addr_hi, sizeof(datahigh));
+
+ // TODO: Test for endian issues?
+ datahigh >>= ((8 - offset) << 3);
+ datalow <<= (offset << 3);
+ datalow = datahigh | datalow;
+
+ data = _mm_loadl_epi64((rsp_vec_t *) &datalow);
+ }
+ else
+ {
+ data = _mm_loadl_epi64((rsp_vec_t *) (m_rsp.get_dmem() + addr));
+ }
+
+ // "Unpack" the data.
+ rsp_vec_t zero = _mm_setzero_si128();
+ data = _mm_unpacklo_epi8(zero, data);
+
+ if (request_type != RSP_MEM_REQUEST_PACK)
+ {
+ data = _mm_srli_epi16(data, 1);
+ }
+
+ data = _mm_shufflehi_epi16(data, _MM_SHUFFLE(0, 1, 2, 3));
+ data = _mm_shufflelo_epi16(data, _MM_SHUFFLE(0, 1, 2, 3));
+
+ _mm_store_si128((rsp_vec_t *) regp, data);
+}
+
+//
+// SSSE3+ accelerated loads for group IV. Byteswap big-endian to 2-byte
+// little-endian vector. Stop loading at quadword boundaries.
+//
+// TODO: Reverse-engineer what happens when loads from vector elements
+// must wraparound (i.e., the address offset is small, starting
+// element is large).
+//
+void rsp_cop2::vec_load_group4(UINT32 addr, UINT32 element, UINT16 *regp, rsp_vec_t reg, rsp_vec_t dqm, rsp_mem_request_type request_type)
+{
+ UINT32 aligned_addr = addr & 0xFF0;
+ UINT32 offset = addr & 0xF;
+ static UINT32 call_count = 0;
+
+ rsp_vec_t data = _mm_load_si128((rsp_vec_t *) (m_rsp.get_dmem() + aligned_addr));
+
+ UINT32 ror;
+ if (request_type == RSP_MEM_REQUEST_QUAD)
+ {
+ ror = 16 - element + offset;
+ }
+ else
+ {
+ // TODO: How is this adjusted for LRV when e != 0?
+ dqm = _mm_cmpeq_epi8(_mm_setzero_si128(), dqm);
+ ror = 16 - offset;
+ }
+
+#if !(defined(__SSSE3__) || defined(_MSC_VER))
+ data = sse2_pshufb(data, m_vec_helpers.ror_b2l_keys[ror & 0xF]);
+ dqm = sse2_pshufb(dqm, m_vec_helpers.ror_b2l_keys[ror & 0xF]);
+#else
+ rsp_vec_t dkey = _mm_load_si128((rsp_vec_t *) (m_vec_helpers.ror_b2l_keys[ror & 0xF]));
+ data = _mm_shuffle_epi8(data, dkey);
+ dqm = _mm_shuffle_epi8(dqm, dkey);
+#endif
+
+ // Mask and mux in the data.
+#if (defined(__SSE4_1__) || defined(_MSC_VER))
+ data = _mm_blendv_epi8(reg, data, dqm);
+#else
+ data = _mm_and_si128(dqm, data);
+ reg = _mm_andnot_si128(dqm, reg);
+ data = _mm_or_si128(data, reg);
+#endif
+
+ _mm_store_si128((rsp_vec_t *) regp, data);
+
+ call_count++;
+}
+
+//
+// SSE3+ accelerated stores for group I. Byteswap 2-byte little-endian
+// vector back to big-endian. Start at vector element offset, wrapping
+// around the edge of the vector as necessary.
+//
+// TODO: Reverse-engineer what happens when stores from vector elements
+// must wraparound. Do we just stop storing the data, or do we
+// continue storing from the front of the vector, as below?
+//
+void rsp_cop2::vec_store_group1(UINT32 addr, UINT32 element, UINT16 *regp, rsp_vec_t reg, rsp_vec_t dqm)
+{
+ UINT32 offset = addr & 0x7;
+ UINT32 ror = element - offset;
+
+ // Shift the DQM up to the point where we mux in the data.
+#if !(defined(__SSSE3__) || defined(_MSC_VER))
+ dqm = sse2_pshufb(dqm, m_vec_helpers.sll_l2b_keys[offset]);
+#else
+ rsp_vec_t ekey = _mm_load_si128((rsp_vec_t *) (m_vec_helpers.sll_l2b_keys[offset]));
+ dqm = _mm_shuffle_epi8(dqm, ekey);
+#endif
+
+ // Rotate the reg to align with the DQM.
+#if !(defined(__SSSE3__) || defined(_MSC_VER))
+ reg = sse2_pshufb(reg, m_vec_helpers.ror_l2b_keys[ror & 0xF]);
+#else
+ ekey = _mm_load_si128((rsp_vec_t *) (m_vec_helpers.ror_l2b_keys[ror & 0xF]));
+ reg = _mm_shuffle_epi8(reg, ekey);
+#endif
+
+ // Always load in 8-byte chunks to emulate wraparound.
+ rsp_vec_t data;
+ if (offset)
+ {
+ UINT32 aligned_addr_lo = addr & ~0x7;
+ UINT32 aligned_addr_hi = (aligned_addr_lo + 8) & 0xFFF;
+
+ data = _mm_loadl_epi64((rsp_vec_t *) (m_rsp.get_dmem() + aligned_addr_lo));
+ rsp_vec_t temp = _mm_loadl_epi64((rsp_vec_t *) (m_rsp.get_dmem() + aligned_addr_hi));
+ data = _mm_unpacklo_epi64(data, temp);
+
+ // Mask and mux in the data.
+#if (defined(__SSE4_1__) || defined(_MSC_VER))
+ data = _mm_blendv_epi8(data, reg, dqm);
+#else
+ data = _mm_andnot_si128(dqm, data);
+ reg = _mm_and_si128(dqm, reg);
+ data = _mm_or_si128(data, reg);
+#endif
+
+ _mm_storel_epi64((rsp_vec_t *) (m_rsp.get_dmem() + aligned_addr_lo), data);
+
+ data = _mm_srli_si128(data, 8);
+ _mm_storel_epi64((rsp_vec_t *) (m_rsp.get_dmem() + aligned_addr_hi), data);
+ }
+ else
+ {
+ data = _mm_loadl_epi64((rsp_vec_t *) (m_rsp.get_dmem() + addr));
+
+ // Mask and mux in the data.
+#if (defined(__SSE4_1__) || defined(_MSC_VER))
+ data = _mm_blendv_epi8(data, reg, dqm);
+#else
+ data = _mm_andnot_si128(dqm, data);
+ reg = _mm_and_si128(dqm, reg);
+ data = _mm_or_si128(data, reg);
+#endif
+
+ _mm_storel_epi64((rsp_vec_t *) (m_rsp.get_dmem() + addr), data);
+ }
+}
+
+//
+// SSE3+ accelerated stores for group II. Byteswap 2-byte little-endian
+// vector back to big-endian. Start at vector element offset, wrapping
+// around the edge of the vector as necessary.
+//
+// TODO: Reverse-engineer what happens when stores from vector elements
+// must wraparound. Do we just stop storing the data, or do we
+// continue storing from the front of the vector, as below?
+//
+// TODO: Reverse-engineer what happens when element != 0.
+//
+void rsp_cop2::vec_store_group2(UINT32 addr, UINT32 element, UINT16 *regp, rsp_vec_t reg, rsp_vec_t dqm, rsp_mem_request_type request_type) {
+ // "Pack" the data.
+ if (request_type != RSP_MEM_REQUEST_PACK)
+ {
+ reg = _mm_slli_epi16(reg, 1);
+ }
+
+ reg = _mm_srai_epi16(reg, 8);
+ reg = _mm_packs_epi16(reg, reg);
+
+#if !(defined(__SSSE3__) || defined(_MSC_VER))
+ reg = sse2_pshufb(reg, m_vec_helpers.word_reverse);
+#else
+ rsp_vec_t dkey = _mm_load_si128((rsp_vec_t *) (m_vec_helpers.word_reverse));
+ reg = _mm_shuffle_epi8(reg, dkey);
+#endif
+
+ // TODO: Always store in 8-byte chunks to emulate wraparound.
+ _mm_storel_epi64((rsp_vec_t *) (m_rsp.get_dmem() + addr), reg);
+}
+
+//
+// SSE3+ accelerated stores for group IV. Byteswap 2-byte little-endian
+// vector back to big-endian. Stop storing at quadword boundaries.
+//
+void rsp_cop2::vec_store_group4(UINT32 addr, UINT32 element, UINT16 *regp, rsp_vec_t reg, rsp_vec_t dqm, rsp_mem_request_type request_type) {
+ UINT32 aligned_addr = addr & 0xFF0;
+ UINT32 offset = addr & 0xF;
+ UINT32 rol = offset;
+
+ rsp_vec_t data = _mm_load_si128((rsp_vec_t *) (m_rsp.get_dmem() + aligned_addr));
+
+ if (request_type == RSP_MEM_REQUEST_QUAD)
+ {
+ rol -= element;
+ }
+ else
+ {
+ // TODO: How is this adjusted for SRV when e != 0?
+ dqm = _mm_cmpeq_epi8(_mm_setzero_si128(), dqm);
+ }
+
+#if !(defined(__SSSE3__) || defined(_MSC_VER))
+ reg = sse2_pshufb(reg, m_vec_helpers.rol_l2b_keys[rol & 0xF]);
+#else
+ rsp_vec_t ekey = _mm_load_si128((rsp_vec_t *) (m_vec_helpers.rol_l2b_keys[rol & 0xF]));
+ reg = _mm_shuffle_epi8(reg, ekey);
+#endif
+
+ // Mask and mux out the data, write.
+#if (defined(__SSE4_1__) || defined(_MSC_VER))
+ data = _mm_blendv_epi8(data, reg, dqm);
+#else
+ reg = _mm_and_si128(dqm, reg);
+ data = _mm_andnot_si128(dqm, data);
+ data = _mm_or_si128(data, reg);
+#endif
+
+ _mm_store_si128((rsp_vec_t *) (m_rsp.get_dmem() + aligned_addr), data);
+}
+#endif
extern offs_t rsp_dasm_one(char *buffer, offs_t pc, UINT32 op);
@@ -100,6 +668,7 @@ extern offs_t rsp_dasm_one(char *buffer, offs_t pc, UINT32 op);
VREG_S(VDREG, 7) = m_vres[7]; \
}
+#if !USE_SIMD
static const int vector_elements_2[16][8] =
{
{ 0, 1, 2, 3, 4, 5, 6, 7 }, // none
@@ -119,6 +688,7 @@ static const int vector_elements_2[16][8] =
{ 6, 6, 6, 6, 6, 6, 6, 6 }, // 6
{ 7, 7, 7, 7, 7, 7, 7, 7 }, // 7
};
+#endif
rsp_cop2::rsp_cop2(rsp_device &rsp, running_machine &machine)
: m_rsp(rsp)
@@ -131,6 +701,13 @@ rsp_cop2::rsp_cop2(rsp_device &rsp, running_machine &machine)
memset(m_v, 0, sizeof(m_v));
memset(m_vflag, 0, sizeof(m_vflag));
memset(m_accum, 0, sizeof(m_accum));
+#if USE_SIMD
+ memset(&m_acc, 0, sizeof(m_acc));
+ memset(&m_flags, 0, sizeof(aligned_rsp_2vect_t) * 3);
+ m_div_out = 0;
+ m_div_in = 0;
+#endif
+ m_rspcop2_state = (internal_rspcop2_state *)rsp.m_cache.alloc_near(sizeof(internal_rspcop2_state));
}
rsp_cop2::~rsp_cop2()
@@ -278,14 +855,16 @@ void rsp_cop2::state_string_export(const int index, std::string &str)
void rsp_cop2::handle_lwc2(UINT32 op)
{
+ int base = (op >> 21) & 0x1f;
+#if !USE_SIMD
int i, end;
UINT32 ea;
int dest = (op >> 16) & 0x1f;
- int base = (op >> 21) & 0x1f;
int index = (op >> 7) & 0xf;
int offset = (op & 0x7f);
if (offset & 0x40)
offset |= 0xffffffc0;
+#endif
switch ((op >> 11) & 0x1f)
{
@@ -298,8 +877,14 @@ void rsp_cop2::handle_lwc2(UINT32 op)
//
// Load 1 byte to vector byte index
+ //printf("LBV ");
+#if USE_SIMD
+ vec_lbdlsv_sbdlsv(op, m_rsp.m_rsp_state->r[base]);
+#else
ea = (base) ? m_rsp.m_rsp_state->r[base] + offset : offset;
VREG_B(dest, index) = m_rsp.READ8(ea);
+#endif
+ //
break;
}
case 0x01: /* LSV */
@@ -311,6 +896,10 @@ void rsp_cop2::handle_lwc2(UINT32 op)
//
// Loads 2 bytes starting from vector byte index
+ //printf("LSV ");
+#if USE_SIMD
+ vec_lbdlsv_sbdlsv(op, m_rsp.m_rsp_state->r[base]);
+#else
ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 2) : (offset * 2);
end = index + 2;
@@ -320,6 +909,8 @@ void rsp_cop2::handle_lwc2(UINT32 op)
VREG_B(dest, i) = m_rsp.READ8(ea);
ea++;
}
+#endif
+ //
break;
}
case 0x02: /* LLV */
@@ -331,6 +922,10 @@ void rsp_cop2::handle_lwc2(UINT32 op)
//
// Loads 4 bytes starting from vector byte index
+ //printf("LLV ");
+#if USE_SIMD
+ vec_lbdlsv_sbdlsv(op, m_rsp.m_rsp_state->r[base]);
+#else
ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 4) : (offset * 4);
end = index + 4;
@@ -340,6 +935,8 @@ void rsp_cop2::handle_lwc2(UINT32 op)
VREG_B(dest, i) = m_rsp.READ8(ea);
ea++;
}
+#endif
+ //
break;
}
case 0x03: /* LDV */
@@ -351,6 +948,10 @@ void rsp_cop2::handle_lwc2(UINT32 op)
//
// Loads 8 bytes starting from vector byte index
+ //printf("LDV ");
+#if USE_SIMD
+ vec_lbdlsv_sbdlsv(op, m_rsp.m_rsp_state->r[base]);
+#else
ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 8) : (offset * 8);
end = index + 8;
@@ -360,6 +961,8 @@ void rsp_cop2::handle_lwc2(UINT32 op)
VREG_B(dest, i) = m_rsp.READ8(ea);
ea++;
}
+#endif
+ //
break;
}
case 0x04: /* LQV */
@@ -371,6 +974,10 @@ void rsp_cop2::handle_lwc2(UINT32 op)
//
// Loads up to 16 bytes starting from vector byte index
+ //printf("LQV ");
+#if USE_SIMD
+ vec_lqrv_sqrv(op, m_rsp.m_rsp_state->r[base]);
+#else
ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 16) : (offset * 16);
end = index + (16 - (ea & 0xf));
@@ -381,6 +988,8 @@ void rsp_cop2::handle_lwc2(UINT32 op)
VREG_B(dest, i) = m_rsp.READ8(ea);
ea++;
}
+#endif
+ //
break;
}
case 0x05: /* LRV */
@@ -392,6 +1001,10 @@ void rsp_cop2::handle_lwc2(UINT32 op)
//
// Stores up to 16 bytes starting from right side until 16-byte boundary
+ //printf("LRV ");
+#if USE_SIMD
+ vec_lqrv_sqrv(op, m_rsp.m_rsp_state->r[base]);
+#else
ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 16) : (offset * 16);
index = 16 - ((ea & 0xf) - index);
@@ -403,6 +1016,8 @@ void rsp_cop2::handle_lwc2(UINT32 op)
VREG_B(dest, i) = m_rsp.READ8(ea);
ea++;
}
+#endif
+ //
break;
}
case 0x06: /* LPV */
@@ -414,12 +1029,18 @@ void rsp_cop2::handle_lwc2(UINT32 op)
//
// Loads a byte as the upper 8 bits of each element
+ //printf("LPV ");
+#if USE_SIMD
+ vec_lfhpuv_sfhpuv(op, m_rsp.m_rsp_state->r[base]);
+#else
ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 8) : (offset * 8);
for (i=0; i < 8; i++)
{
VREG_S(dest, i) = m_rsp.READ8(ea + (((16-index) + i) & 0xf)) << 8;
}
+#endif
+ //
break;
}
case 0x07: /* LUV */
@@ -431,12 +1052,18 @@ void rsp_cop2::handle_lwc2(UINT32 op)
//
// Loads a byte as the bits 14-7 of each element
+ //printf("LUV ");
+#if USE_SIMD
+ vec_lfhpuv_sfhpuv(op, m_rsp.m_rsp_state->r[base]);
+#else
ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 8) : (offset * 8);
for (i=0; i < 8; i++)
{
VREG_S(dest, i) = m_rsp.READ8(ea + (((16-index) + i) & 0xf)) << 7;
}
+#endif
+ //
break;
}
case 0x08: /* LHV */
@@ -448,12 +1075,18 @@ void rsp_cop2::handle_lwc2(UINT32 op)
//
// Loads a byte as the bits 14-7 of each element, with 2-byte stride
+ //printf("LHV ");
+#if USE_SIMD
+ vec_lfhpuv_sfhpuv(op, m_rsp.m_rsp_state->r[base]);
+#else
ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 16) : (offset * 16);
for (i=0; i < 8; i++)
{
VREG_S(dest, i) = m_rsp.READ8(ea + (((16-index) + (i<<1)) & 0xf)) << 7;
}
+#endif
+ //
break;
}
case 0x09: /* LFV */
@@ -465,6 +1098,10 @@ void rsp_cop2::handle_lwc2(UINT32 op)
//
// Loads a byte as the bits 14-7 of upper or lower quad, with 4-byte stride
+ //printf("LFV ");
+#if USE_SIMD
+ vec_lfhpuv_sfhpuv(op, m_rsp.m_rsp_state->r[base]);
+#else
ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 16) : (offset * 16);
// not sure what happens if 16-byte boundary is crossed...
@@ -476,6 +1113,8 @@ void rsp_cop2::handle_lwc2(UINT32 op)
VREG_S(dest, i) = m_rsp.READ8(ea) << 7;
ea += 4;
}
+#endif
+ //
break;
}
case 0x0a: /* LWV */
@@ -488,6 +1127,9 @@ void rsp_cop2::handle_lwc2(UINT32 op)
// Loads the full 128-bit vector starting from vector byte index and wrapping to index 0
// after byte index 15
+ //printf("LWV ");
+#if USE_SIMD
+#else
ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 16) : (offset * 16);
end = (16 - index) + 16;
@@ -497,6 +1139,8 @@ void rsp_cop2::handle_lwc2(UINT32 op)
VREG_B(dest, i & 0xf) = m_rsp.READ8(ea);
ea += 4;
}
+#endif
+ //
break;
}
case 0x0b: /* LTV */
@@ -510,20 +1154,27 @@ void rsp_cop2::handle_lwc2(UINT32 op)
// FIXME: has a small problem with odd indices
- int element;
- int vs = dest;
- int ve = dest + 8;
+ //printf("LTV ");
+#if 0
+#else
+ INT32 index = (op >> 7) & 0xf;
+ INT32 offset = (op & 0x7f);
+ if (offset & 0x40)
+ offset |= 0xffffffc0;
+
+ INT32 vs = (op >> 16) & 0x1f;
+ INT32 ve = vs + 8;
if (ve > 32)
ve = 32;
- element = 7 - (index >> 1);
+ INT32 element = 7 - (index >> 1);
if (index & 1) fatalerror("RSP: LTV: index = %d\n", index);
- ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 16) : (offset * 16);
+ UINT32 ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 16) : (offset * 16);
ea = ((ea + 8) & ~0xf) + (index & 1);
- for (i=vs; i < ve; i++)
+ for (INT32 i = vs; i < ve; i++)
{
element = ((8 - (index >> 1) + (i-vs)) << 1);
VREG_B(i, (element & 0xf)) = m_rsp.READ8(ea);
@@ -531,6 +1182,8 @@ void rsp_cop2::handle_lwc2(UINT32 op)
ea += 2;
}
+#endif
+ //
break;
}
@@ -549,15 +1202,17 @@ void rsp_cop2::handle_lwc2(UINT32 op)
void rsp_cop2::handle_swc2(UINT32 op)
{
+ int base = (op >> 21) & 0x1f;
+#if !USE_SIMD
int i, end;
int eaoffset;
UINT32 ea;
int dest = (op >> 16) & 0x1f;
- int base = (op >> 21) & 0x1f;
int index = (op >> 7) & 0xf;
int offset = (op & 0x7f);
if (offset & 0x40)
offset |= 0xffffffc0;
+#endif
switch ((op >> 11) & 0x1f)
{
@@ -570,8 +1225,14 @@ void rsp_cop2::handle_swc2(UINT32 op)
//
// Stores 1 byte from vector byte index
+ //printf("SBV ");
+#if USE_SIMD
+ vec_lbdlsv_sbdlsv(op, m_rsp.m_rsp_state->r[base]);
+#else
ea = (base) ? m_rsp.m_rsp_state->r[base] + offset : offset;
m_rsp.WRITE8(ea, VREG_B(dest, index));
+#endif
+ //
break;
}
case 0x01: /* SSV */
@@ -583,6 +1244,10 @@ void rsp_cop2::handle_swc2(UINT32 op)
//
// Stores 2 bytes starting from vector byte index
+ //printf("SSV ");
+#if USE_SIMD
+ vec_lbdlsv_sbdlsv(op, m_rsp.m_rsp_state->r[base]);
+#else
ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 2) : (offset * 2);
end = index + 2;
@@ -592,6 +1257,8 @@ void rsp_cop2::handle_swc2(UINT32 op)
m_rsp.WRITE8(ea, VREG_B(dest, i));
ea++;
}
+#endif
+ //
break;
}
case 0x02: /* SLV */
@@ -603,6 +1270,10 @@ void rsp_cop2::handle_swc2(UINT32 op)
//
// Stores 4 bytes starting from vector byte index
+ //printf("SLV ");
+#if USE_SIMD
+ vec_lbdlsv_sbdlsv(op, m_rsp.m_rsp_state->r[base]);
+#else
ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 4) : (offset * 4);
end = index + 4;
@@ -612,6 +1283,8 @@ void rsp_cop2::handle_swc2(UINT32 op)
m_rsp.WRITE8(ea, VREG_B(dest, i));
ea++;
}
+#endif
+ //
break;
}
case 0x03: /* SDV */
@@ -623,6 +1296,10 @@ void rsp_cop2::handle_swc2(UINT32 op)
//
// Stores 8 bytes starting from vector byte index
+ //printf("SDV ");
+#if USE_SIMD
+ vec_lbdlsv_sbdlsv(op, m_rsp.m_rsp_state->r[base]);
+#else
ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 8) : (offset * 8);
end = index + 8;
@@ -632,6 +1309,8 @@ void rsp_cop2::handle_swc2(UINT32 op)
m_rsp.WRITE8(ea, VREG_B(dest, i));
ea++;
}
+#endif
+ //
break;
}
case 0x04: /* SQV */
@@ -643,6 +1322,10 @@ void rsp_cop2::handle_swc2(UINT32 op)
//
// Stores up to 16 bytes starting from vector byte index until 16-byte boundary
+ //printf("SQV ");
+#if USE_SIMD
+ vec_lqrv_sqrv(op, m_rsp.m_rsp_state->r[base]);
+#else
ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 16) : (offset * 16);
end = index + (16 - (ea & 0xf));
@@ -652,6 +1335,8 @@ void rsp_cop2::handle_swc2(UINT32 op)
m_rsp.WRITE8(ea, VREG_B(dest, i & 0xf));
ea++;
}
+#endif
+ //
break;
}
case 0x05: /* SRV */
@@ -663,6 +1348,10 @@ void rsp_cop2::handle_swc2(UINT32 op)
//
// Stores up to 16 bytes starting from right side until 16-byte boundary
+ //printf("SRV ");
+#if USE_SIMD
+ vec_lqrv_sqrv(op, m_rsp.m_rsp_state->r[base]);
+#else
int o;
ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 16) : (offset * 16);
@@ -675,6 +1364,8 @@ void rsp_cop2::handle_swc2(UINT32 op)
m_rsp.WRITE8(ea, VREG_B(dest, ((i + o) & 0xf)));
ea++;
}
+#endif
+ //
break;
}
case 0x06: /* SPV */
@@ -686,6 +1377,10 @@ void rsp_cop2::handle_swc2(UINT32 op)
//
// Stores upper 8 bits of each element
+ //printf("SPV ");
+#if USE_SIMD
+ vec_lfhpuv_sfhpuv(op, m_rsp.m_rsp_state->r[base]);
+#else
ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 8) : (offset * 8);
end = index + 8;
@@ -701,6 +1396,8 @@ void rsp_cop2::handle_swc2(UINT32 op)
}
ea++;
}
+#endif
+ //
break;
}
case 0x07: /* SUV */
@@ -712,6 +1409,10 @@ void rsp_cop2::handle_swc2(UINT32 op)
//
// Stores bits 14-7 of each element
+ //printf("SUV ");
+#if USE_SIMD
+ vec_lfhpuv_sfhpuv(op, m_rsp.m_rsp_state->r[base]);
+#else
ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 8) : (offset * 8);
end = index + 8;
@@ -727,6 +1428,8 @@ void rsp_cop2::handle_swc2(UINT32 op)
}
ea++;
}
+#endif
+ //
break;
}
case 0x08: /* SHV */
@@ -738,6 +1441,10 @@ void rsp_cop2::handle_swc2(UINT32 op)
//
// Stores bits 14-7 of each element, with 2-byte stride
+ //printf("SHV ");
+#if USE_SIMD
+ vec_lfhpuv_sfhpuv(op, m_rsp.m_rsp_state->r[base]);
+#else
ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 16) : (offset * 16);
for (i=0; i < 8; i++)
@@ -748,6 +1455,8 @@ void rsp_cop2::handle_swc2(UINT32 op)
m_rsp.WRITE8(ea, d);
ea += 2;
}
+#endif
+ //
break;
}
case 0x09: /* SFV */
@@ -761,6 +1470,10 @@ void rsp_cop2::handle_swc2(UINT32 op)
// FIXME: only works for index 0 and index 8
+ //printf("SFV ");
+#if USE_SIMD
+ vec_lfhpuv_sfhpuv(op, m_rsp.m_rsp_state->r[base]);
+#else
ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 16) : (offset * 16);
eaoffset = ea & 0xf;
@@ -773,6 +1486,8 @@ void rsp_cop2::handle_swc2(UINT32 op)
m_rsp.WRITE8(ea + (eaoffset & 0xf), VREG_S(dest, i) >> 7);
eaoffset += 4;
}
+#endif
+ //
break;
}
case 0x0a: /* SWV */
@@ -785,6 +1500,9 @@ void rsp_cop2::handle_swc2(UINT32 op)
// Stores the full 128-bit vector starting from vector byte index and wrapping to index 0
// after byte index 15
+ //printf("SWV ");
+#if USE_SIMD
+#else
ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 16) : (offset * 16);
eaoffset = ea & 0xf;
@@ -797,6 +1515,8 @@ void rsp_cop2::handle_swc2(UINT32 op)
m_rsp.WRITE8(ea + (eaoffset & 0xf), VREG_B(dest, i & 0xf));
eaoffset++;
}
+#endif
+ //
break;
}
case 0x0b: /* STV */
@@ -808,25 +1528,34 @@ void rsp_cop2::handle_swc2(UINT32 op)
//
// Stores one element from maximum of 8 vectors, while incrementing element index
- int element;
- int vs = dest;
- int ve = dest + 8;
+ //printf("STV ");
+#if 0
+#else
+ INT32 index = (op >> 7) & 0xf;
+ INT32 offset = (op & 0x7f);
+ if (offset & 0x40)
+ offset |= 0xffffffc0;
+
+ INT32 vs = (op >> 16) & 0x1f;
+ INT32 ve = vs + 8;
if (ve > 32)
ve = 32;
- element = 8 - (index >> 1);
+ INT32 element = 8 - (index >> 1);
- ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 16) : (offset * 16);
+ UINT32 ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 16) : (offset * 16);
- eaoffset = (ea & 0xf) + (element * 2);
+ INT32 eaoffset = (ea & 0xf) + (element * 2);
ea &= ~0xf;
- for (i=vs; i < ve; i++)
+ for (INT32 i = vs; i < ve; i++)
{
m_rsp.WRITE16(ea + (eaoffset & 0xf), VREG_S(i, element & 0x7));
eaoffset += 2;
element++;
}
+#endif
+ //
break;
}
@@ -904,7 +1633,9 @@ UINT16 rsp_cop2::SATURATE_ACCUM(int accum, int slice, UINT16 negative, UINT16 po
void rsp_cop2::handle_vector_ops(UINT32 op)
{
+#if !USE_SIMD
int i;
+#endif
// Opcode legend:
// E = VS2 element type
@@ -923,6 +1654,20 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
//
// Multiplies signed integer by signed integer * 2
+ //printf("MULF ");
+#if USE_SIMD
+ UINT16 *acc = m_acc.s;
+ rsp_vec_t acc_lo, acc_mid, acc_hi;
+
+ rsp_vec_t vs = vec_load_unshuffled_operand(m_v[VS1REG].s);
+ rsp_vec_t vt_shuffle = vec_load_and_shuffle_operand(m_v[VS2REG].s, EL);
+
+ m_v[VDREG].v = vec_vmulf_vmulu(op, vs, vt_shuffle, vec_zero(), &acc_lo, &acc_mid, &acc_hi);
+
+ write_acc_lo(acc, acc_lo);
+ write_acc_mid(acc, acc_mid);
+ write_acc_hi(acc, acc_hi);
+#else
for (i=0; i < 8; i++)
{
INT32 s1 = (INT32)(INT16)VREG_S(VS1REG, i);
@@ -947,8 +1692,10 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
}
}
WRITEBACK_RESULT();
-
+#endif
+ //
break;
+
}
case 0x01: /* VMULU */
@@ -959,6 +1706,20 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
// ------------------------------------------------------
//
+ //printf("MULU ");
+#if USE_SIMD
+ UINT16 *acc = m_acc.s;
+ rsp_vec_t acc_lo, acc_mid, acc_hi;
+
+ rsp_vec_t vs = vec_load_unshuffled_operand(m_v[VS1REG].s);
+ rsp_vec_t vt_shuffle = vec_load_and_shuffle_operand(m_v[VS2REG].s, EL);
+
+ m_v[VDREG].v = vec_vmulf_vmulu(op, vs, vt_shuffle, vec_zero(), &acc_lo, &acc_mid, &acc_hi);
+
+ write_acc_lo(acc, acc_lo);
+ write_acc_mid(acc, acc_mid);
+ write_acc_hi(acc, acc_hi);
+#else
for (i=0; i < 8; i++)
{
INT32 s1 = (INT32)(INT16)VREG_S(VS1REG, i);
@@ -985,6 +1746,8 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
}
}
WRITEBACK_RESULT();
+#endif
+ //
break;
}
@@ -999,6 +1762,24 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
// Stores the higher 16 bits of the 32-bit result to accumulator
// The low slice of accumulator is stored into destination element
+ //printf("MUDL ");
+#if USE_SIMD
+ UINT16 *acc = m_acc.s;
+ rsp_vec_t acc_lo, acc_mid, acc_hi;
+
+ acc_lo = read_acc_lo(acc);
+ acc_mid = read_acc_mid(acc);
+ acc_hi = read_acc_hi(acc);
+
+ rsp_vec_t vs = vec_load_unshuffled_operand(m_v[VS1REG].s);
+ rsp_vec_t vt_shuffle = vec_load_and_shuffle_operand(m_v[VS2REG].s, EL);
+
+ m_v[VDREG].v = vec_vmadl_vmudl(op, vs, vt_shuffle, vec_zero(), &acc_lo, &acc_mid, &acc_hi);
+
+ write_acc_lo(acc, acc_lo);
+ write_acc_mid(acc, acc_mid);
+ write_acc_hi(acc, acc_hi);
+#else
for (i=0; i < 8; i++)
{
UINT32 s1 = (UINT32)(UINT16)VREG_S(VS1REG, i);
@@ -1012,6 +1793,8 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
m_vres[i] = ACCUM_L(i);
}
WRITEBACK_RESULT();
+#endif
+ //
break;
}
@@ -1026,6 +1809,24 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
// The result is stored into accumulator
// The middle slice of accumulator is stored into destination element
+ //printf("MUDM ");
+#if USE_SIMD
+ UINT16 *acc = m_acc.s;
+ rsp_vec_t acc_lo, acc_mid, acc_hi;
+
+ acc_lo = read_acc_lo(acc);
+ acc_mid = read_acc_mid(acc);
+ acc_hi = read_acc_hi(acc);
+
+ rsp_vec_t vs = vec_load_unshuffled_operand(m_v[VS1REG].s);
+ rsp_vec_t vt_shuffle = vec_load_and_shuffle_operand(m_v[VS2REG].s, EL);
+
+ m_v[VDREG].v = vec_vmadm_vmudm(op, vs, vt_shuffle, vec_zero(), &acc_lo, &acc_mid, &acc_hi);
+
+ write_acc_lo(acc, acc_lo);
+ write_acc_mid(acc, acc_mid);
+ write_acc_hi(acc, acc_hi);
+#else
for (i=0; i < 8; i++)
{
INT32 s1 = (INT32)(INT16)VREG_S(VS1REG, i);
@@ -1039,6 +1840,8 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
m_vres[i] = ACCUM_M(i);
}
WRITEBACK_RESULT();
+#endif
+ //
break;
}
@@ -1054,6 +1857,22 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
// The result is stored into accumulator
// The low slice of accumulator is stored into destination element
+ //printf("MUDN ");
+#if USE_SIMD
+ UINT16 *acc = m_acc.s;
+ rsp_vec_t acc_lo = read_acc_lo(acc);
+ rsp_vec_t acc_mid = read_acc_mid(acc);
+ rsp_vec_t acc_hi = read_acc_hi(acc);
+
+ rsp_vec_t vs = vec_load_unshuffled_operand(m_v[VS1REG].s);
+ rsp_vec_t vt_shuffle = vec_load_and_shuffle_operand(m_v[VS2REG].s, EL);
+
+ m_v[VDREG].v = vec_vmadn_vmudn(op, vs, vt_shuffle, vec_zero(), &acc_lo, &acc_mid, &acc_hi);
+
+ write_acc_lo(acc, acc_lo);
+ write_acc_mid(acc, acc_mid);
+ write_acc_hi(acc, acc_hi);
+#else
for (i=0; i < 8; i++)
{
INT32 s1 = (UINT16)VREG_S(VS1REG, i); // not sign-extended
@@ -1067,6 +1886,8 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
m_vres[i] = ACCUM_L(i);
}
WRITEBACK_RESULT();
+#endif
+ //
break;
}
@@ -1081,6 +1902,24 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
// The result is stored into highest 32 bits of accumulator, the low slice is zero
// The highest 32 bits of accumulator is saturated into destination element
+ //printf("MUDH ");
+#if USE_SIMD
+ UINT16 *acc = m_acc.s;
+ rsp_vec_t acc_lo, acc_mid, acc_hi;
+
+ acc_lo = read_acc_lo(acc);
+ acc_mid = read_acc_mid(acc);
+ acc_hi = read_acc_hi(acc);
+
+ rsp_vec_t vs = vec_load_unshuffled_operand(m_v[VS1REG].s);
+ rsp_vec_t vt_shuffle = vec_load_and_shuffle_operand(m_v[VS2REG].s, EL);
+
+ m_v[VDREG].v = vec_vmadh_vmudh(op, vs, vt_shuffle, vec_zero(), &acc_lo, &acc_mid, &acc_hi);
+
+ write_acc_lo(acc, acc_lo);
+ write_acc_mid(acc, acc_mid);
+ write_acc_hi(acc, acc_hi);
+#else
for (i=0; i < 8; i++)
{
INT32 s1 = (INT32)(INT16)VREG_S(VS1REG, i);
@@ -1096,6 +1935,8 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
m_vres[i] = (INT16)(r);
}
WRITEBACK_RESULT();
+#endif
+ //
break;
}
@@ -1109,6 +1950,24 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
// Multiplies signed integer by signed integer * 2
// The result is added to accumulator
+ //printf("MACF ");
+#if USE_SIMD
+ UINT16 *acc = m_acc.s;
+ rsp_vec_t acc_lo, acc_mid, acc_hi;
+
+ acc_lo = read_acc_lo(acc);
+ acc_mid = read_acc_mid(acc);
+ acc_hi = read_acc_hi(acc);
+
+ rsp_vec_t vs = vec_load_unshuffled_operand(m_v[VS1REG].s);
+ rsp_vec_t vt_shuffle = vec_load_and_shuffle_operand(m_v[VS2REG].s, EL);
+
+ m_v[VDREG].v = vec_vmacf_vmacu(op, vs, vt_shuffle, vec_zero(), &acc_lo, &acc_mid, &acc_hi);
+
+ write_acc_lo(acc, acc_lo);
+ write_acc_mid(acc, acc_mid);
+ write_acc_hi(acc, acc_hi);
+#else
for (i=0; i < 8; i++)
{
INT32 s1 = (INT32)(INT16)VREG_S(VS1REG, i);
@@ -1130,6 +1989,8 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
m_vres[i] = SATURATE_ACCUM(i, 1, 0x8000, 0x7fff);
}
WRITEBACK_RESULT();
+#endif
+ //
break;
}
case 0x09: /* VMACU */
@@ -1140,6 +2001,24 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
// ------------------------------------------------------
//
+ //printf("MACU ");
+#if USE_SIMD
+ UINT16 *acc = m_acc.s;
+ rsp_vec_t acc_lo, acc_mid, acc_hi;
+
+ acc_lo = read_acc_lo(acc);
+ acc_mid = read_acc_mid(acc);
+ acc_hi = read_acc_hi(acc);
+
+ rsp_vec_t vs = vec_load_unshuffled_operand(m_v[VS1REG].s);
+ rsp_vec_t vt_shuffle = vec_load_and_shuffle_operand(m_v[VS2REG].s, EL);
+
+ m_v[VDREG].v = vec_vmacf_vmacu(op, vs, vt_shuffle, vec_zero(), &acc_lo, &acc_mid, &acc_hi);
+
+ write_acc_lo(acc, acc_lo);
+ write_acc_mid(acc, acc_mid);
+ write_acc_hi(acc, acc_hi);
+#else
for (i = 0; i < 8; i++)
{
INT32 s1 = (INT32)(INT16)VREG_S(VS1REG, i);
@@ -1176,6 +2055,8 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
}
}
WRITEBACK_RESULT();
+#endif
+ //
break;
}
@@ -1190,6 +2071,24 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
// Adds the higher 16 bits of the 32-bit result to accumulator
// The low slice of accumulator is stored into destination element
+ //printf("MADL ");
+#if USE_SIMD
+ UINT16 *acc = m_acc.s;
+ rsp_vec_t acc_lo, acc_mid, acc_hi;
+
+ acc_lo = read_acc_lo(acc);
+ acc_mid = read_acc_mid(acc);
+ acc_hi = read_acc_hi(acc);
+
+ rsp_vec_t vs = vec_load_unshuffled_operand(m_v[VS1REG].s);
+ rsp_vec_t vt_shuffle = vec_load_and_shuffle_operand(m_v[VS2REG].s, EL);
+
+ m_v[VDREG].v = vec_vmadl_vmudl(op, vs, vt_shuffle, vec_zero(), &acc_lo, &acc_mid, &acc_hi);
+
+ write_acc_lo(acc, acc_lo);
+ write_acc_mid(acc, acc_mid);
+ write_acc_hi(acc, acc_hi);
+#else
for (i = 0; i < 8; i++)
{
UINT32 s1 = (UINT32)(UINT16)VREG_S(VS1REG, i);
@@ -1205,6 +2104,8 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
m_vres[i] = SATURATE_ACCUM(i, 0, 0x0000, 0xffff);
}
WRITEBACK_RESULT();
+#endif
+ //
break;
}
@@ -1219,6 +2120,24 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
// The result is added into accumulator
// The middle slice of accumulator is stored into destination element
+ //printf("MADM ");
+#if USE_SIMD
+ UINT16 *acc = m_acc.s;
+ rsp_vec_t acc_lo, acc_mid, acc_hi;
+
+ acc_lo = read_acc_lo(acc);
+ acc_mid = read_acc_mid(acc);
+ acc_hi = read_acc_hi(acc);
+
+ rsp_vec_t vs = vec_load_unshuffled_operand(m_v[VS1REG].s);
+ rsp_vec_t vt_shuffle = vec_load_and_shuffle_operand(m_v[VS2REG].s, EL);
+
+ m_v[VDREG].v = vec_vmadm_vmudm(op, vs, vt_shuffle, vec_zero(), &acc_lo, &acc_mid, &acc_hi);
+
+ write_acc_lo(acc, acc_lo);
+ write_acc_mid(acc, acc_mid);
+ write_acc_hi(acc, acc_hi);
+#else
for (i=0; i < 8; i++)
{
UINT32 s1 = (INT32)(INT16)VREG_S(VS1REG, i);
@@ -1236,6 +2155,8 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
m_vres[i] = SATURATE_ACCUM(i, 1, 0x8000, 0x7fff);
}
WRITEBACK_RESULT();
+#endif
+ //
break;
}
@@ -1250,6 +2171,24 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
// The result is added into accumulator
// The low slice of accumulator is stored into destination element
+ //printf("MADN ");
+#if USE_SIMD
+ UINT16 *acc = m_acc.s;
+ rsp_vec_t acc_lo, acc_mid, acc_hi;
+
+ acc_lo = read_acc_lo(acc);
+ acc_mid = read_acc_mid(acc);
+ acc_hi = read_acc_hi(acc);
+
+ rsp_vec_t vs = vec_load_unshuffled_operand(m_v[VS1REG].s);
+ rsp_vec_t vt_shuffle = vec_load_and_shuffle_operand(m_v[VS2REG].s, EL);
+
+ m_v[VDREG].v = vec_vmadn_vmudn(op, vs, vt_shuffle, vec_zero(), &acc_lo, &acc_mid, &acc_hi);
+
+ write_acc_lo(acc, acc_lo);
+ write_acc_mid(acc, acc_mid);
+ write_acc_hi(acc, acc_hi);
+#else
for (i=0; i < 8; i++)
{
INT32 s1 = (UINT16)VREG_S(VS1REG, i); // not sign-extended
@@ -1270,6 +2209,8 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
}
WRITEBACK_RESULT();
+#endif
+ //
break;
}
@@ -1284,6 +2225,24 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
// The result is added into highest 32 bits of accumulator, the low slice is zero
// The highest 32 bits of accumulator is saturated into destination element
+ //printf("MADH ");
+#if USE_SIMD
+ UINT16 *acc = m_acc.s;
+ rsp_vec_t acc_lo, acc_mid, acc_hi;
+
+ acc_lo = read_acc_lo(acc);
+ acc_mid = read_acc_mid(acc);
+ acc_hi = read_acc_hi(acc);
+
+ rsp_vec_t vs = vec_load_unshuffled_operand(m_v[VS1REG].s);
+ rsp_vec_t vt_shuffle = vec_load_and_shuffle_operand(m_v[VS2REG].s, EL);
+
+ m_v[VDREG].v = vec_vmadh_vmudh(op, vs, vt_shuffle, vec_zero(), &acc_lo, &acc_mid, &acc_hi);
+
+ write_acc_lo(acc, acc_lo);
+ write_acc_mid(acc, acc_mid);
+ write_acc_hi(acc, acc_hi);
+#else
for (i = 0; i < 8; i++)
{
INT32 s1 = (INT32)(INT16)VREG_S(VS1REG, i);
@@ -1300,6 +2259,8 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
}
WRITEBACK_RESULT();
+#endif
+ //
break;
}
@@ -1314,6 +2275,21 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
// TODO: check VS2REG == VDREG
+ //printf("ADD ");
+#if USE_SIMD
+ rsp_vec_t acc_lo;
+ UINT16 *acc = m_acc.s;
+ rsp_vec_t carry = read_vco_lo(m_flags[RSP_VCO].s);
+
+ rsp_vec_t vs = vec_load_unshuffled_operand(m_v[VS1REG].s);
+ rsp_vec_t vt_shuffle = vec_load_and_shuffle_operand(m_v[VS2REG].s, EL);
+
+ m_v[VDREG].v = vec_vadd(vs, vt_shuffle, carry, &acc_lo);
+
+ write_vco_hi(m_flags[RSP_VCO].s, vec_zero());
+ write_vco_lo(m_flags[RSP_VCO].s, vec_zero());
+ write_acc_lo(acc, acc_lo);
+#else
for (i=0; i < 8; i++)
{
INT32 s1 = (INT32)(INT16)VREG_S(VS1REG, i);
@@ -1329,6 +2305,8 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
CLEAR_ZERO_FLAGS();
CLEAR_CARRY_FLAGS();
WRITEBACK_RESULT();
+#endif
+ //
break;
}
@@ -1343,6 +2321,21 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
// TODO: check VS2REG == VDREG
+ //printf("SUB ");
+#if USE_SIMD
+ rsp_vec_t acc_lo;
+ UINT16 *acc = m_acc.s;
+ rsp_vec_t carry = read_vco_lo(m_flags[RSP_VCO].s);
+
+ rsp_vec_t vs = vec_load_unshuffled_operand(m_v[VS1REG].s);
+ rsp_vec_t vt_shuffle = vec_load_and_shuffle_operand(m_v[VS2REG].s, EL);
+
+ m_v[VDREG].v = vec_vsub(vs, vt_shuffle, carry, &acc_lo);
+
+ write_vco_hi(m_flags[RSP_VCO].s, vec_zero());
+ write_vco_lo(m_flags[RSP_VCO].s, vec_zero());
+ write_acc_lo(acc, acc_lo);
+#else
for (i = 0; i < 8; i++)
{
INT32 s1 = (INT32)(INT16)VREG_S(VS1REG, i);
@@ -1359,6 +2352,8 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
CLEAR_ZERO_FLAGS();
CLEAR_CARRY_FLAGS();
WRITEBACK_RESULT();
+#endif
+ //
break;
}
@@ -1372,6 +2367,18 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
// Changes the sign of source register 2 if source register 1 is negative and stores
// the result to destination register
+ //printf("ABS ");
+#if USE_SIMD
+ rsp_vec_t acc_lo;
+ UINT16 *acc = m_acc.s;
+
+ rsp_vec_t vs = vec_load_unshuffled_operand(m_v[VS1REG].s);
+ rsp_vec_t vt_shuffle = vec_load_and_shuffle_operand(m_v[VS2REG].s, EL);
+
+ m_v[VDREG].v = vec_vabs(vs, vt_shuffle, vec_zero(), &acc_lo);
+
+ write_acc_lo(acc, acc_lo);
+#else
for (i=0; i < 8; i++)
{
INT16 s1 = (INT16)VREG_S(VS1REG, i);
@@ -1400,6 +2407,8 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
SET_ACCUM_L(m_vres[i], i);
}
WRITEBACK_RESULT();
+#endif
+ //
break;
}
@@ -1414,6 +2423,20 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
// TODO: check VS2REG = VDREG
+ //printf("ADDC ");
+#if USE_SIMD
+ UINT16 *acc = m_acc.s;
+ rsp_vec_t sn;
+
+ rsp_vec_t vs = vec_load_unshuffled_operand(m_v[VS1REG].s);
+ rsp_vec_t vt_shuffle = vec_load_and_shuffle_operand(m_v[VS2REG].s, EL);
+
+ m_v[VDREG].v = vec_vaddc(vs, vt_shuffle, vec_zero(), &sn);
+
+ write_vco_hi(m_flags[RSP_VCO].s, vec_zero());
+ write_vco_lo(m_flags[RSP_VCO].s, sn);
+ write_acc_lo(acc, m_v[VDREG].v);
+#else
CLEAR_ZERO_FLAGS();
CLEAR_CARRY_FLAGS();
@@ -1432,6 +2455,8 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
}
}
WRITEBACK_RESULT();
+#endif
+ //
break;
}
@@ -1446,6 +2471,20 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
// TODO: check VS2REG = VDREG
+ //printf("SUBC ");
+#if USE_SIMD
+ UINT16 *acc = m_acc.s;
+ rsp_vec_t eq, sn;
+
+ rsp_vec_t vs = vec_load_unshuffled_operand(m_v[VS1REG].s);
+ rsp_vec_t vt_shuffle = vec_load_and_shuffle_operand(m_v[VS2REG].s, EL);
+
+ m_v[VDREG].v = vec_vsubc(vs, vt_shuffle, vec_zero(), &eq, &sn);
+
+ write_vco_hi(m_flags[RSP_VCO].s, eq);
+ write_vco_lo(m_flags[RSP_VCO].s, sn);
+ write_acc_lo(acc, m_v[VDREG].v);
+#else
CLEAR_ZERO_FLAGS();
CLEAR_CARRY_FLAGS();
@@ -1468,6 +2507,8 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
}
}
WRITEBACK_RESULT();
+#endif
+ //
break;
}
@@ -1480,6 +2521,26 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
//
// Stores high, middle or low slice of accumulator to destination vector
+ //printf("SAW ");
+#if USE_SIMD
+ UINT16 *acc = m_acc.s;
+ switch (EL)
+ {
+ case 8:
+ m_v[VDREG].v = read_acc_hi(acc);
+ break;
+ case 9:
+ m_v[VDREG].v = read_acc_mid(acc);
+ break;
+ case 10:
+ m_v[VDREG].v = read_acc_lo(acc);
+ break;
+
+ default:
+ m_v[VDREG].v = _mm_setzero_si128();
+ break;
+ }
+#else
switch (EL)
{
case 0x08: // VSAWH
@@ -1510,6 +2571,8 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
printf("RSP: VSAW: el = %d\n", EL);//??? ???
exit(0);
}
+#endif
+ //
break;
}
@@ -1523,6 +2586,25 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
// Sets compare flags if elements in VS1 are less than VS2
// Moves the element in VS2 to destination vector
+ //printf("LT ");
+#if USE_SIMD
+ UINT16 *acc = m_acc.s;
+ rsp_vec_t le;
+
+ rsp_vec_t eq = read_vco_hi(m_flags[RSP_VCO].s);
+ rsp_vec_t sign = read_vco_lo(m_flags[RSP_VCO].s);
+
+ rsp_vec_t vs = vec_load_unshuffled_operand(m_v[VS1REG].s);
+ rsp_vec_t vt_shuffle = vec_load_and_shuffle_operand(m_v[VS2REG].s, EL);
+
+ m_v[VDREG].v = vec_veq_vge_vlt_vne(op, vs, vt_shuffle, vec_zero(), &le, eq, sign);
+
+ write_vcc_hi(m_flags[RSP_VCC].s, vec_zero());
+ write_vcc_lo(m_flags[RSP_VCC].s, le);
+ write_vco_hi(m_flags[RSP_VCO].s, vec_zero());
+ write_vco_lo(m_flags[RSP_VCO].s, vec_zero());
+ write_acc_lo(acc, m_v[VDREG].v);
+#else
CLEAR_COMPARE_FLAGS();
CLEAR_CLIP2_FLAGS();
@@ -1558,6 +2640,8 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
CLEAR_CARRY_FLAGS();
CLEAR_ZERO_FLAGS();
WRITEBACK_RESULT();
+#endif
+ //
break;
}
@@ -1571,6 +2655,25 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
// Sets compare flags if elements in VS1 are equal with VS2
// Moves the element in VS2 to destination vector
+ //printf("EQ ");
+#if USE_SIMD
+ UINT16 *acc = m_acc.s;
+ rsp_vec_t le;
+
+ rsp_vec_t eq = read_vco_hi(m_flags[RSP_VCO].s);
+ rsp_vec_t sign = read_vco_lo(m_flags[RSP_VCO].s);
+
+ rsp_vec_t vs = vec_load_unshuffled_operand(m_v[VS1REG].s);
+ rsp_vec_t vt_shuffle = vec_load_and_shuffle_operand(m_v[VS2REG].s, EL);
+
+ m_v[VDREG].v = vec_veq_vge_vlt_vne(op, vs, vt_shuffle, vec_zero(), &le, eq, sign);
+
+ write_vcc_hi(m_flags[RSP_VCC].s, vec_zero());
+ write_vcc_lo(m_flags[RSP_VCC].s, le);
+ write_vco_hi(m_flags[RSP_VCO].s, vec_zero());
+ write_vco_lo(m_flags[RSP_VCO].s, vec_zero());
+ write_acc_lo(acc, m_v[VDREG].v);
+#else
CLEAR_COMPARE_FLAGS();
CLEAR_CLIP2_FLAGS();
@@ -1594,6 +2697,8 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
CLEAR_ZERO_FLAGS();
CLEAR_CARRY_FLAGS();
WRITEBACK_RESULT();
+#endif
+ //
break;
}
@@ -1607,6 +2712,25 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
// Sets compare flags if elements in VS1 are not equal with VS2
// Moves the element in VS2 to destination vector
+ //printf("NE ");
+#if USE_SIMD
+ UINT16 *acc = m_acc.s;
+ rsp_vec_t le;
+
+ rsp_vec_t eq = read_vco_hi(m_flags[RSP_VCO].s);
+ rsp_vec_t sign = read_vco_lo(m_flags[RSP_VCO].s);
+
+ rsp_vec_t vs = vec_load_unshuffled_operand(m_v[VS1REG].s);
+ rsp_vec_t vt_shuffle = vec_load_and_shuffle_operand(m_v[VS2REG].s, EL);
+
+ m_v[VDREG].v = vec_veq_vge_vlt_vne(op, vs, vt_shuffle, vec_zero(), &le, eq, sign);
+
+ write_vcc_hi(m_flags[RSP_VCC].s, vec_zero());
+ write_vcc_lo(m_flags[RSP_VCC].s, le);
+ write_vco_hi(m_flags[RSP_VCO].s, vec_zero());
+ write_vco_lo(m_flags[RSP_VCO].s, vec_zero());
+ write_acc_lo(acc, m_v[VDREG].v);
+#else
CLEAR_COMPARE_FLAGS();
CLEAR_CLIP2_FLAGS();
@@ -1631,6 +2755,8 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
CLEAR_CARRY_FLAGS();
CLEAR_ZERO_FLAGS();
WRITEBACK_RESULT();
+#endif
+ //
break;
}
@@ -1644,6 +2770,25 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
// Sets compare flags if elements in VS1 are greater or equal with VS2
// Moves the element in VS2 to destination vector
+ //printf("GE ");
+#if USE_SIMD
+ UINT16 *acc = m_acc.s;
+ rsp_vec_t le;
+
+ rsp_vec_t eq = read_vco_hi(m_flags[RSP_VCO].s);
+ rsp_vec_t sign = read_vco_lo(m_flags[RSP_VCO].s);
+
+ rsp_vec_t vs = vec_load_unshuffled_operand(m_v[VS1REG].s);
+ rsp_vec_t vt_shuffle = vec_load_and_shuffle_operand(m_v[VS2REG].s, EL);
+
+ m_v[VDREG].v = vec_veq_vge_vlt_vne(op, vs, vt_shuffle, vec_zero(), &le, eq, sign);
+
+ write_vcc_hi(m_flags[RSP_VCC].s, vec_zero());
+ write_vcc_lo(m_flags[RSP_VCC].s, le);
+ write_vco_hi(m_flags[RSP_VCO].s, vec_zero());
+ write_vco_lo(m_flags[RSP_VCO].s, vec_zero());
+ write_acc_lo(acc, m_v[VDREG].v);
+#else
CLEAR_COMPARE_FLAGS();
CLEAR_CLIP2_FLAGS();
@@ -1668,6 +2813,8 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
CLEAR_CARRY_FLAGS();
CLEAR_ZERO_FLAGS();
WRITEBACK_RESULT();
+#endif
+ //
break;
}
@@ -1680,16 +2827,37 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
//
// Vector clip low
+ //printf("CL ");
+#if USE_SIMD
+ UINT16 *acc = m_acc.s;
+
+ rsp_vec_t ge = read_vcc_hi(m_flags[RSP_VCC].s);
+ rsp_vec_t le = read_vcc_lo(m_flags[RSP_VCC].s);
+ rsp_vec_t eq = read_vco_hi(m_flags[RSP_VCO].s);
+ rsp_vec_t sign = read_vco_lo(m_flags[RSP_VCO].s);
+ rsp_vec_t vce = read_vce(m_flags[RSP_VCE].s);
+
+ rsp_vec_t vs = vec_load_unshuffled_operand(m_v[VS1REG].s);
+ rsp_vec_t vt_shuffle = vec_load_and_shuffle_operand(m_v[VS2REG].s, EL);
+ m_v[VDREG].v = vec_vcl(vs, vt_shuffle, vec_zero(), &ge, &le, eq, sign, vce);
+
+ write_vcc_hi(m_flags[RSP_VCC].s, ge);
+ write_vcc_lo(m_flags[RSP_VCC].s, le);
+ write_vco_hi(m_flags[RSP_VCO].s, vec_zero());
+ write_vco_lo(m_flags[RSP_VCO].s, vec_zero());
+ write_vce(m_flags[RSP_VCE].s, vec_zero());
+ write_acc_lo(acc, m_v[VDREG].v);
+#else
for (i = 0; i < 8; i++)
{
INT16 s1 = VREG_S(VS1REG, i);
INT16 s2 = VREG_S(VS2REG, VEC_EL_2(EL, i));
- if (CARRY_FLAG(i) != 0)
+ if (CARRY_FLAG(i) != 0) // vco_lo
{
- if (ZERO_FLAG(i) != 0)
+ if (ZERO_FLAG(i) != 0) // vco_hi
{
- if (COMPARE_FLAG(i) != 0)
+ if (COMPARE_FLAG(i) != 0) // vcc_lo
{
SET_ACCUM_L(-(UINT16)s2, i);
}
@@ -1700,7 +2868,7 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
}
else
{
- if (CLIP1_FLAG(i) != 0)
+ if (CLIP1_FLAG(i) != 0) // vce
{
if (((UINT32)(UINT16)(s1) + (UINT32)(UINT16)(s2)) > 0x10000)
{
@@ -1730,9 +2898,9 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
}
else
{
- if (ZERO_FLAG(i) != 0)
+ if (ZERO_FLAG(i) != 0) // vco_hi
{
- if (CLIP2_FLAG(i) != 0)
+ if (CLIP2_FLAG(i) != 0) // vcc_hi
{
SET_ACCUM_L(s2, i);
}
@@ -1758,10 +2926,12 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
m_vres[i] = ACCUM_L(i);
}
- CLEAR_CARRY_FLAGS();
- CLEAR_ZERO_FLAGS();
- CLEAR_CLIP1_FLAGS();
+ CLEAR_CARRY_FLAGS(); // vco_lo
+ CLEAR_ZERO_FLAGS(); // vco_hi
+ CLEAR_CLIP1_FLAGS(); // vce
WRITEBACK_RESULT();
+#endif
+ //
break;
}
@@ -1774,6 +2944,23 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
//
// Vector clip high
+ //printf("CH ");
+#if USE_SIMD
+ UINT16 *acc = m_acc.s;
+ rsp_vec_t ge, le, sign, eq, vce;
+
+ rsp_vec_t vs = vec_load_unshuffled_operand(m_v[VS1REG].s);
+ rsp_vec_t vt_shuffle = vec_load_and_shuffle_operand(m_v[VS2REG].s, EL);
+
+ m_v[VDREG].v = vec_vch(vs, vt_shuffle, vec_zero(), &ge, &le, &eq, &sign, &vce);
+
+ write_vcc_hi(m_flags[RSP_VCC].s, ge);
+ write_vcc_lo(m_flags[RSP_VCC].s, le);
+ write_vco_hi(m_flags[RSP_VCO].s, eq);
+ write_vco_lo(m_flags[RSP_VCO].s, sign);
+ write_vce(m_flags[RSP_VCE].s, vce);
+ write_acc_lo(acc, m_v[VDREG].v);
+#else
CLEAR_CARRY_FLAGS();
CLEAR_COMPARE_FLAGS();
CLEAR_CLIP1_FLAGS();
@@ -1846,6 +3033,8 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
SET_ACCUM_L(m_vres[i], i);
}
WRITEBACK_RESULT();
+#endif
+ //
break;
}
@@ -1858,6 +3047,23 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
//
// Vector clip reverse
+ //printf("CR ");
+#if USE_SIMD
+ UINT16 *acc = m_acc.s;
+ rsp_vec_t ge, le;
+
+ rsp_vec_t vs = vec_load_unshuffled_operand(m_v[VS1REG].s);
+ rsp_vec_t vt_shuffle = vec_load_and_shuffle_operand(m_v[VS2REG].s, EL);
+
+ m_v[VDREG].v = vec_vcr(vs, vt_shuffle, vec_zero(), &ge, &le);
+
+ write_vcc_hi(m_flags[RSP_VCC].s, ge);
+ write_vcc_lo(m_flags[RSP_VCC].s, le);
+ write_vco_hi(m_flags[RSP_VCO].s, vec_zero());
+ write_vco_lo(m_flags[RSP_VCO].s, vec_zero());
+ write_vce(m_flags[RSP_VCE].s, vec_zero());
+ write_acc_lo(acc, m_v[VDREG].v);
+#else
CLEAR_CARRY_FLAGS();
CLEAR_COMPARE_FLAGS();
CLEAR_CLIP1_FLAGS();
@@ -1905,6 +3111,8 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
m_vres[i] = ACCUM_L(i);
}
WRITEBACK_RESULT();
+#endif
+ //
break;
}
@@ -1917,6 +3125,20 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
//
// Merges two vectors according to compare flags
+ //printf("MRG ");
+#if USE_SIMD
+ UINT16 *acc = m_acc.s;
+ rsp_vec_t le = read_vcc_lo(m_flags[RSP_VCC].s);
+
+ rsp_vec_t vs = vec_load_unshuffled_operand(m_v[VS1REG].s);
+ rsp_vec_t vt_shuffle = vec_load_and_shuffle_operand(m_v[VS2REG].s, EL);
+
+ m_v[VDREG].v = vec_vmrg(vs, vt_shuffle, le);
+
+ write_vco_hi(m_flags[RSP_VCO].s, vec_zero());
+ write_vco_lo(m_flags[RSP_VCO].s, vec_zero());
+ write_acc_lo(acc, m_v[VDREG].v);
+#else
for (i = 0; i < 8; i++)
{
if (COMPARE_FLAG(i) != 0)
@@ -1931,6 +3153,8 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
SET_ACCUM_L(m_vres[i], i);
}
WRITEBACK_RESULT();
+#endif
+ //
break;
}
case 0x28: /* VAND */
@@ -1942,12 +3166,25 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
//
// Bitwise AND of two vector registers
+ //printf("AND ");
+#if USE_SIMD
+ UINT16 *acc = m_acc.s;
+
+ rsp_vec_t vs = vec_load_unshuffled_operand(m_v[VS1REG].s);
+ rsp_vec_t vt_shuffle = vec_load_and_shuffle_operand(m_v[VS2REG].s, EL);
+
+ m_v[VDREG].v = vec_vand_vnand(op, vs, vt_shuffle);
+
+ write_acc_lo(acc, m_v[VDREG].v);
+#else
for (i = 0; i < 8; i++)
{
m_vres[i] = VREG_S(VS1REG, i) & VREG_S(VS2REG, VEC_EL_2(EL, i));
SET_ACCUM_L(m_vres[i], i);
}
WRITEBACK_RESULT();
+#endif
+ //
break;
}
case 0x29: /* VNAND */
@@ -1959,12 +3196,25 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
//
// Bitwise NOT AND of two vector registers
+ //printf("NAND ");
+#if USE_SIMD
+ UINT16 *acc = m_acc.s;
+
+ rsp_vec_t vs = vec_load_unshuffled_operand(m_v[VS1REG].s);
+ rsp_vec_t vt_shuffle = vec_load_and_shuffle_operand(m_v[VS2REG].s, EL);
+
+ m_v[VDREG].v = vec_vand_vnand(op, vs, vt_shuffle);
+
+ write_acc_lo(acc, m_v[VDREG].v);
+#else
for (i = 0; i < 8; i++)
{
m_vres[i] = ~((VREG_S(VS1REG, i) & VREG_S(VS2REG, VEC_EL_2(EL, i))));
SET_ACCUM_L(m_vres[i], i);
}
WRITEBACK_RESULT();
+#endif
+ //
break;
}
case 0x2a: /* VOR */
@@ -1976,12 +3226,25 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
//
// Bitwise OR of two vector registers
+ //printf("OR ");
+#if USE_SIMD
+ UINT16 *acc = m_acc.s;
+
+ rsp_vec_t vs = vec_load_unshuffled_operand(m_v[VS1REG].s);
+ rsp_vec_t vt_shuffle = vec_load_and_shuffle_operand(m_v[VS2REG].s, EL);
+
+ m_v[VDREG].v = vec_vor_vnor(op, vs, vt_shuffle);
+
+ write_acc_lo(acc, m_v[VDREG].v);
+#else
for (i = 0; i < 8; i++)
{
m_vres[i] = VREG_S(VS1REG, i) | VREG_S(VS2REG, VEC_EL_2(EL, i));
SET_ACCUM_L(m_vres[i], i);
}
WRITEBACK_RESULT();
+#endif
+ //
break;
}
case 0x2b: /* VNOR */
@@ -1993,12 +3256,25 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
//
// Bitwise NOT OR of two vector registers
+ //printf("NOR ");
+#if USE_SIMD
+ UINT16 *acc = m_acc.s;
+
+ rsp_vec_t vs = vec_load_unshuffled_operand(m_v[VS1REG].s);
+ rsp_vec_t vt_shuffle = vec_load_and_shuffle_operand(m_v[VS2REG].s, EL);
+
+ m_v[VDREG].v = vec_vor_vnor(op, vs, vt_shuffle);
+
+ write_acc_lo(acc, m_v[VDREG].v);
+#else
for (i=0; i < 8; i++)
{
m_vres[i] = ~((VREG_S(VS1REG, i) | VREG_S(VS2REG, VEC_EL_2(EL, i))));
SET_ACCUM_L(m_vres[i], i);
}
WRITEBACK_RESULT();
+#endif
+ //
break;
}
case 0x2c: /* VXOR */
@@ -2010,12 +3286,25 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
//
// Bitwise XOR of two vector registers
+ //printf("XOR ");
+#if USE_SIMD
+ UINT16 *acc = m_acc.s;
+
+ rsp_vec_t vs = vec_load_unshuffled_operand(m_v[VS1REG].s);
+ rsp_vec_t vt_shuffle = vec_load_and_shuffle_operand(m_v[VS2REG].s, EL);
+
+ m_v[VDREG].v = vec_vxor_vnxor(op, vs, vt_shuffle);
+
+ write_acc_lo(acc, m_v[VDREG].v);
+#else
for (i=0; i < 8; i++)
{
m_vres[i] = VREG_S(VS1REG, i) ^ VREG_S(VS2REG, VEC_EL_2(EL, i));
SET_ACCUM_L(m_vres[i], i);
}
WRITEBACK_RESULT();
+#endif
+ //
break;
}
case 0x2d: /* VNXOR */
@@ -2027,12 +3316,25 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
//
// Bitwise NOT XOR of two vector registers
+ //printf("NXOR ");
+#if USE_SIMD
+ UINT16 *acc = m_acc.s;
+
+ rsp_vec_t vs = vec_load_unshuffled_operand(m_v[VS1REG].s);
+ rsp_vec_t vt_shuffle = vec_load_and_shuffle_operand(m_v[VS2REG].s, EL);
+
+ m_v[VDREG].v = vec_vxor_vnxor(op, vs, vt_shuffle);
+
+ write_acc_lo(acc, m_v[VDREG].v);
+#else
for (i=0; i < 8; i++)
{
m_vres[i] = ~((VREG_S(VS1REG, i) ^ VREG_S(VS2REG, VEC_EL_2(EL, i))));
SET_ACCUM_L(m_vres[i], i);
}
WRITEBACK_RESULT();
+#endif
+ //
break;
}
@@ -2044,6 +3346,16 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
// ------------------------------------------------------
//
// Calculates reciprocal
+
+ //printf("RCP ");
+#if USE_SIMD
+ write_acc_lo(m_acc.s, vec_load_and_shuffle_operand(m_v[VS2REG].s, EL));
+
+ INT32 dp = op & m_dp_flag;
+ m_dp_flag = 0;
+
+ m_v[VDREG].v = vec_vrcp_vrsq(op, dp, VS2REG, EL, VDREG, VS1REG);
+#else
INT32 shifter = 0;
INT32 rec = (INT16)(VREG_S(VS2REG, EL & 7));
@@ -2092,6 +3404,8 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
}
+#endif
+ //
break;
}
@@ -2104,6 +3418,15 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
//
// Calculates reciprocal low part
+ //printf("RCPL ");
+#if USE_SIMD
+ write_acc_lo(m_acc.s, vec_load_and_shuffle_operand(m_v[VS2REG].s, EL));
+
+ INT32 dp = op & m_dp_flag;
+ m_dp_flag = 0;
+
+ m_v[VDREG].v = vec_vrcp_vrsq(op, dp, VS2REG, EL, VDREG, VS1REG);
+#else
INT32 shifter = 0;
INT32 rec = (INT16)VREG_S(VS2REG, EL & 7);
@@ -2168,6 +3491,8 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
SET_ACCUM_L(VREG_S(VS2REG, VEC_EL_2(EL, i)), i);
}
+#endif
+ //
break;
}
@@ -2180,6 +3505,14 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
//
// Calculates reciprocal high part
+ //printf("RCPH ");
+#if USE_SIMD
+ write_acc_lo(m_acc.s, vec_load_and_shuffle_operand(m_v[VS2REG].s, EL));
+
+ m_dp_flag = 1;
+
+ m_v[VDREG].v = vec_vdivh(VS2REG, EL, VDREG, VS1REG);
+#else
m_reciprocal_high = (VREG_S(VS2REG, EL & 7)) << 16;
m_dp_allowed = 1;
@@ -2190,6 +3523,8 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
VREG_S(VDREG, VS1REG & 7) = (INT16)(m_reciprocal_res >> 16);
+#endif
+ //
break;
}
@@ -2202,11 +3537,18 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
//
// Moves element from vector to destination vector
+ //printf("MOV ");
+#if USE_SIMD
+ write_acc_lo(m_acc.s, vec_load_and_shuffle_operand(m_v[VS2REG].s, EL));
+ m_v[VDREG].v = vec_vmov(VS2REG, EL, VDREG, VS1REG);
+#else
VREG_S(VDREG, VS1REG & 7) = VREG_S(VS2REG, EL & 7);
for (i = 0; i < 8; i++)
{
SET_ACCUM_L(VREG_S(VS2REG, VEC_EL_2(EL, i)), i);
}
+#endif
+ //
break;
}
@@ -2219,6 +3561,15 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
//
// Calculates reciprocal square-root
+ //printf("RSQ ");
+#if USE_SIMD
+ write_acc_lo(m_acc.s, vec_load_and_shuffle_operand(m_v[VS2REG].s, EL));
+
+ INT32 dp = op & m_dp_flag;
+ m_dp_flag = 0;
+
+ m_v[VDREG].v = vec_vrcp_vrsq(op, dp, VS2REG, EL, VDREG, VS1REG);
+#else
INT32 shifter = 0;
INT32 rec = (INT16)(VREG_S(VS2REG, EL & 7));
@@ -2268,6 +3619,8 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
SET_ACCUM_L(VREG_S(VS2REG, VEC_EL_2(EL, i)), i);
}
+#endif
+ //
break;
}
@@ -2280,6 +3633,15 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
//
// Calculates reciprocal square-root low part
+ //printf("RSQL ");
+#if USE_SIMD
+ write_acc_lo(m_acc.s, vec_load_and_shuffle_operand(m_v[VS2REG].s, EL));
+
+ INT32 dp = op & m_dp_flag;
+ m_dp_flag = 0;
+
+ m_v[VDREG].v = vec_vrcp_vrsq(op, dp, VS2REG, EL, VDREG, VS1REG);
+#else
INT32 shifter = 0;
INT32 rec = (INT16)VREG_S(VS2REG, EL & 7);
INT32 datainput = rec;
@@ -2347,6 +3709,8 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
SET_ACCUM_L(VREG_S(VS2REG, VEC_EL_2(EL, i)), i);
}
+#endif
+ //
break;
}
@@ -2359,6 +3723,14 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
//
// Calculates reciprocal square-root high part
+ //printf("RSQH ");
+#if USE_SIMD
+ write_acc_lo(m_acc.s, vec_load_and_shuffle_operand(m_v[VS2REG].s, EL));
+
+ m_dp_flag = 1;
+
+ m_v[VDREG].v = vec_vdivh(VS2REG, EL, VDREG, VS1REG);
+#else
m_reciprocal_high = (VREG_S(VS2REG, EL & 7)) << 16;
m_dp_allowed = 1;
@@ -2368,6 +3740,8 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
}
VREG_S(VDREG, VS1REG & 7) = (INT16)(m_reciprocal_res >> 16); // store high part
+#endif
+ //
break;
}
@@ -2380,6 +3754,7 @@ void rsp_cop2::handle_vector_ops(UINT32 op)
//
// Vector null instruction
+ //printf("NOP ");
break;
}
@@ -2402,6 +3777,7 @@ void rsp_cop2::handle_cop2(UINT32 op)
// | 010010 | 00000 | TTTTT | DDDDD | IIII | 0000000 |
// ---------------------------------------------------
//
+ //printf("MFC2 ");
int el = (op >> 7) & 0xf;
UINT16 b1 = VREG_B(RDREG, (el+0) & 0xf);
UINT16 b2 = VREG_B(RDREG, (el+1) & 0xf);
@@ -2416,8 +3792,16 @@ void rsp_cop2::handle_cop2(UINT32 op)
// | 010010 | 00010 | TTTTT | DDDDD | 00000000000 |
// ------------------------------------------------
//
+ //printf("CFC2 ");
if (RTREG)
{
+#if USE_SIMD
+ INT32 src = RDREG & 3;
+ if (src == 3) {
+ src = 2;
+ }
+ RTVAL = get_flags(m_flags[src].s);
+#else
switch(RDREG)
{
case 0:
@@ -2469,6 +3853,7 @@ void rsp_cop2::handle_cop2(UINT32 op)
((CLIP1_FLAG(6) & 1) << 6) |
((CLIP1_FLAG(7) & 1) << 7);
}
+#endif
}
break;
}
@@ -2480,6 +3865,7 @@ void rsp_cop2::handle_cop2(UINT32 op)
// | 010010 | 00100 | TTTTT | DDDDD | IIII | 0000000 |
// ---------------------------------------------------
//
+ //printf("MTC2 ");
int el = (op >> 7) & 0xf;
W_VREG_B(RDREG, (el+0) & 0xf, (RTVAL >> 8) & 0xff);
W_VREG_B(RDREG, (el+1) & 0xf, (RTVAL >> 0) & 0xff);
@@ -2495,6 +3881,30 @@ void rsp_cop2::handle_cop2(UINT32 op)
//
switch(RDREG)
{
+#if USE_SIMD
+ case 0:
+ case 1:
+ case 2:
+ UINT16 r0 = (RTVAL & (1 << 0)) ? 0xffff : 0;
+ UINT16 r1 = (RTVAL & (1 << 1)) ? 0xffff : 0;
+ UINT16 r2 = (RTVAL & (1 << 2)) ? 0xffff : 0;
+ UINT16 r3 = (RTVAL & (1 << 3)) ? 0xffff : 0;
+ UINT16 r4 = (RTVAL & (1 << 4)) ? 0xffff : 0;
+ UINT16 r5 = (RTVAL & (1 << 5)) ? 0xffff : 0;
+ UINT16 r6 = (RTVAL & (1 << 6)) ? 0xffff : 0;
+ UINT16 r7 = (RTVAL & (1 << 7)) ? 0xffff : 0;
+ m_flags[RDREG].__align[0] = _mm_set_epi16(r7, r6, r5, r4, r3, r2, r1, r0);
+ r0 = (RTVAL & (1 << 8)) ? 0xffff : 0;
+ r1 = (RTVAL & (1 << 9)) ? 0xffff : 0;
+ r2 = (RTVAL & (1 << 10)) ? 0xffff : 0;
+ r3 = (RTVAL & (1 << 11)) ? 0xffff : 0;
+ r4 = (RTVAL & (1 << 12)) ? 0xffff : 0;
+ r5 = (RTVAL & (1 << 13)) ? 0xffff : 0;
+ r6 = (RTVAL & (1 << 14)) ? 0xffff : 0;
+ r7 = (RTVAL & (1 << 15)) ? 0xffff : 0;
+ m_flags[RDREG].__align[1] = _mm_set_epi16(r7, r6, r5, r4, r3, r2, r1, r0);
+ break;
+#else
case 0:
CLEAR_CARRY_FLAGS();
CLEAR_ZERO_FLAGS();
@@ -2548,6 +3958,7 @@ void rsp_cop2::handle_cop2(UINT32 op)
if (RTVAL & (1 << 6)) { SET_CLIP1_FLAG(6); }
if (RTVAL & (1 << 7)) { SET_CLIP1_FLAG(7); }
break;
+#endif
}
break;
}
@@ -2555,6 +3966,7 @@ void rsp_cop2::handle_cop2(UINT32 op)
case 0x10: case 0x11: case 0x12: case 0x13: case 0x14: case 0x15: case 0x16: case 0x17:
case 0x18: case 0x19: case 0x1a: case 0x1b: case 0x1c: case 0x1d: case 0x1e: case 0x1f:
{
+ //printf("V");
handle_vector_ops(op);
break;
}
@@ -2563,11 +3975,12 @@ void rsp_cop2::handle_cop2(UINT32 op)
m_rsp.unimplemented_opcode(op);
break;
}
+ //dump(op);
}
inline void rsp_cop2::mfc2()
{
- UINT32 op = m_op;
+ UINT32 op = m_rspcop2_state->op;
int el = (op >> 7) & 0xf;
UINT16 b1 = VREG_B(VS1REG, (el+0) & 0xf);
@@ -2577,7 +3990,7 @@ inline void rsp_cop2::mfc2()
inline void rsp_cop2::cfc2()
{
- UINT32 op = m_op;
+ UINT32 op = m_rspcop2_state->op;
if (RTREG)
{
switch(RDREG)
@@ -2636,7 +4049,7 @@ inline void rsp_cop2::cfc2()
inline void rsp_cop2::mtc2()
{
- UINT32 op = m_op;
+ UINT32 op = m_rspcop2_state->op;
int el = (op >> 7) & 0xf;
VREG_B(VS1REG, (el+0) & 0xf) = (RTVAL >> 8) & 0xff;
VREG_B(VS1REG, (el+1) & 0xf) = (RTVAL >> 0) & 0xff;
@@ -2644,7 +4057,7 @@ inline void rsp_cop2::mtc2()
inline void rsp_cop2::ctc2()
{
- UINT32 op = m_op;
+ UINT32 op = m_rspcop2_state->op;
switch(RDREG)
{
case 0:
@@ -2756,3 +4169,54 @@ void rsp_cop2::log_instruction_execution()
prev_vecs[i].d[1] = m_v[i].d[1];
}
}
+
+void rsp_cop2::dump(UINT32 op)
+{
+ printf("%08x ", op);
+ for (int i = 0; i < 32; i++)
+ {
+ printf("%08x ", m_rsp.m_rsp_state->r[i]);
+ }
+ printf("\n");
+
+ for (int i = 0; i < 32; i++)
+ {
+ printf("%02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n", VREG_B(i, 0), VREG_B(i, 1), VREG_B(i, 2), VREG_B(i, 3), VREG_B(i, 4), VREG_B(i, 5), VREG_B(i, 6), VREG_B(i, 7), VREG_B(i, 8), VREG_B(i, 9), VREG_B(i, 10), VREG_B(i, 11), VREG_B(i, 12), VREG_B(i, 13), VREG_B(i, 14), VREG_B(i, 15));
+ }
+
+#if USE_SIMD
+ printf("acc_h: %04x|%04x|%04x|%04x|%04x|%04x|%04x|%04x\n", m_acc.s[0], m_acc.s[1], m_acc.s[2], m_acc.s[3], m_acc.s[4], m_acc.s[5], m_acc.s[6], m_acc.s[7]);
+ printf("acc_m: %04x|%04x|%04x|%04x|%04x|%04x|%04x|%04x\n", m_acc.s[8], m_acc.s[9], m_acc.s[10], m_acc.s[11], m_acc.s[12], m_acc.s[13], m_acc.s[14], m_acc.s[15]);
+ printf("acc_l: %04x|%04x|%04x|%04x|%04x|%04x|%04x|%04x\n", m_acc.s[16], m_acc.s[17], m_acc.s[18], m_acc.s[19], m_acc.s[20], m_acc.s[21], m_acc.s[22], m_acc.s[23]);
+ printf("vcc_hi: %04x|%04x|%04x|%04x|%04x|%04x|%04x|%04x\n", m_flags[RSP_VCC].s[0], m_flags[RSP_VCC].s[1], m_flags[RSP_VCC].s[2], m_flags[RSP_VCC].s[3], m_flags[RSP_VCC].s[4], m_flags[RSP_VCC].s[5], m_flags[RSP_VCC].s[6], m_flags[RSP_VCC].s[7]);
+ printf("vcc_lo: %04x|%04x|%04x|%04x|%04x|%04x|%04x|%04x\n", m_flags[RSP_VCC].s[8], m_flags[RSP_VCC].s[9], m_flags[RSP_VCC].s[10], m_flags[RSP_VCC].s[11], m_flags[RSP_VCC].s[12], m_flags[RSP_VCC].s[13], m_flags[RSP_VCC].s[14], m_flags[RSP_VCC].s[15]);
+ printf("vco_hi: %04x|%04x|%04x|%04x|%04x|%04x|%04x|%04x\n", m_flags[RSP_VCO].s[0], m_flags[RSP_VCO].s[1], m_flags[RSP_VCO].s[2], m_flags[RSP_VCO].s[3], m_flags[RSP_VCO].s[4], m_flags[RSP_VCO].s[5], m_flags[RSP_VCO].s[6], m_flags[RSP_VCO].s[7]);
+ printf("vco_lo: %04x|%04x|%04x|%04x|%04x|%04x|%04x|%04x\n", m_flags[RSP_VCO].s[8], m_flags[RSP_VCO].s[9], m_flags[RSP_VCO].s[10], m_flags[RSP_VCO].s[11], m_flags[RSP_VCO].s[12], m_flags[RSP_VCO].s[13], m_flags[RSP_VCO].s[14], m_flags[RSP_VCO].s[15]);
+ printf("vce: %04x|%04x|%04x|%04x|%04x|%04x|%04x|%04x\n", m_flags[RSP_VCE].s[0], m_flags[RSP_VCE].s[1], m_flags[RSP_VCE].s[2], m_flags[RSP_VCE].s[3], m_flags[RSP_VCE].s[4], m_flags[RSP_VCE].s[5], m_flags[RSP_VCE].s[6], m_flags[RSP_VCE].s[7]);
+#else
+ printf("acc_h: %04x|%04x|%04x|%04x|%04x|%04x|%04x|%04x\n", ACCUM_H(0), ACCUM_H(1), ACCUM_H(2), ACCUM_H(3), ACCUM_H(4), ACCUM_H(5), ACCUM_H(6), ACCUM_H(7));
+ printf("acc_m: %04x|%04x|%04x|%04x|%04x|%04x|%04x|%04x\n", ACCUM_M(0), ACCUM_M(1), ACCUM_M(2), ACCUM_M(3), ACCUM_M(4), ACCUM_M(5), ACCUM_M(6), ACCUM_M(7));
+ printf("acc_l: %04x|%04x|%04x|%04x|%04x|%04x|%04x|%04x\n", ACCUM_L(0), ACCUM_L(1), ACCUM_L(2), ACCUM_L(3), ACCUM_L(4), ACCUM_L(5), ACCUM_L(6), ACCUM_L(7));
+ printf("vcc_hi: %04x|%04x|%04x|%04x|%04x|%04x|%04x|%04x\n", m_vflag[4][0], m_vflag[4][1], m_vflag[4][2], m_vflag[4][3], m_vflag[4][4], m_vflag[4][5], m_vflag[4][6], m_vflag[4][7]);
+ printf("vcc_lo: %04x|%04x|%04x|%04x|%04x|%04x|%04x|%04x\n", m_vflag[1][0], m_vflag[1][1], m_vflag[1][2], m_vflag[1][3], m_vflag[1][4], m_vflag[1][5], m_vflag[1][6], m_vflag[1][7]);
+ printf("vco_hi: %04x|%04x|%04x|%04x|%04x|%04x|%04x|%04x\n", m_vflag[3][0], m_vflag[3][1], m_vflag[3][2], m_vflag[3][3], m_vflag[3][4], m_vflag[3][5], m_vflag[3][6], m_vflag[3][7]);
+ printf("vco_lo: %04x|%04x|%04x|%04x|%04x|%04x|%04x|%04x\n", m_vflag[0][0], m_vflag[0][1], m_vflag[0][2], m_vflag[0][3], m_vflag[0][4], m_vflag[0][5], m_vflag[0][6], m_vflag[0][7]);
+ printf("vce: %04x|%04x|%04x|%04x|%04x|%04x|%04x|%04x\n", m_vflag[2][0], m_vflag[2][1], m_vflag[2][2], m_vflag[2][3], m_vflag[2][4], m_vflag[2][5], m_vflag[2][6], m_vflag[2][7]);
+#endif
+}
+
+void rsp_cop2::dump_dmem()
+{
+ UINT8* dmem = m_rsp.get_dmem();
+ printf("\n");
+ for (int i = 0; i < 0x1000; i += 32)
+ {
+ printf("%04x: ", i);
+ for (int j = 0; j < 32; j++)
+ {
+ printf("%02x ", dmem[i + j]);
+ }
+ printf("\n");
+ }
+ printf("\n");
+} \ No newline at end of file
diff --git a/src/emu/cpu/rsp/rspcp2.h b/src/emu/cpu/rsp/rspcp2.h
index 15857bd687c..c5e01218def 100644
--- a/src/emu/cpu/rsp/rspcp2.h
+++ b/src/emu/cpu/rsp/rspcp2.h
@@ -1,5 +1,5 @@
// license:BSD-3-Clause
-// copyright-holders:Ryan Holtz
+// copyright-holders:Ryan Holtz,Tyler J. Stachecki
/***************************************************************************
rspcp2.h
@@ -15,16 +15,47 @@
#include "cpu/drcuml.h"
#include "rsp.h"
+#include "rspdiv.h"
-#define USE_SIMD (0)
-#define SIMUL_SIMD (0)
+#define SIMD_OFF (1)
+
+#if (defined(__SSE2__) || defined(__SSE3__) || defined(__SSSE3__) || defined(__SSE4_1__) || defined(__SSE4_2__))
+#define SSE_AVAILABLE (1)
+#else
+#define SSE_AVAILABLE (0)
+#endif
+
+#if (SSE_AVAILABLE || defined(_MSC_VER)) && defined(PTR64) && !SIMD_OFF
+#define USE_SIMD (1)
+#else
+#define USE_SIMD (0)
+#endif
+
+#if USE_SIMD
+#if (defined(__SSE4_2__) || defined(_MSC_VER))
+#include <nmmintrin.h>
+#elif (defined(__SSE4_1__) || defined(_MSC_VER))
+#include <smmintrin.h>
+#elif (defined(__SSSE3__) || defined(_MSC_VER))
+#include <tmmintrin.h>
+#elif (defined(__SSE3__ ) || defined(_MSC_VER))
+#include <pmmintrin.h>
+#else
+#include <emmintrin.h>
+#endif
+
+typedef __m128i rsp_vec_t;
+#endif
union VECTOR_REG
{
UINT64 d[2];
UINT32 l[4];
- INT16 s[8];
+ UINT16 s[8];
UINT8 b[16];
+#if USE_SIMD
+ rsp_vec_t v;
+#endif
};
union ACCUMULATOR_REG
@@ -129,20 +160,31 @@ public:
void log_instruction_execution();
virtual void cfunc_unimplemented_opcode() { }
+ void dump(UINT32 op);
+ void dump_dmem();
+
protected:
virtual int generate_vector_opcode(drcuml_block *block, rsp_device::compiler_state *compiler, const opcode_desc *desc) { return TRUE; }
UINT16 SATURATE_ACCUM(int accum, int slice, UINT16 negative, UINT16 positive);
UINT16 SATURATE_ACCUM1(int accum, UINT16 negative, UINT16 positive);
- UINT32 m_op;
+ // Data that needs to be stored close to the generated DRC code
+ struct internal_rspcop2_state
+ {
+ UINT32 op;
+ };
+ internal_rspcop2_state *m_rspcop2_state;
rsp_device& m_rsp;
running_machine& m_machine;
UINT32 m_vres[8]; /* used for temporary vector results */
+#if USE_SIMD
+ __declspec(align(16)) VECTOR_REG m_v[32];
+#else
VECTOR_REG m_v[32];
-
+#endif
ACCUMULATOR_REG m_accum[8];
UINT16 m_vflag[6][8];
@@ -150,10 +192,198 @@ protected:
UINT32 m_reciprocal_high;
INT32 m_dp_allowed;
+#if USE_SIMD
+ enum rsp_flags_t {
+ RSP_VCO = 0,
+ RSP_VCC = 1,
+ RSP_VCE = 2
+ };
+
+ enum rsp_acc_t {
+ RSP_ACC_LO = 16,
+ RSP_ACC_MD = 8,
+ RSP_ACC_HI = 0,
+ };
+
+ enum rsp_mem_request_type {
+ RSP_MEM_REQUEST_NONE,
+ RSP_MEM_REQUEST_INT_MEM,
+ RSP_MEM_REQUEST_VECTOR,
+ RSP_MEM_REQUEST_FOURTH,
+ RSP_MEM_REQUEST_HALF,
+ RSP_MEM_REQUEST_PACK,
+ RSP_MEM_REQUEST_QUAD,
+ RSP_MEM_REQUEST_REST,
+ RSP_MEM_REQUEST_UPACK
+ };
+
+ union aligned_rsp_1vect_t {
+ rsp_vec_t __align;
+ UINT16 s[8];
+ };
+
+ union aligned_rsp_2vect_t {
+ rsp_vec_t __align[2];
+ UINT16 s[16];
+ };
+
+ union aligned_rsp_3vect_t {
+ rsp_vec_t __align[3];
+ UINT16 s[24];
+ };
+
+ __declspec(align(16)) aligned_rsp_1vect_t m_vdqm;
+ __declspec(align(16)) aligned_rsp_2vect_t m_flags[3];
+ __declspec(align(16)) aligned_rsp_3vect_t m_acc;
+ UINT32 m_dp_flag;
+
+ typedef struct
+ {
+ rsp_vec_t dummy_for_alignment;
+ const UINT16 logic_mask[2][8];
+ const UINT16 vrsq_mask_table[8][8];
+ const UINT16 shuffle_keys[16][8];
+ const UINT16 sll_b2l_keys[16][8];
+ const UINT16 sll_l2b_keys[16][8];
+ const UINT16 srl_b2l_keys[16][8];
+ const UINT16 ror_b2l_keys[16][8];
+ const UINT16 rol_l2b_keys[16][8];
+ const UINT16 ror_l2b_keys[16][8];
+ const UINT16 qr_lut[16][8];
+ const UINT16 bdls_lut[4][4];
+ const UINT16 word_reverse[8];
+ } vec_helpers_t;
+
+ static const vec_helpers_t m_vec_helpers;
+
+ rsp_vec_t vec_load_and_shuffle_operand(const UINT16* src, UINT32 element);
+ static inline UINT32 sign_extend_6(INT32 i) {
+ return ((i << (32 - 7)) >> (32 - 7)) & 0xfff;
+ }
+ static inline rsp_vec_t vec_load_unshuffled_operand(const void* src)
+ {
+ return _mm_load_si128((rsp_vec_t*) src);
+ }
+ static inline void vec_write_operand(UINT16* dest, rsp_vec_t src)
+ {
+ _mm_store_si128((rsp_vec_t*) dest, src);
+ }
+ static inline rsp_vec_t read_acc_lo(const UINT16* acc)
+ {
+ return vec_load_unshuffled_operand(acc + sizeof(rsp_vec_t));
+ }
+ static inline rsp_vec_t read_acc_mid(const UINT16* acc)
+ {
+ return vec_load_unshuffled_operand(acc + (sizeof(rsp_vec_t) >> 1));
+ }
+ static inline rsp_vec_t read_acc_hi(const void* acc)
+ {
+ return vec_load_unshuffled_operand(acc);
+ }
+ static inline rsp_vec_t read_vcc_lo(const UINT16 *vcc)
+ {
+ return vec_load_unshuffled_operand(vcc + (sizeof(rsp_vec_t) >> 1));
+ }
+ static inline rsp_vec_t read_vcc_hi(const UINT16 *vcc)
+ {
+ return vec_load_unshuffled_operand(vcc);
+ }
+ static inline rsp_vec_t read_vco_lo(const UINT16 *vco)
+ {
+ return vec_load_unshuffled_operand(vco + (sizeof(rsp_vec_t) >> 1));
+ }
+ static inline rsp_vec_t read_vco_hi(const UINT16 *vco)
+ {
+ return vec_load_unshuffled_operand(vco);
+ }
+ static inline rsp_vec_t read_vce(const UINT16 *vce)
+ {
+ return vec_load_unshuffled_operand(vce + (sizeof(rsp_vec_t) >> 1));
+ }
+ static inline void write_acc_lo(UINT16 *acc, rsp_vec_t acc_lo)
+ {
+ return vec_write_operand(acc + sizeof(rsp_vec_t), acc_lo);
+ }
+ static inline void write_acc_mid(UINT16 *acc, rsp_vec_t acc_mid)
+ {
+ return vec_write_operand(acc + (sizeof(rsp_vec_t) >> 1), acc_mid);
+ }
+ static inline void write_acc_hi(UINT16 *acc, rsp_vec_t acc_hi)
+ {
+ return vec_write_operand(acc, acc_hi);
+ }
+ static inline void write_vcc_lo(UINT16 *vcc, rsp_vec_t vcc_lo)
+ {
+ return vec_write_operand(vcc + (sizeof(rsp_vec_t) >> 1), vcc_lo);
+ }
+ static inline void write_vcc_hi(UINT16 *vcc, rsp_vec_t vcc_hi)
+ {
+ return vec_write_operand(vcc, vcc_hi);
+ }
+ static inline void write_vco_lo(UINT16 *vcc, rsp_vec_t vco_lo)
+ {
+ return vec_write_operand(vcc + (sizeof(rsp_vec_t) >> 1), vco_lo);
+ }
+ static inline void write_vco_hi(UINT16 *vcc, rsp_vec_t vco_hi)
+ {
+ return vec_write_operand(vcc, vco_hi);
+ }
+ static inline void write_vce(UINT16 *vce, rsp_vec_t vce_r)
+ {
+ return vec_write_operand(vce + (sizeof(rsp_vec_t) >> 1), vce_r);
+ }
+
+ static inline INT16 get_flags(const UINT16 *flags)
+ {
+ return _mm_movemask_epi8(_mm_packs_epi16(_mm_load_si128((rsp_vec_t*) (flags + (sizeof(rsp_vec_t) >> 1))), _mm_load_si128((rsp_vec_t*) flags)));
+ }
+
+ static inline rsp_vec_t vec_zero()
+ {
+ return _mm_setzero_si128();
+ }
+
+ void vec_load_group1(UINT32 addr, UINT32 element, UINT16* regp, rsp_vec_t reg, rsp_vec_t dqm);
+ void vec_load_group2(UINT32 addr, UINT32 element, UINT16* regp, rsp_vec_t reg, rsp_vec_t dqm, rsp_mem_request_type request_type);
+ void vec_load_group4(UINT32 addr, UINT32 element, UINT16* regp, rsp_vec_t reg, rsp_vec_t dqm, rsp_mem_request_type request_type);
+ void vec_store_group1(UINT32 addr, UINT32 element, UINT16* regp, rsp_vec_t reg, rsp_vec_t dqm);
+ void vec_store_group2(UINT32 addr, UINT32 element, UINT16* regp, rsp_vec_t reg, rsp_vec_t dqm, rsp_mem_request_type request_type);
+ void vec_store_group4(UINT32 addr, UINT32 element, UINT16* regp, rsp_vec_t reg, rsp_vec_t dqm, rsp_mem_request_type request_type);
+
+#include "clamp.h"
+#include "vabs.h"
+#include "vadd.h"
+#include "vaddc.h"
+#include "vand.h"
+#include "vch.h"
+#include "vcmp.h"
+#include "vcl.h"
+#include "vcr.h"
+#include "vdivh.h"
+#include "vmac.h"
+#include "vmov.h"
+#include "vmrg.h"
+#include "vmul.h"
+#include "vmulh.h"
+#include "vmull.h"
+#include "vmulm.h"
+#include "vmuln.h"
+#include "vor.h"
+#include "vrcpsq.h"
+#include "vrsq.h"
+#include "vsub.h"
+#include "vsubc.h"
+#include "vxor.h"
+#include "vldst.h"
+#endif
+
private:
void handle_lwc2(UINT32 op);
void handle_swc2(UINT32 op);
void handle_vector_ops(UINT32 op);
+
+ UINT32 m_div_in;
+ UINT32 m_div_out;
};
#endif /* __RSPCP2_H__ */
diff --git a/src/emu/cpu/rsp/rspcp2d.c b/src/emu/cpu/rsp/rspcp2d.c
index 3a5ca09b9ee..d7844be717c 100644
--- a/src/emu/cpu/rsp/rspcp2d.c
+++ b/src/emu/cpu/rsp/rspcp2d.c
@@ -11,7 +11,6 @@
#include "emu.h"
#include "rsp.h"
-#include "rspdiv.h"
#include "rspcp2.h"
#include "rspcp2d.h"
#include "cpu/drcfe.h"
@@ -94,7 +93,7 @@ static void cfunc_ctc2(void *param);
#define CLEAR_CLIP2_FLAG(x) { m_vflag[CLIP2][x & 7] = 0; }
#define CACHE_VALUES() \
- const int op = m_op; \
+ const int op = m_rspcop2_state->op; \
const int vdreg = VDREG; \
const int vs1reg = VS1REG; \
const int vs2reg = VS2REG; \
@@ -137,10 +136,10 @@ void rsp_cop2_drc::cfunc_unimplemented_opcode()
if ((m_machine.debug_flags & DEBUG_FLAG_ENABLED) != 0)
{
char string[200];
- rsp_dasm_one(string, ppc, m_op);
+ rsp_dasm_one(string, ppc, m_rspcop2_state->op);
osd_printf_debug("%08X: %s\n", ppc, string);
}
- fatalerror("RSP: unknown opcode %02X (%08X) at %08X\n", m_op >> 26, m_op, ppc);
+ fatalerror("RSP: unknown opcode %02X (%08X) at %08X\n", m_rspcop2_state->op >> 26, m_rspcop2_state->op, ppc);
}
static void unimplemented_opcode(void *param)
@@ -267,7 +266,7 @@ void rsp_cop2_drc::state_string_export(const int index, std::string &str)
void rsp_cop2_drc::lbv()
{
- UINT32 op = m_op;
+ UINT32 op = m_rspcop2_state->op;
UINT32 ea = 0;
int dest = (op >> 16) & 0x1f;
@@ -300,7 +299,7 @@ static void cfunc_lbv(void *param)
void rsp_cop2_drc::lsv()
{
- UINT32 op = m_op;
+ UINT32 op = m_rspcop2_state->op;
int dest = (op >> 16) & 0x1f;
int base = (op >> 21) & 0x1f;
int index = (op >> 7) & 0xe;
@@ -336,7 +335,7 @@ static void cfunc_lsv(void *param)
void rsp_cop2_drc::llv()
{
- UINT32 op = m_op;
+ UINT32 op = m_rspcop2_state->op;
UINT32 ea = 0;
int dest = (op >> 16) & 0x1f;
int base = (op >> 21) & 0x1f;
@@ -375,7 +374,7 @@ static void cfunc_llv(void *param)
void rsp_cop2_drc::ldv()
{
- UINT32 op = m_op;
+ UINT32 op = m_rspcop2_state->op;
UINT32 ea = 0;
int dest = (op >> 16) & 0x1f;
int base = (op >> 21) & 0x1f;
@@ -414,7 +413,7 @@ static void cfunc_ldv(void *param)
void rsp_cop2_drc::lqv()
{
- UINT32 op = m_op;
+ UINT32 op = m_rspcop2_state->op;
int dest = (op >> 16) & 0x1f;
int base = (op >> 21) & 0x1f;
int offset = (op & 0x7f);
@@ -452,7 +451,7 @@ static void cfunc_lqv(void *param)
void rsp_cop2_drc::lrv()
{
- UINT32 op = m_op;
+ UINT32 op = m_rspcop2_state->op;
int dest = (op >> 16) & 0x1f;
int base = (op >> 21) & 0x1f;
int index = (op >> 7) & 0xf;
@@ -491,7 +490,7 @@ static void cfunc_lrv(void *param)
void rsp_cop2_drc::lpv()
{
- UINT32 op = m_op;
+ UINT32 op = m_rspcop2_state->op;
int dest = (op >> 16) & 0x1f;
int base = (op >> 21) & 0x1f;
int index = (op >> 7) & 0xf;
@@ -526,7 +525,7 @@ static void cfunc_lpv(void *param)
void rsp_cop2_drc::luv()
{
- UINT32 op = m_op;
+ UINT32 op = m_rspcop2_state->op;
int dest = (op >> 16) & 0x1f;
int base = (op >> 21) & 0x1f;
int index = (op >> 7) & 0xf;
@@ -561,7 +560,7 @@ static void cfunc_luv(void *param)
void rsp_cop2_drc::lhv()
{
- UINT32 op = m_op;
+ UINT32 op = m_rspcop2_state->op;
int dest = (op >> 16) & 0x1f;
int base = (op >> 21) & 0x1f;
int index = (op >> 7) & 0xf;
@@ -595,7 +594,7 @@ static void cfunc_lhv(void *param)
void rsp_cop2_drc::lfv()
{
- UINT32 op = m_op;
+ UINT32 op = m_rspcop2_state->op;
int dest = (op >> 16) & 0x1f;
int base = (op >> 21) & 0x1f;
int index = (op >> 7) & 0xf;
@@ -636,7 +635,7 @@ static void cfunc_lfv(void *param)
void rsp_cop2_drc::lwv()
{
- UINT32 op = m_op;
+ UINT32 op = m_rspcop2_state->op;
int dest = (op >> 16) & 0x1f;
int base = (op >> 21) & 0x1f;
int index = (op >> 7) & 0xf;
@@ -673,7 +672,7 @@ static void cfunc_lwv(void *param)
void rsp_cop2_drc::ltv()
{
- UINT32 op = m_op;
+ UINT32 op = m_rspcop2_state->op;
int dest = (op >> 16) & 0x1f;
int base = (op >> 21) & 0x1f;
int index = (op >> 7) & 0xf;
@@ -720,62 +719,62 @@ int rsp_cop2_drc::generate_lwc2(drcuml_block *block, rsp_device::compiler_state
switch ((op >> 11) & 0x1f)
{
case 0x00: /* LBV */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [m_op],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [m_rspcop2_state->op],desc->opptr.l
UML_CALLC(block, cfunc_lbv, this);
return TRUE;
case 0x01: /* LSV */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [m_op],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [m_rspcop2_state->op],desc->opptr.l
UML_CALLC(block, cfunc_lsv, this);
return TRUE;
case 0x02: /* LLV */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [m_op],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [m_rspcop2_state->op],desc->opptr.l
UML_CALLC(block, cfunc_llv, this);
return TRUE;
case 0x03: /* LDV */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [m_op],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [m_rspcop2_state->op],desc->opptr.l
UML_CALLC(block, cfunc_ldv, this);
return TRUE;
case 0x04: /* LQV */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [m_op],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [m_rspcop2_state->op],desc->opptr.l
UML_CALLC(block, cfunc_lqv, this);
return TRUE;
case 0x05: /* LRV */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [m_op],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [m_rspcop2_state->op],desc->opptr.l
UML_CALLC(block, cfunc_lrv, this);
return TRUE;
case 0x06: /* LPV */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [m_op],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [m_rspcop2_state->op],desc->opptr.l
UML_CALLC(block, cfunc_lpv, this);
return TRUE;
case 0x07: /* LUV */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [m_op],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [m_rspcop2_state->op],desc->opptr.l
UML_CALLC(block, cfunc_luv, this);
return TRUE;
case 0x08: /* LHV */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [m_op],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [m_rspcop2_state->op],desc->opptr.l
UML_CALLC(block, cfunc_lhv, this);
return TRUE;
case 0x09: /* LFV */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [m_op],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [m_rspcop2_state->op],desc->opptr.l
UML_CALLC(block, cfunc_lfv, this);
return TRUE;
case 0x0a: /* LWV */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [m_op],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [m_rspcop2_state->op],desc->opptr.l
UML_CALLC(block, cfunc_lwv, this);
return TRUE;
case 0x0b: /* LTV */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [m_op],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [m_rspcop2_state->op],desc->opptr.l
UML_CALLC(block, cfunc_ltv, this);
return TRUE;
@@ -800,7 +799,7 @@ int rsp_cop2_drc::generate_lwc2(drcuml_block *block, rsp_device::compiler_state
void rsp_cop2_drc::sbv()
{
- UINT32 op = m_op;
+ UINT32 op = m_rspcop2_state->op;
int dest = (op >> 16) & 0x1f;
int base = (op >> 21) & 0x1f;
int index = (op >> 7) & 0xf;
@@ -831,7 +830,7 @@ static void cfunc_sbv(void *param)
void rsp_cop2_drc::ssv()
{
- UINT32 op = m_op;
+ UINT32 op = m_rspcop2_state->op;
int dest = (op >> 16) & 0x1f;
int base = (op >> 21) & 0x1f;
int index = (op >> 7) & 0xf;
@@ -868,7 +867,7 @@ static void cfunc_ssv(void *param)
void rsp_cop2_drc::slv()
{
- UINT32 op = m_op;
+ UINT32 op = m_rspcop2_state->op;
int dest = (op >> 16) & 0x1f;
int base = (op >> 21) & 0x1f;
int index = (op >> 7) & 0xf;
@@ -905,7 +904,7 @@ static void cfunc_slv(void *param)
void rsp_cop2_drc::sdv()
{
- UINT32 op = m_op;
+ UINT32 op = m_rspcop2_state->op;
int dest = (op >> 16) & 0x1f;
int base = (op >> 21) & 0x1f;
int index = (op >> 7) & 0x8;
@@ -941,7 +940,7 @@ static void cfunc_sdv(void *param)
void rsp_cop2_drc::sqv()
{
- UINT32 op = m_op;
+ UINT32 op = m_rspcop2_state->op;
int dest = (op >> 16) & 0x1f;
int base = (op >> 21) & 0x1f;
int index = (op >> 7) & 0xf;
@@ -977,7 +976,7 @@ static void cfunc_sqv(void *param)
void rsp_cop2_drc::srv()
{
- UINT32 op = m_op;
+ UINT32 op = m_rspcop2_state->op;
int dest = (op >> 16) & 0x1f;
int base = (op >> 21) & 0x1f;
int index = (op >> 7) & 0xf;
@@ -1017,7 +1016,7 @@ static void cfunc_srv(void *param)
void rsp_cop2_drc::spv()
{
- UINT32 op = m_op;
+ UINT32 op = m_rspcop2_state->op;
int dest = (op >> 16) & 0x1f;
int base = (op >> 21) & 0x1f;
int index = (op >> 7) & 0xf;
@@ -1060,7 +1059,7 @@ static void cfunc_spv(void *param)
void rsp_cop2_drc::suv()
{
- UINT32 op = m_op;
+ UINT32 op = m_rspcop2_state->op;
int dest = (op >> 16) & 0x1f;
int base = (op >> 21) & 0x1f;
int index = (op >> 7) & 0xf;
@@ -1103,7 +1102,7 @@ static void cfunc_suv(void *param)
void rsp_cop2_drc::shv()
{
- UINT32 op = m_op;
+ UINT32 op = m_rspcop2_state->op;
int dest = (op >> 16) & 0x1f;
int base = (op >> 21) & 0x1f;
int index = (op >> 7) & 0xf;
@@ -1141,7 +1140,7 @@ static void cfunc_shv(void *param)
void rsp_cop2_drc::sfv()
{
- UINT32 op = m_op;
+ UINT32 op = m_rspcop2_state->op;
int dest = (op >> 16) & 0x1f;
int base = (op >> 21) & 0x1f;
int index = (op >> 7) & 0xf;
@@ -1182,7 +1181,7 @@ static void cfunc_sfv(void *param)
void rsp_cop2_drc::swv()
{
- UINT32 op = m_op;
+ UINT32 op = m_rspcop2_state->op;
int dest = (op >> 16) & 0x1f;
int base = (op >> 21) & 0x1f;
int index = (op >> 7) & 0xf;
@@ -1221,7 +1220,7 @@ static void cfunc_swv(void *param)
void rsp_cop2_drc::stv()
{
- UINT32 op = m_op;
+ UINT32 op = m_rspcop2_state->op;
int dest = (op >> 16) & 0x1f;
int base = (op >> 21) & 0x1f;
int index = (op >> 7) & 0xf;
@@ -1270,62 +1269,62 @@ int rsp_cop2_drc::generate_swc2(drcuml_block *block, rsp_device::compiler_state
switch ((op >> 11) & 0x1f)
{
case 0x00: /* SBV */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_sbv, this);
return TRUE;
case 0x01: /* SSV */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_ssv, this);
return TRUE;
case 0x02: /* SLV */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_slv, this);
return TRUE;
case 0x03: /* SDV */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_sdv, this);
return TRUE;
case 0x04: /* SQV */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_sqv, this);
return TRUE;
case 0x05: /* SRV */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_srv, this);
return TRUE;
case 0x06: /* SPV */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_spv, this);
return TRUE;
case 0x07: /* SUV */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_suv, this);
return TRUE;
case 0x08: /* SHV */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_shv, this);
return TRUE;
case 0x09: /* SFV */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_sfv, this);
return TRUE;
case 0x0a: /* SWV */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_swv, this);
return TRUE;
case 0x0b: /* STV */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_stv, this);
return TRUE;
@@ -2079,7 +2078,7 @@ static void cfunc_vaddb(void *param)
void rsp_cop2_drc::vsaw()
{
- const int op = m_op;
+ const int op = m_rspcop2_state->op;
const int vdreg = VDREG;
const int el = EL;
@@ -3264,217 +3263,217 @@ int rsp_cop2_drc::generate_vector_opcode(drcuml_block *block, rsp_device::compil
switch (op & 0x3f)
{
case 0x00: /* VMULF */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_vmulf, this);
return TRUE;
case 0x01: /* VMULU */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_vmulu, this);
return TRUE;
case 0x04: /* VMUDL */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_vmudl, this);
return TRUE;
case 0x05: /* VMUDM */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_vmudm, this);
return TRUE;
case 0x06: /* VMUDN */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_vmudn, this);
return TRUE;
case 0x07: /* VMUDH */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_vmudh, this);
return TRUE;
case 0x08: /* VMACF */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_vmacf, this);
return TRUE;
case 0x09: /* VMACU */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_vmacu, this);
return TRUE;
case 0x0c: /* VMADL */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_vmadl, this);
return TRUE;
case 0x0d: /* VMADM */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_vmadm, this);
return TRUE;
case 0x0e: /* VMADN */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_vmadn, this);
return TRUE;
case 0x0f: /* VMADH */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_vmadh, this);
return TRUE;
case 0x10: /* VADD */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_vadd, this);
return TRUE;
case 0x11: /* VSUB */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_vsub, this);
return TRUE;
case 0x13: /* VABS */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_vabs, this);
return TRUE;
case 0x14: /* VADDC */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_vaddc, this);
return TRUE;
case 0x15: /* VSUBC */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_vsubc, this);
return TRUE;
case 0x16: /* VADDB */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_vaddb, this);
return TRUE;
case 0x17: /* VSUBB (reserved, functionally identical to VADDB) */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_vaddb, this);
return TRUE;
case 0x18: /* VACCB (reserved, functionally identical to VADDB) */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_vaddb, this);
return TRUE;
case 0x19: /* VSUCB (reserved, functionally identical to VADDB) */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_vaddb, this);
return TRUE;
case 0x1d: /* VSAW */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_vsaw, this);
return TRUE;
case 0x20: /* VLT */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_vlt, this);
return TRUE;
case 0x21: /* VEQ */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_veq, this);
return TRUE;
case 0x22: /* VNE */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_vne, this);
return TRUE;
case 0x23: /* VGE */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_vge, this);
return TRUE;
case 0x24: /* VCL */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_vcl, this);
return TRUE;
case 0x25: /* VCH */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_vch, this);
return TRUE;
case 0x26: /* VCR */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_vcr, this);
return TRUE;
case 0x27: /* VMRG */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_vmrg, this);
return TRUE;
case 0x28: /* VAND */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_vand, this);
return TRUE;
case 0x29: /* VNAND */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_vnand, this);
return TRUE;
case 0x2a: /* VOR */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_vor, this);
return TRUE;
case 0x2b: /* VNOR */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_vnor, this);
return TRUE;
case 0x2c: /* VXOR */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_vxor, this);
return TRUE;
case 0x2d: /* VNXOR */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_vnxor, this);
return TRUE;
case 0x30: /* VRCP */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_vrcp, this);
return TRUE;
case 0x31: /* VRCPL */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_vrcpl, this);
return TRUE;
case 0x32: /* VRCPH */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_vrcph, this);
return TRUE;
case 0x33: /* VMOV */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_vmov, this);
return TRUE;
case 0x34: /* VRSQ */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_vrsq, this);
return TRUE;
case 0x35: /* VRSQL */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_vrsql, this);
return TRUE;
case 0x36: /* VRSQH */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_vrsqh, this);
return TRUE;
@@ -3483,7 +3482,7 @@ int rsp_cop2_drc::generate_vector_opcode(drcuml_block *block, rsp_device::compil
return TRUE;
default:
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, unimplemented_opcode, &m_rsp);
return FALSE;
}
@@ -3496,7 +3495,7 @@ int rsp_cop2_drc::generate_vector_opcode(drcuml_block *block, rsp_device::compil
void rsp_cop2_drc::mfc2()
{
- UINT32 op = m_op;
+ UINT32 op = m_rspcop2_state->op;
int el = (op >> 7) & 0xf;
UINT16 b1 = VREG_B(VS1REG, (el+0) & 0xf);
@@ -3511,7 +3510,7 @@ static void cfunc_mfc2(void *param)
void rsp_cop2_drc::cfc2()
{
- UINT32 op = m_op;
+ UINT32 op = m_rspcop2_state->op;
if (RTREG)
{
switch(RDREG)
@@ -3576,7 +3575,7 @@ static void cfunc_cfc2(void *param)
void rsp_cop2_drc::mtc2()
{
- UINT32 op = m_op;
+ UINT32 op = m_rspcop2_state->op;
int el = (op >> 7) & 0xf;
VREG_B(VS1REG, (el+0) & 0xf) = (RTVAL >> 8) & 0xff;
VREG_B(VS1REG, (el+1) & 0xf) = (RTVAL >> 0) & 0xff;
@@ -3590,7 +3589,7 @@ static void cfunc_mtc2(void *param)
void rsp_cop2_drc::ctc2()
{
- UINT32 op = m_op;
+ UINT32 op = m_rspcop2_state->op;
switch(RDREG)
{
case 0:
@@ -3706,7 +3705,7 @@ int rsp_cop2_drc::generate_cop2(drcuml_block *block, rsp_device::compiler_state
case 0x00: /* MFCz */
if (RTREG != 0)
{
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_mfc2, this); // callc mfc2
}
return TRUE;
@@ -3714,18 +3713,18 @@ int rsp_cop2_drc::generate_cop2(drcuml_block *block, rsp_device::compiler_state
case 0x02: /* CFCz */
if (RTREG != 0)
{
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_cfc2, this); // callc cfc2
}
return TRUE;
case 0x04: /* MTCz */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_mtc2, this); // callc mtc2
return TRUE;
case 0x06: /* CTCz */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
+ UML_MOV(block, mem(&m_rspcop2_state->op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
UML_CALLC(block, cfunc_ctc2, this); // callc ctc2
return TRUE;
diff --git a/src/emu/cpu/rsp/rspcp2d.h b/src/emu/cpu/rsp/rspcp2d.h
index d56e04e7532..831773d5c66 100644
--- a/src/emu/cpu/rsp/rspcp2d.h
+++ b/src/emu/cpu/rsp/rspcp2d.h
@@ -31,6 +31,7 @@ class rsp_cop2_drc : public rsp_cop2
virtual void state_string_export(const int index, std::string &str);
void cfunc_unimplemented_opcode();
+
public:
virtual void lbv();
virtual void lsv();
diff --git a/src/emu/cpu/rsp/rspcp2s.c b/src/emu/cpu/rsp/rspcp2s.c
deleted file mode 100644
index 4f2c2b18fa9..00000000000
--- a/src/emu/cpu/rsp/rspcp2s.c
+++ /dev/null
@@ -1,3630 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Ryan Holtz
-/***************************************************************************
-
- rspcp2s.c
-
- Universal machine language-based Nintendo/SGI RSP COP2 emulator, with
- SSSE3 SIMD optimizations.
- Written by Harmony of the MESS team.
-
-***************************************************************************/
-
-#include "emu.h"
-#include "rsp.h"
-#include "rspdiv.h"
-#include "rspcp2.h"
-#include "cpu/drcfe.h"
-#include "cpu/drcuml.h"
-#include "cpu/drcumlsh.h"
-
-using namespace uml;
-
-/***************************************************************************
- Helpful Defines
-***************************************************************************/
-
-#define VDREG ((op >> 6) & 0x1f)
-#define VS1REG ((op >> 11) & 0x1f)
-#define VS2REG ((op >> 16) & 0x1f)
-#define EL ((op >> 21) & 0xf)
-
-#define RSVAL (m_rsp.m_rsp_state->r[RSREG])
-#define RTVAL (m_rsp.m_rsp_state->r[RTREG])
-#define RDVAL (m_rsp.m_rsp_state->r[RDREG])
-
-#define EXTRACT16(reg, value, element) \
- switch((element) & 7) \
- { \
- case 0: value = _mm_extract_epi16(reg, 0); break; \
- case 1: value = _mm_extract_epi16(reg, 1); break; \
- case 2: value = _mm_extract_epi16(reg, 2); break; \
- case 3: value = _mm_extract_epi16(reg, 3); break; \
- case 4: value = _mm_extract_epi16(reg, 4); break; \
- case 5: value = _mm_extract_epi16(reg, 5); break; \
- case 6: value = _mm_extract_epi16(reg, 6); break; \
- case 7: value = _mm_extract_epi16(reg, 7); break; \
- }
-
-
-#define INSERT16(reg, value, element) \
- switch((element) & 7) \
- { \
- case 0: reg = _mm_insert_epi16(reg, value, 0); break; \
- case 1: reg = _mm_insert_epi16(reg, value, 1); break; \
- case 2: reg = _mm_insert_epi16(reg, value, 2); break; \
- case 3: reg = _mm_insert_epi16(reg, value, 3); break; \
- case 4: reg = _mm_insert_epi16(reg, value, 4); break; \
- case 5: reg = _mm_insert_epi16(reg, value, 5); break; \
- case 6: reg = _mm_insert_epi16(reg, value, 6); break; \
- case 7: reg = _mm_insert_epi16(reg, value, 7); break; \
- }
-
-
-#define VREG_B(reg, offset) m_v[(reg)].b[(offset)^1]
-#define W_VREG_S(reg, offset) m_v[(reg)].s[(offset)]
-#define VREG_S(reg, offset) (INT16)m_v[(reg)].s[(offset)]
-
-#define VEC_EL_2(x,z) (vector_elements_2[(x)][(z)])
-
-#define ACCUM(x) m_accum[x].q
-
-#define CARRY 0
-#define COMPARE 1
-#define CLIP1 2
-#define ZERO 3
-#define CLIP2 4
-
-static void cfunc_mfc2(void *param);
-static void cfunc_cfc2(void *param);
-static void cfunc_mtc2(void *param);
-static void cfunc_ctc2(void *param);
-
-inline UINT16 rsp_cop2_simd::ACCUM_H(int x)
-{
- UINT16 out;
- EXTRACT16(m_accum_h, out, x);
- return out;
-}
-
-inline UINT16 rsp_cop2_simd::ACCUM_M(int x)
-{
- UINT16 out;
- EXTRACT16(m_accum_m, out, x);
- return out;
-}
-
-inline UINT16 rsp_cop2_simd::ACCUM_L(int x)
-{
- UINT16 out;
- EXTRACT16(m_accum_l, out, x);
- return out;
-}
-
-inline UINT16 rsp_cop2_simd::ACCUM_LL(int x)
-{
- UINT16 out;
- EXTRACT16(m_accum_ll, out, x);
- return out;
-}
-
-#define SET_ACCUM_H(v, x) INSERT16(m_accum_h, v, x);
-#define SET_ACCUM_M(v, x) INSERT16(m_>accum_m, v, x);
-#define SET_ACCUM_L(v, x) INSERT16(m_accum_l, v, x);
-#define SET_ACCUM_LL(v, x) INSERT16(m_accum_ll, v, x);
-
-#define GET_VS1(out, i) EXTRACT16(m_xv[VS1REG], out, i);
-#define GET_VS2(out, i) EXTRACT16(m_xv[VS2REG], out, VEC_EL_2(EL, i));
-
-inline UINT16 rsp_cop2_simd::CARRY_FLAG(const int x)
-{
- UINT16 out;
- EXTRACT16(m_xvflag[CARRY], out, x);
- return out;
-}
-
-inline UINT16 rsp_cop2_simd::COMPARE_FLAG(const int x)
-{
- UINT16 out;
- EXTRACT16(m_xvflag[COMPARE], out, x);
- return out;
-}
-
-inline UINT16 rsp_cop2_simd::CLIP1_FLAG(const int x)
-{
- UINT16 out;
- EXTRACT16(m_xvflag[CLIP1], out, x);
- return out;
-}
-
-inline UINT16 rsp_cop2_simd::ZERO_FLAG(const int x)
-{
- UINT16 out;
- EXTRACT16(m_xvflag[ZERO], out, x);
- return out;
-}
-
-inline UINT16 rsp_cop2_simd::CLIP2_FLAG(const int x)
-{
- UINT16 out;
- EXTRACT16(m_xvflag[CLIP2], out, x);
- return out;
-}
-
-#define CLEAR_CARRY_FLAGS() { m_xvflag[CARRY] = _mm_setzero_si128(); }
-#define CLEAR_COMPARE_FLAGS() { m_xvflag[COMPARE] = _mm_setzero_si128(); }
-#define CLEAR_CLIP1_FLAGS() { m_xvflag[CLIP1] = _mm_setzero_si128(); }
-#define CLEAR_ZERO_FLAGS() { m_xvflag[ZERO] = _mm_setzero_si128(); }
-#define CLEAR_CLIP2_FLAGS() { m_xvflag[CLIP2] = _mm_setzero_si128(); }
-
-#define SET_CARRY_FLAG(x) { INSERT16(m_xvflag[CARRY], 0xffff, x); }
-#define SET_COMPARE_FLAG(x) { INSERT16(m_xvflag[COMPARE], 0xffff, x); }
-#define SET_CLIP1_FLAG(x) { INSERT16(m_xvflag[CLIP1], 0xffff, x); }
-#define SET_ZERO_FLAG(x) { INSERT16(m_xvflag[ZERO], 0xffff, x); }
-#define SET_CLIP2_FLAG(x) { INSERT16(m_xvflag[CLIP2], 0xffff, x); }
-
-#define CLEAR_CARRY_FLAG(x) { INSERT16(m_xvflag[CARRY], 0, x); }
-#define CLEAR_COMPARE_FLAG(x) { INSERT16(m_xvflag[COMPARE], 0, x); }
-#define CLEAR_CLIP1_FLAG(x) { INSERT16(m_xvflag[CLIP1], 0, x); }
-#define CLEAR_ZERO_FLAG(x) { INSERT16(m_xvflag[ZERO], 0, x); }
-#define CLEAR_CLIP2_FLAG(x) { INSERT16(m_xvflag[CLIP2], 0, x); }
-
-#define WRITEBACK_RESULT() { \
- INSERT16(m_xv[VDREG], m_vres[0], 0); \
- INSERT16(m_xv[VDREG], m_vres[1], 1); \
- INSERT16(m_xv[VDREG], m_vres[2], 2); \
- INSERT16(m_xv[VDREG], m_vres[3], 3); \
- INSERT16(m_xv[VDREG], m_vres[4], 4); \
- INSERT16(m_xv[VDREG], m_vres[5], 5); \
- INSERT16(m_xv[VDREG], m_vres[6], 6); \
- INSERT16(m_xv[VDREG], m_vres[7], 7); \
-}
-#endif
-
-static const int vector_elements_2[16][8] =
-{
- { 0, 1, 2, 3, 4, 5, 6, 7 }, // none
- { 0, 1, 2, 3, 4, 5, 6, 7 }, // ???
- { 0, 0, 2, 2, 4, 4, 6, 6 }, // 0q
- { 1, 1, 3, 3, 5, 5, 7, 7 }, // 1q
- { 0, 0, 0, 0, 4, 4, 4, 4 }, // 0h
- { 1, 1, 1, 1, 5, 5, 5, 5 }, // 1h
- { 2, 2, 2, 2, 6, 6, 6, 6 }, // 2h
- { 3, 3, 3, 3, 7, 7, 7, 7 }, // 3h
- { 0, 0, 0, 0, 0, 0, 0, 0 }, // 0
- { 1, 1, 1, 1, 1, 1, 1, 1 }, // 1
- { 2, 2, 2, 2, 2, 2, 2, 2 }, // 2
- { 3, 3, 3, 3, 3, 3, 3, 3 }, // 3
- { 4, 4, 4, 4, 4, 4, 4, 4 }, // 4
- { 5, 5, 5, 5, 5, 5, 5, 5 }, // 5
- { 6, 6, 6, 6, 6, 6, 6, 6 }, // 6
- { 7, 7, 7, 7, 7, 7, 7, 7 }, // 7
-};
-
-static __m128i vec_himask;
-static __m128i vec_lomask;
-static __m128i vec_hibit;
-static __m128i vec_lobit;
-static __m128i vec_n32768;
-static __m128i vec_32767;
-static __m128i vec_flagmask;
-static __m128i vec_shiftmask2;
-static __m128i vec_shiftmask4;
-static __m128i vec_flag_reverse;
-static __m128i vec_neg1;
-static __m128i vec_zero;
-static __m128i vec_shuf[16];
-static __m128i vec_shuf_inverse[16];
-
-rsp_cop2_simd::rsp_cop2_simd(rsp_device &rsp, running_machine &machine) : rsp_cop2(rsp, machine)
- : m_accum_h(0)
- , m_accum_m(0)
- , m_accum_l(0)
- , m_accum_ll(0)
-#if SIMUL_SIMD
- , m_old_reciprocal_res(0)
- , m_old_reciprocal_high(0)
- , m_old_dp_allowed(0)
- , m_scalar_reciprocal_res(0)
- , m_scalar_reciprocal_high(0)
- , m_scalar_dp_allowed(0)
- , m_simd_reciprocal_res(0)
- , m_simd_reciprocal_high(0)
- , m_simd_dp_allowed(0)
-#endif
-{
-#if SIMUL_SIMD
- memset(m_old_r, 0, sizeof(m_old_r));
- memset(m_old_dmem, 0, sizeof(m_old_dmem));
- memset(m_scalar_r, 0, sizeof(m_scalar_r));
- memset(m_scalar_dmem, 0, sizeof(m_scalar_dmem));
-#endif
- memset(m_xv, 0, sizeof(m_xv));
- memset(m_xvflag, 0, sizeof(m_xvflag));
-
- vec_shuf_inverse[ 0] = _mm_set_epi16(0x0f0e, 0x0d0c, 0x0b0a, 0x0908, 0x0706, 0x0504, 0x0302, 0x0100); // none
- vec_shuf_inverse[ 1] = _mm_set_epi16(0x0f0e, 0x0d0c, 0x0b0a, 0x0908, 0x0706, 0x0504, 0x0302, 0x0100); // ???
- vec_shuf_inverse[ 2] = _mm_set_epi16(0x0d0c, 0x0d0c, 0x0908, 0x0908, 0x0504, 0x0504, 0x0100, 0x0100); // 0q
- vec_shuf_inverse[ 3] = _mm_set_epi16(0x0f0e, 0x0f0e, 0x0b0a, 0x0b0a, 0x0706, 0x0706, 0x0302, 0x0302); // 1q
- vec_shuf_inverse[ 4] = _mm_set_epi16(0x0908, 0x0908, 0x0908, 0x0908, 0x0100, 0x0100, 0x0100, 0x0100); // 0h
- vec_shuf_inverse[ 5] = _mm_set_epi16(0x0b0a, 0x0b0a, 0x0b0a, 0x0b0a, 0x0302, 0x0302, 0x0302, 0x0302); // 1h
- vec_shuf_inverse[ 6] = _mm_set_epi16(0x0d0c, 0x0d0c, 0x0d0c, 0x0d0c, 0x0504, 0x0504, 0x0504, 0x0504); // 2h
- vec_shuf_inverse[ 7] = _mm_set_epi16(0x0f0e, 0x0f0e, 0x0f0e, 0x0f0e, 0x0706, 0x0706, 0x0706, 0x0706); // 3h
- vec_shuf_inverse[ 8] = _mm_set_epi16(0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100); // 0
- vec_shuf_inverse[ 9] = _mm_set_epi16(0x0302, 0x0302, 0x0302, 0x0302, 0x0302, 0x0302, 0x0302, 0x0302); // 1
- vec_shuf_inverse[10] = _mm_set_epi16(0x0504, 0x0504, 0x0504, 0x0504, 0x0504, 0x0504, 0x0504, 0x0504); // 2
- vec_shuf_inverse[11] = _mm_set_epi16(0x0706, 0x0706, 0x0706, 0x0706, 0x0706, 0x0706, 0x0706, 0x0706); // 3
- vec_shuf_inverse[12] = _mm_set_epi16(0x0908, 0x0908, 0x0908, 0x0908, 0x0908, 0x0908, 0x0908, 0x0908); // 4
- vec_shuf_inverse[13] = _mm_set_epi16(0x0b0a, 0x0b0a, 0x0b0a, 0x0b0a, 0x0b0a, 0x0b0a, 0x0b0a, 0x0b0a); // 5
- vec_shuf_inverse[14] = _mm_set_epi16(0x0d0c, 0x0d0c, 0x0d0c, 0x0d0c, 0x0d0c, 0x0d0c, 0x0d0c, 0x0d0c); // 6
- vec_shuf_inverse[15] = _mm_set_epi16(0x0f0e, 0x0f0e, 0x0f0e, 0x0f0e, 0x0f0e, 0x0f0e, 0x0f0e, 0x0f0e); // 7
-
- vec_shuf[ 0] = _mm_set_epi16(0x0100, 0x0302, 0x0504, 0x0706, 0x0908, 0x0b0a, 0x0d0c, 0x0f0e); // none
- vec_shuf[ 1] = _mm_set_epi16(0x0100, 0x0302, 0x0504, 0x0706, 0x0908, 0x0b0a, 0x0d0c, 0x0f0e); // ???
- vec_shuf[ 2] = _mm_set_epi16(0x0302, 0x0302, 0x0706, 0x0706, 0x0b0a, 0x0b0a, 0x0f0e, 0x0f0e); // 0q
- vec_shuf[ 3] = _mm_set_epi16(0x0100, 0x0100, 0x0504, 0x0706, 0x0908, 0x0908, 0x0d0c, 0x0d0c); // 1q
- vec_shuf[ 4] = _mm_set_epi16(0x0706, 0x0706, 0x0706, 0x0706, 0x0f0e, 0x0f0e, 0x0f0e, 0x0f0e); // 0q
- vec_shuf[ 5] = _mm_set_epi16(0x0504, 0x0504, 0x0504, 0x0504, 0x0d0c, 0x0d0c, 0x0d0c, 0x0d0c); // 1q
- vec_shuf[ 6] = _mm_set_epi16(0x0302, 0x0302, 0x0302, 0x0302, 0x0b0a, 0x0b0a, 0x0b0a, 0x0b0a); // 2q
- vec_shuf[ 7] = _mm_set_epi16(0x0100, 0x0100, 0x0100, 0x0100, 0x0908, 0x0908, 0x0908, 0x0908); // 3q
- vec_shuf[ 8] = _mm_set_epi16(0x0f0e, 0x0f0e, 0x0f0e, 0x0f0e, 0x0f0e, 0x0f0e, 0x0f0e, 0x0f0e); // 0
- vec_shuf[ 9] = _mm_set_epi16(0x0d0c, 0x0d0c, 0x0d0c, 0x0d0c, 0x0d0c, 0x0d0c, 0x0d0c, 0x0d0c); // 1
- vec_shuf[10] = _mm_set_epi16(0x0b0a, 0x0b0a, 0x0b0a, 0x0b0a, 0x0b0a, 0x0b0a, 0x0b0a, 0x0b0a); // 2
- vec_shuf[11] = _mm_set_epi16(0x0908, 0x0908, 0x0908, 0x0908, 0x0908, 0x0908, 0x0908, 0x0908); // 3
- vec_shuf[12] = _mm_set_epi16(0x0706, 0x0706, 0x0706, 0x0706, 0x0706, 0x0706, 0x0706, 0x0706); // 4
- vec_shuf[13] = _mm_set_epi16(0x0504, 0x0504, 0x0504, 0x0504, 0x0504, 0x0504, 0x0504, 0x0504); // 5
- vec_shuf[14] = _mm_set_epi16(0x0302, 0x0302, 0x0302, 0x0302, 0x0302, 0x0302, 0x0302, 0x0302); // 6
- vec_shuf[15] = _mm_set_epi16(0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100); // 7
- m_accum_h = _mm_setzero_si128();
- m_accum_m = _mm_setzero_si128();
- m_accum_l = _mm_setzero_si128();
- m_accum_ll = _mm_setzero_si128();
- vec_neg1 = _mm_set_epi64x(0xffffffffffffffffL, 0xffffffffffffffffL);
- vec_zero = _mm_setzero_si128();
- vec_himask = _mm_set_epi64x(0xffff0000ffff0000L, 0xffff0000ffff0000L);
- vec_lomask = _mm_set_epi64x(0x0000ffff0000ffffL, 0x0000ffff0000ffffL);
- vec_hibit = _mm_set_epi64x(0x0001000000010000L, 0x0001000000010000L);
- vec_lobit = _mm_set_epi64x(0x0000000100000001L, 0x0000000100000001L);
- vec_32767 = _mm_set_epi64x(0x7fff7fff7fff7fffL, 0x7fff7fff7fff7fffL);
- vec_n32768 = _mm_set_epi64x(0x8000800080008000L, 0x8000800080008000L);
- vec_flagmask = _mm_set_epi64x(0x0001000100010001L, 0x0001000100010001L);
- vec_shiftmask2 = _mm_set_epi64x(0x0000000300000003L, 0x0000000300000003L);
- vec_shiftmask4 = _mm_set_epi64x(0x000000000000000fL, 0x000000000000000fL);
- vec_flag_reverse = _mm_set_epi16(0x0100, 0x0302, 0x0504, 0x0706, 0x0908, 0x0b0a, 0x0d0c, 0x0f0e);
-}
-
-void rsp_cop2_simd::state_string_export(const int index, std::string &str)
-{
- switch (index)
- {
- case RSP_V0:
- string.printf("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)_mm_extract_epi16(m_xv[ 0], 7), (UINT16)_mm_extract_epi16(m_xv[ 0], 6), (UINT16)_mm_extract_epi16(m_xv[ 0], 5), (UINT16)_mm_extract_epi16(m_xv[ 0], 4), (UINT16)_mm_extract_epi16(m_xv[ 0], 3), (UINT16)_mm_extract_epi16(m_xv[ 0], 2), (UINT16)_mm_extract_epi16(m_xv[ 0], 1), (UINT16)_mm_extract_epi16(m_xv[ 0], 0));
- break;
- case RSP_V1:
- string.printf("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)_mm_extract_epi16(m_xv[ 1], 7), (UINT16)_mm_extract_epi16(m_xv[ 1], 6), (UINT16)_mm_extract_epi16(m_xv[ 1], 5), (UINT16)_mm_extract_epi16(m_xv[ 1], 4), (UINT16)_mm_extract_epi16(m_xv[ 1], 3), (UINT16)_mm_extract_epi16(m_xv[ 1], 2), (UINT16)_mm_extract_epi16(m_xv[ 1], 1), (UINT16)_mm_extract_epi16(m_xv[ 1], 0));
- break;
- case RSP_V2:
- string.printf("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)_mm_extract_epi16(m_xv[ 2], 7), (UINT16)_mm_extract_epi16(m_xv[ 2], 6), (UINT16)_mm_extract_epi16(m_xv[ 2], 5), (UINT16)_mm_extract_epi16(m_xv[ 2], 4), (UINT16)_mm_extract_epi16(m_xv[ 2], 3), (UINT16)_mm_extract_epi16(m_xv[ 2], 2), (UINT16)_mm_extract_epi16(m_xv[ 2], 1), (UINT16)_mm_extract_epi16(m_xv[ 2], 0));
- break;
- case RSP_V3:
- string.printf("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)_mm_extract_epi16(m_xv[ 3], 7), (UINT16)_mm_extract_epi16(m_xv[ 3], 6), (UINT16)_mm_extract_epi16(m_xv[ 3], 5), (UINT16)_mm_extract_epi16(m_xv[ 3], 4), (UINT16)_mm_extract_epi16(m_xv[ 3], 3), (UINT16)_mm_extract_epi16(m_xv[ 3], 2), (UINT16)_mm_extract_epi16(m_xv[ 3], 1), (UINT16)_mm_extract_epi16(m_xv[ 3], 0));
- break;
- case RSP_V4:
- string.printf("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)_mm_extract_epi16(m_xv[ 4], 7), (UINT16)_mm_extract_epi16(m_xv[ 4], 6), (UINT16)_mm_extract_epi16(m_xv[ 4], 5), (UINT16)_mm_extract_epi16(m_xv[ 4], 4), (UINT16)_mm_extract_epi16(m_xv[ 4], 3), (UINT16)_mm_extract_epi16(m_xv[ 4], 2), (UINT16)_mm_extract_epi16(m_xv[ 4], 1), (UINT16)_mm_extract_epi16(m_xv[ 4], 0));
- break;
- case RSP_V5:
- string.printf("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)_mm_extract_epi16(m_xv[ 5], 7), (UINT16)_mm_extract_epi16(m_xv[ 5], 6), (UINT16)_mm_extract_epi16(m_xv[ 5], 5), (UINT16)_mm_extract_epi16(m_xv[ 5], 4), (UINT16)_mm_extract_epi16(m_xv[ 5], 3), (UINT16)_mm_extract_epi16(m_xv[ 5], 2), (UINT16)_mm_extract_epi16(m_xv[ 5], 1), (UINT16)_mm_extract_epi16(m_xv[ 5], 0));
- break;
- case RSP_V6:
- string.printf("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)_mm_extract_epi16(m_xv[ 6], 7), (UINT16)_mm_extract_epi16(m_xv[ 6], 6), (UINT16)_mm_extract_epi16(m_xv[ 6], 5), (UINT16)_mm_extract_epi16(m_xv[ 6], 4), (UINT16)_mm_extract_epi16(m_xv[ 6], 3), (UINT16)_mm_extract_epi16(m_xv[ 6], 2), (UINT16)_mm_extract_epi16(m_xv[ 6], 1), (UINT16)_mm_extract_epi16(m_xv[ 6], 0));
- break;
- case RSP_V7:
- string.printf("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)_mm_extract_epi16(m_xv[ 7], 7), (UINT16)_mm_extract_epi16(m_xv[ 7], 6), (UINT16)_mm_extract_epi16(m_xv[ 7], 5), (UINT16)_mm_extract_epi16(m_xv[ 7], 4), (UINT16)_mm_extract_epi16(m_xv[ 7], 3), (UINT16)_mm_extract_epi16(m_xv[ 7], 2), (UINT16)_mm_extract_epi16(m_xv[ 7], 1), (UINT16)_mm_extract_epi16(m_xv[ 7], 0));
- break;
- case RSP_V8:
- string.printf("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)_mm_extract_epi16(m_xv[ 8], 7), (UINT16)_mm_extract_epi16(m_xv[ 8], 6), (UINT16)_mm_extract_epi16(m_xv[ 8], 5), (UINT16)_mm_extract_epi16(m_xv[ 8], 4), (UINT16)_mm_extract_epi16(m_xv[ 8], 3), (UINT16)_mm_extract_epi16(m_xv[ 8], 2), (UINT16)_mm_extract_epi16(m_xv[ 8], 1), (UINT16)_mm_extract_epi16(m_xv[ 8], 0));
- break;
- case RSP_V9:
- string.printf("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)_mm_extract_epi16(m_xv[ 9], 7), (UINT16)_mm_extract_epi16(m_xv[ 9], 6), (UINT16)_mm_extract_epi16(m_xv[ 9], 5), (UINT16)_mm_extract_epi16(m_xv[ 9], 4), (UINT16)_mm_extract_epi16(m_xv[ 9], 3), (UINT16)_mm_extract_epi16(m_xv[ 9], 2), (UINT16)_mm_extract_epi16(m_xv[ 9], 1), (UINT16)_mm_extract_epi16(m_xv[ 9], 0));
- break;
- case RSP_V10:
- string.printf("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)_mm_extract_epi16(m_xv[10], 7), (UINT16)_mm_extract_epi16(m_xv[10], 6), (UINT16)_mm_extract_epi16(m_xv[10], 5), (UINT16)_mm_extract_epi16(m_xv[10], 4), (UINT16)_mm_extract_epi16(m_xv[10], 3), (UINT16)_mm_extract_epi16(m_xv[10], 2), (UINT16)_mm_extract_epi16(m_xv[10], 1), (UINT16)_mm_extract_epi16(m_xv[10], 0));
- break;
- case RSP_V11:
- string.printf("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)_mm_extract_epi16(m_xv[11], 7), (UINT16)_mm_extract_epi16(m_xv[11], 6), (UINT16)_mm_extract_epi16(m_xv[11], 5), (UINT16)_mm_extract_epi16(m_xv[11], 4), (UINT16)_mm_extract_epi16(m_xv[11], 3), (UINT16)_mm_extract_epi16(m_xv[11], 2), (UINT16)_mm_extract_epi16(m_xv[11], 1), (UINT16)_mm_extract_epi16(m_xv[11], 0));
- break;
- case RSP_V12:
- string.printf("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)_mm_extract_epi16(m_xv[12], 7), (UINT16)_mm_extract_epi16(m_xv[12], 6), (UINT16)_mm_extract_epi16(m_xv[12], 5), (UINT16)_mm_extract_epi16(m_xv[12], 4), (UINT16)_mm_extract_epi16(m_xv[12], 3), (UINT16)_mm_extract_epi16(m_xv[12], 2), (UINT16)_mm_extract_epi16(m_xv[12], 1), (UINT16)_mm_extract_epi16(m_xv[12], 0));
- break;
- case RSP_V13:
- string.printf("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)_mm_extract_epi16(m_xv[13], 7), (UINT16)_mm_extract_epi16(m_xv[13], 6), (UINT16)_mm_extract_epi16(m_xv[13], 5), (UINT16)_mm_extract_epi16(m_xv[13], 4), (UINT16)_mm_extract_epi16(m_xv[13], 3), (UINT16)_mm_extract_epi16(m_xv[13], 2), (UINT16)_mm_extract_epi16(m_xv[13], 1), (UINT16)_mm_extract_epi16(m_xv[13], 0));
- break;
- case RSP_V14:
- string.printf("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)_mm_extract_epi16(m_xv[14], 7), (UINT16)_mm_extract_epi16(m_xv[14], 6), (UINT16)_mm_extract_epi16(m_xv[14], 5), (UINT16)_mm_extract_epi16(m_xv[14], 4), (UINT16)_mm_extract_epi16(m_xv[14], 3), (UINT16)_mm_extract_epi16(m_xv[14], 2), (UINT16)_mm_extract_epi16(m_xv[14], 1), (UINT16)_mm_extract_epi16(m_xv[14], 0));
- break;
- case RSP_V15:
- string.printf("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)_mm_extract_epi16(m_xv[15], 7), (UINT16)_mm_extract_epi16(m_xv[15], 6), (UINT16)_mm_extract_epi16(m_xv[15], 5), (UINT16)_mm_extract_epi16(m_xv[15], 4), (UINT16)_mm_extract_epi16(m_xv[15], 3), (UINT16)_mm_extract_epi16(m_xv[15], 2), (UINT16)_mm_extract_epi16(m_xv[15], 1), (UINT16)_mm_extract_epi16(m_xv[15], 0));
- break;
- case RSP_V16:
- string.printf("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)_mm_extract_epi16(m_xv[16], 7), (UINT16)_mm_extract_epi16(m_xv[16], 6), (UINT16)_mm_extract_epi16(m_xv[16], 5), (UINT16)_mm_extract_epi16(m_xv[16], 4), (UINT16)_mm_extract_epi16(m_xv[16], 3), (UINT16)_mm_extract_epi16(m_xv[16], 2), (UINT16)_mm_extract_epi16(m_xv[16], 1), (UINT16)_mm_extract_epi16(m_xv[16], 0));
- break;
- case RSP_V17:
- string.printf("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)_mm_extract_epi16(m_xv[17], 7), (UINT16)_mm_extract_epi16(m_xv[17], 6), (UINT16)_mm_extract_epi16(m_xv[17], 5), (UINT16)_mm_extract_epi16(m_xv[17], 4), (UINT16)_mm_extract_epi16(m_xv[17], 3), (UINT16)_mm_extract_epi16(m_xv[17], 2), (UINT16)_mm_extract_epi16(m_xv[17], 1), (UINT16)_mm_extract_epi16(m_xv[17], 0));
- break;
- case RSP_V18:
- string.printf("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)_mm_extract_epi16(m_xv[18], 7), (UINT16)_mm_extract_epi16(m_xv[18], 6), (UINT16)_mm_extract_epi16(m_xv[18], 5), (UINT16)_mm_extract_epi16(m_xv[18], 4), (UINT16)_mm_extract_epi16(m_xv[18], 3), (UINT16)_mm_extract_epi16(m_xv[18], 2), (UINT16)_mm_extract_epi16(m_xv[18], 1), (UINT16)_mm_extract_epi16(m_xv[18], 0));
- break;
- case RSP_V19:
- string.printf("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)_mm_extract_epi16(m_xv[19], 7), (UINT16)_mm_extract_epi16(m_xv[19], 6), (UINT16)_mm_extract_epi16(m_xv[19], 5), (UINT16)_mm_extract_epi16(m_xv[19], 4), (UINT16)_mm_extract_epi16(m_xv[19], 3), (UINT16)_mm_extract_epi16(m_xv[19], 2), (UINT16)_mm_extract_epi16(m_xv[19], 1), (UINT16)_mm_extract_epi16(m_xv[19], 0));
- break;
- case RSP_V20:
- string.printf("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)_mm_extract_epi16(m_xv[20], 7), (UINT16)_mm_extract_epi16(m_xv[20], 6), (UINT16)_mm_extract_epi16(m_xv[20], 5), (UINT16)_mm_extract_epi16(m_xv[20], 4), (UINT16)_mm_extract_epi16(m_xv[20], 3), (UINT16)_mm_extract_epi16(m_xv[20], 2), (UINT16)_mm_extract_epi16(m_xv[20], 1), (UINT16)_mm_extract_epi16(m_xv[20], 0));
- break;
- case RSP_V21:
- string.printf("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)_mm_extract_epi16(m_xv[21], 7), (UINT16)_mm_extract_epi16(m_xv[21], 6), (UINT16)_mm_extract_epi16(m_xv[21], 5), (UINT16)_mm_extract_epi16(m_xv[21], 4), (UINT16)_mm_extract_epi16(m_xv[21], 3), (UINT16)_mm_extract_epi16(m_xv[21], 2), (UINT16)_mm_extract_epi16(m_xv[21], 1), (UINT16)_mm_extract_epi16(m_xv[21], 0));
- break;
- case RSP_V22:
- string.printf("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)_mm_extract_epi16(m_xv[22], 7), (UINT16)_mm_extract_epi16(m_xv[22], 6), (UINT16)_mm_extract_epi16(m_xv[22], 5), (UINT16)_mm_extract_epi16(m_xv[22], 4), (UINT16)_mm_extract_epi16(m_xv[22], 3), (UINT16)_mm_extract_epi16(m_xv[22], 2), (UINT16)_mm_extract_epi16(m_xv[22], 1), (UINT16)_mm_extract_epi16(m_xv[22], 0));
- break;
- case RSP_V23:
- string.printf("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)_mm_extract_epi16(m_xv[23], 7), (UINT16)_mm_extract_epi16(m_xv[23], 6), (UINT16)_mm_extract_epi16(m_xv[23], 5), (UINT16)_mm_extract_epi16(m_xv[23], 4), (UINT16)_mm_extract_epi16(m_xv[23], 3), (UINT16)_mm_extract_epi16(m_xv[23], 2), (UINT16)_mm_extract_epi16(m_xv[23], 1), (UINT16)_mm_extract_epi16(m_xv[23], 0));
- break;
- case RSP_V24:
- string.printf("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)_mm_extract_epi16(m_xv[24], 7), (UINT16)_mm_extract_epi16(m_xv[24], 6), (UINT16)_mm_extract_epi16(m_xv[24], 5), (UINT16)_mm_extract_epi16(m_xv[24], 4), (UINT16)_mm_extract_epi16(m_xv[24], 3), (UINT16)_mm_extract_epi16(m_xv[24], 2), (UINT16)_mm_extract_epi16(m_xv[24], 1), (UINT16)_mm_extract_epi16(m_xv[24], 0));
- break;
- case RSP_V25:
- string.printf("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)_mm_extract_epi16(m_xv[25], 7), (UINT16)_mm_extract_epi16(m_xv[25], 6), (UINT16)_mm_extract_epi16(m_xv[25], 5), (UINT16)_mm_extract_epi16(m_xv[25], 4), (UINT16)_mm_extract_epi16(m_xv[25], 3), (UINT16)_mm_extract_epi16(m_xv[25], 2), (UINT16)_mm_extract_epi16(m_xv[25], 1), (UINT16)_mm_extract_epi16(m_xv[25], 0));
- break;
- case RSP_V26:
- string.printf("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)_mm_extract_epi16(m_xv[26], 7), (UINT16)_mm_extract_epi16(m_xv[26], 6), (UINT16)_mm_extract_epi16(m_xv[26], 5), (UINT16)_mm_extract_epi16(m_xv[26], 4), (UINT16)_mm_extract_epi16(m_xv[26], 3), (UINT16)_mm_extract_epi16(m_xv[26], 2), (UINT16)_mm_extract_epi16(m_xv[26], 1), (UINT16)_mm_extract_epi16(m_xv[26], 0));
- break;
- case RSP_V27:
- string.printf("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)_mm_extract_epi16(m_xv[27], 7), (UINT16)_mm_extract_epi16(m_xv[27], 6), (UINT16)_mm_extract_epi16(m_xv[27], 5), (UINT16)_mm_extract_epi16(m_xv[27], 4), (UINT16)_mm_extract_epi16(m_xv[27], 3), (UINT16)_mm_extract_epi16(m_xv[27], 2), (UINT16)_mm_extract_epi16(m_xv[27], 1), (UINT16)_mm_extract_epi16(m_xv[27], 0));
- break;
- case RSP_V28:
- string.printf("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)_mm_extract_epi16(m_xv[28], 7), (UINT16)_mm_extract_epi16(m_xv[28], 6), (UINT16)_mm_extract_epi16(m_xv[28], 5), (UINT16)_mm_extract_epi16(m_xv[28], 4), (UINT16)_mm_extract_epi16(m_xv[28], 3), (UINT16)_mm_extract_epi16(m_xv[28], 2), (UINT16)_mm_extract_epi16(m_xv[28], 1), (UINT16)_mm_extract_epi16(m_xv[28], 0));
- break;
- case RSP_V29:
- string.printf("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)_mm_extract_epi16(m_xv[29], 7), (UINT16)_mm_extract_epi16(m_xv[29], 6), (UINT16)_mm_extract_epi16(m_xv[29], 5), (UINT16)_mm_extract_epi16(m_xv[29], 4), (UINT16)_mm_extract_epi16(m_xv[29], 3), (UINT16)_mm_extract_epi16(m_xv[29], 2), (UINT16)_mm_extract_epi16(m_xv[29], 1), (UINT16)_mm_extract_epi16(m_xv[29], 0));
- break;
- case RSP_V30:
- string.printf("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)_mm_extract_epi16(m_xv[30], 7), (UINT16)_mm_extract_epi16(m_xv[30], 6), (UINT16)_mm_extract_epi16(m_xv[30], 5), (UINT16)_mm_extract_epi16(m_xv[30], 4), (UINT16)_mm_extract_epi16(m_xv[30], 3), (UINT16)_mm_extract_epi16(m_xv[30], 2), (UINT16)_mm_extract_epi16(m_xv[30], 1), (UINT16)_mm_extract_epi16(m_xv[30], 0));
- break;
- case RSP_V31:
- string.printf("%04X|%04X|%04X|%04X|%04X|%04X|%04X|%04X", (UINT16)_mm_extract_epi16(m_xv[31], 7), (UINT16)_mm_extract_epi16(m_xv[31], 6), (UINT16)_mm_extract_epi16(m_xv[31], 5), (UINT16)_mm_extract_epi16(m_xv[31], 4), (UINT16)_mm_extract_epi16(m_xv[31], 3), (UINT16)_mm_extract_epi16(m_xv[31], 2), (UINT16)_mm_extract_epi16(m_xv[31], 1), (UINT16)_mm_extract_epi16(m_xv[31], 0));
- break;
- }
-}
-
-/***************************************************************************
- Vector Load Instructions
-***************************************************************************/
-
-// LBV
-//
-// 31 25 20 15 10 6 0
-// --------------------------------------------------
-// | 110010 | BBBBB | TTTTT | 00000 | IIII | Offset |
-// --------------------------------------------------
-//
-// Load 1 byte to vector byte index
-
-inline void rsp_cop2_simd::lbv()
-{
- UINT32 op = m_op;
-
- UINT32 ea = 0;
- int dest = (op >> 16) & 0x1f;
- int base = (op >> 21) & 0x1f;
- int index = (op >> 7) & 0xf;
- int offset = (op & 0x7f);
- if (offset & 0x40)
- {
- offset |= 0xffffffc0;
- }
-
- ea = (base) ? m_rsp.m_rsp_state->r[base] + offset : offset;
-
- UINT16 element;
- EXTRACT16(m_xv[dest], element, (index >> 1));
- element &= 0xff00 >> ((1-(index & 1)) * 8);
- element |= m_rsp.DM_READ8(ea) << ((1-(index & 1)) * 8);
- INSERT16(m_xv[dest], element, (index >> 1));
-}
-
-static void cfunc_lbv(void *param)
-{
- ((rsp_cop2 *)param)->lbv();
-}
-
-
-// LSV
-//
-// 31 25 20 15 10 6 0
-// --------------------------------------------------
-// | 110010 | BBBBB | TTTTT | 00001 | IIII | Offset |
-// --------------------------------------------------
-//
-// Loads 2 bytes starting from vector byte index
-
-inline void rsp_cop2_simd::lsv()
-{
- UINT32 op = m_op;
- int dest = (op >> 16) & 0x1f;
- int base = (op >> 21) & 0x1f;
- int index = (op >> 7) & 0xe;
- int offset = (op & 0x7f);
- if (offset & 0x40)
- {
- offset |= 0xffffffc0;
- }
-
- UINT32 ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 2) : (offset * 2);
- int end = index + 2;
- for (int i = index; i < end; i++)
- {
- UINT16 element;
- EXTRACT16(m_xv[dest], element, (i >> 1));
- element &= 0xff00 >> ((1 - (i & 1)) * 8);
- element |= m_rsp.DM_READ8(ea) << ((1 - (i & 1)) * 8);
- INSERT16(m_xv[dest], element, (i >> 1));
- ea++;
- }
-}
-
-static void cfunc_lsv(void *param)
-{
- ((rsp_cop2 *)param)->lsv();
-}
-
-
-// LLV
-//
-// 31 25 20 15 10 6 0
-// --------------------------------------------------
-// | 110010 | BBBBB | TTTTT | 00010 | IIII | Offset |
-// --------------------------------------------------
-//
-// Loads 4 bytes starting from vector byte index
-
-inline void rsp_cop2_simd::llv()
-{
- UINT32 op = m_op;
- UINT32 ea = 0;
- int dest = (op >> 16) & 0x1f;
- int base = (op >> 21) & 0x1f;
- int index = (op >> 7) & 0xc;
- int offset = (op & 0x7f);
- if (offset & 0x40)
- {
- offset |= 0xffffffc0;
- }
-
- ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 4) : (offset * 4);
-
- int end = index + 4;
-
- for (int i = index; i < end; i++)
- {
- UINT16 element;
- EXTRACT16(m_xv[dest], element, (i >> 1));
- element &= 0xff00 >> ((1 - (i & 1)) * 8);
- element |= m_rsp.DM_READ8(ea) << ((1 - (i & 1)) * 8);
- INSERT16(m_xv[dest], element, (i >> 1));
- ea++;
- }
-}
-
-static void cfunc_llv(void *param)
-{
- ((rsp_cop2 *)param)->llv();
-}
-#endif
-
-
-// LDV
-//
-// 31 25 20 15 10 6 0
-// --------------------------------------------------
-// | 110010 | BBBBB | TTTTT | 00011 | IIII | Offset |
-// --------------------------------------------------
-//
-// Loads 8 bytes starting from vector byte index
-
-inline void rsp_cop2_simd::ldv()
-{
- UINT32 op = m_op;
- UINT32 ea = 0;
- int dest = (op >> 16) & 0x1f;
- int base = (op >> 21) & 0x1f;
- int index = (op >> 7) & 0x8;
- int offset = (op & 0x7f);
- if (offset & 0x40)
- {
- offset |= 0xffffffc0;
- }
-
- ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 8) : (offset * 8);
-
- int end = index + 8;
-
- for (int i = index; i < end; i++)
- {
- UINT16 element;
- EXTRACT16(m_xv[dest], element, (i >> 1));
- element &= 0xff00 >> ((1 - (i & 1)) * 8);
- element |= m_rsp.DM_READ8(ea) << ((1 - (i & 1)) * 8);
- INSERT16(m_xv[dest], element, (i >> 1));
- ea++;
- }
-}
-
-static void cfunc_ldv(void *param)
-{
- ((rsp_cop2 *)param)->ldv();
-}
-#endif
-
-
-// LQV
-//
-// 31 25 20 15 10 6 0
-// --------------------------------------------------
-// | 110010 | BBBBB | TTTTT | 00100 | IIII | Offset |
-// --------------------------------------------------
-//
-// Loads up to 16 bytes starting from vector byte index
-
-inline void rsp_cop2_simd::lqv()
-{
- UINT32 op = m_op;
- int dest = (op >> 16) & 0x1f;
- int base = (op >> 21) & 0x1f;
- int offset = (op & 0x7f);
- if (offset & 0x40)
- {
- offset |= 0xffffffc0;
- }
-
- UINT32 ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 16) : (offset * 16);
-
- int end = 16 - (ea & 0xf);
- if (end > 16) end = 16;
-
- for (int i = 0; i < end; i++)
- {
- UINT16 element;
- EXTRACT16(m_xv[dest], element, (i >> 1));
- element &= 0xff00 >> ((1 - (i & 1)) * 8);
- element |= m_rsp.DM_READ8(ea) << ((1 - (i & 1)) * 8);
- INSERT16(m_xv[dest], element, (i >> 1));
- ea++;
- }
-}
-
-static void cfunc_lqv(void *param)
-{
- ((rsp_cop2 *)param)->lqv();
-}
-
-
-// LRV
-//
-// 31 25 20 15 10 6 0
-// --------------------------------------------------
-// | 110010 | BBBBB | TTTTT | 00101 | IIII | Offset |
-// --------------------------------------------------
-//
-// Stores up to 16 bytes starting from right side until 16-byte boundary
-
-inline void rsp_cop2_simd::lrv()
-{
- UINT32 op = m_op;
- int dest = (op >> 16) & 0x1f;
- int base = (op >> 21) & 0x1f;
- int index = (op >> 7) & 0xf;
- int offset = (op & 0x7f);
- if (offset & 0x40)
- {
- offset |= 0xffffffc0;
- }
-
- UINT32 ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 16) : (offset * 16);
-
- index = 16 - ((ea & 0xf) - index);
- ea &= ~0xf;
-
- for (int i = index; i < 16; i++)
- {
- UINT16 element;
- EXTRACT16(m_xv[dest], element, (i >> 1));
- element &= 0xff00 >> ((1-(i & 1)) * 8);
- element |= m_rsp.DM_READ8(ea) << ((1-(i & 1)) * 8);
- INSERT16(m_xv[dest], element, (i >> 1));
- ea++;
- }
-}
-
-static void cfunc_lrv(void *param)
-{
- ((rsp_cop2 *)param)->lrv();
-}
-
-
-// LPV
-//
-// 31 25 20 15 10 6 0
-// --------------------------------------------------
-// | 110010 | BBBBB | TTTTT | 00110 | IIII | Offset |
-// --------------------------------------------------
-//
-// Loads a byte as the upper 8 bits of each element
-
-inline void rsp_cop2_simd::lpv()
-{
- UINT32 op = m_op;
- int dest = (op >> 16) & 0x1f;
- int base = (op >> 21) & 0x1f;
- int index = (op >> 7) & 0xf;
- int offset = (op & 0x7f);
- if (offset & 0x40)
- {
- offset |= 0xffffffc0;
- }
-
- UINT32 ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 8) : (offset * 8);
-
- for (int i = 0; i < 8; i++)
- {
- INSERT16(m_xv[dest], m_rsp.DM_READ8(ea + (((16-index) + i) & 0xf)) << 8, i);
- }
-}
-
-static void cfunc_lpv(void *param)
-{
- ((rsp_cop2 *)param)->lpv();
-}
-
-
-// LUV
-//
-// 31 25 20 15 10 6 0
-// --------------------------------------------------
-// | 110010 | BBBBB | TTTTT | 00111 | IIII | Offset |
-// --------------------------------------------------
-//
-// Loads a byte as the bits 14-7 of each element
-
-inline void rsp_cop2_simd::luv()
-{
- UINT32 op = m_op;
- int dest = (op >> 16) & 0x1f;
- int base = (op >> 21) & 0x1f;
- int index = (op >> 7) & 0xf;
- int offset = (op & 0x7f);
- if (offset & 0x40)
- {
- offset |= 0xffffffc0;
- }
-
- UINT32 ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 8) : (offset * 8);
-
- for (int i = 0; i < 8; i++)
- {
- INSERT16(m_xv[dest], m_rsp.DM_READ8(ea + (((16-index) + i) & 0xf)) << 7, i);
- }
-}
-
-static void cfunc_luv(void *param)
-{
- ((rsp_cop2 *)param)->luv();
-}
-
-
-// LHV
-//
-// 31 25 20 15 10 6 0
-// --------------------------------------------------
-// | 110010 | BBBBB | TTTTT | 01000 | IIII | Offset |
-// --------------------------------------------------
-//
-// Loads a byte as the bits 14-7 of each element, with 2-byte stride
-
-inline void rsp_cop2_simd::lhv()
-{
- UINT32 op = m_op;
- int dest = (op >> 16) & 0x1f;
- int base = (op >> 21) & 0x1f;
- int index = (op >> 7) & 0xf;
- int offset = (op & 0x7f);
- if (offset & 0x40)
- {
- offset |= 0xffffffc0;
- }
-
- UINT32 ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 16) : (offset * 16);
-
- for (int i = 0; i < 8; i++)
- {
- INSERT16(m_xv[dest], m_rsp.DM_READ8(ea + (((16-index) + (i<<1)) & 0xf)) << 7, i);
- }
-}
-
-static void cfunc_lhv(void *param)
-{
- ((rsp_cop2 *)param)->lhv();
-}
-
-
-// LFV
-// 31 25 20 15 10 6 0
-// --------------------------------------------------
-// | 110010 | BBBBB | TTTTT | 01001 | IIII | Offset |
-// --------------------------------------------------
-//
-// Loads a byte as the bits 14-7 of upper or lower quad, with 4-byte stride
-
-inline void rsp_cop2_simd::lfv()
-{
- UINT32 op = m_op;
- int dest = (op >> 16) & 0x1f;
- int base = (op >> 21) & 0x1f;
- int index = (op >> 7) & 0xf;
- int offset = (op & 0x7f);
- if (offset & 0x40)
- {
- offset |= 0xffffffc0;
- }
-
- UINT32 ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 16) : (offset * 16);
-
- // not sure what happens if 16-byte boundary is crossed...
-
- int end = (index >> 1) + 4;
-
- for (int i = index >> 1; i < end; i++)
- {
- INSERT16(m_xv[dest], m_rsp.DM_READ8(ea) << 7, i);
- ea += 4;
- }
-}
-
-static void cfunc_lfv(void *param)
-{
- ((rsp_cop2 *)param)->lfv();
-}
-
-
-// LWV
-//
-// 31 25 20 15 10 6 0
-// --------------------------------------------------
-// | 110010 | BBBBB | TTTTT | 01010 | IIII | Offset |
-// --------------------------------------------------
-//
-// Loads the full 128-bit vector starting from vector byte index and wrapping to index 0
-// after byte index 15
-
-inline void rsp_cop2_simd::lwv()
-{
- UINT32 op = m_op;
- int dest = (op >> 16) & 0x1f;
- int base = (op >> 21) & 0x1f;
- int index = (op >> 7) & 0xf;
- int offset = (op & 0x7f);
- if (offset & 0x40)
- {
- offset |= 0xffffffc0;
- }
-
- UINT32 ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 16) : (offset * 16);
- int end = (16 - index) + 16;
-
- UINT8 val[16];
- for (int i = (16 - index); i < end; i++)
- {
- val[i & 0xf] = m_rsp.DM_READ8(ea);
- ea += 4;
- }
-
- m_xv[dest] = _mm_set_epi8(val[15], val[14], val[13], val[12], val[11], val[10], val[ 9], val[ 8],
- val[ 7], val[ 6], val[ 5], val[ 4], val[ 3], val[ 2], val[ 1], val[ 0]);
-}
-
-static void cfunc_lwv(void *param)
-{
- ((rsp_cop2 *)param)->lwv();
-}
-
-
-// LTV
-//
-// 31 25 20 15 10 6 0
-// --------------------------------------------------
-// | 110010 | BBBBB | TTTTT | 01011 | IIII | Offset |
-// --------------------------------------------------
-//
-// Loads one element to maximum of 8 vectors, while incrementing element index
-
-inline void rsp_cop2_simd::ltv()
-{
- UINT32 op = m_op;
- int dest = (op >> 16) & 0x1f;
- int base = (op >> 21) & 0x1f;
- int index = (op >> 7) & 0xf;
- int offset = (op & 0x7f);
-
- // FIXME: has a small problem with odd indices
-
- int vs = dest;
- int ve = dest + 8;
- if (ve > 32)
- {
- ve = 32;
- }
-
- int element = 7 - (index >> 1);
-
- UINT32 ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 16) : (offset * 16);
-
- ea = ((ea + 8) & ~0xf) + (index & 1);
- for (int i = vs; i < ve; i++)
- {
- element = (8 - (index >> 1) + (i - vs)) << 1;
- UINT16 value = (m_rsp.DM_READ8(ea) << 8) | m_rsp.DM_READ8(ea + 1);
- INSERT16(m_xv[i], value, (element >> 1));
- ea += 2;
- }
-}
-
-static void cfunc_ltv(void *param)
-{
- ((rsp_cop2 *)param)->ltv();
-}
-
-
-/***************************************************************************
- Vector Store Instructions
-***************************************************************************/
-
-// SBV
-//
-// 31 25 20 15 10 6 0
-// --------------------------------------------------
-// | 111010 | BBBBB | TTTTT | 00000 | IIII | Offset |
-// --------------------------------------------------
-//
-// Stores 1 byte from vector byte index
-
-inline void rsp_cop2_simd::sbv()
-{
- UINT32 op = m_op;
- int dest = (op >> 16) & 0x1f;
- int base = (op >> 21) & 0x1f;
- int index = (op >> 7) & 0xf;
- int offset = (op & 0x7f);
- if (offset & 0x40)
- {
- offset |= 0xffffffc0;
- }
-
- UINT32 ea = (base) ? m_rsp.m_rsp_state->r[base] + offset : offset;
- UINT16 value;
- EXTRACT16(m_xv[dest], value, (index >> 1));
- value >>= (1-(index & 1)) * 8;
- m_rsp.DM_WRITE8(ea, (UINT8)value);
-}
-
-static void cfunc_sbv(void *param)
-{
- ((rsp_cop2 *)param)->sbv();
-}
-
-
-// SSV
-//
-// 31 25 20 15 10 6 0
-// --------------------------------------------------
-// | 111010 | BBBBB | TTTTT | 00001 | IIII | Offset |
-// --------------------------------------------------
-//
-// Stores 2 bytes starting from vector byte index
-
-inline void rsp_cop2_simd::ssv()
-{
- UINT32 op = m_op;
- int dest = (op >> 16) & 0x1f;
- int base = (op >> 21) & 0x1f;
- int index = (op >> 7) & 0xf;
- int offset = (op & 0x7f);
- if (offset & 0x40)
- {
- offset |= 0xffffffc0;
- }
-
- UINT32 ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 2) : (offset * 2);
-
- int end = index + 2;
- for (int i = index; i < end; i++)
- {
- UINT16 value;
- EXTRACT16(m_xv[dest], value, (i >> 1));
- value >>= (1 - (i & 1)) * 8;
- m_rsp.DM_WRITE8(ea, (UINT8)value);
- ea++;
- }
-}
-
-static void cfunc_ssv(void *param)
-{
- ((rsp_cop2 *)param)->ssv();
-}
-
-
-// SLV
-//
-// 31 25 20 15 10 6 0
-// --------------------------------------------------
-// | 111010 | BBBBB | TTTTT | 00010 | IIII | Offset |
-// --------------------------------------------------
-//
-// Stores 4 bytes starting from vector byte index
-
-inline void rsp_cop2_simd::slv()
-{
- UINT32 op = m_op;
- int dest = (op >> 16) & 0x1f;
- int base = (op >> 21) & 0x1f;
- int index = (op >> 7) & 0xf;
- int offset = (op & 0x7f);
- if (offset & 0x40)
- {
- offset |= 0xffffffc0;
- }
-
- UINT32 ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 4) : (offset * 4);
-
- int end = index + 4;
- for (int i = index; i < end; i++)
- {
- UINT16 value;
- EXTRACT16(m_xv[dest], value, (i >> 1));
- value >>= (1 - (i & 1)) * 8;
- m_rsp.DM_WRITE8(ea, (UINT8)value);
- ea++;
- }
-}
-
-static void cfunc_slv(void *param)
-{
- ((rsp_cop2 *)param)->slv();
-}
-
-
-// SDV
-//
-// 31 25 20 15 10 6 0
-// --------------------------------------------------
-// | 111010 | BBBBB | TTTTT | 00011 | IIII | Offset |
-// --------------------------------------------------
-//
-// Stores 8 bytes starting from vector byte index
-
-inline void rsp_cop2_simd::sdv()
-{
- UINT32 op = m_op;
- int dest = (op >> 16) & 0x1f;
- int base = (op >> 21) & 0x1f;
- int index = (op >> 7) & 0x8;
- int offset = (op & 0x7f);
- if (offset & 0x40)
- {
- offset |= 0xffffffc0;
- }
- UINT32 ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 8) : (offset * 8);
-
- int end = index + 8;
- for (int i = index; i < end; i++)
- {
- UINT16 value;
- EXTRACT16(m_xv[dest], value, (i >> 1));
- value >>= (1 - (i & 1)) * 8;
- m_rsp.DM_WRITE8(ea, (UINT8)value);
- ea++;
- }
-}
-
-static void cfunc_sdv(void *param)
-{
- ((rsp_cop2 *)param)->sdv();
-}
-
-
-// SQV
-//
-// 31 25 20 15 10 6 0
-// --------------------------------------------------
-// | 111010 | BBBBB | TTTTT | 00100 | IIII | Offset |
-// --------------------------------------------------
-//
-// Stores up to 16 bytes starting from vector byte index until 16-byte boundary
-
-inline void rsp_cop2_simd::sqv()
-{
- UINT32 op = m_op;
- int dest = (op >> 16) & 0x1f;
- int base = (op >> 21) & 0x1f;
- int index = (op >> 7) & 0xf;
- int offset = (op & 0x7f);
- if (offset & 0x40)
- {
- offset |= 0xffffffc0;
- }
-
- UINT32 ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 16) : (offset * 16);
- int end = index + (16 - (ea & 0xf));
- for (int i=index; i < end; i++)
- {
- UINT16 value;
- EXTRACT16(m_xv[dest], value, (i >> 1));
- value >>= (1-(i & 1)) * 8;
- m_rsp.DM_WRITE8(ea, (UINT8)value);
- ea++;
- }
-}
-
-static void cfunc_sqv(void *param)
-{
- ((rsp_cop2 *)param)->sqv();
-}
-
-
-// SRV
-//
-// 31 25 20 15 10 6 0
-// --------------------------------------------------
-// | 111010 | BBBBB | TTTTT | 00101 | IIII | Offset |
-// --------------------------------------------------
-//
-// Stores up to 16 bytes starting from right side until 16-byte boundary
-
-inline void rsp_cop2_simd::srv()
-{
- UINT32 op = m_op;
- int dest = (op >> 16) & 0x1f;
- int base = (op >> 21) & 0x1f;
- int index = (op >> 7) & 0xf;
- int offset = (op & 0x7f);
- if (offset & 0x40)
- {
- offset |= 0xffffffc0;
- }
-
- UINT32 ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 16) : (offset * 16);
-
- int end = index + (ea & 0xf);
- int o = (16 - (ea & 0xf)) & 0xf;
- ea &= ~0xf;
-
- for (int i = index; i < end; i++)
- {
- UINT32 bi = (i + o) & 0xf;
- UINT16 value;
- EXTRACT16(m_xv[dest], value, (bi >> 1));
- value >>= (1-(bi & 1)) * 8;
- m_rsp.DM_WRITE8(ea, (UINT8)value);
- ea++;
- }
-}
-
-static void cfunc_srv(void *param)
-{
- ((rsp_cop2 *)param)->srv();
-}
-
-
-// SPV
-//
-// 31 25 20 15 10 6 0
-// --------------------------------------------------
-// | 111010 | BBBBB | TTTTT | 00110 | IIII | Offset |
-// --------------------------------------------------
-//
-// Stores upper 8 bits of each element
-
-inline void rsp_cop2_simd::spv()
-{
- UINT32 op = m_op;
- int dest = (op >> 16) & 0x1f;
- int base = (op >> 21) & 0x1f;
- int index = (op >> 7) & 0xf;
- int offset = (op & 0x7f);
- if (offset & 0x40)
- {
- offset |= 0xffffffc0;
- }
-
- UINT32 ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 8) : (offset * 8);
- int end = index + 8;
- for (int i=index; i < end; i++)
- {
- if ((i & 0xf) < 8)
- {
- UINT16 value;
- EXTRACT16(m_xv[dest], value, i);
- m_rsp.DM_WRITE8(ea, (UINT8)(value >> 8));
- }
- else
- {
- UINT16 value;
- EXTRACT16(m_xv[dest], value, i);
- m_rsp.DM_WRITE8(ea, (UINT8)(value >> 7));
- }
- ea++;
- }
-}
-
-static void cfunc_spv(void *param)
-{
- ((rsp_cop2 *)param)->spv();
-}
-
-
-// SUV
-//
-// 31 25 20 15 10 6 0
-// --------------------------------------------------
-// | 111010 | BBBBB | TTTTT | 00111 | IIII | Offset |
-// --------------------------------------------------
-//
-// Stores bits 14-7 of each element
-
-inline void rsp_cop2_simd::suv()
-{
- UINT32 op = m_op;
- int dest = (op >> 16) & 0x1f;
- int base = (op >> 21) & 0x1f;
- int index = (op >> 7) & 0xf;
- int offset = (op & 0x7f);
- if (offset & 0x40)
- {
- offset |= 0xffffffc0;
- }
-
- UINT32 ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 8) : (offset * 8);
- int end = index + 8;
- for (int i=index; i < end; i++)
- {
- if ((i & 0xf) < 8)
- {
- UINT16 value;
- EXTRACT16(m_xv[dest], value, i);
- m_rsp.DM_WRITE8(ea, (UINT8)(value >> 7));
- }
- else
- {
- UINT16 value;
- EXTRACT16(m_xv[dest], value, i);
- m_rsp.DM_WRITE8(ea, (UINT8)(value >> 8));
- }
- ea++;
- }
-}
-
-static void cfunc_suv(void *param)
-{
- ((rsp_cop2 *)param)->suv();
-}
-
-
-// SHV
-//
-// 31 25 20 15 10 6 0
-// --------------------------------------------------
-// | 111010 | BBBBB | TTTTT | 01000 | IIII | Offset |
-// --------------------------------------------------
-//
-// Stores bits 14-7 of each element, with 2-byte stride
-
-inline void rsp_cop2_simd::shv()
-{
- UINT32 op = m_op;
- int dest = (op >> 16) & 0x1f;
- int base = (op >> 21) & 0x1f;
- int index = (op >> 7) & 0xf;
- int offset = (op & 0x7f);
- if (offset & 0x40)
- {
- offset |= 0xffffffc0;
- }
-
- UINT32 ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 16) : (offset * 16);
- for (int i=0; i < 8; i++)
- {
- int element = index + (i << 1);
- UINT16 value;
- EXTRACT16(m_xv[dest], value, element >> 1);
- m_rsp.DM_WRITE8(ea, (value >> 7) & 0x00ff);
- ea += 2;
- }
-}
-
-static void cfunc_shv(void *param)
-{
- ((rsp_cop2 *)param)->shv();
-}
-
-
-// SFV
-//
-// 31 25 20 15 10 6 0
-// --------------------------------------------------
-// | 111010 | BBBBB | TTTTT | 01001 | IIII | Offset |
-// --------------------------------------------------
-//
-// Stores bits 14-7 of upper or lower quad, with 4-byte stride
-
-inline void rsp_cop2_simd::sfv()
-{
- UINT32 op = m_op;
- int dest = (op >> 16) & 0x1f;
- int base = (op >> 21) & 0x1f;
- int index = (op >> 7) & 0xf;
- int offset = (op & 0x7f);
- if (offset & 0x40)
- {
- offset |= 0xffffffc0;
- }
-
- UINT32 ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 16) : (offset * 16);
- int eaoffset = ea & 0xf;
- ea &= ~0xf;
-
- int end = (index >> 1) + 4;
-
- for (int i = index>>1; i < end; i++)
- {
- UINT16 value;
- EXTRACT16(m_xv[dest], value, i);
- m_rsp.DM_WRITE8(ea + (eaoffset & 0xf), (value >> 7) & 0x00ff);
- eaoffset += 4;
- }
-}
-
-static void cfunc_sfv(void *param)
-{
- ((rsp_cop2 *)param)->sfv();
-}
-
-
-// SWV
-//
-// 31 25 20 15 10 6 0
-// --------------------------------------------------
-// | 111010 | BBBBB | TTTTT | 01010 | IIII | Offset |
-// --------------------------------------------------
-//
-// Stores the full 128-bit vector starting from vector byte index and wrapping to index 0
-// after byte index 15
-
-inline void rsp_cop2_simd::swv()
-{
- UINT32 op = m_op;
- int dest = (op >> 16) & 0x1f;
- int base = (op >> 21) & 0x1f;
- int index = (op >> 7) & 0xf;
- int offset = (op & 0x7f);
- if (offset & 0x40)
- {
- offset |= 0xffffffc0;
- }
-
- UINT32 ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 16) : (offset * 16);
- int eaoffset = ea & 0xf;
- ea &= ~0xf;
-
- int end = index + 16;
- for (int i = index; i < end; i++)
- {
- UINT16 value;
- EXTRACT16(m_xv[dest], value, i >> 1);
- m_rsp.DM_WRITE8(ea + (eaoffset & 0xf), (value >> ((1-(i & 1)) * 8)) & 0xff);
- eaoffset++;
- }
-}
-
-static void cfunc_swv(void *param)
-{
- ((rsp_cop2 *)param)->swv();
-}
-
-
-// STV
-//
-// 31 25 20 15 10 6 0
-// --------------------------------------------------
-// | 111010 | BBBBB | TTTTT | 01011 | IIII | Offset |
-// --------------------------------------------------
-//
-// Stores one element from maximum of 8 vectors, while incrementing element index
-
-inline void rsp_cop2_simd::stv()
-{
- UINT32 op = m_op;
- int dest = (op >> 16) & 0x1f;
- int base = (op >> 21) & 0x1f;
- int index = (op >> 7) & 0xf;
- int offset = (op & 0x7f);
-
- if (offset & 0x40)
- {
- offset |= 0xffffffc0;
- }
-
- int vs = dest;
- int ve = dest + 8;
- if (ve > 32)
- {
- ve = 32;
- }
-
- int element = 8 - (index >> 1);
-
- UINT32 ea = (base) ? m_rsp.m_rsp_state->r[base] + (offset * 16) : (offset * 16);
- int eaoffset = (ea & 0xf) + (element * 2);
- ea &= ~0xf;
-
- for (int i = vs; i < ve; i++)
- {
- UINT16 value;
- EXTRACT16(m_xv[i], value, element);
- m_rsp.DM_WRITE16(ea + (eaoffset & 0xf), value);
- eaoffset += 2;
- element++;
- }
-}
-
-static void cfunc_stv(void *param)
-{
- ((rsp_cop2 *)param)->stv();
-}
-
-
-/***************************************************************************
- SIMD Accelerators
-***************************************************************************/
-
-/* ============================================================================
-* RSPPackLo32to16: Pack LSBs of 32-bit vectors to 16-bits without saturation.
-* TODO: 5 SSE2 operations is kind of expensive just to truncate values?
-* ========================================================================= */
-INLINE __m128i RSPPackLo32to16(__m128i vectorLow, __m128i vectorHigh)
-{
- vectorLow = _mm_slli_epi32(vectorLow, 16);
- vectorHigh = _mm_slli_epi32(vectorHigh, 16);
- vectorLow = _mm_srai_epi32(vectorLow, 16);
- vectorHigh = _mm_srai_epi32(vectorHigh, 16);
- return _mm_packs_epi32(vectorLow, vectorHigh);
-}
-
-/* ============================================================================
-* RSPPackHi32to16: Pack MSBs of 32-bit vectors to 16-bits without saturation.
-* ========================================================================= */
-INLINE __m128i RSPPackHi32to16(__m128i vectorLow, __m128i vectorHigh)
-{
- vectorLow = _mm_srai_epi32(vectorLow, 16);
- vectorHigh = _mm_srai_epi32(vectorHigh, 16);
- return _mm_packs_epi32(vectorLow, vectorHigh);
-}
-
-/* ============================================================================
-* RSPSignExtend16to32: Sign-extend 16-bit slices to 32-bit slices.
-* ========================================================================= */
-INLINE void RSPSignExtend16to32(__m128i source, __m128i *vectorLow, __m128i *vectorHigh)
-{
- __m128i vMask = _mm_srai_epi16(source, 15);
- *vectorHigh = _mm_unpackhi_epi16(source, vMask);
- *vectorLow = _mm_unpacklo_epi16(source, vMask);
-}
-
-/* ============================================================================
-* RSPZeroExtend16to32: Zero-extend 16-bit slices to 32-bit slices.
-* ========================================================================= */
-INLINE void RSPZeroExtend16to32(__m128i source, __m128i *vectorLow, __m128i *vectorHigh)
-{
- *vectorHigh = _mm_unpackhi_epi16(source, _mm_setzero_si128());
- *vectorLow = _mm_unpacklo_epi16(source, _mm_setzero_si128());
-}
-
-/* ============================================================================
-* _mm_mullo_epi32: SSE2 lacks _mm_mullo_epi32, define it manually.
-* TODO/WARNING/DISCLAIMER: Assumes one argument is positive.
-* ========================================================================= */
-INLINE __m128i _mm_mullo_epi32(__m128i a, __m128i b)
-{
- __m128i a4 = _mm_srli_si128(a, 4);
- __m128i b4 = _mm_srli_si128(b, 4);
- __m128i ba = _mm_mul_epu32(b, a);
- __m128i b4a4 = _mm_mul_epu32(b4, a4);
-
- __m128i mask = _mm_setr_epi32(~0, 0, ~0, 0);
- __m128i baMask = _mm_and_si128(ba, mask);
- __m128i b4a4Mask = _mm_and_si128(b4a4, mask);
- __m128i b4a4MaskShift = _mm_slli_si128(b4a4Mask, 4);
-
- return _mm_or_si128(baMask, b4a4MaskShift);
-}
-
-/* ============================================================================
-* RSPClampLowToVal: Clamps the low word of the accumulator.
-* ========================================================================= */
-INLINE __m128i RSPClampLowToVal(__m128i vaccLow, __m128i vaccMid, __m128i vaccHigh)
-{
- __m128i setMask = _mm_cmpeq_epi16(_mm_setzero_si128(), _mm_setzero_si128());
- __m128i negCheck, useValMask, negVal, posVal;
-
- /* Compute some common values ahead of time. */
- negCheck = _mm_cmplt_epi16(vaccHigh, _mm_setzero_si128());
-
- /* If accmulator < 0, clamp to val if val != TMin. */
- useValMask = _mm_and_si128(vaccHigh, _mm_srai_epi16(vaccMid, 15));
- useValMask = _mm_cmpeq_epi16(useValMask, setMask);
- negVal = _mm_and_si128(useValMask, vaccLow);
-
- /* Otherwise, clamp to ~0 if any high bits are set. */
- useValMask = _mm_or_si128(vaccHigh, _mm_srai_epi16(vaccMid, 15));
- useValMask = _mm_cmpeq_epi16(useValMask, _mm_setzero_si128());
- posVal = _mm_and_si128(useValMask, vaccLow);
-
- negVal = _mm_and_si128(negCheck, negVal);
- posVal = _mm_andnot_si128(negCheck, posVal);
- return _mm_or_si128(negVal, posVal);
-}
-
-
-/***************************************************************************
- Vector Opcodes
-***************************************************************************/
-
-// VMULF
-//
-// 31 25 24 20 15 10 5 0
-// ------------------------------------------------------
-// | 010010 | 1 | EEEE | SSSSS | TTTTT | DDDDD | 000000 |
-// ------------------------------------------------------
-//
-// Multiplies signed integer by signed integer * 2
-
-inline void rsp_cop2_simd::vmulf()
-{
- int op = m_op;
-
- for (int i = 0; i < 8; i++)
- {
- UINT16 w1, w2;
- GET_VS1(w1, i);
- GET_VS2(w2, i);
- INT32 s1 = (INT32)(INT16)w1;
- INT32 s2 = (INT32)(INT16)w2;
-
- if (s1 == -32768 && s2 == -32768)
- {
- // overflow
- SET_ACCUM_H(0, i);
- SET_ACCUM_M(-32768, i);
- SET_ACCUM_L(-32768, i);
- m_vres[i] = 0x7fff;
- }
- else
- {
- INT64 r = s1 * s2 * 2;
- r += 0x8000; // rounding ?
- SET_ACCUM_H((r < 0) ? 0xffff : 0, i);
- SET_ACCUM_M((INT16)(r >> 16), i);
- SET_ACCUM_L((UINT16)(r), i);
- m_vres[i] = ACCUM_M(i);
- }
- }
- WRITEBACK_RESULT();
-}
-
-static void cfunc_vmulf(void *param)
-{
- ((rsp_cop2 *)param)->vmulf();
-}
-
-
-// VMULU
-//
-// 31 25 24 20 15 10 5 0
-// ------------------------------------------------------
-// | 010010 | 1 | EEEE | SSSSS | TTTTT | DDDDD | 000001 |
-// ------------------------------------------------------
-//
-
-inline void rsp_cop2_simd::vmulu()
-{
- int op = m_op;
-
- for (int i = 0; i < 8; i++)
- {
- UINT16 w1, w2;
- GET_VS1(w1, i);
- GET_VS2(w2, i);
- INT32 s1 = (INT32)(INT16)w1;
- INT32 s2 = (INT32)(INT16)w2;
-
- INT64 r = s1 * s2 * 2;
- r += 0x8000; // rounding ?
-
- SET_ACCUM_H((UINT16)(r >> 32), i);
- SET_ACCUM_M((UINT16)(r >> 16), i);
- SET_ACCUM_L((UINT16)(r), i);
-
- if (r < 0)
- {
- m_vres[i] = 0;
- }
- else if (((INT16)(ACCUM_H(i)) ^ (INT16)(ACCUM_M(i))) < 0)
- {
- m_vres[i] = -1;
- }
- else
- {
- m_vres[i] = ACCUM_M(i);
- }
- }
- WRITEBACK_RESULT();
-}
-
-static void cfunc_vmulu(void *param)
-{
- ((rsp_cop2 *)param)->vmulu();
-}
-
-
-// VMUDL
-//
-// 31 25 24 20 15 10 5 0
-// ------------------------------------------------------
-// | 010010 | 1 | EEEE | SSSSS | TTTTT | DDDDD | 001101 |
-// ------------------------------------------------------
-//
-// Multiplies signed integer by unsigned fraction
-// The result is added into accumulator
-// The middle slice of accumulator is stored into destination element
-
-inline void rsp_cop2_simd::vmudl()
-{
- int op = m_op;
-
- __m128i vsReg = m_xv[VS1REG];
- __m128i vtReg = _mm_shuffle_epi8(m_xv[VS2REG], vec_shuf_inverse[EL]);
-
- /* Unpack to obtain for 32-bit precision. */
- __m128i unpackLo = _mm_mullo_epi16(vsReg, vtReg);
- __m128i unpackHi = _mm_mulhi_epu16(vsReg, vtReg);
- __m128i loProduct = _mm_unpacklo_epi16(unpackLo, unpackHi);
- __m128i hiProduct = _mm_unpackhi_epi16(unpackLo, unpackHi);
-
- m_xv[VDREG] = m_accum_l = RSPPackHi32to16(loProduct, hiProduct);
-
- m_accum_m = _mm_setzero_si128();
- m_accum_h = _mm_setzero_si128();
-}
-
-static void cfunc_vmudl(void *param)
-{
- ((rsp_cop2 *)param)->vmudl();
-}
-
-
-// VMUDM
-//
-// 31 25 24 20 15 10 5 0
-// ------------------------------------------------------
-// | 010010 | 1 | EEEE | SSSSS | TTTTT | DDDDD | 000101 |
-// ------------------------------------------------------
-//
-// Multiplies signed integer by unsigned fraction
-// The result is stored into accumulator
-// The middle slice of accumulator is stored into destination element
-
-inline void rsp_cop2_simd::vmudm()
-{
- int op = m_op;
-
- __m128i vsRegLo, vsRegHi, vtRegLo, vtRegHi;
-
- __m128i vsReg = m_xv[VS1REG];
- __m128i vtReg = _mm_shuffle_epi8(m_xv[VS2REG], vec_shuf_inverse[EL]);
-
- /* Unpack to obtain for 32-bit precision. */
- RSPSignExtend16to32(vsReg, &vsRegLo, &vsRegHi);
- RSPZeroExtend16to32(vtReg, &vtRegLo, &vtRegHi);
-
- /* Begin accumulating the products. */
- __m128i loProduct = _mm_mullo_epi32(vsRegLo, vtRegLo);
- __m128i hiProduct = _mm_mullo_epi32(vsRegHi, vtRegHi);
- m_accum_l = RSPPackLo32to16(loProduct, hiProduct);
- m_accum_m = m_xv[VDREG] = RSPPackHi32to16(loProduct, hiProduct);
-
- loProduct = _mm_cmplt_epi32(loProduct, _mm_setzero_si128());
- hiProduct = _mm_cmplt_epi32(hiProduct, _mm_setzero_si128());
- m_accum_h = _mm_packs_epi32(loProduct, hiProduct);
-}
-
-static void cfunc_vmudm(void *param)
-{
- ((rsp_cop2 *)param)->vmudm();
-}
-
-
-// VMUDN
-//
-// 31 25 24 20 15 10 5 0
-// ------------------------------------------------------
-// | 010010 | 1 | EEEE | SSSSS | TTTTT | DDDDD | 000110 |
-// ------------------------------------------------------
-//
-// Multiplies unsigned fraction by signed integer
-// The result is stored into accumulator
-// The low slice of accumulator is stored into destination element
-
-inline void rsp_cop2_simd::vmudn()
-{
- int op = m_op;
-
- __m128i vsRegLo, vsRegHi, vtRegLo, vtRegHi;
-
- __m128i vsReg = m_xv[VS1REG];
- __m128i vtReg = _mm_shuffle_epi8(m_xv[VS2REG], vec_shuf_inverse[EL]);
-
- /* Unpack to obtain for 32-bit precision. */
- RSPZeroExtend16to32(vsReg, &vsRegLo, &vsRegHi);
- RSPSignExtend16to32(vtReg, &vtRegLo, &vtRegHi);
-
- /* Begin accumulating the products. */
- __m128i loProduct = _mm_mullo_epi32(vsRegLo, vtRegLo);
- __m128i hiProduct = _mm_mullo_epi32(vsRegHi, vtRegHi);
- m_xv[VDREG] = m_accum_l = RSPPackLo32to16(loProduct, hiProduct);
- m_accum_m = RSPPackHi32to16(loProduct, hiProduct);
- m_accum_h = _mm_cmplt_epi16(m_accum_m, _mm_setzero_si128());
-}
-
-static void cfunc_vmudn(void *param)
-{
- ((rsp_cop2 *)param)->vmudn();
-}
-
-
-// VMUDH
-//
-// 31 25 24 20 15 10 5 0
-// ------------------------------------------------------
-// | 010010 | 1 | EEEE | SSSSS | TTTTT | DDDDD | 000111 |
-// ------------------------------------------------------
-//
-// Multiplies signed integer by signed integer
-// The result is stored into highest 32 bits of accumulator, the low slice is zero
-// The highest 32 bits of accumulator is saturated into destination element
-
-inline void rsp_cop2_simd::vmudh()
-{
- int op = m_op;
-
- __m128i vaccLow, vaccHigh;
- __m128i unpackLo, unpackHi;
-
- __m128i vsReg = m_xv[VS1REG];
- __m128i vtReg = _mm_shuffle_epi8(m_xv[VS2REG], vec_shuf_inverse[EL]);
-
- /* Multiply the sources, accumulate the product. */
- unpackLo = _mm_mullo_epi16(vsReg, vtReg);
- unpackHi = _mm_mulhi_epi16(vsReg, vtReg);
- vaccHigh = _mm_unpackhi_epi16(unpackLo, unpackHi);
- vaccLow = _mm_unpacklo_epi16(unpackLo, unpackHi);
-
- /* Pack the accumulator and result back up. */
- m_xv[VDREG] = _mm_packs_epi32(vaccLow, vaccHigh);
- m_accum_l = _mm_setzero_si128();
- m_accum_m = RSPPackLo32to16(vaccLow, vaccHigh);
- m_accum_h = RSPPackHi32to16(vaccLow, vaccHigh);
-}
-
-static void cfunc_vmudh(void *param)
-{
- ((rsp_cop2 *)param)->vmudh();
-}
-
-
-// VMACF
-//
-// 31 25 24 20 15 10 5 0
-// ------------------------------------------------------
-// | 010010 | 1 | EEEE | SSSSS | TTTTT | DDDDD | 001000 |
-// ------------------------------------------------------
-//
-
-inline void rsp_cop2_simd::vmacf()
-{
- int op = m_op;
-
- for (int i = 0; i < 8; i++)
- {
- UINT16 w1, w2;
- GET_VS1(w1, i);
- GET_VS2(w2, i);
- INT32 s1 = (INT32)(INT16)w1;
- INT32 s2 = (INT32)(INT16)w2;
-
- INT32 r = s1 * s2;
-
- UINT64 q = (UINT64)(UINT16)ACCUM_LL(i);
- q |= (((UINT64)(UINT16)ACCUM_L(i)) << 16);
- q |= (((UINT64)(UINT16)ACCUM_M(i)) << 32);
- q |= (((UINT64)(UINT16)ACCUM_H(i)) << 48);
-
- q += (INT64)(r) << 17;
- SET_ACCUM_LL((UINT16)q, i);
- SET_ACCUM_L((UINT16)(q >> 16), i);
- SET_ACCUM_M((UINT16)(q >> 32), i);
- SET_ACCUM_H((UINT16)(q >> 48), i);
-
- m_vres[i] = SATURATE_ACCUM(i, 1, 0x8000, 0x7fff);
- }
- WRITEBACK_RESULT();
-}
-
-static void cfunc_vmacf(void *param)
-{
- ((rsp_cop2 *)param)->vmacf();
-}
-
-
-// VMACU
-//
-// 31 25 24 20 15 10 5 0
-// ------------------------------------------------------
-// | 010010 | 1 | EEEE | SSSSS | TTTTT | DDDDD | 001001 |
-// ------------------------------------------------------
-//
-
-inline void rsp_cop2_simd::vmacu()
-{
- int op = m_op;
-
- __m128i loProduct, hiProduct, unpackLo, unpackHi;
- __m128i vaccHigh;
- __m128i vdReg, vdRegLo, vdRegHi;
-
- __m128i vsReg = m_xv[VS1REG];
- __m128i vtReg = _mm_shuffle_epi8(m_xv[VS2REG], vec_shuf_inverse[EL]);
-
- __m128i vaccLow = m_accum_l;
-
- /* Unpack to obtain for 32-bit precision. */
- RSPZeroExtend16to32(vaccLow, &vaccLow, &vaccHigh);
-
- /* Begin accumulating the products. */
- unpackLo = _mm_mullo_epi16(vsReg, vtReg);
- unpackHi = _mm_mulhi_epi16(vsReg, vtReg);
- loProduct = _mm_unpacklo_epi16(unpackLo, unpackHi);
- hiProduct = _mm_unpackhi_epi16(unpackLo, unpackHi);
- loProduct = _mm_slli_epi32(loProduct, 1);
- hiProduct = _mm_slli_epi32(hiProduct, 1);
-
- vdRegLo = _mm_srli_epi32(loProduct, 16);
- vdRegHi = _mm_srli_epi32(hiProduct, 16);
- vdRegLo = _mm_slli_epi32(vdRegLo, 16);
- vdRegHi = _mm_slli_epi32(vdRegHi, 16);
- vdRegLo = _mm_xor_si128(vdRegLo, loProduct);
- vdRegHi = _mm_xor_si128(vdRegHi, hiProduct);
-
- vaccLow = _mm_add_epi32(vaccLow, vdRegLo);
- vaccHigh = _mm_add_epi32(vaccHigh, vdRegHi);
-
- m_accum_l = vdReg = RSPPackLo32to16(vaccLow, vaccHigh);
-
- /* Multiply the MSB of sources, accumulate the product. */
- vdRegLo = _mm_unpacklo_epi16(m_accum_m, m_accum_h);
- vdRegHi = _mm_unpackhi_epi16(m_accum_m, m_accum_h);
-
- loProduct = _mm_srai_epi32(loProduct, 16);
- hiProduct = _mm_srai_epi32(hiProduct, 16);
- vaccLow = _mm_srai_epi32(vaccLow, 16);
- vaccHigh = _mm_srai_epi32(vaccHigh, 16);
-
- vaccLow = _mm_add_epi32(loProduct, vaccLow);
- vaccHigh = _mm_add_epi32(hiProduct, vaccHigh);
- vaccLow = _mm_add_epi32(vdRegLo, vaccLow);
- vaccHigh = _mm_add_epi32(vdRegHi, vaccHigh);
-
- /* Clamp the accumulator and write it all out. */
- m_accum_m = RSPPackLo32to16(vaccLow, vaccHigh);
- m_accum_h = RSPPackHi32to16(vaccLow, vaccHigh);
-}
-
-static void cfunc_vmacu(void *param)
-{
- ((rsp_cop2 *)param)->vmacu();
-}
-
-
-// VMADL
-//
-// 31 25 24 20 15 10 5 0
-// ------------------------------------------------------
-// | 010010 | 1 | EEEE | SSSSS | TTTTT | DDDDD | 001100 |
-// ------------------------------------------------------
-//
-// Multiplies unsigned fraction by unsigned fraction
-// Adds the higher 16 bits of the 32-bit result to accumulator
-// The low slice of accumulator is stored into destination element
-
-inline void rsp_cop2_simd::vmadl()
-{
- int op = m_op;
-
- for (int i = 0; i < 8; i++)
- {
- UINT16 w1, w2;
- GET_VS1(w1, i);
- GET_VS2(w2, i);
- UINT32 s1 = w1;
- UINT32 s2 = w2;
-
- UINT32 r1 = s1 * s2;
- UINT32 r2 = (UINT16)ACCUM_L(i) + (r1 >> 16);
- UINT32 r3 = (UINT16)ACCUM_M(i) + (r2 >> 16);
-
- SET_ACCUM_L((UINT16)r2, i);
- SET_ACCUM_M((UINT16)r3, i);
- SET_ACCUM_H(ACCUM_H(i) + (INT16)(r3 >> 16), i);
-
- m_vres[i] = SATURATE_ACCUM(i, 0, 0x0000, 0xffff);
- }
- WRITEBACK_RESULT();
-}
-
-static void cfunc_vmadl(void *param)
-{
- ((rsp_cop2 *)param)->vmadl();
-}
-
-
-// VMADM
-//
-// 31 25 24 20 15 10 5 0
-// ------------------------------------------------------
-// | 010010 | 1 | EEEE | SSSSS | TTTTT | DDDDD | 001101 |
-// ------------------------------------------------------
-//
-// Multiplies signed fraction by unsigned fraction
-// Adds the higher 16 bits of the 32-bit result to accumulator
-// The medium slice of accumulator is stored into destination element
-
-inline void rsp_cop2_simd::vmadm()
-{
- int op = m_op;
-
- __m128i vaccLow, vaccHigh, loProduct, hiProduct;
- __m128i vsRegLo, vsRegHi, vtRegLo, vtRegHi, vdRegLo, vdRegHi;
-
- __m128i vsReg = m_xv[VS1REG];
- __m128i vtReg = _mm_shuffle_epi8(m_xv[VS2REG], vec_shuf_inverse[EL]);
-
- /* Unpack to obtain for 32-bit precision. */
- RSPSignExtend16to32(vsReg, &vsRegLo, &vsRegHi);
- RSPZeroExtend16to32(vtReg, &vtRegLo, &vtRegHi);
- RSPZeroExtend16to32(m_accum_l, &vaccLow, &vaccHigh);
-
- /* Begin accumulating the products. */
- loProduct = _mm_mullo_epi32(vsRegLo, vtRegLo);
- hiProduct = _mm_mullo_epi32(vsRegHi, vtRegHi);
-
- vdRegLo = _mm_srli_epi32(loProduct, 16);
- vdRegHi = _mm_srli_epi32(hiProduct, 16);
- vdRegLo = _mm_slli_epi32(vdRegLo, 16);
- vdRegHi = _mm_slli_epi32(vdRegHi, 16);
- vdRegLo = _mm_xor_si128(vdRegLo, loProduct);
- vdRegHi = _mm_xor_si128(vdRegHi, hiProduct);
- vaccLow = _mm_add_epi32(vaccLow, vdRegLo);
- vaccHigh = _mm_add_epi32(vaccHigh, vdRegHi);
-
- m_accum_l = m_xv[VDREG] = RSPPackLo32to16(vaccLow, vaccHigh);
-
- /* Multiply the MSB of sources, accumulate the product. */
- vdRegLo = _mm_unpacklo_epi16(m_accum_m, m_accum_h);
- vdRegHi = _mm_unpackhi_epi16(m_accum_m, m_accum_h);
-
- loProduct = _mm_srai_epi32(loProduct, 16);
- hiProduct = _mm_srai_epi32(hiProduct, 16);
- vaccLow = _mm_srai_epi32(vaccLow, 16);
- vaccHigh = _mm_srai_epi32(vaccHigh, 16);
-
- vaccLow = _mm_add_epi32(loProduct, vaccLow);
- vaccHigh = _mm_add_epi32(hiProduct, vaccHigh);
- vaccLow = _mm_add_epi32(vdRegLo, vaccLow);
- vaccHigh = _mm_add_epi32(vdRegHi, vaccHigh);
-
- /* Clamp the accumulator and write it all out. */
- m_xv[VDREG] = _mm_packs_epi32(vaccLow, vaccHigh);
- m_accum_m = RSPPackLo32to16(vaccLow, vaccHigh);
- m_accum_h = RSPPackHi32to16(vaccLow, vaccHigh);
-}
-
-static void cfunc_vmadm(void *param)
-{
- ((rsp_cop2 *)param)->vmadm();
-}
-
-
-// VMADN
-//
-// 31 25 24 20 15 10 5 0
-// ------------------------------------------------------
-// | 010010 | 1 | EEEE | SSSSS | TTTTT | DDDDD | 001110 |
-// ------------------------------------------------------
-//
-// Multiplies unsigned fraction by signed fraction
-// Adds the 32-bit result to the medium and high slices of the accumulator
-// The low slice of accumulator is saturated into destination element
-
-inline void rsp_cop2_simd::vmadn()
-{
- int op = m_op;
-
- for (int i = 0; i < 8; i++)
- {
- UINT16 w1, w2;
- GET_VS1(w1, i);
- GET_VS2(w2, i);
- INT32 s1 = (UINT16)w1;
- INT32 s2 = (INT32)(INT16)w2;
-
- UINT64 q = (UINT64)ACCUM_LL(i);
- q |= (((UINT64)ACCUM_L(i)) << 16);
- q |= (((UINT64)ACCUM_M(i)) << 32);
- q |= (((UINT64)ACCUM_H(i)) << 48);
- q += (INT64)(s1*s2) << 16;
-
- SET_ACCUM_LL((UINT16)q, i);
- SET_ACCUM_L((UINT16)(q >> 16), i);
- SET_ACCUM_M((UINT16)(q >> 32), i);
- SET_ACCUM_H((UINT16)(q >> 48), i);
-
- m_vres[i] = SATURATE_ACCUM(i, 0, 0x0000, 0xffff);
- }
- WRITEBACK_RESULT();
-}
-
-static void cfunc_vmadn(void *param)
-{
- ((rsp_cop2 *)param)->vmadn();
-}
-
-
-// VMADH
-//
-// 31 25 24 20 15 10 5 0
-// ------------------------------------------------------
-// | 010010 | 1 | EEEE | SSSSS | TTTTT | DDDDD | 001111 |
-// ------------------------------------------------------
-//
-// Multiplies signed integer by signed integer
-// The result is added into highest 32 bits of accumulator, the low slice is zero
-// The highest 32 bits of accumulator is saturated into destination element
-
-inline void rsp_cop2_simd::vmadh()
-{
- int op = m_op;
-
- __m128i vsReg = m_xv[VS1REG];
- __m128i vtReg = _mm_shuffle_epi8(m_xv[VS2REG], vec_shuf_inverse[EL]);
-
- /* Unpack to obtain for 32-bit precision. */
- __m128i vaccLow = _mm_unpacklo_epi16(m_accum_m, m_accum_h);
- __m128i vaccHigh = _mm_unpackhi_epi16(m_accum_m, m_accum_h);
-
- /* Multiply the sources, accumulate the product. */
- __m128i unpackLo = _mm_mullo_epi16(vsReg, vtReg);
- __m128i unpackHi = _mm_mulhi_epi16(vsReg, vtReg);
- __m128i loProduct = _mm_unpacklo_epi16(unpackLo, unpackHi);
- __m128i hiProduct = _mm_unpackhi_epi16(unpackLo, unpackHi);
- vaccLow = _mm_add_epi32(vaccLow, loProduct);
- vaccHigh = _mm_add_epi32(vaccHigh, hiProduct);
-
- /* Pack the accumulator and result back up. */
- m_xv[VDREG] = _mm_packs_epi32(vaccLow, vaccHigh);
- m_accum_m = RSPPackLo32to16(vaccLow, vaccHigh);
- m_accum_h = RSPPackHi32to16(vaccLow, vaccHigh);
-}
-
-static void cfunc_vmadh(void *param)
-{
- ((rsp_cop2 *)param)->vmadh();
-}
-
-
-// VADD
-// 31 25 24 20 15 10 5 0
-// ------------------------------------------------------
-// | 010010 | 1 | EEEE | SSSSS | TTTTT | DDDDD | 010000 |
-// ------------------------------------------------------
-//
-// Adds two vector registers and carry flag, the result is saturated to 32767
-
-inline void rsp_cop2_simd::vadd()
-{
- int op = m_op;
-
- __m128i shuffled = _mm_shuffle_epi8(m_xv[VS2REG], vec_shuf_inverse[EL]);
- __m128i carry = _mm_and_si128(m_xvflag[CARRY], vec_flagmask);
- m_accum_l = _mm_add_epi16(_mm_add_epi16(m_xv[VS1REG], shuffled), carry);
-
- __m128i addvec = _mm_adds_epi16(m_xv[VS1REG], shuffled);
-
- carry = _mm_and_si128(carry, _mm_xor_si128(_mm_cmpeq_epi16(addvec, vec_32767), vec_neg1));
- carry = _mm_and_si128(carry, _mm_xor_si128(_mm_cmpeq_epi16(addvec, vec_n32768), vec_neg1));
-
- m_xv[VDREG] = _mm_add_epi16(addvec, carry);
-
- m_xvflag[ZERO] = vec_zero;
- m_xvflag[CARRY] = vec_zero;
-}
-
-static void cfunc_vadd(void *param)
-{
- ((rsp_cop2 *)param)->vadd();
-}
-
-
-// VSUB
-//
-// 31 25 24 20 15 10 5 0
-// ------------------------------------------------------
-// | 010010 | 1 | EEEE | SSSSS | TTTTT | DDDDD | 010001 |
-// ------------------------------------------------------
-//
-// Subtracts two vector registers and carry flag, the result is saturated to -32768
-// TODO: check VS2REG == VDREG
-
-inline void rsp_cop2_simd::vsub()
-{
- int op = m_op;
-
- __m128i shuffled = _mm_shuffle_epi8(m_xv[VS2REG], vec_shuf_inverse[EL]);
- __m128i carry = _mm_and_si128(m_xvflag[CARRY], vec_flagmask);
- __m128i unsat = _mm_sub_epi16(m_xv[VS1REG], shuffled);
-
- __m128i vs2neg = _mm_cmplt_epi16(shuffled, vec_zero);
- __m128i vs2pos = _mm_cmpeq_epi16(vs2neg, vec_zero);
-
- __m128i saturated = _mm_subs_epi16(m_xv[VS1REG], shuffled);
- __m128i carry_mask = _mm_cmpeq_epi16(unsat, saturated);
- carry_mask = _mm_and_si128(vs2neg, carry_mask);
-
- vs2neg = _mm_and_si128(carry_mask, carry);
- vs2pos = _mm_and_si128(vs2pos, carry);
- __m128i dest_carry = _mm_or_si128(vs2neg, vs2pos);
- m_xv[VDREG] = _mm_subs_epi16(saturated, dest_carry);
-
- m_accum_l = _mm_sub_epi16(unsat, carry);
-
- m_xvflag[ZERO] = _mm_setzero_si128();
- m_xvflag[CARRY] = _mm_setzero_si128();
-}
-
-static void cfunc_vsub(void *param)
-{
- ((rsp_cop2 *)param)->vsub();
-}
-
-
-// VABS
-//
-// 31 25 24 20 15 10 5 0
-// ------------------------------------------------------
-// | 010010 | 1 | EEEE | SSSSS | TTTTT | DDDDD | 010011 |
-// ------------------------------------------------------
-//
-// Changes the sign of source register 2 if source register 1 is negative and stores the result to destination register
-
-inline void rsp_cop2_simd::vabs()
-{
- int op = m_op;
-
- __m128i shuf2 = _mm_shuffle_epi8(m_xv[VS2REG], vec_shuf_inverse[EL]);
- __m128i negs2 = _mm_sub_epi16(_mm_setzero_si128(), shuf2);
- __m128i s2_n32768 = _mm_cmpeq_epi16(shuf2, vec_n32768);
- __m128i s1_lz = _mm_cmplt_epi16(m_xv[VS1REG], _mm_setzero_si128());
-
- __m128i result_gz = _mm_and_si128(shuf2, _mm_cmpgt_epi16(m_xv[VS1REG], _mm_setzero_si128()));
- __m128i result_n32768 = _mm_and_si128(s1_lz, _mm_and_si128(vec_32767, s2_n32768));
- __m128i result_negs2 = _mm_and_si128(s1_lz, _mm_and_si128(negs2, _mm_xor_si128(s2_n32768, vec_neg1)));
- m_xv[VDREG] = m_accum_l = _mm_or_si128(result_gz, _mm_or_si128(result_n32768, result_negs2));
-}
-
-static void cfunc_vabs(void *param)
-{
- ((rsp_cop2 *)param)->vabs();
-}
-
-
-// VADDC
-//
-// 31 25 24 20 15 10 5 0
-// ------------------------------------------------------
-// | 010010 | 1 | EEEE | SSSSS | TTTTT | DDDDD | 010100 |
-// ------------------------------------------------------
-//
-// Adds two vector registers, the carry out is stored into carry register
-// TODO: check VS2REG = VDREG
-
-inline void rsp_cop2_simd::vaddc()
-{
- int op = m_op;
-
- CLEAR_ZERO_FLAGS();
- CLEAR_CARRY_FLAGS();
-
- __m128i shuf2 = _mm_shuffle_epi8(m_xv[VS2REG], vec_shuf_inverse[EL]);
- __m128i vec7531 = _mm_and_si128(m_xv[VS1REG], vec_lomask);
- __m128i vec6420 = _mm_srli_epi32(m_xv[VS1REG], 16);
- __m128i shuf7531 = _mm_and_si128(shuf2, vec_lomask);
- __m128i shuf6420 = _mm_srli_epi32(shuf2, 16);
- __m128i sum7531 = _mm_add_epi32(vec7531, shuf7531);
- __m128i sum6420 = _mm_add_epi32(vec6420, shuf6420);
-
- __m128i over7531 = _mm_and_si128(_mm_xor_si128(_mm_cmpeq_epi16(sum7531, _mm_setzero_si128()), vec_neg1), vec_himask);
- __m128i over6420 = _mm_and_si128(_mm_xor_si128(_mm_cmpeq_epi16(sum6420, _mm_setzero_si128()), vec_neg1), vec_himask);
-
- sum7531 = _mm_and_si128(sum7531, vec_lomask);
- sum6420 = _mm_and_si128(sum6420, vec_lomask);
-
- m_xvflag[CARRY] = _mm_or_si128(over6420, _mm_srli_epi32(over7531, 16));
- m_accum_l = m_xv[VDREG] = _mm_or_si128(_mm_slli_epi32(sum6420, 16), sum7531);
-}
-
-static void cfunc_vaddc(void *param)
-{
- ((rsp_cop2 *)param)->vaddc();
-}
-
-
-// VSUBC
-//
-// 31 25 24 20 15 10 5 0
-// ------------------------------------------------------
-// | 010010 | 1 | EEEE | SSSSS | TTTTT | DDDDD | 010101 |
-// ------------------------------------------------------
-//
-// Subtracts two vector registers, the carry out is stored into carry register
-// TODO: check VS2REG = VDREG
-
-inline void rsp_cop2_simd::vsubc()
-{
- int op = m_op;
-
- CLEAR_ZERO_FLAGS();
- CLEAR_CARRY_FLAGS();
-
- __m128i shuf2 = _mm_shuffle_epi8(m_xv[VS2REG], vec_shuf_inverse[EL]);
- __m128i vec7531 = _mm_and_si128(m_xv[VS1REG], vec_lomask);
- __m128i vec6420 = _mm_srli_epi32(m_xv[VS1REG], 16);
- __m128i shuf7531 = _mm_and_si128(shuf2, vec_lomask);
- __m128i shuf6420 = _mm_srli_epi32(shuf2, 16);
- __m128i sum7531 = _mm_sub_epi32(vec7531, shuf7531);
- __m128i sum6420 = _mm_sub_epi32(vec6420, shuf6420);
-
- __m128i over7531 = _mm_and_si128(_mm_xor_si128(_mm_cmpeq_epi16(sum7531, _mm_setzero_si128()), vec_neg1), vec_himask);
- __m128i over6420 = _mm_and_si128(_mm_xor_si128(_mm_cmpeq_epi16(sum6420, _mm_setzero_si128()), vec_neg1), vec_himask);
- sum7531 = _mm_and_si128(sum7531, vec_lomask);
- sum6420 = _mm_and_si128(sum6420, vec_lomask);
- __m128i zero7531 = _mm_and_si128(_mm_xor_si128(_mm_cmpeq_epi16(sum7531, _mm_setzero_si128()), vec_neg1), vec_lomask);
- __m128i zero6420 = _mm_and_si128(_mm_xor_si128(_mm_cmpeq_epi16(sum6420, _mm_setzero_si128()), vec_neg1), vec_lomask);
-
- m_xvflag[CARRY] = _mm_or_si128(over6420, _mm_srli_epi32(over7531, 16));
- m_xvflag[ZERO] = _mm_or_si128(_mm_slli_epi32(zero6420, 16), zero7531);
-
- m_accum_l = m_xv[VDREG] = _mm_or_si128(_mm_slli_epi32(sum6420, 16), sum7531);
-}
-
-static void cfunc_vsubc(void *param)
-{
- ((rsp_cop2 *)param)->vsubc();
-}
-
-
-// VADDB
-//
-// 31 25 24 20 15 10 5 0
-// ------------------------------------------------------
-// | 010010 | 1 | EEEE | SSSSS | TTTTT | DDDDD | 010110 |
-// ------------------------------------------------------
-//
-// Adds two vector registers bytewise with rounding
-inline void rsp_cop2_simd::vaddb()
-{
- const int op = m_op;
- const int round = (EL == 0) ? 0 : (1 << (EL - 1));
-
- for (int i = 0; i < 8; i++)
- {
- UINT16 w1, w2;
- GET_VS1(w1, i);
- GET_VS2(w2, i);
-
- UINT8 hb1 = w1 >> 8;
- UINT8 lb1 = w1 & 0xff;
- UINT8 hb2 = w2 >> 8;
- UINT8 lb2 = w2 & 0xff;
-
- UINT16 hs = hb1 + hb2 + round;
- UINT16 ls = lb1 + lb2 + round;
-
- SET_ACCUM_L((hs << 8) | ls, i);
-
- hs >>= EL;
- if (hs > 255)
- {
- hs = 255;
- }
-
- ls >>= EL;
- if (ls > 255)
- {
- ls = 255;
- }
-
- m_vres[i] = 0; // VD writeback disabled on production hardware
- // m_vres[i] = (hs << 8) | ls;
- }
- WRITEBACK_RESULT();
-}
-
-static void cfunc_vaddb(void *param)
-{
- ((rsp_cop2 *)param)->vaddb();
-}
-
-
-// VSAW
-//
-// 31 25 24 20 15 10 5 0
-// ------------------------------------------------------
-// | 010010 | 1 | EEEE | SSSSS | TTTTT | DDDDD | 011101 |
-// ------------------------------------------------------
-//
-// Stores high, middle or low slice of accumulator to destination vector
-
-inline void rsp_cop2_simd::vsaw()
-{
- int op = m_op;
-
- switch (EL)
- {
- case 0x08: // VSAWH
- {
- m_xv[VDREG] = m_accum_h;
- break;
- }
- case 0x09: // VSAWM
- {
- m_xv[VDREG] = m_accum_m;
- break;
- }
- case 0x0a: // VSAWL
- {
- m_xv[VDREG] = m_accum_l;
- break;
- }
- default: // Unsupported, writes 0 to VD
- {
- }
- }
-}
-
-static void cfunc_vsaw(void *param)
-{
- ((rsp_cop2 *)param)->vsaw();
-}
-
-
-// VLT
-//
-// 31 25 24 20 15 10 5 0
-// ------------------------------------------------------
-// | 010010 | 1 | EEEE | SSSSS | TTTTT | DDDDD | 100000 |
-// ------------------------------------------------------
-//
-// Sets compare flags if elements in VS1 are less than VS2
-// Moves the element in VS2 to destination vector
-
-inline void rsp_cop2_simd::vlt()
-{
- int op = m_op;
-
- m_xvflag[COMPARE] = m_xvflag[CLIP2] = _mm_setzero_si128();
-
- __m128i shuf = _mm_shuffle_epi8(m_xv[VS2REG], vec_shuf_inverse[EL]);
- __m128i zc_mask = _mm_and_si128(m_xvflag[ZERO], m_xvflag[CARRY]);
- __m128i lt_mask = _mm_cmplt_epi16(m_xv[VS1REG], shuf);
- __m128i eq_mask = _mm_and_si128(_mm_cmpeq_epi16(m_xv[VS1REG], shuf), zc_mask);
-
- m_xvflag[COMPARE] = _mm_or_si128(lt_mask, eq_mask);
-
- __m128i result = _mm_and_si128(m_xv[VS1REG], m_xvflag[COMPARE]);
- m_accum_l = m_xv[VDREG] = _mm_or_si128(result, _mm_and_si128(shuf, _mm_xor_si128(m_xvflag[COMPARE], vec_neg1)));
-
- m_xvflag[ZERO] = m_xvflag[CARRY] = _mm_setzero_si128();
-}
-
-static void cfunc_void vlt(void *param)
-{
- ((rsp_cop2 *)param)->vlt();
-}
-
-
-// VEQ
-//
-// 31 25 24 20 15 10 5 0
-// ------------------------------------------------------
-// | 010010 | 1 | EEEE | SSSSS | TTTTT | DDDDD | 100001 |
-// ------------------------------------------------------
-//
-// Sets compare flags if elements in VS1 are equal with VS2
-// Moves the element in VS2 to destination vector
-
-inline void rsp_cop2_simd::veq()
-{
- int op = m_op;
-
- m_xvflag[COMPARE] = m_xvflag[CLIP2] = _mm_setzero_si128();
-
- __m128i shuf = _mm_shuffle_epi8(m_xv[VS2REG], vec_shuf_inverse[EL]);
- __m128i zero_mask = _mm_cmpeq_epi16(m_xvflag[ZERO], _mm_setzero_si128());
- __m128i eq_mask = _mm_cmpeq_epi16(m_xv[VS1REG], shuf);
-
- m_xvflag[COMPARE] = _mm_and_si128(zero_mask, eq_mask);
-
- __m128i result = _mm_and_si128(m_xv[VS1REG], m_xvflag[COMPARE]);
- m_accum_l = m_xv[VDREG] = _mm_or_si128(result, _mm_and_si128(shuf, _mm_xor_si128(m_xvflag[COMPARE], vec_neg1)));
-
- m_xvflag[ZERO] = m_xvflag[CARRY] = _mm_setzero_si128();
-}
-
-static void cfunc_veq(void *param)
-{
- ((rsp_cop2 *)param)->veq();
-}
-
-
-// VNE
-//
-// 31 25 24 20 15 10 5 0
-// ------------------------------------------------------
-// | 010010 | 1 | EEEE | SSSSS | TTTTT | DDDDD | 100010 |
-// ------------------------------------------------------
-//
-// Sets compare flags if elements in VS1 are not equal with VS2
-// Moves the element in VS2 to destination vector
-
-inline void rsp_cop2_simd::vne()
-{
- int op = m_op;
-
- m_xvflag[COMPARE] = m_xvflag[CLIP2] = _mm_setzero_si128();
-
- __m128i shuf = _mm_shuffle_epi8(m_xv[VS2REG], vec_shuf_inverse[EL]);
- __m128i neq_mask = _mm_xor_si128(_mm_cmpeq_epi16(m_xv[VS1REG], shuf), vec_neg1);
-
- m_xvflag[COMPARE] = _mm_or_si128(m_xvflag[ZERO], neq_mask);
-
- __m128i result = _mm_and_si128(m_xv[VS1REG], m_xvflag[COMPARE]);
- m_accum_l = m_xv[VDREG] = _mm_or_si128(result, _mm_and_si128(shuf, _mm_xor_si128(m_xvflag[COMPARE], vec_neg1)));
-
- m_xvflag[ZERO] = m_xvflag[CARRY] = _mm_setzero_si128();
-}
-
-static void cfunc_vne(void *param)
-{
- ((rsp_cop2 *)param)->vne();
-}
-
-
-// VGE
-//
-// 31 25 24 20 15 10 5 0
-// ------------------------------------------------------
-// | 010010 | 1 | EEEE | SSSSS | TTTTT | DDDDD | 100011 |
-// ------------------------------------------------------
-//
-// Sets compare flags if elements in VS1 are greater or equal with VS2
-// Moves the element in VS2 to destination vector
-
-inline void rsp_cop2_simd::vge()
-{
- int op = m_op;
-
- m_xvflag[COMPARE] = m_xvflag[CLIP2] = _mm_setzero_si128();
-
- __m128i shuf = _mm_shuffle_epi8(m_xv[VS2REG], vec_shuf_inverse[EL]);
- __m128i zero_mask = _mm_cmpeq_epi16(m_xvflag[ZERO], _mm_setzero_si128());
- __m128i carry_mask = _mm_cmpeq_epi16(m_xvflag[CARRY], _mm_setzero_si128());
- __m128i flag_mask = _mm_or_si128(zero_mask, carry_mask);
- __m128i eq_mask = _mm_and_si128(_mm_cmpeq_epi16(m_xv[VS1REG], shuf), flag_mask);
- __m128i gt_mask = _mm_cmpgt_epi16(m_xv[VS1REG], shuf);
- m_xvflag[COMPARE] = _mm_or_si128(eq_mask, gt_mask);
-
- __m128i result = _mm_and_si128(m_xv[VS1REG], m_xvflag[COMPARE]);
- m_accum_l = m_xv[VDREG] = _mm_or_si128(result, _mm_and_si128(shuf, _mm_xor_si128(m_xvflag[COMPARE], vec_neg1)));
-
- m_xvflag[ZERO] = m_xvflag[CARRY] = _mm_setzero_si128();
-}
-
-static void cfunc_vge(void *param)
-{
- ((rsp_cop2 *)param)->vge();
-}
-
-
-// VCL
-//
-// 31 25 24 20 15 10 5 0
-// ------------------------------------------------------
-// | 010010 | 1 | EEEE | SSSSS | TTTTT | DDDDD | 100100 |
-// ------------------------------------------------------
-//
-// Vector clip low
-
-inline void rsp_cop2_simd::vcl()
-{
- int op = m_op;
-
- for (int i = 0; i < 8; i++)
- {
- INT16 s1, s2;
- GET_VS1(s1, i);
- GET_VS2(s2, i);
-
- if (CARRY_FLAG(i) != 0)
- {
- if (ZERO_FLAG(i) != 0)
- {
- if (COMPARE_FLAG(i) != 0)
- {
- SET_ACCUM_L(-(UINT16)s2, i);
- }
- else
- {
- SET_ACCUM_L(s1, i);
- }
- }
- else
- {
- if (CLIP1_FLAG(i) != 0)
- {
- if (((UINT32)(UINT16)(s1) + (UINT32)(UINT16)(s2)) > 0x10000)
- {
- SET_ACCUM_L(s1, i);
- CLEAR_COMPARE_FLAG(i);
- }
- else
- {
- SET_ACCUM_L(-((UINT16)s2), i);
- SET_COMPARE_FLAG(i);
- }
- }
- else
- {
- if (((UINT32)(UINT16)(s1) + (UINT32)(UINT16)(s2)) != 0)
- {
- SET_ACCUM_L(s1, i);
- CLEAR_COMPARE_FLAG(i);
- }
- else
- {
- SET_ACCUM_L(-((UINT16)s2), i);
- SET_COMPARE_FLAG(i);
- }
- }
- }
- }
- else
- {
- if (ZERO_FLAG(i) != 0)
- {
- if (CLIP2_FLAG(i) != 0)
- {
- SET_ACCUM_L(s2, i);
- }
- else
- {
- SET_ACCUM_L(s1, i);
- }
- }
- else
- {
- if (((INT32)(UINT16)s1 - (INT32)(UINT16)s2) >= 0)
- {
- SET_ACCUM_L(s2, i);
- SET_CLIP2_FLAG(i);
- }
- else
- {
- SET_ACCUM_L(s1, i);
- CLEAR_CLIP2_FLAG(i);
- }
- }
- }
- m_vres[i] = ACCUM_L(i);
- }
- CLEAR_ZERO_FLAGS();
- CLEAR_CARRY_FLAGS();
- CLEAR_CLIP1_FLAGS();
- WRITEBACK_RESULT();
-}
-
-static void cfunc_vcl(void *param)
-{
- ((rsp_cop2 *)param)->vcl();
-}
-
-
-// VCH
-//
-// 31 25 24 20 15 10 5 0
-// ------------------------------------------------------
-// | 010010 | 1 | EEEE | SSSSS | TTTTT | DDDDD | 100101 |
-// ------------------------------------------------------
-//
-// Vector clip high
-
-inline void rsp_cop2_simd::vch()
-{
- int op = m_op;
-
- CLEAR_CARRY_FLAGS();
- CLEAR_COMPARE_FLAGS();
- CLEAR_CLIP1_FLAGS();
- CLEAR_ZERO_FLAGS();
- CLEAR_CLIP2_FLAGS();
-
- UINT32 vce = 0;
- for (int i = 0; i < 8; i++)
- {
- INT16 s1, s2;
- GET_VS1(s1, i);
- GET_VS2(s2, i);
-
- if ((s1 ^ s2) < 0)
- {
- vce = (s1 + s2 == -1);
- SET_CARRY_FLAG(i);
- if (s2 < 0)
- {
- SET_CLIP2_FLAG(i);
- }
-
- if ((s1 + s2) <= 0)
- {
- SET_COMPARE_FLAG(i);
- m_vres[i] = -((UINT16)s2);
- }
- else
- {
- m_vres[i] = s1;
- }
-
- if ((s1 + s2) != 0 && s1 != ~s2)
- {
- SET_ZERO_FLAG(i);
- }
- }//sign
- else
- {
- vce = 0;
- if (s2 < 0)
- {
- SET_COMPARE_FLAG(i);
- }
- if ((s1 - s2) >= 0)
- {
- SET_CLIP2_FLAG(i);
- m_vres[i] = s2;
- }
- else
- {
- m_vres[i] = s1;
- }
-
- if ((s1 - s2) != 0 && s1 != ~s2)
- {
- SET_ZERO_FLAG(i);
- }
- }
- if (vce)
- {
- SET_CLIP1_FLAG(i);
- }
- SET_ACCUM_L(m_vres[i], i);
- }
- WRITEBACK_RESULT();
-}
-
-static void cfunc_vch(void *param)
-{
- ((rsp_cop2 *)param)->vch();
-}
-
-
-// VCR
-//
-// 31 25 24 20 15 10 5 0
-// ------------------------------------------------------
-// | 010010 | 1 | EEEE | SSSSS | TTTTT | DDDDD | 100110 |
-// ------------------------------------------------------
-//
-// Vector clip reverse
-
-inline void rsp_cop2_simd::vcr()
-{
- int op = m_op;
-
- CLEAR_CARRY_FLAGS();
- CLEAR_COMPARE_FLAGS();
- CLEAR_CLIP1_FLAGS();
- CLEAR_ZERO_FLAGS();
- CLEAR_CLIP2_FLAGS();
-
- for (int i = 0; i < 8; i++)
- {
- INT16 s1, s2;
- GET_VS1(s1, i);
- GET_VS2(s2, i);
-
- if ((INT16)(s1 ^ s2) < 0)
- {
- if (s2 < 0)
- {
- SET_CLIP2_FLAG(i);
- }
- if ((s1 + s2) <= 0)
- {
- SET_ACCUM_L(~((UINT16)s2), i);
- SET_COMPARE_FLAG(i);
- }
- else
- {
- SET_ACCUM_L(s1, i);
- }
- }
- else
- {
- if (s2 < 0)
- {
- SET_COMPARE_FLAG(i);
- }
- if ((s1 - s2) >= 0)
- {
- SET_ACCUM_L(s2, i);
- SET_CLIP2_FLAG(i);
- }
- else
- {
- SET_ACCUM_L(s1, i);
- }
- }
-
- m_vres[i] = ACCUM_L(i);
- }
- WRITEBACK_RESULT();
-}
-
-static void cfunc_vcr(void *param)
-{
- ((rsp_cop2 *)param)->vcr();
-}
-
-
-// VMRG
-//
-// 31 25 24 20 15 10 5 0
-// ------------------------------------------------------
-// | 010010 | 1 | EEEE | SSSSS | TTTTT | DDDDD | 100111 |
-// ------------------------------------------------------
-//
-// Merges two vectors according to compare flags
-
-inline void rsp_cop2_simd::vmrg()
-{
- int op = m_op;
-
- __m128i shuf = _mm_shuffle_epi8(m_xv[VS2REG], vec_shuf_inverse[EL]);
- __m128i s2mask = _mm_cmpeq_epi16(m_xvflag[COMPARE], _mm_setzero_si128());
- __m128i s1mask = _mm_xor_si128(s2mask, vec_neg1);
- __m128i result = _mm_and_si128(m_xv[VS1REG], s1mask);
- m_xv[VDREG] = _mm_or_si128(result, _mm_and_si128(shuf, s2mask));
- m_accum_l = m_xv[VDREG];
-}
-
-static void cfunc_vmrg(void *param)
-{
- ((rsp_cop2 *)param)->vmrg();
-}
-
-
-// VAND
-//
-// 31 25 24 20 15 10 5 0
-// ------------------------------------------------------
-// | 010010 | 1 | EEEE | SSSSS | TTTTT | DDDDD | 101000 |
-// ------------------------------------------------------
-//
-// Bitwise AND of two vector registers
-
-inline void rsp_cop2_simd::vand()
-{
- int op = m_op;
-
- __m128i shuf = _mm_shuffle_epi8(m_xv[VS2REG], vec_shuf_inverse[EL]);
- m_accum_l = m_xv[VDREG] = _mm_and_si128(m_xv[VS1REG], shuf);
-}
-
-static void cfunc_vand(void *param)
-{
- ((rsp_cop2 *)param)->vand();
-}
-
-
-// VNAND
-//
-// 31 25 24 20 15 10 5 0
-// ------------------------------------------------------
-// | 010010 | 1 | EEEE | SSSSS | TTTTT | DDDDD | 101001 |
-// ------------------------------------------------------
-//
-// Bitwise NOT AND of two vector registers
-
-inline void rsp_cop2_simd::vnand()
-{
- int op = m_op;
-
- __m128i shuf = _mm_shuffle_epi8(m_xv[VS2REG], vec_shuf_inverse[EL]);
- m_accum_l = m_xv[VDREG] = _mm_xor_si128(_mm_and_si128(m_xv[VS1REG], shuf), vec_neg1);
-}
-
-static void cfunc_vnand(void *param)
-{
- ((rsp_cop2 *)param)->vnand();
-}
-
-
-// VOR
-//
-// 31 25 24 20 15 10 5 0
-// ------------------------------------------------------
-// | 010010 | 1 | EEEE | SSSSS | TTTTT | DDDDD | 101010 |
-// ------------------------------------------------------
-//
-// Bitwise OR of two vector registers
-
-inline void rsp_cop2_simd::vor()
-{
- int op = m_op;
-
- __m128i shuf = _mm_shuffle_epi8(m_xv[VS2REG], vec_shuf_inverse[EL]);
- m_accum_l = m_xv[VDREG] = _mm_or_si128(m_xv[VS1REG], shuf);
-}
-
-static void cfunc_vor_simd(void *param)
-{
- ((rsp_cop2 *)param)->vor();
-}
-
-
-// VNOR
-//
-// 31 25 24 20 15 10 5 0
-// ------------------------------------------------------
-// | 010010 | 1 | EEEE | SSSSS | TTTTT | DDDDD | 101011 |
-// ------------------------------------------------------
-//
-// Bitwise NOT OR of two vector registers
-
-inline void rsp_cop2_simd::vnor()
-{
- int op = m_op;
-
- __m128i shuf = _mm_shuffle_epi8(m_xv[VS2REG], vec_shuf_inverse[EL]);
- m_accum_l = m_xv[VDREG] = _mm_xor_si128(_mm_or_si128(m_xv[VS1REG], shuf), vec_neg1);
-}
-
-static void cfunc_vnor(void *param)
-{
- ((rsp_cop2 *)param)->vnor();
-}
-
-
-// VXOR
-//
-// 31 25 24 20 15 10 5 0
-// ------------------------------------------------------
-// | 010010 | 1 | EEEE | SSSSS | TTTTT | DDDDD | 101100 |
-// ------------------------------------------------------
-//
-// Bitwise XOR of two vector registers
-
-inline void rsp_cop2_simd::vxor()
-{
- int op = m_op;
-
- __m128i shuf = _mm_shuffle_epi8(m_xv[VS2REG], vec_shuf_inverse[EL]);
- m_accum_l = m_xv[VDREG] = _mm_xor_si128(m_xv[VS1REG], shuf);
-}
-
-static void cfunc_vxor(void *param)
-{
- ((rsp_cop2 *)param)->vxor();
-}
-
-
-// VNXOR
-//
-// 31 25 24 20 15 10 5 0
-// ------------------------------------------------------
-// | 010010 | 1 | EEEE | SSSSS | TTTTT | DDDDD | 101101 |
-// ------------------------------------------------------
-//
-// Bitwise NOT XOR of two vector registers
-
-inline void rsp_cop2_simd::vnxor()
-{
- int op = m_op;
-
- __m128i shuf = _mm_shuffle_epi8(m_xv[VS2REG], vec_shuf_inverse[EL]);
- m_accum_l = m_xv[VDREG] = _mm_xor_si128(_mm_xor_si128(m_xv[VS1REG], shuf), vec_neg1);
-}
-
-static void cfunc_vnxor(void *param)
-{
- ((rsp_cop2 *)param)->vnxor();
-}
-
-
-// VRCP
-//
-// 31 25 24 20 15 10 5 0
-// ------------------------------------------------------
-// | 010010 | 1 | EEEE | SSSSS | ?FFFF | DDDDD | 110000 |
-// ------------------------------------------------------
-//
-// Calculates reciprocal
-
-inline void rsp_cop2_simd::vrcp()
-{
- int op = m_op;
-
- INT32 shifter = 0;
- UINT16 urec;
- INT32 rec;
- EXTRACT16(m_xv[VS2REG], urec, EL);
- rec = (INT16)urec;
- INT32 datainput = (rec < 0) ? (-rec) : rec;
- if (datainput)
- {
- for (int i = 0; i < 32; i++)
- {
- if (datainput & (1 << ((~i) & 0x1f)))
- {
- shifter = i;
- break;
- }
- }
- }
- else
- {
- shifter = 0x10;
- }
-
- INT32 address = ((datainput << shifter) & 0x7fc00000) >> 22;
- INT32 fetchval = rsp_divtable[address];
- INT32 temp = (0x40000000 | (fetchval << 14)) >> ((~shifter) & 0x1f);
- if (rec < 0)
- {
- temp = ~temp;
- }
- if (!rec)
- {
- temp = 0x7fffffff;
- }
- else if (rec == 0xffff8000)
- {
- temp = 0xffff0000;
- }
- rec = temp;
-
- m_reciprocal_res = rec;
- m_dp_allowed = 0;
-
- INSERT16(m_xv[VDREG], (UINT16)rec, VS1REG);
- m_accum_l = _mm_shuffle_epi8(m_xv[VS2REG], vec_shuf_inverse[EL]);
-}
-
-static void cfunc_vrcp(void *param)
-{
- ((rsp_cop2 *)param)->vrcp();
-}
-
-
-// VRCPL
-//
-// 31 25 24 20 15 10 5 0
-// ------------------------------------------------------
-// | 010010 | 1 | EEEE | SSSSS | ?FFFF | DDDDD | 110001 |
-// ------------------------------------------------------
-//
-// Calculates reciprocal low part
-
-inline void rsp_cop2_simd::vrcpl()
-{
- int op = m_op;
-
-#if SIMUL_SIMD
- m_old_reciprocal_res = m_reciprocal_res;
- m_old_reciprocal_high = m_reciprocal_high;
- m_old_dp_allowed = m_dp_allowed;
-#endif
-
- INT32 shifter = 0;
-
- UINT16 urec;
- EXTRACT16(m_xv[VS2REG], urec, EL);
- INT32 rec = (INT16)urec;
- INT32 datainput = rec;
-
- if (m_dp_allowed)
- {
- rec = (rec & 0x0000ffff) | m_reciprocal_high;
- datainput = rec;
-
- if (rec < 0)
- {
- if (rec < -32768)
- {
- datainput = ~datainput;
- }
- else
- {
- datainput = -datainput;
- }
- }
- }
- else if (datainput < 0)
- {
- datainput = -datainput;
-
- shifter = 0x10;
- }
-
- if (datainput)
- {
- for (int i = 0; i < 32; i++)
- {
- if (datainput & (1 << ((~i) & 0x1f)))
- {
- shifter = i;
- break;
- }
- }
- }
-
- INT32 address = ((datainput << shifter) & 0x7fc00000) >> 22;
- INT32 fetchval = rsp_divtable[address];
- INT32 temp = (0x40000000 | (fetchval << 14)) >> ((~shifter) & 0x1f);
- temp ^= rec >> 31;
-
- if (!rec)
- {
- temp = 0x7fffffff;
- }
- else if (rec == 0xffff8000)
- {
- temp = 0xffff0000;
- }
- rec = temp;
-
- m_reciprocal_res = rec;
- m_dp_allowed = 0;
-
- INSERT16(m_xv[VDREG], (UINT16)rec, VS1REG);
-
- for (int i = 0; i < 8; i++)
- {
- INT16 val;
- EXTRACT16(m_xv[VS2REG], val, VEC_EL_2(EL, i));
- SET_ACCUM_L(val, i);
- }
-}
-
-static void cfunc_vrcpl(void *param)
-{
- ((rsp_cop2 *)param)->vrcpl();
-}
-
-
-// VRCPH
-//
-// 31 25 24 20 15 10 5 0
-// ------------------------------------------------------
-// | 010010 | 1 | EEEE | SSSSS | ?FFFF | DDDDD | 110010 |
-// ------------------------------------------------------
-//
-// Calculates reciprocal high part
-
-inline void rsp_cop2_simd::vrcph()
-{
- int op = m_op;
-
-#if SIMUL_SIMD
- m_old_reciprocal_res = m_reciprocal_res;
- m_old_reciprocal_high = m_reciprocal_high;
- m_old_dp_allowed = m_dp_allowed;
-#endif
-
- UINT16 rcph;
- EXTRACT16(m_xv[VS2REG], rcph, EL);
- m_reciprocal_high = rcph << 16;
- m_dp_allowed = 1;
-
- m_accum_l = _mm_shuffle_epi8(m_xv[VS2REG], vec_shuf_inverse[EL]);
-
- INSERT16(m_xv[VDREG], (INT16)(m_reciprocal_res >> 16), VS1REG);
-}
-
-static void cfunc_vrcph(void *param)
-{
- ((rsp_cop2 *)param)->vrcph();
-}
-
-
-// VMOV
-//
-// 31 25 24 20 15 10 5 0
-// ------------------------------------------------------
-// | 010010 | 1 | EEEE | SSSSS | ?FFFF | DDDDD | 110011 |
-// ------------------------------------------------------
-//
-// Moves element from vector to destination vector
-
-inline void rsp_cop2_simd::vmov()
-{
- int op = m_op;
-
- INT16 val;
- EXTRACT16(m_xv[VS2REG], val, EL);
- INSERT16(m_xv[VDREG], val, VS1REG);
- m_accum_l = _mm_shuffle_epi8(m_xv[VS2REG], vec_shuf_inverse[EL]);
-}
-
-static void cfunc_vmov(void *param)
-{
- ((rsp_cop2 *)param)->vmov();
-}
-
-
-// VRSQ
-//
-// 31 25 24 20 15 10 5 0
-// ------------------------------------------------------
-// | 010010 | 1 | EEEE | SSSSS | ?FFFF | DDDDD | 110100 |
-// ------------------------------------------------------
-//
-// Calculates reciprocal square-root
-
-inline void rsp_cop2_simd::vrsq()
-{
- int op = m_op;
-
- INT32 shifter = 0;
- INT32 rec = (INT16)VREG_S(VS2REG, EL & 7);
- INT32 datainput = (rec < 0) ? (-rec) : (rec);
-
- if (rec < 0)
- {
- if (rec < -32768)
- {
- datainput = ~datainput;
- }
- else
- {
- datainput = -datainput;
- }
- }
-
- if (datainput)
- {
- for (int i = 0; i < 32; i++)
- {
- if (datainput & (1 << ((~i) & 0x1f)))
- {
- shifter = i;
- break;
- }
- }
- }
- else
- {
- shifter = 0;
- }
-
- INT32 address = ((datainput << shifter) & 0x7fc00000) >> 22;
- address = ((address | 0x200) & 0x3fe) | (shifter & 1);
-
- INT32 fetchval = rsp_divtable[address];
- INT32 temp = (0x40000000 | (fetchval << 14)) >> (((~shifter) & 0x1f) >> 1);
- if (rec < 0)
- {
- temp = ~temp;
- }
- if (!rec)
- {
- temp = 0x7fffffff;
- }
- else if (rec == 0xffff8000)
- {
- temp = 0xffff0000;
- }
- rec = temp;
-
- if (rec < 0)
- {
- if (m_dp_allowed)
- {
- if (rec < -32768)
- {
- datainput = ~datainput;
- }
- else
- {
- datainput = -datainput;
- }
- }
- else
- {
- datainput = -datainput;
- }
- }
-
- if (datainput)
- {
- for (int i = 0; i < 32; i++)
- {
- if (datainput & (1 << ((~i) & 0x1f)))
- {
- shifter = i;
- break;
- }
- }
- }
- else
- {
- shifter = 0;
- }
-
- address = ((datainput << shifter) & 0x7fc00000) >> 22;
- address = ((address | 0x200) & 0x3fe) | (shifter & 1);
-
- fetchval = rsp_divtable[address];
- temp = (0x40000000 | (fetchval << 14)) >> (((~shifter) & 0x1f) >> 1);
- if (rec < 0)
- {
- temp = ~temp;
- }
- if (!rec)
- {
- temp = 0x7fff;
- }
- else if (rec == 0xffff8000)
- {
- temp = 0x0000;
- }
- rec = temp;
-
- W_VREG_S(VDREG, VS1REG & 7) = (UINT16)rec;
- for (int i = 0; i < 8; i++)
- {
- SET_ACCUM_L(VREG_S(VS2REG, VEC_EL_2(EL, i)), i);
- }
-}
-
-static void cfunc_vrsq(void *param)
-{
- ((rsp_cop2 *)param)->vrsq();
-}
-
-
-// VRSQL
-//
-// 31 25 24 20 15 10 5 0
-// ------------------------------------------------------
-// | 010010 | 1 | EEEE | SSSSS | ?FFFF | DDDDD | 110101 |
-// ------------------------------------------------------
-//
-// Calculates reciprocal square-root low part
-
-inline void rsp_cop2_simd::vrsql()
-{
- int op = m_op;
-
-#if SIMUL_SIMD
- m_old_reciprocal_res = m_reciprocal_res;
- m_old_reciprocal_high = m_reciprocal_high;
- m_old_dp_allowed = m_dp_allowed;
-#endif
-
- INT32 shifter = 0;
- UINT16 val;
- EXTRACT16(m_xv[VS2REG], val, EL);
- INT32 rec = (INT16)val;
- INT32 datainput = rec;
-
- if (m_dp_allowed)
- {
- rec = (rec & 0x0000ffff) | m_reciprocal_high;
- datainput = rec;
-
- if (rec < 0)
- {
- if (rec < -32768)
- {
- datainput = ~datainput;
- }
- else
- {
- datainput = -datainput;
- }
- }
- }
- else if (datainput < 0)
- {
- datainput = -datainput;
-
- shifter = 0x10;
- }
-
- if (datainput)
- {
- for (int i = 0; i < 32; i++)
- {
- if (datainput & (1 << ((~i) & 0x1f)))
- {
- shifter = i;
- break;
- }
- }
- }
-
- INT32 address = ((datainput << shifter) & 0x7fc00000) >> 22;
- address = ((address | 0x200) & 0x3fe) | (shifter & 1);
-
- INT32 fetchval = rsp_divtable[address];
- INT32 temp = (0x40000000 | (fetchval << 14)) >> (((~shifter) & 0x1f) >> 1);
- temp ^= rec >> 31;
-
- if (!rec)
- {
- temp = 0x7fffffff;
- }
- else if (rec == 0xffff8000)
- {
- temp = 0xffff0000;
- }
- rec = temp;
-
- m_reciprocal_res = rec;
- m_dp_allowed = 0;
-
- INSERT16(m_xv[VDREG], (UINT16)rec, VS1REG);
- m_accum_l = _mm_shuffle_epi8(m_xv[VS2REG], vec_shuf_inverse[EL]);
-}
-
-static void cfunc_vrsql(void *param)
-{
- ((rsp_cop2 *)param)->vrsql();
-}
-
-
-// VRSQH
-//
-// 31 25 24 20 15 10 5 0
-// ------------------------------------------------------
-// | 010010 | 1 | EEEE | SSSSS | ?FFFF | DDDDD | 110110 |
-// ------------------------------------------------------
-//
-// Calculates reciprocal square-root high part
-
-inline void rsp_cop2_simd::vrsqh()
-{
- int op = m_op;
-
-#if SIMUL_SIMD
- m_old_reciprocal_res = m_reciprocal_res;
- m_old_reciprocal_high = m_reciprocal_high;
- m_old_dp_allowed = m_dp_allowed;
-#endif
-
- UINT16 val;
- EXTRACT16(m_xv[VS2REG], val, EL);
- m_reciprocal_high = val << 16;
- m_dp_allowed = 1;
-
- m_accum_l = _mm_shuffle_epi8(m_xv[VS2REG], vec_shuf_inverse[EL]);
-
- INSERT16(m_xv[VDREG], (INT16)(m_reciprocal_res >> 16), VS1REG); // store high part
-}
-
-static void cfunc_vrsqh(void *param)
-{
- ((rsp_cop2 *)param)->vrsqh();
-}
-
-
-/***************************************************************************
- Vector Flag Reading/Writing
-***************************************************************************/
-
-inline void rsp_cop2_simd::mfc2()
-{
- UINT32 op = m_op;
- int el = (op >> 7) & 0xf;
-
- UINT16 out;
- EXTRACT16(m_xv[VS1REG], out, (el >> 1));
- out >>= (1 - (el & 1)) * 8;
- out &= 0x00ff;
-
- el++;
-
- UINT16 temp;
- EXTRACT16(m_xv[VS1REG], temp, (el >> 1));
- temp >>= (1 - (el & 1)) * 8;
- temp &= 0x00ff;
-
- m_rsp.m_rsp_state->r[RTREG] = (INT32)(INT16)((out << 8) | temp);
-}
-
-static void cfunc_mfc2(void *param)
-{
- ((rsp_cop2 *)param)->mfc2();
-}
-
-
-inline void rsp_cop2_simd::cfc2()
-{
- UINT32 op = m_op;
- if (RTREG)
- {
- switch(RDREG)
- {
- case 0:
- RTVAL = ((CARRY_FLAG(0) & 1) << 0) |
- ((CARRY_FLAG(1) & 1) << 1) |
- ((CARRY_FLAG(2) & 1) << 2) |
- ((CARRY_FLAG(3) & 1) << 3) |
- ((CARRY_FLAG(4) & 1) << 4) |
- ((CARRY_FLAG(5) & 1) << 5) |
- ((CARRY_FLAG(6) & 1) << 6) |
- ((CARRY_FLAG(7) & 1) << 7) |
- ((ZERO_FLAG(0) & 1) << 8) |
- ((ZERO_FLAG(1) & 1) << 9) |
- ((ZERO_FLAG(2) & 1) << 10) |
- ((ZERO_FLAG(3) & 1) << 11) |
- ((ZERO_FLAG(4) & 1) << 12) |
- ((ZERO_FLAG(5) & 1) << 13) |
- ((ZERO_FLAG(6) & 1) << 14) |
- ((ZERO_FLAG(7) & 1) << 15);
- if (RTVAL & 0x8000) RTVAL |= 0xffff0000;
- break;
- case 1:
- RTVAL = ((COMPARE_FLAG(0) & 1) << 0) |
- ((COMPARE_FLAG(1) & 1) << 1) |
- ((COMPARE_FLAG(2) & 1) << 2) |
- ((COMPARE_FLAG(3) & 1) << 3) |
- ((COMPARE_FLAG(4) & 1) << 4) |
- ((COMPARE_FLAG(5) & 1) << 5) |
- ((COMPARE_FLAG(6) & 1) << 6) |
- ((COMPARE_FLAG(7) & 1) << 7) |
- ((CLIP2_FLAG(0) & 1) << 8) |
- ((CLIP2_FLAG(1) & 1) << 9) |
- ((CLIP2_FLAG(2) & 1) << 10) |
- ((CLIP2_FLAG(3) & 1) << 11) |
- ((CLIP2_FLAG(4) & 1) << 12) |
- ((CLIP2_FLAG(5) & 1) << 13) |
- ((CLIP2_FLAG(6) & 1) << 14) |
- ((CLIP2_FLAG(7) & 1) << 15);
- if (RTVAL & 0x8000) RTVAL |= 0xffff0000;
- break;
- case 2:
- RTVAL = ((CLIP1_FLAG(0) & 1) << 0) |
- ((CLIP1_FLAG(1) & 1) << 1) |
- ((CLIP1_FLAG(2) & 1) << 2) |
- ((CLIP1_FLAG(3) & 1) << 3) |
- ((CLIP1_FLAG(4) & 1) << 4) |
- ((CLIP1_FLAG(5) & 1) << 5) |
- ((CLIP1_FLAG(6) & 1) << 6) |
- ((CLIP1_FLAG(7) & 1) << 7);
- break;
- }
- }
-}
-
-static void cfunc_cfc2(void *param)
-{
- ((rsp_cop2 *)param)->cfc2();
-}
-
-
-inline void rsp_cop2_simd::mtc2()
-{
- UINT32 op = m_op;
- int el = (op >> 7) & 0xf;
- INSERT16(m_xv[VS1REG], RTVAL, el >> 1);
-}
-
-static void cfunc_mtc2(void *param)
-{
- ((rsp_cop2 *)param)->mtc2();
-}
-
-
-inline void rsp_cop2_simd::ctc2()
-{
- UINT32 op = m_op;
- switch(RDREG)
- {
- case 0:
- CLEAR_CARRY_FLAGS();
- CLEAR_ZERO_FLAGS();
- m_vflag[0][0] = ((RTVAL >> 0) & 1) ? 0xffff : 0;
- m_vflag[0][1] = ((RTVAL >> 1) & 1) ? 0xffff : 0;
- m_vflag[0][2] = ((RTVAL >> 2) & 1) ? 0xffff : 0;
- m_vflag[0][3] = ((RTVAL >> 3) & 1) ? 0xffff : 0;
- m_vflag[0][4] = ((RTVAL >> 4) & 1) ? 0xffff : 0;
- m_vflag[0][5] = ((RTVAL >> 5) & 1) ? 0xffff : 0;
- m_vflag[0][6] = ((RTVAL >> 6) & 1) ? 0xffff : 0;
- m_vflag[0][7] = ((RTVAL >> 7) & 1) ? 0xffff : 0;
- if (RTVAL & (1 << 0)) { SET_CARRY_FLAG(0); }
- if (RTVAL & (1 << 1)) { SET_CARRY_FLAG(1); }
- if (RTVAL & (1 << 2)) { SET_CARRY_FLAG(2); }
- if (RTVAL & (1 << 3)) { SET_CARRY_FLAG(3); }
- if (RTVAL & (1 << 4)) { SET_CARRY_FLAG(4); }
- if (RTVAL & (1 << 5)) { SET_CARRY_FLAG(5); }
- if (RTVAL & (1 << 6)) { SET_CARRY_FLAG(6); }
- if (RTVAL & (1 << 7)) { SET_CARRY_FLAG(7); }
- m_vflag[3][0] = ((RTVAL >> 8) & 1) ? 0xffff : 0;
- m_vflag[3][1] = ((RTVAL >> 9) & 1) ? 0xffff : 0;
- m_vflag[3][2] = ((RTVAL >> 10) & 1) ? 0xffff : 0;
- m_vflag[3][3] = ((RTVAL >> 11) & 1) ? 0xffff : 0;
- m_vflag[3][4] = ((RTVAL >> 12) & 1) ? 0xffff : 0;
- m_vflag[3][5] = ((RTVAL >> 13) & 1) ? 0xffff : 0;
- m_vflag[3][6] = ((RTVAL >> 14) & 1) ? 0xffff : 0;
- m_vflag[3][7] = ((RTVAL >> 15) & 1) ? 0xffff : 0;
- if (RTVAL & (1 << 8)) { SET_ZERO_FLAG(0); }
- if (RTVAL & (1 << 9)) { SET_ZERO_FLAG(1); }
- if (RTVAL & (1 << 10)) { SET_ZERO_FLAG(2); }
- if (RTVAL & (1 << 11)) { SET_ZERO_FLAG(3); }
- if (RTVAL & (1 << 12)) { SET_ZERO_FLAG(4); }
- if (RTVAL & (1 << 13)) { SET_ZERO_FLAG(5); }
- if (RTVAL & (1 << 14)) { SET_ZERO_FLAG(6); }
- if (RTVAL & (1 << 15)) { SET_ZERO_FLAG(7); }
- break;
- case 1:
- CLEAR_COMPARE_FLAGS();
- CLEAR_CLIP2_FLAGS();
- m_vflag[1][0] = ((RTVAL >> 0) & 1) ? 0xffff : 0;
- m_vflag[1][1] = ((RTVAL >> 1) & 1) ? 0xffff : 0;
- m_vflag[1][2] = ((RTVAL >> 2) & 1) ? 0xffff : 0;
- m_vflag[1][3] = ((RTVAL >> 3) & 1) ? 0xffff : 0;
- m_vflag[1][4] = ((RTVAL >> 4) & 1) ? 0xffff : 0;
- m_vflag[1][5] = ((RTVAL >> 5) & 1) ? 0xffff : 0;
- m_vflag[1][6] = ((RTVAL >> 6) & 1) ? 0xffff : 0;
- m_vflag[1][7] = ((RTVAL >> 7) & 1) ? 0xffff : 0;
- if (RTVAL & (1 << 0)) { SET_COMPARE_FLAG(0); }
- if (RTVAL & (1 << 1)) { SET_COMPARE_FLAG(1); }
- if (RTVAL & (1 << 2)) { SET_COMPARE_FLAG(2); }
- if (RTVAL & (1 << 3)) { SET_COMPARE_FLAG(3); }
- if (RTVAL & (1 << 4)) { SET_COMPARE_FLAG(4); }
- if (RTVAL & (1 << 5)) { SET_COMPARE_FLAG(5); }
- if (RTVAL & (1 << 6)) { SET_COMPARE_FLAG(6); }
- if (RTVAL & (1 << 7)) { SET_COMPARE_FLAG(7); }
- m_vflag[4][0] = ((RTVAL >> 8) & 1) ? 0xffff : 0;
- m_vflag[4][1] = ((RTVAL >> 9) & 1) ? 0xffff : 0;
- m_vflag[4][2] = ((RTVAL >> 10) & 1) ? 0xffff : 0;
- m_vflag[4][3] = ((RTVAL >> 11) & 1) ? 0xffff : 0;
- m_vflag[4][4] = ((RTVAL >> 12) & 1) ? 0xffff : 0;
- m_vflag[4][5] = ((RTVAL >> 13) & 1) ? 0xffff : 0;
- m_vflag[4][6] = ((RTVAL >> 14) & 1) ? 0xffff : 0;
- m_vflag[4][7] = ((RTVAL >> 15) & 1) ? 0xffff : 0;
- if (RTVAL & (1 << 8)) { SET_CLIP2_FLAG(0); }
- if (RTVAL & (1 << 9)) { SET_CLIP2_FLAG(1); }
- if (RTVAL & (1 << 10)) { SET_CLIP2_FLAG(2); }
- if (RTVAL & (1 << 11)) { SET_CLIP2_FLAG(3); }
- if (RTVAL & (1 << 12)) { SET_CLIP2_FLAG(4); }
- if (RTVAL & (1 << 13)) { SET_CLIP2_FLAG(5); }
- if (RTVAL & (1 << 14)) { SET_CLIP2_FLAG(6); }
- if (RTVAL & (1 << 15)) { SET_CLIP2_FLAG(7); }
- break;
- case 2:
- CLEAR_CLIP1_FLAGS();
- m_vflag[2][0] = ((RTVAL >> 0) & 1) ? 0xffff : 0;
- m_vflag[2][1] = ((RTVAL >> 1) & 1) ? 0xffff : 0;
- m_vflag[2][2] = ((RTVAL >> 2) & 1) ? 0xffff : 0;
- m_vflag[2][3] = ((RTVAL >> 3) & 1) ? 0xffff : 0;
- m_vflag[2][4] = ((RTVAL >> 4) & 1) ? 0xffff : 0;
- m_vflag[2][5] = ((RTVAL >> 5) & 1) ? 0xffff : 0;
- m_vflag[2][6] = ((RTVAL >> 6) & 1) ? 0xffff : 0;
- m_vflag[2][7] = ((RTVAL >> 7) & 1) ? 0xffff : 0;
- if (RTVAL & (1 << 0)) { SET_CLIP1_FLAG(0); }
- if (RTVAL & (1 << 1)) { SET_CLIP1_FLAG(1); }
- if (RTVAL & (1 << 2)) { SET_CLIP1_FLAG(2); }
- if (RTVAL & (1 << 3)) { SET_CLIP1_FLAG(3); }
- if (RTVAL & (1 << 4)) { SET_CLIP1_FLAG(4); }
- if (RTVAL & (1 << 5)) { SET_CLIP1_FLAG(5); }
- if (RTVAL & (1 << 6)) { SET_CLIP1_FLAG(6); }
- if (RTVAL & (1 << 7)) { SET_CLIP1_FLAG(7); }
- break;
- }
-}
-
-static void cfunc_ctc2(void *param)
-{
- ((rsp_cop2 *)param)->ctc2();
-}
-
-
-/***************************************************************************
- COP2 Opcode Compilation
-***************************************************************************/
-
-int rsp_cop2_simd::generate_cop2(drcuml_block *block, rsp_device::compiler_state *compiler, const opcode_desc *desc)
-{
- UINT32 op = desc->opptr.l[0];
- UINT8 opswitch = RSREG;
-
- switch (opswitch)
- {
- case 0x00: /* MFCz */
- if (RTREG != 0)
- {
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
- UML_CALLC(block, cfunc_mfc2, this); // callc mfc2
- }
- return TRUE;
-
- case 0x02: /* CFCz */
- if (RTREG != 0)
- {
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
- UML_CALLC(block, cfunc_cfc2, this); // callc cfc2
- }
- return TRUE;
-
- case 0x04: /* MTCz */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
- UML_CALLC(block, cfunc_mtc2, this); // callc mtc2
- return TRUE;
-
- case 0x06: /* CTCz */
- UML_MOV(block, mem(&m_op), desc->opptr.l[0]); // mov [arg0],desc->opptr.l
- UML_CALLC(block, cfunc_ctc2, this); // callc ctc2
- return TRUE;
-
- case 0x10: case 0x11: case 0x12: case 0x13: case 0x14: case 0x15: case 0x16: case 0x17:
- case 0x18: case 0x19: case 0x1a: case 0x1b: case 0x1c: case 0x1d: case 0x1e: case 0x1f:
- return generate_vector_opcode(block, compiler, desc);
- }
- return FALSE;
-}
diff --git a/src/emu/cpu/rsp/rspcp2s.h b/src/emu/cpu/rsp/rspcp2s.h
deleted file mode 100644
index b9ad85fbf54..00000000000
--- a/src/emu/cpu/rsp/rspcp2s.h
+++ /dev/null
@@ -1,156 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Ryan Holtz
-/***************************************************************************
-
- rspcp2s.h
-
- Interface file for Reality Signal Processor (RSP) vector extensions
- using SSSE3 SIMD acceleration.
-
-***************************************************************************/
-
-#pragma once
-
-#ifndef __RSPCP2S_H__
-#define __RSPCP2S_H__
-
-#include "cpu/drcuml.h"
-#include "rsp.h"
-#include "rspcp2.h"
-
-#include <tmmintrin.h>
-
-class rsp_cop2_simd : public rsp_cop2_drc
-{
- friend class rsp_device;
-
- rsp_cop2_simd(rsp_device &rsp, running_machine &machine);
-
- virtual int generate_cop2(drcuml_block *block, rsp_device::compiler_state *compiler, const opcode_desc *desc);
- virtual int generate_lwc2(drcuml_block *block, rsp_device::compiler_state *compiler, const opcode_desc *desc);
- virtual int generate_swc2(drcuml_block *block, rsp_device::compiler_state *compiler, const opcode_desc *desc);
-
- virtual void state_string_export(const int index, std::string &str);
-
-public:
- virtual void lbv();
- virtual void lsv();
- virtual void llv();
- virtual void ldv();
- virtual void lqv();
- virtual void lrv();
- virtual void lpv();
- virtual void luv();
- virtual void lhv();
- virtual void lfv();
- virtual void lwv();
- virtual void ltv();
- virtual void sbv();
- virtual void ssv();
- virtual void slv();
- virtual void sdv();
- virtual void sqv();
- virtual void srv();
- virtual void spv();
- virtual void suv();
- virtual void shv();
- virtual void sfv();
- virtual void swv();
- virtual void stv();
- virtual void vmulf();
- virtual void vmulu();
- virtual void vmudl();
- virtual void vmudm();
- virtual void vmudn();
- virtual void vmudh();
- virtual void vmacf();
- virtual void vmacu();
- virtual void vmadl();
- virtual void vmadm();
- virtual void vmadn();
- virtual void vmadh();
- virtual void vadd();
- virtual void vsub();
- virtual void vabs();
- virtual void vaddc();
- virtual void vsubc();
- virtual void vaddb();
- virtual void vsaw();
- virtual void vlt();
- virtual void veq();
- virtual void vne();
- virtual void vge();
- virtual void vcl();
- virtual void vch();
- virtual void vcr();
- virtual void vmrg();
- virtual void vand();
- virtual void vnand();
- virtual void vor();
- virtual void vnor();
- virtual void vxor();
- virtual void vnxor();
- virtual void vrcp();
- virtual void vrcpl();
- virtual void vrcph();
- virtual void vmov();
- virtual void vrsql();
- virtual void vrsqh();
- virtual void vrsq();
- virtual void mfc2();
- virtual void cfc2();
- virtual void mtc2();
- virtual void ctc2();
-
-#if SIMUL_SIMD
- void backup_regs();
- void restore_regs();
- void verify_regs();
-#endif
-
-private:
- virtual int generate_vector_opcode(drcuml_block *block, rsp_device::compiler_state *compiler, const opcode_desc *desc);
-
- UINT16 ACCUM_H(int x);
- UINT16 ACCUM_M(int x);
- UINT16 ACCUM_L(int x);
- UINT16 ACCUM_LL(int x);
- UINT16 CARRY_FLAG(const int x);
- UINT16 COMPARE_FLAG(const int x);
- UINT16 CLIP1_FLAG(const int x);
- UINT16 ZERO_FLAG(const int x);
- UINT16 CLIP2_FLAG(const int x);
- UINT16 SATURATE_ACCUM(int accum, int slice, UINT16 negative, UINT16 positive);
-
- __m128i m_accum_h;
- __m128i m_accum_m;
- __m128i m_accum_l;
- __m128i m_accum_ll;
-
- // Mirror of v[] for now, to be used in parallel as
- // more vector ops are transitioned over
- __m128i m_xv[32];
- __m128i m_xvflag[6];
-
-#if SIMUL_SIMD
- UINT32 m_old_r[35];
- UINT8 m_old_dmem[4096];
-
- UINT32 m_scalar_r[35];
- UINT8 m_scalar_dmem[4096];
-
- INT32 m_old_reciprocal_res;
- UINT32 m_old_reciprocal_high;
- INT32 m_old_dp_allowed;
-
- INT32 m_scalar_reciprocal_res;
- UINT32 m_scalar_reciprocal_high;
- INT32 m_scalar_dp_allowed;
-
- INT32 m_simd_reciprocal_res;
- UINT32 m_simd_reciprocal_high;
- INT32 m_simd_dp_allowed;
-#endif
-};
-
-#endif /* __RSPCP2S_H__ */
diff --git a/src/emu/cpu/rsp/rspdrc.c b/src/emu/cpu/rsp/rspdrc.c
index e30bad904ec..ae719af5959 100644
--- a/src/emu/cpu/rsp/rspdrc.c
+++ b/src/emu/cpu/rsp/rspdrc.c
@@ -21,7 +21,6 @@
#include "emu.h"
#include "debugger.h"
#include "rsp.h"
-#include "rspdiv.h"
#include "rspfe.h"
#include "rspcp2.h"
#include "cpu/drcfe.h"
@@ -184,7 +183,7 @@ static void cfunc_write32(void *param)
void rsp_device::rspdrc_set_options(UINT32 options)
{
- if (!machine().options().drc()) return;
+ if (!(mconfig().options().drc() && !mconfig().m_force_no_drc)) return;
m_drcoptions = options;
}
@@ -308,7 +307,7 @@ void rsp_device::execute_run_drc()
void rsp_device::rspdrc_flush_drc_cache()
{
- if (!machine().options().drc()) return;
+ if (!(mconfig().options().drc() && !mconfig().m_force_no_drc)) return;
m_cache_dirty = TRUE;
}
@@ -669,12 +668,12 @@ void rsp_device::generate_checksum_block(drcuml_block *block, compiler_state *co
if (!(seqhead->flags & OPFLAG_VIRTUAL_NOOP))
{
UINT32 sum = seqhead->opptr.l[0];
- void *base = m_direct->read_decrypted_ptr(seqhead->physpc | 0x1000);
+ void *base = m_direct->read_ptr(seqhead->physpc | 0x1000);
UML_LOAD(block, I0, base, 0, SIZE_DWORD, SCALE_x4); // load i0,base,0,dword
if (seqhead->delay.first() != NULL && seqhead->physpc != seqhead->delay.first()->physpc)
{
- base = m_direct->read_decrypted_ptr(seqhead->delay.first()->physpc | 0x1000);
+ base = m_direct->read_ptr(seqhead->delay.first()->physpc | 0x1000);
assert(base != NULL);
UML_LOAD(block, I1, base, 0, SIZE_DWORD, SCALE_x4); // load i1,base,dword
UML_ADD(block, I0, I0, I1); // add i0,i0,i1
@@ -691,13 +690,13 @@ void rsp_device::generate_checksum_block(drcuml_block *block, compiler_state *co
else
{
UINT32 sum = 0;
- void *base = m_direct->read_decrypted_ptr(seqhead->physpc | 0x1000);
+ void *base = m_direct->read_ptr(seqhead->physpc | 0x1000);
UML_LOAD(block, I0, base, 0, SIZE_DWORD, SCALE_x4); // load i0,base,0,dword
sum += seqhead->opptr.l[0];
for (curdesc = seqhead->next(); curdesc != seqlast->next(); curdesc = curdesc->next())
if (!(curdesc->flags & OPFLAG_VIRTUAL_NOOP))
{
- base = m_direct->read_decrypted_ptr(curdesc->physpc | 0x1000);
+ base = m_direct->read_ptr(curdesc->physpc | 0x1000);
assert(base != NULL);
UML_LOAD(block, I1, base, 0, SIZE_DWORD, SCALE_x4); // load i1,base,dword
UML_ADD(block, I0, I0, I1); // add i0,i0,i1
@@ -705,7 +704,7 @@ void rsp_device::generate_checksum_block(drcuml_block *block, compiler_state *co
if (curdesc->delay.first() != NULL && (curdesc == seqlast || (curdesc->next() != NULL && curdesc->next()->physpc != curdesc->delay.first()->physpc)))
{
- base = m_direct->read_decrypted_ptr(curdesc->delay.first()->physpc | 0x1000);
+ base = m_direct->read_ptr(curdesc->delay.first()->physpc | 0x1000);
assert(base != NULL);
UML_LOAD(block, I1, base, 0, SIZE_DWORD, SCALE_x4); // load i1,base,dword
UML_ADD(block, I0, I0, I1); // add i0,i0,i1
diff --git a/src/emu/cpu/rsp/rspfe.c b/src/emu/cpu/rsp/rspfe.c
index 96291bd0d65..7a80fb6347b 100644
--- a/src/emu/cpu/rsp/rspfe.c
+++ b/src/emu/cpu/rsp/rspfe.c
@@ -37,7 +37,7 @@ bool rsp_frontend::describe(opcode_desc &desc, const opcode_desc *prev)
UINT32 op, opswitch;
// fetch the opcode
- op = desc.opptr.l[0] = m_rsp.m_direct->read_decrypted_dword(desc.physpc | 0x1000);
+ op = desc.opptr.l[0] = m_rsp.m_direct->read_dword(desc.physpc | 0x1000);
// all instructions are 4 bytes and default to a single cycle each
desc.length = 4;
diff --git a/src/emu/cpu/rsp/vabs.h b/src/emu/cpu/rsp/vabs.h
new file mode 100644
index 00000000000..273841b9610
--- /dev/null
+++ b/src/emu/cpu/rsp/vabs.h
@@ -0,0 +1,15 @@
+// license:BSD-3-Clause
+// copyright-holders:Tyler J. Stachecki,Ryan Holtz
+
+inline rsp_vec_t vec_vabs(rsp_vec_t vs, rsp_vec_t vt, rsp_vec_t zero, rsp_vec_t *acc_lo)
+{
+ rsp_vec_t vs_zero = _mm_cmpeq_epi16(vs, zero);
+ rsp_vec_t sign_lt = _mm_srai_epi16(vs, 15);
+ rsp_vec_t vd = _mm_andnot_si128(vs_zero, vt);
+
+ // Careful: if VT = 0x8000 and VS is negative,
+ // acc_lo will be 0x8000 but vd will be 0x7FFF.
+ vd = _mm_xor_si128(vd, sign_lt);
+ *acc_lo = _mm_sub_epi16(vd, sign_lt);
+ return _mm_subs_epi16(vd, sign_lt);
+}
diff --git a/src/emu/cpu/rsp/vadd.h b/src/emu/cpu/rsp/vadd.h
new file mode 100644
index 00000000000..33b21fd7312
--- /dev/null
+++ b/src/emu/cpu/rsp/vadd.h
@@ -0,0 +1,17 @@
+// license:BSD-3-Clause
+// copyright-holders:Tyler J. Stachecki,Ryan Holtz
+
+inline rsp_vec_t vec_vadd(rsp_vec_t vs, rsp_vec_t vt, rsp_vec_t carry, rsp_vec_t *acc_lo)
+{
+ // VCC uses unsaturated arithmetic.
+ rsp_vec_t vd = _mm_add_epi16(vs, vt);
+ *acc_lo = _mm_sub_epi16(vd, carry);
+
+ // VD is the signed sum of the two sources and the carry. Since we
+ // have to saturate the sum of all three, we have to be clever.
+ rsp_vec_t minimum = _mm_min_epi16(vs, vt);
+ rsp_vec_t maximum = _mm_max_epi16(vs, vt);
+ minimum = _mm_subs_epi16(minimum, carry);
+ return _mm_adds_epi16(minimum, maximum);
+}
+
diff --git a/src/emu/cpu/rsp/vaddc.h b/src/emu/cpu/rsp/vaddc.h
new file mode 100644
index 00000000000..0ebd30cbd31
--- /dev/null
+++ b/src/emu/cpu/rsp/vaddc.h
@@ -0,0 +1,13 @@
+// license:BSD-3-Clause
+// copyright-holders:Tyler J. Stachecki,Ryan Holtz
+
+inline rsp_vec_t vec_vaddc(rsp_vec_t vs, rsp_vec_t vt, rsp_vec_t zero, rsp_vec_t *sn)
+{
+ rsp_vec_t sat_sum = _mm_adds_epu16(vs, vt);
+ rsp_vec_t unsat_sum = _mm_add_epi16(vs, vt);
+
+ *sn = _mm_cmpeq_epi16(sat_sum, unsat_sum);
+ *sn = _mm_cmpeq_epi16(*sn, zero);
+
+ return unsat_sum;
+}
diff --git a/src/emu/cpu/rsp/vand.h b/src/emu/cpu/rsp/vand.h
new file mode 100644
index 00000000000..4349227fdd3
--- /dev/null
+++ b/src/emu/cpu/rsp/vand.h
@@ -0,0 +1,9 @@
+// license:BSD-3-Clause
+// copyright-holders:Tyler J. Stachecki,Ryan Holtz
+
+inline rsp_vec_t vec_vand_vnand(UINT32 iw, rsp_vec_t vs, rsp_vec_t vt) {
+ rsp_vec_t vmask = _mm_load_si128((rsp_vec_t *) m_vec_helpers.logic_mask[iw & 0x1]);
+
+ rsp_vec_t vd = _mm_and_si128(vs, vt);
+ return _mm_xor_si128(vd, vmask);
+}
diff --git a/src/emu/cpu/rsp/vch.h b/src/emu/cpu/rsp/vch.h
new file mode 100644
index 00000000000..6abac437a2c
--- /dev/null
+++ b/src/emu/cpu/rsp/vch.h
@@ -0,0 +1,57 @@
+// license:BSD-3-Clause
+// copyright-holders:Tyler J. Stachecki,Ryan Holtz
+
+inline rsp_vec_t vec_vch(rsp_vec_t vs, rsp_vec_t vt, rsp_vec_t zero, rsp_vec_t *ge, rsp_vec_t *le, rsp_vec_t *eq, rsp_vec_t *sign, rsp_vec_t *vce) {
+ // sign = (vs ^ vt) < 0
+ *sign = _mm_xor_si128(vs, vt);
+ *sign = _mm_cmplt_epi16(*sign, zero);
+
+ // sign_negvt = sign ? -vt : vt
+ rsp_vec_t sign_negvt = _mm_xor_si128(vt, *sign);
+ sign_negvt = _mm_sub_epi16(sign_negvt, *sign);
+
+ // Compute diff, diff_zero:
+ rsp_vec_t diff = _mm_sub_epi16(vs, sign_negvt);
+ rsp_vec_t diff_zero = _mm_cmpeq_epi16(diff, zero);
+
+ // Compute le/ge:
+ rsp_vec_t vt_neg = _mm_cmplt_epi16(vt, zero);
+ rsp_vec_t diff_lez = _mm_cmpgt_epi16(diff, zero);
+ rsp_vec_t diff_gez = _mm_or_si128(diff_lez, diff_zero);
+ diff_lez = _mm_cmpeq_epi16(zero, diff_lez);
+
+#if (defined(__SSE4_1__) || defined(_MSC_VER))
+ *ge = _mm_blendv_epi8(diff_gez, vt_neg, *sign);
+ *le = _mm_blendv_epi8(vt_neg, diff_lez, *sign);
+#else
+ *ge = _mm_and_si128(*sign, vt_neg);
+ diff_gez = _mm_andnot_si128(*sign, diff_gez);
+ *ge = _mm_or_si128(*ge, diff_gez);
+
+ *le = _mm_and_si128(*sign, diff_lez);
+ diff_lez = _mm_andnot_si128(*sign, vt_neg);
+ *le = _mm_or_si128(*le, diff_lez);
+#endif
+
+ // Compute vce:
+ *vce = _mm_cmpeq_epi16(diff, *sign);
+ *vce = _mm_and_si128(*vce, *sign);
+
+ // Compute !eq:
+ *eq = _mm_or_si128(diff_zero, *vce);
+ *eq = _mm_cmpeq_epi16(*eq, zero);
+
+ // Compute result:
+#if (defined(__SSE4_1__) || defined(_MSC_VER))
+ rsp_vec_t diff_sel_mask = _mm_blendv_epi8(*ge, *le, *sign);
+ return _mm_blendv_epi8(vs, sign_negvt, diff_sel_mask);
+#else
+ diff_lez = _mm_and_si128(*sign, *le);
+ diff_gez = _mm_andnot_si128(*sign, *ge);
+ rsp_vec_t diff_sel_mask = _mm_or_si128(diff_lez, diff_gez);
+
+ diff_lez = _mm_and_si128(diff_sel_mask, sign_negvt);
+ diff_gez = _mm_andnot_si128(diff_sel_mask, vs);
+ return _mm_or_si128(diff_lez, diff_gez);
+#endif
+}
diff --git a/src/emu/cpu/rsp/vcl.h b/src/emu/cpu/rsp/vcl.h
new file mode 100644
index 00000000000..e82a7fde162
--- /dev/null
+++ b/src/emu/cpu/rsp/vcl.h
@@ -0,0 +1,65 @@
+// license:BSD-3-Clause
+// copyright-holders:Tyler J. Stachecki,Ryan Holtz
+
+inline rsp_vec_t vec_vcl(rsp_vec_t vs, rsp_vec_t vt, rsp_vec_t zero, rsp_vec_t *ge, rsp_vec_t *le, rsp_vec_t eq, rsp_vec_t sign, rsp_vec_t vce)
+{
+ // sign_negvt = sign ? -vt : vt
+ rsp_vec_t sign_negvt = _mm_xor_si128(vt, sign);
+ sign_negvt = _mm_sub_epi16(sign_negvt, sign);
+
+ // Compute diff, diff_zero, ncarry, and nvce:
+ // Note: diff = sign ? (vs + vt) : (vs - vt).
+ rsp_vec_t diff = _mm_sub_epi16(vs, sign_negvt);
+ rsp_vec_t ncarry = _mm_adds_epu16(vs, vt);
+ ncarry = _mm_cmpeq_epi16(diff, ncarry);
+ rsp_vec_t nvce = _mm_cmpeq_epi16(vce, zero);
+ rsp_vec_t diff_zero = _mm_cmpeq_epi16(diff, zero);
+
+ // Compute results for if (sign && ne):
+ rsp_vec_t le_case1 = _mm_and_si128(diff_zero, ncarry);
+ le_case1 = _mm_and_si128(nvce, le_case1);
+ rsp_vec_t le_case2 = _mm_or_si128(diff_zero, ncarry);
+ le_case2 = _mm_and_si128(vce, le_case2);
+ rsp_vec_t le_eq = _mm_or_si128(le_case1, le_case2);
+
+ // Compute results for if (!sign && ne):
+ rsp_vec_t ge_eq = _mm_subs_epu16(vt, vs);
+ ge_eq = _mm_cmpeq_epi16(ge_eq, zero);
+
+ // Blend everything together. Caveat: we don't update
+ // the results of ge/le if ne is false, so be careful.
+ rsp_vec_t do_le = _mm_andnot_si128(eq, sign);
+#if (defined(__SSE4_1__) || defined(_MSC_VER))
+ *le = _mm_blendv_epi8(*le, le_eq, do_le);
+#else
+ le_eq = _mm_and_si128(do_le, le_eq);
+ *le = _mm_andnot_si128(do_le, *le);
+ *le = _mm_or_si128(le_eq, *le);
+#endif
+
+ rsp_vec_t do_ge = _mm_or_si128(sign, eq);
+#if (defined(__SSE4_1__) || defined(_MSC_VER))
+ *ge = _mm_blendv_epi8(ge_eq, *ge, do_ge);
+#else
+ *ge = _mm_and_si128(do_ge, *ge);
+ ge_eq = _mm_andnot_si128(do_ge, ge_eq);
+ *ge = _mm_or_si128(ge_eq, *ge);
+#endif
+
+ // Mux the result based on the value of sign.
+#if (defined(__SSE4_1__) || defined(_MSC_VER))
+ rsp_vec_t mux_mask = _mm_blendv_epi8(*ge, *le, sign);
+#else
+ do_le = _mm_and_si128(sign, *le);
+ do_ge = _mm_andnot_si128(sign, *ge);
+ rsp_vec_t mux_mask = _mm_or_si128(do_le, do_ge);
+#endif
+
+#if (defined(__SSE4_1__) || defined(_MSC_VER))
+ return _mm_blendv_epi8(vs, sign_negvt, mux_mask);
+#else
+ sign_negvt = _mm_and_si128(mux_mask, sign_negvt);
+ vs = _mm_andnot_si128(mux_mask, vs);
+ return _mm_or_si128(sign_negvt, vs);
+#endif
+}
diff --git a/src/emu/cpu/rsp/vcmp.h b/src/emu/cpu/rsp/vcmp.h
new file mode 100644
index 00000000000..7ae4dc4c444
--- /dev/null
+++ b/src/emu/cpu/rsp/vcmp.h
@@ -0,0 +1,49 @@
+// license:BSD-3-Clause
+// copyright-holders:Tyler J. Stachecki,Ryan Holtz
+
+inline rsp_vec_t vec_veq_vge_vlt_vne(UINT32 iw, rsp_vec_t vs, rsp_vec_t vt, rsp_vec_t zero, rsp_vec_t *le, rsp_vec_t eq, rsp_vec_t sign)
+{
+ rsp_vec_t equal = _mm_cmpeq_epi16(vs, vt);
+
+ if (iw & 0x2) // VNE & VGE
+ {
+ if (iw & 0x1) // VGE
+ {
+ rsp_vec_t gt = _mm_cmpgt_epi16(vs, vt);
+ rsp_vec_t equalsign = _mm_and_si128(eq, sign);
+
+ equal = _mm_andnot_si128(equalsign, equal);
+ *le = _mm_or_si128(gt, equal);
+ }
+ else // VNE
+ {
+ rsp_vec_t nequal = _mm_cmpeq_epi16(equal, zero);
+
+ *le = _mm_and_si128(eq, equal);
+ *le = _mm_or_si128(*le, nequal);
+ }
+ }
+ else // VEQ & VLT
+ {
+ if (iw & 0x1) // VEQ
+ {
+ *le = _mm_andnot_si128(eq, equal);
+ }
+ else // VLT
+ {
+ rsp_vec_t lt = _mm_cmplt_epi16(vs, vt);
+
+ equal = _mm_and_si128(eq, equal);
+ equal = _mm_and_si128(sign, equal);
+ *le = _mm_or_si128(lt, equal);
+ }
+ }
+
+#if (defined(__SSE4_1__) || defined(_MSC_VER))
+ return _mm_blendv_epi8(vt, vs, *le);
+#else
+ vs = _mm_and_si128(*le, vs);
+ vt = _mm_andnot_si128(*le, vt);
+ return _mm_or_si128(vs, vt);
+#endif
+}
diff --git a/src/emu/cpu/rsp/vcr.h b/src/emu/cpu/rsp/vcr.h
new file mode 100644
index 00000000000..78f78c66244
--- /dev/null
+++ b/src/emu/cpu/rsp/vcr.h
@@ -0,0 +1,35 @@
+// license:BSD-3-Clause
+// copyright-holders:Tyler J. Stachecki,Ryan Holtz
+
+inline rsp_vec_t vec_vcr(rsp_vec_t vs, rsp_vec_t vt, rsp_vec_t zero, rsp_vec_t *ge, rsp_vec_t *le) {
+ // sign = (vs ^ vt) < 0
+ rsp_vec_t sign = _mm_xor_si128(vs, vt);
+ sign = _mm_srai_epi16(sign, 15);
+
+ // Compute le
+ rsp_vec_t diff_lez = _mm_and_si128(vs, sign);
+ diff_lez = _mm_add_epi16(diff_lez, vt);
+ *le = _mm_srai_epi16(diff_lez, 15);
+
+ // Compute ge
+ rsp_vec_t diff_gez = _mm_or_si128(vs, sign);
+ diff_gez = _mm_min_epi16(diff_gez, vt);
+ *ge = _mm_cmpeq_epi16(diff_gez, vt);
+
+ // sign_notvt = sn ? ~vt : vt
+ rsp_vec_t sign_notvt = _mm_xor_si128(vt, sign);
+
+ // Compute result:
+#if (defined(__SSE4_1__) || defined(_MSC_VER))
+ rsp_vec_t diff_sel_mask = _mm_blendv_epi8(*ge, *le, sign);
+ return _mm_blendv_epi8(vs, sign_notvt, diff_sel_mask);
+#else
+ rsp_vec_t diff_sel_mask = _mm_sub_epi16(*le, *ge);
+ diff_sel_mask = _mm_and_si128(diff_sel_mask, sign);
+ diff_sel_mask = _mm_add_epi16(diff_sel_mask, *ge);
+
+ zero = _mm_sub_epi16(sign_notvt, vs);
+ zero = _mm_and_si128(zero, diff_sel_mask);
+ return _mm_add_epi16(zero, vs);
+#endif
+}
diff --git a/src/emu/cpu/rsp/vdivh.h b/src/emu/cpu/rsp/vdivh.h
new file mode 100644
index 00000000000..286aa8a3ca7
--- /dev/null
+++ b/src/emu/cpu/rsp/vdivh.h
@@ -0,0 +1,12 @@
+// license:BSD-3-Clause
+// copyright-holders:Tyler J. Stachecki,Ryan Holtz
+
+inline rsp_vec_t vec_vdivh(UINT32 src, UINT32 e, UINT32 dest, UINT32 de)
+{
+ // Get the element from VT.
+ m_div_in = m_v[src].s[e & 0x7];
+
+ // Write out the upper part of the result.
+ m_v[dest].s[de & 0x7] = m_div_out;
+ return vec_load_unshuffled_operand(m_v[dest].s);
+}
diff --git a/src/emu/cpu/rsp/vldst.h b/src/emu/cpu/rsp/vldst.h
new file mode 100644
index 00000000000..4a38af029d4
--- /dev/null
+++ b/src/emu/cpu/rsp/vldst.h
@@ -0,0 +1,69 @@
+// license:BSD-3-Clause
+// copyright-holders:Tyler J. Stachecki,Ryan Holtz
+
+// LBV, LDV, LLV, LSV, SBV, SDV, SLV, SSV
+inline void vec_lbdlsv_sbdlsv(UINT32 iw, UINT32 rs)
+{
+ const UINT32 shift_and_idx = (iw >> 11) & 0x3;
+ rsp_vec_t dqm = _mm_loadl_epi64((rsp_vec_t *) (m_vec_helpers.bdls_lut[shift_and_idx]));
+
+ const UINT32 addr = (rs + (sign_extend_6(iw) << shift_and_idx)) & 0xfff;
+ const UINT32 element = (iw >> 7) & 0xf;
+ UINT16* regp = m_v[(iw >> 16) & 0x1f].s;
+
+ if (iw >> 29 & 0x1)
+ {
+ vec_store_group1(addr, element, regp, vec_load_unshuffled_operand(regp), dqm);
+ }
+ else
+ {
+ vec_load_group1(addr, element, regp, vec_load_unshuffled_operand(regp), dqm);
+ }
+}
+
+// LPV, LUV, SPV, SUV
+inline void vec_lfhpuv_sfhpuv(UINT32 iw, UINT32 rs)
+{
+ static const enum rsp_mem_request_type fhpu_type_lut[4] = {
+ RSP_MEM_REQUEST_PACK,
+ RSP_MEM_REQUEST_UPACK,
+ RSP_MEM_REQUEST_HALF,
+ RSP_MEM_REQUEST_FOURTH
+ };
+
+ const UINT32 addr = (rs + (sign_extend_6(iw) << 3)) & 0xfff;
+ const UINT32 element = (iw >> 7) & 0xf;
+ UINT16* regp = m_v[(iw >> 16) & 0x1f].s;
+
+ rsp_mem_request_type request_type = fhpu_type_lut[((iw >> 11) & 0x1f) - 6];
+ if ((iw >> 29) & 0x1)
+ {
+ vec_store_group2(addr, element, regp, vec_load_unshuffled_operand(regp), _mm_setzero_si128(), request_type);
+ }
+ else
+ {
+ vec_load_group2(addr, element, regp, vec_load_unshuffled_operand(regp), _mm_setzero_si128(), request_type);
+ }
+}
+
+// LQV, LRV, SQV, SRV
+inline void vec_lqrv_sqrv(UINT32 iw, UINT32 rs)
+{
+ rs &= 0xfff;
+
+ const UINT32 addr = rs + (sign_extend_6(iw) << 4);
+ const UINT32 element = (iw >> 7) & 0xf;
+ UINT16* regp = m_v[(iw >> 16) & 0x1f].s;
+
+ memcpy(m_vdqm.s, m_vec_helpers.qr_lut[addr & 0xf], sizeof(m_vdqm.s));
+
+ rsp_mem_request_type request_type = (iw >> 11 & 0x1) ? RSP_MEM_REQUEST_REST : RSP_MEM_REQUEST_QUAD;
+ if ((iw >> 29) & 0x1)
+ {
+ vec_store_group4(addr, element, regp, vec_load_unshuffled_operand(regp), vec_load_unshuffled_operand(m_vdqm.s), request_type);
+ }
+ else
+ {
+ vec_load_group4(addr, element, regp, vec_load_unshuffled_operand(regp), vec_load_unshuffled_operand(m_vdqm.s), request_type);
+ }
+}
diff --git a/src/emu/cpu/rsp/vmac.h b/src/emu/cpu/rsp/vmac.h
new file mode 100644
index 00000000000..ecf921a261c
--- /dev/null
+++ b/src/emu/cpu/rsp/vmac.h
@@ -0,0 +1,57 @@
+// license:BSD-3-Clause
+// copyright-holders:Tyler J. Stachecki,Ryan Holtz
+
+inline rsp_vec_t vec_vmacf_vmacu(UINT32 iw, rsp_vec_t vs, rsp_vec_t vt, rsp_vec_t zero, rsp_vec_t *acc_lo, rsp_vec_t *acc_mid, rsp_vec_t *acc_hi)
+{
+ // Get the product and shift it over
+ // being sure to save the carries.
+ rsp_vec_t lo = _mm_mullo_epi16(vs, vt);
+ rsp_vec_t hi = _mm_mulhi_epi16(vs, vt);
+
+ rsp_vec_t mid = _mm_slli_epi16(hi, 1);
+ rsp_vec_t carry = _mm_srli_epi16(lo, 15);
+ hi = _mm_srai_epi16(hi, 15);
+ mid = _mm_or_si128(mid, carry);
+ lo = _mm_slli_epi16(lo, 1);
+
+ // Tricky part: start accumulating everything.
+ // Get/keep the carry as we'll add it in later.
+ rsp_vec_t overflow_mask = _mm_adds_epu16(*acc_lo, lo);
+ *acc_lo = _mm_add_epi16(*acc_lo, lo);
+
+ overflow_mask = _mm_cmpeq_epi16(*acc_lo, overflow_mask);
+ overflow_mask = _mm_cmpeq_epi16(overflow_mask, zero);
+
+ // Add in the carry. If the middle portion is
+ // already 0xFFFF and we have a carry, we have
+ // to carry the all the way up to hi.
+ mid = _mm_sub_epi16(mid, overflow_mask);
+ carry = _mm_cmpeq_epi16(mid, zero);
+ carry = _mm_and_si128(carry, overflow_mask);
+ hi = _mm_sub_epi16(hi, carry);
+
+ // Accumulate the middle portion.
+ overflow_mask = _mm_adds_epu16(*acc_mid, mid);
+ *acc_mid = _mm_add_epi16(*acc_mid, mid);
+
+ overflow_mask = _mm_cmpeq_epi16(*acc_mid, overflow_mask);
+ overflow_mask = _mm_cmpeq_epi16(overflow_mask, zero);
+
+ // Finish up the accumulation of the... accumulator.
+ *acc_hi = _mm_add_epi16(*acc_hi, hi);
+ *acc_hi = _mm_sub_epi16(*acc_hi, overflow_mask);
+
+ if (iw & 0x1) // VMACU
+ {
+ rsp_vec_t overflow_hi_mask = _mm_srai_epi16(*acc_hi, 15);
+ rsp_vec_t overflow_mid_mask = _mm_srai_epi16(*acc_mid, 15);
+ mid = _mm_or_si128(overflow_mid_mask, *acc_mid);
+ overflow_mask = _mm_cmpgt_epi16(*acc_hi, zero);
+ mid = _mm_andnot_si128(overflow_hi_mask, mid);
+ return _mm_or_si128(overflow_mask, mid);
+ }
+ else // VMACF
+ {
+ return sclamp_acc_to_mid(*acc_mid, *acc_hi);
+ }
+}
diff --git a/src/emu/cpu/rsp/vmov.h b/src/emu/cpu/rsp/vmov.h
new file mode 100644
index 00000000000..10a7b1df85f
--- /dev/null
+++ b/src/emu/cpu/rsp/vmov.h
@@ -0,0 +1,9 @@
+// license:BSD-3-Clause
+// copyright-holders:Tyler J. Stachecki,Ryan Holtz
+
+inline rsp_vec_t vec_vmov(UINT32 src, UINT32 e, UINT32 dest, UINT32 de)
+{
+ // Get the element from VT and write out the upper part of the result.
+ m_v[dest].s[de & 0x7] = m_v[src].s[e & 0x7];
+ return vec_load_unshuffled_operand(m_v[dest].s);
+}
diff --git a/src/emu/cpu/rsp/vmrg.h b/src/emu/cpu/rsp/vmrg.h
new file mode 100644
index 00000000000..ab9be63ef16
--- /dev/null
+++ b/src/emu/cpu/rsp/vmrg.h
@@ -0,0 +1,13 @@
+// license:BSD-3-Clause
+// copyright-holders:Tyler J. Stachecki,Ryan Holtz
+
+inline rsp_vec_t vec_vmrg(rsp_vec_t vs, rsp_vec_t vt, rsp_vec_t le)
+{
+#if (defined(__SSE4_1__) || defined(_MSC_VER))
+ return _mm_blendv_epi8(vt, vs, le);
+#else
+ vs = _mm_and_si128(le, vs);
+ vt = _mm_andnot_si128(le, vt);
+ return _mm_or_si128(vs, vt);
+#endif
+}
diff --git a/src/emu/cpu/rsp/vmudh.h b/src/emu/cpu/rsp/vmudh.h
new file mode 100644
index 00000000000..6ae77e2ef7e
--- /dev/null
+++ b/src/emu/cpu/rsp/vmudh.h
@@ -0,0 +1,11 @@
+// license:BSD-3-Clause
+// copyright-holders:Tyler J. Stachecki,Ryan Holtz
+
+inline rsp_vec_t rsp_vmudh(rsp_vec_t vs, rsp_vec_t vt, rsp_vec_t *acc_md, rsp_vec_t *acc_hi)
+{
+ *acc_md = _mm_mullo_epi16(vs, vt);
+ *acc_hi = _mm_mulhi_epi16(vs, vt);
+
+ return sclamp_acc_to_mid(*acc_md, *acc_hi);
+}
+
diff --git a/src/emu/cpu/rsp/vmul.h b/src/emu/cpu/rsp/vmul.h
new file mode 100644
index 00000000000..c8bfc1bbb14
--- /dev/null
+++ b/src/emu/cpu/rsp/vmul.h
@@ -0,0 +1,39 @@
+// license:BSD-3-Clause
+// copyright-holders:Tyler J. Stachecki,Ryan Holtz
+
+//
+// TODO: CHECK ME.
+//
+
+inline rsp_vec_t vec_vmulf_vmulu(UINT32 iw, rsp_vec_t vs, rsp_vec_t vt, rsp_vec_t zero, rsp_vec_t *acc_lo, rsp_vec_t *acc_md, rsp_vec_t *acc_hi)
+{
+ rsp_vec_t lo = _mm_mullo_epi16(vs, vt);
+ rsp_vec_t round = _mm_cmpeq_epi16(zero, zero);
+ rsp_vec_t sign1 = _mm_srli_epi16(lo, 15);
+ lo = _mm_add_epi16(lo, lo);
+ round = _mm_slli_epi16(round, 15);
+ rsp_vec_t hi = _mm_mulhi_epi16(vs, vt);
+ rsp_vec_t sign2 = _mm_srli_epi16(lo, 15);
+ *acc_lo = _mm_add_epi16(round, lo);
+ sign1 = _mm_add_epi16(sign1, sign2);
+
+ hi = _mm_slli_epi16(hi, 1);
+ rsp_vec_t eq = _mm_cmpeq_epi16(vs, vt);
+ rsp_vec_t neq = eq;
+ *acc_md = _mm_add_epi16(hi, sign1);
+
+ rsp_vec_t neg = _mm_srai_epi16(*acc_md, 15);
+
+ if (iw & 0x1) // VMULU
+ {
+ *acc_hi = _mm_andnot_si128(eq, neg);
+ hi =_mm_or_si128(*acc_md, neg);
+ return _mm_andnot_si128(*acc_hi, hi);
+ }
+ else // VMULF
+ {
+ eq = _mm_and_si128(eq, neg);
+ *acc_hi = _mm_andnot_si128(neq, neg);
+ return _mm_add_epi16(*acc_md, eq);
+ }
+}
diff --git a/src/emu/cpu/rsp/vmulh.h b/src/emu/cpu/rsp/vmulh.h
new file mode 100644
index 00000000000..61140f4744c
--- /dev/null
+++ b/src/emu/cpu/rsp/vmulh.h
@@ -0,0 +1,31 @@
+// license:BSD-3-Clause
+// copyright-holders:Tyler J. Stachecki,Ryan Holtz
+
+inline rsp_vec_t vec_vmadh_vmudh(UINT32 iw, rsp_vec_t vs, rsp_vec_t vt, rsp_vec_t zero, rsp_vec_t *acc_lo, rsp_vec_t *acc_md, rsp_vec_t *acc_hi)
+{
+ rsp_vec_t lo = _mm_mullo_epi16(vs, vt);
+ rsp_vec_t hi = _mm_mulhi_epi16(vs, vt);
+
+ if (iw & 0x8) // VMADH
+ {
+ // Tricky part: start accumulating everything.
+ // Get/keep the carry as we'll add it in later.
+ rsp_vec_t overflow_mask = _mm_adds_epu16(*acc_md, lo);
+ *acc_md = _mm_add_epi16(*acc_md, lo);
+
+ overflow_mask = _mm_cmpeq_epi16(*acc_md, overflow_mask);
+ overflow_mask = _mm_cmpeq_epi16(overflow_mask, zero);
+
+ hi = _mm_sub_epi16(hi, overflow_mask);
+ *acc_hi = _mm_add_epi16(*acc_hi, hi);
+ }
+ else // VMUDH
+ {
+ *acc_lo = zero;
+ *acc_md = lo;
+ *acc_hi = hi;
+ }
+
+ return sclamp_acc_to_mid(*acc_md, *acc_hi);
+}
+
diff --git a/src/emu/cpu/rsp/vmull.h b/src/emu/cpu/rsp/vmull.h
new file mode 100644
index 00000000000..2052d537aa8
--- /dev/null
+++ b/src/emu/cpu/rsp/vmull.h
@@ -0,0 +1,44 @@
+// license:BSD-3-Clause
+// copyright-holders:Tyler J. Stachecki,Ryan Holtz
+
+inline rsp_vec_t vec_vmadl_vmudl(UINT32 iw, rsp_vec_t vs, rsp_vec_t vt, rsp_vec_t zero, rsp_vec_t *acc_lo, rsp_vec_t *acc_md, rsp_vec_t *acc_hi)
+{
+ rsp_vec_t hi = _mm_mulhi_epu16(vs, vt);
+
+ if (iw & 0x8) // VMADL
+ {
+ // Tricky part: start accumulating everything.
+ // Get/keep the carry as we'll add it in later.
+ rsp_vec_t overflow_mask = _mm_adds_epu16(*acc_lo, hi);
+ *acc_lo = _mm_add_epi16(*acc_lo, hi);
+
+ overflow_mask = _mm_cmpeq_epi16(*acc_lo, overflow_mask);
+ overflow_mask = _mm_cmpeq_epi16(overflow_mask, zero);
+ hi = _mm_sub_epi16(zero, overflow_mask);
+
+ // Check for overflow of the upper sum.
+ //
+ // TODO: Since hi can only be {0,1}, we should
+ // be able to generalize this for performance.
+ overflow_mask = _mm_adds_epu16(*acc_md, hi);
+ *acc_md = _mm_add_epi16(*acc_md, hi);
+
+ overflow_mask = _mm_cmpeq_epi16(*acc_md, overflow_mask);
+ overflow_mask = _mm_cmpeq_epi16(overflow_mask, zero);
+
+ // Finish up the accumulation of the... accumulator.
+ // Since the product was unsigned, only worry about
+ // positive overflow (i.e.: borrowing not possible).
+ *acc_hi = _mm_sub_epi16(*acc_hi, overflow_mask);
+
+ return uclamp_acc(*acc_lo, *acc_md, *acc_hi, zero);
+ }
+ else // VMUDL
+ {
+ *acc_lo = hi;
+ *acc_md = zero;
+ *acc_hi = zero;
+
+ return hi;
+ }
+}
diff --git a/src/emu/cpu/rsp/vmulm.h b/src/emu/cpu/rsp/vmulm.h
new file mode 100644
index 00000000000..0319a2f6dcc
--- /dev/null
+++ b/src/emu/cpu/rsp/vmulm.h
@@ -0,0 +1,56 @@
+// license:BSD-3-Clause
+// copyright-holders:Tyler J. Stachecki,Ryan Holtz
+
+inline rsp_vec_t vec_vmadm_vmudm(UINT32 iw, rsp_vec_t vs, rsp_vec_t vt, rsp_vec_t zero, rsp_vec_t *acc_lo, rsp_vec_t *acc_md, rsp_vec_t *acc_hi)
+{
+ rsp_vec_t lo = _mm_mullo_epi16(vs, vt);
+ rsp_vec_t hi = _mm_mulhi_epu16(vs, vt);
+
+ // What we really want to do is unsigned vs * signed vt.
+ // However, we have no such instructions to do so.
+ //
+ // There's a trick to "fix" an unsigned product, though:
+ // If vt was negative, take the upper 16-bits of the product
+ // and subtract vs.
+ rsp_vec_t sign = _mm_srai_epi16(vs, 15);
+ vt = _mm_and_si128(vt, sign);
+ hi = _mm_sub_epi16(hi, vt);
+
+ if (iw & 0x8) // VMADM
+ {
+ // Tricky part: start accumulating everything.
+ // Get/keep the carry as we'll add it in later.
+ rsp_vec_t overflow_mask = _mm_adds_epu16(*acc_lo, lo);
+ *acc_lo = _mm_add_epi16(*acc_lo, lo);
+
+ overflow_mask = _mm_cmpeq_epi16(*acc_lo, overflow_mask);
+ overflow_mask = _mm_cmpeq_epi16(overflow_mask, zero);
+
+ // This is REALLY clever. Since the product results from
+ // two 16-bit components, one positive and one negative,
+ // we don't have to worry about carrying the 1 (we can
+ // only borrow) past 32-bits. So we can just add it here.
+ hi = _mm_sub_epi16(hi, overflow_mask);
+
+ // Check for overflow of the upper sum.
+ overflow_mask = _mm_adds_epu16(*acc_md, hi);
+ *acc_md = _mm_add_epi16(*acc_md, hi);
+
+ overflow_mask = _mm_cmpeq_epi16(*acc_md, overflow_mask);
+ overflow_mask = _mm_cmpeq_epi16(overflow_mask, zero);
+
+ // Finish up the accumulation of the... accumulator.
+ *acc_hi = _mm_add_epi16(*acc_hi, _mm_srai_epi16(hi, 15));
+ *acc_hi = _mm_sub_epi16(*acc_hi, overflow_mask);
+
+ return sclamp_acc_to_mid(*acc_md, *acc_hi);
+ }
+ else // VMUDM
+ {
+ *acc_lo = lo;
+ *acc_md = hi;
+ *acc_hi = _mm_srai_epi16(hi, 15);
+
+ return hi;
+ }
+}
diff --git a/src/emu/cpu/rsp/vmuln.h b/src/emu/cpu/rsp/vmuln.h
new file mode 100644
index 00000000000..b9e012622fc
--- /dev/null
+++ b/src/emu/cpu/rsp/vmuln.h
@@ -0,0 +1,55 @@
+// license:BSD-3-Clause
+// copyright-holders:Tyler J. Stachecki,Ryan Holtz
+
+inline rsp_vec_t vec_vmadn_vmudn(UINT32 iw, rsp_vec_t vs, rsp_vec_t vt, rsp_vec_t zero, rsp_vec_t *acc_lo, rsp_vec_t *acc_md, rsp_vec_t *acc_hi)
+{
+ rsp_vec_t lo = _mm_mullo_epi16(vs, vt);
+ rsp_vec_t hi = _mm_mulhi_epu16(vs, vt);
+
+ // What we really want to do is unsigned vs * signed vt.
+ // However, we have no such instructions to do so.
+ //
+ // There's a trick to "fix" an unsigned product, though:
+ // If vt was negative, take the upper 16-bits of the product
+ // and subtract vs.
+ rsp_vec_t sign = _mm_srai_epi16(vt, 15);
+ vs = _mm_and_si128(vs, sign);
+ hi = _mm_sub_epi16(hi, vs);
+
+ if (iw & 0x8) // VMADN
+ {
+ // Tricky part: start accumulating everything.
+ // Get/keep the carry as we'll add it in later.
+ rsp_vec_t overflow_mask = _mm_adds_epu16(*acc_lo, lo);
+ *acc_lo = _mm_add_epi16(*acc_lo, lo);
+
+ overflow_mask = _mm_cmpeq_epi16(*acc_lo, overflow_mask);
+ overflow_mask = _mm_cmpeq_epi16(overflow_mask, zero);
+
+ // This is REALLY clever. Since the product results from
+ // two 16-bit components, one positive and one negative,
+ // we don't have to worry about carrying the 1 (we can
+ // only borrow) past 32-bits. So we can just add it here.
+ hi = _mm_sub_epi16(hi, overflow_mask);
+
+ // Check for overflow of the upper sum.
+ overflow_mask = _mm_adds_epu16(*acc_md, hi);
+ *acc_md = _mm_add_epi16(*acc_md, hi);
+
+ overflow_mask = _mm_cmpeq_epi16(*acc_md, overflow_mask);
+ overflow_mask = _mm_cmpeq_epi16(overflow_mask, zero);
+
+ // Finish up the accumulation of the... accumulator.
+ *acc_hi = _mm_add_epi16(*acc_hi, _mm_srai_epi16(hi, 15));
+ *acc_hi = _mm_sub_epi16(*acc_hi, overflow_mask);
+ return uclamp_acc(*acc_lo, *acc_md, *acc_hi, zero);
+ }
+ else // VMUDN
+ {
+ *acc_lo = lo;
+ *acc_md = hi;
+ *acc_hi = _mm_srai_epi16(hi, 15);
+
+ return lo;
+ }
+}
diff --git a/src/emu/cpu/rsp/vor.h b/src/emu/cpu/rsp/vor.h
new file mode 100644
index 00000000000..9f946df7ca9
--- /dev/null
+++ b/src/emu/cpu/rsp/vor.h
@@ -0,0 +1,10 @@
+// license:BSD-3-Clause
+// copyright-holders:Tyler J. Stachecki,Ryan Holtz
+
+inline rsp_vec_t vec_vor_vnor(UINT32 iw, rsp_vec_t vs, rsp_vec_t vt)
+{
+ rsp_vec_t vmask = _mm_load_si128((rsp_vec_t *) m_vec_helpers.logic_mask[iw & 0x1]);
+
+ rsp_vec_t vd = _mm_or_si128(vs, vt);
+ return _mm_xor_si128(vd, vmask);
+}
diff --git a/src/emu/cpu/rsp/vrcpsq.h b/src/emu/cpu/rsp/vrcpsq.h
new file mode 100644
index 00000000000..2e2434863e9
--- /dev/null
+++ b/src/emu/cpu/rsp/vrcpsq.h
@@ -0,0 +1,58 @@
+// license:BSD-3-Clause
+// copyright-holders:Tyler J. Stachecki,Ryan Holtz
+
+inline rsp_vec_t vec_vrcp_vrsq(UINT32 iw, INT32 dp, UINT32 src, UINT32 e, UINT32 dest, UINT32 de)
+{
+ // Get the element from VT.
+ INT16 vt = m_v[src].s[e & 0x7];
+
+ UINT32 dp_input = ((UINT32) m_div_in << 16) | (UINT16) vt;
+ UINT32 sp_input = vt;
+
+ INT32 input = (dp) ? dp_input : sp_input;
+ INT32 input_mask = input >> 31;
+ INT32 data = input ^ input_mask;
+
+ if (input > -32768)
+ {
+ data -= input_mask;
+ }
+
+ // Handle edge cases.
+ INT32 result;
+ if (data == 0)
+ {
+ result = 0x7fffffff;
+ }
+ else if (input == -32768)
+ {
+ result = 0xffff0000;
+ }
+ else // Main case: compute the reciprocal.
+ {
+ UINT32 shift = count_leading_zeros(data);
+ UINT32 idx = (((UINT64) data << shift) & 0x7FC00000) >> 22;
+
+ if (iw & 0x4) // VRSQ
+ {
+ idx = ((idx | 0x200) & 0x3fe) | (shift % 2);
+ result = rsp_divtable[idx];
+
+ result = ((0x10000 | result) << 14) >> ((31 - shift) >> 1);
+ }
+ else // VRCP
+ {
+ result = rsp_divtable[idx];
+
+ result = ((0x10000 | result) << 14) >> (31 - shift);
+ }
+
+ result = result ^ input_mask;
+ }
+
+ // Write out the results.
+ m_div_out = result >> 16;
+ m_v[dest].s[de & 0x7] = result;
+
+ return vec_load_unshuffled_operand(m_v[dest].s);
+}
diff --git a/src/emu/cpu/rsp/vrsq.h b/src/emu/cpu/rsp/vrsq.h
new file mode 100644
index 00000000000..140e46dcd01
--- /dev/null
+++ b/src/emu/cpu/rsp/vrsq.h
@@ -0,0 +1,66 @@
+// license:BSD-3-Clause
+// copyright-holders:Tyler J. Stachecki,Ryan Holtz
+
+rsp_vec_t vec_vrsq(INT32 dp, UINT32 src, UINT32 e, UINT32 dest, UINT32 de)
+{
+ // Get the element from VT.
+ INT16 vt = m_v[src].s[e & 0x7];
+
+ UINT32 dp_input = ((UINT32) m_div_in << 16) | (UINT16) vt;
+ UINT32 sp_input = vt;
+
+ INT32 input = (dp) ? dp_input : sp_input;
+ INT32 input_mask = input >> 31;
+ INT32 data = input ^ input_mask;
+
+ if (input > -32768)
+ {
+ data -= input_mask;
+ }
+
+ // Handle edge cases.
+ INT32 result;
+ if (data == 0)
+ {
+ result = 0x7fffffff;
+ }
+ else if (input == -32768)
+ {
+ result = 0xffff0000;
+ }
+ else // Main case: compute the reciprocal.
+ {
+ UINT32 shift = count_leading_zeros(data);
+
+ UINT32 idx = (((UINT64) data << shift) & 0x7fc00000) >> 22;
+ idx = ((idx | 0x200) & 0x3fe) | (shift % 2);
+ result = rsp_divtable[idx];
+
+ result = ((0x10000 | result) << 14) >> ((31 - shift) >> 1);
+ result = result ^ input_mask;
+ }
+
+ // Write out the results.
+ m_div_out = result >> 16;
+ m_v[dest].s[de & 0x7] = result;
+
+ return vec_load_unshuffled_operand(m_v[dest].s);
+}
+
+rsp_vec_t vec_vrsqh(UINT32 src, UINT32 e, UINT32 dest, UINT32 de)
+{
+ INT16 elements[8];
+
+ // Get the element from VT.
+ memcpy(elements, &m_v[src], sizeof(rsp_vec_t));
+ m_div_in = elements[e];
+
+ // Write out the upper part of the result.
+ rsp_vec_t vd_mask = _mm_load_si128((rsp_vec_t *) m_vec_helpers.vrsq_mask_table[de]);
+ rsp_vec_t vd = _mm_load_si128((rsp_vec_t *) &m_v[dest]);
+ vd = _mm_andnot_si128(vd_mask, vd);
+
+ rsp_vec_t b_result = _mm_set1_epi16(m_div_out);
+ b_result = _mm_and_si128(vd_mask, b_result);
+ return _mm_or_si128(b_result, vd);
+}
diff --git a/src/emu/cpu/rsp/vsub.h b/src/emu/cpu/rsp/vsub.h
new file mode 100644
index 00000000000..c3df93627c8
--- /dev/null
+++ b/src/emu/cpu/rsp/vsub.h
@@ -0,0 +1,17 @@
+// license:BSD-3-Clause
+// copyright-holders:Tyler J. Stachecki,Ryan Holtz
+
+inline rsp_vec_t vec_vsub(rsp_vec_t vs, rsp_vec_t vt, rsp_vec_t carry, rsp_vec_t *acc_lo)
+{
+ // acc_lo uses saturated arithmetic.
+ rsp_vec_t unsat_diff = _mm_sub_epi16(vt, carry);
+ rsp_vec_t sat_diff = _mm_subs_epi16(vt, carry);
+
+ *acc_lo = _mm_sub_epi16(vs, unsat_diff);
+ rsp_vec_t vd = _mm_subs_epi16(vs, sat_diff);
+
+ // VD is the signed diff of the two sources and the carry. Since we
+ // have to saturate the diff of all three, we have to be clever.
+ rsp_vec_t overflow = _mm_cmpgt_epi16(sat_diff, unsat_diff);
+ return _mm_adds_epi16(vd, overflow);
+}
diff --git a/src/emu/cpu/rsp/vsubc.h b/src/emu/cpu/rsp/vsubc.h
new file mode 100644
index 00000000000..8632b9462d9
--- /dev/null
+++ b/src/emu/cpu/rsp/vsubc.h
@@ -0,0 +1,14 @@
+// license:BSD-3-Clause
+// copyright-holders:Tyler J. Stachecki,Ryan Holtz
+
+inline rsp_vec_t vec_vsubc(rsp_vec_t vs, rsp_vec_t vt, rsp_vec_t zero, rsp_vec_t *eq, rsp_vec_t *sn)
+{
+ rsp_vec_t sat_udiff = _mm_subs_epu16(vs, vt);
+ rsp_vec_t equal = _mm_cmpeq_epi16(vs, vt);
+ rsp_vec_t sat_udiff_zero = _mm_cmpeq_epi16(sat_udiff, zero);
+
+ *eq = _mm_cmpeq_epi16(equal, zero);
+ *sn = _mm_andnot_si128(equal, sat_udiff_zero);
+
+ return _mm_sub_epi16(vs, vt);
+}
diff --git a/src/emu/cpu/rsp/vxor.h b/src/emu/cpu/rsp/vxor.h
new file mode 100644
index 00000000000..b11e1b96bc1
--- /dev/null
+++ b/src/emu/cpu/rsp/vxor.h
@@ -0,0 +1,10 @@
+// license:BSD-3-Clause
+// copyright-holders:Tyler J. Stachecki,Ryan Holtz
+
+inline rsp_vec_t vec_vxor_vnxor(UINT32 iw, rsp_vec_t vs, rsp_vec_t vt)
+{
+ rsp_vec_t vmask = _mm_load_si128((rsp_vec_t *) m_vec_helpers.logic_mask[iw & 0x1]);
+
+ rsp_vec_t vd = _mm_xor_si128(vs, vt);
+ return _mm_xor_si128(vd, vmask);
+}
diff --git a/src/emu/cpu/s2650/s2650.c b/src/emu/cpu/s2650/s2650.c
index abdbe04a1c5..a67bc2ce5fe 100644
--- a/src/emu/cpu/s2650/s2650.c
+++ b/src/emu/cpu/s2650/s2650.c
@@ -229,7 +229,7 @@ inline int s2650_device::check_irq_line()
***************************************************************/
inline UINT8 s2650_device::ROP()
{
- UINT8 result = m_direct->read_decrypted_byte(m_page + m_iar);
+ UINT8 result = m_direct->read_byte(m_page + m_iar);
m_iar = (m_iar + 1) & PMSK;
return result;
}
@@ -240,7 +240,7 @@ inline UINT8 s2650_device::ROP()
***************************************************************/
inline UINT8 s2650_device::ARG()
{
- UINT8 result = m_direct->read_raw_byte(m_page + m_iar);
+ UINT8 result = m_direct->read_byte(m_page + m_iar);
m_iar = (m_iar + 1) & PMSK;
return result;
}
diff --git a/src/emu/cpu/s2650/s2650.h b/src/emu/cpu/s2650/s2650.h
index 9fa79257bd7..e9a0a01c3b9 100644
--- a/src/emu/cpu/s2650/s2650.h
+++ b/src/emu/cpu/s2650/s2650.h
@@ -19,7 +19,7 @@ enum
S2650_EXT_PORT = 0x00ff, /* M/~IO=0 D/~C=x E/~NE=1 */
S2650_CTRL_PORT = 0x0100, /* M/~IO=0 D/~C=0 E/~NE=0 */
S2650_DATA_PORT = 0x0101, /* M/~IO=0 D/~C=1 E/~NE=0 */
- S2650_SENSE_PORT = 0x0102, /* Fake Sense Line */
+ S2650_SENSE_PORT = 0x0102 /* Fake Sense Line */
};
diff --git a/src/emu/cpu/saturn/satops.inc b/src/emu/cpu/saturn/satops.inc
index 35befaaa55f..8f7420584e3 100644
--- a/src/emu/cpu/saturn/satops.inc
+++ b/src/emu/cpu/saturn/satops.inc
@@ -9,7 +9,7 @@ int saturn_device::READ_OP()
{
UINT8 data;
m_icount-=3;
- data=m_direct->read_decrypted_byte(m_pc);
+ data=m_direct->read_byte(m_pc);
saturn_assert(data<0x10);
m_pc=(m_pc+1)&0xfffff;
return data;
@@ -19,7 +19,7 @@ int saturn_device::READ_OP_ARG()
{
UINT8 data;
m_icount-=3;
- data=m_direct->read_raw_byte(m_pc);
+ data=m_direct->read_byte(m_pc);
saturn_assert(data<0x10);
m_pc=(m_pc+1)&0xfffff;
return data;
diff --git a/src/emu/cpu/saturn/saturn.h b/src/emu/cpu/saturn/saturn.h
index 8b663e2248b..836f832cbf6 100644
--- a/src/emu/cpu/saturn/saturn.h
+++ b/src/emu/cpu/saturn/saturn.h
@@ -53,7 +53,7 @@ enum
SATURN_HST,
SATURN_IRQ_STATE,
- SATURN_SLEEPING,
+ SATURN_SLEEPING
};
#define SATURN_IRQ_LINE 0
diff --git a/src/emu/cpu/sc61860/scops.inc b/src/emu/cpu/sc61860/scops.inc
index bde6edd53e1..7bc5b05c987 100644
--- a/src/emu/cpu/sc61860/scops.inc
+++ b/src/emu/cpu/sc61860/scops.inc
@@ -18,18 +18,18 @@
UINT8 sc61860_device::READ_OP()
{
- return m_direct->read_decrypted_byte(m_pc++);
+ return m_direct->read_byte(m_pc++);
}
UINT8 sc61860_device::READ_OP_ARG()
{
- return m_direct->read_raw_byte(m_pc++);
+ return m_direct->read_byte(m_pc++);
}
UINT16 sc61860_device::READ_OP_ARG_WORD()
{
- UINT16 t=m_direct->read_decrypted_byte(m_pc++)<<8;
- t|=m_direct->read_decrypted_byte(m_pc++);
+ UINT16 t=m_direct->read_byte(m_pc++)<<8;
+ t|=m_direct->read_byte(m_pc++);
return t;
}
diff --git a/src/emu/cpu/scmp/scmp.c b/src/emu/cpu/scmp/scmp.c
index cbfaf6a82c2..edd8502c1c5 100644
--- a/src/emu/cpu/scmp/scmp.c
+++ b/src/emu/cpu/scmp/scmp.c
@@ -69,14 +69,14 @@ UINT8 scmp_device::ROP()
{
UINT16 pc = m_PC.w.l;
m_PC.w.l = ADD12(m_PC.w.l,1);
- return m_direct->read_decrypted_byte( pc);
+ return m_direct->read_byte( pc);
}
UINT8 scmp_device::ARG()
{
UINT16 pc = m_PC.w.l;
m_PC.w.l = ADD12(m_PC.w.l,1);
- return m_direct->read_raw_byte(pc);
+ return m_direct->read_byte(pc);
}
UINT8 scmp_device::RM(UINT32 a)
diff --git a/src/emu/cpu/score/score.c b/src/emu/cpu/score/score.c
index 3ecbbe6fb4c..a8e3dd210fc 100644
--- a/src/emu/cpu/score/score.c
+++ b/src/emu/cpu/score/score.c
@@ -283,7 +283,7 @@ INT32 score7_cpu_device::sign_extend(UINT32 data, UINT8 len)
UINT32 score7_cpu_device::fetch()
{
- return m_direct->read_decrypted_dword(m_pc & ~3);
+ return m_direct->read_dword(m_pc & ~3);
}
UINT8 score7_cpu_device::read_byte(offs_t offset)
diff --git a/src/emu/cpu/score/score.h b/src/emu/cpu/score/score.h
index 2fd8ca70ca3..e2c6dc15fef 100644
--- a/src/emu/cpu/score/score.h
+++ b/src/emu/cpu/score/score.h
@@ -23,7 +23,7 @@ enum
SCORE_CEL,
SCORE_GPR,
SCORE_CR = SCORE_GPR + 0x20,
- SCORE_SR = SCORE_CR + 0x20,
+ SCORE_SR = SCORE_CR + 0x20
};
diff --git a/src/emu/cpu/se3208/se3208.c b/src/emu/cpu/se3208/se3208.c
index 31cbdfe73a2..98a87335d33 100644
--- a/src/emu/cpu/se3208/se3208.c
+++ b/src/emu/cpu/se3208/se3208.c
@@ -1738,7 +1738,7 @@ void se3208_device::execute_run()
{
do
{
- UINT16 Opcode=m_direct->read_decrypted_word(m_PC, WORD_XOR_LE(0));
+ UINT16 Opcode=m_direct->read_word(m_PC, WORD_XOR_LE(0));
debugger_instruction_hook(this, m_PC);
diff --git a/src/emu/cpu/sh2/sh2.c b/src/emu/cpu/sh2/sh2.c
index 9e7c5a467a1..b2ea57f60d4 100644
--- a/src/emu/cpu/sh2/sh2.c
+++ b/src/emu/cpu/sh2/sh2.c
@@ -124,7 +124,7 @@
const device_type SH1 = &device_creator<sh1_device>;
const device_type SH2 = &device_creator<sh2_device>;
-
+const device_type SH2A = &device_creator<sh2a_device>;
/*-------------------------------------------------
sh2_internal_a5 - read handler for
@@ -141,15 +141,38 @@ READ32_MEMBER(sh2_device::sh2_internal_a5)
sh2_internal_map - maps SH2 built-ins
-------------------------------------------------*/
-static ADDRESS_MAP_START( sh2_internal_map, AS_PROGRAM, 32, sh2_device )
+static ADDRESS_MAP_START( sh7604_map, AS_PROGRAM, 32, sh2_device )
AM_RANGE(0x40000000, 0xbfffffff) AM_READ(sh2_internal_a5)
- AM_RANGE(0xe0000000, 0xffffffff) AM_READWRITE(sh2_internal_r, sh2_internal_w)
+/*!
+ @todo: cps3boot breaks with this enabled. Needs customization ...
+ */
+// AM_RANGE(0xc0000000, 0xc0000fff) AM_RAM // cache data array
+// AM_RANGE(0xffffff88, 0xffffff8b) AM_READWRITE(dma_dtcr0_r,dma_dtcr0_w)
+ AM_RANGE(0xe0000000, 0xe00001ff) AM_MIRROR(0x1ffffe00) AM_READWRITE(sh7604_r, sh7604_w)
+ADDRESS_MAP_END
+
+static ADDRESS_MAP_START( sh7021_map, AS_PROGRAM, 32, sh2a_device )
+// overrides
+ AM_RANGE(0x05ffff40, 0x05ffff43) AM_READWRITE(dma_sar0_r, dma_sar0_w)
+ AM_RANGE(0x05ffff44, 0x05ffff47) AM_READWRITE(dma_dar0_r, dma_dar0_w)
+ AM_RANGE(0x05ffff48, 0x05ffff4b) AM_READWRITE16(dmaor_r, dmaor_w,0xffff0000)
+ AM_RANGE(0x05ffff48, 0x05ffff4b) AM_READWRITE16(dma_tcr0_r, dma_tcr0_w,0x0000ffff)
+ AM_RANGE(0x05ffff4c, 0x05ffff4f) AM_READWRITE16(dma_chcr0_r, dma_chcr0_w, 0x0000ffff)
+// fall-back
+ AM_RANGE(0x05fffe00, 0x05ffffff) AM_READWRITE16(sh7021_r,sh7021_w,0xffffffff) // SH-7032H internal i/o
+// AM_RANGE(0x07000000, 0x070003ff) AM_RAM AM_SHARE("oram")// on-chip RAM, actually at 0xf000000 (1 kb)
+// AM_RANGE(0x0f000000, 0x0f0003ff) AM_RAM AM_SHARE("oram")// on-chip RAM, actually at 0xf000000 (1 kb)
ADDRESS_MAP_END
+static ADDRESS_MAP_START( sh7032_map, AS_PROGRAM, 32, sh1_device )
+// fall-back
+ AM_RANGE(0x05fffe00, 0x05ffffff) AM_READWRITE16(sh7032_r,sh7032_w,0xffffffff) // SH-7032H internal i/o
+ADDRESS_MAP_END
sh2_device::sh2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: cpu_device(mconfig, SH2, "SH-2", tag, owner, clock, "sh2", __FILE__)
- , m_program_config("program", ENDIANNESS_BIG, 32, 32, 0, ADDRESS_MAP_NAME(sh2_internal_map))
+ , m_program_config("program", ENDIANNESS_BIG, 32, 32, 0, ADDRESS_MAP_NAME(sh7604_map))
+ , m_decrypted_program_config("decrypted_opcodes", ENDIANNESS_BIG, 32, 32, 0)
, m_is_slave(0)
, m_cpu_type(CPU_TYPE_SH2)
, m_cache(CACHE_SIZE + sizeof(internal_sh2_state))
@@ -170,7 +193,7 @@ sh2_device::sh2_device(const machine_config &mconfig, const char *tag, device_t
, m_out_of_cycles(NULL)
, m_debugger_temp(0)
{
- m_isdrc = mconfig.options().drc() ? true : false;
+ m_isdrc = (mconfig.options().drc() && !mconfig.m_force_no_drc) ? true : false;
}
@@ -184,9 +207,10 @@ void sh2_device::device_stop()
}
-sh2_device::sh2_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source, int cpu_type)
+sh2_device::sh2_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source, int cpu_type, address_map_constructor internal_map, int addrlines )
: cpu_device(mconfig, type, name, tag, owner, clock, shortname, source)
- , m_program_config("program", ENDIANNESS_BIG, 32, 32, 0, ADDRESS_MAP_NAME(sh2_internal_map))
+ , m_program_config("program", ENDIANNESS_BIG, 32, addrlines, 0, internal_map)
+ , m_decrypted_program_config("decrypted_opcodes", ENDIANNESS_BIG, 32, addrlines, 0)
, m_is_slave(0)
, m_cpu_type(cpu_type)
, m_cache(CACHE_SIZE + sizeof(internal_sh2_state))
@@ -206,14 +230,28 @@ sh2_device::sh2_device(const machine_config &mconfig, device_type type, const ch
, m_nocode(NULL)
, m_out_of_cycles(NULL)
{
- m_isdrc = mconfig.options().drc() ? true : false;
+ m_isdrc = (mconfig.options().drc() && !mconfig.m_force_no_drc) ? true : false;
+}
+
+sh2a_device::sh2a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : sh2_device(mconfig, SH1, "SH-2A", tag, owner, clock, "sh2a", __FILE__, CPU_TYPE_SH2, ADDRESS_MAP_NAME(sh7021_map), 28 )
+{
}
sh1_device::sh1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : sh2_device(mconfig, SH1, "SH-1", tag, owner, clock, "sh1", __FILE__, CPU_TYPE_SH1 )
+ : sh2_device(mconfig, SH1, "SH-1", tag, owner, clock, "sh1", __FILE__, CPU_TYPE_SH1, ADDRESS_MAP_NAME(sh7032_map), 28 )
{
}
+const address_space_config *sh2_device::memory_space_config(address_spacenum spacenum) const
+{
+ switch(spacenum)
+ {
+ case AS_PROGRAM: return &m_program_config;
+ case AS_DECRYPTED_OPCODES: return has_configured_map(AS_DECRYPTED_OPCODES) ? &m_decrypted_program_config : NULL;
+ default: return NULL;
+ }
+}
offs_t sh2_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options)
{
@@ -229,113 +267,65 @@ offs_t sh2_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *opro
#define LOG(x) do { if (VERBOSE) logerror x; } while (0)
-
UINT8 sh2_device::RB(offs_t A)
{
- if (A >= 0xe0000000)
- return sh2_internal_r(*m_internal, (A & 0x1fc)>>2, 0xff << (((~A) & 3)*8)) >> (((~A) & 3)*8);
-
- if (A >= 0xc0000000)
- return m_program->read_byte(A);
-
- if (A >= 0x40000000)
- return 0xa5;
+ if((A & 0xf0000000) == 0 || (A & 0xf0000000) == 0x20000000)
+ return m_program->read_byte(A & AM);
- return m_program->read_byte(A & AM);
+ return m_program->read_byte(A);
}
UINT16 sh2_device::RW(offs_t A)
{
- if (A >= 0xe0000000)
- return sh2_internal_r(*m_internal, (A & 0x1fc)>>2, 0xffff << (((~A) & 2)*8)) >> (((~A) & 2)*8);
-
- if (A >= 0xc0000000)
- return m_program->read_word(A);
-
- if (A >= 0x40000000)
- return 0xa5a5;
+ if((A & 0xf0000000) == 0 || (A & 0xf0000000) == 0x20000000)
+ return m_program->read_word(A & AM);
- return m_program->read_word(A & AM);
+ return m_program->read_word(A);
}
UINT32 sh2_device::RL(offs_t A)
{
- if (A >= 0xe0000000) /* I/O */
- return sh2_internal_r(*m_internal, (A & 0x1fc)>>2, 0xffffffff);
-
- if (A >= 0xc0000000) /* Cache Data Array */
- return m_program->read_dword(A);
-
- if (A >= 0x40000000) /* Cache Associative Purge Area */
- return 0xa5a5a5a5;
-
/* 0x20000000 no Cache */
/* 0x00000000 read thru Cache if CE bit is 1 */
- return m_program->read_dword(A & AM);
+ if((A & 0xf0000000) == 0 || (A & 0xf0000000) == 0x20000000)
+ return m_program->read_dword(A & AM);
+
+ return m_program->read_dword(A);
}
void sh2_device::WB(offs_t A, UINT8 V)
{
- if (A >= 0xe0000000)
- {
- sh2_internal_w(*m_internal, (A & 0x1fc)>>2, V << (((~A) & 3)*8), 0xff << (((~A) & 3)*8));
- return;
- }
-
- if (A >= 0xc0000000)
+ if((A & 0xf0000000) == 0 || (A & 0xf0000000) == 0x20000000)
{
- m_program->write_byte(A,V);
+ m_program->write_byte(A & AM,V);
return;
}
-
- if (A >= 0x40000000)
- return;
-
- m_program->write_byte(A & AM,V);
+
+ m_program->write_byte(A,V);
}
void sh2_device::WW(offs_t A, UINT16 V)
{
- if (A >= 0xe0000000)
+ if((A & 0xf0000000) == 0 || (A & 0xf0000000) == 0x20000000)
{
- sh2_internal_w(*m_internal, (A & 0x1fc)>>2, V << (((~A) & 2)*8), 0xffff << (((~A) & 2)*8));
+ m_program->write_word(A & AM,V);
return;
}
-
- if (A >= 0xc0000000)
- {
- m_program->write_word(A,V);
- return;
- }
-
- if (A >= 0x40000000)
- return;
-
- m_program->write_word(A & AM,V);
+
+ m_program->write_word(A,V);
}
void sh2_device::WL(offs_t A, UINT32 V)
{
- if (A >= 0xe0000000) /* I/O */
- {
- sh2_internal_w(*m_internal, (A & 0x1fc)>>2, V, 0xffffffff);
- return;
- }
-
- if (A >= 0xc0000000) /* Cache Data Array */
+ if((A & 0xf0000000) == 0 || (A & 0xf0000000) == 0x20000000)
{
- m_program->write_dword(A,V);
+ m_program->write_dword(A & AM,V);
return;
}
-
- /* 0x60000000 Cache Address Data Array */
-
- if (A >= 0x40000000) /* Cache Associative Purge Area */
- return;
-
+
/* 0x20000000 no Cache */
/* 0x00000000 read thru Cache if CE bit is 1 */
- m_program->write_dword(A & AM,V);
+ m_program->write_dword(A,V);
}
/* code cycles t-bit
@@ -2397,7 +2387,8 @@ void sh2_device::device_start()
m_ftcsr_read_cb.bind_relative_to(*owner());
m_program = &space(AS_PROGRAM);
- m_direct = &m_program->direct();
+ m_decrypted_program = has_space(AS_DECRYPTED_OPCODES) ? &space(AS_DECRYPTED_OPCODES) : &space(AS_PROGRAM);
+ m_direct = &m_decrypted_program->direct();
m_internal = &space(AS_PROGRAM);
save_item(NAME(m_sh2_state->pc));
diff --git a/src/emu/cpu/sh2/sh2.h b/src/emu/cpu/sh2/sh2.h
index a91ac1e781d..c53b6baad59 100644
--- a/src/emu/cpu/sh2/sh2.h
+++ b/src/emu/cpu/sh2/sh2.h
@@ -105,15 +105,15 @@ class sh2_device : public cpu_device
public:
// construction/destruction
sh2_device(const machine_config &mconfig, const char *_tag, device_t *_owner, UINT32 _clock);
- sh2_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source, int cpu_type);
+ sh2_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source, int cpu_type,address_map_constructor internal_map, int addrlines);
static void set_is_slave(device_t &device, int slave) { downcast<sh2_device &>(device).m_is_slave = slave; }
static void set_dma_kludge_callback(device_t &device, sh2_dma_kludge_delegate callback) { downcast<sh2_device &>(device).m_dma_kludge_cb = callback; }
static void set_dma_fifo_data_available_callback(device_t &device, sh2_dma_fifo_data_available_delegate callback) { downcast<sh2_device &>(device).m_dma_fifo_data_available_cb = callback; }
static void set_ftcsr_read_callback(device_t &device, sh2_ftcsr_read_delegate callback) { downcast<sh2_device &>(device).m_ftcsr_read_cb = callback; }
- DECLARE_WRITE32_MEMBER( sh2_internal_w );
- DECLARE_READ32_MEMBER( sh2_internal_r );
+ DECLARE_WRITE32_MEMBER( sh7604_w );
+ DECLARE_READ32_MEMBER( sh7604_r );
DECLARE_READ32_MEMBER(sh2_internal_a5);
void sh2_set_frt_input(int state);
@@ -138,7 +138,7 @@ protected:
virtual void execute_set_input(int inputnum, int state);
// device_memory_interface overrides
- virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const { return (spacenum == AS_PROGRAM) ? &m_program_config : NULL; }
+ virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
// device_state_interface overrides
virtual void state_import(const device_state_entry &entry);
@@ -149,9 +149,10 @@ protected:
virtual UINT32 disasm_min_opcode_bytes() const { return 2; }
virtual UINT32 disasm_max_opcode_bytes() const { return 2; }
virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options);
+ address_space *m_program, *m_decrypted_program;
private:
- address_space_config m_program_config;
+ address_space_config m_program_config, m_decrypted_program_config;
// Data that needs to be stored close to the generated DRC code
struct internal_sh2_state
@@ -195,7 +196,6 @@ private:
UINT32 m_pcflushes[16]; // pcflush entries
INT8 m_irq_line_state[17];
- address_space *m_program;
protected:
direct_read_data *m_direct;
private:
@@ -494,12 +494,49 @@ public:
void func_SUBV();
};
+class sh2a_device : public sh2_device
+{
+public:
+ // construction/destruction
+ sh2a_device(const machine_config &mconfig, const char *_tag, device_t *_owner, UINT32 _clock);
+
+ DECLARE_READ32_MEMBER(dma_sar0_r);
+ DECLARE_WRITE32_MEMBER(dma_sar0_w);
+ DECLARE_READ32_MEMBER(dma_dar0_r);
+ DECLARE_WRITE32_MEMBER(dma_dar0_w);
+ DECLARE_READ16_MEMBER(dmaor_r);
+ DECLARE_WRITE16_MEMBER(dmaor_w);
+ DECLARE_READ16_MEMBER(dma_tcr0_r);
+ DECLARE_WRITE16_MEMBER(dma_tcr0_w);
+ DECLARE_READ16_MEMBER(dma_chcr0_r);
+ DECLARE_WRITE16_MEMBER(dma_chcr0_w);
+ DECLARE_READ16_MEMBER(sh7021_r);
+ DECLARE_WRITE16_MEMBER(sh7021_w);
+ void sh7032_dma_exec(int ch);
+
+private:
+ UINT16 m_sh7021_regs[0x200];
+ struct
+ {
+ UINT32 sar; /**< Source Address Register */
+ UINT32 dar; /**< Destination Address Register */
+ UINT16 tcr; /**< Transfer Count Register */
+ UINT16 chcr; /**< Channel Control Register */
+ } m_dma[4];
+ UINT16 m_dmaor; /**< DMA Operation Register (status flags) */
+
+};
class sh1_device : public sh2_device
{
public:
// construction/destruction
sh1_device(const machine_config &mconfig, const char *_tag, device_t *_owner, UINT32 _clock);
+
+ DECLARE_READ16_MEMBER(sh7032_r);
+ DECLARE_WRITE16_MEMBER(sh7032_w);
+private:
+ UINT16 m_sh7032_regs[0x200];
};
@@ -526,6 +563,7 @@ private:
extern const device_type SH1;
extern const device_type SH2;
+extern const device_type SH2A;
#endif /* __SH2_H__ */
diff --git a/src/emu/cpu/sh2/sh2comn.c b/src/emu/cpu/sh2/sh2comn.c
index 8f29e8f95c5..f6883649ee9 100644
--- a/src/emu/cpu/sh2/sh2comn.c
+++ b/src/emu/cpu/sh2/sh2comn.c
@@ -366,6 +366,7 @@ void sh2_device::sh2_do_dma(int dma)
LOG(("SH2.%s: DMA %d complete\n", tag(), dma));
+ m_m[0x62+4*dma] = 0;
m_m[0x63+4*dma] |= 2;
m_dma_timer_active[dma] = 0;
m_dma_irq[dma] |= 1;
@@ -461,14 +462,11 @@ void sh2_device::sh2_dmac_check(int dma)
}
}
-WRITE32_MEMBER( sh2_device::sh2_internal_w )
+
+WRITE32_MEMBER( sh2_device::sh7604_w )
{
UINT32 old;
- if (m_isdrc)
- offset &= 0x7f;
-
-
old = m_m[offset];
COMBINE_DATA(m_m+offset);
@@ -688,11 +686,8 @@ WRITE32_MEMBER( sh2_device::sh2_internal_w )
}
}
-READ32_MEMBER( sh2_device::sh2_internal_r )
+READ32_MEMBER( sh2_device::sh7604_r )
{
- if (m_isdrc)
- offset &= 0x7f;
-
// logerror("sh2_internal_r: Read %08x (%x) @ %08x\n", 0xfffffe00+offset*4, offset, mem_mask);
switch( offset )
{
@@ -888,3 +883,134 @@ void sh2_device::sh2_exception(const char *message, int irqline)
if(m_sh2_state->sleep_mode == 1) { m_sh2_state->sleep_mode = 2; }
}
+
+/*
+ SH-7021 on-chip device
+ */
+
+void sh2a_device::sh7032_dma_exec(int ch)
+{
+ const short dma_word_size[4] = { 0, +1, -1, 0 };
+ UINT8 rs = (m_dma[ch].chcr >> 8) & 0xf; /**< Resource Select bits */
+ if(rs != 0xc) // Auto-Request
+ {
+ logerror("Warning: SH7032 DMA enables non auto-request transfer\n");
+ return;
+ }
+
+ // channel enable & master enable
+ if((m_dma[ch].chcr & 1) == 0 || (m_dmaor & 1) == 0)
+ return;
+
+ printf("%08x %08x %04x\n",m_dma[ch].sar,m_dma[ch].dar,m_dma[ch].chcr);
+ UINT8 dm = (m_dma[ch].chcr >> 14) & 3; /**< Destination Address Mode bits */
+ UINT8 sm = (m_dma[ch].chcr >> 12) & 3; /**< Source Address Mode bits */
+ bool ts = (m_dma[ch].chcr & 8); /**< Transfer Size bit */
+ int src_word_size = dma_word_size[sm] * ((ts == true) ? 2 : 1);
+ int dst_word_size = dma_word_size[dm] * ((ts == true) ? 2 : 1);
+ UINT32 src_addr = m_dma[ch].sar;
+ UINT32 dst_addr = m_dma[ch].dar;
+ UINT32 size_index = m_dma[ch].tcr;
+ if(size_index == 0)
+ size_index = 0x10000;
+
+ if(ts == false)
+ logerror("SH7032: DMA byte mode check\n");
+
+ for(int index = size_index;index>-1;index--)
+ {
+ if(ts == true)
+ m_program->write_word(dst_addr,m_program->read_word(src_addr));
+ else
+ m_program->write_byte(dst_addr,m_program->read_byte(src_addr));
+
+ src_addr += src_word_size;
+ dst_addr += dst_word_size;
+ }
+
+ m_dma[ch].chcr &= ~1; /**< @todo non-instant DMA */
+ printf("%02x %02x %02x %1d\n",sm,dm,rs,ts);
+}
+
+READ32_MEMBER(sh2a_device::dma_sar0_r)
+{
+ return m_dma[0].sar;
+}
+
+WRITE32_MEMBER(sh2a_device::dma_sar0_w)
+{
+ COMBINE_DATA(&m_dma[0].sar);
+}
+
+READ32_MEMBER(sh2a_device::dma_dar0_r)
+{
+ return m_dma[0].dar;
+}
+
+WRITE32_MEMBER(sh2a_device::dma_dar0_w)
+{
+ COMBINE_DATA(&m_dma[0].dar);
+}
+
+READ16_MEMBER(sh2a_device::dma_tcr0_r)
+{
+ return m_dma[0].tcr;
+}
+
+WRITE16_MEMBER(sh2a_device::dma_tcr0_w)
+{
+ //printf("%04x\n",data);
+ COMBINE_DATA(&m_dma[0].tcr);
+}
+
+READ16_MEMBER(sh2a_device::dma_chcr0_r)
+{
+ return m_dma[0].chcr;
+}
+
+WRITE16_MEMBER(sh2a_device::dma_chcr0_w)
+{
+ //printf("%04x CHCR0\n",data);
+ COMBINE_DATA(&m_dma[0].chcr);
+ sh7032_dma_exec(0);
+}
+
+READ16_MEMBER(sh2a_device::dmaor_r)
+{
+ return m_dmaor;
+}
+
+WRITE16_MEMBER(sh2a_device::dmaor_w)
+{
+ COMBINE_DATA(&m_dmaor);
+ sh7032_dma_exec(0);
+}
+
+/*!
+ @brief Dummy debug interface
+ */
+READ16_MEMBER(sh1_device::sh7032_r)
+{
+ return m_sh7032_regs[offset];
+}
+
+/*!
+ @brief Dummy debug interface
+ */
+WRITE16_MEMBER(sh1_device::sh7032_w)
+{
+ COMBINE_DATA(&m_sh7032_regs[offset]);
+}
+
+READ16_MEMBER(sh2a_device::sh7021_r)
+{
+ return m_sh7021_regs[offset];
+}
+
+/*!
+ @brief Dummy debug interface
+ */
+WRITE16_MEMBER(sh2a_device::sh7021_w)
+{
+ COMBINE_DATA(&m_sh7021_regs[offset]);
+}
diff --git a/src/emu/cpu/sh2/sh2drc.c b/src/emu/cpu/sh2/sh2drc.c
index 42c2cde9434..4069f3287c7 100644
--- a/src/emu/cpu/sh2/sh2drc.c
+++ b/src/emu/cpu/sh2/sh2drc.c
@@ -11,6 +11,7 @@
#include "debugger.h"
#include "sh2.h"
#include "sh2comn.h"
+#include "mconfig.h"
extern unsigned DasmSH2(char *buffer, unsigned pc, UINT16 opcode);
@@ -1309,7 +1310,7 @@ void sh2_device::generate_checksum_block(drcuml_block *block, compiler_state *co
{
if (!(seqhead->flags & OPFLAG_VIRTUAL_NOOP))
{
- void *base = m_direct->read_decrypted_ptr(seqhead->physpc, SH2_CODE_XOR(0));
+ void *base = m_direct->read_ptr(seqhead->physpc, SH2_CODE_XOR(0));
UML_LOAD(block, I0, base, 0, SIZE_WORD, SCALE_x2); // load i0,base,word
UML_CMP(block, I0, seqhead->opptr.w[0]); // cmp i0,*opptr
UML_EXHc(block, COND_NE, *m_nocode, epc(seqhead)); // exne nocode,seqhead->pc
@@ -1323,20 +1324,20 @@ void sh2_device::generate_checksum_block(drcuml_block *block, compiler_state *co
for (curdesc = seqhead->next(); curdesc != seqlast->next(); curdesc = curdesc->next())
if (!(curdesc->flags & OPFLAG_VIRTUAL_NOOP))
{
- base = m_direct->read_decrypted_ptr(curdesc->physpc, SH2_CODE_XOR(0));
+ base = m_direct->read_ptr(curdesc->physpc, SH2_CODE_XOR(0));
UML_LOAD(block, I0, curdesc->opptr.w, 0, SIZE_WORD, SCALE_x2); // load i0,*opptr,0,word
UML_CMP(block, I0, curdesc->opptr.w[0]); // cmp i0,*opptr
UML_EXHc(block, COND_NE, *m_nocode, epc(seqhead)); // exne nocode,seqhead->pc
}
#else
UINT32 sum = 0;
- void *base = m_direct->read_decrypted_ptr(seqhead->physpc, SH2_CODE_XOR(0));
+ void *base = m_direct->read_ptr(seqhead->physpc, SH2_CODE_XOR(0));
UML_LOAD(block, I0, base, 0, SIZE_WORD, SCALE_x4); // load i0,base,word
sum += seqhead->opptr.w[0];
for (curdesc = seqhead->next(); curdesc != seqlast->next(); curdesc = curdesc->next())
if (!(curdesc->flags & OPFLAG_VIRTUAL_NOOP))
{
- base = m_direct->read_decrypted_ptr(curdesc->physpc, SH2_CODE_XOR(0));
+ base = m_direct->read_ptr(curdesc->physpc, SH2_CODE_XOR(0));
UML_LOAD(block, I1, base, 0, SIZE_WORD, SCALE_x2); // load i1,*opptr,word
UML_ADD(block, I0, I0, I1); // add i0,i0,i1
sum += curdesc->opptr.w[0];
@@ -2945,7 +2946,7 @@ int sh2_device::generate_group_12(drcuml_block *block, compiler_state *compiler,
void sh2_device::sh2drc_set_options(UINT32 options)
{
- if (!machine().options().drc()) return;
+ if (!(mconfig().options().drc() && !mconfig().m_force_no_drc)) return;
m_drcoptions = options;
}
@@ -2957,7 +2958,7 @@ void sh2_device::sh2drc_set_options(UINT32 options)
void sh2_device::sh2drc_add_pcflush(offs_t address)
{
- if (!machine().options().drc()) return;
+ if (!(mconfig().options().drc() && !mconfig().m_force_no_drc)) return;
if (m_pcfsel < ARRAY_LENGTH(m_pcflushes))
m_pcflushes[m_pcfsel++] = address;
diff --git a/src/emu/cpu/sh2/sh2fe.c b/src/emu/cpu/sh2/sh2fe.c
index 9cc2be5c048..8ea8ccb82d3 100644
--- a/src/emu/cpu/sh2/sh2fe.c
+++ b/src/emu/cpu/sh2/sh2fe.c
@@ -34,7 +34,7 @@ bool sh2_frontend::describe(opcode_desc &desc, const opcode_desc *prev)
UINT16 opcode;
/* fetch the opcode */
- opcode = desc.opptr.w[0] = m_sh2->m_direct->read_decrypted_word(desc.physpc, SH2_CODE_XOR(0));
+ opcode = desc.opptr.w[0] = m_sh2->m_direct->read_word(desc.physpc, SH2_CODE_XOR(0));
/* all instructions are 2 bytes and most are a single cycle */
desc.length = 2;
diff --git a/src/emu/cpu/sh4/sh4.c b/src/emu/cpu/sh4/sh4.c
index 889fe12eb5c..e0835b1f9c0 100644
--- a/src/emu/cpu/sh4/sh4.c
+++ b/src/emu/cpu/sh4/sh4.c
@@ -3474,7 +3474,7 @@ inline void sh34_base_device::execute_one_0000(const UINT16 opcode)
case 0xef: MAC_L(opcode); break;
case 0xff: MAC_L(opcode); break;
}
-};
+}
inline void sh34_base_device::execute_one_4000(const UINT16 opcode)
{
@@ -3948,7 +3948,7 @@ void sh34_base_device::execute_run()
{
if (m_delay)
{
- const UINT16 opcode = m_direct->read_decrypted_word((UINT32)(m_delay & AM), WORD2_XOR_LE(0));
+ const UINT16 opcode = m_direct->read_word((UINT32)(m_delay & AM), WORD2_XOR_LE(0));
debugger_instruction_hook(this, (m_pc-2) & AM);
@@ -3964,7 +3964,7 @@ void sh34_base_device::execute_run()
}
else
{
- const UINT16 opcode = m_direct->read_decrypted_word((UINT32)(m_pc & AM), WORD2_XOR_LE(0));
+ const UINT16 opcode = m_direct->read_word((UINT32)(m_pc & AM), WORD2_XOR_LE(0));
debugger_instruction_hook(this, m_pc & AM);
@@ -3995,7 +3995,7 @@ void sh3be_device::execute_run()
{
if (m_delay)
{
- const UINT16 opcode = m_direct->read_decrypted_word((UINT32)(m_delay & AM), WORD_XOR_LE(6));
+ const UINT16 opcode = m_direct->read_word((UINT32)(m_delay & AM), WORD_XOR_LE(6));
debugger_instruction_hook(this, m_delay & AM);
@@ -4014,7 +4014,7 @@ void sh3be_device::execute_run()
}
else
{
- const UINT16 opcode = m_direct->read_decrypted_word((UINT32)(m_pc & AM), WORD_XOR_LE(6));
+ const UINT16 opcode = m_direct->read_word((UINT32)(m_pc & AM), WORD_XOR_LE(6));
debugger_instruction_hook(this, m_pc & AM);
@@ -4045,7 +4045,7 @@ void sh4be_device::execute_run()
{
if (m_delay)
{
- const UINT16 opcode = m_direct->read_decrypted_word((UINT32)(m_delay & AM), WORD_XOR_LE(6));
+ const UINT16 opcode = m_direct->read_word((UINT32)(m_delay & AM), WORD_XOR_LE(6));
debugger_instruction_hook(this, m_delay & AM);
@@ -4064,7 +4064,7 @@ void sh4be_device::execute_run()
}
else
{
- const UINT16 opcode = m_direct->read_decrypted_word((UINT32)(m_pc & AM), WORD_XOR_LE(6));
+ const UINT16 opcode = m_direct->read_word((UINT32)(m_pc & AM), WORD_XOR_LE(6));
debugger_instruction_hook(this, m_pc & AM);
diff --git a/src/emu/cpu/sharc/sharc.c b/src/emu/cpu/sharc/sharc.c
index af3fe1e3f39..702f36ebe4c 100644
--- a/src/emu/cpu/sharc/sharc.c
+++ b/src/emu/cpu/sharc/sharc.c
@@ -37,7 +37,7 @@ enum
SHARC_B0, SHARC_B1, SHARC_B2, SHARC_B3,
SHARC_B4, SHARC_B5, SHARC_B6, SHARC_B7,
SHARC_B8, SHARC_B9, SHARC_B10, SHARC_B11,
- SHARC_B12, SHARC_B13, SHARC_B14, SHARC_B15,
+ SHARC_B12, SHARC_B13, SHARC_B14, SHARC_B15
};
diff --git a/src/emu/cpu/sm510/sm510.c b/src/emu/cpu/sm510/sm510.c
new file mode 100644
index 00000000000..09029709849
--- /dev/null
+++ b/src/emu/cpu/sm510/sm510.c
@@ -0,0 +1,376 @@
+// license:BSD-3-Clause
+// copyright-holders:hap
+/*
+
+ Sharp SM510 MCU family - known chips:
+ - SM510: 2.7Kx8 ROM, 128x4 RAM(32x4 for LCD)
+ - SM511: 4Kx8 ROM, 128x4 RAM(32x4 for LCD), melody controller
+ - SM512: 4Kx8 ROM, 128x4 RAM(48x4 for LCD), melody controller
+
+ Other chips that may be in the same family, investigate more when one of
+ them needs to get emulated: SM500, SM530/31, SM4A, SM3903, ..
+
+ References:
+ - 1990 Sharp Microcomputers Data Book
+ - 1996 Sharp Microcomputer Databook
+
+ TODO:
+ - proper support for LFSR program counter in debugger
+ - callback for lcd screen as MAME bitmap (when needed)
+ - LCD bs pin blink mode via Y register (0.5s off, 0.5s on)
+ - LB/SBM is correct?
+ - SM511 unknown opcodes
+
+*/
+
+#include "sm510.h"
+#include "debugger.h"
+
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+enum
+{
+ SM510_PC=1, SM510_ACC, SM510_BL, SM510_BM,
+ SM510_C, SM510_W
+};
+
+void sm510_base_device::device_start()
+{
+ m_program = &space(AS_PROGRAM);
+ m_data = &space(AS_DATA);
+ m_prgmask = (1 << m_prgwidth) - 1;
+ m_datamask = (1 << m_datawidth) - 1;
+
+ // resolve callbacks
+ m_read_k.resolve_safe(0);
+ m_read_ba.resolve_safe(1);
+ m_read_b.resolve_safe(1);
+ m_write_s.resolve_safe();
+ m_write_r.resolve_safe();
+
+ m_write_sega.resolve_safe();
+ m_write_segb.resolve_safe();
+ m_write_segbs.resolve_safe();
+ m_write_segc.resolve_safe();
+
+ // zerofill
+ memset(m_stack, 0, sizeof(m_stack));
+ m_pc = 0;
+ m_prev_pc = 0;
+ m_op = 0;
+ m_prev_op = 0;
+ m_param = 0;
+ m_acc = 0;
+ m_bl = 0;
+ m_bm = 0;
+ m_c = 0;
+ m_skip = false;
+ m_w = 0;
+ m_r = 0;
+ m_div = 0;
+ m_1s = false;
+ m_k_active = false;
+ m_l = 0;
+ m_x = 0;
+ m_y = 0;
+ m_bp = false;
+ m_bc = false;
+ m_halt = false;
+ m_melody_rd = 0;
+ m_melody_step_count = 0;
+ m_melody_duty_count = 0;
+ m_melody_duty_index = 0;
+ m_melody_address = 0;
+
+ // register for savestates
+ save_item(NAME(m_stack));
+ save_item(NAME(m_pc));
+ save_item(NAME(m_prev_pc));
+ save_item(NAME(m_op));
+ save_item(NAME(m_prev_op));
+ save_item(NAME(m_param));
+ save_item(NAME(m_acc));
+ save_item(NAME(m_bl));
+ save_item(NAME(m_bm));
+ save_item(NAME(m_c));
+ save_item(NAME(m_skip));
+ save_item(NAME(m_w));
+ save_item(NAME(m_r));
+ save_item(NAME(m_div));
+ save_item(NAME(m_1s));
+ save_item(NAME(m_k_active));
+ save_item(NAME(m_l));
+ save_item(NAME(m_x));
+ save_item(NAME(m_y));
+ save_item(NAME(m_bp));
+ save_item(NAME(m_bc));
+ save_item(NAME(m_halt));
+ save_item(NAME(m_melody_rd));
+ save_item(NAME(m_melody_step_count));
+ save_item(NAME(m_melody_duty_count));
+ save_item(NAME(m_melody_duty_index));
+ save_item(NAME(m_melody_address));
+
+ // register state for debugger
+ state_add(SM510_PC, "PC", m_pc).formatstr("%04X");
+ state_add(SM510_ACC, "ACC", m_acc).formatstr("%01X");
+ state_add(SM510_BL, "BL", m_bl).formatstr("%01X");
+ state_add(SM510_BM, "BM", m_bm).formatstr("%01X");
+ state_add(SM510_C, "C", m_c).formatstr("%01X");
+ state_add(SM510_W, "W", m_w).formatstr("%02X");
+
+ state_add(STATE_GENPC, "curpc", m_pc).formatstr("%04X").noshow();
+ state_add(STATE_GENFLAGS, "GENFLAGS", m_c).formatstr("%1s").noshow();
+
+ m_icountptr = &m_icount;
+
+ // init peripherals
+ init_divider();
+ init_lcd_driver();
+ init_melody();
+}
+
+
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void sm510_base_device::device_reset()
+{
+ m_skip = false;
+ m_halt = false;
+ m_op = m_prev_op = 0;
+ do_branch(3, 7, 0);
+ m_prev_pc = m_pc;
+
+ // lcd is on (Bp on, BC off, bs(y) off)
+ m_bp = true;
+ m_bc = false;
+ m_y = 0;
+
+ m_r = 0;
+ m_write_r(0, 0, 0xff);
+ m_melody_rd &= ~1;
+}
+
+
+
+//-------------------------------------------------
+// lcd driver
+//-------------------------------------------------
+
+inline UINT16 sm510_base_device::get_lcd_row(int column, UINT8* ram)
+{
+ // output 0 if lcd blackpate/bleeder is off, or in case row doesn't exist
+ if (ram == NULL || m_bc || !m_bp)
+ return 0;
+
+ UINT16 rowdata = 0;
+ for (int i = 0; i < 0x10; i++)
+ rowdata |= (ram[i] >> column & 1) << i;
+
+ return rowdata;
+}
+
+TIMER_CALLBACK_MEMBER(sm510_base_device::lcd_timer_cb)
+{
+ // 4 columns
+ for (int h = 0; h < 4; h++)
+ {
+ // 16 segments per row from upper part of RAM
+ m_write_sega(h | SM510_PORT_SEGA, get_lcd_row(h, m_lcd_ram_a), 0xffff);
+ m_write_segb(h | SM510_PORT_SEGB, get_lcd_row(h, m_lcd_ram_b), 0xffff);
+ m_write_segc(h | SM510_PORT_SEGC, get_lcd_row(h, m_lcd_ram_c), 0xffff);
+
+ // bs output from L/X and Y regs
+ UINT8 bs = (m_l >> h & 1) | ((m_x*2) >> h & 2);
+ m_write_segbs(h | SM510_PORT_SEGBS, (m_bc || !m_bp) ? 0 : bs, 0xffff);
+ }
+
+ // schedule next timeout
+ m_lcd_timer->adjust(attotime::from_ticks(0x200, unscaled_clock()));
+}
+
+void sm510_base_device::init_lcd_driver()
+{
+ // note: in reality, this timer runs at high frequency off the main divider, strobing one segment at a time
+ m_lcd_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sm510_base_device::lcd_timer_cb), this));
+ m_lcd_timer->adjust(attotime::from_ticks(0x200, unscaled_clock())); // 64hz default
+}
+
+
+
+//-------------------------------------------------
+// melody controller
+//-------------------------------------------------
+
+void sm510_base_device::clock_melody()
+{
+ if (!m_melody_rom)
+ return;
+
+ // tone cycle table (SM511/SM512 datasheet fig.5)
+ // cmd 0 = cmd, 1 = stop, > 13 = illegal(unknown)
+ static const UINT8 lut_tone_cycles[4*16] =
+ {
+ 0, 0, 7, 8, 8, 9, 9, 10,11,11,12,13,14,14, 7*2, 8*2,
+ 0, 0, 8, 8, 9, 9, 10,11,11,12,13,13,14,15, 8*2, 8*2,
+ 0, 0, 8, 8, 9, 9, 10,10,11,12,12,13,14,15, 8*2, 8*2,
+ 0, 0, 8, 9, 9, 10,10,11,11,12,13,14,14,15, 8*2, 9*2
+ };
+
+ UINT8 cmd = m_melody_rom[m_melody_address] & 0x3f;
+ UINT8 out = 0;
+
+ // clock duty cycle if tone is active
+ if ((cmd & 0xf) > 1)
+ {
+ out = m_melody_duty_index & m_melody_rd & 1;
+ m_melody_duty_count++;
+ int index = m_melody_duty_index << 4 | (cmd & 0xf);
+ int shift = ~cmd >> 4 & 1; // OCT
+
+ if (m_melody_duty_count >= (lut_tone_cycles[index] << shift))
+ {
+ m_melody_duty_count = 0;
+ m_melody_duty_index = (m_melody_duty_index + 1) & 3;
+ }
+ }
+ else if ((cmd & 0xf) == 1)
+ {
+ // rest tell signal
+ m_melody_rd |= 2;
+ }
+
+ // clock time base on F8(d7)
+ if ((m_div & 0x7f) == 0)
+ {
+ UINT8 mask = (cmd & 0x20) ? 0x1f : 0x0f;
+ m_melody_step_count = (m_melody_step_count + 1) & mask;
+
+ if (m_melody_step_count == 0)
+ m_melody_address++;
+ }
+
+ // output to R pin
+ if (out != m_r)
+ {
+ m_write_r(0, out, 0xff);
+ m_r = out;
+ }
+}
+
+void sm510_base_device::init_melody()
+{
+ if (!m_melody_rom)
+ return;
+
+ // verify melody rom
+ for (int i = 0; i < 0x100; i++)
+ {
+ UINT8 data = m_melody_rom[i];
+ if (data & 0xc0 || (data & 0x0f) > 13)
+ logerror("%s unknown melody ROM data $%02X at $%02X\n", tag(), data, i);
+ }
+}
+
+
+
+//-------------------------------------------------
+// interrupt/divider
+//-------------------------------------------------
+
+bool sm510_base_device::wake_me_up()
+{
+ // in halt mode, wake up after 1S signal or K input
+ if (m_k_active || m_1s)
+ {
+ // note: official doc warns that Bl/Bm and the stack are undefined
+ // after waking up, but we leave it unchanged
+ m_halt = false;
+ do_branch(1, 0, 0);
+
+ standard_irq_callback(0);
+ return true;
+ }
+ else
+ return false;
+}
+
+void sm510_base_device::execute_set_input(int line, int state)
+{
+ if (line != SM510_INPUT_LINE_K)
+ return;
+
+ // set K input lines active state
+ m_k_active = (state != 0);
+}
+
+TIMER_CALLBACK_MEMBER(sm510_base_device::div_timer_cb)
+{
+ m_div = (m_div + 1) & 0x7fff;
+
+ // 1S signal on overflow(falling edge of f1)
+ if (m_div == 0)
+ m_1s = true;
+
+ clock_melody();
+}
+
+void sm510_base_device::init_divider()
+{
+ m_div_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sm510_base_device::div_timer_cb), this));
+ m_div_timer->adjust(attotime::from_ticks(1, unscaled_clock()), 0, attotime::from_ticks(1, unscaled_clock()));
+}
+
+
+
+//-------------------------------------------------
+// execute
+//-------------------------------------------------
+
+void sm510_base_device::increment_pc()
+{
+ // PL(program counter low 6 bits) is a simple LFSR: newbit = (bit0==bit1)
+ // PU,PM(high bits) specify page, PL specifies steps within page
+ int feed = ((m_pc >> 1 ^ m_pc) & 1) ? 0 : 0x20;
+ m_pc = feed | (m_pc >> 1 & 0x1f) | (m_pc & ~0x3f);
+}
+
+void sm510_base_device::execute_run()
+{
+ while (m_icount > 0)
+ {
+ m_icount--;
+
+ if (m_halt && !wake_me_up())
+ {
+ // got nothing to do
+ m_icount = 0;
+ return;
+ }
+
+ // remember previous state
+ m_prev_op = m_op;
+ m_prev_pc = m_pc;
+
+ // fetch next opcode
+ debugger_instruction_hook(this, m_pc);
+ m_op = m_program->read_byte(m_pc);
+ increment_pc();
+ get_opcode_param();
+
+ // handle opcode if it's not skipped
+ if (m_skip)
+ {
+ m_skip = false;
+ m_op = 0; // fake nop
+ }
+ else
+ execute_one();
+ }
+}
diff --git a/src/emu/cpu/sm510/sm510.h b/src/emu/cpu/sm510/sm510.h
new file mode 100644
index 00000000000..b50cea20957
--- /dev/null
+++ b/src/emu/cpu/sm510/sm510.h
@@ -0,0 +1,307 @@
+// license:BSD-3-Clause
+// copyright-holders:hap
+/*
+
+ Sharp SM510 MCU family cores
+
+*/
+
+#ifndef _SM510_H_
+#define _SM510_H_
+
+#include "emu.h"
+
+
+// I/O ports setup
+
+// 4-bit K input port (pull-down)
+#define MCFG_SM510_READ_K_CB(_devcb) \
+ sm510_base_device::set_read_k_callback(*device, DEVCB_##_devcb);
+// when in halt state, any K input going High can wake up the CPU,
+// driver is required to use execute_set_input(SM510_INPUT_LINE_K, state)
+#define SM510_INPUT_LINE_K 0
+
+// 1-bit BA input pin (pull-up)
+#define MCFG_SM510_READ_BA_CB(_devcb) \
+ sm510_base_device::set_read_ba_callback(*device, DEVCB_##_devcb);
+
+// 1-bit B(beta) input pin (pull-up)
+#define MCFG_SM510_READ_B_CB(_devcb) \
+ sm510_base_device::set_read_b_callback(*device, DEVCB_##_devcb);
+
+// 8-bit S strobe output port
+#define MCFG_SM510_WRITE_S_CB(_devcb) \
+ sm510_base_device::set_write_s_callback(*device, DEVCB_##_devcb);
+
+// 2-bit R melody output port
+#define MCFG_SM510_WRITE_R_CB(_devcb) \
+ sm510_base_device::set_write_r_callback(*device, DEVCB_##_devcb);
+
+// LCD segment outputs: H1-4 as offset(low), a/b/c 1-16 as data d0-d15
+#define MCFG_SM510_WRITE_SEGA_CB(_devcb) \
+ sm510_base_device::set_write_sega_callback(*device, DEVCB_##_devcb);
+#define MCFG_SM510_WRITE_SEGB_CB(_devcb) \
+ sm510_base_device::set_write_segb_callback(*device, DEVCB_##_devcb);
+#define MCFG_SM510_WRITE_SEGC_CB(_devcb) \
+ sm510_base_device::set_write_segc_callback(*device, DEVCB_##_devcb);
+
+// LCD bs output: same as above, but only up to 2 bits used
+#define MCFG_SM510_WRITE_SEGBS_CB(_devcb) \
+ sm510_base_device::set_write_segbs_callback(*device, DEVCB_##_devcb);
+
+enum
+{
+ SM510_PORT_SEGA = 0x00,
+ SM510_PORT_SEGB = 0x04,
+ SM510_PORT_SEGBS = 0x08,
+ SM510_PORT_SEGC = 0x0c
+};
+
+
+// pinout reference
+
+/*
+
+*/
+
+class sm510_base_device : public cpu_device
+{
+public:
+ // construction/destruction
+ sm510_base_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, int stack_levels, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source)
+ : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source)
+ , m_program_config("program", ENDIANNESS_LITTLE, 8, prgwidth, 0, program)
+ , m_data_config("data", ENDIANNESS_LITTLE, 8, datawidth, 0, data)
+ , m_prgwidth(prgwidth)
+ , m_datawidth(datawidth)
+ , m_stack_levels(stack_levels)
+ , m_lcd_ram_a(*this, "lcd_ram_a"), m_lcd_ram_b(*this, "lcd_ram_b"), m_lcd_ram_c(*this, "lcd_ram_c")
+ , m_write_sega(*this), m_write_segb(*this), m_write_segc(*this), m_write_segbs(*this)
+ , m_melody_rom(*this, "music")
+ , m_read_k(*this)
+ , m_read_ba(*this), m_read_b(*this)
+ , m_write_s(*this)
+ , m_write_r(*this)
+ { }
+
+ // static configuration helpers
+ template<class _Object> static devcb_base &set_read_k_callback(device_t &device, _Object object) { return downcast<sm510_base_device &>(device).m_read_k.set_callback(object); }
+ template<class _Object> static devcb_base &set_read_ba_callback(device_t &device, _Object object) { return downcast<sm510_base_device &>(device).m_read_ba.set_callback(object); }
+ template<class _Object> static devcb_base &set_read_b_callback(device_t &device, _Object object) { return downcast<sm510_base_device &>(device).m_read_b.set_callback(object); }
+ template<class _Object> static devcb_base &set_write_s_callback(device_t &device, _Object object) { return downcast<sm510_base_device &>(device).m_write_s.set_callback(object); }
+ template<class _Object> static devcb_base &set_write_r_callback(device_t &device, _Object object) { return downcast<sm510_base_device &>(device).m_write_r.set_callback(object); }
+
+ template<class _Object> static devcb_base &set_write_sega_callback(device_t &device, _Object object) { return downcast<sm510_base_device &>(device).m_write_sega.set_callback(object); }
+ template<class _Object> static devcb_base &set_write_segb_callback(device_t &device, _Object object) { return downcast<sm510_base_device &>(device).m_write_segb.set_callback(object); }
+ template<class _Object> static devcb_base &set_write_segc_callback(device_t &device, _Object object) { return downcast<sm510_base_device &>(device).m_write_segc.set_callback(object); }
+ template<class _Object> static devcb_base &set_write_segbs_callback(device_t &device, _Object object) { return downcast<sm510_base_device &>(device).m_write_segbs.set_callback(object); }
+
+protected:
+ // device-level overrides
+ virtual void device_start();
+ virtual void device_reset();
+
+ // device_execute_interface overrides
+ virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const { return (clocks + 2 - 1) / 2; } // default 2 cycles per machine cycle
+ virtual UINT64 execute_cycles_to_clocks(UINT64 cycles) const { return (cycles * 2); } // "
+ virtual UINT32 execute_min_cycles() const { return 1; }
+ virtual UINT32 execute_max_cycles() const { return 2; }
+ virtual UINT32 execute_input_lines() const { return 1; }
+ virtual void execute_set_input(int line, int state);
+ virtual void execute_run();
+ virtual void execute_one() { } // -> child class
+
+ // device_memory_interface overrides
+ virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const { return(spacenum == AS_PROGRAM) ? &m_program_config : ((spacenum == AS_DATA) ? &m_data_config : NULL); }
+
+ // device_disasm_interface overrides
+ virtual UINT32 disasm_min_opcode_bytes() const { return 1; }
+ virtual UINT32 disasm_max_opcode_bytes() const { return 0x40; } // actually 2, but debugger doesn't like non-linear pc
+
+ address_space_config m_program_config;
+ address_space_config m_data_config;
+ address_space *m_program;
+ address_space *m_data;
+
+ int m_prgwidth;
+ int m_datawidth;
+ int m_prgmask;
+ int m_datamask;
+
+ UINT16 m_pc, m_prev_pc;
+ UINT16 m_op, m_prev_op;
+ UINT8 m_param;
+ int m_stack_levels;
+ UINT16 m_stack[2];
+ int m_icount;
+
+ UINT8 m_acc;
+ UINT8 m_bl;
+ UINT8 m_bm;
+ UINT8 m_c;
+ bool m_skip;
+ UINT8 m_w;
+ UINT8 m_r;
+ bool m_k_active;
+ bool m_halt;
+
+ // lcd driver
+ optional_shared_ptr<UINT8> m_lcd_ram_a, m_lcd_ram_b, m_lcd_ram_c;
+ devcb_write16 m_write_sega, m_write_segb, m_write_segc, m_write_segbs;
+ emu_timer *m_lcd_timer;
+ UINT8 m_l, m_x;
+ UINT8 m_y;
+ bool m_bp;
+ bool m_bc;
+
+ UINT16 get_lcd_row(int column, UINT8* ram);
+ TIMER_CALLBACK_MEMBER(lcd_timer_cb);
+ void init_lcd_driver();
+
+ // melody controller
+ optional_region_ptr<UINT8> m_melody_rom;
+ UINT8 m_melody_rd;
+ UINT8 m_melody_step_count;
+ UINT8 m_melody_duty_count;
+ UINT8 m_melody_duty_index;
+ UINT8 m_melody_address;
+
+ void clock_melody();
+ void init_melody();
+
+ // interrupt/divider
+ emu_timer *m_div_timer;
+ UINT16 m_div;
+ bool m_1s;
+
+ bool wake_me_up();
+ void init_divider();
+ TIMER_CALLBACK_MEMBER(div_timer_cb);
+
+ // other i/o handlers
+ devcb_read8 m_read_k;
+ devcb_read_line m_read_ba;
+ devcb_read_line m_read_b;
+ devcb_write8 m_write_s;
+ devcb_write8 m_write_r;
+
+ // misc internal helpers
+ void increment_pc();
+ virtual void get_opcode_param() { }
+ virtual void update_w_latch() { }
+
+ UINT8 ram_r();
+ void ram_w(UINT8 data);
+ void pop_stack();
+ void push_stack();
+ void do_branch(UINT8 pu, UINT8 pm, UINT8 pl);
+ UINT8 bitmask(UINT16 param);
+
+ // opcode handlers
+ void op_lb();
+ void op_lbl();
+ void op_sbm();
+ void op_exbla();
+ void op_incb();
+ void op_decb();
+
+ void op_atpl();
+ void op_rtn0();
+ void op_rtn1();
+ void op_tl();
+ void op_tml();
+ void op_tm();
+ void op_t();
+
+ void op_exc();
+ void op_bdc();
+ void op_exci();
+ void op_excd();
+ void op_lda();
+ void op_lax();
+ void op_ptw();
+ void op_wr();
+ void op_ws();
+
+ void op_kta();
+ void op_atbp();
+ void op_atx();
+ void op_atl();
+ void op_atfc();
+ void op_atr();
+
+ void op_add();
+ void op_add11();
+ void op_adx();
+ void op_coma();
+ void op_rot();
+ void op_rc();
+ void op_sc();
+
+ void op_tb();
+ void op_tc();
+ void op_tam();
+ void op_tmi();
+ void op_ta0();
+ void op_tabl();
+ void op_tis();
+ void op_tal();
+ void op_tf1();
+ void op_tf4();
+
+ void op_rm();
+ void op_sm();
+
+ void op_pre();
+ void op_sme();
+ void op_rme();
+ void op_tmel();
+
+ void op_skip();
+ void op_cend();
+ void op_idiv();
+
+ void op_illegal();
+};
+
+
+class sm510_device : public sm510_base_device
+{
+public:
+ sm510_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+protected:
+ virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options);
+ virtual void execute_one();
+ virtual void get_opcode_param();
+
+ virtual void update_w_latch() { m_write_s(0, m_w, 0xff); } // W is connected directly to S
+};
+
+
+class sm511_device : public sm510_base_device
+{
+public:
+ sm511_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ sm511_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, int stack_levels, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source);
+
+protected:
+ virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options);
+ virtual void execute_one();
+ virtual void get_opcode_param();
+};
+
+class sm512_device : public sm511_device
+{
+public:
+ sm512_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+
+
+extern const device_type SM510;
+extern const device_type SM511;
+extern const device_type SM512;
+
+
+#endif /* _SM510_H_ */
diff --git a/src/emu/cpu/sm510/sm510core.c b/src/emu/cpu/sm510/sm510core.c
new file mode 100644
index 00000000000..bf1449804c3
--- /dev/null
+++ b/src/emu/cpu/sm510/sm510core.c
@@ -0,0 +1,136 @@
+// license:BSD-3-Clause
+// copyright-holders:hap
+/*
+
+ Sharp SM510 MCU core implementation
+
+*/
+
+#include "sm510.h"
+#include "debugger.h"
+
+
+// MCU types
+const device_type SM510 = &device_creator<sm510_device>;
+
+
+// internal memory maps
+static ADDRESS_MAP_START(program_2_7k, AS_PROGRAM, 8, sm510_base_device)
+ AM_RANGE(0x0000, 0x02bf) AM_ROM
+ AM_RANGE(0x0400, 0x06bf) AM_ROM
+ AM_RANGE(0x0800, 0x0abf) AM_ROM
+ AM_RANGE(0x0c00, 0x0ebf) AM_ROM
+ADDRESS_MAP_END
+
+static ADDRESS_MAP_START(data_96_32x4, AS_DATA, 8, sm510_base_device)
+ AM_RANGE(0x00, 0x5f) AM_RAM
+ AM_RANGE(0x60, 0x6f) AM_RAM AM_SHARE("lcd_ram_a")
+ AM_RANGE(0x70, 0x7f) AM_RAM AM_SHARE("lcd_ram_b")
+ADDRESS_MAP_END
+
+
+// device definitions
+sm510_device::sm510_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : sm510_base_device(mconfig, SM510, "SM510", tag, owner, clock, 2 /* stack levels */, 12 /* prg width */, ADDRESS_MAP_NAME(program_2_7k), 7 /* data width */, ADDRESS_MAP_NAME(data_96_32x4), "sm510", __FILE__)
+{ }
+
+
+// disasm
+offs_t sm510_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options)
+{
+ extern CPU_DISASSEMBLE(sm510);
+ return CPU_DISASSEMBLE_NAME(sm510)(this, buffer, pc, oprom, opram, options);
+}
+
+
+
+//-------------------------------------------------
+// execute
+//-------------------------------------------------
+
+void sm510_device::get_opcode_param()
+{
+ // LBL, TL, TML opcodes are 2 bytes
+ if (m_op == 0x5f || (m_op & 0xf0) == 0x70)
+ {
+ m_icount--;
+ m_param = m_program->read_byte(m_pc);
+ increment_pc();
+ }
+}
+
+void sm510_device::execute_one()
+{
+ switch (m_op & 0xf0)
+ {
+ case 0x20: op_lax(); break;
+ case 0x30: op_adx(); break;
+ case 0x40: op_lb(); break;
+
+ case 0x80: case 0x90: case 0xa0: case 0xb0:
+ op_t(); break;
+ case 0xc0: case 0xd0: case 0xe0: case 0xf0:
+ op_tm(); break;
+
+ default:
+ switch (m_op & 0xfc)
+ {
+ case 0x04: op_rm(); break;
+ case 0x0c: op_sm(); break;
+ case 0x10: op_exc(); break;
+ case 0x14: op_exci(); break;
+ case 0x18: op_lda(); break;
+ case 0x1c: op_excd(); break;
+ case 0x54: op_tmi(); break;
+ case 0x70: case 0x74: case 0x78: op_tl(); break;
+ case 0x7c: op_tml(); break;
+
+ default:
+ switch (m_op)
+ {
+ case 0x00: op_skip(); break;
+ case 0x01: op_atbp(); break;
+ case 0x02: op_sbm(); break;
+ case 0x03: op_atpl(); break;
+ case 0x08: op_add(); break;
+ case 0x09: op_add11(); break;
+ case 0x0a: op_coma(); break;
+ case 0x0b: op_exbla(); break;
+
+ case 0x51: op_tb(); break;
+ case 0x52: op_tc(); break;
+ case 0x53: op_tam(); break;
+ case 0x58: op_tis(); break;
+ case 0x59: op_atl(); break;
+ case 0x5a: op_ta0(); break;
+ case 0x5b: op_tabl(); break;
+ case 0x5d: op_cend(); break;
+ case 0x5e: op_tal(); break;
+ case 0x5f: op_lbl(); break;
+
+ case 0x60: op_atfc(); break;
+ case 0x61: op_atr(); break;
+ case 0x62: op_wr(); break;
+ case 0x63: op_ws(); break;
+ case 0x64: op_incb(); break;
+ case 0x65: op_idiv(); break;
+ case 0x66: op_rc(); break;
+ case 0x67: op_sc(); break;
+ case 0x68: op_tf1(); break;
+ case 0x69: op_tf4(); break;
+ case 0x6a: op_kta(); break;
+ case 0x6b: op_rot(); break;
+ case 0x6c: op_decb(); break;
+ case 0x6d: op_bdc(); break;
+ case 0x6e: op_rtn0(); break;
+ case 0x6f: op_rtn1(); break;
+
+ default: op_illegal(); break;
+ }
+ break; // 0xff
+
+ }
+ break; // 0xfc
+
+ } // big switch
+}
diff --git a/src/emu/cpu/sm510/sm510d.c b/src/emu/cpu/sm510/sm510d.c
new file mode 100644
index 00000000000..fec8bc44bbd
--- /dev/null
+++ b/src/emu/cpu/sm510/sm510d.c
@@ -0,0 +1,215 @@
+// license:BSD-3-Clause
+// copyright-holders:hap
+/*
+
+ Sharp SM510 MCU family disassembler
+
+*/
+
+#include "emu.h"
+#include "debugger.h"
+#include "sm510.h"
+
+
+// common lookup tables
+
+enum e_mnemonics
+{
+ mILL, mEXT,
+ mLB, mLBL, mSBM, mEXBLA, mINCB, mDECB,
+ mATPL, mRTN0, mRTN1, mTL, mTML, mTM, mT,
+ mEXC, mBDC, mEXCI, mEXCD, mLDA, mLAX, mPTW, mWR, mWS,
+ mKTA, mATBP, mATX, mATL, mATFC, mATR,
+ mADD, mADD11, mADX, mCOMA, mROT, mRC, mSC,
+ mTB, mTC, mTAM, mTMI, mTA0, mTABL, mTIS, mTAL, mTF1, mTF4,
+ mRM, mSM,
+ mPRE, mSME, mRME, mTMEL,
+ mSKIP, mCEND, mIDIV
+};
+
+static const char *const s_mnemonics[] =
+{
+ "?", "",
+ "LB", "LBL", "SBM", "EXBLA", "INCB", "DECB",
+ "ATPL", "RTN0", "RTN1", "TL", "TML", "TM", "T",
+ "EXC", "BDC", "EXCI", "EXCD", "LDA", "LAX", "PTW", "WR", "WS",
+ "KTA", "ATBP", "ATX", "ATL", "ATFC", "ATR",
+ "ADD", "ADD11", "ADX", "COMA", "ROT", "RC", "SC",
+ "TB", "TC", "TAM", "TMI", "TA0", "TABL", "TIS", "TAL", "TF1", "TF4",
+ "RM", "SM",
+ "PRE", "SME", "RME", "TMEL",
+ "SKIP", "CEND", "IDIV"
+};
+
+// number of bits per opcode parameter, 8 or larger means 2-byte opcode
+static const UINT8 s_bits[] =
+{
+ 0, 8,
+ 4, 8, 0, 0, 0, 0,
+ 0, 0, 0, 4+8, 2+8, 6, 6,
+ 2, 0, 2, 2, 2, 4, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 4, 0, 0, 0, 0,
+ 0, 0, 0, 2, 0, 0, 0, 0, 0, 0,
+ 2, 2,
+ 8, 0, 0, 0,
+ 0, 0, 0
+};
+
+#define _OVER DASMFLAG_STEP_OVER
+#define _OUT DASMFLAG_STEP_OUT
+
+static const UINT32 s_flags[] =
+{
+ 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 0, _OUT, _OUT, 0, _OVER, _OVER, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0,
+ 0, 0, 0, 0,
+ 0, _OVER, 0
+};
+
+// next program counter in sequence (relative)
+static const INT8 s_next_pc[0x40] =
+{
+ 32, -1 /* rollback */, -1, 30, 30, -3, -3, 28, 28, -5, -5, 26, 26, -7, -7, 24,
+ 24, -9, -9, 22, 22, -11, -11, 20, 20, -13, -13, 18, 18, -15, -15, 16,
+ 16, -17, -17, 14, 14, -19, -19, 12, 12, -21, -21, 10, 10, -23, -23, 8,
+ 8, -25, -25, 6, 6, -27, -27, 4, 4, -29, -29, 2, 2, -31, -31, 0 /* gets stuck here */
+};
+
+
+
+// common disasm
+
+static offs_t sm510_common_disasm(const UINT8 *lut_mnemonic, const UINT8 *lut_extended, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram)
+{
+ // get raw opcode
+ UINT8 op = oprom[0];
+ UINT8 instr = lut_mnemonic[op];
+ int len = 1;
+
+ int bits = s_bits[instr];
+ UINT8 mask = op & ((1 << (bits & 7)) - 1);
+ UINT16 param = mask;
+ if (bits >= 8)
+ {
+ // note: disasm view shows correct parameter, but raw view does not
+ // note2: oprom array negative index doesn't work either :(
+ param = oprom[s_next_pc[pc & 0x3f]];
+ len++;
+ }
+
+ // extended opcode
+ bool is_extended = (instr == mEXT);
+ if (is_extended)
+ instr = lut_extended[param];
+
+ // disassemble it
+ char *dst = buffer;
+ dst += sprintf(dst, "%-6s ", s_mnemonics[instr]);
+ if (bits > 0)
+ {
+ if (bits <= 4)
+ {
+ if (param < 10)
+ dst += sprintf(dst, "%d", param);
+ else
+ dst += sprintf(dst, "$%X", param);
+ }
+ else if (bits <= 8)
+ {
+ if (!is_extended)
+ dst += sprintf(dst, "$%02X", param);
+ }
+ else
+ {
+ UINT16 address = (param << 4 & 0xc00) | (mask << 6 & 0x3c0) | (param & 0x03f);
+ dst += sprintf(dst, "$%03X", address);
+ }
+
+ // show param offset
+ if (bits >= 8)
+ dst += sprintf(dst, " [$%03X]", pc + s_next_pc[pc & 0x3f]);
+ }
+
+ return len | s_flags[instr] | DASMFLAG_SUPPORTED;
+}
+
+
+// SM510 disasm
+
+static const UINT8 sm510_mnemonic[0x100] =
+{
+/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */
+ mSKIP, mATBP, mSBM, mATPL, mRM, mRM, mRM, mRM, mADD, mADD11,mCOMA, mEXBLA,mSM, mSM, mSM, mSM, // 0
+ mEXC, mEXC, mEXC, mEXC, mEXCI, mEXCI, mEXCI, mEXCI, mLDA, mLDA, mLDA, mLDA, mEXCD, mEXCD, mEXCD, mEXCD, // 1
+ mLAX, mLAX, mLAX, mLAX, mLAX, mLAX, mLAX, mLAX, mLAX, mLAX, mLAX, mLAX, mLAX, mLAX, mLAX, mLAX, // 2
+ mADX, mADX, mADX, mADX, mADX, mADX, mADX, mADX, mADX, mADX, mADX, mADX, mADX, mADX, mADX, mADX, // 3 - note: $3A has synonym DC(decimal correct)
+
+ mLB, mLB, mLB, mLB, mLB, mLB, mLB, mLB, mLB, mLB, mLB, mLB, mLB, mLB, mLB, mLB, // 4
+ 0, mTB, mTC, mTAM, mTMI, mTMI, mTMI, mTMI, mTIS, mATL, mTA0, mTABL, 0, mCEND, mTAL, mLBL, // 5
+ mATFC, mATR, mWR, mWS, mINCB, mIDIV, mRC, mSC, mTF1, mTF4, mKTA, mROT, mDECB, mBDC, mRTN0, mRTN1, // 6
+ mTL, mTL, mTL, mTL, mTL, mTL, mTL, mTL, mTL, mTL, mTL, mTL, mTML, mTML, mTML, mTML, // 7
+
+ mT, mT, mT, mT, mT, mT, mT, mT, mT, mT, mT, mT, mT, mT, mT, mT, // 8
+ mT, mT, mT, mT, mT, mT, mT, mT, mT, mT, mT, mT, mT, mT, mT, mT, // 9
+ mT, mT, mT, mT, mT, mT, mT, mT, mT, mT, mT, mT, mT, mT, mT, mT, // A
+ mT, mT, mT, mT, mT, mT, mT, mT, mT, mT, mT, mT, mT, mT, mT, mT, // B
+
+ mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, // C
+ mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, // D
+ mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, // E
+ mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM // F
+};
+
+CPU_DISASSEMBLE(sm510)
+{
+ return sm510_common_disasm(sm510_mnemonic, NULL, buffer, pc, oprom, opram);
+}
+
+
+// SM511 disasm
+
+static const UINT8 sm511_mnemonic[0x100] =
+{
+/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */
+ mROT, 0, mSBM, mATPL, mRM, mRM, mRM, mRM, mADD, mADD11,mCOMA, mEXBLA,mSM, mSM, mSM, mSM, // 0
+ mEXC, mEXC, mEXC, mEXC, mEXCI, mEXCI, mEXCI, mEXCI, mLDA, mLDA, mLDA, mLDA, mEXCD, mEXCD, mEXCD, mEXCD, // 1
+ mLAX, mLAX, mLAX, mLAX, mLAX, mLAX, mLAX, mLAX, mLAX, mLAX, mLAX, mLAX, mLAX, mLAX, mLAX, mLAX, // 2
+ mADX, mADX, mADX, mADX, mADX, mADX, mADX, mADX, mADX, mADX, mADX, mADX, mADX, mADX, mADX, mADX, // 3
+
+ mLB, mLB, mLB, mLB, mLB, mLB, mLB, mLB, mLB, mLB, mLB, mLB, mLB, mLB, mLB, mLB, // 4
+ mKTA, mTB, mTC, mTAM, mTMI, mTMI, mTMI, mTMI, mTIS, mATL, mTA0, mTABL, mATX, 0, mTAL, mLBL, // 5
+ mEXT, mPRE, mWR, mWS, mINCB, 0, mRC, mSC, mTML, mTML, mTML, mTML, mDECB, mPTW, mRTN0, mRTN1, // 6
+ mTL, mTL, mTL, mTL, mTL, mTL, mTL, mTL, mTL, mTL, mTL, mTL, mTL, mTL, mTL, mTL, // 7
+
+ mT, mT, mT, mT, mT, mT, mT, mT, mT, mT, mT, mT, mT, mT, mT, mT, // 8
+ mT, mT, mT, mT, mT, mT, mT, mT, mT, mT, mT, mT, mT, mT, mT, mT, // 9
+ mT, mT, mT, mT, mT, mT, mT, mT, mT, mT, mT, mT, mT, mT, mT, mT, // A
+ mT, mT, mT, mT, mT, mT, mT, mT, mT, mT, mT, mT, mT, mT, mT, mT, // B
+
+ mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, // C
+ mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, // D
+ mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, // E
+ mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM, mTM // F
+};
+
+static const UINT8 sm511_extended[0x10] =
+{
+ mRME, mSME, mTMEL, mATFC, mBDC, mATBP, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 60 3
+};
+
+CPU_DISASSEMBLE(sm511)
+{
+ // create extended opcode table
+ UINT8 ext[0x100];
+ memset(ext, 0, 0x100);
+ memcpy(ext + 0x30, sm511_extended, 0x10);
+
+ return sm510_common_disasm(sm511_mnemonic, ext, buffer, pc, oprom, opram);
+}
diff --git a/src/emu/cpu/sm510/sm510op.c b/src/emu/cpu/sm510/sm510op.c
new file mode 100644
index 00000000000..bb0f4975511
--- /dev/null
+++ b/src/emu/cpu/sm510/sm510op.c
@@ -0,0 +1,456 @@
+// license:BSD-3-Clause
+// copyright-holders:hap
+
+// SM510 opcode handlers
+
+#include "sm510.h"
+
+
+// internal helpers
+
+inline UINT8 sm510_base_device::ram_r()
+{
+ int bmh = (m_prev_op == 0x02) ? (1 << (m_datawidth-1)) : 0; // from SBM
+ UINT8 address = (bmh | m_bm << 4 | m_bl) & m_datamask;
+ return m_data->read_byte(address) & 0xf;
+}
+
+inline void sm510_base_device::ram_w(UINT8 data)
+{
+ int bmh = (m_prev_op == 0x02) ? (1 << (m_datawidth-1)) : 0; // from SBM
+ UINT8 address = (bmh | m_bm << 4 | m_bl) & m_datamask;
+ m_data->write_byte(address, data & 0xf);
+}
+
+void sm510_base_device::pop_stack()
+{
+ m_pc = m_stack[0] & m_prgmask;
+ for (int i = 0; i < m_stack_levels-1; i++)
+ m_stack[i] = m_stack[i+1];
+}
+
+void sm510_base_device::push_stack()
+{
+ for (int i = m_stack_levels-1; i >= 1; i--)
+ m_stack[i] = m_stack[i-1];
+ m_stack[0] = m_pc;
+}
+
+void sm510_base_device::do_branch(UINT8 pu, UINT8 pm, UINT8 pl)
+{
+ // set new PC(Pu/Pm/Pl)
+ m_pc = ((pu << 10 & 0xc00) | (pm << 6 & 0x3c0) | (pl & 0x03f)) & m_prgmask;
+}
+
+inline UINT8 sm510_base_device::bitmask(UINT16 param)
+{
+ // bitmask from immediate opcode param
+ return 1 << (param & 3);
+}
+
+
+
+// instruction set
+
+// RAM address instructions
+
+void sm510_base_device::op_lb()
+{
+ // LB x: load BM/BL with 4-bit immediate value (partial)
+
+ // SM510 WIP..
+ // bm and bl(low) are probably ok!
+ m_bm = (m_bm & 4) | (m_op & 3);
+ m_bl = (m_op >> 2 & 3);
+
+ // bl(high) is still unclear, official doc is confusing
+ UINT8 hi = 0;
+ switch (m_bl)
+ {
+ case 0: hi = 3; break;
+ case 1: hi = 0; break;
+ case 2: hi = 0; break;
+ case 3: hi = 3; break;
+ }
+ m_bl |= (hi << 2 & 0xc);
+}
+
+void sm510_base_device::op_lbl()
+{
+ // LBL xy: load BM/BL with 8-bit immediate value
+ m_bl = m_param & 0xf;
+ m_bm = (m_param & m_datamask) >> 4;
+}
+
+void sm510_base_device::op_sbm()
+{
+ // SBM: set BM high bit for next opcode - handled in ram_r/w
+ assert(m_op == 0x02);
+}
+
+void sm510_base_device::op_exbla()
+{
+ // EXBLA: exchange BL with ACC
+ UINT8 a = m_acc;
+ m_acc = m_bl;
+ m_bl = a;
+}
+
+void sm510_base_device::op_incb()
+{
+ // INCB: increment BL, skip next on overflow
+ m_bl = (m_bl + 1) & 0xf;
+ m_skip = (m_bl == 0);
+}
+
+void sm510_base_device::op_decb()
+{
+ // DECB: decrement BL, skip next on overflow
+ m_bl = (m_bl - 1) & 0xf;
+ m_skip = (m_bl == 0xf);
+}
+
+
+// ROM address instructions
+
+void sm510_base_device::op_atpl()
+{
+ // ATPL: load Pl(PC low bits) with ACC
+ m_pc = (m_pc & ~0xf) | m_acc;
+}
+
+void sm510_base_device::op_rtn0()
+{
+ // RTN0: return from subroutine
+ pop_stack();
+}
+
+void sm510_base_device::op_rtn1()
+{
+ // RTN1: return from subroutine, skip next
+ op_rtn0();
+ m_skip = true;
+}
+
+void sm510_base_device::op_t()
+{
+ // T xy: jump(transfer) within current page
+ m_pc = (m_pc & ~0x3f) | (m_op & 0x3f);
+}
+
+void sm510_base_device::op_tl()
+{
+ // TL xyz: long jump
+ do_branch(m_param >> 6 & 3, m_op & 0xf, m_param & 0x3f);
+}
+
+void sm510_base_device::op_tml()
+{
+ // TML xyz: long call
+ push_stack();
+ do_branch(m_param >> 6 & 3, m_op & 3, m_param & 0x3f);
+}
+
+void sm510_base_device::op_tm()
+{
+ // TM x: indirect subroutine call, pointers(IDX) are in page 0
+ m_icount--;
+ push_stack();
+ UINT8 idx = m_program->read_byte(m_op & 0x3f);
+ do_branch(idx >> 6 & 3, 4, idx & 0x3f);
+}
+
+
+
+// Data transfer instructions
+
+void sm510_base_device::op_exc()
+{
+ // EXC x: exchange ACC with RAM, xor BM with x
+ UINT8 a = m_acc;
+ m_acc = ram_r();
+ ram_w(a);
+ m_bm ^= (m_op & 3);
+}
+
+void sm510_base_device::op_bdc()
+{
+ // BDC: enable LCD bleeder current with C
+ m_bc = (m_c != 0);
+}
+
+void sm510_base_device::op_exci()
+{
+ // EXCI x: EXC x, INCB
+ op_exc();
+ op_incb();
+}
+
+void sm510_base_device::op_excd()
+{
+ // EXCD x: EXC x, DECB
+ op_exc();
+ op_decb();
+}
+
+void sm510_base_device::op_lda()
+{
+ // LDA x: load ACC with RAM, xor BM with x
+ m_acc = ram_r();
+ m_bm ^= (m_op & 3);
+}
+
+void sm510_base_device::op_lax()
+{
+ // LAX x: load ACC with immediate value, skip any next LAX
+ if ((m_op & ~0xf) != (m_prev_op & ~0xf))
+ m_acc = m_op & 0xf;
+}
+
+void sm510_base_device::op_ptw()
+{
+ // PTW: output W latch
+ m_write_s(0, m_w, 0xff);
+}
+
+void sm510_base_device::op_wr()
+{
+ // WR: shift 0 into W
+ m_w = m_w << 1 | 0;
+ update_w_latch();
+}
+
+void sm510_base_device::op_ws()
+{
+ // WR: shift 1 into W
+ m_w = m_w << 1 | 1;
+ update_w_latch();
+}
+
+
+// I/O instructions
+
+void sm510_base_device::op_kta()
+{
+ // KTA: input K to ACC
+ m_acc = m_read_k(0, 0xff) & 0xf;
+}
+
+void sm510_base_device::op_atbp()
+{
+ // ATBP: output ACC to BP(internal LCD backplate signal)
+ m_bp = ((m_acc & 1) != 0);
+}
+
+void sm510_base_device::op_atx()
+{
+ // ATX: output ACC to X
+ m_x = m_acc;
+}
+
+void sm510_base_device::op_atl()
+{
+ // ATL: output ACC to L
+ m_l = m_acc;
+}
+
+void sm510_base_device::op_atfc()
+{
+ // ATFC: output ACC to Y
+ m_y = m_acc;
+}
+
+void sm510_base_device::op_atr()
+{
+ // ATR: output ACC to R
+ if (m_r != (m_acc & 3))
+ {
+ m_r = m_acc & 3;
+ m_write_r(0, m_r, 0xff);
+ }
+}
+
+
+// Arithmetic instructions
+
+void sm510_base_device::op_add()
+{
+ // ADD: add RAM to ACC
+ m_acc = (m_acc + ram_r()) & 0xf;
+}
+
+void sm510_base_device::op_add11()
+{
+ // ADD11: add RAM and carry to ACC and carry, skip next on carry
+ m_acc += ram_r() + m_c;
+ m_c = m_acc >> 4 & 1;
+ m_skip = (m_c == 1);
+ m_acc &= 0xf;
+}
+
+void sm510_base_device::op_adx()
+{
+ // ADX x: add immediate value to ACC, skip next on carry
+ m_acc += (m_op & 0xf);
+ m_skip = ((m_acc & 0x10) != 0);
+ m_acc &= 0xf;
+}
+
+void sm510_base_device::op_coma()
+{
+ // COMA: complement ACC
+ m_acc ^= 0xf;
+}
+
+void sm510_base_device::op_rot()
+{
+ // ROT: rotate ACC right through carry
+ UINT8 c = m_acc & 1;
+ m_acc = m_acc >> 1 | m_c << 3;
+ m_c = c;
+}
+
+void sm510_base_device::op_rc()
+{
+ // RC: reset carry
+ m_c = 0;
+}
+
+void sm510_base_device::op_sc()
+{
+ // SC: set carry
+ m_c = 1;
+}
+
+
+// Test instructions
+
+void sm510_base_device::op_tb()
+{
+ // TB: skip next if B(beta) pin is set
+ m_skip = (m_read_b() != 0);
+}
+
+void sm510_base_device::op_tc()
+{
+ // TC: skip next if no carry
+ m_skip = !m_c;
+}
+
+void sm510_base_device::op_tam()
+{
+ // TAM: skip next if ACC equals RAM
+ m_skip = (m_acc == ram_r());
+}
+
+void sm510_base_device::op_tmi()
+{
+ // TMI x: skip next if RAM bit is set
+ m_skip = ((ram_r() & bitmask(m_op)) != 0);
+}
+
+void sm510_base_device::op_ta0()
+{
+ // TA0: skip next if ACC is clear
+ m_skip = !m_acc;
+}
+
+void sm510_base_device::op_tabl()
+{
+ // TABL: skip next if ACC equals BL
+ m_skip = (m_acc == m_bl);
+}
+
+void sm510_base_device::op_tis()
+{
+ // TIS: skip next if 1S(gamma flag) is clear, reset it after
+ m_skip = !m_1s;
+ m_1s = false;
+}
+
+void sm510_base_device::op_tal()
+{
+ // TAL: skip next if BA pin is set
+ m_skip = (m_read_ba() != 0);
+}
+
+void sm510_base_device::op_tf1()
+{
+ // TF1: skip next if divider F1(d14) is set
+ m_skip = ((m_div & 0x4000) != 0);
+}
+
+void sm510_base_device::op_tf4()
+{
+ // TF4: skip next if divider F4(d11) is set
+ m_skip = ((m_div & 0x0800) != 0);
+}
+
+
+// Bit manipulation instructions
+
+void sm510_base_device::op_rm()
+{
+ // RM x: reset RAM bit
+ ram_w(ram_r() & ~bitmask(m_op));
+}
+
+void sm510_base_device::op_sm()
+{
+ // SM x: set RAM bit
+ ram_w(ram_r() | bitmask(m_op));
+}
+
+
+// Melody control instructions
+
+void sm510_base_device::op_pre()
+{
+ // PRE x: melody ROM pointer preset
+ m_melody_address = m_param;
+ m_melody_step_count = 0;
+}
+
+void sm510_base_device::op_sme()
+{
+ // SME: set melody enable
+ m_melody_rd |= 1;
+}
+
+void sm510_base_device::op_rme()
+{
+ // RME: reset melody enable
+ m_melody_rd &= ~1;
+}
+
+void sm510_base_device::op_tmel()
+{
+ // TMEL: skip next if rest signal is set, reset it
+ m_skip = ((m_melody_rd & 2) != 0);
+ m_melody_rd &= ~2;
+}
+
+
+// Special instructions
+
+void sm510_base_device::op_skip()
+{
+ // SKIP: no operation
+}
+
+void sm510_base_device::op_cend()
+{
+ // CEND: stop clock (halt the cpu and go into low-power mode)
+ m_halt = true;
+}
+
+void sm510_base_device::op_idiv()
+{
+ // IDIV: reset divider
+ m_div = 0;
+}
+
+void sm510_base_device::op_illegal()
+{
+ logerror("%s unknown opcode $%02X at $%04X\n", tag(), m_op, m_prev_pc);
+}
diff --git a/src/emu/cpu/sm510/sm511core.c b/src/emu/cpu/sm510/sm511core.c
new file mode 100644
index 00000000000..d5dcf94cc7c
--- /dev/null
+++ b/src/emu/cpu/sm510/sm511core.c
@@ -0,0 +1,162 @@
+// license:BSD-3-Clause
+// copyright-holders:hap
+/*
+
+ Sharp SM511 MCU core implementation
+
+*/
+
+#include "sm510.h"
+#include "debugger.h"
+
+
+// MCU types
+const device_type SM511 = &device_creator<sm511_device>;
+const device_type SM512 = &device_creator<sm512_device>;
+
+
+// internal memory maps
+static ADDRESS_MAP_START(program_4k, AS_PROGRAM, 8, sm510_base_device)
+ AM_RANGE(0x0000, 0x0fff) AM_ROM
+ADDRESS_MAP_END
+
+static ADDRESS_MAP_START(data_96_32x4, AS_DATA, 8, sm510_base_device)
+ AM_RANGE(0x00, 0x5f) AM_RAM
+ AM_RANGE(0x60, 0x6f) AM_RAM AM_SHARE("lcd_ram_a")
+ AM_RANGE(0x70, 0x7f) AM_RAM AM_SHARE("lcd_ram_b")
+ADDRESS_MAP_END
+
+static ADDRESS_MAP_START(data_80_48x4, AS_DATA, 8, sm510_base_device)
+ AM_RANGE(0x00, 0x4f) AM_RAM
+ AM_RANGE(0x50, 0x5f) AM_RAM AM_SHARE("lcd_ram_c")
+ AM_RANGE(0x60, 0x6f) AM_RAM AM_SHARE("lcd_ram_a")
+ AM_RANGE(0x70, 0x7f) AM_RAM AM_SHARE("lcd_ram_b")
+ADDRESS_MAP_END
+
+
+// disasm
+offs_t sm511_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options)
+{
+ extern CPU_DISASSEMBLE(sm511);
+ return CPU_DISASSEMBLE_NAME(sm511)(this, buffer, pc, oprom, opram, options);
+}
+
+
+// device definitions
+sm511_device::sm511_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : sm510_base_device(mconfig, SM511, "SM511", tag, owner, clock, 2 /* stack levels */, 12 /* prg width */, ADDRESS_MAP_NAME(program_4k), 7 /* data width */, ADDRESS_MAP_NAME(data_96_32x4), "sm511", __FILE__)
+{ }
+
+sm511_device::sm511_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, int stack_levels, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source)
+ : sm510_base_device(mconfig, type, name, tag, owner, clock, stack_levels, prgwidth, program, datawidth, data, shortname, source)
+{ }
+
+sm512_device::sm512_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : sm511_device(mconfig, SM512, "SM512", tag, owner, clock, 2, 12, ADDRESS_MAP_NAME(program_4k), 7, ADDRESS_MAP_NAME(data_80_48x4), "sm512", __FILE__)
+{ }
+
+
+
+//-------------------------------------------------
+// execute
+//-------------------------------------------------
+
+void sm511_device::get_opcode_param()
+{
+ // XXX?, LBL, PRE, TL, TML and prefix opcodes are 2 bytes
+ if (m_op == 0x01 || (m_op >= 0x5f && m_op <= 0x61) || (m_op & 0xf0) == 0x70 || (m_op & 0xfc) == 0x68)
+ {
+ m_icount--;
+ m_param = m_program->read_byte(m_pc);
+ increment_pc();
+ }
+}
+
+void sm511_device::execute_one()
+{
+ switch (m_op & 0xf0)
+ {
+ case 0x20: op_lax(); break;
+ case 0x30: op_adx(); break;
+ case 0x40: op_lb(); break;
+ case 0x70: op_tl(); break;
+
+ case 0x80: case 0x90: case 0xa0: case 0xb0:
+ op_t(); break;
+ case 0xc0: case 0xd0: case 0xe0: case 0xf0:
+ op_tm(); break;
+
+ default:
+ switch (m_op & 0xfc)
+ {
+ case 0x04: op_rm(); break;
+ case 0x0c: op_sm(); break;
+ case 0x10: op_exc(); break;
+ case 0x14: op_exci(); break;
+ case 0x18: op_lda(); break;
+ case 0x1c: op_excd(); break;
+ case 0x54: op_tmi(); break;
+ case 0x68: op_tml(); break;
+
+ default:
+ switch (m_op)
+ {
+ case 0x00: op_rot(); break;
+// case 0x01: op_xxx(); break; // ?
+ case 0x02: op_sbm(); break;
+ case 0x03: op_atpl(); break;
+ case 0x08: op_add(); break;
+ case 0x09: op_add11(); break;
+ case 0x0a: op_coma(); break;
+ case 0x0b: op_exbla(); break;
+
+ case 0x50: op_kta(); break;
+ case 0x51: op_tb(); break;
+ case 0x52: op_tc(); break;
+ case 0x53: op_tam(); break;
+ case 0x58: op_tis(); break;
+ case 0x59: op_atl(); break;
+ case 0x5a: op_ta0(); break;
+ case 0x5b: op_tabl(); break;
+ case 0x5c: op_atx(); break;
+// case 0x5d: op_cend(); break;
+ case 0x5e: op_tal(); break;
+ case 0x5f: op_lbl(); break;
+
+ case 0x61: op_pre(); break;
+ case 0x62: op_wr(); break;
+ case 0x63: op_ws(); break;
+ case 0x64: op_incb(); break;
+// case 0x65: op_idiv(); break;
+ case 0x66: op_rc(); break;
+ case 0x67: op_sc(); break;
+ case 0x6c: op_decb(); break;
+ case 0x6d: op_ptw(); break;
+ case 0x6e: op_rtn0(); break;
+ case 0x6f: op_rtn1(); break;
+
+ // extended opcodes
+ case 0x60:
+ m_op = m_op << 8 | m_param;
+ switch (m_param)
+ {
+ case 0x30: op_rme(); break;
+ case 0x31: op_sme(); break;
+ case 0x32: op_tmel(); break;
+ case 0x33: op_atfc(); break;
+ case 0x34: op_bdc(); break;
+ case 0x35: op_atbp(); break;
+
+ default: op_illegal(); break;
+ }
+ break; // 0x60
+
+ default: op_illegal(); break;
+ }
+ break; // 0xff
+
+ }
+ break; // 0xfc
+
+ } // big switch
+}
diff --git a/src/emu/cpu/sm8500/sm8500.h b/src/emu/cpu/sm8500/sm8500.h
index 4a51c2bcdf8..7cd7df8f6f4 100644
--- a/src/emu/cpu/sm8500/sm8500.h
+++ b/src/emu/cpu/sm8500/sm8500.h
@@ -18,7 +18,7 @@ enum
SM8500_RR12, SM8500_RR14,
/* additional internal 8 bit registers */
SM8500_IE0, SM8500_IE1, SM8500_IR0, SM8500_IR1, SM8500_P0, SM8500_P1, SM8500_P2, SM8500_P3, SM8500_SYS, SM8500_CKC,
- SM8500_SPH, SM8500_SPL, SM8500_PS0, SM8500_PS1, SM8500_P0C, SM8500_P1C, SM8500_P2C, SM8500_P3C,
+ SM8500_SPH, SM8500_SPL, SM8500_PS0, SM8500_PS1, SM8500_P0C, SM8500_P1C, SM8500_P2C, SM8500_P3C
};
diff --git a/src/emu/cpu/sm8500/sm8500d.c b/src/emu/cpu/sm8500/sm8500d.c
index be8fc0f0549..06b37795d54 100644
--- a/src/emu/cpu/sm8500/sm8500d.c
+++ b/src/emu/cpu/sm8500/sm8500d.c
@@ -27,7 +27,7 @@ enum e_mnemonics
z5A, z5B,
/* more complicated instructions */
-z1A, z1B, z4F,
+z1A, z1B, z4F
};
/* instructions not found:
@@ -86,7 +86,7 @@ enum e_addrmodes {
AM_R=1, AM_rr, AM_r1, AM_S, AM_rmb, AM_mbr, AM_Ri, AM_rmw, AM_mwr, AM_smw, AM_mws,
AM_Sw, AM_iR, AM_rbr, AM_riw, AM_cjp, AM_rib, AM_pi, AM_cbr, AM_i, AM_ii,
AM_ss, AM_RR, AM_2, AM_SS, AM_bR, AM_Rbr, AM_Rb, AM_rR, AM_Rr, AM_Rii, AM_RiR,
- AM_riB, AM_iS, AM_CALS, AM_bid, AM_1A, AM_1B, AM_4F,
+ AM_riB, AM_iS, AM_CALS, AM_bid, AM_1A, AM_1B, AM_4F
};
static const sm8500dasm mnemonic[256] = {
diff --git a/src/emu/cpu/ssem/ssem.h b/src/emu/cpu/ssem/ssem.h
index c80b0f61724..cfcb0e5dc11 100644
--- a/src/emu/cpu/ssem/ssem.h
+++ b/src/emu/cpu/ssem/ssem.h
@@ -78,7 +78,7 @@ enum
{
SSEM_PC = 1,
SSEM_A,
- SSEM_HALT,
+ SSEM_HALT
};
CPU_DISASSEMBLE( ssem );
diff --git a/src/emu/cpu/ssp1601/ssp1601.c b/src/emu/cpu/ssp1601/ssp1601.c
index 94720fd7e73..fb15aa3d84e 100644
--- a/src/emu/cpu/ssp1601/ssp1601.c
+++ b/src/emu/cpu/ssp1601/ssp1601.c
@@ -43,7 +43,7 @@
#define PPC m_ppc.w.h
-#define FETCH() m_direct->read_decrypted_word(rPC++ << 1)
+#define FETCH() m_direct->read_word(rPC++ << 1)
#define PROGRAM_WORD(a) m_program->read_word((a) << 1)
#define GET_PPC_OFFS() PPC
@@ -353,47 +353,47 @@ UINT32 ssp1601_device::ptr1_read_(int ri, int isj2, int modi3)
// mod=0 (00)
case 0x00:
case 0x01:
- case 0x02: return m_RAM0[m_r0[t&3]];
- case 0x03: return m_RAM0[0];
+ case 0x02: return mem.m_RAM0[regs.m_r0[t&3]];
+ case 0x03: return mem.m_RAM0[0];
case 0x04:
case 0x05:
- case 0x06: return m_RAM1[m_r1[t&3]];
- case 0x07: return m_RAM1[0];
+ case 0x06: return mem.m_RAM1[regs.m_r1[t&3]];
+ case 0x07: return mem.m_RAM1[0];
// mod=1 (01), "+!"
case 0x08:
case 0x09:
- case 0x0a: return m_RAM0[m_r0[t&3]++];
- case 0x0b: return m_RAM0[1];
+ case 0x0a: return mem.m_RAM0[regs.m_r0[t&3]++];
+ case 0x0b: return mem.m_RAM0[1];
case 0x0c:
case 0x0d:
- case 0x0e: return m_RAM1[m_r1[t&3]++];
- case 0x0f: return m_RAM1[1];
+ case 0x0e: return mem.m_RAM1[regs.m_r1[t&3]++];
+ case 0x0f: return mem.m_RAM1[1];
// mod=2 (10), "-"
case 0x10:
case 0x11:
- case 0x12: rp = &m_r0[t&3]; t = m_RAM0[*rp];
+ case 0x12: rp = &regs.m_r0[t&3]; t = mem.m_RAM0[*rp];
if (!(rST&7)) { (*rp)--; return t; }
add = -1; goto modulo;
- case 0x13: return m_RAM0[2];
+ case 0x13: return mem.m_RAM0[2];
case 0x14:
case 0x15:
- case 0x16: rp = &m_r1[t&3]; t = m_RAM1[*rp];
+ case 0x16: rp = &regs.m_r1[t&3]; t = mem.m_RAM1[*rp];
if (!(rST&7)) { (*rp)--; return t; }
add = -1; goto modulo;
- case 0x17: return m_RAM1[2];
+ case 0x17: return mem.m_RAM1[2];
// mod=3 (11), "+"
case 0x18:
case 0x19:
- case 0x1a: rp = &m_r0[t&3]; t = m_RAM0[*rp];
+ case 0x1a: rp = &regs.m_r0[t&3]; t = mem.m_RAM0[*rp];
if (!(rST&7)) { (*rp)++; return t; }
add = 1; goto modulo;
- case 0x1b: return m_RAM0[3];
+ case 0x1b: return mem.m_RAM0[3];
case 0x1c:
case 0x1d:
- case 0x1e: rp = &m_r1[t&3]; t = m_RAM1[*rp];
+ case 0x1e: rp = &regs.m_r1[t&3]; t = mem.m_RAM1[*rp];
if (!(rST&7)) { (*rp)++; return t; }
add = 1; goto modulo;
- case 0x1f: return m_RAM1[3];
+ case 0x1f: return mem.m_RAM1[3];
}
return 0;
@@ -412,40 +412,40 @@ void ssp1601_device::ptr1_write(int op, UINT32 d)
// mod=0 (00)
case 0x00:
case 0x01:
- case 0x02: m_RAM0[m_r0[t&3]] = d; return;
- case 0x03: m_RAM0[0] = d; return;
+ case 0x02: mem.m_RAM0[regs.m_r0[t&3]] = d; return;
+ case 0x03: mem.m_RAM0[0] = d; return;
case 0x04:
case 0x05:
- case 0x06: m_RAM1[m_r1[t&3]] = d; return;
- case 0x07: m_RAM1[0] = d; return;
+ case 0x06: mem.m_RAM1[regs.m_r1[t&3]] = d; return;
+ case 0x07: mem.m_RAM1[0] = d; return;
// mod=1 (01), "+!"
// mod=3, "+"
case 0x08:
case 0x09:
- case 0x0a: m_RAM0[m_r0[t&3]++] = d; return;
- case 0x0b: m_RAM0[1] = d; return;
+ case 0x0a: mem.m_RAM0[regs.m_r0[t&3]++] = d; return;
+ case 0x0b: mem.m_RAM0[1] = d; return;
case 0x0c:
case 0x0d:
- case 0x0e: m_RAM1[m_r1[t&3]++] = d; return;
- case 0x0f: m_RAM1[1] = d; return;
+ case 0x0e: mem.m_RAM1[regs.m_r1[t&3]++] = d; return;
+ case 0x0f: mem.m_RAM1[1] = d; return;
// mod=2 (10), "-"
case 0x10:
case 0x11:
- case 0x12: m_RAM0[m_r0[t&3]--] = d; CHECK_RPL(); return;
- case 0x13: m_RAM0[2] = d; return;
+ case 0x12: mem.m_RAM0[regs.m_r0[t&3]--] = d; CHECK_RPL(); return;
+ case 0x13: mem.m_RAM0[2] = d; return;
case 0x14:
case 0x15:
- case 0x16: m_RAM1[m_r1[t&3]--] = d; CHECK_RPL(); return;
- case 0x17: m_RAM1[2] = d; return;
+ case 0x16: mem.m_RAM1[regs.m_r1[t&3]--] = d; CHECK_RPL(); return;
+ case 0x17: mem.m_RAM1[2] = d; return;
// mod=3 (11), "+"
case 0x18:
case 0x19:
- case 0x1a: m_RAM0[m_r0[t&3]++] = d; CHECK_RPL(); return;
- case 0x1b: m_RAM0[3] = d; return;
+ case 0x1a: mem.m_RAM0[regs.m_r0[t&3]++] = d; CHECK_RPL(); return;
+ case 0x1b: mem.m_RAM0[3] = d; return;
case 0x1c:
case 0x1d:
- case 0x1e: m_RAM1[m_r1[t&3]++] = d; CHECK_RPL(); return;
- case 0x1f: m_RAM1[3] = d; return;
+ case 0x1e: mem.m_RAM1[regs.m_r1[t&3]++] = d; CHECK_RPL(); return;
+ case 0x1f: mem.m_RAM1[3] = d; return;
}
}
@@ -457,21 +457,21 @@ UINT32 ssp1601_device::ptr2_read(int op)
// mod=0 (00)
case 0x00:
case 0x01:
- case 0x02: mv = m_RAM0[m_r0[t&3]]++; break;
- case 0x03: mv = m_RAM0[0]++; break;
+ case 0x02: mv = mem.m_RAM0[regs.m_r0[t&3]]++; break;
+ case 0x03: mv = mem.m_RAM0[0]++; break;
case 0x04:
case 0x05:
- case 0x06: mv = m_RAM1[m_r1[t&3]]++; break;
- case 0x07: mv = m_RAM1[0]++; break;
+ case 0x06: mv = mem.m_RAM1[regs.m_r1[t&3]]++; break;
+ case 0x07: mv = mem.m_RAM1[0]++; break;
// mod=1 (01)
- case 0x0b: mv = m_RAM0[1]++; break;
- case 0x0f: mv = m_RAM1[1]++; break;
+ case 0x0b: mv = mem.m_RAM0[1]++; break;
+ case 0x0f: mv = mem.m_RAM1[1]++; break;
// mod=2 (10)
- case 0x13: mv = m_RAM0[2]++; break;
- case 0x17: mv = m_RAM1[2]++; break;
+ case 0x13: mv = mem.m_RAM0[2]++; break;
+ case 0x17: mv = mem.m_RAM1[2]++; break;
// mod=3 (11)
- case 0x1b: mv = m_RAM0[3]++; break;
- case 0x1f: mv = m_RAM1[3]++; break;
+ case 0x1b: mv = mem.m_RAM0[3]++; break;
+ case 0x1f: mv = mem.m_RAM1[3]++; break;
default: logerror(__FILE__ " FIXME: unimplemented mod in ((rX)) @ %04x\n", GET_PPC_OFFS());
return 0;
}
diff --git a/src/emu/cpu/ssp1601/ssp1601.h b/src/emu/cpu/ssp1601/ssp1601.h
index 744dfdbc1ce..ef400cac42b 100644
--- a/src/emu/cpu/ssp1601/ssp1601.h
+++ b/src/emu/cpu/ssp1601/ssp1601.h
@@ -57,14 +57,14 @@ private:
struct {
unsigned char m_r0[4];
unsigned char m_r1[4];
- };
+ } regs;
};
union {
unsigned short m_RAM[256*2]; /* 2 256-word internal RAM banks */
struct {
unsigned short m_RAM0[256];
unsigned short m_RAM1[256];
- };
+ } mem;
};
UINT16 m_stack[6]; /* 6-level hardware stack */
PAIR m_ppc;
diff --git a/src/emu/cpu/superfx/superfx.h b/src/emu/cpu/superfx/superfx.h
index 8e64875e1bd..8c3a8b3d2bd 100644
--- a/src/emu/cpu/superfx/superfx.h
+++ b/src/emu/cpu/superfx/superfx.h
@@ -48,7 +48,7 @@ enum
SUPERFX_RAMCL,
SUPERFX_RAMAR,
SUPERFX_RAMDR,
- SUPERFX_RAMADDR,
+ SUPERFX_RAMADDR
};
#define SUPERFX_SFR_IRQ 0x8000 // Interrupt Flag
@@ -186,7 +186,7 @@ private:
inline void superfx_regs_reset();
void superfx_update_speed();
- void superfx_cache_flush();;
+ void superfx_cache_flush();
UINT8 superfx_cache_mmio_read(UINT32 addr);
void superfx_cache_mmio_write(UINT32 addr, UINT8 data);
void superfx_memory_reset();
diff --git a/src/emu/cpu/t11/t11.c b/src/emu/cpu/t11/t11.c
index 46f82f9a627..211bbd1f071 100644
--- a/src/emu/cpu/t11/t11.c
+++ b/src/emu/cpu/t11/t11.c
@@ -58,7 +58,7 @@ t11_device::t11_device(const machine_config &mconfig, const char *tag, device_t
int t11_device::ROPCODE()
{
PC &= 0xfffe;
- int val = m_direct->read_decrypted_word(PC);
+ int val = m_direct->read_word(PC);
PC += 2;
return val;
}
diff --git a/src/emu/cpu/tlcs90/tlcs90.c b/src/emu/cpu/tlcs90/tlcs90.c
index a5c866c7f54..1e3d5dde80a 100644
--- a/src/emu/cpu/tlcs90/tlcs90.c
+++ b/src/emu/cpu/tlcs90/tlcs90.c
@@ -2377,7 +2377,7 @@ void tlcs90_device::t90_start_timer(int i)
m_timer[i]->adjust(period, i, period);
- logerror("%04X: CPU Timer %d started at %lf Hz\n", m_pc.w.l, i, 1.0 / period.as_double());
+ logerror("%04X: CPU Timer %d started at %f Hz\n", m_pc.w.l, i, 1.0 / period.as_double());
}
void tlcs90_device::t90_start_timer4()
@@ -2399,7 +2399,7 @@ void tlcs90_device::t90_start_timer4()
m_timer[4]->adjust(period, 4, period);
- logerror("%04X: CPU Timer 4 started at %lf Hz\n", m_pc.w.l, 1.0 / period.as_double());
+ logerror("%04X: CPU Timer 4 started at %f Hz\n", m_pc.w.l, 1.0 / period.as_double());
}
diff --git a/src/emu/cpu/tlcs900/900tbl.inc b/src/emu/cpu/tlcs900/900tbl.inc
index 53ec4291fba..2e66f1cf6c9 100644
--- a/src/emu/cpu/tlcs900/900tbl.inc
+++ b/src/emu/cpu/tlcs900/900tbl.inc
@@ -30,7 +30,7 @@ enum e_operand
_M8, /* (8) */
_M16, /* (i16) */
_R, /* register (defined by extension) */
- _SR, /* status register */
+ _SR /* status register */
};
diff --git a/src/emu/cpu/tlcs900/dasm900.c b/src/emu/cpu/tlcs900/dasm900.c
index 4d13d6cd322..7231a2f4759 100644
--- a/src/emu/cpu/tlcs900/dasm900.c
+++ b/src/emu/cpu/tlcs900/dasm900.c
@@ -86,7 +86,7 @@ enum e_operand
O_M8, /* (8) */
O_M16, /* (i16) */
O_R, /* register */
- O_SR, /* status register */
+ O_SR /* status register */
};
diff --git a/src/emu/cpu/tms0980/tms0980.c b/src/emu/cpu/tms0980/tms0980.c
index 50f61788086..8275f09d815 100644
--- a/src/emu/cpu/tms0980/tms0980.c
+++ b/src/emu/cpu/tms0980/tms0980.c
@@ -187,6 +187,7 @@ const device_type TMS0270 = &device_creator<tms0270_cpu_device>; // 40-pin DIP,
// TMS0260 is similar? except opla is 32 instead of 48 terms
+// internal memory maps
static ADDRESS_MAP_START(program_11bit_9, AS_PROGRAM, 16, tms1xxx_cpu_device)
AM_RANGE(0x000, 0xfff) AM_ROM
ADDRESS_MAP_END
@@ -218,8 +219,9 @@ static ADDRESS_MAP_START(data_64x9_as4, AS_DATA, 8, tms1xxx_cpu_device)
ADDRESS_MAP_END
+// device definitions
tms1000_cpu_device::tms1000_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : tms1xxx_cpu_device(mconfig, TMS1000, "TMS1000", tag, owner, clock, 8, 11, 6, 8, 2, 10, ADDRESS_MAP_NAME(program_10bit_8), 6, ADDRESS_MAP_NAME(data_64x4), "tms1000", __FILE__)
+ : tms1xxx_cpu_device(mconfig, TMS1000, "TMS1000", tag, owner, clock, 8 /* o pins */, 11 /* r pins */, 6 /* pc bits */, 8 /* byte width */, 2 /* x width */, 10 /* prg width */, ADDRESS_MAP_NAME(program_10bit_8), 6 /* data width */, ADDRESS_MAP_NAME(data_64x4), "tms1000", __FILE__)
{ }
tms1000_cpu_device::tms1000_cpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 o_pins, UINT8 r_pins, UINT8 pc_bits, UINT8 byte_bits, UINT8 x_bits, int prgwidth, address_map_constructor program, int datawidth, address_map_constructor data, const char *shortname, const char *source)
@@ -316,7 +318,7 @@ tms0270_cpu_device::tms0270_cpu_device(const machine_config &mconfig, const char
{ }
-
+// machine configs
static MACHINE_CONFIG_FRAGMENT(tms1000)
// microinstructions PLA, output PLA
@@ -402,7 +404,7 @@ machine_config_constructor tms0270_cpu_device::device_mconfig_additions() const
}
-
+// disasm
offs_t tms1000_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options)
{
extern CPU_DISASSEMBLE(tms1000);
@@ -448,16 +450,17 @@ void tms1xxx_cpu_device::device_start()
m_program = &space(AS_PROGRAM);
m_data = &space(AS_DATA);
- m_read_k.resolve_safe(0);
- m_write_o.resolve_safe();
- m_write_r.resolve_safe();
- m_power_off.resolve_safe();
-
m_o_mask = (1 << m_o_pins) - 1;
m_r_mask = (1 << m_r_pins) - 1;
m_pc_mask = (1 << m_pc_bits) - 1;
m_x_mask = (1 << m_x_bits) - 1;
+ // resolve callbacks
+ m_read_k.resolve_safe(0);
+ m_write_o.resolve_safe();
+ m_write_r.resolve_safe();
+ m_power_off.resolve_safe();
+
// zerofill
m_pc = 0;
m_sr = 0;
diff --git a/src/emu/cpu/tms32010/tms32010.c b/src/emu/cpu/tms32010/tms32010.c
index a90a697f58b..e6264d3f1dd 100644
--- a/src/emu/cpu/tms32010/tms32010.c
+++ b/src/emu/cpu/tms32010/tms32010.c
@@ -219,7 +219,7 @@ offs_t tms32010_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8
* used to greatly speed up emulation
*/
-#define TMS32010_RDOP(A) (m_direct->read_decrypted_word((A)<<1))
+#define TMS32010_RDOP(A) (m_direct->read_word((A)<<1))
/****************************************************************************
@@ -228,7 +228,7 @@ offs_t tms32010_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8
* that use different encoding mechanisms for opcodes and opcode arguments
*/
-#define TMS32010_RDOP_ARG(A) (m_direct->read_raw_word((A)<<1))
+#define TMS32010_RDOP_ARG(A) (m_direct->read_word((A)<<1))
/************************************************************************
diff --git a/src/emu/cpu/tms32025/tms32025.c b/src/emu/cpu/tms32025/tms32025.c
index 91fa0423e1c..9acc4a31f8c 100644
--- a/src/emu/cpu/tms32025/tms32025.c
+++ b/src/emu/cpu/tms32025/tms32025.c
@@ -134,8 +134,8 @@ Table 3-2. TMS32025/26 Memory Blocks
#define S_IN(A) (m_io->read_word((A)<<1))
#define S_OUT(A,V) (m_io->write_word(((A)<<1),(V)))
-#define M_RDOP(A) ((m_pgmmap[(A) >> 7]) ? (m_pgmmap[(A) >> 7][(A) & 0x7f]) : m_direct->read_decrypted_word((A)<<1))
-#define M_RDOP_ARG(A) ((m_pgmmap[(A) >> 7]) ? (m_pgmmap[(A) >> 7][(A) & 0x7f]) : m_direct->read_decrypted_word((A)<<1))
+#define M_RDOP(A) ((m_pgmmap[(A) >> 7]) ? (m_pgmmap[(A) >> 7][(A) & 0x7f]) : m_direct->read_word((A)<<1))
+#define M_RDOP_ARG(A) ((m_pgmmap[(A) >> 7]) ? (m_pgmmap[(A) >> 7][(A) & 0x7f]) : m_direct->read_word((A)<<1))
/************************** Memory mapped registers ****************/
diff --git a/src/emu/cpu/tms32031/tms32031.c b/src/emu/cpu/tms32031/tms32031.c
index df1f389e4c5..1d8096ce959 100644
--- a/src/emu/cpu/tms32031/tms32031.c
+++ b/src/emu/cpu/tms32031/tms32031.c
@@ -339,7 +339,7 @@ const rom_entry *tms3203x_device::device_rom_region() const
inline UINT32 tms3203x_device::ROPCODE(offs_t pc)
{
- return m_direct->read_decrypted_dword(pc << 2);
+ return m_direct->read_dword(pc << 2);
}
diff --git a/src/emu/cpu/tms32031/tms32031.h b/src/emu/cpu/tms32031/tms32031.h
index ce1189e6c7a..e55fcc2d3b4 100644
--- a/src/emu/cpu/tms32031/tms32031.h
+++ b/src/emu/cpu/tms32031/tms32031.h
@@ -139,7 +139,7 @@ protected:
enum
{
CHIP_TYPE_TMS32031,
- CHIP_TYPE_TMS32032,
+ CHIP_TYPE_TMS32032
};
// construction/destruction
diff --git a/src/emu/cpu/tms32051/tms32051.c b/src/emu/cpu/tms32051/tms32051.c
index c4ddc7de55e..01a5a414022 100644
--- a/src/emu/cpu/tms32051/tms32051.c
+++ b/src/emu/cpu/tms32051/tms32051.c
@@ -35,7 +35,7 @@ enum
TMS32051_AR4,
TMS32051_AR5,
TMS32051_AR6,
- TMS32051_AR7,
+ TMS32051_AR7
};
@@ -78,7 +78,7 @@ offs_t tms32051_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8
#define CYCLES(x) (m_icount -= x)
-#define ROPCODE() m_direct->read_decrypted_word((m_pc++) << 1)
+#define ROPCODE() m_direct->read_word((m_pc++) << 1)
void tms32051_device::CHANGE_PC(UINT16 new_pc)
{
diff --git a/src/emu/cpu/tms32082/tms32082.c b/src/emu/cpu/tms32082/tms32082.c
index f7833e7898c..56d97713b45 100644
--- a/src/emu/cpu/tms32082/tms32082.c
+++ b/src/emu/cpu/tms32082/tms32082.c
@@ -426,7 +426,7 @@ void tms32082_mp_device::execute_set_input(int inputnum, int state)
UINT32 tms32082_mp_device::fetch()
{
- UINT32 w = m_direct->read_decrypted_dword(m_fetchpc);
+ UINT32 w = m_direct->read_dword(m_fetchpc);
m_fetchpc += 4;
return w;
}
diff --git a/src/emu/cpu/tms32082/tms32082.h b/src/emu/cpu/tms32082/tms32082.h
index 2915caa54f1..c08fffa3640 100644
--- a/src/emu/cpu/tms32082/tms32082.h
+++ b/src/emu/cpu/tms32082/tms32082.h
@@ -55,7 +55,7 @@ public:
MP_IN1P,
MP_OUTP,
MP_IE,
- MP_INTPEN,
+ MP_INTPEN
};
enum
@@ -63,7 +63,7 @@ public:
INPUT_X1 = 1,
INPUT_X2 = 2,
INPUT_X3 = 3,
- INPUT_X4 = 4,
+ INPUT_X4 = 4
};
DECLARE_READ32_MEMBER(mp_param_r);
@@ -158,7 +158,7 @@ public:
enum
{
- PP_PC = 1,
+ PP_PC = 1
};
protected:
diff --git a/src/emu/cpu/tms34010/34010ops.c b/src/emu/cpu/tms34010/34010ops.c
index 1e0866478fc..6674d7a1faa 100644
--- a/src/emu/cpu/tms34010/34010ops.c
+++ b/src/emu/cpu/tms34010/34010ops.c
@@ -80,13 +80,13 @@ void tms340x0_device::unimpl(UINT16 op)
{
/* kludge for Super High Impact -- this doesn't seem to cause */
/* an illegal opcode exception */
- if (m_direct->read_decrypted_word(TOBYTE(m_pc - 0x10)) == 0x0007)
+ if (m_direct->read_word(TOBYTE(m_pc - 0x10)) == 0x0007)
return;
/* 9 Ball Shootout calls to FFDF7468, expecting it */
/* to execute the next instruction from FFDF7470 */
/* but the instruction at FFDF7460 is an 0x0001 */
- if (m_direct->read_decrypted_word(TOBYTE(m_pc - 0x10)) == 0x0001)
+ if (m_direct->read_word(TOBYTE(m_pc - 0x10)) == 0x0001)
return;
PUSH(m_pc);
@@ -96,7 +96,7 @@ void tms340x0_device::unimpl(UINT16 op)
COUNT_UNKNOWN_CYCLES(16);
/* extra check to prevent bad things */
- if (m_pc == 0 || s_opcode_table[m_direct->read_decrypted_word(TOBYTE(m_pc)) >> 4] == &tms34010_device::unimpl)
+ if (m_pc == 0 || s_opcode_table[m_direct->read_word(TOBYTE(m_pc)) >> 4] == &tms34010_device::unimpl)
{
set_input_line(INPUT_LINE_HALT, ASSERT_LINE);
debugger_break(machine());
diff --git a/src/emu/cpu/tms34010/tms34010.c b/src/emu/cpu/tms34010/tms34010.c
index 524fa8bd917..4faf2967bc8 100644
--- a/src/emu/cpu/tms34010/tms34010.c
+++ b/src/emu/cpu/tms34010/tms34010.c
@@ -174,32 +174,32 @@ inline UINT32 tms340x0_device::ROPCODE()
{
UINT32 pc = TOBYTE(m_pc);
m_pc += 2 << 3;
- return m_direct->read_decrypted_word(pc);
+ return m_direct->read_word(pc);
}
inline INT16 tms340x0_device::PARAM_WORD()
{
UINT32 pc = TOBYTE(m_pc);
m_pc += 2 << 3;
- return m_direct->read_raw_word(pc);
+ return m_direct->read_word(pc);
}
inline INT32 tms340x0_device::PARAM_LONG()
{
UINT32 pc = TOBYTE(m_pc);
m_pc += 4 << 3;
- return (UINT16)m_direct->read_raw_word(pc) | (m_direct->read_raw_word(pc + 2) << 16);
+ return (UINT16)m_direct->read_word(pc) | (m_direct->read_word(pc + 2) << 16);
}
inline INT16 tms340x0_device::PARAM_WORD_NO_INC()
{
- return m_direct->read_raw_word(TOBYTE(m_pc));
+ return m_direct->read_word(TOBYTE(m_pc));
}
inline INT32 tms340x0_device::PARAM_LONG_NO_INC()
{
UINT32 pc = TOBYTE(m_pc);
- return (UINT16)m_direct->read_raw_word(pc) | (m_direct->read_raw_word(pc + 2) << 16);
+ return (UINT16)m_direct->read_word(pc) | (m_direct->read_word(pc + 2) << 16);
}
/* read memory byte */
diff --git a/src/emu/cpu/tms57002/tms57002.h b/src/emu/cpu/tms57002/tms57002.h
index 94d361133e0..cd450ab578b 100644
--- a/src/emu/cpu/tms57002/tms57002.h
+++ b/src/emu/cpu/tms57002/tms57002.h
@@ -211,7 +211,7 @@ enum {
TMS57002_XBA,
TMS57002_XOA,
TMS57002_XRD,
- TMS57002_XWR,
+ TMS57002_XWR
};
extern const device_type TMS57002;
diff --git a/src/emu/cpu/tms7000/tms7000.c b/src/emu/cpu/tms7000/tms7000.c
index acc81731c1b..99451e30d6b 100644
--- a/src/emu/cpu/tms7000/tms7000.c
+++ b/src/emu/cpu/tms7000/tms7000.c
@@ -631,7 +631,7 @@ void tms7000_device::execute_run()
{
debugger_instruction_hook(this, m_pc);
- m_op = m_direct->read_decrypted_byte(m_pc++);
+ m_op = m_direct->read_byte(m_pc++);
execute_one(m_op);
} while (m_icount > 0);
}
diff --git a/src/emu/cpu/tms7000/tms7000.h b/src/emu/cpu/tms7000/tms7000.h
index 4b5f14ebe89..92effc0d079 100644
--- a/src/emu/cpu/tms7000/tms7000.h
+++ b/src/emu/cpu/tms7000/tms7000.h
@@ -143,8 +143,8 @@ protected:
inline UINT16 read_mem16(UINT16 address) { return m_program->read_byte(address) << 8 | m_program->read_byte((address + 1) & 0xffff); }
inline void write_mem16(UINT16 address, UINT16 data) { m_program->write_byte(address, data >> 8 & 0xff); m_program->write_byte((address + 1) & 0xffff, data & 0xff); }
- inline UINT8 imm8() { return m_direct->read_raw_byte(m_pc++); }
- inline UINT16 imm16() { UINT16 ret = m_direct->read_raw_byte(m_pc++) << 8; return ret | m_direct->read_raw_byte(m_pc++); }
+ inline UINT8 imm8() { return m_direct->read_byte(m_pc++); }
+ inline UINT16 imm16() { UINT16 ret = m_direct->read_byte(m_pc++) << 8; return ret | m_direct->read_byte(m_pc++); }
inline UINT8 pull8() { return m_program->read_byte(m_sp--); }
inline void push8(UINT8 data) { m_program->write_byte(++m_sp, data); }
diff --git a/src/emu/cpu/tms9900/9900dasm.c b/src/emu/cpu/tms9900/9900dasm.c
index 010908290ed..7b3153e6c4c 100644
--- a/src/emu/cpu/tms9900/9900dasm.c
+++ b/src/emu/cpu/tms9900/9900dasm.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Raphael Nabet
/*****************************************************************************
*
diff --git a/src/emu/cpu/tms9900/99xxcore.h b/src/emu/cpu/tms9900/99xxcore.h
index 794be20fcb4..cb94fac286f 100644
--- a/src/emu/cpu/tms9900/99xxcore.h
+++ b/src/emu/cpu/tms9900/99xxcore.h
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Raphael Nabet
/***************************************************************************
diff --git a/src/emu/cpu/ucom4/ucom4.c b/src/emu/cpu/ucom4/ucom4.c
index 11d1513ed03..d480b04fce5 100644
--- a/src/emu/cpu/ucom4/ucom4.c
+++ b/src/emu/cpu/ucom4/ucom4.c
@@ -15,18 +15,9 @@
*/
-enum
-{
- NEC_UCOM43 = 0,
- NEC_UCOM44,
- NEC_UCOM45
-};
-
#include "ucom4.h"
#include "debugger.h"
-#include "ucom4op.inc"
-
// uCOM-43 products: 2000x8 ROM, RAM size custom, supports full instruction set
const device_type NEC_D553 = &device_creator<upd553_cpu_device>; // 42-pin PMOS, 35 pins for I/O, Open Drain output, 96x4 RAM
@@ -62,7 +53,7 @@ ADDRESS_MAP_END
// device definitions
upd553_cpu_device::upd553_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : ucom4_cpu_device(mconfig, NEC_D553, "uPD553", tag, owner, clock, NEC_UCOM43, 3, 11, ADDRESS_MAP_NAME(program_2k), 7, ADDRESS_MAP_NAME(data_96x4), "upd553", __FILE__)
+ : ucom4_cpu_device(mconfig, NEC_D553, "uPD553", tag, owner, clock, NEC_UCOM43, 3 /* stack levels */, 11 /* prg width */, ADDRESS_MAP_NAME(program_2k), 7 /* data width */, ADDRESS_MAP_NAME(data_96x4), "upd553", __FILE__)
{ }
upd650_cpu_device::upd650_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
@@ -124,6 +115,7 @@ void ucom4_cpu_device::device_start()
m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ucom4_cpu_device::simple_timer_cb), this));
+ // resolve callbacks
m_read_a.resolve_safe(0xf);
m_read_b.resolve_safe(0xf);
m_read_c.resolve_safe(0xf);
diff --git a/src/emu/cpu/ucom4/ucom4.h b/src/emu/cpu/ucom4/ucom4.h
index a0f3353c5e5..e6165bcde28 100644
--- a/src/emu/cpu/ucom4/ucom4.h
+++ b/src/emu/cpu/ucom4/ucom4.h
@@ -44,7 +44,6 @@
#define MCFG_UCOM4_WRITE_I_CB(_devcb) \
ucom4_cpu_device::set_write_i_callback(*device, DEVCB_##_devcb);
-
enum
{
NEC_UCOM4_PORTA = 0,
@@ -58,6 +57,13 @@ enum
NEC_UCOM4_PORTI
};
+enum
+{
+ NEC_UCOM43 = 0,
+ NEC_UCOM44,
+ NEC_UCOM45
+};
+
// pinout reference
diff --git a/src/emu/cpu/ucom4/ucom4op.inc b/src/emu/cpu/ucom4/ucom4op.c
index 0f7aaa7902e..11475ee254d 100644
--- a/src/emu/cpu/ucom4/ucom4op.inc
+++ b/src/emu/cpu/ucom4/ucom4op.c
@@ -3,6 +3,9 @@
// uCOM-4 opcode handlers
+#include "ucom4.h"
+
+
// internal helpers
inline UINT8 ucom4_cpu_device::ram_r()
diff --git a/src/emu/cpu/uml.h b/src/emu/cpu/uml.h
index 6d1e6c2d89a..96960bd910e 100644
--- a/src/emu/cpu/uml.h
+++ b/src/emu/cpu/uml.h
@@ -655,7 +655,7 @@ namespace uml
const parameter M7(parameter::make_mapvar(MAPVAR_M0 + 7));
const parameter M8(parameter::make_mapvar(MAPVAR_M0 + 8));
const parameter M9(parameter::make_mapvar(MAPVAR_M0 + 9));
-};
+}
#endif /* __UML_H__ */
diff --git a/src/emu/cpu/unsp/unsp.h b/src/emu/cpu/unsp/unsp.h
index aec52e47112..8d1ca02dd7e 100644
--- a/src/emu/cpu/unsp/unsp.h
+++ b/src/emu/cpu/unsp/unsp.h
@@ -28,7 +28,7 @@ enum
UNSP_IRQ,
UNSP_FIQ,
- UNSP_SB,
+ UNSP_SB
};
diff --git a/src/emu/cpu/upd7725/upd7725.c b/src/emu/cpu/upd7725/upd7725.c
index 78e248eb7bf..d422eae21b0 100644
--- a/src/emu/cpu/upd7725/upd7725.c
+++ b/src/emu/cpu/upd7725/upd7725.c
@@ -326,7 +326,7 @@ void necdsp_device::execute_run()
debugger_instruction_hook(this, regs.pc);
}
- opcode = m_direct->read_decrypted_dword(regs.pc<<2)>>8;
+ opcode = m_direct->read_dword(regs.pc<<2)>>8;
regs.pc++;
switch(opcode >> 22)
{
diff --git a/src/emu/cpu/upd7810/upd7810_macros.h b/src/emu/cpu/upd7810/upd7810_macros.h
index b6172e816ba..27783fb5d9a 100644
--- a/src/emu/cpu/upd7810/upd7810_macros.h
+++ b/src/emu/cpu/upd7810/upd7810_macros.h
@@ -104,8 +104,8 @@
// MEMORY/OPCODE READ/WRITE
//**************************************************************************
-#define RDOP(O) O = m_direct->read_decrypted_byte(PCD); PC++
-#define RDOPARG(A) A = m_direct->read_raw_byte(PCD); PC++
+#define RDOP(O) O = m_direct->read_byte(PCD); PC++
+#define RDOPARG(A) A = m_direct->read_byte(PCD); PC++
#define RM(A) m_program->read_byte(A)
#define WM(A,V) m_program->write_byte(A,V)
diff --git a/src/emu/cpu/v30mz/v30mz.c b/src/emu/cpu/v30mz/v30mz.c
index 62f3dc94132..3bc7c28236a 100644
--- a/src/emu/cpu/v30mz/v30mz.c
+++ b/src/emu/cpu/v30mz/v30mz.c
@@ -308,7 +308,7 @@ inline void v30mz_cpu_device::write_port(UINT16 port, UINT8 data)
inline UINT8 v30mz_cpu_device::fetch_op()
{
- UINT8 data = m_direct->read_decrypted_byte( pc() );
+ UINT8 data = m_direct->read_byte( pc() );
m_ip++;
return data;
}
@@ -316,7 +316,7 @@ inline UINT8 v30mz_cpu_device::fetch_op()
inline UINT8 v30mz_cpu_device::fetch()
{
- UINT8 data = m_direct->read_raw_byte( pc() );
+ UINT8 data = m_direct->read_byte( pc() );
m_ip++;
return data;
}
diff --git a/src/emu/cpu/v60/v60.c b/src/emu/cpu/v60/v60.c
index 3f2df66199c..38b17139fb7 100644
--- a/src/emu/cpu/v60/v60.c
+++ b/src/emu/cpu/v60/v60.c
@@ -63,17 +63,17 @@ offs_t v70_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *opro
// memory accessors
#if defined(LSB_FIRST) && !defined(ALIGN_INTS)
-#define OpRead8(a) (m_direct->read_decrypted_byte(a))
-#define OpRead16(a) (m_direct->read_decrypted_word(a))
-#define OpRead32(a) (m_direct->read_decrypted_dword(a))
+#define OpRead8(a) (m_direct->read_byte(a))
+#define OpRead16(a) (m_direct->read_word(a))
+#define OpRead32(a) (m_direct->read_dword(a))
#else
-#define OpRead8(a) (m_direct->read_decrypted_byte((a), m_fetch_xor))
-#define OpRead16(a) ((m_direct->read_decrypted_byte(((a)+0), m_fetch_xor) << 0) | \
- (m_direct->read_decrypted_byte(((a)+1), m_fetch_xor) << 8))
-#define OpRead32(a) ((m_direct->read_decrypted_byte(((a)+0), m_fetch_xor) << 0) | \
- (m_direct->read_decrypted_byte(((a)+1), m_fetch_xor) << 8) | \
- (m_direct->read_decrypted_byte(((a)+2), m_fetch_xor) << 16) | \
- (m_direct->read_decrypted_byte(((a)+3), m_fetch_xor) << 24))
+#define OpRead8(a) (m_direct->read_byte((a), m_fetch_xor))
+#define OpRead16(a) ((m_direct->read_byte(((a)+0), m_fetch_xor) << 0) | \
+ (m_direct->read_byte(((a)+1), m_fetch_xor) << 8))
+#define OpRead32(a) ((m_direct->read_byte(((a)+0), m_fetch_xor) << 0) | \
+ (m_direct->read_byte(((a)+1), m_fetch_xor) << 8) | \
+ (m_direct->read_byte(((a)+2), m_fetch_xor) << 16) | \
+ (m_direct->read_byte(((a)+3), m_fetch_xor) << 24))
#endif
diff --git a/src/emu/cpu/v810/v810.c b/src/emu/cpu/v810/v810.c
index c665053af7a..9e6db000949 100644
--- a/src/emu/cpu/v810/v810.c
+++ b/src/emu/cpu/v810/v810.c
@@ -137,7 +137,7 @@ offs_t v810_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *opr
#define WIO_H(addr, val) (m_io->write_word(addr,val))
#define WIO_W(addr, val) (m_io->write_dword(addr,val))
-#define R_OP(addr) (m_direct->read_decrypted_word(addr))
+#define R_OP(addr) (m_direct->read_word(addr))
#define GET1 (op&0x1f)
#define GET2 ((op>>5)&0x1f)
diff --git a/src/emu/cpu/x86emit.h b/src/emu/cpu/x86emit.h
index 4a200cb2d5a..45e1c456737 100644
--- a/src/emu/cpu/x86emit.h
+++ b/src/emu/cpu/x86emit.h
@@ -3181,7 +3181,7 @@ inline void emit_cvttpd2dq_r128_m128(x86code *&emitptr, UINT8 dreg, x86_memref m
inline void emit_roundpd_r128_r128_imm(x86code *&emitptr, UINT8 dreg, UINT8 sreg, UINT8 imm) { emit_op_modrm_reg(emitptr, OP_ROUNDPD_Vdq_Wdq_Ib, OP_32BIT, dreg, sreg); emit_byte(emitptr, imm); }
inline void emit_roundpd_r128_m128_imm(x86code *&emitptr, UINT8 dreg, x86_memref memref, UINT8 imm) { emit_op_modrm_mem(emitptr, OP_ROUNDPD_Vdq_Wdq_Ib, OP_32BIT, dreg, memref); emit_byte(emitptr, imm); }
-};
+}
#undef X86EMIT_SIZE
diff --git a/src/emu/cpu/z180/z180.c b/src/emu/cpu/z180/z180.c
index 60fea4491c6..134e67dfb72 100644
--- a/src/emu/cpu/z180/z180.c
+++ b/src/emu/cpu/z180/z180.c
@@ -85,6 +85,7 @@ z180_device::z180_device(const machine_config &mconfig, const char *tag, device_
: cpu_device(mconfig, Z180, "Z180", tag, owner, clock, "z180", __FILE__)
, m_program_config("program", ENDIANNESS_LITTLE, 8, 20, 0)
, m_io_config("io", ENDIANNESS_LITTLE, 8, 16, 0)
+ , m_decrypted_opcodes_config("program", ENDIANNESS_LITTLE, 8, 20, 0)
{
}
@@ -767,6 +768,18 @@ static UINT8 *SZHVC_sub;
#include "z180ed.inc"
#include "z180op.inc"
+
+const address_space_config *z180_device::memory_space_config(address_spacenum spacenum) const
+{
+ switch(spacenum)
+ {
+ case AS_PROGRAM: return &m_program_config;
+ case AS_IO: return &m_io_config;
+ case AS_DECRYPTED_OPCODES: return has_configured_map(AS_DECRYPTED_OPCODES) ? &m_decrypted_opcodes_config : NULL;
+ default: return NULL;
+ }
+}
+
UINT8 z180_device::z180_readcontrol(offs_t port)
{
/* normal external readport */
@@ -1956,6 +1969,8 @@ void z180_device::device_start()
m_program = &space(AS_PROGRAM);
m_direct = &m_program->direct();
+ m_oprogram = has_space(AS_DECRYPTED_OPCODES) ? &space(AS_DECRYPTED_OPCODES) : m_program;
+ m_odirect = &m_oprogram->direct();
m_iospace = &space(AS_IO);
/* set up the state table */
diff --git a/src/emu/cpu/z180/z180.h b/src/emu/cpu/z180/z180.h
index a3d50852bf3..7529280b95a 100644
--- a/src/emu/cpu/z180/z180.h
+++ b/src/emu/cpu/z180/z180.h
@@ -153,7 +153,7 @@ protected:
virtual void execute_set_input(int inputnum, int state);
// device_memory_interface overrides
- virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const { return (spacenum == AS_PROGRAM) ? &m_program_config : ( (spacenum == AS_IO) ? &m_io_config : NULL ); }
+ virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
virtual bool memory_translate(address_spacenum spacenum, int intention, offs_t &address);
// device_state_interface overrides
@@ -169,6 +169,7 @@ protected:
private:
address_space_config m_program_config;
address_space_config m_io_config;
+ address_space_config m_decrypted_opcodes_config;
PAIR m_PREPC,m_PC,m_SP,m_AF,m_BC,m_DE,m_HL,m_IX,m_IY;
PAIR m_AF2,m_BC2,m_DE2,m_HL2;
@@ -193,6 +194,8 @@ private:
z80_daisy_chain m_daisy;
address_space *m_program;
direct_read_data *m_direct;
+ address_space *m_oprogram;
+ direct_read_data *m_odirect;
address_space *m_iospace;
UINT8 m_rtemp;
UINT32 m_ioltemp;
diff --git a/src/emu/cpu/z180/z180dd.inc b/src/emu/cpu/z180/z180dd.inc
index 99557547757..bd2a9fc7137 100644
--- a/src/emu/cpu/z180/z180dd.inc
+++ b/src/emu/cpu/z180/z180dd.inc
@@ -2,7 +2,7 @@
// copyright-holders:Juergen Buchmueller
OP(illegal,1) {
logerror("Z180 '%s' ill. opcode $%02x $%02x\n",
- tag(), m_direct->read_decrypted_byte((_PCD-1)&0xffff), m_direct->read_decrypted_byte(_PCD));
+ tag(), m_odirect->read_byte((_PCD-1)&0xffff), m_odirect->read_byte(_PCD));
}
/**********************************************************
diff --git a/src/emu/cpu/z180/z180ed.inc b/src/emu/cpu/z180/z180ed.inc
index 83dcee1afdb..91520228f87 100644
--- a/src/emu/cpu/z180/z180ed.inc
+++ b/src/emu/cpu/z180/z180ed.inc
@@ -3,7 +3,7 @@
OP(illegal,2)
{
logerror("Z180 '%s' ill. opcode $ed $%02x\n",
- tag(), m_direct->read_decrypted_byte((_PCD-1)&0xffff));
+ tag(), m_odirect->read_byte((_PCD-1)&0xffff));
}
/**********************************************************
diff --git a/src/emu/cpu/z180/z180ops.h b/src/emu/cpu/z180/z180ops.h
index 66de64871ba..36f06a6847f 100644
--- a/src/emu/cpu/z180/z180ops.h
+++ b/src/emu/cpu/z180/z180ops.h
@@ -102,7 +102,7 @@ UINT8 z180_device::ROP()
{
offs_t addr = _PCD;
_PC++;
- return m_direct->read_decrypted_byte(MMU_REMAP_ADDR(addr));
+ return m_odirect->read_byte(MMU_REMAP_ADDR(addr));
}
/****************************************************************
@@ -115,14 +115,14 @@ UINT8 z180_device::ARG()
{
offs_t addr = _PCD;
_PC++;
- return m_direct->read_raw_byte(MMU_REMAP_ADDR(addr));
+ return m_direct->read_byte(MMU_REMAP_ADDR(addr));
}
UINT32 z180_device::ARG16()
{
offs_t addr = _PCD;
_PC += 2;
- return m_direct->read_raw_byte(MMU_REMAP_ADDR(addr)) | (m_direct->read_raw_byte(MMU_REMAP_ADDR(addr+1)) << 8);
+ return m_direct->read_byte(MMU_REMAP_ADDR(addr)) | (m_direct->read_byte(MMU_REMAP_ADDR(addr+1)) << 8);
}
/***************************************************************
diff --git a/src/emu/cpu/z8/z8.c b/src/emu/cpu/z8/z8.c
index bcff4b44145..7db38eaf500 100644
--- a/src/emu/cpu/z8/z8.c
+++ b/src/emu/cpu/z8/z8.c
@@ -210,7 +210,7 @@ offs_t z8_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom
UINT8 z8_device::fetch()
{
- UINT8 data = m_direct->read_decrypted_byte(m_pc);
+ UINT8 data = m_direct->read_byte(m_pc);
m_pc++;
diff --git a/src/emu/cpu/z8/z8.h b/src/emu/cpu/z8/z8.h
index 79c64c268b2..3ab30695bd6 100644
--- a/src/emu/cpu/z8/z8.h
+++ b/src/emu/cpu/z8/z8.h
@@ -150,134 +150,134 @@ private:
inline void swap(UINT8 dst);
#define INSTRUCTION(inst) void inst(UINT8 opcode, int *cycles);
- INSTRUCTION( illegal );
- INSTRUCTION( clr_R1 );
- INSTRUCTION( clr_IR1 );
- INSTRUCTION( ld_r1_IM );
- INSTRUCTION( ld_r1_R2 );
- INSTRUCTION( ld_r2_R1 );
- INSTRUCTION( ld_Ir1_r2 );
- INSTRUCTION( ld_R2_IR1 );
- INSTRUCTION( ld_r1_x_R2 );
- INSTRUCTION( ld_r2_x_R1 );
- INSTRUCTION( ld_r1_r2 );
- INSTRUCTION( ld_r1_Ir2 );
- INSTRUCTION( ld_R2_R1 );
- INSTRUCTION( ld_IR2_R1 );
- INSTRUCTION( ld_R1_IM );
- INSTRUCTION( ld_IR1_IM );
- INSTRUCTION( ldc_r1_Irr2 );
- INSTRUCTION( ldc_r2_Irr1 );
- INSTRUCTION( ldci_Ir1_Irr2 );
- INSTRUCTION( ldci_Ir2_Irr1 );
- INSTRUCTION( lde_r1_Irr2 );
- INSTRUCTION( lde_r2_Irr1 );
- INSTRUCTION( ldei_Ir1_Irr2 );
- INSTRUCTION( ldei_Ir2_Irr1 );
- INSTRUCTION( pop_R1 );
- INSTRUCTION( pop_IR1 );
- INSTRUCTION( push_R2 );
- INSTRUCTION( push_IR2 );
- INSTRUCTION( adc_r1_r2 );
- INSTRUCTION( adc_r1_Ir2 );
- INSTRUCTION( adc_R2_R1 );
- INSTRUCTION( adc_IR2_R1 );
- INSTRUCTION( adc_R1_IM );
- INSTRUCTION( adc_IR1_IM );
- INSTRUCTION( add_r1_r2 );
- INSTRUCTION( add_r1_Ir2 );
- INSTRUCTION( add_R2_R1 );
- INSTRUCTION( add_IR2_R1 );
- INSTRUCTION( add_R1_IM );
- INSTRUCTION( add_IR1_IM );
- INSTRUCTION( cp_r1_r2 );
- INSTRUCTION( cp_r1_Ir2 );
- INSTRUCTION( cp_R2_R1 );
- INSTRUCTION( cp_IR2_R1 );
- INSTRUCTION( cp_R1_IM );
- INSTRUCTION( cp_IR1_IM );
- INSTRUCTION( da_R1 );
- INSTRUCTION( da_IR1 );
- INSTRUCTION( dec_R1 );
- INSTRUCTION( dec_IR1 );
- INSTRUCTION( decw_RR1 );
- INSTRUCTION( decw_IR1 );
- INSTRUCTION( inc_r1 );
- INSTRUCTION( inc_R1 );
- INSTRUCTION( inc_IR1 );
- INSTRUCTION( incw_RR1 );
- INSTRUCTION( incw_IR1 );
- INSTRUCTION( sbc_r1_r2 );
- INSTRUCTION( sbc_r1_Ir2 );
- INSTRUCTION( sbc_R2_R1 );
- INSTRUCTION( sbc_IR2_R1 );
- INSTRUCTION( sbc_R1_IM );
- INSTRUCTION( sbc_IR1_IM );
- INSTRUCTION( sub_r1_r2 );
- INSTRUCTION( sub_r1_Ir2 );
- INSTRUCTION( sub_R2_R1 );
- INSTRUCTION( sub_IR2_R1 );
- INSTRUCTION( sub_R1_IM );
- INSTRUCTION( sub_IR1_IM );
- INSTRUCTION( and_r1_r2 );
- INSTRUCTION( and_r1_Ir2 );
- INSTRUCTION( and_R2_R1 );
- INSTRUCTION( and_IR2_R1 );
- INSTRUCTION( and_R1_IM );
- INSTRUCTION( and_IR1_IM );
- INSTRUCTION( com_R1 );
- INSTRUCTION( com_IR1 );
- INSTRUCTION( or_r1_r2 );
- INSTRUCTION( or_r1_Ir2 );
- INSTRUCTION( or_R2_R1 );
- INSTRUCTION( or_IR2_R1 );
- INSTRUCTION( or_R1_IM );
- INSTRUCTION( or_IR1_IM );
- INSTRUCTION( xor_r1_r2 );
- INSTRUCTION( xor_r1_Ir2 );
- INSTRUCTION( xor_R2_R1 );
- INSTRUCTION( xor_IR2_R1 );
- INSTRUCTION( xor_R1_IM );
- INSTRUCTION( xor_IR1_IM );
- INSTRUCTION( call_IRR1 );
- INSTRUCTION( call_DA );
- INSTRUCTION( djnz_r1_RA );
- INSTRUCTION( iret );
- INSTRUCTION( ret );
- INSTRUCTION( jp_IRR1 );
+ INSTRUCTION( illegal )
+ INSTRUCTION( clr_R1 )
+ INSTRUCTION( clr_IR1 )
+ INSTRUCTION( ld_r1_IM )
+ INSTRUCTION( ld_r1_R2 )
+ INSTRUCTION( ld_r2_R1 )
+ INSTRUCTION( ld_Ir1_r2 )
+ INSTRUCTION( ld_R2_IR1 )
+ INSTRUCTION( ld_r1_x_R2 )
+ INSTRUCTION( ld_r2_x_R1 )
+ INSTRUCTION( ld_r1_r2 )
+ INSTRUCTION( ld_r1_Ir2 )
+ INSTRUCTION( ld_R2_R1 )
+ INSTRUCTION( ld_IR2_R1 )
+ INSTRUCTION( ld_R1_IM )
+ INSTRUCTION( ld_IR1_IM )
+ INSTRUCTION( ldc_r1_Irr2 )
+ INSTRUCTION( ldc_r2_Irr1 )
+ INSTRUCTION( ldci_Ir1_Irr2 )
+ INSTRUCTION( ldci_Ir2_Irr1 )
+ INSTRUCTION( lde_r1_Irr2 )
+ INSTRUCTION( lde_r2_Irr1 )
+ INSTRUCTION( ldei_Ir1_Irr2 )
+ INSTRUCTION( ldei_Ir2_Irr1 )
+ INSTRUCTION( pop_R1 )
+ INSTRUCTION( pop_IR1 )
+ INSTRUCTION( push_R2 )
+ INSTRUCTION( push_IR2 )
+ INSTRUCTION( adc_r1_r2 )
+ INSTRUCTION( adc_r1_Ir2 )
+ INSTRUCTION( adc_R2_R1 )
+ INSTRUCTION( adc_IR2_R1 )
+ INSTRUCTION( adc_R1_IM )
+ INSTRUCTION( adc_IR1_IM )
+ INSTRUCTION( add_r1_r2 )
+ INSTRUCTION( add_r1_Ir2 )
+ INSTRUCTION( add_R2_R1 )
+ INSTRUCTION( add_IR2_R1 )
+ INSTRUCTION( add_R1_IM )
+ INSTRUCTION( add_IR1_IM )
+ INSTRUCTION( cp_r1_r2 )
+ INSTRUCTION( cp_r1_Ir2 )
+ INSTRUCTION( cp_R2_R1 )
+ INSTRUCTION( cp_IR2_R1 )
+ INSTRUCTION( cp_R1_IM )
+ INSTRUCTION( cp_IR1_IM )
+ INSTRUCTION( da_R1 )
+ INSTRUCTION( da_IR1 )
+ INSTRUCTION( dec_R1 )
+ INSTRUCTION( dec_IR1 )
+ INSTRUCTION( decw_RR1 )
+ INSTRUCTION( decw_IR1 )
+ INSTRUCTION( inc_r1 )
+ INSTRUCTION( inc_R1 )
+ INSTRUCTION( inc_IR1 )
+ INSTRUCTION( incw_RR1 )
+ INSTRUCTION( incw_IR1 )
+ INSTRUCTION( sbc_r1_r2 )
+ INSTRUCTION( sbc_r1_Ir2 )
+ INSTRUCTION( sbc_R2_R1 )
+ INSTRUCTION( sbc_IR2_R1 )
+ INSTRUCTION( sbc_R1_IM )
+ INSTRUCTION( sbc_IR1_IM )
+ INSTRUCTION( sub_r1_r2 )
+ INSTRUCTION( sub_r1_Ir2 )
+ INSTRUCTION( sub_R2_R1 )
+ INSTRUCTION( sub_IR2_R1 )
+ INSTRUCTION( sub_R1_IM )
+ INSTRUCTION( sub_IR1_IM )
+ INSTRUCTION( and_r1_r2 )
+ INSTRUCTION( and_r1_Ir2 )
+ INSTRUCTION( and_R2_R1 )
+ INSTRUCTION( and_IR2_R1 )
+ INSTRUCTION( and_R1_IM )
+ INSTRUCTION( and_IR1_IM )
+ INSTRUCTION( com_R1 )
+ INSTRUCTION( com_IR1 )
+ INSTRUCTION( or_r1_r2 )
+ INSTRUCTION( or_r1_Ir2 )
+ INSTRUCTION( or_R2_R1 )
+ INSTRUCTION( or_IR2_R1 )
+ INSTRUCTION( or_R1_IM )
+ INSTRUCTION( or_IR1_IM )
+ INSTRUCTION( xor_r1_r2 )
+ INSTRUCTION( xor_r1_Ir2 )
+ INSTRUCTION( xor_R2_R1 )
+ INSTRUCTION( xor_IR2_R1 )
+ INSTRUCTION( xor_R1_IM )
+ INSTRUCTION( xor_IR1_IM )
+ INSTRUCTION( call_IRR1 )
+ INSTRUCTION( call_DA )
+ INSTRUCTION( djnz_r1_RA )
+ INSTRUCTION( iret )
+ INSTRUCTION( ret )
+ INSTRUCTION( jp_IRR1 )
INSTRUCTION( jp_cc_DA )
INSTRUCTION( jr_cc_RA )
- INSTRUCTION( tcm_r1_r2 );
- INSTRUCTION( tcm_r1_Ir2 );
- INSTRUCTION( tcm_R2_R1 );
- INSTRUCTION( tcm_IR2_R1 );
- INSTRUCTION( tcm_R1_IM );
- INSTRUCTION( tcm_IR1_IM );
- INSTRUCTION( tm_r1_r2 );
- INSTRUCTION( tm_r1_Ir2 );
- INSTRUCTION( tm_R2_R1 );
- INSTRUCTION( tm_IR2_R1 );
- INSTRUCTION( tm_R1_IM );
- INSTRUCTION( tm_IR1_IM );
- INSTRUCTION( rl_R1 );
- INSTRUCTION( rl_IR1 );
- INSTRUCTION( rlc_R1 );
- INSTRUCTION( rlc_IR1 );
- INSTRUCTION( rr_R1 );
- INSTRUCTION( rr_IR1 );
- INSTRUCTION( rrc_R1 );
- INSTRUCTION( rrc_IR1 );
- INSTRUCTION( sra_R1 );
- INSTRUCTION( sra_IR1 );
- INSTRUCTION( swap_R1 );
- INSTRUCTION( swap_IR1 );
- INSTRUCTION( ccf );
- INSTRUCTION( di );
- INSTRUCTION( ei );
- INSTRUCTION( nop );
- INSTRUCTION( rcf );
- INSTRUCTION( scf );
- INSTRUCTION( srp_IM );
+ INSTRUCTION( tcm_r1_r2 )
+ INSTRUCTION( tcm_r1_Ir2 )
+ INSTRUCTION( tcm_R2_R1 )
+ INSTRUCTION( tcm_IR2_R1 )
+ INSTRUCTION( tcm_R1_IM )
+ INSTRUCTION( tcm_IR1_IM )
+ INSTRUCTION( tm_r1_r2 )
+ INSTRUCTION( tm_r1_Ir2 )
+ INSTRUCTION( tm_R2_R1 )
+ INSTRUCTION( tm_IR2_R1 )
+ INSTRUCTION( tm_R1_IM )
+ INSTRUCTION( tm_IR1_IM )
+ INSTRUCTION( rl_R1 )
+ INSTRUCTION( rl_IR1 )
+ INSTRUCTION( rlc_R1 )
+ INSTRUCTION( rlc_IR1 )
+ INSTRUCTION( rr_R1 )
+ INSTRUCTION( rr_IR1 )
+ INSTRUCTION( rrc_R1 )
+ INSTRUCTION( rrc_IR1 )
+ INSTRUCTION( sra_R1 )
+ INSTRUCTION( sra_IR1 )
+ INSTRUCTION( swap_R1 )
+ INSTRUCTION( swap_IR1 )
+ INSTRUCTION( ccf )
+ INSTRUCTION( di )
+ INSTRUCTION( ei )
+ INSTRUCTION( nop )
+ INSTRUCTION( rcf )
+ INSTRUCTION( scf )
+ INSTRUCTION( srp_IM )
#undef INSTRUCTION
typedef void (z8_device::*z8_opcode_func) (UINT8 opcode, int *cycles);
diff --git a/src/emu/cpu/z8/z8ops.inc b/src/emu/cpu/z8/z8ops.inc
index 79621ed1512..4c522791b8e 100644
--- a/src/emu/cpu/z8/z8ops.inc
+++ b/src/emu/cpu/z8/z8ops.inc
@@ -146,7 +146,7 @@ void z8_device::load_from_memory(address_space *space)
UINT8 src = get_working_register(operands & 0x0f);
UINT16 address = register_pair_read(src);
- UINT8 data = m_direct->read_decrypted_byte(address);
+ UINT8 data = m_direct->read_byte(address);
register_write(dst, data);
}
@@ -171,7 +171,7 @@ void z8_device::load_from_memory_autoinc(address_space *space)
UINT8 src = get_working_register(operands & 0x0f);
UINT16 address = register_pair_read(src);
- UINT8 data = m_direct->read_decrypted_byte(address);
+ UINT8 data = m_direct->read_byte(address);
register_write(real_dst, data);
diff --git a/src/emu/cpu/z80/z80.c b/src/emu/cpu/z80/z80.c
index df11378ffac..2b5e2e877f7 100644
--- a/src/emu/cpu/z80/z80.c
+++ b/src/emu/cpu/z80/z80.c
@@ -473,7 +473,7 @@ inline UINT8 z80_device::rop()
{
unsigned pc = PCD;
PC++;
- return m_direct->read_decrypted_byte(pc);
+ return m_decrypted_opcodes_direct->read_byte(pc);
}
/****************************************************************
@@ -486,14 +486,14 @@ inline UINT8 z80_device::arg()
{
unsigned pc = PCD;
PC++;
- return m_direct->read_raw_byte(pc);
+ return m_direct->read_byte(pc);
}
inline UINT16 z80_device::arg16()
{
unsigned pc = PCD;
PC += 2;
- return m_direct->read_raw_byte(pc) | (m_direct->read_raw_byte((pc+1)&0xffff) << 8);
+ return m_direct->read_byte(pc) | (m_direct->read_byte((pc+1)&0xffff) << 8);
}
/***************************************************************
@@ -1945,7 +1945,7 @@ OP(xycb,ff) { A = set(7, rm(m_ea)); wm(m_ea, A); } /* SET 7,A=(XY+o) */
OP(illegal,1) {
logerror("Z80 '%s' ill. opcode $%02x $%02x\n",
- tag(), m_direct->read_decrypted_byte((PCD-1)&0xffff), m_direct->read_decrypted_byte(PCD));
+ tag(), m_decrypted_opcodes_direct->read_byte((PCD-1)&0xffff), m_decrypted_opcodes_direct->read_byte(PCD));
}
/**********************************************************
@@ -2533,7 +2533,7 @@ OP(fd,ff) { illegal_1(); op_ff(); } /* DB FD
OP(illegal,2)
{
logerror("Z80 '%s' ill. opcode $ed $%02x\n",
- tag(), m_direct->read_decrypted_byte((PCD-1)&0xffff));
+ tag(), m_decrypted_opcodes_direct->read_byte((PCD-1)&0xffff));
}
/**********************************************************
@@ -3375,7 +3375,9 @@ void z80_device::device_start()
m_ea = 0;
m_program = &space(AS_PROGRAM);
+ m_decrypted_opcodes = has_space(AS_DECRYPTED_OPCODES) ? &space(AS_DECRYPTED_OPCODES) : m_program;
m_direct = &m_program->direct();
+ m_decrypted_opcodes_direct = &m_decrypted_opcodes->direct();
m_io = &space(AS_IO);
if (static_config() != NULL)
@@ -3702,6 +3704,7 @@ void z80_device::z80_set_cycle_tables(const UINT8 *op, const UINT8 *cb, const UI
z80_device::z80_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
cpu_device(mconfig, Z80, "Z80", tag, owner, clock, "z80", __FILE__),
m_program_config("program", ENDIANNESS_LITTLE, 8, 16, 0),
+ m_decrypted_opcodes_config("decrypted_opcodes", ENDIANNESS_LITTLE, 8, 16, 0),
m_io_config("io", ENDIANNESS_LITTLE, 8, 16, 0)
{
}
@@ -3709,10 +3712,22 @@ z80_device::z80_device(const machine_config &mconfig, const char *tag, device_t
z80_device::z80_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
cpu_device(mconfig, type, name, tag, owner, clock, shortname, source),
m_program_config("program", ENDIANNESS_LITTLE, 8, 16, 0),
+ m_decrypted_opcodes_config("decrypted_opcodes", ENDIANNESS_LITTLE, 8, 16, 0),
m_io_config("io", ENDIANNESS_LITTLE, 8, 16, 0)
{
}
+const address_space_config *z80_device::memory_space_config(address_spacenum spacenum) const
+{
+ switch(spacenum)
+ {
+ case AS_PROGRAM: return &m_program_config;
+ case AS_IO: return &m_io_config;
+ case AS_DECRYPTED_OPCODES: return has_configured_map(AS_DECRYPTED_OPCODES) ? &m_decrypted_opcodes_config : NULL;
+ default: return NULL;
+ }
+}
+
const device_type Z80 = &device_creator<z80_device>;
nsc800_device::nsc800_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
diff --git a/src/emu/cpu/z80/z80.h b/src/emu/cpu/z80/z80.h
index be04708b3a2..e424c4f9937 100644
--- a/src/emu/cpu/z80/z80.h
+++ b/src/emu/cpu/z80/z80.h
@@ -55,7 +55,7 @@ protected:
virtual void execute_set_input(int inputnum, int state);
// device_memory_interface overrides
- virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const { return (spacenum == AS_PROGRAM) ? &m_program_config : ( (spacenum == AS_IO) ? &m_io_config : NULL ); }
+ virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
// device_state_interface overrides
virtual void state_import(const device_state_entry &entry);
@@ -137,12 +137,12 @@ protected:
void illegal_1();
void illegal_2();
- PROTOTYPES(op);
- PROTOTYPES(cb);
- PROTOTYPES(dd);
- PROTOTYPES(ed);
- PROTOTYPES(fd);
- PROTOTYPES(xycb);
+ PROTOTYPES(op)
+ PROTOTYPES(cb)
+ PROTOTYPES(dd)
+ PROTOTYPES(ed)
+ PROTOTYPES(fd)
+ PROTOTYPES(xycb)
void halt();
void leave_halt();
@@ -233,10 +233,13 @@ protected:
// address spaces
const address_space_config m_program_config;
+ const address_space_config m_decrypted_opcodes_config;
const address_space_config m_io_config;
address_space *m_program;
- address_space *m_io;
+ address_space *m_decrypted_opcodes;
+ address_space *m_io;
direct_read_data *m_direct;
+ direct_read_data *m_decrypted_opcodes_direct;
PAIR m_prvpc;
PAIR m_pc;
diff --git a/src/emu/cpu/z8000/z8000ops.inc b/src/emu/cpu/z8000/z8000ops.inc
index 511a0034887..c9d0b365783 100644
--- a/src/emu/cpu/z8000/z8000ops.inc
+++ b/src/emu/cpu/z8000/z8000ops.inc
@@ -4515,13 +4515,14 @@ void z8002_device::Z76_ssN0_dddd_addr()
GET_DST(OP0,NIB3);
GET_SRC(OP0,NIB2);
GET_ADDR_RAW(OP1);
+ UINT16 temp = RW(src); // store src in case dst == src
if (segmented_mode()) {
RL(dst) = addr;
}
else {
RW(dst) = addr;
}
- add_to_addr_reg(dst, RW(src));
+ add_to_addr_reg(dst, temp);
}
/******************************************
diff --git a/src/emu/cpu/z8000/z8000tbl.inc b/src/emu/cpu/z8000/z8000tbl.inc
index ad66cb8c421..e4959706858 100644
--- a/src/emu/cpu/z8000/z8000tbl.inc
+++ b/src/emu/cpu/z8000/z8000tbl.inc
@@ -403,7 +403,7 @@ static const Z8000_init table[] = {
{0x9900,0x99ff, 1,1, 70,&z8002_device::Z99_ssss_dddd, "mult %rl3,%rw2", 0},
{0x9a00,0x9aff, 1,1,744,&z8002_device::Z9A_ssss_dddd, "divl %rq3,%rl2", 0},
{0x9b00,0x9bff, 1,1,107,&z8002_device::Z9B_ssss_dddd, "div %rl3,%rw2", 0},
-{0x9c08,0x9cf8,16,1, 13,&z8002_device::Z9C_dddd_1000, "testl %rl2", 0},
+{0x9c00,0x9cf8, 8,1, 13,&z8002_device::Z9C_dddd_1000, "testl %rl2", 0},
{0x9d00,0x9dff, 1,1, 10,&z8002_device::Z9D_imm8, "rsvd9d", 0},
{0x9e00,0x9e0f, 1,1, 10,&z8002_device::Z9E_0000_cccc, "ret %c3", DASMFLAG_STEP_OUT},
{0x9f00,0x9fff, 1,1, 10,&z8002_device::Z9F_imm8, "rsvd9f", 0},
@@ -543,7 +543,7 @@ void z8000_init_tables(void)
for (i = 0; i < 256; i++)
z8000_zsp[i] = ((i == 0) ? F_Z : 0) |
((i & 128) ? F_S : 0) |
- ((((i>>7)^(i>>6)^(i>>5)^(i>>4)^(i>>3)^(i>>2)^(i>>1)^i) & 1) ? F_PV : 0);
+ ((((i>>7)^(i>>6)^(i>>5)^(i>>4)^(i>>3)^(i>>2)^(i>>1)^i) & 1) ? 0 : F_PV);
/* first set all 64K opcodes to invalid */
for (i = 0; i < 0x10000; i++)
diff --git a/src/emu/debug/debugcmd.c b/src/emu/debug/debugcmd.c
index 8e76f3b3b2b..d7e5f48f79c 100644
--- a/src/emu/debug/debugcmd.c
+++ b/src/emu/debug/debugcmd.c
@@ -2453,7 +2453,7 @@ static void execute_dasm(running_machine &machine, int ref, int params, const ch
{
UINT64 offset, length, bytes = 1;
int minbytes, maxbytes, byteswidth;
- address_space *space;
+ address_space *space, *decrypted_space;
FILE *f = NULL;
int j;
@@ -2466,6 +2466,8 @@ static void execute_dasm(running_machine &machine, int ref, int params, const ch
return;
if (!debug_command_parameter_cpu_space(machine, (params > 4) ? param[4] : NULL, AS_PROGRAM, space))
return;
+ if (!debug_command_parameter_cpu_space(machine, (params > 4) ? param[4] : NULL, AS_DECRYPTED_OPCODES, decrypted_space))
+ decrypted_space = space;
/* determine the width of the bytes */
cpu_device *cpudevice = downcast<cpu_device *>(&space->device());
@@ -2508,8 +2510,8 @@ static void execute_dasm(running_machine &machine, int ref, int params, const ch
/* fetch the bytes up to the maximum */
for (numbytes = 0; numbytes < maxbytes; numbytes++)
{
- opbuf[numbytes] = debug_read_opcode(*space, pcbyte + numbytes, 1, FALSE);
- argbuf[numbytes] = debug_read_opcode(*space, pcbyte + numbytes, 1, TRUE);
+ opbuf[numbytes] = debug_read_opcode(*decrypted_space, pcbyte + numbytes, 1);
+ argbuf[numbytes] = debug_read_opcode(*space, pcbyte + numbytes, 1);
}
/* disassemble the result */
@@ -2522,7 +2524,7 @@ static void execute_dasm(running_machine &machine, int ref, int params, const ch
int startdex = outdex;
numbytes = space->address_to_byte(numbytes);
for (j = 0; j < numbytes; j += minbytes)
- outdex += sprintf(&output[outdex], "%s ", core_i64_hex_format(debug_read_opcode(*space, pcbyte + j, minbytes, FALSE), minbytes * 2));
+ outdex += sprintf(&output[outdex], "%s ", core_i64_hex_format(debug_read_opcode(*decrypted_space, pcbyte + j, minbytes), minbytes * 2));
if (outdex - startdex < byteswidth)
outdex += sprintf(&output[outdex], "%*s", byteswidth - (outdex - startdex), "");
outdex += sprintf(&output[outdex], " ");
@@ -2647,9 +2649,11 @@ static void execute_traceflush(running_machine &machine, int ref, int params, co
static void execute_history(running_machine &machine, int ref, int params, const char *param[])
{
/* validate parameters */
- address_space *space;
+ address_space *space, *decrypted_space;
if (!debug_command_parameter_cpu_space(machine, (params > 0) ? param[0] : NULL, AS_PROGRAM, space))
return;
+ if (!debug_command_parameter_cpu_space(machine, (params > 0) ? param[0] : NULL, AS_DECRYPTED_OPCODES, decrypted_space))
+ decrypted_space = space;
UINT64 count = device_debug::HISTORY_SIZE;
if (!debug_command_parameter_number(machine, param[1], &count))
@@ -2672,8 +2676,8 @@ static void execute_history(running_machine &machine, int ref, int params, const
UINT8 opbuf[64], argbuf[64];
for (int numbytes = 0; numbytes < maxbytes; numbytes++)
{
- opbuf[numbytes] = debug_read_opcode(*space, pcbyte + numbytes, 1, false);
- argbuf[numbytes] = debug_read_opcode(*space, pcbyte + numbytes, 1, true);
+ opbuf[numbytes] = debug_read_opcode(*decrypted_space, pcbyte + numbytes, 1);
+ argbuf[numbytes] = debug_read_opcode(*space, pcbyte + numbytes, 1);
}
char buffer[200];
diff --git a/src/emu/debug/debugcpu.c b/src/emu/debug/debugcpu.c
index 9e3d8121344..2eeb2e1af72 100644
--- a/src/emu/debug/debugcpu.c
+++ b/src/emu/debug/debugcpu.c
@@ -860,7 +860,7 @@ void debug_write_memory(address_space &space, offs_t address, UINT64 data, int s
the given offset from opcode space
-------------------------------------------------*/
-UINT64 debug_read_opcode(address_space &space, offs_t address, int size, int arg)
+UINT64 debug_read_opcode(address_space &space, offs_t address, int size)
{
UINT64 result = ~(UINT64)0 & (~(UINT64)0 >> (64 - 8*size)), result2;
debugcpu_private *global = space.machine().debugcpu_data;
@@ -881,8 +881,8 @@ UINT64 debug_read_opcode(address_space &space, offs_t address, int size, int arg
if (size > space.data_width() / 8)
{
int halfsize = size / 2;
- UINT64 r0 = debug_read_opcode(space, address + 0, halfsize, arg);
- UINT64 r1 = debug_read_opcode(space, address + halfsize, halfsize, arg);
+ UINT64 r0 = debug_read_opcode(space, address + 0, halfsize);
+ UINT64 r1 = debug_read_opcode(space, address + halfsize, halfsize);
if (space.endianness() == ENDIANNESS_LITTLE)
return r0 | (r1 << (8 * halfsize));
@@ -957,14 +957,14 @@ UINT64 debug_read_opcode(address_space &space, offs_t address, int size, int arg
switch (size)
{
case 1:
- result = (arg) ? space.direct().read_raw_byte(address, addrxor) : space.direct().read_decrypted_byte(address, addrxor);
+ result = space.direct().read_byte(address, addrxor);
break;
case 2:
- result = (arg) ? space.direct().read_raw_word(address & ~1, addrxor) : space.direct().read_decrypted_word(address & ~1, addrxor);
+ result = space.direct().read_word(address & ~1, addrxor);
if ((address & 1) != 0)
{
- result2 = (arg) ? space.direct().read_raw_word((address & ~1) + 2, addrxor) : space.direct().read_decrypted_word((address & ~1) + 2, addrxor);
+ result2 = space.direct().read_word((address & ~1) + 2, addrxor);
if (space.endianness() == ENDIANNESS_LITTLE)
result = (result >> (8 * (address & 1))) | (result2 << (16 - 8 * (address & 1)));
else
@@ -974,10 +974,10 @@ UINT64 debug_read_opcode(address_space &space, offs_t address, int size, int arg
break;
case 4:
- result = (arg) ? space.direct().read_raw_dword(address & ~3, addrxor) : space.direct().read_decrypted_dword(address & ~3, addrxor);
+ result = space.direct().read_dword(address & ~3, addrxor);
if ((address & 3) != 0)
{
- result2 = (arg) ? space.direct().read_raw_dword((address & ~3) + 4, addrxor) : space.direct().read_decrypted_dword((address & ~3) + 4, addrxor);
+ result2 = space.direct().read_dword((address & ~3) + 4, addrxor);
if (space.endianness() == ENDIANNESS_LITTLE)
result = (result >> (8 * (address & 3))) | (result2 << (32 - 8 * (address & 3)));
else
@@ -987,10 +987,10 @@ UINT64 debug_read_opcode(address_space &space, offs_t address, int size, int arg
break;
case 8:
- result = (arg) ? space.direct().read_raw_qword(address & ~7, addrxor) : space.direct().read_decrypted_qword(address & ~7, addrxor);
+ result = space.direct().read_qword(address & ~7, addrxor);
if ((address & 7) != 0)
{
- result2 = (arg) ? space.direct().read_raw_qword((address & ~7) + 8, addrxor) : space.direct().read_decrypted_qword((address & ~7) + 8, addrxor);
+ result2 = space.direct().read_qword((address & ~7) + 8, addrxor);
if (space.endianness() == ENDIANNESS_LITTLE)
result = (result >> (8 * (address & 7))) | (result2 << (64 - 8 * (address & 7)));
else
@@ -1219,10 +1219,7 @@ static UINT64 expression_read_program_direct(address_space &space, int opcode, o
offs_t lowmask = space.data_width() / 8 - 1;
/* get the base of memory, aligned to the address minus the lowbits */
- if (opcode & 1)
- base = (UINT8 *)space.direct().read_decrypted_ptr(address & ~lowmask);
- else
- base = (UINT8 *)space.get_read_ptr(address & ~lowmask);
+ base = (UINT8 *)space.get_read_ptr(address & ~lowmask);
/* if we have a valid base, return the appropriate byte */
if (base != NULL)
@@ -1394,10 +1391,7 @@ static void expression_write_program_direct(address_space &space, int opcode, of
offs_t lowmask = space.data_width() / 8 - 1;
/* get the base of memory, aligned to the address minus the lowbits */
- if (opcode & 1)
- base = (UINT8 *)space.direct().read_decrypted_ptr(address & ~lowmask);
- else
- base = (UINT8 *)space.get_read_ptr(address & ~lowmask);
+ base = (UINT8 *)space.get_read_ptr(address & ~lowmask);
/* if we have a valid base, write the appropriate byte */
if (base != NULL)
@@ -2733,6 +2727,7 @@ UINT32 device_debug::compute_opcode_crc32(offs_t pc) const
assert(m_memory != NULL);
// determine the adjusted PC
+ address_space &decrypted_space = m_memory->has_space(AS_DECRYPTED_OPCODES) ? m_memory->space(AS_DECRYPTED_OPCODES) : m_memory->space(AS_PROGRAM);
address_space &space = m_memory->space(AS_PROGRAM);
offs_t pcbyte = space.address_to_byte(pc) & space.bytemask();
@@ -2741,8 +2736,8 @@ UINT32 device_debug::compute_opcode_crc32(offs_t pc) const
int maxbytes = max_opcode_bytes();
for (int numbytes = 0; numbytes < maxbytes; numbytes++)
{
- opbuf[numbytes] = debug_read_opcode(space, pcbyte + numbytes, 1, false);
- argbuf[numbytes] = debug_read_opcode(space, pcbyte + numbytes, 1, true);
+ opbuf[numbytes] = debug_read_opcode(decrypted_space, pcbyte + numbytes, 1);
+ argbuf[numbytes] = debug_read_opcode(space, pcbyte + numbytes, 1);
}
// disassemble to our buffer
@@ -3128,6 +3123,7 @@ UINT32 device_debug::dasm_wrapped(std::string &buffer, offs_t pc)
assert(m_memory != NULL && m_disasm != NULL);
// determine the adjusted PC
+ address_space &decrypted_space = m_memory->has_space(AS_DECRYPTED_OPCODES) ? m_memory->space(AS_DECRYPTED_OPCODES) : m_memory->space(AS_PROGRAM);
address_space &space = m_memory->space(AS_PROGRAM);
offs_t pcbyte = space.address_to_byte(pc) & space.bytemask();
@@ -3136,8 +3132,8 @@ UINT32 device_debug::dasm_wrapped(std::string &buffer, offs_t pc)
int maxbytes = max_opcode_bytes();
for (int numbytes = 0; numbytes < maxbytes; numbytes++)
{
- opbuf[numbytes] = debug_read_opcode(space, pcbyte + numbytes, 1, false);
- argbuf[numbytes] = debug_read_opcode(space, pcbyte + numbytes, 1, true);
+ opbuf[numbytes] = debug_read_opcode(decrypted_space, pcbyte + numbytes, 1);
+ argbuf[numbytes] = debug_read_opcode(space, pcbyte + numbytes, 1);
}
// disassemble to our buffer
diff --git a/src/emu/debug/debugcpu.h b/src/emu/debug/debugcpu.h
index 2f1f90c4ef7..d337a7103f7 100644
--- a/src/emu/debug/debugcpu.h
+++ b/src/emu/debug/debugcpu.h
@@ -549,7 +549,7 @@ void debug_write_qword(address_space &space, offs_t address, UINT64 data, int ap
void debug_write_memory(address_space &space, offs_t address, UINT64 data, int size, int apply_translation);
/* read 1,2,4 or 8 bytes at the given offset from opcode space */
-UINT64 debug_read_opcode(address_space &space, offs_t offset, int size, int arg);
+UINT64 debug_read_opcode(address_space &space, offs_t offset, int size);
#endif
diff --git a/src/emu/debug/dvdisasm.c b/src/emu/debug/dvdisasm.c
index d29ab590fd4..afcd40dd0ef 100644
--- a/src/emu/debug/dvdisasm.c
+++ b/src/emu/debug/dvdisasm.c
@@ -27,7 +27,8 @@ debug_view_disasm_source::debug_view_disasm_source(const char *name, device_t &d
: debug_view_source(name, &device),
m_device(device),
m_disasmintf(dynamic_cast<device_disasm_interface *>(&device)),
- m_space(device.memory().space(AS_PROGRAM))
+ m_space(device.memory().space(AS_PROGRAM)),
+ m_decrypted_space(device.memory().has_space(AS_DECRYPTED_OPCODES) ? device.memory().space(AS_DECRYPTED_OPCODES) : device.memory().space(AS_PROGRAM))
{
}
@@ -251,8 +252,8 @@ offs_t debug_view_disasm::find_pc_backwards(offs_t targetpc, int numinstrs)
while (curpcbyte < fillpcbyte)
{
fillpcbyte--;
- opbuf[1000 + fillpcbyte - targetpcbyte] = debug_read_opcode(source.m_space, fillpcbyte, 1, FALSE);
- argbuf[1000 + fillpcbyte - targetpcbyte] = debug_read_opcode(source.m_space, fillpcbyte, 1, TRUE);
+ opbuf[1000 + fillpcbyte - targetpcbyte] = debug_read_opcode(source.m_decrypted_space, fillpcbyte, 1);
+ argbuf[1000 + fillpcbyte - targetpcbyte] = debug_read_opcode(source.m_space, fillpcbyte, 1);
}
// loop until we get past the target instruction
@@ -310,12 +311,12 @@ void debug_view_disasm::generate_bytes(offs_t pcbyte, int numbytes, int minbytes
// output the first value
int offset = 0;
if (maxchars >= char_num * minbytes)
- offset = sprintf(string, "%s", core_i64_format(debug_read_opcode(source.m_space, pcbyte, minbytes, FALSE), minbytes * char_num, source.is_octal()));
+ offset = sprintf(string, "%s", core_i64_format(debug_read_opcode(source.m_decrypted_space, pcbyte, minbytes), minbytes * char_num, source.is_octal()));
// output subsequent values
int byte;
for (byte = minbytes; byte < numbytes && offset + 1 + char_num * minbytes < maxchars; byte += minbytes)
- offset += sprintf(&string[offset], " %s", core_i64_format(debug_read_opcode(source.m_space, pcbyte + byte, minbytes, encrypted), minbytes * char_num, source.is_octal()));
+ offset += sprintf(&string[offset], " %s", core_i64_format(debug_read_opcode(encrypted ? source.m_space : source.m_decrypted_space, pcbyte + byte, minbytes), minbytes * char_num, source.is_octal()));
// if we ran out of room, indicate more
string[maxchars - 1] = 0;
@@ -394,8 +395,8 @@ bool debug_view_disasm::recompute(offs_t pc, int startline, int lines)
// fetch the bytes up to the maximum
for (numbytes = 0; numbytes < maxbytes; numbytes++)
{
- opbuf[numbytes] = debug_read_opcode(source.m_space, pcbyte + numbytes, 1, FALSE);
- argbuf[numbytes] = debug_read_opcode(source.m_space, pcbyte + numbytes, 1, TRUE);
+ opbuf[numbytes] = debug_read_opcode(source.m_decrypted_space, pcbyte + numbytes, 1);
+ argbuf[numbytes] = debug_read_opcode(source.m_space, pcbyte + numbytes, 1);
}
// disassemble the result
@@ -429,8 +430,8 @@ bool debug_view_disasm::recompute(offs_t pc, int startline, int lines)
}
// update opcode base information
- m_last_direct_decrypted = source.m_space.direct().decrypted();
- m_last_direct_raw = source.m_space.direct().raw();
+ m_last_direct_decrypted = source.m_decrypted_space.direct().ptr();
+ m_last_direct_raw = source.m_space.direct().ptr();
m_last_change_count = source.m_device.debug()->comment_change_count();
// no longer need to recompute
@@ -478,7 +479,7 @@ void debug_view_disasm::view_update()
}
// if the opcode base has changed, rework things
- if (source.m_space.direct().decrypted() != m_last_direct_decrypted || source.m_space.direct().raw() != m_last_direct_raw)
+ if (source.m_decrypted_space.direct().ptr() != m_last_direct_decrypted || source.m_space.direct().ptr() != m_last_direct_raw)
m_recompute = true;
// if the comments have changed, redo it
diff --git a/src/emu/debug/dvdisasm.h b/src/emu/debug/dvdisasm.h
index 6f1c911aaeb..202ffbe4d8c 100644
--- a/src/emu/debug/dvdisasm.h
+++ b/src/emu/debug/dvdisasm.h
@@ -51,6 +51,7 @@ private:
device_t & m_device; // underlying device
device_disasm_interface *m_disasmintf; // disassembly interface
address_space & m_space; // address space to display
+ address_space & m_decrypted_space; // address space to display for decrypted opcodes
};
diff --git a/src/emu/devcpu.h b/src/emu/devcpu.h
index eff1a8e8d6f..20cf21f25f0 100644
--- a/src/emu/devcpu.h
+++ b/src/emu/devcpu.h
@@ -68,6 +68,7 @@ enum
#define MCFG_CPU_PROGRAM_MAP MCFG_DEVICE_PROGRAM_MAP
#define MCFG_CPU_DATA_MAP MCFG_DEVICE_DATA_MAP
#define MCFG_CPU_IO_MAP MCFG_DEVICE_IO_MAP
+#define MCFG_CPU_DECRYPTED_OPCODES_MAP MCFG_DEVICE_DECRYPTED_OPCODES_MAP
#define MCFG_CPU_VBLANK_INT_DRIVER MCFG_DEVICE_VBLANK_INT_DRIVER
#define MCFG_CPU_PERIODIC_INT_DRIVER MCFG_DEVICE_PERIODIC_INT_DRIVER
diff --git a/src/emu/devdelegate.h b/src/emu/devdelegate.h
index 2ce6cc9a0fa..ba1b82ab8ee 100644
--- a/src/emu/devdelegate.h
+++ b/src/emu/devdelegate.h
@@ -54,17 +54,21 @@ public:
device_delegate(const basetype &src) : basetype(src), device_delegate_helper(src.m_device_name) { }
device_delegate(const basetype &src, delegate_late_bind &object) : basetype(src, object), device_delegate_helper(src.m_device_name) { }
template<class _FunctionClass> device_delegate(typename basetype::template traits<_FunctionClass>::member_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object), device_delegate_helper(safe_tag(dynamic_cast<device_t *>(object))) { }
+#ifdef USE_STATIC_DELEGATE
template<class _FunctionClass> device_delegate(typename basetype::template traits<_FunctionClass>::static_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object), device_delegate_helper(safe_tag(dynamic_cast<device_t *>(object))) { }
template<class _FunctionClass> device_delegate(typename basetype::template traits<_FunctionClass>::static_ref_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object), device_delegate_helper(safe_tag(dynamic_cast<device_t *>(object))) { }
+#endif
device_delegate &operator=(const thistype &src) { *static_cast<basetype *>(this) = src; m_device_name = src.m_device_name; return *this; }
// provide additional constructors that take a device name string
template<class _FunctionClass> device_delegate(typename basetype::template traits<_FunctionClass>::member_func_type funcptr, const char *name, const char *devname) : basetype(funcptr, name, (_FunctionClass *)0), device_delegate_helper(devname) { }
template<class _FunctionClass> device_delegate(typename basetype::template traits<_FunctionClass>::member_func_type funcptr, const char *name, const char *devname, _FunctionClass *object) : basetype(funcptr, name, (_FunctionClass *)0), device_delegate_helper(devname) { }
+#ifdef USE_STATIC_DELEGATE
template<class _FunctionClass> device_delegate(typename basetype::template traits<_FunctionClass>::static_func_type funcptr, const char *name, const char *devname, _FunctionClass *object) : basetype(funcptr, name, (_FunctionClass *)0), device_delegate_helper(devname) { }
template<class _FunctionClass> device_delegate(typename basetype::template traits<_FunctionClass>::static_ref_func_type funcptr, const char *name, const char *devname, _FunctionClass *object) : basetype(funcptr, name, (_FunctionClass *)0), device_delegate_helper(devname) { }
device_delegate(typename basetype::template traits<device_t>::static_func_type funcptr, const char *name) : basetype(funcptr, name, (device_t *)0), device_delegate_helper(NULL) { }
device_delegate(typename basetype::template traits<device_t>::static_ref_func_type funcptr, const char *name) : basetype(funcptr, name, (device_t *)0), device_delegate_helper(NULL) { }
+#endif
// and constructors that provide a search root
device_delegate(const thistype &src, device_t &search_root) : basetype(src), device_delegate_helper(src.m_device_name) { bind_relative_to(search_root); }
diff --git a/src/emu/dimemory.c b/src/emu/dimemory.c
index 1b10dd709b5..c10584817cb 100644
--- a/src/emu/dimemory.c
+++ b/src/emu/dimemory.c
@@ -49,6 +49,15 @@ address_space_config::address_space_config()
{
}
+/*!
+ @param name
+ @param endian CPU endianness
+ @param datawidth CPU parallelism bits
+ @param addrwidth address bits
+ @param addrshift
+ @param internal
+ @param defmap
+ */
address_space_config::address_space_config(const char *name, endianness_t endian, UINT8 datawidth, UINT8 addrwidth, INT8 addrshift, address_map_constructor internal, address_map_constructor defmap)
: m_name(name),
m_endianness(endian),
diff --git a/src/emu/dimemory.h b/src/emu/dimemory.h
index 330dfb806e3..5255aadb3da 100644
--- a/src/emu/dimemory.h
+++ b/src/emu/dimemory.h
@@ -46,6 +46,9 @@ const int TRANSLATE_FETCH_DEBUG = (TRANSLATE_FETCH | TRANSLATE_DEBUG_MASK);
#define MCFG_DEVICE_ADDRESS_MAP(_space, _map) \
device_memory_interface::static_set_addrmap(*device, _space, ADDRESS_MAP_NAME(_map));
+#define MCFG_DEVICE_REMOVE_ADDRESS_MAP(_space) \
+ device_memory_interface::static_set_addrmap(*device, _space, NULL);
+
#define MCFG_DEVICE_PROGRAM_MAP(_map) \
MCFG_DEVICE_ADDRESS_MAP(AS_PROGRAM, _map)
@@ -55,6 +58,9 @@ const int TRANSLATE_FETCH_DEBUG = (TRANSLATE_FETCH | TRANSLATE_DEBUG_MASK);
#define MCFG_DEVICE_IO_MAP(_map) \
MCFG_DEVICE_ADDRESS_MAP(AS_IO, _map)
+#define MCFG_DEVICE_DECRYPTED_OPCODES_MAP(_map) \
+ MCFG_DEVICE_ADDRESS_MAP(AS_DECRYPTED_OPCODES, _map)
+
//**************************************************************************
@@ -82,6 +88,8 @@ public:
// basic information getters
bool has_space(int index = 0) const { return (m_addrspace[index] != NULL); }
bool has_space(address_spacenum index) const { return (m_addrspace[int(index)] != NULL); }
+ bool has_configured_map(int index = 0) const { return (m_address_map[index] != NULL); }
+ bool has_configured_map(address_spacenum index) const { return (m_address_map[int(index)] != NULL); }
address_space &space(int index = 0) const { assert(m_addrspace[index] != NULL); return *m_addrspace[index]; }
address_space &space(address_spacenum index) const { assert(m_addrspace[int(index)] != NULL); return *m_addrspace[int(index)]; }
diff --git a/src/emu/drivers/testcpu.c b/src/emu/drivers/testcpu.c
index f5fdaa7dd93..b76bbe23d06 100644
--- a/src/emu/drivers/testcpu.c
+++ b/src/emu/drivers/testcpu.c
@@ -151,14 +151,14 @@ public:
{
UINT64 fulloffs = offset;
UINT64 result = fulloffs + (fulloffs << 8) + (fulloffs << 16) + (fulloffs << 24) + (fulloffs << 32);
- printf("Read from %08X & %016" I64FMT "X = %016" I64FMT "X\n", offset * 8, mem_mask, result);
+ printf("Read from %08X & %08X%08X = %08X%08X\n", offset * 8, (int)((mem_mask&0xffffffff00000000LL) >> 32) , (int)(mem_mask&0xffffffff), (int)((result&0xffffffff00000000LL) >> 32), (int)(result&0xffffffff));
return result;
}
// report writes to anywhere
WRITE64_MEMBER( general_w )
{
- printf("Write to %08X & %016" I64FMT "X = %016" I64FMT "X\n", offset * 8, mem_mask, data);
+ printf("Write to %08X & %08X%08X = %08X%08X\n", offset * 8, (int)((mem_mask&0xffffffff00000000LL) >> 32) , (int)(mem_mask&0xffffffff), (int)((data&0xffffffff00000000LL) >> 32), (int)(data&0xffffffff));
}
private:
diff --git a/src/emu/drivers/xtal.h b/src/emu/drivers/xtal.h
index 89a048f6316..0c9f2061326 100644
--- a/src/emu/drivers/xtal.h
+++ b/src/emu/drivers/xtal.h
@@ -52,6 +52,7 @@ enum
XTAL_1_9968MHz = 1996800, /* NEC PC-98xx */
XTAL_2MHz = 2000000,
XTAL_2_01216MHz = 2012160, /* Cidelsa Draco sound board */
+ XTAL_2_097152MHz = 2097152, /* Icatel 1995 - Brazilian public payphone */
XTAL_2_4576MHz = 2457600, /* Atari ST MFP, NEC PC-98xx */
XTAL_2_5MHz = 2500000, /* Janken Man units */
XTAL_3MHz = 3000000, /* Probably only used to drive 68705 or similar MCUs on 80's Taito PCBs */
diff --git a/src/emu/emuopts.c b/src/emu/emuopts.c
index c537ce6dc4e..c7df63d76d1 100644
--- a/src/emu/emuopts.c
+++ b/src/emu/emuopts.c
@@ -160,6 +160,13 @@ const options_entry emu_options::s_option_entries[] =
{ OPTION_UPDATEINPAUSE, "0", OPTION_BOOLEAN, "keep calling video updates while in pause" },
{ OPTION_DEBUGSCRIPT, NULL, OPTION_STRING, "script for debugger" },
+ // comm options
+ { NULL, NULL, OPTION_HEADER, "CORE COMM OPTIONS" },
+ { OPTION_COMM_LOCAL_HOST, "0.0.0.0", OPTION_STRING, "local address to bind to" },
+ { OPTION_COMM_LOCAL_PORT, "15112", OPTION_STRING, "local port to bind to" },
+ { OPTION_COMM_REMOTE_HOST, "127.0.0.1", OPTION_STRING, "remote address to connect to" },
+ { OPTION_COMM_REMOTE_PORT, "15112", OPTION_STRING, "remote port to connect to" },
+
// misc options
{ NULL, NULL, OPTION_HEADER, "CORE MISC OPTIONS" },
{ OPTION_DRC, "1", OPTION_BOOLEAN, "enable DRC cpu core if available" },
diff --git a/src/emu/emuopts.h b/src/emu/emuopts.h
index ac2f18ac767..855e8eb19af 100644
--- a/src/emu/emuopts.h
+++ b/src/emu/emuopts.h
@@ -174,6 +174,12 @@ enum
#define OPTION_UI_FONT "uifont"
#define OPTION_RAMSIZE "ramsize"
+// core comm options
+#define OPTION_COMM_LOCAL_HOST "comm_localhost"
+#define OPTION_COMM_LOCAL_PORT "comm_localport"
+#define OPTION_COMM_REMOTE_HOST "comm_remotehost"
+#define OPTION_COMM_REMOTE_PORT "comm_remoteport"
+
#define OPTION_CONFIRM_QUIT "confirm_quit"
#define OPTION_UI_MOUSE "ui_mouse"
@@ -343,6 +349,12 @@ public:
const char *ui_font() const { return value(OPTION_UI_FONT); }
const char *ram_size() const { return value(OPTION_RAMSIZE); }
+ // core comm options
+ const char *comm_localhost() const { return value(OPTION_COMM_LOCAL_HOST); }
+ const char *comm_localport() const { return value(OPTION_COMM_LOCAL_PORT); }
+ const char *comm_remotehost() const { return value(OPTION_COMM_REMOTE_HOST); }
+ const char *comm_remoteport() const { return value(OPTION_COMM_REMOTE_PORT); }
+
bool confirm_quit() const { return bool_value(OPTION_CONFIRM_QUIT); }
bool ui_mouse() const { return bool_value(OPTION_UI_MOUSE); }
diff --git a/src/emu/imagedev/floppy.c b/src/emu/imagedev/floppy.c
index 3f704959d9f..8fea5c24566 100644
--- a/src/emu/imagedev/floppy.c
+++ b/src/emu/imagedev/floppy.c
@@ -18,7 +18,7 @@
*/
// Show step operation
-#define TRACE_STEP 1
+#define TRACE_STEP 0
// device type definition
const device_type FLOPPY_CONNECTOR = &device_creator<floppy_connector>;
@@ -661,6 +661,22 @@ UINT32 floppy_image_device::find_position(attotime &base, const attotime &when)
return (delta*floppy_ratio_1).as_ticks(1000000000/1000);
}
+attotime floppy_image_device::get_next_index_time(std::vector<UINT32> &buf, int index, int delta, attotime base)
+{
+ UINT32 next_position;
+ int cells = buf.size();
+ if(index+delta < cells)
+ next_position = buf[index+delta] & floppy_image::TIME_MASK;
+ else {
+ if((buf[cells-1]^buf[0]) & floppy_image::MG_MASK)
+ delta--;
+ index = index + delta - cells + 1;
+ next_position = 200000000 + (buf[index] & floppy_image::TIME_MASK);
+ }
+
+ return base + attotime::from_nsec((UINT64(next_position)*2000/floppy_ratio_1+1)/2);
+}
+
attotime floppy_image_device::get_next_transition(const attotime &from_when)
{
if(!image || mon)
@@ -679,15 +695,10 @@ attotime floppy_image_device::get_next_transition(const attotime &from_when)
if(index == -1)
return attotime::never;
- UINT32 next_position;
- if(index < cells-1)
- next_position = buf[index+1] & floppy_image::TIME_MASK;
- else if((buf[index]^buf[0]) & floppy_image::MG_MASK)
- next_position = 200000000;
- else
- next_position = 200000000 + (buf[1] & floppy_image::TIME_MASK);
-
- return base + attotime::from_nsec((UINT64(next_position)*2000/floppy_ratio_1+1)/2);
+ attotime result = get_next_index_time(buf, index, 1, base);
+ if(result > from_when)
+ return result;
+ return get_next_index_time(buf, index, 2, base);
}
void floppy_image_device::write_flux(const attotime &start, const attotime &end, int transition_count, const attotime *transitions)
diff --git a/src/emu/imagedev/floppy.h b/src/emu/imagedev/floppy.h
index 98834facc65..5b230ae9e49 100644
--- a/src/emu/imagedev/floppy.h
+++ b/src/emu/imagedev/floppy.h
@@ -27,7 +27,7 @@
static_cast<floppy_connector *>(device)->set_formats(_formats);
#define DECLARE_FLOPPY_FORMATS(_name) \
- static const floppy_format_type _name [];
+ static const floppy_format_type _name []
#define FLOPPY_FORMATS_MEMBER(_member) \
const floppy_format_type _member [] = {
@@ -186,6 +186,7 @@ protected:
int find_index(UINT32 position, const std::vector<UINT32> &buf);
void write_zone(UINT32 *buf, int &cells, int &index, UINT32 spos, UINT32 epos, UINT32 mg);
void commit_image();
+ attotime get_next_index_time(std::vector<UINT32> &buf, int index, int delta, attotime base);
};
class ui_menu_control_floppy_image : public ui_menu_control_device_image {
diff --git a/src/emu/imagedev/harddriv.c b/src/emu/imagedev/harddriv.c
index 3134506e61b..bc39d53e4b3 100644
--- a/src/emu/imagedev/harddriv.c
+++ b/src/emu/imagedev/harddriv.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Nathan Woods, Raphael Nabet, Miodrag Milanovic
/*********************************************************************
diff --git a/src/emu/imagedev/harddriv.h b/src/emu/imagedev/harddriv.h
index c80044478b2..f72dc0553f1 100644
--- a/src/emu/imagedev/harddriv.h
+++ b/src/emu/imagedev/harddriv.h
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Nathan Woods, Raphael Nabet, Miodrag Milanovic
/*********************************************************************
diff --git a/src/emu/info.c b/src/emu/info.c
index 4b5adfab3b1..d87cc529bb0 100644
--- a/src/emu/info.c
+++ b/src/emu/info.c
@@ -374,6 +374,12 @@ void info_xml_creator::output_one_device(device_t &device, const char *devtag)
// output_devices - print the XML info for devices
// with roms and for devices that can be mounted
// in slots
+// The current solution works to some extent, but
+// it is limited by the fact that devices are only
+// acknowledged when attached to a driver (so that
+// for instance sub-sub-devices could never appear
+// in the xml input if they are not also attached
+// directly to a driver as device or sub-device)
//-------------------------------------------------
typedef tagmap_t<FPTR> slot_map;
@@ -415,6 +421,17 @@ void info_xml_creator::output_devices()
if (shortnames.add(dev->shortname(), 0, FALSE) != TMERR_DUPLICATE)
output_one_device(*dev, temptag.c_str());
+ // also, check for subdevices with ROMs (a few devices are missed otherwise, e.g. MPU401)
+ device_iterator deviter2(*dev);
+ for (device_t *device = deviter2.first(); device != NULL; device = deviter2.next())
+ {
+ if (device->owner() == dev && device->shortname()!= NULL && strlen(device->shortname())!=0)
+ {
+ if (shortnames.add(device->shortname(), 0, FALSE) != TMERR_DUPLICATE)
+ output_one_device(*device, device->tag());
+ }
+ }
+
const_cast<machine_config &>(m_drivlist.config()).device_remove(&m_drivlist.config().root_device(), temptag.c_str());
}
}
diff --git a/src/emu/ioport.c b/src/emu/ioport.c
index e13d4e0d2e4..b085104b9b5 100644
--- a/src/emu/ioport.c
+++ b/src/emu/ioport.c
@@ -1102,7 +1102,7 @@ void natural_keyboard::build_codes(ioport_manager &manager)
if (LOG_NATURAL_KEYBOARD)
{
std::string tempstr;
- logerror("natural_keyboard: code=%i (%s) port=%p field->name='%s'\n", int(code), unicode_to_string(tempstr, code), port, field->name());
+ logerror("natural_keyboard: code=%i (%s) port=%p field->name='%s'\n", int(code), unicode_to_string(tempstr, code), (void *)port, field->name());
}
}
}
diff --git a/src/emu/ioport.h b/src/emu/ioport.h
index e04b5a02b84..4839fe34272 100644
--- a/src/emu/ioport.h
+++ b/src/emu/ioport.h
@@ -1646,7 +1646,7 @@ ATTR_COLD void INPUT_PORTS_NAME(_name)(device_t &owner, ioport_list &portlist, s
configurer.field_set_unused();
// analog settings
-// if this macro is not used, the minimum defaluts to 0 and maximum defaults to the mask value
+// if this macro is not used, the minimum defaults to 0 and maximum defaults to the mask value
#define PORT_MINMAX(_min, _max) \
configurer.field_set_min_max(_min, _max);
diff --git a/src/emu/machine/53c7xx.h b/src/emu/machine/53c7xx.h
index 877a0d5293c..937bd9d16a0 100644
--- a/src/emu/machine/53c7xx.h
+++ b/src/emu/machine/53c7xx.h
@@ -98,14 +98,14 @@ private:
{
STATE_MASK = 0x00ff,
SUB_SHIFT = 8,
- SUB_MASK = 0xff00,
+ SUB_MASK = 0xff00
};
enum
{
MODE_I,
MODE_T,
- MODE_D,
+ MODE_D
};
enum scsi_state
@@ -131,7 +131,7 @@ private:
SEND_WAIT_SETTLE,
RECV_WAIT_SETTLE,
RECV_WAIT_REQ_0,
- RECV_WAIT_REQ_1,
+ RECV_WAIT_REQ_1
};
void update_irqs();
@@ -148,7 +148,7 @@ private:
SCRIPTS_IDLE,
SCRIPTS_WAIT_MANUAL_START,
SCRIPTS_FETCH,
- SCRIPTS_EXECUTE,
+ SCRIPTS_EXECUTE
};
void set_scripts_state(scripts_state state);
diff --git a/src/emu/machine/64h156.c b/src/emu/machine/64h156.c
index e0d509cb8c0..508034169dd 100644
--- a/src/emu/machine/64h156.c
+++ b/src/emu/machine/64h156.c
@@ -336,7 +336,7 @@ void c64h156_device::live_run(const attotime &limit)
// update signals
if (byte != cur_live.byte) {
if (!byte || !cur_live.accl) {
- if (LOG) logerror("%s BYTE %u\n", cur_live.tm.as_string(),byte);
+ if (LOG) logerror("%s BYTE %02x\n", cur_live.tm.as_string(), cur_live.shift_reg & 0xff);
cur_live.byte = byte;
syncpoint = true;
}
diff --git a/src/emu/machine/6532riot.c b/src/emu/machine/6532riot.c
index b419cf8999d..98bb8c2dacc 100644
--- a/src/emu/machine/6532riot.c
+++ b/src/emu/machine/6532riot.c
@@ -114,17 +114,6 @@ UINT8 riot6532_device::get_timer()
-/*-------------------------------------------------
- timer_end_callback - callback to process the
- timer
--------------------------------------------------*/
-
-TIMER_CALLBACK( riot6532_device::timer_end_callback )
-{
- riot6532_device *via = reinterpret_cast<riot6532_device *>(ptr);
- via->timer_end();
-}
-
void riot6532_device::timer_end()
{
assert(m_timerstate != TIMER_IDLE);
@@ -429,7 +418,7 @@ void riot6532_device::device_start()
m_irq_cb.resolve_safe();
/* allocate timers */
- m_timer = machine().scheduler().timer_alloc(FUNC(timer_end_callback), (void *)this);
+ m_timer = timer_alloc(TIMER_END_CB);
/* register for save states */
save_item(NAME(m_port[0].m_in));
@@ -480,3 +469,15 @@ void riot6532_device::device_reset()
m_timerstate = TIMER_COUNTING;
m_timer->adjust(attotime::from_ticks(256 << m_timershift, clock()));
}
+
+void riot6532_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
+{
+ switch (id)
+ {
+ case TIMER_END_CB:
+ timer_end();
+ break;
+ default:
+ assert_always(FALSE, "Unknown id in riot6532_device::device_timer");
+ }
+}
diff --git a/src/emu/machine/6532riot.h b/src/emu/machine/6532riot.h
index d23734228c6..2825f31dc9d 100644
--- a/src/emu/machine/6532riot.h
+++ b/src/emu/machine/6532riot.h
@@ -84,10 +84,10 @@ protected:
// device-level overrides
virtual void device_start();
virtual void device_reset();
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
virtual void device_post_load() { }
virtual void device_clock_changed() { }
- static TIMER_CALLBACK( timer_end_callback );
private:
void update_irqstate();
@@ -113,6 +113,11 @@ private:
UINT8 m_timershift;
UINT8 m_timerstate;
emu_timer * m_timer;
+
+ enum
+ {
+ TIMER_END_CB
+ };
};
diff --git a/src/emu/machine/6821pia.c b/src/emu/machine/6821pia.c
index 93c6244f144..3fbf6477fa9 100644
--- a/src/emu/machine/6821pia.c
+++ b/src/emu/machine/6821pia.c
@@ -14,7 +14,7 @@
// MACROS
//**************************************************************************
-#define VERBOSE 0
+#define VERBOSE 1
#define LOG(x) do { if (VERBOSE) logerror x; } while (0)
diff --git a/src/emu/machine/68307.c b/src/emu/machine/68307.c
index 08116ca0e18..320c701acc7 100644
--- a/src/emu/machine/68307.c
+++ b/src/emu/machine/68307.c
@@ -114,7 +114,7 @@ int m68307_calc_cs(m68307cpu_device *m68k, offs_t address)
UINT16 m68307cpu_device::simple_read_immediate_16_m68307(offs_t address)
{
// m68307_currentcs = m68307_calc_cs(this, address);
- return m_direct->read_decrypted_word(address);
+ return m_direct->read_word(address);
}
UINT8 m68307cpu_device::read_byte_m68307(offs_t address)
diff --git a/src/emu/machine/6840ptm.c b/src/emu/machine/6840ptm.c
index 410758b9eaf..239498f681c 100644
--- a/src/emu/machine/6840ptm.c
+++ b/src/emu/machine/6840ptm.c
@@ -407,7 +407,7 @@ void ptm6840_device::reload_count(int idx)
duration *= m_t3_divisor;
}
- PLOG(("MC6840 #%s: reload_count(%d): output = %lf\n", tag(), idx, duration.as_double()));
+ PLOG(("MC6840 #%s: reload_count(%d): output = %f\n", tag(), idx, duration.as_double()));
#if 0
if (!(m_control_reg[idx] & 0x02))
diff --git a/src/emu/machine/6840ptm.h b/src/emu/machine/6840ptm.h
index d78ff6eb1cb..d00577d62d0 100644
--- a/src/emu/machine/6840ptm.h
+++ b/src/emu/machine/6840ptm.h
@@ -105,7 +105,7 @@ private:
PTM_6840_MSBBUF2 = 4,
PTM_6840_LSB2 = 5,
PTM_6840_MSBBUF3 = 6,
- PTM_6840_LSB3 = 7,
+ PTM_6840_LSB3 = 7
};
double m_internal_clock;
diff --git a/src/emu/machine/6850acia.c b/src/emu/machine/6850acia.c
index 6058588a54d..7c1fcc85178 100644
--- a/src/emu/machine/6850acia.c
+++ b/src/emu/machine/6850acia.c
@@ -258,7 +258,7 @@ WRITE8_MEMBER( acia6850_device::data_w )
/// TODO: find out if data stored during master reset is sent after divider is set
if (m_divide == 0)
{
- logerror("%s:ACIA %p: Data write while in reset!\n", machine().describe_context(), this);
+ logerror("%s:ACIA %p: Data write while in reset!\n", machine().describe_context(), (void *)this);
}
/// TODO: find out what happens if TDRE is already clear when you write
diff --git a/src/emu/machine/6850acia.h b/src/emu/machine/6850acia.h
index 21ac5b4857e..8bb1a3891bd 100644
--- a/src/emu/machine/6850acia.h
+++ b/src/emu/machine/6850acia.h
@@ -91,7 +91,7 @@ private:
{
DCD_IRQ_NONE = 0,
DCD_IRQ_READ_DATA,
- DCD_IRQ_READ_STATUS,
+ DCD_IRQ_READ_STATUS
};
devcb_write_line m_txd_handler;
diff --git a/src/emu/machine/68561mpcc.c b/src/emu/machine/68561mpcc.c
index c894f4c96ba..1b8a8895fed 100644
--- a/src/emu/machine/68561mpcc.c
+++ b/src/emu/machine/68561mpcc.c
@@ -23,8 +23,6 @@ const device_type MPCC68561 = &device_creator<mpcc68561_t>;
#define LOG_MPCC (1)
-#if 0 // future
-
/***************************************************************************
IMPLEMENTATION
***************************************************************************/
@@ -481,7 +479,3 @@ WRITE8_MEMBER( mpcc68561_t::reg_w )
break;
}
}
-
-#else
-
-#endif
diff --git a/src/emu/machine/68561mpcc.h b/src/emu/machine/68561mpcc.h
index eab113ba9f5..df036282f1c 100644
--- a/src/emu/machine/68561mpcc.h
+++ b/src/emu/machine/68561mpcc.h
@@ -28,7 +28,7 @@ public:
IRQ_A_TX,
IRQ_B_TX,
IRQ_A_EXT,
- IRQ_B_EXT,
+ IRQ_B_EXT
};
mpcc68561_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
@@ -81,7 +81,7 @@ private:
int lastIRQStat;
IRQType_t IRQType;
- Chan channel[1];
+ Chan channel[2];
devcb_write_line intrq_cb;
diff --git a/src/emu/machine/8530scc.h b/src/emu/machine/8530scc.h
index 0a42bfd3405..af4cef88e1e 100644
--- a/src/emu/machine/8530scc.h
+++ b/src/emu/machine/8530scc.h
@@ -26,7 +26,7 @@ public:
IRQ_A_TX,
IRQ_B_TX,
IRQ_A_EXT,
- IRQ_B_EXT,
+ IRQ_B_EXT
};
scc8530_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
diff --git a/src/emu/machine/at29040a.c b/src/emu/machine/at29040a.c
index 31be262b7c1..3285b265792 100644
--- a/src/emu/machine/at29040a.c
+++ b/src/emu/machine/at29040a.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Raphael Nabet, Michael Zapf
/*
Atmel at29c040a flash EEPROM
diff --git a/src/emu/machine/at29040a.h b/src/emu/machine/at29040a.h
index 0dc6473edff..1af258fb719 100644
--- a/src/emu/machine/at29040a.h
+++ b/src/emu/machine/at29040a.h
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Raphael Nabet, Michael Zapf
/*
ATMEL 29040a
diff --git a/src/emu/machine/corvushd.c b/src/emu/machine/corvushd.c
index 659945da93d..0444d3cb530 100644
--- a/src/emu/machine/corvushd.c
+++ b/src/emu/machine/corvushd.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Brett Wyer, Raphael Nabet
//
// corvus_hd
diff --git a/src/emu/machine/corvushd.h b/src/emu/machine/corvushd.h
index 324fef4f1bf..bc83fa2585d 100644
--- a/src/emu/machine/corvushd.h
+++ b/src/emu/machine/corvushd.h
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Brett Wyer, Raphael Nabet
/*****************************************************************************
*
diff --git a/src/emu/machine/eeprompar.c b/src/emu/machine/eeprompar.c
index 1e70085a6e6..af575ec1419 100644
--- a/src/emu/machine/eeprompar.c
+++ b/src/emu/machine/eeprompar.c
@@ -120,7 +120,7 @@ eeprom_parallel_##_lowercase##_device::eeprom_parallel_##_lowercase##_device(con
: eeprom_parallel_##_baseclass##_device(mconfig, EEPROM_PARALLEL_##_uppercase, "Parallel EEPROM " #_uppercase " (" #_cells "x" #_bits ")", tag, owner, #_lowercase, __FILE__) \
{ \
static_set_size(*this, _cells, _bits); \
-}; \
+} \
const device_type EEPROM_PARALLEL_##_uppercase = &device_creator<eeprom_parallel_##_lowercase##_device>;
// standard 28XX class of 8-bit EEPROMs
DEFINE_PARALLEL_EEPROM_DEVICE(28xx, 2804, 2804, 8, 512)
diff --git a/src/emu/machine/eepromser.c b/src/emu/machine/eepromser.c
index 3b1f05bdc94..347accae06f 100644
--- a/src/emu/machine/eepromser.c
+++ b/src/emu/machine/eepromser.c
@@ -1132,7 +1132,7 @@ eeprom_serial_##_lowercase##_##_bits##bit_device::eeprom_serial_##_lowercase##_#
{ \
static_set_size(*this, _cells, _bits); \
static_set_address_bits(*this, _addrbits); \
-}; \
+} \
const device_type EEPROM_SERIAL_##_uppercase##_##_bits##BIT = &device_creator<eeprom_serial_##_lowercase##_##_bits##bit_device>;
// standard 93CX6 class of 16-bit EEPROMs
DEFINE_SERIAL_EEPROM_DEVICE(93cxx, 93c06, 93C06, 16, 16, 6)
diff --git a/src/emu/machine/hd64610.c b/src/emu/machine/hd64610.c
index c56775e486f..d4639892e17 100644
--- a/src/emu/machine/hd64610.c
+++ b/src/emu/machine/hd64610.c
@@ -46,7 +46,7 @@ enum
REG_DAY_OF_THE_WEEK_ALARM,
REG_DAY_ALARM,
REG_CRA,
- REG_CRB,
+ REG_CRB
};
diff --git a/src/emu/machine/hdc9234.c b/src/emu/machine/hdc9234.c
index c77783e463c..4247f17aa51 100644
--- a/src/emu/machine/hdc9234.c
+++ b/src/emu/machine/hdc9234.c
@@ -16,45 +16,48 @@
The HDC9234 controller is also referred to as the "Universal Disk Controller" (UDC)
by the data book
- Michael Zapf, September 2014
+ Michael Zapf, July 2015
***************************************************************************/
#include "emu.h"
#include "hdc9234.h"
+#include "formats/imageutl.h"
// Per-command debugging
-#define TRACE_SELECT 1
-#define TRACE_STEP 1
-#define TRACE_RESTORE 1
-#define TRACE_SUBSTATES 1
-#define TRACE_READ 1
-#define TRACE_WRITE 1
-#define TRACE_READREG 1
-#define TRACE_SETREG 1
-#define TRACE_SETPTR 1
-#define TRACE_FORMAT 1
-#define TRACE_READTRACK 1
+#define TRACE_SELECT 0
+#define TRACE_STEP 0
+#define TRACE_RESTORE 0
+#define TRACE_SUBSTATES 0
+#define TRACE_READ 0
+#define TRACE_WRITE 0
+#define TRACE_READREG 0
+#define TRACE_SETREG 0
+#define TRACE_SETPTR 0
+#define TRACE_FORMAT 0
+#define TRACE_READTRACK 0
// Common states
-#define TRACE_READID 1
-#define TRACE_VERIFY 1
-#define TRACE_TRANSFER 1
+#define TRACE_READID 0
+#define TRACE_VERIFY 0
+#define TRACE_TRANSFER 0
// Live states debugging
-#define TRACE_LIVE 1
-#define TRACE_SHIFT 1
-#define TRACE_SYNC 1
+#define TRACE_LIVE 0
+#define TRACE_SHIFT 0
+#define TRACE_SYNC 0
// Misc debugging
#define TRACE_DELAY 0
-#define TRACE_INT 1
-#define TRACE_LINES 1
-#define TRACE_INDEX 1
-#define TRACE_DMA 1
-#define TRACE_DONE 1
+#define TRACE_INT 0
+#define TRACE_LINES 0
+#define TRACE_INDEX 0
+#define TRACE_DMA 0
+#define TRACE_DONE 0
#define TRACE_FAIL 1
-#define TRACE_AUXBUS 1
+#define TRACE_AUXBUS 0
+#define TRACE_HEADER 0
+#define TRACE_GAPS 0
#define TRACE_DETAIL 0
@@ -65,17 +68,17 @@
ECC
Write long (see MODE register; only useful with ECC)
Tape operations
- Hard disk operation
+ AT mode (HD)
+ FM-encoded HD
=== Implemented but untested ===
- Burst mode
Restore
Poll drives
Seek/Read ID
- Multi-sector read/write
- Usage of seek complete
- Read/write sectors physical
Read track
+
+ === TODO ===
+ Create a common state machine for HD and floppy
*/
/*
@@ -304,7 +307,7 @@ enum
STEP_ON,
STEP_OFF,
RESTORE_CHECK,
- WAIT_SEEK_COMPLETE,
+ WAIT_SEEK_COMPLETE, // 0x08
SEEK_COMPLETE,
HEAD_DELAY,
WAITINDEX0,
@@ -312,7 +315,7 @@ enum
TRACKSTART,
TRACKDONE,
POLL1,
- POLL2,
+ POLL2, // 0x10
POLL3,
READ_ID = 0x40,
@@ -334,17 +337,20 @@ enum
LIVE_STATES = 0x80,
SEARCH_IDAM,
SEARCH_IDAM_FAILED,
+ VERIFY_FAILED,
READ_TWO_MORE_A1_IDAM,
+ READ_IDENT,
READ_ID_FIELDS_INTO_REGS,
SEARCH_DAM,
- READ_TWO_MORE_A1_DAM,
+ READ_TWO_MORE_A1_DAM, // 0x88
+ READ_DATADEL_FLAG,
SEARCH_DAM_FAILED,
READ_SECTOR_DATA,
- READ_SECTOR_DATA1,
+ READ_SECTOR_DATA_CONT,
WRITE_DAM_AND_SECTOR,
WRITE_SEC_SKIP_GAP2,
WRITE_SEC_SKIP_GAP2_LOOP,
- WRITE_SEC_BYTE,
+ WRITE_SEC_BYTE, // 0x90
WRITE_SEC_NEXT_BYTE,
WRITE_TRACK_BYTE,
@@ -355,7 +361,7 @@ enum
FORMAT_TRACK,
WRITE_GAP0,
- WRITE_GAP1,
+ WRITE_GAP1, // 0x98
WRITE_GAP2,
WRITE_GAP3,
WRITE_GAP4,
@@ -363,7 +369,7 @@ enum
WRITE_IXAM,
WRITE_FC,
WRITE_IDAM_SYNC,
- WRITE_IDAM,
+ WRITE_IDAM, // 0xa0
WRITE_HEADER,
WRITE_IDENT,
@@ -372,7 +378,7 @@ enum
WRITE_DATAMARK,
WRITE_SECDATA,
WRITE_DATA_CRC,
- WRITE_DONE,
+ WRITE_DONE, // 0xa8
WRITE_HEADER_CRC,
READ_TRACK,
@@ -464,8 +470,47 @@ bool hdc9234_device::on_track00()
}
/*
+ Seek completed?
+*/
+bool hdc9234_device::seek_complete()
+{
+ return (m_register_r[DRIVE_STATUS] & HDC_DS_SKCOM)!=0;
+}
+
+/*
+ Index hole?
+*/
+bool hdc9234_device::index_hole()
+{
+ return (m_register_r[DRIVE_STATUS] & HDC_DS_INDEX)!=0;
+}
+
+/*
+ Drive ready?
+*/
+bool hdc9234_device::drive_ready()
+{
+ return (m_register_r[DRIVE_STATUS] & HDC_DS_READY)!=0;
+}
+
+/*
+ Doing a track read?
+*/
+bool hdc9234_device::reading_track()
+{
+ return (current_command() & 0xfe) == 0x5a;
+}
+
+/*
Accessor functions for specific parameters.
*/
+
+/*
+ In SMC mode, the cylinder number is stored in bit positions 4,5,6 of the
+ head register and in the 8 bits of the cylinder register.
+ This is true for the desired cyl/head, current cyl/head, and the header
+ fields on the track.
+*/
int hdc9234_device::desired_head()
{
return m_register_w[DESIRED_HEAD] & 0x0f;
@@ -545,11 +590,6 @@ int hdc9234_device::pulse_width()
return time;
}
-bool hdc9234_device::rapid_steps()
-{
- return (m_register_w[MODE] & MO_STEPRATE) == 0;
-}
-
/*
Delivers the sector size
*/
@@ -582,10 +622,43 @@ void hdc9234_device::wait_time(emu_timer *tm, const attotime &delay, int param)
*/
void hdc9234_device::wait_line(int line, line_state level, int substate, bool stopwrite)
{
- m_event_line = line;
- m_line_level = level;
- m_state_after_line = substate;
- m_stopwrite = stopwrite;
+ bool line_at_level = true;
+
+ if (line == SEEKCOMP_LINE && (seek_complete() == (level==ASSERT_LINE)))
+ {
+ if (TRACE_LINES) logerror("%s: SEEK_COMPLETE line is already %d\n", tag(), level);
+ }
+ else
+ {
+ if (line == INDEX_LINE && (index_hole() == (level==ASSERT_LINE)))
+ {
+ if (TRACE_LINES) logerror("%s: INDEX line is already %d\n", tag(), level);
+ }
+ else
+ {
+ if (line == READY_LINE && (drive_ready() == (level==ASSERT_LINE)))
+ {
+ if (TRACE_LINES) logerror("%s: READY line is already %d\n", tag(), level);
+ }
+ else
+ {
+ // The line is not yet at the desired level; hence, arm the trigger.
+ m_event_line = line;
+ m_line_level = level;
+ m_state_after_line = substate;
+ m_stopwrite = stopwrite;
+ line_at_level = false;
+ }
+ }
+ }
+
+ if (line_at_level)
+ {
+ m_substate = substate;
+ m_event_line = UNDEF;
+ m_state_after_line = UNDEF;
+ reenter_command_processing();
+ }
}
// ==================================================================
@@ -635,9 +708,9 @@ void hdc9234_device::read_id(int& cont, bool implied_seek, bool wait_seek_comple
break;
}
- if (TRACE_READID && TRACE_SUBSTATES)
+ if (TRACE_READID)
{
- logerror("%s: substate READ_ID1\n", tag());
+ if (TRACE_SUBSTATES) logerror("%s: substate READ_ID1\n", tag());
logerror("%s: DESIRED_CYL = %d; CURRENT_CYL = %d\n", tag(), desired_cylinder(), current_cylinder());
}
@@ -666,6 +739,7 @@ void hdc9234_device::read_id(int& cont, bool implied_seek, bool wait_seek_comple
if (wait_seek_complete)
{
// We have to wait for SEEK COMPLETE
+ if (TRACE_READID && TRACE_SUBSTATES) logerror("%s: Waiting for SEEK COMPLETE\n", tag());
wait_line(SEEKCOMP_LINE, ASSERT_LINE, READ_ID_SEEK_COMPLETE, false);
cont = WAIT;
}
@@ -701,7 +775,7 @@ void hdc9234_device::read_id(int& cont, bool implied_seek, bool wait_seek_comple
break;
default:
- logerror("%s: unknown substate %d in read_id\n", tag(), m_substate);
+ logerror("%s: unknown substate %02x in read_id\n", tag(), m_substate);
cont = ERROR;
}
}
@@ -721,7 +795,7 @@ void hdc9234_device::read_id(int& cont, bool implied_seek, bool wait_seek_comple
contents of the DESIRED_HEAD/CYLINDER/SECTOR registers
- checks the CRC
*/
-void hdc9234_device::verify(int& cont, bool verify_all)
+void hdc9234_device::verify(int& cont)
{
cont = CONTINUE;
@@ -734,6 +808,10 @@ void hdc9234_device::verify(int& cont, bool verify_all)
// find the desired sector.
if (TRACE_VERIFY && TRACE_SUBSTATES) logerror("%s: substate VERIFY\n", tag());
+ if (TRACE_VERIFY) logerror("%s: VERIFY: Find sector CHS=(%d,%d,%d)\n", tag(),
+ desired_cylinder(),
+ desired_head(),
+ desired_sector());
// If an error occurred (no IDAM found), terminate the command
// (This test is only relevant when we did not have a seek phase before)
@@ -761,6 +839,7 @@ void hdc9234_device::verify(int& cont, bool verify_all)
desired_sector());
m_substate = DATA_TRANSFER;
cont = NEXT;
+ m_first_sector_found = true;
}
else
{
@@ -783,19 +862,16 @@ void hdc9234_device::verify(int& cont, bool verify_all)
break;
case VERIFY3:
- if ((m_register_r[CHIP_STATUS] & CS_SYNCERR) != 0)
+ if (TRACE_VERIFY) logerror("%s: Next IDAM found; total bytes read: %d\n", tag(), m_live_state.bit_count_total / 16);
+ if ((m_register_r[CHIP_STATUS] & CS_COMPERR) != 0)
{
if (TRACE_FAIL) logerror("%s: VERIFY failed to find sector CHS=(%d,%d,%d)\n", tag(), desired_cylinder(), desired_head(), desired_sector());
- // live_run has set the sync error; clear it
- set_bits(m_register_r[CHIP_STATUS], CS_SYNCERR, false);
- // and set the compare error bit instead
- set_bits(m_register_r[CHIP_STATUS], CS_COMPERR, true);
cont = ERROR;
break;
}
// Continue with the loop
- if (verify_all)
+ if (m_logical || !m_first_sector_found)
{
// this is for the logical sector reading/writing
m_substate = VERIFY1;
@@ -811,7 +887,7 @@ void hdc9234_device::verify(int& cont, bool verify_all)
break;
default:
- logerror("%s: unknown substate %d in verify\n", tag(), m_substate);
+ logerror("%s: unknown substate %02x in verify\n", tag(), m_substate);
cont = ERROR;
}
}
@@ -842,17 +918,23 @@ void hdc9234_device::data_transfer(int& cont)
switch (m_substate)
{
case DATA_TRANSFER:
- if (TRACE_TRANSFER && TRACE_SUBSTATES) logerror("%s: substate DATA_TRANSFER\n", tag());
+ if (TRACE_TRANSFER && TRACE_SUBSTATES) logerror("%s: substate DATA_TRANSFER (%s)\n", tag(), m_write? "write" : "read");
// Count from 0 again
m_live_state.bit_count_total = 0;
if (m_transfer_enabled) dma_address_out(m_register_w[DMA23_16], m_register_w[DMA15_8], m_register_w[DMA7_0]);
- if (TRACE_TRANSFER && TRACE_DETAIL) logerror("%s: %s sector CHS=(%d,%d,%d)\n", tag(), m_write? "write" : "read",
- desired_cylinder(),
- desired_head(),
- desired_sector());
+ if (TRACE_TRANSFER && TRACE_DETAIL)
+ {
+ if (m_logical)
+ logerror("%s: %s sector CHS=(%d,%d,%d)\n", tag(), m_write? "Write" : "Read",
+ desired_cylinder(),
+ desired_head(),
+ desired_sector());
+ else
+ logerror("%s: %s next sector on track\n", tag(), m_write? "Write" : "Read");
+ }
if (m_write)
{
@@ -902,7 +984,7 @@ void hdc9234_device::data_transfer(int& cont)
}
else
{
- if (TRACE_TRANSFER) logerror("%s: Sector successfully read\n", tag());
+ if (TRACE_TRANSFER) logerror("%s: Sector successfully read (count=%d)\n", tag(), m_register_w[SECTOR_COUNT]-1);
// Update the DMA registers for multi-sector operations
if (m_multi_sector)
@@ -914,8 +996,9 @@ void hdc9234_device::data_transfer(int& cont)
dma_address = (dma_address + calc_sector_size()) & 0xffffff;
m_register_w[DMA23_16] = m_register_r[DMA23_16] = (dma_address & 0xff0000) >> 16;
- m_register_w[DMA15_8] = m_register_r[DMA15_8] = (dma_address & 0x00ff00) >> 16;
- m_register_w[DMA7_0] = m_register_r[DMA7_0] = (dma_address & 0x0000ff) >> 16;
+ m_register_w[DMA15_8] = m_register_r[DMA15_8] = (dma_address & 0x00ff00) >> 8;
+ m_register_w[DMA7_0] = m_register_r[DMA7_0] = (dma_address & 0x0000ff);
+ if (TRACE_TRANSFER) logerror("%s: New DMA address = %06x\n", tag(), dma_address);
}
// Decrement the count
@@ -933,8 +1016,8 @@ void hdc9234_device::data_transfer(int& cont)
// What happens when we exceed the highest sector number
// in the track? We have to assume that this is possible
// and that in this case the VERIFY routine fails.
- m_register_w[DESIRED_SECTOR] = (desired_sector() + 1) & 0xff;
- m_substate = VERIFY1;
+ if (m_logical) m_register_w[DESIRED_SECTOR] = (desired_sector() + 1) & 0xff;
+ m_substate = VERIFY2;
cont = NEXT;
m_live_state.bit_count_total = 0;
}
@@ -944,7 +1027,7 @@ void hdc9234_device::data_transfer(int& cont)
break;
case DATA_TRANSFER_WRITE:
- if (TRACE_TRANSFER) logerror("%s: Sector successfully written\n", tag());
+ if (TRACE_TRANSFER) logerror("%s: Sector successfully written (count=%d)\n", tag(), m_register_w[SECTOR_COUNT]-1);
// Update the DMA registers for multi-sector operations
if (m_multi_sector)
@@ -956,16 +1039,17 @@ void hdc9234_device::data_transfer(int& cont)
dma_address = (dma_address + calc_sector_size()) & 0xffffff;
m_register_w[DMA23_16] = m_register_r[DMA23_16] = (dma_address & 0xff0000) >> 16;
- m_register_w[DMA15_8] = m_register_r[DMA15_8] = (dma_address & 0x00ff00) >> 16;
- m_register_w[DMA7_0] = m_register_r[DMA7_0] = (dma_address & 0x0000ff) >> 16;
+ m_register_w[DMA15_8] = m_register_r[DMA15_8] = (dma_address & 0x00ff00) >> 8;
+ m_register_w[DMA7_0] = m_register_r[DMA7_0] = (dma_address & 0x0000ff);
+ if (TRACE_TRANSFER) logerror("%s: New DMA address = %06x\n", tag(), dma_address);
}
// Decrement the count
m_register_w[SECTOR_COUNT] = (m_register_w[SECTOR_COUNT]-1) & 0xff;
if (m_register_w[SECTOR_COUNT] != 0 && !m_stop_after_index)
{
- m_register_w[DESIRED_SECTOR] = (desired_sector() + 1) & 0xff;
- m_substate = VERIFY1;
+ if (m_logical) m_register_w[DESIRED_SECTOR] = (desired_sector() + 1) & 0xff;
+ m_substate = VERIFY2;
cont = NEXT;
m_live_state.bit_count_total = 0;
}
@@ -975,7 +1059,7 @@ void hdc9234_device::data_transfer(int& cont)
break;
default:
- logerror("%s: unknown substate %d in data_transfer\n", tag(), m_substate);
+ logerror("%s: unknown substate %02x in data_transfer\n", tag(), m_substate);
cont = ERROR;
}
}
@@ -1065,7 +1149,7 @@ void hdc9234_device::restore_drive()
{
case RESTORE_CHECK:
// Track 0 has not been reached yet
- if ((m_register_r[DRIVE_STATUS] & HDC_DS_READY)==0)
+ if (!drive_ready())
{
if (TRACE_RESTORE) logerror("%s: restore command: Drive not ready\n", tag());
// Does not look like a success, but this takes into account
@@ -1257,7 +1341,7 @@ void hdc9234_device::poll_drives()
break;
case POLL2:
- if ((m_register_r[DRIVE_STATUS] & HDC_DS_SKCOM)!=0)
+ if (seek_complete())
{
// Seek complete has been set
m_substate = DONE;
@@ -1404,8 +1488,9 @@ void hdc9234_device::seek_read_id()
int cont = NEXT;
bool step_enable = (current_command() & 0x04)==1;
- bool wait_seek_comp = ((current_command() & 0x02)==1) || rapid_steps();
+ bool wait_seek_comp = (current_command() & 0x02)==1;
bool do_verify = (current_command() & 0x01)==1;
+ m_logical = true;
while (cont == NEXT)
{
@@ -1418,14 +1503,14 @@ void hdc9234_device::seek_read_id()
if (!do_verify)
cont = SUCCESS;
else
- verify(cont, true);
+ verify(cont);
break;
case DATA_TRANSFER:
// No data transfer here. Just exit.
cont = SUCCESS;
break;
default:
- logerror("%s: unknown substate %d in seek_read_id\n", tag(), m_substate);
+ logerror("%s: unknown substate %02x in seek_read_id\n", tag(), m_substate);
cont = ERROR;
}
}
@@ -1456,16 +1541,17 @@ void hdc9234_device::seek_read_id()
*/
void hdc9234_device::read_sectors()
{
- bool logical = (current_command() & 0x04)!=0;
+ m_logical = (current_command() & 0x04)!=0;
if (m_substate == UNDEF)
{
// Command init
- if (TRACE_READ) logerror("%s: READ SECTORS %s command %02x, CHS=(%d,%d,%d)\n", tag(), logical? "LOGICAL": "PHYSICAL", current_command(), desired_cylinder(), desired_head(), desired_sector());
+ if (TRACE_READ) logerror("%s: READ SECTORS %s command %02x, CHS=(%d,%d,%d)\n", tag(), m_logical? "LOGICAL": "PHYSICAL", current_command(), desired_cylinder(), desired_head(), desired_sector());
m_retry_save = m_register_w[RETRY_COUNT];
m_multi_sector = (m_register_w[SECTOR_COUNT] != 1);
m_write = false;
m_substate = READ_ID;
+ m_first_sector_found = false;
}
int cont = NEXT;
@@ -1477,16 +1563,16 @@ void hdc9234_device::read_sectors()
switch (m_substate & 0xf0)
{
case READ_ID:
- read_id(cont, implied_seek, rapid_steps());
+ read_id(cont, implied_seek, true); // Always check SEEK COMPLETE
break;
case VERIFY:
- verify(cont, logical); // for physical, only verify the first sector
+ verify(cont); // for physical, only verify the first sector
break;
case DATA_TRANSFER:
data_transfer(cont);
break;
default:
- logerror("%s: unknown substate %d in read_sectors\n", tag(), m_substate);
+ logerror("%s: unknown substate %02x in read_sectors\n", tag(), m_substate);
cont = ERROR;
}
}
@@ -1522,14 +1608,16 @@ void hdc9234_device::read_track()
switch (m_substate)
{
case WAITINDEX0:
- // Do we happen to have an index hole right now?
- if ((m_register_r[DRIVE_STATUS] & HDC_DS_INDEX)==0)
+ if (TRACE_READTRACK && TRACE_DETAIL) logerror("%s: Read track - waiting for index hole\n", tag());
+ if (!index_hole())
{
m_substate = WAITINDEX1;
+ cont = NEXT;
}
else
{
- // Waiting for the index line going down
+ // We're above the index hole; wait for the index line going down
+ if (TRACE_READTRACK && TRACE_DETAIL) logerror("%s: Index hole just passing by ... waiting for next\n", tag());
wait_line(INDEX_LINE, ASSERT_LINE, WAITINDEX1, false);
cont = WAIT;
}
@@ -1540,13 +1628,15 @@ void hdc9234_device::read_track()
cont = WAIT;
break;
case TRACKSTART:
+ if (TRACE_READTRACK && TRACE_DETAIL) logerror("%s: Read track - index hole arrived\n", tag());
live_start(READ_TRACK);
- wait_line(INDEX_LINE, ASSERT_LINE, TRACKDONE, true);
cont = WAIT;
break;
case TRACKDONE:
if (TRACE_READTRACK && TRACE_SUBSTATES) logerror("%s: Track reading done\n", tag());
cont = SUCCESS;
+ m_out_dmarq(CLEAR_LINE);
+ m_out_dip(CLEAR_LINE);
break;
}
}
@@ -1650,27 +1740,29 @@ void hdc9234_device::format_track()
switch (m_substate)
{
case WAITINDEX0:
- // Do we happen to have an index hole right now?
- if ((m_register_r[DRIVE_STATUS] & HDC_DS_INDEX)==0)
+ if (TRACE_FORMAT && TRACE_DETAIL) logerror("%s: Format track; looking for track start\n", tag());
+ if (!index_hole())
{
m_substate = WAITINDEX1;
cont = NEXT;
}
else
{
- // Waiting for the index line going down
- wait_line(INDEX_LINE, ASSERT_LINE, WAITINDEX1, false);
+ // We're above the index hole right now, so wait for the line going down
+ if (TRACE_FORMAT && TRACE_DETAIL) logerror("%s: Index hole just passing by ... \n", tag());
+ wait_line(INDEX_LINE, CLEAR_LINE, WAITINDEX1, false);
cont = WAIT;
}
break;
case WAITINDEX1:
// Waiting for the next rising edge
+ if (TRACE_FORMAT && TRACE_DETAIL) logerror("%s: Waiting for next index hole\n", tag());
wait_line(INDEX_LINE, ASSERT_LINE, TRACKSTART, false);
cont = WAIT;
break;
case TRACKSTART:
+ if (TRACE_FORMAT && TRACE_DETAIL) logerror("%s: Format track - index hole arrived\n", tag());
live_start(FORMAT_TRACK);
- wait_line(INDEX_LINE, ASSERT_LINE, TRACKDONE, true);
cont = WAIT;
break;
case TRACKDONE:
@@ -1704,14 +1796,16 @@ void hdc9234_device::format_track()
| 1 |NoSeek|Logical|Normal|RedWC| Precompensation |
+-----+------+-------+------+-----+-----+-----+------+
+ Write physical: typical value 11000000
+ Write logical : typical value 10110000
*/
void hdc9234_device::write_sectors()
{
- bool logical = (current_command() & 0x20)!=0;
+ m_logical = (current_command() & 0x20)!=0;
if (m_substate == UNDEF)
{
- if (TRACE_WRITE) logerror("%s: WRITE SECTORS %s command %02x, CHS=(%d,%d,%d)\n", tag(), logical? "LOGICAL" : "PHYSICAL", current_command(), desired_cylinder(), desired_head(), desired_sector());
+ if (TRACE_WRITE) logerror("%s: WRITE SECTORS %s command %02x, CHS=(%d,%d,%d)\n", tag(), m_logical? "LOGICAL" : "PHYSICAL", current_command(), desired_cylinder(), desired_head(), desired_sector());
m_multi_sector = (m_register_w[SECTOR_COUNT] != 1);
m_substate = READ_ID;
@@ -1720,9 +1814,28 @@ void hdc9234_device::write_sectors()
m_precompensation = (current_command() & 0x07);
// Important for DATA TRANSFER
m_transfer_enabled = true;
- m_sync_size = fm_mode()? 6 : 12;
- m_gap2_size = fm_mode()? 11 : 22;
+
+ // Something interesting here:
+ //
+ // The values for sync and gap2 are passed to the formatting routing
+ // but how do we know their values right now, when we are writing sectors?
+ // Since this is not clearly stated in the specification, we have to
+ // use the default values here
+ // Actually, why can we choose that value for formatting in the first place?
+
+ if (using_floppy())
+ {
+ m_sync_size = fm_mode()? 6 : 12;
+ m_gap2_size = fm_mode()? 11 : 22;
+ }
+ else
+ {
+ // Values for HD
+ m_sync_size = 13;
+ m_gap2_size = 3;
+ }
m_write = false; // until we're writing
+ m_first_sector_found = false;
}
int cont = NEXT;
@@ -1734,17 +1847,17 @@ void hdc9234_device::write_sectors()
switch (m_substate & 0xf0)
{
case READ_ID:
- read_id(cont, implied_seek, rapid_steps());
+ read_id(cont, implied_seek, true); // Always check SEEK COMPLETE
break;
case VERIFY:
- verify(cont, logical);
+ verify(cont);
break;
case DATA_TRANSFER:
m_write = true;
data_transfer(cont);
break;
default:
- logerror("%s: unknown substate %d in write_sectors\n", tag(), m_substate);
+ logerror("%s: unknown substate %02x in write_sectors\n", tag(), m_substate);
cont = ERROR;
}
}
@@ -1780,13 +1893,46 @@ std::string hdc9234_device::ttsn()
return tts(machine().time());
}
+bool hdc9234_device::found_mark(int state)
+{
+ bool ismark = false;
+ if (using_floppy())
+ {
+ if (state==SEARCH_IDAM) ismark = (m_live_state.shift_reg == fm_mode()? 0xf57e : 0x4489);
+ else
+ {
+ // f56a 1x1x
+ ismark = fm_mode()? ((m_live_state.shift_reg & 0xfffa) == 0xf56a) : (m_live_state.shift_reg == 0x4489);
+ }
+ }
+ else
+ {
+ switch (m_hd_encoding)
+ {
+ case MFM_BITS:
+ case MFM_BYTE:
+ ismark = (m_live_state.shift_reg == 0x4489);
+ break;
+ case SEPARATED:
+ // 0 0 0 0 1 0 1 0
+ // 1 0 1 0 0 0 0 1
+ ismark = (m_live_state.data_reg == 0xa1 && m_live_state.clock_reg == 0x0a);
+ break;
+ case SEPARATED_SIMPLE:
+ ismark = (m_live_state.data_reg == 0xa1 && m_live_state.clock_reg == 0xff);
+ break;
+ }
+ }
+ return ismark;
+}
+
/*
The controller starts to read bits from the disk. This method takes an
argument for the state machine called at the end.
*/
void hdc9234_device::live_start(int state)
{
- if (TRACE_LIVE) logerror("%s: [%s] Live start substate=%d\n", tag(), ttsn().c_str(), state);
+ if (TRACE_LIVE) logerror("%s: [%s] Live start substate=%02x\n", tag(), ttsn().c_str(), state);
m_live_state.time = machine().time();
m_live_state.state = state;
m_live_state.next_state = -1;
@@ -1799,7 +1945,7 @@ void hdc9234_device::live_start(int state)
m_live_state.data_reg = 0;
m_live_state.last_data_bit = false;
- pll_reset(m_live_state.time, m_write);
+ if (using_floppy()) pll_reset(m_live_state.time, m_write);
m_checkpoint_state = m_live_state;
// Save checkpoint
@@ -1807,6 +1953,7 @@ void hdc9234_device::live_start(int state)
live_run();
m_last_live_state = UNDEF;
+ if (TRACE_LIVE) logerror("%s: [%s] Live start end\n", tag(), ttsn().c_str()); // delete
}
void hdc9234_device::live_run()
@@ -1833,9 +1980,9 @@ void hdc9234_device::live_run_until(attotime limit)
if (TRACE_LIVE)
{
if (limit == attotime::never)
- logerror("%s: [%s] live_run, live_state=%d, mode=%s\n", tag(), tts(m_live_state.time).c_str(), m_live_state.state, fm_mode()? "FM":"MFM");
+ logerror("%s: [%s live] live_run, live_state=%02x, mode=%s\n", tag(), tts(m_live_state.time).c_str(), m_live_state.state, fm_mode()? "FM":"MFM");
else
- logerror("%s: [%s] live_run until %s, live_state=%d, mode=%s\n", tag(), tts(m_live_state.time).c_str(), tts(limit).c_str(), m_live_state.state, fm_mode()? "FM":"MFM");
+ logerror("%s: [%s live] live_run until %s, live_state=%02x, mode=%s\n", tag(), tts(m_live_state.time).c_str(), tts(limit).c_str(), m_live_state.state, fm_mode()? "FM":"MFM");
}
if (limit == attotime::never)
@@ -1867,7 +2014,7 @@ void hdc9234_device::live_run_until(attotime limit)
if (TRACE_LIVE && m_last_live_state != SEARCH_IDAM)
{
- logerror("%s: [%s] SEARCH_IDAM [limit %s]\n", tag(),tts(m_live_state.time).c_str(), tts(limit).c_str());
+ logerror("%s: [%s live] SEARCH_IDAM [limit %s]\n", tag(),tts(m_live_state.time).c_str(), tts(limit).c_str());
m_last_live_state = m_live_state.state;
}
@@ -1876,17 +2023,21 @@ void hdc9234_device::live_run_until(attotime limit)
if (read_one_bit(limit))
{
- if (TRACE_LIVE) logerror("%s: [%s] SEARCH_IDAM limit reached\n", tag(), tts(m_live_state.time).c_str());
+ if (TRACE_LIVE) logerror("%s: [%s live] SEARCH_IDAM limit reached\n", tag(), tts(m_live_state.time).c_str());
return;
}
// logerror("%s: SEARCH_IDAM\n", tts(m_live_state.time).c_str());
- if (TRACE_SHIFT) logerror("%s: shift = %04x data=%02x c=%d\n", tts(m_live_state.time).c_str(), m_live_state.shift_reg,
+ if (TRACE_SHIFT) logerror("%s: [%s live] shift = %04x data=%02x c=%d\n", tag(), tts(m_live_state.time).c_str(), m_live_state.shift_reg,
get_data_from_encoding(m_live_state.shift_reg), m_live_state.bit_counter);
// [1] p. 9: The ID field sync mark must be found within 33,792 byte times
if (m_live_state.bit_count_total > 33792*16)
{
- wait_for_realtime(SEARCH_IDAM_FAILED);
+ // Desired sector not found within time
+ if (m_substate == VERIFY3)
+ wait_for_realtime(VERIFY_FAILED);
+ else
+ wait_for_realtime(SEARCH_IDAM_FAILED);
return;
}
@@ -1895,7 +2046,7 @@ void hdc9234_device::live_run_until(attotime limit)
// MFM case
if (m_live_state.shift_reg == 0x4489)
{
- if (TRACE_LIVE) logerror("%s: [%s] Found an A1 mark\n", tag(),tts(m_live_state.time).c_str());
+ if (TRACE_LIVE) logerror("%s: [%s live] Found an A1 mark\n", tag(),tts(m_live_state.time).c_str());
m_live_state.crc = 0x443b;
m_live_state.data_separator_phase = false;
m_live_state.bit_counter = 0;
@@ -1922,18 +2073,23 @@ void hdc9234_device::live_run_until(attotime limit)
m_live_state.state = IDLE;
return;
+ case VERIFY_FAILED:
+ set_bits(m_register_r[CHIP_STATUS], CS_COMPERR, true);
+ m_live_state.state = IDLE;
+ return;
+
case READ_TWO_MORE_A1_IDAM: // This state only applies for MFM mode.
if (TRACE_LIVE && m_last_live_state != READ_TWO_MORE_A1_IDAM)
{
- logerror("%s: [%s] READ_TWO_MORE_A1\n", tag(),tts(m_live_state.time).c_str());
+ logerror("%s: [%s live] READ_TWO_MORE_A1\n", tag(),tts(m_live_state.time).c_str());
m_last_live_state = m_live_state.state;
}
// Beyond time limit?
if (read_one_bit(limit)) return;
- if (TRACE_SHIFT) logerror("%s: shift = %04x data=%02x c=%d\n", tts(m_live_state.time).c_str(), m_live_state.shift_reg,
+ if (TRACE_SHIFT) logerror("%s: [%s live] shift = %04x data=%02x c=%d\n", tag(), tts(m_live_state.time).c_str(), m_live_state.shift_reg,
get_data_from_encoding(m_live_state.shift_reg), m_live_state.bit_counter);
if (m_live_state.bit_count_total > 33792*16)
@@ -1955,18 +2111,24 @@ void hdc9234_device::live_run_until(attotime limit)
m_live_state.state = SEARCH_IDAM;
}
else
- if (TRACE_LIVE) logerror("%s: [%s] Found an A1 mark\n", tag(),tts(m_live_state.time).c_str());
+ if (TRACE_LIVE) logerror("%s: [%s live] Found an A1 mark\n", tag(),tts(m_live_state.time).c_str());
// Continue
break;
}
- if (TRACE_LIVE) logerror("%s: [%s] Found data value %02X\n", tag(),tts(m_live_state.time).c_str(), m_live_state.data_reg);
+ if (TRACE_LIVE) logerror("%s: [%s live] Found data value %02X\n", tag(),tts(m_live_state.time).c_str(), m_live_state.data_reg);
// Check for ident field (fe, ff, fd, fc)
if ((m_live_state.data_reg & 0xfc) != 0xfc)
{
// This may happen when we accidentally locked onto the DAM. Look for the next IDAM.
- if (TRACE_LIVE) logerror("%s: Missing ident data after A1A1A1\n", tag());
+ if (TRACE_LIVE)
+ {
+ if (m_live_state.data_reg == 0xf8 || m_live_state.data_reg == 0xfb)
+ logerror("%s: [%s live] Looks like a DAM; continue to next mark\n", tag(), tts(m_live_state.time).c_str());
+ else
+ logerror("%s: [%s live] Missing ident data after A1A1A1, and it was not DAM; format corrupt?\n", tag(), tts(m_live_state.time).c_str());
+ }
m_live_state.state = SEARCH_IDAM;
break;
}
@@ -1981,7 +2143,7 @@ void hdc9234_device::live_run_until(attotime limit)
case READ_ID_FIELDS_INTO_REGS:
if (TRACE_LIVE && m_last_live_state != READ_ID_FIELDS_INTO_REGS)
{
- logerror("%s: [%s] READ_ID_FIELDS_INTO_REGS\n", tag(),tts(m_live_state.time).c_str());
+ logerror("%s: [%s live] READ_ID_FIELDS_INTO_REGS\n", tag(),tts(m_live_state.time).c_str());
m_last_live_state = m_live_state.state;
}
@@ -2003,9 +2165,7 @@ void hdc9234_device::live_run_until(attotime limit)
if(slot > 4)
{
// We successfully read the ID fields; let's wait for the machine time to catch up.
- m_live_state.bit_count_total = 0;
-
- if ((current_command() & 0xfe) == 0x5a)
+ if (reading_track())
// Continue if we're reading a complete track
wait_for_realtime(READ_TRACK_ID_DONE);
else
@@ -2022,7 +2182,7 @@ void hdc9234_device::live_run_until(attotime limit)
case SEARCH_DAM:
if (TRACE_LIVE && m_last_live_state != SEARCH_DAM)
{
- logerror("%s: [%s] SEARCH_DAM\n", tag(),tts(m_live_state.time).c_str());
+ logerror("%s: [%s live] SEARCH_DAM\n", tag(),tts(m_live_state.time).c_str());
m_last_live_state = m_live_state.state;
}
@@ -2031,7 +2191,7 @@ void hdc9234_device::live_run_until(attotime limit)
if(read_one_bit(limit))
return;
- if (TRACE_SHIFT) logerror("%s: shift = %04x data=%02x c=%d\n", tts(m_live_state.time).c_str(), m_live_state.shift_reg,
+ if (TRACE_SHIFT) logerror("%s: [%s live] shift = %04x data=%02x c=%d\n", tag(), tts(m_live_state.time).c_str(), m_live_state.shift_reg,
get_data_from_encoding(m_live_state.shift_reg), m_live_state.bit_counter);
if (!fm_mode())
@@ -2045,7 +2205,7 @@ void hdc9234_device::live_run_until(attotime limit)
if (m_live_state.bit_counter >= 28*16 && m_live_state.shift_reg == 0x4489)
{
- if (TRACE_LIVE) logerror("%s: [%s] Found an A1 mark\n", tag(),tts(m_live_state.time).c_str());
+ if (TRACE_LIVE) logerror("%s: [%s live] Found an A1 mark\n", tag(),tts(m_live_state.time).c_str());
m_live_state.crc = 0x443b;
m_live_state.data_separator_phase = false;
m_live_state.bit_counter = 0;
@@ -2079,14 +2239,14 @@ void hdc9234_device::live_run_until(attotime limit)
case READ_TWO_MORE_A1_DAM: {
if (TRACE_LIVE && m_last_live_state != READ_TWO_MORE_A1_DAM)
{
- logerror("%s: [%s] READ_TWO_MORE_A1_DAM\n", tag(),tts(m_live_state.time).c_str());
+ logerror("%s: [%s live] READ_TWO_MORE_A1_DAM\n", tag(),tts(m_live_state.time).c_str());
m_last_live_state = m_live_state.state;
}
if(read_one_bit(limit))
return;
- if (TRACE_SHIFT) logerror("%s: shift = %04x data=%02x c=%d\n", tts(m_live_state.time).c_str(), m_live_state.shift_reg,
+ if (TRACE_SHIFT) logerror("%s: [%s live] shift = %04x data=%02x c=%d\n", tag(), tts(m_live_state.time).c_str(), m_live_state.shift_reg,
get_data_from_encoding(m_live_state.shift_reg), m_live_state.bit_counter);
// Repeat until we have collected 16 bits
@@ -2103,12 +2263,12 @@ void hdc9234_device::live_run_until(attotime limit)
return;
}
else
- if (TRACE_LIVE) logerror("%s: [%s] Found an A1 mark\n", tag(),tts(m_live_state.time).c_str());
+ if (TRACE_LIVE) logerror("%s: [%s live] Found an A1 mark\n", tag(),tts(m_live_state.time).c_str());
// Continue
break;
}
- if (TRACE_LIVE) logerror("%s: [%s] Found data value %02X\n", tag(),tts(m_live_state.time).c_str(), m_live_state.data_reg);
+ if (TRACE_LIVE) logerror("%s: [%s live] Found data value %02X\n", tag(),tts(m_live_state.time).c_str(), m_live_state.data_reg);
if ((m_live_state.data_reg & 0xff) == 0xf8)
{
@@ -2138,7 +2298,7 @@ void hdc9234_device::live_run_until(attotime limit)
{
if (TRACE_LIVE && m_last_live_state != READ_SECTOR_DATA)
{
- logerror("%s: [%s] READ_SECTOR_DATA\n", tag(),tts(m_live_state.time).c_str());
+ logerror("%s: [%s live] READ_SECTOR_DATA\n", tag(),tts(m_live_state.time).c_str());
m_last_live_state = m_live_state.state;
}
@@ -2163,13 +2323,13 @@ void hdc9234_device::live_run_until(attotime limit)
// Repeat until we have collected 16 bits
if (m_live_state.bit_counter & 15) break;
- if (TRACE_LIVE) logerror("%s: [%s] Found data value %02X, CRC=%04x\n", tag(),tts(m_live_state.time).c_str(), m_live_state.data_reg, m_live_state.crc);
+ if (TRACE_LIVE) logerror("%s: [%s live] Found data value %02X, CRC=%04x\n", tag(),tts(m_live_state.time).c_str(), m_live_state.data_reg, m_live_state.crc);
int slot = (m_live_state.bit_counter >> 4)-1;
if (slot < calc_sector_size())
{
// Sector data
- wait_for_realtime(READ_SECTOR_DATA1);
+ wait_for_realtime(READ_SECTOR_DATA_CONT);
return;
}
else if (slot < calc_sector_size()+2)
@@ -2177,14 +2337,14 @@ void hdc9234_device::live_run_until(attotime limit)
// CRC
if (slot == calc_sector_size()+1)
{
- if ((current_command() & 0xfe)==0x5a)
+ if (reading_track())
{
// Reading a track? Continue with next ID.
wait_for_realtime(READ_TRACK_ID);
}
else
{
- if (TRACE_LIVE) logerror("%s: [%s] Sector read completed\n", tag(),tts(m_live_state.time).c_str());
+ if (TRACE_LIVE) logerror("%s: [%s live] Sector read completed\n", tag(),tts(m_live_state.time).c_str());
wait_for_realtime(IDLE);
}
return;
@@ -2193,10 +2353,10 @@ void hdc9234_device::live_run_until(attotime limit)
break;
}
- case READ_SECTOR_DATA1:
- if (TRACE_LIVE && m_last_live_state != READ_SECTOR_DATA1)
+ case READ_SECTOR_DATA_CONT:
+ if (TRACE_LIVE && m_last_live_state != READ_SECTOR_DATA_CONT)
{
- logerror("%s: [%s] READ_SECTOR_DATA1\n", tag(),tts(m_live_state.time).c_str());
+ logerror("%s: [%s live] READ_SECTOR_DATA_CONT\n", tag(),tts(m_live_state.time).c_str());
m_last_live_state = m_live_state.state;
}
@@ -2242,7 +2402,7 @@ void hdc9234_device::live_run_until(attotime limit)
// 5. Write the CRC bytes
if (TRACE_LIVE)
- logerror("%s: [%s] WRITE_DAM_AND_SECTOR\n", tag(), tts(m_live_state.time).c_str());
+ logerror("%s: [%s live] WRITE_DAM_AND_SECTOR\n", tag(), tts(m_live_state.time).c_str());
skip_on_track(m_gap2_size, WRITE_DAM_SYNC);
break;
@@ -2344,8 +2504,9 @@ void hdc9234_device::live_run_until(attotime limit)
write_on_track(encode((m_live_state.crc >> 8) & 0xff), 1, WRITE_DATA_CRC);
}
else
- // Write a filler byte so that the last CRC bit is saved correctly
- write_on_track(encode(0xff), 1, WRITE_DONE);
+ // Write a filler byte so that the last CRC bit is saved correctly (why actually?)
+ // write_on_track(encode(0xff), 1, WRITE_DONE);
+ m_live_state.state = WRITE_DONE;
break;
@@ -2502,6 +2663,7 @@ void hdc9234_device::live_run_until(attotime limit)
case WRITE_GAP4:
// Write bytes up to the end of the track
+ wait_line(INDEX_LINE, ASSERT_LINE, TRACKDONE, true);
if (TRACE_WRITE && TRACE_DETAIL && m_last_live_state != WRITE_GAP4)
{
logerror("%s: Writing GAP4\n", tag());
@@ -2559,14 +2721,14 @@ void hdc9234_device::live_run_until(attotime limit)
// The pause is implemented by doing dummy reads on the floppy
if (read_one_bit(limit))
{
- if (TRACE_LIVE) logerror("%s: [%s] return; limit=%s\n", tag(), tts(m_live_state.time).c_str(), tts(limit).c_str());
+ if (TRACE_LIVE) logerror("%s: [%s live] return; limit=%s\n", tag(), tts(m_live_state.time).c_str(), tts(limit).c_str());
return;
}
// Repeat until we have collected 16 bits
if ((m_live_state.bit_counter & 15)==0)
{
- if (TRACE_READ && TRACE_DETAIL) logerror("%s: [%s] Read byte %02x, repeat = %d\n", tag(), tts(m_live_state.time).c_str(), m_live_state.data_reg, m_live_state.repeat);
+ if (TRACE_READ && TRACE_DETAIL) logerror("%s: [%s live] Read byte %02x, repeat = %d\n", tag(), tts(m_live_state.time).c_str(), m_live_state.data_reg, m_live_state.repeat);
wait_for_realtime(READ_TRACK_NEXT_BYTE);
return;
}
@@ -2634,11 +2796,15 @@ void hdc9234_device::live_run_until(attotime limit)
otherwise, used to replay the read/write operation up to the point where the event happened
THIS IS THE HARDDISK-ONLY LIVE_RUN
+
+ NB: Although unlikely, hard disks may be recorded in FM format with this controller
+ [1], section "Drive select", table
+ This is currently unsupported; hard disks are forced to MFM
*/
void hdc9234_device::live_run_hd_until(attotime limit)
{
-// int slot = 0;
- logerror("%s: live_run_hd\n", tag());
+ int slot = 0;
+ if (TRACE_LIVE) logerror("%s: live_run_hd\n", tag());
if (m_live_state.state == IDLE || m_live_state.next_state != -1)
return;
@@ -2646,19 +2812,589 @@ void hdc9234_device::live_run_hd_until(attotime limit)
if (TRACE_LIVE)
{
if (limit == attotime::never)
- logerror("%s: [%s] live_run_hd, live_state=%d, mode=%s\n", tag(), tts(m_live_state.time).c_str(), m_live_state.state, fm_mode()? "FM":"MFM");
+ logerror("%s: [%s live] live_run_hd, live_state=%02x, mode=%s\n", tag(), tts(m_live_state.time).c_str(), m_live_state.state, fm_mode()? "FM":"MFM");
else
- logerror("%s: [%s] live_run_hd until %s, live_state=%d, mode=%s\n", tag(), tts(m_live_state.time).c_str(), tts(limit).c_str(), m_live_state.state, fm_mode()? "FM":"MFM");
+ logerror("%s: [%s live] live_run_hd until %s, live_state=%02x, mode=%s\n", tag(), tts(m_live_state.time).c_str(), tts(limit).c_str(), m_live_state.state, fm_mode()? "FM":"MFM");
+ }
+
+ // We did not specify an upper time bound, so we take the next index pulse
+ if (limit == attotime::never && m_harddisk != NULL)
+ {
+ limit = m_harddisk->track_end_time();
+ if (TRACE_LIVE) logerror("%s: [%s live] live_run_hd new limit %s\n", tag(), tts(m_live_state.time).c_str(), tts(limit).c_str());
}
+
while (true)
{
switch (m_live_state.state)
{
- case SEARCH_IDAM:
- break;
+ case SEARCH_IDAM:
+ if (TRACE_LIVE && m_last_live_state != SEARCH_IDAM)
+ {
+ logerror("%s: [%s live] SEARCH_IDAM [limit %s]\n", tag(),tts(m_live_state.time).c_str(), tts(limit).c_str());
+ m_last_live_state = m_live_state.state;
+ }
+
+ // This bit will be set when the IDAM cannot be found
+ set_bits(m_register_r[CHIP_STATUS], CS_SYNCERR, false);
+
+ if (read_from_mfmhd(limit))
+ {
+ if (TRACE_LIVE) logerror("%s: [%s live] SEARCH_IDAM limit reached\n", tag(), tts(m_live_state.time).c_str());
+ return;
+ }
+
+ if (TRACE_LIVE)
+ if ((m_live_state.bit_counter & 0x000f)==0) logerror("%s: [%s live] Read %04x\n", tag(), tts(m_live_state.time).c_str(), m_live_state.shift_reg);
+
+ // [1] p. 9: The ID field sync mark must be found within 33,792 byte times
+ if (m_live_state.bit_count_total > 33792*16)
+ {
+ // Desired sector not found within time
+ if (m_substate == VERIFY3)
+ wait_for_realtime(VERIFY_FAILED);
+ else
+ wait_for_realtime(SEARCH_IDAM_FAILED);
+ return;
+ }
+
+ if (found_mark(SEARCH_IDAM))
+ {
+ if (TRACE_LIVE) logerror("%s: [%s live] Found an A1 mark\n", tag(), tts(m_live_state.time).c_str());
+ m_live_state.crc = 0x443b;
+ m_live_state.data_separator_phase = false;
+ m_live_state.bit_counter = 0;
+
+ m_live_state.state = READ_IDENT;
+ }
+ break;
+
+ case SEARCH_IDAM_FAILED:
+ set_bits(m_register_r[CHIP_STATUS], CS_SYNCERR, true);
+ m_live_state.state = IDLE;
+ return;
+
+ case VERIFY_FAILED:
+ set_bits(m_register_r[CHIP_STATUS], CS_COMPERR, true);
+ m_live_state.state = IDLE;
+ return;
+
+ case READ_IDENT:
+ if (read_from_mfmhd(limit)) return;
+
+ // Repeat until we have collected 16 bits (MFM_BITS; in the other modes this is always false)
+ if (m_live_state.bit_counter & 15) break;
+
+ // Ident bytes are 111111xx
+ if ((m_live_state.data_reg & 0xfc) != 0xfc)
+ {
+ if (TRACE_LIVE)
+ {
+ if (m_live_state.data_reg == 0xf8 || m_live_state.data_reg == 0xfb)
+ logerror("%s: [%s live] Looks like a DAM; continue to next mark\n", tag(), tts(m_live_state.time).c_str());
+ else
+ logerror("%s: [%s live] Missing ident data after A1, and it was not DAM; format corrupt?\n", tag(), tts(m_live_state.time).c_str());
+ }
+ m_live_state.state = SEARCH_IDAM;
+ }
+ else
+ {
+ m_register_r[CURRENT_IDENT] = m_live_state.data_reg;
+ m_live_state.state = READ_ID_FIELDS_INTO_REGS;
+ slot = 0;
+ }
+ break;
+
+ case READ_ID_FIELDS_INTO_REGS:
+ if (TRACE_LIVE && m_last_live_state != READ_ID_FIELDS_INTO_REGS)
+ {
+ logerror("%s: [%s live] READ_ID_FIELDS_INTO_REGS\n", tag(),tts(m_live_state.time).c_str());
+ m_last_live_state = m_live_state.state;
+ }
+
+ if (read_from_mfmhd(limit)) return;
+
+ // Repeat until we have collected 16 bits
+ if (m_live_state.bit_counter & 15) break;
+
+ if (TRACE_LIVE) logerror("%s: slot %d = %02x, crc=%04x\n", tag(), slot, m_live_state.data_reg, m_live_state.crc);
+ m_register_r[id_field[slot++]] = m_live_state.data_reg;
+
+ if(slot > 5)
+ {
+ // We successfully read the ID fields; let's wait for the machine time to catch up.
+ if (reading_track())
+ // Continue if we're reading a complete track
+ wait_for_realtime(READ_TRACK_ID_DONE);
+ else
+ // Live run is done here; it is the main state machine's turn again.
+ wait_for_realtime(IDLE);
+ return;
+ }
+ break;
+
+ case SEARCH_DAM:
+ if (TRACE_LIVE && m_last_live_state != SEARCH_DAM)
+ {
+ logerror("%s: [%s live] SEARCH_DAM\n", tag(),tts(m_live_state.time).c_str());
+ m_last_live_state = m_live_state.state;
+ }
+ set_bits(m_register_r[CHIP_STATUS], CS_DELDATA, false);
+
+ if (read_from_mfmhd(limit)) return;
+
+ if (TRACE_LIVE)
+ if ((m_live_state.bit_counter & 15)==0) logerror("%s: [%s live] Read %04x\n", tag(), tts(m_live_state.time).c_str(), m_live_state.shift_reg);
+
+ if (m_live_state.bit_counter > 30*16)
+ {
+ if (TRACE_FAIL) logerror("%s: SEARCH_DAM failed\n", tag());
+ wait_for_realtime(SEARCH_DAM_FAILED);
+ return;
+ }
+
+ if (found_mark(SEARCH_DAM))
+ {
+ if (TRACE_LIVE) logerror("%s: [%s live] Found an A1 mark\n", tag(),tts(m_live_state.time).c_str());
+ m_live_state.crc = 0x443b;
+ m_live_state.data_separator_phase = false;
+ m_live_state.bit_counter = 0;
+ m_live_state.state = READ_DATADEL_FLAG;
+ }
+ break;
+
+ case READ_DATADEL_FLAG:
+ if (read_from_mfmhd(limit)) return;
+
+ if (m_live_state.bit_counter & 15) break;
+
+ if ((m_live_state.data_reg & 0xff) == 0xf8)
+ {
+ if (TRACE_LIVE) logerror("%s: [%s live] Found deleted data mark F8 after DAM sync\n", tag(), tts(m_live_state.time).c_str());
+ set_bits(m_register_r[CHIP_STATUS], CS_DELDATA, true);
+ }
+ else
+ {
+ if ((m_live_state.data_reg & 0xff) != 0xfb)
+ {
+ if (TRACE_FAIL) logerror("%s: [%s live] Missing FB/F8 data mark after DAM sync; found %04x\n", tag(), tts(m_live_state.time).c_str(), m_live_state.shift_reg);
+ wait_for_realtime(SEARCH_DAM_FAILED);
+ return;
+ }
+ }
+ m_live_state.bit_counter = 0;
+ m_live_state.state = READ_SECTOR_DATA;
+ break;
+
+ case SEARCH_DAM_FAILED:
+ if (TRACE_FAIL) logerror("%s: SEARCH_DAM failed\n", tag());
+ m_live_state.state = IDLE;
+ return;
+
+ case READ_SECTOR_DATA:
+ if (TRACE_LIVE && m_last_live_state != READ_SECTOR_DATA)
+ {
+ logerror("%s: [%s live] READ_SECTOR_DATA\n", tag(),tts(m_live_state.time).c_str());
+ m_last_live_state = m_live_state.state;
+ }
+
+ if (read_from_mfmhd(limit)) return;
+
+ // Request bus release
+ // For hard disk, get it only for the first byte and then keep the bus until the last byte.
+ // HD: bit_counter increases by 16 for MFM_BYTE, SEPARATED(_SIMPLE) and by 1 for MFM_BIT
+ // If we are reading a track, the DMA must have already been granted
+ if (!reading_track() && m_transfer_enabled && (m_live_state.bit_counter == 1 || m_live_state.bit_counter == 16))
+ {
+ set_bits(m_register_r[INT_STATUS], ST_OVRUN, true);
+ m_out_dmarq(ASSERT_LINE);
+ }
+
+ // Repeat until we have collected 16 bits
+ if (m_live_state.bit_counter & 15) break;
+
+ slot = (m_live_state.bit_counter >> 4)-1;
+ if (TRACE_LIVE) logerror("%s: [%s live] Found data value [%d/%d] = %02X, CRC=%04x\n", tag(),tts(m_live_state.time).c_str(), slot, calc_sector_size(), m_live_state.data_reg, m_live_state.crc);
+
+ if (slot < calc_sector_size())
+ {
+ // For the first byte, allow for the DMA acknowledge to be set.
+ if (slot == 0)
+ {
+ wait_for_realtime(READ_SECTOR_DATA_CONT);
+ return;
+ }
+ else m_live_state.state = READ_SECTOR_DATA_CONT;
+ }
+ else if (slot < calc_sector_size()+2)
+ {
+ // CRC
+ if (slot == calc_sector_size()+1)
+ {
+ m_out_dip(CLEAR_LINE);
+ m_out_dmarq(CLEAR_LINE);
+ checkpoint();
+
+ if (reading_track())
+ {
+ // Reading a track? Continue with next ID.
+ wait_for_realtime(READ_TRACK_ID);
+ }
+ else
+ {
+ if (TRACE_LIVE) logerror("%s: [%s live] Sector read completed\n", tag(),tts(m_live_state.time).c_str());
+ wait_for_realtime(IDLE);
+ }
+ return;
+ }
+ }
+ break;
+
+ case READ_SECTOR_DATA_CONT:
+
+ // Did the system CPU send the DMA ACK in the meantime?
+ if ((m_register_r[INT_STATUS] & ST_OVRUN)!=0)
+ {
+ if (TRACE_FAIL) logerror("%s: No DMA ACK - buffer overrun\n", tag());
+ set_bits(m_register_r[INT_STATUS], TC_DATAERR, true);
+ m_live_state.state = IDLE;
+ return;
+ }
+
+ if (m_transfer_enabled)
+ {
+ m_register_r[DATA] = m_register_w[DATA] = m_live_state.data_reg;
+ // See above: For hard disk do it only for the first byte / bit
+ if (m_live_state.bit_counter == 1 || m_live_state.bit_counter == 16)
+ m_out_dip(ASSERT_LINE);
+
+ m_out_dma(0, m_register_r[DATA], 0xff);
+ if (TRACE_LIVE) logerror("%s: [%s live] Byte %02x sent via DMA\n", tag(),tts(m_live_state.time).c_str(), m_register_r[DATA] & 0xff);
+ }
+ m_live_state.state = READ_SECTOR_DATA;
+ break;
+
+ // ==== Track R/W operations (HD), also used for sector writing ===============
+
+ case READ_TRACK_BYTE:
+ // The pause is implemented by doing dummy reads on the hard disk
+ if (read_from_mfmhd(limit))
+ {
+ if (TRACE_LIVE) logerror("%s: [%s live] return; limit=%s\n", tag(), tts(m_live_state.time).c_str(), tts(limit).c_str());
+ return;
+ }
+
+ // Repeat until we have collected 16 bits
+ if ((m_live_state.bit_counter & 15)==0)
+ {
+ if (TRACE_READ && TRACE_DETAIL) logerror("%s: [%s live] Read byte %02x, repeat = %d\n", tag(), tts(m_live_state.time).c_str(), m_live_state.data_reg, m_live_state.repeat);
+ wait_for_realtime(READ_TRACK_NEXT_BYTE);
+ return;
+ }
+ break;
+
+ case READ_TRACK_NEXT_BYTE:
+ m_live_state.state = READ_TRACK_BYTE;
+ m_live_state.repeat--;
+ if (m_live_state.repeat == 0)
+ {
+ // All bytes read
+ m_live_state.state = m_live_state.return_state;
+ checkpoint();
+ }
+ break;
+
+ case WRITE_TRACK_BYTE:
+ if (write_to_mfmhd(limit))
+ {
+ if (TRACE_LIVE) logerror("%s: [%s live] write limit reached\n", tag(), tts(m_live_state.time).c_str());
+ return;
+ }
+
+ if (m_live_state.bit_counter == 0)
+ {
+ // All bits written; get the next byte into the shift register
+ wait_for_realtime(WRITE_TRACK_NEXT_BYTE);
+ return;
+ }
+ break;
+
+ case WRITE_TRACK_NEXT_BYTE:
+ m_live_state.state = WRITE_TRACK_BYTE;
+ m_live_state.repeat--;
+
+ // Write all bytes
+ if (m_live_state.repeat == 0)
+ {
+ // All bytes written
+ m_live_state.state = m_live_state.return_state;
+ checkpoint();
+ }
+ else
+ encode_again();
+
+ break;
+
+ // ======= HD sector write =====================================
+
+ case WRITE_DAM_AND_SECTOR:
+ if (TRACE_LIVE) logerror("%s: [%s live] Skipping GAP2\n", tag(), tts(m_live_state.time).c_str());
+ skip_on_track(m_gap2_size, WRITE_DAM_SYNC);
+
+ break;
+
+ case WRITE_DAM_SYNC:
+ if (TRACE_WRITE && TRACE_DETAIL) logerror("%s: Write sync zeros\n", tag());
+
+ // Clear the overrun/underrun flag
+ set_bits(m_register_r[INT_STATUS], ST_OVRUN, false);
+ write_on_track(encode_hd(0x00), m_sync_size, WRITE_A1);
+ break;
+
+ case WRITE_A1:
+ if (TRACE_WRITE && TRACE_DETAIL) logerror("%s: Write one A1\n", tag());
+ write_on_track(encode_a1_hd(), 1, WRITE_DATAMARK);
+ break;
+
+ case WRITE_DATAMARK:
+ if (TRACE_WRITE && TRACE_DETAIL) logerror("%s: Write data mark\n", tag());
+
+ // Init the CRC for the ident byte and sector
+ m_live_state.crc = 0x443b; // value for 1*A1
+
+ write_on_track(encode_hd(m_deleted? 0xf8 : 0xfb), 1, WRITE_SECDATA);
+
+ m_live_state.byte_counter = calc_sector_size();
+
+ // Set the over/underrun flag and hope that it will be cleared before we start writing
+ // (only for sector writing)
+ if (m_substate == DATA_TRANSFER_WRITE)
+ {
+ set_bits(m_register_r[INT_STATUS], ST_OVRUN, true);
+ m_out_dmarq(ASSERT_LINE);
+ }
+ break;
+
+ case WRITE_SECDATA:
+ if (m_substate == DATA_TRANSFER_WRITE)
+ {
+ // Check whether DMA has been acknowledged
+ if ((m_register_r[INT_STATUS] & ST_OVRUN)!=0)
+ {
+ // No, then stop here
+ m_live_state.state= NO_DMA_ACK;
+ }
+ else
+ {
+ if (TRACE_WRITE && TRACE_DETAIL) logerror("%s: Write sector byte, %d to go\n", tag(), m_live_state.byte_counter);
+
+ // For floppies, set this for each byte; for hard disk, set it only at the beginning
+ if (m_live_state.byte_counter == calc_sector_size())
+ m_out_dip(ASSERT_LINE);
+
+ m_register_r[DATA] = m_register_w[DATA] = m_in_dma(0, 0xff);
+
+ if (m_live_state.byte_counter == 0)
+ {
+ m_out_dip(CLEAR_LINE);
+ m_out_dmarq(CLEAR_LINE);
+ }
+
+ if (m_live_state.byte_counter > 0)
+ {
+ m_live_state.byte_counter--;
+ write_on_track(encode_hd(m_register_r[DATA]), 1, WRITE_SECDATA);
+ }
+ else
+ {
+ m_live_state.state = WRITE_DATA_CRC;
+ // TODO: Prepare for ECC; this is "only" CRC
+ m_live_state.byte_counter = 2;
+ }
+ }
+ }
+ else
+ {
+ // We are here in the context of track formatting. Write a
+ // blank sector
+ write_on_track(encode_hd(0xe5), m_sector_size, WRITE_DATA_CRC);
+ m_live_state.byte_counter = 2;
+ }
+ break;
+
+ case WRITE_DATA_CRC:
+ if (m_live_state.byte_counter > 0)
+ {
+ if (TRACE_WRITE && TRACE_DETAIL) logerror("%s: Write CRC\n", tag());
+ m_live_state.byte_counter--;
+ write_on_track(encode_hd((m_live_state.crc >> 8) & 0xff), 1, WRITE_DATA_CRC);
+ }
+ else
+ // Write a filler byte so that the last CRC bit is saved correctly
+ write_on_track(encode_hd(0xff), 1, WRITE_DONE);
+
+ break;
+
+ case WRITE_DONE:
+ if (m_substate == DATA_TRANSFER_WRITE)
+ {
+ if (TRACE_WRITE && TRACE_DETAIL) logerror("%s: Write sector complete\n", tag());
+ m_live_state.state = IDLE;
+ return;
+ }
+ else
+ {
+ // Continue for track writing: Write GAP3
+ m_live_state.state = WRITE_GAP3;
+ }
+ break;
+
+ // ==================================================
+ // Track reading (HD)
+ // ==================================================
+ //
+ // Read the next ID fields, then the sector contents.
+ // Continue until the next index hole shows up (live_abort).
+ case READ_TRACK:
+ if (TRACE_LIVE) logerror("%s: READ_TRACK\n", tag());
+ m_live_state.state = READ_TRACK_ID;
+ break;
+
+ case READ_TRACK_ID:
+ m_live_state.state = SEARCH_IDAM;
+ // Ask for access to bus
+ set_bits(m_register_r[INT_STATUS], ST_OVRUN, true);
+ m_out_dmarq(ASSERT_LINE);
+ break;
+
+ case READ_TRACK_ID_DONE:
+ if ((m_register_r[INT_STATUS] & ST_OVRUN)!=0)
+ {
+ // We need an ACK right now, or the header bytes will be lost
+ if (TRACE_FAIL) logerror("%s: No DMA ACK - buffer overrun\n", tag());
+ set_bits(m_register_r[INT_STATUS], TC_DATAERR, true);
+ m_live_state.state = IDLE;
+ return;
+ }
+ if (TRACE_LIVE) logerror("%s: READ_TRACK_ID_DONE\n", tag());
+ m_out_dip(ASSERT_LINE);
+
+ // Write the header via DMA
+ for (int slot = 0; slot < 6; slot++)
+ m_out_dma(0, m_register_r[id_field[slot]], 0xff);
+
+ // Continue with reading the sector data
+ m_live_state.state = SEARCH_DAM;
+ wait_line(INDEX_LINE, ASSERT_LINE, TRACKDONE, true);
+ break;
+
+
+ // =========== HD formatting =============
+ // Live states for track formatting
+ // Write GAP 1
+ // Per sector
+ // Write Sync+IDAM
+ // Write Sector header+CRC
+ // Write GAP2
+ // Write Sync+DAM
+ // Write Sector data
+ // Write CRC bytes
+ // Write GAP3
+ // Write GAP4 until the next pulse
+ // ==================================================
+ case FORMAT_TRACK:
+ if (TRACE_LIVE) logerror("%s: FORMAT_TRACK\n", tag());
+ m_live_state.state = WRITE_GAP1;
+ break;
+
+ case WRITE_GAP1:
+ // GAP1 length is in DMA15_8
+ if (TRACE_GAPS) logerror("%s: Writing GAP1; size=%d\n", tag(), m_gap1_size);
+ write_on_track(encode_hd(0x4e), m_gap1_size, WRITE_IDAM_SYNC);
+ break;
+
+ case WRITE_IDAM_SYNC:
+ if (TRACE_GAPS) logerror("%s: Writing IDAM sync, size=%d\n", tag(), m_sync_size);
+ write_on_track(encode_hd(0x00), m_sync_size, WRITE_IDAM);
+ break;
+
+ case WRITE_IDAM:
+ // Set the over/underrun flag and hope that it will be cleared before we enter the next state (after writing)
+ set_bits(m_register_r[INT_STATUS], ST_OVRUN, true);
+ m_out_dmarq(ASSERT_LINE);
+ if (TRACE_HEADER) logerror("%s: Writing IDAM and header: ", tag());
+ write_on_track(encode_a1_hd(), 1, WRITE_HEADER);
+ m_live_state.byte_counter = 5; // TODO: Check this for AT mode
+ m_live_state.crc = 0xffff;
+ break;
+
+ case WRITE_HEADER:
+ if ((m_register_r[INT_STATUS] & ST_OVRUN)!=0)
+ // No DMA (we do not get access to the ID table); exit
+ m_live_state.state= NO_DMA_ACK;
+ else
+ {
+ m_out_dip(ASSERT_LINE);
+ m_live_state.byte_counter--;
+ UINT8 headbyte = m_in_dma(0, 0xff);
+ if (TRACE_HEADER) logerror("%02x ", headbyte);
+ write_on_track(encode_hd(headbyte), 1, (m_live_state.byte_counter>0)? WRITE_HEADER : WRITE_HEADER_CRC);
+
+ if (m_live_state.byte_counter==0)
+ {
+ m_out_dip(CLEAR_LINE);
+ m_out_dmarq(CLEAR_LINE);
+ // we will go to WRITE_HEADER_CRC state; set the byte counter for CRC
+ m_live_state.byte_counter = 2;
+ }
+ }
+ break;
+
+ case WRITE_HEADER_CRC:
+ if (m_live_state.byte_counter > 0)
+ {
+ UINT8 crct = (m_live_state.crc >> 8) & 0xff;
+ if (TRACE_HEADER) logerror("%02x ", crct);
+ m_live_state.byte_counter--;
+ write_on_track(encode_hd(crct), 1, WRITE_HEADER_CRC);
+ }
+ else
+ {
+ if (TRACE_HEADER) logerror("\n");
+ m_live_state.state = WRITE_GAP2;
+ }
+ break;
+
+ case WRITE_GAP2:
+ if (TRACE_GAPS) logerror("%s: Writing GAP2, size=%d\n", tag(), m_gap2_size);
+ write_on_track(encode_hd(0x4e), m_gap2_size, WRITE_DAM_SYNC);
+ break;
+
+ case WRITE_GAP3:
+ m_sector_count--;
+ if (TRACE_GAPS) logerror("%s: Writing GAP3, size=%d\n", tag(), m_gap3_size);
+ write_on_track(encode_hd(0x4e), m_gap3_size, (m_sector_count>0)? WRITE_IDAM_SYNC : WRITE_GAP4);
+ break;
+
+ case WRITE_GAP4:
+ // Write bytes up to the end of the track
+ wait_line(INDEX_LINE, ASSERT_LINE, TRACKDONE, true);
+ if (TRACE_GAPS && m_last_live_state != WRITE_GAP4)
+ {
+ logerror("%s: Writing GAP4\n", tag());
+ m_last_live_state = WRITE_GAP4;
+ }
+ // Write a single byte; when the index hole shows up, the live run will be aborted
+ write_on_track(encode_hd(0x4e), 1, WRITE_GAP4);
+ break;
+// --------------------------------------------------------
+
+ default:
+ if (TRACE_LIVE) logerror("%s: Unknown state: %02x\n", tag(), m_live_state.state);
+ break;
}
- return;
}
+ m_last_live_state = UNDEF;
}
/*
@@ -2675,29 +3411,40 @@ void hdc9234_device::live_sync()
if(m_live_state.time > machine().time())
{
// If so, we must roll back to the last checkpoint
- if (TRACE_SYNC) logerror("%s: [%s] Rolling back and replaying (%s)\n", tag(), ttsn().c_str(), tts(m_live_state.time).c_str());
+ if (TRACE_SYNC) logerror("%s: [%s] Rolling back and replaying [%s live]\n", tag(), ttsn().c_str(), tts(m_live_state.time).c_str());
rollback();
+
// and replay until we reach the machine time
- live_run_until(machine().time());
- // Caught up, write on floppy image
- m_pll.commit(m_floppy, m_live_state.time);
+ if (using_floppy())
+ {
+ live_run_until(machine().time());
+ // Caught up, commit bits from pll buffer to disk until live time (if there is something to write)
+ m_pll.commit(m_floppy, m_live_state.time);
+ }
+ else
+ {
+ // HD case
+ live_run_hd_until(machine().time());
+ }
}
else
{
// We are behind machine time, so we will never get back to that
// time, thus we can commit that position
- if (TRACE_SYNC) logerror("%s: [%s] Committing (%s)\n", tag(), ttsn().c_str(), tts(m_live_state.time).c_str());
- // Write on floppy image
- m_pll.commit(m_floppy, m_live_state.time);
+ if (TRACE_SYNC) logerror("%s: [%s] Committing [%s live]\n", tag(), ttsn().c_str(), tts(m_live_state.time).c_str());
+
+ // Commit bits from pll buffer to disk until live time (if there is something to write)
+ if (using_floppy())
+ m_pll.commit(m_floppy, m_live_state.time);
if (m_live_state.next_state != -1)
- {
m_live_state.state = m_live_state.next_state;
- }
if (m_live_state.state == IDLE)
{
- m_pll.stop_writing(m_floppy, m_live_state.time);
+ // Commit until live time and stop
+ if (using_floppy())
+ m_pll.stop_writing(m_floppy, m_live_state.time);
m_live_state.time = attotime::never;
}
}
@@ -2711,12 +3458,13 @@ void hdc9234_device::live_abort()
{
if (!m_live_state.time.is_never() && m_live_state.time > machine().time())
{
- if (TRACE_LIVE) logerror("%s: Abort; rolling back and replaying (%s)\n", ttsn().c_str(), tts(m_live_state.time).c_str());
+ if (TRACE_LIVE) logerror("%s: [%s] Abort; rolling back and replaying [%s live]\n", tag(), ttsn().c_str(), tts(m_live_state.time).c_str());
rollback();
live_run_until(machine().time());
}
- m_pll.stop_writing(m_floppy, m_live_state.time);
+ if (using_floppy()) m_pll.stop_writing(m_floppy, m_live_state.time);
+
m_live_state.time = attotime::never;
m_live_state.state = IDLE;
m_live_state.next_state = -1;
@@ -2750,14 +3498,17 @@ void hdc9234_device::skip_on_track(int repeat, int next_state)
UINT8 hdc9234_device::get_data_from_encoding(UINT16 raw)
{
- return (raw & 0x4000 ? 0x80 : 0x00) |
- (raw & 0x1000 ? 0x40 : 0x00) |
- (raw & 0x0400 ? 0x20 : 0x00) |
- (raw & 0x0100 ? 0x10 : 0x00) |
- (raw & 0x0040 ? 0x08 : 0x00) |
- (raw & 0x0010 ? 0x04 : 0x00) |
- (raw & 0x0004 ? 0x02 : 0x00) |
- (raw & 0x0001 ? 0x01 : 0x00);
+ unsigned int value = 0;
+
+ if (!using_floppy() && (m_hd_encoding == SEPARATED || m_hd_encoding == SEPARATED_SIMPLE)) return raw & 0xff;
+
+ for (int i=0; i < 8; i++)
+ {
+ value <<= 1;
+ value |= (raw & 0x4000);
+ raw <<= 2;
+ }
+ return (value >> 14) & 0xff;
}
void hdc9234_device::rollback()
@@ -2774,7 +3525,7 @@ void hdc9234_device::wait_for_realtime(int state)
{
m_live_state.next_state = state;
m_timer->adjust(m_live_state.time - machine().time());
- if (TRACE_LIVE) logerror("%s: [%s] Waiting for real time [%s] to catch up\n", tag(), tts(m_live_state.time).c_str(), tts(machine().time()).c_str());
+ if (TRACE_LIVE) logerror("%s: [%s live] Waiting for real time [%s] to catch up; next state = %02x\n", tag(), tts(m_live_state.time).c_str(), ttsn().c_str(), state);
}
/*
@@ -2850,16 +3601,17 @@ UINT16 hdc9234_device::encode(UINT8 byte)
bool last_bit_set;
check_pos = 0x80;
+ m_live_state.data_reg = byte;
+ raw = 0;
+
if (fm_mode())
{
- // Set all clock bits
- raw = 0xaaaa;
-
+ raw = 0;
// FM: data bit = 1 -> encode as 11
// data bit = 0 -> encode as 10
for (int i=0; i<8; i++)
{
- if (byte & check_pos) raw |= 0x4000 >> (2*i);
+ raw = (raw << 2) | (((byte & check_pos)!=0)? 0x03 : 0x02);
check_pos >>= 1;
}
last_bit_set = ((byte & 1)!=0);
@@ -2867,40 +3619,27 @@ UINT16 hdc9234_device::encode(UINT8 byte)
else
{
last_bit_set = m_live_state.last_data_bit;
- raw = 0;
+
for (int i=0; i<8; i++)
{
bool bit_set = ((byte & check_pos)!=0);
// MFM: data bit = 1 -> encode as 01
// data bit = 0 -> encode as x0 (x = !last_bit)
- if (bit_set)
- raw |= 0x4000 >> (2*i);
- else
- raw |= (last_bit_set? 0x0000 : 0x8000) >> (2*i);
+ raw <<= 2;
+ if (bit_set) raw |= 1;
+ else
+ {
+ if (!last_bit_set) raw |= 2;
+ }
last_bit_set = bit_set;
check_pos >>= 1;
}
}
- m_live_state.data_reg = byte;
return raw;
}
-/*
- Encode a byte for FM or MFM recording. Result is returned in the
- shift register of m_live_state.
-*/
-void hdc9234_device::encode_byte(UINT8 byte)
-{
- UINT16 raw = encode(byte);
- m_live_state.bit_counter = 16;
- m_live_state.last_data_bit = raw & 1;
- m_live_state.shift_reg = m_live_state.shift_reg_save = raw;
- if (TRACE_WRITE && TRACE_DETAIL) logerror("%s: [%s] Write %02x (%04x)\n", tag(), tts(m_live_state.time).c_str(), byte, raw);
- checkpoint();
-}
-
void hdc9234_device::encode_again()
{
encode_raw(m_live_state.shift_reg_save);
@@ -2911,7 +3650,7 @@ void hdc9234_device::encode_raw(UINT16 raw)
m_live_state.bit_counter = 16;
m_live_state.shift_reg = m_live_state.shift_reg_save = raw;
m_live_state.last_data_bit = raw & 1;
- if (TRACE_WRITE && TRACE_DETAIL) logerror("%s: [%s] Write %02x (%04x)\n", tag(), tts(m_live_state.time).c_str(), get_data_from_encoding(raw), raw);
+ if (TRACE_WRITE && TRACE_DETAIL) logerror("%s: [%s live] Write %02x (%04x)\n", tag(), tts(m_live_state.time).c_str(), get_data_from_encoding(raw), raw);
checkpoint();
}
@@ -2940,14 +3679,209 @@ void hdc9234_device::pll_reset(const attotime &when, bool output)
void hdc9234_device::checkpoint()
{
- // Write on floppy image
- m_pll.commit(m_floppy, m_live_state.time);
+ // Commit bits from pll buffer to disk until live time (if there is something to write)
+ // For HD we do not use a PLL in this implementation
+ if (using_floppy())
+ {
+ m_pll.commit(m_floppy, m_live_state.time);
+ m_checkpoint_pll = m_pll;
+ }
m_checkpoint_state = m_live_state;
- m_checkpoint_pll = m_pll;
}
// ===========================================================================
+// HD support
+/*
+ Read the bit or complete byte from the hard disk at the point of time
+ specified by the time in the live_state.
+ Return true: the time limit has been reached
+ Return false: valid return
+
+ Updates the CRC and the shift register. Also, the time is updated.
+*/
+bool hdc9234_device::read_from_mfmhd(const attotime &limit)
+{
+ UINT16 data = 0;
+ bool offlimit = m_harddisk->read(m_live_state.time, limit, data);
+
+ // We have reached the time limit
+ if (offlimit) return true;
+
+ if (m_hd_encoding == MFM_BITS)
+ {
+ // Push bit into shift register
+ m_live_state.shift_reg = (m_live_state.shift_reg << 1) | data;
+ m_live_state.bit_counter++;
+ // Used for timeout handling
+ m_live_state.bit_count_total++;
+
+ // Clock bit (false) or data bit (true)?
+ if (m_live_state.data_separator_phase==true)
+ {
+ m_live_state.data_reg = (m_live_state.data_reg << 1) | data;
+ // Update CRC
+ if ((m_live_state.crc ^ (data ? 0x8000 : 0x0000)) & 0x8000)
+ m_live_state.crc = (m_live_state.crc << 1) ^ 0x1021;
+ else
+ m_live_state.crc = m_live_state.crc << 1;
+ }
+
+ m_live_state.data_separator_phase = !m_live_state.data_separator_phase;
+ }
+ else
+ {
+ UINT16 separated = data;
+ m_live_state.shift_reg = data;
+
+ if (m_hd_encoding == MFM_BYTE)
+ {
+ for (int i=0; i < 8; i++)
+ {
+ separated <<= 1;
+ if (data & 0x8000) separated |= 0x0100;
+ data <<= 1;
+ if (data & 0x8000) separated |= 0x0001;
+ data <<= 1;
+ }
+ }
+
+ // Push byte into data / clock register
+ m_live_state.clock_reg = (separated >> 8) & 0xff;
+ m_live_state.data_reg = separated & 0xff;
+ m_live_state.bit_counter += 16;
+ // Used for timeout handling
+ m_live_state.bit_count_total += 16;
+
+ // Update CRC
+ m_live_state.crc = ccitt_crc16_one(m_live_state.crc, m_live_state.data_reg);
+ m_live_state.data_separator_phase = false;
+ }
+
+ return false;
+}
+
+/*
+ Write one bit or complete byte from the shift register to the hard disk
+ at the point of time specified by the time in the live_state.
+ Return true: the time limit has been reached
+ Return false: valid return
+ Updates the CRC and the shift register. Also, the time is updated.
+*/
+bool hdc9234_device::write_to_mfmhd(const attotime &limit)
+{
+ UINT16 data = 0;
+ int count;
+ bool offlimit;
+
+ if (m_hd_encoding == MFM_BITS)
+ {
+ data = ((m_live_state.shift_reg & 0x8000)==0)? 0:1;
+ count = 1;
+ }
+ else
+ {
+ // We'll write the complete shift register in one go
+ data = m_live_state.shift_reg;
+ count = 16;
+ }
+ offlimit = m_harddisk->write(m_live_state.time, limit, data);
+ if (offlimit) return true;
+
+ m_live_state.bit_counter -= count;
+
+ // Calculate the CRC
+ if ((m_live_state.bit_counter & 1)==0)
+ {
+ if (m_hd_encoding == MFM_BITS)
+ {
+ if ((m_live_state.crc ^ ((data==0)? 0x8000 : 0x0000)) & 0x8000)
+ m_live_state.crc = (m_live_state.crc << 1) ^ 0x1021;
+ else
+ m_live_state.crc = m_live_state.crc << 1;
+ }
+ else
+ {
+ // Take the data byte from the stored copy in the data_reg
+ m_live_state.crc = ccitt_crc16_one(m_live_state.crc, m_live_state.data_reg);
+ }
+ }
+
+ m_live_state.shift_reg = (m_live_state.shift_reg << count) & 0xffff;
+ return false;
+}
+
+UINT16 hdc9234_device::encode_hd(UINT8 byte)
+{
+ UINT16 cells;
+ UINT8 check_pos;
+ bool last_bit_set;
+ check_pos = 0x80;
+
+ last_bit_set = m_live_state.last_data_bit;
+ cells = 0;
+
+ int databit = (m_hd_encoding==SEPARATED)? 0x0080 : 0x4000;
+ int shift = (m_hd_encoding==SEPARATED)? 1 : 2;
+ int clockbit = 0x8000;
+
+ if (m_hd_encoding != SEPARATED_SIMPLE)
+ {
+ for (int i=0; i<8; i++)
+ {
+ bool bit_set = ((byte & check_pos)!=0);
+
+ // MFM: data bit = 1 -> encode as 01
+ // data bit = 0 -> encode as x0 (x = !last_bit)
+
+ if (bit_set)
+ cells |= databit;
+ else
+ cells |= (last_bit_set? 0x0000 : clockbit);
+
+ databit >>= shift;
+ clockbit >>= shift;
+
+ last_bit_set = bit_set;
+ check_pos >>= 1;
+ }
+ }
+ else
+ {
+ cells = byte & 0x00ff;
+ }
+
+ m_live_state.data_reg = byte;
+ return cells;
+}
+
+UINT16 hdc9234_device::encode_a1_hd()
+{
+ UINT16 cells = 0;
+
+ switch (m_hd_encoding)
+ {
+ case MFM_BITS:
+ case MFM_BYTE:
+ cells = 0x4489;
+ break;
+ case SEPARATED:
+ cells = 0x0aa1;
+ break;
+ case SEPARATED_SIMPLE:
+ cells = 0xffa1;
+ break;
+ }
+
+ m_live_state.last_data_bit = true;
+ m_live_state.data_reg = 0xa1;
+ m_live_state.bit_counter = 16;
+ return cells;
+}
+
+
+// ===========================================================================
+
/*
Read a byte of data from the controller
The address (offset) encodes the C/D* line (command and /data)
@@ -3074,6 +4008,7 @@ void hdc9234_device::process_command()
void hdc9234_device::reenter_command_processing()
{
+ if (TRACE_DELAY) logerror("%s: Re-enter command processing; live state = %02x\n", tag(), m_live_state.state);
// Do we have a live run on the track?
if (m_live_state.state != IDLE)
{
@@ -3085,6 +4020,7 @@ void hdc9234_device::reenter_command_processing()
// We're here when there is no live_run anymore
// Where were we last time?
// Take care not to restart commands because of the index callback
+ if (TRACE_DELAY) logerror("%s: Continue with substate %02x\n", tag(), m_substate);
if (m_executing && m_substate != UNDEF) (this->*m_command)();
auxbus_out();
}
@@ -3184,31 +4120,36 @@ void hdc9234_device::auxbus_in(UINT8 data)
(data&HDC_DS_SKCOM)? 1:0, (data&HDC_DS_TRK00)? 1:0,
(data&HDC_DS_UDEF)? 1:0, (data&HDC_DS_WRPROT)? 1:0,
(data&HDC_DS_READY)? 1:0, (data&HDC_DS_WRFAULT)? 1:0);
- UINT8 prev = m_register_r[DRIVE_STATUS];
+
+ bool previndex = index_hole();
+ bool prevready = drive_ready();
+ bool prevskcom = seek_complete();
+
m_register_r[DRIVE_STATUS] = data;
- if ((prev & HDC_DS_INDEX) != (data & HDC_DS_INDEX))
- {
- // Check whether index value changed
- index_callback((data & HDC_DS_INDEX)? ASSERT_LINE : CLEAR_LINE);
- }
+ // Call a handler if the respective flag changed
+ if (previndex != index_hole()) index_handler();
+ if (prevready != drive_ready()) ready_handler();
+ if (prevskcom != seek_complete()) seek_complete_handler();
+}
- if ((prev & HDC_DS_READY) != (data & HDC_DS_READY))
- {
- // Check whether ready value changed
- ready_callback((data & HDC_DS_READY)? ASSERT_LINE : CLEAR_LINE);
- }
+bool hdc9234_device::waiting_for_line(int line, int level)
+{
+ return (m_event_line == line && m_state_after_line != UNDEF && m_line_level == level);
+}
- if ((prev & HDC_DS_SKCOM) != (data & HDC_DS_SKCOM))
- {
- // Check whether seek complete value changed
- seek_complete_callback((data & HDC_DS_SKCOM)? ASSERT_LINE : CLEAR_LINE);
- }
+bool hdc9234_device::waiting_for_other_line(int line)
+{
+ return (m_state_after_line != UNDEF && m_event_line != line);
}
-void hdc9234_device::index_callback(int level)
+/*
+ Handlers for incoming signal lines.
+*/
+void hdc9234_device::index_handler()
{
- if (TRACE_LINES) logerror("%s: [%s] Index callback level=%d\n", tag(), ttsn().c_str(), level);
+ int level = index_hole()? ASSERT_LINE : CLEAR_LINE;
+ if (TRACE_LINES) logerror("%s: [%s] Index handler; level=%d\n", tag(), ttsn().c_str(), level);
// Synchronize our position on the track
live_sync();
@@ -3219,24 +4160,31 @@ void hdc9234_device::index_callback(int level)
if (m_wait_for_index) m_stop_after_index = true;
}
- if (m_event_line == INDEX_LINE && level == m_line_level && m_state_after_line != UNDEF)
+ if (waiting_for_line(INDEX_LINE, level))
{
if (TRACE_LINES) logerror("%s: [%s] Index pulse level=%d triggers event\n", tag(), ttsn().c_str(), level);
m_substate = m_state_after_line;
m_state_after_line = UNDEF;
if (m_stopwrite)
{
- m_pll.stop_writing(m_floppy, m_live_state.time);
+ if (using_floppy()) m_pll.stop_writing(m_floppy, m_live_state.time);
m_live_state.state = IDLE;
}
+ reenter_command_processing();
+ }
+ else
+ {
+ // Live processing waits for INDEX
+ // For harddisk we will continue processing on the falling edge
+ if (!waiting_for_other_line(INDEX_LINE) && (using_floppy() || level == CLEAR_LINE))
+ reenter_command_processing();
}
-
- reenter_command_processing();
}
-void hdc9234_device::ready_callback(int level)
+void hdc9234_device::ready_handler()
{
- if (TRACE_LINES) logerror("%s: [%s] Ready callback level=%d\n", tag(), ttsn().c_str(), level);
+ int level = drive_ready()? ASSERT_LINE : CLEAR_LINE;
+ if (TRACE_LINES) logerror("%s: [%s] Ready handler; level=%d\n", tag(), ttsn().c_str(), level);
// Set the interrupt status flag
set_bits(m_register_r[INT_STATUS], ST_RDYCHNG, true);
@@ -3251,7 +4199,8 @@ void hdc9234_device::ready_callback(int level)
set_interrupt(ASSERT_LINE);
}
- if (m_event_line == READY_LINE && level == m_line_level && m_state_after_line != UNDEF)
+ // This is actually not needed, since we never wait for READY
+ if (waiting_for_line(READY_LINE, level))
{
m_substate = m_state_after_line;
m_state_after_line = UNDEF;
@@ -3259,14 +4208,15 @@ void hdc9234_device::ready_callback(int level)
}
}
-void hdc9234_device::seek_complete_callback(int level)
+void hdc9234_device::seek_complete_handler()
{
- if (TRACE_LINES) logerror("%s: [%s] Seek complete callback level=%d\n", tag(), ttsn().c_str(), level);
+ int level = seek_complete()? ASSERT_LINE : CLEAR_LINE;
+ if (TRACE_LINES) logerror("%s: [%s] Seek complete handler; level=%d\n", tag(), ttsn().c_str(), level);
// Synchronize our position on the track
live_sync();
- if (m_event_line == SEEKCOMP_LINE && level == m_line_level && m_state_after_line != UNDEF)
+ if (waiting_for_line(SEEKCOMP_LINE, level))
{
m_substate = m_state_after_line;
m_state_after_line = UNDEF;
@@ -3382,6 +4332,8 @@ void hdc9234_device::connect_floppy_drive(floppy_image_device* floppy)
void hdc9234_device::connect_hard_drive(mfm_harddisk_device* harddisk)
{
m_harddisk = harddisk;
+ m_hd_encoding = m_harddisk->get_encoding();
+ if (TRACE_SELECT && TRACE_DETAIL) logerror("%s: HD encoding = %d\n", tag(), m_hd_encoding);
}
/*
@@ -3451,10 +4403,12 @@ void hdc9234_device::device_reset()
m_deleted = false;
m_executing = false;
m_event_line = UNDEF;
+ m_first_sector_found = false;
m_initialized = true;
m_line_level = CLEAR_LINE;
m_live_state.state = IDLE;
m_live_state.time = attotime::never;
+ m_logical = true;
m_multi_sector = false;
m_output1 = 0;
m_output2 = 0x80;
diff --git a/src/emu/machine/hdc9234.h b/src/emu/machine/hdc9234.h
index 8317545c552..5398e32a099 100644
--- a/src/emu/machine/hdc9234.h
+++ b/src/emu/machine/hdc9234.h
@@ -173,10 +173,16 @@ private:
// Timer callback
void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
- // Callbacks
- void ready_callback(int level);
- void index_callback(int level);
- void seek_complete_callback(int level);
+ // Handlers for incoming signals
+ void ready_handler();
+ void index_handler();
+ void seek_complete_handler();
+
+ // Wait for this line?
+ bool waiting_for_line(int line, int level);
+
+ // Wait for some other line?
+ bool waiting_for_other_line(int line);
// Wait for some time to pass or for a line to change level
void wait_time(emu_timer *tm, int microsec, int next_substate);
@@ -212,6 +218,7 @@ private:
int byte_counter;
bool data_separator_phase;
bool last_data_bit;
+ UINT8 clock_reg;
UINT8 data_reg;
int state;
int next_state;
@@ -241,11 +248,14 @@ private:
void rollback();
void checkpoint();
+ // Found a mark
+ bool found_mark(int state);
+
// Delivers the data bits from the given encoding
UINT8 get_data_from_encoding(UINT16 raw);
// ==============================================
- // PLL functions and interface to floppy
+ // PLL functions and interface to floppy and harddisk
// ==============================================
// Phase-locked loops
@@ -254,13 +264,12 @@ private:
// Clock divider value
UINT8 m_clock_divider;
+ // MFM HD encoding type
+ mfmhd_enc_t m_hd_encoding;
+
// Resets the PLL to the given time
void pll_reset(const attotime &when, bool write);
- // Encodes the byte using FM or MFM. Changes the m_live_state members
- // shift_reg, data_reg, and last_data_bit
- void encode_byte(UINT8 byte);
-
// Puts the word into the shift register directly. Changes the m_live_state members
// shift_reg, and last_data_bit
void encode_raw(UINT16 word);
@@ -268,6 +277,10 @@ private:
// Encodes a byte in FM or MFM. Called by encode_byte.
UINT16 encode(UINT8 byte);
+ // Encodes a byte in FM or MFM. Called by encode_byte.
+ UINT16 encode_hd(UINT8 byte);
+ UINT16 encode_a1_hd();
+
// Encode the latest byte again
void encode_again();
@@ -283,6 +296,12 @@ private:
// Skips bytes on the track
void skip_on_track(int count, int next_state);
+ // Read from the MFM HD
+ bool read_from_mfmhd(const attotime &limit);
+
+ // Write to the MFM HD
+ bool write_to_mfmhd(const attotime &limit);
+
// ==============================================
// Command state machine
// ==============================================
@@ -353,9 +372,15 @@ private:
// Used in RESTORE to find out when to give up
int m_seek_count;
+ // Read/write logical or physical?
+ bool m_logical;
+
// Signals to abort writing
bool m_stopwrite;
+ // Flag to remember whether we found the first sector during a physical access
+ bool m_first_sector_found;
+
// Used for formatting
int m_sector_count;
int m_sector_size;
@@ -368,6 +393,21 @@ private:
// Are we in FM mode?
bool fm_mode();
+ // Seek completed?
+ bool seek_complete();
+
+ // Are we on track 0?
+ bool on_track00();
+
+ // Are we at the index hole?
+ bool index_hole();
+
+ // Is the attached drive ready?
+ bool drive_ready();
+
+ // Are we reading a track?
+ bool reading_track();
+
// Delivers the desired head
int desired_head();
@@ -398,18 +438,12 @@ private:
// Sector size as read from the track
int calc_sector_size();
- // Are we on track 0?
- bool on_track00();
-
- // Are we using rapid steps (needed to decide to wait for seek complete)
- bool rapid_steps();
-
// Is the currently selected drive a floppy drive?
bool using_floppy();
// Common subprograms READ ID, VERIFY, and DATA TRANSFER
void read_id(int& cont, bool implied_seek, bool wait_seek_complete);
- void verify(int& cont, bool verify_all);
+ void verify(int& cont);
void data_transfer(int& cont);
// ===================================================
diff --git a/src/emu/machine/i8255.c b/src/emu/machine/i8255.c
index acaef0f372a..7725565cde2 100644
--- a/src/emu/machine/i8255.c
+++ b/src/emu/machine/i8255.c
@@ -44,7 +44,7 @@ enum
enum
{
MODE_OUTPUT = 0,
- MODE_INPUT,
+ MODE_INPUT
};
diff --git a/src/emu/machine/i8257.c b/src/emu/machine/i8257.c
index f6616de3a61..23abcc3915c 100644
--- a/src/emu/machine/i8257.c
+++ b/src/emu/machine/i8257.c
@@ -53,7 +53,7 @@ enum
STATE_S2,
STATE_S3,
STATE_SW,
- STATE_S4,
+ STATE_S4
};
diff --git a/src/emu/machine/idehd.c b/src/emu/machine/idehd.c
index ffb9a026ea8..aa5517a1a3e 100644
--- a/src/emu/machine/idehd.c
+++ b/src/emu/machine/idehd.c
@@ -12,7 +12,9 @@
#define LOGPRINT(x) do { if (VERBOSE) logerror x; if (PRINTF_IDE_COMMANDS) osd_printf_debug x; } while (0)
-#define TIME_PER_SECTOR (attotime::from_usec(100))
+#define TIME_PER_SECTOR_WRITE (attotime::from_usec(100))
+/* read time <2 breaks primrag2, ==100 breaks bm1stmix */
+#define TIME_PER_SECTOR_READ (attotime::from_usec(2))
#define TIME_PER_ROTATION (attotime::from_hz(5400/60))
#define TIME_BETWEEN_SECTORS (attotime::from_nsec(400))
@@ -393,8 +395,7 @@ void ata_mass_storage_device::fill_buffer()
if (m_sector_count > 0)
{
set_dasp(ASSERT_LINE);
-
- start_busy(TIME_BETWEEN_SECTORS, PARAM_COMMAND);
+ start_busy(TIME_PER_SECTOR_READ, PARAM_COMMAND);
}
break;
}
@@ -519,13 +520,13 @@ void ata_mass_storage_device::process_buffer()
else
{
/* set a timer to do the write */
- start_busy(TIME_PER_SECTOR, PARAM_COMMAND);
+ start_busy(TIME_PER_SECTOR_WRITE, PARAM_COMMAND);
}
}
else
{
/* set a timer to do the write */
- start_busy(TIME_PER_SECTOR, PARAM_COMMAND);
+ start_busy(TIME_PER_SECTOR_WRITE, PARAM_COMMAND);
}
}
}
diff --git a/src/emu/machine/idehd.h b/src/emu/machine/idehd.h
index 0c999a76fd2..beacb0a25c4 100644
--- a/src/emu/machine/idehd.h
+++ b/src/emu/machine/idehd.h
@@ -107,7 +107,7 @@ protected:
enum
{
- TID_NULL = TID_BUSY + 1,
+ TID_NULL = TID_BUSY + 1
};
private:
diff --git a/src/emu/machine/ins8250.h b/src/emu/machine/ins8250.h
index a369f05c9b4..9415c2b70ce 100644
--- a/src/emu/machine/ins8250.h
+++ b/src/emu/machine/ins8250.h
@@ -56,7 +56,7 @@ protected:
TYPE_INS8250A,
TYPE_NS16450,
TYPE_NS16550,
- TYPE_NS16550A,
+ TYPE_NS16550A
};
int m_device_type;
struct {
diff --git a/src/emu/machine/k053252.c b/src/emu/machine/k053252.c
index 70f0ee20bf4..1cea029d38d 100644
--- a/src/emu/machine/k053252.c
+++ b/src/emu/machine/k053252.c
@@ -84,12 +84,21 @@ k053252_device::k053252_device(const machine_config &mconfig, const char *tag, d
void k053252_device::device_start()
{
- save_item(NAME(m_regs));
m_int1_en_cb.resolve_safe();
m_int2_en_cb.resolve_safe();
m_int1_ack_cb.resolve_safe();
m_int2_ack_cb.resolve_safe();
//m_int_time_cb.resolve_safe();
+
+ save_item(NAME(m_regs));
+ save_item(NAME(m_hc));
+ save_item(NAME(m_hfp));
+ save_item(NAME(m_hbp));
+ save_item(NAME(m_vc));
+ save_item(NAME(m_vfp));
+ save_item(NAME(m_vbp));
+ save_item(NAME(m_vsw));
+ save_item(NAME(m_hsw));
}
//-------------------------------------------------
diff --git a/src/emu/machine/mc146818.h b/src/emu/machine/mc146818.h
index d07b78eea4a..3db19ec533e 100644
--- a/src/emu/machine/mc146818.h
+++ b/src/emu/machine/mc146818.h
@@ -113,7 +113,7 @@ private:
REG_B_UIE = 16,
REG_B_AIE = 32,
REG_B_PIE = 64,
- REG_B_SET = 128,
+ REG_B_SET = 128
};
enum
diff --git a/src/emu/machine/mc68681.c b/src/emu/machine/mc68681.c
index be9d65c3546..8b40488de24 100644
--- a/src/emu/machine/mc68681.c
+++ b/src/emu/machine/mc68681.c
@@ -174,7 +174,7 @@ void mc68681_device::update_interrupts()
write_irq(CLEAR_LINE);
m_read_vector = false; // clear IACK too
}
-};
+}
double mc68681_device::duart68681_get_ct_rate()
{
@@ -286,7 +286,7 @@ TIMER_CALLBACK_MEMBER( mc68681_device::duart_timer_callback )
duart68681_start_ct(0xffff);
}
-};
+}
READ8_MEMBER( mc68681_device::read )
{
@@ -630,7 +630,7 @@ int mc68681_device::calc_baud(int ch, UINT8 data)
}
return baud_rate;
-};
+}
void mc68681_device::clear_ISR_bits(int mask)
{
@@ -901,7 +901,7 @@ UINT8 mc68681_channel::read_rx_fifo()
// printf("Rx read %02x\n", rv);
return rv;
-};
+}
UINT8 mc68681_channel::read_chan_reg(int reg)
{
@@ -976,7 +976,7 @@ void mc68681_channel::write_MR(UINT8 data)
}
recalc_framing();
update_interrupts();
-};
+}
void mc68681_channel::recalc_framing()
{
@@ -1114,7 +1114,7 @@ void mc68681_channel::write_CR(UINT8 data)
}
update_interrupts();
-};
+}
void mc68681_channel::write_TX(UINT8 data)
{
@@ -1139,7 +1139,7 @@ void mc68681_channel::write_TX(UINT8 data)
transmit_register_setup(tx_data);
update_interrupts();
-};
+}
void mc68681_channel::ACR_updated()
{
diff --git a/src/emu/machine/mcf5206e.c b/src/emu/machine/mcf5206e.c
index d63937b621c..d993c7235e4 100644
--- a/src/emu/machine/mcf5206e.c
+++ b/src/emu/machine/mcf5206e.c
@@ -275,63 +275,61 @@ inline void mcf5206e_peripheral_device::CSCR_w(int which, int offset, UINT16 dat
-
-
-READ16_MEMBER( mcf5206e_peripheral_device::CSAR0_r) { return CSAR_r(0, offset, mem_mask); };
-WRITE16_MEMBER( mcf5206e_peripheral_device::CSAR0_w) { CSAR_w(0, offset, data, mem_mask); };
-READ32_MEMBER( mcf5206e_peripheral_device::CSMR0_r) { return CSMR_r(0, mem_mask); };
-WRITE32_MEMBER( mcf5206e_peripheral_device::CSMR0_w) { CSMR_w(0, data, mem_mask); };
-READ16_MEMBER( mcf5206e_peripheral_device::CSCR0_r) { return CSCR_r(0, offset, mem_mask); };
-WRITE16_MEMBER( mcf5206e_peripheral_device::CSCR0_w) { CSCR_w(0, offset, data, mem_mask); };
-
-READ16_MEMBER( mcf5206e_peripheral_device::CSAR1_r) { return CSAR_r(1, offset, mem_mask); };
-WRITE16_MEMBER( mcf5206e_peripheral_device::CSAR1_w) { CSAR_w(1, offset, data, mem_mask); };
-READ32_MEMBER( mcf5206e_peripheral_device::CSMR1_r) { return CSMR_r(1, mem_mask); };
-WRITE32_MEMBER( mcf5206e_peripheral_device::CSMR1_w) { CSMR_w(1, data, mem_mask); };
-READ16_MEMBER( mcf5206e_peripheral_device::CSCR1_r) { return CSCR_r(1, offset, mem_mask); };
-WRITE16_MEMBER( mcf5206e_peripheral_device::CSCR1_w) { CSCR_w(1, offset, data, mem_mask); };
-
-READ16_MEMBER( mcf5206e_peripheral_device::CSAR2_r) { return CSAR_r(2, offset, mem_mask); };
-WRITE16_MEMBER( mcf5206e_peripheral_device::CSAR2_w) { CSAR_w(2, offset, data, mem_mask); };
-READ32_MEMBER( mcf5206e_peripheral_device::CSMR2_r) { return CSMR_r(2, mem_mask); };
-WRITE32_MEMBER( mcf5206e_peripheral_device::CSMR2_w) { CSMR_w(2, data, mem_mask); };
-READ16_MEMBER( mcf5206e_peripheral_device::CSCR2_r) { return CSCR_r(2, offset, mem_mask); };
-WRITE16_MEMBER( mcf5206e_peripheral_device::CSCR2_w) { CSCR_w(2, offset, data, mem_mask); };
-
-READ16_MEMBER( mcf5206e_peripheral_device::CSAR3_r) { return CSAR_r(3, offset, mem_mask); };
-WRITE16_MEMBER( mcf5206e_peripheral_device::CSAR3_w) { CSAR_w(3, offset, data, mem_mask); };
-READ32_MEMBER( mcf5206e_peripheral_device::CSMR3_r) { return CSMR_r(3, mem_mask); };
-WRITE32_MEMBER( mcf5206e_peripheral_device::CSMR3_w) { CSMR_w(3, data, mem_mask); };
-READ16_MEMBER( mcf5206e_peripheral_device::CSCR3_r) { return CSCR_r(3, offset, mem_mask); };
-WRITE16_MEMBER( mcf5206e_peripheral_device::CSCR3_w) { CSCR_w(3, offset, data, mem_mask); };
-
-READ16_MEMBER( mcf5206e_peripheral_device::CSAR4_r) { return CSAR_r(4, offset, mem_mask); };
-WRITE16_MEMBER( mcf5206e_peripheral_device::CSAR4_w) { CSAR_w(4, offset, data, mem_mask); };
-READ32_MEMBER( mcf5206e_peripheral_device::CSMR4_r) { return CSMR_r(4, mem_mask); };
-WRITE32_MEMBER( mcf5206e_peripheral_device::CSMR4_w) { CSMR_w(4, data, mem_mask); };
-READ16_MEMBER( mcf5206e_peripheral_device::CSCR4_r) { return CSCR_r(4, offset, mem_mask); };
-WRITE16_MEMBER( mcf5206e_peripheral_device::CSCR4_w) { CSCR_w(4, offset, data, mem_mask); };
-
-READ16_MEMBER( mcf5206e_peripheral_device::CSAR5_r) { return CSAR_r(5, offset, mem_mask); };
-WRITE16_MEMBER( mcf5206e_peripheral_device::CSAR5_w) { CSAR_w(5, offset, data, mem_mask); };
-READ32_MEMBER( mcf5206e_peripheral_device::CSMR5_r) { return CSMR_r(5, mem_mask); };
-WRITE32_MEMBER( mcf5206e_peripheral_device::CSMR5_w) { CSMR_w(5, data, mem_mask); };
-READ16_MEMBER( mcf5206e_peripheral_device::CSCR5_r) { return CSCR_r(5, offset, mem_mask); };
-WRITE16_MEMBER( mcf5206e_peripheral_device::CSCR5_w) { CSCR_w(5, offset, data, mem_mask); };
-
-READ16_MEMBER( mcf5206e_peripheral_device::CSAR6_r) { return CSAR_r(6, offset, mem_mask); };
-WRITE16_MEMBER( mcf5206e_peripheral_device::CSAR6_w) { CSAR_w(6, offset, data, mem_mask); };
-READ32_MEMBER( mcf5206e_peripheral_device::CSMR6_r) { return CSMR_r(6, mem_mask); };
-WRITE32_MEMBER( mcf5206e_peripheral_device::CSMR6_w) { CSMR_w(6, data, mem_mask); };
-READ16_MEMBER( mcf5206e_peripheral_device::CSCR6_r) { return CSCR_r(6, offset, mem_mask); };
-WRITE16_MEMBER( mcf5206e_peripheral_device::CSCR6_w) { CSCR_w(6, offset, data, mem_mask); };
-
-READ16_MEMBER( mcf5206e_peripheral_device::CSAR7_r) { return CSAR_r(7, offset, mem_mask); };
-WRITE16_MEMBER( mcf5206e_peripheral_device::CSAR7_w) { CSAR_w(7, offset, data, mem_mask); };
-READ32_MEMBER( mcf5206e_peripheral_device::CSMR7_r) { return CSMR_r(7, mem_mask); };
-WRITE32_MEMBER( mcf5206e_peripheral_device::CSMR7_w) { CSMR_w(7, data, mem_mask); };
-READ16_MEMBER( mcf5206e_peripheral_device::CSCR7_r) { return CSCR_r(7, offset, mem_mask); };
-WRITE16_MEMBER( mcf5206e_peripheral_device::CSCR7_w) { CSCR_w(7, offset, data, mem_mask); };
+READ16_MEMBER( mcf5206e_peripheral_device::CSAR0_r) { return CSAR_r(0, offset, mem_mask); }
+WRITE16_MEMBER( mcf5206e_peripheral_device::CSAR0_w) { CSAR_w(0, offset, data, mem_mask); }
+READ32_MEMBER( mcf5206e_peripheral_device::CSMR0_r) { return CSMR_r(0, mem_mask); }
+WRITE32_MEMBER( mcf5206e_peripheral_device::CSMR0_w) { CSMR_w(0, data, mem_mask); }
+READ16_MEMBER( mcf5206e_peripheral_device::CSCR0_r) { return CSCR_r(0, offset, mem_mask); }
+WRITE16_MEMBER( mcf5206e_peripheral_device::CSCR0_w) { CSCR_w(0, offset, data, mem_mask); }
+
+READ16_MEMBER( mcf5206e_peripheral_device::CSAR1_r) { return CSAR_r(1, offset, mem_mask); }
+WRITE16_MEMBER( mcf5206e_peripheral_device::CSAR1_w) { CSAR_w(1, offset, data, mem_mask); }
+READ32_MEMBER( mcf5206e_peripheral_device::CSMR1_r) { return CSMR_r(1, mem_mask); }
+WRITE32_MEMBER( mcf5206e_peripheral_device::CSMR1_w) { CSMR_w(1, data, mem_mask); }
+READ16_MEMBER( mcf5206e_peripheral_device::CSCR1_r) { return CSCR_r(1, offset, mem_mask); }
+WRITE16_MEMBER( mcf5206e_peripheral_device::CSCR1_w) { CSCR_w(1, offset, data, mem_mask); }
+
+READ16_MEMBER( mcf5206e_peripheral_device::CSAR2_r) { return CSAR_r(2, offset, mem_mask); }
+WRITE16_MEMBER( mcf5206e_peripheral_device::CSAR2_w) { CSAR_w(2, offset, data, mem_mask); }
+READ32_MEMBER( mcf5206e_peripheral_device::CSMR2_r) { return CSMR_r(2, mem_mask); }
+WRITE32_MEMBER( mcf5206e_peripheral_device::CSMR2_w) { CSMR_w(2, data, mem_mask); }
+READ16_MEMBER( mcf5206e_peripheral_device::CSCR2_r) { return CSCR_r(2, offset, mem_mask); }
+WRITE16_MEMBER( mcf5206e_peripheral_device::CSCR2_w) { CSCR_w(2, offset, data, mem_mask); }
+
+READ16_MEMBER( mcf5206e_peripheral_device::CSAR3_r) { return CSAR_r(3, offset, mem_mask); }
+WRITE16_MEMBER( mcf5206e_peripheral_device::CSAR3_w) { CSAR_w(3, offset, data, mem_mask); }
+READ32_MEMBER( mcf5206e_peripheral_device::CSMR3_r) { return CSMR_r(3, mem_mask); }
+WRITE32_MEMBER( mcf5206e_peripheral_device::CSMR3_w) { CSMR_w(3, data, mem_mask); }
+READ16_MEMBER( mcf5206e_peripheral_device::CSCR3_r) { return CSCR_r(3, offset, mem_mask); }
+WRITE16_MEMBER( mcf5206e_peripheral_device::CSCR3_w) { CSCR_w(3, offset, data, mem_mask); }
+
+READ16_MEMBER( mcf5206e_peripheral_device::CSAR4_r) { return CSAR_r(4, offset, mem_mask); }
+WRITE16_MEMBER( mcf5206e_peripheral_device::CSAR4_w) { CSAR_w(4, offset, data, mem_mask); }
+READ32_MEMBER( mcf5206e_peripheral_device::CSMR4_r) { return CSMR_r(4, mem_mask); }
+WRITE32_MEMBER( mcf5206e_peripheral_device::CSMR4_w) { CSMR_w(4, data, mem_mask); }
+READ16_MEMBER( mcf5206e_peripheral_device::CSCR4_r) { return CSCR_r(4, offset, mem_mask); }
+WRITE16_MEMBER( mcf5206e_peripheral_device::CSCR4_w) { CSCR_w(4, offset, data, mem_mask); }
+
+READ16_MEMBER( mcf5206e_peripheral_device::CSAR5_r) { return CSAR_r(5, offset, mem_mask); }
+WRITE16_MEMBER( mcf5206e_peripheral_device::CSAR5_w) { CSAR_w(5, offset, data, mem_mask); }
+READ32_MEMBER( mcf5206e_peripheral_device::CSMR5_r) { return CSMR_r(5, mem_mask); }
+WRITE32_MEMBER( mcf5206e_peripheral_device::CSMR5_w) { CSMR_w(5, data, mem_mask); }
+READ16_MEMBER( mcf5206e_peripheral_device::CSCR5_r) { return CSCR_r(5, offset, mem_mask); }
+WRITE16_MEMBER( mcf5206e_peripheral_device::CSCR5_w) { CSCR_w(5, offset, data, mem_mask); }
+
+READ16_MEMBER( mcf5206e_peripheral_device::CSAR6_r) { return CSAR_r(6, offset, mem_mask); }
+WRITE16_MEMBER( mcf5206e_peripheral_device::CSAR6_w) { CSAR_w(6, offset, data, mem_mask); }
+READ32_MEMBER( mcf5206e_peripheral_device::CSMR6_r) { return CSMR_r(6, mem_mask); }
+WRITE32_MEMBER( mcf5206e_peripheral_device::CSMR6_w) { CSMR_w(6, data, mem_mask); }
+READ16_MEMBER( mcf5206e_peripheral_device::CSCR6_r) { return CSCR_r(6, offset, mem_mask); }
+WRITE16_MEMBER( mcf5206e_peripheral_device::CSCR6_w) { CSCR_w(6, offset, data, mem_mask); }
+
+READ16_MEMBER( mcf5206e_peripheral_device::CSAR7_r) { return CSAR_r(7, offset, mem_mask); }
+WRITE16_MEMBER( mcf5206e_peripheral_device::CSAR7_w) { CSAR_w(7, offset, data, mem_mask); }
+READ32_MEMBER( mcf5206e_peripheral_device::CSMR7_r) { return CSMR_r(7, mem_mask); }
+WRITE32_MEMBER( mcf5206e_peripheral_device::CSMR7_w) { CSMR_w(7, data, mem_mask); }
+READ16_MEMBER( mcf5206e_peripheral_device::CSCR7_r) { return CSCR_r(7, offset, mem_mask); }
+WRITE16_MEMBER( mcf5206e_peripheral_device::CSCR7_w) { CSCR_w(7, offset, data, mem_mask); }
READ16_MEMBER( mcf5206e_peripheral_device::DMCR_r)
diff --git a/src/emu/machine/microtch.c b/src/emu/machine/microtch.c
index ae85e59217b..eee87447495 100644
--- a/src/emu/machine/microtch.c
+++ b/src/emu/machine/microtch.c
@@ -268,7 +268,7 @@ void microtouch_device::rcv_complete()
m_tx_buffer[m_tx_buffer_num++] = 0x0d;
m_rx_buffer_ptr = 0;
}
-};
+}
INPUT_CHANGED_MEMBER( microtouch_device::touch )
{
diff --git a/src/emu/machine/mm58274c.c b/src/emu/machine/mm58274c.c
index bc1b27daede..0690f775b5d 100644
--- a/src/emu/machine/mm58274c.c
+++ b/src/emu/machine/mm58274c.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Raphael Nabet
/***************************************************************************
@@ -147,7 +147,7 @@ attotime mm58274c_device::interrupt_period_table(int val)
case 7: return attotime::from_seconds(60);
default: fatalerror("out of range\n");
}
-};
+}
READ8_MEMBER( mm58274c_device::read )
{
diff --git a/src/emu/machine/mm58274c.h b/src/emu/machine/mm58274c.h
index 729e1a65fad..225340721ea 100644
--- a/src/emu/machine/mm58274c.h
+++ b/src/emu/machine/mm58274c.h
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Raphael Nabet
#ifndef __MM58274C_H__
#define __MM58274C_H__
diff --git a/src/emu/machine/mos6526.c b/src/emu/machine/mos6526.c
index e65070d3d67..3d9561b36f7 100644
--- a/src/emu/machine/mos6526.c
+++ b/src/emu/machine/mos6526.c
@@ -809,12 +809,18 @@ READ8_MEMBER( mos6526_device::read )
switch (offset & 0x0f)
{
case PRA:
- data = (m_read_pa(0) & ~m_ddra) | (m_pra & m_ddra);
+ if (m_ddra != 0xff)
+ data = (m_read_pa(0) & ~m_ddra) | (m_pra & m_ddra);
+ else
+ data = m_read_pa(0) & m_pra;
m_pa_in = data;
break;
case PRB:
- data = (m_read_pb(0) & ~m_ddrb) | (m_prb & m_ddrb);
+ if (m_ddrb != 0xff)
+ data = (m_read_pb(0) & ~m_ddrb) | (m_prb & m_ddrb);
+ else
+ data = m_read_pb(0) & m_prb;
m_pb_in = data;
if (CRA_PBON)
diff --git a/src/emu/machine/ncr5380n.h b/src/emu/machine/ncr5380n.h
index f7e007d7641..e9a142d78e5 100644
--- a/src/emu/machine/ncr5380n.h
+++ b/src/emu/machine/ncr5380n.h
@@ -115,7 +115,7 @@ private:
INIT_XFR_WAIT_REQ,
INIT_CPT_RECV_BYTE_ACK,
INIT_CPT_RECV_WAIT_REQ,
- INIT_CPT_RECV_BYTE_NACK,
+ INIT_CPT_RECV_BYTE_NACK
};
enum {
@@ -134,13 +134,13 @@ private:
SEND_WAIT_REQ_0,
RECV_WAIT_REQ_1,
RECV_WAIT_SETTLE,
- RECV_WAIT_REQ_0,
+ RECV_WAIT_REQ_0
};
enum {
STATE_MASK = 0x00ff,
SUB_SHIFT = 8,
- SUB_MASK = 0xff00,
+ SUB_MASK = 0xff00
};
enum { BUS_BUSY, BUS_FREE_WAIT, BUS_FREE };
@@ -182,7 +182,7 @@ private:
MODE_EOPIRQ = 0x08,
MODE_BSYIRQ = 0x04,
MODE_DMA = 0x02,
- MODE_ARBITRATE = 0x01,
+ MODE_ARBITRATE = 0x01
};
enum { DMA_NONE, DMA_IN, DMA_OUT };
diff --git a/src/emu/machine/ncr5390.h b/src/emu/machine/ncr5390.h
index b51db080048..93cf76a5486 100644
--- a/src/emu/machine/ncr5390.h
+++ b/src/emu/machine/ncr5390.h
@@ -107,7 +107,7 @@ private:
INIT_XFR_WAIT_REQ,
INIT_CPT_RECV_BYTE_ACK,
INIT_CPT_RECV_WAIT_REQ,
- INIT_CPT_RECV_BYTE_NACK,
+ INIT_CPT_RECV_BYTE_NACK
};
enum {
@@ -126,13 +126,13 @@ private:
SEND_WAIT_REQ_0,
RECV_WAIT_REQ_1,
RECV_WAIT_SETTLE,
- RECV_WAIT_REQ_0,
+ RECV_WAIT_REQ_0
};
enum {
STATE_MASK = 0x00ff,
SUB_SHIFT = 8,
- SUB_MASK = 0xff00,
+ SUB_MASK = 0xff00
};
enum { BUS_BUSY, BUS_FREE_WAIT, BUS_FREE };
@@ -177,7 +177,7 @@ private:
CI_COMPLETE = 0x11,
CI_MSG_ACCEPT = 0x12,
CI_PAD = 0x18,
- CI_SET_ATN = 0x1a,
+ CI_SET_ATN = 0x1a
};
enum { DMA_NONE, DMA_IN, DMA_OUT };
diff --git a/src/emu/machine/netlist.c b/src/emu/machine/netlist.c
index 125f34c9f33..8db7fa3feb4 100644
--- a/src/emu/machine/netlist.c
+++ b/src/emu/machine/netlist.c
@@ -13,6 +13,7 @@
#include "netlist/nl_base.h"
#include "netlist/nl_setup.h"
#include "netlist/nl_factory.h"
+#include "netlist/nl_parser.h"
#include "netlist/devices/net_lib.h"
#include "debugger.h"
@@ -62,8 +63,8 @@ void netlist_mame_analog_input_t::static_set_name(device_t &device, const char *
void netlist_mame_analog_input_t::device_start()
{
LOG_DEV_CALLS(("start %s\n", tag()));
- netlist_param_t *p = this->nl_owner().setup().find_param(m_param_name);
- m_param = dynamic_cast<netlist_param_double_t *>(p);
+ netlist::param_t *p = this->nl_owner().setup().find_param(m_param_name);
+ m_param = dynamic_cast<netlist::param_double_t *>(p);
if (m_param == NULL)
{
fatalerror("device %s wrong parameter type for %s\n", basetag(), m_param_name.cstr());
@@ -94,12 +95,12 @@ void netlist_mame_analog_output_t::static_set_params(device_t &device, const cha
netlist.m_delegate = adelegate;
}
-void netlist_mame_analog_output_t::custom_netlist_additions(netlist_setup_t &setup)
+void netlist_mame_analog_output_t::custom_netlist_additions(netlist::setup_t &setup)
{
pstring dname = "OUT_" + m_in;
m_delegate.bind_relative_to(owner()->machine().root_device());
NETLIB_NAME(analog_callback) *dev = downcast<NETLIB_NAME(analog_callback) *>(
- setup.register_dev("nld_analog_callback", dname));
+ setup.register_dev("NETDEV_CALLBACK", dname));
dev->register_callback(m_delegate);
setup.register_link(dname + ".IN", m_in);
@@ -136,8 +137,8 @@ void netlist_mame_logic_input_t::static_set_params(device_t &device, const char
void netlist_mame_logic_input_t::device_start()
{
LOG_DEV_CALLS(("start %s\n", tag()));
- netlist_param_t *p = downcast<netlist_mame_device_t *>(this->owner())->setup().find_param(m_param_name);
- m_param = dynamic_cast<netlist_param_int_t *>(p);
+ netlist::param_t *p = downcast<netlist_mame_device_t *>(this->owner())->setup().find_param(m_param_name);
+ m_param = dynamic_cast<netlist::param_int_t *>(p);
if (m_param == NULL)
{
fatalerror("device %s wrong parameter type for %s\n", basetag(), m_param_name.cstr());
@@ -168,11 +169,11 @@ void netlist_mame_stream_input_t::device_start()
LOG_DEV_CALLS(("start %s\n", tag()));
}
-void netlist_mame_stream_input_t::custom_netlist_additions(netlist_setup_t &setup)
+void netlist_mame_stream_input_t::custom_netlist_additions(netlist::setup_t &setup)
{
NETLIB_NAME(sound_in) *snd_in = setup.netlist().get_first_device<NETLIB_NAME(sound_in)>();
if (snd_in == NULL)
- snd_in = dynamic_cast<NETLIB_NAME(sound_in) *>(setup.register_dev("nld_sound_in", "STREAM_INPUT"));
+ snd_in = dynamic_cast<NETLIB_NAME(sound_in) *>(setup.register_dev("NETDEV_SOUND_IN", "STREAM_INPUT"));
pstring sparam = pstring::sprintf("STREAM_INPUT.CHAN%d", m_channel);
setup.register_param(sparam, m_param_name);
@@ -206,13 +207,13 @@ void netlist_mame_stream_output_t::device_start()
LOG_DEV_CALLS(("start %s\n", tag()));
}
-void netlist_mame_stream_output_t::custom_netlist_additions(netlist_setup_t &setup)
+void netlist_mame_stream_output_t::custom_netlist_additions(netlist::setup_t &setup)
{
//NETLIB_NAME(sound_out) *snd_out;
pstring sname = pstring::sprintf("STREAM_OUT_%d", m_channel);
//snd_out = dynamic_cast<NETLIB_NAME(sound_out) *>(setup.register_dev("nld_sound_out", sname));
- setup.register_dev("nld_sound_out", sname);
+ setup.register_dev("NETDEV_SOUND_OUT", sname);
setup.register_param(sname + ".CHAN" , m_channel);
setup.register_param(sname + ".MULT", m_mult);
@@ -256,7 +257,7 @@ netlist_mame_device_t::netlist_mame_device_t(const machine_config &mconfig, cons
m_icount(0),
m_div(0),
m_rem(0),
- m_old(netlist_time::zero),
+ m_old(netlist::netlist_time::zero),
m_netlist(NULL),
m_setup(NULL),
m_setup_func(NULL)
@@ -268,14 +269,14 @@ netlist_mame_device_t::netlist_mame_device_t(const machine_config &mconfig, devi
m_icount(0),
m_div(0),
m_rem(0),
- m_old(netlist_time::zero),
+ m_old(netlist::netlist_time::zero),
m_netlist(NULL),
m_setup(NULL),
m_setup_func(NULL)
{
}
-void netlist_mame_device_t::static_set_constructor(device_t &device, void (*setup_func)(netlist_setup_t &))
+void netlist_mame_device_t::static_set_constructor(device_t &device, void (*setup_func)(netlist::setup_t &))
{
LOG_DEV_CALLS(("static_set_constructor\n"));
netlist_mame_device_t &netlist = downcast<netlist_mame_device_t &>(device);
@@ -293,8 +294,8 @@ void netlist_mame_device_t::device_start()
//printf("clock is %d\n", clock());
- m_netlist = global_alloc_clear(netlist_mame_t(*this));
- m_setup = global_alloc_clear(netlist_setup_t(*m_netlist));
+ m_netlist = global_alloc(netlist_mame_t(*this));
+ m_setup = global_alloc(netlist::setup_t(m_netlist));
netlist().init_object(*m_netlist, "netlist");
m_setup->init();
@@ -324,7 +325,7 @@ void netlist_mame_device_t::device_start()
save_state();
- m_old = netlist_time::zero;
+ m_old = netlist::netlist_time::zero;
m_rem = 0;
}
@@ -332,7 +333,7 @@ void netlist_mame_device_t::device_start()
void netlist_mame_device_t::device_clock_changed()
{
//printf("device_clock_changed\n");
- m_div = netlist_time::from_hz(clock()).as_raw();
+ m_div = netlist::netlist_time::from_hz(clock()).as_raw();
//m_rem = 0;
//NL_VERBOSE_OUT(("Setting clock %" I64FMT "d and divisor %d\n", clock(), m_div));
NL_VERBOSE_OUT(("Setting clock %d and divisor %d\n", clock(), m_div));
@@ -343,7 +344,7 @@ void netlist_mame_device_t::device_clock_changed()
void netlist_mame_device_t::device_reset()
{
LOG_DEV_CALLS(("device_reset\n"));
- m_old = netlist_time::zero;
+ m_old = netlist::netlist_time::zero;
m_rem = 0;
netlist().do_reset();
}
@@ -382,7 +383,7 @@ void netlist_mame_device_t::device_timer(emu_timer &timer, device_timer_id id, i
ATTR_HOT ATTR_ALIGN void netlist_mame_device_t::update_time_x()
{
- const netlist_time delta = netlist().time() - m_old + netlist_time::from_raw(m_rem);
+ const netlist::netlist_time delta = netlist().time() - m_old + netlist::netlist_time::from_raw(m_rem);
m_old = netlist().time();
m_icount -= divu_64x32_rem(delta.as_raw(), m_div, &m_rem);
}
@@ -458,7 +459,7 @@ void netlist_mame_cpu_device_t::device_start()
{
netlist_mame_device_t::device_start();
- LOG_DEV_CALLS(("device_start %s\n", tag()));
+ LOG_DEV_CALLS(("cpu device_start %s\n", tag()));
// State support
@@ -466,14 +467,14 @@ void netlist_mame_cpu_device_t::device_start()
for (int i=0; i < netlist().m_nets.size(); i++)
{
- netlist_net_t *n = netlist().m_nets[i];
- if (n->isFamily(netlist_object_t::LOGIC))
+ netlist::net_t *n = netlist().m_nets[i];
+ if (n->isFamily(netlist::object_t::LOGIC))
{
- state_add(i*2, n->name(), downcast<netlist_logic_net_t *>(n)->Q_state_ptr());
+ state_add(i*2, n->name(), downcast<netlist::logic_net_t *>(n)->Q_state_ptr());
}
else
{
- state_add(i*2+1, n->name(), downcast<netlist_analog_net_t *>(n)->Q_Analog_state_ptr()).formatstr("%20s");
+ state_add(i*2+1, n->name(), downcast<netlist::analog_net_t *>(n)->Q_Analog_state_ptr()).formatstr("%20s");
}
}
@@ -528,13 +529,13 @@ ATTR_HOT void netlist_mame_cpu_device_t::execute_run()
m_genPC++;
m_genPC &= 255;
debugger_instruction_hook(this, m_genPC);
- netlist().process_queue(netlist_time::from_raw(m_div));
+ netlist().process_queue(netlist::netlist_time::from_raw(m_div));
update_time_x();
}
}
else
{
- netlist().process_queue(netlist_time::from_raw(m_div) * m_icount);
+ netlist().process_queue(netlist::netlist_time::from_raw(m_div) * m_icount);
update_time_x();
}
}
@@ -549,12 +550,11 @@ netlist_mame_sound_device_t::netlist_mame_sound_device_t(const machine_config &m
{
}
-
void netlist_mame_sound_device_t::device_start()
{
netlist_mame_device_t::device_start();
- LOG_DEV_CALLS(("device_start %s\n", tag()));
+ LOG_DEV_CALLS(("sound device_start %s\n", tag()));
// Configure outputs
@@ -575,7 +575,7 @@ void netlist_mame_sound_device_t::device_start()
if (chan < 0 || chan >= MAX_OUT || chan >= outdevs.size())
fatalerror("illegal channel number");
m_out[chan] = outdevs[i];
- m_out[chan]->m_sample = netlist_time::from_hz(clock());
+ m_out[chan]->m_sample = netlist::netlist_time::from_hz(clock());
m_out[chan]->m_buffer = NULL;
}
@@ -591,7 +591,7 @@ void netlist_mame_sound_device_t::device_start()
{
m_in = indevs[0];
m_num_inputs = m_in->resolve();
- m_in->m_inc = netlist_time::from_hz(clock());
+ m_in->m_inc = netlist::netlist_time::from_hz(clock());
}
/* initialize the stream(s) */
@@ -621,11 +621,11 @@ void netlist_mame_sound_device_t::sound_stream_update(sound_stream &stream, stre
m_in->m_buffer[i] = inputs[i];
}
- netlist_time cur = netlist().time();
+ netlist::netlist_time cur = netlist().time();
- netlist().process_queue(netlist_time::from_raw(m_div) * samples);
+ netlist().process_queue(netlist::netlist_time::from_raw(m_div) * samples);
- cur += (netlist_time::from_raw(m_div) * samples);
+ cur += (netlist::netlist_time::from_raw(m_div) * samples);
for (int i=0; i < m_num_outputs; i++)
{
@@ -633,3 +633,14 @@ void netlist_mame_sound_device_t::sound_stream_update(sound_stream &stream, stre
m_out[i]->buffer_reset(cur);
}
}
+
+// ----------------------------------------------------------------------------------------
+// memregion source support
+// ----------------------------------------------------------------------------------------
+
+bool netlist_source_memregion_t::parse(netlist::setup_t *setup, const pstring name)
+{
+ const char *mem = (const char *)downcast<netlist_mame_t &>(setup->netlist()).machine().root_device().memregion(m_name.cstr())->base();
+ netlist::parser_t p(*setup);
+ return p.parse(mem, name);
+}
diff --git a/src/emu/machine/netlist.h b/src/emu/machine/netlist.h
index c6e8e2ce396..ed93abbed3d 100644
--- a/src/emu/machine/netlist.h
+++ b/src/emu/machine/netlist.h
@@ -28,7 +28,7 @@
netlist_mame_analog_input_t::static_set_name(*device, _name);
#define MCFG_NETLIST_ANALOG_MULT_OFFSET(_mult, _offset) \
- netlist_mame_analog_input_t::static_set_mult_offset(*device, _mult, _offset);
+ netlist_mame_sub_interface::static_set_mult_offset(*device, _mult, _offset);
#define MCFG_NETLIST_ANALOG_OUTPUT(_basetag, _tag, _IN, _class, _member, _class_tag) \
MCFG_DEVICE_ADD(_basetag ":" _tag, NETLIST_ANALOG_OUTPUT, 0) \
@@ -60,20 +60,33 @@
// Extensions to interface netlist with MAME code ....
// ----------------------------------------------------------------------------------------
-#define NETLIST_MEMREGION(_name) \
- setup.parse((char *)downcast<netlist_mame_t &>(setup.netlist()).machine().root_device().memregion(_name)->base());
+class netlist_source_memregion_t : public netlist::setup_t::source_t
+{
+public:
+ netlist_source_memregion_t(pstring name)
+ : netlist::setup_t::source_t(), m_name(name)
+ {
+ }
+
+ bool parse(netlist::setup_t *setup, const pstring name);
+private:
+ pstring m_name;
+};
+
+#define MEMREGION_SOURCE(_name) \
+ setup.register_source(palloc(netlist_source_memregion_t(_name)));
#define NETDEV_ANALOG_CALLBACK_MEMBER(_name) \
void _name(const double data, const attotime &time)
class netlist_mame_device_t;
-class netlist_mame_t : public netlist_base_t
+class netlist_mame_t : public netlist::netlist_t
{
public:
netlist_mame_t(netlist_mame_device_t &parent)
- : netlist_base_t(),
+ : netlist::netlist_t(),
m_parent(parent)
{}
virtual ~netlist_mame_t() { };
@@ -103,12 +116,12 @@ public:
netlist_mame_device_t(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *file);
virtual ~netlist_mame_device_t() {}
- static void static_set_constructor(device_t &device, void (*setup_func)(netlist_setup_t &));
+ static void static_set_constructor(device_t &device, void (*setup_func)(netlist::setup_t &));
- ATTR_HOT inline netlist_setup_t &setup() { return *m_setup; }
+ ATTR_HOT inline netlist::setup_t &setup() { return *m_setup; }
ATTR_HOT inline netlist_mame_t &netlist() { return *m_netlist; }
- ATTR_HOT inline netlist_time last_time_update() { return m_old; }
+ ATTR_HOT inline netlist::netlist_time last_time_update() { return m_old; }
ATTR_HOT void update_time_x();
ATTR_HOT void check_mame_abort_slice();
@@ -137,12 +150,12 @@ private:
/* timing support here - so sound can hijack it ... */
UINT32 m_rem;
- netlist_time m_old;
+ netlist::netlist_time m_old;
netlist_mame_t * m_netlist;
- netlist_setup_t * m_setup;
+ netlist::setup_t * m_setup;
- void (*m_setup_func)(netlist_setup_t &);
+ void (*m_setup_func)(netlist::setup_t &);
};
inline running_machine &netlist_mame_t::machine()
@@ -166,7 +179,7 @@ public:
netlist_mame_cpu_device_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
virtual ~netlist_mame_cpu_device_t() {}
- static void static_set_constructor(device_t &device, void (*setup_func)(netlist_setup_t &));
+ static void static_set_constructor(device_t &device, void (*setup_func)(netlist::setup_t &));
protected:
// netlist_mame_device_t
@@ -243,7 +256,7 @@ public:
netlist_mame_sound_device_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
virtual ~netlist_mame_sound_device_t() {}
- static void static_set_constructor(device_t &device, void (*setup_func)(netlist_setup_t &));
+ static void static_set_constructor(device_t &device, void (*setup_func)(netlist::setup_t &));
inline sound_stream *get_stream() { return m_stream; }
@@ -293,7 +306,7 @@ public:
}
virtual ~netlist_mame_sub_interface() { }
- virtual void custom_netlist_additions(netlist_setup_t &setup) { }
+ virtual void custom_netlist_additions(netlist::setup_t &setup) { }
inline netlist_mame_device_t &nl_owner() const { return *m_owner; }
@@ -362,7 +375,7 @@ protected:
virtual void device_start();
private:
- netlist_param_double_t *m_param;
+ netlist::param_double_t *m_param;
bool m_auto_port;
pstring m_param_name;
};
@@ -387,7 +400,7 @@ public:
protected:
// device-level overrides
virtual void device_start();
- virtual void custom_netlist_additions(netlist_setup_t &setup);
+ virtual void custom_netlist_additions(netlist::setup_t &setup);
private:
pstring m_in;
@@ -412,16 +425,9 @@ public:
inline void write(const UINT32 val)
{
- if (is_sound_device())
- {
- update_to_current_time();
- m_param->setTo((val >> m_shift) & m_mask);
- }
- else
- {
- // FIXME: use device timer ....
- m_param->setTo((val >> m_shift) & m_mask);
- }
+ const UINT32 v = (val >> m_shift) & m_mask;
+ if (v != m_param->Value())
+ synchronize(0, v);
}
inline DECLARE_INPUT_CHANGED_MEMBER(input_changed) { write(newval); }
@@ -434,9 +440,15 @@ public:
protected:
// device-level overrides
virtual void device_start();
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
+ {
+ if (is_sound_device())
+ update_to_current_time();
+ m_param->setTo(param);
+ }
private:
- netlist_param_int_t *m_param;
+ netlist::param_int_t *m_param;
UINT32 m_mask;
UINT32 m_shift;
pstring m_param_name;
@@ -460,7 +472,7 @@ public:
protected:
// device-level overrides
virtual void device_start();
- virtual void custom_netlist_additions(netlist_setup_t &setup);
+ virtual void custom_netlist_additions(netlist::setup_t &setup);
private:
UINT32 m_channel;
pstring m_param_name;
@@ -484,7 +496,7 @@ public:
protected:
// device-level overrides
virtual void device_start();
- virtual void custom_netlist_additions(netlist_setup_t &setup);
+ virtual void custom_netlist_additions(netlist::setup_t &setup);
private:
UINT32 m_channel;
pstring m_out_name;
@@ -493,11 +505,11 @@ private:
// netdev_callback
// ----------------------------------------------------------------------------------------
-class NETLIB_NAME(analog_callback) : public netlist_device_t
+class NETLIB_NAME(analog_callback) : public netlist::device_t
{
public:
NETLIB_NAME(analog_callback)()
- : netlist_device_t(), m_cpu_device(NULL), m_last(0) { }
+ : device_t(), m_cpu_device(NULL), m_last(0) { }
ATTR_COLD void start()
{
@@ -532,7 +544,7 @@ public:
}
private:
- netlist_analog_input_t m_in;
+ netlist::analog_input_t m_in;
netlist_analog_output_delegate m_callback;
netlist_mame_cpu_device_t *m_cpu_device;
nl_double m_last;
@@ -542,11 +554,11 @@ private:
// sound_out
// ----------------------------------------------------------------------------------------
-class NETLIB_NAME(sound_out) : public netlist_device_t
+class NETLIB_NAME(sound_out) : public netlist::device_t
{
public:
NETLIB_NAME(sound_out)()
- : netlist_device_t() { }
+ : netlist::device_t() { }
static const int BUFSIZE = 2048;
@@ -556,63 +568,71 @@ public:
register_param("CHAN", m_channel, 0);
register_param("MULT", m_mult, 1000.0);
register_param("OFFSET", m_offset, 0.0);
- m_sample = netlist_time::from_hz(1); //sufficiently big enough
+ m_sample = netlist::netlist_time::from_hz(1); //sufficiently big enough
save(NAME(m_last_buffer));
}
ATTR_COLD void reset()
{
- m_cur = 0;
+ m_cur = 0.0;
m_last_pos = 0;
- m_last_buffer = netlist_time::zero;
+ m_last_buffer = netlist::netlist_time::zero;
}
- ATTR_HOT void sound_update(const netlist_time upto)
+ ATTR_HOT void sound_update(const netlist::netlist_time upto)
{
int pos = (upto - m_last_buffer) / m_sample;
if (pos >= BUFSIZE)
netlist().error("sound %s: exceeded BUFSIZE\n", name().cstr());
while (m_last_pos < pos )
{
- m_buffer[m_last_pos++] = m_cur;
+ m_buffer[m_last_pos++] = (stream_sample_t) m_cur;
}
}
ATTR_HOT void update()
{
- nl_double val = INPANALOG(m_in);
+ nl_double val = INPANALOG(m_in) * m_mult.Value() + m_offset.Value();
sound_update(netlist().time());
- m_cur = (stream_sample_t) (val * m_mult.Value() + m_offset.Value());
+ /* ignore spikes */
+ if (std::abs(val) < 32767.0)
+ m_cur = val;
+ else if (val > 0.0)
+ m_cur = 32767.0;
+ else
+ m_cur = -32767.0;
+
}
- ATTR_HOT void buffer_reset(netlist_time upto)
+ ATTR_HOT void buffer_reset(netlist::netlist_time upto)
{
m_last_pos = 0;
m_last_buffer = upto;
+ m_cur = 0.0;
}
- netlist_param_int_t m_channel;
- netlist_param_double_t m_mult;
- netlist_param_double_t m_offset;
+ netlist::param_int_t m_channel;
+ netlist::param_double_t m_mult;
+ netlist::param_double_t m_offset;
stream_sample_t *m_buffer;
- netlist_time m_sample;
+ netlist::netlist_time m_sample;
private:
- netlist_analog_input_t m_in;
- stream_sample_t m_cur;
+ netlist::analog_input_t m_in;
+ double m_cur;
int m_last_pos;
- netlist_time m_last_buffer;
+ netlist::netlist_time m_last_buffer;
};
// ----------------------------------------------------------------------------------------
// sound_in
// ----------------------------------------------------------------------------------------
-class NETLIB_NAME(sound_in) : public netlist_device_t
+class NETLIB_NAME(sound_in) : public netlist::device_t
{
public:
NETLIB_NAME(sound_in)()
- : netlist_device_t() { }
+ : netlist::device_t() { }
static const int MAX_INPUT_CHANNELS = 10;
@@ -622,8 +642,8 @@ public:
register_output("Q", m_Q);
register_input("FB", m_feedback);
- connect(m_feedback, m_Q);
- m_inc = netlist_time::from_nsec(1);
+ connect_late(m_feedback, m_Q);
+ m_inc = netlist::netlist_time::from_nsec(1);
for (int i = 0; i < MAX_INPUT_CHANNELS; i++)
@@ -652,7 +672,7 @@ public:
if (i != m_num_channel)
netlist().error("sound input numbering has to be sequential!");
m_num_channel++;
- m_param[i] = dynamic_cast<netlist_param_double_t *>(setup().find_param(m_param_name[i].Value(), true));
+ m_param[i] = dynamic_cast<netlist::param_double_t *>(setup().find_param(m_param_name[i].Value(), true));
}
}
return m_num_channel;
@@ -664,7 +684,7 @@ public:
{
if (m_buffer[i] == NULL)
break; // stop, called outside of stream_update
- nl_double v = m_buffer[i][m_pos];
+ const nl_double v = m_buffer[i][m_pos];
m_param[i]->setTo(v * m_param_mult[i].Value() + m_param_offset[i].Value());
}
m_pos++;
@@ -676,16 +696,16 @@ public:
m_pos = 0;
}
- netlist_param_str_t m_param_name[MAX_INPUT_CHANNELS];
- netlist_param_double_t *m_param[MAX_INPUT_CHANNELS];
+ netlist::param_str_t m_param_name[MAX_INPUT_CHANNELS];
+ netlist::param_double_t *m_param[MAX_INPUT_CHANNELS];
stream_sample_t *m_buffer[MAX_INPUT_CHANNELS];
- netlist_param_double_t m_param_mult[MAX_INPUT_CHANNELS];
- netlist_param_double_t m_param_offset[MAX_INPUT_CHANNELS];
- netlist_time m_inc;
+ netlist::param_double_t m_param_mult[MAX_INPUT_CHANNELS];
+ netlist::param_double_t m_param_offset[MAX_INPUT_CHANNELS];
+ netlist::netlist_time m_inc;
private:
- netlist_logic_input_t m_feedback;
- netlist_logic_output_t m_Q;
+ netlist::logic_input_t m_feedback;
+ netlist::logic_output_t m_Q;
int m_pos;
int m_num_channel;
diff --git a/src/emu/machine/nmc9306.c b/src/emu/machine/nmc9306.c
index d32c88bea01..0b23eda21d7 100644
--- a/src/emu/machine/nmc9306.c
+++ b/src/emu/machine/nmc9306.c
@@ -35,7 +35,7 @@ enum
EWDS = 0, // erase/write disable
WRAL, // write all registers
ERAL, // erase all registers
- EWEN, // erase/write enable
+ EWEN // erase/write enable
};
// states
diff --git a/src/emu/machine/nscsi_bus.h b/src/emu/machine/nscsi_bus.h
index 51bf11ec74c..2aa4a57db7e 100644
--- a/src/emu/machine/nscsi_bus.h
+++ b/src/emu/machine/nscsi_bus.h
@@ -83,7 +83,7 @@ public:
S_PHASE_STATUS = S_CTL|S_INP,
S_PHASE_MSG_OUT = S_MSG|S_CTL,
S_PHASE_MSG_IN = S_MSG|S_CTL|S_INP,
- S_PHASE_MASK = S_MSG|S_CTL|S_INP,
+ S_PHASE_MASK = S_MSG|S_CTL|S_INP
};
nscsi_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
@@ -117,7 +117,7 @@ protected:
SS_INT_CONDITION_MET = 0x14,
SS_RESV_CONFLICT = 0x18,
SS_TERMINATED = 0x22,
- SS_QUEUE_FULL = 0x28,
+ SS_QUEUE_FULL = 0x28
};
// SCSI commands
@@ -238,7 +238,7 @@ protected:
SC_PLAY_CD = 0xbc,
SC_MECHANISM_STATUS = 0xbd,
SC_READ_CD = 0xbe,
- SC_SEND_DVD_STRUCTURE = 0xbf,
+ SC_SEND_DVD_STRUCTURE = 0xbf
};
// SCSI Messages
@@ -264,12 +264,12 @@ protected:
SM_SIMPLE_QUEUE = 0x20,
SM_HEAD_QUEUE = 0x21,
SM_ORDERED_QUEUE = 0x22,
- SM_IGNORE_WIDE_RES = 0x23,
+ SM_IGNORE_WIDE_RES = 0x23
};
enum {
SBUF_MAIN,
- SBUF_SENSE,
+ SBUF_SENSE
};
UINT8 scsi_cmdbuf[4096], scsi_sense_buffer[8];
@@ -359,7 +359,7 @@ protected:
private:
enum {
- IDLE,
+ IDLE
};
enum {
@@ -370,20 +370,20 @@ private:
TARGET_WAIT_MSG_BYTE,
TARGET_WAIT_CMD_BYTE,
TARGET_WAIT_DATA_IN_BYTE,
- TARGET_WAIT_DATA_OUT_BYTE,
+ TARGET_WAIT_DATA_OUT_BYTE
};
enum {
RECV_BYTE_T_WAIT_ACK_0 = 1,
RECV_BYTE_T_WAIT_ACK_1,
SEND_BYTE_T_WAIT_ACK_0,
- SEND_BYTE_T_WAIT_ACK_1,
+ SEND_BYTE_T_WAIT_ACK_1
};
enum {
STATE_MASK = 0x00ff,
SUB_SHIFT = 8,
- SUB_MASK = 0xff00,
+ SUB_MASK = 0xff00
};
enum {
@@ -393,7 +393,7 @@ private:
BC_MESSAGE_2,
BC_DATA_IN,
BC_DATA_OUT,
- BC_BUS_FREE,
+ BC_BUS_FREE
};
struct control {
diff --git a/src/emu/machine/pit8253.c b/src/emu/machine/pit8253.c
index fe160d6d25a..ebd243899fc 100644
--- a/src/emu/machine/pit8253.c
+++ b/src/emu/machine/pit8253.c
@@ -1091,7 +1091,7 @@ void pit8253_device::set_clockin(int timerno, double new_clockin)
pit8253_timer *timer = get_timer(timerno);
assert(timer != NULL);
- LOG2(("pit8253_set_clockin(): PIT timer=%d, clockin = %lf\n", timerno, new_clockin));
+ LOG2(("pit8253_set_clockin(): PIT timer=%d, clockin = %f\n", timerno, new_clockin));
update(timer);
timer->clockin = new_clockin;
diff --git a/src/emu/machine/rtc65271.c b/src/emu/machine/rtc65271.c
index 0e5b8802754..074b8d87f48 100644
--- a/src/emu/machine/rtc65271.c
+++ b/src/emu/machine/rtc65271.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Raphael Nabet, R. Belmont
/*
rtc65271 emulation
diff --git a/src/emu/machine/rtc65271.h b/src/emu/machine/rtc65271.h
index 326ccf7d116..b81e92755d5 100644
--- a/src/emu/machine/rtc65271.h
+++ b/src/emu/machine/rtc65271.h
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Raphael Nabet, R. Belmont
/*
rtc65271.h: include file for rtc65271.c
diff --git a/src/emu/machine/rtc9701.h b/src/emu/machine/rtc9701.h
index 88f6bee0e96..eaad28ad0b5 100644
--- a/src/emu/machine/rtc9701.h
+++ b/src/emu/machine/rtc9701.h
@@ -34,7 +34,7 @@ enum rtc9701_state_t
RTC9701_RTC_WRITE,
RTC9701_EEPROM_READ,
RTC9701_EEPROM_WRITE,
- RTC9701_AFTER_WRITE_ENABLE,
+ RTC9701_AFTER_WRITE_ENABLE
};
diff --git a/src/emu/machine/saturn.c b/src/emu/machine/saturn.c
index f2bb7afd53f..a9ad0638c68 100644
--- a/src/emu/machine/saturn.c
+++ b/src/emu/machine/saturn.c
@@ -4,7 +4,7 @@
Sega Saturn (c) 1994 Sega
- List of things that needs to be implemented:
+ @todo List of things that needs to be implemented:
- There's definitely an ack mechanism in SCU irqs. This is almost surely done via
the ISM register (i.e. going 0->1 to the given bit acks it).
- There might be a delay to exactly when SCU irqs happens. This is due to the basic
@@ -38,7 +38,8 @@
H counter value 0x0ec (236) -> 0xe0
H counter value 0x12c (300) -> 0x100
- Timer 1 seems to count backwards compared to Timer 0 from setting 0x6b onward.
-
+ - Yabause claims that if VDP2 DISP bit isn't enabled then vblank irqs (hblank too?)
+ doesn't happen.
**************************************************************************************/
diff --git a/src/emu/machine/smc92x4.c b/src/emu/machine/smc92x4.c
deleted file mode 100644
index 6a87f8b4bf6..00000000000
--- a/src/emu/machine/smc92x4.c
+++ /dev/null
@@ -1,2011 +0,0 @@
-// license:???
-// copyright-holders:Raphael Nabet, Michael Zapf
-/*
- HDC9224 and HDC9234 Hard and Floppy Disk Controller
-
- This controller handles MFM and FM encoded floppy disks and hard disks.
- The SMC9224 is used in some DEC systems. The HDC9234 is used in the
- Myarc HFDC card for the TI99/4a. The main difference between the two
- chips is the way the ECC bytes are computed; there are differences in
- the way seek times are computed, too.
-
- References:
- * SMC HDC9234 preliminary data book (1988)
-
- Michael Zapf, April 2010
-
- First version by Raphael Nabet, 2003
-*/
-
-#include "emu.h"
-#include "smc92x4.h"
-
-/***************************************************************************
- TYPE DEFINITIONS
-***************************************************************************/
-
-/*
- Definition of bits in the status register
-*/
-#define ST_INTPEND 0x80 /* interrupt pending */
-#define ST_DMAREQ 0x40 /* DMA request */
-#define ST_DONE 0x20 /* command done */
-#define ST_TERMCOD 0x18 /* termination code (see below) */
-#define ST_RDYCHNG 0x04 /* ready change */
-#define ST_OVRUN 0x02 /* overrun/underrun */
-#define ST_BADSECT 0x01 /* bad sector */
-
-/*
- Definition of the termination codes (INT_STATUS)
-*/
-#define ST_TC_SUCCESS 0x00 /* Successful completion */
-#define ST_TC_RDIDERR 0x08 /* Error in READ-ID sequence */
-#define ST_TC_SEEKERR 0x10 /* Error in SEEK sequence */
-#define ST_TC_DATAERR 0x18 /* Error in DATA-TRANSFER seq. */
-
-
-/*
- Definition of bits in the Termination-Conditions register
-*/
-#define TC_CRCPRE 0x80 /* CRC register preset, must be 1 */
-#define TC_UNUSED 0x40 /* bit 6 is not used and must be 0 */
-#define TC_INTDONE 0x20 /* interrupt on done */
-#define TC_TDELDAT 0x10 /* terminate on deleted data */
-#define TC_TDSTAT3 0x08 /* terminate on drive status 3 change */
-#define TC_TWPROT 0x04 /* terminate on write-protect (FDD only) */
-#define TC_INTRDCH 0x02 /* interrupt on ready change (FDD only) */
-#define TC_TWRFLT 0x01 /* interrupt on write-fault (HDD only) */
-
-/*
- Definition of bits in the Chip-Status register
-*/
-#define CS_RETREQ 0x80 /* retry required */
-#define CS_ECCATT 0x40 /* ECC correction attempted */
-#define CS_CRCERR 0x20 /* ECC/CRC error */
-#define CS_DELDATA 0x10 /* deleted data mark */
-#define CS_SYNCERR 0x08 /* synchronization error */
-#define CS_COMPERR 0x04 /* compare error */
-#define CS_PRESDRV 0x03 /* present drive selected */
-
-/*
- Definition of bits in the Mode register
-*/
-#define MO_TYPE 0x80 /* Hard disk (1) or floppy (0) */
-#define MO_CRCECC 0x60 /* Values for CRC/ECC handling */
-#define MO_DENSITY 0x10 /* FM = 1; MFM = 0 */
-#define MO_UNUSED 0x08 /* Unused, 0 */
-#define MO_STEPRATE 0x07 /* Step rates */
-
-/*
- hfdc state structure
-
- status
- ab7 ecc error
- ab6 index pulse
- ab5 seek complete
- ab4 track 0
- ab3 user-defined
- ab2 write-protected
- ab1 drive ready
- ab0 write fault
-
- output1
- ab7 drive select 3
- ab6 drive select 2
- ab5 drive select 1
- ab4 drive select 0
- ab3 programmable outputs
- ab2 programmable outputs
- ab1 programmable outputs
- ab0 programmable outputs
-
- output2
- ab7 drive select 3* (active low, used for tape operations)
- ab6 reduce write current
- ab5 step direction
- ab4 step pulse
- ab3 desired head 3
- ab2 desired head 2
- ab1 desired head 1
- ab0 desired head 0
-*/
-
-#define OUT1_DRVSEL3 0x80
-#define OUT1_DRVSEL2 0x40
-#define OUT1_DRVSEL1 0x20
-#define OUT1_DRVSEL0 0x10
-#define OUT2_DRVSEL3_ 0x80
-#define OUT2_REDWRT 0x40
-#define OUT2_STEPDIR 0x20
-#define OUT2_STEPPULSE 0x10
-#define OUT2_HEADSEL3 0x08
-#define OUT2_HEADSEL2 0x04
-#define OUT2_HEADSEL1 0x02
-#define OUT2_HEADSEL0 0x01
-
-#define DRIVE_TYPE 0x03
-#define TYPE_AT 0x00
-#define TYPE_FLOPPY 0x02 /* for testing on any floppy type */
-#define TYPE_FLOPPY8 0x02
-#define TYPE_FLOPPY5 0x03
-
-#define MAX_SECTOR_LEN 256
-
-#define FORMAT_LONG false
-
-#define ERROR 0
-#define DONE 1
-#define AGAIN 2
-#define UNDEF 3
-
-enum
-{
- DATA_TIMER,
- READ_TIMER,
- WRITE_TIMER,
- SEEK_TIMER,
- TRACK_TIMER
-};
-
-/*
- Step rates in microseconds for MFM. This is set in the mode register,
- bits 0-2. Single density doubles all values.
-*/
-static const int step_hd[] = { 22, 50, 100, 200, 400, 800, 1600, 3200 };
-static const int step_flop8[] = { 218, 500, 1000, 2000, 4000, 8000, 16000, 32000 };
-static const int step_flop5[] = { 436, 1000, 2000, 4000, 8000, 16000, 32000, 64000 };
-
-/*
- 0.2 seconds for a revolution (300 rpm), +50% average waiting for index
- hole. Should be properly done with the index hole detection; we're
- simulating this with a timer for now.
-*/
-#define TRACKTIME_FLOPPY 300000
-#define TRACKTIME_HD 1000
-
-/*
- Register names of the HDC. The left part is the set of write registers,
- while the right part are the read registers.
-*/
-enum
-{
- DMA7_0=0,
- DMA15_8=1,
- DMA23_16=2,
- DESIRED_SECTOR=3,
- DESIRED_HEAD=4, CURRENT_HEAD=4,
- DESIRED_CYLINDER=5, CURRENT_CYLINDER=5,
- SECTOR_COUNT=6, CURRENT_IDENT=6,
- RETRY_COUNT=7, TEMP_STORAGE2=7,
- MODE=8, CHIP_STATUS=8,
- INT_COMM_TERM=9, DRIVE_STATUS=9,
- DATA_DELAY=10, DATA=10,
- COMMAND=11, INT_STATUS=11
-};
-
-#define TRKSIZE_DD 6144
-#define TRKSIZE_SD 3172
-
-#define VERBOSE 1
-#define LOG logerror
-
-smc92x4_device::smc92x4_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
-: device_t(mconfig, SMC92X4, "SMC 9224/9234 Hard/Floppy Disk Controller", tag, owner, clock, "smc92x4", __FILE__),
- m_out_intrq(*this),
- m_out_dip(*this),
- m_out_auxbus(*this),
- m_in_auxbus(*this),
- m_in_dma(*this),
- m_out_dma(*this),
- m_full_track_layout(FALSE)
-{
-}
-
-int smc92x4_device::image_is_single_density()
-{
- floppy_image_legacy *image = m_drive->flopimg_get_image();
- return (floppy_get_track_size(image, 0, 0)<4000);
-}
-
-bool smc92x4_device::in_single_density_mode()
-{
- return ((m_register_w[MODE]&MO_DENSITY)!=0);
-}
-
-void smc92x4_device::copyid(chrn_id id1, chrn_id_hd *id2)
-{
- id2->C = id1.C & 0xff;
- id2->H = id1.H;
- id2->R = id1.R;
- id2->N = id1.N;
- id2->data_id = id1.data_id;
- id2->flags = id1.flags;
-}
-
-/*
- Set IRQ
-*/
-void smc92x4_device::set_interrupt()
-{
- if ((m_register_r[INT_STATUS] & ST_INTPEND) == 0)
- {
- m_register_r[INT_STATUS] |= ST_INTPEND;
- m_out_intrq(ASSERT_LINE);
- }
-}
-
-/*
- Assert Command Done status bit, triggering interrupts as needed
-*/
-void smc92x4_device::set_command_done(int flags)
-{
- //assert(! (m_status & ST_DONE))
- if (VERBOSE>7) LOG("smc92x4 command %02x done, flags=%02x\n", m_command, flags);
-
- m_register_r[INT_STATUS] |= ST_DONE;
- m_register_r[INT_STATUS] &= ~ST_TERMCOD; /* clear the previously set flags */
- m_register_r[INT_STATUS] |= flags;
-
- /* sm92x4 spec, p. 6 */
- if (m_register_w[INT_COMM_TERM] & TC_INTDONE)
- set_interrupt();
-}
-
-/*
- Preserve previously set termination code
-*/
-void smc92x4_device::set_command_done()
-{
- //assert(! (m_status & ST_DONE))
- if (VERBOSE>7) LOG("smc92x4 command %02x done\n", m_command);
-
- m_register_r[INT_STATUS] |= ST_DONE;
-
- /* sm92x4 spec, p. 6 */
- if (m_register_w[INT_COMM_TERM] & TC_INTDONE)
- set_interrupt();
-}
-
-/*
- Clear IRQ
-*/
-void smc92x4_device::clear_interrupt()
-{
- if ((m_register_r[INT_STATUS] & ST_INTPEND) != 0)
- m_out_intrq(CLEAR_LINE);
-}
-
-/*
- Sets the DMA address on the external counter. This counter is attached
- to the auxiliary bus on the PCB.
-*/
-void smc92x4_device::set_dma_address(int pos2316, int pos1508, int pos0700)
-{
- m_out_auxbus((offs_t)OUTPUT_DMA_ADDR, m_register_r[pos2316]);
- m_out_auxbus((offs_t)OUTPUT_DMA_ADDR, m_register_r[pos1508]);
- m_out_auxbus((offs_t)OUTPUT_DMA_ADDR, m_register_r[pos0700]);
-}
-
-void smc92x4_device::dma_add_offset(int offset)
-{
- int dma_address = (m_register_w[DMA23_16]<<16) + (m_register_w[DMA15_8]<<8) + m_register_w[DMA7_0];
- dma_address += offset;
-
- m_register_w[DMA23_16] = m_register_r[DMA23_16] = (dma_address & 0xff0000)>>16;
- m_register_w[DMA15_8] = m_register_r[DMA15_8] = (dma_address & 0x00ff00)>>8;
- m_register_w[DMA7_0] = m_register_r[DMA7_0] = (dma_address & 0x0000ff);
-}
-
-/*
- Get the state from outside and latch it in the register.
- There should be a bus driver on the PCB which provides the signals from
- both the hard and floppy drives during S0=S1=0 and STB*=0 times via the
- auxiliary bus.
-*/
-void smc92x4_device::sync_status_in()
-{
- UINT8 prev;
- prev = m_register_r[DRIVE_STATUS];
- m_register_r[DRIVE_STATUS] = m_in_auxbus(0);
-
- /* Raise interrupt if ready changes. TODO: Check this more closely. */
- if (((m_register_r[DRIVE_STATUS] & DS_READY) != (prev & DS_READY))
- & (m_register_r[INT_STATUS] & ST_RDYCHNG))
- {
- set_interrupt();
- }
-}
-
-/*
- Push the output registers over the auxiliary bus. It is expected that
- the PCB contains latches to store the values.
-*/
-void smc92x4_device::sync_latches_out()
-{
- m_output1 = (m_output1 & 0xf0) | (m_register_w[RETRY_COUNT]&0x0f);
- m_out_auxbus((offs_t)OUTPUT_OUTPUT1, m_output1);
- m_out_auxbus((offs_t)OUTPUT_OUTPUT2, m_output2);
-}
-
-/*************************************************************
- Timed requests and callbacks
-*************************************************************/
-#if 0
-/* setup a timed data request - data request will be triggered in a few usecs time */
-void smc92x4_device::timed_data_request()
-{
- int time = in_single_density_mode()? 128 : 32;
-
- if (!m_use_real_timing)
- time = 1;
-
- /* set new timer */
- m_timer_data->adjust(attotime::from_usec(time));
-}
-#endif
-
-/* setup a timed read sector - read sector will be triggered in a few usecs time */
-void smc92x4_device::timed_sector_read_request()
-{
- int time=0;
-
- // set new timer
- // Average time from sector to sector.
- if (m_selected_drive_type & TYPE_FLOPPY)
- time = (in_single_density_mode())? 30000 : 15000;
- else
- time = 1000;
-
- if (!m_use_real_timing)
- time = 1;
-
- m_timer_rs->adjust(attotime::from_usec(time));
- m_to_be_continued = true;
-}
-
-/* setup a timed write sector - write sector will be triggered in a few usecs time */
-void smc92x4_device::timed_sector_write_request()
-{
- int time=0;
-
- /* Average time from sector to sector. */
- if (m_selected_drive_type & TYPE_FLOPPY)
- time = (in_single_density_mode())? 30000 : 15000;
- else
- time = 1000;
-
- if (!m_use_real_timing)
- time = 1;
-
- m_timer_ws->adjust(attotime::from_usec(time));
- m_to_be_continued = true;
-}
-
-/*
- Set up a timed track read/write
-*/
-void smc92x4_device::timed_track_request()
-{
- int time = 0;
-
- if (m_selected_drive_type & TYPE_FLOPPY)
- time = TRACKTIME_FLOPPY;
- else
- time = TRACKTIME_HD;
-
- if (!m_use_real_timing)
- time = 1;
-
- m_timer_track->adjust(attotime::from_usec(time));
-
- m_to_be_continued = true;
-}
-
-/*
- Set up a timed track seek
-*/
-void smc92x4_device::timed_seek_request()
-{
- int time = 0;
-
- int index = m_register_w[MODE] & MO_STEPRATE;
- int fm = in_single_density_mode();
-
- /* Get seek time. */
- if ((m_selected_drive_type & DRIVE_TYPE) == TYPE_FLOPPY8)
- time = step_flop8[index];
-
- else if ((m_selected_drive_type & DRIVE_TYPE) == TYPE_FLOPPY5)
- time = step_flop5[index];
- else
- time = step_hd[index];
-
- if (fm)
- time = time * 2;
-
- if (!m_use_real_timing)
- {
- if (VERBOSE>5) LOG("smc92x4 info: Disk access without delays\n");
- time = 1;
- }
- m_timer_seek->adjust(attotime::from_usec(time));
- m_to_be_continued = true;
-}
-
-void smc92x4_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
-{
- int transfer_enabled;
- int deldata;
- int redcur;
- int precomp;
- int write_long;
-
- switch (id)
- {
- case DATA_TIMER:
- // Not implemented yet
- break;
- case READ_TIMER:
- transfer_enabled = m_command & 0x01;
- // Now read the sector.
- data_transfer_read(m_recent_id, transfer_enabled);
- sync_status_in();
- break;
- case WRITE_TIMER:
- // The specification is contraditory here :-(
- // For formatting, bit 0x10 = 1 means normal, 0 means deleted
- // while for writing sectors it is the opposite?!
- // We believe the existing drivers which all set the bit for normal writing.
- deldata = 0x10 - (m_command & 0x10);
- redcur = m_command & 0x08;
- precomp = m_command & 0x07;
- write_long = ((m_register_w[MODE]& MO_CRCECC)==0x40);
-
- if (deldata)
- if (VERBOSE>0) LOG("smc92x4 warn: Write deleted data mark not supported. Writing normal mark.\n");
-
- // Now write the sector.
- data_transfer_write(m_recent_id, deldata, redcur, precomp, write_long);
- sync_status_in();
- break;
- case SEEK_TIMER:
- // Callback for seek request.
- /* int buffered = ((m_register_w[MODE] & MO_STEPRATE)==0); */
- /* int buffered = (m_command & 0x01); */
-
- if (m_selected_drive_type & TYPE_FLOPPY)
- {
- if (m_drive==NULL)
- {
- if (VERBOSE>0) LOG("smc92x4 error: seek callback: no floppy\n");
- m_register_r[INT_STATUS] |= ST_TC_SEEKERR;
- }
- else
- {
- if (VERBOSE>5) LOG("smc92x4 step %s direction %d\n", m_drive->tag(), m_step_direction);
- m_drive->floppy_drive_seek(m_step_direction);
- }
- }
- else
- {
- if (VERBOSE>6) LOG("smc92x4 step harddisk direction %d\n", m_step_direction);
- m_harddisk->seek(m_step_direction);
- }
- sync_status_in();
- break;
- case TRACK_TIMER:
- // Callback for track access. Nothing interesting here, just used for
- // delaying.
- break;
- }
- process_after_callback();
-}
-
-
-/*********************************************************************
- Common functions
-*********************************************************************/
-
-/*
- Calculate the ident byte from the cylinder. The specification does not
- define idents beyond cylinder 1023, but formatting programs seem to
- continue with 0xfd for cylinders between 1024 and 2047.
-*/
-UINT8 smc92x4_device::cylinder_to_ident(int cylinder)
-{
- if (cylinder < 256) return 0xfe;
- if (cylinder < 512) return 0xff;
- if (cylinder < 768) return 0xfc;
- if (cylinder < 1024) return 0xfd;
- return 0xfd;
-}
-
-/*
- Calculate the offset from the ident. This is only useful for AT drives;
- these drives cannot have more than 1024 cylinders.
-*/
-int smc92x4_device::ident_to_cylinder(UINT8 ident)
-{
- switch (ident)
- {
- case 0xfe: return 0;
- case 0xff: return 256;
- case 0xfc: return 512;
- case 0xfd: return 768;
- default: return -1;
- }
-}
-
-/*
- Common function to set the read registers from the recently read id.
-*/
-void smc92x4_device::update_id_regs(chrn_id_hd id)
-{
- // Flags for current head register. Note that the sizes are not in
- // sequence (128, 256, 512, 1024). This is only interesting for AT
- // mode.
- static const UINT8 sizeflag[] = { 0x60, 0x00, 0x20, 0x40 };
-
- m_register_r[CURRENT_CYLINDER] = id.C & 0xff;
- m_register_r[CURRENT_HEAD] = id.H & 0x0f;
-
- if (id.flags & BAD_SECTOR)
- m_register_r[CURRENT_HEAD] |= 0x80;
-
- if ((m_selected_drive_type & DRIVE_TYPE) == TYPE_AT)
- m_register_r[CURRENT_HEAD] |= sizeflag[id.N];
- else
- m_register_r[CURRENT_HEAD] |= ((id.C & 0x700)>>4);
-
- m_register_r[CURRENT_IDENT] = cylinder_to_ident(id.C);
-}
-
-/*
- Common procedure: read_id_field (as described in the specification)
-*/
-void smc92x4_device::read_id_field(int *steps, int *direction, chrn_id_hd *id)
-{
- int des_cylinder, cur_cylinder;
- bool found = false;
-
- sync_latches_out();
- sync_status_in();
-
- // Set command termination code. The error code is set first, and
- // on success, it is cleared.
- m_register_r[INT_STATUS] |= ST_TC_RDIDERR;
-
- /* Try to find an ID field. */
- if (m_selected_drive_type & TYPE_FLOPPY)
- {
- chrn_id idflop;
- if (m_drive->flopimg_get_image() == NULL)
- {
- if (VERBOSE>2) LOG("smc92x4 warn: No disk in drive\n");
- m_register_r[CHIP_STATUS] |= CS_SYNCERR;
- return;
- }
-
- /* Check whether image and controller are set to the same density. */
- if ((image_is_single_density() && in_single_density_mode())
- || (!image_is_single_density() && !in_single_density_mode()))
- {
- found = m_drive->floppy_drive_get_next_id(m_register_w[DESIRED_HEAD]&0x0f, &idflop);
- copyid(idflop, id); /* Need to use bigger values for HD, but we don't use separate variables here */
- }
- else
- {
- if (VERBOSE>2) LOG("smc92x4 warn: Controller and medium density do not match.\n");
- }
- sync_status_in();
-
- if (!found)
- {
- if (VERBOSE>1) LOG("smc92x4 error: read_id_field (floppy): sync error\n");
- m_register_r[CHIP_STATUS] |= CS_SYNCERR;
- return;
- }
- }
- else
- {
- m_harddisk->get_next_id(m_register_w[DESIRED_HEAD]&0x0f, id);
- sync_status_in();
- if (!(m_register_r[DRIVE_STATUS]& DS_READY))
- {
- if (VERBOSE>1) LOG("smc92x4 error: read_id_field (harddisk): sync error\n");
- m_register_r[CHIP_STATUS] |= CS_SYNCERR;
- return;
- }
- }
-
- m_register_r[CHIP_STATUS] &= ~CS_SYNCERR;
-
- /* Update the registers. */
- update_id_regs(*id);
-
- if (id->flags & BAD_CRC)
- {
- m_register_r[CHIP_STATUS] |= CS_CRCERR;
- return;
- }
-
- /* Calculate the steps. */
- if ((m_selected_drive_type & DRIVE_TYPE) == TYPE_AT)
- {
- /* Note: the spec says CURRENT_REGISTER, but that seems wrong. */
- des_cylinder = ((m_register_r[DATA] & 0x03)<<8) | m_register_w[DESIRED_CYLINDER];
- cur_cylinder = ident_to_cylinder(m_register_r[CURRENT_IDENT]) + m_register_r[CURRENT_CYLINDER];
- }
- else
- {
- des_cylinder = ((m_register_w[DESIRED_HEAD] & 0x70)<<4) | m_register_w[DESIRED_CYLINDER];
- cur_cylinder = ((m_register_r[CURRENT_HEAD] & 0x70)<<4) | m_register_r[CURRENT_CYLINDER];
- }
-
- if (des_cylinder >= cur_cylinder)
- {
- *steps = des_cylinder - cur_cylinder;
- *direction = +1;
- }
- else
- {
- *steps = cur_cylinder - des_cylinder;
- *direction = -1;
- }
-
- if (VERBOSE>6) LOG("smc92x4 seek required: %d steps\n", *steps);
-
- m_register_r[INT_STATUS] &= ~ST_TC_RDIDERR;
-}
-
-/*
- Common procedure: verify (as described in the specification)
-*/
-int smc92x4_device::verify(chrn_id_hd *id, bool check_sector)
-{
- int maxtry = 132; /* approx. 33792/(256*32) */
- int pass = 0;
- int found = false;
- int foundsect = false;
- int des_cylinder = 0;
-
- // Set command termination code. The error code is set first, and
- // on success, it is cleared.
- m_register_r[INT_STATUS] |= ST_TC_SEEKERR;
-
- while (pass < maxtry && !foundsect)
- {
- pass++;
- /* Try to find an ID field. */
- if (m_selected_drive_type & TYPE_FLOPPY)
- {
- chrn_id idflop;
- found = m_drive->floppy_drive_get_next_id(m_register_w[DESIRED_HEAD]&0x0f, &idflop);
- copyid(idflop, id);
- if (/* pass==1 && */!found)
- {
- m_register_r[CHIP_STATUS] |= CS_SYNCERR;
- if (VERBOSE>1) LOG("smc92x4 error: verify (floppy): sync error\n");
- return ERROR;
- }
- }
- else
- {
- m_harddisk->get_next_id(m_register_w[DESIRED_HEAD]&0x0f, id);
- sync_status_in();
- if (!(m_register_r[DRIVE_STATUS]& DS_READY))
- {
- if (VERBOSE>1) LOG("smc92x4 error: verify (harddisk): sync error\n");
- m_register_r[CHIP_STATUS] |= CS_SYNCERR;
- return ERROR;
- }
- }
-
- m_register_r[CHIP_STATUS] &= ~CS_SYNCERR;
-
- /* Compare with the desired sector ID. */
- if ((m_selected_drive_type & DRIVE_TYPE) == TYPE_AT)
- {
- /* Note: the spec says CURRENT_CYLINDER, but that seems wrong. */
- des_cylinder = ((m_register_r[DATA] & 0x03)<<8) | m_register_w[DESIRED_CYLINDER];
- }
- else
- {
- des_cylinder = ((m_register_w[DESIRED_HEAD] & 0x70)<<4) | m_register_w[DESIRED_CYLINDER];
- }
- if (VERBOSE>6) LOG("smc92x4 check id: current = (%d,%d,%d), required = (%d,%d,%d)\n", id->C, id->H, id->R, des_cylinder, m_register_w[DESIRED_HEAD] & 0x0f, m_register_w[DESIRED_SECTOR]);
- if ((des_cylinder == id->C)
- && ((m_register_w[DESIRED_HEAD] & 0x0f) == id->H))
- {
- if (!check_sector || (m_register_w[DESIRED_SECTOR] == id->R))
- foundsect = true;
- }
- }
- if (!foundsect)
- {
- m_register_r[CHIP_STATUS] |= CS_COMPERR;
- if (VERBOSE>1) LOG("smc92x4 error: verify: sector not found, seek error (desired cyl=%d/sec=%d, current cyl=%d/sec=%d)\n", des_cylinder, m_register_w[DESIRED_SECTOR], id->C, id->R);
- return ERROR;
- }
-
- m_register_r[INT_STATUS] &= ~ST_TC_SEEKERR;
- return DONE;
-}
-
-/*
- Common procedure: data_transfer(read) (as described in the specification)
-*/
-void smc92x4_device::data_transfer_read(chrn_id_hd id, int transfer_enable)
-{
- int i, retry, sector_len;
-
- int sector_data_id;
- dynamic_buffer buf;
-
- sync_latches_out();
- sync_status_in();
-
- // Set command termination code. The error code is set first, and
- // on success, it is cleared.
- m_register_r[INT_STATUS] |= ST_TC_DATAERR;
-
- // Save the value. Note that the retry count is only in the first four
- // bits, and it is stored in one's complement. In this implementation
- // we don't work with it.
- retry = m_register_w[RETRY_COUNT];
-
- /* We are already at the correct sector (found by the verify sequence) */
-
- /* Find the data sync mark. Easy, we assume it has been found. */
-
- if (id.flags & ID_FLAG_DELETED_DATA)
- m_register_r[CHIP_STATUS] |= CS_DELDATA;
- else
- m_register_r[CHIP_STATUS] &= ~CS_DELDATA;
-
- /* Found. Now update the current cylinder/head registers. */
- update_id_regs(id);
-
- /* Initiate the DMA. We assume the DMARQ is positive. */
- m_register_r[INT_STATUS] &= ~ST_OVRUN;
-
- sector_len = 1 << (id.N+7);
- sector_data_id = id.data_id;
- buf.resize(sector_len);
-
- if (m_selected_drive_type & TYPE_FLOPPY)
- {
- m_drive->floppy_drive_read_sector_data(id.H, sector_data_id, &buf[0], sector_len);
- }
- else
- {
- // TODO: Should we get the sector length from the harddisk?
- m_harddisk->read_sector(id.C, id.H, id.R, &buf[0]);
- }
- sync_status_in();
-
- if (transfer_enable)
- {
- /* Copy via DMA into controller RAM. */
- set_dma_address(DMA23_16, DMA15_8, DMA7_0);
-
- m_out_dip(ASSERT_LINE);
- for (i=0; i < sector_len; i++)
- {
- m_out_dma((offs_t)0, buf[i]);
- }
- m_out_dip(CLEAR_LINE);
- }
-
- /* Check CRC. We assume everything is OK, no retry required. */
- m_register_r[CHIP_STATUS] &= ~CS_RETREQ;
- m_register_r[CHIP_STATUS] &= ~CS_CRCERR;
- m_register_r[CHIP_STATUS] &= ~CS_ECCATT;
-
- /* Update the DMA registers. */
- if (transfer_enable) dma_add_offset(sector_len);
-
- /* Decrement sector count. */
- m_register_w[SECTOR_COUNT] = (m_register_w[SECTOR_COUNT]-1)&0xff;
-
- /* Clear the error bits. */
- m_register_r[INT_STATUS] &= ~ST_TC_DATAERR;
-
- if (m_register_w[SECTOR_COUNT] == 0)
- return;
-
- /* Else this is a multi-sector operation. */
- m_register_w[DESIRED_SECTOR] =
- m_register_r[DESIRED_SECTOR] =
- (m_register_w[DESIRED_SECTOR]+1) & 0xff;
-
- /* Reinitialize retry count. */
- m_register_w[RETRY_COUNT] = retry;
-}
-
-/*
- Common procedure: data_transfer(write) (as described in the specification)
-*/
-void smc92x4_device::data_transfer_write(chrn_id_hd id, int deldata, int redcur, int precomp, bool write_long)
-{
- int retry, i, sector_len;
- dynamic_buffer buf;
- int sector_data_id;
- sync_latches_out();
- sync_status_in();
-
- // Set command termination code. The error code is set first, and
- // on success, it is cleared.
- m_register_r[INT_STATUS] |= ST_TC_DATAERR;
-
- // Save the value. Note that the retry count is only in the first four
- // bits, and it is stored in one's complement. In this implementation
- // we don't work with it.
- retry = m_register_w[RETRY_COUNT];
-
- /* Initiate the DMA. We assume the DMARQ is positive. */
- m_register_r[INT_STATUS] &= ~ST_OVRUN;
-
- sector_len = 1 << (id.N+7);
- sector_data_id = id.data_id;
-
- buf.resize(sector_len);
-
- /* Copy via DMA from controller RAM. */
- set_dma_address(DMA23_16, DMA15_8, DMA7_0);
-
- m_out_dip(ASSERT_LINE);
- for (i=0; i<sector_len; i++)
- {
- buf[i] = m_in_dma(0);
- }
- m_out_dip(CLEAR_LINE);
-
- if (write_long)
- {
- if (VERBOSE>1) LOG("smc92x4 warn: write sector: Write_long not supported. Performing a normal write.\n");
- }
-
- if (m_selected_drive_type & TYPE_FLOPPY)
- {
- if (VERBOSE>4) LOG("smc92x4 info: write sector CHS=(%d,%d,%d)\n", id.C, id.H, id.R);
- m_drive->floppy_drive_write_sector_data(id.H, sector_data_id, &buf[0], sector_len, false);
- }
- else
- {
- m_harddisk->write_sector(id.C, id.H, id.R, &buf[0]);
- }
- sync_status_in();
-
- m_register_r[CHIP_STATUS] &= ~CS_RETREQ;
- m_register_r[CHIP_STATUS] &= ~CS_CRCERR;
- m_register_r[CHIP_STATUS] &= ~CS_ECCATT;
-
- /* Update the DMA registers. */
- dma_add_offset(sector_len);
-
- /* Decrement sector count. */
- m_register_w[SECTOR_COUNT] = (m_register_w[SECTOR_COUNT]-1)&0xff;
-
- /* Clear the error bits. */
- m_register_r[INT_STATUS] &= ~ST_TC_DATAERR;
-
- if (m_register_w[SECTOR_COUNT] == 0) return;
-
- /* Else this is a multi-sector operation. */
- m_register_w[DESIRED_SECTOR] = m_register_r[DESIRED_SECTOR] = (m_register_w[DESIRED_SECTOR]+1) & 0xff;
-
- /* Reinitialize retry count. */
- m_register_w[RETRY_COUNT] = retry;
-}
-
-/*
- Read sectors physical / logical. Physical means that the first, the
- second, the third sector appearing under the head will be read. These
- sectors are usually not in logical sequence. The ordering depends on
- the interleave pattern.
-*/
-void smc92x4_device::read_write_sectors()
-{
- int logical = m_command & 0x04;
- int implied_seek_disabled = m_command & 0x02; /* for read */
- int write = (m_command & 0x80);
-
- m_after_seek = false;
-
- m_to_be_continued = false;
-
- if (write) /* write sectors */
- {
- logical = m_command & 0x20;
- implied_seek_disabled = m_command & 0x40;
- }
-
- if (!logical)
- implied_seek_disabled = false;
-
- if (!m_found_id)
- {
- /* First start. */
- read_id_field(&m_seek_count, &m_step_direction, &m_recent_id);
- }
-
- if ((m_register_r[INT_STATUS] & ST_TC_DATAERR) == ST_TC_SUCCESS)
- {
- m_found_id = true;
- /* Perform the seek for the cylinder. */
- if (!implied_seek_disabled && m_seek_count > 0)
- {
- timed_seek_request();
- }
- else
- {
- if (write) write_sectors_continue();
- else read_sectors_continue();
- }
- }
- else
- {
- set_command_done(ST_TC_RDIDERR);
- }
-}
-
-
-void smc92x4_device::read_sectors_continue()
-{
- bool check_sector = true; /* always check the first sector */
- int state = AGAIN;
- int logical = m_command & 0x04;
-
- /* Needed for the two ways of re-entry: during the seek process, and during sector read */
- if (!m_after_seek)
- {
- if (VERBOSE>7) LOG("smc92x4 continue with sector read\n");
- m_seek_count--;
- if (m_seek_count > 0)
- {
- read_write_sectors();
- return;
- }
- m_after_seek = true;
- }
- else
- {
- /* we are here after the sector read. */
- m_to_be_continued = false;
- if (m_register_r[INT_STATUS] & ST_TERMCOD)
- {
- if (VERBOSE>1) LOG("smc92x4 error: data error during sector read: INTSTATUS=%02x\n", m_register_r[INT_STATUS]);
- set_command_done(ST_TC_DATAERR);
- return;
- }
- }
-
- m_to_be_continued = false;
-
- /* Wait for SEEK_COMPLETE. We assume the signal has appeared. */
-
- if (m_register_w[SECTOR_COUNT] > 0 /* && !(m_register_r[DRIVE_STATUS] & DS_INDEX) */)
- {
- /* Call the verify sequence. */
- state = verify(&m_recent_id, check_sector);
- if (state==ERROR)
- {
- // TODO: set command done?
- if (VERBOSE>0) LOG("smc92x4 error: verify error during sector read\n");
- return;
- }
-
- /* For read physical, only verify the first sector. */
- if (!logical)
- check_sector = false;
-
- if (m_recent_id.flags & BAD_SECTOR)
- {
- if (VERBOSE>0) LOG("smc92x4 error: Bad sector, seek error\n");
- set_command_done(ST_TC_SEEKERR);
- }
- else
- {
- timed_sector_read_request();
- }
- }
- else
- {
- set_command_done(ST_TC_SUCCESS);
- if (VERBOSE>7) LOG("smc92x4 read sector command done\n");
- }
-}
-
-void smc92x4_device::write_sectors_continue()
-{
- bool check_sector = true; /* always check the first sector */
- int state = AGAIN;
- int logical = m_command & 0x20;
-
- /* Needed for the two ways of re-entry: during the seek process, and during sector write */
- if (!m_after_seek)
- {
- m_seek_count--;
- if (m_seek_count > 0)
- {
- read_write_sectors();
- return;
- }
- m_after_seek = true;
- }
- else
- {
- /* we are here after the sector write. */
- m_to_be_continued = false;
- if (m_register_r[INT_STATUS] & ST_TERMCOD)
- {
- if (VERBOSE>0) LOG("smc92x4 error: data error during sector write\n");
- set_command_done(ST_TC_DATAERR);
- return;
- }
- }
-
- m_to_be_continued = false;
-
- if ((m_register_w[RETRY_COUNT] & 0xf0)!= 0xf0)
- if (VERBOSE>1) LOG("smc92x4 warn: RETRY_COUNT in write sector should be set to 0. Ignored.\n");
-
- /* Wait for SEEK_COMPLETE. We assume the signal has appeared. */
- if (m_register_w[SECTOR_COUNT] > 0)
- {
- /* Call the verify sequence. */
- state = verify(&m_recent_id, check_sector);
- if (state==ERROR)
- {
- if (VERBOSE>0) LOG("smc92x4 error: verify error during sector write\n");
- return;
- }
-
- /* For write physical, only verify the first sector. */
- if (!logical)
- check_sector = false;
-
-/* printf("smc92x4 write sectors CYL=%02x, HEA=%02x, SEC=%02x, MOD=%02x, CNT=%02x, TRY=%02x\n",
- m_register_w[DESIRED_CYLINDER],
- m_register_w[DESIRED_HEAD],
- m_register_w[DESIRED_SECTOR],
- m_register_w[MODE],
- m_register_w[SECTOR_COUNT],
- m_register_w[RETRY_COUNT]); */
- timed_sector_write_request();
- }
- else
- {
- set_command_done(ST_TC_SUCCESS);
- if (VERBOSE>7) LOG("smc92x4 write sector command done\n");
- }
-}
-
-/*********************************************************************
- Command implementations
-*********************************************************************/
-
-/*
- Handle the restore command
-*/
-void smc92x4_device::restore_drive()
-{
- /* TODO: int_after_seek_complete required for buffered seeks */
- sync_status_in();
-
- if (m_seek_count>=4096 || !(m_register_r[DRIVE_STATUS] & DS_READY))
- {
- if (VERBOSE>0) LOG("smc92x4 error: seek error in restore\n");
- m_register_r[INT_STATUS] |= ST_TC_SEEKERR;
- return;
- }
-
- if (m_register_r[DRIVE_STATUS] & DS_TRK00)
- {
- m_register_r[INT_STATUS] |= ST_TC_SUCCESS;
- /* Issue interrupt */
- set_interrupt();
- return;
- }
-
- m_step_direction = -1;
- timed_seek_request();
-}
-
-void smc92x4_device::restore_continue()
-{
- m_seek_count++;
-
- /* Next iteration */
- restore_drive();
-
- m_to_be_continued = false;
-}
-
-/*
- Handle the step command. Note that the CURRENT_CYLINDER register is not
- updated (this would break the format procedure).
-*/
-void smc92x4_device::step_in_out()
-{
- int direction = (m_command & 0x02)? -1 : +1;
- // bit 0: 0 -> command ends after last seek pulse, 1 -> command
- // ends when the drive asserts the seek complete pin
- int buffered = m_command & 0x01;
-
- m_step_direction = direction;
- m_buffered = (buffered!=0);
-
- timed_seek_request();
- if (VERBOSE>6) LOG("smc92x4 waiting for drive step\n");
-}
-
-void smc92x4_device::step_continue()
-{
- if (VERBOSE>7) LOG("smc92x4 step continue\n");
- m_to_be_continued = false;
- set_command_done(ST_TC_SUCCESS);
-}
-
-/*
- Poll drives
- This command is used to find out which drive has complete a buffered
- seek (RESTORE, SEEK IN/OUT with BUFFERED set to one)
-*/
-void smc92x4_device::poll_drives()
-{
- int mask = 0x08;
- int i;
- int flags = m_command & 0x0f;
-
-/* Spec is unclear: Do we continue to poll the drives after we have checked each
-one for the first time? We are not interested in locking up the emulator, so
-we decide to poll only once. */
- for (i=3; i>=0; i--)
- {
- if (flags & mask)
- {
- /* Poll drive */
- drive_select(i|((m_types[i])<<2));
- if (m_register_r[DRIVE_STATUS] & DS_SKCOM) return;
- }
- mask = mask>>1;
- }
-}
-
-void smc92x4_device::drive_select(int driveparm)
-{
- m_output1 = (0x10 << (driveparm & 0x03)) | (m_register_w[RETRY_COUNT]&0x0f);
- m_selected_drive_type = (driveparm>>2) & 0x03;
- m_head_load_delay_enable = (driveparm>>4)&0x01;
-
- // We need to store the type of the drive for the poll_drives command
- // to be able to correctly select the device (floppy or hard disk).
- m_types[driveparm&0x03] = m_selected_drive_type;
-
- // Copy the DMA registers to registers CURRENT_HEAD, CURRENT_CYLINDER,
- // and CURRENT_IDENT. This is required during formatting (p. 14) as the
- // format command reuses the registers for formatting parameters.
- m_register_r[CURRENT_HEAD] = m_register_r[DMA7_0];
- m_register_r[CURRENT_CYLINDER] = m_register_r[DMA15_8];
- m_register_r[CURRENT_IDENT] = m_register_r[DMA23_16];
-
- sync_latches_out();
- sync_status_in();
-}
-
-/*
- Command SEEK/READID
-*/
-void smc92x4_device::seek_read_id()
-{
- int step_enable = (m_command & 0x04);
- int verify_id = (m_command & 0x01);
- int wait = (m_command & 0x02);
-
- m_to_be_continued = false;
-
- if (!m_found_id)
- {
- /* First start. */
- read_id_field(&m_seek_count, &m_step_direction, &m_recent_id);
- m_found_id = true;
- }
-
- if ((m_register_r[INT_STATUS] & ST_TC_DATAERR) == ST_TC_SUCCESS)
- {
- /* Perform the seek for the cylinder. */
- if (step_enable && m_seek_count > 0)
- {
- timed_seek_request();
- }
- else
- {
- if (wait)
- if (VERBOSE>1) LOG("smc92x4 warn: seed_read_id: Waiting for seek_complete not implemented.\n");
-
- if (verify_id)
- {
- verify(&m_recent_id, true);
- }
- }
- }
- else
- {
- set_command_done(ST_TC_RDIDERR);
- }
-}
-
-void smc92x4_device::seek_read_id_continue()
-{
- m_seek_count--;
- seek_read_id();
- m_to_be_continued = false;
-}
-
-/*
- Formats a track starting from the detection of an index mark until the
- detection of another index mark.
- The formatting is done exclusively by the controller; user programs may
- set parameters for gaps and interleaving.
-
- 1. Before starting the command, the user program must have set up a
- sector sequence table in the controller RAM (located on the PCB):
- (ident, cylinder, head, sector1, size) (5 bytes)
- (ident, cylinder, head, sector2, size)
- (ident, cylinder, head, sector3, size)
- ...
- ident is not required for floppy FM operation. size is not required
- for IBM AT-compatible hard disks.
-
- 2. The DMA registers must point to the beginning of the table
-
- 3. DRIVE_SELECT must be executed (which moves DMA regs to CUR_HEAD ...)
-
- 4. DESIRED_HEAD register must be loaded
-
- 5. The following setup must be done:
-
- GAP 0 size DMA7_0 (2s comp)
- GAP 1 size DMA15_8 (2s comp)
- GAP 2 size DMA23_16 (2s comp)
- GAP 3 size DESIRED_SECTOR (2s comp)
- Sync size DESIRED_CYLINDER (1s comp)
- Sector count SECTOR_COUNT (1s comp)
- Sector size multiple RETRY_COUNT (1s comp)
-
- GAP4 is variable and fills the rest of the track until the next
- index hole. Usually we have 247 bytes for FM and 598 for MFM.
-
- 6. The step rate and density must be loaded into the MODE register
-
- 7. The drive must be stepped to the desired track.
-
- 8. Now this command may be started.
-
- All data bytes of a sector are filled with 0xe5. The gaps will be filled
- with 0x4e (MFM) or 0xff (FM).
-
- To format another track, the sector id table must be updated, and steps
- 7 and 8 must be repeated. If the DESIRED_HEAD register must be updated,
- the complete setup process must be done.
-
- Options: Command = 011m rppp
- m = set data mark (0 = set deleted)
- r = current (1 = reduced)
- ppp = precompensation (for sector size = (2^ppp) * 128; ppp<4 for floppy )
-
- ===============
-
- One deviation from the specification: The TI-99 family uses the SDF
- and TDF formats. The TDF formats complies with the formats produced
- by the standard TI disk controller. It does not use index address marks.
- So we could integrate a translation in ti99_dsk when writing to disk,
- but when reading, how can ti99_dsk know whether to blow up the format
- to full length for this controller or keep it as is for the other
- controller? Unless someone comes up with a better idea, we implement
- an "undocumented" option in this controller, allowing to create a
- different track layout.
-
- So there are two layouts for the floppy track:
-
- - full format, including the index address mark, according to the
- specification
-
- - short format without index AM which matches the PC99 format used
- for the TI-99 family.
-
- The formats are determined by setting the flag in the smc92x4
- interface structure.
-*/
-void smc92x4_device::format_floppy_track(int flags)
-{
- floppy_image_legacy *floppy;
- int i,index,j, exp_size;
- int gap0, gap1, gap2, gap3, gap4, sync1, sync2, count, size, fm;
- int gap_byte, pre_gap, crc, mark, inam;
- UINT8 curr_cyl, curr_head, curr_sect, curr_size;
-
- int normal_data_mark = flags & 0x10;
-
- dynamic_buffer buffer;
-
- /* Determine the track size. We cannot allow different sizes in this design. */
- int data_count = 0;
-
- sync_status_in();
-
- floppy = m_drive->flopimg_get_image();
-
- if (floppy != NULL)
- data_count = floppy_get_track_size(floppy, 0, 0);
-
- if (data_count==0)
- {
- if (in_single_density_mode())
- data_count = TRKSIZE_SD;
- else
- data_count = TRKSIZE_DD;
- }
-
- /* Build buffer */
- buffer.resize(data_count);
-
- fm = in_single_density_mode();
-
- sync2 = (~m_register_w[DESIRED_CYLINDER])&0xff;
- gap2 = (-m_register_w[DMA23_16])&0xff;
- count = (~m_register_w[SECTOR_COUNT])&0xff;
- size = (~m_register_w[RETRY_COUNT])&0xff;
- gap_byte = (fm)? 0xff : 0x4e;
-
- if (m_full_track_layout)
- {
- /* Including the index AM. */
- gap0 = (-m_register_w[DMA7_0])&0xff;
- gap1 = (-m_register_w[DMA15_8])&0xff;
- gap3 = (-m_register_w[DESIRED_SECTOR])&0xff;
- gap4 = (fm)? 247 : 598;
- pre_gap = gap_byte;
- sync1 = sync2;
- inam = sync2 + ((fm)? 1 : 4);
- }
- else
- {
- /* Specific overrides for this format. We do not have the index mark. */
- gap0 = (fm)? 16 : 40;
- gap1 = 0;
- gap3 = (fm)? 45 : 24;
- gap4 = (fm)? 231 : 712;
- pre_gap = (fm)? 0x00 : 0x4e;
- sync1 = (fm)? 6 : 10;
- inam = 0;
- }
-
- index = 0;
-
- mark = (fm)? 10 : 16; /* ID/DAM + A1 + CRC */
-
- exp_size = gap0 + inam + gap1 + count*(sync1 + mark + gap2 + sync2 + size*128 + gap3) + gap4;
-
- if (exp_size != data_count)
- if (VERBOSE>0) LOG("smc92x4 warn: The current track length in the image (%d) does not match the new track length (%d). Keeping the old length. This will break the image (sorry).\n", data_count, exp_size);
-
- /* use the backup registers set up during drive_select */
- set_dma_address(CURRENT_IDENT, CURRENT_CYLINDER, CURRENT_HEAD);
-
- memset(&buffer[index], pre_gap, gap0);
- index += gap0;
-
- if (m_full_track_layout)
- {
- /* Create the Index AM */
- memset(&buffer[index], 0x00, sync1);
- index += sync1;
- if (!fm)
- {
- memset(&buffer[index], 0xc2, 3);
- index += 3;
- }
- memset(&buffer[index], gap_byte, gap1);
- index += gap1;
- }
-
- /* for each sector */
- for (j=0; j < count; j++)
- {
- memset(&buffer[index], 0x00, sync1);
- index += sync1;
-
- if (!fm)
- {
- memset(&buffer[index], 0xa1, 3);
- index += 3;
- }
-
- buffer[index++] = 0xfe;
-
- m_out_dip(ASSERT_LINE);
-// if (!fm) curr_ident = m_in_dma();
- if (!fm) m_in_dma(0);
- curr_cyl = m_in_dma(0);
- curr_head = m_in_dma(0);
- curr_sect = m_in_dma(0);
- curr_size = m_in_dma(0);
- m_out_dip(CLEAR_LINE);
-
- buffer[index++] = curr_cyl;
- buffer[index++] = curr_head;
- buffer[index++] = curr_sect;
- buffer[index++] = curr_size;
-
- if (j==0)
- if (VERBOSE>6) LOG("current_floppy=%s, format track %d, head %d\n", m_drive->tag(), curr_cyl, curr_head);
-
- /* Calculate CRC16 (5 bytes for ID) */
- crc = ccitt_crc16(0xffff, &buffer[index-5], 5);
- buffer[index++] = (crc>>8)&0xff;
- buffer[index++] = crc & 0xff;
-
- memset(&buffer[index], gap_byte, gap2);
- index += gap2;
-
- memset(&buffer[index], 0x00, sync2);
- index += sync2;
-
- if (!fm)
- {
- memset(&buffer[index], 0xa1, 3);
- index += 3;
- }
-
- if (normal_data_mark) buffer[index++] = 0xfb;
- else buffer[index++] = 0xf8;
-
- /* Sector data */
- for (i=0; i < 128*size; i++) buffer[index++] = 0xe5;
-
- /* Calculate CRC16 (128*size+1 bytes for sector) */
- crc = ccitt_crc16(0xffff, &buffer[index-128*size-1], 128*size+1);
- buffer[index++] = (crc>>8)&0xff;
- buffer[index++] = crc & 0xff;
-
- memset(&buffer[index], gap_byte, gap3);
- index += gap3;
- }
-
- memset(&buffer[index], gap_byte, gap4);
- index += gap4;
-
- m_drive->floppy_drive_write_track_data_info_buffer(m_register_w[DESIRED_HEAD]&0x0f, &buffer[0], &data_count);
- sync_status_in();
-}
-
-/*
- Create the track layout of a MFM hard disk. Like floppy disks,
- MFM hard disks are interfaced on a track base, that is, we have to
- create a complete track layout.
-
- For more explanations see the comments to format_floppy_track.
-*/
-void smc92x4_device::format_harddisk_track(int flags)
-{
- int i,index,j;
- int gap1, gap2, gap3, gap4, sync, count, size, gap_byte, crc;
- UINT8 curr_ident, curr_cyl, curr_head, curr_sect, curr_size;
-
- int normal_data_mark = flags & 0x10;
- int data_count=0;
-
- dynamic_buffer buffer;
-
- sync_status_in();
-
- /* Build buffer */
-// gap0 = (-m_register_w[DMA7_0])&0xff;
- gap1 = (-m_register_w[DMA15_8])&0xff;
- gap2 = (-m_register_w[DMA23_16])&0xff;
- gap3 = (-m_register_w[DESIRED_SECTOR])&0xff;
- gap4 = 340;
-
- sync = (~m_register_w[DESIRED_CYLINDER])&0xff;
- count = (~m_register_w[SECTOR_COUNT])&0xff;
- size = (~m_register_w[RETRY_COUNT])&0xff;
-
- data_count = gap1 + count*(sync+12+gap2+sync+size*128+gap3)+gap4;
-
- buffer.resize(data_count);
-
- index = 0;
- gap_byte = 0x4e;
-
- /* use the backup registers set up during drive_select */
- set_dma_address(CURRENT_IDENT, CURRENT_CYLINDER, CURRENT_HEAD);
-
- for (i=0; i < gap1; i++) buffer[index++] = gap_byte;
-
- /* Now write the sectors. */
- for (j=0; j < count; j++)
- {
- for (i=0; i < sync; i++) buffer[index++] = 0x00;
- buffer[index++] = 0xa1;
-
- m_out_dip(ASSERT_LINE);
- curr_ident = m_in_dma(0);
- curr_cyl = m_in_dma(0);
- curr_head = m_in_dma(0);
- curr_sect = m_in_dma(0);
- curr_size = m_in_dma(0);
- m_out_dip(CLEAR_LINE);
-
- buffer[index++] = curr_ident;
- buffer[index++] = curr_cyl;
- buffer[index++] = curr_head;
- buffer[index++] = curr_sect;
- buffer[index++] = curr_size;
-
- /* Calculate CRC16 (5 bytes for ID) */
- crc = ccitt_crc16(0xffff, &buffer[index-5], 5);
- buffer[index++] = (crc>>8)&0xff;
- buffer[index++] = crc & 0xff;
-
- /* GAP 2 */
- for (i=0; i < gap2; i++) buffer[index++] = gap_byte;
- for (i=0; i < sync; i++) buffer[index++] = 0x00;
-
- buffer[index++] = 0xa1;
-
- if (normal_data_mark) buffer[index++] = 0xfb;
- else buffer[index++] = 0xf8;
-
- /* Sector data */
- for (i=0; i < 128*size; i++) buffer[index++] = 0xe5;
-
- /* Calculate CRC16 (128*size+1 bytes for sector) */
- crc = ccitt_crc16(0xffff, &buffer[index-128*size-1], 128*size+1);
- buffer[index++] = (crc>>8)&0xff;
- buffer[index++] = crc & 0xff;
-
- /* GAP 3 */
- for (i=0; i < 3; i++) buffer[index++] = 0; /* check that, unclear in spec */
- for (i=0; i < gap3 - 3; i++) buffer[index++] = gap_byte;
- }
- /* GAP 4 */
- for (i=0; i < gap4; i++) buffer[index++] = gap_byte;
-
- // Now write the whole track
- m_harddisk->write_track(m_register_w[DESIRED_HEAD]&0x0f, &buffer[0], data_count);
-
- sync_status_in();
-}
-
-/*
- Read a floppy track.
- A complete track is read at the position of the head. It reads the
- track from one index pulse to the next index pulse. (Note that the
- spec talks about "index mark" and "signal from the drive" which is
- a bit confusing, since the index AM is behind Gap0, the index hole
- is before Gap0. We should check with a real device. Also, it does not
- speak about the head, so we assume the head is set in the DESIRED_HEAD
- register.)
-
- TODO: The TDF format does not support index marks. Need to define TDF
- in a more flexible way. Also consider format variations.
- (Hint: Do a check for the standard "IBM" format. Should probably do
- a translation from IBM to PC99 and back. Requires to parse the track
- image before. Need to decide whether we generally translate to the IBM
- format or generally to the PC99 format between controller and format.
- Format is the image is always PC99.)
-*/
-void smc92x4_device::read_floppy_track(bool transfer_only_ids)
-{
- floppy_image_legacy *floppy;
- /* Determine the track size. We cannot allow different sizes in this design. */
- int data_count = 0;
- int i;
- dynamic_buffer buffer;
-
- sync_latches_out();
-
- floppy = m_drive->flopimg_get_image();
-
- /* Determine the track size. We cannot allow different sizes in this design. */
- if (floppy != NULL)
- data_count = floppy_get_track_size(floppy, 0, 0);
-
- if (data_count==0)
- {
- if (in_single_density_mode())
- data_count = TRKSIZE_SD;
- else
- data_count = TRKSIZE_DD;
- }
-
- buffer.resize(data_count);
-
- m_drive->floppy_drive_read_track_data_info_buffer(m_register_w[DESIRED_HEAD]&0x0f, (char *)&buffer[0], &data_count);
- sync_status_in();
-
- // Transfer the buffer to the external memory. We assume the memory
- // pointer has been set appropriately in the registers.
- set_dma_address(DMA23_16, DMA15_8, DMA7_0);
-
- if (transfer_only_ids)
- {
- if (VERBOSE>1) LOG("smc92x4 warn: read track: Ignoring transfer-only-ids. Reading complete track.\n");
- }
-
- m_out_dip(ASSERT_LINE);
- for (i=0; i < data_count; i++)
- {
- m_out_dma((offs_t)0, buffer[i]);
- }
- m_out_dip(CLEAR_LINE);
-}
-
-void smc92x4_device::read_harddisk_track(bool transfer_only_ids)
-{
- /* Determine the track size. We cannot allow different sizes in this design. */
- int i;
- dynamic_buffer buffer;
- int data_count=0;
- sync_latches_out();
-
- data_count = m_harddisk->get_track_length();
- buffer.resize(data_count);
-
- /* buffer and data_count are allocated and set by the function. */
- m_harddisk->read_track(m_register_w[DESIRED_HEAD]&0x0f, &buffer[0]);
- sync_status_in();
-
- if (!(m_register_r[DRIVE_STATUS] & DS_READY))
- {
- if (VERBOSE>0) LOG("smc92x4 error: read harddisk track failed.\n");
- }
-
- // Transfer the buffer to the external memory. We assume the memory
- // pointer has been set appropriately in the registers.
- set_dma_address(DMA23_16, DMA15_8, DMA7_0);
-
- if (transfer_only_ids)
- {
- if (VERBOSE>1) LOG("smc92x4 warn: read track: Ignoring transfer-only-ids. Reading complete track.\n");
- }
-
- m_out_dip(ASSERT_LINE);
- for (i=0; i < data_count; i++)
- {
- m_out_dma((offs_t)0, buffer[i]);
- }
- m_out_dip(CLEAR_LINE);
-}
-
-
-void smc92x4_device::read_track()
-{
- int transfer_only_ids = m_command & 0x01;
-
- if (m_selected_drive_type & TYPE_FLOPPY)
- {
- read_floppy_track(transfer_only_ids);
- }
- else
- {
- read_harddisk_track(transfer_only_ids);
- }
- timed_track_request();
-}
-
-void smc92x4_device::read_track_continue()
-{
- m_to_be_continued = false;
- set_command_done(ST_TC_SUCCESS);
-}
-
-void smc92x4_device::format_track()
-{
- int flags = m_command & 0x1f;
-
- if (m_selected_drive_type & TYPE_FLOPPY)
- format_floppy_track(flags);
- else
- format_harddisk_track(flags);
-
- timed_track_request();
-}
-
-void smc92x4_device::format_track_continue()
-{
- m_to_be_continued = false;
- set_command_done(ST_TC_SUCCESS);
-}
-
-/*
- Continue to process after callback
-*/
-void smc92x4_device::process_after_callback()
-{
- UINT8 opcode = m_command;
- if (opcode >= 0x02 && opcode <= 0x03)
- {
- restore_continue();
- }
- else if (opcode >= 0x04 && opcode <= 0x07)
- {
- step_continue();
- }
- else if (opcode >= 0x50 && opcode <= 0x57)
- {
- seek_read_id_continue();
- }
- else if ((opcode >= 0x58 && opcode <= 0x59)||(opcode >= 0x5C && opcode <= 0x5f))
- {
- read_sectors_continue();
- }
- else if (opcode >= 0x5a && opcode <= 0x5b)
- {
- read_track_continue();
- }
- else if (opcode >= 0x60 && opcode <= 0x7f)
- {
- format_track_continue();
- }
- else if (opcode >= 0x80)
- {
- write_sectors_continue();
- }
- else
- {
- if (VERBOSE>1) LOG("smc92x4 warn: Invalid command %x or command changed while waiting for callback\n", opcode);
- }
-}
-
-/*
- Process a command
-*/
-void smc92x4_device::process_command(UINT8 opcode)
-{
- if (VERBOSE>6) LOG("smc92x4 process command %02x\n", opcode);
- if (m_to_be_continued)
- {
- if (VERBOSE>1) LOG("smc92x4 warn: previous command %02x not complete\n", m_command);
- }
-
- /* Reset DONE and BAD_SECTOR. */
- m_register_r[INT_STATUS] &= ~(ST_DONE | ST_BADSECT);
-
- // Reset interrupt line (not explicitly mentioned in spec, but seems reasonable
- clear_interrupt();
- m_register_r[INT_STATUS] &= ~(ST_INTPEND | ST_RDYCHNG);
-
- m_command = opcode;
- m_found_id = false;
- m_seek_count = 0;
-
- if (opcode == 0x00)
- {
- /* RESET */
- /* same effect as the RST* pin being active */
- if (VERBOSE>0) LOG("smc92x4 info: reset command\n");
- reset();
- }
- else if (opcode == 0x01)
- {
- /* DESELECT DRIVE */
- /* done when no drive is in use */
- if (VERBOSE>2) LOG("smc92x4 info: drdeselect command\n");
- m_output1 &= ~(OUT1_DRVSEL3|OUT1_DRVSEL2|OUT1_DRVSEL1|OUT1_DRVSEL0);
- m_output2 |= OUT2_DRVSEL3_;
- /* sync the latches on the PCB */
- sync_latches_out();
- sync_status_in();
- }
- else if (opcode >= 0x02 && opcode <= 0x03)
- {
- /* RESTORE DRIVE */
- // bit 0: 0 -> command ends after last seek pulse, 1 -> command
- // ends when the drive asserts the seek complete pin
- if (VERBOSE>2) LOG("smc92x4 info: restore command %X\n", opcode);
- restore_drive();
- }
- else if (opcode >= 0x04 && opcode <= 0x07)
- {
- /* STEP IN/OUT ONE CYLINDER */
- if (VERBOSE>2) LOG("smc92x4 info: step in/out command %X\n", opcode);
- step_in_out();
- }
- else if (opcode >= 0x08 && opcode <= 0x0f)
- {
- /* TAPE BACKUP (08-0f)*/
- if (VERBOSE>0) LOG("smc92x4 error: tape backup command %X not implemented\n", opcode);
- }
- else if (opcode >= 0x10 && opcode <= 0x1f)
- {
- /* POLLDRIVE */
- if (VERBOSE>2) LOG("smc92x4 info: polldrive command %X\n", opcode);
- poll_drives();
- }
- else if (opcode >= 0x20 && opcode <= 0x3f)
- {
- /* DRIVE SELECT */
- if (VERBOSE>2) LOG("smc92x4 info: drselect command %X\n", opcode);
- drive_select(opcode&0x1f);
- }
- else if (opcode >= 0x40 && opcode <= 0x4f)
- {
- /* SETREGPTR */
- if (VERBOSE>2) LOG("smc92x4 info: setregptr command %X\n", opcode);
- m_register_pointer = opcode & 0xf;
- // Spec does not say anything about the effect of setting an
- // invalid value (only "care should be taken")
- if (m_register_pointer > 10)
- {
- if (VERBOSE>1) LOG("smc92x4 error: set register pointer: Invalid register number: %d. Setting to 10.\n", m_register_pointer);
- m_register_pointer = 10;
- }
- }
- else if (opcode >= 0x50 && opcode <= 0x57)
- {
- /* SEEK/READ ID */
- if (VERBOSE>2) LOG("smc92x4 seekreadid command %X\n", opcode);
- seek_read_id();
- }
- else if ((opcode >= 0x58 && opcode <= 0x59)
- || (opcode >= 0x5C && opcode <= 0x5f)
- || (opcode >= 0x80))
- {
- /* READ/WRITE SECTORS PHYSICAL/LOGICAL */
- if (VERBOSE>2) LOG("smc92x4 info: read/write sector command %X\n", opcode);
- read_write_sectors();
- }
- else if (opcode >= 0x5A && opcode <= 0x5b)
- {
- /* READ TRACK */
- if (VERBOSE>2) LOG("smc92x4 info: read track command %X\n", opcode);
- read_track();
- }
- else if (opcode >= 0x60 && opcode <= 0x7f)
- {
- /* FORMAT TRACK */
- if (VERBOSE>2) LOG("smc92x4 info: format track command %X\n", opcode);
- format_track();
- }
- else
- {
- if (VERBOSE>0) LOG("smc92x4 error: Invalid command %x, ignored\n", opcode);
- }
-
- if (!m_to_be_continued)
- set_command_done();
-}
-
-/***************************************************************************
- Memory accessors
-****************************************************************************/
-
-/*
- Read a byte of data from a smc92x4 controller
- The address (offset) encodes the C/D* line (command and /data)
-*/
-READ8_MEMBER( smc92x4_device::read )
-{
- UINT8 reply = 0;
-
- if ((offset & 1) == 0)
- {
- /* data register */
- reply = m_register_r[m_register_pointer];
- if (VERBOSE>6) LOG("smc92x4 register_r[%d] -> %02x\n", m_register_pointer, reply);
- /* Autoincrement until DATA is reached. */
- if (m_register_pointer < DATA)
- m_register_pointer++;
- }
- else
- {
- /* status register */
- reply = m_register_r[INT_STATUS];
- // Spec (p.3) : The interrupt pin is reset to its inactive state
- // when the UDC interrupt status register is read.
- if (VERBOSE>6) LOG("smc92x4 interrupt status read = %02x\n", reply);
- clear_interrupt();
- /* Clear the bits due to int status register read. */
- m_register_r[INT_STATUS] &= ~(ST_INTPEND | ST_RDYCHNG);
- }
- return reply;
-}
-
-/*
- Write a byte to a smc99x4 controller
- The address (offset) encodes the C/D* line (command and /data)
-*/
-WRITE8_MEMBER( smc92x4_device::write )
-{
- data &= 0xff;
-
- if ((offset & 1) == 0)
- {
- /* data register */
- if (VERBOSE>6) LOG("smc92x4 register_w[%d] <- %X\n", m_register_pointer, data);
- m_register_w[m_register_pointer] = data;
-
- // The DMA registers and the sector register for read and
- // write are identical.
- if (m_register_pointer < DESIRED_HEAD)
- m_register_r[m_register_pointer] = data;
-
- /* Autoincrement until DATA is reached. */
- if (m_register_pointer < DATA)
- m_register_pointer++;
- }
- else
- process_command(data); // command register
-}
-
-
-
-/***************************************************************************
- DEVICE FUNCTIONS
-***************************************************************************/
-
-void smc92x4_device::device_start()
-{
- m_out_intrq.resolve_safe();
- m_out_dip.resolve_safe();
- m_out_auxbus.resolve_safe();
- m_in_auxbus.resolve_safe(0);
- m_out_dma.resolve_safe();
- m_in_dma.resolve_safe(0);
-
- // allocate timers
- // m_timer_data = timer_alloc(DATA_TIMER);
- m_timer_rs = timer_alloc(READ_TIMER);
- m_timer_ws = timer_alloc(WRITE_TIMER);
- m_timer_track = timer_alloc(TRACK_TIMER);
- m_timer_seek = timer_alloc(SEEK_TIMER);
-
- m_use_real_timing = true;
-}
-
-void smc92x4_device::device_reset()
-{
- clear_interrupt();
- m_out_dip(CLEAR_LINE);
-
- for (int i=0; i<=11; i++)
- m_register_r[i] = m_register_w[i] = 0;
-
- m_to_be_continued = false;
-}
-
-void smc92x4_device::set_timing(bool realistic)
-{
- m_use_real_timing = realistic;
- if (VERBOSE>0) LOG("smc92x4: use realistic timing: %02x\n", realistic);
-}
-
-void smc92x4_device::connect_floppy_drive(legacy_floppy_image_device *drive)
-{
- m_drive = drive;
- if (VERBOSE>3)
- {
- if (drive==NULL) LOG("smc92x4: Unselect all drives\n");
- else LOG("smc92x4: Connect drive %s\n", drive->tag());
- }
-}
-void smc92x4_device::connect_hard_drive(mfm_harddisk_legacy_device *drive)
-{
- m_harddisk = drive;
- if (VERBOSE>3)
- {
- if (drive==NULL) LOG("smc92x4: Unselect all drives\n");
- else LOG("smc92x4: Connect drive %s\n", drive->tag());
- }
-}
-
-void smc92x4_device::reset()
-{
- device_reset();
-}
-
-const device_type SMC92X4 = &device_creator<smc92x4_device>;
diff --git a/src/emu/machine/smc92x4.h b/src/emu/machine/smc92x4.h
deleted file mode 100644
index 9cc80b815ea..00000000000
--- a/src/emu/machine/smc92x4.h
+++ /dev/null
@@ -1,231 +0,0 @@
-// license:???
-// copyright-holders:Raphael Nabet, Michael Zapf
-/* Interface */
-
-#ifndef __SMC92X4_H__
-#define __SMC92X4_H__
-
-#include "ti99_hd.h"
-#include "imagedev/flopdrv.h"
-#include "formats/imageutl.h"
-#include "imagedev/harddriv.h"
-#include "harddisk.h"
-
-#define INPUT_STATUS 0x00
-#define OUTPUT_DMA_ADDR 0x01
-#define OUTPUT_OUTPUT1 0x02
-#define OUTPUT_OUTPUT2 0x03
-
-#define MFMHD_TRACK00 0x80
-#define MFMHD_SEEKCOMP 0x40
-#define MFMHD_WRFAULT 0x20
-#define MFMHD_READY 0x10
-#define MFMHD_INDEX 0x08
-
-#define BAD_SECTOR 0x1000
-#define BAD_CRC 0x2000
-
-extern const device_type SMC92X4;
-/*
- Definition of bits in the Disk-Status register
-*/
-#define DS_ECCERR 0x80 /* ECC error */
-#define DS_INDEX 0x40 /* index point */
-#define DS_SKCOM 0x20 /* seek complete */
-#define DS_TRK00 0x10 /* track 0 */
-#define DS_UDEF 0x08 /* user-defined */
-#define DS_WRPROT 0x04 /* write protect */
-#define DS_READY 0x02 /* drive ready bit */
-#define DS_WRFAULT 0x01 /* write fault */
-
-// Interrupt line. To be connected with the controller PCB.
-#define MCFG_SMC92X4_INTRQ_CALLBACK(_write) \
- devcb = &smc92x4_device::set_intrq_wr_callback(*device, DEVCB_##_write);
-
-// DMA in progress line. To be connected with the controller PCB.
-#define MCFG_SMC92X4_DIP_CALLBACK(_write) \
- devcb = &smc92x4_device::set_dip_wr_callback(*device, DEVCB_##_write);
-
-// Auxiliary Bus. These 8 lines need to be connected to external latches
-// and to a counter circuitry which works together with the external RAM.
-// We use the S0/S1 lines as address lines.
-#define MCFG_SMC92X4_AUXBUS_OUT_CALLBACK(_write) \
- devcb = &smc92x4_device::set_auxbus_wr_callback(*device, DEVCB_##_write);
-
-// Auxiliary Bus. This is only used for S0=S1=0.
-#define MCFG_SMC92X4_AUXBUS_IN_CALLBACK(_read) \
- devcb = &smc92x4_device::set_auxbus_rd_callback(*device, DEVCB_##_read);
-
-// Callback to read the contents of the external RAM via the data bus.
-// Note that the address must be set and automatically increased
-// by external circuitry.
-#define MCFG_SMC92X4_DMA_IN_CALLBACK(_read) \
- devcb = &smc92x4_device::set_dma_rd_callback(*device, DEVCB_##_read);
-
-// Callback to write the contents of the external RAM via the data bus.
-// Note that the address must be set and automatically increased
-// by external circuitry. */
-#define MCFG_SMC92X4_DMA_OUT_CALLBACK(_write) \
- devcb = &smc92x4_device::set_dma_wr_callback(*device, DEVCB_##_write);
-
-// Disk format support. This flag allows to choose between the full
-// FM/MFM format and an abbreviated track layout. The difference results
-// from legal variations of the layout. This is not part of
-// the smc92x4 specification, but it allows to keep the image format
-// simple without too much case checking. Should be removed as soon as
-// the respective disk formats support the full format.
-#define MCFG_SMC92X4_FULL_TRACK_LAYOUT(_lay) \
- smc92x4_device::set_full_track_layout(*device, _lay);
-
-
-class smc92x4_device : public device_t
-{
-public:
- smc92x4_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
- template<class _Object> static devcb_base &set_intrq_wr_callback(device_t &device, _Object object) { return downcast<smc92x4_device &>(device).m_out_intrq.set_callback(object); }
- template<class _Object> static devcb_base &set_dip_wr_callback(device_t &device, _Object object) { return downcast<smc92x4_device &>(device).m_out_dip.set_callback(object); }
- template<class _Object> static devcb_base &set_auxbus_wr_callback(device_t &device, _Object object) { return downcast<smc92x4_device &>(device).m_out_auxbus.set_callback(object); }
- template<class _Object> static devcb_base &set_auxbus_rd_callback(device_t &device, _Object object) { return downcast<smc92x4_device &>(device).m_in_auxbus.set_callback(object); }
- template<class _Object> static devcb_base &set_dma_rd_callback(device_t &device, _Object object) { return downcast<smc92x4_device &>(device).m_in_dma.set_callback(object); }
- template<class _Object> static devcb_base &set_dma_wr_callback(device_t &device, _Object object) { return downcast<smc92x4_device &>(device).m_out_dma.set_callback(object); }
-
- static void set_full_track_layout(device_t &device, bool lay) { downcast<smc92x4_device &>(device).m_full_track_layout = lay; }
-
- DECLARE_READ8_MEMBER( read );
- DECLARE_WRITE8_MEMBER( write );
-
- // Used to turn off the delays.
- void set_timing(bool realistic);
-
- // Used to reconfigure the drive connections. Drive selection is done
- // using the select lines and maybe also the user-programmable outputs.
- void connect_floppy_drive(legacy_floppy_image_device *drive);
- void connect_hard_drive(mfm_harddisk_legacy_device *drive);
-
- void reset();
-
-protected:
- virtual void device_start(void);
- virtual void device_reset(void);
-
-private:
- devcb_write_line m_out_intrq; // INT line
- devcb_write_line m_out_dip; // DMA in progress line
- devcb_write8 m_out_auxbus; // AB0-7 lines (using S0,S1 as address)
- devcb_read8 m_in_auxbus; // AB0-7 lines (S0=S1=0)
- devcb_read8 m_in_dma; // DMA read access to the cache buffer
- devcb_write8 m_out_dma; // DMA write access to the cache buffer
-
- UINT8 m_output1; // internal register "output1"
- UINT8 m_output2; // internal register "output2"
-
- void set_dip(line_state value);
- int image_is_single_density();
- bool in_single_density_mode();
- void copyid(chrn_id id1, chrn_id_hd *id2);
- void set_interrupt();
- void clear_interrupt();
- void set_command_done(int flags);
- void set_command_done();
- void set_dma_address(int pos2316, int pos1508, int pos0700);
- void dma_add_offset(int offset);
- void sync_status_in();
- void sync_latches_out();
- void timed_sector_read_request();
- void timed_sector_write_request();
- void timed_track_request();
- void timed_seek_request();
- virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
- UINT8 cylinder_to_ident(int cylinder);
- int ident_to_cylinder(UINT8 ident);
- void update_id_regs(chrn_id_hd id);
- void read_id_field(int *steps, int *direction, chrn_id_hd *id);
- int verify(chrn_id_hd *id, bool check_sector);
- void data_transfer_read(chrn_id_hd id, int transfer_enable);
- void data_transfer_write(chrn_id_hd id, int deldata, int redcur, int precomp, bool write_long);
- void read_write_sectors();
- void read_sectors_continue();
- void write_sectors_continue();
-
- void restore_drive();
- void restore_continue();
-
- void step_in_out();
- void step_continue();
-
- void poll_drives();
-
- void drive_select(int driveparm);
-
- void seek_read_id();
- void seek_read_id_continue();
-
- void format_track();
- void format_track_continue();
- void format_floppy_track(int flags);
- void format_harddisk_track(int flags);
-
- void read_track();
- void read_track_continue();
- void read_floppy_track(bool transfer_only_ids);
- void read_harddisk_track(bool transfer_only_ids);
-
- void process_after_callback();
- void process_command(UINT8 opcode);
-
- int m_selected_drive_type;
- // We need to store the types, although this is not the case in the
- // real hardware. The reason is that poll_drives wants to select the
- // drives without knowing their kinds. In reality this does not matter,
- // since we only check for the seek_complete line, but in our case,
- // floppy and harddrive are pretty different, and we need to know which
- // one to check.
- int m_types[4];
- int m_head_load_delay_enable;
- int m_register_pointer;
-
- UINT8 m_register_r[12];
- UINT8 m_register_w[12];
-
- /* timers to delay execution/completion of commands */
- emu_timer *m_timer_data, *m_timer_rs, *m_timer_ws, *m_timer_seek, *m_timer_track;
-
- /* Flag which determines whether to use realistic timing. */
- bool m_use_real_timing;
-
- /* Required to store the current iteration within restore. */
- int m_seek_count;
-
- /* Recent command. */
- UINT8 m_command;
-
- /* Stores the step direction. */
- int m_step_direction;
-
- /* Stores the buffered flag. */
- bool m_buffered;
-
- /* Stores the recent id field. */
- chrn_id_hd m_recent_id;
-
- /* Indicates whether an ID has been found. */
- bool m_found_id;
-
- /* Indicates whether we are already past the seek_id phase in read/write sector. */
- bool m_after_seek;
-
- /* Determines whether the command will be continued. */
- bool m_to_be_continued;
-
- bool m_full_track_layout;
-
- // Link to attached drive (hard / floppy disk)
- // Hard disks must be instances of mfmhd_device; floppy disks are the common drives.
- // We expect the embedding board to replace the drive according to the
- // select lines.
- legacy_floppy_image_device *m_drive;
- mfm_harddisk_legacy_device *m_harddisk;
-};
-
-#endif
diff --git a/src/emu/machine/smpc.c b/src/emu/machine/smpc.c
index c2dfe39c743..eab928f4daa 100644
--- a/src/emu/machine/smpc.c
+++ b/src/emu/machine/smpc.c
@@ -683,6 +683,10 @@ void saturn_state::smpc_comreg_exec(address_space &space, UINT8 data, UINT8 is_s
printf ("SMPC: CD %s\n",(data & 1) ? "off" : "on");
machine().scheduler().timer_set(attotime::from_usec(20), timer_expired_delegate(FUNC(saturn_state::smpc_cd_enable),this),data & 1);
break;
+ case 0x0a:
+ case 0x0b:
+ popmessage ("SMPC: NETLINK %s, contact MAMEdev",(data & 1) ? "off" : "on");
+ break;
case 0x0d:
if(LOG_SMPC) printf ("SMPC: System Reset\n");
smpc_system_reset();
diff --git a/src/emu/machine/spchrom.c b/src/emu/machine/spchrom.c
index ae906840f43..a49590e9e00 100644
--- a/src/emu/machine/spchrom.c
+++ b/src/emu/machine/spchrom.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Frank Palazzolo, Aaron Giles, Jonathan Gevaryahu, Raphael Nabet, Couriersud, Michael Zapf
/*
spchroms.c - This is an emulator for "typical" speech ROMs from TI, as used by TI99/4(a).
diff --git a/src/emu/machine/spchrom.h b/src/emu/machine/spchrom.h
index e45ba8092e5..520c7fc967b 100644
--- a/src/emu/machine/spchrom.h
+++ b/src/emu/machine/spchrom.h
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Frank Palazzolo, Aaron Giles, Jonathan Gevaryahu, Raphael Nabet, Couriersud, Michael Zapf
/*
* Voice Synthesis Memory
diff --git a/src/emu/machine/strata.c b/src/emu/machine/strata.c
index 26da2fb3f72..01651eb90bd 100644
--- a/src/emu/machine/strata.c
+++ b/src/emu/machine/strata.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Raphael Nabet, Michael Zapf
/*
Intel 28F640J5 Flash ROM emulation (could also handle 28F320J5 with minor
diff --git a/src/emu/machine/strata.h b/src/emu/machine/strata.h
index f68a30e5fef..c037a24396b 100644
--- a/src/emu/machine/strata.h
+++ b/src/emu/machine/strata.h
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Raphael Nabet, Michael Zapf
/*
strata.h: header file for strata.c
diff --git a/src/emu/machine/t10mmc.h b/src/emu/machine/t10mmc.h
index 9e112fe279f..cfebfc1694c 100644
--- a/src/emu/machine/t10mmc.h
+++ b/src/emu/machine/t10mmc.h
@@ -35,7 +35,7 @@ protected:
T10MMC_CMD_PAUSE_RESUME = 0x4b,
T10MMC_CMD_STOP_PLAY_SCAN = 0x4e,
T10MMC_CMD_PLAY_AUDIO_12 = 0xa5,
- T10MMC_CMD_SET_CD_SPEED = 0xbb,
+ T10MMC_CMD_SET_CD_SPEED = 0xbb
};
enum toc_format_t
diff --git a/src/emu/machine/t10spc.h b/src/emu/machine/t10spc.h
index 0ffa27ecd93..778fd40bce1 100644
--- a/src/emu/machine/t10spc.h
+++ b/src/emu/machine/t10spc.h
@@ -73,7 +73,7 @@ protected:
T10SBC_CMD_READ_CAPACITY = 0x25,
T10SBC_CMD_WRITE_10 = 0x2a,
T10SBC_CMD_SEEK_10 = 0x2b,
- T10SBC_CMD_READ_12 = 0xa8,
+ T10SBC_CMD_READ_12 = 0xa8
};
enum
diff --git a/src/emu/machine/ti99_hd.c b/src/emu/machine/ti99_hd.c
index 1f3029a1200..f6f3344f94a 100644
--- a/src/emu/machine/ti99_hd.c
+++ b/src/emu/machine/ti99_hd.c
@@ -14,28 +14,34 @@
**************************************************************************/
+// TODO: Define format by a file
+// Save interleave in CHD
+
#include "emu.h"
#include "formats/imageutl.h"
#include "harddisk.h"
#include "ti99_hd.h"
-#define TI99HD_BLOCKNOTFOUND -1
-
-#define LOG logerror
-#define VERBOSE 0
-
-#define GAP1 16
-#define GAP2 8
-#define GAP3 15
-#define GAP4 340
-#define SYNC 13
+#define TRACE_STEPS 0
+#define TRACE_SIGNALS 0
+#define TRACE_READ 0
+#define TRACE_WRITE 0
+#define TRACE_CACHE 0
+#define TRACE_RWTRACK 0
+#define TRACE_BITS 0
+#define TRACE_DETAIL 0
+#define TRACE_TIMING 0
+#define TRACE_IMAGE 0
+#define TRACE_STATE 1
+#define TRACE_CONFIG 1
enum
{
INDEX_TM = 0,
SPINUP_TM,
- SEEK_TM
+ SEEK_TM,
+ CACHE_TM
};
enum
@@ -45,10 +51,41 @@ enum
STEP_SETTLE
};
+#define TRACKSLOTS 5
+
+#define OFFLIMIT -1
+
+std::string mfm_harddisk_device::tts(const attotime &t)
+{
+ char buf[256];
+ int nsec = t.attoseconds / ATTOSECONDS_PER_NANOSECOND;
+ sprintf(buf, "%4d.%03d,%03d,%03d", int(t.seconds), nsec/1000000, (nsec/1000)%1000, nsec % 1000);
+ return buf;
+}
+
mfm_harddisk_device::mfm_harddisk_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source)
: harddisk_image_device(mconfig, type, name, tag, owner, clock, shortname, source),
device_slot_card_interface(mconfig, *this)
{
+ m_spinupms = 10000;
+ m_cachelines = TRACKSLOTS;
+ m_max_cylinders = 0;
+ m_phys_cylinders = 0; // We will get this value for generic drives from the image
+ m_max_heads = 0;
+ m_cell_size = 100;
+ m_rpm = 3600; // MFM drives have a revolution rate of 3600 rpm (i.e. 60/sec)
+ m_trackimage_size = (int)((60000000000L / (m_rpm * m_cell_size)) / 16 + 1);
+ m_cache = NULL;
+ // We will calculate default values from the time specs later.
+ m_seeknext_time = 0;
+ m_maxseek_time = 0;
+ m_actual_cylinders = 0;
+ m_park_pos = 0;
+ m_interleave = 0;
+}
+
+mfm_harddisk_device::~mfm_harddisk_device()
+{
}
void mfm_harddisk_device::device_start()
@@ -56,14 +93,18 @@ void mfm_harddisk_device::device_start()
m_index_timer = timer_alloc(INDEX_TM);
m_spinup_timer = timer_alloc(SPINUP_TM);
m_seek_timer = timer_alloc(SEEK_TM);
+ m_cache_timer = timer_alloc(CACHE_TM);
- // MFM drives have a revolution rate of 3600 rpm (i.e. 60/sec)
- m_index_timer->adjust(attotime::from_hz(60), 0, attotime::from_hz(60));
+ m_rev_time = attotime::from_hz(m_rpm/60);
+ m_index_timer->adjust(attotime::from_hz(m_rpm/60), 0, attotime::from_hz(m_rpm/60));
- // Spinup may take up to 24 seconds
- m_spinup_timer->adjust(attotime::from_msec(8000));
+ m_current_cylinder = m_park_pos; // Park position
+ m_spinup_timer->adjust(attotime::from_msec(m_spinupms));
- m_current_cylinder = 10; // for test purpose
+ m_cache = global_alloc(mfmhd_trackimage_cache);
+
+ // In 5 second periods, check whether the cache has dirty lines
+ m_cache_timer->adjust(attotime::from_msec(5000), 0, attotime::from_msec(5000));
}
void mfm_harddisk_device::device_reset()
@@ -74,6 +115,107 @@ void mfm_harddisk_device::device_reset()
m_seek_inward = false;
m_track_delta = 0;
m_step_line = CLEAR_LINE;
+ m_recalibrated = false;
+}
+
+void mfm_harddisk_device::device_stop()
+{
+ if (m_cache!=NULL) global_free(m_cache);
+}
+
+/*
+ Load the image from the CHD. We also calculate the head timing here
+ because we need the number of cylinders, and for generic drives we get
+ them from the CHD.
+*/
+bool mfm_harddisk_device::call_load()
+{
+ bool loaded = harddisk_image_device::call_load();
+ if (loaded==IMAGE_INIT_PASS)
+ {
+ std::string metadata;
+ chd_file* chdfile = get_chd_file();
+
+ if (chdfile==NULL)
+ {
+ logerror("%s: chdfile is null\n", tag());
+ return IMAGE_INIT_FAIL;
+ }
+
+ // Read the hard disk metadata
+ chd_error state = chdfile->read_metadata(HARD_DISK_METADATA_TAG, 0, metadata);
+ if (state != CHDERR_NONE)
+ {
+ logerror("%s: Failed to read CHD metadata\n", tag());
+ return IMAGE_INIT_FAIL;
+ }
+
+ if (TRACE_CONFIG) logerror("%s: CHD metadata: %s\n", tag(), metadata.c_str());
+
+ // Parse the metadata
+ int imagecyls;
+ int imageheads;
+ int imagesecpt;
+ int imagesecsz;
+
+ if (sscanf(metadata.c_str(), HARD_DISK_METADATA_FORMAT, &imagecyls, &imageheads, &imagesecpt, &imagesecsz) != 4)
+ {
+ logerror("%s: Invalid CHD metadata\n", tag());
+ return IMAGE_INIT_FAIL;
+ }
+
+ if (TRACE_CONFIG) logerror("%s: CHD image has geometry cyl=%d, head=%d, sect=%d, size=%d\n", tag(), imagecyls, imageheads, imagesecpt, imagesecsz);
+
+ if (m_max_cylinders != 0 && (imagecyls != m_max_cylinders || imageheads != m_max_heads))
+ {
+ throw emu_fatalerror("Image geometry does not fit this kind of hard drive: drive=(%d,%d), image=(%d,%d)", m_max_cylinders, m_max_heads, imagecyls, imageheads);
+ }
+
+ m_cache->init(chdfile, tag(), m_trackimage_size, imagecyls, imageheads, imagesecpt, m_cachelines, m_encoding, m_format);
+
+ // Head timing
+ // We assume that the real times are 80% of the max times
+ // The single-step time includes the settle time, so does the max time
+ // From that we calculate the actual cylinder-by-cylinder time and the settle time
+
+ m_actual_cylinders = m_cache->get_cylinders();
+ if (m_phys_cylinders == 0) m_phys_cylinders = m_actual_cylinders+1;
+
+ m_park_pos = m_phys_cylinders-1;
+
+ float realnext = (m_seeknext_time==0)? 10 : (m_seeknext_time * 0.8);
+ float realmax = (m_maxseek_time==0)? (m_actual_cylinders * 0.2) : (m_maxseek_time * 0.8);
+ float settle_us = ((m_actual_cylinders-1.0) * realnext - realmax) / (m_actual_cylinders-2.0) * 1000;
+ float step_us = realnext * 1000 - settle_us;
+ if (TRACE_CONFIG) logerror("%s: Calculated settle time: %0.2f ms, step: %d us\n", tag(), settle_us/1000, (int)step_us);
+
+ m_settle_time = attotime::from_usec((int)settle_us);
+ m_step_time = attotime::from_usec((int)step_us);
+
+ m_current_cylinder = m_park_pos;
+ m_interleave = m_format->get_interleave();
+ }
+ else
+ {
+ logerror("%s: Could not load CHD\n", tag());
+ }
+ return loaded;
+}
+
+void mfm_harddisk_device::call_unload()
+{
+ if (m_cache!=NULL)
+ {
+ m_cache->cleanup();
+
+ if (m_interleave != m_format->get_interleave())
+ {
+ logerror("%s: Interleave changed from %d to %d; committing to CHD\n", tag(), m_interleave, m_format->get_interleave());
+ }
+ }
+
+ // TODO: If interleave changed, commit that to CHD
+ harddisk_image_device::call_unload();
}
void mfm_harddisk_device::setup_index_pulse_cb(index_pulse_cb cb)
@@ -81,27 +223,60 @@ void mfm_harddisk_device::setup_index_pulse_cb(index_pulse_cb cb)
m_index_pulse_cb = cb;
}
+void mfm_harddisk_device::setup_ready_cb(ready_cb cb)
+{
+ m_ready_cb = cb;
+}
+
void mfm_harddisk_device::setup_seek_complete_cb(seek_complete_cb cb)
{
m_seek_complete_cb = cb;
}
+attotime mfm_harddisk_device::track_end_time()
+{
+ // We back up two microseconds before the track end to avoid the
+ // index pulse to appear earlier (because of rounding effects)
+ attotime nexttime = m_rev_time - attotime::from_nsec(2000);
+ attotime endtime = attotime::never;
+
+ if (!m_ready)
+ {
+ // estimate the next index time; during power-up we assume half the rotational speed
+ // Should never be relevant, though, because READY is false.
+ nexttime = nexttime * 2;
+ }
+
+ if (!m_revolution_start_time.is_never())
+ {
+ endtime = m_revolution_start_time + nexttime;
+ if (TRACE_TIMING) logerror("%s: Track start time = %s, end time = %s\n", tag(), tts(m_revolution_start_time).c_str(), tts(endtime).c_str());
+ }
+ return endtime;
+}
+
void mfm_harddisk_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
switch (id)
{
case INDEX_TM:
- /* Simple index hole handling. We assume that there is only a short pulse. */
+ // Simple index hole handling. We assume that there is only a short pulse.
+ m_revolution_start_time = machine().time();
if (!m_index_pulse_cb.isnull())
{
m_index_pulse_cb(this, ASSERT_LINE);
m_index_pulse_cb(this, CLEAR_LINE);
}
break;
+
case SPINUP_TM:
- m_ready = true;
- logerror("%s: Spinup complete, drive is ready\n", tag());
+ recalibrate();
break;
+
+ case CACHE_TM:
+ m_cache->write_back_one();
+ break;
+
case SEEK_TM:
switch (m_step_phase)
{
@@ -116,8 +291,8 @@ void mfm_harddisk_device::device_timer(emu_timer &timer, device_timer_id id, int
{
// Start the settle timer
m_step_phase = STEP_SETTLE;
- m_seek_timer->adjust(attotime::from_usec(16800));
- logerror("%s: Arrived at target track %d, settling ...\n", tag(), m_current_cylinder);
+ m_seek_timer->adjust(m_settle_time);
+ if (TRACE_STEPS && TRACE_DETAIL) logerror("%s: Arrived at target cylinder %d, settling ...\n", tag(), m_current_cylinder);
}
break;
case STEP_SETTLE:
@@ -126,9 +301,19 @@ void mfm_harddisk_device::device_timer(emu_timer &timer, device_timer_id id, int
else
{
// Seek completed
- logerror("%s: Settling done at cylinder %d, seek complete\n", tag(), m_current_cylinder);
+ if (!m_recalibrated)
+ {
+ m_ready = true;
+ m_recalibrated = true;
+ if (TRACE_STATE) logerror("%s: Spinup complete, drive recalibrated and positioned at cylinder %d; drive is READY\n", tag(), m_current_cylinder);
+ if (!m_ready_cb.isnull()) m_ready_cb(this, ASSERT_LINE);
+ }
+ else
+ {
+ if (TRACE_SIGNALS) logerror("%s: Settling done at cylinder %d, seek complete\n", tag(), m_current_cylinder);
+ }
m_seek_complete = true;
- m_seek_complete_cb(this, ASSERT_LINE);
+ if (!m_seek_complete_cb.isnull()) m_seek_complete_cb(this, ASSERT_LINE);
m_step_phase = STEP_COLLECT;
}
break;
@@ -136,27 +321,40 @@ void mfm_harddisk_device::device_timer(emu_timer &timer, device_timer_id id, int
}
}
+void mfm_harddisk_device::recalibrate()
+{
+ if (TRACE_STEPS) logerror("%s: Recalibrate to track 0\n", tag());
+ direction_in_w(CLEAR_LINE);
+ while (-m_track_delta < m_phys_cylinders)
+ {
+ step_w(ASSERT_LINE);
+ step_w(CLEAR_LINE);
+ }
+}
+
void mfm_harddisk_device::head_move()
{
int steps = m_track_delta;
if (steps < 0) steps = -steps;
- logerror("%s: Moving head by %d step(s) %s\n", tag(), steps, (m_track_delta<0)? "outward" : "inward");
+ if (TRACE_STEPS) logerror("%s: Moving head by %d step(s) %s\n", tag(), steps, (m_track_delta<0)? "outward" : "inward");
- int disttime = steps*200;
+ // We simulate the head movement by pausing for n*step_time with n being the cylinder delta
m_step_phase = STEP_MOVING;
- m_seek_timer->adjust(attotime::from_usec(disttime));
+ m_seek_timer->adjust(m_step_time * steps);
+
+ if (TRACE_TIMING) logerror("%s: Head movement takes %s time\n", tag(), tts(m_step_time * steps).c_str());
// We pretend that we already arrived
// TODO: Check auto truncation?
m_current_cylinder += m_track_delta;
if (m_current_cylinder < 0) m_current_cylinder = 0;
- if (m_current_cylinder > 670) m_current_cylinder = 670;
+ if (m_current_cylinder >= m_actual_cylinders) m_current_cylinder = m_actual_cylinders-1;
m_track_delta = 0;
}
void mfm_harddisk_device::direction_in_w(line_state line)
{
m_seek_inward = (line == ASSERT_LINE);
- logerror("%s: Setting seek direction %s\n", tag(), m_seek_inward? "inward" : "outward");
+ if (TRACE_STEPS && TRACE_DETAIL) logerror("%s: Setting seek direction %s\n", tag(), m_seek_inward? "inward" : "outward");
}
/*
@@ -191,14 +389,6 @@ void mfm_harddisk_device::direction_in_w(line_state line)
- When the timer expires (mode=settle)
- When the counter is not zero, go to (1)
- When the counter is zero, signal seek_complete; done
-
- Step timing:
- per track = 20 ms max, full seek: 150 ms max (615 tracks); both including settling time
- We assume t(1) = 17; t(615)=140
- t(i) = s+d*i
- s=(615*t(1)-t(615))/614
- d=t(1)-s
- s=16800 us, d=200 us
*/
void mfm_harddisk_device::step_w(line_state line)
@@ -210,502 +400,895 @@ void mfm_harddisk_device::step_w(line_state line)
{
m_step_phase = STEP_COLLECT;
m_seek_complete = false;
- m_seek_complete_cb(this, CLEAR_LINE);
+ if (!m_seek_complete_cb.isnull()) m_seek_complete_cb(this, CLEAR_LINE);
}
// Counter will be adjusted according to the direction (+-1)
m_track_delta += (m_seek_inward)? +1 : -1;
- logerror("%s: Got seek pulse; track delta %d\n", tag(), m_track_delta);
- if (m_track_delta < -670 || m_track_delta > 670)
+ if (TRACE_STEPS && TRACE_DETAIL) logerror("%s: Got seek pulse; track delta %d\n", tag(), m_track_delta);
+ if (m_track_delta < -m_phys_cylinders || m_track_delta > m_phys_cylinders)
{
- logerror("%s: Excessive step pulses - doing auto-truncation\n", tag());
+ if (TRACE_STEPS) logerror("%s: Excessive step pulses - doing auto-truncation\n", tag());
m_autotruncation = true;
}
- m_seek_timer->adjust(attotime::from_usec(250));
+ m_seek_timer->adjust(attotime::from_usec(250)); // Start step collect timer
}
m_step_line = line;
}
-mfm_hd_generic_device::mfm_hd_generic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
-: mfm_harddisk_device(mconfig, MFM_HD_GENERIC, "Generic MFM hard disk (byte level)", tag, owner, clock, "mfm_harddisk", __FILE__)
+/*
+ Find the position of the cell.
+ Returns true when the current time exceeds the limit.
+ Returns the position as an index into the track array and the bit number.
+*/
+bool mfm_harddisk_device::find_position(attotime &from_when, const attotime &limit, int &bytepos, int &bit)
{
-}
+ // Frequency
+ UINT32 freq = 1000000000/m_cell_size;
-const device_type MFM_HD_GENERIC = &device_creator<mfm_hd_generic_device>;
+ // As we stop some few cells early each track, we adjust our position
+ // to the track start
+ if (from_when < m_revolution_start_time) from_when = m_revolution_start_time;
-// ===========================================================================
-// Legacy implementation
-// ===========================================================================
+ // Calculate the position in the track, given the from_when time and the revolution_start_time.
+ int cell = (from_when - m_revolution_start_time).as_ticks(freq);
-#include "smc92x4.h"
+ from_when += attotime::from_nsec((m_encoding==MFM_BITS)? m_cell_size : (16*m_cell_size));
+ if (from_when > limit) return true;
-mfm_harddisk_legacy_device::mfm_harddisk_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
-: device_t(mconfig, TI99_MFMHD_LEG, "MFM Harddisk LEGACY", tag, owner, clock, "mfm_harddisk_leg", __FILE__)
-{
-}
+ bytepos = cell / 16;
-/*
- Calculate the ident byte from the cylinder. The specification does not
- define idents beyond cylinder 1023, but formatting programs seem to
- continue with 0xfd for cylinders between 1024 and 2047.
-*/
-UINT8 mfm_harddisk_legacy_device::cylinder_to_ident(int cylinder)
-{
- if (cylinder < 256) return 0xfe;
- if (cylinder < 512) return 0xff;
- if (cylinder < 768) return 0xfc;
- if (cylinder < 1024) return 0xfd;
- return 0xfd;
+ // Reached the end
+ if (bytepos >= m_trackimage_size)
+ {
+ if (TRACE_TIMING) logerror("%s: Reached end: rev_start = %s, live = %s\n", tag(), tts(m_revolution_start_time).c_str(), tts(from_when).c_str());
+ m_revolution_start_time += m_rev_time;
+ cell = (from_when - m_revolution_start_time).as_ticks(freq);
+ bytepos = cell / 16;
+ }
+
+ if (bytepos < 0)
+ {
+ if (TRACE_TIMING) logerror("%s: Negative cell number: rev_start = %s, live = %s\n", tag(), tts(m_revolution_start_time).c_str(), tts(from_when).c_str());
+ bytepos = 0;
+ }
+ bit = cell % 16;
+
+ return false;
}
/*
- Returns the linear sector number, given the CHS data.
+ Reading bytes from the hard disk.
+
+ Returns true if the time limit will be exceeded before reading the bit or complete byte.
+ Otherwise returns the bit at the given position, or the complete data byte with the clock byte.
*/
-bool mfm_harddisk_legacy_device::harddisk_chs_to_lba(hard_disk_file *hdfile, int cylinder, int head, int sector, UINT32 *lba)
+bool mfm_harddisk_device::read(attotime &from_when, const attotime &limit, UINT16 &cdata)
{
- const hard_disk_info *info;
+ UINT16* track = m_cache->get_trackimage(m_current_cylinder, m_current_head);
- if ( hdfile != NULL)
+ if (track==NULL)
{
- info = hard_disk_get_info(hdfile);
+ // What shall we do in this case?
+ throw emu_fatalerror("Cannot read CHD image");
+ }
- if ( (cylinder >= info->cylinders) ||
- (head >= info->heads) ||
- (sector >= info->sectors))
- return false;
+ // Get a copy for later debug output
+ attotime fw = from_when;
- *lba = (cylinder * info->heads + head)
- * info->sectors
- + sector;
- return true;
+ int bytepos = 0;
+ int bitpos = 0;
+
+ bool offlimit = find_position(from_when, limit, bytepos, bitpos);
+ if (offlimit) return true;
+
+ if (m_encoding == MFM_BITS)
+ {
+ // We will deliver a single bit
+ cdata = ((track[bytepos] << bitpos) & 0x8000) >> 15;
+ if (TRACE_BITS) logerror("%s: Reading (c=%d,h=%d,bit=%d) at cell %d [%s] = %d\n", tag(), m_current_cylinder, m_current_head, bitpos, ((bytepos<<4) + bitpos), tts(fw).c_str(), cdata);
+ }
+ else
+ {
+ // We will deliver a whole byte
+ if (TRACE_READ) logerror("%s: Reading (c=%d,h=%d) at position %d\n", tag(), m_current_cylinder, m_current_head, bytepos);
+ cdata = track[bytepos];
}
return false;
}
-/* Accessor functions */
-void mfm_harddisk_legacy_device::read_sector(int cylinder, int head, int sector, UINT8 *buf)
+/*
+ Writing bytes to the hard disk.
+
+ Returns true if the time limit will be exceeded before writing the bit or complete byte.
+*/
+bool mfm_harddisk_device::write(attotime &from_when, const attotime &limit, UINT16 cdata)
{
- UINT32 lba;
- if (VERBOSE>5) LOG("ti99_hd: read_sector(%d, %d, %d)\n", cylinder, head, sector);
- hard_disk_file *file = m_drive->get_hard_disk_file();
+ UINT16* track = m_cache->get_trackimage(m_current_cylinder, m_current_head);
- if (cylinder != m_current_cylinder)
+ if (track==NULL)
{
- return;
+ // What shall we do in this case?
+ throw emu_fatalerror("Cannot read CHD image");
}
- if (file==NULL)
- {
- m_status &= ~MFMHD_READY;
- return;
- }
+ int bytepos = 0;
+ int bitpos = 0;
- if (!harddisk_chs_to_lba(file, cylinder, head, sector, &lba))
+ bool offlimit = find_position(from_when, limit, bytepos, bitpos);
+ if (offlimit) return true;
+
+ m_cache->mark_current_as_dirty();
+
+ if (m_encoding == MFM_BITS)
{
- m_status &= ~MFMHD_READY;
- return;
+ // We will write a single bit
+ if (cdata != 0) track[bytepos] |= (0x8000 >> bitpos);
+ else track[bytepos] &= ~(0x8000 >> bitpos);
+ bitpos++;
}
-
- if (!hard_disk_read(file, lba, buf))
+ else
{
- m_status &= ~MFMHD_READY;
- return;
+ // We will write a whole byte
+ track[bytepos] = cdata;
}
- /* printf("ti99_hd read sector c=%04d h=%02d s=%02d\n", cylinder, head, sector); */
- m_status |= MFMHD_READY;
+
+ if (TRACE_WRITE) if ((bitpos&0x0f)==0) logerror("%s: Wrote data=%04x (c=%d,h=%d) at position %04x\n", tag(), track[bytepos], m_current_cylinder, m_current_head, bytepos);
+ return false;
+}
+
+mfm_hd_generic_device::mfm_hd_generic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+: mfm_harddisk_device(mconfig, MFMHD_GENERIC, "Generic MFM hard disk", tag, owner, clock, "mfm_harddisk", __FILE__)
+{
+}
+
+const device_type MFMHD_GENERIC = &device_creator<mfm_hd_generic_device>;
+
+/*
+ Various models.
+*/
+mfm_hd_st213_device::mfm_hd_st213_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+: mfm_harddisk_device(mconfig, MFMHD_ST213, "Seagate ST-213 MFM hard disk", tag, owner, clock, "mfm_hd_st213", __FILE__)
+{
+ m_phys_cylinders = 670;
+ m_max_cylinders = 615; // 0..614
+ m_park_pos = 620;
+ m_max_heads = 2;
+ m_seeknext_time = 20; // time for one step including settle time
+ m_maxseek_time = 150;
+}
+
+const device_type MFMHD_ST213 = &device_creator<mfm_hd_st213_device>;
+
+mfm_hd_st225_device::mfm_hd_st225_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+: mfm_harddisk_device(mconfig, MFMHD_ST225, "Seagate ST-225 MFM hard disk", tag, owner, clock, "mfm_hd_st225", __FILE__)
+{
+ m_phys_cylinders = 670;
+ m_max_cylinders = 615;
+ m_park_pos = 620;
+ m_max_heads = 4;
+ m_seeknext_time = 20;
+ m_maxseek_time = 150;
+}
+
+const device_type MFMHD_ST225 = &device_creator<mfm_hd_st225_device>;
+
+mfm_hd_st251_device::mfm_hd_st251_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+: mfm_harddisk_device(mconfig, MFMHD_ST251, "Seagate ST-251 MFM hard disk", tag, owner, clock, "mfm_hd_st251", __FILE__)
+{
+ m_phys_cylinders = 821;
+ m_max_cylinders = 820;
+ m_park_pos = 820;
+ m_max_heads = 6;
+ m_seeknext_time = 8;
+ m_maxseek_time = 70;
}
-void mfm_harddisk_legacy_device::write_sector(int cylinder, int head, int sector, UINT8 *buf)
+const device_type MFMHD_ST251 = &device_creator<mfm_hd_st251_device>;
+
+// ===========================================================
+// Track cache
+// The cache holds track images to be read by the controller.
+// This is a write-back LRU cache.
+// ===========================================================
+
+mfmhd_trackimage_cache::mfmhd_trackimage_cache():
+ m_tracks(NULL)
{
- UINT32 lba;
- if (VERBOSE>5) LOG("ti99_hd: write_sector(%d, %d, %d)\n", cylinder, head, sector);
- hard_disk_file *file = m_drive->get_hard_disk_file();
+ m_current_crc = 0;
+ m_tracksize = 0;
+}
- if (file==NULL)
+mfmhd_trackimage_cache::~mfmhd_trackimage_cache()
+{
+ mfmhd_trackimage* current = m_tracks;
+ if (TRACE_CACHE) logerror("%s: MFM HD cache destroy\n", tag());
+
+ while (current != NULL)
{
- m_status &= ~MFMHD_READY;
- return;
+ global_free_array(current->encdata);
+ mfmhd_trackimage* currenttmp = current->next;
+ global_free(current);
+ current = currenttmp;
}
+}
- if (!harddisk_chs_to_lba(file, cylinder, head, sector, &lba))
+void mfmhd_trackimage_cache::write_back_one()
+{
+ mfmhd_trackimage* current = m_tracks;
+
+ while (current != NULL)
{
- m_status &= ~MFMHD_READY;
- m_status |= MFMHD_WRFAULT;
- return;
+ if (current->dirty)
+ {
+ // write_track(m_chd, current->encdata, m_tracksize, current->cylinder, current->head);
+ m_format->save(tag(), m_chd, current->encdata, m_encoding, m_tracksize, current->cylinder, current->head, m_cylinders, m_heads, m_sectors_per_track);
+ current->dirty = false;
+ break;
+ }
+ mfmhd_trackimage* currenttmp = current->next;
+ current = currenttmp;
}
+}
- if (!hard_disk_write(file, lba, buf))
+void mfmhd_trackimage_cache::cleanup()
+{
+ mfmhd_trackimage* current = m_tracks;
+ if (TRACE_CACHE) logerror("%s: MFM HD cache cleanup\n", tag());
+
+ // Still dirty?
+ while (current != NULL)
{
- m_status &= ~MFMHD_READY;
- m_status |= MFMHD_WRFAULT;
- return;
+ if (TRACE_CACHE) logerror("%s: MFM HD cache: evict line cylinder=%d head=%d\n", tag(), current->cylinder, current->head);
+ if (current->dirty)
+ {
+ // write_track(m_chd, current->encdata, m_tracksize, current->cylinder, current->head);
+ m_format->save(tag(), m_chd, current->encdata, m_encoding, m_tracksize, current->cylinder, current->head, m_cylinders, m_heads, m_sectors_per_track);
+ current->dirty = false;
+ }
+ mfmhd_trackimage* currenttmp = current->next;
+ current = currenttmp;
}
+}
- m_status |= MFMHD_READY;
+/*
+ Marks the recently loaded track as dirty. As every writing operations
+ is preceded by a lookup, writing will always be done on the first track in the list.
+*/
+void mfmhd_trackimage_cache::mark_current_as_dirty()
+{
+ m_tracks->dirty = true;
}
+const char *encnames[] = { "MFM_BITS","MFM_BYTE","SEPARATE","SSIMPLE " };
+
/*
- Searches a block containing number * byte, starting at the given
- position. Returns the position of the first byte of the block.
+ Initialize the cache by loading the first <trackslots> tracks.
*/
-int mfm_harddisk_legacy_device::find_block(const UINT8 *buffer, int start, int stop, UINT8 byte, size_t number)
+void mfmhd_trackimage_cache::init(chd_file* chdfile, const char* dtag, int tracksize, int imagecyl, int imageheads, int imagesecpt, int trackslots, mfmhd_enc_t encoding, mfmhd_image_format_t* format)
{
- int i = start;
- size_t current = number;
- while (i < stop && current > 0)
+ m_encoding = encoding;
+ m_tagdev = dtag;
+
+ if (TRACE_CACHE) logerror("%s: MFM HD cache init; using encoding %s; cache size is %d tracks\n", m_tagdev, encnames[encoding], trackslots);
+ chd_error state = CHDERR_NONE;
+ mfmhd_trackimage* previous = NULL;
+ mfmhd_trackimage* current = NULL;
+ std::string metadata;
+
+ m_tracksize = tracksize;
+ m_chd = chdfile;
+ m_format = format;
+ m_cylinders = imagecyl;
+ m_heads = imageheads;
+ m_sectors_per_track = imagesecpt;
+
+ // Load some tracks into the cache
+ int track = 0;
+ int head = 0;
+ int cylinder = 0;
+ while (track < trackslots)
{
- if (buffer[i++] != byte)
+ if (TRACE_CACHE && TRACE_DETAIL) logerror("%s: MFM HD allocate cache slot\n", tag());
+ previous = current;
+ current = global_alloc(mfmhd_trackimage);
+ current->encdata = global_alloc_array(UINT16, tracksize);
+
+ // Load the first tracks into the slots
+ // state = load_track(m_chd, current->encdata, m_tracksize, cylinder, head);
+
+ state = m_format->load(tag(), m_chd, current->encdata, m_encoding, m_tracksize, cylinder, head, m_cylinders, m_heads, m_sectors_per_track);
+
+ current->dirty = false;
+ current->cylinder = cylinder;
+ current->head = head;
+
+ if (state != CHDERR_NONE) throw emu_fatalerror("Cannot load (c=%d,h=%d) from hard disk", cylinder, head);
+
+ // We will read all heads per cylinder first, then go to the next cylinder.
+ if (++head >= m_heads)
{
- current = number;
+ head = 0;
+ cylinder++;
}
+ current->next = NULL;
+
+ if (previous != NULL)
+ previous->next = current;
else
- {
- current--;
- }
- }
- if (current==0)
- {
- return i - number;
+ // Head
+ m_tracks = current;
+
+ // Count the number of loaded tracks
+ track++;
}
- else
- return TI99HD_BLOCKNOTFOUND;
}
-int mfm_harddisk_legacy_device::get_track_length()
+/*
+ Delivers the track image.
+ First look up the track image in the cache. If not present, load it from
+ the CHD, convert it, and evict the least recently used line.
+ The searched track will be the first in m_tracks.
+*/
+UINT16* mfmhd_trackimage_cache::get_trackimage(int cylinder, int head)
{
- int count;
- int size;
- hard_disk_file *file = m_drive->get_hard_disk_file();
- const hard_disk_info *info;
+ // Search the cached track images
+ mfmhd_trackimage* current = m_tracks;
+ mfmhd_trackimage* previous = NULL;
+
+ chd_error state = CHDERR_NONE;
+
+ // Repeat the search. This loop should run at most twice; once for a direct hit,
+ // and twice on miss, then the second iteration will be a hit.
+ while (state == CHDERR_NONE)
+ {
+ // A simple linear search
+ while (current != NULL)
+ {
+ if (current->cylinder == cylinder && current->head == head)
+ {
+ // found it
+ // move it to the front of the chain for LRU
+ if (previous != NULL)
+ {
+ previous->next = current->next; // pull out here
+ current->next = m_tracks; // put the previous head into the next field
+ m_tracks = current; // set this line as new head
+ }
+ return current->encdata;
+ }
+ else
+ {
+ // Don't lose the pointer to the next tail
+ if (current->next != NULL) previous = current;
+ current = current->next;
+ }
+ }
+ // If we are here, we have a cache miss.
+ // Evict the last line
+ // Load the new line into that line
+ // Then look it up again, which will move it to the front
- if (file==NULL) return 0;
- info = hard_disk_get_info(file);
+ // previous points to the second to last element
+ current = previous->next;
+ if (TRACE_CACHE) logerror("%s: MFM HD cache: evict line (c=%d,h=%d)\n", tag(), current->cylinder, current->head);
- count = info->sectors;
- size = info->sectorbytes/128;
- return GAP1 + count*(SYNC+12+GAP2+SYNC+size*128+GAP3)+GAP4;
+ if (current->dirty)
+ {
+ // write_track(m_chd, current->encdata, m_tracksize, current->cylinder, current->head);
+ m_format->save(tag(), m_chd, current->encdata, m_encoding, m_tracksize, current->cylinder, current->head, m_cylinders, m_heads, m_sectors_per_track);
+ current->dirty = false;
+ }
+
+ // state = load_track(m_chd, current->encdata, m_tracksize, cylinder, head);
+ state = m_format->load(tag(), m_chd, current->encdata, m_encoding, m_tracksize, cylinder, head, m_cylinders, m_heads, m_sectors_per_track);
+
+ current->dirty = false;
+ current->cylinder = cylinder;
+ current->head = head;
+ }
+ // If we are here we have a CHD error.
+ return NULL;
}
-/*
- Reads a complete track. We have to rebuild the gaps. This is basically
- done in the same way as in the SDF format in ti99_dsk.
+// ================================================================
- WARNING: This function is untested! We need to create a suitable
- application program for the TI which makes use of it.
-*/
-void mfm_harddisk_legacy_device::read_track(int head, UINT8 *trackdata)
+mfm_harddisk_connector::mfm_harddisk_connector(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock):
+ device_t(mconfig, MFM_HD_CONNECTOR, "MFM hard disk connector", tag, owner, clock, "mfm_hd_connector", __FILE__),
+ device_slot_interface(mconfig, *this)
{
- /* We assume an interleave of 3 for 32 sectors. */
- int step = 3;
- UINT32 lba;
- int i;
+}
- int size;
- int position = 0;
- int sector;
- int crc;
- int count;
+mfm_harddisk_connector::~mfm_harddisk_connector()
+{
+}
- const hard_disk_info *info;
- hard_disk_file *file = m_drive->get_hard_disk_file();
+mfm_harddisk_device* mfm_harddisk_connector::get_device()
+{
+ return dynamic_cast<mfm_harddisk_device *>(get_card_device());
+}
- if (file==NULL)
+void mfm_harddisk_connector::configure(mfmhd_enc_t encoding, int spinupms, int cache, const mfmhd_format_type format)
+{
+ m_encoding = encoding;
+ m_spinupms = spinupms;
+ m_cachesize = cache;
+ m_format = format();
+}
+
+void mfm_harddisk_connector::device_config_complete()
+{
+ mfm_harddisk_device *dev = get_device();
+ if (dev != NULL)
{
- m_status &= ~MFMHD_READY;
- return;
+ dev->set_encoding(m_encoding);
+ dev->set_spinup_time(m_spinupms);
+ dev->set_cache_size(m_cachesize);
+ dev->set_format(m_format);
}
+}
- info = hard_disk_get_info(file);
-
- count = info->sectors;
- size = info->sectorbytes/128;
-
- /* Write lead-in. */
- memset(trackdata, 0x4e, GAP1);
+const device_type MFM_HD_CONNECTOR = &device_creator<mfm_harddisk_connector>;
- position += GAP1;
- for (i=0; i < count; i++)
- {
- sector = (i*step) % info->sectors;
- memset(&trackdata[position], 0x00, SYNC);
- position += SYNC;
+// ================================================================
- /* Write sync */
- trackdata[position++] = 0xa1;
+mfmhd_image_format_t::mfmhd_image_format_t()
+{
+};
- /* Write IDAM */
- trackdata[position++] = cylinder_to_ident(m_current_cylinder);
- trackdata[position++] = m_current_cylinder;
- trackdata[position++] = head;
- trackdata[position++] = sector;
- trackdata[position++] = (size==1)? 0x00 : (0x01 << (size-1));
+mfmhd_image_format_t::~mfmhd_image_format_t()
+{
+};
- /* Set CRC16 */
- crc = ccitt_crc16(0xffff, &trackdata[position-5], 5);
- trackdata[position++] = (crc>>8)&0xff;
- trackdata[position++] = crc & 0xff;
+void mfmhd_image_format_t::mfm_encode(UINT16* trackimage, int& position, UINT8 byte, int count)
+{
+ mfm_encode_mask(trackimage, position, byte, count, 0x00);
+}
- /* Write Gap2 */
- memset(&trackdata[position], 0x4e, GAP2);
- position += GAP2;
+void mfmhd_image_format_t::mfm_encode_a1(UINT16* trackimage, int& position)
+{
+ m_current_crc = 0xffff;
+ mfm_encode_mask(trackimage, position, 0xa1, 1, 0x04);
+ // 0x443b; CRC for A1
+}
- /* Write sync */
- memset(&trackdata[position], 0x00, SYNC);
- position += SYNC;
- trackdata[position++] = 0xa1;
+void mfmhd_image_format_t::mfm_encode_mask(UINT16* trackimage, int& position, UINT8 byte, int count, int mask)
+{
+ UINT16 encclock = 0;
+ UINT16 encdata = 0;
+ UINT8 thisbyte = byte;
+ bool mark = (mask != 0x00);
- /* Write DAM */
- trackdata[position++] = 0xfb;
+ m_current_crc = ccitt_crc16_one(m_current_crc, byte);
- /* Locate the sector content in the image and load it. */
+ for (int i=0; i < 8; i++)
+ {
+ encdata <<= 1;
+ encclock <<= 1;
- if (!harddisk_chs_to_lba(file, m_current_cylinder, head, sector, &lba))
+ if (m_encoding == MFM_BITS || m_encoding == MFM_BYTE)
{
- m_status &= ~MFMHD_READY;
- return;
+ // skip one position for later interleaving
+ encdata <<= 1;
+ encclock <<= 1;
}
- if (!hard_disk_read(file, lba, &trackdata[position]))
+ if (thisbyte & 0x80)
+ {
+ // Encoding 1 => 01
+ encdata |= 1;
+ m_lastbit = true;
+ }
+ else
{
- m_status &= ~MFMHD_READY;
- return;
+ // Encoding 0 => x0
+ // If the bit in the mask is set, suppress the clock bit
+ // Also, if we use the simplified encoding, don't set the clock bits
+ if (m_lastbit == false && m_encoding != SEPARATED_SIMPLE && (mask & 0x80) == 0) encclock |= 1;
+ m_lastbit = false;
}
+ mask <<= 1;
+ // For simplified encoding, set all clock bits to indicate a mark
+ if (m_encoding == SEPARATED_SIMPLE && mark) encclock |= 1;
+ thisbyte <<= 1;
+ }
- position += info->sectorbytes;
+ if (m_encoding == MFM_BITS || m_encoding == MFM_BYTE)
+ encclock <<= 1;
+ else
+ encclock <<= 8;
- /* Set CRC16. Includes the address mark. */
- crc = ccitt_crc16(0xffff, &trackdata[position-size-1], size+1);
- trackdata[position++] = (crc>>8)&0xff;
- trackdata[position++] = crc & 0xff;
+ trackimage[position++] = (encclock | encdata);
- /* Write remaining 3 bytes which would have been used for ECC. */
- memset(&trackdata[position], 0x00, 3);
- position += 3;
+ // When we write the byte multiple times, check whether the next encoding
+ // differs from the previous because of the last bit
- /* Write Gap3 */
- memset(&trackdata[position], 0x4e, GAP3);
- position += GAP3;
+ if (m_encoding == MFM_BITS || m_encoding == MFM_BYTE)
+ {
+ encclock &= 0x7fff;
+ if ((byte & 0x80)==0 && m_lastbit==false) encclock |= 0x8000;
+ }
+
+ for (int j=1; j < count; j++)
+ {
+ trackimage[position++] = (encclock | encdata);
+ m_current_crc = ccitt_crc16_one(m_current_crc, byte);
}
- /* Write Gap 4 */
- memset(&trackdata[position], 0x4e, GAP4);
- position += GAP4;
+}
+
+UINT8 mfmhd_image_format_t::mfm_decode(UINT16 raw)
+{
+ unsigned int value = 0;
- m_status |= MFMHD_READY;
+ for (int i=0; i < 8; i++)
+ {
+ value <<= 1;
+
+ value |= (raw & 0x4000);
+ raw <<= 2;
+ }
+ return (value >> 14) & 0xff;
}
/*
- Writes a track to the image. We need to isolate the sector contents.
- This is basically done in the same way as in the SDF format in ti99_dsk.
+ For debugging. Outputs the byte array in a xxd-like way.
*/
-void mfm_harddisk_legacy_device::write_track(int head, UINT8 *track_image, int data_count)
+void mfmhd_image_format_t::showtrack(UINT16* enctrack, int length)
{
- int current_pos = 0;
- bool found;
- // UINT8 wident;
- UINT8 whead = 0, wsector = 0;
- // UINT8 wsize;
- UINT16 wcyl = 0;
- int state;
+ for (int i=0; i < length; i+=16)
+ {
+ logerror("%07x: ", i);
+ for (int j=0; j < 16; j++)
+ {
+ logerror("%04x ", enctrack[i+j]);
+ }
+ logerror(" ");
+ logerror("\n");
+ }
+}
- /* Only search in the first 100 bytes for the start. */
+// ======================================================================
+// TI-99-specific format
+// ======================================================================
- UINT32 lba;
- hard_disk_file *file = m_drive->get_hard_disk_file();
+const mfmhd_format_type MFMHD_TI99_FORMAT = &mfmhd_image_format_creator<ti99_mfmhd_format>;
- /* printf("ti99_hd write track c=%d h=%d\n", m_current_cylinder, head); */
+enum
+{
+ SEARCH_A1=0,
+ FOUND_A1,
+ DAM_FOUND,
+ CHECK_CRC
+};
- if (file==NULL)
- {
- m_status &= ~MFMHD_READY;
- return;
- }
- current_pos = find_block(track_image, 0, 100, 0x4e, GAP1);
+/*
+ Calculate the ident byte from the cylinder. The specification does not
+ define idents beyond cylinder 1023, but formatting programs seem to
+ continue with 0xfd for cylinders between 1024 and 2047.
+*/
+UINT8 ti99_mfmhd_format::cylinder_to_ident(int cylinder)
+{
+ if (cylinder < 256) return 0xfe;
+ if (cylinder < 512) return 0xff;
+ if (cylinder < 768) return 0xfc;
+ return 0xfd;
+}
+
+/*
+ Returns the linear sector number, given the CHS data.
- // In case of defect formats, we continue as far as possible. This
- // may lead to sectors not being written. */
- if (current_pos==TI99HD_BLOCKNOTFOUND)
+ C,H,S
+ | 0,0,0 | 0,0,1 | 0,0,2 | ...
+ | 0,1,0 | 0,1,1 | 0,1,2 | ...
+ ...
+ | 1,0,0 | ...
+ ...
+*/
+int ti99_mfmhd_format::chs_to_lba(int cylinder, int head, int sector)
+{
+ if ((cylinder < m_cylinders) && (head < m_heads) && (sector < m_sectors_per_track))
{
- logerror("ti99_hd error: write track: Cannot find GAP1 for cylinder %d, head %d.\n", m_current_cylinder, head);
- /* What now? The track data are illegal, so we refuse to continue. */
- m_status |= MFMHD_WRFAULT;
- return;
+ return (cylinder * m_heads + head) * m_sectors_per_track + sector;
}
+ else return -1;
+}
- /* Get behind GAP1 */
- current_pos += GAP1;
- found = false;
+chd_error ti99_mfmhd_format::load(const char* tagdev, chd_file* chdfile, UINT16* trackimage, mfmhd_enc_t encoding, int tracksize, int cylinder, int head, int cylcnt, int headcnt, int sect_per_track)
+{
+ chd_error state = CHDERR_NONE;
+
+ int sectorcount = 32;
+ int size = 256;
+ int interleave = 4;
+
+ m_encoding = encoding;
+ m_cylinders = cylcnt;
+ m_heads = headcnt;
+ m_sectors_per_track = sect_per_track;
+ m_tagdev = tagdev;
+
+ UINT8 sector_content[1024];
+
+ if (TRACE_RWTRACK) logerror("%s: MFM HD cache: load track (c=%d,h=%d) from CHD\n", tag(), cylinder, head);
+
+ m_lastbit = false;
+ int position = 0; // will be incremented by each encode call
+
+ // According to MDM5 formatting:
+ // gap0=16 gap1=16 gap2=3 gap3=22 sync=13 count=32 size=2
+
+ // HFDC manual: When using the hard disk format, the values for GAP0 and GAP1 must
+ // both be set to the same number and loaded in the appropriate registers.
+
+ // Gap 1
+ mfm_encode(trackimage, position, 0x4e, 16);
+
+ int sec_il_start = 0;
+ int sec_number = 0;
+ int identfield = 0;
+ int cylfield = 0;
+ int headfield = 0;
+ int sizefield = (size >> 7)-1;
+
+ // Round up
+ int delta = (sectorcount + interleave-1) / interleave;
- while (current_pos < data_count)
+ if (TRACE_DETAIL) logerror("%s: cyl=%d head=%d: sector sequence = ", tag(), cylinder, head);
+ for (int sector = 0; sector < sectorcount; sector++)
{
- /* We must find the address block to determine the sector. */
- int new_pos = find_block(track_image, current_pos, data_count, 0x00, SYNC);
- if (new_pos==TI99HD_BLOCKNOTFOUND)
- {
- /* Forget about the rest; we're done. */
- if (found) break; /* we were already successful, so all ok */
- logerror("ti99_hd error: write track: Cannot find sync for track %d, head %d.\n", m_current_cylinder, head);
- m_status |= MFMHD_WRFAULT;
- return;
- }
- found = true;
+ if (TRACE_DETAIL) logerror("%02d ", sec_number);
- new_pos = new_pos + SYNC; /* skip sync bytes */
+ // Sync gap
+ mfm_encode(trackimage, position, 0x00, 13);
- if (track_image[new_pos]==0xa1)
- {
- /* IDAM found. */
- current_pos = new_pos + 1;
- // wident = track_image[current_pos]; // unused
- wcyl = track_image[current_pos+1] + ((track_image[current_pos+2]&0x70)<<4);
- whead = track_image[current_pos+2]&0x0f;
- wsector = track_image[current_pos+3];
- // wsize = track_image[current_pos+4]; // unused
-
- if (wcyl == m_current_cylinder && whead == head)
- {
- if (!harddisk_chs_to_lba(file, wcyl, whead, wsector, &lba))
- {
- m_status |= MFMHD_WRFAULT;
- return;
- }
+ // Write IDAM
+ mfm_encode_a1(trackimage, position);
- /* Skip to the sector content. */
- new_pos = find_block(track_image, current_pos, data_count, 0x00, SYNC);
- current_pos = new_pos + SYNC;
- if (track_image[current_pos]==0xa1)
- {
- current_pos += 2;
- state = hard_disk_write(file, lba, track_image+current_pos);
- if (state==0)
- {
- logerror("ti99_hd error: write track: Write error during formatting cylinder %d, head %d\n", wcyl, whead);
- m_status |= MFMHD_WRFAULT;
- return;
- }
- current_pos = current_pos+256+2; /* Skip contents and CRC */
- }
- else
- {
- logerror("ti99_hd error: write track: Cannot find DAM for cylinder %d, head %d, sector %d.\n", wcyl, whead, wsector);
- m_status |= MFMHD_WRFAULT;
- return;
- }
- }
- else
- {
- logerror("ti99_hd error: write track: Cylinder/head mismatch. Drive is on cyl=%d, head=%d, track data say cyl=%d, head=%d\n", m_current_cylinder, head, wcyl, whead);
- m_status |= MFMHD_WRFAULT;
- }
+ // Write header
+ identfield = cylinder_to_ident(cylinder);
+ cylfield = cylinder & 0xff;
+ headfield = ((cylinder & 0x700)>>4) | (head&0x0f);
+
+ mfm_encode(trackimage, position, identfield);
+ mfm_encode(trackimage, position, cylfield);
+ mfm_encode(trackimage, position, headfield);
+ mfm_encode(trackimage, position, sec_number);
+ mfm_encode(trackimage, position, sizefield);
+ // logerror("%s: Created header (%02x,%02x,%02x,%02x)\n", tag(), identfield, cylfield, headfield, sector);
+
+ // Write CRC for header.
+ int crc = m_current_crc;
+ mfm_encode(trackimage, position, (crc >> 8) & 0xff);
+ mfm_encode(trackimage, position, crc & 0xff);
+
+ // Gap 2
+ mfm_encode(trackimage, position, 0x4e, 3);
+
+ // Sync
+ mfm_encode(trackimage, position, 0x00, 13);
+
+ // Write DAM
+ mfm_encode_a1(trackimage, position);
+ mfm_encode(trackimage, position, 0xfb);
+
+ // Get sector content from CHD
+ int lbaposition = chs_to_lba(cylinder, head, sec_number);
+ if (lbaposition>=0)
+ {
+ chd_error state = chdfile->read_units(lbaposition, sector_content);
+ if (state != CHDERR_NONE) break;
}
else
{
- logerror("ti99_hd error: write track: Invalid track image for cyl=%d, head=%d. Cannot find any IDAM in track data.\n", m_current_cylinder, head);
- m_status |= MFMHD_WRFAULT;
- return;
+ logerror("%s: Invalid CHS data (%d,%d,%d); not loading from CHD\n", tag(), cylinder, head, sector);
}
- }
-}
-UINT8 mfm_harddisk_legacy_device::get_status()
-{
- UINT8 status = 0;
- hard_disk_file *file = m_drive->get_hard_disk_file();
- if (file!=NULL)
- status |= MFMHD_READY;
+ for (int i=0; i < size; i++)
+ mfm_encode(trackimage, position, sector_content[i]);
- if (m_current_cylinder==0)
- status |= MFMHD_TRACK00;
+ // Write CRC for content.
+ crc = m_current_crc;
+ mfm_encode(trackimage, position, (crc >> 8) & 0xff);
+ mfm_encode(trackimage, position, crc & 0xff);
- if (!m_seeking)
- status |= MFMHD_SEEKCOMP;
+ // Gap 3
+ mfm_encode(trackimage, position, 0x00, 3);
+ mfm_encode(trackimage, position, 0x4e, 19);
- if (m_id_index == 0)
- status |= MFMHD_INDEX;
+ // Calculate next sector number
+ sec_number += delta;
+ if (sec_number >= sectorcount) sec_number = ++sec_il_start;
+ }
+ if (TRACE_DETAIL) logerror("\n");
- m_status = status;
- if (VERBOSE>5) LOG("ti99_hd: request status reply = %02x\n", status);
- return status;
+ // Gap 4
+ if (state == CHDERR_NONE)
+ {
+ // Fill the rest with 0x4e
+ mfm_encode(trackimage, position, 0x4e, tracksize-position);
+ if (TRACE_IMAGE)
+ {
+ showtrack(trackimage, tracksize);
+ }
+ }
+ return state;
}
-void mfm_harddisk_legacy_device::seek(int direction)
+chd_error ti99_mfmhd_format::save(const char* tagdev, chd_file* chdfile, UINT16* trackimage, mfmhd_enc_t encoding, int tracksize, int current_cylinder, int current_head, int cylcnt, int headcnt, int sect_per_track)
{
- const hard_disk_info *info;
- hard_disk_file *file = m_drive->get_hard_disk_file();
-
- if (file==NULL) return;
+ if (TRACE_CACHE) logerror("%s: MFM HD cache: write back (c=%d,h=%d) to CHD\n", tag(), current_cylinder, current_head);
- info = hard_disk_get_info(file);
+ UINT8 buffer[1024]; // for header or sector content
- m_seeking = true;
+ int bytepos = 0;
+ int state = SEARCH_A1;
+ int count = 0;
+ int pos = 0;
+ UINT16 crc = 0;
+ UINT8 byte;
+ bool search_header = true;
- if (direction<0)
- {
- if (m_current_cylinder>0)
- m_current_cylinder--;
- }
- else
- {
- if (m_current_cylinder < info->cylinders)
- m_current_cylinder++;
- }
+ int ident = 0;
+ int cylinder = 0;
+ int head = 0;
+ int sector = 0;
- // TODO: Requires timer
+ int headerpos = 0;
- m_seeking = false;
-}
+ int calc_interleave = 0;
+ int interleave_prec = -1;
+ bool check_interleave = true;
-void mfm_harddisk_legacy_device::get_next_id(int head, chrn_id_hd *id)
-{
- const hard_disk_info *info;
- hard_disk_file *file;
- int interleave = 3;
+ chd_error chdstate = CHDERR_NONE;
- file = m_drive->get_hard_disk_file();
+ m_encoding = encoding;
+ m_cylinders = cylcnt;
+ m_heads = headcnt;
+ m_sectors_per_track = sect_per_track;
+ m_tagdev = tagdev;
- if (file==NULL)
+ if (TRACE_IMAGE)
{
- m_status &= ~MFMHD_READY;
- return;
+ for (int i=0; i < tracksize; i++)
+ {
+ if ((i % 16)==0) logerror("\n%04x: ", i);
+ logerror("%02x ", (m_encoding==MFM_BITS || m_encoding==MFM_BYTE)? mfm_decode(trackimage[i]) : (trackimage[i]&0xff));
+ }
+ logerror("\n");
}
- info = hard_disk_get_info(file);
+ // We have to go through the bytes of the track and save a sector as soon as one shows up
+ while (bytepos < tracksize)
+ {
+ switch (state)
+ {
+ case SEARCH_A1:
+ if (((m_encoding==MFM_BITS || m_encoding==MFM_BYTE) && trackimage[bytepos]==0x4489)
+ || (m_encoding==SEPARATED && trackimage[bytepos]==0x0aa1)
+ || (m_encoding==SEPARATED_SIMPLE && trackimage[bytepos]==0xffa1))
+ {
+ state = FOUND_A1;
+ count = search_header? 7 : 259;
+ crc = 0x443b; // init value with a1
+ pos = 0;
+ }
+ bytepos++;
+ break;
- m_current_head = head;
+ case FOUND_A1:
+ // read next values into array
+ if (m_encoding==MFM_BITS || m_encoding==MFM_BYTE)
+ {
+ byte = mfm_decode(trackimage[bytepos]);
+ }
+ else byte = (trackimage[bytepos] & 0xff);
- /* TODO: implement an interleave suitable for the number of sectors in the track. */
- m_id_index = (m_id_index + interleave) % info->sectors;
+ crc = ccitt_crc16_one(crc, byte);
+ // logerror("%s: MFM HD: Byte = %02x, CRC=%04x\n", tag(), byte, crc);
- /* build a new info block. */
- id->C = m_current_cylinder;
- id->H = m_current_head;
- id->R = m_id_index;
- id->N = 1;
- id->data_id = m_id_index;
- id->flags = 0;
-}
+ // Put byte into buffer
+ // but not the data mark and the CRC
+ if (search_header || (count > 2 && count < 259)) buffer[pos++] = byte;
-void mfm_harddisk_legacy_device::device_start()
-{
- m_current_cylinder = 0;
- m_current_head = 0;
-}
+ if (--count == 0)
+ {
+ if (crc==0)
+ {
+ if (search_header)
+ {
+ // Found a header
+ ident = buffer[0];
+ // Highest three bits are in the head field
+ cylinder = buffer[1] | ((buffer[2]&0x70)<<4);
+ head = buffer[2] & 0x0f;
+ sector = buffer[3];
+ int identexp = cylinder_to_ident(cylinder);
+
+ if (identexp != ident)
+ {
+ logerror("%s: MFM HD: Field error; ident = %02x (expected %02x) for sector chs=(%d,%d,%d)\n", tag(), ident, identexp, cylinder, head, sector);
+ }
+
+ if (cylinder != current_cylinder)
+ {
+ logerror("%s: MFM HD: Sector header of sector %d defines cylinder = %02x (should be %02x)\n", tag(), sector, cylinder, current_cylinder);
+ }
+
+ if (head != current_head)
+ {
+ logerror("%s: MFM HD: Sector header of sector %d defines head = %02x (should be %02x)\n", tag(), sector, head, current_head);
+ }
+
+ // Count the sectors for the interleave
+ if (check_interleave)
+ {
+ if (interleave_prec == -1) interleave_prec = sector;
+ else
+ {
+ if (sector == interleave_prec+1) check_interleave = false;
+ calc_interleave++;
+ }
+ }
+
+ if (calc_interleave == 0) calc_interleave = sector - buffer[3];
+ // size = buffer[4];
+ search_header = false;
+ if (TRACE_DETAIL) logerror("%s: MFM HD: Found sector chs=(%d,%d,%d)\n", tag(), cylinder, head, sector);
+ headerpos = pos;
+ }
+ else
+ {
+ // Sector contents
+ // Write the sectors to the CHD
+ int lbaposition = chs_to_lba(cylinder, head, sector);
+ if (lbaposition>=0)
+ {
+ if (TRACE_DETAIL) logerror("%s: MFM HD: Writing sector chs=(%d,%d,%d) to CHD\n", tag(), current_cylinder, current_head, sector);
+ chdstate = chdfile->write_units(chs_to_lba(current_cylinder, current_head, sector), buffer);
+
+ if (chdstate != CHDERR_NONE)
+ {
+ logerror("%s: MFM HD: Write error while writing sector chs=(%d,%d,%d)\n", tag(), cylinder, head, sector);
+ }
+ }
+ else
+ {
+ logerror("%s: Invalid CHS data in track image: (%d,%d,%d); not saving to CHD\n", tag(), cylinder, head, sector);
+ }
+
+ search_header = true;
+ }
+ }
+ else
+ {
+ logerror("%s: MFM HD: CRC error in %s of (%d,%d,%d)\n", tag(), search_header? "header" : "data", cylinder, head, sector);
+ search_header = true;
+ }
+ // search next A1
+ state = SEARCH_A1;
-void mfm_harddisk_legacy_device::device_reset()
-{
- m_drive = static_cast<harddisk_image_device *>(subdevice("drive"));
- m_seeking = false;
- m_status = 0;
- m_id_index = 0;
-}
+ if (!search_header && (pos - headerpos) > 30)
+ {
+ logerror("%s: MFM HD: Error; missing DAM; searching next header\n", tag());
+ search_header = true;
+ }
+ }
+ bytepos++;
+ break;
+ }
+ }
-MACHINE_CONFIG_FRAGMENT( mfmhd )
- MCFG_HARDDISK_ADD("drive")
-MACHINE_CONFIG_END
+ if (check_interleave == false)
+ {
+ // Successfully determined the interleave
+ m_interleave = calc_interleave;
+ }
-machine_config_constructor mfm_harddisk_legacy_device::device_mconfig_additions() const
-{
- return MACHINE_CONFIG_NAME( mfmhd );
-}
+ if (TRACE_CACHE)
+ {
+ logerror("%s: MFM HD cache: write back complete (c=%d,h=%d), interleave = %d\n", tag(), current_cylinder, current_head, m_interleave);
+ }
-const device_type TI99_MFMHD_LEG = &device_creator<mfm_harddisk_legacy_device>;
+ return chdstate;
+}
diff --git a/src/emu/machine/ti99_hd.h b/src/emu/machine/ti99_hd.h
index 7f2a5cddf7b..b004ea7cafb 100644
--- a/src/emu/machine/ti99_hd.h
+++ b/src/emu/machine/ti99_hd.h
@@ -17,126 +17,309 @@
#include "emu.h"
#include "imagedev/harddriv.h"
+/*
+ Determine how data are passed from the hard disk to the controller. We
+ allow for different degrees of hardware emulation.
+*/
+enum mfmhd_enc_t
+{
+ MFM_BITS, // One bit at a time
+ MFM_BYTE, // One data byte with interleaved clock bits
+ SEPARATED, // 8 clock bits (most sig byte), one data byte (least sig byte)
+ SEPARATED_SIMPLE // MSB: 00/FF (standard / mark) clock, LSB: one data byte
+};
+
+class mfmhd_image_format_t;
+
+// Pointer to its alloc function
+typedef mfmhd_image_format_t *(*mfmhd_format_type)();
+
+template<class _FormatClass>
+mfmhd_image_format_t *mfmhd_image_format_creator()
+{
+ return new _FormatClass();
+}
+
+class mfmhd_trackimage
+{
+public:
+ bool dirty;
+ int cylinder;
+ int head;
+ UINT16* encdata; // MFM encoding per byte
+ mfmhd_trackimage* next;
+};
+
+class mfmhd_trackimage_cache
+{
+public:
+ mfmhd_trackimage_cache();
+ ~mfmhd_trackimage_cache();
+ void init(chd_file* chdfile, const char* tag, int tracksize, int imagecyls, int imageheads, int imagesecpt, int trackslots, mfmhd_enc_t encoding, mfmhd_image_format_t* format);
+ UINT16* get_trackimage(int cylinder, int head);
+ void mark_current_as_dirty();
+ void cleanup();
+ void write_back_one();
+ int get_cylinders() { return m_cylinders; }
+
+private:
+ chd_file* m_chd;
+
+ const char* m_tagdev;
+ mfmhd_trackimage* m_tracks;
+ mfmhd_enc_t m_encoding;
+ mfmhd_image_format_t* m_format;
+
+ bool m_lastbit;
+ int m_current_crc;
+ int m_cylinders;
+ int m_heads;
+ int m_sectors_per_track;
+ int m_sectorsize;
+ int m_tracksize;
+
+ void showtrack(UINT16* enctrack, int length);
+ const char* tag() { return m_tagdev; }
+};
+
class mfm_harddisk_device : public harddisk_image_device,
public device_slot_card_interface
{
public:
mfm_harddisk_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
+ ~mfm_harddisk_device();
typedef delegate<void (mfm_harddisk_device*, int)> index_pulse_cb;
+ typedef delegate<void (mfm_harddisk_device*, int)> ready_cb;
typedef delegate<void (mfm_harddisk_device*, int)> seek_complete_cb;
void setup_index_pulse_cb(index_pulse_cb cb);
+ void setup_ready_cb(ready_cb cb);
void setup_seek_complete_cb(seek_complete_cb cb);
+ // Configuration
+ void set_encoding(mfmhd_enc_t encoding) { m_encoding = encoding; }
+ void set_spinup_time(int spinupms) { m_spinupms = spinupms; }
+ void set_cache_size(int tracks) { m_cachelines = tracks; }
+ void set_format(mfmhd_image_format_t* format) { m_format = format; }
+
+ mfmhd_enc_t get_encoding() { return m_encoding; }
+
// Active low lines. We're using ASSERT=0 / CLEAR=1
line_state ready_r() { return m_ready? ASSERT_LINE : CLEAR_LINE; }
line_state seek_complete_r() { return m_seek_complete? ASSERT_LINE : CLEAR_LINE; } ;
line_state trk00_r() { return m_current_cylinder==0? ASSERT_LINE : CLEAR_LINE; }
+ // Common routine for read/write
+ bool find_position(attotime &from_when, const attotime &limit, int &bytepos, int &bitpos);
+
+ // Data output towards controller
+ bool read(attotime &from_when, const attotime &limit, UINT16 &data);
+
+ // Data input from controller
+ bool write(attotime &from_when, const attotime &limit, UINT16 data);
+
// Step
void step_w(line_state line);
void direction_in_w(line_state line);
+ // Head select
+ void headsel_w(int head) { m_current_head = head & 0x0f; }
+
+ bool call_load();
+ void call_unload();
+
+ // Tells us the time when the track ends (next index pulse)
+ attotime track_end_time();
+
protected:
void device_start();
+ void device_stop();
void device_reset();
- emu_timer *m_index_timer, *m_spinup_timer, *m_seek_timer;
+ void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
+
+ std::string tts(const attotime &t);
+
+ emu_timer *m_index_timer, *m_spinup_timer, *m_seek_timer, *m_cache_timer;
index_pulse_cb m_index_pulse_cb;
+ ready_cb m_ready_cb;
seek_complete_cb m_seek_complete_cb;
- void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
+
+ int m_max_cylinders;
+ int m_phys_cylinders;
+ int m_actual_cylinders; // after reading the CHD
+ int m_max_heads;
+ int m_park_pos;
+ int m_maxseek_time;
+ int m_seeknext_time;
private:
+ mfmhd_enc_t m_encoding;
+ int m_cell_size; // nanoseconds
+ int m_trackimage_size; // number of 16-bit cell blocks (data bytes)
+ int m_spinupms;
+ int m_rpm;
+ int m_interleave;
+ int m_cachelines;
bool m_ready;
int m_current_cylinder;
+ int m_current_head;
int m_track_delta;
int m_step_phase;
bool m_seek_complete;
bool m_seek_inward;
- //bool m_seeking;
bool m_autotruncation;
+ bool m_recalibrated;
line_state m_step_line; // keep the last state
+ attotime m_spinup_time;
+ attotime m_revolution_start_time;
+ attotime m_rev_time;
+
+ attotime m_settle_time;
+ attotime m_step_time;
+
+ mfmhd_trackimage_cache* m_cache;
+ mfmhd_image_format_t* m_format;
+
+ void prepare_track(int cylinder, int head);
void head_move();
+ void recalibrate();
};
+/*
+ The Generic drive is a MFM drive that has just enough heads and cylinders
+ to handle the CHD image.
+
+ Specific Seagate models:
+
+ ST-213: 10 MB
+ ST-225: 20 MB
+ ST-251: 40 MB
+*/
class mfm_hd_generic_device : public mfm_harddisk_device
{
public:
mfm_hd_generic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
-extern const device_type MFM_HD_GENERIC;
+extern const device_type MFMHD_GENERIC;
-// ===========================================================================
-// Legacy implementation
-// ===========================================================================
-#define MFMHD_0 "mfmhd0"
-#define MFMHD_1 "mfmhd1"
-#define MFMHD_2 "mfmhd2"
+class mfm_hd_st213_device : public mfm_harddisk_device
+{
+public:
+ mfm_hd_st213_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
-extern const device_type TI99_MFMHD_LEG;
+extern const device_type MFMHD_ST213;
-/*
- Needed to adapt to higher cylinder numbers. Floppies do not have such
- high numbers.
-*/
-struct chrn_id_hd
+class mfm_hd_st225_device : public mfm_harddisk_device
{
- UINT16 C;
- UINT8 H;
- UINT8 R;
- UINT8 N;
- int data_id; // id for read/write data command
- unsigned long flags;
+public:
+ mfm_hd_st225_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
-class mfm_harddisk_legacy_device : public device_t
+extern const device_type MFMHD_ST225;
+
+class mfm_hd_st251_device : public mfm_harddisk_device
{
public:
- mfm_harddisk_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ mfm_hd_st251_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+extern const device_type MFMHD_ST251;
- void read_sector(int cylinder, int head, int sector, UINT8 *buf);
- void write_sector(int cylinder, int head, int sector, UINT8 *buf);
- void read_track(int head, UINT8 *buffer);
- void write_track(int head, UINT8 *buffer, int data_count);
- UINT8 get_status();
- void seek(int direction);
- void get_next_id(int head, chrn_id_hd *id);
- int get_track_length();
+
+/* Connector for a MFM hard disk. See also floppy.c */
+class mfm_harddisk_connector : public device_t,
+ public device_slot_interface
+{
+public:
+ mfm_harddisk_connector(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ ~mfm_harddisk_connector();
+
+ mfm_harddisk_device *get_device();
+
+ void configure(mfmhd_enc_t encoding, int spinupms, int cache, mfmhd_format_type format);
protected:
- void device_start();
- void device_reset();
- machine_config_constructor device_mconfig_additions() const;
+ void device_start() { };
+ void device_config_complete();
private:
- int find_block(const UINT8 *buffer, int start, int stop, UINT8 byte, size_t number);
- UINT8 cylinder_to_ident(int cylinder);
- bool harddisk_chs_to_lba(hard_disk_file *hdfile, int cylinder, int head, int sector, UINT32 *lba);
+ mfmhd_enc_t m_encoding;
+ int m_spinupms;
+ int m_cachesize;
+ mfmhd_image_format_t* m_format;
+};
- int m_current_cylinder;
- int m_current_head;
- bool m_seeking;
- int m_status;
- int m_id_index; /* position in track for seeking the sector; counts the sector number */
+extern const device_type MFM_HD_CONNECTOR;
+
+/*
+ Add a harddisk connector.
+ Parameters:
+ _tag = Tag of the connector
+ _slot_intf = Selection of hard drives
+ _def_slot = Default hard drive
+ _enc = Encoding (see comments in ti99_hd.c)
+ _spinupms = Spinup time in milliseconds (some configurations assume that the
+ user has turned on the hard disk before turning on the system. We cannot
+ emulate this, so we allow for shorter times)
+ _cache = number of cached MFM tracks
+*/
+#define MCFG_MFM_HARDDISK_CONN_ADD(_tag, _slot_intf, _def_slot, _enc, _spinupms, _cache, _format) \
+ MCFG_DEVICE_ADD(_tag, MFM_HD_CONNECTOR, 0) \
+ MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
+ static_cast<mfm_harddisk_connector *>(device)->configure(_enc, _spinupms, _cache, _format);
- harddisk_image_device *m_drive;
-};
-class ide_harddisk_legacy_device : public device_t
+/*
+ Hard disk format
+*/
+class mfmhd_image_format_t
{
public:
- ide_harddisk_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ mfmhd_image_format_t();
+ virtual ~mfmhd_image_format_t();
+
+ // Load the image.
+ virtual chd_error load(const char* tagdev, chd_file* chdfile, UINT16* trackimage, mfmhd_enc_t encoding, int tracksize, int cylinder, int head, int cylcnt, int headcnt, int sect_per_track) = 0;
+
+ // Save the image.
+ virtual chd_error save(const char* tagdev, chd_file* chdfile, UINT16* trackimage, mfmhd_enc_t encoding, int tracksize, int cylinder, int head, int cylcnt, int headcnt, int sect_per_track) = 0;
+
+ // Return the recent interleave of the image
+ int get_interleave() { return m_interleave; }
+
protected:
- virtual void device_start() { };
- virtual void device_reset() { };
- virtual machine_config_constructor device_mconfig_additions() const;
+ bool m_lastbit;
+ int m_current_crc;
+ mfmhd_enc_t m_encoding;
+ const char* m_tagdev;
+ int m_cylinders;
+ int m_heads;
+ int m_sectors_per_track;
+ int m_interleave;
+
+ void mfm_encode(UINT16* trackimage, int& position, UINT8 byte, int count=1);
+ void mfm_encode_a1(UINT16* trackimage, int& position);
+ void mfm_encode_mask(UINT16* trackimage, int& position, UINT8 byte, int count, int mask);
+ UINT8 mfm_decode(UINT16 raw);
+ const char* tag() { return m_tagdev; }
+ void showtrack(UINT16* enctrack, int length);
+};
+
+class ti99_mfmhd_format : public mfmhd_image_format_t
+{
+public:
+ ti99_mfmhd_format() {};
+ chd_error load(const char* tagdev, chd_file* chdfile, UINT16* trackimage, mfmhd_enc_t encoding, int tracksize, int cylinder, int head, int cylcnt, int headcnt, int sect_per_track);
+ chd_error save(const char* tagdev, chd_file* chdfile, UINT16* trackimage, mfmhd_enc_t encoding, int tracksize, int cylinder, int head, int cylcnt, int headcnt, int sect_per_track);
+private:
+ UINT8 cylinder_to_ident(int cylinder);
+ int chs_to_lba(int cylinder, int head, int sector);
};
-#define MCFG_MFMHD_3_DRIVES_ADD() \
- MCFG_DEVICE_ADD(MFMHD_0, TI99_MFMHD_LEG, 0) \
- MCFG_DEVICE_ADD(MFMHD_1, TI99_MFMHD_LEG, 0) \
- MCFG_DEVICE_ADD(MFMHD_2, TI99_MFMHD_LEG, 0)
+extern const mfmhd_format_type MFMHD_TI99_FORMAT;
#endif
diff --git a/src/emu/machine/tms1024.c b/src/emu/machine/tms1024.c
index d728f7dfd28..f362349ef16 100644
--- a/src/emu/machine/tms1024.c
+++ b/src/emu/machine/tms1024.c
@@ -3,10 +3,10 @@
/*
Texas Instruments TMS1024/TMS1025 I/O expander
-
+
No documentation was available, just a pinout.
Other than more port pins, TMS1025 is assumed to be same as TMS1024.
-
+
TODO:
- writes to port 0
- what's the MS pin?
@@ -99,13 +99,13 @@ WRITE8_MEMBER(tms1024_device::write_s)
WRITE_LINE_MEMBER(tms1024_device::write_std)
{
state = (state) ? 1 : 0;
-
+
// output on rising edge
if (state && !m_std)
{
if (m_s != 0)
(*m_write_port[m_s-1])((offs_t)(m_s-1), m_h);
}
-
+
m_std = state;
}
diff --git a/src/emu/machine/tms1024.h b/src/emu/machine/tms1024.h
index e91c0ca5a2d..a7bdb4539bf 100644
--- a/src/emu/machine/tms1024.h
+++ b/src/emu/machine/tms1024.h
@@ -88,7 +88,7 @@ protected:
UINT8 m_h; // 4-bit data latch
UINT8 m_s; // 3-bit port select
UINT8 m_std; // strobe pin
-
+
// callbacks
devcb_write8 m_write_port1, m_write_port2, m_write_port3, m_write_port4, m_write_port5, m_write_port6, m_write_port7;
devcb_write8 *m_write_port[7];
diff --git a/src/emu/machine/tms6100.c b/src/emu/machine/tms6100.c
index d37771f4fd2..c0b355feee5 100644
--- a/src/emu/machine/tms6100.c
+++ b/src/emu/machine/tms6100.c
@@ -136,13 +136,15 @@ void tms6100_device::device_start()
save_item(NAME(m_m0));
save_item(NAME(m_m1));
save_item(NAME(m_state));
+ //save_item(NAME(m_variant));
+ //tms6100_set_variant(tms, TMS6110_IS_TMS6100);
}
void m58819_device::device_start()
{
- //tms5110_set_variant(tms, TMS5110_IS_5100);
tms6100_device::device_start();
+ //tms6100_set_variant(tms, TMS6110_IS_M58819);
}
//-------------------------------------------------
@@ -197,7 +199,15 @@ WRITE_LINE_MEMBER(tms6100_device::tms6100_romclock_w)
else
{
/* read bit at address */
+ /* if (m_variant == TMS6110_IS_M58819)
+ {
+ m_data = (m_rom[m_address >> 3] >> (7-(m_address & 0x07))) & 1;
+ }
+ else // m_variant == (TMS6110_IS_TMS6100 || TMS6110_IS_TMS6125)
+ {
+ */
m_data = (m_rom[m_address >> 3] >> (m_address & 0x07)) & 1;
+ /* } */
m_address++;
}
m_state &= ~TMS6100_READ_PENDING;
diff --git a/src/emu/machine/tms6100.h b/src/emu/machine/tms6100.h
index 2259ac27585..2838adf63cf 100644
--- a/src/emu/machine/tms6100.h
+++ b/src/emu/machine/tms6100.h
@@ -37,6 +37,7 @@ private:
UINT8 m_tms_clock;
UINT8 m_data;
UINT8 m_state;
+ //UINT8 m_variant;
};
diff --git a/src/emu/machine/tms9902.c b/src/emu/machine/tms9902.c
index 6bd10ac85a4..557da504f96 100644
--- a/src/emu/machine/tms9902.c
+++ b/src/emu/machine/tms9902.c
@@ -335,7 +335,7 @@ void tms9902_device::set_receive_data_rate()
// Thus the callback function should add up this value on each poll
// and deliver a data input not before it sums up to 1.
m_baudpoll = (double)(baud / (10*POLLING_FREQ));
- if (VERBOSE>3) LOG ("TMS9902: baudpoll = %lf\n", m_baudpoll);
+ if (VERBOSE>3) LOG ("TMS9902: baudpoll = %f\n", m_baudpoll);
m_last_config_value = value;
m_ctrl_cb((offs_t)CONFIG, RATERECV);
diff --git a/src/emu/machine/upd765.c b/src/emu/machine/upd765.c
index 83171d8d55d..5a40d63aad3 100644
--- a/src/emu/machine/upd765.c
+++ b/src/emu/machine/upd765.c
@@ -2465,21 +2465,21 @@ pc_fdc_superio_device::pc_fdc_superio_device(const machine_config &mconfig, cons
select_connected = true;
}
-dp8473_device::dp8473_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : upd765_family_device(mconfig, PC_FDC_SUPERIO, "PC FDC SUPERIO", tag, owner, clock, "dp8473", __FILE__)
+dp8473_device::dp8473_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : upd765_family_device(mconfig, PC_FDC_SUPERIO, "DP8473", tag, owner, clock, "dp8473", __FILE__)
{
ready_polled = false;
ready_connected = false;
select_connected = true;
}
-pc8477a_device::pc8477a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : upd765_family_device(mconfig, PC_FDC_SUPERIO, "PC FDC SUPERIO", tag, owner, clock, "pc8477a", __FILE__)
+pc8477a_device::pc8477a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : upd765_family_device(mconfig, PC_FDC_SUPERIO, "PC8477A", tag, owner, clock, "pc8477a", __FILE__)
{
ready_polled = true;
ready_connected = false;
select_connected = true;
}
-wd37c65c_device::wd37c65c_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : upd765_family_device(mconfig, PC_FDC_SUPERIO, "PC FDC SUPERIO", tag, owner, clock, "wd37c65c", __FILE__)
+wd37c65c_device::wd37c65c_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : upd765_family_device(mconfig, PC_FDC_SUPERIO, "WD37C65C", tag, owner, clock, "wd37c65c", __FILE__)
{
ready_polled = true;
ready_connected = false;
diff --git a/src/emu/machine/upd765.h b/src/emu/machine/upd765.h
index 3c71f4642f9..a3465887943 100644
--- a/src/emu/machine/upd765.h
+++ b/src/emu/machine/upd765.h
@@ -193,7 +193,7 @@ protected:
FIF_DIS = 0x20,
FIF_EIS = 0x40,
- SPEC_ND = 0x0001,
+ SPEC_ND = 0x0001
};
@@ -258,7 +258,7 @@ protected:
WRITE_TRACK_SECTOR_BYTE,
WRITE_TRACK_POST_SECTORS,
- WRITE_TRACK_POST_SECTORS_BYTE,
+ WRITE_TRACK_POST_SECTORS_BYTE
};
struct pll_t {
@@ -354,7 +354,7 @@ protected:
C_SCAN_HIGH,
C_INVALID,
- C_INCOMPLETE,
+ C_INCOMPLETE
};
void delay_cycles(emu_timer *tm, int cycles);
diff --git a/src/emu/machine/vrc4373.c b/src/emu/machine/vrc4373.c
index 234880b0b8e..860b7ff601a 100644
--- a/src/emu/machine/vrc4373.c
+++ b/src/emu/machine/vrc4373.c
@@ -269,22 +269,39 @@ void vrc4373_device::dma_transfer(int which)
if (LOG_NILE)
logerror("%08X:nile Start dma PCI: %08X MEM: %08X Words: %X\n", m_cpu->space(AS_PROGRAM).device().safe_pc(), m_cpu_regs[NREG_DMA_CPAR], m_cpu_regs[NREG_DMA_CMAR], m_cpu_regs[NREG_DMA_REM]);
int pciSel = (m_cpu_regs[NREG_DMACR1+which*0xC] & DMA_MIO) ? AS_DATA : AS_IO;
- UINT32 mem_mask = 0xffffffff;
- while (m_cpu_regs[NREG_DMA_REM]>0) {
- if (0 && LOG_NILE)
- logerror("dma_transfer PCI: %08X Mem: %08X Words Remaining: %X\n", m_cpu_regs[NREG_DMA_CPAR], m_cpu_regs[NREG_DMA_CMAR], m_cpu_regs[NREG_DMA_REM]);
- if (m_cpu_regs[NREG_DMACR1+which*0xC]&DMA_RW) {
- // Read data from PCI and write to local
- m_cpu->space(AS_PROGRAM).write_dword(m_cpu_regs[NREG_DMA_CMAR], this->space(pciSel).read_dword(m_cpu_regs[NREG_DMA_CPAR], mem_mask), mem_mask);
- } else {
- // Read data from local and write to PCI
- this->space(pciSel).write_dword(m_cpu_regs[NREG_DMA_CPAR], m_cpu->space(AS_PROGRAM).read_dword(m_cpu_regs[NREG_DMA_CMAR], mem_mask), mem_mask);
- }
- m_cpu_regs[NREG_DMA_CMAR] += 0x4;
- m_cpu_regs[NREG_DMA_CPAR] += 0x4;
- m_cpu_regs[NREG_DMA_REM]--;
+ address_space *src, *dst;
+ UINT32 srcAddr, dstAddr;
+
+ if (m_cpu_regs[NREG_DMACR1+which*0xC]&DMA_RW) {
+ // Read data from PCI and write to cpu
+ src = &this->space(pciSel);
+ dst = &m_cpu->space(AS_PROGRAM);
+ srcAddr = m_cpu_regs[NREG_DMA_CPAR];
+ dstAddr = m_cpu_regs[NREG_DMA_CMAR];
+ } else {
+ // Read data from cpu and write to PCI
+ src = &m_cpu->space(AS_PROGRAM);
+ dst = &this->space(pciSel);
+ srcAddr = m_cpu_regs[NREG_DMA_CMAR];
+ dstAddr = m_cpu_regs[NREG_DMA_CPAR];
}
+ int count = m_cpu_regs[NREG_DMA_REM];
+ while (count>0) {
+ dst->write_dword(dstAddr, src->read_dword(srcAddr));
+ dstAddr += 0x4;
+ srcAddr += 0x4;
+ --count;
+ }
+ if (m_cpu_regs[NREG_DMACR1+which*0xC]&DMA_RW) {
+ m_cpu_regs[NREG_DMA_CPAR] = srcAddr;
+ m_cpu_regs[NREG_DMA_CMAR] = dstAddr;
+ } else {
+ m_cpu_regs[NREG_DMA_CMAR] = srcAddr;
+ m_cpu_regs[NREG_DMA_CPAR] = dstAddr;
+ }
+ m_cpu_regs[NREG_DMA_REM] = 0;
}
+
// CPU I/F
READ32_MEMBER (vrc4373_device::cpu_if_r)
{
diff --git a/src/emu/machine/wd17xx.c b/src/emu/machine/wd17xx.c
deleted file mode 100644
index c87c2911877..00000000000
--- a/src/emu/machine/wd17xx.c
+++ /dev/null
@@ -1,2107 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Nathan Woods, Kevin Thacker, Phill Harvey-Smith, Robbbert, Curt Coder
-/***************************************************************************
-
- !!! DEPRECATED, USE src/emu/wd_fdc.h FOR NEW DRIVERS !!!
-
- wd17xx.c
-
- Implementations of the Western Digital 17xx and 27xx families of
- floppy disk controllers
-
-
- Models:
-
- DAL DD Side Clock Remark
- ---------------------------------------------------------
- FD1771 1 or 2 MHz First model
- FD1781 x 1 or 2 MHz
- FD1791 x 1 or 2 MHz
- FD1792 1 or 2 MHz
- FD1793 x x 1 or 2 MHz
- FD1794 x 1 or 2 MHz
- FD1795 x x 1 or 2 MHz
- FD1797 x x x 1 or 2 MHz
- FD1761 x 1 MHz
- FD1762 1 MHz ?
- FD1763 x x 1 MHz
- FD1764 x 1 MHz ?
- FD1765 x x 1 MHz
- FD1767 x x x 1 MHz
- WD2791 x 1 or 2 MHz Internal data separator
- WD2793 x x 1 or 2 MHz Internal data separator
- WD2795 x x 1 or 2 MHz Internal data separator
- WD2797 x x x 1 or 2 MHz Internal data separator
- WD1770 x x 8 MHz Motor On signal
- WD1772 x x 8 MHz Motor On signal, Faster stepping rates
- WD1773 x x 8 MHz Enable precomp line
-
- Notes: - In general, later models include all features of earlier models
- - DAL: Data access lines, x = TRUE; otherwise inverted
- - DD: Double density support
- - Side: Has side select support
- - ?: Unknown if it really exists
-
- Clones:
-
- - SMC FD179x
- - Fujitsu MB8876 -> FD1791, MB8877 -> FD1793
- - VLSI VL177x
-
-
- Changelog:
-
- Kevin Thacker
- - Removed disk image code and replaced it with floppy drive functions.
- Any disc image is now useable with this code.
- - Fixed write protect
-
- 2005-Apr-16 P.Harvey-Smith:
- - Increased the delay in wd17xx_timed_read_sector_request and
- wd17xx_timed_write_sector_request, to 40us to more closely match
- what happens on the real hardware, this has fixed the NitrOS9 boot
- problems.
-
- 2007-Nov-01 Wilbert Pol:
- Needed these changes to get the MB8877 for Osborne-1 to work:
- - Added support for multiple record read
- - Changed the wd17xx_read_id to not return after DATADONEDELAY, but
- the host should read the id data through the data register. This
- was accomplished by making this change in the wd17xx_read_id
- function:
- - wd17xx_complete_command(device, DELAY_DATADONE);
- + wd17xx_set_data_request();
-
- 2009-May-10 Robbbert:
- Further change to get the Kaypro II to work
- - When wd17xx_read_id has generated the 6 data bytes, it should make
- an IRQ and turn off the busy status. The timing for Osborne is
- critical, it must be between 300 and 700 usec, I've settled on 400.
- The Kaypro doesn't care timewise, but the busy flag must turn off
- sometime or it hangs.
- - w->status |= STA_2_BUSY;
- + wd17xx_set_busy(device, attotime::from_usec(400));
-
- 2009-June-4 Roberto Lavarone:
- - Initial support for wd1771
- - Added simulation of head loaded feedback from drive
- - Bugfix: busy flag was cleared too early
-
- 2009-June-21 Robbbert:
- - The Bugfix above, while valid, caused the Osborne1 to fail. This
- is because the delay must not exceed 14usec (found by extensive testing).
- - The minimum delay is 1usec, need by z80netf while formatting a disk.
- - http://www.bannister.org/forums/ubbthreads.php?ubb=showflat&Number=50889#Post50889
- explains the problems, testing done, and the test procedure for the z80netf.
- - Thus, the delay is set to 10usec, and all the disks I have (not many)
- seem to work.
- - Note to anyone who wants to change something: Make sure that the
- Osborne1 boots up! It is extremely sensitive to timing!
- - For testing only: The osborne1 rom can be patched to make it much
- more stable, by changing the byte at 0x0da7 from 0x28 to 0x18.
-
- 2009-June-25 Robbbert:
- - Turns out kayproii not working, 10usec is too short.. but 11usec is ok.
- Setting it to 12usec.
- Really, this whole thing needs a complete rewrite.
-
- 2009-July-08 Roberto Lavarone:
- - Fixed a bug in head load flag handling: einstein and samcoupe now working again
-
- 2009-September-30 Robbbert:
- - Modified what status flags are returned after a Forced Interrupt,
- to allow Microbee to boot CP/M.
-
- 2010-Jan-31 Phill Harvey-Smith
- - The above bugfixes for the Kaypro/Osborne1 have borked the booting on the Dragon
- Alpha. The Alpha it seems needs a delay of ay least 17us or the NMI generated by
- INTRQ happens too early and doen't break out of the read/write bytes loops.
-
- I have made the delay settable by calling wd17xx_set_complete_command_delay, and
- let it default to 12us, as required above, so that the Dragon Alpha works again.
- This hopefully should not break the other machines.
-
- This should probably be considdered a minor hack but it does seem to work !
-
- 2010-02-04 Phill Harvey-Smith
- - Added multiple sector write as the RM Nimbus needs it.
-
- 2010-March-22 Curt Coder:
- - Implemented immediate and index pulse interrupts.
-
- 2010-Dec-31 Phill Harvey-Smith
- - Copied multi-sector write code from r7263, for some reason this had been
- silently removed, but is required for the rmnimbus driver.
-
- 2011-Mar-08 Phill Harvey-Smith
- - Triggering intrq now clears the DRQ bit in the status as well as the busy bit.
- Execution of the READ_DAM command now correctly sets w->command.
-
- 2011-Apr-01 Curt Coder
- - Set complete command delay to 16 usec (DD) / 32 usec (SD) and removed
- the external delay setting hack.
-
- 2011-Jun-24 Curt Coder
- - Added device types for all known variants, and enforced inverted DAL lines.
-
- 2011-Sep-18 Curt Coder
- - Connected Side Select Output for variants that support it.
-
- TODO:
- - What happens if a track is read that doesn't have any id's on it?
- (e.g. unformatted disc)
- - Rewrite into a C++ device
-
-***************************************************************************/
-
-
-#include "emu.h"
-#include "formats/imageutl.h"
-#include "machine/wd17xx.h"
-
-/***************************************************************************
- CONSTANTS
-***************************************************************************/
-
-#define VERBOSE 0 /* General logging */
-#define VERBOSE_DATA 0 /* Logging of each byte during read and write */
-
-#define DELAY_ERROR 3
-#define DELAY_NOTREADY 1
-#define DELAY_DATADONE 3
-
-#define TYPE_I 1
-#define TYPE_II 2
-#define TYPE_III 3
-#define TYPE_IV 4
-
-#define FDC_STEP_RATE 0x03 /* Type I additional flags */
-#define FDC_STEP_VERIFY 0x04 /* verify track number */
-#define FDC_STEP_HDLOAD 0x08 /* load head */
-#define FDC_STEP_UPDATE 0x10 /* update track register */
-
-#define FDC_RESTORE 0x00 /* Type I commands */
-#define FDC_SEEK 0x10
-#define FDC_STEP 0x20
-#define FDC_STEP_IN 0x40
-#define FDC_STEP_OUT 0x60
-
-#define FDC_MASK_TYPE_I (FDC_STEP_HDLOAD|FDC_STEP_VERIFY|FDC_STEP_RATE)
-
-/* Type I commands status */
-#define STA_1_BUSY 0x01 /* controller is busy */
-#define STA_1_IPL 0x02 /* index pulse */
-#define STA_1_TRACK0 0x04 /* track 0 detected */
-#define STA_1_CRC_ERR 0x08 /* CRC error */
-#define STA_1_SEEK_ERR 0x10 /* seek error */
-#define STA_1_HD_LOADED 0x20 /* head loaded */
-#define STA_1_WRITE_PRO 0x40 /* floppy is write protected */
-#define STA_1_NOT_READY 0x80 /* drive not ready */
-#define STA_1_MOTOR_ON 0x80 /* status of the Motor On output (WD1770 and WD1772 only) */
-
-/* Type II and III additional flags */
-#define FDC_DELETED_AM 0x01 /* read/write deleted address mark */
-#define FDC_SIDE_CMP_T 0x02 /* side compare track data */
-#define FDC_15MS_DELAY 0x04 /* delay 15ms before command */
-#define FDC_SIDE_CMP_S 0x08 /* side compare sector data */
-#define FDC_MULTI_REC 0x10 /* only for type II commands */
-
-/* Type II commands */
-#define FDC_READ_SEC 0x80 /* read sector */
-#define FDC_WRITE_SEC 0xA0 /* write sector */
-
-#define FDC_MASK_TYPE_II (FDC_MULTI_REC|FDC_SIDE_CMP_S|FDC_15MS_DELAY|FDC_SIDE_CMP_T|FDC_DELETED_AM)
-
-/* Type II commands status */
-#define STA_2_BUSY 0x01
-#define STA_2_DRQ 0x02
-#define STA_2_LOST_DAT 0x04
-#define STA_2_CRC_ERR 0x08
-#define STA_2_REC_N_FND 0x10
-#define STA_2_REC_TYPE 0x20
-#define STA_2_WRITE_PRO 0x40
-#define STA_2_NOT_READY 0x80
-
-#define FDC_MASK_TYPE_III (FDC_SIDE_CMP_S|FDC_15MS_DELAY|FDC_SIDE_CMP_T|FDC_DELETED_AM)
-
-/* Type III commands */
-#define FDC_READ_DAM 0xc0 /* read data address mark */
-#define FDC_READ_TRK 0xe0 /* read track */
-#define FDC_WRITE_TRK 0xf0 /* write track (format) */
-
-/* Type IV additional flags */
-#define FDC_IM0 0x01 /* interrupt mode 0 */
-#define FDC_IM1 0x02 /* interrupt mode 1 */
-#define FDC_IM2 0x04 /* interrupt mode 2 */
-#define FDC_IM3 0x08 /* interrupt mode 3 */
-
-#define FDC_MASK_TYPE_IV (FDC_IM3|FDC_IM2|FDC_IM1|FDC_IM0)
-
-/* Type IV commands */
-#define FDC_FORCE_INT 0xd0 /* force interrupt */
-
-/* structure describing a double density track */
-#define TRKSIZE_DD 6144
-#if 0
-static const UINT8 track_DD[][2] = {
- {16, 0x4e}, /* 16 * 4E (track lead in) */
- { 8, 0x00}, /* 8 * 00 (pre DAM) */
- { 3, 0xf5}, /* 3 * F5 (clear CRC) */
-
- { 1, 0xfe}, /* *** sector *** FE (DAM) */
- { 1, 0x80}, /* 4 bytes track,head,sector,seclen */
- { 1, 0xf7}, /* 1 * F7 (CRC) */
- {22, 0x4e}, /* 22 * 4E (sector lead in) */
- {12, 0x00}, /* 12 * 00 (pre AM) */
- { 3, 0xf5}, /* 3 * F5 (clear CRC) */
- { 1, 0xfb}, /* 1 * FB (AM) */
- { 1, 0x81}, /* x bytes sector data */
- { 1, 0xf7}, /* 1 * F7 (CRC) */
- {16, 0x4e}, /* 16 * 4E (sector lead out) */
- { 8, 0x00}, /* 8 * 00 (post sector) */
- { 0, 0x00}, /* end of data */
-};
-#endif
-
-/* structure describing a single density track */
-#define TRKSIZE_SD 3172
-#if 0
-static const UINT8 track_SD[][2] = {
- {16, 0xff}, /* 16 * FF (track lead in) */
- { 8, 0x00}, /* 8 * 00 (pre DAM) */
- { 1, 0xfc}, /* 1 * FC (clear CRC) */
-
- {11, 0xff}, /* *** sector *** 11 * FF */
- { 6, 0x00}, /* 6 * 00 (pre DAM) */
- { 1, 0xfe}, /* 1 * FE (DAM) */
- { 1, 0x80}, /* 4 bytes track,head,sector,seclen */
- { 1, 0xf7}, /* 1 * F7 (CRC) */
- {10, 0xff}, /* 10 * FF (sector lead in) */
- { 4, 0x00}, /* 4 * 00 (pre AM) */
- { 1, 0xfb}, /* 1 * FB (AM) */
- { 1, 0x81}, /* x bytes sector data */
- { 1, 0xf7}, /* 1 * F7 (CRC) */
- { 0, 0x00}, /* end of data */
-};
-#endif
-
-
-/***************************************************************************
- HELPER FUNCTIONS
-***************************************************************************/
-
-static int wd17xx_has_dal(device_t *device)
-{
- return (device->type() == FD1793 || device->type() == FD1794 || device->type() == FD1797 ||
- device->type() == FD1763 || device->type() == FD1764 || device->type() == FD1767 ||
- device->type() == WD1770 || device->type() == WD1772 || device->type() == WD1773 ||
- device->type() == WD2793 || device->type() == WD2797 ||
- device->type() == MB8877);
-}
-
-static int wd17xx_is_sd_only(device_t *device)
-{
- return (device->type() == FD1771 || device->type() == FD1792 || device->type() == FD1794 || device->type() == FD1762 || device->type() == FD1764);
-}
-
-static int wd17xx_has_side_select(device_t *device)
-{
- return (device->type() == FD1795 || device->type() == FD1797 ||
- device->type() == FD1765 || device->type() == FD1767 ||
- device->type() == WD2795 || device->type() == WD2797);
-}
-
-int wd1770_device::wd17xx_dden()
-{
- if (!m_in_dden_func.isnull())
- return m_in_dden_func();
- else
- return m_dden;
-}
-
-
-/***************************************************************************
- IMPLEMENTATION
-***************************************************************************/
-
-/* clear a data request */
-void wd1770_device::wd17xx_clear_drq()
-{
- m_status &= ~STA_2_DRQ;
-
- m_drq = CLEAR_LINE;
- m_out_drq_func(m_drq);
-}
-
-/* set data request */
-void wd1770_device::wd17xx_set_drq()
-{
- if (m_status & STA_2_DRQ)
- m_status |= STA_2_LOST_DAT;
-
- m_status |= STA_2_DRQ;
-
- m_drq = ASSERT_LINE;
- m_out_drq_func(m_drq);
-}
-
-/* clear interrupt request */
-void wd1770_device::wd17xx_clear_intrq()
-{
- m_intrq = CLEAR_LINE;
- m_out_intrq_func(m_intrq);
-}
-
-/* set interrupt request */
-void wd1770_device::wd17xx_set_intrq()
-{
- m_status &= ~STA_2_BUSY;
- m_status &= ~STA_2_DRQ;
-
- m_intrq = ASSERT_LINE;
- m_out_intrq_func(m_intrq);
-}
-
-/* set intrq after delay */
-TIMER_CALLBACK_MEMBER( wd1770_device::wd17xx_command_callback )
-{
- if (m_last_command_data != FDC_FORCE_INT)
- {
- wd17xx_set_intrq();
- }
-}
-
-/* write next byte to data register and set drq */
-TIMER_CALLBACK_MEMBER( wd1770_device::wd17xx_data_callback )
-{
- /* check if this is a write command */
- if( (m_command_type == TYPE_II && m_command == FDC_WRITE_SEC) ||
- (m_command_type == TYPE_III && m_command == FDC_WRITE_TRK) )
- {
- /* we are ready for new data */
- wd17xx_set_drq();
-
- return;
- }
-
- /* any bytes remaining? */
- if (m_data_count >= 1)
- {
- /* yes */
- m_data = m_buffer[m_data_offset++];
-
- if (VERBOSE_DATA)
- logerror("wd17xx_data_callback: $%02X (data_count %d)\n", m_data, m_data_count);
-
- wd17xx_set_drq();
-
- /* any bytes remaining? */
- if (--m_data_count < 1)
- {
- /* no */
- m_data_offset = 0;
-
- /* clear ddam type */
- m_status &=~STA_2_REC_TYPE;
-
- /* read a sector with ddam set? */
- if (m_command_type == TYPE_II && m_ddam != 0)
- {
- /* set it */
- m_status |= STA_2_REC_TYPE;
- }
-
- /* check if we should handle the next sector for a multi record read */
- if (m_command_type == TYPE_II && m_command == FDC_READ_SEC && (m_read_cmd & 0x10))
- {
- if (VERBOSE)
- logerror("wd17xx_data_callback: multi sector read\n");
-
- if (m_sector == 0xff)
- m_sector = 0x01;
- else
- m_sector++;
-
- wd17xx_timed_read_sector_request();
- }
- else
- {
- /* Delay the INTRQ 3 byte times because we need to read two CRC bytes and
- compare them with a calculated CRC */
- wd17xx_complete_command(DELAY_DATADONE);
-
- if (VERBOSE)
- logerror("wd17xx_data_callback: data read completed\n");
- }
- }
- else
- {
- /* requeue us for more data */
- m_timer_data->adjust(attotime::from_usec(wd17xx_dden() ? 128 : 32));
- }
- }
- else
- {
- logerror("wd17xx_data_callback: (no new data) $%02X (data_count %d)\n", m_data, m_data_count);
- }
-}
-
-
-void wd1770_device::wd17xx_set_busy(const attotime &duration)
-{
- m_status |= STA_1_BUSY;
-
- m_timer_cmd->adjust(duration);
-}
-
-
-/* BUSY COUNT DOESN'T WORK PROPERLY! */
-
-void wd1770_device::wd17xx_command_restore()
-{
- UINT8 step_counter;
-
- if (m_drive == NULL)
- return;
-
- step_counter = 255;
-
-#if 0
- m_status |= STA_1_BUSY;
-#endif
-
- /* setup step direction */
- m_direction = -1;
-
- m_command_type = TYPE_I;
-
- /* reset busy count */
- m_busy_count = 0;
-
- if (1) // image_slotexists(m_drive) : FIXME
- {
- /* keep stepping until track 0 is received or 255 steps have been done */
- while (m_drive->floppy_tk00_r() && (step_counter != 0))
- {
- /* update time to simulate seek time busy signal */
- m_busy_count++;
- m_drive->floppy_drive_seek(m_direction);
- step_counter--;
- }
- }
-
- /* update track reg */
- m_track = 0;
-#if 0
- /* simulate seek time busy signal */
- m_busy_count = 0; //m_busy_count * ((m_data & FDC_STEP_RATE) + 1);
-
- /* when command completes set irq */
- wd17xx_set_intrq();
-#endif
- wd17xx_set_busy(attotime::from_usec(100));
-}
-
-/*
- Write an entire track. Formats which do not define a write_track
- function pointer will cause a silent return.
- What is written to the image depends on the selected format. Sector
- dumps have to extract the sectors in the track, while track dumps
- may directly write the bytes.
- (The if-part below may thus be removed.)
-*/
-void wd1770_device::write_track()
-{
- floppy_image_legacy *floppy;
-#if 0
- int i;
- for (i=0;i+4<m_data_offset;)
- {
- if (m_buffer[i]==0xfe)
- {
- /* got address mark */
- int track = m_buffer[i+1];
- int side = m_buffer[i+2];
- int sector = m_buffer[i+3];
- //int len = m_buffer[i+4];
- int filler = 0xe5; /* IBM and Thomson */
- int density = m_density;
- m_drive->floppy_drive_format_sector(side,sector,track,
- m_hd,sector,density?1:0,filler);
- i += 128; /* at least... */
- }
- else
- i++;
- }
-#endif
-
- /* Get the size in bytes of the current track. For real hardware this
- may vary per system in small degree, and there even for each track
- and head, so we should not assume a fixed value here.
- As we are using a buffered track writing, we have to find out how long
- the track will become. The only object which can tell us is the
- selected format.
- */
- m_data_count = 0;
- floppy = m_drive->flopimg_get_image();
- if (floppy != NULL)
- m_data_count = floppy_get_track_size(floppy, m_hd, m_track);
-
- if (m_data_count==0)
- {
- if (wd17xx_is_sd_only(this))
- m_data_count = TRKSIZE_SD;
- else
- m_data_count = wd17xx_dden() ? TRKSIZE_SD : TRKSIZE_DD;
- }
-
- m_drive->floppy_drive_write_track_data_info_buffer( m_hd, (char *)m_buffer, &(m_data_count) );
-
- m_data_offset = 0;
-
- wd17xx_set_drq();
- m_status |= STA_2_BUSY;
- m_busy_count = 0;
-}
-
-/*
- Read an entire track. It is up to the format to deliver the data. Sector
- dumps may be required to fantasize the missing track bytes, while track
- dumps can directly deliver them.
- (The if-part below may thus be removed.)
-*/
-void wd1770_device::read_track()
-{
- floppy_image_legacy *floppy;
-#if 0
- UINT8 *psrc; /* pointer to track format structure */
- UINT8 *pdst; /* pointer to track buffer */
- int cnt; /* number of bytes to fill in */
- UINT16 crc; /* id or data CRC */
- UINT8 d; /* data */
- UINT8 t = m_track; /* track of DAM */
- UINT8 h = m_head; /* head of DAM */
- UINT8 s = m_sector_dam; /* sector of DAM */
- UINT16 l = m_sector_length; /* sector length of DAM */
- int i;
-
- for (i = 0; i < m_sec_per_track; i++)
- {
- m_dam_list[i][0] = t;
- m_dam_list[i][1] = h;
- m_dam_list[i][2] = i;
- m_dam_list[i][3] = l >> 8;
- }
-
- pdst = m_buffer;
-
- if (m_density)
- {
- psrc = track_DD[0]; /* double density track format */
- cnt = TRKSIZE_DD;
- }
- else
- {
- psrc = track_SD[0]; /* single density track format */
- cnt = TRKSIZE_SD;
- }
-
- while (cnt > 0)
- {
- if (psrc[0] == 0) /* no more track format info ? */
- {
- if (m_dam_cnt < m_sec_per_track) /* but more DAM info ? */
- {
- if (m_density)/* DD track ? */
- psrc = track_DD[3];
- else
- psrc = track_SD[3];
- }
- }
-
- if (psrc[0] != 0) /* more track format info ? */
- {
- cnt -= psrc[0]; /* subtract size */
- d = psrc[1];
-
- if (d == 0xf5) /* clear CRC ? */
- {
- crc = 0xffff;
- d = 0xa1; /* store A1 */
- }
-
- for (i = 0; i < *psrc; i++)
- *pdst++ = d; /* fill data */
-
- if (d == 0xf7) /* store CRC ? */
- {
- pdst--; /* go back one byte */
- *pdst++ = crc & 255; /* put CRC low */
- *pdst++ = crc / 256; /* put CRC high */
- cnt -= 1; /* count one more byte */
- }
- else if (d == 0xfe)/* address mark ? */
- {
- crc = 0xffff; /* reset CRC */
- }
- else if (d == 0x80)/* sector ID ? */
- {
- pdst--; /* go back one byte */
- t = *pdst++ = m_dam_list[m_dam_cnt][0]; /* track number */
- h = *pdst++ = m_dam_list[m_dam_cnt][1]; /* head number */
- s = *pdst++ = m_dam_list[m_dam_cnt][2]; /* sector number */
- l = *pdst++ = m_dam_list[m_dam_cnt][3]; /* sector length code */
- m_dam_cnt++;
- crc = ccitt_crc16_one(crc, t); /* build CRC */
- crc = ccitt_crc16_one(crc, h); /* build CRC */
- crc = ccitt_crc16_one(crc, s); /* build CRC */
- crc = ccitt_crc16_one(crc, l); /* build CRC */
- l = (l == 0) ? 128 : l << 8;
- }
- else if (d == 0xfb)// data address mark ?
- {
- crc = 0xffff; // reset CRC
- }
- else if (d == 0x81)// sector DATA ?
- {
- pdst--; /* go back one byte */
- if (seek(w, t, h, s) == 0)
- {
- if (mame_fread(m_image_file, pdst, l) != l)
- {
- m_status = STA_2_CRC_ERR;
- return;
- }
- }
- else
- {
- m_status = STA_2_REC_N_FND;
- return;
- }
- for (i = 0; i < l; i++) // build CRC of all data
- crc = ccitt_crc16_one(crc, *pdst++);
- cnt -= l;
- }
- psrc += 2;
- }
- else
- {
- *pdst++ = 0xff; /* fill track */
- cnt--; /* until end */
- }
- }
-#endif
- /* Determine the track size. We cannot allow different sizes in this
- design (see above, write_track). */
- m_data_count = 0;
- floppy = m_drive->flopimg_get_image();
- if (floppy != NULL)
- m_data_count = floppy_get_track_size(floppy, m_hd, m_track);
-
- if (m_data_count==0)
- {
- if (wd17xx_is_sd_only(this))
- m_data_count = TRKSIZE_SD;
- else
- m_data_count = wd17xx_dden() ? TRKSIZE_SD : TRKSIZE_DD;
- }
-
- m_drive->floppy_drive_read_track_data_info_buffer( m_hd, (char *)m_buffer, &(m_data_count) );
-
- m_data_offset = 0;
-
- wd17xx_set_drq();
- m_status |= STA_2_BUSY;
- m_busy_count = 0;
-}
-
-
-/* read the next data address mark */
-void wd1770_device::wd17xx_read_id()
-{
- chrn_id id;
- m_status &= ~(STA_2_CRC_ERR | STA_2_REC_N_FND);
-
- /* get next id from disc */
- if (m_drive->floppy_drive_get_next_id(m_hd, &id))
- {
- UINT16 crc = 0xffff;
-
- m_data_offset = 0;
- m_data_count = 6;
-
- /* for MFM */
- /* crc includes 3x0x0a1, and 1x0x0fe (id mark) */
- crc = ccitt_crc16_one(crc,0x0a1);
- crc = ccitt_crc16_one(crc,0x0a1);
- crc = ccitt_crc16_one(crc,0x0a1);
- crc = ccitt_crc16_one(crc,0x0fe);
-
- m_buffer[0] = id.C;
- m_buffer[1] = id.H;
- m_buffer[2] = id.R;
- m_buffer[3] = id.N;
- crc = ccitt_crc16_one(crc, m_buffer[0]);
- crc = ccitt_crc16_one(crc, m_buffer[1]);
- crc = ccitt_crc16_one(crc, m_buffer[2]);
- crc = ccitt_crc16_one(crc, m_buffer[3]);
- /* crc is stored hi-byte followed by lo-byte */
- m_buffer[4] = crc>>8;
- m_buffer[5] = crc & 255;
-
- m_sector = id.C;
-
- if (VERBOSE)
- logerror("wd17xx_read_id: read id succeeded.\n");
-
- wd17xx_timed_data_request();
- }
- else
- {
- /* record not found */
- m_status |= STA_2_REC_N_FND;
- //m_sector = m_track;
- if (VERBOSE)
- logerror("wd17xx_read_id: read id failed\n");
-
- wd17xx_complete_command(DELAY_ERROR);
- }
-}
-
-
-
-void wd1770_device::index_pulse_callback(device_t *img, int state)
-{
- if (img != m_drive)
- return;
-
- m_idx = state;
-
- if (!state && m_idx && BIT(m_interrupt, 2))
- wd17xx_set_intrq();
-
- if (m_hld_count)
- m_hld_count--;
-}
-
-
-
-int wd1770_device::wd17xx_locate_sector()
-{
- UINT8 revolution_count;
- chrn_id id;
- revolution_count = 0;
-
- m_status &= ~STA_2_REC_N_FND;
-
- while (revolution_count!=4)
- {
- if (m_drive->floppy_drive_get_next_id(m_hd, &id))
- {
- /* compare track */
- if (id.C == m_track)
- {
- /* compare head, if we were asked to */
- if (!wd17xx_has_side_select(this) || (id.H == m_head) || (m_head == (UINT8) ~0))
- {
- /* compare id */
- if (id.R == m_sector)
- {
- m_sector_length = 1<<(id.N+7);
- m_sector_data_id = id.data_id;
- /* get ddam status */
- m_ddam = id.flags & ID_FLAG_DELETED_DATA;
- /* got record type here */
- if (VERBOSE)
- logerror("sector found! C:$%02x H:$%02x R:$%02x N:$%02x%s\n", id.C, id.H, id.R, id.N, m_ddam ? " DDAM" : "");
- return 1;
- }
- }
- }
- }
-
- /* index set? */
- if (m_drive->floppy_drive_get_flag_state(FLOPPY_DRIVE_INDEX))
- {
- /* update revolution count */
- revolution_count++;
- }
- }
- return 0;
-}
-
-
-int wd1770_device::wd17xx_find_sector()
-{
- if ( wd17xx_locate_sector() )
- {
- return 1;
- }
-
- /* record not found */
- m_status |= STA_2_REC_N_FND;
-
- if (VERBOSE)
- logerror("track %d sector %d not found!\n", m_track, m_sector);
-
- wd17xx_complete_command(DELAY_ERROR);
-
- return 0;
-}
-
-void wd1770_device::wd17xx_side_compare(UINT8 command)
-{
- if (wd17xx_has_side_select(this))
- set_side((command & FDC_SIDE_CMP_T) ? 1 : 0);
-
- if (command & FDC_SIDE_CMP_T)
- m_head = (command & FDC_SIDE_CMP_S) ? 1 : 0;
- else
- m_head = ~0;
-}
-
-/* read a sector */
-void wd1770_device::wd17xx_read_sector()
-{
- m_data_offset = 0;
-
- /* side compare? */
- wd17xx_side_compare(m_read_cmd);
-
- if (wd17xx_find_sector())
- {
- m_data_count = m_sector_length;
-
- /* read data */
- m_drive->floppy_drive_read_sector_data(m_hd, m_sector_data_id, (char *)m_buffer, m_sector_length);
-
- wd17xx_timed_data_request();
-
- m_status |= STA_2_BUSY;
- m_busy_count = 0;
- }
-}
-
-
-/* called on error, or when command is actually completed */
-/* KT - I have used a timer for systems that use interrupt driven transfers.
-A interrupt occurs after the last byte has been read. If it occurs at the time
-when the last byte has been read it causes problems - same byte read again
-or bytes missed */
-/* TJL - I have add a parameter to allow the emulation to specify the delay
-*/
-void wd1770_device::wd17xx_complete_command(int delay)
-{
- m_data_count = 0;
-
- m_hld_count = 2;
-
- /* set new timer */
- int usecs = wd17xx_dden() ? 32 : 16;
- m_timer_cmd->adjust(attotime::from_usec(usecs));
-
- /* Kill onshot read/write sector timers */
- m_timer_rs->adjust(attotime::never);
- m_timer_ws->adjust(attotime::never);
-}
-
-
-
-void wd1770_device::wd17xx_write_sector()
-{
- /* at this point, the disc is write enabled, and data
- * has been transfered into our buffer - now write it to
- * the disc image or to the real disc
- */
-
- /* side compare? */
- wd17xx_side_compare(m_write_cmd);
-
- /* find sector */
- if (wd17xx_find_sector())
- {
- m_data_count = m_sector_length;
-
- /* write data */
- m_drive->floppy_drive_write_sector_data(m_hd, m_sector_data_id, (char *)m_buffer, m_sector_length, m_write_cmd & 0x01);
- }
-}
-
-
-
-/* verify the seek operation by looking for a id that has a matching track value */
-void wd1770_device::wd17xx_verify_seek()
-{
- UINT8 revolution_count;
- chrn_id id;
- revolution_count = 0;
-
- if (VERBOSE)
- logerror("doing seek verify\n");
-
- m_status &= ~STA_1_SEEK_ERR;
-
- /* must be found within 5 revolutions otherwise error */
- while (revolution_count!=5)
- {
- if (m_drive->floppy_drive_get_next_id( m_hd, &id))
- {
- /* compare track */
- if (id.C == m_track)
- {
- if (VERBOSE)
- logerror("seek verify succeeded!\n");
- return;
- }
- }
-
- /* index set? */
- if (m_drive->floppy_drive_get_flag_state(FLOPPY_DRIVE_INDEX))
- {
- /* update revolution count */
- revolution_count++;
- }
- }
-
- m_status |= STA_1_SEEK_ERR;
-
- if (VERBOSE)
- logerror("failed seek verify!\n");
-}
-
-
-
-/* callback to initiate read sector */
-TIMER_CALLBACK_MEMBER( wd1770_device::wd17xx_read_sector_callback )
-{
- /* ok, start that read! */
-
- if (VERBOSE)
- logerror("wd179x: Read Sector callback.\n");
-
- if (!m_drive->floppy_drive_get_flag_state(FLOPPY_DRIVE_READY))
- wd17xx_complete_command(DELAY_NOTREADY);
- else
- wd17xx_read_sector();
-}
-
-
-
-/* callback to initiate write sector */
-TIMER_CALLBACK_MEMBER( wd1770_device::wd17xx_write_sector_callback )
-{
- /* ok, start that write! */
-
- if (VERBOSE)
- logerror("wd179x: Write Sector callback.\n");
-
- if (!m_drive->floppy_drive_get_flag_state(FLOPPY_DRIVE_READY))
- wd17xx_complete_command(DELAY_NOTREADY);
- else
- {
- /* drive write protected? */
- if (m_drive->floppy_wpt_r() == CLEAR_LINE)
- {
- m_status |= STA_2_WRITE_PRO;
-
- wd17xx_complete_command(DELAY_ERROR);
- }
- else
- {
- /* side compare? */
- wd17xx_side_compare(m_write_cmd);
-
- /* attempt to find it first before getting data from cpu */
- if (wd17xx_find_sector())
- {
- /* request data */
- m_data_offset = 0;
- m_data_count = m_sector_length;
-
- wd17xx_set_drq();
-
- m_status |= STA_2_BUSY;
- m_busy_count = 0;
- }
- }
- }
-}
-
-
-
-/* setup a timed data request - data request will be triggered in a few usecs time */
-void wd1770_device::wd17xx_timed_data_request()
-{
- /* set new timer */
- m_timer_data->adjust(attotime::from_usec(wd17xx_dden() ? 128 : 32));
-}
-
-
-
-/* setup a timed read sector - read sector will be triggered in a few usecs time */
-void wd1770_device::wd17xx_timed_read_sector_request()
-{
- /* set new timer */
- m_timer_rs->adjust(attotime::from_usec(m_pause_time));
-}
-
-
-
-/* setup a timed write sector - write sector will be triggered in a few usecs time */
-void wd1770_device::wd17xx_timed_write_sector_request()
-{
- /* set new timer */
- m_timer_ws->adjust(attotime::from_usec(m_pause_time));
-}
-
-
-/***************************************************************************
- INTERFACE
-***************************************************************************/
-
-/* use this to determine which drive is controlled by WD */
-void wd1770_device::set_drive(UINT8 drive)
-{
- if (VERBOSE)
- logerror("wd17xx_set_drive: $%02x\n", drive);
-
- if (m_floppy_drive_tags[drive] != NULL)
- {
- m_drive = siblingdevice<legacy_floppy_image_device>(m_floppy_drive_tags[drive]);
- }
-}
-
-void wd1770_device::set_side(UINT8 head)
-{
- if (VERBOSE)
- {
- if (head != m_hd)
- logerror("wd17xx_set_side: $%02x\n", head);
- }
-
- m_hd = head;
-}
-
-void wd1770_device::set_pause_time(int usec)
-{
- m_pause_time = usec;
-}
-
-
-/***************************************************************************
- DEVICE HANDLERS
-***************************************************************************/
-
-/* master reset */
-WRITE_LINE_MEMBER( wd1770_device::mr_w )
-{
- /* reset device when going from high to low */
- if (m_mr && state == CLEAR_LINE)
- {
- m_command = 0x03;
- m_status &= ~STA_1_NOT_READY; /* ? */
- }
-
- /* execute restore command when going from low to high */
- if (m_mr == CLEAR_LINE && state)
- {
- wd17xx_command_restore();
- m_sector = 0x01;
- }
-
- m_mr = state;
-}
-
-/* ready and enable precomp (1773 only) */
-WRITE_LINE_MEMBER( wd1770_device::rdy_w )
-{
- m_rdy = state;
-}
-
-/* motor on, 1770 and 1772 only */
-READ_LINE_MEMBER( wd1770_device::mo_r )
-{
- return m_mo;
-}
-
-/* track zero */
-WRITE_LINE_MEMBER( wd1770_device::tr00_w )
-{
- m_tr00 = state;
-}
-
-/* index pulse */
-WRITE_LINE_MEMBER( wd1770_device::idx_w )
-{
- m_idx = state;
-
- if (!state && m_idx && BIT(m_interrupt, 2))
- wd17xx_set_intrq();
-}
-
-/* write protect status */
-WRITE_LINE_MEMBER( wd1770_device::wprt_w )
-{
- m_wprt = state;
-}
-
-/* double density enable */
-WRITE_LINE_MEMBER( wd1770_device::dden_w )
-{
- /* not supported on FD1771, FD1792, FD1794, FD1762 and FD1764 */
- if (wd17xx_is_sd_only(this))
- fatalerror("wd17xx_dden_w: double density input not supported on this model!\n");
- else if (!m_in_dden_func.isnull())
- logerror("wd17xx_dden_w: write has no effect because a read handler is already defined!\n");
- else
- m_dden = state;
-}
-
-/* data request */
-READ_LINE_MEMBER( wd1770_device::drq_r )
-{
- return m_drq;
-}
-
-/* interrupt request */
-READ_LINE_MEMBER( wd1770_device::intrq_r )
-{
- return m_intrq;
-}
-
-/* read the FDC status register. This clears IRQ line too */
-READ8_MEMBER( wd1770_device::status_r )
-{
- int result;
-
- if (!BIT(m_interrupt, 3))
- {
- wd17xx_clear_intrq();
- }
-
- /* bit 7, 'not ready' or 'motor on' */
- if (type() == WD1770 || type() == WD1772)
- {
- m_status &= ~STA_1_MOTOR_ON;
- m_status |= m_mo << 7;
- }
- else
- {
- m_status &= ~STA_1_NOT_READY;
- if (!m_drive->floppy_drive_get_flag_state(FLOPPY_DRIVE_READY))
- m_status |= STA_1_NOT_READY;
- }
-
- result = m_status;
-
- /* type 1 command or force int command? */
- if ((m_command_type==TYPE_I) || (m_command_type==TYPE_IV && ! m_was_busy))
- {
- result &= ~(STA_1_IPL | STA_1_TRACK0);
-
- /* bit 1, index pulse */
- result |= m_idx << 1;
-
- /* bit 2, track 0 state, inverted */
- result |= !m_drive->floppy_tk00_r() << 2;
-
- if (m_command_type==TYPE_I)
- {
- if (m_hld_count)
- m_status |= STA_1_HD_LOADED;
- else
- m_status &= ~ STA_1_HD_LOADED;
- }
-
- /* bit 6, write protect, inverted */
- result |= !m_drive->floppy_wpt_r() << 6;
- }
-
- /* eventually set data request bit */
-// m_status |= m_status_drq;
-
- if (VERBOSE)
- {
- if (m_data_count < 4)
- logerror("%s: wd17xx_status_r: $%02X (data_count %d)\n", machine().describe_context(), result, m_data_count);
- }
-
- return result ^ (wd17xx_has_dal(this) ? 0 : 0xff);
-}
-
-/* read the FDC track register */
-READ8_MEMBER( wd1770_device::track_r )
-{
- if (VERBOSE)
- logerror("%s: wd17xx_track_r: $%02X\n", machine().describe_context(), m_track);
-
- return m_track ^ (wd17xx_has_dal(this) ? 0 : 0xff);
-}
-
-/* read the FDC sector register */
-READ8_MEMBER( wd1770_device::sector_r )
-{
- if (VERBOSE)
- logerror("%s: wd17xx_sector_r: $%02X\n", machine().describe_context(), m_sector);
-
- return m_sector ^ (wd17xx_has_dal(this) ? 0 : 0xff);
-}
-
-/* read the FDC data register */
-READ8_MEMBER( wd1770_device::data_r )
-{
- if (VERBOSE_DATA)
- logerror("%s: wd17xx_data_r: %02x\n", machine().describe_context(), m_data);
-
- /* clear data request */
- wd17xx_clear_drq();
-
- return m_data ^ (wd17xx_has_dal(this) ? 0 : 0xff);
-}
-
-/* write the FDC command register */
-WRITE8_MEMBER( wd1770_device::command_w )
-{
- if (!wd17xx_has_dal(this)) data ^= 0xff;
-
- m_last_command_data = data;
-
- /* only the WD1770 and WD1772 have a 'motor on' line */
- if (type() == WD1770 || type() == WD1772)
- {
- m_mo = ASSERT_LINE;
- m_drive->floppy_mon_w(CLEAR_LINE);
- }
-
- m_drive->floppy_drive_set_ready_state(1,0);
-
- if (!BIT(m_interrupt, 3))
- {
- wd17xx_clear_intrq();
- }
-
- /* clear write protected. On read sector, read track and read dam, write protected bit is clear */
- m_status &= ~((1<<6) | (1<<5) | (1<<4));
-
- if ((data & ~FDC_MASK_TYPE_IV) == FDC_FORCE_INT)
- {
- if (VERBOSE)
- logerror("%s: wd17xx_command_w $%02X FORCE_INT (data_count %d)\n", machine().describe_context(), data, m_data_count);
-
- m_data_count = 0;
- m_data_offset = 0;
- m_was_busy = m_status & STA_2_BUSY;
- m_status &= ~STA_2_BUSY;
-
- wd17xx_clear_drq();
-
- if (!BIT(m_interrupt, 3) && BIT(data, 3))
- {
- /* set immediate interrupt */
- wd17xx_set_intrq();
- }
-
- if (BIT(m_interrupt, 3))
- {
- if (data == FDC_FORCE_INT)
- {
- /* clear immediate interrupt */
- m_interrupt = data & 0x0f;
- }
- else
- {
- /* keep immediate interrupt */
- m_interrupt = 0x08 | (data & 0x07);
- }
- }
- else
- {
- m_interrupt = data & 0x0f;
- }
-
- /* terminate command */
- wd17xx_complete_command(DELAY_ERROR);
-
- m_busy_count = 0;
- m_command_type = TYPE_IV;
- return;
- }
-
- if (data & 0x80)
- {
- /*m_status_ipl = 0;*/
-
- if ((data & ~FDC_MASK_TYPE_II) == FDC_READ_SEC)
- {
- if (VERBOSE)
- {
- logerror("%s: wd17xx_command_w $%02X READ_SEC (", machine().describe_context(), data);
- logerror("cmd=%02X, trk=%02X, sec=%02X, dat=%02X)\n",m_command,m_track,m_sector,m_data);
- }
- m_read_cmd = data;
- m_command = data & ~FDC_MASK_TYPE_II;
- m_command_type = TYPE_II;
- m_status &= ~STA_2_LOST_DAT;
- m_status |= STA_2_BUSY;
- wd17xx_clear_drq();
-
- wd17xx_timed_read_sector_request();
-
- return;
- }
-
- if ((data & ~FDC_MASK_TYPE_II) == FDC_WRITE_SEC)
- {
- if (VERBOSE)
- {
- logerror("%s: wd17xx_command_w $%02X WRITE_SEC (", machine().describe_context(), data);
- logerror("cmd=%02X, trk=%02X, sec=%02X, dat=%02X)\n",m_command,m_track,m_sector,m_data);
- }
-
- m_write_cmd = data;
- m_command = data & ~FDC_MASK_TYPE_II;
- m_command_type = TYPE_II;
- m_status &= ~STA_2_LOST_DAT;
- m_status |= STA_2_BUSY;
- wd17xx_clear_drq();
-
- wd17xx_timed_write_sector_request();
-
- return;
- }
-
- if ((data & ~FDC_MASK_TYPE_III) == FDC_READ_TRK)
- {
- if (VERBOSE)
- logerror("%s: wd17xx_command_w $%02X READ_TRK\n", machine().describe_context(), data);
-
- m_command = data & ~FDC_MASK_TYPE_III;
- m_command_type = TYPE_III;
- m_status &= ~STA_2_LOST_DAT;
- wd17xx_clear_drq();
-#if 1
-// m_status = seek(w, m_track, m_head, m_sector);
- if (m_status == 0)
- read_track();
-#endif
- return;
- }
-
- if ((data & ~FDC_MASK_TYPE_III) == FDC_WRITE_TRK)
- {
- if (VERBOSE)
- logerror("%s: wd17xx_command_w $%02X WRITE_TRK\n", machine().describe_context(), data);
-
- m_command_type = TYPE_III;
- m_status &= ~STA_2_LOST_DAT;
- wd17xx_clear_drq();
-
- if (!m_drive->floppy_drive_get_flag_state(FLOPPY_DRIVE_READY))
- {
- wd17xx_complete_command(DELAY_NOTREADY);
- }
- else
- {
- /* drive write protected? */
- if (m_drive->floppy_wpt_r() == CLEAR_LINE)
- {
- /* yes */
- m_status |= STA_2_WRITE_PRO;
- /* quit command */
- wd17xx_complete_command(DELAY_ERROR);
- }
- else
- {
- m_command = data & ~FDC_MASK_TYPE_III;
- m_data_offset = 0;
- if (wd17xx_is_sd_only(this))
- m_data_count = TRKSIZE_SD;
- else
- m_data_count = wd17xx_dden() ? TRKSIZE_SD : TRKSIZE_DD;
-
- wd17xx_set_drq();
- m_status |= STA_2_BUSY;
- m_busy_count = 0;
- }
- }
- return;
- }
-
- if ((data & ~FDC_MASK_TYPE_III) == FDC_READ_DAM)
- {
- if (VERBOSE)
- logerror("%s: wd17xx_command_w $%02X READ_DAM\n", machine().describe_context(), data);
-
- m_command_type = TYPE_III;
- m_command = data & ~FDC_MASK_TYPE_III;
- m_status &= ~STA_2_LOST_DAT;
- m_status |= STA_2_BUSY;
-
- wd17xx_clear_drq();
-
- if (m_drive->floppy_drive_get_flag_state(FLOPPY_DRIVE_READY))
- wd17xx_read_id();
- else
- wd17xx_complete_command(DELAY_NOTREADY);
-
- return;
- }
-
- if (VERBOSE)
- logerror("%s: wd17xx_command_w $%02X unknown\n", machine().describe_context(), data);
-
- return;
- }
-
- m_status |= STA_1_BUSY;
-
- /* clear CRC error */
- m_status &=~STA_1_CRC_ERR;
-
- if ((data & ~FDC_MASK_TYPE_I) == FDC_RESTORE)
- {
- if (VERBOSE)
- logerror("%s: wd17xx_command_w $%02X RESTORE\n", machine().describe_context(), data);
-
- wd17xx_command_restore();
- }
-
- if ((data & ~FDC_MASK_TYPE_I) == FDC_SEEK)
- {
- UINT8 newtrack;
-
- if (VERBOSE)
- logerror("old track: $%02x new track: $%02x\n", m_track, m_data);
- m_command_type = TYPE_I;
-
- /* setup step direction */
- if (m_track < m_data)
- {
- if (VERBOSE)
- logerror("direction: +1\n");
-
- m_direction = 1;
- }
- else if (m_track > m_data)
- {
- if (VERBOSE)
- logerror("direction: -1\n");
-
- m_direction = -1;
- }
-
- newtrack = m_data;
- if (VERBOSE)
- logerror("%s: wd17xx_command_w $%02X SEEK (data_reg is $%02X)\n", machine().describe_context(), data, newtrack);
-
- /* reset busy count */
- m_busy_count = 0;
-
- /* keep stepping until reached track programmed */
- while (m_track != newtrack)
- {
- /* update time to simulate seek time busy signal */
- m_busy_count++;
-
- /* update track reg */
- m_track += m_direction;
-
- m_drive->floppy_drive_seek(m_direction);
- }
-
- /* simulate seek time busy signal */
- m_busy_count = 0; //m_busy_count * ((data & FDC_STEP_RATE) + 1);
-#if 0
- wd17xx_set_intrq();
-#endif
- wd17xx_set_busy(attotime::from_usec(100));
-
- }
-
- if ((data & ~(FDC_STEP_UPDATE | FDC_MASK_TYPE_I)) == FDC_STEP)
- {
- if (VERBOSE)
- logerror("%s: wd17xx_command_w $%02X STEP dir %+d\n", machine().describe_context(), data, m_direction);
-
- m_command_type = TYPE_I;
- /* if it is a real floppy, issue a step command */
- /* simulate seek time busy signal */
- m_busy_count = 0; //((data & FDC_STEP_RATE) + 1);
-
- m_drive->floppy_drive_seek(m_direction);
-
- if (data & FDC_STEP_UPDATE)
- m_track += m_direction;
-
-#if 0
- wd17xx_set_intrq();
-#endif
- wd17xx_set_busy(attotime::from_usec(100));
-
-
- }
-
- if ((data & ~(FDC_STEP_UPDATE | FDC_MASK_TYPE_I)) == FDC_STEP_IN)
- {
- if (VERBOSE)
- logerror("%s: wd17xx_command_w $%02X STEP_IN\n", machine().describe_context(), data);
-
- m_command_type = TYPE_I;
- m_direction = +1;
- /* simulate seek time busy signal */
- m_busy_count = 0; //((data & FDC_STEP_RATE) + 1);
-
- m_drive->floppy_drive_seek(m_direction);
-
- if (data & FDC_STEP_UPDATE)
- m_track += m_direction;
-#if 0
- wd17xx_set_intrq();
-#endif
- wd17xx_set_busy(attotime::from_usec(100));
-
- }
-
- if ((data & ~(FDC_STEP_UPDATE | FDC_MASK_TYPE_I)) == FDC_STEP_OUT)
- {
- if (VERBOSE)
- logerror("%s: wd17xx_command_w $%02X STEP_OUT\n", machine().describe_context(), data);
-
- m_command_type = TYPE_I;
- m_direction = -1;
- /* simulate seek time busy signal */
- m_busy_count = 0; //((data & FDC_STEP_RATE) + 1);
-
- /* for now only allows a single drive to be selected */
- m_drive->floppy_drive_seek(m_direction);
-
- if (data & FDC_STEP_UPDATE)
- m_track += m_direction;
-
-#if 0
- wd17xx_set_intrq();
-#endif
- wd17xx_set_busy(attotime::from_usec(100));
- }
-
- if (m_command_type == TYPE_I)
- {
- /* 0 is enable spin up sequence, 1 is disable spin up sequence */
- if ((data & FDC_STEP_HDLOAD)==0)
- {
- m_status |= STA_1_HD_LOADED;
- m_hld_count = 2;
- }
- else
- m_status &= ~STA_1_HD_LOADED;
-
- if (data & FDC_STEP_VERIFY)
- {
- /* verify seek */
- wd17xx_verify_seek();
- }
- }
-}
-
-/* write the FDC track register */
-WRITE8_MEMBER( wd1770_device::track_w )
-{
- if (!wd17xx_has_dal(this)) data ^= 0xff;
-
- m_track = data;
-
- if (VERBOSE)
- logerror("%s: wd17xx_track_w $%02X\n", machine().describe_context(), data);
-}
-
-/* write the FDC sector register */
-WRITE8_MEMBER( wd1770_device::sector_w )
-{
- if (!wd17xx_has_dal(this)) data ^= 0xff;
-
- m_sector = data;
-
- if (VERBOSE)
- logerror("%s: wd17xx_sector_w $%02X\n", machine().describe_context(), data);
-}
-
-/* write the FDC data register */
-WRITE8_MEMBER( wd1770_device::data_w )
-{
- if (!wd17xx_has_dal(this)) data ^= 0xff;
-
- if (m_data_count > 0)
- {
- wd17xx_clear_drq();
-
- /* put byte into buffer */
- if (VERBOSE_DATA)
- logerror("wd17xx_info buffered data: $%02X at offset %d.\n", data, m_data_offset);
-
- m_buffer[m_data_offset++] = data;
-
- if (--m_data_count < 1)
- {
- if (m_command == FDC_WRITE_TRK)
- write_track();
- else
- wd17xx_write_sector();
-
- m_data_offset = 0;
-
- /* Check we should handle the next sector for a multi record write */
- if ( m_command_type == TYPE_II && m_command == FDC_WRITE_SEC && ( m_write_cmd & FDC_MULTI_REC ) )
- {
- m_sector++;
- if (wd17xx_locate_sector())
- {
- m_data_count = m_sector_length;
-
- m_status |= STA_2_BUSY;
- m_busy_count = 0;
-
- wd17xx_timed_data_request();
- }
- }
- else
- {
- wd17xx_complete_command(DELAY_DATADONE);
- if (VERBOSE)
- logerror("wd17xx_data_w(): multi data write completed\n");
- }
-// wd17xx_complete_command( DELAY_DATADONE);
- }
- else
- {
- if (m_command == FDC_WRITE_TRK)
- {
- /* Process special data values according to WD17xx specification.
- Note that as CRC values take up two bytes which are written on
- every 0xf7 byte, this will cause the actual image to
- grow larger than what was written from the system. So we need
- to take the value of data_offset when writing the track.
- */
- if (wd17xx_dden())
- {
- switch (data)
- {
- case 0xf5:
- case 0xf6:
- /* not allowed in FM. */
- /* Take back the last write. */
- m_data_offset--;
- break;
- case 0xf7:
- /* Take back the last write. */
- m_data_offset--;
- /* write two crc bytes */
- m_buffer[m_data_offset++] = (m_crc>>8)&0xff;
- m_buffer[m_data_offset++] = (m_crc&0xff);
- m_crc_active = FALSE;
- break;
- case 0xf8:
- case 0xf9:
- case 0xfa:
- case 0xfb:
- case 0xfe:
- /* Preset crc */
- m_crc = 0xffff;
- /* AM is included in the CRC */
- m_crc = ccitt_crc16_one(m_crc, data);
- m_crc_active = TRUE;
- break;
- case 0xfc:
- /* Write index mark. No effect here as we do not store clock patterns.
- Maybe later. */
- break;
- case 0xfd:
- /* Just write, don't use for CRC. */
- break;
- default:
- /* Byte already written. */
- if (m_crc_active)
- m_crc = ccitt_crc16_one(m_crc, data);
- }
- }
- else /* MFM */
- {
- switch (data)
- {
- case 0xf5:
- /* Take back the last write. */
- m_data_offset--;
- /* Write a1 */
- m_buffer[m_data_offset++] = 0xa1;
- /* Preset CRC */
- m_crc = 0xffff;
- m_crc_active = TRUE;
- break;
- case 0xf6:
- /* Take back the last write. */
- m_data_offset--;
- /* Write c2 */
- m_buffer[m_data_offset++] = 0xc2;
- break;
- case 0xf7:
- /* Take back the last write. */
- m_data_offset--;
- /* write two crc bytes */
- m_buffer[m_data_offset++] = (m_crc>>8)&0xff;
- m_buffer[m_data_offset++] = (m_crc&0xff);
- m_crc_active = FALSE;
- break;
- case 0xf8:
- case 0xf9:
- case 0xfa:
- case 0xfb:
- case 0xfc:
- case 0xfd:
- /* Just write, don't use for CRC. */
- break;
- case 0xfe:
- /* AM is included in the CRC */
- if (m_crc_active)
- m_crc = ccitt_crc16_one(m_crc, data);
- break;
- default:
- /* Byte already written. */
- if (m_crc_active)
- m_crc = ccitt_crc16_one(m_crc, data);
- }
- }
- }
- /* yes... setup a timed data request */
- wd17xx_timed_data_request();
- }
- }
- else
- {
- if (VERBOSE)
- logerror("%s: wd17xx_data_w $%02X\n", machine().describe_context(), data);
- }
- m_data = data;
-}
-
-READ8_MEMBER( wd1770_device::read )
-{
- UINT8 data = 0;
-
- switch (offset & 0x03)
- {
- case 0: data = status_r(space, 0); break;
- case 1: data = track_r(space, 0); break;
- case 2: data = sector_r(space, 0); break;
- case 3: data = data_r(space, 0); break;
- }
-
- return data;
-}
-
-WRITE8_MEMBER( wd1770_device::write )
-{
- switch (offset & 0x03)
- {
- case 0: command_w(space, 0, data); break;
- case 1: track_w(space, 0, data); break;
- case 2: sector_w(space, 0, data); break;
- case 3: data_w(space, 0, data); break;
- }
-}
-
-
-/***************************************************************************
- MAME DEVICE INTERFACE
-***************************************************************************/
-
-const device_type FD1771 = &device_creator<fd1771_device>;
-
-fd1771_device::fd1771_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : wd1770_device(mconfig, FD1771, "FD1771", tag, owner, clock, "fd1771", __FILE__)
-{
-}
-
-
-const device_type FD1781 = &device_creator<fd1781_device>;
-
-fd1781_device::fd1781_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : wd1770_device(mconfig, FD1781, "FD1781", tag, owner, clock, "fd1781", __FILE__)
-{
-}
-
-
-const device_type FD1791 = &device_creator<fd1791_device>;
-
-fd1791_device::fd1791_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : wd1770_device(mconfig, FD1791, "FD1791", tag, owner, clock, "fd1791", __FILE__)
-{
-}
-
-
-const device_type FD1792 = &device_creator<fd1792_device>;
-
-fd1792_device::fd1792_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : wd1770_device(mconfig, FD1792, "FD1792", tag, owner, clock, "fd1792", __FILE__)
-{
-}
-
-
-const device_type FD1793 = &device_creator<fd1793_device>;
-
-fd1793_device::fd1793_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : wd1770_device(mconfig, FD1793, "FD1793", tag, owner, clock, "fd1793", __FILE__)
-{
-}
-
-
-const device_type FD1794 = &device_creator<fd1794_device>;
-
-fd1794_device::fd1794_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : wd1770_device(mconfig, FD1794, "FD1794", tag, owner, clock, "fd1794", __FILE__)
-{
-}
-
-
-const device_type FD1795 = &device_creator<fd1795_device>;
-
-fd1795_device::fd1795_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : wd1770_device(mconfig, FD1795, "FD1795", tag, owner, clock, "fd1795", __FILE__)
-{
-}
-
-
-const device_type FD1797 = &device_creator<fd1797_device>;
-
-fd1797_device::fd1797_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : wd1770_device(mconfig, FD1797, "FD1797", tag, owner, clock, "fd1797", __FILE__)
-{
-}
-
-
-const device_type FD1761 = &device_creator<fd1761_device>;
-
-fd1761_device::fd1761_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : wd1770_device(mconfig, FD1761, "FD1761", tag, owner, clock, "fd1761", __FILE__)
-{
-}
-
-
-const device_type FD1762 = &device_creator<fd1762_device>;
-
-fd1762_device::fd1762_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : wd1770_device(mconfig, FD1762, "FD1762", tag, owner, clock, "fd1762", __FILE__)
-{
-}
-
-
-const device_type FD1763 = &device_creator<fd1763_device>;
-
-fd1763_device::fd1763_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : wd1770_device(mconfig, FD1763, "FD1763", tag, owner, clock, "fd1763", __FILE__)
-{
-}
-
-
-const device_type FD1764 = &device_creator<fd1764_device>;
-
-fd1764_device::fd1764_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : wd1770_device(mconfig, FD1764, "FD1764", tag, owner, clock, "fd1764", __FILE__)
-{
-}
-
-
-const device_type FD1765 = &device_creator<fd1765_device>;
-
-fd1765_device::fd1765_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : wd1770_device(mconfig, FD1765, "FD1765", tag, owner, clock, "fd1765", __FILE__)
-{
-}
-
-
-const device_type FD1767 = &device_creator<fd1767_device>;
-
-fd1767_device::fd1767_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : wd1770_device(mconfig, FD1767, "FD1767", tag, owner, clock, "fd1767", __FILE__)
-{
-}
-
-
-const device_type WD2791 = &device_creator<wd2791_device>;
-
-wd2791_device::wd2791_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : wd1770_device(mconfig, WD2791, "WD2791", tag, owner, clock, "wd2791", __FILE__)
-{
-}
-
-
-const device_type WD2793 = &device_creator<wd2793_device>;
-
-wd2793_device::wd2793_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : wd1770_device(mconfig, WD2793, "WD2793", tag, owner, clock, "wd2793", __FILE__)
-{
-}
-
-
-const device_type WD2795 = &device_creator<wd2795_device>;
-
-wd2795_device::wd2795_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : wd1770_device(mconfig, WD2795, "WD2795", tag, owner, clock, "wd2795", __FILE__)
-{
-}
-
-
-const device_type WD2797 = &device_creator<wd2797_device>;
-
-wd2797_device::wd2797_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : wd1770_device(mconfig, WD2797, "WD2797_LEGACY", tag, owner, clock, "wd2797_l", __FILE__)
-{
-}
-
-
-const device_type WD1770 = &device_creator<wd1770_device>;
-
-wd1770_device::wd1770_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : device_t(mconfig, WD1770, "WD1770_LEGACY", tag, owner, clock, "wd1770_l", __FILE__),
- m_out_intrq_func(*this),
- m_out_drq_func(*this),
- m_in_dden_func(*this)
-{
- for (int i = 0; i < 4; i++)
- m_floppy_drive_tags[i] = NULL;
-}
-
-wd1770_device::wd1770_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source)
- : device_t(mconfig, type, name, tag, owner, clock, shortname, source),
- m_out_intrq_func(*this),
- m_out_drq_func(*this),
- m_in_dden_func(*this)
-{
- for (int i = 0; i < 4; i++)
- m_floppy_drive_tags[i] = NULL;
-}
-
-//-------------------------------------------------
-// device_start - device-specific startup
-//-------------------------------------------------
-
-void wd1770_device::device_start()
-{
- m_status = STA_1_TRACK0;
- m_pause_time = 1000;
-
- /* allocate timers */
- m_timer_cmd = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(wd1770_device::wd17xx_command_callback),this));
- m_timer_data = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(wd1770_device::wd17xx_data_callback),this));
- m_timer_rs = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(wd1770_device::wd17xx_read_sector_callback),this));
- m_timer_ws = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(wd1770_device::wd17xx_write_sector_callback),this));
-
- /* resolve callbacks */
- m_in_dden_func.resolve();
- m_out_intrq_func.resolve_safe();
- m_out_drq_func.resolve_safe();
-
- /* stepping rate depends on the clock */
- m_stepping_rate[0] = 6;
- m_stepping_rate[1] = 12;
- m_stepping_rate[2] = 20;
- m_stepping_rate[3] = 30;
-
-}
-
-//-------------------------------------------------
-// device_reset - device-specific reset
-//-------------------------------------------------
-
-static void wd17xx_index_pulse_callback(device_t *controller, device_t *img, int state)
-{
- wd1770_device *wd = downcast<wd1770_device *>(controller);
- wd->index_pulse_callback(img,state);
-}
-
-void wd1770_device::device_reset()
-{
- /* set the default state of some input lines */
- m_mr = ASSERT_LINE;
- m_wprt = ASSERT_LINE;
- m_dden = ASSERT_LINE;
-
- for (int i = 0; i < 4; i++)
- {
- if (m_floppy_drive_tags[i])
- {
- legacy_floppy_image_device *img = siblingdevice<legacy_floppy_image_device>(m_floppy_drive_tags[i]);
-
- if (img)
- {
- img->floppy_drive_set_controller(this);
- img->floppy_drive_set_index_pulse_callback(wd17xx_index_pulse_callback);
- img->floppy_drive_set_rpm(300.);
- }
- }
- }
-
- set_drive(0);
-
- m_hd = 0;
- m_hld_count = 0;
- m_sector = 1;
- m_last_command_data = 0;
- m_interrupt = 0;
- m_data_count = 0;
- m_idx = 0;
- wd17xx_command_restore();
-}
-
-
-const device_type WD1772 = &device_creator<wd1772_device>;
-
-wd1772_device::wd1772_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : wd1770_device(mconfig, WD1772, "WD1772_LEGACY", tag, owner, clock, "wd1772_l", __FILE__)
-{
-}
-
-//-------------------------------------------------
-// device_start - device-specific startup
-//-------------------------------------------------
-
-void wd1772_device::device_start()
-{
- wd1770_device::device_start();
-
- /* the 1772 has faster track stepping rates */
- m_stepping_rate[0] = 6;
- m_stepping_rate[1] = 12;
- m_stepping_rate[2] = 2;
- m_stepping_rate[3] = 3;
-}
-
-
-const device_type WD1773 = &device_creator<wd1773_device>;
-
-wd1773_device::wd1773_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : wd1770_device(mconfig, WD1773, "WD1773_LEGACY", tag, owner, clock, "wd1773_l", __FILE__)
-{
-}
-
-
-const device_type MB8866 = &device_creator<mb8866_device>;
-
-mb8866_device::mb8866_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : wd1770_device(mconfig, MB8866, "MB8866", tag, owner, clock, "mb8866", __FILE__)
-{
-}
-
-
-const device_type MB8876 = &device_creator<mb8876_device>;
-
-mb8876_device::mb8876_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : wd1770_device(mconfig, MB8876, "MB8876", tag, owner, clock, "mb8876", __FILE__)
-{
-}
-
-
-const device_type MB8877 = &device_creator<mb8877_device>;
-
-mb8877_device::mb8877_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : wd1770_device(mconfig, MB8877, "MB8877_LEGACY", tag, owner, clock, "mb8877_l", __FILE__)
-{
-}
diff --git a/src/emu/machine/wd17xx.h b/src/emu/machine/wd17xx.h
deleted file mode 100644
index 7fe3e48ea1f..00000000000
--- a/src/emu/machine/wd17xx.h
+++ /dev/null
@@ -1,401 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Nathan Woods, Kevin Thacker, Phill Harvey-Smith, Robbbert, Curt Coder
-/*********************************************************************
-
- !!! DEPRECATED, USE src/emu/wd_fdc.h FOR NEW DRIVERS !!!
-
- wd17xx.h
-
- Implementations of the Western Digital 17xx and 27xx families of
- floppy disk controllers
-
-*********************************************************************/
-
-#ifndef __WD17XX_H__
-#define __WD17XX_H__
-
-#include "imagedev/flopdrv.h"
-
-
-/***************************************************************************
- TYPE DEFINITIONS
-***************************************************************************/
-
-#define MCFG_WD17XX_DRIVE_TAGS(_tag1, _tag2, _tag3, _tag4) \
- wd1770_device::set_drive_tags(*device, _tag1, _tag2, _tag3, _tag4);
-
-#define MCFG_WD17XX_DEFAULT_DRIVE4_TAGS \
- MCFG_WD17XX_DRIVE_TAGS(FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3)
-
-#define MCFG_WD17XX_DEFAULT_DRIVE2_TAGS \
- MCFG_WD17XX_DRIVE_TAGS(FLOPPY_0, FLOPPY_1, NULL, NULL)
-
-#define MCFG_WD17XX_DEFAULT_DRIVE1_TAGS \
- MCFG_WD17XX_DRIVE_TAGS(FLOPPY_0, NULL, NULL, NULL)
-
-#define MCFG_WD17XX_INTRQ_CALLBACK(_write) \
- devcb = &wd1770_device::set_intrq_wr_callback(*device, DEVCB_##_write);
-
-#define MCFG_WD17XX_DRQ_CALLBACK(_write) \
- devcb = &wd1770_device::set_drq_wr_callback(*device, DEVCB_##_write);
-
-#define MCFG_WD17XX_DDEN_CALLBACK(_write) \
- devcb = &wd1770_device::set_dden_rd_callback(*device, DEVCB_##_write);
-
-
-/***************************************************************************
- MACROS
-***************************************************************************/
-
-class wd1770_device : public device_t
-{
-public:
- wd1770_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
- wd1770_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
-
- template<class _Object> static devcb_base &set_intrq_wr_callback(device_t &device, _Object object) { return downcast<wd1770_device &>(device).m_out_intrq_func.set_callback(object); }
- template<class _Object> static devcb_base &set_drq_wr_callback(device_t &device, _Object object) { return downcast<wd1770_device &>(device).m_out_drq_func.set_callback(object); }
- template<class _Object> static devcb_base &set_dden_rd_callback(device_t &device, _Object object) { return downcast<wd1770_device &>(device).m_in_dden_func.set_callback(object); }
-
- static void set_drive_tags(device_t &device, const char *tag1, const char *tag2, const char *tag3, const char *tag4)
- {
- wd1770_device &dev = downcast<wd1770_device &>(device);
- dev.m_floppy_drive_tags[0] = tag1;
- dev.m_floppy_drive_tags[1] = tag2;
- dev.m_floppy_drive_tags[2] = tag3;
- dev.m_floppy_drive_tags[3] = tag4;
- }
-
- /* the following are not strictly part of the wd179x hardware/emulation
- but will be put here for now until the flopdrv code has been finalised more */
- void set_drive(UINT8); /* set drive wd179x is accessing */
- void set_side(UINT8); /* set side wd179x is accessing */
-
- void set_pause_time(int usec); /* default is 40 usec if not set */
- void index_pulse_callback(device_t *img, int state);
-
- DECLARE_READ8_MEMBER( status_r );
- DECLARE_READ8_MEMBER( track_r );
- DECLARE_READ8_MEMBER( sector_r );
- DECLARE_READ8_MEMBER( data_r );
-
- DECLARE_WRITE8_MEMBER( command_w );
- DECLARE_WRITE8_MEMBER( track_w );
- DECLARE_WRITE8_MEMBER( sector_w );
- DECLARE_WRITE8_MEMBER( data_w );
-
- DECLARE_READ8_MEMBER( read );
- DECLARE_WRITE8_MEMBER( write );
-
- WRITE_LINE_MEMBER( mr_w );
- WRITE_LINE_MEMBER( rdy_w );
- READ_LINE_MEMBER( mo_r );
- WRITE_LINE_MEMBER( tr00_w );
- WRITE_LINE_MEMBER( idx_w );
- WRITE_LINE_MEMBER( wprt_w );
- WRITE_LINE_MEMBER( dden_w );
- READ_LINE_MEMBER( drq_r );
- READ_LINE_MEMBER( intrq_r );
-protected:
- // device-level overrides
- virtual void device_start();
- virtual void device_reset();
-
-protected:
- int wd17xx_dden();
- void wd17xx_clear_drq();
- void wd17xx_set_drq();
- void wd17xx_clear_intrq();
- void wd17xx_set_intrq();
- TIMER_CALLBACK_MEMBER( wd17xx_command_callback );
- TIMER_CALLBACK_MEMBER( wd17xx_data_callback );
- void wd17xx_set_busy(const attotime &duration);
- void wd17xx_command_restore();
- void write_track();
- void read_track();
- void wd17xx_read_id();
- int wd17xx_locate_sector();
- int wd17xx_find_sector();
- void wd17xx_side_compare(UINT8 command);
- void wd17xx_read_sector();
- void wd17xx_complete_command(int delay);
- void wd17xx_write_sector();
- void wd17xx_verify_seek();
- TIMER_CALLBACK_MEMBER( wd17xx_read_sector_callback );
- TIMER_CALLBACK_MEMBER( wd17xx_write_sector_callback );
- void wd17xx_timed_data_request();
- void wd17xx_timed_read_sector_request();
- void wd17xx_timed_write_sector_request();
-
- // internal state
- /* callbacks */
- devcb_write_line m_out_intrq_func;
- devcb_write_line m_out_drq_func;
- devcb_read_line m_in_dden_func;
-
- const char *m_floppy_drive_tags[4];
-
- /* input lines */
- int m_mr; /* master reset */
- int m_rdy; /* ready, enable precomp */
- int m_tr00; /* track 00 */
- int m_idx; /* index */
- int m_wprt; /* write protect */
- int m_dden; /* double density */
-
- /* output lines */
- int m_mo; /* motor on */
- int m_dirc; /* direction */
- int m_drq; /* data request */
- int m_intrq; /* interrupt request */
-
- /* register */
- UINT8 m_data_shift;
- UINT8 m_data;
- UINT8 m_track;
- UINT8 m_sector;
- UINT8 m_command;
- UINT8 m_status;
- UINT8 m_interrupt;
-
- int m_stepping_rate[4]; /* track stepping rate in ms */
-
- unsigned short m_crc; /* Holds the current CRC value for write_track CRC calculation */
- int m_crc_active; /* Flag indicating that CRC calculation in write_track is active. */
-
- UINT8 m_track_reg; /* value of track register */
- UINT8 m_command_type; /* last command type */
- UINT8 m_head; /* current head # */
-
- UINT8 m_read_cmd; /* last read command issued */
- UINT8 m_write_cmd; /* last write command issued */
- INT8 m_direction; /* last step direction */
- UINT8 m_last_command_data; /* last command data */
-
- UINT8 m_status_drq; /* status register data request bit */
- UINT8 m_busy_count; /* how long to keep busy bit set */
-
- UINT8 m_buffer[6144]; /* I/O buffer (holds up to a whole track) */
- UINT32 m_data_offset; /* offset into I/O buffer */
- INT32 m_data_count; /* transfer count from/into I/O buffer */
-
- UINT8 *m_fmt_sector_data[256]; /* pointer to data after formatting a track */
-
- UINT8 m_dam_list[256][4]; /* list of data address marks while formatting */
- int m_dam_data[256]; /* offset to data inside buffer while formatting */
- int m_dam_cnt; /* valid number of entries in the dam_list */
- UINT16 m_sector_length; /* sector length (byte) */
-
- UINT8 m_ddam; /* ddam of sector found - used when reading */
- UINT8 m_sector_data_id;
- int m_data_direction;
-
- int m_hld_count; /* head loaded counter */
-
- /* timers to delay execution/completion of commands */
- emu_timer *m_timer_cmd, *m_timer_data, *m_timer_rs, *m_timer_ws;
-
- /* this is the drive currently selected */
- legacy_floppy_image_device *m_drive;
-
- /* this is the head currently selected */
- UINT8 m_hd;
-
- /* pause time when writing/reading sector */
- int m_pause_time;
-
- /* Were we busy when we received a FORCE_INT command */
- UINT8 m_was_busy;
-};
-
-extern ATTR_DEPRECATED const device_type WD1770;
-
-class fd1771_device : public wd1770_device
-{
-public:
- fd1771_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-};
-
-extern ATTR_DEPRECATED const device_type FD1771;
-
-class fd1781_device : public wd1770_device
-{
-public:
- fd1781_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-};
-
-extern ATTR_DEPRECATED const device_type FD1781;
-
-class fd1791_device : public wd1770_device
-{
-public:
- fd1791_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-};
-
-extern ATTR_DEPRECATED const device_type FD1791;
-
-class fd1792_device : public wd1770_device
-{
-public:
- fd1792_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-};
-
-extern ATTR_DEPRECATED const device_type FD1792;
-
-class fd1793_device : public wd1770_device
-{
-public:
- fd1793_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-};
-
-extern ATTR_DEPRECATED const device_type FD1793;
-
-class fd1794_device : public wd1770_device
-{
-public:
- fd1794_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-};
-
-extern ATTR_DEPRECATED const device_type FD1794;
-
-class fd1795_device : public wd1770_device
-{
-public:
- fd1795_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-};
-
-extern ATTR_DEPRECATED const device_type FD1795;
-
-class fd1797_device : public wd1770_device
-{
-public:
- fd1797_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-};
-
-extern ATTR_DEPRECATED const device_type FD1797;
-
-class fd1761_device : public wd1770_device
-{
-public:
- fd1761_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-};
-
-extern ATTR_DEPRECATED const device_type FD1761;
-
-class fd1762_device : public wd1770_device
-{
-public:
- fd1762_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-};
-
-extern ATTR_DEPRECATED const device_type FD1762;
-
-class fd1763_device : public wd1770_device
-{
-public:
- fd1763_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-};
-
-extern ATTR_DEPRECATED const device_type FD1763;
-
-class fd1764_device : public wd1770_device
-{
-public:
- fd1764_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-};
-
-extern ATTR_DEPRECATED const device_type FD1764;
-
-class fd1765_device : public wd1770_device
-{
-public:
- fd1765_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-};
-
-extern ATTR_DEPRECATED const device_type FD1765;
-
-class fd1767_device : public wd1770_device
-{
-public:
- fd1767_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-};
-
-extern ATTR_DEPRECATED const device_type FD1767;
-
-class wd2791_device : public wd1770_device
-{
-public:
- wd2791_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-};
-
-extern ATTR_DEPRECATED const device_type WD2791;
-
-class wd2793_device : public wd1770_device
-{
-public:
- wd2793_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-};
-
-extern ATTR_DEPRECATED const device_type WD2793;
-
-class wd2795_device : public wd1770_device
-{
-public:
- wd2795_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-};
-
-extern ATTR_DEPRECATED const device_type WD2795;
-
-class wd2797_device : public wd1770_device
-{
-public:
- wd2797_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-};
-
-extern ATTR_DEPRECATED const device_type WD2797;
-
-class wd1772_device : public wd1770_device
-{
-public:
- wd1772_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-protected:
- // device-level overrides
- virtual void device_start();
-};
-
-extern ATTR_DEPRECATED const device_type WD1772;
-
-class wd1773_device : public wd1770_device
-{
-public:
- wd1773_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-};
-
-extern ATTR_DEPRECATED const device_type WD1773;
-
-class mb8866_device : public wd1770_device
-{
-public:
- mb8866_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-};
-
-extern ATTR_DEPRECATED const device_type MB8866;
-
-class mb8876_device : public wd1770_device
-{
-public:
- mb8876_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-};
-
-extern ATTR_DEPRECATED const device_type MB8876;
-
-class mb8877_device : public wd1770_device
-{
-public:
- mb8877_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-};
-
-extern ATTR_DEPRECATED const device_type MB8877;
-
-
-#endif /* __WD17XX_H__ */
diff --git a/src/emu/machine/wd_fdc.c b/src/emu/machine/wd_fdc.c
index 6263cd95026..06d6df35f92 100644
--- a/src/emu/machine/wd_fdc.c
+++ b/src/emu/machine/wd_fdc.c
@@ -4,28 +4,29 @@
#include "debugger.h"
-const device_type FD1771x = &device_creator<fd1771_t>;
-const device_type FD1781x = &device_creator<fd1781_t>;
-const device_type FD1791x = &device_creator<fd1791_t>;
-const device_type FD1792x = &device_creator<fd1792_t>;
-const device_type FD1793x = &device_creator<fd1793_t>;
-const device_type FD1794x = &device_creator<fd1794_t>;
-const device_type FD1795x = &device_creator<fd1795_t>;
-const device_type FD1797x = &device_creator<fd1797_t>;
-const device_type MB8866x = &device_creator<mb8866_t>;
-const device_type MB8876x = &device_creator<mb8876_t>;
-const device_type MB8877x = &device_creator<mb8877_t>;
-const device_type FD1761x = &device_creator<fd1761_t>;
-const device_type FD1763x = &device_creator<fd1763_t>;
-const device_type FD1765x = &device_creator<fd1765_t>;
-const device_type FD1767x = &device_creator<fd1767_t>;
-const device_type WD2791x = &device_creator<wd2791_t>;
-const device_type WD2793x = &device_creator<wd2793_t>;
-const device_type WD2795x = &device_creator<wd2795_t>;
-const device_type WD2797x = &device_creator<wd2797_t>;
-const device_type WD1770x = &device_creator<wd1770_t>;
-const device_type WD1772x = &device_creator<wd1772_t>;
-const device_type WD1773x = &device_creator<wd1773_t>;
+const device_type FD1771 = &device_creator<fd1771_t>;
+const device_type FD1781 = &device_creator<fd1781_t>;
+const device_type FD1791 = &device_creator<fd1791_t>;
+const device_type FD1792 = &device_creator<fd1792_t>;
+const device_type FD1793 = &device_creator<fd1793_t>;
+const device_type KR1818VG93 = &device_creator<kr1818vg93_t>;
+const device_type FD1794 = &device_creator<fd1794_t>;
+const device_type FD1795 = &device_creator<fd1795_t>;
+const device_type FD1797 = &device_creator<fd1797_t>;
+const device_type MB8866 = &device_creator<mb8866_t>;
+const device_type MB8876 = &device_creator<mb8876_t>;
+const device_type MB8877 = &device_creator<mb8877_t>;
+const device_type FD1761 = &device_creator<fd1761_t>;
+const device_type FD1763 = &device_creator<fd1763_t>;
+const device_type FD1765 = &device_creator<fd1765_t>;
+const device_type FD1767 = &device_creator<fd1767_t>;
+const device_type WD2791 = &device_creator<wd2791_t>;
+const device_type WD2793 = &device_creator<wd2793_t>;
+const device_type WD2795 = &device_creator<wd2795_t>;
+const device_type WD2797 = &device_creator<wd2797_t>;
+const device_type WD1770 = &device_creator<wd1770_t>;
+const device_type WD1772 = &device_creator<wd1772_t>;
+const device_type WD1773 = &device_creator<wd1773_t>;
/*
Debugging flags. Set to 0 or 1.
@@ -747,6 +748,7 @@ void wd_fdc_t::write_track_continue()
if (TRACE_STATE) logerror("%s: DATA_LOAD_WAIT_DONE\n", tag());
if(drq) {
status |= S_LOST;
+ drop_drq();
command_end();
return;
}
@@ -902,13 +904,20 @@ void wd_fdc_t::interrupt_start()
status_type_1 = true;
}
- if(!(command & 0x0f)) {
- intrq_cond = 0;
+ int intcond = command & 0x0f;
+ if (!nonsticky_immint) {
+ if(intcond == 0)
+ intrq_cond = 0;
+ else
+ intrq_cond = (intrq_cond & I_IMM) | intcond;
} else {
- intrq_cond = (intrq_cond & I_IMM) | (command & 0x0f);
+ if (intcond < 8)
+ intrq_cond = intcond;
+ else
+ intrq_cond = 0;
}
- if(intrq_cond & I_IMM) {
+ if(command & I_IMM) {
intrq = true;
if(!intrq_cb.isnull())
intrq_cb(intrq);
@@ -2377,7 +2386,7 @@ void wd_fdc_digital_t::digital_pll_t::commit(floppy_image_device *floppy, const
write_position = 0;
}
-fd1771_t::fd1771_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, FD1771x, "FD1771", tag, owner, clock, "fd1771", __FILE__)
+fd1771_t::fd1771_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, FD1771, "FD1771", tag, owner, clock, "fd1771", __FILE__)
{
const static int fd1771_step_times[4] = { 12000, 12000, 20000, 40000 };
@@ -2391,6 +2400,7 @@ fd1771_t::fd1771_t(const machine_config &mconfig, const char *tag, device_t *own
head_control = true;
motor_control = false;
ready_hooked = true;
+ nonsticky_immint = false;
}
int fd1771_t::calc_sector_size(UINT8 size, UINT8 command) const
@@ -2401,7 +2411,7 @@ int fd1771_t::calc_sector_size(UINT8 size, UINT8 command) const
return size ? size << 4 : 4096;
}
-fd1781_t::fd1781_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, FD1781x, "FD1781", tag, owner, clock, "fd1781", __FILE__)
+fd1781_t::fd1781_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, FD1781, "FD1781", tag, owner, clock, "fd1781", __FILE__)
{
const static int fd1781_step_times[4] = { 6000, 12000, 20000, 40000 };
@@ -2415,6 +2425,7 @@ fd1781_t::fd1781_t(const machine_config &mconfig, const char *tag, device_t *own
head_control = true;
motor_control = false;
ready_hooked = true;
+ nonsticky_immint = false;
}
int fd1781_t::calc_sector_size(UINT8 size, UINT8 command) const
@@ -2428,7 +2439,7 @@ int fd1781_t::calc_sector_size(UINT8 size, UINT8 command) const
const int wd_fdc_t::fd179x_step_times[4] = { 6000, 12000, 20000, 30000 };
const int wd_fdc_t::fd176x_step_times[4] = { 12000, 24000, 40000, 60000 };
-fd1791_t::fd1791_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, FD1791x, "FD1791", tag, owner, clock, "fd1791", __FILE__)
+fd1791_t::fd1791_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, FD1791, "FD1791", tag, owner, clock, "fd1791", __FILE__)
{
step_times = fd179x_step_times;
delay_register_commit = 4;
@@ -2441,9 +2452,10 @@ fd1791_t::fd1791_t(const machine_config &mconfig, const char *tag, device_t *own
head_control = true;
motor_control = false;
ready_hooked = true;
+ nonsticky_immint = false;
}
-fd1792_t::fd1792_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, FD1792x, "FD1792", tag, owner, clock, "fd1792", __FILE__)
+fd1792_t::fd1792_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, FD1792, "FD1792", tag, owner, clock, "fd1792", __FILE__)
{
step_times = fd179x_step_times;
delay_register_commit = 4;
@@ -2456,9 +2468,26 @@ fd1792_t::fd1792_t(const machine_config &mconfig, const char *tag, device_t *own
head_control = true;
motor_control = false;
ready_hooked = true;
+ nonsticky_immint = false;
+}
+
+fd1793_t::fd1793_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, FD1793, "FD1793", tag, owner, clock, "fd1793", __FILE__)
+{
+ step_times = fd179x_step_times;
+ delay_register_commit = 4;
+ delay_command_commit = 12;
+ disable_mfm = false;
+ has_enmf = false;
+ inverted_bus = false;
+ side_control = false;
+ side_compare = true;
+ head_control = true;
+ motor_control = false;
+ ready_hooked = true;
+ nonsticky_immint = false;
}
-fd1793_t::fd1793_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, FD1793x, "FD1793", tag, owner, clock, "fd1793", __FILE__)
+kr1818vg93_t::kr1818vg93_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, KR1818VG93, "KR1818VG93", tag, owner, clock, "kr1818vg93", __FILE__)
{
step_times = fd179x_step_times;
delay_register_commit = 4;
@@ -2471,9 +2500,10 @@ fd1793_t::fd1793_t(const machine_config &mconfig, const char *tag, device_t *own
head_control = true;
motor_control = false;
ready_hooked = true;
+ nonsticky_immint = true;
}
-fd1794_t::fd1794_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, FD1794x, "FD1794", tag, owner, clock, "fd1794", __FILE__)
+fd1794_t::fd1794_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, FD1794, "FD1794", tag, owner, clock, "fd1794", __FILE__)
{
step_times = fd179x_step_times;
delay_register_commit = 4;
@@ -2486,9 +2516,10 @@ fd1794_t::fd1794_t(const machine_config &mconfig, const char *tag, device_t *own
head_control = true;
motor_control = false;
ready_hooked = true;
+ nonsticky_immint = false;
}
-fd1795_t::fd1795_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, FD1795x, "FD1795", tag, owner, clock, "fd1795", __FILE__)
+fd1795_t::fd1795_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, FD1795, "FD1795", tag, owner, clock, "fd1795", __FILE__)
{
step_times = fd179x_step_times;
delay_register_commit = 4;
@@ -2501,6 +2532,7 @@ fd1795_t::fd1795_t(const machine_config &mconfig, const char *tag, device_t *own
head_control = true;
motor_control = false;
ready_hooked = true;
+ nonsticky_immint = false;
}
int fd1795_t::calc_sector_size(UINT8 size, UINT8 command) const
@@ -2511,7 +2543,7 @@ int fd1795_t::calc_sector_size(UINT8 size, UINT8 command) const
return 128 << ((size + 1) & 3);
}
-fd1797_t::fd1797_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, FD1797x, "FD1797", tag, owner, clock, "fd1797", __FILE__)
+fd1797_t::fd1797_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, FD1797, "FD1797", tag, owner, clock, "fd1797", __FILE__)
{
step_times = fd179x_step_times;
delay_register_commit = 4;
@@ -2524,6 +2556,7 @@ fd1797_t::fd1797_t(const machine_config &mconfig, const char *tag, device_t *own
head_control = true;
motor_control = false;
ready_hooked = true;
+ nonsticky_immint = false;
}
int fd1797_t::calc_sector_size(UINT8 size, UINT8 command) const
@@ -2534,7 +2567,7 @@ int fd1797_t::calc_sector_size(UINT8 size, UINT8 command) const
return 128 << ((size + 1) & 3);
}
-mb8866_t::mb8866_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, MB8866x, "MB8866", tag, owner, clock, "mb8866", __FILE__)
+mb8866_t::mb8866_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, MB8866, "MB8866", tag, owner, clock, "mb8866", __FILE__)
{
step_times = fd179x_step_times;
delay_register_commit = 4;
@@ -2547,9 +2580,10 @@ mb8866_t::mb8866_t(const machine_config &mconfig, const char *tag, device_t *own
head_control = true;
motor_control = false;
ready_hooked = true;
+ nonsticky_immint = false;
}
-mb8876_t::mb8876_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, MB8876x, "MB8876", tag, owner, clock, "mb8876", __FILE__)
+mb8876_t::mb8876_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, MB8876, "MB8876", tag, owner, clock, "mb8876", __FILE__)
{
step_times = fd179x_step_times;
delay_register_commit = 4;
@@ -2562,9 +2596,10 @@ mb8876_t::mb8876_t(const machine_config &mconfig, const char *tag, device_t *own
head_control = true;
motor_control = false;
ready_hooked = true;
+ nonsticky_immint = false;
}
-mb8877_t::mb8877_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, MB8877x, "MB8877", tag, owner, clock, "mb8877", __FILE__)
+mb8877_t::mb8877_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, MB8877, "MB8877", tag, owner, clock, "mb8877", __FILE__)
{
step_times = fd179x_step_times;
delay_register_commit = 4;
@@ -2577,9 +2612,10 @@ mb8877_t::mb8877_t(const machine_config &mconfig, const char *tag, device_t *own
head_control = true;
motor_control = false;
ready_hooked = true;
+ nonsticky_immint = false;
}
-fd1761_t::fd1761_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, FD1761x, "FD1761", tag, owner, clock, "fd1761", __FILE__)
+fd1761_t::fd1761_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, FD1761, "FD1761", tag, owner, clock, "fd1761", __FILE__)
{
step_times = fd176x_step_times;
delay_register_commit = 16;
@@ -2592,9 +2628,10 @@ fd1761_t::fd1761_t(const machine_config &mconfig, const char *tag, device_t *own
head_control = true;
motor_control = false;
ready_hooked = true;
+ nonsticky_immint = false;
}
-fd1763_t::fd1763_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, FD1763x, "FD1763", tag, owner, clock, "fd1763", __FILE__)
+fd1763_t::fd1763_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, FD1763, "FD1763", tag, owner, clock, "fd1763", __FILE__)
{
step_times = fd176x_step_times;
delay_register_commit = 16;
@@ -2607,9 +2644,10 @@ fd1763_t::fd1763_t(const machine_config &mconfig, const char *tag, device_t *own
head_control = true;
motor_control = false;
ready_hooked = true;
+ nonsticky_immint = false;
}
-fd1765_t::fd1765_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, FD1765x, "FD1765", tag, owner, clock, "fd1765", __FILE__)
+fd1765_t::fd1765_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, FD1765, "FD1765", tag, owner, clock, "fd1765", __FILE__)
{
step_times = fd176x_step_times;
delay_register_commit = 16;
@@ -2622,6 +2660,7 @@ fd1765_t::fd1765_t(const machine_config &mconfig, const char *tag, device_t *own
head_control = true;
motor_control = false;
ready_hooked = true;
+ nonsticky_immint = false;
}
int fd1765_t::calc_sector_size(UINT8 size, UINT8 command) const
@@ -2632,7 +2671,7 @@ int fd1765_t::calc_sector_size(UINT8 size, UINT8 command) const
return 128 << ((size + 1) & 3);
}
-fd1767_t::fd1767_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, FD1767x, "FD1767", tag, owner, clock, "fd1767", __FILE__)
+fd1767_t::fd1767_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, FD1767, "FD1767", tag, owner, clock, "fd1767", __FILE__)
{
step_times = fd179x_step_times;
delay_register_commit = 16;
@@ -2645,6 +2684,7 @@ fd1767_t::fd1767_t(const machine_config &mconfig, const char *tag, device_t *own
head_control = true;
motor_control = false;
ready_hooked = true;
+ nonsticky_immint = false;
}
int fd1767_t::calc_sector_size(UINT8 size, UINT8 command) const
@@ -2655,7 +2695,7 @@ int fd1767_t::calc_sector_size(UINT8 size, UINT8 command) const
return 128 << ((size + 1) & 3);
}
-wd2791_t::wd2791_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, WD2791x, "WD2791", tag, owner, clock, "wd2791", __FILE__)
+wd2791_t::wd2791_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, WD2791, "WD2791", tag, owner, clock, "wd2791", __FILE__)
{
step_times = fd179x_step_times;
delay_register_commit = 16;
@@ -2668,9 +2708,10 @@ wd2791_t::wd2791_t(const machine_config &mconfig, const char *tag, device_t *own
head_control = true;
motor_control = false;
ready_hooked = true;
+ nonsticky_immint = false;
}
-wd2793_t::wd2793_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, WD2793x, "WD2793", tag, owner, clock, "wd2793", __FILE__)
+wd2793_t::wd2793_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, WD2793, "WD2793", tag, owner, clock, "wd2793", __FILE__)
{
step_times = fd179x_step_times;
delay_register_commit = 16;
@@ -2683,9 +2724,10 @@ wd2793_t::wd2793_t(const machine_config &mconfig, const char *tag, device_t *own
head_control = true;
motor_control = false;
ready_hooked = true;
+ nonsticky_immint = false;
}
-wd2795_t::wd2795_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, WD2795x, "WD2795", tag, owner, clock, "wd2795", __FILE__)
+wd2795_t::wd2795_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, WD2795, "WD2795", tag, owner, clock, "wd2795", __FILE__)
{
step_times = fd179x_step_times;
delay_register_commit = 16;
@@ -2698,6 +2740,7 @@ wd2795_t::wd2795_t(const machine_config &mconfig, const char *tag, device_t *own
head_control = true;
motor_control = false;
ready_hooked = true;
+ nonsticky_immint = false;
}
int wd2795_t::calc_sector_size(UINT8 size, UINT8 command) const
@@ -2708,7 +2751,7 @@ int wd2795_t::calc_sector_size(UINT8 size, UINT8 command) const
return 128 << ((size + 1) & 3);
}
-wd2797_t::wd2797_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, WD2797x, "WD2797", tag, owner, clock, "wd2797", __FILE__)
+wd2797_t::wd2797_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_analog_t(mconfig, WD2797, "WD2797", tag, owner, clock, "wd2797", __FILE__)
{
step_times = fd179x_step_times;
delay_register_commit = 16;
@@ -2721,6 +2764,7 @@ wd2797_t::wd2797_t(const machine_config &mconfig, const char *tag, device_t *own
head_control = true;
motor_control = false;
ready_hooked = true;
+ nonsticky_immint = false;
}
int wd2797_t::calc_sector_size(UINT8 size, UINT8 command) const
@@ -2731,7 +2775,7 @@ int wd2797_t::calc_sector_size(UINT8 size, UINT8 command) const
return 128 << ((size + 1) & 3);
}
-wd1770_t::wd1770_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_digital_t(mconfig, WD1770x, "WD1770", tag, owner, clock, "wd1770", __FILE__)
+wd1770_t::wd1770_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_digital_t(mconfig, WD1770, "WD1770", tag, owner, clock, "wd1770", __FILE__)
{
step_times = wd_digital_step_times;
delay_register_commit = 32;
@@ -2744,9 +2788,10 @@ wd1770_t::wd1770_t(const machine_config &mconfig, const char *tag, device_t *own
head_control = false;
motor_control = true;
ready_hooked = false;
+ nonsticky_immint = false;
}
-wd1772_t::wd1772_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_digital_t(mconfig, WD1772x, "WD1772", tag, owner, clock, "wd1772", __FILE__)
+wd1772_t::wd1772_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_digital_t(mconfig, WD1772, "WD1772", tag, owner, clock, "wd1772", __FILE__)
{
const static int wd1772_step_times[4] = { 12000, 24000, 4000, 6000 };
@@ -2761,6 +2806,7 @@ wd1772_t::wd1772_t(const machine_config &mconfig, const char *tag, device_t *own
head_control = false;
motor_control = true;
ready_hooked = false;
+ nonsticky_immint = false;
}
int wd1772_t::settle_time() const
@@ -2768,7 +2814,7 @@ int wd1772_t::settle_time() const
return 30000;
}
-wd1773_t::wd1773_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_digital_t(mconfig, WD1773x, "WD1773", tag, owner, clock, "wd1773", __FILE__)
+wd1773_t::wd1773_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : wd_fdc_digital_t(mconfig, WD1773, "WD1773", tag, owner, clock, "wd1773", __FILE__)
{
step_times = wd_digital_step_times;
delay_register_commit = 32;
@@ -2781,4 +2827,5 @@ wd1773_t::wd1773_t(const machine_config &mconfig, const char *tag, device_t *own
head_control = false;
motor_control = false;
ready_hooked = true;
+ nonsticky_immint = false;
}
diff --git a/src/emu/machine/wd_fdc.h b/src/emu/machine/wd_fdc.h
index 3f2d6c64b5b..1aa0e1b13dc 100644
--- a/src/emu/machine/wd_fdc.h
+++ b/src/emu/machine/wd_fdc.h
@@ -44,71 +44,74 @@
*/
-#define MCFG_FD1771x_ADD(_tag, _clock) \
- MCFG_DEVICE_ADD(_tag, FD1771x, _clock)
+#define MCFG_FD1771_ADD(_tag, _clock) \
+ MCFG_DEVICE_ADD(_tag, FD1771, _clock)
-#define MCFG_FD1781x_ADD(_tag, _clock) \
- MCFG_DEVICE_ADD(_tag, FD1781x, _clock)
+#define MCFG_FD1781_ADD(_tag, _clock) \
+ MCFG_DEVICE_ADD(_tag, FD1781, _clock)
-#define MCFG_FD1791x_ADD(_tag, _clock) \
- MCFG_DEVICE_ADD(_tag, FD1791x, _clock)
+#define MCFG_FD1791_ADD(_tag, _clock) \
+ MCFG_DEVICE_ADD(_tag, FD1791, _clock)
-#define MCFG_FD1792x_ADD(_tag, _clock) \
- MCFG_DEVICE_ADD(_tag, FD1792x, _clock)
+#define MCFG_FD1792_ADD(_tag, _clock) \
+ MCFG_DEVICE_ADD(_tag, FD1792, _clock)
-#define MCFG_FD1793x_ADD(_tag, _clock) \
- MCFG_DEVICE_ADD(_tag, FD1793x, _clock)
+#define MCFG_FD1793_ADD(_tag, _clock) \
+ MCFG_DEVICE_ADD(_tag, FD1793, _clock)
-#define MCFG_FD1794x_ADD(_tag, _clock) \
- MCFG_DEVICE_ADD(_tag, FD1794x, _clock)
+#define MCFG_KR1818VG93_ADD(_tag, _clock) \
+ MCFG_DEVICE_ADD(_tag, KR1818VG93, _clock)
-#define MCFG_FD1795x_ADD(_tag, _clock) \
- MCFG_DEVICE_ADD(_tag, FD1795x, _clock)
+#define MCFG_FD1794_ADD(_tag, _clock) \
+ MCFG_DEVICE_ADD(_tag, FD1794, _clock)
-#define MCFG_FD1797x_ADD(_tag, _clock) \
- MCFG_DEVICE_ADD(_tag, FD1797x, _clock)
+#define MCFG_FD1795_ADD(_tag, _clock) \
+ MCFG_DEVICE_ADD(_tag, FD1795, _clock)
-#define MCFG_MB8866x_ADD(_tag, _clock) \
- MCFG_DEVICE_ADD(_tag, MB8866x, _clock)
+#define MCFG_FD1797_ADD(_tag, _clock) \
+ MCFG_DEVICE_ADD(_tag, FD1797, _clock)
-#define MCFG_MB8876x_ADD(_tag, _clock) \
- MCFG_DEVICE_ADD(_tag, MB8876x, _clock)
+#define MCFG_MB8866_ADD(_tag, _clock) \
+ MCFG_DEVICE_ADD(_tag, MB8866, _clock)
-#define MCFG_MB8877x_ADD(_tag, _clock) \
- MCFG_DEVICE_ADD(_tag, MB8877x, _clock)
+#define MCFG_MB8876_ADD(_tag, _clock) \
+ MCFG_DEVICE_ADD(_tag, MB8876, _clock)
-#define MCFG_FD1761x_ADD(_tag, _clock) \
- MCFG_DEVICE_ADD(_tag, FD1761x, _clock)
+#define MCFG_MB8877_ADD(_tag, _clock) \
+ MCFG_DEVICE_ADD(_tag, MB8877, _clock)
-#define MCFG_FD1763x_ADD(_tag, _clock) \
- MCFG_DEVICE_ADD(_tag, FD1763x, _clock)
+#define MCFG_FD1761_ADD(_tag, _clock) \
+ MCFG_DEVICE_ADD(_tag, FD1761, _clock)
-#define MCFG_FD1765x_ADD(_tag, _clock) \
- MCFG_DEVICE_ADD(_tag, FD1765x, _clock)
+#define MCFG_FD1763_ADD(_tag, _clock) \
+ MCFG_DEVICE_ADD(_tag, FD1763, _clock)
-#define MCFG_FD1767x_ADD(_tag, _clock) \
- MCFG_DEVICE_ADD(_tag, FD1767x, _clock)
+#define MCFG_FD1765_ADD(_tag, _clock) \
+ MCFG_DEVICE_ADD(_tag, FD1765, _clock)
-#define MCFG_WD2791x_ADD(_tag, _clock) \
- MCFG_DEVICE_ADD(_tag, WD2791x, _clock)
+#define MCFG_FD1767_ADD(_tag, _clock) \
+ MCFG_DEVICE_ADD(_tag, FD1767, _clock)
-#define MCFG_WD2793x_ADD(_tag, _clock) \
- MCFG_DEVICE_ADD(_tag, WD2793x, _clock)
+#define MCFG_WD2791_ADD(_tag, _clock) \
+ MCFG_DEVICE_ADD(_tag, WD2791, _clock)
-#define MCFG_WD2795x_ADD(_tag, _clock) \
- MCFG_DEVICE_ADD(_tag, WD2795x, _clock)
+#define MCFG_WD2793_ADD(_tag, _clock) \
+ MCFG_DEVICE_ADD(_tag, WD2793, _clock)
-#define MCFG_WD2797x_ADD(_tag, _clock) \
- MCFG_DEVICE_ADD(_tag, WD2797x, _clock)
+#define MCFG_WD2795_ADD(_tag, _clock) \
+ MCFG_DEVICE_ADD(_tag, WD2795, _clock)
-#define MCFG_WD1770x_ADD(_tag, _clock) \
- MCFG_DEVICE_ADD(_tag, WD1770x, _clock)
+#define MCFG_WD2797_ADD(_tag, _clock) \
+ MCFG_DEVICE_ADD(_tag, WD2797, _clock)
-#define MCFG_WD1772x_ADD(_tag, _clock) \
- MCFG_DEVICE_ADD(_tag, WD1772x, _clock)
+#define MCFG_WD1770_ADD(_tag, _clock) \
+ MCFG_DEVICE_ADD(_tag, WD1770, _clock)
-#define MCFG_WD1773x_ADD(_tag, _clock) \
- MCFG_DEVICE_ADD(_tag, WD1773x, _clock)
+#define MCFG_WD1772_ADD(_tag, _clock) \
+ MCFG_DEVICE_ADD(_tag, WD1772, _clock)
+
+#define MCFG_WD1773_ADD(_tag, _clock) \
+ MCFG_DEVICE_ADD(_tag, WD1773, _clock)
#define MCFG_WD_FDC_FORCE_READY \
downcast<wd_fdc_t *>(device)->set_force_ready(true);
@@ -176,6 +179,8 @@ public:
void hlt_w(bool state);
bool enp_r();
+
+ void index_callback(floppy_image_device *floppy, int state);
protected:
// Chip-specific configuration flags
@@ -188,6 +193,7 @@ protected:
bool head_control;
bool motor_control;
bool ready_hooked;
+ bool nonsticky_immint;
int clock_ratio;
const int *step_times;
int delay_register_commit;
@@ -316,7 +322,7 @@ private:
WRITE_BYTE,
WRITE_BYTE_DONE,
WRITE_SECTOR_PRE,
- WRITE_SECTOR_PRE_BYTE,
+ WRITE_SECTOR_PRE_BYTE
};
struct live_info {
@@ -416,7 +422,6 @@ private:
void command_end();
void spinup();
- void index_callback(floppy_image_device *floppy, int state);
void ready_callback(floppy_image_device *floppy, int state);
bool sector_matches() const;
bool is_ready();
@@ -532,6 +537,11 @@ public:
fd1793_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
+class kr1818vg93_t : public wd_fdc_analog_t {
+public:
+ kr1818vg93_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
class fd1794_t : public wd_fdc_analog_t {
public:
fd1794_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
@@ -640,32 +650,34 @@ public:
wd1773_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
-extern const device_type FD1771x;
+extern const device_type FD1771;
-extern const device_type FD1781x;
+extern const device_type FD1781;
-extern const device_type FD1791x;
-extern const device_type FD1792x;
-extern const device_type FD1793x;
-extern const device_type FD1795x;
-extern const device_type FD1797x;
+extern const device_type FD1791;
+extern const device_type FD1792;
+extern const device_type FD1793;
+extern const device_type FD1794;
+extern const device_type KR1818VG93;
+extern const device_type FD1795;
+extern const device_type FD1797;
-extern const device_type MB8866x;
-extern const device_type MB8876x;
-extern const device_type MB8877x;
+extern const device_type MB8866;
+extern const device_type MB8876;
+extern const device_type MB8877;
-extern const device_type FD1761x;
-extern const device_type FD1763x;
-extern const device_type FD1765x;
-extern const device_type FD1767x;
+extern const device_type FD1761;
+extern const device_type FD1763;
+extern const device_type FD1765;
+extern const device_type FD1767;
-extern const device_type WD2791x;
-extern const device_type WD2793x;
-extern const device_type WD2795x;
-extern const device_type WD2797x;
+extern const device_type WD2791;
+extern const device_type WD2793;
+extern const device_type WD2795;
+extern const device_type WD2797;
-extern const device_type WD1770x;
-extern const device_type WD1772x;
-extern const device_type WD1773x;
+extern const device_type WD1770;
+extern const device_type WD1772;
+extern const device_type WD1773;
#endif
diff --git a/src/emu/machine/x76f041.h b/src/emu/machine/x76f041.h
index 02178a22f3b..d1f8a8e9e46 100644
--- a/src/emu/machine/x76f041.h
+++ b/src/emu/machine/x76f041.h
@@ -52,7 +52,7 @@ private:
CONFIG_BCR2 = 1,
CONFIG_CR = 2,
CONFIG_RR = 3,
- CONFIG_RC = 4,
+ CONFIG_RC = 4
};
enum bcr_t
diff --git a/src/emu/machine/z80dart.h b/src/emu/machine/z80dart.h
index 27df3dabb82..2674f84758a 100644
--- a/src/emu/machine/z80dart.h
+++ b/src/emu/machine/z80dart.h
@@ -500,6 +500,16 @@ public:
DECLARE_READ8_MEMBER( ba_cd_r );
DECLARE_WRITE8_MEMBER( ba_cd_w );
+ DECLARE_READ8_MEMBER( da_r ) { return m_chanA->data_read(); }
+ DECLARE_WRITE8_MEMBER( da_w ) { m_chanA->data_write(data); }
+ DECLARE_READ8_MEMBER( db_r ) { return m_chanB->data_read(); }
+ DECLARE_WRITE8_MEMBER( db_w ) { m_chanB->data_write(data); }
+
+ DECLARE_READ8_MEMBER( ca_r ) { return m_chanA->control_read(); }
+ DECLARE_WRITE8_MEMBER( ca_w ) { m_chanA->control_write(data); }
+ DECLARE_READ8_MEMBER( cb_r ) { return m_chanB->control_read(); }
+ DECLARE_WRITE8_MEMBER( cb_w ) { m_chanB->control_write(data); }
+
// interrupt acknowledge
int m1_r();
diff --git a/src/emu/mconfig.c b/src/emu/mconfig.c
index 55dd19148f3..f313ce4cf99 100644
--- a/src/emu/mconfig.c
+++ b/src/emu/mconfig.c
@@ -25,6 +25,7 @@ machine_config::machine_config(const game_driver &gamedrv, emu_options &options)
: m_minimum_quantum(attotime::zero),
m_watchdog_vblank_count(0),
m_watchdog_time(attotime::zero),
+ m_force_no_drc(false),
m_default_layout(NULL),
m_gamedrv(gamedrv),
m_options(options)
diff --git a/src/emu/mconfig.h b/src/emu/mconfig.h
index 053890f73e6..f17ea06e632 100644
--- a/src/emu/mconfig.h
+++ b/src/emu/mconfig.h
@@ -17,14 +17,14 @@
#ifndef __MCONFIG_H__
#define __MCONFIG_H__
+#include "emuopts.h"
//**************************************************************************
// CONSTANTS
//**************************************************************************
-// by convention, tags should all lowercase and between 1-15 characters
+// by convention, tags should all be lowercase
#define MIN_TAG_LENGTH 1
-#define MAX_TAG_LENGTH 15
//**************************************************************************
// TYPE DEFINITIONS
@@ -62,6 +62,7 @@ public:
std::string m_perfect_cpu_quantum; // tag of CPU to use for "perfect" scheduling
INT32 m_watchdog_vblank_count; // number of VBLANKs until the watchdog kills us
attotime m_watchdog_time; // length of time until the watchdog kills us
+ bool m_force_no_drc; // whether or not to force DRC off
// other parameters
const char * m_default_layout; // default layout for this machine
@@ -134,6 +135,9 @@ ATTR_COLD device_t *MACHINE_CONFIG_NAME(_name)(machine_config &config, device_t
#define MCFG_QUANTUM_PERFECT_CPU(_cputag) \
config.m_perfect_cpu_quantum = owner->subtag(_cputag);
+// recompilation parameters
+#define MCFG_FORCE_NO_DRC() \
+ config.m_force_no_drc = true;
// watchdog configuration
#define MCFG_WATCHDOG_VBLANK_INIT(_count) \
diff --git a/src/emu/memory.c b/src/emu/memory.c
index fe38d0595b6..790597ed295 100644
--- a/src/emu/memory.c
+++ b/src/emu/memory.c
@@ -1510,7 +1510,6 @@ memory_manager::memory_manager(running_machine &machine)
m_banknext(STATIC_BANK1)
{
memset(m_bank_ptr, 0, sizeof(m_bank_ptr));
- memset(m_bankd_ptr, 0, sizeof(m_bankd_ptr));
}
@@ -2099,41 +2098,6 @@ void address_space::locate_memory()
}
-//-------------------------------------------------
-// set_decrypted_region - registers an address
-// range as having a decrypted data pointer
-//-------------------------------------------------
-
-void address_space::set_decrypted_region(offs_t addrstart, offs_t addrend, void *base)
-{
- offs_t bytestart = address_to_byte(addrstart);
- offs_t byteend = address_to_byte_end(addrend);
- bool found = false;
-
- // loop over banks looking for a match
- for (memory_bank *bank = manager().m_banklist.first(); bank != NULL; bank = bank->next())
- {
- // consider this bank if it is used for reading and matches the address space
- if (bank->references_space(*this, ROW_READ))
- {
- // verify that the provided range fully covers this bank
- if (bank->is_covered_by(bytestart, byteend))
- {
- // set the decrypted pointer for the corresponding memory bank
- bank->set_base_decrypted(reinterpret_cast<UINT8 *>(base) + bank->bytestart() - bytestart);
- found = true;
- }
-
- // fatal error if the decrypted region straddles the bank
- else if (bank->straddles(bytestart, byteend))
- throw emu_fatalerror("memory_set_decrypted_region found straddled region %08X-%08X for device '%s'", bytestart, byteend, m_device.tag());
- }
- }
-
- // fatal error as well if we didn't find any relevant memory banks
- if (!found)
- throw emu_fatalerror("memory_set_decrypted_region unable to find matching region %08X-%08X for device '%s'", bytestart, byteend, m_device.tag());
-}
//-------------------------------------------------
@@ -2675,7 +2639,7 @@ memory_bank &address_space::bank_find_or_allocate(const char *tag, offs_t addrst
membank = global_alloc(memory_bank(*this, banknum, bytestart, byteend, tag));
std::string temptag;
if (tag == NULL) {
- strprintf(temptag, "anon_%p", membank);
+ strprintf(temptag, "anon_%p", (void *) membank);
tag = temptag.c_str();
}
manager().m_banklist.append(tag, *membank);
@@ -2824,7 +2788,7 @@ namespace {
offs_t start, end;
subrange(offs_t _start, offs_t _end) : start(_start), end(_end) {}
};
-};
+}
void address_table::setup_range_masked(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, UINT64 mask, std::list<UINT32> &entries)
{
@@ -3666,8 +3630,7 @@ handler_entry &address_table_write::handler(UINT32 index) const
direct_read_data::direct_read_data(address_space &space)
: m_space(space),
- m_raw(NULL),
- m_decrypted(NULL),
+ m_ptr(NULL),
m_bytemask(space.bytemask()),
m_bytestart(1),
m_byteend(0),
@@ -3718,17 +3681,12 @@ bool direct_read_data::set_direct_region(offs_t &byteaddress)
return false;
}
- // if no decrypted opcodes, point to the same base
- UINT8 *base = *m_space.manager().bank_pointer_addr(m_entry, false);
- UINT8 *based = *m_space.manager().bank_pointer_addr(m_entry, true);
- if (based == NULL)
- based = base;
+ UINT8 *base = *m_space.manager().bank_pointer_addr(m_entry);
// compute the adjusted base
const handler_entry_read &handler = m_space.read().handler_read(m_entry);
m_bytemask = handler.bytemask();
- m_raw = base - (handler.bytestart() & m_bytemask);
- m_decrypted = based - (handler.bytestart() & m_bytemask);
+ m_ptr = base - (handler.bytestart() & m_bytemask);
m_bytestart = maskedbits | range->m_bytestart;
m_byteend = maskedbits | range->m_byteend;
return true;
@@ -3811,15 +3769,12 @@ direct_update_delegate direct_read_data::set_direct_update(direct_update_delegat
// within a custom callback
//-------------------------------------------------
-void direct_read_data::explicit_configure(offs_t bytestart, offs_t byteend, offs_t bytemask, void *raw, void *decrypted)
+void direct_read_data::explicit_configure(offs_t bytestart, offs_t byteend, offs_t bytemask, void *ptr)
{
m_bytestart = bytestart;
m_byteend = byteend;
m_bytemask = bytemask;
- m_raw = reinterpret_cast<UINT8 *>(raw);
- m_decrypted = reinterpret_cast<UINT8 *>((decrypted == NULL) ? raw : decrypted);
- m_raw -= bytestart & bytemask;
- m_decrypted -= bytestart & bytemask;
+ m_ptr = reinterpret_cast<UINT8 *>(ptr) - (bytestart & bytemask);
}
@@ -3901,8 +3856,7 @@ memory_block::~memory_block()
memory_bank::memory_bank(address_space &space, int index, offs_t bytestart, offs_t byteend, const char *tag)
: m_next(NULL),
m_machine(space.machine()),
- m_baseptr(space.manager().bank_pointer_addr(index, false)),
- m_basedptr(space.manager().bank_pointer_addr(index, true)),
+ m_baseptr(space.manager().bank_pointer_addr(index)),
m_index(index),
m_anonymous(tag == NULL),
m_bytestart(bytestart),
@@ -3994,23 +3948,6 @@ void memory_bank::set_base(void *base)
//-------------------------------------------------
-// set_base_decrypted - set the decrypted base
-// explicitly
-//-------------------------------------------------
-
-void memory_bank::set_base_decrypted(void *base)
-{
- // NULL is not an option
- if (base == NULL)
- throw emu_fatalerror("memory_bank::set_base_decrypted called NULL base");
-
- // set the base and invalidate any referencing spaces
- *m_basedptr = reinterpret_cast<UINT8 *>(base);
- invalidate_references();
-}
-
-
-//-------------------------------------------------
// set_entry - set the base to a pre-configured
// entry
//-------------------------------------------------
@@ -4022,13 +3959,11 @@ void memory_bank::set_entry(int entrynum)
throw emu_fatalerror("memory_bank::set_entry called for anonymous bank");
if (entrynum < 0 || entrynum >= int(m_entry.size()))
throw emu_fatalerror("memory_bank::set_entry called with out-of-range entry %d", entrynum);
- if (m_entry[entrynum].m_raw == NULL)
+ if (m_entry[entrynum].m_ptr == NULL)
throw emu_fatalerror("memory_bank::set_entry called for bank '%s' with invalid bank entry %d", m_tag.c_str(), entrynum);
- // set both raw and decrypted values
m_curentry = entrynum;
- *m_baseptr = m_entry[entrynum].m_raw;
- *m_basedptr = m_entry[entrynum].m_decrypted;
+ *m_baseptr = m_entry[entrynum].m_ptr;
// invalidate referencing spaces
invalidate_references();
@@ -4064,11 +3999,11 @@ void memory_bank::configure_entry(int entrynum, void *base)
expand_entries(entrynum);
// set the entry
- m_entry[entrynum].m_raw = reinterpret_cast<UINT8 *>(base);
+ m_entry[entrynum].m_ptr = reinterpret_cast<UINT8 *>(base);
// if the bank base is not configured, and we're the first entry, set us up
if (*m_baseptr == NULL && entrynum == 0)
- *m_baseptr = m_entry[entrynum].m_raw;
+ *m_baseptr = m_entry[entrynum].m_ptr;
}
@@ -4084,43 +4019,6 @@ void memory_bank::configure_entries(int startentry, int numentries, void *base,
}
-//-------------------------------------------------
-// configure_decrypted_entry - configure a
-// decrypted entry
-//-------------------------------------------------
-
-void memory_bank::configure_decrypted_entry(int entrynum, void *base)
-{
- // must be positive
- if (entrynum < 0)
- throw emu_fatalerror("memory_bank::configure_decrypted_entry called with out-of-range entry %d", entrynum);
-
- // if we haven't allocated this many entries yet, expand our array
- if (entrynum >= int(m_entry.size()))
- expand_entries(entrynum);
-
- // set the entry
- m_entry[entrynum].m_decrypted = reinterpret_cast<UINT8 *>(base);
-
- // if the bank base is not configured, and we're the first entry, set us up
- if (*m_basedptr == NULL && entrynum == 0)
- *m_basedptr = m_entry[entrynum].m_decrypted;
-}
-
-
-//-------------------------------------------------
-// configure_decrypted_entries - configure
-// multiple decrypted entries
-//-------------------------------------------------
-
-void memory_bank::configure_decrypted_entries(int startentry, int numentries, void *base, offs_t stride)
-{
- // fill in the requested bank entries (backwards to improve allocation)
- for (int entrynum = startentry + numentries - 1; entrynum >= startentry; entrynum--)
- configure_decrypted_entry(entrynum, reinterpret_cast<UINT8 *>(base) + (entrynum - startentry) * stride);
-}
-
-
//**************************************************************************
// MEMORY REGIONS
//**************************************************************************
diff --git a/src/emu/memory.h b/src/emu/memory.h
index da91f4c0baf..ff02476fc7f 100644
--- a/src/emu/memory.h
+++ b/src/emu/memory.h
@@ -37,9 +37,10 @@ enum address_spacenum
// alternate address space names for common use
AS_PROGRAM = AS_0, // program address space
AS_DATA = AS_1, // data address space
- AS_IO = AS_2 // I/O address space
+ AS_IO = AS_2, // I/O address space
+ AS_DECRYPTED_OPCODES = AS_3 // decrypted opcodes, when separate from data accesses
};
-DECLARE_ENUM_OPERATORS(address_spacenum);
+DECLARE_ENUM_OPERATORS(address_spacenum)
// read or write constants
enum read_or_write
@@ -166,8 +167,7 @@ public:
// getters
address_space &space() const { return m_space; }
- UINT8 *raw() const { return m_raw; }
- UINT8 *decrypted() const { return m_decrypted; }
+ UINT8 *ptr() const { return m_ptr; }
// see if an address is within bounds, or attempt to update it if not
bool address_is_valid(offs_t byteaddress) { return EXPECTED(byteaddress >= m_bytestart && byteaddress <= m_byteend) || set_direct_region(byteaddress); }
@@ -178,21 +178,14 @@ public:
// custom update callbacks and configuration
direct_update_delegate set_direct_update(direct_update_delegate function);
- void explicit_configure(offs_t bytestart, offs_t byteend, offs_t bytemask, void *raw, void *decrypted = NULL);
-
- // accessor methods for reading raw data
- void *read_raw_ptr(offs_t byteaddress, offs_t directxor = 0);
- UINT8 read_raw_byte(offs_t byteaddress, offs_t directxor = 0);
- UINT16 read_raw_word(offs_t byteaddress, offs_t directxor = 0);
- UINT32 read_raw_dword(offs_t byteaddress, offs_t directxor = 0);
- UINT64 read_raw_qword(offs_t byteaddress, offs_t directxor = 0);
-
- // accessor methods for reading decrypted data
- void *read_decrypted_ptr(offs_t byteaddress, offs_t directxor = 0);
- UINT8 read_decrypted_byte(offs_t byteaddress, offs_t directxor = 0);
- UINT16 read_decrypted_word(offs_t byteaddress, offs_t directxor = 0);
- UINT32 read_decrypted_dword(offs_t byteaddress, offs_t directxor = 0);
- UINT64 read_decrypted_qword(offs_t byteaddress, offs_t directxor = 0);
+ void explicit_configure(offs_t bytestart, offs_t byteend, offs_t bytemask, void *raw);
+
+ // accessor methods
+ void *read_ptr(offs_t byteaddress, offs_t directxor = 0);
+ UINT8 read_byte(offs_t byteaddress, offs_t directxor = 0);
+ UINT16 read_word(offs_t byteaddress, offs_t directxor = 0);
+ UINT32 read_dword(offs_t byteaddress, offs_t directxor = 0);
+ UINT64 read_qword(offs_t byteaddress, offs_t directxor = 0);
private:
// internal helpers
@@ -202,8 +195,7 @@ private:
// internal state
address_space & m_space;
- UINT8 * m_raw; // direct access data pointer (raw)
- UINT8 * m_decrypted; // direct access data pointer (decrypted)
+ UINT8 * m_ptr; // direct access data pointer
offs_t m_bytemask; // byte address mask
offs_t m_bytestart; // minimum valid byte address
offs_t m_byteend; // maximum valid byte address
@@ -355,9 +347,6 @@ public:
offs_t byte_to_address(offs_t address) const { return m_config.byte2addr(address); }
offs_t byte_to_address_end(offs_t address) const { return m_config.byte2addr_end(address); }
- // decryption
- void set_decrypted_region(offs_t addrstart, offs_t addrend, void *base);
-
// direct access
direct_update_delegate set_direct_update_handler(direct_update_delegate function) { return m_direct->set_direct_update(function); }
bool set_direct_region(offs_t &byteaddress);
@@ -566,11 +555,10 @@ class memory_bank
read_or_write m_readorwrite; // used for read or write?
};
- // a bank_entry contains a raw and decrypted pointer
+ // a bank_entry contains a pointer
struct bank_entry
{
- UINT8 * m_raw;
- UINT8 * m_decrypted;
+ UINT8 * m_ptr;
};
public:
@@ -586,7 +574,6 @@ public:
bool anonymous() const { return m_anonymous; }
offs_t bytestart() const { return m_bytestart; }
void *base() const { return *m_baseptr; }
- void *base_decrypted() const { return *m_basedptr; }
const char *tag() const { return m_tag.c_str(); }
const char *name() const { return m_name.c_str(); }
@@ -602,13 +589,10 @@ public:
// set the base explicitly
void set_base(void *base);
- void set_base_decrypted(void *base);
// configure and set entries
void configure_entry(int entrynum, void *base);
void configure_entries(int startentry, int numentries, void *base, offs_t stride);
- void configure_decrypted_entry(int entrynum, void *base);
- void configure_decrypted_entries(int startentry, int numentries, void *base, offs_t stride);
void set_entry(int entrynum);
private:
@@ -620,7 +604,6 @@ private:
memory_bank * m_next; // next bank in sequence
running_machine & m_machine; // need the machine to free our memory
UINT8 ** m_baseptr; // pointer to our base pointer in the global array
- UINT8 ** m_basedptr; // same for the decrypted base pointer
UINT16 m_index; // array index for this handler
bool m_anonymous; // are we anonymous or explicit?
offs_t m_bytestart; // byte-adjusted start offset
@@ -747,7 +730,7 @@ public:
void dump(FILE *file);
// pointers to a bank pointer (internal usage only)
- UINT8 **bank_pointer_addr(UINT8 index, bool decrypted = false) { return decrypted ? &m_bankd_ptr[index] : &m_bank_ptr[index]; }
+ UINT8 **bank_pointer_addr(UINT8 index) { return &m_bank_ptr[index]; }
// regions
memory_region *region_alloc(const char *name, UINT32 length, UINT8 width, endianness_t endian);
@@ -766,7 +749,6 @@ private:
bool m_initialized; // have we completed initialization?
UINT8 * m_bank_ptr[TOTAL_MEMORY_BANKS]; // array of bank pointers
- UINT8 * m_bankd_ptr[TOTAL_MEMORY_BANKS]; // array of decrypted bank pointers
simple_list<address_space> m_spacelist; // list of address spaces
simple_list<memory_block> m_blocklist; // head of the list of memory blocks
@@ -887,102 +869,67 @@ private:
//**************************************************************************
//-------------------------------------------------
-// read_raw_ptr - return a pointer to valid RAM
+// read_ptr - return a pointer to valid RAM
// referenced by the address, or NULL if no RAM
// backing that address
//-------------------------------------------------
-inline void *direct_read_data::read_raw_ptr(offs_t byteaddress, offs_t directxor)
-{
- if (address_is_valid(byteaddress))
- return &m_raw[(byteaddress ^ directxor) & m_bytemask];
- return NULL;
-}
-
-inline void *direct_read_data::read_decrypted_ptr(offs_t byteaddress, offs_t directxor)
+inline void *direct_read_data::read_ptr(offs_t byteaddress, offs_t directxor)
{
if (address_is_valid(byteaddress))
- return &m_decrypted[(byteaddress ^ directxor) & m_bytemask];
+ return &m_ptr[(byteaddress ^ directxor) & m_bytemask];
return NULL;
}
//-------------------------------------------------
-// read_raw_byte - read a byte via the
+// read_byte - read a byte via the
// direct_read_data class
//-------------------------------------------------
-inline UINT8 direct_read_data::read_raw_byte(offs_t byteaddress, offs_t directxor)
+inline UINT8 direct_read_data::read_byte(offs_t byteaddress, offs_t directxor)
{
if (address_is_valid(byteaddress))
- return m_raw[(byteaddress ^ directxor) & m_bytemask];
- return m_space.read_byte(byteaddress);
-}
-
-inline UINT8 direct_read_data::read_decrypted_byte(offs_t byteaddress, offs_t directxor)
-{
- if (address_is_valid(byteaddress))
- return m_decrypted[(byteaddress ^ directxor) & m_bytemask];
+ return m_ptr[(byteaddress ^ directxor) & m_bytemask];
return m_space.read_byte(byteaddress);
}
//-------------------------------------------------
-// read_raw_word - read a word via the
+// read_word - read a word via the
// direct_read_data class
//-------------------------------------------------
-inline UINT16 direct_read_data::read_raw_word(offs_t byteaddress, offs_t directxor)
+inline UINT16 direct_read_data::read_word(offs_t byteaddress, offs_t directxor)
{
if (address_is_valid(byteaddress))
- return *reinterpret_cast<UINT16 *>(&m_raw[(byteaddress ^ directxor) & m_bytemask]);
- return m_space.read_word(byteaddress);
-}
-
-inline UINT16 direct_read_data::read_decrypted_word(offs_t byteaddress, offs_t directxor)
-{
- if (address_is_valid(byteaddress))
- return *reinterpret_cast<UINT16 *>(&m_decrypted[(byteaddress ^ directxor) & m_bytemask]);
+ return *reinterpret_cast<UINT16 *>(&m_ptr[(byteaddress ^ directxor) & m_bytemask]);
return m_space.read_word(byteaddress);
}
//-------------------------------------------------
-// read_raw_dword - read a dword via the
+// read_dword - read a dword via the
// direct_read_data class
//-------------------------------------------------
-inline UINT32 direct_read_data::read_raw_dword(offs_t byteaddress, offs_t directxor)
+inline UINT32 direct_read_data::read_dword(offs_t byteaddress, offs_t directxor)
{
if (address_is_valid(byteaddress))
- return *reinterpret_cast<UINT32 *>(&m_raw[(byteaddress ^ directxor) & m_bytemask]);
- return m_space.read_dword(byteaddress);
-}
-
-inline UINT32 direct_read_data::read_decrypted_dword(offs_t byteaddress, offs_t directxor)
-{
- if (address_is_valid(byteaddress))
- return *reinterpret_cast<UINT32 *>(&m_decrypted[(byteaddress ^ directxor) & m_bytemask]);
+ return *reinterpret_cast<UINT32 *>(&m_ptr[(byteaddress ^ directxor) & m_bytemask]);
return m_space.read_dword(byteaddress);
}
//-------------------------------------------------
-// read_raw_qword - read a qword via the
+// read_qword - read a qword via the
// direct_read_data class
//-------------------------------------------------
-inline UINT64 direct_read_data::read_raw_qword(offs_t byteaddress, offs_t directxor)
-{
- if (address_is_valid(byteaddress))
- return *reinterpret_cast<UINT64 *>(&m_raw[(byteaddress ^ directxor) & m_bytemask]);
- return m_space.read_qword(byteaddress);
-}
-
-inline UINT64 direct_read_data::read_decrypted_qword(offs_t byteaddress, offs_t directxor)
+inline UINT64 direct_read_data::read_qword(offs_t byteaddress, offs_t directxor)
{
if (address_is_valid(byteaddress))
- return *reinterpret_cast<UINT64 *>(&m_decrypted[(byteaddress ^ directxor) & m_bytemask]);
+ return *reinterpret_cast<UINT64 *>(&m_ptr[(byteaddress ^ directxor) & m_bytemask]);
return m_space.read_qword(byteaddress);
}
diff --git a/src/emu/netlist/analog/nld_bjt.c b/src/emu/netlist/analog/nld_bjt.c
index fe9644ef052..0e793c7d909 100644
--- a/src/emu/netlist/analog/nld_bjt.c
+++ b/src/emu/netlist/analog/nld_bjt.c
@@ -5,9 +5,11 @@
*
*/
+#include <solver/nld_solver.h>
#include "nld_bjt.h"
#include "../nl_setup.h"
-#include "nld_solver.h"
+
+NETLIB_NAMESPACE_DEVICES_START()
class diode
{
@@ -42,6 +44,15 @@ private:
// nld_Q
// ----------------------------------------------------------------------------------------
+NETLIB_NAME(Q)::NETLIB_NAME(Q)(const family_t afamily)
+: device_t(afamily)
+, m_qtype(BJT_NPN) { }
+
+NETLIB_NAME(Q)::~NETLIB_NAME(Q)()
+{
+}
+
+
NETLIB_START(Q)
{
register_param("model", m_model, "");
@@ -72,49 +83,21 @@ NETLIB_START(QBJT_switch)
register_terminal("_B1", m_BC_dummy.m_P);
register_terminal("_C1", m_BC_dummy.m_N);
- connect(m_RB.m_N, m_RC.m_N);
+ connect_late(m_RB.m_N, m_RC.m_N);
- connect(m_RB.m_P, m_BC_dummy.m_P);
- connect(m_RC.m_P, m_BC_dummy.m_N);
+ connect_late(m_RB.m_P, m_BC_dummy.m_P);
+ connect_late(m_RC.m_P, m_BC_dummy.m_N);
save(NLNAME(m_state_on));
- m_state_on = 0;
-
- {
- nl_double IS = m_model.model_value("IS", 1e-15);
- nl_double BF = m_model.model_value("BF", 100);
- nl_double NF = m_model.model_value("NF", 1);
- //nl_double VJE = m_model.dValue("VJE", 0.75);
-
- set_qtype((m_model.model_type() == "NPN") ? BJT_NPN : BJT_PNP);
-
- nl_double alpha = BF / (1.0 + BF);
-
- diode d(IS, NF);
-
- // Assume 5mA Collector current for switch operation
-
- m_V = d.V(0.005 / alpha);
-
- /* Base current is 0.005 / beta
- * as a rough estimate, we just scale the conductance down */
-
- m_gB = 1.0 / (m_V/(0.005 / BF));
-
- //m_gB = d.gI(0.005 / alpha);
-
- if (m_gB < netlist().gmin())
- m_gB = netlist().gmin();
- m_gC = d.gI(0.005); // very rough estimate
- }
-
}
NETLIB_RESET(QBJT_switch)
{
NETLIB_NAME(Q)::reset();
+ m_state_on = 0;
+
m_RB.set(netlist().gmin(), 0.0, 0.0);
m_RC.set(netlist().gmin(), 0.0, 0.0);
@@ -135,6 +118,31 @@ NETLIB_UPDATE(QBJT_switch)
NETLIB_UPDATE_PARAM(QBJT_switch)
{
+ nl_double IS = m_model.model_value("IS", 1e-15);
+ nl_double BF = m_model.model_value("BF", 100);
+ nl_double NF = m_model.model_value("NF", 1);
+ //nl_double VJE = m_model.dValue("VJE", 0.75);
+
+ set_qtype((m_model.model_type() == "NPN") ? BJT_NPN : BJT_PNP);
+
+ nl_double alpha = BF / (1.0 + BF);
+
+ diode d(IS, NF);
+
+ // Assume 5mA Collector current for switch operation
+
+ m_V = d.V(0.005 / alpha);
+
+ /* Base current is 0.005 / beta
+ * as a rough estimate, we just scale the conductance down */
+
+ m_gB = 1.0 / (m_V/(0.005 / BF));
+
+ //m_gB = d.gI(0.005 / alpha);
+
+ if (m_gB < netlist().gmin())
+ m_gB = netlist().gmin();
+ m_gC = d.gI(0.005); // very rough estimate
}
NETLIB_UPDATE_TERMINALS(QBJT_switch)
@@ -174,29 +182,13 @@ NETLIB_START(QBJT_EB)
register_terminal("_E1", m_D_EC.m_P);
register_terminal("_C1", m_D_EC.m_N);
- connect(m_D_EB.m_P, m_D_EC.m_P);
- connect(m_D_EB.m_N, m_D_CB.m_N);
- connect(m_D_CB.m_P, m_D_EC.m_N);
+ connect_late(m_D_EB.m_P, m_D_EC.m_P);
+ connect_late(m_D_EB.m_N, m_D_CB.m_N);
+ connect_late(m_D_CB.m_P, m_D_EC.m_N);
m_gD_BE.save("m_D_BE", *this);
m_gD_BC.save("m_D_BC", *this);
- {
- nl_double IS = m_model.model_value("IS", 1e-15);
- nl_double BF = m_model.model_value("BF", 100);
- nl_double NF = m_model.model_value("NF", 1);
- nl_double BR = m_model.model_value("BR", 1);
- nl_double NR = m_model.model_value("NR", 1);
- //nl_double VJE = m_model.dValue("VJE", 0.75);
-
- set_qtype((m_model.model_type() == "NPN") ? BJT_NPN : BJT_PNP);
-
- m_alpha_f = BF / (1.0 + BF);
- m_alpha_r = BR / (1.0 + BR);
-
- m_gD_BE.set_param(IS / m_alpha_f, NF, netlist().gmin());
- m_gD_BC.set_param(IS / m_alpha_r, NR, netlist().gmin());
- }
}
NETLIB_UPDATE(QBJT_EB)
@@ -238,4 +230,20 @@ NETLIB_UPDATE_TERMINALS(QBJT_EB)
NETLIB_UPDATE_PARAM(QBJT_EB)
{
+ nl_double IS = m_model.model_value("IS", 1e-15);
+ nl_double BF = m_model.model_value("BF", 100);
+ nl_double NF = m_model.model_value("NF", 1);
+ nl_double BR = m_model.model_value("BR", 1);
+ nl_double NR = m_model.model_value("NR", 1);
+ //nl_double VJE = m_model.dValue("VJE", 0.75);
+
+ set_qtype((m_model.model_type() == "NPN") ? BJT_NPN : BJT_PNP);
+
+ m_alpha_f = BF / (1.0 + BF);
+ m_alpha_r = BR / (1.0 + BR);
+
+ m_gD_BE.set_param(IS / m_alpha_f, NF, netlist().gmin());
+ m_gD_BC.set_param(IS / m_alpha_r, NR, netlist().gmin());
}
+
+NETLIB_NAMESPACE_DEVICES_END()
diff --git a/src/emu/netlist/analog/nld_bjt.h b/src/emu/netlist/analog/nld_bjt.h
index eca05c423c7..df0a68f5cf8 100644
--- a/src/emu/netlist/analog/nld_bjt.h
+++ b/src/emu/netlist/analog/nld_bjt.h
@@ -16,7 +16,7 @@
// ----------------------------------------------------------------------------------------
#define QBJT_SW(_name, _model) \
- NET_REGISTER_DEV(QBJT_switch, _name) \
+ NET_REGISTER_DEV(QBJT_SW, _name) \
NETDEV_PARAMI(_name, model, _model)
#define QBJT_EB(_name, _model) \
@@ -24,13 +24,15 @@
NETDEV_PARAMI(_name, model, _model)
+NETLIB_NAMESPACE_DEVICES_START()
+
// ----------------------------------------------------------------------------------------
// nld_Q - Base classes
// ----------------------------------------------------------------------------------------
// Have a common start for transistors
-class NETLIB_NAME(Q) : public netlist_device_t
+class NETLIB_NAME(Q) : public device_t
{
public:
enum q_type {
@@ -38,19 +40,18 @@ public:
BJT_PNP
};
- ATTR_COLD NETLIB_NAME(Q)(const family_t afamily)
- : netlist_device_t(afamily)
- , m_qtype(BJT_NPN) { }
+ NETLIB_NAME(Q)(const family_t afamily);
+ virtual ~NETLIB_NAME(Q)();
inline q_type qtype() const { return m_qtype; }
inline bool is_qtype(q_type atype) const { return m_qtype == atype; }
inline void set_qtype(q_type atype) { m_qtype = atype; }
protected:
- /* ATTR_COLD */ virtual void start();
- /* ATTR_COLD */ virtual void reset();
+ virtual void start();
+ virtual void reset();
ATTR_HOT void update();
- netlist_param_model_t m_model;
+ param_model_t m_model;
private:
q_type m_qtype;
};
@@ -59,9 +60,11 @@ class NETLIB_NAME(QBJT) : public NETLIB_NAME(Q)
{
public:
- ATTR_COLD NETLIB_NAME(QBJT)(const family_t afamily)
+ NETLIB_NAME(QBJT)(const family_t afamily)
: NETLIB_NAME(Q)(afamily) { }
+ virtual ~NETLIB_NAME(QBJT)() { }
+
protected:
private:
@@ -93,9 +96,9 @@ class NETLIB_NAME(QBJT_switch) : public NETLIB_NAME(QBJT)
public:
ATTR_COLD NETLIB_NAME(QBJT_switch)()
: NETLIB_NAME(QBJT)(BJT_SWITCH),
- m_RB(netlist_object_t::ANALOG),
- m_RC(netlist_object_t::ANALOG),
- m_BC_dummy(netlist_object_t::ANALOG),
+ m_RB(object_t::ANALOG),
+ m_RC(object_t::ANALOG),
+ m_BC_dummy(object_t::ANALOG),
m_gB(NETLIST_GMIN_DEFAULT), m_gC(NETLIST_GMIN_DEFAULT), m_V(0.0), m_state_on(0) { }
@@ -110,9 +113,9 @@ public:
protected:
- /* ATTR_COLD */ virtual void start();
+ virtual void start();
ATTR_HOT virtual void update_param();
- /* ATTR_COLD */ virtual void reset();
+ virtual void reset();
NETLIB_UPDATE_TERMINALSI();
nl_double m_gB; // base conductance / switch on
@@ -133,23 +136,23 @@ class NETLIB_NAME(QBJT_EB) : public NETLIB_NAME(QBJT)
public:
ATTR_COLD NETLIB_NAME(QBJT_EB)()
: NETLIB_NAME(QBJT)(BJT_EB),
- m_D_CB(netlist_object_t::ANALOG),
- m_D_EB(netlist_object_t::ANALOG),
- m_D_EC(netlist_object_t::ANALOG),
+ m_D_CB(object_t::ANALOG),
+ m_D_EB(object_t::ANALOG),
+ m_D_EC(object_t::ANALOG),
m_alpha_f(0),
m_alpha_r(0)
{ }
protected:
- /* ATTR_COLD */ virtual void start();
- /* ATTR_COLD */ virtual void reset();
+ virtual void start();
+ virtual void reset();
ATTR_HOT void update_param();
ATTR_HOT void virtual update();
NETLIB_UPDATE_TERMINALSI();
- netlist_generic_diode m_gD_BC;
- netlist_generic_diode m_gD_BE;
+ generic_diode m_gD_BC;
+ generic_diode m_gD_BE;
nld_twoterm m_D_CB; // gcc, gce - gcc, gec - gcc, gcc - gce | Ic
nld_twoterm m_D_EB; // gee, gec - gee, gce - gee, gee - gec | Ie
@@ -161,4 +164,6 @@ protected:
private:
};
+NETLIB_NAMESPACE_DEVICES_END()
+
#endif /* NLD_BJT_H_ */
diff --git a/src/emu/netlist/analog/nld_fourterm.c b/src/emu/netlist/analog/nld_fourterm.c
index e2457d8ee11..58d173e6554 100644
--- a/src/emu/netlist/analog/nld_fourterm.c
+++ b/src/emu/netlist/analog/nld_fourterm.c
@@ -5,9 +5,11 @@
*
*/
+#include <solver/nld_solver.h>
#include "nld_fourterm.h"
#include "../nl_setup.h"
-#include "nld_solver.h"
+
+NETLIB_NAMESPACE_DEVICES_START()
// ----------------------------------------------------------------------------------------
// nld_VCCS
@@ -41,8 +43,8 @@ void NETLIB_NAME(VCCS)::start_internal(const nl_double def_RI)
m_ON.m_otherterm = &m_IP;
m_ON1.m_otherterm = &m_IN;
- connect(m_OP, m_OP1);
- connect(m_ON, m_ON1);
+ connect_late(m_OP, m_OP1);
+ connect_late(m_ON, m_ON1);
}
NETLIB_RESET(VCCS)
@@ -50,6 +52,7 @@ NETLIB_RESET(VCCS)
const nl_double m_mult = m_G.Value() * m_gfac; // 1.0 ==> 1V ==> 1A
const nl_double GI = NL_FCONST(1.0) / m_RI.Value();
+ //printf("VCCS %s RI %f\n", name().cstr(), m_RI.Value());
m_IP.set(GI);
m_IN.set(GI);
@@ -62,12 +65,12 @@ NETLIB_RESET(VCCS)
NETLIB_UPDATE_PARAM(VCCS)
{
+ NETLIB_NAME(VCCS)::reset();
}
NETLIB_UPDATE(VCCS)
{
/* only called if connected to a rail net ==> notify the solver to recalculate */
- /* Big FIXME ... */
if (!m_IP.net().isRailNet())
m_IP.schedule_solve();
else if (!m_IN.net().isRailNet())
@@ -79,6 +82,56 @@ NETLIB_UPDATE(VCCS)
}
// ----------------------------------------------------------------------------------------
+// nld_LVCCS
+// ----------------------------------------------------------------------------------------
+
+NETLIB_START(LVCCS)
+{
+ NETLIB_NAME(VCCS)::start();
+ register_param("CURLIM", m_cur_limit, 1000.0);
+}
+
+NETLIB_RESET(LVCCS)
+{
+ NETLIB_NAME(VCCS)::reset();
+}
+
+NETLIB_UPDATE_PARAM(LVCCS)
+{
+ NETLIB_NAME(VCCS)::update_param();
+}
+
+NETLIB_UPDATE(LVCCS)
+{
+ NETLIB_NAME(VCCS)::update();
+}
+
+NETLIB_UPDATE_TERMINALS(LVCCS)
+{
+ const nl_double m_mult = m_G.Value() * m_gfac; // 1.0 ==> 1V ==> 1A
+ const nl_double vi = m_IP.net().m_cur_Analog - m_IN.net().m_cur_Analog;
+
+ if (std::abs(m_mult / m_cur_limit * vi) > 0.5)
+ m_vi = m_vi + 0.2*std::tanh((vi - m_vi)/0.2);
+ else
+ m_vi = vi;
+
+ const nl_double x = m_mult / m_cur_limit * m_vi;
+ const nl_double X = std::tanh(x);
+
+ const nl_double beta = m_mult * (1.0 - X*X);
+ const nl_double I = m_cur_limit * X - beta * m_vi;
+
+ m_OP.set(beta, NL_FCONST(0.0), I);
+ m_OP1.set(-beta, NL_FCONST(0.0));
+
+ m_ON.set(-beta, NL_FCONST(0.0), -I);
+ m_ON1.set(beta, NL_FCONST(0.0));
+ //printf("vi %f beta %f I %f\n", vi, beta, I);
+
+}
+
+// ----------------------------------------------------------------------------------------
// nld_CCCS
// ----------------------------------------------------------------------------------------
@@ -119,8 +172,8 @@ NETLIB_START(VCVS)
m_OP2.m_otherterm = &m_ON2;
m_ON2.m_otherterm = &m_OP2;
- connect(m_OP2, m_OP1);
- connect(m_ON2, m_ON1);
+ connect_late(m_OP2, m_OP1);
+ connect_late(m_ON2, m_ON1);
}
NETLIB_RESET(VCVS)
@@ -135,3 +188,5 @@ NETLIB_RESET(VCVS)
NETLIB_UPDATE_PARAM(VCVS)
{
}
+
+NETLIB_NAMESPACE_DEVICES_END()
diff --git a/src/emu/netlist/analog/nld_fourterm.h b/src/emu/netlist/analog/nld_fourterm.h
index 13584babef5..7ed6965a393 100644
--- a/src/emu/netlist/analog/nld_fourterm.h
+++ b/src/emu/netlist/analog/nld_fourterm.h
@@ -16,15 +16,19 @@
// Macros
// ----------------------------------------------------------------------------------------
-#define VCCS(_name) \
+#define VCCS(_name) \
NET_REGISTER_DEV(VCCS, _name)
-#define CCCS(_name) \
+#define CCCS(_name) \
NET_REGISTER_DEV(CCCS, _name)
-#define VCVS(_name) \
+#define VCVS(_name) \
NET_REGISTER_DEV(VCVS, _name)
+#define LVCCS(_name) \
+ NET_REGISTER_DEV(LVCCS, _name)
+
+NETLIB_NAMESPACE_DEVICES_START()
// ----------------------------------------------------------------------------------------
// nld_VCCS
@@ -47,37 +51,59 @@
*
*/
-class NETLIB_NAME(VCCS) : public netlist_device_t
+class NETLIB_NAME(VCCS) : public device_t
{
public:
ATTR_COLD NETLIB_NAME(VCCS)()
- : netlist_device_t(VCCS), m_gfac(1.0) { }
+ : device_t(VCCS), m_gfac(1.0) { }
ATTR_COLD NETLIB_NAME(VCCS)(const family_t afamily)
- : netlist_device_t(afamily), m_gfac(1.0) { }
+ : device_t(afamily), m_gfac(1.0) { }
+
+ param_double_t m_G;
+ param_double_t m_RI;
protected:
- /* ATTR_COLD */ virtual void start();
- /* ATTR_COLD */ virtual void reset();
- /* ATTR_COLD */ virtual void update_param();
- ATTR_HOT void update();
+ virtual void start();
+ virtual void reset();
+ virtual void update_param();
+ ATTR_HOT virtual void update();
ATTR_COLD void start_internal(const nl_double def_RI);
- netlist_terminal_t m_OP;
- netlist_terminal_t m_ON;
-
- netlist_terminal_t m_IP;
- netlist_terminal_t m_IN;
+ terminal_t m_OP;
+ terminal_t m_ON;
- netlist_terminal_t m_OP1;
- netlist_terminal_t m_ON1;
+ terminal_t m_IP;
+ terminal_t m_IN;
- netlist_param_double_t m_G;
- netlist_param_double_t m_RI;
+ terminal_t m_OP1;
+ terminal_t m_ON1;
nl_double m_gfac;
};
+/* Limited Current source*/
+
+class NETLIB_NAME(LVCCS) : public NETLIB_NAME(VCCS)
+{
+public:
+ ATTR_COLD NETLIB_NAME(LVCCS)()
+ : NETLIB_NAME(VCCS)(LVCCS), m_vi(0.0) { }
+ ATTR_COLD NETLIB_NAME(LVCCS)(const family_t afamily)
+ : NETLIB_NAME(VCCS)(afamily), m_vi(0.0) { }
+
+ param_double_t m_cur_limit; /* current limit */
+
+protected:
+ virtual void start();
+ virtual void reset();
+ virtual void update_param();
+ ATTR_HOT virtual void update();
+ NETLIB_UPDATE_TERMINALSI();
+
+ nl_double m_vi;
+};
+
// ----------------------------------------------------------------------------------------
// nld_CCCS
// ----------------------------------------------------------------------------------------
@@ -97,9 +123,7 @@ protected:
*
* RI = 1
*
- * FIXME: This needs extremely high levels of accuracy to work
- * With the current default of 1mv we can only measure
- * currents of 1mA.
+ * This needs high levels of accuracy to work with 1 Ohm RI.
*
*/
@@ -108,13 +132,11 @@ class NETLIB_NAME(CCCS) : public NETLIB_NAME(VCCS)
public:
ATTR_COLD NETLIB_NAME(CCCS)()
: NETLIB_NAME(VCCS)(CCCS), m_gfac(1.0) { }
- //ATTR_COLD NETLIB_NAME(CCCS)(const family_t afamily)
- //: netlist_device_t(afamily), m_gfac(1.0) { }
protected:
- /* ATTR_COLD */ virtual void start();
- /* ATTR_COLD */ virtual void reset();
- /* ATTR_COLD */ virtual void update_param();
+ virtual void start();
+ virtual void reset();
+ virtual void update_param();
ATTR_HOT void update();
nl_double m_gfac;
@@ -155,17 +177,20 @@ public:
ATTR_COLD NETLIB_NAME(VCVS)()
: NETLIB_NAME(VCCS)(VCVS) { }
+ param_double_t m_RO;
+
protected:
- /* ATTR_COLD */ virtual void start();
- /* ATTR_COLD */ virtual void reset();
- /* ATTR_COLD */ virtual void update_param();
+ virtual void start();
+ virtual void reset();
+ virtual void update_param();
//ATTR_HOT void update();
- netlist_terminal_t m_OP2;
- netlist_terminal_t m_ON2;
+ terminal_t m_OP2;
+ terminal_t m_ON2;
- netlist_param_double_t m_RO;
};
+NETLIB_NAMESPACE_DEVICES_END()
+
#endif /* NLD_FOURTERM_H_ */
diff --git a/src/emu/netlist/analog/nld_ms_jakobi.h b/src/emu/netlist/analog/nld_ms_jakobi.h
deleted file mode 100644
index 9376e54c9ef..00000000000
--- a/src/emu/netlist/analog/nld_ms_jakobi.h
+++ /dev/null
@@ -1,362 +0,0 @@
-// license:GPL-2.0+
-// copyright-holders:Couriersud
-/*
- * nld_ms_direct1.h
- *
- */
-
-#ifndef NLD_MS_GAUSS_SEIDEL_H_
-#define NLD_MS_GAUSS_SEIDEL_H_
-
-#include "nld_solver.h"
-#include "nld_ms_direct.h"
-
-template <int m_N, int _storage_N>
-class netlist_matrix_solver_SOR_t: public netlist_matrix_solver_direct_t<m_N, _storage_N>
-{
-public:
-
- netlist_matrix_solver_SOR_t(const netlist_solver_parameters_t &params, int size)
- : netlist_matrix_solver_direct_t<m_N, _storage_N>(netlist_matrix_solver_t::GAUSS_SEIDEL, params, size)
- , m_lp_fact(0)
- , m_gs_fail(0)
- , m_gs_total(0)
- {
- const char *p = osd_getenv("NL_STATS");
- if (p != NULL)
- m_log_stats = (bool) atoi(p);
- else
- m_log_stats = false;
- }
-
- virtual ~netlist_matrix_solver_SOR_t() {}
-
- /* ATTR_COLD */ virtual void log_stats();
-
- ATTR_HOT inline int vsolve_non_dynamic();
-protected:
- ATTR_HOT virtual nl_double vsolve();
-
-private:
- nl_double m_lp_fact;
- int m_gs_fail;
- int m_gs_total;
- bool m_log_stats;
-
-};
-
-// ----------------------------------------------------------------------------------------
-// netlist_matrix_solver - Gauss - Seidel
-// ----------------------------------------------------------------------------------------
-
-template <int m_N, int _storage_N>
-void netlist_matrix_solver_SOR_t<m_N, _storage_N>::log_stats()
-{
- if (this->m_stat_calculations != 0 && m_log_stats)
- {
- printf("==============================================\n");
- printf("Solver %s\n", this->name().cstr());
- printf(" ==> %d nets\n", this->N()); //, (*(*groups[i].first())->m_core_terms.first())->name().cstr());
- printf(" has %s elements\n", this->is_dynamic() ? "dynamic" : "no dynamic");
- printf(" has %s elements\n", this->is_timestep() ? "timestep" : "no timestep");
- printf(" %6.3f average newton raphson loops\n", (double) this->m_stat_newton_raphson / (double) this->m_stat_vsolver_calls);
- printf(" %10d invocations (%6d Hz) %10d gs fails (%6.2f%%) %6.3f average\n",
- this->m_stat_calculations,
- this->m_stat_calculations * 10 / (int) (this->netlist().time().as_double() * 10.0),
- this->m_gs_fail,
- 100.0 * (double) this->m_gs_fail / (double) this->m_stat_calculations,
- (double) this->m_gs_total / (double) this->m_stat_calculations);
- }
-}
-
-template <int m_N, int _storage_N>
-ATTR_HOT nl_double netlist_matrix_solver_SOR_t<m_N, _storage_N>::vsolve()
-{
- /*
- * enable linear prediction on first newton pass
- */
-
- if (USE_LINEAR_PREDICTION)
- for (int k = 0; k < this->N(); k++)
- {
- this->m_last_V[k] = this->m_nets[k]->m_cur_Analog;
- this->m_nets[k]->m_cur_Analog = this->m_nets[k]->m_cur_Analog + this->m_Vdelta[k] * this->current_timestep() * m_lp_fact;
- }
- else
- for (int k = 0; k < this->N(); k++)
- {
- this->m_last_V[k] = this->m_nets[k]->m_cur_Analog;
- }
-
- this->solve_base(this);
-
- if (USE_LINEAR_PREDICTION)
- {
- nl_double sq = 0;
- nl_double sqo = 0;
- const nl_double rez_cts = 1.0 / this->current_timestep();
- for (int k = 0; k < this->N(); k++)
- {
- const netlist_analog_net_t *n = this->m_nets[k];
- const nl_double nv = (n->m_cur_Analog - this->m_last_V[k]) * rez_cts ;
- sq += nv * nv;
- sqo += this->m_Vdelta[k] * this->m_Vdelta[k];
- this->m_Vdelta[k] = nv;
- }
- if (sqo > 1e-90)
- m_lp_fact = std::min(nl_math::sqrt(sq/sqo), 2.0);
- else
- m_lp_fact = 0.0;
- }
-
-
- return this->compute_next_timestep();
-}
-
-template <int m_N, int _storage_N>
-ATTR_HOT inline int netlist_matrix_solver_SOR_t<m_N, _storage_N>::vsolve_non_dynamic()
-{
- /* The matrix based code looks a lot nicer but actually is 30% slower than
- * the optimized code which works directly on the data structures.
- * Need something like that for gaussian elimination as well.
- */
-
-#if 0 || USE_MATRIX_GS
- static nl_double ws = 1.0;
- ATTR_ALIGN nl_double new_v[_storage_N] = { 0.0 };
- const int iN = this->N();
-
- bool resched = false;
-
- int resched_cnt = 0;
-
- this->build_LE();
-
- {
- nl_double frob;
- frob = 0;
- nl_double rmin = 1e99, rmax = -1e99;
- for (int k = 0; k < iN; k++)
- {
- new_v[k] = this->m_nets[k]->m_cur_Analog;
- nl_double s=0.0;
- for (int i = 0; i < iN; i++)
- {
- frob += this->m_A[k][i] * this->m_A[k][i];
- s = s + nl_math::abs(this->m_A[k][i]);
- }
-
- if (s<rmin)
- rmin = s;
- if (s>rmax)
- rmax = s;
- }
-#if 0
- nl_double frobA = nl_math::sqrt(frob /(iN));
- if (1 &&frobA < 1.0)
- //ws = 2.0 / (1.0 + nl_math::sqrt(1.0-frobA));
- ws = 2.0 / (2.0 - frobA);
- else
- ws = 1.0;
- ws = 0.9;
-#else
- // calculate an estimate for rho.
- // This is based on the Perron???Frobenius theorem for positive matrices.
- // No mathematical proof here. The following estimates the
- // optimal relaxation parameter pretty well. Unfortunately, the
- // overhead is bigger than the gain. Consequently the fast GS below
- // uses a fixed GS. One can however use this here to determine a
- // suitable parameter.
- nl_double rm = (rmax + rmin) * 0.5;
- if (rm < 1.0)
- ws = 2.0 / (1.0 + nl_math::sqrt(1.0-rm));
- else
- ws = 1.0;
- if (ws > 1.02 && rmax > 1.001)
- printf("rmin %f rmax %f ws %f\n", rmin, rmax, ws);
-#endif
- }
-
- // Frobenius norm for (D-L)^(-1)U
- //nl_double frobU;
- //nl_double frobL;
- //nl_double norm;
- do {
- resched = false;
- nl_double cerr = 0.0;
- //frobU = 0;
- //frobL = 0;
- //norm = 0;
-
- for (int k = 0; k < iN; k++)
- {
- nl_double Idrive = 0;
- //nl_double norm_t = 0;
- // Reduction loops need -ffast-math
- for (int i = 0; i < iN; i++)
- Idrive += this->m_A[k][i] * new_v[i];
-
- for (int i = 0; i < iN; i++)
- {
- //if (i < k) frobL += this->m_A[k][i] * this->m_A[k][i] / this->m_A[k][k] /this-> m_A[k][k];
- //if (i > k) frobU += this->m_A[k][i] * this->m_A[k][i] / this->m_A[k][k] / this->m_A[k][k];
- //norm_t += nl_math::abs(this->m_A[k][i]);
- }
-
- //if (norm_t > norm) norm = norm_t;
- const nl_double new_val = (1.0-ws) * new_v[k] + ws * (this->m_RHS[k] - Idrive + this->m_A[k][k] * new_v[k]) / this->m_A[k][k];
-
- const nl_double e = nl_math::abs(new_val - new_v[k]);
- cerr = (e > cerr ? e : cerr);
- new_v[k] = new_val;
- }
-
- if (cerr > this->m_params.m_accuracy)
- {
- resched = true;
- }
- resched_cnt++;
- //ATTR_UNUSED nl_double frobUL = nl_math::sqrt((frobU + frobL) / (double) (iN) / (double) (iN));
- } while (resched && (resched_cnt < this->m_params.m_gs_loops));
- //printf("Frobenius %f %f %f %f %f\n", nl_math::sqrt(frobU), nl_math::sqrt(frobL), frobUL, frobA, norm);
- //printf("Omega Estimate1 %f %f\n", 2.0 / (1.0 + nl_math::sqrt(1-frobUL)), 2.0 / (1.0 + nl_math::sqrt(1-frobA)) ); // printf("Frobenius %f\n", sqrt(frob / (double) (iN * iN) ));
- //printf("Omega Estimate2 %f %f\n", 2.0 / (2.0 - frobUL), 2.0 / (2.0 - frobA) ); // printf("Frobenius %f\n", sqrt(frob / (double) (iN * iN) ));
-
-
- this->store(new_v, false);
-
- this->m_gs_total += resched_cnt;
- if (resched)
- {
- //this->netlist().warning("Falling back to direct solver .. Consider increasing RESCHED_LOOPS");
- this->m_gs_fail++;
- int tmp = netlist_matrix_solver_direct_t<m_N, _storage_N>::solve_non_dynamic();
- this->m_calculations++;
- return tmp;
- }
- else {
- this->m_calculations++;
-
- return resched_cnt;
- }
-
-#else
- const int iN = this->N();
- bool resched = false;
- int resched_cnt = 0;
-
- /* ideally, we could get an estimate for the spectral radius of
- * Inv(D - L) * U
- *
- * and estimate using
- *
- * omega = 2.0 / (1.0 + nl_math::sqrt(1-rho))
- */
-
- const nl_double ws = this->m_params.m_sor; //1.045; //2.0 / (1.0 + /*sin*/(3.14159 * 5.5 / (double) (m_nets.count()+1)));
- //const nl_double ws = 2.0 / (1.0 + sin(3.14159 * 4 / (double) (this->N())));
-
- ATTR_ALIGN nl_double w[_storage_N];
- ATTR_ALIGN nl_double one_m_w[_storage_N];
- ATTR_ALIGN nl_double RHS[_storage_N];
- ATTR_ALIGN nl_double new_V[_storage_N];
- ATTR_ALIGN nl_double old_V[_storage_N];
-
- for (int k = 0; k < iN; k++)
- {
- nl_double gtot_t = 0.0;
- nl_double gabs_t = 0.0;
- nl_double RHS_t = 0.0;
-
- new_V[k] = this->m_nets[k]->m_cur_Analog;
-
- {
- const int term_count = this->m_terms[k]->count();
- const nl_double * const RESTRICT gt = this->m_terms[k]->gt();
- const nl_double * const RESTRICT go = this->m_terms[k]->go();
- const nl_double * const RESTRICT Idr = this->m_terms[k]->Idr();
- const nl_double * const *other_cur_analog = this->m_terms[k]->other_curanalog();
-
- for (int i = 0; i < term_count; i++)
- {
- gtot_t = gtot_t + gt[i];
- RHS_t = RHS_t + Idr[i];
- }
- if (USE_GABS)
- for (int i = 0; i < term_count; i++)
- gabs_t = gabs_t + nl_math::abs(go[i]);
-
- for (int i = this->m_terms[k]->m_railstart; i < term_count; i++)
- RHS_t = RHS_t + go[i] * *other_cur_analog[i];
- }
-
- RHS[k] = RHS_t;
-
- //if (nl_math::abs(gabs_t - nl_math::abs(gtot_t)) > 1e-20)
- // printf("%d %e abs: %f tot: %f\n",k, gabs_t / gtot_t -1.0, gabs_t, gtot_t);
-
- gabs_t *= 0.95; // avoid rounding issues
- if (!USE_GABS || gabs_t <= gtot_t)
- {
- w[k] = ws / gtot_t;
- one_m_w[k] = 1.0 - ws;
- }
- else
- {
- //printf("abs: %f tot: %f\n", gabs_t, gtot_t);
- w[k] = 1.0 / (gtot_t + gabs_t);
- one_m_w[k] = 1.0 - 1.0 * gtot_t / (gtot_t + gabs_t);
- }
-
- }
-
- const nl_double accuracy = this->m_params.m_accuracy;
-
- for (int k = 0; k < iN; k++)
- old_V[k] = this->m_nets[k]->m_cur_Analog;
- do {
- resched = false;
-
- for (int k = 0; k < iN; k++)
- {
- const int * RESTRICT net_other = this->m_terms[k]->net_other();
- const int railstart = this->m_terms[k]->m_railstart;
- const nl_double * RESTRICT go = this->m_terms[k]->go();
-
- nl_double Idrive = 0.0;
- for (int i = 0; i < railstart; i++)
- //Idrive = Idrive + go[i] * new_V[net_other[i]];
- Idrive = Idrive + go[i] * old_V[net_other[i]];
-
- //const nl_double new_val = new_V[k] * one_m_w[k] + (Idrive + RHS[k]) * w[k];
- //resched = resched || (nl_math::abs(new_val - new_V[k]) > accuracy);
- const nl_double new_val = old_V[k] * one_m_w[k] + (Idrive + RHS[k]) * w[k];
- resched = resched || (nl_math::abs(new_val - old_V[k]) > accuracy);
- new_V[k] = new_val;
- }
- for (int k = 0; k < iN; k++)
- old_V[k] = new_V[k];
-
- resched_cnt++;
- } while (resched && (resched_cnt < this->m_params.m_gs_loops));
-
- for (int k = 0; k < iN; k++)
- this->m_nets[k]->m_cur_Analog = new_V[k];
-
- this->m_gs_total += resched_cnt;
- this->m_stat_calculations++;
-
- if (resched)
- {
- //this->netlist().warning("Falling back to direct solver .. Consider increasing RESCHED_LOOPS");
- this->m_gs_fail++;
- return netlist_matrix_solver_direct_t<m_N, _storage_N>::vsolve_non_dynamic();
- }
- else {
- return resched_cnt;
- }
-#endif
-}
-
-
-#endif /* NLD_MS_GAUSS_SEIDEL_H_ */
diff --git a/src/emu/netlist/analog/nld_ms_sor.h b/src/emu/netlist/analog/nld_ms_sor.h
deleted file mode 100644
index 25799dbb1e6..00000000000
--- a/src/emu/netlist/analog/nld_ms_sor.h
+++ /dev/null
@@ -1,202 +0,0 @@
-// license:GPL-2.0+
-// copyright-holders:Couriersud
-/*
- * nld_ms_sor.h
- *
- * Generic successive over relaxation solver.
- *
- * Fow w==1 we will do the classic Gauss-Seidel approach
- *
- */
-
-#ifndef NLD_MS_SOR_H_
-#define NLD_MS_SOR_H_
-
-#include "nld_solver.h"
-#include "nld_ms_direct.h"
-
-template <unsigned m_N, unsigned _storage_N>
-class netlist_matrix_solver_SOR_t: public netlist_matrix_solver_direct_t<m_N, _storage_N>
-{
-public:
-
- netlist_matrix_solver_SOR_t(const netlist_solver_parameters_t &params, int size)
- : netlist_matrix_solver_direct_t<m_N, _storage_N>(netlist_matrix_solver_t::GAUSS_SEIDEL, params, size)
- , m_lp_fact(0)
- , m_gs_fail(0)
- , m_gs_total(0)
- {
- }
-
- virtual ~netlist_matrix_solver_SOR_t() {}
-
- /* ATTR_COLD */ virtual void log_stats();
-
- ATTR_HOT virtual int vsolve_non_dynamic(const bool newton_raphson);
-protected:
- ATTR_HOT virtual nl_double vsolve();
-
-private:
- nl_double m_lp_fact;
- int m_gs_fail;
- int m_gs_total;
-};
-
-// ----------------------------------------------------------------------------------------
-// netlist_matrix_solver - Gauss - Seidel
-// ----------------------------------------------------------------------------------------
-
-template <unsigned m_N, unsigned _storage_N>
-void netlist_matrix_solver_SOR_t<m_N, _storage_N>::log_stats()
-{
- if (this->m_stat_calculations != 0 && this->m_params.m_log_stats)
- {
- this->netlist().log("==============================================");
- this->netlist().log("Solver %s", this->name().cstr());
- this->netlist().log(" ==> %d nets", this->N()); //, (*(*groups[i].first())->m_core_terms.first())->name().cstr());
- this->netlist().log(" has %s elements", this->is_dynamic() ? "dynamic" : "no dynamic");
- this->netlist().log(" has %s elements", this->is_timestep() ? "timestep" : "no timestep");
- this->netlist().log(" %6.3f average newton raphson loops", (double) this->m_stat_newton_raphson / (double) this->m_stat_vsolver_calls);
- this->netlist().log(" %10d invocations (%6d Hz) %10d gs fails (%6.2f%%) %6.3f average",
- this->m_stat_calculations,
- this->m_stat_calculations * 10 / (int) (this->netlist().time().as_double() * 10.0),
- this->m_gs_fail,
- 100.0 * (double) this->m_gs_fail / (double) this->m_stat_calculations,
- (double) this->m_gs_total / (double) this->m_stat_calculations);
- }
-}
-
-template <unsigned m_N, unsigned _storage_N>
-ATTR_HOT nl_double netlist_matrix_solver_SOR_t<m_N, _storage_N>::vsolve()
-{
- this->solve_base(this);
- return this->compute_next_timestep();
-}
-
-template <unsigned m_N, unsigned _storage_N>
-ATTR_HOT inline int netlist_matrix_solver_SOR_t<m_N, _storage_N>::vsolve_non_dynamic(const bool newton_raphson)
-{
- const int iN = this->N();
- bool resched = false;
- int resched_cnt = 0;
-
- /* ideally, we could get an estimate for the spectral radius of
- * Inv(D - L) * U
- *
- * and estimate using
- *
- * omega = 2.0 / (1.0 + nl_math::sqrt(1-rho))
- */
-
- const nl_double ws = this->m_params.m_sor; //1.045; //2.0 / (1.0 + /*sin*/(3.14159 * 5.5 / (double) (m_nets.count()+1)));
- //const nl_double ws = 2.0 / (1.0 + sin(3.14159 * 4 / (double) (this->N())));
-
- ATTR_ALIGN nl_double w[_storage_N];
- ATTR_ALIGN nl_double one_m_w[_storage_N];
- ATTR_ALIGN nl_double RHS[_storage_N];
- ATTR_ALIGN nl_double new_V[_storage_N];
-
- for (int k = 0; k < iN; k++)
- {
- nl_double gtot_t = 0.0;
- nl_double gabs_t = 0.0;
- nl_double RHS_t = 0.0;
-
- new_V[k] = this->m_nets[k]->m_cur_Analog;
-
- {
- const int term_count = this->m_terms[k]->count();
- const nl_double * const RESTRICT gt = this->m_terms[k]->gt();
- const nl_double * const RESTRICT go = this->m_terms[k]->go();
- const nl_double * const RESTRICT Idr = this->m_terms[k]->Idr();
- const nl_double * const *other_cur_analog = this->m_terms[k]->other_curanalog();
-
- for (int i = 0; i < term_count; i++)
- {
- gtot_t = gtot_t + gt[i];
- RHS_t = RHS_t + Idr[i];
- }
-
- if (USE_GABS)
- for (int i = 0; i < term_count; i++)
- gabs_t = gabs_t + nl_math::abs(go[i]);
-
- for (int i = this->m_terms[k]->m_railstart; i < term_count; i++)
- RHS_t = RHS_t + go[i] * *other_cur_analog[i];
- }
-
- RHS[k] = RHS_t;
-
- if (USE_GABS)
- {
- gabs_t *= NL_FCONST(0.95); // avoid rounding issues
- if (gabs_t <= gtot_t)
- {
- w[k] = ws / gtot_t;
- one_m_w[k] = NL_FCONST(1.0) - ws;
- }
- else
- {
- w[k] = NL_FCONST(1.0) / (gtot_t + gabs_t);
- one_m_w[k] = NL_FCONST(1.0) - NL_FCONST(1.0) * gtot_t / (gtot_t + gabs_t);
- }
- }
- else
- {
- w[k] = ws / gtot_t;
- one_m_w[k] = NL_FCONST(1.0) - ws;
- }
- }
-
- const nl_double accuracy = this->m_params.m_accuracy;
-
- do {
- resched = false;
-
- for (int k = 0; k < iN; k++)
- {
- const int * RESTRICT net_other = this->m_terms[k]->net_other();
- const int railstart = this->m_terms[k]->m_railstart;
- const nl_double * RESTRICT go = this->m_terms[k]->go();
-
- nl_double Idrive = 0.0;
- for (int i = 0; i < railstart; i++)
- Idrive = Idrive + go[i] * new_V[net_other[i]];
-
- const nl_double new_val = new_V[k] * one_m_w[k] + (Idrive + RHS[k]) * w[k];
-
- resched = resched || (nl_math::abs(new_val - new_V[k]) > accuracy);
- new_V[k] = new_val;
- }
-
- resched_cnt++;
- } while (resched && (resched_cnt < this->m_params.m_gs_loops));
-
- if (newton_raphson)
- {
- //printf("here %s\n", this->name().cstr());
- for (int k = 0; k < iN; k++)
- this->m_nets[k]->m_cur_Analog += 1.0 * (new_V[k] - this->m_nets[k]->m_cur_Analog);
- }
- else
- {
- for (int k = 0; k < iN; k++)
- this->m_nets[k]->m_cur_Analog = new_V[k];
- }
-
- this->m_gs_total += resched_cnt;
- this->m_stat_calculations++;
-
- if (resched)
- {
- // Fallback to direct solver ...
- this->m_gs_fail++;
- return netlist_matrix_solver_direct_t<m_N, _storage_N>::vsolve_non_dynamic(newton_raphson);
- }
- else {
- return resched_cnt;
- }
-}
-
-
-#endif /* NLD_MS_SOR_H_ */
diff --git a/src/emu/netlist/analog/nld_ms_sor_mat.h b/src/emu/netlist/analog/nld_ms_sor_mat.h
deleted file mode 100644
index 9c5a29382f1..00000000000
--- a/src/emu/netlist/analog/nld_ms_sor_mat.h
+++ /dev/null
@@ -1,305 +0,0 @@
-// license:GPL-2.0+
-// copyright-holders:Couriersud
-/*
- * nld_ms_sor.h
- *
- * Generic successive over relaxation solver.
- *
- * Fow w==1 we will do the classic Gauss-Seidel approach
- *
- */
-
-#ifndef NLD_MS_SOR_MAT_H_
-#define NLD_MS_SOR_MAT_H_
-
-#include "nld_solver.h"
-#include "nld_ms_direct.h"
-
-template <unsigned m_N, unsigned _storage_N>
-class netlist_matrix_solver_SOR_mat_t: public netlist_matrix_solver_direct_t<m_N, _storage_N>
-{
-public:
-
- netlist_matrix_solver_SOR_mat_t(const netlist_solver_parameters_t &params, int size)
- : netlist_matrix_solver_direct_t<m_N, _storage_N>(netlist_matrix_solver_t::GAUSS_SEIDEL, params, size)
- , m_omega(params.m_sor)
- , m_lp_fact(0)
- , m_gs_fail(0)
- , m_gs_total(0)
- {
- pstring p = nl_util::environment("NETLIST_STATS");
- if (p != "")
- m_log_stats = (bool) p.as_long();
- else
- m_log_stats = false;
- }
-
- virtual ~netlist_matrix_solver_SOR_mat_t() {}
-
- /* ATTR_COLD */ virtual void log_stats();
-
- ATTR_HOT inline int vsolve_non_dynamic(const bool newton_raphson);
-protected:
- ATTR_HOT virtual nl_double vsolve();
-
-private:
- nl_double m_Vdelta[_storage_N];
-
- nl_double m_omega;
- nl_double m_lp_fact;
- int m_gs_fail;
- int m_gs_total;
- bool m_log_stats;
-
-};
-
-// ----------------------------------------------------------------------------------------
-// netlist_matrix_solver - Gauss - Seidel
-// ----------------------------------------------------------------------------------------
-
-template <unsigned m_N, unsigned _storage_N>
-void netlist_matrix_solver_SOR_mat_t<m_N, _storage_N>::log_stats()
-{
- if (this->m_stat_calculations != 0 && m_log_stats)
- {
- this->netlist().log("==============================================\n");
- this->netlist().log("Solver %s\n", this->name().cstr());
- this->netlist().log(" ==> %d nets\n", this->N()); //, (*(*groups[i].first())->m_core_terms.first())->name().cstr());
- this->netlist().log(" has %s elements\n", this->is_dynamic() ? "dynamic" : "no dynamic");
- this->netlist().log(" has %s elements\n", this->is_timestep() ? "timestep" : "no timestep");
- this->netlist().log(" %6.3f average newton raphson loops\n", (double) this->m_stat_newton_raphson / (double) this->m_stat_vsolver_calls);
- this->netlist().log(" %10d invocations (%6d Hz) %10d gs fails (%6.2f%%) %6.3f average\n",
- this->m_stat_calculations,
- this->m_stat_calculations * 10 / (int) (this->netlist().time().as_double() * 10.0),
- this->m_gs_fail,
- 100.0 * (double) this->m_gs_fail / (double) this->m_stat_calculations,
- (double) this->m_gs_total / (double) this->m_stat_calculations);
- }
-}
-
-template <unsigned m_N, unsigned _storage_N>
-ATTR_HOT nl_double netlist_matrix_solver_SOR_mat_t<m_N, _storage_N>::vsolve()
-{
- /*
- * enable linear prediction on first newton pass
- */
-
- if (USE_LINEAR_PREDICTION)
- for (unsigned k = 0; k < this->N(); k++)
- {
- this->m_last_V[k] = this->m_nets[k]->m_cur_Analog;
- this->m_nets[k]->m_cur_Analog = this->m_nets[k]->m_cur_Analog + this->m_Vdelta[k] * this->current_timestep() * m_lp_fact;
- }
- else
- for (unsigned k = 0; k < this->N(); k++)
- {
- this->m_last_V[k] = this->m_nets[k]->m_cur_Analog;
- }
-
- this->solve_base(this);
-
- if (USE_LINEAR_PREDICTION)
- {
- nl_double sq = 0;
- nl_double sqo = 0;
- const nl_double rez_cts = 1.0 / this->current_timestep();
- for (unsigned k = 0; k < this->N(); k++)
- {
- const netlist_analog_net_t *n = this->m_nets[k];
- const nl_double nv = (n->m_cur_Analog - this->m_last_V[k]) * rez_cts ;
- sq += nv * nv;
- sqo += this->m_Vdelta[k] * this->m_Vdelta[k];
- this->m_Vdelta[k] = nv;
- }
-
- // FIXME: used to be 1e90, but this would not be compatible with float
- if (sqo > NL_FCONST(1e-20))
- m_lp_fact = std::min(nl_math::sqrt(sq/sqo), (nl_double) 2.0);
- else
- m_lp_fact = NL_FCONST(0.0);
- }
-
-
- return this->compute_next_timestep();
-}
-
-template <unsigned m_N, unsigned _storage_N>
-ATTR_HOT inline int netlist_matrix_solver_SOR_mat_t<m_N, _storage_N>::vsolve_non_dynamic(const bool newton_raphson)
-{
- /* The matrix based code looks a lot nicer but actually is 30% slower than
- * the optimized code which works directly on the data structures.
- * Need something like that for gaussian elimination as well.
- */
-
-
- ATTR_ALIGN nl_double new_v[_storage_N] = { 0.0 };
- const int iN = this->N();
-
- bool resched = false;
-
- int resched_cnt = 0;
-
- this->build_LE_A();
- this->build_LE_RHS();
-
-#if 1
-#if 0
- static int ws_cnt = 0;
- ws_cnt++;
- if (0 && ws_cnt % 100 == 0)
- {
- // update omega
- nl_double lambdaN = 0;
- nl_double lambda1 = 1e9;
- for (int k = 0; k < iN; k++)
- {
- #if 0
- nl_double akk = nl_math::abs(this->m_A[k][k]);
- if ( akk > lambdaN)
- lambdaN = akk;
- if (akk < lambda1)
- lambda1 = akk;
- #else
- nl_double akk = nl_math::abs(this->m_A[k][k]);
- nl_double s = 0.0;
- for (int i=0; i<iN; i++)
- s = s + nl_math::abs(this->m_A[k][i]);
- akk = s / akk - 1.0;
- //if ( akk > lambdaN)
- // lambdaN = akk;
- if (akk < lambda1)
- lambda1 = akk;
- #endif
- }
- //printf("lambda: %f %f\n", lambda, 2.0 / (1.0 + 2 * sqrt(lambda)) );
-
- //ws = 2.0 / (2.0 - lambdaN - lambda1);
- m_omega = 2.0 / (2.0 - lambda1);
- //printf("%f\n", ws);
- }
-#endif
-
- for (int k = 0; k < iN; k++)
- new_v[k] = this->m_nets[k]->m_cur_Analog;
-
-#else
- {
- nl_double frob;
- frob = 0;
- nl_double rmin = 1e99, rmax = -1e99;
- for (int k = 0; k < iN; k++)
- {
- new_v[k] = this->m_nets[k]->m_cur_Analog;
- nl_double s=0.0;
- for (int i = 0; i < iN; i++)
- {
- frob += this->m_A[k][i] * this->m_A[k][i];
- s = s + nl_math::abs(this->m_A[k][i]);
- }
-
- if (s<rmin)
- rmin = s;
- if (s>rmax)
- rmax = s;
- }
-#if 0
- nl_double frobA = nl_math::sqrt(frob /(iN));
- if (1 &&frobA < 1.0)
- //ws = 2.0 / (1.0 + nl_math::sqrt(1.0-frobA));
- ws = 2.0 / (2.0 - frobA);
- else
- ws = 1.0;
- ws = 0.9;
-#else
- // calculate an estimate for rho.
- // This is based on the Perron???Frobenius theorem for positive matrices.
- // No mathematical proof here. The following estimates the
- // optimal relaxation parameter pretty well. Unfortunately, the
- // overhead is bigger than the gain. Consequently the fast GS below
- // uses a fixed GS. One can however use this here to determine a
- // suitable parameter.
- nl_double rm = (rmax + rmin) * 0.5;
- if (rm < 1.0)
- ws = 2.0 / (1.0 + nl_math::sqrt(1.0-rm));
- else
- ws = 1.0;
- if (ws > 1.02 && rmax > 1.001)
- printf("rmin %f rmax %f ws %f\n", rmin, rmax, ws);
-#endif
- }
-#endif
- // Frobenius norm for (D-L)^(-1)U
- //nl_double frobU;
- //nl_double frobL;
- //nl_double norm;
- do {
- resched = false;
- nl_double cerr = 0.0;
- //frobU = 0;
- //frobL = 0;
- //norm = 0;
-
- for (int k = 0; k < iN; k++)
- {
- nl_double Idrive = 0;
- //nl_double norm_t = 0;
- // Reduction loops need -ffast-math
- for (int i = 0; i < iN; i++)
- Idrive += this->m_A[k][i] * new_v[i];
-
-#if 0
- for (int i = 0; i < iN; i++)
- {
- if (i < k) frobL += this->m_A[k][i] * this->m_A[k][i] / this->m_A[k][k] /this-> m_A[k][k];
- if (i > k) frobU += this->m_A[k][i] * this->m_A[k][i] / this->m_A[k][k] / this->m_A[k][k];
- norm_t += nl_math::abs(this->m_A[k][i]);
- }
-#endif
- //if (norm_t > norm) norm = norm_t;
-#if 0
- const nl_double new_val = (1.0-ws) * new_v[k] + ws * (this->m_RHS[k] - Idrive + this->m_A[k][k] * new_v[k]) / this->m_A[k][k];
-
- const nl_double e = nl_math::abs(new_val - new_v[k]);
- cerr = (e > cerr ? e : cerr);
- new_v[k] = new_val;
-#else
- const nl_double delta = m_omega * (this->m_RHS[k] - Idrive) / this->m_A[k][k];
- const nl_double adelta = nl_math::abs(delta);
- cerr = (adelta > cerr ? adelta : cerr);
- new_v[k] += delta;
-#endif
- }
-
- if (cerr > this->m_params.m_accuracy)
- {
- resched = true;
- }
- resched_cnt++;
- //ATTR_UNUSED nl_double frobUL = nl_math::sqrt((frobU + frobL) / (double) (iN) / (double) (iN));
- } while (resched && (resched_cnt < this->m_params.m_gs_loops));
- //printf("Frobenius %f %f %f %f %f\n", nl_math::sqrt(frobU), nl_math::sqrt(frobL), frobUL, frobA, norm);
- //printf("Omega Estimate1 %f %f\n", 2.0 / (1.0 + nl_math::sqrt(1-frobUL)), 2.0 / (1.0 + nl_math::sqrt(1-frobA)) ); // printf("Frobenius %f\n", sqrt(frob / (double) (iN * iN) ));
- //printf("Omega Estimate2 %f %f\n", 2.0 / (2.0 - frobUL), 2.0 / (2.0 - frobA) ); // printf("Frobenius %f\n", sqrt(frob / (double) (iN * iN) ));
-
-
- this->store(new_v, false);
- this->m_gs_total += resched_cnt;
- if (resched)
- {
- //this->netlist().warning("Falling back to direct solver .. Consider increasing RESCHED_LOOPS");
- this->m_gs_fail++;
-
- this->LE_solve();
- this->m_stat_calculations++;
- return netlist_matrix_solver_direct_t<m_N, _storage_N>::solve_non_dynamic(newton_raphson);
- }
- else {
- this->m_stat_calculations++;
-
- return resched_cnt;
- }
-
-}
-
-
-#endif /* NLD_MS_GAUSS_SEIDEL_H_ */
diff --git a/src/emu/netlist/analog/nld_opamps.c b/src/emu/netlist/analog/nld_opamps.c
index 7e88aece9bb..b20989f9645 100644
--- a/src/emu/netlist/analog/nld_opamps.c
+++ b/src/emu/netlist/analog/nld_opamps.c
@@ -37,3 +37,121 @@ NETLIST_START(opamp_lm3900)
PARAM(G1.RO, RES_K(8))
NETLIST_END()
+
+NETLIB_NAMESPACE_DEVICES_START()
+
+/*
+ * Type = 0: Impedance changer
+ * 1; Ideal opamp
+ * 2; opamp with first pole
+ * 3: opamp with first pole + output limit
+ * 4: opamp with input stage, first pole + output limit
+ */
+
+NETLIB_START(OPAMP)
+{
+ register_sub("RP1", m_RP);
+ register_sub("CP1", m_CP);
+ register_sub("G1", m_G1);
+ register_sub("EBUF", m_EBUF);
+ register_sub("DN", m_DN);
+ register_sub("DP", m_DP);
+
+ register_input("VCC", m_VCC);
+ register_input("GND", m_GND);
+
+ register_output("VL", m_VL);
+ register_output("VH", m_VH);
+ register_output("VREF", m_VREF);
+
+ register_param("model", m_model, "");
+
+ m_type = m_model.model_value("TYPE");
+
+ if (m_type == 3)
+ {
+ register_subalias("PLUS", "G1.IP");
+ register_subalias("MINUS", "G1.IN");
+ register_subalias("OUT", "EBUF.OP");
+
+ connect_late("EBUF.ON", "VREF");
+
+ connect_late("G1.ON", "VREF");
+ connect_late("RP1.2", "VREF");
+ connect_late("CP1.2", "VREF");
+ connect_late("EBUF.IN", "VREF");
+
+ connect_late("RP1.1", "G1.OP");
+ connect_late("CP1.1", "RP1.1");
+
+ connect_late("DP.K", "VH");
+ connect_late("VL", "DN.A");
+ connect_late("DP.A", "DN.K");
+ connect_late("DN.K", "RP1.1");
+ connect_late("EBUF.IP", "RP1.1");
+ }
+ else
+ netlist().error("Unknown opamp type: %d", m_type);
+}
+
+/* .model abc OPAMP(VLH=2.0 VLL=0.2 FPF=5 UGF=10k SLEW=0.6u RI=1000k RO=50 DAB=0.002)
+ *
+ * Differential Amp Bias ~ op amp's total quiescent current.
+ * */
+
+NETLIB_UPDATE(OPAMP)
+{
+ const double cVt = 0.0258 * 1.0; // * m_n;
+ const double cId = m_model.model_value("DAB"); // 3 mA
+ const double cVd = cVt * nl_math::log(cId / 1e-15 + 1.0);
+ m_VH.set_Q(INPANALOG(m_VCC) - m_model.model_value("VLH") - cVd);
+ m_VL.set_Q(INPANALOG(m_GND) + m_model.model_value("VLL") + cVd);
+ m_VREF.set_Q((INPANALOG(m_VCC) + INPANALOG(m_GND)) / 2.0);
+}
+
+NETLIB_RESET(OPAMP)
+{
+ m_EBUF.do_reset();
+ m_G1.do_reset();
+ m_DP.do_reset();
+ m_DN.do_reset();
+ m_CP.do_reset();
+ m_RP.do_reset();
+
+ m_EBUF.m_G.setTo(1.0);
+ m_G1.m_RI.setTo(m_model.model_value("RI"));
+ m_EBUF.m_RO.setTo(m_model.model_value("RO"));
+ m_DP.m_model.setTo(".model tt D(IS=1e-15 N=1)");
+ m_DN.m_model.setTo(".model tt D(IS=1e-15 N=1)");
+
+ double CP = m_model.model_value("DAB") / m_model.model_value("SLEW");
+ double RP = 0.5 / 3.1459 / CP / m_model.model_value("FPF");
+ double G = m_model.model_value("UGF") / m_model.model_value("FPF") / RP;
+
+ //printf("CP=%e RP=%f G=%f\n", CP, RP, G);
+ m_CP.m_C.setTo(CP);
+ m_RP.set_R(RP);
+ m_G1.m_G.setTo(G);
+
+}
+
+NETLIB_UPDATE_PARAM(OPAMP)
+{
+}
+
+/*
+NETLIB_DEVICE_WITH_PARAMS(OPAMPx,
+ NETLIB_NAME(R) m_RP;
+ NETLIB_NAME(C) m_CP;
+ NETLIB_NAME(VCCS) m_G1;
+ NETLIB_NAME(VCVS) m_EBUF;
+
+ param_model_t m_model;
+ analog_input_t m_VH;
+ analog_input_t m_VL;
+ analog_input_t m_VREF;
+);
+*/
+
+NETLIB_NAMESPACE_DEVICES_END()
+
diff --git a/src/emu/netlist/analog/nld_opamps.h b/src/emu/netlist/analog/nld_opamps.h
index 4433114a18c..f870c58b465 100644
--- a/src/emu/netlist/analog/nld_opamps.h
+++ b/src/emu/netlist/analog/nld_opamps.h
@@ -5,7 +5,7 @@
*
*/
-#pragma once
+//#pragma once
#ifndef NLD_OPAMPS_H_
#define NLD_OPAMPS_H_
@@ -13,20 +13,47 @@
#include "../nl_base.h"
#include "../nl_setup.h"
#include "nld_twoterm.h"
+#include "nld_fourterm.h"
// ----------------------------------------------------------------------------------------
// Macros
// ----------------------------------------------------------------------------------------
+#define OPAMP(_name, _model) \
+ NET_REGISTER_DEV(OPAMP, _name) \
+ NETDEV_PARAMI(_name, model, _model)
+
#define LM3900(_name) \
- SUBMODEL(_name, opamp_lm3900)
+ SUBMODEL(opamp_lm3900, _name)
// ----------------------------------------------------------------------------------------
// Devices ...
// ----------------------------------------------------------------------------------------
-NETLIST_EXTERNAL(opamp_lm3900);
+NETLIST_EXTERNAL(opamp_lm3900)
+
+NETLIB_NAMESPACE_DEVICES_START()
+
+NETLIB_DEVICE_WITH_PARAMS(OPAMP,
+ NETLIB_NAME(R) m_RP;
+ NETLIB_NAME(C) m_CP;
+ NETLIB_NAME(VCCS) m_G1;
+ NETLIB_NAME(VCVS) m_EBUF;
+ NETLIB_NAME(D) m_DP;
+ NETLIB_NAME(D) m_DN;
+
+ analog_input_t m_VCC;
+ analog_input_t m_GND;
+
+ param_model_t m_model;
+ analog_output_t m_VH;
+ analog_output_t m_VL;
+ analog_output_t m_VREF;
+ /* state */
+ unsigned m_type;
+);
+NETLIB_NAMESPACE_DEVICES_END()
#endif /* NLD_OPAMPS_H_ */
diff --git a/src/emu/netlist/analog/nld_switches.c b/src/emu/netlist/analog/nld_switches.c
index ab53c4dcc48..cf5dcd09c4b 100644
--- a/src/emu/netlist/analog/nld_switches.c
+++ b/src/emu/netlist/analog/nld_switches.c
@@ -11,6 +11,8 @@
#define R_OFF (1.0 / netlist().gmin())
#define R_ON 0.01
+NETLIB_NAMESPACE_DEVICES_START()
+
// ----------------------------------------------------------------------------------------
// SWITCH
// ----------------------------------------------------------------------------------------
@@ -63,7 +65,7 @@ NETLIB_START(switch2)
register_param("POS", m_POS, 0);
- connect(m_R[0].m_N, m_R[1].m_N);
+ connect_late(m_R[0].m_N, m_R[1].m_N);
register_subalias("1", m_R[0].m_P);
register_subalias("2", m_R[1].m_P);
@@ -101,3 +103,5 @@ NETLIB_UPDATE_PARAM(switch2)
{
update();
}
+
+NETLIB_NAMESPACE_DEVICES_END()
diff --git a/src/emu/netlist/analog/nld_switches.h b/src/emu/netlist/analog/nld_switches.h
index 0465eea44ce..79dc989c948 100644
--- a/src/emu/netlist/analog/nld_switches.h
+++ b/src/emu/netlist/analog/nld_switches.h
@@ -18,27 +18,29 @@
// ----------------------------------------------------------------------------------------
#define SWITCH(_name) \
- NET_REGISTER_DEV(switch1, _name)
+ NET_REGISTER_DEV(SWITCH, _name)
#define SWITCH2(_name) \
- NET_REGISTER_DEV(switch2, _name)
+ NET_REGISTER_DEV(SWITCH2, _name)
// ----------------------------------------------------------------------------------------
// Devices ...
// ----------------------------------------------------------------------------------------
+NETLIB_NAMESPACE_DEVICES_START()
+
NETLIB_DEVICE_WITH_PARAMS(switch1,
NETLIB_NAME(R_base) m_R;
- netlist_param_int_t m_POS;
+ param_int_t m_POS;
);
NETLIB_DEVICE_WITH_PARAMS(switch2,
NETLIB_NAME(R_base) m_R[2];
- netlist_param_int_t m_POS;
+ param_int_t m_POS;
);
-
+NETLIB_NAMESPACE_DEVICES_END()
#endif /* NLD_SWITCHES_H_ */
diff --git a/src/emu/netlist/analog/nld_twoterm.c b/src/emu/netlist/analog/nld_twoterm.c
index 02ec7fa9c29..1a99dcaf90a 100644
--- a/src/emu/netlist/analog/nld_twoterm.c
+++ b/src/emu/netlist/analog/nld_twoterm.c
@@ -5,22 +5,26 @@
*
*/
+#include <solver/nld_solver.h>
+#include <algorithm>
+
#include "nld_twoterm.h"
-#include "nld_solver.h"
+
+NETLIB_NAMESPACE_DEVICES_START()
// ----------------------------------------------------------------------------------------
-// netlist_generic_diode
+// generic_diode
// ----------------------------------------------------------------------------------------
-ATTR_COLD netlist_generic_diode::netlist_generic_diode()
+ATTR_COLD generic_diode::generic_diode()
{
m_Vd = 0.7;
set_param(1e-15, 1, 1e-15);
}
-ATTR_COLD void netlist_generic_diode::set_param(const nl_double Is, const nl_double n, nl_double gmin)
+ATTR_COLD void generic_diode::set_param(const nl_double Is, const nl_double n, nl_double gmin)
{
- static const int csqrt2 = nl_math::sqrt(2.0);
+ static const double csqrt2 = nl_math::sqrt(2.0);
m_Is = Is;
m_n = n;
m_gmin = gmin;
@@ -31,7 +35,7 @@ ATTR_COLD void netlist_generic_diode::set_param(const nl_double Is, const nl_dou
m_VtInv = 1.0 / m_Vt;
}
-ATTR_COLD void netlist_generic_diode::save(pstring name, netlist_object_t &parent)
+ATTR_COLD void generic_diode::save(pstring name, object_t &parent)
{
parent.save(m_Vd, name + ".m_Vd");
parent.save(m_Id, name + ".m_Id");
@@ -43,14 +47,14 @@ ATTR_COLD void netlist_generic_diode::save(pstring name, netlist_object_t &paren
// ----------------------------------------------------------------------------------------
ATTR_COLD NETLIB_NAME(twoterm)::NETLIB_NAME(twoterm)(const family_t afamily)
- : netlist_device_t(afamily)
+ : device_t(afamily)
{
m_P.m_otherterm = &m_N;
m_N.m_otherterm = &m_P;
}
ATTR_COLD NETLIB_NAME(twoterm)::NETLIB_NAME(twoterm)()
- : netlist_device_t(TWOTERM)
+ : device_t(TWOTERM)
{
m_P.m_otherterm = &m_N;
m_N.m_otherterm = &m_P;
@@ -115,10 +119,6 @@ NETLIB_UPDATE(R)
NETLIB_UPDATE_PARAM(R)
{
- //printf("updating %s to %f\n", name().cstr(), m_R.Value());
-
- // FIXME: Only attached nets should be brought up to current time
- //netlist().solver()->update_to_current_time(); // bring up current time
update_dev();
if (m_R.Value() > 1e-9)
set_R(m_R.Value());
@@ -139,7 +139,7 @@ NETLIB_START(POT)
register_subalias("2", m_R1.m_N);
register_subalias("3", m_R2.m_N);
- connect(m_R2.m_P, m_R1.m_N);
+ connect_late(m_R2.m_P, m_R1.m_N);
register_param("R", m_R, 1.0 / netlist().gmin());
register_param("DIAL", m_Dial, 0.5);
@@ -165,9 +165,6 @@ NETLIB_UPDATE_PARAM(POT)
if (m_DialIsLog.Value())
v = (nl_math::exp(v) - 1.0) / (nl_math::exp(1.0) - 1.0);
- // FIXME: Only attached nets should be brought up to current time
- //netlist().solver()->update_to_current_time(); // bring up current time
-
m_R1.update_dev();
m_R2.update_dev();
@@ -213,9 +210,6 @@ NETLIB_UPDATE_PARAM(POT2)
if (m_Reverse.Value())
v = 1.0 - v;
- // FIXME: Only attached nets should be brought up to current time
- //netlist().solver()->update_to_current_time(); // bring up current time
-
m_R1.update_dev();
m_R1.set_R(std::max(m_R.Value() * v, netlist().gmin()));
@@ -246,6 +240,7 @@ NETLIB_RESET(C)
NETLIB_UPDATE_PARAM(C)
{
//step_time(1.0/48000.0);
+ m_GParallel = netlist().gmin() * m_C.Value();
}
NETLIB_UPDATE(C)
@@ -253,6 +248,14 @@ NETLIB_UPDATE(C)
NETLIB_NAME(twoterm)::update();
}
+ATTR_HOT void NETLIB_NAME(C)::step_time(const nl_double st)
+{
+ /* Gpar should support convergence */
+ const nl_double G = m_C.Value() / st + m_GParallel;
+ const nl_double I = -G * deltaV();
+ set(G, 0.0, I);
+}
+
// ----------------------------------------------------------------------------------------
// nld_D
// ----------------------------------------------------------------------------------------
@@ -286,3 +289,57 @@ NETLIB_UPDATE_TERMINALS(D)
m_D.update_diode(deltaV());
set(m_D.G(), 0.0, m_D.Ieq());
}
+
+// ----------------------------------------------------------------------------------------
+// nld_VS
+// ----------------------------------------------------------------------------------------
+
+NETLIB_START(VS)
+{
+ NETLIB_NAME(twoterm)::start();
+
+ register_param("R", m_R, 0.1);
+ register_param("V", m_V, 0.0);
+
+ register_terminal("P", m_P);
+ register_terminal("N", m_N);
+}
+
+NETLIB_RESET(VS)
+{
+ NETLIB_NAME(twoterm)::reset();
+ this->set(1.0 / m_R, m_V, 0.0);
+}
+
+NETLIB_UPDATE(VS)
+{
+ NETLIB_NAME(twoterm)::update();
+}
+
+// ----------------------------------------------------------------------------------------
+// nld_CS
+// ----------------------------------------------------------------------------------------
+
+NETLIB_START(CS)
+{
+ NETLIB_NAME(twoterm)::start();
+
+ register_param("I", m_I, 1.0);
+
+ register_terminal("P", m_P);
+ register_terminal("N", m_N);
+}
+
+NETLIB_RESET(CS)
+{
+ NETLIB_NAME(twoterm)::reset();
+ printf("m_I %f\n", m_I.Value());
+ this->set(0.0, 0.0, m_I);
+}
+
+NETLIB_UPDATE(CS)
+{
+ NETLIB_NAME(twoterm)::update();
+}
+
+NETLIB_NAMESPACE_DEVICES_END()
diff --git a/src/emu/netlist/analog/nld_twoterm.h b/src/emu/netlist/analog/nld_twoterm.h
index fed3b148db5..c6714d62d45 100644
--- a/src/emu/netlist/analog/nld_twoterm.h
+++ b/src/emu/netlist/analog/nld_twoterm.h
@@ -40,35 +40,44 @@
// ----------------------------------------------------------------------------------------
#define RES(_name, _R) \
- NET_REGISTER_DEV(R, _name) \
+ NET_REGISTER_DEV(RES, _name) \
NETDEV_PARAMI(_name, R, _R)
-#define POT(_name, _R) \
- NET_REGISTER_DEV(POT, _name) \
+#define POT(_name, _R) \
+ NET_REGISTER_DEV(POT, _name) \
NETDEV_PARAMI(_name, R, _R)
/* Does not have pin 3 connected */
-#define POT2(_name, _R) \
- NET_REGISTER_DEV(POT2, _name) \
+#define POT2(_name, _R) \
+ NET_REGISTER_DEV(POT2, _name) \
NETDEV_PARAMI(_name, R, _R)
#define CAP(_name, _C) \
- NET_REGISTER_DEV(C, _name) \
+ NET_REGISTER_DEV(CAP, _name) \
NETDEV_PARAMI(_name, C, _C)
/* Generic Diode */
-#define DIODE(_name, _model) \
- NET_REGISTER_DEV(D, _name) \
+#define DIODE(_name, _model) \
+ NET_REGISTER_DEV(DIODE, _name) \
NETDEV_PARAMI(_name, model, _model)
+#define VS(_name, _V) \
+ NET_REGISTER_DEV(VS, _name) \
+ NETDEV_PARAMI(_name, V, _V)
+
+#define CS(_name, _I) \
+ NET_REGISTER_DEV(CS, _name) \
+ NETDEV_PARAMI(_name, I, _I)
+
// ----------------------------------------------------------------------------------------
// Generic macros
// ----------------------------------------------------------------------------------------
#ifdef RES_R
-#warning "Do not include rescap.h in a netlist environment"
+// FIXME: avoid compile fails
+// #warning "Do not include rescap.h in a netlist environment"
#endif
#define RES_R(res) ((double)(res))
@@ -85,31 +94,33 @@
// Implementation
// ----------------------------------------------------------------------------------------
+NETLIB_NAMESPACE_DEVICES_START()
+
// ----------------------------------------------------------------------------------------
// nld_twoterm
// ----------------------------------------------------------------------------------------
-class NETLIB_NAME(twoterm) : public netlist_device_t
+class NETLIB_NAME(twoterm) : public device_t
{
public:
ATTR_COLD NETLIB_NAME(twoterm)(const family_t afamily);
ATTR_COLD NETLIB_NAME(twoterm)();
- netlist_terminal_t m_P;
- netlist_terminal_t m_N;
+ terminal_t m_P;
+ terminal_t m_N;
virtual NETLIB_UPDATE_TERMINALSI()
{
}
- ATTR_HOT inline void set(const nl_double G, const nl_double V, const nl_double I)
+ ATTR_HOT /* inline */ void set(const nl_double G, const nl_double V, const nl_double I)
{
/* GO, GT, I */
m_P.set( G, G, ( V) * G - I);
m_N.set( G, G, ( -V) * G + I);
}
- ATTR_HOT inline nl_double deltaV() const
+ ATTR_HOT /* inline */ nl_double deltaV() const
{
return m_P.net().as_analog().Q_Analog() - m_N.net().as_analog().Q_Analog();
}
@@ -122,8 +133,8 @@ public:
}
protected:
- /* ATTR_COLD */ virtual void start();
- /* ATTR_COLD */ virtual void reset();
+ virtual void start();
+ virtual void reset();
ATTR_HOT void update();
private:
@@ -144,13 +155,13 @@ public:
}
protected:
- /* ATTR_COLD */ virtual void start();
- /* ATTR_COLD */ virtual void reset();
+ virtual void start();
+ virtual void reset();
ATTR_HOT void update();
};
NETLIB_DEVICE_WITH_PARAMS_DERIVED(R, R_base,
- netlist_param_double_t m_R;
+ param_double_t m_R;
);
// ----------------------------------------------------------------------------------------
@@ -161,18 +172,18 @@ NETLIB_DEVICE_WITH_PARAMS(POT,
NETLIB_NAME(R_base) m_R1;
NETLIB_NAME(R_base) m_R2;
- netlist_param_double_t m_R;
- netlist_param_double_t m_Dial;
- netlist_param_logic_t m_DialIsLog;
+ param_double_t m_R;
+ param_double_t m_Dial;
+ param_logic_t m_DialIsLog;
);
NETLIB_DEVICE_WITH_PARAMS(POT2,
NETLIB_NAME(R_base) m_R1;
- netlist_param_double_t m_R;
- netlist_param_double_t m_Dial;
- netlist_param_logic_t m_DialIsLog;
- netlist_param_logic_t m_Reverse;
+ param_double_t m_R;
+ param_double_t m_Dial;
+ param_logic_t m_DialIsLog;
+ param_logic_t m_Reverse;
);
@@ -183,22 +194,20 @@ NETLIB_DEVICE_WITH_PARAMS(POT2,
class NETLIB_NAME(C) : public NETLIB_NAME(twoterm)
{
public:
- ATTR_COLD NETLIB_NAME(C)() : NETLIB_NAME(twoterm)(CAPACITOR) { }
+ ATTR_COLD NETLIB_NAME(C)() : NETLIB_NAME(twoterm)(CAPACITOR), m_GParallel(0.0) { }
- ATTR_HOT void step_time(const nl_double st)
- {
- const nl_double G = m_C.Value() / st;
- const nl_double I = -G * deltaV();
- set(G, 0.0, I);
- }
+ ATTR_HOT void step_time(const nl_double st);
+
+ param_double_t m_C;
protected:
- /* ATTR_COLD */ virtual void start();
- /* ATTR_COLD */ virtual void reset();
- /* ATTR_COLD */ virtual void update_param();
+ virtual void start();
+ virtual void reset();
+ virtual void update_param();
ATTR_HOT void update();
- netlist_param_double_t m_C;
+private:
+ nl_double m_GParallel;
};
@@ -207,15 +216,14 @@ protected:
// A generic diode model to be used in other devices (Diode, BJT ...)
// ----------------------------------------------------------------------------------------
-class netlist_generic_diode
+class generic_diode
{
public:
- ATTR_COLD netlist_generic_diode();
+ ATTR_COLD generic_diode();
ATTR_HOT inline void update_diode(const nl_double nVd)
{
- //FIXME: Optimize cutoff case
-
+#if 1
if (nVd < NL_FCONST(-5.0) * m_Vt)
{
m_Vd = nVd;
@@ -225,24 +233,31 @@ public:
else if (nVd < m_Vcrit)
{
m_Vd = nVd;
-
+ //m_Vd = m_Vd + 10.0 * m_Vt * std::tanh((nVd - m_Vd) / 10.0 / m_Vt);
const nl_double eVDVt = nl_math::exp(m_Vd * m_VtInv);
m_Id = m_Is * (eVDVt - NL_FCONST(1.0));
m_G = m_Is * m_VtInv * eVDVt + m_gmin;
}
else
{
- nl_double a = (nVd - m_Vd) * m_VtInv;
- if (a < NL_FCONST(1e-12) - NL_FCONST(1.0)) a = NL_FCONST(1e-12) - NL_FCONST(1.0);
+#if 1
+ const nl_double a = std::max((nVd - m_Vd) * m_VtInv, NL_FCONST(0.5) - NL_FCONST(1.0));
m_Vd = m_Vd + nl_math::e_log1p(a) * m_Vt;
-
+#else
+ m_Vd = m_Vd + 10.0 * m_Vt * std::tanh((nVd - m_Vd) / 10.0 / m_Vt);
+#endif
const nl_double eVDVt = nl_math::exp(m_Vd * m_VtInv);
m_Id = m_Is * (eVDVt - NL_FCONST(1.0));
m_G = m_Is * m_VtInv * eVDVt + m_gmin;
}
-
- //printf("nVd %f m_Vd %f Vcrit %f\n", nVd, m_Vd, m_Vcrit);
+#else
+ m_Vd = m_Vd + 20.0 * m_Vt * std::tanh((nVd - m_Vd) / 20.0 / m_Vt);
+ const nl_double eVDVt = nl_math::exp(m_Vd * m_VtInv);
+ m_Id = m_Is * (eVDVt - NL_FCONST(1.0));
+ m_G = m_Is * m_VtInv * eVDVt + m_gmin;
+#endif
+ //printf("%p nVd %f m_Vd %f Vcrit %f\n", this, nVd, m_Vd, m_Vcrit);
}
ATTR_COLD void set_param(const nl_double Is, const nl_double n, nl_double gmin);
@@ -254,7 +269,7 @@ public:
/* owning object must save those ... */
- ATTR_COLD void save(pstring name, netlist_object_t &parent);
+ ATTR_COLD void save(pstring name, object_t &parent);
private:
nl_double m_Vd;
@@ -281,16 +296,54 @@ public:
NETLIB_UPDATE_TERMINALSI();
+ param_model_t m_model;
+
protected:
- /* ATTR_COLD */ virtual void start();
- /* ATTR_COLD */ virtual void update_param();
+ virtual void start();
+ virtual void update_param();
ATTR_HOT void update();
- netlist_param_model_t m_model;
+ generic_diode m_D;
+};
+
+// ----------------------------------------------------------------------------------------
+// nld_VS - Voltage source
+//
+// netlist voltage source must have inner resistance
+// ----------------------------------------------------------------------------------------
+
+class NETLIB_NAME(VS) : public NETLIB_NAME(twoterm)
+{
+public:
+ ATTR_COLD NETLIB_NAME(VS)() : NETLIB_NAME(twoterm)(VS) { }
+
+protected:
+ virtual void start();
+ virtual void reset();
+ ATTR_HOT void update();
+
+ param_double_t m_R;
+ param_double_t m_V;
+};
+
+// ----------------------------------------------------------------------------------------
+// nld_CS - Current source
+// ----------------------------------------------------------------------------------------
+
+class NETLIB_NAME(CS) : public NETLIB_NAME(twoterm)
+{
+public:
+ ATTR_COLD NETLIB_NAME(CS)() : NETLIB_NAME(twoterm)(CS) { }
+
+protected:
+ virtual void start();
+ virtual void reset();
+ ATTR_HOT void update();
- netlist_generic_diode m_D;
+ param_double_t m_I;
};
+NETLIB_NAMESPACE_DEVICES_END()
#endif /* NLD_TWOTERM_H_ */
diff --git a/src/emu/netlist/devices/net_lib.c b/src/emu/netlist/devices/net_lib.c
index f239beb1069..02a004453da 100644
--- a/src/emu/netlist/devices/net_lib.c
+++ b/src/emu/netlist/devices/net_lib.c
@@ -14,26 +14,36 @@
NETLIST_START(diode_models)
NET_MODEL(".model 1N914 D(Is=2.52n Rs=.568 N=1.752 Cjo=4p M=.4 tt=20n Iave=200m Vpk=75 mfg=OnSemi type=silicon)")
+ NET_MODEL(".model 1N4001 D(Is=14.11n N=1.984 Rs=33.89m Ikf=94.81 Xti=3 Eg=1.11 Cjo=25.89p M=.44 Vj=.3245 Fc=.5 Bv=75 Ibv=10u Tt=5.7u Iave=1 Vpk=50 mfg=GI type=silicon)")
NET_MODEL(".model 1N4148 D(Is=2.52n Rs=.568 N=1.752 Cjo=4p M=.4 tt=20n Iave=200m Vpk=75 mfg=OnSemi type=silicon)")
+ NET_MODEL(".model 1S1588 D(Is=2.52n Rs=.568 N=1.752 Cjo=4p M=.4 tt=20n Iave=200m Vpk=75)")
NET_MODEL(".model LedRed D(IS=93.2p RS=42M N=3.73 BV=4 IBV=10U CJO=2.97P VJ=.75 M=.333 TT=4.32U Iave=40m Vpk=4 type=LED)")
NET_MODEL(".model LedGreen D(IS=93.2p RS=42M N=4.61 BV=4 IBV=10U CJO=2.97P VJ=.75 M=.333 TT=4.32U Iave=40m Vpk=4 type=LED)")
NET_MODEL(".model LedBlue D(IS=93.2p RS=42M N=7.47 BV=5 IBV=10U CJO=2.97P VJ=.75 M=.333 TT=4.32U Iave=40m Vpk=5 type=LED)")
NET_MODEL(".model LedWhite D(Is=0.27n Rs=5.65 N=6.79 Cjo=42p Iave=30m Vpk=5 type=LED)")
- NET_MODEL(".model 1N4001 D(Is=14.11n N=1.984 Rs=33.89m Ikf=94.81 Xti=3 Eg=1.11 Cjo=25.89p M=.44 Vj=.3245 Fc=.5 Bv=75 Ibv=10u Tt=5.7u Iave=1 Vpk=50 mfg=GI type=silicon)")
+
NETLIST_END()
NETLIST_START(bjt_models)
- NET_MODEL(".model BC237B NPN(IS=1.8E-14 ISE=5.0E-14 ISC=1.72E-13 XTI=3 BF=400 BR=35.5 IKF=0.14 IKR=0.03 XTB=1.5 VAF=80 VAR=12.5 VJE=0.58 VJC=0.54 RE=0.6 RC=0.25 RB=0.56 CJE=13E-12 CJC=4E-12 XCJC=0.75 FC=0.5 NF=0.9955 NR=1.005 NE=1.46 NC=1.27 MJE=0.33 MJC=0.33 TF=0.64E-9 TR=50.72E-9 EG=1.11 KF=0 AF=1 VCEO=45V ICRATING=100M MFG=ZETEX)")
- NET_MODEL(".model BC556B PNP(IS=3.83E-14 NF=1.008 ISE=1.22E-14 NE=1.528 BF=344.4 IKF=0.08039 VAF=21.11 NR=1.005 ISC=2.85E-13 NC=1.28 BR=14.84 IKR=0.047 VAR=32.02 RB=1 IRB=1.00E-06 RBM=1 RE=0.6202 RC=0.5713 XTB=0 EG=1.11 XTI=3 CJE=1.23E-11 VJE=0.6106 MJE=0.378 TF=5.60E-10 XTF=3.414 VTF=5.23 ITF=0.1483 PTF=0 CJC=1.08E-11 VJC=0.1022 MJC=0.3563 XCJC=0.6288 TR=1.00E-32 CJS=0 VJS=0.75 MJS=0.333 FC=0.8027 Vceo=65 Icrating=100m mfg=Philips)")
NET_MODEL(".model 2SA1015 PNP(Is=295.1E-18 Xti=3 Eg=1.11 Vaf=100 Bf=110 Xtb=1.5 Br=10.45 Rc=15 Cjc=66.2p Mjc=1.054 Vjc=.75 Fc=.5 Cje=5p Mje=.3333 Vje=.75 Tr=10n Tf=1.661n VCEO=45V ICrating=150M MFG=Toshiba)")
NET_MODEL(".model 2SC1815 NPN(Is=2.04f Xti=3 Eg=1.11 Vaf=6 Bf=400 Ikf=20m Xtb=1.5 Br=3.377 Rc=1 Cjc=1p Mjc=.3333 Vjc=.75 Fc=.5 Cje=25p Mje=.3333 Vje=.75 Tr=450n Tf=20n Itf=0 Vtf=0 Xtf=0 VCEO=45V ICrating=150M MFG=Toshiba)")
+
NET_MODEL(".model 2N3643 NPN(IS=14.34E-15 ISE=14.34E-15 ISC=0 XTI=3 BF=255.9 BR=6.092 IKF=0.2847 IKR=0 XTB=1.5 VAF=74.03 VAR=28 VJE=0.65 VJC=0.65 RE=0.1 RC=1 RB=10 CJE=22.01E-12 CJC=7.306E-12 XCJC=0.75 FC=0.5 NF=1 NR=1 NE=1.307 NC=2 MJE=0.377 MJC=0.3416 TF=411.1E-12 TR=46.91E-9 ITF=0.6 VTF=1.7 XTF=3 EG=1.11 KF=0 AF=1 VCEO=30 ICRATING=500m MFG=NSC)")
NET_MODEL(".model 2N3645 PNP(IS=650.6E-18 ISE=54.81E-15 ISC=0 XTI=3 BF=231.7 BR=3.563 IKF=1.079 IKR=0 XTB=1.5 VAF=115.7 VAR=35 VJE=0.65 VJC=0.65 RE=0.15 RC=0.715 RB=10 CJE=19.82E-12 CJC=14.76E-12 XCJC=0.75 FC=0.5 NF=1 NR=1 NE=1.829 NC=2 MJE=0.3357 MJC=0.5383 TF=603.7E-12 TR=111.3E-9 ITF=0.65 VTF=5 XTF=1.7 EG=1.11 KF=0 AF=1 VCEO=60 ICRATING=500m MFG=NSC)")
// 3644 = 3645 Difference between 3644 and 3645 is voltage rating. 3644: VCBO=45, 3645: VCBO=60
NET_MODEL(".model 2N3644 PNP(IS=650.6E-18 ISE=54.81E-15 ISC=0 XTI=3 BF=231.7 BR=3.563 IKF=1.079 IKR=0 XTB=1.5 VAF=115.7 VAR=35 VJE=0.65 VJC=0.65 RE=0.15 RC=0.715 RB=10 CJE=19.82E-12 CJC=14.76E-12 XCJC=0.75 FC=0.5 NF=1 NR=1 NE=1.829 NC=2 MJE=0.3357 MJC=0.5383 TF=603.7E-12 TR=111.3E-9 ITF=0.65 VTF=5 XTF=1.7 EG=1.11 KF=0 AF=1 VCEO=60 ICRATING=500m MFG=NSC)")
- NET_MODEL(".model BC817-25 NPN(IS=9.198E-14 NF=1.003 ISE=4.468E-16 NE=1.65 BF=338.8 IKF=0.4913 VAF=107.9 NR=1.002 ISC=5.109E-15 NC=1.071 BR=29.48 IKR=0.193 VAR=25 RB=1 IRB=1000 RBM=1 RE=0.2126 RC=0.143 XTB=0 EG=1.11 XTI=3 CJE=3.825E-11 VJE=0.7004 MJE=0.364 TF=5.229E-10 XTF=219.7 VTF=3.502 ITF=7.257 PTF=0 CJC=1.27E-11 VJC=0.4431 MJC=0.3983 XCJC=0.4555 TR=7E-11 CJS=0 VJS=0.75 MJS=0.333 FC=0.905 Vceo=45 Icrating=500m mfg=Philips)")
// 2N5190 = BC817-25
NET_MODEL(".model 2N5190 NPN(IS=9.198E-14 NF=1.003 ISE=4.468E-16 NE=1.65 BF=338.8 IKF=0.4913 VAF=107.9 NR=1.002 ISC=5.109E-15 NC=1.071 BR=29.48 IKR=0.193 VAR=25 RB=1 IRB=1000 RBM=1 RE=0.2126 RC=0.143 XTB=0 EG=1.11 XTI=3 CJE=3.825E-11 VJE=0.7004 MJE=0.364 TF=5.229E-10 XTF=219.7 VTF=3.502 ITF=7.257 PTF=0 CJC=1.27E-11 VJC=0.4431 MJC=0.3983 XCJC=0.4555 TR=7E-11 CJS=0 VJS=0.75 MJS=0.333 FC=0.905 Vceo=45 Icrating=500m mfg=Philips)")
+ NET_MODEL(".model 2SC945 NPN(IS=3.577E-14 BF=2.382E+02 NF=1.01 VAF=1.206E+02 IKF=3.332E-01 ISE=3.038E-16 NE=1.205 BR=1.289E+01 NR=1.015 VAR=1.533E+01 IKR=2.037E-01 ISC=3.972E-14 NC=1.115 RB=3.680E+01 IRB=1.004E-04 RBM=1 RE=8.338E-01 RC=1.557E+00 CJE=1.877E-11 VJE=7.211E-01 MJE=3.486E-01 TF=4.149E-10 XTF=1.000E+02 VTF=9.956 ITF=5.118E-01 PTF=0 CJC=6.876p VJC=3.645E-01 MJC=3.074E-01 TR=5.145E-08 XTB=1.5 EG=1.11 XTI=3 FC=0.5 Vceo=50 Icrating=100m MFG=NEC)")
+
+ NET_MODEL(".model BC237B NPN(IS=1.8E-14 ISE=5.0E-14 ISC=1.72E-13 XTI=3 BF=400 BR=35.5 IKF=0.14 IKR=0.03 XTB=1.5 VAF=80 VAR=12.5 VJE=0.58 VJC=0.54 RE=0.6 RC=0.25 RB=0.56 CJE=13E-12 CJC=4E-12 XCJC=0.75 FC=0.5 NF=0.9955 NR=1.005 NE=1.46 NC=1.27 MJE=0.33 MJC=0.33 TF=0.64E-9 TR=50.72E-9 EG=1.11 KF=0 AF=1 VCEO=45V ICRATING=100M MFG=ZETEX)")
+ NET_MODEL(".model BC556B PNP(IS=3.83E-14 NF=1.008 ISE=1.22E-14 NE=1.528 BF=344.4 IKF=0.08039 VAF=21.11 NR=1.005 ISC=2.85E-13 NC=1.28 BR=14.84 IKR=0.047 VAR=32.02 RB=1 IRB=1.00E-06 RBM=1 RE=0.6202 RC=0.5713 XTB=0 EG=1.11 XTI=3 CJE=1.23E-11 VJE=0.6106 MJE=0.378 TF=5.60E-10 XTF=3.414 VTF=5.23 ITF=0.1483 PTF=0 CJC=1.08E-11 VJC=0.1022 MJC=0.3563 XCJC=0.6288 TR=1.00E-32 CJS=0 VJS=0.75 MJS=0.333 FC=0.8027 Vceo=65 Icrating=100m mfg=Philips)")
+ NET_MODEL(".model BC817-25 NPN(IS=9.198E-14 NF=1.003 ISE=4.468E-16 NE=1.65 BF=338.8 IKF=0.4913 VAF=107.9 NR=1.002 ISC=5.109E-15 NC=1.071 BR=29.48 IKR=0.193 VAR=25 RB=1 IRB=1000 RBM=1 RE=0.2126 RC=0.143 XTB=0 EG=1.11 XTI=3 CJE=3.825E-11 VJE=0.7004 MJE=0.364 TF=5.229E-10 XTF=219.7 VTF=3.502 ITF=7.257 PTF=0 CJC=1.27E-11 VJC=0.4431 MJC=0.3983 XCJC=0.4555 TR=7E-11 CJS=0 VJS=0.75 MJS=0.333 FC=0.905 Vceo=45 Icrating=500m mfg=Philips)")
+NETLIST_END()
+
+NETLIST_START(family_models)
+ NET_MODEL(".model 74XXOC FAMILY(IVL=0.8 IVH=2.0 OVL=0.1 OVH=4.95 ORL=10.0 ORH=1.0e8)")
+ NET_MODEL(".model CD4XXX FAMILY(TYPE=CD4XXX)")
NETLIST_END()
@@ -41,21 +51,29 @@ NETLIST_END()
#define ENTRY1(_nic, _name, _defparam) factory.register_device<_nic>( # _name, xstr(_nic), _defparam );
#define ENTRY(_nic, _name, _defparam) ENTRY1(NETLIB_NAME(_nic), _name, _defparam)
-void nl_initialize_factory(netlist_factory_list_t &factory)
+NETLIB_NAMESPACE_DEVICES_START()
+
+void initialize_factory(factory_list_t &factory)
{
ENTRY(R, RES, "R")
ENTRY(POT, POT, "R")
ENTRY(POT2, POT2, "R")
ENTRY(C, CAP, "C")
ENTRY(D, DIODE, "model")
- ENTRY(VCVS, VCVS, "-") // FIXME: STD parameters ?
+ ENTRY(VCVS, VCVS, "-")
ENTRY(VCCS, VCCS, "-")
ENTRY(CCCS, CCCS, "-")
+ ENTRY(LVCCS, LVCCS, "-")
+ ENTRY(VS, VS, "V")
+ ENTRY(CS, CS, "I")
+ ENTRY(OPAMP, OPAMP, "model")
ENTRY(dummy_input, DUMMY_INPUT, "-")
- ENTRY(frontier, FRONTIER, "+I,Q")
+ ENTRY(frontier, FRONTIER_DEV, "+I,G,Q") // not intended to be used directly
+ ENTRY(function, AFUNC, "N,FUNC") // only for macro devices - NO FEEDBACK loops
ENTRY(QBJT_EB, QBJT_EB, "model")
ENTRY(QBJT_switch, QBJT_SW, "model")
- ENTRY(ttl_input, TTL_INPUT, "IN")
+ ENTRY(logic_input, TTL_INPUT, "IN")
+ ENTRY(logic_input, LOGIC_INPUT, "IN,FAMILY")
ENTRY(analog_input, ANALOG_INPUT, "IN")
ENTRY(log, LOG, "+I")
ENTRY(logD, LOGD, "+I,I2")
@@ -70,8 +88,6 @@ void nl_initialize_factory(netlist_factory_list_t &factory)
ENTRY(switch2, SWITCH2, "-")
ENTRY(nicRSFF, NETDEV_RSFF, "+S,R")
ENTRY(nicDelay, NETDEV_DELAY, "-")
- ENTRY(4020, CD_4020, "+IP,RESET,VDD,VSS")
- //ENTRY(4066, CD_4066, "+A,B")
ENTRY(7400, TTL_7400_NAND, "+A,B")
ENTRY(7402, TTL_7402_NOR, "+A,B")
ENTRY(7404, TTL_7404_INVERT, "+A")
@@ -104,11 +120,14 @@ void nl_initialize_factory(netlist_factory_list_t &factory)
ENTRY(9310, TTL_9310, "-")
ENTRY(9312, TTL_9312, "-")
ENTRY(9316, TTL_9316, "+CLK,ENP,ENT,CLRQ,LOADQ,A,B,C,D")
+ ENTRY(CD4020, CD4020, "")
+ ENTRY(CD4066_GATE, CD4066_GATE, "")
+ /* entries with suffix _WI are legacy only */
+ ENTRY(CD4020, CD4020_WI, "+IP,RESET,VDD,VSS")
+ //ENTRY(4066, CD_4066, "+A,B")
ENTRY(NE555, NE555, "-")
ENTRY(r2r_dac, R2R_DAC, "+VIN,R,N")
- ENTRY(4020_dip, CD_4020_DIP, "-")
- ENTRY(4016_dip, CD_4016_DIP, "-")
- ENTRY(4066_dip, CD_4066_DIP, "-")
+ ENTRY(4538_dip, CD4538_DIP, "-")
ENTRY(7400_dip, TTL_7400_DIP, "-")
ENTRY(7402_dip, TTL_7402_DIP, "-")
ENTRY(7404_dip, TTL_7404_DIP, "-")
@@ -142,4 +161,15 @@ void nl_initialize_factory(netlist_factory_list_t &factory)
ENTRY(9316_dip, TTL_9316_DIP, "-")
ENTRY(SN74LS629_dip, SN74LS629_DIP, "1.CAP1,2.CAP2")
ENTRY(NE555_dip, NE555_DIP, "-")
+ ENTRY(MM5837_dip, MM5837_DIP, "-")
+}
+
+NETLIB_NAMESPACE_DEVICES_END()
+
+namespace netlist
+{
+ void initialize_factory(factory_list_t &factory)
+ {
+ devices::initialize_factory(factory);
+ }
}
diff --git a/src/emu/netlist/devices/net_lib.h b/src/emu/netlist/devices/net_lib.h
index 1ae4336f62e..4f10aee0651 100644
--- a/src/emu/netlist/devices/net_lib.h
+++ b/src/emu/netlist/devices/net_lib.h
@@ -50,23 +50,31 @@
#include "nld_9316.h"
#include "nld_ne555.h"
+#include "nld_mm5837.h"
#include "nld_r2r_dac.h"
#include "nld_log.h"
+#include "../macro/nlm_cd4xxx.h"
+#include "../macro/nlm_ttl74xx.h"
+#include "../macro/nlm_opamp.h"
+
#include "../analog/nld_bjt.h"
#include "../analog/nld_fourterm.h"
-#include "../analog/nld_solver.h"
#include "../analog/nld_switches.h"
#include "../analog/nld_twoterm.h"
#include "../analog/nld_opamps.h"
+#include "../solver/nld_solver.h"
#include "nld_legacy.h"
-NETLIST_EXTERNAL(diode_models);
-NETLIST_EXTERNAL(bjt_models);
+NETLIST_EXTERNAL(diode_models)
+NETLIST_EXTERNAL(bjt_models)
+NETLIST_EXTERNAL(family_models)
-void nl_initialize_factory(netlist_factory_list_t &factory);
+namespace netlist {
+ void initialize_factory(netlist::factory_list_t &factory);
+}
#endif
diff --git a/src/emu/netlist/devices/nld_4020.c b/src/emu/netlist/devices/nld_4020.c
index f0e160de8d3..efb52d063b4 100644
--- a/src/emu/netlist/devices/nld_4020.c
+++ b/src/emu/netlist/devices/nld_4020.c
@@ -7,7 +7,9 @@
#include "nld_4020.h"
-NETLIB_START(4020)
+NETLIB_NAMESPACE_DEVICES_START()
+
+NETLIB_START(CD4020)
{
register_sub("sub", sub);
register_sub("supply", m_supply);
@@ -30,13 +32,13 @@ NETLIB_START(4020)
register_subalias("VSS", m_supply.m_vss);
}
-NETLIB_RESET(4020)
+NETLIB_RESET(CD4020)
{
sub.do_reset();
}
-NETLIB_START(4020_sub)
+NETLIB_START(CD4020_sub)
{
register_input("IP", m_IP);
@@ -56,13 +58,13 @@ NETLIB_START(4020_sub)
save(NLNAME(m_cnt));
}
-NETLIB_RESET(4020_sub)
+NETLIB_RESET(CD4020_sub)
{
- m_IP.set_state(netlist_logic_t::STATE_INP_HL);
+ m_IP.set_state(logic_t::STATE_INP_HL);
m_cnt = 0;
}
-NETLIB_UPDATE(4020_sub)
+NETLIB_UPDATE(CD4020_sub)
{
UINT8 cnt = m_cnt;
cnt = ( cnt + 1) & 0x3fff;
@@ -70,13 +72,13 @@ NETLIB_UPDATE(4020_sub)
m_cnt = cnt;
}
-NETLIB_UPDATE(4020)
+NETLIB_UPDATE(CD4020)
{
if (INPLOGIC(m_RESET))
{
sub.m_cnt = 0;
sub.m_IP.inactivate();
- static const netlist_time reset_time = netlist_time::from_nsec(140);
+ /* static */ const netlist_time reset_time = netlist_time::from_nsec(140);
OUTLOGIC(sub.m_Q[0], 0, reset_time);
for (int i=3; i<14; i++)
OUTLOGIC(sub.m_Q[i], 0, reset_time);
@@ -85,9 +87,9 @@ NETLIB_UPDATE(4020)
sub.m_IP.activate_hl();
}
-inline NETLIB_FUNC_VOID(4020_sub, update_outputs, (const UINT16 cnt))
+inline NETLIB_FUNC_VOID(CD4020_sub, update_outputs, (const UINT16 cnt))
{
- static const netlist_time out_delayQn[14] = {
+ /* static */ const netlist_time out_delayQn[14] = {
NLTIME_FROM_NS(180), NLTIME_FROM_NS(280),
NLTIME_FROM_NS(380), NLTIME_FROM_NS(480),
NLTIME_FROM_NS(580), NLTIME_FROM_NS(680),
@@ -102,47 +104,4 @@ inline NETLIB_FUNC_VOID(4020_sub, update_outputs, (const UINT16 cnt))
OUTLOGIC(m_Q[i], (cnt >> i) & 1, out_delayQn[i]);
}
-NETLIB_START(4020_dip)
-{
- NETLIB_NAME(4020)::start();
-
- /* +--------------+
- * Q12 |1 ++ 16| VDD
- * Q13 |2 15| Q11
- * Q14 |3 14| Q10
- * Q6 |4 4020 13| Q8
- * Q5 |5 12| Q9
- * Q7 |6 11| RESET
- * Q4 |7 10| IP (Input pulses)
- * VSS |8 9| Q1
- * +--------------+
- */
-
- register_subalias("1", sub.m_Q[11]);
- register_subalias("2", sub.m_Q[12]);
- register_subalias("3", sub.m_Q[13]);
- register_subalias("4", sub.m_Q[5]);
- register_subalias("5", sub.m_Q[4]);
- register_subalias("6", sub.m_Q[6]);
- register_subalias("7", sub.m_Q[3]);
- register_subalias("8", m_supply.m_vss);
-
- register_subalias("9", sub.m_Q[0]);
- register_subalias("10", sub.m_IP);
- register_subalias("11", m_RESET);
- register_subalias("12", sub.m_Q[8]);
- register_subalias("13", sub.m_Q[7]);
- register_subalias("14", sub.m_Q[9]);
- register_subalias("15", sub.m_Q[10]);
- register_subalias("16", m_supply.m_vdd);
-}
-
-NETLIB_UPDATE(4020_dip)
-{
- NETLIB_NAME(4020)::update();
-}
-
-NETLIB_RESET(4020_dip)
-{
- NETLIB_NAME(4020)::reset();
-}
+NETLIB_NAMESPACE_DEVICES_END()
diff --git a/src/emu/netlist/devices/nld_4020.h b/src/emu/netlist/devices/nld_4020.h
index 0b9a06364d8..d4814471fc1 100644
--- a/src/emu/netlist/devices/nld_4020.h
+++ b/src/emu/netlist/devices/nld_4020.h
@@ -3,7 +3,7 @@
/*
* nld_4020.h
*
- * CD4020: CMOS Ripple-Carry Binary Counters/Dividers
+ * CD4020: 14-Stage Ripple Carry Binary Counters
*
* +--------------+
* Q12 |1 ++ 16| VDD
@@ -30,35 +30,38 @@
#include "../nl_base.h"
#include "nld_cmos.h"
-#define CD_4020(_name, _IP, _RESET, _VDD, _VSS) \
- NET_REGISTER_DEV(4020, _name) \
+/* FIXME: only used in mario.c */
+#define CD4020_WI(_name, _IP, _RESET, _VDD, _VSS) \
+ NET_REGISTER_DEV(CD4020_WI, _name) \
NET_CONNECT(_name, IP, _IP) \
NET_CONNECT(_name, RESET, _RESET) \
NET_CONNECT(_name, VDD, _VDD) \
NET_CONNECT(_name, VSS, _VSS)
-#define CD_4020_DIP(_name) \
- NET_REGISTER_DEV(4020_dip, _name)
+#define CD4020(_name) \
+ NET_REGISTER_DEV(CD4020, _name)
-NETLIB_SUBDEVICE(4020_sub,
+NETLIB_NAMESPACE_DEVICES_START()
- NETLIB_LOGIC_FAMILY(CD4000)
+NETLIB_SUBDEVICE(CD4020_sub,
+
+ NETLIB_LOGIC_FAMILY(CD4XXX)
ATTR_HOT void update_outputs(const UINT16 cnt);
- netlist_logic_input_t m_IP;
+ logic_input_t m_IP;
UINT16 m_cnt;
- netlist_logic_output_t m_Q[14];
+ logic_output_t m_Q[14];
);
-NETLIB_DEVICE(4020,
- NETLIB_LOGIC_FAMILY(CD4000)
- NETLIB_NAME(4020_sub) sub;
+NETLIB_DEVICE(CD4020,
+ NETLIB_LOGIC_FAMILY(CD4XXX)
+ NETLIB_NAME(CD4020_sub) sub;
NETLIB_NAME(vdd_vss) m_supply;
- netlist_logic_input_t m_RESET;
+ logic_input_t m_RESET;
);
-NETLIB_DEVICE_DERIVED_PURE(4020_dip, 4020);
+NETLIB_NAMESPACE_DEVICES_END()
#endif /* NLD_4020_H_ */
diff --git a/src/emu/netlist/devices/nld_4066.c b/src/emu/netlist/devices/nld_4066.c
index 8225447d555..535314c0aa4 100644
--- a/src/emu/netlist/devices/nld_4066.c
+++ b/src/emu/netlist/devices/nld_4066.c
@@ -7,25 +7,27 @@
#include "nld_4066.h"
+NETLIB_NAMESPACE_DEVICES_START()
-NETLIB_START(4066)
+NETLIB_START(CD4066_GATE)
{
register_input("CTL", m_control);
+ register_sub("PS", m_supply);
register_sub("R", m_R);
- m_base_r = 270.0;
+ register_param("BASER", m_base_r, 270.0);
}
-NETLIB_RESET(4066)
+NETLIB_RESET(CD4066_GATE)
{
m_R.do_reset();
}
-NETLIB_UPDATE(4066)
+NETLIB_UPDATE(CD4066_GATE)
{
- nl_double sup = (m_supply->vdd() - m_supply->vss());
+ nl_double sup = (m_supply.vdd() - m_supply.vss());
nl_double low = NL_FCONST(0.45) * sup;
nl_double high = NL_FCONST(0.55) * sup;
- nl_double in = INPANALOG(m_control) - m_supply->vss();
+ nl_double in = INPANALOG(m_control) - m_supply.vss();
nl_double rON = m_base_r * NL_FCONST(5.0) / sup;
nl_double R = -1.0;
@@ -55,66 +57,4 @@ NETLIB_UPDATE(4066)
}
-NETLIB_START(4066_dip)
-{
- register_sub("supply", m_supply);
- m_A.m_supply = m_B.m_supply = m_C.m_supply = m_D.m_supply = &m_supply;
- register_sub("A", m_A);
- register_sub("B", m_B);
- register_sub("C", m_C);
- register_sub("D", m_D);
-
- m_A.m_base_r = m_B.m_base_r = m_C.m_base_r = m_D.m_base_r = 270;
-
- register_subalias("1", m_A.m_R.m_P);
- register_subalias("2", m_A.m_R.m_N);
- register_subalias("3", m_B.m_R.m_P);
- register_subalias("4", m_B.m_R.m_N);
- register_subalias("5", m_B.m_control);
- register_subalias("6", m_C.m_control);
- register_subalias("7", m_supply.m_vss);
-
- register_subalias("8", m_C.m_R.m_P);
- register_subalias("9", m_C.m_R.m_N);
- register_subalias("10", m_D.m_R.m_P);
- register_subalias("11", m_D.m_R.m_N);
- register_subalias("12", m_D.m_control);
- register_subalias("13", m_A.m_control);
- register_subalias("14", m_supply.m_vdd);
-
-}
-
-NETLIB_RESET(4066_dip)
-{
- m_A.do_reset();
- m_B.do_reset();
- m_C.do_reset();
- m_D.do_reset();
-}
-
-NETLIB_UPDATE(4066_dip)
-{
- /* only called during startup */
- m_A.update_dev();
- m_B.update_dev();
- m_C.update_dev();
- m_D.update_dev();
-}
-
-NETLIB_START(4016_dip)
-{
- NETLIB_NAME(4066_dip)::start();
-
- m_A.m_base_r = m_B.m_base_r = m_C.m_base_r = m_D.m_base_r = 1000.0;
-}
-
-NETLIB_RESET(4016_dip)
-{
- NETLIB_NAME(4066_dip)::reset();
-}
-
-NETLIB_UPDATE(4016_dip)
-{
- /* only called during startup */
- NETLIB_NAME(4066_dip)::update();
-}
+NETLIB_NAMESPACE_DEVICES_END()
diff --git a/src/emu/netlist/devices/nld_4066.h b/src/emu/netlist/devices/nld_4066.h
index 39209f386b6..e9fc1bfec26 100644
--- a/src/emu/netlist/devices/nld_4066.h
+++ b/src/emu/netlist/devices/nld_4066.h
@@ -27,33 +27,22 @@
#include "../nl_base.h"
#include "nld_cmos.h"
-#define CD_4066_DIP(_name) \
- NET_REGISTER_DEV(4066_dip, _name)
+#define CD4066_GATE(_name) \
+ NET_REGISTER_DEV(CD4066_GATE, _name)
-#define CD_4016_DIP(_name) \
- NET_REGISTER_DEV(4016_dip, _name)
+NETLIB_NAMESPACE_DEVICES_START()
-NETLIB_SUBDEVICE(4066,
- NETLIB_LOGIC_FAMILY(CD4000)
+NETLIB_DEVICE(CD4066_GATE,
+ NETLIB_LOGIC_FAMILY(CD4XXX)
public:
- netlist_analog_input_t m_control;
+ analog_input_t m_control;
NETLIB_NAME(R) m_R;
- NETLIB_NAME(vdd_vss) *m_supply;
- nl_double m_base_r;
-);
-
-NETLIB_DEVICE(4066_dip,
- NETLIB_LOGIC_FAMILY(CD4000)
-
- NETLIB_NAME(4066) m_A;
- NETLIB_NAME(4066) m_B;
- NETLIB_NAME(4066) m_C;
- NETLIB_NAME(4066) m_D;
NETLIB_NAME(vdd_vss) m_supply;
+ param_double_t m_base_r;
);
-NETLIB_DEVICE_DERIVED_PURE(4016_dip, 4066_dip);
+NETLIB_NAMESPACE_DEVICES_END()
#endif /* NLD_4066_H_ */
diff --git a/src/emu/netlist/devices/nld_7400.c b/src/emu/netlist/devices/nld_7400.c
index 758d5d1b667..188b8ad5529 100644
--- a/src/emu/netlist/devices/nld_7400.c
+++ b/src/emu/netlist/devices/nld_7400.c
@@ -7,6 +7,8 @@
#include "nld_7400.h"
+NETLIB_NAMESPACE_DEVICES_START()
+
#if (USE_TRUTHTABLE)
nld_7400::truthtable_t nld_7400::m_ttbl;
const char *nld_7400::m_desc[] = {
@@ -26,20 +28,20 @@ NETLIB_START(7400_dip)
register_sub("3", m_3);
register_sub("4", m_4);
- register_subalias("1", m_1.m_i[0]);
- register_subalias("2", m_1.m_i[1]);
+ register_subalias("1", m_1.m_I[0]);
+ register_subalias("2", m_1.m_I[1]);
register_subalias("3", m_1.m_Q[0]);
- register_subalias("4", m_2.m_i[0]);
- register_subalias("5", m_2.m_i[1]);
+ register_subalias("4", m_2.m_I[0]);
+ register_subalias("5", m_2.m_I[1]);
register_subalias("6", m_2.m_Q[0]);
- register_subalias("9", m_3.m_i[0]);
- register_subalias("10", m_3.m_i[1]);
+ register_subalias("9", m_3.m_I[0]);
+ register_subalias("10", m_3.m_I[1]);
register_subalias("8", m_3.m_Q[0]);
- register_subalias("12", m_4.m_i[0]);
- register_subalias("13", m_4.m_i[1]);
+ register_subalias("12", m_4.m_I[0]);
+ register_subalias("13", m_4.m_I[1]);
register_subalias("11", m_4.m_Q[0]);
}
@@ -59,3 +61,5 @@ NETLIB_RESET(7400_dip)
m_3.do_reset();
m_4.do_reset();
}
+
+NETLIB_NAMESPACE_DEVICES_END()
diff --git a/src/emu/netlist/devices/nld_7400.h b/src/emu/netlist/devices/nld_7400.h
index 73f5ffe33f8..97bdda0a912 100644
--- a/src/emu/netlist/devices/nld_7400.h
+++ b/src/emu/netlist/devices/nld_7400.h
@@ -33,23 +33,24 @@
#define NLD_7400_H_
#include "nld_signal.h"
+#include "nld_truthtable.h"
#define TTL_7400_NAND(_name, _A, _B) \
- NET_REGISTER_DEV(7400, _name) \
+ NET_REGISTER_DEV(TTL_7400_NAND, _name) \
NET_CONNECT(_name, A, _A) \
NET_CONNECT(_name, B, _B)
+#define TTL_7400_DIP(_name) \
+ NET_REGISTER_DEV(TTL_7400_DIP, _name)
+
+NETLIB_NAMESPACE_DEVICES_START()
+
#if (USE_TRUTHTABLE)
-#include "nld_truthtable.h"
NETLIB_TRUTHTABLE(7400, 2, 1, 0);
#else
NETLIB_SIGNAL(7400, 2, 0, 0);
#endif
-
-#define TTL_7400_DIP(_name) \
- NET_REGISTER_DEV(7400_dip, _name)
-
NETLIB_DEVICE(7400_dip,
NETLIB_NAME(7400) m_1;
@@ -58,4 +59,6 @@ NETLIB_DEVICE(7400_dip,
NETLIB_NAME(7400) m_4;
);
+NETLIB_NAMESPACE_DEVICES_END()
+
#endif /* NLD_7400_H_ */
diff --git a/src/emu/netlist/devices/nld_7402.c b/src/emu/netlist/devices/nld_7402.c
index 708dab04fcf..0e5695bebc9 100644
--- a/src/emu/netlist/devices/nld_7402.c
+++ b/src/emu/netlist/devices/nld_7402.c
@@ -7,6 +7,8 @@
#include "nld_7402.h"
+NETLIB_NAMESPACE_DEVICES_START()
+
#if (USE_TRUTHTABLE)
nld_7402::truthtable_t nld_7402::m_ttbl;
const char *nld_7402::m_desc[] = {
@@ -27,19 +29,19 @@ NETLIB_START(7402_dip)
register_sub("4", m_4);
register_subalias("1", m_1.m_Q[0]);
- register_subalias("2", m_1.m_i[0]);
- register_subalias("3", m_1.m_i[1]);
+ register_subalias("2", m_1.m_I[0]);
+ register_subalias("3", m_1.m_I[1]);
register_subalias("4", m_2.m_Q[0]);
- register_subalias("5", m_2.m_i[0]);
- register_subalias("6", m_2.m_i[1]);
+ register_subalias("5", m_2.m_I[0]);
+ register_subalias("6", m_2.m_I[1]);
- register_subalias("8", m_3.m_i[0]);
- register_subalias("9", m_3.m_i[1]);
+ register_subalias("8", m_3.m_I[0]);
+ register_subalias("9", m_3.m_I[1]);
register_subalias("10", m_3.m_Q[0]);
- register_subalias("11", m_4.m_i[0]);
- register_subalias("12", m_4.m_i[1]);
+ register_subalias("11", m_4.m_I[0]);
+ register_subalias("12", m_4.m_I[1]);
register_subalias("13", m_4.m_Q[0]);
}
@@ -59,3 +61,5 @@ NETLIB_RESET(7402_dip)
m_3.do_reset();
m_4.do_reset();
}
+
+NETLIB_NAMESPACE_DEVICES_END()
diff --git a/src/emu/netlist/devices/nld_7402.h b/src/emu/netlist/devices/nld_7402.h
index bd0306cd3e1..1d11236488b 100644
--- a/src/emu/netlist/devices/nld_7402.h
+++ b/src/emu/netlist/devices/nld_7402.h
@@ -33,18 +33,20 @@
#define NLD_7402_H_
#include "nld_signal.h"
+#include "nld_truthtable.h"
#define TTL_7402_NOR(_name, _I1, _I2) \
- NET_REGISTER_DEV(7402, _name) \
+ NET_REGISTER_DEV(TTL_7402_NOR, _name) \
NET_CONNECT(_name, A, _I1) \
NET_CONNECT(_name, B, _I2)
#define TTL_7402_DIP(_name) \
- NET_REGISTER_DEV(7402_dip, _name)
+ NET_REGISTER_DEV(TTL_7402_DIP, _name)
+
+NETLIB_NAMESPACE_DEVICES_START()
#if (USE_TRUTHTABLE)
-#include "nld_truthtable.h"
NETLIB_TRUTHTABLE(7402, 2, 1, 0);
#else
NETLIB_SIGNAL(7402, 2, 1, 0);
@@ -58,4 +60,6 @@ NETLIB_DEVICE(7402_dip,
NETLIB_NAME(7402) m_4;
);
+NETLIB_NAMESPACE_DEVICES_END()
+
#endif /* NLD_7402_H_ */
diff --git a/src/emu/netlist/devices/nld_7404.c b/src/emu/netlist/devices/nld_7404.c
index 57050ac8cd8..5bfd08c7d1e 100644
--- a/src/emu/netlist/devices/nld_7404.c
+++ b/src/emu/netlist/devices/nld_7404.c
@@ -7,10 +7,22 @@
#include "nld_7404.h"
+NETLIB_NAMESPACE_DEVICES_START()
+
+#if 1 && (USE_TRUTHTABLE)
+nld_7404::truthtable_t nld_7404::m_ttbl;
+const char *nld_7404::m_desc[] = {
+ "A | Q ",
+ "0 | 1|22",
+ "1 | 0|15",
+ ""
+};
+#else
+
NETLIB_START(7404)
{
- register_input("A", m_I);
- register_output("Q", m_Q);
+ register_input("A", m_I[0]);
+ register_output("Q", m_Q[0]);
}
NETLIB_RESET(7404)
@@ -19,10 +31,11 @@ NETLIB_RESET(7404)
NETLIB_UPDATE(7404)
{
- static const netlist_time delay[2] = { NLTIME_FROM_NS(15), NLTIME_FROM_NS(22) };
- UINT8 t = (INPLOGIC(m_I)) ^ 1;
- OUTLOGIC(m_Q, t, delay[t]);
+ /* static */ const netlist_time delay[2] = { NLTIME_FROM_NS(15), NLTIME_FROM_NS(22) };
+ UINT8 t = (INPLOGIC(m_I[0])) ^ 1;
+ OUTLOGIC(m_Q[0], t, delay[t]);
}
+#endif
NETLIB_START(7404_dip)
{
@@ -33,23 +46,23 @@ NETLIB_START(7404_dip)
register_sub("5", m_5);
register_sub("6", m_6);
- register_subalias("1", m_1.m_I);
- register_subalias("2", m_1.m_Q);
+ register_subalias("1", m_1.m_I[0]);
+ register_subalias("2", m_1.m_Q[0]);
- register_subalias("3", m_2.m_I);
- register_subalias("4", m_2.m_Q);
+ register_subalias("3", m_2.m_I[0]);
+ register_subalias("4", m_2.m_Q[0]);
- register_subalias("5", m_3.m_I);
- register_subalias("6", m_3.m_Q);
+ register_subalias("5", m_3.m_I[0]);
+ register_subalias("6", m_3.m_Q[0]);
- register_subalias("8", m_4.m_Q);
- register_subalias("9", m_4.m_I);
+ register_subalias("8", m_4.m_Q[0]);
+ register_subalias("9", m_4.m_I[0]);
- register_subalias("10", m_5.m_Q);
- register_subalias("11", m_5.m_I);
+ register_subalias("10", m_5.m_Q[0]);
+ register_subalias("11", m_5.m_I[0]);
- register_subalias("12", m_6.m_Q);
- register_subalias("13", m_6.m_I);
+ register_subalias("12", m_6.m_Q[0]);
+ register_subalias("13", m_6.m_I[0]);
}
NETLIB_UPDATE(7404_dip)
@@ -73,3 +86,5 @@ NETLIB_RESET(7404_dip)
m_5.do_reset();
m_6.do_reset();
}
+
+NETLIB_NAMESPACE_DEVICES_END()
diff --git a/src/emu/netlist/devices/nld_7404.h b/src/emu/netlist/devices/nld_7404.h
index f74210bc958..60465f74d9c 100644
--- a/src/emu/netlist/devices/nld_7404.h
+++ b/src/emu/netlist/devices/nld_7404.h
@@ -31,19 +31,26 @@
#define NLD_7404_H_
#include "nld_signal.h"
-
-NETLIB_DEVICE(7404,
-public:
- netlist_logic_input_t m_I;
- netlist_logic_output_t m_Q;
-);
+#include "nld_truthtable.h"
#define TTL_7404_INVERT(_name, _A) \
- NET_REGISTER_DEV(7404, _name) \
+ NET_REGISTER_DEV(TTL_7404_INVERT, _name) \
NET_CONNECT(_name, A, _A)
#define TTL_7404_DIP(_name) \
- NET_REGISTER_DEV(7402_dip, _name)
+ NET_REGISTER_DEV(TTL_7404_DIP, _name)
+
+NETLIB_NAMESPACE_DEVICES_START()
+
+#if 1 && (USE_TRUTHTABLE)
+NETLIB_TRUTHTABLE(7404, 1, 1, 0);
+#else
+NETLIB_DEVICE(7404,
+public:
+ netlist_logic_input_t m_I[1];
+ netlist_logic_output_t m_Q[1];
+);
+#endif
NETLIB_DEVICE(7404_dip,
@@ -54,4 +61,7 @@ NETLIB_DEVICE(7404_dip,
NETLIB_NAME(7404) m_5;
NETLIB_NAME(7404) m_6;
);
+
+NETLIB_NAMESPACE_DEVICES_END()
+
#endif /* NLD_7404_H_ */
diff --git a/src/emu/netlist/devices/nld_7408.c b/src/emu/netlist/devices/nld_7408.c
index 4ecdc78469b..a0a54d6cf82 100644
--- a/src/emu/netlist/devices/nld_7408.c
+++ b/src/emu/netlist/devices/nld_7408.c
@@ -7,6 +7,8 @@
#include "nld_7408.h"
+NETLIB_NAMESPACE_DEVICES_START()
+
#if (USE_TRUTHTABLE)
nld_7408::truthtable_t nld_7408::m_ttbl;
const char *nld_7408::m_desc[] = {
@@ -26,20 +28,20 @@ NETLIB_START(7408_dip)
register_sub("3", m_3);
register_sub("4", m_4);
- register_subalias("1", m_1.m_i[0]);
- register_subalias("2", m_1.m_i[1]);
+ register_subalias("1", m_1.m_I[0]);
+ register_subalias("2", m_1.m_I[1]);
register_subalias("3", m_1.m_Q[0]);
- register_subalias("4", m_2.m_i[0]);
- register_subalias("5", m_2.m_i[1]);
+ register_subalias("4", m_2.m_I[0]);
+ register_subalias("5", m_2.m_I[1]);
register_subalias("6", m_2.m_Q[0]);
- register_subalias("9", m_3.m_i[0]);
- register_subalias("10", m_3.m_i[1]);
+ register_subalias("9", m_3.m_I[0]);
+ register_subalias("10", m_3.m_I[1]);
register_subalias("8", m_3.m_Q[0]);
- register_subalias("12", m_4.m_i[0]);
- register_subalias("13", m_4.m_i[1]);
+ register_subalias("12", m_4.m_I[0]);
+ register_subalias("13", m_4.m_I[1]);
register_subalias("11", m_4.m_Q[0]);
}
@@ -59,3 +61,5 @@ NETLIB_RESET(7408_dip)
m_3.do_reset();
m_4.do_reset();
}
+
+NETLIB_NAMESPACE_DEVICES_END()
diff --git a/src/emu/netlist/devices/nld_7408.h b/src/emu/netlist/devices/nld_7408.h
index 91967fe9ba6..9304d5c554d 100644
--- a/src/emu/netlist/devices/nld_7408.h
+++ b/src/emu/netlist/devices/nld_7408.h
@@ -33,21 +33,24 @@
#define NLD_7408_H_
#include "nld_signal.h"
+#include "nld_truthtable.h"
#define TTL_7408_AND(_name, _A, _B) \
- NET_REGISTER_DEV(7408, _name) \
+ NET_REGISTER_DEV(TTL_7408_AND, _name) \
NET_CONNECT(_name, A, _A) \
NET_CONNECT(_name, B, _B)
+#define TTL_7408_DIP(_name) \
+ NET_REGISTER_DEV(TTL_7408_DIP, _name)
+
+NETLIB_NAMESPACE_DEVICES_START()
+
#if (USE_TRUTHTABLE)
-#include "nld_truthtable.h"
NETLIB_TRUTHTABLE(7408, 2, 1, 0);
#else
NETLIB_SIGNAL(7408, 2, 0, 1);
#endif
-#define TTL_7408_DIP(_name) \
- NET_REGISTER_DEV(7408_dip, _name)
NETLIB_DEVICE(7408_dip,
@@ -57,4 +60,6 @@ NETLIB_DEVICE(7408_dip,
NETLIB_NAME(7408) m_4;
);
+NETLIB_NAMESPACE_DEVICES_END()
+
#endif /* NLD_7408_H_ */
diff --git a/src/emu/netlist/devices/nld_7410.c b/src/emu/netlist/devices/nld_7410.c
index d920398c68b..9564ecd4e4f 100644
--- a/src/emu/netlist/devices/nld_7410.c
+++ b/src/emu/netlist/devices/nld_7410.c
@@ -7,6 +7,8 @@
#include "nld_7410.h"
+NETLIB_NAMESPACE_DEVICES_START()
+
#if (USE_TRUTHTABLE)
nld_7410::truthtable_t nld_7410::m_ttbl;
const char *nld_7410::m_desc[] = {
@@ -27,20 +29,20 @@ NETLIB_START(7410_dip)
register_sub("2", m_2);
register_sub("3", m_3);
- register_subalias("1", m_1.m_i[0]);
- register_subalias("2", m_1.m_i[1]);
- register_subalias("3", m_2.m_i[0]);
- register_subalias("4", m_2.m_i[1]);
- register_subalias("5", m_2.m_i[2]);
+ register_subalias("1", m_1.m_I[0]);
+ register_subalias("2", m_1.m_I[1]);
+ register_subalias("3", m_2.m_I[0]);
+ register_subalias("4", m_2.m_I[1]);
+ register_subalias("5", m_2.m_I[2]);
register_subalias("6", m_2.m_Q[0]);
register_subalias("8", m_3.m_Q[0]);
- register_subalias("9", m_3.m_i[0]);
- register_subalias("10", m_3.m_i[1]);
- register_subalias("11", m_3.m_i[2]);
+ register_subalias("9", m_3.m_I[0]);
+ register_subalias("10", m_3.m_I[1]);
+ register_subalias("11", m_3.m_I[2]);
register_subalias("12", m_1.m_Q[0]);
- register_subalias("13", m_1.m_i[2]);
+ register_subalias("13", m_1.m_I[2]);
}
NETLIB_UPDATE(7410_dip)
@@ -57,3 +59,5 @@ NETLIB_RESET(7410_dip)
m_2.do_reset();
m_3.do_reset();
}
+
+NETLIB_NAMESPACE_DEVICES_END()
diff --git a/src/emu/netlist/devices/nld_7410.h b/src/emu/netlist/devices/nld_7410.h
index 23a8fba8763..d6e97838c7b 100644
--- a/src/emu/netlist/devices/nld_7410.h
+++ b/src/emu/netlist/devices/nld_7410.h
@@ -33,23 +33,25 @@
#define NLD_7410_H_
#include "nld_signal.h"
+#include "nld_truthtable.h"
#define TTL_7410_NAND(_name, _I1, _I2, _I3) \
- NET_REGISTER_DEV(7410, _name) \
+ NET_REGISTER_DEV(TTL_7410_NAND, _name) \
NET_CONNECT(_name, A, _I1) \
NET_CONNECT(_name, B, _I2) \
NET_CONNECT(_name, C, _I3)
+#define TTL_7410_DIP(_name) \
+ NET_REGISTER_DEV(TTL_7410_DIP, _name)
+
+NETLIB_NAMESPACE_DEVICES_START()
+
#if (USE_TRUTHTABLE)
-#include "nld_truthtable.h"
NETLIB_TRUTHTABLE(7410, 3, 1, 0);
#else
NETLIB_SIGNAL(7410, 3, 0, 0);
#endif
-#define TTL_7410_DIP(_name) \
- NET_REGISTER_DEV(7410_dip, _name)
-
NETLIB_DEVICE(7410_dip,
NETLIB_NAME(7410) m_1;
@@ -57,4 +59,6 @@ NETLIB_DEVICE(7410_dip,
NETLIB_NAME(7410) m_3;
);
+NETLIB_NAMESPACE_DEVICES_END()
+
#endif /* NLD_7410_H_ */
diff --git a/src/emu/netlist/devices/nld_74107.c b/src/emu/netlist/devices/nld_74107.c
index cd0238de829..542c80a5b43 100644
--- a/src/emu/netlist/devices/nld_74107.c
+++ b/src/emu/netlist/devices/nld_74107.c
@@ -7,6 +7,8 @@
#include "nld_74107.h"
+NETLIB_NAMESPACE_DEVICES_START()
+
NETLIB_START(74107Asub)
{
register_input("CLK", m_clk);
@@ -20,7 +22,7 @@ NETLIB_START(74107Asub)
NETLIB_RESET(74107Asub)
{
- m_clk.set_state(netlist_logic_t::STATE_INP_HL);
+ m_clk.set_state(logic_t::STATE_INP_HL);
m_Q.initial(0);
m_QQ.initial(1);
@@ -141,3 +143,5 @@ NETLIB_UPDATE(74107_dip)
m_1.update_dev();
m_2.update_dev();
}
+
+NETLIB_NAMESPACE_DEVICES_END()
diff --git a/src/emu/netlist/devices/nld_74107.h b/src/emu/netlist/devices/nld_74107.h
index ba2462c55c5..89f59822f22 100644
--- a/src/emu/netlist/devices/nld_74107.h
+++ b/src/emu/netlist/devices/nld_74107.h
@@ -62,7 +62,7 @@
#include "../nl_base.h"
#define TTL_74107A(_name, _CLK, _J, _K, _CLRQ) \
- NET_REGISTER_DEV(74107A, _name) \
+ NET_REGISTER_DEV(TTL_74107A, _name) \
NET_CONNECT(_name, CLK, _CLK) \
NET_CONNECT(_name, J, _J) \
NET_CONNECT(_name, K, _K) \
@@ -72,13 +72,15 @@
TTL_74107A(_name, _CLK, _J, _K, _CLRQ)
#define TTL_74107_DIP(_name) \
- NET_REGISTER_DEV(74107_dip, _name)
+ NET_REGISTER_DEV(TTL_74107_DIP, _name)
+
+NETLIB_NAMESPACE_DEVICES_START()
NETLIB_SUBDEVICE(74107Asub,
- netlist_logic_input_t m_clk;
+ logic_input_t m_clk;
- netlist_logic_output_t m_Q;
- netlist_logic_output_t m_QQ;
+ logic_output_t m_Q;
+ logic_output_t m_QQ;
netlist_sig_t m_Q1;
netlist_sig_t m_Q2;
@@ -92,9 +94,9 @@ NETLIB_DEVICE(74107A,
public:
NETLIB_NAME(74107Asub) sub;
- netlist_logic_input_t m_J;
- netlist_logic_input_t m_K;
- netlist_logic_input_t m_clrQ;
+ logic_input_t m_J;
+ logic_input_t m_K;
+ logic_input_t m_clrQ;
);
@@ -112,4 +114,6 @@ NETLIB_DEVICE(74107_dip,
NETLIB_NAME(74107) m_2;
);
+NETLIB_NAMESPACE_DEVICES_END()
+
#endif /* NLD_74107_H_ */
diff --git a/src/emu/netlist/devices/nld_7411.c b/src/emu/netlist/devices/nld_7411.c
index 0664bd10c5c..2db034577cb 100644
--- a/src/emu/netlist/devices/nld_7411.c
+++ b/src/emu/netlist/devices/nld_7411.c
@@ -7,6 +7,8 @@
#include "nld_7411.h"
+NETLIB_NAMESPACE_DEVICES_START()
+
#if (USE_TRUTHTABLE)
nld_7411::truthtable_t nld_7411::m_ttbl;
const char *nld_7411::m_desc[] = {
@@ -25,20 +27,20 @@ NETLIB_START(7411_dip)
register_sub("2", m_2);
register_sub("3", m_3);
- register_subalias("1", m_1.m_i[0]);
- register_subalias("2", m_1.m_i[1]);
- register_subalias("3", m_2.m_i[0]);
- register_subalias("4", m_2.m_i[1]);
- register_subalias("5", m_2.m_i[2]);
+ register_subalias("1", m_1.m_I[0]);
+ register_subalias("2", m_1.m_I[1]);
+ register_subalias("3", m_2.m_I[0]);
+ register_subalias("4", m_2.m_I[1]);
+ register_subalias("5", m_2.m_I[2]);
register_subalias("6", m_2.m_Q[0]);
register_subalias("8", m_3.m_Q[0]);
- register_subalias("9", m_3.m_i[0]);
- register_subalias("10", m_3.m_i[1]);
- register_subalias("11", m_3.m_i[2]);
+ register_subalias("9", m_3.m_I[0]);
+ register_subalias("10", m_3.m_I[1]);
+ register_subalias("11", m_3.m_I[2]);
register_subalias("12", m_1.m_Q[0]);
- register_subalias("13", m_1.m_i[2]);
+ register_subalias("13", m_1.m_I[2]);
}
NETLIB_UPDATE(7411_dip)
@@ -55,3 +57,5 @@ NETLIB_RESET(7411_dip)
m_2.do_reset();
m_3.do_reset();
}
+
+NETLIB_NAMESPACE_DEVICES_END()
diff --git a/src/emu/netlist/devices/nld_7411.h b/src/emu/netlist/devices/nld_7411.h
index 93e7fd7f960..11d4d45a20f 100644
--- a/src/emu/netlist/devices/nld_7411.h
+++ b/src/emu/netlist/devices/nld_7411.h
@@ -33,22 +33,25 @@
#define NLD_7411_H_
#include "nld_signal.h"
+#include "nld_truthtable.h"
#define TTL_7411_AND(_name, _I1, _I2, _I3) \
- NET_REGISTER_DEV(7411, _name) \
+ NET_REGISTER_DEV(TTL_7411_AND, _name) \
NET_CONNECT(_name, A, _I1) \
NET_CONNECT(_name, B, _I2) \
NET_CONNECT(_name, C, _I3)
+#define TTL_7411_DIP(_name) \
+ NET_REGISTER_DEV(TTL_7411_DIP, _name)
+
+NETLIB_NAMESPACE_DEVICES_START()
+
#if (USE_TRUTHTABLE)
-#include "nld_truthtable.h"
NETLIB_TRUTHTABLE(7411, 3, 1, 0);
#else
NETLIB_SIGNAL(7411, 3, 0, 1);
#endif
-#define TTL_7411_DIP(_name) \
- NET_REGISTER_DEV(7411_dip, _name)
NETLIB_DEVICE(7411_dip,
@@ -57,4 +60,6 @@ NETLIB_DEVICE(7411_dip,
NETLIB_NAME(7411) m_3;
);
+NETLIB_NAMESPACE_DEVICES_END()
+
#endif /* NLD_7411_H_ */
diff --git a/src/emu/netlist/devices/nld_74123.c b/src/emu/netlist/devices/nld_74123.c
index 5d301558c2d..59a9ed16ce4 100644
--- a/src/emu/netlist/devices/nld_74123.c
+++ b/src/emu/netlist/devices/nld_74123.c
@@ -10,9 +10,12 @@
#define R_OFF (1E20)
#define R_ON (m_RI.Value())
+NETLIB_NAMESPACE_DEVICES_START()
+
NETLIB_START(74123)
{
- m_dev_type = 74123;
+ if ((m_dev_type != 9602) && (m_dev_type != 4538) )
+ m_dev_type = 74123;
register_sub("RP", m_RP);
register_sub("RN", m_RN);
@@ -33,52 +36,70 @@ NETLIB_START(74123)
register_subalias("C", m_RN.m_R.m_N);
register_subalias("RC", m_RN.m_R.m_P);
- register_param("K", m_K, 0.4);
+ if (m_dev_type == 4538)
+ register_param("K", m_K, 0.4);
+ else
+ register_param("K", m_K, 0.4);
+
register_param("RI", m_RI, 400.0); // around 250 for HC series, 400 on LS/TTL, estimated from datasheets
- connect(m_RP_Q, m_RP.m_I);
- connect(m_RN_Q, m_RN.m_I);
+ connect_late(m_RP_Q, m_RP.m_I);
+ connect_late(m_RN_Q, m_RN.m_I);
- connect(m_RN.m_R.m_P, m_RP.m_R.m_N);
- connect(m_CV, m_RN.m_R.m_P);
+ connect_late(m_RN.m_R.m_P, m_RP.m_R.m_N);
+ connect_late(m_CV, m_RN.m_R.m_P);
save(NLNAME(m_last_trig));
save(NLNAME(m_state));
save(NLNAME(m_KP));
- m_KP = 1.0 / (1.0 + exp(m_K.Value()));
}
NETLIB_UPDATE(74123)
{
netlist_sig_t m_trig;
+ netlist_sig_t res = !INPLOGIC(m_CLRQ);
+ netlist_time t_AB_to_Q = NLTIME_FROM_NS(10);
+ netlist_time t_C_to_Q = NLTIME_FROM_NS(10);
if (m_dev_type == 74123)
+ {
m_trig = (INPLOGIC(m_A) ^ 1) & INPLOGIC(m_B) & INPLOGIC(m_CLRQ);
- else
- // 9602
+ }
+ else if (m_dev_type == 9602)
+ {
m_trig = (INPLOGIC(m_A) ^ 1) | INPLOGIC(m_B);
+ }
+ else // 4538
+ {
+ m_trig = (INPLOGIC(m_B) ^ 1) | INPLOGIC(m_A);
+ // The line below is from the datasheet truthtable ... doesn't make sense at all
+ //res = res | INPLOGIC(m_A) | (INPLOGIC(m_B) ^ 1);
+ t_AB_to_Q = NLTIME_FROM_NS(300);
+ t_C_to_Q = NLTIME_FROM_NS(250);
+ //printf("m_trig %d res %d\n", m_trig, res);
+ }
- if (!INPLOGIC(m_CLRQ))
+ if (res)
{
- OUTLOGIC(m_Q, 0, NLTIME_FROM_NS(10));
- OUTLOGIC(m_QQ, 1, NLTIME_FROM_NS(10));
+ OUTLOGIC(m_Q, 0, t_C_to_Q);
+ OUTLOGIC(m_QQ, 1, t_C_to_Q);
/* quick charge until trigger */
/* FIXME: SGS datasheet shows quick charge to 5V,
* though schematics indicate quick charge to Vhigh only.
*/
- OUTLOGIC(m_RP_Q, 1, NLTIME_FROM_NS(10)); // R_ON
- OUTLOGIC(m_RN_Q, 0, NLTIME_FROM_NS(10)); // R_OFF
+ OUTLOGIC(m_RP_Q, 1, t_C_to_Q); // R_ON
+ OUTLOGIC(m_RN_Q, 0, t_C_to_Q); // R_OFF
m_state = 2; //charging (quick)
}
else if (!m_last_trig && m_trig)
{
// FIXME: Timing!
- OUTLOGIC(m_Q, 1, NLTIME_FROM_NS(10));
- OUTLOGIC(m_QQ, 0, NLTIME_FROM_NS(10));
+ OUTLOGIC(m_Q, 1, t_AB_to_Q);
+ OUTLOGIC(m_QQ, 0,t_AB_to_Q);
- OUTLOGIC(m_RN_Q, 1, NLTIME_FROM_NS(10)); // R_ON
- OUTLOGIC(m_RP_Q, 0, NLTIME_FROM_NS(10)); // R_OFF
+ OUTLOGIC(m_RN_Q, 1, t_AB_to_Q); // R_ON
+ OUTLOGIC(m_RP_Q, 0, t_AB_to_Q); // R_OFF
m_state = 1; // discharging
}
@@ -110,6 +131,8 @@ NETLIB_UPDATE(74123)
NETLIB_RESET(74123)
{
+ m_KP = 1.0 / (1.0 + exp(m_K.Value()));
+
m_RP.do_reset();
m_RN.do_reset();
@@ -133,7 +156,7 @@ NETLIB_START(74123_dip)
register_subalias("6", m_2.m_RN.m_R.m_N);
register_subalias("7", m_2.m_RN.m_R.m_P);
register_subalias("8", m_1.m_RN.m_R.m_N);
- connect(m_1.m_RN.m_R.m_N, m_2.m_RN.m_R.m_N);
+ connect_late(m_1.m_RN.m_R.m_N, m_2.m_RN.m_R.m_N);
register_subalias("9", m_2.m_A);
register_subalias("10", m_2.m_B);
@@ -143,7 +166,7 @@ NETLIB_START(74123_dip)
register_subalias("14", m_1.m_RN.m_R.m_N);
register_subalias("15", m_1.m_RN.m_R.m_P);
register_subalias("16", m_1.m_RP.m_R.m_P);
- connect(m_1.m_RP.m_R.m_P, m_2.m_RP.m_R.m_P);
+ connect_late(m_1.m_RP.m_R.m_P, m_2.m_RP.m_R.m_P);
}
NETLIB_UPDATE(74123_dip)
@@ -161,12 +184,12 @@ NETLIB_RESET(74123_dip)
NETLIB_START(9602_dip)
{
- register_sub("1", m_1);
- register_sub("2", m_2);
-
m_1.m_dev_type = 9602;
m_2.m_dev_type = 9602;
+ register_sub("1", m_1);
+ register_sub("2", m_2);
+
register_subalias("1", m_1.m_RN.m_R.m_N); // C1
register_subalias("2", m_1.m_RN.m_R.m_P); // RC1
register_subalias("3", m_1.m_CLRQ);
@@ -175,7 +198,7 @@ NETLIB_START(9602_dip)
register_subalias("6", m_1.m_Q);
register_subalias("7", m_1.m_QQ);
register_subalias("8", m_1.m_RN.m_R.m_N);
- connect(m_1.m_RN.m_R.m_N, m_2.m_RN.m_R.m_N);
+ connect_late(m_1.m_RN.m_R.m_N, m_2.m_RN.m_R.m_N);
register_subalias("9", m_2.m_QQ);
register_subalias("10", m_2.m_Q);
@@ -185,7 +208,7 @@ NETLIB_START(9602_dip)
register_subalias("14", m_2.m_RN.m_R.m_P); // RC2
register_subalias("15", m_2.m_RN.m_R.m_N); // C2
register_subalias("16", m_1.m_RP.m_R.m_P);
- connect(m_1.m_RP.m_R.m_P, m_2.m_RP.m_R.m_P);
+ connect_late(m_1.m_RP.m_R.m_P, m_2.m_RP.m_R.m_P);
}
NETLIB_UPDATE(9602_dip)
@@ -200,3 +223,47 @@ NETLIB_RESET(9602_dip)
m_1.do_reset();
m_2.do_reset();
}
+
+NETLIB_START(4538_dip)
+{
+ m_1.m_dev_type = 4538;
+ m_2.m_dev_type = 4538;
+
+ register_sub("1", m_1);
+ register_sub("2", m_2);
+
+ register_subalias("1", m_1.m_RN.m_R.m_N); // C1
+ register_subalias("2", m_1.m_RN.m_R.m_P); // RC1
+ register_subalias("3", m_1.m_CLRQ);
+ register_subalias("4", m_1.m_A);
+ register_subalias("5", m_1.m_B);
+ register_subalias("6", m_1.m_Q);
+ register_subalias("7", m_1.m_QQ);
+ register_subalias("8", m_1.m_RN.m_R.m_N);
+ connect_late(m_1.m_RN.m_R.m_N, m_2.m_RN.m_R.m_N);
+
+ register_subalias("9", m_2.m_QQ);
+ register_subalias("10", m_2.m_Q);
+ register_subalias("11", m_2.m_B);
+ register_subalias("12", m_2.m_A);
+ register_subalias("13", m_2.m_CLRQ);
+ register_subalias("14", m_2.m_RN.m_R.m_P); // RC2
+ register_subalias("15", m_2.m_RN.m_R.m_N); // C2
+ register_subalias("16", m_1.m_RP.m_R.m_P);
+ connect_late(m_1.m_RP.m_R.m_P, m_2.m_RP.m_R.m_P);
+}
+
+NETLIB_UPDATE(4538_dip)
+{
+ /* only called during startup */
+ m_1.update_dev();
+ m_2.update_dev();
+}
+
+NETLIB_RESET(4538_dip)
+{
+ m_1.do_reset();
+ m_2.do_reset();
+}
+
+NETLIB_NAMESPACE_DEVICES_END()
diff --git a/src/emu/netlist/devices/nld_74123.h b/src/emu/netlist/devices/nld_74123.h
index 79c6021b025..8772103b521 100644
--- a/src/emu/netlist/devices/nld_74123.h
+++ b/src/emu/netlist/devices/nld_74123.h
@@ -30,6 +30,20 @@
* Q1Q |7 10| Q2
* GND |8 9| Q2Q
* +--------------+
+ *
+ * CD4538: Dual Retriggerable, Resettable One Shots
+ *
+ * +--------------+
+ * C1 |1 ++ 16| VCC
+ * RC1 |2 15| C2
+ * CLR1 |3 14| RC2
+ * A1 |4 4538 13| CLR2
+ * B1 |5 12| A2
+ * Q1 |6 11| B2
+ * Q1Q |7 10| Q2
+ * GND |8 9| Q2Q
+ * +--------------+
+ *
*/
#ifndef NLD_74123_H_
@@ -40,37 +54,38 @@
#include "../analog/nld_twoterm.h"
#define TTL_74123(_name) \
- NET_REGISTER_DEV(74123, _name)
+ NET_REGISTER_DEV(TTL_74123, _name)
+NETLIB_NAMESPACE_DEVICES_START()
NETLIB_DEVICE(74123,
public:
NETLIB_NAME(res_sw) m_RP;
NETLIB_NAME(res_sw) m_RN;
- netlist_logic_output_t m_RP_Q;
- netlist_logic_output_t m_RN_Q;
+ logic_output_t m_RP_Q;
+ logic_output_t m_RN_Q;
- netlist_logic_input_t m_A;
- netlist_logic_input_t m_B;
- netlist_logic_input_t m_CLRQ;
- netlist_logic_output_t m_Q;
- netlist_logic_output_t m_QQ;
+ logic_input_t m_A;
+ logic_input_t m_B;
+ logic_input_t m_CLRQ;
+ logic_output_t m_Q;
+ logic_output_t m_QQ;
- netlist_analog_input_t m_CV;
+ analog_input_t m_CV;
netlist_sig_t m_last_trig;
UINT8 m_state;
double m_KP;
- netlist_param_double_t m_K;
- netlist_param_double_t m_RI;
+ param_double_t m_K;
+ param_double_t m_RI;
int m_dev_type;
);
#define TTL_74123_DIP(_name) \
- NET_REGISTER_DEV(74123_dip, _name)
+ NET_REGISTER_DEV(TTL_74123_DIP, _name)
NETLIB_DEVICE(74123_dip,
@@ -84,7 +99,7 @@ NETLIB_DEVICE(74123_dip,
*/
#define TTL_9602_DIP(_name) \
- NET_REGISTER_DEV(9602_dip, _name)
+ NET_REGISTER_DEV(TTL_9602_DIP, _name)
NETLIB_DEVICE(9602_dip,
@@ -93,5 +108,20 @@ NETLIB_DEVICE(9602_dip,
);
+/*
+ * The CD4538 is pretty similar to the 9602
+ */
+
+#define CD4538_DIP(_name) \
+ NET_REGISTER_DEV(CD4538_DIP, _name)
+
+NETLIB_DEVICE(4538_dip,
+ NETLIB_LOGIC_FAMILY(CD4XXX)
+ NETLIB_NAME(74123) m_1;
+ NETLIB_NAME(74123) m_2;
+);
+
+NETLIB_NAMESPACE_DEVICES_END()
+
#endif /* NLD_74123_H_ */
diff --git a/src/emu/netlist/devices/nld_74153.c b/src/emu/netlist/devices/nld_74153.c
index 23c8bc71d60..ab52808c4cc 100644
--- a/src/emu/netlist/devices/nld_74153.c
+++ b/src/emu/netlist/devices/nld_74153.c
@@ -7,6 +7,8 @@
#include "nld_74153.h"
+NETLIB_NAMESPACE_DEVICES_START()
+
/* FIXME: timing is not 100% accurate, Strobe and Select inputs have a
* slightly longer timing.
* Convert this to sub-devices at some time.
@@ -110,3 +112,5 @@ NETLIB_RESET(74153_dip)
m_1.do_reset();
m_2.do_reset();
}
+
+NETLIB_NAMESPACE_DEVICES_END()
diff --git a/src/emu/netlist/devices/nld_74153.h b/src/emu/netlist/devices/nld_74153.h
index 16024114d4b..fe59759b1f7 100644
--- a/src/emu/netlist/devices/nld_74153.h
+++ b/src/emu/netlist/devices/nld_74153.h
@@ -48,7 +48,7 @@
#include "../nl_base.h"
#define TTL_74153(_name, _C0, _C1, _C2, _C3, _A, _B, _G) \
- NET_REGISTER_DEV(74153, _name) \
+ NET_REGISTER_DEV(TTL_74153, _name) \
NET_CONNECT(_name, C0, _C0) \
NET_CONNECT(_name, C1, _C1) \
NET_CONNECT(_name, C2, _C2) \
@@ -58,13 +58,15 @@
NET_CONNECT(_name, G, _G)
#define TTL_74153_DIP(_name) \
- NET_REGISTER_DEV(74153_dip, _name)
+ NET_REGISTER_DEV(TTL_74153_DIP, _name)
+
+NETLIB_NAMESPACE_DEVICES_START()
NETLIB_SUBDEVICE(74153sub,
- netlist_logic_input_t m_C[4];
- netlist_logic_input_t m_G;
+ logic_input_t m_C[4];
+ logic_input_t m_G;
- netlist_logic_output_t m_Y;
+ logic_output_t m_Y;
int m_chan;
);
@@ -72,16 +74,18 @@ NETLIB_SUBDEVICE(74153sub,
NETLIB_DEVICE(74153,
public:
NETLIB_NAME(74153sub) m_sub;
- netlist_logic_input_t m_A;
- netlist_logic_input_t m_B;
+ logic_input_t m_A;
+ logic_input_t m_B;
);
NETLIB_DEVICE(74153_dip,
NETLIB_NAME(74153sub) m_1;
NETLIB_NAME(74153sub) m_2;
- netlist_logic_input_t m_A;
- netlist_logic_input_t m_B;
+ logic_input_t m_A;
+ logic_input_t m_B;
);
+NETLIB_NAMESPACE_DEVICES_END()
+
#endif /* NLD_74153_H_ */
diff --git a/src/emu/netlist/devices/nld_74175.c b/src/emu/netlist/devices/nld_74175.c
index a10268bdfda..ec9d49a923b 100644
--- a/src/emu/netlist/devices/nld_74175.c
+++ b/src/emu/netlist/devices/nld_74175.c
@@ -7,6 +7,8 @@
#include "nld_74175.h"
+NETLIB_NAMESPACE_DEVICES_START()
+
static const netlist_time delay[2] = { NLTIME_FROM_NS(25), NLTIME_FROM_NS(25) };
static const netlist_time delay_clear[2] = { NLTIME_FROM_NS(40), NLTIME_FROM_NS(25) };
@@ -29,7 +31,7 @@ NETLIB_START(74175_sub)
NETLIB_RESET(74175_sub)
{
- m_CLK.set_state(netlist_logic_t::STATE_INP_LH);
+ m_CLK.set_state(logic_t::STATE_INP_LH);
m_clrq = 0;
m_data = 0xFF;
}
@@ -136,3 +138,5 @@ NETLIB_UPDATE(74175_dip)
{
NETLIB_NAME(74175)::update();
}
+
+NETLIB_NAMESPACE_DEVICES_END()
diff --git a/src/emu/netlist/devices/nld_74175.h b/src/emu/netlist/devices/nld_74175.h
index 70951ac4d42..f74165a5839 100644
--- a/src/emu/netlist/devices/nld_74175.h
+++ b/src/emu/netlist/devices/nld_74175.h
@@ -39,16 +39,17 @@
#include "nld_signal.h"
#define TTL_74175(_name) \
- NET_REGISTER_DEV(74175, _name)
+ NET_REGISTER_DEV(TTL_74175, _name)
#define TTL_74175_DIP(_name) \
- NET_REGISTER_DEV(74175_dip, _name)
+ NET_REGISTER_DEV(TTL_74175_DIP, _name)
+NETLIB_NAMESPACE_DEVICES_START()
NETLIB_SUBDEVICE(74175_sub,
- netlist_logic_input_t m_CLK;
- netlist_logic_output_t m_Q[4];
- netlist_logic_output_t m_QQ[4];
+ logic_input_t m_CLK;
+ logic_output_t m_Q[4];
+ logic_output_t m_QQ[4];
netlist_sig_t m_clrq;
UINT8 m_data;
@@ -57,10 +58,12 @@ NETLIB_SUBDEVICE(74175_sub,
NETLIB_DEVICE(74175,
NETLIB_NAME(74175_sub) m_sub;
- netlist_logic_input_t m_D[4];
- netlist_logic_input_t m_CLRQ;
+ logic_input_t m_D[4];
+ logic_input_t m_CLRQ;
);
NETLIB_DEVICE_DERIVED_PURE(74175_dip, 74175);
+NETLIB_NAMESPACE_DEVICES_END()
+
#endif /* NLD_74175_H_ */
diff --git a/src/emu/netlist/devices/nld_74192.c b/src/emu/netlist/devices/nld_74192.c
index 785b0d48094..c07affc8b6a 100644
--- a/src/emu/netlist/devices/nld_74192.c
+++ b/src/emu/netlist/devices/nld_74192.c
@@ -9,6 +9,8 @@
#include "nld_74192.h"
+NETLIB_NAMESPACE_DEVICES_START()
+
NETLIB_START(74192)
{
register_sub("subABCD", m_ABCD);
@@ -42,7 +44,7 @@ NETLIB_RESET(74192)
}
// FIXME: Timing
-static const netlist_time delay[4] =
+/* static */ const netlist_time delay[4] =
{
NLTIME_FROM_NS(40),
NLTIME_FROM_NS(40),
@@ -130,3 +132,5 @@ NETLIB_RESET(74192_dip)
{
NETLIB_NAME(74192)::reset();
}
+
+NETLIB_NAMESPACE_DEVICES_END()
diff --git a/src/emu/netlist/devices/nld_74192.h b/src/emu/netlist/devices/nld_74192.h
index 10db69d775e..d5be6346cb2 100644
--- a/src/emu/netlist/devices/nld_74192.h
+++ b/src/emu/netlist/devices/nld_74192.h
@@ -33,29 +33,33 @@
#include "nld_9316.h"
#define TTL_74192(_name) \
- NET_REGISTER_DEV(74192, _name)
+ NET_REGISTER_DEV(TTL_74192, _name)
#define TTL_74192_DIP(_name) \
- NET_REGISTER_DEV(74192_dip, _name)
+ NET_REGISTER_DEV(TTL_74192_DIP, _name)
+
+NETLIB_NAMESPACE_DEVICES_START()
NETLIB_DEVICE(74192,
ATTR_HOT void update_outputs();
NETLIB_NAME(9316_subABCD) m_ABCD;
- netlist_logic_input_t m_CLEAR;
- netlist_logic_input_t m_LOADQ;
- netlist_logic_input_t m_CU;
- netlist_logic_input_t m_CD;
+ logic_input_t m_CLEAR;
+ logic_input_t m_LOADQ;
+ logic_input_t m_CU;
+ logic_input_t m_CD;
INT8 m_cnt;
UINT8 m_last_CU;
UINT8 m_last_CD;
- netlist_logic_output_t m_Q[4];
- netlist_logic_output_t m_BORROWQ;
- netlist_logic_output_t m_CARRYQ;
+ logic_output_t m_Q[4];
+ logic_output_t m_BORROWQ;
+ logic_output_t m_CARRYQ;
);
NETLIB_DEVICE_DERIVED_PURE(74192_dip, 74192);
+NETLIB_NAMESPACE_DEVICES_END()
+
#endif /* NLD_74192_H_ */
diff --git a/src/emu/netlist/devices/nld_74193.c b/src/emu/netlist/devices/nld_74193.c
index ccfd29b6feb..7a857dbe5a0 100644
--- a/src/emu/netlist/devices/nld_74193.c
+++ b/src/emu/netlist/devices/nld_74193.c
@@ -9,6 +9,8 @@
#include "nld_74193.h"
+NETLIB_NAMESPACE_DEVICES_START()
+
NETLIB_START(74193)
{
register_input("A", m_A);
@@ -130,3 +132,5 @@ NETLIB_RESET(74193_dip)
{
NETLIB_NAME(74193)::reset();
}
+
+NETLIB_NAMESPACE_DEVICES_END()
diff --git a/src/emu/netlist/devices/nld_74193.h b/src/emu/netlist/devices/nld_74193.h
index eaa22a06ea1..d97095b7230 100644
--- a/src/emu/netlist/devices/nld_74193.h
+++ b/src/emu/netlist/devices/nld_74193.h
@@ -29,32 +29,36 @@
#include "../nl_base.h"
#define TTL_74193(_name) \
- NET_REGISTER_DEV(74193, _name)
+ NET_REGISTER_DEV(TTL_74193, _name)
#define TTL_74193_DIP(_name) \
- NET_REGISTER_DEV(74193_dip, _name)
+ NET_REGISTER_DEV(TTL_74193_DIP, _name)
+
+NETLIB_NAMESPACE_DEVICES_START()
NETLIB_DEVICE(74193,
ATTR_HOT void update_outputs();
- netlist_logic_input_t m_A;
- netlist_logic_input_t m_B;
- netlist_logic_input_t m_C;
- netlist_logic_input_t m_D;
- netlist_logic_input_t m_CLEAR;
- netlist_logic_input_t m_LOADQ;
- netlist_logic_input_t m_CU;
- netlist_logic_input_t m_CD;
+ logic_input_t m_A;
+ logic_input_t m_B;
+ logic_input_t m_C;
+ logic_input_t m_D;
+ logic_input_t m_CLEAR;
+ logic_input_t m_LOADQ;
+ logic_input_t m_CU;
+ logic_input_t m_CD;
INT8 m_cnt;
UINT8 m_last_CU;
UINT8 m_last_CD;
- netlist_logic_output_t m_Q[4];
- netlist_logic_output_t m_BORROWQ;
- netlist_logic_output_t m_CARRYQ;
+ logic_output_t m_Q[4];
+ logic_output_t m_BORROWQ;
+ logic_output_t m_CARRYQ;
);
NETLIB_DEVICE_DERIVED_PURE(74193_dip, 74193);
+NETLIB_NAMESPACE_DEVICES_END()
+
#endif /* NLD_74193_H_ */
diff --git a/src/emu/netlist/devices/nld_7420.c b/src/emu/netlist/devices/nld_7420.c
index 59e649fc6f6..57a25b5d7b7 100644
--- a/src/emu/netlist/devices/nld_7420.c
+++ b/src/emu/netlist/devices/nld_7420.c
@@ -7,6 +7,8 @@
#include "nld_7420.h"
+NETLIB_NAMESPACE_DEVICES_START()
+
#if (USE_TRUTHTABLE)
nld_7420::truthtable_t nld_7420::m_ttbl;
const char *nld_7420::m_desc[] = {
@@ -25,19 +27,19 @@ NETLIB_START(7420_dip)
register_sub("1", m_1);
register_sub("2", m_2);
- register_subalias("1", m_1.m_i[0]);
- register_subalias("2", m_1.m_i[1]);
+ register_subalias("1", m_1.m_I[0]);
+ register_subalias("2", m_1.m_I[1]);
- register_subalias("4", m_1.m_i[2]);
- register_subalias("5", m_1.m_i[3]);
+ register_subalias("4", m_1.m_I[2]);
+ register_subalias("5", m_1.m_I[3]);
register_subalias("6", m_1.m_Q[0]);
register_subalias("8", m_2.m_Q[0]);
- register_subalias("9", m_2.m_i[0]);
- register_subalias("10", m_2.m_i[1]);
+ register_subalias("9", m_2.m_I[0]);
+ register_subalias("10", m_2.m_I[1]);
- register_subalias("12", m_2.m_i[2]);
- register_subalias("13", m_2.m_i[3]);
+ register_subalias("12", m_2.m_I[2]);
+ register_subalias("13", m_2.m_I[3]);
}
@@ -53,3 +55,5 @@ NETLIB_RESET(7420_dip)
m_1.do_reset();
m_2.do_reset();
}
+
+NETLIB_NAMESPACE_DEVICES_END()
diff --git a/src/emu/netlist/devices/nld_7420.h b/src/emu/netlist/devices/nld_7420.h
index c537cf7467b..2ce7020c7e5 100644
--- a/src/emu/netlist/devices/nld_7420.h
+++ b/src/emu/netlist/devices/nld_7420.h
@@ -34,29 +34,33 @@
#define NLD_7420_H_
#include "nld_signal.h"
+#include "nld_truthtable.h"
#define TTL_7420_NAND(_name, _I1, _I2, _I3, _I4) \
- NET_REGISTER_DEV(7420, _name) \
+ NET_REGISTER_DEV(TTL_7420_NAND, _name) \
NET_CONNECT(_name, A, _I1) \
NET_CONNECT(_name, B, _I2) \
NET_CONNECT(_name, C, _I3) \
NET_CONNECT(_name, D, _I4)
+#define TTL_7420_DIP(_name) \
+ NET_REGISTER_DEV(TTL_7420_DIP, _name)
+
+NETLIB_NAMESPACE_DEVICES_START()
+
#if (USE_TRUTHTABLE)
-#include "nld_truthtable.h"
NETLIB_TRUTHTABLE(7420, 4, 1, 0);
#else
NETLIB_SIGNAL(7420, 4, 0, 0);
#endif
-#define TTL_7420_DIP(_name) \
- NET_REGISTER_DEV(7420_dip, _name)
-
NETLIB_DEVICE(7420_dip,
NETLIB_NAME(7420) m_1;
NETLIB_NAME(7420) m_2;
);
+NETLIB_NAMESPACE_DEVICES_END()
+
#endif /* NLD_7420_H_ */
diff --git a/src/emu/netlist/devices/nld_7425.c b/src/emu/netlist/devices/nld_7425.c
index 59bb899c56b..c432960a02d 100644
--- a/src/emu/netlist/devices/nld_7425.c
+++ b/src/emu/netlist/devices/nld_7425.c
@@ -7,28 +7,30 @@
#include "nld_7425.h"
+NETLIB_NAMESPACE_DEVICES_START()
+
NETLIB_START(7425_dip)
{
register_sub("1", m_1);
register_sub("2", m_2);
- register_subalias("1", m_1.m_i[0]);
- register_subalias("2", m_1.m_i[1]);
+ register_subalias("1", m_1.m_I[0]);
+ register_subalias("2", m_1.m_I[1]);
//register_subalias("3", ); X1 ==> NC
- register_subalias("4", m_1.m_i[2]);
- register_subalias("5", m_1.m_i[3]);
+ register_subalias("4", m_1.m_I[2]);
+ register_subalias("5", m_1.m_I[3]);
register_subalias("6", m_1.m_Q[0]);
register_subalias("8", m_2.m_Q[0]);
- register_subalias("9", m_2.m_i[0]);
- register_subalias("10", m_2.m_i[1]);
+ register_subalias("9", m_2.m_I[0]);
+ register_subalias("10", m_2.m_I[1]);
//register_subalias("11", ); X2 ==> NC
- register_subalias("12", m_2.m_i[2]);
- register_subalias("13", m_2.m_i[3]);
+ register_subalias("12", m_2.m_I[2]);
+ register_subalias("13", m_2.m_I[3]);
}
@@ -44,3 +46,5 @@ NETLIB_RESET(7425_dip)
m_1.do_reset();
m_2.do_reset();
}
+
+NETLIB_NAMESPACE_DEVICES_END()
diff --git a/src/emu/netlist/devices/nld_7425.h b/src/emu/netlist/devices/nld_7425.h
index f7df8442851..816c0cba100 100644
--- a/src/emu/netlist/devices/nld_7425.h
+++ b/src/emu/netlist/devices/nld_7425.h
@@ -39,21 +39,25 @@
#include "nld_signal.h"
#define TTL_7425_NOR(_name, _I1, _I2, _I3, _I4) \
- NET_REGISTER_DEV(7425, _name) \
+ NET_REGISTER_DEV(TTL_7425_NOR, _name) \
NET_CONNECT(_name, A, _I1) \
NET_CONNECT(_name, B, _I2) \
NET_CONNECT(_name, C, _I3) \
NET_CONNECT(_name, D, _I4)
+#define TTL_7425_DIP(_name) \
+ NET_REGISTER_DEV(TTL_7425_DIP, _name)
-NETLIB_SIGNAL(7425, 4, 1, 0);
+NETLIB_NAMESPACE_DEVICES_START()
-#define TTL_7425_DIP(_name) \
- NET_REGISTER_DEV(7425_dip, _name)
+NETLIB_SIGNAL(7425, 4, 1, 0);
NETLIB_DEVICE(7425_dip,
NETLIB_NAME(7425) m_1;
NETLIB_NAME(7425) m_2;
);
+
+NETLIB_NAMESPACE_DEVICES_END()
+
#endif /* NLD_7425_H_ */
diff --git a/src/emu/netlist/devices/nld_7427.c b/src/emu/netlist/devices/nld_7427.c
index a363ddd5f3c..fb193f74679 100644
--- a/src/emu/netlist/devices/nld_7427.c
+++ b/src/emu/netlist/devices/nld_7427.c
@@ -9,6 +9,8 @@
#include "nld_7402.h"
+NETLIB_NAMESPACE_DEVICES_START()
+
#if (USE_TRUTHTABLE)
nld_7427::truthtable_t nld_7427::m_ttbl;
const char *nld_7427::m_desc[] = {
@@ -27,20 +29,20 @@ NETLIB_START(7427_dip)
register_sub("2", m_2);
register_sub("3", m_3);
- register_subalias("1", m_1.m_i[0]);
- register_subalias("2", m_1.m_i[1]);
- register_subalias("3", m_2.m_i[0]);
- register_subalias("4", m_2.m_i[1]);
- register_subalias("5", m_2.m_i[2]);
+ register_subalias("1", m_1.m_I[0]);
+ register_subalias("2", m_1.m_I[1]);
+ register_subalias("3", m_2.m_I[0]);
+ register_subalias("4", m_2.m_I[1]);
+ register_subalias("5", m_2.m_I[2]);
register_subalias("6", m_2.m_Q[0]);
register_subalias("8", m_3.m_Q[0]);
- register_subalias("9", m_3.m_i[0]);
- register_subalias("10", m_3.m_i[1]);
- register_subalias("11", m_3.m_i[2]);
+ register_subalias("9", m_3.m_I[0]);
+ register_subalias("10", m_3.m_I[1]);
+ register_subalias("11", m_3.m_I[2]);
register_subalias("12", m_1.m_Q[0]);
- register_subalias("13", m_1.m_i[2]);
+ register_subalias("13", m_1.m_I[2]);
}
NETLIB_UPDATE(7427_dip)
@@ -57,3 +59,5 @@ NETLIB_RESET(7427_dip)
m_2.do_reset();
m_3.do_reset();
}
+
+NETLIB_NAMESPACE_DEVICES_END()
diff --git a/src/emu/netlist/devices/nld_7427.h b/src/emu/netlist/devices/nld_7427.h
index 69d9618e246..6ba726a17fc 100644
--- a/src/emu/netlist/devices/nld_7427.h
+++ b/src/emu/netlist/devices/nld_7427.h
@@ -33,27 +33,33 @@
#define NLD_7427_H_
#include "nld_signal.h"
+#include "nld_truthtable.h"
#define TTL_7427_NOR(_name, _I1, _I2, _I3) \
- NET_REGISTER_DEV(7427, _name) \
+ NET_REGISTER_DEV(TTL_7427_NOR, _name) \
NET_CONNECT(_name, A, _I1) \
NET_CONNECT(_name, B, _I2) \
NET_CONNECT(_name, C, _I3)
+#define TTL_7427_DIP(_name) \
+ NET_REGISTER_DEV(TTL_7427_DIP, _name)
+
+NETLIB_NAMESPACE_DEVICES_START()
+
#if (USE_TRUTHTABLE)
-#include "nld_truthtable.h"
NETLIB_TRUTHTABLE(7427, 3, 1, 0);
#else
NETLIB_SIGNAL(7427, 3, 1, 0);
#endif
-#define TTL_7427_DIP(_name) \
- NET_REGISTER_DEV(7427_dip, _name)
-
NETLIB_DEVICE(7427_dip,
NETLIB_NAME(7427) m_1;
NETLIB_NAME(7427) m_2;
NETLIB_NAME(7427) m_3;
);
+
+NETLIB_NAMESPACE_DEVICES_END()
+
+
#endif /* NLD_7427_H_ */
diff --git a/src/emu/netlist/devices/nld_74279.c b/src/emu/netlist/devices/nld_74279.c
index 17fbc2e8b22..ca633cfa8be 100644
--- a/src/emu/netlist/devices/nld_74279.c
+++ b/src/emu/netlist/devices/nld_74279.c
@@ -7,6 +7,8 @@
#include "nld_74279.h"
+NETLIB_NAMESPACE_DEVICES_START()
+
nld_74279A::truthtable_t nld_74279A::m_ttbl;
nld_74279B::truthtable_t nld_74279B::m_ttbl;
@@ -125,23 +127,23 @@ NETLIB_START(74279_dip)
register_sub("3", m_3);
register_sub("4", m_4);
- register_subalias("1", m_1.m_i[2]); //R
- register_subalias("2", m_1.m_i[0]);
- register_subalias("3", m_1.m_i[1]);
+ register_subalias("1", m_1.m_I[2]); //R
+ register_subalias("2", m_1.m_I[0]);
+ register_subalias("3", m_1.m_I[1]);
register_subalias("4", m_1.m_Q[0]);
- register_subalias("5", m_2.m_i[1]); //R
- register_subalias("6", m_2.m_i[0]);
+ register_subalias("5", m_2.m_I[1]); //R
+ register_subalias("6", m_2.m_I[0]);
register_subalias("7", m_2.m_Q[0]);
register_subalias("9", m_3.m_Q[0]);
- register_subalias("10", m_3.m_i[2]); //R
- register_subalias("11", m_3.m_i[0]);
- register_subalias("12", m_3.m_i[1]);
+ register_subalias("10", m_3.m_I[2]); //R
+ register_subalias("11", m_3.m_I[0]);
+ register_subalias("12", m_3.m_I[1]);
register_subalias("13", m_4.m_Q[0]);
- register_subalias("14", m_4.m_i[1]); //R
- register_subalias("15", m_4.m_i[0]);
+ register_subalias("14", m_4.m_I[1]); //R
+ register_subalias("15", m_4.m_I[0]);
}
NETLIB_UPDATE(74279_dip)
@@ -160,3 +162,5 @@ NETLIB_RESET(74279_dip)
m_3.do_reset();
m_4.do_reset();
}
+
+NETLIB_NAMESPACE_DEVICES_END()
diff --git a/src/emu/netlist/devices/nld_74279.h b/src/emu/netlist/devices/nld_74279.h
index cee47fb7452..aecd8435f6d 100644
--- a/src/emu/netlist/devices/nld_74279.h
+++ b/src/emu/netlist/devices/nld_74279.h
@@ -38,6 +38,11 @@
#include "nld_truthtable.h"
+#define TTL_74279_DIP(_name) \
+ NET_REGISTER_DEV(TTL_74279_DIP, _name)
+
+NETLIB_NAMESPACE_DEVICES_START()
+
#if 0
NETLIB_TRUTHTABLE(74279A, 2, 1, 1);
NETLIB_TRUTHTABLE(74279B, 3, 1, 1);
@@ -47,8 +52,6 @@ NETLIB_TRUTHTABLE(74279B, 4, 1, 0);
//NETLIB_TRUTHTABLE(74279A, 4, 2, 0);
//NETLIB_TRUTHTABLE(74279B, 5, 2, 0);
#endif
-#define TTL_74279_DIP(_name) \
- NET_REGISTER_DEV(74279_dip, _name)
NETLIB_DEVICE(74279_dip,
@@ -58,4 +61,6 @@ NETLIB_DEVICE(74279_dip,
NETLIB_NAME(74279A) m_4;
);
+NETLIB_NAMESPACE_DEVICES_END()
+
#endif /* NLD_74279_H_ */
diff --git a/src/emu/netlist/devices/nld_7430.c b/src/emu/netlist/devices/nld_7430.c
index 06d73997ad5..31ea833cb27 100644
--- a/src/emu/netlist/devices/nld_7430.c
+++ b/src/emu/netlist/devices/nld_7430.c
@@ -7,6 +7,8 @@
#include "nld_7430.h"
+NETLIB_NAMESPACE_DEVICES_START()
+
#if (USE_TRUTHTABLE)
nld_7430::truthtable_t nld_7430::m_ttbl;
const char *nld_7430::m_desc[] = {
@@ -30,17 +32,17 @@ NETLIB_START(7430_dip)
{
register_sub("1", m_1);
- register_subalias("1", m_1.m_i[0]);
- register_subalias("2", m_1.m_i[1]);
- register_subalias("3", m_1.m_i[2]);
- register_subalias("4", m_1.m_i[3]);
- register_subalias("5", m_1.m_i[4]);
- register_subalias("6", m_1.m_i[5]);
+ register_subalias("1", m_1.m_I[0]);
+ register_subalias("2", m_1.m_I[1]);
+ register_subalias("3", m_1.m_I[2]);
+ register_subalias("4", m_1.m_I[3]);
+ register_subalias("5", m_1.m_I[4]);
+ register_subalias("6", m_1.m_I[5]);
register_subalias("8", m_1.m_Q[0]);
- register_subalias("11", m_1.m_i[6]);
- register_subalias("12", m_1.m_i[7]);
+ register_subalias("11", m_1.m_I[6]);
+ register_subalias("12", m_1.m_I[7]);
}
NETLIB_UPDATE(7430_dip)
@@ -53,3 +55,5 @@ NETLIB_RESET(7430_dip)
{
m_1.do_reset();
}
+
+NETLIB_NAMESPACE_DEVICES_END()
diff --git a/src/emu/netlist/devices/nld_7430.h b/src/emu/netlist/devices/nld_7430.h
index ed6e239a1b5..126aa491429 100644
--- a/src/emu/netlist/devices/nld_7430.h
+++ b/src/emu/netlist/devices/nld_7430.h
@@ -38,9 +38,10 @@
#define NLD_7430_H_
#include "nld_signal.h"
+#include "nld_truthtable.h"
#define TTL_7430_NAND(_name, _I1, _I2, _I3, _I4, _I5, _I6, _I7, _I8) \
- NET_REGISTER_DEV(7430, _name) \
+ NET_REGISTER_DEV(TTL_7430_NAND, _name) \
NET_CONNECT(_name, A, _I1) \
NET_CONNECT(_name, B, _I2) \
NET_CONNECT(_name, C, _I3) \
@@ -51,18 +52,24 @@
NET_CONNECT(_name, H, _I8)
+#define TTL_7430_DIP(_name) \
+ NET_REGISTER_DEV(TTL_7430_DIP, _name)
+
+NETLIB_NAMESPACE_DEVICES_START()
+
#if (USE_TRUTHTABLE)
-#include "nld_truthtable.h"
NETLIB_TRUTHTABLE(7430, 8, 1, 0);
#else
NETLIB_SIGNAL(7430, 8, 0, 0);
#endif
-#define TTL_7430_DIP(_name) \
- NET_REGISTER_DEV(7430_dip, _name)
NETLIB_DEVICE(7430_dip,
NETLIB_NAME(7430) m_1;
);
+
+NETLIB_NAMESPACE_DEVICES_END()
+
+
#endif /* NLD_7430_H_ */
diff --git a/src/emu/netlist/devices/nld_7432.c b/src/emu/netlist/devices/nld_7432.c
index e3dda241be7..d0b358482f8 100644
--- a/src/emu/netlist/devices/nld_7432.c
+++ b/src/emu/netlist/devices/nld_7432.c
@@ -7,6 +7,8 @@
#include "nld_7432.h"
+NETLIB_NAMESPACE_DEVICES_START()
+
#if (USE_TRUTHTABLE)
nld_7432::truthtable_t nld_7432::m_ttbl;
const char *nld_7432::m_desc[] = {
@@ -27,19 +29,19 @@ NETLIB_START(7432_dip)
register_sub("4", m_4);
register_subalias("3", m_1.m_Q[0]);
- register_subalias("1", m_1.m_i[0]);
- register_subalias("2", m_1.m_i[1]);
+ register_subalias("1", m_1.m_I[0]);
+ register_subalias("2", m_1.m_I[1]);
register_subalias("6", m_2.m_Q[0]);
- register_subalias("4", m_2.m_i[0]);
- register_subalias("5", m_2.m_i[1]);
+ register_subalias("4", m_2.m_I[0]);
+ register_subalias("5", m_2.m_I[1]);
- register_subalias("9", m_3.m_i[0]);
- register_subalias("10", m_3.m_i[1]);
+ register_subalias("9", m_3.m_I[0]);
+ register_subalias("10", m_3.m_I[1]);
register_subalias("8", m_3.m_Q[0]);
- register_subalias("12", m_4.m_i[0]);
- register_subalias("13", m_4.m_i[1]);
+ register_subalias("12", m_4.m_I[0]);
+ register_subalias("13", m_4.m_I[1]);
register_subalias("11", m_4.m_Q[0]);
}
@@ -59,3 +61,5 @@ NETLIB_RESET(7432_dip)
m_3.do_reset();
m_4.do_reset();
}
+
+NETLIB_NAMESPACE_DEVICES_END()
diff --git a/src/emu/netlist/devices/nld_7432.h b/src/emu/netlist/devices/nld_7432.h
index b81bc74cb26..f3655407143 100644
--- a/src/emu/netlist/devices/nld_7432.h
+++ b/src/emu/netlist/devices/nld_7432.h
@@ -33,18 +33,19 @@
#define NLD_7432_H_
#include "nld_signal.h"
+#include "nld_truthtable.h"
-#define TTL_7432_OR(_name, _I1, _I2) \
- NET_REGISTER_DEV(7432, _name) \
- NET_CONNECT(_name, A, _I1) \
+#define TTL_7432_OR(_name, _I1, _I2) \
+ NET_REGISTER_DEV(TTL_7432_OR, _name) \
+ NET_CONNECT(_name, A, _I1) \
NET_CONNECT(_name, B, _I2)
-#define TTL_7432_DIP(_name) \
- NET_REGISTER_DEV(7432_dip, _name)
+#define TTL_7432_DIP(_name) \
+ NET_REGISTER_DEV(TTL_7432_DIP, _name)
+NETLIB_NAMESPACE_DEVICES_START()
#if (USE_TRUTHTABLE)
-#include "nld_truthtable.h"
NETLIB_TRUTHTABLE(7432, 2, 1, 0);
#else
NETLIB_SIGNAL(7432, 2, 1, 1);
@@ -58,4 +59,6 @@ NETLIB_DEVICE(7432_dip,
NETLIB_NAME(7432) m_4;
);
+NETLIB_NAMESPACE_DEVICES_END()
+
#endif /* NLD_7432_H_ */
diff --git a/src/emu/netlist/devices/nld_7437.c b/src/emu/netlist/devices/nld_7437.c
index ba078f81d11..79fcaa5c4c5 100644
--- a/src/emu/netlist/devices/nld_7437.c
+++ b/src/emu/netlist/devices/nld_7437.c
@@ -7,6 +7,8 @@
#include "nld_7437.h"
+NETLIB_NAMESPACE_DEVICES_START()
+
#if (USE_TRUTHTABLE)
nld_7437::truthtable_t nld_7437::m_ttbl;
const char *nld_7437::m_desc[] = {
@@ -26,20 +28,20 @@ NETLIB_START(7437_dip)
register_sub("3", m_3);
register_sub("4", m_4);
- register_subalias("1", m_1.m_i[0]);
- register_subalias("2", m_1.m_i[1]);
+ register_subalias("1", m_1.m_I[0]);
+ register_subalias("2", m_1.m_I[1]);
register_subalias("3", m_1.m_Q[0]);
- register_subalias("4", m_2.m_i[0]);
- register_subalias("5", m_2.m_i[1]);
+ register_subalias("4", m_2.m_I[0]);
+ register_subalias("5", m_2.m_I[1]);
register_subalias("6", m_2.m_Q[0]);
- register_subalias("9", m_3.m_i[0]);
- register_subalias("10", m_3.m_i[1]);
+ register_subalias("9", m_3.m_I[0]);
+ register_subalias("10", m_3.m_I[1]);
register_subalias("8", m_3.m_Q[0]);
- register_subalias("12", m_4.m_i[0]);
- register_subalias("13", m_4.m_i[1]);
+ register_subalias("12", m_4.m_I[0]);
+ register_subalias("13", m_4.m_I[1]);
register_subalias("11", m_4.m_Q[0]);
}
@@ -59,3 +61,5 @@ NETLIB_RESET(7437_dip)
m_3.do_reset();
m_4.do_reset();
}
+
+NETLIB_NAMESPACE_DEVICES_END()
diff --git a/src/emu/netlist/devices/nld_7437.h b/src/emu/netlist/devices/nld_7437.h
index 03145ee8a8c..6b2f193b374 100644
--- a/src/emu/netlist/devices/nld_7437.h
+++ b/src/emu/netlist/devices/nld_7437.h
@@ -36,22 +36,24 @@
#define NLD_7437_H_
#include "nld_signal.h"
+#include "nld_truthtable.h"
#define TTL_7437_NAND(_name, _A, _B) \
- NET_REGISTER_DEV(7437, _name) \
+ NET_REGISTER_DEV(TTL_7437_NAND, _name) \
NET_CONNECT(_name, A, _A) \
NET_CONNECT(_name, B, _B)
+#define TTL_7437_DIP(_name) \
+ NET_REGISTER_DEV(TTL_7437_DIP, _name)
+
+NETLIB_NAMESPACE_DEVICES_START()
+
#if (USE_TRUTHTABLE)
-#include "nld_truthtable.h"
NETLIB_TRUTHTABLE(7437, 2, 1, 0);
#else
NETLIB_SIGNAL(7437, 2, 0, 0);
#endif
-#define TTL_7437_DIP(_name) \
- NET_REGISTER_DEV(7437_dip, _name)
-
NETLIB_DEVICE(7437_dip,
NETLIB_NAME(7437) m_1;
@@ -60,4 +62,6 @@ NETLIB_DEVICE(7437_dip,
NETLIB_NAME(7437) m_4;
);
+NETLIB_NAMESPACE_DEVICES_END()
+
#endif /* NLD_7437_H_ */
diff --git a/src/emu/netlist/devices/nld_7448.c b/src/emu/netlist/devices/nld_7448.c
index 7533449e8c5..618b61d8c6e 100644
--- a/src/emu/netlist/devices/nld_7448.c
+++ b/src/emu/netlist/devices/nld_7448.c
@@ -7,6 +7,8 @@
#include "nld_7448.h"
+NETLIB_NAMESPACE_DEVICES_START()
+
#if (0 && USE_TRUTHTABLE)
nld_7448::truthtable_t nld_7448::m_ttbl;
const char *nld_7448::m_desc[] = {
@@ -135,13 +137,11 @@ NETLIB_START(7448_sub)
register_output("g", m_Q[6]);
save(NLNAME(m_state));
- save(NLNAME(m_active));
}
NETLIB_RESET(7448_sub)
{
m_state = 0;
- m_active = 1;
}
NETLIB_UPDATE(7448_sub)
@@ -219,3 +219,5 @@ NETLIB_RESET(7448_dip)
{
NETLIB_NAME(7448)::reset();
}
+
+NETLIB_NAMESPACE_DEVICES_END()
diff --git a/src/emu/netlist/devices/nld_7448.h b/src/emu/netlist/devices/nld_7448.h
index 676da1ac184..f5bbdf50704 100644
--- a/src/emu/netlist/devices/nld_7448.h
+++ b/src/emu/netlist/devices/nld_7448.h
@@ -27,7 +27,7 @@
#include "../nl_base.h"
#define TTL_7448(_name, _A0, _A1, _A2, _A3, _LTQ, _BIQ, _RBIQ) \
- NET_REGISTER_DEV(7448, _name) \
+ NET_REGISTER_DEV(TTL_7448, _name) \
NET_CONNECT(_name, A, _A0) \
NET_CONNECT(_name, B, _A1) \
NET_CONNECT(_name, C, _A2) \
@@ -37,7 +37,7 @@
NET_CONNECT(_name, RBIQ, _RBIQ)
#define TTL_7448_DIP(_name) \
- NET_REGISTER_DEV(7448_dip, _name)
+ NET_REGISTER_DEV(TTL_7448_DIP, _name)
/*
* FIXME: Using truthtable is a lot slower than the explicit device
@@ -48,20 +48,21 @@
NETLIB_TRUTHTABLE(7448, 7, 7, 0);
#else
+NETLIB_NAMESPACE_DEVICES_START()
+
NETLIB_SUBDEVICE(7448_sub,
ATTR_HOT void update_outputs(UINT8 v);
static const UINT8 tab7448[16][7];
- netlist_logic_input_t m_A;
- netlist_logic_input_t m_B;
- netlist_logic_input_t m_C;
- netlist_logic_input_t m_D;
- netlist_logic_input_t m_RBIQ;
+ logic_input_t m_A;
+ logic_input_t m_B;
+ logic_input_t m_C;
+ logic_input_t m_D;
+ logic_input_t m_RBIQ;
UINT8 m_state;
- int m_active;
- netlist_logic_output_t m_Q[7]; /* a .. g */
+ logic_output_t m_Q[7]; /* a .. g */
);
@@ -69,10 +70,13 @@ NETLIB_DEVICE(7448,
public:
NETLIB_NAME(7448_sub) sub;
- netlist_logic_input_t m_LTQ;
- netlist_logic_input_t m_BIQ;
+ logic_input_t m_LTQ;
+ logic_input_t m_BIQ;
);
#endif
+
NETLIB_DEVICE_DERIVED_PURE(7448_dip, 7448);
+NETLIB_NAMESPACE_DEVICES_END()
+
#endif /* NLD_7448_H_ */
diff --git a/src/emu/netlist/devices/nld_7450.c b/src/emu/netlist/devices/nld_7450.c
index b854b04decc..30d7916acf0 100644
--- a/src/emu/netlist/devices/nld_7450.c
+++ b/src/emu/netlist/devices/nld_7450.c
@@ -7,6 +7,8 @@
#include "nld_7450.h"
+NETLIB_NAMESPACE_DEVICES_START()
+
NETLIB_START(7450)
{
register_input("A", m_A);
@@ -88,3 +90,5 @@ NETLIB_RESET(7450_dip)
m_1.do_reset();
m_2.do_reset();
}
+
+NETLIB_NAMESPACE_DEVICES_END()
diff --git a/src/emu/netlist/devices/nld_7450.h b/src/emu/netlist/devices/nld_7450.h
index 4a08f552d68..43b73636be3 100644
--- a/src/emu/netlist/devices/nld_7450.h
+++ b/src/emu/netlist/devices/nld_7450.h
@@ -27,22 +27,24 @@
#include "nld_signal.h"
#define TTL_7450_ANDORINVERT(_name, _I1, _I2, _I3, _I4) \
- NET_REGISTER_DEV(7450, _name) \
+ NET_REGISTER_DEV(TTL_7450_ANDORINVERT, _name) \
NET_CONNECT(_name, A, _I1) \
NET_CONNECT(_name, B, _I2) \
NET_CONNECT(_name, C, _I3) \
NET_CONNECT(_name, D, _I4)
#define TTL_7450_DIP(_name) \
- NET_REGISTER_DEV(7450_dip, _name)
+ NET_REGISTER_DEV(TTL_7450_DIP, _name)
+
+NETLIB_NAMESPACE_DEVICES_START()
NETLIB_DEVICE(7450,
public:
- netlist_logic_input_t m_A;
- netlist_logic_input_t m_B;
- netlist_logic_input_t m_C;
- netlist_logic_input_t m_D;
- netlist_logic_output_t m_Q;
+ logic_input_t m_A;
+ logic_input_t m_B;
+ logic_input_t m_C;
+ logic_input_t m_D;
+ logic_output_t m_Q;
);
NETLIB_DEVICE(7450_dip,
@@ -51,4 +53,6 @@ NETLIB_DEVICE(7450_dip,
NETLIB_NAME(7450) m_2;
);
+NETLIB_NAMESPACE_DEVICES_END()
+
#endif /* NLD_7450_H_ */
diff --git a/src/emu/netlist/devices/nld_7474.c b/src/emu/netlist/devices/nld_7474.c
index 1aeb628030f..11088c89a79 100644
--- a/src/emu/netlist/devices/nld_7474.c
+++ b/src/emu/netlist/devices/nld_7474.c
@@ -7,6 +7,8 @@
#include "nld_7474.h"
+NETLIB_NAMESPACE_DEVICES_START()
+
ATTR_HOT inline void NETLIB_NAME(7474sub)::newstate(const UINT8 stateQ, const UINT8 stateQQ)
{
// 0: High-to-low 40 ns, 1: Low-to-high 25 ns
@@ -83,12 +85,9 @@ NETLIB_START(7474sub)
NETLIB_RESET(7474sub)
{
- m_CLK.set_state(netlist_logic_t::STATE_INP_LH);
+ m_CLK.set_state(logic_t::STATE_INP_LH);
m_nextD = 0;
- /* FIXME: required by pong doubles - need a mechanism to set this from netlist */
- //m_Q.initial(1);
- //m_QQ.initial(1);
}
NETLIB_START(7474_dip)
@@ -124,3 +123,5 @@ NETLIB_UPDATE(7474_dip)
m_1.update_dev();
m_2.update_dev();
}
+
+NETLIB_NAMESPACE_DEVICES_END()
diff --git a/src/emu/netlist/devices/nld_7474.h b/src/emu/netlist/devices/nld_7474.h
index a4c4e44466f..f98de117350 100644
--- a/src/emu/netlist/devices/nld_7474.h
+++ b/src/emu/netlist/devices/nld_7474.h
@@ -45,21 +45,23 @@
#include "nld_signal.h"
#define TTL_7474(_name, _CLK, _D, _CLRQ, _PREQ) \
- NET_REGISTER_DEV(7474, _name) \
+ NET_REGISTER_DEV(TTL_7474, _name) \
NET_CONNECT(_name, CLK, _CLK) \
NET_CONNECT(_name, D, _D) \
NET_CONNECT(_name, CLRQ, _CLRQ) \
NET_CONNECT(_name, PREQ, _PREQ)
#define TTL_7474_DIP(_name) \
- NET_REGISTER_DEV(7474_dip, _name)
+ NET_REGISTER_DEV(TTL_7474_DIP, _name)
+
+NETLIB_NAMESPACE_DEVICES_START()
NETLIB_SUBDEVICE(7474sub,
- netlist_logic_input_t m_CLK;
+ logic_input_t m_CLK;
INT8 m_nextD;
- netlist_logic_output_t m_Q;
- netlist_logic_output_t m_QQ;
+ logic_output_t m_Q;
+ logic_output_t m_QQ;
ATTR_HOT inline void newstate(const UINT8 stateQ, const UINT8 stateQQ);
);
@@ -68,9 +70,9 @@ NETLIB_DEVICE(7474,
public:
NETLIB_NAME(7474sub) sub;
- netlist_logic_input_t m_D;
- netlist_logic_input_t m_CLRQ;
- netlist_logic_input_t m_PREQ;
+ logic_input_t m_D;
+ logic_input_t m_CLRQ;
+ logic_input_t m_PREQ;
);
NETLIB_DEVICE(7474_dip,
@@ -79,4 +81,6 @@ NETLIB_DEVICE(7474_dip,
NETLIB_NAME(7474) m_2;
);
+NETLIB_NAMESPACE_DEVICES_END()
+
#endif /* NLD_7474_H_ */
diff --git a/src/emu/netlist/devices/nld_7483.c b/src/emu/netlist/devices/nld_7483.c
index fc7dbc06a3a..97c6b41b29a 100644
--- a/src/emu/netlist/devices/nld_7483.c
+++ b/src/emu/netlist/devices/nld_7483.c
@@ -7,6 +7,8 @@
#include "nld_7483.h"
+NETLIB_NAMESPACE_DEVICES_START()
+
NETLIB_START(7483)
{
register_input("A1", m_A1);
@@ -83,3 +85,5 @@ NETLIB_RESET(7483_dip)
{
NETLIB_NAME(7483)::reset();
}
+
+NETLIB_NAMESPACE_DEVICES_END()
diff --git a/src/emu/netlist/devices/nld_7483.h b/src/emu/netlist/devices/nld_7483.h
index d887c72f0a9..9bbefc88b1d 100644
--- a/src/emu/netlist/devices/nld_7483.h
+++ b/src/emu/netlist/devices/nld_7483.h
@@ -30,7 +30,7 @@
#include "../nl_base.h"
#define TTL_7483(_name, _A1, _A2, _A3, _A4, _B1, _B2, _B3, _B4, _CI) \
- NET_REGISTER_DEV(7483, _name) \
+ NET_REGISTER_DEV(TTL_7483, _name) \
NET_CONNECT(_name, A1, _A1) \
NET_CONNECT(_name, A2, _A2) \
NET_CONNECT(_name, A3, _A3) \
@@ -42,29 +42,33 @@
NET_CONNECT(_name, C0, _CI)
#define TTL_7483_DIP(_name) \
- NET_REGISTER_DEV(7483_dip, _name)
+ NET_REGISTER_DEV(TTL_7483_DIP, _name)
+
+NETLIB_NAMESPACE_DEVICES_START()
NETLIB_DEVICE(7483,
- netlist_logic_input_t m_C0;
- netlist_logic_input_t m_A1;
- netlist_logic_input_t m_A2;
- netlist_logic_input_t m_A3;
- netlist_logic_input_t m_A4;
- netlist_logic_input_t m_B1;
- netlist_logic_input_t m_B2;
- netlist_logic_input_t m_B3;
- netlist_logic_input_t m_B4;
+ logic_input_t m_C0;
+ logic_input_t m_A1;
+ logic_input_t m_A2;
+ logic_input_t m_A3;
+ logic_input_t m_A4;
+ logic_input_t m_B1;
+ logic_input_t m_B2;
+ logic_input_t m_B3;
+ logic_input_t m_B4;
UINT8 m_lastr;
- netlist_logic_output_t m_S1;
- netlist_logic_output_t m_S2;
- netlist_logic_output_t m_S3;
- netlist_logic_output_t m_S4;
- netlist_logic_output_t m_C4;
+ logic_output_t m_S1;
+ logic_output_t m_S2;
+ logic_output_t m_S3;
+ logic_output_t m_S4;
+ logic_output_t m_C4;
);
NETLIB_DEVICE_DERIVED_PURE(7483_dip, 7483);
+NETLIB_NAMESPACE_DEVICES_END()
+
#endif /* NLD_7483_H_ */
diff --git a/src/emu/netlist/devices/nld_7486.c b/src/emu/netlist/devices/nld_7486.c
index e4009b22180..5957c2c0433 100644
--- a/src/emu/netlist/devices/nld_7486.c
+++ b/src/emu/netlist/devices/nld_7486.c
@@ -7,11 +7,24 @@
#include "nld_7486.h"
+NETLIB_NAMESPACE_DEVICES_START()
+
+#if (USE_TRUTHTABLE)
+nld_7486::truthtable_t nld_7486::m_ttbl;
+const char *nld_7486::m_desc[] = {
+ "A , B | Q ",
+ "0,0|0|15",
+ "0,1|1|22",
+ "1,0|1|22",
+ "1,1|0|15",
+ ""
+};
+#else
NETLIB_START(7486)
{
- register_input("A", m_A);
- register_input("B", m_B);
- register_output("Q", m_Q);
+ register_input("A", m_I[0]);
+ register_input("B", m_I[1]);
+ register_output("Q", m_Q[0]);
save(NLNAME(m_active));
}
@@ -25,10 +38,41 @@ NETLIB_UPDATE(7486)
{
const netlist_time delay[2] = { NLTIME_FROM_NS(15), NLTIME_FROM_NS(22) };
- UINT8 t = INPLOGIC(m_A) ^ INPLOGIC(m_B);
- OUTLOGIC(m_Q, t, delay[t]);
+ UINT8 t = INPLOGIC(m_I[0]) ^ INPLOGIC(m_I[1]);
+ OUTLOGIC(m_Q[0], t, delay[t]);
}
+ATTR_HOT void NETLIB_NAME(7486)::inc_active()
+{
+ const netlist_time delay[2] = { NLTIME_FROM_NS(15), NLTIME_FROM_NS(22) };
+ nl_assert(netlist().use_deactivate());
+ if (++m_active == 1)
+ {
+ m_I[0].activate();
+ m_I[1].activate();
+
+ netlist_time mt = this->m_I[0].net().time();
+ if (this->m_I[1].net().time() > mt)
+ mt = this->m_I[1].net().time();
+
+ UINT8 t = INPLOGIC(m_I[0]) ^ INPLOGIC(m_I[1]);
+ m_Q[0].net().set_Q_time(t, mt + delay[t]);
+ }
+}
+
+ATTR_HOT void NETLIB_NAME(7486)::dec_active()
+{
+#if 1
+ nl_assert(netlist().use_deactivate());
+ if (--m_active == 0)
+ {
+ m_I[0].inactivate();
+ m_I[1].inactivate();
+ }
+#endif
+}
+#endif
+
NETLIB_START(7486_dip)
{
register_sub("1", m_1);
@@ -36,21 +80,21 @@ NETLIB_START(7486_dip)
register_sub("3", m_3);
register_sub("4", m_4);
- register_subalias("1", m_1.m_A);
- register_subalias("2", m_1.m_B);
- register_subalias("3", m_1.m_Q);
+ register_subalias("1", m_1.m_I[0]);
+ register_subalias("2", m_1.m_I[1]);
+ register_subalias("3", m_1.m_Q[0]);
- register_subalias("4", m_2.m_A);
- register_subalias("5", m_2.m_B);
- register_subalias("6", m_2.m_Q);
+ register_subalias("4", m_2.m_I[0]);
+ register_subalias("5", m_2.m_I[1]);
+ register_subalias("6", m_2.m_Q[0]);
- register_subalias("9", m_3.m_A);
- register_subalias("10", m_3.m_B);
- register_subalias("8", m_3.m_Q);
+ register_subalias("9", m_3.m_I[0]);
+ register_subalias("10", m_3.m_I[1]);
+ register_subalias("8", m_3.m_Q[0]);
- register_subalias("12", m_4.m_A);
- register_subalias("13", m_4.m_B);
- register_subalias("11", m_4.m_Q);
+ register_subalias("12", m_4.m_I[0]);
+ register_subalias("13", m_4.m_I[1]);
+ register_subalias("11", m_4.m_Q[0]);
}
NETLIB_UPDATE(7486_dip)
@@ -70,32 +114,4 @@ NETLIB_RESET(7486_dip)
m_4.do_reset();
}
-ATTR_HOT void NETLIB_NAME(7486)::inc_active()
-{
- const netlist_time delay[2] = { NLTIME_FROM_NS(15), NLTIME_FROM_NS(22) };
- nl_assert(netlist().use_deactivate());
- if (++m_active == 1)
- {
- m_A.activate();
- m_B.activate();
-
- netlist_time mt = this->m_A.net().time();
- if (this->m_B.net().time() > mt)
- mt = this->m_B.net().time();
-
- UINT8 t = INPLOGIC(m_A) ^ INPLOGIC(m_B);
- m_Q.net().set_Q_time(t, mt + delay[t]);
- }
-}
-
-ATTR_HOT void NETLIB_NAME(7486)::dec_active()
-{
-#if 1
- nl_assert(netlist().use_deactivate());
- if (--m_active == 0)
- {
- m_A.inactivate();
- m_B.inactivate();
- }
-#endif
-}
+NETLIB_NAMESPACE_DEVICES_END()
diff --git a/src/emu/netlist/devices/nld_7486.h b/src/emu/netlist/devices/nld_7486.h
index 5febda494f9..788b633dfe1 100644
--- a/src/emu/netlist/devices/nld_7486.h
+++ b/src/emu/netlist/devices/nld_7486.h
@@ -33,25 +33,32 @@
#define NLD_7486_H_
#include "nld_signal.h"
+#include "nld_truthtable.h"
#define TTL_7486_XOR(_name, _A, _B) \
- NET_REGISTER_DEV(7486, _name) \
+ NET_REGISTER_DEV(TTL_7486_XOR, _name) \
NET_CONNECT(_name, A, _A) \
NET_CONNECT(_name, B, _B)
+
+#define TTL_7486_DIP(_name) \
+ NET_REGISTER_DEV(TTL_7486_DIP, _name)
+
+NETLIB_NAMESPACE_DEVICES_START()
+
+#if (USE_TRUTHTABLE)
+NETLIB_TRUTHTABLE(7486, 2, 1, 0);
+#else
NETLIB_DEVICE(7486,
public:
- netlist_logic_input_t m_A;
- netlist_logic_input_t m_B;
- netlist_logic_output_t m_Q;
+ netlist_logic_input_t m_I[2];
+ netlist_logic_output_t m_Q[1];
ATTR_HOT void inc_active();
ATTR_HOT void dec_active();
int m_active;
);
-
-#define TTL_7486_DIP(_name) \
- NET_REGISTER_DEV(7486_dip, _name)
+#endif
NETLIB_DEVICE(7486_dip,
@@ -61,4 +68,6 @@ NETLIB_DEVICE(7486_dip,
NETLIB_NAME(7486) m_4;
);
+NETLIB_NAMESPACE_DEVICES_END()
+
#endif /* NLD_7486_H_ */
diff --git a/src/emu/netlist/devices/nld_7490.c b/src/emu/netlist/devices/nld_7490.c
index 03317c96040..a054247a070 100644
--- a/src/emu/netlist/devices/nld_7490.c
+++ b/src/emu/netlist/devices/nld_7490.c
@@ -7,6 +7,8 @@
#include "nld_7490.h"
+NETLIB_NAMESPACE_DEVICES_START()
+
NETLIB_START(7490)
{
register_input("A", m_A);
@@ -43,6 +45,9 @@ static const netlist_time delay[4] =
NETLIB_UPDATE(7490)
{
+ const netlist_sig_t new_A = INPLOGIC(m_A);
+ const netlist_sig_t new_B = INPLOGIC(m_B);
+
if (INPLOGIC(m_R91) & INPLOGIC(m_R92))
{
m_cnt = 9;
@@ -53,20 +58,23 @@ NETLIB_UPDATE(7490)
m_cnt = 0;
update_outputs();
}
- else if (m_last_A && !INPLOGIC(m_A)) // High - Low
- {
- m_cnt ^= 1;
- OUTLOGIC(m_Q[0], m_cnt & 1, delay[0]);
- }
- else if (m_last_B && !INPLOGIC(m_B)) // High - Low
+ else
{
- m_cnt += 2;
- if (m_cnt >= 10)
- m_cnt = 0;
- update_outputs();
+ if (m_last_A && !new_A) // High - Low
+ {
+ m_cnt ^= 1;
+ OUTLOGIC(m_Q[0], m_cnt & 1, delay[0]);
+ }
+ if (m_last_B && !new_B) // High - Low
+ {
+ m_cnt += 2;
+ if (m_cnt >= 10)
+ m_cnt &= 1; /* Output A is not reset! */
+ update_outputs();
+ }
}
- m_last_A = INPLOGIC(m_A);
- m_last_B = INPLOGIC(m_B);
+ m_last_A = new_A;
+ m_last_B = new_B;
}
NETLIB_FUNC_VOID(7490, update_outputs, (void))
@@ -85,7 +93,7 @@ NETLIB_START(7490_dip)
// register_subalias("4", ); --> NC
// register_subalias("5", ); --> VCC
register_subalias("6", m_R91);
- register_subalias("7", m_R92);
+ register_subalias("7", m_R92);
register_subalias("8", m_Q[2]);
register_subalias("9", m_Q[1]);
@@ -106,3 +114,5 @@ NETLIB_RESET(7490_dip)
{
NETLIB_NAME(7490)::reset();
}
+
+NETLIB_NAMESPACE_DEVICES_END()
diff --git a/src/emu/netlist/devices/nld_7490.h b/src/emu/netlist/devices/nld_7490.h
index 81398d69bd8..72650c3dcbe 100644
--- a/src/emu/netlist/devices/nld_7490.h
+++ b/src/emu/netlist/devices/nld_7490.h
@@ -58,7 +58,7 @@
#include "../nl_base.h"
#define TTL_7490(_name, _A, _B, _R1, _R2, _R91, _R92) \
- NET_REGISTER_DEV(7490, _name) \
+ NET_REGISTER_DEV(TTL_7490, _name) \
NET_CONNECT(_name, A, _A) \
NET_CONNECT(_name, B, _B) \
NET_CONNECT(_name, R1, _R1) \
@@ -67,26 +67,29 @@
NET_CONNECT(_name, R92, _R92)
#define TTL_7490_DIP(_name) \
- NET_REGISTER_DEV(7490_dip, _name)
+ NET_REGISTER_DEV(TTL_7490_DIP, _name)
+NETLIB_NAMESPACE_DEVICES_START()
NETLIB_DEVICE(7490,
ATTR_HOT void update_outputs();
- netlist_logic_input_t m_R1;
- netlist_logic_input_t m_R2;
- netlist_logic_input_t m_R91;
- netlist_logic_input_t m_R92;
- netlist_logic_input_t m_A;
- netlist_logic_input_t m_B;
+ logic_input_t m_R1;
+ logic_input_t m_R2;
+ logic_input_t m_R91;
+ logic_input_t m_R92;
+ logic_input_t m_A;
+ logic_input_t m_B;
UINT8 m_cnt;
UINT8 m_last_A;
UINT8 m_last_B;
- netlist_logic_output_t m_Q[4];
+ logic_output_t m_Q[4];
);
NETLIB_DEVICE_DERIVED_PURE(7490_dip, 7490);
+NETLIB_NAMESPACE_DEVICES_END()
+
#endif /* NLD_7490_H_ */
diff --git a/src/emu/netlist/devices/nld_7493.c b/src/emu/netlist/devices/nld_7493.c
index 7f5be72fd6a..83a7ae1012c 100644
--- a/src/emu/netlist/devices/nld_7493.c
+++ b/src/emu/netlist/devices/nld_7493.c
@@ -8,6 +8,8 @@
#include "nld_7493.h"
#include "../nl_setup.h"
+NETLIB_NAMESPACE_DEVICES_START()
+
NETLIB_START(7493)
{
register_sub("A", A);
@@ -25,8 +27,8 @@ NETLIB_START(7493)
register_subalias("QC", C.m_Q);
register_subalias("QD", D.m_Q);
- connect(C.m_I, B.m_Q);
- connect(D.m_I, C.m_Q);
+ connect_late(C.m_I, B.m_Q);
+ connect_late(D.m_I, C.m_Q);
}
NETLIB_RESET(7493)
@@ -43,19 +45,24 @@ NETLIB_START(7493ff)
register_output("Q", m_Q);
save(NLNAME(m_reset));
+ save(NLNAME(m_state));
}
NETLIB_RESET(7493ff)
{
m_reset = 1;
- m_I.set_state(netlist_logic_t::STATE_INP_HL);
+ m_state = 0;
+ m_I.set_state(logic_t::STATE_INP_HL);
}
NETLIB_UPDATE(7493ff)
{
const netlist_time out_delay = NLTIME_FROM_NS(18);
- //if (m_reset == 0)
- OUTLOGIC(m_Q, (!m_Q.net().as_logic().new_Q()) & m_reset, out_delay);
+ if (m_reset != 0)
+ {
+ m_state ^= 1;
+ OUTLOGIC(m_Q, m_state, out_delay);
+ }
}
NETLIB_UPDATE(7493)
@@ -71,6 +78,7 @@ NETLIB_UPDATE(7493)
OUTLOGIC(C.m_Q, 0, NLTIME_FROM_NS(40));
OUTLOGIC(D.m_Q, 0, NLTIME_FROM_NS(40));
A.m_reset = B.m_reset = C.m_reset = D.m_reset = 0;
+ A.m_state = B.m_state = C.m_state = D.m_state = 0;
}
else
{
@@ -112,3 +120,5 @@ NETLIB_RESET(7493_dip)
{
NETLIB_NAME(7493)::reset();
}
+
+NETLIB_NAMESPACE_DEVICES_END()
diff --git a/src/emu/netlist/devices/nld_7493.h b/src/emu/netlist/devices/nld_7493.h
index 1cdb1594076..a54593c7c1f 100644
--- a/src/emu/netlist/devices/nld_7493.h
+++ b/src/emu/netlist/devices/nld_7493.h
@@ -60,25 +60,28 @@
#include "../nl_base.h"
#define TTL_7493(_name, _CLKA, _CLKB, _R1, _R2) \
- NET_REGISTER_DEV(7493, _name) \
+ NET_REGISTER_DEV(TTL_7493, _name) \
NET_CONNECT(_name, CLKA, _CLKA) \
NET_CONNECT(_name, CLKB, _CLKB) \
NET_CONNECT(_name, R1, _R1) \
NET_CONNECT(_name, R2, _R2)
#define TTL_7493_DIP(_name) \
- NET_REGISTER_DEV(7493_dip, _name)
+ NET_REGISTER_DEV(TTL_7493_DIP, _name)
+
+NETLIB_NAMESPACE_DEVICES_START()
NETLIB_SUBDEVICE(7493ff,
- netlist_logic_input_t m_I;
- netlist_logic_output_t m_Q;
+ logic_input_t m_I;
+ logic_output_t m_Q;
UINT8 m_reset;
+ UINT8 m_state;
);
NETLIB_DEVICE(7493,
- netlist_logic_input_t m_R1;
- netlist_logic_input_t m_R2;
+ logic_input_t m_R1;
+ logic_input_t m_R2;
NETLIB_NAME(7493ff) A;
NETLIB_NAME(7493ff) B;
@@ -88,5 +91,7 @@ NETLIB_DEVICE(7493,
NETLIB_DEVICE_DERIVED_PURE(7493_dip, 7493);
+NETLIB_NAMESPACE_DEVICES_END()
+
#endif /* NLD_7493_H_ */
diff --git a/src/emu/netlist/devices/nld_74ls629.c b/src/emu/netlist/devices/nld_74ls629.c
index 31f66c562e3..5ee1e1679db 100644
--- a/src/emu/netlist/devices/nld_74ls629.c
+++ b/src/emu/netlist/devices/nld_74ls629.c
@@ -42,12 +42,14 @@
#include "nld_74ls629.h"
#include "../nl_setup.h"
+NETLIB_NAMESPACE_DEVICES_START()
+
NETLIB_START(SN74LS629clk)
{
register_input("FB", m_FB);
register_output("Y", m_Y);
- connect(m_FB, m_Y);
+ connect_late(m_FB, m_Y);
reset();
@@ -87,9 +89,9 @@ NETLIB_START(SN74LS629)
register_input("FC", m_FC);
register_subalias("GND", m_R_FC.m_N);
- connect(m_FC, m_R_FC.m_P);
- connect(m_RNG, m_R_RNG.m_P);
- connect(m_R_FC.m_N, m_R_RNG.m_N);
+ connect_late(m_FC, m_R_FC.m_P);
+ connect_late(m_RNG, m_R_RNG.m_P);
+ connect_late(m_R_FC.m_N, m_R_RNG.m_N);
register_subalias("Y", m_clock.m_Y);
register_param("CAP", m_CAP, 1e-6);
@@ -141,14 +143,14 @@ NETLIB_UPDATE(SN74LS629)
freq += k9 * v_rng * v_freq_3;
freq += k10 * v_rng * v_freq_4;
- freq *= NL_FCONST(0.1e-6) / m_CAP.Value();
+ freq *= NL_FCONST(0.1e-6) / m_CAP;
// FIXME: we need a possibility to remove entries from queue ...
// or an exact model ...
m_clock.m_inc = netlist_time::from_double(0.5 / (double) freq);
//m_clock.update();
- NL_VERBOSE_OUT(("%s %f %f %f\n", name().cstr(), v_freq, v_rng, freq));
+ //NL_VERBOSE_OUT(("%s %f %f %f\n", name().cstr(), v_freq, v_rng, freq));
}
if (!m_clock.m_enableq && INPLOGIC(m_ENQ))
@@ -187,7 +189,7 @@ NETLIB_START(SN74LS629_dip)
register_subalias("8", m_1.m_R_FC.m_N);
register_subalias("9", m_1.m_R_FC.m_N);
- connect(m_1.m_R_FC.m_N, m_2.m_R_FC.m_N);
+ connect_late(m_1.m_R_FC.m_N, m_2.m_R_FC.m_N);
register_subalias("10", m_2.m_clock.m_Y);
@@ -205,3 +207,5 @@ NETLIB_RESET(SN74LS629_dip)
m_1.do_reset();
m_2.do_reset();
}
+
+NETLIB_NAMESPACE_DEVICES_END()
diff --git a/src/emu/netlist/devices/nld_74ls629.h b/src/emu/netlist/devices/nld_74ls629.h
index c571b5c29ed..11c74bb8246 100644
--- a/src/emu/netlist/devices/nld_74ls629.h
+++ b/src/emu/netlist/devices/nld_74ls629.h
@@ -35,9 +35,11 @@
NET_REGISTER_DEV(SN74LS629, _name) \
NETDEV_PARAMI(_name, CAP, _cap)
+NETLIB_NAMESPACE_DEVICES_START()
+
NETLIB_SUBDEVICE(SN74LS629clk,
- netlist_logic_input_t m_FB;
- netlist_logic_output_t m_Y;
+ logic_input_t m_FB;
+ logic_output_t m_Y;
netlist_time m_inc;
netlist_sig_t m_enableq;
@@ -50,15 +52,15 @@ public:
NETLIB_NAME(R_base) m_R_FC;
NETLIB_NAME(R_base) m_R_RNG;
- netlist_logic_input_t m_ENQ;
- netlist_analog_input_t m_RNG;
- netlist_analog_input_t m_FC;
+ logic_input_t m_ENQ;
+ analog_input_t m_RNG;
+ analog_input_t m_FC;
- netlist_param_double_t m_CAP;
+ param_double_t m_CAP;
);
#define SN74LS629_DIP(_name, _cap1, _cap2) \
- NET_REGISTER_DEV(SN74LS629_dip, _name) \
+ NET_REGISTER_DEV(SN74LS629_DIP, _name) \
NETDEV_PARAMI(_name, 1.CAP, _cap1) \
NETDEV_PARAMI(_name, 2.CAP, _cap2)
@@ -67,5 +69,7 @@ NETLIB_DEVICE(SN74LS629_dip,
NETLIB_NAME(SN74LS629) m_2;
);
+NETLIB_NAMESPACE_DEVICES_END()
+
#endif /* NLD_74LS629_H_ */
diff --git a/src/emu/netlist/devices/nld_82S16.c b/src/emu/netlist/devices/nld_82S16.c
index a9f7b7c9072..07990ffa598 100644
--- a/src/emu/netlist/devices/nld_82S16.c
+++ b/src/emu/netlist/devices/nld_82S16.c
@@ -7,7 +7,7 @@
#include "nld_82S16.h"
-//static const netlist_time delay[2] = { NLTIME_FROM_NS(40), NLTIME_FROM_NS(25) };
+NETLIB_NAMESPACE_DEVICES_START()
// FIXME: timing!
// FIXME: optimize device (separate address decoder!)
@@ -100,3 +100,5 @@ NETLIB_UPDATE(82S16_dip)
{
NETLIB_NAME(82S16)::update();
}
+
+NETLIB_NAMESPACE_DEVICES_END()
diff --git a/src/emu/netlist/devices/nld_82S16.h b/src/emu/netlist/devices/nld_82S16.h
index 1f4b443c991..0c0963498c9 100644
--- a/src/emu/netlist/devices/nld_82S16.h
+++ b/src/emu/netlist/devices/nld_82S16.h
@@ -27,19 +27,21 @@
#include "../nl_base.h"
#define TTL_82S16(_name) \
- NET_REGISTER_DEV(82S16, _name)
+ NET_REGISTER_DEV(TTL_82S16, _name)
#define TTL_82S16_DIP(_name) \
- NET_REGISTER_DEV(82S16_dip, _name)
+ NET_REGISTER_DEV(TTL_82S16_DIP, _name)
+
+NETLIB_NAMESPACE_DEVICES_START()
NETLIB_DEVICE(82S16,
- netlist_logic_input_t m_A[8];
- netlist_logic_input_t m_CE1Q;
- netlist_logic_input_t m_CE2Q;
- netlist_logic_input_t m_CE3Q;
- netlist_logic_input_t m_WEQ;
- netlist_logic_input_t m_DIN;
- netlist_logic_output_t m_DOUTQ;
+ logic_input_t m_A[8];
+ logic_input_t m_CE1Q;
+ logic_input_t m_CE2Q;
+ logic_input_t m_CE3Q;
+ logic_input_t m_WEQ;
+ logic_input_t m_DIN;
+ logic_output_t m_DOUTQ;
//netlist_state_t<UINT8[256]> m_ram;
UINT8 m_ram[256];
@@ -47,4 +49,6 @@ NETLIB_DEVICE(82S16,
NETLIB_DEVICE_DERIVED_PURE(82S16_dip, 82S16);
+NETLIB_NAMESPACE_DEVICES_END()
+
#endif /* NLD_82S16_H_ */
diff --git a/src/emu/netlist/devices/nld_9310.c b/src/emu/netlist/devices/nld_9310.c
index 42787be9157..586f1b47c05 100644
--- a/src/emu/netlist/devices/nld_9310.c
+++ b/src/emu/netlist/devices/nld_9310.c
@@ -9,6 +9,8 @@
#define MAXCNT 9
+NETLIB_NAMESPACE_DEVICES_START()
+
NETLIB_START(9310)
{
register_sub("subABCD", subABCD);
@@ -81,7 +83,7 @@ NETLIB_START(9310_sub)
NETLIB_RESET(9310_sub)
{
- m_CLK.set_state(netlist_logic_t::STATE_INP_LH);
+ m_CLK.set_state(logic_t::STATE_INP_LH);
m_cnt = 0;
m_loadq = 1;
m_ent = 1;
@@ -156,7 +158,7 @@ inline NETLIB_FUNC_VOID(9310_sub, update_outputs_all, (const UINT8 cnt, const ne
inline NETLIB_FUNC_VOID(9310_sub, update_outputs, (const UINT8 cnt))
{
- static const netlist_time out_delay = NLTIME_FROM_NS(20);
+ /* static */ const netlist_time out_delay = NLTIME_FROM_NS(20);
#if 0
// for (int i=0; i<4; i++)
// OUTLOGIC(m_Q[i], (cnt >> i) & 1, delay[i]);
@@ -231,3 +233,5 @@ NETLIB_RESET(9310_dip)
{
NETLIB_NAME(9310)::reset();
}
+
+NETLIB_NAMESPACE_DEVICES_END()
diff --git a/src/emu/netlist/devices/nld_9310.h b/src/emu/netlist/devices/nld_9310.h
index a485749588f..4ab59ea038e 100644
--- a/src/emu/netlist/devices/nld_9310.h
+++ b/src/emu/netlist/devices/nld_9310.h
@@ -48,7 +48,7 @@
#include "../nl_base.h"
#define TTL_9310(_name, _CLK, _ENP, _ENT, _CLRQ, _LOADQ, _A, _B, _C, _D) \
- NET_REGISTER_DEV(9310, _name) \
+ NET_REGISTER_DEV(TTL_9310, _name) \
NET_CONNECT(_name, CLK, _CLK) \
NET_CONNECT(_name, ENP, _ENP) \
NET_CONNECT(_name, ENT, _ENT) \
@@ -60,13 +60,15 @@
NET_CONNECT(_name, D, _D)
#define TTL_9310_DIP(_name) \
- NET_REGISTER_DEV(9310_dip, _name)
+ NET_REGISTER_DEV(TTL_9310_DIP, _name)
+
+NETLIB_NAMESPACE_DEVICES_START()
NETLIB_SUBDEVICE(9310_subABCD,
- netlist_logic_input_t m_A;
- netlist_logic_input_t m_B;
- netlist_logic_input_t m_C;
- netlist_logic_input_t m_D;
+ logic_input_t m_A;
+ logic_input_t m_B;
+ logic_input_t m_C;
+ logic_input_t m_D;
ATTR_HOT inline UINT8 read_ABCD() const
{
@@ -79,29 +81,31 @@ NETLIB_SUBDEVICE(9310_sub,
ATTR_HOT inline void update_outputs_all(const UINT8 cnt, const netlist_time out_delay);
ATTR_HOT inline void update_outputs(const UINT8 cnt);
- netlist_logic_input_t m_CLK;
+ logic_input_t m_CLK;
UINT8 m_cnt;
NETLIB_NAME(9310_subABCD) *m_ABCD;
netlist_sig_t m_loadq;
netlist_sig_t m_ent;
- netlist_logic_output_t m_QA;
- netlist_logic_output_t m_QB;
- netlist_logic_output_t m_QC;
- netlist_logic_output_t m_QD;
- netlist_logic_output_t m_RC;
+ logic_output_t m_QA;
+ logic_output_t m_QB;
+ logic_output_t m_QC;
+ logic_output_t m_QD;
+ logic_output_t m_RC;
);
NETLIB_DEVICE(9310,
NETLIB_NAME(9310_sub) sub;
NETLIB_NAME(9310_subABCD) subABCD;
- netlist_logic_input_t m_ENP;
- netlist_logic_input_t m_ENT;
- netlist_logic_input_t m_CLRQ;
- netlist_logic_input_t m_LOADQ;
+ logic_input_t m_ENP;
+ logic_input_t m_ENT;
+ logic_input_t m_CLRQ;
+ logic_input_t m_LOADQ;
);
NETLIB_DEVICE_DERIVED_PURE(9310_dip, 9310);
+NETLIB_NAMESPACE_DEVICES_END()
+
#endif /* NLD_9310_H_ */
diff --git a/src/emu/netlist/devices/nld_9312.c b/src/emu/netlist/devices/nld_9312.c
index a867ef6d986..0821861dea4 100644
--- a/src/emu/netlist/devices/nld_9312.c
+++ b/src/emu/netlist/devices/nld_9312.c
@@ -22,6 +22,8 @@
*/
#include "nld_9312.h"
+NETLIB_NAMESPACE_DEVICES_START()
+
#if (1 && USE_TRUTHTABLE)
nld_9312::truthtable_t nld_9312::m_ttbl;
@@ -59,7 +61,7 @@ NETLIB_UPDATE(9312)
const UINT8 G = INPLOGIC(m_G);
if (G)
{
- static const netlist_time delay[2] = { NLTIME_FROM_NS(33), NLTIME_FROM_NS(19) };
+ /* static */ const netlist_time delay[2] = { NLTIME_FROM_NS(33), NLTIME_FROM_NS(19) };
OUTLOGIC(m_Y, 0, delay[0]);
OUTLOGIC(m_YQ, 1, delay[1]);
@@ -77,7 +79,7 @@ NETLIB_UPDATE(9312)
m_B.activate();
m_C.activate();
}
- static const netlist_time delay[2] = { NLTIME_FROM_NS(33), NLTIME_FROM_NS(28) };
+ /* static */ const netlist_time delay[2] = { NLTIME_FROM_NS(33), NLTIME_FROM_NS(28) };
const UINT8 chan = INPLOGIC(m_A) | (INPLOGIC(m_B)<<1) | (INPLOGIC(m_C)<<2);
if (m_last_chan != chan)
{
@@ -128,19 +130,19 @@ NETLIB_START(9312_dip)
#if (1 && USE_TRUTHTABLE)
- register_subalias("13", m_sub.m_i[0]);
- register_subalias("12", m_sub.m_i[1]);
- register_subalias("11", m_sub.m_i[2]);
- register_subalias("10", m_sub.m_i[3]);
+ register_subalias("13", m_sub.m_I[0]);
+ register_subalias("12", m_sub.m_I[1]);
+ register_subalias("11", m_sub.m_I[2]);
+ register_subalias("10", m_sub.m_I[3]);
- register_subalias("1", m_sub.m_i[4]);
- register_subalias("2", m_sub.m_i[5]);
- register_subalias("3", m_sub.m_i[6]);
- register_subalias("4", m_sub.m_i[7]);
- register_subalias("5", m_sub.m_i[8]);
- register_subalias("6", m_sub.m_i[9]);
- register_subalias("7", m_sub.m_i[10]);
- register_subalias("9", m_sub.m_i[11]);
+ register_subalias("1", m_sub.m_I[4]);
+ register_subalias("2", m_sub.m_I[5]);
+ register_subalias("3", m_sub.m_I[6]);
+ register_subalias("4", m_sub.m_I[7]);
+ register_subalias("5", m_sub.m_I[8]);
+ register_subalias("6", m_sub.m_I[9]);
+ register_subalias("7", m_sub.m_I[10]);
+ register_subalias("9", m_sub.m_I[11]);
register_subalias("15", m_sub.m_Q[0]); // Y
register_subalias("14", m_sub.m_Q[1]); // YQ
@@ -177,3 +179,4 @@ NETLIB_RESET(9312_dip)
{
m_sub.do_reset();
}
+NETLIB_NAMESPACE_DEVICES_END()
diff --git a/src/emu/netlist/devices/nld_9312.h b/src/emu/netlist/devices/nld_9312.h
index c4a024f1c00..ab5c0a8f8c9 100644
--- a/src/emu/netlist/devices/nld_9312.h
+++ b/src/emu/netlist/devices/nld_9312.h
@@ -38,12 +38,17 @@
#define NLD_9312_H_
#include "nld_signal.h"
+#include "nld_truthtable.h"
#define TTL_9312(_name) \
- NET_REGISTER_DEV(9312, _name)
-#if (USE_TRUTHTABLE)
-#include "nld_truthtable.h"
+ NET_REGISTER_DEV(TTL_9312, _name)
+
+#define TTL_9312_DIP(_name) \
+ NET_REGISTER_DEV(TTL_9312_DIP, _name)
+
+NETLIB_NAMESPACE_DEVICES_START()
+#if (USE_TRUTHTABLE)
/* The truthtable implementation is a lot faster than
* the carefully crafted code :-(
*/
@@ -67,12 +72,10 @@ public:
#endif
-
-#define TTL_9312_DIP(_name) \
- NET_REGISTER_DEV(9312_dip, _name)
-
NETLIB_DEVICE(9312_dip,
NETLIB_NAME(9312) m_sub;
);
+NETLIB_NAMESPACE_DEVICES_END()
+
#endif /* NLD_9312_H_ */
diff --git a/src/emu/netlist/devices/nld_9316.c b/src/emu/netlist/devices/nld_9316.c
index ce5b05cfbf0..220487f1037 100644
--- a/src/emu/netlist/devices/nld_9316.c
+++ b/src/emu/netlist/devices/nld_9316.c
@@ -9,6 +9,8 @@
#define MAXCNT 15
+NETLIB_NAMESPACE_DEVICES_START()
+
NETLIB_START(9316)
{
register_sub("subABCD", subABCD);
@@ -81,7 +83,7 @@ NETLIB_START(9316_sub)
NETLIB_RESET(9316_sub)
{
- m_CLK.set_state(netlist_logic_t::STATE_INP_LH);
+ m_CLK.set_state(logic_t::STATE_INP_LH);
m_cnt = 0;
m_loadq = 1;
m_ent = 1;
@@ -151,7 +153,7 @@ inline NETLIB_FUNC_VOID(9316_sub, update_outputs_all, (const UINT8 cnt, const ne
inline NETLIB_FUNC_VOID(9316_sub, update_outputs, (const UINT8 cnt))
{
- static const netlist_time out_delay = NLTIME_FROM_NS(20);
+ /* static */ const netlist_time out_delay = NLTIME_FROM_NS(20);
#if 0
// for (int i=0; i<4; i++)
// OUTLOGIC(m_Q[i], (cnt >> i) & 1, delay[i]);
@@ -226,3 +228,5 @@ NETLIB_RESET(9316_dip)
{
NETLIB_NAME(9316)::reset();
}
+
+NETLIB_NAMESPACE_DEVICES_END()
diff --git a/src/emu/netlist/devices/nld_9316.h b/src/emu/netlist/devices/nld_9316.h
index 88c53b44ae0..ec6791ed63b 100644
--- a/src/emu/netlist/devices/nld_9316.h
+++ b/src/emu/netlist/devices/nld_9316.h
@@ -52,7 +52,7 @@
#include "../nl_base.h"
#define TTL_9316(_name, _CLK, _ENP, _ENT, _CLRQ, _LOADQ, _A, _B, _C, _D) \
- NET_REGISTER_DEV(9316, _name) \
+ NET_REGISTER_DEV(TTL_9316, _name) \
NET_CONNECT(_name, CLK, _CLK) \
NET_CONNECT(_name, ENP, _ENP) \
NET_CONNECT(_name, ENT, _ENT) \
@@ -64,13 +64,15 @@
NET_CONNECT(_name, D, _D)
#define TTL_9316_DIP(_name) \
- NET_REGISTER_DEV(9316_dip, _name)
+ NET_REGISTER_DEV(TTL_9316_DIP, _name)
+
+NETLIB_NAMESPACE_DEVICES_START()
NETLIB_SUBDEVICE(9316_subABCD,
- netlist_logic_input_t m_A;
- netlist_logic_input_t m_B;
- netlist_logic_input_t m_C;
- netlist_logic_input_t m_D;
+ logic_input_t m_A;
+ logic_input_t m_B;
+ logic_input_t m_C;
+ logic_input_t m_D;
ATTR_HOT inline UINT8 read_ABCD() const
{
@@ -83,13 +85,13 @@ NETLIB_SUBDEVICE(9316_sub,
ATTR_HOT inline void update_outputs_all(const UINT8 cnt, const netlist_time out_delay);
ATTR_HOT inline void update_outputs(const UINT8 cnt);
- netlist_logic_input_t m_CLK;
+ logic_input_t m_CLK;
- netlist_logic_output_t m_QA;
- netlist_logic_output_t m_QB;
- netlist_logic_output_t m_QC;
- netlist_logic_output_t m_QD;
- netlist_logic_output_t m_RC;
+ logic_output_t m_QA;
+ logic_output_t m_QB;
+ logic_output_t m_QC;
+ logic_output_t m_QD;
+ logic_output_t m_RC;
UINT8 m_cnt;
NETLIB_NAME(9316_subABCD) *m_ABCD;
@@ -101,12 +103,14 @@ NETLIB_SUBDEVICE(9316_sub,
NETLIB_DEVICE(9316,
NETLIB_NAME(9316_sub) sub;
NETLIB_NAME(9316_subABCD) subABCD;
- netlist_logic_input_t m_ENP;
- netlist_logic_input_t m_ENT;
- netlist_logic_input_t m_CLRQ;
- netlist_logic_input_t m_LOADQ;
+ logic_input_t m_ENP;
+ logic_input_t m_ENT;
+ logic_input_t m_CLRQ;
+ logic_input_t m_LOADQ;
);
NETLIB_DEVICE_DERIVED_PURE(9316_dip, 9316);
+NETLIB_NAMESPACE_DEVICES_END()
+
#endif /* NLD_9316_H_ */
diff --git a/src/emu/netlist/devices/nld_cmos.h b/src/emu/netlist/devices/nld_cmos.h
index 14f69240ce6..e3783ade423 100644
--- a/src/emu/netlist/devices/nld_cmos.h
+++ b/src/emu/netlist/devices/nld_cmos.h
@@ -11,22 +11,24 @@
#include "../nl_base.h"
#include "../analog/nld_twoterm.h"
-class nld_vdd_vss : public netlist_device_t
+NETLIB_NAMESPACE_DEVICES_START()
+
+class nld_vdd_vss : public device_t
{
public:
nld_vdd_vss ()
- : netlist_device_t()
+ : device_t()
{ }
- netlist_analog_input_t m_vdd;
- netlist_analog_input_t m_vss;
+ analog_input_t m_vdd;
+ analog_input_t m_vss;
protected:
ATTR_HOT void update() {};
ATTR_HOT void start()
{
- register_input("VDD,", m_vdd);
- register_input("VSS,", m_vss);
+ register_input("VDD", m_vdd);
+ register_input("VSS", m_vss);
};
ATTR_HOT void reset() {};
@@ -35,4 +37,6 @@ public:
ATTR_HOT inline nl_double vss() { return INPANALOG(m_vss); }
};
+NETLIB_NAMESPACE_DEVICES_END()
+
#endif /* NLD_CMOS_H_ */
diff --git a/src/emu/netlist/devices/nld_legacy.c b/src/emu/netlist/devices/nld_legacy.c
index 6eadf46ad64..d6b926545fe 100644
--- a/src/emu/netlist/devices/nld_legacy.c
+++ b/src/emu/netlist/devices/nld_legacy.c
@@ -8,6 +8,8 @@
#include "nld_legacy.h"
#include "../nl_setup.h"
+NETLIB_NAMESPACE_DEVICES_START()
+
NETLIB_START(nicRSFF)
{
register_input("S", m_S);
@@ -59,15 +61,18 @@ NETLIB_UPDATE_PARAM(nicDelay)
NETLIB_UPDATE(nicDelay)
{
- if (INPLOGIC(m_I) && !m_last)
+ netlist_sig_t nval = INPLOGIC(m_I);
+ if (nval && !m_last)
{
// L_to_H
OUTLOGIC(m_Q, 1, NLTIME_FROM_NS(m_L_to_H.Value()));
}
- else if (!INPLOGIC(m_I) && m_last)
+ else if (!nval && m_last)
{
// H_to_L
OUTLOGIC(m_Q, 0, NLTIME_FROM_NS(m_H_to_L.Value()));
}
- m_last = INPLOGIC(m_I);
+ m_last = nval;
}
+
+NETLIB_NAMESPACE_DEVICES_END()
diff --git a/src/emu/netlist/devices/nld_legacy.h b/src/emu/netlist/devices/nld_legacy.h
index c82f172781d..62cdd8b02ca 100644
--- a/src/emu/netlist/devices/nld_legacy.h
+++ b/src/emu/netlist/devices/nld_legacy.h
@@ -15,39 +15,42 @@
#include "../nl_base.h"
+NETLIB_NAMESPACE_DEVICES_START()
+
// ----------------------------------------------------------------------------------------
// Macros
// ----------------------------------------------------------------------------------------
#define NETDEV_RSFF(_name) \
- NET_REGISTER_DEV(nicRSFF, _name)
+ NET_REGISTER_DEV(NETDEV_RSFF, _name)
#define NETDEV_DELAY(_name) \
- NET_REGISTER_DEV(nicDelay, _name)
+ NET_REGISTER_DEV(NETDEV_DELAY, _name)
// ----------------------------------------------------------------------------------------
// Devices ...
// ----------------------------------------------------------------------------------------
NETLIB_DEVICE(nicRSFF,
- netlist_logic_input_t m_S;
- netlist_logic_input_t m_R;
+ logic_input_t m_S;
+ logic_input_t m_R;
- netlist_logic_output_t m_Q;
- netlist_logic_output_t m_QQ;
+ logic_output_t m_Q;
+ logic_output_t m_QQ;
);
NETLIB_DEVICE_WITH_PARAMS(nicDelay,
- netlist_logic_input_t m_I;
+ logic_input_t m_I;
- netlist_logic_output_t m_Q;
+ logic_output_t m_Q;
- netlist_param_int_t m_L_to_H;
- netlist_param_int_t m_H_to_L;
+ param_int_t m_L_to_H;
+ param_int_t m_H_to_L;
UINT8 m_last;
);
+NETLIB_NAMESPACE_DEVICES_END()
#endif /* NLD_LEGACY_H_ */
diff --git a/src/emu/netlist/devices/nld_log.c b/src/emu/netlist/devices/nld_log.c
index a57301df744..f6061cc3aab 100644
--- a/src/emu/netlist/devices/nld_log.c
+++ b/src/emu/netlist/devices/nld_log.c
@@ -10,6 +10,8 @@
#include "nld_log.h"
//#include "sound/wavwrite.h"
+NETLIB_NAMESPACE_DEVICES_START()
+
//FIXME: what to do with save states?
NETLIB_START(log)
@@ -70,3 +72,5 @@ NETLIB_NAME(log)::~NETLIB_NAME(wav)()
fclose(m_file);
}
#endif
+
+NETLIB_NAMESPACE_DEVICES_END()
diff --git a/src/emu/netlist/devices/nld_log.h b/src/emu/netlist/devices/nld_log.h
index 99fd9541602..4b768b66b82 100644
--- a/src/emu/netlist/devices/nld_log.h
+++ b/src/emu/netlist/devices/nld_log.h
@@ -21,33 +21,37 @@
#include "../nl_base.h"
#define LOG(_name, _I) \
- NET_REGISTER_DEV(log, _name) \
+ NET_REGISTER_DEV(ÖPG, _name) \
NET_CONNECT(_name, I, _I)
+NETLIB_NAMESPACE_DEVICES_START()
+
NETLIB_DEVICE(log,
~NETLIB_NAME(log)();
- netlist_analog_input_t m_I;
+ analog_input_t m_I;
protected:
void * m_file;
);
#define LOGD(_name, _I, _I2) \
- NET_REGISTER_DEV(logD, _name) \
+ NET_REGISTER_DEV(LOGD, _name) \
NET_CONNECT(_name, I, _I) \
NET_CONNECT(_name, I2, _I2)
NETLIB_DEVICE_DERIVED(logD, log,
- netlist_analog_input_t m_I2;
+ analog_input_t m_I2;
);
#if 0
NETLIB_DEVICE(wav,
~NETLIB_NAME(wav)();
- netlist_analog_input_t m_I;
+ analog_input_t m_I;
private:
// FIXME: rewrite sound/wavwrite.h to be an object ...
void *m_file;
);
#endif
+NETLIB_NAMESPACE_DEVICES_END()
+
#endif /* NLD_LOG_H_ */
diff --git a/src/emu/netlist/devices/nld_mm5837.c b/src/emu/netlist/devices/nld_mm5837.c
new file mode 100644
index 00000000000..e45c0bf8198
--- /dev/null
+++ b/src/emu/netlist/devices/nld_mm5837.c
@@ -0,0 +1,82 @@
+// license:GPL-2.0+
+// copyright-holders:Couriersud
+/*
+ * nld_MM5837.c
+ *
+ */
+
+#include <solver/nld_solver.h>
+#include "nld_mm5837.h"
+#include "../nl_setup.h"
+
+#define R_LOW (1000)
+#define R_HIGH (1000)
+
+NETLIB_NAMESPACE_DEVICES_START()
+
+NETLIB_START(MM5837_dip)
+{
+ /* clock */
+ register_output("Q", m_Q);
+ register_input("FB", m_feedback);
+ m_inc = netlist_time::from_hz(56000);
+ connect_late(m_feedback, m_Q);
+
+ /* output */
+ register_sub("RV", m_RV);
+ register_terminal("_RV1", m_RV.m_P);
+ register_terminal("_RV2", m_RV.m_N);
+ register_output("_Q", m_V0);
+ connect_late(m_RV.m_N, m_V0);
+
+ /* device */
+ register_input("1", m_VDD);
+ register_input("2", m_VGG);
+ register_subalias("3", m_RV.m_P);
+ register_input("4", m_VSS);
+
+ save(NLNAME(m_shift));
+}
+
+NETLIB_RESET(MM5837_dip)
+{
+ m_V0.initial(0.0);
+ m_RV.do_reset();
+ m_RV.set(NL_FCONST(1.0) / R_LOW, 0.0, 0.0);
+
+ m_shift = 0x1ffff;
+ m_is_timestep = m_RV.m_P.net().as_analog().solver()->is_timestep();
+}
+
+NETLIB_UPDATE(MM5837_dip)
+{
+ OUTLOGIC(m_Q, !m_Q.net().as_logic().new_Q(), m_inc );
+
+ /* shift register
+ *
+ * 17 bits, bits 17 & 14 feed back to input
+ *
+ */
+
+ const UINT32 last_state = m_shift & 0x01;
+ /* shift */
+ m_shift = (m_shift >> 1) | (((m_shift & 0x01) ^ ((m_shift >> 3) & 0x01)) << 16);
+ const UINT32 state = m_shift & 0x01;
+
+ if (state != last_state)
+ {
+ const nl_double R = state ? R_HIGH : R_LOW;
+ const nl_double V = state ? INPANALOG(m_VDD) : INPANALOG(m_VSS);
+
+ // We only need to update the net first if this is a time stepping net
+ if (m_is_timestep)
+ m_RV.update_dev();
+ m_RV.set(NL_FCONST(1.0) / R, V, 0.0);
+ m_RV.m_P.schedule_after(NLTIME_FROM_NS(1));
+ }
+
+}
+
+
+
+NETLIB_NAMESPACE_DEVICES_END()
diff --git a/src/emu/netlist/devices/nld_mm5837.h b/src/emu/netlist/devices/nld_mm5837.h
new file mode 100644
index 00000000000..e5aad3daa81
--- /dev/null
+++ b/src/emu/netlist/devices/nld_mm5837.h
@@ -0,0 +1,54 @@
+// license:GPL-2.0+
+// copyright-holders:Couriersud
+/*
+ * nld_MM5837.h
+ *
+ * MM5837: Digital noise source
+ *
+ * +--------+
+ * VDD |1 ++ 8| NC
+ * VGG |2 7| NC
+ * OUT |3 6| NC
+ * VSS |4 5| NC
+ * +--------+
+ *
+ * Naming conventions follow National Semiconductor datasheet
+ *
+ */
+
+#ifndef NLD_MM5837_H_
+#define NLD_MM5837_H_
+
+#include "../nl_base.h"
+#include "../analog/nld_twoterm.h"
+
+#define MM5837_DIP(_name) \
+ NET_REGISTER_DEV(MM5837_DIP, _name)
+
+NETLIB_NAMESPACE_DEVICES_START()
+
+NETLIB_DEVICE(MM5837_dip,
+
+ analog_input_t m_VDD;
+ analog_input_t m_VGG;
+ analog_input_t m_VSS;
+
+ /* output stage */
+ nld_twoterm m_RV;
+ analog_output_t m_V0; /* could be gnd as well */
+
+ /* clock stage */
+ logic_input_t m_feedback;
+ logic_output_t m_Q;
+ netlist_time m_inc;
+
+ /* state */
+ UINT32 m_shift;
+
+ /* cache */
+ bool m_is_timestep;
+);
+
+NETLIB_NAMESPACE_DEVICES_END()
+
+#endif /* NLD_MM5837_H_ */
diff --git a/src/emu/netlist/devices/nld_ne555.c b/src/emu/netlist/devices/nld_ne555.c
index 8caf08e024b..6705081eb3a 100644
--- a/src/emu/netlist/devices/nld_ne555.c
+++ b/src/emu/netlist/devices/nld_ne555.c
@@ -5,13 +5,15 @@
*
*/
+#include <solver/nld_solver.h>
#include "nld_ne555.h"
#include "../nl_setup.h"
-#include "../analog/nld_solver.h"
#define R_OFF (1E20)
#define R_ON (25) // Datasheet states a maximum discharge of 200mA, R = 5V / 0.2
+NETLIB_NAMESPACE_DEVICES_START()
+
inline nl_double NETLIB_NAME(NE555)::clamp(const nl_double v, const nl_double a, const nl_double b)
{
nl_double ret = v;
@@ -40,9 +42,9 @@ NETLIB_START(NE555)
register_subalias("DISCH", m_RDIS.m_P); // Pin 7
register_subalias("VCC", m_R1.m_P); // Pin 8
- connect(m_R1.m_N, m_R2.m_P);
- connect(m_R2.m_N, m_R3.m_P);
- connect(m_RDIS.m_N, m_R3.m_N);
+ connect_late(m_R1.m_N, m_R2.m_P);
+ connect_late(m_R2.m_N, m_R3.m_P);
+ connect_late(m_RDIS.m_N, m_R3.m_N);
save(NLNAME(m_last_out));
save(NLNAME(m_ff));
@@ -66,7 +68,6 @@ NETLIB_RESET(NE555)
NETLIB_UPDATE(NE555)
{
// FIXME: assumes GND is connected to 0V.
- // FIXME: Hookup RESET!
nl_double vt = clamp(TERMANALOG(m_R2.m_P), 0.7, 1.4);
bool bthresh = (INPANALOG(m_THRES) > vt);
@@ -124,3 +125,5 @@ NETLIB_RESET(NE555_dip)
{
NETLIB_NAME(NE555)::reset();
}
+
+NETLIB_NAMESPACE_DEVICES_END()
diff --git a/src/emu/netlist/devices/nld_ne555.h b/src/emu/netlist/devices/nld_ne555.h
index cb433732c48..f02c7763ebd 100644
--- a/src/emu/netlist/devices/nld_ne555.h
+++ b/src/emu/netlist/devices/nld_ne555.h
@@ -25,6 +25,7 @@
#define NE555(_name) \
NET_REGISTER_DEV(NE555, _name)
+NETLIB_NAMESPACE_DEVICES_START()
NETLIB_DEVICE(NE555,
NETLIB_NAME(R) m_R1;
@@ -32,10 +33,10 @@ NETLIB_DEVICE(NE555,
NETLIB_NAME(R) m_R3;
NETLIB_NAME(R) m_RDIS;
- netlist_logic_input_t m_RESET;
- netlist_analog_input_t m_THRES;
- netlist_analog_input_t m_TRIG;
- netlist_analog_output_t m_OUT;
+ logic_input_t m_RESET;
+ analog_input_t m_THRES;
+ analog_input_t m_TRIG;
+ analog_output_t m_OUT;
bool m_last_out;
bool m_ff;
@@ -45,9 +46,10 @@ NETLIB_DEVICE(NE555,
);
#define NE555_DIP(_name) \
- NET_REGISTER_DEV(NE555_dip, _name)
+ NET_REGISTER_DEV(NE555_DIP, _name)
NETLIB_DEVICE_DERIVED_PURE(NE555_dip, NE555);
+NETLIB_NAMESPACE_DEVICES_END()
#endif /* NLD_NE555_H_ */
diff --git a/src/emu/netlist/devices/nld_r2r_dac.c b/src/emu/netlist/devices/nld_r2r_dac.c
index 1e76723f9e7..c1f05837d4c 100644
--- a/src/emu/netlist/devices/nld_r2r_dac.c
+++ b/src/emu/netlist/devices/nld_r2r_dac.c
@@ -7,6 +7,8 @@
#include "nld_r2r_dac.h"
+NETLIB_NAMESPACE_DEVICES_START()
+
NETLIB_START(r2r_dac)
{
NETLIB_NAME(twoterm)::start();
@@ -38,3 +40,5 @@ NETLIB_UPDATE_PARAM(r2r_dac)
this->set(1.0 / m_R.Value(), V, 0.0);
}
+
+NETLIB_NAMESPACE_DEVICES_END()
diff --git a/src/emu/netlist/devices/nld_r2r_dac.h b/src/emu/netlist/devices/nld_r2r_dac.h
index 619fad90539..843c827a538 100644
--- a/src/emu/netlist/devices/nld_r2r_dac.h
+++ b/src/emu/netlist/devices/nld_r2r_dac.h
@@ -50,17 +50,21 @@
#include "../analog/nld_twoterm.h"
#define R2R_DAC(_name, _VIN, _R, _N) \
- NET_REGISTER_DEV(r2r_dac, _name) \
+ NET_REGISTER_DEV(R2R_DAC, _name) \
NETDEV_PARAMI(_name, VIN, _VIN) \
NETDEV_PARAMI(_name, R, _R) \
NETDEV_PARAMI(_name, N, _N)
+NETLIB_NAMESPACE_DEVICES_START()
+
NETLIB_DEVICE_WITH_PARAMS_DERIVED(r2r_dac, twoterm,
- netlist_param_double_t m_VIN;
- netlist_param_double_t m_R;
- netlist_param_int_t m_num;
- netlist_param_int_t m_val;
+ param_double_t m_VIN;
+ param_double_t m_R;
+ param_int_t m_num;
+ param_int_t m_val;
);
+NETLIB_NAMESPACE_DEVICES_END()
+
#endif /* NLD_R2R_DAC_H_ */
diff --git a/src/emu/netlist/devices/nld_signal.h b/src/emu/netlist/devices/nld_signal.h
index 3f4bb331741..0cf2bc7c238 100644
--- a/src/emu/netlist/devices/nld_signal.h
+++ b/src/emu/netlist/devices/nld_signal.h
@@ -18,36 +18,38 @@
class NETLIB_NAME(_name) : public net_signal_t<_num_input, _check, _invert> \
{ \
public: \
- ATTR_COLD NETLIB_NAME(_name) () \
+ NETLIB_NAME(_name) () \
: net_signal_t<_num_input, _check, _invert>() { } \
}
+NETLIB_NAMESPACE_DEVICES_START()
+
// ----------------------------------------------------------------------------------------
// net_signal_t
// ----------------------------------------------------------------------------------------
template <int _numdev, int _check, int _invert>
-class net_signal_t : public netlist_device_t
+class net_signal_t : public device_t
{
public:
net_signal_t()
- : netlist_device_t(), m_active(1)
+ : device_t(), m_active(1)
{
}
- ATTR_COLD void start()
+ void start()
{
const char *sIN[8] = { "A", "B", "C", "D", "E", "F", "G", "H" };
register_output("Q", m_Q[0]);
for (int i=0; i < _numdev; i++)
{
- register_input(sIN[i], m_i[i]);
+ register_input(sIN[i], m_I[i]);
}
save(NLNAME(m_active));
}
- ATTR_COLD void reset()
+ void reset()
{
m_Q[0].initial(0);
m_active = 1;
@@ -57,13 +59,13 @@ public:
{
for (int i = 0; i< _numdev; i++)
{
- this->m_i[i].activate();
- if (INPLOGIC(this->m_i[i]) == _check)
+ this->m_I[i].activate();
+ if (INPLOGIC(this->m_I[i]) == _check)
{
for (int j = 0; j < i; j++)
- this->m_i[j].inactivate();
+ this->m_I[j].inactivate();
for (int j = i + 1; j < _numdev; j++)
- this->m_i[j].inactivate();
+ this->m_I[j].inactivate();
return _check ^ (1 ^ _invert);
}
}
@@ -80,8 +82,8 @@ public:
netlist_time mt = netlist_time::zero;
for (int i = 0; i< _numdev; i++)
{
- if (this->m_i[i].net().time() > mt)
- mt = this->m_i[i].net().time();
+ if (this->m_I[i].net().time() > mt)
+ mt = this->m_I[i].net().time();
}
netlist_sig_t r = process();
m_Q[0].net().set_Q_time(r, mt + times[r]);
@@ -94,7 +96,7 @@ public:
if (--m_active == 0)
{
for (int i = 0; i< _numdev; i++)
- m_i[i].inactivate();
+ m_I[i].inactivate();
}
}
@@ -107,9 +109,11 @@ public:
}
public:
- netlist_logic_input_t m_i[_numdev];
- netlist_logic_output_t m_Q[1];
+ logic_input_t m_I[_numdev];
+ logic_output_t m_Q[1];
INT32 m_active;
};
+NETLIB_NAMESPACE_DEVICES_END()
+
#endif /* NLD_SIGNAL_H_ */
diff --git a/src/emu/netlist/devices/nld_system.c b/src/emu/netlist/devices/nld_system.c
index b7a5cf6c71e..c4ecbaba454 100644
--- a/src/emu/netlist/devices/nld_system.c
+++ b/src/emu/netlist/devices/nld_system.c
@@ -5,8 +5,10 @@
*
*/
+#include <solver/nld_solver.h>
#include "nld_system.h"
-#include "../analog/nld_solver.h"
+
+NETLIB_NAMESPACE_DEVICES_START()
// ----------------------------------------------------------------------------------------
// netlistparams
@@ -42,7 +44,7 @@ NETLIB_START(clock)
register_param("FREQ", m_freq, 7159000.0 * 5.0);
m_inc = netlist_time::from_hz(m_freq.Value()*2);
- connect(m_feedback, m_Q);
+ connect_late(m_feedback, m_Q);
}
NETLIB_RESET(clock)
@@ -73,7 +75,7 @@ NETLIB_START(extclock)
register_param("OFFSET", m_offset, 0.0);
m_inc[0] = netlist_time::from_hz(m_freq.Value()*2);
- connect(m_feedback, m_Q);
+ connect_late(m_feedback, m_Q);
{
netlist_time base = netlist_time::from_hz(m_freq.Value()*2);
pstring_list_t pat(m_pattern.Value(),",");
@@ -129,22 +131,34 @@ NETLIB_UPDATE(extclock)
// logic_input
// ----------------------------------------------------------------------------------------
-NETLIB_START(ttl_input)
+NETLIB_START(logic_input)
{
+ /* make sure we get the family first */
+ register_param("FAMILY", m_FAMILY, ".model FAMILY(TYPE=TTL)");
+ set_logic_family(logic_family_desc_t::from_model(m_FAMILY.Value()));
+
register_output("Q", m_Q);
register_param("IN", m_IN, 0);
}
-NETLIB_RESET(ttl_input)
+NETLIB_RESET(logic_input)
+{
+}
+
+NETLIB_STOP(logic_input)
{
+ if (m_logic_family != NULL)
+ if (!m_logic_family->m_is_static)
+ pfree(m_logic_family);
}
-NETLIB_UPDATE(ttl_input)
+
+NETLIB_UPDATE(logic_input)
{
OUTLOGIC(m_Q, m_IN.Value() & 1, netlist_time::from_nsec(1));
}
-NETLIB_UPDATE_PARAM(ttl_input)
+NETLIB_UPDATE_PARAM(logic_input)
{
update();
}
@@ -177,7 +191,7 @@ NETLIB_UPDATE_PARAM(analog_input)
// nld_d_to_a_proxy
// ----------------------------------------------------------------------------------------
-ATTR_COLD void nld_d_to_a_proxy::start()
+void nld_d_to_a_proxy::start()
{
nld_base_d_to_a_proxy::start();
@@ -188,14 +202,18 @@ ATTR_COLD void nld_d_to_a_proxy::start()
register_output("_Q", m_Q);
register_subalias("Q", m_RV.m_P);
- connect(m_RV.m_N, m_Q);
- m_Q.initial(0.0);
+ connect_direct(m_RV.m_N, m_Q);
+
+ save(NLNAME(m_last_state));
}
-ATTR_COLD void nld_d_to_a_proxy::reset()
+void nld_d_to_a_proxy::reset()
{
+ m_Q.initial(0.0);
+ m_last_state = -1;
m_RV.do_reset();
m_is_timestep = m_RV.m_P.net().as_analog().solver()->is_timestep();
+ m_RV.set(NL_FCONST(1.0) / logic_family().m_R_low, logic_family().m_low_V, 0.0);
}
ATTR_HOT void nld_d_to_a_proxy::update()
@@ -269,3 +287,98 @@ NETLIB_UPDATE_PARAM(res_sw)
{
// nothing, not intended to be called
}
+
+/* -----------------------------------------------------------------------------
+ * nld_function
+ * ----------------------------------------------------------------------------- */
+
+NETLIB_START(function)
+{
+ register_param("N", m_N, 2);
+ register_param("FUNC", m_func, "");
+ register_output("Q", m_Q);
+
+ for (int i=0; i < m_N; i++)
+ register_input(pstring::sprintf("A%d", i), m_I[i]);
+
+ pstring_list_t cmds(m_func.Value(), " ");
+ m_precompiled.clear();
+
+ for (std::size_t i=0; i < cmds.size(); i++)
+ {
+ pstring cmd = cmds[i];
+ rpn_inst rc;
+ if (cmd == "+")
+ rc.m_cmd = ADD;
+ else if (cmd == "-")
+ rc.m_cmd = SUB;
+ else if (cmd == "*")
+ rc.m_cmd = MULT;
+ else if (cmd == "/")
+ rc.m_cmd = DIV;
+ else if (cmd == "/")
+ rc.m_cmd = DIV;
+ else if (cmd.startsWith("A"))
+ {
+ rc.m_cmd = PUSH_INPUT;
+ rc.m_param = cmd.substr(1).as_long();
+ }
+ else
+ {
+ bool err = false;
+ rc.m_cmd = PUSH_CONST;
+ rc.m_param = cmd.as_double(&err);
+ if (err)
+ netlist().error("nld_function: unknown/misformatted token <%s> in <%s>", cmd.cstr(), m_func.Value().cstr());
+ }
+ m_precompiled.add(rc);
+ }
+
+}
+
+NETLIB_RESET(function)
+{
+ m_Q.initial(0.0);
+}
+
+NETLIB_UPDATE(function)
+{
+ //nl_double val = INPANALOG(m_I[0]) * INPANALOG(m_I[1]) * 0.2;
+ //OUTANALOG(m_Q, val);
+ nl_double stack[20];
+ unsigned ptr = 0;
+ unsigned e = m_precompiled.size();
+ for (unsigned i = 0; i<e; i++)
+ {
+ rpn_inst &rc = m_precompiled[i];
+ switch (rc.m_cmd)
+ {
+ case ADD:
+ ptr--;
+ stack[ptr-1] = stack[ptr] + stack[ptr-1];
+ break;
+ case MULT:
+ ptr--;
+ stack[ptr-1] = stack[ptr] * stack[ptr-1];
+ break;
+ case SUB:
+ ptr--;
+ stack[ptr-1] = stack[ptr-1] - stack[ptr];
+ break;
+ case DIV:
+ ptr--;
+ stack[ptr-1] = stack[ptr-1] / stack[ptr];
+ break;
+ case PUSH_INPUT:
+ stack[ptr++] = INPANALOG(m_I[(int) rc.m_param]);
+ break;
+ case PUSH_CONST:
+ stack[ptr++] = rc.m_param;
+ break;
+ }
+ }
+ OUTANALOG(m_Q, stack[ptr-1]);
+}
+
+
+NETLIB_NAMESPACE_DEVICES_END()
diff --git a/src/emu/netlist/devices/nld_system.h b/src/emu/netlist/devices/nld_system.h
index f764f0027e6..76837f99d28 100644
--- a/src/emu/netlist/devices/nld_system.h
+++ b/src/emu/netlist/devices/nld_system.h
@@ -11,6 +11,7 @@
#include "../nl_setup.h"
#include "../nl_base.h"
+#include "../nl_factory.h"
#include "../analog/nld_twoterm.h"
// -----------------------------------------------------------------------------
@@ -18,52 +19,71 @@
// -----------------------------------------------------------------------------
#define TTL_INPUT(_name, _v) \
- NET_REGISTER_DEV(ttl_input, _name) \
+ NET_REGISTER_DEV(TTL_INPUT, _name) \
PARAM(_name.IN, _v)
+#define LOGIC_INPUT(_name, _v, _family) \
+ NET_REGISTER_DEV(LOGIC_INPUT, _name) \
+ PARAM(_name.IN, _v) \
+ PARAM(_name.FAMILY, _family)
+
#define ANALOG_INPUT(_name, _v) \
- NET_REGISTER_DEV(analog_input, _name) \
+ NET_REGISTER_DEV(ANALOG_INPUT, _name) \
PARAM(_name.IN, _v)
#define MAINCLOCK(_name, _freq) \
- NET_REGISTER_DEV(mainclock, _name) \
+ NET_REGISTER_DEV(MAINCLOCK, _name) \
PARAM(_name.FREQ, _freq)
#define CLOCK(_name, _freq) \
- NET_REGISTER_DEV(clock, _name) \
+ NET_REGISTER_DEV(CLOCK, _name) \
PARAM(_name.FREQ, _freq)
#define EXTCLOCK(_name, _freq, _pattern) \
- NET_REGISTER_DEV(extclock, _name) \
+ NET_REGISTER_DEV(EXTCLOCK, _name) \
PARAM(_name.FREQ, _freq) \
PARAM(_name.PATTERN, _pattern)
#define GNDA() \
- NET_REGISTER_DEV(gnd, GND)
+ NET_REGISTER_DEV(GNDA, GND)
#define DUMMY_INPUT(_name) \
- NET_REGISTER_DEV(dummy_input, _name)
+ NET_REGISTER_DEV(DUMMY_INPUT, _name)
-#define FRONTIER(_name, _IN, _OUT) \
- NET_REGISTER_DEV(frontier, _name) \
+//FIXME: Usage discouraged, use OPTIMIZE_FRONTIER instead
+#define FRONTIER_DEV(_name, _IN, _G, _OUT) \
+ NET_REGISTER_DEV(FRONTIER_DEV, _name) \
NET_C(_IN, _name.I) \
+ NET_C(_G, _name.G) \
NET_C(_OUT, _name.Q)
+#define OPTIMIZE_FRONTIER(_attach, _r_in, _r_out) \
+ setup.register_frontier(# _attach, _r_in, _r_out);
+
#define RES_SWITCH(_name, _IN, _P1, _P2) \
- NET_REGISTER_DEV(res_sw, _name) \
+ NET_REGISTER_DEV(RES_SWITCH, _name) \
NET_C(_IN, _name.I) \
NET_C(_P1, _name.1) \
NET_C(_P2, _name.2)
+
/* Default device to hold netlist parameters */
#define PARAMETERS(_name) \
- NET_REGISTER_DEV(netlistparams, _name)
+ NET_REGISTER_DEV(PARAMETERS, _name)
+
+#define AFUNC(_name, _N, _F) \
+ NET_REGISTER_DEV(AFUNC, _name) \
+ PARAM(_name.N, _N) \
+ PARAM(_name.FUNC, _F)
+
+NETLIB_NAMESPACE_DEVICES_START()
+
// -----------------------------------------------------------------------------
-// mainclock
+// netlistparams
// -----------------------------------------------------------------------------
NETLIB_DEVICE_WITH_PARAMS(netlistparams,
public:
- netlist_param_logic_t m_use_deactivate;
+ param_logic_t m_use_deactivate;
);
// -----------------------------------------------------------------------------
@@ -72,12 +92,12 @@ public:
NETLIB_DEVICE_WITH_PARAMS(mainclock,
public:
- netlist_logic_output_t m_Q;
+ logic_output_t m_Q;
- netlist_param_double_t m_freq;
+ param_double_t m_freq;
netlist_time m_inc;
- ATTR_HOT inline static void mc_update(netlist_logic_net_t &net);
+ ATTR_HOT inline static void mc_update(logic_net_t &net);
);
// -----------------------------------------------------------------------------
@@ -85,10 +105,10 @@ public:
// -----------------------------------------------------------------------------
NETLIB_DEVICE_WITH_PARAMS(clock,
- netlist_logic_input_t m_feedback;
- netlist_logic_output_t m_Q;
+ logic_input_t m_feedback;
+ logic_output_t m_Q;
- netlist_param_double_t m_freq;
+ param_double_t m_freq;
netlist_time m_inc;
);
@@ -97,12 +117,12 @@ NETLIB_DEVICE_WITH_PARAMS(clock,
// -----------------------------------------------------------------------------
NETLIB_DEVICE_WITH_PARAMS(extclock,
- netlist_logic_input_t m_feedback;
- netlist_logic_output_t m_Q;
+ logic_input_t m_feedback;
+ logic_output_t m_Q;
- netlist_param_double_t m_freq;
- netlist_param_str_t m_pattern;
- netlist_param_double_t m_offset;
+ param_double_t m_freq;
+ param_str_t m_pattern;
+ param_double_t m_offset;
UINT8 m_cnt;
UINT8 m_size;
@@ -114,48 +134,51 @@ NETLIB_DEVICE_WITH_PARAMS(extclock,
// Special support devices ...
// -----------------------------------------------------------------------------
-NETLIB_DEVICE_WITH_PARAMS(ttl_input,
- netlist_logic_output_t m_Q;
+NETLIB_DEVICE_WITH_PARAMS(logic_input,
- netlist_param_logic_t m_IN;
+ virtual void stop();
+ logic_output_t m_Q;
+
+ param_logic_t m_IN;
+ param_model_t m_FAMILY;
);
NETLIB_DEVICE_WITH_PARAMS(analog_input,
- netlist_analog_output_t m_Q;
+ analog_output_t m_Q;
- netlist_param_double_t m_IN;
+ param_double_t m_IN;
);
// -----------------------------------------------------------------------------
// nld_gnd
// -----------------------------------------------------------------------------
-class NETLIB_NAME(gnd) : public netlist_device_t
+class NETLIB_NAME(gnd) : public device_t
{
public:
- ATTR_COLD NETLIB_NAME(gnd)()
- : netlist_device_t(GND) { }
+ NETLIB_NAME(gnd)()
+ : device_t(GND) { }
- /* ATTR_COLD */ virtual ~NETLIB_NAME(gnd)() {}
+ virtual ~NETLIB_NAME(gnd)() {}
protected:
- ATTR_COLD void start()
+ void start()
{
register_output("Q", m_Q);
}
- ATTR_COLD void reset()
+ void reset()
{
}
- ATTR_HOT void update()
+ void update()
{
OUTANALOG(m_Q, 0.0);
}
private:
- netlist_analog_output_t m_Q;
+ analog_output_t m_Q;
};
@@ -163,31 +186,31 @@ private:
// nld_dummy_input
// -----------------------------------------------------------------------------
-class NETLIB_NAME(dummy_input) : public netlist_device_t
+class NETLIB_NAME(dummy_input) : public device_t
{
public:
- ATTR_COLD NETLIB_NAME(dummy_input)()
- : netlist_device_t(DUMMY) { }
+ NETLIB_NAME(dummy_input)()
+ : device_t(DUMMY) { }
- /* ATTR_COLD */ virtual ~NETLIB_NAME(dummy_input)() {}
+ virtual ~NETLIB_NAME(dummy_input)() {}
protected:
- ATTR_COLD void start()
+ void start()
{
register_input("I", m_I);
}
- ATTR_COLD void reset()
+ void reset()
{
}
- ATTR_HOT void update()
+ void update()
{
}
private:
- netlist_analog_input_t m_I;
+ analog_input_t m_I;
};
@@ -195,58 +218,121 @@ private:
// nld_frontier
// -----------------------------------------------------------------------------
-class NETLIB_NAME(frontier) : public netlist_device_t
+class NETLIB_NAME(frontier) : public device_t
{
public:
- ATTR_COLD NETLIB_NAME(frontier)()
- : netlist_device_t(DUMMY) { }
+ NETLIB_NAME(frontier)()
+ : device_t(DUMMY) { }
- /* ATTR_COLD */ virtual ~NETLIB_NAME(frontier)() {}
+ virtual ~NETLIB_NAME(frontier)() {}
protected:
- ATTR_COLD void start()
+ void start()
{
- register_input("I", m_I);
- register_output("Q", m_Q);
+ register_param("RIN", m_p_RIN, 1.0e6);
+ register_param("ROUT", m_p_ROUT, 50.0);
+
+ register_input("_I", m_I);
+ register_terminal("I",m_RIN.m_P);
+ register_terminal("G",m_RIN.m_N);
+ connect_late(m_I, m_RIN.m_P);
+
+ register_output("_Q", m_Q);
+ register_terminal("_OP",m_ROUT.m_P);
+ register_terminal("Q",m_ROUT.m_N);
+ connect_late(m_Q, m_ROUT.m_P);
}
- ATTR_COLD void reset()
+ void reset()
{
+ m_RIN.set(1.0 / m_p_RIN.Value(),0,0);
+ m_ROUT.set(1.0 / m_p_ROUT.Value(),0,0);
}
- ATTR_HOT void update()
+ void update()
{
OUTANALOG(m_Q, INPANALOG(m_I));
}
private:
- netlist_analog_input_t m_I;
- netlist_analog_output_t m_Q;
+ NETLIB_NAME(twoterm) m_RIN;
+ NETLIB_NAME(twoterm) m_ROUT;
+ analog_input_t m_I;
+ analog_output_t m_Q;
+
+ param_double_t m_p_RIN;
+ param_double_t m_p_ROUT;
+};
+
+/* -----------------------------------------------------------------------------
+ * nld_function
+ *
+ * FIXME: Currently a proof of concept to get congo bongo working
+ * ----------------------------------------------------------------------------- */
+
+class NETLIB_NAME(function) : public device_t
+{
+public:
+ NETLIB_NAME(function)()
+ : device_t() { }
+
+ virtual ~NETLIB_NAME(function)() {}
+
+protected:
+
+ void start();
+ void reset();
+ void update();
+
+private:
+
+ enum rpn_cmd
+ {
+ ADD,
+ MULT,
+ SUB,
+ DIV,
+ PUSH_CONST,
+ PUSH_INPUT,
+ };
+
+ struct rpn_inst
+ {
+ rpn_inst() : m_cmd(ADD), m_param(0.0) { }
+ rpn_cmd m_cmd;
+ nl_double m_param;
+ };
+ param_int_t m_N;
+ param_str_t m_func;
+ analog_output_t m_Q;
+ analog_input_t m_I[10];
+
+ plist_t<rpn_inst> m_precompiled;
};
// -----------------------------------------------------------------------------
// nld_res_sw
// -----------------------------------------------------------------------------
-class NETLIB_NAME(res_sw) : public netlist_device_t
+class NETLIB_NAME(res_sw) : public device_t
{
public:
- ATTR_COLD NETLIB_NAME(res_sw)()
- : netlist_device_t() { }
+ NETLIB_NAME(res_sw)()
+ : device_t() { }
- /* ATTR_COLD */ virtual ~NETLIB_NAME(res_sw)() {}
+ virtual ~NETLIB_NAME(res_sw)() {}
- netlist_param_double_t m_RON;
- netlist_param_double_t m_ROFF;
- netlist_logic_input_t m_I;
+ param_double_t m_RON;
+ param_double_t m_ROFF;
+ logic_input_t m_I;
NETLIB_NAME(R) m_R;
protected:
- ATTR_COLD void start();
- ATTR_COLD void reset();
+ void start();
+ void reset();
ATTR_HOT void update();
ATTR_HOT void update_param();
@@ -258,33 +344,33 @@ private:
// nld_base_proxy
// -----------------------------------------------------------------------------
-class nld_base_proxy : public netlist_device_t
+class nld_base_proxy : public device_t
{
public:
- ATTR_COLD nld_base_proxy(netlist_logic_t &inout_proxied, netlist_core_terminal_t &proxy_inout)
- : netlist_device_t()
+ nld_base_proxy(logic_t *inout_proxied, core_terminal_t *proxy_inout)
+ : device_t()
{
- m_logic_family = inout_proxied.logic_family();
- m_term_proxied = &inout_proxied;
- m_proxy_term = &proxy_inout;
+ m_logic_family = inout_proxied->logic_family();
+ m_term_proxied = inout_proxied;
+ m_proxy_term = proxy_inout;
}
- /* ATTR_COLD */ virtual ~nld_base_proxy() {}
+ virtual ~nld_base_proxy() {}
- ATTR_COLD netlist_logic_t &term_proxied() const { return *m_term_proxied; }
- ATTR_COLD netlist_core_terminal_t &proxy_term() const { return *m_proxy_term; }
+ logic_t &term_proxied() const { return *m_term_proxied; }
+ core_terminal_t &proxy_term() const { return *m_proxy_term; }
protected:
- /* ATTR_COLD */ virtual const netlist_logic_family_desc_t &logic_family() const
+ virtual const logic_family_desc_t &logic_family() const
{
return *m_logic_family;
}
private:
- const netlist_logic_family_desc_t *m_logic_family;
- netlist_logic_t *m_term_proxied;
- netlist_core_terminal_t *m_proxy_term;
+ const logic_family_desc_t *m_logic_family;
+ logic_t *m_term_proxied;
+ core_terminal_t *m_proxy_term;
};
// -----------------------------------------------------------------------------
@@ -294,29 +380,30 @@ private:
class nld_a_to_d_proxy : public nld_base_proxy
{
public:
- ATTR_COLD nld_a_to_d_proxy(netlist_logic_input_t &in_proxied)
- : nld_base_proxy(in_proxied, m_I)
+ nld_a_to_d_proxy(logic_input_t *in_proxied)
+ : nld_base_proxy(in_proxied, &m_I)
{
}
- /* ATTR_COLD */ virtual ~nld_a_to_d_proxy() {}
+ virtual ~nld_a_to_d_proxy() {}
- netlist_analog_input_t m_I;
- netlist_logic_output_t m_Q;
+ analog_input_t m_I;
+ logic_output_t m_Q;
protected:
- ATTR_COLD void start()
+ void start()
{
register_input("I", m_I);
register_output("Q", m_Q);
}
- ATTR_COLD void reset()
+ void reset()
{
}
ATTR_HOT void update()
{
+ //printf("%s: %f\n", name().cstr(), m_I.Q_Analog());
if (m_I.Q_Analog() > logic_family().m_high_thresh_V)
OUTLOGIC(m_Q, 1, NLTIME_FROM_NS(1));
else if (m_I.Q_Analog() < logic_family().m_low_thresh_V)
@@ -336,22 +423,22 @@ private:
class nld_base_d_to_a_proxy : public nld_base_proxy
{
public:
- ATTR_COLD nld_base_d_to_a_proxy(netlist_logic_output_t &out_proxied, netlist_core_terminal_t &proxy_out)
- : nld_base_proxy(out_proxied, proxy_out)
- {
- }
-
- /* ATTR_COLD */ virtual ~nld_base_d_to_a_proxy() {}
+ virtual ~nld_base_d_to_a_proxy() {}
- /* ATTR_COLD */ virtual netlist_logic_input_t &in() { return m_I; }
+ virtual logic_input_t &in() { return m_I; }
protected:
- /* ATTR_COLD */ virtual void start()
+ nld_base_d_to_a_proxy(logic_output_t *out_proxied, core_terminal_t &proxy_out)
+ : nld_base_proxy(out_proxied, &proxy_out)
+ {
+ }
+
+ virtual void start()
{
register_input("I", m_I);
}
- netlist_logic_input_t m_I;
+ logic_input_t m_I;
private:
};
@@ -359,7 +446,7 @@ private:
class nld_d_to_a_proxy : public nld_base_d_to_a_proxy
{
public:
- ATTR_COLD nld_d_to_a_proxy(netlist_logic_output_t &out_proxied)
+ nld_d_to_a_proxy(logic_output_t *out_proxied)
: nld_base_d_to_a_proxy(out_proxied, m_RV.m_P)
, m_RV(TWOTERM)
, m_last_state(-1)
@@ -367,20 +454,61 @@ public:
{
}
- /* ATTR_COLD */ virtual ~nld_d_to_a_proxy() {}
+ virtual ~nld_d_to_a_proxy() {}
protected:
- /* ATTR_COLD */ virtual void start();
+ virtual void start();
- /* ATTR_COLD */ virtual void reset();
+ virtual void reset();
ATTR_HOT void update();
private:
- netlist_analog_output_t m_Q;
+ analog_output_t m_Q;
nld_twoterm m_RV;
int m_last_state;
bool m_is_timestep;
};
+
+class factory_lib_entry_t : public base_factory_t
+{
+ P_PREVENT_COPYING(factory_lib_entry_t)
+public:
+
+ ATTR_COLD factory_lib_entry_t(setup_t &setup, const pstring &name, const pstring &classname,
+ const pstring &def_param)
+ : base_factory_t(name, classname, def_param), m_setup(setup) { }
+
+ class dummy : public device_t
+ {
+ public:
+ dummy(const pstring &dev_name) : device_t(), m_dev_name(dev_name) { }
+ protected:
+ virtual void init(netlist_t &anetlist, const pstring &aname)
+ {
+ anetlist.setup().namespace_push(aname);
+ anetlist.setup().include(m_dev_name);
+ anetlist.setup().namespace_pop();
+ }
+ void start() { }
+ void reset() { }
+ void update() { }
+
+ pstring m_dev_name;
+ };
+
+ ATTR_COLD device_t *Create()
+ {
+ device_t *r = palloc(dummy(this->name()));
+ return r;
+ }
+
+private:
+ setup_t &m_setup;
+};
+
+
+NETLIB_NAMESPACE_DEVICES_END()
+
#endif /* NLD_SYSTEM_H_ */
diff --git a/src/emu/netlist/devices/nld_truthtable.c b/src/emu/netlist/devices/nld_truthtable.c
index 03acc31d4f4..4ae30d23cbf 100644
--- a/src/emu/netlist/devices/nld_truthtable.c
+++ b/src/emu/netlist/devices/nld_truthtable.c
@@ -8,6 +8,8 @@
#include "nld_truthtable.h"
#include "../plib/plists.h"
+NETLIB_NAMESPACE_DEVICES_START()
+
unsigned truthtable_desc_t::count_bits(UINT32 v)
{
unsigned ret = 0;
@@ -97,7 +99,7 @@ UINT32 truthtable_desc_t::get_ignored_extended(UINT32 i)
// desc
// ----------------------------------------------------------------------------------------
-ATTR_COLD void truthtable_desc_t::help(unsigned cur, pstring_list_t list,
+void truthtable_desc_t::help(unsigned cur, pstring_list_t list,
UINT64 state,UINT16 val, UINT8 *timing_index)
{
pstring elem = list[cur].trim();
@@ -133,7 +135,7 @@ ATTR_COLD void truthtable_desc_t::help(unsigned cur, pstring_list_t list,
{
// cutoff previous inputs and outputs for ignore
if (m_outs[nstate] != ~0U && m_outs[nstate] != val)
- nl_fatalerror("Error in truthtable: State %04x already set, %d != %d\n",
+ fatalerror_e("Error in truthtable: State %04x already set, %d != %d\n",
(UINT32) nstate, m_outs[nstate], val);
m_outs[nstate] = val;
for (unsigned j=0; j<m_NO; j++)
@@ -142,7 +144,7 @@ ATTR_COLD void truthtable_desc_t::help(unsigned cur, pstring_list_t list,
}
}
-ATTR_COLD void truthtable_desc_t::setup(const pstring_list_t &truthtable, UINT32 disabled_ignore)
+void truthtable_desc_t::setup(const pstring_list_t &truthtable, UINT32 disabled_ignore)
{
unsigned line = 0;
@@ -229,18 +231,18 @@ ATTR_COLD void truthtable_desc_t::setup(const pstring_list_t &truthtable, UINT32
for (UINT32 i=0; i<m_size; i++)
{
if (m_outs[i] == ~0U)
- nl_fatalerror("truthtable: found element not set %04x\n", i);
+ fatalerror_e("truthtable: found element not set %04x\n", i);
m_outs[i] |= ((ign[i] & ~disabled_ignore) << m_NO);
}
*m_initialized = true;
}
-#define ENTRYX(_n,_m,_h) case (_n * 1000 + _m * 10 + _h): \
+#define ENTRYX(_n,_m,_h) case (_n * 1000 + _m * 10 + _h): \
{ typedef netlist_factory_truthtable_t<_n,_m,_h> xtype; \
- return palloc(xtype,name,classname,def_param); } break
+ return palloc(xtype(name,classname,def_param)); } break
-#define ENTRYY(_n,_m) ENTRYX(_n,_m,0); ENTRYX(_n,_m,1)
+#define ENTRYY(_n,_m) ENTRYX(_n,_m,0); ENTRYX(_n,_m,1)
#define ENTRY(_n) ENTRYY(_n, 1); ENTRYY(_n, 2); ENTRYY(_n, 3); ENTRYY(_n, 4); ENTRYY(_n, 5); ENTRYY(_n, 6)
@@ -267,3 +269,5 @@ netlist_base_factory_truthtable_t *nl_tt_factory_create(const unsigned ni, const
}
return NULL;
}
+
+NETLIB_NAMESPACE_DEVICES_END()
diff --git a/src/emu/netlist/devices/nld_truthtable.h b/src/emu/netlist/devices/nld_truthtable.h
index 3f447d28f2e..aff146cfb91 100644
--- a/src/emu/netlist/devices/nld_truthtable.h
+++ b/src/emu/netlist/devices/nld_truthtable.h
@@ -24,6 +24,26 @@
static const char *m_desc[]; \
}
+#define TRUTHTABLE_START(_name, _in, _out, _has_state, _def_params) \
+ { \
+ netlist::devices::netlist_base_factory_truthtable_t *ttd = netlist::devices::nl_tt_factory_create(_in, _out, _has_state, \
+ # _name, # _name, "+" _def_params);
+
+#define TT_HEAD(_x) \
+ ttd->m_desc.add(_x);
+
+#define TT_LINE(_x) \
+ ttd->m_desc.add(_x);
+
+#define TT_FAMILY(_x) \
+ ttd->m_family = netlist::logic_family_desc_t::from_model(setup.get_model_str(_x));
+
+#define TRUTHTABLE_END() \
+ setup.factory().register_device(ttd); \
+ }
+
+NETLIB_NAMESPACE_DEVICES_START()
+
#if 0
static inline UINT32 remove_first_bit(UINT32 v)
{
@@ -45,10 +65,10 @@ struct truthtable_desc_t
{
}
- ATTR_COLD void setup(const pstring_list_t &desc, UINT32 disabled_ignore);
+ void setup(const pstring_list_t &desc, UINT32 disabled_ignore);
private:
- ATTR_COLD void help(unsigned cur, pstring_list_t list,
+ void help(unsigned cur, pstring_list_t list,
UINT64 state,UINT16 val, UINT8 *timing_index);
static unsigned count_bits(UINT32 v);
static UINT32 set_bits(UINT32 v, UINT32 b);
@@ -71,7 +91,7 @@ private:
};
template<unsigned m_NI, unsigned m_NO, int has_state>
-class nld_truthtable_t : public netlist_device_t
+class nld_truthtable_t : public device_t
{
public:
@@ -90,7 +110,7 @@ public:
};
nld_truthtable_t(truthtable_t *ttbl, const char *desc[])
- : netlist_device_t(), m_last_state(0), m_ign(0), m_active(1), m_ttp(ttbl)
+ : device_t(), m_last_state(0), m_ign(0), m_active(1), m_ttp(ttbl)
{
while (*desc != NULL && **desc != 0 )
{
@@ -101,12 +121,12 @@ public:
}
nld_truthtable_t(truthtable_t *ttbl, const pstring_list_t &desc)
- : netlist_device_t(), m_last_state(0), m_ign(0), m_active(1), m_ttp(ttbl)
+ : device_t(), m_last_state(0), m_ign(0), m_active(1), m_ttp(ttbl)
{
m_desc = desc;
}
- /* ATTR_COLD */ virtual void start()
+ virtual void start()
{
pstring header = m_desc[0];
@@ -121,7 +141,7 @@ public:
for (unsigned i=0; i < m_NI; i++)
{
inout[i] = inout[i].trim();
- register_input(inout[i], m_i[i]);
+ register_input(inout[i], m_I[i]);
}
for (unsigned i=0; i < m_NO; i++)
{
@@ -138,7 +158,7 @@ public:
if (idx>=0)
{
//printf("connecting %s %d\n", out[i].cstr(), idx);
- connect(m_Q[i], m_i[idx]);
+ connect_late(m_Q[i], m_I[idx]);
// disable ignore for this inputs altogether.
// FIXME: This shouldn't be necessary
disabled_ignore |= (1<<idx);
@@ -157,16 +177,17 @@ public:
for (int k=0; m_ttp->m_timing_nt[k] != netlist_time::zero; k++)
printf("%d %f\n", k, m_ttp->m_timing_nt[k].as_double() * 1000000.0);
#endif
- // FIXME: save state
save(NLNAME(m_last_state));
save(NLNAME(m_ign));
save(NLNAME(m_active));
-
}
- ATTR_COLD void reset()
+ void reset()
{
m_active = 0;
+ m_ign = 0;
+ for (unsigned i = 0; i < m_NI; i++)
+ m_I[i].activate();
for (unsigned i=0; i<m_NO;i++)
if (this->m_Q[i].net().num_cons()>0)
m_active++;
@@ -174,34 +195,35 @@ public:
}
template<bool doOUT>
- ATTR_HOT inline void process()
+ inline void process()
{
netlist_time mt = netlist_time::zero;
UINT32 state = 0;
for (unsigned i = 0; i < m_NI; i++)
{
- if (!doOUT || (m_ign & (1<<i)) != 0)
- m_i[i].activate();
+ if (!doOUT || (m_ign & (1<<i)))
+ m_I[i].activate();
}
for (unsigned i = 0; i < m_NI; i++)
{
- state |= (INPLOGIC(m_i[i]) << i);
+ state |= (INPLOGIC(m_I[i]) << i);
if (!doOUT)
- if (this->m_i[i].net().time() > mt)
- mt = this->m_i[i].net().time();
+ if (this->m_I[i].net().time() > mt)
+ mt = this->m_I[i].net().time();
}
const UINT32 nstate = state | (has_state ? (m_last_state << m_NI) : 0);
- const UINT32 out = m_ttp->m_outs[nstate] & ((1 << m_NO) - 1);
- m_ign = m_ttp->m_outs[nstate] >> m_NO;
+ const UINT32 outstate = m_ttp->m_outs[nstate];
+ const UINT32 out = outstate & ((1 << m_NO) - 1);
+ m_ign = outstate >> m_NO;
if (has_state)
m_last_state = (state << m_NO) | out;
#if 0
for (int i = 0; i < m_NI; i++)
if (m_ign & (1 << i))
- m_i[i].inactivate();
+ m_I[i].inactivate();
#endif
const UINT32 timebase = nstate * m_NO;
if (doOUT)
@@ -213,10 +235,12 @@ public:
for (unsigned i = 0; i < m_NO; i++)
m_Q[i].net().set_Q_time((out >> i) & 1, mt + m_ttp->m_timing_nt[m_ttp->m_timing[timebase + i]]);
- for (unsigned i = 0; i < m_NI; i++)
- if (m_ign & (1 << i))
- m_i[i].inactivate();
-
+ if (m_NI > 1 || has_state)
+ {
+ for (unsigned i = 0; i < m_NI; i++)
+ if (m_ign & (1 << i))
+ m_I[i].inactivate();
+ }
}
ATTR_HOT void update()
@@ -237,16 +261,27 @@ public:
ATTR_HOT void dec_active()
{
nl_assert(netlist().use_deactivate());
- if (has_state == 0)
+ /* FIXME:
+ * Based on current measurements there is no point to disable
+ * 1 input devices. This should actually be a parameter so that we
+ * can decide for each individual gate whether it is benefitial to
+ * ignore deactivation.
+ */
+ if (m_NI < 2)
+ return;
+ else if (has_state == 0)
+ {
if (--m_active == 0)
{
for (unsigned i = 0; i< m_NI; i++)
- m_i[i].inactivate();
+ m_I[i].inactivate();
+ m_ign = (1<<m_NI)-1;
}
+ }
}
- netlist_logic_input_t m_i[m_NI];
- netlist_logic_output_t m_Q[m_NO];
+ logic_input_t m_I[m_NI];
+ logic_output_t m_Q[m_NO];
private:
@@ -258,31 +293,40 @@ private:
pstring_list_t m_desc;
};
-class netlist_base_factory_truthtable_t : public netlist_base_factory_t
+class netlist_base_factory_truthtable_t : public base_factory_t
{
- NETLIST_PREVENT_COPYING(netlist_base_factory_truthtable_t)
+ P_PREVENT_COPYING(netlist_base_factory_truthtable_t)
public:
- ATTR_COLD netlist_base_factory_truthtable_t(const pstring &name, const pstring &classname,
+ netlist_base_factory_truthtable_t(const pstring &name, const pstring &classname,
const pstring &def_param)
- : netlist_base_factory_t(name, classname, def_param)
+ : base_factory_t(name, classname, def_param), m_family(netlist_family_TTL)
{}
+
+ virtual ~netlist_base_factory_truthtable_t()
+ {
+ if (!m_family->m_is_static)
+ pfree(m_family);
+ }
+
pstring_list_t m_desc;
+ logic_family_desc_t *m_family;
};
template<unsigned m_NI, unsigned m_NO, int has_state>
class netlist_factory_truthtable_t : public netlist_base_factory_truthtable_t
{
- NETLIST_PREVENT_COPYING(netlist_factory_truthtable_t)
+ P_PREVENT_COPYING(netlist_factory_truthtable_t)
public:
- ATTR_COLD netlist_factory_truthtable_t(const pstring &name, const pstring &classname,
+ netlist_factory_truthtable_t(const pstring &name, const pstring &classname,
const pstring &def_param)
: netlist_base_factory_truthtable_t(name, classname, def_param) { }
- ATTR_COLD netlist_device_t *Create()
+ device_t *Create()
{
typedef nld_truthtable_t<m_NI, m_NO, has_state> tt_type;
- netlist_device_t *r = palloc(tt_type, &m_ttbl, m_desc);
+ device_t *r = palloc(tt_type(&m_ttbl, m_desc));
+ r->set_logic_family(m_family);
//r->init(setup, name);
return r;
}
@@ -295,20 +339,8 @@ netlist_base_factory_truthtable_t *nl_tt_factory_create(const unsigned ni, const
const pstring &name, const pstring &classname,
const pstring &def_param);
-#define TRUTHTABLE_START(_name, _in, _out, _has_state, _def_params) \
- { \
- netlist_base_factory_truthtable_t *ttd = nl_tt_factory_create(_in, _out, _has_state, \
- # _name, # _name, "+" _def_params);
-
-#define TT_HEAD(_x) \
- ttd->m_desc.add(_x);
-
-#define TT_LINE(_x) \
- ttd->m_desc.add(_x);
+NETLIB_NAMESPACE_DEVICES_END()
-#define TRUTHTABLE_END() \
- setup.factory().register_device(ttd); \
- }
#endif /* NLD_TRUTHTABLE_H_ */
diff --git a/src/emu/netlist/macro/nlm_cd4xxx.c b/src/emu/netlist/macro/nlm_cd4xxx.c
new file mode 100644
index 00000000000..97777b193aa
--- /dev/null
+++ b/src/emu/netlist/macro/nlm_cd4xxx.c
@@ -0,0 +1,172 @@
+
+#include "nlm_cd4xxx.h"
+
+#include "devices/nld_truthtable.h"
+#include "devices/nld_system.h"
+#include "devices/nld_4020.h"
+#include "devices/nld_4066.h"
+
+/*
+ * CD4001BC: Quad 2-Input NOR Buffered B Series Gate
+ *
+ * +--------------+
+ * A1 |1 ++ 14| VCC
+ * B1 |2 13| A6
+ * A2 |3 12| Y6
+ * Y2 |4 4001 11| A5
+ * A3 |5 10| Y5
+ * Y3 |6 9| A4
+ * GND |7 8| Y4
+ * +--------------+
+ *
+ */
+
+NETLIST_START(CD4001_DIP)
+ CD4001_NOR(s1)
+ CD4001_NOR(s2)
+ CD4001_NOR(s3)
+ CD4001_NOR(s4)
+
+ DUMMY_INPUT(VSS)
+ DUMMY_INPUT(VDD)
+
+ DIPPINS( /* +--------------+ */
+ s1.A, /* A1 |1 ++ 14| VCC */ VSS.I,
+ s1.B, /* B1 |2 13| A6 */ s4.B,
+ s1.Q, /* A2 |3 12| Y6 */ s4.A,
+ s2.Q, /* Y2 |4 4001 11| A5 */ s4.Q,
+ s2.A, /* A3 |5 10| Y5 */ s3.Q,
+ s2.B, /* Y3 |6 9| A4 */ s3.B,
+ VDD.I, /* GND |7 8| Y4 */ s3.A
+ /* +--------------+ */
+ )
+
+NETLIST_END()
+
+/* CD4020: 14-Stage Ripple Carry Binary Counters
+ *
+ * +--------------+
+ * Q12 |1 ++ 16| VDD
+ * Q13 |2 15| Q11
+ * Q14 |3 14| Q10
+ * Q6 |4 4020 13| Q8
+ * Q5 |5 12| Q9
+ * Q7 |6 11| RESET
+ * Q4 |7 10| IP (Input pulses)
+ * VSS |8 9| Q1
+ * +--------------+
+ *
+ * Naming conventions follow Texas Instruments datasheet
+ *
+ * FIXME: Timing depends on VDD-VSS
+ * This needs a cmos d-a/a-d proxy implementation.
+ */
+
+NETLIST_START(CD4020_DIP)
+
+ CD4020(s1)
+ DIPPINS( /* +--------------+ */
+ s1.Q12, /* Q12 |1 ++ 16| VDD */ s1.VDD,
+ s1.Q13, /* Q13 |2 15| Q11 */ s1.Q11,
+ s1.Q14, /* Q14 |3 14| Q10 */ s1.Q10,
+ s1.Q6, /* Q6 |4 4020 13| Q8 */ s1.Q8,
+ s1.Q5, /* Q5 |5 12| Q9 */ s1.Q9,
+ s1.Q7, /* Q7 |6 11| RESET */ s1.RESET,
+ s1.Q4, /* Q4 |7 10| IP */ s1.IP,
+ s1.VSS, /* VSS |8 9| Q1 */ s1.Q1
+ /* +--------------+ */
+ )
+ /*
+ * IP = (Input pulses)
+ */
+
+NETLIST_END()
+
+/* CD4066: Quad Bilateral Switch
+ *
+ * +--------------+
+ * INOUTA |1 ++ 14| VDD
+ * OUTINA |2 13| CONTROLA
+ * OUTINB |3 12| CONTROLD
+ * INOUTB |4 4066 11| INOUTD
+ * CONTROLB |5 10| OUTIND
+ * CONTROLC |6 9| OUTINC
+ * VSS |7 8| INOUTC
+ * +--------------+
+ *
+ * FIXME: These devices are slow (~125 ns). THis is currently not reflected
+ *
+ * Naming conventions follow National semiconductor datasheet
+ *
+ */
+
+NETLIST_START(CD4066_DIP)
+ CD4066_GATE(A)
+ CD4066_GATE(B)
+ CD4066_GATE(C)
+ CD4066_GATE(D)
+
+ NET_C(A.PS.VDD, B.PS.VDD, C.PS.VDD, D.PS.VDD)
+ NET_C(A.PS.VSS, B.PS.VSS, C.PS.VSS, D.PS.VSS)
+
+ PARAM(A.BASER, 270.0)
+ PARAM(B.BASER, 270.0)
+ PARAM(C.BASER, 270.0)
+ PARAM(D.BASER, 270.0)
+
+ DIPPINS( /* +--------------+ */
+ A.R.1, /* INOUTA |1 ++ 14| VDD */ A.PS.VDD,
+ A.R.2, /* OUTINA |2 13| CONTROLA */ A.CTL,
+ B.R.1, /* OUTINB |3 12| CONTROLD */ D.CTL,
+ B.R.2, /* INOUTB |4 4066 11| INOUTD */ D.R.1,
+ B.CTL, /* CONTROLB |5 10| OUTIND */ D.R.2,
+ C.CTL, /* CONTROLC |6 9| OUTINC */ C.R.1,
+ A.PS.VSS, /* VSS |7 8| INOUTC */ C.R.2
+ /* +--------------+ */
+ )
+NETLIST_END()
+
+NETLIST_START(CD4016_DIP)
+ CD4066_GATE(A)
+ CD4066_GATE(B)
+ CD4066_GATE(C)
+ CD4066_GATE(D)
+
+ NET_C(A.PS.VDD, B.PS.VDD, C.PS.VDD, D.PS.VDD)
+ NET_C(A.PS.VSS, B.PS.VSS, C.PS.VSS, D.PS.VSS)
+
+ PARAM(A.BASER, 1000.0)
+ PARAM(B.BASER, 1000.0)
+ PARAM(C.BASER, 1000.0)
+ PARAM(D.BASER, 1000.0)
+
+ DIPPINS( /* +--------------+ */
+ A.R.1, /* INOUTA |1 ++ 14| VDD */ A.PS.VDD,
+ A.R.2, /* OUTINA |2 13| CONTROLA */ A.CTL,
+ B.R.1, /* OUTINB |3 12| CONTROLD */ D.CTL,
+ B.R.2, /* INOUTB |4 4016 11| INOUTD */ D.R.1,
+ B.CTL, /* CONTROLB |5 10| OUTIND */ D.R.2,
+ C.CTL, /* CONTROLC |6 9| OUTINC */ C.R.1,
+ A.PS.VSS, /* VSS |7 8| INOUTC */ C.R.2
+ /* +--------------+ */
+ )
+NETLIST_END()
+
+NETLIST_START(CD4XXX_lib)
+
+ TRUTHTABLE_START(CD4001_NOR, 2, 1, 0, "")
+ TT_HEAD("A , B | Q ")
+ TT_LINE("0,0|1|85")
+ TT_LINE("X,1|0|120")
+ TT_LINE("1,X|0|120")
+ TT_FAMILY("CD4XXX")
+ TRUTHTABLE_END()
+
+ LOCAL_LIB_ENTRY(CD4001_DIP)
+
+ /* DIP ONLY */
+ LOCAL_LIB_ENTRY(CD4020_DIP)
+ LOCAL_LIB_ENTRY(CD4016_DIP)
+ LOCAL_LIB_ENTRY(CD4066_DIP)
+
+NETLIST_END()
diff --git a/src/emu/netlist/macro/nlm_cd4xxx.h b/src/emu/netlist/macro/nlm_cd4xxx.h
new file mode 100644
index 00000000000..e841fb89afc
--- /dev/null
+++ b/src/emu/netlist/macro/nlm_cd4xxx.h
@@ -0,0 +1,50 @@
+#ifndef NLD_CD4XXX_H_
+#define NLD_CD4XXX_H_
+
+#include "../nl_setup.h"
+
+/*
+ * Devices:
+ *
+ * CD4001_NOR : single gate
+ * CD4001_DIP : dip package
+ * CD4020_DIP : dip package (device model in core)
+ * CD4016_DIP : dip package (device model in core)
+ * CD4066_DIP : dip package (device model in core)
+ *
+ */
+
+#ifndef __PLIB_PREPROCESSOR__
+
+/* ----------------------------------------------------------------------------
+ * Netlist Macros
+ * ---------------------------------------------------------------------------*/
+
+#define CD4001_NOR(_name) \
+ NET_REGISTER_DEV(CD4001_NOR, _name)
+
+#define CD4001_DIP(_name) \
+ NET_REGISTER_DEV(CD4001_DIP, _name)
+
+/* ----------------------------------------------------------------------------
+ * DIP only macros
+ * ---------------------------------------------------------------------------*/
+
+#define CD4020_DIP(_name) \
+ NET_REGISTER_DEV(CD4020_DIP, _name)
+
+#define CD4066_DIP(_name) \
+ NET_REGISTER_DEV(CD4066_DIP, _name)
+
+#define CD4016_DIP(_name) \
+ NET_REGISTER_DEV(CD4016_DIP, _name)
+
+/* ----------------------------------------------------------------------------
+ * External declarations
+ * ---------------------------------------------------------------------------*/
+
+NETLIST_EXTERNAL(CD4XXX_lib)
+
+#endif
+
+#endif
diff --git a/src/emu/netlist/macro/nlm_opamp.c b/src/emu/netlist/macro/nlm_opamp.c
new file mode 100644
index 00000000000..143f4d8cfec
--- /dev/null
+++ b/src/emu/netlist/macro/nlm_opamp.c
@@ -0,0 +1,47 @@
+
+#include "nlm_opamp.h"
+
+#include "analog/nld_opamps.h"
+#include "devices/nld_system.h"
+
+/*
+ * Generic layout with 4 opamps, VCC on pint 4 and GND on pin 11
+ */
+
+NETLIST_START(opamp_layout_4_4_11)
+ DIPPINS( /* +--------------+ */
+ A.OUT, /* |1 ++ 14| */ D.OUT,
+ A.MINUS, /* |2 13| */ D.MINUS,
+ A.PLUS, /* |3 12| */ D.PLUS,
+ A.VCC, /* |4 11| */ A.GND,
+ B.PLUS, /* |5 10| */ C.PLUS,
+ B.MINUS, /* |6 9| */ C.MINUS,
+ B.OUT, /* |7 8| */ C.OUT
+ /* +--------------+ */
+ )
+ NET_C(A.GND, B.GND, C.GND, D.GND)
+ NET_C(A.VCC, B.VCC, C.VCC, D.VCC)
+NETLIST_END()
+
+NETLIST_START(MB3614_DIP)
+ /* The opamp actually has an FPF of about 500k. This doesn't work here and causes oscillations.
+ * FPF here therefore about half the Solver clock.
+ */
+ OPAMP(A, "MB3614")
+ OPAMP(B, "MB3614")
+ OPAMP(C, "MB3614")
+ OPAMP(D, "MB3614")
+
+ INCLUDE(opamp_layout_4_4_11)
+
+NETLIST_END()
+
+NETLIST_START(OPAMP_lib)
+ LOCAL_LIB_ENTRY(opamp_layout_4_4_11)
+
+ NET_MODEL(".model MB3614 OPAMP(TYPE=3 VLH=2.0 VLL=0.2 FPF=5 UGF=500k SLEW=0.6M RI=1000k RO=50 DAB=0.002)")
+ NET_MODEL(".model MB3614_SLOW OPAMP(TYPE=3 VLH=2.0 VLL=0.2 FPF=5 UGF=11k SLEW=0.6M RI=1000k RO=50 DAB=0.002)")
+ LOCAL_LIB_ENTRY(MB3614_DIP)
+
+
+NETLIST_END()
diff --git a/src/emu/netlist/macro/nlm_opamp.h b/src/emu/netlist/macro/nlm_opamp.h
new file mode 100644
index 00000000000..d31a5f0b876
--- /dev/null
+++ b/src/emu/netlist/macro/nlm_opamp.h
@@ -0,0 +1,23 @@
+#ifndef NLM_OPAMP_H_
+#define NLM_OPAMP_H_
+
+#include "../nl_setup.h"
+
+#ifndef __PLIB_PREPROCESSOR__
+
+/* ----------------------------------------------------------------------------
+ * Netlist Macros
+ * ---------------------------------------------------------------------------*/
+
+#define MB3614_DIP(_name) \
+ NET_REGISTER_DEV(MB3614_DIP, _name)
+
+/* ----------------------------------------------------------------------------
+ * External declarations
+ * ---------------------------------------------------------------------------*/
+
+NETLIST_EXTERNAL(OPAMP_lib)
+
+#endif
+
+#endif
diff --git a/src/emu/netlist/macro/nlm_ttl74xx.c b/src/emu/netlist/macro/nlm_ttl74xx.c
new file mode 100644
index 00000000000..75e865b1fe1
--- /dev/null
+++ b/src/emu/netlist/macro/nlm_ttl74xx.c
@@ -0,0 +1,56 @@
+
+#include "nlm_ttl74xx.h"
+
+#include "devices/nld_truthtable.h"
+#include "devices/nld_system.h"
+
+/*
+ * DM7416: Hex Inverting Buffers with
+ * High Voltage Open-Collector Outputs
+ *
+ * +--------------+
+ * A1 |1 ++ 14| VCC
+ * Y1 |2 13| A6
+ * A2 |3 12| Y6
+ * Y2 |4 7416 11| A5
+ * A3 |5 10| Y5
+ * Y3 |6 9| A4
+ * GND |7 8| Y4
+ * +--------------+
+ *
+ */
+
+NETLIST_START(TTL_7416_DIP)
+ TTL_7416_GATE(s1)
+ TTL_7416_GATE(s2)
+ TTL_7416_GATE(s3)
+ TTL_7416_GATE(s4)
+ TTL_7416_GATE(s5)
+ TTL_7416_GATE(s6)
+
+ DUMMY_INPUT(GND)
+ DUMMY_INPUT(VCC)
+
+ DIPPINS( /* +--------------+ */
+ s1.A, /* A1 |1 ++ 14| VCC */ VCC.I,
+ s1.Q, /* Y1 |2 13| A6 */ s6.A,
+ s2.A, /* A2 |3 12| Y6 */ s6.Q,
+ s2.Q, /* Y2 |4 7416 11| A5 */ s5.A,
+ s3.A, /* A3 |5 10| Y5 */ s5.Q,
+ s3.Q, /* Y3 |6 9| A4 */ s4.A,
+ GND.I, /* GND |7 8| Y4 */ s4.Q
+ /* +--------------+ */
+ )
+NETLIST_END()
+
+NETLIST_START(TTL74XX_lib)
+ TRUTHTABLE_START(TTL_7416_GATE, 1, 1, 0, "")
+ TT_HEAD(" A | Q ")
+ TT_LINE(" 0 | 1 |15")
+ TT_LINE(" 1 | 0 |23")
+ /* Open Collector */
+ TT_FAMILY("74XXOC")
+ TRUTHTABLE_END()
+
+ LOCAL_LIB_ENTRY(TTL_7416_DIP)
+NETLIST_END()
diff --git a/src/emu/netlist/macro/nlm_ttl74xx.h b/src/emu/netlist/macro/nlm_ttl74xx.h
new file mode 100644
index 00000000000..91f757dbf7d
--- /dev/null
+++ b/src/emu/netlist/macro/nlm_ttl74xx.h
@@ -0,0 +1,26 @@
+#ifndef NLD_TTL74XX_H_
+#define NLD_TTL74XX_H_
+
+#include "../nl_setup.h"
+
+#ifndef __PLIB_PREPROCESSOR__
+
+/* ----------------------------------------------------------------------------
+ * Netlist Macros
+ * ---------------------------------------------------------------------------*/
+
+#define TTL_7416_GATE(_name) \
+ NET_REGISTER_DEV(TTL_7416_GATE, _name)
+
+#define TTL_7416_DIP(_name) \
+ NET_REGISTER_DEV(TTL7416_DIP, _name)
+
+/* ----------------------------------------------------------------------------
+ * External declarations
+ * ---------------------------------------------------------------------------*/
+
+NETLIST_EXTERNAL(TTL74XX_lib)
+
+#endif
+
+#endif
diff --git a/src/emu/netlist/nl_base.c b/src/emu/netlist/nl_base.c
index b07e462f4f4..c63ddc61a00 100644
--- a/src/emu/netlist/nl_base.c
+++ b/src/emu/netlist/nl_base.c
@@ -5,43 +5,48 @@
*
*/
+#include <solver/nld_solver.h>
#include <cstring>
+#include <algorithm>
+#include <cstdio>
#include "plib/palloc.h"
#include "nl_base.h"
#include "devices/nld_system.h"
-#include "analog/nld_solver.h"
#include "nl_util.h"
-const netlist_time netlist_time::zero = netlist_time::from_raw(0);
+const netlist::netlist_time netlist::netlist_time::zero = netlist::netlist_time::from_raw(0);
+namespace netlist
+{
//============================================================
// Exceptions
//============================================================
// emu_fatalerror is a generic fatal exception that provides an error string
-nl_fatalerror::nl_fatalerror(const char *format, ...)
+fatalerror_e::fatalerror_e(const char *format, ...)
{
va_list ap;
va_start(ap, format);
m_text = pstring(format).vprintf(ap);
+ fprintf(stderr, "%s\n", m_text.cstr());
va_end(ap);
}
-nl_fatalerror::nl_fatalerror(const char *format, va_list ap)
+fatalerror_e::fatalerror_e(const char *format, va_list ap)
{
m_text = pstring(format).vprintf(ap);
}
// ----------------------------------------------------------------------------------------
-// netlist_logic_family_ttl_t
+// logic_family_ttl_t
// ----------------------------------------------------------------------------------------
-class netlist_logic_family_ttl_t : public netlist_logic_family_desc_t
+class logic_family_ttl_t : public logic_family_desc_t
{
public:
- netlist_logic_family_ttl_t()
+ logic_family_ttl_t() : logic_family_desc_t()
{
m_low_thresh_V = 0.8;
m_high_thresh_V = 2.0;
@@ -50,58 +55,92 @@ public:
m_high_V = 4.0;
m_R_low = 1.0;
m_R_high = 130.0;
+ m_is_static = true;
}
- virtual nld_base_d_to_a_proxy *create_d_a_proxy(netlist_logic_output_t &proxied) const
+ virtual devices::nld_base_d_to_a_proxy *create_d_a_proxy(logic_output_t *proxied) const
{
- return palloc(nld_d_to_a_proxy , proxied);
+ return palloc(devices::nld_d_to_a_proxy(proxied));
}
};
//FIXME: set to proper values
-class netlist_logic_family_cd4000_t : public netlist_logic_family_desc_t
+class logic_family_cd4xxx_t : public logic_family_desc_t
{
public:
- netlist_logic_family_cd4000_t()
+ logic_family_cd4xxx_t() : logic_family_desc_t()
{
m_low_thresh_V = 0.8;
m_high_thresh_V = 2.0;
// m_low_V - these depend on sinked/sourced current. Values should be suitable for typical applications.
- m_low_V = 0.1;
- m_high_V = 4.0;
- m_R_low = 1.0;
- m_R_high = 130.0;
+ m_low_V = 0.05;
+ m_high_V = 4.95;
+ m_R_low = 10.0;
+ m_R_high = 10.0;
+ m_is_static = true;
}
- virtual nld_base_d_to_a_proxy *create_d_a_proxy(netlist_logic_output_t &proxied) const
+ virtual devices::nld_base_d_to_a_proxy *create_d_a_proxy(logic_output_t *proxied) const
+ {
+ return palloc(devices::nld_d_to_a_proxy(proxied));
+ }
+};
+
+logic_family_desc_t *netlist_family_TTL = palloc(logic_family_ttl_t);
+logic_family_desc_t *netlist_family_CD4XXX = palloc(logic_family_cd4xxx_t);
+
+class logic_family_std_proxy_t : public logic_family_desc_t
+{
+public:
+ logic_family_std_proxy_t() { }
+ virtual devices::nld_base_d_to_a_proxy *create_d_a_proxy(logic_output_t *proxied) const
{
- return palloc(nld_d_to_a_proxy , proxied);
+ return palloc(devices::nld_d_to_a_proxy(proxied));
}
};
-const netlist_logic_family_desc_t &netlist_family_TTL = netlist_logic_family_ttl_t();
-const netlist_logic_family_desc_t &netlist_family_CD4000 = netlist_logic_family_cd4000_t();
+logic_family_desc_t *logic_family_desc_t::from_model(const pstring &model)
+{
+ if (setup_t::model_value_str(model, "TYPE", "") == "TTL")
+ return netlist_family_TTL;
+ if (setup_t::model_value_str(model, "TYPE", "") == "CD4XXX")
+ return netlist_family_CD4XXX;
+
+ logic_family_std_proxy_t *ret = palloc(logic_family_std_proxy_t);
+
+ ret->m_low_thresh_V = setup_t::model_value(model, "IVL", 0.8);
+ ret->m_high_thresh_V = setup_t::model_value(model, "IVH", 2.0);
+ ret->m_low_V = setup_t::model_value(model, "OVL", 0.1);
+ ret->m_high_V = setup_t::model_value(model, "OVH", 4.0);
+ ret->m_R_low = setup_t::model_value(model, "ORL", 1.0);
+ ret->m_R_high = setup_t::model_value(model, "ORH", 130.0);
+
+ return ret;
+}
+
// ----------------------------------------------------------------------------------------
// netlist_queue_t
// ----------------------------------------------------------------------------------------
-netlist_queue_t::netlist_queue_t(netlist_base_t &nl)
- : netlist_timed_queue<netlist_net_t *, netlist_time, 512>()
- , netlist_object_t(QUEUE, GENERIC)
+queue_t::queue_t(netlist_t &nl)
+ : timed_queue<net_t *, netlist_time>(512)
+ , object_t(QUEUE, GENERIC)
, pstate_callback_t()
, m_qsize(0)
+ , m_times(512)
+ , m_names(512)
{
this->init_object(nl, "QUEUE");
}
-void netlist_queue_t::register_state(pstate_manager_t &manager, const pstring &module)
+void queue_t::register_state(pstate_manager_t &manager, const pstring &module)
{
NL_VERBOSE_OUT(("register_state\n"));
manager.save_item(m_qsize, this, module + "." + "qsize");
- manager.save_item(m_times, this, module + "." + "times");
- manager.save_item(&(m_name[0][0]), this, module + "." + "names", sizeof(m_name));
+ manager.save_item(&m_times[0], this, module + "." + "times", m_times.size());
+ manager.save_item(&(m_names[0].m_buf[0]), this, module + "." + "names", m_names.size() * sizeof(names_t));
}
-void netlist_queue_t::on_pre_save()
+void queue_t::on_pre_save()
{
NL_VERBOSE_OUT(("on_pre_save\n"));
m_qsize = this->count();
@@ -112,22 +151,22 @@ void netlist_queue_t::on_pre_save()
pstring p = this->listptr()[i].object()->name();
int n = p.len();
n = std::min(63, n);
- std::strncpy(&(m_name[i][0]), p, n);
- m_name[i][n] = 0;
+ std::strncpy(m_names[i].m_buf, p, n);
+ m_names[i].m_buf[n] = 0;
}
}
-void netlist_queue_t::on_post_load()
+void queue_t::on_post_load()
{
this->clear();
NL_VERBOSE_OUT(("current time %f qsize %d\n", netlist().time().as_double(), m_qsize));
for (int i = 0; i < m_qsize; i++ )
{
- netlist_net_t *n = netlist().find_net(&(m_name[i][0]));
+ net_t *n = netlist().find_net(m_names[i].m_buf);
//NL_VERBOSE_OUT(("Got %s ==> %p\n", qtemp[i].m_name, n));
- //NL_VERBOSE_OUT(("schedule time %f (%f)\n", n->time().as_double(), qtemp[i].m_time.as_double()));
- this->push(netlist_queue_t::entry_t(netlist_time::from_raw(m_times[i]), n));
+ //NL_VERBOSE_OUT(("schedule time %f (%f)\n", n->time().as_double(), netlist_time::from_raw(m_times[i]).as_double()));
+ this->push(queue_t::entry_t(netlist_time::from_raw(m_times[i]), n));
}
}
@@ -135,24 +174,24 @@ void netlist_queue_t::on_post_load()
// netlist_object_t
// ----------------------------------------------------------------------------------------
-ATTR_COLD netlist_object_t::netlist_object_t(const type_t atype, const family_t afamily)
+ATTR_COLD object_t::object_t(const type_t atype, const family_t afamily)
: m_objtype(atype)
, m_family(afamily)
, m_netlist(NULL)
{}
-ATTR_COLD netlist_object_t::~netlist_object_t()
+ATTR_COLD object_t::~object_t()
{
}
-ATTR_COLD void netlist_object_t::init_object(netlist_base_t &nl, const pstring &aname)
+ATTR_COLD void object_t::init_object(netlist_t &nl, const pstring &aname)
{
m_netlist = &nl;
m_name = aname;
save_register();
}
-ATTR_COLD const pstring &netlist_object_t::name() const
+ATTR_COLD const pstring &object_t::name() const
{
if (m_name == "")
netlist().error("object not initialized");
@@ -163,38 +202,38 @@ ATTR_COLD const pstring &netlist_object_t::name() const
// netlist_owned_object_t
// ----------------------------------------------------------------------------------------
-ATTR_COLD netlist_owned_object_t::netlist_owned_object_t(const type_t atype,
+ATTR_COLD device_object_t::device_object_t(const type_t atype,
const family_t afamily)
-: netlist_object_t(atype, afamily)
-, m_netdev(NULL)
+: object_t(atype, afamily)
+, m_device(NULL)
{
}
-ATTR_COLD void netlist_owned_object_t::init_object(netlist_core_device_t &dev,
+ATTR_COLD void device_object_t::init_object(core_device_t &dev,
const pstring &aname)
{
- netlist_object_t::init_object(dev.netlist(), aname);
- m_netdev = &dev;
+ object_t::init_object(dev.netlist(), aname);
+ m_device = &dev;
}
// ----------------------------------------------------------------------------------------
// netlist_base_t
// ----------------------------------------------------------------------------------------
-netlist_base_t::netlist_base_t()
- : netlist_object_t(NETLIST, GENERIC), pstate_manager_t(),
+netlist_t::netlist_t()
+ : object_t(NETLIST, GENERIC), pstate_manager_t(),
m_stop(netlist_time::zero),
m_time(netlist_time::zero),
+ m_use_deactivate(0),
m_queue(*this),
m_mainclock(NULL),
m_solver(NULL),
m_gnd(NULL),
- m_use_deactivate(0),
m_setup(NULL)
{
}
-netlist_base_t::~netlist_base_t()
+netlist_t::~netlist_t()
{
for (std::size_t i=0; i < m_nets.size(); i++)
{
@@ -211,28 +250,28 @@ netlist_base_t::~netlist_base_t()
pstring::resetmem();
}
-ATTR_COLD void netlist_base_t::save_register()
+ATTR_COLD void netlist_t::save_register()
{
save(static_cast<pstate_callback_t &>(m_queue), "m_queue");
save(NLNAME(m_time));
- netlist_object_t::save_register();
+ object_t::save_register();
}
-ATTR_HOT nl_double netlist_base_t::gmin() const
+ATTR_HOT nl_double netlist_t::gmin() const
{
return solver()->gmin();
}
-ATTR_COLD void netlist_base_t::start()
+ATTR_COLD void netlist_t::start()
{
/* find the main clock and solver ... */
NL_VERBOSE_OUT(("Searching for mainclock and solver ...\n"));
- m_mainclock = get_single_device<NETLIB_NAME(mainclock)>("mainclock");
- m_solver = get_single_device<NETLIB_NAME(solver)>("solver");
- m_gnd = get_single_device<NETLIB_NAME(gnd)>("gnd");
- m_params = get_single_device<NETLIB_NAME(netlistparams)>("parameter");
+ m_mainclock = get_single_device<devices:: NETLIB_NAME(mainclock)>("mainclock");
+ m_solver = get_single_device<devices::NETLIB_NAME(solver)>("solver");
+ m_gnd = get_single_device<devices::NETLIB_NAME(gnd)>("gnd");
+ m_params = get_single_device<devices::NETLIB_NAME(netlistparams)>("parameter");
/* make sure the solver and parameters are started first! */
@@ -249,14 +288,14 @@ ATTR_COLD void netlist_base_t::start()
NL_VERBOSE_OUT(("Initializing devices ...\n"));
for (std::size_t i = 0; i < m_devices.size(); i++)
{
- netlist_device_t *dev = m_devices[i];
+ device_t *dev = m_devices[i];
if (dev != m_solver && dev != m_params)
dev->start_dev();
}
}
-ATTR_COLD void netlist_base_t::stop()
+ATTR_COLD void netlist_t::stop()
{
/* find the main clock and solver ... */
@@ -269,7 +308,7 @@ ATTR_COLD void netlist_base_t::stop()
}
}
-ATTR_COLD netlist_net_t *netlist_base_t::find_net(const pstring &name)
+ATTR_COLD net_t *netlist_t::find_net(const pstring &name)
{
for (std::size_t i = 0; i < m_nets.size(); i++)
{
@@ -279,14 +318,15 @@ ATTR_COLD netlist_net_t *netlist_base_t::find_net(const pstring &name)
return NULL;
}
-ATTR_COLD void netlist_base_t::rebuild_lists()
+ATTR_COLD void netlist_t::rebuild_lists()
{
+ //printf("Rebuild Lists\n");
for (std::size_t i = 0; i < m_nets.size(); i++)
m_nets[i]->rebuild_list();
}
-ATTR_COLD void netlist_base_t::reset()
+ATTR_COLD void netlist_t::reset()
{
m_time = netlist_time::zero;
m_queue.clear();
@@ -320,7 +360,7 @@ ATTR_COLD void netlist_base_t::reset()
}
-ATTR_HOT void netlist_base_t::process_queue(const netlist_time &delta)
+ATTR_HOT void netlist_t::process_queue(const netlist_time &delta)
{
m_stop = m_time + delta;
@@ -328,7 +368,7 @@ ATTR_HOT void netlist_base_t::process_queue(const netlist_time &delta)
{
while ( (m_time < m_stop) && (m_queue.is_not_empty()))
{
- const netlist_queue_t::entry_t e = *m_queue.pop();
+ const queue_t::entry_t e = *m_queue.pop();
m_time = e.exec_time();
e.object()->update_devs();
@@ -338,7 +378,7 @@ ATTR_HOT void netlist_base_t::process_queue(const netlist_time &delta)
m_time = m_stop;
} else {
- netlist_logic_net_t &mc_net = m_mainclock->m_Q.net().as_logic();
+ logic_net_t &mc_net = m_mainclock->m_Q.net().as_logic();
const netlist_time inc = m_mainclock->m_inc;
netlist_time mc_time = mc_net.time();
@@ -350,17 +390,17 @@ ATTR_HOT void netlist_base_t::process_queue(const netlist_time &delta)
{
m_time = mc_time;
mc_time += inc;
- NETLIB_NAME(mainclock)::mc_update(mc_net);
+ devices::NETLIB_NAME(mainclock)::mc_update(mc_net);
}
- const netlist_queue_t::entry_t e = *m_queue.pop();
+ const queue_t::entry_t e = *m_queue.pop();
m_time = e.exec_time();
e.object()->update_devs();
} else {
m_time = mc_time;
mc_time += inc;
- NETLIB_NAME(mainclock)::mc_update(mc_net);
+ devices::NETLIB_NAME(mainclock)::mc_update(mc_net);
}
add_to_stat(m_perf_out_processed, 1);
@@ -369,7 +409,7 @@ ATTR_HOT void netlist_base_t::process_queue(const netlist_time &delta)
}
}
-ATTR_COLD void netlist_base_t::error(const char *format, ...) const
+ATTR_COLD void netlist_t::error(const char *format, ...) const
{
va_list ap;
va_start(ap, format);
@@ -377,7 +417,7 @@ ATTR_COLD void netlist_base_t::error(const char *format, ...) const
va_end(ap);
}
-ATTR_COLD void netlist_base_t::warning(const char *format, ...) const
+ATTR_COLD void netlist_t::warning(const char *format, ...) const
{
va_list ap;
va_start(ap, format);
@@ -385,7 +425,7 @@ ATTR_COLD void netlist_base_t::warning(const char *format, ...) const
va_end(ap);
}
-ATTR_COLD void netlist_base_t::log(const char *format, ...) const
+ATTR_COLD void netlist_t::log(const char *format, ...) const
{
va_list ap;
va_start(ap, format);
@@ -404,8 +444,8 @@ ATTR_COLD void netlist_base_t::log(const char *format, ...) const
// net_core_device_t
// ----------------------------------------------------------------------------------------
-ATTR_COLD netlist_core_device_t::netlist_core_device_t(const family_t afamily)
-: netlist_object_t(DEVICE, afamily), netlist_logic_family_t()
+ATTR_COLD core_device_t::core_device_t(const family_t afamily)
+: object_t(DEVICE, afamily), logic_family_t()
#if (NL_KEEP_STATISTICS)
, stat_total_time(0)
, stat_update_count(0)
@@ -414,27 +454,28 @@ ATTR_COLD netlist_core_device_t::netlist_core_device_t(const family_t afamily)
{
}
-ATTR_COLD void netlist_core_device_t::init(netlist_base_t &anetlist, const pstring &name)
+ATTR_COLD void core_device_t::init(netlist_t &anetlist, const pstring &name)
{
- set_logic_family(this->default_logic_family());
+ if (logic_family() == NULL)
+ set_logic_family(this->default_logic_family());
init_object(anetlist, name);
-#if USE_PMFDELEGATES
- void (netlist_core_device_t::* pFunc)() = &netlist_core_device_t::update;
-#if NO_USE_PMFCONVERSION
- static_update = pFunc;
-#else
- static_update = reinterpret_cast<net_update_delegate>((this->*pFunc));
-#endif
+#if (NL_PMF_TYPE == NL_PMF_TYPE_GNUC_PMF)
+ void (core_device_t::* pFunc)() = &core_device_t::update;
+ m_static_update = pFunc;
+#elif (NL_PMF_TYPE == NL_PMF_TYPE_GNUC_PMF_CONV)
+ void (core_device_t::* pFunc)() = &core_device_t::update;
+ m_static_update = reinterpret_cast<net_update_delegate>((this->*pFunc));
+#elif (NL_PMF_TYPE == NL_PMF_TYPE_INTERNAL)
+ m_static_update = pmfp::get_mfp<net_update_delegate>(&core_device_t::update, this);
#endif
-
}
-ATTR_COLD netlist_core_device_t::~netlist_core_device_t()
+ATTR_COLD core_device_t::~core_device_t()
{
}
-ATTR_COLD void netlist_core_device_t::start_dev()
+ATTR_COLD void core_device_t::start_dev()
{
#if (NL_KEEP_STATISTICS)
netlist().m_started_devices.add(this, false);
@@ -442,16 +483,16 @@ ATTR_COLD void netlist_core_device_t::start_dev()
start();
}
-ATTR_COLD void netlist_core_device_t::stop_dev()
+ATTR_COLD void core_device_t::stop_dev()
{
#if (NL_KEEP_STATISTICS)
#endif
stop();
}
-ATTR_HOT netlist_sig_t netlist_core_device_t::INPLOGIC_PASSIVE(netlist_logic_input_t &inp)
+ATTR_HOT netlist_sig_t core_device_t::INPLOGIC_PASSIVE(logic_input_t &inp)
{
- if (inp.state() != netlist_logic_t::STATE_INP_PASSIVE)
+ if (inp.state() != logic_t::STATE_INP_PASSIVE)
return inp.Q();
else
{
@@ -467,35 +508,35 @@ ATTR_HOT netlist_sig_t netlist_core_device_t::INPLOGIC_PASSIVE(netlist_logic_inp
// netlist_device_t
// ----------------------------------------------------------------------------------------
-netlist_device_t::netlist_device_t()
- : netlist_core_device_t(GENERIC),
+device_t::device_t()
+ : core_device_t(GENERIC),
m_terminals(20)
{
}
-netlist_device_t::netlist_device_t(const family_t afamily)
- : netlist_core_device_t(afamily),
+device_t::device_t(const family_t afamily)
+ : core_device_t(afamily),
m_terminals(20)
{
}
-netlist_device_t::~netlist_device_t()
+device_t::~device_t()
{
//NL_VERBOSE_OUT(("~net_device_t\n");
}
-ATTR_COLD netlist_setup_t &netlist_device_t::setup()
+ATTR_COLD setup_t &device_t::setup()
{
return netlist().setup();
}
-ATTR_COLD void netlist_device_t::init(netlist_base_t &anetlist, const pstring &name)
+ATTR_COLD void device_t::init(netlist_t &anetlist, const pstring &name)
{
- netlist_core_device_t::init(anetlist, name);
+ core_device_t::init(anetlist, name);
}
-ATTR_COLD void netlist_device_t::register_sub(const pstring &name, netlist_device_t &dev)
+ATTR_COLD void device_t::register_sub(const pstring &name, device_t &dev)
{
dev.init(netlist(), this->name() + "." + name);
// subdevices always first inherit the logic family of the parent
@@ -503,60 +544,80 @@ ATTR_COLD void netlist_device_t::register_sub(const pstring &name, netlist_devic
dev.start_dev();
}
-ATTR_COLD void netlist_device_t::register_subalias(const pstring &name, netlist_core_terminal_t &term)
+ATTR_COLD void device_t::register_subalias(const pstring &name, core_terminal_t &term)
{
pstring alias = this->name() + "." + name;
// everything already fully qualified
setup().register_alias_nofqn(alias, term.name());
- if (term.isType(netlist_terminal_t::INPUT) || term.isType(netlist_terminal_t::TERMINAL))
+ if (term.isType(terminal_t::INPUT) || term.isType(terminal_t::TERMINAL))
m_terminals.add(alias);
}
-ATTR_COLD void netlist_device_t::register_terminal(const pstring &name, netlist_terminal_t &port)
+ATTR_COLD void device_t::register_subalias(const pstring &name, const pstring &aliased)
+{
+ pstring alias = this->name() + "." + name;
+ pstring aliased_fqn = this->name() + "." + aliased;
+
+ // everything already fully qualified
+ setup().register_alias_nofqn(alias, aliased_fqn);
+
+ // FIXME: make this working again
+ //if (term.isType(terminal_t::INPUT) || term.isType(terminal_t::TERMINAL))
+ // m_terminals.add(name);
+}
+
+ATTR_COLD void device_t::register_terminal(const pstring &name, terminal_t &port)
{
setup().register_object(*this, name, port);
- if (port.isType(netlist_terminal_t::INPUT) || port.isType(netlist_terminal_t::TERMINAL))
+ if (port.isType(terminal_t::INPUT) || port.isType(terminal_t::TERMINAL))
m_terminals.add(port.name());
}
-ATTR_COLD void netlist_device_t::register_output(const pstring &name, netlist_logic_output_t &port)
+ATTR_COLD void device_t::register_output(const pstring &name, logic_output_t &port)
{
port.set_logic_family(this->logic_family());
setup().register_object(*this, name, port);
}
-ATTR_COLD void netlist_device_t::register_output(const pstring &name, netlist_analog_output_t &port)
+ATTR_COLD void device_t::register_output(const pstring &name, analog_output_t &port)
{
- //port.set_logic_family(this->logic_family());
setup().register_object(*this, name, port);
}
-ATTR_COLD void netlist_device_t::register_input(const pstring &name, netlist_logic_input_t &inp)
+ATTR_COLD void device_t::register_input(const pstring &name, logic_input_t &inp)
{
inp.set_logic_family(this->logic_family());
setup().register_object(*this, name, inp);
m_terminals.add(inp.name());
}
-ATTR_COLD void netlist_device_t::register_input(const pstring &name, netlist_analog_input_t &inp)
+ATTR_COLD void device_t::register_input(const pstring &name, analog_input_t &inp)
{
- //inp.set_logic_family(this->logic_family());
setup().register_object(*this, name, inp);
m_terminals.add(inp.name());
}
-ATTR_COLD void netlist_device_t::connect(netlist_core_terminal_t &t1, netlist_core_terminal_t &t2)
+ATTR_COLD void device_t::connect_late(core_terminal_t &t1, core_terminal_t &t2)
+{
+ setup().register_link_fqn(t1.name(), t2.name());
+}
+
+ATTR_COLD void device_t::connect_late(const pstring &t1, const pstring &t2)
+{
+ setup().register_link_fqn(name() + "." + t1, name() + "." + t2);
+}
+
+ATTR_COLD void device_t::connect_direct(core_terminal_t &t1, core_terminal_t &t2)
{
- /* FIXME: These should really first be collected like NET_C connects */
if (!setup().connect(t1, t2))
netlist().error("Error connecting %s to %s\n", t1.name().cstr(), t2.name().cstr());
}
template <class C, class T>
-ATTR_COLD void netlist_device_t::register_param(const pstring &sname, C &param, const T initialVal)
+ATTR_COLD void device_t::register_param(const pstring &sname, C &param, const T initialVal)
{
pstring fullname = this->name() + "." + sname;
param.init_object(*this, fullname);
@@ -564,21 +625,21 @@ ATTR_COLD void netlist_device_t::register_param(const pstring &sname, C &param,
setup().register_object(*this, fullname, param);
}
-template ATTR_COLD void netlist_device_t::register_param(const pstring &sname, netlist_param_double_t &param, const double initialVal);
-template ATTR_COLD void netlist_device_t::register_param(const pstring &sname, netlist_param_double_t &param, const float initialVal);
-template ATTR_COLD void netlist_device_t::register_param(const pstring &sname, netlist_param_int_t &param, const int initialVal);
-template ATTR_COLD void netlist_device_t::register_param(const pstring &sname, netlist_param_logic_t &param, const int initialVal);
-template ATTR_COLD void netlist_device_t::register_param(const pstring &sname, netlist_param_str_t &param, const char * const initialVal);
-template ATTR_COLD void netlist_device_t::register_param(const pstring &sname, netlist_param_str_t &param, const pstring &initialVal);
-template ATTR_COLD void netlist_device_t::register_param(const pstring &sname, netlist_param_model_t &param, const char * const initialVal);
+template ATTR_COLD void device_t::register_param(const pstring &sname, param_double_t &param, const double initialVal);
+template ATTR_COLD void device_t::register_param(const pstring &sname, param_double_t &param, const float initialVal);
+template ATTR_COLD void device_t::register_param(const pstring &sname, param_int_t &param, const int initialVal);
+template ATTR_COLD void device_t::register_param(const pstring &sname, param_logic_t &param, const int initialVal);
+template ATTR_COLD void device_t::register_param(const pstring &sname, param_str_t &param, const char * const initialVal);
+template ATTR_COLD void device_t::register_param(const pstring &sname, param_str_t &param, const pstring &initialVal);
+template ATTR_COLD void device_t::register_param(const pstring &sname, param_model_t &param, const char * const initialVal);
// ----------------------------------------------------------------------------------------
// netlist_net_t
// ----------------------------------------------------------------------------------------
-ATTR_COLD netlist_net_t::netlist_net_t(const family_t afamily)
- : netlist_object_t(NET, afamily)
+ATTR_COLD net_t::net_t(const family_t afamily)
+ : object_t(NET, afamily)
, m_new_Q(0)
, m_cur_Q (0)
, m_railterminal(NULL)
@@ -589,27 +650,28 @@ ATTR_COLD netlist_net_t::netlist_net_t(const family_t afamily)
{
}
-ATTR_COLD netlist_net_t::~netlist_net_t()
+ATTR_COLD net_t::~net_t()
{
if (isInitialized())
netlist().remove_save_items(this);
}
-ATTR_COLD void netlist_net_t::init_object(netlist_base_t &nl, const pstring &aname)
+ATTR_COLD void net_t::init_object(netlist_t &nl, const pstring &aname)
{
- netlist_object_t::init_object(nl, aname);
+ object_t::init_object(nl, aname);
nl.m_nets.add(this);
}
-ATTR_HOT void netlist_net_t::inc_active(netlist_core_terminal_t &term)
+ATTR_HOT void net_t::inc_active(core_terminal_t &term)
{
m_active++;
m_list_active.insert(term);
+ nl_assert(m_active <= num_cons());
if (m_active == 1)
{
if (netlist().use_deactivate())
{
- railterminal().netdev().inc_active();
+ railterminal().device().inc_active();
//m_cur_Q = m_new_Q;
}
if (m_in_queue == 0)
@@ -630,31 +692,39 @@ ATTR_HOT void netlist_net_t::inc_active(netlist_core_terminal_t &term)
}
}
-ATTR_HOT void netlist_net_t::dec_active(netlist_core_terminal_t &term)
+ATTR_HOT void net_t::dec_active(core_terminal_t &term)
{
m_active--;
+ nl_assert(m_active >= 0);
m_list_active.remove(term);
if (m_active == 0 && netlist().use_deactivate())
- railterminal().netdev().dec_active();
+ railterminal().device().dec_active();
}
-ATTR_COLD void netlist_net_t::register_railterminal(netlist_core_terminal_t &mr)
+ATTR_COLD void net_t::register_railterminal(core_terminal_t &mr)
{
nl_assert(m_railterminal == NULL);
m_railterminal = &mr;
}
-ATTR_COLD void netlist_net_t::rebuild_list()
+ATTR_COLD void net_t::rebuild_list()
{
/* rebuild m_list */
+ unsigned cnt = 0;
m_list_active.clear();
for (std::size_t i=0; i < m_core_terms.size(); i++)
- if (m_core_terms[i]->state() != netlist_logic_t::STATE_INP_PASSIVE)
+ if (m_core_terms[i]->state() != logic_t::STATE_INP_PASSIVE)
+ {
m_list_active.add(*m_core_terms[i]);
+ cnt++;
+ }
+ //if (cnt != m_active)
+ //printf("ARgh %s ==> %d != %d\n", name().cstr(), cnt, m_active);
+ m_active = cnt;
}
-ATTR_COLD void netlist_net_t::save_register()
+ATTR_COLD void net_t::save_register()
{
save(NLNAME(m_time));
save(NLNAME(m_active));
@@ -662,19 +732,19 @@ ATTR_COLD void netlist_net_t::save_register()
save(NLNAME(m_cur_Analog));
save(NLNAME(m_cur_Q));
save(NLNAME(m_new_Q));
- netlist_object_t::save_register();
+ object_t::save_register();
}
-ATTR_HOT inline void netlist_core_terminal_t::update_dev(const UINT32 mask)
+ATTR_HOT /* inline */ void core_terminal_t::update_dev(const UINT32 mask)
{
inc_stat(netdev().stat_call_count);
if ((state() & mask) != 0)
{
- netdev().update_dev();
+ device().update_dev();
}
}
-ATTR_HOT inline void netlist_net_t::update_devs()
+ATTR_HOT /* inline */ void net_t::update_devs()
{
//assert(m_num_cons != 0);
nl_assert(this->isRailNet());
@@ -684,17 +754,39 @@ ATTR_HOT inline void netlist_net_t::update_devs()
m_in_queue = 2; /* mark as taken ... */
m_cur_Q = m_new_Q;
+#if 0
+ core_terminal_t * t[256];
+ core_terminal_t *p = m_list_active.first();
+ int cnt = 0;
+ while (p != NULL)
+ {
+ if ((p->state() & mask) != 0)
+ t[cnt++] = p;
+ p = m_list_active.next(p);
+ }
- netlist_core_terminal_t *p = m_list_active.first();
+ for (int i=0; i<cnt; i++)
+ t[i]->netdev().update_dev();
+ core_terminal_t *p = m_list_active.first();
while (p != NULL)
{
p->update_dev(mask);
p = m_list_active.next(p);
}
+
+#else
+ core_terminal_t *p = m_list_active.first();
+
+ while (p != NULL)
+ {
+ p->update_dev(mask);
+ p = p->m_next;
+ }
+#endif
}
-ATTR_COLD void netlist_net_t::reset()
+ATTR_COLD void net_t::reset()
{
m_time = netlist_time::zero;
m_active = 0;
@@ -714,31 +806,32 @@ ATTR_COLD void netlist_net_t::reset()
m_core_terms[i]->do_reset();
for (std::size_t i=0; i < m_core_terms.size(); i++)
- if (m_core_terms[i]->state() != netlist_logic_t::STATE_INP_PASSIVE)
+ if (m_core_terms[i]->state() != logic_t::STATE_INP_PASSIVE)
m_active++;
}
-ATTR_COLD void netlist_net_t::register_con(netlist_core_terminal_t &terminal)
+ATTR_COLD void net_t::register_con(core_terminal_t &terminal)
{
terminal.set_net(*this);
m_core_terms.add(&terminal);
- if (terminal.state() != netlist_logic_t::STATE_INP_PASSIVE)
+ if (terminal.state() != logic_t::STATE_INP_PASSIVE)
m_active++;
}
-ATTR_COLD void netlist_net_t::move_connections(netlist_net_t *dest_net)
+ATTR_COLD void net_t::move_connections(net_t *dest_net)
{
for (std::size_t i = 0; i < m_core_terms.size(); i++)
{
- netlist_core_terminal_t *p = m_core_terms[i];
+ core_terminal_t *p = m_core_terms[i];
dest_net->register_con(*p);
}
- m_core_terms.clear(); // FIXME: othernet needs to be free'd from memory
+ m_core_terms.clear();
+ m_active = 0;
}
-ATTR_COLD void netlist_net_t::merge_net(netlist_net_t *othernet)
+ATTR_COLD void net_t::merge_net(net_t *othernet)
{
NL_VERBOSE_OUT(("merging nets ...\n"));
if (othernet == NULL)
@@ -769,47 +862,47 @@ ATTR_COLD void netlist_net_t::merge_net(netlist_net_t *othernet)
// netlist_logic_net_t
// ----------------------------------------------------------------------------------------
-ATTR_COLD netlist_logic_net_t::netlist_logic_net_t()
- : netlist_net_t(LOGIC)
+ATTR_COLD logic_net_t::logic_net_t()
+ : net_t(LOGIC)
{
}
-ATTR_COLD void netlist_logic_net_t::reset()
+ATTR_COLD void logic_net_t::reset()
{
- netlist_net_t::reset();
+ net_t::reset();
}
-ATTR_COLD void netlist_logic_net_t::save_register()
+ATTR_COLD void logic_net_t::save_register()
{
- netlist_net_t::save_register();
+ net_t::save_register();
}
// ----------------------------------------------------------------------------------------
// netlist_analog_net_t
// ----------------------------------------------------------------------------------------
-ATTR_COLD netlist_analog_net_t::netlist_analog_net_t()
- : netlist_net_t(ANALOG)
+ATTR_COLD analog_net_t::analog_net_t()
+ : net_t(ANALOG)
, m_DD_n_m_1(0.0)
, m_h_n_m_1(1e-6)
, m_solver(NULL)
{
}
-ATTR_COLD void netlist_analog_net_t::reset()
+ATTR_COLD void analog_net_t::reset()
{
- netlist_net_t::reset();
+ net_t::reset();
}
-ATTR_COLD void netlist_analog_net_t::save_register()
+ATTR_COLD void analog_net_t::save_register()
{
save(NLNAME(m_DD_n_m_1));
save(NLNAME(m_h_n_m_1));
- netlist_net_t::save_register();
+ net_t::save_register();
}
-ATTR_COLD bool netlist_analog_net_t::already_processed(list_t *groups, int cur_group)
+ATTR_COLD bool analog_net_t::already_processed(list_t *groups, int cur_group)
{
if (isRailNet())
return true;
@@ -821,7 +914,7 @@ ATTR_COLD bool netlist_analog_net_t::already_processed(list_t *groups, int cur_g
return false;
}
-ATTR_COLD void netlist_analog_net_t::process_net(list_t *groups, int &cur_group)
+ATTR_COLD void analog_net_t::process_net(list_t *groups, int &cur_group)
{
if (num_cons() == 0)
return;
@@ -830,13 +923,13 @@ ATTR_COLD void netlist_analog_net_t::process_net(list_t *groups, int &cur_group)
groups[cur_group].add(this);
for (std::size_t i = 0; i < m_core_terms.size(); i++)
{
- netlist_core_terminal_t *p = m_core_terms[i];
+ core_terminal_t *p = m_core_terms[i];
//SOLVER_VERBOSE_OUT(("terminal %s\n", p->name().cstr()));
- if (p->isType(netlist_terminal_t::TERMINAL))
+ if (p->isType(terminal_t::TERMINAL))
{
//SOLVER_VERBOSE_OUT(("isterminal\n"));
- netlist_terminal_t *pt = static_cast<netlist_terminal_t *>(p);
- netlist_analog_net_t *other_net = &pt->m_otherterm->net().as_analog();
+ terminal_t *pt = static_cast<terminal_t *>(p);
+ analog_net_t *other_net = &pt->m_otherterm->net().as_analog();
if (!other_net->already_processed(groups, cur_group))
other_net->process_net(groups, cur_group);
}
@@ -848,15 +941,15 @@ ATTR_COLD void netlist_analog_net_t::process_net(list_t *groups, int &cur_group)
// netlist_core_terminal_t
// ----------------------------------------------------------------------------------------
-ATTR_COLD netlist_core_terminal_t::netlist_core_terminal_t(const type_t atype, const family_t afamily)
-: netlist_owned_object_t(atype, afamily)
-, plinkedlist_element_t<netlist_core_terminal_t>()
+ATTR_COLD core_terminal_t::core_terminal_t(const type_t atype, const family_t afamily)
+: device_object_t(atype, afamily)
+, plinkedlist_element_t<core_terminal_t>()
, m_net(NULL)
, m_state(STATE_NONEX)
{
}
-ATTR_COLD void netlist_core_terminal_t::set_net(netlist_net_t &anet)
+ATTR_COLD void core_terminal_t::set_net(net_t &anet)
{
m_net = &anet;
}
@@ -865,8 +958,8 @@ ATTR_COLD void netlist_core_terminal_t::set_net(netlist_net_t &anet)
// netlist_terminal_t
// ----------------------------------------------------------------------------------------
-ATTR_COLD netlist_terminal_t::netlist_terminal_t()
-: netlist_core_terminal_t(TERMINAL, ANALOG)
+ATTR_COLD terminal_t::terminal_t()
+: core_terminal_t(TERMINAL, ANALOG)
, m_Idr1(NULL)
, m_go1(NULL)
, m_gt1(NULL)
@@ -874,21 +967,21 @@ ATTR_COLD netlist_terminal_t::netlist_terminal_t()
{
}
-ATTR_HOT void netlist_terminal_t::schedule_solve()
+ATTR_HOT void terminal_t::schedule_solve()
{
// FIXME: Remove this after we found a way to remove *ALL* twoterms connected to railnets only.
if (net().as_analog().solver() != NULL)
net().as_analog().solver()->update_forced();
}
-ATTR_HOT void netlist_terminal_t::schedule_after(const netlist_time &after)
+ATTR_HOT void terminal_t::schedule_after(const netlist_time &after)
{
// FIXME: Remove this after we found a way to remove *ALL* twoterms connected to railnets only.
if (net().as_analog().solver() != NULL)
net().as_analog().solver()->update_after(after);
}
-ATTR_COLD void netlist_terminal_t::reset()
+ATTR_COLD void terminal_t::reset()
{
set_state(STATE_INP_ACTIVE);
set_ptr(m_Idr1, 0.0);
@@ -896,12 +989,12 @@ ATTR_COLD void netlist_terminal_t::reset()
set_ptr(m_gt1, netlist().gmin());
}
-ATTR_COLD void netlist_terminal_t::save_register()
+ATTR_COLD void terminal_t::save_register()
{
save(NLNAME(m_Idr1));
save(NLNAME(m_go1));
save(NLNAME(m_gt1));
- netlist_core_terminal_t::save_register();
+ core_terminal_t::save_register();
}
@@ -917,21 +1010,21 @@ ATTR_COLD void netlist_terminal_t::save_register()
// netlist_logic_output_t
// ----------------------------------------------------------------------------------------
-ATTR_COLD netlist_logic_output_t::netlist_logic_output_t()
- : netlist_logic_t(OUTPUT)
+ATTR_COLD logic_output_t::logic_output_t()
+ : logic_t(OUTPUT)
{
set_state(STATE_OUT);
this->set_net(m_my_net);
}
-ATTR_COLD void netlist_logic_output_t::init_object(netlist_core_device_t &dev, const pstring &aname)
+ATTR_COLD void logic_output_t::init_object(core_device_t &dev, const pstring &aname)
{
- netlist_core_terminal_t::init_object(dev, aname);
+ core_terminal_t::init_object(dev, aname);
net().init_object(dev.netlist(), aname + ".net");
net().register_railterminal(*this);
}
-ATTR_COLD void netlist_logic_output_t::initial(const netlist_sig_t val)
+ATTR_COLD void logic_output_t::initial(const netlist_sig_t val)
{
net().as_logic().initial(val);
}
@@ -941,68 +1034,38 @@ ATTR_COLD void netlist_logic_output_t::initial(const netlist_sig_t val)
// netlist_analog_output_t
// ----------------------------------------------------------------------------------------
-ATTR_COLD netlist_analog_output_t::netlist_analog_output_t()
+ATTR_COLD analog_output_t::analog_output_t()
: netlist_analog_t(OUTPUT), m_proxied_net(NULL)
{
this->set_net(m_my_net);
set_state(STATE_OUT);
- net().as_analog().m_cur_Analog = 0.98;
+ net().as_analog().m_cur_Analog = NL_FCONST(0.99);
}
-ATTR_COLD void netlist_analog_output_t::init_object(netlist_core_device_t &dev, const pstring &aname)
+ATTR_COLD void analog_output_t::init_object(core_device_t &dev, const pstring &aname)
{
- netlist_core_terminal_t::init_object(dev, aname);
+ core_terminal_t::init_object(dev, aname);
net().init_object(dev.netlist(), aname + ".net");
net().register_railterminal(*this);
}
-ATTR_COLD void netlist_analog_output_t::initial(const nl_double val)
+ATTR_COLD void analog_output_t::initial(const nl_double val)
{
- // FIXME: Really necessary?
- net().as_analog().m_cur_Analog = val * NL_FCONST(0.99);
+ net().as_analog().m_cur_Analog = val;
}
// ----------------------------------------------------------------------------------------
// netlist_param_t & friends
// ----------------------------------------------------------------------------------------
-ATTR_COLD netlist_param_t::netlist_param_t(const param_type_t atype)
- : netlist_owned_object_t(PARAM, ANALOG)
+ATTR_COLD param_t::param_t(const param_type_t atype)
+ : device_object_t(PARAM, ANALOG)
, m_param_type(atype)
{
}
-ATTR_COLD netlist_param_double_t::netlist_param_double_t()
- : netlist_param_t(DOUBLE)
- , m_param(0.0)
-{
-}
-
-ATTR_COLD netlist_param_int_t::netlist_param_int_t()
- : netlist_param_t(INTEGER)
- , m_param(0)
-{
-}
-
-ATTR_COLD netlist_param_logic_t::netlist_param_logic_t()
- : netlist_param_int_t()
-{
-}
-
-ATTR_COLD netlist_param_str_t::netlist_param_str_t()
- : netlist_param_t(STRING)
- , m_param("")
-{
-}
-
-ATTR_COLD netlist_param_model_t::netlist_param_model_t()
- : netlist_param_t(MODEL)
- , m_param("")
-{
-}
-
-ATTR_COLD const pstring netlist_param_model_t::model_type() const
+ATTR_COLD const pstring param_model_t::model_type() const
{
pstring tmp = this->Value();
// .model 1N914 D(Is=2.52n Rs=.568 N=1.752 Cjo=4p M=.4 tt=20n Iave=200m Vpk=75 mfg=OnSemi type=silicon)
@@ -1015,48 +1078,25 @@ ATTR_COLD const pstring netlist_param_model_t::model_type() const
}
-ATTR_COLD nl_double netlist_param_model_t::model_value(const pstring &entity, const nl_double defval) const
+ATTR_COLD const pstring param_model_t::model_value_str(const pstring &entity, const pstring defval) const
{
- pstring tmp = this->Value();
- // .model 1N914 D(Is=2.52n Rs=.568 N=1.752 Cjo=4p M=.4 tt=20n Iave=200m Vpk=75 mfg=OnSemi type=silicon)
- int p = tmp.ucase().find(entity.ucase() + "=");
- if (p>=0)
- {
- int pblank = tmp.find(" ", p);
- if (pblank < 0) pblank = tmp.len() + 1;
- tmp = tmp.substr(p, pblank - p);
- int pequal = tmp.find("=", 0);
- if (pequal < 0)
- netlist().error("parameter %s misformat in model %s temp %s\n", entity.cstr(), Value().cstr(), tmp.cstr());
- tmp = tmp.substr(pequal+1);
- nl_double factor = NL_FCONST(1.0);
- switch (*(tmp.right(1).cstr()))
- {
- case 'm': factor = 1e-3; break;
- case 'u': factor = 1e-6; break;
- case 'n': factor = 1e-9; break;
- case 'p': factor = 1e-12; break;
- case 'f': factor = 1e-15; break;
- case 'a': factor = 1e-18; break;
+ return setup_t::model_value_str(this->Value(), entity, defval);
+}
- }
- if (factor != NL_FCONST(1.0))
- tmp = tmp.left(tmp.len() - 1);
- return tmp.as_double() * factor;
- }
- else
- {
- netlist().log("Entity %s not found in model %s\n", entity.cstr(), tmp.cstr());
- return defval;
- }
+ATTR_COLD nl_double param_model_t::model_value(const pstring &entity, const nl_double defval) const
+{
+ return setup_t::model_value(this->Value(), entity, defval);
}
+} // namespace
+
+NETLIB_NAMESPACE_DEVICES_START()
// ----------------------------------------------------------------------------------------
// mainclock
// ----------------------------------------------------------------------------------------
-ATTR_HOT inline void NETLIB_NAME(mainclock)::mc_update(netlist_logic_net_t &net)
+ATTR_HOT /* inline */ void NETLIB_NAME(mainclock)::mc_update(logic_net_t &net)
{
net.toggle_new_Q();
net.update_devs();
@@ -1082,9 +1122,10 @@ NETLIB_UPDATE_PARAM(mainclock)
NETLIB_UPDATE(mainclock)
{
- netlist_logic_net_t &net = m_Q.net().as_logic();
+ logic_net_t &net = m_Q.net().as_logic();
// this is only called during setup ...
net.toggle_new_Q();
net.set_time(netlist().time() + m_inc);
}
+NETLIB_NAMESPACE_DEVICES_END()
diff --git a/src/emu/netlist/nl_base.h b/src/emu/netlist/nl_base.h
index b5d547d2fdd..bd8ef6b48be 100644
--- a/src/emu/netlist/nl_base.h
+++ b/src/emu/netlist/nl_base.h
@@ -164,24 +164,15 @@
// Type definitions
// ----------------------------------------------------------------------------------------
-//typedef UINT8 netlist_sig_t;
-
-#define netlist_sig_t UINT8
-
-class netlist_core_device_t;
-
-#if USE_PMFDELEGATES
-#if NO_USE_PMFCONVERSION
-typedef void (netlist_core_device_t::*net_update_delegate)();
-#else
-typedef void (*net_update_delegate)(netlist_core_device_t *);
-#endif
-#endif
+typedef UINT8 netlist_sig_t;
//============================================================
// MACROS / netlist devices
//============================================================
+#define NETLIB_NAMESPACE_DEVICES_START() namespace netlist { namespace devices {
+#define NETLIB_NAMESPACE_DEVICES_END() }}
+
#define NETLIB_NAME(_chip) nld_ ## _chip
#define NETLIB_NAME_STR_S(_s) # _s
@@ -222,14 +213,14 @@ typedef void (*net_update_delegate)(netlist_core_device_t *);
NETLIB_DEVICE_BASE(NETLIB_NAME(_name), NETLIB_NAME(_pclass), protected:, _priv)
#define NETLIB_DEVICE(_name, _priv) \
- NETLIB_DEVICE_BASE(NETLIB_NAME(_name), netlist_device_t, protected:, _priv)
+ NETLIB_DEVICE_BASE(NETLIB_NAME(_name), device_t, protected:, _priv)
#define NETLIB_SUBDEVICE(_name, _priv) \
- class NETLIB_NAME(_name) : public netlist_device_t \
+ class NETLIB_NAME(_name) : public device_t \
{ \
public: \
NETLIB_NAME(_name) () \
- : netlist_device_t() \
+ : device_t() \
{ } \
/*protected:*/ \
ATTR_HOT void update(); \
@@ -240,7 +231,7 @@ typedef void (*net_update_delegate)(netlist_core_device_t *);
}
#define NETLIB_DEVICE_WITH_PARAMS(_name, _priv) \
- NETLIB_DEVICE_BASE(NETLIB_NAME(_name), netlist_device_t, \
+ NETLIB_DEVICE_BASE(NETLIB_NAME(_name), device_t, \
ATTR_HOT void update_param(); \
, _priv)
@@ -250,1183 +241,1175 @@ typedef void (*net_update_delegate)(netlist_core_device_t *);
, _priv)
#define NETLIB_LOGIC_FAMILY(_fam) \
-/* ATTR_COLD */ virtual const netlist_logic_family_desc_t *default_logic_family() \
+virtual logic_family_desc_t *default_logic_family() \
{ \
- return &netlist_family_ ## _fam; \
+ return netlist_family_ ## _fam; \
}
-//============================================================
-// Exceptions
-//============================================================
-
-class nl_fatalerror : public std::exception
-{
-public:
- nl_fatalerror(const char *format, ...) ATTR_PRINTF(2,3);
- nl_fatalerror(const char *format, va_list ap);
- virtual ~nl_fatalerror() throw() {}
-
- /* inline */ const pstring &text() { return m_text; }
-private:
- pstring m_text;
-};
//============================================================
// Asserts
//============================================================
-#ifdef MAME_DEBUG
-#define nl_assert(x) do { if (!(x)) throw nl_fatalerror("assert: %s:%d: %s", __FILE__, __LINE__, #x); } while (0)
+#if defined(MAME_DEBUG)
+#define nl_assert(x) do { if (!(x)) throw fatalerror_e("assert: %s:%d: %s", __FILE__, __LINE__, #x); } while (0)
#else
-#define nl_assert(x) do { if (0) if (!(x)) throw nl_fatalerror("assert: %s:%d: %s", __FILE__, __LINE__, #x); } while (0)
+#define nl_assert(x) do { if (0) if (!(x)) throw fatalerror_e("assert: %s:%d: %s", __FILE__, __LINE__, #x); } while (0)
#endif
-#define nl_assert_always(x, msg) do { if (!(x)) throw nl_fatalerror("Fatal error: %s\nCaused by assert: %s:%d: %s", msg, __FILE__, __LINE__, #x); } while (0)
+#define nl_assert_always(x, msg) do { if (!(x)) throw fatalerror_e("Fatal error: %s\nCaused by assert: %s:%d: %s", msg, __FILE__, __LINE__, #x); } while (0)
// -----------------------------------------------------------------------------
// forward definitions
// -----------------------------------------------------------------------------
-class netlist_logic_output_t;
-class netlist_analog_net_t;
-class netlist_logic_net_t;
-class netlist_net_t;
-class netlist_param_t;
-class netlist_setup_t;
-class netlist_base_t;
-class netlist_matrix_solver_t;
-
-class NETLIB_NAME(gnd);
-class NETLIB_NAME(solver);
-class NETLIB_NAME(mainclock);
-class NETLIB_NAME(netlistparams);
-class NETLIB_NAME(base_proxy);
-
-// -----------------------------------------------------------------------------
-// netlist_output_family_t
-// -----------------------------------------------------------------------------
-
-class nld_base_d_to_a_proxy;
+//============================================================
+// Namespace starts
+//============================================================
-class netlist_logic_family_desc_t
-{
-public:
- virtual ~netlist_logic_family_desc_t() {}
- virtual nld_base_d_to_a_proxy *create_d_a_proxy(netlist_logic_output_t &proxied) const = 0;
-
- nl_double m_low_thresh_V;
- nl_double m_high_thresh_V;
- nl_double m_low_V;
- nl_double m_high_V;
- nl_double m_R_low;
- nl_double m_R_high;
-};
-
-class netlist_logic_family_t
+namespace netlist
{
-public:
+ namespace devices
+ {
+ class matrix_solver_t;
+ class NETLIB_NAME(gnd);
+ class NETLIB_NAME(solver);
+ class NETLIB_NAME(mainclock);
+ class NETLIB_NAME(netlistparams);
+ class NETLIB_NAME(base_proxy);
+ class nld_base_d_to_a_proxy;
+ }
- netlist_logic_family_t() : m_logic_family(NULL) {}
+ //============================================================
+ // Exceptions
+ //============================================================
- ATTR_HOT /* inline */ const netlist_logic_family_desc_t *logic_family() const { return m_logic_family; }
- ATTR_COLD void set_logic_family(const netlist_logic_family_desc_t *fam) { m_logic_family = fam; }
+ class fatalerror_e : public std::exception
+ {
+ public:
+ fatalerror_e(const char *format, ...) ATTR_PRINTF(2,3);
+ fatalerror_e(const char *format, va_list ap);
+ virtual ~fatalerror_e() throw() {}
+
+ const pstring &text() { return m_text; }
+ private:
+ pstring m_text;
+ };
-private:
- const netlist_logic_family_desc_t *m_logic_family;
-};
+ class logic_output_t;
+ class analog_net_t;
+ class logic_net_t;
+ class net_t;
+ class setup_t;
+ class netlist_t;
+ class core_device_t;
+ class param_model_t;
-/* Terminals inherit the family description from the netlist_device
- * The default is the ttl family, but any device can override the family.
- * For individual terminals, these can be overwritten as well.
- *
- * Only devices of type GENERIC should have a family description entry
- */
+ // -----------------------------------------------------------------------------
+ // netlist_output_family_t
+ // -----------------------------------------------------------------------------
-extern const netlist_logic_family_desc_t &netlist_family_TTL;
-extern const netlist_logic_family_desc_t &netlist_family_CD4000;
+ class logic_family_desc_t
+ {
+ public:
+ logic_family_desc_t() : m_is_static(false) {}
+ virtual ~logic_family_desc_t() {}
+ virtual devices::nld_base_d_to_a_proxy *create_d_a_proxy(logic_output_t *proxied) const = 0;
+ nl_double m_low_thresh_V;
+ nl_double m_high_thresh_V;
+ nl_double m_low_V;
+ nl_double m_high_V;
+ nl_double m_R_low;
+ nl_double m_R_high;
-// -----------------------------------------------------------------------------
-// netlist_object_t
-// -----------------------------------------------------------------------------
+ bool m_is_static;
-class netlist_object_t
-{
- NETLIST_PREVENT_COPYING(netlist_object_t)
-public:
- enum type_t {
- TERMINAL = 0,
- INPUT = 1,
- OUTPUT = 2,
- PARAM = 3,
- NET = 4,
- DEVICE = 5,
- NETLIST = 6,
- QUEUE = 7
- };
- enum family_t {
- // Terminal families
- LOGIC,
- ANALOG,
- // Device families
- GENERIC, // <== devices usually fall into this category
- TWOTERM, // Generic twoterm ...
- RESISTOR, // Resistor
- CAPACITOR, // Capacitor
- DIODE, // Diode
- DUMMY, // DUMMY device without function
- FRONTIER, // Net frontier
- BJT_EB, // BJT(Ebers-Moll)
- BJT_SWITCH, // BJT(Switch)
- VCVS, // Voltage controlled voltage source
- VCCS, // Voltage controlled current source
- CCCS, // Current controlled current source
- GND // GND device
+ static logic_family_desc_t *from_model(const pstring &model);
};
- ATTR_COLD netlist_object_t(const type_t atype, const family_t afamily);
+ class logic_family_t
+ {
+ public:
- virtual ~netlist_object_t();
+ logic_family_t() : m_logic_family(NULL) {}
+ ~logic_family_t() { }
- ATTR_COLD void init_object(netlist_base_t &nl, const pstring &aname);
- ATTR_COLD bool isInitialized() { return (m_netlist != NULL); }
+ ATTR_HOT logic_family_desc_t *logic_family() const { return m_logic_family; }
+ ATTR_COLD void set_logic_family(logic_family_desc_t *fam) { m_logic_family = fam; }
- ATTR_COLD const pstring &name() const;
+ protected:
+ logic_family_desc_t *m_logic_family;
+ };
- PSTATE_INTERFACE_DECL()
+ /* Terminals inherit the family description from the netlist_device
+ * The default is the ttl family, but any device can override the family.
+ * For individual terminals, these can be overwritten as well.
+ *
+ * Only devices of type GENERIC should have a family description entry
+ */
- ATTR_HOT /* inline */ type_t type() const { return m_objtype; }
- ATTR_HOT /* inline */ family_t family() const { return m_family; }
- ATTR_HOT /* inline */ bool isType(const type_t atype) const { return (m_objtype == atype); }
- ATTR_HOT /* inline */ bool isFamily(const family_t afamily) const { return (m_family == afamily); }
+ extern logic_family_desc_t *netlist_family_TTL;
+ extern logic_family_desc_t *netlist_family_CD4XXX;
- ATTR_HOT /* inline */ netlist_base_t & netlist() { return *m_netlist; }
- ATTR_HOT /* inline */ const netlist_base_t & netlist() const { return *m_netlist; }
- ATTR_COLD void /* inline */ do_reset()
+ // -----------------------------------------------------------------------------
+ // netlist_object_t
+ // -----------------------------------------------------------------------------
+
+ class object_t
{
- reset();
- }
+ P_PREVENT_COPYING(object_t)
+ public:
+ enum type_t {
+ TERMINAL = 0,
+ INPUT = 1,
+ OUTPUT = 2,
+ PARAM = 3,
+ NET = 4,
+ DEVICE = 5,
+ NETLIST = 6,
+ QUEUE = 7
+ };
+ enum family_t {
+ // Terminal families
+ LOGIC,
+ ANALOG,
+ // Device families
+ GENERIC, // <== devices usually fall into this category
+ TWOTERM, // Generic twoterm ...
+ RESISTOR, // Resistor
+ CAPACITOR, // Capacitor
+ DIODE, // Diode
+ DUMMY, // DUMMY device without function
+ FRONTIER, // Net frontier
+ BJT_EB, // BJT(Ebers-Moll)
+ BJT_SWITCH, // BJT(Switch)
+ VCVS, // Voltage controlled voltage source
+ VCCS, // Voltage controlled current source
+ LVCCS, // Voltage controlled current source (Current limited)
+ CCCS, // Current controlled current source
+ VS, // Voltage Source
+ CS, // Current Source
+ GND // GND device
+ };
+
+ ATTR_COLD object_t(const type_t atype, const family_t afamily);
+
+ virtual ~object_t();
+
+ ATTR_COLD void init_object(netlist_t &nl, const pstring &aname);
+ ATTR_COLD bool isInitialized() { return (m_netlist != NULL); }
+
+ ATTR_COLD const pstring &name() const;
+
+ PSTATE_INTERFACE_DECL()
+
+ ATTR_HOT type_t type() const { return m_objtype; }
+ ATTR_HOT family_t family() const { return m_family; }
+
+ ATTR_HOT bool isType(const type_t atype) const { return (m_objtype == atype); }
+ ATTR_HOT bool isFamily(const family_t afamily) const { return (m_family == afamily); }
+
+ ATTR_HOT netlist_t & netlist() { return *m_netlist; }
+ ATTR_HOT const netlist_t & netlist() const { return *m_netlist; }
+
+ ATTR_COLD void do_reset()
+ {
+ reset();
+ }
-protected:
+ protected:
- /* ATTR_COLD */ virtual void reset() = 0;
- // must call parent save_register !
- /* ATTR_COLD */ virtual void save_register() { };
+ virtual void reset() = 0;
+ // must call parent save_register !
+ virtual void save_register() { };
-private:
- pstring m_name;
- const type_t m_objtype;
- const family_t m_family;
- netlist_base_t * m_netlist;
-};
+ private:
+ pstring m_name;
+ const type_t m_objtype;
+ const family_t m_family;
+ netlist_t * m_netlist;
+ };
-// -----------------------------------------------------------------------------
-// netlist_owned_object_t
-// -----------------------------------------------------------------------------
+ // -----------------------------------------------------------------------------
+ // netlist_owned_object_t
+ // -----------------------------------------------------------------------------
-class netlist_owned_object_t : public netlist_object_t
-{
- NETLIST_PREVENT_COPYING(netlist_owned_object_t)
-public:
- ATTR_COLD netlist_owned_object_t(const type_t atype, const family_t afamily);
+ class device_object_t : public object_t
+ {
+ P_PREVENT_COPYING(device_object_t)
+ public:
+ ATTR_COLD device_object_t(const type_t atype, const family_t afamily);
- ATTR_COLD void init_object(netlist_core_device_t &dev, const pstring &aname);
+ ATTR_COLD void init_object(core_device_t &dev, const pstring &aname);
- ATTR_HOT /* inline */ netlist_core_device_t &netdev() const { return *m_netdev; }
-private:
- netlist_core_device_t * m_netdev;
-};
+ core_device_t &device() const { return *m_device; }
+ private:
+ core_device_t * m_device;
+ };
-// -----------------------------------------------------------------------------
-// netlist_core_terminal_t
-// -----------------------------------------------------------------------------
-class netlist_core_terminal_t : public netlist_owned_object_t, public plinkedlist_element_t<netlist_core_terminal_t>
-{
- NETLIST_PREVENT_COPYING(netlist_core_terminal_t)
-public:
+ // -----------------------------------------------------------------------------
+ // netlist_core_terminal_t
+ // -----------------------------------------------------------------------------
- typedef plist_t<netlist_core_terminal_t *> list_t;
+ class core_terminal_t : public device_object_t, public plinkedlist_element_t<core_terminal_t>
+ {
+ P_PREVENT_COPYING(core_terminal_t)
+ public:
- /* needed here ... */
+ typedef plist_t<core_terminal_t *> list_t;
- enum state_e {
- STATE_INP_PASSIVE = 0,
- STATE_INP_ACTIVE = 1,
- STATE_INP_HL = 2,
- STATE_INP_LH = 4,
- STATE_OUT = 128,
- STATE_NONEX = 256
- };
+ /* needed here ... */
+ enum state_e {
+ STATE_INP_PASSIVE = 0,
+ STATE_INP_ACTIVE = 1,
+ STATE_INP_HL = 2,
+ STATE_INP_LH = 4,
+ STATE_OUT = 128,
+ STATE_NONEX = 256
+ };
- ATTR_COLD netlist_core_terminal_t(const type_t atype, const family_t afamily);
- //ATTR_COLD void init_object(netlist_core_device_t &dev, const pstring &aname);
+ ATTR_COLD core_terminal_t(const type_t atype, const family_t afamily);
- ATTR_COLD void set_net(netlist_net_t &anet);
- ATTR_COLD /* inline */ void clear_net() { m_net = NULL; }
- ATTR_HOT /* inline */ bool has_net() const { return (m_net != NULL); }
+ //ATTR_COLD void init_object(netlist_core_device_t &dev, const pstring &aname);
- ATTR_HOT /* inline */ const netlist_net_t & net() const { return *m_net;}
- ATTR_HOT /* inline */ netlist_net_t & net() { return *m_net;}
+ ATTR_COLD void set_net(net_t &anet);
+ ATTR_COLD void clear_net() { m_net = NULL; }
+ ATTR_HOT bool has_net() const { return (m_net != NULL); }
- ATTR_HOT /* inline */ bool is_state(const state_e astate) const { return (m_state == astate); }
- ATTR_HOT /* inline */ state_e state() const { return m_state; }
- ATTR_HOT /* inline */ void set_state(const state_e astate)
- {
- nl_assert(astate != STATE_NONEX);
- m_state = astate;
- }
+ ATTR_HOT const net_t & net() const { return *m_net;}
+ ATTR_HOT net_t & net() { return *m_net;}
- /* inline only intended to be called from nl_base.c */
- ATTR_HOT inline void update_dev(const UINT32 mask);
+ ATTR_HOT bool is_state(const state_e astate) const { return (m_state == astate); }
+ ATTR_HOT state_e state() const { return m_state; }
+ ATTR_HOT void set_state(const state_e astate)
+ {
+ nl_assert(astate != STATE_NONEX);
+ m_state = astate;
+ }
-protected:
- /* ATTR_COLD */ virtual void save_register()
- {
- save(NLNAME(m_state));
- netlist_owned_object_t::save_register();
- }
-private:
- netlist_net_t * m_net;
- state_e m_state;
-};
+ ATTR_HOT /* inline */ void update_dev(const UINT32 mask);
-NETLIST_SAVE_TYPE(netlist_core_terminal_t::state_e, DT_INT);
+ protected:
+ virtual void save_register()
+ {
+ save(NLNAME(m_state));
+ device_object_t::save_register();
+ }
+ private:
+ net_t * m_net;
+ state_e m_state;
+ };
-class netlist_terminal_t : public netlist_core_terminal_t
-{
- NETLIST_PREVENT_COPYING(netlist_terminal_t)
-public:
+ class terminal_t : public core_terminal_t
+ {
+ P_PREVENT_COPYING(terminal_t)
+ public:
- typedef plist_t<netlist_terminal_t *> list_t;
+ typedef plist_t<terminal_t *> list_t;
- ATTR_COLD netlist_terminal_t();
+ ATTR_COLD terminal_t();
- nl_double *m_Idr1; // drive current
- nl_double *m_go1; // conductance for Voltage from other term
- nl_double *m_gt1; // conductance for total conductance
+ nl_double *m_Idr1; // drive current
+ nl_double *m_go1; // conductance for Voltage from other term
+ nl_double *m_gt1; // conductance for total conductance
- ATTR_HOT /* inline */ void set(const nl_double G)
- {
- set_ptr(m_Idr1, 0);
- set_ptr(m_go1, G);
- set_ptr(m_gt1, G);
- }
+ ATTR_HOT void set(const nl_double G)
+ {
+ set_ptr(m_Idr1, 0);
+ set_ptr(m_go1, G);
+ set_ptr(m_gt1, G);
+ }
- ATTR_HOT /* inline */ void set(const nl_double GO, const nl_double GT)
- {
- set_ptr(m_Idr1, 0);
- set_ptr(m_go1, GO);
- set_ptr(m_gt1, GT);
- }
+ ATTR_HOT void set(const nl_double GO, const nl_double GT)
+ {
+ set_ptr(m_Idr1, 0);
+ set_ptr(m_go1, GO);
+ set_ptr(m_gt1, GT);
+ }
- ATTR_HOT /* inline */ void set(const nl_double GO, const nl_double GT, const nl_double I)
- {
- set_ptr(m_Idr1, I);
- set_ptr(m_go1, GO);
- set_ptr(m_gt1, GT);
- }
+ ATTR_HOT void set(const nl_double GO, const nl_double GT, const nl_double I)
+ {
+ set_ptr(m_Idr1, I);
+ set_ptr(m_go1, GO);
+ set_ptr(m_gt1, GT);
+ }
- ATTR_HOT void schedule_solve();
- ATTR_HOT void schedule_after(const netlist_time &after);
+ ATTR_HOT void schedule_solve();
+ ATTR_HOT void schedule_after(const netlist_time &after);
- netlist_terminal_t *m_otherterm;
+ terminal_t *m_otherterm;
-protected:
- /* ATTR_COLD */ virtual void save_register();
+ protected:
+ virtual void save_register();
- /* ATTR_COLD */ virtual void reset();
-private:
- ATTR_HOT /* inline */ void set_ptr(nl_double *ptr, const nl_double val)
- {
- if (ptr != NULL && *ptr != val)
+ virtual void reset();
+ private:
+ ATTR_HOT void set_ptr(nl_double *ptr, const nl_double val)
{
- *ptr = val;
+ if (ptr != NULL && *ptr != val)
+ {
+ *ptr = val;
+ }
}
- }
-};
-
-
-// -----------------------------------------------------------------------------
-// netlist_input_t
-// -----------------------------------------------------------------------------
+ };
-class netlist_logic_t : public netlist_core_terminal_t, public netlist_logic_family_t
-{
-public:
+ // -----------------------------------------------------------------------------
+ // netlist_input_t
+ // -----------------------------------------------------------------------------
- ATTR_COLD netlist_logic_t(const type_t atype)
- : netlist_core_terminal_t(atype, LOGIC), netlist_logic_family_t(),
- m_proxy(NULL)
+ class logic_t : public core_terminal_t, public logic_family_t
{
- }
+ public:
- ATTR_COLD bool has_proxy() const { return (m_proxy != NULL); }
- ATTR_COLD nld_base_proxy *get_proxy() const { return m_proxy; }
- ATTR_COLD void set_proxy(nld_base_proxy *proxy) { m_proxy = proxy; }
-protected:
+ ATTR_COLD logic_t(const type_t atype)
+ : core_terminal_t(atype, LOGIC), logic_family_t(),
+ m_proxy(NULL)
+ {
+ }
-private:
- nld_base_proxy *m_proxy;
-};
+ ATTR_COLD bool has_proxy() const { return (m_proxy != NULL); }
+ ATTR_COLD devices::nld_base_proxy *get_proxy() const { return m_proxy; }
+ ATTR_COLD void set_proxy(devices::nld_base_proxy *proxy) { m_proxy = proxy; }
-class netlist_analog_t : public netlist_core_terminal_t
-{
-public:
+ protected:
+ private:
+ devices::nld_base_proxy *m_proxy;
+ };
- ATTR_COLD netlist_analog_t(const type_t atype)
- : netlist_core_terminal_t(atype, ANALOG)
+ class netlist_analog_t : public core_terminal_t
{
- }
+ public:
-protected:
-private:
-};
+ ATTR_COLD netlist_analog_t(const type_t atype)
+ : core_terminal_t(atype, ANALOG)
+ {
+ }
-// -----------------------------------------------------------------------------
-// netlist_logic_input_t
-// -----------------------------------------------------------------------------
+ protected:
-class netlist_logic_input_t : public netlist_logic_t
-{
-public:
- ATTR_COLD netlist_logic_input_t()
- : netlist_logic_t(INPUT)
+ private:
+ };
+
+ // -----------------------------------------------------------------------------
+ // netlist_logic_input_t
+ // -----------------------------------------------------------------------------
+
+ class logic_input_t : public logic_t
{
- set_state(STATE_INP_ACTIVE);
- }
+ public:
+ ATTR_COLD logic_input_t()
+ : logic_t(INPUT)
+ {
+ set_state(STATE_INP_ACTIVE);
+ }
- ATTR_HOT /* inline */ netlist_sig_t Q() const;
- ATTR_HOT /* inline */ netlist_sig_t last_Q() const;
+ ATTR_HOT netlist_sig_t Q() const;
+ ATTR_HOT netlist_sig_t last_Q() const;
- ATTR_HOT /* inline */ void inactivate();
- ATTR_HOT /* inline */ void activate();
- ATTR_HOT /* inline */ void activate_hl();
- ATTR_HOT /* inline */ void activate_lh();
+ ATTR_HOT void inactivate();
+ ATTR_HOT void activate();
+ ATTR_HOT void activate_hl();
+ ATTR_HOT void activate_lh();
-protected:
- /* ATTR_COLD */ virtual void reset()
- {
- //netlist_core_terminal_t::reset();
- set_state(STATE_INP_ACTIVE);
- }
+ protected:
+ virtual void reset()
+ {
+ //netlist_core_terminal_t::reset();
+ set_state(STATE_INP_ACTIVE);
+ }
-};
+ };
-// -----------------------------------------------------------------------------
-// netlist_analog_input_t
-// -----------------------------------------------------------------------------
+ // -----------------------------------------------------------------------------
+ // netlist_analog_input_t
+ // -----------------------------------------------------------------------------
-class netlist_analog_input_t : public netlist_analog_t
-{
-public:
- ATTR_COLD netlist_analog_input_t()
- : netlist_analog_t(INPUT)
+ class analog_input_t : public netlist_analog_t
{
- set_state(STATE_INP_ACTIVE);
- }
+ public:
+ ATTR_COLD analog_input_t()
+ : netlist_analog_t(INPUT)
+ {
+ set_state(STATE_INP_ACTIVE);
+ }
- ATTR_HOT /* inline */ nl_double Q_Analog() const;
+ ATTR_HOT nl_double Q_Analog() const;
-protected:
- /* ATTR_COLD */ virtual void reset()
- {
- //netlist_core_terminal_t::reset();
- set_state(STATE_INP_ACTIVE);
- }
-};
+ protected:
+ virtual void reset()
+ {
+ //netlist_core_terminal_t::reset();
+ set_state(STATE_INP_ACTIVE);
+ }
+ };
-// -----------------------------------------------------------------------------
-// net_net_t
-// -----------------------------------------------------------------------------
+ // -----------------------------------------------------------------------------
+ // net_net_t
+ // -----------------------------------------------------------------------------
-class netlist_net_t : public netlist_object_t
-{
- NETLIST_PREVENT_COPYING(netlist_net_t)
-public:
+ class net_t : public object_t
+ {
+ P_PREVENT_COPYING(net_t)
+ public:
- typedef plist_t<netlist_net_t *> list_t;
+ typedef plist_t<net_t *> list_t;
- ATTR_COLD netlist_net_t(const family_t afamily);
- /* ATTR_COLD */ virtual ~netlist_net_t();
+ ATTR_COLD net_t(const family_t afamily);
+ virtual ~net_t();
- ATTR_COLD void init_object(netlist_base_t &nl, const pstring &aname);
+ ATTR_COLD void init_object(netlist_t &nl, const pstring &aname);
- ATTR_COLD void register_con(netlist_core_terminal_t &terminal);
- ATTR_COLD void merge_net(netlist_net_t *othernet);
- ATTR_COLD void register_railterminal(netlist_core_terminal_t &mr);
+ ATTR_COLD void register_con(core_terminal_t &terminal);
+ ATTR_COLD void merge_net(net_t *othernet);
+ ATTR_COLD void register_railterminal(core_terminal_t &mr);
- ATTR_HOT /* inline */ netlist_logic_net_t & as_logic();
- ATTR_HOT /* inline */ const netlist_logic_net_t & as_logic() const;
+ ATTR_HOT logic_net_t & as_logic();
+ ATTR_HOT const logic_net_t & as_logic() const;
- ATTR_HOT /* inline */ netlist_analog_net_t & as_analog();
- ATTR_HOT /* inline */ const netlist_analog_net_t & as_analog() const;
+ ATTR_HOT analog_net_t & as_analog();
+ ATTR_HOT const analog_net_t & as_analog() const;
- ATTR_HOT void update_devs();
+ ATTR_HOT void update_devs();
- ATTR_HOT /* inline */ const netlist_time &time() const { return m_time; }
- ATTR_HOT /* inline */ void set_time(const netlist_time &ntime) { m_time = ntime; }
+ ATTR_HOT const netlist_time &time() const { return m_time; }
+ ATTR_HOT void set_time(const netlist_time &ntime) { m_time = ntime; }
- ATTR_HOT /* inline */ bool isRailNet() const { return !(m_railterminal == NULL); }
- ATTR_HOT /* inline */ netlist_core_terminal_t & railterminal() const { return *m_railterminal; }
+ ATTR_HOT bool isRailNet() const { return !(m_railterminal == NULL); }
+ ATTR_HOT core_terminal_t & railterminal() const { return *m_railterminal; }
- ATTR_HOT /* inline */ void push_to_queue(const netlist_time &delay);
- ATTR_HOT /* inline */ void reschedule_in_queue(const netlist_time &delay);
- ATTR_HOT bool /* inline */ is_queued() const { return m_in_queue == 1; }
+ ATTR_HOT void push_to_queue(const netlist_time &delay);
+ ATTR_HOT void reschedule_in_queue(const netlist_time &delay);
+ ATTR_HOT bool is_queued() const { return m_in_queue == 1; }
- ATTR_HOT /* inline */ int num_cons() const { return m_core_terms.size(); }
+ ATTR_HOT int num_cons() const { return m_core_terms.size(); }
- ATTR_HOT void inc_active(netlist_core_terminal_t &term);
- ATTR_HOT void dec_active(netlist_core_terminal_t &term);
+ ATTR_HOT void inc_active(core_terminal_t &term);
+ ATTR_HOT void dec_active(core_terminal_t &term);
- ATTR_COLD void rebuild_list(); /* rebuild m_list after a load */
+ ATTR_COLD void rebuild_list(); /* rebuild m_list after a load */
- ATTR_COLD void move_connections(netlist_net_t *new_net);
+ ATTR_COLD void move_connections(net_t *new_net);
- plist_t<netlist_core_terminal_t *> m_core_terms; // save post-start m_list ...
+ plist_t<core_terminal_t *> m_core_terms; // save post-start m_list ...
- ATTR_HOT /* inline */ void set_Q_time(const netlist_sig_t &newQ, const netlist_time &at)
- {
- if (newQ != m_new_Q)
+ ATTR_HOT void set_Q_time(const netlist_sig_t &newQ, const netlist_time &at)
{
- m_in_queue = 0;
- m_time = at;
+ if (newQ != m_new_Q)
+ {
+ m_in_queue = 0;
+ m_time = at;
+ }
+ m_cur_Q = m_new_Q = newQ;
}
- m_cur_Q = m_new_Q = newQ;
- }
-protected: //FIXME: needed by current solver code
+ protected: //FIXME: needed by current solver code
- /* ATTR_COLD */ virtual void save_register();
- /* ATTR_COLD */ virtual void reset();
+ virtual void save_register();
+ virtual void reset();
- netlist_sig_t m_new_Q;
- netlist_sig_t m_cur_Q;
+ netlist_sig_t m_new_Q;
+ netlist_sig_t m_cur_Q;
-private:
+ private:
- netlist_core_terminal_t * m_railterminal;
- plinkedlist_t<netlist_core_terminal_t> m_list_active;
+ core_terminal_t * m_railterminal;
+ plinkedlist_t<core_terminal_t> m_list_active;
- netlist_time m_time;
- INT32 m_active;
- UINT8 m_in_queue; /* 0: not in queue, 1: in queue, 2: last was taken */
+ netlist_time m_time;
+ INT32 m_active;
+ UINT8 m_in_queue; /* 0: not in queue, 1: in queue, 2: last was taken */
-public:
- // We have to have those on one object. Dividing those does lead
- // to a significant performance hit
- // FIXME: Have to fix the public at some time
- nl_double m_cur_Analog;
+ public:
+ // We have to have those on one object. Dividing those does lead
+ // to a significant performance hit
+ // FIXME: Have to fix the public at some time
+ nl_double m_cur_Analog;
-};
-
-class netlist_logic_net_t : public netlist_net_t
-{
- NETLIST_PREVENT_COPYING(netlist_logic_net_t)
-public:
-
- typedef plist_t<netlist_logic_net_t *> list_t;
-
- ATTR_COLD netlist_logic_net_t();
- /* ATTR_COLD */ virtual ~netlist_logic_net_t() { };
+ };
- ATTR_HOT /* inline */ netlist_sig_t Q() const
+ class logic_net_t : public net_t
{
- return m_cur_Q;
- }
+ P_PREVENT_COPYING(logic_net_t)
+ public:
- ATTR_HOT /* inline */ netlist_sig_t new_Q() const
- {
- return m_new_Q;
- }
+ typedef plist_t<logic_net_t *> list_t;
- ATTR_HOT /* inline */ void set_Q(const netlist_sig_t &newQ, const netlist_time &delay)
- {
- if (newQ != m_new_Q)
+ ATTR_COLD logic_net_t();
+ virtual ~logic_net_t() { };
+
+ ATTR_HOT netlist_sig_t Q() const
{
- m_new_Q = newQ;
- push_to_queue(delay);
+ return m_cur_Q;
}
- }
- ATTR_HOT /* inline */ void toggle_new_Q()
- {
- m_new_Q ^= 1;
- }
-
- ATTR_COLD void initial(const netlist_sig_t val)
- {
- m_cur_Q = val;
- m_new_Q = val;
- }
+ ATTR_HOT netlist_sig_t new_Q() const
+ {
+ return m_new_Q;
+ }
- /* internal state support
- * FIXME: get rid of this and implement export/import in MAME
- */
- ATTR_COLD /* inline */ netlist_sig_t &Q_state_ptr()
- {
- return m_cur_Q;
- }
+ ATTR_HOT void set_Q(const netlist_sig_t &newQ, const netlist_time &delay)
+ {
+ if (newQ != m_new_Q)
+ {
+ m_new_Q = newQ;
+ push_to_queue(delay);
+ }
+ }
-protected: //FIXME: needed by current solver code
+ ATTR_HOT void toggle_new_Q()
+ {
+ m_new_Q ^= 1;
+ }
- /* ATTR_COLD */ virtual void save_register();
- /* ATTR_COLD */ virtual void reset();
+ ATTR_COLD void initial(const netlist_sig_t val)
+ {
+ m_cur_Q = val;
+ m_new_Q = val;
+ }
+ /* internal state support
+ * FIXME: get rid of this and implement export/import in MAME
+ */
+ ATTR_COLD netlist_sig_t &Q_state_ptr()
+ {
+ return m_cur_Q;
+ }
-private:
+ protected: //FIXME: needed by current solver code
-public:
+ virtual void save_register();
+ virtual void reset();
-};
-class netlist_analog_net_t : public netlist_net_t
-{
- NETLIST_PREVENT_COPYING(netlist_analog_net_t)
-public:
+ private:
- typedef plist_t<netlist_analog_net_t *> list_t;
+ public:
- ATTR_COLD netlist_analog_net_t();
- /* ATTR_COLD */ virtual ~netlist_analog_net_t() { };
+ };
- ATTR_HOT /* inline */ nl_double Q_Analog() const
+ class analog_net_t : public net_t
{
- return m_cur_Analog;
- }
+ P_PREVENT_COPYING(analog_net_t)
+ public:
- ATTR_COLD /* inline */ nl_double &Q_Analog_state_ptr()
- {
- return m_cur_Analog;
- }
+ typedef plist_t<analog_net_t *> list_t;
- ATTR_HOT /* inline */ netlist_matrix_solver_t *solver() { return m_solver; }
+ ATTR_COLD analog_net_t();
+ virtual ~analog_net_t() { };
- ATTR_COLD bool already_processed(list_t *groups, int cur_group);
- ATTR_COLD void process_net(list_t *groups, int &cur_group);
+ ATTR_HOT nl_double Q_Analog() const
+ {
+ return m_cur_Analog;
+ }
-protected:
+ ATTR_COLD nl_double &Q_Analog_state_ptr()
+ {
+ return m_cur_Analog;
+ }
- /* ATTR_COLD */ virtual void save_register();
- /* ATTR_COLD */ virtual void reset();
+ ATTR_HOT devices::matrix_solver_t *solver() { return m_solver; }
+ ATTR_COLD bool already_processed(list_t *groups, int cur_group);
+ ATTR_COLD void process_net(list_t *groups, int &cur_group);
-private:
+ protected:
-public:
- nl_double m_DD_n_m_1;
- nl_double m_h_n_m_1;
+ virtual void save_register();
+ virtual void reset();
- //FIXME: needed by current solver code
- netlist_matrix_solver_t *m_solver;
-};
-// -----------------------------------------------------------------------------
-// net_output_t
-// -----------------------------------------------------------------------------
+ private:
-class netlist_logic_output_t : public netlist_logic_t
-{
- NETLIST_PREVENT_COPYING(netlist_logic_output_t)
-public:
+ public:
+ nl_double m_DD_n_m_1;
+ nl_double m_h_n_m_1;
+
+ //FIXME: needed by current solver code
+ devices::matrix_solver_t *m_solver;
+ };
- ATTR_COLD netlist_logic_output_t();
+ // -----------------------------------------------------------------------------
+ // net_output_t
+ // -----------------------------------------------------------------------------
- ATTR_COLD void init_object(netlist_core_device_t &dev, const pstring &aname);
- /* ATTR_COLD */ virtual void reset()
+ class logic_output_t : public logic_t
{
- set_state(STATE_OUT);
- }
+ P_PREVENT_COPYING(logic_output_t)
+ public:
- ATTR_COLD void initial(const netlist_sig_t val);
+ ATTR_COLD logic_output_t();
- ATTR_HOT /* inline */ void set_Q(const netlist_sig_t newQ, const netlist_time &delay)
- {
- net().as_logic().set_Q(newQ, delay);
- }
+ ATTR_COLD void init_object(core_device_t &dev, const pstring &aname);
+ virtual void reset()
+ {
+ set_state(STATE_OUT);
+ }
-private:
- netlist_logic_net_t m_my_net;
-};
+ ATTR_COLD void initial(const netlist_sig_t val);
-class netlist_analog_output_t : public netlist_analog_t
-{
- NETLIST_PREVENT_COPYING(netlist_analog_output_t)
-public:
+ ATTR_HOT void set_Q(const netlist_sig_t newQ, const netlist_time &delay)
+ {
+ net().as_logic().set_Q(newQ, delay);
+ }
- ATTR_COLD netlist_analog_output_t();
+ private:
+ logic_net_t m_my_net;
+ };
- ATTR_COLD void init_object(netlist_core_device_t &dev, const pstring &aname);
- /* ATTR_COLD */ virtual void reset()
+ class analog_output_t : public netlist_analog_t
{
- set_state(STATE_OUT);
- }
+ P_PREVENT_COPYING(analog_output_t)
+ public:
- ATTR_COLD void initial(const nl_double val);
+ ATTR_COLD analog_output_t();
- ATTR_HOT /* inline */ void set_Q(const nl_double newQ);
+ ATTR_COLD void init_object(core_device_t &dev, const pstring &aname);
+ virtual void reset()
+ {
+ set_state(STATE_OUT);
+ }
- netlist_analog_net_t *m_proxied_net; // only for proxy nets in analog input logic
+ ATTR_COLD void initial(const nl_double val);
-private:
- netlist_analog_net_t m_my_net;
-};
+ ATTR_HOT void set_Q(const nl_double newQ);
-// -----------------------------------------------------------------------------
-// net_param_t
-// -----------------------------------------------------------------------------
+ analog_net_t *m_proxied_net; // only for proxy nets in analog input logic
-class netlist_param_t : public netlist_owned_object_t
-{
- NETLIST_PREVENT_COPYING(netlist_param_t)
-public:
-
- enum param_type_t {
- MODEL,
- STRING,
- DOUBLE,
- INTEGER,
- LOGIC
+ private:
+ analog_net_t m_my_net;
};
- ATTR_COLD netlist_param_t(const param_type_t atype);
-
- ATTR_HOT /* inline */ param_type_t param_type() const { return m_param_type; }
-
-protected:
-
- /* ATTR_COLD */ virtual void reset() { }
-
-private:
- const param_type_t m_param_type;
-};
+ // -----------------------------------------------------------------------------
+ // net_param_t
+ // -----------------------------------------------------------------------------
-class netlist_param_double_t : public netlist_param_t
-{
- NETLIST_PREVENT_COPYING(netlist_param_double_t)
-public:
- ATTR_COLD netlist_param_double_t();
-
- ATTR_HOT /* inline */ void setTo(const nl_double param);
- ATTR_COLD /* inline */ void initial(const nl_double val) { m_param = val; }
- ATTR_HOT /* inline */ nl_double Value() const { return m_param; }
-
-protected:
- /* ATTR_COLD */ virtual void save_register()
+ class param_t : public device_object_t
{
- save(NLNAME(m_param));
- netlist_param_t::save_register();
- }
+ P_PREVENT_COPYING(param_t)
+ public:
-private:
- nl_double m_param;
-};
+ enum param_type_t {
+ MODEL,
+ STRING,
+ DOUBLE,
+ INTEGER,
+ LOGIC
+ };
-class netlist_param_int_t : public netlist_param_t
-{
- NETLIST_PREVENT_COPYING(netlist_param_int_t)
-public:
- ATTR_COLD netlist_param_int_t();
+ ATTR_COLD param_t(const param_type_t atype);
- ATTR_HOT /* inline */ void setTo(const int param);
- ATTR_COLD /* inline */ void initial(const int val) { m_param = val; }
+ ATTR_HOT param_type_t param_type() const { return m_param_type; }
- ATTR_HOT /* inline */ int Value() const { return m_param; }
+ protected:
-protected:
- /* ATTR_COLD */ virtual void save_register()
- {
- save(NLNAME(m_param));
- netlist_param_t::save_register();
- }
+ virtual void reset() { }
-private:
- int m_param;
-};
+ private:
+ const param_type_t m_param_type;
+ };
-class netlist_param_logic_t : public netlist_param_int_t
-{
- NETLIST_PREVENT_COPYING(netlist_param_logic_t)
-public:
- ATTR_COLD netlist_param_logic_t();
-};
+ template <class C, param_t::param_type_t T>
+ class param_template_t : public param_t
+ {
+ P_PREVENT_COPYING(param_template_t)
+ public:
+ ATTR_COLD param_template_t()
+ : param_t(T)
+ , m_param(C(0))
+ {
+ }
-class netlist_param_str_t : public netlist_param_t
-{
- NETLIST_PREVENT_COPYING(netlist_param_str_t)
-public:
- ATTR_COLD netlist_param_str_t();
+ operator const C() const { return Value(); }
- ATTR_HOT /* inline */ void setTo(const pstring &param);
- ATTR_COLD /* inline */ void initial(const pstring &val) { m_param = val; }
+ ATTR_HOT void setTo(const C &param);
+ ATTR_COLD void initial(const C &val) { m_param = val; }
+ ATTR_HOT C Value() const { return m_param; }
- ATTR_HOT /* inline */ const pstring &Value() const { return m_param; }
+ protected:
+ virtual void save_register()
+ {
+ /* pstrings not yet supported, these need special logic */
+ if (T != param_t::STRING && T != param_t::MODEL)
+ save(NLNAME(m_param));
+ param_t::save_register();
+ }
-private:
- pstring m_param;
-};
+ C m_param;
+ private:
+ };
-class netlist_param_model_t : public netlist_param_t
-{
- NETLIST_PREVENT_COPYING(netlist_param_model_t)
-public:
- ATTR_COLD netlist_param_model_t();
+ typedef param_template_t<nl_double, param_t::DOUBLE> param_double_t;
+ typedef param_template_t<int, param_t::INTEGER> param_int_t;
+ typedef param_template_t<pstring, param_t::STRING> param_str_t;
- ATTR_COLD /* inline */ void initial(const pstring &val) { m_param = val; }
+ class param_logic_t : public param_int_t
+ {
+ P_PREVENT_COPYING(param_logic_t)
+ public:
+ ATTR_COLD param_logic_t() : param_int_t() { };
+ };
- ATTR_HOT /* inline */ const pstring &Value() const { return m_param; }
+ class param_model_t : public param_template_t<pstring, param_t::MODEL>
+ {
+ P_PREVENT_COPYING(param_model_t)
+ public:
+ ATTR_COLD param_model_t() : param_template_t<pstring, param_t::MODEL>() { }
+
+ /* these should be cached! */
+ ATTR_COLD nl_double model_value(const pstring &entity, const nl_double defval = 0.0) const;
+ ATTR_COLD const pstring model_value_str(const pstring &entity, const pstring defval = "") const;
+ ATTR_COLD const pstring model_type() const;
+ };
- /* these should be cached! */
- ATTR_COLD nl_double model_value(const pstring &entity, const nl_double defval = 0.0) const;
- ATTR_COLD const pstring model_type() const;
+ // -----------------------------------------------------------------------------
+ // core_device_t
+ // -----------------------------------------------------------------------------
-private:
- pstring m_param;
-};
+ class core_device_t : public object_t, public logic_family_t
+ {
+ P_PREVENT_COPYING(core_device_t)
+ public:
-// -----------------------------------------------------------------------------
-// net_device_t
-// -----------------------------------------------------------------------------
+ typedef plist_t<core_device_t *> list_t;
-class netlist_core_device_t : public netlist_object_t, public netlist_logic_family_t
-{
- NETLIST_PREVENT_COPYING(netlist_core_device_t)
-public:
+ ATTR_COLD core_device_t(const family_t afamily);
- typedef plist_t<netlist_core_device_t *> list_t;
+ virtual ~core_device_t();
- ATTR_COLD netlist_core_device_t(const family_t afamily);
+ virtual void init(netlist_t &anetlist, const pstring &name);
+ ATTR_HOT virtual void update_param() {}
- /* ATTR_COLD */ virtual ~netlist_core_device_t();
+ ATTR_HOT void update_dev()
+ {
+ begin_timing(stat_total_time);
+ inc_stat(stat_update_count);
+
+ #if (NL_PMF_TYPE == NL_PMF_TYPE_GNUC_PMF)
+ (this->*m_static_update)();
+ #elif ((NL_PMF_TYPE == NL_PMF_TYPE_GNUC_PMF_CONV) || (NL_PMF_TYPE == NL_PMF_TYPE_INTERNAL))
+ m_static_update(this);
+ #else
+ update();
+ #endif
+ end_timing(stat_total_time);
+ }
+ ATTR_COLD void start_dev();
+ ATTR_COLD void stop_dev();
- /* ATTR_COLD */ virtual void init(netlist_base_t &anetlist, const pstring &name);
- ATTR_HOT virtual void update_param() {}
+ ATTR_HOT netlist_sig_t INPLOGIC_PASSIVE(logic_input_t &inp);
- ATTR_HOT /* inline */ void update_dev()
- {
- begin_timing(stat_total_time);
- inc_stat(stat_update_count);
-#if USE_PMFDELEGATES
-#if NO_USE_PMFCONVERSION
- (this->*static_update)();
-#else
- static_update(this);
-#endif
-#else
- update();
-#endif
- end_timing(stat_total_time);
- }
- ATTR_COLD void start_dev();
- ATTR_COLD void stop_dev();
+ ATTR_HOT netlist_sig_t INPLOGIC(const logic_input_t &inp) const
+ {
+ //printf("%s %d\n", inp.name().cstr(), inp.state());
+ nl_assert(inp.state() != logic_t::STATE_INP_PASSIVE);
+ return inp.Q();
+ }
- ATTR_HOT netlist_sig_t INPLOGIC_PASSIVE(netlist_logic_input_t &inp);
+ ATTR_HOT void OUTLOGIC(logic_output_t &out, const netlist_sig_t val, const netlist_time &delay)
+ {
+ out.set_Q(val, delay);
+ }
- ATTR_HOT /* inline */ netlist_sig_t INPLOGIC(const netlist_logic_input_t &inp) const
- {
- nl_assert(inp.state() != netlist_logic_t::STATE_INP_PASSIVE);
- return inp.Q();
- }
+ ATTR_HOT nl_double INPANALOG(const analog_input_t &inp) const { return inp.Q_Analog(); }
- ATTR_HOT /* inline */ void OUTLOGIC(netlist_logic_output_t &out, const netlist_sig_t val, const netlist_time &delay)
- {
- out.set_Q(val, delay);
- }
+ ATTR_HOT nl_double TERMANALOG(const terminal_t &term) const { return term.net().as_analog().Q_Analog(); }
- ATTR_HOT /* inline */ nl_double INPANALOG(const netlist_analog_input_t &inp) const { return inp.Q_Analog(); }
+ ATTR_HOT void OUTANALOG(analog_output_t &out, const nl_double val)
+ {
+ out.set_Q(val);
+ }
- ATTR_HOT /* inline */ nl_double TERMANALOG(const netlist_terminal_t &term) const { return term.net().as_analog().Q_Analog(); }
+ ATTR_HOT virtual void inc_active() { }
- ATTR_HOT /* inline */ void OUTANALOG(netlist_analog_output_t &out, const nl_double val)
- {
- out.set_Q(val);
- }
+ ATTR_HOT virtual void dec_active() { }
- ATTR_HOT virtual void inc_active() { }
+ ATTR_HOT virtual void step_time(ATTR_UNUSED const nl_double st) { }
+ ATTR_HOT virtual void update_terminals() { }
- ATTR_HOT virtual void dec_active() { }
+ #if (NL_KEEP_STATISTICS)
+ /* stats */
+ osd_ticks_t stat_total_time;
+ INT32 stat_update_count;
+ INT32 stat_call_count;
+ #endif
- ATTR_HOT virtual void step_time(ATTR_UNUSED const nl_double st) { }
- ATTR_HOT virtual void update_terminals() { }
+ protected:
+ ATTR_HOT virtual void update() { }
+ virtual void start() { }
+ virtual void stop() { } \
+ virtual logic_family_desc_t *default_logic_family()
+ {
+ return netlist_family_TTL;
+ }
+ private:
-#if (NL_KEEP_STATISTICS)
- /* stats */
- osd_ticks_t stat_total_time;
- INT32 stat_update_count;
- INT32 stat_call_count;
-#endif
+ #if (NL_PMF_TYPE == NL_PMF_TYPE_GNUC_PMF)
+ typedef void (core_device_t::*net_update_delegate)();
+ #elif ((NL_PMF_TYPE == NL_PMF_TYPE_GNUC_PMF_CONV) || (NL_PMF_TYPE == NL_PMF_TYPE_INTERNAL))
+ typedef MEMBER_ABI void (*net_update_delegate)(core_device_t *);
+ #endif
-#if USE_PMFDELEGATES
- net_update_delegate static_update;
-#endif
+ #if (NL_PMF_TYPE > NL_PMF_TYPE_VIRTUAL)
+ net_update_delegate m_static_update;
+ #endif
+ };
-protected:
+ // -----------------------------------------------------------------------------
+ // device_t
+ // -----------------------------------------------------------------------------
- ATTR_HOT virtual void update() { }
- /* ATTR_COLD */ virtual void start() { }
- /* ATTR_COLD */ virtual void stop() { } \
- /* ATTR_COLD */ virtual const netlist_logic_family_desc_t *default_logic_family()
+ class device_t : public core_device_t
{
- return &netlist_family_TTL;
- }
-
-private:
-};
+ P_PREVENT_COPYING(device_t)
+ public:
+ ATTR_COLD device_t();
+ ATTR_COLD device_t(const family_t afamily);
-class netlist_device_t : public netlist_core_device_t
-{
- NETLIST_PREVENT_COPYING(netlist_device_t)
-public:
+ virtual ~device_t();
- ATTR_COLD netlist_device_t();
- ATTR_COLD netlist_device_t(const family_t afamily);
+ virtual void init(netlist_t &anetlist, const pstring &name);
- /* ATTR_COLD */ virtual ~netlist_device_t();
+ ATTR_COLD setup_t &setup();
- /* ATTR_COLD */ virtual void init(netlist_base_t &anetlist, const pstring &name);
+ ATTR_COLD void register_sub(const pstring &name, device_t &dev);
+ ATTR_COLD void register_subalias(const pstring &name, core_terminal_t &term);
+ ATTR_COLD void register_subalias(const pstring &name, const pstring &aliased);
+ ATTR_COLD void register_terminal(const pstring &name, terminal_t &port);
+ ATTR_COLD void register_output(const pstring &name, analog_output_t &out);
+ ATTR_COLD void register_output(const pstring &name, logic_output_t &out);
+ ATTR_COLD void register_input(const pstring &name, analog_input_t &in);
+ ATTR_COLD void register_input(const pstring &name, logic_input_t &in);
- ATTR_COLD netlist_setup_t &setup();
+ ATTR_COLD void connect_late(const pstring &t1, const pstring &t2);
+ ATTR_COLD void connect_late(core_terminal_t &t1, core_terminal_t &t2);
+ ATTR_COLD void connect_direct(core_terminal_t &t1, core_terminal_t &t2);
- ATTR_COLD void register_sub(const pstring &name, netlist_device_t &dev);
- ATTR_COLD void register_subalias(const pstring &name, netlist_core_terminal_t &term);
- ATTR_COLD void register_terminal(const pstring &name, netlist_terminal_t &port);
- ATTR_COLD void register_output(const pstring &name, netlist_analog_output_t &out);
- ATTR_COLD void register_output(const pstring &name, netlist_logic_output_t &out);
- ATTR_COLD void register_input(const pstring &name, netlist_analog_input_t &in);
- ATTR_COLD void register_input(const pstring &name, netlist_logic_input_t &in);
+ plist_t<pstring> m_terminals;
- ATTR_COLD void connect(netlist_core_terminal_t &t1, netlist_core_terminal_t &t2);
+ protected:
- plist_t<pstring> m_terminals;
+ ATTR_HOT virtual void update() { }
+ ATTR_HOT virtual void start() { }
+ ATTR_HOT virtual void update_terminals() { }
-protected:
+ template <class C, class T>
+ ATTR_COLD void register_param(const pstring &sname, C &param, const T initialVal);
- ATTR_HOT virtual void update() { }
- ATTR_HOT virtual void start() { }
- ATTR_HOT virtual void update_terminals() { }
-
- template <class C, class T>
- ATTR_COLD void register_param(const pstring &sname, C &param, const T initialVal);
-
-private:
-};
+ private:
+ };
-// -----------------------------------------------------------------------------
-// netlist_queue_t
-// -----------------------------------------------------------------------------
+ // -----------------------------------------------------------------------------
+ // netlist_queue_t
+ // -----------------------------------------------------------------------------
-class netlist_queue_t : public netlist_timed_queue<netlist_net_t *, netlist_time, 512>,
- public netlist_object_t,
- public pstate_callback_t
-{
-public:
- netlist_queue_t(netlist_base_t &nl);
+ class queue_t : public timed_queue<net_t *, netlist_time>,
+ public object_t,
+ public pstate_callback_t
+ {
+ public:
+ queue_t(netlist_t &nl);
-protected:
+ protected:
- void reset() {}
+ void reset() {}
- void register_state(pstate_manager_t &manager, const pstring &module);
- void on_pre_save();
- void on_post_load();
+ void register_state(pstate_manager_t &manager, const pstring &module);
+ void on_pre_save();
+ void on_post_load();
-private:
- int m_qsize;
- netlist_time::INTERNALTYPE m_times[512];
- char m_name[512][64];
-};
+ private:
+ struct names_t { char m_buf[64]; };
+ int m_qsize;
+ parray_t<netlist_time::INTERNALTYPE> m_times;
+ parray_t<names_t> m_names;
+ };
-// -----------------------------------------------------------------------------
-// netlist_base_t
-// -----------------------------------------------------------------------------
+ // -----------------------------------------------------------------------------
+ // netlist_base_t
+ // -----------------------------------------------------------------------------
-class netlist_base_t : public netlist_object_t, public pstate_manager_t
-{
- NETLIST_PREVENT_COPYING(netlist_base_t)
-public:
+ class netlist_t : public object_t, public pstate_manager_t
+ {
+ P_PREVENT_COPYING(netlist_t)
+ public:
- netlist_base_t();
- virtual ~netlist_base_t();
+ netlist_t();
+ virtual ~netlist_t();
- ATTR_COLD void start();
- ATTR_COLD void stop();
+ ATTR_COLD void start();
+ ATTR_COLD void stop();
- ATTR_HOT /* inline */ const netlist_queue_t &queue() const { return m_queue; }
- ATTR_HOT /* inline */ netlist_queue_t &queue() { return m_queue; }
- ATTR_HOT /* inline */ const netlist_time &time() const { return m_time; }
- ATTR_HOT /* inline */ NETLIB_NAME(solver) *solver() const { return m_solver; }
- ATTR_HOT /* inline */ NETLIB_NAME(gnd) *gnd() const { return m_gnd; }
- ATTR_HOT nl_double gmin() const;
+ ATTR_HOT const queue_t &queue() const { return m_queue; }
+ ATTR_HOT queue_t &queue() { return m_queue; }
+ ATTR_HOT const netlist_time &time() const { return m_time; }
+ ATTR_HOT devices::NETLIB_NAME(solver) *solver() const { return m_solver; }
+ ATTR_HOT devices::NETLIB_NAME(gnd) *gnd() const { return m_gnd; }
+ ATTR_HOT nl_double gmin() const;
- ATTR_HOT void push_to_queue(netlist_net_t &out, const netlist_time &attime);
- ATTR_HOT void remove_from_queue(netlist_net_t &out);
+ ATTR_HOT void push_to_queue(net_t &out, const netlist_time &attime);
+ ATTR_HOT void remove_from_queue(net_t &out);
- ATTR_HOT void process_queue(const netlist_time &delta);
- ATTR_HOT /* inline */ void abort_current_queue_slice() { m_stop = netlist_time::zero; }
+ ATTR_HOT void process_queue(const netlist_time &delta);
+ ATTR_HOT void abort_current_queue_slice() { m_stop = netlist_time::zero; }
- ATTR_HOT /* inline */ const bool &use_deactivate() const { return m_use_deactivate; }
+ ATTR_HOT const bool &use_deactivate() const { return m_use_deactivate; }
- ATTR_COLD void rebuild_lists(); /* must be called after post_load ! */
+ ATTR_COLD void rebuild_lists(); /* must be called after post_load ! */
- ATTR_COLD void set_setup(netlist_setup_t *asetup) { m_setup = asetup; }
- ATTR_COLD netlist_setup_t &setup() { return *m_setup; }
+ ATTR_COLD void set_setup(setup_t *asetup) { m_setup = asetup; }
+ ATTR_COLD setup_t &setup() { return *m_setup; }
- ATTR_COLD netlist_net_t *find_net(const pstring &name);
+ ATTR_COLD net_t *find_net(const pstring &name);
- ATTR_COLD void error(const char *format, ...) const ATTR_PRINTF(2,3);
- ATTR_COLD void warning(const char *format, ...) const ATTR_PRINTF(2,3);
- ATTR_COLD void log(const char *format, ...) const ATTR_PRINTF(2,3);
+ ATTR_COLD void error(const char *format, ...) const ATTR_PRINTF(2,3);
+ ATTR_COLD void warning(const char *format, ...) const ATTR_PRINTF(2,3);
+ ATTR_COLD void log(const char *format, ...) const ATTR_PRINTF(2,3);
- template<class _C>
- plist_t<_C *> get_device_list()
- {
- plist_t<_C *> tmp;
- for (std::size_t i = 0; i < m_devices.size(); i++)
+ template<class _C>
+ plist_t<_C *> get_device_list()
{
- _C *dev = dynamic_cast<_C *>(m_devices[i]);
- if (dev != NULL)
- tmp.add(dev);
+ plist_t<_C *> tmp;
+ for (std::size_t i = 0; i < m_devices.size(); i++)
+ {
+ _C *dev = dynamic_cast<_C *>(m_devices[i]);
+ if (dev != NULL)
+ tmp.add(dev);
+ }
+ return tmp;
}
- return tmp;
- }
- template<class _C>
- _C *get_first_device()
- {
- for (std::size_t i = 0; i < m_devices.size(); i++)
+ template<class _C>
+ _C *get_first_device()
{
- _C *dev = dynamic_cast<_C *>(m_devices[i]);
- if (dev != NULL)
- return dev;
+ for (std::size_t i = 0; i < m_devices.size(); i++)
+ {
+ _C *dev = dynamic_cast<_C *>(m_devices[i]);
+ if (dev != NULL)
+ return dev;
+ }
+ return NULL;
}
- return NULL;
- }
- template<class _C>
- _C *get_single_device(const char *classname)
- {
- _C *ret = NULL;
- for (std::size_t i = 0; i < m_devices.size(); i++)
+ template<class _C>
+ _C *get_single_device(const char *classname)
{
- _C *dev = dynamic_cast<_C *>(m_devices[i]);
- if (dev != NULL)
+ _C *ret = NULL;
+ for (std::size_t i = 0; i < m_devices.size(); i++)
{
- if (ret != NULL)
- this->error("more than one %s device found", classname);
- else
- ret = dev;
+ _C *dev = dynamic_cast<_C *>(m_devices[i]);
+ if (dev != NULL)
+ {
+ if (ret != NULL)
+ this->error("more than one %s device found", classname);
+ else
+ ret = dev;
+ }
}
+ return ret;
}
- return ret;
- }
- pnamedlist_t<netlist_device_t *> m_devices;
- netlist_net_t::list_t m_nets;
-#if (NL_KEEP_STATISTICS)
- pnamedlist_t<netlist_core_device_t *> m_started_devices;
-#endif
+ pnamedlist_t<device_t *> m_devices;
+ net_t::list_t m_nets;
+ #if (NL_KEEP_STATISTICS)
+ pnamedlist_t<core_device_t *> m_started_devices;
+ #endif
-protected:
+ protected:
- enum loglevel_e
- {
- NL_ERROR,
- NL_WARNING,
- NL_LOG
- };
+ enum loglevel_e
+ {
+ NL_ERROR,
+ NL_WARNING,
+ NL_LOG
+ };
- // any derived netlist must override this ...
- /* ATTR_COLD */ virtual void verror(const loglevel_e level,
- const char *format, va_list ap) const = 0;
+ // any derived netlist must override this ...
+ virtual void verror(const loglevel_e level,
+ const char *format, va_list ap) const = 0;
- /* from netlist_object */
- /* ATTR_COLD */ virtual void reset();
- /* ATTR_COLD */ virtual void save_register();
+ /* from netlist_object */
+ virtual void reset();
+ virtual void save_register();
-#if (NL_KEEP_STATISTICS)
- // performance
- int m_perf_out_processed;
- int m_perf_inp_processed;
- int m_perf_inp_active;
-#endif
+ #if (NL_KEEP_STATISTICS)
+ // performance
+ int m_perf_out_processed;
+ int m_perf_inp_processed;
+ int m_perf_inp_active;
+ #endif
-private:
- netlist_time m_stop; // target time for current queue processing
+ private:
+ netlist_time m_stop; // target time for current queue processing
- netlist_time m_time;
- netlist_queue_t m_queue;
+ netlist_time m_time;
+ bool m_use_deactivate;
+ queue_t m_queue;
- NETLIB_NAME(mainclock) * m_mainclock;
- NETLIB_NAME(solver) * m_solver;
- NETLIB_NAME(gnd) * m_gnd;
- bool m_use_deactivate;
+ devices::NETLIB_NAME(mainclock) * m_mainclock;
+ devices::NETLIB_NAME(solver) * m_solver;
+ devices::NETLIB_NAME(gnd) * m_gnd;
- NETLIB_NAME(netlistparams) *m_params;
- netlist_setup_t *m_setup;
-};
-// -----------------------------------------------------------------------------
-// /* inline */ implementations
-// -----------------------------------------------------------------------------
+ devices::NETLIB_NAME(netlistparams) *m_params;
+ setup_t *m_setup;
+ };
-PSTATE_INTERFACE(netlist_object_t, m_netlist, name())
+ // -----------------------------------------------------------------------------
+ // inline implementations
+ // -----------------------------------------------------------------------------
-ATTR_HOT inline void netlist_param_str_t::setTo(const pstring &param)
-{
- m_param = param;
- netdev().update_param();
-}
+ PSTATE_INTERFACE(object_t, m_netlist, name())
-ATTR_HOT inline void netlist_param_int_t::setTo(const int param)
-{
- if (m_param != param)
+ template <class C, param_t::param_type_t T>
+ ATTR_HOT inline void param_template_t<C, T>::setTo(const C &param)
{
- m_param = param;
- netdev().update_param();
+ if (m_param != param)
+ {
+ m_param = param;
+ device().update_param();
+ }
}
-}
-ATTR_HOT inline void netlist_param_double_t::setTo(const nl_double param)
-{
- if (m_param != param)
+ ATTR_HOT inline logic_net_t & net_t::as_logic()
{
- m_param = param;
- netdev().update_param();
+ nl_assert(family() == LOGIC);
+ return static_cast<logic_net_t &>(*this);
}
-}
-
-ATTR_HOT inline netlist_logic_net_t & netlist_net_t::as_logic()
-{
- nl_assert(family() == LOGIC);
- return static_cast<netlist_logic_net_t &>(*this);
-}
-ATTR_HOT inline const netlist_logic_net_t & netlist_net_t::as_logic() const
-{
- nl_assert(family() == LOGIC);
- return static_cast<const netlist_logic_net_t &>(*this);
-}
+ ATTR_HOT inline const logic_net_t & net_t::as_logic() const
+ {
+ nl_assert(family() == LOGIC);
+ return static_cast<const logic_net_t &>(*this);
+ }
-ATTR_HOT inline netlist_analog_net_t & netlist_net_t::as_analog()
-{
- nl_assert(family() == ANALOG);
- return static_cast<netlist_analog_net_t &>(*this);
-}
+ ATTR_HOT inline analog_net_t & net_t::as_analog()
+ {
+ nl_assert(family() == ANALOG);
+ return static_cast<analog_net_t &>(*this);
+ }
-ATTR_HOT inline const netlist_analog_net_t & netlist_net_t::as_analog() const
-{
- nl_assert(family() == ANALOG);
- return static_cast<const netlist_analog_net_t &>(*this);
-}
+ ATTR_HOT inline const analog_net_t & net_t::as_analog() const
+ {
+ nl_assert(family() == ANALOG);
+ return static_cast<const analog_net_t &>(*this);
+ }
-ATTR_HOT inline void netlist_logic_input_t::inactivate()
-{
- if (EXPECTED(!is_state(STATE_INP_PASSIVE)))
+ ATTR_HOT inline void logic_input_t::inactivate()
{
- set_state(STATE_INP_PASSIVE);
- net().as_logic().dec_active(*this);
+ if (EXPECTED(!is_state(STATE_INP_PASSIVE)))
+ {
+ //printf("inactivate %s\n", name().cstr());
+ set_state(STATE_INP_PASSIVE);
+ net().as_logic().dec_active(*this);
+ }
}
-}
-ATTR_HOT inline void netlist_logic_input_t::activate()
-{
- if (is_state(STATE_INP_PASSIVE))
+ ATTR_HOT inline void logic_input_t::activate()
{
- net().as_logic().inc_active(*this);
- set_state(STATE_INP_ACTIVE);
+ if (is_state(STATE_INP_PASSIVE))
+ {
+ net().as_logic().inc_active(*this);
+ set_state(STATE_INP_ACTIVE);
+ }
}
-}
-ATTR_HOT inline void netlist_logic_input_t::activate_hl()
-{
- if (is_state(STATE_INP_PASSIVE))
+ ATTR_HOT inline void logic_input_t::activate_hl()
{
- net().as_logic().inc_active(*this);
- set_state(STATE_INP_HL);
+ if (is_state(STATE_INP_PASSIVE))
+ {
+ net().as_logic().inc_active(*this);
+ set_state(STATE_INP_HL);
+ }
}
-}
-ATTR_HOT inline void netlist_logic_input_t::activate_lh()
-{
- if (is_state(STATE_INP_PASSIVE))
+ ATTR_HOT inline void logic_input_t::activate_lh()
{
- net().as_logic().inc_active(*this);
- set_state(STATE_INP_LH);
+ if (is_state(STATE_INP_PASSIVE))
+ {
+ net().as_logic().inc_active(*this);
+ set_state(STATE_INP_LH);
+ }
}
-}
-ATTR_HOT inline void netlist_net_t::push_to_queue(const netlist_time &delay)
-{
- if (!is_queued() && (num_cons() > 0))
+ ATTR_HOT inline void net_t::push_to_queue(const netlist_time &delay)
+ {
+ if (!is_queued() && (num_cons() > 0))
+ {
+ m_time = netlist().time() + delay;
+ m_in_queue = (m_active > 0); /* queued ? */
+ if (m_in_queue)
+ {
+ netlist().push_to_queue(*this, m_time);
+ }
+ }
+ }
+
+ ATTR_HOT inline void net_t::reschedule_in_queue(const netlist_time &delay)
{
+ if (is_queued())
+ netlist().remove_from_queue(*this);
+
m_time = netlist().time() + delay;
m_in_queue = (m_active > 0); /* queued ? */
- if (m_in_queue)
+ if (EXPECTED(m_in_queue))
{
netlist().push_to_queue(*this, m_time);
}
}
-}
-ATTR_HOT inline void netlist_net_t::reschedule_in_queue(const netlist_time &delay)
-{
- if (is_queued())
- netlist().remove_from_queue(*this);
- m_time = netlist().time() + delay;
- m_in_queue = (m_active > 0); /* queued ? */
- if (EXPECTED(m_in_queue))
+ ATTR_HOT inline netlist_sig_t logic_input_t::Q() const
{
- netlist().push_to_queue(*this, m_time);
+ return net().as_logic().Q();
}
-}
+ ATTR_HOT inline nl_double analog_input_t::Q_Analog() const
+ {
+ return net().as_analog().Q_Analog();
+ }
-ATTR_HOT inline netlist_sig_t netlist_logic_input_t::Q() const
-{
- return net().as_logic().Q();
-}
+ ATTR_HOT inline void analog_output_t::set_Q(const nl_double newQ)
+ {
+ if (newQ != net().as_analog().m_cur_Analog)
+ {
+ net().as_analog().m_cur_Analog = newQ;
+ net().push_to_queue(NLTIME_FROM_NS(1));
+ }
+ }
-ATTR_HOT inline nl_double netlist_analog_input_t::Q_Analog() const
-{
- return net().as_analog().Q_Analog();
-}
+ ATTR_HOT inline void netlist_t::push_to_queue(net_t &out, const netlist_time &attime)
+ {
+ m_queue.push(queue_t::entry_t(attime, &out));
+ }
-ATTR_HOT inline void netlist_analog_output_t::set_Q(const nl_double newQ)
-{
- if (newQ != net().as_analog().m_cur_Analog)
+ ATTR_HOT inline void netlist_t::remove_from_queue(net_t &out)
{
- net().as_analog().m_cur_Analog = newQ;
- net().push_to_queue(NLTIME_FROM_NS(1));
+ m_queue.remove(&out);
}
-}
-ATTR_HOT inline void netlist_base_t::push_to_queue(netlist_net_t &out, const netlist_time &attime)
-{
- m_queue.push(netlist_queue_t::entry_t(attime, &out));
}
-ATTR_HOT inline void netlist_base_t::remove_from_queue(netlist_net_t &out)
-{
- m_queue.remove(&out);
-}
+NETLIST_SAVE_TYPE(netlist::core_terminal_t::state_e, DT_INT);
+
#endif /* NLBASE_H_ */
diff --git a/src/emu/netlist/nl_config.h b/src/emu/netlist/nl_config.h
index c6b5373fb26..5fceb40d3bf 100644
--- a/src/emu/netlist/nl_config.h
+++ b/src/emu/netlist/nl_config.h
@@ -15,30 +15,55 @@
//============================================================
/*
- * The next options needs -Wno-pmf-conversions to compile and gcc
- * There is quite some significant speed-up of up to 20% involved.
- * NO_USE_PMFCONVERSION is for illustrative purposes only. Using PMFs
- * has some overhead in comparison to calling a virtual function.
+ * The following options determine how object::update is called.
+ * NL_PMF_TYPE_VIRTUAL
+ * Use stock virtual call
*
- * To get a performance increase we need the GCC extension.
+ * NL_PMF_TYPE_GNUC_PMF
+ * Use standard pointer to member function syntax
*
- * Todo: This doesn't work with current (4.8+) mingw 32bit builds.
- * Therefore disabled for now for i386 builds.
+ * NL_PMF_TYPE_GNUC_PMF_CONV
+ * Use gnu extension and convert the pmf to a function pointer.
+ * This is not standard compliant and needs
+ * -Wno-pmf-conversions to compile.
*
+ * NL_PMF_TYPE_INTERNAL
+ * Use the same approach as MAME for deriving the function pointer.
+ * This is compiler-dependant as well
+ *
+ * Benchmarks for ./nltool -c run -f src/mame/drivers/nl_pong.c -t 10 -n pong_fast
+ *
+ * NL_PMF_TYPE_INTERNAL: 215%
+ * NL_PMF_TYPE_GNUC_PMF: 163%
+ * NL_PMF_TYPE_GNUC_PMF_CONV: 215%
+ * NL_PMF_TYPE_VIRTUAL: 213%
+ *
+ * The whole exercise was done to avoid virtual calls. In prior versions of
+ * netlist, the INTERNAL and GNUC_PMF_CONV approach provided significant improvement.
+ * Since than, ATTR_COLD was removed from functions declared as virtual.
+ * This may explain that the recent benchmarks show no difference at all.
+ *
+ * Disappointing is the GNUC_PMF performance.
*/
-#ifndef USE_PMFDELEGATES
-#if defined(__clang__) || defined(__APPLE__) || (defined(__GNUC__) && defined(__i386__))
- #define USE_PMFDELEGATES (0)
- #define NO_USE_PMFCONVERSION (1)
-#elif defined(__GNUC__)
- #define USE_PMFDELEGATES (0)
- #define NO_USE_PMFCONVERSION (0)
- #pragma GCC diagnostic ignored "-Wpmf-conversions"
-#else
- #define USE_PMFDELEGATES (0)
- #define NO_USE_PMFCONVERSION (1)
+// This will be autodetected
+//#define NL_PMF_TYPE 3
+
+#define NL_PMF_TYPE_VIRTUAL 0
+#define NL_PMF_TYPE_GNUC_PMF 1
+#define NL_PMF_TYPE_GNUC_PMF_CONV 2
+#define NL_PMF_TYPE_INTERNAL 3
+
+#ifndef NL_PMF_TYPE
+ #if PHAS_PMF_INTERNAL
+ #define NL_PMF_TYPE NL_PMF_TYPE_INTERNAL
+ #else
+ #define NL_PMF_TYPE NL_PMF_TYPE_VIRTUAL
+ #endif
#endif
+
+#if (NL_PMF_TYPE == NL_PMF_TYPE_GNUC_PMF_CONV)
+#pragma GCC diagnostic ignored "-Wpmf-conversions"
#endif
/*
@@ -69,7 +94,6 @@
#define NETLIST_GMIN_DEFAULT (1e-9)
-
//#define nl_double float
//#define NL_FCONST(x) (x ## f)
@@ -112,12 +136,6 @@
#define HAS_OPENMP (0)
#endif
-// prevent implicit copying
-#define NETLIST_PREVENT_COPYING(_name) \
- private: \
- _name(const _name &); \
- _name &operator=(const _name &);
-
//============================================================
// Performance tracking
//============================================================
diff --git a/src/emu/netlist/nl_dice_compat.h b/src/emu/netlist/nl_dice_compat.h
index 5b24868b13a..70661be23a7 100644
--- a/src/emu/netlist/nl_dice_compat.h
+++ b/src/emu/netlist/nl_dice_compat.h
@@ -40,10 +40,14 @@ sed -e 's/#define \(.*\)"\(.*\)"[ \t]*,[ \t]*\(.*\)/NET_ALIAS(\1,\2.\3)/' src/ma
*/
#ifndef NL_CONVERT_CPP
-#ifdef NETLIST_DEVELOPMENT
-#define CHIP(_n, _t) setup.register_dev( palloc(nld_ ## _t ## _dip), _n);
+#ifndef NETLIST_DEVELOPMENT
+#define NETLIST_DEVELOPMENT 0
+#endif
+#if (NETLIST_DEVELOPMENT)
+#define CHIP(_n, _t) setup.register_dev( palloc(netlist::devices::nld_ ## _t ## _dip), _n);
#else
-#define CHIP(_n, _t) setup.register_dev(NETLIB_NAME_STR(_t ## _dip), _n);
+#define CHIP(_n, _t) setup.register_dev(NETLIB_NAME_STR_S(TTL_ ## _t ## _DIP), _n);
+//#define CHIP(_n, _t) TTL_ ## _t ## _DIP(_n)
#endif
#define CONNECTION( ... ) CONNECTIONY( CONNECTIONX( __VA_ARGS__ ) )
@@ -114,7 +118,7 @@ public:
#define CIRCUIT_LAYOUT_END NETLIST_END()
#define CHIP_555_Mono(_name, _pdesc) \
- CHIP(# _name, NE555) \
+ NE555_DIP(_name) \
NET_C(_name.6, _name.7) \
RES(_name ## _R, (_pdesc)->r) \
CAP(_name ## _C, (_pdesc)->c) \
@@ -126,7 +130,7 @@ public:
NET_CSTR(# _name ".1", "GND")
#define CHIP_555_Astable(_name, _pdesc) \
- CHIP(# _name, NE555) \
+ NE555_DIP(_name) \
RES(_name ## _R1, (_pdesc)->r1) \
RES(_name ## _R2, (_pdesc)->r2) \
CAP(_name ## _C, (_pdesc)->c) \
diff --git a/src/emu/netlist/nl_factory.c b/src/emu/netlist/nl_factory.c
index 15ccbc62b5e..665e1a74f40 100644
--- a/src/emu/netlist/nl_factory.c
+++ b/src/emu/netlist/nl_factory.c
@@ -11,11 +11,13 @@
#include "nl_factory.h"
#include "nl_setup.h"
+namespace netlist
+{
// ----------------------------------------------------------------------------------------
// net_device_t_base_factory
// ----------------------------------------------------------------------------------------
-ATTR_COLD const pstring_list_t netlist_base_factory_t::term_param_list()
+ATTR_COLD const pstring_list_t base_factory_t::term_param_list()
{
if (m_def_param.startsWith("+"))
return pstring_list_t(m_def_param.substr(1), ",");
@@ -23,7 +25,7 @@ ATTR_COLD const pstring_list_t netlist_base_factory_t::term_param_list()
return pstring_list_t();
}
-ATTR_COLD const pstring_list_t netlist_base_factory_t::def_params()
+ATTR_COLD const pstring_list_t base_factory_t::def_params()
{
if (m_def_param.startsWith("+") || m_def_param.equals("-"))
return pstring_list_t();
@@ -32,46 +34,48 @@ ATTR_COLD const pstring_list_t netlist_base_factory_t::def_params()
}
-netlist_factory_list_t::netlist_factory_list_t()
+factory_list_t::factory_list_t()
{
}
-netlist_factory_list_t::~netlist_factory_list_t()
+factory_list_t::~factory_list_t()
{
for (std::size_t i=0; i < m_list.size(); i++)
{
- netlist_base_factory_t *p = m_list[i];
+ base_factory_t *p = m_list[i];
pfree(p);
}
m_list.clear();
}
-netlist_device_t *netlist_factory_list_t::new_device_by_classname(const pstring &classname) const
+#if 0
+device_t *factory_list_t::new_device_by_classname(const pstring &classname) const
{
for (std::size_t i=0; i < m_list.size(); i++)
{
- netlist_base_factory_t *p = m_list[i];
+ base_factory_t *p = m_list[i];
if (p->classname() == classname)
{
- netlist_device_t *ret = p->Create();
+ device_t *ret = p->Create();
return ret;
}
p++;
}
return NULL; // appease code analysis
}
+#endif
-netlist_device_t *netlist_factory_list_t::new_device_by_name(const pstring &name, netlist_setup_t &setup) const
+device_t *factory_list_t::new_device_by_name(const pstring &name, setup_t &setup) const
{
- netlist_base_factory_t *f = factory_by_name(name, setup);
+ base_factory_t *f = factory_by_name(name, setup);
return f->Create();
}
-netlist_base_factory_t * netlist_factory_list_t::factory_by_name(const pstring &name, netlist_setup_t &setup) const
+base_factory_t * factory_list_t::factory_by_name(const pstring &name, setup_t &setup) const
{
for (std::size_t i=0; i < m_list.size(); i++)
{
- netlist_base_factory_t *p = m_list[i];
+ base_factory_t *p = m_list[i];
if (p->name() == name)
{
return p;
@@ -81,3 +85,5 @@ netlist_base_factory_t * netlist_factory_list_t::factory_by_name(const pstring &
setup.netlist().error("Class %s not found!\n", name.cstr());
return NULL; // appease code analysis
}
+
+}
diff --git a/src/emu/netlist/nl_factory.h b/src/emu/netlist/nl_factory.h
index ff4c56ceff1..c3e8577743a 100644
--- a/src/emu/netlist/nl_factory.h
+++ b/src/emu/netlist/nl_factory.h
@@ -14,82 +14,85 @@
#include "plib/plists.h"
#include "nl_base.h"
-// -----------------------------------------------------------------------------
-// net_dev class factory
-// -----------------------------------------------------------------------------
-
-class netlist_base_factory_t
-{
- NETLIST_PREVENT_COPYING(netlist_base_factory_t)
-public:
- ATTR_COLD netlist_base_factory_t(const pstring &name, const pstring &classname,
- const pstring &def_param)
- : m_name(name), m_classname(classname), m_def_param(def_param)
- {}
-
- /* ATTR_COLD */ virtual ~netlist_base_factory_t() {}
-
- /* ATTR_COLD */ virtual netlist_device_t *Create() = 0;
-
- ATTR_COLD const pstring &name() const { return m_name; }
- ATTR_COLD const pstring &classname() const { return m_classname; }
- ATTR_COLD const pstring &param_desc() const { return m_def_param; }
- ATTR_COLD const pstring_list_t term_param_list();
- ATTR_COLD const pstring_list_t def_params();
-
-protected:
- pstring m_name; /* device name */
- pstring m_classname; /* device class name */
- pstring m_def_param; /* default parameter */
-};
-
-template <class C>
-class net_list_factory_t : public netlist_base_factory_t
+namespace netlist
{
- NETLIST_PREVENT_COPYING(net_list_factory_t)
-public:
- ATTR_COLD net_list_factory_t(const pstring &name, const pstring &classname,
- const pstring &def_param)
- : netlist_base_factory_t(name, classname, def_param) { }
+ // -----------------------------------------------------------------------------
+ // net_dev class factory
+ // -----------------------------------------------------------------------------
- ATTR_COLD netlist_device_t *Create()
+ class base_factory_t
{
- netlist_device_t *r = palloc(C);
- //r->init(setup, name);
- return r;
- }
-};
-
-class netlist_factory_list_t
-{
-public:
- typedef plist_t<netlist_base_factory_t *> list_t;
+ P_PREVENT_COPYING(base_factory_t)
+ public:
+ ATTR_COLD base_factory_t(const pstring &name, const pstring &classname,
+ const pstring &def_param)
+ : m_name(name), m_classname(classname), m_def_param(def_param)
+ {}
+
+ virtual ~base_factory_t() {}
+
+ virtual device_t *Create() = 0;
+
+ ATTR_COLD const pstring &name() const { return m_name; }
+ ATTR_COLD const pstring &classname() const { return m_classname; }
+ ATTR_COLD const pstring &param_desc() const { return m_def_param; }
+ ATTR_COLD const pstring_list_t term_param_list();
+ ATTR_COLD const pstring_list_t def_params();
+
+ protected:
+ pstring m_name; /* device name */
+ pstring m_classname; /* device class name */
+ pstring m_def_param; /* default parameter */
+ };
+
+ template <class C>
+ class factory_t : public base_factory_t
+ {
+ P_PREVENT_COPYING(factory_t)
+ public:
+ ATTR_COLD factory_t(const pstring &name, const pstring &classname,
+ const pstring &def_param)
+ : base_factory_t(name, classname, def_param) { }
+
+ ATTR_COLD device_t *Create()
+ {
+ device_t *r = palloc(C);
+ //r->init(setup, name);
+ return r;
+ }
+ };
+
+ class factory_list_t
+ {
+ public:
+ typedef plist_t<base_factory_t *> list_t;
- netlist_factory_list_t();
- ~netlist_factory_list_t();
+ factory_list_t();
+ ~factory_list_t();
- template<class _C>
- ATTR_COLD void register_device(const pstring &name, const pstring &classname,
- const pstring &def_param)
- {
- m_list.add(palloc(net_list_factory_t< _C >, name, classname, def_param));
- }
+ template<class _C>
+ ATTR_COLD void register_device(const pstring &name, const pstring &classname,
+ const pstring &def_param)
+ {
+ m_list.add(palloc(factory_t< _C >(name, classname, def_param)));
+ }
- ATTR_COLD void register_device(netlist_base_factory_t *factory)
- {
- m_list.add(factory);
- }
+ ATTR_COLD void register_device(base_factory_t *factory)
+ {
+ m_list.add(factory);
+ }
- ATTR_COLD netlist_device_t *new_device_by_classname(const pstring &classname) const;
- ATTR_COLD netlist_device_t *new_device_by_name(const pstring &name, netlist_setup_t &setup) const;
- ATTR_COLD netlist_base_factory_t * factory_by_name(const pstring &name, netlist_setup_t &setup) const;
+ //ATTR_COLD device_t *new_device_by_classname(const pstring &classname) const;
+ ATTR_COLD device_t *new_device_by_name(const pstring &name, setup_t &setup) const;
+ ATTR_COLD base_factory_t * factory_by_name(const pstring &name, setup_t &setup) const;
- const list_t &list() { return m_list; }
+ const list_t &list() { return m_list; }
-private:
- list_t m_list;
+ private:
+ list_t m_list;
-};
+ };
+}
#endif /* NLFACTORY_H_ */
diff --git a/src/emu/netlist/nl_lists.h b/src/emu/netlist/nl_lists.h
index 1a047c3b5aa..b861d1e84e2 100644
--- a/src/emu/netlist/nl_lists.h
+++ b/src/emu/netlist/nl_lists.h
@@ -11,119 +11,148 @@
#define NLLISTS_H_
#include "nl_config.h"
-
+#include "plib/plists.h"
// ----------------------------------------------------------------------------------------
// timed queue
// ----------------------------------------------------------------------------------------
-template <class _Element, class _Time, int _Size>
-class netlist_timed_queue
+namespace netlist
{
- NETLIST_PREVENT_COPYING(netlist_timed_queue)
-public:
-
- class entry_t
+ template <class _Element, class _Time>
+ class timed_queue
{
+ P_PREVENT_COPYING(timed_queue)
public:
- ATTR_HOT /* inline */ entry_t()
- : m_exec_time(), m_object() {}
- ATTR_HOT /* inline */ entry_t(const _Time &atime, const _Element &elem) : m_exec_time(atime), m_object(elem) {}
- ATTR_HOT /* inline */ const _Time &exec_time() const { return m_exec_time; }
- ATTR_HOT /* inline */ const _Element &object() const { return m_object; }
-
- ATTR_HOT /* inline */ entry_t &operator=(const entry_t &right) {
- m_exec_time = right.m_exec_time;
- m_object = right.m_object;
- return *this;
- }
- private:
- _Time m_exec_time;
- _Element m_object;
- };
+ class entry_t
+ {
+ public:
+ ATTR_HOT entry_t()
+ : m_exec_time(), m_object() {}
+ ATTR_HOT entry_t(const _Time &atime, const _Element &elem) : m_exec_time(atime), m_object(elem) {}
+ ATTR_HOT const _Time &exec_time() const { return m_exec_time; }
+ ATTR_HOT const _Element &object() const { return m_object; }
+
+ ATTR_HOT entry_t &operator=(const entry_t &right) {
+ m_exec_time = right.m_exec_time;
+ m_object = right.m_object;
+ return *this;
+ }
- netlist_timed_queue()
- {
- clear();
- }
+ private:
+ _Time m_exec_time;
+ _Element m_object;
+ };
- ATTR_HOT /* inline */ int capacity() const { return _Size; }
- ATTR_HOT /* inline */ bool is_empty() const { return (m_end == &m_list[1]); }
- ATTR_HOT /* inline */ bool is_not_empty() const { return (m_end > &m_list[1]); }
+ timed_queue(unsigned list_size)
+ : m_list(list_size)
+ {
+ #if HAS_OPENMP && USE_OPENMP
+ m_lock = 0;
+ #endif
+ clear();
+ }
- ATTR_HOT void push(const entry_t &e)
- {
- const _Time t = e.exec_time();
- entry_t * i = m_end++;
- while (t > (i - 1)->exec_time())
+ ATTR_HOT std::size_t capacity() const { return m_list.size(); }
+ ATTR_HOT bool is_empty() const { return (m_end == &m_list[1]); }
+ ATTR_HOT bool is_not_empty() const { return (m_end > &m_list[1]); }
+
+ ATTR_HOT void push(const entry_t &e)
{
- *(i) = *(i-1);
- i--;
- inc_stat(m_prof_sortmove);
+ #if HAS_OPENMP && USE_OPENMP
+ /* Lock */
+ while (atomic_exchange32(&m_lock, 1)) { }
+ #endif
+ const _Time t = e.exec_time();
+ entry_t * i = m_end++;
+ while (t > (i - 1)->exec_time())
+ {
+ *(i) = *(i-1);
+ i--;
+ inc_stat(m_prof_sortmove);
+ }
+ *i = e;
+ inc_stat(m_prof_call);
+ #if HAS_OPENMP && USE_OPENMP
+ m_lock = 0;
+ #endif
+ //nl_assert(m_end - m_list < _Size);
}
- *i = e;
- inc_stat(m_prof_call);
- //nl_assert(m_end - m_list < _Size);
- }
- ATTR_HOT /* inline */ const entry_t *pop()
- {
- return --m_end;
- }
+ ATTR_HOT const entry_t *pop()
+ {
+ return --m_end;
+ }
- ATTR_HOT /* inline */ const entry_t *peek() const
- {
- return (m_end-1);
- }
+ ATTR_HOT const entry_t *peek() const
+ {
+ return (m_end-1);
+ }
- ATTR_HOT /* inline */ void remove(const _Element &elem)
- {
- entry_t * i = m_end - 1;
- while (i > &m_list[0])
+ ATTR_HOT void remove(const _Element &elem)
{
- if (i->object() == elem)
+ /* Lock */
+ #if HAS_OPENMP && USE_OPENMP
+ while (atomic_exchange32(&m_lock, 1)) { }
+ #endif
+ entry_t * i = m_end - 1;
+ while (i > &m_list[0])
{
- m_end--;
- while (i < m_end)
+ if (i->object() == elem)
{
- *i = *(i+1);
- i++;
+ m_end--;
+ while (i < m_end)
+ {
+ *i = *(i+1);
+ i++;
+ }
+ #if HAS_OPENMP && USE_OPENMP
+ m_lock = 0;
+ #endif
+ return;
}
- return;
+ i--;
}
- i--;
+ #if HAS_OPENMP && USE_OPENMP
+ m_lock = 0;
+ #endif
}
- }
- ATTR_COLD void clear()
- {
- m_end = &m_list[0];
- /* put an empty element with maximum time into the queue.
- * the insert algo above will run into this element and doesn't
- * need a comparison with queue start.
- */
- m_list[0] = entry_t(_Time::from_raw(~0), _Element(0));
- m_end++;
- }
+ ATTR_COLD void clear()
+ {
+ m_end = &m_list[0];
+ /* put an empty element with maximum time into the queue.
+ * the insert algo above will run into this element and doesn't
+ * need a comparison with queue start.
+ */
+ m_list[0] = entry_t(_Time::from_raw(~0), _Element(0));
+ m_end++;
+ }
- // save state support & mame disasm
+ // save state support & mame disasm
- ATTR_COLD /* inline */ const entry_t *listptr() const { return &m_list[0]; }
- ATTR_HOT /* inline */ int count() const { return m_end - m_list; }
- ATTR_HOT /* inline */ const entry_t & operator[](const int & index) const { return m_list[index]; }
+ ATTR_COLD const entry_t *listptr() const { return &m_list[1]; }
+ ATTR_HOT int count() const { return m_end - &m_list[1]; }
+ ATTR_HOT const entry_t & operator[](const int & index) const { return m_list[1+index]; }
-#if (NL_KEEP_STATISTICS)
- // profiling
- INT32 m_prof_sortmove;
- INT32 m_prof_call;
-#endif
+ #if (NL_KEEP_STATISTICS)
+ // profiling
+ INT32 m_prof_sortmove;
+ INT32 m_prof_call;
+ #endif
-private:
+ private:
+
+ #if HAS_OPENMP && USE_OPENMP
+ volatile INT32 m_lock;
+ #endif
+ entry_t * m_end;
+ //entry_t m_list[_Size];
+ parray_t<entry_t> m_list;
- entry_t * m_end;
- entry_t m_list[_Size];
+ };
-};
+}
#endif /* NLLISTS_H_ */
diff --git a/src/emu/netlist/nl_parser.c b/src/emu/netlist/nl_parser.c
index c7eb527d15a..efdac63c182 100644
--- a/src/emu/netlist/nl_parser.c
+++ b/src/emu/netlist/nl_parser.c
@@ -12,11 +12,13 @@
//#undef NL_VERBOSE_OUT
//#define NL_VERBOSE_OUT(x) printf x
+namespace netlist
+{
// ----------------------------------------------------------------------------------------
// A netlist parser
// ----------------------------------------------------------------------------------------
-ATTR_COLD void netlist_parser::verror(pstring msg, int line_num, pstring line)
+ATTR_COLD void parser_t::verror(pstring msg, int line_num, pstring line)
{
m_setup.netlist().error("line %d: error: %s\n\t\t%s\n", line_num,
msg.cstr(), line.cstr());
@@ -25,7 +27,7 @@ ATTR_COLD void netlist_parser::verror(pstring msg, int line_num, pstring line)
}
-bool netlist_parser::parse(const char *buf, const pstring nlname)
+bool parser_t::parse(const char *buf, const pstring nlname)
{
ppreprocessor prepro;
@@ -48,10 +50,14 @@ bool netlist_parser::parse(const char *buf, const pstring nlname)
m_tok_comma = register_token(",");
m_tok_ALIAS = register_token("ALIAS");
+ m_tok_DIPPINS = register_token("DIPPINS");
m_tok_NET_C = register_token("NET_C");
+ m_tok_FRONTIER = register_token("OPTIMIZE_FRONTIER");
m_tok_PARAM = register_token("PARAM");
m_tok_NET_MODEL = register_token("NET_MODEL");
m_tok_INCLUDE = register_token("INCLUDE");
+ m_tok_LOCAL_SOURCE = register_token("LOCAL_SOURCE");
+ m_tok_LOCAL_LIB_ENTRY = register_token("LOCAL_LIB_ENTRY");
m_tok_SUBMODEL = register_token("SUBMODEL");
m_tok_NETLIST_START = register_token("NETLIST_START");
m_tok_NETLIST_END = register_token("NETLIST_END");
@@ -59,6 +65,7 @@ bool netlist_parser::parse(const char *buf, const pstring nlname)
m_tok_TRUTHTABLE_END = register_token("TRUTHTABLE_END");
m_tok_TT_HEAD = register_token("TT_HEAD");
m_tok_TT_LINE = register_token("TT_LINE");
+ m_tok_TT_FAMILY = register_token("TT_FAMILY");
bool in_nl = false;
@@ -100,7 +107,7 @@ bool netlist_parser::parse(const char *buf, const pstring nlname)
}
}
-void netlist_parser::parse_netlist(ATTR_UNUSED const pstring &nlname)
+void parser_t::parse_netlist(ATTR_UNUSED const pstring &nlname)
{
while (true)
{
@@ -114,8 +121,12 @@ void netlist_parser::parse_netlist(ATTR_UNUSED const pstring &nlname)
if (token.is(m_tok_ALIAS))
net_alias();
+ else if (token.is(m_tok_DIPPINS))
+ dippins();
else if (token.is(m_tok_NET_C))
net_c();
+ else if (token.is(m_tok_FRONTIER))
+ frontier();
else if (token.is(m_tok_PARAM))
netdev_param();
else if (token.is(m_tok_NET_MODEL))
@@ -124,8 +135,15 @@ void netlist_parser::parse_netlist(ATTR_UNUSED const pstring &nlname)
net_submodel();
else if (token.is(m_tok_INCLUDE))
net_include();
+ else if (token.is(m_tok_LOCAL_SOURCE))
+ net_local_source();
else if (token.is(m_tok_TRUTHTABLE_START))
net_truthtable_start();
+ else if (token.is(m_tok_LOCAL_LIB_ENTRY))
+ {
+ m_setup.register_lib_entry(get_identifier());
+ require_token(m_tok_param_right);
+ }
else if (token.is(m_tok_NETLIST_END))
{
netdev_netlist_end();
@@ -136,7 +154,7 @@ void netlist_parser::parse_netlist(ATTR_UNUSED const pstring &nlname)
}
}
-void netlist_parser::net_truthtable_start()
+void parser_t::net_truthtable_start()
{
pstring name = get_identifier();
require_token(m_tok_comma);
@@ -149,7 +167,7 @@ void netlist_parser::net_truthtable_start()
pstring def_param = get_string();
require_token(m_tok_param_right);
- netlist_base_factory_truthtable_t *ttd = nl_tt_factory_create(ni, no, hs,
+ netlist::devices::netlist_base_factory_truthtable_t *ttd = netlist::devices::nl_tt_factory_create(ni, no, hs,
name, name, "+" + def_param);
while (true)
@@ -168,6 +186,12 @@ void netlist_parser::net_truthtable_start()
ttd->m_desc.add(get_string());
require_token(m_tok_param_right);
}
+ else if (token.is(m_tok_TT_FAMILY))
+ {
+ require_token(m_tok_param_left);
+ ttd->m_family = netlist::logic_family_desc_t::from_model(m_setup.get_model_str(get_string()));
+ require_token(m_tok_param_right);
+ }
else
{
require_token(token, m_tok_TRUTHTABLE_END);
@@ -180,20 +204,20 @@ void netlist_parser::net_truthtable_start()
}
-void netlist_parser::netdev_netlist_start()
+void parser_t::netdev_netlist_start()
{
// don't do much
token_t name = get_token();
require_token(m_tok_param_right);
}
-void netlist_parser::netdev_netlist_end()
+void parser_t::netdev_netlist_end()
{
// don't do much
require_token(m_tok_param_right);
}
-void netlist_parser::net_model()
+void parser_t::net_model()
{
// don't do much
pstring model = get_string();
@@ -201,33 +225,52 @@ void netlist_parser::net_model()
require_token(m_tok_param_right);
}
-void netlist_parser::net_submodel()
+void parser_t::net_submodel()
{
// don't do much
- pstring name = get_identifier();
- require_token(m_tok_comma);
pstring model = get_identifier();
+ require_token(m_tok_comma);
+ pstring name = get_identifier();
require_token(m_tok_param_right);
m_setup.namespace_push(name);
- netlist_parser subparser(m_setup);
- subparser.parse(m_buf, model);
+ m_setup.include(model);
m_setup.namespace_pop();
}
-void netlist_parser::net_include()
+void parser_t::frontier()
+{
+ // don't do much
+ pstring attachat = get_identifier();
+ require_token(m_tok_comma);
+ double r_IN = eval_param(get_token());
+ require_token(m_tok_comma);
+ double r_OUT = eval_param(get_token());
+ require_token(m_tok_param_right);
+
+ m_setup.register_frontier(attachat, r_IN, r_OUT);
+}
+
+void parser_t::net_include()
{
// don't do much
pstring name = get_identifier();
require_token(m_tok_param_right);
- netlist_parser subparser(m_setup);
- subparser.parse(m_buf, name);
+ m_setup.include(name);
}
-void netlist_parser::net_alias()
+void parser_t::net_local_source()
{
- pstring alias = get_identifier();
+ // This directive is only for hardcoded netlists. Ignore it here.
+ pstring name = get_identifier();
+ require_token(m_tok_param_right);
+
+}
+
+void parser_t::net_alias()
+{
+ pstring alias = get_identifier_or_number();
require_token(m_tok_comma);
@@ -239,7 +282,7 @@ void netlist_parser::net_alias()
m_setup.register_alias(alias, out);
}
-void netlist_parser::net_c()
+void parser_t::net_c()
{
pstring first = get_identifier();
require_token(m_tok_comma);
@@ -258,69 +301,114 @@ void netlist_parser::net_c()
}
-void netlist_parser::netdev_param()
+void parser_t::dippins()
+{
+ pstring_list_t pins;
+
+ pins.add(get_identifier());
+ require_token(m_tok_comma);
+
+ while (true)
+ {
+ pstring t1 = get_identifier();
+ pins.add(t1);
+ token_t n = get_token();
+ if (n.is(m_tok_param_right))
+ break;
+ if (!n.is(m_tok_comma))
+ error("expected a comma, found <%s>", n.str().cstr());
+ }
+ if ((pins.size() % 2) == 1)
+ error("You must pass an equal number of pins to DIPPINS");
+ unsigned n = pins.size();
+ for (unsigned i = 0; i < n / 2; i++)
+ {
+ m_setup.register_alias(pstring::sprintf("%d", i+1), pins[i*2]);
+ m_setup.register_alias(pstring::sprintf("%d", n-i), pins[i*2 + 1]);
+ }
+}
+
+void parser_t::netdev_param()
{
pstring param;
- nl_double val;
param = get_identifier();
require_token(m_tok_comma);
- val = eval_param(get_token());
+ token_t tok = get_token();
+ if (tok.is_type(STRING))
+ {
+ NL_VERBOSE_OUT(("Parser: Param: %s %s\n", param.cstr(), tok.str().cstr()));
+ m_setup.register_param(param, tok.str());
+ }
+ else
+ {
+ nl_double val = eval_param(tok);
NL_VERBOSE_OUT(("Parser: Param: %s %f\n", param.cstr(), val));
m_setup.register_param(param, val);
+ }
require_token(m_tok_param_right);
}
-void netlist_parser::device(const pstring &dev_type)
+void parser_t::device(const pstring &dev_type)
{
- pstring devname;
- netlist_base_factory_t *f = m_setup.factory().factory_by_name(dev_type, m_setup);
- netlist_device_t *dev;
- pstring_list_t termlist = f->term_param_list();
- pstring_list_t def_params = f->def_params();
-
- std::size_t cnt;
+ if (m_setup.is_library_item(dev_type))
+ {
+ pstring devname = get_identifier();
+ m_setup.namespace_push(devname);
+ m_setup.include(dev_type);
+ m_setup.namespace_pop();
+ require_token(m_tok_param_right);
+ }
+ else
+ {
+ base_factory_t *f = m_setup.factory().factory_by_name(dev_type, m_setup);
+ device_t *dev;
+ pstring_list_t termlist = f->term_param_list();
+ pstring_list_t def_params = f->def_params();
- devname = get_identifier();
+ std::size_t cnt;
- dev = f->Create();
- m_setup.register_dev(dev, devname);
+ pstring devname = get_identifier();
- NL_VERBOSE_OUT(("Parser: IC: %s\n", devname.cstr()));
+ dev = f->Create();
+ m_setup.register_dev(dev, devname);
- cnt = 0;
- while (cnt < def_params.size())
- {
- pstring paramfq = devname + "." + def_params[cnt];
+ NL_VERBOSE_OUT(("Parser: IC: %s\n", devname.cstr()));
- NL_VERBOSE_OUT(("Defparam: %s\n", paramfq.cstr()));
- require_token(m_tok_comma);
- token_t tok = get_token();
- if (tok.is_type(STRING))
- {
- m_setup.register_param(paramfq, tok.str());
- }
- else
+ cnt = 0;
+ while (cnt < def_params.size())
{
- nl_double val = eval_param(tok);
- m_setup.register_param(paramfq, val);
+ pstring paramfq = devname + "." + def_params[cnt];
+
+ NL_VERBOSE_OUT(("Defparam: %s\n", paramfq.cstr()));
+ require_token(m_tok_comma);
+ token_t tok = get_token();
+ if (tok.is_type(STRING))
+ {
+ m_setup.register_param(paramfq, tok.str());
+ }
+ else
+ {
+ nl_double val = eval_param(tok);
+ m_setup.register_param(paramfq, val);
+ }
+ cnt++;
}
- cnt++;
- }
- token_t tok = get_token();
- cnt = 0;
- while (tok.is(m_tok_comma) && cnt < termlist.size())
- {
- pstring output_name = get_identifier();
+ token_t tok = get_token();
+ cnt = 0;
+ while (tok.is(m_tok_comma) && cnt < termlist.size())
+ {
+ pstring output_name = get_identifier();
- m_setup.register_link(devname + "." + termlist[cnt], output_name);
+ m_setup.register_link(devname + "." + termlist[cnt], output_name);
- cnt++;
- tok = get_token();
+ cnt++;
+ tok = get_token();
+ }
+ if (cnt != termlist.size())
+ m_setup.netlist().error("netlist: input count mismatch for %s - expected %" SIZETFMT " found %" SIZETFMT "\n", devname.cstr(), SIZET_PRINTF(termlist.size()), SIZET_PRINTF(cnt));
+ require_token(tok, m_tok_param_right);
}
- if (cnt != termlist.size())
- m_setup.netlist().error("netlist: input count mismatch for %s - expected %" SIZETFMT " found %" SIZETFMT "\n", devname.cstr(), termlist.size(), cnt);
- require_token(tok, m_tok_param_right);
}
@@ -329,7 +417,7 @@ void netlist_parser::device(const pstring &dev_type)
// ----------------------------------------------------------------------------------------
-nl_double netlist_parser::eval_param(const token_t tok)
+nl_double parser_t::eval_param(const token_t tok)
{
static const char *macs[6] = {"", "RES_K", "RES_M", "CAP_U", "CAP_N", "CAP_P"};
static nl_double facs[6] = {1, 1e3, 1e6, 1e-6, 1e-9, 1e-12};
@@ -377,3 +465,4 @@ nl_double netlist_parser::eval_param(const token_t tok)
return ret * facs[f];
#endif
}
+}
diff --git a/src/emu/netlist/nl_parser.h b/src/emu/netlist/nl_parser.h
index d275dee35aa..89c2ba4e1e1 100644
--- a/src/emu/netlist/nl_parser.h
+++ b/src/emu/netlist/nl_parser.h
@@ -12,156 +12,67 @@
#include "nl_util.h"
#include "plib/pparser.h"
-class netlist_parser : public ptokenizer
+namespace netlist
{
- NETLIST_PREVENT_COPYING(netlist_parser)
-public:
- netlist_parser(netlist_setup_t &setup)
- : ptokenizer(), m_setup(setup), m_buf(NULL) {}
-
- bool parse(const char *buf, const pstring nlname = "");
-
- void parse_netlist(const pstring &nlname);
- void net_alias();
- void netdev_param();
- void net_c();
- void device(const pstring &dev_type);
- void netdev_netlist_start();
- void netdev_netlist_end();
- void net_model();
- void net_submodel();
- void net_include();
- void net_truthtable_start();
-
-protected:
- /* for debugging messages */
- netlist_base_t &netlist() { return m_setup.netlist(); }
-
- virtual void verror(pstring msg, int line_num, pstring line);
-private:
-
- nl_double eval_param(const token_t tok);
-
- token_id_t m_tok_param_left;
- token_id_t m_tok_param_right;
- token_id_t m_tok_comma;
- token_id_t m_tok_ALIAS;
- token_id_t m_tok_NET_C;
- token_id_t m_tok_PARAM;
- token_id_t m_tok_NET_MODEL;
- token_id_t m_tok_NETLIST_START;
- token_id_t m_tok_NETLIST_END;
- token_id_t m_tok_SUBMODEL;
- token_id_t m_tok_INCLUDE;
- token_id_t m_tok_TRUTHTABLE_START;
- token_id_t m_tok_TRUTHTABLE_END;
- token_id_t m_tok_TT_HEAD;
- token_id_t m_tok_TT_LINE;
-
- netlist_setup_t &m_setup;
-
- const char *m_buf;
-};
-
-class netlist_source_t
-{
-public:
- typedef plist_t<netlist_source_t> list_t;
-
- enum source_e
+ class parser_t : public ptokenizer
{
- EMPTY,
- STRING,
- PROC,
- MEMORY
+ P_PREVENT_COPYING(parser_t)
+ public:
+ parser_t(setup_t &setup)
+ : ptokenizer(), m_setup(setup), m_buf(NULL) {}
+
+ bool parse(const char *buf, const pstring nlname = "");
+
+ void parse_netlist(const pstring &nlname);
+ void net_alias();
+ void dippins();
+ void netdev_param();
+ void net_c();
+ void frontier();
+ void device(const pstring &dev_type);
+ void netdev_netlist_start();
+ void netdev_netlist_end();
+ void net_model();
+ void net_submodel();
+ void net_include();
+ void net_local_source();
+ void net_truthtable_start();
+
+ protected:
+ /* for debugging messages */
+ netlist_t &netlist() { return m_setup.netlist(); }
+
+ virtual void verror(pstring msg, int line_num, pstring line);
+ private:
+
+ nl_double eval_param(const token_t tok);
+
+ token_id_t m_tok_param_left;
+ token_id_t m_tok_param_right;
+ token_id_t m_tok_comma;
+ token_id_t m_tok_ALIAS;
+ token_id_t m_tok_NET_C;
+ token_id_t m_tok_DIPPINS;
+ token_id_t m_tok_FRONTIER;
+ token_id_t m_tok_PARAM;
+ token_id_t m_tok_NET_MODEL;
+ token_id_t m_tok_NETLIST_START;
+ token_id_t m_tok_NETLIST_END;
+ token_id_t m_tok_SUBMODEL;
+ token_id_t m_tok_INCLUDE;
+ token_id_t m_tok_LOCAL_SOURCE;
+ token_id_t m_tok_LOCAL_LIB_ENTRY;
+ token_id_t m_tok_TRUTHTABLE_START;
+ token_id_t m_tok_TRUTHTABLE_END;
+ token_id_t m_tok_TT_HEAD;
+ token_id_t m_tok_TT_LINE;
+ token_id_t m_tok_TT_FAMILY;
+
+ setup_t &m_setup;
+
+ const char *m_buf;
};
- netlist_source_t()
- : m_type(EMPTY),
- m_setup_func(NULL),
- m_setup_func_name(""),
- m_mem(NULL)
- {
- }
-
- netlist_source_t(pstring name, void (*setup_func)(netlist_setup_t &))
- : m_type(PROC),
- m_setup_func(setup_func),
- m_setup_func_name(name),
- m_mem(NULL)
- {
- }
-
- netlist_source_t(const char *mem)
- : m_type(MEMORY),
- m_setup_func(NULL),
- m_setup_func_name(""),
- m_mem(mem)
- {
- }
-
- ~netlist_source_t() { }
-
- bool parse(netlist_setup_t &setup, const pstring name)
- {
- switch (m_type)
- {
- case PROC:
- if (name == m_setup_func_name)
- {
- m_setup_func(setup);
- return true;
- }
- break;
- case MEMORY:
- {
- netlist_parser p(setup);
- return p.parse(m_mem, name);
- }
- break;
- case STRING:
- case EMPTY:
- break;
- }
- return false;
- }
-private:
- source_e m_type;
-
- void (*m_setup_func)(netlist_setup_t &);
- pstring m_setup_func_name;
- const char *m_mem;
-
-};
-
-class netlist_sources_t
-{
-public:
-
- netlist_sources_t() { }
-
- ~netlist_sources_t()
- {
- m_list.clear();
- }
-
- void add(netlist_source_t src)
- {
- m_list.add(src);
- }
-
- void parse(netlist_setup_t &setup, const pstring name)
- {
- for (std::size_t i=0; i < m_list.size(); i++)
- {
- if (m_list[i].parse(setup, name))
- return;
- }
- setup.netlist().error("unable to find %s in source collection", name.cstr());
- }
-
-private:
- netlist_source_t::list_t m_list;
-};
+}
#endif /* NL_PARSER_H_ */
diff --git a/src/emu/netlist/nl_setup.c b/src/emu/netlist/nl_setup.c
index 5799a8dddcd..de5f377a548 100644
--- a/src/emu/netlist/nl_setup.c
+++ b/src/emu/netlist/nl_setup.c
@@ -5,6 +5,7 @@
*
*/
+#include <solver/nld_solver.h>
#include <cstdio>
#include "plib/palloc.h"
@@ -15,41 +16,53 @@
#include "nl_factory.h"
#include "devices/net_lib.h"
#include "devices/nld_system.h"
-#include "analog/nld_solver.h"
#include "analog/nld_twoterm.h"
static NETLIST_START(base)
TTL_INPUT(ttlhigh, 1)
TTL_INPUT(ttllow, 0)
- NET_REGISTER_DEV(gnd, GND)
- NET_REGISTER_DEV(netlistparams, NETLIST)
+ NET_REGISTER_DEV(GND, GND)
+ NET_REGISTER_DEV(PARAMETER, NETLIST)
+
+ LOCAL_SOURCE(diode_models)
+ LOCAL_SOURCE(bjt_models)
+ LOCAL_SOURCE(family_models)
+ LOCAL_SOURCE(TTL74XX_lib)
+ LOCAL_SOURCE(CD4XXX_lib)
+ LOCAL_SOURCE(OPAMP_lib)
INCLUDE(diode_models);
INCLUDE(bjt_models);
+ INCLUDE(family_models);
+ INCLUDE(TTL74XX_lib);
+ INCLUDE(CD4XXX_lib);
+ INCLUDE(OPAMP_lib);
NETLIST_END()
// ----------------------------------------------------------------------------------------
-// netlist_setup_t
+// setup_t
// ----------------------------------------------------------------------------------------
-netlist_setup_t::netlist_setup_t(netlist_base_t &netlist)
+namespace netlist
+{
+setup_t::setup_t(netlist_t *netlist)
: m_netlist(netlist)
, m_proxy_cnt(0)
{
- netlist.set_setup(this);
- m_factory = palloc(netlist_factory_list_t);
+ netlist->set_setup(this);
+ m_factory = palloc(factory_list_t);
}
-void netlist_setup_t::init()
+void setup_t::init()
{
- nl_initialize_factory(factory());
+ initialize_factory(factory());
NETLIST_NAME(base)(*this);
}
-netlist_setup_t::~netlist_setup_t()
+setup_t::~setup_t()
{
m_links.clear();
m_alias.clear();
@@ -59,11 +72,12 @@ netlist_setup_t::~netlist_setup_t()
netlist().set_setup(NULL);
pfree(m_factory);
+ m_sources.clear_and_free();
pstring::resetmem();
}
-ATTR_COLD pstring netlist_setup_t::build_fqn(const pstring &obj_name) const
+ATTR_COLD pstring setup_t::build_fqn(const pstring &obj_name) const
{
if (m_stack.empty())
return netlist().name() + "." + obj_name;
@@ -71,7 +85,7 @@ ATTR_COLD pstring netlist_setup_t::build_fqn(const pstring &obj_name) const
return m_stack.peek() + "." + obj_name;
}
-void netlist_setup_t::namespace_push(const pstring &aname)
+void setup_t::namespace_push(const pstring &aname)
{
if (m_stack.empty())
m_stack.push(netlist().name() + "." + aname);
@@ -79,13 +93,13 @@ void netlist_setup_t::namespace_push(const pstring &aname)
m_stack.push(m_stack.peek() + "." + aname);
}
-void netlist_setup_t::namespace_pop()
+void setup_t::namespace_pop()
{
m_stack.pop();
}
-netlist_device_t *netlist_setup_t::register_dev(netlist_device_t *dev, const pstring &name)
+device_t *setup_t::register_dev(device_t *dev, const pstring &name)
{
pstring fqn = build_fqn(name);
@@ -96,72 +110,83 @@ netlist_device_t *netlist_setup_t::register_dev(netlist_device_t *dev, const pst
return dev;
}
-netlist_device_t *netlist_setup_t::register_dev(const pstring &classname, const pstring &name)
+void setup_t::register_lib_entry(const pstring &name)
{
- netlist_device_t *dev = factory().new_device_by_classname(classname);
- if (dev == NULL)
- netlist().error("Class %s not found!\n", classname.cstr());
- return register_dev(dev, name);
+ if (m_lib.contains(name))
+ netlist().warning("Lib entry collection already contains %s. IGNORED", name.cstr());
+ else
+ m_lib.add(name);
}
-void netlist_setup_t::remove_dev(const pstring &name)
+device_t *setup_t::register_dev(const pstring &classname, const pstring &name)
{
- netlist_device_t *dev = netlist().m_devices.find_by_name(name);
- pstring temp = name + ".";
- if (dev == NULL)
- netlist().error("Device %s does not exist\n", name.cstr());
-
- remove_start_with<tagmap_terminal_t>(m_terminals, temp);
- remove_start_with<tagmap_param_t>(m_params, temp);
-
- const link_t *p = m_links.data();
- while (p != NULL)
+ if (m_lib.contains(classname))
{
- const link_t *n = p+1;
- if (temp.equals(p->e1.substr(0,temp.len())) || temp.equals(p->e2.substr(0,temp.len())))
- m_links.remove(*p);
- p = n;
+ namespace_push(name);
+ include(classname);
+ namespace_pop();
+ return NULL;
+ }
+ else
+ {
+ device_t *dev = factory().new_device_by_name(classname, *this);
+ //device_t *dev = factory().new_device_by_classname(classname);
+ if (dev == NULL)
+ netlist().error("Class %s not found!\n", classname.cstr());
+ return register_dev(dev, name);
}
- netlist().m_devices.remove_by_name(name);
}
-void netlist_setup_t::register_model(const pstring &model)
+void setup_t::register_model(const pstring &model)
{
m_models.add(model);
}
-void netlist_setup_t::register_alias_nofqn(const pstring &alias, const pstring &out)
+void setup_t::register_alias_nofqn(const pstring &alias, const pstring &out)
{
- if (!(m_alias.add(link_t(alias, out), false)==true))
+ if (!m_alias.add(alias, out))
netlist().error("Error adding alias %s to alias list\n", alias.cstr());
}
-void netlist_setup_t::register_alias(const pstring &alias, const pstring &out)
+void setup_t::register_alias(const pstring &alias, const pstring &out)
{
pstring alias_fqn = build_fqn(alias);
pstring out_fqn = build_fqn(out);
register_alias_nofqn(alias_fqn, out_fqn);
}
-pstring netlist_setup_t::objtype_as_astr(netlist_object_t &in) const
+void setup_t::register_dippins_arr(const pstring &terms)
+{
+ pstring_list_t list(terms,", ");
+ if (list.size() == 0 || (list.size() % 2) == 1)
+ netlist().error("You must pass an equal number of pins to DIPPINS");
+ unsigned n = list.size();
+ for (unsigned i = 0; i < n / 2; i++)
+ {
+ register_alias(pstring::sprintf("%d", i+1), list[i * 2]);
+ register_alias(pstring::sprintf("%d", n-i), list[i * 2 + 1]);
+ }
+}
+
+pstring setup_t::objtype_as_astr(object_t &in) const
{
switch (in.type())
{
- case netlist_terminal_t::TERMINAL:
+ case terminal_t::TERMINAL:
return "TERMINAL";
- case netlist_terminal_t::INPUT:
+ case terminal_t::INPUT:
return "INPUT";
- case netlist_terminal_t::OUTPUT:
+ case terminal_t::OUTPUT:
return "OUTPUT";
- case netlist_terminal_t::NET:
+ case terminal_t::NET:
return "NET";
- case netlist_terminal_t::PARAM:
+ case terminal_t::PARAM:
return "PARAM";
- case netlist_terminal_t::DEVICE:
+ case terminal_t::DEVICE:
return "DEVICE";
- case netlist_terminal_t::NETLIST:
+ case terminal_t::NETLIST:
return "NETLIST";
- case netlist_terminal_t::QUEUE:
+ case terminal_t::QUEUE:
return "QUEUE";
}
// FIXME: noreturn
@@ -169,21 +194,41 @@ pstring netlist_setup_t::objtype_as_astr(netlist_object_t &in) const
return "Error";
}
-void netlist_setup_t::register_object(netlist_device_t &dev, const pstring &name, netlist_object_t &obj)
+const pstring setup_t::get_model_str(const pstring val) const
+{
+ if (val.startsWith(".model ") || val.find("(") >= 0)
+ {
+ return val;
+ }
+ else
+ {
+ pstring search = (".model " + val + " ").ucase();
+ for (std::size_t i=0; i < m_models.size(); i++)
+ {
+ if (m_models[i].ucase().startsWith(search))
+ return m_models[i];
+ }
+ netlist().error("Model %s not found\n", val.cstr());
+ return ""; /* please compiler */
+ }
+}
+
+
+void setup_t::register_object(device_t &dev, const pstring &name, object_t &obj)
{
switch (obj.type())
{
- case netlist_terminal_t::TERMINAL:
- case netlist_terminal_t::INPUT:
- case netlist_terminal_t::OUTPUT:
+ case terminal_t::TERMINAL:
+ case terminal_t::INPUT:
+ case terminal_t::OUTPUT:
{
- netlist_core_terminal_t &term = dynamic_cast<netlist_core_terminal_t &>(obj);
- if (obj.isType(netlist_terminal_t::OUTPUT))
+ core_terminal_t &term = dynamic_cast<core_terminal_t &>(obj);
+ if (obj.isType(terminal_t::OUTPUT))
{
- if (obj.isFamily(netlist_terminal_t::LOGIC))
- dynamic_cast<netlist_logic_output_t &>(term).init_object(dev, dev.name() + "." + name);
- else if (obj.isFamily(netlist_terminal_t::ANALOG))
- dynamic_cast<netlist_analog_output_t &>(term).init_object(dev, dev.name() + "." + name);
+ if (obj.isFamily(terminal_t::LOGIC))
+ dynamic_cast<logic_output_t &>(term).init_object(dev, dev.name() + "." + name);
+ else if (obj.isFamily(terminal_t::ANALOG))
+ dynamic_cast<analog_output_t &>(term).init_object(dev, dev.name() + "." + name);
else
netlist().error("Error adding %s %s to terminal list, neither LOGIC nor ANALOG\n", objtype_as_astr(term).cstr(), term.name().cstr());
}
@@ -195,82 +240,65 @@ void netlist_setup_t::register_object(netlist_device_t &dev, const pstring &name
NL_VERBOSE_OUT(("%s %s\n", objtype_as_astr(term).cstr(), name.cstr()));
}
break;
- case netlist_terminal_t::NET:
+ case terminal_t::NET:
break;
- case netlist_terminal_t::PARAM:
+ case terminal_t::PARAM:
{
- netlist_param_t &param = dynamic_cast<netlist_param_t &>(obj);
+ param_t &param = dynamic_cast<param_t &>(obj);
//printf("name: %s\n", name.cstr());
- const pstring val = m_params_temp.find_by_name(name).e2;
- if (val != "")
+ if (m_params_temp.contains(name))
{
+ const pstring val = m_params_temp[name];
switch (param.param_type())
{
- case netlist_param_t::DOUBLE:
+ case param_t::DOUBLE:
{
NL_VERBOSE_OUT(("Found parameter ... %s : %s\n", name.cstr(), val.cstr()));
double vald = 0;
if (std::sscanf(val.cstr(), "%lf", &vald) != 1)
netlist().error("Invalid number conversion %s : %s\n", name.cstr(), val.cstr());
- dynamic_cast<netlist_param_double_t &>(param).initial(vald);
+ dynamic_cast<param_double_t &>(param).initial(vald);
}
break;
- case netlist_param_t::INTEGER:
- case netlist_param_t::LOGIC:
+ case param_t::INTEGER:
+ case param_t::LOGIC:
{
NL_VERBOSE_OUT(("Found parameter ... %s : %s\n", name.cstr(), val.cstr()));
double vald = 0;
if (std::sscanf(val.cstr(), "%lf", &vald) != 1)
netlist().error("Invalid number conversion %s : %s\n", name.cstr(), val.cstr());
- dynamic_cast<netlist_param_int_t &>(param).initial((int) vald);
+ dynamic_cast<param_int_t &>(param).initial((int) vald);
}
break;
- case netlist_param_t::STRING:
+ case param_t::STRING:
{
- dynamic_cast<netlist_param_str_t &>(param).initial(val);
- }
- break;
- case netlist_param_t::MODEL:
- {
- pstring search = (".model " + val + " ").ucase();
- bool found = false;
- for (std::size_t i=0; i < m_models.size(); i++)
- {
- if (m_models[i].ucase().startsWith(search))
- {
- //int pl=m_models[i].find("(");
- //int pr=m_models[i].find(")");
- //dynamic_cast<netlist_param_model_t &>(param).initial(m_models[i].substr(pl+1,pr-pl-1));
- dynamic_cast<netlist_param_model_t &>(param).initial(m_models[i]);
- found = true;
- break;
- }
- }
- if (!found)
- netlist().error("Model %s not found\n", val.cstr());
+ dynamic_cast<param_str_t &>(param).initial(val);
}
break;
+ case param_t::MODEL:
+ dynamic_cast<param_model_t &>(param).initial(get_model_str(val));
+ break;
default:
netlist().error("Parameter is not supported %s : %s\n", name.cstr(), val.cstr());
}
}
- if (!(m_params.add(&param, false)==true))
+ if (!m_params.add(param.name(), &param))
netlist().error("Error adding parameter %s to parameter list\n", name.cstr());
}
break;
- case netlist_terminal_t::DEVICE:
+ case terminal_t::DEVICE:
netlist().error("Device registration not yet supported - %s\n", name.cstr());
break;
- case netlist_terminal_t::NETLIST:
+ case terminal_t::NETLIST:
netlist().error("Netlist registration not yet supported - %s\n", name.cstr());
break;
- case netlist_terminal_t::QUEUE:
+ case terminal_t::QUEUE:
netlist().error("QUEUE registration not yet supported - %s\n", name.cstr());
break;
}
}
-void netlist_setup_t::register_link_arr(const pstring &terms)
+void setup_t::register_link_arr(const pstring &terms)
{
pstring_list_t list(terms,", ");
if (list.size() < 2)
@@ -282,30 +310,90 @@ void netlist_setup_t::register_link_arr(const pstring &terms)
}
-void netlist_setup_t::register_link(const pstring &sin, const pstring &sout)
+void setup_t::register_link_fqn(const pstring &sin, const pstring &sout)
{
- link_t temp = link_t(build_fqn(sin), build_fqn(sout));
+ link_t temp = link_t(sin, sout);
NL_VERBOSE_OUT(("link %s <== %s\n", sin.cstr(), sout.cstr()));
m_links.add(temp);
- //if (!(m_links.add(sin + "." + sout, temp, false)==TMERR_NONE))
- // fatalerror("Error adding link %s<==%s to link list\n", sin.cstr(), sout.cstr());
}
-void netlist_setup_t::register_param(const pstring &param, const double value)
+void setup_t::register_link(const pstring &sin, const pstring &sout)
+{
+ register_link_fqn(build_fqn(sin), build_fqn(sout));
+}
+
+void setup_t::remove_connections(const pstring pin)
+{
+ pstring pinfn = build_fqn(pin);
+ bool found = false;
+ for (std::size_t i = 0; i < m_links.size(); i++)
+ {
+ if ((m_links[i].e1 == pinfn) || (m_links[i].e2 == pinfn))
+ {
+ netlist().log("removing connection: %s <==> %s\n", m_links[i].e1.cstr(), m_links[i].e2.cstr());
+ m_links.remove_at(i);
+ found = true;
+ }
+ }
+ if (!found)
+ netlist().error("remove_connections: found no occurrence of %s\n", pin.cstr());
+}
+
+
+void setup_t::register_frontier(const pstring attach, const double r_IN, const double r_OUT)
+{
+ static int frontier_cnt = 0;
+ pstring frontier_name = pstring::sprintf("frontier_%d", frontier_cnt);
+ frontier_cnt++;
+ device_t *front = register_dev("FRONTIER_DEV", frontier_name);
+ register_param(frontier_name + ".RIN", r_IN);
+ register_param(frontier_name + ".ROUT", r_OUT);
+ register_link(frontier_name + ".G", "GND");
+ pstring attfn = build_fqn(attach);
+ bool found = false;
+ for (std::size_t i = 0; i < m_links.size(); i++)
+ {
+ if (m_links[i].e1 == attfn)
+ {
+ m_links[i].e1 = front->name() + ".I";
+ found = true;
+ }
+ else if (m_links[i].e2 == attfn)
+ {
+ m_links[i].e2 = front->name() + ".I";
+ found = true;
+ }
+ }
+ if (!found)
+ netlist().error("Frontier setup: found no occurrence of %s\n", attach.cstr());
+ register_link(attach, frontier_name + ".Q");
+}
+
+
+void setup_t::register_param(const pstring &param, const double value)
{
// FIXME: there should be a better way
register_param(param, pstring::sprintf("%.9e", value));
}
-void netlist_setup_t::register_param(const pstring &param, const pstring &value)
+void setup_t::register_param(const pstring &param, const pstring &value)
{
pstring fqn = build_fqn(param);
- if (!(m_params_temp.add(link_t(fqn, value), false)==true))
- netlist().error("Error adding parameter %s to parameter list\n", param.cstr());
+ int idx = m_params_temp.index_of(fqn);
+ if (idx < 0)
+ {
+ if (!m_params_temp.add(fqn, value))
+ netlist().error("Unexpected error adding parameter %s to parameter list\n", param.cstr());
+ }
+ else
+ {
+ netlist().warning("Overwriting %s old <%s> new <%s>\n", fqn.cstr(), m_params_temp.value_at(idx).cstr(), value.cstr());
+ m_params_temp[fqn] = value;
+ }
}
-const pstring netlist_setup_t::resolve_alias(const pstring &name) const
+const pstring setup_t::resolve_alias(const pstring &name) const
{
pstring temp = name;
pstring ret;
@@ -313,17 +401,18 @@ const pstring netlist_setup_t::resolve_alias(const pstring &name) const
/* FIXME: Detect endless loop */
do {
ret = temp;
- temp = m_alias.find_by_name(ret).e2;
+ int p = m_alias.index_of(ret);
+ temp = (p>=0 ? m_alias.value_at(p) : "");
} while (temp != "");
NL_VERBOSE_OUT(("%s==>%s\n", name.cstr(), ret.cstr()));
return ret;
}
-netlist_core_terminal_t *netlist_setup_t::find_terminal(const pstring &terminal_in, bool required)
+core_terminal_t *setup_t::find_terminal(const pstring &terminal_in, bool required)
{
const pstring &tname = resolve_alias(terminal_in);
- netlist_core_terminal_t *ret;
+ core_terminal_t *ret;
ret = m_terminals.find_by_name(tname);
/* look for default */
@@ -340,14 +429,14 @@ netlist_core_terminal_t *netlist_setup_t::find_terminal(const pstring &terminal_
return ret;
}
-netlist_core_terminal_t *netlist_setup_t::find_terminal(const pstring &terminal_in, netlist_object_t::type_t atype, bool required)
+core_terminal_t *setup_t::find_terminal(const pstring &terminal_in, object_t::type_t atype, bool required)
{
const pstring &tname = resolve_alias(terminal_in);
- netlist_core_terminal_t *ret;
+ core_terminal_t *ret;
ret = m_terminals.find_by_name(tname);
/* look for default */
- if (ret == NULL && atype == netlist_object_t::OUTPUT)
+ if (ret == NULL && atype == object_t::OUTPUT)
{
/* look for ".Q" std output */
pstring s = tname + ".Q";
@@ -367,34 +456,34 @@ netlist_core_terminal_t *netlist_setup_t::find_terminal(const pstring &terminal_
return ret;
}
-netlist_param_t *netlist_setup_t::find_param(const pstring &param_in, bool required)
+param_t *setup_t::find_param(const pstring &param_in, bool required)
{
const pstring param_in_fqn = build_fqn(param_in);
const pstring &outname = resolve_alias(param_in_fqn);
- netlist_param_t *ret;
+ int ret;
- ret = m_params.find_by_name(outname);
- if (ret == NULL && required)
+ ret = m_params.index_of(outname);
+ if (ret < 0 && required)
netlist().error("parameter %s(%s) not found!\n", param_in_fqn.cstr(), outname.cstr());
- if (ret != NULL)
+ if (ret != -1)
NL_VERBOSE_OUT(("Found parameter %s\n", outname.cstr()));
- return ret;
+ return (ret == -1 ? NULL : m_params.value_at(ret));
}
// FIXME avoid dynamic cast here
-nld_base_proxy *netlist_setup_t::get_d_a_proxy(netlist_core_terminal_t &out)
+devices::nld_base_proxy *setup_t::get_d_a_proxy(core_terminal_t &out)
{
- nl_assert(out.isFamily(netlist_terminal_t::LOGIC));
+ nl_assert(out.isFamily(terminal_t::LOGIC));
//printf("proxy for %s\n", out.name().cstr());;
- netlist_logic_output_t &out_cast = dynamic_cast<netlist_logic_output_t &>(out);
- nld_base_proxy *proxy = out_cast.get_proxy();
+ logic_output_t &out_cast = dynamic_cast<logic_output_t &>(out);
+ devices::nld_base_proxy *proxy = out_cast.get_proxy();
if (proxy == NULL)
{
// create a new one ...
- nld_base_d_to_a_proxy *new_proxy = out_cast.logic_family()->create_d_a_proxy(out_cast);
+ devices::nld_base_d_to_a_proxy *new_proxy = out_cast.logic_family()->create_d_a_proxy(&out_cast);
pstring x = pstring::sprintf("proxy_da_%s_%d", out.name().cstr(), m_proxy_cnt);
m_proxy_cnt++;
@@ -406,7 +495,7 @@ nld_base_proxy *netlist_setup_t::get_d_a_proxy(netlist_core_terminal_t &out)
for (std::size_t i = 0; i < out.net().m_core_terms.size(); i++)
{
- netlist_core_terminal_t *p = out.net().m_core_terms[i];
+ core_terminal_t *p = out.net().m_core_terms[i];
p->clear_net(); // de-link from all nets ...
if (!connect(new_proxy->proxy_term(), *p))
netlist().error("Error connecting %s to %s\n", new_proxy->proxy_term().name().cstr(), (*p).name().cstr());
@@ -420,12 +509,12 @@ nld_base_proxy *netlist_setup_t::get_d_a_proxy(netlist_core_terminal_t &out)
return proxy;
}
-void netlist_setup_t::connect_input_output(netlist_core_terminal_t &in, netlist_core_terminal_t &out)
+void setup_t::connect_input_output(core_terminal_t &in, core_terminal_t &out)
{
- if (out.isFamily(netlist_terminal_t::ANALOG) && in.isFamily(netlist_terminal_t::LOGIC))
+ if (out.isFamily(terminal_t::ANALOG) && in.isFamily(terminal_t::LOGIC))
{
- netlist_logic_input_t &incast = dynamic_cast<netlist_logic_input_t &>(in);
- nld_a_to_d_proxy *proxy = palloc(nld_a_to_d_proxy, incast);
+ logic_input_t &incast = dynamic_cast<logic_input_t &>(in);
+ devices::nld_a_to_d_proxy *proxy = palloc(devices::nld_a_to_d_proxy(&incast));
incast.set_proxy(proxy);
pstring x = pstring::sprintf("proxy_ad_%s_%d", in.name().cstr(), m_proxy_cnt);
m_proxy_cnt++;
@@ -437,9 +526,9 @@ void netlist_setup_t::connect_input_output(netlist_core_terminal_t &in, netlist_
out.net().register_con(proxy->m_I);
}
- else if (out.isFamily(netlist_terminal_t::LOGIC) && in.isFamily(netlist_terminal_t::ANALOG))
+ else if (out.isFamily(terminal_t::LOGIC) && in.isFamily(terminal_t::ANALOG))
{
- nld_base_proxy *proxy = get_d_a_proxy(out);
+ devices::nld_base_proxy *proxy = get_d_a_proxy(out);
connect_terminals(proxy->proxy_term(), in);
//proxy->out().net().register_con(in);
@@ -454,17 +543,17 @@ void netlist_setup_t::connect_input_output(netlist_core_terminal_t &in, netlist_
}
-void netlist_setup_t::connect_terminal_input(netlist_terminal_t &term, netlist_core_terminal_t &inp)
+void setup_t::connect_terminal_input(terminal_t &term, core_terminal_t &inp)
{
- if (inp.isFamily(netlist_terminal_t::ANALOG))
+ if (inp.isFamily(terminal_t::ANALOG))
{
connect_terminals(inp, term);
}
- else if (inp.isFamily(netlist_terminal_t::LOGIC))
+ else if (inp.isFamily(terminal_t::LOGIC))
{
- netlist_logic_input_t &incast = dynamic_cast<netlist_logic_input_t &>(inp);
+ logic_input_t &incast = dynamic_cast<logic_input_t &>(inp);
NL_VERBOSE_OUT(("connect_terminal_input: connecting proxy\n"));
- nld_a_to_d_proxy *proxy = palloc(nld_a_to_d_proxy, incast);
+ devices::nld_a_to_d_proxy *proxy = palloc(devices::nld_a_to_d_proxy(&incast));
incast.set_proxy(proxy);
pstring x = pstring::sprintf("proxy_ad_%s_%d", inp.name().cstr(), m_proxy_cnt);
m_proxy_cnt++;
@@ -486,9 +575,9 @@ void netlist_setup_t::connect_terminal_input(netlist_terminal_t &term, netlist_c
}
}
-void netlist_setup_t::connect_terminal_output(netlist_terminal_t &in, netlist_core_terminal_t &out)
+void setup_t::connect_terminal_output(terminal_t &in, core_terminal_t &out)
{
- if (out.isFamily(netlist_terminal_t::ANALOG))
+ if (out.isFamily(terminal_t::ANALOG))
{
NL_VERBOSE_OUT(("connect_terminal_output: %s %s\n", in.name().cstr(), out.name().cstr()));
/* no proxy needed, just merge existing terminal net */
@@ -497,10 +586,10 @@ void netlist_setup_t::connect_terminal_output(netlist_terminal_t &in, netlist_co
else
out.net().register_con(in);
}
- else if (out.isFamily(netlist_terminal_t::LOGIC))
+ else if (out.isFamily(terminal_t::LOGIC))
{
NL_VERBOSE_OUT(("connect_terminal_output: connecting proxy\n"));
- nld_base_proxy *proxy = get_d_a_proxy(out);
+ devices::nld_base_proxy *proxy = get_d_a_proxy(out);
connect_terminals(proxy->proxy_term(), in);
}
@@ -510,7 +599,7 @@ void netlist_setup_t::connect_terminal_output(netlist_terminal_t &in, netlist_co
}
}
-void netlist_setup_t::connect_terminals(netlist_core_terminal_t &t1, netlist_core_terminal_t &t2)
+void setup_t::connect_terminals(core_terminal_t &t1, core_terminal_t &t2)
{
//nl_assert(in.isType(netlist_terminal_t::TERMINAL));
//nl_assert(out.isType(netlist_terminal_t::TERMINAL));
@@ -533,7 +622,7 @@ void netlist_setup_t::connect_terminals(netlist_core_terminal_t &t1, netlist_cor
else
{
NL_VERBOSE_OUT(("adding net ...\n"));
- netlist_analog_net_t *anet = palloc(netlist_analog_net_t);
+ analog_net_t *anet = palloc(analog_net_t);
t1.set_net(*anet);
//m_netlist.solver()->m_nets.add(anet);
// FIXME: Nets should have a unique name
@@ -543,18 +632,18 @@ void netlist_setup_t::connect_terminals(netlist_core_terminal_t &t1, netlist_cor
}
}
-static netlist_core_terminal_t &resolve_proxy(netlist_core_terminal_t &term)
+static core_terminal_t &resolve_proxy(core_terminal_t &term)
{
- if (term.isFamily(netlist_core_terminal_t::LOGIC))
+ if (term.isFamily(core_terminal_t::LOGIC))
{
- netlist_logic_t &out = dynamic_cast<netlist_logic_t &>(term);
+ logic_t &out = dynamic_cast<logic_t &>(term);
if (out.has_proxy())
return out.get_proxy()->proxy_term();
}
return term;
}
-bool netlist_setup_t::connect_input_input(netlist_core_terminal_t &t1, netlist_core_terminal_t &t2)
+bool setup_t::connect_input_input(core_terminal_t &t1, core_terminal_t &t2)
{
bool ret = false;
if (t1.has_net())
@@ -565,7 +654,7 @@ bool netlist_setup_t::connect_input_input(netlist_core_terminal_t &t1, netlist_c
{
for (std::size_t i=0; i<t1.net().m_core_terms.size(); i++)
{
- if (t1.net().m_core_terms[i]->isType(netlist_core_terminal_t::TERMINAL)
+ if (t1.net().m_core_terms[i]->isType(core_terminal_t::TERMINAL)
/*|| t1.net().m_core_terms[i]->isType(netlist_core_terminal_t::OUTPUT)*/)
{
ret = connect(t2, *t1.net().m_core_terms[i]);
@@ -583,7 +672,7 @@ bool netlist_setup_t::connect_input_input(netlist_core_terminal_t &t1, netlist_c
{
for (std::size_t i=0; i<t2.net().m_core_terms.size(); i++)
{
- if (t2.net().m_core_terms[i]->isType(netlist_core_terminal_t::TERMINAL)
+ if (t2.net().m_core_terms[i]->isType(core_terminal_t::TERMINAL)
/*|| t2.net().m_core_terms[i]->isType(netlist_core_terminal_t::OUTPUT)*/)
{
ret = connect(t1, *t2.net().m_core_terms[i]);
@@ -598,46 +687,46 @@ bool netlist_setup_t::connect_input_input(netlist_core_terminal_t &t1, netlist_c
-bool netlist_setup_t::connect(netlist_core_terminal_t &t1_in, netlist_core_terminal_t &t2_in)
+bool setup_t::connect(core_terminal_t &t1_in, core_terminal_t &t2_in)
{
NL_VERBOSE_OUT(("Connecting %s to %s\n", t1_in.name().cstr(), t2_in.name().cstr()));
- netlist_core_terminal_t &t1 = resolve_proxy(t1_in);
- netlist_core_terminal_t &t2 = resolve_proxy(t2_in);
+ core_terminal_t &t1 = resolve_proxy(t1_in);
+ core_terminal_t &t2 = resolve_proxy(t2_in);
bool ret = true;
- if (t1.isType(netlist_core_terminal_t::OUTPUT) && t2.isType(netlist_core_terminal_t::INPUT))
+ if (t1.isType(core_terminal_t::OUTPUT) && t2.isType(core_terminal_t::INPUT))
{
if (t2.has_net() && t2.net().isRailNet())
netlist().error("Input %s already connected\n", t2.name().cstr());
connect_input_output(t2, t1);
}
- else if (t1.isType(netlist_core_terminal_t::INPUT) && t2.isType(netlist_core_terminal_t::OUTPUT))
+ else if (t1.isType(core_terminal_t::INPUT) && t2.isType(core_terminal_t::OUTPUT))
{
if (t1.has_net() && t1.net().isRailNet())
netlist().error("Input %s already connected\n", t1.name().cstr());
connect_input_output(t1, t2);
}
- else if (t1.isType(netlist_core_terminal_t::OUTPUT) && t2.isType(netlist_core_terminal_t::TERMINAL))
+ else if (t1.isType(core_terminal_t::OUTPUT) && t2.isType(core_terminal_t::TERMINAL))
{
- connect_terminal_output(dynamic_cast<netlist_terminal_t &>(t2), t1);
+ connect_terminal_output(dynamic_cast<terminal_t &>(t2), t1);
}
- else if (t1.isType(netlist_core_terminal_t::TERMINAL) && t2.isType(netlist_core_terminal_t::OUTPUT))
+ else if (t1.isType(core_terminal_t::TERMINAL) && t2.isType(core_terminal_t::OUTPUT))
{
- connect_terminal_output(dynamic_cast<netlist_terminal_t &>(t1), t2);
+ connect_terminal_output(dynamic_cast<terminal_t &>(t1), t2);
}
- else if (t1.isType(netlist_core_terminal_t::INPUT) && t2.isType(netlist_core_terminal_t::TERMINAL))
+ else if (t1.isType(core_terminal_t::INPUT) && t2.isType(core_terminal_t::TERMINAL))
{
- connect_terminal_input(dynamic_cast<netlist_terminal_t &>(t2), t1);
+ connect_terminal_input(dynamic_cast<terminal_t &>(t2), t1);
}
- else if (t1.isType(netlist_core_terminal_t::TERMINAL) && t2.isType(netlist_core_terminal_t::INPUT))
+ else if (t1.isType(core_terminal_t::TERMINAL) && t2.isType(core_terminal_t::INPUT))
{
- connect_terminal_input(dynamic_cast<netlist_terminal_t &>(t1), t2);
+ connect_terminal_input(dynamic_cast<terminal_t &>(t1), t2);
}
- else if (t1.isType(netlist_core_terminal_t::TERMINAL) && t2.isType(netlist_core_terminal_t::TERMINAL))
+ else if (t1.isType(core_terminal_t::TERMINAL) && t2.isType(core_terminal_t::TERMINAL))
{
- connect_terminals(dynamic_cast<netlist_terminal_t &>(t1), dynamic_cast<netlist_terminal_t &>(t2));
+ connect_terminals(dynamic_cast<terminal_t &>(t1), dynamic_cast<terminal_t &>(t2));
}
- else if (t1.isType(netlist_core_terminal_t::INPUT) && t2.isType(netlist_core_terminal_t::INPUT))
+ else if (t1.isType(core_terminal_t::INPUT) && t2.isType(core_terminal_t::INPUT))
{
ret = connect_input_input(t1, t2);
}
@@ -647,7 +736,7 @@ bool netlist_setup_t::connect(netlist_core_terminal_t &t1_in, netlist_core_termi
return ret;
}
-void netlist_setup_t::resolve_inputs()
+void setup_t::resolve_inputs()
{
bool has_twoterms = false;
@@ -665,8 +754,8 @@ void netlist_setup_t::resolve_inputs()
{
const pstring t1s = m_links[li].e1;
const pstring t2s = m_links[li].e2;
- netlist_core_terminal_t *t1 = find_terminal(t1s);
- netlist_core_terminal_t *t2 = find_terminal(t2s);
+ core_terminal_t *t1 = find_terminal(t1s);
+ core_terminal_t *t2 = find_terminal(t2s);
if (connect(*t1, *t2))
{
@@ -691,7 +780,7 @@ void netlist_setup_t::resolve_inputs()
// delete empty nets ... and save m_list ...
- netlist_net_t::list_t todelete;
+ net_t::list_t todelete;
for (std::size_t i = 0; i<netlist().m_nets.size(); i++)
{
@@ -733,29 +822,34 @@ void netlist_setup_t::resolve_inputs()
// FIXME: doesn't find internal devices. This needs to be more clever
for (std::size_t i=0; i < netlist().m_devices.size(); i++)
{
- NETLIB_NAME(twoterm) *t = dynamic_cast<NETLIB_NAME(twoterm) *>(netlist().m_devices[i]);
+ devices::NETLIB_NAME(twoterm) *t = dynamic_cast<devices::NETLIB_NAME(twoterm) *>(netlist().m_devices[i]);
if (t != NULL)
{
has_twoterms = true;
if (t->m_N.net().isRailNet() && t->m_P.net().isRailNet())
+#if 0
netlist().error("Found device %s connected only to railterminals %s/%s\n",
t->name().cstr(), t->m_N.net().name().cstr(), t->m_P.net().name().cstr());
+#else
+ netlist().warning("Found device %s connected only to railterminals %s/%s\n",
+ t->name().cstr(), t->m_N.net().name().cstr(), t->m_P.net().name().cstr());
+#endif
}
}
netlist().log("initialize solver ...\n");
- if (m_netlist.solver() == NULL)
+ if (netlist().solver() == NULL)
{
if (has_twoterms)
netlist().error("No solver found for this net although analog elements are present\n");
}
else
- m_netlist.solver()->post_start();
+ netlist().solver()->post_start();
}
-void netlist_setup_t::start_devices()
+void setup_t::start_devices()
{
pstring env = nl_util::environment("NL_LOGS");
@@ -767,7 +861,7 @@ void netlist_setup_t::start_devices()
{
NL_VERBOSE_OUT(("%d: <%s>\n",i, ll[i].cstr()));
NL_VERBOSE_OUT(("%d: <%s>\n",i, ll[i].cstr()));
- netlist_device_t *nc = factory().new_device_by_classname("nld_log");
+ device_t *nc = factory().new_device_by_name("LOG", *this);
pstring name = "log_" + ll[i];
register_dev(nc, name);
register_link(name + ".I", ll[i]);
@@ -777,23 +871,112 @@ void netlist_setup_t::start_devices()
netlist().start();
}
-void netlist_setup_t::parse(const char *buf)
-{
- netlist_parser parser(*this);
- parser.parse(buf);
-}
-
-void netlist_setup_t::print_stats() const
+void setup_t::print_stats() const
{
#if (NL_KEEP_STATISTICS)
{
for (std::size_t i = 0; i < netlist().m_started_devices.size(); i++)
{
- netlist_core_device_t *entry = netlist().m_started_devices[i];
+ core_device_t *entry = netlist().m_started_devices[i];
printf("Device %20s : %12d %12d %15ld\n", entry->name().cstr(), entry->stat_call_count, entry->stat_update_count, (long int) entry->stat_total_time / (entry->stat_update_count + 1));
}
- printf("Queue Pushes %15d\n", m_netlist.queue().m_prof_call);
- printf("Queue Moves %15d\n", m_netlist.queue().m_prof_sortmove);
+ printf("Queue Pushes %15d\n", netlist().queue().m_prof_call);
+ printf("Queue Moves %15d\n", netlist().queue().m_prof_sortmove);
}
#endif
}
+
+// ----------------------------------------------------------------------------------------
+// Static
+// ----------------------------------------------------------------------------------------
+
+const pstring setup_t::model_value_str(const pstring &model_str, const pstring &entity, const pstring defval)
+{
+ pstring tmp = model_str;
+ // .model 1N914 D(Is=2.52n Rs=.568 N=1.752 Cjo=4p M=.4 tt=20n Iave=200m Vpk=75 mfg=OnSemi type=silicon)
+ int p = tmp.ucase().find(entity.ucase() + "=");
+ if (p>=0)
+ {
+ int pblank = tmp.find(" ", p);
+ if (pblank < 0) pblank = tmp.len() + 1;
+ tmp = tmp.substr(p, pblank - p);
+ if (tmp.right(1) == ")")
+ tmp = tmp.left(tmp.len()-1);
+ int pequal = tmp.find("=", 0);
+ if (pequal < 0)
+ fatalerror_e("parameter %s misformat in model %s temp %s\n", entity.cstr(), model_str.cstr(), tmp.cstr());
+ tmp = tmp.substr(pequal+1);
+ return tmp;
+ }
+ else
+ {
+ //netlist().log("Entity %s not found in model %s\n", entity.cstr(), tmp.cstr());
+ //printf("Entity %s not found in model %s\n", entity.cstr(), tmp.cstr());
+ return defval;
+ }
+}
+
+nl_double setup_t::model_value(const pstring &model_str, const pstring &entity, const nl_double defval)
+{
+ pstring tmp = model_value_str(model_str, entity, "NOTFOUND");
+
+ nl_double factor = NL_FCONST(1.0);
+ if (tmp != "NOTFOUND")
+ {
+ char numfac = *(tmp.right(1).cstr());
+ switch (numfac)
+ {
+ case 'M': factor = 1e6; break;
+ case 'k': factor = 1e3; break;
+ case 'm': factor = 1e-3; break;
+ case 'u': factor = 1e-6; break;
+ case 'n': factor = 1e-9; break;
+ case 'p': factor = 1e-12; break;
+ case 'f': factor = 1e-15; break;
+ case 'a': factor = 1e-18; break;
+ default:
+ if (numfac < '0' || numfac > '9')
+ fatalerror_e("Unknown number factor <%c> in: %s", numfac, entity.cstr());
+ }
+ if (factor != NL_FCONST(1.0))
+ tmp = tmp.left(tmp.len() - 1);
+ return tmp.as_double() * factor;
+ }
+ else
+ {
+ //netlist().log("Entity %s not found in model %s\n", entity.cstr(), tmp.cstr());
+ return defval;
+ }
+}
+
+// ----------------------------------------------------------------------------------------
+// Sources
+// ----------------------------------------------------------------------------------------
+
+void setup_t::include(const pstring &netlist_name)
+{
+ for (std::size_t i=0; i < m_sources.size(); i++)
+ {
+ if (m_sources[i]->parse(this, netlist_name))
+ return;
+ }
+ netlist().error("unable to find %s in source collection", netlist_name.cstr());
+}
+
+// ----------------------------------------------------------------------------------------
+// base sources
+// ----------------------------------------------------------------------------------------
+
+bool netlist_source_string_t::parse(setup_t *setup, const pstring name)
+{
+ parser_t p(*setup);
+ return p.parse(m_str, name);
+}
+
+bool netlist_source_mem_t::parse(setup_t *setup, const pstring name)
+{
+ parser_t p(*setup);
+ return p.parse(m_str, name);
+}
+
+}
diff --git a/src/emu/netlist/nl_setup.h b/src/emu/netlist/nl_setup.h
index df9cebac2ce..129a6fef001 100644
--- a/src/emu/netlist/nl_setup.h
+++ b/src/emu/netlist/nl_setup.h
@@ -22,16 +22,13 @@
#define ALIAS(_alias, _name) \
setup.register_alias(# _alias, # _name);
-#define NET_REGISTER_DEV(_type, _name) \
- setup.register_dev(NETLIB_NAME_STR(_type), # _name);
+#define DIPPINS(_pin1, ...) \
+ setup.register_dippins_arr( #_pin1 ", " # __VA_ARGS__);
/* to be used to reference new library truthtable devices */
-#define NET_REGISTER_DEV_X(_type, _name) \
+#define NET_REGISTER_DEV(_type, _name) \
setup.register_dev(# _type, # _name);
-#define NET_REMOVE_DEV(_name) \
- setup.remove_dev(# _name);
-
#define NET_REGISTER_SIGNAL(_type, _name) \
NET_REGISTER_DEV(_type ## _ ## sig, _name)
@@ -49,157 +46,275 @@
#define NETLIST_NAME(_name) netlist ## _ ## _name
-#define NETLIST_EXTERNAL(_name) \
-ATTR_COLD void NETLIST_NAME(_name)(netlist_setup_t &setup)
+#define NETLIST_EXTERNAL(_name) \
+ ATTR_COLD void NETLIST_NAME(_name)(netlist::setup_t &setup);
-#define NETLIST_START(_name) \
-ATTR_COLD void NETLIST_NAME(_name)(netlist_setup_t &setup) \
+#define NETLIST_START(_name) \
+ATTR_COLD void NETLIST_NAME(_name)(netlist::setup_t &setup) \
{
#define NETLIST_END() }
-#define INCLUDE(_name) \
- NETLIST_NAME(_name)(setup);
+#define LOCAL_SOURCE(_name) \
+ setup.register_source(palloc(netlist::source_proc_t(# _name, &NETLIST_NAME(_name))));
+
+#define LOCAL_LIB_ENTRY(_name) \
+ LOCAL_SOURCE(_name) \
+ setup.register_lib_entry(# _name);
-#define SUBMODEL(_name, _model) \
- setup.namespace_push(# _name); \
- NETLIST_NAME(_model)(setup); \
+#define INCLUDE(_name) \
+ setup.include(# _name);
+
+#define SUBMODEL(_model, _name) \
+ setup.namespace_push(# _name); \
+ NETLIST_NAME(_model)(setup); \
setup.namespace_pop();
// ----------------------------------------------------------------------------------------
// netlist_setup_t
// ----------------------------------------------------------------------------------------
-// Forward definition so we keep nl_factory.h out of the public
-class netlist_factory_list_t;
-
-class netlist_setup_t
+namespace netlist
{
- NETLIST_PREVENT_COPYING(netlist_setup_t)
-public:
+ // Forward definition so we keep nl_factory.h out of the public
+ class factory_list_t;
- struct link_t
+
+ class setup_t
{
- link_t() { }
- link_t(void *) { }
- // Copy constructor
- link_t(const link_t &from)
+ P_PREVENT_COPYING(setup_t)
+ public:
+
+ // ----------------------------------------------------------------------------------------
+ // A Generic netlist sources implementation
+ // ----------------------------------------------------------------------------------------
+
+ class source_t
{
- e1 = from.e1;
- e2 = from.e2;
- }
+ public:
+ typedef plist_t<source_t *> list_t;
- link_t(const pstring &ae1, const pstring &ae2)
+ source_t()
+ {}
+
+ virtual ~source_t() { }
+
+ virtual bool parse(setup_t *setup, const pstring name) = 0;
+ private:
+ };
+
+ struct link_t
{
- e1 = ae1;
- e2 = ae2;
- }
- pstring e1;
- pstring e2;
+ link_t() { }
+ link_t(void *) { }
+ // Copy constructor
+ link_t(const link_t &from)
+ {
+ e1 = from.e1;
+ e2 = from.e2;
+ }
+
+ link_t(const pstring &ae1, const pstring &ae2)
+ {
+ e1 = ae1;
+ e2 = ae2;
+ }
+ pstring e1;
+ pstring e2;
- bool operator==(const link_t &rhs) const { return (e1 == rhs.e1) && (e2 == rhs.e2); }
- link_t &operator=(const link_t &rhs) { e1 = rhs.e1; e2 = rhs.e2; return *this; }
+ bool operator==(const link_t &rhs) const { return (e1 == rhs.e1) && (e2 == rhs.e2); }
+ link_t &operator=(const link_t &rhs) { e1 = rhs.e1; e2 = rhs.e2; return *this; }
- const pstring &name() const { return e1; }
- };
+ const pstring &name() const { return e1; }
+ };
+
+ //typedef pnamedlist_t<link_t> tagmap_nstring_t;
+ typedef pnamedlist_t<core_terminal_t *> tagmap_terminal_t;
+
+ setup_t(netlist_t *netlist);
+ ~setup_t();
+
+ void init();
+
+ netlist_t &netlist() { return *m_netlist; }
+ const netlist_t &netlist() const { return *m_netlist; }
+
+ pstring build_fqn(const pstring &obj_name) const;
+
+ device_t *register_dev(device_t *dev, const pstring &name);
+ device_t *register_dev(const pstring &classname, const pstring &name);
+ void remove_dev(const pstring &name);
+
+ void register_lib_entry(const pstring &name);
+
+ void register_model(const pstring &model);
+ void register_alias(const pstring &alias, const pstring &out);
+ void register_dippins_arr(const pstring &terms);
+
+ void register_alias_nofqn(const pstring &alias, const pstring &out);
+
+ void register_link_arr(const pstring &terms);
+ void register_link_fqn(const pstring &sin, const pstring &sout);
+ void register_link(const pstring &sin, const pstring &sout);
+
+ void register_param(const pstring &param, const pstring &value);
+ void register_param(const pstring &param, const double value);
+
+ void register_frontier(const pstring attach, const double r_IN, const double r_OUT);
+ void remove_connections(const pstring attach);
- typedef pnamedlist_t<link_t> tagmap_nstring_t;
- typedef pnamedlist_t<netlist_param_t *> tagmap_param_t;
- typedef pnamedlist_t<netlist_core_terminal_t *> tagmap_terminal_t;
- typedef plist_t<link_t> tagmap_link_t;
+ const pstring get_model_str(const pstring val) const;
- netlist_setup_t(netlist_base_t &netlist);
- ~netlist_setup_t();
+ void register_object(device_t &dev, const pstring &name, object_t &obj);
+ bool connect(core_terminal_t &t1, core_terminal_t &t2);
- void init();
+ core_terminal_t *find_terminal(const pstring &outname_in, bool required = true);
+ core_terminal_t *find_terminal(const pstring &outname_in, object_t::type_t atype, bool required = true);
- netlist_base_t &netlist() { return m_netlist; }
- const netlist_base_t &netlist() const { return m_netlist; }
+ param_t *find_param(const pstring &param_in, bool required = true);
- pstring build_fqn(const pstring &obj_name) const;
+ void start_devices();
+ void resolve_inputs();
- netlist_device_t *register_dev(netlist_device_t *dev, const pstring &name);
- netlist_device_t *register_dev(const pstring &classname, const pstring &name);
- void remove_dev(const pstring &name);
+ /* handle namespace */
- void register_model(const pstring &model);
- void register_alias(const pstring &alias, const pstring &out);
- void register_alias_nofqn(const pstring &alias, const pstring &out);
- void register_link_arr(const pstring &terms);
- void register_link(const pstring &sin, const pstring &sout);
- void register_param(const pstring &param, const pstring &value);
- void register_param(const pstring &param, const double value);
+ void namespace_push(const pstring &aname);
+ void namespace_pop();
- void register_object(netlist_device_t &dev, const pstring &name, netlist_object_t &obj);
- bool connect(netlist_core_terminal_t &t1, netlist_core_terminal_t &t2);
+ /* parse a source */
- netlist_core_terminal_t *find_terminal(const pstring &outname_in, bool required = true);
- netlist_core_terminal_t *find_terminal(const pstring &outname_in, netlist_object_t::type_t atype, bool required = true);
+ void include(const pstring &netlist_name);
- netlist_param_t *find_param(const pstring &param_in, bool required = true);
+ /* register a source */
- void parse(const char *buf);
+ void register_source(source_t *src) { m_sources.add(src); }
- void start_devices();
- void resolve_inputs();
+ factory_list_t &factory() { return *m_factory; }
+ const factory_list_t &factory() const { return *m_factory; }
- /* handle namespace */
+ bool is_library_item(const pstring &name) const { return m_lib.contains(name); }
- void namespace_push(const pstring &aname);
- void namespace_pop();
+ /* not ideal, but needed for save_state */
+ tagmap_terminal_t m_terminals;
- netlist_factory_list_t &factory() { return *m_factory; }
- const netlist_factory_list_t &factory() const { return *m_factory; }
+ void print_stats() const;
- /* not ideal, but needed for save_state */
- tagmap_terminal_t m_terminals;
+ /* static support functions */
- void print_stats() const;
+ static const pstring model_value_str(const pstring &model_str, const pstring &entity, const pstring defval);
+ static nl_double model_value(const pstring &model_str, const pstring &entity, const nl_double defval);
-protected:
+ protected:
-private:
+ private:
- netlist_base_t &m_netlist;
+ netlist_t *m_netlist;
- tagmap_nstring_t m_alias;
- tagmap_param_t m_params;
- tagmap_link_t m_links;
- tagmap_nstring_t m_params_temp;
+ phashmap_t<pstring, pstring> m_alias;
+ phashmap_t<pstring, param_t *> m_params;
+ phashmap_t<pstring, pstring> m_params_temp;
- netlist_factory_list_t *m_factory;
+ plist_t<link_t> m_links;
- plist_t<pstring> m_models;
+ factory_list_t *m_factory;
- int m_proxy_cnt;
+ plist_t<pstring> m_models;
- pstack_t<pstring> m_stack;
+ int m_proxy_cnt;
+ pstack_t<pstring> m_stack;
+ source_t::list_t m_sources;
+ plist_t<pstring> m_lib;
- void connect_terminals(netlist_core_terminal_t &in, netlist_core_terminal_t &out);
- void connect_input_output(netlist_core_terminal_t &in, netlist_core_terminal_t &out);
- void connect_terminal_output(netlist_terminal_t &in, netlist_core_terminal_t &out);
- void connect_terminal_input(netlist_terminal_t &term, netlist_core_terminal_t &inp);
- bool connect_input_input(netlist_core_terminal_t &t1, netlist_core_terminal_t &t2);
- // helpers
- pstring objtype_as_astr(netlist_object_t &in) const;
+ void connect_terminals(core_terminal_t &in, core_terminal_t &out);
+ void connect_input_output(core_terminal_t &in, core_terminal_t &out);
+ void connect_terminal_output(terminal_t &in, core_terminal_t &out);
+ void connect_terminal_input(terminal_t &term, core_terminal_t &inp);
+ bool connect_input_input(core_terminal_t &t1, core_terminal_t &t2);
- const pstring resolve_alias(const pstring &name) const;
- nld_base_proxy *get_d_a_proxy(netlist_core_terminal_t &out);
+ // helpers
+ pstring objtype_as_astr(object_t &in) const;
- template <class T>
- void remove_start_with(T &hm, pstring &sw)
+ const pstring resolve_alias(const pstring &name) const;
+ devices::nld_base_proxy *get_d_a_proxy(core_terminal_t &out);
+
+#if 0
+ template <class T>
+ void remove_start_with(T &hm, pstring &sw)
+ {
+ for (std::size_t i = hm.size() - 1; i >= 0; i--)
+ {
+ pstring x = hm[i]->name();
+ if (sw.equals(x.substr(0, sw.len())))
+ {
+ NL_VERBOSE_OUT(("removing %s\n", hm[i]->name().cstr()));
+ hm.remove(hm[i]);
+ }
+ }
+ }
+#endif
+ };
+
+ // ----------------------------------------------------------------------------------------
+ // base sources
+ // ----------------------------------------------------------------------------------------
+
+
+ class netlist_source_string_t : public setup_t::source_t
+ {
+ public:
+
+ netlist_source_string_t(pstring source)
+ : setup_t::source_t(), m_str(source)
+ {
+ }
+
+ bool parse(setup_t *setup, const pstring name);
+
+ private:
+ pstring m_str;
+ };
+
+
+ class netlist_source_mem_t : public setup_t::source_t
{
- for (std::size_t i = hm.size() - 1; i >= 0; i--)
+ public:
+ netlist_source_mem_t(const char *mem)
+ : setup_t::source_t(), m_str(mem)
{
- pstring x = hm[i]->name();
- if (sw.equals(x.substr(0, sw.len())))
+ }
+
+ bool parse(setup_t *setup, const pstring name);
+ private:
+ pstring m_str;
+ };
+
+ class source_proc_t : public setup_t::source_t
+ {
+ public:
+ source_proc_t(pstring name, void (*setup_func)(setup_t &))
+ : setup_t::source_t(),
+ m_setup_func(setup_func),
+ m_setup_func_name(name)
+ {
+ }
+
+ bool parse(setup_t *setup, const pstring name)
+ {
+ if (name == m_setup_func_name)
{
- NL_VERBOSE_OUT(("removing %s\n", hm[i]->name().cstr()));
- hm.remove(hm[i]);
+ m_setup_func(*setup);
+ return true;
}
+ else
+ return false;
}
- }
-};
+ private:
+ void (*m_setup_func)(setup_t &);
+ pstring m_setup_func_name;
+ };
+
+}
+
#endif /* NLSETUP_H_ */
diff --git a/src/emu/netlist/nl_time.h b/src/emu/netlist/nl_time.h
index 365fd271c19..4473b67d2c8 100644
--- a/src/emu/netlist/nl_time.h
+++ b/src/emu/netlist/nl_time.h
@@ -23,105 +23,112 @@
// net_list_time
// ----------------------------------------------------------------------------------------
-struct netlist_time
+#define RESOLUTION NETLIST_INTERNAL_RES
+
+namespace netlist
{
-public:
+ struct netlist_time
+ {
+ public:
- typedef UINT64 INTERNALTYPE;
+ typedef UINT64 INTERNALTYPE;
- static const INTERNALTYPE RESOLUTION = NETLIST_INTERNAL_RES;
+ ATTR_HOT /* inline */ netlist_time() : m_time(0) {}
- ATTR_HOT inline netlist_time() : m_time(0) {}
+ ATTR_HOT friend /* inline */ const netlist_time operator-(const netlist_time &left, const netlist_time &right);
+ ATTR_HOT friend /* inline */ const netlist_time operator+(const netlist_time &left, const netlist_time &right);
+ ATTR_HOT friend /* inline */ const netlist_time operator*(const netlist_time &left, const UINT32 factor);
+ ATTR_HOT friend /* inline */ UINT32 operator/(const netlist_time &left, const netlist_time &right);
+ ATTR_HOT friend /* inline */ bool operator>(const netlist_time &left, const netlist_time &right);
+ ATTR_HOT friend /* inline */ bool operator<(const netlist_time &left, const netlist_time &right);
+ ATTR_HOT friend /* inline */ bool operator>=(const netlist_time &left, const netlist_time &right);
+ ATTR_HOT friend /* inline */ bool operator<=(const netlist_time &left, const netlist_time &right);
+ ATTR_HOT friend /* inline */ bool operator!=(const netlist_time &left, const netlist_time &right);
- ATTR_HOT friend inline const netlist_time operator-(const netlist_time &left, const netlist_time &right);
- ATTR_HOT friend inline const netlist_time operator+(const netlist_time &left, const netlist_time &right);
- ATTR_HOT friend inline const netlist_time operator*(const netlist_time &left, const UINT32 factor);
- ATTR_HOT friend inline UINT32 operator/(const netlist_time &left, const netlist_time &right);
- ATTR_HOT friend inline bool operator>(const netlist_time &left, const netlist_time &right);
- ATTR_HOT friend inline bool operator<(const netlist_time &left, const netlist_time &right);
- ATTR_HOT friend inline bool operator>=(const netlist_time &left, const netlist_time &right);
- ATTR_HOT friend inline bool operator<=(const netlist_time &left, const netlist_time &right);
- ATTR_HOT friend inline bool operator!=(const netlist_time &left, const netlist_time &right);
+ ATTR_HOT /* inline */ const netlist_time &operator=(const netlist_time &right) { m_time = right.m_time; return *this; }
+ ATTR_HOT /* inline */ const netlist_time &operator=(const double &right) { m_time = (INTERNALTYPE) ( right * (double) RESOLUTION); return *this; }
- ATTR_HOT inline const netlist_time &operator=(const netlist_time &right) { m_time = right.m_time; return *this; }
- ATTR_HOT inline const netlist_time &operator=(const double &right) { m_time = (INTERNALTYPE) ( right * (double) RESOLUTION); return *this; }
+ // issues with ISO C++ standard
+ //ATTR_HOT /* inline */ operator double() const { return as_double(); }
- // issues with ISO C++ standard
- //ATTR_HOT inline operator double() const { return as_double(); }
+ ATTR_HOT /* inline */ const netlist_time &operator+=(const netlist_time &right) { m_time += right.m_time; return *this; }
- ATTR_HOT inline const netlist_time &operator+=(const netlist_time &right) { m_time += right.m_time; return *this; }
+ ATTR_HOT /* inline */ INTERNALTYPE as_raw() const { return m_time; }
+ ATTR_HOT /* inline */ double as_double() const { return (double) m_time / (double) RESOLUTION; }
- ATTR_HOT inline INTERNALTYPE as_raw() const { return m_time; }
- ATTR_HOT inline double as_double() const { return (double) m_time / (double) RESOLUTION; }
+ // for save states ....
+ ATTR_HOT /* inline */ INTERNALTYPE *get_internaltype_ptr() { return &m_time; }
- // for save states ....
- ATTR_HOT inline INTERNALTYPE *get_internaltype_ptr() { return &m_time; }
+ ATTR_HOT static /* inline */ const netlist_time from_nsec(const int ns) { return netlist_time((UINT64) ns * (RESOLUTION / U64(1000000000))); }
+ ATTR_HOT static /* inline */ const netlist_time from_usec(const int us) { return netlist_time((UINT64) us * (RESOLUTION / U64(1000000))); }
+ ATTR_HOT static /* inline */ const netlist_time from_msec(const int ms) { return netlist_time((UINT64) ms * (RESOLUTION / U64(1000))); }
+ ATTR_HOT static /* inline */ const netlist_time from_hz(const UINT64 hz) { return netlist_time(RESOLUTION / hz); }
+ ATTR_HOT static /* inline */ const netlist_time from_double(const double t) { return netlist_time((INTERNALTYPE) ( t * (double) RESOLUTION)); }
+ ATTR_HOT static /* inline */ const netlist_time from_raw(const INTERNALTYPE raw) { return netlist_time(raw); }
- ATTR_HOT static inline const netlist_time from_nsec(const int ns) { return netlist_time((UINT64) ns * (RESOLUTION / U64(1000000000))); }
- ATTR_HOT static inline const netlist_time from_usec(const int us) { return netlist_time((UINT64) us * (RESOLUTION / U64(1000000))); }
- ATTR_HOT static inline const netlist_time from_msec(const int ms) { return netlist_time((UINT64) ms * (RESOLUTION / U64(1000))); }
- ATTR_HOT static inline const netlist_time from_hz(const UINT64 hz) { return netlist_time(RESOLUTION / hz); }
- ATTR_HOT static inline const netlist_time from_double(const double t) { return netlist_time((INTERNALTYPE) ( t * (double) RESOLUTION)); }
- ATTR_HOT static inline const netlist_time from_raw(const INTERNALTYPE raw) { return netlist_time(raw); }
+ static const netlist_time zero;
- static const netlist_time zero;
+ protected:
-protected:
+ ATTR_HOT /* inline */ netlist_time(const INTERNALTYPE val) : m_time(val) {}
- ATTR_HOT inline netlist_time(const INTERNALTYPE val) : m_time(val) {}
+ private:
+ INTERNALTYPE m_time;
+ };
-private:
- INTERNALTYPE m_time;
-};
+ #undef RESOLUTION
-template<> ATTR_COLD inline void pstate_manager_t::save_item(netlist_time &nlt, const void *owner, const pstring &stname)
-{
- save_state_ptr(stname, DT_INT64, owner, sizeof(netlist_time::INTERNALTYPE), 1, nlt.get_internaltype_ptr(), false);
-}
+ ATTR_HOT inline const netlist_time operator-(const netlist_time &left, const netlist_time &right)
+ {
+ return netlist_time::from_raw(left.m_time - right.m_time);
+ }
-ATTR_HOT inline const netlist_time operator-(const netlist_time &left, const netlist_time &right)
-{
- return netlist_time::from_raw(left.m_time - right.m_time);
-}
+ ATTR_HOT inline const netlist_time operator*(const netlist_time &left, const UINT32 factor)
+ {
+ return netlist_time::from_raw(left.m_time * factor);
+ }
-ATTR_HOT inline const netlist_time operator*(const netlist_time &left, const UINT32 factor)
-{
- return netlist_time::from_raw(left.m_time * factor);
-}
+ ATTR_HOT inline UINT32 operator/(const netlist_time &left, const netlist_time &right)
+ {
+ return left.m_time / right.m_time;
+ }
-ATTR_HOT inline UINT32 operator/(const netlist_time &left, const netlist_time &right)
-{
- return left.m_time / right.m_time;
-}
+ ATTR_HOT inline const netlist_time operator+(const netlist_time &left, const netlist_time &right)
+ {
+ return netlist_time::from_raw(left.m_time + right.m_time);
+ }
-ATTR_HOT inline const netlist_time operator+(const netlist_time &left, const netlist_time &right)
-{
- return netlist_time::from_raw(left.m_time + right.m_time);
-}
+ ATTR_HOT inline bool operator<(const netlist_time &left, const netlist_time &right)
+ {
+ return (left.m_time < right.m_time);
+ }
-ATTR_HOT inline bool operator<(const netlist_time &left, const netlist_time &right)
-{
- return (left.m_time < right.m_time);
-}
+ ATTR_HOT inline bool operator>(const netlist_time &left, const netlist_time &right)
+ {
+ return (left.m_time > right.m_time);
+ }
-ATTR_HOT inline bool operator>(const netlist_time &left, const netlist_time &right)
-{
- return (left.m_time > right.m_time);
-}
+ ATTR_HOT inline bool operator<=(const netlist_time &left, const netlist_time &right)
+ {
+ return (left.m_time <= right.m_time);
+ }
-ATTR_HOT inline bool operator<=(const netlist_time &left, const netlist_time &right)
-{
- return (left.m_time <= right.m_time);
-}
+ ATTR_HOT inline bool operator>=(const netlist_time &left, const netlist_time &right)
+ {
+ return (left.m_time >= right.m_time);
+ }
+
+ ATTR_HOT inline bool operator!=(const netlist_time &left, const netlist_time &right)
+ {
+ return (left.m_time != right.m_time);
+ }
-ATTR_HOT inline bool operator>=(const netlist_time &left, const netlist_time &right)
-{
- return (left.m_time >= right.m_time);
}
-ATTR_HOT inline bool operator!=(const netlist_time &left, const netlist_time &right)
+template<> ATTR_COLD inline void pstate_manager_t::save_item(netlist::netlist_time &nlt, const void *owner, const pstring &stname)
{
- return (left.m_time != right.m_time);
+ save_state_ptr(stname, DT_INT64, owner, sizeof(netlist::netlist_time::INTERNALTYPE), 1, nlt.get_internaltype_ptr(), false);
}
+
#endif /* NLTIME_H_ */
diff --git a/src/emu/netlist/nl_util.h b/src/emu/netlist/nl_util.h
index 09a06ce976a..bb5a564dd74 100644
--- a/src/emu/netlist/nl_util.h
+++ b/src/emu/netlist/nl_util.h
@@ -10,6 +10,7 @@
#include <cmath>
#include <cstring>
+#include <cstdlib>
#include "plib/pstring.h"
#include "plib/plists.h"
@@ -60,17 +61,22 @@ public:
#if 0
inline static double fastexp_h(const double x)
{
- static const double ln2r = 1.442695040888963387;
- static const double ln2 = 0.693147180559945286;
- static const double c3 = 0.166666666666666667;
+ /* static */ const double ln2r = 1.442695040888963387;
+ /* static */ const double ln2 = 0.693147180559945286;
+ /* static */ const double c3 = 0.166666666666666667;
+ /* static */ const double c4 = 1.0 / 24.0;
+ /* static */ const double c5 = 1.0 / 120.0;
const double y = x * ln2r;
- const unsigned int t = y;
+ const UINT32 t = y;
const double z = (x - ln2 * (double) t);
- const double zz = z * z;
- const double zzz = zz * z;
+ const double e = (1.0 + z * (1.0 + z * (0.5 + z * (c3 + z * (c4 + c5*z)))));
- return (double)(1 << t)*(1.0 + z + 0.5 * zz + c3 * zzz);
+ if (t < 63)
+ //return (double)((UINT64) 1 << t)*(1.0 + z + 0.5 * zz + c3 * zzz+c4*zzzz+c5*zzzzz);
+ return (double)((UINT64) 1 << t) * e;
+ else
+ return pow(2.0, t)*e;
}
ATTR_HOT inline static double exp(const double x)
diff --git a/src/emu/netlist/plib/palloc.c b/src/emu/netlist/plib/palloc.c
index 5f9dbc5fee7..2ed54bd0b35 100644
--- a/src/emu/netlist/plib/palloc.c
+++ b/src/emu/netlist/plib/palloc.c
@@ -6,11 +6,35 @@
*/
#include "pconfig.h"
+#include "palloc.h"
#if (PSTANDALONE)
#include <stdlib.h>
#include <xmmintrin.h>
+class pmemory_pool
+{
+public:
+ pmemory_pool() {}
+};
+
+static pmemory_pool sppool;
+
+pmemory_pool *ppool = &sppool;
+
+void* operator new(std::size_t size, pmemory_pool *pool) throw (std::bad_alloc)
+{
+ //printf("here new\n");
+ return palloc_raw(size);;
+}
+
+void operator delete(void *ptr, pmemory_pool *pool)
+{
+ //printf("here delete\n");
+ if (ptr != NULL)
+ pfree_raw(ptr);
+}
+
void *palloc_raw(const size_t size)
{
return _mm_malloc(size, 64);
diff --git a/src/emu/netlist/plib/palloc.h b/src/emu/netlist/plib/palloc.h
index e78bbc6e3ab..c80265c8105 100644
--- a/src/emu/netlist/plib/palloc.h
+++ b/src/emu/netlist/plib/palloc.h
@@ -8,6 +8,8 @@
#ifndef PALLOC_H_
#define PALLOC_H_
+#include <cstdio>
+
#include "pconfig.h"
//============================================================
@@ -28,77 +30,71 @@
#define ATTR_ALIGN
#endif
+class pmemory_pool;
+
+extern pmemory_pool *ppool;
void *palloc_raw(const size_t size);
void pfree_raw(void *p);
-template<typename T>
-inline T *palloc_t()
-{
- void *p = palloc_raw(sizeof(T));
- return new (p) T();
-}
+void* operator new(std::size_t size, pmemory_pool *pool) throw (std::bad_alloc);
-template<typename T, typename P1>
-inline T *palloc_t(P1 &p1)
-{
- void *p = palloc_raw(sizeof(T));
- return new (p) T(p1);
-}
-
-template<typename T, typename P1, typename P2>
-inline T *palloc_t(P1 &p1, P2 &p2)
-{
- void *p = palloc_raw(sizeof(T));
- return new (p) T(p1, p2);
-}
-
-template<typename T, typename P1, typename P2, typename P3>
-inline T *palloc_t(P1 &p1, P2 &p2, P3 &p3)
-{
- void *p = palloc_raw(sizeof(T));
- return new (p) T(p1, p2, p3);
-}
-
-template<typename T, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7>
-inline T *palloc_t(P1 &p1, P2 &p2, P3 &p3, P4 &p4, P5 &p5, P6 &p6, P7 &p7)
-{
- void *p = palloc_raw(sizeof(T));
- return new (p) T(p1, p2, p3, p4, p5, p6, p7);
-}
+void operator delete(void *ptr, pmemory_pool *pool);
template<typename T>
inline void pfree_t(T *p)
{
p->~T();
pfree_raw(p);
- //delete p;
}
template <typename T>
inline T *palloc_array_t(size_t N)
{
- return new T[N];
+ //printf("here palloc_array %d\n", (unsigned) N);
+ char *buf = reinterpret_cast<char *>(palloc_raw(N * sizeof(T) + 64*2));
+ size_t *s = reinterpret_cast<size_t *>(buf);
+ *s = N;
+ buf += 64;
+ T *p = reinterpret_cast<T *>(buf);
+ for (size_t i = 0; i < N; i++)
+ new(reinterpret_cast<void *>(&p[i])) T();
+ return p;
}
template <typename T>
inline void pfree_array_t(T *p)
{
- delete[] p;
+ char *buf = reinterpret_cast<char *>(p);
+ buf -= 64;
+ size_t *s = reinterpret_cast<size_t *>(buf);
+ size_t N = *s;
+ //printf("here pfree_array %d\n", (unsigned) N);
+ while (N > 0)
+ {
+ p->~T();
+ p++;
+ N--;
+ }
+ pfree_raw(s);
}
-#define palloc(T, ...) palloc_t<T>(__VA_ARGS__)
+#define palloc(T) new(ppool) T
#define pfree(_ptr) pfree_t(_ptr)
+#if 1
#define palloc_array(T, N) palloc_array_t<T>(N)
#define pfree_array(_ptr) pfree_array_t(_ptr)
-
#else
+#define palloc_array(T, N) new T[N]
+#define pfree_array(_ptr) delete[] _ptr
+#endif
+#else
+#include "corealloc.h"
#define ATTR_ALIGN
-#include "corealloc.h"
-#define palloc(T, ...) global_alloc(T(__VA_ARGS__))
+#define palloc(T) global_alloc(T)
#define pfree(_ptr) global_free(_ptr)
#define palloc_array(T, N) global_alloc_array(T, N)
diff --git a/src/emu/netlist/plib/pconfig.h b/src/emu/netlist/plib/pconfig.h
index 6c00cdd3411..b39701c90e9 100644
--- a/src/emu/netlist/plib/pconfig.h
+++ b/src/emu/netlist/plib/pconfig.h
@@ -12,23 +12,77 @@
#define PSTANDALONE (0)
#endif
+#if !(PSTANDALONE)
+#include "osdcore.h"
+#include "eminline.h"
+
+#ifndef assert
+#define assert(x) do {} while (0)
+#endif
+
+#include "delegate.h"
+
+#else
+#include <stdint.h>
+#endif
+#include <cstddef>
+
+
//============================================================
-// Compiling standalone
+// Standard defines
//============================================================
-// Compiling without mame ?
+// prevent implicit copying
+#define P_PREVENT_COPYING(_name) \
+ private: \
+ _name(const _name &); \
+ _name &operator=(const _name &);
-#include <algorithm>
-#include <cstdarg>
+
+//============================================================
+// Compiling standalone
+//============================================================
#if !(PSTANDALONE)
-#include "osdcore.h"
#undef ATTR_COLD
#define ATTR_COLD
+static inline std::size_t SIZET_PRINTF(const std::size_t &v)
+{
+ return (unsigned) v;
+}
+
+/* use MAME */
+#if (USE_DELEGATE_TYPE == DELEGATE_TYPE_INTERNAL)
+#define PHAS_PMF_INTERNAL 1
#else
-#include <stdint.h>
+#define PHAS_PMF_INTERNAL 0
+#endif
+
+#else
+
+/* determine PMF approach */
+
+#if defined(__GNUC__)
+ /* does not work in versions over 4.7.x of 32bit MINGW */
+ #if defined(__MINGW32__) && !defined(__x86_64) && defined(__i386__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)))
+ #define PHAS_PMF_INTERNAL 1
+ #define MEMBER_ABI __thiscall
+ #elif defined(EMSCRIPTEN)
+ #define PHAS_PMF_INTERNAL 0
+ #elif defined(__arm__) || defined(__ARMEL__)
+ #define PHAS_PMF_INTERNAL 0
+ #else
+ #define PHAS_PMF_INTERNAL 1
+ #endif
+#else
+#define USE_DELEGATE_TYPE PHAS_PMF_INTERNAL 0
+#endif
+
+#ifndef MEMBER_ABI
+ #define MEMBER_ABI
+#endif
/* not supported in GCC prior to 4.4.x */
/* ATTR_HOT and ATTR_COLD cause performance degration in 5.1 */
@@ -85,15 +139,87 @@ typedef int64_t INT64;
#endif
#if defined(_MSC_VER) || defined(__MINGW32__)
-#ifdef PTR64
+#if (PTR64)
#define SIZETFMT "I64u"
#else
#define SIZETFMT "u"
#endif
#else
-#define SIZETFMT "zu"
+//#define SIZETFMT "zu"
+#if (PTR64)
+#define SIZETFMT "lu"
+#else
+#define SIZETFMT "u"
+#endif
#endif
+static inline std::size_t SIZET_PRINTF(const std::size_t &v)
+{
+ return (unsigned) v;
+}
+
+#endif
+
+/*
+ * The following class was derived from the MAME delegate.h code.
+ * It derives a pointer to a member function.
+ */
+
+#if (PHAS_PMF_INTERNAL)
+class pmfp
+{
+public:
+ // construct from any member function pointer
+ class generic_class;
+ typedef void (*generic_function)();
+
+ #if (PSTANDALONE)
+ typedef std::size_t FPTR;
+ #endif
+
+ template<typename _MemberFunctionType>
+ pmfp(_MemberFunctionType mfp)
+ : m_function(0), m_this_delta(0)
+ {
+ *reinterpret_cast<_MemberFunctionType *>(this) = mfp;
+ }
+
+ // binding helper
+ template<typename _FunctionType, typename _ObjectType>
+ _FunctionType update_after_bind(_ObjectType *object)
+ {
+ return reinterpret_cast<_FunctionType>(
+ convert_to_generic(reinterpret_cast<generic_class *>(object)));
+ }
+ template<typename _FunctionType, typename _MemberFunctionType, typename _ObjectType>
+ static _FunctionType get_mfp(_MemberFunctionType mfp, _ObjectType *object)
+ {
+ pmfp mfpo(mfp);
+ return mfpo.update_after_bind<_FunctionType>(object);
+ }
+
+private:
+ // extract the generic function and adjust the object pointer
+ generic_function convert_to_generic(generic_class * object) const
+ {
+ // apply the "this" delta to the object first
+ generic_class * o_p_delta = reinterpret_cast<generic_class *>(reinterpret_cast<UINT8 *>(object) + m_this_delta);
+
+ // if the low bit of the vtable index is clear, then it is just a raw function pointer
+ if (!(m_function & 1))
+ return reinterpret_cast<generic_function>(m_function);
+
+ // otherwise, it is the byte index into the vtable where the actual function lives
+ UINT8 *vtable_base = *reinterpret_cast<UINT8 **>(o_p_delta);
+ return *reinterpret_cast<generic_function *>(vtable_base + m_function - 1);
+ }
+
+ // actual state
+ FPTR m_function; // first item can be one of two things:
+ // if even, it's a pointer to the function
+ // if odd, it's the byte offset into the vtable
+ int m_this_delta; // delta to apply to the 'this' pointer
+};
#endif
#endif /* PCONFIG_H_ */
diff --git a/src/emu/netlist/plib/plists.h b/src/emu/netlist/plib/plists.h
index 032f123aab1..ab8ebf414c7 100644
--- a/src/emu/netlist/plib/plists.h
+++ b/src/emu/netlist/plib/plists.h
@@ -11,6 +11,8 @@
#define PLISTS_H_
#include <cstring>
+#include <algorithm>
+#include <cmath>
#include "palloc.h"
#include "pstring.h"
@@ -58,12 +60,17 @@ public:
* array works around this.
*/
- ATTR_HOT /* inline */ _ListClass *data() { return m_list; }
+ ATTR_HOT _ListClass *data() { return m_list; }
- ATTR_HOT /* inline */ _ListClass& operator[](std::size_t index) { return m_list[index]; }
- ATTR_HOT /* inline */ const _ListClass& operator[](std::size_t index) const { return m_list[index]; }
+ ATTR_HOT _ListClass& operator[](std::size_t index) { return m_list[index]; }
+ ATTR_HOT const _ListClass& operator[](std::size_t index) const { return m_list[index]; }
- ATTR_HOT /* inline */ std::size_t size() const { return m_capacity; }
+ ATTR_HOT std::size_t size() const { return m_capacity; }
+
+ void resize(const std::size_t new_size)
+ {
+ set_capacity(new_size);
+ }
protected:
ATTR_COLD void set_capacity(const std::size_t new_capacity)
@@ -96,7 +103,7 @@ public:
plist_t() : std::vector<_ListClass>() {}
plist_t(const int numElements) : std::vector<_ListClass>(numElements) {}
- /* inline */ void add(const _ListClass &elem) { this->push_back(elem); }
+ void add(const _ListClass &elem) { this->push_back(elem); }
void clear_and_free()
{
for (_ListClass *i = this->data(); i < this->data() + this->size(); i++)
@@ -105,7 +112,7 @@ public:
}
this->clear();
}
- /* inline */ bool contains(const _ListClass &elem) const
+ bool contains(const _ListClass &elem) const
{
for (const _ListClass *i = this->data(); i < this->data() + this->size(); i++)
{
@@ -115,7 +122,7 @@ public:
return false;
}
- /* inline */ void remove(const _ListClass &elem)
+ void remove(const _ListClass &elem)
{
for (int i = 0; i < this->size(); i++)
{
@@ -126,12 +133,12 @@ public:
}
}
}
- /* inline */ void remove_at(const int pos)
+ void remove_at(const int pos)
{
this->erase(this->begin() + pos);
}
- /* inline */ int indexof(const _ListClass &elem) const
+ int indexof(const _ListClass &elem) const
{
for (int i = 0; i < this->size(); i++)
{
@@ -141,7 +148,7 @@ public:
return -1;
}
- ATTR_HOT /* inline */ void swap(const int pos1, const int pos2)
+ ATTR_HOT void swap(const int pos1, const int pos2)
{
//nl_assert((pos1>=0) && (pos1<m_count));
//nl_assert((pos2>=0) && (pos2<m_count));
@@ -200,12 +207,12 @@ public:
m_list = NULL;
}
- ATTR_HOT /* inline */ _ListClass *data() { return m_list; }
+ ATTR_HOT _ListClass *data() { return m_list; }
- ATTR_HOT /* inline */ _ListClass& operator[](std::size_t index) { return *(m_list + index); }
- ATTR_HOT /* inline */ const _ListClass& operator[](std::size_t index) const { return *(m_list + index); }
+ ATTR_HOT _ListClass& operator[](std::size_t index) { return *(m_list + index); }
+ ATTR_HOT const _ListClass& operator[](std::size_t index) const { return *(m_list + index); }
- ATTR_HOT /* inline */ void add(const _ListClass &elem)
+ ATTR_HOT void add(const _ListClass &elem)
{
if (m_count >= m_capacity){
std::size_t new_size = m_capacity * 2;
@@ -217,7 +224,21 @@ public:
m_list[m_count++] = elem;
}
- ATTR_HOT /* inline */ void remove(const _ListClass &elem)
+ ATTR_HOT void insert_at(const _ListClass &elem, const std::size_t index)
+ {
+ if (m_count >= m_capacity){
+ std::size_t new_size = m_capacity * 2;
+ if (new_size < 32)
+ new_size = 32;
+ set_capacity(new_size);
+ }
+ for (std::size_t i = m_count; i>index; i--)
+ m_list[i] = m_list[i-1];
+ m_list[index] = elem;
+ m_count++;
+ }
+
+ ATTR_HOT void remove(const _ListClass &elem)
{
for (std::size_t i = 0; i < m_count; i++)
{
@@ -234,7 +255,7 @@ public:
}
}
- ATTR_HOT /* inline */ void remove_at(const std::size_t pos)
+ ATTR_HOT void remove_at(const std::size_t pos)
{
//nl_assert((pos>=0) && (pos<m_count));
m_count--;
@@ -244,7 +265,7 @@ public:
}
}
- ATTR_HOT /* inline */ void swap(const std::size_t pos1, const std::size_t pos2)
+ ATTR_HOT void swap(const std::size_t pos1, const std::size_t pos2)
{
//nl_assert((pos1>=0) && (pos1<m_count));
//nl_assert((pos2>=0) && (pos2<m_count));
@@ -253,7 +274,7 @@ public:
m_list[pos2] =tmp;
}
- ATTR_HOT /* inline */ bool contains(const _ListClass &elem) const
+ ATTR_HOT bool contains(const _ListClass &elem) const
{
for (_ListClass *i = m_list; i < m_list + m_count; i++)
{
@@ -263,7 +284,7 @@ public:
return false;
}
- ATTR_HOT /* inline */ int indexof(const _ListClass &elem) const
+ ATTR_HOT int indexof(const _ListClass &elem) const
{
for (std::size_t i = 0; i < m_count; i++)
{
@@ -273,10 +294,10 @@ public:
return -1;
}
- ATTR_HOT /* inline */ std::size_t size() const { return m_count; }
- ATTR_HOT /* inline */ bool is_empty() const { return (m_count == 0); }
- ATTR_HOT /* inline */ void clear() { m_count = 0; }
- ATTR_HOT /* inline */ std::size_t capacity() const { return m_capacity; }
+ ATTR_HOT std::size_t size() const { return m_count; }
+ ATTR_HOT bool is_empty() const { return (m_count == 0); }
+ ATTR_HOT void clear() { m_count = 0; }
+ ATTR_HOT std::size_t capacity() const { return m_capacity; }
ATTR_COLD void clear_and_free()
{
@@ -298,10 +319,12 @@ private:
if (cnt > new_capacity)
cnt = new_capacity;
- for (_ListClass *ps = m_list; ps < m_list + cnt; ps++, pd++)
- *pd = *ps;
if (m_list != NULL)
+ {
+ for (_ListClass *ps = m_list; ps < m_list + cnt; ps++, pd++)
+ *pd = *ps;
this->dealloc(m_list);
+ }
m_list = m_new;
m_count = cnt;
}
@@ -347,6 +370,14 @@ public:
return _ListClass(NULL);
}
+ int index_by_name(const pstring &name) const
+ {
+ for (std::size_t i=0; i < this->size(); i++)
+ if (get_name((*this)[i]) == name)
+ return (int) i;
+ return -1;
+ }
+
void remove_by_name(const pstring &name)
{
plist_t<_ListClass>::remove(find_by_name(name));
@@ -366,9 +397,9 @@ public:
}
private:
- template <typename T> static const pstring get_name(const T *elem) { return elem->name(); }
- template <typename T> static const pstring get_name(T *elem) { return elem->name(); }
- template <typename T> static const pstring get_name(const T &elem) { return elem.name(); }
+ template <typename T> const pstring &get_name(const T *elem) const { return elem->name(); }
+ template <typename T> const pstring &get_name(T *elem) const { return elem->name(); }
+ template <typename T> const pstring &get_name(const T &elem) const { return elem.name(); }
};
@@ -403,27 +434,27 @@ public:
{
}
- ATTR_HOT /* inline */ void push(const _StackClass &elem)
+ ATTR_HOT void push(const _StackClass &elem)
{
m_list.add(elem);
}
- ATTR_HOT /* inline */ _StackClass peek() const
+ ATTR_HOT _StackClass peek() const
{
return m_list[m_list.size() - 1];
}
- ATTR_HOT /* inline */ _StackClass pop()
+ ATTR_HOT _StackClass pop()
{
_StackClass ret = peek();
m_list.remove_at(m_list.size() - 1);
return ret;
}
- ATTR_HOT /* inline */ int count() const { return m_list.size(); }
- ATTR_HOT /* inline */ bool empty() const { return (m_list.size() == 0); }
- ATTR_HOT /* inline */ void reset() { m_list.reset(); }
- ATTR_HOT /* inline */ int capacity() const { return m_list.capacity(); }
+ ATTR_HOT int count() const { return m_list.size(); }
+ ATTR_HOT bool empty() const { return (m_list.size() == 0); }
+ ATTR_HOT void reset() { m_list.reset(); }
+ ATTR_HOT int capacity() const { return m_list.capacity(); }
private:
plist_t<_StackClass> m_list;
@@ -448,7 +479,7 @@ public:
plinkedlist_t() : m_head(NULL) {}
- ATTR_HOT /* inline */ void insert(const _ListClass &before, _ListClass &elem)
+ ATTR_HOT void insert(const _ListClass &before, _ListClass &elem)
{
if (m_head == &before)
{
@@ -473,13 +504,13 @@ public:
}
}
- ATTR_HOT /* inline */ void insert(_ListClass &elem)
+ ATTR_HOT void insert(_ListClass &elem)
{
elem.m_next = m_head;
m_head = &elem;
}
- ATTR_HOT /* inline */ void add(_ListClass &elem)
+ ATTR_HOT void add(_ListClass &elem)
{
_ListClass **p = &m_head;
while (*p != NULL)
@@ -490,7 +521,7 @@ public:
elem.m_next = NULL;
}
- ATTR_HOT /* inline */ void remove(const _ListClass &elem)
+ ATTR_HOT void remove(const _ListClass &elem)
{
_ListClass **p = &m_head;
while (*p != &elem)
@@ -502,11 +533,11 @@ public:
}
- ATTR_HOT static /* inline */ _ListClass *next(const _ListClass &elem) { return elem.m_next; }
- ATTR_HOT static /* inline */ _ListClass *next(const _ListClass *elem) { return elem->m_next; }
- ATTR_HOT /* inline */ _ListClass *first() const { return m_head; }
- ATTR_HOT /* inline */ void clear() { m_head = NULL; }
- ATTR_HOT /* inline */ bool is_empty() const { return (m_head == NULL); }
+ ATTR_HOT static _ListClass *next(const _ListClass &elem) { return elem.m_next; }
+ ATTR_HOT static _ListClass *next(const _ListClass *elem) { return elem->m_next; }
+ ATTR_HOT _ListClass *first() const { return m_head; }
+ ATTR_HOT void clear() { m_head = NULL; }
+ ATTR_HOT bool is_empty() const { return (m_head == NULL); }
private:
_ListClass *m_head;
@@ -524,7 +555,6 @@ public:
pstring_list_t(const pstring &str, const pstring &onstr, bool ignore_empty = false)
: plist_t<pstring>()
{
-
int p = 0;
int pn;
@@ -582,4 +612,234 @@ public:
}
};
+// ----------------------------------------------------------------------------------------
+// hashmap list
+// ----------------------------------------------------------------------------------------
+
+
+template <class C>
+struct phash_functor
+{
+ unsigned hash(const C &v) const { return (unsigned) v; }
+};
+
+template <>
+struct phash_functor<pstring>
+{
+#if 1
+#if 1
+ unsigned hash(const pstring &v) const
+ {
+ const char *string = v.cstr();
+ unsigned result = *string++;
+ for (UINT8 c = *string++; c != 0; c = *string++)
+ result = (result*33) ^ c;
+ return result;
+ }
+#else
+ unsigned hash(const pstring &v) const
+ {
+ /* Fowler–Noll–Vo hash - FNV-1 */
+ const char *string = v.cstr();
+ unsigned result = 2166136261;
+ for (UINT8 c = *string++; c != 0; c = *string++)
+ result = (result * 16777619) ^ c;
+ // result = (result ^ c) * 16777619; FNV 1a
+ return result;
+ }
+#endif
+#else
+ unsigned hash(const pstring &v) const
+ {
+ /* jenkins one at a time algo */
+ unsigned result = 0;
+ const char *string = v.cstr();
+ while (*string)
+ {
+ result += *string;
+ string++;
+ result += (result << 10);
+ result ^= (result >> 6);
+ }
+ result += (result << 3);
+ result ^= (result >> 11);
+ result += (result << 15);
+ return result;
+ }
+#endif
+};
+
+template <class K, class V, class H = phash_functor<K> >
+class phashmap_t
+{
+public:
+ phashmap_t() : m_hash(17)
+ {
+ for (unsigned i=0; i<m_hash.size(); i++)
+ m_hash[i] = -1;
+ }
+
+ ~phashmap_t()
+ {
+ }
+
+ struct element_t
+ {
+ element_t() { }
+ element_t(K key, unsigned hash, V value)
+ : m_key(key), m_hash(hash), m_value(value), m_next(-1)
+ {}
+ K m_key;
+ unsigned m_hash;
+ V m_value;
+ int m_next;
+ };
+
+ void clear()
+ {
+ if (0)
+ {
+ unsigned cnt = 0;
+ for (unsigned i=0; i<m_hash.size(); i++)
+ if (m_hash[i] >= 0)
+ cnt++;
+ const unsigned s = m_values.size();
+ if (s>0)
+ printf("phashmap: %d elements %d hashsize, percent in overflow: %d\n", s, (unsigned) m_hash.size(), (s - cnt) * 100 / s);
+ else
+ printf("phashmap: No elements .. \n");
+ }
+ m_values.clear();
+ for (unsigned i=0; i<m_hash.size(); i++)
+ m_hash[i] = -1;
+ }
+
+ bool contains(const K &key) const
+ {
+ return (get_idx(key) >= 0);
+ }
+
+ int index_of(const K &key) const
+ {
+ return get_idx(key);
+ }
+
+ unsigned size() const { return m_values.size(); }
+
+ bool add(const K &key, const V &value)
+ {
+ /*
+ * we are using the Euler prime function here
+ *
+ * n * n + n + 41 | 40 >= n >=0
+ *
+ * and accept that outside we will not have a prime
+ *
+ */
+ if (m_values.size() > m_hash.size())
+ {
+ unsigned n = std::sqrt( 2 * m_hash.size());
+ n = n * n + n + 41;
+ m_hash.resize(n);
+ rebuild();
+ }
+ const H h;
+ const unsigned hash=h.hash(key);
+ const unsigned pos = hash % m_hash.size();
+ if (m_hash[pos] == -1)
+ {
+ unsigned vpos = m_values.size();
+ m_values.add(element_t(key, hash, value));
+ m_hash[pos] = vpos;
+ }
+ else
+ {
+ int ep = m_hash[pos];
+
+ for (; ep != -1; ep = m_values[ep].m_next)
+ {
+ if (m_values[ep].m_hash == hash && m_values[ep].m_key == key )
+ return false; /* duplicate */
+ }
+ unsigned vpos = m_values.size();
+ m_values.add(element_t(key, hash, value));
+ m_values[vpos].m_next = m_hash[pos];
+ m_hash[pos] = vpos;
+ }
+ return true;
+ }
+
+ V& operator[](const K &key)
+ {
+ int p = get_idx(key);
+ if (p == -1)
+ {
+ p = m_values.size();
+ add(key, V());
+ }
+ return m_values[p].m_value;
+ }
+
+ const V& operator[](const K &key) const
+ {
+ int p = get_idx(key);
+ if (p == -1)
+ {
+ p = m_values.size();
+ add(key, V());
+ }
+ return m_values[p].m_value;
+ }
+
+ V& value_at(const unsigned pos) { return m_values[pos].m_value; }
+ const V& value_at(const unsigned pos) const { return m_values[pos].m_value; }
+
+ V& key_at(const unsigned pos) const { return m_values[pos].m_key; }
+private:
+
+ int get_idx(const K &key) const
+ {
+ H h;
+ const unsigned hash=h.hash(key);
+ const unsigned pos = hash % m_hash.size();
+
+ for (int ep = m_hash[pos]; ep != -1; ep = m_values[ep].m_next)
+ if (m_values[ep].m_hash == hash && m_values[ep].m_key == key )
+ return ep;
+ return -1;
+ }
+
+ void rebuild()
+ {
+ for (unsigned i=0; i<m_hash.size(); i++)
+ m_hash[i] = -1;
+ for (unsigned i=0; i<m_values.size(); i++)
+ {
+ unsigned pos = m_values[i].m_hash % m_hash.size();
+ m_values[i].m_next = m_hash[pos];
+ m_hash[pos] = i;
+ }
+
+ }
+ plist_t<element_t> m_values;
+ parray_t<int> m_hash;
+};
+
+// ----------------------------------------------------------------------------------------
+// sort a list ... slow, I am lazy
+// elements must support ">" operator.
+// ----------------------------------------------------------------------------------------
+
+template<typename Class>
+static inline void psort_list(Class &sl)
+{
+ for(unsigned i = 0; i < sl.size(); i++)
+ {
+ for(unsigned j = i + 1; j < sl.size(); j++)
+ if(sl[i] > sl[j])
+ std::swap(sl[i], sl[j]);
+
+ }
+}
+
#endif /* PLISTS_H_ */
diff --git a/src/emu/netlist/plib/pparser.c b/src/emu/netlist/plib/pparser.c
index 95b9260c7cd..954b9048810 100644
--- a/src/emu/netlist/plib/pparser.c
+++ b/src/emu/netlist/plib/pparser.c
@@ -6,6 +6,7 @@
*/
#include <cstdio>
+#include <cstdarg>
#include "pparser.h"
@@ -96,6 +97,16 @@ pstring ptokenizer::get_identifier()
return tok.str();
}
+pstring ptokenizer::get_identifier_or_number()
+{
+ token_t tok = get_token();
+ if (!(tok.is_type(IDENTIFIER) || tok.is_type(NUMBER)))
+ {
+ error("Error: expected an identifier, got <%s>\n", tok.str().cstr());
+ }
+ return tok.str();
+}
+
double ptokenizer::get_number_double()
{
token_t tok = get_token();
@@ -256,6 +267,7 @@ ATTR_COLD void ptokenizer::error(const char *format, ...)
ppreprocessor::ppreprocessor()
{
+ m_expr_sep.add("!");
m_expr_sep.add("(");
m_expr_sep.add(")");
m_expr_sep.add("+");
@@ -283,11 +295,20 @@ double ppreprocessor::expr(const pstring_list_t &sexpr, std::size_t &start, int
if (tok == "(")
{
start++;
- val = expr(sexpr, start, prio);
+ val = expr(sexpr, start, /*prio*/ 0);
if (sexpr[start] != ")")
error("parsing error!");
start++;
}
+ else if (tok == "!")
+ {
+ start++;
+ val = expr(sexpr, start, 90);
+ if (val != 0)
+ val = 0;
+ else
+ val = 1;
+ }
else
{
tok=sexpr[start];
@@ -442,7 +463,7 @@ pstring ppreprocessor::process(const pstring &contents)
}
}
else
- error(pstring::sprintf("unknown directive on line %" SIZETFMT ": %s\n", i, line.cstr()));
+ error(pstring::sprintf("unknown directive on line %" SIZETFMT ": %s\n", SIZET_PRINTF(i), line.cstr()));
}
else
{
diff --git a/src/emu/netlist/plib/pparser.h b/src/emu/netlist/plib/pparser.h
index 4a3305094aa..15d81294a09 100644
--- a/src/emu/netlist/plib/pparser.h
+++ b/src/emu/netlist/plib/pparser.h
@@ -9,12 +9,12 @@
#define PPARSER_H_
#include "pconfig.h"
-#include "../nl_config.h" // FIXME
-#include "../nl_util.h"
+#include "pstring.h"
+#include "plists.h"
class ptokenizer
{
- NETLIST_PREVENT_COPYING(ptokenizer)
+ P_PREVENT_COPYING(ptokenizer)
public:
virtual ~ptokenizer() {}
@@ -51,13 +51,13 @@ public:
m_id = token_id_t(-1);
m_token ="";
}
- token_t(token_type type, const pstring str)
+ token_t(token_type type, const pstring &str)
{
m_type = type;
m_id = token_id_t(-1);
m_token = str;
}
- token_t(const token_id_t id, const pstring str)
+ token_t(const token_id_t id, const pstring &str)
{
m_type = TOKEN;
m_id = id;
@@ -86,6 +86,7 @@ public:
token_t get_token();
pstring get_string();
pstring get_identifier();
+ pstring get_identifier_or_number();
double get_number_double();
long get_number_long();
@@ -145,7 +146,7 @@ private:
class ppreprocessor
{
- NETLIST_PREVENT_COPYING(ppreprocessor)
+ P_PREVENT_COPYING(ppreprocessor)
public:
struct define_t
diff --git a/src/emu/netlist/plib/pstate.c b/src/emu/netlist/plib/pstate.c
index 07532032405..909bfcb2e58 100644
--- a/src/emu/netlist/plib/pstate.c
+++ b/src/emu/netlist/plib/pstate.c
@@ -33,7 +33,7 @@ ATTR_COLD void pstate_manager_t::save_state_ptr(const pstring &stname, const pst
"DT_FLOAT"
};
- pstate_entry_t *p = palloc(pstate_entry_t, stname, dt, owner, size, count, ptr, is_ptr);
+ pstate_entry_t *p = palloc(pstate_entry_t(stname, dt, owner, size, count, ptr, is_ptr));
m_save.add(p);
}
@@ -71,7 +71,8 @@ template<> ATTR_COLD void pstate_manager_t::save_item(pstate_callback_t &state,
{
//save_state_ptr(stname, DT_CUSTOM, 0, 1, &state);
pstate_callback_t *state_p = &state;
- pstate_entry_t *p = palloc(pstate_entry_t, stname, owner, state_p);
+ pstate_entry_t *p = palloc(pstate_entry_t(stname, owner, state_p));
m_save.add(p);
state.register_state(*this, stname);
}
+
diff --git a/src/emu/netlist/plib/pstate.h b/src/emu/netlist/plib/pstate.h
index 73b83e65a00..0350b0fe309 100644
--- a/src/emu/netlist/plib/pstate.h
+++ b/src/emu/netlist/plib/pstate.h
@@ -24,9 +24,9 @@
template<typename C> ATTR_COLD void obj::save(C &state, const pstring &stname) \
{ manager->save_item(state, this, module + "." + stname); } \
template<typename C, std::size_t N> ATTR_COLD void obj::save(C (&state)[N], const pstring &stname) \
- { manager->save_state_ptr(module + "." + stname, nl_datatype<C>::type, this, sizeof(state[0]), N, &(state[0]), false); } \
+ { manager->save_state_ptr(module + "." + stname, pstate_datatype<C>::type, this, sizeof(state[0]), N, &(state[0]), false); } \
template<typename C> ATTR_COLD void obj::save(C *state, const pstring &stname, const int count) \
- { manager->save_state_ptr(module + "." + stname, nl_datatype<C>::type, this, sizeof(C), count, state, false); }
+ { manager->save_state_ptr(module + "." + stname, pstate_datatype<C>::type, this, sizeof(C), count, state, false); }
enum pstate_data_type_e {
NOT_SUPPORTED,
@@ -40,13 +40,13 @@ enum pstate_data_type_e {
DT_FLOAT
};
-template<typename _ItemType> struct nl_datatype
+template<typename _ItemType> struct pstate_datatype
{
static const pstate_data_type_e type = pstate_data_type_e(NOT_SUPPORTED);
static const bool is_ptr = false;
};
-template<typename _ItemType> struct nl_datatype<_ItemType *>
+template<typename _ItemType> struct pstate_datatype<_ItemType *>
{
static const pstate_data_type_e type = pstate_data_type_e(NOT_SUPPORTED);
static const bool is_ptr = true;
@@ -55,8 +55,8 @@ template<typename _ItemType> struct nl_datatype<_ItemType *>
//template<typename _ItemType> struct type_checker<_ItemType*> { static const bool is_atom = false; static const bool is_pointer = true; };
#define NETLIST_SAVE_TYPE(TYPE, TYPEDESC) \
- template<> struct nl_datatype<TYPE>{ static const pstate_data_type_e type = pstate_data_type_e(TYPEDESC); static const bool is_ptr = false;}; \
- template<> struct nl_datatype<TYPE *>{ static const pstate_data_type_e type = pstate_data_type_e(TYPEDESC); static const bool is_ptr = true;}
+ template<> struct pstate_datatype<TYPE>{ static const pstate_data_type_e type = pstate_data_type_e(TYPEDESC); static const bool is_ptr = false;}; \
+ template<> struct pstate_datatype<TYPE *>{ static const pstate_data_type_e type = pstate_data_type_e(TYPEDESC); static const bool is_ptr = true;}
NETLIST_SAVE_TYPE(char, DT_INT8);
NETLIST_SAVE_TYPE(double, DT_DOUBLE);
@@ -70,7 +70,7 @@ NETLIST_SAVE_TYPE(UINT32, DT_INT);
NETLIST_SAVE_TYPE(INT32, DT_INT);
NETLIST_SAVE_TYPE(UINT16, DT_INT16);
NETLIST_SAVE_TYPE(INT16, DT_INT16);
-//NETLIST_SAVE_TYPE(netlist_time::INTERNALTYPE, DT_INT64);
+//NETLIST_SAVE_TYPE(std::size_t, DT_INT64);
class pstate_manager_t;
@@ -128,26 +128,25 @@ public:
template<typename C> ATTR_COLD void save_item(C &state, const void *owner, const pstring &stname)
{
- save_state_ptr(stname, nl_datatype<C>::type, owner, sizeof(C), 1, &state, nl_datatype<C>::is_ptr);
+ save_state_ptr(stname, pstate_datatype<C>::type, owner, sizeof(C), 1, &state, pstate_datatype<C>::is_ptr);
}
template<typename C, std::size_t N> ATTR_COLD void save_item(C (&state)[N], const void *owner, const pstring &stname)
{
- save_state_ptr(stname, nl_datatype<C>::type, owner, sizeof(state[0]), N, &(state[0]), false);
+ save_state_ptr(stname, pstate_datatype<C>::type, owner, sizeof(state[0]), N, &(state[0]), false);
}
template<typename C> ATTR_COLD void save_item(C *state, const void *owner, const pstring &stname, const int count)
{
- save_state_ptr(stname, nl_datatype<C>::type, owner, sizeof(C), count, state, false);
+ save_state_ptr(stname, pstate_datatype<C>::type, owner, sizeof(C), count, state, false);
}
ATTR_COLD void pre_save();
ATTR_COLD void post_load();
ATTR_COLD void remove_save_items(const void *owner);
- inline const pstate_entry_t::list_t &save_list() const { return m_save; }
+ const pstate_entry_t::list_t &save_list() const { return m_save; }
- // FIXME: should be protected
ATTR_COLD void save_state_ptr(const pstring &stname, const pstate_data_type_e, const void *owner, const int size, const int count, void *ptr, bool is_ptr);
protected:
diff --git a/src/emu/netlist/plib/pstring.c b/src/emu/netlist/plib/pstring.c
index ec930808e7b..e5f73ffa17b 100644
--- a/src/emu/netlist/plib/pstring.c
+++ b/src/emu/netlist/plib/pstring.c
@@ -5,12 +5,12 @@
*
*/
-#include <new>
#include <cstdio>
#include <cstring>
//FIXME:: pstring should be locale free
#include <cctype>
#include <cstdlib>
+#include <algorithm>
#include "pstring.h"
#include "palloc.h"
@@ -73,7 +73,7 @@ void pstring::pcopy(const char *from, int size)
m_ptr = n;
}
-pstring pstring::substr(unsigned int start, int count) const
+const pstring pstring::substr(unsigned int start, int count) const
{
pstring ret;
unsigned alen = len();
@@ -85,7 +85,7 @@ pstring pstring::substr(unsigned int start, int count) const
return ret;
}
-pstring pstring::ucase() const
+const pstring pstring::ucase() const
{
pstring ret = *this;
ret.pcopy(cstr(), len());
@@ -94,7 +94,7 @@ pstring pstring::ucase() const
return ret;
}
-int pstring::find_first_not_of(const pstring no) const
+int pstring::find_first_not_of(const pstring &no) const
{
for (int i=0; i < len(); i++)
{
@@ -108,7 +108,7 @@ int pstring::find_first_not_of(const pstring no) const
return -1;
}
-int pstring::find_last_not_of(const pstring no) const
+int pstring::find_last_not_of(const pstring &no) const
{
for (int i=len() - 1; i >= 0; i--)
{
@@ -144,7 +144,7 @@ pstring pstring::replace(const pstring &search, const pstring &replace) const
}
return ret;
}
-pstring pstring::ltrim(const pstring ws) const
+const pstring pstring::ltrim(const pstring &ws) const
{
int f = find_first_not_of(ws);
if (f>=0)
@@ -153,7 +153,7 @@ pstring pstring::ltrim(const pstring ws) const
return "";
}
-pstring pstring::rtrim(const pstring ws) const
+const pstring pstring::rtrim(const pstring &ws) const
{
int f = find_last_not_of(ws);
if (f>=0)
@@ -218,7 +218,7 @@ long pstring::as_long(bool *error) const
return ret;
}
-pstring pstring::vprintf(va_list args) const
+const pstring pstring::vprintf(va_list args) const
{
// sprintf into the temporary buffer
char tempbuf[4096];
@@ -259,7 +259,7 @@ void pstring::resetmem()
// pstring ...
// ----------------------------------------------------------------------------------------
-pstring pstring::sprintf(const char *format, ...)
+const pstring pstring::sprintf(const char *format, ...)
{
va_list ap;
va_start(ap, format);
diff --git a/src/emu/netlist/plib/pstring.h b/src/emu/netlist/plib/pstring.h
index 7cfb936472c..88a8922e98b 100644
--- a/src/emu/netlist/plib/pstring.h
+++ b/src/emu/netlist/plib/pstring.h
@@ -7,6 +7,9 @@
#ifndef _PSTRING_H_
#define _PSTRING_H_
+#include <cstdarg>
+#include <cstddef>
+
#include "pconfig.h"
// ----------------------------------------------------------------------------------------
@@ -36,7 +39,7 @@ public:
// C string conversion operators and helpers
operator const char *() const { return m_ptr->str(); }
- inline const char *cstr() const { return m_ptr->str(); }
+ const char *cstr() const { return m_ptr->str(); }
// concatenation operators
pstring& operator+=(const char c) { char buf[2] = { c, 0 }; pcat(buf); return *this; }
@@ -61,13 +64,13 @@ public:
bool operator>=(const char *string) const { return (pcmp(string) >= 0); }
bool operator>=(const pstring &string) const { return (pcmp(string.cstr()) >= 0); }
- inline int len() const { return m_ptr->len(); }
+ int len() const { return m_ptr->len(); }
- inline bool equals(const pstring &string) const { return (pcmp(string.cstr(), m_ptr->str()) == 0); }
- inline bool iequals(const pstring &string) const { return (pcmpi(string.cstr(), m_ptr->str()) == 0); }
+ bool equals(const pstring &string) const { return (pcmp(string.cstr(), m_ptr->str()) == 0); }
+ bool iequals(const pstring &string) const { return (pcmpi(string.cstr(), m_ptr->str()) == 0); }
- inline int cmp(const pstring &string) const { return pcmp(string.cstr()); }
- inline int cmpi(const pstring &string) const { return pcmpi(cstr(), string.cstr()); }
+ int cmp(const pstring &string) const { return pcmp(string.cstr()); }
+ int cmpi(const pstring &string) const { return pcmpi(cstr(), string.cstr()); }
int find(const char *search, int start = 0) const;
@@ -75,28 +78,28 @@ public:
// various
- inline bool startsWith(const pstring &arg) const { return (pcmp(cstr(), arg.cstr(), arg.len()) == 0); }
+ bool startsWith(const pstring &arg) const { return (pcmp(cstr(), arg.cstr(), arg.len()) == 0); }
bool startsWith(const char *arg) const;
pstring replace(const pstring &search, const pstring &replace) const;
// these return nstring ...
- inline pstring cat(const pstring &s) const { return *this + s; }
- inline pstring cat(const char *s) const { return *this + s; }
+ const pstring cat(const pstring &s) const { return *this + s; }
+ const pstring cat(const char *s) const { return *this + s; }
- pstring substr(unsigned int start, int count = -1) const ;
+ const pstring substr(unsigned int start, int count = -1) const ;
- inline pstring left(unsigned int count) const { return substr(0, count); }
- inline pstring right(unsigned int count) const { return substr(len() - count, count); }
+ const pstring left(unsigned int count) const { return substr(0, count); }
+ const pstring right(unsigned int count) const { return substr(len() - count, count); }
- int find_first_not_of(const pstring no) const;
- int find_last_not_of(const pstring no) const;
+ int find_first_not_of(const pstring &no) const;
+ int find_last_not_of(const pstring &no) const;
- pstring ltrim(const pstring ws = " \t\n\r") const;
- pstring rtrim(const pstring ws = " \t\n\r") const;
- inline pstring trim(const pstring ws = " \t\n\r") const { return this->ltrim(ws).rtrim(ws); }
+ const pstring ltrim(const pstring &ws = " \t\n\r") const;
+ const pstring rtrim(const pstring &ws = " \t\n\r") const;
+ const pstring trim(const pstring &ws = " \t\n\r") const { return this->ltrim(ws).rtrim(ws); }
- pstring rpad(const pstring ws, const int cnt) const
+ const pstring rpad(const pstring &ws, const int cnt) const
{
// FIXME: slow!
pstring ret = *this;
@@ -105,7 +108,7 @@ public:
return ret.substr(0, cnt);
}
- pstring ucase() const;
+ const pstring ucase() const;
// conversions
@@ -115,10 +118,10 @@ public:
// printf using string as format ...
- pstring vprintf(va_list args) const;
+ const pstring vprintf(va_list args) const;
// static
- static pstring sprintf(const char *format, ...) ATTR_PRINTF(1,2);
+ static const pstring sprintf(const char *format, ...) ATTR_PRINTF(1,2);
static void resetmem();
protected:
@@ -147,13 +150,13 @@ protected:
str_t *m_ptr;
private:
- inline void init()
+ void init()
{
m_ptr = &m_zero;
m_ptr->m_ref_count++;
}
- inline int pcmp(const char *right) const
+ int pcmp(const char *right) const
{
return pcmp(m_ptr->str(), right);
}
@@ -166,7 +169,7 @@ private:
void pcopy(const char *from);
- inline void pcopy(const pstring &from)
+ void pcopy(const pstring &from)
{
sfree(m_ptr);
m_ptr = from.m_ptr;
@@ -212,7 +215,7 @@ public:
// C string conversion operators and helpers
operator const char *() const { return m_ptr; }
- inline const char *cstr() const { return m_ptr; }
+ const char *cstr() const { return m_ptr; }
operator pstring() const { return pstring(m_ptr); }
@@ -220,10 +223,10 @@ public:
pstringbuffer& operator+=(const char c) { char buf[2] = { c, 0 }; pcat(buf); return *this; }
pstringbuffer& operator+=(const pstring &string) { pcat(string.cstr()); return *this; }
- inline std::size_t len() const { return m_len; }
+ std::size_t len() const { return m_len; }
- inline void cat(const pstring &s) { pcat(s); }
- inline void cat(const char *s) { pcat(s); }
+ void cat(const pstring &s) { pcat(s); }
+ void cat(const char *s) { pcat(s); }
pstring substr(unsigned int start, int count = -1)
{
@@ -232,7 +235,7 @@ public:
private:
- inline void init()
+ void init()
{
m_ptr = NULL;
m_size = 0;
diff --git a/src/emu/netlist/solver/mat_cr.h b/src/emu/netlist/solver/mat_cr.h
new file mode 100644
index 00000000000..708833f2625
--- /dev/null
+++ b/src/emu/netlist/solver/mat_cr.h
@@ -0,0 +1,135 @@
+// license:GPL-2.0+
+// copyright-holders:Couriersud
+/*
+ * mat_cr.h
+ *
+ * Compressed row format matrices
+ *
+ */
+
+#ifndef MAT_CR_H_
+#define MAT_CR_H_
+
+#include <algorithm>
+#include "../plib/pconfig.h"
+
+template<int _storage_N>
+struct mat_cr_t
+{
+ unsigned nz_num;
+ unsigned ia[_storage_N + 1];
+ unsigned ja[_storage_N * _storage_N];
+ unsigned diag[_storage_N]; /* n */
+
+ void mult_vec(const double * RESTRICT A, const double * RESTRICT x, double * RESTRICT res)
+ {
+ /*
+ * res = A * x
+ */
+
+ unsigned i = 0;
+ unsigned k = 0;
+ const unsigned oe = nz_num;
+
+ while (k < oe)
+ {
+ double tmp = 0.0;
+ const unsigned e = ia[i+1];
+ for (; k < e; k++)
+ tmp += A[k] * x[ja[k]];
+ res[i++] = tmp;
+ }
+ }
+
+ void incomplete_LU_factorization(const double * RESTRICT A, double * RESTRICT LU)
+ {
+ /*
+ * incomplete LU Factorization according to http://de.wikipedia.org/wiki/ILU-Zerlegung
+ *
+ * Result is stored in matrix LU
+ *
+ */
+
+ const unsigned lnz = nz_num;
+
+ for (unsigned k = 0; k < lnz; k++)
+ LU[k] = A[k];
+
+ for (unsigned i = 1; ia[i] < lnz; i++) // row i
+ {
+ const unsigned iai1 = ia[i + 1];
+ for (unsigned pk = ia[i]; pk < diag[i]; pk++) // all columns left of diag in row i
+ {
+ // pk == (i, k)
+ const unsigned k = ja[pk];
+ const unsigned iak1 = ia[k + 1];
+ const double LUpk = LU[pk] = LU[pk] / LU[diag[k]];
+
+ unsigned pt = ia[k];
+
+ for (unsigned pj = pk + 1; pj < iai1; pj++) // pj = (i, j)
+ {
+ // we can assume that within a row ja increases continuously */
+ const unsigned ej = ja[pj];
+ while (ja[pt] < ej && pt < iak1)
+ pt++;
+ if (pt < iak1 && ja[pt] == ej)
+ LU[pj] = LU[pj] - LUpk * LU[pt];
+ }
+ }
+ }
+ }
+
+ void solveLUx (const double * RESTRICT LU, double * RESTRICT r)
+ {
+ /*
+ * Solve a linear equation Ax = r
+ * where
+ * A = L*U
+ *
+ * L unit lower triangular
+ * U upper triangular
+ *
+ * ==> LUx = r
+ *
+ * ==> Ux = Lâ»Â¹r = w
+ *
+ * ==> r = Lw
+ *
+ * This can be solved for w using backwards elimination in L.
+ *
+ * Now Ux = w
+ *
+ * This can be solved for x using backwards elimination in U.
+ *
+ */
+
+ unsigned i;
+
+ for (i = 1; ia[i] < nz_num; i++ )
+ {
+ double tmp = 0.0;
+ const unsigned j1 = ia[i];
+ const unsigned j2 = diag[i];
+
+ for (unsigned j = j1; j < j2; j++ )
+ tmp += LU[j] * r[ja[j]];
+
+ r[i] -= tmp;
+ }
+ // i now is equal to n;
+ for (; 0 < i; i-- )
+ {
+ const unsigned im1 = i - 1;
+ double tmp = 0.0;
+ const unsigned j1 = diag[im1] + 1;
+ const unsigned j2 = ia[im1+1];
+ for (unsigned j = j1; j < j2; j++ )
+ tmp += LU[j] * r[ja[j]];
+ r[im1] = (r[im1] - tmp) / LU[diag[im1]];
+ }
+ }
+
+};
+
+#endif /* MAT_CR_H_ */
diff --git a/src/emu/netlist/analog/nld_ms_direct.h b/src/emu/netlist/solver/nld_ms_direct.h
index b5021e1c9f6..f64514a1c7c 100644
--- a/src/emu/netlist/analog/nld_ms_direct.h
+++ b/src/emu/netlist/solver/nld_ms_direct.h
@@ -8,37 +8,45 @@
#ifndef NLD_MS_DIRECT_H_
#define NLD_MS_DIRECT_H_
-#include "nld_solver.h"
+#include <algorithm>
+
+#include "../solver/nld_solver.h"
+
+NETLIB_NAMESPACE_DEVICES_START()
+
+//#define nl_ext_double __float128 // slow, very slow
+//#define nl_ext_double long double // slightly slower
+#define nl_ext_double double
template <unsigned m_N, unsigned _storage_N>
-class netlist_matrix_solver_direct_t: public netlist_matrix_solver_t
+class matrix_solver_direct_t: public matrix_solver_t
{
public:
- netlist_matrix_solver_direct_t(const netlist_solver_parameters_t &params, const int size);
- netlist_matrix_solver_direct_t(const eSolverType type, const netlist_solver_parameters_t &params, const int size);
+ matrix_solver_direct_t(const solver_parameters_t *params, const int size);
+ matrix_solver_direct_t(const eSolverType type, const solver_parameters_t *params, const int size);
- virtual ~netlist_matrix_solver_direct_t();
+ virtual ~matrix_solver_direct_t();
- /* ATTR_COLD */ virtual void vsetup(netlist_analog_net_t::list_t &nets);
- /* ATTR_COLD */ virtual void reset() { netlist_matrix_solver_t::reset(); }
+ virtual void vsetup(analog_net_t::list_t &nets);
+ virtual void reset() { matrix_solver_t::reset(); }
ATTR_HOT inline unsigned N() const { if (m_N == 0) return m_dim; else return m_N; }
ATTR_HOT inline int vsolve_non_dynamic(const bool newton_raphson);
protected:
- /* ATTR_COLD */ virtual void add_term(int net_idx, netlist_terminal_t *term);
+ virtual void add_term(int net_idx, terminal_t *term);
ATTR_HOT virtual nl_double vsolve();
ATTR_HOT int solve_non_dynamic(const bool newton_raphson);
ATTR_HOT void build_LE_A();
- ATTR_HOT void build_LE_RHS();
+ ATTR_HOT void build_LE_RHS(nl_double * RESTRICT rhs);
ATTR_HOT void LE_solve();
ATTR_HOT void LE_back_subst(nl_double * RESTRICT x);
ATTR_HOT nl_double delta(const nl_double * RESTRICT V);
- ATTR_HOT void store(const nl_double * RESTRICT V, const bool store_RHS);
+ ATTR_HOT void store(const nl_double * RESTRICT V);
/* bring the whole system to the current time
* Don't schedule a new calculation time. The recalculation has to be
@@ -46,7 +54,8 @@ protected:
*/
ATTR_HOT nl_double compute_next_timestep();
- ATTR_ALIGN nl_double m_A[_storage_N][((_storage_N + 7) / 8) * 8];
+ ATTR_ALIGN nl_ext_double m_A[_storage_N][((_storage_N + 7) / 8) * 8];
+ //ATTR_ALIGN nl_double m_A[_storage_N][((_storage_N + 7) / 8) * 8];
ATTR_ALIGN nl_double m_RHS[_storage_N];
ATTR_ALIGN nl_double m_last_RHS[_storage_N]; // right hand side - contains currents
ATTR_ALIGN nl_double m_last_V[_storage_N];
@@ -61,11 +70,11 @@ private:
};
// ----------------------------------------------------------------------------------------
-// netlist_matrix_solver_direct
+// matrix_solver_direct
// ----------------------------------------------------------------------------------------
template <unsigned m_N, unsigned _storage_N>
-netlist_matrix_solver_direct_t<m_N, _storage_N>::~netlist_matrix_solver_direct_t()
+matrix_solver_direct_t<m_N, _storage_N>::~matrix_solver_direct_t()
{
for (unsigned k = 0; k < N(); k++)
{
@@ -76,7 +85,7 @@ netlist_matrix_solver_direct_t<m_N, _storage_N>::~netlist_matrix_solver_direct_t
}
template <unsigned m_N, unsigned _storage_N>
-ATTR_HOT nl_double netlist_matrix_solver_direct_t<m_N, _storage_N>::compute_next_timestep()
+ATTR_HOT nl_double matrix_solver_direct_t<m_N, _storage_N>::compute_next_timestep()
{
nl_double new_solver_timestep = m_params.m_max_timestep;
@@ -86,9 +95,9 @@ ATTR_HOT nl_double netlist_matrix_solver_direct_t<m_N, _storage_N>::compute_next
* FIXME: We should extend the logic to use either all nets or
* only output nets.
*/
- for (unsigned k = 0; k < N(); k++)
+ for (unsigned k = 0, iN=N(); k < iN; k++)
{
- netlist_analog_net_t *n = m_nets[k];
+ analog_net_t *n = m_nets[k];
const nl_double DD_n = (n->m_cur_Analog - m_last_V[k]);
const nl_double hn = current_timestep();
@@ -115,24 +124,24 @@ ATTR_HOT nl_double netlist_matrix_solver_direct_t<m_N, _storage_N>::compute_next
}
template <unsigned m_N, unsigned _storage_N>
-ATTR_COLD void netlist_matrix_solver_direct_t<m_N, _storage_N>::add_term(int k, netlist_terminal_t *term)
+ATTR_COLD void matrix_solver_direct_t<m_N, _storage_N>::add_term(int k, terminal_t *term)
{
if (term->m_otherterm->net().isRailNet())
{
- m_rails_temp[k].add(term, -1);
+ m_rails_temp[k].add(term, -1, false);
}
else
{
int ot = get_net_idx(&term->m_otherterm->net());
if (ot>=0)
{
- m_terms[k]->add(term, ot);
+ m_terms[k]->add(term, ot, true);
SOLVER_VERBOSE_OUT(("Net %d Term %s %f %f\n", k, terms[i]->name().cstr(), terms[i]->m_gt, terms[i]->m_go));
}
/* Should this be allowed ? */
else // if (ot<0)
{
- m_rails_temp[k].add(term, ot);
+ m_rails_temp[k].add(term, ot, true);
netlist().error("found term with missing othernet %s\n", term->name().cstr());
}
}
@@ -140,10 +149,10 @@ ATTR_COLD void netlist_matrix_solver_direct_t<m_N, _storage_N>::add_term(int k,
template <unsigned m_N, unsigned _storage_N>
-ATTR_COLD void netlist_matrix_solver_direct_t<m_N, _storage_N>::vsetup(netlist_analog_net_t::list_t &nets)
+ATTR_COLD void matrix_solver_direct_t<m_N, _storage_N>::vsetup(analog_net_t::list_t &nets)
{
if (m_dim < nets.size())
- netlist().error("Dimension %d less than %" SIZETFMT, m_dim, nets.size());
+ netlist().error("Dimension %d less than %" SIZETFMT, m_dim, SIZET_PRINTF(nets.size()));
for (unsigned k = 0; k < N(); k++)
{
@@ -151,13 +160,13 @@ ATTR_COLD void netlist_matrix_solver_direct_t<m_N, _storage_N>::vsetup(netlist_a
m_rails_temp[k].clear();
}
- netlist_matrix_solver_t::setup(nets);
+ matrix_solver_t::setup(nets);
for (unsigned k = 0; k < N(); k++)
{
m_terms[k]->m_railstart = m_terms[k]->count();
for (unsigned i = 0; i < m_rails_temp[k].count(); i++)
- this->m_terms[k]->add(m_rails_temp[k].terms()[i], m_rails_temp[k].net_other()[i]);
+ this->m_terms[k]->add(m_rails_temp[k].terms()[i], m_rails_temp[k].net_other()[i], false);
m_rails_temp[k].clear(); // no longer needed
m_terms[k]->set_pointers();
@@ -206,15 +215,85 @@ ATTR_COLD void netlist_matrix_solver_direct_t<m_N, _storage_N>::vsetup(netlist_a
}
#endif
+
+ /* create a list of non zero elements right of the diagonal
+ * These list anticipate the population of array elements by
+ * Gaussian elimination.
+ */
+ for (unsigned k = 0; k < N(); k++)
+ {
+ terms_t * t = m_terms[k];
+ /* pretty brutal */
+ int *other = t->net_other();
+
+ t->m_nz.clear();
+
+ if (k==0)
+ t->m_nzrd.clear();
+ else
+ {
+ t->m_nzrd = m_terms[k-1]->m_nzrd;
+ unsigned j=0;
+ while(j < t->m_nzrd.size())
+ {
+ if (t->m_nzrd[j] < k + 1)
+ t->m_nzrd.remove_at(j);
+ else
+ j++;
+ }
+ }
+
+ for (unsigned j = 0; j < N(); j++)
+ {
+ for (unsigned i = 0; i < t->m_railstart; i++)
+ {
+ if (!t->m_nzrd.contains(other[i]) && other[i] >= (int) (k + 1))
+ t->m_nzrd.add(other[i]);
+ if (!t->m_nz.contains(other[i]))
+ t->m_nz.add(other[i]);
+ }
+ }
+ psort_list(t->m_nzrd);
+
+ t->m_nz.add(k); // add diagonal
+ psort_list(t->m_nz);
+ }
+
+ if(0)
+ for (unsigned k = 0; k < N(); k++)
+ {
+ netlist().log("%3d: ", k);
+ for (unsigned j = 0; j < m_terms[k]->m_nzrd.size(); j++)
+ netlist().log(" %3d", m_terms[k]->m_nzrd[j]);
+ netlist().log("\n");
+ }
+
+ /*
+ * save states
+ */
+ save(NLNAME(m_RHS));
+ save(NLNAME(m_last_RHS));
+ save(NLNAME(m_last_V));
+
+ for (unsigned k = 0; k < N(); k++)
+ {
+ pstring num = pstring::sprintf("%d", k);
+
+ save(m_terms[k]->go(),"GO" + num, m_terms[k]->count());
+ save(m_terms[k]->gt(),"GT" + num, m_terms[k]->count());
+ save(m_terms[k]->Idr(),"IDR" + num , m_terms[k]->count());
+ }
+
}
template <unsigned m_N, unsigned _storage_N>
-ATTR_HOT void netlist_matrix_solver_direct_t<m_N, _storage_N>::build_LE_A()
+ATTR_HOT void matrix_solver_direct_t<m_N, _storage_N>::build_LE_A()
{
- for (unsigned k = 0; k < N(); k++)
+ const unsigned iN = N();
+ for (unsigned k = 0; k < iN; k++)
{
- for (unsigned i=0; i < N(); i++)
+ for (unsigned i=0; i < iN; i++)
m_A[k][i] = 0.0;
nl_double akk = 0.0;
@@ -230,14 +309,15 @@ ATTR_HOT void netlist_matrix_solver_direct_t<m_N, _storage_N>::build_LE_A()
m_A[k][k] += akk;
for (unsigned i = 0; i < railstart; i++)
- m_A[k][net_other[i]] += -go[i];
+ m_A[k][net_other[i]] -= go[i];
}
}
template <unsigned m_N, unsigned _storage_N>
-ATTR_HOT void netlist_matrix_solver_direct_t<m_N, _storage_N>::build_LE_RHS()
+ATTR_HOT void matrix_solver_direct_t<m_N, _storage_N>::build_LE_RHS(nl_double * RESTRICT rhs)
{
- for (unsigned k = 0; k < N(); k++)
+ const unsigned iN = N();
+ for (unsigned k = 0; k < iN; k++)
{
nl_double rhsk_a = 0.0;
nl_double rhsk_b = 0.0;
@@ -254,12 +334,12 @@ ATTR_HOT void netlist_matrix_solver_direct_t<m_N, _storage_N>::build_LE_RHS()
//rhsk = rhsk + go[i] * terms[i]->m_otherterm->net().as_analog().Q_Analog();
rhsk_b = rhsk_b + go[i] * *other_cur_analog[i];
- m_RHS[k] = rhsk_a + rhsk_b;
+ rhs[k] = rhsk_a + rhsk_b;
}
}
template <unsigned m_N, unsigned _storage_N>
-ATTR_HOT void netlist_matrix_solver_direct_t<m_N, _storage_N>::LE_solve()
+ATTR_HOT void matrix_solver_direct_t<m_N, _storage_N>::LE_solve()
{
#if 0
for (int i = 0; i < N(); i++)
@@ -281,7 +361,8 @@ ATTR_HOT void netlist_matrix_solver_direct_t<m_N, _storage_N>::LE_solve()
unsigned maxrow = i;
for (unsigned j = i + 1; j < kN; j++)
{
- if (nl_math::abs(m_A[j][i]) > nl_math::abs(m_A[maxrow][i]))
+ //if (std::abs(m_A[j][i]) > std::abs(m_A[maxrow][i]))
+ if (m_A[j][i] * m_A[j][i] > m_A[maxrow][i] * m_A[maxrow][i])
maxrow = j;
}
@@ -293,28 +374,70 @@ ATTR_HOT void netlist_matrix_solver_direct_t<m_N, _storage_N>::LE_solve()
}
std::swap(m_RHS[i], m_RHS[maxrow]);
}
- }
-
- /* FIXME: Singular matrix? */
- const nl_double f = 1.0 / m_A[i][i];
+ /* FIXME: Singular matrix? */
+ const nl_double f = 1.0 / m_A[i][i];
+ const nl_ext_double * RESTRICT s = &m_A[i][i+1];
- /* Eliminate column i from row j */
+ /* Eliminate column i from row j */
- for (unsigned j = i + 1; j < kN; j++)
+ for (unsigned j = i + 1; j < kN; j++)
+ {
+ nl_ext_double * RESTRICT d = &m_A[j][i+1];
+ const nl_double f1 = - m_A[j][i] * f;
+ if (f1 != NL_FCONST(0.0))
+ {
+ const unsigned e = kN - i - 1;
+ for (unsigned k = 0; k < e; k++)
+ d[k] = d[k] + s[k] * f1;
+ m_RHS[j] += m_RHS[i] * f1;
+ }
+ }
+ }
+ else
{
- const nl_double f1 = - m_A[j][i] * f;
- if (f1 != NL_FCONST(0.0))
+ /* FIXME: Singular matrix? */
+ const nl_double f = 1.0 / m_A[i][i];
+ const nl_ext_double * RESTRICT s = &m_A[i][0];
+ const unsigned *p = m_terms[i]->m_nzrd.data();
+ const unsigned e = m_terms[i]->m_nzrd.size();
+
+ /* Eliminate column i from row j */
+
+ for (unsigned j = i + 1; j < kN; j++)
{
- for (unsigned k = i + 1; k < kN; k++)
- m_A[j][k] += m_A[i][k] * f1;
- m_RHS[j] += m_RHS[i] * f1;
+ nl_ext_double * RESTRICT d = &m_A[j][0];
+ const nl_double f1 = - d[i] * f;
+ if (f1 != NL_FCONST(0.0))
+ {
+ #if 0
+ /* The code below is 30% faster than the original
+ * implementation which is given here for reference.
+ *
+ * for (unsigned k = i + 1; k < kN; k++)
+ * m_A[j][k] = m_A[j][k] + m_A[i][k] * f1;
+ */
+ double * RESTRICT d = &m_A[j][i+1];
+ const double * RESTRICT s = &m_A[i][i+1];
+ const int e = kN - i - 1;
+
+ for (int k = 0; k < e; k++)
+ d[k] = d[k] + s[k] * f1;
+ #else
+ for (unsigned k = 0; k < e; k++)
+ {
+ const unsigned pk = p[k];
+ d[pk] += s[pk] * f1;
+ }
+ #endif
+ m_RHS[j] += m_RHS[i] * f1;
+ }
}
}
}
}
template <unsigned m_N, unsigned _storage_N>
-ATTR_HOT void netlist_matrix_solver_direct_t<m_N, _storage_N>::LE_back_subst(
+ATTR_HOT void matrix_solver_direct_t<m_N, _storage_N>::LE_back_subst(
nl_double * RESTRICT x)
{
const unsigned kN = N();
@@ -324,16 +447,35 @@ ATTR_HOT void netlist_matrix_solver_direct_t<m_N, _storage_N>::LE_back_subst(
{
nl_double tmp = 0;
+#if 1
+#if (USE_PIVOT_SEARCH)
+ const nl_ext_double * RESTRICT A = &m_A[j][j+1];
+ const nl_double * RESTRICT xp = &x[j+1];
+ const unsigned e = kN - j - 1;
+ for (unsigned k = 0; k < e; k++)
+ tmp += A[k] * xp[k];
+#else
+ const nl_ext_double * RESTRICT A = &m_A[j][0];
+ const unsigned *p = m_terms[j]->m_nzrd.data();
+ const unsigned e = m_terms[j]->m_nzrd.size();
+
+ for (unsigned k = 0; k < e; k++)
+ {
+ const unsigned pk = p[k];
+ tmp += A[pk] * x[pk];
+ }
+#endif
+#else
for (unsigned k = j + 1; k < kN; k++)
tmp += m_A[j][k] * x[k];
-
+#endif
x[j] = (m_RHS[j] - tmp) / m_A[j][j];
}
#if 0
printf("Solution:\n");
- for (int i = 0; i < N(); i++)
+ for (unsigned i = 0; i < N(); i++)
{
- for (int k = 0; k < N(); k++)
+ for (unsigned k = 0; k < N(); k++)
printf("%f ", m_A[i][k]);
printf("| %f = %f \n", x[i], m_RHS[i]);
}
@@ -343,82 +485,100 @@ ATTR_HOT void netlist_matrix_solver_direct_t<m_N, _storage_N>::LE_back_subst(
}
template <unsigned m_N, unsigned _storage_N>
-ATTR_HOT nl_double netlist_matrix_solver_direct_t<m_N, _storage_N>::delta(
+ATTR_HOT nl_double matrix_solver_direct_t<m_N, _storage_N>::delta(
const nl_double * RESTRICT V)
{
+ /* FIXME: Ideally we should also include currents (RHS) here. This would
+ * need a revaluation of the right hand side after voltages have been updated
+ * and thus belong into a different calculation. This applies to all solvers.
+ */
+
+ const unsigned iN = this->N();
nl_double cerr = 0;
- nl_double cerr2 = 0;
- for (unsigned i = 0; i < this->N(); i++)
- {
- const nl_double e = nl_math::abs(V[i] - this->m_nets[i]->m_cur_Analog);
- const nl_double e2 = nl_math::abs(m_RHS[i] - this->m_last_RHS[i]);
- cerr = (e > cerr ? e : cerr);
- cerr2 = (e2 > cerr2 ? e2 : cerr2);
- }
- // FIXME: Review
- return cerr + cerr2*NL_FCONST(100000.0);
+ for (unsigned i = 0; i < iN; i++)
+ cerr = std::max(cerr, nl_math::abs(V[i] - this->m_nets[i]->m_cur_Analog));
+ return cerr;
}
template <unsigned m_N, unsigned _storage_N>
-ATTR_HOT void netlist_matrix_solver_direct_t<m_N, _storage_N>::store(
- const nl_double * RESTRICT V, const bool store_RHS)
+ATTR_HOT void matrix_solver_direct_t<m_N, _storage_N>::store(
+ const nl_double * RESTRICT V)
{
- for (unsigned i = 0; i < this->N(); i++)
+ for (unsigned i = 0, iN=N(); i < iN; i++)
{
this->m_nets[i]->m_cur_Analog = V[i];
}
- if (store_RHS)
- {
- for (unsigned i = 0; i < this->N(); i++)
- {
- this->m_last_RHS[i] = m_RHS[i];
- }
- }
}
template <unsigned m_N, unsigned _storage_N>
-ATTR_HOT nl_double netlist_matrix_solver_direct_t<m_N, _storage_N>::vsolve()
+ATTR_HOT nl_double matrix_solver_direct_t<m_N, _storage_N>::vsolve()
{
- solve_base<netlist_matrix_solver_direct_t>(this);
+ this->solve_base(this);
return this->compute_next_timestep();
}
template <unsigned m_N, unsigned _storage_N>
-ATTR_HOT int netlist_matrix_solver_direct_t<m_N, _storage_N>::solve_non_dynamic(ATTR_UNUSED const bool newton_raphson)
+ATTR_HOT int matrix_solver_direct_t<m_N, _storage_N>::solve_non_dynamic(ATTR_UNUSED const bool newton_raphson)
{
- nl_double new_v[_storage_N]; // = { 0.0 };
+ nl_double new_V[_storage_N]; // = { 0.0 };
- this->LE_back_subst(new_v);
+ this->LE_back_subst(new_V);
- if (this->is_dynamic())
+ if (newton_raphson)
{
- nl_double err = delta(new_v);
+#if 0
+ /* limiting just doesn't work. */
+ const unsigned iN = this->N();
+ double err = 0;
+ for (unsigned k = 0; k < iN; k++)
+ {
+ const double ov = this->m_nets[k]->m_cur_Analog;
+ double d = new_V[k] - ov;
+ err = std::max(nl_math::abs(d), err);
+ }
+ double a = 1.05;
+ for (unsigned k = 0; k < iN; k++)
+ {
+ const double ov = this->m_nets[k]->m_cur_Analog;
+ double d = new_V[k] - ov;
+ const double nv = ov + a * d;
+ this->m_nets[k]->m_cur_Analog = nv;
+ }
- store(new_v, true);
+ return (err > this->m_params.m_accuracy) ? 2 : 1;
+#else
+ nl_double err = delta(new_V);
+
+ store(new_V);
return (err > this->m_params.m_accuracy) ? 2 : 1;
+#endif
}
else
{
- store(new_v, false); // ==> No need to store RHS
+ store(new_V);
return 1;
}
}
template <unsigned m_N, unsigned _storage_N>
-ATTR_HOT inline int netlist_matrix_solver_direct_t<m_N, _storage_N>::vsolve_non_dynamic(const bool newton_raphson)
+ATTR_HOT inline int matrix_solver_direct_t<m_N, _storage_N>::vsolve_non_dynamic(const bool newton_raphson)
{
this->build_LE_A();
- this->build_LE_RHS();
+ this->build_LE_RHS(m_last_RHS);
+
+ for (unsigned i=0, iN=N(); i < iN; i++)
+ m_RHS[i] = m_last_RHS[i];
+
this->LE_solve();
return this->solve_non_dynamic(newton_raphson);
}
template <unsigned m_N, unsigned _storage_N>
-netlist_matrix_solver_direct_t<m_N, _storage_N>::netlist_matrix_solver_direct_t(const netlist_solver_parameters_t &params, const int size)
-: netlist_matrix_solver_t(GAUSSIAN_ELIMINATION, params)
+matrix_solver_direct_t<m_N, _storage_N>::matrix_solver_direct_t(const solver_parameters_t *params, const int size)
+: matrix_solver_t(GAUSSIAN_ELIMINATION, params)
, m_dim(size)
, m_lp_fact(0)
{
@@ -434,8 +594,8 @@ netlist_matrix_solver_direct_t<m_N, _storage_N>::netlist_matrix_solver_direct_t(
}
template <unsigned m_N, unsigned _storage_N>
-netlist_matrix_solver_direct_t<m_N, _storage_N>::netlist_matrix_solver_direct_t(const eSolverType type, const netlist_solver_parameters_t &params, const int size)
-: netlist_matrix_solver_t(type, params)
+matrix_solver_direct_t<m_N, _storage_N>::matrix_solver_direct_t(const eSolverType type, const solver_parameters_t *params, const int size)
+: matrix_solver_t(type, params)
, m_dim(size)
, m_lp_fact(0)
{
@@ -450,5 +610,6 @@ netlist_matrix_solver_direct_t<m_N, _storage_N>::netlist_matrix_solver_direct_t(
}
}
+NETLIB_NAMESPACE_DEVICES_END()
#endif /* NLD_MS_DIRECT_H_ */
diff --git a/src/emu/netlist/analog/nld_ms_direct1.h b/src/emu/netlist/solver/nld_ms_direct1.h
index 6b901417a0a..d2009846053 100644
--- a/src/emu/netlist/analog/nld_ms_direct1.h
+++ b/src/emu/netlist/solver/nld_ms_direct1.h
@@ -8,15 +8,17 @@
#ifndef NLD_MS_DIRECT1_H_
#define NLD_MS_DIRECT1_H_
-#include "nld_solver.h"
-#include "nld_ms_direct.h"
+#include "../solver/nld_ms_direct.h"
+#include "../solver/nld_solver.h"
-class netlist_matrix_solver_direct1_t: public netlist_matrix_solver_direct_t<1,1>
+NETLIB_NAMESPACE_DEVICES_START()
+
+class matrix_solver_direct1_t: public matrix_solver_direct_t<1,1>
{
public:
- netlist_matrix_solver_direct1_t(const netlist_solver_parameters_t &params)
- : netlist_matrix_solver_direct_t<1, 1>(params, 1)
+ matrix_solver_direct1_t(const solver_parameters_t *params)
+ : matrix_solver_direct_t<1, 1>(params, 1)
{}
ATTR_HOT inline int vsolve_non_dynamic(const bool newton_raphson);
protected:
@@ -25,20 +27,20 @@ private:
};
// ----------------------------------------------------------------------------------------
-// netlist_matrix_solver - Direct1
+// matrix_solver - Direct1
// ----------------------------------------------------------------------------------------
-ATTR_HOT nl_double netlist_matrix_solver_direct1_t::vsolve()
+ATTR_HOT nl_double matrix_solver_direct1_t::vsolve()
{
- solve_base<netlist_matrix_solver_direct1_t>(this);
+ solve_base<matrix_solver_direct1_t>(this);
return this->compute_next_timestep();
}
-ATTR_HOT inline int netlist_matrix_solver_direct1_t::vsolve_non_dynamic(ATTR_UNUSED const bool newton_raphson)
+ATTR_HOT inline int matrix_solver_direct1_t::vsolve_non_dynamic(ATTR_UNUSED const bool newton_raphson)
{
- netlist_analog_net_t *net = m_nets[0];
+ analog_net_t *net = m_nets[0];
this->build_LE_A();
- this->build_LE_RHS();
+ this->build_LE_RHS(m_RHS);
//NL_VERBOSE_OUT(("%f %f\n", new_val, m_RHS[0] / m_A[0][0]);
nl_double new_val = m_RHS[0] / m_A[0][0];
@@ -57,6 +59,7 @@ ATTR_HOT inline int netlist_matrix_solver_direct1_t::vsolve_non_dynamic(ATTR_UNU
}
+NETLIB_NAMESPACE_DEVICES_END()
#endif /* NLD_MS_DIRECT1_H_ */
diff --git a/src/emu/netlist/analog/nld_ms_direct2.h b/src/emu/netlist/solver/nld_ms_direct2.h
index 2aa8d749aaa..79f9e55d908 100644
--- a/src/emu/netlist/analog/nld_ms_direct2.h
+++ b/src/emu/netlist/solver/nld_ms_direct2.h
@@ -8,17 +8,17 @@
#ifndef NLD_MS_DIRECT2_H_
#define NLD_MS_DIRECT2_H_
-#include "nld_solver.h"
-#include "nld_ms_direct.h"
+#include "../solver/nld_ms_direct.h"
+#include "../solver/nld_solver.h"
+NETLIB_NAMESPACE_DEVICES_START()
-
-class netlist_matrix_solver_direct2_t: public netlist_matrix_solver_direct_t<2,2>
+class matrix_solver_direct2_t: public matrix_solver_direct_t<2,2>
{
public:
- netlist_matrix_solver_direct2_t(const netlist_solver_parameters_t &params)
- : netlist_matrix_solver_direct_t<2, 2>(params, 2)
+ matrix_solver_direct2_t(const solver_parameters_t *params)
+ : matrix_solver_direct_t<2, 2>(params, 2)
{}
ATTR_HOT inline int vsolve_non_dynamic(const bool newton_raphson);
protected:
@@ -27,19 +27,19 @@ private:
};
// ----------------------------------------------------------------------------------------
-// netlist_matrix_solver - Direct2
+// matrix_solver - Direct2
// ----------------------------------------------------------------------------------------
-ATTR_HOT nl_double netlist_matrix_solver_direct2_t::vsolve()
+ATTR_HOT nl_double matrix_solver_direct2_t::vsolve()
{
- solve_base<netlist_matrix_solver_direct2_t>(this);
+ solve_base<matrix_solver_direct2_t>(this);
return this->compute_next_timestep();
}
-ATTR_HOT inline int netlist_matrix_solver_direct2_t::vsolve_non_dynamic(ATTR_UNUSED const bool newton_raphson)
+ATTR_HOT inline int matrix_solver_direct2_t::vsolve_non_dynamic(ATTR_UNUSED const bool newton_raphson)
{
build_LE_A();
- build_LE_RHS();
+ build_LE_RHS(m_RHS);
const nl_double a = m_A[0][0];
const nl_double b = m_A[0][1];
@@ -53,16 +53,16 @@ ATTR_HOT inline int netlist_matrix_solver_direct2_t::vsolve_non_dynamic(ATTR_UNU
if (is_dynamic())
{
nl_double err = this->delta(new_val);
- store(new_val, true);
+ store(new_val);
if (err > m_params.m_accuracy )
return 2;
else
return 1;
}
- store(new_val, false);
+ store(new_val);
return 1;
}
-
+NETLIB_NAMESPACE_DEVICES_END()
#endif /* NLD_MS_DIRECT2_H_ */
diff --git a/src/emu/netlist/solver/nld_ms_gmres.h b/src/emu/netlist/solver/nld_ms_gmres.h
new file mode 100644
index 00000000000..102549b9194
--- /dev/null
+++ b/src/emu/netlist/solver/nld_ms_gmres.h
@@ -0,0 +1,426 @@
+// license:GPL-2.0+
+// copyright-holders:Couriersud
+/*
+ * nld_ms_sor.h
+ *
+ * Generic successive over relaxation solver.
+ *
+ * Fow w==1 we will do the classic Gauss-Seidel approach
+ *
+ */
+
+#ifndef NLD_MS_GMRES_H_
+#define NLD_MS_GMRES_H_
+
+#include <algorithm>
+
+#include "../solver/mat_cr.h"
+#include "../solver/nld_ms_direct.h"
+#include "../solver/nld_solver.h"
+#include "../solver/vector_base.h"
+
+NETLIB_NAMESPACE_DEVICES_START()
+
+template <unsigned m_N, unsigned _storage_N>
+class matrix_solver_GMRES_t: public matrix_solver_direct_t<m_N, _storage_N>
+{
+public:
+
+ matrix_solver_GMRES_t(const solver_parameters_t *params, int size)
+ : matrix_solver_direct_t<m_N, _storage_N>(matrix_solver_t::GAUSS_SEIDEL, params, size)
+ , m_use_iLU_preconditioning(true)
+ , m_use_more_precise_stop_condition(false)
+ , m_accuracy_mult(1.0)
+ {
+ unsigned mr=this->N(); /* FIXME: maximum iterations locked in here */
+
+ for (unsigned i = 0; i < mr + 1; i++)
+ m_ht[i] = new double[mr];
+
+ for (unsigned i = 0; i < this->N(); i++)
+ m_v[i] = new double[_storage_N];
+
+ }
+
+ virtual ~matrix_solver_GMRES_t()
+ {
+ unsigned mr=this->N(); /* FIXME: maximum iterations locked in here */
+
+ for (unsigned i = 0; i < mr + 1; i++)
+ delete[] m_ht[i];
+
+ for (unsigned i = 0; i < this->N(); i++)
+ delete[] m_v[i];
+ }
+
+ virtual void vsetup(analog_net_t::list_t &nets);
+ ATTR_HOT virtual int vsolve_non_dynamic(const bool newton_raphson);
+protected:
+ ATTR_HOT virtual nl_double vsolve();
+
+private:
+
+ int solve_ilu_gmres(double * RESTRICT x, double * RESTRICT rhs, const unsigned restart_max, const unsigned mr, double accuracy);
+
+ plist_t<int> m_term_cr[_storage_N];
+
+ bool m_use_iLU_preconditioning;
+ bool m_use_more_precise_stop_condition;
+
+ mat_cr_t<_storage_N> mat;
+
+ double m_A[_storage_N * _storage_N];
+ double m_LU[_storage_N * _storage_N];
+
+ double m_c[_storage_N + 1]; /* mr + 1 */
+ double m_g[_storage_N + 1]; /* mr + 1 */
+ double * RESTRICT m_ht[_storage_N + 1]; /* (mr + 1), mr */
+ double m_s[_storage_N]; /* mr + 1 */
+ double * RESTRICT m_v[_storage_N + 1]; /*(mr + 1), n */
+ //double m_y[_storage_N]; /* mr + 1 */
+
+ double m_accuracy_mult; // FXIME: Save state
+};
+
+// ----------------------------------------------------------------------------------------
+// matrix_solver - GMRES
+// ----------------------------------------------------------------------------------------
+
+template <unsigned m_N, unsigned _storage_N>
+void matrix_solver_GMRES_t<m_N, _storage_N>::vsetup(analog_net_t::list_t &nets)
+{
+ matrix_solver_direct_t<m_N, _storage_N>::vsetup(nets);
+
+ unsigned nz = 0;
+ const unsigned iN = this->N();
+
+ for (unsigned k=0; k<iN; k++)
+ {
+ terms_t * RESTRICT row = this->m_terms[k];
+ mat.ia[k] = nz;
+
+ for (unsigned j=0; j<row->m_nz.size(); j++)
+ {
+ mat.ja[nz] = row->m_nz[j];
+ if (row->m_nz[j] == k)
+ mat.diag[k] = nz;
+ nz++;
+ }
+
+ /* build pointers into the compressed row format matrix for each terminal */
+
+ for (unsigned j=0; j< this->m_terms[k]->m_railstart;j++)
+ {
+ for (unsigned i = mat.ia[k]; i<nz; i++)
+ if (this->m_terms[k]->net_other()[j] == (int) mat.ja[i])
+ {
+ m_term_cr[k].add(i);
+ break;
+ }
+ nl_assert(m_term_cr[k].size() == this->m_terms[k]->m_railstart);
+ }
+ }
+
+ mat.ia[iN] = nz;
+ mat.nz_num = nz;
+}
+
+template <unsigned m_N, unsigned _storage_N>
+ATTR_HOT nl_double matrix_solver_GMRES_t<m_N, _storage_N>::vsolve()
+{
+ this->solve_base(this);
+ return this->compute_next_timestep();
+}
+
+template <unsigned m_N, unsigned _storage_N>
+ATTR_HOT inline int matrix_solver_GMRES_t<m_N, _storage_N>::vsolve_non_dynamic(const bool newton_raphson)
+{
+ const unsigned iN = this->N();
+
+ /* ideally, we could get an estimate for the spectral radius of
+ * Inv(D - L) * U
+ *
+ * and estimate using
+ *
+ * omega = 2.0 / (1.0 + nl_math::sqrt(1-rho))
+ */
+
+ //nz_num = 0;
+ ATTR_ALIGN nl_double RHS[_storage_N];
+ ATTR_ALIGN nl_double new_V[_storage_N];
+ ATTR_ALIGN nl_double l_V[_storage_N];
+
+ for (unsigned i=0, e=mat.nz_num; i<e; i++)
+ m_A[i] = 0.0;
+
+ for (unsigned k = 0; k < iN; k++)
+ {
+ nl_double gtot_t = 0.0;
+ nl_double RHS_t = 0.0;
+
+ const unsigned term_count = this->m_terms[k]->count();
+ const unsigned railstart = this->m_terms[k]->m_railstart;
+ const nl_double * const RESTRICT gt = this->m_terms[k]->gt();
+ const nl_double * const RESTRICT go = this->m_terms[k]->go();
+ const nl_double * const RESTRICT Idr = this->m_terms[k]->Idr();
+ const nl_double * const * RESTRICT other_cur_analog = this->m_terms[k]->other_curanalog();
+
+ l_V[k] = new_V[k] = this->m_nets[k]->m_cur_Analog;
+ for (unsigned i = 0; i < term_count; i++)
+ {
+ gtot_t = gtot_t + gt[i];
+ RHS_t = RHS_t + Idr[i];
+ }
+
+ for (unsigned i = railstart; i < term_count; i++)
+ RHS_t = RHS_t + go[i] * *other_cur_analog[i];
+
+ RHS[k] = RHS_t;
+
+ // add diagonal element
+ m_A[mat.diag[k]] = gtot_t;
+
+ for (unsigned i = 0; i < railstart; i++)
+ {
+ const unsigned pi = m_term_cr[k][i];
+ m_A[pi] -= go[i];
+ }
+ }
+ mat.ia[iN] = mat.nz_num;
+
+ const nl_double accuracy = this->m_params.m_accuracy;
+#if 1
+ int mr = std::min((int) iN-1,(int) sqrt(iN));
+ mr = std::min(mr, this->m_params.m_gs_loops);
+ int iter = 4;
+ int gsl = solve_ilu_gmres(new_V, RHS, iter, mr, accuracy);
+ int failed = mr * iter;
+#else
+ int failed = 6;
+ //int gsl = tt_ilu_cr(new_V, RHS, failed, accuracy);
+ int gsl = tt_gs_cr(new_V, RHS, failed, accuracy);
+#endif
+ this->m_iterative_total += gsl;
+ this->m_stat_calculations++;
+
+ if (gsl>=failed)
+ {
+ //for (int k = 0; k < iN; k++)
+ // this->m_nets[k]->m_cur_Analog = new_V[k];
+ // Fallback to direct solver ...
+ this->m_iterative_fail++;
+ return matrix_solver_direct_t<m_N, _storage_N>::vsolve_non_dynamic(newton_raphson);
+ }
+
+ if (newton_raphson)
+ {
+ double err = 0;
+ for (unsigned k = 0; k < iN; k++)
+ err = std::max(nl_math::abs(l_V[k] - new_V[k]), err);
+
+ //printf("here %s\n", this->name().cstr());
+ for (unsigned k = 0; k < iN; k++)
+ this->m_nets[k]->m_cur_Analog += 1.0 * (new_V[k] - this->m_nets[k]->m_cur_Analog);
+ if (err > accuracy)
+ return 2;
+ else
+ return 1;
+ }
+ else
+ {
+ for (unsigned k = 0; k < iN; k++)
+ this->m_nets[k]->m_cur_Analog = new_V[k];
+ return 1;
+ }
+}
+
+static inline void givens_mult( const double c, const double s, double * RESTRICT g0, double * RESTRICT g1 )
+{
+ const double tg0 = c * *g0 - s * *g1;
+ const double tg1 = s * *g0 + c * *g1;
+
+ *g0 = tg0;
+ *g1 = tg1;
+}
+
+template <unsigned m_N, unsigned _storage_N>
+int matrix_solver_GMRES_t<m_N, _storage_N>::solve_ilu_gmres (double * RESTRICT x, double * RESTRICT rhs, const unsigned restart_max, const unsigned mr, double accuracy)
+{
+ /*-------------------------------------------------------------------------
+ * The code below was inspired by code published by John Burkardt under
+ * the LPGL here:
+ *
+ * http://people.sc.fsu.edu/~jburkardt/cpp_src/mgmres/mgmres.html
+ *
+ * The code below was completely written from scratch based on the pseudo code
+ * found here:
+ *
+ * http://de.wikipedia.org/wiki/GMRES-Verfahren
+ *
+ * The Algorithm itself is described in
+ *
+ * Yousef Saad,
+ * Iterative Methods for Sparse Linear Systems,
+ * Second Edition,
+ * SIAM, 20003,
+ * ISBN: 0898715342,
+ * LC: QA188.S17.
+ *
+ *------------------------------------------------------------------------*/
+
+ unsigned itr_used = 0;
+ double rho_delta = 0.0;
+
+ const unsigned n = this->N();
+
+ if (m_use_iLU_preconditioning)
+ mat.incomplete_LU_factorization(m_A, m_LU);
+
+ if (m_use_more_precise_stop_condition)
+ {
+ /* derive residual for a given delta x
+ *
+ * LU y = A dx
+ *
+ * ==> rho / accuracy = sqrt(y * y)
+ *
+ * This approach will approximate the iterative stop condition
+ * based |xnew - xold| pretty precisely. But it is slow, or expressed
+ * differently: The invest doesn't pay off.
+ * Therefore we use the approach in the else part.
+ */
+ double t[_storage_N];
+ double Ax[_storage_N];
+ vec_set(n, accuracy, t);
+ mat.mult_vec(m_A, t, Ax);
+ mat.solveLUx(m_LU, Ax);
+
+ const double rho_to_accuracy = std::sqrt(vecmult2(n, Ax)) / accuracy;
+
+ //printf("rho/accuracy = %f\n", rho_to_accuracy);
+
+ rho_delta = accuracy * rho_to_accuracy;
+ }
+ else
+ rho_delta = accuracy * std::sqrt((double) n) * m_accuracy_mult;
+
+ for (unsigned itr = 0; itr < restart_max; itr++)
+ {
+ unsigned last_k = mr;
+ double mu;
+ double rho;
+
+ double Ax[_storage_N];
+ double residual[_storage_N];
+
+ mat.mult_vec(m_A, x, Ax);
+
+ vec_sub(n, rhs, Ax, residual);
+
+ if (m_use_iLU_preconditioning)
+ {
+ mat.solveLUx(m_LU, residual);
+ }
+
+ rho = std::sqrt(vecmult2(n, residual));
+
+ vec_mult_scalar(n, residual, 1.0 / rho, m_v[0]);
+
+ vec_set(mr+1, 0.0, m_g);
+ m_g[0] = rho;
+
+ for (unsigned i = 0; i < mr; i++)
+ vec_set(mr + 1, 0.0, m_ht[i]);
+
+ for (unsigned k = 0; k < mr; k++)
+ {
+ const unsigned k1 = k + 1;
+
+ mat.mult_vec(m_A, m_v[k], m_v[k1]);
+
+ if (m_use_iLU_preconditioning)
+ mat.solveLUx(m_LU, m_v[k1]);
+
+ for (unsigned j = 0; j <= k; j++)
+ {
+ m_ht[j][k] = vecmult(n, m_v[k1], m_v[j]);
+ vec_add_mult_scalar(n, m_v[j], -m_ht[j][k], m_v[k1]);
+ }
+ m_ht[k1][k] = std::sqrt(vecmult2(n, m_v[k1]));
+
+ if (m_ht[k1][k] != 0.0)
+ vec_scale(n, m_v[k1], 1.0 / m_ht[k1][k]);
+
+ for (unsigned j = 0; j < k; j++)
+ givens_mult(m_c[j], m_s[j], &m_ht[j][k], &m_ht[j+1][k]);
+
+ mu = std::sqrt(std::pow(m_ht[k][k], 2) + std::pow(m_ht[k1][k], 2));
+
+ m_c[k] = m_ht[k][k] / mu;
+ m_s[k] = -m_ht[k1][k] / mu;
+ m_ht[k][k] = m_c[k] * m_ht[k][k] - m_s[k] * m_ht[k1][k];
+ m_ht[k1][k] = 0.0;
+
+ givens_mult(m_c[k], m_s[k], &m_g[k], &m_g[k1]);
+
+ rho = std::abs(m_g[k1]);
+
+ itr_used = itr_used + 1;
+
+ if (rho <= rho_delta)
+ {
+ last_k = k;
+ break;
+ }
+ }
+
+ if (last_k >= mr)
+ /* didn't converge within accuracy */
+ last_k = mr - 1;
+
+ double m_y[_storage_N + 1];
+
+ /* Solve the system H * y = g */
+ /* x += m_v[j] * m_y[j] */
+ for (int i = last_k; i >= 0; i--)
+ {
+ double tmp = m_g[i];
+ for (unsigned j = i + 1; j <= last_k; j++)
+ {
+ tmp -= m_ht[i][j] * m_y[j];
+ }
+ m_y[i] = tmp / m_ht[i][i];
+ }
+
+ for (unsigned i = 0; i <= last_k; i++)
+ vec_add_mult_scalar(n, m_v[i], m_y[i], x);
+
+#if 1
+ if (rho <= rho_delta)
+ {
+ break;
+ }
+#else
+ /* we try to approximate the x difference between to steps using m_v[last_k] */
+
+ double xdelta = m_y[last_k] * vec_maxabs(n, m_v[last_k]);
+ if (xdelta < accuracy)
+ {
+ if (m_accuracy_mult < 16384.0)
+ m_accuracy_mult = m_accuracy_mult * 2.0;
+ break;
+ }
+ else
+ m_accuracy_mult = m_accuracy_mult / 2.0;
+
+#endif
+ }
+
+ return itr_used;
+}
+
+
+
+NETLIB_NAMESPACE_DEVICES_END()
+
+#endif /* NLD_MS_GMRES_H_ */
diff --git a/src/emu/netlist/solver/nld_ms_sor.h b/src/emu/netlist/solver/nld_ms_sor.h
new file mode 100644
index 00000000000..82c10c5c9d8
--- /dev/null
+++ b/src/emu/netlist/solver/nld_ms_sor.h
@@ -0,0 +1,196 @@
+// license:GPL-2.0+
+// copyright-holders:Couriersud
+/*
+ * nld_ms_sor.h
+ *
+ * Generic successive over relaxation solver.
+ *
+ * Fow w==1 we will do the classic Gauss-Seidel approach
+ *
+ */
+
+#ifndef NLD_MS_SOR_H_
+#define NLD_MS_SOR_H_
+
+#include <algorithm>
+
+#include "../solver/nld_ms_direct.h"
+#include "../solver/nld_solver.h"
+
+NETLIB_NAMESPACE_DEVICES_START()
+
+template <unsigned m_N, unsigned _storage_N>
+class matrix_solver_SOR_t: public matrix_solver_direct_t<m_N, _storage_N>
+{
+public:
+
+ matrix_solver_SOR_t(const solver_parameters_t *params, int size)
+ : matrix_solver_direct_t<m_N, _storage_N>(matrix_solver_t::GAUSS_SEIDEL, params, size)
+ , m_lp_fact(0)
+ {
+ }
+
+ virtual ~matrix_solver_SOR_t() {}
+
+ virtual void vsetup(analog_net_t::list_t &nets);
+ ATTR_HOT virtual int vsolve_non_dynamic(const bool newton_raphson);
+protected:
+ ATTR_HOT virtual nl_double vsolve();
+
+private:
+ nl_double m_lp_fact;
+};
+
+// ----------------------------------------------------------------------------------------
+// matrix_solver - Gauss - Seidel
+// ----------------------------------------------------------------------------------------
+
+
+template <unsigned m_N, unsigned _storage_N>
+void matrix_solver_SOR_t<m_N, _storage_N>::vsetup(analog_net_t::list_t &nets)
+{
+ matrix_solver_direct_t<m_N, _storage_N>::vsetup(nets);
+ this->save(NLNAME(m_lp_fact));
+}
+
+template <unsigned m_N, unsigned _storage_N>
+ATTR_HOT nl_double matrix_solver_SOR_t<m_N, _storage_N>::vsolve()
+{
+ this->solve_base(this);
+ return this->compute_next_timestep();
+}
+
+template <unsigned m_N, unsigned _storage_N>
+ATTR_HOT inline int matrix_solver_SOR_t<m_N, _storage_N>::vsolve_non_dynamic(const bool newton_raphson)
+{
+ const unsigned iN = this->N();
+ bool resched = false;
+ int resched_cnt = 0;
+
+ /* ideally, we could get an estimate for the spectral radius of
+ * Inv(D - L) * U
+ *
+ * and estimate using
+ *
+ * omega = 2.0 / (1.0 + nl_math::sqrt(1-rho))
+ */
+
+ const nl_double ws = this->m_params.m_sor;
+
+ ATTR_ALIGN nl_double w[_storage_N];
+ ATTR_ALIGN nl_double one_m_w[_storage_N];
+ ATTR_ALIGN nl_double RHS[_storage_N];
+ ATTR_ALIGN nl_double new_V[_storage_N];
+
+ for (unsigned k = 0; k < iN; k++)
+ {
+ nl_double gtot_t = 0.0;
+ nl_double gabs_t = 0.0;
+ nl_double RHS_t = 0.0;
+
+ const unsigned term_count = this->m_terms[k]->count();
+ const nl_double * const RESTRICT gt = this->m_terms[k]->gt();
+ const nl_double * const RESTRICT go = this->m_terms[k]->go();
+ const nl_double * const RESTRICT Idr = this->m_terms[k]->Idr();
+ const nl_double * const *other_cur_analog = this->m_terms[k]->other_curanalog();
+
+ new_V[k] = this->m_nets[k]->m_cur_Analog;
+
+ for (unsigned i = 0; i < term_count; i++)
+ {
+ gtot_t = gtot_t + gt[i];
+ RHS_t = RHS_t + Idr[i];
+ }
+
+ for (unsigned i = this->m_terms[k]->m_railstart; i < term_count; i++)
+ RHS_t = RHS_t + go[i] * *other_cur_analog[i];
+
+ RHS[k] = RHS_t;
+
+ if (USE_GABS)
+ {
+ for (unsigned i = 0; i < term_count; i++)
+ gabs_t = gabs_t + nl_math::abs(go[i]);
+
+ gabs_t *= NL_FCONST(0.5); // derived by try and error
+ if (gabs_t <= gtot_t)
+ {
+ w[k] = ws / gtot_t;
+ one_m_w[k] = NL_FCONST(1.0) - ws;
+ }
+ else
+ {
+ w[k] = NL_FCONST(1.0) / (gtot_t + gabs_t);
+ one_m_w[k] = NL_FCONST(1.0) - NL_FCONST(1.0) * gtot_t / (gtot_t + gabs_t);
+ }
+ }
+ else
+ {
+ w[k] = ws / gtot_t;
+ one_m_w[k] = NL_FCONST(1.0) - ws;
+ }
+ }
+
+ const nl_double accuracy = this->m_params.m_accuracy;
+
+ /* uncommenting the line below will force dynamic updates every X iterations
+ * althought the system has not converged yet. This is a proof of concept,
+ * 91glub
+ *
+ */
+ const bool interleaved_dynamic_updates = false;
+ //const bool interleaved_dynamic_updates = newton_raphson;
+
+ do {
+ resched = false;
+ double err = 0;
+ for (unsigned k = 0; k < iN; k++)
+ {
+ const int * RESTRICT net_other = this->m_terms[k]->net_other();
+ const unsigned railstart = this->m_terms[k]->m_railstart;
+ const nl_double * RESTRICT go = this->m_terms[k]->go();
+
+ nl_double Idrive = 0.0;
+ for (unsigned i = 0; i < railstart; i++)
+ Idrive = Idrive + go[i] * new_V[net_other[i]];
+
+ const nl_double new_val = new_V[k] * one_m_w[k] + (Idrive + RHS[k]) * w[k];
+
+ err = std::max(nl_math::abs(new_val - new_V[k]), err);
+ new_V[k] = new_val;
+ }
+
+ if (err > accuracy)
+ resched = true;
+
+ resched_cnt++;
+ //} while (resched && (resched_cnt < this->m_params.m_gs_loops));
+ } while (resched && ((!interleaved_dynamic_updates && resched_cnt < this->m_params.m_gs_loops) || (interleaved_dynamic_updates && resched_cnt < 5 )));
+
+ this->m_iterative_total += resched_cnt;
+ this->m_stat_calculations++;
+
+ if (resched && !interleaved_dynamic_updates)
+ {
+ // Fallback to direct solver ...
+ this->m_iterative_fail++;
+ return matrix_solver_direct_t<m_N, _storage_N>::vsolve_non_dynamic(newton_raphson);
+ }
+
+ if (interleaved_dynamic_updates)
+ {
+ for (unsigned k = 0; k < iN; k++)
+ this->m_nets[k]->m_cur_Analog += 1.0 * (new_V[k] - this->m_nets[k]->m_cur_Analog);
+ }
+ else
+ {
+ for (unsigned k = 0; k < iN; k++)
+ this->m_nets[k]->m_cur_Analog = new_V[k];
+ }
+
+ return resched_cnt;
+}
+
+NETLIB_NAMESPACE_DEVICES_END()
+
+#endif /* NLD_MS_SOR_H_ */
diff --git a/src/emu/netlist/solver/nld_ms_sor_mat.h b/src/emu/netlist/solver/nld_ms_sor_mat.h
new file mode 100644
index 00000000000..d5ce05ef8b1
--- /dev/null
+++ b/src/emu/netlist/solver/nld_ms_sor_mat.h
@@ -0,0 +1,241 @@
+// license:GPL-2.0+
+// copyright-holders:Couriersud
+/*
+ * nld_ms_sor.h
+ *
+ * Generic successive over relaxation solver.
+ *
+ * Fow w==1 we will do the classic Gauss-Seidel approach
+ *
+ */
+
+#ifndef NLD_MS_SOR_MAT_H_
+#define NLD_MS_SOR_MAT_H_
+
+#include <algorithm>
+
+#include "../solver/nld_ms_direct.h"
+#include "../solver/nld_solver.h"
+
+NETLIB_NAMESPACE_DEVICES_START()
+
+template <unsigned m_N, unsigned _storage_N>
+class matrix_solver_SOR_mat_t: public matrix_solver_direct_t<m_N, _storage_N>
+{
+public:
+
+ matrix_solver_SOR_mat_t(const solver_parameters_t *params, int size)
+ : matrix_solver_direct_t<m_N, _storage_N>(matrix_solver_t::GAUSS_SEIDEL, params, size)
+ , m_omega(params->m_sor)
+ , m_lp_fact(0)
+ , m_gs_fail(0)
+ , m_gs_total(0)
+ {
+ }
+
+ virtual ~matrix_solver_SOR_mat_t() {}
+
+ virtual void log_stats();
+ virtual void vsetup(analog_net_t::list_t &nets);
+
+ ATTR_HOT inline int vsolve_non_dynamic(const bool newton_raphson);
+protected:
+ ATTR_HOT virtual nl_double vsolve();
+
+private:
+ nl_double m_Vdelta[_storage_N];
+
+ nl_double m_omega;
+ nl_double m_lp_fact;
+ int m_gs_fail;
+ int m_gs_total;
+};
+
+// ----------------------------------------------------------------------------------------
+// matrix_solver - Gauss - Seidel
+// ----------------------------------------------------------------------------------------
+
+template <unsigned m_N, unsigned _storage_N>
+void matrix_solver_SOR_mat_t<m_N, _storage_N>::log_stats()
+{
+ if (this->m_stat_calculations != 0 && this->m_params.m_log_stats)
+ {
+ this->netlist().log("==============================================");
+ this->netlist().log("Solver %s", this->name().cstr());
+ this->netlist().log(" ==> %d nets", this->N()); //, (*(*groups[i].first())->m_core_terms.first())->name().cstr());
+ this->netlist().log(" has %s elements", this->is_dynamic() ? "dynamic" : "no dynamic");
+ this->netlist().log(" has %s elements", this->is_timestep() ? "timestep" : "no timestep");
+ this->netlist().log(" %6.3f average newton raphson loops", (double) this->m_stat_newton_raphson / (double) this->m_stat_vsolver_calls);
+ this->netlist().log(" %10d invocations (%6d Hz) %10d gs fails (%6.2f%%) %6.3f average",
+ this->m_stat_calculations,
+ this->m_stat_calculations * 10 / (int) (this->netlist().time().as_double() * 10.0),
+ this->m_gs_fail,
+ 100.0 * (double) this->m_gs_fail / (double) this->m_stat_calculations,
+ (double) this->m_gs_total / (double) this->m_stat_calculations);
+ }
+}
+
+template <unsigned m_N, unsigned _storage_N>
+void matrix_solver_SOR_mat_t<m_N, _storage_N>::vsetup(analog_net_t::list_t &nets)
+{
+ matrix_solver_direct_t<m_N, _storage_N>::vsetup(nets);
+ this->save(NLNAME(m_omega));
+ this->save(NLNAME(m_lp_fact));
+ this->save(NLNAME(m_gs_fail));
+ this->save(NLNAME(m_gs_total));
+ this->save(NLNAME(m_Vdelta));
+}
+
+
+template <unsigned m_N, unsigned _storage_N>
+ATTR_HOT nl_double matrix_solver_SOR_mat_t<m_N, _storage_N>::vsolve()
+{
+ /*
+ * enable linear prediction on first newton pass
+ */
+
+ if (USE_LINEAR_PREDICTION)
+ for (unsigned k = 0; k < this->N(); k++)
+ {
+ this->m_last_V[k] = this->m_nets[k]->m_cur_Analog;
+ this->m_nets[k]->m_cur_Analog = this->m_nets[k]->m_cur_Analog + this->m_Vdelta[k] * this->current_timestep() * m_lp_fact;
+ }
+ else
+ for (unsigned k = 0; k < this->N(); k++)
+ {
+ this->m_last_V[k] = this->m_nets[k]->m_cur_Analog;
+ }
+
+ this->solve_base(this);
+
+ if (USE_LINEAR_PREDICTION)
+ {
+ nl_double sq = 0;
+ nl_double sqo = 0;
+ const nl_double rez_cts = 1.0 / this->current_timestep();
+ for (unsigned k = 0; k < this->N(); k++)
+ {
+ const analog_net_t *n = this->m_nets[k];
+ const nl_double nv = (n->m_cur_Analog - this->m_last_V[k]) * rez_cts ;
+ sq += nv * nv;
+ sqo += this->m_Vdelta[k] * this->m_Vdelta[k];
+ this->m_Vdelta[k] = nv;
+ }
+
+ // FIXME: used to be 1e90, but this would not be compatible with float
+ if (sqo > NL_FCONST(1e-20))
+ m_lp_fact = std::min(nl_math::sqrt(sq/sqo), (nl_double) 2.0);
+ else
+ m_lp_fact = NL_FCONST(0.0);
+ }
+
+
+ return this->compute_next_timestep();
+}
+
+template <unsigned m_N, unsigned _storage_N>
+ATTR_HOT inline int matrix_solver_SOR_mat_t<m_N, _storage_N>::vsolve_non_dynamic(const bool newton_raphson)
+{
+ /* The matrix based code looks a lot nicer but actually is 30% slower than
+ * the optimized code which works directly on the data structures.
+ * Need something like that for gaussian elimination as well.
+ */
+
+
+ ATTR_ALIGN nl_double new_v[_storage_N] = { 0.0 };
+ const unsigned iN = this->N();
+
+ bool resched = false;
+
+ int resched_cnt = 0;
+
+ this->build_LE_A();
+ this->build_LE_RHS(this->m_RHS);
+
+#if 0
+ static int ws_cnt = 0;
+ ws_cnt++;
+ if (1 && ws_cnt % 200 == 0)
+ {
+ // update omega
+ nl_double lambdaN = 0;
+ nl_double lambda1 = 1e9;
+ for (int k = 0; k < iN; k++)
+ {
+ #if 0
+ nl_double akk = nl_math::abs(this->m_A[k][k]);
+ if ( akk > lambdaN)
+ lambdaN = akk;
+ if (akk < lambda1)
+ lambda1 = akk;
+ #else
+ nl_double akk = nl_math::abs(this->m_A[k][k]);
+ nl_double s = 0.0;
+ for (int i=0; i<iN; i++)
+ s = s + nl_math::abs(this->m_A[k][i]);
+ akk = s / akk - 1.0;
+ if ( akk > lambdaN)
+ lambdaN = akk;
+ if (akk < lambda1)
+ lambda1 = akk;
+ #endif
+ }
+ //printf("lambda: %f %f\n", lambda, 2.0 / (1.0 + 2 * sqrt(lambda)) );
+
+ //ws = 2.0 / (2.0 - lambdaN - lambda1);
+ m_omega = 2.0 / (2.0 - lambda1);
+ //printf("%f %f %f\n", m_omega, lambda1, lambdaN);
+ }
+#endif
+
+ for (unsigned k = 0; k < iN; k++)
+ new_v[k] = this->m_nets[k]->m_cur_Analog;
+
+ do {
+ resched = false;
+ nl_double cerr = 0.0;
+
+ for (unsigned k = 0; k < iN; k++)
+ {
+ nl_double Idrive = 0;
+
+ const nl_ext_double * RESTRICT A = &this->m_A[k][0];
+ const unsigned *p = this->m_terms[k]->m_nz.data();
+ const unsigned e = this->m_terms[k]->m_nz.size();
+
+ for (unsigned i = 0; i < e; i++)
+ Idrive = Idrive + A[p[i]] * new_v[p[i]];
+
+ const nl_double delta = m_omega * (this->m_RHS[k] - Idrive) / A[k];
+ cerr = std::max(cerr, nl_math::abs(delta));
+ new_v[k] += delta;
+ }
+
+ if (cerr > this->m_params.m_accuracy)
+ {
+ resched = true;
+ }
+ resched_cnt++;
+ } while (resched && (resched_cnt < this->m_params.m_gs_loops));
+
+ this->m_stat_calculations++;
+ this->m_gs_total += resched_cnt;
+
+ if (resched)
+ {
+ //this->netlist().warning("Falling back to direct solver .. Consider increasing RESCHED_LOOPS");
+ this->m_gs_fail++;
+
+ this->LE_solve();
+ return matrix_solver_direct_t<m_N, _storage_N>::solve_non_dynamic(newton_raphson);
+ }
+ else {
+ this->store(new_v);
+ return resched_cnt;
+ }
+
+}
+
+NETLIB_NAMESPACE_DEVICES_END()
+
+#endif /* NLD_MS_GAUSS_SEIDEL_H_ */
diff --git a/src/emu/netlist/analog/nld_solver.c b/src/emu/netlist/solver/nld_solver.c
index 4f4ea19c79c..acf9a6fdaae 100644
--- a/src/emu/netlist/analog/nld_solver.c
+++ b/src/emu/netlist/solver/nld_solver.c
@@ -9,10 +9,11 @@
* the vectorizations fast-math enables pretty expensive
*/
+//#pragma GCC optimize "-ffast-math"
#if 0
#pragma GCC optimize "-ffast-math"
-#pragma GCC optimize "-ftree-parallelize-loops=4"
-//#pragma GCC optimize "-funroll-loops"
+//#pragma GCC optimize "-ftree-parallelize-loops=4"
+#pragma GCC optimize "-funroll-loops"
#pragma GCC optimize "-funswitch-loops"
#pragma GCC optimize "-fvariable-expansion-in-unroller"
#pragma GCC optimize "-funsafe-loop-optimizations"
@@ -25,6 +26,7 @@
#pragma GCC optimize "-fivopts"
#endif
+#include <iostream>
#include <algorithm>
#include "nld_solver.h"
#include "nld_ms_direct.h"
@@ -32,15 +34,32 @@
#include "nld_ms_direct2.h"
#include "nld_ms_sor.h"
#include "nld_ms_sor_mat.h"
-#include "nld_twoterm.h"
+#include "nld_ms_gmres.h"
+//#include "nld_twoterm.h"
#include "../nl_lists.h"
#if HAS_OPENMP
#include "omp.h"
#endif
-ATTR_COLD void terms_t::add(netlist_terminal_t *term, int net_other)
+NETLIB_NAMESPACE_DEVICES_START()
+
+ATTR_COLD void terms_t::add(terminal_t *term, int net_other, bool sorted)
{
+ if (sorted)
+ for (unsigned i=0; i < m_net_other.size(); i++)
+ {
+ if (m_net_other[i] > net_other)
+ {
+ m_term.insert_at(term, i);
+ m_net_other.insert_at(net_other, i);
+ m_gt.insert_at(0.0, i);
+ m_go.insert_at(0.0, i);
+ m_Idr.insert_at(0.0, i);
+ m_other_curanalog.insert_at(NULL, i);
+ return;
+ }
+ }
m_term.add(term);
m_net_other.add(net_other);
m_gt.add(0.0);
@@ -61,25 +80,27 @@ ATTR_COLD void terms_t::set_pointers()
}
// ----------------------------------------------------------------------------------------
-// netlist_matrix_solver
+// matrix_solver
// ----------------------------------------------------------------------------------------
-ATTR_COLD netlist_matrix_solver_t::netlist_matrix_solver_t(const eSolverType type, const netlist_solver_parameters_t &params)
+ATTR_COLD matrix_solver_t::matrix_solver_t(const eSolverType type, const solver_parameters_t *params)
: m_stat_calculations(0),
m_stat_newton_raphson(0),
m_stat_vsolver_calls(0),
- m_params(params),
+ m_iterative_fail(0),
+ m_iterative_total(0),
+ m_params(*params),
m_cur_ts(0),
m_type(type)
{
}
-ATTR_COLD netlist_matrix_solver_t::~netlist_matrix_solver_t()
+ATTR_COLD matrix_solver_t::~matrix_solver_t()
{
m_inps.clear_and_free();
}
-ATTR_COLD void netlist_matrix_solver_t::setup(netlist_analog_net_t::list_t &nets)
+ATTR_COLD void matrix_solver_t::setup(analog_net_t::list_t &nets)
{
NL_VERBOSE_OUT(("New solver setup\n"));
@@ -94,43 +115,43 @@ ATTR_COLD void netlist_matrix_solver_t::setup(netlist_analog_net_t::list_t &nets
{
NL_VERBOSE_OUT(("setting up net\n"));
- netlist_analog_net_t *net = nets[k];
+ analog_net_t *net = nets[k];
net->m_solver = this;
for (std::size_t i = 0; i < net->m_core_terms.size(); i++)
{
- netlist_core_terminal_t *p = net->m_core_terms[i];
+ core_terminal_t *p = net->m_core_terms[i];
NL_VERBOSE_OUT(("%s %s %d\n", p->name().cstr(), net->name().cstr(), (int) net->isRailNet()));
switch (p->type())
{
- case netlist_terminal_t::TERMINAL:
- switch (p->netdev().family())
+ case terminal_t::TERMINAL:
+ switch (p->device().family())
{
- case netlist_device_t::CAPACITOR:
- if (!m_step_devices.contains(&p->netdev()))
- m_step_devices.add(&p->netdev());
+ case device_t::CAPACITOR:
+ if (!m_step_devices.contains(&p->device()))
+ m_step_devices.add(&p->device());
break;
- case netlist_device_t::BJT_EB:
- case netlist_device_t::DIODE:
- //case netlist_device_t::VCVS:
- case netlist_device_t::BJT_SWITCH:
- NL_VERBOSE_OUT(("found BJT/Diode\n"));
- if (!m_dynamic_devices.contains(&p->netdev()))
- m_dynamic_devices.add(&p->netdev());
+ case device_t::BJT_EB:
+ case device_t::DIODE:
+ case device_t::LVCCS:
+ case device_t::BJT_SWITCH:
+ NL_VERBOSE_OUT(("found BJT/Diode/LVCCS\n"));
+ if (!m_dynamic_devices.contains(&p->device()))
+ m_dynamic_devices.add(&p->device());
break;
default:
break;
}
{
- netlist_terminal_t *pterm = dynamic_cast<netlist_terminal_t *>(p);
+ terminal_t *pterm = dynamic_cast<terminal_t *>(p);
add_term(k, pterm);
}
NL_VERBOSE_OUT(("Added terminal\n"));
break;
- case netlist_terminal_t::INPUT:
+ case terminal_t::INPUT:
{
- netlist_analog_output_t *net_proxy_output = NULL;
+ analog_output_t *net_proxy_output = NULL;
for (std::size_t i = 0; i < m_inps.size(); i++)
if (m_inps[i]->m_proxied_net == &p->net().as_analog())
{
@@ -140,8 +161,8 @@ ATTR_COLD void netlist_matrix_solver_t::setup(netlist_analog_net_t::list_t &nets
if (net_proxy_output == NULL)
{
- net_proxy_output = palloc(netlist_analog_output_t);
- net_proxy_output->init_object(*this, this->name() + "." + pstring::sprintf("m%" SIZETFMT, m_inps.size()));
+ net_proxy_output = palloc(analog_output_t);
+ net_proxy_output->init_object(*this, this->name() + "." + pstring::sprintf("m%" SIZETFMT, SIZET_PRINTF(m_inps.size())));
m_inps.add(net_proxy_output);
net_proxy_output->m_proxied_net = &p->net().as_analog();
}
@@ -158,10 +179,11 @@ ATTR_COLD void netlist_matrix_solver_t::setup(netlist_analog_net_t::list_t &nets
}
NL_VERBOSE_OUT(("added net with %" SIZETFMT " populated connections\n", net->m_core_terms.size()));
}
+
}
-ATTR_HOT void netlist_matrix_solver_t::update_inputs()
+ATTR_HOT void matrix_solver_t::update_inputs()
{
// avoid recursive calls. Inputs are updated outside this call
for (std::size_t i=0; i<m_inps.size(); i++)
@@ -169,34 +191,35 @@ ATTR_HOT void netlist_matrix_solver_t::update_inputs()
}
-ATTR_HOT void netlist_matrix_solver_t::update_dynamic()
+ATTR_HOT void matrix_solver_t::update_dynamic()
{
/* update all non-linear devices */
for (std::size_t i=0; i < m_dynamic_devices.size(); i++)
- switch (m_dynamic_devices[i]->family())
- {
- case netlist_device_t::DIODE:
- static_cast<NETLIB_NAME(D) *>(m_dynamic_devices[i])->update_terminals();
- break;
- default:
- m_dynamic_devices[i]->update_terminals();
- break;
- }
+ m_dynamic_devices[i]->update_terminals();
}
-ATTR_COLD void netlist_matrix_solver_t::start()
+ATTR_COLD void matrix_solver_t::start()
{
register_output("Q_sync", m_Q_sync);
register_input("FB_sync", m_fb_sync);
- connect(m_fb_sync, m_Q_sync);
+ connect_direct(m_fb_sync, m_Q_sync);
+
+ save(NLNAME(m_last_step));
+ save(NLNAME(m_cur_ts));
+ save(NLNAME(m_stat_calculations));
+ save(NLNAME(m_stat_newton_raphson));
+ save(NLNAME(m_stat_vsolver_calls));
+ save(NLNAME(m_iterative_fail));
+ save(NLNAME(m_iterative_total));
+
}
-ATTR_COLD void netlist_matrix_solver_t::reset()
+ATTR_COLD void matrix_solver_t::reset()
{
m_last_step = netlist_time::zero;
}
-ATTR_COLD void netlist_matrix_solver_t::update()
+ATTR_COLD void matrix_solver_t::update()
{
const nl_double new_timestep = solve();
@@ -204,7 +227,7 @@ ATTR_COLD void netlist_matrix_solver_t::update()
m_Q_sync.net().reschedule_in_queue(netlist_time::from_double(new_timestep));
}
-ATTR_COLD void netlist_matrix_solver_t::update_forced()
+ATTR_COLD void matrix_solver_t::update_forced()
{
ATTR_UNUSED const nl_double new_timestep = solve();
@@ -212,7 +235,7 @@ ATTR_COLD void netlist_matrix_solver_t::update_forced()
m_Q_sync.net().reschedule_in_queue(netlist_time::from_double(m_params.m_min_timestep));
}
-ATTR_HOT void netlist_matrix_solver_t::step(const netlist_time delta)
+ATTR_HOT void matrix_solver_t::step(const netlist_time delta)
{
const nl_double dd = delta.as_double();
for (std::size_t k=0; k < m_step_devices.size(); k++)
@@ -220,7 +243,7 @@ ATTR_HOT void netlist_matrix_solver_t::step(const netlist_time delta)
}
template<class C >
-void netlist_matrix_solver_t::solve_base(C *p)
+void matrix_solver_t::solve_base(C *p)
{
m_stat_vsolver_calls++;
if (is_dynamic())
@@ -239,7 +262,7 @@ void netlist_matrix_solver_t::solve_base(C *p)
// reschedule ....
if (this_resched > 1 && !m_Q_sync.net().is_queued())
{
- netlist().warning("NEWTON_LOOPS exceeded ... reschedule");
+ netlist().warning("NEWTON_LOOPS exceeded on net %s... reschedule", this->name().cstr());
m_Q_sync.net().reschedule_in_queue(m_params.m_nt_sync_delay);
}
}
@@ -249,14 +272,14 @@ void netlist_matrix_solver_t::solve_base(C *p)
}
}
-ATTR_HOT nl_double netlist_matrix_solver_t::solve()
+ATTR_HOT nl_double matrix_solver_t::solve()
{
- netlist_time now = netlist().time();
- netlist_time delta = now - m_last_step;
+ const netlist_time now = netlist().time();
+ const netlist_time delta = now - m_last_step;
// We are already up to date. Avoid oscillations.
// FIXME: Make this a parameter!
- if (delta < netlist_time::from_nsec(1))
+ if (delta < netlist_time::from_nsec(1)) // 20000
return -1.0;
/* update all terminals for new time step */
@@ -273,10 +296,10 @@ ATTR_HOT nl_double netlist_matrix_solver_t::solve()
// ----------------------------------------------------------------------------------------
-// netlist_matrix_solver - Direct base
+// matrix_solver - Direct base
// ----------------------------------------------------------------------------------------
-ATTR_COLD int netlist_matrix_solver_t::get_net_idx(netlist_net_t *net)
+ATTR_COLD int matrix_solver_t::get_net_idx(net_t *net)
{
for (std::size_t k = 0; k < m_nets.size(); k++)
if (m_nets[k] == net)
@@ -304,10 +327,12 @@ NETLIB_START(solver)
register_param("FREQ", m_freq, 48000.0);
+ register_param("ITERATIVE", m_iterative_solver, "SOR");
+
register_param("ACCURACY", m_accuracy, 1e-7);
register_param("GS_LOOPS", m_gs_loops, 9); // Gauss-Seidel loops
register_param("GS_THRESHOLD", m_gs_threshold, 6); // below this value, gaussian elimination is used
- register_param("NR_LOOPS", m_nr_loops, 25); // Newton-Raphson loops
+ register_param("NR_LOOPS", m_nr_loops, 250); // Newton-Raphson loops
register_param("PARALLEL", m_parallel, 0);
register_param("SOR_FACTOR", m_sor, 1.059);
register_param("GMIN", m_gmin, NETLIST_GMIN_DEFAULT);
@@ -320,7 +345,7 @@ NETLIB_START(solver)
// internal staff
register_input("FB_step", m_fb_step);
- connect(m_fb_step, m_Q_step);
+ connect_late(m_fb_step, m_Q_step);
}
@@ -333,7 +358,7 @@ NETLIB_RESET(solver)
NETLIB_UPDATE_PARAM(solver)
{
- //m_inc = netlist_time::from_hz(m_freq.Value());
+ //m_inc = time::from_hz(m_freq.Value());
}
NETLIB_STOP(solver)
@@ -357,8 +382,8 @@ NETLIB_UPDATE(solver)
#if HAS_OPENMP && USE_OPENMP
if (m_parallel.Value())
{
- omp_set_num_threads(4);
- omp_set_dynamic(0);
+ omp_set_num_threads(3);
+ //omp_set_dynamic(0);
#pragma omp parallel
{
#pragma omp for
@@ -396,40 +421,49 @@ NETLIB_UPDATE(solver)
}
template <int m_N, int _storage_N>
-netlist_matrix_solver_t * NETLIB_NAME(solver)::create_solver(int size, const int gs_threshold, const bool use_specific)
+matrix_solver_t * NETLIB_NAME(solver)::create_solver(int size, const bool use_specific)
{
if (use_specific && m_N == 1)
- return palloc(netlist_matrix_solver_direct1_t, m_params);
+ return palloc(matrix_solver_direct1_t(&m_params));
else if (use_specific && m_N == 2)
- return palloc(netlist_matrix_solver_direct2_t, m_params);
+ return palloc(matrix_solver_direct2_t(&m_params));
else
{
- if (size >= gs_threshold)
+ if (size >= m_gs_threshold)
{
- if (USE_MATRIX_GS)
+ if (pstring("SOR_MAT").equals(m_iterative_solver))
+ {
+ typedef matrix_solver_SOR_mat_t<m_N,_storage_N> solver_mat;
+ return palloc(solver_mat(&m_params, size));
+ }
+ else if (pstring("SOR").equals(m_iterative_solver))
+ {
+ typedef matrix_solver_SOR_t<m_N,_storage_N> solver_GS;
+ return palloc(solver_GS(&m_params, size));
+ }
+ else if (pstring("GMRES").equals(m_iterative_solver))
{
- typedef netlist_matrix_solver_SOR_mat_t<m_N,_storage_N> solver_mat;
- return palloc(solver_mat, m_params, size);
+ typedef matrix_solver_GMRES_t<m_N,_storage_N> solver_GMRES;
+ return palloc(solver_GMRES(&m_params, size));
}
else
{
- typedef netlist_matrix_solver_SOR_t<m_N,_storage_N> solver_GS;
- return palloc(solver_GS, m_params, size);
+ netlist().error("Unknown solver type: %s\n", m_iterative_solver.Value().cstr());
+ return NULL;
}
}
else
{
- typedef netlist_matrix_solver_direct_t<m_N,_storage_N> solver_D;
- return palloc(solver_D, m_params, size);
+ typedef matrix_solver_direct_t<m_N,_storage_N> solver_D;
+ return palloc(solver_D(&m_params, size));
}
}
}
ATTR_COLD void NETLIB_NAME(solver)::post_start()
{
- netlist_analog_net_t::list_t groups[100];
+ analog_net_t::list_t groups[256];
int cur_group = -1;
- const int gs_threshold = m_gs_threshold.Value();
const bool use_specific = true;
m_params.m_accuracy = m_accuracy.Value();
@@ -467,7 +501,7 @@ ATTR_COLD void NETLIB_NAME(solver)::post_start()
if (!netlist().m_nets[i]->isRailNet())
{
SOLVER_VERBOSE_OUT((" ==> not a rail net\n"));
- netlist_analog_net_t *n = &netlist().m_nets[i]->as_analog();
+ analog_net_t *n = &netlist().m_nets[i]->as_analog();
if (!n->already_processed(groups, cur_group))
{
cur_group++;
@@ -477,82 +511,92 @@ ATTR_COLD void NETLIB_NAME(solver)::post_start()
}
// setup the solvers
- netlist().log("Found %d net groups in %" SIZETFMT " nets\n", cur_group + 1, netlist().m_nets.size());
+ netlist().log("Found %d net groups in %" SIZETFMT " nets\n", cur_group + 1, SIZET_PRINTF(netlist().m_nets.size()));
for (int i = 0; i <= cur_group; i++)
{
- netlist_matrix_solver_t *ms;
+ matrix_solver_t *ms;
std::size_t net_count = groups[i].size();
switch (net_count)
{
case 1:
- ms = create_solver<1,1>(1, gs_threshold, use_specific);
+ ms = create_solver<1,1>(1, use_specific);
break;
case 2:
- ms = create_solver<2,2>(2, gs_threshold, use_specific);
+ ms = create_solver<2,2>(2, use_specific);
break;
case 3:
- ms = create_solver<3,3>(3, gs_threshold, use_specific);
+ ms = create_solver<3,3>(3, use_specific);
break;
case 4:
- ms = create_solver<4,4>(4, gs_threshold, use_specific);
+ ms = create_solver<4,4>(4, use_specific);
break;
case 5:
- ms = create_solver<5,5>(5, gs_threshold, use_specific);
+ ms = create_solver<5,5>(5, use_specific);
break;
case 6:
- ms = create_solver<6,6>(6, gs_threshold, use_specific);
+ ms = create_solver<6,6>(6, use_specific);
break;
case 7:
- ms = create_solver<7,7>(7, gs_threshold, use_specific);
+ ms = create_solver<7,7>(7, use_specific);
break;
case 8:
- ms = create_solver<8,8>(8, gs_threshold, use_specific);
+ ms = create_solver<8,8>(8, use_specific);
break;
case 12:
- ms = create_solver<12,12>(12, gs_threshold, use_specific);
+ ms = create_solver<12,12>(12, use_specific);
+ break;
+ case 87:
+ ms = create_solver<87,87>(87, use_specific);
break;
default:
if (net_count <= 16)
{
- ms = create_solver<0,16>(net_count, gs_threshold, use_specific);
+ ms = create_solver<0,16>(net_count, use_specific);
}
else if (net_count <= 32)
{
- ms = create_solver<0,32>(net_count, gs_threshold, use_specific);
+ ms = create_solver<0,32>(net_count, use_specific);
}
else if (net_count <= 64)
{
- ms = create_solver<0,64>(net_count, gs_threshold, use_specific);
+ ms = create_solver<0,64>(net_count, use_specific);
}
else
+ if (net_count <= 128)
{
- netlist().error("Encountered netgroup with > 64 nets");
+ ms = create_solver<0,128>(net_count, use_specific);
+ }
+ else
+ {
+ netlist().error("Encountered netgroup with > 128 nets");
ms = NULL; /* tease compilers */
}
break;
}
- register_sub(pstring::sprintf("Solver_%" SIZETFMT,m_mat_solvers.size()), *ms);
+ register_sub(pstring::sprintf("Solver_%" SIZETFMT,SIZET_PRINTF(m_mat_solvers.size())), *ms);
ms->vsetup(groups[i]);
m_mat_solvers.add(ms);
netlist().log("Solver %s", ms->name().cstr());
- netlist().log(" # %d ==> %" SIZETFMT " nets", i, groups[i].size()); //, (*(*groups[i].first())->m_core_terms.first())->name().cstr());
+ netlist().log(" # %d ==> %" SIZETFMT " nets", i, SIZET_PRINTF(groups[i].size())); //, (*(*groups[i].first())->m_core_terms.first())->name().cstr());
netlist().log(" has %s elements", ms->is_dynamic() ? "dynamic" : "no dynamic");
netlist().log(" has %s elements", ms->is_timestep() ? "timestep" : "no timestep");
for (std::size_t j=0; j<groups[i].size(); j++)
{
- netlist().log("Net %" SIZETFMT ": %s", j, groups[i][j]->name().cstr());
- netlist_net_t *n = groups[i][j];
+ netlist().log("Net %" SIZETFMT ": %s", SIZET_PRINTF(j), groups[i][j]->name().cstr());
+ net_t *n = groups[i][j];
for (std::size_t k = 0; k < n->m_core_terms.size(); k++)
{
- const netlist_core_terminal_t *p = n->m_core_terms[k];
+ const core_terminal_t *p = n->m_core_terms[k];
netlist().log(" %s", p->name().cstr());
}
}
}
}
+
+NETLIB_NAMESPACE_DEVICES_END()
diff --git a/src/emu/netlist/analog/nld_solver.h b/src/emu/netlist/solver/nld_solver.h
index 7ab2f4a7733..682483dfde3 100644
--- a/src/emu/netlist/analog/nld_solver.h
+++ b/src/emu/netlist/solver/nld_solver.h
@@ -22,18 +22,20 @@
// ----------------------------------------------------------------------------------------
#define SOLVER(_name, _freq) \
- NET_REGISTER_DEV(solver, _name) \
+ NET_REGISTER_DEV(SOLVER, _name) \
PARAM(_name.FREQ, _freq)
// ----------------------------------------------------------------------------------------
// solver
// ----------------------------------------------------------------------------------------
+NETLIB_NAMESPACE_DEVICES_START()
+
class NETLIB_NAME(solver);
/* FIXME: these should become proper devices */
-struct netlist_solver_parameters_t
+struct solver_parameters_t
{
nl_double m_accuracy;
nl_double m_lte;
@@ -50,7 +52,7 @@ struct netlist_solver_parameters_t
class terms_t
{
- NETLIST_PREVENT_COPYING(terms_t)
+ P_PREVENT_COPYING(terms_t)
public:
ATTR_COLD terms_t() : m_railstart(0)
@@ -61,13 +63,16 @@ class terms_t
m_term.clear();
m_net_other.clear();
m_gt.clear();
+ m_go.clear();
+ m_Idr.clear();
+ m_other_curanalog.clear();
}
- ATTR_COLD void add(netlist_terminal_t *term, int net_other);
+ ATTR_COLD void add(terminal_t *term, int net_other, bool sorted);
ATTR_HOT inline unsigned count() { return m_term.size(); }
- ATTR_HOT inline netlist_terminal_t **terms() { return m_term.data(); }
+ ATTR_HOT inline terminal_t **terms() { return m_term.data(); }
ATTR_HOT inline int *net_other() { return m_net_other.data(); }
ATTR_HOT inline nl_double *gt() { return m_gt.data(); }
ATTR_HOT inline nl_double *go() { return m_go.data(); }
@@ -78,8 +83,10 @@ class terms_t
unsigned m_railstart;
+ plist_t<unsigned> m_nzrd; /* non zero right of the diagonal for elimination */
+ plist_t<unsigned> m_nz; /* all non zero for multiplication */
private:
- plist_t<netlist_terminal_t *> m_term;
+ plist_t<terminal_t *> m_term;
plist_t<int> m_net_other;
plist_t<nl_double> m_go;
plist_t<nl_double> m_gt;
@@ -87,11 +94,11 @@ private:
plist_t<nl_double *> m_other_curanalog;
};
-class netlist_matrix_solver_t : public netlist_device_t
+class matrix_solver_t : public device_t
{
public:
- typedef plist_t<netlist_matrix_solver_t *> list_t;
- typedef netlist_core_device_t::list_t dev_list_t;
+ typedef plist_t<matrix_solver_t *> list_t;
+ typedef core_device_t::list_t dev_list_t;
enum eSolverType
{
@@ -99,10 +106,10 @@ public:
GAUSS_SEIDEL
};
- ATTR_COLD netlist_matrix_solver_t(const eSolverType type, const netlist_solver_parameters_t &params);
- /* ATTR_COLD */ virtual ~netlist_matrix_solver_t();
+ ATTR_COLD matrix_solver_t(const eSolverType type, const solver_parameters_t *params);
+ virtual ~matrix_solver_t();
- /* ATTR_COLD */ virtual void vsetup(netlist_analog_net_t::list_t &nets) = 0;
+ virtual void vsetup(analog_net_t::list_t &nets) = 0;
template<class C>
void solve_base(C *p);
@@ -120,32 +127,53 @@ public:
/* netdevice functions */
ATTR_HOT virtual void update();
- /* ATTR_COLD */ virtual void start();
- /* ATTR_COLD */ virtual void reset();
+ virtual void start();
+ virtual void reset();
- ATTR_COLD int get_net_idx(netlist_net_t *net);
- /* ATTR_COLD */ virtual void log_stats() {};
+ ATTR_COLD int get_net_idx(net_t *net);
inline eSolverType type() const { return m_type; }
+ virtual void log_stats()
+ {
+ if (this->m_stat_calculations != 0 && this->m_params.m_log_stats)
+ {
+ this->netlist().log("==============================================");
+ this->netlist().log("Solver %s", this->name().cstr());
+ this->netlist().log(" ==> %d nets", (unsigned) this->m_nets.size()); //, (*(*groups[i].first())->m_core_terms.first())->name().cstr());
+ this->netlist().log(" has %s elements", this->is_dynamic() ? "dynamic" : "no dynamic");
+ this->netlist().log(" has %s elements", this->is_timestep() ? "timestep" : "no timestep");
+ this->netlist().log(" %6.3f average newton raphson loops", (double) this->m_stat_newton_raphson / (double) this->m_stat_vsolver_calls);
+ this->netlist().log(" %10d invocations (%6d Hz) %10d gs fails (%6.2f%%) %6.3f average",
+ this->m_stat_calculations,
+ this->m_stat_calculations * 10 / (int) (this->netlist().time().as_double() * 10.0),
+ this->m_iterative_fail,
+ 100.0 * (double) this->m_iterative_fail / (double) this->m_stat_calculations,
+ (double) this->m_iterative_total / (double) this->m_stat_calculations);
+ }
+ }
+
+
protected:
- ATTR_COLD void setup(netlist_analog_net_t::list_t &nets);
+ ATTR_COLD void setup(analog_net_t::list_t &nets);
ATTR_HOT void update_dynamic();
// should return next time step
ATTR_HOT virtual nl_double vsolve() = 0;
- /* ATTR_COLD */ virtual void add_term(int net_idx, netlist_terminal_t *term) = 0;
+ virtual void add_term(int net_idx, terminal_t *term) = 0;
- plist_t<netlist_analog_net_t *> m_nets;
- plist_t<netlist_analog_output_t *> m_inps;
+ plist_t<analog_net_t *> m_nets;
+ plist_t<analog_output_t *> m_inps;
int m_stat_calculations;
int m_stat_newton_raphson;
int m_stat_vsolver_calls;
+ int m_iterative_fail;
+ int m_iterative_total;
- const netlist_solver_parameters_t &m_params;
+ const solver_parameters_t &m_params;
ATTR_HOT inline nl_double current_timestep() { return m_cur_ts; }
private:
@@ -155,8 +183,8 @@ private:
dev_list_t m_step_devices;
dev_list_t m_dynamic_devices;
- netlist_logic_input_t m_fb_sync;
- netlist_logic_output_t m_Q_sync;
+ logic_input_t m_fb_sync;
+ logic_output_t m_Q_sync;
ATTR_HOT void step(const netlist_time delta);
@@ -167,13 +195,13 @@ private:
-class NETLIB_NAME(solver) : public netlist_device_t
+class NETLIB_NAME(solver) : public device_t
{
public:
NETLIB_NAME(solver)()
- : netlist_device_t() { }
+ : device_t() { }
- /* ATTR_COLD */ virtual ~NETLIB_NAME(solver)();
+ virtual ~NETLIB_NAME(solver)();
ATTR_COLD void post_start();
ATTR_COLD void stop();
@@ -186,34 +214,35 @@ protected:
ATTR_HOT void reset();
ATTR_HOT void update_param();
- netlist_logic_input_t m_fb_step;
- netlist_logic_output_t m_Q_step;
+ logic_input_t m_fb_step;
+ logic_output_t m_Q_step;
- netlist_param_double_t m_freq;
- netlist_param_double_t m_sync_delay;
- netlist_param_double_t m_accuracy;
- netlist_param_double_t m_gmin;
- netlist_param_double_t m_lte;
- netlist_param_double_t m_sor;
- netlist_param_logic_t m_dynamic;
- netlist_param_double_t m_min_timestep;
+ param_double_t m_freq;
+ param_double_t m_sync_delay;
+ param_double_t m_accuracy;
+ param_double_t m_gmin;
+ param_double_t m_lte;
+ param_double_t m_sor;
+ param_logic_t m_dynamic;
+ param_double_t m_min_timestep;
- netlist_param_int_t m_nr_loops;
- netlist_param_int_t m_gs_loops;
- netlist_param_int_t m_gs_threshold;
- netlist_param_int_t m_parallel;
+ param_str_t m_iterative_solver;
+ param_int_t m_nr_loops;
+ param_int_t m_gs_loops;
+ param_int_t m_gs_threshold;
+ param_int_t m_parallel;
- netlist_param_logic_t m_log_stats;
+ param_logic_t m_log_stats;
- netlist_matrix_solver_t::list_t m_mat_solvers;
+ matrix_solver_t::list_t m_mat_solvers;
private:
- netlist_solver_parameters_t m_params;
+ solver_parameters_t m_params;
template <int m_N, int _storage_N>
- netlist_matrix_solver_t *create_solver(int size, int gs_threshold, bool use_specific);
+ matrix_solver_t *create_solver(int size, bool use_specific);
};
-
+NETLIB_NAMESPACE_DEVICES_END()
#endif /* NLD_SOLVER_H_ */
diff --git a/src/emu/netlist/solver/vector_base.h b/src/emu/netlist/solver/vector_base.h
new file mode 100644
index 00000000000..c180b080338
--- /dev/null
+++ b/src/emu/netlist/solver/vector_base.h
@@ -0,0 +1,108 @@
+// license:GPL-2.0+
+// copyright-holders:Couriersud
+/*
+ * vector_base.h
+ *
+ * Base vector operations
+ *
+ */
+
+#ifndef VECTOR_BASE_H_
+#define VECTOR_BASE_H_
+
+#include <algorithm>
+#include "../plib/pconfig.h"
+
+#if 0
+template <unsigned _storage_N>
+struct pvector
+{
+ pvector(unsigned size)
+ : m_N(size) { }
+
+ unsigned size() {
+ if (_storage_N)
+ }
+
+ double m_V[_storage_N];
+private:
+ unsigned m_N;
+};
+#endif
+
+#if !defined(__clang__) && !defined(_MSC_VER) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 6))
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
+#endif
+
+inline void vec_set (const std::size_t n, const double &scalar, double * RESTRICT result)
+{
+ for ( std::size_t i = 0; i < n; i++ )
+ result[i] = scalar;
+}
+inline double vecmult (const std::size_t n, const double * RESTRICT a1, const double * RESTRICT a2 )
+{
+
+ double value = 0.0;
+ for ( std::size_t i = 0; i < n; i++ )
+ value = value + a1[i] * a2[i];
+ return value;
+}
+
+
+inline double vecmult2 (const std::size_t n, const double *a1)
+{
+ double value = 0.0;
+ for ( std::size_t i = 0; i < n; i++ )
+ {
+ const double temp = a1[i];
+ value = value + temp * temp;
+ }
+ return value;
+}
+
+inline void vec_mult_scalar (const std::size_t n, const double * RESTRICT v, const double scalar, double * RESTRICT result)
+{
+ for ( std::size_t i = 0; i < n; i++ )
+ {
+ result[i] = scalar * v[i];
+ }
+}
+
+inline void vec_add_mult_scalar (const std::size_t n, const double * RESTRICT v, const double scalar, double * RESTRICT result)
+{
+ for ( std::size_t i = 0; i < n; i++ )
+ result[i] += scalar * v[i];
+}
+
+inline void vec_add_ip(const std::size_t n, const double * RESTRICT v, double * RESTRICT result)
+{
+ for ( std::size_t i = 0; i < n; i++ )
+ result[i] += v[i];
+}
+
+inline void vec_sub(const std::size_t n, const double * RESTRICT v1, const double * RESTRICT v2, double * RESTRICT result)
+{
+ for ( std::size_t i = 0; i < n; i++ )
+ result[i] = v1[i] - v2[i];
+}
+
+inline void vec_scale (const std::size_t n, double * RESTRICT v, const double scalar)
+{
+ for ( std::size_t i = 0; i < n; i++ )
+ v[i] = scalar * v[i];
+}
+
+inline double vec_maxabs(const std::size_t n, const double * RESTRICT v)
+{
+ double ret = 0.0;
+ for ( std::size_t i = 0; i < n; i++ )
+ ret = std::max(ret, std::abs(v[i]));
+
+ return ret;
+}
+#if !defined(__clang__) && !defined(_MSC_VER) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 6))
+#pragma GCC diagnostic pop
+#endif
+
+#endif /* MAT_CR_H_ */
diff --git a/src/emu/netlist/tools/nl_convert.c b/src/emu/netlist/tools/nl_convert.c
new file mode 100644
index 00000000000..23e5c537b12
--- /dev/null
+++ b/src/emu/netlist/tools/nl_convert.c
@@ -0,0 +1,457 @@
+// license:GPL-2.0+
+// copyright-holders:Couriersud
+/*
+ * nl_convert.c
+ *
+ */
+
+#include <algorithm>
+#include <cstdio>
+#include <cmath>
+#include "nl_convert.h"
+
+template<typename Class>
+static plist_t<int> bubble(const pnamedlist_t<Class *> &sl)
+{
+ plist_t<int> ret(sl.size());
+ for (unsigned i=0; i<sl.size(); i++)
+ ret[i] = i;
+
+ for(unsigned i=0; i < sl.size(); i++)
+ {
+ for(unsigned j=i+1; j < sl.size(); j++)
+ {
+ if(sl[ret[i]]->name() > sl[ret[j]]->name())
+ {
+ std::swap(ret[i], ret[j]);
+ }
+ }
+ }
+ return ret;
+}
+
+/*-------------------------------------------------
+ convert - convert a spice netlist
+-------------------------------------------------*/
+
+
+void nl_convert_base_t::out(const char *format, ...)
+{
+ va_list ap;
+ va_start(ap, format);
+ m_buf += pstring(format).vprintf(ap);
+ va_end(ap);
+}
+
+void nl_convert_base_t::add_pin_alias(const pstring &devname, const pstring &name, const pstring &alias)
+{
+ m_pins.add(palloc(pin_alias_t(devname + "." + name, devname + "." + alias)), false);
+}
+
+void nl_convert_base_t::add_ext_alias(const pstring &alias)
+{
+ m_ext_alias.add(alias);
+}
+
+void nl_convert_base_t::add_device(const pstring &atype, const pstring &aname, const pstring &amodel)
+{
+ m_devs.add(palloc(dev_t(atype, aname, amodel)), false);
+}
+void nl_convert_base_t::add_device(const pstring &atype, const pstring &aname, double aval)
+{
+ m_devs.add(palloc(dev_t(atype, aname, aval)), false);
+}
+void nl_convert_base_t::add_device(const pstring &atype, const pstring &aname)
+{
+ m_devs.add(palloc(dev_t(atype, aname)), false);
+}
+
+void nl_convert_base_t::add_term(pstring netname, pstring termname)
+{
+ net_t * net = m_nets.find_by_name(netname);
+ if (net == NULL)
+ {
+ net = palloc(net_t(netname));
+ m_nets.add(net, false);
+ }
+
+ /* if there is a pin alias, translate ... */
+ pin_alias_t *alias = m_pins.find_by_name(termname);
+
+ if (alias != NULL)
+ net->terminals().add(alias->alias());
+ else
+ net->terminals().add(termname);
+}
+
+void nl_convert_base_t::dump_nl()
+{
+ for (std::size_t i=0; i<m_ext_alias.size(); i++)
+ {
+ net_t *net = m_nets.find_by_name(m_ext_alias[i]);
+ // use the first terminal ...
+ out("ALIAS(%s, %s)\n", m_ext_alias[i].cstr(), net->terminals()[0].cstr());
+ // if the aliased net only has this one terminal connected ==> don't dump
+ if (net->terminals().size() == 1)
+ net->set_no_export();
+ }
+ plist_t<int> sorted = bubble(m_devs);
+ for (std::size_t i=0; i<m_devs.size(); i++)
+ {
+ std::size_t j = sorted[i];
+
+ if (m_devs[j]->has_value())
+ out("%s(%s, %s)\n", m_devs[j]->type().cstr(),
+ m_devs[j]->name().cstr(), get_nl_val(m_devs[j]->value()).cstr());
+ else if (m_devs[j]->has_model())
+ out("%s(%s, \"%s\")\n", m_devs[j]->type().cstr(),
+ m_devs[j]->name().cstr(), m_devs[j]->model().cstr());
+ else
+ out("%s(%s)\n", m_devs[j]->type().cstr(),
+ m_devs[j]->name().cstr());
+ }
+ // print nets
+ for (std::size_t i=0; i<m_nets.size(); i++)
+ {
+ net_t * net = m_nets[i];
+ if (!net->is_no_export())
+ {
+ //printf("Net %s\n", net->name().cstr());
+ out("NET_C(%s", net->terminals()[0].cstr() );
+ for (std::size_t j=1; j<net->terminals().size(); j++)
+ {
+ out(", %s", net->terminals()[j].cstr() );
+ }
+ out(")\n");
+ }
+ }
+ m_devs.clear_and_free();
+ m_nets.clear_and_free();
+ m_pins.clear_and_free();
+ m_ext_alias.clear();
+}
+
+const pstring nl_convert_base_t::get_nl_val(const double val)
+{
+ {
+ int i = 0;
+ while (m_units[i].m_unit != "-" )
+ {
+ if (m_units[i].m_mult <= std::abs(val))
+ break;
+ i++;
+ }
+ return pstring::sprintf(m_units[i].m_func.cstr(), val / m_units[i].m_mult);
+ }
+}
+double nl_convert_base_t::get_sp_unit(const pstring &unit)
+{
+ int i = 0;
+ while (m_units[i].m_unit != "-")
+ {
+ if (m_units[i].m_unit == unit)
+ return m_units[i].m_mult;
+ i++;
+ }
+ fprintf(stderr, "Unit %s unknown\n", unit.cstr());
+ return 0.0;
+}
+
+double nl_convert_base_t::get_sp_val(const pstring &sin)
+{
+ int p = sin.len() - 1;
+ while (p>=0 && (sin.substr(p,1) < "0" || sin.substr(p,1) > "9"))
+ p--;
+ pstring val = sin.substr(0,p + 1);
+ pstring unit = sin.substr(p + 1);
+
+ double ret = get_sp_unit(unit) * val.as_double();
+ //printf("<%s> %s %d ==> %f\n", sin.cstr(), unit.cstr(), p, ret);
+ return ret;
+}
+
+nl_convert_base_t::unit_t nl_convert_base_t::m_units[] = {
+ {"T", "", 1.0e12 },
+ {"G", "", 1.0e9 },
+ {"MEG", "RES_M(%g)", 1.0e6 },
+ {"k", "RES_K(%g)", 1.0e3 }, /* eagle */
+ {"K", "RES_K(%g)", 1.0e3 },
+ {"", "%g", 1.0e0 },
+ {"M", "CAP_M(%g)", 1.0e-3 },
+ {"u", "CAP_U(%g)", 1.0e-6 }, /* eagle */
+ {"U", "CAP_U(%g)", 1.0e-6 },
+ {"μ", "CAP_U(%g)", 1.0e-6 },
+ {"N", "CAP_N(%g)", 1.0e-9 },
+ {"P", "CAP_P(%g)", 1.0e-12},
+ {"F", "%ge-15", 1.0e-15},
+
+ {"MIL", "%e", 25.4e-6},
+
+ {"-", "%g", 1.0 }
+};
+
+
+void nl_convert_spice_t::convert(const pstring &contents)
+{
+ pstring_list_t spnl(contents, "\n");
+
+ // Add gnd net
+
+ // FIXME: Parameter
+ out("NETLIST_START(dummy)\n");
+ add_term("0", "GND");
+
+ pstring line = "";
+
+ for (std::size_t i=0; i < spnl.size(); i++)
+ {
+ // Basic preprocessing
+ pstring inl = spnl[i].trim().ucase();
+ if (inl.startsWith("+"))
+ line = line + inl.substr(1);
+ else
+ {
+ process_line(line);
+ line = inl;
+ }
+ }
+ process_line(line);
+ dump_nl();
+ // FIXME: Parameter
+ out("NETLIST_END()\n");
+}
+
+void nl_convert_spice_t::process_line(const pstring &line)
+{
+ if (line != "")
+ {
+ pstring_list_t tt(line, " ", true);
+ double val = 0.0;
+ switch (tt[0].cstr()[0])
+ {
+ case ';':
+ out("// %s\n", line.substr(1).cstr());
+ break;
+ case '*':
+ out("// %s\n", line.substr(1).cstr());
+ break;
+ case '.':
+ if (tt[0].equals(".SUBCKT"))
+ {
+ out("NETLIST_START(%s)\n", tt[1].cstr());
+ for (std::size_t i=2; i<tt.size(); i++)
+ add_ext_alias(tt[i]);
+ }
+ else if (tt[0].equals(".ENDS"))
+ {
+ dump_nl();
+ out("NETLIST_END()\n");
+ }
+ else
+ out("// %s\n", line.cstr());
+ break;
+ case 'Q':
+ {
+ bool cerr = false;
+ /* check for fourth terminal ... should be numeric net
+ * including "0" or start with "N" (ltspice)
+ */
+ ATTR_UNUSED int nval =tt[4].as_long(&cerr);
+ pstring model;
+ pstring pins ="CBE";
+
+ if ((!cerr || tt[4].startsWith("N")) && tt.size() > 5)
+ model = tt[5];
+ else
+ model = tt[4];
+ pstring_list_t m(model,"{");
+ if (m.size() == 2)
+ {
+ if (m[1].len() != 4)
+ fprintf(stderr, "error with model desc %s\n", model.cstr());
+ pins = m[1].left(3);
+ }
+ add_device("QBJT_EB", tt[0], m[0]);
+ add_term(tt[1], tt[0] + "." + pins[0]);
+ add_term(tt[2], tt[0] + "." + pins[1]);
+ add_term(tt[3], tt[0] + "." + pins[2]);
+ }
+ break;
+ case 'R':
+ if (tt[0].startsWith("RV"))
+ {
+ val = get_sp_val(tt[4]);
+ add_device("POT", tt[0], val);
+ add_term(tt[1], tt[0] + ".1");
+ add_term(tt[2], tt[0] + ".2");
+ add_term(tt[3], tt[0] + ".3");
+ }
+ else
+ {
+ val = get_sp_val(tt[3]);
+ add_device("RES", tt[0], val);
+ add_term(tt[1], tt[0] + ".1");
+ add_term(tt[2], tt[0] + ".2");
+ }
+ break;
+ case 'C':
+ val = get_sp_val(tt[3]);
+ add_device("CAP", tt[0], val);
+ add_term(tt[1], tt[0] + ".1");
+ add_term(tt[2], tt[0] + ".2");
+ break;
+ case 'V':
+ // just simple Voltage sources ....
+ if (tt[2].equals("0"))
+ {
+ val = get_sp_val(tt[3]);
+ add_device("ANALOG_INPUT", tt[0], val);
+ add_term(tt[1], tt[0] + ".Q");
+ //add_term(tt[2], tt[0] + ".2");
+ }
+ else
+ fprintf(stderr, "Voltage Source %s not connected to GND\n", tt[0].cstr());
+ break;
+ case 'I': // Input pin special notation
+ {
+ val = get_sp_val(tt[2]);
+ add_device("ANALOG_INPUT", tt[0], val);
+ add_term(tt[1], tt[0] + ".Q");
+ }
+ break;
+ case 'D':
+ add_device("DIODE", tt[0], tt[3]);
+ /* FIXME ==> does Kicad use different notation from LTSPICE */
+ add_term(tt[1], tt[0] + ".K");
+ add_term(tt[2], tt[0] + ".A");
+ break;
+ case 'U':
+ case 'X':
+ {
+ // FIXME: specific code for KICAD exports
+ // last element is component type
+ // FIXME: Parameter
+
+ pstring xname = tt[0].replace(".", "_");
+ pstring tname = "TTL_" + tt[tt.size()-1] + "_DIP";
+ add_device(tname, xname);
+ for (std::size_t i=1; i < tt.size() - 1; i++)
+ {
+ pstring term = pstring::sprintf("%s.%" SIZETFMT, xname.cstr(), SIZET_PRINTF(i));
+ add_term(tt[i], term);
+ }
+ break;
+ }
+ default:
+ out("// IGNORED %s: %s\n", tt[0].cstr(), line.cstr());
+ }
+ }
+}
+
+
+void nl_convert_eagle_t::convert(const pstring &contents)
+{
+ eagle_tokenizer tok(*this);
+ tok.reset(contents.cstr());
+
+ out("NETLIST_START(dummy)\n");
+ add_term("GND", "GND");
+ add_term("VCC", "VCC");
+ eagle_tokenizer::token_t token = tok.get_token();
+ while (true)
+ {
+ if (token.is_type(eagle_tokenizer::ENDOFFILE))
+ {
+ dump_nl();
+ // FIXME: Parameter
+ out("NETLIST_END()\n");
+ return;
+ }
+ else if (token.is(tok.m_tok_SEMICOLON))
+ {
+ /* ignore empty statements */
+ token = tok.get_token();
+ }
+ else if (token.is(tok.m_tok_ADD))
+ {
+ pstring name = tok.get_string();
+ /* skip to semicolon */
+ do
+ {
+ token = tok.get_token();
+ } while (!token.is(tok.m_tok_SEMICOLON));
+ token = tok.get_token();
+ pstring sval = "";
+ if (token.is(tok.m_tok_VALUE))
+ {
+ pstring vname = tok.get_string();
+ sval = tok.get_string();
+ tok.require_token(tok.m_tok_SEMICOLON);
+ token = tok.get_token();
+ }
+ switch (name.cstr()[0])
+ {
+ case 'Q':
+ {
+ add_device("QBJT", name, sval);
+ }
+ break;
+ case 'R':
+ {
+ double val = get_sp_val(sval);
+ add_device("RES", name, val);
+ }
+ break;
+ case 'C':
+ {
+ double val = get_sp_val(sval);
+ add_device("CAP", name, val);
+ }
+ break;
+ case 'P':
+ if (sval.ucase() == "HIGH")
+ add_device("TTL_INPUT", name, 1);
+ else if (sval.ucase() == "LOW")
+ add_device("TTL_INPUT", name, 0);
+ else
+ add_device("ANALOG_INPUT", name, sval.as_double());
+ add_pin_alias(name, "1", "Q");
+ break;
+ case 'D':
+ /* Pin 1 = Anode, Pin 2 = Cathode */
+ add_device("DIODE", name, sval);
+ add_pin_alias(name, "1", "A");
+ add_pin_alias(name, "2", "K");
+ break;
+ case 'U':
+ case 'X':
+ {
+ pstring tname = "TTL_" + sval + "_DIP";
+ add_device(tname, name);
+ break;
+ }
+ default:
+ tok.error("// IGNORED %s\n", name.cstr());
+ }
+
+ }
+ else if (token.is(tok.m_tok_SIGNAL))
+ {
+ pstring netname = tok.get_string();
+ token = tok.get_token();
+ while (!token.is(tok.m_tok_SEMICOLON))
+ {
+ /* fixme: should check for string */
+ pstring devname = token.str();
+ pstring pin = tok.get_string();
+ add_term(netname, devname + "." + pin);
+ token = tok.get_token(); }
+ }
+ else
+ {
+ out("Unexpected %s\n", token.str().cstr());
+ return;
+ }
+ }
+
+}
diff --git a/src/emu/netlist/tools/nl_convert.h b/src/emu/netlist/tools/nl_convert.h
index e4726b33314..d2e2d238718 100644
--- a/src/emu/netlist/tools/nl_convert.h
+++ b/src/emu/netlist/tools/nl_convert.h
@@ -10,10 +10,9 @@
#ifndef NL_CONVERT_H_
#define NL_CONVERT_H_
-#include <cstddef>
-
#include "plib/pstring.h"
#include "plib/plists.h"
+#include "plib/pparser.h"
/*-------------------------------------------------
convert - convert a spice netlist
@@ -26,19 +25,39 @@ public:
nl_convert_base_t() {};
virtual ~nl_convert_base_t()
{
- nets.clear_and_free();
- devs.clear_and_free();
- pins.clear_and_free();
+ m_nets.clear_and_free();
+ m_devs.clear_and_free();
+ m_pins.clear_and_free();
}
const pstringbuffer &result() { return m_buf; }
virtual void convert(const pstring &contents) = 0;
protected:
- struct sp_net_t
+
+ void out(const char *format, ...) ATTR_PRINTF(2,3);
+ void add_pin_alias(const pstring &devname, const pstring &name, const pstring &alias);
+
+ void add_ext_alias(const pstring &alias);
+
+ void add_device(const pstring &atype, const pstring &aname, const pstring &amodel);
+ void add_device(const pstring &atype, const pstring &aname, double aval);
+ void add_device(const pstring &atype, const pstring &aname);
+
+ void add_term(pstring netname, pstring termname);
+
+ void dump_nl();
+
+ const pstring get_nl_val(const double val);
+ double get_sp_unit(const pstring &unit);
+
+ double get_sp_val(const pstring &sin);
+
+private:
+ struct net_t
{
public:
- sp_net_t(const pstring &aname)
+ net_t(const pstring &aname)
: m_name(aname), m_no_export(false) {}
const pstring &name() { return m_name;}
@@ -52,18 +71,18 @@ protected:
pstring_list_t m_terminals;
};
- struct sp_dev_t
+ struct dev_t
{
public:
- sp_dev_t(const pstring &atype, const pstring &aname, const pstring &amodel)
+ dev_t(const pstring &atype, const pstring &aname, const pstring &amodel)
: m_type(atype), m_name(aname), m_model(amodel), m_val(0), m_has_val(false)
{}
- sp_dev_t(const pstring &atype, const pstring &aname, double aval)
+ dev_t(const pstring &atype, const pstring &aname, double aval)
: m_type(atype), m_name(aname), m_model(""), m_val(aval), m_has_val(true)
{}
- sp_dev_t(const pstring &atype, const pstring &aname)
+ dev_t(const pstring &atype, const pstring &aname)
: m_type(atype), m_name(aname), m_model(""), m_val(0.0), m_has_val(false)
{}
@@ -83,16 +102,16 @@ protected:
bool m_has_val;
};
- struct sp_unit {
- pstring sp_unit;
- pstring nl_func;
- double mult;
+ struct unit_t {
+ pstring m_unit;
+ pstring m_func;
+ double m_mult;
};
- struct sp_pin_alias_t
+ struct pin_alias_t
{
public:
- sp_pin_alias_t(const pstring &name, const pstring &alias)
+ pin_alias_t(const pstring &name, const pstring &alias)
: m_name(name), m_alias(alias)
{}
const pstring &name() { return m_name; }
@@ -102,146 +121,17 @@ protected:
pstring m_alias;
};
- void add_term(pstring netname, pstring termname)
- {
- sp_net_t * net = nets.find_by_name(netname);
- if (net == NULL)
- {
- net = palloc(sp_net_t, netname);
- nets.add(net, false);
- }
-
- /* if there is a pin alias, translate ... */
- sp_pin_alias_t *alias = pins.find_by_name(termname);
-
- if (alias != NULL)
- net->terminals().add(alias->alias());
- else
- net->terminals().add(termname);
- }
-
- const pstring get_nl_val(const double val)
- {
- {
- int i = 0;
- while (m_sp_units[i].sp_unit != "-" )
- {
- if (m_sp_units[i].mult <= nl_math::abs(val))
- break;
- i++;
- }
- return pstring::sprintf(m_sp_units[i].nl_func.cstr(), val / m_sp_units[i].mult);
- }
- }
- double get_sp_unit(const pstring &unit)
- {
- int i = 0;
- while (m_sp_units[i].sp_unit != "-")
- {
- if (m_sp_units[i].sp_unit == unit)
- return m_sp_units[i].mult;
- i++;
- }
- fprintf(stderr, "Unit %s unknown\n", unit.cstr());
- return 0.0;
- }
-
- double get_sp_val(const pstring &sin)
- {
- int p = sin.len() - 1;
- while (p>=0 && (sin.substr(p,1) < "0" || sin.substr(p,1) > "9"))
- p--;
- pstring val = sin.substr(0,p + 1);
- pstring unit = sin.substr(p + 1);
-
- double ret = get_sp_unit(unit) * val.as_double();
- //printf("<%s> %s %d ==> %f\n", sin.cstr(), unit.cstr(), p, ret);
- return ret;
- }
-
- void dump_nl()
- {
- for (int i=0; i<alias.size(); i++)
- {
- sp_net_t *net = nets.find_by_name(alias[i]);
- // use the first terminal ...
- out("ALIAS(%s, %s)\n", alias[i].cstr(), net->terminals()[0].cstr());
- // if the aliased net only has this one terminal connected ==> don't dump
- if (net->terminals().size() == 1)
- net->set_no_export();
- }
- for (int i=0; i<devs.size(); i++)
- {
- if (devs[i]->has_value())
- out("%s(%s, %s)\n", devs[i]->type().cstr(),
- devs[i]->name().cstr(), get_nl_val(devs[i]->value()).cstr());
- else if (devs[i]->has_model())
- out("%s(%s, \"%s\")\n", devs[i]->type().cstr(),
- devs[i]->name().cstr(), devs[i]->model().cstr());
- else
- out("%s(%s)\n", devs[i]->type().cstr(),
- devs[i]->name().cstr());
- }
- // print nets
- for (int i=0; i<nets.size(); i++)
- {
- sp_net_t * net = nets[i];
- if (!net->is_no_export())
- {
- //printf("Net %s\n", net->name().cstr());
- out("NET_C(%s", net->terminals()[0].cstr() );
- for (int j=1; j<net->terminals().size(); j++)
- {
- out(", %s", net->terminals()[j].cstr() );
- }
- out(")\n");
- }
- }
- devs.clear_and_free();
- nets.clear_and_free();
- pins.clear_and_free();
- alias.clear();
- }
-
- void out(const char *format, ...) ATTR_PRINTF(2,3)
- {
- va_list ap;
- va_start(ap, format);
- m_buf += pstring(format).vprintf(ap);
- va_end(ap);
- }
-
- pnamedlist_t<sp_net_t *> nets;
- pnamedlist_t<sp_dev_t *> devs;
- pnamedlist_t<sp_pin_alias_t *> pins;
- plist_t<pstring> alias;
-
private:
pstringbuffer m_buf;
- static sp_unit m_sp_units[];
+ pnamedlist_t<dev_t *> m_devs;
+ pnamedlist_t<net_t *> m_nets;
+ plist_t<pstring> m_ext_alias;
+ pnamedlist_t<pin_alias_t *> m_pins;
-};
+ static unit_t m_units[];
-nl_convert_base_t::sp_unit nl_convert_base_t::m_sp_units[] = {
- {"T", "", 1.0e12 },
- {"G", "", 1.0e9 },
- {"MEG", "RES_M(%g)", 1.0e6 },
- {"k", "RES_K(%g)", 1.0e3 }, /* eagle */
- {"K", "RES_K(%g)", 1.0e3 },
- {"", "%g", 1.0e0 },
- {"M", "CAP_M(%g)", 1.0e-3 },
- {"u", "CAP_U(%g)", 1.0e-6 }, /* eagle */
- {"U", "CAP_U(%g)", 1.0e-6 },
- {"µ", "CAP_U(%g)", 1.0e-6 },
- {"N", "CAP_N(%g)", 1.0e-9 },
- {"P", "CAP_P(%g)", 1.0e-12},
- {"F", "%ge-15", 1.0e-15},
-
- {"MIL", "%e", 25.4e-6},
-
- {"-", "%g", 1.0 }
};
class nl_convert_spice_t : public nl_convert_base_t
@@ -253,137 +143,11 @@ public:
{
}
- void convert(const pstring &contents)
- {
- pstring_list_t spnl(contents, "\n");
-
- // Add gnd net
-
- // FIXME: Parameter
- out("NETLIST_START(dummy)\n");
- nets.add(palloc(sp_net_t, "0"), false);
- nets[0]->terminals().add("GND");
-
- pstring line = "";
-
- for (std::size_t i=0; i < spnl.size(); i++)
- {
- // Basic preprocessing
- pstring inl = spnl[i].trim().ucase();
- if (inl.startsWith("+"))
- line = line + inl.substr(1);
- else
- {
- process_line(line);
- line = inl;
- }
- }
- process_line(line);
- dump_nl();
- // FIXME: Parameter
- out("NETLIST_END()\n");
- }
+ void convert(const pstring &contents);
protected:
- void process_line(const pstring &line)
- {
- if (line != "")
- {
- pstring_list_t tt(line, " ", true);
- double val = 0.0;
- switch (tt[0].cstr()[0])
- {
- case ';':
- out("// %s\n", line.substr(1).cstr());
- break;
- case '*':
- out("// %s\n", line.substr(1).cstr());
- break;
- case '.':
- if (tt[0].equals(".SUBCKT"))
- {
- out("NETLIST_START(%s)\n", tt[1].cstr());
- for (int i=2; i<tt.size(); i++)
- alias.add(tt[i]);
- }
- else if (tt[0].equals(".ENDS"))
- {
- dump_nl();
- out("NETLIST_END()\n");
- }
- else
- out("// %s\n", line.cstr());
- break;
- case 'Q':
- {
- bool cerr = false;
- /* check for fourth terminal ... should be numeric net
- * including "0" or start with "N" (ltspice)
- */
- // FIXME: we need a is_long method ..
- ATTR_UNUSED int nval =tt[4].as_long(&cerr);
- if ((!cerr || tt[4].startsWith("N")) && tt.size() > 5)
- devs.add(palloc(sp_dev_t, "QBJT", tt[0], tt[5]), false);
- else
- devs.add(palloc(sp_dev_t, "QBJT", tt[0], tt[4]), false);
- add_term(tt[1], tt[0] + ".C");
- add_term(tt[2], tt[0] + ".B");
- add_term(tt[3], tt[0] + ".E");
- }
- break;
- case 'R':
- val = get_sp_val(tt[3]);
- devs.add(palloc(sp_dev_t, "RES", tt[0], val), false);
- add_term(tt[1], tt[0] + ".1");
- add_term(tt[2], tt[0] + ".2");
- break;
- case 'C':
- val = get_sp_val(tt[3]);
- devs.add(palloc(sp_dev_t, "CAP", tt[0], val), false);
- add_term(tt[1], tt[0] + ".1");
- add_term(tt[2], tt[0] + ".2");
- break;
- case 'V':
- // just simple Voltage sources ....
- if (tt[2].equals("0"))
- {
- val = get_sp_val(tt[3]);
- devs.add(palloc(sp_dev_t, "ANALOG_INPUT", tt[0], val), false);
- add_term(tt[1], tt[0] + ".Q");
- //add_term(tt[2], tt[0] + ".2");
- }
- else
- fprintf(stderr, "Voltage Source %s not connected to GND\n", tt[0].cstr());
- break;
- case 'D':
- // FIXME: Rewrite resistor value
- devs.add(palloc(sp_dev_t, "DIODE", tt[0], tt[3]), false);
- add_term(tt[1], tt[0] + ".A");
- add_term(tt[2], tt[0] + ".K");
- break;
- case 'U':
- case 'X':
- {
- // FIXME: specific code for KICAD exports
- // last element is component type
- // FIXME: Parameter
-
- pstring xname = tt[0].replace(".", "_");
- pstring tname = "TTL_" + tt[tt.size()-1] + "_DIP";
- devs.add(palloc(sp_dev_t, tname, xname), false);
- for (int i=1; i < tt.size() - 1; i++)
- {
- pstring term = pstring::sprintf("%s.%d", xname.cstr(), i);
- add_term(tt[i], term);
- }
- break;
- }
- default:
- out("// IGNORED %s: %s\n", tt[0].cstr(), line.cstr());
- }
- }
- }
+ void process_line(const pstring &line);
private:
@@ -400,7 +164,6 @@ public:
class eagle_tokenizer : public ptokenizer
{
-
public:
eagle_tokenizer(nl_convert_eagle_t &convert)
: ptokenizer(), m_convert(convert)
@@ -435,7 +198,7 @@ public:
void verror(pstring msg, int line_num, pstring line)
{
- m_convert.out("abc");
+ m_convert.out("%s (line %d): %s\n", msg.cstr(), line_num, line.cstr());
}
@@ -443,133 +206,7 @@ public:
nl_convert_eagle_t &m_convert;
};
- void convert(const pstring &contents)
- {
- eagle_tokenizer tok(*this);
- tok.reset(contents.cstr());
-
- out("NETLIST_START(dummy)\n");
- nets.add(palloc(sp_net_t, "GND"), false);
- nets[0]->terminals().add("GND");
- nets.add(palloc(sp_net_t, "VCC"), false);
- nets[1]->terminals().add("VCC");
- eagle_tokenizer::token_t token = tok.get_token();
- while (true)
- {
- if (token.is_type(eagle_tokenizer::ENDOFFILE))
- {
- dump_nl();
- // FIXME: Parameter
- out("NETLIST_END()\n");
- return;
- }
- else if (token.is(tok.m_tok_SEMICOLON))
- {
- /* ignore empty statements */
- token = tok.get_token();
- }
- else if (token.is(tok.m_tok_ADD))
- {
- pstring name = tok.get_string();
- /* skip to semicolon */
- do
- {
- token = tok.get_token();
- } while (!token.is(tok.m_tok_SEMICOLON));
- token = tok.get_token();
- pstring sval = "";
- if (token.is(tok.m_tok_VALUE))
- {
- pstring vname = tok.get_string();
- sval = tok.get_string();
- tok.require_token(tok.m_tok_SEMICOLON);
- token = tok.get_token();
- }
- switch (name.cstr()[0])
- {
- case 'Q':
- {
- devs.add(palloc(sp_dev_t, "QBJT", name, sval), false);
-#if 0
- if ((!cerr || tt[4].startsWith("N")) && tt.size() > 5)
- devs.add(palloc(sp_dev_t, "QBJT", tt[0], tt[5]), false);
- else
- devs.add(palloc(sp_dev_t, "QBJT", tt[0], tt[4]), false);
-#endif
- }
- break;
- case 'R':
- {
- double val = get_sp_val(sval);
- devs.add(palloc(sp_dev_t, "RES", name, val), false);
- }
- break;
- case 'C':
- {
- double val = get_sp_val(sval);
- devs.add(palloc(sp_dev_t, "CAP", name, val), false);
- }
- break;
- case 'P':
- if (sval.ucase() == "HIGH")
- devs.add(palloc(sp_dev_t, "TTL_INPUT", name, 1), false);
- else if (sval.ucase() == "LOW")
- devs.add(palloc(sp_dev_t, "TTL_INPUT", name, 0), false);
- else
- devs.add(palloc(sp_dev_t, "ANALOG_INPUT", name, sval.as_double()), false);
- pins.add(palloc(sp_pin_alias_t, name + ".1", name + ".Q"), false);
-
-#if 0
- // just simple Voltage sources ....
- if (tt[2].equals("0"))
- {
- val = get_sp_val(tt[3]);
- devs.add(palloc(sp_dev_t, "ANALOG_INPUT", tt[0], val), false);
- add_term(tt[1], tt[0] + ".Q");
- //add_term(tt[2], tt[0] + ".2");
- }
- else
- fprintf(stderr, "Voltage Source %s not connected to GND\n", tt[0].cstr());
-#endif
- break;
- case 'D':
- /* Pin 1 = Anode, Pin 2 = Cathode */
- devs.add(palloc(sp_dev_t, "DIODE", name, sval), false);
- pins.add(palloc(sp_pin_alias_t, name + ".1", name + ".A"), false);
- pins.add(palloc(sp_pin_alias_t, name + ".2", name + ".K"), false);
- break;
- case 'U':
- case 'X':
- {
- pstring tname = "TTL_" + sval + "_DIP";
- devs.add(palloc(sp_dev_t, tname, name), false);
- break;
- }
- default:
- tok.error("// IGNORED %s\n", name.cstr());
- }
-
- }
- else if (token.is(tok.m_tok_SIGNAL))
- {
- pstring netname = tok.get_string();
- token = tok.get_token();
- while (!token.is(tok.m_tok_SEMICOLON))
- {
- /* fixme: should check for string */
- pstring devname = token.str();
- pstring pin = tok.get_string();
- add_term(netname, devname + "." + pin);
- token = tok.get_token(); }
- }
- else
- {
- out("Unexpected %s\n", token.str().cstr());
- return;
- }
- }
-
- }
+ void convert(const pstring &contents);
protected:
diff --git a/src/emu/profiler.h b/src/emu/profiler.h
index 25cd2b4d7ce..ceb1afee877 100644
--- a/src/emu/profiler.h
+++ b/src/emu/profiler.h
@@ -71,7 +71,7 @@ enum profile_type
PROFILER_IDLE,
PROFILER_TOTAL
};
-DECLARE_ENUM_OPERATORS(profile_type);
+DECLARE_ENUM_OPERATORS(profile_type)
diff --git a/src/emu/rendersw.inc b/src/emu/rendersw.inc
index aefe09183a1..3ab326a5459 100644
--- a/src/emu/rendersw.inc
+++ b/src/emu/rendersw.inc
@@ -149,7 +149,7 @@ private:
UINT32 pix01 = palbase[texbase[u1]];
UINT32 pix10 = palbase[texbase[v1]];
UINT32 pix11 = palbase[texbase[u1 + v1]];
- return rgb_bilinear_filter(pix00, pix01, pix10, pix11, curu >> 8, curv >> 8);
+ return rgbaint_t::bilinear_filter(pix00, pix01, pix10, pix11, curu >> 8, curv >> 8);
}
else
{
@@ -181,11 +181,7 @@ private:
const UINT16 *texbase = reinterpret_cast<const UINT16 *>(texture.base);
texbase += v0 * texture.rowpixels + u0;
- UINT32 pix00 = palbase[texbase[0]];
- UINT32 pix01 = palbase[texbase[u1]];
- UINT32 pix10 = palbase[texbase[v1]];
- UINT32 pix11 = palbase[texbase[u1 + v1]];
- return rgba_bilinear_filter(pix00, pix01, pix10, pix11, curu >> 8, curv >> 8);
+ return rgbaint_t::bilinear_filter(palbase[texbase[0]], palbase[texbase[u1]], palbase[texbase[v1]], palbase[texbase[u1 + v1]], curu >> 8, curv >> 8);
}
else
{
@@ -247,7 +243,7 @@ private:
else
pix11 = pix10;
}
- return rgb_bilinear_filter(pix00, pix01, pix10, pix11, curu >> 8, curv >> 8);
+ return rgbaint_t::bilinear_filter(pix00, pix01, pix10, pix11, curu >> 8, curv >> 8);
}
else
{
@@ -278,11 +274,7 @@ private:
const UINT32 *texbase = reinterpret_cast<const UINT32 *>(texture.base);
texbase += v0 * texture.rowpixels + u0;
- UINT32 pix00 = texbase[0];
- UINT32 pix01 = texbase[u1];
- UINT32 pix10 = texbase[v1];
- UINT32 pix11 = texbase[u1 + v1];
- return rgb_bilinear_filter(pix00, pix01, pix10, pix11, curu >> 8, curv >> 8);
+ return rgbaint_t::bilinear_filter(texbase[0], texbase[u1], texbase[v1], texbase[u1 + v1], curu >> 8, curv >> 8);
}
else
{
@@ -313,11 +305,7 @@ private:
const UINT32 *texbase = reinterpret_cast<const UINT32 *>(texture.base);
texbase += v0 * texture.rowpixels + u0;
- UINT32 pix00 = texbase[0];
- UINT32 pix01 = texbase[u1];
- UINT32 pix10 = texbase[v1];
- UINT32 pix11 = texbase[u1 + v1];
- return rgba_bilinear_filter(pix00, pix01, pix10, pix11, curu >> 8, curv >> 8);
+ return rgbaint_t::bilinear_filter(texbase[0], texbase[u1], texbase[v1], texbase[u1 + v1], curu >> 8, curv >> 8);
}
else
{
diff --git a/src/emu/rendlay.c b/src/emu/rendlay.c
index c72a291dbb5..cb229846299 100644
--- a/src/emu/rendlay.c
+++ b/src/emu/rendlay.c
@@ -261,13 +261,14 @@ static int xml_get_attribute_int_with_subst(running_machine &machine, xml_data_n
{
const char *string = xml_get_attribute_string_with_subst(machine, node, attribute, NULL);
int value;
+ unsigned int uvalue;
if (string == NULL)
return defvalue;
if (string[0] == '$')
- return (sscanf(&string[1], "%X", &value) == 1) ? value : defvalue;
+ return (sscanf(&string[1], "%X", &uvalue) == 1) ? uvalue : defvalue;
if (string[0] == '0' && string[1] == 'x')
- return (sscanf(&string[2], "%X", &value) == 1) ? value : defvalue;
+ return (sscanf(&string[2], "%X", &uvalue) == 1) ? uvalue : defvalue;
if (string[0] == '#')
return (sscanf(&string[1], "%d", &value) == 1) ? value : defvalue;
return (sscanf(&string[0], "%d", &value) == 1) ? value : defvalue;
diff --git a/src/emu/rendlay.h b/src/emu/rendlay.h
index a288e0ab09d..068fc5cfec0 100644
--- a/src/emu/rendlay.h
+++ b/src/emu/rendlay.h
@@ -29,7 +29,7 @@ enum item_layer
ITEM_LAYER_MARQUEE,
ITEM_LAYER_MAX
};
-DECLARE_ENUM_OPERATORS(item_layer);
+DECLARE_ENUM_OPERATORS(item_layer)
diff --git a/src/emu/save.h b/src/emu/save.h
index c2d4e0bd6c1..85bb660540c 100644
--- a/src/emu/save.h
+++ b/src/emu/save.h
@@ -190,22 +190,22 @@ private:
// template specializations to enumerate the fundamental atomic types you are allowed to save
-ALLOW_SAVE_TYPE_AND_ARRAY(char);
+ALLOW_SAVE_TYPE_AND_ARRAY(char)
ALLOW_SAVE_TYPE (bool); // std::vector<bool> may be packed internally
-ALLOW_SAVE_TYPE_AND_ARRAY(INT8);
-ALLOW_SAVE_TYPE_AND_ARRAY(UINT8);
-ALLOW_SAVE_TYPE_AND_ARRAY(INT16);
-ALLOW_SAVE_TYPE_AND_ARRAY(UINT16);
-ALLOW_SAVE_TYPE_AND_ARRAY(INT32);
-ALLOW_SAVE_TYPE_AND_ARRAY(UINT32);
-ALLOW_SAVE_TYPE_AND_ARRAY(INT64);
-ALLOW_SAVE_TYPE_AND_ARRAY(UINT64);
-ALLOW_SAVE_TYPE_AND_ARRAY(PAIR);
-ALLOW_SAVE_TYPE_AND_ARRAY(PAIR64);
-ALLOW_SAVE_TYPE_AND_ARRAY(float);
-ALLOW_SAVE_TYPE_AND_ARRAY(double);
-ALLOW_SAVE_TYPE_AND_ARRAY(endianness_t);
-ALLOW_SAVE_TYPE_AND_ARRAY(rgb_t);
+ALLOW_SAVE_TYPE_AND_ARRAY(INT8)
+ALLOW_SAVE_TYPE_AND_ARRAY(UINT8)
+ALLOW_SAVE_TYPE_AND_ARRAY(INT16)
+ALLOW_SAVE_TYPE_AND_ARRAY(UINT16)
+ALLOW_SAVE_TYPE_AND_ARRAY(INT32)
+ALLOW_SAVE_TYPE_AND_ARRAY(UINT32)
+ALLOW_SAVE_TYPE_AND_ARRAY(INT64)
+ALLOW_SAVE_TYPE_AND_ARRAY(UINT64)
+ALLOW_SAVE_TYPE_AND_ARRAY(PAIR)
+ALLOW_SAVE_TYPE_AND_ARRAY(PAIR64)
+ALLOW_SAVE_TYPE_AND_ARRAY(float)
+ALLOW_SAVE_TYPE_AND_ARRAY(double)
+ALLOW_SAVE_TYPE_AND_ARRAY(endianness_t)
+ALLOW_SAVE_TYPE_AND_ARRAY(rgb_t)
diff --git a/src/emu/schedule.h b/src/emu/schedule.h
index 36ae83d2929..a2d8660ef4f 100644
--- a/src/emu/schedule.h
+++ b/src/emu/schedule.h
@@ -144,10 +144,12 @@ public:
void synchronize(timer_expired_delegate callback = timer_expired_delegate(), int param = 0, void *ptr = NULL) { timer_set(attotime::zero, callback, param, ptr); }
// timers with old-skool callbacks
+#ifdef USE_STATIC_DELEGATE
emu_timer *timer_alloc(timer_expired_func callback, const char *name, void *ptr = NULL) { return timer_alloc(timer_expired_delegate(callback, name, &machine()), ptr); }
void timer_set(const attotime &duration, timer_expired_func callback, const char *name, int param = 0, void *ptr = NULL) { timer_set(duration, timer_expired_delegate(callback, name, &machine()), param, ptr); }
void timer_pulse(const attotime &period, timer_expired_func callback, const char *name, int param = 0, void *ptr = NULL) { timer_pulse(period, timer_expired_delegate(callback, name, &machine()), param, ptr); }
void synchronize(timer_expired_func callback, const char *name = NULL, int param = 0, void *ptr = NULL) { timer_set(attotime::zero, callback, name, param, ptr); }
+#endif
// timers, specified by device/id; generally devices should use the device_t methods instead
emu_timer *timer_alloc(device_t &device, device_timer_id id = 0, void *ptr = NULL);
diff --git a/src/emu/screen.c b/src/emu/screen.c
index 0690695efd5..12bf4280dd8 100644
--- a/src/emu/screen.c
+++ b/src/emu/screen.c
@@ -463,7 +463,10 @@ void screen_device::configure(int width, int height, const rectangle &visarea, a
// if an old style VBLANK_TIME was specified in the MACHINE_CONFIG,
// use it; otherwise calculate the VBLANK period from the visible area
if (m_oldstyle_vblank_supplied)
+ {
m_vblank_period = m_vblank;
+ logerror("%s: Deprecated legacy Old Style screen configured (MCFG_SCREEN_VBLANK_TIME), please use MCFG_SCREEN_RAW_PARAMS instead.\n",this->tag());
+ }
else
m_vblank_period = m_scantime * (height - visarea.height());
diff --git a/src/emu/screen.h b/src/emu/screen.h
index de8ce06e3b0..d91328cb1e9 100644
--- a/src/emu/screen.h
+++ b/src/emu/screen.h
@@ -352,15 +352,58 @@ typedef device_type_iterator<&device_creator<screen_device>, screen_device> scre
#define MCFG_SCREEN_TYPE(_type) \
screen_device::static_set_type(*device, SCREEN_TYPE_##_type);
+
+/*!
+ @brief Configures screen parameters for the given screen.
+
+ @param _pixclock Pixel Clock frequency value
+ @param _htotal Total number of horizontal pixels, including hblank period.
+ @param _hbend Horizontal pixel position for HBlank end event, also first pixel where screen rectangle is visible.
+ @param _hbstart Horizontal pixel position for HBlank start event, also last pixel where screen rectangle is visible.
+ @param _vtotal Total number of vertical pixels, including vblank period.
+ @param _vbend Vertical pixel position for VBlank end event, also first pixel where screen rectangle is visible.
+ @param _vbstart Vertical pixel position for VBlank start event, also last pixel where screen rectangle is visible.
+ */
#define MCFG_SCREEN_RAW_PARAMS(_pixclock, _htotal, _hbend, _hbstart, _vtotal, _vbend, _vbstart) \
screen_device::static_set_raw(*device, _pixclock, _htotal, _hbend, _hbstart, _vtotal, _vbend, _vbstart);
+/*!
+ @brief Sets the number of Frames Per Second for this screen
+
+ @param _rate FPS number
+ @deprecated Please use MCFG_SCREEN_RAW_PARAMS instead. Gives imprecise timings.
+ */
#define MCFG_SCREEN_REFRESH_RATE(_rate) \
screen_device::static_set_refresh(*device, HZ_TO_ATTOSECONDS(_rate));
+
+/*!
+ @brief Sets the vblank time of the given screen
+
+ @param _time Time parameter, in attotime value\
+ @deprecated Please use MCFG_SCREEN_RAW_PARAMS instead. Gives imprecise timings.
+ */
#define MCFG_SCREEN_VBLANK_TIME(_time) \
screen_device::static_set_vblank_time(*device, _time);
+
+/*!
+ @brief Sets total screen size, including H/V-Blanks
+
+ @param _width Screen horizontal size
+ @param _height Screen vertical size
+ @deprecated Please use MCFG_SCREEN_RAW_PARAMS instead. Gives imprecise timings.
+ */
#define MCFG_SCREEN_SIZE(_width, _height) \
screen_device::static_set_size(*device, _width, _height);
+
+/*!
+ @brief Sets screen visible area
+
+ @param _minx Screen left border
+ @param _maxx Screen right border, must be in N-1 format
+ @param _miny Screen top border
+ @param _maxx Screen bottom border, must be in N-1 format
+ @deprecated Please use MCFG_SCREEN_RAW_PARAMS instead. Gives imprecise timings.
+ */
#define MCFG_SCREEN_VISIBLE_AREA(_minx, _maxx, _miny, _maxy) \
screen_device::static_set_visarea(*device, _minx, _maxx, _miny, _maxy);
#define MCFG_SCREEN_DEFAULT_POSITION(_xscale, _xoffs, _yscale, _yoffs) \
diff --git a/src/emu/softlist.c b/src/emu/softlist.c
index 9f6fd339b8b..fdfd980aeea 100644
--- a/src/emu/softlist.c
+++ b/src/emu/softlist.c
@@ -557,6 +557,13 @@ void software_list_device::internal_validity_check(validity_checker &valid)
break;
}
+ // Did we lost the software parts?
+ if (swinfo->num_parts() == 0)
+ {
+ osd_printf_error("%s: %s has no part\n", filename(), swinfo->shortname());
+ break;
+ }
+
// Second, since the xml is fine, run additional checks:
// check for duplicate names
diff --git a/src/emu/sound.c b/src/emu/sound.c
index ed5527edc39..d2543154bf6 100644
--- a/src/emu/sound.c
+++ b/src/emu/sound.c
@@ -225,8 +225,8 @@ int sound_stream::input_source_outputnum(int inputnum) const
void sound_stream::set_input(int index, sound_stream *input_stream, int output_index, float gain)
{
- VPRINTF(("stream_set_input(%p, '%s', %d, %p, %d, %f)\n", this, m_device.tag(),
- index, input_stream, output_index, (double) gain));
+ VPRINTF(("stream_set_input(%p, '%s', %d, %p, %d, %f)\n", (void *)this, m_device.tag(),
+ index, (void *)input_stream, output_index, (double) gain));
// make sure it's a valid input
if (index >= m_input.size())
@@ -605,7 +605,7 @@ void sound_stream::generate_samples(int samples)
if (samples <= 0)
return;
- VPRINTF(("generate_samples(%p, %d)\n", this, samples));
+ VPRINTF(("generate_samples(%p, %d)\n", (void *) this, samples));
// ensure all inputs are up to date and generate resampled data
for (unsigned int inputnum = 0; inputnum < m_input.size(); inputnum++)
@@ -637,7 +637,7 @@ void sound_stream::generate_samples(int samples)
}
// run the callback
- VPRINTF((" callback(%p, %d)\n", this, samples));
+ VPRINTF((" callback(%p, %d)\n", (void *)this, samples));
m_callback(*this, inputs, outputs, samples);
VPRINTF((" callback done\n"));
}
diff --git a/src/emu/sound/ay8910.c b/src/emu/sound/ay8910.c
index 9decdb85c08..9e8d397ff7a 100644
--- a/src/emu/sound/ay8910.c
+++ b/src/emu/sound/ay8910.c
@@ -1004,6 +1004,12 @@ int ay8910_device::ay8910_read_ym()
/*
even if the port is set as output, we still need to return the external
data. Some games, like kidniki, need this to work.
+
+ FIXME: The io ports are designed as open collector outputs. Bits 7 and 8 of AY_ENABLE
+ only enable (low) or disable (high) the pull up resistors. The YM2149 datasheet
+ specifies those pull up resistors as 60k to 600k (min / max).
+ We do need a callback for those two flags. Kid Niki (Irem m62) is one such
+ case were it makes a difference in comparison to a standard TTL output.
*/
if (!m_port_a_read_cb.isnull())
m_regs[AY_PORTA] = m_port_a_read_cb(0);
diff --git a/src/emu/sound/bsmt2000.c b/src/emu/sound/bsmt2000.c
index 80802d5f60e..0b1dea55354 100644
--- a/src/emu/sound/bsmt2000.c
+++ b/src/emu/sound/bsmt2000.c
@@ -296,7 +296,7 @@ READ16_MEMBER( bsmt2000_device::tms_data_r )
READ16_MEMBER( bsmt2000_device::tms_rom_r )
{
// underlying logic assumes this is a sign-extended value
- return (INT8)m_direct->read_raw_byte((m_rom_bank << 16) + m_rom_address);
+ return (INT8)m_direct->read_byte((m_rom_bank << 16) + m_rom_address);
}
diff --git a/src/emu/sound/c352.c b/src/emu/sound/c352.c
index c164bc53413..b4172e43aa0 100644
--- a/src/emu/sound/c352.c
+++ b/src/emu/sound/c352.c
@@ -124,8 +124,8 @@ void c352_device::mix_one_channel(unsigned long ch, long sample_count)
return;
}
- sample = (char)m_direct->read_raw_byte(pos);
- nextsample = (char)m_direct->read_raw_byte(pos+cnt);
+ sample = (char)m_direct->read_byte(pos);
+ nextsample = (char)m_direct->read_byte(pos+cnt);
// sample is muLaw, not 8-bit linear (Fighting Layer uses this extensively)
if (flag & C352_FLG_MULAW)
@@ -489,7 +489,7 @@ void c352_device::device_start()
divider=332;
break;
}
-
+
m_sample_rate_base = clock() / divider;
m_stream = machine().sound().stream_alloc(*this, 0, 4, m_sample_rate_base);
diff --git a/src/emu/sound/c352.h b/src/emu/sound/c352.h
index 0717fd133df..31eceffb366 100644
--- a/src/emu/sound/c352.h
+++ b/src/emu/sound/c352.h
@@ -26,7 +26,7 @@ enum
#define MCFG_C352_DIVIDER(_setting) \
c352_device::static_set_divider(*device, _setting);
-
+
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
@@ -43,7 +43,7 @@ public:
// inline configuration helpers
static void static_set_divider(device_t &device, int setting);
-
+
DECLARE_READ16_MEMBER(read);
DECLARE_WRITE16_MEMBER(write);
@@ -80,7 +80,7 @@ private:
C352_FLG_FILTER = 0x0004, // don't apply filter
C352_FLG_REVLOOP = 0x0003, // loop backwards
C352_FLG_LOOP = 0x0002, // loop forward
- C352_FLG_REVERSE = 0x0001, // play sample backwards
+ C352_FLG_REVERSE = 0x0001 // play sample backwards
};
struct c352_ch_t
@@ -108,7 +108,7 @@ private:
c352_ch_t m_c352_ch[32];
int m_sample_rate_base;
int m_divider;
-
+
long m_channel_l[2048*2];
long m_channel_r[2048*2];
long m_channel_l2[2048*2];
diff --git a/src/emu/sound/disc_sys.inc b/src/emu/sound/disc_sys.inc
index b3c89188cad..4192e832d93 100644
--- a/src/emu/sound/disc_sys.inc
+++ b/src/emu/sound/disc_sys.inc
@@ -27,11 +27,6 @@
*
*************************************/
-// FIXME
-//#undef I64FMT
-//#define I64FMT "ll"
-
-
DISCRETE_START( dso_csvlog )
{
int log_num, node_num;
diff --git a/src/emu/sound/discrete.c b/src/emu/sound/discrete.c
index 61f3ea35242..5270f37ebb9 100644
--- a/src/emu/sound/discrete.c
+++ b/src/emu/sound/discrete.c
@@ -39,7 +39,8 @@
#include "wavwrite.h"
#include "discrete.h"
-
+/* for_each collides with c++ standard libraries - include it here */
+#define for_each(_T, _e, _l) for (_T _e = (_l)->begin_ptr() ; _e <= (_l)->end_ptr(); _e++)
// device type definition
const device_type DISCRETE = &device_creator<discrete_sound_device>;
diff --git a/src/emu/sound/discrete.h b/src/emu/sound/discrete.h
index a7dff7c7ff7..d3dfd2c4e85 100644
--- a/src/emu/sound/discrete.h
+++ b/src/emu/sound/discrete.h
@@ -3747,8 +3747,6 @@ enum
*
*************************************/
-#define for_each(_T, _e, _l) for (_T _e = (_l)->begin_ptr() ; _e <= (_l)->end_ptr(); _e++)
-
/*
* add and delete may be slow - the focus is on access!
*/
diff --git a/src/emu/sound/es5503.c b/src/emu/sound/es5503.c
index fd2d52c4545..b1881412da2 100644
--- a/src/emu/sound/es5503.c
+++ b/src/emu/sound/es5503.c
@@ -128,9 +128,10 @@ void es5503_device::halt_osc(int onum, int type, UINT32 *accumulator, int resshi
*accumulator = altram << resshift;
}
+ int omode = (pPartner->control>>1) & 3;
// if swap mode, start the partner
- if (mode == MODE_SWAP)
+ if ((mode == MODE_SWAP) || (omode == MODE_SWAP))
{
pPartner->control &= ~1; // clear the halt bit
pPartner->accumulator = 0; // and make sure it starts from the top (does this also need phase preservation?)
@@ -183,9 +184,9 @@ void es5503_device::sound_stream_update(sound_stream &stream, stream_sample_t **
// channel strobe is always valid when reading; this allows potentially banking per voice
m_channel_strobe = (ctrl>>4) & 0xf;
- data = (INT32)m_direct->read_raw_byte(ramptr + wtptr) ^ 0x80;
+ data = (INT32)m_direct->read_byte(ramptr + wtptr) ^ 0x80;
- if (m_direct->read_raw_byte(ramptr + wtptr) == 0x00)
+ if (m_direct->read_byte(ramptr + wtptr) == 0x00)
{
halt_osc(osc, 1, &acc, resshift);
}
diff --git a/src/emu/sound/ics2115.c b/src/emu/sound/ics2115.c
index d77410ad74b..af3557c28c3 100644
--- a/src/emu/sound/ics2115.c
+++ b/src/emu/sound/ics2115.c
@@ -138,10 +138,10 @@ void ics2115_device::device_reset()
int ics2115_voice::update_volume_envelope()
{
int ret = 0;
- if(vol_ctrl.done || vol_ctrl.stop)
+ if(vol_ctrl.bitflags.done || vol_ctrl.bitflags.stop)
return ret;
- if(vol_ctrl.invert) {
+ if(vol_ctrl.bitflags.invert) {
vol.acc -= vol.add;
vol.left = vol.acc - vol.start;
} else {
@@ -152,26 +152,26 @@ int ics2115_voice::update_volume_envelope()
if(vol.left > 0)
return ret;
- if(vol_ctrl.irq) {
- vol_ctrl.irq_pending = true;
+ if(vol_ctrl.bitflags.irq) {
+ vol_ctrl.bitflags.irq_pending = true;
ret = 1;
}
- if(osc_conf.eightbit)
+ if(osc_conf.bitflags.eightbit)
return ret;
- if(vol_ctrl.loop) {
- if(vol_ctrl.loop_bidir)
- vol_ctrl.invert = !vol_ctrl.invert;
+ if(vol_ctrl.bitflags.loop) {
+ if(vol_ctrl.bitflags.loop_bidir)
+ vol_ctrl.bitflags.invert = !vol_ctrl.bitflags.invert;
- if(vol_ctrl.invert)
+ if(vol_ctrl.bitflags.invert)
vol.acc = vol.end + vol.left;
else
vol.acc = vol.start - vol.left;
} else {
- state.on = false;
- vol_ctrl.done = true;
- if(vol_ctrl.invert)
+ state.bitflags.on = false;
+ vol_ctrl.bitflags.done = true;
+ if(vol_ctrl.bitflags.invert)
vol.acc = vol.end;
else
vol.acc = vol.start;
@@ -198,9 +198,9 @@ int ics2115_voice::update_volume_envelope()
int ics2115_voice::update_oscillator()
{
int ret = 0;
- if(osc_conf.stop)
+ if(osc_conf.bitflags.stop)
return ret;
- if(osc_conf.invert) {
+ if(osc_conf.bitflags.invert) {
osc.acc -= osc.fc << 2;
osc.left = osc.acc - osc.start;
} else {
@@ -210,17 +210,17 @@ int ics2115_voice::update_oscillator()
// > instead of >= to stop crackling?
if(osc.left > 0)
return ret;
- if(osc_conf.irq) {
- osc_conf.irq_pending = true;
+ if(osc_conf.bitflags.irq) {
+ osc_conf.bitflags.irq_pending = true;
ret = 1;
}
- if(osc_conf.loop) {
- if(osc_conf.loop_bidir)
- osc_conf.invert = !osc_conf.invert;
+ if(osc_conf.bitflags.loop) {
+ if(osc_conf.bitflags.loop_bidir)
+ osc_conf.bitflags.invert = !osc_conf.bitflags.invert;
//else
// printf("click!\n");
- if(osc_conf.invert) {
+ if(osc_conf.bitflags.invert) {
osc.acc = osc.end + osc.left;
osc.left = osc.acc - osc.start;
}
@@ -229,9 +229,9 @@ int ics2115_voice::update_oscillator()
osc.left = osc.end - osc.acc;
}
} else {
- state.on = false;
- osc_conf.stop = true;
- if(!osc_conf.invert)
+ state.bitflags.on = false;
+ osc_conf.bitflags.stop = true;
+ if(!osc_conf.bitflags.invert)
osc.acc = osc.end;
else
osc.acc = osc.start;
@@ -245,7 +245,7 @@ stream_sample_t ics2115_device::get_sample(ics2115_voice& voice)
UINT32 curaddr = ((voice.osc.saddr << 20) & 0xffffff) | (voice.osc.acc >> 12);
UINT32 nextaddr;
- if (voice.state.on && voice.osc_conf.loop && !voice.osc_conf.loop_bidir &&
+ if (voice.state.bitflags.on && voice.osc_conf.bitflags.loop && !voice.osc_conf.bitflags.loop_bidir &&
(voice.osc.left < (voice.osc.fc <<2))) {
//printf("C?[%x:%x]", voice.osc.left, voice.osc.acc);
nextaddr = ((voice.osc.saddr << 20) & 0xffffff) | (voice.osc.start >> 12);
@@ -255,7 +255,7 @@ stream_sample_t ics2115_device::get_sample(ics2115_voice& voice)
INT16 sample1, sample2;
- if (voice.osc_conf.eightbit) {
+ if (voice.osc_conf.bitflags.eightbit) {
sample1 = ((INT8)m_rom[curaddr]) << 8;
sample2 = ((INT8)m_rom[curaddr + 1]) << 8;
}
@@ -283,21 +283,21 @@ stream_sample_t ics2115_device::get_sample(ics2115_voice& voice)
bool ics2115_voice::playing()
{
- return state.on && !((vol_ctrl.done || vol_ctrl.stop) && osc_conf.stop);
+ return state.bitflags.on && !((vol_ctrl.bitflags.done || vol_ctrl.bitflags.stop) && osc_conf.bitflags.stop);
}
void ics2115_voice::update_ramp() {
//slow attack
- if (state.on && !osc_conf.stop) {
- if (state.ramp < 0x40)
- state.ramp += 0x1;
+ if (state.bitflags.on && !osc_conf.bitflags.stop) {
+ if (state.bitflags.ramp < 0x40)
+ state.bitflags.ramp += 0x1;
else
- state.ramp = 0x40;
+ state.bitflags.ramp = 0x40;
}
//slow release
else {
- if (state.ramp)
- state.ramp -= 0x1;
+ if (state.bitflags.ramp)
+ state.bitflags.ramp -= 0x1;
}
}
@@ -309,7 +309,7 @@ int ics2115_device::fill_output(ics2115_voice& voice, stream_sample_t *outputs[2
for (int i = 0; i < samples; i++) {
UINT32 volacc = (voice.vol.acc >> 10) & 0xffff;
- UINT32 volume = (m_volume[volacc >> 4] * voice.state.ramp) >> 6;
+ UINT32 volume = (m_volume[volacc >> 4] * voice.state.bitflags.ramp) >> 6;
UINT16 vleft = volume; //* (255 - voice.vol.pan) / 0x80];
UINT16 vright = volume; //* (voice.vol.pan + 1) / 0x80];
@@ -319,7 +319,7 @@ int ics2115_device::fill_output(ics2115_voice& voice, stream_sample_t *outputs[2
//that the voice is pointing at is contributing to the summation.
//(austere note: this will of course fix some of the glitches due to multiple transition)
stream_sample_t sample;
- if(voice.osc_conf.ulaw) {
+ if(voice.osc_conf.bitflags.ulaw) {
UINT32 curaddr = ((voice.osc.saddr << 20) & 0xffffff) | (voice.osc.acc >> 12);
sample = m_ulaw[m_rom[curaddr]];
}
@@ -361,7 +361,7 @@ void ics2115_device::sound_stream_update(sound_stream &stream, stream_sample_t *
#ifdef ICS2115_DEBUG
UINT32 curaddr = ((voice.osc.saddr << 20) & 0xffffff) | (voice.osc.acc >> 12);
stream_sample_t sample;
- if(voice.osc_conf.ulaw)
+ if(voice.osc_conf.bitflags.ulaw)
sample = m_ulaw[m_rom[curaddr]];
else
sample = get_sample(voice);
@@ -374,7 +374,7 @@ void ics2115_device::sound_stream_update(sound_stream &stream, stream_sample_t *
#ifdef ICS2115_DEBUG
if(voice.playing()) {
printf("%d", osc);
- if (voice.osc_conf.invert)
+ if (voice.osc_conf.bitflags.invert)
printf("+");
else if ((voice.osc.fc >> 1) > 0x1ff)
printf("*");
@@ -488,10 +488,10 @@ UINT16 ics2115_device::reg_read() {
// may expect |8 on reg 0 on voice irq with &80 == 0
// ret = 0xFF;
if (!m_vmode)
- ret = voice.vol_ctrl.irq ? 0x81 : 0x01;
+ ret = voice.vol_ctrl.bitflags.irq ? 0x81 : 0x01;
else
ret = 0x01;
- //ret = voice.vol_ctrl.value | 0x1;
+ //ret = voice.vol_ctrl.bitflags.value | 0x1;
ret <<= 8;
break;
@@ -503,17 +503,17 @@ UINT16 ics2115_device::reg_read() {
ret = 0xff;
for (int i = 0; i <= m_active_osc; i++) {
ics2115_voice& v = m_voice[i];
- if (v.osc_conf.irq_pending || v.vol_ctrl.irq_pending) {
+ if (v.osc_conf.bitflags.irq_pending || v.vol_ctrl.bitflags.irq_pending) {
ret = i | 0xe0;
- ret &= v.vol_ctrl.irq_pending ? (~0x40) : 0xff;
- ret &= v.osc_conf.irq_pending ? (~0x80) : 0xff;
+ ret &= v.vol_ctrl.bitflags.irq_pending ? (~0x40) : 0xff;
+ ret &= v.osc_conf.bitflags.irq_pending ? (~0x80) : 0xff;
recalc_irq();
- if (v.osc_conf.irq_pending) {
- v.osc_conf.irq_pending = 0;
+ if (v.osc_conf.bitflags.irq_pending) {
+ v.osc_conf.bitflags.irq_pending = 0;
ret &= ~0x80;
}
- if (v.vol_ctrl.irq_pending) {
- v.vol_ctrl.irq_pending = 0;
+ if (v.vol_ctrl.bitflags.irq_pending) {
+ v.vol_ctrl.bitflags.irq_pending = 0;
ret &= ~0x40;
}
break;
@@ -694,14 +694,14 @@ void ics2115_device::reg_write(UINT8 data, bool msb) {
#ifdef ICS2115_ISOLATE
if (m_osc_select == ICS2115_ISOLATE)
#endif
- if (!voice.osc_conf.stop || !voice.vol_ctrl.stop)
+ if (!voice.osc_conf.bitflags.stop || !voice.vol_ctrl.bitflags.stop)
printf("[%02d STOP]\n", m_osc_select);
#endif
if (!m_vmode) {
- voice.osc_conf.stop = true;
- voice.vol_ctrl.stop = true;
+ voice.osc_conf.bitflags.stop = true;
+ voice.vol_ctrl.bitflags.stop = true;
//try to key it off as well!
- voice.state.on = false;
+ voice.state.bitflags.on = false;
}
}
#ifdef ICS2115_DEBUG
@@ -769,8 +769,8 @@ READ8_MEMBER(ics2115_device::read)
if (m_irq_enabled && (m_irq_pending & 3))
ret |= 1;
for (int i = 0; i <= m_active_osc; i++) {
- if (//m_voice[i].vol_ctrl.irq_pending ||
- m_voice[i].osc_conf.irq_pending) {
+ if (//m_voice[i].vol_ctrl.bitflags.irq_pending ||
+ m_voice[i].osc_conf.bitflags.irq_pending) {
ret |= 2;
break;
}
@@ -823,9 +823,9 @@ void ics2115_device::keyon()
return;
#endif
//set initial condition (may need to invert?) -- does NOT work since these are set to zero even
- m_voice[m_osc_select].state.on = true;
+ m_voice[m_osc_select].state.bitflags.on = true;
//no ramp up...
- m_voice[m_osc_select].state.ramp = 0x40;
+ m_voice[m_osc_select].state.bitflags.ramp = 0x40;
#ifdef ICS2115_DEBUG
printf("[%02d vs:%04x ve:%04x va:%04x vi:%02x vc:%02x os:%06x oe:%06x oa:%06x of:%04x SA:%02x oc:%02x][%04x]\n", m_osc_select,
@@ -852,7 +852,7 @@ void ics2115_device::recalc_irq()
//Suspect
bool irq = (m_irq_pending & m_irq_enabled);
for(int i = 0; (!irq) && (i < 32); i++)
- irq |= m_voice[i].vol_ctrl.irq_pending && m_voice[i].osc_conf.irq_pending;
+ irq |= m_voice[i].vol_ctrl.bitflags.irq_pending && m_voice[i].osc_conf.bitflags.irq_pending;
m_irq_on = irq;
if(!m_irq_cb.isnull())
m_irq_cb(irq ? ASSERT_LINE : CLEAR_LINE);
diff --git a/src/emu/sound/ics2115.h b/src/emu/sound/ics2115.h
index 16d571fd997..fbfeb64e24a 100644
--- a/src/emu/sound/ics2115.h
+++ b/src/emu/sound/ics2115.h
@@ -49,7 +49,7 @@ struct ics2115_voice {
UINT8 invert : 1;
UINT8 irq_pending: 1;
//IRQ on variable?
- };
+ } bitflags;
UINT8 value;
} osc_conf;
@@ -64,7 +64,7 @@ struct ics2115_voice {
UINT8 invert : 1; //invert direction
UINT8 irq_pending: 1; //(read only) IRQ pending
//noenvelope == (done | disable)
- };
+ } bitflags;
UINT8 value;
} vol_ctrl;
@@ -74,7 +74,7 @@ struct ics2115_voice {
struct {
UINT8 on : 1;
UINT8 ramp : 7; // 100 0000 = 0x40 maximum
- };
+ } bitflags;
UINT8 value;
} state;
diff --git a/src/emu/sound/multipcm.c b/src/emu/sound/multipcm.c
index 5f984ffeadb..69c164bad2c 100644
--- a/src/emu/sound/multipcm.c
+++ b/src/emu/sound/multipcm.c
@@ -534,7 +534,7 @@ void multipcm_device::device_start()
for (int j = 0; j < 12; j++)
{
- ptSample[j] = (UINT8)m_direct->read_raw_byte((i*12) + j);
+ ptSample[j] = (UINT8)m_direct->read_byte((i*12) + j);
}
m_Samples[i].Start=(ptSample[0]<<16)|(ptSample[1]<<8)|(ptSample[2]<<0);
@@ -616,7 +616,7 @@ void multipcm_device::sound_stream_update(sound_stream &stream, stream_sample_t
unsigned int adr=slot->offset>>SHIFT;
signed int sample;
unsigned int step=slot->step;
- signed int csample=(signed short) (m_direct->read_raw_byte(slot->Base+adr)<<8);
+ signed int csample=(signed short) (m_direct->read_byte(slot->Base+adr)<<8);
signed int fpart=slot->offset&((1<<SHIFT)-1);
sample=(csample*fpart+slot->Prev*((1<<SHIFT)-fpart))>>SHIFT;
diff --git a/src/emu/sound/n63701x.c b/src/emu/sound/n63701x.c
index e76db1e1fc4..a1308c36713 100644
--- a/src/emu/sound/n63701x.c
+++ b/src/emu/sound/n63701x.c
@@ -47,6 +47,16 @@ namco_63701x_device::namco_63701x_device(const machine_config &mconfig, const ch
void namco_63701x_device::device_start()
{
m_stream = stream_alloc(0, 2, clock()/1000);
+
+ for (int i = 0; i < 2; i++)
+ {
+ save_item(NAME(m_voices[i].select), i);
+ save_item(NAME(m_voices[i].playing), i);
+ save_item(NAME(m_voices[i].base_addr), i);
+ save_item(NAME(m_voices[i].position), i);
+ save_item(NAME(m_voices[i].volume), i);
+ save_item(NAME(m_voices[i].silence_counter), i);
+ }
}
diff --git a/src/emu/sound/okim6295.c b/src/emu/sound/okim6295.c
index 2e59809199d..fc9f35e3a58 100644
--- a/src/emu/sound/okim6295.c
+++ b/src/emu/sound/okim6295.c
@@ -303,14 +303,14 @@ void okim6295_device::write_command(UINT8 command)
// determine the start/stop positions
offs_t base = m_command * 8;
- offs_t start = m_direct->read_raw_byte(base + 0) << 16;
- start |= m_direct->read_raw_byte(base + 1) << 8;
- start |= m_direct->read_raw_byte(base + 2) << 0;
+ offs_t start = m_direct->read_byte(base + 0) << 16;
+ start |= m_direct->read_byte(base + 1) << 8;
+ start |= m_direct->read_byte(base + 2) << 0;
start &= 0x3ffff;
- offs_t stop = m_direct->read_raw_byte(base + 3) << 16;
- stop |= m_direct->read_raw_byte(base + 4) << 8;
- stop |= m_direct->read_raw_byte(base + 5) << 0;
+ offs_t stop = m_direct->read_byte(base + 3) << 16;
+ stop |= m_direct->read_byte(base + 4) << 8;
+ stop |= m_direct->read_byte(base + 5) << 0;
stop &= 0x3ffff;
if (start < stop)
@@ -405,7 +405,7 @@ void okim6295_device::okim_voice::generate_adpcm(direct_read_data &direct, strea
while (samples-- != 0)
{
// fetch the next sample byte
- int nibble = direct.read_raw_byte(m_base_offset + m_sample / 2) >> (((m_sample & 1) << 2) ^ 4);
+ int nibble = direct.read_byte(m_base_offset + m_sample / 2) >> (((m_sample & 1) << 2) ^ 4);
// output to the buffer, scaling by the volume
// signal in range -2048..2047, volume in range 2..32 => signal * volume / 2 in range -32768..32767
diff --git a/src/emu/sound/okim9810.c b/src/emu/sound/okim9810.c
index 311138e8df7..e134e646ddb 100644
--- a/src/emu/sound/okim9810.c
+++ b/src/emu/sound/okim9810.c
@@ -4,7 +4,7 @@
okim9810.h
- OKI MSM9810 ADCPM(2) sound chip.
+ OKI MSM9810 ADPCM(2) sound chip.
***************************************************************************/
@@ -313,31 +313,31 @@ void okim9810_device::write_command(UINT8 data)
const offs_t base = m_TMP_register * 8;
offs_t startAddr;
- UINT8 startFlags = m_direct->read_raw_byte(base + 0);
- startAddr = m_direct->read_raw_byte(base + 1) << 16;
- startAddr |= m_direct->read_raw_byte(base + 2) << 8;
- startAddr |= m_direct->read_raw_byte(base + 3) << 0;
+ UINT8 startFlags = m_direct->read_byte(base + 0);
+ startAddr = m_direct->read_byte(base + 1) << 16;
+ startAddr |= m_direct->read_byte(base + 2) << 8;
+ startAddr |= m_direct->read_byte(base + 3) << 0;
offs_t endAddr;
- UINT8 endFlags = m_direct->read_raw_byte(base + 4);
- endAddr = m_direct->read_raw_byte(base + 5) << 16;
- endAddr |= m_direct->read_raw_byte(base + 6) << 8;
- endAddr |= m_direct->read_raw_byte(base + 7) << 0;
+ UINT8 endFlags = m_direct->read_byte(base + 4);
+ endAddr = m_direct->read_byte(base + 5) << 16;
+ endAddr |= m_direct->read_byte(base + 6) << 8;
+ endAddr |= m_direct->read_byte(base + 7) << 0;
// Sub-table
if (startFlags & 0x80)
{
offs_t subTable = startAddr;
// TODO: New startFlags &= 0x80. Are there further subtables?
- startFlags = m_direct->read_raw_byte(subTable + 0);
- startAddr = m_direct->read_raw_byte(subTable + 1) << 16;
- startAddr |= m_direct->read_raw_byte(subTable + 2) << 8;
- startAddr |= m_direct->read_raw_byte(subTable + 3) << 0;
+ startFlags = m_direct->read_byte(subTable + 0);
+ startAddr = m_direct->read_byte(subTable + 1) << 16;
+ startAddr |= m_direct->read_byte(subTable + 2) << 8;
+ startAddr |= m_direct->read_byte(subTable + 3) << 0;
// TODO: What does byte (subTable + 4) refer to?
- endAddr = m_direct->read_raw_byte(subTable + 5) << 16;
- endAddr |= m_direct->read_raw_byte(subTable + 6) << 8;
- endAddr |= m_direct->read_raw_byte(subTable + 7) << 0;
+ endAddr = m_direct->read_byte(subTable + 5) << 16;
+ endAddr |= m_direct->read_byte(subTable + 6) << 8;
+ endAddr |= m_direct->read_byte(subTable + 7) << 0;
}
m_voice[channel].m_sample = 0;
@@ -478,7 +478,7 @@ void okim9810_device::okim_voice::generate_audio(direct_read_data &direct,
if (m_sample == 0)
{
// fetch the first sample nibble
- int nibble0 = direct.read_raw_byte(m_base_offset + m_sample / 2) >> (((m_sample & 1) << 2) ^ 4);
+ int nibble0 = direct.read_byte(m_base_offset + m_sample / 2) >> (((m_sample & 1) << 2) ^ 4);
switch (m_playbackAlgo)
{
case OKIM9810_ADPCM_PLAYBACK:
@@ -504,7 +504,7 @@ void okim9810_device::okim_voice::generate_audio(direct_read_data &direct,
}
// And fetch the second sample nibble
- int nibble1 = direct.read_raw_byte(m_base_offset + (m_sample+1) / 2) >> ((((m_sample+1) & 1) << 2) ^ 4);
+ int nibble1 = direct.read_byte(m_base_offset + (m_sample+1) / 2) >> ((((m_sample+1) & 1) << 2) ^ 4);
switch (m_playbackAlgo)
{
case OKIM9810_ADPCM_PLAYBACK:
diff --git a/src/emu/sound/okim9810.h b/src/emu/sound/okim9810.h
index 665c9a9fdee..6d3595c59b2 100644
--- a/src/emu/sound/okim9810.h
+++ b/src/emu/sound/okim9810.h
@@ -4,7 +4,7 @@
okim9810.h
- OKI MSM9810 ADCPM(2) sound chip.
+ OKI MSM9810 ADPCM(2) sound chip.
Notes:
The master clock frequency for this chip can range from 3.5MHz to 4.5Mhz.
diff --git a/src/emu/sound/pokey.c b/src/emu/sound/pokey.c
index e27870108b5..89279c16184 100644
--- a/src/emu/sound/pokey.c
+++ b/src/emu/sound/pokey.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Brad Oliver, Eric Smith, Juergen Buchmueller
/*****************************************************************************
*
@@ -1100,7 +1100,7 @@ void pokey_device::pokey_potgo(void)
{
int pot;
- LOG(("POKEY #%p pokey_potgo\n", this));
+ LOG(("POKEY #%p pokey_potgo\n", (void *) this));
m_ALLPOT = 0x00;
m_pot_counter = 0;
diff --git a/src/emu/sound/pokey.h b/src/emu/sound/pokey.h
index c2cf13ba477..96c9f672246 100644
--- a/src/emu/sound/pokey.h
+++ b/src/emu/sound/pokey.h
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Brad Oliver, Eric Smith, Juergen Buchmueller
/*****************************************************************************
*
diff --git a/src/emu/sound/qs1000.c b/src/emu/sound/qs1000.c
index 18872b99e1f..3100800acbc 100644
--- a/src/emu/sound/qs1000.c
+++ b/src/emu/sound/qs1000.c
@@ -523,7 +523,7 @@ void qs1000_device::sound_stream_update(sound_stream &stream, stream_sample_t **
if (chan.m_start + chan.m_adpcm_addr >= chan.m_loop_end)
chan.m_adpcm_addr = chan.m_loop_start - chan.m_start;
- UINT8 data = m_direct->read_raw_byte(chan.m_start + (chan.m_adpcm_addr >> 1));
+ UINT8 data = m_direct->read_byte(chan.m_start + (chan.m_adpcm_addr >> 1));
UINT8 nibble = (chan.m_adpcm_addr & 1 ? data : data >> 4) & 0xf;
chan.m_adpcm_signal = chan.m_adpcm.clock(nibble);
}
@@ -556,7 +556,7 @@ void qs1000_device::sound_stream_update(sound_stream &stream, stream_sample_t **
}
}
- INT8 result = m_direct->read_raw_byte(chan.m_addr) - 128;
+ INT8 result = m_direct->read_byte(chan.m_addr) - 128;
chan.m_acc += chan.m_freq;
chan.m_addr = (chan.m_addr + (chan.m_acc >> 18)) & QS1000_ADDRESS_MASK;
@@ -576,9 +576,9 @@ void qs1000_device::start_voice(int ch)
UINT32 table_addr = (m_channels[ch].m_regs[0x01] << 16) | (m_channels[ch].m_regs[0x02] << 8) | m_channels[ch].m_regs[0x03];
// Fetch the sound information
- UINT16 freq = (m_direct->read_raw_byte(table_addr + 0) << 8) | m_direct->read_raw_byte(table_addr + 1);
- UINT16 word1 = (m_direct->read_raw_byte(table_addr + 2) << 8) | m_direct->read_raw_byte(table_addr + 3);
- UINT16 base = (m_direct->read_raw_byte(table_addr + 4) << 8) | m_direct->read_raw_byte(table_addr + 5);
+ UINT16 freq = (m_direct->read_byte(table_addr + 0) << 8) | m_direct->read_byte(table_addr + 1);
+ UINT16 word1 = (m_direct->read_byte(table_addr + 2) << 8) | m_direct->read_byte(table_addr + 3);
+ UINT16 base = (m_direct->read_byte(table_addr + 4) << 8) | m_direct->read_byte(table_addr + 5);
if (LOGGING_ENABLED)
printf("[%.6x] Freq:%.4x ????:%.4x Addr:%.4x\n", table_addr, freq, word1, base);
@@ -588,42 +588,42 @@ void qs1000_device::start_voice(int ch)
return;
// Fetch the sample pointers and flags
- UINT8 byte0 = m_direct->read_raw_byte(base);
+ UINT8 byte0 = m_direct->read_byte(base);
UINT32 start_addr;
start_addr = byte0 << 16;
- start_addr |= m_direct->read_raw_byte(base + 1) << 8;
- start_addr |= m_direct->read_raw_byte(base + 2) << 0;
+ start_addr |= m_direct->read_byte(base + 1) << 8;
+ start_addr |= m_direct->read_byte(base + 2) << 0;
start_addr &= QS1000_ADDRESS_MASK;
UINT32 loop_start;
loop_start = (byte0 & 0xf0) << 16;
- loop_start |= m_direct->read_raw_byte(base + 3) << 12;
- loop_start |= m_direct->read_raw_byte(base + 4) << 4;
- loop_start |= m_direct->read_raw_byte(base + 5) >> 4;
+ loop_start |= m_direct->read_byte(base + 3) << 12;
+ loop_start |= m_direct->read_byte(base + 4) << 4;
+ loop_start |= m_direct->read_byte(base + 5) >> 4;
loop_start &= QS1000_ADDRESS_MASK;
UINT32 loop_end;
loop_end = (byte0 & 0xf0) << 16;
- loop_end |= (m_direct->read_raw_byte(base + 5) & 0xf) << 16;
- loop_end |= m_direct->read_raw_byte(base + 6) << 8;
- loop_end |= m_direct->read_raw_byte(base + 7);
+ loop_end |= (m_direct->read_byte(base + 5) & 0xf) << 16;
+ loop_end |= m_direct->read_byte(base + 6) << 8;
+ loop_end |= m_direct->read_byte(base + 7);
loop_end &= QS1000_ADDRESS_MASK;
- UINT8 byte8 = m_direct->read_raw_byte(base + 8);
+ UINT8 byte8 = m_direct->read_byte(base + 8);
if (LOGGING_ENABLED)
{
- UINT8 byte9 = m_direct->read_raw_byte(base + 9);
- UINT8 byte10 = m_direct->read_raw_byte(base + 10);
- UINT8 byte11 = m_direct->read_raw_byte(base + 11);
- UINT8 byte12 = m_direct->read_raw_byte(base + 12);
- UINT8 byte13 = m_direct->read_raw_byte(base + 13);
- UINT8 byte14 = m_direct->read_raw_byte(base + 14);
- UINT8 byte15 = m_direct->read_raw_byte(base + 15);
+ UINT8 byte9 = m_direct->read_byte(base + 9);
+ UINT8 byte10 = m_direct->read_byte(base + 10);
+ UINT8 byte11 = m_direct->read_byte(base + 11);
+ UINT8 byte12 = m_direct->read_byte(base + 12);
+ UINT8 byte13 = m_direct->read_byte(base + 13);
+ UINT8 byte14 = m_direct->read_byte(base + 14);
+ UINT8 byte15 = m_direct->read_byte(base + 15);
printf("[%.6x] Sample Start:%.6x Loop Start:%.6x Loop End:%.6x Params: %.2x %.2x %.2x %.2x %.2x %.2x %.2x %.2x\n", base, start_addr, loop_start, loop_end, byte8, byte9, byte10, byte11, byte12, byte13, byte14, byte15);
}
diff --git a/src/emu/sound/qs1000.h b/src/emu/sound/qs1000.h
index b3610dda400..24b843184b4 100644
--- a/src/emu/sound/qs1000.h
+++ b/src/emu/sound/qs1000.h
@@ -108,7 +108,7 @@ public:
{
QS1000_KEYON = 1,
QS1000_PLAYING = 2,
- QS1000_ADPCM = 4,
+ QS1000_ADPCM = 4
};
void start_voice(int ch);
diff --git a/src/emu/sound/rf5c400.c b/src/emu/sound/rf5c400.c
index 34d3fd3f362..91f9cf0d761 100644
--- a/src/emu/sound/rf5c400.c
+++ b/src/emu/sound/rf5c400.c
@@ -40,7 +40,7 @@ enum
TYPE_MASK = 0x00C0,
TYPE_16 = 0x0000,
TYPE_8LOW = 0x0040,
- TYPE_8HIGH = 0x0080,
+ TYPE_8HIGH = 0x0080
};
/* envelope phase */
@@ -49,7 +49,7 @@ enum
PHASE_NONE = 0,
PHASE_ATTACK,
PHASE_DECAY,
- PHASE_RELEASE,
+ PHASE_RELEASE
};
diff --git a/src/emu/sound/saa1099.c b/src/emu/sound/saa1099.c
index fc08f5dc58b..a915fa6ed38 100644
--- a/src/emu/sound/saa1099.c
+++ b/src/emu/sound/saa1099.c
@@ -63,6 +63,13 @@
0x1c | ---- ---x | All channels enable (0 = off, 1 = on)
0x1c | ---- --x- | Synch & Reset generators
+ Version History:
+ ================
+ ??-??-200? - First version of the driver submitted for MESS (GPL/MESS license)
+ ??-??-200? - Submitted to DOSBOX for Creative Music System/Game Blaster emulation
+ ??-??-201? - Driver relicensed to BSD 3 Clause (GPL+ compatible)
+ 06-27-2015 - Applied clock divisor fix from DOSBOX SVN, http://www.vogons.org/viewtopic.php?p=344227#p344227
+
***************************************************************************/
#include "emu.h"
@@ -159,6 +166,7 @@ saa1099_device::saa1099_device(const machine_config &mconfig, const char *tag, d
void saa1099_device::device_start()
{
/* copy global parameters */
+ m_master_clock = clock();
m_sample_rate = clock() / 256;
/* for each chip allocate one stream */
@@ -204,7 +212,6 @@ void saa1099_device::device_start()
void saa1099_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
{
int j, ch;
-
/* if the channels are disabled we're done */
if (!m_all_ch_enable)
{
@@ -218,10 +225,10 @@ void saa1099_device::sound_stream_update(sound_stream &stream, stream_sample_t *
{
switch (m_noise_params[ch])
{
- case 0: m_noise[ch].freq = 31250.0 * 2; break;
- case 1: m_noise[ch].freq = 15625.0 * 2; break;
- case 2: m_noise[ch].freq = 7812.5 * 2; break;
- case 3: m_noise[ch].freq = m_channels[ch * 3].freq; break;
+ case 0: m_noise[ch].freq = m_master_clock/256.0 * 2; break;
+ case 1: m_noise[ch].freq = m_master_clock/512.0 * 2; break;
+ case 2: m_noise[ch].freq = m_master_clock/1024.0 * 2; break;
+ case 3: m_noise[ch].freq = m_channels[ch * 3].freq; break;
}
}
@@ -234,7 +241,7 @@ void saa1099_device::sound_stream_update(sound_stream &stream, stream_sample_t *
for (ch = 0; ch < 6; ch++)
{
if (m_channels[ch].freq == 0.0)
- m_channels[ch].freq = (double)((2 * 15625) << m_channels[ch].octave) /
+ m_channels[ch].freq = (double)((2 * m_master_clock / 512) << m_channels[ch].octave) /
(511.0 - (double)m_channels[ch].frequency);
/* check the actual position in the square wave */
@@ -242,7 +249,7 @@ void saa1099_device::sound_stream_update(sound_stream &stream, stream_sample_t *
while (m_channels[ch].counter < 0)
{
/* calculate new frequency now after the half wave is updated */
- m_channels[ch].freq = (double)((2 * 15625) << m_channels[ch].octave) /
+ m_channels[ch].freq = (double)((2 * m_master_clock / 512) << m_channels[ch].octave) /
(511.0 - (double)m_channels[ch].frequency);
m_channels[ch].counter += m_sample_rate;
@@ -255,22 +262,21 @@ void saa1099_device::sound_stream_update(sound_stream &stream, stream_sample_t *
envelope_w(1);
}
- /* if the noise is enabled */
+ // if the noise is enabled
if (m_channels[ch].noise_enable)
{
- /* if the noise level is high (noise 0: chan 0-2, noise 1: chan 3-5) */
+ // if the noise level is high (noise 0: chan 0-2, noise 1: chan 3-5)
if (m_noise[ch/3].level & 1)
{
- /* subtract to avoid overflows, also use only half amplitude */
+ // subtract to avoid overflows, also use only half amplitude
output_l -= m_channels[ch].amplitude[ LEFT] * m_channels[ch].envelope[ LEFT] / 16 / 2;
output_r -= m_channels[ch].amplitude[RIGHT] * m_channels[ch].envelope[RIGHT] / 16 / 2;
}
}
-
- /* if the square wave is enabled */
+ // if the square wave is enabled
if (m_channels[ch].freq_enable)
{
- /* if the channel level is high */
+ // if the channel level is high
if (m_channels[ch].level & 1)
{
output_l += m_channels[ch].amplitude[ LEFT] * m_channels[ch].envelope[ LEFT] / 16;
diff --git a/src/emu/sound/saa1099.h b/src/emu/sound/saa1099.h
index 7bf52630903..1909efa1c52 100644
--- a/src/emu/sound/saa1099.h
+++ b/src/emu/sound/saa1099.h
@@ -103,6 +103,7 @@ private:
saa1099_channel m_channels[6]; /* channels */
saa1099_noise m_noise[2]; /* noise generators */
double m_sample_rate;
+ int m_master_clock;
};
extern const device_type SAA1099;
diff --git a/src/emu/sound/sn76496.c b/src/emu/sound/sn76496.c
index 13ae3ce99b0..7d0ccf50319 100644
--- a/src/emu/sound/sn76496.c
+++ b/src/emu/sound/sn76496.c
@@ -142,6 +142,38 @@ sn76496_base_device::sn76496_base_device(const machine_config &mconfig, device_t
{
}
+sn76496_device::sn76496_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : sn76496_base_device(mconfig, SN76496, "SN76496", tag, 0x10000, 0x04, 0x08, false, false, 8, true, owner, clock, "sn76496", __FILE__)
+ { }
+u8106_device::u8106_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : sn76496_base_device(mconfig, U8106, "U8106", tag, 0x4000, 0x01, 0x02, true, false, 8, true, owner, clock, "u8106", __FILE__)
+ { }
+y2404_device::y2404_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : sn76496_base_device(mconfig, Y2404, "Y2404", tag, 0x10000, 0x04, 0x08, false, false, 8, true, owner, clock, "y2404", __FILE__)
+ { }
+sn76489_device::sn76489_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : sn76496_base_device(mconfig, SN76489, "SN76489", tag, 0x4000, 0x01, 0x02, true, false, 8, true, owner, clock, "sn76489", __FILE__)
+ { }
+sn76489a_device::sn76489a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : sn76496_base_device(mconfig, SN76489A, "SN76489A", tag, 0x10000, 0x04, 0x08, false, false, 8, true, owner, clock, "sn76489a", __FILE__)
+ { }
+sn76494_device::sn76494_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : sn76496_base_device(mconfig, SN76494, "SN76494", tag, 0x10000, 0x04, 0x08, false, false, 1, true, owner, clock, "sn76494", __FILE__)
+ { }
+sn94624_device::sn94624_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : sn76496_base_device(mconfig, SN94624, "SN94624", tag, 0x4000, 0x01, 0x02, true, false, 1, true, owner, clock, "sn94624", __FILE__)
+ { }
+ncr7496_device::ncr7496_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : sn76496_base_device(mconfig, NCR7496, "NCR7496", tag, 0x8000, 0x02, 0x20, false, false, 8, true, owner, clock, "ncr7496", __FILE__)
+ { }
+gamegear_device::gamegear_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : sn76496_base_device(mconfig, GAMEGEAR, "Game Gear PSG", tag, 0x8000, 0x01, 0x08, true, true, 8, false, owner, clock, "gamegear_psg", __FILE__)
+ { }
+segapsg_device::segapsg_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : sn76496_base_device(mconfig, SEGAPSG, "SEGA VDP PSG", tag, 0x8000, 0x01, 0x08, true, false, 8, false, owner, clock, "segapsg", __FILE__)
+ { }
+
+
void sn76496_base_device::device_start()
{
int sample_rate = clock()/2;
@@ -217,16 +249,8 @@ void sn76496_base_device::write(UINT8 data)
m_sound->update();
// set number of cycles until READY is active; this is always one
- // 'sample', i.e. it equals the clock divider exactly; until the
- // clock divider is fully supported, we delay until one sample has
- // played. The fact that this below is '2' and not '1' is because
- // of a ?race condition? in the mess crvision driver, where after
- // any sample is played at all, no matter what, the cycles_to_ready
- // ends up never being not ready, unless this value is greater than
- // 1. Once the full clock divider stuff is written, this should no
- // longer be an issue.
-
- m_cycles_to_ready = 2;
+ // 'sample', i.e. it equals the clock divider exactly
+ m_cycles_to_ready = 1;
if (data & 0x80)
{
diff --git a/src/emu/sound/sn76496.h b/src/emu/sound/sn76496.h
index 8cb9e69f85f..bedee2de532 100644
--- a/src/emu/sound/sn76496.h
+++ b/src/emu/sound/sn76496.h
@@ -33,6 +33,7 @@ public:
DECLARE_WRITE8_MEMBER( stereo_w );
void write(UINT8 data);
DECLARE_WRITE8_MEMBER( write );
+ DECLARE_READ_LINE_MEMBER( ready_r ) { return m_ready_state ? 1 : 0; }
protected:
virtual void device_start();
@@ -74,90 +75,70 @@ private:
class sn76496_device : public sn76496_base_device
{
public:
- sn76496_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : sn76496_base_device(mconfig, SN76496, "SN76496", tag, 0x10000, 0x04, 0x08, false, false, 8, true, owner, clock, "sn76496", __FILE__)
- { }
+ sn76496_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
// U8106 not verified yet. todo: verify; (a custom marked sn76489? only used on mr. do and maybe other universal games)
class u8106_device : public sn76496_base_device
{
public:
- u8106_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : sn76496_base_device(mconfig, U8106, "U8106", tag, 0x4000, 0x01, 0x02, true, false, 8, true, owner, clock, "u8106", __FILE__)
- { }
+ u8106_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
// Y2404 not verified yet. todo: verify; (don't be fooled by the Y, it's a TI chip, not Yamaha)
class y2404_device : public sn76496_base_device
{
public:
- y2404_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : sn76496_base_device(mconfig, Y2404, "Y2404", tag, 0x10000, 0x04, 0x08, false, false, 8, true, owner, clock, "y2404", __FILE__)
- { }
+ y2404_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
// SN76489 not verified yet. todo: verify;
class sn76489_device : public sn76496_base_device
{
public:
- sn76489_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : sn76496_base_device(mconfig, SN76489, "SN76489", tag, 0x4000, 0x01, 0x02, true, false, 8, true, owner, clock, "sn76489", __FILE__)
- { }
+ sn76489_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
// SN76489A: whitenoise verified, phase verified, periodic verified (by plgdavid)
class sn76489a_device : public sn76496_base_device
{
public:
- sn76489a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : sn76496_base_device(mconfig, SN76489A, "SN76489A", tag, 0x10000, 0x04, 0x08, false, false, 8, true, owner, clock, "sn76489a", __FILE__)
- { }
+ sn76489a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
// SN76494 not verified, (according to datasheet: same as sn76489a but without the /8 divider)
class sn76494_device : public sn76496_base_device
{
public:
- sn76494_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : sn76496_base_device(mconfig, SN76494, "SN76494", tag, 0x10000, 0x04, 0x08, false, false, 1, true, owner, clock, "sn76494", __FILE__)
- { }
+ sn76494_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
// SN94624 whitenoise verified, phase verified, period verified; verified by PlgDavid
class sn94624_device : public sn76496_base_device
{
public:
- sn94624_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : sn76496_base_device(mconfig, SN94624, "SN94624", tag, 0x4000, 0x01, 0x02, true, false, 1, true, owner, clock, "sn94624", __FILE__)
- { }
+ sn94624_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
// NCR7496 not verified; info from smspower wiki
class ncr7496_device : public sn76496_base_device
{
public:
- ncr7496_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : sn76496_base_device(mconfig, NCR7496, "NCR7496", tag, 0x8000, 0x02, 0x20, false, false, 8, true, owner, clock, "ncr7496", __FILE__)
- { }
+ ncr7496_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
// Verified by Justin Kerk
class gamegear_device : public sn76496_base_device
{
public:
- gamegear_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : sn76496_base_device(mconfig, GAMEGEAR, "Game Gear PSG", tag, 0x8000, 0x01, 0x08, true, true, 8, false, owner, clock, "gamegear_psg", __FILE__)
- { }
+ gamegear_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
// todo: verify; from smspower wiki, assumed to have same invert as gamegear
class segapsg_device : public sn76496_base_device
{
public:
- segapsg_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : sn76496_base_device(mconfig, SEGAPSG, "SEGA VDP PSG", tag, 0x8000, 0x01, 0x08, true, false, 8, false, owner, clock, "segapsg", __FILE__)
- { }
+ segapsg_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
#endif /* __SN76496_H__ */
diff --git a/src/emu/sound/spu.h b/src/emu/sound/spu.h
index 7092df970fa..8a6727e4833 100644
--- a/src/emu/sound/spu.h
+++ b/src/emu/sound/spu.h
@@ -41,7 +41,7 @@ class spu_device : public device_t, public device_sound_interface
dirtyflag_voice_mask=0x00ffffff,
dirtyflag_reverb=0x01000000,
dirtyflag_ram=0x02000000,
- dirtyflag_irq=0x04000000,
+ dirtyflag_irq=0x04000000
};
protected:
diff --git a/src/emu/sound/st0016.c b/src/emu/sound/st0016.c
index 4c75f3f7b02..99328a93b4d 100644
--- a/src/emu/sound/st0016.c
+++ b/src/emu/sound/st0016.c
@@ -45,6 +45,11 @@ void st0016_device::device_start()
{
m_stream = stream_alloc(0, 2, 44100);
m_ram_read_cb.resolve_safe(0);
+
+ save_item(NAME(m_vpos));
+ save_item(NAME(m_frac));
+ save_item(NAME(m_lponce));
+ save_item(NAME(m_regs));
}
diff --git a/src/emu/sound/tms36xx.c b/src/emu/sound/tms36xx.c
index 3bc5425bade..c170b1305b1 100644
--- a/src/emu/sound/tms36xx.c
+++ b/src/emu/sound/tms36xx.c
@@ -375,6 +375,21 @@ void tms36xx_device::device_start()
m_decay[0], m_decay[1], m_decay[2],
m_decay[3], m_decay[4], m_decay[5]));
LOG(("TMS36xx speed %d\n", m_speed));
+
+ save_item(NAME(m_octave));
+ save_item(NAME(m_tune_counter));
+ save_item(NAME(m_note_counter));
+ save_item(NAME(m_voices));
+ save_item(NAME(m_shift));
+ save_item(NAME(m_vol));
+ save_item(NAME(m_vol_counter));
+ save_item(NAME(m_counter));
+ save_item(NAME(m_frequency));
+ save_item(NAME(m_output));
+ save_item(NAME(m_enable));
+ save_item(NAME(m_tune_num));
+ save_item(NAME(m_tune_ofs));
+ save_item(NAME(m_tune_max));
}
diff --git a/src/emu/sound/tms5110.c b/src/emu/sound/tms5110.c
index 03729598737..c5861e2d7c6 100644
--- a/src/emu/sound/tms5110.c
+++ b/src/emu/sound/tms5110.c
@@ -68,17 +68,15 @@
#define MAX_SAMPLE_CHUNK 512
-/* Variants */
+/* 6 Variants, from tms5110r.inc */
-#define TMS5110_IS_5110A (1)
-#define TMS5110_IS_5100 (2)
-#define TMS5110_IS_5110 (3)
+#define TMS5110_IS_TMC0281 (1)
+#define TMS5110_IS_TMC0281D (2)
+#define TMS5110_IS_CD2801 (3)
+#define TMS5110_IS_CD2802 (4)
+#define TMS5110_IS_TMS5110A (5)
+#define TMS5110_IS_M58817 (6)
-#define TMS5110_IS_CD2801 TMS5110_IS_5100
-#define TMS5110_IS_TMC0281 TMS5110_IS_5100
-
-#define TMS5110_IS_CD2802 TMS5110_IS_5110
-#define TMS5110_IS_M58817 TMS5110_IS_5110
/* States for CTL */
@@ -104,14 +102,23 @@ void tms5110_device::set_variant(int variant)
{
switch (variant)
{
- case TMS5110_IS_5110A:
- m_coeff = &tms5110a_coeff;
+ case TMS5110_IS_TMC0281:
+ m_coeff = &T0280B_0281A_coeff;
+ break;
+ case TMS5110_IS_TMC0281D:
+ m_coeff = &T0280D_0281D_coeff;
+ break;
+ case TMS5110_IS_CD2801:
+ m_coeff = &T0280F_2801A_coeff;
break;
- case TMS5110_IS_5100:
- m_coeff = &pat4209836_coeff;
+ case TMS5110_IS_M58817:
+ m_coeff = &M58817_coeff;
break;
- case TMS5110_IS_5110:
- m_coeff = &pat4403965_coeff;
+ case TMS5110_IS_CD2802:
+ m_coeff = &T0280F_2802_coeff;
+ break;
+ case TMS5110_IS_TMS5110A:
+ m_coeff = &tms5110a_coeff;
break;
default:
fatalerror("Unknown variant in tms5110_create\n");
@@ -490,21 +497,17 @@ void tms5110_device::process(INT16 *buffer, unsigned int size)
}
else
{
- /* generate voiced samples here */
+ // generate voiced samples here
/* US patent 4331836 Figure 14B shows, and logic would hold, that a pitch based chirp
* function has a chirp/peak and then a long chain of zeroes.
- * The last entry of the chirp rom is at address 0b110011 (50d), the 51st sample,
+ * The last entry of the chirp rom is at address 0b110011 (51d), the 52nd sample,
* and if the address reaches that point the ADDRESS incrementer is
- * disabled, forcing all samples beyond 50d to be == 50d
- * (address 50d holds zeroes)
+ * disabled, forcing all samples beyond 51d to be == 51d
*/
-
- /*if (m_coeff->subtype & (SUBTYPE_TMS5100 | SUBTYPE_M58817))*/
-
- if (m_pitch_count > 50)
- current_val = m_coeff->chirptable[50];
- else
- current_val = m_coeff->chirptable[m_pitch_count];
+ if (m_pitch_count >= 51)
+ current_val = (INT8)m_coeff->chirptable[51];
+ else /*m_pitch_count < 51*/
+ current_val = (INT8)m_coeff->chirptable[m_pitch_count];
}
/* Update LFSR *20* times every sample, like patent shows */
@@ -873,7 +876,7 @@ void tms5110_device::device_start()
{
m_table = region()->base();
- set_variant(TMS5110_IS_5110A);
+ set_variant(TMS5110_IS_TMS5110A);
/* resolve lines */
m_m0_cb.resolve();
@@ -898,37 +901,47 @@ void tms5110_device::device_start()
void tms5100_device::device_start()
{
tms5110_device::device_start();
- set_variant(TMS5110_IS_5100);
+ set_variant(TMS5110_IS_TMC0281);
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
-void tms5110a_device::device_start()
+void tmc0281_device::device_start()
{
tms5110_device::device_start();
- set_variant(TMS5110_IS_5110A);
+ set_variant(TMS5110_IS_TMC0281);
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
-void cd2801_device::device_start()
+void tms5100a_device::device_start()
{
tms5110_device::device_start();
- set_variant(TMS5110_IS_CD2801);
+ set_variant(TMS5110_IS_TMC0281D);
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
-void tmc0281_device::device_start()
+void tmc0281d_device::device_start()
{
tms5110_device::device_start();
- set_variant(TMS5110_IS_TMC0281);
+ set_variant(TMS5110_IS_TMC0281D);
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void cd2801_device::device_start()
+{
+ tms5110_device::device_start();
+ set_variant(TMS5110_IS_CD2801);
}
//-------------------------------------------------
@@ -945,6 +958,16 @@ void cd2802_device::device_start()
// device_start - device-specific startup
//-------------------------------------------------
+void tms5110a_device::device_start()
+{
+ tms5110_device::device_start();
+ set_variant(TMS5110_IS_TMS5110A);
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
void m58817_device::device_start()
{
tms5110_device::device_start();
@@ -1365,36 +1388,38 @@ tms5110_device::tms5110_device(const machine_config &mconfig, device_type type,
const device_type TMS5100 = &device_creator<tms5100_device>;
-
tms5100_device::tms5100_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: tms5110_device(mconfig, TMS5100, "TMS5100", tag, owner, clock, "tms5100", __FILE__)
{
}
+const device_type TMC0281 = &device_creator<tmc0281_device>;
-const device_type TMS5110A = &device_creator<tms5110a_device>;
-
-tms5110a_device::tms5110a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : tms5110_device(mconfig, TMS5110A, "TMS5110A", tag, owner, clock, "tms5110a", __FILE__)
+tmc0281_device::tmc0281_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : tms5110_device(mconfig, TMC0281, "TMC0281", tag, owner, clock, "tmc0281", __FILE__)
{
}
+const device_type TMS5100A = &device_creator<tms5100a_device>;
-const device_type CD2801 = &device_creator<cd2801_device>;
-
-cd2801_device::cd2801_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : tms5110_device(mconfig, CD2801, "CD2801", tag, owner, clock, "cd2801", __FILE__)
+tms5100a_device::tms5100a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : tms5110_device(mconfig, TMS5100A, "TMS5100A", tag, owner, clock, "tms5100a", __FILE__)
{
}
+const device_type TMC0281D = &device_creator<tmc0281d_device>;
-const device_type TMC0281 = &device_creator<tmc0281_device>;
-
-tmc0281_device::tmc0281_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : tms5110_device(mconfig, TMC0281, "TMC0281", tag, owner, clock, "tmc0281", __FILE__)
+tmc0281d_device::tmc0281d_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : tms5110_device(mconfig, TMC0281D, "TMC0281D", tag, owner, clock, "tmc0281d", __FILE__)
{
}
+const device_type CD2801 = &device_creator<cd2801_device>;
+
+cd2801_device::cd2801_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : tms5110_device(mconfig, CD2801, "CD2801", tag, owner, clock, "cd2801", __FILE__)
+{
+}
const device_type CD2802 = &device_creator<cd2802_device>;
@@ -1403,6 +1428,12 @@ cd2802_device::cd2802_device(const machine_config &mconfig, const char *tag, dev
{
}
+const device_type TMS5110A = &device_creator<tms5110a_device>;
+
+tms5110a_device::tms5110a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : tms5110_device(mconfig, TMS5110A, "TMS5110A", tag, owner, clock, "tms5110a", __FILE__)
+{
+}
const device_type M58817 = &device_creator<m58817_device>;
diff --git a/src/emu/sound/tms5110.h b/src/emu/sound/tms5110.h
index 6196834a24a..43863042940 100644
--- a/src/emu/sound/tms5110.h
+++ b/src/emu/sound/tms5110.h
@@ -185,38 +185,49 @@ protected:
extern const device_type TMS5100;
-class tms5110a_device : public tms5110_device
+class tmc0281_device : public tms5110_device
{
public:
- tms5110a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ tmc0281_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
protected:
// device-level overrides
virtual void device_start();
};
-extern const device_type TMS5110A;
+extern const device_type TMC0281;
-class cd2801_device : public tms5110_device
+class tms5100a_device : public tms5110_device
{
public:
- cd2801_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ tms5100a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
protected:
// device-level overrides
virtual void device_start();
};
-extern const device_type CD2801;
+extern const device_type TMS5100A;
-class tmc0281_device : public tms5110_device
+class tmc0281d_device : public tms5110_device
{
public:
- tmc0281_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ tmc0281d_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
protected:
// device-level overrides
virtual void device_start();
};
-extern const device_type TMC0281;
+extern const device_type TMC0281D;
+
+class cd2801_device : public tms5110_device
+{
+public:
+ cd2801_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+protected:
+ // device-level overrides
+ virtual void device_start();
+};
+
+extern const device_type CD2801;
class cd2802_device : public tms5110_device
{
@@ -229,6 +240,17 @@ protected:
extern const device_type CD2802;
+class tms5110a_device : public tms5110_device
+{
+public:
+ tms5110a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+protected:
+ // device-level overrides
+ virtual void device_start();
+};
+
+extern const device_type TMS5110A;
+
class m58817_device : public tms5110_device
{
public:
diff --git a/src/emu/sound/tms5110r.inc b/src/emu/sound/tms5110r.inc
index 4e20ef96e2d..41abe5caea4 100644
--- a/src/emu/sound/tms5110r.inc
+++ b/src/emu/sound/tms5110r.inc
@@ -37,14 +37,34 @@
/* quick note on derivative analysis:
Judging by all the TI chips I (Lord Nightmare) have done this test on, the first derivative between successive values of the LPC tables should follow a roughly triangular or sine shaped curve, the second derivative should start at a value, increase slightly, then decrease smoothly and become negative right around where the LPC curve passes 0, finally increase slightly right near the end. If it doesn't do this, there is probably a wrong value in there somewhere. The pitch and energy tables follow similar patterns but aren't the same since they never cross 0. The chirp table doesn't follow this pattern at all.
*/
-/* chip type defines */
-#define SUBTYPE_TMS5100 1
-#define SUBTYPE_M58817 2
-#define SUBTYPE_TMS5110 4
-#define SUBTYPE_TMS5200 8
-#define SUBTYPE_TMS5220 16
-#define SUBTYPE_PAT4335277 32
-#define SUBTYPE_VLM5030 64
+
+ /* Chip types based on die marks from decap:
+ chip type
+ |||||| rom number
+ |||||| |||||
+ VVVVVV VVVVV
+ T0280A 0281 = 1978 speak & spell, unknown difference to below, assumed same? uses old chirp
+ T0280B 0281A = 1979 speak & spell, also == TMS5100, uses old chirp
+ ?????? ????? (no decap; likely 'T0280D 0281D') = 1980 speak & spell, 1981 speak & spell compact, changed energy table, otherwise same as above, uses old chirp
+ T0280F 2801A = 1980 speak & math, 1980 speak and read, uses old chirp
+ ?????? ????? (no decap; likely 'T0280F 2802') = touch and tell, language translator; uses a unique chirp rom.
+ ?????? ????? = TMS5110
+ T0280F 5110A = TMS5110AN2L
+
+
+ */
+
+/* chip rom contents defines */
+#define SUBTYPE_0281A 1
+#define SUBTYPE_0281D 2
+#define SUBTYPE_2801A 4
+#define SUBTYPE_M58817 8
+#define SUBTYPE_2802 16
+#define SUBTYPE_5110 32
+#define SUBTYPE_2501E 64
+#define SUBTYPE_5220 128
+#define SUBTYPE_PAT4335277 256
+#define SUBTYPE_VLM5030 512
/* coefficient defines */
#define MAX_K 10
@@ -67,85 +87,348 @@ struct tms5100_coeffs
INT8 interp_coeff[8];
};
-/*
-TMS5100/TMC0281 Die revs A, B
-History
-The TMS5100NL was decapped and imaged by digshadow in April, 2013.
-The LPC table is verified to match the decap.
- It also matches the intended contents of US Patent 4,209,836 and several others.
-The chirp table is verified to match the decap, and also matches the patents.
-The TMS5100 (development name: TMC0280) and the Speak & Spell's "CD2801" chip
-are believed to be the same silicon. The 5100 decapped by digshadow had the die
-markings: "0281 B 281A"
-In December 2014, Sean riddle decapped a TMC0281 die from 1978 from an early speak
-and spell. The TMC0281 die had the die markings "0281 A 281"; the chirp table matches
-what digshadow had decapped earlier.
+/* common, shared coefficients */
+/* energy */
+#define TI_0280_PATENT_ENERGY \
+ /* E */\
+ { 0, 0, 1, 1, 2, 3, 5, 7, \
+ 10, 15, 21, 30, 43, 61, 86, COEFF_ENERGY_SENTINEL }, // last rom value is actually really 0, but the tms5110.c code still requires the sentinel value to function correctly, until it is properly updated or merged with tms5220.c
+
+#define TI_0280_LATER_ENERGY \
+ /* E */\
+ { 0, 1, 2, 3, 4, 6, 8, 11, \
+ 16, 23, 33, 47, 63, 85,114, COEFF_ENERGY_SENTINEL }, // last rom value is actually really 0, but the tms5110.c code still requires the sentinel value to function correctly, until it is properly updated or merged with tms5220.c
+
+//technically this is the same as above, but tms5220.c expects the 0 rather than needing a sentinel value
+//TODO: when tms5110.c no longer needs sentinel, get rid of this and merge with above.
+#define TI_0285_LATER_ENERGY \
+ /* E */\
+ { 0, 1, 2, 3, 4, 6, 8, 11, \
+ 16, 23, 33, 47, 63, 85,114, 0 },
+
+
+/* pitch */
+#define TI_0280_2801_PATENT_PITCH \
+ /* P */\
+ { 0, 41, 43, 45, 47, 49, 51, 53, \
+ 55, 58, 60, 63, 66, 70, 73, 76, \
+ 79, 83, 87, 90, 94, 99, 103, 107, \
+ 112, 118, 123, 129, 134, 140, 147, 153 },
+
+#define TI_2802_PITCH \
+ /* P */\
+ { 0, 16, 18, 19, 21, 24, 26, 28, \
+ 31, 35, 37, 42, 44, 47, 50, 53, \
+ 56, 59, 63, 67, 71, 75, 79, 84, \
+ 89, 94, 100, 106, 112, 126, 141, 150},
+
+#define TI_5110_PITCH \
+ /* P */\
+ { 0, 15, 16, 17, 19, 21, 22, 25, \
+ 26, 29, 32, 36, 40, 42, 46, 50, \
+ 55, 60, 64, 68, 72, 76, 80, 84, \
+ 86, 93, 101, 110, 120, 132, 144, 159},
+
+#define TI_2501E_PITCH \
+ /* P */\
+ { 0, 14, 15, 16, 17, 18, 19, 20, \
+ 21, 22, 23, 24, 25, 26, 27, 28, \
+ 29, 30, 31, 32, 34, 36, 38, 40, \
+ 41, 43, 45, 48, 49, 51, 54, 55, \
+ 57, 60, 62, 64, 68, 72, 74, 76, \
+ 81, 85, 87, 90, 96, 99, 103, 107, \
+ 112, 117, 122, 127, 133, 139, 145, 151, \
+ 157, 164, 171, 178, 186, 194, 202, 211},
+
+#define TI_5220_PITCH \
+ /* P */\
+ { 0, 15, 16, 17, 18, 19, 20, 21, \
+ 22, 23, 24, 25, 26, 27, 28, 29, \
+ 30, 31, 32, 33, 34, 35, 36, 37, \
+ 38, 39, 40, 41, 42, 44, 46, 48, \
+ 50, 52, 53, 56, 58, 60, 62, 65, \
+ 68, 70, 72, 76, 78, 80, 84, 86, \
+ 91, 94, 98, 101, 105, 109, 114, 118, \
+ 122, 127, 132, 137, 142, 148, 153, 159},
+
+/* LPC */
+#define TI_0280_PATENT_LPC \
+ /* K1 */\
+ { -501, -497, -493, -488, -480, -471, -460, -446,\
+ -427, -405, -378, -344, -305, -259, -206, -148,\
+ -86, -21, 45, 110, 171, 227, 277, 320,\
+ 357, 388, 413, 434, 451, 464, 474, 498 },\
+ /* K2 */\
+ { -349, -328, -305, -280, -252, -223, -192, -158,\
+ -124, -88, -51, -14, 23, 60, 97, 133,\
+ 167, 199, 230, 259, 286, 310, 333, 354,\
+ 372, 389, 404, 417, 429, 439, 449, 506 },\
+ /* K3 */\
+ { -397, -365, -327, -282, -229, -170, -104, -36,\
+ 35, 104, 169, 228, 281, 326, 364, 396 },\
+ /* K4 */\
+ { -369, -334, -293, -245, -191, -131, -67, -1,\
+ 64, 128, 188, 243, 291, 332, 367, 397 },\
+ /* K5 */\
+ { -319, -286, -250, -211, -168, -122, -74, -25,\
+ 24, 73, 121, 167, 210, 249, 285, 318 },\
+ /* K6 */\
+ { -290, -252, -209, -163, -114, -62, -9, 44,\
+ 97, 147, 194, 238, 278, 313, 344, 371 },\
+ /* K7 */\
+ { -291, -256, -216, -174, -128, -80, -31, 19,\
+ 69, 117, 163, 206, 246, 283, 316, 345 },\
+ /* K8 */\
+ { -218, -133, -38, 59, 152, 235, 305, 361 },\
+ /* K9 */\
+ { -226, -157, -82, -3, 76, 151, 220, 280 },\
+ /* K10 */\
+ { -179, -122, -61, 1, 62, 123, 179, 231 },
+
+#define TI_2801_2501E_LPC \
+ /* K1 */\
+ { -501, -498, -495, -490, -485, -478, -469, -459,\
+ -446, -431, -412, -389, -362, -331, -295, -253,\
+ -207, -156, -102, -45, 13, 70, 126, 179,\
+ 228, 272, 311, 345, 374, 399, 420, 437 },\
+ /* K2 */\
+ { -376, -357, -335, -312, -286, -258, -227, -195,\
+ -161, -124, -87, -49, -10, 29, 68, 106,\
+ 143, 178, 212, 243, 272, 299, 324, 346,\
+ 366, 384, 400, 414, 427, 438, 448, 506 },\
+ /* K3 */\
+ { -407, -381, -349, -311, -268, -218, -162, -102,\
+ -39, 25, 89, 149, 206, 257, 302, 341 },\
+ /* K4 */\
+ { -290, -252, -209, -163, -114, -62, -9, 44,\
+ 97, 147, 194, 238, 278, 313, 344, 371 },\
+ /* K5 */\
+ { -318, -283, -245, -202, -156, -107, -56, -3,\
+ 49, 101, 150, 196, 239, 278, 313, 344 },\
+ /* K6 */\
+ { -193, -152, -109, -65, -20, 26, 71, 115,\
+ 158, 198, 235, 270, 301, 330, 355, 377 },\
+ /* K7 */\
+ { -254, -218, -180, -140, -97, -53, -8, 36,\
+ 81, 124, 165, 204, 240, 274, 304, 332 },\
+ /* K8 */\
+ { -205, -112, -10, 92, 187, 269, 336, 387 },\
+ /* K9 */\
+ { -249, -183, -110, -32, 48, 126, 198, 261 }, /* on patents 4,403,965 and 4,946,391 the 4th entry is 0x3ED (-19) which is a typo of the correct value of 0x3E0 (-32)*/\
+ /* K10 */\
+ { -190, -133, -73, -10, 53, 115, 173, 227 },
+
+// below is the same as 2801/2501E above EXCEPT for K4 which is completely different.
+#define TI_2802_LPC \
+ /* K1 */\
+ { -501, -498, -495, -490, -485, -478, -469, -459,\
+ -446, -431, -412, -389, -362, -331, -295, -253,\
+ -207, -156, -102, -45, 13, 70, 126, 179,\
+ 228, 272, 311, 345, 374, 399, 420, 437},\
+ /* K2 */\
+ { -376, -357, -335, -312, -286, -258, -227, -195,\
+ -161, -124, -87, -49, -10, 29, 68, 106,\
+ 143, 178, 212, 243, 272, 299, 324, 346,\
+ 366, 384, 400, 414, 427, 438, 448, 506},\
+ /* K3 */\
+ { -407, -381, -349, -311, -268, -218, -162, -102,\
+ -39, 25, 89, 149, 206, 257, 302, 341},\
+ /* K4 */\
+ { -289, -248, -202, -152, -98, -43, 14, 71,\
+ 125, 177, 225, 269, 307, 341, 371, 506},\
+ /* K5 */\
+ { -318, -283, -245, -202, -156, -107, -56, -3,\
+ 49, 101, 150, 196, 239, 278, 313, 344},\
+ /* K6 */\
+ { -193, -152, -109, -65, -20, 26, 71, 115,\
+ 158, 198, 235, 270, 301, 330, 355, 377},\
+ /* K7 */\
+ { -254, -218, -180, -140, -97, -53, -8, 36,\
+ 81, 124, 165, 204, 240, 274, 304, 332},\
+ /* K8 */\
+ { -205, -112, -10, 92, 187, 269, 336, 387},\
+ /* K9 */\
+ { -249, -183, -110, -32, 48, 126, 198, 261},\
+ /* K10 */\
+ { -190, -133, -73, -10, 53, 115, 173, 227},
+
+#define TI_5110_5220_LPC \
+ /* K1 */\
+ { -501, -498, -497, -495, -493, -491, -488, -482,\
+ -478, -474, -469, -464, -459, -452, -445, -437,\
+ -412, -380, -339, -288, -227, -158, -81, -1,\
+ 80, 157, 226, 287, 337, 379, 411, 436 },\
+ /* K2 */\
+ { -328, -303, -274, -244, -211, -175, -138, -99,\
+ -59, -18, 24, 64, 105, 143, 180, 215,\
+ 248, 278, 306, 331, 354, 374, 392, 408,\
+ 422, 435, 445, 455, 463, 470, 476, 506 },\
+ /* K3 */\
+ { -441, -387, -333, -279, -225, -171, -117, -63,\
+ -9, 45, 98, 152, 206, 260, 314, 368 },\
+ /* K4 */\
+ { -328, -273, -217, -161, -106, -50, 5, 61,\
+ 116, 172, 228, 283, 339, 394, 450, 506 },\
+ /* K5 */\
+ { -328, -282, -235, -189, -142, -96, -50, -3,\
+ 43, 90, 136, 182, 229, 275, 322, 368 },\
+ /* K6 */\
+ { -256, -212, -168, -123, -79, -35, 10, 54,\
+ 98, 143, 187, 232, 276, 320, 365, 409 },\
+ /* K7 */\
+ { -308, -260, -212, -164, -117, -69, -21, 27,\
+ 75, 122, 170, 218, 266, 314, 361, 409 },\
+ /* K8 */\
+ { -256, -161, -66, 29, 124, 219, 314, 409 },\
+ /* K9 */\
+ { -256, -176, -96, -15, 65, 146, 226, 307 },\
+ /* K10 */\
+ { -205, -132, -59, 14, 87, 160, 234, 307 },
+
+/* chirp */
+#define TI_0280_PATENT_CHIRP \
+ /* Chirp table */\
+ { 0x00, 0x2a, 0xd4, 0x32, 0xb2, 0x12, 0x25, 0x14,\
+ 0x02, 0xe1, 0xc5, 0x02, 0x5f, 0x5a, 0x05, 0x0f,\
+ 0x26, 0xfc, 0xa5, 0xa5, 0xd6, 0xdd, 0xdc, 0xfc,\
+ 0x25, 0x2b, 0x22, 0x21, 0x0f, 0xff, 0xf8, 0xee,\
+ 0xed, 0xef, 0xf7, 0xf6, 0xfa, 0x00, 0x03, 0x02,\
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
+ 0x00, 0x00, 0x00, 0x00 },
+
+// almost, but not exactly the same as the patent chirp above (25 bits differ)
+#define TI_2801_CHIRP \
+ /* Chirp table */\
+ { 0x00, 0x2b, 0xd4, 0x33, 0xb3, 0x12, 0x25, 0x14,\
+ 0x02, 0xe2, 0xc6, 0x03, 0x60, 0x5b, 0x05, 0x0f,\
+ 0x26, 0xfc, 0xa6, 0xa5, 0xd6, 0xdd, 0xdd, 0xfd,\
+ 0x25, 0x2b, 0x23, 0x22, 0x0f, 0xff, 0xf8, 0xef,\
+ 0xed, 0xef, 0xf7, 0xf7, 0xfa, 0x01, 0x04, 0x03,\
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
+ 0x00, 0x00, 0x00, 0x00 },
+
+//TODO: Fix me! below is INACCURATE, no decap of 2802 yet!
+#define TI_2802_CHIRP \
+ /* Chirp table */\
+ { 0x00, 0xa3, 0xbe, 0xee, 0x38, 0x78, 0x7f, 0x3e,\
+ 0xe2, 0xe0, 0x26, 0x19, 0xce, 0x06, 0x1e, 0xd0,\
+ 0x12, 0xcd, 0xea, 0xde, 0xda, 0x02, 0xff, 0x06,\
+ 0xfe, 0x00, 0xfe, 0xfb, 0xfd, 0xfd, 0x00, 0x00,\
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00,\
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
+ 0x00, 0x00, 0x00, 0x00 },
+
+#define TI_LATER_CHIRP \
+ /* Chirp table */\
+ { 0x00, 0x03, 0x0f, 0x28, 0x4c, 0x6c, 0x71, 0x50,\
+ 0x25, 0x26, 0x4c, 0x44, 0x1a, 0x32, 0x3b, 0x13,\
+ 0x37, 0x1a, 0x25, 0x1f, 0x1d, 0x00, 0x00, 0x00,\
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
+ 0x00, 0x00, 0x00, 0x00 },
+
+/* TMS5100/TMC0281:
+ (Die revs A, B; 1977?-1981?)
+ The TMS5100NL was decapped and imaged by digshadow in April, 2013.
+ The LPC table is verified to match the decap.
+ It also matches the intended contents of US Patent 4,209,836 and several others.
+ The chirp table is verified to match the decap, and also matches the patents.
+ In April, 2013, digshadow decapped a TMS5100 chip from 1980: http://siliconpr0n.org/map/ti/tms5100nl/
+ The TMS5100 had the die markings: "0281 B 281A"
+ In December 2014, Sean riddle decapped a TMC0281 chip from 1978 from an early speak
+ and spell.
+ The TMC0281 die had the die markings "0281 A 281"
+ The chirp table matches what digshadow had decapped earlier.
+ The LPC table hasn't been fully typed yet.
+ Digitally dumped via PROMOUT by PlgDavid in 2014 for verification.
*/
-static const struct tms5100_coeffs pat4209836_coeff =
+static const struct tms5100_coeffs T0280B_0281A_coeff =
{
/* subtype */
- SUBTYPE_TMS5100,
+ SUBTYPE_0281A,
10,
4,
5,
{ 5, 5, 4, 4, 4, 4, 4, 3, 3, 3 },
- /* E */
- { 0, 0, 1, 1, 2, 3, 5, 7,
- 10, 15, 21, 30, 43, 61, 86, COEFF_ENERGY_SENTINEL }, // last rom value is actually really 0, but the tms5110.c code still requires the sentinel value to function correctly, until it is properly updated or merged with tms5220.c
- /* P */
- { 0, 41, 43, 45, 47, 49, 51, 53,
- 55, 58, 60, 63, 66, 70, 73, 76,
- 79, 83, 87, 90, 94, 99, 103, 107,
- 112, 118, 123, 129, 134, 140, 147, 153 },
+ TI_0280_PATENT_ENERGY
+ TI_0280_2801_PATENT_PITCH
{
- /* K1 */
- { -501, -497, -493, -488, -480, -471, -460, -446,
- -427, -405, -378, -344, -305, -259, -206, -148,
- -86, -21, 45, 110, 171, 227, 277, 320,
- 357, 388, 413, 434, 451, 464, 474, 498 },
- /* K2 */
- { -349, -328, -305, -280, -252, -223, -192, -158,
- -124, -88, -51, -14, 23, 60, 97, 133,
- 167, 199, 230, 259, 286, 310, 333, 354,
- 372, 389, 404, 417, 429, 439, 449, 506 },
- /* K3 */
- { -397, -365, -327, -282, -229, -170, -104, -36,
- 35, 104, 169, 228, 281, 326, 364, 396 },
- /* K4 */
- { -369, -334, -293, -245, -191, -131, -67, -1,
- 64, 128, 188, 243, 291, 332, 367, 397 },
- /* K5 */
- { -319, -286, -250, -211, -168, -122, -74, -25,
- 24, 73, 121, 167, 210, 249, 285, 318 },
- /* K6 */
- { -290, -252, -209, -163, -114, -62, -9, 44,
- 97, 147, 194, 238, 278, 313, 344, 371 },
- /* K7 */
- { -291, -256, -216, -174, -128, -80, -31, 19,
- 69, 117, 163, 206, 246, 283, 316, 345 },
- /* K8 */
- { -218, -133, -38, 59, 152, 235, 305, 361 },
- /* K9 */
- { -226, -157, -82, -3, 76, 151, 220, 280 },
- /* K10 */
- { -179, -122, -61, 1, 62, 123, 179, 231 },
+ TI_0280_PATENT_LPC
},
- /* Chirp table */
- { 0, 42, -44, 50, -78, 18, 37, 20,
- 2, -31, -59, 2, 95, 90, 5, 15,
- 38, -4, -91,-91, -42,-35,-36, -4,
- 37, 43, 34, 33, 15, -1, -8,-18,
- -19,-17, -9,-10, -6, 0, 3, 2,
- 1, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0 },
+ TI_0280_PATENT_CHIRP
/* interpolation coefficients */
{ 3, 3, 3, 2, 2, 1, 1, 0 }
};
-/* The following CD2802 coefficients come from US Patents 4,403,965 and 4,946,391; They have not yet been verified using derivatives. The M58817 seems to work best with these coefficients, so its possible the engineers of that chip copied them from the TI patents.
-***These values have not yet been verified against a real CD2802 (used in touch & tell)***
-*/
-static const struct tms5100_coeffs pat4403965_coeff =
+/* TMS5110A/TMC0281D:
+ This chip is used on the later speak & spell, and speak & spell compact;
+ The energy table differs from the original tmc0281/tms5100, as does the interpolation behavior,
+ which is the 'alternate' behavior.
+ The chips have datecodes in the 1983-1984 range, probably 1982 also.
+ Digitally dumped via PROMOUT by PlgDavid in 2014
+ */
+static const struct tms5100_coeffs T0280D_0281D_coeff =
+{
+ /* subtype */
+ SUBTYPE_0281D,
+ 10,
+ 4,
+ 5,
+ { 5, 5, 4, 4, 4, 4, 4, 3, 3, 3 },
+ TI_0280_LATER_ENERGY
+ TI_0280_2801_PATENT_PITCH
+ {
+ TI_0280_PATENT_LPC
+ },
+ TI_0280_PATENT_CHIRP
+ /* interpolation coefficients */
+ { 3, 3, 3, 2, 2, 1, 1, 0 }
+};
+
+/* TMC0280/CD2801:
+ Used in the Speak & Math, Speak & Read, and Language Translator
+ Decapped by Digshadow in 2014 http://siliconpr0n.org/map/ti/tmc0280fnl/
+ Digitally dumped via PROMOUT by PlgDavid in 2014
+ The coefficients are exactly the same as the TMS5200.
+ The coefficients also come from US Patents 4,403,965 and 4,946,391 (with
+ one typo in the patent).
+ The chirp table is very slightly different from the 4,209,836 patent one,
+ but matches the table in the 4,403,965 and 4,946,391 patents.
+ The Mitsubishi M58817 also seems to work best with these coefficients, so
+ it is possible the engineers of that chip copied them from the TI patents.
+ ***TODO: there are 2 versions of this chip, and the interpolation
+ behavior between the two differs slightly:
+ * TMC0280NLP // CD2801 with datecodes around 1980 has the same
+ interpolation inhibit behavior as 5100/TMC0281 on unvoiced->silent
+ transition.
+ * CD2801A-NL with datecodes around 1982 have the 'alternate behavior'
+ */
+static const struct tms5100_coeffs T0280F_2801A_coeff =
+{
+ /* subtype */
+ SUBTYPE_2801A,
+ 10,
+ 4,
+ 5,
+ { 5, 5, 4, 4, 4, 4, 4, 3, 3, 3 },
+ TI_0280_LATER_ENERGY
+ TI_0280_2801_PATENT_PITCH
+ {
+ TI_2801_2501E_LPC
+ },
+ TI_2801_CHIRP
+ /* interpolation coefficients */
+ { 3, 3, 3, 2, 2, 1, 1, 0 }
+};
+
+/* Mitsubishi M58817
+The Mitsubishi M58817 seems to have (partly?) copied the coefficients from the
+TMC0280/CD2801 above, but has some slight differences to it within the chip:
+the main accumulator seems to have 1 extra bit and the digital values are
+tapped 1 bit higher than on the TI chips. This is emulated within tms5110.c
+ */
+static const struct tms5100_coeffs M58817_coeff =
{
/* subtype */
SUBTYPE_M58817,
@@ -153,125 +436,68 @@ static const struct tms5100_coeffs pat4403965_coeff =
4,
5,
{ 5, 5, 4, 4, 4, 4, 4, 3, 3, 3 },
- /* E */
- { 0, 1, 2, 3, 4, 6, 8, 11,
- 16, 23, 33, 47, 63, 85, 114, 511 },
- /* P */
- { 0, 41, 43, 45, 47, 49, 51, 53,
- 55, 58, 60, 63, 66, 70, 73, 76,
- 79, 83, 87, 90, 94, 99, 103, 107,
- 112, 118, 123, 129, 134, 140, 147, 153 },
+ TI_0280_LATER_ENERGY
+ TI_0280_2801_PATENT_PITCH
{
- /* K1 */
- { -501, -498, -495, -490, -485, -478, -469, -459,
- -446, -431, -412, -389, -362, -331, -295, -253,
- -207, -156, -102, -45, 13, 70, 126, 179,
- 228, 272, 311, 345, 374, 399, 420, 437 },
- /* K2 */
- { -376, -357, -335, -312, -286, -258, -227, -195,
- -161, -124, -87, -49, -10, 29, 68, 106,
- 143, 178, 212, 243, 272, 299, 324, 346,
- 366, 384, 400, 414, 427, 438, 448, 506 },
- /* K3 */
- { -407, -381, -349, -311, -268, -218, -162, -102,
- -39, 25, 89, 149, 206, 257, 302, 341 },
- /* K4 */
- { -290, -252, -209, -163, -114, -62, -9, 44,
- 97, 147, 194, 238, 278, 313, 344, 371 },
- /* K5 */
- { -318, -283, -245, -202, -156, -107, -56, -3,
- 49, 101, 150, 196, 239, 278, 313, 344 },
- /* K6 */
- { -193, -152, -109, -65, -20, 26, 71, 115,
- 158, 198, 235, 270, 301, 330, 355, 377 },
- /* K7 */
- { -254, -218, -180, -140, -97, -53, -8, 36,
- 81, 124, 165, 204, 240, 274, 304, 332 },
- /* K8 */
- { -205, -112, -10, 92, 187, 269, 336, 387 },
- /* K9 */
- { -249, -183, -110, -19, 48, 126, 198, 261 }, // on tms5200 the 4th entry is -32
- /* K10 */
- { -190, -133, -73, -10, 53, 115, 173, 227 },
+ TI_2801_2501E_LPC
},
- /* Chirp table */
- { 0, 43, -44, 51,-77, 18, 37, 20,
- 2,-30, -58, 3, 96, 91, 5, 15,
- 38, -4, -90,-91,-42,-35,-35, -3,
- 37, 43, 35, 34, 15, -1, -8,-17,
- -19,-17, -9, -9, -6, 1, 4, 3,
- 1, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0 },
+ TI_2801_CHIRP
+ /* interpolation coefficients */
+ { 3, 3, 3, 2, 2, 1, 1, 0 }
+};
+
+/* CD2802:
+ (1984 era?)
+ Used in Touch and Tell only (and Vocaid?), this chip has a unique pitch, LPC and chirp table.
+ Has the 'alternate' interpolation behavior.
+ Digitally dumped via PROMOUT by PlgDavid in 2014
+ */
+static const struct tms5100_coeffs T0280F_2802_coeff =
+{
+ /* subtype */
+ SUBTYPE_2802,
+ 10,
+ 4,
+ 5,
+ { 5, 5, 4, 4, 4, 4, 4, 3, 3, 3 },
+ TI_0280_LATER_ENERGY
+ TI_2802_PITCH
+ {
+ TI_2802_LPC
+ },
+ TI_2802_CHIRP
/* interpolation coefficients */
{ 3, 3, 3, 2, 2, 1, 1, 0 }
};
-/* The following TMS5110A LPC coefficients were directly read from an actual
-TMS5110A chip by Jarek Burczynski using the PROMOUT pin, and can be regarded
-as established fact. However, the chirp table and the interpolation
-coefficients still come from the patents as there doesn't seem to be an easy
-way to read those out from the chip without decapping it.
-The TMS5111NLL was decapped and imaged by digshadow in April, 2013.
-The LPC table is verified to match the values from Jarek's PROMOUT dump of the TMS5110,
-and the die even says "TMS5110AJ" on it. It uses the 'newer' 5200-style chirp table.
+/* TMS5110A:
+ (1984-90 era? early chips may be called TMS5110C; later chips past 1988 or so may be called TSP5110A)
+ The TMS5110A LPC coefficients were originally read from an actual TMS5110A
+ chip by Jarek Burczynski using the PROMOUT pin, later verified/redumped
+ by PlgDavid.
+ NullMoogleCable decapped a TMS5110AN2L in 2015: http://wtfmoogle.com/wp-content/uploads/2015/03/0317_1.jpg
+ which was used to verify the chirp table.
+ The slightly older but otherwise identical TMS5111NLL was decapped and imaged by digshadow in April, 2013.
+ The die is marked "TMS5110AJ"
+ The LPC table is verified from decap to match the values from Jarek and PlgDavid's PROMOUT dumps of the TMS5110.
+ The LPC table matches that of the TMS5220.
+ It uses the 'newer' 5200-style chirp table.
+ It has the 'alternate' interpolation behavor (tested on 5110a; 5111 behavior is unknown)
*/
static const struct tms5100_coeffs tms5110a_coeff =
{
/* subtype */
- SUBTYPE_TMS5110,
+ SUBTYPE_5110,
10,
4,
5,
{ 5, 5, 4, 4, 4, 4, 4, 3, 3, 3 },
- /* E */
- { 0, 1, 2, 3, 4, 6, 8, 11,
- 16, 23, 33, 47, 63, 85, 114, 511 },
- /* P */
- { 0, 15, 16, 17, 19, 21, 22, 25,
- 26, 29, 32, 36, 40, 42, 46, 50,
- 55, 60, 64, 68, 72, 76, 80, 84,
- 86, 93, 101, 110, 120, 132, 144, 159 },
+ TI_0280_LATER_ENERGY
+ TI_5110_PITCH
{
- /* K1 */
- { -501, -498, -497, -495, -493, -491, -488, -482,
- -478, -474, -469, -464, -459, -452, -445, -437,
- -412, -380, -339, -288, -227, -158, -81, -1,
- 80, 157, 226, 287, 337, 379, 411, 436 },
- /* K2 */
- { -328, -303, -274, -244, -211, -175, -138, -99,
- -59, -18, 24, 64, 105, 143, 180, 215,
- 248, 278, 306, 331, 354, 374, 392, 408,
- 422, 435, 445, 455, 463, 470, 476, 506 },
- /* K3 */
- { -441, -387, -333, -279, -225, -171, -117, -63,
- -9, 45, 98, 152, 206, 260, 314, 368 },
- /* K4 */
- { -328, -273, -217, -161, -106, -50, 5, 61,
- 116, 172, 228, 283, 339, 394, 450, 506 },
- /* K5 */
- { -328, -282, -235, -189, -142, -96, -50, -3,
- 43, 90, 136, 182, 229, 275, 322, 368 },
- /* K6 */
- { -256, -212, -168, -123, -79, -35, 10, 54,
- 98, 143, 187, 232, 276, 320, 365, 409 },
- /* K7 */
- { -308, -260, -212, -164, -117, -69, -21, 27,
- 75, 122, 170, 218, 266, 314, 361, 409 },
- /* K8 */
- { -256, -161, -66, 29, 124, 219, 314, 409 },
- /* K9 */
- { -256, -176, -96, -15, 65, 146, 226, 307 },
- /* K10 */
- { -205, -132, -59, 14, 87, 160, 234, 307 },
+ TI_5110_5220_LPC
},
- /* Chirp table */
- { 0x00, 0x03, 0x0F, 0x28, 0x4C, 0x6C, 0x71, 0x50,
- 0x25, 0x26, 0x4C, 0x44, 0x1A, 0x32, 0x3B, 0x13,
- 0x37, 0x1A, 0x25, 0x1F, 0x1D, 0x00, 0x00, 0x00,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0 },
+ TI_LATER_CHIRP
/* interpolation coefficients */
{ 3, 3, 3, 2, 2, 1, 1, 0 }
};
@@ -279,8 +505,9 @@ static const struct tms5100_coeffs tms5110a_coeff =
/* The following coefficients come from US Patent 4,335,277 and 4,581,757.
However, the K10 row of coefficients are entirely missing from both of those
patents.
-The K values don't match the values read from an actual TMS5200 chip, but
-might match the TMS5111 or some other undiscovered chip?
+The K values don't match the values read from any of the TI chips so far, but
+might match some other undiscovered chip? Or may be complete garbage put as a red
+herring in the patent?
*/
// k* is followed by d if done transcription, c if checked for derivative aberrations
static const struct tms5100_coeffs pat4335277_coeff =
@@ -291,18 +518,8 @@ static const struct tms5100_coeffs pat4335277_coeff =
4,
6,
{ 5, 5, 4, 4, 4, 4, 4, 3, 3, 3 },
- /* Ed */
- { 0, 1, 2, 3, 4, 6, 8, 11,
- 16, 23, 33, 47, 63, 85, 114, 511 }, /* last value is actually 0 in ROM, but 511 is stop sentinel */
- /* Pd */
- { 0, 14, 15, 16, 17, 18, 19, 20,
- 21, 22, 23, 24, 25, 26, 27, 28,
- 29, 30, 31, 32, 34, 36, 38, 40,
- 41, 43, 45, 48, 49, 51, 54, 55,
- 57, 60, 62, 64, 68, 72, 74, 76,
- 81, 85, 87, 90, 96, 99, 103, 107,
- 112, 117, 122, 127, 133, 139, 145, 151,
- 157, 164, 171, 178, 186, 194, 202, 211 },
+ TI_0285_LATER_ENERGY
+ TI_2501E_PITCH
{
/* K1dc */
{ -507, -505, -503, -501, -497, -493, -488, -481,
@@ -336,20 +553,14 @@ static const struct tms5100_coeffs pat4335277_coeff =
/* K10 - this was entirely missing from the patent, and I've simply copied the real TMS5220 one, which is wrong */
{ -205, -132, -59, 14, 87, 160, 234, 307 },
},
- /* Chirp table */
- { 0, 42, -44, 50, -78, 18, 37, 20,
- 2, -31, -59, 2, 95, 90, 5, 15,
- 38, -4, -91,-91, -42,-35,-36, -4,
- 37, 43, 34, 33, 15, -1, -8,-18,
- -19,-17, -9,-10, -6, 0, 3, 2,
- 1, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0 },
+ TI_0280_PATENT_CHIRP
/* interpolation coefficients */
{ 3, 3, 3, 2, 2, 1, 1, 0 }
};
-/*
-The TMS5200CNL was decapped and imaged by digshadow in March, 2013.
+/* TMS5200/CD2501E
+ (1979-1983 era)
+The TMS5200NL was decapped and imaged by digshadow in March, 2013.
It is equivalent to the CD2501E (internally: "TMC0285") chip used
on the TI 99/4(A) speech module.
The LPC table is verified to match the decap.
@@ -359,83 +570,39 @@ Note that the K coefficients are VERY different from the coefficients given
in the US 4,335,277 patent, which may have been for some sort of prototype or
otherwise intentionally scrambled. The energy and pitch tables, however, are
identical to that patent.
-Also note, that the K coefficients are ALMOST identical to the coefficients from the CD2802.
-The interpolation coefficients still come from the patents pending verification
- of the interpolation counter circuit from the chip decap image.
+Also note, that the K coefficients are identical to the coefficients from the
+ CD2801 (which itself is almost identical to the CD2802).
NOTE FROM DECAP: immediately to the left of each of the K1,2,3,4,5,and 6
coefficients in the LPC rom are extra columns containing the constants
-510, -502, 313, 318, or in hex 0x202, 0x20A, 0x139, 0x13E.
Those EXACT constants DO appear (rather nonsensically) on the lpc table in US
- patent 4,335,277. They don't seem to do anything except take up space and may
- be a leftover from an older design predating even the patent.
+ patent 4,335,277. They are likely related to the multiplicative interpolator
+ described in us patent 4,419,540; whether the 5200/2501E and the 5220 or 5220C
+ actually implement this interpolator or not is unclear. This interpolator
+ seems intended for chips with variable frame rate, so it may only exist
+ on the TMS/TSP5220C and CD2501ECD.
*/
-static const struct tms5100_coeffs tms5200_coeff =
+static const struct tms5100_coeffs T0285_2501E_coeff =
{
/* subtype */
- SUBTYPE_TMS5200,
+ SUBTYPE_2501E,
10,
4,
6,
{ 5, 5, 4, 4, 4, 4, 4, 3, 3, 3 },
- /* E */
- { 0, 1, 2, 3, 4, 6, 8, 11,
- 16, 23, 33, 47, 63, 85, 114, 0 },
- /* P */
- { 0, 14, 15, 16, 17, 18, 19, 20,
- 21, 22, 23, 24, 25, 26, 27, 28,
- 29, 30, 31, 32, 34, 36, 38, 40,
- 41, 43, 45, 48, 49, 51, 54, 55,
- 57, 60, 62, 64, 68, 72, 74, 76,
- 81, 85, 87, 90, 96, 99, 103, 107,
- 112, 117, 122, 127, 133, 139, 145, 151,
- 157, 164, 171, 178, 186, 194, 202, 211 },
+ TI_0285_LATER_ENERGY
+ TI_2501E_PITCH
{
- /* K1 */
- { -501, -498, -495, -490, -485, -478, -469, -459,
- -446, -431, -412, -389, -362, -331, -295, -253,
- -207, -156, -102, -45, 13, 70, 126, 179,
- 228, 272, 311, 345, 374, 399, 420, 437 },
- /* K2 */
- { -376, -357, -335, -312, -286, -258, -227, -195,
- -161, -124, -87, -49, -10, 29, 68, 106,
- 143, 178, 212, 243, 272, 299, 324, 346,
- 366, 384, 400, 414, 427, 438, 448, 506 },
- /* K3 */
- { -407, -381, -349, -311, -268, -218, -162, -102,
- -39, 25, 89, 149, 206, 257, 302, 341 },
- /* K4 */
- { -290, -252, -209, -163, -114, -62, -9, 44,
- 97, 147, 194, 238, 278, 313, 344, 371 },
- /* K5 */
- { -318, -283, -245, -202, -156, -107, -56, -3,
- 49, 101, 150, 196, 239, 278, 313, 344 },
- /* K6 */
- { -193, -152, -109, -65, -20, 26, 71, 115,
- 158, 198, 235, 270, 301, 330, 355, 377 },
- /* K7 */
- { -254, -218, -180, -140, -97, -53, -8, 36,
- 81, 124, 165, 204, 240, 274, 304, 332 },
- /* K8 */
- { -205, -112, -10, 92, 187, 269, 336, 387 },
- /* K9 */
- { -249, -183, -110, -32, 48, 126, 198, 261 }, // verified from decap; on the cd2802 patent the 4th entry is -19 (patent typo?)
- /* K10 */
- { -190, -133, -73, -10, 53, 115, 173, 227 },
+ TI_2801_2501E_LPC
},
- /* Chirp table */
- { 0x00, 0x03, 0x0F, 0x28, 0x4C, 0x6C, 0x71, 0x50,
- 0x25, 0x26, 0x4C, 0x44, 0x1A, 0x32, 0x3B, 0x13,
- 0x37, 0x1A, 0x25, 0x1F, 0x1D, 0x00, 0x00, 0x00,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0 },
+ TI_LATER_CHIRP
/* interpolation coefficients */
{ 0, 3, 3, 3, 2, 2, 1, 1 }
};
-/*
+/* TMS5220/5220C:
+(1983 era for 5220, 1986-1992 era for 5220C; 5220C may also be called TSP5220C)
The TMS5220NL was decapped and imaged by digshadow in April, 2013.
The LPC table table is verified to match the decap.
The chirp table is verified to match the decap. (sum = 0x3da)
@@ -448,64 +615,17 @@ The chirp table is verified to match the decap. (sum = 0x3da)
static const struct tms5100_coeffs tms5220_coeff =
{
/* subtype */
- SUBTYPE_TMS5220,
+ SUBTYPE_5220,
10,
4,
6,
{ 5, 5, 4, 4, 4, 4, 4, 3, 3, 3 },
- /* E */
- { 0, 1, 2, 3, 4, 6, 8, 11,
- 16, 23, 33, 47, 63, 85, 114, 0 },
- /* P */
- { 0, 15, 16, 17, 18, 19, 20, 21,
- 22, 23, 24, 25, 26, 27, 28, 29,
- 30, 31, 32, 33, 34, 35, 36, 37,
- 38, 39, 40, 41, 42, 44, 46, 48,
- 50, 52, 53, 56, 58, 60, 62, 65,
- 68, 70, 72, 76, 78, 80, 84, 86,
- 91, 94, 98, 101, 105, 109, 114, 118,
- 122, 127, 132, 137, 142, 148, 153, 159 },
+ TI_0285_LATER_ENERGY
+ TI_5220_PITCH
{
- /* K1 */
- { -501, -498, -497, -495, -493, -491, -488, -482,
- -478, -474, -469, -464, -459, -452, -445, -437,
- -412, -380, -339, -288, -227, -158, -81, -1,
- 80, 157, 226, 287, 337, 379, 411, 436 },
- /* K2 */
- { -328, -303, -274, -244, -211, -175, -138, -99,
- -59, -18, 24, 64, 105, 143, 180, 215,
- 248, 278, 306, 331, 354, 374, 392, 408,
- 422, 435, 445, 455, 463, 470, 476, 506 },
- /* K3 */
- { -441, -387, -333, -279, -225, -171, -117, -63,
- -9, 45, 98, 152, 206, 260, 314, 368 },
- /* K4 */
- { -328, -273, -217, -161, -106, -50, 5, 61,
- 116, 172, 228, 283, 339, 394, 450, 506 },
- /* K5 */
- { -328, -282, -235, -189, -142, -96, -50, -3,
- 43, 90, 136, 182, 229, 275, 322, 368 },
- /* K6 */
- { -256, -212, -168, -123, -79, -35, 10, 54,
- 98, 143, 187, 232, 276, 320, 365, 409 },
- /* K7 */
- { -308, -260, -212, -164, -117, -69, -21, 27,
- 75, 122, 170, 218, 266, 314, 361, 409 },
- /* K8 */
- { -256, -161, -66, 29, 124, 219, 314, 409 },
- /* K9 */
- { -256, -176, -96, -15, 65, 146, 226, 307 },
- /* K10 */
- { -205, -132, -59, 14, 87, 160, 234, 307 },
+ TI_5110_5220_LPC
},
- /* Chirp table */
- { 0x00, 0x03, 0x0F, 0x28, 0x4C, 0x6C, 0x71, 0x50,
- 0x25, 0x26, 0x4C, 0x44, 0x1A, 0x32, 0x3B, 0x13,
- 0x37, 0x1A, 0x25, 0x1F, 0x1D, 0x00, 0x00, 0x00,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0 },
+ TI_LATER_CHIRP
/* interpolation coefficients */
{ 0, 3, 3, 3, 2, 2, 1, 1 }
};
diff --git a/src/emu/sound/tms5220.c b/src/emu/sound/tms5220.c
index 388862728ea..d71344a01e8 100644
--- a/src/emu/sound/tms5220.c
+++ b/src/emu/sound/tms5220.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Frank Palazzolo, Aaron Giles, Jonathan Gevaryahu, Raphael Nabet, Couriersud, Michael Zapf
/**********************************************************************************************
@@ -338,7 +338,7 @@ void tms5220_device::set_variant(int variant)
{
case TMS5220_IS_5200:
case TMS5220_IS_CD2501ECD:
- m_coeff = &tms5200_coeff;
+ m_coeff = &T0285_2501E_coeff;
break;
case TMS5220_IS_5220C:
case TMS5220_IS_5220:
@@ -920,9 +920,9 @@ void tms5220_device::process(INT16 *buffer, unsigned int size)
* disabled, forcing all samples beyond 51d to be == 51d
*/
if (m_pitch_count >= 51)
- m_excitation_data = m_coeff->chirptable[51];
+ m_excitation_data = (INT8)m_coeff->chirptable[51];
else /*m_pitch_count < 51*/
- m_excitation_data = m_coeff->chirptable[m_pitch_count];
+ m_excitation_data = (INT8)m_coeff->chirptable[m_pitch_count];
}
// Update LFSR *20* times every sample (once per T cycle), like patent shows
diff --git a/src/emu/sound/tms5220.h b/src/emu/sound/tms5220.h
index 6a9b36b723e..7150ce5457b 100644
--- a/src/emu/sound/tms5220.h
+++ b/src/emu/sound/tms5220.h
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Frank Palazzolo, Aaron Giles, Jonathan Gevaryahu, Raphael Nabet, Couriersud, Michael Zapf
#pragma once
diff --git a/src/emu/sound/x1_010.c b/src/emu/sound/x1_010.c
index 1025f9d99d4..5d8377569bb 100644
--- a/src/emu/sound/x1_010.c
+++ b/src/emu/sound/x1_010.c
@@ -21,7 +21,8 @@ Registers:
Reg: Bits: Meaning:
- 0 7654 3---
+ 0 7--- ---- Frequency divider flag (only downtown seems to set this)
+ -654 3---
---- -2-- PCM/Waveform repeat flag (0:Ones 1:Repeat) (*1)
---- --1- Sound out select (0:PCM 1:Waveform)
---- ---0 Key on / off
@@ -190,7 +191,7 @@ WRITE16_MEMBER( x1_010_device::word_w )
void x1_010_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
{
X1_010_CHANNEL *reg;
- int ch, i, volL, volR, freq;
+ int ch, i, volL, volR, freq, div;
register INT8 *start, *end, data;
register UINT8 *env;
register UINT32 smp_offs, smp_step, env_offs, env_step, delta;
@@ -206,13 +207,14 @@ void x1_010_device::sound_stream_update(sound_stream &stream, stream_sample_t **
if( (reg->status&1) != 0 ) { // Key On
stream_sample_t *bufL = outputs[0];
stream_sample_t *bufR = outputs[1];
+ div = (reg->status&0x80) ? 1 : 0;
if( (reg->status&2) == 0 ) { // PCM sampling
start = m_region + reg->start*0x1000;
end = m_region + (0x100-reg->end)*0x1000;
volL = ((reg->volume>>4)&0xf)*VOL_BASE;
volR = ((reg->volume>>0)&0xf)*VOL_BASE;
smp_offs = m_smp_offset[ch];
- freq = reg->frequency;
+ freq = reg->frequency>>div;
// Meta Fox does write the frequency register, but this is a hack to make it "work" with the current setup
// This is broken for Arbalester (it writes 8), but that'll be fixed later.
if( freq == 0 ) freq = 4;
@@ -238,7 +240,7 @@ void x1_010_device::sound_stream_update(sound_stream &stream, stream_sample_t **
} else { // Wave form
start = (INT8 *)&(m_reg[reg->volume*128+0x1000]);
smp_offs = m_smp_offset[ch];
- freq = (reg->pitch_hi<<8)+reg->frequency;
+ freq = ((reg->pitch_hi<<8)+reg->frequency)>>div;
smp_step = (UINT32)((float)m_base_clock/128.0f/1024.0f/4.0f*freq*(1<<FREQ_BASE_BITS)/(float)m_rate);
env = (UINT8 *)&(m_reg[reg->end*128]);
diff --git a/src/emu/sound/ymf278b.c b/src/emu/sound/ymf278b.c
index 7e323f3d525..ae9b9e7dffc 100644
--- a/src/emu/sound/ymf278b.c
+++ b/src/emu/sound/ymf278b.c
@@ -250,23 +250,23 @@ void ymf278b_device::sound_stream_update(sound_stream &stream, stream_sample_t *
{
// 8 bit
case 0:
- sample = m_direct->read_raw_byte(slot->startaddr + (slot->stepptr>>16))<<8;
+ sample = m_direct->read_byte(slot->startaddr + (slot->stepptr>>16))<<8;
break;
// 12 bit
case 1:
if (slot->stepptr & 0x10000)
- sample = m_direct->read_raw_byte(slot->startaddr + (slot->stepptr>>17)*3+2)<<8 |
- (m_direct->read_raw_byte(slot->startaddr + (slot->stepptr>>17)*3+1) << 4 & 0xf0);
+ sample = m_direct->read_byte(slot->startaddr + (slot->stepptr>>17)*3+2)<<8 |
+ (m_direct->read_byte(slot->startaddr + (slot->stepptr>>17)*3+1) << 4 & 0xf0);
else
- sample = m_direct->read_raw_byte(slot->startaddr + (slot->stepptr>>17)*3)<<8 |
- (m_direct->read_raw_byte(slot->startaddr + (slot->stepptr>>17)*3+1) & 0xf0);
+ sample = m_direct->read_byte(slot->startaddr + (slot->stepptr>>17)*3)<<8 |
+ (m_direct->read_byte(slot->startaddr + (slot->stepptr>>17)*3+1) & 0xf0);
break;
// 16 bit
case 2:
- sample = m_direct->read_raw_byte(slot->startaddr + ((slot->stepptr>>16)*2))<<8 |
- m_direct->read_raw_byte(slot->startaddr + ((slot->stepptr>>16)*2)+1);
+ sample = m_direct->read_byte(slot->startaddr + ((slot->stepptr>>16)*2))<<8 |
+ m_direct->read_byte(slot->startaddr + ((slot->stepptr>>16)*2)+1);
break;
// ?? bit, effect is unknown, datasheet says it's prohibited
@@ -480,7 +480,7 @@ void ymf278b_device::C_w(UINT8 reg, UINT8 data)
else
offset = m_wavetblhdr*0x80000 + (slot->wave - 384) * 12;
for (i = 0; i < 12; i++)
- p[i] = m_direct->read_raw_byte(offset+i);
+ p[i] = m_direct->read_byte(offset+i);
slot->bits = (p[0]&0xc0)>>6;
slot->startaddr = (p[2] | (p[1]<<8) | ((p[0]&0x3f)<<16));
@@ -690,6 +690,7 @@ WRITE8_MEMBER( ymf278b_device::write )
timer_busy_start(0);
if (m_lastport) B_w(m_port_AB, data);
else A_w(m_port_AB, data);
+ m_last_fm_data = data;
break;
case 4:
@@ -737,6 +738,8 @@ READ8_MEMBER( ymf278b_device::read )
case 1:
case 3:
// but they're not implemented here yet
+ // This may be incorrect, but it makes the mbwave moonsound detection in msx drivers pass.
+ ret = m_last_fm_data;
break;
// PCM regs
@@ -752,7 +755,7 @@ READ8_MEMBER( ymf278b_device::read )
ret = (m_pcmregs[m_port_C] & 0x1f) | 0x20; // device ID in upper bits
break;
case 6:
- ret = m_direct->read_raw_byte(m_memadr);
+ ret = m_direct->read_byte(m_memadr);
m_memadr = (m_memadr + 1) & 0x3fffff;
break;
@@ -879,6 +882,7 @@ void ymf278b_device::register_save_state()
save_item(NAME(m_port_AB));
save_item(NAME(m_port_C));
save_item(NAME(m_lastport));
+ save_item(NAME(m_last_fm_data));
for (i = 0; i < 24; ++i)
{
@@ -979,7 +983,8 @@ ymf278b_device::ymf278b_device(const machine_config &mconfig, const char *tag, d
device_sound_interface(mconfig, *this),
device_memory_interface(mconfig, *this),
m_space_config("samples", ENDIANNESS_BIG, 8, 22, 0, NULL),
- m_irq_handler(*this)
+ m_irq_handler(*this),
+ m_last_fm_data(0)
{
m_address_map[0] = *ADDRESS_MAP_NAME(ymf278b);
}
diff --git a/src/emu/sound/ymf278b.h b/src/emu/sound/ymf278b.h
index 5423aad65c8..8a3fdad12cb 100644
--- a/src/emu/sound/ymf278b.h
+++ b/src/emu/sound/ymf278b.h
@@ -131,6 +131,7 @@ private:
direct_read_data * m_direct;
const address_space_config m_space_config;
devcb_write_line m_irq_handler;
+ UINT8 m_last_fm_data;
};
extern const device_type YMF278B;
diff --git a/src/emu/sound/zsg2.c b/src/emu/sound/zsg2.c
index e6b9f6af450..4f3f1a42ca9 100644
--- a/src/emu/sound/zsg2.c
+++ b/src/emu/sound/zsg2.c
@@ -47,7 +47,6 @@ TODO:
- volume/panning is linear? volume slides are too steep
- most music sounds tinny, probably due to missing DSP?
- what is reg 0xa/0xc? seems related to volume
-- chip should running at 31khz (divider of 768 instead of 192)
- identify sample flags
* bassdrum in shikigam level 1 music is a good hint: it should be one octave
lower, indicating possible stereo sample, or base octave(like in ymf278)
@@ -86,10 +85,9 @@ void zsg2_device::device_start()
memset(&m_chan, 0, sizeof(m_chan));
- m_stream = stream_alloc(0, 2, clock() / 192);
+ m_stream = stream_alloc(0, 2, clock() / 768);
m_mem_blocks = m_mem_base.length();
-
m_mem_copy = auto_alloc_array_clear(machine(), UINT32, m_mem_blocks);
m_full_samples = auto_alloc_array_clear(machine(), INT16, m_mem_blocks * 4 + 4); // +4 is for empty block
@@ -214,7 +212,7 @@ void zsg2_device::sound_stream_update(sound_stream &stream, stream_sample_t **in
continue;
m_chan[ch].step_ptr += m_chan[ch].step;
- if (m_chan[ch].step_ptr & 0x40000)
+ if (m_chan[ch].step_ptr & 0x10000)
{
m_chan[ch].step_ptr &= 0xffff;
if (++m_chan[ch].cur_pos >= m_chan[ch].end_pos)
@@ -231,7 +229,7 @@ void zsg2_device::sound_stream_update(sound_stream &stream, stream_sample_t **in
m_chan[ch].samples = prepare_samples(m_chan[ch].page | m_chan[ch].cur_pos);
}
- INT32 sample = (m_chan[ch].samples[m_chan[ch].step_ptr >> 16 & 3] * m_chan[ch].vol) >> 16;
+ INT32 sample = (m_chan[ch].samples[m_chan[ch].step_ptr >> 14 & 3] * m_chan[ch].vol) >> 16;
mix_l += (sample * m_chan[ch].panl + sample * (0x1f - m_chan[ch].panr)) >> 5;
mix_r += (sample * m_chan[ch].panr + sample * (0x1f - m_chan[ch].panl)) >> 5;
diff --git a/src/emu/ui/filesel.c b/src/emu/ui/filesel.c
index 294e58c76fb..141d2f9e7b9 100644
--- a/src/emu/ui/filesel.c
+++ b/src/emu/ui/filesel.c
@@ -566,7 +566,8 @@ void ui_menu_file_selector::populate()
if (m_has_softlist)
{
// add the "[software list]" entry
- append_entry(SELECTOR_ENTRY_TYPE_SOFTWARE_LIST, NULL, NULL);
+ entry = append_entry(SELECTOR_ENTRY_TYPE_SOFTWARE_LIST, NULL, NULL);
+ selected_entry = entry;
}
// add the drives
diff --git a/src/emu/ui/imgcntrl.c b/src/emu/ui/imgcntrl.c
index 15f487c4c2e..f1166bb3a8a 100644
--- a/src/emu/ui/imgcntrl.c
+++ b/src/emu/ui/imgcntrl.c
@@ -134,6 +134,7 @@ void ui_menu_control_device_image::load_software_part()
std::string temp_name = std::string(sld->list_name()).append(":").append(swi->shortname()).append(":").append(swp->name());
driver_enumerator drivlist(machine().options(), machine().options().system_name());
+ drivlist.next();
media_auditor auditor(drivlist);
media_auditor::summary summary = auditor.audit_software(sld->list_name(), (software_info *)swi, AUDIT_VALIDATE_FAST);
// if everything looks good, load software
diff --git a/src/emu/ui/mainmenu.h b/src/emu/ui/mainmenu.h
index a4590b00af0..b21d5da1c73 100644
--- a/src/emu/ui/mainmenu.h
+++ b/src/emu/ui/mainmenu.h
@@ -44,7 +44,7 @@ private:
CHEAT,
SELECT_GAME,
BIOS_SELECTION,
- BARCODE_READ,
+ BARCODE_READ
};
};
diff --git a/src/emu/ui/swlist.h b/src/emu/ui/swlist.h
index e47fd8f6e4c..7ced74cc97c 100644
--- a/src/emu/ui/swlist.h
+++ b/src/emu/ui/swlist.h
@@ -15,7 +15,7 @@
class ui_menu_software_parts : public ui_menu {
public:
- enum { T_EMPTY, T_FMGR, T_SWLIST, T_ENTRY, };
+ enum { T_EMPTY, T_FMGR, T_SWLIST, T_ENTRY };
ui_menu_software_parts(running_machine &machine, render_container *container, const software_info *info, const char *interface, const software_part **part, bool other_opt, int *result);
virtual ~ui_menu_software_parts();
virtual void populate();
diff --git a/src/emu/ui/ui.c b/src/emu/ui/ui.c
index b9b9da66643..a0458ed7a7d 100644
--- a/src/emu/ui/ui.c
+++ b/src/emu/ui/ui.c
@@ -92,6 +92,7 @@ static const input_item_id non_char_keys[] =
// messagebox buffer
static std::string messagebox_text;
+static std::string messagebox_poptext;
static rgb_t messagebox_backcolor;
// slider info
@@ -441,7 +442,7 @@ void ui_manager::update_and_render(render_container *container)
// display any popup messages
if (osd_ticks() < m_popup_text_end)
- draw_text_box(container, messagebox_text.c_str(), JUSTIFY_CENTER, 0.5f, 0.9f, messagebox_backcolor);
+ draw_text_box(container, messagebox_poptext.c_str(), JUSTIFY_CENTER, 0.5f, 0.9f, messagebox_backcolor);
else
m_popup_text_end = 0;
@@ -868,7 +869,7 @@ void CLIB_DECL ui_manager::popup_time(int seconds, const char *text, ...)
// extract the text
va_start(arg,text);
- strvprintf(messagebox_text, text, arg);
+ strvprintf(messagebox_poptext, text, arg);
messagebox_backcolor = UI_BACKGROUND_COLOR;
va_end(arg);
@@ -1028,7 +1029,9 @@ std::string &ui_manager::warnings_string(std::string &str)
// add a warning if any ROMs were loaded with warnings
if (rom_load_warnings(machine()) > 0)
{
- str.append("One or more ROMs/CHDs for this game are incorrect. The ");
+ str.append("One or more ROMs/CHDs for this ");
+ str.append(emulator_info::get_gamenoun());
+ str.append(" are incorrect. The ");
str.append(emulator_info::get_gamenoun());
str.append(" may not run correctly.\n");
if (machine().system().flags & WARNING_FLAGS)
@@ -1064,25 +1067,36 @@ std::string &ui_manager::warnings_string(std::string &str)
str.append("The video emulation isn't 100% accurate.\n");
if (machine().system().flags & GAME_IMPERFECT_SOUND)
str.append("The sound emulation isn't 100% accurate.\n");
- if (machine().system().flags & GAME_NO_SOUND)
- str.append("The game lacks sound.\n");
+ if (machine().system().flags & GAME_NO_SOUND) {
+ str.append("The ");
+ str.append(emulator_info::get_gamenoun());
+ str.append(" lacks sound.\n");
+ }
if (machine().system().flags & GAME_NO_COCKTAIL)
str.append("Screen flipping in cocktail mode is not supported.\n");
// check if external artwork is present before displaying this warning?
- if (machine().system().flags & GAME_REQUIRES_ARTWORK)
- str.append("The game requires external artwork files\n");
+ if (machine().system().flags & GAME_REQUIRES_ARTWORK) {
+ str.append("The ");
+ str.append(emulator_info::get_gamenoun());
+ str.append(" requires external artwork files\n");
+ }
// if there's a NOT WORKING, UNEMULATED PROTECTION or GAME MECHANICAL warning, make it stronger
if (machine().system().flags & (GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_MECHANICAL))
{
// add the strings for these warnings
- if (machine().system().flags & GAME_UNEMULATED_PROTECTION)
- str.append("The game has protection which isn't fully emulated.\n");
+ if (machine().system().flags & GAME_UNEMULATED_PROTECTION) {
+ str.append("The ");
+ str.append(emulator_info::get_gamenoun());
+ str.append(" has protection which isn't fully emulated.\n");
+ }
if (machine().system().flags & GAME_NOT_WORKING) {
str.append("\nTHIS ");
str.append(emulator_info::get_capgamenoun());
- str.append(" DOESN'T WORK. The emulation for this game is not yet complete. "
+ str.append(" DOESN'T WORK. The emulation for this ");
+ str.append(emulator_info::get_gamenoun());
+ str.append(" is not yet complete. "
"There is nothing you can do to fix this problem except wait for the developers to improve the emulation.\n");
}
if (machine().system().flags & GAME_MECHANICAL) {
@@ -1108,8 +1122,11 @@ std::string &ui_manager::warnings_string(std::string &str)
if ((drivlist.driver().flags & (GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_MECHANICAL)) == 0)
{
// this one works, add a header and display the name of the clone
- if (!foundworking)
- str.append("\n\nThere are working clones of this game: ");
+ if (!foundworking) {
+ str.append("\n\nThere are working clones of this ");
+ str.append(emulator_info::get_gamenoun());
+ str.append(": ");
+ }
else
str.append(", ");
str.append(drivlist.driver().name);
diff --git a/src/emu/validity.c b/src/emu/validity.c
index 8ed4f1e7fe2..dc6ee7cf9c6 100644
--- a/src/emu/validity.c
+++ b/src/emu/validity.c
@@ -109,8 +109,6 @@ void validity_checker::validate_tag(const char *tag)
// too short/too long = bad
if (strlen(begin) < MIN_TAG_LENGTH)
osd_printf_error("Tag '%s' is too short (must be at least %d characters)\n", tag, MIN_TAG_LENGTH);
- if (strlen(begin) > MAX_TAG_LENGTH)
- osd_printf_error("Tag '%s' is too long (must be less than %d characters)\n", tag, MAX_TAG_LENGTH);
}
@@ -188,7 +186,7 @@ void validity_checker::check_shared_source(const game_driver &driver)
// check_all - check all drivers
//-------------------------------------------------
-void validity_checker::check_all()
+bool validity_checker::check_all()
{
// start by checking core stuff
validate_begin();
@@ -220,6 +218,8 @@ void validity_checker::check_all()
// cleanup
validate_end();
+
+ return !(m_errors > 0 || m_warnings > 0);
}
@@ -328,6 +328,8 @@ void validity_checker::validate_one(const game_driver &driver)
void validity_checker::validate_core()
{
// basic system checks
+ if (~0 != -1) osd_printf_error("Machine must be two's complement\n");
+
UINT8 a = 0xff;
UINT8 b = a + 1;
if (b > a) osd_printf_error("UINT8 must be 8 bits\n");
@@ -342,6 +344,16 @@ void validity_checker::validate_core()
if (sizeof(INT64) != 8) osd_printf_error("INT64 must be 64 bits\n");
if (sizeof(UINT64) != 8) osd_printf_error("UINT64 must be 64 bits\n");
+ // check signed right shift
+ INT8 a8 = -3;
+ INT16 a16 = -3;
+ INT32 a32 = -3;
+ INT64 a64 = -3;
+ if (a8 >> 1 != -2) osd_printf_error("INT8 right shift must be arithmetic\n");
+ if (a16 >> 1 != -2) osd_printf_error("INT16 right shift must be arithmetic\n");
+ if (a32 >> 1 != -2) osd_printf_error("INT32 right shift must be arithmetic\n");
+ if (a64 >> 1 != -2) osd_printf_error("INT64 right shift must be arithmetic\n");
+
// check pointer size
#ifdef PTR64
if (sizeof(void *) != 8) osd_printf_error("PTR64 flag enabled, but was compiled for 32-bit target\n");
diff --git a/src/emu/validity.h b/src/emu/validity.h
index 64984433ecf..acc271a7cae 100644
--- a/src/emu/validity.h
+++ b/src/emu/validity.h
@@ -43,7 +43,7 @@ public:
// operations
void check_driver(const game_driver &driver);
void check_shared_source(const game_driver &driver);
- void check_all();
+ bool check_all();
// helpers for devices
void validate_tag(const char *tag);
diff --git a/src/emu/video/315_5124.c b/src/emu/video/315_5124.c
index b7a454f46ab..dac2027d126 100644
--- a/src/emu/video/315_5124.c
+++ b/src/emu/video/315_5124.c
@@ -171,7 +171,7 @@ sega315_5124_device::sega315_5124_device(const machine_config &mconfig, const ch
sega315_5124_device::sega315_5124_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT8 cram_size, UINT8 palette_offset, bool supports_224_240, const char *shortname, const char *source)
- : device_t( mconfig, type, name, tag, owner, clock, shortname, __FILE__)
+ : device_t( mconfig, type, name, tag, owner, clock, shortname, source)
, device_memory_interface(mconfig, *this)
, device_video_interface(mconfig, *this)
, m_cram_size( cram_size )
@@ -1613,8 +1613,11 @@ void sega315_5124_device::device_start()
save_item(NAME(m_hcounter));
save_item(NAME(m_reg));
save_item(NAME(m_current_palette));
- save_item(NAME(m_tmpbitmap));
- save_item(NAME(m_y1_bitmap));
+
+ // these were created with register_screen_bitmap which is dynamic, and will reallocate if the screen size changes, saving them is NOT safe with the current core.
+ // The Genesis VDP (315_5313.c) which uses this as a base in order to support the legacy SMS operaiton mode can change resolutions for example.
+ //save_item(NAME(m_tmpbitmap));
+ //save_item(NAME(m_y1_bitmap));
save_item(NAME(m_draw_time));
save_item(NAME(m_sprite_base));
save_item(NAME(m_sprite_pattern_line));
diff --git a/src/emu/video/clgd542x.c b/src/emu/video/clgd542x.c
index 84a7c0b33cf..854611d1c80 100644
--- a/src/emu/video/clgd542x.c
+++ b/src/emu/video/clgd542x.c
@@ -233,13 +233,12 @@ void cirrus_gd5428_device::cirrus_define_video_mode()
if (!gc_locked && (vga.sequencer.data[0x07] & 0x01))
{
- switch(vga.sequencer.data[0x07] & 0x0E)
+ switch(vga.sequencer.data[0x07] & 0x06) // bit 3 is reserved on GD542x
{
case 0x00: svga.rgb8_en = 1; break;
- case 0x02: svga.rgb16_en = 1; divisor = 2; break; //double VCLK
- case 0x04: svga.rgb24_en = 1; divisor = 3; break;
- case 0x06: svga.rgb16_en = 1; break;
- case 0x08: svga.rgb32_en = 1; break;
+ case 0x02: svga.rgb16_en = 1; clock /= 2; break; // Clock / 2 for 16-bit data
+ case 0x04: svga.rgb24_en = 1; clock /= 3; break; // Clock / 3 for 24-bit data
+ case 0x06: svga.rgb16_en = 1; divisor = 2; break; // Clock rate for 16-bit data
}
}
recompute_params_clock(divisor, (int)clock);
@@ -251,6 +250,12 @@ UINT16 cirrus_gd5428_device::offset()
if (svga.rgb8_en == 1) // guess
off <<= 2;
+ if (svga.rgb16_en == 1)
+ off <<= 2;
+ if (svga.rgb24_en == 1)
+ off <<= 2;
+ if (svga.rgb32_en == 1)
+ off <<= 2;
// popmessage("Offset: %04x %s %s ** -- actual: %04x",vga.crtc.offset,vga.crtc.dw?"DW":"--",vga.crtc.word_mode?"BYTE":"WORD",off);
return off;
}
@@ -276,22 +281,43 @@ void cirrus_gd5428_device::start_bitblt()
{
if(m_blt_mode & 0x80) // colour expand
{
- UINT8 pixel = (vga.memory[m_blt_source_current % vga.svga_intf.vram_size] >> (7-(x % 8)) & 0x01) ? vga.gc.enable_set_reset : vga.gc.set_reset; // use GR0/1/10/11 background/foreground regs
+ if(m_blt_mode & 0x10) // 16-bit colour expansion / transparency width
+ {
+ // use GR0/1/10/11 background/foreground regs
+ UINT16 pixel = (vga.memory[m_blt_source_current % vga.svga_intf.vram_size] >> (7-((x/2) % 8)) & 0x01) ? ((m_gr11 << 8) | vga.gc.enable_set_reset) : ((m_gr10 << 8) | vga.gc.set_reset);
- copy_pixel(pixel, vga.memory[m_blt_dest_current % vga.svga_intf.vram_size]);
- if((x % 8) == 7 && !(m_blt_mode & 0x40)) // don't increment if a pattern (it's only 8 bits)
- m_blt_source_current++;
+ if(m_blt_dest_current & 1)
+ copy_pixel(pixel >> 8, vga.memory[m_blt_dest_current % vga.svga_intf.vram_size]);
+ else
+ copy_pixel(pixel & 0xff, vga.memory[m_blt_dest_current % vga.svga_intf.vram_size]);
+ if((x % 8) == 7 && !(m_blt_mode & 0x40)) // don't increment if a pattern (it's only 8 bits)
+ m_blt_source_current++;
+ }
+ else
+ {
+ UINT8 pixel = (vga.memory[m_blt_source_current % vga.svga_intf.vram_size] >> (7-(x % 8)) & 0x01) ? vga.gc.enable_set_reset : vga.gc.set_reset; // use GR0/1/10/11 background/foreground regs
+
+ copy_pixel(pixel, vga.memory[m_blt_dest_current % vga.svga_intf.vram_size]);
+ if((x % 8) == 7 && !(m_blt_mode & 0x40)) // don't increment if a pattern (it's only 8 bits)
+ m_blt_source_current++;
+ }
}
else
{
copy_pixel(vga.memory[m_blt_source_current % vga.svga_intf.vram_size], vga.memory[m_blt_dest_current % vga.svga_intf.vram_size]);
m_blt_source_current++;
}
+
m_blt_dest_current++;
if(m_blt_mode & 0x40 && (x % 8) == 7) // 8x8 pattern - reset pattern source location
{
if(m_blt_mode & 0x80) // colour expand
m_blt_source_current = m_blt_source + (1*(y % 8)); // patterns are linear data
+ else if(svga.rgb15_en || svga.rgb16_en)
+ {
+ if(m_blt_mode & 0x40 && (x % 16) == 15)
+ m_blt_source_current = m_blt_source + (16*(y % 8));
+ }
else
m_blt_source_current = m_blt_source + (8*(y % 8));
}
@@ -300,6 +326,11 @@ void cirrus_gd5428_device::start_bitblt()
{
if(m_blt_mode & 0x80) // colour expand
m_blt_source_current = m_blt_source + (1*(y % 8)); // patterns are linear data
+ else if(svga.rgb15_en || svga.rgb16_en)
+ {
+ if(m_blt_mode & 0x40 && (x % 16) == 15)
+ m_blt_source_current = m_blt_source + (16*(y % 8));
+ }
else
m_blt_source_current = m_blt_source + (8*(y % 8));
}
@@ -326,11 +357,26 @@ void cirrus_gd5428_device::start_reverse_bitblt()
{
if(m_blt_mode & 0x80) // colour expand
{
+ if(m_blt_mode & 0x10) // 16-bit colour expansion / transparency width
+ {
+ // use GR0/1/10/11 background/foreground regs
+ UINT16 pixel = (vga.memory[m_blt_source_current % vga.svga_intf.vram_size] >> (7-((x/2) % 8)) & 0x01) ? ((m_gr11 << 8) | vga.gc.enable_set_reset) : ((m_gr10 << 8) | vga.gc.set_reset);
+
+ if(m_blt_dest_current & 1)
+ copy_pixel(pixel >> 8, vga.memory[m_blt_dest_current % vga.svga_intf.vram_size]);
+ else
+ copy_pixel(pixel & 0xff, vga.memory[m_blt_dest_current % vga.svga_intf.vram_size]);
+ if((x % 8) == 7 && !(m_blt_mode & 0x40)) // don't increment if a pattern (it's only 8 bits)
+ m_blt_source_current--;
+ }
+ else
+ {
UINT8 pixel = (vga.memory[m_blt_source_current % vga.svga_intf.vram_size] >> (7-(x % 8)) & 0x01) ? vga.gc.enable_set_reset : vga.gc.set_reset; // use GR0/1/10/11 background/foreground regs
copy_pixel(pixel, vga.memory[m_blt_dest_current % vga.svga_intf.vram_size]);
if((x % 8) == 7 && !(m_blt_mode & 0x40)) // don't decrement if a pattern (it's only 8 bits)
m_blt_source_current--;
+ }
}
else
{
@@ -342,6 +388,11 @@ void cirrus_gd5428_device::start_reverse_bitblt()
{
if(m_blt_mode & 0x80) // colour expand
m_blt_source_current = m_blt_source - (1*(y % 8)); // patterns are linear data
+ else if(svga.rgb15_en || svga.rgb16_en)
+ {
+ if(m_blt_mode & 0x40 && (x % 16) == 15)
+ m_blt_source_current = m_blt_source - (16*(y % 8));
+ }
else
m_blt_source_current = m_blt_source - (8*(y % 8));
}
@@ -350,6 +401,11 @@ void cirrus_gd5428_device::start_reverse_bitblt()
{
if(m_blt_mode & 0x80) // colour expand
m_blt_source_current = m_blt_source - (1*(y % 8)); // patterns are linear data
+ else if(svga.rgb15_en || svga.rgb16_en)
+ {
+ if(m_blt_mode & 0x40 && (x % 16) == 15)
+ m_blt_source_current = m_blt_source - (16*(y % 8));
+ }
else
m_blt_source_current = m_blt_source - (8*(y % 8));
}
@@ -407,7 +463,11 @@ void cirrus_gd5428_device::blit_byte()
for(x=0;x<8;x++)
{
- pixel = ((m_blt_system_buffer & (0x00000001 << (7-x))) >> (7-x)) ? vga.gc.enable_set_reset : vga.gc.set_reset; // use GR0/1/10/11 background/foreground regs
+ // use GR0/1/10/11 background/foreground regs
+ if(m_blt_dest_current & 1)
+ pixel = ((m_blt_system_buffer & (0x00000001 << (7-x))) >> (7-x)) ? m_gr11 : m_gr10;
+ else
+ pixel = ((m_blt_system_buffer & (0x00000001 << (7-x))) >> (7-x)) ? vga.gc.enable_set_reset : vga.gc.set_reset;
if(m_blt_pixel_count <= m_blt_width - 1)
copy_pixel(pixel,vga.memory[m_blt_dest_current % vga.svga_intf.vram_size]);
m_blt_dest_current++;
@@ -656,9 +716,11 @@ UINT8 cirrus_gd5428_device::cirrus_gc_reg_read(UINT8 index)
break;
case 0x0e: // Miscellaneous Control
break;
- case 0x10: // Foreground Colour Byte 1
+ case 0x10: // Background Colour Byte 1
+ res = m_gr10;
break;
- case 0x11: // Background Colour Byte 1
+ case 0x11: // Foreground Colour Byte 1
+ res = m_gr11;
break;
case 0x20: // BLT Width 0
res = m_blt_width & 0x00ff;
@@ -778,9 +840,11 @@ void cirrus_gd5428_device::cirrus_gc_reg_write(UINT8 index, UINT8 data)
break;
case 0x0e: // Miscellaneous Control
break;
- case 0x10: // Foreground Colour Byte 1
+ case 0x10: // Background Colour Byte 1
+ m_gr10 = data;
break;
- case 0x11: // Background Colour Byte 1
+ case 0x11: // Foreground Colour Byte 1
+ m_gr11 = data;
break;
case 0x20: // BLT Width 0
m_blt_width = (m_blt_width & 0xff00) | data;
@@ -1328,14 +1392,27 @@ WRITE8_MEMBER(cirrus_gd5428_device::mem_w)
else
offset &= 0xffff;
+ // GR0 (and GR10 in 15/16bpp modes) = background colour in write mode 5
+ // GR1 (and GR11 in 15/16bpp modes) = foreground colour in write modes 4 or 5
if(vga.gc.write_mode == 4)
{
int i;
for(i=0;i<8;i++)
{
- if(data & (0x01 << (7-i)))
- vga.memory[((addr+offset)*8+i) % vga.svga_intf.vram_size] = vga.gc.enable_set_reset; // GR1 (and GR11 in 16bpp modes) = foreground colour in write modes 4 or 5
+ if(svga.rgb8_en)
+ {
+ if(data & (0x01 << (7-i)))
+ vga.memory[((addr+offset)*8+i) % vga.svga_intf.vram_size] = vga.gc.enable_set_reset;
+ }
+ else if(svga.rgb15_en || svga.rgb16_en)
+ {
+ if(data & (0x01 << (7-i)))
+ {
+ vga.memory[((addr+offset)*16+(i*2)) % vga.svga_intf.vram_size] = vga.gc.enable_set_reset;
+ vga.memory[((addr+offset)*16+(i*2)+1) % vga.svga_intf.vram_size] = m_gr11;
+ }
+ }
}
return;
}
@@ -1346,10 +1423,26 @@ WRITE8_MEMBER(cirrus_gd5428_device::mem_w)
for(i=0;i<8;i++)
{
- if(data & (0x01 << (7-i)))
- vga.memory[((addr+offset)*8+i) % vga.svga_intf.vram_size] = vga.gc.enable_set_reset; // GR1 (and GR11 in 16bpp modes) = foreground colour in write modes 4 or 5
- else
- vga.memory[((addr+offset)*8+i) % vga.svga_intf.vram_size] = vga.gc.set_reset; // GR0 (and GR10 in 16bpp modes) = background colour in write mode 5
+ if(svga.rgb8_en)
+ {
+ if(data & (0x01 << (7-i)))
+ vga.memory[((addr+offset)*8+i) % vga.svga_intf.vram_size] = vga.gc.enable_set_reset;
+ else
+ vga.memory[((addr+offset)*8+i) % vga.svga_intf.vram_size] = vga.gc.set_reset;
+ }
+ else if(svga.rgb15_en || svga.rgb16_en)
+ {
+ if(data & (0x01 << (7-i)))
+ {
+ vga.memory[((addr+offset)*16+(i*2)) % vga.svga_intf.vram_size] = vga.gc.enable_set_reset;
+ vga.memory[((addr+offset)*16+(i*2)+1) % vga.svga_intf.vram_size] = m_gr11;
+ }
+ else
+ {
+ vga.memory[((addr+offset)*16+(i*2)) % vga.svga_intf.vram_size] = vga.gc.set_reset;
+ vga.memory[((addr+offset)*16+(i*2)+1) % vga.svga_intf.vram_size] = m_gr10;
+ }
+ }
}
return;
}
diff --git a/src/emu/video/clgd542x.h b/src/emu/video/clgd542x.h
index 31e1876ef9e..20300d160fd 100644
--- a/src/emu/video/clgd542x.h
+++ b/src/emu/video/clgd542x.h
@@ -41,6 +41,8 @@ protected:
UINT8 gc_bank_1;
bool gc_locked;
UINT8 m_lock_reg;
+ UINT8 m_gr10; // high byte of background colour (in 15/16bpp)
+ UINT8 m_gr11; // high byte of foreground colour (in 15/16bpp)
UINT8 m_cr19;
UINT8 m_cr1a;
diff --git a/src/emu/video/crt9007.c b/src/emu/video/crt9007.c
index 7a7a3f78f87..a5722fbd3bf 100644
--- a/src/emu/video/crt9007.c
+++ b/src/emu/video/crt9007.c
@@ -176,7 +176,7 @@ enum
{
NON_INTERLACED = 0,
ENHANCED_VIDEO_INTERFACE,
- NORMAL_VIDEO_INTERFACE,
+ NORMAL_VIDEO_INTERFACE
};
diff --git a/src/emu/video/hd44780.h b/src/emu/video/hd44780.h
index 466af6f8a7d..f98bc01806b 100644
--- a/src/emu/video/hd44780.h
+++ b/src/emu/video/hd44780.h
@@ -69,15 +69,14 @@ protected:
enum
{
CHARSET_HD44780_A00,
- CHARSET_KS0066_F05,
- /*
+ CHARSET_KS0066_F05 /*,
CHARSET_HD44780_A01,
CHARSET_HD44780_A02,
CHARSET_KS0066_F00,
CHARSET_KS0066_F03,
CHARSET_KS0066_F04,
CHARSET_KS0066_F06,
- CHARSET_KS0066_F59,
+ CHARSET_KS0066_F59
*/
};
diff --git a/src/emu/video/i82730.c b/src/emu/video/i82730.c
new file mode 100644
index 00000000000..5bcc3240a35
--- /dev/null
+++ b/src/emu/video/i82730.c
@@ -0,0 +1,527 @@
+// license:GPL-2.0+
+// copyright-holders:Dirk Best
+/***************************************************************************
+
+ Intel 82730
+
+ Text Coprocessor
+
+***************************************************************************/
+
+#include "i82730.h"
+
+
+//**************************************************************************
+// CONSTANTS
+//**************************************************************************
+
+#define VERBOSE 1
+#define VERBOSE_COMMANDS 1
+#define VERBOSE_DATASTREAM 0
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+const device_type I82730 = &device_creator<i82730_device>;
+
+const char *i82730_device::m_command_names[] =
+{
+ /* 00 */ "NOP",
+ /* 01 */ "START DISPLAY",
+ /* 02 */ "START VIRTUAL DISPLAY",
+ /* 03 */ "STOP DISPLAY",
+ /* 04 */ "MODE SET",
+ /* 05 */ "LOAD CBP",
+ /* 06 */ "LOAD INTMASK",
+ /* 07 */ "LPEN ENABLE",
+ /* 08 */ "READ STATUS",
+ /* 09 */ "LD CUR POS",
+ /* 0a */ "SELF TEST",
+ /* 0b */ "TEST ROW BUFFER"
+};
+
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// i82730_device - constructor
+//-------------------------------------------------
+
+i82730_device::i82730_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ device_t(mconfig, I82730, "I82730", tag, owner, clock, "i82730", __FILE__),
+ device_video_interface(mconfig, *this),
+ m_sint_handler(*this),
+ m_cpu_tag(NULL), m_program(NULL),
+ m_row_timer(NULL),
+ m_initialized(false), m_mode_set(false),
+ m_ca(0),
+ m_sysbus(0x00), m_ibp(0x0000), m_cbp(0x0000), m_intmask(0xffff), m_status(0x0000),
+ m_list_switch(0), m_auto_line_feed(0), m_max_dma_count(0),
+ m_lptr(0), m_sptr(0),
+ m_dma_burst_space(0), m_dma_burst_length(0),
+ m_hfldstrt(0), m_margin(0), m_lpr(0), m_field_attribute_mask(0), m_vsyncstp(0), m_vfldstrt(0), m_vfldstp(0),
+ m_frame_int_count(0),
+ m_row_index(0)
+{
+}
+
+//-------------------------------------------------
+// set_cpu_tag - set cpu we are attached to
+//-------------------------------------------------
+
+void i82730_device::set_cpu_tag(device_t &device, device_t *owner, const char *tag)
+{
+ i82730_device &dev = dynamic_cast<i82730_device &>(device);
+ dev.m_cpu_tag = tag;
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void i82730_device::device_start()
+{
+ // register bitmap
+ m_screen->register_screen_bitmap(m_bitmap);
+
+ // resolve callbacks
+ m_sint_handler.resolve_safe();
+
+ // bind delegates
+ m_update_row_cb.bind_relative_to(*owner());
+
+ // allocate row timer
+ m_row_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(i82730_device::row_update), this));
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void i82730_device::device_reset()
+{
+ cpu_device *cpu = m_owner->subdevice<cpu_device>(m_cpu_tag);
+ m_program = &cpu->space(AS_PROGRAM);
+
+ m_initialized = false;
+ m_mode_set = false;
+
+ m_ca = 0;
+ m_status = 0x0000;
+}
+
+
+//**************************************************************************
+// MEMORY ACCESS
+//**************************************************************************
+
+UINT8 i82730_device::read_byte(offs_t address)
+{
+ return m_program->read_byte(address);
+}
+
+UINT16 i82730_device::read_word(offs_t address)
+{
+ UINT16 data = 0xffff;
+
+ if (sysbus_16bit() && !(address & 1))
+ {
+ data = m_program->read_word(address);
+ }
+ else
+ {
+ data = m_program->read_byte(address);
+ data |= m_program->read_byte(address + 1) << 8;
+ }
+
+ return data;
+}
+
+void i82730_device::write_byte(offs_t address, UINT8 data)
+{
+ m_program->write_byte(address, data);
+}
+
+void i82730_device::write_word(offs_t address, UINT16 data)
+{
+ if (sysbus_16bit() && !(address & 1))
+ {
+ m_program->write_word(address, data);
+ }
+ else
+ {
+ m_program->write_byte(address, data & 0xff);
+ m_program->write_byte(address + 1, (data >> 8) & 0xff);
+ }
+}
+
+
+//**************************************************************************
+// IMPLEMENTATION
+//**************************************************************************
+
+void i82730_device::update_interrupts()
+{
+ UINT16 code = m_status & ~m_intmask & ~(VDIP | DIP);
+ write_word(m_cbp + 20, code);
+
+ if (code)
+ m_sint_handler(1);
+}
+
+void i82730_device::mode_set()
+{
+ UINT32 mptr = (read_word(m_cbp + 32) << 16) | read_word(m_cbp + 30);
+ UINT16 tmp;
+
+ tmp = read_word(mptr);
+ m_dma_burst_space = tmp & 0x7f;
+ m_dma_burst_length = (tmp >> 8) & 0x7f;
+
+ tmp = read_word(mptr + 2);
+ UINT8 hsyncstp = tmp & 0xff;
+ UINT8 line_length = (tmp >> 8) & 0xff;
+
+ tmp = read_word(mptr + 4);
+ UINT8 hfldstp = tmp & 0xff;
+ m_hfldstrt = (tmp >> 8) & 0xff;
+
+ tmp = read_word(mptr + 6);
+ UINT8 hbrdstp = tmp & 0xff;
+ UINT8 hbrdstrt = (tmp >> 8) & 0xff;
+
+ tmp = read_word(mptr + 8);
+ m_margin = tmp & 0x1f;
+
+ tmp = read_word(mptr + 10);
+ m_lpr = tmp & 0x1f;
+
+ tmp = read_word(mptr + 24);
+ m_field_attribute_mask = tmp & 0x7fff;
+
+ tmp = read_word(mptr + 26);
+ UINT16 frame_length = tmp & 0x7ff;
+
+ tmp = read_word(mptr + 28);
+ m_vsyncstp = tmp & 0x7ff;
+
+ tmp = read_word(mptr + 30);
+ m_vfldstrt = tmp & 0x7ff;
+
+ tmp = read_word(mptr + 32);
+ m_vfldstp = tmp & 0x7ff;
+
+ tmp = read_word(mptr + 38);
+ m_frame_int_count = tmp & 0x0f;
+
+ // setup screen mode
+ rectangle visarea(hbrdstrt * 16, hbrdstp * 16 - 1, m_vsyncstp, m_vfldstp + m_margin + 1 + m_lpr - 1);
+ attoseconds_t period = HZ_TO_ATTOSECONDS(clock() * 16) * line_length * 16 * frame_length;
+ m_screen->configure(line_length * 16, frame_length, visarea, period);
+
+ // start display is now valid
+ m_mode_set = true;
+
+ // adjust timer for the new mode
+ m_row_timer->adjust(m_screen->time_until_pos(0));
+
+ // output some debug info
+ if (VERBOSE)
+ {
+ logerror("%s('%s'): ---- setting mode ----\n", shortname(), basetag());
+ logerror("%s('%s'): dma burst length %02x, space %02x\n", shortname(), basetag(), m_dma_burst_length, m_dma_burst_space);
+ logerror("%s('%s'): margin %02x, lpr %02x\n", shortname(), basetag(), m_margin, m_lpr);
+ logerror("%s('%s'): hsyncstp: %02x, line_length: %02x, hfldstrt: %02x, hbrdstart: %02x, hfldstop: %02x, hbrdstop: %02x\n",
+ shortname(), basetag(), hsyncstp, line_length, m_hfldstrt, hbrdstrt, hfldstp, hbrdstp);
+ logerror("%s('%s'): frame_length %04x, vsyncstp: %04x, vfldstrt: %04x, vfldstp: %04x\n",
+ shortname(), basetag(), frame_length, m_vsyncstp, m_vfldstrt, m_vfldstp);
+ }
+}
+
+void i82730_device::execute_command()
+{
+ UINT8 command = read_byte(m_cbp + 1);
+ UINT16 tmp;
+
+ if (VERBOSE_COMMANDS && command < ARRAY_LENGTH(m_command_names))
+ logerror("%s('%s'): executing command: %s [cbp = %08x]\n", shortname(), basetag(), m_command_names[command], m_cbp);
+
+ tmp = read_word(m_cbp + 2);
+ m_list_switch = BIT(tmp, 6);
+ m_auto_line_feed = BIT(tmp, 7);
+
+ tmp = read_word(m_cbp + 4);
+ m_max_dma_count = tmp & 0xff;
+
+ switch (command)
+ {
+ // NOP
+ case 0x00:
+ break;
+
+ // START DISPLAY
+ case 0x01:
+ if (m_mode_set)
+ m_status = (m_status & ~VDIP) | DIP;
+ break;
+
+ // START VIRTUAL DISPLAY
+ case 0x02:
+ if (m_mode_set)
+ m_status = VDIP | (m_status & ~DIP);
+ break;
+
+ // STOP DISPLAY
+ case 0x03:
+ m_status &= ~(VDIP | DIP);
+ break;
+
+ // MODE SET
+ case 0x04:
+ mode_set();
+ break;
+
+ // LOAD CBP
+ case 0x05:
+ m_cbp = (read_word(m_cbp + 16) << 16) | read_word(m_cbp + 14);
+ execute_command();
+ break;
+
+ // LOAD INTMASK
+ case 0x06:
+ m_intmask = read_word(m_cbp + 22);
+ if (VERBOSE_COMMANDS)
+ logerror("%s('%s'): intmask now %04x\n", shortname(), basetag(), m_intmask);
+ break;
+
+ // LPEN ENABLE
+ case 0x07:
+ fatalerror("%s('%s'): Unimplemented command %s\n", shortname(), basetag(), m_command_names[command]);
+ break;
+
+ // READ STATUS
+ case 0x08:
+ write_word(m_cbp + 18, m_status);
+ m_status &= (VDIP | DIP);
+ break;
+
+ // LD CUR POS
+ case 0x09:
+ fatalerror("%s('%s'): Unimplemented command %s\n", shortname(), basetag(), m_command_names[command]);
+ break;
+
+ // SELF TEST
+ case 0x0a:
+ fatalerror("%s('%s'): Unimplemented command %s\n", shortname(), basetag(), m_command_names[command]);
+ break;
+
+ // TEST ROW BUFFER
+ case 0x0b:
+ fatalerror("%s('%s'): Unimplemented command %s\n", shortname(), basetag(), m_command_names[command]);
+ break;
+
+ default:
+ if (VERBOSE_COMMANDS)
+ logerror("%s('%s'): executing command: (reserved) [cbp = %08x]\n", shortname(), basetag(), m_cbp);
+ m_status |= RCC;
+ update_interrupts();
+ break;
+ }
+
+ // clear busy
+ write_word(m_cbp, read_word(m_cbp) & 0xff00);
+}
+
+void i82730_device::load_row()
+{
+ bool finished = false;
+
+ m_row[m_row_index].count = 0;
+
+ while (!finished)
+ {
+ UINT16 data = read_word(m_sptr);
+ m_sptr += 2;
+
+ if (BIT(data, 15))
+ {
+ switch (data >> 8)
+ {
+ case 0x8e:
+ m_field_attribute_mask = read_word(m_sptr) & 0x7fff;
+ m_sptr += 2;
+
+ if (VERBOSE_DATASTREAM)
+ logerror("%s('%s'): SET FIELD ATTRIB to %04x\n", shortname(), basetag(), m_field_attribute_mask);
+
+ break;
+
+ default:
+ fatalerror("%s('%s'): Unimplemented datastream command %02x\n", shortname(), basetag(), data >> 8);
+ }
+ }
+ else
+ {
+ // maximum row size is 200
+ if (m_row[m_row_index].count < m_max_dma_count && m_row[m_row_index].count < 200)
+ {
+ m_row[m_row_index].data[m_row[m_row_index].count++] = data;
+ }
+ else
+ {
+#if 0
+ // move to next string?
+ if (m_auto_line_feed == 0)
+ {
+ m_sptr = (read_word(m_lptr + 2) << 16) | read_word(m_lptr);
+ m_lptr += 4;
+ }
+#endif
+ finished = true;
+ }
+ }
+ }
+
+ m_sptr -= 2;
+}
+
+TIMER_CALLBACK_MEMBER( i82730_device::row_update )
+{
+ int y = m_screen->vpos();
+
+ if (y == 0)
+ {
+ // clear interrupt status flags
+ m_status &= (VDIP | DIP);
+
+ // clear field attribute mask
+ m_field_attribute_mask = 0;
+
+ // get listbase
+ if (m_list_switch)
+ m_lptr = (read_word(m_cbp + 8) << 16) | read_word(m_cbp + 6);
+ else
+ m_lptr = (read_word(m_cbp + 12) << 16) | read_word(m_cbp + 10);
+
+ m_sptr = (read_word(m_lptr + 2) << 16) | read_word(m_lptr);
+ m_lptr += 4;
+
+ // fetch initial row
+ m_row_index = 0;
+ load_row();
+ }
+ else if (y >= m_vsyncstp && y < m_vfldstrt)
+ {
+ // blank (top border)
+ }
+ else if (y >= m_vfldstrt && y < m_vfldstp)
+ {
+ UINT8 lc = (y - m_vfldstrt) % (m_lpr + 1);
+
+ // call driver
+ m_update_row_cb(m_bitmap, m_row[m_row_index].data, lc, y - m_vsyncstp, m_row[m_row_index].count);
+
+ // swap buffers at end of row
+ if (lc == m_lpr)
+ {
+ m_row_index ^= 1;
+ load_row();
+ }
+ }
+ else if (y >= m_vfldstp && y < m_vfldstp + m_margin + 1)
+ {
+ // margin
+ }
+ else if (y >= m_vfldstp + m_margin + 1 && y < m_vfldstp + m_margin + 1 + m_lpr + 1)
+ {
+ UINT8 lc = (y - (m_vfldstp + m_margin + 1)) % (m_lpr + 1);
+
+ m_sptr = (read_word(m_cbp + 36) << 16) | read_word(m_cbp + 34);
+ load_row();
+
+ // call driver
+ m_update_row_cb(m_bitmap, m_row[m_row_index].data, lc, y - m_vsyncstp, m_row[m_row_index].count);
+ }
+ else if (y == m_vfldstp + m_margin + 1 + m_lpr + 1)
+ {
+ // todo: check ca
+
+ // frame interrupt?
+ if ((m_screen->frame_number() % m_frame_int_count) == 0)
+ m_status |= EONF;
+
+ // check interrupts
+ update_interrupts();
+ }
+ else
+ {
+ // vblank
+ }
+
+ m_row_timer->adjust(m_screen->time_until_pos((y + 1) % m_screen->height()));
+}
+
+WRITE_LINE_MEMBER( i82730_device::ca_w )
+{
+ if (VERBOSE)
+ logerror("%s('%s'): ca_w %d\n", shortname(), basetag(), state);
+
+ // falling edge
+ if (m_ca == 1 && state == 0)
+ {
+ if (!m_initialized)
+ {
+ // get system bus width
+ m_sysbus = m_program->read_byte(0xfffffff6);
+
+ // get intermediate block pointer
+ m_ibp = (read_word(0xfffffffe) << 16) | read_word(0xfffffffc);
+
+ // get system configuration byte
+ UINT8 scb = read_byte(m_ibp + 6);
+
+ // clear busy
+ write_word(m_ibp, read_word(m_ibp) & 0xff00);
+
+ // done
+ m_initialized = true;
+
+ // output some debug info
+ if (VERBOSE)
+ {
+ logerror("%s('%s'): ---- initializing ----\n", shortname(), basetag());
+ logerror("%s('%s'): %s system bus\n", shortname(), basetag(), sysbus_16bit() ? "16-bit" : "8-bit");
+ logerror("%s('%s'): intermediate block pointer: %08x\n", shortname(), basetag(), m_ibp);
+ logerror("%s('%s'): addrbus: %s, clno: %d, clpos: %d, mode: %s, dtw16: %s, srdy: %s\n", shortname(), basetag(),
+ BIT(scb, 0) ? "32-bit" : "16-bit", (scb >> 1) & 0x03, (scb >> 3) & 0x03,
+ BIT(scb, 5) ? "master" : "slave", BIT(scb, 6) ? "16-bit" : "8-bit", BIT(scb, 7) ? "synchronous" : "asynchronous");
+ }
+ }
+
+ // fetch command block pointer
+ m_cbp = (read_word(m_ibp + 4) << 16) | read_word(m_ibp + 2);
+
+ // and execute command
+ execute_command();
+ }
+
+ m_ca = state;
+}
+
+WRITE_LINE_MEMBER( i82730_device::irst_w )
+{
+ if (VERBOSE)
+ logerror("%s('%s'): irst_w %d\n", shortname(), basetag(), state);
+
+ m_sint_handler(0);
+}
+
+UINT32 i82730_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
+{
+ copybitmap(bitmap, m_bitmap, 0, 0, m_hfldstrt * 16, 0, cliprect);
+ return 0;
+}
diff --git a/src/emu/video/i82730.h b/src/emu/video/i82730.h
new file mode 100644
index 00000000000..5df4e46a5de
--- /dev/null
+++ b/src/emu/video/i82730.h
@@ -0,0 +1,157 @@
+// license:GPL-2.0+
+// copyright-holders:Dirk Best
+/***************************************************************************
+
+ Intel 82730
+
+ Text Coprocessor
+
+***************************************************************************/
+
+#pragma once
+
+#ifndef __I82730_H__
+#define __I82730_H__
+
+#include "emu.h"
+
+
+//**************************************************************************
+// INTERFACE CONFIGURATION MACROS
+//**************************************************************************
+
+#define MCFG_I82730_ADD(_tag, _cpu_tag, _clock) \
+ MCFG_DEVICE_ADD(_tag, I82730, _clock) \
+ i82730_device::set_cpu_tag(*device, owner, _cpu_tag);
+
+#define MCFG_I82730_SINT_HANDLER(_devcb) \
+ devcb = &i82730_device::set_sint_handler(*device, DEVCB_##_devcb);
+
+#define MCFG_I82730_UPDATE_ROW_CB(_class, _method) \
+ i82730_device::set_update_row_callback(*device, i82730_update_row_delegate(&_class::_method, #_class "::" #_method, downcast<_class *>(owner)));
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+typedef device_delegate<void (bitmap_rgb32 &bitmap, UINT16 *data, UINT8 lc, UINT16 y, int x_count)> i82730_update_row_delegate;
+
+#define I82730_UPDATE_ROW(name) \
+ void name(bitmap_rgb32 &bitmap, UINT16 *data, UINT8 lc, UINT16 y, int x_count)
+
+
+// ======================> i82730_device
+
+class i82730_device : public device_t, public device_video_interface
+{
+public:
+ // construction/destruction
+ i82730_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ // callbacks
+ template<class _Object> static devcb_base &set_sint_handler(device_t &device, _Object object)
+ { return downcast<i82730_device &>(device).m_sint_handler.set_callback(object); }
+
+ // inline configuration
+ static void set_cpu_tag(device_t &device, device_t *owner, const char *tag);
+ static void set_update_row_callback(device_t &device, i82730_update_row_delegate callback) { downcast<i82730_device &>(device).m_update_row_cb = callback; }
+
+ UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
+
+ DECLARE_WRITE_LINE_MEMBER(ca_w);
+ DECLARE_WRITE_LINE_MEMBER(irst_w);
+
+protected:
+ virtual void device_start();
+ virtual void device_reset();
+
+private:
+ // status
+ enum
+ {
+ DUR = 0x001, // data underrun
+ LPU = 0x002, // light pen update
+ DBOR = 0x004, // data buffer overrun
+ EONF = 0x008, // end of n frames
+ FDE = 0x010, // frame data error
+ RCC = 0x020, // reserved channel command executed
+ RDC = 0x040, // reserved data stream command executed
+ DIP = 0x080, // display in progress
+ VDIP = 0x100 // virtual display in progress
+ };
+
+ static const char* m_command_names[];
+
+ bool sysbus_16bit() { return BIT(m_sysbus, 0); }
+
+ UINT8 read_byte(offs_t address);
+ UINT16 read_word(offs_t address);
+ void write_byte(offs_t address, UINT8 data);
+ void write_word(offs_t address, UINT16 data);
+
+ void update_interrupts();
+ void mode_set();
+ void execute_command();
+ void load_row();
+
+ TIMER_CALLBACK_MEMBER(row_update);
+
+ devcb_write_line m_sint_handler;
+ i82730_update_row_delegate m_update_row_cb;
+
+ const char *m_cpu_tag;
+ address_space *m_program;
+
+ emu_timer *m_row_timer;
+
+ bitmap_rgb32 m_bitmap;
+
+ bool m_initialized;
+ bool m_mode_set;
+
+ int m_ca;
+
+ // internal registers
+ UINT8 m_sysbus;
+ UINT32 m_ibp;
+ UINT32 m_cbp;
+ UINT16 m_intmask;
+ UINT16 m_status;
+
+ int m_list_switch;
+ int m_auto_line_feed;
+ UINT8 m_max_dma_count;
+
+ UINT32 m_lptr;
+ UINT32 m_sptr;
+
+ int m_dma_burst_space;
+ int m_dma_burst_length;
+
+ // display parameters
+ int m_hfldstrt;
+ int m_margin;
+ int m_lpr;
+ UINT16 m_field_attribute_mask;
+ int m_vsyncstp;
+ int m_vfldstrt;
+ int m_vfldstp;
+
+ int m_frame_int_count;
+
+ // row buffers
+ struct row_buffer
+ {
+ UINT16 data[200];
+ int count;
+ };
+
+ row_buffer m_row[2];
+ int m_row_index;
+};
+
+// device type definition
+extern const device_type I82730;
+
+#endif // __I82730_H__
diff --git a/src/emu/video/i8275.c b/src/emu/video/i8275.c
index 848ee9e8eed..59f50b04f70 100644
--- a/src/emu/video/i8275.c
+++ b/src/emu/video/i8275.c
@@ -315,7 +315,7 @@ void i8275_device::device_timer(emu_timer &timer, device_timer_id id, int param,
int vsp = 0;
int rvv = 0;
- UINT8 data = m_buffer[!m_buffer_dma][sx];
+ UINT8 data = (end_of_row || m_end_of_screen) ? 0 : m_buffer[!m_buffer_dma][sx];
if (data & 0x80)
{
@@ -359,7 +359,7 @@ void i8275_device::device_timer(emu_timer &timer, device_timer_id id, int param,
m_end_of_screen = true;
break;
}
- vsp = 1;
+ //vsp = 1;
}
else
{
diff --git a/src/emu/video/mb_vcu.c b/src/emu/video/mb_vcu.c
index c06571ce4e8..a5ff14230bf 100644
--- a/src/emu/video/mb_vcu.c
+++ b/src/emu/video/mb_vcu.c
@@ -191,6 +191,24 @@ void mb_vcu_device::device_start()
3, resistances_gb, m_weights_b, 3600, 0,
2, resistances_r, m_weights_r, 3600, 0);
}
+
+ save_item(NAME(m_status));
+ save_pointer(NAME(m_ram), 0x800);
+ save_pointer(NAME(m_palram), 0x100);
+ save_item(NAME(m_param_offset_latch));
+ save_item(NAME(m_xpos));
+ save_item(NAME(m_ypos));
+ save_item(NAME(m_color1));
+ save_item(NAME(m_color2));
+ save_item(NAME(m_mode));
+ save_item(NAME(m_pix_xsize));
+ save_item(NAME(m_pix_ysize));
+ save_item(NAME(m_vregs));
+ save_item(NAME(m_bk_color));
+ save_item(NAME(m_vbank));
+ save_item(NAME(m_weights_r));
+ save_item(NAME(m_weights_g));
+ save_item(NAME(m_weights_b));
}
diff --git a/src/emu/video/mc6845.c b/src/emu/video/mc6845.c
index 2b72a57b47d..4c1d811369c 100644
--- a/src/emu/video/mc6845.c
+++ b/src/emu/video/mc6845.c
@@ -92,6 +92,7 @@ mc6845_device::mc6845_device(const machine_config &mconfig, device_type type, co
: device_t(mconfig, type, name, tag, owner, clock, shortname, source),
device_video_interface(mconfig, *this, false),
m_show_border_area(true),
+ m_interlace_adjust(0),
m_visarea_adjust_min_x(0),
m_visarea_adjust_max_x(0),
m_visarea_adjust_min_y(0),
@@ -108,6 +109,7 @@ mc6845_device::mc6845_device(const machine_config &mconfig, const char *tag, dev
: device_t(mconfig, MC6845, "MC6845 CRTC", tag, owner, clock, "mc6845", __FILE__),
device_video_interface(mconfig, *this, false),
m_show_border_area(true),
+ m_interlace_adjust(0),
m_visarea_adjust_min_x(0),
m_visarea_adjust_max_x(0),
m_visarea_adjust_min_y(0),
@@ -218,7 +220,7 @@ WRITE8_MEMBER( mc6845_device::register_w )
case 0x06: m_vert_disp = data & 0x7f; break;
case 0x07: m_vert_sync_pos = data & 0x7f; break;
case 0x08: m_mode_control = data & 0xff; break;
- case 0x09: m_max_ras_addr = data & 0x1f; break;
+ case 0x09: m_max_ras_addr = data & 0x1f; if (MODE_INTERLACE_AND_VIDEO) m_max_ras_addr += m_interlace_adjust; break;
case 0x0a: m_cursor_start_ras = data & 0x7f; break;
case 0x0b: m_cursor_end_ras = data & 0x1f; break;
case 0x0c: m_disp_start_addr = ((data & 0x3f) << 8) | (m_disp_start_addr & 0x00ff); break;
@@ -453,7 +455,7 @@ READ_LINE_MEMBER( mc6845_device::vsync_r )
void mc6845_device::recompute_parameters(bool postload)
{
UINT16 hsync_on_pos, hsync_off_pos, vsync_on_pos, vsync_off_pos;
- //UINT16 video_char_height = (MODE_INTERLACE_AND_VIDEO ? m_max_ras_addr + 1 : m_max_ras_addr) + 1;
+
UINT16 video_char_height = m_max_ras_addr + 1; // fix garbage at the bottom of the screen (eg victor9k)
// Would be useful for 'interlace and video' mode support...
// UINT16 frame_char_height = (MODE_INTERLACE_AND_VIDEO ? m_max_ras_addr / 2 : m_max_ras_addr) + 1;
@@ -1477,7 +1479,7 @@ PALETTE_INIT_MEMBER(mos8563_device, mos8563)
palette.set_pen_color(13, rgb_t(0xff, 0xff, 0x55));
palette.set_pen_color(14, rgb_t(0xaa, 0xaa, 0xaa));
palette.set_pen_color(15, rgb_t::white);
-};
+}
void mos8563_device::update_cursor_state()
diff --git a/src/emu/video/mc6845.h b/src/emu/video/mc6845.h
index db7e80f84a5..053c2b9491e 100644
--- a/src/emu/video/mc6845.h
+++ b/src/emu/video/mc6845.h
@@ -30,6 +30,9 @@
#define MCFG_MC6845_SHOW_BORDER_AREA(_show) \
mc6845_device::set_show_border_area(*device, _show);
+#define MCFG_MC6845_INTERLACE_ADJUST(_value) \
+ mc6845_device::set_interlace_adjust(*device, _value);
+
#define MCFG_MC6845_VISAREA_ADJUST(_minx, _maxx, _miny, _maxy) \
mc6845_device::set_visarea_adjust(*device, _minx, _maxx, _miny, _maxy);
@@ -96,6 +99,7 @@ public:
mc6845_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
static void set_show_border_area(device_t &device, bool show) { downcast<mc6845_device &>(device).m_show_border_area = show; }
+ static void set_interlace_adjust(device_t &device, int value) { downcast<mc6845_device &>(device).m_interlace_adjust = value; }
static void set_visarea_adjust(device_t &device, int min_x, int max_x, int min_y, int max_y)
{
mc6845_device &dev = downcast<mc6845_device &>(device);
@@ -272,6 +276,7 @@ protected:
************************/
bool m_show_border_area; /* visible screen area (false) active display (true) active display + blanking */
+ int m_interlace_adjust; /* adjust max ras in interlace mode */
/* visible screen area adjustment */
int m_visarea_adjust_min_x;
diff --git a/src/emu/video/mc6847.c b/src/emu/video/mc6847.c
index 44ae168b028..76c0dcb4c92 100644
--- a/src/emu/video/mc6847.c
+++ b/src/emu/video/mc6847.c
@@ -150,7 +150,7 @@ mc6847_friend_device::mc6847_friend_device(const machine_config &mconfig, device
// to the clock
//-------------------------------------------------
-ATTR_FORCE_INLINE emu_timer *mc6847_friend_device::setup_timer(device_timer_id id, double offset, double period)
+inline emu_timer *mc6847_friend_device::setup_timer(device_timer_id id, double offset, double period)
{
emu_timer *timer = timer_alloc(id);
timer->adjust(
@@ -228,7 +228,7 @@ void mc6847_friend_device::device_post_load(void)
// update_field_sync_timer
//-------------------------------------------------
-ATTR_FORCE_INLINE void mc6847_friend_device::update_field_sync_timer(void)
+void mc6847_friend_device::update_field_sync_timer(void)
{
// are we expecting field sync?
bool expected_field_sync = (m_physical_scanline < m_field_sync_falling_edge_scanline)
@@ -268,7 +268,7 @@ void mc6847_friend_device::device_timer(emu_timer &timer, device_timer_id id, in
// new_frame
//-------------------------------------------------
-ATTR_FORCE_INLINE void mc6847_friend_device::new_frame(void)
+inline void mc6847_friend_device::new_frame(void)
{
m_physical_scanline = 0;
m_logical_scanline = 0;
@@ -304,7 +304,7 @@ const char *mc6847_friend_device::scanline_zone_string(scanline_zone zone)
// change_horizontal_sync
//-------------------------------------------------
-ATTR_FORCE_INLINE void mc6847_friend_device::change_horizontal_sync(bool line)
+inline void mc6847_friend_device::change_horizontal_sync(bool line)
{
g_profiler.start(PROFILER_USER1);
@@ -372,7 +372,7 @@ ATTR_FORCE_INLINE void mc6847_friend_device::change_horizontal_sync(bool line)
// change_field_sync
//-------------------------------------------------
-ATTR_FORCE_INLINE void mc6847_friend_device::change_field_sync(bool line)
+inline void mc6847_friend_device::change_field_sync(bool line)
{
/* output field sync */
if (line != m_field_sync)
@@ -397,7 +397,7 @@ ATTR_FORCE_INLINE void mc6847_friend_device::change_field_sync(bool line)
// next_scanline
//-------------------------------------------------
-ATTR_FORCE_INLINE void mc6847_friend_device::next_scanline(void)
+inline void mc6847_friend_device::next_scanline(void)
{
/* advance to next scanline */
m_physical_scanline++;
@@ -678,7 +678,7 @@ void mc6847_base_device::record_scanline_res(int scanline, INT32 start_pos, INT3
// record_body_scanline
//-------------------------------------------------
-ATTR_FORCE_INLINE void mc6847_base_device::record_body_scanline(UINT16 physical_scanline, UINT16 scanline, INT32 start_pos, INT32 end_pos)
+inline void mc6847_base_device::record_body_scanline(UINT16 physical_scanline, UINT16 scanline, INT32 start_pos, INT32 end_pos)
{
// sanity checks
assert(scanline < 192);
@@ -780,7 +780,7 @@ void mc6847_base_device::field_sync_changed(bool line)
// border_value
//-------------------------------------------------
-ATTR_FORCE_INLINE mc6847_base_device::pixel_t mc6847_base_device::border_value(UINT8 mode, const pixel_t *palette, bool is_mc6847t1)
+inline mc6847_base_device::pixel_t mc6847_base_device::border_value(UINT8 mode, const pixel_t *palette, bool is_mc6847t1)
{
pixel_t result;
switch(mc6847_friend_device::border_value(mode, is_mc6847t1))
diff --git a/src/emu/video/mc6847.h b/src/emu/video/mc6847.h
index b81422cdc37..d3420a7fcba 100644
--- a/src/emu/video/mc6847.h
+++ b/src/emu/video/mc6847.h
@@ -172,7 +172,7 @@ protected:
}
}
}
- };
+ }
private:
struct entry
@@ -370,7 +370,7 @@ protected:
result = true;
}
return result;
- };
+ }
// template function for emitting graphics bytes
template<int bits_per_pixel, int xscale>
diff --git a/src/emu/video/pc_vga.c b/src/emu/video/pc_vga.c
index 67a7ea5d0cd..c494e4904ec 100644
--- a/src/emu/video/pc_vga.c
+++ b/src/emu/video/pc_vga.c
@@ -127,13 +127,15 @@ const device_type MACH8 = &device_creator<mach8_device>;
vga_device::vga_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source)
: device_t(mconfig, type, name, tag, owner, clock, shortname, source),
- m_palette(*this, "^palette")
+ m_palette(*this, "^palette"),
+ m_screen(*this,"^screen")
{
}
vga_device::vga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, VGA, "VGA", tag, owner, clock, "vga", __FILE__),
- m_palette(*this, "^palette")
+ m_palette(*this, "^palette"),
+ m_screen(*this,"^screen")
{
}
@@ -218,7 +220,8 @@ void svga_device::zero()
TIMER_CALLBACK_MEMBER(vga_device::vblank_timer_cb)
{
vga.crtc.start_addr = vga.crtc.start_addr_latch;
- m_vblank_timer->adjust( machine().first_screen()->time_until_pos(vga.crtc.vert_blank_start) );
+ vga.attribute.pel_shift = vga.attribute.pel_shift_latch;
+ m_vblank_timer->adjust( machine().first_screen()->time_until_pos(vga.crtc.vert_blank_start + vga.crtc.vert_blank_end) );
}
void vga_device::device_start()
@@ -468,7 +471,10 @@ void vga_device::vga_vh_vga(bitmap_rgb32 &bitmap, const rectangle &cliprect)
if((line + yi) < (vga.crtc.line_compare & mask_comp))
curr_addr = addr;
if((line + yi) == (vga.crtc.line_compare & mask_comp))
+ {
curr_addr = 0;
+ pel_shift = 0;
+ }
bitmapline = &bitmap.pix32(line + yi);
for (pos=curr_addr, c=0, column=0; column<VGA_COLUMNS+1; column++, c+=8, pos++)
{
@@ -1262,7 +1268,7 @@ void vga_device::recompute_params_clock(int divisor, int xtal)
refresh = HZ_TO_ATTOSECONDS(pixel_clock) * (hblank_period) * vblank_period;
machine().first_screen()->configure((hblank_period), (vblank_period), visarea, refresh );
//popmessage("%d %d\n",vga.crtc.horz_total * 8,vga.crtc.vert_total);
- m_vblank_timer->adjust( machine().first_screen()->time_until_pos(vga.crtc.vert_blank_start) );
+ m_vblank_timer->adjust( machine().first_screen()->time_until_pos(vga.crtc.vert_blank_start + vga.crtc.vert_blank_end) );
}
void vga_device::recompute_params()
@@ -1765,7 +1771,7 @@ void vga_device::attribute_reg_write(UINT8 index, UINT8 data)
case 0x10: vga.attribute.data[0x10] = data; break;
case 0x11: vga.attribute.data[0x11] = data; break;
case 0x12: vga.attribute.data[0x12] = data; break;
- case 0x13: vga.attribute.pel_shift = vga.attribute.data[0x13] = data; break;
+ case 0x13: vga.attribute.pel_shift_latch = vga.attribute.data[0x13] = data; break;
case 0x14: vga.attribute.data[0x14] = data; break;
}
}
diff --git a/src/emu/video/pc_vga.h b/src/emu/video/pc_vga.h
index 613d38a1616..ee0504a95e1 100644
--- a/src/emu/video/pc_vga.h
+++ b/src/emu/video/pc_vga.h
@@ -208,6 +208,7 @@ protected:
UINT8 index, data[0x15]; int state;
UINT8 prot_bit;
UINT8 pel_shift;
+ UINT8 pel_shift_latch;
} attribute;
@@ -229,6 +230,7 @@ protected:
emu_timer *m_vblank_timer;
required_device<palette_device> m_palette;
+ required_device<screen_device> m_screen;
};
diff --git a/src/emu/video/rgbgen.c b/src/emu/video/rgbgen.c
new file mode 100644
index 00000000000..4e7e6042569
--- /dev/null
+++ b/src/emu/video/rgbgen.c
@@ -0,0 +1,136 @@
+// license:BSD-3-Clause
+// copyright-holders:Vas Crabb, Ryan Holtz
+/***************************************************************************
+
+ rgbgen.c
+
+ General RGB utilities.
+
+***************************************************************************/
+
+#if !(defined(__ALTIVEC__) || ((!defined(MAME_DEBUG) || defined(__OPTIMIZE__)) && (defined(__SSE2__) || defined(_MSC_VER)) && defined(PTR64)))
+
+#include "emu.h"
+#include "rgbgen.h"
+
+/***************************************************************************
+ HIGHER LEVEL OPERATIONS
+***************************************************************************/
+
+/*-------------------------------------------------
+ rgbaint_blend - blend two colors by the given
+ scale factor
+-------------------------------------------------*/
+
+void rgbaint_t::blend(const rgbaint_t& color2, UINT8 color1scale)
+{
+ INT32 scale1 = (INT32)color1scale;
+ INT32 scale2 = 256 - scale1;
+
+ m_a = (m_a * scale1 + color2.m_a * scale2) >> 8;
+ m_r = (m_r * scale1 + color2.m_r * scale2) >> 8;
+ m_g = (m_g * scale1 + color2.m_g * scale2) >> 8;
+ m_b = (m_b * scale1 + color2.m_b * scale2) >> 8;
+ m_a |= (m_a & 0x00800000) ? 0xff000000 : 0;
+ m_r |= (m_r & 0x00800000) ? 0xff000000 : 0;
+ m_g |= (m_g & 0x00800000) ? 0xff000000 : 0;
+ m_b |= (m_b & 0x00800000) ? 0xff000000 : 0;
+}
+
+
+/*-------------------------------------------------
+ rgbaint_scale_and_clamp - scale the given
+ color by an 8.8 scale factor, immediate or
+ per channel, and clamp to byte values
+-------------------------------------------------*/
+
+void rgbaint_t::scale_imm_and_clamp(INT32 scale)
+{
+ m_a = (m_a * scale) >> 8;
+ m_r = (m_r * scale) >> 8;
+ m_g = (m_g * scale) >> 8;
+ m_b = (m_b * scale) >> 8;
+ m_a |= (m_a & 0x00800000) ? 0xff000000 : 0;
+ m_r |= (m_r & 0x00800000) ? 0xff000000 : 0;
+ m_g |= (m_g & 0x00800000) ? 0xff000000 : 0;
+ m_b |= (m_b & 0x00800000) ? 0xff000000 : 0;
+ if ((UINT32)m_a > 255) { m_a = (m_a < 0) ? 0 : 255; }
+ if ((UINT32)m_r > 255) { m_r = (m_r < 0) ? 0 : 255; }
+ if ((UINT32)m_g > 255) { m_g = (m_g < 0) ? 0 : 255; }
+ if ((UINT32)m_b > 255) { m_b = (m_b < 0) ? 0 : 255; }
+}
+
+void rgbaint_t::scale_and_clamp(const rgbaint_t& scale)
+{
+ m_a = (m_a * scale.m_a) >> 8;
+ m_r = (m_r * scale.m_r) >> 8;
+ m_g = (m_g * scale.m_g) >> 8;
+ m_b = (m_b * scale.m_b) >> 8;
+ m_a |= (m_a & 0x00800000) ? 0xff000000 : 0;
+ m_r |= (m_r & 0x00800000) ? 0xff000000 : 0;
+ m_g |= (m_g & 0x00800000) ? 0xff000000 : 0;
+ m_b |= (m_b & 0x00800000) ? 0xff000000 : 0;
+ if ((UINT32)m_a > 255) { m_a = (m_a < 0) ? 0 : 255; }
+ if ((UINT32)m_r > 255) { m_r = (m_r < 0) ? 0 : 255; }
+ if ((UINT32)m_g > 255) { m_g = (m_g < 0) ? 0 : 255; }
+ if ((UINT32)m_b > 255) { m_b = (m_b < 0) ? 0 : 255; }
+}
+
+
+void rgbaint_t::scale_imm_add_and_clamp(INT32 scale, const rgbaint_t& other)
+{
+ m_a = (m_a * scale) >> 8;
+ m_r = (m_r * scale) >> 8;
+ m_g = (m_g * scale) >> 8;
+ m_b = (m_b * scale) >> 8;
+ m_a |= (m_a & 0x00800000) ? 0xff000000 : 0;
+ m_r |= (m_r & 0x00800000) ? 0xff000000 : 0;
+ m_g |= (m_g & 0x00800000) ? 0xff000000 : 0;
+ m_b |= (m_b & 0x00800000) ? 0xff000000 : 0;
+ m_a += other.m_a;
+ m_r += other.m_r;
+ m_g += other.m_g;
+ m_b += other.m_b;
+ if ((UINT32)m_a > 255) { m_a = (m_a < 0) ? 0 : 255; }
+ if ((UINT32)m_r > 255) { m_r = (m_r < 0) ? 0 : 255; }
+ if ((UINT32)m_g > 255) { m_g = (m_g < 0) ? 0 : 255; }
+ if ((UINT32)m_b > 255) { m_b = (m_b < 0) ? 0 : 255; }
+}
+
+void rgbaint_t::scale_add_and_clamp(const rgbaint_t& scale, const rgbaint_t& other)
+{
+ m_a = (m_a * scale.m_a) >> 8;
+ m_r = (m_r * scale.m_r) >> 8;
+ m_g = (m_g * scale.m_g) >> 8;
+ m_b = (m_b * scale.m_b) >> 8;
+ m_a |= (m_a & 0x00800000) ? 0xff000000 : 0;
+ m_r |= (m_r & 0x00800000) ? 0xff000000 : 0;
+ m_g |= (m_g & 0x00800000) ? 0xff000000 : 0;
+ m_b |= (m_b & 0x00800000) ? 0xff000000 : 0;
+ m_a += other.m_a;
+ m_r += other.m_r;
+ m_g += other.m_g;
+ m_b += other.m_b;
+ if ((UINT32)m_a > 255) { m_a = (m_a < 0) ? 0 : 255; }
+ if ((UINT32)m_r > 255) { m_r = (m_r < 0) ? 0 : 255; }
+ if ((UINT32)m_g > 255) { m_g = (m_g < 0) ? 0 : 255; }
+ if ((UINT32)m_b > 255) { m_b = (m_b < 0) ? 0 : 255; }
+}
+
+void rgbaint_t::scale2_add_and_clamp(const rgbaint_t& scale, const rgbaint_t& other, const rgbaint_t& scale2)
+{
+ m_a = (m_a * scale.m_a + other.m_a * scale2.m_a) >> 8;
+ m_r = (m_r * scale.m_r + other.m_r * scale2.m_r) >> 8;
+ m_g = (m_g * scale.m_g + other.m_g * scale2.m_g) >> 8;
+ m_b = (m_b * scale.m_b + other.m_b * scale2.m_b) >> 8;
+ m_a |= (m_a & 0x00800000) ? 0xff000000 : 0;
+ m_r |= (m_r & 0x00800000) ? 0xff000000 : 0;
+ m_g |= (m_g & 0x00800000) ? 0xff000000 : 0;
+ m_b |= (m_b & 0x00800000) ? 0xff000000 : 0;
+ if ((UINT32)m_a > 255) { m_a = (m_a < 0) ? 0 : 255; }
+ if ((UINT32)m_r > 255) { m_r = (m_r < 0) ? 0 : 255; }
+ if ((UINT32)m_g > 255) { m_g = (m_g < 0) ? 0 : 255; }
+ if ((UINT32)m_b > 255) { m_b = (m_b < 0) ? 0 : 255; }
+}
+
+#endif // !defined(__ALTIVEC__)
diff --git a/src/emu/video/rgbgen.h b/src/emu/video/rgbgen.h
index 9eda032f361..dae5a2984d3 100644
--- a/src/emu/video/rgbgen.h
+++ b/src/emu/video/rgbgen.h
@@ -1,5 +1,5 @@
// license:BSD-3-Clause
-// copyright-holders:Vas Crabb
+// copyright-holders:Vas Crabb, Ryan Holtz
/***************************************************************************
rgbgen.h
@@ -16,456 +16,492 @@
TYPE DEFINITIONS
***************************************************************************/
-/* intermediate RGB values are stored in a struct */
-struct rgbint { INT16 dummy, r, g, b; };
-
-/* intermediate RGB values are stored in a struct */
-struct rgbaint { INT16 a, r, g, b; };
-
-
-
-/***************************************************************************
- BASIC CONVERSIONS
-***************************************************************************/
-
-/*-------------------------------------------------
- rgb_comp_to_rgbint - converts a trio of RGB
- components to an rgbint type
--------------------------------------------------*/
-
-INLINE void rgb_comp_to_rgbint(rgbint *rgb, INT16 r, INT16 g, INT16 b)
-{
- rgb->r = r;
- rgb->g = g;
- rgb->b = b;
-}
-
-
-/*-------------------------------------------------
- rgba_comp_to_rgbint - converts a quad of RGB
- components to an rgbint type
--------------------------------------------------*/
-
-INLINE void rgba_comp_to_rgbaint(rgbaint *rgb, INT16 a, INT16 r, INT16 g, INT16 b)
-{
- rgb->a = a;
- rgb->r = r;
- rgb->g = g;
- rgb->b = b;
-}
-
-
-/*-------------------------------------------------
- rgb_to_rgbint - converts a packed trio of RGB
- components to an rgbint type
--------------------------------------------------*/
-
-INLINE void rgb_to_rgbint(rgbint *rgb, rgb_t color)
-{
- rgb->r = color.r();
- rgb->g = color.g();
- rgb->b = color.b();
-}
-
-
-/*-------------------------------------------------
- rgba_to_rgbaint - converts a packed quad of RGB
- components to an rgbint type
--------------------------------------------------*/
-
-INLINE void rgba_to_rgbaint(rgbaint *rgb, rgb_t color)
-{
- rgb->a = color.a();
- rgb->r = color.r();
- rgb->g = color.g();
- rgb->b = color.b();
-}
-
-
-/*-------------------------------------------------
- rgbint_to_rgb - converts an rgbint back to
- a packed trio of RGB values
--------------------------------------------------*/
-
-INLINE rgb_t rgbint_to_rgb(const rgbint *color)
-{
- return rgb_t(color->r, color->g, color->b);
-}
-
-
-/*-------------------------------------------------
- rgbaint_to_rgba - converts an rgbint back to
- a packed quad of RGB values
--------------------------------------------------*/
-
-INLINE rgb_t rgbaint_to_rgba(const rgbaint *color)
-{
- return rgb_t(color->a, color->r, color->g, color->b);
-}
-
-
-/*-------------------------------------------------
- rgbint_to_rgb_clamp - converts an rgbint back
- to a packed trio of RGB values, clamping them
- to bytes first
--------------------------------------------------*/
-
-INLINE rgb_t rgbint_to_rgb_clamp(const rgbint *color)
-{
- UINT8 r = (color->r < 0) ? 0 : (color->r > 255) ? 255 : color->r;
- UINT8 g = (color->g < 0) ? 0 : (color->g > 255) ? 255 : color->g;
- UINT8 b = (color->b < 0) ? 0 : (color->b > 255) ? 255 : color->b;
- return rgb_t(r, g, b);
-}
-
-
-/*-------------------------------------------------
- rgbaint_to_rgba_clamp - converts an rgbint back
- to a packed quad of RGB values, clamping them
- to bytes first
--------------------------------------------------*/
-
-INLINE rgb_t rgbaint_to_rgba_clamp(const rgbaint *color)
-{
- UINT8 a = (color->a < 0) ? 0 : (color->a > 255) ? 255 : color->a;
- UINT8 r = (color->r < 0) ? 0 : (color->r > 255) ? 255 : color->r;
- UINT8 g = (color->g < 0) ? 0 : (color->g > 255) ? 255 : color->g;
- UINT8 b = (color->b < 0) ? 0 : (color->b > 255) ? 255 : color->b;
- return rgb_t(a, r, g, b);
-}
-
-
-
-/***************************************************************************
- CORE MATH
-***************************************************************************/
-
-/*-------------------------------------------------
- rgbint_add - add two rgbint values
--------------------------------------------------*/
-
-INLINE void rgbint_add(rgbint *color1, const rgbint *color2)
-{
- color1->r += color2->r;
- color1->g += color2->g;
- color1->b += color2->b;
-}
-
-
-/*-------------------------------------------------
- rgbaint_add - add two rgbaint values
--------------------------------------------------*/
-
-INLINE void rgbaint_add(rgbaint *color1, const rgbaint *color2)
-{
- color1->a += color2->a;
- color1->r += color2->r;
- color1->g += color2->g;
- color1->b += color2->b;
-}
-
-
-/*-------------------------------------------------
- rgbint_sub - subtract two rgbint values
--------------------------------------------------*/
-
-INLINE void rgbint_sub(rgbint *color1, const rgbint *color2)
-{
- color1->r -= color2->r;
- color1->g -= color2->g;
- color1->b -= color2->b;
-}
-
-
-/*-------------------------------------------------
- rgbaint_sub - subtract two rgbaint values
--------------------------------------------------*/
-
-INLINE void rgbaint_sub(rgbaint *color1, const rgbaint *color2)
-{
- color1->a -= color2->a;
- color1->r -= color2->r;
- color1->g -= color2->g;
- color1->b -= color2->b;
-}
-
-
-/*-------------------------------------------------
- rgbint_subr - reverse subtract two rgbint
- values
--------------------------------------------------*/
-
-INLINE void rgbint_subr(rgbint *color1, const rgbint *color2)
-{
- color1->r = color2->r - color1->r;
- color1->g = color2->g - color1->g;
- color1->b = color2->b - color1->b;
-}
-
-
-/*-------------------------------------------------
- rgbaint_subr - reverse subtract two rgbaint
- values
--------------------------------------------------*/
-
-INLINE void rgbaint_subr(rgbaint *color1, const rgbaint *color2)
+class rgbaint_t
{
- color1->a = color2->a - color1->a;
- color1->r = color2->r - color1->r;
- color1->g = color2->g - color1->g;
- color1->b = color2->b - color1->b;
-}
-
-
-/*-------------------------------------------------
- rgbint_shl - shift each component of an
- rgbint struct by the given number of bits
--------------------------------------------------*/
-
-INLINE void rgbint_shl(rgbint *color, UINT8 shift)
-{
- color->r <<= shift;
- color->g <<= shift;
- color->b <<= shift;
-}
-
-
-/*-------------------------------------------------
- rgbaint_shl - shift each component of an
- rgbaint struct by the given number of bits
--------------------------------------------------*/
-
-INLINE void rgbaint_shl(rgbaint *color, UINT8 shift)
-{
- color->r <<= shift;
- color->g <<= shift;
- color->b <<= shift;
- color->a <<= shift;
-}
-
-
-/*-------------------------------------------------
- rgbint_shr - shift each component of an
- rgbint struct by the given number of bits
--------------------------------------------------*/
-
-INLINE void rgbint_shr(rgbint *color, UINT8 shift)
-{
- color->r >>= shift;
- color->g >>= shift;
- color->b >>= shift;
-}
-
-
-/*-------------------------------------------------
- rgbaint_shr - shift each component of an
- rgbaint struct by the given number of bits
--------------------------------------------------*/
-
-INLINE void rgbaint_shr(rgbaint *color, UINT8 shift)
-{
- color->r >>= shift;
- color->g >>= shift;
- color->b >>= shift;
- color->a >>= shift;
-}
-
-
-
-/***************************************************************************
- HIGHER LEVEL OPERATIONS
-***************************************************************************/
-
-/*-------------------------------------------------
- rgbint_blend - blend two colors by the given
- scale factor
--------------------------------------------------*/
-
-INLINE void rgbint_blend(rgbint *color1, const rgbint *color2, UINT8 color1scale)
-{
- int scale1 = (int)color1scale;
- int scale2 = 256 - scale1;
-
- color1->r = (color1->r * scale1 + color2->r * scale2) >> 8;
- color1->g = (color1->g * scale1 + color2->g * scale2) >> 8;
- color1->b = (color1->b * scale1 + color2->b * scale2) >> 8;
-}
-
-
-/*-------------------------------------------------
- rgbaint_blend - blend two colors by the given
- scale factor
--------------------------------------------------*/
-
-INLINE void rgbaint_blend(rgbaint *color1, const rgbaint *color2, UINT8 color1scale)
-{
- int scale1 = (int)color1scale;
- int scale2 = 256 - scale1;
-
- color1->a = (color1->a * scale1 + color2->a * scale2) >> 8;
- color1->r = (color1->r * scale1 + color2->r * scale2) >> 8;
- color1->g = (color1->g * scale1 + color2->g * scale2) >> 8;
- color1->b = (color1->b * scale1 + color2->b * scale2) >> 8;
-}
-
-
-/*-------------------------------------------------
- rgbint_scale_and_clamp - scale the given
- color by an 8.8 scale factor, immediate or
- per channel, and clamp to byte values
--------------------------------------------------*/
-
-INLINE void rgbint_scale_immediate_and_clamp(rgbint *color, INT16 colorscale)
-{
- color->r = (color->r * colorscale) >> 8;
- if ((UINT16)color->r > 255) { color->r = (color->r < 0) ? 0 : 255; }
- color->g = (color->g * colorscale) >> 8;
- if ((UINT16)color->g > 255) { color->g = (color->g < 0) ? 0 : 255; }
- color->b = (color->b * colorscale) >> 8;
- if ((UINT16)color->b > 255) { color->b = (color->b < 0) ? 0 : 255; }
-}
-
-INLINE void rgbint_scale_channel_and_clamp(rgbint *color, const rgbint *colorscale)
-{
- color->r = (color->r * colorscale->r) >> 8;
- if ((UINT16)color->r > 255) { color->r = (color->r < 0) ? 0 : 255; }
- color->g = (color->g * colorscale->g) >> 8;
- if ((UINT16)color->g > 255) { color->g = (color->g < 0) ? 0 : 255; }
- color->b = (color->b * colorscale->b) >> 8;
- if ((UINT16)color->b > 255) { color->b = (color->b < 0) ? 0 : 255; }
-}
-
-
-/*-------------------------------------------------
- rgbaint_scale_and_clamp - scale the given
- color by an 8.8 scale factor, immediate or
- per channel, and clamp to byte values
--------------------------------------------------*/
-
-INLINE void rgbaint_scale_immediate_and_clamp(rgbaint *color, INT16 colorscale)
-{
- color->a = (color->a * colorscale) >> 8;
- if ((UINT16)color->a > 255) { color->a = (color->a < 0) ? 0 : 255; }
- color->r = (color->r * colorscale) >> 8;
- if ((UINT16)color->r > 255) { color->r = (color->r < 0) ? 0 : 255; }
- color->g = (color->g * colorscale) >> 8;
- if ((UINT16)color->g > 255) { color->g = (color->g < 0) ? 0 : 255; }
- color->b = (color->b * colorscale) >> 8;
- if ((UINT16)color->b > 255) { color->b = (color->b < 0) ? 0 : 255; }
-}
-
-INLINE void rgbaint_scale_channel_and_clamp(rgbaint *color, const rgbaint *colorscale)
-{
- color->a = (color->a * colorscale->a) >> 8;
- if ((UINT16)color->a > 255) { color->a = (color->a < 0) ? 0 : 255; }
- color->r = (color->r * colorscale->r) >> 8;
- if ((UINT16)color->r > 255) { color->r = (color->r < 0) ? 0 : 255; }
- color->g = (color->g * colorscale->g) >> 8;
- if ((UINT16)color->g > 255) { color->g = (color->g < 0) ? 0 : 255; }
- color->b = (color->b * colorscale->b) >> 8;
- if ((UINT16)color->b > 255) { color->b = (color->b < 0) ? 0 : 255; }
-}
-
-
-/*-------------------------------------------------
- rgb_bilinear_filter - bilinear filter between
- four pixel values; this code is derived from
- code provided by Michael Herf
--------------------------------------------------*/
-
-INLINE UINT32 rgb_bilinear_filter(UINT32 rgb00, UINT32 rgb01, UINT32 rgb10, UINT32 rgb11, UINT8 u, UINT8 v)
-{
- UINT32 ag0, ag1, rb0, rb1;
-
- rb0 = (rgb00 & 0x00ff00ff) + ((((rgb01 & 0x00ff00ff) - (rgb00 & 0x00ff00ff)) * u) >> 8);
- rb1 = (rgb10 & 0x00ff00ff) + ((((rgb11 & 0x00ff00ff) - (rgb10 & 0x00ff00ff)) * u) >> 8);
- ag0 = (rgb00 & 0x0000ff00) + ((((rgb01 & 0x0000ff00) - (rgb00 & 0x0000ff00)) * u) >> 8);
- ag1 = (rgb10 & 0x0000ff00) + ((((rgb11 & 0x0000ff00) - (rgb10 & 0x0000ff00)) * u) >> 8);
-
- rb0 = (rb0 & 0x00ff00ff) + ((((rb1 & 0x00ff00ff) - (rb0 & 0x00ff00ff)) * v) >> 8);
- ag0 = (ag0 & 0x0000ff00) + ((((ag1 & 0x0000ff00) - (ag0 & 0x0000ff00)) * v) >> 8);
-
- return (ag0 & 0x0000ff00) | (rb0 & 0x00ff00ff);
-}
-
-
-/*-------------------------------------------------
- rgba_bilinear_filter - bilinear filter between
- four pixel values; this code is derived from
- code provided by Michael Herf
--------------------------------------------------*/
-
-INLINE UINT32 rgba_bilinear_filter(UINT32 rgb00, UINT32 rgb01, UINT32 rgb10, UINT32 rgb11, UINT8 u, UINT8 v)
-{
- UINT32 ag0, ag1, rb0, rb1;
-
- rb0 = (rgb00 & 0x00ff00ff) + ((((rgb01 & 0x00ff00ff) - (rgb00 & 0x00ff00ff)) * u) >> 8);
- rb1 = (rgb10 & 0x00ff00ff) + ((((rgb11 & 0x00ff00ff) - (rgb10 & 0x00ff00ff)) * u) >> 8);
- rgb00 = rgb00 >> 8;
- rgb01 = rgb01 >> 8;
- rgb10 = rgb10 >> 8;
- rgb11 = rgb11 >> 8;
- ag0 = (rgb00 & 0x00ff00ff) + ((((rgb01 & 0x00ff00ff) - (rgb00 & 0x00ff00ff)) * u) >> 8);
- ag1 = (rgb10 & 0x00ff00ff) + ((((rgb11 & 0x00ff00ff) - (rgb10 & 0x00ff00ff)) * u) >> 8);
-
- rb0 = (rb0 & 0x00ff00ff) + ((((rb1 & 0x00ff00ff) - (rb0 & 0x00ff00ff)) * v) >> 8);
- ag0 = (ag0 & 0x00ff00ff) + ((((ag1 & 0x00ff00ff) - (ag0 & 0x00ff00ff)) * v) >> 8);
-
- return ((ag0 << 8) & 0xff00ff00) | (rb0 & 0x00ff00ff);
-}
-
-
-/*-------------------------------------------------
- rgbint_bilinear_filter - bilinear filter between
- four pixel values; this code is derived from
- code provided by Michael Herf
--------------------------------------------------*/
-
-INLINE void rgbint_bilinear_filter(rgbint *color, UINT32 rgb00, UINT32 rgb01, UINT32 rgb10, UINT32 rgb11, UINT8 u, UINT8 v)
-{
- UINT32 ag0, ag1, rb0, rb1;
-
- rb0 = (rgb00 & 0x00ff00ff) + ((((rgb01 & 0x00ff00ff) - (rgb00 & 0x00ff00ff)) * u) >> 8);
- rb1 = (rgb10 & 0x00ff00ff) + ((((rgb11 & 0x00ff00ff) - (rgb10 & 0x00ff00ff)) * u) >> 8);
- ag0 = (rgb00 & 0x0000ff00) + ((((rgb01 & 0x0000ff00) - (rgb00 & 0x0000ff00)) * u) >> 8);
- ag1 = (rgb10 & 0x0000ff00) + ((((rgb11 & 0x0000ff00) - (rgb10 & 0x0000ff00)) * u) >> 8);
-
- rb0 = (rb0 & 0x00ff00ff) + ((((rb1 & 0x00ff00ff) - (rb0 & 0x00ff00ff)) * v) >> 8);
- ag0 = (ag0 & 0x0000ff00) + ((((ag1 & 0x0000ff00) - (ag0 & 0x0000ff00)) * v) >> 8);
-
- color->r = rb0 >> 16;
- color->g = ag0 >> 8;
- color->b = rb0;
-}
-
-
-/*-------------------------------------------------
- rgbaint_bilinear_filter - bilinear filter between
- four pixel values; this code is derived from
- code provided by Michael Herf
--------------------------------------------------*/
-
-INLINE void rgbaint_bilinear_filter(rgbaint *color, UINT32 rgb00, UINT32 rgb01, UINT32 rgb10, UINT32 rgb11, UINT8 u, UINT8 v)
-{
- UINT32 ag0, ag1, rb0, rb1;
-
- rb0 = (rgb00 & 0x00ff00ff) + ((((rgb01 & 0x00ff00ff) - (rgb00 & 0x00ff00ff)) * u) >> 8);
- rb1 = (rgb10 & 0x00ff00ff) + ((((rgb11 & 0x00ff00ff) - (rgb10 & 0x00ff00ff)) * u) >> 8);
- rgb00 = rgb00 >> 8;
- rgb01 = rgb01 >> 8;
- rgb10 = rgb10 >> 8;
- rgb11 = rgb11 >> 8;
- ag0 = (rgb00 & 0x00ff00ff) + ((((rgb01 & 0x00ff00ff) - (rgb00 & 0x00ff00ff)) * u) >> 8);
- ag1 = (rgb10 & 0x00ff00ff) + ((((rgb11 & 0x00ff00ff) - (rgb10 & 0x00ff00ff)) * u) >> 8);
-
- rb0 = (rb0 & 0x00ff00ff) + ((((rb1 & 0x00ff00ff) - (rb0 & 0x00ff00ff)) * v) >> 8);
- ag0 = (ag0 & 0x00ff00ff) + ((((ag1 & 0x00ff00ff) - (ag0 & 0x00ff00ff)) * v) >> 8);
-
- color->a = ag0 >> 16;
- color->r = rb0 >> 16;
- color->g = ag0;
- color->b = rb0;
-}
-
-
-#endif /* __RGBUTIL__ */
+public:
+ inline rgbaint_t() { }
+ inline rgbaint_t(UINT32 rgba) { set(rgba); }
+ inline rgbaint_t(INT32 a, INT32 r, INT32 g, INT32 b) { set(a, r, g, b); }
+ inline rgbaint_t(rgb_t& rgba) { set(rgba); }
+
+ inline void set(rgbaint_t& other) { set(other.m_a, other.m_r, other.m_g, other.m_b); }
+ inline void set(UINT32 rgba) { set((rgba >> 24) & 0xff, (rgba >> 16) & 0xff, (rgba >> 8) & 0xff, rgba & 0xff); }
+ inline void set(INT32 a, INT32 r, INT32 g, INT32 b)
+ {
+ m_a = a;
+ m_r = r;
+ m_g = g;
+ m_b = b;
+ }
+ inline void set(rgb_t& rgba) { set(rgba.a(), rgba.r(), rgba.g(), rgba.b()); }
+
+ inline rgb_t to_rgba()
+ {
+ return rgb_t(m_a, m_r, m_g, m_b);
+ }
+
+ inline rgb_t to_rgba_clamp()
+ {
+ UINT8 a = (m_a < 0) ? 0 : (m_a > 255) ? 255 : m_a;
+ UINT8 r = (m_r < 0) ? 0 : (m_r > 255) ? 255 : m_r;
+ UINT8 g = (m_g < 0) ? 0 : (m_g > 255) ? 255 : m_g;
+ UINT8 b = (m_b < 0) ? 0 : (m_b > 255) ? 255 : m_b;
+ return rgb_t(a, r, g, b);
+ }
+
+ inline void add(const rgbaint_t& color)
+ {
+ add_imm_rgba(color.m_a, color.m_r, color.m_g, color.m_b);
+ }
+
+ inline void add_imm(const INT32 imm)
+ {
+ add_imm_rgba(imm, imm, imm, imm);
+ }
+
+ inline void add_imm_rgba(const INT32 a, const INT32 r, const INT32 g, const INT32 b)
+ {
+ m_a += a;
+ m_r += r;
+ m_g += g;
+ m_b += b;
+ }
+
+ inline void sub(const rgbaint_t& color)
+ {
+ sub_imm_rgba(color.m_a, color.m_r, color.m_g, color.m_b);
+ }
+
+ inline void sub_imm(const INT32 imm)
+ {
+ sub_imm_rgba(imm, imm, imm, imm);
+ }
+
+ inline void sub_imm_rgba(const INT32 a, const INT32 r, const INT32 g, const INT32 b)
+ {
+ m_a -= a;
+ m_r -= r;
+ m_g -= g;
+ m_b -= b;
+ }
+
+ inline void subr(rgbaint_t& color)
+ {
+ subr_imm_rgba(color.m_a, color.m_r, color.m_g, color.m_b);
+ }
+
+ inline void subr_imm(const INT32 imm)
+ {
+ subr_imm_rgba(imm, imm, imm, imm);
+ }
+
+ inline void subr_imm_rgba(const INT32 a, const INT32 r, const INT32 g, const INT32 b)
+ {
+ m_a = a - m_a;
+ m_r = r - m_r;
+ m_g = g - m_g;
+ m_b = b - m_b;
+ }
+
+ inline void set_a(const INT32 value)
+ {
+ m_a = value;
+ }
+
+ inline void set_r(const INT32 value)
+ {
+ m_r = value;
+ }
+
+ inline void set_g(const INT32 value)
+ {
+ m_g = value;
+ }
+
+ inline void set_b(const INT32 value)
+ {
+ m_b = value;
+ }
+
+ inline UINT8 get_a() const
+ {
+ return m_a;
+ }
+
+ inline UINT8 get_r() const
+ {
+ return m_r;
+ }
+
+ inline UINT8 get_g() const
+ {
+ return m_g;
+ }
+
+ inline UINT8 get_b() const
+ {
+ return m_b;
+ }
+
+ inline INT32 get_a32() const
+ {
+ return m_a;
+ }
+
+ inline INT32 get_r32() const
+ {
+ return m_r;
+ }
+
+ inline INT32 get_g32() const
+ {
+ return m_g;
+ }
+
+ inline INT32 get_b32() const
+ {
+ return m_b;
+ }
+
+ inline void mul(rgbaint_t& color)
+ {
+ mul_imm_rgba(color.m_a, color.m_r, color.m_g, color.m_b);
+ }
+
+ inline void mul_imm(const INT32 imm)
+ {
+ mul_imm_rgba(imm, imm, imm, imm);
+ }
+
+ inline void mul_imm_rgba(const INT32 a, const INT32 r, const INT32 g, const INT32 b)
+ {
+ m_a *= a;
+ m_r *= r;
+ m_g *= g;
+ m_b *= b;
+ }
+
+ inline void shl(const rgbaint_t& shift)
+ {
+ m_a <<= shift.m_a;
+ m_r <<= shift.m_r;
+ m_g <<= shift.m_g;
+ m_b <<= shift.m_b;
+ }
+
+ inline void shl_imm(const UINT8 shift)
+ {
+ if (shift == 0)
+ return;
+
+ m_a <<= shift;
+ m_r <<= shift;
+ m_g <<= shift;
+ m_b <<= shift;
+ }
+
+ inline void shr(const rgbaint_t& shift)
+ {
+ m_a >>= shift.m_a;
+ m_r >>= shift.m_r;
+ m_g >>= shift.m_g;
+ m_b >>= shift.m_b;
+ }
+
+ inline void shr_imm(const UINT8 shift)
+ {
+ if (shift == 0)
+ return;
+
+ m_a >>= shift;
+ m_r >>= shift;
+ m_g >>= shift;
+ m_b >>= shift;
+ }
+
+ inline void sra(const rgbaint_t& shift)
+ {
+ m_a >>= shift.m_a;
+ if (m_a & (1 << (31 - shift.m_a)))
+ m_a |= ~0 << (32 - shift.m_a);
+
+ m_r >>= shift.m_r;
+ if (m_r & (1 << (31 - shift.m_r)))
+ m_r |= ~0 << (32 - shift.m_r);
+
+ m_g >>= shift.m_g;
+ if (m_g & (1 << (31 - shift.m_g)))
+ m_g |= ~0 << (32 - shift.m_g);
+
+ m_b >>= shift.m_b;
+ if (m_b & (1 << (31 - shift.m_b)))
+ m_b |= ~0 << (32 - shift.m_b);
+ }
+
+ inline void sra_imm(const UINT8 shift)
+ {
+ const UINT32 high_bit = 1 << (31 - shift);
+ const UINT32 high_mask = ~0 << (32 - shift);
+
+ m_a >>= shift;
+ if (m_a & high_bit)
+ m_a |= high_mask;
+
+ m_r >>= shift;
+ if (m_r & high_bit)
+ m_r |= high_mask;
+
+ m_g >>= shift;
+ if (m_g & high_bit)
+ m_g |= high_mask;
+
+ m_b >>= shift;
+ if (m_b & high_bit)
+ m_b |= high_mask;
+ }
+
+ inline void or_reg(const rgbaint_t& color)
+ {
+ or_imm_rgba(color.m_a, color.m_r, color.m_g, color.m_b);
+ }
+
+ inline void or_imm(const INT32 imm)
+ {
+ or_imm_rgba(imm, imm, imm, imm);
+ }
+
+ inline void or_imm_rgba(const INT32 a, const INT32 r, const INT32 g, const INT32 b)
+ {
+ m_a |= a;
+ m_r |= r;
+ m_g |= g;
+ m_b |= b;
+ }
+
+ inline void and_reg(const rgbaint_t& color)
+ {
+ and_imm_rgba(color.m_a, color.m_r, color.m_g, color.m_b);
+ }
+
+ inline void andnot_reg(const rgbaint_t& color)
+ {
+ and_imm_rgba(~color.m_a, ~color.m_r, ~color.m_g, ~color.m_b);
+ }
+
+ inline void and_imm(const INT32 imm)
+ {
+ and_imm_rgba(imm, imm, imm, imm);
+ }
+
+ inline void and_imm_rgba(const INT32 a, const INT32 r, const INT32 g, const INT32 b)
+ {
+ m_a &= a;
+ m_r &= r;
+ m_g &= g;
+ m_b &= b;
+ }
+
+ inline void xor_reg(const rgbaint_t& color)
+ {
+ xor_imm_rgba(color.m_a, color.m_r, color.m_g, color.m_b);
+ }
+
+ inline void xor_imm(const INT32 imm)
+ {
+ xor_imm_rgba(imm, imm, imm, imm);
+ }
+
+ inline void xor_imm_rgba(const INT32 a, const INT32 r, const INT32 g, const INT32 b)
+ {
+ m_a ^= a;
+ m_r ^= r;
+ m_g ^= g;
+ m_b ^= b;
+ }
+
+ inline void clamp_and_clear(const UINT32 sign)
+ {
+ if (m_a & sign)
+ m_a = 0;
+
+ if (m_r & sign)
+ m_r = 0;
+
+ if (m_g & sign)
+ m_g = 0;
+
+ if (m_b & sign)
+ m_b = 0;
+
+ m_a = (m_a < 0) ? 0 : (m_a > 255) ? 255 : m_a;
+ m_r = (m_r < 0) ? 0 : (m_r > 255) ? 255 : m_r;
+ m_g = (m_g < 0) ? 0 : (m_g > 255) ? 255 : m_g;
+ m_b = (m_b < 0) ? 0 : (m_b > 255) ? 255 : m_b;
+ }
+
+ inline void clamp_to_uint8()
+ {
+ m_a = (m_a < 0) ? 0 : (m_a > 255) ? 255 : m_a;
+ m_r = (m_r < 0) ? 0 : (m_r > 255) ? 255 : m_r;
+ m_g = (m_g < 0) ? 0 : (m_g > 255) ? 255 : m_g;
+ m_b = (m_b < 0) ? 0 : (m_b > 255) ? 255 : m_b;
+ }
+
+ inline void sign_extend(const UINT32 compare, const UINT32 sign)
+ {
+ if ((m_a & compare) == compare)
+ m_a |= sign;
+
+ if ((m_r & compare) == compare)
+ m_r |= sign;
+
+ if ((m_g & compare) == compare)
+ m_g |= sign;
+
+ if ((m_b & compare) == compare)
+ m_b |= sign;
+ }
+
+ inline void min(const INT32 value)
+ {
+ m_a = (m_a > value) ? value : m_a;
+ m_r = (m_r > value) ? value : m_r;
+ m_g = (m_g > value) ? value : m_g;
+ m_b = (m_b > value) ? value : m_b;
+ }
+
+ void blend(const rgbaint_t& other, UINT8 factor);
+
+ void scale_and_clamp(const rgbaint_t& scale);
+ void scale_imm_and_clamp(const INT32 scale);
+ void scale2_add_and_clamp(const rgbaint_t& scale, const rgbaint_t& other, const rgbaint_t& scale2);
+ void scale_add_and_clamp(const rgbaint_t& scale, const rgbaint_t& other);
+ void scale_imm_add_and_clamp(const INT32 scale, const rgbaint_t& other);
+
+ inline void cmpeq(const rgbaint_t& value)
+ {
+ m_a = (m_a == value.m_a) ? 0xffffffff : 0;
+ m_r = (m_r == value.m_r) ? 0xffffffff : 0;
+ m_g = (m_g == value.m_g) ? 0xffffffff : 0;
+ m_b = (m_b == value.m_b) ? 0xffffffff : 0;
+ }
+
+ inline void cmpeq_imm(const INT32 value)
+ {
+ m_a = (m_a == value) ? 0xffffffff : 0;
+ m_r = (m_r == value) ? 0xffffffff : 0;
+ m_g = (m_g == value) ? 0xffffffff : 0;
+ m_b = (m_b == value) ? 0xffffffff : 0;
+ }
+
+ inline void cmpgt(const rgbaint_t& value)
+ {
+ m_a = (m_a > value.m_a) ? 0xffffffff : 0;
+ m_r = (m_r > value.m_r) ? 0xffffffff : 0;
+ m_g = (m_g > value.m_g) ? 0xffffffff : 0;
+ m_b = (m_b > value.m_b) ? 0xffffffff : 0;
+ }
+
+ inline void cmpgt_imm(const INT32 value)
+ {
+ m_a = (m_a > value) ? 0xffffffff : 0;
+ m_r = (m_r > value) ? 0xffffffff : 0;
+ m_g = (m_g > value) ? 0xffffffff : 0;
+ m_b = (m_b > value) ? 0xffffffff : 0;
+ }
+
+ inline void cmplt(const rgbaint_t& value)
+ {
+ m_a = (m_a < value.m_a) ? 0xffffffff : 0;
+ m_r = (m_r < value.m_r) ? 0xffffffff : 0;
+ m_g = (m_g < value.m_g) ? 0xffffffff : 0;
+ m_b = (m_b < value.m_b) ? 0xffffffff : 0;
+ }
+
+ inline void cmplt_imm(const INT32 value)
+ {
+ m_a = (m_a < value) ? 0xffffffff : 0;
+ m_r = (m_r < value) ? 0xffffffff : 0;
+ m_g = (m_g < value) ? 0xffffffff : 0;
+ m_b = (m_b < value) ? 0xffffffff : 0;
+ }
+
+ inline void merge_alpha(rgbaint_t& alpha)
+ {
+ m_a = alpha.m_a;
+ }
+
+ inline rgbaint_t operator=(const rgbaint_t& other)
+ {
+ m_a = other.m_a;
+ m_r = other.m_r;
+ m_g = other.m_g;
+ m_b = other.m_b;
+ return *this;
+ }
+
+ inline rgbaint_t& operator+=(const rgbaint_t& other)
+ {
+ m_a += other.m_a;
+ m_r += other.m_r;
+ m_g += other.m_g;
+ m_b += other.m_b;
+ return *this;
+ }
+
+ inline rgbaint_t& operator+=(const INT32 other)
+ {
+ m_a += other;
+ m_r += other;
+ m_g += other;
+ m_b += other;
+ return *this;
+ }
+
+ static UINT32 bilinear_filter(UINT32 rgb00, UINT32 rgb01, UINT32 rgb10, UINT32 rgb11, UINT8 u, UINT8 v)
+ {
+ UINT32 rb0 = (rgb00 & 0x00ff00ff) + ((((rgb01 & 0x00ff00ff) - (rgb00 & 0x00ff00ff)) * u) >> 8);
+ UINT32 rb1 = (rgb10 & 0x00ff00ff) + ((((rgb11 & 0x00ff00ff) - (rgb10 & 0x00ff00ff)) * u) >> 8);
+
+ rgb00 >>= 8;
+ rgb01 >>= 8;
+ rgb10 >>= 8;
+ rgb11 >>= 8;
+
+ UINT32 ag0 = (rgb00 & 0x00ff00ff) + ((((rgb01 & 0x00ff00ff) - (rgb00 & 0x00ff00ff)) * u) >> 8);
+ UINT32 ag1 = (rgb10 & 0x00ff00ff) + ((((rgb11 & 0x00ff00ff) - (rgb10 & 0x00ff00ff)) * u) >> 8);
+
+ rb0 = (rb0 & 0x00ff00ff) + ((((rb1 & 0x00ff00ff) - (rb0 & 0x00ff00ff)) * v) >> 8);
+ ag0 = (ag0 & 0x00ff00ff) + ((((ag1 & 0x00ff00ff) - (ag0 & 0x00ff00ff)) * v) >> 8);
+
+ return ((ag0 << 8) & 0xff00ff00) | (rb0 & 0x00ff00ff);
+ }
+
+ inline void bilinear_filter_rgbaint(UINT32 rgb00, UINT32 rgb01, UINT32 rgb10, UINT32 rgb11, UINT8 u, UINT8 v)
+ {
+ UINT32 rb0 = (rgb00 & 0x00ff00ff) + ((((rgb01 & 0x00ff00ff) - (rgb00 & 0x00ff00ff)) * u) >> 8);
+ UINT32 rb1 = (rgb10 & 0x00ff00ff) + ((((rgb11 & 0x00ff00ff) - (rgb10 & 0x00ff00ff)) * u) >> 8);
+
+ rgb00 >>= 8;
+ rgb01 >>= 8;
+ rgb10 >>= 8;
+ rgb11 >>= 8;
+
+ UINT32 ag0 = (rgb00 & 0x00ff00ff) + ((((rgb01 & 0x00ff00ff) - (rgb00 & 0x00ff00ff)) * u) >> 8);
+ UINT32 ag1 = (rgb10 & 0x00ff00ff) + ((((rgb11 & 0x00ff00ff) - (rgb10 & 0x00ff00ff)) * u) >> 8);
+
+ rb0 = (rb0 & 0x00ff00ff) + ((((rb1 & 0x00ff00ff) - (rb0 & 0x00ff00ff)) * v) >> 8);
+ ag0 = (ag0 & 0x00ff00ff) + ((((ag1 & 0x00ff00ff) - (ag0 & 0x00ff00ff)) * v) >> 8);
+
+ UINT32 result = ((ag0 << 8) & 0xff00ff00) | (rb0 & 0x00ff00ff);
+ this->set(result);
+ }
+
+protected:
+ INT32 m_a;
+ INT32 m_r;
+ INT32 m_g;
+ INT32 m_b;
+};
+
+#endif /* __RGBGEN__ */
diff --git a/src/emu/video/rgbutil.c b/src/emu/video/rgbsse.c
index b0815c754c8..ed20479fd9e 100644
--- a/src/emu/video/rgbutil.c
+++ b/src/emu/video/rgbsse.c
@@ -1,27 +1,32 @@
// license:BSD-3-Clause
-// copyright-holders:Aaron Giles
+// copyright-holders:Vas Crabb, Ryan Holtz
/***************************************************************************
- rgbutil.c
+ rgbsse.c
- Utility definitions for RGB manipulation. Allows RGB handling to be
- performed in an abstracted fashion and optimized with SIMD.
+ SSE optimized RGB utilities.
+
+ WARNING: This code assumes SSE2 or greater capability.
***************************************************************************/
-#include "emu.h"
-#include "rgbutil.h"
+#if (!defined(MAME_DEBUG) || defined(__OPTIMIZE__)) && (defined(__SSE2__) || defined(_MSC_VER)) && defined(PTR64)
+#include "emu.h"
+#include <emmintrin.h>
+#include "rgbsse.h"
/***************************************************************************
- SSE TABLES
+ TABLES
***************************************************************************/
-#if (!defined(MAME_DEBUG) || defined(__OPTIMIZE__)) && (defined(__SSE2__) || defined(_MSC_VER)) && defined(PTR64)
-const struct _rgbsse_statics rgbsse_statics =
+const struct rgbaint_t::_statics rgbaint_t::statics =
{
{ 0 },
- { 255, 255, 255, 255, 255, 255, 255, 255 },
+ { 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0x0000, 0x0000 },
+ { 0xffff, 0xffff, 0xffff, 0xffff, 0x0000, 0x0000, 0xffff, 0xffff },
+ { 0xffff, 0xffff, 0x0000, 0x0000, 0xffff, 0xffff, 0xffff, 0xffff },
+ { 0x0000, 0x0000, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff },
{
{ 0, 256, 0, 256, 0, 256, 0, 256 }, { 1, 255, 1, 255, 1, 255, 1, 255 },
{ 2, 254, 2, 254, 2, 254, 2, 254 }, { 3, 253, 3, 253, 3, 253, 3, 253 },
@@ -153,148 +158,37 @@ const struct _rgbsse_statics rgbsse_statics =
{ 254, 2, 254, 2, 254, 2, 254, 2 }, { 255, 1, 255, 1, 255, 1, 255, 1 }
}
};
-#endif // defined(__SSE2__)
-
/***************************************************************************
- VMX/ALTIVEC TABLES
+ HIGHER LEVEL OPERATIONS
***************************************************************************/
-#if defined(__ALTIVEC__)
-#include <altivec.h>
-const struct _rgbvmx_statics rgbvmx_statics =
+void rgbaint_t::blend(const rgbaint_t& other, UINT8 factor)
{
- { 255, 255, 255, 255, 255, 255, 255, 255 },
- {
- { 0, 256, 0, 256, 0, 256, 0, 256 }, { 1, 255, 1, 255, 1, 255, 1, 255 },
- { 2, 254, 2, 254, 2, 254, 2, 254 }, { 3, 253, 3, 253, 3, 253, 3, 253 },
- { 4, 252, 4, 252, 4, 252, 4, 252 }, { 5, 251, 5, 251, 5, 251, 5, 251 },
- { 6, 250, 6, 250, 6, 250, 6, 250 }, { 7, 249, 7, 249, 7, 249, 7, 249 },
- { 8, 248, 8, 248, 8, 248, 8, 248 }, { 9, 247, 9, 247, 9, 247, 9, 247 },
- { 10, 246, 10, 246, 10, 246, 10, 246 }, { 11, 245, 11, 245, 11, 245, 11, 245 },
- { 12, 244, 12, 244, 12, 244, 12, 244 }, { 13, 243, 13, 243, 13, 243, 13, 243 },
- { 14, 242, 14, 242, 14, 242, 14, 242 }, { 15, 241, 15, 241, 15, 241, 15, 241 },
- { 16, 240, 16, 240, 16, 240, 16, 240 }, { 17, 239, 17, 239, 17, 239, 17, 239 },
- { 18, 238, 18, 238, 18, 238, 18, 238 }, { 19, 237, 19, 237, 19, 237, 19, 237 },
- { 20, 236, 20, 236, 20, 236, 20, 236 }, { 21, 235, 21, 235, 21, 235, 21, 235 },
- { 22, 234, 22, 234, 22, 234, 22, 234 }, { 23, 233, 23, 233, 23, 233, 23, 233 },
- { 24, 232, 24, 232, 24, 232, 24, 232 }, { 25, 231, 25, 231, 25, 231, 25, 231 },
- { 26, 230, 26, 230, 26, 230, 26, 230 }, { 27, 229, 27, 229, 27, 229, 27, 229 },
- { 28, 228, 28, 228, 28, 228, 28, 228 }, { 29, 227, 29, 227, 29, 227, 29, 227 },
- { 30, 226, 30, 226, 30, 226, 30, 226 }, { 31, 225, 31, 225, 31, 225, 31, 225 },
- { 32, 224, 32, 224, 32, 224, 32, 224 }, { 33, 223, 33, 223, 33, 223, 33, 223 },
- { 34, 222, 34, 222, 34, 222, 34, 222 }, { 35, 221, 35, 221, 35, 221, 35, 221 },
- { 36, 220, 36, 220, 36, 220, 36, 220 }, { 37, 219, 37, 219, 37, 219, 37, 219 },
- { 38, 218, 38, 218, 38, 218, 38, 218 }, { 39, 217, 39, 217, 39, 217, 39, 217 },
- { 40, 216, 40, 216, 40, 216, 40, 216 }, { 41, 215, 41, 215, 41, 215, 41, 215 },
- { 42, 214, 42, 214, 42, 214, 42, 214 }, { 43, 213, 43, 213, 43, 213, 43, 213 },
- { 44, 212, 44, 212, 44, 212, 44, 212 }, { 45, 211, 45, 211, 45, 211, 45, 211 },
- { 46, 210, 46, 210, 46, 210, 46, 210 }, { 47, 209, 47, 209, 47, 209, 47, 209 },
- { 48, 208, 48, 208, 48, 208, 48, 208 }, { 49, 207, 49, 207, 49, 207, 49, 207 },
- { 50, 206, 50, 206, 50, 206, 50, 206 }, { 51, 205, 51, 205, 51, 205, 51, 205 },
- { 52, 204, 52, 204, 52, 204, 52, 204 }, { 53, 203, 53, 203, 53, 203, 53, 203 },
- { 54, 202, 54, 202, 54, 202, 54, 202 }, { 55, 201, 55, 201, 55, 201, 55, 201 },
- { 56, 200, 56, 200, 56, 200, 56, 200 }, { 57, 199, 57, 199, 57, 199, 57, 199 },
- { 58, 198, 58, 198, 58, 198, 58, 198 }, { 59, 197, 59, 197, 59, 197, 59, 197 },
- { 60, 196, 60, 196, 60, 196, 60, 196 }, { 61, 195, 61, 195, 61, 195, 61, 195 },
- { 62, 194, 62, 194, 62, 194, 62, 194 }, { 63, 193, 63, 193, 63, 193, 63, 193 },
- { 64, 192, 64, 192, 64, 192, 64, 192 }, { 65, 191, 65, 191, 65, 191, 65, 191 },
- { 66, 190, 66, 190, 66, 190, 66, 190 }, { 67, 189, 67, 189, 67, 189, 67, 189 },
- { 68, 188, 68, 188, 68, 188, 68, 188 }, { 69, 187, 69, 187, 69, 187, 69, 187 },
- { 70, 186, 70, 186, 70, 186, 70, 186 }, { 71, 185, 71, 185, 71, 185, 71, 185 },
- { 72, 184, 72, 184, 72, 184, 72, 184 }, { 73, 183, 73, 183, 73, 183, 73, 183 },
- { 74, 182, 74, 182, 74, 182, 74, 182 }, { 75, 181, 75, 181, 75, 181, 75, 181 },
- { 76, 180, 76, 180, 76, 180, 76, 180 }, { 77, 179, 77, 179, 77, 179, 77, 179 },
- { 78, 178, 78, 178, 78, 178, 78, 178 }, { 79, 177, 79, 177, 79, 177, 79, 177 },
- { 80, 176, 80, 176, 80, 176, 80, 176 }, { 81, 175, 81, 175, 81, 175, 81, 175 },
- { 82, 174, 82, 174, 82, 174, 82, 174 }, { 83, 173, 83, 173, 83, 173, 83, 173 },
- { 84, 172, 84, 172, 84, 172, 84, 172 }, { 85, 171, 85, 171, 85, 171, 85, 171 },
- { 86, 170, 86, 170, 86, 170, 86, 170 }, { 87, 169, 87, 169, 87, 169, 87, 169 },
- { 88, 168, 88, 168, 88, 168, 88, 168 }, { 89, 167, 89, 167, 89, 167, 89, 167 },
- { 90, 166, 90, 166, 90, 166, 90, 166 }, { 91, 165, 91, 165, 91, 165, 91, 165 },
- { 92, 164, 92, 164, 92, 164, 92, 164 }, { 93, 163, 93, 163, 93, 163, 93, 163 },
- { 94, 162, 94, 162, 94, 162, 94, 162 }, { 95, 161, 95, 161, 95, 161, 95, 161 },
- { 96, 160, 96, 160, 96, 160, 96, 160 }, { 97, 159, 97, 159, 97, 159, 97, 159 },
- { 98, 158, 98, 158, 98, 158, 98, 158 }, { 99, 157, 99, 157, 99, 157, 99, 157 },
- { 100, 156, 100, 156, 100, 156, 100, 156 }, { 101, 155, 101, 155, 101, 155, 101, 155 },
- { 102, 154, 102, 154, 102, 154, 102, 154 }, { 103, 153, 103, 153, 103, 153, 103, 153 },
- { 104, 152, 104, 152, 104, 152, 104, 152 }, { 105, 151, 105, 151, 105, 151, 105, 151 },
- { 106, 150, 106, 150, 106, 150, 106, 150 }, { 107, 149, 107, 149, 107, 149, 107, 149 },
- { 108, 148, 108, 148, 108, 148, 108, 148 }, { 109, 147, 109, 147, 109, 147, 109, 147 },
- { 110, 146, 110, 146, 110, 146, 110, 146 }, { 111, 145, 111, 145, 111, 145, 111, 145 },
- { 112, 144, 112, 144, 112, 144, 112, 144 }, { 113, 143, 113, 143, 113, 143, 113, 143 },
- { 114, 142, 114, 142, 114, 142, 114, 142 }, { 115, 141, 115, 141, 115, 141, 115, 141 },
- { 116, 140, 116, 140, 116, 140, 116, 140 }, { 117, 139, 117, 139, 117, 139, 117, 139 },
- { 118, 138, 118, 138, 118, 138, 118, 138 }, { 119, 137, 119, 137, 119, 137, 119, 137 },
- { 120, 136, 120, 136, 120, 136, 120, 136 }, { 121, 135, 121, 135, 121, 135, 121, 135 },
- { 122, 134, 122, 134, 122, 134, 122, 134 }, { 123, 133, 123, 133, 123, 133, 123, 133 },
- { 124, 132, 124, 132, 124, 132, 124, 132 }, { 125, 131, 125, 131, 125, 131, 125, 131 },
- { 126, 130, 126, 130, 126, 130, 126, 130 }, { 127, 129, 127, 129, 127, 129, 127, 129 },
- { 128, 128, 128, 128, 128, 128, 128, 128 }, { 129, 127, 129, 127, 129, 127, 129, 127 },
- { 130, 126, 130, 126, 130, 126, 130, 126 }, { 131, 125, 131, 125, 131, 125, 131, 125 },
- { 132, 124, 132, 124, 132, 124, 132, 124 }, { 133, 123, 133, 123, 133, 123, 133, 123 },
- { 134, 122, 134, 122, 134, 122, 134, 122 }, { 135, 121, 135, 121, 135, 121, 135, 121 },
- { 136, 120, 136, 120, 136, 120, 136, 120 }, { 137, 119, 137, 119, 137, 119, 137, 119 },
- { 138, 118, 138, 118, 138, 118, 138, 118 }, { 139, 117, 139, 117, 139, 117, 139, 117 },
- { 140, 116, 140, 116, 140, 116, 140, 116 }, { 141, 115, 141, 115, 141, 115, 141, 115 },
- { 142, 114, 142, 114, 142, 114, 142, 114 }, { 143, 113, 143, 113, 143, 113, 143, 113 },
- { 144, 112, 144, 112, 144, 112, 144, 112 }, { 145, 111, 145, 111, 145, 111, 145, 111 },
- { 146, 110, 146, 110, 146, 110, 146, 110 }, { 147, 109, 147, 109, 147, 109, 147, 109 },
- { 148, 108, 148, 108, 148, 108, 148, 108 }, { 149, 107, 149, 107, 149, 107, 149, 107 },
- { 150, 106, 150, 106, 150, 106, 150, 106 }, { 151, 105, 151, 105, 151, 105, 151, 105 },
- { 152, 104, 152, 104, 152, 104, 152, 104 }, { 153, 103, 153, 103, 153, 103, 153, 103 },
- { 154, 102, 154, 102, 154, 102, 154, 102 }, { 155, 101, 155, 101, 155, 101, 155, 101 },
- { 156, 100, 156, 100, 156, 100, 156, 100 }, { 157, 99, 157, 99, 157, 99, 157, 99 },
- { 158, 98, 158, 98, 158, 98, 158, 98 }, { 159, 97, 159, 97, 159, 97, 159, 97 },
- { 160, 96, 160, 96, 160, 96, 160, 96 }, { 161, 95, 161, 95, 161, 95, 161, 95 },
- { 162, 94, 162, 94, 162, 94, 162, 94 }, { 163, 93, 163, 93, 163, 93, 163, 93 },
- { 164, 92, 164, 92, 164, 92, 164, 92 }, { 165, 91, 165, 91, 165, 91, 165, 91 },
- { 166, 90, 166, 90, 166, 90, 166, 90 }, { 167, 89, 167, 89, 167, 89, 167, 89 },
- { 168, 88, 168, 88, 168, 88, 168, 88 }, { 169, 87, 169, 87, 169, 87, 169, 87 },
- { 170, 86, 170, 86, 170, 86, 170, 86 }, { 171, 85, 171, 85, 171, 85, 171, 85 },
- { 172, 84, 172, 84, 172, 84, 172, 84 }, { 173, 83, 173, 83, 173, 83, 173, 83 },
- { 174, 82, 174, 82, 174, 82, 174, 82 }, { 175, 81, 175, 81, 175, 81, 175, 81 },
- { 176, 80, 176, 80, 176, 80, 176, 80 }, { 177, 79, 177, 79, 177, 79, 177, 79 },
- { 178, 78, 178, 78, 178, 78, 178, 78 }, { 179, 77, 179, 77, 179, 77, 179, 77 },
- { 180, 76, 180, 76, 180, 76, 180, 76 }, { 181, 75, 181, 75, 181, 75, 181, 75 },
- { 182, 74, 182, 74, 182, 74, 182, 74 }, { 183, 73, 183, 73, 183, 73, 183, 73 },
- { 184, 72, 184, 72, 184, 72, 184, 72 }, { 185, 71, 185, 71, 185, 71, 185, 71 },
- { 186, 70, 186, 70, 186, 70, 186, 70 }, { 187, 69, 187, 69, 187, 69, 187, 69 },
- { 188, 68, 188, 68, 188, 68, 188, 68 }, { 189, 67, 189, 67, 189, 67, 189, 67 },
- { 190, 66, 190, 66, 190, 66, 190, 66 }, { 191, 65, 191, 65, 191, 65, 191, 65 },
- { 192, 64, 192, 64, 192, 64, 192, 64 }, { 193, 63, 193, 63, 193, 63, 193, 63 },
- { 194, 62, 194, 62, 194, 62, 194, 62 }, { 195, 61, 195, 61, 195, 61, 195, 61 },
- { 196, 60, 196, 60, 196, 60, 196, 60 }, { 197, 59, 197, 59, 197, 59, 197, 59 },
- { 198, 58, 198, 58, 198, 58, 198, 58 }, { 199, 57, 199, 57, 199, 57, 199, 57 },
- { 200, 56, 200, 56, 200, 56, 200, 56 }, { 201, 55, 201, 55, 201, 55, 201, 55 },
- { 202, 54, 202, 54, 202, 54, 202, 54 }, { 203, 53, 203, 53, 203, 53, 203, 53 },
- { 204, 52, 204, 52, 204, 52, 204, 52 }, { 205, 51, 205, 51, 205, 51, 205, 51 },
- { 206, 50, 206, 50, 206, 50, 206, 50 }, { 207, 49, 207, 49, 207, 49, 207, 49 },
- { 208, 48, 208, 48, 208, 48, 208, 48 }, { 209, 47, 209, 47, 209, 47, 209, 47 },
- { 210, 46, 210, 46, 210, 46, 210, 46 }, { 211, 45, 211, 45, 211, 45, 211, 45 },
- { 212, 44, 212, 44, 212, 44, 212, 44 }, { 213, 43, 213, 43, 213, 43, 213, 43 },
- { 214, 42, 214, 42, 214, 42, 214, 42 }, { 215, 41, 215, 41, 215, 41, 215, 41 },
- { 216, 40, 216, 40, 216, 40, 216, 40 }, { 217, 39, 217, 39, 217, 39, 217, 39 },
- { 218, 38, 218, 38, 218, 38, 218, 38 }, { 219, 37, 219, 37, 219, 37, 219, 37 },
- { 220, 36, 220, 36, 220, 36, 220, 36 }, { 221, 35, 221, 35, 221, 35, 221, 35 },
- { 222, 34, 222, 34, 222, 34, 222, 34 }, { 223, 33, 223, 33, 223, 33, 223, 33 },
- { 224, 32, 224, 32, 224, 32, 224, 32 }, { 225, 31, 225, 31, 225, 31, 225, 31 },
- { 226, 30, 226, 30, 226, 30, 226, 30 }, { 227, 29, 227, 29, 227, 29, 227, 29 },
- { 228, 28, 228, 28, 228, 28, 228, 28 }, { 229, 27, 229, 27, 229, 27, 229, 27 },
- { 230, 26, 230, 26, 230, 26, 230, 26 }, { 231, 25, 231, 25, 231, 25, 231, 25 },
- { 232, 24, 232, 24, 232, 24, 232, 24 }, { 233, 23, 233, 23, 233, 23, 233, 23 },
- { 234, 22, 234, 22, 234, 22, 234, 22 }, { 235, 21, 235, 21, 235, 21, 235, 21 },
- { 236, 20, 236, 20, 236, 20, 236, 20 }, { 237, 19, 237, 19, 237, 19, 237, 19 },
- { 238, 18, 238, 18, 238, 18, 238, 18 }, { 239, 17, 239, 17, 239, 17, 239, 17 },
- { 240, 16, 240, 16, 240, 16, 240, 16 }, { 241, 15, 241, 15, 241, 15, 241, 15 },
- { 242, 14, 242, 14, 242, 14, 242, 14 }, { 243, 13, 243, 13, 243, 13, 243, 13 },
- { 244, 12, 244, 12, 244, 12, 244, 12 }, { 245, 11, 245, 11, 245, 11, 245, 11 },
- { 246, 10, 246, 10, 246, 10, 246, 10 }, { 247, 9, 247, 9, 247, 9, 247, 9 },
- { 248, 8, 248, 8, 248, 8, 248, 8 }, { 249, 7, 249, 7, 249, 7, 249, 7 },
- { 250, 6, 250, 6, 250, 6, 250, 6 }, { 251, 5, 251, 5, 251, 5, 251, 5 },
- { 252, 4, 252, 4, 252, 4, 252, 4 }, { 253, 3, 253, 3, 253, 3, 253, 3 },
- { 254, 2, 254, 2, 254, 2, 254, 2 }, { 255, 1, 255, 1, 255, 1, 255, 1 }
- }
-};
-#endif // defined(__ALTIVEC__)
+ __m128i scale1 = _mm_set1_epi32(factor);
+ __m128i scale2 = _mm_sub_epi32(_mm_set1_epi32(0x100), scale1);
+
+ rgbaint_t scaled_other(other);
+ scaled_other.mul(scale2);
+
+ mul(scale1);
+ add(scaled_other);
+ sra_imm(8);
+}
+
+void rgbaint_t::scale_and_clamp(const rgbaint_t& scale)
+{
+ mul(scale);
+ sra_imm(8);
+ clamp_to_uint8();
+}
+
+void rgbaint_t::scale_imm_and_clamp(const INT32 scale)
+{
+ mul_imm(scale);
+ sra_imm(8);
+ clamp_to_uint8();
+}
+
+#endif // defined(__SSE2__) || defined(_MSC_VER)
diff --git a/src/emu/video/rgbsse.h b/src/emu/video/rgbsse.h
index 4822d5519f0..5f88e0e717c 100644
--- a/src/emu/video/rgbsse.h
+++ b/src/emu/video/rgbsse.h
@@ -1,5 +1,5 @@
// license:BSD-3-Clause
-// copyright-holders:Vas Crabb
+// copyright-holders:Vas Crabb, Ryan Holtz
/***************************************************************************
rgbsse.h
@@ -15,393 +15,520 @@
#include <emmintrin.h>
-
/***************************************************************************
TYPE DEFINITIONS
***************************************************************************/
-/* intermediate RGB values are stored in an __m128i */
-typedef __m128i rgbint;
-
-/* intermediate RGB values are stored in an __m128i */
-typedef __m128i rgbaint;
-
-
-
-/***************************************************************************
- BASIC CONVERSIONS
-***************************************************************************/
-
-/*-------------------------------------------------
- rgb_comp_to_rgbint - converts a trio of RGB
- components to an rgbint type
--------------------------------------------------*/
-
-INLINE void rgb_comp_to_rgbint(rgbint *rgb, INT16 r, INT16 g, INT16 b)
-{
- *rgb = _mm_set_epi16(0, 0, 0, 0, 0, r, g, b);
-}
-
-
-/*-------------------------------------------------
- rgba_comp_to_rgbint - converts a quad of RGB
- components to an rgbint type
--------------------------------------------------*/
-
-INLINE void rgba_comp_to_rgbaint(rgbaint *rgb, INT16 a, INT16 r, INT16 g, INT16 b)
-{
- *rgb = _mm_set_epi16(0, 0, 0, 0, a, r, g, b);
-}
-
-
-/*-------------------------------------------------
- rgb_to_rgbint - converts a packed trio of RGB
- components to an rgbint type
--------------------------------------------------*/
-
-INLINE void rgb_to_rgbint(rgbint *rgb, rgb_t color)
-{
- *rgb = _mm_unpacklo_epi8(_mm_cvtsi32_si128(color), _mm_setzero_si128());
-}
-
-
-/*-------------------------------------------------
- rgba_to_rgbaint - converts a packed quad of RGB
- components to an rgbint type
--------------------------------------------------*/
-
-INLINE void rgba_to_rgbaint(rgbaint *rgb, rgb_t color)
-{
- *rgb = _mm_unpacklo_epi8(_mm_cvtsi32_si128(color), _mm_setzero_si128());
-}
-
-
-/*-------------------------------------------------
- rgbint_to_rgb - converts an rgbint back to
- a packed trio of RGB values
--------------------------------------------------*/
-
-INLINE rgb_t rgbint_to_rgb(const rgbint *color)
-{
- return _mm_cvtsi128_si32(_mm_packus_epi16(*color, *color));
-}
-
-
-/*-------------------------------------------------
- rgbaint_to_rgba - converts an rgbint back to
- a packed quad of RGB values
--------------------------------------------------*/
-
-INLINE rgb_t rgbaint_to_rgba(const rgbaint *color)
-{
- return _mm_cvtsi128_si32(_mm_packus_epi16(*color, *color));
-}
-
-
-/*-------------------------------------------------
- rgbint_to_rgb_clamp - converts an rgbint back
- to a packed trio of RGB values, clamping them
- to bytes first
--------------------------------------------------*/
-
-INLINE rgb_t rgbint_to_rgb_clamp(const rgbint *color)
-{
- return _mm_cvtsi128_si32(_mm_packus_epi16(*color, *color));
-}
-
-
-/*-------------------------------------------------
- rgbaint_to_rgba_clamp - converts an rgbint back
- to a packed quad of RGB values, clamping them
- to bytes first
--------------------------------------------------*/
-
-INLINE rgb_t rgbaint_to_rgba_clamp(const rgbaint *color)
-{
- return _mm_cvtsi128_si32(_mm_packus_epi16(*color, *color));
-}
-
-
-
-/***************************************************************************
- CORE MATH
-***************************************************************************/
-
-/*-------------------------------------------------
- rgbint_add - add two rgbint values
--------------------------------------------------*/
-
-INLINE void rgbint_add(rgbint *color1, const rgbint *color2)
+class rgbaint_t
{
- *color1 = _mm_add_epi16(*color1, *color2);
-}
-
-
-/*-------------------------------------------------
- rgbaint_add - add two rgbaint values
--------------------------------------------------*/
-
-INLINE void rgbaint_add(rgbaint *color1, const rgbaint *color2)
-{
- *color1 = _mm_add_epi16(*color1, *color2);
-}
-
-
-/*-------------------------------------------------
- rgbint_sub - subtract two rgbint values
--------------------------------------------------*/
-
-INLINE void rgbint_sub(rgbint *color1, const rgbint *color2)
-{
- *color1 = _mm_sub_epi16(*color1, *color2);
-}
-
-
-/*-------------------------------------------------
- rgbaint_sub - subtract two rgbaint values
--------------------------------------------------*/
-
-INLINE void rgbaint_sub(rgbaint *color1, const rgbaint *color2)
-{
- *color1 = _mm_sub_epi16(*color1, *color2);
-}
-
-
-/*-------------------------------------------------
- rgbint_subr - reverse subtract two rgbint
- values
--------------------------------------------------*/
-
-INLINE void rgbint_subr(rgbint *color1, const rgbint *color2)
-{
- __m128i temp = *color1;
- *color1 = *color2;
- *color1 = _mm_sub_epi16(*color1, temp);
-}
-
-
-/*-------------------------------------------------
- rgbaint_subr - reverse subtract two rgbaint
- values
--------------------------------------------------*/
-
-INLINE void rgbaint_subr(rgbaint *color1, const rgbaint *color2)
-{
- __m128i temp = *color1;
- *color1 = *color2;
- *color1 = _mm_sub_epi16(*color1, temp);
-}
-
-
-/*-------------------------------------------------
- rgbint_shl - shift each component of an
- rgbint struct by the given number of bits
--------------------------------------------------*/
-
-INLINE void rgbint_shl(rgbint *color, UINT8 shift)
-{
- *color = _mm_slli_epi16(*color, shift);
-}
-
-
-/*-------------------------------------------------
- rgbaint_shl - shift each component of an
- rgbaint struct by the given number of bits
--------------------------------------------------*/
-
-INLINE void rgbaint_shl(rgbaint *color, UINT8 shift)
-{
- *color = _mm_slli_epi16(*color, shift);
-}
-
-
-/*-------------------------------------------------
- rgbint_shr - shift each component of an
- rgbint struct by the given number of bits
--------------------------------------------------*/
-
-INLINE void rgbint_shr(rgbint *color, UINT8 shift)
-{
- *color = _mm_srli_epi16(*color, shift);
-}
-
-
-/*-------------------------------------------------
- rgbaint_shr - shift each component of an
- rgbaint struct by the given number of bits
--------------------------------------------------*/
-
-INLINE void rgbaint_shr(rgbaint *color, UINT8 shift)
-{
- *color = _mm_srli_epi16(*color, shift);
-}
-
-
-
-/***************************************************************************
- TABLES
-***************************************************************************/
-
-extern const struct _rgbsse_statics
-{
- __m128 dummy_for_alignment;
- INT16 maxbyte[8];
- INT16 scale_table[256][8];
-} rgbsse_statics;
-
-
-
-/***************************************************************************
- HIGHER LEVEL OPERATIONS
-***************************************************************************/
-
-/*-------------------------------------------------
- rgbint_blend - blend two colors by the given
- scale factor
--------------------------------------------------*/
-
-INLINE void rgbint_blend(rgbint *color1, const rgbint *color2, UINT8 color1scale)
-{
- *color1 = _mm_unpacklo_epi16(*color1, *color2);
- *color1 = _mm_madd_epi16(*color1, *(__m128i *)&rgbsse_statics.scale_table[color1scale][0]);
- *color1 = _mm_srli_epi32(*color1, 8);
- *color1 = _mm_packs_epi32(*color1, *color1);
-}
-
-
-/*-------------------------------------------------
- rgbaint_blend - blend two colors by the given
- scale factor
--------------------------------------------------*/
-
-INLINE void rgbaint_blend(rgbaint *color1, const rgbaint *color2, UINT8 color1scale)
-{
- rgbint_blend(color1, color2, color1scale);
-}
-
-
-/*-------------------------------------------------
- rgbint_scale_and_clamp - scale the given
- color by an 8.8 scale factor, immediate or
- per channel, and clamp to byte values
--------------------------------------------------*/
-
-INLINE void rgbint_scale_immediate_and_clamp(rgbint *color, INT16 colorscale)
-{
- __m128i mscale = _mm_set1_epi16(colorscale);
- *color = _mm_unpacklo_epi16(*color, _mm_setzero_si128());
- *color = _mm_madd_epi16(*color, mscale);
- *color = _mm_srli_epi32(*color, 8);
- *color = _mm_packs_epi32(*color, *color);
- *color = _mm_min_epi16(*color, *(__m128i *)&rgbsse_statics.maxbyte);
-}
-
-INLINE void rgbint_scale_channel_and_clamp(rgbint *color, const rgbint *colorscale)
-{
- __m128i mscale = _mm_unpacklo_epi16(*colorscale, _mm_setzero_si128());
- *color = _mm_unpacklo_epi16(*color, _mm_setzero_si128());
- *color = _mm_madd_epi16(*color, mscale);
- *color = _mm_srli_epi32(*color, 8);
- *color = _mm_packs_epi32(*color, *color);
- *color = _mm_min_epi16(*color, *(__m128i *)&rgbsse_statics.maxbyte);
-}
-
-
-/*-------------------------------------------------
- rgbaint_scale_and_clamp - scale the given
- color by an 8.8 scale factor, immediate or
- per channel, and clamp to byte values
--------------------------------------------------*/
-
-INLINE void rgbaint_scale_immediate_and_clamp(rgbaint *color, INT16 colorscale)
-{
- rgbint_scale_immediate_and_clamp(color, colorscale);
-}
-
-INLINE void rgbaint_scale_channel_and_clamp(rgbaint *color, const rgbint *colorscale)
-{
- rgbint_scale_channel_and_clamp(color, color);
-}
-
-
-/*-------------------------------------------------
- rgb_bilinear_filter - bilinear filter between
- four pixel values
--------------------------------------------------*/
-
-INLINE UINT32 rgb_bilinear_filter(UINT32 rgb00, UINT32 rgb01, UINT32 rgb10, UINT32 rgb11, UINT8 u, UINT8 v)
-{
- __m128i color00 = _mm_cvtsi32_si128(rgb00);
- __m128i color01 = _mm_cvtsi32_si128(rgb01);
- __m128i color10 = _mm_cvtsi32_si128(rgb10);
- __m128i color11 = _mm_cvtsi32_si128(rgb11);
-
- /* interleave color01 and color00 at the byte level */
- color01 = _mm_unpacklo_epi8(color01, color00);
- color11 = _mm_unpacklo_epi8(color11, color10);
- color01 = _mm_unpacklo_epi8(color01, _mm_setzero_si128());
- color11 = _mm_unpacklo_epi8(color11, _mm_setzero_si128());
- color01 = _mm_madd_epi16(color01, *(__m128i *)&rgbsse_statics.scale_table[u][0]);
- color11 = _mm_madd_epi16(color11, *(__m128i *)&rgbsse_statics.scale_table[u][0]);
- color01 = _mm_slli_epi32(color01, 15);
- color11 = _mm_srli_epi32(color11, 1);
- color01 = _mm_max_epi16(color01, color11);
- color01 = _mm_madd_epi16(color01, *(__m128i *)&rgbsse_statics.scale_table[v][0]);
- color01 = _mm_srli_epi32(color01, 15);
- color01 = _mm_packs_epi32(color01, color01);
- color01 = _mm_packus_epi16(color01, color01);
- return _mm_cvtsi128_si32(color01);
-}
-
-
-/*-------------------------------------------------
- rgba_bilinear_filter - bilinear filter between
- four pixel values
--------------------------------------------------*/
-
-INLINE UINT32 rgba_bilinear_filter(UINT32 rgb00, UINT32 rgb01, UINT32 rgb10, UINT32 rgb11, UINT8 u, UINT8 v)
-{
- return rgb_bilinear_filter(rgb00, rgb01, rgb10, rgb11, u, v);
-}
-
-
-/*-------------------------------------------------
- rgbint_bilinear_filter - bilinear filter between
- four pixel values
--------------------------------------------------*/
-
-INLINE void rgbint_bilinear_filter(rgbint *color, UINT32 rgb00, UINT32 rgb01, UINT32 rgb10, UINT32 rgb11, UINT8 u, UINT8 v)
-{
- __m128i color00 = _mm_cvtsi32_si128(rgb00);
- __m128i color01 = _mm_cvtsi32_si128(rgb01);
- __m128i color10 = _mm_cvtsi32_si128(rgb10);
- __m128i color11 = _mm_cvtsi32_si128(rgb11);
-
- /* interleave color01 and color00 at the byte level */
- color01 = _mm_unpacklo_epi8(color01, color00);
- color11 = _mm_unpacklo_epi8(color11, color10);
- color01 = _mm_unpacklo_epi8(color01, _mm_setzero_si128());
- color11 = _mm_unpacklo_epi8(color11, _mm_setzero_si128());
- color01 = _mm_madd_epi16(color01, *(__m128i *)&rgbsse_statics.scale_table[u][0]);
- color11 = _mm_madd_epi16(color11, *(__m128i *)&rgbsse_statics.scale_table[u][0]);
- color01 = _mm_slli_epi32(color01, 15);
- color11 = _mm_srli_epi32(color11, 1);
- color01 = _mm_max_epi16(color01, color11);
- color01 = _mm_madd_epi16(color01, *(__m128i *)&rgbsse_statics.scale_table[v][0]);
- color01 = _mm_srli_epi32(color01, 15);
- *color = _mm_packs_epi32(color01, color01);
-}
-
-
-/*-------------------------------------------------
- rgbaint_bilinear_filter - bilinear filter between
- four pixel values
--------------------------------------------------*/
-
-INLINE void rgbaint_bilinear_filter(rgbaint *color, UINT32 rgb00, UINT32 rgb01, UINT32 rgb10, UINT32 rgb11, UINT8 u, UINT8 v)
-{
- rgbint_bilinear_filter(color, rgb00, rgb01, rgb10, rgb11, u, v);
-}
-
+public:
+ inline rgbaint_t() { }
+ inline rgbaint_t(UINT32 rgba) { set(rgba); }
+ inline rgbaint_t(INT32 a, INT32 r, INT32 g, INT32 b) { set(a, r, g, b); }
+ inline rgbaint_t(rgb_t& rgb) { set(rgb); }
+ inline rgbaint_t(__m128i rgba) { m_value = rgba; }
+
+ inline void set(rgbaint_t& other) { m_value = other.m_value; }
+ inline void set(UINT32 rgba) { m_value = _mm_and_si128(_mm_set1_epi32(0xff), _mm_set_epi32(rgba >> 24, rgba >> 16, rgba >> 8, rgba)); }
+ inline void set(INT32 a, INT32 r, INT32 g, INT32 b) { m_value = _mm_set_epi32(a, r, g, b); }
+ inline void set(rgb_t& rgb) { m_value = _mm_unpacklo_epi16(_mm_unpacklo_epi8(_mm_cvtsi32_si128(rgb), _mm_setzero_si128()), _mm_setzero_si128()); }
+
+ inline rgb_t to_rgba()
+ {
+ return _mm_cvtsi128_si32(_mm_packus_epi16(_mm_packs_epi32(m_value, _mm_setzero_si128()), _mm_setzero_si128()));
+ }
+
+ inline rgb_t to_rgba_clamp()
+ {
+ return _mm_cvtsi128_si32(_mm_packus_epi16(_mm_packs_epi32(m_value, _mm_setzero_si128()), _mm_setzero_si128()));
+ }
+
+ inline void add(const rgbaint_t& color2)
+ {
+ m_value = _mm_add_epi32(m_value, color2.m_value);
+ }
+
+ inline void add_imm(const INT32 imm)
+ {
+ m_value = _mm_add_epi32(m_value, _mm_set1_epi32(imm));
+ }
+
+ inline void add_imm_rgba(const INT32 a, const INT32 r, const INT32 g, const INT32 b)
+ {
+ m_value = _mm_add_epi32(m_value, _mm_set_epi32(a, r, g, b));
+ }
+
+ inline void sub(const rgbaint_t& color2)
+ {
+ m_value = _mm_sub_epi32(m_value, color2.m_value);
+ }
+
+ inline void sub_imm(const INT32 imm)
+ {
+ m_value = _mm_sub_epi32(m_value, _mm_set1_epi32(imm));
+ }
+
+ inline void sub_imm_rgba(const INT32 a, const INT32 r, const INT32 g, const INT32 b)
+ {
+ m_value = _mm_sub_epi32(m_value, _mm_set_epi32(a, r, g, b));
+ }
+
+ inline void subr(rgbaint_t& color2)
+ {
+ m_value = _mm_sub_epi32(color2.m_value, m_value);
+ }
+
+ inline void subr_imm(const INT32 imm)
+ {
+ m_value = _mm_sub_epi32(_mm_set1_epi32(imm), m_value);
+ }
+
+ inline void subr_imm_rgba(const INT32 a, const INT32 r, const INT32 g, const INT32 b)
+ {
+ m_value = _mm_sub_epi32(_mm_set_epi32(a, r, g, b), m_value);
+ }
+
+ inline void set_a(const INT32 value)
+ {
+ m_value = _mm_or_si128(_mm_and_si128(m_value, alpha_mask()), _mm_set_epi32(value, 0, 0, 0));
+ }
+
+ inline void set_r(const INT32 value)
+ {
+ m_value = _mm_or_si128(_mm_and_si128(m_value, red_mask()), _mm_set_epi32(0, value, 0, 0));
+ }
+
+ inline void set_g(const INT32 value)
+ {
+ m_value = _mm_or_si128(_mm_and_si128(m_value, green_mask()), _mm_set_epi32(0, 0, value, 0));
+ }
+
+ inline void set_b(const INT32 value)
+ {
+ m_value = _mm_or_si128(_mm_and_si128(m_value, blue_mask()), _mm_set_epi32(0, 0, 0, value));
+ }
+
+ inline UINT8 get_a() const
+ {
+ return _mm_extract_epi16(m_value, 6);
+ }
+
+ inline UINT8 get_r() const
+ {
+ return _mm_extract_epi16(m_value, 4);
+ }
+
+ inline UINT8 get_g() const
+ {
+ return _mm_extract_epi16(m_value, 2);
+ }
+
+ inline UINT8 get_b() const
+ {
+ return _mm_extract_epi16(m_value, 0);
+ }
+
+ inline INT32 get_a32() const
+ {
+ return (_mm_extract_epi16(m_value, 7) << 16) | _mm_extract_epi16(m_value, 6);
+ }
+
+ inline INT32 get_r32() const
+ {
+ return (_mm_extract_epi16(m_value, 5) << 16) | _mm_extract_epi16(m_value, 4);
+ }
+
+ inline INT32 get_g32() const
+ {
+ return (_mm_extract_epi16(m_value, 3) << 16) | _mm_extract_epi16(m_value, 2);
+ }
+
+ inline INT32 get_b32() const
+ {
+ return (_mm_extract_epi16(m_value, 1) << 16) | _mm_extract_epi16(m_value, 0);
+ }
+
+ inline void mul(const rgbaint_t& color)
+ {
+ __m128i tmp1 = _mm_mul_epu32(m_value, color.m_value);
+ __m128i tmp2 = _mm_mul_epu32(_mm_srli_si128(m_value, 4), _mm_srli_si128(color.m_value, 4));
+ m_value = _mm_unpacklo_epi32(_mm_shuffle_epi32(tmp1, _MM_SHUFFLE(0, 0, 2, 0)), _mm_shuffle_epi32(tmp2, _MM_SHUFFLE(0, 0, 2, 0)));
+ }
+
+ inline void mul_imm(const INT32 imm)
+ {
+ __m128i immv = _mm_set1_epi32(imm);
+ __m128i tmp1 = _mm_mul_epu32(m_value, immv);
+ __m128i tmp2 = _mm_mul_epu32(_mm_srli_si128(m_value, 4), _mm_srli_si128(immv, 4));
+ m_value = _mm_unpacklo_epi32(_mm_shuffle_epi32(tmp1, _MM_SHUFFLE(0, 0, 2, 0)), _mm_shuffle_epi32(tmp2, _MM_SHUFFLE(0, 0, 2, 0)));
+ }
+
+ inline void mul_imm_rgba(const INT32 a, const INT32 r, const INT32 g, const INT32 b)
+ {
+ __m128i immv = _mm_set_epi32(a, r, g, b);
+ __m128i tmp1 = _mm_mul_epu32(m_value, immv);
+ __m128i tmp2 = _mm_mul_epu32(_mm_srli_si128(m_value, 4), _mm_srli_si128(immv, 4));
+ m_value = _mm_unpacklo_epi32(_mm_shuffle_epi32(tmp1, _MM_SHUFFLE(0, 0, 2, 0)), _mm_shuffle_epi32(tmp2, _MM_SHUFFLE(0, 0, 2, 0)));
+ }
+
+ inline void shl(const rgbaint_t& shift)
+ {
+ rgbaint_t areg(*this);
+ rgbaint_t rreg(*this);
+ rgbaint_t greg(*this);
+ rgbaint_t breg(*this);
+ rgbaint_t ashift(0, 0, 0, shift.get_a32());
+ rgbaint_t rshift(0, 0, 0, shift.get_r32());
+ rgbaint_t gshift(0, 0, 0, shift.get_g32());
+ rgbaint_t bshift(0, 0, 0, shift.get_b32());
+ areg.m_value = _mm_sll_epi32(areg.m_value, ashift.m_value);
+ rreg.m_value = _mm_sll_epi32(rreg.m_value, rshift.m_value);
+ greg.m_value = _mm_sll_epi32(greg.m_value, gshift.m_value);
+ breg.m_value = _mm_sll_epi32(breg.m_value, bshift.m_value);
+ set(areg.get_a32(), rreg.get_r32(), greg.get_g32(), breg.get_b32());
+ }
+
+ inline void shl_imm(const UINT8 shift)
+ {
+ m_value = _mm_slli_epi32(m_value, shift);
+ }
+
+ inline void shr(const rgbaint_t& shift)
+ {
+ rgbaint_t areg(*this);
+ rgbaint_t rreg(*this);
+ rgbaint_t greg(*this);
+ rgbaint_t breg(*this);
+ rgbaint_t ashift(0, 0, 0, shift.get_a32());
+ rgbaint_t rshift(0, 0, 0, shift.get_r32());
+ rgbaint_t gshift(0, 0, 0, shift.get_g32());
+ rgbaint_t bshift(0, 0, 0, shift.get_b32());
+ areg.m_value = _mm_srl_epi32(areg.m_value, ashift.m_value);
+ rreg.m_value = _mm_srl_epi32(rreg.m_value, rshift.m_value);
+ greg.m_value = _mm_srl_epi32(greg.m_value, gshift.m_value);
+ breg.m_value = _mm_srl_epi32(breg.m_value, bshift.m_value);
+ set(areg.get_a32(), rreg.get_r32(), greg.get_g32(), breg.get_b32());
+ }
+
+ inline void shr_imm(const UINT8 shift)
+ {
+ m_value = _mm_srli_epi32(m_value, shift);
+ }
+
+ inline void sra(const rgbaint_t& shift)
+ {
+ rgbaint_t areg(*this);
+ rgbaint_t rreg(*this);
+ rgbaint_t greg(*this);
+ rgbaint_t breg(*this);
+ rgbaint_t ashift(0, 0, 0, shift.get_a32());
+ rgbaint_t rshift(0, 0, 0, shift.get_r32());
+ rgbaint_t gshift(0, 0, 0, shift.get_g32());
+ rgbaint_t bshift(0, 0, 0, shift.get_b32());
+ areg.m_value = _mm_sra_epi32(areg.m_value, ashift.m_value);
+ rreg.m_value = _mm_sra_epi32(rreg.m_value, rshift.m_value);
+ greg.m_value = _mm_sra_epi32(greg.m_value, gshift.m_value);
+ breg.m_value = _mm_sra_epi32(breg.m_value, bshift.m_value);
+ set(areg.get_a32(), rreg.get_r32(), greg.get_g32(), breg.get_b32());
+ }
+
+ inline void sra_imm(const UINT8 shift)
+ {
+ m_value = _mm_srai_epi32(m_value, shift);
+ }
+
+ inline void or_reg(const rgbaint_t& color2)
+ {
+ m_value = _mm_or_si128(m_value, color2.m_value);
+ }
+
+ inline void or_imm(const INT32 value)
+ {
+ m_value = _mm_or_si128(m_value, _mm_set1_epi32(value));
+ }
+
+ inline void or_imm_rgba(const INT32 a, const INT32 r, const INT32 g, const INT32 b)
+ {
+ m_value = _mm_or_si128(m_value, _mm_set_epi32(a, r, g, b));
+ }
+
+ inline void and_reg(const rgbaint_t& color)
+ {
+ m_value = _mm_and_si128(m_value, color.m_value);
+ }
+
+ inline void andnot_reg(const rgbaint_t& color)
+ {
+ m_value = _mm_andnot_si128(color.m_value, m_value);
+ }
+
+ inline void and_imm(const INT32 value)
+ {
+ m_value = _mm_and_si128(m_value, _mm_set1_epi32(value));
+ }
+
+ inline void and_imm_rgba(const INT32 a, const INT32 r, const INT32 g, const INT32 b)
+ {
+ m_value = _mm_and_si128(m_value, _mm_set_epi32(a, r, g, b));
+ }
+
+ inline void xor_reg(const rgbaint_t& color2)
+ {
+ m_value = _mm_xor_si128(m_value, color2.m_value);
+ }
+
+ inline void xor_imm(const INT32 value)
+ {
+ m_value = _mm_xor_si128(m_value, _mm_set1_epi32(value));
+ }
+
+ inline void xor_imm_rgba(const INT32 a, const INT32 r, const INT32 g, const INT32 b)
+ {
+ m_value = _mm_xor_si128(m_value, _mm_set_epi32(a, r, g, b));
+ }
+
+ inline void clamp_and_clear(const UINT32 sign)
+ {
+ __m128i vsign = _mm_set1_epi32(sign);
+ m_value = _mm_and_si128(m_value, _mm_cmpeq_epi32(_mm_and_si128(m_value, vsign), _mm_setzero_si128()));
+ vsign = _mm_srai_epi32(vsign, 1);
+ vsign = _mm_xor_si128(vsign, _mm_set1_epi32(0xffffffff));
+ __m128i mask = _mm_cmpgt_epi32(m_value, vsign);
+ m_value = _mm_or_si128(_mm_and_si128(vsign, mask), _mm_and_si128(m_value, _mm_xor_si128(mask, _mm_set1_epi32(0xffffffff))));
+ }
+
+ inline void clamp_to_uint8()
+ {
+ m_value = _mm_packs_epi32(m_value, _mm_setzero_si128());
+ m_value = _mm_packus_epi16(m_value, _mm_setzero_si128());
+ m_value = _mm_unpacklo_epi8(m_value, _mm_setzero_si128());
+ m_value = _mm_unpacklo_epi16(m_value, _mm_setzero_si128());
+ }
+
+ inline void sign_extend(const UINT32 compare, const UINT32 sign)
+ {
+ __m128i compare_vec = _mm_set1_epi32(compare);
+ __m128i compare_mask = _mm_cmpeq_epi32(_mm_and_si128(m_value, compare_vec), compare_vec);
+ __m128i compared = _mm_and_si128(_mm_set1_epi32(sign), compare_mask);
+ m_value = _mm_or_si128(m_value, compared);
+ }
+
+ inline void min(const INT32 value)
+ {
+ __m128i val = _mm_set1_epi32(value);
+ __m128i is_greater_than = _mm_cmpgt_epi32(m_value, val);
+
+ __m128i val_to_set = _mm_and_si128(val, is_greater_than);
+ __m128i keep_mask = _mm_xor_si128(is_greater_than, _mm_set1_epi32(0xffffffff));
+
+ m_value = _mm_and_si128(m_value, keep_mask);
+ m_value = _mm_or_si128(val_to_set, m_value);
+ }
+
+ inline void max(const INT32 value)
+ {
+ __m128i val = _mm_set1_epi32(value);
+ __m128i is_less_than = _mm_cmplt_epi32(m_value, val);
+
+ __m128i val_to_set = _mm_and_si128(val, is_less_than);
+ __m128i keep_mask = _mm_xor_si128(is_less_than, _mm_set1_epi32(0xffffffff));
+
+ m_value = _mm_and_si128(m_value, keep_mask);
+ m_value = _mm_or_si128(val_to_set, m_value);
+ }
+
+ void blend(const rgbaint_t& other, UINT8 factor);
+
+ void scale_and_clamp(const rgbaint_t& scale);
+ void scale_imm_and_clamp(const INT32 scale);
+
+ inline void scale_imm_add_and_clamp(const INT32 scale, const rgbaint_t& other)
+ {
+ mul_imm(scale);
+ sra_imm(8);
+ add(other);
+ clamp_to_uint8();
+ }
+
+ inline void scale_add_and_clamp(const rgbaint_t& scale, const rgbaint_t& other)
+ {
+ mul(scale);
+ sra_imm(8);
+ add(other);
+ clamp_to_uint8();
+ }
+
+ inline void scale2_add_and_clamp(const rgbaint_t& scale, const rgbaint_t& other, const rgbaint_t& scale2)
+ {
+ rgbaint_t color2(other);
+ color2.mul(scale2);
+
+ mul(scale);
+ add(color2);
+ sra_imm(8);
+ clamp_to_uint8();
+ }
+
+ inline void cmpeq(const rgbaint_t& value)
+ {
+ m_value = _mm_cmpeq_epi32(m_value, value.m_value);
+ }
+
+ inline void cmpeq_imm(const INT32 value)
+ {
+ m_value = _mm_cmpeq_epi32(m_value, _mm_set1_epi32(value));
+ }
+
+ inline void cmpeq_imm_rgba(const INT32 a, const INT32 r, const INT32 g, const INT32 b)
+ {
+ m_value = _mm_cmpeq_epi32(m_value, _mm_set_epi32(a, r, g, b));
+ }
+
+ inline void cmpgt(const rgbaint_t& value)
+ {
+ m_value = _mm_cmpgt_epi32(m_value, value.m_value);
+ }
+
+ inline void cmpgt_imm(const INT32 value)
+ {
+ m_value = _mm_cmpgt_epi32(m_value, _mm_set1_epi32(value));
+ }
+
+ inline void cmpgt_imm_rgba(const INT32 a, const INT32 r, const INT32 g, const INT32 b)
+ {
+ m_value = _mm_cmpgt_epi32(m_value, _mm_set_epi32(a, r, g, b));
+ }
+
+ inline void cmplt(const rgbaint_t& value)
+ {
+ m_value = _mm_cmplt_epi32(m_value, value.m_value);
+ }
+
+ inline void cmplt_imm(const INT32 value)
+ {
+ m_value = _mm_cmplt_epi32(m_value, _mm_set1_epi32(value));
+ }
+
+ inline void cmplt_imm_rgba(const INT32 a, const INT32 r, const INT32 g, const INT32 b)
+ {
+ m_value = _mm_cmplt_epi32(m_value, _mm_set_epi32(a, r, g, b));
+ }
+
+ inline rgbaint_t operator=(const rgbaint_t& other)
+ {
+ m_value = other.m_value;
+ return *this;
+ }
+
+ inline rgbaint_t& operator+=(const rgbaint_t& other)
+ {
+ m_value = _mm_add_epi32(m_value, other.m_value);
+ return *this;
+ }
+
+ inline rgbaint_t& operator+=(const INT32 other)
+ {
+ m_value = _mm_add_epi32(m_value, _mm_set1_epi32(other));
+ return *this;
+ }
+
+ inline rgbaint_t& operator-=(const rgbaint_t& other)
+ {
+ m_value = _mm_sub_epi32(m_value, other.m_value);
+ return *this;
+ }
+
+ inline rgbaint_t& operator*=(const rgbaint_t& other)
+ {
+ m_value = _mm_unpacklo_epi32(_mm_shuffle_epi32(_mm_mul_epu32(m_value, other.m_value), _MM_SHUFFLE(0, 0, 2, 0)), _mm_shuffle_epi32(_mm_mul_epu32(_mm_srli_si128(m_value, 4), _mm_srli_si128(other.m_value, 4)), _MM_SHUFFLE(0, 0, 2, 0)));
+ return *this;
+ }
+
+ inline rgbaint_t& operator*=(const INT32 other)
+ {
+ const __m128i immv = _mm_set1_epi32(other);
+ m_value = _mm_unpacklo_epi32(_mm_shuffle_epi32(_mm_mul_epu32(m_value, immv), _MM_SHUFFLE(0, 0, 2, 0)), _mm_shuffle_epi32(_mm_mul_epu32(_mm_srli_si128(m_value, 4), _mm_srli_si128(immv, 4)), _MM_SHUFFLE(0, 0, 2, 0)));
+ return *this;
+ }
+
+ inline rgbaint_t& operator>>=(const INT32 shift)
+ {
+ m_value = _mm_srai_epi32(m_value, shift);
+ return *this;
+ }
+
+ inline void merge_alpha(const rgbaint_t& alpha)
+ {
+ m_value = _mm_insert_epi16(m_value, _mm_extract_epi16(alpha.m_value, 7), 7);
+ m_value = _mm_insert_epi16(m_value, _mm_extract_epi16(alpha.m_value, 6), 6);
+ }
+
+ static UINT32 bilinear_filter(UINT32 rgb00, UINT32 rgb01, UINT32 rgb10, UINT32 rgb11, UINT8 u, UINT8 v)
+ {
+ __m128i color00 = _mm_cvtsi32_si128(rgb00);
+ __m128i color01 = _mm_cvtsi32_si128(rgb01);
+ __m128i color10 = _mm_cvtsi32_si128(rgb10);
+ __m128i color11 = _mm_cvtsi32_si128(rgb11);
+
+ /* interleave color01 and color00 at the byte level */
+ color01 = _mm_unpacklo_epi8(color01, color00);
+ color11 = _mm_unpacklo_epi8(color11, color10);
+ color01 = _mm_unpacklo_epi8(color01, _mm_setzero_si128());
+ color11 = _mm_unpacklo_epi8(color11, _mm_setzero_si128());
+ color01 = _mm_madd_epi16(color01, scale_factor(u));
+ color11 = _mm_madd_epi16(color11, scale_factor(u));
+ color01 = _mm_slli_epi32(color01, 15);
+ color11 = _mm_srli_epi32(color11, 1);
+ color01 = _mm_max_epi16(color01, color11);
+ color01 = _mm_madd_epi16(color01, scale_factor(v));
+ color01 = _mm_srli_epi32(color01, 15);
+ color01 = _mm_packs_epi32(color01, _mm_setzero_si128());
+ color01 = _mm_packus_epi16(color01, _mm_setzero_si128());
+ return _mm_cvtsi128_si32(color01);
+ }
+
+ inline void bilinear_filter_rgbaint(UINT32 rgb00, UINT32 rgb01, UINT32 rgb10, UINT32 rgb11, UINT8 u, UINT8 v)
+ {
+ __m128i color00 = _mm_cvtsi32_si128(rgb00);
+ __m128i color01 = _mm_cvtsi32_si128(rgb01);
+ __m128i color10 = _mm_cvtsi32_si128(rgb10);
+ __m128i color11 = _mm_cvtsi32_si128(rgb11);
+
+ /* interleave color01 and color00 at the byte level */
+ color01 = _mm_unpacklo_epi8(color01, color00);
+ color11 = _mm_unpacklo_epi8(color11, color10);
+ color01 = _mm_unpacklo_epi8(color01, _mm_setzero_si128());
+ color11 = _mm_unpacklo_epi8(color11, _mm_setzero_si128());
+ color01 = _mm_madd_epi16(color01, scale_factor(u));
+ color11 = _mm_madd_epi16(color11, scale_factor(u));
+ color01 = _mm_slli_epi32(color01, 15);
+ color11 = _mm_srli_epi32(color11, 1);
+ color01 = _mm_max_epi16(color01, color11);
+ color01 = _mm_madd_epi16(color01, scale_factor(v));
+ m_value = _mm_srli_epi32(color01, 15);
+ }
+
+protected:
+ struct _statics
+ {
+ __m128 dummy_for_alignment;
+ INT16 alpha_mask[8];
+ INT16 red_mask[8];
+ INT16 green_mask[8];
+ INT16 blue_mask[8];
+ INT16 scale_table[256][8];
+ };
+
+ static inline __m128i alpha_mask() { return *(__m128i *)&statics.alpha_mask[0]; }
+ static inline __m128i red_mask() { return *(__m128i *)&statics.red_mask[0]; }
+ static inline __m128i green_mask() { return *(__m128i *)&statics.green_mask[0]; }
+ static inline __m128i blue_mask() { return *(__m128i *)&statics.blue_mask[0]; }
+ static inline __m128i scale_factor(UINT8 index) { return *(__m128i *)&statics.scale_table[index][0]; }
+
+ __m128i m_value;
+
+ static const _statics statics;
+
+};
#endif /* __RGBSSE__ */
diff --git a/src/emu/video/rgbvmx.c b/src/emu/video/rgbvmx.c
new file mode 100644
index 00000000000..a35572368a7
--- /dev/null
+++ b/src/emu/video/rgbvmx.c
@@ -0,0 +1,220 @@
+// license:BSD-3-Clause
+// copyright-holders:Vas Crabb, Ryan Holtz
+/***************************************************************************
+
+ rgbsse.c
+
+ VMX/Altivec optimised RGB utilities.
+
+***************************************************************************/
+
+#if defined(__ALTIVEC__)
+
+#include "emu.h"
+#include "rgbutil.h"
+
+/***************************************************************************
+ TABLES
+***************************************************************************/
+
+const rgbaint_t::VECU8 rgbaint_t::alpha_perm = { 16, 17, 18, 19, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
+const rgbaint_t::VECU8 rgbaint_t::red_perm = { 0, 1, 2, 3, 16, 17, 18, 19, 8, 9, 10, 11, 12, 13, 14, 15 };
+const rgbaint_t::VECU8 rgbaint_t::green_perm = { 0, 1, 2, 3, 4, 5, 6, 7, 16, 17, 18, 19, 12, 13, 14, 15 };
+const rgbaint_t::VECU8 rgbaint_t::blue_perm = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 16, 17, 18, 19 };
+const rgbaint_t::VECS16 rgbaint_t::scale_table[256] = {
+ { 0, 256, 0, 256, 0, 256, 0, 256 }, { 1, 255, 1, 255, 1, 255, 1, 255 },
+ { 2, 254, 2, 254, 2, 254, 2, 254 }, { 3, 253, 3, 253, 3, 253, 3, 253 },
+ { 4, 252, 4, 252, 4, 252, 4, 252 }, { 5, 251, 5, 251, 5, 251, 5, 251 },
+ { 6, 250, 6, 250, 6, 250, 6, 250 }, { 7, 249, 7, 249, 7, 249, 7, 249 },
+ { 8, 248, 8, 248, 8, 248, 8, 248 }, { 9, 247, 9, 247, 9, 247, 9, 247 },
+ { 10, 246, 10, 246, 10, 246, 10, 246 }, { 11, 245, 11, 245, 11, 245, 11, 245 },
+ { 12, 244, 12, 244, 12, 244, 12, 244 }, { 13, 243, 13, 243, 13, 243, 13, 243 },
+ { 14, 242, 14, 242, 14, 242, 14, 242 }, { 15, 241, 15, 241, 15, 241, 15, 241 },
+ { 16, 240, 16, 240, 16, 240, 16, 240 }, { 17, 239, 17, 239, 17, 239, 17, 239 },
+ { 18, 238, 18, 238, 18, 238, 18, 238 }, { 19, 237, 19, 237, 19, 237, 19, 237 },
+ { 20, 236, 20, 236, 20, 236, 20, 236 }, { 21, 235, 21, 235, 21, 235, 21, 235 },
+ { 22, 234, 22, 234, 22, 234, 22, 234 }, { 23, 233, 23, 233, 23, 233, 23, 233 },
+ { 24, 232, 24, 232, 24, 232, 24, 232 }, { 25, 231, 25, 231, 25, 231, 25, 231 },
+ { 26, 230, 26, 230, 26, 230, 26, 230 }, { 27, 229, 27, 229, 27, 229, 27, 229 },
+ { 28, 228, 28, 228, 28, 228, 28, 228 }, { 29, 227, 29, 227, 29, 227, 29, 227 },
+ { 30, 226, 30, 226, 30, 226, 30, 226 }, { 31, 225, 31, 225, 31, 225, 31, 225 },
+ { 32, 224, 32, 224, 32, 224, 32, 224 }, { 33, 223, 33, 223, 33, 223, 33, 223 },
+ { 34, 222, 34, 222, 34, 222, 34, 222 }, { 35, 221, 35, 221, 35, 221, 35, 221 },
+ { 36, 220, 36, 220, 36, 220, 36, 220 }, { 37, 219, 37, 219, 37, 219, 37, 219 },
+ { 38, 218, 38, 218, 38, 218, 38, 218 }, { 39, 217, 39, 217, 39, 217, 39, 217 },
+ { 40, 216, 40, 216, 40, 216, 40, 216 }, { 41, 215, 41, 215, 41, 215, 41, 215 },
+ { 42, 214, 42, 214, 42, 214, 42, 214 }, { 43, 213, 43, 213, 43, 213, 43, 213 },
+ { 44, 212, 44, 212, 44, 212, 44, 212 }, { 45, 211, 45, 211, 45, 211, 45, 211 },
+ { 46, 210, 46, 210, 46, 210, 46, 210 }, { 47, 209, 47, 209, 47, 209, 47, 209 },
+ { 48, 208, 48, 208, 48, 208, 48, 208 }, { 49, 207, 49, 207, 49, 207, 49, 207 },
+ { 50, 206, 50, 206, 50, 206, 50, 206 }, { 51, 205, 51, 205, 51, 205, 51, 205 },
+ { 52, 204, 52, 204, 52, 204, 52, 204 }, { 53, 203, 53, 203, 53, 203, 53, 203 },
+ { 54, 202, 54, 202, 54, 202, 54, 202 }, { 55, 201, 55, 201, 55, 201, 55, 201 },
+ { 56, 200, 56, 200, 56, 200, 56, 200 }, { 57, 199, 57, 199, 57, 199, 57, 199 },
+ { 58, 198, 58, 198, 58, 198, 58, 198 }, { 59, 197, 59, 197, 59, 197, 59, 197 },
+ { 60, 196, 60, 196, 60, 196, 60, 196 }, { 61, 195, 61, 195, 61, 195, 61, 195 },
+ { 62, 194, 62, 194, 62, 194, 62, 194 }, { 63, 193, 63, 193, 63, 193, 63, 193 },
+ { 64, 192, 64, 192, 64, 192, 64, 192 }, { 65, 191, 65, 191, 65, 191, 65, 191 },
+ { 66, 190, 66, 190, 66, 190, 66, 190 }, { 67, 189, 67, 189, 67, 189, 67, 189 },
+ { 68, 188, 68, 188, 68, 188, 68, 188 }, { 69, 187, 69, 187, 69, 187, 69, 187 },
+ { 70, 186, 70, 186, 70, 186, 70, 186 }, { 71, 185, 71, 185, 71, 185, 71, 185 },
+ { 72, 184, 72, 184, 72, 184, 72, 184 }, { 73, 183, 73, 183, 73, 183, 73, 183 },
+ { 74, 182, 74, 182, 74, 182, 74, 182 }, { 75, 181, 75, 181, 75, 181, 75, 181 },
+ { 76, 180, 76, 180, 76, 180, 76, 180 }, { 77, 179, 77, 179, 77, 179, 77, 179 },
+ { 78, 178, 78, 178, 78, 178, 78, 178 }, { 79, 177, 79, 177, 79, 177, 79, 177 },
+ { 80, 176, 80, 176, 80, 176, 80, 176 }, { 81, 175, 81, 175, 81, 175, 81, 175 },
+ { 82, 174, 82, 174, 82, 174, 82, 174 }, { 83, 173, 83, 173, 83, 173, 83, 173 },
+ { 84, 172, 84, 172, 84, 172, 84, 172 }, { 85, 171, 85, 171, 85, 171, 85, 171 },
+ { 86, 170, 86, 170, 86, 170, 86, 170 }, { 87, 169, 87, 169, 87, 169, 87, 169 },
+ { 88, 168, 88, 168, 88, 168, 88, 168 }, { 89, 167, 89, 167, 89, 167, 89, 167 },
+ { 90, 166, 90, 166, 90, 166, 90, 166 }, { 91, 165, 91, 165, 91, 165, 91, 165 },
+ { 92, 164, 92, 164, 92, 164, 92, 164 }, { 93, 163, 93, 163, 93, 163, 93, 163 },
+ { 94, 162, 94, 162, 94, 162, 94, 162 }, { 95, 161, 95, 161, 95, 161, 95, 161 },
+ { 96, 160, 96, 160, 96, 160, 96, 160 }, { 97, 159, 97, 159, 97, 159, 97, 159 },
+ { 98, 158, 98, 158, 98, 158, 98, 158 }, { 99, 157, 99, 157, 99, 157, 99, 157 },
+ { 100, 156, 100, 156, 100, 156, 100, 156 }, { 101, 155, 101, 155, 101, 155, 101, 155 },
+ { 102, 154, 102, 154, 102, 154, 102, 154 }, { 103, 153, 103, 153, 103, 153, 103, 153 },
+ { 104, 152, 104, 152, 104, 152, 104, 152 }, { 105, 151, 105, 151, 105, 151, 105, 151 },
+ { 106, 150, 106, 150, 106, 150, 106, 150 }, { 107, 149, 107, 149, 107, 149, 107, 149 },
+ { 108, 148, 108, 148, 108, 148, 108, 148 }, { 109, 147, 109, 147, 109, 147, 109, 147 },
+ { 110, 146, 110, 146, 110, 146, 110, 146 }, { 111, 145, 111, 145, 111, 145, 111, 145 },
+ { 112, 144, 112, 144, 112, 144, 112, 144 }, { 113, 143, 113, 143, 113, 143, 113, 143 },
+ { 114, 142, 114, 142, 114, 142, 114, 142 }, { 115, 141, 115, 141, 115, 141, 115, 141 },
+ { 116, 140, 116, 140, 116, 140, 116, 140 }, { 117, 139, 117, 139, 117, 139, 117, 139 },
+ { 118, 138, 118, 138, 118, 138, 118, 138 }, { 119, 137, 119, 137, 119, 137, 119, 137 },
+ { 120, 136, 120, 136, 120, 136, 120, 136 }, { 121, 135, 121, 135, 121, 135, 121, 135 },
+ { 122, 134, 122, 134, 122, 134, 122, 134 }, { 123, 133, 123, 133, 123, 133, 123, 133 },
+ { 124, 132, 124, 132, 124, 132, 124, 132 }, { 125, 131, 125, 131, 125, 131, 125, 131 },
+ { 126, 130, 126, 130, 126, 130, 126, 130 }, { 127, 129, 127, 129, 127, 129, 127, 129 },
+ { 128, 128, 128, 128, 128, 128, 128, 128 }, { 129, 127, 129, 127, 129, 127, 129, 127 },
+ { 130, 126, 130, 126, 130, 126, 130, 126 }, { 131, 125, 131, 125, 131, 125, 131, 125 },
+ { 132, 124, 132, 124, 132, 124, 132, 124 }, { 133, 123, 133, 123, 133, 123, 133, 123 },
+ { 134, 122, 134, 122, 134, 122, 134, 122 }, { 135, 121, 135, 121, 135, 121, 135, 121 },
+ { 136, 120, 136, 120, 136, 120, 136, 120 }, { 137, 119, 137, 119, 137, 119, 137, 119 },
+ { 138, 118, 138, 118, 138, 118, 138, 118 }, { 139, 117, 139, 117, 139, 117, 139, 117 },
+ { 140, 116, 140, 116, 140, 116, 140, 116 }, { 141, 115, 141, 115, 141, 115, 141, 115 },
+ { 142, 114, 142, 114, 142, 114, 142, 114 }, { 143, 113, 143, 113, 143, 113, 143, 113 },
+ { 144, 112, 144, 112, 144, 112, 144, 112 }, { 145, 111, 145, 111, 145, 111, 145, 111 },
+ { 146, 110, 146, 110, 146, 110, 146, 110 }, { 147, 109, 147, 109, 147, 109, 147, 109 },
+ { 148, 108, 148, 108, 148, 108, 148, 108 }, { 149, 107, 149, 107, 149, 107, 149, 107 },
+ { 150, 106, 150, 106, 150, 106, 150, 106 }, { 151, 105, 151, 105, 151, 105, 151, 105 },
+ { 152, 104, 152, 104, 152, 104, 152, 104 }, { 153, 103, 153, 103, 153, 103, 153, 103 },
+ { 154, 102, 154, 102, 154, 102, 154, 102 }, { 155, 101, 155, 101, 155, 101, 155, 101 },
+ { 156, 100, 156, 100, 156, 100, 156, 100 }, { 157, 99, 157, 99, 157, 99, 157, 99 },
+ { 158, 98, 158, 98, 158, 98, 158, 98 }, { 159, 97, 159, 97, 159, 97, 159, 97 },
+ { 160, 96, 160, 96, 160, 96, 160, 96 }, { 161, 95, 161, 95, 161, 95, 161, 95 },
+ { 162, 94, 162, 94, 162, 94, 162, 94 }, { 163, 93, 163, 93, 163, 93, 163, 93 },
+ { 164, 92, 164, 92, 164, 92, 164, 92 }, { 165, 91, 165, 91, 165, 91, 165, 91 },
+ { 166, 90, 166, 90, 166, 90, 166, 90 }, { 167, 89, 167, 89, 167, 89, 167, 89 },
+ { 168, 88, 168, 88, 168, 88, 168, 88 }, { 169, 87, 169, 87, 169, 87, 169, 87 },
+ { 170, 86, 170, 86, 170, 86, 170, 86 }, { 171, 85, 171, 85, 171, 85, 171, 85 },
+ { 172, 84, 172, 84, 172, 84, 172, 84 }, { 173, 83, 173, 83, 173, 83, 173, 83 },
+ { 174, 82, 174, 82, 174, 82, 174, 82 }, { 175, 81, 175, 81, 175, 81, 175, 81 },
+ { 176, 80, 176, 80, 176, 80, 176, 80 }, { 177, 79, 177, 79, 177, 79, 177, 79 },
+ { 178, 78, 178, 78, 178, 78, 178, 78 }, { 179, 77, 179, 77, 179, 77, 179, 77 },
+ { 180, 76, 180, 76, 180, 76, 180, 76 }, { 181, 75, 181, 75, 181, 75, 181, 75 },
+ { 182, 74, 182, 74, 182, 74, 182, 74 }, { 183, 73, 183, 73, 183, 73, 183, 73 },
+ { 184, 72, 184, 72, 184, 72, 184, 72 }, { 185, 71, 185, 71, 185, 71, 185, 71 },
+ { 186, 70, 186, 70, 186, 70, 186, 70 }, { 187, 69, 187, 69, 187, 69, 187, 69 },
+ { 188, 68, 188, 68, 188, 68, 188, 68 }, { 189, 67, 189, 67, 189, 67, 189, 67 },
+ { 190, 66, 190, 66, 190, 66, 190, 66 }, { 191, 65, 191, 65, 191, 65, 191, 65 },
+ { 192, 64, 192, 64, 192, 64, 192, 64 }, { 193, 63, 193, 63, 193, 63, 193, 63 },
+ { 194, 62, 194, 62, 194, 62, 194, 62 }, { 195, 61, 195, 61, 195, 61, 195, 61 },
+ { 196, 60, 196, 60, 196, 60, 196, 60 }, { 197, 59, 197, 59, 197, 59, 197, 59 },
+ { 198, 58, 198, 58, 198, 58, 198, 58 }, { 199, 57, 199, 57, 199, 57, 199, 57 },
+ { 200, 56, 200, 56, 200, 56, 200, 56 }, { 201, 55, 201, 55, 201, 55, 201, 55 },
+ { 202, 54, 202, 54, 202, 54, 202, 54 }, { 203, 53, 203, 53, 203, 53, 203, 53 },
+ { 204, 52, 204, 52, 204, 52, 204, 52 }, { 205, 51, 205, 51, 205, 51, 205, 51 },
+ { 206, 50, 206, 50, 206, 50, 206, 50 }, { 207, 49, 207, 49, 207, 49, 207, 49 },
+ { 208, 48, 208, 48, 208, 48, 208, 48 }, { 209, 47, 209, 47, 209, 47, 209, 47 },
+ { 210, 46, 210, 46, 210, 46, 210, 46 }, { 211, 45, 211, 45, 211, 45, 211, 45 },
+ { 212, 44, 212, 44, 212, 44, 212, 44 }, { 213, 43, 213, 43, 213, 43, 213, 43 },
+ { 214, 42, 214, 42, 214, 42, 214, 42 }, { 215, 41, 215, 41, 215, 41, 215, 41 },
+ { 216, 40, 216, 40, 216, 40, 216, 40 }, { 217, 39, 217, 39, 217, 39, 217, 39 },
+ { 218, 38, 218, 38, 218, 38, 218, 38 }, { 219, 37, 219, 37, 219, 37, 219, 37 },
+ { 220, 36, 220, 36, 220, 36, 220, 36 }, { 221, 35, 221, 35, 221, 35, 221, 35 },
+ { 222, 34, 222, 34, 222, 34, 222, 34 }, { 223, 33, 223, 33, 223, 33, 223, 33 },
+ { 224, 32, 224, 32, 224, 32, 224, 32 }, { 225, 31, 225, 31, 225, 31, 225, 31 },
+ { 226, 30, 226, 30, 226, 30, 226, 30 }, { 227, 29, 227, 29, 227, 29, 227, 29 },
+ { 228, 28, 228, 28, 228, 28, 228, 28 }, { 229, 27, 229, 27, 229, 27, 229, 27 },
+ { 230, 26, 230, 26, 230, 26, 230, 26 }, { 231, 25, 231, 25, 231, 25, 231, 25 },
+ { 232, 24, 232, 24, 232, 24, 232, 24 }, { 233, 23, 233, 23, 233, 23, 233, 23 },
+ { 234, 22, 234, 22, 234, 22, 234, 22 }, { 235, 21, 235, 21, 235, 21, 235, 21 },
+ { 236, 20, 236, 20, 236, 20, 236, 20 }, { 237, 19, 237, 19, 237, 19, 237, 19 },
+ { 238, 18, 238, 18, 238, 18, 238, 18 }, { 239, 17, 239, 17, 239, 17, 239, 17 },
+ { 240, 16, 240, 16, 240, 16, 240, 16 }, { 241, 15, 241, 15, 241, 15, 241, 15 },
+ { 242, 14, 242, 14, 242, 14, 242, 14 }, { 243, 13, 243, 13, 243, 13, 243, 13 },
+ { 244, 12, 244, 12, 244, 12, 244, 12 }, { 245, 11, 245, 11, 245, 11, 245, 11 },
+ { 246, 10, 246, 10, 246, 10, 246, 10 }, { 247, 9, 247, 9, 247, 9, 247, 9 },
+ { 248, 8, 248, 8, 248, 8, 248, 8 }, { 249, 7, 249, 7, 249, 7, 249, 7 },
+ { 250, 6, 250, 6, 250, 6, 250, 6 }, { 251, 5, 251, 5, 251, 5, 251, 5 },
+ { 252, 4, 252, 4, 252, 4, 252, 4 }, { 253, 3, 253, 3, 253, 3, 253, 3 },
+ { 254, 2, 254, 2, 254, 2, 254, 2 }, { 255, 1, 255, 1, 255, 1, 255, 1 }
+};
+
+
+/***************************************************************************
+ HIGHER LEVEL OPERATIONS
+***************************************************************************/
+
+void rgbaint_t::blend(const rgbaint_t& other, UINT8 factor)
+{
+ const VECU32 shift = vec_splat_u32(-16);
+ const VECS32 scale1 = { factor, factor, factor, factor };
+ const VECS32 scale2 = { 0x100 - factor, 0x100 - factor, 0x100 - factor, 0x100 - factor, };
+
+ VECU32 temp = vec_msum((VECU16)m_value, (VECU16)vec_rl(scale1, shift), vec_splat_u32(0));
+ temp = vec_msum((VECU16)other.m_value, (VECU16)vec_rl(scale2, shift), temp);
+
+ m_value = vec_msum((VECU16)m_value, (VECU16)scale1, vec_mulo((VECU16)other.m_value, (VECU16)scale2));
+ m_value = vec_add(vec_sl(temp, shift), (VECU32)m_value);
+ sra_imm(8);
+}
+
+void rgbaint_t::scale_and_clamp(const rgbaint_t& scale)
+{
+ mul(scale);
+ sra_imm(8);
+ max(0);
+ min(255);
+}
+
+void rgbaint_t::scale_imm_and_clamp(const INT32 scale)
+{
+ mul_imm(scale);
+ sra_imm(8);
+ max(0);
+ min(255);
+}
+
+void rgbaint_t::scale2_add_and_clamp(const rgbaint_t& scale, const rgbaint_t& other, const rgbaint_t& scale2)
+{
+ rgbaint_t color2(other);
+ color2.mul(scale2);
+
+ mul(scale);
+ add(color2);
+ sra_imm(8);
+ max(0);
+ min(255);
+}
+
+void rgbaint_t::scale_imm_add_and_clamp(const INT32 scale, const rgbaint_t& other)
+{
+ mul_imm(scale);
+ sra_imm(8);
+ add(other);
+ max(0);
+ min(255);
+}
+
+void rgbaint_t::scale_add_and_clamp(const rgbaint_t& scale, const rgbaint_t& other)
+{
+ mul(scale);
+ sra_imm(8);
+ add(other);
+ max(0);
+ min(255);
+}
+
+#endif // defined(__ALTIVEC__)
diff --git a/src/emu/video/rgbvmx.h b/src/emu/video/rgbvmx.h
index a0f40eee330..10c235eaa5a 100644
--- a/src/emu/video/rgbvmx.h
+++ b/src/emu/video/rgbvmx.h
@@ -1,5 +1,5 @@
// license:BSD-3-Clause
-// copyright-holders:Vas Crabb
+// copyright-holders:Vas Crabb, Ryan Holtz
/***************************************************************************
rgbvmx.h
@@ -11,425 +11,493 @@
#ifndef __RGBVMX__
#define __RGBVMX__
-#if defined(__ALTIVEC__)
#include <altivec.h>
-#endif
-
/***************************************************************************
TYPE DEFINITIONS
***************************************************************************/
-/* intermediate RGB values are stored in a vector */
-typedef vector signed short rgbint;
-
-/* intermediate RGB values are stored in a vector */
-typedef vector signed short rgbaint;
-
-
-
-/***************************************************************************
- BASIC CONVERSIONS
-***************************************************************************/
-
-/*-------------------------------------------------
- rgb_comp_to_rgbint - converts a trio of RGB
- components to an rgbint type
--------------------------------------------------*/
-
-INLINE void rgb_comp_to_rgbint(rgbint *rgb, INT16 r, INT16 g, INT16 b)
+class rgbaint_t
{
- rgbint result = { 0, r, g, b, 0, 0, 0, 0 };
- *rgb = result;
-}
+public:
+ inline rgbaint_t() { }
+ inline rgbaint_t(UINT32 rgba) { set(rgba); }
+ inline rgbaint_t(INT32 a, INT32 r, INT32 g, INT32 b) { set(a, r, g, b); }
+ inline rgbaint_t(rgb_t& rgb) { set(rgb); }
+
+ inline void set(rgbaint_t& other) { m_value = other.m_value; }
+
+ inline void set(UINT32 rgba)
+ {
+ const VECU32 zero = { 0, 0, 0, 0 };
+ const VECS8 temp = vec_perm(vec_lde(0, &rgba), zero, vec_lvsl(0, &rgba));
+ m_value = vec_mergeh((VECS16)zero, (VECS16)vec_mergeh((VECS8)zero, temp));
+ }
+
+ inline void set(INT32 a, INT32 r, INT32 g, INT32 b)
+ {
+ VECS32 result = { a, r, g, b };
+ m_value = result;
+ }
+
+ inline void set(rgb_t& rgb)
+ {
+ const VECU32 zero = { 0, 0, 0, 0 };
+ const VECS8 temp = vec_perm(vec_lde(0, rgb.ptr()), zero, vec_lvsl(0, rgb.ptr()));
+ m_value = vec_mergeh((VECS16)zero, (VECS16)vec_mergeh((VECS8)zero, temp));
+ }
+
+ inline rgb_t to_rgba()
+ {
+ VECU32 temp = vec_pack(m_value, m_value);
+ temp = vec_pack((VECU16)temp, (VECU16)temp);
+ UINT32 result;
+ vec_ste(temp, 0, &result);
+ return result;
+ }
+
+ inline rgb_t to_rgba_clamp()
+ {
+ VECU32 temp = vec_packs(m_value, m_value);
+ temp = vec_packsu((VECU16)temp, (VECU16)temp);
+ UINT32 result;
+ vec_ste(temp, 0, &result);
+ return result;
+ }
+
+ inline void add(const rgbaint_t& color2)
+ {
+ m_value = vec_add(m_value, color2.m_value);
+ }
+
+ inline void add_imm(const INT32 imm)
+ {
+ const VECS32 temp = { imm, imm, imm, imm };
+ m_value = vec_add(m_value, temp);
+ }
+
+ inline void add_imm_rgba(const INT32 a, const INT32 r, const INT32 g, const INT32 b)
+ {
+ const VECS32 temp = { a, r, g, b };
+ m_value = vec_add(m_value, temp);
+ }
+
+ inline void sub(const rgbaint_t& color2)
+ {
+ m_value = vec_sub(m_value, color2.m_value);
+ }
+
+ inline void sub_imm(const INT32 imm)
+ {
+ const VECS32 temp = { imm, imm, imm, imm };
+ m_value = vec_sub(m_value, temp);
+ }
+
+ inline void sub_imm_rgba(const INT32 a, const INT32 r, const INT32 g, const INT32 b)
+ {
+ const VECS32 temp = { a, r, g, b };
+ m_value = vec_sub(m_value, temp);
+ }
+
+ inline void subr(rgbaint_t& color2)
+ {
+ m_value = vec_sub(color2.m_value, m_value);
+ }
+
+ inline void subr_imm(const INT32 imm)
+ {
+ const VECS32 temp = { imm, imm, imm, imm };
+ m_value = vec_sub(temp, m_value);
+ }
+
+ inline void subr_imm_rgba(const INT32 a, const INT32 r, const INT32 g, const INT32 b)
+ {
+ const VECS32 temp = { a, r, g, b };
+ m_value = vec_sub(temp, m_value);
+ }
+
+ inline void set_a(const INT32 value)
+ {
+ const VECS32 temp = { value, value, value, value };
+ m_value = vec_perm(m_value, temp, alpha_perm);
+ }
+
+ inline void set_r(const INT32 value)
+ {
+ const VECS32 temp = { value, value, value, value };
+ m_value = vec_perm(m_value, temp, red_perm);
+ }
+
+ inline void set_g(const INT32 value)
+ {
+ const VECS32 temp = { value, value, value, value };
+ m_value = vec_perm(m_value, temp, green_perm);
+ }
+
+ inline void set_b(const INT32 value)
+ {
+ const VECS32 temp = { value, value, value, value };
+ m_value = vec_perm(m_value, temp, blue_perm);
+ }
+
+ inline UINT8 get_a() const
+ {
+ UINT8 result;
+ vec_ste(vec_splat((VECU8)m_value, 3), 0, &result);
+ return result;
+ }
+
+ inline UINT8 get_r() const
+ {
+ UINT8 result;
+ vec_ste(vec_splat((VECU8)m_value, 7), 0, &result);
+ return result;
+ }
+
+ inline UINT8 get_g() const
+ {
+ UINT8 result;
+ vec_ste(vec_splat((VECU8)m_value, 11), 0, &result);
+ return result;
+ }
+
+ inline UINT8 get_b() const
+ {
+ UINT8 result;
+ vec_ste(vec_splat((VECU8)m_value, 15), 0, &result);
+ return result;
+ }
+
+ inline INT32 get_a32() const
+ {
+ INT32 result;
+ vec_ste(vec_splat(m_value, 0), 0, &result);
+ return result;
+ }
+
+ inline INT32 get_r32() const
+ {
+ INT32 result;
+ vec_ste(vec_splat(m_value, 1), 0, &result);
+ return result;
+ }
+
+ inline INT32 get_g32() const
+ {
+ INT32 result;
+ vec_ste(vec_splat(m_value, 2), 0, &result);
+ return result;
+ }
+
+ inline INT32 get_b32() const
+ {
+ INT32 result;
+ vec_ste(vec_splat(m_value, 3), 0, &result);
+ return result;
+ }
+
+ inline void mul(const rgbaint_t& color)
+ {
+ const VECU32 shift = vec_splat_u32(-16);
+ const VECU32 temp = vec_msum((VECU16)m_value, (VECU16)vec_rl(color.m_value, shift), vec_splat_u32(0));
+ m_value = vec_add(vec_sl(temp, shift), vec_mulo((VECU16)m_value, (VECU16)color.m_value));
+ }
+
+ inline void mul_imm(const INT32 imm)
+ {
+ const VECU32 value = { imm, imm, imm, imm };
+ const VECU32 shift = vec_splat_u32(-16);
+ const VECU32 temp = vec_msum((VECU16)m_value, (VECU16)vec_rl(value, shift), vec_splat_u32(0));
+ m_value = vec_add(vec_sl(temp, shift), vec_mulo((VECU16)m_value, (VECU16)value));
+ }
+
+ inline void mul_imm_rgba(const INT32 a, const INT32 r, const INT32 g, const INT32 b)
+ {
+ const VECU32 value = { a, r, g, b };
+ const VECU32 shift = vec_splat_u32(-16);
+ const VECU32 temp = vec_msum((VECU16)m_value, (VECU16)vec_rl(value, shift), vec_splat_u32(0));
+ m_value = vec_add(vec_sl(temp, shift), vec_mulo((VECU16)m_value, (VECU16)value));
+ }
+
+ inline void shl(const rgbaint_t& shift)
+ {
+ const VECU32 limit = { 32, 32, 32, 32 };
+ const VECU32 temp = vec_splat(shift.m_value, 3);
+ m_value = vec_and(vec_sl(m_value, temp), vec_cmpgt(limit, temp));
+ }
+
+ inline void shl_imm(const UINT8 shift)
+ {
+ const VECU32 temp = { shift, shift, shift, shift };
+ m_value = vec_sl(m_value, temp);
+ }
+
+ inline void shr(const rgbaint_t& shift)
+ {
+ const VECU32 limit = { 32, 32, 32, 32 };
+ const VECU32 temp = vec_splat(shift.m_value, 3);
+ m_value = vec_and(vec_sr(m_value, temp), vec_cmpgt(limit, temp));
+ }
+
+ inline void shr_imm(const UINT8 shift)
+ {
+ const VECU32 temp = { shift, shift, shift, shift };
+ m_value = vec_sr(m_value, temp);
+ }
+
+ inline void sra(const rgbaint_t& shift)
+ {
+ const VECU32 limit = { 31, 31, 31, 31 };
+ m_value = vec_sra(m_value, vec_min((VECU32)vec_splat(shift.m_value, 3), limit));
+ }
+
+ inline void sra_imm(const UINT8 shift)
+ {
+ const VECU32 temp = { shift, shift, shift, shift };
+ m_value = vec_sra(m_value, temp);
+ }
+
+ inline void or_reg(const rgbaint_t& color2)
+ {
+ m_value = vec_or(m_value, color2.m_value);
+ }
+
+ inline void or_imm(const INT32 value)
+ {
+ const VECS32 temp = { value, value, value, value };
+ m_value = vec_or(m_value, temp);
+ }
+
+ inline void or_imm_rgba(const INT32 a, const INT32 r, const INT32 g, const INT32 b)
+ {
+ const VECS32 temp = { a, r, g, b };
+ m_value = vec_or(m_value, temp);
+ }
+
+ inline void and_reg(const rgbaint_t& color)
+ {
+ m_value = vec_and(m_value, color.m_value);
+ }
+
+ inline void and_imm(const INT32 value)
+ {
+ const VECS32 temp = { value, value, value, value };
+ m_value = vec_and(m_value, temp);
+ }
+
+ inline void and_imm_rgba(const INT32 a, const INT32 r, const INT32 g, const INT32 b)
+ {
+ const VECS32 temp = { a, r, g, b };
+ m_value = vec_and(m_value, temp);
+ }
+
+ inline void xor_reg(const rgbaint_t& color2)
+ {
+ m_value = vec_xor(m_value, color2.m_value);
+ }
+
+ inline void xor_imm(const INT32 value)
+ {
+ const VECS32 temp = { value, value, value, value };
+ m_value = vec_xor(m_value, temp);
+ }
+
+ inline void xor_imm_rgba(const INT32 a, const INT32 r, const INT32 g, const INT32 b)
+ {
+ const VECS32 temp = { a, r, g, b };
+ m_value = vec_xor(m_value, temp);
+ }
+
+ inline void clamp_and_clear(const UINT32 sign)
+ {
+ const VECS32 vzero = { 0, 0, 0, 0 };
+ VECS32 vsign = { sign, sign, sign, sign };
+ m_value = vec_and(m_value, vec_cmpeq(vec_and(m_value, vsign), vzero));
+ vsign = vec_nor(vec_sra(vsign, vec_splat_u32(1)), vzero);
+ const VECS32 mask = vec_cmpgt(m_value, vsign);
+ m_value = vec_or(vec_and(vsign, mask), vec_and(m_value, vec_nor(mask, vzero)));
+ }
+
+ inline void sign_extend(const UINT32 compare, const UINT32 sign)
+ {
+ const VECS32 compare_vec = { compare, compare, compare, compare };
+ const VECS32 compare_mask = vec_cmpeq(vec_and(m_value, compare_vec), compare_vec);
+ const VECS32 sign_vec = { sign, sign, sign, sign };
+ m_value = vec_or(m_value, vec_and(sign_vec, compare_mask));
+ }
+
+ inline void min(const INT32 value)
+ {
+ const VECS32 temp = { value, value, value, value };
+ m_value = vec_min(m_value, temp);
+ }
+
+ inline void max(const INT32 value)
+ {
+ const VECS32 temp = { value, value, value, value };
+ m_value = vec_max(m_value, temp);
+ }
+
+ void blend(const rgbaint_t& other, UINT8 factor);
+
+ void scale_and_clamp(const rgbaint_t& scale);
+ void scale_imm_and_clamp(const INT32 scale);
+ void scale2_add_and_clamp(const rgbaint_t& scale, const rgbaint_t& other, const rgbaint_t& scale2);
+ void scale_add_and_clamp(const rgbaint_t& scale, const rgbaint_t& other);
+ void scale_imm_add_and_clamp(const INT32 scale, const rgbaint_t& other);
+
+ inline void cmpeq(const rgbaint_t& value)
+ {
+ m_value = vec_cmpeq(m_value, value.m_value);
+ }
+
+ inline void cmpeq_imm(const INT32 value)
+ {
+ const VECS32 temp = { value, value, value, value };
+ m_value = vec_cmpeq(m_value, temp);
+ }
+
+ inline void cmpeq_imm_rgba(const INT32 a, const INT32 r, const INT32 g, const INT32 b)
+ {
+ const VECS32 temp = { a, r, g, b };
+ m_value = vec_cmpeq(m_value, temp);
+ }
+
+ inline void cmpgt(const rgbaint_t& value)
+ {
+ m_value = vec_cmpgt(m_value, value.m_value);
+ }
+
+ inline void cmpgt_imm(const INT32 value)
+ {
+ const VECS32 temp = { value, value, value, value };
+ m_value = vec_cmpgt(m_value, temp);
+ }
+
+ inline void cmpgt_imm_rgba(const INT32 a, const INT32 r, const INT32 g, const INT32 b)
+ {
+ const VECS32 temp = { a, r, g, b };
+ m_value = vec_cmpgt(m_value, temp);
+ }
+
+ inline void cmplt(const rgbaint_t& value)
+ {
+ m_value = vec_cmplt(m_value, value.m_value);
+ }
+
+ inline void cmplt_imm(const INT32 value)
+ {
+ const VECS32 temp = { value, value, value, value };
+ m_value = vec_cmplt(m_value, temp);
+ }
+
+ inline void cmplt_imm_rgba(const INT32 a, const INT32 r, const INT32 g, const INT32 b)
+ {
+ const VECS32 temp = { a, r, g, b };
+ m_value = vec_cmplt(m_value, temp);
+ }
+
+ inline rgbaint_t operator=(const rgbaint_t& other)
+ {
+ m_value = other.m_value;
+ return *this;
+ }
+
+ inline rgbaint_t& operator+=(const rgbaint_t& other)
+ {
+ m_value = vec_add(m_value, other.m_value);
+ return *this;
+ }
+
+ inline rgbaint_t& operator+=(const INT32 other)
+ {
+ const VECS32 temp = { other, other, other, other };
+ m_value = vec_add(m_value, temp);
+ return *this;
+ }
+
+ inline rgbaint_t& operator-=(const rgbaint_t& other)
+ {
+ m_value = vec_sub(m_value, other.m_value);
+ return *this;
+ }
+
+ inline rgbaint_t& operator*=(const rgbaint_t& other)
+ {
+ const VECU32 shift = vec_splat_u32(-16);
+ const VECU32 temp = vec_msum((VECU16)m_value, (VECU16)vec_rl(other.m_value, shift), vec_splat_u32(0));
+ m_value = vec_add(vec_sl(temp, shift), vec_mulo((VECU16)m_value, (VECU16)other.m_value));
+ return *this;
+ }
+
+ inline rgbaint_t& operator*=(const INT32 other)
+ {
+ const VECS32 value = { other, other, other, other };
+ const VECU32 shift = vec_splat_u32(-16);
+ const VECU32 temp = vec_msum((VECU16)m_value, (VECU16)vec_rl(value, shift), vec_splat_u32(0));
+ m_value = vec_add(vec_sl(temp, shift), vec_mulo((VECU16)m_value, (VECU16)value));
+ return *this;
+ }
+
+ inline rgbaint_t& operator>>=(const INT32 shift)
+ {
+ const VECU32 temp = { shift, shift, shift, shift };
+ m_value = vec_sra(m_value, temp);
+ return *this;
+ }
+
+ inline void merge_alpha(const rgbaint_t& alpha)
+ {
+ m_value = vec_perm(m_value, alpha.m_value, alpha_perm);
+ }
+
+ static UINT32 bilinear_filter(UINT32 rgb00, UINT32 rgb01, UINT32 rgb10, UINT32 rgb11, UINT8 u, UINT8 v)
+ {
+ const VECS32 zero = vec_splat_s32(0);
+
+ VECS32 color00 = vec_perm((VECS32)vec_lde(0, &rgb00), zero, vec_lvsl(0, &rgb00));
+ VECS32 color01 = vec_perm((VECS32)vec_lde(0, &rgb01), zero, vec_lvsl(0, &rgb01));
+ VECS32 color10 = vec_perm((VECS32)vec_lde(0, &rgb10), zero, vec_lvsl(0, &rgb10));
+ VECS32 color11 = vec_perm((VECS32)vec_lde(0, &rgb11), zero, vec_lvsl(0, &rgb11));
+
+ /* interleave color01 and color00 at the byte level */
+ color01 = vec_mergeh((VECU8)color01, (VECU8)color00);
+ color11 = vec_mergeh((VECU8)color11, (VECU8)color10);
+ color01 = vec_mergeh((VECU8)zero, (VECU8)color01);
+ color11 = vec_mergeh((VECU8)zero, (VECU8)color11);
+ color01 = vec_msum((VECS16)color01, scale_table[u], zero);
+ color11 = vec_msum((VECS16)color11, scale_table[u], zero);
+ color01 = vec_sl(color01, vec_splat_u32(15));
+ color11 = vec_sr(color11, vec_splat_u32(1));
+ color01 = vec_max((VECS16)color01, (VECS16)color11);
+ color01 = vec_msum((VECS16)color01, scale_table[v], zero);
+ color01 = vec_sr(color01, vec_splat_u32(15));
+ color01 = vec_packs(color01, color01);
+ color01 = vec_packsu((VECS16)color01, (VECS16)color01);
+
+ UINT32 result;
+ vec_ste((VECU32)color01, 0, &result);
+ return result;
+ }
+
+protected:
+ typedef __vector signed char VECS8;
+ typedef __vector unsigned char VECU8;
+ typedef __vector signed short VECS16;
+ typedef __vector unsigned short VECU16;
+ typedef __vector signed int VECS32;
+ typedef __vector unsigned int VECU32;
+
+ VECS32 m_value;
+
+ static const VECU8 alpha_perm;
+ static const VECU8 red_perm;
+ static const VECU8 green_perm;
+ static const VECU8 blue_perm;
+ static const VECS16 scale_table[256];
+};
-/*-------------------------------------------------
- rgba_comp_to_rgbint - converts a quad of RGB
- components to an rgbint type
--------------------------------------------------*/
-
-INLINE void rgba_comp_to_rgbaint(rgbaint *rgb, INT16 a, INT16 r, INT16 g, INT16 b)
-{
- rgbaint result = { a, r, g, b, 0, 0, 0, 0 };
- *rgb = result;
-}
-
-
-/*-------------------------------------------------
- rgb_to_rgbint - converts a packed trio of RGB
- components to an rgbint type
--------------------------------------------------*/
-
-INLINE void rgb_to_rgbint(rgbint *rgb, rgb_t const &color)
-{
- vector signed char temp = (vector signed char)vec_perm((vector signed int)vec_lde(0, color.ptr()), vec_splat_s32(0), vec_lvsl(0, color.ptr()));
- *rgb = (rgbint)vec_mergeh((vector signed char)vec_splat_s32(0), temp);
-}
-
-
-/*-------------------------------------------------
- rgba_to_rgbaint - converts a packed quad of RGB
- components to an rgbint type
--------------------------------------------------*/
-
-INLINE void rgba_to_rgbaint(rgbaint *rgb, rgb_t const &color)
-{
- vector signed char temp = (vector signed char)vec_perm((vector signed int)vec_lde(0, color.ptr()), vec_splat_s32(0), vec_lvsl(0, color.ptr()));
- *rgb = (rgbaint)vec_mergeh((vector signed char)vec_splat_s32(0), temp);
-}
-
-
-/*-------------------------------------------------
- rgbint_to_rgb - converts an rgbint back to
- a packed trio of RGB values
--------------------------------------------------*/
-
-INLINE rgb_t rgbint_to_rgb(const rgbint *color)
-{
- vector unsigned int temp = vec_splat((vector unsigned int)vec_packsu(*color, *color), 0);
- UINT32 result;
- vec_ste(temp, 0, &result);
- return result;
-}
-
-
-/*-------------------------------------------------
- rgbaint_to_rgba - converts an rgbint back to
- a packed quad of RGB values
--------------------------------------------------*/
-
-INLINE rgb_t rgbaint_to_rgba(const rgbaint *color)
-{
- vector unsigned int temp = vec_splat((vector unsigned int)vec_packsu(*color, *color), 0);
- UINT32 result;
- vec_ste(temp, 0, &result);
- return result;
-}
-
-
-/*-------------------------------------------------
- rgbint_to_rgb_clamp - converts an rgbint back
- to a packed trio of RGB values, clamping them
- to bytes first
--------------------------------------------------*/
-
-INLINE rgb_t rgbint_to_rgb_clamp(const rgbint *color)
-{
- vector unsigned int temp = vec_splat((vector unsigned int)vec_packsu(*color, *color), 0);
- UINT32 result;
- vec_ste(temp, 0, &result);
- return result;
-}
-
-
-/*-------------------------------------------------
- rgbaint_to_rgba_clamp - converts an rgbint back
- to a packed quad of RGB values, clamping them
- to bytes first
--------------------------------------------------*/
-
-INLINE rgb_t rgbaint_to_rgba_clamp(const rgbaint *color)
-{
- vector unsigned int temp = vec_splat((vector unsigned int)vec_packsu(*color, *color), 0);
- UINT32 result;
- vec_ste(temp, 0, &result);
- return result;
-}
-
-
-
-/***************************************************************************
- CORE MATH
-***************************************************************************/
-
-/*-------------------------------------------------
- rgbint_add - add two rgbint values
--------------------------------------------------*/
-
-INLINE void rgbint_add(rgbint *color1, const rgbint *color2)
-{
- *color1 = vec_add(*color1, *color2);
-}
-
-
-/*-------------------------------------------------
- rgbaint_add - add two rgbaint values
--------------------------------------------------*/
-
-INLINE void rgbaint_add(rgbaint *color1, const rgbaint *color2)
-{
- *color1 = vec_add(*color1, *color2);
-}
-
-
-/*-------------------------------------------------
- rgbint_sub - subtract two rgbint values
--------------------------------------------------*/
-
-INLINE void rgbint_sub(rgbint *color1, const rgbint *color2)
-{
- *color1 = vec_sub(*color1, *color2);
-}
-
-
-/*-------------------------------------------------
- rgbaint_sub - subtract two rgbaint values
--------------------------------------------------*/
-
-INLINE void rgbaint_sub(rgbaint *color1, const rgbaint *color2)
-{
- *color1 = vec_sub(*color1, *color2);
-}
-
-
-/*-------------------------------------------------
- rgbint_subr - reverse subtract two rgbint
- values
--------------------------------------------------*/
-
-INLINE void rgbint_subr(rgbint *color1, const rgbint *color2)
-{
- *color1 = vec_sub(*color2, *color1);
-}
-
-
-/*-------------------------------------------------
- rgbaint_subr - reverse subtract two rgbaint
- values
--------------------------------------------------*/
-
-INLINE void rgbaint_subr(rgbaint *color1, const rgbaint *color2)
-{
- *color1 = vec_sub(*color2, *color1);
-}
-
-
-
-/***************************************************************************
- TABLES
-***************************************************************************/
-
-extern const struct _rgbvmx_statics
-{
- rgbaint maxbyte;
- rgbaint scale_table[256];
-} rgbvmx_statics;
-
-
-
-/***************************************************************************
- HIGHER LEVEL OPERATIONS
-***************************************************************************/
-
-/*-------------------------------------------------
- rgbint_blend - blend two colors by the given
- scale factor
--------------------------------------------------*/
-
-INLINE void rgbint_blend(rgbint *color1, const rgbint *color2, UINT8 color1scale)
-{
- vector signed int temp;
- *color1 = vec_mergeh(*color1, *color2);
- temp = vec_msum(*color1, rgbvmx_statics.scale_table[color1scale], vec_splat_s32(0));
- temp = (vector signed int)vec_sr(temp, vec_splat_u32(8));
- *color1 = vec_packs(temp, temp);
-}
-
-
-/*-------------------------------------------------
- rgbaint_blend - blend two colors by the given
- scale factor
--------------------------------------------------*/
-
-INLINE void rgbaint_blend(rgbaint *color1, const rgbaint *color2, UINT8 color1scale)
-{
- vector signed int temp;
- *color1 = vec_mergeh(*color1, *color2);
- temp = vec_msum(*color1, rgbvmx_statics.scale_table[color1scale], vec_splat_s32(0));
- temp = (vector signed int)vec_sr(temp, vec_splat_u32(8));
- *color1 = vec_packs(temp, temp);
-}
-
-
-/*-------------------------------------------------
- rgbint_scale_and_clamp - scale the given
- color by an 8.8 scale factor, immediate or
- per channel, and clamp to byte values
--------------------------------------------------*/
-
-INLINE void rgbint_scale_immediate_and_clamp(rgbint *color, INT16 colorscale)
-{
- rgbint splatmap = vec_splat((rgbint)vec_lvsl(0, &colorscale), 0);
- rgbint vecscale = vec_lde(0, &colorscale);
- vector signed int temp;
- vecscale = (rgbint)vec_perm(vecscale, vecscale, (vector unsigned char)splatmap);
- *color = (rgbint)vec_mergeh(*color, (rgbint)vec_splat_s32(0));
- temp = vec_msum(*color, vecscale, vec_splat_s32(0));
- temp = (vector signed int)vec_sr(temp, vec_splat_u32(8));
- *color = vec_min(vec_packs(temp, temp), rgbvmx_statics.maxbyte);
-}
-
-INLINE void rgbint_scale_channel_and_clamp(rgbint *color, const rgbint *colorscale)
-{
- rgbint vecscale = (rgbint)vec_mergeh(*colorscale, (rgbint)vec_splat_s32(0));
- vector signed int temp;
- *color = (rgbint)vec_mergeh(*color, (rgbint)vec_splat_s32(0));
- temp = vec_msum(*color, vecscale, vec_splat_s32(0));
- temp = (vector signed int)vec_sr(temp, vec_splat_u32(8));
- *color = vec_min(vec_packs(temp, temp), rgbvmx_statics.maxbyte);
-}
-
-
-/*-------------------------------------------------
- rgbaint_scale_and_clamp - scale the given
- color by an 8.8 scale factor, immediate or
- per channel, and clamp to byte values
--------------------------------------------------*/
-
-INLINE void rgbaint_scale_immediate_and_clamp(rgbaint *color, INT16 colorscale)
-{
- rgbaint splatmap = vec_splat((rgbaint)vec_lvsl(0, &colorscale), 0);
- rgbaint vecscale = vec_lde(0, &colorscale);
- vector signed int temp;
- vecscale = (rgbaint)vec_perm(vecscale, vecscale, (vector unsigned char)splatmap);
- *color = (rgbaint)vec_mergeh(*color, (rgbaint)vec_splat_s32(0));
- temp = vec_msum(*color, vecscale, vec_splat_s32(0));
- temp = (vector signed int)vec_sr(temp, vec_splat_u32(8));
- *color = vec_min(vec_packs(temp, temp), rgbvmx_statics.maxbyte);
-}
-
-INLINE void rgbaint_scale_channel_and_clamp(rgbaint *color, const rgbint *colorscale)
-{
- rgbaint vecscale = (rgbaint)vec_mergeh(*color, (rgbaint)vec_splat_s32(0));
- vector signed int temp;
- *color = (rgbaint)vec_mergeh(*color, (rgbaint)vec_splat_s32(0));
- temp = vec_msum(*color, vecscale, vec_splat_s32(0));
- temp = (vector signed int)vec_sr(temp, vec_splat_u32(8));
- *color = vec_min(vec_packs(temp, temp), rgbvmx_statics.maxbyte);
-}
-
-
-/*-------------------------------------------------
- rgb_bilinear_filter - bilinear filter between
- four pixel values
--------------------------------------------------*/
-
-INLINE rgb_t rgb_bilinear_filter(rgb_t const &rgb00, rgb_t const &rgb01, rgb_t const &rgb10, rgb_t const &rgb11, UINT8 u, UINT8 v)
-{
- rgbint color00 = (rgbint)vec_perm((vector signed int)vec_lde(0, rgb00.ptr()), vec_splat_s32(0), vec_lvsl(0, rgb00.ptr()));
- rgbint color01 = (rgbint)vec_perm((vector signed int)vec_lde(0, rgb01.ptr()), vec_splat_s32(0), vec_lvsl(0, rgb01.ptr()));
- rgbint color10 = (rgbint)vec_perm((vector signed int)vec_lde(0, rgb10.ptr()), vec_splat_s32(0), vec_lvsl(0, rgb10.ptr()));
- rgbint color11 = (rgbint)vec_perm((vector signed int)vec_lde(0, rgb11.ptr()), vec_splat_s32(0), vec_lvsl(0, rgb11.ptr()));
-
- /* interleave color01 and color00 at the byte level */
- color01 = (rgbint)vec_mergeh((vector signed char)color01, (vector signed char)color00);
- color11 = (rgbint)vec_mergeh((vector signed char)color11, (vector signed char)color10);
- color01 = (rgbint)vec_mergeh((vector signed char)vec_splat_s32(0), (vector signed char)color01);
- color11 = (rgbint)vec_mergeh((vector signed char)vec_splat_s32(0), (vector signed char)color11);
- color01 = (rgbint)vec_msum(color01, rgbvmx_statics.scale_table[u], vec_splat_s32(0));
- color11 = (rgbint)vec_msum(color11, rgbvmx_statics.scale_table[u], vec_splat_s32(0));
- color01 = (rgbint)vec_sr((vector signed int)color01, vec_splat_u32(1));
- color11 = (rgbint)vec_sl((vector signed int)color11, vec_splat_u32(15));
- color01 = vec_max(color01, color11);
- color01 = (rgbint)vec_msum(color01, rgbvmx_statics.scale_table[v], vec_splat_s32(0));
- color01 = (rgbint)vec_sr((vector signed int)color01, vec_splat_u32(15));
- color01 = vec_packs((vector signed int)color01, (vector signed int)color01);
- color01 = (rgbint)vec_packsu(color01, color01);
-
- UINT32 result;
- vec_ste((vector unsigned int)color01, 0, &result);
- return result;
-}
-
-
-/*-------------------------------------------------
- rgba_bilinear_filter - bilinear filter between
- four pixel values
--------------------------------------------------*/
-
-INLINE rgb_t rgba_bilinear_filter(rgb_t const &rgb00, rgb_t const &rgb01, rgb_t const &rgb10, rgb_t const &rgb11, UINT8 u, UINT8 v)
-{
- rgbaint color00 = (rgbaint)vec_perm((vector signed int)vec_lde(0, rgb00.ptr()), vec_splat_s32(0), vec_lvsl(0, rgb00.ptr()));
- rgbaint color01 = (rgbaint)vec_perm((vector signed int)vec_lde(0, rgb01.ptr()), vec_splat_s32(0), vec_lvsl(0, rgb01.ptr()));
- rgbaint color10 = (rgbaint)vec_perm((vector signed int)vec_lde(0, rgb10.ptr()), vec_splat_s32(0), vec_lvsl(0, rgb10.ptr()));
- rgbaint color11 = (rgbaint)vec_perm((vector signed int)vec_lde(0, rgb11.ptr()), vec_splat_s32(0), vec_lvsl(0, rgb11.ptr()));
-
- /* interleave color01 and color00 at the byte level */
- color01 = (rgbaint)vec_mergeh((vector signed char)color01, (vector signed char)color00);
- color11 = (rgbaint)vec_mergeh((vector signed char)color11, (vector signed char)color10);
- color01 = (rgbaint)vec_mergeh((vector signed char)vec_splat_s32(0), (vector signed char)color01);
- color11 = (rgbaint)vec_mergeh((vector signed char)vec_splat_s32(0), (vector signed char)color11);
- color01 = (rgbaint)vec_msum(color01, rgbvmx_statics.scale_table[u], vec_splat_s32(0));
- color11 = (rgbaint)vec_msum(color11, rgbvmx_statics.scale_table[u], vec_splat_s32(0));
- color01 = (rgbaint)vec_sr((vector signed int)color01, vec_splat_u32(1));
- color11 = (rgbaint)vec_sl((vector signed int)color11, vec_splat_u32(15));
- color01 = vec_max(color01, color11);
- color01 = (rgbaint)vec_msum(color01, rgbvmx_statics.scale_table[v], vec_splat_s32(0));
- color01 = (rgbaint)vec_sr((vector signed int)color01, vec_splat_u32(15));
- color01 = vec_packs((vector signed int)color01, (vector signed int)color01);
- color01 = (rgbaint)vec_packsu(color01, color01);
-
- UINT32 result;
- vec_ste((vector unsigned int)color01, 0, &result);
- return result;
-}
-
-
-/*-------------------------------------------------
- rgbint_bilinear_filter - bilinear filter between
- four pixel values
--------------------------------------------------*/
-
-INLINE void rgbint_bilinear_filter(rgbint *color, rgb_t const &rgb00, rgb_t const &rgb01, rgb_t const &rgb10, rgb_t const &rgb11, UINT8 u, UINT8 v)
-{
- rgbint color00 = (rgbint)vec_perm((vector signed int)vec_lde(0, rgb00.ptr()), vec_splat_s32(0), vec_lvsl(0, rgb00.ptr()));
- rgbint color01 = (rgbint)vec_perm((vector signed int)vec_lde(0, rgb01.ptr()), vec_splat_s32(0), vec_lvsl(0, rgb01.ptr()));
- rgbint color10 = (rgbint)vec_perm((vector signed int)vec_lde(0, rgb10.ptr()), vec_splat_s32(0), vec_lvsl(0, rgb10.ptr()));
- rgbint color11 = (rgbint)vec_perm((vector signed int)vec_lde(0, rgb11.ptr()), vec_splat_s32(0), vec_lvsl(0, rgb11.ptr()));
-
- /* interleave color01 and color00 at the byte level */
- color01 = (rgbint)vec_mergeh((vector signed char)color01, (vector signed char)color00);
- color11 = (rgbint)vec_mergeh((vector signed char)color11, (vector signed char)color10);
- color01 = (rgbint)vec_mergeh((vector signed char)vec_splat_s32(0), (vector signed char)color01);
- color11 = (rgbint)vec_mergeh((vector signed char)vec_splat_s32(0), (vector signed char)color11);
- color01 = (rgbint)vec_msum(color01, rgbvmx_statics.scale_table[u], vec_splat_s32(0));
- color11 = (rgbint)vec_msum(color11, rgbvmx_statics.scale_table[u], vec_splat_s32(0));
- color01 = (rgbint)vec_sr((vector signed int)color01, vec_splat_u32(1));
- color11 = (rgbint)vec_sl((vector signed int)color11, vec_splat_u32(15));
- color01 = vec_max(color01, color11);
- color01 = (rgbint)vec_msum(color01, rgbvmx_statics.scale_table[v], vec_splat_s32(0));
- color01 = (rgbint)vec_sr((vector signed int)color01, vec_splat_u32(15));
- *color = vec_packs((vector signed int)color01, (vector signed int)color01);
-}
-
-
-/*-------------------------------------------------
- rgbaint_bilinear_filter - bilinear filter between
- four pixel values
--------------------------------------------------*/
-
-INLINE void rgbaint_bilinear_filter(rgbaint *color, rgb_t const &rgb00, rgb_t const &rgb01, rgb_t const &rgb10, rgb_t const &rgb11, UINT8 u, UINT8 v)
-{
- rgbaint color00 = (rgbaint)vec_perm((vector signed int)vec_lde(0, rgb00.ptr()), vec_splat_s32(0), vec_lvsl(0, rgb00.ptr()));
- rgbaint color01 = (rgbaint)vec_perm((vector signed int)vec_lde(0, rgb01.ptr()), vec_splat_s32(0), vec_lvsl(0, rgb01.ptr()));
- rgbaint color10 = (rgbaint)vec_perm((vector signed int)vec_lde(0, rgb10.ptr()), vec_splat_s32(0), vec_lvsl(0, rgb10.ptr()));
- rgbaint color11 = (rgbaint)vec_perm((vector signed int)vec_lde(0, rgb11.ptr()), vec_splat_s32(0), vec_lvsl(0, rgb11.ptr()));
-
- /* interleave color01 and color00 at the byte level */
- color01 = (rgbaint)vec_mergeh((vector signed char)color01, (vector signed char)color00);
- color11 = (rgbaint)vec_mergeh((vector signed char)color11, (vector signed char)color10);
- color01 = (rgbaint)vec_mergeh((vector signed char)vec_splat_s32(0), (vector signed char)color01);
- color11 = (rgbaint)vec_mergeh((vector signed char)vec_splat_s32(0), (vector signed char)color11);
- color01 = (rgbaint)vec_msum(color01, rgbvmx_statics.scale_table[u], vec_splat_s32(0));
- color11 = (rgbaint)vec_msum(color11, rgbvmx_statics.scale_table[u], vec_splat_s32(0));
- color01 = (rgbaint)vec_sr((vector signed int)color01, vec_splat_u32(1));
- color11 = (rgbaint)vec_sl((vector signed int)color11, vec_splat_u32(15));
- color01 = vec_max(color01, color11);
- color01 = (rgbaint)vec_msum(color01, rgbvmx_statics.scale_table[v], vec_splat_s32(0));
- color01 = (rgbaint)vec_sr((vector signed int)color01, vec_splat_u32(15));
- *color = vec_packs((vector signed int)color01, (vector signed int)color01);
-}
// altivec.h somehow redefines "bool" in a bad way on PowerPC Mac OS X. really.
#ifdef OSX_PPC
diff --git a/src/emu/video/tms3556.c b/src/emu/video/tms3556.c
index 819e18840d8..9d073bdbe0d 100644
--- a/src/emu/video/tms3556.c
+++ b/src/emu/video/tms3556.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Raphael Nabet
/*
tms3556 emulation
diff --git a/src/emu/video/tms3556.h b/src/emu/video/tms3556.h
index 8c153ab2d5b..a331b8333e3 100644
--- a/src/emu/video/tms3556.h
+++ b/src/emu/video/tms3556.h
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Raphael Nabet
/***************************************************************************
diff --git a/src/emu/video/tms9928a.c b/src/emu/video/tms9928a.c
index 23ee5998b8d..8e8b672f8e4 100644
--- a/src/emu/video/tms9928a.c
+++ b/src/emu/video/tms9928a.c
@@ -82,6 +82,34 @@ tms9928a_device::tms9928a_device( const machine_config &mconfig, const char *tag
// static_set_addrmap(*this, AS_DATA, ADDRESS_MAP_NAME(memmap));
}
+tms9129_device::tms9129_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : tms9928a_device( mconfig, TMS9129, "TMS9129", tag, owner, clock, true, true, false, "tms9129", __FILE__)
+{ }
+
+tms9918_device::tms9918_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : tms9928a_device( mconfig, TMS9918, "TMS9918", tag, owner, clock, false, false, true, "tms9918", __FILE__)
+{ }
+
+tms9918a_device::tms9918a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : tms9928a_device( mconfig, TMS9918A, "TMS9918A", tag, owner, clock, false, true, true, "tms9918a", __FILE__)
+{ }
+
+tms9118_device::tms9118_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : tms9928a_device( mconfig, TMS9118, "TMS9118 VDP", tag, owner, clock, false, true, false, "tms9118", __FILE__)
+{ }
+
+tms9128_device::tms9128_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : tms9928a_device( mconfig, TMS9128, "TMS9128 VDP", tag, owner, clock, false, true, false, "tms9128", __FILE__)
+{ }
+
+tms9929_device::tms9929_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : tms9928a_device( mconfig, TMS9929, "TMS9929", tag, owner, clock, true, false, true, "tms9929", __FILE__)
+{ }
+
+tms9929a_device::tms9929a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : tms9928a_device( mconfig, TMS9929A, "TMS9929A", tag, owner, clock, true, true, true, "tms9929a", __FILE__)
+{ }
+
READ8_MEMBER( tms9928a_device::vram_read )
{
diff --git a/src/emu/video/tms9928a.h b/src/emu/video/tms9928a.h
index db47dffcf40..b87807782d1 100644
--- a/src/emu/video/tms9928a.h
+++ b/src/emu/video/tms9928a.h
@@ -158,56 +158,49 @@ private:
class tms9918_device : public tms9928a_device
{
public:
- tms9918_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : tms9928a_device( mconfig, TMS9918, "TMS9918", tag, owner, clock, false, false, true, "tms9918", __FILE__) { }
+ tms9918_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
class tms9918a_device : public tms9928a_device
{
public:
- tms9918a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : tms9928a_device( mconfig, TMS9918A, "TMS9918A", tag, owner, clock, false, true, true, "tms9918a", __FILE__) { }
+ tms9918a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
class tms9118_device : public tms9928a_device
{
public:
- tms9118_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : tms9928a_device( mconfig, TMS9118, "TMS9118 VDP", tag, owner, clock, false, true, false, "tms9118", __FILE__) { }
+ tms9118_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
class tms9128_device : public tms9928a_device
{
public:
- tms9128_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : tms9928a_device( mconfig, TMS9128, "TMS9128 VDP", tag, owner, clock, false, true, false, "tms9128", __FILE__) { }
+ tms9128_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
class tms9929_device : public tms9928a_device
{
public:
- tms9929_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : tms9928a_device( mconfig, TMS9929, "TMS9929", tag, owner, clock, true, false, true, "tms9929", __FILE__) { }
+ tms9929_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
class tms9929a_device : public tms9928a_device
{
public:
- tms9929a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : tms9928a_device( mconfig, TMS9929A, "TMS9929A", tag, owner, clock, true, true, true, "tms9929a", __FILE__) { }
+ tms9929a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
class tms9129_device : public tms9928a_device
{
public:
- tms9129_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : tms9928a_device( mconfig, TMS9129, "TMS9129", tag, owner, clock, true, true, false, "tms9129", __FILE__) { }
+ tms9129_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
diff --git a/src/emu/video/v9938.c b/src/emu/video/v9938.c
index 40e13ec4d6f..3192593e76a 100644
--- a/src/emu/video/v9938.c
+++ b/src/emu/video/v9938.c
@@ -37,8 +37,13 @@ enum
V9938_MODE_UNKNOWN
};
+#define MODEL_V9938 (0)
+#define MODEL_V9958 (1)
+
#define EXPMEM_OFFSET 0x20000
+#define LONG_WIDTH (512 + 32)
+
static const char *const v9938_modes[] = {
"TEXT 1", "MULTICOLOR", "GRAPHIC 1", "GRAPHIC 2", "GRAPHIC 3",
"GRAPHIC 4", "GRAPHIC 5", "GRAPHIC 6", "GRAPHIC 7", "TEXT 2",
@@ -86,10 +91,6 @@ v99x8_device::v99x8_device(const machine_config &mconfig, device_type type, cons
m_scanline(0),
m_blink(0),
m_blink_count(0),
- m_size(0),
- m_size_old(0),
- m_size_auto(0),
- m_size_now(0),
m_mx_delta(0),
m_my_delta(0),
m_button_state(0),
@@ -166,19 +167,6 @@ int v99x8_device::interrupt ()
return m_int_state;
}
-void v99x8_device::set_resolution (int i)
-{
- if (i == RENDER_AUTO)
- {
- m_size_auto = 1;
- }
- else
- {
- m_size = i;
- m_size_auto = 0;
- }
-}
-
/*
Not really right... won't work with sprites in graphics 7
and with palette updated mid-screen
@@ -569,7 +557,6 @@ void v99x8_device::device_start()
m_vdp_engine = NULL;
m_screen->register_screen_bitmap(m_bitmap);
- m_size_old = -1;
// Video RAM is allocated as an own address space
m_vram_space = &space(AS_DATA);
@@ -602,10 +589,6 @@ void v99x8_device::device_start()
save_item(NAME(m_scanline));
save_item(NAME(m_blink));
save_item(NAME(m_blink_count));
- save_item(NAME(m_size));
- save_item(NAME(m_size_old));
- save_item(NAME(m_size_auto));
- save_item(NAME(m_size_now));
save_item(NAME(m_mx_delta));
save_item(NAME(m_my_delta));
save_item(NAME(m_button_state));
@@ -876,67 +859,43 @@ inline bool v99x8_device::v9938_second_field()
return !(((m_cont_reg[9] & 0x04) && !(m_stat_reg[2] & 2)) || m_blink);
}
-/*
-* This file is included for a number of different situations:
-* _Width : can be 512 + 32 or 256 + 16
-* V9938_BPP : can be 8 or 16
-*/
-
-template<typename _PixelType, int _Width>
-void v99x8_device::default_border(const pen_t *pens, _PixelType *ln)
+void v99x8_device::default_border(const pen_t *pens, UINT16 *ln)
{
- _PixelType pen;
+ UINT16 pen;
int i;
pen = pens[m_pal_ind16[(m_cont_reg[7]&0x0f)]];
- i = _Width;
+ i = LONG_WIDTH;
while (i--) *ln++ = pen;
-
- if (m_size_now != RENDER_HIGH) m_size_now = RENDER_LOW;
}
-template<typename _PixelType, int _Width>
-void v99x8_device::graphic7_border(const pen_t *pens, _PixelType *ln)
+void v99x8_device::graphic7_border(const pen_t *pens, UINT16 *ln)
{
- _PixelType pen;
+ UINT16 pen;
int i;
pen = pens[m_pal_ind256[m_cont_reg[7]]];
- i = _Width;
+ i = LONG_WIDTH;
while (i--) *ln++ = pen;
-
- if (m_size_now != RENDER_HIGH) m_size_now = RENDER_LOW;
}
-template<typename _PixelType, int _Width>
-void v99x8_device::graphic5_border(const pen_t *pens, _PixelType *ln)
+void v99x8_device::graphic5_border(const pen_t *pens, UINT16 *ln)
{
int i;
- _PixelType pen0;
- if (_Width > 512)
- {
- _PixelType pen1;
+ UINT16 pen0;
+ UINT16 pen1;
- pen1 = pens[m_pal_ind16[(m_cont_reg[7]&0x03)]];
- pen0 = pens[m_pal_ind16[((m_cont_reg[7]>>2)&0x03)]];
- i = (_Width) / 2;
- while (i--) { *ln++ = pen0; *ln++ = pen1; }
- }
- else
- {
- pen0 = pens[m_pal_ind16[((m_cont_reg[7]>>2)&0x03)]];
- i = _Width;
- while (i--) *ln++ = pen0;
- }
- m_size_now = RENDER_HIGH;
+ pen1 = pens[m_pal_ind16[(m_cont_reg[7]&0x03)]];
+ pen0 = pens[m_pal_ind16[((m_cont_reg[7]>>2)&0x03)]];
+ i = LONG_WIDTH / 2;
+ while (i--) { *ln++ = pen0; *ln++ = pen1; }
}
-template<typename _PixelType, int _Width>
-void v99x8_device::mode_text1(const pen_t *pens, _PixelType *ln, int line)
+void v99x8_device::mode_text1(const pen_t *pens, UINT16 *ln, int line)
{
int pattern, x, xx, name, xxx;
- _PixelType fg, bg, pen;
+ UINT16 fg, bg, pen;
int nametbl_addr, patterntbl_addr;
patterntbl_addr = m_cont_reg[4] << 11;
@@ -949,9 +908,7 @@ void v99x8_device::mode_text1(const pen_t *pens, _PixelType *ln, int line)
pen = pens[m_pal_ind16[(m_cont_reg[7]&0x0f)]];
- xxx = m_offset_x + 8;
- if (_Width > 512)
- xxx *= 2;
+ xxx = (m_offset_x + 8) * 2;
while (xxx--) *ln++ = pen;
for (x=0;x<40;x++)
@@ -961,26 +918,21 @@ void v99x8_device::mode_text1(const pen_t *pens, _PixelType *ln, int line)
for (xx=0;xx<6;xx++)
{
*ln++ = (pattern & 0x80) ? fg : bg;
- if (_Width > 512)
- *ln++ = (pattern & 0x80) ? fg : bg;
+ *ln++ = (pattern & 0x80) ? fg : bg;
pattern <<= 1;
}
/* width height 212, characters start repeating at the bottom */
name = (name + 1) & 0x3ff;
}
- xxx = (16 - m_offset_x) + 8;
- if (_Width > 512)
- xxx *= 2;
+ xxx = ((16 - m_offset_x) + 8) * 2;
while (xxx--) *ln++ = pen;
- if (m_size_now != RENDER_HIGH) m_size_now = RENDER_LOW;
}
-template<typename _PixelType, int _Width>
-void v99x8_device::mode_text2(const pen_t *pens, _PixelType *ln, int line)
+void v99x8_device::mode_text2(const pen_t *pens, UINT16 *ln, int line)
{
int pattern, x, charcode, name, xxx, patternmask, colourmask;
- _PixelType fg, bg, fg0, bg0, pen;
+ UINT16 fg, bg, fg0, bg0, pen;
int nametbl_addr, patterntbl_addr, colourtbl_addr;
patterntbl_addr = m_cont_reg[4] << 11;
@@ -1000,10 +952,8 @@ void v99x8_device::mode_text2(const pen_t *pens, _PixelType *ln, int line)
name = (line/8)*80;
- xxx = m_offset_x + 8;
+ xxx = (m_offset_x + 8) * 2;
pen = pens[m_pal_ind16[(m_cont_reg[7]&0x0f)]];
- if (_Width > 512)
- xxx *= 2;
while (xxx--) *ln++ = pen;
for (x=0;x<80;x++)
@@ -1017,21 +967,12 @@ void v99x8_device::mode_text2(const pen_t *pens, _PixelType *ln, int line)
pattern = m_vram_space->read_byte(patterntbl_addr + ((charcode * 8) +
((line + m_cont_reg[23]) & 7)));
- if (_Width > 512)
- {
- *ln++ = (pattern & 0x80) ? fg0 : bg0;
- *ln++ = (pattern & 0x40) ? fg0 : bg0;
- *ln++ = (pattern & 0x20) ? fg0 : bg0;
- *ln++ = (pattern & 0x10) ? fg0 : bg0;
- *ln++ = (pattern & 0x08) ? fg0 : bg0;
- *ln++ = (pattern & 0x04) ? fg0 : bg0;
- }
- else
- {
- *ln++ = (pattern & 0x80) ? fg0 : bg0;
- *ln++ = (pattern & 0x20) ? fg0 : bg0;
- *ln++ = (pattern & 0x08) ? fg0 : bg0;
- }
+ *ln++ = (pattern & 0x80) ? fg0 : bg0;
+ *ln++ = (pattern & 0x40) ? fg0 : bg0;
+ *ln++ = (pattern & 0x20) ? fg0 : bg0;
+ *ln++ = (pattern & 0x10) ? fg0 : bg0;
+ *ln++ = (pattern & 0x08) ? fg0 : bg0;
+ *ln++ = (pattern & 0x04) ? fg0 : bg0;
name++;
continue;
@@ -1041,38 +982,25 @@ void v99x8_device::mode_text2(const pen_t *pens, _PixelType *ln, int line)
pattern = m_vram_space->read_byte(patterntbl_addr + ((charcode * 8) +
((line + m_cont_reg[23]) & 7)));
- if (_Width > 512)
- {
- *ln++ = (pattern & 0x80) ? fg : bg;
- *ln++ = (pattern & 0x40) ? fg : bg;
- *ln++ = (pattern & 0x20) ? fg : bg;
- *ln++ = (pattern & 0x10) ? fg : bg;
- *ln++ = (pattern & 0x08) ? fg : bg;
- *ln++ = (pattern & 0x04) ? fg : bg;
- }
- else
- {
- *ln++ = (pattern & 0x80) ? fg : bg;
- *ln++ = (pattern & 0x20) ? fg : bg;
- *ln++ = (pattern & 0x08) ? fg : bg;
- }
+ *ln++ = (pattern & 0x80) ? fg : bg;
+ *ln++ = (pattern & 0x40) ? fg : bg;
+ *ln++ = (pattern & 0x20) ? fg : bg;
+ *ln++ = (pattern & 0x10) ? fg : bg;
+ *ln++ = (pattern & 0x08) ? fg : bg;
+ *ln++ = (pattern & 0x04) ? fg : bg;
name++;
}
- xxx = 16 - m_offset_x + 8;
- if (_Width > 512)
- xxx *= 2;
+ xxx = (16 - m_offset_x + 8) * 2;
while (xxx--) *ln++ = pen;
- m_size_now = RENDER_HIGH;
}
-template<typename _PixelType, int _Width>
-void v99x8_device::mode_multi(const pen_t *pens, _PixelType *ln, int line)
+void v99x8_device::mode_multi(const pen_t *pens, UINT16 *ln, int line)
{
int nametbl_addr, patterntbl_addr, colour;
int name, line2, x, xx;
- _PixelType pen, pen_bg;
+ UINT16 pen, pen_bg;
nametbl_addr = (m_cont_reg[2] << 10);
patterntbl_addr = (m_cont_reg[4] << 11);
@@ -1081,10 +1009,7 @@ void v99x8_device::mode_multi(const pen_t *pens, _PixelType *ln, int line)
name = (line2/8)*32;
pen_bg = pens[m_pal_ind16[(m_cont_reg[7]&0x0f)]];
- if (_Width < 512)
- xx = m_offset_x;
- else
- xx = m_offset_x * 2;
+ xx = m_offset_x * 2;
while (xx--) *ln++ = pen_bg;
for (x=0;x<32;x++)
@@ -1096,40 +1021,30 @@ void v99x8_device::mode_multi(const pen_t *pens, _PixelType *ln, int line)
*ln++ = pen;
*ln++ = pen;
*ln++ = pen;
- if (_Width > 512)
- {
- *ln++ = pen;
- *ln++ = pen;
- *ln++ = pen;
- *ln++ = pen;
- }
+ *ln++ = pen;
+ *ln++ = pen;
+ *ln++ = pen;
+ *ln++ = pen;
pen = pens[m_pal_ind16[colour&15]];
/* eight pixels */
*ln++ = pen;
*ln++ = pen;
*ln++ = pen;
*ln++ = pen;
- if (_Width > 512)
- {
- *ln++ = pen;
- *ln++ = pen;
- *ln++ = pen;
- *ln++ = pen;
- }
+ *ln++ = pen;
+ *ln++ = pen;
+ *ln++ = pen;
+ *ln++ = pen;
name++;
}
- xx = 16 - m_offset_x;
- if (_Width > 512)
- xx *= 2;
+ xx = (16 - m_offset_x) * 2;
while (xx--) *ln++ = pen_bg;
- if (m_size_now != RENDER_HIGH) m_size_now = RENDER_LOW;
}
-template<typename _PixelType, int _Width>
-void v99x8_device::mode_graphic1(const pen_t *pens, _PixelType *ln, int line)
+void v99x8_device::mode_graphic1(const pen_t *pens, UINT16 *ln, int line)
{
- _PixelType fg, bg, pen;
+ UINT16 fg, bg, pen;
int nametbl_addr, patterntbl_addr, colourtbl_addr;
int pattern, x, xx, line2, name, charcode, colour, xxx;
@@ -1142,10 +1057,7 @@ void v99x8_device::mode_graphic1(const pen_t *pens, _PixelType *ln, int line)
name = (line2/8)*32;
pen = pens[m_pal_ind16[(m_cont_reg[7]&0x0f)]];
- if (_Width < 512)
- xxx = m_offset_x;
- else
- xxx = m_offset_x * 2;
+ xxx = m_offset_x * 2;
while (xxx--) *ln++ = pen;
for (x=0;x<32;x++)
@@ -1159,30 +1071,25 @@ void v99x8_device::mode_graphic1(const pen_t *pens, _PixelType *ln, int line)
for (xx=0;xx<8;xx++)
{
*ln++ = (pattern & 0x80) ? fg : bg;
- if (_Width > 512)
- *ln++ = (pattern & 0x80) ? fg : bg;
+ *ln++ = (pattern & 0x80) ? fg : bg;
pattern <<= 1;
}
name++;
}
- xx = 16 - m_offset_x;
- if (_Width > 512)
- xx *= 2;
+ xx = (16 - m_offset_x) * 2;
while (xx--) *ln++ = pen;
- if (m_size_now != RENDER_HIGH) m_size_now = RENDER_LOW;
}
-template<typename _PixelType, int _Width>
-void v99x8_device::mode_graphic23(const pen_t *pens, _PixelType *ln, int line)
+void v99x8_device::mode_graphic23(const pen_t *pens, UINT16 *ln, int line)
{
- _PixelType fg, bg, pen;
+ UINT16 fg, bg, pen;
int nametbl_addr, patterntbl_addr, colourtbl_addr;
int pattern, x, xx, line2, name, charcode,
colour, colourmask, patternmask, xxx;
- colourmask = (m_cont_reg[3] & 0x7f) * 8 | 7;
- patternmask = (m_cont_reg[4] & 0x03) * 256 | (colourmask & 255);
+ colourmask = ((m_cont_reg[3] & 0x7f) * 8) | 7;
+ patternmask = ((m_cont_reg[4] & 0x03) * 256) | 0xff;
nametbl_addr = (m_cont_reg[2] << 10);
colourtbl_addr = ((m_cont_reg[3] & 0x80) << 6) + (m_cont_reg[10] << 14);
@@ -1192,10 +1099,7 @@ void v99x8_device::mode_graphic23(const pen_t *pens, _PixelType *ln, int line)
name = (line2/8)*32;
pen = pens[m_pal_ind16[(m_cont_reg[7]&0x0f)]];
- if (_Width < 512)
- xxx = m_offset_x;
- else
- xxx = m_offset_x * 2;
+ xxx = m_offset_x * 2;
while (xxx--) *ln++ = pen;
for (x=0;x<32;x++)
@@ -1208,26 +1112,21 @@ void v99x8_device::mode_graphic23(const pen_t *pens, _PixelType *ln, int line)
for (xx=0;xx<8;xx++)
{
*ln++ = (pattern & 0x80) ? fg : bg;
- if (_Width > 512)
- *ln++ = (pattern & 0x80) ? fg : bg;
+ *ln++ = (pattern & 0x80) ? fg : bg;
pattern <<= 1;
}
name++;
}
- xx = 16 - m_offset_x;
- if (_Width > 512)
- xx *= 2;
+ xx = (16 - m_offset_x) * 2;
while (xx--) *ln++ = pen;
- if (m_size_now != RENDER_HIGH) m_size_now = RENDER_LOW;
}
-template<typename _PixelType, int _Width>
-void v99x8_device::mode_graphic4(const pen_t *pens, _PixelType *ln, int line)
+void v99x8_device::mode_graphic4(const pen_t *pens, UINT16 *ln, int line)
{
int nametbl_addr, colour;
int line2, linemask, x, xx;
- _PixelType pen, pen_bg;
+ UINT16 pen, pen_bg;
linemask = ((m_cont_reg[2] & 0x1f) << 3) | 7;
@@ -1238,10 +1137,7 @@ void v99x8_device::mode_graphic4(const pen_t *pens, _PixelType *ln, int line)
nametbl_addr += 0x8000;
pen_bg = pens[m_pal_ind16[(m_cont_reg[7]&0x0f)]];
- if (_Width < 512)
- xx = m_offset_x;
- else
- xx = m_offset_x * 2;
+ xx = m_offset_x * 2;
while (xx--) *ln++ = pen_bg;
for (x=0;x<128;x++)
@@ -1249,28 +1145,22 @@ void v99x8_device::mode_graphic4(const pen_t *pens, _PixelType *ln, int line)
colour = m_vram_space->read_byte(nametbl_addr++);
pen = pens[m_pal_ind16[colour>>4]];
*ln++ = pen;
- if (_Width > 512)
- *ln++ = pen;
+ *ln++ = pen;
pen = pens[m_pal_ind16[colour&15]];
*ln++ = pen;
- if (_Width > 512)
- *ln++ = pen;
+ *ln++ = pen;
}
- xx = 16 - m_offset_x;
- if (_Width > 512)
- xx *= 2;
+ xx = (16 - m_offset_x) * 2;
while (xx--) *ln++ = pen_bg;
- if (m_size_now != RENDER_HIGH) m_size_now = RENDER_LOW;
}
-template<typename _PixelType, int _Width>
-void v99x8_device::mode_graphic5(const pen_t *pens, _PixelType *ln, int line)
+void v99x8_device::mode_graphic5(const pen_t *pens, UINT16 *ln, int line)
{
int nametbl_addr, colour;
int line2, linemask, x, xx;
- _PixelType pen_bg0[4];
- _PixelType pen_bg1[4];
+ UINT16 pen_bg0[4];
+ UINT16 pen_bg1[4];
linemask = ((m_cont_reg[2] & 0x1f) << 3) | 7;
@@ -1280,70 +1170,42 @@ void v99x8_device::mode_graphic5(const pen_t *pens, _PixelType *ln, int line)
if ( (m_cont_reg[2] & 0x20) && v9938_second_field() )
nametbl_addr += 0x8000;
- if (_Width > 512)
- {
- pen_bg1[0] = pens[m_pal_ind16[(m_cont_reg[7]&0x03)]];
- pen_bg0[0] = pens[m_pal_ind16[((m_cont_reg[7]>>2)&0x03)]];
-
- xx = m_offset_x;
- while (xx--) { *ln++ = pen_bg0[0]; *ln++ = pen_bg1[0]; }
-
- x = (m_cont_reg[8] & 0x20) ? 0 : 1;
-
- for (;x<4;x++)
- {
- pen_bg0[x] = pens[m_pal_ind16[x]];
- pen_bg1[x] = pens[m_pal_ind16[x]];
- }
+ pen_bg1[0] = pens[m_pal_ind16[(m_cont_reg[7]&0x03)]];
+ pen_bg0[0] = pens[m_pal_ind16[((m_cont_reg[7]>>2)&0x03)]];
- for (x=0;x<128;x++)
- {
- colour = m_vram_space->read_byte(nametbl_addr++);
+ xx = m_offset_x;
+ while (xx--) { *ln++ = pen_bg0[0]; *ln++ = pen_bg1[0]; }
- *ln++ = pen_bg0[colour>>6];
- *ln++ = pen_bg1[(colour>>4)&3];
- *ln++ = pen_bg0[(colour>>2)&3];
- *ln++ = pen_bg1[(colour&3)];
- }
+ x = (m_cont_reg[8] & 0x20) ? 0 : 1;
- pen_bg1[0] = pens[m_pal_ind16[(m_cont_reg[7]&0x03)]];
- pen_bg0[0] = pens[m_pal_ind16[((m_cont_reg[7]>>2)&0x03)]];
- xx = 16 - m_offset_x;
- while (xx--) { *ln++ = pen_bg0[0]; *ln++ = pen_bg1[0]; }
- }
- else
+ for (;x<4;x++)
{
- pen_bg0[0] = pens[m_pal_ind16[((m_cont_reg[7]>>2)&0x03)]];
-
- x = (m_cont_reg[8] & 0x20) ? 0 : 1;
-
- for (;x<4;x++)
- pen_bg0[x] = pens[m_pal_ind16[x]];
-
- xx = m_offset_x;
- while (xx--) *ln++ = pen_bg0[0];
+ pen_bg0[x] = pens[m_pal_ind16[x]];
+ pen_bg1[x] = pens[m_pal_ind16[x]];
+ }
- for (x=0;x<128;x++)
- {
- colour = m_vram_space->read_byte(nametbl_addr++);
- *ln++ = pen_bg0[colour>>6];
- *ln++ = pen_bg0[(colour>>2)&3];
- }
+ for (x=0;x<128;x++)
+ {
+ colour = m_vram_space->read_byte(nametbl_addr++);
- pen_bg0[0] = pens[m_pal_ind16[((m_cont_reg[7]>>2)&0x03)]];
- xx = 16 - m_offset_x;
- while (xx--) *ln++ = pen_bg0[0];
+ *ln++ = pen_bg0[colour>>6];
+ *ln++ = pen_bg1[(colour>>4)&3];
+ *ln++ = pen_bg0[(colour>>2)&3];
+ *ln++ = pen_bg1[(colour&3)];
}
- m_size_now = RENDER_HIGH;
+
+ pen_bg1[0] = pens[m_pal_ind16[(m_cont_reg[7]&0x03)]];
+ pen_bg0[0] = pens[m_pal_ind16[((m_cont_reg[7]>>2)&0x03)]];
+ xx = 16 - m_offset_x;
+ while (xx--) { *ln++ = pen_bg0[0]; *ln++ = pen_bg1[0]; }
}
-template<typename _PixelType, int _Width>
-void v99x8_device::mode_graphic6(const pen_t *pens, _PixelType *ln, int line)
+void v99x8_device::mode_graphic6(const pen_t *pens, UINT16 *ln, int line)
{
UINT8 colour;
int line2, linemask, x, xx, nametbl_addr;
- _PixelType pen_bg, fg0;
- _PixelType fg1;
+ UINT16 pen_bg, fg0;
+ UINT16 fg1;
linemask = ((m_cont_reg[2] & 0x1f) << 3) | 7;
@@ -1354,10 +1216,7 @@ void v99x8_device::mode_graphic6(const pen_t *pens, _PixelType *ln, int line)
nametbl_addr += 0x10000;
pen_bg = pens[m_pal_ind16[(m_cont_reg[7]&0x0f)]];
- if (_Width < 512)
- xx = m_offset_x;
- else
- xx = m_offset_x * 2;
+ xx = m_offset_x * 2;
while (xx--) *ln++ = pen_bg;
if (m_cont_reg[2] & 0x40)
@@ -1367,21 +1226,11 @@ void v99x8_device::mode_graphic6(const pen_t *pens, _PixelType *ln, int line)
nametbl_addr++;
colour = m_vram_space->read_byte(((nametbl_addr&1) << 16) | (nametbl_addr>>1));
fg0 = pens[m_pal_ind16[colour>>4]];
- if (_Width < 512)
- {
- *ln++ = fg0; *ln++ = fg0;
- *ln++ = fg0; *ln++ = fg0;
- *ln++ = fg0; *ln++ = fg0;
- *ln++ = fg0; *ln++ = fg0;
- }
- else
- {
- fg1 = pens[m_pal_ind16[colour&15]];
- *ln++ = fg0; *ln++ = fg1; *ln++ = fg0; *ln++ = fg1;
- *ln++ = fg0; *ln++ = fg1; *ln++ = fg0; *ln++ = fg1;
- *ln++ = fg0; *ln++ = fg1; *ln++ = fg0; *ln++ = fg1;
- *ln++ = fg0; *ln++ = fg1; *ln++ = fg0; *ln++ = fg1;
- }
+ fg1 = pens[m_pal_ind16[colour&15]];
+ *ln++ = fg0; *ln++ = fg1; *ln++ = fg0; *ln++ = fg1;
+ *ln++ = fg0; *ln++ = fg1; *ln++ = fg0; *ln++ = fg1;
+ *ln++ = fg0; *ln++ = fg1; *ln++ = fg0; *ln++ = fg1;
+ *ln++ = fg0; *ln++ = fg1; *ln++ = fg0; *ln++ = fg1;
nametbl_addr += 7;
}
}
@@ -1391,25 +1240,20 @@ void v99x8_device::mode_graphic6(const pen_t *pens, _PixelType *ln, int line)
{
colour = m_vram_space->read_byte(((nametbl_addr&1) << 16) | (nametbl_addr>>1));
*ln++ = pens[m_pal_ind16[colour>>4]];
- if (_Width > 512)
- *ln++ = pens[m_pal_ind16[colour&15]];
+ *ln++ = pens[m_pal_ind16[colour&15]];
nametbl_addr++;
}
}
- xx = 16 - m_offset_x;
- if (_Width > 512)
- xx *= 2;
+ xx = (16 - m_offset_x) * 2;
while (xx--) *ln++ = pen_bg;
- m_size_now = RENDER_HIGH;
}
-template<typename _PixelType, int _Width>
-void v99x8_device::mode_graphic7(const pen_t *pens, _PixelType *ln, int line)
+void v99x8_device::mode_graphic7(const pen_t *pens, UINT16 *ln, int line)
{
UINT8 colour;
int line2, linemask, x, xx, nametbl_addr;
- _PixelType pen, pen_bg;
+ UINT16 pen, pen_bg;
linemask = ((m_cont_reg[2] & 0x1f) << 3) | 7;
@@ -1420,10 +1264,7 @@ void v99x8_device::mode_graphic7(const pen_t *pens, _PixelType *ln, int line)
nametbl_addr += 0x10000;
pen_bg = pens[m_pal_ind256[m_cont_reg[7]]];
- if (_Width < 512)
- xx = m_offset_x;
- else
- xx = m_offset_x * 2;
+ xx = m_offset_x * 2;
while (xx--) *ln++ = pen_bg;
if ((m_v9958_sp_mode & 0x18) == 0x08) // v9958 screen 12, puzzle star title screen
@@ -1445,23 +1286,16 @@ void v99x8_device::mode_graphic7(const pen_t *pens, _PixelType *ln, int line)
(colour[2] & 7) << 5 | (colour[3] & 7) << 8;
*ln++ = s_pal_indYJK[ind | ((colour[0] >> 3) & 31)];
- if (_Width > 512)
- *ln++ = s_pal_indYJK[ind | ((colour[0] >> 3) & 31)];
+ *ln++ = s_pal_indYJK[ind | ((colour[0] >> 3) & 31)];
*ln++ = s_pal_indYJK[ind | ((colour[1] >> 3) & 31)];
-
- if (_Width > 512)
- *ln++ = s_pal_indYJK[ind | ((colour[1] >> 3) & 31)];
+ *ln++ = s_pal_indYJK[ind | ((colour[1] >> 3) & 31)];
*ln++ = s_pal_indYJK[ind | ((colour[2] >> 3) & 31)];
-
- if (_Width > 512)
- *ln++ = s_pal_indYJK[ind | ((colour[2] >> 3) & 31)];
+ *ln++ = s_pal_indYJK[ind | ((colour[2] >> 3) & 31)];
*ln++ = s_pal_indYJK[ind | ((colour[3] >> 3) & 31)];
-
- if (_Width > 512)
- *ln++ = s_pal_indYJK[ind | ((colour[3] >> 3) & 31)];
+ *ln++ = s_pal_indYJK[ind | ((colour[3] >> 3) & 31)];
nametbl_addr++;
}
@@ -1485,23 +1319,16 @@ void v99x8_device::mode_graphic7(const pen_t *pens, _PixelType *ln, int line)
(colour[2] & 7) << 5 | (colour[3] & 7) << 8;
*ln++ = colour[0] & 8 ? m_pal_ind16[colour[0] >> 4] : s_pal_indYJK[ind | ((colour[0] >> 3) & 30)];
- if (_Width > 512)
- *ln++ = colour[0] & 8 ? m_pal_ind16[colour[0] >> 4] : s_pal_indYJK[ind | ((colour[0] >> 3) & 30)];
+ *ln++ = colour[0] & 8 ? m_pal_ind16[colour[0] >> 4] : s_pal_indYJK[ind | ((colour[0] >> 3) & 30)];
*ln++ = colour[1] & 8 ? m_pal_ind16[colour[1] >> 4] : s_pal_indYJK[ind | ((colour[1] >> 3) & 30)];
-
- if (_Width > 512)
- *ln++ = colour[1] & 8 ? m_pal_ind16[colour[1] >> 4] : s_pal_indYJK[ind | ((colour[1] >> 3) & 30)];
+ *ln++ = colour[1] & 8 ? m_pal_ind16[colour[1] >> 4] : s_pal_indYJK[ind | ((colour[1] >> 3) & 30)];
*ln++ = colour[2] & 8 ? m_pal_ind16[colour[2] >> 4] : s_pal_indYJK[ind | ((colour[2] >> 3) & 30)];
-
- if (_Width > 512)
- *ln++ = colour[2] & 8 ? m_pal_ind16[colour[2] >> 4] : s_pal_indYJK[ind | ((colour[2] >> 3) & 30)];
+ *ln++ = colour[2] & 8 ? m_pal_ind16[colour[2] >> 4] : s_pal_indYJK[ind | ((colour[2] >> 3) & 30)];
*ln++ = colour[3] & 8 ? m_pal_ind16[colour[3] >> 4] : s_pal_indYJK[ind | ((colour[3] >> 3) & 30)];
-
- if (_Width > 512)
- *ln++ = colour[3] & 8 ? m_pal_ind16[colour[3] >> 4] : s_pal_indYJK[ind | ((colour[3] >> 3) & 30)];
+ *ln++ = colour[3] & 8 ? m_pal_ind16[colour[3] >> 4] : s_pal_indYJK[ind | ((colour[3] >> 3) & 30)];
nametbl_addr++;
}
@@ -1517,13 +1344,10 @@ void v99x8_device::mode_graphic7(const pen_t *pens, _PixelType *ln, int line)
*ln++ = pen; *ln++ = pen;
*ln++ = pen; *ln++ = pen;
*ln++ = pen; *ln++ = pen;
- if (_Width > 512)
- {
- *ln++ = pen; *ln++ = pen;
- *ln++ = pen; *ln++ = pen;
- *ln++ = pen; *ln++ = pen;
- *ln++ = pen; *ln++ = pen;
- }
+ *ln++ = pen; *ln++ = pen;
+ *ln++ = pen; *ln++ = pen;
+ *ln++ = pen; *ln++ = pen;
+ *ln++ = pen; *ln++ = pen;
nametbl_addr++;
}
}
@@ -1534,134 +1358,91 @@ void v99x8_device::mode_graphic7(const pen_t *pens, _PixelType *ln, int line)
colour = m_vram_space->read_byte(((nametbl_addr&1) << 16) | (nametbl_addr>>1));
pen = pens[m_pal_ind256[colour]];
*ln++ = pen;
- if (_Width > 512)
- *ln++ = pen;
+ *ln++ = pen;
nametbl_addr++;
}
}
- xx = 16 - m_offset_x;
- if (_Width > 512)
- xx *= 2;
+ xx = (16 - m_offset_x) * 2;
while (xx--) *ln++ = pen_bg;
- if (m_size_now != RENDER_HIGH) m_size_now = RENDER_LOW;
}
-template<typename _PixelType, int _Width>
-void v99x8_device::mode_unknown(const pen_t *pens, _PixelType *ln, int line)
+void v99x8_device::mode_unknown(const pen_t *pens, UINT16 *ln, int line)
{
- _PixelType fg, bg;
+ UINT16 fg, bg;
int x;
fg = pens[m_pal_ind16[m_cont_reg[7] >> 4]];
bg = pens[m_pal_ind16[m_cont_reg[7] & 15]];
- if (_Width < 512)
- {
- x = m_offset_x;
- while (x--) *ln++ = bg;
+ x = m_offset_x * 2;
+ while (x--) *ln++ = bg;
- x = 256;
- while (x--) *ln++ = fg;
+ x = 512;
+ while (x--) *ln++ = fg;
- x = 16 - m_offset_x;
- while (x--) *ln++ = bg;
- }
- else
- {
- x = m_offset_x * 2;
- while (x--) *ln++ = bg;
-
- x = 512;
- while (x--) *ln++ = fg;
-
- x = (16 - m_offset_x) * 2;
- while (x--) *ln++ = bg;
- }
- if (m_size_now != RENDER_HIGH) m_size_now = RENDER_LOW;
+ x = (16 - m_offset_x) * 2;
+ while (x--) *ln++ = bg;
}
-template<typename _PixelType, int _Width>
-void v99x8_device::default_draw_sprite(const pen_t *pens, _PixelType *ln, UINT8 *col)
+void v99x8_device::default_draw_sprite(const pen_t *pens, UINT16 *ln, UINT8 *col)
{
int i;
- if (_Width > 512)
- ln += m_offset_x * 2;
- else
- ln += m_offset_x;
+ ln += m_offset_x * 2;
for (i=0;i<256;i++)
{
if (col[i] & 0x80)
{
*ln++ = pens[m_pal_ind16[col[i]&0x0f]];
- if (_Width > 512)
- *ln++ = pens[m_pal_ind16[col[i]&0x0f]];
+ *ln++ = pens[m_pal_ind16[col[i]&0x0f]];
}
else
{
- if (_Width > 512)
- ln += 2;
- else
- ln++;
+ ln += 2;
}
}
}
-template<typename _PixelType, int _Width>
-void v99x8_device::graphic5_draw_sprite(const pen_t *pens, _PixelType *ln, UINT8 *col)
+
+void v99x8_device::graphic5_draw_sprite(const pen_t *pens, UINT16 *ln, UINT8 *col)
{
int i;
- if (_Width > 512)
- ln += m_offset_x * 2;
- else
- ln += m_offset_x;
+ ln += m_offset_x * 2;
for (i=0;i<256;i++)
{
if (col[i] & 0x80)
{
*ln++ = pens[m_pal_ind16[(col[i]>>2)&0x03]];
- if (_Width > 512)
- *ln++ = pens[m_pal_ind16[col[i]&0x03]];
+ *ln++ = pens[m_pal_ind16[col[i]&0x03]];
}
else
{
- if (_Width > 512)
- ln += 2;
- else
- ln++;
+ ln += 2;
}
}
}
-template<typename _PixelType, int _Width>
-void v99x8_device::graphic7_draw_sprite(const pen_t *pens, _PixelType *ln, UINT8 *col)
+void v99x8_device::graphic7_draw_sprite(const pen_t *pens, UINT16 *ln, UINT8 *col)
{
static const UINT16 g7_ind16[16] = {
0, 2, 192, 194, 48, 50, 240, 242,
482, 7, 448, 455, 56, 63, 504, 511 };
int i;
- if (_Width > 512)
- ln += m_offset_x * 2;
- else
- ln += m_offset_x;
+ ln += m_offset_x * 2;
for (i=0;i<256;i++)
{
if (col[i] & 0x80)
{
*ln++ = pens[g7_ind16[col[i]&0x0f]];
- if (_Width > 512)
- *ln++ = pens[g7_ind16[col[i]&0x0f]];
+ *ln++ = pens[g7_ind16[col[i]&0x0f]];
}
else
{
- if (_Width > 512)
- ln += 2;
- else
- ln++;
+ ln += 2;
}
}
}
@@ -1917,98 +1698,74 @@ void v99x8_device::sprite_mode2 (int line, UINT8 *col)
m_stat_reg[0] = (m_stat_reg[0] & 0xa0) | p;
}
-#define SHORT_WIDTH (256 + 16)
-#define LONG_WIDTH (512 + 32)
const v99x8_device::v99x8_mode v99x8_device::s_modes[] = {
{ 0x02,
- &v99x8_device::mode_text1<UINT16, LONG_WIDTH>,
- &v99x8_device::mode_text1<UINT16, SHORT_WIDTH>,
- &v99x8_device::default_border<UINT16, LONG_WIDTH>,
- &v99x8_device::default_border<UINT16, SHORT_WIDTH>,
+ &v99x8_device::mode_text1,
+ &v99x8_device::default_border,
NULL,
- NULL,
- NULL },
+ NULL
+ },
{ 0x01,
- &v99x8_device::mode_multi<UINT16, LONG_WIDTH>,
- &v99x8_device::mode_multi<UINT16, SHORT_WIDTH>,
- &v99x8_device::default_border<UINT16, LONG_WIDTH>,
- &v99x8_device::default_border<UINT16, SHORT_WIDTH>,
+ &v99x8_device::mode_multi,
+ &v99x8_device::default_border,
&v99x8_device::sprite_mode1,
- &v99x8_device::default_draw_sprite<UINT16, LONG_WIDTH>,
- &v99x8_device::default_draw_sprite<UINT16, SHORT_WIDTH> },
+ &v99x8_device::default_draw_sprite
+ },
{ 0x00,
- &v99x8_device::mode_graphic1<UINT16, LONG_WIDTH>,
- &v99x8_device::mode_graphic1<UINT16, SHORT_WIDTH>,
- &v99x8_device::default_border<UINT16, LONG_WIDTH>,
- &v99x8_device::default_border<UINT16, SHORT_WIDTH>,
+ &v99x8_device::mode_graphic1,
+ &v99x8_device::default_border,
&v99x8_device::sprite_mode1,
- &v99x8_device::default_draw_sprite<UINT16, LONG_WIDTH>,
- &v99x8_device::default_draw_sprite<UINT16, SHORT_WIDTH> },
+ &v99x8_device::default_draw_sprite
+ },
{ 0x04,
- &v99x8_device::mode_graphic23<UINT16, LONG_WIDTH>,
- &v99x8_device::mode_graphic23<UINT16, SHORT_WIDTH>,
- &v99x8_device::default_border<UINT16, LONG_WIDTH>,
- &v99x8_device::default_border<UINT16, SHORT_WIDTH>,
+ &v99x8_device::mode_graphic23,
+ &v99x8_device::default_border,
&v99x8_device::sprite_mode1,
- &v99x8_device::default_draw_sprite<UINT16, LONG_WIDTH>,
- &v99x8_device::default_draw_sprite<UINT16, SHORT_WIDTH> },
+ &v99x8_device::default_draw_sprite
+ },
{ 0x08,
- &v99x8_device::mode_graphic23<UINT16, LONG_WIDTH>,
- &v99x8_device::mode_graphic23<UINT16, SHORT_WIDTH>,
- &v99x8_device::default_border<UINT16, LONG_WIDTH>,
- &v99x8_device::default_border<UINT16, SHORT_WIDTH>,
+ &v99x8_device::mode_graphic23,
+ &v99x8_device::default_border,
&v99x8_device::sprite_mode2,
- &v99x8_device::default_draw_sprite<UINT16, LONG_WIDTH>,
- &v99x8_device::default_draw_sprite<UINT16, SHORT_WIDTH> },
+ &v99x8_device::default_draw_sprite
+ },
{ 0x0c,
- &v99x8_device::mode_graphic4<UINT16, LONG_WIDTH>,
- &v99x8_device::mode_graphic4<UINT16, SHORT_WIDTH>,
- &v99x8_device::default_border<UINT16, LONG_WIDTH>,
- &v99x8_device::default_border<UINT16, SHORT_WIDTH>,
+ &v99x8_device::mode_graphic4,
+ &v99x8_device::default_border,
&v99x8_device::sprite_mode2,
- &v99x8_device::default_draw_sprite<UINT16, LONG_WIDTH>,
- &v99x8_device::default_draw_sprite<UINT16, SHORT_WIDTH> },
+ &v99x8_device::default_draw_sprite
+ },
{ 0x10,
- &v99x8_device::mode_graphic5<UINT16, LONG_WIDTH>,
- &v99x8_device::mode_graphic5<UINT16, SHORT_WIDTH>,
- &v99x8_device::graphic5_border<UINT16, LONG_WIDTH>,
- &v99x8_device::graphic5_border<UINT16, SHORT_WIDTH>,
+ &v99x8_device::mode_graphic5,
+ &v99x8_device::graphic5_border,
&v99x8_device::sprite_mode2,
- &v99x8_device::graphic5_draw_sprite<UINT16, LONG_WIDTH>,
- &v99x8_device::graphic5_draw_sprite<UINT16, SHORT_WIDTH> },
+ &v99x8_device::graphic5_draw_sprite
+ },
{ 0x14,
- &v99x8_device::mode_graphic6<UINT16, LONG_WIDTH>,
- &v99x8_device::mode_graphic6<UINT16, SHORT_WIDTH>,
- &v99x8_device::default_border<UINT16, LONG_WIDTH>,
- &v99x8_device::default_border<UINT16, SHORT_WIDTH>,
+ &v99x8_device::mode_graphic6,
+ &v99x8_device::default_border,
&v99x8_device::sprite_mode2,
- &v99x8_device::default_draw_sprite<UINT16, LONG_WIDTH>,
- &v99x8_device::default_draw_sprite<UINT16, SHORT_WIDTH> },
+ &v99x8_device::default_draw_sprite
+ },
{ 0x1c,
- &v99x8_device::mode_graphic7<UINT16, LONG_WIDTH>,
- &v99x8_device::mode_graphic7<UINT16, SHORT_WIDTH>,
- &v99x8_device::graphic7_border<UINT16, LONG_WIDTH>,
- &v99x8_device::graphic7_border<UINT16, SHORT_WIDTH>,
+ &v99x8_device::mode_graphic7,
+ &v99x8_device::graphic7_border,
&v99x8_device::sprite_mode2,
- &v99x8_device::graphic7_draw_sprite<UINT16, LONG_WIDTH>,
- &v99x8_device::graphic7_draw_sprite<UINT16, SHORT_WIDTH> },
+ &v99x8_device::graphic7_draw_sprite
+ },
{ 0x0a,
- &v99x8_device::mode_text2<UINT16, LONG_WIDTH>,
- &v99x8_device::mode_text2<UINT16, SHORT_WIDTH>,
- &v99x8_device::default_border<UINT16, LONG_WIDTH>,
- &v99x8_device::default_border<UINT16, SHORT_WIDTH>,
- NULL,
+ &v99x8_device::mode_text2,
+ &v99x8_device::default_border,
NULL,
- NULL },
+ NULL
+ },
{ 0xff,
- &v99x8_device::mode_unknown<UINT16, LONG_WIDTH>,
- &v99x8_device::mode_unknown<UINT16, SHORT_WIDTH>,
- &v99x8_device::default_border<UINT16, LONG_WIDTH>,
- &v99x8_device::default_border<UINT16, SHORT_WIDTH>,
+ &v99x8_device::mode_unknown,
+ &v99x8_device::default_border,
NULL,
- NULL,
- NULL },
+ NULL
+ }
};
void v99x8_device::set_mode()
@@ -2026,56 +1783,33 @@ void v99x8_device::set_mode()
void v99x8_device::refresh_16(int line)
{
const pen_t *pens = m_palette->pens();
- int i, double_lines;
+ bool double_lines = false;
UINT8 col[256];
UINT16 *ln, *ln2 = NULL;
- double_lines = 0;
-
- if (m_size == RENDER_HIGH)
+ if (m_cont_reg[9] & 0x08)
{
- if (m_cont_reg[9] & 0x08)
- {
- m_size_now = RENDER_HIGH;
- ln = &m_bitmap.pix16(line*2+((m_stat_reg[2]>>1)&1));
- }
- else
- {
- ln = &m_bitmap.pix16(line*2);
- ln2 = &m_bitmap.pix16(line*2+1);
- double_lines = 1;
- }
+ ln = &m_bitmap.pix16(line*2+((m_stat_reg[2]>>1)&1));
}
else
- ln = &m_bitmap.pix16(line);
+ {
+ ln = &m_bitmap.pix16(line*2);
+ ln2 = &m_bitmap.pix16(line*2+1);
+ double_lines = true;
+ }
if ( !(m_cont_reg[1] & 0x40) || (m_stat_reg[2] & 0x40) )
{
- if (m_size == RENDER_HIGH)
- (this->*s_modes[m_mode].border_16) (pens, ln);
- else
- (this->*s_modes[m_mode].border_16s) (pens, ln);
+ (this->*s_modes[m_mode].border_16) (pens, ln);
}
else
{
- i = (line - m_offset_y) & 255;
- if (m_size == RENDER_HIGH)
- {
- (this->*s_modes[m_mode].visible_16) (pens, ln, i);
- if (s_modes[m_mode].sprites)
- {
- (this->*s_modes[m_mode].sprites) (i, col);
- (this->*s_modes[m_mode].draw_sprite_16) (pens, ln, col);
- }
- }
- else
+ int i = (line - m_offset_y) & 255;
+ (this->*s_modes[m_mode].visible_16) (pens, ln, i);
+ if (s_modes[m_mode].sprites)
{
- (this->*s_modes[m_mode].visible_16s) (pens, ln, i);
- if (s_modes[m_mode].sprites)
- {
- (this->*s_modes[m_mode].sprites) (i, col);
- (this->*s_modes[m_mode].draw_sprite_16s) (pens, ln, col);
- }
+ (this->*s_modes[m_mode].sprites) (i, col);
+ (this->*s_modes[m_mode].draw_sprite_16) (pens, ln, col);
}
}
@@ -2241,22 +1975,6 @@ void v99x8_device::interrupt_start_vblank()
m_blink_count = (m_cont_reg[13] & 0x0f) * 10;
}
}
-
- // check screen rendering size
- if (m_size_auto && (m_size_now >= 0) && (m_size != m_size_now) )
- m_size = m_size_now;
-
- if (m_size != m_size_old)
- {
- if (m_size == RENDER_HIGH)
- m_screen->set_visible_area (0, 512 + 32 - 1, 0, 424 + 56 - 1);
- else
- m_screen->set_visible_area (0, 256 + 16 - 1, 0, 212 + 28 - 1);
-
- m_size_old = m_size;
- }
-
- m_size_now = -1;
}
/***************************************************************************
diff --git a/src/emu/video/v9938.h b/src/emu/video/v9938.h
index 4af159b5ae3..1393765ace3 100644
--- a/src/emu/video/v9938.h
+++ b/src/emu/video/v9938.h
@@ -29,16 +29,6 @@
#define MCFG_V99X8_INTERRUPT_CALLBACK(_irq) \
downcast<v99x8_device *>(device)->set_interrupt_callback(DEVCB_##_irq);
-// init functions
-
-#define MODEL_V9938 (0)
-#define MODEL_V9958 (1)
-
-// resolutions
-#define RENDER_HIGH (0)
-#define RENDER_LOW (1)
-#define RENDER_AUTO (2)
-
//**************************************************************************
// GLOBAL VARIABLES
@@ -50,7 +40,6 @@ extern const device_type V9958;
-
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
@@ -70,7 +59,6 @@ public:
m_int_callback.set_callback(irq);
}
int interrupt ();
- void set_resolution (int);
int get_transpen();
bitmap_ind16 &get_bitmap() { return m_bitmap; }
void update_mouse_state(int mx_delta, int my_delta, int button_state);
@@ -113,24 +101,24 @@ private:
void check_int();
void register_write(int reg, int data);
- template<typename _PixelType, int _Width> void default_border(const pen_t *pens, _PixelType *ln);
- template<typename _PixelType, int _Width> void graphic7_border(const pen_t *pens, _PixelType *ln);
- template<typename _PixelType, int _Width> void graphic5_border(const pen_t *pens, _PixelType *ln);
- template<typename _PixelType, int _Width> void mode_text1(const pen_t *pens, _PixelType *ln, int line);
- template<typename _PixelType, int _Width> void mode_text2(const pen_t *pens, _PixelType *ln, int line);
- template<typename _PixelType, int _Width> void mode_multi(const pen_t *pens, _PixelType *ln, int line);
- template<typename _PixelType, int _Width> void mode_graphic1(const pen_t *pens, _PixelType *ln, int line);
- template<typename _PixelType, int _Width> void mode_graphic23(const pen_t *pens, _PixelType *ln, int line);
- template<typename _PixelType, int _Width> void mode_graphic4(const pen_t *pens, _PixelType *ln, int line);
- template<typename _PixelType, int _Width> void mode_graphic5(const pen_t *pens, _PixelType *ln, int line);
- template<typename _PixelType, int _Width> void mode_graphic6(const pen_t *pens, _PixelType *ln, int line);
- template<typename _PixelType, int _Width> void mode_graphic7(const pen_t *pens, _PixelType *ln, int line);
+ void default_border(const pen_t *pens, UINT16 *ln);
+ void graphic7_border(const pen_t *pens, UINT16 *ln);
+ void graphic5_border(const pen_t *pens, UINT16 *ln);
+ void mode_text1(const pen_t *pens, UINT16 *ln, int line);
+ void mode_text2(const pen_t *pens, UINT16 *ln, int line);
+ void mode_multi(const pen_t *pens, UINT16 *ln, int line);
+ void mode_graphic1(const pen_t *pens, UINT16 *ln, int line);
+ void mode_graphic23(const pen_t *pens, UINT16 *ln, int line);
+ void mode_graphic4(const pen_t *pens, UINT16 *ln, int line);
+ void mode_graphic5(const pen_t *pens, UINT16 *ln, int line);
+ void mode_graphic6(const pen_t *pens, UINT16 *ln, int line);
+ void mode_graphic7(const pen_t *pens, UINT16 *ln, int line);
// template<typename _PixelType, int _Width> void mode_yae(const pen_t *pens, _PixelType *ln, int line);
// template<typename _PixelType, int _Width> void mode_yjk(const pen_t *pens, _PixelType *ln, int line);
- template<typename _PixelType, int _Width> void mode_unknown(const pen_t *pens, _PixelType *ln, int line);
- template<typename _PixelType, int _Width> void default_draw_sprite(const pen_t *pens, _PixelType *ln, UINT8 *col);
- template<typename _PixelType, int _Width> void graphic5_draw_sprite(const pen_t *pens, _PixelType *ln, UINT8 *col);
- template<typename _PixelType, int _Width> void graphic7_draw_sprite(const pen_t *pens, _PixelType *ln, UINT8 *col);
+ void mode_unknown(const pen_t *pens, UINT16 *ln, int line);
+ void default_draw_sprite(const pen_t *pens, UINT16 *ln, UINT8 *col);
+ void graphic5_draw_sprite(const pen_t *pens, UINT16 *ln, UINT8 *col);
+ void graphic7_draw_sprite(const pen_t *pens, UINT16 *ln, UINT8 *col);
void sprite_mode1(int line, UINT8 *col);
void sprite_mode2(int line, UINT8 *col);
@@ -197,8 +185,6 @@ private:
int m_scanline;
// blinking
int m_blink, m_blink_count;
- // size
- int m_size, m_size_old, m_size_auto, m_size_now;
// mouse
UINT8 m_mx_delta, m_my_delta;
// mouse & lightpen
@@ -228,12 +214,9 @@ private:
{
UINT8 m;
void (v99x8_device::*visible_16)(const pen_t *, UINT16*, int);
- void (v99x8_device::*visible_16s)(const pen_t *, UINT16*, int);
void (v99x8_device::*border_16)(const pen_t *, UINT16*);
- void (v99x8_device::*border_16s)(const pen_t *, UINT16*);
void (v99x8_device::*sprites)(int, UINT8*);
void (v99x8_device::*draw_sprite_16)(const pen_t *, UINT16*, UINT8*);
- void (v99x8_device::*draw_sprite_16s)(const pen_t *, UINT16*, UINT8*);
} ;
static const v99x8_mode s_modes[];
required_device<palette_device> m_palette;
diff --git a/src/emu/video/vooddefs.h b/src/emu/video/vooddefs.h
index a64b0c22f66..db67d2de8d5 100644
--- a/src/emu/video/vooddefs.h
+++ b/src/emu/video/vooddefs.h
@@ -1,4 +1,4 @@
-// license:BSD-3-Clause
+ // license:BSD-3-Clause
// copyright-holders:Aaron Giles
/***************************************************************************
@@ -23,6 +23,12 @@ enum
STALLED_UNTIL_FIFO_EMPTY
};
+// Use old macro style or newer SSE2 optimized functions
+#define USE_OLD_RASTER 0
+
+// Use old table lookup versus straight double divide
+#define USE_FAST_RECIP 0
+
/* maximum number of TMUs */
#define MAX_TMU 2
@@ -2148,10 +2154,10 @@ while (0)
#define CLAMPED_ARGB(ITERR, ITERG, ITERB, ITERA, FBZCP, RESULT) \
do \
{ \
- INT32 r = (INT32)(ITERR) >> 12; \
- INT32 g = (INT32)(ITERG) >> 12; \
- INT32 b = (INT32)(ITERB) >> 12; \
- INT32 a = (INT32)(ITERA) >> 12; \
+ r = (INT32)(ITERR) >> 12; \
+ g = (INT32)(ITERG) >> 12; \
+ b = (INT32)(ITERB) >> 12; \
+ a = (INT32)(ITERA) >> 12; \
\
if (FBZCP_RGBZW_CLAMP(FBZCP) == 0) \
{ \
@@ -2193,6 +2199,36 @@ do
} \
while (0)
+INLINE rgbaint_t ATTR_FORCE_INLINE clampARGB(const rgbaint_t &iterargb, UINT32 FBZCP)
+{
+ rgbaint_t result(iterargb);
+ //rgbaint_t colorint((INT32) (itera>>12), (INT32) (iterr>>12), (INT32) (iterg>>12), (INT32) (iterb>>12));
+ result.shr_imm(12);
+
+ if (FBZCP_RGBZW_CLAMP(FBZCP) == 0)
+ {
+ //r &= 0xfff;
+ result.and_imm(0xfff);
+ //if (r == 0xfff)
+ rgbaint_t temp(result);
+ temp.cmpeq_imm(0xfff);
+ // result.rgb.r = 0;
+ result.andnot_reg(temp);
+ //else if (r == 0x100)
+ temp.set(result);
+ temp.cmpeq_imm(0x100);
+ // Shift by 1 so that INT32 result is not negative
+ temp.shr_imm(1);
+ // result.rgb.r = 0xff;
+ result.or_reg(temp);
+ }
+ else
+ {
+ //return colorint.to_rgba_clamp();
+ }
+ result.clamp_to_uint8();
+ return result;
+}
#define CLAMPED_Z(ITERZ, FBZCP, RESULT) \
do \
@@ -2310,6 +2346,73 @@ do
} \
while (0)
+INLINE bool ATTR_FORCE_INLINE chromaKeyTest(voodoo_state *v, stats_block *stats, UINT32 fbzModeReg, rgbaint_t rgbaIntColor)
+{
+ if (FBZMODE_ENABLE_CHROMAKEY(fbzModeReg))
+ {
+ rgb_union color;
+ color.u = (rgbaIntColor.get_a()<<24) | (rgbaIntColor.get_r()<<16) | (rgbaIntColor.get_g()<<8) | rgbaIntColor.get_b();
+ /* non-range version */
+ if (!CHROMARANGE_ENABLE(v->reg[chromaRange].u))
+ {
+ if (((color.u ^ v->reg[chromaKey].u) & 0xffffff) == 0)
+ {
+ stats->chroma_fail++;
+ return false;
+ }
+ }
+
+ /* tricky range version */
+ else
+ {
+ INT32 low, high, test;
+ int results = 0;
+
+ /* check blue */
+ low = v->reg[chromaKey].rgb.b;
+ high = v->reg[chromaRange].rgb.b;
+ test = color.rgb.b;
+ results = (test >= low && test <= high);
+ results ^= CHROMARANGE_BLUE_EXCLUSIVE(v->reg[chromaRange].u);
+ results <<= 1;
+
+ /* check green */
+ low = v->reg[chromaKey].rgb.g;
+ high = v->reg[chromaRange].rgb.g;
+ test = color.rgb.g;
+ results |= (test >= low && test <= high);
+ results ^= CHROMARANGE_GREEN_EXCLUSIVE(v->reg[chromaRange].u);
+ results <<= 1;
+
+ /* check red */
+ low = v->reg[chromaKey].rgb.r;
+ high = v->reg[chromaRange].rgb.r;
+ test = color.rgb.r;
+ results |= (test >= low && test <= high);
+ results ^= CHROMARANGE_RED_EXCLUSIVE(v->reg[chromaRange].u);
+
+ /* final result */
+ if (CHROMARANGE_UNION_MODE(v->reg[chromaRange].u))
+ {
+ if (results != 0)
+ {
+ stats->chroma_fail++;
+ return false;
+ }
+ }
+ else
+ {
+ if (results == 7)
+ {
+ stats->chroma_fail++;
+ return false;
+ }
+ }
+ }
+ }
+ return true;
+}
+
/*************************************
@@ -2332,7 +2435,18 @@ do
} \
while (0)
-
+INLINE bool alphaMaskTest(stats_block *stats, UINT32 fbzModeReg, UINT8 alpha)
+{
+ if (FBZMODE_ENABLE_ALPHA_MASK(fbzModeReg))
+ {
+ if ((alpha & 1) == 0)
+ {
+ stats->afunc_fail++;
+ return false;
+ }
+ }
+ return true;
+}
/*************************************
*
@@ -2407,6 +2521,71 @@ do
} \
while (0)
+INLINE bool ATTR_FORCE_INLINE alphaTest(voodoo_state *v, stats_block *stats, UINT32 alphaModeReg, UINT8 alpha)
+{
+ if (ALPHAMODE_ALPHATEST(alphaModeReg))
+ {
+ UINT8 alpharef = v->reg[alphaMode].rgb.a;
+ switch (ALPHAMODE_ALPHAFUNCTION(alphaModeReg))
+ {
+ case 0: /* alphaOP = never */
+ stats->afunc_fail++;
+ return false;
+
+ case 1: /* alphaOP = less than */
+ if (alpha >= alpharef)
+ {
+ stats->afunc_fail++;
+ return false;
+ }
+ break;
+
+ case 2: /* alphaOP = equal */
+ if (alpha != alpharef)
+ {
+ stats->afunc_fail++;
+ return false;
+ }
+ break;
+
+ case 3: /* alphaOP = less than or equal */
+ if (alpha > alpharef)
+ {
+ stats->afunc_fail++;
+ return false;
+ }
+ break;
+
+ case 4: /* alphaOP = greater than */
+ if (alpha <= alpharef)
+ {
+ stats->afunc_fail++;
+ return false;
+ }
+ break;
+
+ case 5: /* alphaOP = not equal */
+ if (alpha == alpharef)
+ {
+ stats->afunc_fail++;
+ return false;
+ }
+ break;
+
+ case 6: /* alphaOP = greater than or equal */
+ if (alpha < alpharef)
+ {
+ stats->afunc_fail++;
+ return false;
+ }
+ break;
+
+ case 7: /* alphaOP = always */
+ break;
+ }
+ }
+ return true;
+}
/*************************************
@@ -2571,6 +2750,205 @@ do
} \
while (0)
+INLINE void ATTR_FORCE_INLINE alphaBlend(UINT32 FBZMODE, UINT32 ALPHAMODE, INT32 x, const UINT8 *dither, int dpix, UINT16 *depth, rgbaint_t &preFog, rgbaint_t &srcColor)
+{
+ if (ALPHAMODE_ALPHABLEND(ALPHAMODE))
+ {
+ //int dpix = dest[XX];
+ int dr, dg, db;
+ EXTRACT_565_TO_888(dpix, dr, dg, db);
+ int da = FBZMODE_ENABLE_ALPHA_PLANES(FBZMODE) ? depth[x] : 0xff;
+ //int sr = (RR);
+ //int sg = (GG);
+ //int sb = (BB);
+ //int sa = (AA);
+ int sa = srcColor.get_a();
+ int ta;
+ int srcAlphaScale, destAlphaScale;
+ rgbaint_t srcScale, destScale;
+
+ /* apply dither subtraction */
+ if (FBZMODE_ALPHA_DITHER_SUBTRACT(FBZMODE))
+ {
+ /* look up the dither value from the appropriate matrix */
+ //int dith = DITHER[(XX) & 3];
+
+ /* subtract the dither value */
+ dr += (15 - dither[x&3]) >> 1;
+ dg += (15 - dither[x&3]) >> 2;
+ db += (15 - dither[x&3]) >> 1;
+ }
+
+ /* blend the source alpha */
+ srcAlphaScale = 0;
+ if (ALPHAMODE_SRCALPHABLEND(ALPHAMODE) == 4)
+ srcAlphaScale = 256;
+ //(AA) = sa;
+
+ /* compute source portion */
+ switch (ALPHAMODE_SRCRGBBLEND(ALPHAMODE))
+ {
+ default: /* reserved */
+ case 0: /* AZERO */
+ srcScale.set(srcAlphaScale, 0, 0, 0);
+ //(RR) = (GG) = (BB) = 0;
+ break;
+
+ case 1: /* ASRC_ALPHA */
+ srcScale.set(srcAlphaScale-1, sa, sa, sa);
+ srcScale.add_imm(1);
+ //(RR) = (sr * (sa + 1)) >> 8;
+ //(GG) = (sg * (sa + 1)) >> 8;
+ //(BB) = (sb * (sa + 1)) >> 8;
+ break;
+
+ case 2: /* A_COLOR */
+ srcScale.set(srcAlphaScale-1, dr, dg, db);
+ srcScale.add_imm(1);
+ //(RR) = (sr * (dr + 1)) >> 8;
+ //(GG) = (sg * (dg + 1)) >> 8;
+ //(BB) = (sb * (db + 1)) >> 8;
+ break;
+
+ case 3: /* ADST_ALPHA */
+ ta = da + 1;
+ srcScale.set(srcAlphaScale, ta, ta, ta);
+ //(RR) = (sr * (da + 1)) >> 8;
+ //(GG) = (sg * (da + 1)) >> 8;
+ //(BB) = (sb * (da + 1)) >> 8;
+ break;
+
+ case 4: /* AONE */
+ srcScale.set(srcAlphaScale, 256, 256, 256);
+ break;
+
+ case 5: /* AOMSRC_ALPHA */
+ ta = (0x100 - sa);
+ srcScale.set(srcAlphaScale, ta, ta, ta);
+ //(RR) = (sr * (0x100 - sa)) >> 8;
+ //(GG) = (sg * (0x100 - sa)) >> 8;
+ //(BB) = (sb * (0x100 - sa)) >> 8;
+ break;
+
+ case 6: /* AOM_COLOR */
+ srcScale.set(srcAlphaScale, (0x100 - dr), (0x100 - dg), (0x100 - db));
+ //(RR) = (sr * (0x100 - dr)) >> 8;
+ //(GG) = (sg * (0x100 - dg)) >> 8;
+ //(BB) = (sb * (0x100 - db)) >> 8;
+ break;
+
+ case 7: /* AOMDST_ALPHA */
+ ta = (0x100 - da);
+ srcScale.set(srcAlphaScale, ta, ta, ta);
+ //(RR) = (sr * (0x100 - da)) >> 8;
+ //(GG) = (sg * (0x100 - da)) >> 8;
+ //(BB) = (sb * (0x100 - da)) >> 8;
+ break;
+
+ case 15: /* ASATURATE */
+ ta = (sa < (0x100 - da)) ? sa : (0x100 - da);
+ ta++;
+ srcScale.set(srcAlphaScale, ta, ta, ta);
+ //(RR) = (sr * (ta + 1)) >> 8;
+ //(GG) = (sg * (ta + 1)) >> 8;
+ //(BB) = (sb * (ta + 1)) >> 8;
+ break;
+ }
+
+ /* blend the dest alpha */
+ destAlphaScale = 0;
+ if (ALPHAMODE_DSTALPHABLEND(ALPHAMODE) == 4)
+ destAlphaScale = 256;
+ //(AA) += da;
+
+ /* add in dest portion */
+ switch (ALPHAMODE_DSTRGBBLEND(ALPHAMODE))
+ {
+ default: /* reserved */
+ case 0: /* AZERO */
+ destScale.set(destAlphaScale, 0, 0, 0);
+ break;
+
+ case 1: /* ASRC_ALPHA */
+ destScale.set(destAlphaScale-1, sa, sa, sa);
+ destScale.add_imm(1);
+ //(RR) += (dr * (sa + 1)) >> 8;
+ //(GG) += (dg * (sa + 1)) >> 8;
+ //(BB) += (db * (sa + 1)) >> 8;
+ break;
+
+ case 2: /* A_COLOR */
+ destScale.set(srcColor);
+ destScale.add_imm(1);
+ destScale.set_a(destAlphaScale);
+ //(RR) += (dr * (sr + 1)) >> 8;
+ //(GG) += (dg * (sg + 1)) >> 8;
+ //(BB) += (db * (sb + 1)) >> 8;
+ break;
+
+ case 3: /* ADST_ALPHA */
+ ta = da + 1;
+ destScale.set(destAlphaScale, ta, ta, ta);
+ //(RR) += (dr * (da + 1)) >> 8;
+ //(GG) += (dg * (da + 1)) >> 8;
+ //(BB) += (db * (da + 1)) >> 8;
+ break;
+
+ case 4: /* AONE */
+ destScale.set(destAlphaScale, 256, 256, 256);
+ //(RR) += dr;
+ //(GG) += dg;
+ //(BB) += db;
+ break;
+
+ case 5: /* AOMSRC_ALPHA */
+ ta = (0x100 - sa);
+ destScale.set(destAlphaScale, ta, ta, ta);
+ //(RR) += (dr * (0x100 - sa)) >> 8;
+ //(GG) += (dg * (0x100 - sa)) >> 8;
+ //(BB) += (db * (0x100 - sa)) >> 8;
+ break;
+
+ case 6: /* AOM_COLOR */
+ destScale.set(0x100, 0x100, 0x100, 0x100);
+ destScale.sub(srcColor);
+ destScale.set_a(destAlphaScale);
+ //destScale.set(destAlphaScale, (0x100 - color.rgb.r), (0x100 - color.rgb.g), (0x100 - color.rgb.b));
+ //(RR) += (dr * (0x100 - sr)) >> 8;
+ //(GG) += (dg * (0x100 - sg)) >> 8;
+ //(BB) += (db * (0x100 - sb)) >> 8;
+ break;
+
+ case 7: /* AOMDST_ALPHA */
+ ta = (0x100 - da);
+ destScale.set(destAlphaScale, ta, ta, ta);
+ //(RR) += (dr * (0x100 - da)) >> 8;
+ //(GG) += (dg * (0x100 - da)) >> 8;
+ //(BB) += (db * (0x100 - da)) >> 8;
+ break;
+
+ case 15: /* A_COLORBEFOREFOG */
+ destScale.set(preFog);
+ destScale.add_imm(1);
+ destScale.set_a(destAlphaScale);
+ //destScale.set((rgb_t) (((destAlphaScale-1)<<24) | (preFog.u & 0x00ffffff)));
+ //destScale.add_imm(1);
+ //(RR) += (dr * (prefogr + 1)) >> 8;
+ //(GG) += (dg * (prefogg + 1)) >> 8;
+ //(BB) += (db * (prefogb + 1)) >> 8;
+ break;
+ }
+ // Main blend
+ rgbaint_t destColor(da, dr, dg, db);
+
+ srcColor.scale2_add_and_clamp(srcScale, destColor, destScale);
+ /* clamp */
+ //CLAMP((RR), 0x00, 0xff);
+ //CLAMP((GG), 0x00, 0xff);
+ //CLAMP((BB), 0x00, 0xff);
+ //CLAMP((AA), 0x00, 0xff);
+ }
+}
/*************************************
@@ -2690,6 +3068,130 @@ do
} \
while (0)
+INLINE void ATTR_FORCE_INLINE applyFogging(voodoo_state *v, UINT32 fogModeReg, UINT32 fbzCpReg, INT32 x, const UINT8 *dither4, INT32 fogDepth,
+ rgbaint_t &color, INT32 iterz, INT64 iterw, UINT8 itera)
+{
+ if (FOGMODE_ENABLE_FOG(fogModeReg))
+ {
+ UINT32 color_alpha = color.get_a();
+
+ /* constant fog bypasses everything else */
+ rgbaint_t fogColorLocal(v->reg[fogColor].u);
+
+ if (FOGMODE_FOG_CONSTANT(fogModeReg))
+ {
+ /* if fog_mult is 0, we add this to the original color */
+ if (FOGMODE_FOG_MULT(fogModeReg) == 0)
+ {
+ fogColorLocal.add(color);
+ fogColorLocal.clamp_to_uint8();
+ //color += fog;
+ }
+
+ /* otherwise this just becomes the new color */
+ else
+ {
+ //color = fogColorLocal;
+ //color = fog;
+ }
+ }
+ /* non-constant fog comes from several sources */
+ else
+ {
+ INT32 fogblend = 0;
+
+ /* if fog_add is zero, we start with the fog color */
+ if (FOGMODE_FOG_ADD(fogModeReg))
+ fogColorLocal.set(0, 0, 0, 0);
+ //fr = fg = fb = 0;
+
+ /* if fog_mult is zero, we subtract the incoming color */
+ if (!FOGMODE_FOG_MULT(fogModeReg))
+ {
+ fogColorLocal.sub(color);
+ //fog.rgb -= color.rgb;
+ //fr -= (RR);
+ //fg -= (GG);
+ //fb -= (BB);
+ }
+
+ /* fog blending mode */
+ switch (FOGMODE_FOG_ZALPHA(fogModeReg))
+ {
+ case 0: /* fog table */
+ {
+ INT32 delta = v->fbi.fogdelta[fogDepth >> 10];
+ INT32 deltaval;
+
+ /* perform the multiply against lower 8 bits of wfloat */
+ deltaval = (delta & v->fbi.fogdelta_mask) *
+ ((fogDepth >> 2) & 0xff);
+
+ /* fog zones allow for negating this value */
+ if (FOGMODE_FOG_ZONES(fogModeReg) && (delta & 2))
+ deltaval = -deltaval;
+ deltaval >>= 6;
+
+ /* apply dither */
+ if (FOGMODE_FOG_DITHER(fogModeReg))
+ deltaval += dither4[x&3];
+ deltaval >>= 4;
+
+ /* add to the blending factor */
+ fogblend = v->fbi.fogblend[fogDepth >> 10] + deltaval;
+ break;
+ }
+
+ case 1: /* iterated A */
+ fogblend = itera;
+ break;
+
+ case 2: /* iterated Z */
+ CLAMPED_Z(iterz, fbzCpReg, fogblend);
+ fogblend >>= 8;
+ break;
+
+ case 3: /* iterated W - Voodoo 2 only */
+ CLAMPED_W(iterw, fbzCpReg, fogblend);
+ break;
+ }
+
+ /* perform the blend */
+ fogblend++;
+
+ //fr = (fr * fogblend) >> 8;
+ //fg = (fg * fogblend) >> 8;
+ //fb = (fb * fogblend) >> 8;
+ /* if fog_mult is 0, we add this to the original color */
+ if (FOGMODE_FOG_MULT(fogModeReg) == 0)
+ {
+ fogColorLocal.scale_imm_add_and_clamp(fogblend, color);
+ //color += fog;
+ //(RR) += fr;
+ //(GG) += fg;
+ //(BB) += fb;
+ }
+
+ /* otherwise this just becomes the new color */
+ else
+ {
+ fogColorLocal.scale_imm_and_clamp(fogblend);
+ //color = fog;
+ //(RR) = fr;
+ //(GG) = fg;
+ //(BB) = fb;
+ }
+ }
+
+
+ /* clamp */
+ //CLAMP((RR), 0x00, 0xff);
+ //CLAMP((GG), 0x00, 0xff);
+ //CLAMP((BB), 0x00, 0xff);
+ fogColorLocal.set_a(color_alpha);
+ color.set(fogColorLocal);
+ }
+}
/*************************************
@@ -2703,17 +3205,21 @@ do
{ \
INT32 blendr, blendg, blendb, blenda; \
INT32 tr, tg, tb, ta; \
- INT32 oow, s, t, lod, ilod; \
+ INT32 s, t, lod, ilod; \
INT32 smax, tmax; \
UINT32 texbase; \
rgb_union c_local; \
- \
+ \
/* determine the S/T/LOD values for this texture */ \
if (TEXMODE_ENABLE_PERSPECTIVE(TEXMODE)) \
{ \
- oow = fast_reciplog((ITERW), &lod); \
- s = ((INT64)oow * (ITERS)) >> 29; \
- t = ((INT64)oow * (ITERT)) >> 29; \
+ if (USE_FAST_RECIP) { \
+ const INT32 oow = fast_reciplog((ITERW), &lod); \
+ s = ((INT64)oow * (ITERS)) >> 29; \
+ t = ((INT64)oow * (ITERT)) >> 29; \
+ } else { \
+ multi_reciplog(ITERS, ITERT, ITERW, lod, s, t); \
+ } \
lod += (LODBASE); \
} \
else \
@@ -2869,7 +3375,7 @@ do
} \
\
/* weigh in each texel */ \
- c_local.u = rgba_bilinear_filter(texel0, texel1, texel2, texel3, sfrac, tfrac);\
+ c_local.u = rgbaint_t::bilinear_filter(texel0, texel1, texel2, texel3, sfrac, tfrac); \
} \
\
/* select zero/other for RGB */ \
@@ -3041,7 +3547,6 @@ while (0)
do \
{ \
INT32 depthval, wfloat, fogdepth, biasdepth; \
- INT32 prefogr, prefogg, prefogb; \
INT32 r, g, b, a; \
\
(STATS)->pixels_in++; \
@@ -3206,19 +3711,131 @@ do
} \
while (0)
+INLINE bool ATTR_FORCE_INLINE depthTest(UINT16 zaColorReg, stats_block *stats, INT32 destDepth, UINT32 fbzModeReg, INT32 biasdepth)
+{
+ /* handle depth buffer testing */
+ if (FBZMODE_ENABLE_DEPTHBUF(fbzModeReg))
+ {
+ INT32 depthsource;
+ /* the source depth is either the iterated W/Z+bias or a */
+ /* constant value */
+ if (FBZMODE_DEPTH_SOURCE_COMPARE(fbzModeReg) == 0)
+ depthsource = biasdepth;
+ else
+ depthsource = zaColorReg;
+
+ /* test against the depth buffer */
+ switch (FBZMODE_DEPTH_FUNCTION(fbzModeReg))
+ {
+ case 0: /* depthOP = never */
+ stats->zfunc_fail++;
+ return false;
+
+ case 1: /* depthOP = less than */
+ if (depthsource >= destDepth)
+ {
+ stats->zfunc_fail++;
+ return false;
+ }
+ break;
+
+ case 2: /* depthOP = equal */
+ if (depthsource != destDepth)
+ {
+ stats->zfunc_fail++;
+ return false;
+ }
+ break;
+
+ case 3: /* depthOP = less than or equal */
+ if (depthsource > destDepth)
+ {
+ stats->zfunc_fail++;
+ return false;
+ }
+ break;
+
+ case 4: /* depthOP = greater than */
+ if (depthsource <= destDepth)
+ {
+ stats->zfunc_fail++;
+ return false;
+ }
+ break;
+
+ case 5: /* depthOP = not equal */
+ if (depthsource == destDepth)
+ {
+ stats->zfunc_fail++;
+ return false;
+ }
+ break;
+
+ case 6: /* depthOP = greater than or equal */
+ if (depthsource < destDepth)
+ {
+ stats->zfunc_fail++;
+ return false;
+ }
+ break;
+
+ case 7: /* depthOP = always */
+ break;
+ }
+ }
+ return true;
+}
+
+#if USE_OLD_RASTER == 1
#define PIXEL_PIPELINE_END(VV, STATS, DITHER, DITHER4, DITHER_LOOKUP, XX, dest, depth, FBZMODE, FBZCOLORPATH, ALPHAMODE, FOGMODE, ITERZ, ITERW, ITERAXXX) \
\
/* perform fogging */ \
+ INT32 prefogr, prefogg, prefogb; \
prefogr = r; \
prefogg = g; \
prefogb = b; \
APPLY_FOGGING(VV, FOGMODE, FBZCOLORPATH, XX, DITHER4, r, g, b, \
ITERZ, ITERW, ITERAXXX); \
+ \
+ /* perform alpha blending */ \
+ APPLY_ALPHA_BLEND(FBZMODE, ALPHAMODE, XX, DITHER, r, g, b, a); \
+ /* modify the pixel for debugging purposes */ \
+ MODIFY_PIXEL(VV); \
\
- /* perform alpha blending */ \
- APPLY_ALPHA_BLEND(FBZMODE, ALPHAMODE, XX, DITHER, r, g, b, a); \
+ /* write to framebuffer */ \
+ if (FBZMODE_RGB_BUFFER_MASK(FBZMODE)) \
+ { \
+ /* apply dithering */ \
+ APPLY_DITHER(FBZMODE, XX, DITHER_LOOKUP, r, g, b); \
+ dest[XX] = (r << 11) | (g << 5) | b; \
+ } \
\
+ /* write to aux buffer */ \
+ if (depth && FBZMODE_AUX_BUFFER_MASK(FBZMODE)) \
+ { \
+ if (FBZMODE_ENABLE_ALPHA_PLANES(FBZMODE) == 0) \
+ depth[XX] = biasdepth; \
+ else \
+ depth[XX] = a; \
+ } \
+ \
+ /* track pixel writes to the frame buffer regardless of mask */ \
+ (STATS)->pixels_out++; \
+ \
+skipdrawdepth: \
+ ; \
+} \
+while (0)
+#else
+#define PIXEL_PIPELINE_END(VV, STATS, DITHER, DITHER4, DITHER_LOOKUP, XX, dest, depth, FBZMODE, FBZCOLORPATH, ALPHAMODE, FOGMODE, ITERZ, ITERW, ITERAXXX) \
+ \
+ /* perform fogging */ \
+ preFog.set(color); \
+ applyFogging(VV, FOGMODE, FBZCOLORPATH, XX, DITHER4, fogdepth, color, ITERZ, ITERW, ITERAXXX.get_a()); \
+ /* perform alpha blending */ \
+ alphaBlend(FBZMODE, ALPHAMODE, XX, DITHER, dest[XX], depth, preFog, color); \
+ a = color.get_a(); r = color.get_r(); g = color.get_g(); b = color.get_b(); \
/* modify the pixel for debugging purposes */ \
MODIFY_PIXEL(VV); \
\
@@ -3246,7 +3863,7 @@ skipdrawdepth:
; \
} \
while (0)
-
+#endif
/*************************************
@@ -3391,7 +4008,7 @@ do
} \
\
/* select zero or a_other */ \
- if (FBZCP_CCA_ZERO_OTHER(FBZCOLORPATH) == 0) \
+ if (!FBZCP_CCA_ZERO_OTHER(FBZCOLORPATH)) \
a = c_other.rgb.a; \
else \
a = 0; \
@@ -3546,6 +4163,247 @@ do
} \
while (0)
+INLINE bool ATTR_FORCE_INLINE combineColor(voodoo_state *VV, stats_block *STATS, UINT32 FBZCOLORPATH, UINT32 FBZMODE, UINT32 ALPHAMODE,
+ rgbaint_t TEXELARGB, INT32 ITERZ, INT64 ITERW, rgbaint_t &srcColor)
+{
+ rgbaint_t c_other;
+ rgbaint_t c_local;
+
+ /* compute c_other */
+ switch (FBZCP_CC_RGBSELECT(FBZCOLORPATH))
+ {
+ case 0: /* iterated RGB */
+ c_other.set(srcColor);
+ break;
+
+ case 1: /* texture RGB */
+ c_other.set(TEXELARGB);
+ break;
+
+ case 2: /* color1 RGB */
+ c_other.set((VV)->reg[color1].u);
+ break;
+
+ default: /* reserved - voodoo3 framebufferRGB */
+ c_other.set(0);
+ break;
+ }
+
+ /* handle chroma key */
+ if (!chromaKeyTest(VV, STATS, FBZMODE, c_other))
+ return false;
+ //APPLY_CHROMAKEY(VV, STATS, FBZMODE, c_other);
+
+ /* compute a_other */
+ switch (FBZCP_CC_ASELECT(FBZCOLORPATH))
+ {
+ case 0: /* iterated alpha */
+ c_other.merge_alpha(srcColor);
+ break;
+
+ case 1: /* texture alpha */
+ c_other.merge_alpha(TEXELARGB);
+ break;
+
+ case 2: /* color1 alpha */
+ c_other.set_a((VV)->reg[color1].rgb.a);
+ break;
+
+ default: /* reserved */
+ c_other.set_a(0);
+ break;
+ }
+
+ /* handle alpha mask */
+ if (!alphaMaskTest(STATS, FBZMODE, c_other.get_a()))
+ return false;
+ //APPLY_ALPHAMASK(VV, STATS, FBZMODE, c_other.rgb.a);
+
+
+ /* compute c_local */
+ if (FBZCP_CC_LOCALSELECT_OVERRIDE(FBZCOLORPATH) == 0)
+ {
+ if (FBZCP_CC_LOCALSELECT(FBZCOLORPATH) == 0) /* iterated RGB */
+ c_local.set(srcColor);
+ else /* color0 RGB */
+ c_local.set((VV)->reg[color0].u);
+ }
+ else
+ {
+ if (!(TEXELARGB.get_a() & 0x80)) /* iterated RGB */
+ c_local.set(srcColor);
+ else /* color0 RGB */
+ c_local.set((VV)->reg[color0].u);
+ }
+
+ /* compute a_local */
+ switch (FBZCP_CCA_LOCALSELECT(FBZCOLORPATH))
+ {
+ default:
+ case 0: /* iterated alpha */
+ c_local.merge_alpha(srcColor);
+ break;
+
+ case 1: /* color0 alpha */
+ c_local.set_a((VV)->reg[color0].rgb.a);
+ break;
+
+ case 2: /* clamped iterated Z[27:20] */
+ {
+ int temp;
+ CLAMPED_Z(ITERZ, FBZCOLORPATH, temp);
+ c_local.set_a((UINT8) temp);
+ break;
+ }
+
+ case 3: /* clamped iterated W[39:32] */
+ {
+ int temp;
+ CLAMPED_W(ITERW, FBZCOLORPATH, temp); /* Voodoo 2 only */
+ c_local.set_a((UINT8) temp);
+ break;
+ }
+ }
+
+ UINT8 a_other = c_other.get_a();
+ UINT8 a_local = c_local.get_a();
+ UINT8 tmp;
+ rgbaint_t add_val(c_local);
+
+ /* select zero or c_other */
+ if (FBZCP_CC_ZERO_OTHER(FBZCOLORPATH))
+ c_other.and_imm_rgba(-1, 0, 0, 0);
+ //r = g = b = 0;
+
+ /* select zero or a_other */
+ if (FBZCP_CCA_ZERO_OTHER(FBZCOLORPATH))
+ c_other.set_a(0);
+
+ /* subtract a/c_local */
+ if (FBZCP_CC_SUB_CLOCAL(FBZCOLORPATH) || (FBZCP_CCA_SUB_CLOCAL(FBZCOLORPATH)))
+ {
+ rgbaint_t sub_val = c_local;
+
+ if (!FBZCP_CC_SUB_CLOCAL(FBZCOLORPATH))
+ sub_val.set(a_local, 0, 0, 0);
+
+ if (!FBZCP_CCA_SUB_CLOCAL(FBZCOLORPATH))
+ sub_val.set_a(0);
+
+ c_other.sub(sub_val);
+ }
+
+ /* blend RGB */
+ switch (FBZCP_CC_MSELECT(FBZCOLORPATH))
+ {
+ default: /* reserved */
+ case 0: /* 0 */
+ c_local.and_imm_rgba(-1, 0, 0, 0);
+ break;
+
+ case 1: /* c_local */
+ break;
+
+ case 2: /* a_other */
+ c_local.set(a_local, a_other, a_other, a_other);
+ break;
+
+ case 3: /* a_local */
+ c_local.set(a_local, a_local, a_local, a_local);
+ break;
+
+ case 4: /* texture alpha */
+ tmp = TEXELARGB.get_a();
+ c_local.set(a_local, tmp, tmp, tmp);
+ break;
+
+ case 5: /* texture RGB (Voodoo 2 only) */
+ c_local.set(TEXELARGB);
+ break;
+ }
+
+ /* blend alpha */
+ switch (FBZCP_CCA_MSELECT(FBZCOLORPATH))
+ {
+ default: /* reserved */
+ case 0: /* 0 */
+ c_local.set_a(0);
+ break;
+
+ case 1: /* a_local */
+ case 3: /* a_local */
+ c_local.set_a(a_local);
+ break;
+
+ case 2: /* a_other */
+ c_local.set_a(a_other);
+ break;
+
+ case 4: /* texture alpha */
+ c_local.merge_alpha(TEXELARGB);
+ break;
+ }
+
+ /* reverse the RGB blend */
+ if (!FBZCP_CC_REVERSE_BLEND(FBZCOLORPATH))
+ c_local.xor_imm_rgba(0, 0xff, 0xff, 0xff);
+
+ /* reverse the alpha blend */
+ if (!FBZCP_CCA_REVERSE_BLEND(FBZCOLORPATH))
+ c_local.xor_imm_rgba(0xff, 0, 0, 0);
+
+ /* do the blend */
+ //color.rgb.a = (color.rgb.a * (blenda + 1)) >> 8;
+ //color.rgb.r = (color.rgb.r * (blendr + 1)) >> 8;
+ //color.rgb.g = (color.rgb.g * (blendg + 1)) >> 8;
+ //color.rgb.b = (color.rgb.b * (blendb + 1)) >> 8;
+
+ /* add clocal or alocal to RGB */
+ switch (FBZCP_CC_ADD_ACLOCAL(FBZCOLORPATH))
+ {
+ case 3: /* reserved */
+ case 0: /* nothing */
+ add_val.set(a_local, 0, 0, 0);
+ break;
+
+ case 1: /* add c_local */
+ break;
+
+ case 2: /* add_alocal */
+ add_val.set(a_local, a_local, a_local, a_local);
+ break;
+ }
+
+ /* add clocal or alocal to alpha */
+ if (!FBZCP_CCA_ADD_ACLOCAL(FBZCOLORPATH))
+ add_val.set_a(0);
+ //color.rgb.a += c_local.rgb.a;
+
+ /* clamp */
+ //CLAMP(color.rgb.a, 0x00, 0xff);
+ //CLAMP(color.rgb.r, 0x00, 0xff);
+ //CLAMP(color.rgb.g, 0x00, 0xff);
+ //CLAMP(color.rgb.b, 0x00, 0xff);
+ c_local.add_imm(1);
+ c_other.scale_add_and_clamp(c_local, add_val);
+ srcColor.set(c_other);
+
+ /* invert */
+ if (FBZCP_CCA_INVERT_OUTPUT(FBZCOLORPATH))
+ srcColor.xor_imm_rgba(0xff, 0, 0, 0);
+ /* invert */
+ if (FBZCP_CC_INVERT_OUTPUT(FBZCOLORPATH))
+ srcColor.xor_imm_rgba(0, 0xff, 0xff, 0xff);
+
+
+ /* handle alpha test */
+ if (!alphaTest(VV, STATS, ALPHAMODE, srcColor.get_a()))
+ return false;
+ //APPLY_ALPHATEST(VV, STATS, ALPHAMODE, color.rgb.a);
+
+ return true;
+}
+
/*************************************
@@ -3553,7 +4411,7 @@ while (0)
* Rasterizer generator macro
*
*************************************/
-
+#if USE_OLD_RASTER == 1
#define RASTERIZER(name, TMUS, FBZCOLORPATH, FBZMODE, ALPHAMODE, FOGMODE, TEXMODE0, TEXMODE1) \
\
static void raster_##name(void *destbase, INT32 y, const poly_extent *extent, const void *extradata, int threadid) \
@@ -3639,18 +4497,16 @@ static void raster_##name(void *destbase, INT32 y, const poly_extent *extent, co
iters1 = extra->starts1 + dy * extra->ds1dy + dx * extra->ds1dx; \
itert1 = extra->startt1 + dy * extra->dt1dy + dx * extra->dt1dx; \
} \
- \
+ extra->info->hits++; \
/* loop in X */ \
for (x = startx; x < stopx; x++) \
{ \
- rgb_union iterargb = { 0 }; \
+ rgb_union iterargb; \
rgb_union texel = { 0 }; \
\
/* pixel pipeline part 1 handles depth setup and stippling */ \
- PIXEL_PIPELINE_BEGIN(v, stats, x, y, FBZCOLORPATH, FBZMODE, \
- iterz, iterw); \
- /* depth testing */ \
- DEPTH_TEST(v, stats, x, FBZMODE); \
+ PIXEL_PIPELINE_BEGIN(v, stats, x, y, FBZCOLORPATH, FBZMODE, iterz, iterw); \
+ DEPTH_TEST(v, stats, x, FBZMODE); \
\
/* run the texture pipeline on TMU1 to produce a value in texel */ \
/* note that they set LOD min to 8 to "disable" a TMU */ \
@@ -3663,23 +4519,18 @@ static void raster_##name(void *destbase, INT32 y, const poly_extent *extent, co
/* result in texel */ \
/* note that they set LOD min to 8 to "disable" a TMU */ \
if (TMUS >= 1 && v->tmu[0].lodmin < (8 << 8)) \
- { \
+ { \
if (!v->send_config) \
- { \
TEXTURE_PIPELINE(&v->tmu[0], x, dither4, TEXMODE0, texel, \
v->tmu[0].lookup, extra->lodbase0, \
- iters0, itert0, iterw0, texel); \
- } \
- else \
- { \
- texel.u=v->tmu_config; \
- } \
- } \
- \
+ iters0, itert0, iterw0, texel); \
+ else \
+ texel.u = v->tmu_config; \
+ } \
/* colorpath pipeline selects source colors and does blending */ \
CLAMPED_ARGB(iterr, iterg, iterb, itera, FBZCOLORPATH, iterargb); \
COLORPATH_PIPELINE(v, stats, FBZCOLORPATH, FBZMODE, ALPHAMODE, texel, \
- iterz, iterw, iterargb); \
+ iterz, iterw, iterargb); \
\
/* pixel pipeline part 2 handles fog, alpha, and final output */ \
PIXEL_PIPELINE_END(v, stats, dither, dither4, dither_lookup, x, dest, depth, \
@@ -3707,3 +4558,541 @@ static void raster_##name(void *destbase, INT32 y, const poly_extent *extent, co
} \
} \
}
+#else
+// New rasterizer implementation
+#define RASTERIZER(name, TMUS, FBZCOLORPATH, FBZMODE, ALPHAMODE, FOGMODE, TEXMODE0, TEXMODE1) \
+ \
+static void raster_##name(void *destbase, INT32 y, const poly_extent *extent, const void *extradata, int threadid) \
+{ \
+ const poly_extra_data *extra = (const poly_extra_data *)extradata; \
+ voodoo_state *v = extra->state; \
+ stats_block *stats = &v->thread_stats[threadid]; \
+ DECLARE_DITHER_POINTERS; \
+ INT32 startx = extent->startx; \
+ INT32 stopx = extent->stopx; \
+ rgbaint_t iterargb, iterargbDelta; \
+ INT32 iterz; \
+ INT64 iterw, iterw0 = 0, iterw1 = 0; \
+ INT64 iters0 = 0, iters1 = 0; \
+ INT64 itert0 = 0, itert1 = 0; \
+ UINT16 *depth; \
+ UINT16 *dest; \
+ INT32 dx, dy; \
+ INT32 scry; \
+ INT32 x; \
+ \
+ /* determine the screen Y */ \
+ scry = y; \
+ if (FBZMODE_Y_ORIGIN(FBZMODE)) \
+ scry = (v->fbi.yorigin - y) & 0x3ff; \
+ \
+ /* compute dithering */ \
+ COMPUTE_DITHER_POINTERS(FBZMODE, y); \
+ \
+ /* apply clipping */ \
+ if (FBZMODE_ENABLE_CLIPPING(FBZMODE)) \
+ { \
+ INT32 tempclip; \
+ \
+ /* Y clipping buys us the whole scanline */ \
+ if (scry < ((v->reg[clipLowYHighY].u >> 16) & 0x3ff) || \
+ scry >= (v->reg[clipLowYHighY].u & 0x3ff)) \
+ { \
+ stats->pixels_in += stopx - startx; \
+ stats->clip_fail += stopx - startx; \
+ return; \
+ } \
+ \
+ /* X clipping */ \
+ tempclip = (v->reg[clipLeftRight].u >> 16) & 0x3ff; \
+ if (startx < tempclip) \
+ { \
+ stats->pixels_in += tempclip - startx; \
+ v->stats.total_clipped += tempclip - startx; \
+ startx = tempclip; \
+ } \
+ tempclip = v->reg[clipLeftRight].u & 0x3ff; \
+ if (stopx >= tempclip) \
+ { \
+ stats->pixels_in += stopx - tempclip; \
+ v->stats.total_clipped += stopx - tempclip; \
+ stopx = tempclip - 1; \
+ } \
+ } \
+ \
+ /* get pointers to the target buffer and depth buffer */ \
+ dest = (UINT16 *)destbase + scry * v->fbi.rowpixels; \
+ depth = (v->fbi.auxoffs != ~0) ? ((UINT16 *)(v->fbi.ram + v->fbi.auxoffs) + scry * v->fbi.rowpixels) : NULL; \
+ \
+ /* compute the starting parameters */ \
+ dx = startx - (extra->ax >> 4); \
+ dy = y - (extra->ay >> 4); \
+ INT32 iterr = extra->startr + dy * extra->drdy + dx * extra->drdx; \
+ INT32 iterg = extra->startg + dy * extra->dgdy + dx * extra->dgdx; \
+ INT32 iterb = extra->startb + dy * extra->dbdy + dx * extra->dbdx; \
+ INT32 itera = extra->starta + dy * extra->dady + dx * extra->dadx; \
+ iterargb.set(itera, iterr, iterg, iterb); \
+ iterargbDelta.set(extra->dadx, extra->drdx, extra->dgdx, extra->dbdx); \
+ iterz = extra->startz + dy * extra->dzdy + dx * extra->dzdx; \
+ iterw = extra->startw + dy * extra->dwdy + dx * extra->dwdx; \
+ if (TMUS >= 1) \
+ { \
+ iterw0 = extra->startw0 + dy * extra->dw0dy + dx * extra->dw0dx; \
+ iters0 = extra->starts0 + dy * extra->ds0dy + dx * extra->ds0dx; \
+ itert0 = extra->startt0 + dy * extra->dt0dy + dx * extra->dt0dx; \
+ } \
+ if (TMUS >= 2) \
+ { \
+ iterw1 = extra->startw1 + dy * extra->dw1dy + dx * extra->dw1dx; \
+ iters1 = extra->starts1 + dy * extra->ds1dy + dx * extra->ds1dx; \
+ itert1 = extra->startt1 + dy * extra->dt1dy + dx * extra->dt1dx; \
+ } \
+ extra->info->hits++; \
+ /* loop in X */ \
+ for (x = startx; x < stopx; x++) \
+ { \
+ rgbaint_t texel(0); \
+ rgbaint_t color, preFog; \
+ \
+ /* pixel pipeline part 1 handles depth setup and stippling */ \
+ PIXEL_PIPELINE_BEGIN(v, stats, x, y, FBZCOLORPATH, FBZMODE, iterz, iterw); \
+ /* depth testing */ \
+ if (!depthTest((UINT16) v->reg[zaColor].u, stats, depth[x], FBZMODE, biasdepth)) \
+ goto skipdrawdepth; \
+ \
+ /* run the texture pipeline on TMU1 to produce a value in texel */ \
+ /* note that they set LOD min to 8 to "disable" a TMU */ \
+ if (TMUS >= 2 && v->tmu[1].lodmin < (8 << 8)) { \
+ INT32 tmp; \
+ const rgbaint_t texelZero(0); \
+ texel = genTexture(&v->tmu[1], x, dither4, TEXMODE1, v->tmu[1].lookup, extra->lodbase1, \
+ iters1, itert1, iterw1, tmp); \
+ texel = combineTexture(&v->tmu[1], TEXMODE1, texel, texelZero, tmp); \
+ } \
+ /* run the texture pipeline on TMU0 to produce a final */ \
+ /* result in texel */ \
+ /* note that they set LOD min to 8 to "disable" a TMU */ \
+ if (TMUS >= 1 && v->tmu[0].lodmin < (8 << 8)) \
+ { \
+ if (!v->send_config) \
+ { \
+ INT32 lod0; \
+ rgbaint_t texelT0; \
+ texelT0 = genTexture(&v->tmu[0], x, dither4, TEXMODE0, v->tmu[0].lookup, extra->lodbase0, \
+ iters0, itert0, iterw0, lod0); \
+ texel = combineTexture(&v->tmu[0], TEXMODE0, texelT0, texel, lod0); \
+ } \
+ else \
+ { \
+ texel.set(v->tmu_config); \
+ } \
+ } \
+ \
+ /* colorpath pipeline selects source colors and does blending */ \
+ color = clampARGB(iterargb, FBZCOLORPATH); \
+ if (!combineColor(v, stats, FBZCOLORPATH, FBZMODE, ALPHAMODE, texel, iterz, iterw, color)) \
+ goto skipdrawdepth; \
+ \
+ /* pixel pipeline part 2 handles fog, alpha, and final output */ \
+ PIXEL_PIPELINE_END(v, stats, dither, dither4, dither_lookup, x, dest, depth, \
+ FBZMODE, FBZCOLORPATH, ALPHAMODE, FOGMODE, \
+ iterz, iterw, iterargb); \
+ \
+ /* update the iterated parameters */ \
+ iterargb += iterargbDelta; \
+ iterz += extra->dzdx; \
+ iterw += extra->dwdx; \
+ if (TMUS >= 1) \
+ { \
+ iterw0 += extra->dw0dx; \
+ iters0 += extra->ds0dx; \
+ itert0 += extra->dt0dx; \
+ } \
+ if (TMUS >= 2) \
+ { \
+ iterw1 += extra->dw1dx; \
+ iters1 += extra->ds1dx; \
+ itert1 += extra->dt1dx; \
+ } \
+ } \
+}
+#endif
+// ******************************************************************************************************************************
+// Computes a log2 of a 16.32 value to 2 fractional bits of precision.
+// The return value is coded as a 24.8 value.
+// The maximum error using a 4 bit lookup from the mantissa is 0.0875, which is less than 1/2 lsb (0.125) for 2 bits of fraction.
+// ******************************************************************************************************************************
+INLINE INT32 ATTR_FORCE_INLINE new_log2(double &value)
+{
+ static const INT32 new_log2_table[16] = {0, 22, 44, 63, 82, 100, 118, 134, 150, 165, 179, 193, 207, 220, 232, 244};
+ UINT64 ival = *((UINT64 *)&value);
+ // We zero the result if negative so don't worry about the sign bit
+ INT32 exp = (ival>>52);
+ exp -= 1023+32;
+ exp <<= 8;
+ UINT32 addr = (UINT64)(ival>>48) & 0xf;
+ exp += new_log2_table[addr];
+ // Return 0 if negative
+ return (ival & ((UINT64)1<<63)) ? 0 : exp;
+}
+
+// Computes A/C and B/C and returns log2 of 1/C
+// A, B and C are 16.32 values. The results are 14.18.
+INLINE void ATTR_FORCE_INLINE multi_reciplog(INT64 valueA, INT64 valueB, INT64 valueC, INT32 &log, INT32 &resA, INT32 &resB)
+{
+ double recip = 1.0f/valueC;
+ double resAD = valueA * recip * ((INT64)1<<(47-29));
+ double resBD = valueB * recip * ((INT64)1<<(47-29));
+ log = new_log2(recip);
+ resA = resAD;
+ resB = resBD;
+}
+
+
+INLINE rgbaint_t ATTR_FORCE_INLINE genTexture(tmu_state *TT, INT32 x, const UINT8 *dither4, const UINT32 TEXMODE, rgb_t *LOOKUP, INT32 LODBASE, INT64 ITERS, INT64 ITERT, INT64 ITERW, INT32 &lod)
+{
+ rgbaint_t result;
+ INT32 s, t, ilod;
+
+ /* determine the S/T/LOD values for this texture */
+ lod = (LODBASE);
+ if (TEXMODE_ENABLE_PERSPECTIVE(TEXMODE))
+ {
+ INT32 wLog;
+ if (USE_FAST_RECIP) {
+ const INT32 oow = fast_reciplog((ITERW), &wLog);
+ s = ((INT64)oow * (ITERS)) >> 29;
+ t = ((INT64)oow * (ITERT)) >> 29;
+ } else {
+ multi_reciplog(ITERS, ITERT, ITERW, wLog, s, t);
+ }
+ lod += wLog;
+ }
+ else
+ {
+ s = (ITERS) >> 14;
+ t = (ITERT) >> 14;
+ }
+
+ /* clamp W */
+ if (TEXMODE_CLAMP_NEG_W(TEXMODE) && (ITERW) < 0)
+ {
+ s = t = 0;
+ }
+
+ /* clamp the LOD */
+ lod += (TT)->lodbias;
+ if (TEXMODE_ENABLE_LOD_DITHER(TEXMODE))
+ lod += dither4[x&3] << 4;
+ if (lod < (TT)->lodmin)
+ lod = (TT)->lodmin;
+ else if (lod > (TT)->lodmax)
+ lod = (TT)->lodmax;
+
+ /* now the LOD is in range; if we don't own this LOD, take the next one */
+ ilod = lod >> 8;
+ if (!(((TT)->lodmask >> ilod) & 1))
+ ilod++;
+
+ /* fetch the texture base */
+ UINT32 texbase = (TT)->lodoffset[ilod];
+
+ /* compute the maximum s and t values at this LOD */
+ INT32 smax = (TT)->wmask >> ilod;
+ INT32 tmax = (TT)->hmask >> ilod;
+
+ /* determine whether we are point-sampled or bilinear */
+ if ((lod == (TT)->lodmin && !TEXMODE_MAGNIFICATION_FILTER(TEXMODE)) ||
+ (lod != (TT)->lodmin && !TEXMODE_MINIFICATION_FILTER(TEXMODE)))
+ {
+ /* point sampled */
+
+ UINT32 texel0;
+
+ /* adjust S/T for the LOD and strip off the fractions */
+ s >>= ilod + 18;
+ t >>= ilod + 18;
+
+ /* clamp/wrap S/T if necessary */
+ if (TEXMODE_CLAMP_S(TEXMODE))
+ CLAMP(s, 0, smax);
+ if (TEXMODE_CLAMP_T(TEXMODE))
+ CLAMP(t, 0, tmax);
+ s &= smax;
+ t &= tmax;
+ t *= smax + 1;
+
+ /* fetch texel data */
+ if (TEXMODE_FORMAT(TEXMODE) < 8)
+ {
+ texel0 = *(UINT8 *)&(TT)->ram[(texbase + t + s) & (TT)->mask];
+ result.set((LOOKUP)[texel0]);
+ }
+ else
+ {
+ texel0 = *(UINT16 *)&(TT)->ram[(texbase + 2*(t + s)) & (TT)->mask];
+ if (TEXMODE_FORMAT(TEXMODE) >= 10 && TEXMODE_FORMAT(TEXMODE) <= 12)
+ result.set((LOOKUP)[texel0]);
+ else
+ result.set(((LOOKUP)[texel0 & 0xff] & 0xffffff) | ((texel0 & 0xff00) << 16));
+ }
+ }
+ else
+ {
+ /* bilinear filtered */
+
+ UINT32 texel0, texel1, texel2, texel3;
+ UINT32 sfrac, tfrac;
+ INT32 s1, t1;
+
+ /* adjust S/T for the LOD and strip off all but the low 8 bits of */
+ /* the fraction */
+ s >>= ilod + 10;
+ t >>= ilod + 10;
+
+ /* also subtract 1/2 texel so that (0.5,0.5) = a full (0,0) texel */
+ s -= 0x80;
+ t -= 0x80;
+
+ /* extract the fractions */
+ sfrac = s & (TT)->bilinear_mask;
+ tfrac = t & (TT)->bilinear_mask;
+
+ /* now toss the rest */
+ s >>= 8;
+ t >>= 8;
+ s1 = s + 1;
+ t1 = t + 1;
+
+ /* clamp/wrap S/T if necessary */
+ if (TEXMODE_CLAMP_S(TEXMODE))
+ {
+ if (s < 0) {
+ s = 0;
+ s1 = 0;
+ } else if (s >= smax) {
+ s = smax;
+ s1 = smax;
+ }
+ //CLAMP(s, 0, smax);
+ //CLAMP(s1, 0, smax);
+ } else {
+ s &= smax;
+ s1 &= smax;
+ }
+
+ if (TEXMODE_CLAMP_T(TEXMODE))
+ {
+ if (t < 0) {
+ t = 0;
+ t1 = 0;
+ } else if (t >= tmax) {
+ t = tmax;
+ t1 = tmax;
+ }
+ //CLAMP(t, 0, tmax);
+ //CLAMP(t1, 0, tmax);
+ } else {
+ t &= tmax;
+ t1 &= tmax;
+ }
+ t *= smax + 1;
+ t1 *= smax + 1;
+
+ /* fetch texel data */
+ if (TEXMODE_FORMAT(TEXMODE) < 8)
+ {
+ texel0 = *(UINT8 *)&(TT)->ram[(texbase + t + s)];
+ texel1 = *(UINT8 *)&(TT)->ram[(texbase + t + s1)];
+ texel2 = *(UINT8 *)&(TT)->ram[(texbase + t1 + s)];
+ texel3 = *(UINT8 *)&(TT)->ram[(texbase + t1 + s1)];
+ texel0 = (LOOKUP)[texel0];
+ texel1 = (LOOKUP)[texel1];
+ texel2 = (LOOKUP)[texel2];
+ texel3 = (LOOKUP)[texel3];
+ }
+ else
+ {
+ texel0 = *(UINT16 *)&(TT)->ram[(texbase + 2*(t + s))];
+ texel1 = *(UINT16 *)&(TT)->ram[(texbase + 2*(t + s1))];
+ texel2 = *(UINT16 *)&(TT)->ram[(texbase + 2*(t1 + s))];
+ texel3 = *(UINT16 *)&(TT)->ram[(texbase + 2*(t1 + s1))];
+ if (TEXMODE_FORMAT(TEXMODE) >= 10 && TEXMODE_FORMAT(TEXMODE) <= 12)
+ {
+ texel0 = (LOOKUP)[texel0];
+ texel1 = (LOOKUP)[texel1];
+ texel2 = (LOOKUP)[texel2];
+ texel3 = (LOOKUP)[texel3];
+ }
+ else
+ {
+ texel0 = ((LOOKUP)[texel0 & 0xff] & 0xffffff) | ((texel0 & 0xff00) << 16);
+ texel1 = ((LOOKUP)[texel1 & 0xff] & 0xffffff) | ((texel1 & 0xff00) << 16);
+ texel2 = ((LOOKUP)[texel2 & 0xff] & 0xffffff) | ((texel2 & 0xff00) << 16);
+ texel3 = ((LOOKUP)[texel3 & 0xff] & 0xffffff) | ((texel3 & 0xff00) << 16);
+ }
+ }
+
+ /* weigh in each texel */
+
+ result.bilinear_filter_rgbaint(texel0, texel1, texel2, texel3, sfrac, tfrac);
+ }
+ return result;
+}
+
+INLINE rgbaint_t ATTR_FORCE_INLINE combineTexture(tmu_state *TT, const UINT32 TEXMODE, rgbaint_t c_local, rgbaint_t c_other, INT32 lod)
+{
+ INT32 a_other = c_other.get_a();
+ INT32 a_local = c_local.get_a();
+ rgbaint_t add_val = c_local;
+ UINT8 tmp;
+
+ /* select zero/other for RGB */
+ if (TEXMODE_TC_ZERO_OTHER(TEXMODE))
+ c_other.and_imm_rgba(-1, 0, 0, 0);
+
+ /* select zero/other for alpha */
+ if (TEXMODE_TCA_ZERO_OTHER(TEXMODE))
+ c_other.set_a(0);
+
+ if (TEXMODE_TC_SUB_CLOCAL(TEXMODE) || TEXMODE_TCA_SUB_CLOCAL(TEXMODE))
+ {
+ rgbaint_t sub_val = c_local;
+
+ /* potentially subtract c_local */
+ if (!TEXMODE_TC_SUB_CLOCAL(TEXMODE))
+ sub_val.and_imm_rgba(-1, 0, 0, 0);
+
+ if (!TEXMODE_TCA_SUB_CLOCAL(TEXMODE))
+ sub_val.set_a(0);
+
+ c_other.sub(sub_val);
+ }
+
+ /* blend RGB */
+ switch (TEXMODE_TC_MSELECT(TEXMODE))
+ {
+ default: /* reserved */
+ case 0: /* zero */
+ c_local.and_imm_rgba(-1, 0, 0, 0);
+ break;
+
+ case 1: /* c_local */
+ break;
+
+ case 2: /* a_other */
+ c_local.set(a_local, a_other, a_other, a_other);
+ break;
+
+ case 3: /* a_local */
+ c_local.set(a_local, a_local, a_local, a_local);
+ break;
+
+ case 4: /* LOD (detail factor) */
+ if ((TT)->detailbias <= lod)
+ c_local.and_imm_rgba(-1, 0, 0, 0);
+ else
+ {
+ tmp = ((((TT)->detailbias - lod) << (TT)->detailscale) >> 8);
+ if (tmp > (TT)->detailmax)
+ tmp = (TT)->detailmax;
+ c_local.set(a_local, tmp, tmp, tmp);
+ }
+ break;
+
+ case 5: /* LOD fraction */
+ tmp = lod & 0xff;
+ c_local.set(a_local, tmp, tmp, tmp);
+ break;
+ }
+
+ /* blend alpha */
+ switch (TEXMODE_TCA_MSELECT(TEXMODE))
+ {
+ default: /* reserved */
+ case 0: /* zero */
+ c_local.set_a(0);
+ break;
+
+ case 1: /* c_local */
+ break;
+
+ case 2: /* a_other */
+ c_local.set_a(a_other);
+ break;
+
+ case 3: /* a_local */
+ break;
+
+ case 4: /* LOD (detail factor) */
+ if ((TT)->detailbias <= lod)
+ c_local.set_a(0);
+ else
+ {
+ tmp = ((((TT)->detailbias - lod) << (TT)->detailscale) >> 8);
+ if (tmp > (TT)->detailmax)
+ tmp = (TT)->detailmax;
+ c_local.set_a(tmp);
+ }
+ break;
+
+ case 5: /* LOD fraction */
+ c_local.set_a(lod & 0xff);
+ break;
+ }
+
+ /* reverse the RGB blend */
+ if (!TEXMODE_TC_REVERSE_BLEND(TEXMODE))
+ {
+ c_local.xor_imm_rgba(0, 0xff, 0xff, 0xff);
+ }
+
+ /* reverse the alpha blend */
+ if (!TEXMODE_TCA_REVERSE_BLEND(TEXMODE))
+ c_local.xor_imm_rgba(0xff, 0, 0, 0);
+
+ /* do the blend */
+ //tr = (tr * (blendr + 1)) >> 8;
+ //tg = (tg * (blendg + 1)) >> 8;
+ //tb = (tb * (blendb + 1)) >> 8;
+ //ta = (ta * (blenda + 1)) >> 8;
+
+ /* add clocal or alocal to RGB */
+ switch (TEXMODE_TC_ADD_ACLOCAL(TEXMODE))
+ {
+ case 3: /* reserved */
+ case 0: /* nothing */
+ add_val.set(a_local, 0, 0, 0);
+ break;
+
+ case 1: /* add c_local */
+ break;
+
+ case 2: /* add_alocal */
+ add_val.set(a_local, a_local , a_local , a_local);
+ //tr += c_local.rgb.a;
+ //tg += c_local.rgb.a;
+ //tb += c_local.rgb.a;
+ break;
+ }
+
+ /* add clocal or alocal to alpha */
+ if (!TEXMODE_TCA_ADD_ACLOCAL(TEXMODE))
+ add_val.set_a(0);
+ //ta += c_local.rgb.a;
+
+ /* clamp */
+ //result.rgb.r = (tr < 0) ? 0 : (tr > 0xff) ? 0xff : tr;
+ //result.rgb.g = (tg < 0) ? 0 : (tg > 0xff) ? 0xff : tg;
+ //result.rgb.b = (tb < 0) ? 0 : (tb > 0xff) ? 0xff : tb;
+ //result.rgb.a = (ta < 0) ? 0 : (ta > 0xff) ? 0xff : ta;
+ c_local.add_imm(1);
+ c_other.scale_add_and_clamp(c_local, add_val);
+ rgbaint_t result(c_other);
+ /* invert */
+ if (TEXMODE_TC_INVERT_OUTPUT(TEXMODE))
+ result.xor_imm_rgba(0, 0xff, 0xff, 0xff);
+ if (TEXMODE_TCA_INVERT_OUTPUT(TEXMODE))
+ result.xor_imm_rgba(0xff, 0, 0, 0);
+ return result;
+}
diff --git a/src/emu/video/voodoo.c b/src/emu/video/voodoo.c
index 1942aaa392f..774387c3921 100644
--- a/src/emu/video/voodoo.c
+++ b/src/emu/video/voodoo.c
@@ -174,7 +174,9 @@ bits(7:4) and bit(24)), X, and Y:
#define MODIFY_PIXEL(VV)
-
+// Need to turn off cycle eating when debugging MIPS drc
+// otherwise timer interrupts won't match nodrc debug mode.
+#define EAT_CYCLES (1)
/*************************************
@@ -211,7 +213,8 @@ static TIMER_CALLBACK( stall_cpu_callback );
static void stall_cpu(voodoo_state *v, int state, attotime current_time);
static TIMER_CALLBACK( vblank_callback );
static INT32 register_w(voodoo_state *v, offs_t offset, UINT32 data);
-static INT32 lfb_w(voodoo_state *v, offs_t offset, UINT32 data, UINT32 mem_mask, bool lfb_3d);
+static INT32 lfb_direct_w(voodoo_state *v, offs_t offset, UINT32 data, UINT32 mem_mask);
+static INT32 lfb_w(voodoo_state *v, offs_t offset, UINT32 data, UINT32 mem_mask);
static INT32 texture_w(voodoo_state *v, offs_t offset, UINT32 data);
static INT32 banshee_2d_w(voodoo_state *v, offs_t offset, UINT32 data);
@@ -892,7 +895,7 @@ static void swap_buffers(voodoo_state *v)
/* periodically log rasterizer info */
v->stats.swaps++;
- if (LOG_RASTERIZERS && v->stats.swaps % 100 == 0)
+ if (LOG_RASTERIZERS && v->stats.swaps % 1000 == 0)
dump_rasterizer_stats(v);
/* update the statistics (debug) */
@@ -1457,8 +1460,14 @@ INLINE INT32 prepare_tmu(tmu_state *t)
/* adjust the result: negative to get the log of the original value */
/* plus 12 to account for the extra exponent, and divided by 2 to */
/* get the log of the square root of texdx */
- (void)fast_reciplog(texdx, &lodbase);
- return (-lodbase + (12 << 8)) / 2;
+ #if USE_FAST_RECIP == 1
+ (void)fast_reciplog(texdx, &lodbase);
+ return (-lodbase + (12 << 8)) / 2;
+ #else
+ double tmpTex = texdx;
+ lodbase = new_log2(tmpTex);
+ return (lodbase + (12 << 8)) / 2;
+ #endif
}
@@ -1943,7 +1952,7 @@ static UINT32 cmdfifo_execute(voodoo_state *v, cmdfifo_info *f)
/* loop over words */
for (i = 0; i < count; i++)
- cycles += lfb_w(v, target++, *src++, 0xffffffff, true);
+ cycles += lfb_w(v, target++, *src++, 0xffffffff);
break;
}
@@ -2931,8 +2940,52 @@ default_case:
* Voodoo LFB writes
*
*************************************/
+static INT32 lfb_direct_w(voodoo_state *v, offs_t offset, UINT32 data, UINT32 mem_mask)
+{
+ UINT16 *dest;
+ UINT32 destmax;
+ int x, y;
+ UINT32 bufoffs;
+
+ /* statistics */
+ v->stats.lfb_writes++;
+
+ /* byte swizzling */
+ if (LFBMODE_BYTE_SWIZZLE_WRITES(v->reg[lfbMode].u))
+ {
+ data = FLIPENDIAN_INT32(data);
+ mem_mask = FLIPENDIAN_INT32(mem_mask);
+ }
-static INT32 lfb_w(voodoo_state *v, offs_t offset, UINT32 data, UINT32 mem_mask, bool lfb_3d)
+ /* word swapping */
+ if (LFBMODE_WORD_SWAP_WRITES(v->reg[lfbMode].u))
+ {
+ data = (data << 16) | (data >> 16);
+ mem_mask = (mem_mask << 16) | (mem_mask >> 16);
+ }
+
+ // TODO: This direct write is not verified.
+ // For direct lfb access just write the data
+ /* compute X,Y */
+ offset <<= 1;
+ x = offset & ((1 << v->fbi.lfb_stride) - 1);
+ y = (offset >> v->fbi.lfb_stride);
+ dest = (UINT16 *)(v->fbi.ram + v->fbi.lfb_base*4);
+ destmax = (v->fbi.mask + 1 - v->fbi.lfb_base*4) / 2;
+ bufoffs = y * v->fbi.rowpixels + x;
+ if (bufoffs >= destmax) {
+ logerror("lfb_direct_w: Buffer offset out of bounds x=%i y=%i offset=%08X bufoffs=%08X data=%08X\n", x, y, offset, (UINT32) bufoffs, data);
+ return 0;
+ }
+ if (ACCESSING_BITS_0_15)
+ dest[bufoffs + 0] = data&0xffff;
+ if (ACCESSING_BITS_16_31)
+ dest[bufoffs + 1] = data>>16;
+ if (LOG_LFB) logerror("VOODOO.%d.LFB:write direct (%d,%d) = %08X & %08X\n", v->index, x, y, data, mem_mask);
+ return 0;
+}
+
+static INT32 lfb_w(voodoo_state *v, offs_t offset, UINT32 data, UINT32 mem_mask)
{
UINT16 *dest, *depth;
UINT32 destmax, depthmax;
@@ -2943,29 +2996,6 @@ static INT32 lfb_w(voodoo_state *v, offs_t offset, UINT32 data, UINT32 mem_mask,
/* statistics */
v->stats.lfb_writes++;
- // TODO: This direct write is not verified.
- // For direct lfb access just write the data
- if (!lfb_3d) {
- UINT32 bufoffs;
- /* compute X,Y */
- offset <<= 1;
- x = offset & ((1 << v->fbi.lfb_stride) - 1);
- y = (offset >> v->fbi.lfb_stride);
- dest = (UINT16 *)(v->fbi.ram + v->fbi.lfb_base*4);
- destmax = (v->fbi.mask + 1 - v->fbi.lfb_base*4) / 2;
- bufoffs = y * v->fbi.rowpixels + x;
- if (bufoffs >= destmax) {
- logerror("LFB_W: Buffer offset out of bounds x=%i y=%i lfb_3d=%i offset=%08X bufoffs=%08X data=%08X\n", x, y, lfb_3d, offset, (UINT32) bufoffs, data);
- return 0;
- }
- if (ACCESSING_BITS_0_15)
- dest[bufoffs + 0] = data&0xffff;
- if (ACCESSING_BITS_16_31)
- dest[bufoffs + 1] = data>>16;
- if (LOG_LFB) logerror("VOODOO.%d.LFB:write direct (%d,%d) = %08X & %08X\n", v->index, x, y, data, mem_mask);
- return 0;
- }
-
/* byte swizzling */
if (LFBMODE_BYTE_SWIZZLE_WRITES(v->reg[lfbMode].u))
{
@@ -3187,9 +3217,6 @@ static INT32 lfb_w(voodoo_state *v, offs_t offset, UINT32 data, UINT32 mem_mask,
depth = (UINT16 *)(v->fbi.ram + v->fbi.auxoffs);
depthmax = (v->fbi.mask + 1 - v->fbi.auxoffs) / 2;
- /* wait for any outstanding work to finish */
- poly_wait(v->poly, "LFB Write");
-
/* simple case: no pipeline */
if (!LFBMODE_ENABLE_PIXEL_PIPELINE(v->reg[lfbMode].u))
{
@@ -3209,6 +3236,9 @@ static INT32 lfb_w(voodoo_state *v, offs_t offset, UINT32 data, UINT32 mem_mask,
/* compute dithering */
COMPUTE_DITHER_POINTERS_NO_DITHER_VAR(v->reg[fbzMode].u, y);
+ /* wait for any outstanding work to finish */
+ poly_wait(v->poly, "LFB Write");
+
/* loop over up to two pixels */
for (pix = 0; mask; pix++)
{
@@ -3281,8 +3311,6 @@ static INT32 lfb_w(voodoo_state *v, offs_t offset, UINT32 data, UINT32 mem_mask,
iterw = (UINT32) sw[pix] << 16;
}
INT32 iterz = sw[pix] << 12;
- rgb_union color;
- rgb_union iterargb = { 0 };
/* apply clipping */
if (FBZMODE_ENABLE_CLIPPING(v->reg[fbzMode].u))
@@ -3297,15 +3325,19 @@ static INT32 lfb_w(voodoo_state *v, offs_t offset, UINT32 data, UINT32 mem_mask,
goto nextpixel;
}
}
+ #if USE_OLD_RASTER == 1
+ rgb_union color;
+ rgb_union iterargb = { 0 };
+ #else
+ rgbaint_t color, preFog;
+ rgbaint_t iterargb(0);
+ #endif
/* pixel pipeline part 1 handles depth testing and stippling */
//PIXEL_PIPELINE_BEGIN(v, stats, x, y, v->reg[fbzColorPath].u, v->reg[fbzMode].u, iterz, iterw);
// Start PIXEL_PIPE_BEGIN copy
//#define PIXEL_PIPELINE_BEGIN(VV, STATS, XX, YY, FBZCOLORPATH, FBZMODE, ITERZ, ITERW)
- do
- {
INT32 fogdepth, biasdepth;
- INT32 prefogr, prefogg, prefogb;
INT32 r, g, b, a;
(stats)->pixels_in++;
@@ -3334,7 +3366,7 @@ static INT32 lfb_w(voodoo_state *v, offs_t offset, UINT32 data, UINT32 mem_mask,
if (((v->reg[stipple].u >> stipple_index) & 1) == 0)
{
v->stats.total_stippled++;
- goto skipdrawdepth;
+ goto nextpixel;
}
}
}
@@ -3343,25 +3375,46 @@ static INT32 lfb_w(voodoo_state *v, offs_t offset, UINT32 data, UINT32 mem_mask,
// Depth testing value for lfb pipeline writes is directly from write data, no biasing is used
fogdepth = biasdepth = (UINT32) sw[pix];
- /* Perform depth testing */
- DEPTH_TEST(v, stats, x, v->reg[fbzMode].u);
+ #if USE_OLD_RASTER == 1
+ /* Perform depth testing */
+ DEPTH_TEST(v, stats, x, v->reg[fbzMode].u);
+
+ /* use the RGBA we stashed above */
+ color.rgb.r = r = sr[pix];
+ color.rgb.g = g = sg[pix];
+ color.rgb.b = b = sb[pix];
+ color.rgb.a = a = sa[pix];
+
+ /* apply chroma key, alpha mask, and alpha testing */
+ APPLY_CHROMAKEY(v, stats, v->reg[fbzMode].u, color);
+ APPLY_ALPHAMASK(v, stats, v->reg[fbzMode].u, color.rgb.a);
+ APPLY_ALPHATEST(v, stats, v->reg[alphaMode].u, color.rgb.a);
+ #else
+ /* Perform depth testing */
+ if (!depthTest((UINT16) v->reg[zaColor].u, stats, depth[x], v->reg[fbzMode].u, biasdepth))
+ goto nextpixel;
+
+ /* use the RGBA we stashed above */
+ color.set(sa[pix], sr[pix], sg[pix], sb[pix]);
- /* use the RGBA we stashed above */
- color.rgb.r = r = sr[pix];
- color.rgb.g = g = sg[pix];
- color.rgb.b = b = sb[pix];
- color.rgb.a = a = sa[pix];
+ /* handle chroma key */
+ if (!chromaKeyTest(v, stats, v->reg[fbzMode].u, color))
+ goto nextpixel;
+ /* handle alpha mask */
+ if (!alphaMaskTest(stats, v->reg[fbzMode].u, color.get_a()))
+ goto nextpixel;
+ /* handle alpha test */
+ if (!alphaTest(v, stats, v->reg[alphaMode].u, color.get_a()))
+ goto nextpixel;
+ #endif
- /* apply chroma key, alpha mask, and alpha testing */
- APPLY_CHROMAKEY(v, stats, v->reg[fbzMode].u, color);
- APPLY_ALPHAMASK(v, stats, v->reg[fbzMode].u, color.rgb.a);
- APPLY_ALPHATEST(v, stats, v->reg[alphaMode].u, color.rgb.a);
+ /* wait for any outstanding work to finish */
+ poly_wait(v->poly, "LFB Write");
/* pixel pipeline part 2 handles color combine, fog, alpha, and final output */
PIXEL_PIPELINE_END(v, stats, dither, dither4, dither_lookup, x, dest, depth,
v->reg[fbzMode].u, v->reg[fbzColorPath].u, v->reg[alphaMode].u, v->reg[fogMode].u,
iterz, iterw, iterargb);
- }
nextpixel:
/* advance our pointers */
x++;
@@ -3594,7 +3647,7 @@ static void flush_fifos(voodoo_state *v, attotime current_time)
mem_mask &= 0xffff0000;
address &= 0xffffff;
- cycles = lfb_w(v, address, data, mem_mask, true);
+ cycles = lfb_w(v, address, data, mem_mask);
}
}
@@ -3720,7 +3773,7 @@ WRITE32_MEMBER( voodoo_device::voodoo_w )
else if (offset & (0x800000/4))
cycles = texture_w(v, offset, data);
else
- cycles = lfb_w(v, offset, data, mem_mask, true);
+ cycles = lfb_w(v, offset, data, mem_mask);
/* if we ended up with cycles, mark the operation pending */
if (cycles)
@@ -3900,7 +3953,7 @@ static UINT32 register_r(voodoo_state *v, offs_t offset)
/* bit 31 is not used */
/* eat some cycles since people like polling here */
- v->cpu->execute().eat_cycles(1000);
+ if (EAT_CYCLES) v->cpu->execute().eat_cycles(1000);
break;
/* bit 2 of the initEnable register maps this to dacRead */
@@ -3913,7 +3966,7 @@ static UINT32 register_r(voodoo_state *v, offs_t offset)
case vRetrace:
/* eat some cycles since people like polling here */
- v->cpu->execute().eat_cycles(10);
+ if (EAT_CYCLES) v->cpu->execute().eat_cycles(10);
result = v->screen->vpos();
break;
@@ -3928,7 +3981,7 @@ static UINT32 register_r(voodoo_state *v, offs_t offset)
result = v->fbi.cmdfifo[0].rdptr;
/* eat some cycles since people like polling here */
- v->cpu->execute().eat_cycles(1000);
+ if (EAT_CYCLES) v->cpu->execute().eat_cycles(1000);
break;
case cmdFifoAMin:
@@ -4757,7 +4810,7 @@ WRITE32_MEMBER( voodoo_banshee_device::banshee_w )
logerror("%s:banshee_w(YUV:%X) = %08X & %08X\n", machine().describe_context(), (offset*4) & 0x3fffff, data, mem_mask);
else if (offset < 0x2000000/4)
{
- lfb_w(v, offset & 0xffffff/4, data, mem_mask, true);
+ lfb_w(v, offset & 0xffffff/4, data, mem_mask);
} else {
logerror("%s:banshee_w Address out of range %08X = %08X & %08X\n", machine().describe_context(), (offset*4), data, mem_mask);
}
@@ -4791,7 +4844,7 @@ WRITE32_MEMBER( voodoo_banshee_device::banshee_fb_w )
}
}
else
- lfb_w(v, offset - v->fbi.lfb_base, data, mem_mask, false);
+ lfb_direct_w(v, offset - v->fbi.lfb_base, data, mem_mask);
}
@@ -5658,6 +5711,7 @@ static raster_info *add_rasterizer(voodoo_state *v, const raster_info *cinfo)
/* fill in the data */
info->hits = 0;
info->polys = 0;
+ info->hash = hash;
/* hook us into the hash table */
info->next = v->raster_hash[hash];
@@ -5665,7 +5719,7 @@ static raster_info *add_rasterizer(voodoo_state *v, const raster_info *cinfo)
if (LOG_RASTERIZERS)
printf("Adding rasterizer @ %p : cp=%08X am=%08X %08X fbzM=%08X tm0=%08X tm1=%08X (hash=%d)\n",
- info->callback,
+ (void *)info->callback,
info->eff_color_path, info->eff_alpha_mode, info->eff_fog_mode, info->eff_fbz_mode,
info->eff_tex_mode_0, info->eff_tex_mode_1, hash);
@@ -5760,7 +5814,7 @@ static void dump_rasterizer_stats(voodoo_state *v)
break;
/* print it */
- printf("RASTERIZER_ENTRY( 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X ) /* %c %8d %10d */\n",
+ printf("RASTERIZER_ENTRY( 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X ) /* %c %2d %8d %10d */\n",
best->eff_color_path,
best->eff_alpha_mode,
best->eff_fog_mode,
@@ -5768,6 +5822,7 @@ static void dump_rasterizer_stats(voodoo_state *v)
best->eff_tex_mode_0,
best->eff_tex_mode_1,
best->is_generic ? '*' : ' ',
+ best->hash,
best->polys,
best->hits);
@@ -6436,5 +6491,27 @@ RASTERIZER_ENTRY( 0x00602439, 0x00044119, 0x00000000, 0x000B0379, 0x00000009, 0x
//RASTERIZER_ENTRY( 0x00002809, 0x00004110, 0x00000001, 0x00030FFB, 0x08241AC7, 0xFFFFFFFF ) /* in-game */
//RASTERIZER_ENTRY( 0x00424219, 0x00000000, 0x00000001, 0x00030F7B, 0x08241AC7, 0xFFFFFFFF ) /* in-game */
//RASTERIZER_ENTRY( 0x0200421A, 0x00001510, 0x00000001, 0x00030F7B, 0x08241AC7, 0xFFFFFFFF ) /* in-game */
+/* gtfore06 ----> fbzColorPath alphaMode fogMode, fbzMode, texMode0, texMode1 hash */
+RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x000000C1, 0x00010F79, 0x0C261ACD, 0x0C261ACD ) /* 18 1064626 69362127 */
+RASTERIZER_ENTRY( 0x00002425, 0x00045119, 0x000000C1, 0x00010F79, 0x0C224A0D, 0x0C261ACD ) /* 47 3272483 31242799 */
+RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x000000C1, 0x00010F79, 0x00000ACD, 0x0C261ACD ) /* 9 221917 12348555 */
+RASTERIZER_ENTRY( 0x00002425, 0x00045110, 0x000000C1, 0x00010FF9, 0x00000ACD, 0x0C261ACD ) /* 26 57291 9357989 */
+RASTERIZER_ENTRY( 0x00002429, 0x00000000, 0x000000C1, 0x00010FF9, 0x00000A09, 0x0C261A0F ) /* 12 97156 8530607 */
+RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x000000C1, 0x00010F79, 0x000000C4, 0x0C261ACD ) /* 55 110144 5265532 */
+RASTERIZER_ENTRY( 0x00002425, 0x00045110, 0x000000C1, 0x00010FF9, 0x000000C4, 0x0C261ACD ) /* 61 16644 1079382 */
+RASTERIZER_ENTRY( 0x00002425, 0x00045119, 0x000000C1, 0x00010FF9, 0x000000C4, 0x0C261ACD ) /* 5 8332 1065229 */
+RASTERIZER_ENTRY( 0x00002425, 0x00045119, 0x000000C1, 0x00010F79, 0x0C224A0D, 0x0C261A0D ) /* 45 8148 505013 */
+RASTERIZER_ENTRY( 0x00002425, 0x00045119, 0x00000000, 0x00010F79, 0x0C224A0D, 0x0C261A0D ) /* 84 45233 248267 */
+RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x000000C1, 0x00010F79, 0x0C261ACD, 0x0C2610C4 ) /* 90 10235 193036 */
+RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x000000C1, 0x00010FF9, 0x0C261ACD, 0x0C261ACD ) /* * 29 3777 83777 */
+RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x00000000, 0x00010FF9, 0x0C261ACD, 0x042210C0 ) /* 2 24952 66761 */
+RASTERIZER_ENTRY( 0x00002429, 0x00000000, 0x00000000, 0x00010FF9, 0x00000A09, 0x0C261A0F ) /* 24 661 50222 */
+RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x00000000, 0x00010FF9, 0x0C261ACD, 0x04221AC9 ) /* 92 12504 43720 */
+RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x000000C1, 0x00010FF9, 0x0C261ACD, 0x0C2610C4 ) /* 79 2160 43650 */
+RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x00000000, 0x00010FF9, 0x000000C4, 0x04221AC9 ) /* 19 2796 30377 */
+RASTERIZER_ENTRY( 0x00002425, 0x00045119, 0x000000C1, 0x00010FF9, 0x00000ACD, 0x0C261ACD ) /* 67 1962 14755 */
+RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x000000C1, 0x00010FF9, 0x000000C4, 0x0C261ACD ) /* * 66 74 3951 */
+RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x00000000, 0x00010FF9, 0x00000ACD, 0x04221AC9 ) /* 70 374 3691 */
+RASTERIZER_ENTRY( 0x00482405, 0x00045119, 0x000000C1, 0x00010FF9, 0x00000ACD, 0x0C261ACD ) /* * 20 350 7928 */
#endif
diff --git a/src/lib/formats/2d_dsk.c b/src/lib/formats/2d_dsk.c
new file mode 100644
index 00000000000..7f304b4eaa0
--- /dev/null
+++ b/src/lib/formats/2d_dsk.c
@@ -0,0 +1,41 @@
+// license:GPL-2.0+
+// copyright-holders:Dirk Best
+/***************************************************************************
+
+ 2D
+
+ Disk image format used by early Sharp computers
+
+***************************************************************************/
+
+#include "2d_dsk.h"
+
+_2d_format::_2d_format() : wd177x_format(formats)
+{
+}
+
+const char *_2d_format::name() const
+{
+ return "2d";
+}
+
+const char *_2d_format::description() const
+{
+ return "2D disk image";
+}
+
+const char *_2d_format::extensions() const
+{
+ return "2d";
+}
+
+const _2d_format::format _2d_format::formats[] =
+{
+ {
+ floppy_image::FF_525, floppy_image::DSDD, floppy_image::MFM,
+ 2000, 16, 40, 2, 256, {}, 1, {}, 32, 22, 54
+ },
+ {}
+};
+
+const floppy_format_type FLOPPY_2D_FORMAT = &floppy_image_format_creator<_2d_format>;
diff --git a/src/lib/formats/2d_dsk.h b/src/lib/formats/2d_dsk.h
new file mode 100644
index 00000000000..ab70b95f21a
--- /dev/null
+++ b/src/lib/formats/2d_dsk.h
@@ -0,0 +1,33 @@
+// license:GPL-2.0+
+// copyright-holders:Dirk Best
+/***************************************************************************
+
+ Sharp 2D
+
+ Disk image format
+
+***************************************************************************/
+
+#pragma once
+
+#ifndef __2D_DSK_H__
+#define __2D_DSK_H__
+
+#include "wd177x_dsk.h"
+
+class _2d_format : public wd177x_format
+{
+public:
+ _2d_format();
+
+ virtual const char *name() const;
+ virtual const char *description() const;
+ virtual const char *extensions() const;
+
+private:
+ static const format formats[];
+};
+
+extern const floppy_format_type FLOPPY_2D_FORMAT;
+
+#endif // __2D_DSK_H__
diff --git a/src/lib/formats/ap2_dsk.c b/src/lib/formats/ap2_dsk.c
index 4425d3fae99..e20b96e438a 100644
--- a/src/lib/formats/ap2_dsk.c
+++ b/src/lib/formats/ap2_dsk.c
@@ -668,7 +668,7 @@ bool a2_16sect_format::load(io_generic *io, UINT32 form_factor, floppy_image *im
}
fpos += 256*16;
- for(int i=0; i<51; i++)
+ for(int i=0; i<49; i++)
raw_w(track_data, 10, 0x3fc);
for(int i=0; i<16; i++) {
int sector;
@@ -698,6 +698,7 @@ bool a2_16sect_format::load(io_generic *io, UINT32 form_factor, floppy_image *im
raw_w(track_data, 9, 0x01fe);
raw_w(track_data, 24, 0xd5aaad);
+ raw_w(track_data, 1, 0);
UINT8 pval = 0x00;
for(int i=0; i<342; i++) {
@@ -721,7 +722,7 @@ bool a2_16sect_format::load(io_generic *io, UINT32 form_factor, floppy_image *im
raw_w(track_data, 8, translate6[pval]);
raw_w(track_data, 24, 0xdeaaeb);
}
- raw_w(track_data, 4, 0xff);
+ raw_w(track_data, 8, 0xff);
assert(track_data.size() == 51090);
generate_track_from_levels(track, 0, track_data, 0, image);
diff --git a/src/lib/formats/apridisk.c b/src/lib/formats/apridisk.c
index 46dfaf96c36..b19e2c26bd7 100644
--- a/src/lib/formats/apridisk.c
+++ b/src/lib/formats/apridisk.c
@@ -2,226 +2,147 @@
// copyright-holders:Dirk Best
/***************************************************************************
- APRIDISK disk image format
+ APRIDISK
-***************************************************************************/
-
-#include "emu.h" // fatalerror
-#include "apridisk.h"
-#include "imageutl.h"
-#include "coretmpl.h"
-
-/***************************************************************************
- CONSTANTS
-***************************************************************************/
-
-#define APR_HEADER_SIZE 128
-
-/* sector types */
-#define APR_DELETED 0xe31d0000
-#define APR_MAGIC 0xe31d0001
-#define APR_COMMENT 0xe31d0002
-#define APR_CREATOR 0xe31d0003
-
-/* compression type */
-#define APR_UNCOMPRESSED 0x9e90
-#define APR_COMPRESSED 0x3e5a
-
-static const char *apr_magic = "ACT Apricot disk image\x1a\x04";
-
-
-/***************************************************************************
- TYPE DEFINITIONS
-***************************************************************************/
-
-struct apr_sector
-{
- int head;
- int track;
- int sector;
- UINT8 data[512];
-};
+ Disk image format for the ACT Apricot
-struct apr_tag
-{
- int heads;
- int tracks;
- int sectors_per_track;
- struct apr_sector sectors[2880];
- char *comment;
-};
-
-
-/***************************************************************************
- IMPLEMENTATION
***************************************************************************/
-/* sector format:
- *
- * 00-03: sector type
- * 04-05: compression type
- * 06-07: header size
- * 08-11: data size
- * 12-13: track
- * 14: head
- * 15: sector
- */
-
-static floperr_t apr_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
-{
- struct apr_tag *tag = (apr_tag *)floppy_tag(floppy);
-// printf("apr_read_sector %d %d %d\n", head, track, sector);
- memcpy(buffer, tag->sectors[head * track * sector].data, buflen);
- return FLOPPY_ERROR_SUCCESS;
-}
+#include "emu.h"
+#include "imageutl.h"
+#include "apridisk.h"
-static floperr_t apr_read_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
+apridisk_format::apridisk_format()
{
- struct apr_tag *tag = (apr_tag *)floppy_tag(floppy);
-// printf("apr_read_indexed_sector %d %d %d\n", head, track, sector);
- memcpy(buffer, tag->sectors[head * track * sector].data, buflen);
- return FLOPPY_ERROR_SUCCESS;
}
-/* sector length is always 512 byte */
-static floperr_t apr_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *sector_length)
+const char *apridisk_format::name() const
{
- *sector_length = 512;
- return FLOPPY_ERROR_SUCCESS;
+ return "apridisk";
}
-static int apr_get_heads_per_disk(floppy_image_legacy *floppy)
+const char *apridisk_format::description() const
{
- struct apr_tag *tag = (apr_tag *)floppy_tag(floppy);
- return tag->heads;
+ return "APRIDISK disk image";
}
-static int apr_get_tracks_per_disk(floppy_image_legacy *floppy)
+const char *apridisk_format::extensions() const
{
- struct apr_tag *tag = (apr_tag *)floppy_tag(floppy);
- return tag->tracks;
+ return "dsk";
}
-static floperr_t apr_get_indexed_sector_info(floppy_image_legacy *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags)
-{
- struct apr_tag *tag = (apr_tag *)floppy_tag(floppy);
-
-// printf("apr_get_indexed_sector_info %d %d %d\n", head, track, sector_index);
-
- /* sanity checks */
- if (head < 0 || head > (tag->heads - 1)) return FLOPPY_ERROR_SEEKERROR;
- if (track < 0 || track > (tag->tracks - 1)) return FLOPPY_ERROR_SEEKERROR;
- if (sector_index < 0 || sector_index > (tag->sectors_per_track - 1)) return FLOPPY_ERROR_SEEKERROR;
-
- if (cylinder) *cylinder = tag->sectors[head * track * sector_index].track;
- if (side) *side = tag->sectors[head * track * sector_index].head;
- if (sector) *sector = tag->sectors[head * track * sector_index].sector;
- if (sector_length) *sector_length = 512;
-
- return FLOPPY_ERROR_SUCCESS;
-}
-
-FLOPPY_IDENTIFY( apridisk_identify )
+int apridisk_format::identify(io_generic *io, UINT32 form_factor)
{
UINT8 header[APR_HEADER_SIZE];
+ io_generic_read(io, header, 0, APR_HEADER_SIZE);
- /* get header */
- floppy_image_read(floppy, &header, 0, sizeof(header));
+ const char magic[] = "ACT Apricot disk image\x1a\x04";
- /* look for the magic string */
- if (memcmp(header, apr_magic, sizeof(*apr_magic)) == 0)
- *vote = 100;
+ if (memcmp(header, magic, sizeof(magic) - 1) == 0)
+ return 100;
else
- *vote = 0;
-
- return FLOPPY_ERROR_SUCCESS;
+ return 0;
}
-FLOPPY_CONSTRUCT( apridisk_construct )
+bool apridisk_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
{
- struct FloppyCallbacks *callbacks;
- struct apr_tag *tag;
-
- int cur_sector = 0;
- UINT8 sector_header[16];
- UINT64 pos = 128;
- UINT32 type;
-
- tag = (apr_tag *)floppy_create_tag(floppy, sizeof(struct apr_tag));
+ desc_pc_sector sectors[80][2][18];
+ UINT8 sector_data[MAX_SECTORS * SECTOR_SIZE];
+ UINT8 *data_ptr = sector_data;
+ int track_count = 0, head_count = 0, sector_count = 0;
- if (!tag)
- return FLOPPY_ERROR_OUTOFMEMORY;
+ UINT64 file_size = io_generic_size(io);
+ UINT64 file_offset = APR_HEADER_SIZE;
- tag->heads = 0;
- tag->tracks = 0;
- tag->sectors_per_track = 0;
-
- floppy_image_read(floppy, &sector_header, pos, 16);
- type = pick_integer_le(&sector_header, 0, 4);
-
- while (type == APR_DELETED || type == APR_MAGIC || type == APR_COMMENT || type == APR_CREATOR)
+ while (file_offset < file_size)
{
+ // read sector header
+ UINT8 sector_header[16];
+ io_generic_read(io, sector_header, file_offset, 16);
+
+ UINT32 type = pick_integer_le(&sector_header, 0, 4);
UINT16 compression = pick_integer_le(&sector_header, 4, 2);
UINT16 header_size = pick_integer_le(&sector_header, 6, 2);
UINT32 data_size = pick_integer_le(&sector_header, 8, 4);
- tag->sectors[cur_sector].head = pick_integer_le(&sector_header, 12, 1);
- tag->sectors[cur_sector].sector = pick_integer_le(&sector_header, 13, 1);
- tag->sectors[cur_sector].track = pick_integer_le(&sector_header, 14, 1);
-
- pos += header_size;
+ file_offset += header_size;
- if (type == APR_MAGIC)
+ switch (type)
{
- if (compression == APR_UNCOMPRESSED)
- {
- floppy_image_read(floppy, &tag->sectors[cur_sector].data, pos, data_size);
-
- }
- else if (compression == APR_COMPRESSED)
+ case APR_SECTOR:
+ UINT8 head = pick_integer_le(&sector_header, 12, 1);
+ UINT8 sector = pick_integer_le(&sector_header, 13, 1);
+ UINT8 track = (UINT8) pick_integer_le(&sector_header, 14, 2);
+
+ track_count = MAX(track_count, track);
+ head_count = MAX(head_count, head);
+ sector_count = MAX(sector_count, sector);
+
+ // build sector info
+ sectors[track][head][sector - 1].head = head;
+ sectors[track][head][sector - 1].sector = sector;
+ sectors[track][head][sector - 1].track = track;
+ sectors[track][head][sector - 1].size = SECTOR_SIZE >> 8;
+ sectors[track][head][sector - 1].actual_size = SECTOR_SIZE;
+ sectors[track][head][sector - 1].deleted = false;
+ sectors[track][head][sector - 1].bad_crc = false;
+
+ // read sector data
+ switch (compression)
{
- dynamic_buffer buffer(data_size);
- UINT16 length;
- UINT8 value;
+ case APR_COMPRESSED:
+ {
+ UINT8 comp[3];
+ io_generic_read(io, comp, file_offset, 3);
+ UINT16 length = pick_integer_le(comp, 0, 2);
- floppy_image_read(floppy, &buffer[0], pos, data_size);
+ if (length != SECTOR_SIZE)
+ fatalerror("apridisk_format: Invalid compression length %04x\n", length);
- length = pick_integer_le(&buffer[0], 0, 2);
- value = pick_integer_le(&buffer[0], 2, 1);
-
- /* not sure if this is possible */
- if (length != 512) {
- fatalerror("Compression unsupported\n");
+ memset(data_ptr, comp[2], SECTOR_SIZE);
}
+ break;
+
+ case APR_UNCOMPRESSED:
+ io_generic_read(io, data_ptr, file_offset, SECTOR_SIZE);
+ break;
- memset(&tag->sectors[cur_sector].data, value, length);
+ default:
+ fatalerror("apridisk_format: Invalid compression %04x\n", compression);
}
- else
- return FLOPPY_ERROR_INVALIDIMAGE;
- tag->heads = MAX(tag->sectors[cur_sector].head, tag->heads);
- tag->tracks = MAX(tag->sectors[cur_sector].track, tag->tracks);
- tag->sectors_per_track = MAX(tag->sectors[cur_sector].sector, tag->sectors_per_track);
- }
+ sectors[track][head][sector - 1].data = data_ptr;
+ data_ptr += SECTOR_SIZE;
- /* seek to next sector */
- pos += data_size;
- cur_sector++;
+ break;
- floppy_image_read(floppy, &sector_header, pos, 16);
- type = pick_integer_le(&sector_header, 0, 4);
+ }
+
+ file_offset += data_size;
}
- tag->heads++;
- tag->tracks++;
+ // track/head index are zero-based, so increase the final count by 1
+ track_count++;
+ head_count++;
+
+ int cell_count = (sector_count == 18 ? 200000 : 100000);
- callbacks = floppy_callbacks(floppy);
- callbacks->read_sector = apr_read_sector;
- callbacks->read_indexed_sector = apr_read_indexed_sector;
- callbacks->get_sector_length = apr_get_sector_length;
- callbacks->get_heads_per_disk = apr_get_heads_per_disk;
- callbacks->get_tracks_per_disk = apr_get_tracks_per_disk;
- callbacks->get_indexed_sector_info = apr_get_indexed_sector_info;
+ // now build our final track info
+ for (int track = 0; track < track_count; track++)
+ for (int head = 0; head < head_count; head++)
+ build_pc_track_mfm(track, head, image, cell_count, sector_count, sectors[track][head], 84, 80, 50, 22);
- return FLOPPY_ERROR_SUCCESS;
+ return true;
}
+
+bool apridisk_format::save(io_generic *io, floppy_image *image)
+{
+ return false;
+}
+
+bool apridisk_format::supports_save() const
+{
+ return false;
+}
+
+const floppy_format_type FLOPPY_APRIDISK_FORMAT = &floppy_image_format_creator<apridisk_format>;
diff --git a/src/lib/formats/apridisk.h b/src/lib/formats/apridisk.h
index d33743d8711..6eb5fc4617e 100644
--- a/src/lib/formats/apridisk.h
+++ b/src/lib/formats/apridisk.h
@@ -2,16 +2,56 @@
// copyright-holders:Dirk Best
/***************************************************************************
- APRIDISK disk image format
+ APRIDISK
+
+ Disk image format for the ACT Apricot
***************************************************************************/
+#pragma once
+
#ifndef __APRIDISK_H__
#define __APRIDISK_H__
#include "flopimg.h"
-FLOPPY_IDENTIFY( apridisk_identify );
-FLOPPY_CONSTRUCT( apridisk_construct );
+class apridisk_format : public floppy_image_format_t
+{
+public:
+ apridisk_format();
+
+ virtual const char *name() const;
+ virtual const char *description() const;
+ virtual const char *extensions() const;
+
+ virtual int identify(io_generic *io, UINT32 form_factor);
+ virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image);
+ virtual bool save(io_generic *io, floppy_image *image);
+ virtual bool supports_save() const;
+
+private:
+ static const int APR_HEADER_SIZE = 128;
+
+ // sector types
+ enum
+ {
+ APR_DELETED = 0xe31d0000,
+ APR_SECTOR = 0xe31d0001,
+ APR_COMMENT = 0xe31d0002,
+ APR_CREATOR = 0xe31d0003
+ };
+
+ // compression types
+ enum
+ {
+ APR_UNCOMPRESSED = 0x9e90,
+ APR_COMPRESSED = 0x3e5a
+ };
+
+ static const int SECTOR_SIZE = 512;
+ static const int MAX_SECTORS = 2880; // enough for a hd disk image
+};
+
+extern const floppy_format_type FLOPPY_APRIDISK_FORMAT;
-#endif /* __APRIDISK_H__ */
+#endif // __APRIDISK_H__
diff --git a/src/lib/formats/atarist_dsk.c b/src/lib/formats/atarist_dsk.c
deleted file mode 100644
index eb559a940c4..00000000000
--- a/src/lib/formats/atarist_dsk.c
+++ /dev/null
@@ -1,86 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Miodrag Milanovic
-/*********************************************************************
-
- formats/atarist_dsk.c
-
- Atari ST disk images
-
-*********************************************************************/
-
-#include <assert.h>
-
-#include "formats/atarist_dsk.h"
-#include "formats/basicdsk.h"
-
-/*
-
- TODO:
-
- - MSA format
- - STT format
- - DIM format
-
-*/
-
-/***************************************************************************
- CONSTANTS / MACROS
-***************************************************************************/
-
-#define LOG 0
-
-/***************************************************************************
- IMPLEMENTATION
-***************************************************************************/
-
-/*-------------------------------------------------
- FLOPPY_IDENTIFY( atarist_st_identify )
--------------------------------------------------*/
-
-static FLOPPY_IDENTIFY( atarist_st_identify )
-{
- *vote = 100;
-
- return FLOPPY_ERROR_SUCCESS;
-}
-
-/*-------------------------------------------------
- FLOPPY_CONSTRUCT( atarist_st_construct )
--------------------------------------------------*/
-
-static FLOPPY_CONSTRUCT( atarist_st_construct )
-{
- int heads = 0;
- int tracks = 0;
- int sectors = 0;
- UINT8 bootsector[512];
-
- floppy_image_read(floppy, bootsector, 0, 512);
- sectors = bootsector[0x18];
- heads = bootsector[0x1a];
- tracks = (bootsector[0x13] | (bootsector[0x14] << 8)) / sectors / heads;
-
- struct basicdsk_geometry geometry;
- memset(&geometry, 0, sizeof(geometry));
-
- geometry.heads = heads;
- geometry.first_sector_id = 1;
- geometry.sector_length = 512;
- geometry.tracks = tracks;
- geometry.sectors = sectors;
-
- if (LOG) LOG_FORMATS("ST Heads %d Tracks %d Sectors %d\n", heads, tracks, sectors);
-
- return basicdsk_construct(floppy, &geometry);
-}
-
-/*-------------------------------------------------
- FLOPPY_CONSTRUCT(atarist_dsk_construct)
--------------------------------------------------*/
-
-LEGACY_FLOPPY_OPTIONS_START( atarist )
- LEGACY_FLOPPY_OPTION( atarist, "st", "Atari ST floppy disk image", atarist_st_identify, atarist_st_construct, NULL, NULL )
-/* LEGACY_FLOPPY_OPTION( atarist, "stt", "Atari ST floppy disk image", atarist_stt_identify, atarist_stt_construct, NULL, NULL )
- LEGACY_FLOPPY_OPTION( atarist, "msa", "Atari ST floppy disk image", atarist_msa_identify, atarist_msa_construct, NULL, NULL )
- LEGACY_FLOPPY_OPTION( atarist, "dim", "Atari ST floppy disk image", atarist_dim_identify, atarist_dim_construct, NULL, NULL )*/
-LEGACY_FLOPPY_OPTIONS_END
diff --git a/src/lib/formats/atarist_dsk.h b/src/lib/formats/atarist_dsk.h
deleted file mode 100644
index 6c86e456a5b..00000000000
--- a/src/lib/formats/atarist_dsk.h
+++ /dev/null
@@ -1,20 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Miodrag Milanovic
-/*********************************************************************
-
- formats/atarist_dsk.h
-
- atarist disk images
-
-*********************************************************************/
-
-#ifndef ATARIST_DSK_H
-#define ATARIST_DSK_H
-
-#include "flopimg.h"
-
-/**************************************************************************/
-
-LEGACY_FLOPPY_OPTIONS_EXTERN(atarist);
-
-#endif /* ATARIST_DSK_H */
diff --git a/src/lib/formats/camplynx_cas.c b/src/lib/formats/camplynx_cas.c
index 8c467314e5a..02133da4da4 100644
--- a/src/lib/formats/camplynx_cas.c
+++ b/src/lib/formats/camplynx_cas.c
@@ -23,7 +23,7 @@ Each byte is 8 bits (MSB first) with no start or stop bits.
********************************************************************/
-#include <assert.h>
+#include "emu.h" // for popmessage and <string>
#include "camplynx_cas.h"
@@ -84,13 +84,13 @@ static int camplynx_handle_cassette(INT16 *buffer, const UINT8 *bytes)
UINT32 byte_count = 0;
UINT32 i;
-
/* header zeroes */
for (i=0; i<555; i++)
sample_count += camplynx_output_byte(buffer, sample_count, 0);
if (bytes[0] == 0x22)
{
+ std::string pgmname = " LOAD \"";
byte_count++;
sample_count += camplynx_output_byte(buffer, sample_count, 0xA5);
sample_count += camplynx_output_byte(buffer, sample_count, 0x22);
@@ -99,14 +99,25 @@ static int camplynx_handle_cassette(INT16 *buffer, const UINT8 *bytes)
for (i=1; bytes[i]!=0x22; i++)
{
if (i < camplynx_image_size)
+ {
sample_count += camplynx_output_byte(buffer, sample_count, bytes[i]);
+ pgmname.append(1, (char)bytes[i]);
+ }
else
return sample_count;
byte_count++;
}
+ pgmname.append(1, (char)0x22);
sample_count += camplynx_output_byte(buffer, sample_count, bytes[byte_count++]); // should be 0x22
+ // if a machine-language program, say to use MLOAD
+ if (bytes[byte_count] == 0x4D)
+ pgmname[0] = (char)0x4D;
+
+ // Tell user how to load the tape
+ popmessage("%s",pgmname.c_str());
+
/* data zeroes */
for (i=0; i<555; i++)
sample_count += camplynx_output_byte(buffer, sample_count, 0);
diff --git a/src/lib/formats/cd90_640_dsk.c b/src/lib/formats/cd90_640_dsk.c
new file mode 100644
index 00000000000..1654d5d8c99
--- /dev/null
+++ b/src/lib/formats/cd90_640_dsk.c
@@ -0,0 +1,56 @@
+// license:GPL-2.0+
+// copyright-holders:Dirk Best
+/***************************************************************************
+
+ Thompson CD90-640 FDC
+
+ Disk image format
+
+ TODO:
+ - Gap sizes unverified for FM
+
+***************************************************************************/
+
+#include "cd90_640_dsk.h"
+
+cd90_640_format::cd90_640_format() : wd177x_format(formats)
+{
+}
+
+const char *cd90_640_format::name() const
+{
+ return "cd90_640";
+}
+
+const char *cd90_640_format::description() const
+{
+ return "CD90-640 disk image";
+}
+
+const char *cd90_640_format::extensions() const
+{
+ return "fd";
+}
+
+const cd90_640_format::format cd90_640_format::formats[] =
+{
+ {
+ floppy_image::FF_525, floppy_image::SSSD, floppy_image::FM,
+ 4000, 16, 40, 1, 128, {}, 1, {}, 14, 11, 12
+ },
+ {
+ floppy_image::FF_525, floppy_image::SSDD, floppy_image::MFM,
+ 2000, 16, 40, 1, 256, {}, 1, {}, 31, 22, 44
+ },
+ {
+ floppy_image::FF_525, floppy_image::DSSD, floppy_image::FM,
+ 4000, 16, 40, 2, 128, {}, 1, {}, 14, 11, 12
+ },
+ {
+ floppy_image::FF_525, floppy_image::DSDD, floppy_image::MFM,
+ 2000, 16, 40, 2, 256, {}, 1, {}, 31, 22, 44
+ },
+ {}
+};
+
+const floppy_format_type FLOPPY_CD90_640_FORMAT = &floppy_image_format_creator<cd90_640_format>;
diff --git a/src/lib/formats/cd90_640_dsk.h b/src/lib/formats/cd90_640_dsk.h
new file mode 100644
index 00000000000..ccf80508047
--- /dev/null
+++ b/src/lib/formats/cd90_640_dsk.h
@@ -0,0 +1,33 @@
+// license:GPL-2.0+
+// copyright-holders:Dirk Best
+/***************************************************************************
+
+ Thompson CD90-640 FDC
+
+ Disk image format
+
+***************************************************************************/
+
+#pragma once
+
+#ifndef __CD90_640_DSK_H__
+#define __CD90_640_DSK_H__
+
+#include "wd177x_dsk.h"
+
+class cd90_640_format : public wd177x_format
+{
+public:
+ cd90_640_format();
+
+ virtual const char *name() const;
+ virtual const char *description() const;
+ virtual const char *extensions() const;
+
+private:
+ static const format formats[];
+};
+
+extern const floppy_format_type FLOPPY_CD90_640_FORMAT;
+
+#endif // __CD90_640_DSK_H__
diff --git a/src/lib/formats/cgenie_dsk.c b/src/lib/formats/cgenie_dsk.c
index 895651acbe2..827830682ec 100644
--- a/src/lib/formats/cgenie_dsk.c
+++ b/src/lib/formats/cgenie_dsk.c
@@ -29,6 +29,16 @@ const char *cgenie_format::extensions() const
return "dsk";
}
+int cgenie_format::get_track_dam_fm(const format &f, int head, int track)
+{
+ return (track == f.track_count/2) ? FM_DDAM : FM_DAM;
+}
+
+int cgenie_format::get_track_dam_mfm(const format &f, int head, int track)
+{
+ return (track == f.track_count/2) ? MFM_DDAM : MFM_DAM;
+}
+
const cgenie_format::format cgenie_format::formats[] =
{
{ // 102k 5 1/4 inch single density single sided (Type A)
diff --git a/src/lib/formats/cgenie_dsk.h b/src/lib/formats/cgenie_dsk.h
index 2c88860b9cc..1eda22404c5 100644
--- a/src/lib/formats/cgenie_dsk.h
+++ b/src/lib/formats/cgenie_dsk.h
@@ -24,6 +24,10 @@ public:
virtual const char *description() const;
virtual const char *extensions() const;
+protected:
+ virtual int get_track_dam_fm(const format &f, int head, int track);
+ virtual int get_track_dam_mfm(const format &f, int head, int track);
+
private:
static const format formats[];
};
diff --git a/src/lib/formats/cpis_dsk.c b/src/lib/formats/cpis_dsk.c
index 088fcebb908..8246db7e82e 100644
--- a/src/lib/formats/cpis_dsk.c
+++ b/src/lib/formats/cpis_dsk.c
@@ -8,104 +8,7 @@
*********************************************************************/
-#include <string.h>
-#include <assert.h>
-
-#include "formats/cpis_dsk.h"
-#include "formats/basicdsk.h"
-
-
-static int compis_get_tracks_and_sectors(floppy_image_legacy *floppy, int *tracks, int *sectors)
-{
- switch(floppy_image_size(floppy)) {
- case 0x50000: /* 320 KB */
- *tracks = 40;
- *sectors = 8;
- break;
-
- case 0x5a000: /* 360 KB */
- *tracks = 40;
- *sectors = 9;
- break;
-
- case 0xa0000: /* 640 KB */
- *tracks = 80;
- *sectors = 8;
- break;
-
- case 0xb4000: /* 720 KB */
- *tracks = 80;
- *sectors = 9;
- break;
-
- case 0x12c000: /* 1200 KB */
- *tracks = 80;
- *sectors = 15;
- break;
-
- default:
- return 0;
- }
- return 1;
-}
-
-
-
-static FLOPPY_IDENTIFY(compis_dsk_identify)
-{
- int dummy;
- *vote = compis_get_tracks_and_sectors(floppy, &dummy, &dummy) ? 100 : 0;
- return FLOPPY_ERROR_SUCCESS;
-}
-
-
-
-static FLOPPY_CONSTRUCT(compis_dsk_construct)
-{
- struct basicdsk_geometry geometry;
-
- memset(&geometry, 0, sizeof(geometry));
- geometry.heads = 1;
- geometry.first_sector_id = 1;
- geometry.sector_length = 512;
-
- if (params)
- {
- /* create */
- geometry.tracks = option_resolution_lookup_int(params, PARAM_TRACKS);
- geometry.sectors = option_resolution_lookup_int(params, PARAM_SECTORS);
- }
- else
- {
- /* open */
- if (!compis_get_tracks_and_sectors(floppy, &geometry.tracks, &geometry.sectors))
- return FLOPPY_ERROR_INVALIDIMAGE;
- }
-
- return basicdsk_construct(floppy, &geometry);
-}
-
-
-
-/* ----------------------------------------------------------------------- */
-
-LEGACY_FLOPPY_OPTIONS_START( compis )
- LEGACY_FLOPPY_OPTION( compis_dsk, "dsk", "Compis floppy disk image", compis_dsk_identify, compis_dsk_construct, NULL,
- TRACKS(40/[80])
- SECTORS(8/[9]/15))
-LEGACY_FLOPPY_OPTIONS_END
-
-
-
-/*********************************************************************
-
- formats/cpis_dsk.c
-
- cpis format
-
-*********************************************************************/
-
-#include "formats/cpis_dsk.h"
+#include "cpis_dsk.h"
cpis_format::cpis_format() : upd765_format(formats)
{
diff --git a/src/lib/formats/cpis_dsk.h b/src/lib/formats/cpis_dsk.h
index e6e4e8bad20..3879c6a17c6 100644
--- a/src/lib/formats/cpis_dsk.h
+++ b/src/lib/formats/cpis_dsk.h
@@ -11,14 +11,6 @@
#ifndef CPIS_DSK_H
#define CPIS_DSK_H
-#include "flopimg.h"
-
-
-/**************************************************************************/
-
-LEGACY_FLOPPY_OPTIONS_EXTERN(compis);
-
-
#include "upd765_dsk.h"
class cpis_format : public upd765_format {
diff --git a/src/lib/formats/d64_dsk.h b/src/lib/formats/d64_dsk.h
index 558d4ebf1c2..ec99a36251b 100644
--- a/src/lib/formats/d64_dsk.h
+++ b/src/lib/formats/d64_dsk.h
@@ -53,7 +53,7 @@ protected:
ERROR_27, /* checksum error in header block */
ERROR_28, /* write error UNIMPLEMENTED */
ERROR_29, /* disk ID mismatch */
- ERROR_74, /* disk not ready (no device 1) UNIMPLEMENTED */
+ ERROR_74 /* disk not ready (no device 1) UNIMPLEMENTED */
};
const format *formats;
diff --git a/src/lib/formats/flopimg.c b/src/lib/formats/flopimg.c
index 510f7d8c2d4..e2ee5122b2c 100644
--- a/src/lib/formats/flopimg.c
+++ b/src/lib/formats/flopimg.c
@@ -2563,8 +2563,9 @@ void floppy_image_format_t::extract_sectors_from_bitstream_fm_pc(const UINT8 *bi
if(idblk_count < 100)
idblk[idblk_count++] = i+1;
}
- // fb
- if(shift_reg == 0xf56f) { // data mark
+ // f8, f9, fa, fb
+ if(shift_reg == 0xf56a || shift_reg == 0xf56b ||
+ shift_reg == 0xf56e || shift_reg == 0xf56f) { // data mark
if(dblk_count < 100)
dblk[dblk_count++] = i+1;
}
diff --git a/src/lib/formats/flopimg.h b/src/lib/formats/flopimg.h
index 4d4c7f360ca..c3e42c5c96d 100644
--- a/src/lib/formats/flopimg.h
+++ b/src/lib/formats/flopimg.h
@@ -357,7 +357,7 @@ protected:
SECTOR_LOOP_START, //!< Start of the per-sector loop, sector number goes from p1 to p2 inclusive
SECTOR_LOOP_END, //!< End of the per-sector loop
- SECTOR_INTERLEAVE_SKEW, //!< Defines interleave and skew for sector counting
+ SECTOR_INTERLEAVE_SKEW //!< Defines interleave and skew for sector counting
};
//! Sector data description
@@ -686,7 +686,7 @@ public:
FF_3 = 0x20202033, //!< "3 " 3 inch disk
FF_35 = 0x20203533, //!< "35 " 3.5 inch disk
FF_525 = 0x20353235, //!< "525 " 5.25 inch disk
- FF_8 = 0x20202038, //!< "8 " 8 inch disk
+ FF_8 = 0x20202038 //!< "8 " 8 inch disk
};
//! Variants
@@ -698,14 +698,14 @@ public:
DSDD = 0x44445344, //!< "DSDD", Double-sided double-density (720K in 3.5, 360K in 5.25)
DSQD = 0x44515344, //!< "DSQD", Double-sided quad-density (720K in 5.25, means DD+80 tracks)
DSHD = 0x44485344, //!< "DSHD", Double-sided high-density (1440K)
- DSED = 0x44455344, //!< "DSED", Double-sided extra-density (2880K)
+ DSED = 0x44455344 //!< "DSED", Double-sided extra-density (2880K)
};
//! Encodings
enum {
FM = 0x2020464D, //!< " FM", frequency modulation
MFM = 0x204D464D, //!< " MFM", modified frequency modulation
- M2FM = 0x4D32464D, //!< "M2FM", modified modified frequency modulation
+ M2FM = 0x4D32464D //!< "M2FM", modified modified frequency modulation
};
// construction/destruction
diff --git a/src/lib/formats/g64_dsk.c b/src/lib/formats/g64_dsk.c
index b4b9f057f1b..6cbb345adc8 100644
--- a/src/lib/formats/g64_dsk.c
+++ b/src/lib/formats/g64_dsk.c
@@ -44,37 +44,47 @@ bool g64_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
dynamic_buffer img(size);
io_generic_read(io, &img[0], 0, size);
- if (img[VERSION]) {
- throw emu_fatalerror("g64_format: Unsupported version %u", img[VERSION]);
+ if (img[POS_VERSION]) {
+ throw emu_fatalerror("g64_format: Unsupported version %u", img[POS_VERSION]);
}
- int track_count = img[TRACK_COUNT];
+ int track_count = img[POS_TRACK_COUNT];
int head = 0;
for (int track = 0; track < track_count; track++)
{
- UINT32 track_offset = pick_integer_le(&img[0], TRACK_OFFSET + (track * 4), 4);
+ int cylinder = track % TRACK_COUNT;
- if (!track_offset)
+ if (track == TRACK_COUNT)
+ head = 1;
+
+ UINT32 tpos = POS_TRACK_OFFSET + (track * 4);
+ UINT32 spos = tpos + (track_count * 4);
+ UINT32 dpos = pick_integer_le(&img[0], tpos, 4);
+
+ if (!dpos)
continue;
- if (track_offset > size)
- throw emu_fatalerror("g64_format: Track %u offset %06x out of bounds", track, track_offset);
+ if (dpos > size)
+ throw emu_fatalerror("g64_format: Track %u offset %06x out of bounds", track, dpos);
- UINT32 speed_zone = pick_integer_le(&img[0], SPEED_ZONE + (track * 4), 4);
+ UINT32 speed_zone = pick_integer_le(&img[0], spos, 4);
if (speed_zone > 3)
throw emu_fatalerror("g64_format: Unsupported variable speed zones on track %d", track);
- UINT16 track_bytes = pick_integer_le(&img[0], track_offset, 2);
+ UINT16 track_bytes = pick_integer_le(&img[0], dpos, 2);
int track_size = track_bytes * 8;
- LOG_FORMATS("track %u size %u cell %ld\n", track, track_size, 200000000L/track_size);
+ LOG_FORMATS("head %u track %u offs %u size %u cell %ld\n", head, cylinder, dpos, track_bytes, 200000000L/track_size);
- generate_track_from_bitstream(track, head, &img[track_offset+2], track_size, image);
+ generate_track_from_bitstream(cylinder, head, &img[dpos+2], track_size, image);
}
- image->set_variant(floppy_image::SSSD);
+ if (!head)
+ image->set_variant(floppy_image::SSSD);
+ else
+ image->set_variant(floppy_image::DSSD);
return true;
}
@@ -93,52 +103,59 @@ int g64_format::generate_bitstream(int track, int head, int speed_zone, UINT8 *t
bool g64_format::save(io_generic *io, floppy_image *image)
{
- UINT8 header[] = { 'G', 'C', 'R', '-', '1', '5', '4', '1', 0x00, 0x54, TRACK_LENGTH & 0xff, TRACK_LENGTH >> 8 };
+ int tracks, heads;
+ image->get_actual_geometry(tracks, heads);
+ tracks = TRACK_COUNT * heads;
- io_generic_write(io, header, SIGNATURE, sizeof(header));
+ // write header
+ UINT8 header[] = { 'G', 'C', 'R', '-', '1', '5', '4', '1', 0x00, tracks, TRACK_LENGTH & 0xff, TRACK_LENGTH >> 8 };
+ io_generic_write(io, header, POS_SIGNATURE, sizeof(header));
- int head = 0;
- int tracks_written = 0;
+ // write tracks
+ for (int head = 0; head < heads; head++) {
+ int tracks_written = 0;
- dynamic_buffer trackbuf(TRACK_LENGTH-2);
- for (int track = 0; track < 84; track++) {
- UINT32 tpos = TRACK_OFFSET + track * 4;
- UINT32 spos = SPEED_ZONE + track * 4;
- UINT32 dpos = TRACK_DATA + tracks_written * TRACK_LENGTH;
+ dynamic_buffer trackbuf(TRACK_LENGTH-2);
- io_generic_write_filler(io, 0x00, tpos, 4);
- io_generic_write_filler(io, 0x00, spos, 4);
+ for (int track = 0; track < TRACK_COUNT; track++) {
+ UINT32 tpos = POS_TRACK_OFFSET + (track * 4);
+ UINT32 spos = tpos + (tracks * 4);
+ UINT32 dpos = POS_TRACK_OFFSET + (tracks * 4 * 2) + (tracks_written * TRACK_LENGTH);
- if (image->get_buffer(track, head).size() <= 1)
- continue;
+ io_generic_write_filler(io, 0x00, tpos, 4);
+ io_generic_write_filler(io, 0x00, spos, 4);
+
+ if (image->get_buffer(track, head).size() <= 1)
+ continue;
- int track_size;
- int speed_zone;
+ int track_size;
+ int speed_zone;
- // figure out the cell size and speed zone from the track data
- if ((speed_zone = generate_bitstream(track, head, 3, &trackbuf[0], track_size, image)) == -1)
- if ((speed_zone = generate_bitstream(track, head, 2, &trackbuf[0], track_size, image)) == -1)
- if ((speed_zone = generate_bitstream(track, head, 1, &trackbuf[0], track_size, image)) == -1)
- if ((speed_zone = generate_bitstream(track, head, 0, &trackbuf[0], track_size, image)) == -1)
- throw emu_fatalerror("g64_format: Cannot determine speed zone for track %u", track);
+ // figure out the cell size and speed zone from the track data
+ if ((speed_zone = generate_bitstream(track, head, 3, &trackbuf[0], track_size, image)) == -1)
+ if ((speed_zone = generate_bitstream(track, head, 2, &trackbuf[0], track_size, image)) == -1)
+ if ((speed_zone = generate_bitstream(track, head, 1, &trackbuf[0], track_size, image)) == -1)
+ if ((speed_zone = generate_bitstream(track, head, 0, &trackbuf[0], track_size, image)) == -1)
+ throw emu_fatalerror("g64_format: Cannot determine speed zone for track %u", track);
- LOG_FORMATS("track %u size %u cell %u\n", track, track_size, c1541_cell_size[speed_zone]);
+ LOG_FORMATS("head %u track %u size %u cell %u\n", head, track, track_size, c1541_cell_size[speed_zone]);
- UINT8 track_offset[4];
- UINT8 speed_offset[4];
- UINT8 track_length[2];
+ UINT8 track_offset[4];
+ UINT8 speed_offset[4];
+ UINT8 track_length[2];
- place_integer_le(track_offset, 0, 4, dpos);
- place_integer_le(speed_offset, 0, 4, speed_zone);
- place_integer_le(track_length, 0, 2, track_size/8);
+ place_integer_le(track_offset, 0, 4, dpos);
+ place_integer_le(speed_offset, 0, 4, speed_zone);
+ place_integer_le(track_length, 0, 2, track_size/8);
- io_generic_write(io, track_offset, tpos, 4);
- io_generic_write(io, speed_offset, spos, 4);
- io_generic_write_filler(io, 0xff, dpos, TRACK_LENGTH);
- io_generic_write(io, track_length, dpos, 2);
- io_generic_write(io, &trackbuf[0], dpos + 2, track_size);
+ io_generic_write(io, track_offset, tpos, 4);
+ io_generic_write(io, speed_offset, spos, 4);
+ io_generic_write_filler(io, 0xff, dpos, TRACK_LENGTH);
+ io_generic_write(io, track_length, dpos, 2);
+ io_generic_write(io, &trackbuf[0], dpos + 2, track_size);
- tracks_written++;
+ tracks_written++;
+ }
}
return true;
@@ -151,12 +168,12 @@ const char *g64_format::name() const
const char *g64_format::description() const
{
- return "Commodore 1541 GCR disk image";
+ return "Commodore 1541/1571 GCR disk image";
}
const char *g64_format::extensions() const
{
- return "g64,g41";
+ return "g64,g41,g71";
}
const floppy_format_type FLOPPY_G64_FORMAT = &floppy_image_format_creator<g64_format>;
diff --git a/src/lib/formats/g64_dsk.h b/src/lib/formats/g64_dsk.h
index b7d32c8ed6d..f7f06548ede 100644
--- a/src/lib/formats/g64_dsk.h
+++ b/src/lib/formats/g64_dsk.h
@@ -30,15 +30,17 @@ public:
protected:
enum
{
- SIGNATURE = 0x0,
- VERSION = 0x8,
- TRACK_COUNT = 0x9,
- MAX_TRACK_SIZE = 0xa,
- TRACK_OFFSET = 0xc,
- SPEED_ZONE = 0x15c,
- MASTERING = 0x2ac,
- TRACK_DATA = 0x2ac,
- TRACK_LENGTH = 0x1ef8
+ POS_SIGNATURE = 0x0,
+ POS_VERSION = 0x8,
+ POS_TRACK_COUNT = 0x9,
+ POS_MAX_TRACK_SIZE = 0xa,
+ POS_TRACK_OFFSET = 0xc
+ };
+
+ enum
+ {
+ TRACK_LENGTH = 0x1ef8,
+ TRACK_COUNT = 84
};
static const UINT32 c1541_cell_size[];
diff --git a/src/lib/formats/guab_dsk.c b/src/lib/formats/guab_dsk.c
new file mode 100644
index 00000000000..4c92362251a
--- /dev/null
+++ b/src/lib/formats/guab_dsk.c
@@ -0,0 +1,42 @@
+// license:GPL-2.0+
+// copyright-holders:Dirk Best
+/***************************************************************************
+
+ JPM Give us a Break
+
+ Disk image format
+
+***************************************************************************/
+
+#include "guab_dsk.h"
+
+guab_format::guab_format() : wd177x_format(formats)
+{
+}
+
+const char *guab_format::name() const
+{
+ return "guab";
+}
+
+const char *guab_format::description() const
+{
+ return "JPM Give us a Break disk image";
+}
+
+const char *guab_format::extensions() const
+{
+ return "dsk";
+}
+
+// gap sizes unverified
+const guab_format::format guab_format::formats[] =
+{
+ {
+ floppy_image::FF_35, floppy_image::DSDD, floppy_image::MFM,
+ 2000, 18, 80, 2, 256, {}, 0, {}, 80, 22, 24
+ },
+ {}
+};
+
+const floppy_format_type FLOPPY_GUAB_FORMAT = &floppy_image_format_creator<guab_format>;
diff --git a/src/lib/formats/guab_dsk.h b/src/lib/formats/guab_dsk.h
new file mode 100644
index 00000000000..36280ddd88f
--- /dev/null
+++ b/src/lib/formats/guab_dsk.h
@@ -0,0 +1,33 @@
+// license:GPL-2.0+
+// copyright-holders:Dirk Best
+/***************************************************************************
+
+ JPM Give us a Break
+
+ Disk image format
+
+***************************************************************************/
+
+#pragma once
+
+#ifndef __GUAB_DSK_H__
+#define __GUAB_DSK_H__
+
+#include "wd177x_dsk.h"
+
+class guab_format : public wd177x_format
+{
+public:
+ guab_format();
+
+ virtual const char *name() const;
+ virtual const char *description() const;
+ virtual const char *extensions() const;
+
+private:
+ static const format formats[];
+};
+
+extern const floppy_format_type FLOPPY_GUAB_FORMAT;
+
+#endif // __GUAB_DSK_H__
diff --git a/src/lib/formats/hect_dsk.c b/src/lib/formats/hect_dsk.c
index 4e8794131f8..8dfe445e6e4 100644
--- a/src/lib/formats/hect_dsk.c
+++ b/src/lib/formats/hect_dsk.c
@@ -93,38 +93,6 @@ static FLOPPY_CONSTRUCT(hector_disc2_dsk800_construct)
return basicdsk_construct(floppy, &geometry);
}
-/* For the 720Ko disk 3 1/2 inch disk for the mini disc unit !!:
- 512 bytes per sectors,
- 9 sector per track,
- From sector =1 to sector 9,
- 80 tracks,
- 2 Head
- This format can be extract from a real disc with anadisk (*.IMG format rename in *.HE7).
-*/
-
-static FLOPPY_IDENTIFY(hector_minidisc_dsk_identify)
-{
- *vote = (floppy_image_size(floppy) == (2*70*9*512)) ? 100 : 0;
- return FLOPPY_ERROR_SUCCESS;
-}
-
-static FLOPPY_CONSTRUCT(hector_minidisc_dsk_construct)
-{
- struct basicdsk_geometry geometry;
- memset(&geometry, 0, sizeof(geometry)); // 635904 octets
- geometry.heads = 2;//2
- geometry.first_sector_id = 1;
- geometry.sector_length = 512;
- geometry.tracks = 70;//69
- geometry.sectors = 9;
- return basicdsk_construct(floppy, &geometry);
-}
-
-/* Specific for the mini disc unit */
-LEGACY_FLOPPY_OPTIONS_START( hector_minidisc )
- LEGACY_FLOPPY_OPTION( hector_dsk, "HMD", "hector mini disc floppy disk image 360Ko", hector_minidisc_dsk_identify, hector_minidisc_dsk_construct, NULL, NULL)
-LEGACY_FLOPPY_OPTIONS_END
-
LEGACY_FLOPPY_OPTIONS_START( hector_disc2 )
LEGACY_FLOPPY_OPTION( hector_dsk, "HE2", "hector disc2 floppy disk image 200K", hector_disc2_dsk200_identify, hector_disc2_dsk200_construct, NULL, NULL)
LEGACY_FLOPPY_OPTION( hector_dsk, "HE7", "hector disc2 floppy disk image 720K", hector_disc2_dsk720_identify, hector_disc2_dsk720_construct, NULL, NULL)
diff --git a/src/lib/formats/hect_tap.c b/src/lib/formats/hect_tap.c
index b9365d35f05..9110f07cc8c 100644
--- a/src/lib/formats/hect_tap.c
+++ b/src/lib/formats/hect_tap.c
@@ -31,7 +31,7 @@ enum
{
Header_cycles = 77, /* Valeur Th?orique 66 = 44100 * 1.5 / 1000 // mesur? sur jeu Formule1 = 1,75ms*/
Zero_cycles = 27, /* Valeur Th?orique 17 = 44100 * 0.4 / 1000 // mesur? sur jeu Formule1 = 0,61ms*/
- Un_cycles = 50, /* Valeur Th?orique 40 = 44100 * 0.9 / 1000 // mesur? sur jeu Formule1 = 1,13ms*/
+ Un_cycles = 50 /* Valeur Th?orique 40 = 44100 * 0.9 / 1000 // mesur? sur jeu Formule1 = 1,13ms*/
};
/* Here I prefer use the value that I read on a real tape, and not the theorical value; note that these
diff --git a/src/lib/formats/hector_minidisc.c b/src/lib/formats/hector_minidisc.c
new file mode 100644
index 00000000000..fe4a7ee44b1
--- /dev/null
+++ b/src/lib/formats/hector_minidisc.c
@@ -0,0 +1,41 @@
+// license:GPL-2.0+
+// copyright-holders:Dirk Best
+/***************************************************************************
+
+ Hector Minidisc
+
+ Disk image format
+
+***************************************************************************/
+
+#include "hector_minidisc.h"
+
+hmd_format::hmd_format() : upd765_format(formats)
+{
+}
+
+const char *hmd_format::name() const
+{
+ return "hector_minidisc";
+}
+
+const char *hmd_format::description() const
+{
+ return "Hector Minidisc disk image";
+}
+
+const char *hmd_format::extensions() const
+{
+ return "hmd";
+}
+
+const hmd_format::format hmd_format::formats[] =
+{
+ {
+ floppy_image::FF_35, floppy_image::DSDD, floppy_image::MFM,
+ 2000, 9, 70, 2, 512, {}, 1, {}, 80, 50, 22, 54
+ },
+ {}
+};
+
+const floppy_format_type FLOPPY_HMD_FORMAT = &floppy_image_format_creator<hmd_format>;
diff --git a/src/lib/formats/hector_minidisc.h b/src/lib/formats/hector_minidisc.h
new file mode 100644
index 00000000000..d850573f2b6
--- /dev/null
+++ b/src/lib/formats/hector_minidisc.h
@@ -0,0 +1,33 @@
+// license:GPL-2.0+
+// copyright-holders:Dirk Best
+/***************************************************************************
+
+ Hector Minidisc
+
+ Disk image format
+
+***************************************************************************/
+
+#pragma once
+
+#ifndef __HMD_DSK_H__
+#define __HMD_DSK_H__
+
+#include "upd765_dsk.h"
+
+class hmd_format : public upd765_format
+{
+public:
+ hmd_format();
+
+ virtual const char *name() const;
+ virtual const char *description() const;
+ virtual const char *extensions() const;
+
+private:
+ static const format formats[];
+};
+
+extern const floppy_format_type FLOPPY_HMD_FORMAT;
+
+#endif // __HMD_DSK_H__
diff --git a/src/lib/formats/jvc_dsk.c b/src/lib/formats/jvc_dsk.c
new file mode 100644
index 00000000000..30ec8287f22
--- /dev/null
+++ b/src/lib/formats/jvc_dsk.c
@@ -0,0 +1,174 @@
+// license:GPL-2.0+
+// copyright-holders:Dirk Best
+/***************************************************************************
+
+ JVC
+
+ Disk image format
+
+ Named after its creator, Jeff Vavasour
+
+ TODO:
+ - Support writing unusal formats?
+
+***************************************************************************/
+
+#include "emu.h"
+#include "jvc_dsk.h"
+
+jvc_format::jvc_format()
+{
+}
+
+const char *jvc_format::name() const
+{
+ return "jvc";
+}
+
+const char *jvc_format::description() const
+{
+ return "JVC disk image";
+}
+
+const char *jvc_format::extensions() const
+{
+ return "jvc,dsk";
+}
+
+bool jvc_format::parse_header(io_generic *io, int &header_size, int &tracks, int &heads, int &sectors, int &sector_size, int &base_sector_id)
+{
+ UINT64 size = io_generic_size(io);
+ header_size = size % 256;
+ UINT8 header[5];
+
+ if (header_size > 0)
+ io_generic_read(io, header, 0, header_size);
+
+ if (header_size > 5)
+ return false;
+
+ // default values
+ heads = 1;
+ sectors = 18;
+ sector_size = 256;
+ base_sector_id = 1;
+
+ switch (header_size)
+ {
+ case 5: emu_fatalerror("jvc_format: sector attribute flag unsupported\n");
+ break;
+ case 4: base_sector_id = header[3];
+ // no break
+ case 3: sector_size = 128 << header[2];
+ // no break
+ case 2: heads = header[1];
+ // no break
+ case 1: sectors = header[0];
+ // no break
+ case 0: tracks = (size - header_size) / sector_size / sectors;
+ break;
+ }
+
+ return tracks * heads * sectors * sector_size == (size - header_size);
+}
+
+int jvc_format::identify(io_generic *io, UINT32 form_factor)
+{
+ int header_size, tracks, heads, sectors, sector_size, sector_base_id;
+ return parse_header(io, header_size, tracks, heads, sectors, sector_size, sector_base_id) ? 50 : 0;
+}
+
+bool jvc_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
+{
+ int header_size, track_count, head_count, sector_count, sector_size, sector_base_id;
+
+ if (!parse_header(io, header_size, track_count, head_count, sector_count, sector_size, sector_base_id))
+ return false;
+
+ // safety check
+ if (sector_count * sector_size > 10000)
+ emu_fatalerror("jvc_format: incorrect track layout\n");
+
+ int file_offset = header_size;
+
+ for (int track = 0; track < track_count; track++)
+ {
+ for (int head = 0; head < head_count ; head++)
+ {
+ desc_pc_sector sectors[256];
+ UINT8 sector_data[10000];
+ int sector_offset = 0;
+
+ for (int i = 0; i < sector_count; i++)
+ {
+ sectors[i].track = track;
+ sectors[i].head = head;
+ sectors[i].sector = sector_base_id + i;
+ sectors[i].actual_size = sector_size;
+ sectors[i].size = sector_size >> 8;
+ sectors[i].deleted = false;
+ sectors[i].bad_crc = false;
+ sectors[i].data = &sector_data[sector_offset];
+
+ io_generic_read(io, sectors[i].data, file_offset, sector_size);
+
+ sector_offset += sector_size;
+ file_offset += sector_size;
+ }
+
+ build_wd_track_mfm(track, head, image, 100000, sector_count, sectors, 22, 32, 24);
+ }
+ }
+
+ return true;
+}
+
+bool jvc_format::save(io_generic *io, floppy_image *image)
+{
+ UINT8 bitstream[500000/8];
+ UINT8 sector_data[50000];
+ desc_xs sectors[256];
+ UINT64 file_offset = 0;
+
+ int track_count, head_count;
+ image->get_actual_geometry(track_count, head_count);
+
+ // we'll write a header if the disk is two-sided
+ if (head_count == 2)
+ {
+ UINT8 header[2];
+ header[0] = 18;
+ header[1] = 2;
+ io_generic_write(io, header, file_offset, sizeof(header));
+ file_offset += sizeof(header);
+ }
+
+ // write disk data
+ for (int track = 0; track < track_count; track++)
+ {
+ for (int head = 0; head < head_count; head++)
+ {
+ int track_size;
+ generate_bitstream_from_track(track, head, 2000, bitstream, track_size, image);
+ extract_sectors_from_bitstream_mfm_pc(bitstream, track_size, sectors, sector_data, sizeof(sector_data));
+
+ for (int i = 0; i < 18; i++)
+ {
+ if (sectors[1 + i].size != 256)
+ emu_fatalerror("jvc_format: invalid sector size: %d\n", sectors[1 + i].size);
+
+ io_generic_write(io, sectors[1 + i].data, file_offset, sectors[1 + i].size);
+ file_offset += sectors[1 + i].size;
+ }
+ }
+ }
+
+ return true;
+}
+
+bool jvc_format::supports_save() const
+{
+ return true;
+}
+
+const floppy_format_type FLOPPY_JVC_FORMAT = &floppy_image_format_creator<jvc_format>;
diff --git a/src/lib/formats/jvc_dsk.h b/src/lib/formats/jvc_dsk.h
new file mode 100644
index 00000000000..eaeeefb84aa
--- /dev/null
+++ b/src/lib/formats/jvc_dsk.h
@@ -0,0 +1,50 @@
+// license:GPL-2.0+
+// copyright-holders:Dirk Best
+/***************************************************************************
+
+ JVC
+
+ Disk image format
+
+ Named after its creator, Jeff Vavasour
+
+***************************************************************************/
+
+#pragma once
+
+#ifndef __JVC_DSK_H__
+#define __JVC_DSK_H__
+
+#include "flopimg.h"
+
+class jvc_format : public floppy_image_format_t
+{
+public:
+ jvc_format();
+
+ struct jvc_header
+ {
+ UINT8 sectors_per_track;
+ UINT8 side_count;
+ UINT8 sector_size;
+ UINT8 first_sector_id;
+ UINT8 sector_attribute_flag;
+ int header_size;
+ };
+
+ virtual const char *name() const;
+ virtual const char *description() const;
+ virtual const char *extensions() const;
+
+ virtual int identify(io_generic *io, UINT32 form_factor);
+ virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image);
+ virtual bool save(io_generic *io, floppy_image *image);
+ virtual bool supports_save() const;
+
+private:
+ bool parse_header(io_generic *io, int &header_size, int &tracks, int &heads, int &sectors, int &sector_size, int &base_sector_id);
+};
+
+extern const floppy_format_type FLOPPY_JVC_FORMAT;
+
+#endif // __JVC_DSK_H__
diff --git a/src/lib/formats/m20_dsk.c b/src/lib/formats/m20_dsk.c
index 8dbb403143b..5fec77cf1d5 100644
--- a/src/lib/formats/m20_dsk.c
+++ b/src/lib/formats/m20_dsk.c
@@ -14,173 +14,7 @@
*********************************************************************/
-#include <string.h>
-#include <assert.h>
-
#include "m20_dsk.h"
-#include "basicdsk.h"
-
-static FLOPPY_IDENTIFY(m20_dsk_identify)
-{
- *vote = (floppy_image_size(floppy) == 286720) ? 100 : 0;
- return FLOPPY_ERROR_SUCCESS;
-}
-
-static int m20_get_heads_per_disk(floppy_image_legacy *floppy)
-{
- return 2;
-}
-
-static int m20_get_tracks_per_disk(floppy_image_legacy *floppy)
-{
- return 35;
-}
-
-static UINT64 m20_translate_offset(floppy_image_legacy *floppy, int track, int head, int sector)
-{
- return 256*(32*track+16*head+sector);
-}
-
-static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, UINT64 *offset)
-{
- UINT64 offs;
- /* translate the sector to a raw sector */
- if (!sector_is_index)
- {
- sector -= 1;
- }
-
- /* check to see if we are out of range */
- if ((head < 0) || (head >= 2) || (track < 0) || (track >= 35) || (sector < 0) || (sector >= 16))
- return FLOPPY_ERROR_SEEKERROR;
-
- offs = m20_translate_offset(floppy, track, head, sector);
- if (offset)
- *offset = offs;
- return FLOPPY_ERROR_SUCCESS;
-}
-
-
-
-static floperr_t internal_m20_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, void *buffer, size_t buflen)
-{
- UINT64 offset;
- floperr_t err;
-
- //printf("internal_m20_read_sector: track = %d, head = %d, sector = %d, secisix = %d, buflen = %ld\n", track, head, sector, sector_is_index, (long)buflen);
- err = get_offset(floppy, head, track, sector, sector_is_index, &offset);
- if (err)
- return err;
-
- floppy_image_read(floppy, buffer, offset, buflen);
- return FLOPPY_ERROR_SUCCESS;
-}
-
-
-
-static floperr_t internal_m20_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, const void *buffer, size_t buflen, int ddam)
-{
- UINT64 offset;
- floperr_t err;
-
- err = get_offset(floppy, head, track, sector, sector_is_index, &offset);
- if (err)
- return err;
-
- floppy_image_write(floppy, buffer, offset, buflen);
- return FLOPPY_ERROR_SUCCESS;
-}
-
-
-
-static floperr_t m20_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
-{
- return internal_m20_read_sector(floppy, head, track, sector, FALSE, buffer, buflen);
-}
-
-static floperr_t m20_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
-{
- return internal_m20_write_sector(floppy, head, track, sector, FALSE, buffer, buflen, ddam);
-}
-
-static floperr_t m20_read_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
-{
- return internal_m20_read_sector(floppy, head, track, sector, TRUE, buffer, buflen);
-}
-
-static floperr_t m20_write_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
-{
- return internal_m20_write_sector(floppy, head, track, sector, TRUE, buffer, buflen, ddam);
-}
-
-static floperr_t m20_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *sector_length)
-{
- floperr_t err;
- err = get_offset(floppy, head, track, sector, FALSE, NULL);
- if (err)
- return err;
-
- if (sector_length) {
- if (track == 0 && head == 0)
- *sector_length = 128;
- else
- *sector_length = 256;
- }
- return FLOPPY_ERROR_SUCCESS;
-}
-
-
-
-static floperr_t m20_get_indexed_sector_info(floppy_image_legacy *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags)
-{
- sector_index += 1;
- if (cylinder)
- *cylinder = track;
- if (side)
- *side = head;
- if (sector)
- *sector = sector_index;
- if (flags)
- /* TODO: read DAM or DDAM and determine flags */
- *flags = 0;
- return m20_get_sector_length(floppy, head, track, sector_index, sector_length);
-}
-
-
-static FLOPPY_CONSTRUCT(m20_dsk_construct)
-{
- struct FloppyCallbacks *callbacks;
- callbacks = floppy_callbacks(floppy);
- callbacks->read_sector = m20_read_sector;
- callbacks->write_sector = m20_write_sector;
- callbacks->read_indexed_sector = m20_read_indexed_sector;
- callbacks->write_indexed_sector = m20_write_indexed_sector;
- callbacks->get_sector_length = m20_get_sector_length;
- callbacks->get_heads_per_disk = m20_get_heads_per_disk;
- callbacks->get_tracks_per_disk = m20_get_tracks_per_disk;
- callbacks->get_indexed_sector_info = m20_get_indexed_sector_info;
-
- return FLOPPY_ERROR_SUCCESS;
-}
-
-
-
-/* ----------------------------------------------------------------------- */
-
-LEGACY_FLOPPY_OPTIONS_START( m20 )
- LEGACY_FLOPPY_OPTION(m20_dsk, "img", "M20 disk image", m20_dsk_identify, m20_dsk_construct, NULL, NULL)
-LEGACY_FLOPPY_OPTIONS_END
-
-
-/*********************************************************************
-
- formats/m20_dsk.c
-
- m20 format
-
-*********************************************************************/
-
-#include "formats/m20_dsk.h"
m20_format::m20_format()
{
diff --git a/src/lib/formats/m20_dsk.h b/src/lib/formats/m20_dsk.h
index f4b23017953..e3f8c9cf411 100644
--- a/src/lib/formats/m20_dsk.h
+++ b/src/lib/formats/m20_dsk.h
@@ -13,13 +13,6 @@
#include "flopimg.h"
-/**************************************************************************/
-
-LEGACY_FLOPPY_OPTIONS_EXTERN(m20);
-
-
-#include "wd177x_dsk.h"
-
class m20_format : public floppy_image_format_t {
public:
m20_format();
diff --git a/src/lib/formats/msx_dsk.c b/src/lib/formats/msx_dsk.c
index 815c6fa5e2e..ab0b5bab529 100644
--- a/src/lib/formats/msx_dsk.c
+++ b/src/lib/formats/msx_dsk.c
@@ -8,27 +8,7 @@
*********************************************************************/
-#include <assert.h>
-
-#include "formats/msx_dsk.h"
-#include "formats/basicdsk.h"
-
-LEGACY_FLOPPY_OPTIONS_START(msx)
- LEGACY_FLOPPY_OPTION(msx, "dsk", "MSX SS", basicdsk_identify_default, basicdsk_construct_default, NULL,
- HEADS([1])
- TRACKS([80])
- SECTORS([9])
- SECTOR_LENGTH([512])
- FIRST_SECTOR_ID([1]))
- LEGACY_FLOPPY_OPTION(msx, "dsk", "MSX DS", basicdsk_identify_default, basicdsk_construct_default, NULL,
- HEADS([2])
- TRACKS([80])
- SECTORS([9])
- SECTOR_LENGTH([512])
- FIRST_SECTOR_ID([1]))
-LEGACY_FLOPPY_OPTIONS_END
-
-/********************************************************************/
+#include "msx_dsk.h"
//msx_format::msx_format() : wd177x_format(formats)
msx_format::msx_format() : upd765_format(formats)
diff --git a/src/lib/formats/msx_dsk.h b/src/lib/formats/msx_dsk.h
index 8e26ec93128..94a5411c51a 100644
--- a/src/lib/formats/msx_dsk.h
+++ b/src/lib/formats/msx_dsk.h
@@ -11,15 +11,7 @@
#ifndef MSX_DSK_H
#define MSX_DSK_H
-#include "flopimg.h"
-
-/**************************************************************************/
-
-LEGACY_FLOPPY_OPTIONS_EXTERN(msx);
-
-/**************************************************************************/
-
-#include "wd177x_dsk.h"
+//#include "wd177x_dsk.h"
#include "upd765_dsk.h"
//class msx_format : public wd177x_format {
@@ -37,5 +29,4 @@ private:
extern const floppy_format_type FLOPPY_MSX_FORMAT;
-
#endif /* MSX_DSK_H */
diff --git a/src/lib/formats/pk8020_dsk.c b/src/lib/formats/pk8020_dsk.c
new file mode 100644
index 00000000000..e21fdbdb98e
--- /dev/null
+++ b/src/lib/formats/pk8020_dsk.c
@@ -0,0 +1,44 @@
+// license:GPL-2.0+
+// copyright-holders:Dirk Best
+/***************************************************************************
+
+ PK-8020
+
+ Disk image format
+
+ TODO:
+ - Verify gap sizes
+
+***************************************************************************/
+
+#include "pk8020_dsk.h"
+
+pk8020_format::pk8020_format() : wd177x_format(formats)
+{
+}
+
+const char *pk8020_format::name() const
+{
+ return "pk8020";
+}
+
+const char *pk8020_format::description() const
+{
+ return "PK-8020 disk image";
+}
+
+const char *pk8020_format::extensions() const
+{
+ return "kdi";
+}
+
+const pk8020_format::format pk8020_format::formats[] =
+{
+ {
+ floppy_image::FF_525, floppy_image::DSQD, floppy_image::MFM,
+ 2000, 5, 80, 2, 1024, {}, 1, {}, 60, 22, 24
+ },
+ {}
+};
+
+const floppy_format_type FLOPPY_PK8020_FORMAT = &floppy_image_format_creator<pk8020_format>;
diff --git a/src/lib/formats/pk8020_dsk.h b/src/lib/formats/pk8020_dsk.h
new file mode 100644
index 00000000000..1700530c781
--- /dev/null
+++ b/src/lib/formats/pk8020_dsk.h
@@ -0,0 +1,33 @@
+// license:GPL-2.0+
+// copyright-holders:Dirk Best
+/***************************************************************************
+
+ PK-8020
+
+ Disk image format
+
+***************************************************************************/
+
+#pragma once
+
+#ifndef __PK8020_DSK_H__
+#define __PK8020_DSK_H__
+
+#include "wd177x_dsk.h"
+
+class pk8020_format : public wd177x_format
+{
+public:
+ pk8020_format();
+
+ virtual const char *name() const;
+ virtual const char *description() const;
+ virtual const char *extensions() const;
+
+private:
+ static const format formats[];
+};
+
+extern const floppy_format_type FLOPPY_PK8020_FORMAT;
+
+#endif // __PK8020_DSK_H__
diff --git a/src/lib/formats/svi_dsk.c b/src/lib/formats/svi_dsk.c
index 491169bec28..aaa6a45e709 100644
--- a/src/lib/formats/svi_dsk.c
+++ b/src/lib/formats/svi_dsk.c
@@ -1,174 +1,142 @@
-// license:BSD-3-Clause
-// copyright-holders:Miodrag Milanovic
-/*********************************************************************
+// license:GPL-2.0+
+// copyright-holders:Dirk Best
+/***************************************************************************
- formats/svi_dsk.c
+ Spectravideo SVI-318/328
- SVI318 disk images
+ Disk image format
-*********************************************************************/
-
-#include <string.h>
-#include <assert.h>
+***************************************************************************/
#include "svi_dsk.h"
-#include "basicdsk.h"
-static FLOPPY_IDENTIFY(svi_dsk_identify)
+svi_format::svi_format()
{
- *vote = ((floppy_image_size(floppy) == (172032)) || (floppy_image_size(floppy) == (346112))) ? 100 : 0;
- return FLOPPY_ERROR_SUCCESS;
}
-static int svi_get_heads_per_disk(floppy_image_legacy *floppy)
+const char *svi_format::name() const
{
- return (floppy_image_size(floppy) == (172032)) ? 1 : 2;
+ return "svi";
}
-static int svi_get_tracks_per_disk(floppy_image_legacy *floppy)
+const char *svi_format::description() const
{
- return 40;
+ return "SVI-318/328 disk image";
}
-static UINT64 svi_translate_offset(floppy_image_legacy *floppy,
- int track, int head, int sector)
+const char *svi_format::extensions() const
{
- UINT64 o;
- if ((track==0) && (head==0))
- o = sector*128;
- else
- o = ((track*((floppy_image_size(floppy) == (172032)) ? 1 : 2)+head)*17+sector)*256-2048; /* (17*256)-(18*128)=2048 */
-
- return o;
+ return "dsk";
}
-static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, UINT64 *offset)
+int svi_format::identify(io_generic *io, UINT32 form_factor)
{
- UINT64 offs;
- /* translate the sector to a raw sector */
- if (!sector_is_index)
- {
- sector -= 1;
- }
- /* check to see if we are out of range */
- if ((head < 0) || (head >= ((floppy_image_size(floppy) == (172032)) ? 1 : 2)) || (track < 0) || (track >= 40)
- || (sector < 0) || (sector >= ((head==0 && track==0) ? 18 : 17)))
- return FLOPPY_ERROR_SEEKERROR;
-
- offs = svi_translate_offset(floppy, track, head, sector);
- if (offset)
- *offset = offs;
- return FLOPPY_ERROR_SUCCESS;
-}
+ UINT64 size = io_generic_size(io);
+ if (size == 172032 || size == 346112)
+ return 50;
-
-static floperr_t internal_svi_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, void *buffer, size_t buflen)
-{
- UINT64 offset;
- floperr_t err;
- err = get_offset(floppy, head, track, sector, sector_is_index, &offset);
- if (err)
- return err;
-
- floppy_image_read(floppy, buffer, offset, buflen);
- return FLOPPY_ERROR_SUCCESS;
+ return 0;
}
-
-
-static floperr_t internal_svi_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, const void *buffer, size_t buflen, int ddam)
+bool svi_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
{
- UINT64 offset;
- floperr_t err;
-
- err = get_offset(floppy, head, track, sector, sector_is_index, &offset);
- if (err)
- return err;
-
- floppy_image_write(floppy, buffer, offset, buflen);
- return FLOPPY_ERROR_SUCCESS;
-}
+ UINT64 size = io_generic_size(io);
+ int head_count;
+ switch (size)
+ {
+ case 172032: head_count = 1; break;
+ case 346112: head_count = 2; break;
+ default: return false;
+ }
+ int file_offset = 0;
-static floperr_t svi_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
-{
- return internal_svi_read_sector(floppy, head, track, sector, FALSE, buffer, buflen);
-}
+ for (int track = 0; track < 40; track++)
+ {
+ for (int head = 0; head < head_count ; head++)
+ {
+ int sector_count = (track == 0 && head == 0) ? 18 : 17;
+ int sector_size = (track == 0 && head == 0) ? 128 : 256;
+
+ desc_pc_sector sectors[20];
+ UINT8 sector_data[5000];
+ int sector_offset = 0;
+
+ for (int i = 0; i < sector_count; i++)
+ {
+ sectors[i].track = track;
+ sectors[i].head = head;
+ sectors[i].sector = i + 1;
+ sectors[i].actual_size = sector_size;
+ sectors[i].size = sector_size >> 8;
+ sectors[i].deleted = false;
+ sectors[i].bad_crc = false;
+ sectors[i].data = &sector_data[sector_offset];
+
+ io_generic_read(io, sectors[i].data, file_offset, sector_size);
+
+ sector_offset += sector_size;
+ file_offset += sector_size;
+ }
+
+ if (track == 0 && head == 0)
+ build_wd_track_fm(track, head, image, 50000, sector_count, sectors, 10, 26, 11);
+ else
+ build_wd_track_mfm(track, head, image, 100000, sector_count, sectors, 32, 50, 22);
+ }
+ }
-static floperr_t svi_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
-{
- return internal_svi_write_sector(floppy, head, track, sector, FALSE, buffer, buflen, ddam);
+ return true;
}
-static floperr_t svi_read_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
+bool svi_format::save(io_generic *io, floppy_image *image)
{
- return internal_svi_read_sector(floppy, head, track, sector, TRUE, buffer, buflen);
-}
+ UINT8 bitstream[500000/8];
+ UINT8 sector_data[50000];
+ desc_xs sectors[256];
+ int track_size;
+ UINT64 file_offset = 0;
-static floperr_t svi_write_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
-{
- return internal_svi_write_sector(floppy, head, track, sector, TRUE, buffer, buflen, ddam);
-}
+ int track_count, head_count;
+ image->get_actual_geometry(track_count, head_count);
-static floperr_t svi_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *sector_length)
-{
- floperr_t err;
- err = get_offset(floppy, head, track, sector, FALSE, NULL);
- if (err)
- return err;
+ // initial fm track
+ generate_bitstream_from_track(0, 0, 4000, bitstream, track_size, image);
+ extract_sectors_from_bitstream_fm_pc(bitstream, track_size, sectors, sector_data, sizeof(sector_data));
- if (sector_length) {
- *sector_length = (head==0 && track==0) ? 128 : 256;
+ for (int i = 0; i < 18; i++)
+ {
+ io_generic_write(io, sectors[i + 1].data, file_offset, 128);
+ file_offset += 128;
}
- return FLOPPY_ERROR_SUCCESS;
-}
-
+ // rest are mfm tracks
+ for (int track = 0; track < track_count; track++)
+ {
+ for (int head = 0; head < head_count; head++)
+ {
+ // skip track 0, head 0
+ if (track == 0) { if (head_count == 1) break; else head++; }
+
+ generate_bitstream_from_track(track, head, 2000, bitstream, track_size, image);
+ extract_sectors_from_bitstream_mfm_pc(bitstream, track_size, sectors, sector_data, sizeof(sector_data));
+
+ for (int i = 0; i < 17; i++)
+ {
+ io_generic_write(io, sectors[i + 1].data, file_offset, 256);
+ file_offset += 256;
+ }
+ }
+ }
-static floperr_t svi_get_indexed_sector_info(floppy_image_legacy *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags)
-{
- sector_index += 1;
- if (cylinder)
- *cylinder = track;
- if (side)
- *side = head;
- if (sector)
- *sector = sector_index;
- if (flags)
- /* TODO: read DAM or DDAM and determine flags */
- *flags = 0;
- return svi_get_sector_length(floppy, head, track, sector_index, sector_length);
+ return true;
}
-
-static FLOPPY_CONSTRUCT(svi_dsk_construct)
+bool svi_format::supports_save() const
{
- struct FloppyCallbacks *callbacks;
- callbacks = floppy_callbacks(floppy);
- callbacks->read_sector = svi_read_sector;
- callbacks->write_sector = svi_write_sector;
- callbacks->read_indexed_sector = svi_read_indexed_sector;
- callbacks->write_indexed_sector = svi_write_indexed_sector;
- callbacks->get_sector_length = svi_get_sector_length;
- callbacks->get_heads_per_disk = svi_get_heads_per_disk;
- callbacks->get_tracks_per_disk = svi_get_tracks_per_disk;
- callbacks->get_indexed_sector_info = svi_get_indexed_sector_info;
-
- return FLOPPY_ERROR_SUCCESS;
+ return true;
}
-
-
-/* ----------------------------------------------------------------------- */
-
-LEGACY_FLOPPY_OPTIONS_START( svi318 )
- LEGACY_FLOPPY_OPTION( svi_dsk, "dsk", "SVI-318 floppy disk image", svi_dsk_identify, svi_dsk_construct, NULL, NULL)
- LEGACY_FLOPPY_OPTION( svi_cpm, "dsk", "SVI-728 DSDD CP/M disk image", basicdsk_identify_default, basicdsk_construct_default, NULL,
- HEADS([2])
- TRACKS([40])
- SECTORS([17])
- SECTOR_LENGTH([256])
- FIRST_SECTOR_ID([1]))
-LEGACY_FLOPPY_OPTIONS_END
+const floppy_format_type FLOPPY_SVI_FORMAT = &floppy_image_format_creator<svi_format>;
diff --git a/src/lib/formats/svi_dsk.h b/src/lib/formats/svi_dsk.h
index 3b88c496dcb..6ffd74619a1 100644
--- a/src/lib/formats/svi_dsk.h
+++ b/src/lib/formats/svi_dsk.h
@@ -1,20 +1,35 @@
-// license:BSD-3-Clause
-// copyright-holders:Miodrag Milanovic
-/*********************************************************************
+// license:GPL-2.0+
+// copyright-holders:Dirk Best
+/***************************************************************************
- formats/svi_dsk.h
+ Spectravideo SVI-318/328
- SVI318 disk images
+ Disk image format
-*********************************************************************/
+***************************************************************************/
-#ifndef SVI_DSK_H
-#define SVI_DSK_H
+#pragma once
+
+#ifndef __SVI_DSK_H__
+#define __SVI_DSK_H__
#include "flopimg.h"
-/**************************************************************************/
+class svi_format : public floppy_image_format_t
+{
+public:
+ svi_format();
+
+ virtual const char *name() const;
+ virtual const char *description() const;
+ virtual const char *extensions() const;
+
+ virtual int identify(io_generic *io, UINT32 form_factor);
+ virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image);
+ virtual bool save(io_generic *io, floppy_image *image);
+ virtual bool supports_save() const;
+};
-LEGACY_FLOPPY_OPTIONS_EXTERN(svi318);
+extern const floppy_format_type FLOPPY_SVI_FORMAT;
-#endif /* SVI_DSK_H */
+#endif // __SVI_DSK_H__
diff --git a/src/lib/formats/ti99_dsk.c b/src/lib/formats/ti99_dsk.c
index f0688634d9f..599cbe4eda3 100644
--- a/src/lib/formats/ti99_dsk.c
+++ b/src/lib/formats/ti99_dsk.c
@@ -2,8 +2,6 @@
// copyright-holders:Michael Zapf
/*********************************************************************
*
- * formats/ti99_dsk.c
- *
* TI-99 family disk images
*
* used by TI-99/4, TI-99/4A, TI-99/8, SGCPU ("TI-99/4P"), and Geneve
@@ -34,10 +32,7 @@
* all 80 tracks, doubling the size of the image file. This disk image will
* now become unusable in a 40-track drive - which is exactly what happens in reality.
*
- * -------------------------------------------------------------------
- * The second half of this file contains the legacy implementation.
- *
- * Michael Zapf, Sep 2014
+ * Michael Zapf, July 2015
*
********************************************************************/
@@ -1139,1996 +1134,3 @@ int ti99_tdf_format::get_track_size(int cell_size, int sector_count)
}
const floppy_format_type FLOPPY_TI99_TDF_FORMAT = &floppy_image_format_creator<ti99_tdf_format>;
-
-
-//==========================================================================
-
-/**************************************************************
- *
- * Legacy implementation
- *
- * Different to earlier implementations, these format implementations provide
- * full track read/write capabilities. For the SDF format, the missing track
- * information is recreated, and a common interleave is assumed.
- *
- * Note that in principle, writing tracks may change track sizes.
- * As neither one of the formats contains meta-information about track lengths,
- * and as the image consists of a contiguous sequence of the tracks, we
- * cannot allow different track sizes currently. Accordingly, the track size
- * cannot be changed after the image has been created by imgtool.
- * Hence, also sector count per tracks and recording type (FM or MFM) cannot be
- * changed without breaking the image.
- * For example, MFM disks with 18 sectors per track can only be reformatted to
- * MFM/18. Moreover, while this could be handled in a future revision,
- * the number of tracks should also remain unchanged.
- *
- * You can use blank image files (filled with zeros or arbitrary data) and use
- * the Disk Manager cartridge to properly format them. Also, this can be done
- * by imgtool. The image file must match the format length (representing the
- * space on the physical medium).
- *
- * 80 track drive handling
- *
- * For the TI system there may be a situation where 40 track disks are used
- * in 80 track drives. In these cases, the disk driver applies double-stepping,
- * that is, it advances the head twice in order to seek the next track. We
- * emulate this by dividing the track number by 2, which means that two tracks
- * are mapped to one (0,1 -> 0; 2,3 -> 1; 4,5 -> 2; ...; 78,79 -> 39)
- *
- * Technical detail: The size of the track must be given before actually
- * starting write_track as the controller implementation uses buffered
- * transfer.
- *
- * Michael Zapf, Feb 2010
- *
- * TODO: Link to imgtool. imgtool still uses its own format creation
- *
- * FIXME: If image is broken with good first track and defect higher tracks,
- * tdf_guess_geometry fails to define a geometry. The guessing should
- * always be done.
-**************************************************************/
-
-#define TI99_IDAM_LENGTH 7
-
-/*
- Determines whether we are using 80 track drives. This variable is
- necessary unless we get information about the dip
- switch settings. It is set by the disk controller implementations
- (bwg, hfdc, ti_fdc).
-*/
-static int use_80_track_drives = FALSE;
-
-struct ti99dsk_geometry
-{
- UINT8 sides;
- UINT8 tracksperside;
- UINT8 secspertrack;
- UINT8 density;
-};
-
-struct ti99dsk_tag
-{
- int heads;
- int tracks;
- int sectors;
- int track_size; // Complete track; to be calculated
- int format;
- int first_idam;
- int dam_offset;
-};
-
-/*
- Parametrizes the format to use 80 track drives. For TI systems we
- need to be able to emulate 40 track drives and 80 track drives.
- This is set in the configuration, but the format has no direct access.
- So as a preliminary solution we use this global function which sets the
- flag. This function is called by the disk controller implementations
- (bwg, hfdc, ti_fdc).
-*/
-void ti99_set_80_track_drives(int use80)
-{
- use_80_track_drives = use80;
-}
-
-#define TI99_DSK_TAG "ti99dsktag"
-#define TI99DSK_BLOCKNOTFOUND -1
-
-/*
- Searches a block containing number * byte, starting at the given
- position. Returns the position of the first byte of the block.
-*/
-static int find_block(const UINT8 *buffer, int start, int stop, UINT8 byte, size_t number)
-{
- int i = start;
- size_t current = number;
- while (i < stop && current > 0)
- {
- if (buffer[i++] != byte)
- {
- current = number;
- }
- else
- {
- current--;
- }
- }
- if (current==0)
- {
- return i - number;
- }
- else
- return TI99DSK_BLOCKNOTFOUND;
-}
-
-/*
- Queried by flopdrv. Instead of the image tracks, we return the tracks
- of the floppy drive. We assume we always have two heads.
-*/
-static int ti99_get_heads_per_disk(floppy_image_legacy *floppy)
-{
-// struct ti99dsk_tag *tag = (ti99dsk_tag*)floppy_tag(floppy);
-// return tag->heads;
- return 2;
-}
-
-/*
- Queried by flopdrv. Instead of the image tracks, we return the tracks
- of the floppy drive.
-*/
-static int ti99_get_tracks_per_disk(floppy_image_legacy *floppy)
-{
- int drivetracks = 42;
-
- // This may fail on startup; therefore we use a special function in
- // in the floppy controller implementations to explicitly set the geometry.
- if (use_80_track_drives)
- {
- drivetracks = 83;
- }
- return drivetracks;
-}
-
-static floperr_t ti99_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *sector_length)
-{
- *sector_length=SECTOR_SIZE;
- return FLOPPY_ERROR_SUCCESS;
-}
-
-/*
- Return the track size. We do not allow different track
- sizes, so we store the track size in the tag.
-*/
-static UINT32 ti99_get_track_size(floppy_image_legacy *floppy, int head, int track)
-{
- struct ti99dsk_tag *tag = (ti99dsk_tag*)floppy_tag(floppy);
- return tag->track_size;
-}
-
-/*
-static void create_vib(UINT8 *sector0, option_resolution *params)
-{
- const char *name = "UNNAMED ";
- int sides, tracksperside,secspertrack,totalsectors,ausize,allocbytes,i;
-
- enum { NAME=0, TOTALSECS=10, SECSPERTRACK=11, SIG=12, PROT=16, TRACKS=17, SIDES=18, DENSITY=19, EXT=20, ALLOC=56 };
-
- sides = option_resolution_lookup_int(params, PARAM_HEADS);
- tracksperside = option_resolution_lookup_int(params, PARAM_TRACKS);
- secspertrack = option_resolution_lookup_int(params, PARAM_SECTORS);
-
- totalsectors = sides * tracksperside * secspertrack;
-
- memcpy(&sector0[NAME], name, 10);
-
- sector0[TOTALSECS] = (totalsectors>>8)&0xff;
- sector0[TOTALSECS+1] = (totalsectors&0xff);
-
- sector0[SECSPERTRACK] = secspertrack;
- sector0[SIG] = 'D';
- sector0[SIG+1] = 'S';
- sector0[SIG+2] = 'K';
-
- sector0[PROT] = ' ';
- sector0[TRACKS] = tracksperside;
- sector0[SIDES] = sides;
- sector0[DENSITY] = (secspertrack<10)? 0x01 : 0x02;
-
- for (i=EXT; i < ALLOC; i++)
- sector0[i] = 0;
-
- ausize = (totalsectors / 1441) + 1;
-
- allocbytes = totalsectors / ausize / 8;
-
- for (i=ALLOC; i < ALLOC+allocbytes; i++)
- sector0[i] = 0;
-
- while (i++ < SECTOR_SIZE)
- sector0[i] = 0xff;
-}
-*/
-/* =========================================================================
- Sector dump format
- =========================================================================*/
-
-static floperr_t ti99_sdf_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen);
-static floperr_t ti99_sdf_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam);
-
-/* -----------------------------------------------------------------------
- * Guess the geometry of the sector dump disk.
- *
- * Sector size is always 256 bytes.
- *
- * Common formats:
- * 90 KiB = 40 tracks / 1 side / 9 sectors = SSSD
- * 180 KiB = 40 tracks / 2 side / 9 sectors = DSSD (most common)
- * = 40 tracks / 1 side / 18 sectors = SSDD (rare)
- * = 80 tracks / 1 side / 9 sectors = SSSD80 (rare)
- * 360 KiB = 40 tracks / 2 side / 18 sectors = DSDD (most common)
- * = 80 tracks / 2 side / 9 sectors = DSSD80 (rare)
- * = 80 tracks / 1 side / 18 sectors = SSDD80 (rare)
- * = 40 tracks / 1 side / 36 sectors = SSHD (rare)
- * 720 KiB = 80 tracks / 2 side / 18 sectors = DSDD80 (most common)
- * 1440 KiB= 80 tracks / 2 side / 36 sectors = DSHD80 (most common)
- *
- * Moreover, there may be formats with 35 tracks (ancient) and 8 sectors/track.
- * We only check for the 8 sector formats.
- * 160 KiB = 40 tracks / 1 side / 16 sectors = SSDD8
- * 320 KiB = 40 tracks / 2 side / 16 sectors = DSDD8
- *
- * The Volume Information Block may contain suitable information, but not
- * before the disk is formatted and initialized.
- *
- * returns 100 if recognized, 0 if not recognized
- * ----------------------------------------------------------------------- */
-
-static int ti99_sdf_guess_geometry(floppy_image_legacy *floppy, UINT64 size,
- struct ti99dsk_geometry *geometry)
-{
- int totsecs;
- typedef struct ti99_vib
- {
- char name[10]; // volume name (10 characters, pad with spaces)
- UINT8 totsecsMSB; // disk length in sectors (big-endian) (usually 360, 720 or 1440)
- UINT8 totsecsLSB;
- UINT8 secspertrack; // sectors per track (usually 9 (FM) or 18 (MFM))
- UINT8 id[3]; // String "DSK"
- UINT8 protection; // 'P' if disk is protected, ' ' otherwise.
- UINT8 tracksperside; // tracks per side (usually 40)
- UINT8 sides; // sides (1 or 2)
- UINT8 density; // 0,1 (FM) or 2,3,4 (MFM)
- UINT8 res[36]; // Empty for traditional disks, or up to 3 directory pointers
- UINT8 abm[200]; // allocation bitmap: a 1 for each sector in use (sector 0 is LSBit of byte 0,
- // sector 7 is MSBit of byte 0, sector 8 is LSBit of byte 1, etc.)
- } ti99_vib;
-
- ti99_vib vib;
- UINT32 file_size;
- struct ti99dsk_geometry dummy_geometry;
-
- if (geometry)
- memset(geometry, 0, sizeof(*geometry));
- else
- geometry = &dummy_geometry;
-
- if (size > 0xFFFFFFFF)
- return 0;
-
- file_size = (UINT32) size;
-
- // Read the Volume Information Block
- floppy_image_read(floppy, &vib, 0, sizeof(vib));
-
- // If we have read the sector successfully, let us parse it
- totsecs = (vib.totsecsMSB << 8) | vib.totsecsLSB;
- geometry->secspertrack = vib.secspertrack;
- if (geometry->secspertrack == 0)
- // Some images might be like this, because the original SSSD
- // TI controller always assumes 9.
- geometry->secspertrack = 9;
- geometry->tracksperside = vib.tracksperside;
- if (geometry->tracksperside == 0)
- // Some images are like this, because the original SSSD TI controller
- // always assumes 40.
- geometry->tracksperside = 40;
- geometry->sides = vib.sides;
- if (geometry->sides == 0)
- // Some images are like this, because the original SSSD TI controller
- // always assumes that tracks beyond 40 are on side 2. */
- geometry->sides = totsecs / (geometry->secspertrack * geometry->tracksperside);
- geometry->density = vib.density;
- // check that the format makes sense
- if (((geometry->secspertrack * geometry->tracksperside * geometry->sides) == totsecs)
- && (geometry->density <= 4) && (totsecs >= 2) && (! memcmp(vib.id, "DSK", 3))
- && (file_size == totsecs*256))
- {
- LOG_FORMATS("SDF/VIB consistent; tracks = %d, heads = %d, sectors = %d\n", geometry->tracksperside, geometry->sides, geometry->secspertrack);
- return 100;
- }
- LOG_FORMATS("SDF/VIB not consistent; guessing format\n");
-
- // So that was not consistent. We guess the size from the file size
- // and assume that the VIB did not contain reliable data. For the
- // ambiguous case we choose the most common format.
-
- // Adding support for another sector image format which adds 768 bytes
- // as a bad sector map
- if ((file_size / 256) % 10 == 3)
- {
- LOG_FORMATS("Stripping map of bad sectors at image end\n");
- file_size -= 768;
- }
-
- switch (file_size)
- {
- case 1*40*9*256:
- // 90kbytes: SSSD
- case 0:
- /*default:*/
- geometry->sides = 1;
- geometry->tracksperside = 40;
- geometry->secspertrack = 9;
- geometry->density = 1;
- break;
-
- case 2*40*9*256:
- // 180kbytes: either DSSD or 18-sector-per-track SSDD.
- // We assume DSSD since DSSD is more common and is supported by
- // the original TI SD disk controller.
- geometry->sides = 2;
- geometry->tracksperside = 40;
- geometry->secspertrack = 9;
- geometry->density = 1;
- break;
-
- case 1*40*16*256:
- // 160kbytes: 16-sector-per-track SSDD (standard format for TI
- // DD disk controller prototype, and the TI hexbus disk
- // controller?) */
- geometry->sides = 1;
- geometry->tracksperside = 40;
- geometry->secspertrack = 16;
- geometry->density = 2;
- break;
-
- case 2*40*16*256:
- // 320kbytes: 16-sector-per-track DSDD (standard format for TI
- // DD disk controller prototype, and TI hexbus disk
- // controller?)
- geometry->sides = 2;
- geometry->tracksperside = 40;
- geometry->secspertrack = 16;
- geometry->density = 2;
- break;
-
- case 2*40*18*256:
- // 360kbytes: 18-sector-per-track DSDD (standard format for most
- // third-party DD disk controllers, but reportedly not supported by
- // the original TI DD disk controller prototype)
- geometry->sides = 2;
- geometry->tracksperside = 40;
- geometry->secspertrack = 18;
- geometry->density = 2;
- break;
-
- case 2*80*18*256:
- // 720kbytes: 18-sector-per-track 80-track DSDD (Myarc only)
- geometry->sides = 2;
- geometry->tracksperside = 80;
- geometry->secspertrack = 18;
- geometry->density = 2;
- break;
-
- case 2*80*36*256:
- // 1.44Mbytes: DSHD (Myarc only)
- geometry->sides = 2;
- geometry->tracksperside = 80;
- geometry->secspertrack = 36;
- geometry->density = 3;
- break;
-
- default:
- LOG_FORMATS("Unrecognized disk image geometry\n");
- return 0;
- }
-
- LOG_FORMATS("SDF geometry guess: tracks = %d, heads = %d, sectors = %d\n", geometry->tracksperside, geometry->sides, geometry->secspertrack);
- return 100;
-}
-
-/*
- Figure out the interleave for the sector arrangement in the track. For
- SDF format this is required for the read_track function.
-
- Interleave:
- 0 7 5 3 1 8 6 4 2;
- start with 0, 3, 6, 0, 3, 6, ...
- 0 11 4 15 8 1 12 5 16 9 2 13 6 17 10 3 14 7
- start with 0 for every track
-
- Rare formats: 8 sectors
- 0 3 6 1 4 7 2 5 (i*3)%8
-
- 16 sectors
- 0 9 2 11 4 13 6 15 8 1 10 3 12 5 14 7 (i*9)%16
-
- 36 sectors
- 0 11 22 ... 3 14 25 (i*11)%36
-*/
-static void guess_interleave(int sectors, int *step, int *initial)
-{
- switch (sectors)
- {
- case 8:
- *step = 3;
- /* initial is the offset from track to track+1 of the starting sector number */
- *initial = 0;
- break;
- case 9:
- *step = 7;
- *initial = 3;
- break;
- case 16:
- *step = 9;
- *initial = 0;
- break;
- case 18:
- *step = 11;
- *initial = 0;
- break;
- case 36:
- *step = 11;
- *initial = 0;
- break;
- default:
- *step = 11;
- *initial = 0;
- break;
- }
-}
-
-/*
- Delivers a whole track. As the image consists only of
- sector data, we must reconstruct the track data and
- then insert the sector data.
-
- The track layout is exactly the Track Dump Format, except that the
- CRC values must be correctly calculated.
-
- Total length (FM) = 247 + sectors*334; (sectors=8 or 9)
- Total length (MFM) = 752 + sectors*340; (sectors=16 or 18)
-*/
-static floperr_t ti99_sdf_read_track(floppy_image_legacy *floppy, int head, int track, UINT64 offset, void *buffer, size_t buflen)
-{
- int sector;
- int startstep;
- int step;
- int position=0;
- unsigned short crc;
- int i;
- floperr_t err;
- int imgtrack = track;
-
- UINT8 *trackdata = (UINT8*)buffer;
-
- /* Determine from the image geometry whether we have FM or MFM */
- struct ti99dsk_tag *tag = (ti99dsk_tag*)floppy_tag(floppy);
-
- // Do we have a 40 track disk in an 80 track drive? In that case we
- // double the "width" of the tracks. */
- if (use_80_track_drives && tag->tracks<=40)
- {
- imgtrack = track / 2;
- }
-
- guess_interleave(tag->sectors, &step, &startstep);
-
- if (tag->sectors < 10) /* must be FM */
- {
- /* Write lead-in. */
- memset(trackdata, 0x00, 16);
- position += 16;
- for (i=0; i < tag->sectors; i++)
- {
- /* Create interleaving */
- sector = (i*step + imgtrack*startstep) % tag->sectors;
-
- memset(&trackdata[position], 0x00, 6);
- position += 6;
- /* Set IDAM */
- trackdata[position++] = 0xfe;
- trackdata[position++] = imgtrack;
- trackdata[position++] = head;
- trackdata[position++] = sector;
- trackdata[position++] = 0x01;
- /* Calculate CRC16. Preset to 0xffff (what is 0xcdb4?) */
- crc = ccitt_crc16(0xffff, &trackdata[position-(TI99_IDAM_LENGTH-2)], TI99_IDAM_LENGTH - 2);
- trackdata[position++] = (crc>>8)&0xff;
- trackdata[position++] = crc & 0xff;
-
- /* Write Gap2 */
- memset(&trackdata[position], 0xff, 11);
- position += 11;
- memset(&trackdata[position], 0x00, 6);
- position += 6;
- /* Write DAM */
- trackdata[position++] = 0xfb;
-
- /* Locate the sector content in the image and load it. */
- err = ti99_sdf_read_sector(floppy, head, imgtrack, sector, &trackdata[position], SECTOR_SIZE);
- if (err)
- return err;
-
- position += SECTOR_SIZE;
-
- /* Set CRC16 */
- crc = ccitt_crc16(0xffff, &trackdata[position-(SECTOR_SIZE+1)], SECTOR_SIZE+1);
- trackdata[position++] = (crc>>8)&0xff;
- trackdata[position++] = crc & 0xff;
-
- /* Write Gap3 */
- memset(&trackdata[position], 0xff, 45);
- position += 45;
- }
- /* Write lead-out */
- memset(&trackdata[position], 0xff, 231);
- position += 231;
- }
- else /* we have MFM */
- {
- /* Write lead-in. */
- memset(trackdata, 0x4e, 40);
- position += 40;
- for (i=0; i < tag->sectors; i++)
- {
- sector = (i*step + imgtrack*startstep) % tag->sectors;
-
- memset(&trackdata[position], 0x00, 10);
- position += 10;
- /* Write sync */
- memset(&trackdata[position], 0xa1, 3);
- position += 3;
- /* Set IDAM */
- trackdata[position++] = 0xfe;
- trackdata[position++] = imgtrack;
- trackdata[position++] = head;
- trackdata[position++] = sector;
- trackdata[position++] = 0x01;
- /* Set CRC16 */
- crc = ccitt_crc16(0xffff, &trackdata[position-TI99_IDAM_LENGTH+2], TI99_IDAM_LENGTH - 2);
- trackdata[position++] = (crc>>8)&0xff;
- trackdata[position++] = crc & 0xff;
-
- /* Write Gap2 */
- memset(&trackdata[position], 0x4e, 22);
- position += 22;
- memset(&trackdata[position], 0x00, 12);
- position += 12;
- /* Write sync */
- memset(&trackdata[position], 0xa1, 3);
- position += 3;
- /* Write DAM */
- trackdata[position++] = 0xfb;
-
- /* Locate the sector content in the image and load it. */
- err = ti99_sdf_read_sector(floppy, head, track, sector, &trackdata[position], SECTOR_SIZE);
- if (err)
- return err;
-
- position += SECTOR_SIZE;
-
- /* Set CRC16 */
- crc = ccitt_crc16(0xffff, &trackdata[position-SECTOR_SIZE-1], SECTOR_SIZE+1);
- trackdata[position++] = (crc>>8)&0xff;
- trackdata[position++] = crc & 0xff;
-
- /* Write Gap3 */
- memset(&trackdata[position], 0x4e, 24);
- position += 24;
- }
- /* Write lead-out */
- memset(&trackdata[position], 0x4e, 712);
- position += 712;
- }
- return FLOPPY_ERROR_SUCCESS;
-}
-
-/*
- Writes a whole track. As the sector dump format does not include track
- data, we have to extract the sector contents and to write them
- in sequence into the image. All the rest (gaps, crc, sync bytes) are
- dropped here.
- Bytes written to locations beyond the image end will be droppped
- silently (as if the medium is unwritable from that point).
-*/
-static floperr_t ti99_sdf_write_track(floppy_image_legacy *floppy, int head, int track, UINT64 offset, const void *buffer, size_t buflen)
-{
- int current_pos = 0;
- UINT8 *track_image;
- int leadin, gap1, gap2;
- int is_fm, found;
- struct ti99dsk_tag *tag = (ti99dsk_tag*)floppy_tag(floppy);
- int imgtrack = track;
-
- // Find out if we are going to write an FM or MFM track. Note that the
- // original TI controller is known to have a bug in the formatting
- // routine (using a MOVB instead of a MOV instruction when setting the
- // pointer to the track data), outputting false bytes at the
- // beginning of the track. So we do not rely on absolute positions
- // (and neither does the controller).
- track_image = (UINT8*)buffer;
-
- if (use_80_track_drives && tag->tracks<=40)
- {
- imgtrack = track / 2;
- }
-
- /* Only search in the first 100 bytes for the start. */
- leadin = 40;
- gap1 = 10;
- gap2 = 12;
- is_fm = FALSE;
-
- current_pos = find_block(track_image, 0, 100, 0x4e, leadin);
-
- // In case of defect formats, we continue as far as possible. This
- // may lead to sectors not being written. */
- if (current_pos==TI99DSK_BLOCKNOTFOUND)
- {
- /* Not MFM, possibly FM image */
- /* Again, find Lead-in */
- leadin = 16;
- current_pos = find_block(track_image, 0, 100, 0x00, leadin);
- if (current_pos==TI99DSK_BLOCKNOTFOUND)
- {
- /* If neither, forget about this process completely. */
- LOG_FORMATS("Cannot find lead-in for track %d, head %d.\n", track, head);
- return FLOPPY_ERROR_INVALIDIMAGE;
- }
- gap1 = 6;
- gap2 = 6;
- is_fm = TRUE;
- }
-
- found = FALSE;
- /* Get behind lead-in */
- current_pos += leadin;
- while (current_pos < buflen)
- {
- /* We must find the address block to determine the sector. */
- int new_pos = find_block(track_image, current_pos, buflen, 0x00, gap1);
- if (new_pos==TI99DSK_BLOCKNOTFOUND)
- {
- /* Forget about the rest. */
- if (found) break; /* we were already successful, so all ok */
- LOG_FORMATS("Cannot find gap1 for track %d, head %d.\n", track, head);
- return FLOPPY_ERROR_INVALIDIMAGE;
- }
- found = TRUE;
-
- if (!is_fm)
- new_pos += 3; /* skip sync bytes in MFM */
-
- if (track_image[new_pos + gap1]==0xfe)
- {
- current_pos = new_pos + gap1 + 1;
- /* IDAM found. */
- int wtrack = track_image[current_pos];
- int whead = track_image[current_pos+1];
- int sector = track_image[current_pos+2];
- if (wtrack == imgtrack && whead == head)
- {
- /* We skip the first part of gap2. */
- new_pos = find_block(track_image, current_pos, buflen, 0x00, gap2);
- if (current_pos==TI99DSK_BLOCKNOTFOUND)
- {
- LOG_FORMATS("Cannot find gap2 for track %d, head %d.\n", imgtrack, head);
- return FLOPPY_ERROR_INVALIDIMAGE;
- }
- else
- {
- new_pos += gap2;
- if (!is_fm)
- new_pos += 3; /* skip sync */
- current_pos = new_pos;
- if (track_image[current_pos]==0xfb)
- {
- /* DAM found. We now write the sector content to the image. */
- ti99_sdf_write_sector(floppy, head, track, sector, &track_image[current_pos+1], SECTOR_SIZE, 0);
- current_pos += SECTOR_SIZE;
- }
- else
- LOG_FORMATS("DAM not found. Not writing write sector %d\n", sector);
- /* else not found, ignore this sector. */
- }
- }
- else
- {
- // else the sector head data do not match the
- // current track and head. Ignore the sector.
- LOG_FORMATS("Wrong track: wtrack=%d, imgtrack=%d, whead=%d, imghead=%d\n",wtrack,imgtrack, whead,head);
- }
- }
- else
- {
- /* One step forward. Retry. */
- current_pos++;
- }
- }
- return FLOPPY_ERROR_SUCCESS;
-}
-
-/*
- This method creates a properly formatted image.
-
- For a proper image, we need to format all tracks, and to create a
- minimal filesystem:
-
- name = "UNNAMED "
- number of sectors
- sectors/track
- "DSK"
- protection = 0x00
- tracks/side
- sides
- density (0,1 = FM, 2 = MFM)
- 0x14 - 0x37 : 0x00
- Allocation bitmap: 0xFF except for the first #sectors/AU size
-
- AU size = 1 (360 - 1440 sectors)
- = 2 (1441 - 2880 sectors)
- = 4 (2881 - 5760 sectors)
- = 8 (5760 - 11520 sectors)
-
- sector 0 =
- sector 1 = 256* 0x00
-*/
-/* static floperr_t ti99_sdf_format_track(floppy_image_legacy *floppy, int head, int track, option_resolution *params)
-{
- dynamic_buffer sector0(SECTOR_SIZE);
- create_vib(sector0, params);
- if (true)
- {
- printf("not implemented\n");
- return FLOPPY_ERROR_SEEKERROR;
- }
- return FLOPPY_ERROR_SUCCESS;
-}
-*/
-
-/*
- Get the offset from the start of the image file. In this format, logical
- tracks on two-sided disks are arranged as follows (example for 40
- tracks; accordingly for 35 or 80)
-
- head-track
- 0-0
- 0-1
- 0-2
- 0-3
- ...
- 0-39
- 1-39
- 1-38
- 1-37
- ...
- 1-0
- Note that we take the imgtrack, which may be half of the drive track.
-*/
-static floperr_t ti99_sdf_get_offset(floppy_image_legacy *floppy, int head, int imgtrack, int sector, UINT64 *offset)
-{
- struct ti99dsk_tag *tag = (ti99dsk_tag*)floppy_tag(floppy);
-
- if ((head < 0) || (head >= tag->heads)
- || (imgtrack < 0) || (imgtrack >= tag->tracks)
- || (sector < 0) || (sector > tag->sectors))
- return FLOPPY_ERROR_SEEKERROR;
-
- if (head == 0) /* track numbers increasing towards inner track */
- {
- *offset = (imgtrack * tag->sectors + sector) * SECTOR_SIZE;
- }
- else /* track numbers increasing towards outer track */
- {
- *offset = (((2*tag->tracks)-1-imgtrack) * tag->sectors + sector) * SECTOR_SIZE;
- }
- return FLOPPY_ERROR_SUCCESS;
-}
-
-/*
- Read one sector at the specified position.
-*/
-static floperr_t ti99_sdf_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
-{
- floperr_t err;
- UINT64 offset;
- int imgtrack = track;
- struct ti99dsk_tag *tag = (ti99dsk_tag*)floppy_tag(floppy);
-
- if (use_80_track_drives && tag->tracks<=40)
- {
- imgtrack = track / 2;
- }
-
- err = ti99_sdf_get_offset(floppy, head, imgtrack, sector, &offset);
- if (err)
- {
- return err;
- }
- floppy_image_read(floppy, buffer, offset, SECTOR_SIZE);
-
- return FLOPPY_ERROR_SUCCESS;
-}
-
-/*
- For the SDF format, sectors are always numbered in ascending order,
- starting with the lowest numbered sector in each track. In other words,
- we have nothing to calculate here.
-*/
-static floperr_t ti99_sdf_read_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
-{
- return ti99_sdf_read_sector(floppy, head, track, sector, buffer, buflen);
-}
-
-/*
- Write one sector at the specified position.
-*/
-static floperr_t ti99_sdf_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
-{
- UINT64 offset;
- floperr_t err;
- int imgtrack = track;
-
- struct ti99dsk_tag *tag = (ti99dsk_tag*)floppy_tag(floppy);
-
- if (use_80_track_drives && tag->tracks<=40)
- {
- imgtrack = track / 2;
- }
-
- err = ti99_sdf_get_offset(floppy, head, imgtrack, sector, &offset);
- if (err)
- {
- return err;
- }
- floppy_image_write(floppy, buffer, offset, SECTOR_SIZE);
-
- return FLOPPY_ERROR_SUCCESS;
-}
-
-/*
- See above; indexing and numbering coincide.
-*/
-static floperr_t ti99_sdf_write_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
-{
- return ti99_sdf_write_sector(floppy, head, track, sector, buffer, buflen, ddam);
-}
-
-/*
- Required for ReadAddress command
-*/
-static floperr_t ti99_sdf_get_indexed_sector_info(floppy_image_legacy *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags)
-{
- struct ti99dsk_tag *tag = (ti99dsk_tag*)floppy_tag(floppy);
-
- if (use_80_track_drives && tag->tracks<=40)
- {
- track = track / 2;
- }
-
- if (sector_length)
- *sector_length=SECTOR_SIZE;
- if (cylinder)
- *cylinder = track;
- if (side)
- *side = head;
- if (sector)
- *sector = sector_index;
- if (flags)
- *flags = 0;
- if (sector_index >= tag->sectors)
- {
- return FLOPPY_ERROR_SEEKERROR;
- }
-
- return FLOPPY_ERROR_SUCCESS;
-}
-
-/*
- Try to identify the image as an SDF format image.
-*/
-static FLOPPY_IDENTIFY(ti99_sdf_identify)
-{
- UINT64 size;
- size = floppy_image_size(floppy);
- *vote = ti99_sdf_guess_geometry(floppy, size, NULL);
- LOG_FORMATS("SDF voting %d\n", *vote);
- return FLOPPY_ERROR_SUCCESS;
-}
-
-/*
- Create the SDF data structures and set the callbacks.
-*/
-static FLOPPY_CONSTRUCT(ti99_sdf_construct)
-{
- struct ti99dsk_geometry geometry;
- struct FloppyCallbacks *callbacks;
- struct ti99dsk_tag *tag;
- LOG_FORMATS("Reading image as SDF\n");
-
- if (params)
- {
- /* create */
- memset(&geometry, 0, sizeof(geometry));
- geometry.sides = option_resolution_lookup_int(params, PARAM_HEADS);
- geometry.tracksperside = option_resolution_lookup_int(params, PARAM_TRACKS);
- geometry.secspertrack = option_resolution_lookup_int(params, PARAM_SECTORS);
-
- /* We don't have headers for geometry */
- /* check for usage in imgtool - we want to be able to create useful disks */
- }
- else
- {
- /* load */
- if (ti99_sdf_guess_geometry(floppy, floppy_image_size(floppy), &geometry)<50)
- return FLOPPY_ERROR_INVALIDIMAGE;
- }
-
- assert(geometry.sides);
- assert(geometry.tracksperside);
- assert(geometry.secspertrack);
-
- tag = (struct ti99dsk_tag *) floppy_create_tag(floppy, sizeof(struct ti99dsk_tag));
-
- if (!tag)
- return FLOPPY_ERROR_OUTOFMEMORY;
-
- tag->heads = geometry.sides;
- tag->tracks = geometry.tracksperside;
- tag->sectors = geometry.secspertrack;
- if (tag->sectors < 10)
- /* FM mode */
- tag->track_size = 16 + tag->sectors*334 + 231;
- else
- tag->track_size = 40 + tag->sectors*340 + 712;
-
- /* set up format callbacks */
- callbacks = floppy_callbacks(floppy);
- callbacks->read_sector = ti99_sdf_read_sector;
- callbacks->write_sector = ti99_sdf_write_sector;
- callbacks->read_indexed_sector = ti99_sdf_read_indexed_sector;
- callbacks->write_indexed_sector = ti99_sdf_write_indexed_sector;
- callbacks->read_track = ti99_sdf_read_track;
- callbacks->write_track = ti99_sdf_write_track;
-/* callbacks->format_track = ti99_sdf_format_track; */
- callbacks->get_track_size = ti99_get_track_size;
- /* post format unset */
- callbacks->get_heads_per_disk = ti99_get_heads_per_disk;
- callbacks->get_tracks_per_disk = ti99_get_tracks_per_disk;
- callbacks->get_sector_length = ti99_get_sector_length;
- callbacks->get_indexed_sector_info = ti99_sdf_get_indexed_sector_info;
-
- return FLOPPY_ERROR_SUCCESS;
-}
-
-/* -----------------------------------------------------------------------
- * Track Dump Format, aka PC99 format
- * This format includes all track data, including address marks and gaps.
- * However, CRC is not stored; instead, a f7f7 is stored at that location.
- * Two track images exist, one for FM and one for MFM format.
- *
- * In this implementation, however, we do calculate the CRC.
- *
- * All tracks have exactly the same size, so offsets are calculated easily.
- *
- * This format is a precise map of the data contents of the track;
- * however, it does not store clock patterns.
- *
- * The TDF format does not have a special index part, so any sector on it
- * must be searched (as done by the disk controller)
- *
- * Interesting detail: The original TI disk controller has a bug which has
- * just recently been discovered (using MESS!): The lead-in has another 9
- * bytes as a prefix; this is due to a wrongly set pointer in the format
- * routine. Strictly speaking, it produces invalid track images.
- * The original hardware does not care, however, so neither should we.
- * To keep the emulation realistic (and to allow for a
- * possible future extension with clock bits), we search for the
- * beginning of the track. From there on, however, we accept no further
- * deviations. This may make the resulting format unusable with the PC99
- * emulator, but it only appears when formatting with the TI disk
- * controller anyway. If the image is created with another disk controller or
- * using imgtool, the format is correctly created.
- *
- * FM track image
- *
- * Lead-in: 16* 00
- * Pre-ID gap: 6* 00 ---+
- * IDAM: fe |
- * Track: tt |
- * Head: hh |
- * Sector: ss |
- * Size: 01 |
- * CRC: 2* f7 +--- repeat 9 times (8 in rare cases)
- * Gap2: 11* ff |
- * 6* 00 |
- * DAM: fb |
- * Content: 256* xx |
- * CRC: 2* f7 |
- * Gap3: 45* ff ---+
- * Lead-out: 231* ff
- *
- * --------------
- *
- * MFM track image
- *
- * Lead-in: 40* 4e
- * Pre-ID gap: 10* 00 ---+
- * Sync: 3* a1 |
- * IDAM: fe |
- * Track: tt |
- * Head: hh |
- * Sector: ss |
- * Size: 01 |
- * CRC: 2* f7 +--- repeat 18 times (16 in rare cases)
- * Gap2: 22* 4e |
- * 12* 00 |
- * Sync: 3* a1 |
- * DAM: fb |
- * Content: 256* xx |
- * CRC: 2* f7 |
- * Gap3: 24* 4e ---+
- * Lead-out: 712* 4e
- *
- * ------------------
- * The tracks are located on the image as follows (different to SDF!):
- *
- * head-track
- * 0-0
- * 0-1
- * 0-2
- * 0-3
- * ...
- * 0-39
- * 1-0
- * 1-1
- * 1-2
- * ...
- * 1-39
- * ----------------------------------------------------------------------- */
-
-#define TI99_FM 1
-#define TI99_MFM 2
-
-/* For the emulation of the clock pattern, we add a 9th bit. */
-#define TI99_DAM 0x1fb
-#define TI99_IDAM 0x1fe
-
-#define TI99_FM_DAM_OFFSET 24
-#define TI99_MFM_DAM_OFFSET 44
-
-#define TI99_FM_TRACK_ADD 247
-#define TI99_MFM_TRACK_ADD 752
-
-#define TI99_FM_TOTAL_SECTOR 334
-#define TI99_MFM_TOTAL_SECTOR 340
-
-/*
- Determine offset of the first IDAM. This is the base of the simulation
- of the clock bytes. We use a heuristic to guess where the track begins
- and simply check whether we can locate the first IDAM and DAM. Return
- value is the offset to the first IDAM.
-*/
-static floperr_t determine_offset(int format, UINT8 *track, int *offset)
-{
- floperr_t retval;
- int current_pos;
-
- if (format==TI99_FM)
- {
-// printf("Trying FM\n");
- // We are seeking the lead-in and pre-id gap from
- // position 0 to position 50. This is just to make sure that
- // if there are bad bytes at the beginning (original TI controller)
- // we will skip them.
- current_pos = find_block(track, 0, 50, 0x00, 22);
- if (current_pos==TI99DSK_BLOCKNOTFOUND)
- {
- LOG_FORMATS("Lead-in not found\n");
- retval = FLOPPY_ERROR_SEEKERROR;
- }
- else
- {
- current_pos += 22;
- if (track[current_pos]==0xfe /* IDAM */ &&
- track[current_pos+4]==0x01 /* sector length, always 256 for TI */ &&
- track[current_pos+24]==0xfb) /* DAM */
- {
- /* We're pretty sure this is the beginning. */
- *offset = current_pos;
- retval = FLOPPY_ERROR_SUCCESS;
- }
- else
- {
- LOG_FORMATS("IDAM or DAM not found\n");
- retval = FLOPPY_ERROR_SEEKERROR;
- }
- }
- }
- else
- {
- /* MFM */
-// printf("Trying MFM\n");
- int track_start = find_block(track, 0, 100, 0x4e, 40);
- if (track_start==TI99DSK_BLOCKNOTFOUND)
- {
- LOG_FORMATS("Lead-in not found\n");
- retval = FLOPPY_ERROR_SEEKERROR;
- }
- else
- {
- track_start += 40;
- current_pos = find_block(track, track_start, track_start+10, 0x00, 10);
- if (current_pos==TI99DSK_BLOCKNOTFOUND)
- {
- LOG_FORMATS("Pre-gap not found\n");
- retval = FLOPPY_ERROR_SEEKERROR;
- }
- else
- {
- current_pos += 10;
- if (track[current_pos] == 0xa1 /* First sync */ &&
- track[current_pos+3] == 0xfe /* IDAM */ &&
- track[current_pos+44] == 0xa1 /* First sync */ &&
- track[current_pos+47] == 0xfb) /* DAM */
- {
- /* We're pretty sure this is the beginning. */
- *offset = current_pos + 3;
- retval = FLOPPY_ERROR_SUCCESS;
- }
- else
- {
- LOG_FORMATS("Sync/IDAM/DAM not found\n");
- retval = FLOPPY_ERROR_SEEKERROR;
- }
- }
- }
- }
-/* printf("TDF offset = 0x%x\n", *offset); */
- return retval;
-}
-
-/*
- Gets a byte from the track. In this format we do not have a clock
- signal, so we will simulate it. Thus, this function returns a 9-bit
- value, with the first bit set as a marker for an address mark.
-
- This may be a little more complicated than necessary, but it correctly
- emulates the behavior of the controller (and it allows for an
- alternative format which actually supports clock and data).
-*/
-static int read_byte(int format, int first_idam, UINT8 *track, int position)
-{
- int totalseclen;
- int dam_offset;
- int byte;
-
- /* Check whether we are at any IDAM or DAM in this track. */
- if (format==TI99_FM)
- {
- totalseclen = TI99_FM_TOTAL_SECTOR;
- dam_offset = TI99_FM_DAM_OFFSET;
- }
- else
- {
- totalseclen = TI99_MFM_TOTAL_SECTOR;
- dam_offset = TI99_MFM_DAM_OFFSET;
- }
-
- int curpos = (position - first_idam) % totalseclen;
- if (curpos==0 && track[position]==0xfe)
- byte = TI99_IDAM;
- else
- {
- if (curpos==dam_offset && track[position]==0xfb)
- byte = TI99_DAM;
- else
- byte = track[position] & 0xff;
- }
- return byte;
-}
-
-/*
- Determine the position of this track in the image.
-*/
-static floperr_t ti99_tdf_get_offset(floppy_image_legacy *floppy, int head, int imgtrack, UINT64 *offset)
-{
- struct ti99dsk_tag *tag = (ti99dsk_tag*)floppy_tag(floppy);
-
- if ((head < 0) || (head >= tag->heads) || (imgtrack < 0) || (imgtrack >= tag->tracks))
- return FLOPPY_ERROR_SEEKERROR;
-
- // For head 0, tracks increase from 0 to tracks-1; then for head 1,
- // tracks also increase from 0 to tracks-1. */
- *offset = head * (tag->tracks * tag->track_size) + imgtrack * tag->track_size;
-
- return FLOPPY_ERROR_SUCCESS;
-}
-
-/*
- Reads a track. We just copy the contents from the format and recreate
- the CRC if it is the "blank" CRC as F7F7.
- This method assumes that the track division be done already.
-*/
-static floperr_t ti99_tdf_read_track_internal(floppy_image_legacy *floppy, int head, int imgtrack, UINT64 offset, void *buffer, size_t buflen)
-{
- floperr_t err;
- UINT64 track_offset;
- int first_idam = 0;
- struct ti99dsk_tag *tag = (ti99dsk_tag*)floppy_tag(floppy);
- int i, byte, crc;
-
- UINT8 *track_data = (UINT8*)buffer;
-
- err = ti99_tdf_get_offset(floppy, head, imgtrack, &track_offset);
- if (err)
- return err;
-
- floppy_image_read(floppy, buffer, track_offset, buflen);
-
- // Rebuild the CRCs. PC99 did not store the CRC but put
- // F7F7 in its place.
- // The first CRC is at position IDAM + 5
- // The second CRC is at position IDAM + 0x119 (FM) or +0x12d (MFM)
- // All this is repeated for each sector in the track
-
- if (determine_offset(tag->format, track_data, &first_idam)==FLOPPY_ERROR_SEEKERROR)
- return FLOPPY_ERROR_SEEKERROR;
-
- i = 0;
- while (i < buflen)
- {
- byte = read_byte(tag->format, first_idam, track_data, i);
- if (byte == TI99_IDAM)
- {
- // Do we have a valid CRCs already? Then this image
- // already contains proper CRCs handling. Do not recreate them.
- if (track_data[i+5] != 0xf7 || track_data[i+6] != 0xf7)
- return FLOPPY_ERROR_SUCCESS;
-
- crc = ccitt_crc16(0xffff, &track_data[i], 5);
- track_data[i+5] = (crc>>8) & 0xff;
- track_data[i+6] = (crc & 0xff);
- }
- else
- {
- if (byte == TI99_DAM)
- {
- crc = ccitt_crc16(0xffff, &track_data[i], SECTOR_SIZE+1);
- track_data[i+SECTOR_SIZE+1] = (crc>>8) & 0xff;
- track_data[i+SECTOR_SIZE+2] = (crc & 0xff);
- }
- }
- i++;
- }
-// dump_contents(track_data, buflen);
- return FLOPPY_ERROR_SUCCESS;
-}
-
-/*
- Reads a track. We just copy the contents from the format, without
- changes.
-*/
-static floperr_t ti99_tdf_read_track(floppy_image_legacy *floppy, int head, int track, UINT64 offset, void *buffer, size_t buflen)
-{
- int imgtrack = track;
-
- struct ti99dsk_tag *tag = (ti99dsk_tag*)floppy_tag(floppy);
- if (use_80_track_drives && tag->tracks<=40)
- {
- imgtrack = track / 2;
- }
- return ti99_tdf_read_track_internal(floppy, head, imgtrack, offset, buffer, buflen);
-}
-
-/*
- Writes a track.
-*/
-static floperr_t ti99_tdf_write_track(floppy_image_legacy *floppy, int head, int track, UINT64 offset, const void *buffer, size_t buflen)
-{
- floperr_t err;
- UINT64 track_offset;
- int imgtrack = track;
-
- struct ti99dsk_tag *tag = (ti99dsk_tag*)floppy_tag(floppy);
- if (use_80_track_drives && tag->tracks<=40)
- {
- imgtrack = track / 2;
- }
-
- err = ti99_tdf_get_offset(floppy, head, imgtrack, &track_offset);
- if (err)
- return err;
-
- // According to the TDF format, we don't need the CRC but replace it
- // with F7F7. For now we keep it and see whether PC99 can cope with
- // that. (Otherwise we would have to copy the const buffer). */
- floppy_image_write(floppy, buffer, offset + track_offset, buflen);
- return FLOPPY_ERROR_SUCCESS;
-}
-
-/*
-static floperr_t ti99_tdf_format_track(floppy_image_legacy *floppy, int head, int track, option_resolution *params)
-{
- int sectors;
- int sector_length;
- int interleave;
- int first_sector_id;
- sectors = option_resolution_lookup_int(params, PARAM_SECTORS);
- sector_length = option_resolution_lookup_int(params, PARAM_SECTOR_LENGTH);
- interleave = option_resolution_lookup_int(params, PARAM_INTERLEAVE);
- first_sector_id = option_resolution_lookup_int(params, PARAM_FIRST_SECTOR_ID);
- return FLOPPY_ERROR_SUCCESS;
-}
-*/
-
-/*
- Get a sector from a track. This function takes a complete track,
- searches for the sector, and passes a pointer to the sector contents
- back.
- As the original TI controller creates bad bytes at the start of a track
- we do *not* assume a simple layout. The strategy is to search the
- lead-in of the track, and from this offset, step through the track
- in search for the sector. Since we do not have index marks (we cannot
- distinguish them from ordinary data, as we do not store the clock), we
- do not attempt to detect IDAM or DAM.
-*/
-static floperr_t ti99_tdf_seek_sector_in_track(floppy_image_legacy *floppy, int head, int track, int sector, UINT8 *track_data, UINT8 **sector_data)
-{
- struct ti99dsk_tag *tag = (ti99dsk_tag*)floppy_tag(floppy);
-
- int byte;
- int state;
- enum { SEARCHIDAM, SEARCHDAM };
-
- state = SEARCHIDAM;
- if (tag->first_idam==0) /* should we check for every track? */
- {
- if (determine_offset(tag->format, track_data, &tag->first_idam)==FLOPPY_ERROR_SEEKERROR)
- {
- LOG_FORMATS("could not determine offset\n");
- return FLOPPY_ERROR_SEEKERROR;
- }
- }
-
- for (int i=0; i < tag->track_size; i++)
- {
- byte = read_byte(tag->format, tag->first_idam, track_data, i);
-
- switch (state)
- {
- case SEARCHIDAM:
- /* search for the IDAM */
- if (byte==TI99_IDAM)
- {
- if ((track_data[i+1]==track) && (track_data[i+2]==head) && (track_data[i+3]==sector))
- state = SEARCHDAM;
- else
- state = SEARCHIDAM;
- }
- break;
- case SEARCHDAM:
- if (byte==TI99_DAM)
- {
- *sector_data = &track_data[i+1];
- return FLOPPY_ERROR_SUCCESS;
- }
- break;
- }
- }
- LOG_FORMATS("Sector not found.\n");
- return FLOPPY_ERROR_SEEKERROR;
-}
-
-static floperr_t ti99_tdf_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
-{
- floperr_t err;
- UINT8 *sector_data;
- int imgtrack = track;
- struct ti99dsk_tag *tag = (ti99dsk_tag*)floppy_tag(floppy);
- dynamic_buffer track_data(tag->track_size);
-
- if (use_80_track_drives && tag->tracks<=40)
- {
- imgtrack = track / 2;
- }
-
- err = ti99_tdf_read_track_internal(floppy, head, imgtrack, 0, &track_data[0], tag->track_size);
- if (err)
- return err;
-
- err = ti99_tdf_seek_sector_in_track(floppy, head, imgtrack, sector, &track_data[0], &sector_data);
- if (err)
- return err;
- /* verify CRC? */
-
- memcpy(buffer, sector_data, SECTOR_SIZE);
- return FLOPPY_ERROR_SUCCESS;
-}
-
-/*
- Writes a sector into the track. Note that the indexed_write method
- may be used instead of this method, according to the implementation
- of flopimg/flopdrv.
-*/
-static floperr_t ti99_tdf_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
-{
- floperr_t err;
- UINT8 *sector_data;
- UINT8 *track_data;
- UINT64 track_offset;
- int imgtrack = track;
- UINT64 offset;
- UINT8 crc_field[2];
- int crc;
-
- struct ti99dsk_tag *tag = (ti99dsk_tag*)floppy_tag(floppy);
-
- track_data = (UINT8*)malloc(tag->track_size);
- if (use_80_track_drives && tag->tracks<=40)
- {
- imgtrack = track / 2;
- }
-
- err = ti99_tdf_read_track_internal(floppy, head, imgtrack, 0, track_data, tag->track_size);
- if (err)
- return err;
- err = ti99_tdf_seek_sector_in_track(floppy, head, imgtrack, sector, track_data, &sector_data);
- if (err)
- return err;
-
- err = ti99_tdf_get_offset(floppy, head, imgtrack, &track_offset);
- if (err)
- return err;
-
- offset = track_offset + (sector_data - track_data);
-
- floppy_image_write(floppy, buffer, offset, SECTOR_SIZE);
-
- // Recalculate CRC. We init the CRC with bf84 (DAM fb is
- // already included; would be ffff without)
- crc = ccitt_crc16(0xbf84, (UINT8*)buffer, SECTOR_SIZE);
- crc_field[0] = (crc>>8) & 0xff;
- crc_field[1] = (crc & 0xff);
- floppy_image_write(floppy, crc_field, offset+SECTOR_SIZE, 2);
-
- return FLOPPY_ERROR_SUCCESS;
-}
-
-static floperr_t ti99_tdf_write_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector_index, const void *buffer, size_t buflen, int ddam)
-{
- /* Read track, head */
- int byte;
- struct ti99dsk_tag *tag = (ti99dsk_tag*)floppy_tag(floppy);
- dynamic_buffer track_data(tag->track_size);
- UINT8 *sector_data;
- UINT64 track_offset;
- UINT64 offset;
- UINT8 crc_field[2];
-
- int crc;
- int imgtrack = track;
-
- int i;
- floperr_t err;
-
- if (use_80_track_drives && tag->tracks<=40)
- {
- imgtrack = track / 2;
- }
-
- err = ti99_tdf_read_track_internal(floppy, head, imgtrack, 0, &track_data[0], tag->track_size);
- if (err)
- {
- return err;
- }
-
- /* Search for the sector_index-th sector. */
- if (tag->first_idam==0) /* should we check for every track? */
- {
- if (determine_offset(tag->format, &track_data[0], &tag->first_idam)==FLOPPY_ERROR_SEEKERROR)
- {
- return FLOPPY_ERROR_SEEKERROR;
- }
- }
-
- /* Search for the IDAM of the n-th sector */
- i=0;
- while (i < tag->track_size && sector_index>=0)
- {
- byte = read_byte(tag->format, tag->first_idam, &track_data[0], i);
- if (byte == TI99_IDAM)
- {
- sector_index--;
- }
- i++;
- }
- i--;
-
- /* Not that many sectors in this track? */
- if (sector_index>0)
- {
- return FLOPPY_ERROR_SEEKERROR;
- }
-
- /* Find the DAM. */
- while (i < tag->track_size)
- {
- byte = read_byte(tag->format, tag->first_idam, &track_data[0], i);
- if (byte == TI99_DAM)
- break;
- else
- i++;
- }
-
- /* There was no DAM. Image seems to be broken. */
- if (i == tag->track_size)
- {
- return FLOPPY_ERROR_SEEKERROR;
- }
-
- /* Sector data is right after the DAM. */
- sector_data = &track_data[i+1];
-
- /* Get the position of the track in the image. */
- err = ti99_tdf_get_offset(floppy, head, imgtrack, &track_offset);
- if (err)
- return err;
-
- offset = track_offset + (sector_data - &track_data[0]);
-
- /* Write the sector data at that position. */
- floppy_image_write(floppy, buffer, offset, SECTOR_SIZE);
-
- // Recalculate CRC. We init the CRC with bf84 (DAM fb is
- // already included; would be ffff without)
- crc = ccitt_crc16(0xbf84, (UINT8*)buffer, SECTOR_SIZE);
- crc_field[0] = (crc>>8) & 0xff;
- crc_field[1] = (crc & 0xff);
- floppy_image_write(floppy, crc_field, offset+SECTOR_SIZE, 2);
-
- return FLOPPY_ERROR_SUCCESS;
-}
-
-
-static floperr_t ti99_tdf_find_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, void *buffer, unsigned long *flags)
-{
- /* Read track, head */
- int byte = 0;
- struct ti99dsk_tag *tag = (ti99dsk_tag*)floppy_tag(floppy);
- dynamic_buffer track_data(tag->track_size);
- int imgtrack = track;
- int i;
- floperr_t err;
- floperr_t retval;
-
- if (use_80_track_drives && tag->tracks<=40)
- {
- imgtrack = track / 2;
- }
-
- err = ti99_tdf_read_track_internal(floppy, head, imgtrack, 0, &track_data[0], tag->track_size);
- if (err)
- {
- return err;
- }
-
- /* Search for the sector_index-th sector. */
-
- if (tag->first_idam==0) /* should we check for every track? */
- {
- if (determine_offset(tag->format, &track_data[0], &tag->first_idam)==FLOPPY_ERROR_SEEKERROR)
- {
- return FLOPPY_ERROR_SEEKERROR;
- }
- }
-
- i=0;
- sector_index = sector_index+1;
- while (i++ < tag->track_size && sector_index>0)
- {
- byte = read_byte(tag->format, tag->first_idam, &track_data[0], i);
- if (byte == TI99_IDAM)
- {
- sector_index--;
- }
- }
-
- retval = FLOPPY_ERROR_SEEKERROR;
- if (sector_index==0)
- {
- /* If desired, return the ID field */
- if (cylinder)
- {
- *cylinder = track_data[i];
- // printf("cylinder=%d", *cylinder);
-
- }
- if (side)
- {
- *side = track_data[i+1];
- // printf(", side=%d", *side);
- }
- if (sector)
- {
- *sector = track_data[i+2];
- // printf(", sector=%d", *sector);
- }
- if (sector_length)
- {
- *sector_length = 128 << track_data[i+3];
- // printf(", sector_length=%d\n", *sector_length);
- }
- if (flags)
- {
- *flags = 0;
- }
- retval = FLOPPY_ERROR_SUCCESS;
-
- /* If desired, return the sector contents. */
- if (buffer)
- {
- while (i++ < tag->track_size)
- {
- byte = read_byte(tag->format, tag->first_idam, &track_data[0], i);
- if (byte == TI99_DAM)
- break;
- }
- if (byte == TI99_DAM)
- {
- memcpy(buffer, &track_data[i+1], SECTOR_SIZE);
- }
- else
- {
- retval = FLOPPY_ERROR_SEEKERROR;
- }
- }
- }
- return retval;
-}
-
-/*
- Required for ReadAddress command. This function gets the 1st, 2nd, 3rd,
- sector (and so on) from the track, not sector 1, 2, 3. That is, the
- returned sector info depends on the interleave and the start sector.
-*/
-static floperr_t ti99_tdf_get_indexed_sector_info(floppy_image_legacy *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags)
-{
- return ti99_tdf_find_indexed_sector(floppy, head, track, sector_index, cylinder, side, sector, sector_length, NULL, flags);
-}
-
-static floperr_t ti99_tdf_read_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
-{
- return ti99_tdf_find_indexed_sector(floppy, head, track, sector, (int*)NULL, (int*)NULL, (int*)NULL, (UINT32*)NULL, buffer, (unsigned long*)NULL);
-}
-
-
-/*
- Guess the geometry of the disk.
- 1. Check whether the disk is formatted, and if so, whether it is
- a FM or a MFM disk
- 2. If this fails, guess from the file size which format it should have
-
- SDF formats have sizes which are multiples of 10KiB.
- TDF: full sector size FM (MFM) = 334 (340) bytes
- additional track data FM (MFM) = 247 (752) bytes
-
- => check whether size is dividable by 40 (or 35) and by 2
- => get track size
- => subtract track data
- => divide by 334 or 340
- => number of sectors should be 8, 9, 16, 18, 32, or 36
-
- SSDD is 274880, but DSSD is 260240, so they differ (unlike in the SDF format)
- Still, we cannot tell apart single-sided 80 track formats from double-sided
- 40 tracks. We assume the latter. Moreover, we only attempt to detect
- 9/18/36 sectors (no 8/16) and 40 tracks (no 35).
-
- SSSD40 = 130120
- DSSD = 260240
- SSDD = 274880
- DSDD = 549760
- DSHD = 1039360
- DSDD80 = 1099520
- DSHD80 = 2078720
-*/
-static int ti99_tdf_guess_geometry(floppy_image_legacy *floppy, UINT64 size,
- struct ti99dsk_geometry *geometry)
-{
- int idamcnt, state, track, head, i, totalseclen = 0, format = 0, byte, tracklength, trackadd = 0;
- int first_idam = 0;
- /* Allocate enough bytes to hold the longest supported track. */
- dynamic_buffer track_data(13000);
- /*int offset;*/
-
- struct ti99dsk_geometry dummy_geometry;
-
- if (geometry)
- memset(geometry, 0, sizeof(*geometry));
- else
- geometry = &dummy_geometry;
-
- floppy_image_read(floppy, &track_data[0], 0, 13000);
-
- if (determine_offset(TI99_MFM, &track_data[0], &first_idam)==FLOPPY_ERROR_SEEKERROR)
- {
- /* MFM failed. */
- if (determine_offset(TI99_FM, &track_data[0], &first_idam)==FLOPPY_ERROR_SEEKERROR)
- {
- LOG_FORMATS("IDAM not found. Unformatted disk.\n");
-
- // FM failed as well. Disk is not formatted. We assume
- // a format that fits into the space provided by the file.
- // We only give a moderate vote in this case, so SDF
- // make take it.
-
- if (size < 130120 || size > 2078720)
- {
- LOG_FORMATS("Unknown format size: %d\n", (int)size);
- return 0;
- }
- if (size >= 130120 && size < 260240)
- {
- /* SSSD */
- geometry->sides = 1;
- geometry->tracksperside = 40;
- geometry->secspertrack = 9;
- geometry->density = 1;
- return 50;
- }
- if (size >= 260240 && size < 274880)
- {
- /* DSSD */
- geometry->sides = 2;
- geometry->tracksperside = 40;
- geometry->secspertrack = 9;
- geometry->density = 1;
- return 50;
- }
- if (size >= 274880 && size < 549760)
- {
- /* SSDD */
- geometry->sides = 1;
- geometry->tracksperside = 40;
- geometry->secspertrack = 18;
- geometry->density = 2;
- return 50;
- }
- if (size >= 549760 && size < 1039360)
- {
- /* DSDD */
- geometry->sides = 2;
- geometry->tracksperside = 40;
- geometry->secspertrack = 18;
- geometry->density = 2;
- return 50;
- }
- if (size >= 1039360 && size < 1099520)
- {
- /* DSHD */
- geometry->sides = 2;
- geometry->tracksperside = 40;
- geometry->secspertrack = 36;
- geometry->density = 2;
- return 50;
- }
- if (size >= 1099520 && size < 2078720)
- {
- /* DSDD80 */
- geometry->sides = 2;
- geometry->tracksperside = 80;
- geometry->secspertrack = 18;
- geometry->density = 2;
- return 50;
- }
- if (size == 2078720)
- {
- /* DSHD80 */
- geometry->sides = 2;
- geometry->tracksperside = 80;
- geometry->secspertrack = 36;
- geometry->density = 2;
- return 50;
- }
- }
- else
- {
- /* FM format */
- totalseclen = TI99_FM_TOTAL_SECTOR;
- trackadd = TI99_FM_TRACK_ADD; /* additional track data (gaps etc.) */
- geometry->density = 1;
- format = TI99_FM;
- }
- }
- else
- {
- /* MFM format */
- totalseclen = TI99_MFM_TOTAL_SECTOR;
- trackadd = TI99_MFM_TRACK_ADD;
- geometry->density = 2;
- format = TI99_MFM;
- }
-
- /* Count the number of IDAMs on track 0, head 0 */
- idamcnt = 0;
- state = 0;
- track = 0;
- head = 0;
- i=0;
-
- while (i++ < 13000 && head == 0 && track == 0)
- {
- byte = read_byte(format, first_idam, &track_data[0], i);
- switch (state)
- {
- case 0:
- if (byte==TI99_IDAM)
- state = 1;
- break;
- case 1:
- track = byte;
- state = 2;
- break;
- case 2:
- head = byte;
- state = 3;
- break;
- case 3:
- idamcnt++;
- state = 0;
- }
- }
- LOG_FORMATS("Determined %d sectors\n", idamcnt);
-
- // Now calculate the geometry
- // The track size, in theory, may change due to reformatting,
- // and it may also vary between tracks, but the TDF does not support
- // varying track lengths. So every track has the same length as track 0.
- // Also, we don't yet know whether the drive and the disk have the
- // same track count. For 80 track drives and 40 track disks, we need
- // double-stepping; this will be known as soon as the controller is
- // initialized; we need to check that in the access methods.
-
- tracklength = idamcnt * totalseclen + trackadd;
- /*offset = 0;*/
-
- // Read the last track. We assume that all tracks are properly
- // formatted; otherwise, the above calculations would already fail.
- // That is, the last track in the image tells us whether it is for
- // head 0 or for head 1.
-
- geometry->sides = 1;
- floppy_image_read(floppy, &track_data[0], size-tracklength, tracklength);
- if (determine_offset(format, &track_data[0], &first_idam)==FLOPPY_ERROR_SEEKERROR)
- {
- /* error ... what now? */
- LOG_FORMATS("Error when reading last track. Image broken.\n");
- return 50;
- }
- else
- {
- if (track_data[first_idam+2]==0)
- {
- geometry->sides = 1;
- }
- else
- {
- if (track_data[first_idam+2]==1)
- {
- geometry->sides = 2;
- }
- else
- {
- LOG_FORMATS("Error: Last track has invalid first IDAM: head = %d.\n", track_data[first_idam+2]);
- }
-
- }
- }
-
-
- geometry->tracksperside = (size / tracklength) / geometry->sides;
- geometry->secspertrack = idamcnt;
-
- if (geometry->tracksperside < 35 || geometry->tracksperside > 80)
- {
- LOG_FORMATS("Unsupported track count: %d\n", geometry->tracksperside);
- return 0;
- }
-
- return 100;
-}
-
-static FLOPPY_IDENTIFY(ti99_tdf_identify)
-{
- UINT64 size;
- size = floppy_image_size(floppy);
- *vote = ti99_tdf_guess_geometry(floppy, size, NULL);
- LOG_FORMATS("TDF voting %d\n", *vote);
- return FLOPPY_ERROR_SUCCESS;
-}
-
-static FLOPPY_CONSTRUCT(ti99_tdf_construct)
-{
- struct ti99dsk_geometry geometry;
- struct FloppyCallbacks *callbacks;
- struct ti99dsk_tag *tag;
- LOG_FORMATS("Reading image as TDF\n");
- if (params)
- {
- /* create */
- memset(&geometry, 0, sizeof(geometry));
-/*
- geometry.sides = option_resolution_lookup_int(params, PARAM_HEADS);
- geometry.tracksperside = option_resolution_lookup_int(params, PARAM_TRACKS);
- geometry.secspertrack = option_resolution_lookup_int(params, PARAM_SECTORS);
-*/
- }
- else
- {
- /* load */
- if (ti99_tdf_guess_geometry(floppy, floppy_image_size(floppy), &geometry)<50)
- return FLOPPY_ERROR_INVALIDIMAGE;
- }
-
- assert(geometry.sides);
- assert(geometry.tracksperside);
- assert(geometry.secspertrack);
-
- tag = (struct ti99dsk_tag *) floppy_create_tag(floppy, sizeof(struct ti99dsk_tag));
-
- tag->heads = geometry.sides;
- tag->tracks = geometry.tracksperside;
-
- if (geometry.density==TI99_FM)
- tag->track_size = geometry.secspertrack * TI99_FM_TOTAL_SECTOR + TI99_FM_TRACK_ADD;
- else
- tag->track_size = geometry.secspertrack * TI99_MFM_TOTAL_SECTOR + TI99_MFM_TRACK_ADD;
-
- tag->format = geometry.density;
- tag->first_idam = 0; /* let's find out later */
- tag->dam_offset = 0;
-
- /* set up format callbacks */
- callbacks = floppy_callbacks(floppy);
- callbacks->read_sector = ti99_tdf_read_sector;
- callbacks->write_sector = ti99_tdf_write_sector;
- callbacks->read_indexed_sector = ti99_tdf_read_indexed_sector;
- callbacks->write_indexed_sector = ti99_tdf_write_indexed_sector;
- callbacks->read_track = ti99_tdf_read_track;
- callbacks->write_track = ti99_tdf_write_track;
-/* callbacks->format_track = ti99_tdf_format_track; */
- callbacks->get_track_size = ti99_get_track_size;
- /* post format unset */
- callbacks->get_heads_per_disk = ti99_get_heads_per_disk;
- callbacks->get_tracks_per_disk = ti99_get_tracks_per_disk;
- callbacks->get_sector_length = ti99_get_sector_length;
- callbacks->get_indexed_sector_info = ti99_tdf_get_indexed_sector_info;
-
- return FLOPPY_ERROR_SUCCESS;
-}
-
-/* ----------------------------------------------------------------------- */
-
-LEGACY_FLOPPY_OPTIONS_START( ti99 )
- LEGACY_FLOPPY_OPTION( ti99_sdf, "dsk", "TI99 sector dump (v9t9)", ti99_sdf_identify, ti99_sdf_construct, NULL,
- HEADS([1]-2)
- TRACKS(35-[40]-80)
- SECTORS(8/9/16/[18]/36)
- SECTOR_LENGTH([256])
- FIRST_SECTOR_ID(0))
- LEGACY_FLOPPY_OPTION( ti99_tdf, "dsk,dtk", "TI99 track dump (pc99)", ti99_tdf_identify, ti99_tdf_construct, NULL,
- TRACKS(35-[40]-80)
- SECTORS(8/9/16/[18]/36)
- SECTOR_LENGTH([256])
- FIRST_SECTOR_ID(0))
-LEGACY_FLOPPY_OPTIONS_END
diff --git a/src/lib/formats/ti99_dsk.h b/src/lib/formats/ti99_dsk.h
index 28cae3e2edf..a61d3da1a69 100644
--- a/src/lib/formats/ti99_dsk.h
+++ b/src/lib/formats/ti99_dsk.h
@@ -47,7 +47,7 @@ protected:
};
/*
- Modern implementation of the sector dump format.
+ Implementation of the sector dump format.
*/
class ti99_sdf_format : public ti99_floppy_format
{
@@ -86,7 +86,7 @@ private:
extern const floppy_format_type FLOPPY_TI99_SDF_FORMAT;
/*
- Modern implementation of the track dump format.
+ Implementation of the track dump format.
*/
class ti99_tdf_format : public ti99_floppy_format
{
@@ -108,12 +108,4 @@ private:
extern const floppy_format_type FLOPPY_TI99_TDF_FORMAT;
-// ========================================================================
-/*
- Legacy implementation.
-*/
-
-LEGACY_FLOPPY_OPTIONS_EXTERN(ti99);
-void ti99_set_80_track_drives(int use80);
-
#endif /* TI99_DSK_H */
diff --git a/src/lib/formats/trs80_dsk.c b/src/lib/formats/trs80_dsk.c
new file mode 100644
index 00000000000..4a0a2bf5e49
--- /dev/null
+++ b/src/lib/formats/trs80_dsk.c
@@ -0,0 +1,55 @@
+// license:GPL-2.0+
+// copyright-holders:Dirk Best
+/***************************************************************************
+
+ TRS-80
+
+ JV1 disk image format
+
+ Used by Jeff Vavasour's TRS-80 Emulators
+
+ TODO:
+ - Gap sizes unverified
+
+***************************************************************************/
+
+#include "trs80_dsk.h"
+
+trs80_format::trs80_format() : wd177x_format(formats)
+{
+}
+
+const char *trs80_format::name() const
+{
+ return "trs80";
+}
+
+const char *trs80_format::description() const
+{
+ return "TRS-80 JV1 disk image";
+}
+
+const char *trs80_format::extensions() const
+{
+ return "dsk";
+}
+
+int trs80_format::get_track_dam_fm(const format &f, int head, int track)
+{
+ return (track == 17 && head == 0) ? FM_DDAM : FM_DAM;
+}
+
+const trs80_format::format trs80_format::formats[] =
+{
+ {
+ floppy_image::FF_525, floppy_image::SSSD, floppy_image::FM,
+ 4000, 10, 35, 1, 256, {}, 0, {}, 14, 11, 12
+ },
+ {
+ floppy_image::FF_525, floppy_image::SSSD, floppy_image::FM,
+ 4000, 10, 40, 1, 256, {}, 0, {}, 14, 11, 12
+ },
+ {}
+};
+
+const floppy_format_type FLOPPY_TRS80_FORMAT = &floppy_image_format_creator<trs80_format>;
diff --git a/src/lib/formats/trs80_dsk.h b/src/lib/formats/trs80_dsk.h
new file mode 100644
index 00000000000..988d7ee2a7d
--- /dev/null
+++ b/src/lib/formats/trs80_dsk.h
@@ -0,0 +1,36 @@
+// license:GPL-2.0+
+// copyright-holders:Dirk Best
+/***************************************************************************
+
+ TRS-80
+
+ JV1 disk image format
+
+***************************************************************************/
+
+#pragma once
+
+#ifndef __TRS80_DSK_H__
+#define __TRS80_DSK_H__
+
+#include "wd177x_dsk.h"
+
+class trs80_format : public wd177x_format
+{
+public:
+ trs80_format();
+
+ virtual const char *name() const;
+ virtual const char *description() const;
+ virtual const char *extensions() const;
+
+protected:
+ virtual int get_track_dam_fm(const format &f, int head, int track);
+
+private:
+ static const format formats[];
+};
+
+extern const floppy_format_type FLOPPY_TRS80_FORMAT;
+
+#endif // __TRS80_DSK_H__
diff --git a/src/lib/formats/trs_dsk.c b/src/lib/formats/trs_dsk.c
deleted file mode 100644
index 2bb87173167..00000000000
--- a/src/lib/formats/trs_dsk.c
+++ /dev/null
@@ -1,80 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Nathan Woods
-#include <string.h>
-#include <assert.h>
-#include "trs_dsk.h"
-#include "basicdsk.h"
-#include "coco_dsk.h"
-
-/* -----------------------------------------------------------------------
- * JV1 (Jeff Vavasour 1) format
- *
- * Used by Jeff Vavasour's TRS-80 Emulators
- *
- * Very straight basic disk; 1 head, 10 sectors, 256 sector length
- * ----------------------------------------------------------------------- */
-
-#define TRS80_JV1_HEADS 1
-#define TRS80_JV1_SECTORS 10
-#define TRS80_JV1_SECTORLENGTH 256
-#define TRS80_JV1_FIRSTSECTORID 0
-
-static FLOPPY_IDENTIFY( trs80_jv1_identify )
-{
- UINT64 size;
- size = floppy_image_size(floppy);
- *vote = (size % (TRS80_JV1_HEADS * TRS80_JV1_SECTORS * TRS80_JV1_SECTORLENGTH))
- ? 0 : 100;
- return FLOPPY_ERROR_SUCCESS;
-}
-
-
-static UINT64 trs80_jv1_get_ddam(floppy_image_legacy *floppy, const struct basicdsk_geometry *geom, int track, int head, int sector)
-{
- // directory track is protected
- if ((track==17) && (head==0)) {
- return ID_FLAG_DELETED_DATA;
- }
- return 0;
-}
-
-static FLOPPY_CONSTRUCT( trs80_jv1_construct )
-{
- struct basicdsk_geometry geometry;
-
- memset(&geometry, 0, sizeof(geometry));
- geometry.heads = TRS80_JV1_HEADS;
- geometry.sectors = TRS80_JV1_SECTORS;
- geometry.first_sector_id = TRS80_JV1_FIRSTSECTORID;
- geometry.sector_length = TRS80_JV1_SECTORLENGTH;
- geometry.get_ddam = trs80_jv1_get_ddam;
-
- if (params)
- {
- /* create */
- geometry.tracks = option_resolution_lookup_int(params, PARAM_TRACKS);
- }
- else
- {
- /* load */
- geometry.tracks = (int) (floppy_image_size(floppy) / geometry.heads
- / geometry.sectors / geometry.sector_length);
- }
- return basicdsk_construct(floppy, &geometry);
-}
-
-
-
-/* ----------------------------------------------------------------------- */
-
-LEGACY_FLOPPY_OPTIONS_START( trs80 )
- LEGACY_FLOPPY_OPTION( trs80_jv1, "dsk", "TRS-80 JV1 disk image", trs80_jv1_identify, trs80_jv1_construct, NULL,
- TRACKS([35]-255))
- LEGACY_FLOPPY_OPTION( trs80_dmk, "dsk,dmk", "TRS-80 DMK disk image", coco_dmk_identify, coco_dmk_construct, NULL,
- HEADS([1]-2)
- TRACKS([35]-255)
- SECTORS(1-[10]-18)
- SECTOR_LENGTH(128/[256]/512/1024/2048/4096/8192)
- INTERLEAVE(0-[6]-17)
- FIRST_SECTOR_ID([0]-1))
-LEGACY_FLOPPY_OPTIONS_END
diff --git a/src/lib/formats/trs_dsk.h b/src/lib/formats/trs_dsk.h
deleted file mode 100644
index a33cec6872b..00000000000
--- a/src/lib/formats/trs_dsk.h
+++ /dev/null
@@ -1,20 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Nathan Woods
-/*********************************************************************
-
- formats/trs_dsk.h
-
- TRS-80 disk images
-
-*********************************************************************/
-
-#ifndef TRS_DSK_H
-#define TRS_DSK_H
-
-#include "flopimg.h"
-
-/**************************************************************************/
-
-LEGACY_FLOPPY_OPTIONS_EXTERN( trs80 );
-
-#endif /* TRS_DSK_H */
diff --git a/src/lib/formats/vdk_dsk.c b/src/lib/formats/vdk_dsk.c
new file mode 100644
index 00000000000..896815c26ad
--- /dev/null
+++ b/src/lib/formats/vdk_dsk.c
@@ -0,0 +1,143 @@
+// license:GPL-2.0+
+// copyright-holders:Dirk Best
+/***************************************************************************
+
+ VDK
+
+ Disk image format
+
+ Used by Paul Burgin's PC-Dragon emulator
+
+***************************************************************************/
+
+#include "emu.h"
+#include "vdk_dsk.h"
+
+vdk_format::vdk_format()
+{
+}
+
+const char *vdk_format::name() const
+{
+ return "vdk";
+}
+
+const char *vdk_format::description() const
+{
+ return "VDK disk image";
+}
+
+const char *vdk_format::extensions() const
+{
+ return "vdk";
+}
+
+int vdk_format::identify(io_generic *io, UINT32 form_factor)
+{
+ UINT8 id[2];
+ io_generic_read(io, id, 0, 2);
+
+ if (id[0] == 'd' && id[1] == 'k')
+ return 50;
+ else
+ return 0;
+}
+
+bool vdk_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
+{
+ UINT8 header[0x100];
+ io_generic_read(io, header, 0, 0x100);
+
+ int header_size = header[3] * 0x100 + header[2];
+ int track_count = header[8];
+ int head_count = header[9];
+
+ int file_offset = header_size;
+
+ for (int track = 0; track < track_count; track++)
+ {
+ for (int head = 0; head < head_count ; head++)
+ {
+ desc_pc_sector sectors[SECTOR_COUNT];
+ UINT8 sector_data[SECTOR_COUNT * SECTOR_SIZE];
+ int sector_offset = 0;
+
+ for (int i = 0; i < SECTOR_COUNT; i++)
+ {
+ sectors[i].track = track;
+ sectors[i].head = head;
+ sectors[i].sector = FIRST_SECTOR_ID + i;
+ sectors[i].actual_size = SECTOR_SIZE;
+ sectors[i].size = SECTOR_SIZE >> 8;
+ sectors[i].deleted = false;
+ sectors[i].bad_crc = false;
+ sectors[i].data = &sector_data[sector_offset];
+
+ io_generic_read(io, sectors[i].data, file_offset, SECTOR_SIZE);
+
+ sector_offset += SECTOR_SIZE;
+ file_offset += SECTOR_SIZE;
+ }
+
+ build_wd_track_mfm(track, head, image, 100000, SECTOR_COUNT, sectors, 22, 32, 24);
+ }
+ }
+
+ return true;
+}
+
+bool vdk_format::save(io_generic *io, floppy_image *image)
+{
+ UINT8 bitstream[500000/8];
+ UINT8 sector_data[50000];
+ desc_xs sectors[256];
+ UINT64 file_offset = 0;
+
+ int track_count, head_count;
+ image->get_actual_geometry(track_count, head_count);
+
+ // write header
+ UINT8 header[12];
+
+ header[0] = 'd';
+ header[1] = 'k';
+ header[2] = sizeof(header) % 0x100;
+ header[3] = sizeof(header) / 0x100;
+ header[4] = 0x10;
+ header[5] = 0x10;
+ header[6] = 'M';
+ header[7] = 0x01;
+ header[8] = track_count;
+ header[9] = head_count;
+ header[10] = 0;
+ header[11] = 0;
+
+ io_generic_write(io, header, file_offset, sizeof(header));
+ file_offset += sizeof(header);
+
+ // write disk data
+ for (int track = 0; track < track_count; track++)
+ {
+ for (int head = 0; head < head_count; head++)
+ {
+ int track_size;
+ generate_bitstream_from_track(track, head, 2000, bitstream, track_size, image);
+ extract_sectors_from_bitstream_mfm_pc(bitstream, track_size, sectors, sector_data, sizeof(sector_data));
+
+ for (int i = 0; i < SECTOR_COUNT; i++)
+ {
+ io_generic_write(io, sectors[FIRST_SECTOR_ID + i].data, file_offset, SECTOR_SIZE);
+ file_offset += SECTOR_SIZE;
+ }
+ }
+ }
+
+ return true;
+}
+
+bool vdk_format::supports_save() const
+{
+ return true;
+}
+
+const floppy_format_type FLOPPY_VDK_FORMAT = &floppy_image_format_creator<vdk_format>;
diff --git a/src/lib/formats/vdk_dsk.h b/src/lib/formats/vdk_dsk.h
new file mode 100644
index 00000000000..5570c14eab8
--- /dev/null
+++ b/src/lib/formats/vdk_dsk.h
@@ -0,0 +1,42 @@
+// license:GPL-2.0+
+// copyright-holders:Dirk Best
+/***************************************************************************
+
+ VDK
+
+ Disk image format
+
+ Used by Paul Burgin's PC-Dragon emulator
+
+***************************************************************************/
+
+#pragma once
+
+#ifndef __VDK_DSK_H__
+#define __VDK_DSK_H__
+
+#include "flopimg.h"
+
+class vdk_format : public floppy_image_format_t
+{
+public:
+ vdk_format();
+
+ virtual const char *name() const;
+ virtual const char *description() const;
+ virtual const char *extensions() const;
+
+ virtual int identify(io_generic *io, UINT32 form_factor);
+ virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image);
+ virtual bool save(io_generic *io, floppy_image *image);
+ virtual bool supports_save() const;
+
+private:
+ static const int SECTOR_SIZE = 256;
+ static const int SECTOR_COUNT = 18;
+ static const int FIRST_SECTOR_ID = 1;
+};
+
+extern const floppy_format_type FLOPPY_VDK_FORMAT;
+
+#endif // __VDK_DSK_H__
diff --git a/src/lib/formats/vector06_dsk.c b/src/lib/formats/vector06_dsk.c
new file mode 100644
index 00000000000..b423f4b7154
--- /dev/null
+++ b/src/lib/formats/vector06_dsk.c
@@ -0,0 +1,44 @@
+// license:GPL-2.0+
+// copyright-holders:Dirk Best
+/***************************************************************************
+
+ Vector 06
+
+ Disk image format
+
+ TODO:
+ - Gap sizes
+
+***************************************************************************/
+
+#include "vector06_dsk.h"
+
+vector06_format::vector06_format() : wd177x_format(formats)
+{
+}
+
+const char *vector06_format::name() const
+{
+ return "vector06";
+}
+
+const char *vector06_format::description() const
+{
+ return "Vector 06 disk image";
+}
+
+const char *vector06_format::extensions() const
+{
+ return "fdd";
+}
+
+const vector06_format::format vector06_format::formats[] =
+{
+ {
+ floppy_image::FF_525, floppy_image::DSQD, floppy_image::MFM,
+ 2000, 5, 82, 2, 1024, {}, 1, {}, 80, 22, 24
+ },
+ {}
+};
+
+const floppy_format_type FLOPPY_VECTOR06_FORMAT = &floppy_image_format_creator<vector06_format>;
diff --git a/src/lib/formats/vector06_dsk.h b/src/lib/formats/vector06_dsk.h
new file mode 100644
index 00000000000..cad2fa3ddf3
--- /dev/null
+++ b/src/lib/formats/vector06_dsk.h
@@ -0,0 +1,33 @@
+// license:GPL-2.0+
+// copyright-holders:Dirk Best
+/***************************************************************************
+
+ Vector 06
+
+ Disk image format
+
+***************************************************************************/
+
+#pragma once
+
+#ifndef __VECTOR06_DSK_H__
+#define __VECTOR06_DSK_H__
+
+#include "wd177x_dsk.h"
+
+class vector06_format : public wd177x_format
+{
+public:
+ vector06_format();
+
+ virtual const char *name() const;
+ virtual const char *description() const;
+ virtual const char *extensions() const;
+
+private:
+ static const format formats[];
+};
+
+extern const floppy_format_type FLOPPY_VECTOR06_FORMAT;
+
+#endif // __VECTOR06_DSK_H__
diff --git a/src/lib/formats/vtech1_dsk.c b/src/lib/formats/vtech1_dsk.c
deleted file mode 100644
index c0771ea7227..00000000000
--- a/src/lib/formats/vtech1_dsk.c
+++ /dev/null
@@ -1,41 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Miodrag Milanovic
-/*********************************************************************
-
- formats/vtech1_dsk.c
-
- VTech1 disk images
-
-*********************************************************************/
-
-#include <assert.h>
-
-#include "formats/vtech1_dsk.h"
-
-static FLOPPY_IDENTIFY( vtech1_dsk_identify )
-{
- *vote = 100;
- return FLOPPY_ERROR_SUCCESS;
-}
-
-
-static FLOPPY_CONSTRUCT( vtech1_dsk_construct )
-{
- return FLOPPY_ERROR_SUCCESS;
-}
-
-LEGACY_FLOPPY_OPTIONS_START( vtech1_only )
- LEGACY_FLOPPY_OPTION(
- vtech1_dsk,
- "dsk",
- "Laser floppy disk image",
- vtech1_dsk_identify,
- vtech1_dsk_construct,
- NULL,
- HEADS([1])
- TRACKS([40])
- SECTORS([16])
- SECTOR_LENGTH([154])
- FIRST_SECTOR_ID([0])
- )
-LEGACY_FLOPPY_OPTIONS_END0
diff --git a/src/lib/formats/vtech1_dsk.h b/src/lib/formats/vtech1_dsk.h
deleted file mode 100644
index 338faf452e3..00000000000
--- a/src/lib/formats/vtech1_dsk.h
+++ /dev/null
@@ -1,18 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Miodrag Milanovic
-/*********************************************************************
-
- formats/vtech1_dsk.h
-
- VTech1 disk images
-
-*********************************************************************/
-
-#ifndef VTECH1_DSK_H
-#define VTECH1_DSK_H
-
-#include "flopimg.h"
-
-LEGACY_FLOPPY_OPTIONS_EXTERN(vtech1_only);
-
-#endif /* VTECH1_DSK_H */
diff --git a/src/lib/formats/wd177x_dsk.c b/src/lib/formats/wd177x_dsk.c
index da0ab9e7130..69458af0335 100644
--- a/src/lib/formats/wd177x_dsk.c
+++ b/src/lib/formats/wd177x_dsk.c
@@ -204,6 +204,11 @@ bool wd177x_format::load(io_generic *io, UINT32 form_factor, floppy_image *image
for(int track=0; track < f.track_count; track++)
for(int head=0; head < f.head_count; head++) {
+ if (f.encoding == floppy_image::FM)
+ desc[14].p1 = get_track_dam_fm(f, head, track);
+ else
+ desc[16].p1 = get_track_dam_mfm(f, head, track);
+
io_generic_read(io, sectdata, get_image_offset(f, head, track), track_size);
generate_track(desc, track, head, sectors, f.sector_count, total_size, image);
}
@@ -345,6 +350,18 @@ int wd177x_format::get_image_offset(const format &f, int head, int track)
return (track * f.head_count + head) * compute_track_size(f);
}
+int wd177x_format::get_track_dam_fm(const format &f, int head, int track)
+{
+ // everything marked as data by default
+ return FM_DAM;
+}
+
+int wd177x_format::get_track_dam_mfm(const format &f, int head, int track)
+{
+ // everything marked as data by default
+ return MFM_DAM;
+}
+
void wd177x_format::check_compatibility(floppy_image *image, std::vector<int> &candidates)
{
UINT8 bitstream[500000/8];
diff --git a/src/lib/formats/wd177x_dsk.h b/src/lib/formats/wd177x_dsk.h
index 64846e95dcf..a932beb1ced 100644
--- a/src/lib/formats/wd177x_dsk.h
+++ b/src/lib/formats/wd177x_dsk.h
@@ -43,11 +43,16 @@ public:
virtual bool supports_save() const;
protected:
+ enum { FM_DAM = 0xf56f, FM_DDAM = 0xf56a, MFM_DAM = 0xfb, MFM_DDAM = 0xf8 };
+
const format *formats;
+
virtual floppy_image_format_t::desc_e* get_desc_fm(const format &f, int &current_size, int &end_gap_index);
virtual floppy_image_format_t::desc_e* get_desc_mfm(const format &f, int &current_size, int &end_gap_index);
virtual int find_size(io_generic *io, UINT32 form_factor);
virtual int get_image_offset(const format &f, int head, int track);
+ virtual int get_track_dam_fm(const format &f, int head, int track);
+ virtual int get_track_dam_mfm(const format &f, int head, int track);
int compute_track_size(const format &f) const;
void build_sector_description(const format &d, UINT8 *sectdata, desc_s *sectors) const;
diff --git a/src/lib/util/avhuff.c b/src/lib/util/avhuff.c
index dd589c6abdd..d9fdecb46cc 100644
--- a/src/lib/util/avhuff.c
+++ b/src/lib/util/avhuff.c
@@ -143,7 +143,6 @@ inline void avhuff_encoder::deltarle_encoder::encode_one(bitstream_out &bitbuf,
//-------------------------------------------------
// decode_one - decode data
//-------------------------------------------------
-
inline UINT32 avhuff_decoder::deltarle_decoder::decode_one(bitstream_in &bitbuf)
{
// return RLE data if we still have some
@@ -174,9 +173,13 @@ inline UINT32 avhuff_decoder::deltarle_decoder::decode_one(bitstream_in &bitbuf)
// AVHUFF ENCODER
//**************************************************************************
-//-------------------------------------------------
-// avhuff_encoder - constructor
-//-------------------------------------------------
+/**
+ * @fn avhuff_encoder::avhuff_encoder()
+ *
+ * @brief -------------------------------------------------
+ * avhuff_encoder - constructor
+ * -------------------------------------------------.
+ */
avhuff_encoder::avhuff_encoder()
{
@@ -185,11 +188,19 @@ m_flac_encoder.set_num_channels(1);
m_flac_encoder.set_strip_metadata(true);
}
-
-//-------------------------------------------------
-// encode_data - encode a block of data into a
-// compressed data stream
-//-------------------------------------------------
+/**
+ * @fn avhuff_error avhuff_encoder::encode_data(const UINT8 *source, UINT8 *dest, UINT32 &complength)
+ *
+ * @brief -------------------------------------------------
+ * encode_data - encode a block of data into a compressed data stream
+ * -------------------------------------------------.
+ *
+ * @param source Source for the.
+ * @param [in,out] dest If non-null, destination for the.
+ * @param [in,out] complength The complength.
+ *
+ * @return An avhuff_error.
+ */
avhuff_error avhuff_encoder::encode_data(const UINT8 *source, UINT8 *dest, UINT32 &complength)
{
@@ -266,11 +277,17 @@ avhuff_error avhuff_encoder::encode_data(const UINT8 *source, UINT8 *dest, UINT3
return AVHERR_NONE;
}
-
-//-------------------------------------------------
-// raw_data_size - return the raw data size of
-// a raw stream based on the header
-//-------------------------------------------------
+/**
+ * @fn UINT32 avhuff_encoder::raw_data_size(const UINT8 *data)
+ *
+ * @brief -------------------------------------------------
+ * raw_data_size - return the raw data size of a raw stream based on the header
+ * -------------------------------------------------.
+ *
+ * @param data The data.
+ *
+ * @return An UINT32.
+ */
UINT32 avhuff_encoder::raw_data_size(const UINT8 *data)
{
@@ -290,11 +307,23 @@ UINT32 avhuff_encoder::raw_data_size(const UINT8 *data)
return size;
}
-
-//-------------------------------------------------
-// assemble_data - assemble a datastream from raw
-// bits
-//-------------------------------------------------
+/**
+ * @fn avhuff_error avhuff_encoder::assemble_data(dynamic_buffer &buffer, bitmap_yuy16 &bitmap, UINT8 channels, UINT32 numsamples, INT16 **samples, UINT8 *metadata, UINT32 metadatasize)
+ *
+ * @brief -------------------------------------------------
+ * assemble_data - assemble a datastream from raw bits
+ * -------------------------------------------------.
+ *
+ * @param [in,out] buffer The buffer.
+ * @param [in,out] bitmap The bitmap.
+ * @param channels The channels.
+ * @param numsamples The numsamples.
+ * @param [in,out] samples If non-null, the samples.
+ * @param [in,out] metadata If non-null, the metadata.
+ * @param metadatasize The metadatasize.
+ *
+ * @return An avhuff_error.
+ */
avhuff_error avhuff_encoder::assemble_data(dynamic_buffer &buffer, bitmap_yuy16 &bitmap, UINT8 channels, UINT32 numsamples, INT16 **samples, UINT8 *metadata, UINT32 metadatasize)
{
@@ -348,11 +377,21 @@ avhuff_error avhuff_encoder::assemble_data(dynamic_buffer &buffer, bitmap_yuy16
return AVHERR_NONE;
}
-
-//-------------------------------------------------
-// encode_audio - encode raw audio data to the
-// destination
-//-------------------------------------------------
+/**
+ * @fn avhuff_error avhuff_encoder::encode_audio(const UINT8 *source, int channels, int samples, UINT8 *dest, UINT8 *sizes)
+ *
+ * @brief -------------------------------------------------
+ * encode_audio - encode raw audio data to the destination
+ * -------------------------------------------------.
+ *
+ * @param source Source for the.
+ * @param channels The channels.
+ * @param samples The samples.
+ * @param [in,out] dest If non-null, destination for the.
+ * @param [in,out] sizes If non-null, the sizes.
+ *
+ * @return An avhuff_error.
+ */
avhuff_error avhuff_encoder::encode_audio(const UINT8 *source, int channels, int samples, UINT8 *dest, UINT8 *sizes)
{
@@ -471,11 +510,21 @@ avhuff_error avhuff_encoder::encode_audio(const UINT8 *source, int channels, int
return AVHERR_NONE;
}
-
-//-------------------------------------------------
-// encode_video - encode raw video data to the
-// destination
-//-------------------------------------------------
+/**
+ * @fn avhuff_error avhuff_encoder::encode_video(const UINT8 *source, int width, int height, UINT8 *dest, UINT32 &complength)
+ *
+ * @brief -------------------------------------------------
+ * encode_video - encode raw video data to the destination
+ * -------------------------------------------------.
+ *
+ * @param source Source for the.
+ * @param width The width.
+ * @param height The height.
+ * @param [in,out] dest If non-null, destination for the.
+ * @param [in,out] complength The complength.
+ *
+ * @return An avhuff_error.
+ */
avhuff_error avhuff_encoder::encode_video(const UINT8 *source, int width, int height, UINT8 *dest, UINT32 &complength)
{
@@ -483,11 +532,22 @@ avhuff_error avhuff_encoder::encode_video(const UINT8 *source, int width, int he
return encode_video_lossless(source, width, height, dest, complength);
}
-
-//-------------------------------------------------
-// encode_video_lossless - do a lossless video
-// encoding using deltas and huffman encoding
-//-------------------------------------------------
+/**
+ * @fn avhuff_error avhuff_encoder::encode_video_lossless(const UINT8 *source, int width, int height, UINT8 *dest, UINT32 &complength)
+ *
+ * @brief -------------------------------------------------
+ * encode_video_lossless - do a lossless video encoding using deltas and huffman
+ * encoding
+ * -------------------------------------------------.
+ *
+ * @param source Source for the.
+ * @param width The width.
+ * @param height The height.
+ * @param [in,out] dest If non-null, destination for the.
+ * @param [in,out] complength The complength.
+ *
+ * @return An avhuff_error.
+ */
avhuff_error avhuff_encoder::encode_video_lossless(const UINT8 *source, int width, int height, UINT8 *dest, UINT32 &complength)
{
@@ -540,10 +600,20 @@ avhuff_error avhuff_encoder::encode_video_lossless(const UINT8 *source, int widt
// DELTA-RLE ENCODER
//**************************************************************************
-//-------------------------------------------------
-// rle_and_histo_bitmap - RLE compress and
-// histogram a bitmap's worth of data
-//-------------------------------------------------
+/**
+ * @fn UINT16 *avhuff_encoder::deltarle_encoder::rle_and_histo_bitmap(const UINT8 *source, UINT32 items_per_row, UINT32 item_advance, UINT32 row_count)
+ *
+ * @brief -------------------------------------------------
+ * rle_and_histo_bitmap - RLE compress and histogram a bitmap's worth of data
+ * -------------------------------------------------.
+ *
+ * @param source Source for the.
+ * @param items_per_row The items per row.
+ * @param item_advance The item advance.
+ * @param row_count Number of rows.
+ *
+ * @return null if it fails, else an UINT16*.
+ */
UINT16 *avhuff_encoder::deltarle_encoder::rle_and_histo_bitmap(const UINT8 *source, UINT32 items_per_row, UINT32 item_advance, UINT32 row_count)
{
@@ -608,18 +678,27 @@ UINT16 *avhuff_encoder::deltarle_encoder::rle_and_histo_bitmap(const UINT8 *sour
// AVHUFF DECODER
//**************************************************************************
-//-------------------------------------------------
-// avhuff_decoder - constructor
-//-------------------------------------------------
+/**
+ * @fn avhuff_decoder::avhuff_decoder()
+ *
+ * @brief -------------------------------------------------
+ * avhuff_decoder - constructor
+ * -------------------------------------------------.
+ */
avhuff_decoder::avhuff_decoder()
{
}
-
-//-------------------------------------------------
-// configure - configure decompression parameters
-//-------------------------------------------------
+/**
+ * @fn void avhuff_decoder::configure(const avhuff_decompress_config &config)
+ *
+ * @brief -------------------------------------------------
+ * configure - configure decompression parameters
+ * -------------------------------------------------.
+ *
+ * @param config The configuration.
+ */
void avhuff_decoder::configure(const avhuff_decompress_config &config)
{
@@ -632,11 +711,19 @@ void avhuff_decoder::configure(const avhuff_decompress_config &config)
m_config.metadata = config.metadata;
}
-
-//-------------------------------------------------
-// decode_data - decode both audio and video from
-// a raw data stream
-//-------------------------------------------------
+/**
+ * @fn avhuff_error avhuff_decoder::decode_data(const UINT8 *source, UINT32 complength, UINT8 *dest)
+ *
+ * @brief -------------------------------------------------
+ * decode_data - decode both audio and video from a raw data stream
+ * -------------------------------------------------.
+ *
+ * @param source Source for the.
+ * @param complength The complength.
+ * @param [in,out] dest If non-null, destination for the.
+ *
+ * @return An avhuff_error.
+ */
avhuff_error avhuff_decoder::decode_data(const UINT8 *source, UINT32 complength, UINT8 *dest)
{
@@ -765,11 +852,25 @@ avhuff_error avhuff_decoder::decode_data(const UINT8 *source, UINT32 complength,
return AVHERR_NONE;
}
-
-//-------------------------------------------------
-// decode_audio - decode audio from a compressed
-// data stream
-//-------------------------------------------------
+/**
+ * @fn avhuff_error avhuff_decoder::decode_audio(int channels, int samples, const UINT8 *source, UINT8 **dest, UINT32 dxor, const UINT8 *sizes)
+ *
+ * @brief -------------------------------------------------
+ * decode_audio - decode audio from a compressed data stream
+ * -------------------------------------------------.
+ *
+ * @exception CHDERR_DECOMPRESSION_ERROR Thrown when a chderr decompression error error
+ * condition occurs.
+ *
+ * @param channels The channels.
+ * @param samples The samples.
+ * @param source Source for the.
+ * @param [in,out] dest If non-null, destination for the.
+ * @param dxor The dxor.
+ * @param sizes The sizes.
+ *
+ * @return An avhuff_error.
+ */
avhuff_error avhuff_decoder::decode_audio(int channels, int samples, const UINT8 *source, UINT8 **dest, UINT32 dxor, const UINT8 *sizes)
{
@@ -889,11 +990,23 @@ avhuff_error avhuff_decoder::decode_audio(int channels, int samples, const UINT8
return AVHERR_NONE;
}
-
-//-------------------------------------------------
-// decode_video - decode video from a compressed
-// data stream
-//-------------------------------------------------
+/**
+ * @fn avhuff_error avhuff_decoder::decode_video(int width, int height, const UINT8 *source, UINT32 complength, UINT8 *dest, UINT32 dstride, UINT32 dxor)
+ *
+ * @brief -------------------------------------------------
+ * decode_video - decode video from a compressed data stream
+ * -------------------------------------------------.
+ *
+ * @param width The width.
+ * @param height The height.
+ * @param source Source for the.
+ * @param complength The complength.
+ * @param [in,out] dest If non-null, destination for the.
+ * @param dstride The dstride.
+ * @param dxor The dxor.
+ *
+ * @return An avhuff_error.
+ */
avhuff_error avhuff_decoder::decode_video(int width, int height, const UINT8 *source, UINT32 complength, UINT8 *dest, UINT32 dstride, UINT32 dxor)
{
@@ -904,11 +1017,24 @@ avhuff_error avhuff_decoder::decode_video(int width, int height, const UINT8 *so
return AVHERR_INVALID_DATA;
}
-
-//-------------------------------------------------
-// decode_video_lossless - do a lossless video
-// decoding using deltas and huffman encoding
-//-------------------------------------------------
+/**
+ * @fn avhuff_error avhuff_decoder::decode_video_lossless(int width, int height, const UINT8 *source, UINT32 complength, UINT8 *dest, UINT32 dstride, UINT32 dxor)
+ *
+ * @brief -------------------------------------------------
+ * decode_video_lossless - do a lossless video decoding using deltas and huffman
+ * encoding
+ * -------------------------------------------------.
+ *
+ * @param width The width.
+ * @param height The height.
+ * @param source Source for the.
+ * @param complength The complength.
+ * @param [in,out] dest If non-null, destination for the.
+ * @param dstride The dstride.
+ * @param dxor The dxor.
+ *
+ * @return An avhuff_error.
+ */
avhuff_error avhuff_decoder::decode_video_lossless(int width, int height, const UINT8 *source, UINT32 complength, UINT8 *dest, UINT32 dstride, UINT32 dxor)
{
diff --git a/src/lib/util/aviio.c b/src/lib/util/aviio.c
index 0d0403809f8..06b603e0e31 100644
--- a/src/lib/util/aviio.c
+++ b/src/lib/util/aviio.c
@@ -18,59 +18,207 @@
CONSTANTS
***************************************************************************/
+/**
+ * @def FILETYPE_READ
+ *
+ * @brief A macro that defines filetype read.
+ */
+
#define FILETYPE_READ 1
+
+/**
+ * @def FILETYPE_CREATE
+ *
+ * @brief A macro that defines filetype create.
+ */
+
#define FILETYPE_CREATE 2
+/** @brief Size of the maximum riff. */
#define MAX_RIFF_SIZE (2UL * 1024 * 1024 * 1024 - 1024) /* just under 2GB */
+/** @brief The maximum avi size in gigabytes. */
#define MAX_AVI_SIZE_IN_GB (256)
+
+/**
+ * @def FOUR_GB
+ *
+ * @brief A macro that defines four gigabytes.
+ */
+
#define FOUR_GB ((UINT64)1 << 32)
+/**
+ * @def MAX_SOUND_CHANNELS
+ *
+ * @brief A macro that defines maximum sound channels.
+ */
+
#define MAX_SOUND_CHANNELS 2
+
+/**
+ * @def SOUND_BUFFER_MSEC
+ *
+ * @brief A macro that defines sound buffer msec.
+ */
+
#define SOUND_BUFFER_MSEC 2000 /* milliseconds of sound buffering */
+/** @brief The chunktype riff. */
#define CHUNKTYPE_RIFF AVI_FOURCC('R','I','F','F')
+/** @brief List of chunktypes. */
#define CHUNKTYPE_LIST AVI_FOURCC('L','I','S','T')
+/** @brief The chunktype junk. */
#define CHUNKTYPE_JUNK AVI_FOURCC('J','U','N','K')
+/** @brief The chunktype avih. */
#define CHUNKTYPE_AVIH AVI_FOURCC('a','v','i','h')
+/** @brief The chunktype strh. */
#define CHUNKTYPE_STRH AVI_FOURCC('s','t','r','h')
+/** @brief The chunktype strf. */
#define CHUNKTYPE_STRF AVI_FOURCC('s','t','r','f')
+/** @brief The first chunktype index. */
#define CHUNKTYPE_IDX1 AVI_FOURCC('i','d','x','1')
+/** @brief The chunktype indx. */
#define CHUNKTYPE_INDX AVI_FOURCC('i','n','d','x')
+/** @brief The chunktype xxdb. */
#define CHUNKTYPE_XXDB AVI_FOURCC(0x00,0x00,'d','b')
+/** @brief The chunktype xxdc. */
#define CHUNKTYPE_XXDC AVI_FOURCC(0x00,0x00,'d','c')
+/** @brief The chunktype xxwb. */
#define CHUNKTYPE_XXWB AVI_FOURCC(0x00,0x00,'w','b')
+/** @brief The chunktype ixxx. */
#define CHUNKTYPE_IXXX AVI_FOURCC('i','x',0x00,0x00)
+/** @brief The chunktype xx mask. */
#define CHUNKTYPE_XX_MASK AVI_FOURCC(0x00,0x00,0xff,0xff)
+/** @brief The listtype avi. */
#define LISTTYPE_AVI AVI_FOURCC('A','V','I',' ')
+/** @brief The listtype avix. */
#define LISTTYPE_AVIX AVI_FOURCC('A','V','I','X')
+/** @brief The listtype hdrl. */
#define LISTTYPE_HDRL AVI_FOURCC('h','d','r','l')
+/** @brief The listtype strl. */
#define LISTTYPE_STRL AVI_FOURCC('s','t','r','l')
+/** @brief The listtype movi. */
#define LISTTYPE_MOVI AVI_FOURCC('m','o','v','i')
+/** @brief The streamtype vids. */
#define STREAMTYPE_VIDS AVI_FOURCC('v','i','d','s')
+/** @brief The streamtype auds. */
#define STREAMTYPE_AUDS AVI_FOURCC('a','u','d','s')
+/** @brief The handler bitmap. */
#define HANDLER_DIB AVI_FOURCC('D','I','B',' ')
+/** @brief The handler hfyu. */
#define HANDLER_HFYU AVI_FOURCC('h','f','y','u')
/* main AVI header files */
+
+/**
+ * @def AVIF_HASINDEX
+ *
+ * @brief A macro that defines avif hasindex.
+ */
+
#define AVIF_HASINDEX 0x00000010
+
+/**
+ * @def AVIF_MUSTUSEINDEX
+ *
+ * @brief A macro that defines avif mustuseindex.
+ */
+
#define AVIF_MUSTUSEINDEX 0x00000020
+
+/**
+ * @def AVIF_ISINTERLEAVED
+ *
+ * @brief A macro that defines avif isinterleaved.
+ */
+
#define AVIF_ISINTERLEAVED 0x00000100
+
+/**
+ * @def AVIF_COPYRIGHTED
+ *
+ * @brief A macro that defines avif copyrighted.
+ */
+
#define AVIF_COPYRIGHTED 0x00010000
+
+/**
+ * @def AVIF_WASCAPTUREFILE
+ *
+ * @brief A macro that defines avif wascapturefile.
+ */
+
#define AVIF_WASCAPTUREFILE 0x00020000
/* index definitions */
+
+/**
+ * @def AVI_INDEX_OF_INDEXES
+ *
+ * @brief A macro that defines avi index of indexes.
+ */
+
#define AVI_INDEX_OF_INDEXES 0x00
+
+/**
+ * @def AVI_INDEX_OF_CHUNKS
+ *
+ * @brief A macro that defines avi index of chunks.
+ */
+
#define AVI_INDEX_OF_CHUNKS 0x01
+
+/**
+ * @def AVI_INDEX_IS_DATA
+ *
+ * @brief A macro that defines avi index is data.
+ */
+
#define AVI_INDEX_IS_DATA 0x80
+
+/**
+ * @def AVI_INDEX_2FIELD
+ *
+ * @brief A macro that defines avi index 2 field.
+ */
+
#define AVI_INDEX_2FIELD 0x01
/* HuffYUV definitions */
+
+/**
+ * @def HUFFYUV_PREDICT_LEFT
+ *
+ * @brief A macro that defines huffyuv predict left.
+ */
+
#define HUFFYUV_PREDICT_LEFT 0
+
+/**
+ * @def HUFFYUV_PREDICT_GRADIENT
+ *
+ * @brief A macro that defines huffyuv predict gradient.
+ */
+
#define HUFFYUV_PREDICT_GRADIENT 1
+
+/**
+ * @def HUFFYUV_PREDICT_MEDIAN
+ *
+ * @brief A macro that defines huffyuv predict median.
+ */
+
#define HUFFYUV_PREDICT_MEDIAN 2
+
+/**
+ * @def HUFFYUV_PREDICT_DECORR
+ *
+ * @brief A macro that defines huffyuv predict decorr.
+ */
+
#define HUFFYUV_PREDICT_DECORR 0x40
@@ -79,96 +227,177 @@
TYPE DEFINITIONS
***************************************************************************/
+/**
+ * @struct avi_chunk
+ *
+ * @brief An avi chunk.
+ */
+
struct avi_chunk
{
+ /** @brief The offset. */
UINT64 offset; /* file offset of chunk header */
+ /** @brief The size. */
UINT64 size; /* size of this chunk */
+ /** @brief The type. */
UINT32 type; /* type of this chunk */
+ /** @brief The listtype. */
UINT32 listtype; /* type of this list (if we are a list) */
};
+/**
+ * @struct avi_chunk_list
+ *
+ * @brief List of avi chunks.
+ */
struct avi_chunk_list
{
+ /** @brief The offset. */
UINT64 offset; /* offset in the file of header */
+ /** @brief The length. */
UINT32 length; /* length of the chunk including header */
};
+/**
+ * @struct huffyuv_table
+ *
+ * @brief A huffyuv table.
+ */
struct huffyuv_table
{
+ /** @brief The shift[ 256]. */
UINT8 shift[256]; /* bit shift amounts */
+ /** @brief The bits[ 256]. */
UINT32 bits[256]; /* bit match values */
+ /** @brief The mask[ 256]. */
UINT32 mask[256]; /* bit mask values */
+ /** @brief The baselookup[ 65536]. */
UINT16 baselookup[65536]; /* base lookup table */
+ /** @brief The extralookup. */
UINT16 * extralookup; /* extra lookup tables */
};
+/**
+ * @struct huffyuv_data
+ *
+ * @brief A huffyuv data.
+ */
struct huffyuv_data
{
+ /** @brief The predictor. */
UINT8 predictor; /* predictor */
+ /** @brief The table[ 3]. */
huffyuv_table table[3]; /* array of tables */
};
+/**
+ * @struct avi_stream
+ *
+ * @brief An avi stream.
+ */
struct avi_stream
{
+ /** @brief The type. */
UINT32 type; /* subtype of stream */
+ /** @brief Describes the format to use. */
UINT32 format; /* format of stream data */
+ /** @brief The rate. */
UINT32 rate; /* timescale for stream */
+ /** @brief The scale. */
UINT32 scale; /* duration of one sample in the stream */
+ /** @brief The samples. */
UINT32 samples; /* number of samples */
+ /** @brief The chunk. */
avi_chunk_list * chunk; /* list of chunks */
+ /** @brief The chunks. */
UINT32 chunks; /* chunks currently known */
+ /** @brief The chunksalloc. */
UINT32 chunksalloc; /* number of chunks allocated */
+ /** @brief The width. */
UINT32 width; /* width of video */
+ /** @brief The height. */
UINT32 height; /* height of video */
+ /** @brief The depth. */
UINT32 depth; /* depth of video */
+ /** @brief The interlace. */
UINT8 interlace; /* interlace parameters */
+ /** @brief The huffyuv. */
huffyuv_data * huffyuv; /* huffyuv decompression data */
+ /** @brief The channels. */
UINT16 channels; /* audio channels */
+ /** @brief The samplebits. */
UINT16 samplebits; /* audio bits per sample */
+ /** @brief The samplerate. */
UINT32 samplerate; /* audio sample rate */
/* only used when creating */
+ /** @brief The saved strh offset. */
UINT64 saved_strh_offset; /* writeoffset of strh chunk */
+ /** @brief The saved indx offset. */
UINT64 saved_indx_offset; /* writeoffset of indx chunk */
};
+/**
+ * @struct avi_file
+ *
+ * @brief An avi file.
+ */
struct avi_file
{
/* shared data */
+ /** @brief The file. */
osd_file * file; /* pointer to open file */
+ /** @brief The type. */
int type; /* type of access (read/create) */
+ /** @brief The information. */
avi_movie_info info; /* movie info structure */
+ /** @brief The tempbuffer. */
UINT8 * tempbuffer; /* temporary buffer */
+ /** @brief The tempbuffersize. */
UINT32 tempbuffersize; /* size of the temporary buffer */
/* only used when reading */
+ /** @brief The streams. */
int streams; /* number of streams */
+ /** @brief The stream. */
avi_stream * stream; /* allocated array of stream information */
+ /** @brief The rootchunk. */
avi_chunk rootchunk; /* dummy root chunk that wraps the whole file */
/* only used when creating */
+ /** @brief The writeoffs. */
UINT64 writeoffs; /* current file write offset */
+ /** @brief The riffbase. */
UINT64 riffbase; /* base of the current RIFF */
+ /** @brief The chunkstack[ 8]. */
avi_chunk chunkstack[8]; /* stack of chunks we are writing */
+ /** @brief The chunksp. */
int chunksp; /* stack pointer for the current chunk */
+ /** @brief The saved movi offset. */
UINT64 saved_movi_offset; /* writeoffset of movi list */
+ /** @brief The saved avih offset. */
UINT64 saved_avih_offset; /* writeoffset of avih chunk */
+ /** @brief The soundbuf. */
INT16 * soundbuf; /* buffer for sound data */
+ /** @brief The soundbuf samples. */
UINT32 soundbuf_samples; /* length of sound buffer in samples */
+ /** @brief The soundbuf chansamples[ maximum sound channels]. */
UINT32 soundbuf_chansamples[MAX_SOUND_CHANNELS]; /* samples in buffer for each channel */
+ /** @brief The soundbuf chunks. */
UINT32 soundbuf_chunks; /* number of chunks completed so far */
+ /** @brief The soundbuf frames. */
UINT32 soundbuf_frames; /* number of frames ahead of the video */
};
@@ -241,6 +470,16 @@ static void printf_chunk_recursive(avi_file *file, avi_chunk *chunk, int indent)
from the given buffer
-------------------------------------------------*/
+/**
+ * @fn INLINE UINT16 fetch_16bits(const UINT8 *data)
+ *
+ * @brief Fetches the 16bits.
+ *
+ * @param data The data.
+ *
+ * @return The 16bits.
+ */
+
INLINE UINT16 fetch_16bits(const UINT8 *data)
{
return data[0] | (data[1] << 8);
@@ -252,6 +491,16 @@ INLINE UINT16 fetch_16bits(const UINT8 *data)
from the given buffer
-------------------------------------------------*/
+/**
+ * @fn INLINE UINT32 fetch_32bits(const UINT8 *data)
+ *
+ * @brief Fetches the 32bits.
+ *
+ * @param data The data.
+ *
+ * @return The 32bits.
+ */
+
INLINE UINT32 fetch_32bits(const UINT8 *data)
{
return data[0] | (data[1] << 8) | (data[2] << 16) | (data[3] << 24);
@@ -263,6 +512,16 @@ INLINE UINT32 fetch_32bits(const UINT8 *data)
from the given buffer
-------------------------------------------------*/
+/**
+ * @fn INLINE UINT64 fetch_64bits(const UINT8 *data)
+ *
+ * @brief Fetches the 64bits.
+ *
+ * @param data The data.
+ *
+ * @return The 64bits.
+ */
+
INLINE UINT64 fetch_64bits(const UINT8 *data)
{
return (UINT64)data[0] | ((UINT64)data[1] << 8) |
@@ -277,6 +536,15 @@ INLINE UINT64 fetch_64bits(const UINT8 *data)
to the given buffer
-------------------------------------------------*/
+/**
+ * @fn INLINE void put_16bits(UINT8 *data, UINT16 value)
+ *
+ * @brief Puts the 16bits.
+ *
+ * @param [in,out] data If non-null, the data.
+ * @param value The value.
+ */
+
INLINE void put_16bits(UINT8 *data, UINT16 value)
{
data[0] = value >> 0;
@@ -289,6 +557,15 @@ INLINE void put_16bits(UINT8 *data, UINT16 value)
to the given buffer
-------------------------------------------------*/
+/**
+ * @fn INLINE void put_32bits(UINT8 *data, UINT32 value)
+ *
+ * @brief Puts the 32bits.
+ *
+ * @param [in,out] data If non-null, the data.
+ * @param value The value.
+ */
+
INLINE void put_32bits(UINT8 *data, UINT32 value)
{
data[0] = value >> 0;
@@ -303,6 +580,15 @@ INLINE void put_32bits(UINT8 *data, UINT32 value)
to the given buffer
-------------------------------------------------*/
+/**
+ * @fn INLINE void put_64bits(UINT8 *data, UINT64 value)
+ *
+ * @brief Puts the 64bits.
+ *
+ * @param [in,out] data If non-null, the data.
+ * @param value The value.
+ */
+
INLINE void put_64bits(UINT8 *data, UINT64 value)
{
data[0] = value >> 0;
@@ -321,6 +607,16 @@ INLINE void put_64bits(UINT8 *data, UINT64 value)
video stream
-------------------------------------------------*/
+/**
+ * @fn INLINE avi_stream *get_video_stream(avi_file *file)
+ *
+ * @brief Gets video stream.
+ *
+ * @param [in,out] file If non-null, the file.
+ *
+ * @return null if it fails, else the video stream.
+ */
+
INLINE avi_stream *get_video_stream(avi_file *file)
{
int streamnum;
@@ -339,6 +635,18 @@ INLINE avi_stream *get_video_stream(avi_file *file)
audio stream for the 'n'th channel
-------------------------------------------------*/
+/**
+ * @fn INLINE avi_stream *get_audio_stream(avi_file *file, int channel, int *offset)
+ *
+ * @brief Gets audio stream.
+ *
+ * @param [in,out] file If non-null, the file.
+ * @param channel The channel.
+ * @param [in,out] offset If non-null, the offset.
+ *
+ * @return null if it fails, else the audio stream.
+ */
+
INLINE avi_stream *get_audio_stream(avi_file *file, int channel, int *offset)
{
int streamnum;
@@ -365,6 +673,19 @@ INLINE avi_stream *get_audio_stream(avi_file *file, int channel, int *offset)
for a given chunk within a stream
-------------------------------------------------*/
+/**
+ * @fn INLINE avi_error set_stream_chunk_info(avi_stream *stream, UINT32 index, UINT64 offset, UINT32 length)
+ *
+ * @brief Sets stream chunk information.
+ *
+ * @param [in,out] stream If non-null, the stream.
+ * @param index Zero-based index of the.
+ * @param offset The offset.
+ * @param length The length.
+ *
+ * @return An avi_error.
+ */
+
INLINE avi_error set_stream_chunk_info(avi_stream *stream, UINT32 index, UINT64 offset, UINT32 length)
{
/* if we need to allocate more, allocate more */
@@ -398,6 +719,16 @@ INLINE avi_error set_stream_chunk_info(avi_stream *stream, UINT32 index, UINT64
idx1 chunk
-------------------------------------------------*/
+/**
+ * @fn INLINE UINT32 compute_idx1_size(avi_file *file)
+ *
+ * @brief Calculates the index 1 size.
+ *
+ * @param [in,out] file If non-null, the file.
+ *
+ * @return The calculated index 1 size.
+ */
+
INLINE UINT32 compute_idx1_size(avi_file *file)
{
int chunks = 0;
@@ -416,6 +747,17 @@ INLINE UINT32 compute_idx1_size(avi_file *file)
a given stream
-------------------------------------------------*/
+/**
+ * @fn INLINE UINT32 get_chunkid_for_stream(avi_file *file, avi_stream *stream)
+ *
+ * @brief Gets chunkid for stream.
+ *
+ * @param [in,out] file If non-null, the file.
+ * @param [in,out] stream If non-null, the stream.
+ *
+ * @return The chunkid for stream.
+ */
+
INLINE UINT32 get_chunkid_for_stream(avi_file *file, avi_stream *stream)
{
UINT32 chunkid;
@@ -435,6 +777,17 @@ INLINE UINT32 get_chunkid_for_stream(avi_file *file, avi_stream *stream)
number, get the first sample number
-------------------------------------------------*/
+/**
+ * @fn INLINE UINT32 framenum_to_samplenum(avi_file *file, UINT32 framenum)
+ *
+ * @brief Framenum to samplenum.
+ *
+ * @param [in,out] file If non-null, the file.
+ * @param framenum The framenum.
+ *
+ * @return An UINT32.
+ */
+
INLINE UINT32 framenum_to_samplenum(avi_file *file, UINT32 framenum)
{
return ((UINT64)file->info.audio_samplerate * (UINT64)framenum * (UINT64)file->info.video_sampletime + file->info.video_timescale - 1) / (UINT64)file->info.video_timescale;
@@ -447,6 +800,17 @@ INLINE UINT32 framenum_to_samplenum(avi_file *file, UINT32 framenum)
requested amount of data
-------------------------------------------------*/
+/**
+ * @fn INLINE avi_error expand_tempbuffer(avi_file *file, UINT32 length)
+ *
+ * @brief Expand tempbuffer.
+ *
+ * @param [in,out] file If non-null, the file.
+ * @param length The length.
+ *
+ * @return An avi_error.
+ */
+
INLINE avi_error expand_tempbuffer(avi_file *file, UINT32 length)
{
/* expand the tempbuffer to hold the data if necessary */
@@ -473,6 +837,17 @@ INLINE avi_error expand_tempbuffer(avi_file *file, UINT32 length)
avi_open - open an AVI movie file for read
-------------------------------------------------*/
+/**
+ * @fn avi_error avi_open(const char *filename, avi_file **file)
+ *
+ * @brief Queries if a given avi open.
+ *
+ * @param filename Filename of the file.
+ * @param [in,out] file If non-null, the file.
+ *
+ * @return An avi_error.
+ */
+
avi_error avi_open(const char *filename, avi_file **file)
{
avi_file *newfile = NULL;
@@ -525,6 +900,18 @@ error:
avi_create - create a new AVI movie file
-------------------------------------------------*/
+/**
+ * @fn avi_error avi_create(const char *filename, const avi_movie_info *info, avi_file **file)
+ *
+ * @brief Avi create.
+ *
+ * @param filename Filename of the file.
+ * @param info The information.
+ * @param [in,out] file If non-null, the file.
+ *
+ * @return An avi_error.
+ */
+
avi_error avi_create(const char *filename, const avi_movie_info *info, avi_file **file)
{
avi_file *newfile = NULL;
@@ -632,6 +1019,16 @@ error:
avi_close - close an AVI movie file
-------------------------------------------------*/
+/**
+ * @fn avi_error avi_close(avi_file *file)
+ *
+ * @brief Avi close.
+ *
+ * @param [in,out] file If non-null, the file.
+ *
+ * @return An avi_error.
+ */
+
avi_error avi_close(avi_file *file)
{
avi_error avierr = AVIERR_NONE;
@@ -706,6 +1103,14 @@ avi_error avi_close(avi_file *file)
avi_printf_chunks - print the chunks in a file
-------------------------------------------------*/
+/**
+ * @fn void avi_printf_chunks(avi_file *file)
+ *
+ * @brief Avi printf chunks.
+ *
+ * @param [in,out] file If non-null, the file.
+ */
+
void avi_printf_chunks(avi_file *file)
{
printf_chunk_recursive(file, &file->rootchunk, 0);
@@ -717,6 +1122,16 @@ void avi_printf_chunks(avi_file *file)
an avi_error
-------------------------------------------------*/
+/**
+ * @fn const char *avi_error_string(avi_error err)
+ *
+ * @brief Avi error string.
+ *
+ * @param err The error.
+ *
+ * @return null if it fails, else a char*.
+ */
+
const char *avi_error_string(avi_error err)
{
switch (err)
@@ -748,6 +1163,16 @@ const char *avi_error_string(avi_error err)
movie info
-------------------------------------------------*/
+/**
+ * @fn const avi_movie_info *avi_get_movie_info(avi_file *file)
+ *
+ * @brief Avi get movie information.
+ *
+ * @param [in,out] file If non-null, the file.
+ *
+ * @return null if it fails, else an avi_movie_info*.
+ */
+
const avi_movie_info *avi_get_movie_info(avi_file *file)
{
return &file->info;
@@ -759,6 +1184,17 @@ const avi_movie_info *avi_get_movie_info(avi_file *file)
to a sample index
-------------------------------------------------*/
+/**
+ * @fn UINT32 avi_first_sample_in_frame(avi_file *file, UINT32 framenum)
+ *
+ * @brief Avi first sample in frame.
+ *
+ * @param [in,out] file If non-null, the file.
+ * @param framenum The framenum.
+ *
+ * @return An UINT32.
+ */
+
UINT32 avi_first_sample_in_frame(avi_file *file, UINT32 framenum)
{
return framenum_to_samplenum(file, framenum);
@@ -771,6 +1207,18 @@ UINT32 avi_first_sample_in_frame(avi_file *file, UINT32 framenum)
converting to YUY16 format
-------------------------------------------------*/
+/**
+ * @fn avi_error avi_read_video_frame(avi_file *file, UINT32 framenum, bitmap_yuy16 &bitmap)
+ *
+ * @brief Avi read video frame.
+ *
+ * @param [in,out] file If non-null, the file.
+ * @param framenum The framenum.
+ * @param [in,out] bitmap The bitmap.
+ *
+ * @return An avi_error.
+ */
+
avi_error avi_read_video_frame(avi_file *file, UINT32 framenum, bitmap_yuy16 &bitmap)
{
avi_error avierr = AVIERR_NONE;
@@ -829,6 +1277,20 @@ avi_error avi_read_video_frame(avi_file *file, UINT32 framenum, bitmap_yuy16 &bi
data from an AVI file
-------------------------------------------------*/
+/**
+ * @fn avi_error avi_read_sound_samples(avi_file *file, int channel, UINT32 firstsample, UINT32 numsamples, INT16 *output)
+ *
+ * @brief Avi read sound samples.
+ *
+ * @param [in,out] file If non-null, the file.
+ * @param channel The channel.
+ * @param firstsample The firstsample.
+ * @param numsamples The numsamples.
+ * @param [in,out] output If non-null, the output.
+ *
+ * @return An avi_error.
+ */
+
avi_error avi_read_sound_samples(avi_file *file, int channel, UINT32 firstsample, UINT32 numsamples, INT16 *output)
{
avi_error avierr = AVIERR_NONE;
@@ -935,6 +1397,17 @@ avi_error avi_read_sound_samples(avi_file *file, int channel, UINT32 firstsample
of video in YUY16 format
-------------------------------------------------*/
+/**
+ * @fn avi_error avi_append_video_frame(avi_file *file, bitmap_yuy16 &bitmap)
+ *
+ * @brief Avi append video frame.
+ *
+ * @param [in,out] file If non-null, the file.
+ * @param [in,out] bitmap The bitmap.
+ *
+ * @return An avi_error.
+ */
+
avi_error avi_append_video_frame(avi_file *file, bitmap_yuy16 &bitmap)
{
avi_stream *stream = get_video_stream(file);
@@ -982,6 +1455,17 @@ avi_error avi_append_video_frame(avi_file *file, bitmap_yuy16 &bitmap)
of video in RGB32 format
-------------------------------------------------*/
+/**
+ * @fn avi_error avi_append_video_frame(avi_file *file, bitmap_rgb32 &bitmap)
+ *
+ * @brief Avi append video frame.
+ *
+ * @param [in,out] file If non-null, the file.
+ * @param [in,out] bitmap The bitmap.
+ *
+ * @return An avi_error.
+ */
+
avi_error avi_append_video_frame(avi_file *file, bitmap_rgb32 &bitmap)
{
avi_stream *stream = get_video_stream(file);
@@ -1033,6 +1517,20 @@ avi_error avi_append_video_frame(avi_file *file, bitmap_rgb32 &bitmap)
samples
-------------------------------------------------*/
+/**
+ * @fn avi_error avi_append_sound_samples(avi_file *file, int channel, const INT16 *samples, UINT32 numsamples, UINT32 sampleskip)
+ *
+ * @brief Avi append sound samples.
+ *
+ * @param [in,out] file If non-null, the file.
+ * @param channel The channel.
+ * @param samples The samples.
+ * @param numsamples The numsamples.
+ * @param sampleskip The sampleskip.
+ *
+ * @return An avi_error.
+ */
+
avi_error avi_append_sound_samples(avi_file *file, int channel, const INT16 *samples, UINT32 numsamples, UINT32 sampleskip)
{
UINT32 sampoffset = file->soundbuf_chansamples[channel];
@@ -1062,6 +1560,18 @@ avi_error avi_append_sound_samples(avi_file *file, int channel, const INT16 *sam
memory
-------------------------------------------------*/
+/**
+ * @fn static avi_error read_chunk_data(avi_file *file, const avi_chunk *chunk, UINT8 **buffer)
+ *
+ * @brief Reads chunk data.
+ *
+ * @param [in,out] file If non-null, the file.
+ * @param chunk The chunk.
+ * @param [in,out] buffer If non-null, the buffer.
+ *
+ * @return The chunk data.
+ */
+
static avi_error read_chunk_data(avi_file *file, const avi_chunk *chunk, UINT8 **buffer)
{
file_error filerr;
@@ -1090,6 +1600,18 @@ static avi_error read_chunk_data(avi_file *file, const avi_chunk *chunk, UINT8 *
first chunk in a container
-------------------------------------------------*/
+/**
+ * @fn static avi_error get_first_chunk(avi_file *file, const avi_chunk *parent, avi_chunk *newchunk)
+ *
+ * @brief Gets the first chunk.
+ *
+ * @param [in,out] file If non-null, the file.
+ * @param parent The parent.
+ * @param [in,out] newchunk If non-null, the newchunk.
+ *
+ * @return The first chunk.
+ */
+
static avi_error get_first_chunk(avi_file *file, const avi_chunk *parent, avi_chunk *newchunk)
{
UINT64 startoffset = (parent != NULL && parent->type != 0) ? parent->offset + 12 : 0;
@@ -1104,6 +1626,18 @@ static avi_error get_first_chunk(avi_file *file, const avi_chunk *parent, avi_ch
next chunk in a container
-------------------------------------------------*/
+/**
+ * @fn static avi_error get_next_chunk(avi_file *file, const avi_chunk *parent, avi_chunk *newchunk)
+ *
+ * @brief Gets the next chunk.
+ *
+ * @param [in,out] file If non-null, the file.
+ * @param parent The parent.
+ * @param [in,out] newchunk If non-null, the newchunk.
+ *
+ * @return The next chunk.
+ */
+
static avi_error get_next_chunk(avi_file *file, const avi_chunk *parent, avi_chunk *newchunk)
{
UINT64 nextoffset = newchunk->offset + 8 + newchunk->size + (newchunk->size & 1);
@@ -1116,6 +1650,19 @@ static avi_error get_next_chunk(avi_file *file, const avi_chunk *parent, avi_chu
first chunk of a particular type in a container
-------------------------------------------------*/
+/**
+ * @fn static avi_error find_first_chunk(avi_file *file, UINT32 findme, const avi_chunk *container, avi_chunk *result)
+ *
+ * @brief Searches for the first chunk.
+ *
+ * @param [in,out] file If non-null, the file.
+ * @param findme The findme.
+ * @param container The container.
+ * @param [out] result If non-null, the result.
+ *
+ * @return The found chunk.
+ */
+
static avi_error find_first_chunk(avi_file *file, UINT32 findme, const avi_chunk *container, avi_chunk *result)
{
avi_error avierr;
@@ -1133,6 +1680,19 @@ static avi_error find_first_chunk(avi_file *file, UINT32 findme, const avi_chunk
next chunk of a particular type in a container
-------------------------------------------------*/
+/**
+ * @fn static avi_error find_next_chunk(avi_file *file, UINT32 findme, const avi_chunk *container, avi_chunk *result)
+ *
+ * @brief Searches for the next chunk.
+ *
+ * @param [in,out] file If non-null, the file.
+ * @param findme The findme.
+ * @param container The container.
+ * @param [out] result If non-null, the result.
+ *
+ * @return The found chunk.
+ */
+
static avi_error find_next_chunk(avi_file *file, UINT32 findme, const avi_chunk *container, avi_chunk *result)
{
avi_error avierr;
@@ -1150,6 +1710,19 @@ static avi_error find_next_chunk(avi_file *file, UINT32 findme, const avi_chunk
first list of a particular type in a container
-------------------------------------------------*/
+/**
+ * @fn static avi_error find_first_list(avi_file *file, UINT32 findme, const avi_chunk *container, avi_chunk *result)
+ *
+ * @brief Searches for the first list.
+ *
+ * @param [in,out] file If non-null, the file.
+ * @param findme The findme.
+ * @param container The container.
+ * @param [out] result If non-null, the result.
+ *
+ * @return The found list.
+ */
+
static avi_error find_first_list(avi_file *file, UINT32 findme, const avi_chunk *container, avi_chunk *result)
{
avi_error avierr;
@@ -1167,6 +1740,19 @@ static avi_error find_first_list(avi_file *file, UINT32 findme, const avi_chunk
next list of a particular type in a container
-------------------------------------------------*/
+/**
+ * @fn static avi_error find_next_list(avi_file *file, UINT32 findme, const avi_chunk *container, avi_chunk *result)
+ *
+ * @brief Searches for the next list.
+ *
+ * @param [in,out] file If non-null, the file.
+ * @param findme The findme.
+ * @param container The container.
+ * @param [out] result If non-null, the result.
+ *
+ * @return The found list.
+ */
+
static avi_error find_next_list(avi_file *file, UINT32 findme, const avi_chunk *container, avi_chunk *result)
{
avi_error avierr;
@@ -1184,6 +1770,19 @@ static avi_error find_next_list(avi_file *file, UINT32 findme, const avi_chunk *
chunk relative to the current one
-------------------------------------------------*/
+/**
+ * @fn static avi_error get_next_chunk_internal(avi_file *file, const avi_chunk *parent, avi_chunk *newchunk, UINT64 offset)
+ *
+ * @brief Gets the next chunk internal.
+ *
+ * @param [in,out] file If non-null, the file.
+ * @param parent The parent.
+ * @param [in,out] newchunk If non-null, the newchunk.
+ * @param offset The offset.
+ *
+ * @return The next chunk internal.
+ */
+
static avi_error get_next_chunk_internal(avi_file *file, const avi_chunk *parent, avi_chunk *newchunk, UINT64 offset)
{
file_error filerr;
@@ -1227,6 +1826,16 @@ static avi_error get_next_chunk_internal(avi_file *file, const avi_chunk *parent
read_movie_data - get data about a movie
-------------------------------------------------*/
+/**
+ * @fn static avi_error read_movie_data(avi_file *file)
+ *
+ * @brief Reads movie data.
+ *
+ * @param [in,out] file If non-null, the file.
+ *
+ * @return The movie data.
+ */
+
static avi_error read_movie_data(avi_file *file)
{
avi_chunk riff, hdrl, avih, strl, strh, strf, indx, movi, idx1;
@@ -1328,6 +1937,16 @@ error:
from the streams we've read
-------------------------------------------------*/
+/**
+ * @fn static avi_error extract_movie_info(avi_file *file)
+ *
+ * @brief Extracts the movie information described by file.
+ *
+ * @param [in,out] file If non-null, the file.
+ *
+ * @return The extracted movie information.
+ */
+
static avi_error extract_movie_info(avi_file *file)
{
//avi_stream *audiostream;
@@ -1389,6 +2008,17 @@ static avi_error extract_movie_info(avi_file *file)
chunk
-------------------------------------------------*/
+/**
+ * @fn static avi_error parse_avih_chunk(avi_file *file, avi_chunk *avih)
+ *
+ * @brief Parse avih chunk.
+ *
+ * @param [in,out] file If non-null, the file.
+ * @param [in,out] avih If non-null, the avih.
+ *
+ * @return An avi_error.
+ */
+
static avi_error parse_avih_chunk(avi_file *file, avi_chunk *avih)
{
UINT8 *chunkdata = NULL;
@@ -1420,6 +2050,18 @@ error:
chunk
-------------------------------------------------*/
+/**
+ * @fn static avi_error parse_strh_chunk(avi_file *file, avi_stream *stream, avi_chunk *strh)
+ *
+ * @brief Parse strh chunk.
+ *
+ * @param [in,out] file If non-null, the file.
+ * @param [in,out] stream If non-null, the stream.
+ * @param [in,out] strh If non-null, the strh.
+ *
+ * @return An avi_error.
+ */
+
static avi_error parse_strh_chunk(avi_file *file, avi_stream *stream, avi_chunk *strh)
{
UINT8 *chunkdata = NULL;
@@ -1448,6 +2090,18 @@ error:
chunk
-------------------------------------------------*/
+/**
+ * @fn static avi_error parse_strf_chunk(avi_file *file, avi_stream *stream, avi_chunk *strf)
+ *
+ * @brief Parse strf chunk.
+ *
+ * @param [in,out] file If non-null, the file.
+ * @param [in,out] stream If non-null, the stream.
+ * @param [in,out] strf If non-null, the strf.
+ *
+ * @return An avi_error.
+ */
+
static avi_error parse_strf_chunk(avi_file *file, avi_stream *stream, avi_chunk *strf)
{
UINT8 *chunkdata = NULL;
@@ -1492,6 +2146,18 @@ error:
parse_indx_chunk - parse an indx chunk
-------------------------------------------------*/
+/**
+ * @fn static avi_error parse_indx_chunk(avi_file *file, avi_stream *stream, avi_chunk *strf)
+ *
+ * @brief Parse indx chunk.
+ *
+ * @param [in,out] file If non-null, the file.
+ * @param [in,out] stream If non-null, the stream.
+ * @param [in,out] strf If non-null, the strf.
+ *
+ * @return An avi_error.
+ */
+
static avi_error parse_indx_chunk(avi_file *file, avi_stream *stream, avi_chunk *strf)
{
UINT32 entries, entry;
@@ -1582,6 +2248,18 @@ error:
parse_idx1_chunk - parse an idx1 chunk
-------------------------------------------------*/
+/**
+ * @fn static avi_error parse_idx1_chunk(avi_file *file, UINT64 baseoffset, avi_chunk *idx1)
+ *
+ * @brief Parse index 1 chunk.
+ *
+ * @param [in,out] file If non-null, the file.
+ * @param baseoffset The baseoffset.
+ * @param [in,out] idx1 If non-null, the first index.
+ *
+ * @return An avi_error.
+ */
+
static avi_error parse_idx1_chunk(avi_file *file, UINT64 baseoffset, avi_chunk *idx1)
{
UINT8 *chunkdata = NULL;
@@ -1632,6 +2310,19 @@ error:
chunk_open - open a new chunk for writing
-------------------------------------------------*/
+/**
+ * @fn static avi_error chunk_open(avi_file *file, UINT32 type, UINT32 listtype, UINT32 estlength)
+ *
+ * @brief Queries if a given chunk open.
+ *
+ * @param [in,out] file If non-null, the file.
+ * @param type The type.
+ * @param listtype The listtype.
+ * @param estlength The estlength.
+ *
+ * @return An avi_error.
+ */
+
static avi_error chunk_open(avi_file *file, UINT32 type, UINT32 listtype, UINT32 estlength)
{
file_error filerr;
@@ -1690,6 +2381,16 @@ static avi_error chunk_open(avi_file *file, UINT32 type, UINT32 listtype, UINT32
chunk_close - finish writing an chunk
-------------------------------------------------*/
+/**
+ * @fn static avi_error chunk_close(avi_file *file)
+ *
+ * @brief Chunk close.
+ *
+ * @param [in,out] file If non-null, the file.
+ *
+ * @return An avi_error.
+ */
+
static avi_error chunk_close(avi_file *file)
{
avi_chunk *chunk = &file->chunkstack[--file->chunksp];
@@ -1723,6 +2424,19 @@ static avi_error chunk_close(avi_file *file)
chunk_write - write an chunk and its data
-------------------------------------------------*/
+/**
+ * @fn static avi_error chunk_write(avi_file *file, UINT32 type, const void *data, UINT32 length)
+ *
+ * @brief Chunk write.
+ *
+ * @param [in,out] file If non-null, the file.
+ * @param type The type.
+ * @param data The data.
+ * @param length The length.
+ *
+ * @return An avi_error.
+ */
+
static avi_error chunk_write(avi_file *file, UINT32 type, const void *data, UINT32 length)
{
file_error filerr;
@@ -1794,6 +2508,21 @@ static avi_error chunk_write(avi_file *file, UINT32 type, const void *data, UINT
original
-------------------------------------------------*/
+/**
+ * @fn static avi_error chunk_overwrite(avi_file *file, UINT32 type, const void *data, UINT32 length, UINT64 *offset, int initial_write)
+ *
+ * @brief Chunk overwrite.
+ *
+ * @param [in,out] file If non-null, the file.
+ * @param type The type.
+ * @param data The data.
+ * @param length The length.
+ * @param [in,out] offset If non-null, the offset.
+ * @param initial_write The initial write.
+ *
+ * @return An avi_error.
+ */
+
static avi_error chunk_overwrite(avi_file *file, UINT32 type, const void *data, UINT32 length, UINT64 *offset, int initial_write)
{
UINT64 savedoffset = 0;
@@ -1826,6 +2555,16 @@ static avi_error chunk_overwrite(avi_file *file, UINT32 type, const void *data,
set of AVI and stream headers
-------------------------------------------------*/
+/**
+ * @fn static avi_error write_initial_headers(avi_file *file)
+ *
+ * @brief Writes an initial headers.
+ *
+ * @param [in,out] file If non-null, the file.
+ *
+ * @return An avi_error.
+ */
+
static avi_error write_initial_headers(avi_file *file)
{
avi_error avierr;
@@ -1898,6 +2637,17 @@ static avi_error write_initial_headers(avi_file *file)
chunk
-------------------------------------------------*/
+/**
+ * @fn static avi_error write_avih_chunk(avi_file *file, int initial_write)
+ *
+ * @brief Writes an avih chunk.
+ *
+ * @param [in,out] file If non-null, the file.
+ * @param initial_write The initial write.
+ *
+ * @return An avi_error.
+ */
+
static avi_error write_avih_chunk(avi_file *file, int initial_write)
{
avi_stream *video = get_video_stream(file);
@@ -1923,6 +2673,18 @@ static avi_error write_avih_chunk(avi_file *file, int initial_write)
chunk
-------------------------------------------------*/
+/**
+ * @fn static avi_error write_strh_chunk(avi_file *file, avi_stream *stream, int initial_write)
+ *
+ * @brief Writes a strh chunk.
+ *
+ * @param [in,out] file If non-null, the file.
+ * @param [in,out] stream If non-null, the stream.
+ * @param initial_write The initial write.
+ *
+ * @return An avi_error.
+ */
+
static avi_error write_strh_chunk(avi_file *file, avi_stream *stream, int initial_write)
{
UINT8 buffer[56];
@@ -1966,6 +2728,17 @@ static avi_error write_strh_chunk(avi_file *file, avi_stream *stream, int initia
chunk
-------------------------------------------------*/
+/**
+ * @fn static avi_error write_strf_chunk(avi_file *file, avi_stream *stream)
+ *
+ * @brief Writes a strf chunk.
+ *
+ * @param [in,out] file If non-null, the file.
+ * @param [in,out] stream If non-null, the stream.
+ *
+ * @return An avi_error.
+ */
+
static avi_error write_strf_chunk(avi_file *file, avi_stream *stream)
{
/* video stream */
@@ -2019,6 +2792,18 @@ static avi_error write_strf_chunk(avi_file *file, avi_stream *stream)
chunk
-------------------------------------------------*/
+/**
+ * @fn static avi_error write_indx_chunk(avi_file *file, avi_stream *stream, int initial_write)
+ *
+ * @brief Writes an indx chunk.
+ *
+ * @param [in,out] file If non-null, the file.
+ * @param [in,out] stream If non-null, the stream.
+ * @param initial_write The initial write.
+ *
+ * @return An avi_error.
+ */
+
static avi_error write_indx_chunk(avi_file *file, avi_stream *stream, int initial_write)
{
UINT8 buffer[24 + 16 * MAX_AVI_SIZE_IN_GB / 4];
@@ -2115,6 +2900,16 @@ static avi_error write_indx_chunk(avi_file *file, avi_stream *stream, int initia
write_idx1_chunk - write the idx1 chunk
-------------------------------------------------*/
+/**
+ * @fn static avi_error write_idx1_chunk(avi_file *file)
+ *
+ * @brief Writes an index 1 chunk.
+ *
+ * @param [in,out] file If non-null, the file.
+ *
+ * @return An avi_error.
+ */
+
static avi_error write_idx1_chunk(avi_file *file)
{
UINT32 tempbuflength = compute_idx1_size(file) - 8;
@@ -2164,6 +2959,16 @@ static avi_error write_idx1_chunk(avi_file *file)
buffering system
-------------------------------------------------*/
+/**
+ * @fn static avi_error soundbuf_initialize(avi_file *file)
+ *
+ * @brief Soundbuf initialize.
+ *
+ * @param [in,out] file If non-null, the file.
+ *
+ * @return An avi_error.
+ */
+
static avi_error soundbuf_initialize(avi_file *file)
{
avi_stream *audio = get_audio_stream(file, 0, NULL);
@@ -2197,6 +3002,17 @@ static avi_error soundbuf_initialize(avi_file *file)
chunk data
-------------------------------------------------*/
+/**
+ * @fn static avi_error soundbuf_write_chunk(avi_file *file, UINT32 framenum)
+ *
+ * @brief Soundbuf write chunk.
+ *
+ * @param [in,out] file If non-null, the file.
+ * @param framenum The framenum.
+ *
+ * @return An avi_error.
+ */
+
static avi_error soundbuf_write_chunk(avi_file *file, UINT32 framenum)
{
avi_stream *stream = get_audio_stream(file, 0, NULL);
@@ -2229,6 +3045,17 @@ static avi_error soundbuf_write_chunk(avi_file *file, UINT32 framenum)
buffers
-------------------------------------------------*/
+/**
+ * @fn static avi_error soundbuf_flush(avi_file *file, int only_flush_full)
+ *
+ * @brief Soundbuf flush.
+ *
+ * @param [in,out] file If non-null, the file.
+ * @param only_flush_full The only flush full.
+ *
+ * @return An avi_error.
+ */
+
static avi_error soundbuf_flush(avi_file *file, int only_flush_full)
{
avi_stream *stream = get_audio_stream(file, 0, NULL);
@@ -2322,6 +3149,19 @@ static avi_error soundbuf_flush(avi_file *file, int only_flush_full)
bitmap to an RGB encoded frame
-------------------------------------------------*/
+/**
+ * @fn static avi_error rgb32_compress_to_rgb(avi_stream *stream, const bitmap_rgb32 &bitmap, UINT8 *data, UINT32 numbytes)
+ *
+ * @brief RGB 32 compress to RGB.
+ *
+ * @param [in,out] stream If non-null, the stream.
+ * @param bitmap The bitmap.
+ * @param [in,out] data If non-null, the data.
+ * @param numbytes The numbytes.
+ *
+ * @return An avi_error.
+ */
+
static avi_error rgb32_compress_to_rgb(avi_stream *stream, const bitmap_rgb32 &bitmap, UINT8 *data, UINT32 numbytes)
{
int height = MIN(stream->height, bitmap.height());
@@ -2373,6 +3213,19 @@ static avi_error rgb32_compress_to_rgb(avi_stream *stream, const bitmap_rgb32 &b
encoded frame to a YUY16 bitmap
-------------------------------------------------*/
+/**
+ * @fn static avi_error yuv_decompress_to_yuy16(avi_stream *stream, const UINT8 *data, UINT32 numbytes, bitmap_yuy16 &bitmap)
+ *
+ * @brief Yuv decompress to yuy 16.
+ *
+ * @param [in,out] stream If non-null, the stream.
+ * @param data The data.
+ * @param numbytes The numbytes.
+ * @param [in,out] bitmap The bitmap.
+ *
+ * @return An avi_error.
+ */
+
static avi_error yuv_decompress_to_yuy16(avi_stream *stream, const UINT8 *data, UINT32 numbytes, bitmap_yuy16 &bitmap)
{
const UINT16 *dataend = (const UINT16 *)(data + numbytes);
@@ -2412,6 +3265,19 @@ static avi_error yuv_decompress_to_yuy16(avi_stream *stream, const UINT8 *data,
bitmap to a YUV encoded frame
-------------------------------------------------*/
+/**
+ * @fn static avi_error yuy16_compress_to_yuy(avi_stream *stream, const bitmap_yuy16 &bitmap, UINT8 *data, UINT32 numbytes)
+ *
+ * @brief Yuy 16 compress to yuy.
+ *
+ * @param [in,out] stream If non-null, the stream.
+ * @param bitmap The bitmap.
+ * @param [in,out] data If non-null, the data.
+ * @param numbytes The numbytes.
+ *
+ * @return An avi_error.
+ */
+
static avi_error yuy16_compress_to_yuy(avi_stream *stream, const bitmap_yuy16 &bitmap, UINT8 *data, UINT32 numbytes)
{
const UINT16 *dataend = (const UINT16 *)(data + numbytes);
@@ -2451,6 +3317,18 @@ static avi_error yuy16_compress_to_yuy(avi_stream *stream, const bitmap_yuy16 &b
tables
-------------------------------------------------*/
+/**
+ * @fn static avi_error huffyuv_extract_tables(avi_stream *stream, const UINT8 *chunkdata, UINT32 size)
+ *
+ * @brief Huffyuv extract tables.
+ *
+ * @param [in,out] stream If non-null, the stream.
+ * @param chunkdata The chunkdata.
+ * @param size The size.
+ *
+ * @return An avi_error.
+ */
+
static avi_error huffyuv_extract_tables(avi_stream *stream, const UINT8 *chunkdata, UINT32 size)
{
const UINT8 *chunkend = chunkdata + size;
@@ -2590,6 +3468,19 @@ error:
HuffYUV-encoded frame to a YUY16 bitmap
-------------------------------------------------*/
+/**
+ * @fn static avi_error huffyuv_decompress_to_yuy16(avi_stream *stream, const UINT8 *data, UINT32 numbytes, bitmap_yuy16 &bitmap)
+ *
+ * @brief Huffyuv decompress to yuy 16.
+ *
+ * @param [in,out] stream If non-null, the stream.
+ * @param data The data.
+ * @param numbytes The numbytes.
+ * @param [in,out] bitmap The bitmap.
+ *
+ * @return An avi_error.
+ */
+
static avi_error huffyuv_decompress_to_yuy16(avi_stream *stream, const UINT8 *data, UINT32 numbytes, bitmap_yuy16 &bitmap)
{
huffyuv_data *huffyuv = stream->huffyuv;
@@ -2793,6 +3684,14 @@ static avi_error huffyuv_decompress_to_yuy16(avi_stream *stream, const UINT8 *da
return AVIERR_NONE;
}
+/**
+ * @fn static void u64toa(UINT64 val, char *output)
+ *
+ * @brief 64toas.
+ *
+ * @param val The value.
+ * @param [in,out] output If non-null, the output.
+ */
static void u64toa(UINT64 val, char *output)
{
@@ -2810,6 +3709,16 @@ static void u64toa(UINT64 val, char *output)
about a chunk recursively
-------------------------------------------------*/
+/**
+ * @fn static void printf_chunk_recursive(avi_file *file, avi_chunk *container, int indent)
+ *
+ * @brief Printf chunk recursive.
+ *
+ * @param [in,out] file If non-null, the file.
+ * @param [in,out] container If non-null, the container.
+ * @param indent The indent.
+ */
+
static void printf_chunk_recursive(avi_file *file, avi_chunk *container, int indent)
{
char size[20], offset[20];
diff --git a/src/lib/util/bitmap.c b/src/lib/util/bitmap.c
index a6e7b02f957..aeb9852ca1c 100644
--- a/src/lib/util/bitmap.c
+++ b/src/lib/util/bitmap.c
@@ -20,9 +20,9 @@
// CONSTANTS
//**************************************************************************
-// alignment values; 128 bytes is the largest cache line on typical
-// architectures today
+/** @brief alignment values; 128 bytes is the largest cache line on typical architectures today. */
const UINT32 BITMAP_OVERALL_ALIGN = 128;
+/** @brief The bitmap rowbytes align. */
const UINT32 BITMAP_ROWBYTES_ALIGN = 128;
@@ -61,9 +61,20 @@ inline void bitmap_t::compute_base(int xslop, int yslop)
// BITMAP ALLOCATION/CONFIGURATION
//**************************************************************************
-//-------------------------------------------------
-// bitmap_t - basic constructor
-//-------------------------------------------------
+/**
+ * @fn bitmap_t::bitmap_t(bitmap_format format, int bpp, int width, int height, int xslop, int yslop)
+ *
+ * @brief -------------------------------------------------
+ * bitmap_t - basic constructor
+ * -------------------------------------------------.
+ *
+ * @param format Describes the format to use.
+ * @param bpp The bits per pixel.
+ * @param width The width.
+ * @param height The height.
+ * @param xslop The xslop.
+ * @param yslop The yslop.
+ */
bitmap_t::bitmap_t(bitmap_format format, int bpp, int width, int height, int xslop, int yslop)
: m_alloc(NULL),
@@ -76,6 +87,18 @@ bitmap_t::bitmap_t(bitmap_format format, int bpp, int width, int height, int xsl
allocate(width, height, xslop, yslop);
}
+/**
+ * @fn bitmap_t::bitmap_t(bitmap_format format, int bpp, void *base, int width, int height, int rowpixels)
+ *
+ * @brief Constructor.
+ *
+ * @param format Describes the format to use.
+ * @param bpp The bits per pixel.
+ * @param [in,out] base If non-null, the base.
+ * @param width The width.
+ * @param height The height.
+ * @param rowpixels The rowpixels.
+ */
bitmap_t::bitmap_t(bitmap_format format, int bpp, void *base, int width, int height, int rowpixels)
: m_alloc(NULL),
@@ -91,6 +114,16 @@ bitmap_t::bitmap_t(bitmap_format format, int bpp, void *base, int width, int hei
{
}
+/**
+ * @fn bitmap_t::bitmap_t(bitmap_format format, int bpp, bitmap_t &source, const rectangle &subrect)
+ *
+ * @brief Constructor.
+ *
+ * @param format Describes the format to use.
+ * @param bpp The bits per pixel.
+ * @param [in,out] source Source for the.
+ * @param subrect The subrect.
+ */
bitmap_t::bitmap_t(bitmap_format format, int bpp, bitmap_t &source, const rectangle &subrect)
: m_alloc(NULL),
@@ -109,10 +142,13 @@ bitmap_t::bitmap_t(bitmap_format format, int bpp, bitmap_t &source, const rectan
assert(source.cliprect().contains(subrect));
}
-
-//-------------------------------------------------
-// ~bitmap_t - basic destructor
-//-------------------------------------------------
+/**
+ * @fn bitmap_t::~bitmap_t()
+ *
+ * @brief -------------------------------------------------
+ * ~bitmap_t - basic destructor
+ * -------------------------------------------------.
+ */
bitmap_t::~bitmap_t()
{
@@ -120,12 +156,19 @@ bitmap_t::~bitmap_t()
reset();
}
-
-//-------------------------------------------------
-// allocate -- (re)allocate memory for the bitmap
-// at the given size, destroying anything that
-// already exists
-//-------------------------------------------------
+/**
+ * @fn void bitmap_t::allocate(int width, int height, int xslop, int yslop)
+ *
+ * @brief -------------------------------------------------
+ * allocate -- (re)allocate memory for the bitmap at the given size, destroying
+ * anything that already exists
+ * -------------------------------------------------.
+ *
+ * @param width The width.
+ * @param height The height.
+ * @param xslop The xslop.
+ * @param yslop The yslop.
+ */
void bitmap_t::allocate(int width, int height, int xslop, int yslop)
{
@@ -157,12 +200,19 @@ void bitmap_t::allocate(int width, int height, int xslop, int yslop)
compute_base(xslop, yslop);
}
-
-//-------------------------------------------------
-// resize -- resize a bitmap, reusing existing
-// memory if the new size is smaller than the
-// current size
-//-------------------------------------------------
+/**
+ * @fn void bitmap_t::resize(int width, int height, int xslop, int yslop)
+ *
+ * @brief -------------------------------------------------
+ * resize -- resize a bitmap, reusing existing memory if the new size is smaller than
+ * the current size
+ * -------------------------------------------------.
+ *
+ * @param width The width.
+ * @param height The height.
+ * @param xslop The xslop.
+ * @param yslop The yslop.
+ */
void bitmap_t::resize(int width, int height, int xslop, int yslop)
{
@@ -197,11 +247,13 @@ void bitmap_t::resize(int width, int height, int xslop, int yslop)
compute_base(xslop, yslop);
}
-
-//-------------------------------------------------
-// reset -- reset to an invalid bitmap, deleting
-// all allocated stuff
-//-------------------------------------------------
+/**
+ * @fn void bitmap_t::reset()
+ *
+ * @brief -------------------------------------------------
+ * reset -- reset to an invalid bitmap, deleting all allocated stuff
+ * -------------------------------------------------.
+ */
void bitmap_t::reset()
{
@@ -218,11 +270,18 @@ void bitmap_t::reset()
m_cliprect.set(0, -1, 0, -1);
}
-
-//-------------------------------------------------
-// wrap -- wrap an array of memory; the target
-// bitmap does not own the memory
-//-------------------------------------------------
+/**
+ * @fn void bitmap_t::wrap(void *base, int width, int height, int rowpixels)
+ *
+ * @brief -------------------------------------------------
+ * wrap -- wrap an array of memory; the target bitmap does not own the memory
+ * -------------------------------------------------.
+ *
+ * @param [in,out] base If non-null, the base.
+ * @param width The width.
+ * @param height The height.
+ * @param rowpixels The rowpixels.
+ */
void bitmap_t::wrap(void *base, int width, int height, int rowpixels)
{
@@ -237,12 +296,17 @@ void bitmap_t::wrap(void *base, int width, int height, int rowpixels)
m_cliprect.set(0, m_width - 1, 0, m_height - 1);
}
-
-//-------------------------------------------------
-// wrap -- wrap a subrectangle of an existing
-// bitmap by copying its fields; the target
-// bitmap does not own the memory
-//-------------------------------------------------
+/**
+ * @fn void bitmap_t::wrap(const bitmap_t &source, const rectangle &subrect)
+ *
+ * @brief -------------------------------------------------
+ * wrap -- wrap a subrectangle of an existing bitmap by copying its fields; the target
+ * bitmap does not own the memory
+ * -------------------------------------------------.
+ *
+ * @param source Source for the.
+ * @param subrect The subrect.
+ */
void bitmap_t::wrap(const bitmap_t &source, const rectangle &subrect)
{
@@ -262,11 +326,15 @@ void bitmap_t::wrap(const bitmap_t &source, const rectangle &subrect)
m_cliprect.set(0, m_width - 1, 0, m_height - 1);
}
-
-//-------------------------------------------------
-// set_palette -- associate a palette with a
-// bitmap
-//-------------------------------------------------
+/**
+ * @fn void bitmap_t::set_palette(palette_t *palette)
+ *
+ * @brief -------------------------------------------------
+ * set_palette -- associate a palette with a bitmap
+ * -------------------------------------------------.
+ *
+ * @param [in,out] palette If non-null, the palette.
+ */
void bitmap_t::set_palette(palette_t *palette)
{
@@ -285,10 +353,16 @@ void bitmap_t::set_palette(palette_t *palette)
}
}
-
-//-------------------------------------------------
-// fill -- fill a bitmap with a solid color
-//-------------------------------------------------
+/**
+ * @fn void bitmap_t::fill(UINT32 color, const rectangle &cliprect)
+ *
+ * @brief -------------------------------------------------
+ * fill -- fill a bitmap with a solid color
+ * -------------------------------------------------.
+ *
+ * @param color The color.
+ * @param cliprect The cliprect.
+ */
void bitmap_t::fill(UINT32 color, const rectangle &cliprect)
{
diff --git a/src/lib/util/cdrom.c b/src/lib/util/cdrom.c
index 6655418583a..e3cb14e8f0c 100644
--- a/src/lib/util/cdrom.c
+++ b/src/lib/util/cdrom.c
@@ -28,11 +28,41 @@
DEBUGGING
***************************************************************************/
+/** @brief The verbose. */
#define VERBOSE (0)
#if VERBOSE
+
+/**
+ * @def LOG(x) do
+ *
+ * @brief A macro that defines log.
+ *
+ * @param x The void to process.
+ */
+
#define LOG(x) do { if (VERBOSE) logerror x; } while (0)
+
+/**
+ * @fn void CLIB_DECL logerror(const char *text, ...) ATTR_PRINTF(1,2);
+ *
+ * @brief Logerrors the given text.
+ *
+ * @param text The text.
+ *
+ * @return A CLIB_DECL.
+ */
+
void CLIB_DECL logerror(const char *text, ...) ATTR_PRINTF(1,2);
#else
+
+/**
+ * @def LOG(x);
+ *
+ * @brief A macro that defines log.
+ *
+ * @param x The void to process.
+ */
+
#define LOG(x)
#endif
@@ -42,18 +72,27 @@ void CLIB_DECL logerror(const char *text, ...) ATTR_PRINTF(1,2);
CONSTANTS
***************************************************************************/
-const int SYNC_OFFSET = 0x000; // offset within sector
-const int SYNC_NUM_BYTES = 12; // 12 bytes
+/** @brief offset within sector. */
+const int SYNC_OFFSET = 0x000;
+/** @brief 12 bytes. */
+const int SYNC_NUM_BYTES = 12;
-const int MODE_OFFSET = 0x00f; // offset within sector
+/** @brief offset within sector. */
+const int MODE_OFFSET = 0x00f;
-const int ECC_P_OFFSET = 0x81c; // offset within sector
-const int ECC_P_NUM_BYTES = 86; // 2 lots of 86
-const int ECC_P_COMP = 24; // 24 bytes each
+/** @brief offset within sector. */
+const int ECC_P_OFFSET = 0x81c;
+/** @brief 2 lots of 86. */
+const int ECC_P_NUM_BYTES = 86;
+/** @brief 24 bytes each. */
+const int ECC_P_COMP = 24;
+/** @brief The ECC q offset. */
const int ECC_Q_OFFSET = ECC_P_OFFSET + 2 * ECC_P_NUM_BYTES;
-const int ECC_Q_NUM_BYTES = 52; // 2 lots of 52
-const int ECC_Q_COMP = 43; // 43 bytes each
+/** @brief 2 lots of 52. */
+const int ECC_Q_NUM_BYTES = 52;
+/** @brief 43 bytes each. */
+const int ECC_Q_COMP = 43;
@@ -61,11 +100,21 @@ const int ECC_Q_COMP = 43; // 43 bytes each
TYPE DEFINITIONS
***************************************************************************/
+/**
+ * @struct cdrom_file
+ *
+ * @brief A cdrom file.
+ */
+
struct cdrom_file
{
+ /** @brief The chd. */
chd_file * chd; /* CHD file */
+ /** @brief The cdtoc. */
cdrom_toc cdtoc; /* TOC for the CD */
+ /** @brief Information describing the track. */
chdcd_track_input_info track_info; /* track info */
+ /** @brief The fhandle[ CD maximum tracks]. */
core_file * fhandle[CD_MAX_TRACKS];/* file handle */
};
@@ -80,6 +129,18 @@ struct cdrom_file
and the track number
-------------------------------------------------*/
+/**
+ * @fn INLINE UINT32 physical_to_chd_lba(cdrom_file *file, UINT32 physlba, UINT32 &tracknum)
+ *
+ * @brief Physical to chd lba.
+ *
+ * @param [in,out] file If non-null, the file.
+ * @param physlba The physlba.
+ * @param [in,out] tracknum The tracknum.
+ *
+ * @return An UINT32.
+ */
+
INLINE UINT32 physical_to_chd_lba(cdrom_file *file, UINT32 physlba, UINT32 &tracknum)
{
UINT32 chdlba;
@@ -102,6 +163,18 @@ INLINE UINT32 physical_to_chd_lba(cdrom_file *file, UINT32 physlba, UINT32 &trac
and the track number
-------------------------------------------------*/
+/**
+ * @fn INLINE UINT32 logical_to_chd_lba(cdrom_file *file, UINT32 loglba, UINT32 &tracknum)
+ *
+ * @brief Logical to chd lba.
+ *
+ * @param [in,out] file If non-null, the file.
+ * @param loglba The loglba.
+ * @param [in,out] tracknum The tracknum.
+ *
+ * @return An UINT32.
+ */
+
INLINE UINT32 logical_to_chd_lba(cdrom_file *file, UINT32 loglba, UINT32 &tracknum)
{
UINT32 chdlba, physlba;
@@ -134,6 +207,16 @@ INLINE UINT32 logical_to_chd_lba(cdrom_file *file, UINT32 loglba, UINT32 &trackn
BASE FUNCTIONALITY
***************************************************************************/
+/**
+ * @fn cdrom_file *cdrom_open(const char *inputfile)
+ *
+ * @brief Queries if a given cdrom open.
+ *
+ * @param inputfile The inputfile.
+ *
+ * @return null if it fails, else a cdrom_file*.
+ */
+
cdrom_file *cdrom_open(const char *inputfile)
{
int i;
@@ -220,6 +303,16 @@ cdrom_file *cdrom_open(const char *inputfile)
already-opened CHD file
-------------------------------------------------*/
+/**
+ * @fn cdrom_file *cdrom_open(chd_file *chd)
+ *
+ * @brief Queries if a given cdrom open.
+ *
+ * @param [in,out] chd If non-null, the chd.
+ *
+ * @return null if it fails, else a cdrom_file*.
+ */
+
cdrom_file *cdrom_open(chd_file *chd)
{
int i;
@@ -308,6 +401,14 @@ cdrom_file *cdrom_open(chd_file *chd)
cdrom_close - "close" a CD-ROM file
-------------------------------------------------*/
+/**
+ * @fn void cdrom_close(cdrom_file *file)
+ *
+ * @brief Cdrom close.
+ *
+ * @param [in,out] file If non-null, the file.
+ */
+
void cdrom_close(cdrom_file *file)
{
if (file == NULL)
@@ -330,6 +431,22 @@ void cdrom_close(cdrom_file *file)
CORE READ ACCESS
***************************************************************************/
+/**
+ * @fn chd_error read_partial_sector(cdrom_file *file, void *dest, UINT32 lbasector, UINT32 chdsector, UINT32 tracknum, UINT32 startoffs, UINT32 length)
+ *
+ * @brief Reads partial sector.
+ *
+ * @param [in,out] file If non-null, the file.
+ * @param [in,out] dest If non-null, destination for the.
+ * @param lbasector The lbasector.
+ * @param chdsector The chdsector.
+ * @param tracknum The tracknum.
+ * @param startoffs The startoffs.
+ * @param length The length.
+ *
+ * @return The partial sector.
+ */
+
chd_error read_partial_sector(cdrom_file *file, void *dest, UINT32 lbasector, UINT32 chdsector, UINT32 tracknum, UINT32 startoffs, UINT32 length)
{
chd_error result = CHDERR_NONE;
@@ -388,6 +505,20 @@ chd_error read_partial_sector(cdrom_file *file, void *dest, UINT32 lbasector, UI
from a CD-ROM
-------------------------------------------------*/
+/**
+ * @fn UINT32 cdrom_read_data(cdrom_file *file, UINT32 lbasector, void *buffer, UINT32 datatype, bool phys)
+ *
+ * @brief Cdrom read data.
+ *
+ * @param [in,out] file If non-null, the file.
+ * @param lbasector The lbasector.
+ * @param [in,out] buffer If non-null, the buffer.
+ * @param datatype The datatype.
+ * @param phys true to physical.
+ *
+ * @return An UINT32.
+ */
+
UINT32 cdrom_read_data(cdrom_file *file, UINT32 lbasector, void *buffer, UINT32 datatype, bool phys)
{
if (file == NULL)
@@ -460,6 +591,19 @@ UINT32 cdrom_read_data(cdrom_file *file, UINT32 lbasector, void *buffer, UINT32
a sector
-------------------------------------------------*/
+/**
+ * @fn UINT32 cdrom_read_subcode(cdrom_file *file, UINT32 lbasector, void *buffer, bool phys)
+ *
+ * @brief Cdrom read subcode.
+ *
+ * @param [in,out] file If non-null, the file.
+ * @param lbasector The lbasector.
+ * @param [in,out] buffer If non-null, the buffer.
+ * @param phys true to physical.
+ *
+ * @return An UINT32.
+ */
+
UINT32 cdrom_read_subcode(cdrom_file *file, UINT32 lbasector, void *buffer, bool phys)
{
if (file == NULL)
@@ -497,6 +641,17 @@ UINT32 cdrom_read_subcode(cdrom_file *file, UINT32 lbasector, void *buffer, bool
for a physical frame number
-------------------------------------------------*/
+/**
+ * @fn UINT32 cdrom_get_track(cdrom_file *file, UINT32 frame)
+ *
+ * @brief Cdrom get track.
+ *
+ * @param [in,out] file If non-null, the file.
+ * @param frame The frame.
+ *
+ * @return An UINT32.
+ */
+
UINT32 cdrom_get_track(cdrom_file *file, UINT32 frame)
{
UINT32 track = 0;
@@ -516,6 +671,17 @@ UINT32 cdrom_get_track(cdrom_file *file, UINT32 frame)
that a track starts at
-------------------------------------------------*/
+/**
+ * @fn UINT32 cdrom_get_track_start(cdrom_file *file, UINT32 track)
+ *
+ * @brief Cdrom get track start.
+ *
+ * @param [in,out] file If non-null, the file.
+ * @param track The track.
+ *
+ * @return An UINT32.
+ */
+
UINT32 cdrom_get_track_start(cdrom_file *file, UINT32 track)
{
if (file == NULL)
@@ -533,6 +699,17 @@ UINT32 cdrom_get_track_start(cdrom_file *file, UINT32 track)
physical frame number that a track starts at
-------------------------------------------------*/
+/**
+ * @fn UINT32 cdrom_get_track_start_phys(cdrom_file *file, UINT32 track)
+ *
+ * @brief Cdrom get track start physical.
+ *
+ * @param [in,out] file If non-null, the file.
+ * @param track The track.
+ *
+ * @return An UINT32.
+ */
+
UINT32 cdrom_get_track_start_phys(cdrom_file *file, UINT32 track)
{
if (file == NULL)
@@ -554,6 +731,16 @@ UINT32 cdrom_get_track_start_phys(cdrom_file *file, UINT32 track)
number
-------------------------------------------------*/
+/**
+ * @fn int cdrom_get_last_track(cdrom_file *file)
+ *
+ * @brief Cdrom get last track.
+ *
+ * @param [in,out] file If non-null, the file.
+ *
+ * @return An int.
+ */
+
int cdrom_get_last_track(cdrom_file *file)
{
if (file == NULL)
@@ -568,6 +755,17 @@ int cdrom_get_last_track(cdrom_file *file)
for a track
-------------------------------------------------*/
+/**
+ * @fn int cdrom_get_adr_control(cdrom_file *file, int track)
+ *
+ * @brief Cdrom get address control.
+ *
+ * @param [in,out] file If non-null, the file.
+ * @param track The track.
+ *
+ * @return An int.
+ */
+
int cdrom_get_adr_control(cdrom_file *file, int track)
{
if (file == NULL)
@@ -586,6 +784,17 @@ int cdrom_get_adr_control(cdrom_file *file, int track)
cdrom_get_track_type - return the track type
-------------------------------------------------*/
+/**
+ * @fn int cdrom_get_track_type(cdrom_file *file, int track)
+ *
+ * @brief Cdrom get track type.
+ *
+ * @param [in,out] file If non-null, the file.
+ * @param track The track.
+ *
+ * @return An int.
+ */
+
int cdrom_get_track_type(cdrom_file *file, int track)
{
if (file == NULL)
@@ -600,6 +809,16 @@ int cdrom_get_track_type(cdrom_file *file, int track)
CD-ROM
-------------------------------------------------*/
+/**
+ * @fn const cdrom_toc *cdrom_get_toc(cdrom_file *file)
+ *
+ * @brief Cdrom get TOC.
+ *
+ * @param [in,out] file If non-null, the file.
+ *
+ * @return null if it fails, else a cdrom_toc*.
+ */
+
const cdrom_toc *cdrom_get_toc(cdrom_file *file)
{
if (file == NULL)
@@ -620,6 +839,16 @@ const cdrom_toc *cdrom_get_toc(cdrom_file *file)
and track data size
-------------------------------------------------*/
+/**
+ * @fn static void cdrom_get_info_from_type_string(const char *typestring, UINT32 *trktype, UINT32 *datasize)
+ *
+ * @brief Cdrom get information from type string.
+ *
+ * @param typestring The typestring.
+ * @param [in,out] trktype If non-null, the trktype.
+ * @param [in,out] datasize If non-null, the datasize.
+ */
+
static void cdrom_get_info_from_type_string(const char *typestring, UINT32 *trktype, UINT32 *datasize)
{
if (!strcmp(typestring, "MODE1"))
@@ -705,6 +934,15 @@ static void cdrom_get_info_from_type_string(const char *typestring, UINT32 *trkt
and track data size
-------------------------------------------------*/
+/**
+ * @fn void cdrom_convert_type_string_to_track_info(const char *typestring, cdrom_track_info *info)
+ *
+ * @brief Cdrom convert type string to track information.
+ *
+ * @param typestring The typestring.
+ * @param [in,out] info If non-null, the information.
+ */
+
void cdrom_convert_type_string_to_track_info(const char *typestring, cdrom_track_info *info)
{
cdrom_get_info_from_type_string(typestring, &info->trktype, &info->datasize);
@@ -716,6 +954,15 @@ void cdrom_convert_type_string_to_track_info(const char *typestring, cdrom_track
and pregap data size
-------------------------------------------------*/
+/**
+ * @fn void cdrom_convert_type_string_to_pregap_info(const char *typestring, cdrom_track_info *info)
+ *
+ * @brief Cdrom convert type string to pregap information.
+ *
+ * @param typestring The typestring.
+ * @param [in,out] info If non-null, the information.
+ */
+
void cdrom_convert_type_string_to_pregap_info(const char *typestring, cdrom_track_info *info)
{
cdrom_get_info_from_type_string(typestring, &info->pgtype, &info->pgdatasize);
@@ -727,6 +974,15 @@ void cdrom_convert_type_string_to_pregap_info(const char *typestring, cdrom_trac
and track subcode data size
-------------------------------------------------*/
+/**
+ * @fn void cdrom_convert_subtype_string_to_track_info(const char *typestring, cdrom_track_info *info)
+ *
+ * @brief Cdrom convert subtype string to track information.
+ *
+ * @param typestring The typestring.
+ * @param [in,out] info If non-null, the information.
+ */
+
void cdrom_convert_subtype_string_to_track_info(const char *typestring, cdrom_track_info *info)
{
if (!strcmp(typestring, "RW"))
@@ -747,6 +1003,15 @@ void cdrom_convert_subtype_string_to_track_info(const char *typestring, cdrom_tr
and track subcode data size
-------------------------------------------------*/
+/**
+ * @fn void cdrom_convert_subtype_string_to_pregap_info(const char *typestring, cdrom_track_info *info)
+ *
+ * @brief Cdrom convert subtype string to pregap information.
+ *
+ * @param typestring The typestring.
+ * @param [in,out] info If non-null, the information.
+ */
+
void cdrom_convert_subtype_string_to_pregap_info(const char *typestring, cdrom_track_info *info)
{
if (!strcmp(typestring, "RW"))
@@ -766,6 +1031,16 @@ void cdrom_convert_subtype_string_to_pregap_info(const char *typestring, cdrom_t
associated with the given type
-------------------------------------------------*/
+/**
+ * @fn const char *cdrom_get_type_string(UINT32 trktype)
+ *
+ * @brief Cdrom get type string.
+ *
+ * @param trktype The trktype.
+ *
+ * @return null if it fails, else a char*.
+ */
+
const char *cdrom_get_type_string(UINT32 trktype)
{
switch (trktype)
@@ -788,6 +1063,16 @@ const char *cdrom_get_type_string(UINT32 trktype)
associated with the given subcode type
-------------------------------------------------*/
+/**
+ * @fn const char *cdrom_get_subtype_string(UINT32 subtype)
+ *
+ * @brief Cdrom get subtype string.
+ *
+ * @param subtype The subtype.
+ *
+ * @return null if it fails, else a char*.
+ */
+
const char *cdrom_get_subtype_string(UINT32 subtype)
{
switch (subtype)
@@ -809,6 +1094,17 @@ const char *cdrom_get_subtype_string(UINT32 subtype)
TOC structure
-------------------------------------------------*/
+/**
+ * @fn chd_error cdrom_parse_metadata(chd_file *chd, cdrom_toc *toc)
+ *
+ * @brief Cdrom parse metadata.
+ *
+ * @param [in,out] chd If non-null, the chd.
+ * @param [in,out] toc If non-null, the TOC.
+ *
+ * @return A chd_error.
+ */
+
chd_error cdrom_parse_metadata(chd_file *chd, cdrom_toc *toc)
{
std::string metadata;
@@ -975,6 +1271,17 @@ chd_error cdrom_parse_metadata(chd_file *chd, cdrom_toc *toc)
cdrom_write_metadata - write metadata
-------------------------------------------------*/
+/**
+ * @fn chd_error cdrom_write_metadata(chd_file *chd, const cdrom_toc *toc)
+ *
+ * @brief Cdrom write metadata.
+ *
+ * @param [in,out] chd If non-null, the chd.
+ * @param toc The TOC.
+ *
+ * @return A chd_error.
+ */
+
chd_error cdrom_write_metadata(chd_file *chd, const cdrom_toc *toc)
{
chd_error err;
@@ -1019,11 +1326,11 @@ chd_error cdrom_write_metadata(chd_file *chd, const cdrom_toc *toc)
return CHDERR_NONE;
}
-
-//-------------------------------------------------
-// ECC lookup tables
-// pre-calculated tables for ECC data calcs
-//-------------------------------------------------
+/**
+ * @brief -------------------------------------------------
+ * ECC lookup tables pre-calculated tables for ECC data calcs
+ * -------------------------------------------------.
+ */
static const UINT8 ecclow[256] =
{
@@ -1045,6 +1352,7 @@ static const UINT8 ecclow[256] =
0xfd, 0xff, 0xf9, 0xfb, 0xf5, 0xf7, 0xf1, 0xf3, 0xed, 0xef, 0xe9, 0xeb, 0xe5, 0xe7, 0xe1, 0xe3
};
+/** @brief The ecchigh[ 256]. */
static const UINT8 ecchigh[256] =
{
0x00, 0xf4, 0xf5, 0x01, 0xf7, 0x03, 0x02, 0xf6, 0xf3, 0x07, 0x06, 0xf2, 0x04, 0xf0, 0xf1, 0x05,
@@ -1065,13 +1373,12 @@ static const UINT8 ecchigh[256] =
0x50, 0xa4, 0xa5, 0x51, 0xa7, 0x53, 0x52, 0xa6, 0xa3, 0x57, 0x56, 0xa2, 0x54, 0xa0, 0xa1, 0x55
};
-
-//-------------------------------------------------
-// poffsets - each row represents the addresses
-// used to calculate a byte of the ECC P data
-// 86 (*2) ECC P bytes, 24 values represented by
-// each
-//-------------------------------------------------
+/**
+ * @brief -------------------------------------------------
+ * poffsets - each row represents the addresses used to calculate a byte of the ECC P
+ * data 86 (*2) ECC P bytes, 24 values represented by each
+ * -------------------------------------------------.
+ */
static const UINT16 poffsets[ECC_P_NUM_BYTES][ECC_P_COMP] =
{
@@ -1163,13 +1470,12 @@ static const UINT16 poffsets[ECC_P_NUM_BYTES][ECC_P_COMP] =
{ 0x055,0x0ab,0x101,0x157,0x1ad,0x203,0x259,0x2af,0x305,0x35b,0x3b1,0x407,0x45d,0x4b3,0x509,0x55f,0x5b5,0x60b,0x661,0x6b7,0x70d,0x763,0x7b9,0x80f }
};
-
-//-------------------------------------------------
-// qoffsets - each row represents the addresses
-// used to calculate a byte of the ECC Q data
-// 52 (*2) ECC Q bytes, 43 values represented by
-// each
-//-------------------------------------------------
+/**
+ * @brief -------------------------------------------------
+ * qoffsets - each row represents the addresses used to calculate a byte of the ECC Q
+ * data 52 (*2) ECC Q bytes, 43 values represented by each
+ * -------------------------------------------------.
+ */
static const UINT16 qoffsets[ECC_Q_NUM_BYTES][ECC_Q_COMP] =
{
@@ -1240,11 +1546,19 @@ inline UINT8 ecc_source_byte(const UINT8 *sector, UINT32 offset)
return (sector[MODE_OFFSET] == 2 && offset < 4) ? 0x00 : sector[SYNC_OFFSET + SYNC_NUM_BYTES + offset];
}
-
-//-------------------------------------------------
-// ecc_compute_bytes - calculate an ECC value
-// (P or Q)
-//-------------------------------------------------
+/**
+ * @fn void ecc_compute_bytes(const UINT8 *sector, const UINT16 *row, int rowlen, UINT8 &val1, UINT8 &val2)
+ *
+ * @brief -------------------------------------------------
+ * ecc_compute_bytes - calculate an ECC value (P or Q)
+ * -------------------------------------------------.
+ *
+ * @param sector The sector.
+ * @param row The row.
+ * @param rowlen The rowlen.
+ * @param [in,out] val1 The first value.
+ * @param [in,out] val2 The second value.
+ */
void ecc_compute_bytes(const UINT8 *sector, const UINT16 *row, int rowlen, UINT8 &val1, UINT8 &val2)
{
@@ -1259,11 +1573,17 @@ void ecc_compute_bytes(const UINT8 *sector, const UINT16 *row, int rowlen, UINT8
val2 ^= val1;
}
-
-//-------------------------------------------------
-// ecc_verify - verify the P and Q ECC codes in
-// a sector
-//-------------------------------------------------
+/**
+ * @fn bool ecc_verify(const UINT8 *sector)
+ *
+ * @brief -------------------------------------------------
+ * ecc_verify - verify the P and Q ECC codes in a sector
+ * -------------------------------------------------.
+ *
+ * @param sector The sector.
+ *
+ * @return true if it succeeds, false if it fails.
+ */
bool ecc_verify(const UINT8 *sector)
{
@@ -1287,11 +1607,16 @@ bool ecc_verify(const UINT8 *sector)
return true;
}
-
-//-------------------------------------------------
-// ecc_generate - generate the P and Q ECC codes
-// for a sector, overwriting any existing codes
-//-------------------------------------------------
+/**
+ * @fn void ecc_generate(UINT8 *sector)
+ *
+ * @brief -------------------------------------------------
+ * ecc_generate - generate the P and Q ECC codes for a sector, overwriting any
+ * existing codes
+ * -------------------------------------------------.
+ *
+ * @param [in,out] sector If non-null, the sector.
+ */
void ecc_generate(UINT8 *sector)
{
@@ -1304,11 +1629,15 @@ void ecc_generate(UINT8 *sector)
ecc_compute_bytes(sector, qoffsets[byte], ECC_Q_COMP, sector[ECC_Q_OFFSET + byte], sector[ECC_Q_OFFSET + ECC_Q_NUM_BYTES + byte]);
}
-
-//-------------------------------------------------
-// ecc_clear - erase the ECC P and Q cods to 0
-// within a sector
-//-------------------------------------------------
+/**
+ * @fn void ecc_clear(UINT8 *sector)
+ *
+ * @brief -------------------------------------------------
+ * ecc_clear - erase the ECC P and Q cods to 0 within a sector
+ * -------------------------------------------------.
+ *
+ * @param [in,out] sector If non-null, the sector.
+ */
void ecc_clear(UINT8 *sector)
{
diff --git a/src/lib/util/chd.c b/src/lib/util/chd.c
index 3dd088c0121..07e98d03b85 100644
--- a/src/lib/util/chd.c
+++ b/src/lib/util/chd.c
@@ -57,23 +57,37 @@ enum
// V5 compression types
enum
{
+ ///< codec #0
// these types are live when running
- COMPRESSION_TYPE_0 = 0, // codec #0
- COMPRESSION_TYPE_1 = 1, // codec #1
- COMPRESSION_TYPE_2 = 2, // codec #2
- COMPRESSION_TYPE_3 = 3, // codec #3
- COMPRESSION_NONE = 4, // no compression; implicit length = hunkbytes
- COMPRESSION_SELF = 5, // same as another block in this chd
- COMPRESSION_PARENT = 6, // same as a hunk's worth of units in the parent chd
-
+ COMPRESSION_TYPE_0 = 0,
+ ///< codec #1
+ COMPRESSION_TYPE_1 = 1,
+ ///< codec #2
+ COMPRESSION_TYPE_2 = 2,
+ ///< codec #3
+ COMPRESSION_TYPE_3 = 3,
+ ///< no compression; implicit length = hunkbytes
+ COMPRESSION_NONE = 4,
+ ///< same as another block in this chd
+ COMPRESSION_SELF = 5,
+ ///< same as a hunk's worth of units in the parent chd
+ COMPRESSION_PARENT = 6,
+
+ ///< start of small RLE run (4-bit length)
// these additional pseudo-types are used for compressed encodings:
- COMPRESSION_RLE_SMALL, // start of small RLE run (4-bit length)
- COMPRESSION_RLE_LARGE, // start of large RLE run (8-bit length)
- COMPRESSION_SELF_0, // same as the last COMPRESSION_SELF block
- COMPRESSION_SELF_1, // same as the last COMPRESSION_SELF block + 1
- COMPRESSION_PARENT_SELF, // same block in the parent
- COMPRESSION_PARENT_0, // same as the last COMPRESSION_PARENT block
- COMPRESSION_PARENT_1 // same as the last COMPRESSION_PARENT block + 1
+ COMPRESSION_RLE_SMALL,
+ ///< start of large RLE run (8-bit length)
+ COMPRESSION_RLE_LARGE,
+ ///< same as the last COMPRESSION_SELF block
+ COMPRESSION_SELF_0,
+ ///< same as the last COMPRESSION_SELF block + 1
+ COMPRESSION_SELF_1,
+ ///< same block in the parent
+ COMPRESSION_PARENT_SELF,
+ ///< same as the last COMPRESSION_PARENT block
+ COMPRESSION_PARENT_0,
+ ///< same as the last COMPRESSION_PARENT block + 1
+ COMPRESSION_PARENT_1
};
@@ -265,9 +279,13 @@ inline UINT8 chd_file::bits_for_value(UINT64 value)
// CHD FILE MANAGEMENT
//**************************************************************************
-//-------------------------------------------------
-// chd_file - constructor
-//-------------------------------------------------
+/**
+ * @fn chd_file::chd_file()
+ *
+ * @brief -------------------------------------------------
+ * chd_file - constructor
+ * -------------------------------------------------.
+ */
chd_file::chd_file()
: m_file(NULL),
@@ -278,10 +296,13 @@ chd_file::chd_file()
close();
}
-
-//-------------------------------------------------
-// ~chd_file - destructor
-//-------------------------------------------------
+/**
+ * @fn chd_file::~chd_file()
+ *
+ * @brief -------------------------------------------------
+ * ~chd_file - destructor
+ * -------------------------------------------------.
+ */
chd_file::~chd_file()
{
@@ -289,10 +310,15 @@ chd_file::~chd_file()
close();
}
-
-//-------------------------------------------------
-// sha1 - return our SHA1 value
-//-------------------------------------------------
+/**
+ * @fn sha1_t chd_file::sha1()
+ *
+ * @brief -------------------------------------------------
+ * sha1 - return our SHA1 value
+ * -------------------------------------------------.
+ *
+ * @return A sha1_t.
+ */
sha1_t chd_file::sha1()
{
@@ -310,10 +336,18 @@ sha1_t chd_file::sha1()
}
}
-
-//-------------------------------------------------
-// raw_sha1 - return our raw SHA1 value
-//-------------------------------------------------
+/**
+ * @fn sha1_t chd_file::raw_sha1()
+ *
+ * @brief -------------------------------------------------
+ * raw_sha1 - return our raw SHA1 value
+ * -------------------------------------------------.
+ *
+ * @exception CHDERR_UNSUPPORTED_VERSION Thrown when a chderr unsupported version error
+ * condition occurs.
+ *
+ * @return A sha1_t.
+ */
sha1_t chd_file::raw_sha1()
{
@@ -335,10 +369,18 @@ sha1_t chd_file::raw_sha1()
}
}
-
-//-------------------------------------------------
-// parent_sha1 - return our parent's SHA1 value
-//-------------------------------------------------
+/**
+ * @fn sha1_t chd_file::parent_sha1()
+ *
+ * @brief -------------------------------------------------
+ * parent_sha1 - return our parent's SHA1 value
+ * -------------------------------------------------.
+ *
+ * @exception CHDERR_UNSUPPORTED_VERSION Thrown when a chderr unsupported version error
+ * condition occurs.
+ *
+ * @return A sha1_t.
+ */
sha1_t chd_file::parent_sha1()
{
@@ -360,11 +402,19 @@ sha1_t chd_file::parent_sha1()
}
}
-
-//-------------------------------------------------
-// hunk_info - return information about this
-// hunk
-//-------------------------------------------------
+/**
+ * @fn chd_error chd_file::hunk_info(UINT32 hunknum, chd_codec_type &compressor, UINT32 &compbytes)
+ *
+ * @brief -------------------------------------------------
+ * hunk_info - return information about this hunk
+ * -------------------------------------------------.
+ *
+ * @param hunknum The hunknum.
+ * @param [in,out] compressor The compressor.
+ * @param [in,out] compbytes The compbytes.
+ *
+ * @return A chd_error.
+ */
chd_error chd_file::hunk_info(UINT32 hunknum, chd_codec_type &compressor, UINT32 &compbytes)
{
@@ -463,10 +513,15 @@ chd_error chd_file::hunk_info(UINT32 hunknum, chd_codec_type &compressor, UINT32
return CHDERR_NONE;
}
-
-//-------------------------------------------------
-// set_raw_sha1 - set our SHA1 values
-//-------------------------------------------------
+/**
+ * @fn void chd_file::set_raw_sha1(sha1_t rawdata)
+ *
+ * @brief -------------------------------------------------
+ * set_raw_sha1 - set our SHA1 values
+ * -------------------------------------------------.
+ *
+ * @param rawdata The rawdata.
+ */
void chd_file::set_raw_sha1(sha1_t rawdata)
{
@@ -484,10 +539,17 @@ void chd_file::set_raw_sha1(sha1_t rawdata)
metadata_update_hash();
}
-
-//-------------------------------------------------
-// set_parent_sha1 - set the parent SHA1 value
-//-------------------------------------------------
+/**
+ * @fn void chd_file::set_parent_sha1(sha1_t parent)
+ *
+ * @brief -------------------------------------------------
+ * set_parent_sha1 - set the parent SHA1 value
+ * -------------------------------------------------.
+ *
+ * @exception CHDERR_INVALID_FILE Thrown when a chderr invalid file error condition occurs.
+ *
+ * @param parent The parent.
+ */
void chd_file::set_parent_sha1(sha1_t parent)
{
@@ -504,11 +566,21 @@ void chd_file::set_parent_sha1(sha1_t parent)
file_write(m_parentsha1_offset, rawbuf, sizeof(rawbuf));
}
-
-//-------------------------------------------------
-// create - create a new file with no parent
-// using an existing opened file handle
-//-------------------------------------------------
+/**
+ * @fn chd_error chd_file::create(core_file &file, UINT64 logicalbytes, UINT32 hunkbytes, UINT32 unitbytes, chd_codec_type compression[4])
+ *
+ * @brief -------------------------------------------------
+ * create - create a new file with no parent using an existing opened file handle
+ * -------------------------------------------------.
+ *
+ * @param [in,out] file The file.
+ * @param logicalbytes The logicalbytes.
+ * @param hunkbytes The hunkbytes.
+ * @param unitbytes The unitbytes.
+ * @param compression The compression.
+ *
+ * @return A chd_error.
+ */
chd_error chd_file::create(core_file &file, UINT64 logicalbytes, UINT32 hunkbytes, UINT32 unitbytes, chd_codec_type compression[4])
{
@@ -529,11 +601,21 @@ chd_error chd_file::create(core_file &file, UINT64 logicalbytes, UINT32 hunkbyte
return create_common();
}
-
-//-------------------------------------------------
-// create - create a new file with a parent
-// using an existing opened file handle
-//-------------------------------------------------
+/**
+ * @fn chd_error chd_file::create(core_file &file, UINT64 logicalbytes, UINT32 hunkbytes, chd_codec_type compression[4], chd_file &parent)
+ *
+ * @brief -------------------------------------------------
+ * create - create a new file with a parent using an existing opened file handle
+ * -------------------------------------------------.
+ *
+ * @param [in,out] file The file.
+ * @param logicalbytes The logicalbytes.
+ * @param hunkbytes The hunkbytes.
+ * @param compression The compression.
+ * @param [in,out] parent The parent.
+ *
+ * @return A chd_error.
+ */
chd_error chd_file::create(core_file &file, UINT64 logicalbytes, UINT32 hunkbytes, chd_codec_type compression[4], chd_file &parent)
{
@@ -554,11 +636,21 @@ chd_error chd_file::create(core_file &file, UINT64 logicalbytes, UINT32 hunkbyte
return create_common();
}
-
-//-------------------------------------------------
-// create - create a new file with no parent
-// using a filename
-//-------------------------------------------------
+/**
+ * @fn chd_error chd_file::create(const char *filename, UINT64 logicalbytes, UINT32 hunkbytes, UINT32 unitbytes, chd_codec_type compression[4])
+ *
+ * @brief -------------------------------------------------
+ * create - create a new file with no parent using a filename
+ * -------------------------------------------------.
+ *
+ * @param filename Filename of the file.
+ * @param logicalbytes The logicalbytes.
+ * @param hunkbytes The hunkbytes.
+ * @param unitbytes The unitbytes.
+ * @param compression The compression.
+ *
+ * @return A chd_error.
+ */
chd_error chd_file::create(const char *filename, UINT64 logicalbytes, UINT32 hunkbytes, UINT32 unitbytes, chd_codec_type compression[4])
{
@@ -585,11 +677,21 @@ chd_error chd_file::create(const char *filename, UINT64 logicalbytes, UINT32 hun
return chderr;
}
-
-//-------------------------------------------------
-// create - create a new file with a parent
-// using a filename
-//-------------------------------------------------
+/**
+ * @fn chd_error chd_file::create(const char *filename, UINT64 logicalbytes, UINT32 hunkbytes, chd_codec_type compression[4], chd_file &parent)
+ *
+ * @brief -------------------------------------------------
+ * create - create a new file with a parent using a filename
+ * -------------------------------------------------.
+ *
+ * @param filename Filename of the file.
+ * @param logicalbytes The logicalbytes.
+ * @param hunkbytes The hunkbytes.
+ * @param compression The compression.
+ * @param [in,out] parent The parent.
+ *
+ * @return A chd_error.
+ */
chd_error chd_file::create(const char *filename, UINT64 logicalbytes, UINT32 hunkbytes, chd_codec_type compression[4], chd_file &parent)
{
@@ -616,11 +718,19 @@ chd_error chd_file::create(const char *filename, UINT64 logicalbytes, UINT32 hun
return chderr;
}
-
-//-------------------------------------------------
-// open - open an existing file for read or
-// read/write
-//-------------------------------------------------
+/**
+ * @fn chd_error chd_file::open(const char *filename, bool writeable, chd_file *parent)
+ *
+ * @brief -------------------------------------------------
+ * open - open an existing file for read or read/write
+ * -------------------------------------------------.
+ *
+ * @param filename Filename of the file.
+ * @param writeable true if writeable.
+ * @param [in,out] parent If non-null, the parent.
+ *
+ * @return A chd_error.
+ */
chd_error chd_file::open(const char *filename, bool writeable, chd_file *parent)
{
@@ -648,11 +758,19 @@ chd_error chd_file::open(const char *filename, bool writeable, chd_file *parent)
return err;
}
-
-//-------------------------------------------------
-// open - open an existing file for read or
-// read/write
-//-------------------------------------------------
+/**
+ * @fn chd_error chd_file::open(core_file &file, bool writeable, chd_file *parent)
+ *
+ * @brief -------------------------------------------------
+ * open - open an existing file for read or read/write
+ * -------------------------------------------------.
+ *
+ * @param [in,out] file The file.
+ * @param writeable true if writeable.
+ * @param [in,out] parent If non-null, the parent.
+ *
+ * @return A chd_error.
+ */
chd_error chd_file::open(core_file &file, bool writeable, chd_file *parent)
{
@@ -667,10 +785,13 @@ chd_error chd_file::open(core_file &file, bool writeable, chd_file *parent)
return open_common(writeable);
}
-
-//-------------------------------------------------
-// close - close a CHD file for access
-//-------------------------------------------------
+/**
+ * @fn void chd_file::close()
+ *
+ * @brief -------------------------------------------------
+ * close - close a CHD file for access
+ * -------------------------------------------------.
+ */
void chd_file::close()
{
@@ -719,10 +840,28 @@ void chd_file::close()
m_cachehunk = ~0;
}
-
-//-------------------------------------------------
-// read - read a single hunk from the CHD file
-//-------------------------------------------------
+/**
+ * @fn chd_error chd_file::read_hunk(UINT32 hunknum, void *buffer)
+ *
+ * @brief -------------------------------------------------
+ * read - read a single hunk from the CHD file
+ * -------------------------------------------------.
+ *
+ * @exception CHDERR_NOT_OPEN Thrown when a chderr not open error condition occurs.
+ * @exception CHDERR_HUNK_OUT_OF_RANGE Thrown when a chderr hunk out of range error
+ * condition occurs.
+ * @exception CHDERR_DECOMPRESSION_ERROR Thrown when a chderr decompression error error
+ * condition occurs.
+ * @exception CHDERR_REQUIRES_PARENT Thrown when a chderr requires parent error condition
+ * occurs.
+ * @exception CHDERR_READ_ERROR Thrown when a chderr read error error condition
+ * occurs.
+ *
+ * @param hunknum The hunknum.
+ * @param [in,out] buffer If non-null, the buffer.
+ *
+ * @return The hunk.
+ */
chd_error chd_file::read_hunk(UINT32 hunknum, void *buffer)
{
@@ -850,10 +989,24 @@ chd_error chd_file::read_hunk(UINT32 hunknum, void *buffer)
}
}
-
-//-------------------------------------------------
-// write - write a single hunk to the CHD file
-//-------------------------------------------------
+/**
+ * @fn chd_error chd_file::write_hunk(UINT32 hunknum, const void *buffer)
+ *
+ * @brief -------------------------------------------------
+ * write - write a single hunk to the CHD file
+ * -------------------------------------------------.
+ *
+ * @exception CHDERR_NOT_OPEN Thrown when a chderr not open error condition occurs.
+ * @exception CHDERR_HUNK_OUT_OF_RANGE Thrown when a chderr hunk out of range error
+ * condition occurs.
+ * @exception CHDERR_FILE_NOT_WRITEABLE Thrown when a chderr file not writeable error
+ * condition occurs.
+ *
+ * @param hunknum The hunknum.
+ * @param buffer The buffer.
+ *
+ * @return A chd_error.
+ */
chd_error chd_file::write_hunk(UINT32 hunknum, const void *buffer)
{
@@ -922,33 +1075,58 @@ chd_error chd_file::write_hunk(UINT32 hunknum, const void *buffer)
}
}
-
-//-------------------------------------------------
-// read_units - read the given number of units
-// from the CHD
-//-------------------------------------------------
+/**
+ * @fn chd_error chd_file::read_units(UINT64 unitnum, void *buffer, UINT32 count)
+ *
+ * @brief -------------------------------------------------
+ * read_units - read the given number of units from the CHD
+ * -------------------------------------------------.
+ *
+ * @param unitnum The unitnum.
+ * @param [in,out] buffer If non-null, the buffer.
+ * @param count Number of.
+ *
+ * @return The units.
+ */
chd_error chd_file::read_units(UINT64 unitnum, void *buffer, UINT32 count)
{
return read_bytes(unitnum * UINT64(m_unitbytes), buffer, count * m_unitbytes);
}
-
-//-------------------------------------------------
-// write_units - write the given number of units
-// to the CHD
-//-------------------------------------------------
+/**
+ * @fn chd_error chd_file::write_units(UINT64 unitnum, const void *buffer, UINT32 count)
+ *
+ * @brief -------------------------------------------------
+ * write_units - write the given number of units to the CHD
+ * -------------------------------------------------.
+ *
+ * @param unitnum The unitnum.
+ * @param buffer The buffer.
+ * @param count Number of.
+ *
+ * @return A chd_error.
+ */
chd_error chd_file::write_units(UINT64 unitnum, const void *buffer, UINT32 count)
{
return write_bytes(unitnum * UINT64(m_unitbytes), buffer, count * m_unitbytes);
}
-
-//-------------------------------------------------
-// read_bytes - read from the CHD at a byte level,
-// using the cache to handle partial hunks
-//-------------------------------------------------
+/**
+ * @fn chd_error chd_file::read_bytes(UINT64 offset, void *buffer, UINT32 bytes)
+ *
+ * @brief -------------------------------------------------
+ * read_bytes - read from the CHD at a byte level, using the cache to handle partial
+ * hunks
+ * -------------------------------------------------.
+ *
+ * @param offset The offset.
+ * @param [in,out] buffer If non-null, the buffer.
+ * @param bytes The bytes.
+ *
+ * @return The bytes.
+ */
chd_error chd_file::read_bytes(UINT64 offset, void *buffer, UINT32 bytes)
{
@@ -988,11 +1166,20 @@ chd_error chd_file::read_bytes(UINT64 offset, void *buffer, UINT32 bytes)
return CHDERR_NONE;
}
-
-//-------------------------------------------------
-// write_bytes - write to the CHD at a byte level,
-// using the cache to handle partial hunks
-//-------------------------------------------------
+/**
+ * @fn chd_error chd_file::write_bytes(UINT64 offset, const void *buffer, UINT32 bytes)
+ *
+ * @brief -------------------------------------------------
+ * write_bytes - write to the CHD at a byte level, using the cache to handle partial
+ * hunks
+ * -------------------------------------------------.
+ *
+ * @param offset The offset.
+ * @param buffer The buffer.
+ * @param bytes The bytes.
+ *
+ * @return A chd_error.
+ */
chd_error chd_file::write_bytes(UINT64 offset, const void *buffer, UINT32 bytes)
{
@@ -1033,11 +1220,22 @@ chd_error chd_file::write_bytes(UINT64 offset, const void *buffer, UINT32 bytes)
return CHDERR_NONE;
}
-
-//-------------------------------------------------
-// read_metadata - read the indexed metadata
-// of the given type
-//-------------------------------------------------
+/**
+ * @fn chd_error chd_file::read_metadata(chd_metadata_tag searchtag, UINT32 searchindex, std::string &output)
+ *
+ * @brief -------------------------------------------------
+ * read_metadata - read the indexed metadata of the given type
+ * -------------------------------------------------.
+ *
+ * @exception CHDERR_METADATA_NOT_FOUND Thrown when a chderr metadata not found error
+ * condition occurs.
+ *
+ * @param searchtag The searchtag.
+ * @param searchindex The searchindex.
+ * @param [in,out] output The output.
+ *
+ * @return The metadata.
+ */
chd_error chd_file::read_metadata(chd_metadata_tag searchtag, UINT32 searchindex, std::string &output)
{
@@ -1066,6 +1264,21 @@ chd_error chd_file::read_metadata(chd_metadata_tag searchtag, UINT32 searchindex
}
}
+/**
+ * @fn chd_error chd_file::read_metadata(chd_metadata_tag searchtag, UINT32 searchindex, dynamic_buffer &output)
+ *
+ * @brief Reads a metadata.
+ *
+ * @exception CHDERR_METADATA_NOT_FOUND Thrown when a chderr metadata not found error
+ * condition occurs.
+ *
+ * @param searchtag The searchtag.
+ * @param searchindex The searchindex.
+ * @param [in,out] output The output.
+ *
+ * @return The metadata.
+ */
+
chd_error chd_file::read_metadata(chd_metadata_tag searchtag, UINT32 searchindex, dynamic_buffer &output)
{
// wrap this for clean reporting
@@ -1089,6 +1302,23 @@ chd_error chd_file::read_metadata(chd_metadata_tag searchtag, UINT32 searchindex
}
}
+/**
+ * @fn chd_error chd_file::read_metadata(chd_metadata_tag searchtag, UINT32 searchindex, void *output, UINT32 outputlen, UINT32 &resultlen)
+ *
+ * @brief Reads a metadata.
+ *
+ * @exception CHDERR_METADATA_NOT_FOUND Thrown when a chderr metadata not found error
+ * condition occurs.
+ *
+ * @param searchtag The searchtag.
+ * @param searchindex The searchindex.
+ * @param [in,out] output If non-null, the output.
+ * @param outputlen The outputlen.
+ * @param [in,out] resultlen The resultlen.
+ *
+ * @return The metadata.
+ */
+
chd_error chd_file::read_metadata(chd_metadata_tag searchtag, UINT32 searchindex, void *output, UINT32 outputlen, UINT32 &resultlen)
{
// wrap this for clean reporting
@@ -1112,6 +1342,23 @@ chd_error chd_file::read_metadata(chd_metadata_tag searchtag, UINT32 searchindex
}
}
+/**
+ * @fn chd_error chd_file::read_metadata(chd_metadata_tag searchtag, UINT32 searchindex, dynamic_buffer &output, chd_metadata_tag &resulttag, UINT8 &resultflags)
+ *
+ * @brief Reads a metadata.
+ *
+ * @exception CHDERR_METADATA_NOT_FOUND Thrown when a chderr metadata not found error
+ * condition occurs.
+ *
+ * @param searchtag The searchtag.
+ * @param searchindex The searchindex.
+ * @param [in,out] output The output.
+ * @param [in,out] resulttag The resulttag.
+ * @param [in,out] resultflags The resultflags.
+ *
+ * @return The metadata.
+ */
+
chd_error chd_file::read_metadata(chd_metadata_tag searchtag, UINT32 searchindex, dynamic_buffer &output, chd_metadata_tag &resulttag, UINT8 &resultflags)
{
// wrap this for clean reporting
@@ -1137,11 +1384,21 @@ chd_error chd_file::read_metadata(chd_metadata_tag searchtag, UINT32 searchindex
}
}
-
-//-------------------------------------------------
-// write_metadata - write the indexed metadata
-// of the given type
-//-------------------------------------------------
+/**
+ * @fn chd_error chd_file::write_metadata(chd_metadata_tag metatag, UINT32 metaindex, const void *inputbuf, UINT32 inputlen, UINT8 flags)
+ *
+ * @brief -------------------------------------------------
+ * write_metadata - write the indexed metadata of the given type
+ * -------------------------------------------------.
+ *
+ * @param metatag The metatag.
+ * @param metaindex The metaindex.
+ * @param inputbuf The inputbuf.
+ * @param inputlen The inputlen.
+ * @param flags The flags.
+ *
+ * @return A chd_error.
+ */
chd_error chd_file::write_metadata(chd_metadata_tag metatag, UINT32 metaindex, const void *inputbuf, UINT32 inputlen, UINT8 flags)
{
@@ -1209,11 +1466,21 @@ chd_error chd_file::write_metadata(chd_metadata_tag metatag, UINT32 metaindex, c
}
}
-
-//-------------------------------------------------
-// delete_metadata - remove the given metadata
-// from the list
-//-------------------------------------------------
+/**
+ * @fn chd_error chd_file::delete_metadata(chd_metadata_tag metatag, UINT32 metaindex)
+ *
+ * @brief -------------------------------------------------
+ * delete_metadata - remove the given metadata from the list
+ * -------------------------------------------------.
+ *
+ * @exception CHDERR_METADATA_NOT_FOUND Thrown when a chderr metadata not found error
+ * condition occurs.
+ *
+ * @param metatag The metatag.
+ * @param metaindex The metaindex.
+ *
+ * @return A chd_error.
+ */
chd_error chd_file::delete_metadata(chd_metadata_tag metatag, UINT32 metaindex)
{
@@ -1237,11 +1504,19 @@ chd_error chd_file::delete_metadata(chd_metadata_tag metatag, UINT32 metaindex)
}
}
-
-//-------------------------------------------------
-// clone_all_metadata - clone the metadata from
-// one CHD to a second
-//-------------------------------------------------
+/**
+ * @fn chd_error chd_file::clone_all_metadata(chd_file &source)
+ *
+ * @brief -------------------------------------------------
+ * clone_all_metadata - clone the metadata from one CHD to a second
+ * -------------------------------------------------.
+ *
+ * @exception err Thrown when an error error condition occurs.
+ *
+ * @param [in,out] source Another instance to copy.
+ *
+ * @return A chd_error.
+ */
chd_error chd_file::clone_all_metadata(chd_file &source)
{
@@ -1276,12 +1551,18 @@ chd_error chd_file::clone_all_metadata(chd_file &source)
}
}
-
-//-------------------------------------------------
-// compute_overall_sha1 - iterate through the
-// metadata and compute the overall hash of the
-// CHD file
-//-------------------------------------------------
+/**
+ * @fn sha1_t chd_file::compute_overall_sha1(sha1_t rawsha1)
+ *
+ * @brief -------------------------------------------------
+ * compute_overall_sha1 - iterate through the metadata and compute the overall hash of
+ * the CHD file
+ * -------------------------------------------------.
+ *
+ * @param rawsha1 The first rawsha.
+ *
+ * @return The calculated overall sha 1.
+ */
sha1_t chd_file::compute_overall_sha1(sha1_t rawsha1)
{
@@ -1322,10 +1603,19 @@ sha1_t chd_file::compute_overall_sha1(sha1_t rawsha1)
return overall_sha1.finish();
}
-
-//-------------------------------------------------
-// codec_config - set internal codec parameters
-//-------------------------------------------------
+/**
+ * @fn chd_error chd_file::codec_configure(chd_codec_type codec, int param, void *config)
+ *
+ * @brief -------------------------------------------------
+ * codec_config - set internal codec parameters
+ * -------------------------------------------------.
+ *
+ * @param codec The codec.
+ * @param param The parameter.
+ * @param [in,out] config If non-null, the configuration.
+ *
+ * @return A chd_error.
+ */
chd_error chd_file::codec_configure(chd_codec_type codec, int param, void *config)
{
@@ -1349,11 +1639,17 @@ chd_error chd_file::codec_configure(chd_codec_type codec, int param, void *confi
}
}
-
-//-------------------------------------------------
-// error_string - return an error string for
-// the given CHD error
-//-------------------------------------------------
+/**
+ * @fn const char *chd_file::error_string(chd_error err)
+ *
+ * @brief -------------------------------------------------
+ * error_string - return an error string for the given CHD error
+ * -------------------------------------------------.
+ *
+ * @param err The error.
+ *
+ * @return null if it fails, else a char*.
+ */
const char *chd_file::error_string(chd_error err)
{
@@ -1401,10 +1697,16 @@ const char *chd_file::error_string(chd_error err)
// INTERNAL HELPERS
//**************************************************************************
-//-------------------------------------------------
-// guess_unitbytes - for older CHD formats, take
-// a guess at the bytes/unit based on metadata
-//-------------------------------------------------
+/**
+ * @fn UINT32 chd_file::guess_unitbytes()
+ *
+ * @brief -------------------------------------------------
+ * guess_unitbytes - for older CHD formats, take a guess at the bytes/unit based on
+ * metadata
+ * -------------------------------------------------.
+ *
+ * @return An UINT32.
+ */
UINT32 chd_file::guess_unitbytes()
{
@@ -1426,11 +1728,21 @@ UINT32 chd_file::guess_unitbytes()
return m_hunkbytes;
}
-
-//-------------------------------------------------
-// parse_v3_header - parse the header from a v3
-// file and configure core parameters
-//-------------------------------------------------
+/**
+ * @fn void chd_file::parse_v3_header(UINT8 *rawheader, sha1_t &parentsha1)
+ *
+ * @brief -------------------------------------------------
+ * parse_v3_header - parse the header from a v3 file and configure core parameters
+ * -------------------------------------------------.
+ *
+ * @exception CHDERR_INVALID_FILE Thrown when a chderr invalid file error condition
+ * occurs.
+ * @exception CHDERR_UNKNOWN_COMPRESSION Thrown when a chderr unknown compression error
+ * condition occurs.
+ *
+ * @param [in,out] rawheader If non-null, the rawheader.
+ * @param [in,out] parentsha1 The first parentsha.
+ */
void chd_file::parse_v3_header(UINT8 *rawheader, sha1_t &parentsha1)
{
@@ -1479,11 +1791,21 @@ void chd_file::parse_v3_header(UINT8 *rawheader, sha1_t &parentsha1)
m_unitcount = (m_logicalbytes + m_unitbytes - 1) / m_unitbytes;
}
-
-//-------------------------------------------------
-// parse_v4_header - parse the header from a v4
-// file and configure core parameters
-//-------------------------------------------------
+/**
+ * @fn void chd_file::parse_v4_header(UINT8 *rawheader, sha1_t &parentsha1)
+ *
+ * @brief -------------------------------------------------
+ * parse_v4_header - parse the header from a v4 file and configure core parameters
+ * -------------------------------------------------.
+ *
+ * @exception CHDERR_INVALID_FILE Thrown when a chderr invalid file error condition
+ * occurs.
+ * @exception CHDERR_UNKNOWN_COMPRESSION Thrown when a chderr unknown compression error
+ * condition occurs.
+ *
+ * @param [in,out] rawheader If non-null, the rawheader.
+ * @param [in,out] parentsha1 The first parentsha.
+ */
void chd_file::parse_v4_header(UINT8 *rawheader, sha1_t &parentsha1)
{
@@ -1532,11 +1854,18 @@ void chd_file::parse_v4_header(UINT8 *rawheader, sha1_t &parentsha1)
m_unitcount = (m_logicalbytes + m_unitbytes - 1) / m_unitbytes;
}
-
-//-------------------------------------------------
-// parse_v5_header - read the header from a v5
-// file and configure core parameters
-//-------------------------------------------------
+/**
+ * @fn void chd_file::parse_v5_header(UINT8 *rawheader, sha1_t &parentsha1)
+ *
+ * @brief -------------------------------------------------
+ * parse_v5_header - read the header from a v5 file and configure core parameters
+ * -------------------------------------------------.
+ *
+ * @exception CHDERR_INVALID_FILE Thrown when a chderr invalid file error condition occurs.
+ *
+ * @param [in,out] rawheader If non-null, the rawheader.
+ * @param [in,out] parentsha1 The first parentsha.
+ */
void chd_file::parse_v5_header(UINT8 *rawheader, sha1_t &parentsha1)
{
@@ -1575,11 +1904,18 @@ void chd_file::parse_v5_header(UINT8 *rawheader, sha1_t &parentsha1)
parentsha1 = be_read_sha1(&rawheader[m_parentsha1_offset]);
}
-
-//-------------------------------------------------
-// compress_v5_map - compress the v5 map and
-// write it to the end of the file
-//-------------------------------------------------
+/**
+ * @fn chd_error chd_file::compress_v5_map()
+ *
+ * @brief -------------------------------------------------
+ * compress_v5_map - compress the v5 map and write it to the end of the file
+ * -------------------------------------------------.
+ *
+ * @exception CHDERR_COMPRESSION_ERROR Thrown when a chderr compression error error
+ * condition occurs.
+ *
+ * @return A chd_error.
+ */
chd_error chd_file::compress_v5_map()
{
@@ -1782,10 +2118,16 @@ chd_error chd_file::compress_v5_map()
}
}
-
-//-------------------------------------------------
-// decompress_v5_map - decompress the v5 map
-//-------------------------------------------------
+/**
+ * @fn void chd_file::decompress_v5_map()
+ *
+ * @brief -------------------------------------------------
+ * decompress_v5_map - decompress the v5 map
+ * -------------------------------------------------.
+ *
+ * @exception CHDERR_DECOMPRESSION_ERROR Thrown when a chderr decompression error error
+ * condition occurs.
+ */
void chd_file::decompress_v5_map()
{
@@ -1900,11 +2242,22 @@ void chd_file::decompress_v5_map()
throw CHDERR_DECOMPRESSION_ERROR;
}
-
-//-------------------------------------------------
-// create_common - command path when creating a
-// new CHD file
-//-------------------------------------------------
+/**
+ * @fn chd_error chd_file::create_common()
+ *
+ * @brief -------------------------------------------------
+ * create_common - command path when creating a new CHD file
+ * -------------------------------------------------.
+ *
+ * @exception CHDERR_UNSUPPORTED_VERSION Thrown when a chderr unsupported version error
+ * condition occurs.
+ * @exception CHDERR_INVALID_PARAMETER Thrown when a chderr invalid parameter error
+ * condition occurs.
+ * @exception CHDERR_UNKNOWN_COMPRESSION Thrown when a chderr unknown compression error
+ * condition occurs.
+ *
+ * @return The new common.
+ */
chd_error chd_file::create_common()
{
@@ -1999,11 +2352,28 @@ chd_error chd_file::create_common()
return CHDERR_NONE;
}
-
-//-------------------------------------------------
-// open_common - common path when opening an
-// existing CHD file for input
-//-------------------------------------------------
+/**
+ * @fn chd_error chd_file::open_common(bool writeable)
+ *
+ * @brief -------------------------------------------------
+ * open_common - common path when opening an existing CHD file for input
+ * -------------------------------------------------.
+ *
+ * @exception CHDERR_INVALID_FILE Thrown when a chderr invalid file error condition
+ * occurs.
+ * @exception CHDERR_UNSUPPORTED_VERSION Thrown when a chderr unsupported version error
+ * condition occurs.
+ * @exception CHDERR_FILE_NOT_WRITEABLE Thrown when a chderr file not writeable error
+ * condition occurs.
+ * @exception CHDERR_INVALID_PARENT Thrown when a chderr invalid parent error condition
+ * occurs.
+ * @exception CHDERR_INVALID_PARAMETER Thrown when a chderr invalid parameter error
+ * condition occurs.
+ *
+ * @param writeable true if writeable.
+ *
+ * @return A chd_error.
+ */
chd_error chd_file::open_common(bool writeable)
{
@@ -2063,11 +2433,16 @@ chd_error chd_file::open_common(bool writeable)
}
}
-
-//-------------------------------------------------
-// create_open_common - common code for handling
-// creation and opening of a file
-//-------------------------------------------------
+/**
+ * @fn void chd_file::create_open_common()
+ *
+ * @brief -------------------------------------------------
+ * create_open_common - common code for handling creation and opening of a file
+ * -------------------------------------------------.
+ *
+ * @exception CHDERR_UNKNOWN_COMPRESSION Thrown when a chderr unknown compression error
+ * condition occurs.
+ */
void chd_file::create_open_common()
{
@@ -2091,12 +2466,24 @@ void chd_file::create_open_common()
m_cache.resize(m_hunkbytes);
}
-
-//-------------------------------------------------
-// verify_proper_compression_append - verify that
-// the given hunk is a proper candidate for
-// appending to a compressed CHD
-//-------------------------------------------------
+/**
+ * @fn void chd_file::verify_proper_compression_append(UINT32 hunknum)
+ *
+ * @brief -------------------------------------------------
+ * verify_proper_compression_append - verify that the given hunk is a proper candidate
+ * for appending to a compressed CHD
+ * -------------------------------------------------.
+ *
+ * @exception CHDERR_NOT_OPEN Thrown when a chderr not open error condition occurs.
+ * @exception CHDERR_HUNK_OUT_OF_RANGE Thrown when a chderr hunk out of range error
+ * condition occurs.
+ * @exception CHDERR_FILE_NOT_WRITEABLE Thrown when a chderr file not writeable error
+ * condition occurs.
+ * @exception CHDERR_COMPRESSION_ERROR Thrown when a chderr compression error error
+ * condition occurs.
+ *
+ * @param hunknum The hunknum.
+ */
void chd_file::verify_proper_compression_append(UINT32 hunknum)
{
@@ -2127,12 +2514,20 @@ void chd_file::verify_proper_compression_append(UINT32 hunknum)
throw CHDERR_COMPRESSION_ERROR;
}
-
-//-------------------------------------------------
-// hunk_write_compressed - write a hunk to a
-// compressed CHD, discovering the best
-// technique
-//-------------------------------------------------
+/**
+ * @fn void chd_file::hunk_write_compressed(UINT32 hunknum, INT8 compression, const UINT8 *compressed, UINT32 complength, crc16_t crc16)
+ *
+ * @brief -------------------------------------------------
+ * hunk_write_compressed - write a hunk to a compressed CHD, discovering the best
+ * technique
+ * -------------------------------------------------.
+ *
+ * @param hunknum The hunknum.
+ * @param compression The compression.
+ * @param compressed The compressed.
+ * @param complength The complength.
+ * @param crc16 The CRC 16.
+ */
void chd_file::hunk_write_compressed(UINT32 hunknum, INT8 compression, const UINT8 *compressed, UINT32 complength, crc16_t crc16)
{
@@ -2150,11 +2545,19 @@ void chd_file::hunk_write_compressed(UINT32 hunknum, INT8 compression, const UIN
be_write(&rawmap[10], crc16, 2);
}
-
-//-------------------------------------------------
-// hunk_copy_from_self - mark a hunk as being a
-// copy of another hunk in the same CHD
-//-------------------------------------------------
+/**
+ * @fn void chd_file::hunk_copy_from_self(UINT32 hunknum, UINT32 otherhunk)
+ *
+ * @brief -------------------------------------------------
+ * hunk_copy_from_self - mark a hunk as being a copy of another hunk in the same CHD
+ * -------------------------------------------------.
+ *
+ * @exception CHDERR_INVALID_PARAMETER Thrown when a chderr invalid parameter error
+ * condition occurs.
+ *
+ * @param hunknum The hunknum.
+ * @param otherhunk The otherhunk.
+ */
void chd_file::hunk_copy_from_self(UINT32 hunknum, UINT32 otherhunk)
{
@@ -2173,11 +2576,16 @@ void chd_file::hunk_copy_from_self(UINT32 hunknum, UINT32 otherhunk)
be_write(&rawmap[10], 0, 2);
}
-
-//-------------------------------------------------
-// hunk_copy_from_parent - mark a hunk as being a
-// copy of a hunk from a parent CHD
-//-------------------------------------------------
+/**
+ * @fn void chd_file::hunk_copy_from_parent(UINT32 hunknum, UINT64 parentunit)
+ *
+ * @brief -------------------------------------------------
+ * hunk_copy_from_parent - mark a hunk as being a copy of a hunk from a parent CHD
+ * -------------------------------------------------.
+ *
+ * @param hunknum The hunknum.
+ * @param parentunit The parentunit.
+ */
void chd_file::hunk_copy_from_parent(UINT32 hunknum, UINT64 parentunit)
{
@@ -2192,10 +2600,20 @@ void chd_file::hunk_copy_from_parent(UINT32 hunknum, UINT64 parentunit)
be_write(&rawmap[10], 0, 2);
}
-
-//-------------------------------------------------
-// metadata_find - find a metadata entry
-//-------------------------------------------------
+/**
+ * @fn bool chd_file::metadata_find(chd_metadata_tag metatag, INT32 metaindex, metadata_entry &metaentry, bool resume)
+ *
+ * @brief -------------------------------------------------
+ * metadata_find - find a metadata entry
+ * -------------------------------------------------.
+ *
+ * @param metatag The metatag.
+ * @param metaindex The metaindex.
+ * @param [in,out] metaentry The metaentry.
+ * @param resume true to resume.
+ *
+ * @return true if it succeeds, false if it fails.
+ */
bool chd_file::metadata_find(chd_metadata_tag metatag, INT32 metaindex, metadata_entry &metaentry, bool resume)
{
@@ -2238,11 +2656,16 @@ bool chd_file::metadata_find(chd_metadata_tag metatag, INT32 metaindex, metadata
return false;
}
-
-//-------------------------------------------------
-// metadata_set_previous_next - set the 'next'
-// offset of a piece of metadata
-//-------------------------------------------------
+/**
+ * @fn void chd_file::metadata_set_previous_next(UINT64 prevoffset, UINT64 nextoffset)
+ *
+ * @brief -------------------------------------------------
+ * metadata_set_previous_next - set the 'next' offset of a piece of metadata
+ * -------------------------------------------------.
+ *
+ * @param prevoffset The prevoffset.
+ * @param nextoffset The nextoffset.
+ */
void chd_file::metadata_set_previous_next(UINT64 prevoffset, UINT64 nextoffset)
{
@@ -2267,11 +2690,13 @@ void chd_file::metadata_set_previous_next(UINT64 prevoffset, UINT64 nextoffset)
file_write(offset, rawbuf, sizeof(rawbuf));
}
-
-//-------------------------------------------------
-// metadata_update_hash - compute the SHA1
-// hash of all metadata that requests it
-//-------------------------------------------------
+/**
+ * @fn void chd_file::metadata_update_hash()
+ *
+ * @brief -------------------------------------------------
+ * metadata_update_hash - compute the SHA1 hash of all metadata that requests it
+ * -------------------------------------------------.
+ */
void chd_file::metadata_update_hash()
{
@@ -2290,11 +2715,18 @@ void chd_file::metadata_update_hash()
file_write(m_sha1_offset, rawbuf, sizeof(rawbuf));
}
-
-//-------------------------------------------------
-// metadata_hash_compare - compare two hash
-// entries
-//-------------------------------------------------
+/**
+ * @fn int CLIB_DECL chd_file::metadata_hash_compare(const void *elem1, const void *elem2)
+ *
+ * @brief -------------------------------------------------
+ * metadata_hash_compare - compare two hash entries
+ * -------------------------------------------------.
+ *
+ * @param elem1 The first element.
+ * @param elem2 The second element.
+ *
+ * @return A CLIB_DECL.
+ */
int CLIB_DECL chd_file::metadata_hash_compare(const void *elem1, const void *elem2)
{
@@ -2307,9 +2739,13 @@ int CLIB_DECL chd_file::metadata_hash_compare(const void *elem1, const void *ele
// CHD COMPRESSOR
//**************************************************************************
-//-------------------------------------------------
-// chd_file_compressor - constructor
-//-------------------------------------------------
+/**
+ * @fn chd_file_compressor::chd_file_compressor()
+ *
+ * @brief -------------------------------------------------
+ * chd_file_compressor - constructor
+ * -------------------------------------------------.
+ */
chd_file_compressor::chd_file_compressor()
: m_walking_parent(false),
@@ -2330,10 +2766,13 @@ chd_file_compressor::chd_file_compressor()
m_work_queue = osd_work_queue_alloc(WORK_QUEUE_FLAG_MULTI);
}
-
-//-------------------------------------------------
-// ~chd_file_compressor - destructor
-//-------------------------------------------------
+/**
+ * @fn chd_file_compressor::~chd_file_compressor()
+ *
+ * @brief -------------------------------------------------
+ * ~chd_file_compressor - destructor
+ * -------------------------------------------------.
+ */
chd_file_compressor::~chd_file_compressor()
{
@@ -2346,10 +2785,13 @@ chd_file_compressor::~chd_file_compressor()
delete m_codecs[codecnum];
}
-
-//-------------------------------------------------
-// compress_begin - initiate compression
-//-------------------------------------------------
+/**
+ * @fn void chd_file_compressor::compress_begin()
+ *
+ * @brief -------------------------------------------------
+ * compress_begin - initiate compression
+ * -------------------------------------------------.
+ */
void chd_file_compressor::compress_begin()
{
@@ -2392,10 +2834,18 @@ void chd_file_compressor::compress_begin()
m_write_hunk = 0;
}
-
-//-------------------------------------------------
-// compress_continue - continue compression
-//-------------------------------------------------
+/**
+ * @fn chd_error chd_file_compressor::compress_continue(double &progress, double &ratio)
+ *
+ * @brief -------------------------------------------------
+ * compress_continue - continue compression
+ * -------------------------------------------------.
+ *
+ * @param [in,out] progress The progress.
+ * @param [in,out] ratio The ratio.
+ *
+ * @return A chd_error.
+ */
chd_error chd_file_compressor::compress_continue(double &progress, double &ratio)
{
@@ -2538,11 +2988,18 @@ chd_error chd_file_compressor::compress_continue(double &progress, double &ratio
return m_walking_parent ? CHDERR_WALKING_PARENT : CHDERR_COMPRESSING;
}
-
-//-------------------------------------------------
-// async_walk_parent - handle asynchronous parent
-// walking operations
-//-------------------------------------------------
+/**
+ * @fn void *chd_file_compressor::async_walk_parent_static(void *param, int threadid)
+ *
+ * @brief -------------------------------------------------
+ * async_walk_parent - handle asynchronous parent walking operations
+ * -------------------------------------------------.
+ *
+ * @param [in,out] param If non-null, the parameter.
+ * @param threadid The threadid.
+ *
+ * @return null if it fails, else a void*.
+ */
void *chd_file_compressor::async_walk_parent_static(void *param, int threadid)
{
@@ -2551,6 +3008,14 @@ void *chd_file_compressor::async_walk_parent_static(void *param, int threadid)
return NULL;
}
+/**
+ * @fn void chd_file_compressor::async_walk_parent(work_item &item)
+ *
+ * @brief Asynchronous walk parent.
+ *
+ * @param [in,out] item The item.
+ */
+
void chd_file_compressor::async_walk_parent(work_item &item)
{
// compute CRC-16 and SHA-1 hashes for each unit, unless we're the last one or we're uncompressed
@@ -2565,11 +3030,18 @@ void chd_file_compressor::async_walk_parent(work_item &item)
atomic_exchange32(&item.m_status, WS_COMPLETE);
}
-
-//-------------------------------------------------
-// async_compress_hunk - handle asynchronous
-// hunk compression
-//-------------------------------------------------
+/**
+ * @fn void *chd_file_compressor::async_compress_hunk_static(void *param, int threadid)
+ *
+ * @brief -------------------------------------------------
+ * async_compress_hunk - handle asynchronous hunk compression
+ * -------------------------------------------------.
+ *
+ * @param [in,out] param If non-null, the parameter.
+ * @param threadid The threadid.
+ *
+ * @return null if it fails, else a void*.
+ */
void *chd_file_compressor::async_compress_hunk_static(void *param, int threadid)
{
@@ -2578,6 +3050,15 @@ void *chd_file_compressor::async_compress_hunk_static(void *param, int threadid)
return NULL;
}
+/**
+ * @fn void chd_file_compressor::async_compress_hunk(work_item &item, int threadid)
+ *
+ * @brief Asynchronous compress hunk.
+ *
+ * @param [in,out] item The item.
+ * @param threadid The threadid.
+ */
+
void chd_file_compressor::async_compress_hunk(work_item &item, int threadid)
{
// use our thread's codec
@@ -2599,11 +3080,18 @@ void chd_file_compressor::async_compress_hunk(work_item &item, int threadid)
atomic_exchange32(&item.m_status, WS_COMPLETE);
}
-
-//-------------------------------------------------
-// async_read - handle asynchronous source file
-// reading
-//-------------------------------------------------
+/**
+ * @fn void *chd_file_compressor::async_read_static(void *param, int threadid)
+ *
+ * @brief -------------------------------------------------
+ * async_read - handle asynchronous source file reading
+ * -------------------------------------------------.
+ *
+ * @param [in,out] param If non-null, the parameter.
+ * @param threadid The threadid.
+ *
+ * @return null if it fails, else a void*.
+ */
void *chd_file_compressor::async_read_static(void *param, int threadid)
{
@@ -2611,6 +3099,12 @@ void *chd_file_compressor::async_read_static(void *param, int threadid)
return NULL;
}
+/**
+ * @fn void chd_file_compressor::async_read()
+ *
+ * @brief Asynchronous read.
+ */
+
void chd_file_compressor::async_read()
{
// if in the error or complete state, stop
@@ -2686,9 +3180,13 @@ void chd_file_compressor::async_read()
// CHD COMPRESSOR HASHMAP
//**************************************************************************
-//-------------------------------------------------
-// hashmap - constructor
-//-------------------------------------------------
+/**
+ * @fn chd_file_compressor::hashmap::hashmap()
+ *
+ * @brief -------------------------------------------------
+ * hashmap - constructor
+ * -------------------------------------------------.
+ */
chd_file_compressor::hashmap::hashmap()
: m_block_list(new entry_block(NULL))
@@ -2697,10 +3195,13 @@ chd_file_compressor::hashmap::hashmap()
memset(m_map, 0, sizeof(m_map));
}
-
-//-------------------------------------------------
-// ~hashmap - destructor
-//-------------------------------------------------
+/**
+ * @fn chd_file_compressor::hashmap::~hashmap()
+ *
+ * @brief -------------------------------------------------
+ * ~hashmap - destructor
+ * -------------------------------------------------.
+ */
chd_file_compressor::hashmap::~hashmap()
{
@@ -2708,10 +3209,13 @@ chd_file_compressor::hashmap::~hashmap()
delete m_block_list;
}
-
-//-------------------------------------------------
-// reset - reset the state of the map
-//-------------------------------------------------
+/**
+ * @fn void chd_file_compressor::hashmap::reset()
+ *
+ * @brief -------------------------------------------------
+ * reset - reset the state of the map
+ * -------------------------------------------------.
+ */
void chd_file_compressor::hashmap::reset()
{
@@ -2728,10 +3232,18 @@ void chd_file_compressor::hashmap::reset()
memset(m_map, 0, sizeof(m_map));
}
-
-//-------------------------------------------------
-// find - find an item in the CRC map
-//-------------------------------------------------
+/**
+ * @fn UINT64 chd_file_compressor::hashmap::find(crc16_t crc16, sha1_t sha1)
+ *
+ * @brief -------------------------------------------------
+ * find - find an item in the CRC map
+ * -------------------------------------------------.
+ *
+ * @param crc16 The CRC 16.
+ * @param sha1 The first sha.
+ *
+ * @return An UINT64.
+ */
UINT64 chd_file_compressor::hashmap::find(crc16_t crc16, sha1_t sha1)
{
@@ -2742,10 +3254,17 @@ UINT64 chd_file_compressor::hashmap::find(crc16_t crc16, sha1_t sha1)
return NOT_FOUND;
}
-
-//-------------------------------------------------
-// add - add an item to the CRC map
-//-------------------------------------------------
+/**
+ * @fn void chd_file_compressor::hashmap::add(UINT64 itemnum, crc16_t crc16, sha1_t sha1)
+ *
+ * @brief -------------------------------------------------
+ * add - add an item to the CRC map
+ * -------------------------------------------------.
+ *
+ * @param itemnum The itemnum.
+ * @param crc16 The CRC 16.
+ * @param sha1 The first sha.
+ */
void chd_file_compressor::hashmap::add(UINT64 itemnum, crc16_t crc16, sha1_t sha1)
{
diff --git a/src/lib/util/chdcd.c b/src/lib/util/chdcd.c
index a94b27c1590..e267c613d1d 100644
--- a/src/lib/util/chdcd.c
+++ b/src/lib/util/chdcd.c
@@ -21,6 +21,18 @@
CONSTANTS & DEFINES
***************************************************************************/
+/**
+ * @def TOKENIZE();
+ *
+ * @brief A macro that defines tokenize.
+ *
+ * @param linebuffer The linebuffer.
+ * @param i Zero-based index of the.
+ * @param sizeof(linebuffer) The sizeof(linebuffer)
+ * @param token The token.
+ * @param sizeof(token) The sizeof(token)
+ */
+
#define TOKENIZE i = tokenize( linebuffer, i, sizeof(linebuffer), token, sizeof(token) );
@@ -29,6 +41,7 @@
GLOBAL VARIABLES
***************************************************************************/
+/** @brief The linebuffer[ 512]. */
static char linebuffer[512];
@@ -37,6 +50,16 @@ static char linebuffer[512];
IMPLEMENTATION
***************************************************************************/
+/**
+ * @fn static std::string get_file_path(std::string &path)
+ *
+ * @brief Gets file path.
+ *
+ * @param [in,out] path Full pathname of the file.
+ *
+ * @return The file path.
+ */
+
static std::string get_file_path(std::string &path)
{
int pos = path.find_last_of('\\');
@@ -52,6 +75,16 @@ static std::string get_file_path(std::string &path)
get_file_size - get the size of a file
-------------------------------------------------*/
+/**
+ * @fn static UINT64 get_file_size(const char *filename)
+ *
+ * @brief Gets file size.
+ *
+ * @param filename Filename of the file.
+ *
+ * @return The file size.
+ */
+
static UINT64 get_file_size(const char *filename)
{
osd_file *file;
@@ -70,6 +103,20 @@ static UINT64 get_file_size(const char *filename)
tokenize - get a token from the line buffer
-------------------------------------------------*/
+/**
+ * @fn static int tokenize( const char *linebuffer, int i, int linebuffersize, char *token, int tokensize )
+ *
+ * @brief Tokenizes.
+ *
+ * @param linebuffer The linebuffer.
+ * @param i Zero-based index of the.
+ * @param linebuffersize The linebuffersize.
+ * @param [in,out] token If non-null, the token.
+ * @param tokensize The tokensize.
+ *
+ * @return An int.
+ */
+
static int tokenize( const char *linebuffer, int i, int linebuffersize, char *token, int tokensize )
{
int j = 0;
@@ -114,6 +161,16 @@ static int tokenize( const char *linebuffer, int i, int linebuffersize, char *to
msf_to_frames - convert m:s:f into a number of frames
-------------------------------------------------*/
+/**
+ * @fn static int msf_to_frames( char *token )
+ *
+ * @brief Msf to frames.
+ *
+ * @param [in,out] token If non-null, the token.
+ *
+ * @return An int.
+ */
+
static int msf_to_frames( char *token )
{
int m = 0;
@@ -140,6 +197,18 @@ static int msf_to_frames( char *token )
length in bytes of the data and the offset in
bytes to where the data starts in the file.
-------------------------------------------------*/
+
+/**
+ * @fn static UINT32 parse_wav_sample(const char *filename, UINT32 *dataoffs)
+ *
+ * @brief Parse WAV sample.
+ *
+ * @param filename Filename of the file.
+ * @param [in,out] dataoffs If non-null, the dataoffs.
+ *
+ * @return An UINT32.
+ */
+
static UINT32 parse_wav_sample(const char *filename, UINT32 *dataoffs)
{
unsigned long offset = 0;
@@ -308,6 +377,16 @@ static UINT32 parse_wav_sample(const char *filename, UINT32 *dataoffs)
return length;
}
+/**
+ * @fn UINT16 read_uint16(FILE *infile)
+ *
+ * @brief Reads uint 16.
+ *
+ * @param [in,out] infile If non-null, the infile.
+ *
+ * @return The uint 16.
+ */
+
UINT16 read_uint16(FILE *infile)
{
UINT16 res = 0;
@@ -320,6 +399,16 @@ UINT16 read_uint16(FILE *infile)
return res;
}
+/**
+ * @fn UINT32 read_uint32(FILE *infile)
+ *
+ * @brief Reads uint 32.
+ *
+ * @param [in,out] infile If non-null, the infile.
+ *
+ * @return The uint 32.
+ */
+
UINT32 read_uint32(FILE *infile)
{
UINT32 res = 0;
@@ -332,6 +421,16 @@ UINT32 read_uint32(FILE *infile)
return res;
}
+/**
+ * @fn UINT64 read_uint64(FILE *infile)
+ *
+ * @brief Reads uint 64.
+ *
+ * @param [in,out] infile If non-null, the infile.
+ *
+ * @return The uint 64.
+ */
+
UINT64 read_uint64(FILE *infile)
{
UINT64 res0 = U64(0), res1 = U64(0);
@@ -352,6 +451,18 @@ UINT64 read_uint64(FILE *infile)
chdcd_parse_nero - parse a Nero .NRG file
-------------------------------------------------*/
+/**
+ * @fn chd_error chdcd_parse_nero(const char *tocfname, cdrom_toc &outtoc, chdcd_track_input_info &outinfo)
+ *
+ * @brief Chdcd parse nero.
+ *
+ * @param tocfname The tocfname.
+ * @param [in,out] outtoc The outtoc.
+ * @param [in,out] outinfo The outinfo.
+ *
+ * @return A chd_error.
+ */
+
chd_error chdcd_parse_nero(const char *tocfname, cdrom_toc &outtoc, chdcd_track_input_info &outinfo)
{
FILE *infile;
@@ -526,6 +637,18 @@ chd_error chdcd_parse_nero(const char *tocfname, cdrom_toc &outtoc, chdcd_track_
chdcd_parse_iso - parse a .ISO file
-------------------------------------------------*/
+/**
+ * @fn chd_error chdcd_parse_iso(const char *tocfname, cdrom_toc &outtoc, chdcd_track_input_info &outinfo)
+ *
+ * @brief Chdcd parse ISO.
+ *
+ * @param tocfname The tocfname.
+ * @param [in,out] outtoc The outtoc.
+ * @param [in,out] outinfo The outinfo.
+ *
+ * @return A chd_error.
+ */
+
chd_error chdcd_parse_iso(const char *tocfname, cdrom_toc &outtoc, chdcd_track_input_info &outinfo)
{
FILE *infile;
@@ -591,6 +714,18 @@ chd_error chdcd_parse_iso(const char *tocfname, cdrom_toc &outtoc, chdcd_track_i
chdcd_parse_gdi - parse a Sega GD-ROM rip
-------------------------------------------------*/
+/**
+ * @fn static chd_error chdcd_parse_gdi(const char *tocfname, cdrom_toc &outtoc, chdcd_track_input_info &outinfo)
+ *
+ * @brief Chdcd parse GDI.
+ *
+ * @param tocfname The tocfname.
+ * @param [in,out] outtoc The outtoc.
+ * @param [in,out] outinfo The outinfo.
+ *
+ * @return A chd_error.
+ */
+
static chd_error chdcd_parse_gdi(const char *tocfname, cdrom_toc &outtoc, chdcd_track_input_info &outinfo)
{
FILE *infile;
@@ -711,6 +846,18 @@ static chd_error chdcd_parse_gdi(const char *tocfname, cdrom_toc &outtoc, chdcd_
chdcd_parse_cue - parse a CDRWin format CUE file
-------------------------------------------------*/
+/**
+ * @fn chd_error chdcd_parse_cue(const char *tocfname, cdrom_toc &outtoc, chdcd_track_input_info &outinfo)
+ *
+ * @brief Chdcd parse cue.
+ *
+ * @param tocfname The tocfname.
+ * @param [in,out] outtoc The outtoc.
+ * @param [in,out] outinfo The outinfo.
+ *
+ * @return A chd_error.
+ */
+
chd_error chdcd_parse_cue(const char *tocfname, cdrom_toc &outtoc, chdcd_track_input_info &outinfo)
{
FILE *infile;
@@ -994,6 +1141,18 @@ chd_error chdcd_parse_cue(const char *tocfname, cdrom_toc &outtoc, chdcd_track_i
chdcd_parse_toc - parse a CDRDAO format TOC file
-------------------------------------------------*/
+/**
+ * @fn chd_error chdcd_parse_toc(const char *tocfname, cdrom_toc &outtoc, chdcd_track_input_info &outinfo)
+ *
+ * @brief Chdcd parse TOC.
+ *
+ * @param tocfname The tocfname.
+ * @param [in,out] outtoc The outtoc.
+ * @param [in,out] outinfo The outinfo.
+ *
+ * @return A chd_error.
+ */
+
chd_error chdcd_parse_toc(const char *tocfname, cdrom_toc &outtoc, chdcd_track_input_info &outinfo)
{
FILE *infile;
diff --git a/src/lib/util/chdcodec.c b/src/lib/util/chdcodec.c
index 3a7781fced8..9f013609133 100644
--- a/src/lib/util/chdcodec.c
+++ b/src/lib/util/chdcodec.c
@@ -1453,10 +1453,17 @@ UINT32 chd_cd_flac_compressor::compress(const UINT8 *src, UINT32 srclen, UINT8 *
return complen;
}
-
-//-------------------------------------------------
-// blocksize - return the optimal block size
-//-------------------------------------------------
+/**
+ * @fn UINT32 chd_cd_flac_compressor::blocksize(UINT32 bytes)
+ *
+ * @brief -------------------------------------------------
+ * blocksize - return the optimal block size
+ * -------------------------------------------------.
+ *
+ * @param bytes The bytes.
+ *
+ * @return An UINT32.
+ */
UINT32 chd_cd_flac_compressor::blocksize(UINT32 bytes)
{
@@ -1473,9 +1480,19 @@ UINT32 chd_cd_flac_compressor::blocksize(UINT32 bytes)
// CD FLAC DECOMPRESSOR
//**************************************************************************
-//-------------------------------------------------
-// chd_cd_flac_decompressor - constructor
-//-------------------------------------------------
+/**
+ * @fn chd_cd_flac_decompressor::chd_cd_flac_decompressor(chd_file &chd, UINT32 hunkbytes, bool lossy)
+ *
+ * @brief -------------------------------------------------
+ * chd_cd_flac_decompressor - constructor
+ * -------------------------------------------------.
+ *
+ * @exception CHDERR_CODEC_ERROR Thrown when a chderr codec error error condition occurs.
+ *
+ * @param [in,out] chd The chd.
+ * @param hunkbytes The hunkbytes.
+ * @param lossy true to lossy.
+ */
chd_cd_flac_decompressor::chd_cd_flac_decompressor(chd_file &chd, UINT32 hunkbytes, bool lossy)
: chd_decompressor(chd, hunkbytes, lossy),
@@ -1503,21 +1520,34 @@ chd_cd_flac_decompressor::chd_cd_flac_decompressor(chd_file &chd, UINT32 hunkbyt
throw CHDERR_CODEC_ERROR;
}
-
-//-------------------------------------------------
-// ~chd_cd_flac_decompressor - destructor
-//-------------------------------------------------
+/**
+ * @fn chd_cd_flac_decompressor::~chd_cd_flac_decompressor()
+ *
+ * @brief -------------------------------------------------
+ * ~chd_cd_flac_decompressor - destructor
+ * -------------------------------------------------.
+ */
chd_cd_flac_decompressor::~chd_cd_flac_decompressor()
{
inflateEnd(&m_inflater);
}
-
-//-------------------------------------------------
-// decompress - decompress data using the FLAC
-// codec
-//-------------------------------------------------
+/**
+ * @fn void chd_cd_flac_decompressor::decompress(const UINT8 *src, UINT32 complen, UINT8 *dest, UINT32 destlen)
+ *
+ * @brief -------------------------------------------------
+ * decompress - decompress data using the FLAC codec
+ * -------------------------------------------------.
+ *
+ * @exception CHDERR_DECOMPRESSION_ERROR Thrown when a chderr decompression error error
+ * condition occurs.
+ *
+ * @param src Source for the.
+ * @param complen The complen.
+ * @param [in,out] dest If non-null, destination for the.
+ * @param destlen The destlen.
+ */
void chd_cd_flac_decompressor::decompress(const UINT8 *src, UINT32 complen, UINT8 *dest, UINT32 destlen)
{
@@ -1562,9 +1592,17 @@ void chd_cd_flac_decompressor::decompress(const UINT8 *src, UINT32 complen, UINT
// AVHUFF COMPRESSOR
//**************************************************************************
-//-------------------------------------------------
-// chd_avhuff_compressor - constructor
-//-------------------------------------------------
+/**
+ * @fn chd_avhuff_compressor::chd_avhuff_compressor(chd_file &chd, UINT32 hunkbytes, bool lossy)
+ *
+ * @brief -------------------------------------------------
+ * chd_avhuff_compressor - constructor
+ * -------------------------------------------------.
+ *
+ * @param [in,out] chd The chd.
+ * @param hunkbytes The hunkbytes.
+ * @param lossy true to lossy.
+ */
chd_avhuff_compressor::chd_avhuff_compressor(chd_file &chd, UINT32 hunkbytes, bool lossy)
: chd_compressor(chd, hunkbytes, lossy),
@@ -1581,10 +1619,24 @@ chd_avhuff_compressor::chd_avhuff_compressor(chd_file &chd, UINT32 hunkbytes, bo
}
}
-
-//-------------------------------------------------
-// compress - compress data using the A/V codec
-//-------------------------------------------------
+/**
+ * @fn UINT32 chd_avhuff_compressor::compress(const UINT8 *src, UINT32 srclen, UINT8 *dest)
+ *
+ * @brief -------------------------------------------------
+ * compress - compress data using the A/V codec
+ * -------------------------------------------------.
+ *
+ * @exception CHDERR_INVALID_DATA Thrown when a chderr invalid data error condition
+ * occurs.
+ * @exception CHDERR_COMPRESSION_ERROR Thrown when a chderr compression error error
+ * condition occurs.
+ *
+ * @param src Source for the.
+ * @param srclen The srclen.
+ * @param [in,out] dest If non-null, destination for the.
+ *
+ * @return An UINT32.
+ */
UINT32 chd_avhuff_compressor::compress(const UINT8 *src, UINT32 srclen, UINT8 *dest)
{
@@ -1609,12 +1661,18 @@ UINT32 chd_avhuff_compressor::compress(const UINT8 *src, UINT32 srclen, UINT8 *d
return complen;
}
-
-//-------------------------------------------------
-// postinit - actual initialization of avhuff
-// happens here, on the first attempt to compress
-// or decompress data
-//-------------------------------------------------
+/**
+ * @fn void chd_avhuff_compressor::postinit()
+ *
+ * @brief -------------------------------------------------
+ * postinit - actual initialization of avhuff happens here, on the first attempt to
+ * compress or decompress data
+ * -------------------------------------------------.
+ *
+ * @exception err Thrown when an error error condition occurs.
+ * @exception CHDERR_INVALID_METADATA Thrown when a chderr invalid metadata error condition
+ * occurs.
+ */
void chd_avhuff_compressor::postinit()
{
@@ -1646,20 +1704,38 @@ void chd_avhuff_compressor::postinit()
// AVHUFF DECOMPRESSOR
//**************************************************************************
-//-------------------------------------------------
-// chd_avhuff_decompressor - constructor
-//-------------------------------------------------
+/**
+ * @fn chd_avhuff_decompressor::chd_avhuff_decompressor(chd_file &chd, UINT32 hunkbytes, bool lossy)
+ *
+ * @brief -------------------------------------------------
+ * chd_avhuff_decompressor - constructor
+ * -------------------------------------------------.
+ *
+ * @param [in,out] chd The chd.
+ * @param hunkbytes The hunkbytes.
+ * @param lossy true to lossy.
+ */
chd_avhuff_decompressor::chd_avhuff_decompressor(chd_file &chd, UINT32 hunkbytes, bool lossy)
: chd_decompressor(chd, hunkbytes, lossy)
{
}
-
-//-------------------------------------------------
-// decompress - decompress data using the A/V
-// codec
-//-------------------------------------------------
+/**
+ * @fn void chd_avhuff_decompressor::decompress(const UINT8 *src, UINT32 complen, UINT8 *dest, UINT32 destlen)
+ *
+ * @brief -------------------------------------------------
+ * decompress - decompress data using the A/V codec
+ * -------------------------------------------------.
+ *
+ * @exception CHDERR_DECOMPRESSION_ERROR Thrown when a chderr decompression error error
+ * condition occurs.
+ *
+ * @param src Source for the.
+ * @param complen The complen.
+ * @param [in,out] dest If non-null, destination for the.
+ * @param destlen The destlen.
+ */
void chd_avhuff_decompressor::decompress(const UINT8 *src, UINT32 complen, UINT8 *dest, UINT32 destlen)
{
@@ -1677,11 +1753,19 @@ void chd_avhuff_decompressor::decompress(const UINT8 *src, UINT32 complen, UINT8
}
}
-
-//-------------------------------------------------
-// config - codec-specific configuration for the
-// A/V codec
-//-------------------------------------------------
+/**
+ * @fn void chd_avhuff_decompressor::configure(int param, void *config)
+ *
+ * @brief -------------------------------------------------
+ * config - codec-specific configuration for the A/V codec
+ * -------------------------------------------------.
+ *
+ * @exception CHDERR_INVALID_PARAMETER Thrown when a chderr invalid parameter error
+ * condition occurs.
+ *
+ * @param param The parameter.
+ * @param [in,out] config If non-null, the configuration.
+ */
void chd_avhuff_decompressor::configure(int param, void *config)
{
diff --git a/src/lib/util/corealloc.c b/src/lib/util/corealloc.c
index 0f752aa1b7c..a635803e463 100644
--- a/src/lib/util/corealloc.c
+++ b/src/lib/util/corealloc.c
@@ -394,11 +394,15 @@ void memory_entry::release(memory_entry *entry, const char *file, int line)
release_lock();
}
-
-//-------------------------------------------------
-// report_unfreed - print a list of unfreed
-// memory to the target file
-//-------------------------------------------------
+/**
+ * @fn void memory_entry::report_unfreed(UINT64 start)
+ *
+ * @brief -------------------------------------------------
+ * report_unfreed - print a list of unfreed memory to the target file
+ * -------------------------------------------------.
+ *
+ * @param start The start.
+ */
void memory_entry::report_unfreed(UINT64 start)
{
diff --git a/src/lib/util/corefile.c b/src/lib/util/corefile.c
index 823d37b8b55..797805ac768 100644
--- a/src/lib/util/corefile.c
+++ b/src/lib/util/corefile.c
@@ -1028,6 +1028,20 @@ static file_error osd_or_zlib_read(core_file *file, void *buffer, UINT64 offset,
handles zlib-compressed data
-------------------------------------------------*/
+/**
+ * @fn static file_error osd_or_zlib_write(core_file *file, const void *buffer, UINT64 offset, UINT32 length, UINT32 *actual)
+ *
+ * @brief OSD or zlib write.
+ *
+ * @param [in,out] file If non-null, the file.
+ * @param buffer The buffer.
+ * @param offset The offset.
+ * @param length The length.
+ * @param [in,out] actual If non-null, the actual.
+ *
+ * @return A file_error.
+ */
+
static file_error osd_or_zlib_write(core_file *file, const void *buffer, UINT64 offset, UINT32 length, UINT32 *actual)
{
/* if no compression, just pass through */
diff --git a/src/lib/util/corestr.c b/src/lib/util/corestr.c
index 8a78a672ac6..b4a75a3bc48 100644
--- a/src/lib/util/corestr.c
+++ b/src/lib/util/corestr.c
@@ -294,12 +294,34 @@ std::string strmakeupper(std::string& str)
return str;
}
+/**
+ * @fn std::string strmakelower(std::string& str)
+ *
+ * @brief Strmakelowers the given string.
+ *
+ * @param [in,out] str The string.
+ *
+ * @return A std::string.
+ */
+
std::string strmakelower(std::string& str)
{
std::transform(str.begin(), str.end(), str.begin(), ::tolower);
return str;
}
+/**
+ * @fn int strreplace(std::string &str, const std::string& search, const std::string& replace)
+ *
+ * @brief Strreplaces.
+ *
+ * @param [in,out] str The string.
+ * @param search The search.
+ * @param replace The replace.
+ *
+ * @return An int.
+ */
+
int strreplace(std::string &str, const std::string& search, const std::string& replace)
{
int searchlen = search.length();
diff --git a/src/lib/util/coreutil.c b/src/lib/util/coreutil.c
index fbc807caad3..a7c2ccb0f22 100644
--- a/src/lib/util/coreutil.c
+++ b/src/lib/util/coreutil.c
@@ -67,6 +67,18 @@ int gregorian_is_leap_year(int year)
/* months are one counted */
+
+/**
+ * @fn int gregorian_days_in_month(int month, int year)
+ *
+ * @brief Gregorian days in month.
+ *
+ * @param month The month.
+ * @param year The year.
+ *
+ * @return An int.
+ */
+
int gregorian_days_in_month(int month, int year)
{
if (month == 2)
@@ -82,6 +94,15 @@ int gregorian_days_in_month(int month, int year)
MISC
***************************************************************************/
+/**
+ * @fn void rand_memory(void *memory, size_t length)
+ *
+ * @brief Random memory.
+ *
+ * @param [in,out] memory If non-null, the memory.
+ * @param length The length.
+ */
+
void rand_memory(void *memory, size_t length)
{
static UINT32 seed = 0;
diff --git a/src/lib/util/cstrpool.c b/src/lib/util/cstrpool.c
index b77557c1056..dfb41e25232 100644
--- a/src/lib/util/cstrpool.c
+++ b/src/lib/util/cstrpool.c
@@ -70,10 +70,13 @@ bool const_string_pool::contains(const char *string)
return false;
}
-
-//-------------------------------------------------
-// pool_chunk - constructor
-//-------------------------------------------------
+/**
+ * @fn const_string_pool::pool_chunk::pool_chunk()
+ *
+ * @brief -------------------------------------------------
+ * pool_chunk - constructor
+ * -------------------------------------------------.
+ */
const_string_pool::pool_chunk::pool_chunk()
: m_next(NULL),
@@ -81,10 +84,17 @@ const_string_pool::pool_chunk::pool_chunk()
{
}
-
-//-------------------------------------------------
-// add - add a string to this pool
-//-------------------------------------------------
+/**
+ * @fn const char *const_string_pool::pool_chunk::add(const char *string)
+ *
+ * @brief -------------------------------------------------
+ * add - add a string to this pool
+ * -------------------------------------------------.
+ *
+ * @param string The string to add.
+ *
+ * @return null if it fails, else a char*.
+ */
const char *const_string_pool::pool_chunk::add(const char *string)
{
diff --git a/src/lib/util/delegate.c b/src/lib/util/delegate.c
index 6c688f72985..2245cf14bcb 100644
--- a/src/lib/util/delegate.c
+++ b/src/lib/util/delegate.c
@@ -32,11 +32,18 @@ delegate_mfp::raw_mfp_data delegate_mfp::s_null_mfp = { 0 };
#if (USE_DELEGATE_TYPE == DELEGATE_TYPE_INTERNAL)
-//-------------------------------------------------
-// delegate_convert_raw - given an object and
-// an raw function, adjust the object base and
-// return the actual final code pointer
-//-------------------------------------------------
+/**
+ * @fn delegate_generic_function delegate_mfp::convert_to_generic(delegate_generic_class *&object) const
+ *
+ * @brief -------------------------------------------------
+ * delegate_convert_raw - given an object and an raw function, adjust the object base
+ * and return the actual final code pointer
+ * -------------------------------------------------.
+ *
+ * @param [in,out] object [in,out] If non-null, the object.
+ *
+ * @return The given data converted to a generic.
+ */
delegate_generic_function delegate_mfp::convert_to_generic(delegate_generic_class *&object) const
{
diff --git a/src/lib/util/delegate.h b/src/lib/util/delegate.h
index 363163e2ccf..848e56480c9 100644
--- a/src/lib/util/delegate.h
+++ b/src/lib/util/delegate.h
@@ -95,20 +95,29 @@
#if defined(__GNUC__)
/* does not work in versions over 4.7.x of 32bit MINGW */
#if defined(__MINGW32__) && !defined(__x86_64) && defined(__i386__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)))
- #define USE_DELEGATE_TYPE DELEGATE_TYPE_COMPATIBLE
+ //#define USE_DELEGATE_TYPE DELEGATE_TYPE_COMPATIBLE
+ #define USE_DELEGATE_TYPE DELEGATE_TYPE_INTERNAL
+ #define MEMBER_ABI __thiscall
+ #define HAS_DIFFERENT_ABI 1
#elif defined(EMSCRIPTEN)
#define USE_DELEGATE_TYPE DELEGATE_TYPE_COMPATIBLE
#elif defined(__arm__) || defined(__ARMEL__)
#define USE_DELEGATE_TYPE DELEGATE_TYPE_COMPATIBLE
#else
#define USE_DELEGATE_TYPE DELEGATE_TYPE_INTERNAL
+ #define MEMBER_ABI
+ #define HAS_DIFFERENT_ABI 0
#endif
#else
#define USE_DELEGATE_TYPE DELEGATE_TYPE_COMPATIBLE
#endif
+#define USE_STATIC_DELEGATE 1
-
+#if (USE_DELEGATE_TYPE == DELEGATE_TYPE_COMPATIBLE)
+ #define MEMBER_ABI
+ #define HAS_DIFFERENT_ABI 0
+#endif
//**************************************************************************
// HELPER CLASSES
//**************************************************************************
@@ -554,7 +563,7 @@ public:
typedef typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _P3Type, _P4Type, _P5Type, _P6Type, _P7Type, _P8Type, _P9Type, _P10Type, _P11Type, _P12Type>::static_ref_func_type static_ref_func_type;
};
typedef typename traits<delegate_generic_class>::static_func_type generic_static_func;
-
+ typedef MEMBER_ABI generic_static_func generic_member_func;
// generic constructor
delegate_base()
: m_function(NULL),
@@ -646,20 +655,28 @@ public:
return (m_raw_function == rhs.m_raw_function && object() == rhs.object() && m_raw_mfp == rhs.m_raw_mfp);
}
+#define DELEGATE_CALL(x) \
+ if (is_mfp() && (HAS_DIFFERENT_ABI)) \
+ return (*reinterpret_cast<generic_member_func>(m_function)) x; \
+ else \
+ return (*m_function) x;
+ //return MEMBER_ABI (*reinpertret_cast<generic_member_func>(m_function)) x;
+
// call the function
- _ReturnType operator()() const { return (*m_function)(m_object); }
- _ReturnType operator()(_P1Type p1) const { return (*m_function)(m_object, p1); }
- _ReturnType operator()(_P1Type p1, _P2Type p2) const { return (*m_function)(m_object, p1, p2); }
- _ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3) const { return (*m_function)(m_object, p1, p2, p3); }
- _ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3, _P4Type p4) const { return (*m_function)(m_object, p1, p2, p3, p4); }
- _ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3, _P4Type p4, _P5Type p5) const { return (*m_function)(m_object, p1, p2, p3, p4, p5); }
- _ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3, _P4Type p4, _P5Type p5, _P6Type p6) const { return (*m_function)(m_object, p1, p2, p3, p4, p5, p6); }
- _ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3, _P4Type p4, _P5Type p5, _P6Type p6, _P7Type p7) const { return (*m_function)(m_object, p1, p2, p3, p4, p5, p6, p7); }
- _ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3, _P4Type p4, _P5Type p5, _P6Type p6, _P7Type p7, _P8Type p8) const { return (*m_function)(m_object, p1, p2, p3, p4, p5, p6, p7, p8); }
- _ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3, _P4Type p4, _P5Type p5, _P6Type p6, _P7Type p7, _P8Type p8, _P9Type p9) const { return (*m_function)(m_object, p1, p2, p3, p4, p5, p6, p7, p8, p9); }
- _ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3, _P4Type p4, _P5Type p5, _P6Type p6, _P7Type p7, _P8Type p8, _P9Type p9, _P10Type p10) const { return (*m_function)(m_object, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10); }
- _ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3, _P4Type p4, _P5Type p5, _P6Type p6, _P7Type p7, _P8Type p8, _P9Type p9, _P10Type p10, _P11Type p11) const { return (*m_function)(m_object, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11); }
- _ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3, _P4Type p4, _P5Type p5, _P6Type p6, _P7Type p7, _P8Type p8, _P9Type p9, _P10Type p10, _P11Type p11, _P12Type p12) const { return (*m_function)(m_object, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12); }
+ _ReturnType operator()() const { DELEGATE_CALL((m_object)); }
+ //_ReturnType operator()() const { return (*m_function)(m_object); }
+ _ReturnType operator()(_P1Type p1) const { DELEGATE_CALL((m_object, p1)); }
+ _ReturnType operator()(_P1Type p1, _P2Type p2) const { DELEGATE_CALL((m_object, p1, p2)); }
+ _ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3) const { DELEGATE_CALL((m_object, p1, p2, p3)); }
+ _ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3, _P4Type p4) const { DELEGATE_CALL((m_object, p1, p2, p3, p4)); }
+ _ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3, _P4Type p4, _P5Type p5) const { DELEGATE_CALL((m_object, p1, p2, p3, p4, p5)); }
+ _ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3, _P4Type p4, _P5Type p5, _P6Type p6) const { DELEGATE_CALL((m_object, p1, p2, p3, p4, p5, p6)); }
+ _ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3, _P4Type p4, _P5Type p5, _P6Type p6, _P7Type p7) const { DELEGATE_CALL((m_object, p1, p2, p3, p4, p5, p6, p7)); }
+ _ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3, _P4Type p4, _P5Type p5, _P6Type p6, _P7Type p7, _P8Type p8) const { DELEGATE_CALL((m_object, p1, p2, p3, p4, p5, p6, p7, p8)); }
+ _ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3, _P4Type p4, _P5Type p5, _P6Type p6, _P7Type p7, _P8Type p8, _P9Type p9) const { DELEGATE_CALL((m_object, p1, p2, p3, p4, p5, p6, p7, p8, p9)); }
+ _ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3, _P4Type p4, _P5Type p5, _P6Type p6, _P7Type p7, _P8Type p8, _P9Type p9, _P10Type p10) const { DELEGATE_CALL((m_object, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10)); }
+ _ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3, _P4Type p4, _P5Type p5, _P6Type p6, _P7Type p7, _P8Type p8, _P9Type p9, _P10Type p10, _P11Type p11) const { DELEGATE_CALL((m_object, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11)); }
+ _ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3, _P4Type p4, _P5Type p5, _P6Type p6, _P7Type p7, _P8Type p8, _P9Type p9, _P10Type p10, _P11Type p11, _P12Type p12) const { DELEGATE_CALL((m_object, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12)); }
// getters
bool has_object() const { return (object() != NULL); }
@@ -732,8 +749,10 @@ public:
delegate(const basetype &src) : basetype(src) { }
delegate(const basetype &src, delegate_late_bind &object) : basetype(src, object) { }
template<class _FunctionClass> delegate(typename basetype::template traits<_FunctionClass>::member_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { }
+#ifdef USE_STATIC_DELEGATE
template<class _FunctionClass> delegate(typename basetype::template traits<_FunctionClass>::static_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { }
template<class _FunctionClass> delegate(typename basetype::template traits<_FunctionClass>::static_ref_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { }
+#endif
delegate &operator=(const basetype &src) { *static_cast<basetype *>(this) = src; return *this; }
};
@@ -749,8 +768,10 @@ public:
delegate(const basetype &src) : basetype(src) { }
delegate(const basetype &src, delegate_late_bind &object) : basetype(src, object) { }
template<class _FunctionClass> delegate(typename basetype::template traits<_FunctionClass>::member_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { }
+#ifdef USE_STATIC_DELEGATE
template<class _FunctionClass> delegate(typename basetype::template traits<_FunctionClass>::static_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { }
template<class _FunctionClass> delegate(typename basetype::template traits<_FunctionClass>::static_ref_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { }
+#endif
delegate &operator=(const basetype &src) { *static_cast<basetype *>(this) = src; return *this; }
};
@@ -766,8 +787,10 @@ public:
delegate(const basetype &src) : basetype(src) { }
delegate(const basetype &src, delegate_late_bind &object) : basetype(src, object) { }
template<class _FunctionClass> delegate(typename basetype::template traits<_FunctionClass>::member_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { }
+#ifdef USE_STATIC_DELEGATE
template<class _FunctionClass> delegate(typename basetype::template traits<_FunctionClass>::static_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { }
template<class _FunctionClass> delegate(typename basetype::template traits<_FunctionClass>::static_ref_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { }
+#endif
delegate &operator=(const basetype &src) { *static_cast<basetype *>(this) = src; return *this; }
};
@@ -783,8 +806,10 @@ public:
delegate(const basetype &src) : basetype(src) { }
delegate(const basetype &src, delegate_late_bind &object) : basetype(src, object) { }
template<class _FunctionClass> delegate(typename basetype::template traits<_FunctionClass>::member_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { }
+#ifdef USE_STATIC_DELEGATE
template<class _FunctionClass> delegate(typename basetype::template traits<_FunctionClass>::static_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { }
template<class _FunctionClass> delegate(typename basetype::template traits<_FunctionClass>::static_ref_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { }
+#endif
delegate &operator=(const basetype &src) { *static_cast<basetype *>(this) = src; return *this; }
};
@@ -800,8 +825,10 @@ public:
delegate(const basetype &src) : basetype(src) { }
delegate(const basetype &src, delegate_late_bind &object) : basetype(src, object) { }
template<class _FunctionClass> delegate(typename basetype::template traits<_FunctionClass>::member_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { }
+#ifdef USE_STATIC_DELEGATE
template<class _FunctionClass> delegate(typename basetype::template traits<_FunctionClass>::static_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { }
template<class _FunctionClass> delegate(typename basetype::template traits<_FunctionClass>::static_ref_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { }
+#endif
delegate &operator=(const basetype &src) { *static_cast<basetype *>(this) = src; return *this; }
};
@@ -817,8 +844,10 @@ public:
delegate(const basetype &src) : basetype(src) { }
delegate(const basetype &src, delegate_late_bind &object) : basetype(src, object) { }
template<class _FunctionClass> delegate(typename basetype::template traits<_FunctionClass>::member_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { }
+#ifdef USE_STATIC_DELEGATE
template<class _FunctionClass> delegate(typename basetype::template traits<_FunctionClass>::static_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { }
template<class _FunctionClass> delegate(typename basetype::template traits<_FunctionClass>::static_ref_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { }
+#endif
delegate &operator=(const basetype &src) { *static_cast<basetype *>(this) = src; return *this; }
};
@@ -834,8 +863,10 @@ public:
delegate(const basetype &src) : basetype(src) { }
delegate(const basetype &src, delegate_late_bind &object) : basetype(src, object) { }
template<class _FunctionClass> delegate(typename basetype::template traits<_FunctionClass>::member_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { }
+#ifdef USE_STATIC_DELEGATE
template<class _FunctionClass> delegate(typename basetype::template traits<_FunctionClass>::static_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { }
template<class _FunctionClass> delegate(typename basetype::template traits<_FunctionClass>::static_ref_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { }
+#endif
delegate &operator=(const basetype &src) { *static_cast<basetype *>(this) = src; return *this; }
};
@@ -851,8 +882,10 @@ public:
delegate(const basetype &src) : basetype(src) { }
delegate(const basetype &src, delegate_late_bind &object) : basetype(src, object) { }
template<class _FunctionClass> delegate(typename basetype::template traits<_FunctionClass>::member_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { }
+#ifdef USE_STATIC_DELEGATE
template<class _FunctionClass> delegate(typename basetype::template traits<_FunctionClass>::static_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { }
template<class _FunctionClass> delegate(typename basetype::template traits<_FunctionClass>::static_ref_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { }
+#endif
delegate &operator=(const basetype &src) { *static_cast<basetype *>(this) = src; return *this; }
};
@@ -868,8 +901,10 @@ public:
delegate(const basetype &src) : basetype(src) { }
delegate(const basetype &src, delegate_late_bind &object) : basetype(src, object) { }
template<class _FunctionClass> delegate(typename basetype::template traits<_FunctionClass>::member_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { }
+#ifdef USE_STATIC_DELEGATE
template<class _FunctionClass> delegate(typename basetype::template traits<_FunctionClass>::static_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { }
template<class _FunctionClass> delegate(typename basetype::template traits<_FunctionClass>::static_ref_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { }
+#endif
delegate &operator=(const basetype &src) { *static_cast<basetype *>(this) = src; return *this; }
};
@@ -885,8 +920,10 @@ public:
delegate(const basetype &src) : basetype(src) { }
delegate(const basetype &src, delegate_late_bind &object) : basetype(src, object) { }
template<class _FunctionClass> delegate(typename basetype::template traits<_FunctionClass>::member_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { }
+#ifdef USE_STATIC_DELEGATE
template<class _FunctionClass> delegate(typename basetype::template traits<_FunctionClass>::static_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { }
template<class _FunctionClass> delegate(typename basetype::template traits<_FunctionClass>::static_ref_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { }
+#endif
delegate &operator=(const basetype &src) { *static_cast<basetype *>(this) = src; return *this; }
};
@@ -902,8 +939,10 @@ public:
delegate(const basetype &src) : basetype(src) { }
delegate(const basetype &src, delegate_late_bind &object) : basetype(src, object) { }
template<class _FunctionClass> delegate(typename basetype::template traits<_FunctionClass>::member_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { }
+#ifdef USE_STATIC_DELEGATE
template<class _FunctionClass> delegate(typename basetype::template traits<_FunctionClass>::static_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { }
template<class _FunctionClass> delegate(typename basetype::template traits<_FunctionClass>::static_ref_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { }
+#endif
delegate &operator=(const basetype &src) { *static_cast<basetype *>(this) = src; return *this; }
};
@@ -919,8 +958,10 @@ public:
delegate(const basetype &src) : basetype(src) { }
delegate(const basetype &src, delegate_late_bind &object) : basetype(src, object) { }
template<class _FunctionClass> delegate(typename basetype::template traits<_FunctionClass>::member_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { }
+#ifdef USE_STATIC_DELEGATE
template<class _FunctionClass> delegate(typename basetype::template traits<_FunctionClass>::static_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { }
template<class _FunctionClass> delegate(typename basetype::template traits<_FunctionClass>::static_ref_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { }
+#endif
delegate &operator=(const basetype &src) { *static_cast<basetype *>(this) = src; return *this; }
};
@@ -936,8 +977,10 @@ public:
delegate(const basetype &src) : basetype(src) { }
delegate(const basetype &src, delegate_late_bind &object) : basetype(src, object) { }
template<class _FunctionClass> delegate(typename basetype::template traits<_FunctionClass>::member_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { }
+#ifdef USE_STATIC_DELEGATE
template<class _FunctionClass> delegate(typename basetype::template traits<_FunctionClass>::static_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { }
template<class _FunctionClass> delegate(typename basetype::template traits<_FunctionClass>::static_ref_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { }
+#endif
delegate &operator=(const basetype &src) { *static_cast<basetype *>(this) = src; return *this; }
};
diff --git a/src/lib/util/flac.c b/src/lib/util/flac.c
index d2f576e637e..49fc667a184 100644
--- a/src/lib/util/flac.c
+++ b/src/lib/util/flac.c
@@ -608,10 +608,17 @@ FLAC__StreamDecoderWriteStatus flac_decoder::write_callback(const ::FLAC__Frame
return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;
}
-
-//-------------------------------------------------
-// error_callback - handle errors (ignore them)
-//-------------------------------------------------
+/**
+ * @fn void flac_decoder::error_callback_static(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data)
+ *
+ * @brief -------------------------------------------------
+ * error_callback - handle errors (ignore them)
+ * -------------------------------------------------.
+ *
+ * @param decoder The decoder.
+ * @param status The status.
+ * @param [in,out] client_data If non-null, information describing the client.
+ */
void flac_decoder::error_callback_static(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data)
{
diff --git a/src/lib/util/harddisk.c b/src/lib/util/harddisk.c
index 4760a5fd51f..b1082f3234f 100644
--- a/src/lib/util/harddisk.c
+++ b/src/lib/util/harddisk.c
@@ -97,6 +97,16 @@ chd_file *hard_disk_get_chd(hard_disk_file *file)
a hard disk
-------------------------------------------------*/
+/**
+ * @fn hard_disk_info *hard_disk_get_info(hard_disk_file *file)
+ *
+ * @brief Hard disk get information.
+ *
+ * @param [in,out] file If non-null, the file.
+ *
+ * @return null if it fails, else a hard_disk_info*.
+ */
+
hard_disk_info *hard_disk_get_info(hard_disk_file *file)
{
return &file->info;
@@ -108,6 +118,18 @@ hard_disk_info *hard_disk_get_info(hard_disk_file *file)
disk
-------------------------------------------------*/
+/**
+ * @fn UINT32 hard_disk_read(hard_disk_file *file, UINT32 lbasector, void *buffer)
+ *
+ * @brief Hard disk read.
+ *
+ * @param [in,out] file If non-null, the file.
+ * @param lbasector The lbasector.
+ * @param [in,out] buffer If non-null, the buffer.
+ *
+ * @return An UINT32.
+ */
+
UINT32 hard_disk_read(hard_disk_file *file, UINT32 lbasector, void *buffer)
{
chd_error err = file->chd->read_units(lbasector, buffer);
@@ -120,6 +142,18 @@ UINT32 hard_disk_read(hard_disk_file *file, UINT32 lbasector, void *buffer)
disk
-------------------------------------------------*/
+/**
+ * @fn UINT32 hard_disk_write(hard_disk_file *file, UINT32 lbasector, const void *buffer)
+ *
+ * @brief Hard disk write.
+ *
+ * @param [in,out] file If non-null, the file.
+ * @param lbasector The lbasector.
+ * @param buffer The buffer.
+ *
+ * @return An UINT32.
+ */
+
UINT32 hard_disk_write(hard_disk_file *file, UINT32 lbasector, const void *buffer)
{
chd_error err = file->chd->write_units(lbasector, buffer);
diff --git a/src/lib/util/hashing.c b/src/lib/util/hashing.c
index 1481de34a12..e7f315ecc53 100644
--- a/src/lib/util/hashing.c
+++ b/src/lib/util/hashing.c
@@ -214,10 +214,17 @@ bool crc16_t::from_string(const char *string, int length)
return true;
}
-
-//-------------------------------------------------
-// as_string - convert to a string
-//-------------------------------------------------
+/**
+ * @fn const char *crc16_t::as_string(std::string &buffer) const
+ *
+ * @brief -------------------------------------------------
+ * as_string - convert to a string
+ * -------------------------------------------------.
+ *
+ * @param [in,out] buffer The buffer.
+ *
+ * @return null if it fails, else a char*.
+ */
const char *crc16_t::as_string(std::string &buffer) const
{
@@ -225,11 +232,16 @@ const char *crc16_t::as_string(std::string &buffer) const
return buffer.c_str();
}
-
-//-------------------------------------------------
-// append - hash a block of data, appending to
-// the currently-accumulated value
-//-------------------------------------------------
+/**
+ * @fn void crc16_creator::append(const void *data, UINT32 length)
+ *
+ * @brief -------------------------------------------------
+ * append - hash a block of data, appending to the currently-accumulated value
+ * -------------------------------------------------.
+ *
+ * @param data The data.
+ * @param length The length.
+ */
void crc16_creator::append(const void *data, UINT32 length)
{
diff --git a/src/lib/util/huffman.c b/src/lib/util/huffman.c
index 7e6d1906456..9205264f9eb 100644
--- a/src/lib/util/huffman.c
+++ b/src/lib/util/huffman.c
@@ -730,10 +730,20 @@ huffman_8bit_decoder::huffman_8bit_decoder()
{
}
-
-//-------------------------------------------------
-// decode - decode a full buffer
-//-------------------------------------------------
+/**
+ * @fn huffman_error huffman_8bit_decoder::decode(const UINT8 *source, UINT32 slength, UINT8 *dest, UINT32 dlength)
+ *
+ * @brief -------------------------------------------------
+ * decode - decode a full buffer
+ * -------------------------------------------------.
+ *
+ * @param source Source for the.
+ * @param slength The slength.
+ * @param [in,out] dest If non-null, destination for the.
+ * @param dlength The dlength.
+ *
+ * @return A huffman_error.
+ */
huffman_error huffman_8bit_decoder::decode(const UINT8 *source, UINT32 slength, UINT8 *dest, UINT32 dlength)
{
diff --git a/src/lib/util/jedparse.c b/src/lib/util/jedparse.c
index b8aa6d85418..9bed1164303 100644
--- a/src/lib/util/jedparse.c
+++ b/src/lib/util/jedparse.c
@@ -410,6 +410,18 @@ int jedbin_parse(const void *data, size_t length, jed_data *result)
based on the jed_data provided
-------------------------------------------------*/
+/**
+ * @fn size_t jedbin_output(const jed_data *data, void *result, size_t length)
+ *
+ * @brief Jedbin output.
+ *
+ * @param data The data.
+ * @param [out] result If non-null, the result.
+ * @param length The length.
+ *
+ * @return A size_t.
+ */
+
size_t jedbin_output(const jed_data *data, void *result, size_t length)
{
UINT8 *curdst = (UINT8 *)result;
diff --git a/src/lib/util/md5.c b/src/lib/util/md5.c
index 1fdcb26de03..3c0abb33b30 100644
--- a/src/lib/util/md5.c
+++ b/src/lib/util/md5.c
@@ -153,6 +153,16 @@ MD5Final(md5byte digest[16], struct MD5Context *ctx)
* reflect the addition of 16 longwords of new data. MD5Update blocks
* the data and converts bytes into longwords for this routine.
*/
+
+/**
+ * @fn void MD5Transform(UWORD32 buf[4], UWORD32 const in[16])
+ *
+ * @brief Md 5 transform.
+ *
+ * @param buf The buffer.
+ * @param in The in.
+ */
+
void
MD5Transform(UWORD32 buf[4], UWORD32 const in[16])
{
diff --git a/src/lib/util/opresolv.c b/src/lib/util/opresolv.c
index 0cfa1030932..91c6f1a9cbd 100644
--- a/src/lib/util/opresolv.c
+++ b/src/lib/util/opresolv.c
@@ -536,14 +536,31 @@ optreserr_t option_resolution_isvalidvalue(const char *specification, int option
return OPTIONRESOLUTION_ERROR_PARAMOUTOFRANGE;
}
-
+/**
+ * @fn int option_resolution_contains(const char *specification, int option_char)
+ *
+ * @brief Option resolution contains.
+ *
+ * @param specification The specification.
+ * @param option_char The option character.
+ *
+ * @return An int.
+ */
int option_resolution_contains(const char *specification, int option_char)
{
return strchr(specification, option_char) != NULL;
}
-
+/**
+ * @fn const char *option_resolution_error_string(optreserr_t err)
+ *
+ * @brief Option resolution error string.
+ *
+ * @param err The error.
+ *
+ * @return null if it fails, else a char*.
+ */
const char *option_resolution_error_string(optreserr_t err)
{
diff --git a/src/lib/util/options.c b/src/lib/util/options.c
index 62c3cc0379a..69e7189f50b 100644
--- a/src/lib/util/options.c
+++ b/src/lib/util/options.c
@@ -709,10 +709,15 @@ void core_options::remove_entry(core_options::entry &delentry)
m_entrylist.remove(delentry);
}
-
-//-------------------------------------------------
-// copyfrom - copy options from another set
-//-------------------------------------------------
+/**
+ * @fn void core_options::copyfrom(const core_options &src)
+ *
+ * @brief -------------------------------------------------
+ * copyfrom - copy options from another set
+ * -------------------------------------------------.
+ *
+ * @param src Source for the.
+ */
void core_options::copyfrom(const core_options &src)
{
@@ -724,12 +729,21 @@ void core_options::copyfrom(const core_options &src)
append_entry(*global_alloc(entry(curentry->name(), curentry->description(), curentry->flags(), curentry->default_value())));
}
-
-//-------------------------------------------------
-// validate_and_set_data - make sure the data is
-// of the appropriate type and within range,
-// then set it
-//-------------------------------------------------
+/**
+ * @fn bool core_options::validate_and_set_data(core_options::entry &curentry, const char *newdata, int priority, std::string &error_string)
+ *
+ * @brief -------------------------------------------------
+ * validate_and_set_data - make sure the data is of the appropriate type and within
+ * range, then set it
+ * -------------------------------------------------.
+ *
+ * @param [in,out] curentry The curentry.
+ * @param newdata The newdata.
+ * @param priority The priority.
+ * @param [in,out] error_string The error string.
+ *
+ * @return true if it succeeds, false if it fails.
+ */
bool core_options::validate_and_set_data(core_options::entry &curentry, const char *newdata, int priority, std::string &error_string)
{
diff --git a/src/lib/util/palette.c b/src/lib/util/palette.c
index 321f5ebca72..f2252a24319 100644
--- a/src/lib/util/palette.c
+++ b/src/lib/util/palette.c
@@ -467,11 +467,16 @@ void palette_t::normalize_range(UINT32 start, UINT32 end, int lum_min, int lum_m
}
}
-
-//-------------------------------------------------
-// update_adjusted_color - update a color index
-// by group and index pair
-//-------------------------------------------------
+/**
+ * @fn void palette_t::update_adjusted_color(UINT32 group, UINT32 index)
+ *
+ * @brief -------------------------------------------------
+ * update_adjusted_color - update a color index by group and index pair
+ * -------------------------------------------------.
+ *
+ * @param group The group.
+ * @param index Zero-based index of the.
+ */
void palette_t::update_adjusted_color(UINT32 group, UINT32 index)
{
diff --git a/src/lib/util/plaparse.c b/src/lib/util/plaparse.c
index 03502e80560..74bc8edcc69 100644
--- a/src/lib/util/plaparse.c
+++ b/src/lib/util/plaparse.c
@@ -294,6 +294,18 @@ static bool process_field(jed_data *data, const UINT8 **src, const UINT8 *srcend
that has been loaded raw into memory
-------------------------------------------------*/
+/**
+ * @fn int pla_parse(const void *data, size_t length, jed_data *result)
+ *
+ * @brief Pla parse.
+ *
+ * @param data The data.
+ * @param length The length.
+ * @param [out] result If non-null, the result.
+ *
+ * @return An int.
+ */
+
int pla_parse(const void *data, size_t length, jed_data *result)
{
const UINT8 *src = (const UINT8 *)data;
diff --git a/src/lib/util/png.c b/src/lib/util/png.c
index 076b1b02965..706dfb5e50f 100644
--- a/src/lib/util/png.c
+++ b/src/lib/util/png.c
@@ -1096,6 +1096,18 @@ png_error png_write_bitmap(core_file *fp, png_info *info, bitmap_t &bitmap, int
********************************************************************************/
+/**
+ * @fn png_error mng_capture_start(core_file *fp, bitmap_t &bitmap, double rate)
+ *
+ * @brief Mng capture start.
+ *
+ * @param [in,out] fp If non-null, the fp.
+ * @param [in,out] bitmap The bitmap.
+ * @param rate The rate.
+ *
+ * @return A png_error.
+ */
+
png_error mng_capture_start(core_file *fp, bitmap_t &bitmap, double rate)
{
UINT8 mhdr[28];
@@ -1118,11 +1130,35 @@ png_error mng_capture_start(core_file *fp, bitmap_t &bitmap, double rate)
return PNGERR_NONE;
}
+/**
+ * @fn png_error mng_capture_frame(core_file *fp, png_info *info, bitmap_t &bitmap, int palette_length, const rgb_t *palette)
+ *
+ * @brief Mng capture frame.
+ *
+ * @param [in,out] fp If non-null, the fp.
+ * @param [in,out] info If non-null, the information.
+ * @param [in,out] bitmap The bitmap.
+ * @param palette_length Length of the palette.
+ * @param palette The palette.
+ *
+ * @return A png_error.
+ */
+
png_error mng_capture_frame(core_file *fp, png_info *info, bitmap_t &bitmap, int palette_length, const rgb_t *palette)
{
return write_png_stream(fp, info, bitmap, palette_length, palette);
}
+/**
+ * @fn png_error mng_capture_stop(core_file *fp)
+ *
+ * @brief Mng capture stop.
+ *
+ * @param [in,out] fp If non-null, the fp.
+ *
+ * @return A png_error.
+ */
+
png_error mng_capture_stop(core_file *fp)
{
return write_chunk(fp, NULL, MNG_CN_MEND, 0);
diff --git a/src/lib/util/pool.c b/src/lib/util/pool.c
index 807d3568077..ab62f47c6aa 100644
--- a/src/lib/util/pool.c
+++ b/src/lib/util/pool.c
@@ -570,6 +570,14 @@ static void memory_error(const char *message)
pool behavior
-------------------------------------------------*/
+/**
+ * @fn int test_memory_pools(void)
+ *
+ * @brief Tests memory pools.
+ *
+ * @return An int.
+ */
+
int test_memory_pools(void)
{
object_pool *pool;
diff --git a/src/lib/util/sha1.c b/src/lib/util/sha1.c
index b8de519c7bc..32247510190 100644
--- a/src/lib/util/sha1.c
+++ b/src/lib/util/sha1.c
@@ -121,6 +121,14 @@ static void WRITE_UINT32(unsigned char* data, UINT32 val)
/* Initialize the SHA values */
+/**
+ * @fn void sha1_init(struct sha1_ctx *ctx)
+ *
+ * @brief Sha 1 initialise.
+ *
+ * @param [in,out] ctx If non-null, the context.
+ */
+
void
sha1_init(struct sha1_ctx *ctx)
{
@@ -145,6 +153,15 @@ sha1_init(struct sha1_ctx *ctx)
Note that this function destroys the data area */
+/**
+ * @fn static void sha1_transform(UINT32 *state, UINT32 *data)
+ *
+ * @brief Sha 1 transform.
+ *
+ * @param [in,out] state If non-null, the state.
+ * @param [in,out] data If non-null, the data.
+ */
+
static void
sha1_transform(UINT32 *state, UINT32 *data)
{
@@ -250,6 +267,15 @@ sha1_transform(UINT32 *state, UINT32 *data)
state[4] += E;
}
+/**
+ * @fn static void sha1_block(struct sha1_ctx *ctx, const UINT8 *block)
+ *
+ * @brief Sha 1 block.
+ *
+ * @param [in,out] ctx If non-null, the context.
+ * @param block The block.
+ */
+
static void
sha1_block(struct sha1_ctx *ctx, const UINT8 *block)
{
@@ -267,6 +293,16 @@ sha1_block(struct sha1_ctx *ctx, const UINT8 *block)
sha1_transform(ctx->digest, data);
}
+/**
+ * @fn void sha1_update(struct sha1_ctx *ctx, unsigned length, const UINT8 *buffer)
+ *
+ * @brief Sha 1 update.
+ *
+ * @param [in,out] ctx If non-null, the context.
+ * @param length The length.
+ * @param buffer The buffer.
+ */
+
void
sha1_update(struct sha1_ctx *ctx,
unsigned length, const UINT8 *buffer)
@@ -303,6 +339,14 @@ sha1_update(struct sha1_ctx *ctx,
/* Final wrapup - pad to SHA1_DATA_SIZE-byte boundary with the bit pattern
1 0* (64-bit count of bits processed, MSB-first) */
+/**
+ * @fn void sha1_final(struct sha1_ctx *ctx)
+ *
+ * @brief Sha 1 final.
+ *
+ * @param [in,out] ctx If non-null, the context.
+ */
+
void
sha1_final(struct sha1_ctx *ctx)
{
@@ -346,6 +390,16 @@ sha1_final(struct sha1_ctx *ctx)
sha1_transform(ctx->digest, data);
}
+/**
+ * @fn void sha1_digest(const struct sha1_ctx *ctx, unsigned length, UINT8 *digest)
+ *
+ * @brief Sha 1 digest.
+ *
+ * @param ctx The context.
+ * @param length The length.
+ * @param [in,out] digest If non-null, the digest.
+ */
+
void
sha1_digest(const struct sha1_ctx *ctx,
unsigned length,
diff --git a/src/lib/util/tagmap.c b/src/lib/util/tagmap.c
index c8247899dcc..7995b578314 100644
--- a/src/lib/util/tagmap.c
+++ b/src/lib/util/tagmap.c
@@ -13,6 +13,8 @@
#include "tagmap.h"
#ifdef MAME_DEBUG
+/** @brief The tagmap finds. */
INT32 g_tagmap_finds = 0;
+/** @brief true to enable, false to disable the tagmap counter. */
bool g_tagmap_counter_enabled = false;
#endif
diff --git a/src/lib/util/un7z.c b/src/lib/util/un7z.c
index 149ead60e4d..bbae440e0ff 100644
--- a/src/lib/util/un7z.c
+++ b/src/lib/util/un7z.c
@@ -467,6 +467,14 @@ _7z_error _7z_file_decompress(_7z_file *new_7z, void *buffer, UINT32 length)
_7z_file
-------------------------------------------------*/
+/**
+ * @fn static void free__7z_file(_7z_file *_7z)
+ *
+ * @brief Free 7z file.
+ *
+ * @param [in,out] _7z If non-null, the 7z.
+ */
+
static void free__7z_file(_7z_file *_7z)
{
if (_7z != NULL)
diff --git a/src/lib/util/unicode.c b/src/lib/util/unicode.c
index c87965415d7..5f375337b34 100644
--- a/src/lib/util/unicode.c
+++ b/src/lib/util/unicode.c
@@ -308,6 +308,16 @@ int utf16f_from_uchar(utf16_char *utf16string, size_t count, unicode_char uchar)
previous character in a string
-------------------------------------------------*/
+/**
+ * @fn const char *utf8_previous_char(const char *utf8string)
+ *
+ * @brief UTF 8 previous character.
+ *
+ * @param utf8string The UTF 8string.
+ *
+ * @return null if it fails, else a char*.
+ */
+
const char *utf8_previous_char(const char *utf8string)
{
while ((*--utf8string & 0xc0) == 0x80)
@@ -322,6 +332,16 @@ const char *utf8_previous_char(const char *utf8string)
UTF-8 characters
-------------------------------------------------*/
+/**
+ * @fn int utf8_is_valid_string(const char *utf8string)
+ *
+ * @brief UTF 8 is valid string.
+ *
+ * @param utf8string The UTF 8string.
+ *
+ * @return An int.
+ */
+
int utf8_is_valid_string(const char *utf8string)
{
int remaining_length = strlen(utf8string);
diff --git a/src/lib/util/unzip.c b/src/lib/util/unzip.c
index 264029052be..21e137b9f24 100644
--- a/src/lib/util/unzip.c
+++ b/src/lib/util/unzip.c
@@ -67,8 +67,29 @@
#define ZIPCRC 0x0e
#define ZIPSIZE 0x12
#define ZIPUNCMP 0x16
+
+/**
+ * @def ZIPFNLN
+ *
+ * @brief A macro that defines zipfnln.
+ */
+
#define ZIPFNLN 0x1a
+
+/**
+ * @def ZIPXTRALN
+ *
+ * @brief A macro that defines zipxtraln.
+ */
+
#define ZIPXTRALN 0x1c
+
+/**
+ * @def ZIPNAME
+ *
+ * @brief A macro that defines zipname.
+ */
+
#define ZIPNAME 0x1e
@@ -77,11 +98,31 @@
INLINE FUNCTIONS
***************************************************************************/
+/**
+ * @fn INLINE UINT16 read_word(UINT8 *buf)
+ *
+ * @brief Reads a word.
+ *
+ * @param [in,out] buf If non-null, the buffer.
+ *
+ * @return The word.
+ */
+
INLINE UINT16 read_word(UINT8 *buf)
{
return (buf[1] << 8) | buf[0];
}
+/**
+ * @fn INLINE UINT32 read_dword(UINT8 *buf)
+ *
+ * @brief Reads a double word.
+ *
+ * @param [in,out] buf If non-null, the buffer.
+ *
+ * @return The double word.
+ */
+
INLINE UINT32 read_dword(UINT8 *buf)
{
return (buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | buf[0];
@@ -93,6 +134,7 @@ INLINE UINT32 read_dword(UINT8 *buf)
GLOBAL VARIABLES
***************************************************************************/
+/** @brief The zip cache[ zip cache size]. */
static zip_file *zip_cache[ZIP_CACHE_SIZE];
@@ -122,6 +164,17 @@ static zip_error decompress_data_type_8(zip_file *zip, UINT64 offset, void *buff
zip_file_open - opens a ZIP file for reading
-------------------------------------------------*/
+/**
+ * @fn zip_error zip_file_open(const char *filename, zip_file **zip)
+ *
+ * @brief Queries if a given zip file open.
+ *
+ * @param filename Filename of the file.
+ * @param [in,out] zip If non-null, the zip.
+ *
+ * @return A zip_error.
+ */
+
zip_error zip_file_open(const char *filename, zip_file **zip)
{
zip_error ziperr = ZIPERR_NONE;
@@ -213,6 +266,14 @@ error:
to the cache
-------------------------------------------------*/
+/**
+ * @fn void zip_file_close(zip_file *zip)
+ *
+ * @brief Zip file close.
+ *
+ * @param [in,out] zip If non-null, the zip.
+ */
+
void zip_file_close(zip_file *zip)
{
int cachenum;
@@ -243,6 +304,12 @@ void zip_file_close(zip_file *zip)
cache and free all memory
-------------------------------------------------*/
+/**
+ * @fn void zip_file_cache_clear(void)
+ *
+ * @brief Zip file cache clear.
+ */
+
void zip_file_cache_clear(void)
{
int cachenum;
@@ -267,6 +334,16 @@ void zip_file_cache_clear(void)
in the ZIP
-------------------------------------------------*/
+/**
+ * @fn const zip_file_header *zip_file_first_file(zip_file *zip)
+ *
+ * @brief Zip file first file.
+ *
+ * @param [in,out] zip If non-null, the zip.
+ *
+ * @return null if it fails, else a zip_file_header*.
+ */
+
const zip_file_header *zip_file_first_file(zip_file *zip)
{
/* reset the position and go from there */
@@ -280,6 +357,16 @@ const zip_file_header *zip_file_first_file(zip_file *zip)
in the ZIP
-------------------------------------------------*/
+/**
+ * @fn const zip_file_header *zip_file_next_file(zip_file *zip)
+ *
+ * @brief Zip file next file.
+ *
+ * @param [in,out] zip If non-null, the zip.
+ *
+ * @return null if it fails, else a zip_file_header*.
+ */
+
const zip_file_header *zip_file_next_file(zip_file *zip)
{
/* fix up any modified data */
@@ -337,6 +424,18 @@ const zip_file_header *zip_file_next_file(zip_file *zip)
from a ZIP into the target buffer
-------------------------------------------------*/
+/**
+ * @fn zip_error zip_file_decompress(zip_file *zip, void *buffer, UINT32 length)
+ *
+ * @brief Zip file decompress.
+ *
+ * @param [in,out] zip If non-null, the zip.
+ * @param [in,out] buffer If non-null, the buffer.
+ * @param length The length.
+ *
+ * @return A zip_error.
+ */
+
zip_error zip_file_decompress(zip_file *zip, void *buffer, UINT32 length)
{
zip_error ziperr;
@@ -384,6 +483,14 @@ zip_error zip_file_decompress(zip_file *zip, void *buffer, UINT32 length)
zip_file
-------------------------------------------------*/
+/**
+ * @fn static void free_zip_file(zip_file *zip)
+ *
+ * @brief Free zip file.
+ *
+ * @param [in,out] zip If non-null, the zip.
+ */
+
static void free_zip_file(zip_file *zip)
{
if (zip != NULL)
@@ -410,6 +517,16 @@ static void free_zip_file(zip_file *zip)
read_ecd - read the ECD data
-------------------------------------------------*/
+/**
+ * @fn static zip_error read_ecd(zip_file *zip)
+ *
+ * @brief Reads an ecd.
+ *
+ * @param [in,out] zip If non-null, the zip.
+ *
+ * @return The ecd.
+ */
+
static zip_error read_ecd(zip_file *zip)
{
UINT32 buflen = 1024;
@@ -484,6 +601,17 @@ static zip_error read_ecd(zip_file *zip)
offset of the compressed data
-------------------------------------------------*/
+/**
+ * @fn static zip_error get_compressed_data_offset(zip_file *zip, UINT64 *offset)
+ *
+ * @brief Gets compressed data offset.
+ *
+ * @param [in,out] zip If non-null, the zip.
+ * @param [in,out] offset If non-null, the offset.
+ *
+ * @return The compressed data offset.
+ */
+
static zip_error get_compressed_data_offset(zip_file *zip, UINT64 *offset)
{
file_error error;
@@ -521,6 +649,19 @@ static zip_error get_compressed_data_offset(zip_file *zip, UINT64 *offset)
type 0 data (which is uncompressed)
-------------------------------------------------*/
+/**
+ * @fn static zip_error decompress_data_type_0(zip_file *zip, UINT64 offset, void *buffer, UINT32 length)
+ *
+ * @brief Decompress the data type 0.
+ *
+ * @param [in,out] zip If non-null, the zip.
+ * @param offset The offset.
+ * @param [in,out] buffer If non-null, the buffer.
+ * @param length The length.
+ *
+ * @return A zip_error.
+ */
+
static zip_error decompress_data_type_0(zip_file *zip, UINT64 offset, void *buffer, UINT32 length)
{
file_error filerr;
@@ -542,6 +683,19 @@ static zip_error decompress_data_type_0(zip_file *zip, UINT64 offset, void *buff
type 8 data (which is deflated)
-------------------------------------------------*/
+/**
+ * @fn static zip_error decompress_data_type_8(zip_file *zip, UINT64 offset, void *buffer, UINT32 length)
+ *
+ * @brief Decompress the data type 8.
+ *
+ * @param [in,out] zip If non-null, the zip.
+ * @param offset The offset.
+ * @param [in,out] buffer If non-null, the buffer.
+ * @param length The length.
+ *
+ * @return A zip_error.
+ */
+
static zip_error decompress_data_type_8(zip_file *zip, UINT64 offset, void *buffer, UINT32 length)
{
UINT32 input_remaining = zip->header.compressed_length;
diff --git a/src/lib/util/vbiparse.c b/src/lib/util/vbiparse.c
index 3f22e51c990..9c6c39fc4ea 100644
--- a/src/lib/util/vbiparse.c
+++ b/src/lib/util/vbiparse.c
@@ -276,6 +276,18 @@ int vbi_parse_white_flag(const UINT16 *source, int sourcewidth, int sourceshift)
frame
-------------------------------------------------*/
+/**
+ * @fn void vbi_parse_all(const UINT16 *source, int sourcerowpixels, int sourcewidth, int sourceshift, vbi_metadata *vbi)
+ *
+ * @brief Vbi parse all.
+ *
+ * @param source Source for the.
+ * @param sourcerowpixels The sourcerowpixels.
+ * @param sourcewidth The sourcewidth.
+ * @param sourceshift The sourceshift.
+ * @param [in,out] vbi If non-null, the vbi.
+ */
+
void vbi_parse_all(const UINT16 *source, int sourcerowpixels, int sourcewidth, int sourceshift, vbi_metadata *vbi)
{
UINT32 bits[2][24];
@@ -338,6 +350,16 @@ void vbi_parse_all(const UINT16 *source, int sourcerowpixels, int sourcewidth, i
into a smaller form for storage
-------------------------------------------------*/
+/**
+ * @fn void vbi_metadata_pack(UINT8 *dest, UINT32 framenum, const vbi_metadata *vbi)
+ *
+ * @brief Vbi metadata pack.
+ *
+ * @param [in,out] dest If non-null, destination for the.
+ * @param framenum The framenum.
+ * @param vbi The vbi.
+ */
+
void vbi_metadata_pack(UINT8 *dest, UINT32 framenum, const vbi_metadata *vbi)
{
dest[0] = framenum >> 16;
@@ -364,6 +386,16 @@ void vbi_metadata_pack(UINT8 *dest, UINT32 framenum, const vbi_metadata *vbi)
from a smaller form into the full structure
-------------------------------------------------*/
+/**
+ * @fn void vbi_metadata_unpack(vbi_metadata *vbi, UINT32 *framenum, const UINT8 *source)
+ *
+ * @brief Vbi metadata unpack.
+ *
+ * @param [in,out] vbi If non-null, the vbi.
+ * @param [in,out] framenum If non-null, the framenum.
+ * @param source Source for the.
+ */
+
void vbi_metadata_unpack(vbi_metadata *vbi, UINT32 *framenum, const UINT8 *source)
{
if (framenum != NULL)
diff --git a/src/lib/util/xmlfile.c b/src/lib/util/xmlfile.c
index 7956654a984..cb674abfa2b 100644
--- a/src/lib/util/xmlfile.c
+++ b/src/lib/util/xmlfile.c
@@ -411,13 +411,14 @@ int xml_get_attribute_int(xml_data_node *node, const char *attribute, int defval
{
const char *string = xml_get_attribute_string(node, attribute, NULL);
int value;
+ unsigned int uvalue;
if (string == NULL)
return defvalue;
if (string[0] == '$')
- return (sscanf(&string[1], "%X", &value) == 1) ? value : defvalue;
+ return (sscanf(&string[1], "%X", &uvalue) == 1) ? uvalue : defvalue;
if (string[0] == '0' && string[1] == 'x')
- return (sscanf(&string[2], "%X", &value) == 1) ? value : defvalue;
+ return (sscanf(&string[2], "%X", &uvalue) == 1) ? uvalue : defvalue;
if (string[0] == '#')
return (sscanf(&string[1], "%d", &value) == 1) ? value : defvalue;
return (sscanf(&string[0], "%d", &value) == 1) ? value : defvalue;
@@ -451,6 +452,18 @@ int xml_get_attribute_int_format(xml_data_node *node, const char *attribute)
found, return = the provided default
-------------------------------------------------*/
+/**
+ * @fn float xml_get_attribute_float(xml_data_node *node, const char *attribute, float defvalue)
+ *
+ * @brief XML get attribute float.
+ *
+ * @param [in,out] node If non-null, the node.
+ * @param attribute The attribute.
+ * @param defvalue The defvalue.
+ *
+ * @return A float.
+ */
+
float xml_get_attribute_float(xml_data_node *node, const char *attribute, float defvalue)
{
const char *string = xml_get_attribute_string(node, attribute, NULL);
@@ -467,6 +480,18 @@ float xml_get_attribute_float(xml_data_node *node, const char *attribute, float
string value on the node
-------------------------------------------------*/
+/**
+ * @fn xml_attribute_node *xml_set_attribute(xml_data_node *node, const char *name, const char *value)
+ *
+ * @brief XML set attribute.
+ *
+ * @param [in,out] node If non-null, the node.
+ * @param name The name.
+ * @param value The value.
+ *
+ * @return null if it fails, else an xml_attribute_node*.
+ */
+
xml_attribute_node *xml_set_attribute(xml_data_node *node, const char *name, const char *value)
{
xml_attribute_node *anode;
@@ -495,6 +520,18 @@ xml_attribute_node *xml_set_attribute(xml_data_node *node, const char *name, con
integer value on the node
-------------------------------------------------*/
+/**
+ * @fn xml_attribute_node *xml_set_attribute_int(xml_data_node *node, const char *name, int value)
+ *
+ * @brief XML set attribute int.
+ *
+ * @param [in,out] node If non-null, the node.
+ * @param name The name.
+ * @param value The value.
+ *
+ * @return null if it fails, else an xml_attribute_node*.
+ */
+
xml_attribute_node *xml_set_attribute_int(xml_data_node *node, const char *name, int value)
{
char buffer[100];
@@ -508,6 +545,18 @@ xml_attribute_node *xml_set_attribute_int(xml_data_node *node, const char *name,
float value on the node
-------------------------------------------------*/
+/**
+ * @fn xml_attribute_node *xml_set_attribute_float(xml_data_node *node, const char *name, float value)
+ *
+ * @brief XML set attribute float.
+ *
+ * @param [in,out] node If non-null, the node.
+ * @param name The name.
+ * @param value The value.
+ *
+ * @return null if it fails, else an xml_attribute_node*.
+ */
+
xml_attribute_node *xml_set_attribute_float(xml_data_node *node, const char *name, float value)
{
char buffer[100];
@@ -526,6 +575,16 @@ xml_attribute_node *xml_set_attribute_float(xml_data_node *node, const char *nam
to ensure it doesn't contain embedded tags
-------------------------------------------------*/
+/**
+ * @fn const char *xml_normalize_string(const char *string)
+ *
+ * @brief XML normalize string.
+ *
+ * @param string The string.
+ *
+ * @return null if it fails, else a char*.
+ */
+
const char *xml_normalize_string(const char *string)
{
static char buffer[1024];
@@ -564,6 +623,16 @@ const char *xml_normalize_string(const char *string)
systems
-------------------------------------------------*/
+/**
+ * @fn static void *expat_malloc(size_t size)
+ *
+ * @brief Expat malloc.
+ *
+ * @param size The size.
+ *
+ * @return null if it fails, else a void*.
+ */
+
static void *expat_malloc(size_t size)
{
UINT32 *result = (UINT32 *)malloc(size + 4 * sizeof(UINT32));
@@ -571,12 +640,31 @@ static void *expat_malloc(size_t size)
return &result[4];
}
+/**
+ * @fn static void expat_free(void *ptr)
+ *
+ * @brief Expat free.
+ *
+ * @param [in,out] ptr If non-null, the pointer.
+ */
+
static void expat_free(void *ptr)
{
if (ptr != NULL)
free(&((UINT32 *)ptr)[-4]);
}
+/**
+ * @fn static void *expat_realloc(void *ptr, size_t size)
+ *
+ * @brief Expat realloc.
+ *
+ * @param [in,out] ptr If non-null, the pointer.
+ * @param size The size.
+ *
+ * @return null if it fails, else a void*.
+ */
+
static void *expat_realloc(void *ptr, size_t size)
{
void *newptr = expat_malloc(size);
@@ -596,6 +684,17 @@ static void *expat_realloc(void *ptr, size_t size)
expat_setup_parser - set up expat for parsing
-------------------------------------------------*/
+/**
+ * @fn static int expat_setup_parser(xml_parse_info *parse_info, xml_parse_options *opts)
+ *
+ * @brief Expat setup parser.
+ *
+ * @param [in,out] parse_info If non-null, information describing the parse.
+ * @param [in,out] opts If non-null, options for controlling the operation.
+ *
+ * @return An int.
+ */
+
static int expat_setup_parser(xml_parse_info *parse_info, xml_parse_options *opts)
{
XML_Memory_Handling_Suite memcallbacks;
@@ -647,6 +746,16 @@ static int expat_setup_parser(xml_parse_info *parse_info, xml_parse_options *opt
element
-------------------------------------------------*/
+/**
+ * @fn static void expat_element_start(void *data, const XML_Char *name, const XML_Char **attributes)
+ *
+ * @brief Expat element start.
+ *
+ * @param [in,out] data If non-null, the data.
+ * @param name The name.
+ * @param attributes The attributes.
+ */
+
static void expat_element_start(void *data, const XML_Char *name, const XML_Char **attributes)
{
xml_parse_info *parse_info = (xml_parse_info *) data;
@@ -676,6 +785,16 @@ static void expat_element_start(void *data, const XML_Char *name, const XML_Char
element data
-------------------------------------------------*/
+/**
+ * @fn static void expat_data(void *data, const XML_Char *s, int len)
+ *
+ * @brief Expat data.
+ *
+ * @param [in,out] data If non-null, the data.
+ * @param s The const XML_Char * to process.
+ * @param len The length.
+ */
+
static void expat_data(void *data, const XML_Char *s, int len)
{
xml_parse_info *parse_info = (xml_parse_info *) data;
@@ -714,6 +833,15 @@ static void expat_data(void *data, const XML_Char *s, int len)
of an element
-------------------------------------------------*/
+/**
+ * @fn static void expat_element_end(void *data, const XML_Char *name)
+ *
+ * @brief Expat element end.
+ *
+ * @param [in,out] data If non-null, the data.
+ * @param name The name.
+ */
+
static void expat_element_end(void *data, const XML_Char *name)
{
xml_parse_info *parse_info = (xml_parse_info *) data;
@@ -764,6 +892,18 @@ static void expat_element_end(void *data, const XML_Char *name)
add_child - add a new node to the parent
-------------------------------------------------*/
+/**
+ * @fn static xml_data_node *add_child(xml_data_node *parent, const char *name, const char *value)
+ *
+ * @brief Adds a child.
+ *
+ * @param [in,out] parent If non-null, the parent.
+ * @param name The name.
+ * @param value The value.
+ *
+ * @return null if it fails, else an xml_data_node*.
+ */
+
static xml_data_node *add_child(xml_data_node *parent, const char *name, const char *value)
{
xml_data_node **pnode;
@@ -806,6 +946,18 @@ static xml_data_node *add_child(xml_data_node *parent, const char *name, const c
given node
-------------------------------------------------*/
+/**
+ * @fn static xml_attribute_node *add_attribute(xml_data_node *node, const char *name, const char *value)
+ *
+ * @brief Adds an attribute.
+ *
+ * @param [in,out] node If non-null, the node.
+ * @param name The name.
+ * @param value The value.
+ *
+ * @return null if it fails, else an xml_attribute_node*.
+ */
+
static xml_attribute_node *add_attribute(xml_data_node *node, const char *name, const char *value)
{
xml_attribute_node *anode, **panode;
@@ -849,6 +1001,16 @@ static xml_attribute_node *add_attribute(xml_data_node *node, const char *name,
an XML node and its children to a file
-------------------------------------------------*/
+/**
+ * @fn static void write_node_recursive(xml_data_node *node, int indent, core_file *file)
+ *
+ * @brief Writes a node recursive.
+ *
+ * @param [in,out] node If non-null, the node.
+ * @param indent The indent.
+ * @param [in,out] file If non-null, the file.
+ */
+
static void write_node_recursive(xml_data_node *node, int indent, core_file *file)
{
xml_attribute_node *anode;
@@ -892,6 +1054,14 @@ static void write_node_recursive(xml_data_node *node, int indent, core_file *fil
the data allocated to an XML node
-------------------------------------------------*/
+/**
+ * @fn static void free_node_recursive(xml_data_node *node)
+ *
+ * @brief Free node recursive.
+ *
+ * @param [in,out] node If non-null, the node.
+ */
+
static void free_node_recursive(xml_data_node *node)
{
xml_attribute_node *anode, *nanode;
diff --git a/src/lib/util/zippath.c b/src/lib/util/zippath.c
index d24f8438509..36c9470ed92 100644
--- a/src/lib/util/zippath.c
+++ b/src/lib/util/zippath.c
@@ -22,13 +22,25 @@
TYPE DEFINITIONS
***************************************************************************/
+/**
+ * @struct zippath_returned_directory
+ *
+ * @brief A zippath returned directory.
+ */
+
struct zippath_returned_directory
{
+ /** @brief The next. */
zippath_returned_directory *next;
+ /** @brief The name. */
std::string name;
};
-
+/**
+ * @class zippath_directory
+ *
+ * @brief A zippath directory.
+ */
class zippath_directory
{
@@ -41,16 +53,23 @@ public:
returned_dirlist(NULL) { }
/* common */
+ /** @brief true to returned parent. */
bool returned_parent;
+ /** @brief The returned entry. */
osd_directory_entry returned_entry;
/* specific to normal directories */
+ /** @brief Pathname of the directory. */
osd_directory *directory;
/* specific to ZIP directories */
+ /** @brief true to called zip first. */
bool called_zip_first;
+ /** @brief The zipfile. */
zip_file *zipfile;
+ /** @brief The zipprefix. */
std::string zipprefix;
+ /** @brief The returned dirlist. */
zippath_returned_directory *returned_dirlist;
};
@@ -69,9 +88,17 @@ static int is_7z_file(const char *path);
PATH OPERATIONS
***************************************************************************/
-//============================================================
-// is_path_separator
-//============================================================
+/**
+ * @fn int is_path_separator(char c)
+ *
+ * @brief ============================================================
+ * is_path_separator
+ * ============================================================.
+ *
+ * @param c The character.
+ *
+ * @return An int.
+ */
int is_path_separator(char c)
{
@@ -82,6 +109,16 @@ int is_path_separator(char c)
parse_parent_path - parses out the parent path
-------------------------------------------------*/
+/**
+ * @fn static void parse_parent_path(const char *path, int *beginpos, int *endpos)
+ *
+ * @brief Parse parent path.
+ *
+ * @param path Full pathname of the file.
+ * @param [in,out] beginpos If non-null, the beginpos.
+ * @param [in,out] endpos If non-null, the endpos.
+ */
+
static void parse_parent_path(const char *path, int *beginpos, int *endpos)
{
int length = strlen(path);
@@ -111,6 +148,17 @@ static void parse_parent_path(const char *path, int *beginpos, int *endpos)
zippath_parent - retrieves the parent directory
-------------------------------------------------*/
+/**
+ * @fn std::string &zippath_parent(std::string &dst, const char *path)
+ *
+ * @brief Zippath parent.
+ *
+ * @param [in,out] dst Destination for the.
+ * @param path Full pathname of the file.
+ *
+ * @return A std::string&amp;
+ */
+
std::string &zippath_parent(std::string &dst, const char *path)
{
int pos;
@@ -133,6 +181,17 @@ std::string &zippath_parent(std::string &dst, const char *path)
directory basename
-------------------------------------------------*/
+/**
+ * @fn std::string &zippath_parent_basename(std::string &dst, const char *path)
+ *
+ * @brief Zippath parent basename.
+ *
+ * @param [in,out] dst Destination for the.
+ * @param path Full pathname of the file.
+ *
+ * @return A std::string&amp;
+ */
+
std::string &zippath_parent_basename(std::string &dst, const char *path)
{
int beginpos, endpos;
@@ -147,6 +206,18 @@ std::string &zippath_parent_basename(std::string &dst, const char *path)
zippath_combine - combines two paths
-------------------------------------------------*/
+/**
+ * @fn std::string &zippath_combine(std::string &dst, const char *path1, const char *path2)
+ *
+ * @brief Zippath combine.
+ *
+ * @param [in,out] dst Destination for the.
+ * @param path1 The first path.
+ * @param path2 The second path.
+ *
+ * @return A std::string&amp;
+ */
+
std::string &zippath_combine(std::string &dst, const char *path1, const char *path2)
{
if (!strcmp(path2, "."))
@@ -183,6 +254,16 @@ std::string &zippath_combine(std::string &dst, const char *path1, const char *pa
file_error to a zip_error
-------------------------------------------------*/
+/**
+ * @fn static file_error file_error_from_zip_error(zip_error ziperr)
+ *
+ * @brief File error from zip error.
+ *
+ * @param ziperr The ziperr.
+ *
+ * @return A file_error.
+ */
+
static file_error file_error_from_zip_error(zip_error ziperr)
{
file_error filerr;
@@ -216,6 +297,18 @@ static file_error file_error_from_zip_error(zip_error ziperr)
from a zip file entry
-------------------------------------------------*/
+/**
+ * @fn static file_error create_core_file_from_zip(zip_file *zip, const zip_file_header *header, core_file *&file)
+ *
+ * @brief Creates core file from zip.
+ *
+ * @param [in,out] zip If non-null, the zip.
+ * @param header The header.
+ * @param [in,out] file [in,out] If non-null, the file.
+ *
+ * @return The new core file from zip.
+ */
+
static file_error create_core_file_from_zip(zip_file *zip, const zip_file_header *header, core_file *&file)
{
file_error filerr;
@@ -251,6 +344,19 @@ done:
zippath_fopen - opens a zip path file
-------------------------------------------------*/
+/**
+ * @fn file_error zippath_fopen(const char *filename, UINT32 openflags, core_file *&file, std::string &revised_path)
+ *
+ * @brief Zippath fopen.
+ *
+ * @param filename Filename of the file.
+ * @param openflags The openflags.
+ * @param [in,out] file [in,out] If non-null, the file.
+ * @param [in,out] revised_path Full pathname of the revised file.
+ *
+ * @return A file_error.
+ */
+
file_error zippath_fopen(const char *filename, UINT32 openflags, core_file *&file, std::string &revised_path)
{
file_error filerr = FILERR_NOT_FOUND;
@@ -380,6 +486,16 @@ done:
is_root - tests to see if this path is the root
-------------------------------------------------*/
+/**
+ * @fn static int is_root(const char *path)
+ *
+ * @brief Is root.
+ *
+ * @param path Full pathname of the file.
+ *
+ * @return An int.
+ */
+
static int is_root(const char *path)
{
int i = 0;
@@ -402,6 +518,16 @@ static int is_root(const char *path)
7-zip file
-------------------------------------------------*/
+/**
+ * @fn static int is_7z_file(const char *path)
+ *
+ * @brief Is 7z file.
+ *
+ * @param path Full pathname of the file.
+ *
+ * @return An int.
+ */
+
static int is_7z_file(const char *path)
{
const char *s = strrchr(path, '.');
@@ -414,6 +540,16 @@ static int is_7z_file(const char *path)
ZIP file
-------------------------------------------------*/
+/**
+ * @fn static int is_zip_file(const char *path)
+ *
+ * @brief Is zip file.
+ *
+ * @param path Full pathname of the file.
+ *
+ * @return An int.
+ */
+
static int is_zip_file(const char *path)
{
const char *s = strrchr(path, '.');
@@ -427,6 +563,16 @@ static int is_zip_file(const char *path)
character is a path separator within a ZIP file
-------------------------------------------------*/
+/**
+ * @fn static int is_zip_file_separator(char c)
+ *
+ * @brief Is zip file separator.
+ *
+ * @param c The character.
+ *
+ * @return An int.
+ */
+
static int is_zip_file_separator(char c)
{
return (c == '/') || (c == '\\');
@@ -439,6 +585,16 @@ static int is_zip_file_separator(char c)
character is a path separator within a ZIP path
-------------------------------------------------*/
+/**
+ * @fn static int is_zip_path_separator(char c)
+ *
+ * @brief Is zip path separator.
+ *
+ * @param c The character.
+ *
+ * @return An int.
+ */
+
static int is_zip_path_separator(char c)
{
return is_zip_file_separator(c) || is_path_separator(c);
@@ -451,6 +607,17 @@ static int is_zip_path_separator(char c)
character, normalizing separators as '/'
-------------------------------------------------*/
+/**
+ * @fn static char next_path_char(const char *s, int *pos)
+ *
+ * @brief Next path character.
+ *
+ * @param s The const char * to process.
+ * @param [in,out] pos If non-null, the position.
+ *
+ * @return A char.
+ */
+
static char next_path_char(const char *s, int *pos)
{
char result;
@@ -493,6 +660,18 @@ static char next_path_char(const char *s, int *pos)
type of a sub path in a zip file
-------------------------------------------------*/
+/**
+ * @fn static const zip_file_header *zippath_find_sub_path(zip_file *zipfile, const char *subpath, osd_dir_entry_type *type)
+ *
+ * @brief Zippath find sub path.
+ *
+ * @param [in,out] zipfile If non-null, the zipfile.
+ * @param subpath The subpath.
+ * @param [in,out] type If non-null, the type.
+ *
+ * @return null if it fails, else a zip_file_header*.
+ */
+
static const zip_file_header *zippath_find_sub_path(zip_file *zipfile, const char *subpath, osd_dir_entry_type *type)
{
int i, j;
@@ -546,6 +725,19 @@ static const zip_file_header *zippath_find_sub_path(zip_file *zipfile, const cha
true path and ZIP entry components
-------------------------------------------------*/
+/**
+ * @fn static file_error zippath_resolve(const char *path, osd_dir_entry_type &entry_type, zip_file *&zipfile, std::string &newpath)
+ *
+ * @brief Zippath resolve.
+ *
+ * @param path Full pathname of the file.
+ * @param [in,out] entry_type Type of the entry.
+ * @param [in,out] zipfile [in,out] If non-null, the zipfile.
+ * @param [in,out] newpath The newpath.
+ *
+ * @return A file_error.
+ */
+
static file_error zippath_resolve(const char *path, osd_dir_entry_type &entry_type, zip_file *&zipfile, std::string &newpath)
{
file_error err;
@@ -641,6 +833,17 @@ done:
zippath_opendir - opens a directory
-------------------------------------------------*/
+/**
+ * @fn file_error zippath_opendir(const char *path, zippath_directory **directory)
+ *
+ * @brief Zippath opendir.
+ *
+ * @param path Full pathname of the file.
+ * @param [in,out] directory If non-null, pathname of the directory.
+ *
+ * @return A file_error.
+ */
+
file_error zippath_opendir(const char *path, zippath_directory **directory)
{
file_error err;
@@ -701,6 +904,14 @@ done:
zippath_closedir - closes a directory
-------------------------------------------------*/
+/**
+ * @fn void zippath_closedir(zippath_directory *directory)
+ *
+ * @brief Zippath closedir.
+ *
+ * @param [in,out] directory If non-null, pathname of the directory.
+ */
+
void zippath_closedir(zippath_directory *directory)
{
if (directory->directory != NULL)
@@ -726,6 +937,17 @@ void zippath_closedir(zippath_directory *directory)
returns the relative path
-------------------------------------------------*/
+/**
+ * @fn static const char *get_relative_path(zippath_directory *directory, const zip_file_header *header)
+ *
+ * @brief Gets relative path.
+ *
+ * @param [in,out] directory If non-null, pathname of the directory.
+ * @param header The header.
+ *
+ * @return null if it fails, else the relative path.
+ */
+
static const char *get_relative_path(zippath_directory *directory, const zip_file_header *header)
{
const char *result = NULL;
@@ -747,6 +969,16 @@ static const char *get_relative_path(zippath_directory *directory, const zip_fil
zippath_readdir - reads a directory
-------------------------------------------------*/
+/**
+ * @fn const osd_directory_entry *zippath_readdir(zippath_directory *directory)
+ *
+ * @brief Zippath readdir.
+ *
+ * @param [in,out] directory If non-null, pathname of the directory.
+ *
+ * @return null if it fails, else an osd_directory_entry*.
+ */
+
const osd_directory_entry *zippath_readdir(zippath_directory *directory)
{
const osd_directory_entry *result = NULL;
@@ -853,6 +1085,16 @@ const osd_directory_entry *zippath_readdir(zippath_directory *directory)
a ZIP path or FALSE if not
-------------------------------------------------*/
+/**
+ * @fn int zippath_is_zip(zippath_directory *directory)
+ *
+ * @brief Zippath is zip.
+ *
+ * @param [in,out] directory If non-null, pathname of the directory.
+ *
+ * @return An int.
+ */
+
int zippath_is_zip(zippath_directory *directory)
{
return directory->zipfile != NULL;
diff --git a/src/mame/arcade.lst b/src/mame/arcade.lst
index 69d5bb2111d..b1c33b43c24 100644
--- a/src/mame/arcade.lst
+++ b/src/mame/arcade.lst
@@ -670,7 +670,7 @@ phoenixb // (c) 1980 Amstar + Centuri license
phoenixt // (c) 1980 Taito
phoenixj // (c) 1980 Taito
phoenix3 // bootleg
-phoenixdal // bootleg D&L (No copyright/title)
+phoenixdal // bootleg D&L (No copyright/title)
phoenixc // bootleg
phoenixc2 // bootleg
phoenixc3 // bootleg
@@ -730,7 +730,7 @@ nrallyx // (c) 1981 Namco
nrallyxb // (c) 1981 Namco
jungler // GX327 (c) 1981 Konami
junglers // GX327 (c) 1981 Stern
-jackler // 1 9 8 2 (Jungler Bootleg)
+jackler // 1 9 8 2 (Jungler Bootleg)
savanna // Olympia (c) 1982 (Jungler bootleg)
tactcian // GX335 (c) 1982 Sega
tactcian2 // GX335 (c) 1981 Sega
@@ -1465,7 +1465,9 @@ invadrmr // (c) 1978 Model Racing
claybust // (c) 1978 Model Racing
gunchamp // (c) 1980 Model Racing
gunchamps // (c) 1980 Model Racing (sshot.c)
-spaceatt // (c) 1978 Video Games GMBH
+spaceatt // (c) 1978 Video Games GmbH
+spaceattbp // (c) 1978 Video Games GmbH
+spaceatt2k // (c) 1978 Video Games GmbH
galmonst // (c) Laguna S.A.
spaceat2 // (c) 1980 Zenitone-Microsec Ltd
spacecom // bootleg
@@ -1788,13 +1790,13 @@ horizon // (c) 1985
youjyudn // (c) 1986 (Japan)
vigilant // (c) 1988 (World Rev E)
-vigilanta // (c) 1988 (World Rev A)
+vigilanta // (c) 1988 (World Rev A)
vigilantb // (c) 1988 (US Rev B)
-vigilantc // (c) 1988 (World Rev C)
+vigilantc // (c) 1988 (World Rev C)
vigilantd // (c) 1988 (Japan Rev D)
-vigilantg // (c) 1988 (US Rev G)
-vigilano // (c) 1988 (US)
-vigilanbl // bootleg
+vigilantg // (c) 1988 (US Rev G)
+vigilanto // (c) 1988 (US)
+vigilantbl // bootleg
kikcubic // (c) 1988 (Japan)
kikcubicb // bootleg
buccanrs // (c) 1989 Duintronic
@@ -1899,6 +1901,7 @@ geostorm // (c) 1994 Irem (Japan)
airass // (c) 1993 Irem (World)
firebarr // (c) 1993 Irem (Japan)
dsoccr94 // (c) 1994 Irem (Data East Corporation license)
+dsoccr94k //
kftgoal // (c) 1994 Jaleco
wpksoc // (c) 1995 Jaleco
@@ -2106,7 +2109,8 @@ rbisland // B22 (c) 1987 Taito Corporation
rbislando // B22 (c) 1987 Taito Corporation
rbislande // B39 (c) 1988 Taito Corporation
jumping // bootleg
-jumpinga // bootleg
+jumpinga // bootleg (Seyutu)
+jumpingi // bootleg (Seyutu / Imnoe)
arkanoid // A75 (c) 1986 Taito Corporation Japan (World)
arkanoidu // A75 (c) 1986 Taito America Corporation + Romstar license (US)
arkanoiduo // A75 (c) 1986 Taito America Corporation + Romstar license (US)
@@ -2240,6 +2244,7 @@ insectxj // B97 (c) 1989 Taito Corporation (Japan)
cchance // (c)1987 Taito?
champbwl // (c)1989 Romstar. not Taito, but the same Seta video chips
doraemon // Sunsoft / Epoch / Fujiko - Shogakukan - TV Asahi (prototype)
+thedealr // Visco Games
// Taito L-System games
raimais // B36 (c) 1988 Taito Corporation (Japan)
@@ -2654,7 +2659,7 @@ outzoneb // TP-O18 (c) 1990 Toaplan
outzonec // TP-O18 (c) 1990 Toaplan
vimana // TP-O19 (c) 1991 Toaplan (+ Tecmo license when set to Japan)
vimanaj // TP-O19 (c) 1991 Toaplan (+ Tecmo license when set to Japan)
-vimanan // TP-O19 (c) 1991 Toaplan (+ Nova Apparate GMBH & Co license)
+vimanan // TP-O19 (c) 1991 Toaplan (+ Nova Apparate GmbH & Co license)
snowbros // MIN16-02 (c) 1990 Toaplan + Romstar license
snowbrosa // MIN16-02 (c) 1990 Toaplan + Romstar license
snowbrosb // MIN16-02 (c) 1990 Toaplan + Romstar license
@@ -3012,13 +3017,15 @@ sidearms // 12/1986 (c) 1986 (World)
sidearmsu // 12/1986 (c) 1986 + Romstar license (US)
sidearmsur1 // 12/1986 (c) 1986 + Romstar license (US)
sidearmsj // 12/1986 (c) 1986 (Japan)
-turtship // (c) 1988 Philco (NOT A CAPCOM GAME but runs on modified Sidearms hardware)
-turtshipj // (c) 1988 Philco (NOT A CAPCOM GAME but runs on modified Sidearms hardware)
-turtshipk // (c) 1988 Philco (NOT A CAPCOM GAME but runs on modified Sidearms hardware)
-dyger // (c) 1989 Philco (NOT A CAPCOM GAME but runs on modified Sidearms hardware)
-dygera // (c) 1989 Philco (NOT A CAPCOM GAME but runs on modified Sidearms hardware)
+turtship // (c) 1988 Philko (NOT A CAPCOM GAME but runs on modified Sidearms hardware)
+turtshipj // (c) 1988 Philko (NOT A CAPCOM GAME but runs on modified Sidearms hardware)
+turtshipk // (c) 1988 Philko (NOT A CAPCOM GAME but runs on modified Sidearms hardware)
+turtshipko // (c) 1988 Philko (NOT A CAPCOM GAME but runs on modified Sidearms hardware)
+turtshipkn // (c) 1989 Philko (NOT A CAPCOM GAME but runs on modified Sidearms hardware)
+dyger // (c) 1989 Philko (NOT A CAPCOM GAME but runs on modified Sidearms hardware)
+dygera // (c) 1989 Philko (NOT A CAPCOM GAME but runs on modified Sidearms hardware)
twinfalc // (c) 1989 Philko (Poara Enterprises license) (NOT A CAPCOM GAME but runs on modified Sidearms hardware)
-whizz // (c) 1989 Philco (NOT A CAPCOM GAME but runs on modified Sidearms hardware)
+whizz // (c) 1989 Philko (NOT A CAPCOM GAME but runs on modified Sidearms hardware)
avengers // 2/1987 (c) 1987 (US)
avengers2 // 2/1987 (c) 1987 (US)
buraiken // 2/1987 (c) 1987 (Japan)
@@ -3026,6 +3033,7 @@ bionicc // 3/1987 (c) 1987 (Euro)
bionicc1 // 3/1987 (c) 1987 (US)
bionicc2 // 3/1987 (c) 1987 (US)
topsecrt // 3/1987 (c) 1987 (Japan)
+bioniccbl // bootleg
supduck // (c) Comad
1943 // 6/1987 (c) 1987 (Euro)
1943u // 6/1987 (c) 1987 (US) Rev C
@@ -3131,7 +3139,7 @@ cawingj // 12/10/1990 (c) 1990 (Japan)
cawingbl // bootleg
cawingb2 // bootleg
nemo // 30/11/1990 (c) 1990 (World)
-nemor1 // 09/11/1990 (c) 1990 (World)
+nemor1 // 09/11/1990 (c) 1990 (World)
nemoj // 20/11/1990 (c) 1990 (Japan)
sf2 // 22/05/1991 (c) 1991 (World)
sf2eb // 14/02/1991 (c) 1991 (World)
@@ -3198,7 +3206,7 @@ sf2red // hack
sf2v004 // hack
sf2acc // hack
sf2acca // hack
-sf2ceblp // hack
+sf2ceblp // hack
sf2accp2 // hack
sf2amf // bootleg
sf2amf2 // bootleg
@@ -3226,6 +3234,7 @@ varth // 14/07/1992 (c) 1992 (World)
varthr1 // 12/06/1992 (c) 1992 (World)
varthu // 12/06/1992 (c) 1992 (USA)
varthj // 14/07/1992 (c) 1992 (Japan)
+varthjr // 14/07/1992 (c) 1992 (Japan)
qad // 01/07/1992 (c) 1992 (USA)
qadjr // 21/09/1994 (c) 1994 (Japan)
wof // 31/10/1992 (c) 1992 (World) (CPS1 + QSound)
@@ -3436,6 +3445,7 @@ xmvsf // 04/10/1996 (c) 1996 (Euro)
xmvsfr1 // 10/09/1996 (c) 1996 (Euro)
xmvsfu // 23/10/1996 (c) 1996 (USA)
xmvsfur1 // 04/10/1996 (c) 1996 (USA)
+xmvsfur2 // 10/09/1996 (c) 1996 (USA)
xmvsfj // 04/10/1996 (c) 1996 (Japan)
xmvsfjr1 // 10/09/1996 (c) 1996 (Japan)
xmvsfjr2 // 09/09/1996 (c) 1996 (Japan)
@@ -4499,6 +4509,9 @@ stactics // (c) 1981 Sega
turbo // (c) 1981 Sega
turboa // (c) 1981 Sega
turbob // (c) 1981 Sega
+turboc // (c) 1981 Sega
+turbod // (c) 1981 Sega
+turbobl // bootleg
subroc3d // (c) 1982 Sega
buckrog // (c) 1982 Sega
buckrogn // (c) 1982 Sega
@@ -4603,8 +4616,9 @@ cottonja // (c) 1990 (FD1094)
ddux // (c) 1989 (FD1094)
dduxj // (c) 1989 (FD1094)
ddux1 // (c) 1989 (8751)
-dunkshot // (c) 1986 (FD1094)
-dunkshoto // (c) 1986 (FD1094)
+dunkshot // (c) 1986 (FD1089A)
+dunkshota // (c) 1986 (FD1089A)
+dunkshoto // (c) 1986 (FD1089A)
eswat // (c) 1989 (FD1094)
eswatu // (c) 1989 (FD1094)
eswatj // (c) 1989 (FD1094)
@@ -4784,6 +4798,7 @@ rascot // 1991.?? Royal Ascot (Japan)
// 1988.08 Galaxy Force (US)
gforce2j // 1988.07 Galaxy Force II (Japan)
gforce2ja // 1988.07 Galaxy Force II (Japan)
+gforce2sd // 1988.?? Galaxy Force II (World, Super Deluxe unit)
gforce2 // 1988.?? Galaxy Force II (World)
// 1988.12 Galaxy Force II (US)
// 1988.08 Power Drift (US)
@@ -4792,7 +4807,8 @@ pdrift // 1988.?? Power Drift (World)
pdrifta // 1988.?? Power Drift (World)
pdrifte // 1988.?? Power Drift (World)
pdriftl
-gloc // 1990.04 G-LOC Air Battle (US)
+gloc // 1990.?? G-LOC Air Battle (World)
+glocu // 1990.04 G-LOC Air Battle (US)
// 1990.05 G-LOC Air Battle (Japan)
glocr360 // 1990.?? G-LOC (R360, World?)
strkfgtr // 1991.06 Strike Fighter (World)
@@ -4804,6 +4820,7 @@ rchasej // 1991.09 Rail Chase (Japan)
// Sega System 24 games
// disk based
hotrodj // 1988.03 Hot Rod (Japan)
+hotrodja // 1988.03 Hot Rod (Japan)
hotrod // 1988.?? Hot Rod (World)
hotroda
// 1988.07 Hot Rod (US)
@@ -4836,6 +4853,9 @@ quizmeku // 1993.05 Quiz Mekurumeku Story (Japan)
mahmajn2 // 1994.05 Tokorosan no Mahmahjong 2 (Japan)
qgh // 1994.09 Quiz Ghost Hunter
+// M1 board
+bingpty // ?
+
// Sega System 32 games
radm // 1991.?? Rad Mobile (World)
radmu // 1991.03 Rad Mobile (US)
@@ -4910,6 +4930,7 @@ netmerc // ?? Info available in time ??
// Sega H1 games
coolridr // 1995.04 Cool Riders
+aquastge
// Sega ST-V games
stvbios
@@ -5600,6 +5621,7 @@ sprtshot // 2002.12 Sports Shooting USA
ggx15 // 2003.03 Guilty Gear X Ver.1.5
demofist // 2003.06 Demolish Fist
dolphin // 2003.08 Dolphin Blue
+kov7sprt // 2003.11 Knights of Valour - The Seven Sprits
ggisuka // 2003.12 Guilty Gear Isuka
// 2003.12 Sangoku Senki Shichisei Tensei (IGS)
rumblef // 2004.03 The Rumble Fish
@@ -5610,7 +5632,7 @@ kofnwj // 2004.07 The King of Fighters Neo Wave (Japan)
xtrmhunt // 2004.09 Extreme Hunting
dirtypig // 2004.09 Dirty Pig Skin Football
ftspeed // 2004.09 Faster than Speed
-kov7sprt // 2004.?? Knights of Valour - The Seven Sprits
+rumblf2p // 2005.01 The Rumble Fish 2 (prototype)
anmlbskt // 2005.01 Animal Basket (date is inside of ROM, probably earlier than release)
vfurlong // 2005.03 Net Select Keiba Victory Furlong
rumblef2 // 2005.03 The Rumble Fish 2
@@ -5620,8 +5642,8 @@ kofxi // 2005.10 The King of Fighters XI
fotns // 2005.12 Hokuto no Ken
mslug6 // 2006.02 Metal Slug 6
xtrmhnt2 // 2006.09 Extreme Hunting 2 Tournament Edition
-claychal // 2008.?? Sega Clay Challenge
-basschal // 2009.?? Sega Bass Challenge
+claychal // 2008.11 Sega Clay Challenge
+basschal // 2009.02 Sega Bass Challenge
// Hikaru
hikaru // 2000.?? Hikaru BIOS
@@ -5709,15 +5731,15 @@ mj2 // 2005.02.02 Sega Network Taisen Mahjong MJ 2 (Rev G)
// 2005.03 Sangokushi Taisen
gundamos // 2005.03 Gundam Battle Operating Simulator
// 2005.04 Quest of D Ver.1.20
- // 2005.04 Wangan Midnight Maximum Tune 2 (Japan)
-wangmid2 // 2005.04 Wangan Midnight Maximum Tune 2 (export)
+wangmid2 // 2005.04 Wangan Midnight Maximum Tune 2 (Japan)
+ // 2005.04 Wangan Midnight Maximum Tune 2 (Export)
// 2005.06 Sangokushi Taisen Ver.1.002
// 2005.06 Sangokushi Taisen Ver.1.03
// 2005.06 Sega Golf Club Network Pro Tour 2005
// 2005.06 Quest of D Ver.1.20a
// 2005.09 Quest of D Ver.1.21
// 2005.10 Sangokushi Taisen Ver.1.100
-wangmd2b // 2005.10 Wangan Midnight Maximum Tune 2 (Japan) (Rev A)
+wangmd2b // 2005.10 Wangan Midnight Maximum Tune 2 (Export) (Rev A)
// 2005.11 Sangokushi Taisen Ver.1.110
// 2005.12 Quest of D Gofu no Keisyousya Ver.2.00
// 2005.12 Quest of D Gofu no Keisyousya Ver.2.01
@@ -5740,6 +5762,7 @@ scg06nt // 2005.12 Sega Golf Club 2006: Next Tours (Rev A)
// 2006.09 Sega Network Taisen Mahjong MJ 3 Evolution (Rev A)
// 2006.10 Quest of D Oukoku no Syugosya Ver.3.00
// 2006.11 Quest of D Oukoku no Syugosya Ver.3.01
+mj3evo // 2007.06 Sega Network Taisen Mahjong MJ 3 Evolution (Rev B)
// 2007.11 Quest of D The Battle Kingdom Ver.4.00
// 2008.01 Quest of D The Battle Kingdom Ver.4.00b
// 2008.02 Quest of D The Battle Kingdom Ver.4.00c
@@ -6447,6 +6470,7 @@ esckids // GX975 (c) 1991 (Asia)
esckidsj // GX975 (c) 1991 (Japan)
vendetta // GX081 (c) 1991 (World)
vendettar // GX081 (c) 1991 (World)
+vendettaz // GX081 (c) 1991 (World)
vendetta2p // GX081 (c) 1991 (World)
vendetta2peba // GX081 (c) 1991 (World)
vendetta2pu // GX081 (c) 1991 (Asia)
@@ -6533,7 +6557,8 @@ lgtnfght // GX939 (c) 1990 (World)
lgtnfghta // GX939 (c) 1990 (Asia)
lgtnfghtu // GX939 (c) 1990 (US)
trigon // GX939 (c) 1990 (Japan)
-blswhstl // GX060 (c) 1991
+blswhstl // GX060 (c) 1991 (World)
+blswhstla // GX060 (c) 1991 (Asia)
detatwin // GX060 (c) 1991 (Japan)
glfgreat // GX061 (c) 1991
glfgreatj // GX061 (c) 1991 (Japan)
@@ -6552,6 +6577,7 @@ ssridersubc // GX064 (c) 1991 (US)
ssridersabd // GX064 (c) 1991 (Asia)
ssridersadd // GX064 (c) 1991 (Asia)
ssridersjbd // GX064 (c) 1991 (Japan)
+ssridersjad // GX064 (c) 1991 (Japan)
ssridersjac // GX064 (c) 1991 (Japan)
ssridersb // bootleg
ssriders2 // bootleg
@@ -6620,6 +6646,7 @@ mtlchampj // GX234 (c) 1993 (Japan)
mtlchampa // GX234 (c) 1993 (Japan)
rungun // GX247 (c) 1993 (World)
runguna // GX247 (c) 1993 (World)
+rungunb // GX247 (c) 1993 (World)
rungunu // GX247 (c) 1993 (US)
rungunua // GX247 (c) 1993 (US)
slmdunkj // GX247 (c) 1993 (Japan)
@@ -6636,6 +6663,7 @@ overdriva // GX789 (c) 1990
overdrivb // GX789 (c) 1990
gradius3 // GX945 (c) 1989 (World)
gradius3j // GX945 (c) 1989 (Japan)
+gradius3js // GX945 (c) 1989 (Japan, split)
gradius3a // GX945 (c) 1989 (Asia)
// Konami 68020 games
@@ -7496,6 +7524,7 @@ mechattu // A8002 'MA' (c) 1989
mechattu1 // A8002 'MA' (c) 1989
bbusters // A9003 'BB' (c) 1989
bbustersu // A9003 'BB' (c) 1989
+bbustersua // A9003 'BB' (c) 1989
// Electrocoin on early SNK hardware
dmndrby // G4001 'DD' (c) 1986
@@ -8674,6 +8703,7 @@ stdragon // (c) 1989
stdragona // (c) 1989
rodland // (c) 1990
rodlandj // (c) 1990 (Japan)
+rittam // Prototype or hack of Rod-Land
rodlandjb // bootleg
avspirit // (c) 1991
phantasm // (c) 1991 (Japan)
@@ -8759,6 +8789,7 @@ pspikesc // bootleg
karatblz // (c) 1991 Video System Co.
karatblzu // (c) 1991 Video System Co. (US)
karatblzj // (c) 1991 Video System / Tecmo (Japan)
+karatblzbl // bootleg
turbofrc // (c) 1991 Video System Co.
aerofgt // (c) 1992 Video System Co.
aerofgtb // (c) 1992 Video System Co.
@@ -8815,6 +8846,7 @@ baryona // (c) 1997 SemiCom
dreamwld // (c) 2000 SemiCom
rolcrush // (c) 1999 Trust
cutefght // (c) 1998 SemiCom
+gaialast // (c) 1999 SemiCom
// SH2 board
s1945ii // (c) 1997
@@ -9109,6 +9141,7 @@ keroppi // (c) 1993 Sammy
keroppij // (c) 1993 Sammy
extdwnhl // (c) 1995 Sammy Japan
gundhara // (c) 1995 Banpresto
+gundharac // (c) 1995 Banpresto (Chinese, bootleg?)
sokonuke // (c) 1995 Sammy Industries
zombraid // (c) 1995 American Sammy
zombraidp // (c) 1995 American Sammy
@@ -9368,6 +9401,7 @@ missmw96 // (c) 1996 Comad
smissw //
fantsia2 // (c) 1997 Comad
fantsia2a // (c) 1997 Comad
+fantsia2n // (c) 1998 Comad
wownfant // (c) 2002 Comad
pgalvip // (c) 1996 ACE International (Afega stickers on ROMs)
pgalvipa //
@@ -9470,14 +9504,16 @@ puzzlet // (c) 2000 Yunizu Corporation (Japan)
spcforce // (c) 1980 Venture Line
spcforc2 // bootleg
meteor // (c) 1981 Venture Line
-looping // (c) 1982 Video Games GMBH
-loopingv // (c) 1982 Video Games GMBH (Venture Line license)
-loopingva // (c) 1982 Video Games GMBH (Venture Line license)
+looping // (c) 1982 Video Games GmbH
+loopingv // (c) 1982 Video Games GmbH (Venture Line license)
+loopingva // (c) 1982 Video Games GmbH (Venture Line license)
skybump // (c) 1982 Venture Line
suprridr // (c) 1983 Venture Line + Taito license
// Yun Sung games
-paradise // (c) >1994 Yun Sung
+paradise // (c) 1994 Yun Sung
+paradisea // (c) 1994 Yun Sung
+paradisee // (c) 1994 Yun Sung (Escape license)
paradlx // (c) >1994 Yun Sung
para2dx // (c) >1994 Yun Sung
penky // (c) 1995 Yun Sung
@@ -9590,6 +9626,7 @@ janoh // (c) 1984 Toaplan
janoha // (c) 1984 Toaplan
jansou // (c) 1985 Dyna
jansoua // (c) 1985 Dyna
+tahjong // (c) 1985 Bally Pond / Nasco
mjsiyoub // (c) 1986 Visco
mjsenka // (c) 1986 Visco
mjyarou // (c) 1986 Visco / Video System
@@ -9630,6 +9667,7 @@ sprtmtch // "31" (c) 1989 Dynax + Fabtek license
maya // (c) 1994 Promat
mayaa // (c) 1994 Promat
mayab // (c) 1994 Promat
+mayac // (c) 1994 Promat
inca // (c) 199? ????
blktouch // (c) Yang Gi Co Ltd.
mcnpshnt // "33" Mahjong Campus Hunting 1990 Dynax
@@ -9650,6 +9688,7 @@ htengoku // 1992 Dynax
cdracula // 1994 Y.S.E.
mjreach // 1994 Dynax
mjdialq2 // "52" (c) 1991 Dynax
+mjdialq2a // "52" (c) 1991 Dynax
yarunara // "55" Mahjong Yarunara 1991 Dynax
mjangels // "61" Mahjong Angels 1991 Dynax
quiztvqq // "64" Quiz TV Gassyuukoku Q&Q 1992 Dynax
@@ -9711,6 +9750,7 @@ pkgnsh // "505" Pachinko Gindama Shoubu 1998 (Japan)
pkgnshdx // "522" Pachinko Gindama Shoubu DX 1998 (Japan)
hjingi // "???" 1990 Dynax
+hjingia // "???" 1990 Dynax
hanayara // "???"
mjelctrn // "???" Mahjong Electron Base parts 2 & 4
mjelct3 // "???" Mahjong Electron Base parts 2 & 3
@@ -10612,6 +10652,7 @@ bmcbowl // (c) 1994 BMC
koftball // (c) 1995 BMC
bmcpokr // (c) 1999 BMC
popobear // (c) 2000 BMC
+mjmaglmp // (c) 2000 BMC
// Merit
mgames // (c) 1981 Merit
@@ -10904,6 +10945,7 @@ mosaicf2 // (c) 1999 F2 System
royalpk2 //
finalgdr // (c) 2001 Semicom
mrkicker // (c) 2001 Semicom
+mrkickera // (c) 2001 Semicom
wivernwg // (c) 2001 Semicom
wyvernwg // (c) 2001 Semicom / Game Vision
wyvernwga // (c) 2001 Semicom / Game Vision
@@ -11133,10 +11175,12 @@ pepp0009 // (c) 1987 IGT - International Game Technology
pepp0010 // (c) 1987 IGT - International Game Technology
pepp0014 // (c) 1987 IGT - International Game Technology
pepp0014a // (c) 1987 IGT - International Game Technology
+pepp0021 // (c) 1987 IGT - International Game Technology
pepp0023 // (c) 1987 IGT - International Game Technology
pepp0038 // (c) 1987 IGT - International Game Technology
pepp0040 // (c) 1987 IGT - International Game Technology
pepp0040a // (c) 1987 IGT - International Game Technology
+pepp0040b // (c) 1987 IGT - International Game Technology
pepp0041 // (c) 1987 IGT - International Game Technology
pepp0042 // (c) 1987 IGT - International Game Technology
pepp0043 // (c) 1987 IGT - International Game Technology
@@ -11146,6 +11190,7 @@ pepp0045 // (c) 1987 IGT - International Game Technology
pepp0046 // (c) 1987 IGT - International Game Technology
pepp0046a // (c) 1987 IGT - International Game Technology
pepp0046b // (c) 1987 IGT - International Game Technology
+pepp0048 // (c) 1987 IGT - International Game Technology
pepp0051 // (c) 1987 IGT - International Game Technology
pepp0053 // (c) 1987 IGT - International Game Technology
pepp0055 // (c) 1987 IGT - International Game Technology
@@ -11162,6 +11207,8 @@ pepp0063 // (c) 1987 IGT - International Game Technology
pepp0064 // (c) 1987 IGT - International Game Technology
pepp0065 // (c) 1987 IGT - International Game Technology
pepp0083 // (c) 1987 IGT - International Game Technology
+pepp0085 // (c) 1987 IGT - International Game Technology
+pepp0089 // (c) 1987 IGT - International Game Technology
pepp0103 // (c) 1987 IGT - International Game Technology
pepp0116 // (c) 1987 IGT - International Game Technology
pepp0116a // (c) 1987 IGT - International Game Technology
@@ -11171,6 +11218,9 @@ pepp0125 // (c) 1987 IGT - International Game Technology
pepp0126 // (c) 1987 IGT - International Game Technology
pepp0127 // (c) 1987 IGT - International Game Technology
pepp0127a // (c) 1987 IGT - International Game Technology
+pepp0130 // (c) 1987 IGT - International Game Technology
+pepp0132 // (c) 1987 IGT - International Game Technology
+pepp0150 // (c) 1987 IGT - International Game Technology
pepp0158 // (c) 1987 IGT - International Game Technology
pepp0158a // (c) 1987 IGT - International Game Technology
pepp0158b // (c) 1987 IGT - International Game Technology
@@ -11180,6 +11230,7 @@ pepp0159 // (c) 1987 IGT - International Game Technology
pepp0171 // (c) 1987 IGT - International Game Technology
pepp0171a // (c) 1987 IGT - International Game Technology
pepp0178 // (c) 1987 IGT - International Game Technology
+pepp0181 // (c) 1987 IGT - International Game Technology
pepp0188 // (c) 1987 IGT - International Game Technology
pepp0188a // (c) 1987 IGT - International Game Technology
pepp0190 // (c) 1987 IGT - International Game Technology
@@ -11188,6 +11239,7 @@ pepp0190b // (c) 1987 IGT - International Game Technology
pepp0197 // (c) 1987 IGT - International Game Technology
pepp0197a // (c) 1987 IGT - International Game Technology
pepp0197b // (c) 1987 IGT - International Game Technology
+pepp0197c // (c) 1987 IGT - International Game Technology
pepp0203 // (c) 1987 IGT - International Game Technology
pepp0203a // (c) 1987 IGT - International Game Technology
pepp0203b // (c) 1987 IGT - International Game Technology
@@ -11196,12 +11248,14 @@ pepp0203d // (c) 1987 IGT - International Game Technology
pepp0219 // (c) 1987 IGT - International Game Technology
pepp0221 // (c) 1987 IGT - International Game Technology
pepp0221a // (c) 1987 IGT - International Game Technology
+pepp0223 // (c) 1987 IGT - International Game Technology
pepp0224 // (c) 1987 IGT - International Game Technology
pepp0224a // (c) 1987 IGT - International Game Technology
pepp0230 // (c) 1987 IGT - International Game Technology
pepp0242 // (c) 1987 IGT - International Game Technology
pepp0249 // (c) 1987 IGT - International Game Technology
pepp0250 // (c) 1987 IGT - International Game Technology
+pepp0250a // (c) 1987 IGT - International Game Technology
pepp0265 // (c) 1987 IGT - International Game Technology
pepp0265a // (c) 1987 IGT - International Game Technology
pepp0265b // (c) 1987 IGT - International Game Technology
@@ -11209,13 +11263,18 @@ pepp0274 // (c) 1987 IGT - International Game Technology
pepp0288 // (c) 1987 IGT - International Game Technology
pepp0290 // (c) 1987 IGT - International Game Technology
pepp0291 // (c) 1987 IGT - International Game Technology
+pepp0291a // (c) 1987 IGT - International Game Technology
+pepp0401 // (c) 1987 IGT - International Game Technology
pepp0409 // (c) 1987 IGT - International Game Technology
pepp0410 // (c) 1987 IGT - International Game Technology
+pepp0410a // (c) 1987 IGT - International Game Technology
pepp0417 // (c) 1987 IGT - International Game Technology
pepp0417a // (c) 1987 IGT - International Game Technology
pepp0419 // (c) 1987 IGT - International Game Technology
pepp0420 // (c) 1987 IGT - International Game Technology
pepp0423 // (c) 1987 IGT - International Game Technology
+pepp0423a // (c) 1987 IGT - International Game Technology
+pepp0423b // (c) 1987 IGT - International Game Technology
pepp0426 // (c) 1987 IGT - International Game Technology
pepp0428 // (c) 1987 IGT - International Game Technology
pepp0429 // (c) 1987 IGT - International Game Technology
@@ -11230,6 +11289,7 @@ pepp0452 // (c) 1987 IGT - International Game Technology
pepp0454 // (c) 1987 IGT - International Game Technology
pepp0455 // (c) 1987 IGT - International Game Technology
pepp0458 // (c) 1987 IGT - International Game Technology
+pepp0467 // (c) 1987 IGT - International Game Technology
pepp0488 // (c) 1987 IGT - International Game Technology
pepp0508 // (c) 1987 IGT - International Game Technology
pepp0509 // (c) 1987 IGT - International Game Technology
@@ -11249,6 +11309,7 @@ pepp0538 // (c) 1987 IGT - International Game Technology
pepp0540 // (c) 1987 IGT - International Game Technology
pepp0542 // (c) 1987 IGT - International Game Technology
pepp0542a // (c) 1987 IGT - International Game Technology
+pepp0550 // (c) 1987 IGT - International Game Technology
pepp0568 // (c) 1987 IGT - International Game Technology
pepp0585 // (c) 1987 IGT - International Game Technology
pepp0713 // (c) 1987 IGT - International Game Technology
@@ -11256,9 +11317,13 @@ pepp0725 // (c) 1987 IGT - International Game Technology
pepp0725a // (c) 1987 IGT - International Game Technology
pepp0726 // (c) 1987 IGT - International Game Technology
pepp0728 // (c) 1987 IGT - International Game Technology
+pepp0750 // (c) 1987 IGT - International Game Technology
+pepp0757 // (c) 1987 IGT - International Game Technology
pepp0760 // (c) 1987 IGT - International Game Technology
pepp0763 // (c) 1987 IGT - International Game Technology
+pepp0764 // (c) 1987 IGT - International Game Technology
pepp0775 // (c) 1987 IGT - International Game Technology
+pepp0812 // (c) 1987 IGT - International Game Technology
pepp0816 // (c) 1987 IGT - International Game Technology
peip0028 // (c) 1987 IGT - International Game Technology
peip0029 // (c) 1987 IGT - International Game Technology
@@ -11338,6 +11403,7 @@ pex0055po // (c) 1995 IGT - International Game Technology
pex0055pp // (c) 1995 IGT - International Game Technology
pex0055pq // (c) 1995 IGT - International Game Technology
pex0055pr // (c) 1995 IGT - International Game Technology
+pex0057p // (c) 1995 IGT - International Game Technology
pex0060p // (c) 1995 IGT - International Game Technology
pex0124p // (c) 1995 IGT - International Game Technology
pex0150p // (c) 1995 IGT - International Game Technology
@@ -11364,6 +11430,7 @@ pex0455p // (c) 1995 IGT - International Game Technology
pex0458p // (c) 1995 IGT - International Game Technology
pex0459p // (c) 1995 IGT - International Game Technology
pex0459pa // (c) 1995 IGT - International Game Technology
+pex0489p // (c) 1995 IGT - International Game Technology
pex0508p // (c) 1995 IGT - International Game Technology
pex0514p // (c) 1995 IGT - International Game Technology
pex0515p // (c) 1995 IGT - International Game Technology
@@ -11371,7 +11438,9 @@ pex0516p // (c) 1995 IGT - International Game Technology
pex0536p // (c) 1995 IGT - International Game Technology
pex0537p // (c) 1995 IGT - International Game Technology
pex0550p // (c) 1995 IGT - International Game Technology
+pex0557p // (c) 1995 IGT - International Game Technology
pex0568p // (c) 1995 IGT - International Game Technology
+pex0578p // (c) 1995 IGT - International Game Technology
pex0588p // (c) 1995 IGT - International Game Technology
pex0581p // (c) 1995 IGT - International Game Technology
pex0725p // (c) 1995 IGT - International Game Technology
@@ -11383,6 +11452,8 @@ pex2010p // (c) 1995 IGT - International Game Technology
pex2016p // (c) 1995 IGT - International Game Technology
pex2017p // (c) 1995 IGT - International Game Technology
pex2018p // (c) 1995 IGT - International Game Technology
+pex2021p // (c) 1995 IGT - International Game Technology
+pex2024p // (c) 1995 IGT - International Game Technology
pex2025p // (c) 1995 IGT - International Game Technology
pex2026p // (c) 1995 IGT - International Game Technology
pex2027p // (c) 1995 IGT - International Game Technology
@@ -11431,15 +11502,18 @@ pex2306p // (c) 1995 IGT - International Game Technology
pex2307p // (c) 1995 IGT - International Game Technology
pex2308p // (c) 1995 IGT - International Game Technology
pex2310p // (c) 1995 IGT - International Game Technology
+pex2312p // (c) 1995 IGT - International Game Technology
pex2314p // (c) 1995 IGT - International Game Technology
pex2374p // (c) 1995 IGT - International Game Technology
pex2377p // (c) 1995 IGT - International Game Technology
pex2386p // (c) 1995 IGT - International Game Technology
+pex2412p // (c) 1995 IGT - International Game Technology
pex2419p // (c) 1995 IGT - International Game Technology
pex2420p // (c) 1995 IGT - International Game Technology
pex2421p // (c) 1995 IGT - International Game Technology
pex2440p // (c) 1995 IGT - International Game Technology
pex2461p // (c) 1995 IGT - International Game Technology
+pex2474p // (c) 1995 IGT - International Game Technology
pex2478p // (c) 1995 IGT - International Game Technology
pex2479p // (c) 1995 IGT - International Game Technology
pex2480p // (c) 1995 IGT - International Game Technology
@@ -11855,6 +11929,9 @@ nc96 // (c) 1996 Amcoe
nc96a // (c) 1996 Amcoe
nc96b // (c) 1996 Amcoe
nc96c // (c) 1996 Amcoe
+nc96d // (c) 1996 Amcoe
+nc96e // (c) 1996 Amcoe
+nc96f // (c) 1996 Amcoe
nc96txt // (c) 2000 Amcoe
nfb96 // (c) 1996 Amcoe
nfb96a // (c) 1996 Amcoe
@@ -12751,16 +12828,17 @@ cashtrn //
// TAB Austria
// Quizard (Philips CD-I based HW)
cdibios // Base unit
-quizard // (c) TAB Austria 1996
-quizrd12 // (c) TAB Austria 1996
-quizrd17 // (c) TAB Austria 1996
-quizrd18 // (c) TAB Austria 199?
-quizrd22 // (c) TAB Austria 1995
-quizrd23 // (c) TAB Austria 199?
-quizrd34 // (c) TAB Austria 199?
-quizrr42 // (c) TAB Austria 1998
-quizrr41 // (c) TAB Austria 1998
-quizrr40 // (c) TAB Austria 1997
+quizard // (c) TAB Austria 199?
+quizard_17 // (c) TAB Austria 1996
+quizard_12 // (c) TAB Austria 1996
+quizard_10 // (c) TAB Austria 1996
+quizard2 // (c) TAB Austria 1995
+quizard2_22 // (c) TAB Austria 199?
+quizard3 // (c) TAB Austria 1996
+quizard3_32 // (c) TAB Austria 1996
+quizard4 // (c) TAB Austria 1998
+quizard4_41 // (c) TAB Austria 1998
+quizard4_40 // (c) TAB Austria 1997
// Impera (Philips CD-I based HW)
magicard // (c) 199? Impera
@@ -12814,7 +12892,7 @@ vpoker // (c) 198?
specfrce // (c) 2002 ICE/Play Mechanix
jnero // (c) 2004 ICE/Play Mechanix
-// Amatic Trading GMBH
+// Amatic Trading GmbH
suprstar // (c) 1996 Amatic
am_mg24 // (c) 2000 Amatic
am_mg3 // (c) 2000 Amatic
@@ -13396,16 +13474,8 @@ j2sset
// JPM Give us a Break hardware
guab // (c) 1986
-guab3a // (c) 1986
-guab4 // (c) 1986
-guab6 // (c) 1986
-guab6a // (c) 1986
-guab7 // (c) 1986
-guab21 // (c) 1986
-guab43 // (c) 1986
crisscrs // (c) 1986
tenup // (c) 1988
-tenup3 // (c) 1988
// JPM System 5
diff --git a/src/mame/audio/cclimber.c b/src/mame/audio/cclimber.c
index 80108dddb91..ce8d11832ea 100644
--- a/src/mame/audio/cclimber.c
+++ b/src/mame/audio/cclimber.c
@@ -14,6 +14,7 @@ SAMPLES_START_CB_MEMBER( cclimber_audio_device::sh_start )
{
if (machine().root_device().memregion("samples")->base())
m_sample_buf = auto_alloc_array(machine(), INT16, 2 * machine().root_device().memregion("samples")->bytes());
+ save_pointer(NAME(m_sample_buf), 2 * machine().root_device().memregion("samples")->bytes());
}
MACHINE_CONFIG_FRAGMENT( cclimber_audio )
@@ -58,6 +59,9 @@ cclimber_audio_device::cclimber_audio_device(const machine_config &mconfig, cons
void cclimber_audio_device::device_start()
{
+ save_item(NAME(m_sample_num));
+ save_item(NAME(m_sample_freq));
+ save_item(NAME(m_sample_volume));
}
//-------------------------------------------------
diff --git a/src/mame/audio/depthch.c b/src/mame/audio/depthch.c
index 55623b38d0c..07e55d48e98 100644
--- a/src/mame/audio/depthch.c
+++ b/src/mame/audio/depthch.c
@@ -45,7 +45,7 @@ enum
SND_LONGEXPL = 0,
SND_SHRTEXPL,
SND_SPRAY,
- SND_SONAR,
+ SND_SONAR
};
diff --git a/src/mame/audio/geebee.c b/src/mame/audio/geebee.c
index ab84daf034b..8105b65ac41 100644
--- a/src/mame/audio/geebee.c
+++ b/src/mame/audio/geebee.c
@@ -29,15 +29,6 @@ geebee_sound_device::geebee_sound_device(const machine_config &mconfig, const ch
{
}
-//-------------------------------------------------
-// device_config_complete - perform any
-// operations now that the configuration is
-// complete
-//-------------------------------------------------
-
-void geebee_sound_device::device_config_complete()
-{
-}
//-------------------------------------------------
// device_start - device-specific startup
diff --git a/src/mame/audio/irem.c b/src/mame/audio/irem.c
index f9ae63c07bd..06de09520d7 100644
--- a/src/mame/audio/irem.c
+++ b/src/mame/audio/irem.c
@@ -19,6 +19,8 @@ irem_audio_device::irem_audio_device(const machine_config &mconfig, const char *
device_sound_interface(mconfig, *this),
m_port1(0),
m_port2(0)
+ //m_ay_45L(*this, "ay_45l"),
+ //m_ay_45M(*this, "ay_45m")
{
}
@@ -40,8 +42,14 @@ void irem_audio_device::device_start()
{
m_adpcm1 = machine().device<msm5205_device>("msm1");
m_adpcm2 = machine().device<msm5205_device>("msm2");
- m_ay1 = machine().device<ay8910_device>("ay1");
- m_ay2 = machine().device<ay8910_device>("ay2");
+ m_ay_45L = machine().device<ay8910_device>("ay_45l");
+ m_ay_45M = machine().device<ay8910_device>("ay_45m");
+
+ m_audio_BD = machine().device<netlist_mame_logic_input_t>("snd_nl:ibd");
+ m_audio_SD = machine().device<netlist_mame_logic_input_t>("snd_nl:isd");
+ m_audio_OH = machine().device<netlist_mame_logic_input_t>("snd_nl:ioh");
+ m_audio_CH = machine().device<netlist_mame_logic_input_t>("snd_nl:ich");
+ m_audio_SINH = machine().device<netlist_mame_logic_input_t>("snd_nl:sinh");
save_item(NAME(m_port1));
save_item(NAME(m_port2));
@@ -90,17 +98,17 @@ WRITE8_MEMBER( irem_audio_device::m6803_port2_w )
{
/* PSG 0 or 1? */
if (m_port2 & 0x08)
- m_ay1->address_w(space, 0, m_port1);
+ m_ay_45M->address_w(space, 0, m_port1);
if (m_port2 & 0x10)
- m_ay2->address_w(space, 0, m_port1);
+ m_ay_45L->address_w(space, 0, m_port1);
}
else
{
/* PSG 0 or 1? */
if (m_port2 & 0x08)
- m_ay1->data_w(space, 0, m_port1);
+ m_ay_45M->data_w(space, 0, m_port1);
if (m_port2 & 0x10)
- m_ay2->data_w(space, 0, m_port1);
+ m_ay_45L->data_w(space, 0, m_port1);
}
}
m_port2 = data;
@@ -118,15 +126,20 @@ READ8_MEMBER( irem_audio_device::m6803_port1_r )
{
/* PSG 0 or 1? */
if (m_port2 & 0x08)
- return m_ay1->data_r(space, 0);
+ return m_ay_45M->data_r(space, 0);
if (m_port2 & 0x10)
- return m_ay2->data_r(space, 0);
+ return m_ay_45L->data_r(space, 0);
return 0xff;
}
READ8_MEMBER( irem_audio_device::m6803_port2_r )
{
+ /*
+ * Pin21, 6803 (Port 21) tied with 4.7k to +5V
+ *
+ */
+ printf("port2 read\n");
return 0;
}
@@ -138,7 +151,7 @@ READ8_MEMBER( irem_audio_device::m6803_port2_r )
*
*************************************/
-WRITE8_MEMBER( irem_audio_device::ay8910_0_portb_w )
+WRITE8_MEMBER( irem_audio_device::ay8910_45M_portb_w )
{
/* bits 2-4 select MSM5205 clock & 3b/4b playback mode */
m_adpcm1->playmode_w((data >> 2) & 7);
@@ -152,8 +165,19 @@ WRITE8_MEMBER( irem_audio_device::ay8910_0_portb_w )
}
-WRITE8_MEMBER( irem_audio_device::ay8910_1_porta_w )
+WRITE8_MEMBER( irem_audio_device::ay8910_45L_porta_w )
{
+ /*
+ * 45L 21 IOA0 ==> BD
+ * 45L 20 IOA1 ==> SD
+ * 45L 19 IOA2 ==> OH
+ * 45L 18 IOA3 ==> CH
+ *
+ */
+ if (m_audio_BD) m_audio_BD->write_line(data & 0x01 ? 1: 0);
+ if (m_audio_SD) m_audio_SD->write_line(data & 0x02 ? 1: 0);
+ if (m_audio_OH) m_audio_OH->write_line(data & 0x04 ? 1: 0);
+ if (m_audio_CH) m_audio_CH->write_line(data & 0x08 ? 1: 0);
#ifdef MAME_DEBUG
if (data & 0x0f) popmessage("analog sound %x",data&0x0f);
#endif
@@ -355,7 +379,107 @@ static ADDRESS_MAP_START( irem_sound_portmap, AS_IO, 8, driver_device )
AM_RANGE(M6801_PORT2, M6801_PORT2) AM_DEVREADWRITE("irem_audio", irem_audio_device, m6803_port2_r, m6803_port2_w)
ADDRESS_MAP_END
+/*
+ * Original recordings:
+ *
+ * https://www.youtube.com/watch?v=Hr1wZpwP7R4
+ *
+ * This is not an original recording ("drums added")
+ *
+ * https://www.youtube.com/watch?v=aarl0xfBQf0
+ *
+ */
+
+#define USE_FRONTIERS 1
+#define USE_FIXED_STV 1
+
+#include "nl_kidniki.c"
+
+NETLIST_START(kidniki_interface)
+
+#if (USE_FRONTIERS)
+ SOLVER(Solver, 18000)
+ PARAM(Solver.ACCURACY, 1e-7)
+ PARAM(Solver.NR_LOOPS, 300)
+ PARAM(Solver.GS_LOOPS, 1)
+ PARAM(Solver.GS_THRESHOLD, 99)
+ PARAM(Solver.ITERATIVE, "SOR")
+ PARAM(Solver.PARALLEL, 1)
+ PARAM(Solver.SOR_FACTOR, 1.00)
+#else
+ SOLVER(Solver, 12000)
+ PARAM(Solver.ACCURACY, 1e-8)
+ PARAM(Solver.NR_LOOPS, 300)
+ PARAM(Solver.GS_LOOPS, 20)
+ PARAM(Solver.ITERATIVE, "GMRES")
+ PARAM(Solver.PARALLEL, 0)
+#endif
+
+ LOCAL_SOURCE(kidniki_schematics)
+
+ ANALOG_INPUT(I_V5, 5)
+ //ANALOG_INPUT(I_V0, 0)
+ ALIAS(I_V0.Q, GND)
+
+ /* AY 8910 internal resistors */
+
+ RES(R_AY45L_A, 1000)
+ RES(R_AY45L_B, 1000)
+ RES(R_AY45L_C, 1000)
+
+ RES(R_AY45M_A, 1000)
+ RES(R_AY45M_B, 1000)
+ RES(R_AY45M_C, 1000)
+
+ NET_C(I_V5, R_AY45L_A.1, R_AY45L_B.1, R_AY45L_C.1, R_AY45M_A.1, R_AY45M_B.1, R_AY45M_C.1)
+ NET_C(R_AY45L_A.2, R_AY45L_B.2, R_AY45M_A.2, R_AY45M_B.2, R_AY45M_C.2)
+
+ ALIAS(I_SOUNDIC0, R_AY45L_C.2)
+ ALIAS(I_SOUND0, R_AY45L_A.2)
+
+ /* On M62 boards with pcb pictures available
+ * D6 is missing, although the pcb print exists.
+ * We are replacing this with a 10m Resistor.
+ */
+ TTL_INPUT(SINH, 1)
+#if 0
+ DIODE(D6, "1N914")
+ NET_C(D6.K, SINH)
+ ALIAS(I_SINH0, D6.A)
+#else
+ RES(SINH_DUMMY, RES_M(10))
+ NET_C(SINH_DUMMY.1, SINH)
+ ALIAS(I_SINH0, SINH_DUMMY.2)
+#endif
+
+ NET_MODEL(".model AY8910PORT FAMILY(OVL=0.05 OVH=4.95 ORL=100.0 ORH=0.5k)")
+
+ LOGIC_INPUT(I_SD0, 1, "AY8910PORT")
+ //CLOCK(I_SD0, 5)
+ LOGIC_INPUT(I_BD0, 1, "AY8910PORT")
+ //CLOCK(I_BD0, 5)
+ LOGIC_INPUT(I_CH0, 1, "AY8910PORT")
+ //CLOCK(I_CH0, 2.2 )
+ LOGIC_INPUT(I_OH0, 1, "AY8910PORT")
+ //CLOCK(I_OH0, 1.0)
+ ANALOG_INPUT(I_MSM2K0, 0)
+ ANALOG_INPUT(I_MSM3K0, 0)
+
+ INCLUDE(kidniki_schematics)
+
+ #if (USE_FRONTIERS)
+ OPTIMIZE_FRONTIER(C63.2, RES_K(27), RES_K(1))
+ OPTIMIZE_FRONTIER(R31.2, RES_K(5.1), 50)
+ OPTIMIZE_FRONTIER(R29.2, RES_K(2.7), 50)
+ OPTIMIZE_FRONTIER(R87.2, RES_K(68), 50)
+
+ OPTIMIZE_FRONTIER(R50.1, RES_K(2.2), 50)
+ OPTIMIZE_FRONTIER(R55.1, RES_K(510), 50)
+ OPTIMIZE_FRONTIER(R84.2, RES_K(50), RES_K(5))
+ #endif
+
+NETLIST_END()
/*************************************
*
@@ -374,27 +498,63 @@ static MACHINE_CONFIG_FRAGMENT( irem_audio_base )
MCFG_SOUND_ADD("irem_audio", IREM_AUDIO, 0)
- MCFG_SOUND_ADD("ay1", AY8910, XTAL_3_579545MHz/4) /* verified on pcb */
- MCFG_AY8910_OUTPUT_TYPE(AY8910_SINGLE_OUTPUT | AY8910_DISCRETE_OUTPUT)
- MCFG_AY8910_RES_LOADS(470, 0, 0)
+ MCFG_SOUND_ADD("ay_45m", AY8910, XTAL_3_579545MHz/4) /* verified on pcb */
+ MCFG_AY8910_OUTPUT_TYPE(AY8910_RESISTOR_OUTPUT)
+ MCFG_AY8910_RES_LOADS(2000.0, 2000.0, 2000.0)
MCFG_AY8910_PORT_A_READ_CB(READ8(driver_device, soundlatch_byte_r))
- MCFG_AY8910_PORT_B_WRITE_CB(DEVWRITE8("irem_audio", irem_audio_device, ay8910_0_portb_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
-
- MCFG_SOUND_ADD("ay2", AY8910, XTAL_3_579545MHz/4) /* verified on pcb */
- MCFG_AY8910_OUTPUT_TYPE(AY8910_SINGLE_OUTPUT | AY8910_DISCRETE_OUTPUT)
- MCFG_AY8910_RES_LOADS(470, 0, 0)
- MCFG_AY8910_PORT_A_WRITE_CB(DEVWRITE8("irem_audio", irem_audio_device, ay8910_1_porta_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
+ MCFG_AY8910_PORT_B_WRITE_CB(DEVWRITE8("irem_audio", irem_audio_device, ay8910_45M_portb_w))
+ MCFG_SOUND_ROUTE_EX(0, "snd_nl", 1.0, 0)
+ MCFG_SOUND_ROUTE_EX(1, "snd_nl", 1.0, 1)
+ MCFG_SOUND_ROUTE_EX(2, "snd_nl", 1.0, 2)
+
+ MCFG_SOUND_ADD("ay_45l", AY8910, XTAL_3_579545MHz/4) /* verified on pcb */
+ MCFG_AY8910_OUTPUT_TYPE(AY8910_RESISTOR_OUTPUT)
+ MCFG_AY8910_RES_LOADS(2000.0, 2000.0, 2000.0)
+ MCFG_AY8910_PORT_A_WRITE_CB(DEVWRITE8("irem_audio", irem_audio_device, ay8910_45L_porta_w))
+ MCFG_SOUND_ROUTE_EX(0, "snd_nl", 1.0, 3)
+ MCFG_SOUND_ROUTE_EX(1, "snd_nl", 1.0, 4)
+ MCFG_SOUND_ROUTE_EX(2, "snd_nl", 1.0, 5)
MCFG_SOUND_ADD("msm1", MSM5205, XTAL_384kHz) /* verified on pcb */
MCFG_MSM5205_VCLK_CB(DEVWRITELINE("irem_audio", irem_audio_device, adpcm_int)) /* interrupt function */
MCFG_MSM5205_PRESCALER_SELECTOR(MSM5205_S96_4B) /* default to 4KHz, but can be changed at run time */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
+ MCFG_SOUND_ROUTE_EX(0, "snd_nl", 1.0, 6)
MCFG_SOUND_ADD("msm2", MSM5205, XTAL_384kHz) /* verified on pcb */
MCFG_MSM5205_PRESCALER_SELECTOR(MSM5205_SEX_4B) /* default to 4KHz, but can be changed at run time, slave */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
+ MCFG_SOUND_ROUTE_EX(0, "snd_nl", 1.0, 7)
+
+ /* NETLIST configuration using internal AY8910 resistor values */
+
+ MCFG_SOUND_ADD("snd_nl", NETLIST_SOUND, 48000)
+ MCFG_NETLIST_SETUP(kidniki_interface)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+
+ MCFG_NETLIST_LOGIC_INPUT("snd_nl", "ibd", "I_BD0.IN", 0, 1)
+ MCFG_NETLIST_LOGIC_INPUT("snd_nl", "isd", "I_SD0.IN", 0, 1)
+ MCFG_NETLIST_LOGIC_INPUT("snd_nl", "ich", "I_CH0.IN", 0, 1)
+ MCFG_NETLIST_LOGIC_INPUT("snd_nl", "ioh", "I_OH0.IN", 0, 1)
+ MCFG_NETLIST_LOGIC_INPUT("snd_nl", "sinh", "SINH.IN", 0, 1)
+
+ MCFG_NETLIST_STREAM_INPUT("snd_nl", 0, "R_AY45M_A.R")
+ MCFG_NETLIST_STREAM_INPUT("snd_nl", 1, "R_AY45M_B.R")
+ MCFG_NETLIST_STREAM_INPUT("snd_nl", 2, "R_AY45M_C.R")
+
+ MCFG_NETLIST_STREAM_INPUT("snd_nl", 3, "R_AY45L_A.R")
+ MCFG_NETLIST_STREAM_INPUT("snd_nl", 4, "R_AY45L_B.R")
+ MCFG_NETLIST_STREAM_INPUT("snd_nl", 5, "R_AY45L_C.R")
+
+
+ MCFG_NETLIST_STREAM_INPUT("snd_nl", 6, "I_MSM2K0.IN")
+ MCFG_NETLIST_ANALOG_MULT_OFFSET(5.0/65535.0, 2.5)
+ MCFG_NETLIST_STREAM_INPUT("snd_nl", 7, "I_MSM3K0.IN")
+ MCFG_NETLIST_ANALOG_MULT_OFFSET(5.0/65535.0, 2.5)
+
+ //MCFG_NETLIST_STREAM_OUTPUT("snd_nl", 0, "RV1.1")
+ //MCFG_NETLIST_ANALOG_MULT_OFFSET(30000.0, -35000.0)
+ MCFG_NETLIST_STREAM_OUTPUT("snd_nl", 0, "R26.1")
+ MCFG_NETLIST_ANALOG_MULT_OFFSET(30000.0 * 10.0, 0.0)
+
MACHINE_CONFIG_END
MACHINE_CONFIG_FRAGMENT( m52_sound_c_audio )
@@ -409,17 +569,17 @@ MACHINE_CONFIG_FRAGMENT( m52_sound_c_audio )
MCFG_SOUND_ADD("irem_audio", IREM_AUDIO, 0)
- MCFG_SOUND_ADD("ay1", AY8910, XTAL_3_579545MHz/4) /* verified on pcb */
+ MCFG_SOUND_ADD("ay_45m", AY8910, XTAL_3_579545MHz/4) /* verified on pcb */
MCFG_AY8910_OUTPUT_TYPE(AY8910_SINGLE_OUTPUT | AY8910_DISCRETE_OUTPUT)
MCFG_AY8910_RES_LOADS(470, 0, 0)
MCFG_AY8910_PORT_A_READ_CB(READ8(driver_device, soundlatch_byte_r))
- MCFG_AY8910_PORT_B_WRITE_CB(DEVWRITE8("irem_audio", irem_audio_device, ay8910_0_portb_w))
+ MCFG_AY8910_PORT_B_WRITE_CB(DEVWRITE8("irem_audio", irem_audio_device, ay8910_45M_portb_w))
MCFG_SOUND_ROUTE_EX(0, "filtermix", 1.0, 0)
- MCFG_SOUND_ADD("ay2", AY8910, XTAL_3_579545MHz/4) /* verified on pcb */
+ MCFG_SOUND_ADD("ay_45l", AY8910, XTAL_3_579545MHz/4) /* verified on pcb */
MCFG_AY8910_OUTPUT_TYPE(AY8910_SINGLE_OUTPUT | AY8910_DISCRETE_OUTPUT)
MCFG_AY8910_RES_LOADS(470, 0, 0)
- MCFG_AY8910_PORT_A_WRITE_CB(DEVWRITE8("irem_audio", irem_audio_device, ay8910_1_porta_w))
+ MCFG_AY8910_PORT_A_WRITE_CB(DEVWRITE8("irem_audio", irem_audio_device, ay8910_45L_porta_w))
MCFG_SOUND_ROUTE_EX(0, "filtermix", 1.0, 1)
MCFG_SOUND_ADD("msm1", MSM5205, XTAL_384kHz) /* verified on pcb */
diff --git a/src/mame/audio/irem.h b/src/mame/audio/irem.h
index 863fc992c6d..aa59e4e5c63 100644
--- a/src/mame/audio/irem.h
+++ b/src/mame/audio/irem.h
@@ -2,6 +2,7 @@
// copyright-holders:Couriersud
#include "sound/ay8910.h"
#include "sound/msm5205.h"
+#include "machine/netlist.h"
class irem_audio_device : public device_t,
public device_sound_interface
@@ -15,14 +16,16 @@ public:
DECLARE_WRITE8_MEMBER( m6803_port2_w );
DECLARE_READ8_MEMBER( m6803_port1_r );
DECLARE_READ8_MEMBER( m6803_port2_r );
- DECLARE_WRITE8_MEMBER( ay8910_0_portb_w );
- DECLARE_WRITE8_MEMBER( ay8910_1_porta_w );
+ DECLARE_WRITE8_MEMBER( ay8910_45M_portb_w );
+ DECLARE_WRITE8_MEMBER( ay8910_45L_porta_w );
DECLARE_WRITE8_MEMBER( sound_irq_ack_w );
DECLARE_WRITE8_MEMBER( m52_adpcm_w );
DECLARE_WRITE8_MEMBER( m62_adpcm_w );
void adpcm_int(int st);
+ netlist_mame_logic_input_t * m_audio_SINH;
+
protected:
// device-level overrides
virtual void device_config_complete();
@@ -36,10 +39,18 @@ private:
UINT8 m_port1;
UINT8 m_port2;
- ay8910_device *m_ay1;
- ay8910_device *m_ay2;
+ /* FIXME: using required / optional device would be better */
+ // required_device<ay8910_device> m_ay_45L;
+ // required_device<ay8910_device> m_ay_45M;
+ ay8910_device *m_ay_45L;
+ ay8910_device *m_ay_45M;
msm5205_device *m_adpcm1;
msm5205_device *m_adpcm2;
+
+ netlist_mame_logic_input_t * m_audio_BD;
+ netlist_mame_logic_input_t * m_audio_SD;
+ netlist_mame_logic_input_t * m_audio_OH;
+ netlist_mame_logic_input_t * m_audio_CH;
};
MACHINE_CONFIG_EXTERN( m52_sound_c_audio );
diff --git a/src/mame/audio/m79amb.c b/src/mame/audio/m79amb.c
index eba68d316dd..3d9df21221f 100644
--- a/src/mame/audio/m79amb.c
+++ b/src/mame/audio/m79amb.c
@@ -330,7 +330,7 @@ WRITE8_MEMBER(m79amb_state::m79amb_8000_w)
m_discrete->write(space, M79AMB_SHOT_EN, data & 0x01);
m_discrete->write(space, M79AMB_BOOM_EN, data & 0x02);
m_discrete->write(space, M79AMB_THUD_EN, data & 0x04);
-};
+}
WRITE8_MEMBER(m79amb_state::m79amb_8003_w)
{
diff --git a/src/mame/audio/mario.c b/src/mame/audio/mario.c
index 0a96e566937..3958aa8d743 100644
--- a/src/mame/audio/mario.c
+++ b/src/mame/audio/mario.c
@@ -125,7 +125,7 @@ static NETLIST_START(nl_mario_snd7)
NET_C(R65.2, 4K_A.FC, C44.1)
NET_C(C44.2, GND)
- CD_4020(3H, 4K_B.Y, ttllow, V5, GND)
+ CD4020_WI(3H, 4K_B.Y, ttllow, V5, GND)
TTL_7404_INVERT(4J_B, 3H.Q12)
RES(R64, RES_K(20))
@@ -193,13 +193,15 @@ NETLIST_END()
static NETLIST_START(nl_mario)
- /* Standard stuff */
+ LOCAL_SOURCE(nl_mario_snd0)
+ LOCAL_SOURCE(nl_mario_snd7)
+ LOCAL_SOURCE(nl_mario_dac)
SOLVER(Solver, 48000)
PARAM(Solver.ACCURACY, 1e-8)
PARAM(Solver.SOR_FACTOR, 1.0)
PARAM(Solver.GS_THRESHOLD, 5)
- PARAM(Solver.GS_LOOPS, 4)
+ PARAM(Solver.GS_LOOPS, 1)
//PARAM(Solver.LTE, 5e-2) // Default is not enough for paddle control
PARAM(Solver.DYNAMIC_TS, 0)
ANALOG_INPUT(V5, 5)
@@ -229,14 +231,7 @@ static NETLIST_START(nl_mario)
NET_C(GND, R19.1) //FIXME
NET_C(2K_C.Q, R41.1)
-#if 1
- RES(DUM, RES_K(22))
- NET_C(R39.1, DUM.1)
- NET_C(DUM.2, GND)
- FRONTIER(front1, R39.1, R40.1)
-#else
NET_C(R39.1, R40.1)
-#endif
NET_C(R20.2, R19.2, R40.2, R41.2, C31.1)
NET_C(C31.2, GND)
@@ -283,6 +278,7 @@ static NETLIST_START(nl_mario)
NET_C(GND, ROUT.2)
+ OPTIMIZE_FRONTIER(R40.1, RES_K(22), 50)
NETLIST_END()
#else
diff --git a/src/mame/audio/micro3d.c b/src/mame/audio/micro3d.c
index eff49247cfa..e0ba3722bc9 100644
--- a/src/mame/audio/micro3d.c
+++ b/src/mame/audio/micro3d.c
@@ -22,20 +22,20 @@
*************************************/
/* Borrowed from segasnd.c */
-INLINE void configure_filter(filter_state *state, double r, double c)
+INLINE void configure_filter(m3d_filter_state *state, double r, double c)
{
state->capval = 0;
state->exponent = 1.0 - exp(-1.0 / (r * c * 2000000/8));
}
#if 0
-INLINE double step_rc_filter(filter_state *state, double input)
+INLINE double step_rc_filter(m3d_filter_state *state, double input)
{
state->capval += (input - state->capval) * state->exponent;
return state->capval;
}
-INLINE double step_cr_filter(filter_state *state, double input)
+INLINE double step_cr_filter(m3d_filter_state *state, double input)
{
double result = (input - state->capval);
state->capval += (input - state->capval) * state->exponent;
@@ -144,13 +144,13 @@ void micro3d_sound_device::noise_sh_w(UINT8 data)
m_dac[data & 3] = state->m_dac_data;
- if (m_vca == 255)
+ if (m_dac[VCA] == 255)
m_gain = 0;
else
- m_gain = expf(-(float)(m_vca) / 25.0f) * 10.0f;
+ m_gain = expf(-(float)(m_dac[VCA]) / 25.0f) * 10.0f;
- q = 0.75/255 * (255 - m_vcq) + 0.1;
- fc = 4500.0/255 * (255 - m_vcf) + 100;
+ q = 0.75/255 * (255 - m_dac[VCQ]) + 0.1;
+ fc = 4500.0/255 * (255 - m_dac[VCF]) + 100;
recompute_filter(&m_filter, m_gain, q, fc);
}
@@ -170,16 +170,14 @@ const device_type MICRO3D = &device_creator<micro3d_sound_device>;
micro3d_sound_device::micro3d_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, MICRO3D, "Microprose Audio Custom", tag, owner, clock, "micro3d_sound", __FILE__),
device_sound_interface(mconfig, *this),
- m_vcf(0),
- m_vcq(0),
- m_vca(0),
- m_pan(0),
m_gain(0),
m_noise_shift(0),
m_noise_value(0),
m_noise_subcount(0),
m_stream(NULL)
+
{
+ memset(m_dac, 0, sizeof(UINT8)*4);
}
//-------------------------------------------------
@@ -241,8 +239,8 @@ void micro3d_sound_device::sound_stream_update(sound_stream &stream, stream_samp
if (m_gain == 0)
return;
- pan_l = (float)(255 - m_pan) / 255.0f;
- pan_r = (float)(m_pan) / 255.0f;
+ pan_l = (float)(255 - m_dac[PAN]) / 255.0f;
+ pan_r = (float)(m_dac[PAN]) / 255.0f;
while (samples--)
{
diff --git a/src/mame/audio/nl_kidniki.c b/src/mame/audio/nl_kidniki.c
new file mode 100644
index 00000000000..71f6ea1a14a
--- /dev/null
+++ b/src/mame/audio/nl_kidniki.c
@@ -0,0 +1,484 @@
+
+#include "netlist/devices/net_lib.h"
+
+#ifndef USE_FRONTIERS
+#define USE_FRONTIERS 0
+#endif
+
+#ifndef USE_FIXED_STV
+#define USE_FIXED_STV 0
+#endif
+
+/* ----------------------------------------------------------------------------
+ * Library section header START
+ * ---------------------------------------------------------------------------*/
+
+#ifndef __PLIB_PREPROCESSOR__
+
+#define MC14584B_GATE(_name) \
+ NET_REGISTER_DEV(MC14584B_GATE, _name)
+
+#define MC14584B_DIP(_name) \
+ NET_REGISTER_DEV(MC14584B_DIP, _name)
+
+#define LM324_DIP(_name) \
+ NET_REGISTER_DEV(LM324_DIP, _name)
+
+#define LM358_DIP(_name) \
+ NET_REGISTER_DEV(LM358_DIP, _name)
+
+NETLIST_EXTERNAL(kidniki_lib)
+
+#endif
+
+/* ----------------------------------------------------------------------------
+ * Library section header END
+ * ---------------------------------------------------------------------------*/
+
+/* ----------------------------------------------------------------------------
+ * Kidniki schematics
+ * ---------------------------------------------------------------------------*/
+
+NETLIST_START(kidniki_schematics)
+ // EESCHEMA NETLIST VERSION 1.1 (SPICE FORMAT) CREATION DATE: SAT 06 JUN 2015 01:06:26 PM CEST
+ // TO EXCLUDE A COMPONENT FROM THE SPICE NETLIST ADD [SPICE_NETLIST_ENABLED] USER FIELD SET TO: N
+ // TO REORDER THE COMPONENT SPICE NODE SEQUENCE ADD [SPICE_NODE_SEQUENCE] USER FIELD AND DEFINE SEQUENCE: 2,1,0
+ // SHEET NAME:/
+ // IGNORED O_AUDIO0: O_AUDIO0 49 0
+ // .END
+
+ LOCAL_SOURCE(kidniki_lib)
+ INCLUDE(kidniki_lib)
+
+ /*
+ * Workaround: The simplified opamp model does not correctly
+ * model the internals of the inputs.
+ */
+
+ ANALOG_INPUT(VWORKAROUND, 2.061)
+ RES(RWORKAROUND, RES_K(27))
+ NET_C(VWORKAROUND.Q, RWORKAROUND.1)
+ NET_C(XU1.6, RWORKAROUND.2)
+
+ CAP(C200, CAP_N(100))
+ CAP(C28, CAP_U(1))
+ CAP(C31, CAP_N(470))
+ CAP(C32, CAP_N(3.3))
+ CAP(C33, CAP_U(1))
+ CAP(C34, CAP_N(1))
+ CAP(C35, CAP_N(1))
+ CAP(C36, CAP_N(6.5))
+ CAP(C37, CAP_N(22))
+ CAP(C38, CAP_N(1))
+ CAP(C39, CAP_N(1))
+ CAP(C40, CAP_P(12))
+ CAP(C41, CAP_U(1))
+ CAP(C42, CAP_N(1.2))
+ CAP(C43, CAP_N(1.2))
+ CAP(C44, CAP_U(1))
+ CAP(C45, CAP_N(22))
+ CAP(C47, CAP_U(1))
+ CAP(C48, CAP_N(470))
+ CAP(C49, CAP_N(3.3))
+ CAP(C50, CAP_N(22))
+ CAP(C51, CAP_N(22))
+ CAP(C52, CAP_N(27))
+ CAP(C53, CAP_N(27))
+ CAP(C56, CAP_N(6.8))
+ CAP(C57, CAP_N(6.8))
+ CAP(C59, CAP_N(6.8))
+ CAP(C60, CAP_N(22))
+ CAP(C61, CAP_N(22))
+ CAP(C62, CAP_N(6.8))
+ CAP(C63, CAP_N(1))
+ CAP(C64, CAP_N(68))
+ CAP(C65, CAP_N(68))
+ CAP(C66, CAP_N(68))
+ CAP(C67, CAP_N(15))
+ CAP(C68, CAP_N(15))
+ CAP(C69, CAP_N(10))
+ CAP(C70, CAP_N(22))
+ CAP(C72, CAP_N(12))
+ CAP(C73, CAP_N(10))
+ CAP(C76, CAP_N(68))
+ CAP(C77, CAP_N(12))
+
+ DIODE(D3, "1S1588")
+ DIODE(D4, "1S1588")
+ DIODE(D5, "1S1588")
+
+ POT(RV1, RES_K(50))
+
+ QBJT_EB(Q10, "2SC945")
+ QBJT_EB(Q3, "2SC945")
+ QBJT_EB(Q4, "2SC945")
+ QBJT_EB(Q5, "2SC945")
+ QBJT_EB(Q6, "2SC945")
+ QBJT_EB(Q7, "2SC945")
+ QBJT_EB(Q9, "2SC945")
+
+ LM324_DIP(XU1)
+ LM358_DIP(XU2)
+ //SUBMODEL(LM324_DIP,XU1)
+ //SUBMODEL(LM358_DIP,XU2)
+
+ MC14584B_DIP(XU3)
+
+ RES(R100, RES_K(560))
+ RES(R101, RES_K(150))
+ RES(R102, RES_K(150))
+ RES(R103, RES_K(470))
+ RES(R104, RES_K(22))
+ RES(R105, RES_K(470))
+ RES(R106, RES_K(150))
+ RES(R107, RES_K(150))
+ RES(R108, RES_K(560))
+ RES(R119, RES_K(22))
+ RES(R200, RES_K(100))
+ RES(R201, RES_K(100))
+ RES(R27, RES_K(6.8))
+ RES(R28, RES_K(150))
+ RES(R29, RES_K(2.7))
+ RES(R30, RES_K(10))
+ RES(R31, RES_K(5.1))
+ //RES(R32, RES_K(1))
+ RES(R32, RES_K(4.7))
+ RES(R34, RES_K(100))
+ RES(R35, RES_K(100))
+ RES(R36, RES_K(100))
+ RES(R37, RES_K(47))
+ RES(R38, 820)
+ RES(R39, RES_K(22))
+ RES(R40, RES_K(10))
+ RES(R41, RES_K(10))
+ RES(R42, RES_K(150))
+ RES(R43, 470)
+ RES(R44, RES_K(100))
+ RES(R45, RES_K(1))
+ RES(R46, RES_K(12))
+ RES(R48, 470)
+ RES(R48_2, RES_K(100))
+ RES(R49, RES_K(10))
+ RES(R50, RES_K(2.2))
+ RES(R51, RES_K(150))
+ RES(R52, RES_K(100))
+ RES(R53, RES_K(100))
+ RES(R54, RES_K(680))
+ RES(R55, RES_K(510))
+ RES(R57, 560)
+ RES(R58, RES_K(39))
+ RES(R59, 560)
+ RES(R60, RES_K(39))
+ RES(R61, RES_K(100))
+ RES(R62, RES_K(100))
+ RES(R63, RES_K(1))
+ RES(R65, RES_K(1))
+ RES(R65_1, RES_K(27))
+ RES(R66, RES_M(1))
+ RES(R67, RES_K(100))
+ RES(R68, RES_K(100))
+ RES(R69, RES_K(1))
+ RES(R70, RES_K(10))
+ RES(R71, RES_K(100))
+ RES(R72, RES_K(100))
+ RES(R73, RES_K(10))
+ RES(R74, RES_K(10))
+ RES(R75, RES_K(10))
+ RES(R76, RES_K(10))
+ RES(R81, 220)
+ RES(R82, RES_M(2.2))
+ RES(R83, RES_K(12))
+ RES(R84, RES_K(1))
+ RES(R85, RES_M(2.2))
+ RES(R86, RES_K(10))
+ RES(R87, RES_K(68))
+ RES(R89, RES_K(22))
+ RES(R90, RES_K(390))
+ RES(R91, RES_K(100))
+ RES(R92, RES_K(22))
+ RES(R93, RES_K(1))
+ RES(R94, RES_K(22))
+ RES(R95, RES_K(330))
+ RES(R96, RES_K(150))
+ RES(R97, RES_K(150))
+ RES(R98, RES_K(650))
+
+ #if USE_FIXED_STV
+ ANALOG_INPUT(STV, 2)
+ #else
+ RES(R78, RES_K(3.3))
+ RES(R77, RES_K(2.2))
+ CAP(C58, CAP_U(47))
+ #endif
+
+ NET_C(R95.1, XU3.2, R96.2)
+ NET_C(R95.2, XU3.1, C69.1)
+ NET_C(XU3.3, R103.2, C73.1)
+ NET_C(XU3.4, R103.1, R102.2)
+ NET_C(XU3.5, R105.2, C72.1)
+ NET_C(XU3.6, R105.1, R106.2)
+ #if USE_FIXED_STV
+ //FIXME: We should have a NET_C_REMOVE
+ NET_C(/*XU3.7,*/ C69.2, C73.2, C72.2, C77.2, C67.2, C68.2, R65.2, R38.2, XU1.11, R54.2, Q4.E, R63.2, C47.2, R72.2, R67.2, R71.2, R68.2, C48.2, R46.2, C28.1, C32.1, R43.2, XU2.4, C56.1, C52.1,/* R77.2, C58.1, */ R48.2, R93.2, R94.2, R119.2, R104.2, R53.2, R34.2, R81.2, R92.2, R89.2, C33.1, R37.2, R36.1, R91.1, I_V0.Q, RV1.3)
+ #else
+ NET_C(/*XU3.7,*/ C69.2, C73.2, C72.2, C77.2, C67.2, C68.2, R65.2, R38.2, XU1.11, R54.2, Q4.E, R63.2, C47.2, R72.2, R67.2, R71.2, R68.2, C48.2, R46.2, C28.1, C32.1, R43.2, XU2.4, C56.1, C52.1, R77.2, C58.1, R48.2, R93.2, R94.2, R119.2, R104.2, R53.2, R34.2, R81.2, R92.2, R89.2, C33.1, R37.2, R36.1, R91.1, I_V0.Q, RV1.3)
+ #endif
+ NET_C(XU3.8, R108.1, R107.2)
+ NET_C(XU3.9, R108.2, C77.1)
+ NET_C(XU3.10, R100.1, R101.2)
+ NET_C(XU3.11, R100.2, C67.1)
+ NET_C(XU3.12, R98.1, R97.2)
+ NET_C(XU3.13, R98.2, C68.1)
+ #if USE_FIXED_STV
+ NET_C(/*XU3.14,*/ XU1.4, R66.1, R70.1, Q6.C, Q5.C, XU2.8, /* R78.1, */ R86.1, R83.1, Q3.C, I_V5.Q)
+ #else
+ NET_C(/*XU3.14,*/ XU1.4, R66.1, R70.1, Q6.C, Q5.C, XU2.8, R78.1, R86.1, R83.1, Q3.C, I_V5.Q)
+ #endif
+ NET_C(R96.1, R102.1, R106.1, R107.1, R101.1, R97.1, R65.1, C63.2)
+ NET_C(C63.1, R65_1.2)
+ NET_C(R65_1.1, R44.2, C38.2, C40.2, XU1.6)
+ #if USE_FIXED_STV
+ NET_C(R30.1, R41.1, R40.1, STV, R76.2, /* R78.2, R77.1, C58.2*/ STV)
+ #else
+ NET_C(R30.1, R41.1, R40.1, R76.2, R78.2, R77.1, C58.2)
+ #endif
+ NET_C(R30.2, XU1.5)
+ NET_C(R44.1, C39.1, C40.1, R48_2.2)
+ NET_C(C38.1, C39.2, R38.1)
+ NET_C(XU1.1, XU1.2, R39.1, R32.2)
+ NET_C(XU1.3, C34.1, R41.2)
+ NET_C(XU1.7, R45.2)
+ NET_C(XU1.8, XU1.9, R31.2, C36.2)
+ NET_C(XU1.10, R42.1, C32.2)
+ NET_C(XU1.12, C49.1, C31.1, R40.2, C61.1, C60.1)
+ NET_C(XU1.13, R27.1, R28.2)
+ NET_C(XU1.14, R28.1, R29.2, I_SINH0)
+ NET_C(R48_2.1, C45.2, R54.1)
+ NET_C(C45.1, R55.1, Q7.B)
+ NET_C(R55.2, R90.2, C33.2, R37.1, Q3.E)
+ NET_C(R45.1, C44.2)
+ NET_C(C44.1, R66.2, Q4.B)
+ NET_C(Q4.C, C42.1, C43.1, R46.1, C35.2, D4.K, D5.K)
+ NET_C(R70.2, R69.2, Q7.C)
+ NET_C(R63.1, Q7.E)
+ NET_C(R69.1, C49.2)
+ NET_C(C42.2, R58.1, D5.A)
+ NET_C(R58.2, R57.1, C47.1)
+ NET_C(R57.2, Q6.E)
+ NET_C(Q6.B, R61.1)
+ NET_C(C50.1, R67.1, R61.2)
+ NET_C(C50.2, R72.1, I_OH0.Q)
+ NET_C(C51.1, R68.1, R62.2)
+ NET_C(C51.2, R71.1, I_CH0.Q)
+ NET_C(R62.1, Q5.B)
+ NET_C(Q5.E, R59.2)
+ NET_C(R60.1, C43.2, D4.A)
+ NET_C(R60.2, R59.1, C48.1)
+ NET_C(C35.1, C34.2, R39.2)
+ NET_C(R32.1, C31.2)
+ NET_C(R27.2, C28.2)
+ NET_C(R29.1, R31.1, R50.2, R49.1, RV1.1)
+ NET_C(R42.2, R51.1, C36.1)
+ NET_C(R51.2, C41.1)
+ NET_C(C41.2, R43.1, I_SOUNDIC0)
+ NET_C(XU2.1, XU2.2, R73.1)
+ NET_C(XU2.3, R76.1, C200.2)
+ NET_C(XU2.5, C56.2, R75.1)
+ NET_C(XU2.6, XU2.7, R50.1, C53.2)
+ NET_C(R75.2, R74.1, C53.1)
+ NET_C(R74.2, C52.2, R73.2)
+ NET_C(R49.2, R48.1, I_SOUND0)
+ NET_C(Q9.E, R81.1)
+ NET_C(Q9.C, R84.2, R83.2, R82.1, C59.1)
+ NET_C(Q9.B, R82.2, C62.1)
+ NET_C(Q10.E, R93.1)
+ NET_C(Q10.C, R87.2, R86.2, R85.1, C76.1)
+ NET_C(Q10.B, R85.2, C64.1)
+ NET_C(R84.1, C61.2)
+ NET_C(C60.2, R87.1)
+ NET_C(C64.2, C65.1, R94.1, D3.K)
+ NET_C(C65.2, C66.1, R119.1)
+ NET_C(C66.2, C76.2, R104.1)
+ NET_C(R53.1, R52.2, C37.1)
+ NET_C(R34.1, C37.2, I_BD0.Q)
+ NET_C(R52.1, D3.A)
+ NET_C(R92.1, C62.2, C57.1)
+ NET_C(R89.1, C57.2, C59.2, R90.1)
+ NET_C(Q3.B, R35.1)
+ NET_C(R35.2, R36.2, C70.1)
+ NET_C(R91.2, C70.2, I_SD0.Q)
+ NET_C(I_MSM3K0.Q, R200.2)
+ NET_C(I_MSM2K0.Q, R201.2)
+ NET_C(R200.1, R201.1, C200.1)
+
+ /* Amplifier stage */
+
+ CAP(C26, CAP_U(1))
+ RES(R25, 560)
+ RES(R26, RES_K(47))
+ CAP(C29, CAP_U(0.01))
+
+ NET_C(RV1.2, C26.1)
+ NET_C(C26.2, R25.1)
+ NET_C(R25.2, R26.1, C29.1)
+ NET_C(R26.2, C29.2, GND)
+
+NETLIST_END()
+
+/* ----------------------------------------------------------------------------
+ * Library section body START
+ * ---------------------------------------------------------------------------*/
+
+NETLIST_START(opamp)
+
+ /* Opamp model from
+ *
+ * http://www.ecircuitcenter.com/Circuits/opmodel1/opmodel1.htm
+ *
+ * Bandwidth 1Mhz
+ *
+ */
+
+ /* Terminal definitions for calling netlists */
+
+ ALIAS(PLUS, G1.IP) // Positive input
+ ALIAS(MINUS, G1.IN) // Negative input
+ ALIAS(OUT, EBUF.OP) // Opamp output ...
+
+ ALIAS(GND, EBUF.ON) // GND terminal
+ ALIAS(VCC, DUMMY.I) // VCC terminal
+ DUMMY_INPUT(DUMMY)
+
+ /* The opamp model */
+
+ VCCS(G1)
+ PARAM(G1.RI, RES_K(1000))
+#if 1
+ PARAM(G1.G, 100) // typical OP-AMP amplification 100 * 1000 = 100000
+ RES(RP1, 1000)
+ CAP(CP1, 1.59e-5) // <== change to 1.59e-3 for 10Khz bandwidth
+#else
+ PARAM(G1.G, 1) // typical OP-AMP amplification 100 * 1000 = 100000
+ RES(RP1, 100000)
+ CAP(CP1, 1.59e-7) // <== change to 1.59e-3 for 10Khz bandwidth
+#endif
+ VCVS(EBUF)
+ PARAM(EBUF.RO, 50)
+ PARAM(EBUF.G, 1)
+
+// PARAM(EBUF.RI, 1e20)
+// NET_C(EBUF.ON, GND)
+
+ NET_C(G1.ON, GND)
+ NET_C(RP1.2, GND)
+ NET_C(CP1.2, GND)
+ NET_C(EBUF.IN, GND)
+
+ NET_C(RP1.1, G1.OP)
+ NET_C(CP1.1, RP1.1)
+
+ DIODE(DP,"1N914")
+ DIODE(DN,"1N914")
+
+ NET_C(DP.K, VCC)
+#if 1
+ NET_C(DP.A, DN.K, RP1.1)
+#else
+ RES(RDP, 1000)
+ RES(RDN, 1000)
+ NET_C(RDP.1, DP.A)
+ NET_C(RDN.1, DN.K)
+ NET_C(RDP.2, RDN.2, RP1.1)
+#endif
+ NET_C(DN.A, GND)
+
+ NET_C(EBUF.IP, RP1.1)
+
+NETLIST_END()
+
+NETLIST_START(LM324_DIP)
+ SUBMODEL(opamp, op1)
+ SUBMODEL(opamp, op2)
+ SUBMODEL(opamp, op3)
+ SUBMODEL(opamp, op4)
+
+ ALIAS( 1, op1.OUT)
+ ALIAS( 2, op1.MINUS)
+ ALIAS( 3, op1.PLUS)
+
+ ALIAS( 7, op2.OUT)
+ ALIAS( 6, op2.MINUS)
+ ALIAS( 5, op2.PLUS)
+
+ ALIAS( 8, op3.OUT)
+ ALIAS( 9, op3.MINUS)
+ ALIAS(10, op3.PLUS)
+
+ ALIAS(14, op4.OUT)
+ ALIAS(13, op4.MINUS)
+ ALIAS(12, op4.PLUS)
+
+ NET_C(op1.GND, op2.GND, op3.GND, op4.GND)
+ NET_C(op1.VCC, op2.VCC, op3.VCC, op4.VCC)
+
+ ALIAS(11, op1.GND)
+ ALIAS( 4, op1.VCC)
+NETLIST_END()
+
+NETLIST_START(LM358_DIP)
+ SUBMODEL(opamp, op1)
+ SUBMODEL(opamp, op2)
+
+ ALIAS( 1, op1.OUT)
+ ALIAS( 2, op1.MINUS)
+ ALIAS( 3, op1.PLUS)
+
+ ALIAS( 7, op2.OUT)
+ ALIAS( 6, op2.MINUS)
+ ALIAS( 5, op2.PLUS)
+
+
+ NET_C(op1.GND, op2.GND)
+ NET_C(op1.VCC, op2.VCC)
+
+ ALIAS( 4, op1.GND)
+ ALIAS( 8, op1.VCC)
+NETLIST_END()
+
+NETLIST_START(MC14584B_DIP)
+ MC14584B_GATE(s1)
+ MC14584B_GATE(s2)
+ MC14584B_GATE(s3)
+ MC14584B_GATE(s4)
+ MC14584B_GATE(s5)
+ MC14584B_GATE(s6)
+
+ ALIAS( 1, s1.A)
+ ALIAS( 2, s1.Q)
+ ALIAS( 3, s2.A)
+ ALIAS( 4, s2.Q)
+ ALIAS( 5, s3.A)
+ ALIAS( 6, s3.Q)
+
+ ALIAS( 8, s4.Q)
+ ALIAS( 9, s4.A)
+ ALIAS(10, s5.Q)
+ ALIAS(11, s5.A)
+ ALIAS(12, s6.Q)
+ ALIAS(13, s6.A)
+NETLIST_END()
+
+NETLIST_START(kidniki_lib)
+ TRUTHTABLE_START(MC14584B_GATE, 1, 1, 0, "")
+ TT_HEAD(" A | Q ")
+ TT_LINE(" 0 | 1 |100")
+ TT_LINE(" 1 | 0 |100")
+ TT_FAMILY(".model MC14584B FAMILY(IVL=2.1 IVH=2.7 OVL=0.05 OVH=4.95 ORL=10.0 ORH=10.0)")
+ TRUTHTABLE_END()
+
+ LOCAL_LIB_ENTRY(LM324_DIP)
+ LOCAL_LIB_ENTRY(LM358_DIP)
+ LOCAL_LIB_ENTRY(MC14584B_DIP)
+
+NETLIST_END()
+
diff --git a/src/mame/audio/poolshrk.c b/src/mame/audio/poolshrk.c
index a1b2899375d..188d072dda3 100644
--- a/src/mame/audio/poolshrk.c
+++ b/src/mame/audio/poolshrk.c
@@ -157,22 +157,22 @@ DISCRETE_SOUND_END
*
*************************************/
-WRITE8_MEMBER(poolshrk_state::poolshrk_scratch_sound_w)
+WRITE8_MEMBER(poolshrk_state::scratch_sound_w)
{
m_discrete->write(space, POOLSHRK_SCRATCH_SND, offset & 1);
}
-WRITE8_MEMBER(poolshrk_state::poolshrk_score_sound_w)
+WRITE8_MEMBER(poolshrk_state::score_sound_w)
{
m_discrete->write(space, POOLSHRK_SCORE_EN, 1); /* this will trigger the sound code for 1 sample */
}
-WRITE8_MEMBER(poolshrk_state::poolshrk_click_sound_w)
+WRITE8_MEMBER(poolshrk_state::click_sound_w)
{
m_discrete->write(space, POOLSHRK_CLICK_EN, 1); /* this will trigger the sound code for 1 sample */
}
-WRITE8_MEMBER(poolshrk_state::poolshrk_bump_sound_w)
+WRITE8_MEMBER(poolshrk_state::bump_sound_w)
{
m_discrete->write(space, POOLSHRK_BUMP_EN, offset & 1);
}
diff --git a/src/mame/audio/seibu.c b/src/mame/audio/seibu.c
index 9e64e9ef6b0..0d23c437afa 100644
--- a/src/mame/audio/seibu.c
+++ b/src/mame/audio/seibu.c
@@ -83,6 +83,13 @@ seibu_sound_device::seibu_sound_device(const machine_config &mconfig, const char
m_rst10_irq(0xff),
m_rst18_irq(0xff)
{
+ m_encryption_mode = 0;
+ m_decrypted_opcodes = NULL;
+}
+
+void seibu_sound_device::set_encryption(int mode)
+{
+ m_encryption_mode = mode;
}
//-------------------------------------------------
@@ -91,6 +98,33 @@ seibu_sound_device::seibu_sound_device(const machine_config &mconfig, const char
void seibu_sound_device::device_start()
{
+ int length = memregion(":audiocpu")->bytes();
+ UINT8 *rom = memregion(":audiocpu")->base();
+ if (length > 0x10000)
+ {
+ membank(":seibu_bank1")->configure_entries(0, (length - 0x10000) / 0x8000, rom + 0x10000, 0x8000);
+
+ /* Denjin Makai definitely needs this at start-up, it never writes to the bankswitch */
+ membank(":seibu_bank1")->set_entry(0);
+ } else
+ membank(":seibu_bank1")->set_base(rom + 0x8000);
+
+ switch(m_encryption_mode) {
+ case 0: break;
+ case 3: break;
+
+ case 1:
+ get_custom_decrypt();
+ memcpy(m_decrypted_opcodes, rom, length);
+ apply_decrypt(rom, m_decrypted_opcodes, 0x2000);
+ break;
+
+ case 2:
+ get_custom_decrypt();
+ apply_decrypt(rom, m_decrypted_opcodes, length);
+ break;
+ }
+
m_main2sub[0] = m_main2sub[1] = 0;
m_sub2main[0] = m_sub2main[1] = 0;
@@ -108,18 +142,8 @@ void seibu_sound_device::device_start()
void seibu_sound_device::device_reset()
{
- int romlength = machine().root_device().memregion("audiocpu")->bytes();
- UINT8 *rom = machine().root_device().memregion("audiocpu")->base();
-
- m_sound_cpu = machine().device("audiocpu");
+ m_sound_cpu = machine().device(":audiocpu");
update_irq_lines(VECTOR_INIT);
- if (romlength > 0x10000)
- {
- machine().root_device().membank("bank1")->configure_entries(0, (romlength - 0x10000) / 0x8000, rom + 0x10000, 0x8000);
-
- /* Denjin Makai definitely needs this at start-up, it never writes to the bankswitch */
- machine().root_device().membank("bank1")->set_entry(0);
- }
}
static UINT8 decrypt_data(int a,int src)
@@ -155,25 +179,32 @@ static UINT8 decrypt_opcode(int a,int src)
return src;
}
-void seibu_sound_device::decrypt(const char *cpu,int length)
+UINT8 *seibu_sound_device::get_custom_decrypt()
{
- address_space &space = machine().device(cpu)->memory().space(AS_PROGRAM);
- UINT8 *decrypt = auto_alloc_array_clear(machine(), UINT8, length);
- UINT8 *rom = machine().root_device().memregion(cpu)->base();
- int i;
-
- space.set_decrypted_region(0x0000, (length < 0x10000) ? (length - 1) : 0x1fff, decrypt);
+ if (m_decrypted_opcodes)
+ return m_decrypted_opcodes;
+
+ int size = memregion(":audiocpu")->bytes();
+ m_decrypted_opcodes = auto_alloc_array_clear(machine(), UINT8, size);
+ membank(":seibu_bank0d")->set_base(m_decrypted_opcodes);
+ if (size > 0x10000) {
+ membank(":seibu_bank1d")->configure_entries(0, (size - 0x10000) / 0x8000, m_decrypted_opcodes + 0x10000, 0x8000);
+ membank(":seibu_bank1d")->set_entry(0);
+ } else
+ membank(":seibu_bank1d")->set_base(m_decrypted_opcodes + 0x8000);
+
+ return m_decrypted_opcodes;
+}
- for (i = 0;i < length;i++)
+void seibu_sound_device::apply_decrypt(UINT8 *rom, UINT8 *opcodes, int length)
+{
+ for (int i = 0;i < length;i++)
{
UINT8 src = rom[i];
rom[i] = decrypt_data(i,src);
- decrypt[i] = decrypt_opcode(i,src);
+ opcodes[i] = decrypt_opcode(i,src);
}
-
- if (length > 0x10000)
- machine().root_device().membank("bank1")->configure_decrypted_entries(0, (length - 0x10000) / 0x8000, decrypt + 0x10000, 0x8000);
}
void seibu_sound_device::update_irq_lines(int param)
@@ -238,7 +269,9 @@ WRITE_LINE_MEMBER( seibu_sound_device::fm_irqhandler )
WRITE8_MEMBER( seibu_sound_device::bank_w )
{
- space.machine().root_device().membank("bank1")->set_entry(data & 1);
+ membank(":seibu_bank1")->set_entry(data & 1);
+ if (m_decrypted_opcodes)
+ membank(":seibu_bank1d")->set_entry(data & 1);
}
WRITE8_MEMBER( seibu_sound_device::coin_w )
@@ -326,6 +359,11 @@ WRITE16_MEMBER( seibu_sound_device::main_mustb_w )
/***************************************************************************/
+ADDRESS_MAP_START( seibu_sound_decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 8, driver_device )
+ AM_RANGE(0x0000, 0x1fff) AM_ROMBANK("seibu_bank0d")
+ AM_RANGE(0x8000, 0xffff) AM_ROMBANK("seibu_bank1d")
+ADDRESS_MAP_END
+
ADDRESS_MAP_START( seibu_sound_map, AS_PROGRAM, 8, driver_device )
AM_RANGE(0x0000, 0x1fff) AM_ROM
AM_RANGE(0x2000, 0x27ff) AM_RAM
@@ -341,7 +379,7 @@ ADDRESS_MAP_START( seibu_sound_map, AS_PROGRAM, 8, driver_device )
AM_RANGE(0x4018, 0x4019) AM_DEVWRITE("seibu_sound", seibu_sound_device, main_data_w)
AM_RANGE(0x401b, 0x401b) AM_DEVWRITE("seibu_sound", seibu_sound_device, coin_w)
AM_RANGE(0x6000, 0x6000) AM_DEVREADWRITE("oki", okim6295_device, read, write)
- AM_RANGE(0x8000, 0xffff) AM_ROMBANK("bank1")
+ AM_RANGE(0x8000, 0xffff) AM_ROMBANK("seibu_bank1")
ADDRESS_MAP_END
ADDRESS_MAP_START( seibu2_airraid_sound_map, AS_PROGRAM, 8, driver_device )
@@ -359,7 +397,7 @@ ADDRESS_MAP_START( seibu2_airraid_sound_map, AS_PROGRAM, 8, driver_device )
AM_RANGE(0x4018, 0x4019) AM_DEVWRITE("seibu_sound", seibu_sound_device, main_data_w)
AM_RANGE(0x401b, 0x401b) AM_DEVWRITE("seibu_sound", seibu_sound_device, coin_w)
// AM_RANGE(0x6000, 0x6000) AM_DEVREADWRITE("oki", okim6295_device, read, write)
- AM_RANGE(0x8000, 0xffff) AM_ROM
+ AM_RANGE(0x8000, 0xffff) AM_ROMBANK("seibu_bank1")
ADDRESS_MAP_END
ADDRESS_MAP_START( seibu2_sound_map, AS_PROGRAM, 8, driver_device )
@@ -377,7 +415,7 @@ ADDRESS_MAP_START( seibu2_sound_map, AS_PROGRAM, 8, driver_device )
AM_RANGE(0x4018, 0x4019) AM_DEVWRITE("seibu_sound", seibu_sound_device, main_data_w)
AM_RANGE(0x401b, 0x401b) AM_DEVWRITE("seibu_sound", seibu_sound_device, coin_w)
AM_RANGE(0x6000, 0x6000) AM_DEVREADWRITE("oki", okim6295_device, read, write)
- AM_RANGE(0x8000, 0xffff) AM_ROMBANK("bank1")
+ AM_RANGE(0x8000, 0xffff) AM_ROMBANK("seibu_bank1")
ADDRESS_MAP_END
ADDRESS_MAP_START( seibu2_raiden2_sound_map, AS_PROGRAM, 8, driver_device )
@@ -396,7 +434,7 @@ ADDRESS_MAP_START( seibu2_raiden2_sound_map, AS_PROGRAM, 8, driver_device )
AM_RANGE(0x401b, 0x401b) AM_DEVWRITE("seibu_sound", seibu_sound_device, coin_w)
AM_RANGE(0x6000, 0x6000) AM_DEVREADWRITE("oki1", okim6295_device, read, write)
AM_RANGE(0x6002, 0x6002) AM_DEVREADWRITE("oki2", okim6295_device, read, write)
- AM_RANGE(0x8000, 0xffff) AM_ROMBANK("bank1")
+ AM_RANGE(0x8000, 0xffff) AM_ROMBANK("seibu_bank1")
AM_RANGE(0x4004, 0x4004) AM_NOP
AM_RANGE(0x401a, 0x401a) AM_NOP
ADDRESS_MAP_END
@@ -416,7 +454,7 @@ ADDRESS_MAP_START( seibu_newzeroteam_sound_map, AS_PROGRAM, 8, driver_device )
AM_RANGE(0x401a, 0x401a) AM_DEVWRITE("seibu_sound", seibu_sound_device, bank_w)
AM_RANGE(0x401b, 0x401b) AM_DEVWRITE("seibu_sound", seibu_sound_device, coin_w)
AM_RANGE(0x6000, 0x6000) AM_DEVREADWRITE("oki", okim6295_device, read, write)
- AM_RANGE(0x8000, 0xffff) AM_ROMBANK("bank1")
+ AM_RANGE(0x8000, 0xffff) AM_ROMBANK("seibu_bank1")
ADDRESS_MAP_END
ADDRESS_MAP_START( seibu3_sound_map, AS_PROGRAM, 8, driver_device )
@@ -434,7 +472,7 @@ ADDRESS_MAP_START( seibu3_sound_map, AS_PROGRAM, 8, driver_device )
AM_RANGE(0x4018, 0x4019) AM_DEVWRITE("seibu_sound", seibu_sound_device, main_data_w)
AM_RANGE(0x401b, 0x401b) AM_DEVWRITE("seibu_sound", seibu_sound_device, coin_w)
AM_RANGE(0x6008, 0x6009) AM_DEVREADWRITE("ym2", ym2203_device, read, write)
- AM_RANGE(0x8000, 0xffff) AM_ROMBANK("bank1")
+ AM_RANGE(0x8000, 0xffff) AM_ROMBANK("seibu_bank1")
ADDRESS_MAP_END
ADDRESS_MAP_START( seibu3_adpcm_sound_map, AS_PROGRAM, 8, driver_device )
@@ -456,7 +494,7 @@ ADDRESS_MAP_START( seibu3_adpcm_sound_map, AS_PROGRAM, 8, driver_device )
AM_RANGE(0x6005, 0x6006) AM_DEVWRITE("adpcm2", seibu_adpcm_device, adr_w)
AM_RANGE(0x6008, 0x6009) AM_DEVREADWRITE("ym2", ym2203_device, read, write)
AM_RANGE(0x601a, 0x601a) AM_DEVWRITE("adpcm2", seibu_adpcm_device, ctl_w)
- AM_RANGE(0x8000, 0xffff) AM_ROMBANK("bank1")
+ AM_RANGE(0x8000, 0xffff) AM_ROMBANK("seibu_bank1")
ADDRESS_MAP_END
/***************************************************************************
diff --git a/src/mame/audio/seibu.h b/src/mame/audio/seibu.h
index a92ab8a5855..ca3fa2f11c2 100644
--- a/src/mame/audio/seibu.h
+++ b/src/mame/audio/seibu.h
@@ -31,6 +31,7 @@
#include "sound/2203intf.h"
#include "sound/okim6295.h"
+ADDRESS_MAP_EXTERN(seibu_sound_decrypted_opcodes_map, 8);
ADDRESS_MAP_EXTERN(seibu_sound_map, 8);
ADDRESS_MAP_EXTERN(seibu2_sound_map, 8);
ADDRESS_MAP_EXTERN(seibu2_airraid_sound_map, 8);
@@ -58,7 +59,10 @@ public:
DECLARE_READ8_MEMBER( main_data_pending_r );
DECLARE_WRITE8_MEMBER( main_data_w );
DECLARE_WRITE8_MEMBER( pending_w );
- void decrypt(const char *cpu,int length);
+
+ static void apply_decrypt(UINT8 *rom, UINT8 *opcodes, int length);
+ void set_encryption(int mode);
+ UINT8 *get_custom_decrypt();
void update_irq_lines(int param);
protected:
@@ -67,6 +71,9 @@ protected:
virtual void device_reset();
private:
+ int m_encryption_mode;
+ UINT8 *m_decrypted_opcodes;
+
// internal state
device_t *m_sound_cpu;
UINT8 m_main2sub[2];
@@ -188,6 +195,24 @@ extern const device_type SEIBU_ADPCM;
MCFG_CPU_PROGRAM_MAP(seibu3_adpcm_sound_map) \
MCFG_DEVICE_ADD("seibu_sound", SEIBU_SOUND, 0)
+#define SEIBU_SOUND_SYSTEM_ENCRYPTED_LOW() \
+ MCFG_DEVICE_MODIFY("seibu_sound") \
+ downcast<seibu_sound_device *>(device)->set_encryption(1); \
+ MCFG_DEVICE_MODIFY("audiocpu") \
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(seibu_sound_decrypted_opcodes_map)
+
+#define SEIBU_SOUND_SYSTEM_ENCRYPTED_FULL() \
+ MCFG_DEVICE_MODIFY("seibu_sound") \
+ downcast<seibu_sound_device *>(device)->set_encryption(2); \
+ MCFG_DEVICE_MODIFY("audiocpu") \
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(seibu_sound_decrypted_opcodes_map)
+
+#define SEIBU_SOUND_SYSTEM_ENCRYPTED_CUSTOM() \
+ MCFG_DEVICE_MODIFY("seibu_sound") \
+ downcast<seibu_sound_device *>(device)->set_encryption(3); \
+ MCFG_DEVICE_MODIFY("audiocpu") \
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(seibu_sound_decrypted_opcodes_map)
+
#define SEIBU_SOUND_SYSTEM_YM3812_INTERFACE(freq1,freq2) \
MCFG_SPEAKER_STANDARD_MONO("mono") \
\
diff --git a/src/mame/audio/spacefb.c b/src/mame/audio/spacefb.c
index 12cff3cbf78..16df34c04bf 100644
--- a/src/mame/audio/spacefb.c
+++ b/src/mame/audio/spacefb.c
@@ -13,25 +13,25 @@
#include "includes/spacefb.h"
-READ8_MEMBER(spacefb_state::spacefb_audio_p2_r)
+READ8_MEMBER(spacefb_state::audio_p2_r)
{
return (m_sound_latch & 0x18) << 1;
}
-READ8_MEMBER(spacefb_state::spacefb_audio_t0_r)
+READ8_MEMBER(spacefb_state::audio_t0_r)
{
return m_sound_latch & 0x20;
}
-READ8_MEMBER(spacefb_state::spacefb_audio_t1_r)
+READ8_MEMBER(spacefb_state::audio_t1_r)
{
return m_sound_latch & 0x04;
}
-WRITE8_MEMBER(spacefb_state::spacefb_port_1_w)
+WRITE8_MEMBER(spacefb_state::port_1_w)
{
m_audiocpu->set_input_line(0, (data & 0x02) ? CLEAR_LINE : ASSERT_LINE);
diff --git a/src/mame/audio/suna8.c b/src/mame/audio/suna8.c
index 1f0ea7fc597..5fe1ad7cbfe 100644
--- a/src/mame/audio/suna8.c
+++ b/src/mame/audio/suna8.c
@@ -29,7 +29,7 @@ SAMPLES_START_CB_MEMBER(suna8_state::sh_start)
WRITE8_MEMBER(suna8_state::suna8_samples_number_w)
{
- m_sample = data & 0xf;
+ m_sample = data;
logerror("%s: sample number = %02X\n", machine().describe_context(), data);
}
@@ -49,30 +49,27 @@ void suna8_state::play_sample(int index)
WRITE8_MEMBER(suna8_state::suna8_play_samples_w)
{
logerror("%s: play sample = %02X\n", machine().describe_context(), data);
- if ( data )
- {
- if ( ~data & 0x10 )
- {
- play_sample(m_sample);
- }
- else if ( ~data & 0x08 )
- {
- play_sample((m_sample & 3) + 7);
- }
- else if ( ~data & 0x40 ) // sparkman, second sample rom
- {
- play_sample(m_sample + 0x10);
- }
- }
+
+ // At boot: ff (ay reset) -> 00 (game writes ay enable) -> f9 (game writes to port A).
+ // Then game writes f9 -> f1 -> f9. Is bit 3 stop/reset?
+
+ if ( m_play == 0xe9 && data == 0xf9 )
+ play_sample(m_sample & 0x0f);
+ else if ( m_play == 0xb9 && data == 0xf9 ) // second sample rom
+ play_sample(((m_sample >> 4) & 0x0f) + 0x10);
+
+ m_play = data;
}
WRITE8_MEMBER(suna8_state::rranger_play_samples_w)
{
- if (data)
- {
- if (( m_sample != 0 ) && ( ~data & 0x30 )) // don't play sample zero when those bits are active
- {
- play_sample(m_sample);
- }
- }
+ logerror("%s: play sample = %02X\n", machine().describe_context(), data);
+
+ // At boot: ff (ay reset) -> 00 (game writes ay enable) -> 30 (game writes to port A).
+ // Is bit 6 stop/reset?
+
+ if ( m_play == 0x60 && data == 0x70 )
+ play_sample(m_sample & 0x0f);
+
+ m_play = data;
}
diff --git a/src/mame/audio/taito_zm.c b/src/mame/audio/taito_zm.c
index 74334c5081f..069a6536759 100644
--- a/src/mame/audio/taito_zm.c
+++ b/src/mame/audio/taito_zm.c
@@ -114,11 +114,6 @@ ADDRESS_MAP_START( taitozoom_mn_map, AS_PROGRAM, 16, driver_device )
AM_RANGE(0xe00000, 0xe000ff) AM_DEVREADWRITE8("taito_zoom", taito_zoom_device, shared_ram_r, shared_ram_w, 0xffff) // M66220FP for comms with maincpu
ADDRESS_MAP_END
-static ADDRESS_MAP_START( taitozoom_mn_io_map, AS_IO, 8, driver_device )
- ADDRESS_MAP_UNMAP_HIGH
- AM_RANGE(MN10200_PORT1, MN10200_PORT1) AM_DEVREADWRITE("taito_zoom", taito_zoom_device, tms_ctrl_r, tms_ctrl_w)
-ADDRESS_MAP_END
-
/***************************************************************************
@@ -178,8 +173,9 @@ MACHINE_CONFIG_FRAGMENT( taito_zoom_sound )
/* basic machine hardware */
MCFG_TAITO_ZOOM_ADD("taito_zoom")
MCFG_CPU_ADD("mn10200", MN1020012A, XTAL_25MHz/2)
+ MCFG_MN10200_READ_PORT_CB(1, DEVREAD8("taito_zoom", taito_zoom_device, tms_ctrl_r))
+ MCFG_MN10200_WRITE_PORT_CB(1, DEVWRITE8("taito_zoom", taito_zoom_device, tms_ctrl_w))
MCFG_CPU_PROGRAM_MAP(taitozoom_mn_map)
- MCFG_CPU_IO_MAP(taitozoom_mn_io_map)
MCFG_QUANTUM_TIME(attotime::from_hz(60000))
diff --git a/src/mame/audio/turrett.c b/src/mame/audio/turrett.c
index 29b07dbb4c8..6a2fc150c7b 100644
--- a/src/mame/audio/turrett.c
+++ b/src/mame/audio/turrett.c
@@ -103,7 +103,7 @@ void turrett_device::sound_stream_update(sound_stream &stream, stream_sample_t *
for (int s = 0; s < samples; ++s)
{
- INT16 sample = m_direct->read_raw_word(addr << 1);
+ INT16 sample = m_direct->read_word(addr << 1);
if ((UINT16)sample == 0x8000)
{
diff --git a/src/mame/audio/tx1.c b/src/mame/audio/tx1.c
index 8fc0c5085a9..7891d97e29b 100644
--- a/src/mame/audio/tx1.c
+++ b/src/mame/audio/tx1.c
@@ -132,12 +132,12 @@ WRITE8_MEMBER( tx1_sound_device::pit8253_w )
{
if (m_pit8253.idx[offset] == 0)
{
- m_pit8253.counts[offset].LSB = data;
+ m_pit8253.counts[offset].as8bit.LSB = data;
m_pit8253.idx[offset] = 1;
}
else
{
- m_pit8253.counts[offset].MSB = data;
+ m_pit8253.counts[offset].as8bit.MSB = data;
m_pit8253.idx[offset] = 0;
}
}
diff --git a/src/mame/audio/vicdual.c b/src/mame/audio/vicdual.c
index 4c891894557..8576db9bf66 100644
--- a/src/mame/audio/vicdual.c
+++ b/src/mame/audio/vicdual.c
@@ -15,8 +15,6 @@
* Oct 2004, Derrick Renaud
************************************************************************/
-static emu_timer *frogs_croak_timer;
-
/* Discrete Sound Input Nodes */
#define FROGS_FLY_EN NODE_01
@@ -133,7 +131,7 @@ TIMER_CALLBACK_MEMBER( vicdual_state::frogs_croak_callback )
MACHINE_START_MEMBER(vicdual_state,frogs_audio)
{
- frogs_croak_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(vicdual_state::frogs_croak_callback), this));
+ m_frogs_croak_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(vicdual_state::frogs_croak_callback), this));
machine_start();
}
@@ -164,7 +162,7 @@ WRITE8_MEMBER( vicdual_state::frogs_audio_w )
if (last_croak)
{
/* The croak will keep playing until .429s after being disabled */
- frogs_croak_timer->adjust(attotime::from_double(1.1 * RES_K(390) * CAP_U(1)));
+ m_frogs_croak_timer->adjust(attotime::from_double(1.1 * RES_K(390) * CAP_U(1)));
}
}
if (new_buzzz)
diff --git a/src/mame/audio/warpwarp.c b/src/mame/audio/warpwarp.c
index 8f2130fb4a2..1c3f42f9de4 100644
--- a/src/mame/audio/warpwarp.c
+++ b/src/mame/audio/warpwarp.c
@@ -40,15 +40,7 @@ warpwarp_sound_device::warpwarp_sound_device(const machine_config &mconfig, cons
{
}
-//-------------------------------------------------
-// device_config_complete - perform any
-// operations now that the configuration is
-// complete
-//-------------------------------------------------
-void warpwarp_sound_device::device_config_complete()
-{
-}
//-------------------------------------------------
// device_start - device-specific startup
diff --git a/src/mame/audio/warpwarp.h b/src/mame/audio/warpwarp.h
index 9e4352c792f..593208d8939 100644
--- a/src/mame/audio/warpwarp.h
+++ b/src/mame/audio/warpwarp.h
@@ -15,7 +15,6 @@ public:
protected:
// device-level overrides
- virtual void device_config_complete();
virtual void device_start();
// sound stream update overrides
@@ -59,7 +58,6 @@ public:
protected:
// device-level overrides
- virtual void device_config_complete();
virtual void device_start();
// sound stream update overrides
diff --git a/src/mame/drivers/3x3puzzl.c b/src/mame/drivers/3x3puzzl.c
index c0753cec6b7..833d3ead2ca 100644
--- a/src/mame/drivers/3x3puzzl.c
+++ b/src/mame/drivers/3x3puzzl.c
@@ -162,7 +162,7 @@ WRITE16_MEMBER(_3x3puzzle_state::gfx_ctrl_w)
WRITE16_MEMBER(_3x3puzzle_state::tilemap1_scrollx_w)
{
m_tilemap1->set_scrollx(data);
-};
+}
WRITE16_MEMBER(_3x3puzzle_state::tilemap1_scrolly_w)
{
diff --git a/src/mame/drivers/8080bw.c b/src/mame/drivers/8080bw.c
index 5505f551a2e..ec488e6c447 100644
--- a/src/mame/drivers/8080bw.c
+++ b/src/mame/drivers/8080bw.c
@@ -3307,7 +3307,6 @@ ROM_START( searthie )
ROM_LOAD( "searthie.e", 0x1800, 0x0800, CRC(baf949b0) SHA1(bfda97a3ef59fcdf87814afc6918507190c3e315) )
ROM_END
-
ROM_START( invadrmr )
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "11.1t", 0x0000, 0x0400, CRC(389d44b6) SHA1(5d2581b8bc0da918ce57cf319e06b5b31989c681) )
@@ -3318,7 +3317,6 @@ ROM_START( invadrmr )
ROM_LOAD( "sv06.1g", 0x1c00, 0x0400, CRC(2c68e0b4) SHA1(a5e5357120102ad32792bf3ef6362f45b7ba7070) )
ROM_END
-
ROM_START( claybust )
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "0.a1", 0x0000, 0x0400, CRC(90810582) SHA1(a5c3655bae6f92a3cd0eae3a5a3c25e414d4fdf0) )
@@ -3329,7 +3327,6 @@ ROM_START( claybust )
ROM_LOAD( "5.a8", 0x1400, 0x0400, CRC(92cd4da8) SHA1(217e00012a52c479bf0b0cf37ce556387755740d) )
ROM_END
-
ROM_START( gunchamp )
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "251.a1", 0x0000, 0x0400, CRC(f27a8c1e) SHA1(510debd1ac2c0986f99c217e3078208a39d7837c) )
@@ -3342,7 +3339,6 @@ ROM_START( gunchamp )
ROM_LOAD( "258.a10", 0x1c00, 0x0400, CRC(471d4052) SHA1(c8ccda2eba44c2ab49f5fc2874fe70c2bdae35d3) )
ROM_END
-
ROM_START( spaceatt )
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "h", 0x0000, 0x0400, CRC(d0c32d72) SHA1(b3bd950b1ba940fbeb5d95e55113ed8f4c311434) ) // == SV01
@@ -3353,6 +3349,34 @@ ROM_START( spaceatt )
ROM_LOAD( "a", 0x1c00, 0x0400, CRC(211ac4a3) SHA1(e08e90a4e77cfa30400626a484c9f37c87ea13f9) )
ROM_END
+/* SPACE ATTACK set is from Video Game GmbH - 1010 A / Top board shows Video-Games - 6302 LICH - 1034
+ Roms are set up as 1k bproms (82S137) and data is 1 rom top 4 bits, another bottom 4. This data once assembled matches original spaceatt set */
+ROM_START( spaceattbp )
+ ROM_REGION( 0x10000, "maincpu", 0 )
+ ROMX_LOAD( "06e.bin", 0x0000, 0x0400, CRC(68301d05) SHA1(b0c33a982b42378da828281e74356d58fbea1d86), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI )
+ ROMX_LOAD( "12l.bin", 0x0000, 0x0400, CRC(c5a5228f) SHA1(7861b5567d44e972d728551d47aab9b92d71ffc7), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO )
+ ROMX_LOAD( "05de.bin", 0x0400, 0x0400, CRC(42032c14) SHA1(753948e7f52b88655c894b48d419b76de07c14f2), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI )
+ ROMX_LOAD( "11hl.bin", 0x0400, 0x0400, CRC(d5d3811a) SHA1(7d2d983fa88b0349a90a6331ca3e18583125d21e), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO )
+ ROMX_LOAD( "04d.bin", 0x0800, 0x0400, CRC(5f5e540c) SHA1(9092794a878494dbe34c2f05a212ff7b9d00fc55), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI )
+ ROMX_LOAD( "10h.bin", 0x0800, 0x0400, CRC(9d5ef6f1) SHA1(ef584678373375a7f13307d7c4597639a5f6010e), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO )
+ ROMX_LOAD( "03b.bin", 0x1400, 0x0400, CRC(89e13008) SHA1(1ad82ae0607af27925b42758f8c86a0e89079620), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI )
+ ROMX_LOAD( "09g.bin", 0x1400, 0x0400, CRC(c16f5503) SHA1(cf36beac472c5c405342193b7ef434d32b37a4a8), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO )
+ ROMX_LOAD( "02ab.bin", 0x1800, 0x0400, CRC(ffa166c2) SHA1(10496fcbb272130cc200dfb1886808559be8d6ea), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI )
+ ROMX_LOAD( "08f.bin", 0x1800, 0x0400, CRC(b5fa1a2b) SHA1(7eab1cb9a9f95520a37ee4fb2b246ef072dedcbd), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO )
+ ROMX_LOAD( "01a.bin", 0x1c00, 0x0400, CRC(44f8e99c) SHA1(9adecdadb16edaebde02892e30f9f87fb98f4ae1), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI )
+ ROMX_LOAD( "07ef.bin", 0x1c00, 0x0400, CRC(9560880d) SHA1(866d6c3714b939814ce48707be53a69ef8355b34), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO )
+ROM_END
+
+/* SPACE ATTACK set is from Video Games GmbH - Board Typ 1010 C / Top board shows Video-Games - 6302 LICH - 1034B
+ Contains same data as spaceatt but with added 00 fill to make larger roms (b+a=E1, 00fill+c=F1, f+00fill=G1, h+sv02=H1) */
+ROM_START( spaceatt2k )
+ ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD( "H1.bin", 0x0000, 0x0800, CRC(734f5ad8) SHA1(ff6200af4c9110d8181249cbcef1a8a40fa40b7f) )
+ ROM_LOAD( "G1.bin", 0x0800, 0x0800, CRC(6bfaca4a) SHA1(16f48649b531bdef8c2d1446c429b5f414524350) )
+ ROM_LOAD( "F1.bin", 0x1000, 0x0800, CRC(0ccead96) SHA1(537aef03468f63c5b9e11dd61e253f7ae17d9743) )
+ ROM_LOAD( "E1.bin", 0x1800, 0x0800, CRC(19971ca7) SHA1(373900e6796aa681f35158e2c4c7665574990906) )
+ROM_END
+
ROM_START( spaceat2 )
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "spaceatt.h", 0x0000, 0x0800, CRC(a31d0756) SHA1(2b76929654ed0b180091348546dac29fc6e5438e) )
@@ -3371,12 +3395,6 @@ ROM_START( galmonst )
ROM_LOAD( "a.5v", 0x1c00, 0x0400, CRC(05a6806b) SHA1(ea884110d0ea6463801cbc2f87ce9c4921b49e33) )
ROM_END
-
-
-
-
-
-
ROM_START( spacecom )
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "1f.ic67", 0x0000, 0x0400, BAD_DUMP CRC(703f2cbe) SHA1(b183f9fbedd8658399555c0ba21ecab6370e86cb) )
@@ -4696,6 +4714,8 @@ GAMEL(1979, cosmicm2, invaders, cosmicmo, cosmicmo, driver_device, 0, ROT270
GAMEL(1980?,sinvzen, invaders, invaders, sinvzen, driver_device, 0, ROT270, "Taito / Zenitone-Microsec Ltd.", "Super Invaders (Zenitone-Microsec)", GAME_SUPPORTS_SAVE, layout_invaders ) // unclassified, licensed or bootleg?
GAMEL(1980, ultrainv, invaders, invaders, sicv, driver_device, 0, ROT270, "Taito / Konami", "Ultra Invaders", GAME_SUPPORTS_SAVE, layout_invaders ) // unclassified, licensed or bootleg?
GAMEL(1978, spaceatt, invaders, invaders, sicv, driver_device, 0, ROT270, "bootleg (Video Games GmbH)", "Space Attack (bootleg of Space Invaders)", GAME_SUPPORTS_SAVE, layout_invaders )
+GAMEL(1978, spaceattbp, invaders, invaders, sicv, driver_device, 0, ROT270, "bootleg (Video Games GmbH)", "Space Attack (bproms)(bootleg of Space Invaders)", GAME_SUPPORTS_SAVE, layout_invaders )
+GAMEL(1978, spaceatt2k, invaders, invaders, sicv, driver_device, 0, ROT270, "bootleg (Video Games GmbH)", "Space Attack (2k roms)(bootleg of Space Invaders)", GAME_SUPPORTS_SAVE, layout_invaders )
GAMEL(1978, galmonst, invaders, invaders, sicv, driver_device, 0, ROT270, "bootleg (Laguna S.A.)", "Galaxy Monsters (Laguna S.A. Spanish bootleg of Space Invaders)", GAME_SUPPORTS_SAVE, layout_invaders )
GAMEL(1980, spaceat2, invaders, invaders, spaceat2, driver_device, 0, ROT270, "bootleg (Video Games UK)", "Space Attack II (bootleg of Super Invaders)", GAME_SUPPORTS_SAVE, layout_invaders ) // bootleg of Zenitone-Microsec Super Invaders
GAMEL(1979, spacecom, invaders, spacecom, spacecom, _8080bw_state, spacecom, ROT270, "bootleg", "Space Combat (bootleg of Space Invaders)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE, layout_spacecom )
diff --git a/src/mame/drivers/acesp.c b/src/mame/drivers/acesp.c
index 55762c4e582..aa052919ad1 100644
--- a/src/mame/drivers/acesp.c
+++ b/src/mame/drivers/acesp.c
@@ -3848,9 +3848,25 @@ ROM_START( sp_cpal )
SP_CPAL_SOUND
ROM_END
-// mpu4.c
-extern void descramble_crystal( UINT8* region, int start, int end, UINT8 extra_xor);
-
+static void descramble_crystal( UINT8* region, int start, int end, UINT8 extra_xor)
+{
+ for (int i=start;i<end;i++)
+ {
+ UINT8 x = region[i];
+ switch (i & 0x58)
+ {
+ case 0x00: // same as 0x08
+ case 0x08: x = BITSWAP8( x^0xca , 3,2,1,0,7,4,6,5 ); break;
+ case 0x10: x = BITSWAP8( x^0x30 , 3,0,4,6,1,5,7,2 ); break;
+ case 0x18: x = BITSWAP8( x^0x89 , 4,1,2,5,7,0,6,3 ); break;
+ case 0x40: x = BITSWAP8( x^0x14 , 6,1,4,3,2,5,0,7 ); break;
+ case 0x48: x = BITSWAP8( x^0x40 , 1,0,3,2,5,4,7,6 ); break;
+ case 0x50: x = BITSWAP8( x^0xcb , 3,2,1,0,7,6,5,4 ); break;
+ case 0x58: x = BITSWAP8( x^0xc0 , 2,3,6,0,5,1,7,4 ); break;
+ }
+ region[i] = x ^ extra_xor;
+ }
+}
DRIVER_INIT_MEMBER(ace_sp_state,ace_cr)
{
descramble_crystal(memregion( "maincpu" )->base(), 0x0000, 0x10000, 0x00);
diff --git a/src/mame/drivers/aerofgt.c b/src/mame/drivers/aerofgt.c
index 76565723a92..26913e4af62 100644
--- a/src/mame/drivers/aerofgt.c
+++ b/src/mame/drivers/aerofgt.c
@@ -413,6 +413,11 @@ static ADDRESS_MAP_START( wbbc97_sound_map, AS_PROGRAM, 8, aerofgt_state )
AM_RANGE(0xfc20, 0xfc20) AM_READ(soundlatch_byte_r)
ADDRESS_MAP_END
+static ADDRESS_MAP_START( karatblzbl_sound_map, AS_PROGRAM, 8, aerofgt_state )
+ AM_RANGE(0x0000, 0x77ff) AM_ROM
+ AM_RANGE(0x7800, 0x7fff) AM_RAM
+ADDRESS_MAP_END
+
static INPUT_PORTS_START( pspikes )
PORT_START("IN0")
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
@@ -1237,14 +1242,14 @@ GFXDECODE_END
static GFXDECODE_START( turbofrc )
GFXDECODE_ENTRY( "gfx1", 0, pspikes_charlayout, 0, 16 )
GFXDECODE_ENTRY( "gfx2", 0, pspikes_charlayout, 256, 16 )
- GFXDECODE_ENTRY( "gfx3", 0, pspikes_spritelayout, 512, 16 )
+ GFXDECODE_ENTRY( "spritegfx", 0, pspikes_spritelayout, 512, 16 )
GFXDECODE_ENTRY( "gfx4", 0, pspikes_spritelayout, 768, 16 )
GFXDECODE_END
static GFXDECODE_START( aerofgtb )
GFXDECODE_ENTRY( "gfx1", 0, pspikes_charlayout, 0, 16 )
GFXDECODE_ENTRY( "gfx2", 0, pspikes_charlayout, 256, 16 )
- GFXDECODE_ENTRY( "gfx3", 0, aerofgtb_spritelayout, 512, 16 )
+ GFXDECODE_ENTRY( "spritegfx", 0, aerofgtb_spritelayout, 512, 16 )
GFXDECODE_ENTRY( "gfx4", 0, aerofgtb_spritelayout, 768, 16 )
GFXDECODE_END
@@ -1258,14 +1263,14 @@ static GFXDECODE_START( aerfboot )
GFXDECODE_ENTRY( "gfx1", 0, aerfboot_charlayout, 0, 16 )
GFXDECODE_ENTRY( "gfx1", 0x20000, aerfboot_charlayout, 256, 16 )
GFXDECODE_ENTRY( "gfx2", 0, aerfboot_spritelayout, 512, 16 )
- GFXDECODE_ENTRY( "gfx3", 0, aerfboot_spritelayout, 768, 16 )
+ GFXDECODE_ENTRY( "spritegfx", 0, aerfboot_spritelayout, 768, 16 )
GFXDECODE_END
static GFXDECODE_START( aerfboo2 )
GFXDECODE_ENTRY( "gfx1", 0, aerfboo2_charlayout, 0, 16 )
GFXDECODE_ENTRY( "gfx2", 0, aerfboo2_charlayout, 256, 16 )
- GFXDECODE_ENTRY( "gfx3", 0, aerfboo2_spritelayout, 512, 16 )
- GFXDECODE_ENTRY( "gfx3", 0x100000,aerfboo2_spritelayout, 768, 16 )
+ GFXDECODE_ENTRY( "spritegfx", 0, aerfboo2_spritelayout, 512, 16 )
+ GFXDECODE_ENTRY( "spritegfx", 0x100000,aerfboo2_spritelayout, 768, 16 )
GFXDECODE_END
static GFXDECODE_START( wbbc97 )
@@ -1506,6 +1511,52 @@ static MACHINE_CONFIG_START( karatblz, aerofgt_state )
MCFG_SOUND_ROUTE(2, "rspeaker", 1.0)
MACHINE_CONFIG_END
+static MACHINE_CONFIG_START( karatblzbl, aerofgt_state )
+
+ /* basic machine hardware */
+ MCFG_CPU_ADD("maincpu",M68000,20000000/2) /* 10 MHz (?) */
+ MCFG_CPU_PROGRAM_MAP(karatblz_map)
+ MCFG_CPU_VBLANK_INT_DRIVER("screen", aerofgt_state, irq1_line_hold)
+
+ MCFG_CPU_ADD("audiocpu",Z80,8000000/2) /* 4 MHz ??? */
+ MCFG_CPU_PROGRAM_MAP(karatblzbl_sound_map)
+
+// MCFG_MACHINE_START_OVERRIDE(aerofgt_state,aerofgt)
+// MCFG_MACHINE_RESET_OVERRIDE(aerofgt_state,aerofgt)
+
+ /* video hardware */
+ MCFG_SCREEN_ADD("screen", RASTER)
+ MCFG_SCREEN_REFRESH_RATE(60)
+ MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
+ MCFG_SCREEN_SIZE(64*8, 32*8)
+ MCFG_SCREEN_VISIBLE_AREA(1*8, 45*8-1, 0*8, 30*8-1)
+ MCFG_SCREEN_UPDATE_DRIVER(aerofgt_state, screen_update_karatblz)
+ MCFG_SCREEN_PALETTE("palette")
+
+ MCFG_GFXDECODE_ADD("gfxdecode", "palette", turbofrc)
+ MCFG_PALETTE_ADD("palette", 1024)
+ MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB)
+
+ MCFG_DEVICE_ADD("vsystem_spr_old", VSYSTEM_SPR2, 0)
+ MCFG_VSYSTEM_SPR2_SET_TILE_INDIRECT( aerofgt_state, aerofgt_old_tile_callback )
+ MCFG_VSYSTEM_SPR2_SET_GFXREGION(2)
+ MCFG_VSYSTEM_SPR2_GFXDECODE("gfxdecode")
+ MCFG_VSYSTEM_SPR2_PALETTE("palette")
+
+ MCFG_DEVICE_ADD("vsystem_spr_ol2", VSYSTEM_SPR2, 0)
+ MCFG_VSYSTEM_SPR2_SET_TILE_INDIRECT( aerofgt_state, aerofgt_ol2_tile_callback )
+ MCFG_VSYSTEM_SPR2_SET_GFXREGION(3)
+ MCFG_VSYSTEM_SPR2_GFXDECODE("gfxdecode")
+ MCFG_VSYSTEM_SPR2_PALETTE("palette")
+
+ MCFG_VIDEO_START_OVERRIDE(aerofgt_state,karatblz)
+
+ /* sound hardware */
+ MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+
+ // NEC D7759c + YM????
+MACHINE_CONFIG_END
+
static MACHINE_CONFIG_START( spinlbrk, aerofgt_state )
/* basic machine hardware */
@@ -2123,7 +2174,7 @@ ROM_START( spinlbrk )
ROM_LOAD( "ic11", 0x080000, 0x80000, CRC(7dcc913d) SHA1(527bae5020581d1ac322ea25c8e0994d54bbc051) )
ROM_LOAD( "ic16", 0x100000, 0x80000, CRC(0d84af7f) SHA1(07356ee61c84c4c4ccb49c8dfe8c468990580041) ) //FIRST AND SECOND HALF IDENTICAL
- ROM_REGION( 0x100000, "gfx3", 0 )
+ ROM_REGION( 0x100000, "spritegfx", 0 )
ROM_LOAD( "ic12", 0x000000, 0x80000, CRC(d63fac4e) SHA1(bb96d2e41334d136b9208dbe7e88a45e3bbc6542) )
ROM_LOAD( "ic18", 0x080000, 0x80000, CRC(5a60444b) SHA1(62c418aedd1087dac82dcb44830cce00278103dd) )
@@ -2173,7 +2224,7 @@ ROM_START( spinlbrku )
ROM_LOAD( "ic11", 0x080000, 0x80000, CRC(7dcc913d) SHA1(527bae5020581d1ac322ea25c8e0994d54bbc051) )
ROM_LOAD( "ic16", 0x100000, 0x80000, CRC(0d84af7f) SHA1(07356ee61c84c4c4ccb49c8dfe8c468990580041) ) //FIRST AND SECOND HALF IDENTICAL
- ROM_REGION( 0x100000, "gfx3", 0 )
+ ROM_REGION( 0x100000, "spritegfx", 0 )
ROM_LOAD( "ic12", 0x000000, 0x80000, CRC(d63fac4e) SHA1(bb96d2e41334d136b9208dbe7e88a45e3bbc6542) )
ROM_LOAD( "ic18", 0x080000, 0x80000, CRC(5a60444b) SHA1(62c418aedd1087dac82dcb44830cce00278103dd) )
@@ -2223,7 +2274,7 @@ ROM_START( spinlbrkj )
ROM_LOAD( "ic11", 0x080000, 0x80000, CRC(7dcc913d) SHA1(527bae5020581d1ac322ea25c8e0994d54bbc051) )
ROM_LOAD( "ic16", 0x100000, 0x80000, CRC(0d84af7f) SHA1(07356ee61c84c4c4ccb49c8dfe8c468990580041) ) //FIRST AND SECOND HALF IDENTICAL
- ROM_REGION( 0x100000, "gfx3", 0 )
+ ROM_REGION( 0x100000, "spritegfx", 0 )
ROM_LOAD( "ic12", 0x000000, 0x80000, CRC(d63fac4e) SHA1(bb96d2e41334d136b9208dbe7e88a45e3bbc6542) )
ROM_LOAD( "ic18", 0x080000, 0x80000, CRC(5a60444b) SHA1(62c418aedd1087dac82dcb44830cce00278103dd) )
@@ -2268,7 +2319,7 @@ ROM_START( karatblz )
ROM_REGION( 0x80000, "gfx2", 0 )
ROM_LOAD( "gh9.u61", 0x00000, 0x80000, CRC(5d1676bd) SHA1(6227d489c9c6259a0ac2bef62821fbf94efca8c6) )
- ROM_REGION( 0x400000, "gfx3", 0 )
+ ROM_REGION( 0x400000, "spritegfx", 0 )
ROM_LOAD( "u42", 0x000000, 0x100000, CRC(65f0da84) SHA1(0bfbc6f4b87583703246704eb9fa13b1b3e6f90e) )
ROM_LOAD( "3.u44", 0x100000, 0x020000, CRC(34bdead2) SHA1(99f9a8cac807fcd599db55d2dc624ed92a3862ef) )
ROM_LOAD( "u43", 0x200000, 0x100000, CRC(7b349e5d) SHA1(8590a328f403e2c697a8d698c08d4adaf01fff62) )
@@ -2300,7 +2351,7 @@ ROM_START( karatblzu )
ROM_REGION( 0x80000, "gfx2", 0 )
ROM_LOAD( "gh9.u61", 0x00000, 0x80000, CRC(5d1676bd) SHA1(6227d489c9c6259a0ac2bef62821fbf94efca8c6) )
- ROM_REGION( 0x400000, "gfx3", 0 )
+ ROM_REGION( 0x400000, "spritegfx", 0 )
ROM_LOAD( "u42", 0x000000, 0x100000, CRC(65f0da84) SHA1(0bfbc6f4b87583703246704eb9fa13b1b3e6f90e) )
ROM_LOAD( "3.u44", 0x100000, 0x020000, CRC(34bdead2) SHA1(99f9a8cac807fcd599db55d2dc624ed92a3862ef) )
ROM_LOAD( "u43", 0x200000, 0x100000, CRC(7b349e5d) SHA1(8590a328f403e2c697a8d698c08d4adaf01fff62) )
@@ -2332,7 +2383,7 @@ ROM_START( karatblzj )
ROM_REGION( 0x80000, "gfx2", 0 )
ROM_LOAD( "gh9.u61", 0x00000, 0x80000, CRC(5d1676bd) SHA1(6227d489c9c6259a0ac2bef62821fbf94efca8c6) )
- ROM_REGION( 0x400000, "gfx3", 0 )
+ ROM_REGION( 0x400000, "spritegfx", 0 )
ROM_LOAD( "u42", 0x000000, 0x100000, CRC(65f0da84) SHA1(0bfbc6f4b87583703246704eb9fa13b1b3e6f90e) )
ROM_LOAD( "3.u44", 0x100000, 0x020000, CRC(34bdead2) SHA1(99f9a8cac807fcd599db55d2dc624ed92a3862ef) )
ROM_LOAD( "u43", 0x200000, 0x100000, CRC(7b349e5d) SHA1(8590a328f403e2c697a8d698c08d4adaf01fff62) )
@@ -2349,6 +2400,62 @@ ROM_START( karatblzj )
ROM_LOAD( "u104", 0x000000, 0x100000, CRC(5795e884) SHA1(a4178497ad0a1e60ceb87612b218d77b36d2a11b) )
ROM_END
+/*
+
+Karate Blazers (bootleg)
+
+CPU : MC68000
+SND : Z80 + NEC D7759c + YM???? (no number on chip)
+
+*/
+
+ROM_START( karatblzbl )
+ ROM_REGION( 0x80000, "maincpu", 0 ) /* 68000 code */
+ ROM_LOAD16_BYTE( "9.u5", 0x000000, 0x040000, CRC(33c3d3cd) SHA1(a8490091fe8d96b984ebbbe6b2f107fe23411814) )
+ ROM_LOAD16_BYTE( "10.u2", 0x000001, 0x040000, CRC(dbed7323) SHA1(3ec2fffea41e606c176e2392b37f757ad6febf99) )
+
+ ROM_REGION( 0x10000, "audiocpu", 0 )
+ ROM_LOAD( "2.u80", 0x00000, 0x10000, CRC(ca4b171e) SHA1(a05fd81f68759a09be3ec09f38d7c9364dfb6c14) )
+
+ ROM_REGION( 0x20000, "samples", 0 ) // D7759c data
+ ROM_LOAD( "1.u88", 0x00000, 0x20000, CRC(47db1605) SHA1(ae00e633eb98567f04ff97e3d63e04e049d955ec) )
+
+ ROM_REGION( 0x80000, "gfx1", 0 )
+ ROM_LOAD( "3.u81", 0x00000, 0x80000, CRC(3e0cea91) SHA1(bab41715f106d364013b64649441d280bc6893cf) )
+
+ ROM_REGION( 0x80000, "gfx2", 0 )
+ ROM_LOAD( "4.u82", 0x00000, 0x80000, CRC(5d1676bd) SHA1(6227d489c9c6259a0ac2bef62821fbf94efca8c6) )
+
+ ROM_REGION( 0x400000, "spritegfx", 0 )
+ ROM_LOAD16_BYTE( "gfx14.u58", 0x000000, 0x020000, CRC(41e18169) SHA1(fc1723cb5d5ddf7dc3d418070605ad14770620e5) )
+ ROM_LOAD16_BYTE( "gfx19.u63", 0x000001, 0x020000, CRC(09833f2a) SHA1(13d7d530c5f7baa4442c950c8a976934a3df2304) )
+ ROM_LOAD16_BYTE( "gfx13.u59", 0x040000, 0x020000, CRC(666a8c19) SHA1(0392eb45b135db139d0149cbc140bdcaec627bf2) )
+ ROM_LOAD16_BYTE( "gfx18.u64", 0x040001, 0x020000, CRC(4be67468) SHA1(67413b9fc33483133a8ef39c39a1f202be1efcbf) )
+ ROM_LOAD16_BYTE( "gfx12.u60", 0x080000, 0x020000, CRC(f425fe4c) SHA1(446b414e7f6bd699592dfdfc41e48d8f2f3a91b6) )
+ ROM_LOAD16_BYTE( "gfx17.u65", 0x080001, 0x020000, CRC(96e77e04) SHA1(2c4f07c0bd7748470fb320c2e87bcf8c359d10ab) )
+ ROM_LOAD16_BYTE( "gfx11.u61", 0x0c0000, 0x020000, CRC(09ae152b) SHA1(5d558e938f5d914f8bed2a8d980d08ad9e85d505) )
+ ROM_LOAD16_BYTE( "gfx16.u66", 0x0c0001, 0x020000, CRC(cc3a2c8f) SHA1(d69a2127f6142c4d5b4363720511d564ceecf2b9) )
+ ROM_LOAD16_BYTE( "gfx15.u57", 0x100000, 0x020000, CRC(876cf42e) SHA1(d9d5025f421f3dd297b519418a3cac528fcc269a) )
+ ROM_LOAD16_BYTE( "gfx20.u62", 0x100001, 0x020000, CRC(8b759fde) SHA1(90ba7f71736a2bd35af045372db34d69d3015ff1) )
+ ROM_LOAD16_BYTE( "gfx24.u68", 0x200000, 0x020000, CRC(a4417bf8) SHA1(791a3d70376915848fe1f26aa3152c96533c2783) )
+ ROM_LOAD16_BYTE( "gfx29.u73", 0x200001, 0x020000, CRC(5affb5d0) SHA1(c89517dfb139d18f313f15c70481999f136ecb82) )
+ ROM_LOAD16_BYTE( "gfx23.u69", 0x240000, 0x020000, CRC(3ff332e2) SHA1(2c3e3fc9af2735d21f0d14c08c731f148c5cc301) )
+ ROM_LOAD16_BYTE( "gfx28.u74", 0x240001, 0x020000, CRC(ccfdd9ad) SHA1(53b4d68bcae4c84fb73f4b6b5d1d1503f125c3c4) )
+ ROM_LOAD16_BYTE( "gfx22.u70", 0x280000, 0x020000, CRC(5d673b74) SHA1(d54d22969c0a2d155775c48bea93f6946457d405) )
+ ROM_LOAD16_BYTE( "gfx27.u75", 0x280001, 0x020000, CRC(a38802d4) SHA1(f29d69dbac451be3b855733b77b83f86b8f2af86) )
+ ROM_LOAD16_BYTE( "gfx21.u71", 0x2c0000, 0x020000, CRC(ffd66ea0) SHA1(fc1b2fa27d28a61b381e3d4f15809c740082d07f) )
+ ROM_LOAD16_BYTE( "gfx26.u76", 0x2c0001, 0x020000, CRC(7ae76103) SHA1(5c42fbe133cbf600d2150295a70a1541b79706b5) )
+ ROM_LOAD16_BYTE( "gfx25.u67", 0x300000, 0x020000, CRC(1195b559) SHA1(2fd00b3360df5f0a762569ab49c445b68568cf2e) )
+ ROM_LOAD16_BYTE( "gfx30.u72", 0x300001, 0x020000, CRC(7593679f) SHA1(3a6199d1dc60d2c05084fe41c639228613831d99) )
+
+ ROM_REGION( 0x100000, "gfx4", 0 )
+ ROM_LOAD16_BYTE( "5.u62", 0x000000, 0x040000, CRC(1ed12174) SHA1(1e4fc511ad644aaf90505f7930957b4adf9f6c2a) )
+ ROM_LOAD16_BYTE( "6.u63", 0x000001, 0x040000, CRC(874c5251) SHA1(487c2ff66e03e0c1d415039a11404c503b48f9c6) )
+ ROM_LOAD16_BYTE( "7.u64", 0x080000, 0x040000, CRC(c2ed2666) SHA1(5c7b9cf46d13309facc8da82ef3eeb7ef3707ca0) )
+ ROM_LOAD16_BYTE( "8.u65", 0x080001, 0x040000, CRC(b491201a) SHA1(c18cb1cc8a8bf031e00d8d89de62f7ed5548e767) )
+ROM_END
+
+
ROM_START( turbofrc )
ROM_REGION( 0xc0000, "maincpu", 0 ) /* 68000 code */
ROM_LOAD16_WORD_SWAP( "tfrc2.bin", 0x00000, 0x40000, CRC(721300ee) SHA1(79ab32fdfd377592a0bdbd1c4794cfd529a3eb7b) )
@@ -2367,7 +2474,7 @@ ROM_START( turbofrc )
ROM_LOAD( "tfrcu105.bin", 0x000000, 0x80000, CRC(4de4e59e) SHA1(571396dadb8aac043319cabe24e629210e442d57) )
ROM_LOAD( "tfrcu106.bin", 0x080000, 0x20000, CRC(c6479eb5) SHA1(47a58f082c73bc9dae3970e760ba46478ce6a190) )
- ROM_REGION( 0x200000, "gfx3", 0 )
+ ROM_REGION( 0x200000, "spritegfx", 0 )
ROM_LOAD( "tfrcu116.bin", 0x000000, 0x80000, CRC(df210f3b) SHA1(990ac43e4a46fee6b929c5b27d317cdadf179b8b) )
ROM_LOAD( "tfrcu118.bin", 0x080000, 0x40000, CRC(f61d1d79) SHA1(2b8e33912c05c26170afd2fced0ff06cb7a097fa) )
ROM_LOAD( "tfrcu117.bin", 0x100000, 0x80000, CRC(f70812fd) SHA1(1964e1134940825211cd4825fdd3f13b8242192d) )
@@ -2422,7 +2529,7 @@ ROM_START( aerofgtb )
ROM_REGION( 0x080000, "gfx2", 0 )
ROM_LOAD( "it-19-02", 0x000000, 0x80000, CRC(4f57f8ba) SHA1(aaad548e9a7490dfd48a975135716225f416b6f6) )
- ROM_REGION( 0x100000, "gfx3", 0 )
+ ROM_REGION( 0x100000, "spritegfx", 0 )
ROM_LOAD( "it-19-04", 0x000000, 0x80000, CRC(3b329c1f) SHA1(279cb32d69ce1e71f42cfad93d395794a3e92bc6) )
ROM_LOAD( "it-19-05", 0x080000, 0x80000, CRC(02b525af) SHA1(07f23d15938dfbdc4f0977ba1463a06090569026) )
@@ -2453,7 +2560,7 @@ ROM_START( aerofgtc )
ROM_REGION( 0x080000, "gfx2", 0 )
ROM_LOAD( "it-19-02", 0x000000, 0x80000, CRC(4f57f8ba) SHA1(aaad548e9a7490dfd48a975135716225f416b6f6) )
- ROM_REGION( 0x100000, "gfx3", 0 )
+ ROM_REGION( 0x100000, "spritegfx", 0 )
ROM_LOAD( "it-19-04", 0x000000, 0x80000, CRC(3b329c1f) SHA1(279cb32d69ce1e71f42cfad93d395794a3e92bc6) )
ROM_LOAD( "it-19-05", 0x080000, 0x80000, CRC(02b525af) SHA1(07f23d15938dfbdc4f0977ba1463a06090569026) )
@@ -2484,7 +2591,7 @@ ROM_START( sonicwi )
ROM_REGION( 0x080000, "gfx2", 0 )
ROM_LOAD( "it-19-02", 0x000000, 0x80000, CRC(4f57f8ba) SHA1(aaad548e9a7490dfd48a975135716225f416b6f6) )
- ROM_REGION( 0x100000, "gfx3", 0 )
+ ROM_REGION( 0x100000, "spritegfx", 0 )
ROM_LOAD( "it-19-04", 0x000000, 0x80000, CRC(3b329c1f) SHA1(279cb32d69ce1e71f42cfad93d395794a3e92bc6) )
ROM_LOAD( "it-19-05", 0x080000, 0x80000, CRC(02b525af) SHA1(07f23d15938dfbdc4f0977ba1463a06090569026) )
@@ -2517,7 +2624,7 @@ ROM_START( aerfboot )
ROM_LOAD( "afb_ep12.tc", 0x000000, 0x80000, CRC(1e692065) SHA1(a67da59cd65ec492d6e6ab14b1800fd35480a52d) )
ROM_LOAD( "afb_ep10.ta", 0x080000, 0x80000, CRC(e50db1a7) SHA1(952676879fb6a260c56a120b849abfae75f4cf2b) )
- ROM_REGION( 0x080000, "gfx3", 0 )
+ ROM_REGION( 0x080000, "spritegfx", 0 )
ROM_LOAD( "afb_ep13.td", 0x000000, 0x40000, CRC(1830f70c) SHA1(1759de9b56e4999defc08b2423eff38ec98c4f17) )
ROM_LOAD( "afb_ep11.tb", 0x040000, 0x40000, CRC(6298c0eb) SHA1(ede63849973742c67637eac0ec9cda95ea2ecebc) )
@@ -2539,7 +2646,7 @@ ROM_START( aerfboo2 )
ROM_REGION( 0x80000, "gfx2", 0 )
ROM_LOAD( "g6" , 0x000000, 0x80000, CRC(b9b1b9b0) SHA1(c25e1ef8b5ecb4b630fb850fe483d7efb0544a6c) )
- ROM_REGION( 0x200000, "gfx3", 0 )
+ ROM_REGION( 0x200000, "spritegfx", 0 )
ROM_LOAD32_BYTE( "g2" , 0x000000, 0x80000, CRC(84774dbd) SHA1(731b08a62446ff9cf36a43d42d217f73b4e2437c) )
ROM_LOAD32_BYTE( "g1" , 0x000001, 0x80000, CRC(4ab31e69) SHA1(1c6bf5bf4a887cf21da76c6a874f8ff5d3540e3a) )
ROM_LOAD32_BYTE( "g4" , 0x000002, 0x80000, CRC(97725694) SHA1(59316e4be043e0b7111c6777b36bcfd39c899e72) )
@@ -2598,6 +2705,7 @@ GAME( 1997, wbbc97, 0, wbbc97, wbbc97, driver_device, 0, ROT0, "C
GAME( 1991, karatblz, 0, karatblz, karatblz, driver_device, 0, ROT0, "Video System Co.", "Karate Blazers (World)", GAME_SUPPORTS_SAVE | GAME_NO_COCKTAIL )
GAME( 1991, karatblzu,karatblz, karatblz, karatblz, driver_device, 0, ROT0, "Video System Co.", "Karate Blazers (US)", GAME_SUPPORTS_SAVE | GAME_NO_COCKTAIL )
GAME( 1991, karatblzj,karatblz, karatblz, karatblz, driver_device, 0, ROT0, "Video System Co.", "Karate Blazers (Japan)", GAME_SUPPORTS_SAVE | GAME_NO_COCKTAIL )
+GAME( 1991, karatblzbl,karatblz,karatblzbl,karatblz,driver_device, 0, ROT0, "bootleg", "Karate Blazers (bootleg)", GAME_SUPPORTS_SAVE | GAME_NO_COCKTAIL | GAME_NO_SOUND )
GAME( 1991, turbofrc, 0, turbofrc, turbofrc, driver_device, 0, ROT270, "Video System Co.", "Turbo Force (old revision)", GAME_SUPPORTS_SAVE | GAME_NO_COCKTAIL )
// there's also an undumped Turbo Force (new revision). Most notable thing in there is the points value of the rocks in level 6 (5.000 versus 500).
diff --git a/src/mame/drivers/aleck64.c b/src/mame/drivers/aleck64.c
index 00df3236cce..745d761cc32 100644
--- a/src/mame/drivers/aleck64.c
+++ b/src/mame/drivers/aleck64.c
@@ -850,7 +850,6 @@ static MACHINE_CONFIG_START( aleck64, aleck64_state )
MCFG_RSP_SP_SET_STATUS_CB(DEVWRITE32("rcp",n64_periphs, sp_set_status))
MCFG_CPU_PROGRAM_MAP(rsp_map)
-
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
@@ -860,7 +859,6 @@ static MACHINE_CONFIG_START( aleck64, aleck64_state )
MCFG_PALETTE_ADD("palette", 0x1000)
-
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
MCFG_SOUND_ADD("dac1", DMADAC, 0)
@@ -869,6 +867,8 @@ static MACHINE_CONFIG_START( aleck64, aleck64_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
MCFG_N64_PERIPHS_ADD("rcp");
+
+ MCFG_FORCE_NO_DRC()
MACHINE_CONFIG_END
UINT32 aleck64_state::screen_update_e90(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
@@ -1131,13 +1131,20 @@ ROM_START( doncdoon )
ROM_LOAD( "normslp.rom", 0x00, 0x80, CRC(4f2ae525) SHA1(eab43f8cc52c8551d9cff6fced18ef80eaba6f05) )
ROM_END
-
+/* Mayjinsen 3
+ * PCB marking: "SeTa // 3D Rom PCB-2A // SETA CORPORATION // MADE IN JAPAN"
+ * PCB has:
+ * U1 CIC-NUS; CIC-NUS-5101 security chip (Sharp SM5K3 MCU)
+ * U2 BU9850; BU9850 4k Serial EEPROM (Rohm, proprietary/custom part?)
+ * U3 NUS64M: "MXC991789M // MX23L6402-35A // NUS-ZSCJ-0 // 1Q4787A2" Macronix custom latchable self-addressable mask rom
+ * Internal checksum is verified to match rom dump
+ */
ROM_START( mayjin3 )
ROM_REGION32_BE( 0x800, "user1", ROMREGION_ERASE00 )
PIF_BOOTROM
ROM_REGION32_BE( 0x4000000, "user2", 0 )
- ROM_LOAD16_WORD_SWAP( "nus-zscj.u3", 0x000000, 0x800000, CRC(8b36eb91) SHA1(179745625c16c6813d5f8d29bfd7628783d55806) )
+ ROM_LOAD16_WORD_SWAP( "nus-zscj-0.u3", 0x000000, 0x800000, CRC(52a37340) SHA1(b5834bfde5b8a7e20415b2593abd76ec95ab27c7) ) // U3 NUS64M
ROM_REGION16_BE( 0x80, "normpoint", 0 )
ROM_LOAD( "normpnt.rom", 0x00, 0x80, CRC(e7f2a005) SHA1(c27b4a364a24daeee6e99fd286753fd6216362b4) )
@@ -1163,4 +1170,4 @@ GAME( 2003, twrshaft, aleck64, aleck64, twrshaft, aleck64_state, aleck64, ROT0,
GAME( 2003, hipai, aleck64, aleck64, hipai, aleck64_state, aleck64, ROT0, "Aruze / Seta", "Hi Pai Paradise", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
GAME( 2003, doncdoon, aleck64, aleck64, doncdoon, aleck64_state, aleck64, ROT0, "Aruze", "Hanabi de Doon! - Don-chan Puzzle", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
GAME( 2003, kurufev, aleck64, aleck64, kurufev, aleck64_state, aleck64, ROT0, "Aruze / Takumi", "Kurukuru Fever", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
-GAME( 2000, mayjin3, aleck64, aleck64, aleck64, aleck64_state, aleck64, ROT0, "Seta / Able Corporation", "Mayjinsen 3", GAME_NOT_WORKING|GAME_NO_SOUND )
+GAME( 2000, mayjin3, aleck64, aleck64, aleck64, aleck64_state, aleck64, ROT0, "Seta / Able Corporation", "Mayjinsen 3", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
diff --git a/src/mame/drivers/aleisttl.c b/src/mame/drivers/aleisttl.c
index c9efe1a854b..2b8fe06c97f 100644
--- a/src/mame/drivers/aleisttl.c
+++ b/src/mame/drivers/aleisttl.c
@@ -4,10 +4,19 @@
Allied Leisure discrete hardware games
+ Chase (aka Chase1) (1976)
+ Deluxe Soccer (1973)
+ Fire Power (1975) EG-1020-2
+ Fütsball (1975)
+ Galaxy Raider (1974)
Hesitation (1974) AL-6500?
+ Hockey, Soccer, Tennis (1974)
+ Improbable (1974)
+ Knock Ball (1974)
Paddle Battle (1973)
+ Ric-O-Chet (1973)
Robot (1975) AL-7500
- Ski (1975)
+ Ski (1975) (electromechanical)
Street Burners (1975) URL-8300
Super Soccer (1973)
Tennis Tourney (1973)
diff --git a/src/mame/drivers/alpha68k.c b/src/mame/drivers/alpha68k.c
index 26c1c904fff..bcc51a934e8 100644
--- a/src/mame/drivers/alpha68k.c
+++ b/src/mame/drivers/alpha68k.c
@@ -1924,7 +1924,7 @@ static MACHINE_CONFIG_START( sstingry, alpha68k_state )
MCFG_CPU_ADD("audiocpu", Z80, 3579545)
MCFG_CPU_PROGRAM_MAP(sstingry_sound_map)
MCFG_CPU_IO_MAP(kyros_sound_portmap)
- MCFG_CPU_PERIODIC_INT_DRIVER(alpha68k_state, irq0_line_hold, 2*60)
+ MCFG_CPU_VBLANK_INT_DRIVER("screen", alpha68k_state, irq0_line_hold)
MCFG_CPU_PERIODIC_INT_DRIVER(alpha68k_state, nmi_line_pulse, 4000)
MCFG_CPU_ADD("mcu", I8748, 9263750) /* 9.263750 MHz oscillator, divided by 3*5 internally */
@@ -1978,7 +1978,7 @@ static MACHINE_CONFIG_START( kyros, alpha68k_state )
MCFG_CPU_ADD("audiocpu", Z80, XTAL_24MHz/6) /* Verified on bootleg PCB */
MCFG_CPU_PROGRAM_MAP(kyros_sound_map)
MCFG_CPU_IO_MAP(kyros_sound_portmap)
- MCFG_CPU_PERIODIC_INT_DRIVER(alpha68k_state, irq0_line_hold, 2*60)
+ MCFG_CPU_VBLANK_INT_DRIVER("screen", alpha68k_state, irq0_line_hold)
MCFG_CPU_PERIODIC_INT_DRIVER(alpha68k_state, nmi_line_pulse, 4000)
MCFG_MACHINE_START_OVERRIDE(alpha68k_state,common)
diff --git a/src/mame/drivers/angelkds.c b/src/mame/drivers/angelkds.c
index 47e225f680f..8bd36d7b37c 100644
--- a/src/mame/drivers/angelkds.c
+++ b/src/mame/drivers/angelkds.c
@@ -212,6 +212,11 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, angelkds_state )
AM_RANGE(0xf005, 0xf005) AM_WRITE(angelkds_layer_ctrl_write)
ADDRESS_MAP_END
+static ADDRESS_MAP_START( decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 8, angelkds_state )
+ AM_RANGE(0x0000, 0x7fff) AM_ROM AM_SHARE("decrypted_opcodes")
+ AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1")
+ADDRESS_MAP_END
+
static ADDRESS_MAP_START( main_portmap, AS_IO, 8, angelkds_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x00) AM_WRITENOP // 00 on start-up, not again
@@ -628,6 +633,12 @@ static MACHINE_CONFIG_START( angelkds, angelkds_state )
MCFG_SOUND_ROUTE(3, "mono", 0.45)
MACHINE_CONFIG_END
+static MACHINE_CONFIG_DERIVED( spcpostn, angelkds )
+ /* encryption */
+ MCFG_DEVICE_MODIFY("maincpu")
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
+MACHINE_CONFIG_END
+
/*** Rom Loading
"maincpu" for the main code
@@ -643,7 +654,7 @@ MACHINE_CONFIG_END
ROM_START( angelkds )
/* Nasco X090-PC-A (Sega 837-6600) */
- ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_REGION( 0x8000, "maincpu", 0 )
ROM_LOAD( "11428.c10", 0x00000, 0x08000, CRC(90daacd2) SHA1(7e50ad1cbed0c1e6bad04ef1611cad25538c905f) )
ROM_REGION( 0x20000, "user1", 0 ) /* Banked Code */
@@ -690,7 +701,7 @@ ROM_END
ROM_START( spcpostn )
/* X090-PC-A 171-5383 */
- ROM_REGION( 2*0x10000, "maincpu", 0 ) /* D317-0005 (NEC Z80 Custom) */
+ ROM_REGION( 0x8000, "maincpu", 0 ) /* D317-0005 (NEC Z80 Custom) */
ROM_LOAD( "epr10125.c10", 0x00000, 0x08000, CRC(bffd38c6) SHA1(af02907124343ddecd21439d25f1ebb81ef9f51a) ) /* encrypted */
ROM_REGION( 0x28000, "user1", 0 ) /* Banked Code */
@@ -736,10 +747,12 @@ DRIVER_INIT_MEMBER(angelkds_state,spcpostn)
{
UINT8 *RAM = memregion("user1")->base();
- sega_317_0005_decode(machine(), "maincpu");
+ // 317-0005
+ sega_decode_317(memregion("maincpu")->base(), m_decrypted_opcodes, 1);
+
membank("bank1")->configure_entries(0, 10, &RAM[0x0000], 0x4000);
}
GAME( 1988, angelkds, 0, angelkds, angelkds, angelkds_state, angelkds, ROT90, "Sega / Nasco?", "Angel Kids (Japan)" , GAME_SUPPORTS_SAVE) /* Nasco not displayed but 'Exa Planning' is */
-GAME( 1986, spcpostn, 0, angelkds, spcpostn, angelkds_state, spcpostn, ROT90, "Sega / Nasco", "Space Position (Japan)" , GAME_SUPPORTS_SAVE) /* encrypted */
+GAME( 1986, spcpostn, 0, spcpostn, spcpostn, angelkds_state, spcpostn, ROT90, "Sega / Nasco", "Space Position (Japan)" , GAME_SUPPORTS_SAVE) /* encrypted */
diff --git a/src/mame/drivers/appoooh.c b/src/mame/drivers/appoooh.c
index b3ab3aba401..103d034f01e 100644
--- a/src/mame/drivers/appoooh.c
+++ b/src/mame/drivers/appoooh.c
@@ -167,11 +167,10 @@ Language
#include "cpu/z80/z80.h"
#include "includes/appoooh.h"
#include "machine/segacrp2.h"
-#include "sound/msm5205.h"
#include "sound/sn76496.h"
-WRITE_LINE_MEMBER(appoooh_state::appoooh_adpcm_int)
+WRITE_LINE_MEMBER(appoooh_state::adpcm_int)
{
if (m_adpcm_address != 0xffffffff)
{
@@ -197,7 +196,7 @@ WRITE_LINE_MEMBER(appoooh_state::appoooh_adpcm_int)
}
/* adpcm address write */
-WRITE8_MEMBER(appoooh_state::appoooh_adpcm_w)
+WRITE8_MEMBER(appoooh_state::adpcm_w)
{
m_adpcm_address = data << 8;
m_msm->reset_w(0);
@@ -219,22 +218,28 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, appoooh_state )
AM_RANGE(0xe800, 0xefff) AM_RAM /* RAM ? */
AM_RANGE(0xf000, 0xf01f) AM_SHARE("spriteram")
- AM_RANGE(0xf020, 0xf3ff) AM_WRITE(appoooh_fg_videoram_w) AM_SHARE("fg_videoram")
- AM_RANGE(0xf420, 0xf7ff) AM_WRITE(appoooh_fg_colorram_w) AM_SHARE("fg_colorram")
+ AM_RANGE(0xf020, 0xf3ff) AM_WRITE(fg_videoram_w) AM_SHARE("fg_videoram")
+ AM_RANGE(0xf420, 0xf7ff) AM_WRITE(fg_colorram_w) AM_SHARE("fg_colorram")
AM_RANGE(0xf800, 0xf81f) AM_SHARE("spriteram_2")
- AM_RANGE(0xf820, 0xfbff) AM_WRITE(appoooh_bg_videoram_w) AM_SHARE("bg_videoram")
- AM_RANGE(0xfc20, 0xffff) AM_WRITE(appoooh_bg_colorram_w) AM_SHARE("bg_colorram")
+ AM_RANGE(0xf820, 0xfbff) AM_WRITE(bg_videoram_w) AM_SHARE("bg_videoram")
+ AM_RANGE(0xfc20, 0xffff) AM_WRITE(bg_colorram_w) AM_SHARE("bg_colorram")
AM_RANGE(0xf000, 0xffff) AM_RAM
ADDRESS_MAP_END
+static ADDRESS_MAP_START( decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 8, appoooh_state )
+ AM_RANGE(0x0000, 0x7fff) AM_ROM AM_SHARE("decrypted_opcodes")
+ AM_RANGE(0x8000, 0x9fff) AM_ROM AM_REGION("maincpu", 0x8000)
+ AM_RANGE(0xa000, 0xdfff) AM_ROMBANK("bank1")
+ADDRESS_MAP_END
+
static ADDRESS_MAP_START( main_portmap, AS_IO, 8, appoooh_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x00) AM_READ_PORT("P1") AM_DEVWRITE("sn1", sn76489_device, write)
AM_RANGE(0x01, 0x01) AM_READ_PORT("P2") AM_DEVWRITE("sn2", sn76489_device, write)
AM_RANGE(0x02, 0x02) AM_DEVWRITE("sn3", sn76489_device, write)
- AM_RANGE(0x03, 0x03) AM_READ_PORT("DSW1") AM_WRITE(appoooh_adpcm_w)
- AM_RANGE(0x04, 0x04) AM_READ_PORT("BUTTON3") AM_WRITE(appoooh_out_w)
- AM_RANGE(0x05, 0x05) AM_WRITE(appoooh_scroll_w) /* unknown */
+ AM_RANGE(0x03, 0x03) AM_READ_PORT("DSW1") AM_WRITE(adpcm_w)
+ AM_RANGE(0x04, 0x04) AM_READ_PORT("BUTTON3") AM_WRITE(out_w)
+ AM_RANGE(0x05, 0x05) AM_WRITE(scroll_w) /* unknown */
ADDRESS_MAP_END
@@ -387,6 +392,8 @@ GFXDECODE_END
void appoooh_state::machine_start()
{
+ membank("bank1")->configure_entries(0, 2, memregion("maincpu")->base() + 0xa000, 0x6000);
+
save_item(NAME(m_adpcm_data));
save_item(NAME(m_adpcm_address));
}
@@ -428,7 +435,7 @@ static MACHINE_CONFIG_START( appoooh_common, appoooh_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
MCFG_SOUND_ADD("msm", MSM5205, 384000)
- MCFG_MSM5205_VCLK_CB(WRITELINE(appoooh_state, appoooh_adpcm_int)) /* interrupt function */
+ MCFG_MSM5205_VCLK_CB(WRITELINE(appoooh_state, adpcm_int)) /* interrupt function */
MCFG_MSM5205_PRESCALER_SELECTOR(MSM5205_S64_4B) /* 6KHz */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
MACHINE_CONFIG_END
@@ -455,6 +462,9 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( robowres, appoooh_common )
+ MCFG_DEVICE_MODIFY("maincpu")
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
@@ -577,13 +587,48 @@ ROM_END
DRIVER_INIT_MEMBER(appoooh_state,robowres)
{
- sega_315_5179_decode(machine(), "maincpu");
+ static const UINT8 xor_table[128] =
+ {
+ 0x00,0x45,0x41,0x14,0x10,0x55,0x51,0x01,0x04,0x40,0x45,0x11,0x14,0x50,
+ 0x00,0x05,0x41,0x44,0x10,0x15,0x51,0x54,0x04,
+ 0x00,0x45,0x41,0x14,0x10,0x55,0x05,0x01,0x44,0x40,0x15,0x11,0x54,0x50,
+ 0x00,0x05,0x41,0x44,0x10,0x15,0x51,0x01,0x04,
+ 0x40,0x45,0x11,0x14,0x50,0x55,0x05,0x01,0x44,0x40,0x15,0x11,0x54,0x04,
+ 0x00,0x45,0x41,0x14,0x50,
+ 0x00,0x05,0x41,0x44,0x10,0x15,0x51,0x54,0x04,
+ 0x00,0x45,0x41,0x14,0x50,0x55,0x05,0x01,0x44,0x40,0x15,0x11,0x54,0x50,
+ 0x00,0x05,0x41,0x44,0x10,0x55,0x51,0x01,0x04,
+ 0x40,0x45,0x11,0x14,0x50,0x55,0x05,0x01,0x44,0x40,0x15,0x51,0x54,0x04,
+ 0x00,0x45,0x41,0x14,0x10,0x55,0x51,0x01,0x04,
+ 0x40,0x45,0x11,0x54,0x50,0x00,0x05,0x41,
+ };
+
+ static const int swap_table[128] =
+ {
+ 8, 9,11,13,15, 0, 2, 4, 6,
+ 8, 9,11,13,15, 1, 2, 4, 6,
+ 8, 9,11,13,15, 1, 2, 4, 6,
+ 8, 9,11,13,15, 1, 2, 4, 6,
+ 8,10,11,13,15, 1, 2, 4, 6,
+ 8,10,11,13,15, 1, 2, 4, 6,
+ 8,10,11,13,15, 1, 3, 4, 6,
+ 8,
+ 7, 1, 2, 4, 6, 0, 1, 3, 5,
+ 7, 1, 2, 4, 6, 0, 1, 3, 5,
+ 7, 1, 2, 4, 6, 0, 2, 3, 5,
+ 7, 1, 2, 4, 6, 0, 2, 3, 5,
+ 7, 1, 2, 4, 6, 0, 2, 3, 5,
+ 7, 1, 3, 4, 6, 0, 2, 3, 5,
+ 7, 1, 3, 4, 6, 0, 2, 4, 5,
+ 7,
+ };
+
+ sega_decode_2(memregion("maincpu")->base(), m_decrypted_opcodes, xor_table, swap_table);
}
DRIVER_INIT_MEMBER(appoooh_state,robowresb)
{
- address_space &space = m_maincpu->space(AS_PROGRAM);
- space.set_decrypted_region(0x0000, 0x7fff, memregion("maincpu")->base() + 0x1c000);
+ memcpy(m_decrypted_opcodes, memregion("maincpu")->base() + 0x1c000, 0x8000);
}
diff --git a/src/mame/drivers/argus.c b/src/mame/drivers/argus.c
index c96adc02469..bb4da4494d1 100644
--- a/src/mame/drivers/argus.c
+++ b/src/mame/drivers/argus.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Yochizo
/***************************************************************************
diff --git a/src/mame/drivers/arkanoid.c b/src/mame/drivers/arkanoid.c
index e6b0fed2f33..64693872fea 100644
--- a/src/mame/drivers/arkanoid.c
+++ b/src/mame/drivers/arkanoid.c
@@ -1365,6 +1365,40 @@ MACHINE_CONFIG_END
/***************************************************************************/
/* ROMs */
+/* rom numbering, with guesses:
+ A75 01 = Z80 code 1/2 v1.0 Japan
+ A75 01-1 = Z80 code 1/2 v1.1 Japan and USA/Romstar
+ A75 02 = Z80 code 2/2 v1.0 Japan
+ A75 03 = GFX 1/3
+ A75 04 = GFX 2/3
+ A75 05 = GFX 3/3
+ A75 06 = MC68705P5 MCU code, v1.0 Japan and v1.0 USA/Romstar
+ A75 07 = PROM red
+ A75 08 = PROM green
+ A75 09 = PROM blue
+ A75 10 = Z80 code 2/2 v1.1 USA/Romstar
+ A75 11 = Z80 code 2/2 v1.2 Japan (paired with 01-1 v1.1 Japan)
+ (A75 12 through 17 are unknown, could be another two sets of z80 code plus mc68705p5)
+ A75 18 = Z80 code v2.0 2/2 USA/Romstar
+ A75 19 = Z80 code v2.0 1/2 USA/Romstar
+ A75 20 = MC68705P5 MCU code, v2.0 USA/Romstar
+ A75 21 = Z80 code v2.0 1/2 Japan
+ A75 22 = Z80 code v2.0 2/2 Japan
+ A75 23 = MC68705P5 MCU code, v2.0 Japan
+ A75 24 = Z80 code v2.1 1/2 Japan
+ A75 25 = Z80 code v2.1 2/2 Japan
+ A75 26 = MC68705P5 MCU code, v2.1 Japan
+ A75 27 = Z80 code 1/2 Tournament
+ A75 28 = Z80 code 2/2 Tournament
+ A75 29 = GFX 1/3 Tournament
+ A75 30 = GFX 2/3 Tournament
+ A75 31 = GFX 3/3 Tournament
+ A75 32 = MC68705P5 MCU code, Tournament
+ A75 33 = PROM red Tournament
+ A75 34 = PROM green Tournament
+ A75 35 = PROM blue Tournament
+ (one of the 21/22/23 or 24/25/26 sets is likely 'world'? or are these really two japan sets?)
+*/
ROM_START( arkanoid )
ROM_REGION( 0x10000, "maincpu", 0 )
@@ -1411,23 +1445,24 @@ ROM_START( arkanoidu )
ROM_LOAD( "a75-09.ic22", 0x0400, 0x0200, CRC(a7c6c277) SHA1(adaa003dcd981576ea1cc5f697d709b2d6b2ea29) ) /* blue component */
ROM_END
+/* Observed on a real TAITO J1100075A pcb (with K1100181A sticker), pcb is white painted, and has a "ROMSTAR(C) // All Rights Reserved // Serial No. // No 14128" sticker */
ROM_START( arkanoiduo )
- ROM_REGION( 0x10000, "maincpu", 0 )
- ROM_LOAD( "a75-01-1.ic17", 0x0000, 0x8000, CRC(5bcda3b0) SHA1(52cadd38b5f8e8856f007a9c602d6b508f30be65) )
- ROM_LOAD( "a75-10.ic16", 0x8000, 0x8000, CRC(a1769e15) SHA1(fbb45731246a098b29eb08de5d63074b496aaaba) )
-
- ROM_REGION( 0x0800, "mcu", 0 ) /* 2k for the microcontroller */
- ROM_LOAD( "a75-06.ic14", 0x0000, 0x0800, CRC(515d77b6) SHA1(a302937683d11f663abd56a2fd7c174374e4d7fb) ) // ok for this set
-
- ROM_REGION( 0x18000, "gfx1", 0 )
- ROM_LOAD( "a75-03.ic64", 0x00000, 0x8000, CRC(038b74ba) SHA1(ac053cc4908b4075f918748b89570e07a0ba5116) )
- ROM_LOAD( "a75-04.ic63", 0x08000, 0x8000, CRC(71fae199) SHA1(5d253c46ccf4cd2976a5fb8b8713f0f345443d06) )
- ROM_LOAD( "a75-05.ic62", 0x10000, 0x8000, CRC(c76374e2) SHA1(7520dd48de20db60a2038f134dcaa454988e7874) )
-
- ROM_REGION( 0x0600, "proms", 0 ) /* BPROMs are silkscreened as 7621, actual BPROMs used are MMI 6306-1N */
- ROM_LOAD( "a75-07.ic24", 0x0000, 0x0200, CRC(0af8b289) SHA1(6bc589e8a609b4cf450aebedc8ce02d5d45c970f) ) /* red component */
- ROM_LOAD( "a75-08.ic23", 0x0200, 0x0200, CRC(abb002fb) SHA1(c14f56b8ef103600862e7930709d293b0aa97a73) ) /* green component */
- ROM_LOAD( "a75-09.ic22", 0x0400, 0x0200, CRC(a7c6c277) SHA1(adaa003dcd981576ea1cc5f697d709b2d6b2ea29) ) /* blue component */
+ ROM_REGION( 0x10000, "maincpu", 0 ) /* Silkscreen: "IC17 27256" and "IC16 27256" */
+ ROM_LOAD( "a75__01-1.ic17", 0x0000, 0x8000, CRC(5bcda3b0) SHA1(52cadd38b5f8e8856f007a9c602d6b508f30be65) )
+ ROM_LOAD( "a75__10.ic16", 0x8000, 0x8000, CRC(a1769e15) SHA1(fbb45731246a098b29eb08de5d63074b496aaaba) )
+
+ ROM_REGION( 0x0800, "mcu", 0 ) /* Silkscreen: "IC14 P5", 2k for the MC68705P5S protected microcontroller */
+ ROM_LOAD( "a75__06.ic14", 0x0000, 0x0800, BAD_DUMP CRC(515d77b6) SHA1(a302937683d11f663abd56a2fd7c174374e4d7fb) ) /* Possible bootleg code??, need to re-verify the real decapped/extracted data here */
+
+ ROM_REGION( 0x18000, "gfx1", 0 ) /* Silkscreen: "IC62 27128/256", "IC63 27128/256", "IC64 27128/256" */
+ ROM_LOAD( "a75__03.ic64", 0x00000, 0x8000, CRC(038b74ba) SHA1(ac053cc4908b4075f918748b89570e07a0ba5116) )
+ ROM_LOAD( "a75__04.ic63", 0x08000, 0x8000, CRC(71fae199) SHA1(5d253c46ccf4cd2976a5fb8b8713f0f345443d06) )
+ ROM_LOAD( "a75__05.ic62", 0x10000, 0x8000, CRC(c76374e2) SHA1(7520dd48de20db60a2038f134dcaa454988e7874) )
+
+ ROM_REGION( 0x0600, "proms", 0 ) /* Silkscreen: "IC22 7621", "IC23 7621", "IC24 7621", but the actual BPROMs used are either MMI 6306-1N or Fairchild MB7116E */
+ ROM_LOAD( "a75-07.ic24", 0x0000, 0x0200, CRC(0af8b289) SHA1(6bc589e8a609b4cf450aebedc8ce02d5d45c970f) ) /* Chip Silkscreen: "A75-07"; red component */
+ ROM_LOAD( "a75-08.ic23", 0x0200, 0x0200, CRC(abb002fb) SHA1(c14f56b8ef103600862e7930709d293b0aa97a73) ) /* Chip Silkscreen: "A75-08"; green component */
+ ROM_LOAD( "a75-09.ic22", 0x0400, 0x0200, CRC(a7c6c277) SHA1(adaa003dcd981576ea1cc5f697d709b2d6b2ea29) ) /* Chip Silkscreen: "A75-09"; blue component */
ROM_END
ROM_START( arkanoidj )
diff --git a/src/mame/drivers/armedf.c b/src/mame/drivers/armedf.c
index 1773e1eaf26..05bc05f6c58 100644
--- a/src/mame/drivers/armedf.c
+++ b/src/mame/drivers/armedf.c
@@ -2184,7 +2184,7 @@ DRIVER_INIT_MEMBER(bigfghtr_state,bigfghtr)
/* YEAR, NAME, PARENT, MACHINE, INPUT, INIT, MONITOR, COMPANY, FULLNAME, FLAGS */
GAME( 1987, legion, 0, legion, legion, armedf_state, legion, ROT270, "Nichibutsu", "Legion - Spinner-87 (World ver 2.03)", GAME_SUPPORTS_SAVE )
GAME( 1987, legionj, legion, legion, legion, armedf_state, legion, ROT270, "Nichibutsu", "Chouji Meikyuu Legion (Japan ver 1.05)", GAME_SUPPORTS_SAVE )
-GAME( 1987, legionjb, legion, legionjb, legion, armedf_state, legionjb, ROT270, "Nichibutsu", "Chouji Meikyuu Legion (Japan ver 1.05, bootleg)", GAME_SUPPORTS_SAVE) /* blitter protection removed */
+GAME( 1987, legionjb, legion, legionjb, legion, armedf_state, legionjb, ROT270, "bootleg", "Chouji Meikyuu Legion (Japan ver 1.05, bootleg)", GAME_SUPPORTS_SAVE) /* blitter protection removed */
GAME( 1987, terraf, 0, terraf, terraf, armedf_state, terrafu, ROT0, "Nichibutsu", "Terra Force", GAME_SUPPORTS_SAVE )
GAME( 1987, terrafu, terraf, terraf, terraf, armedf_state, terrafu, ROT0, "Nichibutsu USA", "Terra Force (US)", GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/asuka.c b/src/mame/drivers/asuka.c
index 7617fe36f19..9bd425858ec 100644
--- a/src/mame/drivers/asuka.c
+++ b/src/mame/drivers/asuka.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:David Graves, Brian Troha
/***************************************************************************
diff --git a/src/mame/drivers/atarisy2.c b/src/mame/drivers/atarisy2.c
index 62ce11f1657..f989596d660 100644
--- a/src/mame/drivers/atarisy2.c
+++ b/src/mame/drivers/atarisy2.c
@@ -194,18 +194,6 @@ void atarisy2_state::scanline_update(screen_device &screen, int scanline)
*
*************************************/
-DIRECT_UPDATE_MEMBER( atarisy2_state::atarisy2_direct_handler )
-{
- /* make sure slapstic area looks like ROM */
- if (address >= 0x8000 && address < 0x8200)
- {
- direct.explicit_configure(0x8000, 0x81ff, 0x1ff, reinterpret_cast<UINT8 *>(m_slapstic_base.target()));
- return ~0;
- }
- return address;
-}
-
-
MACHINE_START_MEMBER(atarisy2_state,atarisy2)
{
atarigen_state::machine_start();
@@ -215,6 +203,9 @@ MACHINE_START_MEMBER(atarisy2_state,atarisy2)
save_item(NAME(m_p2portwr_state));
save_item(NAME(m_p2portrd_state));
save_item(NAME(m_sound_reset_state));
+
+ m_rombank1->configure_entries(0, 64, memregion("maincpu")->base() + 0x10000, 0x2000);
+ m_rombank2->configure_entries(0, 64, memregion("maincpu")->base() + 0x10000, 0x2000);
}
@@ -224,8 +215,6 @@ MACHINE_RESET_MEMBER(atarisy2_state,atarisy2)
m_slapstic->slapstic_reset();
scanline_timer_reset(*m_screen, 64);
- m_maincpu->space(AS_PROGRAM).set_direct_update_handler(direct_update_delegate(FUNC(atarisy2_state::atarisy2_direct_handler), this));
-
m_p2portwr_state = 0;
m_p2portrd_state = 0;
@@ -286,44 +275,39 @@ WRITE16_MEMBER(atarisy2_state::int_enable_w)
WRITE16_MEMBER(atarisy2_state::bankselect_w)
{
- static const int bankoffset[64] =
+ /*static const int bankoffset[64] =
{
- 0x28000, 0x20000, 0x18000, 0x10000,
- 0x2a000, 0x22000, 0x1a000, 0x12000,
- 0x2c000, 0x24000, 0x1c000, 0x14000,
- 0x2e000, 0x26000, 0x1e000, 0x16000,
- 0x48000, 0x40000, 0x38000, 0x30000,
- 0x4a000, 0x42000, 0x3a000, 0x32000,
- 0x4c000, 0x44000, 0x3c000, 0x34000,
- 0x4e000, 0x46000, 0x3e000, 0x36000,
- 0x68000, 0x60000, 0x58000, 0x50000,
- 0x6a000, 0x62000, 0x5a000, 0x52000,
- 0x6c000, 0x64000, 0x5c000, 0x54000,
- 0x6e000, 0x66000, 0x5e000, 0x56000,
- 0x88000, 0x80000, 0x78000, 0x70000,
- 0x8a000, 0x82000, 0x7a000, 0x72000,
- 0x8c000, 0x84000, 0x7c000, 0x74000,
- 0x8e000, 0x86000, 0x7e000, 0x76000
- };
-
- int newword = m_bankselect[offset];
- UINT8 *base;
-
- COMBINE_DATA(&newword);
- m_bankselect[offset] = newword;
-
- base = &memregion("maincpu")->base()[bankoffset[(newword >> 10) & 0x3f]];
- memcpy(offset ? m_rombank2 : m_rombank1, base, 0x2000);
+ 12, 8, 4, 0,
+ 13, 9, 5, 1,
+ 14, 10, 6, 2,
+ 15, 11, 7, 3,
+ 28, 24, 20, 16,
+ 29, 25, 21, 17,
+ 30, 26, 22, 18,
+ 31, 27, 23, 19,
+ 44, 40, 36, 32,
+ 45, 41, 37, 33,
+ 46, 42, 38, 34,
+ 47, 43, 39, 35,
+ 60, 56, 52, 48,
+ 61, 57, 53, 49,
+ 62, 58, 54, 50,
+ 63, 59, 55, 51
+ };*/
+
+ int banknumber = ((data >> 10) & 0x3f) ^ 0x03;
+ banknumber = BITSWAP16(banknumber, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 1, 0, 3, 2);
+
+ if (offset)
+ m_rombank2->set_entry(banknumber);
+ else
+ m_rombank1->set_entry(banknumber);
}
void atarisy2_state::device_post_load()
{
atarigen_state::device_post_load();
-
- address_space &space = m_maincpu->space(AS_PROGRAM);
- bankselect_w(space, 0, m_bankselect[0], 0xffff);
- bankselect_w(space, 1, m_bankselect[1], 0xffff);
}
@@ -768,7 +752,7 @@ WRITE8_MEMBER(atarisy2_state::coincount_w)
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, atarisy2_state )
AM_RANGE(0x0000, 0x0fff) AM_RAM
AM_RANGE(0x1000, 0x11ff) AM_MIRROR(0x0200) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram")
- AM_RANGE(0x1400, 0x1403) AM_MIRROR(0x007c) AM_READWRITE(adc_r, bankselect_w) AM_SHARE("bankselect")
+ AM_RANGE(0x1400, 0x1403) AM_MIRROR(0x007c) AM_READWRITE(adc_r, bankselect_w)
AM_RANGE(0x1480, 0x1487) AM_MIRROR(0x0078) AM_WRITE(adc_strobe_w)
AM_RANGE(0x1580, 0x1581) AM_MIRROR(0x001e) AM_WRITE(int0_ack_w)
AM_RANGE(0x15a0, 0x15a1) AM_MIRROR(0x001e) AM_WRITE(int1_ack_w)
@@ -781,8 +765,8 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, atarisy2_state )
AM_RANGE(0x1800, 0x1801) AM_MIRROR(0x03fe) AM_READ(switch_r) AM_WRITE(watchdog_reset16_w)
AM_RANGE(0x1c00, 0x1c01) AM_MIRROR(0x03fe) AM_READ(sound_r)
AM_RANGE(0x2000, 0x3fff) AM_READWRITE(videoram_r, videoram_w)
- AM_RANGE(0x4000, 0x5fff) AM_ROM AM_SHARE("rombank1")
- AM_RANGE(0x6000, 0x7fff) AM_ROM AM_SHARE("rombank2")
+ AM_RANGE(0x4000, 0x5fff) AM_ROMBANK("rombank1")
+ AM_RANGE(0x6000, 0x7fff) AM_ROMBANK("rombank2")
AM_RANGE(0x8000, 0x81ff) AM_READWRITE(slapstic_r, slapstic_w) AM_SHARE("slapstic_base")
AM_RANGE(0x8000, 0xffff) AM_ROM
ADDRESS_MAP_END
diff --git a/src/mame/drivers/atarittl.c b/src/mame/drivers/atarittl.c
index 19b39e59306..6ae411bcf5f 100644
--- a/src/mame/drivers/atarittl.c
+++ b/src/mame/drivers/atarittl.c
@@ -16,43 +16,45 @@
Suspected "same games" are grouped together. These are usually the exact same game but different cabinet/name.
- Technical Manual #s Game Name(s) Atari Part #'s Data PROM/ROM Chip Numbers
- -------------------+----------------------------------------------------+----------------------------------+---------+---------------------------------------
- TM-025 Anti-Aircraft (1975) A000951 YES 003127
- TM-058 Breakout/Breakout Cocktail (1976) A004533 NO
- TM-048 Crash 'N Score/Stock Car (1975) A004256 YES 003186(x2), 003187(x2), 004248, 004247
- TM-030 Crossfire (1975)
- TM-003,005,011,020 Gran Trak 10/Trak 10/Formula K/Race Circuit (1974) A000872,A000872 K3RT YES 74186 Racetrack Prom (K5)
- TM-004,021 Gran Trak 20/Trak 20/Twin Racer (1974) A001791(RT20),A001793(A20-K4DRTA) YES 74186 Racetrack prom (K5)
- TM-006,035 Goal 4/World Cup/Coupe De Monde (1975) A000823 NO
- TM-016 Gotcha/Gotcha Color? (1973) A000816 NO
- TM-028 Highway/Hi-Way (1975) A003211 NO
- TM-055 Indy 4 (1976) A003000,A006268,A006270 YES 003186, 003187, 005502-01, 05503-01
- TM-026 Indy 800 (1975) A003000,A003170,A003182 YES 003186-003189 (4)
- A003184,A003191,A003198,A003199
- TM-027 Jet Fighter/Jet Fighter Cocktail (1975) A004254,A004255 YES 004250-004252, 004253-01 to 03 (3)
- TM-077 LeMans (1976) A005844,A005845 YES 005837-01, 005838-01, 005839-01
- TM-040 Outlaw (1976) A003213 YES 003323 - ROM (8205 @ J4)
- TM-007 Pin Pong (1974) A001660 NO
- TM-013 Pong/Super Pong (1972) A001433,A000423 NO
- TM-015 Pong Cocktail (1974) NO
- TM-014 Pong Doubles/Coupe Davis (1974) A000785 NO
- TM-018 Pursuit (1975) K8P-B 90128 NO
- TM-012,022,034 Quadrapong/Elimination (1974) A000845 NO
- TM-009 Qwak!/Quack (1974) A000937,A000953 YES 72074/37-2530N (K9)
- TM-001,032 Rebound/Volleyball (1974) A000517,A000846 NO
- TM-047 Shark Jaws (1975) A003806 YES 004182, 004183
- TM-008 Space Race (1974) A000803 NO
- TM-023 Spike (1974) SPIKE-(A or B) NO
- TM-046 Steeplechase/Astroturf (1975) A003750 YES 003774 ROM Bugle (C8), 003773-01 "A" Horse (C4), 003773-02 "B" Horse (D4)
- TM-057 Stunt Cycle (1976) A004128 YES 004275 ROM Motorcycle/Bus (1F), 004811 ROM Score Translator (D7)
- TM-010,036,049 Tank/Tank Cocktail/Tank II (1974/1975) A003111 (K5T-F 90124) YES 90-2006
- TM-002 Touch Me (1974) NO
+ Technical Manual #s Game Name(s) Atari Part #'s Data PROM/ROM Chip Numbers
+ -------------------+---------------------------------------------------------+----------------------------------+---------+---------------------------------------
+ TM-025 Anti-Aircraft (1975) A000951 YES 003127
+ TM-058 Breakout/Breakout Cocktail (1976) A004533 NO
+ TM-015 Cocktail Pong/Coup Franc (1974) ??????? NO
+ TM-048 Crash 'N Score/Stock Car (1975) A004256 YES 003186(x2), 003187(x2), 004248, 004247
+ TM-030 Crossfire (1975) ??????? NO?
+ TM-003,005,011,020 Gran Trak 10/Trak 10/Formula K/Race Circuit (1974) A000872,A000872 K3RT YES 74186 Racetrack Prom (K5)
+ TM-004,021 Gran Trak 20/Trak 20/Twin Racer (1974) A001791(RT20),A001793(A20-K4DRTA) YES 74186 Racetrack prom (K5)
+ TM-006,035 Goal 4/World Cup/Coupe De Monde (1975) A000823 NO
+ TM-016 Gotcha/Gotcha Color? (1973) A000816 NO
+ TM-028 Highway/Hi-Way (1975) A003211 NO
+ TM-055 Indy 4 (1976) A003000,A006268,A006270 YES 003186, 003187, 005502-01, 05503-01
+ TM-026 Indy 800 (1975) A003000,A003170,A003182 YES 003186-003189 (4)
+ A003184,A003191,A003198,A003199
+ TM-027 Jet Fighter/Jet Fighter Cocktail/Launch Aircraft (1975) A004254,A004255 YES 004250-004252, 004253-01 to 03 (3)
+ TM-077 LeMans (1976) A005844,A005845 YES 005837-01, 005838-01, 005839-01
+ TM-040 Outlaw (1976) A003213 YES 003323 - ROM (8205 @ J4)
+ TM-007 Pin Pong (1974) A001660 NO
+ TM-013 Pong/Super Pong (1972) A001433,A000423 NO
+ TM-014 Pong Doubles/Coupe Davis (1974) A000785 NO
+ TM-018 Pursuit (1975) K8P-B 90128 NO
+ TM-012,022,034 Quadrapong/Elimination (1974) A000845 NO
+ TM-009 Qwak!/Quack (1974) A000937,A000953 YES 72074/37-2530N (K9)
+ TM-001,032 Rebound/Volleyball (1974) A000517,A000846 NO
+ TM-047 Shark Jaws (1975) A003806 YES 004182, 004183
+ TM-008 Space Race (1974) A000803 NO
+ TM-023 Spike (1974) SPIKE-(A or B) NO
+ TM-046 Steeplechase/Astroturf (1975) A003750 YES 003774 ROM Bugle (C8), 003773-01 "A" Horse (C4), 003773-02 "B" Horse (D4)
+ TM-057 Stunt Cycle (1976) A004128 YES 004275 ROM Motorcycle/Bus (1F), 004811 ROM Score Translator (D7)
+ TM-010,036,049 Tank/Tank Cocktail/Tank II (1974/1975) A003111 (K5T-F 90124) YES 90-2006
+ TM-002 Touch Me (1974) ??????? NO
- Not Known to be released or produced, but at least announced.
- TM-024 Qwakers (Not Produced/Released)
- TM-017 World Cup Football (Not Produced/Released)
+ TM-0?? Arcade Driver/Driver First Person (Not Produced/Released) (197?)
+ TM-0?? Dodgeball/Dodgem (Not Produced/Released) (1975)
+ TM-024 Qwakers (Not Produced/Released) (1974?)
+ TM-017 World Cup Football (Not Produced/Released) (1974)
***************************************************************************/
@@ -308,7 +310,7 @@ ROM_END
/* // NO DUMPED ROMS
-// Astroturf
+// Astroturf (1975)
ROM_START( astrotrf )
ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 )
@@ -317,12 +319,7 @@ ROM_START( astrotrf )
ROM_LOAD( "003773-02.c4", 0x0100, 0x0100, NO_DUMP ) // Graphics (Astroturf - Rev.A)
ROM_END
-// Crossfire
-// Unclear if this is 100% TTL or if it uses a ROM:
-// IC description in manual says a rom is used (74186 ROM)
-// but the parts list in the same manual mentions no IC 74186!
-
-// Gran Trak 10
+// Gran Trak 10 / Trak 10 / Formula K / Race Circuit (1974)
ROM_START( gtrak10 ) // Unknown size, assumed 2K Bytes
ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 )
@@ -330,7 +327,7 @@ ROM_START( gtrak10 ) // Unknown size, assumed 2K Bytes
ROM_LOAD( "74168.k5", 0x0000, 0x0800, NO_DUMP) // Racetrack
ROM_END
-// Gran Trak 20
+// Gran Trak 20 / Trak 20 / Twin Racer (1974)
ROM_START( gtrak20 ) // Unknown size, assumed 2K Bytes
ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 )
@@ -338,7 +335,7 @@ ROM_START( gtrak20 ) // Unknown size, assumed 2K Bytes
ROM_LOAD( "74168.k5", 0x0000, 0x0800, NO_DUMP) // Racetrack
ROM_END
-// LeMans
+// LeMans (1976)
ROM_START( lemans )
ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 )
@@ -348,7 +345,7 @@ ROM_START( lemans )
ROM_LOAD( "005839-01.n6", 0x0200, 0x0100, NO_DUMP ) // Rom 3
ROM_END
-// Qwak!
+// Qwak! / Quack (1974)
ROM_START( qwak )
ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 )
@@ -361,6 +358,16 @@ ROM_END
/* // 100% TTL - NO ROMS
+// Crossfire (1975)
+// Unclear if this is 100% TTL or if it uses a ROM:
+// IC description in manual says a rom is used (74186 ROM)
+// but the parts list in the same manual mentions no IC 74186!
+// Simulated in DICE without ROMs from schematics, so unlikely
+// it uses any, and is in fact 100% TTL..
+ROM_START ( crossfir )
+ ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 )
+ROM_END
+
ROM_START( goal4 )
ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 )
ROM_END
@@ -410,33 +417,34 @@ ROM_END
GAME(1975, antiairc, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Anti-Aircraft [TTL]", GAME_IS_SKELETON)
-GAME(1975, crashnsc, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Crash 'n Score [TTL]", GAME_IS_SKELETON)
+GAME(1975, crashnsc, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Crash 'n Score/Stock Car [TTL]", GAME_IS_SKELETON)
GAME(1976, indy4, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Indy 4 [TTL]", GAME_IS_SKELETON)
GAME(1975, indy800, 0, atarikee, 0, driver_device, 0, ROT90, "Atari/Kee", "Indy 800 [TTL]", GAME_IS_SKELETON)
-GAME(1975, jetfight, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Jet Fighter (set 1) [TTL]", GAME_IS_SKELETON)
-GAME(1975, jetfighta, jetfight, atarikee, 0, driver_device, 0, ROT0, "Atari", "Jet Fighter (set 2) [TTL]", GAME_IS_SKELETON)
+GAME(1975, jetfight, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Jet Fighter/Jet Fighter Cocktail/Launch Aircraft (set 1) [TTL]", GAME_IS_SKELETON)
+GAME(1975, jetfighta, jetfight, atarikee, 0, driver_device, 0, ROT0, "Atari", "Jet Fighter/Jet Fighter Cocktail/Launch Aircraft (set 2) [TTL]", GAME_IS_SKELETON)
GAME(1976, outlaw, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Outlaw [TTL]", GAME_IS_SKELETON)
GAME(1975, sharkjaw, 0, atarikee, 0, driver_device, 0, ROT0, "Atari/Horror Games", "Shark JAWS [TTL]",GAME_IS_SKELETON)
GAME(1975, steeplec, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Steeplechase [TTL]", GAME_IS_SKELETON)
GAME(1976, stuntcyc, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Stunt Cycle [TTL]", GAME_IS_SKELETON)
-GAME(1974, tank, 0, atarikee, 0, driver_device, 0, ROT0, "Atari/Kee", "Tank/Tank II [TTL]", GAME_IS_SKELETON)
+GAME(1974, tank, 0, atarikee, 0, driver_device, 0, ROT0, "Atari/Kee", "Tank/Tank Cocktail/Tank II [TTL]", GAME_IS_SKELETON)
// MISSING ROM DUMPS
-//GAME(1975, astrotrf, steeplec, atarikee, 0, driver_device, 0, ROT0, "Atari", "Astroturf [TTL]",GAME_IS_SKELETON)
+//GAME(1975, astrotrf, steeplec, atarikee, 0, driver_device, 0, ROT0, "Atari", "Astroturf [TTL]", GAME_IS_SKELETON)
+//GAME(1974, gtrak10, 0, atarikee, 0, driver_device, 0, ROT0, "Atari/Kee", "Gran Trak 10/Trak 10/Formula K/Race Circuit [TTL]", GAME_IS_SKELETON) //?
+//GAME(1974, gtrak20, 0, atarikee, 0, driver_device, 0, ROT0, "Atari/Kee", "Gran Trak 20/Trak 20/Twin Racer [TTL]", GAME_IS_SKELETON) //?
//GAME(1976, lemans, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "LeMans [TTL]", GAME_IS_SKELETON)
-//GAME(1974, gtrak10, 0, atarikee, 0, driver_device, 0, ROT0, "Atari/Kee", "Gran Trak 10/Trak 10/Formula K/Race Circuit [TTL]",GAME_IS_SKELETON) //?
-//GAME(1974, gtrak20, 0, atarikee, 0, driver_device, 0, ROT0, "Atari/Kee", "Gran Trak 20/Trak 20/Twin Racer [TTL]",GAME_IS_SKELETON) //?
//GAME(1974, quack, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Qwak!/Quack [TTL]", GAME_IS_SKELETON)
-// 100% TLL
-//GAME(1974, coupedem, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Coupe De Monde [TTL]",GAME_IS_SKELETON)
-//GAME(1975, goal4, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Goal 4/World Cup/Coupe De Monde [TTL]",GAME_IS_SKELETON)
-//GAME(1973, gotchaat, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Gotcha [TTL]",GAME_IS_SKELETON) //?
-//GAME(1973, gotchaatc, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Gotcha Color [TTL]",GAME_IS_SKELETON) //?
-//GAME(1975, highway, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Highway/Hiway [TTL]",GAME_IS_SKELETON)
-//GAME(1974, pinpong, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Pin Pong [TTL]",GAME_IS_SKELETON)
-//GAME(1975, pursuit, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Pursuit [TTL]",GAME_IS_SKELETON)
-//GAME(1973, quadpong, 0, atarikee, 0, driver_device, 0, ROT0, "Atari/Kee", "Quadrapong/Elimination [TTL]",GAME_IS_SKELETON)
-//GAME(1974, rebound, 0, atarikee, 0, driver_device, 0, ROT0, "Atari/Kee", "Rebound/Spike/Volleyball [TTL]",GAME_IS_SKELETON)
-//GAME(1974, spacrace, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Space Race [TTL]",GAME_IS_SKELETON)
-//GAME(1974, touchme, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Touch Me [TTL]",GAME_IS_SKELETON) //?
+// 100% TTL
+//GAME(1974, coupedem, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Coupe De Monde [TTL]", GAME_IS_SKELETON)
+//GAME(1975, crossfir, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Crossfire [TTL]", GAME_IS_SKELETON)
+//GAME(1975, goal4, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Goal 4/World Cup/Coupe De Monde [TTL]", GAME_IS_SKELETON)
+//GAME(1973, gotchaat, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Gotcha [TTL]", GAME_IS_SKELETON) //?
+//GAME(1973, gotchaatc, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Gotcha Color [TTL]", GAME_IS_SKELETON) //?
+//GAME(1975, highway, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Highway/Hiway [TTL]", GAME_IS_SKELETON)
+//GAME(1974, pinpong, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Pin Pong [TTL]", GAME_IS_SKELETON)
+//GAME(1975, pursuit, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Pursuit [TTL]", GAME_IS_SKELETON)
+//GAME(1973, quadpong, 0, atarikee, 0, driver_device, 0, ROT0, "Atari/Kee", "Quadrapong/Elimination [TTL]", GAME_IS_SKELETON)
+//GAME(1974, rebound, 0, atarikee, 0, driver_device, 0, ROT0, "Atari/Kee", "Rebound/Spike/Volleyball [TTL]", GAME_IS_SKELETON)
+//GAME(1974, spacrace, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Space Race [TTL]", GAME_IS_SKELETON)
+//GAME(1974, touchme, 0, atarikee, 0, driver_device, 0, ROT0, "Atari", "Touch Me [TTL]", GAME_IS_SKELETON) //?
diff --git a/src/mame/drivers/bailey.c b/src/mame/drivers/bailey.c
index 4ccf874269d..9ba1600648f 100644
--- a/src/mame/drivers/bailey.c
+++ b/src/mame/drivers/bailey.c
@@ -4,7 +4,10 @@
Bailey International discrete hardware games
+ Fighter Squadron (1976)
Fun Four (1976)
+ Missile Command (1976)
+ Sebring (1976)
***************************************************************************/
diff --git a/src/mame/drivers/battlera.c b/src/mame/drivers/battlera.c
index 792ce0ceb01..00f9bcebbda 100644
--- a/src/mame/drivers/battlera.c
+++ b/src/mame/drivers/battlera.c
@@ -24,14 +24,20 @@
#include "emu.h"
#include "cpu/h6280/h6280.h"
#include "sound/2203intf.h"
-#include "sound/msm5205.h"
#include "sound/c6280.h"
#include "includes/battlera.h"
+void battlera_state::machine_start()
+{
+ save_item(NAME(m_control_port_select));
+ save_item(NAME(m_msm5205next));
+ save_item(NAME(m_toggle));
+}
+
/******************************************************************************/
-WRITE8_MEMBER(battlera_state::battlera_sound_w)
+WRITE8_MEMBER(battlera_state::sound_w)
{
if (offset == 0)
{
@@ -65,7 +71,7 @@ READ8_MEMBER(battlera_state::control_data_r)
static ADDRESS_MAP_START( battlera_map, AS_PROGRAM, 8, battlera_state )
AM_RANGE(0x000000, 0x0fffff) AM_ROM
- AM_RANGE(0x1e0800, 0x1e0801) AM_WRITE(battlera_sound_w)
+ AM_RANGE(0x1e0800, 0x1e0801) AM_WRITE(sound_w)
AM_RANGE(0x1e1000, 0x1e13ff) AM_DEVREADWRITE( "huc6260", huc6260_device, palette_direct_read, palette_direct_write) AM_SHARE("paletteram")
AM_RANGE(0x1f0000, 0x1f1fff) AM_RAMBANK("bank8") /* Main ram */
AM_RANGE(0x1ff000, 0x1ff001) AM_READWRITE(control_data_r, control_data_w)
@@ -84,7 +90,7 @@ ADDRESS_MAP_END
/******************************************************************************/
-WRITE_LINE_MEMBER(battlera_state::battlera_adpcm_int)
+WRITE_LINE_MEMBER(battlera_state::adpcm_int)
{
m_msm->data_w(m_msm5205next >> 4);
m_msm5205next <<= 4;
@@ -94,12 +100,12 @@ WRITE_LINE_MEMBER(battlera_state::battlera_adpcm_int)
m_audiocpu->set_input_line(1, HOLD_LINE);
}
-WRITE8_MEMBER(battlera_state::battlera_adpcm_data_w)
+WRITE8_MEMBER(battlera_state::adpcm_data_w)
{
m_msm5205next = data;
}
-WRITE8_MEMBER(battlera_state::battlera_adpcm_reset_w)
+WRITE8_MEMBER(battlera_state::adpcm_reset_w)
{
m_msm->reset_w(0);
}
@@ -107,10 +113,10 @@ WRITE8_MEMBER(battlera_state::battlera_adpcm_reset_w)
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, battlera_state )
AM_RANGE(0x000000, 0x00ffff) AM_ROM
AM_RANGE(0x040000, 0x040001) AM_DEVWRITE("ymsnd", ym2203_device, write)
- AM_RANGE(0x080000, 0x080001) AM_WRITE(battlera_adpcm_data_w)
+ AM_RANGE(0x080000, 0x080001) AM_WRITE(adpcm_data_w)
AM_RANGE(0x1fe800, 0x1fe80f) AM_DEVWRITE("c6280", c6280_device, c6280_w)
AM_RANGE(0x1f0000, 0x1f1fff) AM_RAMBANK("bank7") /* Main ram */
- AM_RANGE(0x1ff000, 0x1ff001) AM_READ(soundlatch_byte_r) AM_WRITE(battlera_adpcm_reset_w)
+ AM_RANGE(0x1ff000, 0x1ff001) AM_READ(soundlatch_byte_r) AM_WRITE(adpcm_reset_w)
AM_RANGE(0x1ff400, 0x1ff403) AM_DEVWRITE("audiocpu", h6280_device, irq_status_w)
ADDRESS_MAP_END
@@ -183,11 +189,6 @@ INPUT_PORTS_END
/******************************************************************************/
-WRITE_LINE_MEMBER(battlera_state::pce_irq_changed)
-{
- m_maincpu->set_input_line(0, state);
-}
-
UINT32 battlera_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
m_huc6260->video_update( bitmap, cliprect );
@@ -219,8 +220,7 @@ static MACHINE_CONFIG_START( battlera, battlera_state )
MCFG_DEVICE_ADD( "huc6270", HUC6270, 0 )
MCFG_HUC6270_VRAM_SIZE(0x20000)
- MCFG_HUC6270_IRQ_CHANGED_CB(WRITELINE(battlera_state, pce_irq_changed))
-
+ MCFG_HUC6270_IRQ_CHANGED_CB(INPUTLINE("maincpu", 0))
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
@@ -230,7 +230,7 @@ static MACHINE_CONFIG_START( battlera, battlera_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.40)
MCFG_SOUND_ADD("msm", MSM5205, 384000)
- MCFG_MSM5205_VCLK_CB(WRITELINE(battlera_state, battlera_adpcm_int)) /* interrupt function */
+ MCFG_MSM5205_VCLK_CB(WRITELINE(battlera_state, adpcm_int)) /* interrupt function */
MCFG_MSM5205_PRESCALER_SELECTOR(MSM5205_S48_4B) /* 8KHz */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.85)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.85)
@@ -301,6 +301,6 @@ ROM_END
/******************************************************************************/
-GAME( 1988, battlera, 0, battlera, battlera, driver_device, 0, ROT0, "Data East Corporation", "Battle Rangers (World)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
-GAME( 1988, bldwolf, battlera, battlera, battlera, driver_device, 0, ROT0, "Data East USA", "Bloody Wolf (US)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
-GAME( 1988, bldwolfj, battlera, battlera, battlera, driver_device, 0, ROT0, "Data East Corporation", "Narazumono Sentoubutai Bloody Wolf (Japan)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
+GAME( 1988, battlera, 0, battlera, battlera, driver_device, 0, ROT0, "Data East Corporation", "Battle Rangers (World)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
+GAME( 1988, bldwolf, battlera, battlera, battlera, driver_device, 0, ROT0, "Data East USA", "Bloody Wolf (US)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
+GAME( 1988, bldwolfj, battlera, battlera, battlera, driver_device, 0, ROT0, "Data East Corporation", "Narazumono Sentoubutai Bloody Wolf (Japan)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/bbusters.c b/src/mame/drivers/bbusters.c
index 0077139e261..8d615cd422a 100644
--- a/src/mame/drivers/bbusters.c
+++ b/src/mame/drivers/bbusters.c
@@ -788,10 +788,58 @@ ROM_END
ROM_START( bbustersu )
ROM_REGION( 0x80000, "maincpu", 0 )
- ROM_LOAD16_BYTE( "bbv2-3.k10", 0x000000, 0x20000, CRC(6930088b) SHA1(265f0b584d81b6fdcda5c3a2e0bd15d56443bb35) )
- ROM_LOAD16_BYTE( "bbv2-5.k12", 0x000001, 0x20000, CRC(cfdb2c6c) SHA1(54a837dc84b74d12e931f607f3dc9ee06a7e4d31) )
- ROM_LOAD16_BYTE( "bb-2.k8", 0x040000, 0x20000, CRC(20141805) SHA1(0958579681bda81bcf48d020a14bc147c1e575f1) )
- ROM_LOAD16_BYTE( "bb-4.k11", 0x040001, 0x20000, CRC(d482e0e9) SHA1(e56ca92965e8954b613ba4b0e3975e3a12840c30) )
+ ROM_LOAD16_BYTE( "bb-ver3-u3.k10", 0x000000, 0x20000, CRC(c80ec3bc) SHA1(81cccc920c6dc58ccd20fb38bfede717f534986f) )
+ ROM_LOAD16_BYTE( "bb-ver3-u5.k12", 0x000001, 0x20000, CRC(5ded86d1) SHA1(de2ce91b85a1d74e60a7093211c1a7d3c27c1d72) )
+ ROM_LOAD16_BYTE( "bb-2.k8", 0x040000, 0x20000, CRC(20141805) SHA1(0958579681bda81bcf48d020a14bc147c1e575f1) )
+ ROM_LOAD16_BYTE( "bb-4.k11", 0x040001, 0x20000, CRC(d482e0e9) SHA1(e56ca92965e8954b613ba4b0e3975e3a12840c30) )
+
+ ROM_REGION( 0x10000, "audiocpu", 0 )
+ ROM_LOAD( "bb-1.e6", 0x000000, 0x10000, CRC(4360f2ee) SHA1(4c6b212f59389bdf4388893d2030493b110ac087) )
+
+ ROM_REGION( 0x020000, "gfx1", 0 )
+ ROM_LOAD( "bb-10.l9", 0x000000, 0x20000, CRC(490c0d9b) SHA1(567c25a6d96407259c64061d674305e4117d9fa4) )
+
+ ROM_REGION( 0x200000, "gfx2", 0 )
+ ROM_LOAD( "bb-f11.m16", 0x000000, 0x80000, CRC(39fdf9c0) SHA1(80392947e3a1831c3ee80139f6f3bdc3bafa4f0d) )
+ ROM_LOAD( "bb-f12.m13", 0x080000, 0x80000, CRC(69ee046b) SHA1(5c0435f1ce76b584fa8d154d7617d73c7ab5f62f) )
+ ROM_LOAD( "bb-f13.m12", 0x100000, 0x80000, CRC(f5ef840e) SHA1(dd0f630c52076e0d330f47931e68a3ae9a401078) )
+ ROM_LOAD( "bb-f14.m11", 0x180000, 0x80000, CRC(1a7df3bb) SHA1(1f27a528e6f89fe56a7342c4f1ff733da0a09327) )
+
+ ROM_REGION( 0x200000, "gfx3", 0 )
+ ROM_LOAD( "bb-f21.l10", 0x000000, 0x80000, CRC(530f595b) SHA1(820898693b878c4423de9c244f943d39ea69515e) )
+ ROM_LOAD( "bb-f22.l12", 0x080000, 0x80000, CRC(889c562e) SHA1(d19172d6515ab9793c98de75d6e41687e61a408d) )
+ ROM_LOAD( "bb-f23.l13", 0x100000, 0x80000, CRC(c89fe0da) SHA1(92be860a7191e7473c42aa2da981eda873219d3d) )
+ ROM_LOAD( "bb-f24.l15", 0x180000, 0x80000, CRC(e0d81359) SHA1(2213c17651b6c023a456447f352b0739439f913a) )
+
+ ROM_REGION( 0x80000, "gfx4", 0 )
+ ROM_LOAD( "bb-back1.m4", 0x000000, 0x80000, CRC(b5445313) SHA1(3c99b557b2af30ff0fbc8a7dc6c40448c4f327db) )
+
+ ROM_REGION( 0x80000, "gfx5", 0 )
+ ROM_LOAD( "bb-back2.m6", 0x000000, 0x80000, CRC(8be996f6) SHA1(1e2c56f4c24793f806d7b366b92edc03145ae94c) )
+
+ ROM_REGION( 0x10000, "user1", 0 ) /* Zoom table */
+ /* same rom exists in 4 different locations on the board */
+ ROM_LOAD( "bb-6.e7", 0x000000, 0x10000, CRC(61f3de03) SHA1(736f9634fe054ea68a2aa90a743bd0dc320f23c9) )
+ ROM_LOAD( "bb-7.h7", 0x000000, 0x10000, CRC(61f3de03) SHA1(736f9634fe054ea68a2aa90a743bd0dc320f23c9) )
+ ROM_LOAD( "bb-8.a14", 0x000000, 0x10000, CRC(61f3de03) SHA1(736f9634fe054ea68a2aa90a743bd0dc320f23c9) )
+ ROM_LOAD( "bb-9.c14", 0x000000, 0x10000, CRC(61f3de03) SHA1(736f9634fe054ea68a2aa90a743bd0dc320f23c9) )
+
+ ROM_REGION( 0x80000, "ymsnd", 0 )
+ ROM_LOAD( "bb-pcma.l5", 0x000000, 0x80000, CRC(44cd5bfe) SHA1(26a612191a0aa614c090203485aba17c99c763ee) )
+
+ ROM_REGION( 0x80000, "ymsnd.deltat", 0 )
+ ROM_LOAD( "bb-pcma.l5", 0x000000, 0x80000, CRC(44cd5bfe) SHA1(26a612191a0aa614c090203485aba17c99c763ee) )
+
+ ROM_REGION( 0x100, "eeprom", 0 )
+ ROM_LOAD( "bbusters-eeprom.bin", 0x00, 0x100, CRC(a52ebd66) SHA1(de04db6f1510700c61bf152799452a80220ae87c) )
+ROM_END
+
+ROM_START( bbustersua )
+ ROM_REGION( 0x80000, "maincpu", 0 )
+ ROM_LOAD16_BYTE( "bb-ver2-u3.k10", 0x000000, 0x20000, CRC(6930088b) SHA1(265f0b584d81b6fdcda5c3a2e0bd15d56443bb35) )
+ ROM_LOAD16_BYTE( "bb-ver2-u5.k12", 0x000001, 0x20000, CRC(cfdb2c6c) SHA1(54a837dc84b74d12e931f607f3dc9ee06a7e4d31) )
+ ROM_LOAD16_BYTE( "bb-2.k8", 0x040000, 0x20000, CRC(20141805) SHA1(0958579681bda81bcf48d020a14bc147c1e575f1) )
+ ROM_LOAD16_BYTE( "bb-4.k11", 0x040001, 0x20000, CRC(d482e0e9) SHA1(e56ca92965e8954b613ba4b0e3975e3a12840c30) )
ROM_REGION( 0x10000, "audiocpu", 0 )
ROM_LOAD( "bb-1.e6", 0x000000, 0x10000, CRC(4360f2ee) SHA1(4c6b212f59389bdf4388893d2030493b110ac087) )
@@ -1020,10 +1068,11 @@ ROM_END
/******************************************************************************/
// as soon as you calibrate the guns in test mode the game refuses to boot
-GAME( 1989, bbusters, 0, bbusters, bbusters, driver_device, 0, ROT0, "SNK", "Beast Busters (World)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
-GAME( 1989, bbustersu,bbusters, bbusters, bbusters, driver_device, 0, ROT0, "SNK", "Beast Busters (US, Version 2)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
-
-GAME( 1989, mechatt, 0, mechatt, mechatt, driver_device, 0, ROT0, "SNK", "Mechanized Attack (World)", GAME_SUPPORTS_SAVE )
-GAME( 1989, mechattj, mechatt, mechatt, mechattj, driver_device, 0, ROT0, "SNK", "Mechanized Attack (Japan)", GAME_SUPPORTS_SAVE )
-GAME( 1989, mechattu, mechatt, mechatt, mechattu, driver_device, 0, ROT0, "SNK", "Mechanized Attack (US)", GAME_SUPPORTS_SAVE )
-GAME( 1989, mechattu1,mechatt, mechatt, mechattu, driver_device, 0, ROT0, "SNK", "Mechanized Attack (US, Version 1, Single Player)", GAME_SUPPORTS_SAVE )
+GAME( 1989, bbusters, 0, bbusters, bbusters, driver_device, 0, ROT0, "SNK", "Beast Busters (World)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
+GAME( 1989, bbustersu, bbusters, bbusters, bbusters, driver_device, 0, ROT0, "SNK", "Beast Busters (US, Version 3)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
+GAME( 1989, bbustersua, bbusters, bbusters, bbusters, driver_device, 0, ROT0, "SNK", "Beast Busters (US, Version 2)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
+
+GAME( 1989, mechatt, 0, mechatt, mechatt, driver_device, 0, ROT0, "SNK", "Mechanized Attack (World)", GAME_SUPPORTS_SAVE )
+GAME( 1989, mechattj, mechatt, mechatt, mechattj, driver_device, 0, ROT0, "SNK", "Mechanized Attack (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1989, mechattu, mechatt, mechatt, mechattu, driver_device, 0, ROT0, "SNK", "Mechanized Attack (US)", GAME_SUPPORTS_SAVE )
+GAME( 1989, mechattu1, mechatt, mechatt, mechattu, driver_device, 0, ROT0, "SNK", "Mechanized Attack (US, Version 1, Single Player)", GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/bfcobra.c b/src/mame/drivers/bfcobra.c
index 732034483d5..a65b185aebe 100644
--- a/src/mame/drivers/bfcobra.c
+++ b/src/mame/drivers/bfcobra.c
@@ -102,11 +102,11 @@
union ADDR_REG
{
#ifdef LSB_FIRST
- struct { UINT16 loword, hiword ; } ;
- struct { UINT8 addr0, addr1, addr2; };
+ struct { UINT16 loword, hiword ; } as16bit;
+ struct { UINT8 addr0, addr1, addr2; } as8bit;
#else
- struct { UINT16 hiword, loword ; } ;
- struct { UINT8 addr2, addr1, addr0; };
+ struct { UINT16 hiword, loword ; } as16bit;
+ struct { UINT8 addr2, addr1, addr0; } as8bit;
#endif
UINT32 addr;
};
@@ -490,12 +490,12 @@ void bfcobra_state::RunBlit(address_space &space)
UINT8 dstdata = 0;
/* Read the blitter command */
- BLITPRG_READ(source.addr0);
- BLITPRG_READ(source.addr1);
- BLITPRG_READ(source.addr2);
- BLITPRG_READ(dest.addr0);
- BLITPRG_READ(dest.addr1);
- BLITPRG_READ(dest.addr2);
+ BLITPRG_READ(source.as8bit.addr0);
+ BLITPRG_READ(source.as8bit.addr1);
+ BLITPRG_READ(source.as8bit.addr2);
+ BLITPRG_READ(dest.as8bit.addr0);
+ BLITPRG_READ(dest.as8bit.addr1);
+ BLITPRG_READ(dest.as8bit.addr2);
BLITPRG_READ(modectl);
BLITPRG_READ(compfunc);
BLITPRG_READ(outercnt);
@@ -516,13 +516,13 @@ void bfcobra_state::RunBlit(address_space &space)
blitter.command & CMD_SRCUP ? "SRCUP" : " ",
blitter.command & CMD_DSTUP ? "DSTUP" : " ");
- osd_printf_debug("Src Address Byte 0 %.2x\n", blitter.source.addr0);
- osd_printf_debug("Src Address Byte 1 %.2x\n", blitter.source.addr1);
- osd_printf_debug("Src Control %.2x\n", blitter.source.addr2);
+ osd_printf_debug("Src Address Byte 0 %.2x\n", blitter.source.as8bit.addr0);
+ osd_printf_debug("Src Address Byte 1 %.2x\n", blitter.source.as8bit.addr1);
+ osd_printf_debug("Src Control %.2x\n", blitter.source.as8bit.addr2);
osd_printf_debug(" Src Address %.5x\n", blitter.source.addr & 0xfffff);
- osd_printf_debug("Dest Address Byte 0 %.2x\n", blitter.dest.addr0);
- osd_printf_debug("Dest Address Byte 1 %.2x\n", blitter.dest.addr1);
- osd_printf_debug("Dest Control %.2x\n", blitter.dest.addr2);
+ osd_printf_debug("Dest Address Byte 0 %.2x\n", blitter.dest.as8bit.addr0);
+ osd_printf_debug("Dest Address Byte 1 %.2x\n", blitter.dest.as8bit.addr1);
+ osd_printf_debug("Dest Control %.2x\n", blitter.dest.as8bit.addr2);
osd_printf_debug(" Dst. Address %.5x\n", blitter.dest.addr & 0xfffff);
osd_printf_debug("Mode Control %.2x", blitter.modectl);
osd_printf_debug(" %s\n", blitter.modectl & MODE_BITTOBYTE ? "BIT_TO_BYTE" : "");
@@ -552,40 +552,40 @@ void bfcobra_state::RunBlit(address_space &space)
if (blitter.modectl & MODE_YFRAC)
{
if (blitter.modectl & MODE_SSIGN )
- blitter.dest.addr0--;
+ blitter.dest.as8bit.addr0--;
else
- blitter.dest.addr0++;
+ blitter.dest.as8bit.addr0++;
}
else
{
if (blitter.modectl & MODE_DSIGN )
- blitter.dest.addr1--;
+ blitter.dest.as8bit.addr1--;
else
- blitter.dest.addr1++;
+ blitter.dest.as8bit.addr1++;
}
- if( blitter.source.addr0 < blitter.step )
+ if( blitter.source.as8bit.addr0 < blitter.step )
{
- blitter.source.addr0 -=blitter.step ;
- blitter.source.addr0 +=blitter.source.addr1;
+ blitter.source.as8bit.addr0 -= blitter.step ;
+ blitter.source.as8bit.addr0 += blitter.source.as8bit.addr1;
if ( blitter.modectl & MODE_YFRAC )
{
if (blitter.modectl & MODE_DSIGN )
- blitter.dest.addr1--;
+ blitter.dest.as8bit.addr1--;
else
- blitter.dest.addr1++;
+ blitter.dest.as8bit.addr1++;
}
else
{
if (blitter.modectl & MODE_SSIGN )
- blitter.dest.addr0--;
+ blitter.dest.as8bit.addr0--;
else
- blitter.dest.addr0++;
+ blitter.dest.as8bit.addr0++;
}
}
else
{
- blitter.source.addr0 -=blitter.step;
+ blitter.source.as8bit.addr0 -= blitter.step;
}
*blitter_get_addr( blitter.dest.addr) = blitter.pattern;
@@ -603,7 +603,7 @@ void bfcobra_state::RunBlit(address_space &space)
if (LOOPTYPE == 3 && innercnt == blitter.innercnt)
{
srcdata = *(blitter_get_addr( blitter.source.addr & 0xfffff));
- blitter.source.loword++;
+ blitter.source.as16bit.loword++;
cycles_used++;
}
@@ -616,9 +616,9 @@ void bfcobra_state::RunBlit(address_space &space)
cycles_used++;
if (blitter.modectl & MODE_SSIGN)
- blitter.source.loword-- ;
+ blitter.source.as16bit.loword-- ;
else
- blitter.source.loword++;
+ blitter.source.as16bit.loword++;
result = srcdata;
}
@@ -725,9 +725,9 @@ void bfcobra_state::RunBlit(address_space &space)
/* Update destination address */
if (blitter.modectl & MODE_DSIGN)
- blitter.dest.loword--;
+ blitter.dest.as16bit.loword--;
else
- blitter.dest.loword++;
+ blitter.dest.as16bit.loword++;
} while (--innercnt);
@@ -738,10 +738,10 @@ void bfcobra_state::RunBlit(address_space &space)
else
{
if (blitter.command & CMD_DSTUP)
- blitter.dest.loword += blitter.step;
+ blitter.dest.as16bit.loword += blitter.step;
if (blitter.command & CMD_SRCUP)
- blitter.source.loword += blitter.step;
+ blitter.source.as16bit.loword += blitter.step;
if (blitter.command & CMD_PARRD)
{
@@ -937,7 +937,7 @@ READ8_MEMBER(bfcobra_state::chipset_r)
case 0x20:
{
/* Seems correct - used during RLE pic decoding */
- val = m_blitter.dest.addr0;
+ val = m_blitter.dest.as8bit.addr0;
break;
}
case 0x22:
@@ -1006,17 +1006,17 @@ WRITE8_MEMBER(bfcobra_state::chipset_w)
}
case 0x18:
{
- m_blitter.program.addr0 = data;
+ m_blitter.program.as8bit.addr0 = data;
break;
}
case 0x19:
{
- m_blitter.program.addr1 = data;
+ m_blitter.program.as8bit.addr1 = data;
break;
}
case 0x1A:
{
- m_blitter.program.addr2 = data;
+ m_blitter.program.as8bit.addr2 = data;
break;
}
case 0x20:
@@ -1091,7 +1091,7 @@ enum fdc_phase
COMMAND,
EXECUTION_R,
EXECUTION_W,
- RESULTS,
+ RESULTS
};
enum command
diff --git a/src/mame/drivers/bionicc.c b/src/mame/drivers/bionicc.c
index 196c217979e..a6a36ea55b0 100644
--- a/src/mame/drivers/bionicc.c
+++ b/src/mame/drivers/bionicc.c
@@ -567,6 +567,47 @@ ROM_START( topsecrt ) /* "Not for use in any other country but Japan" */
ROM_LOAD( "63s141.18f", 0x0000, 0x0100, CRC(b58d0023) SHA1(e8a4a2e2951bf73b3d9eed6957e9ee1e61c9c58a) ) /* priority (not used), Labeled "TSB" */
ROM_END
+ROM_START( bioniccbl )
+ ROM_REGION( 0x40000, "maincpu", 0 ) /* 68000 code */
+ ROM_LOAD16_BYTE( "02l.bin", 0x00000, 0x10000, CRC(b2fe1ddb) SHA1(892f19124993add96edabdba3aafeecc6668c5d9) )
+ ROM_LOAD16_BYTE( "03l.bin", 0x00001, 0x10000, CRC(427a003d) SHA1(5a379fe2942e5565810939d5eb843003226222cc) )
+ ROM_LOAD16_BYTE( "02u.bin", 0x20000, 0x10000, CRC(27f04bb6) SHA1(41d17b84b34dc8b2e5dfa67794a8df3e898b740b) )
+ ROM_LOAD16_BYTE( "03u.bin", 0x20001, 0x10000, CRC(c01547b1) SHA1(563bf6be4f10f5e6eb5b562266accf168f62bf30) )
+
+ ROM_REGION( 0x10000, "audiocpu", 0 )
+ ROM_LOAD( "01.bin", 0x00000, 0x8000, CRC(8ea07917) SHA1(e9ace70d89482fc3669860450a41aacacbee9083) )
+
+ ROM_REGION( 0x1000, "mcu", 0 ) /* i8751 microcontroller */
+ ROM_LOAD( "c8751h-88", 0x0000, 0x1000, NO_DUMP ) // 19.bin (protected)
+
+ ROM_REGION( 0x08000, "gfx1", 0 )
+ ROM_LOAD( "06.bin", 0x00000, 0x4000, CRC(4e6b81d9) SHA1(052784d789b0c9193edf218fa1883b6e3b7df988) )
+
+ ROM_REGION( 0x10000, "gfx2", 0 )
+ ROM_LOAD( "05.bin", 0x00000, 0x8000, CRC(9bf8dc7f) SHA1(539a52087ed1f58839b6aa8c0b5ed249f4f4041e) )
+ ROM_LOAD( "04.bin", 0x08000, 0x8000, CRC(1b43bf63) SHA1(b80d675a07cebd83daf202d1c3d3f7c2dedf5c30) )
+
+ ROM_REGION( 0x40000, "gfx3", 0 )
+ ROM_LOAD( "ts_12.17f", 0x00000, 0x8000, CRC(e4b4619e) SHA1(3bec8399ffb28fd50ce6ae88d90b091eadf8bda1) ) // 09.bin
+ ROM_LOAD( "ts_11.15f", 0x08000, 0x8000, CRC(ab30237a) SHA1(ea6c07df992ba48f9eca7daa4ea775faa94358d2) ) // 08.bin
+ ROM_LOAD( "ts_17.17g", 0x10000, 0x8000, CRC(deb657e4) SHA1(b36b468f9bbb7a4937286230d3f6caa14c61d4dd) ) // 13.bin
+ ROM_LOAD( "ts_16.15g", 0x18000, 0x8000, CRC(d363b5f9) SHA1(1dd3991d99db2d6bcbdb12879ba50a01fef95004) ) // 12.bin
+ ROM_LOAD( "ts_13.18f", 0x20000, 0x8000, CRC(a8f5a004) SHA1(36ab0cb8ec9ce0519876f7461ccc5020c9c5b597) ) // 10.bin
+ ROM_LOAD( "ts_18.18g", 0x28000, 0x8000, CRC(3b36948c) SHA1(d85fcc0265ba1729c587b046cc5a7ba6f25363dd) ) // 14.bin
+ ROM_LOAD( "ts_23.18j", 0x30000, 0x8000, CRC(bbfbe58a) SHA1(9b1d5672b6f3c5c0952f8dcd0da71acc68a97a5e) ) // 17.bin
+ ROM_LOAD( "ts_24.18k", 0x38000, 0x8000, CRC(f156e564) SHA1(a6cad05bcc6d9ded6294f9b5aa856d05641aed02) ) // 18.bin
+
+ ROM_REGION( 0x40000, "gfx4", 0 )
+ ROM_LOAD( "07.bin", 0x00000, 0x10000, CRC(a0e78996) SHA1(810a54e657c0faaff6a8494acaf803d1d2151893) )
+ ROM_LOAD( "11.bin", 0x10000, 0x10000, CRC(37cb11c2) SHA1(af8c2ae4bb6e6c13ea3e8b7c96e5b18f1eb1d5a5) )
+ ROM_LOAD( "15.bin", 0x20000, 0x10000, CRC(4e0354ce) SHA1(d3256c891b44c6593b0b44c0d0a3e754ce78c1cb) )
+ ROM_LOAD( "16.bin", 0x30000, 0x10000, CRC(ac89e5cc) SHA1(aa7e065ece6d25b7e83fadcd22c09e1f7dc0b86f) )
+
+ ROM_REGION( 0x0100, "proms", 0 )
+ ROM_LOAD( "63s141.18f", 0x0000, 0x0100, CRC(b58d0023) SHA1(e8a4a2e2951bf73b3d9eed6957e9ee1e61c9c58a) ) /* priority (not used), Labeled "TSB" */
+ROM_END
+
+
/*************************************
*
@@ -578,4 +619,6 @@ GAME( 1987, bionicc, 0, bionicc, bionicc, driver_device, 0, ROT0, "Capcom
GAME( 1987, bionicc1, bionicc, bionicc, bionicc, driver_device, 0, ROT0, "Capcom", "Bionic Commando (US set 1)", GAME_SUPPORTS_SAVE )
GAME( 1987, bionicc2, bionicc, bionicc, bionicc, driver_device, 0, ROT0, "Capcom", "Bionic Commando (US set 2)", GAME_SUPPORTS_SAVE )
GAME( 1987, topsecrt, bionicc, bionicc, bionicc, driver_device, 0, ROT0, "Capcom", "Top Secret (Japan, old revision)", GAME_SUPPORTS_SAVE )
+GAME( 1987, bioniccbl,bionicc, bionicc, bionicc, driver_device, 0, ROT0, "bootleg", "Bionic Commandos (bootleg)", GAME_SUPPORTS_SAVE )
+
// there's also an undumped JP new revision on which there are no extra lives after 1 million points, plus other bug-fixes / changes
diff --git a/src/mame/drivers/bmcpokr.c b/src/mame/drivers/bmcpokr.c
index 3d5da67ab7b..386e52bafc5 100644
--- a/src/mame/drivers/bmcpokr.c
+++ b/src/mame/drivers/bmcpokr.c
@@ -1,52 +1,25 @@
// license:BSD-3-Clause
// copyright-holders:Luca Elia
-/************************************************************************************************************
+/***************************************************************************
-Dongfang Shenlong ("Eastern Dragon")
-BMC 1999
+BMC games using a 68k + VDB40817/SYA70521
driver by Luca Elia
-Similar to bmcbowl, koftball, popobear
-PCB Layout
-----------
+Similar to bmcbowl, koftball, popobear
-BMC-A81212
-|---------------------------------------|
-| CH-A-401 CH-M-301 CH-M-701 |
-|M11B416256A UM3567 |
-|42MHz CH-M-201 CH-M-101 M6295 |
-| VDB40817 1|
-| HM86171-80 VOL 0|
-| SYA70521 W|
-| LM324 7805 A|
-|DSW1 Y|
-| 68000 TDA2003 |
-|DSW2 CH-M-505 CH-M-605 |
-| 6264 6264 2|
-|DSW3 CPLD 74HC132 74LS05 2|
-| 555 W|
-|DSW4 A|
-| BATT SW JAMMA Y|
-|---------------------------------------|
-Notes:
- RAM - M11B416256, 6264(x2)
- VDB40817/SYA70521 - Unknown QFP100
- CPLD - unknown PLCC44 chip labelled 'BMC B816140'
- BATT - 5.5 volt 0.047F super cap
- 68000 @10.50MHz (42/4)
- M6295 @1.05MHz (42/40)
- UM3567 @3.50MHz (42/12)
- HSync - 15.440kHz
- VSync - 58.935Hz
+CPU: 68000
+Video: BMC VDB40817 + BMC SYA70521
+Sound: M6295 + UM3567
+Other: BMC B816140 (CPLD)
-************************************************************************************************************/
+***************************************************************************/
#include "emu.h"
#include "cpu/m68000/m68000.h"
+#include "video/ramdac.h"
#include "sound/2413intf.h"
#include "sound/okim6295.h"
-#include "video/ramdac.h"
#include "machine/nvram.h"
#include "machine/ticket.h"
@@ -69,6 +42,7 @@ public:
m_palette(*this, "palette")
{ }
+ // Devices
required_device<cpu_device> m_maincpu;
required_device<ticket_dispenser_device> m_hopper;
required_shared_ptr<UINT16> m_videoram_1;
@@ -82,27 +56,34 @@ public:
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
- tilemap_t *m_tilemap_1;
- tilemap_t *m_tilemap_2;
- TILE_GET_INFO_MEMBER(get_t1_tile_info);
- TILE_GET_INFO_MEMBER(get_t2_tile_info);
- TILE_GET_INFO_MEMBER(get_t3_tile_info);
- DECLARE_WRITE16_MEMBER(videoram_1_w);
- DECLARE_WRITE16_MEMBER(videoram_2_w);
-
+ // Protection
UINT16 m_prot_val;
DECLARE_READ16_MEMBER(prot_r);
DECLARE_WRITE16_MEMBER(prot_w);
DECLARE_READ16_MEMBER(unk_r);
+ // I/O
UINT16 m_mux;
DECLARE_WRITE16_MEMBER(mux_w);
DECLARE_READ16_MEMBER(dsw_r);
DECLARE_CUSTOM_INPUT_MEMBER(hopper_r);
+ DECLARE_READ16_MEMBER(mjmaglmp_dsw_r);
+ DECLARE_READ16_MEMBER(mjmaglmp_key_r);
+ // Interrrupts
UINT16 m_irq_enable;
DECLARE_WRITE16_MEMBER(irq_enable_w);
DECLARE_WRITE16_MEMBER(irq_ack_w);
+ TIMER_DEVICE_CALLBACK_MEMBER(interrupt);
+
+ // Video
+ tilemap_t *m_tilemap_1;
+ tilemap_t *m_tilemap_2;
+ TILE_GET_INFO_MEMBER(get_t1_tile_info);
+ TILE_GET_INFO_MEMBER(get_t2_tile_info);
+ TILE_GET_INFO_MEMBER(get_t3_tile_info);
+ DECLARE_WRITE16_MEMBER(videoram_1_w);
+ DECLARE_WRITE16_MEMBER(videoram_2_w);
bitmap_ind16 *m_pixbitmap;
void pixbitmap_redraw();
@@ -114,8 +95,6 @@ public:
void draw_layer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer);
UINT32 screen_update_bmcpokr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- TIMER_DEVICE_CALLBACK_MEMBER(interrupt);
-
void save_state()
{
save_item(NAME(m_prot_val));
@@ -439,6 +418,74 @@ static ADDRESS_MAP_START( bmcpokr_mem, AS_PROGRAM, 16, bmcpokr_state )
AM_RANGE(0x3b0000, 0x3b0001) AM_READ_PORT("INPUTS2")
ADDRESS_MAP_END
+
+READ16_MEMBER(bmcpokr_state::mjmaglmp_dsw_r)
+{
+ switch ((m_mux >> 4) & 7)
+ {
+ case 7: return ioport("DSW1")->read() << 8;
+ case 6: return ioport("DSW2")->read() << 8;
+ case 5: return ioport("DSW3")->read() << 8;
+ case 3: return ioport("DSW4")->read() << 8;
+ }
+ return 0xff << 8;
+}
+
+READ16_MEMBER(bmcpokr_state::mjmaglmp_key_r)
+{
+ UINT16 key = 0x3f;
+ switch ((m_mux >> 4) & 7)
+ {
+ case 0: key = ioport("KEY1")->read(); break;
+ case 1: key = ioport("KEY2")->read(); break;
+ case 2: key = ioport("KEY3")->read(); break;
+ case 3: key = ioport("KEY4")->read(); break;
+ case 4: key = ioport("KEY5")->read(); break;
+ }
+ return ioport("INPUTS")->read() | (key & 0x3f);
+}
+
+static ADDRESS_MAP_START( mjmaglmp_map, AS_PROGRAM, 16, bmcpokr_state )
+ AM_RANGE(0x000000, 0x03ffff) AM_ROM
+ AM_RANGE(0x210000, 0x21ffff) AM_RAM AM_SHARE("nvram")
+
+ AM_RANGE(0x280000, 0x287fff) AM_RAM_WRITE(videoram_1_w) AM_SHARE("videoram_1")
+ AM_RANGE(0x288000, 0x28ffff) AM_RAM_WRITE(videoram_2_w) AM_SHARE("videoram_2")
+ AM_RANGE(0x290000, 0x297fff) AM_RAM
+
+ AM_RANGE(0x2a0000, 0x2dffff) AM_RAM_WRITE(pixram_w) AM_SHARE("pixram")
+
+ AM_RANGE(0x2ff800, 0x2ff9ff) AM_RAM AM_SHARE("scrollram_1")
+ AM_RANGE(0x2ffa00, 0x2ffbff) AM_RAM AM_SHARE("scrollram_2")
+ AM_RANGE(0x2ffc00, 0x2ffdff) AM_RAM AM_SHARE("scrollram_3")
+ AM_RANGE(0x2ffe00, 0x2fffff) AM_RAM
+
+ AM_RANGE(0x320000, 0x320003) AM_RAM AM_SHARE("layerctrl")
+
+ AM_RANGE(0x388000, 0x388001) AM_WRITE(mux_w)
+
+ AM_RANGE(0x390000, 0x390001) AM_READ(mjmaglmp_dsw_r)
+
+ AM_RANGE(0x398000, 0x398001) AM_READ(mjmaglmp_key_r)
+
+ AM_RANGE(0x3c8800, 0x3c8803) AM_DEVWRITE8("ymsnd", ym2413_device, write, 0x00ff)
+ AM_RANGE(0x3c9000, 0x3c9001) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff)
+
+ AM_RANGE(0x3c9800, 0x3c9801) AM_DEVWRITE8("ramdac",ramdac_device, index_w, 0x00ff )
+ AM_RANGE(0x3c9802, 0x3c9803) AM_DEVWRITE8("ramdac",ramdac_device, pal_w, 0x00ff )
+ AM_RANGE(0x3c9804, 0x3c9805) AM_DEVWRITE8("ramdac",ramdac_device, mask_w, 0x00ff )
+
+ AM_RANGE(0x3ca000, 0x3ca001) AM_RAM // 3ca001.b, rw
+ AM_RANGE(0x3ca002, 0x3ca003) AM_RAM // 3ca003.b, w(9d)
+ AM_RANGE(0x3ca006, 0x3ca007) AM_WRITE(irq_ack_w)
+ AM_RANGE(0x3ca008, 0x3ca009) AM_WRITE(irq_enable_w)
+ AM_RANGE(0x3ca00e, 0x3ca00f) AM_RAM AM_SHARE("priority") // 3ca00f.b, w (priority?)
+ AM_RANGE(0x3ca016, 0x3ca017) AM_WRITE(pixpal_w)
+ AM_RANGE(0x3ca018, 0x3ca019) AM_RAM // 3ca019.b, w
+ AM_RANGE(0x3ca01a, 0x3ca01b) AM_READ(unk_r) AM_WRITENOP
+ AM_RANGE(0x3ca01c, 0x3ca01d) AM_RAM // 3ca01d.b, w(0)
+ADDRESS_MAP_END
+
/***************************************************************************
Input Ports
***************************************************************************/
@@ -562,6 +609,154 @@ static INPUT_PORTS_START( bmcpokr )
PORT_DIPSETTING( 0x00, DEF_STR( Joystick ) )
INPUT_PORTS_END
+static INPUT_PORTS_START( mjmaglmp )
+ PORT_START("INPUTS")
+ // Joystick controls:
+ PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1 ) PORT_CONDITION("DSW2",0x01,EQUALS,0x00) // START
+ PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_CONDITION("DSW2",0x01,EQUALS,0x00) // UP
+ PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_CONDITION("DSW2",0x01,EQUALS,0x00) // DOWN
+ PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_CONDITION("DSW2",0x01,EQUALS,0x00) // LEFT
+ PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_CONDITION("DSW2",0x01,EQUALS,0x00) // RIGHT
+ PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CONDITION("DSW2",0x01,EQUALS,0x00) // 1P E1 (select)
+
+ PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_COIN2 ) // NOTE
+ PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) // KEY DOWN
+ PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Pay Out") PORT_CODE(KEYCODE_O) // PAY
+ PORT_BIT( 0x0200, IP_ACTIVE_HIGH,IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, bmcpokr_state,hopper_r, NULL) // HOPPER
+ PORT_SERVICE_NO_TOGGLE( 0x0400, IP_ACTIVE_LOW ) // ACCOUNT
+ PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Reset") // RESET
+ PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // (unused)
+ PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_CONDITION("DSW2",0x01,EQUALS,0x00) // 1P E2 (bet)
+ PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_CONDITION("DSW2",0x01,EQUALS,0x00) // 1P E3 (select)
+ PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_COIN1 ) // COIN
+
+ PORT_START("KEY1")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_M ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
+
+ PORT_START("KEY2")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_B ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_F ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_J ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_N ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_REACH ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_BET ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
+
+ PORT_START("KEY3")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_C ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_G ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_K ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_CHI ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_RON ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
+
+ PORT_START("KEY4")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_D ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_H ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_L ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_PON ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
+
+ PORT_START("KEY5")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_BIG ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL ) PORT_CONDITION("DSW2",0x01,EQUALS,0x01)
+
+ PORT_START("DSW1")
+ PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("DIP1:1")
+ PORT_DIPSETTING( 0x00, DEF_STR( Yes ) )
+ PORT_DIPSETTING( 0x01, DEF_STR( No ) )
+ PORT_DIPNAME( 0x02, 0x00, "Doube-Up Game" ) PORT_DIPLOCATION("DIP1:2")
+ PORT_DIPSETTING( 0x00, DEF_STR( Yes ) )
+ PORT_DIPSETTING( 0x02, DEF_STR( No ) )
+ PORT_DIPNAME( 0x04, 0x04, "Coin Sw. Function" ) PORT_DIPLOCATION("DIP1:3")
+ PORT_DIPSETTING( 0x00, "Coin" )
+ PORT_DIPSETTING( 0x04, "Note" )
+ PORT_DIPNAME( 0x08, 0x08, "Pay Sw. Function" ) PORT_DIPLOCATION("DIP1:4")
+ PORT_DIPSETTING( 0x00, "Pay-Out" )
+ PORT_DIPSETTING( 0x08, "Key-Down" )
+ PORT_DIPNAME( 0x10, 0x10, "Game Hint" ) PORT_DIPLOCATION("DIP1:5")
+ PORT_DIPSETTING( 0x00, DEF_STR( Yes ) )
+ PORT_DIPSETTING( 0x10, DEF_STR( No ) )
+ PORT_DIPNAME( 0x20, 0x20, "Direct Double" ) PORT_DIPLOCATION("DIP1:6")
+ PORT_DIPSETTING( 0x00, DEF_STR( Yes ) )
+ PORT_DIPSETTING( 0x20, DEF_STR( No ) )
+ PORT_DIPNAME( 0x40, 0x40, "Coin Acceptor" ) PORT_DIPLOCATION("DIP1:7")
+ PORT_DIPSETTING( 0x00, "Mechanical" )
+ PORT_DIPSETTING( 0x40, "Electronic" )
+ PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "DIP1:8" )
+
+ PORT_START("DSW2")
+ PORT_DIPNAME( 0x01, 0x01, DEF_STR( Controls ) ) PORT_DIPLOCATION("DIP2:1")
+ PORT_DIPSETTING( 0x01, "Keyboard" )
+ PORT_DIPSETTING( 0x00, DEF_STR( Joystick ) )
+ PORT_DIPNAME( 0x02, 0x02, "Key-In Limit" ) PORT_DIPLOCATION("DIP2:2")
+ PORT_DIPSETTING( 0x00, "1000" )
+ PORT_DIPSETTING( 0x02, "5000" )
+ PORT_DIPNAME( 0x04, 0x04, "Double Lose Pool" ) PORT_DIPLOCATION("DIP2:3")
+ PORT_DIPSETTING( 0x00, "50" )
+ PORT_DIPSETTING( 0x04, "100" )
+ PORT_DIPNAME( 0x18, 0x18, "Double Over / Round Bonus" ) PORT_DIPLOCATION("DIP2:4,5")
+ PORT_DIPSETTING( 0x10, "100 / 10" )
+ PORT_DIPSETTING( 0x18, "200 / 10" )
+ PORT_DIPSETTING( 0x08, "300 / 15" )
+ PORT_DIPSETTING( 0x00, "500 / 25" )
+ PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "DIP2:6" )
+ PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "DIP2:7" )
+ PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "DIP2:8" )
+
+ PORT_START("DSW3")
+ PORT_DIPNAME( 0x03, 0x03, "Pay-Out Rate" ) PORT_DIPLOCATION("DIP3:1,2")
+ PORT_DIPSETTING( 0x02, "75" )
+ PORT_DIPSETTING( 0x01, "82" )
+ PORT_DIPSETTING( 0x03, "85" )
+ PORT_DIPSETTING( 0x00, "88" )
+ PORT_DIPNAME( 0x0c, 0x0c, "Double-Up Rate" ) PORT_DIPLOCATION("DIP3:3,4")
+ PORT_DIPSETTING( 0x08, "95" )
+ PORT_DIPSETTING( 0x04, "96" )
+ PORT_DIPSETTING( 0x00, "97" )
+ PORT_DIPSETTING( 0x0c, "98" )
+ PORT_DIPNAME( 0x30, 0x30, "Game Enhance Type" ) PORT_DIPLOCATION("DIP3:5,6")
+ PORT_DIPSETTING( 0x10, "Small" )
+ PORT_DIPSETTING( 0x00, "Big" )
+ PORT_DIPSETTING( 0x30, "Normal" )
+ PORT_DIPSETTING( 0x20, "Bonus" )
+ PORT_DIPNAME( 0xc0, 0xc0, "Credit Limit" ) PORT_DIPLOCATION("DIP3:7,8")
+ PORT_DIPSETTING( 0x00, "300" )
+ PORT_DIPSETTING( 0x80, "500" )
+ PORT_DIPSETTING( 0x40, "1000" )
+ PORT_DIPSETTING( 0xc0, "2000" )
+
+ PORT_START("DSW4")
+ PORT_DIPNAME( 0x01, 0x01, "Max Bet" ) PORT_DIPLOCATION("DIP4:1")
+ PORT_DIPSETTING( 0x01, "10" )
+ PORT_DIPSETTING( 0x00, "20" )
+ PORT_DIPNAME( 0x06, 0x06, "Min Bet" ) PORT_DIPLOCATION("DIP4:2,3")
+ PORT_DIPSETTING( 0x00, "1" )
+ PORT_DIPSETTING( 0x06, "3" )
+ PORT_DIPSETTING( 0x04, "6" )
+ PORT_DIPSETTING( 0x02, "9" )
+ PORT_DIPNAME( 0x18, 0x18, DEF_STR( Coinage ) ) PORT_DIPLOCATION("DIP4:4,5")
+ PORT_DIPSETTING( 0x00, DEF_STR( 2C_1C ) )
+ PORT_DIPSETTING( 0x18, DEF_STR( 1C_1C ) )
+ PORT_DIPSETTING( 0x10, DEF_STR( 1C_2C ) )
+ PORT_DIPSETTING( 0x08, DEF_STR( 1C_3C ) )
+ PORT_DIPNAME( 0x60, 0x60, "Credits Per Key-In" ) PORT_DIPLOCATION("DIP4:6,7")
+ PORT_DIPSETTING( 0x40, "5" )
+ PORT_DIPSETTING( 0x60, "10" )
+ PORT_DIPSETTING( 0x20, "50" )
+ PORT_DIPSETTING( 0x00, "100" )
+ PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "DIP4:8" )
+INPUT_PORTS_END
+
/***************************************************************************
Graphics Layout
***************************************************************************/
@@ -636,10 +831,54 @@ static MACHINE_CONFIG_START( bmcpokr, bmcpokr_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50)
MACHINE_CONFIG_END
+static MACHINE_CONFIG_DERIVED( mjmaglmp, bmcpokr )
+ MCFG_CPU_MODIFY("maincpu")
+ MCFG_CPU_PROGRAM_MAP(mjmaglmp_map)
+MACHINE_CONFIG_END
+
/***************************************************************************
ROMs Loading
***************************************************************************/
+/***************************************************************************
+
+Dongfang Shenlong ("Eastern Dragon")
+BMC 1999
+
+PCB Layout
+----------
+
+BMC-A81212
+|---------------------------------------|
+| CH-A-401 CH-M-301 CH-M-701 |
+|M11B416256A UM3567 |
+|42MHz CH-M-201 CH-M-101 M6295 |
+| VDB40817 1|
+| HM86171-80 VOL 0|
+| SYA70521 W|
+| LM324 7805 A|
+|DSW1 Y|
+| 68000 TDA2003 |
+|DSW2 CH-M-505 CH-M-605 |
+| 6264 6264 2|
+|DSW3 CPLD 74HC132 74LS05 2|
+| 555 W|
+|DSW4 A|
+| BATT SW JAMMA Y|
+|---------------------------------------|
+Notes:
+ RAM - M11B416256, 6264(x2)
+ VDB40817/SYA70521 - Unknown QFP100
+ CPLD - unknown PLCC44 chip labelled 'BMC B816140'
+ BATT - 5.5 volt 0.047F super cap
+ 68000 @10.50MHz (42/4)
+ M6295 @1.05MHz (42/40)
+ UM3567 @3.50MHz (42/12)
+ HSync - 15.440kHz
+ VSync - 58.935Hz
+
+***************************************************************************/
+
ROM_START( bmcpokr )
ROM_REGION( 0x40000, "maincpu", 0 ) /* 68000 Code */
ROM_LOAD16_BYTE( "ch-m-605.u13", 0x000000, 0x20000, CRC(c5c3fcd1) SHA1(b77fef734c290d52ae877a24bb3ee42b24eb5cb8) )
@@ -655,4 +894,59 @@ ROM_START( bmcpokr )
ROM_LOAD( "ch-m-701.u10", 0x00000, 0x40000, CRC(e01be644) SHA1(b68682786d5b40cb5672cfd7f717adcfb8fac7d3) )
ROM_END
-GAME( 1999, bmcpokr, 0, bmcpokr, bmcpokr, driver_device, 0, ROT0, "BMC", "Dongfang Shenlong", GAME_SUPPORTS_SAVE )
+/***************************************************************************
+
+Mahjong Magic Lamp (BMC, 2000)
+
+PCB Layout
+----------
+
+BMC-A70809
+ |--------------------------------------|
+|-| 6116 555 |
+| 0.1UF JA-A-602 JA-A-502 |
+| 68000 |
+| TD62003 42MHz |
+| PAL |
+| PAL 51C4160 |
+| SYA70521 |
+|-| U3567 |
+ | |
+ | HM86171 VDB40817 |
+|-| VOL DSW4 |
+| 7805 6295 DSW3 |
+| AMP JA-A-301 JA-A-401 DSW2 |
+|-| JA-A-901 JA-A-201 JA-A-101 DSW1 |
+ |--------------------------------------|
+Notes:
+ 68000 - clock 10.5000MHz [42/4]
+ M6295 - clock 1.0500MHz [42/40]. Pin 7 HIGH
+ U3567 - = YM2413, clock 3.5000MHz [42/12]
+ HM86171 - HMC RAMDAC. Clock input 10.5000MHz [42/4]
+ VDB/SYA - custom QFP100 GFX chips badged with BMC logo
+ 51C4160 - SOJ40 video RAM, possibly 4M DRAM (256k x 16-bit)
+ 555 - 555 Timer
+ DSW1-4 - 8-position DIP switches
+ AMP - NEC uPC1241H
+ VSync - 58.9342Hz
+ HSync - 15.4408kHz
+
+***************************************************************************/
+
+ROM_START( mjmaglmp )
+ ROM_REGION( 0x40000, "maincpu", 0 ) /* 68000 Code */
+ ROM_LOAD16_BYTE( "ja-a-602.u10", 0x000000, 0x20000, CRC(b69e235c) SHA1(04e5d0d667de29680e4a35d0d98b587447e54ce3) )
+ ROM_LOAD16_BYTE( "ja-a-502.u11", 0x000001, 0x20000, CRC(bb609da3) SHA1(ffadc20912e0a9ebe0d1a1f7f94dfaccb48be5c1) )
+
+ ROM_REGION( 0x200000, "gfx1", 0 )
+ ROM_LOAD16_BYTE( "ja-a-101.u41", 0x000000, 0x80000, CRC(7878b9a1) SHA1(7efacb063b47e518c4d3856e90d7532f478e54dd) )
+ ROM_LOAD16_BYTE( "ja-a-201.u42", 0x000001, 0x80000, CRC(b74f3b2b) SHA1(09724909a14aebc135029d97fafcd215a84f05e3) )
+ ROM_LOAD16_BYTE( "ja-a-301.u43", 0x100000, 0x80000, CRC(2bbaf65e) SHA1(d792054671671a2e479b89ad29bc7b3f935804f9) )
+ ROM_LOAD16_BYTE( "ja-a-401.u44", 0x100001, 0x80000, CRC(9292acb1) SHA1(01ce7997305dd5fdc5dc2b801046303a4d8a89c0) )
+
+ ROM_REGION( 0x40000, "oki", 0 ) /* Samples */
+ ROM_LOAD( "ja-a-901.u6", 0x00000, 0x40000, CRC(25f36d00) SHA1(c182348340ca67ad69d1a67c58b47d6371a725c9) )
+ROM_END
+
+GAME( 1999, bmcpokr, 0, bmcpokr, bmcpokr, driver_device, 0, ROT0, "BMC", "Dongfang Shenlong", GAME_SUPPORTS_SAVE )
+GAME( 2000, mjmaglmp, 0, mjmaglmp, mjmaglmp, driver_device, 0, ROT0, "BMC", "Mahjong Magic Lamp (v. JAA02)", GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/boogwing.c b/src/mame/drivers/boogwing.c
index 10f314ec6af..4a0ecabbf5b 100644
--- a/src/mame/drivers/boogwing.c
+++ b/src/mame/drivers/boogwing.c
@@ -143,6 +143,9 @@ static ADDRESS_MAP_START( boogwing_map, AS_PROGRAM, 16, boogwing_state )
AM_RANGE(0x3c0000, 0x3c004f) AM_RAM // ?
ADDRESS_MAP_END
+static ADDRESS_MAP_START( decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 16, boogwing_state )
+ AM_RANGE(0x000000, 0x0fffff) AM_ROM AM_SHARE("decrypted_opcodes")
+ADDRESS_MAP_END
static ADDRESS_MAP_START( audio_map, AS_PROGRAM, 8, boogwing_state )
AM_RANGE(0x000000, 0x00ffff) AM_ROM
@@ -317,6 +320,7 @@ static MACHINE_CONFIG_START( boogwing, boogwing_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 14000000) /* DE102 */
MCFG_CPU_PROGRAM_MAP(boogwing_map)
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", boogwing_state, irq6_line_hold)
MCFG_CPU_ADD("audiocpu", H6280, 32220000/4)
@@ -635,7 +639,7 @@ DRIVER_INIT_MEMBER(boogwing_state,boogwing)
deco56_decrypt_gfx(machine(), "tiles2");
deco56_decrypt_gfx(machine(), "tiles3");
deco56_remap_gfx(machine(), "gfx6");
- deco102_decrypt_cpu(machine(), "maincpu", 0x42ba, 0x00, 0x18);
+ deco102_decrypt_cpu((UINT16 *)memregion("maincpu")->base(), m_decrypted_opcodes, 0x100000, 0x42ba, 0x00, 0x18);
memcpy(dst, src, 0x100000);
}
diff --git a/src/mame/drivers/bublbobl.c b/src/mame/drivers/bublbobl.c
index 1683613309b..065ca46b23f 100644
--- a/src/mame/drivers/bublbobl.c
+++ b/src/mame/drivers/bublbobl.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Chris Moore, Nicola Salmoria
/***************************************************************************
diff --git a/src/mame/drivers/cabal.c b/src/mame/drivers/cabal.c
index 1ae39175190..026b621144b 100644
--- a/src/mame/drivers/cabal.c
+++ b/src/mame/drivers/cabal.c
@@ -197,7 +197,7 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, cabal_state )
AM_RANGE(0x401b, 0x401b) AM_DEVWRITE("seibu_sound", seibu_sound_device, coin_w)
AM_RANGE(0x6005, 0x6006) AM_DEVWRITE("adpcm2", seibu_adpcm_device, adr_w)
AM_RANGE(0x601a, 0x601a) AM_DEVWRITE("adpcm2", seibu_adpcm_device, ctl_w)
- AM_RANGE(0x8000, 0xffff) AM_ROM
+ AM_RANGE(0x8000, 0xffff) AM_ROMBANK("seibu_bank1")
ADDRESS_MAP_END
static ADDRESS_MAP_START( cabalbl_sound_map, AS_PROGRAM, 8, cabal_state )
@@ -468,7 +468,7 @@ static GFXDECODE_START( cabal )
GFXDECODE_END
-static MACHINE_CONFIG_START( cabal, cabal_state )
+static MACHINE_CONFIG_START( cabal_base, cabal_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, XTAL_20MHz/2) /* verified on pcb */
@@ -511,6 +511,14 @@ static MACHINE_CONFIG_START( cabal, cabal_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS,"mono", 0.40)
MACHINE_CONFIG_END
+static MACHINE_CONFIG_DERIVED( cabal, cabal_base )
+ SEIBU_SOUND_SYSTEM_ENCRYPTED_LOW()
+MACHINE_CONFIG_END
+
+static MACHINE_CONFIG_DERIVED( cabalbl2, cabal_base )
+ SEIBU_SOUND_SYSTEM_ENCRYPTED_CUSTOM()
+MACHINE_CONFIG_END
+
/* the bootleg has different sound hardware (2 extra Z80s for ADPCM playback) */
static MACHINE_CONFIG_START( cabalbl, cabal_state )
@@ -787,7 +795,7 @@ ROM_END
// based on stickers present on the board it appears to have been manufactured by 'TAB-Austria' and is marked 'CA02'
ROM_START( cabalbl2 )
- ROM_REGION( 0x50000, "maincpu", 0 ) /* 64k for cpu code */
+ ROM_REGION( 0x40000, "maincpu", 0 ) /* 64k for cpu code */
ROM_LOAD16_BYTE( "c9.bin", 0x00000, 0x10000, CRC(00abbe0c) SHA1(bacf17444abfb4f56248ff56e37b0aa2b1a3800d) )
ROM_LOAD16_BYTE( "c7.bin", 0x00001, 0x10000, CRC(44736281) SHA1(1d6da95ef96d9c02aea70791e1cb87b70097d5ed) )
ROM_LOAD16_BYTE( "c8.bin", 0x20000, 0x10000, CRC(d763a47c) SHA1(146d8082a404b6eddaf2dc9ba41a997949c17f8a) )
@@ -831,33 +839,17 @@ ROM_START( cabalbl2 )
ROM_END
-
-void cabal_state::seibu_sound_bootleg(const char *cpu,int length)
-{
- address_space &space = machine().device(cpu)->memory().space(AS_PROGRAM);
- UINT8 *decrypt = auto_alloc_array(machine(), UINT8, length);
- UINT8 *rom = memregion(cpu)->base();
-
- space.set_decrypted_region(0x0000, (length < 0x10000) ? (length - 1) : 0x1fff, decrypt);
-
- memcpy(decrypt, rom+length, length);
-
- if (length > 0x10000)
- membank("bank1")->configure_decrypted_entries(0, (length - 0x10000) / 0x8000, decrypt + 0x10000, 0x8000);
-}
-
-
-
DRIVER_INIT_MEMBER(cabal_state,cabal)
{
- m_seibu_sound->decrypt("audiocpu",0x2000);
m_adpcm1->decrypt("adpcm1");
m_adpcm2->decrypt("adpcm2");
}
DRIVER_INIT_MEMBER(cabal_state,cabalbl2)
{
- seibu_sound_bootleg("audiocpu",0x2000);
+ UINT8 *decrypt = m_seibu_sound->get_custom_decrypt();
+ memcpy(decrypt, memregion("audiocpu")->base()+0x2000, 0x2000);
+ memcpy(decrypt+0x8000, memregion("audiocpu")->base()+0x8000, 0x8000);
m_adpcm1->decrypt("adpcm1");
m_adpcm2->decrypt("adpcm2");
}
@@ -866,7 +858,7 @@ DRIVER_INIT_MEMBER(cabal_state,cabalbl2)
GAME( 1988, cabal, 0, cabal, cabalj, cabal_state, cabal, ROT0, "TAD Corporation", "Cabal (World, Joystick version)", GAME_SUPPORTS_SAVE )
GAME( 1989, cabala, cabal, cabal, cabalj, cabal_state, cabal, ROT0, "TAD Corporation (Alpha Trading license)", "Cabal (Alpha Trading)", GAME_SUPPORTS_SAVE ) // korea?
GAME( 1988, cabalbl, cabal, cabalbl, cabalbl, driver_device, 0, ROT0, "bootleg (Red Corporation)", "Cabal (bootleg of Joystick version, set 1, alternate sound hardware)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
-GAME( 1988, cabalbl2,cabal, cabal, cabalj, cabal_state, cabalbl2,ROT0, "bootleg", "Cabal (bootleg of Joystick version, set 2)", GAME_SUPPORTS_SAVE )
+GAME( 1988, cabalbl2,cabal, cabalbl2,cabalj, cabal_state, cabalbl2,ROT0, "bootleg", "Cabal (bootleg of Joystick version, set 2)", GAME_SUPPORTS_SAVE )
GAME( 1988, cabalus, cabal, cabal, cabalt, cabal_state, cabal, ROT0, "TAD Corporation (Fabtek license)", "Cabal (US set 1, Trackball version)", GAME_SUPPORTS_SAVE )
GAME( 1988, cabalus2,cabal, cabal, cabalt, cabal_state, cabal, ROT0, "TAD Corporation (Fabtek license)", "Cabal (US set 2, Trackball version)", GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/calorie.c b/src/mame/drivers/calorie.c
index effedfd8a5f..a5921c03dd8 100644
--- a/src/mame/drivers/calorie.c
+++ b/src/mame/drivers/calorie.c
@@ -94,7 +94,8 @@ public:
m_sprites(*this, "sprites"),
m_maincpu(*this, "maincpu"),
m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_decrypted_opcodes(*this, "decrypted_opcodes") { }
/* memory pointers */
required_shared_ptr<UINT8> m_fg_ram;
@@ -121,6 +122,7 @@ public:
required_device<cpu_device> m_maincpu;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
+ optional_shared_ptr<UINT8> m_decrypted_opcodes;
};
@@ -256,7 +258,7 @@ WRITE8_MEMBER(calorie_state::bogus_w)
static ADDRESS_MAP_START( calorie_map, AS_PROGRAM, 8, calorie_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0x8000, 0xbfff) AM_ROM
- AM_RANGE(0xc000, 0xcfff) AM_RAM
+ AM_RANGE(0xc000, 0xcfff) AM_RAM AM_SHARE("ram")
AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(fg_ram_w) AM_SHARE("fg_ram")
AM_RANGE(0xd800, 0xdbff) AM_RAM AM_SHARE("sprites")
AM_RANGE(0xdc00, 0xdcff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
@@ -269,6 +271,11 @@ static ADDRESS_MAP_START( calorie_map, AS_PROGRAM, 8, calorie_state )
AM_RANGE(0xf800, 0xf800) AM_WRITE(soundlatch_byte_w)
ADDRESS_MAP_END
+static ADDRESS_MAP_START( decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 8, calorie_state )
+ AM_RANGE(0x0000, 0x7fff) AM_ROM AM_SHARE("decrypted_opcodes")
+ AM_RANGE(0x8000, 0xbfff) AM_ROM
+ AM_RANGE(0xc000, 0xcfff) AM_RAM AM_SHARE("ram")
+ADDRESS_MAP_END
static ADDRESS_MAP_START( calorie_sound_map, AS_PROGRAM, 8, calorie_state )
AM_RANGE(0x0000, 0x3fff) AM_ROM
@@ -447,6 +454,7 @@ static MACHINE_CONFIG_START( calorie, calorie_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z80,4000000) /* 4 MHz */
MCFG_CPU_PROGRAM_MAP(calorie_map)
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", calorie_state, irq0_line_hold)
MCFG_CPU_ADD("audiocpu", Z80,3000000) /* 3 MHz */
@@ -555,13 +563,13 @@ ROM_END
DRIVER_INIT_MEMBER(calorie_state,calorie)
{
- sega_317_0004_decode(machine(), "maincpu");
+ // 317-0004
+ sega_decode_317(memregion("maincpu")->base(), m_decrypted_opcodes, 0);
}
DRIVER_INIT_MEMBER(calorie_state,calorieb)
{
- address_space &space = m_maincpu->space(AS_PROGRAM);
- space.set_decrypted_region(0x0000, 0x7fff, memregion("maincpu")->base() + 0x10000);
+ memcpy(m_decrypted_opcodes, memregion("maincpu")->base() + 0x10000, 0x8000);
}
diff --git a/src/mame/drivers/cbasebal.c b/src/mame/drivers/cbasebal.c
index d3b7bd38cb1..098fe4c35c2 100644
--- a/src/mame/drivers/cbasebal.c
+++ b/src/mame/drivers/cbasebal.c
@@ -34,6 +34,7 @@ WRITE8_MEMBER(cbasebal_state::cbasebal_bankswitch_w)
/* bits 0-4 select ROM bank */
//logerror("%04x: bankswitch %02x\n", space.device().safe_pc(), data);
membank("bank1")->set_entry(data & 0x1f);
+ membank("bank1d")->set_entry(data & 0x1f);
/* bit 5 used but unknown */
@@ -98,6 +99,11 @@ static ADDRESS_MAP_START( cbasebal_map, AS_PROGRAM, 8, cbasebal_state )
AM_RANGE(0xfe00, 0xffff) AM_RAM AM_SHARE("spriteram")
ADDRESS_MAP_END
+static ADDRESS_MAP_START( decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 8, cbasebal_state )
+ AM_RANGE(0x0000, 0x7fff) AM_ROMBANK("bank0d")
+ AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1d")
+ADDRESS_MAP_END
+
static ADDRESS_MAP_START( cbasebal_portmap, AS_IO, 8, cbasebal_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x00) AM_WRITE(cbasebal_bankswitch_w)
@@ -223,8 +229,6 @@ GFXDECODE_END
void cbasebal_state::machine_start()
{
- membank("bank1")->configure_entries(0, 32, memregion("maincpu")->base() + 0x10000, 0x4000);
-
save_item(NAME(m_rambank));
save_item(NAME(m_tilebank));
save_item(NAME(m_spritebank));
@@ -257,6 +261,7 @@ static MACHINE_CONFIG_START( cbasebal, cbasebal_state )
MCFG_CPU_ADD("maincpu", Z80, 6000000) /* ??? */
MCFG_CPU_PROGRAM_MAP(cbasebal_map)
MCFG_CPU_IO_MAP(cbasebal_portmap)
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", cbasebal_state, irq0_line_hold) /* ??? */
MCFG_EEPROM_SERIAL_93C46_ADD("eeprom")
@@ -330,7 +335,13 @@ ROM_END
DRIVER_INIT_MEMBER(cbasebal_state,cbasebal)
{
- pang_decode(machine());
+ UINT8 *src = memregion("maincpu")->base();
+ int size = memregion("maincpu")->bytes();
+ UINT8 *dst = auto_alloc_array(machine(), UINT8, size);
+ pang_decode(src, dst, size);
+ membank("bank1")->configure_entries(0, 32, src + 0x10000, 0x4000);
+ membank("bank0d")->set_base(dst);
+ membank("bank1d")->configure_entries(0, 32, dst + 0x10000, 0x4000);
}
diff --git a/src/mame/drivers/cclimber.c b/src/mame/drivers/cclimber.c
index cec97aea9aa..6cfd1382651 100644
--- a/src/mame/drivers/cclimber.c
+++ b/src/mame/drivers/cclimber.c
@@ -216,6 +216,11 @@ Dip location verified from manual for: cclimber, guzzler, swimmer
#define MASTER_CLOCK XTAL_18_432MHz
+void cclimber_state::machine_start()
+{
+ save_item(NAME(m_nmi_mask));
+}
+
WRITE8_MEMBER(cclimber_state::swimmer_sh_soundlatch_w)
{
soundlatch_byte_w(space,offset,data);
@@ -249,8 +254,10 @@ WRITE8_MEMBER(cclimber_state::toprollr_rombank_w)
m_toprollr_rombank &= ~(1 << offset);
m_toprollr_rombank |= (data & 1) << offset;
- if (m_toprollr_rombank < 3)
+ if (m_toprollr_rombank < 3) {
membank("bank1")->set_entry(m_toprollr_rombank);
+ membank("bank1d")->set_entry(m_toprollr_rombank);
+ }
}
MACHINE_RESET_MEMBER(cclimber_state,cclimber)
@@ -294,6 +301,10 @@ static ADDRESS_MAP_START( cclimber_map, AS_PROGRAM, 8, cclimber_state )
AM_RANGE(0xb800, 0xb800) AM_READ_PORT("SYSTEM")
ADDRESS_MAP_END
+static ADDRESS_MAP_START( decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 8, cclimber_state )
+ AM_RANGE(0x0000, 0x5fff) AM_ROM AM_SHARE("decrypted_opcodes")
+ADDRESS_MAP_END
+
static ADDRESS_MAP_START( cannonb_map, AS_PROGRAM, 8, cclimber_state )
AM_RANGE(0x5045, 0x505f) AM_WRITENOP /* do not errorlog this */
AM_RANGE(0x0000, 0x5fff) AM_ROM
@@ -334,6 +345,10 @@ static ADDRESS_MAP_START( swimmer_map, AS_PROGRAM, 8, cclimber_state )
AM_RANGE(0xb000, 0xb000) AM_READ_PORT("DSW1")
AM_RANGE(0xb800, 0xb800) AM_READ_PORT("DSW2") AM_WRITEONLY AM_SHARE("bgcolor")
AM_RANGE(0xb880, 0xb880) AM_READ_PORT("SYSTEM")
+ADDRESS_MAP_END
+
+static ADDRESS_MAP_START( guzzler_map, AS_PROGRAM, 8, cclimber_state )
+ AM_IMPORT_FROM(swimmer_map)
AM_RANGE(0xc000, 0xc7ff) AM_RAM /* ??? used by Guzzler */
AM_RANGE(0xe000, 0xffff) AM_ROM /* Guzzler only */
ADDRESS_MAP_END
@@ -362,7 +377,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( toprollr_map, AS_PROGRAM, 8, cclimber_state )
AM_RANGE(0x0000, 0x5fff) AM_ROMBANK("bank1")
- AM_RANGE(0x6000, 0x6bff) AM_RAM
+ AM_RANGE(0x6000, 0x6bff) AM_RAM AM_SHARE("ram")
AM_RANGE(0x8800, 0x88ff) AM_RAM AM_SHARE("bigspriteram")
AM_RANGE(0x8c00, 0x8fff) AM_RAM AM_SHARE("bg_videoram")
AM_RANGE(0x9000, 0x93ff) AM_RAM AM_SHARE("videoram")
@@ -381,6 +396,10 @@ static ADDRESS_MAP_START( toprollr_map, AS_PROGRAM, 8, cclimber_state )
AM_RANGE(0xc000, 0xffff) AM_ROM
ADDRESS_MAP_END
+static ADDRESS_MAP_START( toprollr_decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 8, cclimber_state )
+ AM_RANGE(0x0000, 0x5fff) AM_ROMBANK("bank1d")
+ AM_RANGE(0xc000, 0xffff) AM_ROM AM_REGION("maincpu", 0xc000)
+ADDRESS_MAP_END
static ADDRESS_MAP_START( cclimber_portmap, AS_IO, 8, cclimber_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
@@ -1014,6 +1033,11 @@ static MACHINE_CONFIG_DERIVED( cclimber, root )
MCFG_CCLIMBER_AUDIO_ADD("cclimber_audio")
MACHINE_CONFIG_END
+static MACHINE_CONFIG_DERIVED( cclimberx, cclimber )
+ MCFG_CPU_MODIFY("maincpu")
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
+MACHINE_CONFIG_END
+
static MACHINE_CONFIG_DERIVED( cannonb, cclimber )
@@ -1032,6 +1056,7 @@ static MACHINE_CONFIG_DERIVED( yamato, root )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(yamato_map)
MCFG_CPU_IO_MAP(yamato_portmap)
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
MCFG_CPU_ADD("audiocpu", Z80, 3072000) /* 3.072 MHz ? */
MCFG_CPU_PROGRAM_MAP(yamato_audio_map)
@@ -1060,6 +1085,7 @@ static MACHINE_CONFIG_DERIVED( toprollr, cclimber )
/* basic machine hardware */
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(toprollr_map)
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(toprollr_decrypted_opcodes_map)
/* video hardware */
MCFG_GFXDECODE_MODIFY("gfxdecode", toprollr)
@@ -1109,6 +1135,12 @@ static MACHINE_CONFIG_START( swimmer, cclimber_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
MACHINE_CONFIG_END
+static MACHINE_CONFIG_DERIVED( guzzler, swimmer )
+ /* basic machine hardware */
+ MCFG_CPU_MODIFY("maincpu")
+ MCFG_CPU_PROGRAM_MAP(guzzler_map)
+MACHINE_CONFIG_END
+
/***************************************************************************
@@ -1117,7 +1149,7 @@ MACHINE_CONFIG_END
***************************************************************************/
ROM_START( cclimber )
- ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_REGION( 0x6000, "maincpu", 0 )
ROM_LOAD( "cc11", 0x0000, 0x1000, CRC(217ec4ff) SHA1(334604c3a051d57440a9d0bfc34b809418ef1d2d) )
ROM_LOAD( "cc10", 0x1000, 0x1000, CRC(b3c26cef) SHA1(f52cb5482c12a9c5fb56e2e2aec7cab0ed23e5a5) )
ROM_LOAD( "cc09", 0x2000, 0x1000, CRC(6db0879c) SHA1(c0ba1976c1dcd6edadd78073173a26851ae8dd4f) )
@@ -1149,7 +1181,7 @@ ROM_START( cclimber )
ROM_END
ROM_START( cclimberj )
- ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_REGION( 0x6000, "maincpu", 0 )
ROM_LOAD( "cc11j.bin", 0x0000, 0x1000, CRC(89783959) SHA1(948fa88fcb9e3797b9c10934d36cf6a55cb590fe) )
ROM_LOAD( "cc10j.bin", 0x1000, 0x1000, CRC(14eda506) SHA1(4bc55b4c4ec197952b05ad32584f15f0383cc2df) )
ROM_LOAD( "cc09j.bin", 0x2000, 0x1000, CRC(26489069) SHA1(9be4d4a22dd334e619416e6c846a05003c0d687e) )
@@ -1181,7 +1213,7 @@ ROM_START( cclimberj )
ROM_END
ROM_START( ccboot )
- ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_REGION( 0x6000, "maincpu", 0 )
ROM_LOAD( "m11.bin", 0x0000, 0x1000, CRC(5efbe180) SHA1(e0c24f21d563da075eb5019d0e76cb01c2598c7a) )
ROM_LOAD( "m10.bin", 0x1000, 0x1000, CRC(be2748c7) SHA1(ae66bc4e5e02bf9944a3ee4b0d2dec073f732260) )
ROM_LOAD( "cc09j.bin", 0x2000, 0x1000, CRC(26489069) SHA1(9be4d4a22dd334e619416e6c846a05003c0d687e) )
@@ -1214,7 +1246,7 @@ ROM_START( ccboot )
ROM_END
ROM_START( ccboot2 )
- ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_REGION( 0x6000, "maincpu", 0 )
ROM_LOAD( "11.4k", 0x0000, 0x1000, CRC(b2b17e24) SHA1(1242d64242b3a6fe099457d155ebc508e5482818) )
ROM_LOAD( "10.4j", 0x1000, 0x1000, CRC(8382bc0f) SHA1(2390ee2ec08a074c7bc4b9c7750b979a1d3a8a67) )
ROM_LOAD( "cc09j.bin", 0x2000, 0x1000, CRC(26489069) SHA1(9be4d4a22dd334e619416e6c846a05003c0d687e) )
@@ -1247,7 +1279,7 @@ ROM_START( ccboot2 )
ROM_END
ROM_START( ccbootmr ) /* Model Racing bootleg */
- ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_REGION( 0x6000, "maincpu", 0 )
ROM_LOAD( "211.k4", 0x0000, 0x1000, CRC(b2b17e24) SHA1(1242d64242b3a6fe099457d155ebc508e5482818) )
ROM_LOAD( "210.j4", 0x1000, 0x1000, CRC(8382bc0f) SHA1(2390ee2ec08a074c7bc4b9c7750b979a1d3a8a67) )
ROM_LOAD( "209.f4", 0x2000, 0x1000, CRC(26489069) SHA1(9be4d4a22dd334e619416e6c846a05003c0d687e) )
@@ -1281,7 +1313,7 @@ ROM_END
ROM_START( cclimbroper )
- ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_REGION( 0x6000, "maincpu", 0 )
ROM_LOAD( "cc5-2532.cpu", 0x0000, 0x1000, CRC(f94b96e8) SHA1(b13dceb0a73d1a4eeb9c3e2d2307f0c82c365393))
ROM_LOAD( "cc4-2532.cpu", 0x1000, 0x1000, CRC(4b1abea6) SHA1(eae7c96fc0b64d313bed4a75bd6d397b37eaac7e) )
ROM_LOAD( "cc3-2532.cpu", 0x2000, 0x1000, CRC(5612bb3c) SHA1(213846bb3393467260f401b00b821cbab7ac9636) )
@@ -1318,7 +1350,7 @@ ROM_END
/* Sets below are Crazy Kong Part II and have an extra screen in attract mode, showing a caged Kong and copyright */
ROM_START( ckongpt2 )
- ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_REGION( 0x6000, "maincpu", 0 )
ROM_LOAD( "7.5d", 0x0000, 0x1000, CRC(b27df032) SHA1(57f9be139c610405e3c2fddd7093dfb1277e450e) )
ROM_LOAD( "8.5e", 0x1000, 0x1000, CRC(5dc1aaba) SHA1(42b9e5946ffce7c156d114bde68f37c2c34853c4) )
ROM_LOAD( "9.5h", 0x2000, 0x1000, CRC(c9054c94) SHA1(1aa08d2501ee620759fd5c111e12f6d432c25294) )
@@ -1347,7 +1379,7 @@ ROM_START( ckongpt2 )
ROM_END
ROM_START( ckongpt2a )
- ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_REGION( 0x6000, "maincpu", 0 )
ROM_LOAD( "7.5d", 0x0000, 0x1000, CRC(b27df032) SHA1(57f9be139c610405e3c2fddd7093dfb1277e450e) )
ROM_LOAD( "8.5e", 0x1000, 0x1000, CRC(5dc1aaba) SHA1(42b9e5946ffce7c156d114bde68f37c2c34853c4) )
ROM_LOAD( "9.5h", 0x2000, 0x1000, CRC(c9054c94) SHA1(1aa08d2501ee620759fd5c111e12f6d432c25294) )
@@ -1376,7 +1408,7 @@ ROM_START( ckongpt2a )
ROM_END
ROM_START( ckongpt2j )
- ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_REGION( 0x6000, "maincpu", 0 )
ROM_LOAD( "7.5d", 0x0000, 0x1000, CRC(b27df032) SHA1(57f9be139c610405e3c2fddd7093dfb1277e450e) )
ROM_LOAD( "8.5e", 0x1000, 0x1000, CRC(5dc1aaba) SHA1(42b9e5946ffce7c156d114bde68f37c2c34853c4) )
ROM_LOAD( "9.5h", 0x2000, 0x1000, CRC(c9054c94) SHA1(1aa08d2501ee620759fd5c111e12f6d432c25294) )
@@ -1405,7 +1437,7 @@ ROM_START( ckongpt2j )
ROM_END
ROM_START( ckongpt2jeu )
- ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_REGION( 0x6000, "maincpu", 0 )
ROM_LOAD( "7.5d", 0x0000, 0x1000, CRC(b27df032) SHA1(57f9be139c610405e3c2fddd7093dfb1277e450e) )
ROM_LOAD( "8.5e", 0x1000, 0x1000, CRC(5dc1aaba) SHA1(42b9e5946ffce7c156d114bde68f37c2c34853c4) )
ROM_LOAD( "9.5h", 0x2000, 0x1000, CRC(c9054c94) SHA1(1aa08d2501ee620759fd5c111e12f6d432c25294) )
@@ -1435,7 +1467,7 @@ ROM_END
ROM_START( ckongpt2b )
- ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_REGION( 0x6000, "maincpu", 0 )
ROM_LOAD( "d05-7.rom", 0x0000, 0x1000, CRC(5d96ee9a) SHA1(f531d251fd3469edd3b5b5e7c26ff9cef7006ce8) )
ROM_LOAD( "f05-8.rom", 0x1000, 0x1000, CRC(74a8435b) SHA1(465ad96009d3ba939eee13ba0d5fd6d9dec118bc) )
ROM_LOAD( "h05-9.rom", 0x2000, 0x1000, CRC(e06ca575) SHA1(cd5a32fac614902e136e522ac188616c72d65571) )
@@ -1468,7 +1500,7 @@ ROM_END
/* Sets below are 'Crazy Kong' without the extra Falcon screen or Pt. 2 subtitle, they also have worse colours */
ROM_START( ckong )
- ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_REGION( 0x6000, "maincpu", 0 )
ROM_LOAD( "falcon7", 0x0000, 0x1000, CRC(2171cac3) SHA1(7b18bfe44c32fb64b675bbbe2136344522c79b09) )
ROM_LOAD( "falcon8", 0x1000, 0x1000, CRC(88b83ff7) SHA1(4afc494cc264aaa4614da6aed02ce062d9c20850) )
ROM_LOAD( "falcon9", 0x2000, 0x1000, CRC(cff2af47) SHA1(1757428cefad13855a623162101ec01c04006c94) )
@@ -1498,7 +1530,7 @@ ROM_END
ROM_START( ckongo )
- ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_REGION( 0x6000, "maincpu", 0 )
ROM_LOAD( "o55a-1", 0x0000, 0x1000, CRC(8bfb4623) SHA1(1b8e12d1f337756bbfa9c3d736db7513d571c1b3) )
ROM_LOAD( "o55a-2", 0x1000, 0x1000, CRC(9ae8089b) SHA1(e50864bb77dce24ba6d10c4fc16ccaa593962442) )
ROM_LOAD( "o55a-3", 0x2000, 0x1000, CRC(e82b33c8) SHA1(27befba696cd1a9453fb49e8e4ddd46eab41b30d) )
@@ -1532,7 +1564,7 @@ ROM_START( ckongo )
ROM_END
ROM_START( ckongalc )
- ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_REGION( 0x6000, "maincpu", 0 )
ROM_LOAD( "ck7.bin", 0x0000, 0x1000, CRC(2171cac3) SHA1(7b18bfe44c32fb64b675bbbe2136344522c79b09) )
ROM_LOAD( "ck8.bin", 0x1000, 0x1000, CRC(88b83ff7) SHA1(4afc494cc264aaa4614da6aed02ce062d9c20850) )
ROM_LOAD( "ck9.bin", 0x2000, 0x1000, CRC(cff2af47) SHA1(1757428cefad13855a623162101ec01c04006c94) )
@@ -1561,7 +1593,7 @@ ROM_START( ckongalc )
ROM_END
ROM_START( bigkong )
- ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_REGION( 0x6000, "maincpu", 0 )
ROM_LOAD( "dk01f7_2532.d5", 0x0000, 0x1000, CRC(4c9102f1) SHA1(845b48fa1e6ad82dc797520f7ff7daffc1a47c39) )
ROM_LOAD( "dk02f8_2532.f5", 0x1000, 0x1000, CRC(1683e9ae) SHA1(4690c8be70c0cc0e7d78d2ff205eed3f4ead7278) )
ROM_LOAD( "dk03f9_2532.h5", 0x2000, 0x1000, CRC(073eea32) SHA1(de7889df04f8a279a0864748298e5ccdce0578f1) )
@@ -1590,7 +1622,7 @@ ROM_START( bigkong )
ROM_END
ROM_START( monkeyd )
- ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_REGION( 0x6000, "maincpu", 0 )
ROM_LOAD( "ck7.bin", 0x0000, 0x1000, CRC(2171cac3) SHA1(7b18bfe44c32fb64b675bbbe2136344522c79b09) )
ROM_LOAD( "ck8.bin", 0x1000, 0x1000, CRC(88b83ff7) SHA1(4afc494cc264aaa4614da6aed02ce062d9c20850) )
ROM_LOAD( "ck9.bin", 0x2000, 0x1000, CRC(cff2af47) SHA1(1757428cefad13855a623162101ec01c04006c94) )
@@ -1761,7 +1793,7 @@ Dip Switch - Donkey King
ROM_START( dking )
- ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_REGION( 0x6000, "maincpu", 0 )
ROM_LOAD( "d11.r2", 0x0800, 0x0800, CRC(f7cace41) SHA1(981dbb1cddd66a0cbc8fe147172ffe7eb5b7fa21) )
ROM_CONTINUE( 0x0000, 0x800 )
ROM_LOAD( "d7.1n", 0x1000, 0x1000, CRC(fe89dea4) SHA1(c39372ebe9950808ebc1ff7909c291496b206026) )
@@ -1793,7 +1825,7 @@ ROM_END
ROM_START( ckongdks )
- ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_REGION( 0x6000, "maincpu", 0 )
ROM_LOAD( "ck13.bin", 0x0800, 0x0800, CRC(f97ba8ae) SHA1(ae4a578ad77a8d3252f2f99a1afa6f38bc00471e) ) // 97.509766%
ROM_CONTINUE( 0x0000, 0x0800 )
ROM_LOAD( "ck09.bin", 0x1000, 0x1000, CRC(fe89dea4) SHA1(c39372ebe9950808ebc1ff7909c291496b206026) )
@@ -1830,7 +1862,7 @@ ROM_END
of Silver Land so I'm loading the River Patrol GFX instead as they fit better
*/
ROM_START( rpatrol )
- ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_REGION( 0x6000, "maincpu", 0 )
ROM_LOAD( "sci1.bin", 0x0000, 0x1000, CRC(33b01c90) SHA1(9c8da6dd963bfb0544ef99b8fdedcf86c32cdb6b) )
ROM_LOAD( "sci2.bin", 0x1000, 0x1000, CRC(03f53340) SHA1(35336945f4b634fc4c7791ac9c9e6643c8cd8006) )
ROM_LOAD( "sci3.bin", 0x2000, 0x1000, CRC(8fa300df) SHA1(5c3ba1ef6c1ce8df437b4fa464293208630b5e8d) )
@@ -1881,7 +1913,7 @@ ROM_START( rpatrol )
ROM_END
ROM_START( rpatrolb )
- ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_REGION( 0x6000, "maincpu", 0 )
ROM_LOAD( "rp1.4l", 0x0000, 0x1000, CRC(bfd7ae7a) SHA1(a06d1cc2674ed40d0bfa67dd6d724964c1e40600) )
ROM_LOAD( "rp2.4j", 0x1000, 0x1000, CRC(03f53340) SHA1(35336945f4b634fc4c7791ac9c9e6643c8cd8006) )
ROM_LOAD( "rp3.4f", 0x2000, 0x1000, CRC(8fa300df) SHA1(5c3ba1ef6c1ce8df437b4fa464293208630b5e8d) )
@@ -1912,7 +1944,7 @@ ROM_START( rpatrolb )
ROM_END
ROM_START( silvland )
- ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_REGION( 0x6000, "maincpu", 0 )
ROM_LOAD( "7.2r", 0x0000, 0x1000, CRC(57e6be62) SHA1(c1d47970f8209256c9ccd6512b921dec6c276998) )
ROM_LOAD( "8.1n", 0x1000, 0x1000, CRC(bbb2b287) SHA1(93cd4ebe238c189c80be8b8ab1ec2649256dd6ea) )
ROM_LOAD( "rp3.4f", 0x2000, 0x1000, CRC(8fa300df) SHA1(5c3ba1ef6c1ce8df437b4fa464293208630b5e8d) )
@@ -1985,7 +2017,7 @@ ROM_START( cannonb )
ROM_END
ROM_START( cannonb2 )
- ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_REGION( 0x6000, "maincpu", 0 )
ROM_LOAD( "cb1.bin", 0x0000, 0x1000, CRC(7a3cba7c) SHA1(08b8b356fdbe642e80d42b5ab4164a1bd6ad93ba) )
ROM_LOAD( "cb2.bin", 0x1000, 0x1000, CRC(58ef3118) SHA1(51ae36c21147e99d4060034520f6eebf3210937c) )
ROM_LOAD( "cb3.bin", 0x2000, 0x1000, CRC(e18a836b) SHA1(19b90a55db82914c5db18486e05d9f59aba1b442) )
@@ -2016,7 +2048,7 @@ ROM_START( cannonb2 )
ROM_END
ROM_START( cannonb3 )
- ROM_REGION( 0x11000, "maincpu", 0 )
+ ROM_REGION( 0x6000, "maincpu", 0 )
ROM_LOAD( "1 pos e5 2532.bin", 0x0000, 0x1000, CRC(4b482e80) SHA1(4c0e52016ed760d399e8d49f600d38c1b6ccf256) )
ROM_LOAD( "2 pos f5 2532.bin", 0x1000, 0x1000, CRC(1fa050af) SHA1(00244e19aee14ce980697136cddb6cb72a4d80da) )
ROM_LOAD( "3 pos h5 2532.bin", 0x2000, 0x1000, CRC(e18a836b) SHA1(19b90a55db82914c5db18486e05d9f59aba1b442) )
@@ -2058,7 +2090,7 @@ ROM_END
*/
ROM_START( bagmanf )
- ROM_REGION( 0x11000, "maincpu", 0 )
+ ROM_REGION( 0x6000, "maincpu", 0 )
ROM_LOAD( "01.d5.bin", 0x0000, 0x1000, CRC(e0156191) SHA1(bb5f16d49fbe48f3bac118acd1fea51ec4bc5355) )
ROM_LOAD( "02.f5.bin", 0x1000, 0x1000, CRC(7b758982) SHA1(c8460023b43fed4aca9c6b987faea334832c5e30) )
ROM_LOAD( "03.h5.bin", 0x2000, 0x1000, CRC(302a077b) SHA1(916c4a6ea1e631cc72bdb91ff9d263dcbaf08bb2) )
@@ -2099,7 +2131,7 @@ ROM_END
ROM_START( swimmer )
- ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_REGION( 0x8000, "maincpu", 0 )
ROM_LOAD( "sw1", 0x0000, 0x1000, CRC(f12481e7) SHA1(4e8ee509043fd57ec1579594f0b2c543f270bead) )
ROM_LOAD( "sw2", 0x1000, 0x1000, CRC(a0b6fdd2) SHA1(7d3603de6c282224869824c7572868fc85599ea2) )
ROM_LOAD( "sw3", 0x2000, 0x1000, CRC(ec93d7de) SHA1(e225c6b98eb3c32825c1cc1fcf69dec7e340460c) )
@@ -2109,7 +2141,7 @@ ROM_START( swimmer )
ROM_LOAD( "sw7", 0x6000, 0x1000, CRC(37efb64e) SHA1(0ed4d678895c17b37df605990acd096c538e3675) )
ROM_LOAD( "sw8", 0x7000, 0x1000, CRC(33d6001e) SHA1(749b746d018e74e364fd6974e4522c8a18915774) )
- ROM_REGION( 0x10000, "audiocpu", 0 )
+ ROM_REGION( 0x1000, "audiocpu", 0 )
ROM_LOAD( "sw12.4k", 0x0000, 0x1000, CRC(2eee9bcb) SHA1(ceafdf750a8af0c1c9abbbf437c3e9d9ae09f72b) )
ROM_REGION( 0x3000, "gfx1", 0 )
@@ -2132,7 +2164,7 @@ ROM_START( swimmer )
ROM_END
ROM_START( swimmera )
- ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_REGION( 0x8000, "maincpu", 0 )
ROM_LOAD( "swa1", 0x0000, 0x1000, CRC(42c2b6c5) SHA1(13688e1ee08308b13ead5af7b4f65043dae4e40f) )
ROM_LOAD( "swa2", 0x1000, 0x1000, CRC(49bac195) SHA1(a5d2cc2cdd10003f69014c4799f5f59e47a44260) )
ROM_LOAD( "swa3", 0x2000, 0x1000, CRC(a6d8cb01) SHA1(80ab0ffaee6e0edf19b767229865722c2af6112c) )
@@ -2142,7 +2174,7 @@ ROM_START( swimmera )
ROM_LOAD( "swa7", 0x6000, 0x1000, CRC(7090e5ee) SHA1(d1e0ca38c3d1e4a7b7efa3696e47fb36ad3f8aa0) )
ROM_LOAD( "swa8", 0x7000, 0x1000, CRC(ab86efa9) SHA1(5b5a80ae285c7e9f4c51e646116edf789d4dba39) )
- ROM_REGION( 0x10000, "audiocpu", 0 )
+ ROM_REGION( 0x1000, "audiocpu", 0 )
ROM_LOAD( "sw12.4k", 0x0000, 0x1000, CRC(2eee9bcb) SHA1(ceafdf750a8af0c1c9abbbf437c3e9d9ae09f72b) )
ROM_REGION( 0x3000, "gfx1", 0 )
@@ -2165,7 +2197,7 @@ ROM_START( swimmera )
ROM_END
ROM_START( swimmerb )
- ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_REGION( 0x8000, "maincpu", 0 )
ROM_LOAD( "sw1.9l", 0x0000, 0x1000, CRC(b045be08) SHA1(52187e1daebec521a98157f22960637393e40e62) )
ROM_LOAD( "sw2.9k", 0x1000, 0x1000, CRC(163d65e5) SHA1(b505f05af96f241285f0f7082ed03fa07bbde7de) )
ROM_LOAD( "sw3.9j", 0x2000, 0x1000, CRC(631d74e9) SHA1(b6adba9445264de80f5daf33dad1c90b23617648) )
@@ -2175,7 +2207,7 @@ ROM_START( swimmerb )
ROM_LOAD( "sw7.9c", 0x6000, 0x1000, CRC(88266f2e) SHA1(4ad15f9ba7b45a6c1c3637f8d0fd8be9c04b495f) )
ROM_LOAD( "sw8.9a", 0x7000, 0x1000, CRC(191a16e4) SHA1(75d3f49e2f4ea04d3a7cc88662c023768bf48365) )
- ROM_REGION( 0x10000, "audiocpu", 0 )
+ ROM_REGION( 0x1000, "audiocpu", 0 )
ROM_LOAD( "sw12.4k", 0x0000, 0x1000, CRC(2eee9bcb) SHA1(ceafdf750a8af0c1c9abbbf437c3e9d9ae09f72b) )
ROM_REGION( 0x3000, "gfx1", 0 )
@@ -2205,7 +2237,7 @@ ROM_START( guzzler )
ROM_LOAD( "guzz-04.bin", 0x6000, 0x2000, CRC(45be42f5) SHA1(578943afdb6ceca34ca7c19c2fd1164ca3aa57bd) )
ROM_LOAD( "guzz-16.bin", 0xe000, 0x2000, CRC(61ee00b7) SHA1(ea8516c8dfb2de32a8034f94c7d0c086e3596740) )
- ROM_REGION( 0x10000, "audiocpu", 0 )
+ ROM_REGION( 0x1000, "audiocpu", 0 )
ROM_LOAD( "guzz-12.bin", 0x0000, 0x1000, CRC(f3754d9e) SHA1(bb30832aba4e82ab0ecce40fc1223d9771ff7dd2) )
ROM_REGION( 0x3000, "gfx1", 0 )
@@ -2236,7 +2268,7 @@ ROM_START( guzzlers ) /* Swimmer Conversion, 1k vs 2k romsize in maincpu */
ROM_LOAD( "guzz8.a9", 0x7000, 0x1000, CRC(8d44f5f8) SHA1(957f1b880f6f815ac31c1a37c40cdff75dd119cf) )
ROM_LOAD( "guzz-16.bin", 0xe000, 0x2000, CRC(61ee00b7) SHA1(ea8516c8dfb2de32a8034f94c7d0c086e3596740) ) // 16.
- ROM_REGION( 0x10000, "audiocpu", 0 )
+ ROM_REGION( 0x1000, "audiocpu", 0 )
ROM_LOAD( "guzz-12.bin", 0x0000, 0x1000, CRC(f3754d9e) SHA1(bb30832aba4e82ab0ecce40fc1223d9771ff7dd2) ) // GUZZ12.L4
ROM_REGION( 0x3000, "gfx1", 0 ) /* chars */
@@ -2256,14 +2288,14 @@ ROM_START( guzzlers ) /* Swimmer Conversion, 1k vs 2k romsize in maincpu */
ROM_END
ROM_START( yamato )
- ROM_REGION( 2*0x10000, "maincpu", 0 )
+ ROM_REGION( 0x8000, "maincpu", 0 )
ROM_LOAD( "2.5de", 0x0000, 0x2000, CRC(20895096) SHA1(af76786e3c519e710899f143d46c53087e9817c7) )
ROM_LOAD( "3.5f", 0x2000, 0x2000, CRC(57a696f9) SHA1(28ea80fb100ac92295fc3eb318617d7cb014408d) )
ROM_LOAD( "4.5jh", 0x4000, 0x2000, CRC(59a468e8) SHA1(a79cdee6efefd87a356cc8d710f8050bc12e07c3) )
/* hole at 6000-6fff */
ROM_LOAD( "11.5a", 0x7000, 0x1000, CRC(35987485) SHA1(1f0cb545bbd52982cbf801bc1dd2c4087af2f5f7) )
- ROM_REGION( 0x10000, "audiocpu", 0 )
+ ROM_REGION( 0x800, "audiocpu", 0 )
ROM_LOAD( "1.5v", 0x0000, 0x0800, CRC(3aad9e3c) SHA1(37b0414b265397881bb45b166ecab85880d1358d) )
ROM_REGION( 0x4000, "gfx1", 0 )
@@ -2287,14 +2319,14 @@ ROM_START( yamato )
ROM_END
ROM_START( yamato2 )
- ROM_REGION( 2*0x10000, "maincpu", 0 )
+ ROM_REGION( 0x8000, "maincpu", 0 )
ROM_LOAD( "2-2.5de", 0x0000, 0x2000, CRC(93da1d52) SHA1(21b72856ebbd969e4e075b52719e6acdbd1bc4c5) )
ROM_LOAD( "3-2.5f", 0x2000, 0x2000, CRC(31e73821) SHA1(e582c9fcea1b29d43f65b6aa67e1895c38d2736c) )
ROM_LOAD( "4-2.5jh", 0x4000, 0x2000, CRC(fd7bcfc3) SHA1(5037170cb3a9824794e90d74def92b0b25d45caa) )
/* hole at 6000-6fff */
/* 7000-7fff not present here */
- ROM_REGION( 0x10000, "audiocpu", 0 )
+ ROM_REGION( 0x8000, "audiocpu", 0 )
ROM_LOAD( "1.5v", 0x0000, 0x0800, CRC(3aad9e3c) SHA1(37b0414b265397881bb45b166ecab85880d1358d) )
ROM_REGION( 0x4000, "gfx1", 0 )
@@ -2318,7 +2350,7 @@ ROM_START( yamato2 )
ROM_END
ROM_START( toprollr )
- ROM_REGION( 0x10000*2, "maincpu", 0 )
+ ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "10.k3", 0xc000, 0x2000, CRC(1e8914a6) SHA1(ec17f185f890d04ce75a5d8edf8b32da60e7a8d8) )
ROM_LOAD( "11.l3", 0xe000, 0x2000, CRC(b20a9fa2) SHA1(accd3296447eca002b0808e7b02832f5e35407e8) )
@@ -2361,13 +2393,69 @@ ROM_END
DRIVER_INIT_MEMBER(cclimber_state,yamato)
{
- yamato_decode(machine(),"maincpu");
+ static const UINT8 convtable[32][4] =
+ {
+ /* opcode data address */
+ /* A B C D A B C D */
+ { 0x88,0xa8,0x08,0x28 }, { 0x88,0xa8,0x80,0xa0 }, /* ...0...0...0...0 */
+ { 0x20,0xa0,0x28,0xa8 }, { 0x88,0xa8,0x80,0xa0 }, /* ...0...0...0...1 */
+ { 0x88,0xa8,0x80,0xa0 }, { 0x88,0xa8,0x80,0xa0 }, /* ...0...0...1...0 */
+ { 0x88,0xa8,0x80,0xa0 }, { 0x20,0xa0,0x28,0xa8 }, /* ...0...0...1...1 */
+ { 0x88,0xa8,0x08,0x28 }, { 0x88,0xa8,0x08,0x28 }, /* ...0...1...0...0 */
+ { 0x88,0xa8,0x80,0xa0 }, { 0x88,0xa8,0x80,0xa0 }, /* ...0...1...0...1 */
+ { 0x20,0xa0,0x28,0xa8 }, { 0x20,0xa0,0x28,0xa8 }, /* ...0...1...1...0 */
+ { 0x88,0xa8,0x80,0xa0 }, { 0x88,0xa8,0x80,0xa0 }, /* ...0...1...1...1 */
+ { 0x20,0xa0,0x28,0xa8 }, { 0x88,0xa8,0x08,0x28 }, /* ...1...0...0...0 */
+ { 0x20,0xa0,0x28,0xa8 }, { 0x28,0x20,0xa8,0xa0 }, /* ...1...0...0...1 */
+ { 0xa0,0x20,0x80,0x00 }, { 0x20,0xa0,0x28,0xa8 }, /* ...1...0...1...0 */
+ { 0x28,0x20,0xa8,0xa0 }, { 0x20,0xa0,0x28,0xa8 }, /* ...1...0...1...1 */
+ { 0x20,0xa0,0x28,0xa8 }, { 0x88,0xa8,0x08,0x28 }, /* ...1...1...0...0 */
+ { 0x88,0xa8,0x08,0x28 }, { 0x88,0xa8,0x08,0x28 }, /* ...1...1...0...1 */
+ { 0xa0,0x20,0x80,0x00 }, { 0x88,0x08,0x80,0x00 }, /* ...1...1...1...0 */
+ { 0x20,0xa0,0x28,0xa8 }, { 0x00,0x08,0x20,0x28 } /* ...1...1...1...1 */
+ };
+
+ sega_decode(memregion("maincpu")->base(), m_decrypted_opcodes, 0x6000, convtable);
+
+ save_item(NAME(m_yamato_p0));
+ save_item(NAME(m_yamato_p1));
}
DRIVER_INIT_MEMBER(cclimber_state,toprollr)
{
- toprollr_decode(machine(), "maincpu", "user1");
+ static const UINT8 convtable[32][4] =
+ {
+ /* opcode data address */
+ /* A B C D A B C D */
+ { 0x88,0xa8,0x08,0x28 }, { 0x88,0xa8,0x80,0xa0 }, /* ...0...0...0...0 */
+ { 0x20,0xa0,0x28,0xa8 }, { 0x88,0xa8,0x80,0xa0 }, /* ...0...0...0...1 */
+ { 0x88,0xa8,0x80,0xa0 }, { 0x88,0xa8,0x80,0xa0 }, /* ...0...0...1...0 */
+ { 0x88,0xa8,0x80,0xa0 }, { 0x20,0xa0,0x28,0xa8 }, /* ...0...0...1...1 */
+ { 0x88,0xa8,0x08,0x28 }, { 0x88,0xa8,0x08,0x28 }, /* ...0...1...0...0 */
+ { 0x88,0xa8,0x80,0xa0 }, { 0x88,0xa8,0x80,0xa0 }, /* ...0...1...0...1 */
+ { 0x20,0xa0,0x28,0xa8 }, { 0x20,0xa0,0x28,0xa8 }, /* ...0...1...1...0 */
+ { 0x88,0xa8,0x80,0xa0 }, { 0x88,0xa8,0x80,0xa0 }, /* ...0...1...1...1 */
+ { 0x20,0xa0,0x28,0xa8 }, { 0x88,0xa8,0x08,0x28 }, /* ...1...0...0...0 */
+ { 0x20,0xa0,0x28,0xa8 }, { 0x28,0x20,0xa8,0xa0 }, /* ...1...0...0...1 */
+ { 0xa0,0x20,0x80,0x00 }, { 0x20,0xa0,0x28,0xa8 }, /* ...1...0...1...0 */
+ { 0x28,0x20,0xa8,0xa0 }, { 0x20,0xa0,0x28,0xa8 }, /* ...1...0...1...1 */
+ { 0x20,0xa0,0x28,0xa8 }, { 0x88,0xa8,0x08,0x28 }, /* ...1...1...0...0 */
+ { 0x88,0xa8,0x08,0x28 }, { 0x88,0xa8,0x08,0x28 }, /* ...1...1...0...1 */
+ { 0xa0,0x20,0x80,0x00 }, { 0x88,0x08,0x80,0x00 }, /* ...1...1...1...0 */
+ { 0x20,0xa0,0x28,0xa8 }, { 0x00,0x08,0x20,0x28 } /* ...1...1...1...1 */
+ };
+
+ UINT8 *opcodes = auto_alloc_array(machine(), UINT8, 0x6000*3);
+ sega_decode(memregion("user1")->base(), opcodes, 0, convtable, 3, 0x6000);
+
+ membank("bank1")->configure_entries(0, 3, memregion("user1")->base(), 0x6000);
+ membank("bank1d")->configure_entries(0, 3, opcodes, 0x6000);
+
+ membank("bank1")->set_entry(0);
+ membank("bank1d")->set_entry(0);
+
+ save_item(NAME(m_toprollr_rombank));
}
DRIVER_INIT_MEMBER(cclimber_state,dking)
@@ -2385,56 +2473,56 @@ DRIVER_INIT_MEMBER(cclimber_state,dking)
}
-GAME( 1980, cclimber, 0, cclimber, cclimber, cclimber_state, cclimber, ROT0, "Nichibutsu", "Crazy Climber (US)", 0 )
-GAME( 1980, cclimberj, cclimber, cclimber, cclimberj, cclimber_state,cclimberj,ROT0, "Nichibutsu", "Crazy Climber (Japan)", 0 )
-GAME( 1980, ccboot, cclimber, cclimber, cclimber, cclimber_state, cclimberj,ROT0, "bootleg", "Crazy Climber (bootleg set 1)", 0 )
-GAME( 1980, ccboot2, cclimber, cclimber, cclimber, cclimber_state, cclimberj,ROT0, "bootleg", "Crazy Climber (bootleg set 2)", 0 )
-GAME( 1980, ccbootmr, cclimber, cclimber, cclimber, cclimber_state, cclimberj,ROT0, "bootleg (Model Racing)", "Crazy Climber (Model Racing bootleg)", 0 )
-GAME( 1980, cclimbroper, cclimber, cclimber, cclimber, driver_device, 0, ROT0, "bootleg (Operamatic)", "Crazy Climber (Spanish, Operamatic bootleg)", 0 )
+GAME( 1980, cclimber, 0, cclimberx, cclimber, cclimber_state, cclimber, ROT0, "Nichibutsu", "Crazy Climber (US)", GAME_SUPPORTS_SAVE )
+GAME( 1980, cclimberj, cclimber, cclimberx, cclimberj, cclimber_state,cclimberj,ROT0, "Nichibutsu", "Crazy Climber (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1980, ccboot, cclimber, cclimberx, cclimber, cclimber_state, cclimberj,ROT0, "bootleg", "Crazy Climber (bootleg set 1)", GAME_SUPPORTS_SAVE )
+GAME( 1980, ccboot2, cclimber, cclimberx, cclimber, cclimber_state, cclimberj,ROT0, "bootleg", "Crazy Climber (bootleg set 2)", GAME_SUPPORTS_SAVE )
+GAME( 1980, ccbootmr, cclimber, cclimberx, cclimber, cclimber_state, cclimberj,ROT0, "bootleg (Model Racing)", "Crazy Climber (Model Racing bootleg)", GAME_SUPPORTS_SAVE )
+GAME( 1980, cclimbroper, cclimber, cclimber, cclimber, driver_device, 0, ROT0, "bootleg (Operamatic)", "Crazy Climber (Spanish, Operamatic bootleg)", GAME_SUPPORTS_SAVE )
/* these sets have ugly colours, no extra attract screen, and no graphics for the extra attract screen in the BG roms
- there is a Falcon logo in the text roms which is unused
- does the code to display the extra screen still exist in the roms? */
-GAME( 1981, ckong, 0, cclimber, ckong, driver_device, 0, ROT270, "Kyoei / Falcon", "Crazy Kong", 0 ) // on a Falcon FCK-01 PCB, but doesn't display any Falcon copyright
-GAME( 1981, ckongalc, ckong, cclimber, ckong, driver_device, 0, ROT270, "bootleg (Alca)", "Crazy Kong (Alca bootleg)", 0 )
-GAME( 1981, monkeyd, ckong, cclimber, ckong, driver_device, 0, ROT270, "bootleg", "Monkey Donkey", 0 )
-GAME( 1981, dking, ckong, cclimber, ckong, cclimber_state, dking, ROT270, "bootleg", "Donkey King", 0 ) // supposedly, possibly by Hafasonic?
-GAME( 1981, ckongdks, ckong, cclimber, ckong, cclimber_state, dking, ROT270, "bootleg", "Donkey Kong (Spanish Crazy Kong bootleg)", 0 )
+GAME( 1981, ckong, 0, cclimber, ckong, driver_device, 0, ROT270, "Kyoei / Falcon", "Crazy Kong", GAME_SUPPORTS_SAVE ) // on a Falcon FCK-01 PCB, but doesn't display any Falcon copyright
+GAME( 1981, ckongalc, ckong, cclimber, ckong, driver_device, 0, ROT270, "bootleg (Alca)", "Crazy Kong (Alca bootleg)", GAME_SUPPORTS_SAVE )
+GAME( 1981, monkeyd, ckong, cclimber, ckong, driver_device, 0, ROT270, "bootleg", "Monkey Donkey", GAME_SUPPORTS_SAVE )
+GAME( 1981, dking, ckong, cclimber, ckong, cclimber_state, dking, ROT270, "bootleg", "Donkey King", GAME_SUPPORTS_SAVE ) // supposedly, possibly by Hafasonic?
+GAME( 1981, ckongdks, ckong, cclimber, ckong, cclimber_state, dking, ROT270, "bootleg", "Donkey Kong (Spanish Crazy Kong bootleg)", GAME_SUPPORTS_SAVE )
/* these sets have correct colours, and also contain the graphics used for the extra attract screen in the BG roms, but it is unused
- the Falcon logo in the text roms is still unused
- does the code to display the extra screen still exist in the roms? */
-GAME( 1981, ckongo, ckong, cclimber, ckong, driver_device, 0, ROT270, "bootleg (Orca)", "Crazy Kong (Orca bootleg)", 0 )
-GAME( 1981, bigkong, ckong, cclimber, ckong, driver_device, 0, ROT270, "bootleg", "Big Kong", 0 )
+GAME( 1981, ckongo, ckong, cclimber, ckong, driver_device, 0, ROT270, "bootleg (Orca)", "Crazy Kong (Orca bootleg)", GAME_SUPPORTS_SAVE )
+GAME( 1981, bigkong, ckong, cclimber, ckong, driver_device, 0, ROT270, "bootleg", "Big Kong", GAME_SUPPORTS_SAVE )
/* these sets have correct colours, and the extra attract screen, they also make use of the Falcon logo, some sets hack out the Falcon
text on the extra screen */
-GAME( 1981, ckongpt2, 0, cclimber, ckong, driver_device, 0, ROT270, "Falcon", "Crazy Kong Part II (set 1)", 0 )
-GAME( 1981, ckongpt2a, ckongpt2, cclimber, ckong, driver_device, 0, ROT270, "Falcon", "Crazy Kong Part II (set 2)", 0 )
-GAME( 1981, ckongpt2j, ckongpt2, cclimber, ckong, driver_device, 0, ROT270, "Falcon", "Crazy Kong Part II (Japan)", 0 )
-GAME( 1981, ckongpt2jeu, ckongpt2, cclimber, ckong, driver_device, 0, ROT270, "bootleg (Jeutel)", "Crazy Kong Part II (Jeutel bootleg)", 0 )
-GAME( 1981, ckongpt2b, ckongpt2, cclimber, ckongb, cclimber_state, ckongb, ROT270, "bootleg", "Crazy Kong Part II (alternative levels)", 0 )
+GAME( 1981, ckongpt2, 0, cclimber, ckong, driver_device, 0, ROT270, "Falcon", "Crazy Kong Part II (set 1)", GAME_SUPPORTS_SAVE )
+GAME( 1981, ckongpt2a, ckongpt2, cclimber, ckong, driver_device, 0, ROT270, "Falcon", "Crazy Kong Part II (set 2)", GAME_SUPPORTS_SAVE )
+GAME( 1981, ckongpt2j, ckongpt2, cclimber, ckong, driver_device, 0, ROT270, "Falcon", "Crazy Kong Part II (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1981, ckongpt2jeu, ckongpt2, cclimber, ckong, driver_device, 0, ROT270, "bootleg (Jeutel)", "Crazy Kong Part II (Jeutel bootleg)", GAME_SUPPORTS_SAVE )
+GAME( 1981, ckongpt2b, ckongpt2, cclimber, ckongb, cclimber_state, ckongb, ROT270, "bootleg", "Crazy Kong Part II (alternative levels)", GAME_SUPPORTS_SAVE )
// see bagman.c for parent
-GAME( 1981, bagmanf, bagman, cclimber, ckong, driver_device, 0, ROT270, "bootleg", "Bagman (bootleg on Crazy Kong hardware)", GAME_NOT_WORKING )
+GAME( 1981, bagmanf, bagman, cclimber, ckong, driver_device, 0, ROT270, "bootleg", "Bagman (bootleg on Crazy Kong hardware)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
-GAME( 1981, rpatrol, 0, cclimber, rpatrol, driver_device, 0, ROT0, "Orca", "River Patrol (Orca)", 0 )
-GAME( 1981, rpatrolb, rpatrol, cclimber, rpatrol, driver_device, 0, ROT0, "bootleg", "River Patrol (bootleg)", 0 )
-GAME( 1981, silvland, rpatrol, cclimber, rpatrol, driver_device, 0, ROT0, "Falcon", "Silver Land", 0 )
+GAME( 1981, rpatrol, 0, cclimber, rpatrol, driver_device, 0, ROT0, "Orca", "River Patrol (Orca)", GAME_SUPPORTS_SAVE )
+GAME( 1981, rpatrolb, rpatrol, cclimber, rpatrol, driver_device, 0, ROT0, "bootleg", "River Patrol (bootleg)", GAME_SUPPORTS_SAVE )
+GAME( 1981, silvland, rpatrol, cclimber, rpatrol, driver_device, 0, ROT0, "Falcon", "Silver Land", GAME_SUPPORTS_SAVE )
// see pacman.c for parent
-GAME( 1985, cannonb, cannonbp, cannonb, cannonb, cclimber_state, cannonb, ROT90, "bootleg (Soft)", "Cannon Ball (bootleg on Crazy Kong hardware) (set 1, buggy)" , GAME_IMPERFECT_GRAPHICS ) // bootleggers missed protection after bonus game
-GAME( 1985, cannonb2, cannonbp, cannonb, cannonb, cclimber_state, cannonb2, ROT90, "bootleg (TV Game Gruenberg)", "Cannon Ball (bootleg on Crazy Kong hardware) (set 2, buggy)", 0 ) // bootleggers missed protection after bonus game
-GAME( 1985, cannonb3, cannonbp, cannonb, cannonb, cclimber_state, cannonb2, ROT90, "bootleg (Soft)", "Cannon Ball (bootleg on Crazy Kong hardware) (set 3, no bonus game)", 0 ) // the bonus game is patched out, thus avoiding the protection issue
+GAME( 1985, cannonb, cannonbp, cannonb, cannonb, cclimber_state, cannonb, ROT90, "bootleg (Soft)", "Cannon Ball (bootleg on Crazy Kong hardware) (set 1, buggy)" , GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) // bootleggers missed protection after bonus game
+GAME( 1985, cannonb2, cannonbp, cannonb, cannonb, cclimber_state, cannonb2, ROT90, "bootleg (TV Game Gruenberg)", "Cannon Ball (bootleg on Crazy Kong hardware) (set 2, buggy)", GAME_SUPPORTS_SAVE ) // bootleggers missed protection after bonus game
+GAME( 1985, cannonb3, cannonbp, cannonb, cannonb, cclimber_state, cannonb2, ROT90, "bootleg (Soft)", "Cannon Ball (bootleg on Crazy Kong hardware) (set 3, no bonus game)", GAME_SUPPORTS_SAVE ) // the bonus game is patched out, thus avoiding the protection issue
-GAME( 1982, swimmer, 0, swimmer, swimmer, driver_device, 0, ROT0, "Tehkan", "Swimmer (set 1)", 0 )
-GAME( 1982, swimmera, swimmer, swimmer, swimmer, driver_device, 0, ROT0, "Tehkan", "Swimmer (set 2)", 0 )
-GAME( 1982, swimmerb, swimmer, swimmer, swimmerb, driver_device, 0, ROT0, "Tehkan", "Swimmer (set 3)", 0 )
+GAME( 1982, swimmer, 0, swimmer, swimmer, driver_device, 0, ROT0, "Tehkan", "Swimmer (set 1)", GAME_SUPPORTS_SAVE )
+GAME( 1982, swimmera, swimmer, swimmer, swimmer, driver_device, 0, ROT0, "Tehkan", "Swimmer (set 2)", GAME_SUPPORTS_SAVE )
+GAME( 1982, swimmerb, swimmer, swimmer, swimmerb, driver_device, 0, ROT0, "Tehkan", "Swimmer (set 3)", GAME_SUPPORTS_SAVE )
-GAME( 1983, guzzler, 0, swimmer, guzzler, driver_device, 0, ROT90, "Tehkan", "Guzzler", 0 )
-GAME( 1983, guzzlers, guzzler, swimmer, guzzler, driver_device, 0, ROT90, "Tehkan", "Guzzler (Swimmer Conversion)", 0 )
+GAME( 1983, guzzler, 0, guzzler, guzzler, driver_device, 0, ROT90, "Tehkan", "Guzzler", GAME_SUPPORTS_SAVE )
+GAME( 1983, guzzlers, guzzler, guzzler, guzzler, driver_device, 0, ROT90, "Tehkan", "Guzzler (Swimmer Conversion)", GAME_SUPPORTS_SAVE )
-GAME( 1983, yamato, 0, yamato, yamato, cclimber_state, yamato, ROT90, "Sega", "Yamato (US)", GAME_IMPERFECT_GRAPHICS )
-GAME( 1983, yamato2, yamato, yamato, yamato, cclimber_state, yamato, ROT90, "Sega", "Yamato (World?)", GAME_IMPERFECT_GRAPHICS )
+GAME( 1983, yamato, 0, yamato, yamato, cclimber_state, yamato, ROT90, "Sega", "Yamato (US)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
+GAME( 1983, yamato2, yamato, yamato, yamato, cclimber_state, yamato, ROT90, "Sega", "Yamato (World?)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
-GAME( 1983, toprollr, 0, toprollr, toprollr, cclimber_state, toprollr, ROT90, "Jaleco", "Top Roller", GAME_IMPERFECT_COLORS )
+GAME( 1983, toprollr, 0, toprollr, toprollr, cclimber_state, toprollr, ROT90, "Jaleco", "Top Roller", GAME_IMPERFECT_COLORS | GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/cdi.c b/src/mame/drivers/cdi.c
index 5f0c12b15e4..6b928c15cdc 100644
--- a/src/mame/drivers/cdi.c
+++ b/src/mame/drivers/cdi.c
@@ -211,7 +211,7 @@ MACHINE_RESET_MEMBER(cdi_state,cdi)
m_dmadac[1] = machine().device<dmadac_sound_device>("dac2");
}
-MACHINE_RESET_MEMBER(cdi_state,quizrd12)
+MACHINE_RESET_MEMBER(cdi_state,quizard12)
{
MACHINE_RESET_CALL_MEMBER( cdi );
@@ -219,7 +219,7 @@ MACHINE_RESET_MEMBER(cdi_state,quizrd12)
m_scc->set_quizard_mcu_ack(0x5a);
}
-MACHINE_RESET_MEMBER(cdi_state,quizrd17)
+MACHINE_RESET_MEMBER(cdi_state,quizard17)
{
MACHINE_RESET_CALL_MEMBER( cdi );
@@ -227,8 +227,8 @@ MACHINE_RESET_MEMBER(cdi_state,quizrd17)
m_scc->set_quizard_mcu_ack(0x5a);
}
-/* Untested - copied from quizrd17 */
-MACHINE_RESET_MEMBER(cdi_state,quizrd18)
+/* Untested - copied from quizard17 */
+MACHINE_RESET_MEMBER(cdi_state,quizard18)
{
MACHINE_RESET_CALL_MEMBER( cdi );
@@ -236,7 +236,7 @@ MACHINE_RESET_MEMBER(cdi_state,quizrd18)
m_scc->set_quizard_mcu_ack(0x5a);
}
-MACHINE_RESET_MEMBER(cdi_state,quizrd22)
+MACHINE_RESET_MEMBER(cdi_state,quizard22)
{
MACHINE_RESET_CALL_MEMBER( cdi );
@@ -248,8 +248,8 @@ MACHINE_RESET_MEMBER(cdi_state,quizrd22)
m_scc->set_quizard_mcu_ack(0x59);
}
-/* Untested - copied from quizrd22 */
-MACHINE_RESET_MEMBER(cdi_state,quizrd23)
+/* Untested - copied from quizard22 */
+MACHINE_RESET_MEMBER(cdi_state,quizard23)
{
MACHINE_RESET_CALL_MEMBER( cdi );
@@ -261,7 +261,7 @@ MACHINE_RESET_MEMBER(cdi_state,quizrd23)
m_scc->set_quizard_mcu_ack(0x59);
}
-MACHINE_RESET_MEMBER(cdi_state,quizrd32)
+MACHINE_RESET_MEMBER(cdi_state,quizard32)
{
MACHINE_RESET_CALL_MEMBER( cdi );
@@ -269,8 +269,8 @@ MACHINE_RESET_MEMBER(cdi_state,quizrd32)
m_scc->set_quizard_mcu_ack(0x58);
}
-/* Untested - copied from quizrd32 */
-MACHINE_RESET_MEMBER(cdi_state,quizrd34)
+/* Untested - copied from quizard32 */
+MACHINE_RESET_MEMBER(cdi_state,quizard34)
{
MACHINE_RESET_CALL_MEMBER( cdi );
@@ -278,8 +278,8 @@ MACHINE_RESET_MEMBER(cdi_state,quizrd34)
m_scc->set_quizard_mcu_ack(0x58);
}
-/* Untested - copied from quizrr41 */
-MACHINE_RESET_MEMBER(cdi_state,quizrr40)
+/* Untested - copied from quizard4r41 */
+MACHINE_RESET_MEMBER(cdi_state,quizard4r40)
{
MACHINE_RESET_CALL_MEMBER( cdi );
@@ -288,7 +288,7 @@ MACHINE_RESET_MEMBER(cdi_state,quizrr40)
m_scc->set_quizard_mcu_ack(0x57);
}
-MACHINE_RESET_MEMBER(cdi_state,quizrr41)
+MACHINE_RESET_MEMBER(cdi_state,quizard4r41)
{
MACHINE_RESET_CALL_MEMBER( cdi );
@@ -297,7 +297,7 @@ MACHINE_RESET_MEMBER(cdi_state,quizrr41)
m_scc->set_quizard_mcu_ack(0x57);
}
-MACHINE_RESET_MEMBER(cdi_state,quizrr42)
+MACHINE_RESET_MEMBER(cdi_state,quizard4r42)
{
MACHINE_RESET_CALL_MEMBER( cdi );
@@ -373,44 +373,44 @@ static MACHINE_CONFIG_DERIVED( quizard, cdi_base )
MCFG_CPU_VBLANK_INT_DRIVER("screen", cdi_state, mcu_frame)
MACHINE_CONFIG_END
-static MACHINE_CONFIG_DERIVED( quizrd12, quizard )
- MCFG_MACHINE_RESET_OVERRIDE(cdi_state, quizrd12 )
+static MACHINE_CONFIG_DERIVED( quizard12, quizard )
+ MCFG_MACHINE_RESET_OVERRIDE(cdi_state, quizard12 )
MACHINE_CONFIG_END
-static MACHINE_CONFIG_DERIVED( quizrd17, quizard )
- MCFG_MACHINE_RESET_OVERRIDE(cdi_state, quizrd17 )
+static MACHINE_CONFIG_DERIVED( quizard17, quizard )
+ MCFG_MACHINE_RESET_OVERRIDE(cdi_state, quizard17 )
MACHINE_CONFIG_END
-static MACHINE_CONFIG_DERIVED( quizrd18, quizard )
- MCFG_MACHINE_RESET_OVERRIDE(cdi_state, quizrd18 )
+static MACHINE_CONFIG_DERIVED( quizard18, quizard )
+ MCFG_MACHINE_RESET_OVERRIDE(cdi_state, quizard18 )
MACHINE_CONFIG_END
-static MACHINE_CONFIG_DERIVED( quizrd22, quizard )
- MCFG_MACHINE_RESET_OVERRIDE(cdi_state, quizrd22 )
+static MACHINE_CONFIG_DERIVED( quizard22, quizard )
+ MCFG_MACHINE_RESET_OVERRIDE(cdi_state, quizard22 )
MACHINE_CONFIG_END
-static MACHINE_CONFIG_DERIVED( quizrd23, quizard )
- MCFG_MACHINE_RESET_OVERRIDE(cdi_state, quizrd23 )
+static MACHINE_CONFIG_DERIVED( quizard23, quizard )
+ MCFG_MACHINE_RESET_OVERRIDE(cdi_state, quizard23 )
MACHINE_CONFIG_END
-static MACHINE_CONFIG_DERIVED( quizrd32, quizard )
- MCFG_MACHINE_RESET_OVERRIDE(cdi_state, quizrd32 )
+static MACHINE_CONFIG_DERIVED( quizard32, quizard )
+ MCFG_MACHINE_RESET_OVERRIDE(cdi_state, quizard32 )
MACHINE_CONFIG_END
-static MACHINE_CONFIG_DERIVED( quizrd34, quizard )
- MCFG_MACHINE_RESET_OVERRIDE(cdi_state, quizrd34 )
+static MACHINE_CONFIG_DERIVED( quizard3, quizard )
+ MCFG_MACHINE_RESET_OVERRIDE(cdi_state, quizard34 )
MACHINE_CONFIG_END
-static MACHINE_CONFIG_DERIVED( quizrr40, quizard )
- MCFG_MACHINE_RESET_OVERRIDE(cdi_state, quizrr40 )
+static MACHINE_CONFIG_DERIVED( quizard4r40, quizard )
+ MCFG_MACHINE_RESET_OVERRIDE(cdi_state, quizard4r40 )
MACHINE_CONFIG_END
-static MACHINE_CONFIG_DERIVED( quizrr41, quizard )
- MCFG_MACHINE_RESET_OVERRIDE(cdi_state, quizrr41 )
+static MACHINE_CONFIG_DERIVED( quizard4r41, quizard )
+ MCFG_MACHINE_RESET_OVERRIDE(cdi_state, quizard4r41 )
MACHINE_CONFIG_END
-static MACHINE_CONFIG_DERIVED( quizrr42, quizard )
- MCFG_MACHINE_RESET_OVERRIDE(cdi_state, quizrr42 )
+static MACHINE_CONFIG_DERIVED( quizard4r42, quizard )
+ MCFG_MACHINE_RESET_OVERRIDE(cdi_state, quizard4r42 )
MACHINE_CONFIG_END
@@ -460,7 +460,10 @@ ROM_START( cdibios )
ROM_REGION(0x2000, "slave", 0)
ROM_LOAD( "slave.bin", 0x0000, 0x2000, NO_DUMP ) // Undumped 68HC05 microcontroller, might need decapping
ROM_END
-ROM_START( quizard )
+
+// Quizard
+
+ROM_START( quizard ) /* CD-ROM printed ??/?? */
ROM_REGION(0x80000, "maincpu", 0)
ROM_LOAD( "cdi220b.rom", 0x000000, 0x80000, CRC(279683ca) SHA1(53360a1f21ddac952e95306ced64186a3fc0b93e) )
@@ -471,10 +474,10 @@ ROM_START( quizard )
ROM_LOAD( "slave.bin", 0x0000, 0x2000, NO_DUMP ) // Undumped 68HC05 microcontroller, might need decapping
DISK_REGION( "cdrom" )
- DISK_IMAGE_READONLY( "quizrd32", 0, BAD_DUMP SHA1(31e9fa2169aa44d799c37170b238134ab738e1a1) )
+ DISK_IMAGE_READONLY( "quizard18", 0, BAD_DUMP SHA1(ede873b22957f2a707bbd3039e962ef2ca5aedbd) )
ROM_END
-ROM_START( quizrd22 )
+ROM_START( quizard_17 )
ROM_REGION(0x80000, "maincpu", 0)
ROM_LOAD( "cdi220b.rom", 0x000000, 0x80000, CRC(279683ca) SHA1(53360a1f21ddac952e95306ced64186a3fc0b93e) )
@@ -485,10 +488,10 @@ ROM_START( quizrd22 )
ROM_LOAD( "slave.bin", 0x0000, 0x2000, NO_DUMP ) // Undumped 68HC05 microcontroller, might need decapping
DISK_REGION( "cdrom" )
- DISK_IMAGE_READONLY( "quizrd22", 0, BAD_DUMP SHA1(03c8fdcf27ead6e221691111e8c679b551099543) )
+ DISK_IMAGE_READONLY( "quizard17", 0, BAD_DUMP SHA1(4bd698f076505b4e17be978481bce027eb47123b) )
ROM_END
-ROM_START( quizrd17 )
+ROM_START( quizard_12 ) /* CD-ROM printed 01/95 */
ROM_REGION(0x80000, "maincpu", 0)
ROM_LOAD( "cdi220b.rom", 0x000000, 0x80000, CRC(279683ca) SHA1(53360a1f21ddac952e95306ced64186a3fc0b93e) )
@@ -499,10 +502,10 @@ ROM_START( quizrd17 )
ROM_LOAD( "slave.bin", 0x0000, 0x2000, NO_DUMP ) // Undumped 68HC05 microcontroller, might need decapping
DISK_REGION( "cdrom" )
- DISK_IMAGE_READONLY( "quizrd17", 0, BAD_DUMP SHA1(4bd698f076505b4e17be978481bce027eb47123b) )
+ DISK_IMAGE_READONLY( "quizard12", 0, BAD_DUMP SHA1(6e41683b96b74e903040842aeb18437ad7813c82) )
ROM_END
-ROM_START( quizrd12 ) /* CD-ROM printed 01/95 */
+ROM_START( quizard_10 )
ROM_REGION(0x80000, "maincpu", 0)
ROM_LOAD( "cdi220b.rom", 0x000000, 0x80000, CRC(279683ca) SHA1(53360a1f21ddac952e95306ced64186a3fc0b93e) )
@@ -512,11 +515,17 @@ ROM_START( quizrd12 ) /* CD-ROM printed 01/95 */
ROM_REGION(0x2000, "slave", 0)
ROM_LOAD( "slave.bin", 0x0000, 0x2000, NO_DUMP ) // Undumped 68HC05 microcontroller, might need decapping
+
+ // software: BurnAtOnce 0.99.5 / CHDMAN 0.163
+ // Drive: TS-L633R
DISK_REGION( "cdrom" )
- DISK_IMAGE_READONLY( "quizrd12", 0, BAD_DUMP SHA1(6e41683b96b74e903040842aeb18437ad7813c82) )
+ DISK_IMAGE_READONLY( "quizard10", 0, SHA1(5715db50f0d5ffe06f47c0943f4bf0481ab6048e) )
ROM_END
-ROM_START( quizrd18 ) /* CD-ROM printed ??/?? */
+
+// Quizard 2
+
+ROM_START( quizard2 ) /* CD-ROM printed ??/?? */
ROM_REGION(0x80000, "maincpu", 0)
ROM_LOAD( "cdi220b.rom", 0x000000, 0x80000, CRC(279683ca) SHA1(53360a1f21ddac952e95306ced64186a3fc0b93e) )
@@ -527,10 +536,10 @@ ROM_START( quizrd18 ) /* CD-ROM printed ??/?? */
ROM_LOAD( "slave.bin", 0x0000, 0x2000, NO_DUMP ) // Undumped 68HC05 microcontroller, might need decapping
DISK_REGION( "cdrom" )
- DISK_IMAGE_READONLY( "quizrd18", 0, BAD_DUMP SHA1(ede873b22957f2a707bbd3039e962ef2ca5aedbd) )
+ DISK_IMAGE_READONLY( "quizard23", 0, BAD_DUMP SHA1(cd909d9a54275d6f2d36e03e83eea996e781b4d3) )
ROM_END
-ROM_START( quizrd23 ) /* CD-ROM printed ??/?? */
+ROM_START( quizard2_22 )
ROM_REGION(0x80000, "maincpu", 0)
ROM_LOAD( "cdi220b.rom", 0x000000, 0x80000, CRC(279683ca) SHA1(53360a1f21ddac952e95306ced64186a3fc0b93e) )
@@ -541,10 +550,12 @@ ROM_START( quizrd23 ) /* CD-ROM printed ??/?? */
ROM_LOAD( "slave.bin", 0x0000, 0x2000, NO_DUMP ) // Undumped 68HC05 microcontroller, might need decapping
DISK_REGION( "cdrom" )
- DISK_IMAGE_READONLY( "quizrd23", 0, BAD_DUMP SHA1(cd909d9a54275d6f2d36e03e83eea996e781b4d3) )
+ DISK_IMAGE_READONLY( "quizard22", 0, BAD_DUMP SHA1(03c8fdcf27ead6e221691111e8c679b551099543) )
ROM_END
-ROM_START( quizrd34 ) /* CD-ROM printed ??/?? */
+// Quizard 3
+
+ROM_START( quizard3 ) /* CD-ROM printed ??/?? */
ROM_REGION(0x80000, "maincpu", 0)
ROM_LOAD( "cdi220b.rom", 0x000000, 0x80000, CRC(279683ca) SHA1(53360a1f21ddac952e95306ced64186a3fc0b93e) )
@@ -555,10 +566,10 @@ ROM_START( quizrd34 ) /* CD-ROM printed ??/?? */
ROM_LOAD( "slave.bin", 0x0000, 0x2000, NO_DUMP ) // Undumped 68HC05 microcontroller, might need decapping
DISK_REGION( "cdrom" )
- DISK_IMAGE_READONLY( "quizrd34", 0, BAD_DUMP SHA1(37ad49b72b5175afbb87141d57bc8604347fe032) )
+ DISK_IMAGE_READONLY( "quizard34", 0, BAD_DUMP SHA1(37ad49b72b5175afbb87141d57bc8604347fe032) )
ROM_END
-ROM_START( quizrr42 ) /* CD-ROM printed 09/98 */
+ROM_START( quizard3_32 )
ROM_REGION(0x80000, "maincpu", 0)
ROM_LOAD( "cdi220b.rom", 0x000000, 0x80000, CRC(279683ca) SHA1(53360a1f21ddac952e95306ced64186a3fc0b93e) )
@@ -569,10 +580,11 @@ ROM_START( quizrr42 ) /* CD-ROM printed 09/98 */
ROM_LOAD( "slave.bin", 0x0000, 0x2000, NO_DUMP ) // Undumped 68HC05 microcontroller, might need decapping
DISK_REGION( "cdrom" )
- DISK_IMAGE_READONLY( "quizrr42", 0, BAD_DUMP SHA1(a5d5c8950b4650b8753f9119dc7f1ccaa2aa5442) )
+ DISK_IMAGE_READONLY( "quizard32", 0, BAD_DUMP SHA1(31e9fa2169aa44d799c37170b238134ab738e1a1) )
ROM_END
-ROM_START( quizrr41 )
+
+ROM_START( quizard4 ) /* CD-ROM printed 09/98 */
ROM_REGION(0x80000, "maincpu", 0)
ROM_LOAD( "cdi220b.rom", 0x000000, 0x80000, CRC(279683ca) SHA1(53360a1f21ddac952e95306ced64186a3fc0b93e) )
@@ -583,10 +595,10 @@ ROM_START( quizrr41 )
ROM_LOAD( "slave.bin", 0x0000, 0x2000, NO_DUMP ) // Undumped 68HC05 microcontroller, might need decapping
DISK_REGION( "cdrom" )
- DISK_IMAGE_READONLY( "quizrr41", 0, BAD_DUMP SHA1(2c0484c6545aac8e00b318328c6edce6f5dde43d) )
+ DISK_IMAGE_READONLY( "quizard4r42", 0, BAD_DUMP SHA1(a5d5c8950b4650b8753f9119dc7f1ccaa2aa5442) )
ROM_END
-ROM_START( quizrr40 ) /* CD-ROM printed 07/97 */
+ROM_START( quizard4_41 )
ROM_REGION(0x80000, "maincpu", 0)
ROM_LOAD( "cdi220b.rom", 0x000000, 0x80000, CRC(279683ca) SHA1(53360a1f21ddac952e95306ced64186a3fc0b93e) )
@@ -597,7 +609,21 @@ ROM_START( quizrr40 ) /* CD-ROM printed 07/97 */
ROM_LOAD( "slave.bin", 0x0000, 0x2000, NO_DUMP ) // Undumped 68HC05 microcontroller, might need decapping
DISK_REGION( "cdrom" )
- DISK_IMAGE_READONLY( "quizrr40", 0, BAD_DUMP SHA1(288cc37a994e4f1cbd47aa8c92342879c6fc0b87) )
+ DISK_IMAGE_READONLY( "quizard4r41", 0, BAD_DUMP SHA1(2c0484c6545aac8e00b318328c6edce6f5dde43d) )
+ROM_END
+
+ROM_START( quizard4_40 ) /* CD-ROM printed 07/97 */
+ ROM_REGION(0x80000, "maincpu", 0)
+ ROM_LOAD( "cdi220b.rom", 0x000000, 0x80000, CRC(279683ca) SHA1(53360a1f21ddac952e95306ced64186a3fc0b93e) )
+
+ ROM_REGION(0x2000, "cdic", 0)
+ ROM_LOAD( "cdic.bin", 0x0000, 0x2000, NO_DUMP ) // Undumped 68HC05 microcontroller, might need decapping
+
+ ROM_REGION(0x2000, "slave", 0)
+ ROM_LOAD( "slave.bin", 0x0000, 0x2000, NO_DUMP ) // Undumped 68HC05 microcontroller, might need decapping
+
+ DISK_REGION( "cdrom" )
+ DISK_IMAGE_READONLY( "quizard4r40", 0, BAD_DUMP SHA1(288cc37a994e4f1cbd47aa8c92342879c6fc0b87) )
ROM_END
@@ -611,17 +637,18 @@ CONS( 1991, cdimono1, 0, 0, cdimono1, cdi, driver_device, 0,
// The Quizard games are RETAIL CD-i units, with additional JAMMA adapters & dongles for protection, hence being 'clones' of the system.
GAME( 1995, cdibios, 0, cdi_base, quizard, driver_device, 0, ROT0, "Philips", "CD-i Bios", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_IS_BIOS_ROOT )
-// Working
-GAME( 1995, quizrd12, cdibios, quizrd12, quizard, driver_device, 0, ROT0, "TAB Austria", "Quizard 1.2", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION )
-GAME( 1995, quizrd17, cdibios, quizrd17, quizard, driver_device, 0, ROT0, "TAB Austria", "Quizard 1.7", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION )
-GAME( 1995, quizrd22, cdibios, quizrd22, quizard, driver_device, 0, ROT0, "TAB Austria", "Quizard 2.2", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION )
-
-GAME( 1995, quizrd18, cdibios, quizrd18, quizard, driver_device, 0, ROT0, "TAB Austria", "Quizard 1.8", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION )
-GAME( 1995, quizrd23, cdibios, quizrd23, quizard, driver_device, 0, ROT0, "TAB Austria", "Quizard 2.3", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION )
-GAME( 1995, quizrd34, cdibios, quizrd34, quizard, driver_device, 0, ROT0, "TAB Austria", "Quizard 3.4", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION )
-
-// Partially working
-GAME( 1996, quizard, cdibios, quizrd32, quizard, driver_device, 0, ROT0, "TAB Austria", "Quizard 3.2", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION )
-GAME( 1997, quizrr40, cdibios, quizrr40, quizard, driver_device, 0, ROT0, "TAB Austria", "Quizard Rainbow 4.0", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION )
-GAME( 1998, quizrr41, cdibios, quizrr41, quizard, driver_device, 0, ROT0, "TAB Austria", "Quizard Rainbow 4.1", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION )
-GAME( 1998, quizrr42, cdibios, quizrr42, quizard, driver_device, 0, ROT0, "TAB Austria", "Quizard Rainbow 4.2", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION )
+
+GAME( 1995, quizard, cdibios, quizard18, quizard, driver_device, 0, ROT0, "TAB Austria", "Quizard (v1.8)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION )
+GAME( 1995, quizard_17, quizard, quizard17, quizard, driver_device, 0, ROT0, "TAB Austria", "Quizard (v1.7)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION )
+GAME( 1995, quizard_12, quizard, quizard12, quizard, driver_device, 0, ROT0, "TAB Austria", "Quizard (v1.2)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION )
+GAME( 1995, quizard_10, quizard, quizard12, quizard, driver_device, 0, ROT0, "TAB Austria", "Quizard (v1.0)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION )
+
+GAME( 1995, quizard2, cdibios, quizard23, quizard, driver_device, 0, ROT0, "TAB Austria", "Quizard 2 (v2.3)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION )
+GAME( 1995, quizard2_22, quizard2, quizard22, quizard, driver_device, 0, ROT0, "TAB Austria", "Quizard 2 (v2.2)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION )
+
+GAME( 1995, quizard3, cdibios, quizard3, quizard, driver_device, 0, ROT0, "TAB Austria", "Quizard 3 (v3.4)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION )
+GAME( 1996, quizard3_32, quizard3, quizard32, quizard, driver_device, 0, ROT0, "TAB Austria", "Quizard 3 (v3.2)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION )
+
+GAME( 1998, quizard4, cdibios, quizard4r42, quizard, driver_device, 0, ROT0, "TAB Austria", "Quizard 4 Rainbow (v4.2)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION ) // doesn't boot
+GAME( 1998, quizard4_41, quizard4, quizard4r41, quizard, driver_device, 0, ROT0, "TAB Austria", "Quizard 4 Rainbow (v4.1)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION )
+GAME( 1997, quizard4_40, quizard4, quizard4r40, quizard, driver_device, 0, ROT0, "TAB Austria", "Quizard 4 Rainbow (v4.0)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION )
diff --git a/src/mame/drivers/cheekyms.c b/src/mame/drivers/cheekyms.c
index a0aadecb296..6b155075488 100644
--- a/src/mame/drivers/cheekyms.c
+++ b/src/mame/drivers/cheekyms.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Lee Taylor, Chris Moore
/*************************************************************************
Universal Cheeky Mouse Driver
diff --git a/src/mame/drivers/chihiro.c b/src/mame/drivers/chihiro.c
index 1fe778e3726..cc9fe4c26b6 100644
--- a/src/mame/drivers/chihiro.c
+++ b/src/mame/drivers/chihiro.c
@@ -13,9 +13,9 @@ Games on this system include....
|*| 2003 | Crazy Taxi High Roller (Rev B) | Sega / Hitmaker | GDROM | GDX-0002B | 317-0353-COM |
| | 2003 | Virtua Cop 3 | Sega | GDROM | GDX-0003 | 317-0354-COM |
|*| 2003 | Virtua Cop 3 (Rev A) | Sega | GDROM | GDX-0003A | 317-0354-COM |
-| | 2003 | Out Run 2 | Sega | GDROM | GDX-0004 | 317-0372-COM |
-|*| 2003 | Out Run 2 (Rev A) | Sega | GDROM | GDX-0004A | 317-0372-COM |
-| | 2003 | Out Run 2 prototype (Rev P) | Sega | GDROM | GDX-0004P | |
+| | 2003 | OutRun 2 | Sega | GDROM | GDX-0004 | 317-0372-COM |
+|*| 2003 | OutRun 2 (Rev A) | Sega | GDROM | GDX-0004A | 317-0372-COM |
+| | 2003 | OutRun 2 prototype (Rev P ) | Sega | GDROM | GDX-0004P | |
| | 2004 | Sega Golf Club Network Pro Tour | Sega | GDROM | GDX-0005 | |
| | 2004 | Sega Network Taisen Mahjong MJ 2 | Sega | GDROM | GDX-0006 | |
| | 2004 | Sega Network Taisen Mahjong MJ 2 (Rev A) | Sega | GDROM | GDX-0006A | |
@@ -32,15 +32,15 @@ Games on this system include....
| | 2004 | Wangan Midnight Maximum Tune (Export) | Namco | GDROM | GDX-0009 | 317-5101-COM |
| | 2004 | Wangan Midnight Maximum Tune (Export) (Rev A) | Namco | GDROM | GDX-0009A | 317-5101-COM |
|*| 2004 | Wangan Midnight Maximum Tune (Export) (Rev B) | Namco | GDROM | GDX-0009B | 317-5101-COM |
-| | 2004 | Outrun 2 SP (Japan) | Sega | GDROM | GDX-0011 | |
+| | 2004 | OutRun 2 SP (Japan) | Sega | GDROM | GDX-0011 | |
|*| 2004 | Ghost Squad | Sega | GDROM | GDX-0012 | 317-0398-COM |
|*| 2004 | Ghost Squad (Rev A) | Sega | GDROM | GDX-0012A | 317-0398-COM |
|*| 2005 | Gundam Battle Operating Simulator | Banpresto | GDROM | GDX-0013 | 317-0400-JPN |
-| | 2004 | Outrun 2 Special Tours | Sega | GDROM | GDX-0014 | 317-0xxx-COM |
-|*| 2004 | Outrun 2 Special Tours (Rev A) | Sega | GDROM | GDX-0014A | 317-0xxx-COM |
+| | 2004 | OutRun 2 Special Tours | Sega | GDROM | GDX-0014 | 317-0xxx-COM |
+|*| 2004 | OutRun 2 Special Tours (Rev A) | Sega | GDROM | GDX-0014A | 317-0xxx-COM |
|*| 2005 | Wangan Midnight Maximum Tune 2 (Japan) | Namco | GDROM | GDX-0015 | 317-5106-JPN |
-|*| 2005 | Wangan Midnight Maximum Tune 2 (Japan) (Rev A) | Namco | GDROM | GDX-0015A | 317-5106-JPN |
-|*| 2005 | Wangan Midnight Maximum Tune 2 (Export) | Namco | GDROM | GDX-0016 | 317-5106-COM |
+| | 2005 | Wangan Midnight Maximum Tune 2 (Export) | Namco | GDROM | GDX-0016 | 317-5106-COM |
+|*| 2005 | Wangan Midnight Maximum Tune 2 (Export) | Namco | GDROM | GDX-0016A | 317-5106-COM |
| | 2005 | Sega Network Taisen Mahjong MJ 3 | Sega | GDROM | GDX-0017 | 317-0414-JPN |
| | 2005 | Sega Network Taisen Mahjong MJ 3 (Rev A) | Sega | GDROM | GDX-0017A | 317-0414-JPN |
| | 2005 | Sega Network Taisen Mahjong MJ 3 (Rev B) | Sega | GDROM | GDX-0017B | 317-0414-JPN |
@@ -52,6 +52,7 @@ Games on this system include....
|*| 2005 | Sega Club Golf 2006: Next Tours (Rev A) | Sega | GDROM | GDX-0018A | |
| | 2006 | Sega Network Taisen Mahjong MJ 3 Evolution | Sega | GDROM | GDX-0021 | |
| | 2006 | Sega Network Taisen Mahjong MJ 3 Evolution (Rev A) | Sega | GDROM | GDX-0021A | |
+|*| 2007 | Sega Network Taisen Mahjong MJ 3 Evolution (Rev B) | Sega | GDROM | GDX-0021B | |
| | 2009 | Firmware Update For Compact Flash Box | Sega | GDROM | GDX-0024 | |
|*| 2009 | Firmware Update For Compact Flash Box (Rev A) | Sega | GDROM | GDX-0024A | 317-0567-EXP |
|*| 2004 | Quest Of D (Ver.1.01C) | Sega | CDROM | CDV-10005C | |
@@ -197,6 +198,9 @@ XBox Board
Notes:
* These parts located on the other side of the PCB
Some of the connectors are not used.
+ GAME1/2 - Connected to CN1 on Base Board. JST Part Number B12B-PHDSS
+ GAME3/4 - Connected to CN1 on Base Board. JST Part Number B12B-PHDSS
+ FRONT_PANEL - Connected to CN1 on Base Board. JST Part Number B10B-PHDSS
Base Board
@@ -376,6 +380,204 @@ Thanks to Alex, Mr Mudkips, and Philip Burke for this info.
#define LOG_PCI
//#define LOG_OHCI
//#define LOG_BASEBOARD
+//#define USB_ENABLED
+
+struct OHCIEndpointDescriptor {
+ int mps; // MaximumPacketSize
+ int f; // Format
+ int k; // sKip
+ int s; // Speed
+ int d; // Direction
+ int en; // EndpointNumber
+ int fa; // FunctionAddress
+ UINT32 tailp; // TDQueueTailPointer
+ UINT32 headp; // TDQueueHeadPointer
+ UINT32 nexted; // NextED
+ int c; // toggleCarry
+ int h; // Halted
+ UINT32 word0;
+};
+
+struct OHCITransferDescriptor {
+ int cc; // ConditionCode
+ int ec; // ErrorCount
+ int t; // DataToggle
+ int di; // DelayInterrupt
+ int dp; // Direction/PID
+ int r; // bufferRounding
+ UINT32 cbp; // CurrentBufferPointer
+ UINT32 nexttd; // NextTD
+ UINT32 be; // BufferEnd
+ UINT32 word0;
+};
+
+struct OHCIIsochronousTransferDescriptor {
+ int cc; // ConditionCode
+ int fc; // FrameCount
+ int di; // DelayInterrupt
+ int sf; // StartingFrame
+ UINT32 bp0; // BufferPage0
+ UINT32 nexttd; // NextTD
+ UINT32 be; // BufferEnd
+ UINT32 offset[8]; // Offset/PacketStatusWord
+};
+
+enum OHCIRegisters {
+ HcRevision=0,
+ HcControl,
+ HcCommandStatus,
+ HcInterruptStatus,
+ HcInterruptEnable,
+ HcInterruptDisable,
+ HcHCCA,
+ HcPeriodCurrentED,
+ HcControlHeadED,
+ HcControlCurrentED,
+ HcBulkHeadED,
+ HcBulkCurrentED,
+ HcDoneHead,
+ HcFmInterval,
+ HcFmRemaining,
+ HcFmNumber,
+ HcPeriodicStart,
+ HcLSThreshold,
+ HcRhDescriptorA,
+ HcRhDescriptorB,
+ HcRhStatus,
+ HcRhPortStatus1
+};
+
+enum OHCIHostControllerFunctionalState {
+ UsbReset=0,
+ UsbResume,
+ UsbOperational,
+ UsbSuspend
+};
+
+enum OHCIInterrupt {
+ SchedulingOverrun=1,
+ WritebackDoneHead=2,
+ StartofFrame=4,
+ ResumeDetected=8,
+ UnrecoverableError=16,
+ FrameNumberOverflow=32,
+ RootHubStatusChange=64,
+ OwnershipChange=0x40000000,
+ MasterInterruptEnable=0x80000000
+};
+
+enum OHCICompletionCode {
+ NoError=0,
+ CRC,
+ BitStuffing,
+ DataToggleMismatch,
+ Stall,
+ DeviceNotResponding,
+ PIDCheckFailure,
+ UnexpectedPID,
+ DataOverrun,
+ DataUnderrun,
+ BufferOverrun=12,
+ BufferUnderrun,
+ NotAccessed=14
+};
+
+struct USBSetupPacket {
+ UINT8 bmRequestType;
+ UINT8 bRequest;
+ UINT16 wValue;
+ UINT16 wIndex;
+ UINT16 wLength;
+};
+
+struct USBStandardDeviceDscriptor {
+ UINT8 bLength;
+ UINT8 bDescriptorType;
+ UINT16 bcdUSB;
+ UINT8 bDeviceClass;
+ UINT8 bDeviceSubClass;
+ UINT8 bDeviceProtocol;
+ UINT8 bMaxPacketSize0;
+ UINT16 idVendor;
+ UINT16 idProduct;
+ UINT16 bcdDevice;
+ UINT8 iManufacturer;
+ UINT8 iProduct;
+ UINT8 iSerialNumber;
+ UINT8 bNumConfigurations;
+};
+
+struct USBStandardConfigurationDescriptor {
+ UINT8 bLength;
+ UINT8 bDescriptorType;
+ UINT16 wTotalLength;
+ UINT8 bNumInterfaces;
+ UINT8 bConfigurationValue;
+ UINT8 iConfiguration;
+ UINT8 bmAttributes;
+ UINT8 MaxPower;
+};
+
+struct USBStandardInterfaceDescriptor {
+ UINT8 bLength;
+ UINT8 bDescriptorType;
+ UINT8 bInterfaceNumber;
+ UINT8 bAlternateSetting;
+ UINT8 bNumEndpoints;
+ UINT8 bInterfaceClass;
+ UINT8 bInterfaceSubClass;
+ UINT8 bInterfaceProtocol;
+ UINT8 iInterface;
+};
+
+struct USBStandardEndpointDescriptor {
+ UINT8 bLength;
+ UINT8 bDescriptorType;
+ UINT8 bEndpointAddress;
+ UINT8 bmAttributes;
+ UINT16 wMaxPacketSize;
+ UINT8 bInterval;
+};
+
+enum USBPid {
+ SetupPid=0,
+ OutPid,
+ InPid
+};
+
+enum USBRequestCode {
+ GET_STATUS=0,
+ CLEAR_FEATURE=1,
+ SET_FEATURE=3,
+ SET_ADDRESS=5,
+ GET_DESCRIPTOR=6,
+ SET_DESCRIPTOR=7,
+ GET_CONFIGURATION=8,
+ SET_CONFIGURATION=9,
+ GET_INTERFACE=10,
+ SET_INTERFACE=11,
+ SYNCH_FRAME=12
+};
+
+enum USBDescriptorType {
+ DEVICE=1,
+ CONFIGURATION=2,
+ STRING=3,
+ INTERFACE=4,
+ ENDPOINT=5
+};
+
+class ohci_function_device {
+public:
+ ohci_function_device();
+ void execute_reset();
+ int execute_transfer(int address, int endpoint, int pid, UINT8 *buffer, int size);
+private:
+ int address;
+ int controldir;
+ int remain;
+ UINT8 *position;
+};
class chihiro_state : public driver_device
{
@@ -410,6 +612,13 @@ public:
int smbus_pic16lc(int command, int rw, int data);
int smbus_cx25871(int command, int rw, int data);
int smbus_eeprom(int command, int rw, int data);
+ void usb_ohci_plug(int port, ohci_function_device *function);
+ void usb_ohci_interrupts();
+ void usb_ohci_read_endpoint_descriptor(UINT32 address);
+ void usb_ohci_writeback_endpoint_descriptor(UINT32 address);
+ void usb_ohci_read_transfer_descriptor(UINT32 address);
+ void usb_ohci_writeback_transfer_descriptor(UINT32 address);
+ void usb_ohci_read_isochronous_transfer_descriptor(UINT32 address);
void baseboard_ide_event(int type, UINT8 *read, UINT8 *write);
UINT8 *baseboard_ide_dimmboard(UINT32 lba);
void dword_write_le(UINT8 *addr, UINT32 d);
@@ -426,6 +635,7 @@ public:
DECLARE_WRITE_LINE_MEMBER(chihiro_pit8254_out2_changed);
IRQ_CALLBACK_MEMBER(irq_callback);
TIMER_CALLBACK_MEMBER(audio_apu_timer);
+ TIMER_CALLBACK_MEMBER(usb_ohci_timer);
struct chihiro_devices {
pic8259_device *pic8259_1;
@@ -468,6 +678,25 @@ public:
UINT32 mixer_regs[0x80 / 4];
UINT32 controller_regs[0x38 / 4];
} ac97st;
+ struct ohci_state {
+ UINT32 hc_regs[255];
+ struct {
+ ohci_function_device *function;
+ int delay;
+ } ports[4 + 1];
+ emu_timer *timer;
+ int state;
+ UINT32 framenumber;
+ UINT32 nextinterupted;
+ UINT32 nextbulked;
+ int interruptbulkratio;
+ int writebackdonehadcounter;
+ address_space *space;
+ UINT8 buffer[1024];
+ OHCIEndpointDescriptor endpoint_descriptor;
+ OHCITransferDescriptor transfer_descriptor;
+ OHCIIsochronousTransferDescriptor isochronous_transfer_descriptor;
+ } ohcist;
UINT8 pic16lc_buffer[0xff];
nv2a_renderer *nvidia_nv2a;
bool debug_irq_active;
@@ -721,6 +950,62 @@ static void dump_list_command(running_machine &machine, int ref, int params, con
}
}
+static void dump_dpc_command(running_machine &machine, int ref, int params, const char **param)
+{
+ chihiro_state *state = machine.driver_data<chihiro_state>();
+ address_space &space = state->m_maincpu->space();
+ UINT64 addr;
+ offs_t address;
+
+ if (params < 1)
+ return;
+ if (!debug_command_parameter_number(machine, param[0], &addr))
+ return;
+ address = (offs_t)addr;
+ if (!debug_cpu_translate(space, TRANSLATE_READ_DEBUG, &address))
+ {
+ debug_console_printf(machine, "Address is unmapped.\n");
+ return;
+ }
+ debug_console_printf(machine, "Type %d word\n", space.read_word_unaligned(address));
+ debug_console_printf(machine, "Inserted %d byte\n", space.read_byte(address + 2));
+ debug_console_printf(machine, "Padding %d byte\n", space.read_byte(address + 3));
+ debug_console_printf(machine, "DpcListEntry {%08X,%08X} _LIST_ENTRY\n", space.read_dword_unaligned(address + 4), space.read_dword_unaligned(address + 8));
+ debug_console_printf(machine, "DeferredRoutine %08X dword\n", space.read_dword_unaligned(address + 12));
+ debug_console_printf(machine, "DeferredContext %08X dword\n", space.read_dword_unaligned(address + 16));
+ debug_console_printf(machine, "SystemArgument1 %08X dword\n", space.read_dword_unaligned(address + 20));
+ debug_console_printf(machine, "SystemArgument2 %08X dword\n", space.read_dword_unaligned(address + 24));
+}
+
+static void dump_timer_command(running_machine &machine, int ref, int params, const char **param)
+{
+ chihiro_state *state = machine.driver_data<chihiro_state>();
+ address_space &space = state->m_maincpu->space();
+ UINT64 addr;
+ offs_t address;
+
+ if (params < 1)
+ return;
+ if (!debug_command_parameter_number(machine, param[0], &addr))
+ return;
+ address = (offs_t)addr;
+ if (!debug_cpu_translate(space, TRANSLATE_READ_DEBUG, &address))
+ {
+ debug_console_printf(machine, "Address is unmapped.\n");
+ return;
+ }
+ debug_console_printf(machine, "Header.Type %d byte\n", space.read_byte(address));
+ debug_console_printf(machine, "Header.Absolute %d byte\n", space.read_byte(address + 1));
+ debug_console_printf(machine, "Header.Size %d byte\n", space.read_byte(address + 2));
+ debug_console_printf(machine, "Header.Inserted %d byte\n", space.read_byte(address + 3));
+ debug_console_printf(machine, "Header.SignalState %08X dword\n", space.read_dword_unaligned(address + 4));
+ debug_console_printf(machine, "Header.WaitListEntry {%08X,%08X} _LIST_ENTRY\n", space.read_dword_unaligned(address + 8), space.read_dword_unaligned(address + 12));
+ debug_console_printf(machine, "DueTime %" I64FMT "x qword\n", (INT64)space.read_qword_unaligned(address + 16));
+ debug_console_printf(machine, "TimerListEntry {%08X,%08X} _LIST_ENTRY\n", space.read_dword_unaligned(address + 24), space.read_dword_unaligned(address + 28));
+ debug_console_printf(machine, "Dpc %08X dword\n", space.read_dword_unaligned(address + 32));
+ debug_console_printf(machine, "Period %d dword\n", space.read_dword_unaligned(address + 36));
+}
+
static void curthread_command(running_machine &machine, int ref, int params, const char **param)
{
chihiro_state *state = machine.driver_data<chihiro_state>();
@@ -878,6 +1163,8 @@ static void help_command(running_machine &machine, int ref, int params, const ch
debug_console_printf(machine, " chihiro dump_string,<address> -- Dump _STRING object at <address>\n");
debug_console_printf(machine, " chihiro dump_process,<address> -- Dump _PROCESS object at <address>\n");
debug_console_printf(machine, " chihiro dump_list,<address>[,<offset>] -- Dump _LIST_ENTRY chain starting at <address>\n");
+ debug_console_printf(machine, " chihiro dump_dpc,<address> -- Dump _KDPC object at <address>\n");
+ debug_console_printf(machine, " chihiro dump_timer,<address> -- Dump _KTIMER object at <address>\n");
debug_console_printf(machine, " chihiro curthread -- Print information about current thread\n");
debug_console_printf(machine, " chihiro irq,<number> -- Generate interrupt with irq number 0-15\n");
debug_console_printf(machine, " chihiro nv2a_combiners -- Toggle use of register combiners\n");
@@ -900,6 +1187,10 @@ static void chihiro_debug_commands(running_machine &machine, int ref, int params
dump_process_command(machine, ref, params - 1, param + 1);
else if (strcmp("dump_list", param[0]) == 0)
dump_list_command(machine, ref, params - 1, param + 1);
+ else if (strcmp("dump_dpc", param[0]) == 0)
+ dump_dpc_command(machine, ref, params - 1, param + 1);
+ else if (strcmp("dump_timer", param[0]) == 0)
+ dump_timer_command(machine, ref, params - 1, param + 1);
else if (strcmp("curthread", param[0]) == 0)
curthread_command(machine, ref, params - 1, param + 1);
else if (strcmp("irq", param[0]) == 0)
@@ -1022,7 +1313,7 @@ static void geforce_pci_w(device_t *busdevice, device_t *device, int function, i
}
/*
- * ohci usb controller placeholder
+ * ohci usb controller (placeholder for now)
*/
#ifdef LOG_OHCI
@@ -1063,9 +1354,20 @@ static const struct {
READ32_MEMBER(chihiro_state::usbctrl_r)
{
- int a, p;
+ UINT32 ret;
+#ifdef LOG_OHCI
+ if (offset >= 0x54 / 4)
+ logerror("usb controller 0 register HcRhPortStatus[%d] read\n", (offset - 0x54 / 4) + 1);
+ else
+ logerror("usb controller 0 register %s read\n", usbregnames[offset]);
+#endif
+ ret=ohcist.hc_regs[offset];
if (offset == 0) { /* hacks needed until usb (and jvs) is implemented */
+#ifdef USB_ENABLED
+#else
+ int p;
+
if (usbhack_counter == 0)
p = 0;
else if (usbhack_counter == 1) // after game loaded
@@ -1073,31 +1375,462 @@ READ32_MEMBER(chihiro_state::usbctrl_r)
else
p = -1;
if (p >= 0) {
- for (a = 0; a < 16; a++) {
+ for (int a = 0; a < 16; a++) {
if (hacks[p].modify[a].address == 0)
break;
m_maincpu->space(0).write_byte(hacks[p].modify[a].address, hacks[p].modify[a].write_byte);
}
}
usbhack_counter++;
- }
-#ifdef LOG_OHCI
- if (offset >= 0x54 / 4)
- logerror("usb controller 0 register HcRhPortStatus[%d] read\n", (offset - 0x54 / 4) + 1);
- else
- logerror("usb controller 0 register %s read\n", usbregnames[offset]);
#endif
- return 0;
+ }
+ return ret;
}
WRITE32_MEMBER(chihiro_state::usbctrl_w)
{
+#ifdef USB_ENABLED
+ UINT32 old = ohcist.hc_regs[offset];
+#endif
+
#ifdef LOG_OHCI
if (offset >= 0x54 / 4)
logerror("usb controller 0 register HcRhPortStatus[%d] write %08X\n", (offset - 0x54 / 4) + 1, data);
else
logerror("usb controller 0 register %s write %08X\n", usbregnames[offset], data);
#endif
+#ifdef USB_ENABLED
+ if (offset == HcRhStatus) {
+ if (data & 0x80000000)
+ ohcist.hc_regs[HcRhStatus] &= ~0x8000;
+ if (data & 0x00020000)
+ ohcist.hc_regs[HcRhStatus] &= ~0x0002;
+ if (data & 0x00010000)
+ ohcist.hc_regs[HcRhStatus] &= ~0x0001;
+ return;
+ }
+ if (offset == HcControl) {
+ int hcfs;
+
+ hcfs = (data >> 6) & 3;
+ if (hcfs == UsbOperational) {
+ ohcist.timer->enable();
+ ohcist.timer->adjust(attotime::from_msec(1), 0, attotime::from_msec(1));
+ ohcist.writebackdonehadcounter = 7;
+ }
+ else
+ ohcist.timer->enable(false);
+ ohcist.state = hcfs;
+ ohcist.interruptbulkratio = (data & 3) + 1;
+ }
+ if (offset == HcCommandStatus) {
+ if (data & 1)
+ ohcist.hc_regs[HcControl] |= 3 << 6;
+ ohcist.hc_regs[HcCommandStatus] |= data;
+ return;
+ }
+ if (offset == HcInterruptStatus) {
+ ohcist.hc_regs[HcInterruptStatus] &= ~data;
+ usb_ohci_interrupts();
+ return;
+ }
+ if (offset == HcInterruptEnable) {
+ ohcist.hc_regs[HcInterruptEnable] |= data;
+ usb_ohci_interrupts();
+ return;
+ }
+ if (offset == HcInterruptDisable) {
+ ohcist.hc_regs[HcInterruptEnable] &= ~data;
+ usb_ohci_interrupts();
+ return;
+ }
+ if (offset >= HcRhPortStatus1) {
+ int port = offset - HcRhPortStatus1 + 1; // port 0 not used
+ // bit 0 ClearPortEnable: 1 clears PortEnableStatus
+ // bit 1 SetPortEnable: 1 sets PortEnableStatus
+ // bit 2 SetPortSuspend: 1 sets PortSuspendStatus
+ // bit 3 ClearSuspendStatus: 1 clears PortSuspendStatus
+ // bit 4 SetPortReset: 1 sets PortResetStatus
+ if (data & 0x10) {
+ ohcist.hc_regs[offset] |= 0x10;
+ ohcist.ports[port].function->execute_reset();
+ // after 10ms set PortResetStatusChange and clear PortResetStatus and set PortEnableStatus
+ ohcist.ports[port].delay = 10;
+ }
+ // bit 8 SetPortPower: 1 sets PortPowerStatus
+ // bit 9 ClearPortPower: 1 clears PortPowerStatus
+ // bit 16 1 clears ConnectStatusChange
+ // bit 17 1 clears PortEnableStatusChange
+ // bit 18 1 clears PortSuspendStatusChange
+ // bit 19 1 clears PortOverCurrentIndicatorChange
+ // bit 20 1 clears PortResetStatusChange
+ if (ohcist.hc_regs[offset] != old)
+ ohcist.hc_regs[HcInterruptStatus] |= RootHubStatusChange;
+ usb_ohci_interrupts();
+ return;
+ }
+#endif
+ ohcist.hc_regs[offset] = data;
+}
+
+TIMER_CALLBACK_MEMBER(chihiro_state::usb_ohci_timer)
+{
+ UINT32 hcca;
+ int changed = 0;
+ int list = 1;
+ bool cont = false;
+ int pid, remain, mps;
+
+ hcca = ohcist.hc_regs[HcHCCA];
+ if (ohcist.state == UsbOperational) {
+ // increment frame number
+ ohcist.framenumber = (ohcist.framenumber + 1) & 0xffff;
+ ohcist.space->write_dword(hcca + 0x80, ohcist.framenumber);
+ ohcist.hc_regs[HcFmNumber] = ohcist.framenumber;
+ }
+ // port reset delay
+ for (int p = 1; p <= 4; p++) {
+ if (ohcist.ports[p].delay > 0) {
+ ohcist.ports[p].delay--;
+ if (ohcist.ports[p].delay == 0) {
+ ohcist.hc_regs[HcRhPortStatus1 + p - 1] = (ohcist.hc_regs[HcRhPortStatus1 + p - 1] & ~(1 << 4)) | (1 << 20) | (1 << 1); // bit 1 PortEnableStatus
+ changed = 1;
+ }
+ }
+ }
+ if (ohcist.state == UsbOperational) {
+ while (list >= 0)
+ {
+ // select list, do transfer
+ if (list == 0) {
+ if (ohcist.hc_regs[HcControl] & (1 << 2)) {
+ // periodic
+ if (ohcist.hc_regs[HcControl] & (1 << 3)) {
+ // isochronous
+ }
+ }
+ list = -1;
+ }
+ if (list == 1) {
+ // control
+ if (ohcist.hc_regs[HcControl] & (1 << 4)) {
+ cont = true;
+ while (cont == true) {
+ // if current endpoint descriptor is not 0 use it, otherwise ...
+ if (ohcist.hc_regs[HcControlCurrentED] == 0) {
+ // ... check the filled bit ...
+ if (ohcist.hc_regs[HcCommandStatus] & (1 << 1)) {
+ // ... if 1 start processing from the head of the list
+ ohcist.hc_regs[HcControlCurrentED] = ohcist.hc_regs[HcControlHeadED];
+ ohcist.hc_regs[HcCommandStatus] &= ~(1 << 1);
+ // but if the list is empty, go to the next list
+ if (ohcist.hc_regs[HcControlCurrentED] == 0)
+ cont = false;
+ }
+ else
+ cont = false;
+ }
+ if (cont == true) {
+ // service endpoint descriptor
+ usb_ohci_read_endpoint_descriptor(ohcist.hc_regs[HcControlCurrentED]);
+ // only if it is not halted and not to be skipped
+ if (!(ohcist.endpoint_descriptor.h | ohcist.endpoint_descriptor.k)) {
+ // compare the Endpoint Descriptor’s TailPointer and NextTransferDescriptor fields.
+ if (ohcist.endpoint_descriptor.headp != ohcist.endpoint_descriptor.tailp) {
+ UINT32 a, b;
+ // service transfer descriptor
+ usb_ohci_read_transfer_descriptor(ohcist.endpoint_descriptor.headp);
+ // get pid
+ if (ohcist.endpoint_descriptor.d == 1)
+ pid=OutPid; // out
+ else if (ohcist.endpoint_descriptor.d == 2)
+ pid=InPid; // in
+ else {
+ pid = ohcist.transfer_descriptor.dp; // 0 setup 1 out 2 in
+ }
+ // determine how much data to transfer
+ // setup pid must be 8 bytes
+ a = ohcist.transfer_descriptor.be & 0xfff;
+ b = ohcist.transfer_descriptor.cbp & 0xfff;
+ if ((ohcist.transfer_descriptor.be ^ ohcist.transfer_descriptor.cbp) & 0xfffff000)
+ a |= 0x1000;
+ remain = a - b + 1;
+ if (pid == InPid) {
+ mps = ohcist.endpoint_descriptor.mps;
+ if (remain < mps)
+ mps = remain;
+ }
+ else {
+ mps = ohcist.endpoint_descriptor.mps;
+ }
+ if (ohcist.transfer_descriptor.cbp == 0)
+ mps = 0;
+ b = ohcist.transfer_descriptor.cbp;
+ // if sending ...
+ if (pid != InPid) {
+ // ... get mps bytes
+ for (int c = 0; c < mps; c++) {
+ ohcist.buffer[c] = ohcist.space->read_byte(b);
+ b++;
+ if ((b & 0xfff) == 0)
+ b = ohcist.transfer_descriptor.be & 0xfffff000;
+ }
+ }
+ // should check for time available
+ // execute transaction
+ mps=ohcist.ports[1].function->execute_transfer(ohcist.endpoint_descriptor.fa, ohcist.endpoint_descriptor.en, pid, ohcist.buffer, mps);
+ // if receiving ...
+ if (pid == InPid) {
+ // ... store mps bytes
+ for (int c = 0; c < mps; c++) {
+ ohcist.space->write_byte(b,ohcist.buffer[c]);
+ b++;
+ if ((b & 0xfff) == 0)
+ b = ohcist.transfer_descriptor.be & 0xfffff000;
+ }
+ }
+ // status writeback (CompletionCode field, DataToggleControl field, CurrentBufferPointer field, ErrorCount field)
+ ohcist.transfer_descriptor.cc = NoError;
+ ohcist.transfer_descriptor.t = (ohcist.transfer_descriptor.t ^ 1) | 2;
+ ohcist.transfer_descriptor.cbp = b;
+ ohcist.transfer_descriptor.ec = 0;
+ if ((remain == mps) || (mps == 0)) {
+ // retire transfer descriptor
+ a = ohcist.endpoint_descriptor.headp;
+ ohcist.endpoint_descriptor.headp = ohcist.transfer_descriptor.nexttd;
+ ohcist.transfer_descriptor.nexttd = ohcist.hc_regs[HcDoneHead];
+ ohcist.hc_regs[HcDoneHead] = a;
+ ohcist.endpoint_descriptor.c = ohcist.transfer_descriptor.t & 1;
+ if (ohcist.transfer_descriptor.di != 7) {
+ if (ohcist.transfer_descriptor.di < ohcist.writebackdonehadcounter)
+ ohcist.writebackdonehadcounter = ohcist.transfer_descriptor.di;
+ }
+ usb_ohci_writeback_transfer_descriptor(a);
+ usb_ohci_writeback_endpoint_descriptor(ohcist.hc_regs[HcControlCurrentED]);
+ } else {
+ usb_ohci_writeback_transfer_descriptor(ohcist.endpoint_descriptor.headp);
+ }
+ } else
+ ohcist.hc_regs[HcControlCurrentED] = ohcist.endpoint_descriptor.nexted;
+ } else
+ ohcist.hc_regs[HcControlCurrentED] = ohcist.endpoint_descriptor.nexted;
+ // one bulk every n control transfers
+ ohcist.interruptbulkratio--;
+ if (ohcist.interruptbulkratio <= 0) {
+ ohcist.interruptbulkratio = (ohcist.hc_regs[HcControl] & 3) + 1;
+ cont = false;
+ }
+ }
+ }
+ }
+ list = 2;
+ }
+ if (list == 2) {
+ // bulk
+ if (ohcist.hc_regs[HcControl] & (1 << 5)) {
+ ohcist.hc_regs[HcCommandStatus] &= ~(1 << 2);
+ if (ohcist.hc_regs[HcControlCurrentED] == 0)
+ list = 0;
+ else if (ohcist.hc_regs[HcControl] & (1 << 4))
+ list = 1;
+ else
+ list = 0;
+ }
+ }
+ }
+ if (ohcist.framenumber == 0)
+ ohcist.hc_regs[HcInterruptStatus] |= FrameNumberOverflow;
+ ohcist.hc_regs[HcInterruptStatus] |= StartofFrame;
+ if ((ohcist.writebackdonehadcounter != 0) && (ohcist.writebackdonehadcounter != 7))
+ ohcist.writebackdonehadcounter--;
+ if ((ohcist.writebackdonehadcounter == 0) && ((ohcist.hc_regs[HcInterruptStatus] & WritebackDoneHead) == 0)) {
+ UINT32 b = 0;
+
+ if ((ohcist.hc_regs[HcInterruptStatus] & ohcist.hc_regs[HcInterruptEnable]) != WritebackDoneHead)
+ b = 1;
+ ohcist.hc_regs[HcInterruptStatus] |= WritebackDoneHead;
+ ohcist.space->write_dword(hcca + 0x84, ohcist.hc_regs[HcDoneHead] | b);
+ ohcist.hc_regs[HcDoneHead] = 0;
+ ohcist.writebackdonehadcounter = 7;
+ }
+ }
+ if (changed != 0) {
+ ohcist.hc_regs[HcInterruptStatus] |= RootHubStatusChange;
+ }
+ usb_ohci_interrupts();
+}
+
+void chihiro_state::usb_ohci_plug(int port, ohci_function_device *function)
+{
+ if ((port > 0) && (port <= 4)) {
+ ohcist.ports[port].function = function;
+ ohcist.hc_regs[HcRhPortStatus1+port-1] = 1;
+ }
+}
+
+static USBStandardDeviceDscriptor devdesc = {18,1,0x201,0xff,0x34,0x56,64,0x100,0x101,0x301,0,0,0,1};
+
+ohci_function_device::ohci_function_device()
+{
+ address = 0;
+ controldir = 0;
+ remain = 0;
+ position = NULL;
+}
+
+void ohci_function_device::execute_reset()
+{
+ address = 0;
+}
+
+int ohci_function_device::execute_transfer(int address, int endpoint, int pid, UINT8 *buffer, int size)
+{
+ if (endpoint == 0) {
+ if (pid == SetupPid) {
+ struct USBSetupPacket *p=(struct USBSetupPacket *)buffer;
+ // define direction
+ controldir = p->bmRequestType & 128;
+ // case !=0, in data stage and out status stage
+ // case ==0, out data stage and in status stage
+ position = NULL;
+ remain = p->wLength;
+ if ((p->bmRequestType & 0x60) == 0) {
+ switch (p->bRequest) {
+ case GET_DESCRIPTOR:
+ if ((p->wValue >> 8) == 1) { // device descriptor
+ //p->wValue & 255;
+ position = (UINT8 *)&devdesc;
+ remain = sizeof(devdesc);
+ }
+ break;
+ case SET_ADDRESS:
+ //p->wValue;
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ else if (pid == InPid) {
+ // case !=0, give data
+ // case ==0, nothing
+ if (size > remain)
+ size = remain;
+ if (controldir != 0) {
+ if (position != NULL)
+ memcpy(buffer, position, size);
+ position = position + size;
+ remain = remain - size;
+ }
+ }
+ else if (pid == OutPid) {
+ // case !=0, nothing
+ // case ==0, give data
+ if (size > remain)
+ size = remain;
+ if (controldir == 0) {
+ if (position != NULL)
+ memcpy(position, buffer, size);
+ position = position + size;
+ remain = remain - size;
+ }
+ }
+ }
+ return size;
+}
+
+void chihiro_state::usb_ohci_interrupts()
+{
+ if (((ohcist.hc_regs[HcInterruptStatus] & ohcist.hc_regs[HcInterruptEnable]) != 0) && ((ohcist.hc_regs[HcInterruptEnable] & MasterInterruptEnable) != 0))
+ chihiro_devs.pic8259_1->ir1_w(1);
+ else
+ chihiro_devs.pic8259_1->ir1_w(0);
+}
+
+void chihiro_state::usb_ohci_read_endpoint_descriptor(UINT32 address)
+{
+ UINT32 w;
+
+ w = ohcist.space->read_dword(address);
+ ohcist.endpoint_descriptor.word0 = w;
+ ohcist.endpoint_descriptor.fa = w & 0x7f;
+ ohcist.endpoint_descriptor.en = (w >> 7) & 15;
+ ohcist.endpoint_descriptor.d = (w >> 11) & 3;
+ ohcist.endpoint_descriptor.s = (w >> 13) & 1;
+ ohcist.endpoint_descriptor.k = (w >> 14) & 1;
+ ohcist.endpoint_descriptor.f = (w >> 15) & 1;
+ ohcist.endpoint_descriptor.mps = (w >> 16) & 0x7ff;
+ ohcist.endpoint_descriptor.tailp = ohcist.space->read_dword(address + 4);
+ w = ohcist.space->read_dword(address + 8);
+ ohcist.endpoint_descriptor.headp = w & 0xfffffffc;
+ ohcist.endpoint_descriptor.h = w & 1;
+ ohcist.endpoint_descriptor.c = (w >> 1) & 1;
+ ohcist.endpoint_descriptor.nexted = ohcist.space->read_dword(address + 12);
+}
+
+void chihiro_state::usb_ohci_writeback_endpoint_descriptor(UINT32 address)
+{
+ UINT32 w;
+
+ w = ohcist.endpoint_descriptor.word0 & 0xf8000000;
+ w = w | (ohcist.endpoint_descriptor.mps << 16) | (ohcist.endpoint_descriptor.f << 15) | (ohcist.endpoint_descriptor.k << 14) | (ohcist.endpoint_descriptor.s << 13) | (ohcist.endpoint_descriptor.d << 11) | (ohcist.endpoint_descriptor.en << 7) | ohcist.endpoint_descriptor.fa;
+ ohcist.space->write_dword(address, w);
+ w = ohcist.endpoint_descriptor.headp | (ohcist.endpoint_descriptor.c << 1) | ohcist.endpoint_descriptor.h;
+ ohcist.space->write_dword(address + 8, w);
+}
+
+void chihiro_state::usb_ohci_read_transfer_descriptor(UINT32 address)
+{
+ UINT32 w;
+
+ w = ohcist.space->read_dword(address);
+ ohcist.transfer_descriptor.word0 = w;
+ ohcist.transfer_descriptor.cc = (w >> 28) & 15;
+ ohcist.transfer_descriptor.ec= (w >> 26) & 3;
+ ohcist.transfer_descriptor.t= (w >> 24) & 3;
+ ohcist.transfer_descriptor.di= (w >> 21) & 7;
+ ohcist.transfer_descriptor.dp= (w >> 19) & 3;
+ ohcist.transfer_descriptor.r = (w >> 18) & 1;
+ ohcist.transfer_descriptor.cbp = ohcist.space->read_dword(address + 4);
+ ohcist.transfer_descriptor.nexttd = ohcist.space->read_dword(address + 8);
+ ohcist.transfer_descriptor.be = ohcist.space->read_dword(address + 12);
+}
+
+void chihiro_state::usb_ohci_writeback_transfer_descriptor(UINT32 address)
+{
+ UINT32 w;
+
+ w = ohcist.transfer_descriptor.word0 & 0x0003ffff;
+ w = w | (ohcist.transfer_descriptor.cc << 28) | (ohcist.transfer_descriptor.ec << 26) | (ohcist.transfer_descriptor.t << 24) | (ohcist.transfer_descriptor.di << 21) | (ohcist.transfer_descriptor.dp << 19) | (ohcist.transfer_descriptor.r << 18);
+ ohcist.space->write_dword(address, w);
+ ohcist.space->write_dword(address + 4, ohcist.transfer_descriptor.cbp);
+ ohcist.space->write_dword(address + 8, ohcist.transfer_descriptor.nexttd);
+}
+
+void chihiro_state::usb_ohci_read_isochronous_transfer_descriptor(UINT32 address)
+{
+ UINT32 w;
+
+ w = ohcist.space->read_dword(address);
+ ohcist.isochronous_transfer_descriptor.cc = (w >> 28) & 15;
+ ohcist.isochronous_transfer_descriptor.fc = (w >> 24) & 7;
+ ohcist.isochronous_transfer_descriptor.di = (w >> 21) & 7;
+ ohcist.isochronous_transfer_descriptor.sf = w & 0xffff;
+ ohcist.isochronous_transfer_descriptor.bp0 = ohcist.space->read_dword(address + 4) & 0xfffff000;
+ ohcist.isochronous_transfer_descriptor.nexttd = ohcist.space->read_dword(address + 8);
+ ohcist.isochronous_transfer_descriptor.be = ohcist.space->read_dword(address + 12);
+ w = ohcist.space->read_dword(address + 16);
+ ohcist.isochronous_transfer_descriptor.offset[0] = w & 0xffff;
+ ohcist.isochronous_transfer_descriptor.offset[1] = (w >> 16) & 0xffff;
+ w = ohcist.space->read_dword(address + 20);
+ ohcist.isochronous_transfer_descriptor.offset[2] = w & 0xffff;
+ ohcist.isochronous_transfer_descriptor.offset[3] = (w >> 16) & 0xffff;
+ w = ohcist.space->read_dword(address + 24);
+ ohcist.isochronous_transfer_descriptor.offset[4] = w & 0xffff;
+ ohcist.isochronous_transfer_descriptor.offset[5] = (w >> 16) & 0xffff;
+ w = ohcist.space->read_dword(address + 28);
+ ohcist.isochronous_transfer_descriptor.offset[6] = w & 0xffff;
+ ohcist.isochronous_transfer_descriptor.offset[7] = (w >> 16) & 0xffff;
}
/*
@@ -1290,6 +2023,23 @@ TIMER_CALLBACK_MEMBER(chihiro_state::audio_apu_timer)
}
}
+static UINT32 hubintiasbridg_pci_r(device_t *busdevice, device_t *device, int function, int reg, UINT32 mem_mask)
+{
+#ifdef LOG_PCI
+ // logerror(" bus:0 function:%d register:%d mask:%08X\n",function,reg,mem_mask);
+#endif
+ if ((function == 0) && (reg == 8))
+ return 0xb4; // 0:1:0 revision id must be at least 0xb4, otherwise usb will require a hub
+ return 0;
+}
+
+static void hubintiasbridg_pci_w(device_t *busdevice, device_t *device, int function, int reg, UINT32 data, UINT32 mem_mask)
+{
+#ifdef LOG_PCI
+ if (reg >= 16) logerror(" bus:0 function:%d register:%d data:%08X mask:%08X\n", function, reg, data, mem_mask);
+#endif
+}
+
/*
* dummy for non connected devices
*/
@@ -1792,6 +2542,19 @@ void chihiro_state::machine_start()
apust.timer->enable(false);
if (machine().debug_flags & DEBUG_FLAG_ENABLED)
debug_console_register_command(machine(), "chihiro", CMDFLAG_NONE, 0, 1, 4, chihiro_debug_commands);
+ memset(&ohcist, 0, sizeof(ohcist));
+#ifdef USB_ENABLED
+ ohcist.hc_regs[HcRevision] = 0x10;
+ ohcist.hc_regs[HcFmInterval] = 0x2edf;
+ ohcist.hc_regs[HcLSThreshold] = 0x628;
+ ohcist.hc_regs[HcRhDescriptorA] = 4;
+ ohcist.interruptbulkratio = 1;
+ ohcist.writebackdonehadcounter = 7;
+ ohcist.space = &m_maincpu->space();
+ ohcist.timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(chihiro_state::usb_ohci_timer), this), (void *)"USB OHCI Timer");
+ ohcist.timer->enable(false);
+ usb_ohci_plug(1, new ohci_function_device()); // test connect
+#endif
usbhack_index = -1;
for (int a = 1; a < 2; a++)
if (strcmp(machine().basename(), hacks[a].game_name) == 0) {
@@ -1831,7 +2594,7 @@ static MACHINE_CONFIG_START(chihiro_base, chihiro_state)
MCFG_PCI_BUS_LEGACY_ADD("pcibus", 0)
MCFG_PCI_BUS_LEGACY_DEVICE(0, "PCI Bridge Device - Host Bridge", dummy_pci_r, dummy_pci_w)
- MCFG_PCI_BUS_LEGACY_DEVICE(1, "HUB Interface - ISA Bridge", dummy_pci_r, dummy_pci_w)
+ MCFG_PCI_BUS_LEGACY_DEVICE(1, "HUB Interface - ISA Bridge", hubintiasbridg_pci_r, hubintiasbridg_pci_w)
MCFG_PCI_BUS_LEGACY_DEVICE(2, "OHCI USB Controller 1", dummy_pci_r, dummy_pci_w)
MCFG_PCI_BUS_LEGACY_DEVICE(3, "OHCI USB Controller 2", dummy_pci_r, dummy_pci_w)
MCFG_PCI_BUS_LEGACY_DEVICE(4, "MCP Networking Adapter", dummy_pci_r, dummy_pci_w)
@@ -2003,8 +2766,8 @@ ROM_START( mj2c )
DISK_REGION( "gdrom" )
DISK_IMAGE_READONLY( "gdx-0006c", 0, BAD_DUMP SHA1(505653117a73ed8b256ccf19450e7573a4dc57e9) )
- ROM_REGION( 0x50, "pic", ROMREGION_ERASE) // key was missing
- ROM_LOAD("317-0374-jpn.data", 0x00, 0x50, NO_DUMP )
+ ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF)
+ ROM_LOAD( "317-0374-jpn.pic", 0x000000, 0x004000, CRC(004f77a1) SHA1(bc5c6950293f3bff60bf7913d20a2046aa19ea69) )
ROM_END
ROM_START( mj2f )
@@ -2013,8 +2776,8 @@ ROM_START( mj2f )
DISK_REGION( "gdrom" )
DISK_IMAGE_READONLY( "gdx-0006f", 0, SHA1(d3900ca5135f9001e642c78b4d323d353880b41b) )
- ROM_REGION( 0x50, "pic", ROMREGION_ERASE) // key was missing
- ROM_LOAD("317-0374-jpn.data", 0x00, 0x50, NO_DUMP )
+ ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF)
+ ROM_LOAD( "317-0374-jpn.pic", 0x000000, 0x004000, CRC(004f77a1) SHA1(bc5c6950293f3bff60bf7913d20a2046aa19ea69) )
ROM_END
/*
@@ -2039,8 +2802,8 @@ ROM_START( mj2 )
DISK_REGION( "gdrom" )
DISK_IMAGE_READONLY( "gdx-0006g", 0, SHA1(e306837d5c093fdf1e9ff02239a8563535b1c181) )
- ROM_REGION( 0x50, "pic", ROMREGION_ERASE) // key was missing
- ROM_LOAD("317-0374-jpn.data", 0x00, 0x50, NO_DUMP )
+ ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF)
+ ROM_LOAD( "317-0374-jpn.pic", 0x000000, 0x004000, CRC(004f77a1) SHA1(bc5c6950293f3bff60bf7913d20a2046aa19ea69) )
ROM_END
ROM_START( ollie )
@@ -2119,21 +2882,21 @@ ROM_START( outr2st )
ROM_LOAD( "317-0xxx-com.pic", 0x000000, 0x004000, CRC(f94cf26f) SHA1(dd4af2b52935c7b2d8cd196ec1a30c0ef0993322) )
ROM_END
-ROM_START( wangmd2b )
+ROM_START( wangmid2 )
CHIHIRO_BIOS
DISK_REGION( "gdrom" )
- DISK_IMAGE_READONLY( "gdx-0015a", 0, BAD_DUMP SHA1(cb306df60550bbd8df312634cb97014bb39f1631) )
+ DISK_IMAGE_READONLY( "gdx-0015", 0, BAD_DUMP SHA1(259483fd211a70c23205ffd852316d616c5a2740) )
ROM_REGION( 0x50, "pic", ROMREGION_ERASE)
ROM_LOAD("317-5106-jpn.data", 0x00, 0x50, CRC(75c716aa) SHA1(5c2bcf3d28a80b336c6882d5aeb010d04327f8c1) )
ROM_END
-ROM_START( wangmid2 )
+ROM_START( wangmd2b )
CHIHIRO_BIOS
DISK_REGION( "gdrom" )
- DISK_IMAGE_READONLY( "gdx-0016", 0, BAD_DUMP SHA1(259483fd211a70c23205ffd852316d616c5a2740) )
+ DISK_IMAGE_READONLY( "gdx-0016a", 0, BAD_DUMP SHA1(cb306df60550bbd8df312634cb97014bb39f1631) )
ROM_REGION( 0x50, "pic", ROMREGION_ERASE)
ROM_LOAD("317-5106-com.data", 0x00, 0x50, CRC(75c716aa) SHA1(5c2bcf3d28a80b336c6882d5aeb010d04327f8c1) )
@@ -2145,8 +2908,8 @@ ROM_START( mj3d )
DISK_REGION( "gdrom" )
DISK_IMAGE_READONLY( "gdx-0017d", 0, BAD_DUMP SHA1(cfbbd452c8f4efe0e99f398f5521fc3574b913bb) )
- ROM_REGION( 0x50, "pic", ROMREGION_ERASE) // key was missing
- ROM_LOAD("317-0414-jpn.data", 0x00, 0x50, NO_DUMP )
+ ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF)
+ ROM_LOAD( "317-0414-jpn.pic", 0x000000, 0x004000, CRC(27d1c541) SHA1(c85a8229dd769af02ab43c97f09f995743cdb315) )
ROM_END
ROM_START( mj3 )
@@ -2155,8 +2918,8 @@ ROM_START( mj3 )
DISK_REGION( "gdrom" )
DISK_IMAGE_READONLY( "gdx-0017f", 0, SHA1(8641be9b2e1d8eb33cf27d3444956c0117debc2f) )
- ROM_REGION( 0x50, "pic", ROMREGION_ERASE) // key was missing
- ROM_LOAD("317-0414-jpn.data", 0x00, 0x50, NO_DUMP )
+ ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF)
+ ROM_LOAD( "317-0414-jpn.pic", 0x000000, 0x004000, CRC(27d1c541) SHA1(c85a8229dd769af02ab43c97f09f995743cdb315) )
ROM_END
ROM_START( scg06nt )
@@ -2169,6 +2932,17 @@ ROM_START( scg06nt )
ROM_LOAD("gdx-0018.data", 0x00, 0x50, CRC(1a210abd) SHA1(43a54d028315d2dfa9f8ea6fb59265e0b980b02f) )
ROM_END
+ROM_START( mj3evo )
+ CHIHIRO_BIOS
+
+ DISK_REGION( "gdrom" )
+ DISK_IMAGE_READONLY( "gdx-0021b", 0, SHA1(c97d1dc95cdf1b4bd5d7cf6b4db0757f3d6bd723) )
+
+ // PIC label is unknown
+ ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF)
+ ROM_LOAD( "317-xxxx-jpn.pic", 0x000000, 0x004000, CRC(650fcc94) SHA1(c88488900460fb3deecb3cf376fc043b10c020ef) )
+ROM_END
+
/*
Title BOX GDROM CF-BOX FIRM
Media ID EB08
@@ -2208,8 +2982,8 @@ ROM_END
/* 0002B */ GAME( 2003, crtaxihr, chihiro, chihirogd, chihiro, driver_device, 0, ROT0, "Sega / Hitmaker", "Crazy Taxi High Roller (Rev B) (GDX-0002B)", GAME_NO_SOUND|GAME_NOT_WORKING )
// 0003 GAME( 2003, vcop3o, vcop3, chihirogd, chihiro, driver_device, 0, ROT0, "Sega", "Virtua Cop 3 (GDX-0003)", GAME_NO_SOUND|GAME_NOT_WORKING )
/* 0003A */ GAME( 2003, vcop3, chihiro, chihirogd, chihiro, driver_device, 0, ROT0, "Sega", "Virtua Cop 3 (Rev A) (GDX-0003A)", GAME_NO_SOUND|GAME_NOT_WORKING )
-// 0004 GAME( 2003, outr2o, outr2, chihirogd, chihiro, driver_device, 0, ROT0, "Sega", "Out Run 2 (GDX-0004)", GAME_NO_SOUND|GAME_NOT_WORKING|GAME_SUPPORTS_SAVE )
-/* 0004A */ GAME( 2003, outr2, chihiro, chihirogd, chihiro, driver_device, 0, ROT0, "Sega", "Out Run 2 (Rev A) (GDX-0004A)", GAME_NO_SOUND|GAME_NOT_WORKING|GAME_SUPPORTS_SAVE )
+// 0004 GAME( 2003, outr2o, outr2, chihirogd, chihiro, driver_device, 0, ROT0, "Sega", "OutRun 2 (GDX-0004)", GAME_NO_SOUND|GAME_NOT_WORKING|GAME_SUPPORTS_SAVE )
+/* 0004A */ GAME( 2003, outr2, chihiro, chihirogd, chihiro, driver_device, 0, ROT0, "Sega", "OutRun 2 (Rev A) (GDX-0004A)", GAME_NO_SOUND|GAME_NOT_WORKING|GAME_SUPPORTS_SAVE )
// 0005 GAME( 2004, sgolcnpt, chihiro, chihirogd, chihiro, driver_device, 0, ROT0, "Sega", "Sega Golf Club Network Pro Tour (GDX-0005)", GAME_NO_SOUND|GAME_NOT_WORKING|GAME_SUPPORTS_SAVE )
// 0006 GAME( 2004, mj2o, mj2, chihirogd, chihiro, driver_device, 0, ROT0, "Sega", "Sega Network Taisen Mahjong MJ 2 (GDX-0006)", GAME_NO_SOUND|GAME_NOT_WORKING )
// 0006A GAME( 2004, mj2a, mj2, chihirogd, chihiro, driver_device, 0, ROT0, "Sega", "Sega Network Taisen Mahjong MJ 2 (Rev A) (GDX-0006A)", GAME_NO_SOUND|GAME_NOT_WORKING )
@@ -2227,15 +3001,15 @@ ROM_END
// 0009A GAME( 2004, wangmida, wangmid, chihirogd, chihiro, driver_device, 0, ROT0, "Namco", "Wangan Midnight Maximum Tune (Export) (Rev A) (GDX-0009A)", GAME_NO_SOUND|GAME_NOT_WORKING )
/* 0009B */ GAME( 2004, wangmid, chihiro, chihirogd, chihiro, driver_device, 0, ROT0, "Namco", "Wangan Midnight Maximum Tune (Export) (Rev B) (GDX-0009B)", GAME_NO_SOUND|GAME_NOT_WORKING )
// 0010
-// 0011 GAME( 2004, outr2sp, chihiro, chihirogd, chihiro, driver_device, 0, ROT0, "Sega", "Out Run 2 SP (Japan) (GDX-0011)", GAME_NO_SOUND|GAME_NOT_WORKING|GAME_SUPPORTS_SAVE )
+// 0011 GAME( 2004, outr2sp, chihiro, chihirogd, chihiro, driver_device, 0, ROT0, "Sega", "OutRun 2 SP (Japan) (GDX-0011)", GAME_NO_SOUND|GAME_NOT_WORKING|GAME_SUPPORTS_SAVE )
/* 0012 */ GAME( 2004, ghostsqo, ghostsqu, chihirogd, chihiro, driver_device, 0, ROT0, "Sega", "Ghost Squad (GDX-0012)", GAME_NO_SOUND|GAME_NOT_WORKING )
/* 0012A */ GAME( 2004, ghostsqu, chihiro, chihirogd, chihiro, driver_device, 0, ROT0, "Sega", "Ghost Squad (Rev A) (GDX-0012A)", GAME_NO_SOUND|GAME_NOT_WORKING )
/* 0013 */ GAME( 2005, gundamos, chihiro, chihirogd, chihiro, driver_device, 0, ROT0, "Banpresto", "Gundam Battle Operating Simulator (GDX-0013)", GAME_NO_SOUND|GAME_NOT_WORKING )
-// 0014 GAME( 2004, outr2sto, outr2st, chihirogd, chihiro, driver_device, 0, ROT0, "Sega", "Out Run 2 Special Tours (GDX-0014)", GAME_NO_SOUND|GAME_NOT_WORKING )
-/* 0014A */ GAME( 2004, outr2st, chihiro, chihirogd, chihiro, driver_device, 0, ROT0, "Sega", "Out Run 2 Special Tours (Rev A) (GDX-0014A)", GAME_NO_SOUND|GAME_NOT_WORKING )
-// 0015 GAME( 2005, wanmd2bo, wangmd2b, chihirogd, chihiro, driver_device, 0, ROT0, "Namco", "Wangan Midnight Maximum Tune 2 (Japan) (GDX-0015)", GAME_NO_SOUND|GAME_NOT_WORKING )
-/* 0015A */ GAME( 2005, wangmd2b, chihiro, chihirogd, chihiro, driver_device, 0, ROT0, "Namco", "Wangan Midnight Maximum Tune 2 (Japan) (Rev A) (GDX-0015A)", GAME_NO_SOUND|GAME_NOT_WORKING )
-/* 0016 */ GAME( 2005, wangmid2, chihiro, chihirogd, chihiro, driver_device, 0, ROT0, "Namco", "Wangan Midnight Maximum Tune 2 (Export) (GDX-0016)", GAME_NO_SOUND|GAME_NOT_WORKING )
+// 0014 GAME( 2004, outr2sto, outr2st, chihirogd, chihiro, driver_device, 0, ROT0, "Sega", "OutRun 2 Special Tours (GDX-0014)", GAME_NO_SOUND|GAME_NOT_WORKING )
+/* 0014A */ GAME( 2004, outr2st, chihiro, chihirogd, chihiro, driver_device, 0, ROT0, "Sega", "OutRun 2 Special Tours (Rev A) (GDX-0014A)", GAME_NO_SOUND|GAME_NOT_WORKING )
+/* 0015 */ GAME( 2005, wangmid2, chihiro, chihirogd, chihiro, driver_device, 0, ROT0, "Namco", "Wangan Midnight Maximum Tune 2 (Japan) (GDX-0015)", GAME_NO_SOUND|GAME_NOT_WORKING )
+// 0016 GAME( 2005, wanmd2bo, wangmd2b, chihirogd, chihiro, driver_device, 0, ROT0, "Namco", "Wangan Midnight Maximum Tune 2 (Export) (GDX-0016)", GAME_NO_SOUND|GAME_NOT_WORKING )
+/* 0016A */ GAME( 2005, wangmd2b, chihiro, chihirogd, chihiro, driver_device, 0, ROT0, "Namco", "Wangan Midnight Maximum Tune 2 (Export) (Rev A) (GDX-0016A)", GAME_NO_SOUND|GAME_NOT_WORKING )
// 0017 GAME( 2005, mj3o, mj3, chihirogd, chihiro, driver_device, 0, ROT0, "Sega", "Sega Network Taisen Mahjong MJ 3 (GDX-0017)", GAME_NO_SOUND|GAME_NOT_WORKING )
// 0017A GAME( 2005, mj3a, mj3, chihirogd, chihiro, driver_device, 0, ROT0, "Sega", "Sega Network Taisen Mahjong MJ 3 (Rev A) (GDX-0017A)", GAME_NO_SOUND|GAME_NOT_WORKING )
// 0017B GAME( 2005, mj3b, mj3, chihirogd, chihiro, driver_device, 0, ROT0, "Sega", "Sega Network Taisen Mahjong MJ 3 (Rev B) (GDX-0017B)", GAME_NO_SOUND|GAME_NOT_WORKING )
@@ -2247,8 +3021,9 @@ ROM_END
/* 0018A */ GAME( 2005, scg06nt, chihiro, chihirogd, chihiro, driver_device, 0, ROT0, "Sega", "Sega Club Golf 2006 Next Tours (Rev A) (GDX-0018A)", GAME_NO_SOUND|GAME_NOT_WORKING )
// 0019
// 0020
-// 0021 GAME( 2005, mj3evo, mj3ev, chihirogd, chihiro, driver_device, 0, ROT0, "Sega", "Sega Network Taisen Mahjong MJ 3 Evolution (GDX-0021)", GAME_NO_SOUND|GAME_NOT_WORKING )
-// 0021A GAME( 2005, mj3ev, chihiro, chihirogd, chihiro, driver_device, 0, ROT0, "Sega", "Sega Network Taisen Mahjong MJ 3 Evolution (Rev A) (GDX-0021A)", GAME_NO_SOUND|GAME_NOT_WORKING )
+// 0021 GAME( 2006, mj3evoo, mj3evo, chihirogd, chihiro, driver_device, 0, ROT0, "Sega", "Sega Network Taisen Mahjong MJ 3 Evolution (GDX-0021)", GAME_NO_SOUND|GAME_NOT_WORKING )
+// 0021A GAME( 2006, mj3evoa, mj3evo, chihirogd, chihiro, driver_device, 0, ROT0, "Sega", "Sega Network Taisen Mahjong MJ 3 Evolution (Rev A) (GDX-0021A)", GAME_NO_SOUND|GAME_NOT_WORKING )
+/* 0021B */ GAME( 2007, mj3evo, chihiro, chihirogd, chihiro, driver_device, 0, ROT0, "Sega", "Sega Network Taisen Mahjong MJ 3 Evolution (Rev B) (GDX-0021B)", GAME_NO_SOUND|GAME_NOT_WORKING )
// 0022
// 0023
// 0024 GAME( 2009, ccfboxo, ccfboxa, chihirogd, chihiro, driver_device, 0, ROT0, "Sega", "Chihiro Firmware Update For Compact Flash Box (GDX-0024)", GAME_NO_SOUND|GAME_NOT_WORKING )
diff --git a/src/mame/drivers/chinsan.c b/src/mame/drivers/chinsan.c
index 33031e08dac..fca2227d2be 100644
--- a/src/mame/drivers/chinsan.c
+++ b/src/mame/drivers/chinsan.c
@@ -87,6 +87,7 @@ public:
required_device<msm5205_device> m_adpcm;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
+ UINT8 *m_decrypted_opcodes;
};
@@ -139,6 +140,7 @@ UINT32 chinsan_state::screen_update_chinsan(screen_device &screen, bitmap_ind16
WRITE8_MEMBER(chinsan_state::ctrl_w)
{
membank("bank1")->set_entry(data >> 6);
+ membank("bank1d")->set_entry(data >> 6);
}
WRITE8_MEMBER(chinsan_state::ym_port_w1)
@@ -248,6 +250,11 @@ static ADDRESS_MAP_START( chinsan_map, AS_PROGRAM, 8, chinsan_state )
AM_RANGE(0xe000, 0xf7ff) AM_RAM AM_SHARE("video")
ADDRESS_MAP_END
+static ADDRESS_MAP_START( decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 8, chinsan_state )
+ AM_RANGE(0x0000, 0x7fff) AM_ROMBANK("bank0d")
+ AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1d")
+ADDRESS_MAP_END
+
static ADDRESS_MAP_START( chinsan_io, AS_IO, 8, chinsan_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x00) AM_WRITE(chinsan_port00_w)
@@ -564,7 +571,9 @@ WRITE_LINE_MEMBER(chinsan_state::chin_adpcm_int)
void chinsan_state::machine_start()
{
- membank("bank1")->configure_entries(0, 4, memregion("maincpu")->base() + 0x10000, 0x4000);
+ membank("bank1")->configure_entries(0, 4, memregion("maincpu")->base() + 0x8000, 0x4000);
+ membank("bank0d")->set_base(m_decrypted_opcodes);
+ membank("bank1d")->configure_entries(0, 4, m_decrypted_opcodes + 0x8000, 0x4000);
save_item(NAME(m_adpcm_idle));
save_item(NAME(m_port_select));
@@ -589,6 +598,7 @@ static MACHINE_CONFIG_START( chinsan, chinsan_state )
MCFG_CPU_ADD("maincpu", Z80,10000000/2) /* ? MHz */
MCFG_CPU_PROGRAM_MAP(chinsan_map)
MCFG_CPU_IO_MAP(chinsan_io)
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", chinsan_state, irq0_line_hold)
@@ -633,10 +643,10 @@ MACHINE_CONFIG_END
*************************************/
ROM_START( chinsan )
- ROM_REGION( 0x20000, "maincpu", 0 ) /* encrypted code / data */
+ ROM_REGION( 0x18000, "maincpu", 0 ) /* encrypted code / data */
ROM_LOAD( "mm00.7d", 0x00000, 0x08000, CRC(f7a4414f) SHA1(f65223b2928f610ab97fda2f2c008806cf2420e5) )
ROM_CONTINUE( 0x00000, 0x08000 ) // first half is blank
- ROM_LOAD( "mm01.8d", 0x10000, 0x10000, CRC(c69ddbf5) SHA1(9533365c1761b113174d53a2e23ce6a7baca7dfe) )
+ ROM_LOAD( "mm01.8d", 0x08000, 0x10000, CRC(c69ddbf5) SHA1(9533365c1761b113174d53a2e23ce6a7baca7dfe) )
ROM_REGION( 0x2000, "user1", 0 ) /* MC8123 key */
ROM_LOAD( "317-5012.key", 0x0000, 0x2000, CRC(2ecfb132) SHA1(3110ef82080dd7d908cc6bf34c6643f187f90b29) )
@@ -667,7 +677,8 @@ ROM_END
DRIVER_INIT_MEMBER(chinsan_state,chinsan)
{
- mc8123_decrypt_rom(machine(), "maincpu", "user1", "bank1", 4);
+ m_decrypted_opcodes = auto_alloc_array(machine(), UINT8, 0x18000);
+ mc8123_decode(memregion("maincpu")->base(), m_decrypted_opcodes, memregion("user1")->base(), 0x18000);
}
diff --git a/src/mame/drivers/chsuper.c b/src/mame/drivers/chsuper.c
index e31ca733741..70f99cb2d77 100644
--- a/src/mame/drivers/chsuper.c
+++ b/src/mame/drivers/chsuper.c
@@ -135,21 +135,21 @@ WRITE8_MEMBER( chsuper_state::chsuper_vram_w )
*/
-WRITE8_MEMBER( chsuper_state::chsuper_outporta_w ) // Port EEh
+WRITE8_MEMBER( chsuper_state::chsuper_outporta_w ) // Port EEh
{
coin_counter_w(machine(), 0, data & 0x01); // Coin counter
- output_set_lamp_value(0, (data >> 1) & 1); // Hold 1 / Black (Nero) lamp.
- coin_counter_w(machine(), 1, data & 0x04); // Payout / Ticket Out pulse
- output_set_lamp_value(1, (data >> 3) & 1); // Hold 2 / Low (Bassa) lamp.
+ output_set_lamp_value(0, (data >> 1) & 1); // Hold 1 / Black (Nero) lamp.
+ coin_counter_w(machine(), 1, data & 0x04); // Payout / Ticket Out pulse
+ output_set_lamp_value(1, (data >> 3) & 1); // Hold 2 / Low (Bassa) lamp.
// D4: unused...
- output_set_lamp_value(5, (data >> 5) & 1); // BET lamp
+ output_set_lamp_value(5, (data >> 5) & 1); // BET lamp
// D6: ticket motor...
// D7: unused...
/* Workaround to get the HOLD 3 lamp line active,
from the HOLD 1 and HOLD 5 lamps status...
*/
- m_blacklamp = (data >> 1) & 1; // latching the BLACK lamp status...
+ m_blacklamp = (data >> 1) & 1; // latching the BLACK lamp status...
if ((m_blacklamp == 1) & (m_redlamp == 1)) // if both are ON...
{
@@ -161,29 +161,29 @@ WRITE8_MEMBER( chsuper_state::chsuper_outporta_w ) // Port EEh
}
}
-WRITE8_MEMBER( chsuper_state::chsuper_outportb_w ) // Port EFh
+WRITE8_MEMBER( chsuper_state::chsuper_outportb_w ) // Port EFh
{
// D0: unknown...
// D1: unused...
- output_set_lamp_value(3, (data >> 2) & 1); // Hold 4 / High (Alta) lamp.
+ output_set_lamp_value(3, (data >> 2) & 1); // Hold 4 / High (Alta) lamp.
// D3: unused...
// D4: unused...
- output_set_lamp_value(4, (data >> 5) & 1); // Hold 5 / Red (Rosso) / Gamble (Raddoppio) lamp.
- output_set_lamp_value(6, (data >> 6) & 1); // Start / Gamble (Raddoppio) lamp.
+ output_set_lamp_value(4, (data >> 5) & 1); // Hold 5 / Red (Rosso) / Gamble (Raddoppio) lamp.
+ output_set_lamp_value(6, (data >> 6) & 1); // Start / Gamble (Raddoppio) lamp.
// D7: unused...
/* Workaround to get the HOLD 3 lamp line active,
from the HOLD 1 and HOLD 5 lamps status...
*/
- m_redlamp = (data >> 5) & 1; // latching the RED lamp status...
+ m_redlamp = (data >> 5) & 1; // latching the RED lamp status...
- if ((m_blacklamp == 1) & (m_redlamp == 1)) // if both are ON...
+ if ((m_blacklamp == 1) & (m_redlamp == 1)) // if both are ON...
{
- output_set_lamp_value(2, 1); // Hold 3 ON
+ output_set_lamp_value(2, 1); // Hold 3 ON
}
else
{
- output_set_lamp_value(2, 0); // Hold 3 OFF
+ output_set_lamp_value(2, 0); // Hold 3 OFF
}
}
@@ -208,10 +208,43 @@ static ADDRESS_MAP_START( chsuper_portmap, AS_IO, 8, chsuper_state )
AM_RANGE( 0x00fc, 0x00fc ) AM_DEVWRITE("ramdac", ramdac_device, index_w)
AM_RANGE( 0x00fd, 0x00fd ) AM_DEVWRITE("ramdac", ramdac_device, pal_w)
AM_RANGE( 0x00fe, 0x00fe ) AM_DEVWRITE("ramdac", ramdac_device, mask_w)
- AM_RANGE( 0x8300, 0x8300 ) AM_READ_PORT("IN2") // valid input port present in test mode.
+ AM_RANGE( 0x8300, 0x8300 ) AM_READ_PORT("IN2") // valid input port present in test mode.
AM_RANGE( 0xff20, 0xff3f ) AM_DEVWRITE("dac", dac_device, write_unsigned8) // unk writes
ADDRESS_MAP_END
+/* About Sound...
+
+ Samples are PCM unsigned 8-bit, mono.
+ These are embedded into the program ROM, starting
+ at the 0x10000 offset.
+
+ The audio system is currently unknown, but the sound writes
+ are the following...
+
+ For any sample triggered:
+
+ FF39h --> 0x02
+ FF30h --> 0x30
+
+ then the following 5 writes (per sample number)...
+
+ SND# (hex): 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14
+ Writes...
+ FF2Ah: 0x00 0xEA 0x01 0x76 0x00 0xF9 0x01 0x0F 0x00 0x84 0x01 0x01 0x00 0x01 0x01 0x01 0x00 0x01 0x01 0x8C 0x00
+ FF29h: 0xFF 0xF6 0x04 0x05 0xFF 0x05 0x04 0x75 0xFF 0xF8 0x04 0x00 0xFF 0x00 0x04 0x21 0xFF 0x21 0x04 0x0D 0xFF
+ FF28h: 0xFF 0x0F 0xF8 0x69 0xFF 0x75 0x83 0x05 0xFF 0x0D 0x90 0xF8 0xFF 0x00 0x20 0x00 0xFF 0x00 0x00 0x9C 0xFF
+ FF2Fh: 0xF7 0x0F 0xFF 0xFF 0x06 0x00 0xFF 0xFF 0xF9 0x0D 0xFD 0xFF 0x01 0x04 0x1C 0xFF 0x22 0xE3 0xFF 0xFF 0xBB
+ FF2Eh: 0xF0 0x17 0xFF 0xFF 0x8A 0xF2 0xFF 0xFF 0xF2 0x7D 0x98 0xFF 0xFF 0x20 0xE0 0xFF 0xFF 0x00 0xFF 0xFF 0x1F
+
+ then ending with...
+
+ FF2Ch --> 0x00
+ FF2Bh --> 0xF8
+ FF30h --> 0x90
+ FF39h --> 0x00
+
+*/
+
static INPUT_PORTS_START( chsuper )
PORT_START("IN0")
@@ -230,7 +263,7 @@ static INPUT_PORTS_START( chsuper )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_W) PORT_NAME("IN1-3")
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_E) PORT_NAME("IN1-4")
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_R) PORT_NAME("IN1-5")
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 ) // ticket-in in chmpnum
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 ) // ticket-in in chmpnum
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_T) PORT_NAME("IN1-7")
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) // ticket out / payout in chsuper2
diff --git a/src/mame/drivers/circusc.c b/src/mame/drivers/circusc.c
index 238fd9b002c..1bd909c2d09 100644
--- a/src/mame/drivers/circusc.c
+++ b/src/mame/drivers/circusc.c
@@ -334,7 +334,7 @@ INTERRUPT_GEN_MEMBER(circusc_state::vblank_irq)
static MACHINE_CONFIG_START( circusc, circusc_state )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", M6809, 2048000) /* 2 MHz? */
+ MCFG_CPU_ADD("maincpu", KONAMI1, 2048000) /* 2 MHz? */
MCFG_CPU_PROGRAM_MAP(circusc_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", circusc_state, vblank_irq)
MCFG_WATCHDOG_VBLANK_INIT(8)
@@ -567,7 +567,6 @@ ROM_END
DRIVER_INIT_MEMBER(circusc_state,circusc)
{
- konami1_decode(machine(), "maincpu");
}
diff --git a/src/mame/drivers/cobra.c b/src/mame/drivers/cobra.c
index bbfa5ec4b13..7850cc721fa 100644
--- a/src/mame/drivers/cobra.c
+++ b/src/mame/drivers/cobra.c
@@ -323,7 +323,7 @@
#include "machine/timekpr.h"
#include "video/k001604.h"
#include "video/poly.h"
-#include "video/rgbgen.h"
+#include "video/rgbutil.h"
#include "sound/rf5c400.h"
#include "sound/dmadac.h"
@@ -419,7 +419,7 @@ private:
enum
{
RE_STATUS_IDLE = 0,
- RE_STATUS_COMMAND = 1,
+ RE_STATUS_COMMAND = 1
};
enum
@@ -431,7 +431,7 @@ private:
POLY_A = 4,
POLY_U = 5,
POLY_V = 6,
- POLY_W = 7,
+ POLY_W = 7
};
};
@@ -444,7 +444,7 @@ public:
{
EVENT_EMPTY,
EVENT_HALF_FULL,
- EVENT_FULL,
+ EVENT_FULL
};
typedef delegate<void (EventType)> event_delegate;
@@ -687,7 +687,7 @@ public:
enum
{
MAIN_INT_M2S = 0x01,
- MAIN_INT_S2M = 0x02,
+ MAIN_INT_S2M = 0x02
};
UINT8 m_m2s_int_enable;
@@ -895,7 +895,7 @@ void cobra_renderer::render_texture_scan(INT32 scanline, const extent_t &extent,
rgb_t texel10 = texture_fetch(&m_texture_ram[tex_address], iu, iv+1, texture_width, tex_format);
rgb_t texel11 = texture_fetch(&m_texture_ram[tex_address], iu+1, iv+1, texture_width, tex_format);
- rgb_t texel = rgba_bilinear_filter(texel00, texel01, texel10, texel11, (int)(lerp_u * 255), (int)(lerp_v * 255));
+ rgb_t texel = rgbaint_t::bilinear_filter(texel00, texel01, texel10, texel11, (int)(lerp_u * 255), (int)(lerp_v * 255));
#endif
diff --git a/src/mame/drivers/commando.c b/src/mame/drivers/commando.c
index 42507a52015..012e6ac0171 100644
--- a/src/mame/drivers/commando.c
+++ b/src/mame/drivers/commando.c
@@ -72,6 +72,10 @@ static ADDRESS_MAP_START( commando_map, AS_PROGRAM, 8, commando_state )
AM_RANGE(0xff80, 0xffff) AM_RAM
ADDRESS_MAP_END
+static ADDRESS_MAP_START( decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 8, commando_state )
+ AM_RANGE(0x0000, 0xbfff) AM_ROM AM_SHARE("decrypted_opcodes")
+ADDRESS_MAP_END
+
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, commando_state )
AM_RANGE(0x0000, 0x3fff) AM_ROM
AM_RANGE(0x4000, 0x47ff) AM_RAM
@@ -245,6 +249,7 @@ static MACHINE_CONFIG_START( commando, commando_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z80, PHI_MAIN) // ???
MCFG_CPU_PROGRAM_MAP(commando_map)
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", commando_state, commando_interrupt)
MCFG_CPU_ADD("audiocpu", Z80, PHI_B) // 3 MHz
@@ -281,7 +286,7 @@ MACHINE_CONFIG_END
/* ROMs */
ROM_START( commando )
- ROM_REGION( 2*0x10000, "maincpu", 0 ) /* 64k for code + 64k for decrypted opcodes */
+ ROM_REGION( 0xc000, "maincpu", 0 )
ROM_LOAD( "cm04.9m", 0x0000, 0x8000, CRC(8438b694) SHA1(e154478d8f1b635355bd777370acabe49cb9d309) )
ROM_LOAD( "cm03.8m", 0x8000, 0x4000, CRC(35486542) SHA1(531a85c9e03970ce037be84f2240c2df6f6e3ec1) )
@@ -317,7 +322,7 @@ ROM_START( commando )
ROM_END
ROM_START( commandou )
- ROM_REGION( 2*0x10000, "maincpu", 0 ) /* 64k for code + 64k for decrypted opcodes */
+ ROM_REGION( 0xc000, "maincpu", 0 )
ROM_LOAD( "u4-f.9m", 0x0000, 0x8000, CRC(a6118935) SHA1(d5811968b23d61e344e151747bcc3c0ed2b9497b) )
ROM_LOAD( "u3-f.8m", 0x8000, 0x4000, CRC(24f49684) SHA1(d38a7bd9f3b506747a03f6b94c3f8a2d9fc59166) )
@@ -353,7 +358,7 @@ ROM_START( commandou )
ROM_END
ROM_START( commandoj )
- ROM_REGION( 2*0x10000, "maincpu", 0 ) /* 64k for code + 64k for decrypted opcodes */
+ ROM_REGION( 0xc000, "maincpu", 0 )
ROM_LOAD( "so04.9m", 0x0000, 0x8000, CRC(d3f2bfb3) SHA1(738a5673ac6a907cb04cfb125e8aab3f7437b9d2) )
ROM_LOAD( "so03.8m", 0x8000, 0x4000, CRC(ed01f472) SHA1(fa181293ae8f0fee78d412259eb81f6de1e1307a) )
@@ -389,7 +394,7 @@ ROM_START( commandoj )
ROM_END
ROM_START( commandob )
- ROM_REGION( 2*0x10000, "maincpu", 0 ) /* 64k for code + 64k for decrypted opcodes */
+ ROM_REGION( 0xc000, "maincpu", 0 )
ROM_LOAD( "commandob_04_9m_27256.bin", 0x0000, 0x8000, CRC(348a7654) SHA1(f3668c47c154a9c7d7afeabb0259c9bc56e847ac) )
ROM_LOAD( "cm03.8m", 0x8000, 0x4000, CRC(35486542) SHA1(531a85c9e03970ce037be84f2240c2df6f6e3ec1) )
@@ -433,7 +438,7 @@ ROM_START( commandob )
ROM_END
ROM_START( commandob2 )
- ROM_REGION( 2*0x10000, "maincpu", 0 ) /* 64k for code + 64k for decrypted opcodes */
+ ROM_REGION( 0xc000, "maincpu", 0 )
ROM_LOAD( "10", 0x0000, 0x8000, CRC(ab5d1469) SHA1(05935155365bef3c40823101303a3857af1c71e6) )
ROM_LOAD( "11", 0x8000, 0x4000, CRC(d1a43ba1) SHA1(dbaedcd3a1b489a01b7f783fda6fcad203758717) )
@@ -507,7 +512,7 @@ ROM_START( commandob2 )
ROM_END
ROM_START( commandou2 )
- ROM_REGION( 2*0x10000, "maincpu", 0 ) /* 64k for code + 64k for decrypted opcodes */
+ ROM_REGION( 0xc000, "maincpu", 0 )
ROM_LOAD( "uc4.9m", 0x0000, 0x8000, CRC(89ee8e17) SHA1(68db271af8b0f400ca95df5672983bfb87f3f84a) )
ROM_LOAD( "uc3.8m", 0x8000, 0x4000, CRC(72a1a529) SHA1(fe7797206e38bd78e817b6c351d5cb943720fe6c) )
@@ -543,7 +548,7 @@ ROM_START( commandou2 )
ROM_END
ROM_START( sinvasn )
- ROM_REGION( 2*0x10000, "maincpu", 0 ) /* 64k for code + 64k for decrypted opcodes */
+ ROM_REGION( 0xc000, "maincpu", 0 )
ROM_LOAD( "sp04.9m", 0x0000, 0x8000, CRC(33f9601e) SHA1(71182227b77fccbbc1d89b5828aa86dcc64ca05e) )
ROM_LOAD( "sp03.8m", 0x8000, 0x4000, CRC(c7fb43b3) SHA1(36d0dffdacc36a6b6a77101d942c0821846f3275) )
@@ -579,7 +584,7 @@ ROM_START( sinvasn )
ROM_END
ROM_START( sinvasnb )
- ROM_REGION( 2*0x10000, "maincpu", 0 ) /* 64k for code + 64k for decrypted opcodes */
+ ROM_REGION( 0xc000, "maincpu", 0 )
ROM_LOAD( "u4", 0x0000, 0x8000, CRC(834ba0de) SHA1(85f40559e6a436f3f752b6e862a419a5b9481fa8) )
ROM_LOAD( "u3", 0x8000, 0x4000, CRC(07e4ee3a) SHA1(6d7665b3072f075893ef37e55147b10271d069ef) )
@@ -618,40 +623,26 @@ ROM_END
DRIVER_INIT_MEMBER(commando_state,commando)
{
- address_space &space = m_maincpu->space(AS_PROGRAM);
UINT8 *rom = memregion("maincpu")->base();
- UINT8 *decrypt = auto_alloc_array(machine(), UINT8, 0xc000);
- int A;
-
- space.set_decrypted_region(0x0000, 0xbfff, decrypt);
// the first opcode is *not* encrypted
- decrypt[0] = rom[0];
- for (A = 1; A < 0xc000; A++)
+ m_decrypted_opcodes[0] = rom[0];
+ for (int A = 1; A < 0xc000; A++)
{
- int src;
-
- src = rom[A];
- decrypt[A] = (src & 0x11) | ((src & 0xe0) >> 4) | ((src & 0x0e) << 4);
+ UINT8 src = rom[A];
+ m_decrypted_opcodes[A] = (src & 0x11) | ((src & 0xe0) >> 4) | ((src & 0x0e) << 4);
}
}
DRIVER_INIT_MEMBER(commando_state,spaceinv)
{
- address_space &space = m_maincpu->space(AS_PROGRAM);
UINT8 *rom = memregion("maincpu")->base();
- UINT8 *decrypt = auto_alloc_array(machine(), UINT8, 0xc000);
- int A;
-
- space.set_decrypted_region(0x0000, 0xbfff, decrypt);
// the first opcode *is* encrypted
- for (A = 0; A < 0xc000; A++)
+ for (int A = 0; A < 0xc000; A++)
{
- int src;
-
- src = rom[A];
- decrypt[A] = (src & 0x11) | ((src & 0xe0) >> 4) | ((src & 0x0e) << 4);
+ UINT8 src = rom[A];
+ m_decrypted_opcodes[A] = (src & 0x11) | ((src & 0xe0) >> 4) | ((src & 0x0e) << 4);
}
}
diff --git a/src/mame/drivers/coolridr.c b/src/mame/drivers/coolridr.c
index b4285094cc1..b420c04066a 100644
--- a/src/mame/drivers/coolridr.c
+++ b/src/mame/drivers/coolridr.c
@@ -344,7 +344,8 @@ public:
// store the blit params here
UINT32 m_spriteblit[12];
-
+ UINT32 m_vregs_address;
+
UINT32 m_clipvals[2][3];
UINT8 m_clipblitterMode[2]; // hack
@@ -409,6 +410,7 @@ public:
DECLARE_WRITE32_MEMBER(sysh1_dma_w);
DECLARE_WRITE32_MEMBER(sysh1_char_w);
DECLARE_READ32_MEMBER(coolridr_hack2_r);
+ DECLARE_READ32_MEMBER(aquastge_hack_r);
DECLARE_READ16_MEMBER(h1_soundram_r);
DECLARE_READ16_MEMBER(h1_soundram2_r);
DECLARE_WRITE16_MEMBER(h1_soundram_w);
@@ -419,14 +421,14 @@ public:
DECLARE_WRITE_LINE_MEMBER(scsp1_to_sh1_irq);
DECLARE_WRITE_LINE_MEMBER(scsp2_to_sh1_irq);
DECLARE_WRITE8_MEMBER(sound_to_sh1_w);
- DECLARE_READ16_MEMBER(sh7032_r);
- DECLARE_WRITE16_MEMBER(sh7032_w);
- UINT16 m_sh7032_regs[0x200];
DECLARE_DRIVER_INIT(coolridr);
+ DECLARE_DRIVER_INIT(aquastge);
virtual void machine_start();
virtual void machine_reset();
virtual void video_start();
+ UINT32 m_colbase;
+
void coolriders_drawgfx_opaque(bitmap_ind16 &dest, const rectangle &cliprect, gfx_element *gfx,
UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty);
@@ -475,6 +477,7 @@ public:
coolridr_state* state;
UINT32 clipvals[3];
int screen;
+ int colbase;
};
static int comp_sprite_z(const void *q1, const void *q2);
@@ -780,6 +783,7 @@ void coolridr_state::coolriders_drawgfx_transpen(bitmap_ind16 &dest, const recta
void coolridr_state::draw_bg_coolridr(bitmap_ind16 &bitmap, const rectangle &cliprect, int which)
{
int bg_r,bg_g,bg_b;
+ address_space &space = m_maincpu->space(AS_PROGRAM);
if(m_pen_fill[which])
{
@@ -805,7 +809,7 @@ void coolridr_state::draw_bg_coolridr(bitmap_ind16 &bitmap, const rectangle &cli
UINT8 transpen_setting;
gfx_element *gfx = m_gfxdecode->gfx(m_gfx_index);
#define VREG(_offs) \
- m_framebuffer_vram[(0x9b80+_offs+which*0x40)/4]
+ space.read_dword(m_vregs_address+_offs+which*0x40)
scrollx = (VREG(0x2c) >> 16) & 0x7ff;
scrolly = VREG(0x2c) & 0x3ff;
@@ -827,7 +831,7 @@ void coolridr_state::draw_bg_coolridr(bitmap_ind16 &bitmap, const rectangle &cli
UINT16 basex = scrollx>>4;
for (int x=0;x<32;x++)
{
- vram_data = (m_h1_vram[(basex&0x7f)+((basey&0x3f)*0x80)+base_offset] & 0xffff);
+ vram_data = (m_h1_vram[((basex&0x7f)+((basey&0x3f)*0x80)+base_offset)&0x07ffff] & 0xffff);
color = m_color_bank + ((vram_data & 0x800) >> 11) * 4;
/* bike select enables bits 15-12, pretty sure one of these is tile bank (because there's a solid pen on 0x3ff / 0x7ff). */
tile = (vram_data & 0x7ff) | ((vram_data & 0x8000) >> 4);
@@ -1946,8 +1950,8 @@ void *coolridr_state::draw_object_threaded(void *param, int threadid)
UINT32 lastSpriteNumber = 0xffffffff;
UINT16 blankcount = 0;
- int color_offs = (0x7b20 + (b1colorNumber & 0x7ff))*0x40 * 5; /* yes, * 5 */ \
- int color_offs2 = (0x7b20 + (b2colorNumber & 0x7ff))*0x40 * 5;
+ int color_offs = (object->colbase + (b1colorNumber & 0x7ff))*0x40 * 5; /* yes, * 5 */ \
+ int color_offs2 = (object->colbase + (b2colorNumber & 0x7ff))*0x40 * 5;
for (int h = 0; h < used_hCellCount; h++)
{
int current_decoded = false;
@@ -2239,6 +2243,7 @@ void coolridr_state::blit_current_sprite(address_space &space)
cool_render_object* testobject = (cool_render_object *)malloc(sizeof(cool_render_object));
testobject->state = this;
+ testobject->colbase = m_colbase;
for (int i=0;i<12;i++)
testobject->spriteblit[i] = m_spriteblit[i];
@@ -2476,7 +2481,7 @@ WRITE32_MEMBER(coolridr_state::sysh1_blit_data_w)
//blit mode 10 00 00000003
//blit mode 10 01 00000002
- //blit mode 10 02 00007b20 << this is the palette base for the sprites
+ //blit mode 10 02 00007b20 << this is the palette base for the sprites (but not in aquastage where it gets set to 0x210 and colbase is 0?) ( m_colbase )
//blit mode 10 00 00000002
//blit mode 10 01 00000001
//blit mode 10 02 00040204
@@ -2727,7 +2732,7 @@ void coolridr_state::sysh1_dma_transfer( address_space &space, UINT16 dma_index
do{
cmd = (m_framebuffer_vram[(0+dma_index)/4] & 0xfc000000) >> 24;
-
+
switch(cmd)
{
case 0x00: /* end of list marker */
@@ -2738,6 +2743,8 @@ void coolridr_state::sysh1_dma_transfer( address_space &space, UINT16 dma_index
src = (m_framebuffer_vram[(0+dma_index)/4] & 0x03ffffff);
dst = (m_framebuffer_vram[(4+dma_index)/4]);
size = m_framebuffer_vram[(8+dma_index)/4];
+ printf("%08x %08x %04x\n",src,dst,size);
+
if(dst & 0xfff00001)
printf("unk values to %02x dst %08x\n",cmd,dst);
dst &= 0x000ffffe;
@@ -2793,12 +2800,17 @@ void coolridr_state::sysh1_dma_transfer( address_space &space, UINT16 dma_index
dma_index+=0xc;
break;
- case 0x04: /* init - value 0x040c80d2 (unknown purpose, slave mode?) */
+ break;
case 0x10: /* sets up look-up for tilemap video registers */
+ m_vregs_address = (m_framebuffer_vram[(0+dma_index)/4] & 0x03ffffff);
+ dma_index+=4;
+ break;
+ case 0x04: /* init - value 0x040c80d2 (unknown purpose, slave mode?) */
case 0x20: /* screen 1 - linescroll/zoom table? (default values) */
case 0x24: /* screen 2 / */
case 0x50: /* screen 1 - unknown */
case 0x54: /* screen 2 / */
+ //printf("%02x %08x\n",cmd,m_framebuffer_vram[(0+dma_index)/4]);
dma_index+=4;
break;
case 0x30: /* screen 1 - 0x80 at boot, then 0x808080 */
@@ -2854,6 +2866,13 @@ static ADDRESS_MAP_START( system_h1_map, AS_PROGRAM, 32, coolridr_state )
AM_RANGE(0x60000000, 0x600003ff) AM_WRITENOP
ADDRESS_MAP_END
+static ADDRESS_MAP_START(aquastge_h1_map, AS_PROGRAM, 32, coolridr_state)
+ AM_RANGE(0x03c00000, 0x03c0ffff) AM_MIRROR(0x00200000) AM_RAM_WRITE(sysh1_dma_w) AM_SHARE("fb_vram") /* mostly mapped at 0x03e00000 */
+ AM_RANGE(0x03f50000, 0x03f5ffff) AM_RAM // video registers
+ AM_RANGE(0x03e10000, 0x03e1ffff) AM_RAM AM_SHARE("share3") /*Communication area RAM*/
+ AM_RANGE(0x03f00000, 0x03f0ffff) AM_RAM /*Communication area RAM*/
+ AM_IMPORT_FROM(system_h1_map)
+ADDRESS_MAP_END
READ16_MEMBER( coolridr_state::h1_soundram_r)
{
@@ -2989,16 +3008,7 @@ WRITE32_MEMBER(coolridr_state::sysh1_sound_dma_w)
COMBINE_DATA(&m_sound_dma[offset]);
}
-/* TODO: place-holder, to be moved in the SH core ... */
-READ16_MEMBER(coolridr_state::sh7032_r)
-{
- return m_sh7032_regs[offset];
-}
-WRITE16_MEMBER(coolridr_state::sh7032_w)
-{
- COMBINE_DATA(&m_sh7032_regs[offset]);
-}
static ADDRESS_MAP_START( coolridr_submap, AS_PROGRAM, 32, coolridr_state )
AM_RANGE(0x00000000, 0x0001ffff) AM_ROM AM_SHARE("share2") // note: SH7032 only supports 64KB
@@ -3016,7 +3026,7 @@ static ADDRESS_MAP_START( coolridr_submap, AS_PROGRAM, 32, coolridr_state )
AM_RANGE(0x05000000, 0x05000fff) AM_RAM
AM_RANGE(0x05200000, 0x052001ff) AM_RAM
AM_RANGE(0x05300000, 0x0530ffff) AM_RAM AM_SHARE("share3") /*Communication area RAM*/
- AM_RANGE(0x05fffe00, 0x05ffffff) AM_READWRITE16(sh7032_r,sh7032_w,0xffffffff) // SH-7032H internal i/o
+// AM_RANGE(0x05fffe00, 0x05ffffff) AM_READWRITE16(sh7032_r,sh7032_w,0xffffffff) // SH-7032H internal i/o
AM_RANGE(0x06000000, 0x060001ff) AM_RAM AM_SHARE("nvram") // backup RAM
AM_RANGE(0x06100000, 0x06100003) AM_READ_PORT("IN0") AM_WRITE8(lamps_w,0x000000ff)
AM_RANGE(0x06100004, 0x06100007) AM_READ_PORT("IN1")
@@ -3032,6 +3042,14 @@ static ADDRESS_MAP_START( coolridr_submap, AS_PROGRAM, 32, coolridr_state )
AM_RANGE(0x60000000, 0x600003ff) AM_WRITENOP
ADDRESS_MAP_END
+static ADDRESS_MAP_START( aquastge_submap, AS_PROGRAM, 32, coolridr_state )
+ AM_RANGE(0x05210000, 0x0521ffff) AM_RAM AM_SHARE("share3") /*Communication area RAM*/
+ AM_RANGE(0x05200000, 0x0537ffff) AM_RAM
+ AM_RANGE(0x06000200, 0x06000207) AM_WRITENOP // program bug?
+ AM_RANGE(0x06100018, 0x0610001b) AM_READ_PORT("IN7")
+ AM_IMPORT_FROM(coolridr_submap)
+ADDRESS_MAP_END
+
/* TODO: what is this for, volume mixing? MIDI? */
WRITE8_MEMBER(coolridr_state::sound_to_sh1_w)
{
@@ -3055,6 +3073,134 @@ static GFXDECODE_START( coolridr )
// GFXDECODE_ENTRY( NULL, 0, tiles16x16_layout, 0, 0x100 )
GFXDECODE_END
+#define DUMMY_INPUT_PORT(_x_) \
+ PORT_START(_x_) \
+ PORT_DIPNAME( 0x00000001, 0x00000001, _x_ ) \
+ PORT_DIPSETTING( 0x00000001, DEF_STR( Off ) ) \
+ PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) \
+ PORT_DIPNAME( 0x00000002, 0x00000002, DEF_STR( Unknown ) ) \
+ PORT_DIPSETTING( 0x00000002, DEF_STR( Off ) ) \
+ PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) \
+ PORT_DIPNAME( 0x00000004, 0x00000004, DEF_STR( Unknown ) ) \
+ PORT_DIPSETTING( 0x00000004, DEF_STR( Off ) ) \
+ PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) \
+ PORT_DIPNAME( 0x00000008, 0x00000008, DEF_STR( Unknown ) ) \
+ PORT_DIPSETTING( 0x00000008, DEF_STR( Off ) ) \
+ PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) \
+ PORT_DIPNAME( 0x00000010, 0x00000010, DEF_STR( Unknown ) ) \
+ PORT_DIPSETTING( 0x00000010, DEF_STR( Off ) ) \
+ PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) \
+ PORT_DIPNAME( 0x00000020, 0x00000020, DEF_STR( Unknown ) ) \
+ PORT_DIPSETTING( 0x00000020, DEF_STR( Off ) ) \
+ PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) \
+ PORT_DIPNAME( 0x00000040, 0x00000040, DEF_STR( Unknown ) ) \
+ PORT_DIPSETTING( 0x00000040, DEF_STR( Off ) ) \
+ PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) \
+ PORT_DIPNAME( 0x00000080, 0x00000080, DEF_STR( Unknown ) ) \
+ PORT_DIPSETTING( 0x00000080, DEF_STR( Off ) ) \
+ PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) \
+ PORT_DIPNAME( 0x00010000, 0x00010000, _x_ ) \
+ PORT_DIPSETTING( 0x00010000, DEF_STR( Off ) ) \
+ PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) \
+ PORT_DIPNAME( 0x00020000, 0x00020000, DEF_STR( Unknown ) ) \
+ PORT_DIPSETTING( 0x00020000, DEF_STR( Off ) ) \
+ PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) \
+ PORT_DIPNAME( 0x00040000, 0x00040000, DEF_STR( Unknown ) ) \
+ PORT_DIPSETTING( 0x00040000, DEF_STR( Off ) ) \
+ PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) \
+ PORT_DIPNAME( 0x00080000, 0x00080000, DEF_STR( Unknown ) ) \
+ PORT_DIPSETTING( 0x00080000, DEF_STR( Off ) ) \
+ PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) \
+ PORT_DIPNAME( 0x00100000, 0x00100000, DEF_STR( Unknown ) ) \
+ PORT_DIPSETTING( 0x00100000, DEF_STR( Off ) ) \
+ PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) \
+ PORT_DIPNAME( 0x00200000, 0x00200000, DEF_STR( Unknown ) ) \
+ PORT_DIPSETTING( 0x00200000, DEF_STR( Off ) ) \
+ PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) \
+ PORT_DIPNAME( 0x00400000, 0x00400000, DEF_STR( Unknown ) ) \
+ PORT_DIPSETTING( 0x00400000, DEF_STR( Off ) ) \
+ PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) \
+ PORT_DIPNAME( 0x00800000, 0x00800000, DEF_STR( Unknown ) ) \
+ PORT_DIPSETTING( 0x00800000, DEF_STR( Off ) ) \
+ PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) \
+ PORT_BIT( 0xff00ff00, IP_ACTIVE_LOW, IPT_UNUSED ) \
+
+static INPUT_PORTS_START( aquastge )
+ DUMMY_INPUT_PORT("IN0")
+
+ PORT_START("IN1")
+ PORT_DIPNAME( 0x00000001, 0x00000001, "IN1" )
+ PORT_DIPSETTING( 0x00000001, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x00000000, DEF_STR( On ) )
+ PORT_DIPNAME( 0x00000002, 0x00000002, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x00000002, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x00000000, DEF_STR( On ) )
+ PORT_DIPNAME( 0x00000004, 0x00000004, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x00000004, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x00000000, DEF_STR( On ) )
+ PORT_DIPNAME( 0x00000008, 0x00000008, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x00000008, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x00000000, DEF_STR( On ) )
+ PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
+ PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
+ PORT_DIPNAME( 0x00000040, 0x00000040, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x00000040, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x00000000, DEF_STR( On ) )
+ PORT_DIPNAME( 0x00000080, 0x00000080, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x00000080, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x00000000, DEF_STR( On ) )
+ PORT_BIT( 0x00010000, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_NAME("P1 Coin")
+ PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_NAME("P2 Coin")
+ PORT_SERVICE_NO_TOGGLE( 0x00040000, IP_ACTIVE_LOW )
+ PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("P1 Service Switch")
+ PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("P1 Start")
+ PORT_BIT( 0x00200000, IP_ACTIVE_LOW, IPT_START2 ) PORT_NAME("P2 Start")
+ PORT_BIT( 0x00400000, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("P2 Service Switch")
+ PORT_BIT( 0x00800000, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0xff00ff00, IP_ACTIVE_LOW, IPT_UNUSED )
+
+ DUMMY_INPUT_PORT("IN2")
+
+ DUMMY_INPUT_PORT("IN3")
+
+ DUMMY_INPUT_PORT("IN5")
+
+ DUMMY_INPUT_PORT("IN6")
+
+ DUMMY_INPUT_PORT("IN7")
+
+ PORT_START("AN0")
+ PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
+
+ PORT_START("AN1")
+ PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
+
+ PORT_START("AN2")
+ PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
+
+ PORT_START("AN3")
+ PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
+
+ PORT_START("AN4")
+ PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
+
+ PORT_START("AN5")
+ PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
+
+ PORT_START("AN6")
+ PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
+
+ PORT_START("AN7")
+ PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
+
+
+ // driver debug
+ PORT_START("CONFIG")
+ PORT_CONFNAME( 0x01, 0x01, "Use Threading Code" )
+ PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x01, DEF_STR( On ) )
+INPUT_PORTS_END
+
static INPUT_PORTS_START( coolridr )
PORT_START("IN0")
PORT_DIPNAME( 0x00000001, 0x00000001, "IN0-0" )
@@ -3621,6 +3767,14 @@ static MACHINE_CONFIG_START( coolridr, coolridr_state )
MCFG_SOUND_ROUTE(0, "rspeaker", 1.0)
MACHINE_CONFIG_END
+static MACHINE_CONFIG_DERIVED( aquastge, coolridr )
+ MCFG_CPU_MODIFY("maincpu")
+ MCFG_CPU_PROGRAM_MAP(aquastge_h1_map)
+
+ MCFG_CPU_MODIFY("sub")
+ MCFG_CPU_PROGRAM_MAP(aquastge_submap)
+MACHINE_CONFIG_END
+
ROM_START( coolridr )
ROM_REGION( 0x200000, "maincpu", 0 ) /* SH2 code */
ROM_LOAD32_WORD_SWAP( "ep17659.30", 0x0000000, 0x080000, CRC(473027b0) SHA1(acaa212869dd79550235171b9f054e82750f74c3) )
@@ -3665,6 +3819,46 @@ ROM_START( coolridr )
ROM_END
+ROM_START( aquastge )
+ ROM_REGION( 0x200000, "maincpu", 0 ) /* SH2 code */
+ ROM_LOAD32_WORD_SWAP( "epr-18280.ic30", 0x0000000, 0x080000, CRC(4038352a) SHA1(fe951592e2462c701c740da4ec77435ae3026eab) )
+ ROM_LOAD32_WORD_SWAP( "epr-18279.ic29", 0x0000002, 0x080000, CRC(9697cbcd) SHA1(4afa9a3f85b9d4483dafae8a98526ae32abd7103) )
+ ROM_LOAD32_WORD_SWAP( "epr-18282.ic32", 0x0100000, 0x080000, CRC(53684dd8) SHA1(59759f6e3f815280a2406cc2133fc46e673cc76a))
+ ROM_LOAD32_WORD_SWAP( "epr-18281.ic31", 0x0100002, 0x080000, CRC(f1233190) SHA1(471578c9343ac7198d73bee73975656c52e0bc5d) )
+
+ /* Page 12 of the service manual states that these 4 regions are tested, so I believe that they are read by the SH-2 */
+ ROM_REGION32_BE( 0x1000000, "gfx_data", ROMREGION_ERASEFF ) /* SH2 code */
+ ROM_LOAD32_WORD_SWAP( "mpr-18283.ic17", 0x0c00002, 0x0200000, CRC(f42e2e72) SHA1(caf8733b6888ee718032c55f64da14590353517e) )
+ ROM_RELOAD(0x0000002, 0x0200000)
+ ROM_LOAD32_WORD_SWAP( "mpr-18284.ic18", 0x0c00000, 0x0200000, CRC(5fdf3c1f) SHA1(9976fe4afc3234eecbaf47a2e0f951b6fe1cb5f5) )
+ ROM_RELOAD(0x0000000, 0x0200000)
+
+ ROM_REGION( 0x100000, "soundcpu", ROMREGION_ERASE00 ) /* 68000 */
+
+ ROM_REGION( 0x100000, "sub", 0 ) /* SH1 */
+ ROM_LOAD16_WORD_SWAP( "epr-18278.ic12", 0x000000, 0x020000, CRC(e601132a) SHA1(bed103ef2e0dfa8bb485d93d661142b82c23088b) )
+
+ /* these are compressed sprite data */
+ ROM_REGION( 0x2800000, "compressedgfx", ROMREGION_ERASEFF )
+ ROM_LOAD16_WORD_SWAP( "mpr-18289.ic5", 0x0000000, 0x0200000, CRC(fb212692) SHA1(da2f77564e718276c66b0f02e72a97d7b3653c35) ) // 0004
+ ROM_LOAD16_WORD_SWAP( "mpr-18288.ic4", 0x0400000, 0x0200000, CRC(558c82ee) SHA1(e2ae4f2e81c7360eedd1b18e36d1f6ca6c015fee) ) // 9000
+ ROM_LOAD16_WORD_SWAP( "mpr-18287.ic3", 0x0800000, 0x0200000, CRC(bf8743d8) SHA1(8d0e0691ec062f1939db8f6b75edb92d34417f81) ) // 4900
+ ROM_LOAD16_WORD_SWAP( "mpr-18286.ic2", 0x0c00000, 0x0200000, CRC(3eb95e9a) SHA1(d565e5f353327e16f7ead2251fd9a503bf46e210) ) // 0490
+ ROM_LOAD16_WORD_SWAP( "mpr-18285.ic1", 0x1000000, 0x0200000, CRC(8390453c) SHA1(e7d3a6579d9805a71b954bb248a2da749e9d9d38) ) // 0049
+ ROM_LOAD16_WORD_SWAP( "mpr-18294.ic10",0x1400000, 0x0200000, CRC(341ebd4a) SHA1(9d9a1c09d81a50132edcc18a99266416683f4ff6) ) // 0004
+ ROM_LOAD16_WORD_SWAP( "mpr-18293.ic9", 0x1800000, 0x0200000, CRC(f76bc076) SHA1(f5a8f9bd26b2e8533a1fbf8da6938373df971749)) // 9000
+ ROM_LOAD16_WORD_SWAP( "mpr-18292.ic8", 0x1c00000, 0x0200000, CRC(59a713f9) SHA1(388b833fa6fb930f26c80674606505ec80668a16) ) // 4900
+ ROM_LOAD16_WORD_SWAP( "mpr-18291.ic7", 0x2000000, 0x0200000, CRC(b6c167bd) SHA1(4990bae50e8804b2e1048aa5c64b086e8427073f) ) // 0490
+ ROM_LOAD16_WORD_SWAP( "mpr-18290.ic6", 0x2400000, 0x0200000, CRC(11f7adb0) SHA1(a72f9892f93506456edc7ffc66224446a58ca38b) ) // 0049
+
+ ROM_REGION( 0x80000, "scsp1", 0 ) /* first SCSP's RAM */
+ ROM_FILL( 0x000000, 0x80000, 0 )
+
+ ROM_REGION( 0x80000, "scsp2", 0 ) /* second SCSP's RAM */
+ ROM_FILL( 0x000000, 0x80000, 0 )
+ROM_END
+
+
/*
TODO: both irq routines writes 1 to 0x60d8894, sets up the Watchdog timer then expect that this buffer goes low IN the irq routines.
The Watchdog Timer is setted up with these params:
@@ -3704,6 +3898,20 @@ READ32_MEMBER(coolridr_state::coolridr_hack2_r)
}
+READ32_MEMBER(coolridr_state::aquastge_hack_r)
+{
+ offs_t pc = downcast<cpu_device *>(&space.device())->pc();
+
+ if ((pc == 0x6009e76) || (pc == 0x6009e78))
+ return 0;
+ else
+ {
+// printf("pc %08x\n", pc);
+ }
+
+ return m_sysh1_workram_h[0xc3fd8/4];
+}
+
DRIVER_INIT_MEMBER(coolridr_state,coolridr)
{
@@ -3712,6 +3920,8 @@ DRIVER_INIT_MEMBER(coolridr_state,coolridr)
m_maincpu->sh2drc_set_options(SH2DRC_FASTEST_OPTIONS);
m_subcpu->sh2drc_set_options(SH2DRC_FASTEST_OPTIONS);
+ m_colbase = 0x7b20;
+
// work around the hack when mapping the workram directly
m_maincpu->sh2drc_add_fastram(0x06000000, 0x060d7fff, 0, &m_sysh1_workram_h[0]);
m_maincpu->sh2drc_add_fastram(0x060d9000, 0x060fffff, 0, &m_sysh1_workram_h[0xd9000/4]);
@@ -3719,4 +3929,19 @@ DRIVER_INIT_MEMBER(coolridr_state,coolridr)
m_maincpu->sh2drc_add_fastram(0x20000000, 0x201fffff, 1, &m_rom[0]);
}
+DRIVER_INIT_MEMBER(coolridr_state, aquastge)
+{
+ m_maincpu->space(AS_PROGRAM).install_read_handler(0x60c3fd8, 0x60c3fdb, read32_delegate(FUNC(coolridr_state::aquastge_hack_r), this));
+
+
+
+
+ m_maincpu->sh2drc_set_options(SH2DRC_FASTEST_OPTIONS);
+ m_subcpu->sh2drc_set_options(SH2DRC_FASTEST_OPTIONS);
+
+ m_colbase = 0;
+}
+
GAME( 1995, coolridr, 0, coolridr, coolridr, coolridr_state, coolridr, ROT0, "Sega", "Cool Riders",GAME_IMPERFECT_SOUND) // region is set in test mode, this set is for Japan, USA and Export (all regions)
+GAME( 1995, aquastge, 0, aquastge, aquastge, coolridr_state, aquastge, ROT0, "Sega", "Aqua Stage",GAME_NOT_WORKING)
+
diff --git a/src/mame/drivers/cps1.c b/src/mame/drivers/cps1.c
index 1206481492b..bdb22c80e1b 100644
--- a/src/mame/drivers/cps1.c
+++ b/src/mame/drivers/cps1.c
@@ -622,6 +622,10 @@ ADDRESS_MAP_START( qsound_sub_map, AS_PROGRAM, 8, cps_state ) // used by cps2.
AM_RANGE(0xf000, 0xffff) AM_RAM AM_SHARE("qsound_ram2")
ADDRESS_MAP_END
+ADDRESS_MAP_START( qsound_decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 8, cps_state )
+ AM_RANGE(0x0000, 0x7fff) AM_ROMBANK("decrypted")
+ADDRESS_MAP_END
+
static ADDRESS_MAP_START( sf2m3_map, AS_PROGRAM, 16, cps_state )
AM_RANGE(0x000000, 0x3fffff) AM_ROM
AM_RANGE(0x800010, 0x800011) AM_READ_PORT("IN1") /* Player input ports */
@@ -3238,6 +3242,7 @@ static MACHINE_CONFIG_DERIVED( qsound, cps1_12MHz )
MCFG_CPU_REPLACE("audiocpu", Z80, XTAL_8MHz) /* verified on pcb */
MCFG_CPU_PROGRAM_MAP(qsound_sub_map)
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(qsound_decrypted_opcodes_map)
MCFG_CPU_PERIODIC_INT_DRIVER(cps_state, irq0_line_hold, 250) // measured (cps2.c)
MCFG_MACHINE_START_OVERRIDE(cps_state, qsound)
@@ -9596,6 +9601,42 @@ ROM_START( varthj )
ROM_LOAD( "ioc1.ic1", 0x0000, 0x0117, CRC(0d182081) SHA1(475b3d417785da4bc512cce2b274bb00d4cc6792) )
ROM_END
+/* B-Board 91634B-2, Japan Resale Ver. */
+ROM_START( varthjr )
+ ROM_REGION( CODE_SIZE, "maincpu", 0 ) /* 68000 code */
+ ROM_LOAD16_WORD_SWAP( "vaj_23b.8f", 0x00000, 0x80000, CRC(ad3d3522) SHA1(db627233f9d8a03c2d4bb31614951a0cdc81600d) )
+ ROM_LOAD16_WORD_SWAP( "vaj_22b.7f", 0x80000, 0x80000, CRC(034e3e55) SHA1(eeb85a827cf18dafbdf0a2828aa39128352857f3) )
+
+ ROM_REGION( 0x200000, "gfx", 0 )
+ ROMX_LOAD( "va_01.3a", 0x000000, 0x80000, CRC(b1fb726e) SHA1(5ac0876b6c49d0a99710dda68653664f4d8c1167) , ROM_GROUPWORD | ROM_SKIP(6) ) // == va-5m.7a
+ ROMX_LOAD( "va_02.4a", 0x000002, 0x80000, CRC(4c6588cd) SHA1(d14e8cf051ac934ccc989d8c571c6cc9eed34af5) , ROM_GROUPWORD | ROM_SKIP(6) ) // == va-7m.9a
+ ROMX_LOAD( "va_03.5a", 0x000004, 0x80000, CRC(0b1ace37) SHA1(6f9493c22f667f683db2789972fd16bb94724679) , ROM_GROUPWORD | ROM_SKIP(6) ) // == va-1m.3a
+ ROMX_LOAD( "va_04.6a", 0x000006, 0x80000, CRC(44dfe706) SHA1(a013a434df3161a91aafbb35dc4e20dfb3f177f4) , ROM_GROUPWORD | ROM_SKIP(6) ) // == va-3m.5a
+
+ ROM_REGION( 0x18000, "audiocpu", 0 ) /* 64k for the audio CPU (+banks) */
+ ROM_LOAD( "va_09.12a", 0x00000, 0x08000, CRC(7a99446e) SHA1(ca027f41e3e58be5abc33ad7380746658cb5380a) )
+ ROM_CONTINUE( 0x10000, 0x08000 )
+
+ ROM_REGION( 0x40000, "oki", 0 ) /* Samples */
+ ROM_LOAD( "va_18.11c", 0x00000, 0x20000, CRC(de30510e) SHA1(8e878696192606b76a3a0e53553e638d9621cff7) )
+ ROM_LOAD( "va_19.12c", 0x20000, 0x20000, CRC(0610a4ac) SHA1(3da02ea6a7a56c85de898806d2a1cf6bc526c1b3) )
+
+ ROM_REGION( 0x0200, "aboardplds", 0 )
+ ROM_LOAD( "buf1", 0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
+ ROM_LOAD( "ioa1", 0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
+ ROM_LOAD( "prg1", 0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
+ ROM_LOAD( "rom1", 0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) )
+ ROM_LOAD( "sou1", 0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) )
+
+ ROM_REGION( 0x0200, "bboardplds", 0 )
+ ROM_LOAD( "va63b.1a", 0x0000, 0x0117, BAD_DUMP CRC(38540e86) SHA1(86e0aba363108f80a8eff84b99d11528ad6db099) ) /* Handcrafted but works on actual US PCB. Redump needed */
+ ROM_LOAD( "iob1.12d", 0x0000, 0x0117, CRC(3abc0700) SHA1(973043aa46ec6d5d1db20dc9d5937005a0f9f6ae) )
+ ROM_LOAD( "bprg1.11d", 0x0000, 0x0117, CRC(31793da7) SHA1(400fa7ac517421c978c1ee7773c30b9ed0c5d3f3) )
+
+ ROM_REGION( 0x0200, "cboardplds", 0 )
+ ROM_LOAD( "ioc1.ic1", 0x0000, 0x0117, CRC(0d182081) SHA1(475b3d417785da4bc512cce2b274bb00d4cc6792) )
+ROM_END
+
/* B-Board 89625B-1 */
ROM_START( qad )
ROM_REGION( CODE_SIZE, "maincpu", 0 ) /* 68000 code */
@@ -11551,27 +11592,35 @@ DRIVER_INIT_MEMBER( cps_state, sf2m8 )
DRIVER_INIT_CALL(cps1);
}
+void cps_state::kabuki_setup(void (*decode)(UINT8 *src, UINT8 *dst))
+{
+ UINT8 *decrypt = auto_alloc_array(machine(), UINT8, 0x8000);
+ UINT8 *rom = memregion("audiocpu")->base();
+ decode(rom, decrypt);
+ membank("decrypted")->set_base(decrypt);
+}
+
DRIVER_INIT_MEMBER(cps_state,wof)
{
- wof_decode(machine());
+ kabuki_setup(wof_decode);
DRIVER_INIT_CALL(cps1);
}
DRIVER_INIT_MEMBER(cps_state,dino)
{
- dino_decode(machine());
+ kabuki_setup(dino_decode);
DRIVER_INIT_CALL(cps1);
}
DRIVER_INIT_MEMBER(cps_state,punisher)
{
- punisher_decode(machine());
+ kabuki_setup(punisher_decode);
DRIVER_INIT_CALL(cps1);
}
DRIVER_INIT_MEMBER(cps_state,slammast)
{
- slammast_decode(machine());
+ kabuki_setup(slammast_decode);
DRIVER_INIT_CALL(cps1);
}
@@ -11806,6 +11855,7 @@ GAME( 1992, varth, 0, cps1_12MHz, varth, cps_state, cps1,
GAME( 1992, varthr1, varth, cps1_12MHz, varth, cps_state, cps1, ROT270, "Capcom", "Varth: Operation Thunderstorm (World 920612)", GAME_SUPPORTS_SAVE ) // "ETC"
GAME( 1992, varthu, varth, cps1_12MHz, varth, cps_state, cps1, ROT270, "Capcom (Romstar license)", "Varth: Operation Thunderstorm (USA 920612)", GAME_SUPPORTS_SAVE )
GAME( 1992, varthj, varth, cps1_12MHz, varth, cps_state, cps1, ROT270, "Capcom", "Varth: Operation Thunderstorm (Japan 920714)", GAME_SUPPORTS_SAVE )
+GAME( 1992, varthjr, varth, cps1_12MHz, varth, cps_state, cps1, ROT270, "Capcom", "Varth: Operation Thunderstorm (Japan Resale Ver. 920714)", GAME_SUPPORTS_SAVE )
GAME( 1992, qad, 0, cps1_12MHz, qad, cps_state, cps1, ROT0, "Capcom", "Quiz & Dragons: Capcom Quiz Game (USA 920701)", GAME_SUPPORTS_SAVE ) // 12MHz verified
GAME( 1994, qadjr, qad, cps1_12MHz, qadjr, cps_state, cps1, ROT0, "Capcom", "Quiz & Dragons: Capcom Quiz Game (Japan Resale Ver. 940921)", GAME_SUPPORTS_SAVE )
GAME( 1992, wof, 0, qsound, wof, cps_state, wof, ROT0, "Capcom", "Warriors of Fate (World 921031)", GAME_SUPPORTS_SAVE ) // "ETC"
diff --git a/src/mame/drivers/cps2.c b/src/mame/drivers/cps2.c
index aba0c3e76e7..4693b1f97ef 100644
--- a/src/mame/drivers/cps2.c
+++ b/src/mame/drivers/cps2.c
@@ -632,6 +632,7 @@ Stephh's inputs notes (based on some tests on the "parent" set) :
#include "sound/okim6295.h"
#include "includes/cps1.h" // External CPS1 definitions
+#include "machine/cps2crypt.h"
/*************************************
@@ -884,6 +885,9 @@ static ADDRESS_MAP_START( cps2_map, AS_PROGRAM, 16, cps_state )
AM_RANGE(0xff0000, 0xffffff) AM_RAM /* RAM */
ADDRESS_MAP_END
+static ADDRESS_MAP_START( decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 16, cps_state )
+ AM_RANGE(0x000000, 0x3fffff) AM_ROM AM_SHARE("decrypted_opcodes") /* 68000 ROM */
+ADDRESS_MAP_END
static ADDRESS_MAP_START( dead_cps2_map, AS_PROGRAM, 16, cps_state )
AM_RANGE(0x000000, 0x3fffff) AM_ROM /* 68000 ROM */
@@ -1205,7 +1209,7 @@ INPUT_PORTS_END
MACHINE_START_MEMBER(cps_state,cps2)
{
- if (m_audiocpu != NULL) // gigaman2 has no audiocpu
+ if (m_audiocpu != NULL) // gigaman2 has an AT89C4051 (8051) MCU as an audio cpu, no qsound.
membank("bank1")->configure_entries(0, (QSOUND_SIZE - 0x10000) / 0x4000, memregion("audiocpu")->base() + 0x10000, 0x4000);
}
@@ -1215,6 +1219,7 @@ static MACHINE_CONFIG_START( cps2, cps_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, XTAL_16MHz)
MCFG_CPU_PROGRAM_MAP(cps2_map)
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", cps_state, cps2_interrupt, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80, XTAL_8MHz)
@@ -1251,14 +1256,17 @@ static MACHINE_CONFIG_DERIVED( dead_cps2, cps2 )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(dead_cps2_map)
+ MCFG_DEVICE_REMOVE_ADDRESS_MAP(AS_DECRYPTED_OPCODES)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( gigaman2, cps2 )
MCFG_DEVICE_REMOVE("audiocpu")
-
+ // gigaman2 has an AT89C4051 (8051) MCU as an audio cpu, no qsound.
MCFG_DEVICE_REMOVE("qsound")
+ MCFG_CPU_MODIFY("maincpu")
+
MCFG_OKIM6295_ADD("oki", XTAL_32MHz/32, OKIM6295_PIN7_HIGH) // clock frequency & pin 7 not verified
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.47)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.47)
@@ -1293,6 +1301,8 @@ ROM_START( 1944 )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "nff.11m", 0x000000, 0x400000, CRC(243e4e05) SHA1(83281f7290ac105a3f9a7507cbc11317d45ba706) )
ROM_LOAD16_WORD_SWAP( "nff.12m", 0x400000, 0x400000, CRC(4fcf1600) SHA1(36f18c5d92b79433bdf7088b29a244708929d48e) )
+
+ _1944_USA_KEY
ROM_END
ROM_START( 1944j )
@@ -1318,6 +1328,8 @@ ROM_START( 1944j )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "nff.11m", 0x000000, 0x400000, CRC(243e4e05) SHA1(83281f7290ac105a3f9a7507cbc11317d45ba706) )
ROM_LOAD16_WORD_SWAP( "nff.12m", 0x400000, 0x400000, CRC(4fcf1600) SHA1(36f18c5d92b79433bdf7088b29a244708929d48e) )
+
+ _1944_JAPAN_KEY
ROM_END
ROM_START( 19xx )
@@ -1345,6 +1357,8 @@ ROM_START( 19xx )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "19x.11m", 0x000000, 0x200000, CRC(d38beef3) SHA1(134e961b926a97cca5e45d3558efb98f6f278e08) )
ROM_LOAD16_WORD_SWAP( "19x.12m", 0x200000, 0x200000, CRC(d47c96e2) SHA1(3c1b5563f8e7ee1c450b3592fcb319e928caec3c) )
+
+ _19XX_USA_KEY
ROM_END
@@ -1392,6 +1406,8 @@ ROM_START( 19xxj )
ROM_LOAD16_WORD_SWAP( "19x-56.11a", 0x280000, 0x080000, CRC(dfa8819f) SHA1(b5112ced4632c888aee0ca6c1bc4b5097bbdabda) )
ROM_LOAD16_WORD_SWAP( "19x-57.12a", 0x300000, 0x080000, CRC(229ba777) SHA1(2506b967689697fdb4e43d8b01fc9b564641a70d) )
ROM_LOAD16_WORD_SWAP( "19x-58.13a", 0x380000, 0x080000, CRC(c7dceba4) SHA1(6a2684bc9738a3f6d071d72ffa678316a029f1c5) )
+
+ _19XX_JAPAN_KEY
ROM_END
ROM_START( 19xxjr1 )
@@ -1419,6 +1435,8 @@ ROM_START( 19xxjr1 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "19x.11m", 0x000000, 0x200000, CRC(d38beef3) SHA1(134e961b926a97cca5e45d3558efb98f6f278e08) )
ROM_LOAD16_WORD_SWAP( "19x.12m", 0x200000, 0x200000, CRC(d47c96e2) SHA1(3c1b5563f8e7ee1c450b3592fcb319e928caec3c) )
+
+ _19XX_JAPAN_KEY
ROM_END
ROM_START( 19xxjr2 )
@@ -1446,6 +1464,8 @@ ROM_START( 19xxjr2 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "19x.11m", 0x000000, 0x200000, CRC(d38beef3) SHA1(134e961b926a97cca5e45d3558efb98f6f278e08) )
ROM_LOAD16_WORD_SWAP( "19x.12m", 0x200000, 0x200000, CRC(d47c96e2) SHA1(3c1b5563f8e7ee1c450b3592fcb319e928caec3c) )
+
+ _19XX_JAPAN_KEY
ROM_END
ROM_START( 19xxa )
@@ -1473,6 +1493,8 @@ ROM_START( 19xxa )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "19x.11m", 0x000000, 0x200000, CRC(d38beef3) SHA1(134e961b926a97cca5e45d3558efb98f6f278e08) )
ROM_LOAD16_WORD_SWAP( "19x.12m", 0x200000, 0x200000, CRC(d47c96e2) SHA1(3c1b5563f8e7ee1c450b3592fcb319e928caec3c) )
+
+ _19XX_ASIA_KEY
ROM_END
ROM_START( 19xxar1 )
@@ -1500,6 +1522,9 @@ ROM_START( 19xxar1 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "19x.11m", 0x000000, 0x200000, CRC(d38beef3) SHA1(134e961b926a97cca5e45d3558efb98f6f278e08) )
ROM_LOAD16_WORD_SWAP( "19x.12m", 0x200000, 0x200000, CRC(d47c96e2) SHA1(3c1b5563f8e7ee1c450b3592fcb319e928caec3c) )
+
+ _19XX_ASIA_KEY
+
ROM_END
ROM_START( 19xxh )
@@ -1527,6 +1552,8 @@ ROM_START( 19xxh )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "19x.11m", 0x000000, 0x200000, CRC(d38beef3) SHA1(134e961b926a97cca5e45d3558efb98f6f278e08) )
ROM_LOAD16_WORD_SWAP( "19x.12m", 0x200000, 0x200000, CRC(d47c96e2) SHA1(3c1b5563f8e7ee1c450b3592fcb319e928caec3c) )
+
+ _19XX_HISPANIC_KEY
ROM_END
ROM_START( 19xxb )
@@ -1554,6 +1581,8 @@ ROM_START( 19xxb )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "19x.11m", 0x000000, 0x200000, CRC(d38beef3) SHA1(134e961b926a97cca5e45d3558efb98f6f278e08) )
ROM_LOAD16_WORD_SWAP( "19x.12m", 0x200000, 0x200000, CRC(d47c96e2) SHA1(3c1b5563f8e7ee1c450b3592fcb319e928caec3c) )
+
+ _19XX_BRAZIL_KEY
ROM_END
ROM_START( armwar )
@@ -1585,6 +1614,8 @@ ROM_START( armwar )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "pwg.11m", 0x000000, 0x200000, CRC(a78f7433) SHA1(e47ffba7b9dac9d0dda985c5d966194be18260f7) )
ROM_LOAD16_WORD_SWAP( "pwg.12m", 0x200000, 0x200000, CRC(77438ed0) SHA1(733ca6c6a792e66e2aa12c5fc06dd459527afe4b) )
+
+ ARMWAR_WORLD_KEY
ROM_END
ROM_START( armwarr1 )
@@ -1616,6 +1647,8 @@ ROM_START( armwarr1 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "pwg.11m", 0x000000, 0x200000, CRC(a78f7433) SHA1(e47ffba7b9dac9d0dda985c5d966194be18260f7) )
ROM_LOAD16_WORD_SWAP( "pwg.12m", 0x200000, 0x200000, CRC(77438ed0) SHA1(733ca6c6a792e66e2aa12c5fc06dd459527afe4b) )
+
+ ARMWAR_WORLD_KEY
ROM_END
ROM_START( armwaru )
@@ -1647,6 +1680,8 @@ ROM_START( armwaru )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "pwg.11m", 0x000000, 0x200000, CRC(a78f7433) SHA1(e47ffba7b9dac9d0dda985c5d966194be18260f7) )
ROM_LOAD16_WORD_SWAP( "pwg.12m", 0x200000, 0x200000, CRC(77438ed0) SHA1(733ca6c6a792e66e2aa12c5fc06dd459527afe4b) )
+
+ ARMWAR_USA_KEY
ROM_END
ROM_START( armwaru1 )
@@ -1678,6 +1713,8 @@ ROM_START( armwaru1 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "pwg.11m", 0x000000, 0x200000, CRC(a78f7433) SHA1(e47ffba7b9dac9d0dda985c5d966194be18260f7) )
ROM_LOAD16_WORD_SWAP( "pwg.12m", 0x200000, 0x200000, CRC(77438ed0) SHA1(733ca6c6a792e66e2aa12c5fc06dd459527afe4b) )
+
+ ARMWAR_USA_KEY
ROM_END
ROM_START( pgear )
@@ -1709,6 +1746,8 @@ ROM_START( pgear )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "pwg.11m", 0x000000, 0x200000, CRC(a78f7433) SHA1(e47ffba7b9dac9d0dda985c5d966194be18260f7) )
ROM_LOAD16_WORD_SWAP( "pwg.12m", 0x200000, 0x200000, CRC(77438ed0) SHA1(733ca6c6a792e66e2aa12c5fc06dd459527afe4b) )
+
+ ARMWAR_JAPAN_KEY
ROM_END
ROM_START( pgearr1 )
@@ -1740,6 +1779,8 @@ ROM_START( pgearr1 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "pwg.11m", 0x000000, 0x200000, CRC(a78f7433) SHA1(e47ffba7b9dac9d0dda985c5d966194be18260f7) )
ROM_LOAD16_WORD_SWAP( "pwg.12m", 0x200000, 0x200000, CRC(77438ed0) SHA1(733ca6c6a792e66e2aa12c5fc06dd459527afe4b) )
+
+ ARMWAR_JAPAN_KEY
ROM_END
ROM_START( armwara )
@@ -1771,6 +1812,8 @@ ROM_START( armwara )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "pwg.11m", 0x000000, 0x200000, CRC(a78f7433) SHA1(e47ffba7b9dac9d0dda985c5d966194be18260f7) )
ROM_LOAD16_WORD_SWAP( "pwg.12m", 0x200000, 0x200000, CRC(77438ed0) SHA1(733ca6c6a792e66e2aa12c5fc06dd459527afe4b) )
+
+ ARMWAR_ASIA_KEY
ROM_END
ROM_START( armwarar1 )
@@ -1802,6 +1845,8 @@ ROM_START( armwarar1 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "pwg.11m", 0x000000, 0x200000, CRC(a78f7433) SHA1(e47ffba7b9dac9d0dda985c5d966194be18260f7) )
ROM_LOAD16_WORD_SWAP( "pwg.12m", 0x200000, 0x200000, CRC(77438ed0) SHA1(733ca6c6a792e66e2aa12c5fc06dd459527afe4b) )
+
+ ARMWAR_ASIA_KEY
ROM_END
ROM_START( avsp )
@@ -1828,6 +1873,8 @@ ROM_START( avsp )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "avp.11m", 0x000000, 0x200000, CRC(83499817) SHA1(e65b0ebd61ddc748842a9d4d92404b5305307623) )
ROM_LOAD16_WORD_SWAP( "avp.12m", 0x200000, 0x200000, CRC(f4110d49) SHA1(f27538776cc1ba8213f19f98728ed8c02508d3ac) )
+
+ AVSP_WORLD_KEY
ROM_END
ROM_START( avspu )
@@ -1854,6 +1901,8 @@ ROM_START( avspu )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "avp.11m", 0x000000, 0x200000, CRC(83499817) SHA1(e65b0ebd61ddc748842a9d4d92404b5305307623) )
ROM_LOAD16_WORD_SWAP( "avp.12m", 0x200000, 0x200000, CRC(f4110d49) SHA1(f27538776cc1ba8213f19f98728ed8c02508d3ac) )
+
+ AVSP_USA_KEY
ROM_END
ROM_START( avspj )
@@ -1880,6 +1929,8 @@ ROM_START( avspj )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "avp.11m", 0x000000, 0x200000, CRC(83499817) SHA1(e65b0ebd61ddc748842a9d4d92404b5305307623) )
ROM_LOAD16_WORD_SWAP( "avp.12m", 0x200000, 0x200000, CRC(f4110d49) SHA1(f27538776cc1ba8213f19f98728ed8c02508d3ac) )
+
+ AVSP_JAPAN_KEY
ROM_END
ROM_START( avspa )
@@ -1906,6 +1957,8 @@ ROM_START( avspa )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "avp.11m", 0x000000, 0x200000, CRC(83499817) SHA1(e65b0ebd61ddc748842a9d4d92404b5305307623) )
ROM_LOAD16_WORD_SWAP( "avp.12m", 0x200000, 0x200000, CRC(f4110d49) SHA1(f27538776cc1ba8213f19f98728ed8c02508d3ac) )
+
+ AVSP_ASIA_KEY
ROM_END
ROM_START( avsph )
@@ -1932,6 +1985,8 @@ ROM_START( avsph )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "avp.11m", 0x000000, 0x200000, CRC(83499817) SHA1(e65b0ebd61ddc748842a9d4d92404b5305307623) )
ROM_LOAD16_WORD_SWAP( "avp.12m", 0x200000, 0x200000, CRC(f4110d49) SHA1(f27538776cc1ba8213f19f98728ed8c02508d3ac) )
+
+ AVSP_HISPANIC_KEY
ROM_END
ROM_START( batcir )
@@ -1958,6 +2013,8 @@ ROM_START( batcir )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "btc.11m", 0x000000, 0x200000, CRC(c27f2229) SHA1(df2459493af40937b6656a16fad43ff51bed2204) )
ROM_LOAD16_WORD_SWAP( "btc.12m", 0x200000, 0x200000, CRC(418a2e33) SHA1(0642ddff2ab9255f154419da24ba644ed63f34ab) )
+
+ BATCIR_WORLD_KEY
ROM_END
ROM_START( batcirj )
@@ -1984,6 +2041,8 @@ ROM_START( batcirj )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "btc.11m", 0x000000, 0x200000, CRC(c27f2229) SHA1(df2459493af40937b6656a16fad43ff51bed2204) )
ROM_LOAD16_WORD_SWAP( "btc.12m", 0x200000, 0x200000, CRC(418a2e33) SHA1(0642ddff2ab9255f154419da24ba644ed63f34ab) )
+
+ BATCIR_JAPAN_KEY
ROM_END
ROM_START( batcira )
@@ -2010,6 +2069,8 @@ ROM_START( batcira )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "btc.11m", 0x000000, 0x200000, CRC(c27f2229) SHA1(df2459493af40937b6656a16fad43ff51bed2204) )
ROM_LOAD16_WORD_SWAP( "btc.12m", 0x200000, 0x200000, CRC(418a2e33) SHA1(0642ddff2ab9255f154419da24ba644ed63f34ab) )
+
+ BATCIR_ASIA_KEY
ROM_END
ROM_START( choko )
@@ -2034,6 +2095,8 @@ ROM_START( choko )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_BYTE( "tkoj5_a.simm5", 0x000000, 0x200000, CRC(ab45d509) SHA1(c58cf87d3828dfe0643cf4c58615f3352bd45508) ) // ROM on a simm
ROM_LOAD16_BYTE( "tkoj5_b.simm5", 0x000001, 0x200000, CRC(fa905c3d) SHA1(3eae65b01d50ec4ec4aeff49f434b9b88a50463c) ) // ROM on a simm
+
+ CHOKO_JAPAN_KEY
ROM_END
ROM_START( csclub )
@@ -2076,6 +2139,8 @@ ROM_START( csclub )
ROM_LOAD16_WORD_SWAP( "csc.56", 0x280000, 0x080000, CRC(9a345334) SHA1(330291400a73215c9797457507a86c90ba415247))
ROM_LOAD16_WORD_SWAP( "csc.57", 0x300000, 0x080000, CRC(aedc27f2) SHA1(55137f0f22c4823558e6a8ba76011695579a4f1f) )
ROM_LOAD16_WORD_SWAP( "csc.58", 0x380000, 0x080000, CRC(2300b7b3) SHA1(f5ecbb45c24f7de1c1aa435870695551d4e343ca) )
+
+ CSCLUB_WORLD_KEY
ROM_END
ROM_START( csclub1 )
@@ -2100,6 +2165,8 @@ ROM_START( csclub1 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "csc.11m", 0x000000, 0x200000, CRC(a027b827) SHA1(6d58a63efc7bd5d07353d9b55826c01a3c416c33) )
ROM_LOAD16_WORD_SWAP( "csc.12m", 0x200000, 0x200000, CRC(cb7f6e55) SHA1(b64e6b663fd09e887d2dc0f4b545e88688c0af55) )
+
+ CSCLUB_WORLD_KEY
ROM_END
ROM_START( csclubj )
@@ -2124,6 +2191,8 @@ ROM_START( csclubj )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "csc.11m", 0x000000, 0x200000, CRC(a027b827) SHA1(6d58a63efc7bd5d07353d9b55826c01a3c416c33) ) /* roms 51 to 54 joined in all eprom version */
ROM_LOAD16_WORD_SWAP( "csc.12m", 0x200000, 0x200000, CRC(cb7f6e55) SHA1(b64e6b663fd09e887d2dc0f4b545e88688c0af55) ) /* roms 55 to 58 joined in all eprom version */
+
+ CSCLUB_JAPAN_KEY
ROM_END
ROM_START( csclubjy ) // this is fairly redundant, same code as csclubj, same gfx as csclub (yellow case - all eprom), but it's a valid shipped combination
@@ -2166,6 +2235,8 @@ ROM_START( csclubjy ) // this is fairly redundant, same code as csclubj, same gf
ROM_LOAD16_WORD_SWAP( "csc.56", 0x280000, 0x080000, CRC(9a345334) SHA1(330291400a73215c9797457507a86c90ba415247))
ROM_LOAD16_WORD_SWAP( "csc.57", 0x300000, 0x080000, CRC(aedc27f2) SHA1(55137f0f22c4823558e6a8ba76011695579a4f1f) )
ROM_LOAD16_WORD_SWAP( "csc.58", 0x380000, 0x080000, CRC(2300b7b3) SHA1(f5ecbb45c24f7de1c1aa435870695551d4e343ca) )
+
+ CSCLUB_JAPAN_KEY
ROM_END
@@ -2191,6 +2262,8 @@ ROM_START( cscluba )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "csc.11m", 0x000000, 0x200000, CRC(a027b827) SHA1(6d58a63efc7bd5d07353d9b55826c01a3c416c33) )
ROM_LOAD16_WORD_SWAP( "csc.12m", 0x200000, 0x200000, CRC(cb7f6e55) SHA1(b64e6b663fd09e887d2dc0f4b545e88688c0af55) )
+
+ CSCLUB_ASIA_KEY
ROM_END
ROM_START( csclubh )
@@ -2215,6 +2288,8 @@ ROM_START( csclubh )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "csc.11m", 0x000000, 0x200000, CRC(a027b827) SHA1(6d58a63efc7bd5d07353d9b55826c01a3c416c33) ) /* roms 51 to 54 joined in all eprom version */
ROM_LOAD16_WORD_SWAP( "csc.12m", 0x200000, 0x200000, CRC(cb7f6e55) SHA1(b64e6b663fd09e887d2dc0f4b545e88688c0af55) ) /* roms 55 to 58 joined in all eprom version */
+
+ CSCLUB_HISPANIC_KEY
ROM_END
ROM_START( cybots )
@@ -2246,6 +2321,8 @@ ROM_START( cybots )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "cyb.11m", 0x000000, 0x200000, CRC(362ccab2) SHA1(28e537067d4846f22657ee37166d18b8f05f4da1) )
ROM_LOAD16_WORD_SWAP( "cyb.12m", 0x200000, 0x200000, CRC(7066e9cc) SHA1(eb6a9d4998b3311344d73bae88d661d81609c492) )
+
+ CYBOTS_WORLD_KEY
ROM_END
ROM_START( cybotsu )
@@ -2277,6 +2354,8 @@ ROM_START( cybotsu )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "cyb.11m", 0x000000, 0x200000, CRC(362ccab2) SHA1(28e537067d4846f22657ee37166d18b8f05f4da1) )
ROM_LOAD16_WORD_SWAP( "cyb.12m", 0x200000, 0x200000, CRC(7066e9cc) SHA1(eb6a9d4998b3311344d73bae88d661d81609c492) )
+
+ CYBOTS_USA_KEY
ROM_END
ROM_START( cybotsj )
@@ -2308,6 +2387,8 @@ ROM_START( cybotsj )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "cyb.11m", 0x000000, 0x200000, CRC(362ccab2) SHA1(28e537067d4846f22657ee37166d18b8f05f4da1) )
ROM_LOAD16_WORD_SWAP( "cyb.12m", 0x200000, 0x200000, CRC(7066e9cc) SHA1(eb6a9d4998b3311344d73bae88d661d81609c492) )
+
+ CYBOTS_JAPAN_KEY
ROM_END
ROM_START( ddtod )
@@ -2335,6 +2416,8 @@ ROM_START( ddtod )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "dad.11m", 0x000000, 0x200000, CRC(0c499b67) SHA1(a8ebd8a1cd6dece8344b7cb0439d85843fb97616) )
ROM_LOAD16_WORD_SWAP( "dad.12m", 0x200000, 0x200000, CRC(2f0b5a4e) SHA1(8d1ebbb811aa469b0f0d29d719d2b9af28fb63a2) )
+
+ DDTOD_WORLD_KEY
ROM_END
ROM_START( ddtodr1 )
@@ -2362,6 +2445,8 @@ ROM_START( ddtodr1 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "dad.11m", 0x000000, 0x200000, CRC(0c499b67) SHA1(a8ebd8a1cd6dece8344b7cb0439d85843fb97616) )
ROM_LOAD16_WORD_SWAP( "dad.12m", 0x200000, 0x200000, CRC(2f0b5a4e) SHA1(8d1ebbb811aa469b0f0d29d719d2b9af28fb63a2) )
+
+ DDTOD_WORLD_KEY
ROM_END
ROM_START( ddtodu )
@@ -2389,6 +2474,8 @@ ROM_START( ddtodu )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "dad.11m", 0x000000, 0x200000, CRC(0c499b67) SHA1(a8ebd8a1cd6dece8344b7cb0439d85843fb97616) )
ROM_LOAD16_WORD_SWAP( "dad.12m", 0x200000, 0x200000, CRC(2f0b5a4e) SHA1(8d1ebbb811aa469b0f0d29d719d2b9af28fb63a2) )
+
+ DDTOD_USA_KEY
ROM_END
ROM_START( ddtodur1 )
@@ -2416,6 +2503,8 @@ ROM_START( ddtodur1 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "dad.11m", 0x000000, 0x200000, CRC(0c499b67) SHA1(a8ebd8a1cd6dece8344b7cb0439d85843fb97616) )
ROM_LOAD16_WORD_SWAP( "dad.12m", 0x200000, 0x200000, CRC(2f0b5a4e) SHA1(8d1ebbb811aa469b0f0d29d719d2b9af28fb63a2) )
+
+ DDTOD_USA_KEY
ROM_END
ROM_START( ddtodj )
@@ -2443,6 +2532,8 @@ ROM_START( ddtodj )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "dad.11m", 0x000000, 0x200000, CRC(0c499b67) SHA1(a8ebd8a1cd6dece8344b7cb0439d85843fb97616) )
ROM_LOAD16_WORD_SWAP( "dad.12m", 0x200000, 0x200000, CRC(2f0b5a4e) SHA1(8d1ebbb811aa469b0f0d29d719d2b9af28fb63a2) )
+
+ DDTOD_JAPAN_KEY
ROM_END
ROM_START( ddtodjr1 )
@@ -2470,6 +2561,8 @@ ROM_START( ddtodjr1 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "dad.11m", 0x000000, 0x200000, CRC(0c499b67) SHA1(a8ebd8a1cd6dece8344b7cb0439d85843fb97616) )
ROM_LOAD16_WORD_SWAP( "dad.12m", 0x200000, 0x200000, CRC(2f0b5a4e) SHA1(8d1ebbb811aa469b0f0d29d719d2b9af28fb63a2) )
+
+ DDTOD_JAPAN_KEY
ROM_END
ROM_START( ddtodjr2 )
@@ -2497,6 +2590,8 @@ ROM_START( ddtodjr2 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "dad.11m", 0x000000, 0x200000, CRC(0c499b67) SHA1(a8ebd8a1cd6dece8344b7cb0439d85843fb97616) )
ROM_LOAD16_WORD_SWAP( "dad.12m", 0x200000, 0x200000, CRC(2f0b5a4e) SHA1(8d1ebbb811aa469b0f0d29d719d2b9af28fb63a2) )
+
+ DDTOD_JAPAN_KEY
ROM_END
ROM_START( ddtoda )
@@ -2524,6 +2619,8 @@ ROM_START( ddtoda )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "dad.11m", 0x000000, 0x200000, CRC(0c499b67) SHA1(a8ebd8a1cd6dece8344b7cb0439d85843fb97616) )
ROM_LOAD16_WORD_SWAP( "dad.12m", 0x200000, 0x200000, CRC(2f0b5a4e) SHA1(8d1ebbb811aa469b0f0d29d719d2b9af28fb63a2) )
+
+ DDTOD_ASIA_KEY
ROM_END
ROM_START( ddtodar1 )
@@ -2551,6 +2648,8 @@ ROM_START( ddtodar1 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "dad.11m", 0x000000, 0x200000, CRC(0c499b67) SHA1(a8ebd8a1cd6dece8344b7cb0439d85843fb97616) )
ROM_LOAD16_WORD_SWAP( "dad.12m", 0x200000, 0x200000, CRC(2f0b5a4e) SHA1(8d1ebbb811aa469b0f0d29d719d2b9af28fb63a2) )
+
+ DDTOD_ASIA_KEY
ROM_END
ROM_START( ddtodh )
@@ -2578,6 +2677,8 @@ ROM_START( ddtodh )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "dad.11m", 0x000000, 0x200000, CRC(0c499b67) SHA1(a8ebd8a1cd6dece8344b7cb0439d85843fb97616) )
ROM_LOAD16_WORD_SWAP( "dad.12m", 0x200000, 0x200000, CRC(2f0b5a4e) SHA1(8d1ebbb811aa469b0f0d29d719d2b9af28fb63a2) )
+
+ DDTOD_HISPANIC_KEY
ROM_END
ROM_START( ddtodhr1 )
@@ -2605,6 +2706,8 @@ ROM_START( ddtodhr1 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "dad.11m", 0x000000, 0x200000, CRC(0c499b67) SHA1(a8ebd8a1cd6dece8344b7cb0439d85843fb97616) )
ROM_LOAD16_WORD_SWAP( "dad.12m", 0x200000, 0x200000, CRC(2f0b5a4e) SHA1(8d1ebbb811aa469b0f0d29d719d2b9af28fb63a2) )
+
+ DDTOD_HISPANIC_KEY
ROM_END
ROM_START( ddtodhr2 )
@@ -2632,6 +2735,8 @@ ROM_START( ddtodhr2 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "dad.11m", 0x000000, 0x200000, CRC(0c499b67) SHA1(a8ebd8a1cd6dece8344b7cb0439d85843fb97616) )
ROM_LOAD16_WORD_SWAP( "dad.12m", 0x200000, 0x200000, CRC(2f0b5a4e) SHA1(8d1ebbb811aa469b0f0d29d719d2b9af28fb63a2) )
+
+ DDTOD_HISPANIC_KEY
ROM_END
ROM_START( ddsom )
@@ -2663,6 +2768,8 @@ ROM_START( ddsom )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "dd2.11m", 0x000000, 0x200000, CRC(98d0c325) SHA1(7406e8d943d77c468eb418c4113261f4ab973bbf) )
ROM_LOAD16_WORD_SWAP( "dd2.12m", 0x200000, 0x200000, CRC(5ea2e7fa) SHA1(0e6a9fd007f637adcb2226c902394f07de45e803) )
+
+ DDSOM_WORLD_KEY
ROM_END
ROM_START( ddsomr1 )
@@ -2694,6 +2801,8 @@ ROM_START( ddsomr1 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "dd2.11m", 0x000000, 0x200000, CRC(98d0c325) SHA1(7406e8d943d77c468eb418c4113261f4ab973bbf) )
ROM_LOAD16_WORD_SWAP( "dd2.12m", 0x200000, 0x200000, CRC(5ea2e7fa) SHA1(0e6a9fd007f637adcb2226c902394f07de45e803) )
+
+ DDSOM_WORLD_KEY
ROM_END
ROM_START( ddsomr2 )
@@ -2725,6 +2834,8 @@ ROM_START( ddsomr2 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "dd2.11m", 0x000000, 0x200000, CRC(98d0c325) SHA1(7406e8d943d77c468eb418c4113261f4ab973bbf) )
ROM_LOAD16_WORD_SWAP( "dd2.12m", 0x200000, 0x200000, CRC(5ea2e7fa) SHA1(0e6a9fd007f637adcb2226c902394f07de45e803) )
+
+ DDSOM_WORLD_KEY
ROM_END
ROM_START( ddsomr3 )
@@ -2756,6 +2867,8 @@ ROM_START( ddsomr3 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "dd2.11m", 0x000000, 0x200000, CRC(98d0c325) SHA1(7406e8d943d77c468eb418c4113261f4ab973bbf) )
ROM_LOAD16_WORD_SWAP( "dd2.12m", 0x200000, 0x200000, CRC(5ea2e7fa) SHA1(0e6a9fd007f637adcb2226c902394f07de45e803) )
+
+ DDSOM_WORLD_KEY
ROM_END
ROM_START( ddsomu )
@@ -2787,6 +2900,8 @@ ROM_START( ddsomu )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "dd2.11m", 0x000000, 0x200000, CRC(98d0c325) SHA1(7406e8d943d77c468eb418c4113261f4ab973bbf) )
ROM_LOAD16_WORD_SWAP( "dd2.12m", 0x200000, 0x200000, CRC(5ea2e7fa) SHA1(0e6a9fd007f637adcb2226c902394f07de45e803) )
+
+ DDSOM_USA_KEY
ROM_END
ROM_START( ddsomur1 )
@@ -2818,6 +2933,8 @@ ROM_START( ddsomur1 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "dd2.11m", 0x000000, 0x200000, CRC(98d0c325) SHA1(7406e8d943d77c468eb418c4113261f4ab973bbf) )
ROM_LOAD16_WORD_SWAP( "dd2.12m", 0x200000, 0x200000, CRC(5ea2e7fa) SHA1(0e6a9fd007f637adcb2226c902394f07de45e803) )
+
+ DDSOM_USA_KEY
ROM_END
ROM_START( ddsomj )
@@ -2849,6 +2966,8 @@ ROM_START( ddsomj )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "dd2.11m", 0x000000, 0x200000, CRC(98d0c325) SHA1(7406e8d943d77c468eb418c4113261f4ab973bbf) )
ROM_LOAD16_WORD_SWAP( "dd2.12m", 0x200000, 0x200000, CRC(5ea2e7fa) SHA1(0e6a9fd007f637adcb2226c902394f07de45e803) )
+
+ DDSOM_JAPAN_KEY
ROM_END
ROM_START( ddsomjr1 )
@@ -2880,6 +2999,8 @@ ROM_START( ddsomjr1 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "dd2.11m", 0x000000, 0x200000, CRC(98d0c325) SHA1(7406e8d943d77c468eb418c4113261f4ab973bbf) )
ROM_LOAD16_WORD_SWAP( "dd2.12m", 0x200000, 0x200000, CRC(5ea2e7fa) SHA1(0e6a9fd007f637adcb2226c902394f07de45e803) )
+
+ DDSOM_JAPAN_KEY
ROM_END
ROM_START( ddsoma )
@@ -2911,6 +3032,8 @@ ROM_START( ddsoma )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "dd2.11m", 0x000000, 0x200000, CRC(98d0c325) SHA1(7406e8d943d77c468eb418c4113261f4ab973bbf) )
ROM_LOAD16_WORD_SWAP( "dd2.12m", 0x200000, 0x200000, CRC(5ea2e7fa) SHA1(0e6a9fd007f637adcb2226c902394f07de45e803) )
+
+ DDSOM_ASIA_KEY
ROM_END
@@ -2943,6 +3066,8 @@ ROM_START( ddsomar1 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "dd2.11m", 0x000000, 0x200000, CRC(98d0c325) SHA1(7406e8d943d77c468eb418c4113261f4ab973bbf) )
ROM_LOAD16_WORD_SWAP( "dd2.12m", 0x200000, 0x200000, CRC(5ea2e7fa) SHA1(0e6a9fd007f637adcb2226c902394f07de45e803) )
+
+ DDSOM_ASIA_KEY
ROM_END
ROM_START( ddsomb )
@@ -2974,6 +3099,8 @@ ROM_START( ddsomb )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "dd2.11m", 0x000000, 0x200000, CRC(98d0c325) SHA1(7406e8d943d77c468eb418c4113261f4ab973bbf) )
ROM_LOAD16_WORD_SWAP( "dd2.12m", 0x200000, 0x200000, CRC(5ea2e7fa) SHA1(0e6a9fd007f637adcb2226c902394f07de45e803) )
+
+ DDSOM_BRAZIL_KEY
ROM_END
ROM_START( ddsomh )
@@ -3005,6 +3132,8 @@ ROM_START( ddsomh )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "dd2.11m", 0x000000, 0x200000, CRC(98d0c325) SHA1(7406e8d943d77c468eb418c4113261f4ab973bbf) )
ROM_LOAD16_WORD_SWAP( "dd2.12m", 0x200000, 0x200000, CRC(5ea2e7fa) SHA1(0e6a9fd007f637adcb2226c902394f07de45e803) )
+
+ DDSOM_HISPANIC_KEY
ROM_END
ROM_START( dimahoo )
@@ -3028,6 +3157,8 @@ ROM_START( dimahoo )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "gmd.11m", 0x000000, 0x400000, CRC(06a65542) SHA1(a1b3df70c90055a3cd59d0149fd18a74eff5bcc9) )
ROM_LOAD16_WORD_SWAP( "gmd.12m", 0x400000, 0x400000, CRC(50bc7a31) SHA1(7283569fc646c39f4c693f14e0ce7ff2ee49111a) )
+
+ DIMAHOO_WORLD_KEY
ROM_END
ROM_START( dimahoou )
@@ -3051,6 +3182,8 @@ ROM_START( dimahoou )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "gmd.11m", 0x000000, 0x400000, CRC(06a65542) SHA1(a1b3df70c90055a3cd59d0149fd18a74eff5bcc9) )
ROM_LOAD16_WORD_SWAP( "gmd.12m", 0x400000, 0x400000, CRC(50bc7a31) SHA1(7283569fc646c39f4c693f14e0ce7ff2ee49111a) )
+
+ DIMAHOO_USA_KEY
ROM_END
ROM_START( gmahou )
@@ -3074,6 +3207,8 @@ ROM_START( gmahou )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "gmd.11m", 0x000000, 0x400000, CRC(06a65542) SHA1(a1b3df70c90055a3cd59d0149fd18a74eff5bcc9) )
ROM_LOAD16_WORD_SWAP( "gmd.12m", 0x400000, 0x400000, CRC(50bc7a31) SHA1(7283569fc646c39f4c693f14e0ce7ff2ee49111a) )
+
+ DIMAHOO_JAPAN_KEY
ROM_END
ROM_START( dstlk )
@@ -3105,6 +3240,8 @@ ROM_START( dstlk )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "vam.11m", 0x000000, 0x200000, CRC(4a39deb2) SHA1(7e63e615869958db66a4e52a0272afee5a10e446) )
ROM_LOAD16_WORD_SWAP( "vam.12m", 0x200000, 0x200000, CRC(1a3e5c03) SHA1(c5a556e125d6c3d68da745b4d56cd7a851f2a23d) )
+
+ DSTLK_WORLD_KEY
ROM_END
ROM_START( dstlku )
@@ -3136,6 +3273,8 @@ ROM_START( dstlku )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "vam.11m", 0x000000, 0x200000, CRC(4a39deb2) SHA1(7e63e615869958db66a4e52a0272afee5a10e446) )
ROM_LOAD16_WORD_SWAP( "vam.12m", 0x200000, 0x200000, CRC(1a3e5c03) SHA1(c5a556e125d6c3d68da745b4d56cd7a851f2a23d) )
+
+ DSTLK_USA_KEY
ROM_END
ROM_START( dstlkur1 )
@@ -3167,6 +3306,8 @@ ROM_START( dstlkur1 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "vam.11m", 0x000000, 0x200000, CRC(4a39deb2) SHA1(7e63e615869958db66a4e52a0272afee5a10e446) )
ROM_LOAD16_WORD_SWAP( "vam.12m", 0x200000, 0x200000, CRC(1a3e5c03) SHA1(c5a556e125d6c3d68da745b4d56cd7a851f2a23d) )
+
+ DSTLK_USA_KEY
ROM_END
ROM_START( vampj )
@@ -3198,6 +3339,8 @@ ROM_START( vampj )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "vam.11m", 0x000000, 0x200000, CRC(4a39deb2) SHA1(7e63e615869958db66a4e52a0272afee5a10e446) )
ROM_LOAD16_WORD_SWAP( "vam.12m", 0x200000, 0x200000, CRC(1a3e5c03) SHA1(c5a556e125d6c3d68da745b4d56cd7a851f2a23d) )
+
+ DSTLK_JAPAN_KEY
ROM_END
ROM_START( vampja )
@@ -3229,6 +3372,8 @@ ROM_START( vampja )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "vam.11m", 0x000000, 0x200000, CRC(4a39deb2) SHA1(7e63e615869958db66a4e52a0272afee5a10e446) )
ROM_LOAD16_WORD_SWAP( "vam.12m", 0x200000, 0x200000, CRC(1a3e5c03) SHA1(c5a556e125d6c3d68da745b4d56cd7a851f2a23d) )
+
+ DSTLK_JAPAN_KEY
ROM_END
ROM_START( vampjr1 )
@@ -3260,6 +3405,8 @@ ROM_START( vampjr1 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "vam.11m", 0x000000, 0x200000, CRC(4a39deb2) SHA1(7e63e615869958db66a4e52a0272afee5a10e446) )
ROM_LOAD16_WORD_SWAP( "vam.12m", 0x200000, 0x200000, CRC(1a3e5c03) SHA1(c5a556e125d6c3d68da745b4d56cd7a851f2a23d) )
+
+ DSTLK_JAPAN_KEY
ROM_END
ROM_START( dstlka )
@@ -3291,6 +3438,8 @@ ROM_START( dstlka )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "vam.11m", 0x000000, 0x200000, CRC(4a39deb2) SHA1(7e63e615869958db66a4e52a0272afee5a10e446) )
ROM_LOAD16_WORD_SWAP( "vam.12m", 0x200000, 0x200000, CRC(1a3e5c03) SHA1(c5a556e125d6c3d68da745b4d56cd7a851f2a23d) )
+
+ DSTLK_ASIA_KEY
ROM_END
ROM_START( dstlkh )
@@ -3322,6 +3471,8 @@ ROM_START( dstlkh )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "vam.11m", 0x000000, 0x200000, CRC(4a39deb2) SHA1(7e63e615869958db66a4e52a0272afee5a10e446) )
ROM_LOAD16_WORD_SWAP( "vam.12m", 0x200000, 0x200000, CRC(1a3e5c03) SHA1(c5a556e125d6c3d68da745b4d56cd7a851f2a23d) )
+
+ DSTLK_HISPANIC_KEY
ROM_END
ROM_START( ecofghtr )
@@ -3348,6 +3499,8 @@ ROM_START( ecofghtr )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "uec.11m", 0x000000, 0x200000, CRC(81b25d39) SHA1(448adfcc7d98873a48c710d857225cdd1580e5c9) )
ROM_LOAD16_WORD_SWAP( "uec.12m", 0x200000, 0x200000, CRC(27729e52) SHA1(a55c8159adf766dda70cb047f5ac85ce6bc0a3f3) )
+
+ ECOFGHTR_WORLD_KEY
ROM_END
ROM_START( ecofghtru )
@@ -3374,6 +3527,8 @@ ROM_START( ecofghtru )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "uec.11m", 0x000000, 0x200000, CRC(81b25d39) SHA1(448adfcc7d98873a48c710d857225cdd1580e5c9) )
ROM_LOAD16_WORD_SWAP( "uec.12m", 0x200000, 0x200000, CRC(27729e52) SHA1(a55c8159adf766dda70cb047f5ac85ce6bc0a3f3) )
+
+ ECOFGHTR_USA_KEY
ROM_END
ROM_START( ecofghtru1 )
@@ -3400,6 +3555,8 @@ ROM_START( ecofghtru1 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "uec.11m", 0x000000, 0x200000, CRC(81b25d39) SHA1(448adfcc7d98873a48c710d857225cdd1580e5c9) )
ROM_LOAD16_WORD_SWAP( "uec.12m", 0x200000, 0x200000, CRC(27729e52) SHA1(a55c8159adf766dda70cb047f5ac85ce6bc0a3f3) )
+
+ ECOFGHTR_USA_KEY
ROM_END
ROM_START( uecology )
@@ -3426,6 +3583,8 @@ ROM_START( uecology )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "uec.11m", 0x000000, 0x200000, CRC(81b25d39) SHA1(448adfcc7d98873a48c710d857225cdd1580e5c9) )
ROM_LOAD16_WORD_SWAP( "uec.12m", 0x200000, 0x200000, CRC(27729e52) SHA1(a55c8159adf766dda70cb047f5ac85ce6bc0a3f3) )
+
+ ECOFGHTR_JAPAN_KEY
ROM_END
ROM_START( ecofghtra )
@@ -3452,6 +3611,8 @@ ROM_START( ecofghtra )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "uec.11m", 0x000000, 0x200000, CRC(81b25d39) SHA1(448adfcc7d98873a48c710d857225cdd1580e5c9) )
ROM_LOAD16_WORD_SWAP( "uec.12m", 0x200000, 0x200000, CRC(27729e52) SHA1(a55c8159adf766dda70cb047f5ac85ce6bc0a3f3) )
+
+ ECOFGHTR_ASIA_KEY
ROM_END
ROM_START( ecofghtrh )
@@ -3478,6 +3639,8 @@ ROM_START( ecofghtrh )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "uec.11m", 0x000000, 0x200000, CRC(81b25d39) SHA1(448adfcc7d98873a48c710d857225cdd1580e5c9) )
ROM_LOAD16_WORD_SWAP( "uec.12m", 0x200000, 0x200000, CRC(27729e52) SHA1(a55c8159adf766dda70cb047f5ac85ce6bc0a3f3) )
+
+ ECOFGHTR_HISPANIC_KEY
ROM_END
ROM_START( gigawing )
@@ -3499,6 +3662,8 @@ ROM_START( gigawing )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "ggw.11m", 0x000000, 0x400000, CRC(e172acf5) SHA1(d7b0963d66165f3607d887741c5e7ab952bcf2ff) )
ROM_LOAD16_WORD_SWAP( "ggw.12m", 0x400000, 0x400000, CRC(4bee4e8f) SHA1(c440b5a38359ec3b8002f39690b79bf78703f5d0) )
+
+ GIGAWING_USA_KEY
ROM_END
ROM_START( gigawingj )
@@ -3520,6 +3685,8 @@ ROM_START( gigawingj )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "ggw.11m", 0x000000, 0x400000, CRC(e172acf5) SHA1(d7b0963d66165f3607d887741c5e7ab952bcf2ff) )
ROM_LOAD16_WORD_SWAP( "ggw.12m", 0x400000, 0x400000, CRC(4bee4e8f) SHA1(c440b5a38359ec3b8002f39690b79bf78703f5d0) )
+
+ GIGAWING_JAPAN_KEY
ROM_END
ROM_START( gigawinga )
@@ -3541,6 +3708,8 @@ ROM_START( gigawinga )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "ggw.11m", 0x000000, 0x400000, CRC(e172acf5) SHA1(d7b0963d66165f3607d887741c5e7ab952bcf2ff) )
ROM_LOAD16_WORD_SWAP( "ggw.12m", 0x400000, 0x400000, CRC(4bee4e8f) SHA1(c440b5a38359ec3b8002f39690b79bf78703f5d0) )
+
+ GIGAWING_ASIA_KEY
ROM_END
ROM_START( gigawingh )
@@ -3562,6 +3731,8 @@ ROM_START( gigawingh )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "ggw.11m", 0x000000, 0x400000, CRC(e172acf5) SHA1(d7b0963d66165f3607d887741c5e7ab952bcf2ff) )
ROM_LOAD16_WORD_SWAP( "ggw.12m", 0x400000, 0x400000, CRC(4bee4e8f) SHA1(c440b5a38359ec3b8002f39690b79bf78703f5d0) )
+
+ GIGAWING_HISPANIC_KEY
ROM_END
ROM_START( gigawingb )
@@ -3583,6 +3754,8 @@ ROM_START( gigawingb )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "ggw.11m", 0x000000, 0x400000, CRC(e172acf5) SHA1(d7b0963d66165f3607d887741c5e7ab952bcf2ff) )
ROM_LOAD16_WORD_SWAP( "ggw.12m", 0x400000, 0x400000, CRC(4bee4e8f) SHA1(c440b5a38359ec3b8002f39690b79bf78703f5d0) )
+
+ GIGAWING_BRAZIL_KEY
ROM_END
ROM_START( hsf2 )
@@ -3609,6 +3782,8 @@ ROM_START( hsf2 )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "hs2.11m", 0x000000, 0x800000, CRC(0e15c359) SHA1(176108b0d76d821a849324680aba0cd04b5016c1) )
+
+ HSF2_USA_KEY
ROM_END
ROM_START( hsf2a )
@@ -3635,6 +3810,8 @@ ROM_START( hsf2a )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "hs2.11m", 0x000000, 0x800000, CRC(0e15c359) SHA1(176108b0d76d821a849324680aba0cd04b5016c1) )
+
+ HSF2_ASIA_KEY
ROM_END
ROM_START( hsf2j )
@@ -3661,6 +3838,8 @@ ROM_START( hsf2j )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "hs2.11m", 0x000000, 0x800000, CRC(0e15c359) SHA1(176108b0d76d821a849324680aba0cd04b5016c1) )
+
+ HSF2_JAPAN_KEY
ROM_END
ROM_START( jyangoku )
@@ -3684,6 +3863,8 @@ ROM_START( jyangoku )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_BYTE( "maj5_a.simm5", 0x000000, 0x200000, CRC(5ad9ee53) SHA1(acfb7ec137209409c1a439ebc62d8fa3f87e7012) ) // ROM on a simm
ROM_LOAD16_BYTE( "maj5_b.simm5", 0x000001, 0x200000, CRC(efb3dbfb) SHA1(3b32b9890f79805b6a2e1ec63f2cadaca14cf11a) ) // ROM on a simm
+
+ JYANGOKU_JAPAN_KEY
ROM_END
ROM_START( megaman2 )
@@ -3707,6 +3888,8 @@ ROM_START( megaman2 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "rm2.11m", 0x000000, 0x200000, CRC(2106174d) SHA1(0a35d9ca8ebcad74904b20648d5320f839d6377e) )
ROM_LOAD16_WORD_SWAP( "rm2.12m", 0x200000, 0x200000, CRC(546c1636) SHA1(f96b172ab899f2c6ee17a5dd1fb61af9432e3cd2) )
+
+ MEGAMAN2_USA_KEY
ROM_END
ROM_START( megaman2a )
@@ -3730,6 +3913,8 @@ ROM_START( megaman2a )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "rm2.11m", 0x000000, 0x200000, CRC(2106174d) SHA1(0a35d9ca8ebcad74904b20648d5320f839d6377e) )
ROM_LOAD16_WORD_SWAP( "rm2.12m", 0x200000, 0x200000, CRC(546c1636) SHA1(f96b172ab899f2c6ee17a5dd1fb61af9432e3cd2) )
+
+ MEGAMAN2_ASIA_KEY
ROM_END
ROM_START( rockman2j )
@@ -3753,6 +3938,8 @@ ROM_START( rockman2j )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "rm2.11m", 0x000000, 0x200000, CRC(2106174d) SHA1(0a35d9ca8ebcad74904b20648d5320f839d6377e) )
ROM_LOAD16_WORD_SWAP( "rm2.12m", 0x200000, 0x200000, CRC(546c1636) SHA1(f96b172ab899f2c6ee17a5dd1fb61af9432e3cd2) )
+
+ MEGAMAN2_JAPAN_KEY
ROM_END
ROM_START( megaman2h )
@@ -3776,6 +3963,8 @@ ROM_START( megaman2h )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "rm2.11m", 0x000000, 0x200000, CRC(2106174d) SHA1(0a35d9ca8ebcad74904b20648d5320f839d6377e) )
ROM_LOAD16_WORD_SWAP( "rm2.12m", 0x200000, 0x200000, CRC(546c1636) SHA1(f96b172ab899f2c6ee17a5dd1fb61af9432e3cd2) )
+
+ MEGAMAN2_HISPANIC_KEY
ROM_END
/*
@@ -3834,6 +4023,8 @@ ROM_START( mmatrix )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "mmx.11m", 0x000000, 0x400000, CRC(4180b39f) SHA1(cabb1c358eae1bb6cfed07f5b92e4acd38650667) )
ROM_LOAD16_WORD_SWAP( "mmx.12m", 0x400000, 0x400000, CRC(95e22a59) SHA1(b3431d170c0a1a0d826ad0af21300b9180e3f114) )
+
+ MMATRIX_USA_KEY
ROM_END
ROM_START( mmatrixj )
@@ -3859,6 +4050,8 @@ ROM_START( mmatrixj )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "mmx.11m", 0x000000, 0x400000, CRC(4180b39f) SHA1(cabb1c358eae1bb6cfed07f5b92e4acd38650667) )
ROM_LOAD16_WORD_SWAP( "mmx.12m", 0x400000, 0x400000, CRC(95e22a59) SHA1(b3431d170c0a1a0d826ad0af21300b9180e3f114) )
+
+ MMATRIX_JAPAN_KEY
ROM_END
ROM_START( msh )
@@ -3890,6 +4083,8 @@ ROM_START( msh )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "msh.11m", 0x000000, 0x200000, CRC(37ac6d30) SHA1(ec67421fbf4a08a686e76792cb35e9cbf04d022d) )
ROM_LOAD16_WORD_SWAP( "msh.12m", 0x200000, 0x200000, CRC(de092570) SHA1(a03d0df901f6ea79685eaed67db65bee14ec29c6) )
+
+ MSH_WORLD_KEY
ROM_END
ROM_START( mshu )
@@ -3921,6 +4116,8 @@ ROM_START( mshu )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "msh.11m", 0x000000, 0x200000, CRC(37ac6d30) SHA1(ec67421fbf4a08a686e76792cb35e9cbf04d022d) )
ROM_LOAD16_WORD_SWAP( "msh.12m", 0x200000, 0x200000, CRC(de092570) SHA1(a03d0df901f6ea79685eaed67db65bee14ec29c6) )
+
+ MSH_USA_KEY
ROM_END
ROM_START( mshj )
@@ -3952,6 +4149,8 @@ ROM_START( mshj )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "msh.11m", 0x000000, 0x200000, CRC(37ac6d30) SHA1(ec67421fbf4a08a686e76792cb35e9cbf04d022d) )
ROM_LOAD16_WORD_SWAP( "msh.12m", 0x200000, 0x200000, CRC(de092570) SHA1(a03d0df901f6ea79685eaed67db65bee14ec29c6) )
+
+ MSH_JAPAN_KEY
ROM_END
ROM_START( mshjr1 )
@@ -3983,6 +4182,8 @@ ROM_START( mshjr1 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "msh.11m", 0x000000, 0x200000, CRC(37ac6d30) SHA1(ec67421fbf4a08a686e76792cb35e9cbf04d022d) )
ROM_LOAD16_WORD_SWAP( "msh.12m", 0x200000, 0x200000, CRC(de092570) SHA1(a03d0df901f6ea79685eaed67db65bee14ec29c6) )
+
+ MSH_JAPAN_KEY
ROM_END
ROM_START( msha )
@@ -4014,6 +4215,8 @@ ROM_START( msha )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "msh.11m", 0x000000, 0x200000, CRC(37ac6d30) SHA1(ec67421fbf4a08a686e76792cb35e9cbf04d022d) )
ROM_LOAD16_WORD_SWAP( "msh.12m", 0x200000, 0x200000, CRC(de092570) SHA1(a03d0df901f6ea79685eaed67db65bee14ec29c6) )
+
+ MSH_ASIA_KEY
ROM_END
ROM_START( mshh )
@@ -4045,6 +4248,8 @@ ROM_START( mshh )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "msh.11m", 0x000000, 0x200000, CRC(37ac6d30) SHA1(ec67421fbf4a08a686e76792cb35e9cbf04d022d) )
ROM_LOAD16_WORD_SWAP( "msh.12m", 0x200000, 0x200000, CRC(de092570) SHA1(a03d0df901f6ea79685eaed67db65bee14ec29c6) )
+
+ MSH_HISPANIC_KEY
ROM_END
ROM_START( mshb )
@@ -4076,6 +4281,8 @@ ROM_START( mshb )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "msh.11m", 0x000000, 0x200000, CRC(37ac6d30) SHA1(ec67421fbf4a08a686e76792cb35e9cbf04d022d) )
ROM_LOAD16_WORD_SWAP( "msh.12m", 0x200000, 0x200000, CRC(de092570) SHA1(a03d0df901f6ea79685eaed67db65bee14ec29c6) )
+
+ MSH_BRAZIL_KEY
ROM_END
ROM_START( mshvsf )
@@ -4107,6 +4314,8 @@ ROM_START( mshvsf )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "mvs.11m", 0x000000, 0x400000, CRC(86219770) SHA1(4e5b68d382a5aa37f8b0b6434c53a2b95f5f9a4d) )
ROM_LOAD16_WORD_SWAP( "mvs.12m", 0x400000, 0x400000, CRC(f2fd7f68) SHA1(28a30d55d3eaf963006c7cbe7c288099cd3ba536) )
+
+ MSHVSSF_WORLD_KEY
ROM_END
ROM_START( mshvsfu )
@@ -4138,6 +4347,8 @@ ROM_START( mshvsfu )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "mvs.11m", 0x000000, 0x400000, CRC(86219770) SHA1(4e5b68d382a5aa37f8b0b6434c53a2b95f5f9a4d) )
ROM_LOAD16_WORD_SWAP( "mvs.12m", 0x400000, 0x400000, CRC(f2fd7f68) SHA1(28a30d55d3eaf963006c7cbe7c288099cd3ba536) )
+
+ MSHVSSF_USA_KEY
ROM_END
ROM_START( mshvsfu1 )
@@ -4169,6 +4380,8 @@ ROM_START( mshvsfu1 )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "mvs.11m", 0x000000, 0x400000, CRC(86219770) SHA1(4e5b68d382a5aa37f8b0b6434c53a2b95f5f9a4d) )
ROM_LOAD16_WORD_SWAP( "mvs.12m", 0x400000, 0x400000, CRC(f2fd7f68) SHA1(28a30d55d3eaf963006c7cbe7c288099cd3ba536) )
+
+ MSHVSSF_USA_KEY
ROM_END
ROM_START( mshvsfj )
@@ -4200,6 +4413,8 @@ ROM_START( mshvsfj )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "mvs.11m", 0x000000, 0x400000, CRC(86219770) SHA1(4e5b68d382a5aa37f8b0b6434c53a2b95f5f9a4d) )
ROM_LOAD16_WORD_SWAP( "mvs.12m", 0x400000, 0x400000, CRC(f2fd7f68) SHA1(28a30d55d3eaf963006c7cbe7c288099cd3ba536) )
+
+ MSHVSSF_JAPAN_KEY
ROM_END
ROM_START( mshvsfj1 )
@@ -4231,6 +4446,8 @@ ROM_START( mshvsfj1 )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "mvs.11m", 0x000000, 0x400000, CRC(86219770) SHA1(4e5b68d382a5aa37f8b0b6434c53a2b95f5f9a4d) )
ROM_LOAD16_WORD_SWAP( "mvs.12m", 0x400000, 0x400000, CRC(f2fd7f68) SHA1(28a30d55d3eaf963006c7cbe7c288099cd3ba536) )
+
+ MSHVSSF_JAPAN_KEY
ROM_END
ROM_START( mshvsfj2 )
@@ -4262,6 +4479,8 @@ ROM_START( mshvsfj2 )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "mvs.11m", 0x000000, 0x400000, CRC(86219770) SHA1(4e5b68d382a5aa37f8b0b6434c53a2b95f5f9a4d) )
ROM_LOAD16_WORD_SWAP( "mvs.12m", 0x400000, 0x400000, CRC(f2fd7f68) SHA1(28a30d55d3eaf963006c7cbe7c288099cd3ba536) )
+
+ MSHVSSF_JAPAN_KEY
ROM_END
ROM_START( mshvsfh )
@@ -4293,6 +4512,8 @@ ROM_START( mshvsfh )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "mvs.11m", 0x000000, 0x400000, CRC(86219770) SHA1(4e5b68d382a5aa37f8b0b6434c53a2b95f5f9a4d) )
ROM_LOAD16_WORD_SWAP( "mvs.12m", 0x400000, 0x400000, CRC(f2fd7f68) SHA1(28a30d55d3eaf963006c7cbe7c288099cd3ba536) )
+
+ MSHVSSF_HISPANIC_KEY
ROM_END
ROM_START( mshvsfa )
@@ -4324,6 +4545,8 @@ ROM_START( mshvsfa )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "mvs.11m", 0x000000, 0x400000, CRC(86219770) SHA1(4e5b68d382a5aa37f8b0b6434c53a2b95f5f9a4d) )
ROM_LOAD16_WORD_SWAP( "mvs.12m", 0x400000, 0x400000, CRC(f2fd7f68) SHA1(28a30d55d3eaf963006c7cbe7c288099cd3ba536) )
+
+ MSHVSSF_ASIA_KEY
ROM_END
ROM_START( mshvsfa1 )
@@ -4355,6 +4578,8 @@ ROM_START( mshvsfa1 )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "mvs.11m", 0x000000, 0x400000, CRC(86219770) SHA1(4e5b68d382a5aa37f8b0b6434c53a2b95f5f9a4d) )
ROM_LOAD16_WORD_SWAP( "mvs.12m", 0x400000, 0x400000, CRC(f2fd7f68) SHA1(28a30d55d3eaf963006c7cbe7c288099cd3ba536) )
+
+ MSHVSSF_ASIA_KEY
ROM_END
ROM_START( mshvsfb )
@@ -4386,6 +4611,8 @@ ROM_START( mshvsfb )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "mvs.11m", 0x000000, 0x400000, CRC(86219770) SHA1(4e5b68d382a5aa37f8b0b6434c53a2b95f5f9a4d) )
ROM_LOAD16_WORD_SWAP( "mvs.12m", 0x400000, 0x400000, CRC(f2fd7f68) SHA1(28a30d55d3eaf963006c7cbe7c288099cd3ba536) )
+
+ MSHVSSF_BRAZIL_KEY
ROM_END
ROM_START( mshvsfb1 )
@@ -4417,6 +4644,8 @@ ROM_START( mshvsfb1 )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "mvs.11m", 0x000000, 0x400000, CRC(86219770) SHA1(4e5b68d382a5aa37f8b0b6434c53a2b95f5f9a4d) )
ROM_LOAD16_WORD_SWAP( "mvs.12m", 0x400000, 0x400000, CRC(f2fd7f68) SHA1(28a30d55d3eaf963006c7cbe7c288099cd3ba536) )
+
+ MSHVSSF_BRAZIL_KEY
ROM_END
/*
@@ -4459,6 +4688,8 @@ ROM_START( mvsc )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "mvc.11m", 0x000000, 0x400000, CRC(850fe663) SHA1(81e519d05a08855f242ea2e17ee0859b449db895) )
ROM_LOAD16_WORD_SWAP( "mvc.12m", 0x400000, 0x400000, CRC(7ccb1896) SHA1(74caadf3282fcc6acffb1bbe3734106f81124121) )
+
+ MVSC_WORLD_KEY
ROM_END
ROM_START( mvscr1 )
@@ -4490,6 +4721,8 @@ ROM_START( mvscr1 )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "mvc.11m", 0x000000, 0x400000, CRC(850fe663) SHA1(81e519d05a08855f242ea2e17ee0859b449db895) )
ROM_LOAD16_WORD_SWAP( "mvc.12m", 0x400000, 0x400000, CRC(7ccb1896) SHA1(74caadf3282fcc6acffb1bbe3734106f81124121) )
+
+ MVSC_WORLD_KEY
ROM_END
ROM_START( mvscu )
@@ -4521,6 +4754,8 @@ ROM_START( mvscu )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "mvc.11m", 0x000000, 0x400000, CRC(850fe663) SHA1(81e519d05a08855f242ea2e17ee0859b449db895) )
ROM_LOAD16_WORD_SWAP( "mvc.12m", 0x400000, 0x400000, CRC(7ccb1896) SHA1(74caadf3282fcc6acffb1bbe3734106f81124121) )
+
+ MVSC_USA_KEY
ROM_END
ROM_START( mvscur1 )
@@ -4552,6 +4787,8 @@ ROM_START( mvscur1 )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "mvc.11m", 0x000000, 0x400000, CRC(850fe663) SHA1(81e519d05a08855f242ea2e17ee0859b449db895) )
ROM_LOAD16_WORD_SWAP( "mvc.12m", 0x400000, 0x400000, CRC(7ccb1896) SHA1(74caadf3282fcc6acffb1bbe3734106f81124121) )
+
+ MVSC_USA_KEY
ROM_END
ROM_START( mvscj )
@@ -4583,6 +4820,8 @@ ROM_START( mvscj )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "mvc.11m", 0x000000, 0x400000, CRC(850fe663) SHA1(81e519d05a08855f242ea2e17ee0859b449db895) )
ROM_LOAD16_WORD_SWAP( "mvc.12m", 0x400000, 0x400000, CRC(7ccb1896) SHA1(74caadf3282fcc6acffb1bbe3734106f81124121) )
+
+ MVSC_JAPAN_KEY
ROM_END
ROM_START( mvscjr1 )
@@ -4614,6 +4853,8 @@ ROM_START( mvscjr1 )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "mvc.11m", 0x000000, 0x400000, CRC(850fe663) SHA1(81e519d05a08855f242ea2e17ee0859b449db895) )
ROM_LOAD16_WORD_SWAP( "mvc.12m", 0x400000, 0x400000, CRC(7ccb1896) SHA1(74caadf3282fcc6acffb1bbe3734106f81124121) )
+
+ MVSC_JAPAN_KEY
ROM_END
/*
@@ -4660,6 +4901,8 @@ ROM_START( mvscjsing )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "mvc64-11m.11", 0x000000, 0x800000, CRC(5d8819e0) SHA1(afe2ec7fa4786e6d9a9a0ffa5787862ad69b0010) )
+
+ MVSC_JAPAN_KEY
ROM_END
ROM_START( mvsca )
@@ -4691,6 +4934,8 @@ ROM_START( mvsca )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "mvc.11m", 0x000000, 0x400000, CRC(850fe663) SHA1(81e519d05a08855f242ea2e17ee0859b449db895) )
ROM_LOAD16_WORD_SWAP( "mvc.12m", 0x400000, 0x400000, CRC(7ccb1896) SHA1(74caadf3282fcc6acffb1bbe3734106f81124121) )
+
+ MVSC_ASIA_KEY
ROM_END
ROM_START( mvscar1 )
@@ -4722,6 +4967,8 @@ ROM_START( mvscar1 )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "mvc.11m", 0x000000, 0x400000, CRC(850fe663) SHA1(81e519d05a08855f242ea2e17ee0859b449db895) )
ROM_LOAD16_WORD_SWAP( "mvc.12m", 0x400000, 0x400000, CRC(7ccb1896) SHA1(74caadf3282fcc6acffb1bbe3734106f81124121) )
+
+ MVSC_ASIA_KEY
ROM_END
ROM_START( mvsch )
@@ -4753,6 +5000,8 @@ ROM_START( mvsch )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "mvc.11m", 0x000000, 0x400000, CRC(850fe663) SHA1(81e519d05a08855f242ea2e17ee0859b449db895) )
ROM_LOAD16_WORD_SWAP( "mvc.12m", 0x400000, 0x400000, CRC(7ccb1896) SHA1(74caadf3282fcc6acffb1bbe3734106f81124121) )
+
+ MVSC_HISPANIC_KEY
ROM_END
ROM_START( mvscb )
@@ -4784,6 +5033,8 @@ ROM_START( mvscb )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "mvc.11m", 0x000000, 0x400000, CRC(850fe663) SHA1(81e519d05a08855f242ea2e17ee0859b449db895) )
ROM_LOAD16_WORD_SWAP( "mvc.12m", 0x400000, 0x400000, CRC(7ccb1896) SHA1(74caadf3282fcc6acffb1bbe3734106f81124121) )
+
+ MVSC_BRAZIL_KEY
ROM_END
ROM_START( mpang )
@@ -4808,6 +5059,8 @@ ROM_START( mpang )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "mpn-simm.05a", 0x000000, 0x200000, CRC(318a2e21) SHA1(c573cd88f8279a062c73ef1d79cd8421dbdcd93e) ) // ROM on a simm
ROM_LOAD16_WORD_SWAP( "mpn-simm.05b", 0x200000, 0x200000, CRC(5462f4e8) SHA1(299fbdab700e735e6395c5d9e3f079bb2e3dbd73) ) // ROM on a simm
+
+ MPANG_ALLREGIONS_KEY
ROM_END
ROM_START( mpangr1 )
@@ -4832,6 +5085,8 @@ ROM_START( mpangr1 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "mpn-simm.05a", 0x000000, 0x200000, CRC(318a2e21) SHA1(c573cd88f8279a062c73ef1d79cd8421dbdcd93e) ) // ROM on a simm
ROM_LOAD16_WORD_SWAP( "mpn-simm.05b", 0x200000, 0x200000, CRC(5462f4e8) SHA1(299fbdab700e735e6395c5d9e3f079bb2e3dbd73) ) // ROM on a simm
+
+ MPANG_ALLREGIONS_KEY
ROM_END
ROM_START( mpangu )
@@ -4855,6 +5110,8 @@ ROM_START( mpangu )
ROM_LOAD16_WORD_SWAP( "mpn.q2", 0x100000, 0x100000, CRC(d22090b1) SHA1(0ba65c0efb46af3cfb8ea3fe5087186248c57420) )
ROM_LOAD16_WORD_SWAP( "mpn.q3", 0x200000, 0x100000, CRC(60aa5ef2) SHA1(03fa994d7f5b43e05e8417a8769e07c22548a27a) )
ROM_LOAD16_WORD_SWAP( "mpn.q4", 0x300000, 0x100000, CRC(3a67d203) SHA1(7213364745d0c4c7fe11573afb9678483e24acb4) )
+
+ MPANG_ALLREGIONS_KEY
ROM_END
ROM_START( mpangj )
@@ -4879,6 +5136,8 @@ ROM_START( mpangj )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "mpn-simm.05a", 0x000000, 0x200000, CRC(318a2e21) SHA1(c573cd88f8279a062c73ef1d79cd8421dbdcd93e) ) // ROM on a simm
ROM_LOAD16_WORD_SWAP( "mpn-simm.05b", 0x200000, 0x200000, CRC(5462f4e8) SHA1(299fbdab700e735e6395c5d9e3f079bb2e3dbd73) ) // ROM on a simm
+
+ MPANG_ALLREGIONS_KEY
ROM_END
ROM_START( nwarr )
@@ -4910,6 +5169,8 @@ ROM_START( nwarr )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "vph.11m", 0x000000, 0x200000, CRC(e1837d33) SHA1(e3cb69f64767bacbec7286d0b4cd0ce7a0ba13d8) )
ROM_LOAD16_WORD_SWAP( "vph.12m", 0x200000, 0x200000, CRC(fbd3cd90) SHA1(4813c25802ad71b77ca04fd8f3a86344f99f0d6a) )
+
+ NWARR_WORLD_KEY
ROM_END
ROM_START( nwarru )
@@ -4941,6 +5202,8 @@ ROM_START( nwarru )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "vph.11m", 0x000000, 0x200000, CRC(e1837d33) SHA1(e3cb69f64767bacbec7286d0b4cd0ce7a0ba13d8) )
ROM_LOAD16_WORD_SWAP( "vph.12m", 0x200000, 0x200000, CRC(fbd3cd90) SHA1(4813c25802ad71b77ca04fd8f3a86344f99f0d6a) )
+
+ NWARR_USA_KEY
ROM_END
ROM_START( nwarrh )
@@ -4972,6 +5235,8 @@ ROM_START( nwarrh )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "vph.11m", 0x000000, 0x200000, CRC(e1837d33) SHA1(e3cb69f64767bacbec7286d0b4cd0ce7a0ba13d8) )
ROM_LOAD16_WORD_SWAP( "vph.12m", 0x200000, 0x200000, CRC(fbd3cd90) SHA1(4813c25802ad71b77ca04fd8f3a86344f99f0d6a) )
+
+ NWARR_HISPANIC_KEY
ROM_END
ROM_START( nwarrb )
@@ -5003,6 +5268,8 @@ ROM_START( nwarrb )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "vph.11m", 0x000000, 0x200000, CRC(e1837d33) SHA1(e3cb69f64767bacbec7286d0b4cd0ce7a0ba13d8) )
ROM_LOAD16_WORD_SWAP( "vph.12m", 0x200000, 0x200000, CRC(fbd3cd90) SHA1(4813c25802ad71b77ca04fd8f3a86344f99f0d6a) )
+
+ NWARR_BRAZIL_KEY
ROM_END
ROM_START( nwarra )
@@ -5034,6 +5301,8 @@ ROM_START( nwarra )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "vph.11m", 0x000000, 0x200000, CRC(e1837d33) SHA1(e3cb69f64767bacbec7286d0b4cd0ce7a0ba13d8) )
ROM_LOAD16_WORD_SWAP( "vph.12m", 0x200000, 0x200000, CRC(fbd3cd90) SHA1(4813c25802ad71b77ca04fd8f3a86344f99f0d6a) )
+
+ NWARR_ASIA_KEY
ROM_END
ROM_START( vhuntj )
@@ -5065,6 +5334,8 @@ ROM_START( vhuntj )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "vph.11m", 0x000000, 0x200000, CRC(e1837d33) SHA1(e3cb69f64767bacbec7286d0b4cd0ce7a0ba13d8) )
ROM_LOAD16_WORD_SWAP( "vph.12m", 0x200000, 0x200000, CRC(fbd3cd90) SHA1(4813c25802ad71b77ca04fd8f3a86344f99f0d6a) )
+
+ NWARR_JAPAN_KEY
ROM_END
ROM_START( vhuntjr1s )
@@ -5096,6 +5367,8 @@ ROM_START( vhuntjr1s )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "vph.11m", 0x000000, 0x200000, CRC(e1837d33) SHA1(e3cb69f64767bacbec7286d0b4cd0ce7a0ba13d8) )
ROM_LOAD16_WORD_SWAP( "vph.12m", 0x200000, 0x200000, CRC(fbd3cd90) SHA1(4813c25802ad71b77ca04fd8f3a86344f99f0d6a) )
+
+ NWARR_JAPAN_KEY
ROM_END
ROM_START( vhuntjr1 )
@@ -5127,6 +5400,8 @@ ROM_START( vhuntjr1 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "vph.11m", 0x000000, 0x200000, CRC(e1837d33) SHA1(e3cb69f64767bacbec7286d0b4cd0ce7a0ba13d8) )
ROM_LOAD16_WORD_SWAP( "vph.12m", 0x200000, 0x200000, CRC(fbd3cd90) SHA1(4813c25802ad71b77ca04fd8f3a86344f99f0d6a) )
+
+ NWARR_JAPAN_KEY
ROM_END
ROM_START( vhuntjr2 )
@@ -5158,6 +5433,8 @@ ROM_START( vhuntjr2 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "vph.11m", 0x000000, 0x200000, CRC(e1837d33) SHA1(e3cb69f64767bacbec7286d0b4cd0ce7a0ba13d8) )
ROM_LOAD16_WORD_SWAP( "vph.12m", 0x200000, 0x200000, CRC(fbd3cd90) SHA1(4813c25802ad71b77ca04fd8f3a86344f99f0d6a) )
+
+ NWARR_JAPAN_KEY
ROM_END
ROM_START( progear )
@@ -5184,6 +5461,8 @@ ROM_START( progear )
ROM_LOAD16_WORD_SWAP( "pga-simm.05b", 0x200000, 0x200000, CRC(37a65d86) SHA1(374d562a4648734f82aa2ddb6d258e870896dd45) ) // ROM on a simm
ROM_LOAD16_WORD_SWAP( "pga-simm.06a", 0x400000, 0x200000, CRC(d3f1e934) SHA1(5dcea28c873d0d472f5b94e07d97cd77ace2b252) ) // ROM on a simm
ROM_LOAD16_WORD_SWAP( "pga-simm.06b", 0x600000, 0x200000, CRC(8b39489a) SHA1(fd790efaf37dc2c4c16f657941044e3e2d3c2711) ) // ROM on a simm
+
+ PROGEAR_USA_KEY
ROM_END
ROM_START( progearj )
@@ -5210,6 +5489,8 @@ ROM_START( progearj )
ROM_LOAD16_WORD_SWAP( "pga-simm.05b", 0x200000, 0x200000, CRC(37a65d86) SHA1(374d562a4648734f82aa2ddb6d258e870896dd45) ) // ROM on a simm
ROM_LOAD16_WORD_SWAP( "pga-simm.06a", 0x400000, 0x200000, CRC(d3f1e934) SHA1(5dcea28c873d0d472f5b94e07d97cd77ace2b252) ) // ROM on a simm
ROM_LOAD16_WORD_SWAP( "pga-simm.06b", 0x600000, 0x200000, CRC(8b39489a) SHA1(fd790efaf37dc2c4c16f657941044e3e2d3c2711) ) // ROM on a simm
+
+ PROGEAR_JAPAN_KEY
ROM_END
ROM_START( progeara )
@@ -5236,6 +5517,8 @@ ROM_START( progeara )
ROM_LOAD16_WORD_SWAP( "pga-simm.05b", 0x200000, 0x200000, CRC(37a65d86) SHA1(374d562a4648734f82aa2ddb6d258e870896dd45) ) // ROM on a simm
ROM_LOAD16_WORD_SWAP( "pga-simm.06a", 0x400000, 0x200000, CRC(d3f1e934) SHA1(5dcea28c873d0d472f5b94e07d97cd77ace2b252) ) // ROM on a simm
ROM_LOAD16_WORD_SWAP( "pga-simm.06b", 0x600000, 0x200000, CRC(8b39489a) SHA1(fd790efaf37dc2c4c16f657941044e3e2d3c2711) ) // ROM on a simm
+
+ PROGEAR_ASIA_KEY
ROM_END
ROM_START( pzloop2 )
@@ -5262,6 +5545,8 @@ ROM_START( pzloop2 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "pl2-simm.05a", 0x000000, 0x200000, CRC(85d8fbe8) SHA1(c19d5e9084d07e610379b6e1b6be7bdf0b9b7f7f) ) // ROM on a simm
ROM_LOAD16_WORD_SWAP( "pl2-simm.05b", 0x200000, 0x200000, CRC(1ed62584) SHA1(28411f610f48cca6424a2d53e2a4ac691e826317) ) // ROM on a simm
+
+ PZLOOP2_ALLREGIONS_KEY
ROM_END
ROM_START( pzloop2j )
@@ -5288,6 +5573,8 @@ ROM_START( pzloop2j )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "pl2-simm.05a", 0x000000, 0x200000, CRC(85d8fbe8) SHA1(c19d5e9084d07e610379b6e1b6be7bdf0b9b7f7f) ) // ROM on a simm
ROM_LOAD16_WORD_SWAP( "pl2-simm.05b", 0x200000, 0x200000, CRC(1ed62584) SHA1(28411f610f48cca6424a2d53e2a4ac691e826317) ) // ROM on a simm
+
+ PZLOOP2_ALLREGIONS_KEY
ROM_END
ROM_START( pzloop2jr1 )
@@ -5314,6 +5601,8 @@ ROM_START( pzloop2jr1 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "pl2-simm.05a", 0x000000, 0x200000, CRC(85d8fbe8) SHA1(c19d5e9084d07e610379b6e1b6be7bdf0b9b7f7f) ) // ROM on a simm
ROM_LOAD16_WORD_SWAP( "pl2-simm.05b", 0x200000, 0x200000, CRC(1ed62584) SHA1(28411f610f48cca6424a2d53e2a4ac691e826317) ) // ROM on a simm
+
+ PZLOOP2_ALLREGIONS_KEY
ROM_END
ROM_START( qndream )
@@ -5337,6 +5626,8 @@ ROM_START( qndream )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "tqz.11m", 0x000000, 0x200000, CRC(78e7884f) SHA1(82fbbf704ac4bc0e0e7a6f407686861aa3693c23) )
ROM_LOAD16_WORD_SWAP( "tqz.12m", 0x200000, 0x200000, CRC(2e049b13) SHA1(e026f444b905e679e8240c7dd371658c4a3fd713) )
+
+ QNDREAM_JAPAN_KEY
ROM_END
ROM_START( ringdest )
@@ -5370,6 +5661,8 @@ ROM_START( ringdest )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "smb.11m", 0x000000, 0x200000, CRC(c56935f9) SHA1(ca1705e48e31ddc13505e6297bceca2bec1bb209) )
ROM_LOAD16_WORD_SWAP( "smb.12m", 0x200000, 0x200000, CRC(955b0782) SHA1(ee09500e7b44e923126533613bfe26cdabc7ab5f) )
+
+ RINGDEST_WORLD_KEY
ROM_END
ROM_START( smbomb )
@@ -5403,6 +5696,8 @@ ROM_START( smbomb )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "smb.11m", 0x000000, 0x200000, CRC(c56935f9) SHA1(ca1705e48e31ddc13505e6297bceca2bec1bb209) )
ROM_LOAD16_WORD_SWAP( "smb.12m", 0x200000, 0x200000, CRC(955b0782) SHA1(ee09500e7b44e923126533613bfe26cdabc7ab5f) )
+
+ RINGDEST_JAPAN_KEY
ROM_END
ROM_START( smbombr1 )
@@ -5436,6 +5731,8 @@ ROM_START( smbombr1 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "smb.11m", 0x000000, 0x200000, CRC(c56935f9) SHA1(ca1705e48e31ddc13505e6297bceca2bec1bb209) )
ROM_LOAD16_WORD_SWAP( "smb.12m", 0x200000, 0x200000, CRC(955b0782) SHA1(ee09500e7b44e923126533613bfe26cdabc7ab5f) )
+
+ RINGDEST_JAPAN_KEY
ROM_END
ROM_START( ringdesta )
@@ -5469,6 +5766,8 @@ ROM_START( ringdesta )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "smb.11m", 0x000000, 0x200000, CRC(c56935f9) SHA1(ca1705e48e31ddc13505e6297bceca2bec1bb209) )
ROM_LOAD16_WORD_SWAP( "smb.12m", 0x200000, 0x200000, CRC(955b0782) SHA1(ee09500e7b44e923126533613bfe26cdabc7ab5f) )
+
+ RINGDEST_ASIA_KEY
ROM_END
ROM_START( mmancp2u )
@@ -5509,6 +5808,8 @@ ROM_START( mmancp2u )
ROM_LOAD16_WORD_SWAP( "rcm.56", 0x280000, 0x80000, CRC(ade475bc) SHA1(02ae6bc21d5e41e05595845f264c9ad040d70b37) )
ROM_LOAD16_WORD_SWAP( "rcm.57", 0x300000, 0x80000, CRC(075effb3) SHA1(4be02d966d933c0d92908c5e05842c6b33c9703b) )
ROM_LOAD16_WORD_SWAP( "rcm.58", 0x380000, 0x80000, CRC(f6c1f87b) SHA1(d6cd8d2bac96404b6983d738093b7177d478f12e) )
+
+ MMANCP2_USA_KEY
ROM_END
ROM_START( mmancp2ur1 )
@@ -5549,6 +5850,8 @@ ROM_START( mmancp2ur1 )
ROM_LOAD16_WORD_SWAP( "rcm.56", 0x280000, 0x80000, CRC(ade475bc) SHA1(02ae6bc21d5e41e05595845f264c9ad040d70b37) )
ROM_LOAD16_WORD_SWAP( "rcm.57", 0x300000, 0x80000, CRC(075effb3) SHA1(4be02d966d933c0d92908c5e05842c6b33c9703b) )
ROM_LOAD16_WORD_SWAP( "rcm.58", 0x380000, 0x80000, CRC(f6c1f87b) SHA1(d6cd8d2bac96404b6983d738093b7177d478f12e) )
+
+ MMANCP2_USA_KEY
ROM_END
@@ -5590,6 +5893,8 @@ ROM_START( rmancp2j )
ROM_LOAD16_WORD_SWAP( "rcm.56", 0x280000, 0x80000, CRC(ade475bc) SHA1(02ae6bc21d5e41e05595845f264c9ad040d70b37) )
ROM_LOAD16_WORD_SWAP( "rcm.57", 0x300000, 0x80000, CRC(075effb3) SHA1(4be02d966d933c0d92908c5e05842c6b33c9703b) )
ROM_LOAD16_WORD_SWAP( "rcm.58", 0x380000, 0x80000, CRC(f6c1f87b) SHA1(d6cd8d2bac96404b6983d738093b7177d478f12e) )
+
+ MMANCP2_JAPAN_KEY
ROM_END
ROM_START( sfa )
@@ -5614,6 +5919,8 @@ ROM_START( sfa )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "sfz.11m", 0x000000, 0x200000, CRC(c4b093cd) SHA1(256526bb693a0b72443f047e060304c9b739acd1) )
ROM_LOAD16_WORD_SWAP( "sfz.12m", 0x200000, 0x200000, CRC(8bdbc4b4) SHA1(0e21c9a75a17a7e7dfd8bb51098c2b9dc4c933ec) )
+
+ SFA_WORLD_KEY
ROM_END
ROM_START( sfar1 )
@@ -5638,6 +5945,8 @@ ROM_START( sfar1 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "sfz.11m", 0x000000, 0x200000, CRC(c4b093cd) SHA1(256526bb693a0b72443f047e060304c9b739acd1) )
ROM_LOAD16_WORD_SWAP( "sfz.12m", 0x200000, 0x200000, CRC(8bdbc4b4) SHA1(0e21c9a75a17a7e7dfd8bb51098c2b9dc4c933ec) )
+
+ SFA_WORLD_KEY
ROM_END
ROM_START( sfar2 )
@@ -5662,6 +5971,8 @@ ROM_START( sfar2 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "sfz.11m", 0x000000, 0x200000, CRC(c4b093cd) SHA1(256526bb693a0b72443f047e060304c9b739acd1) )
ROM_LOAD16_WORD_SWAP( "sfz.12m", 0x200000, 0x200000, CRC(8bdbc4b4) SHA1(0e21c9a75a17a7e7dfd8bb51098c2b9dc4c933ec) )
+
+ SFA_WORLD_KEY
ROM_END
ROM_START( sfar3 )
@@ -5686,6 +5997,8 @@ ROM_START( sfar3 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "sfz.11m", 0x000000, 0x200000, CRC(c4b093cd) SHA1(256526bb693a0b72443f047e060304c9b739acd1) )
ROM_LOAD16_WORD_SWAP( "sfz.12m", 0x200000, 0x200000, CRC(8bdbc4b4) SHA1(0e21c9a75a17a7e7dfd8bb51098c2b9dc4c933ec) )
+
+ SFA_WORLD_KEY
ROM_END
ROM_START( sfau )
@@ -5710,6 +6023,8 @@ ROM_START( sfau )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "sfz.11m", 0x000000, 0x200000, CRC(c4b093cd) SHA1(256526bb693a0b72443f047e060304c9b739acd1) )
ROM_LOAD16_WORD_SWAP( "sfz.12m", 0x200000, 0x200000, CRC(8bdbc4b4) SHA1(0e21c9a75a17a7e7dfd8bb51098c2b9dc4c933ec) )
+
+ SFA_USA_KEY
ROM_END
ROM_START( sfza )
@@ -5734,6 +6049,8 @@ ROM_START( sfza )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "sfz.11m", 0x000000, 0x200000, CRC(c4b093cd) SHA1(256526bb693a0b72443f047e060304c9b739acd1) )
ROM_LOAD16_WORD_SWAP( "sfz.12m", 0x200000, 0x200000, CRC(8bdbc4b4) SHA1(0e21c9a75a17a7e7dfd8bb51098c2b9dc4c933ec) )
+
+ SFA_ASIA_KEY
ROM_END
ROM_START( sfzar1 )
@@ -5758,6 +6075,8 @@ ROM_START( sfzar1 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "sfz.11m", 0x000000, 0x200000, CRC(c4b093cd) SHA1(256526bb693a0b72443f047e060304c9b739acd1) )
ROM_LOAD16_WORD_SWAP( "sfz.12m", 0x200000, 0x200000, CRC(8bdbc4b4) SHA1(0e21c9a75a17a7e7dfd8bb51098c2b9dc4c933ec) )
+
+ SFA_ASIA_KEY
ROM_END
ROM_START( sfzj )
@@ -5782,6 +6101,8 @@ ROM_START( sfzj )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "sfz.11m", 0x000000, 0x200000, CRC(c4b093cd) SHA1(256526bb693a0b72443f047e060304c9b739acd1) )
ROM_LOAD16_WORD_SWAP( "sfz.12m", 0x200000, 0x200000, CRC(8bdbc4b4) SHA1(0e21c9a75a17a7e7dfd8bb51098c2b9dc4c933ec) )
+
+ SFA_JAPAN_KEY
ROM_END
ROM_START( sfzjr1 )
@@ -5806,6 +6127,8 @@ ROM_START( sfzjr1 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "sfz.11m", 0x000000, 0x200000, CRC(c4b093cd) SHA1(256526bb693a0b72443f047e060304c9b739acd1) )
ROM_LOAD16_WORD_SWAP( "sfz.12m", 0x200000, 0x200000, CRC(8bdbc4b4) SHA1(0e21c9a75a17a7e7dfd8bb51098c2b9dc4c933ec) )
+
+ SFA_JAPAN_KEY
ROM_END
ROM_START( sfzjr2 )
@@ -5830,6 +6153,8 @@ ROM_START( sfzjr2 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "sfz.11m", 0x000000, 0x200000, CRC(c4b093cd) SHA1(256526bb693a0b72443f047e060304c9b739acd1) )
ROM_LOAD16_WORD_SWAP( "sfz.12m", 0x200000, 0x200000, CRC(8bdbc4b4) SHA1(0e21c9a75a17a7e7dfd8bb51098c2b9dc4c933ec) )
+
+ SFA_JAPAN_KEY
ROM_END
ROM_START( sfzh )
@@ -5854,6 +6179,8 @@ ROM_START( sfzh )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "sfz.11m", 0x000000, 0x200000, CRC(c4b093cd) SHA1(256526bb693a0b72443f047e060304c9b739acd1) )
ROM_LOAD16_WORD_SWAP( "sfz.12m", 0x200000, 0x200000, CRC(8bdbc4b4) SHA1(0e21c9a75a17a7e7dfd8bb51098c2b9dc4c933ec) )
+
+ SFA_HISPANIC_KEY
ROM_END
ROM_START( sfzhr1 )
@@ -5878,6 +6205,8 @@ ROM_START( sfzhr1 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "sfz.11m", 0x000000, 0x200000, CRC(c4b093cd) SHA1(256526bb693a0b72443f047e060304c9b739acd1) )
ROM_LOAD16_WORD_SWAP( "sfz.12m", 0x200000, 0x200000, CRC(8bdbc4b4) SHA1(0e21c9a75a17a7e7dfd8bb51098c2b9dc4c933ec) )
+
+ SFA_HISPANIC_KEY
ROM_END
ROM_START( sfzb )
@@ -5902,6 +6231,8 @@ ROM_START( sfzb )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "sfz.11m", 0x000000, 0x200000, CRC(c4b093cd) SHA1(256526bb693a0b72443f047e060304c9b739acd1) )
ROM_LOAD16_WORD_SWAP( "sfz.12m", 0x200000, 0x200000, CRC(8bdbc4b4) SHA1(0e21c9a75a17a7e7dfd8bb51098c2b9dc4c933ec) )
+
+ SFA_BRAZIL_KEY
ROM_END
ROM_START( sfzbr1 )
@@ -5926,6 +6257,8 @@ ROM_START( sfzbr1 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "sfz.11m", 0x000000, 0x200000, CRC(c4b093cd) SHA1(256526bb693a0b72443f047e060304c9b739acd1) )
ROM_LOAD16_WORD_SWAP( "sfz.12m", 0x200000, 0x200000, CRC(8bdbc4b4) SHA1(0e21c9a75a17a7e7dfd8bb51098c2b9dc4c933ec) )
+
+ SFA_BRAZIL_KEY
ROM_END
ROM_START( sfa2 )
@@ -5955,6 +6288,8 @@ ROM_START( sfa2 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "sz2.11m", 0x000000, 0x200000, CRC(aa47a601) SHA1(a4d1ee89c84a3b9db06469bb66e85293b5aa9ac9) )
ROM_LOAD16_WORD_SWAP( "sz2.12m", 0x200000, 0x200000, CRC(2237bc53) SHA1(96d5693047e4cf1ed10a8ee1905cea267a278e92) )
+
+ SFA2_WORLD_KEY
ROM_END
ROM_START( sfa2u )
@@ -5984,6 +6319,8 @@ ROM_START( sfa2u )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "sz2.11m", 0x000000, 0x200000, CRC(aa47a601) SHA1(a4d1ee89c84a3b9db06469bb66e85293b5aa9ac9) )
ROM_LOAD16_WORD_SWAP( "sz2.12m", 0x200000, 0x200000, CRC(2237bc53) SHA1(96d5693047e4cf1ed10a8ee1905cea267a278e92) )
+
+ SFA2_USA_KEY
ROM_END
ROM_START( sfa2ur1 )
@@ -6013,6 +6350,8 @@ ROM_START( sfa2ur1 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "sz2.11m", 0x000000, 0x200000, CRC(aa47a601) SHA1(a4d1ee89c84a3b9db06469bb66e85293b5aa9ac9) )
ROM_LOAD16_WORD_SWAP( "sz2.12m", 0x200000, 0x200000, CRC(2237bc53) SHA1(96d5693047e4cf1ed10a8ee1905cea267a278e92) )
+
+ SFA2_USA_KEY
ROM_END
ROM_START( sfz2j )
@@ -6042,6 +6381,8 @@ ROM_START( sfz2j )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "sz2.11m", 0x000000, 0x200000, CRC(aa47a601) SHA1(a4d1ee89c84a3b9db06469bb66e85293b5aa9ac9) )
ROM_LOAD16_WORD_SWAP( "sz2.12m", 0x200000, 0x200000, CRC(2237bc53) SHA1(96d5693047e4cf1ed10a8ee1905cea267a278e92) )
+
+ SFA2_JAPAN_KEY
ROM_END
ROM_START( sfz2jr1 )
@@ -6071,6 +6412,8 @@ ROM_START( sfz2jr1 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "sz2.11m", 0x000000, 0x200000, CRC(aa47a601) SHA1(a4d1ee89c84a3b9db06469bb66e85293b5aa9ac9) )
ROM_LOAD16_WORD_SWAP( "sz2.12m", 0x200000, 0x200000, CRC(2237bc53) SHA1(96d5693047e4cf1ed10a8ee1905cea267a278e92) )
+
+ SFA2_JAPAN_KEY
ROM_END
ROM_START( sfz2a )
@@ -6100,6 +6443,8 @@ ROM_START( sfz2a )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "sz2.11m", 0x000000, 0x200000, CRC(aa47a601) SHA1(a4d1ee89c84a3b9db06469bb66e85293b5aa9ac9) )
ROM_LOAD16_WORD_SWAP( "sz2.12m", 0x200000, 0x200000, CRC(2237bc53) SHA1(96d5693047e4cf1ed10a8ee1905cea267a278e92) )
+
+ SFA2_ASIA_KEY
ROM_END
ROM_START( sfz2b )
@@ -6129,6 +6474,8 @@ ROM_START( sfz2b )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "sz2.11m", 0x000000, 0x200000, CRC(aa47a601) SHA1(a4d1ee89c84a3b9db06469bb66e85293b5aa9ac9) )
ROM_LOAD16_WORD_SWAP( "sz2.12m", 0x200000, 0x200000, CRC(2237bc53) SHA1(96d5693047e4cf1ed10a8ee1905cea267a278e92) )
+
+ SFA2_BRAZIL_KEY
ROM_END
ROM_START( sfz2br1 )
@@ -6158,6 +6505,8 @@ ROM_START( sfz2br1 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "sz2.11m", 0x000000, 0x200000, CRC(aa47a601) SHA1(a4d1ee89c84a3b9db06469bb66e85293b5aa9ac9) )
ROM_LOAD16_WORD_SWAP( "sz2.12m", 0x200000, 0x200000, CRC(2237bc53) SHA1(96d5693047e4cf1ed10a8ee1905cea267a278e92) )
+
+ SFA2_BRAZIL_KEY
ROM_END
ROM_START( sfz2h )
@@ -6187,6 +6536,8 @@ ROM_START( sfz2h )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "sz2.11m", 0x000000, 0x200000, CRC(aa47a601) SHA1(a4d1ee89c84a3b9db06469bb66e85293b5aa9ac9) )
ROM_LOAD16_WORD_SWAP( "sz2.12m", 0x200000, 0x200000, CRC(2237bc53) SHA1(96d5693047e4cf1ed10a8ee1905cea267a278e92) )
+
+ SFA2_HISPANIC_KEY
ROM_END
ROM_START( sfz2n )
@@ -6216,6 +6567,8 @@ ROM_START( sfz2n )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "sz2.11m", 0x000000, 0x200000, CRC(aa47a601) SHA1(a4d1ee89c84a3b9db06469bb66e85293b5aa9ac9) )
ROM_LOAD16_WORD_SWAP( "sz2.12m", 0x200000, 0x200000, CRC(2237bc53) SHA1(96d5693047e4cf1ed10a8ee1905cea267a278e92) )
+
+ SFA2_OCEANIA_KEY
ROM_END
ROM_START( sfz2al )
@@ -6245,6 +6598,8 @@ ROM_START( sfz2al )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "sza.11m", 0x000000, 0x200000, CRC(aa47a601) SHA1(a4d1ee89c84a3b9db06469bb66e85293b5aa9ac9) )
ROM_LOAD16_WORD_SWAP( "sza.12m", 0x200000, 0x200000, CRC(2237bc53) SHA1(96d5693047e4cf1ed10a8ee1905cea267a278e92) )
+
+ SFZ2AL_ASIA_KEY
ROM_END
ROM_START( sfz2alj )
@@ -6274,6 +6629,8 @@ ROM_START( sfz2alj )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "sza.11m", 0x000000, 0x200000, CRC(aa47a601) SHA1(a4d1ee89c84a3b9db06469bb66e85293b5aa9ac9) )
ROM_LOAD16_WORD_SWAP( "sza.12m", 0x200000, 0x200000, CRC(2237bc53) SHA1(96d5693047e4cf1ed10a8ee1905cea267a278e92) )
+
+ SFZ2AL_JAPAN_KEY
ROM_END
ROM_START( sfz2alh )
@@ -6303,6 +6660,8 @@ ROM_START( sfz2alh )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "sza.11m", 0x000000, 0x200000, CRC(aa47a601) SHA1(a4d1ee89c84a3b9db06469bb66e85293b5aa9ac9) )
ROM_LOAD16_WORD_SWAP( "sza.12m", 0x200000, 0x200000, CRC(2237bc53) SHA1(96d5693047e4cf1ed10a8ee1905cea267a278e92) )
+
+ SFZ2AL_HISPANIC_KEY
ROM_END
ROM_START( sfz2alb )
@@ -6332,6 +6691,8 @@ ROM_START( sfz2alb )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "sza.11m", 0x000000, 0x200000, CRC(aa47a601) SHA1(a4d1ee89c84a3b9db06469bb66e85293b5aa9ac9) )
ROM_LOAD16_WORD_SWAP( "sza.12m", 0x200000, 0x200000, CRC(2237bc53) SHA1(96d5693047e4cf1ed10a8ee1905cea267a278e92) )
+
+ SFZ2AL_BRAZIL_KEY
ROM_END
ROM_START( sfa3 )
@@ -6363,6 +6724,8 @@ ROM_START( sfa3 )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "sz3.11m", 0x000000, 0x400000, CRC(1c89eed1) SHA1(649a0b0a3eb72e2e69e9fb1ac51a58b70daa39f3) )
ROM_LOAD16_WORD_SWAP( "sz3.12m", 0x400000, 0x400000, CRC(f392b13a) SHA1(fa04ce0370144a49bd1d5acd873eef87b0dc9d15) )
+
+ SFA3_WORLD_KEY
ROM_END
ROM_START( sfa3u )
@@ -6394,6 +6757,8 @@ ROM_START( sfa3u )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "sz3.11m", 0x000000, 0x400000, CRC(1c89eed1) SHA1(649a0b0a3eb72e2e69e9fb1ac51a58b70daa39f3) )
ROM_LOAD16_WORD_SWAP( "sz3.12m", 0x400000, 0x400000, CRC(f392b13a) SHA1(fa04ce0370144a49bd1d5acd873eef87b0dc9d15) )
+
+ SFA3_USA_KEY
ROM_END
ROM_START( sfa3ur1 )
@@ -6425,6 +6790,8 @@ ROM_START( sfa3ur1 )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "sz3.11m", 0x000000, 0x400000, CRC(1c89eed1) SHA1(649a0b0a3eb72e2e69e9fb1ac51a58b70daa39f3) )
ROM_LOAD16_WORD_SWAP( "sz3.12m", 0x400000, 0x400000, CRC(f392b13a) SHA1(fa04ce0370144a49bd1d5acd873eef87b0dc9d15) )
+
+ SFA3_USA_KEY
ROM_END
ROM_START( sfz3j )
@@ -6456,6 +6823,8 @@ ROM_START( sfz3j )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "sz3.11m", 0x000000, 0x400000, CRC(1c89eed1) SHA1(649a0b0a3eb72e2e69e9fb1ac51a58b70daa39f3) )
ROM_LOAD16_WORD_SWAP( "sz3.12m", 0x400000, 0x400000, CRC(f392b13a) SHA1(fa04ce0370144a49bd1d5acd873eef87b0dc9d15) )
+
+ SFA3_JAPAN_KEY
ROM_END
ROM_START( sfz3jr1 )
@@ -6487,6 +6856,8 @@ ROM_START( sfz3jr1 )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "sz3.11m", 0x000000, 0x400000, CRC(1c89eed1) SHA1(649a0b0a3eb72e2e69e9fb1ac51a58b70daa39f3) )
ROM_LOAD16_WORD_SWAP( "sz3.12m", 0x400000, 0x400000, CRC(f392b13a) SHA1(fa04ce0370144a49bd1d5acd873eef87b0dc9d15) )
+
+ SFA3_JAPAN_KEY
ROM_END
ROM_START( sfz3jr2 )
@@ -6518,6 +6889,8 @@ ROM_START( sfz3jr2 )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "sz3.11m", 0x000000, 0x400000, CRC(1c89eed1) SHA1(649a0b0a3eb72e2e69e9fb1ac51a58b70daa39f3) )
ROM_LOAD16_WORD_SWAP( "sz3.12m", 0x400000, 0x400000, CRC(f392b13a) SHA1(fa04ce0370144a49bd1d5acd873eef87b0dc9d15) )
+
+ SFA3_JAPAN_KEY
ROM_END
ROM_START( sfz3a )
@@ -6549,6 +6922,8 @@ ROM_START( sfz3a )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "sz3.11m", 0x000000, 0x400000, CRC(1c89eed1) SHA1(649a0b0a3eb72e2e69e9fb1ac51a58b70daa39f3) )
ROM_LOAD16_WORD_SWAP( "sz3.12m", 0x400000, 0x400000, CRC(f392b13a) SHA1(fa04ce0370144a49bd1d5acd873eef87b0dc9d15) )
+
+ SFA3_ASIA_KEY
ROM_END
ROM_START( sfz3ar1 )
@@ -6580,6 +6955,8 @@ ROM_START( sfz3ar1 )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "sz3.11m", 0x000000, 0x400000, CRC(1c89eed1) SHA1(649a0b0a3eb72e2e69e9fb1ac51a58b70daa39f3) )
ROM_LOAD16_WORD_SWAP( "sz3.12m", 0x400000, 0x400000, CRC(f392b13a) SHA1(fa04ce0370144a49bd1d5acd873eef87b0dc9d15) )
+
+ SFA3_ASIA_KEY
ROM_END
ROM_START( sfa3h )
@@ -6611,6 +6988,8 @@ ROM_START( sfa3h )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "sz3.11m", 0x000000, 0x400000, CRC(1c89eed1) SHA1(649a0b0a3eb72e2e69e9fb1ac51a58b70daa39f3) )
ROM_LOAD16_WORD_SWAP( "sz3.12m", 0x400000, 0x400000, CRC(f392b13a) SHA1(fa04ce0370144a49bd1d5acd873eef87b0dc9d15) )
+
+ SFA3_HISPANIC_KEY
ROM_END
ROM_START( sfa3hr1 )
@@ -6642,6 +7021,8 @@ ROM_START( sfa3hr1 )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "sz3.11m", 0x000000, 0x400000, CRC(1c89eed1) SHA1(649a0b0a3eb72e2e69e9fb1ac51a58b70daa39f3) )
ROM_LOAD16_WORD_SWAP( "sz3.12m", 0x400000, 0x400000, CRC(f392b13a) SHA1(fa04ce0370144a49bd1d5acd873eef87b0dc9d15) )
+
+ SFA3_HISPANIC_KEY
ROM_END
ROM_START( sfa3b )
@@ -6673,6 +7054,8 @@ ROM_START( sfa3b )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "sz3.11m", 0x000000, 0x400000, CRC(1c89eed1) SHA1(649a0b0a3eb72e2e69e9fb1ac51a58b70daa39f3) )
ROM_LOAD16_WORD_SWAP( "sz3.12m", 0x400000, 0x400000, CRC(f392b13a) SHA1(fa04ce0370144a49bd1d5acd873eef87b0dc9d15) )
+
+ SFA3_BRAZIL_KEY
ROM_END
ROM_START( sgemf )
@@ -6701,6 +7084,8 @@ ROM_START( sgemf )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "pcf.11m", 0x000000, 0x400000, CRC(a5dea005) SHA1(3ae79baf6ff5bd527f82b26f164c7e3c65423ae2) )
ROM_LOAD16_WORD_SWAP( "pcf.12m", 0x400000, 0x400000, CRC(4ce235fe) SHA1(795b94557e954cc0e45fd3778b609064d57a34a2) )
+
+ SGEMF_USA_KEY
ROM_END
ROM_START( pfghtj )
@@ -6729,6 +7114,8 @@ ROM_START( pfghtj )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "pcf.11m", 0x000000, 0x400000, CRC(a5dea005) SHA1(3ae79baf6ff5bd527f82b26f164c7e3c65423ae2) )
ROM_LOAD16_WORD_SWAP( "pcf.12m", 0x400000, 0x400000, CRC(4ce235fe) SHA1(795b94557e954cc0e45fd3778b609064d57a34a2) )
+
+ SGEMF_JAPAN_KEY
ROM_END
ROM_START( sgemfa )
@@ -6757,6 +7144,8 @@ ROM_START( sgemfa )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "pcf.11m", 0x000000, 0x400000, CRC(a5dea005) SHA1(3ae79baf6ff5bd527f82b26f164c7e3c65423ae2) )
ROM_LOAD16_WORD_SWAP( "pcf.12m", 0x400000, 0x400000, CRC(4ce235fe) SHA1(795b94557e954cc0e45fd3778b609064d57a34a2) )
+
+ SGEMF_ASIA_KEY
ROM_END
ROM_START( sgemfh )
@@ -6785,6 +7174,8 @@ ROM_START( sgemfh )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "pcf.11m", 0x000000, 0x400000, CRC(a5dea005) SHA1(3ae79baf6ff5bd527f82b26f164c7e3c65423ae2) )
ROM_LOAD16_WORD_SWAP( "pcf.12m", 0x400000, 0x400000, CRC(4ce235fe) SHA1(795b94557e954cc0e45fd3778b609064d57a34a2) )
+
+ SGEMF_HISPANIC_KEY
ROM_END
ROM_START( spf2t )
@@ -6807,6 +7198,8 @@ ROM_START( spf2t )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "pzf.11m", 0x000000, 0x200000, CRC(78442743) SHA1(b61190bb586871de6d54af580e3e1d9cc0de0acb) )
ROM_LOAD16_WORD_SWAP( "pzf.12m", 0x200000, 0x200000, CRC(399d2c7b) SHA1(e849dea97b8d16540415c0d9bbc4f9f4eb755ec4) )
+
+ SPF2T_WORLD_KEY
ROM_END
ROM_START( spf2tu )
@@ -6829,6 +7222,8 @@ ROM_START( spf2tu )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "pzf.11m", 0x000000, 0x200000, CRC(78442743) SHA1(b61190bb586871de6d54af580e3e1d9cc0de0acb) )
ROM_LOAD16_WORD_SWAP( "pzf.12m", 0x200000, 0x200000, CRC(399d2c7b) SHA1(e849dea97b8d16540415c0d9bbc4f9f4eb755ec4) )
+
+ SPF2T_USA_KEY
ROM_END
@@ -6852,6 +7247,8 @@ ROM_START( spf2xj )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "pzf.11m", 0x000000, 0x200000, CRC(78442743) SHA1(b61190bb586871de6d54af580e3e1d9cc0de0acb) )
ROM_LOAD16_WORD_SWAP( "pzf.12m", 0x200000, 0x200000, CRC(399d2c7b) SHA1(e849dea97b8d16540415c0d9bbc4f9f4eb755ec4) )
+
+ SPF2T_JAPAN_KEY
ROM_END
ROM_START( spf2ta )
@@ -6874,6 +7271,8 @@ ROM_START( spf2ta )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "pzf.11m", 0x000000, 0x200000, CRC(78442743) SHA1(b61190bb586871de6d54af580e3e1d9cc0de0acb) )
ROM_LOAD16_WORD_SWAP( "pzf.12m", 0x200000, 0x200000, CRC(399d2c7b) SHA1(e849dea97b8d16540415c0d9bbc4f9f4eb755ec4) )
+
+ SPF2T_ASIA_KEY
ROM_END
ROM_START( spf2th )
@@ -6896,6 +7295,8 @@ ROM_START( spf2th )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "pzf.11m", 0x000000, 0x200000, CRC(78442743) SHA1(b61190bb586871de6d54af580e3e1d9cc0de0acb) )
ROM_LOAD16_WORD_SWAP( "pzf.12m", 0x200000, 0x200000, CRC(399d2c7b) SHA1(e849dea97b8d16540415c0d9bbc4f9f4eb755ec4) )
+
+ SPF2T_HISPANIC_KEY
ROM_END
ROM_START( ssf2 )
@@ -6929,6 +7330,8 @@ ROM_START( ssf2 )
ROM_LOAD( "ssf.q06", 0x280000, 0x080000, CRC(4e79c951) SHA1(1144781d7dc57ef8a6458d982f5c91548ff59e27) )
ROM_LOAD( "ssf.q07", 0x300000, 0x080000, CRC(cdd14313) SHA1(ebe767a9d4b51dba4282fa0a36a546a88620dd59) )
ROM_LOAD( "ssf.q08", 0x380000, 0x080000, CRC(6f5a088c) SHA1(6c0b4690479647a99d76335f174be8455b4ff118) )
+
+ SSF2_WORLD_KEY
ROM_END
ROM_START( ssf2r1 )
@@ -6962,6 +7365,8 @@ ROM_START( ssf2r1 )
ROM_LOAD( "ssf.q06", 0x280000, 0x080000, CRC(4e79c951) SHA1(1144781d7dc57ef8a6458d982f5c91548ff59e27) )
ROM_LOAD( "ssf.q07", 0x300000, 0x080000, CRC(cdd14313) SHA1(ebe767a9d4b51dba4282fa0a36a546a88620dd59) )
ROM_LOAD( "ssf.q08", 0x380000, 0x080000, CRC(6f5a088c) SHA1(6c0b4690479647a99d76335f174be8455b4ff118) )
+
+ SSF2_WORLD_KEY
ROM_END
ROM_START( ssf2u )
@@ -6995,6 +7400,8 @@ ROM_START( ssf2u )
ROM_LOAD( "ssf.q06", 0x280000, 0x080000, CRC(4e79c951) SHA1(1144781d7dc57ef8a6458d982f5c91548ff59e27) )
ROM_LOAD( "ssf.q07", 0x300000, 0x080000, CRC(cdd14313) SHA1(ebe767a9d4b51dba4282fa0a36a546a88620dd59) )
ROM_LOAD( "ssf.q08", 0x380000, 0x080000, CRC(6f5a088c) SHA1(6c0b4690479647a99d76335f174be8455b4ff118) )
+
+ SSF2_USA_KEY
ROM_END
ROM_START( ssf2a )
@@ -7028,6 +7435,8 @@ ROM_START( ssf2a )
ROM_LOAD( "ssf.q06", 0x280000, 0x080000, CRC(4e79c951) SHA1(1144781d7dc57ef8a6458d982f5c91548ff59e27) )
ROM_LOAD( "ssf.q07", 0x300000, 0x080000, CRC(cdd14313) SHA1(ebe767a9d4b51dba4282fa0a36a546a88620dd59) )
ROM_LOAD( "ssf.q08", 0x380000, 0x080000, CRC(6f5a088c) SHA1(6c0b4690479647a99d76335f174be8455b4ff118) )
+
+ SSF2_ASIA_KEY
ROM_END
ROM_START( ssf2ar1 )
@@ -7061,6 +7470,8 @@ ROM_START( ssf2ar1 )
ROM_LOAD( "ssf.q06", 0x280000, 0x080000, CRC(4e79c951) SHA1(1144781d7dc57ef8a6458d982f5c91548ff59e27) )
ROM_LOAD( "ssf.q07", 0x300000, 0x080000, CRC(cdd14313) SHA1(ebe767a9d4b51dba4282fa0a36a546a88620dd59) )
ROM_LOAD( "ssf.q08", 0x380000, 0x080000, CRC(6f5a088c) SHA1(6c0b4690479647a99d76335f174be8455b4ff118) )
+
+ SSF2_ASIA_KEY
ROM_END
ROM_START( ssf2j )
@@ -7094,6 +7505,8 @@ ROM_START( ssf2j )
ROM_LOAD( "ssf.q06", 0x280000, 0x080000, CRC(4e79c951) SHA1(1144781d7dc57ef8a6458d982f5c91548ff59e27) )
ROM_LOAD( "ssf.q07", 0x300000, 0x080000, CRC(cdd14313) SHA1(ebe767a9d4b51dba4282fa0a36a546a88620dd59) )
ROM_LOAD( "ssf.q08", 0x380000, 0x080000, CRC(6f5a088c) SHA1(6c0b4690479647a99d76335f174be8455b4ff118) )
+
+ SSF2_JAPAN_KEY
ROM_END
ROM_START( ssf2jr1 )
@@ -7127,6 +7540,8 @@ ROM_START( ssf2jr1 )
ROM_LOAD( "ssf.q06", 0x280000, 0x080000, CRC(4e79c951) SHA1(1144781d7dc57ef8a6458d982f5c91548ff59e27) )
ROM_LOAD( "ssf.q07", 0x300000, 0x080000, CRC(cdd14313) SHA1(ebe767a9d4b51dba4282fa0a36a546a88620dd59) )
ROM_LOAD( "ssf.q08", 0x380000, 0x080000, CRC(6f5a088c) SHA1(6c0b4690479647a99d76335f174be8455b4ff118) )
+
+ SSF2_JAPAN_KEY
ROM_END
ROM_START( ssf2jr2 )
@@ -7160,6 +7575,8 @@ ROM_START( ssf2jr2 )
ROM_LOAD( "ssf.q06", 0x280000, 0x080000, CRC(4e79c951) SHA1(1144781d7dc57ef8a6458d982f5c91548ff59e27) )
ROM_LOAD( "ssf.q07", 0x300000, 0x080000, CRC(cdd14313) SHA1(ebe767a9d4b51dba4282fa0a36a546a88620dd59) )
ROM_LOAD( "ssf.q08", 0x380000, 0x080000, CRC(6f5a088c) SHA1(6c0b4690479647a99d76335f174be8455b4ff118) )
+
+ SSF2_JAPAN_KEY
ROM_END
ROM_START( ssf2h )
@@ -7193,6 +7610,8 @@ ROM_START( ssf2h )
ROM_LOAD( "ssf.q06", 0x280000, 0x080000, CRC(4e79c951) SHA1(1144781d7dc57ef8a6458d982f5c91548ff59e27) )
ROM_LOAD( "ssf.q07", 0x300000, 0x080000, CRC(cdd14313) SHA1(ebe767a9d4b51dba4282fa0a36a546a88620dd59) )
ROM_LOAD( "ssf.q08", 0x380000, 0x080000, CRC(6f5a088c) SHA1(6c0b4690479647a99d76335f174be8455b4ff118) )
+
+ SSF2_HISPANIC_KEY
ROM_END
ROM_START( ssf2tb )
@@ -7226,6 +7645,8 @@ ROM_START( ssf2tb )
ROM_LOAD( "ssf.q06", 0x280000, 0x080000, CRC(4e79c951) SHA1(1144781d7dc57ef8a6458d982f5c91548ff59e27) )
ROM_LOAD( "ssf.q07", 0x300000, 0x080000, CRC(cdd14313) SHA1(ebe767a9d4b51dba4282fa0a36a546a88620dd59) )
ROM_LOAD( "ssf.q08", 0x380000, 0x080000, CRC(6f5a088c) SHA1(6c0b4690479647a99d76335f174be8455b4ff118) )
+
+ SSF2TB_WORLD_KEY
ROM_END
ROM_START( ssf2tbr1 )
@@ -7259,6 +7680,8 @@ ROM_START( ssf2tbr1 )
ROM_LOAD( "ssf.q06", 0x280000, 0x080000, CRC(4e79c951) SHA1(1144781d7dc57ef8a6458d982f5c91548ff59e27) )
ROM_LOAD( "ssf.q07", 0x300000, 0x080000, CRC(cdd14313) SHA1(ebe767a9d4b51dba4282fa0a36a546a88620dd59) )
ROM_LOAD( "ssf.q08", 0x380000, 0x080000, CRC(6f5a088c) SHA1(6c0b4690479647a99d76335f174be8455b4ff118) )
+
+ SSF2TB_WORLD_KEY
ROM_END
ROM_START( ssf2tbj )
@@ -7292,6 +7715,8 @@ ROM_START( ssf2tbj )
ROM_LOAD( "ssf.q06", 0x280000, 0x080000, CRC(4e79c951) SHA1(1144781d7dc57ef8a6458d982f5c91548ff59e27) )
ROM_LOAD( "ssf.q07", 0x300000, 0x080000, CRC(cdd14313) SHA1(ebe767a9d4b51dba4282fa0a36a546a88620dd59) )
ROM_LOAD( "ssf.q08", 0x380000, 0x080000, CRC(6f5a088c) SHA1(6c0b4690479647a99d76335f174be8455b4ff118) )
+
+ SSF2TB_JAPAN_KEY
ROM_END
ROM_START( ssf2tbh )
@@ -7325,6 +7750,8 @@ ROM_START( ssf2tbh )
ROM_LOAD( "ssf.q06", 0x280000, 0x080000, CRC(4e79c951) SHA1(1144781d7dc57ef8a6458d982f5c91548ff59e27) )
ROM_LOAD( "ssf.q07", 0x300000, 0x080000, CRC(cdd14313) SHA1(ebe767a9d4b51dba4282fa0a36a546a88620dd59) )
ROM_LOAD( "ssf.q08", 0x380000, 0x080000, CRC(6f5a088c) SHA1(6c0b4690479647a99d76335f174be8455b4ff118) )
+
+ SSF2TB_HISPANIC_KEY
ROM_END
ROM_START( ssf2t )
@@ -7359,6 +7786,8 @@ ROM_START( ssf2t )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "sfx.11m", 0x000000, 0x200000, CRC(9bdbd476) SHA1(a8520f77f30b97aae36408e0c4ca1ebbde1808a5) )
ROM_LOAD16_WORD_SWAP( "sfx.12m", 0x200000, 0x200000, CRC(a05e3aab) SHA1(d4eb9cae66c74e956569fea8b815156fbd420f83) )
+
+ SSF2T_WORLD_KEY
ROM_END
ROM_START( ssf2tu )
@@ -7393,6 +7822,8 @@ ROM_START( ssf2tu )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "sfx.11m", 0x000000, 0x200000, CRC(9bdbd476) SHA1(a8520f77f30b97aae36408e0c4ca1ebbde1808a5) )
ROM_LOAD16_WORD_SWAP( "sfx.12m", 0x200000, 0x200000, CRC(a05e3aab) SHA1(d4eb9cae66c74e956569fea8b815156fbd420f83) )
+
+ SSF2T_USA_KEY
ROM_END
ROM_START( ssf2tur1 )
@@ -7427,6 +7858,8 @@ ROM_START( ssf2tur1 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "sfx.11m", 0x000000, 0x200000, CRC(9bdbd476) SHA1(a8520f77f30b97aae36408e0c4ca1ebbde1808a5) )
ROM_LOAD16_WORD_SWAP( "sfx.12m", 0x200000, 0x200000, CRC(a05e3aab) SHA1(d4eb9cae66c74e956569fea8b815156fbd420f83) )
+
+ SSF2T_USA_KEY
ROM_END
ROM_START( ssf2ta )
@@ -7461,6 +7894,8 @@ ROM_START( ssf2ta )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "sfx.11m", 0x000000, 0x200000, CRC(9bdbd476) SHA1(a8520f77f30b97aae36408e0c4ca1ebbde1808a5) )
ROM_LOAD16_WORD_SWAP( "sfx.12m", 0x200000, 0x200000, CRC(a05e3aab) SHA1(d4eb9cae66c74e956569fea8b815156fbd420f83) )
+
+ SSF2T_ASIA_KEY
ROM_END
ROM_START( ssf2xj )
@@ -7495,6 +7930,8 @@ ROM_START( ssf2xj )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "sfx.11m", 0x000000, 0x200000, CRC(9bdbd476) SHA1(a8520f77f30b97aae36408e0c4ca1ebbde1808a5) )
ROM_LOAD16_WORD_SWAP( "sfx.12m", 0x200000, 0x200000, CRC(a05e3aab) SHA1(d4eb9cae66c74e956569fea8b815156fbd420f83) )
+
+ SSF2T_JAPAN_KEY
ROM_END
// interesting version, yellow case (rental?), shows OP instead of AM on startup, uses a different (unique) key to the usual Japan set
@@ -7556,6 +7993,8 @@ ROM_START( ssf2xjr )
ROM_LOAD16_WORD_SWAP( "ssf.56a", 0x280000, 0x080000, CRC(3919c0e5) SHA1(23b21b13775c62f0c8ee6b9db403196397981b27) )
ROM_LOAD16_WORD_SWAP( "ssf.57a", 0x300000, 0x080000, CRC(1ba9bfa6) SHA1(e010e66aea28b2688ccf6feaf678728bab89a852) )
ROM_LOAD16_WORD_SWAP( "ssf.58a", 0x380000, 0x080000, CRC(0c89a272) SHA1(55eb7322c8498e0897165a689feb0406caa09db6) )
+
+ SSF2T_JAPAN_RENTAL_KEY
ROM_END
ROM_START( vhunt2 )
@@ -7587,6 +8026,8 @@ ROM_START( vhunt2 )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "vh2.11m", 0x000000, 0x400000, CRC(38922efd) SHA1(8cfb36bdce3a524d0a81fec12ca0cba82222fa30) )
ROM_LOAD16_WORD_SWAP( "vh2.12m", 0x400000, 0x400000, CRC(6e2430af) SHA1(b475faf943bec4171ba0130f287e1948743ca273) )
+
+ VHUNT2_JAPAN_KEY
ROM_END
ROM_START( vhunt2r1 )
@@ -7618,6 +8059,8 @@ ROM_START( vhunt2r1 )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "vh2.11m", 0x000000, 0x400000, CRC(38922efd) SHA1(8cfb36bdce3a524d0a81fec12ca0cba82222fa30) )
ROM_LOAD16_WORD_SWAP( "vh2.12m", 0x400000, 0x400000, CRC(6e2430af) SHA1(b475faf943bec4171ba0130f287e1948743ca273) )
+
+ VHUNT2_JAPAN_KEY
ROM_END
ROM_START( vsav )
@@ -7649,6 +8092,8 @@ ROM_START( vsav )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "vm3.11m", 0x000000, 0x400000, CRC(e80e956e) SHA1(74181fca4b764fb3c56ceef2cb4c6fd6c18ec4b6) )
ROM_LOAD16_WORD_SWAP( "vm3.12m", 0x400000, 0x400000, CRC(9cd71557) SHA1(7059db25698a0b286314c5961c618f6d2e6f24a1) )
+
+ VSAV_WORLD_KEY
ROM_END
ROM_START( vsavu )
@@ -7680,6 +8125,8 @@ ROM_START( vsavu )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "vm3.11m", 0x000000, 0x400000, CRC(e80e956e) SHA1(74181fca4b764fb3c56ceef2cb4c6fd6c18ec4b6) )
ROM_LOAD16_WORD_SWAP( "vm3.12m", 0x400000, 0x400000, CRC(9cd71557) SHA1(7059db25698a0b286314c5961c618f6d2e6f24a1) )
+
+ VSAV_USA_KEY
ROM_END
ROM_START( vsavj )
@@ -7711,6 +8158,8 @@ ROM_START( vsavj )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "vm3.11m", 0x000000, 0x400000, CRC(e80e956e) SHA1(74181fca4b764fb3c56ceef2cb4c6fd6c18ec4b6) )
ROM_LOAD16_WORD_SWAP( "vm3.12m", 0x400000, 0x400000, CRC(9cd71557) SHA1(7059db25698a0b286314c5961c618f6d2e6f24a1) )
+
+ VSAV_JAPAN_KEY
ROM_END
ROM_START( vsava )
@@ -7742,6 +8191,8 @@ ROM_START( vsava )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "vm3.11m", 0x000000, 0x400000, CRC(e80e956e) SHA1(74181fca4b764fb3c56ceef2cb4c6fd6c18ec4b6) )
ROM_LOAD16_WORD_SWAP( "vm3.12m", 0x400000, 0x400000, CRC(9cd71557) SHA1(7059db25698a0b286314c5961c618f6d2e6f24a1) )
+
+ VSAV_ASIA_KEY
ROM_END
ROM_START( vsavh )
@@ -7773,6 +8224,8 @@ ROM_START( vsavh )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "vm3.11m", 0x000000, 0x400000, CRC(e80e956e) SHA1(74181fca4b764fb3c56ceef2cb4c6fd6c18ec4b6) )
ROM_LOAD16_WORD_SWAP( "vm3.12m", 0x400000, 0x400000, CRC(9cd71557) SHA1(7059db25698a0b286314c5961c618f6d2e6f24a1) )
+
+ VSAV_HISPANIC_KEY
ROM_END
ROM_START( vsav2 )
@@ -7804,6 +8257,8 @@ ROM_START( vsav2 )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "vs2.11m", 0x000000, 0x400000, CRC(d67e47b7) SHA1(15a3f6779eccb10551ed94edf7e6e406a79b3de7) )
ROM_LOAD16_WORD_SWAP( "vs2.12m", 0x400000, 0x400000, CRC(6d020a14) SHA1(e98f862fac1e357c90949768bb2646263d9981a0) )
+
+ VSAV2_JAPAN_KEY
ROM_END
ROM_START( xmcota )
@@ -7835,6 +8290,8 @@ ROM_START( xmcota )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "xmn.11m", 0x000000, 0x200000, CRC(c848a6bc) SHA1(ac8ac564d3c43225822f8bc330eba9f35b24b0a4) )
ROM_LOAD16_WORD_SWAP( "xmn.12m", 0x200000, 0x200000, CRC(729c188f) SHA1(3279774ad8aebbcf0fc779cdfcbe21044dd192ad) )
+
+ XMCOTA_WORLD_KEY
ROM_END
ROM_START( xmcotar1 )
@@ -7866,6 +8323,8 @@ ROM_START( xmcotar1 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "xmn.11m", 0x000000, 0x200000, CRC(c848a6bc) SHA1(ac8ac564d3c43225822f8bc330eba9f35b24b0a4) )
ROM_LOAD16_WORD_SWAP( "xmn.12m", 0x200000, 0x200000, CRC(729c188f) SHA1(3279774ad8aebbcf0fc779cdfcbe21044dd192ad) )
+
+ XMCOTA_WORLD_KEY
ROM_END
ROM_START( xmcotau )
@@ -7897,6 +8356,8 @@ ROM_START( xmcotau )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "xmn.11m", 0x000000, 0x200000, CRC(c848a6bc) SHA1(ac8ac564d3c43225822f8bc330eba9f35b24b0a4) )
ROM_LOAD16_WORD_SWAP( "xmn.12m", 0x200000, 0x200000, CRC(729c188f) SHA1(3279774ad8aebbcf0fc779cdfcbe21044dd192ad) )
+
+ XMCOTA_USA_KEY
ROM_END
ROM_START( xmcotah )
@@ -7928,6 +8389,8 @@ ROM_START( xmcotah )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "xmn.11m", 0x000000, 0x200000, CRC(c848a6bc) SHA1(ac8ac564d3c43225822f8bc330eba9f35b24b0a4) )
ROM_LOAD16_WORD_SWAP( "xmn.12m", 0x200000, 0x200000, CRC(729c188f) SHA1(3279774ad8aebbcf0fc779cdfcbe21044dd192ad) )
+
+ XMCOTA_HISPANIC_KEY
ROM_END
ROM_START( xmcotahr1 )
@@ -7959,6 +8422,8 @@ ROM_START( xmcotahr1 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "xmn.11m", 0x000000, 0x200000, CRC(c848a6bc) SHA1(ac8ac564d3c43225822f8bc330eba9f35b24b0a4) )
ROM_LOAD16_WORD_SWAP( "xmn.12m", 0x200000, 0x200000, CRC(729c188f) SHA1(3279774ad8aebbcf0fc779cdfcbe21044dd192ad) )
+
+ XMCOTA_HISPANIC_KEY
ROM_END
ROM_START( xmcotaj )
@@ -7990,6 +8455,8 @@ ROM_START( xmcotaj )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "xmn.11m", 0x000000, 0x200000, CRC(c848a6bc) SHA1(ac8ac564d3c43225822f8bc330eba9f35b24b0a4) )
ROM_LOAD16_WORD_SWAP( "xmn.12m", 0x200000, 0x200000, CRC(729c188f) SHA1(3279774ad8aebbcf0fc779cdfcbe21044dd192ad) )
+
+ XMCOTA_JAPAN_KEY
ROM_END
ROM_START( xmcotaj1 )
@@ -8021,6 +8488,8 @@ ROM_START( xmcotaj1 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "xmn.11m", 0x000000, 0x200000, CRC(c848a6bc) SHA1(ac8ac564d3c43225822f8bc330eba9f35b24b0a4) )
ROM_LOAD16_WORD_SWAP( "xmn.12m", 0x200000, 0x200000, CRC(729c188f) SHA1(3279774ad8aebbcf0fc779cdfcbe21044dd192ad) )
+
+ XMCOTA_JAPAN_KEY
ROM_END
ROM_START( xmcotaj2 )
@@ -8052,6 +8521,8 @@ ROM_START( xmcotaj2 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "xmn.11m", 0x000000, 0x200000, CRC(c848a6bc) SHA1(ac8ac564d3c43225822f8bc330eba9f35b24b0a4) )
ROM_LOAD16_WORD_SWAP( "xmn.12m", 0x200000, 0x200000, CRC(729c188f) SHA1(3279774ad8aebbcf0fc779cdfcbe21044dd192ad) )
+
+ XMCOTA_JAPAN_KEY
ROM_END
ROM_START( xmcotaj3 )
@@ -8083,6 +8554,8 @@ ROM_START( xmcotaj3 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "xmn.11m", 0x000000, 0x200000, CRC(c848a6bc) SHA1(ac8ac564d3c43225822f8bc330eba9f35b24b0a4) )
ROM_LOAD16_WORD_SWAP( "xmn.12m", 0x200000, 0x200000, CRC(729c188f) SHA1(3279774ad8aebbcf0fc779cdfcbe21044dd192ad) )
+
+ XMCOTA_JAPAN_KEY
ROM_END
ROM_START( xmcotajr )
@@ -8114,6 +8587,8 @@ ROM_START( xmcotajr )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "xmn.11m", 0x000000, 0x200000, CRC(c848a6bc) SHA1(ac8ac564d3c43225822f8bc330eba9f35b24b0a4) )
ROM_LOAD16_WORD_SWAP( "xmn.12m", 0x200000, 0x200000, CRC(729c188f) SHA1(3279774ad8aebbcf0fc779cdfcbe21044dd192ad) )
+
+ XMCOTA_JAPAN_KEY
ROM_END
ROM_START( xmcotaa )
@@ -8145,6 +8620,8 @@ ROM_START( xmcotaa )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "xmn.11m", 0x000000, 0x200000, CRC(c848a6bc) SHA1(ac8ac564d3c43225822f8bc330eba9f35b24b0a4) )
ROM_LOAD16_WORD_SWAP( "xmn.12m", 0x200000, 0x200000, CRC(729c188f) SHA1(3279774ad8aebbcf0fc779cdfcbe21044dd192ad) )
+
+ XMCOTA_ASIA_KEY
ROM_END
ROM_START( xmcotaar1 )
@@ -8176,6 +8653,8 @@ ROM_START( xmcotaar1 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "xmn.11m", 0x000000, 0x200000, CRC(c848a6bc) SHA1(ac8ac564d3c43225822f8bc330eba9f35b24b0a4) )
ROM_LOAD16_WORD_SWAP( "xmn.12m", 0x200000, 0x200000, CRC(729c188f) SHA1(3279774ad8aebbcf0fc779cdfcbe21044dd192ad) )
+
+ XMCOTA_ASIA_KEY
ROM_END
ROM_START( xmvsf )
@@ -8206,6 +8685,8 @@ ROM_START( xmvsf )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "xvs.11m", 0x000000, 0x200000, CRC(9cadcdbc) SHA1(64d3bd53b04daec84c9af4aa3ff010867b3d306d) )
ROM_LOAD16_WORD_SWAP( "xvs.12m", 0x200000, 0x200000, CRC(7b11e460) SHA1(a581c84acaaf0ce056841c15a6f36889e88be68d) )
+
+ XMVSSF_WORLD_KEY
ROM_END
ROM_START( xmvsfr1 )
@@ -8236,6 +8717,8 @@ ROM_START( xmvsfr1 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "xvs.11m", 0x000000, 0x200000, CRC(9cadcdbc) SHA1(64d3bd53b04daec84c9af4aa3ff010867b3d306d) )
ROM_LOAD16_WORD_SWAP( "xvs.12m", 0x200000, 0x200000, CRC(7b11e460) SHA1(a581c84acaaf0ce056841c15a6f36889e88be68d) )
+
+ XMVSSF_WORLD_KEY
ROM_END
ROM_START( xmvsfu )
@@ -8266,12 +8749,47 @@ ROM_START( xmvsfu )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "xvs.11m", 0x000000, 0x200000, CRC(9cadcdbc) SHA1(64d3bd53b04daec84c9af4aa3ff010867b3d306d) )
ROM_LOAD16_WORD_SWAP( "xvs.12m", 0x200000, 0x200000, CRC(7b11e460) SHA1(a581c84acaaf0ce056841c15a6f36889e88be68d) )
+
+ XMVSSF_USA_KEY
ROM_END
ROM_START( xmvsfur1 )
ROM_REGION( CODE_SIZE, "maincpu", 0 ) /* 68000 code */
- ROM_LOAD16_WORD_SWAP( "xvsu.03h", 0x000000, 0x80000, CRC(5481155a) SHA1(799a2488684cbead33206498d13261b79624a46e) )
- ROM_LOAD16_WORD_SWAP( "xvsu.04h", 0x080000, 0x80000, CRC(1e236388) SHA1(329c08103840fadbc4176785c4b24013a7a2b1bc) )
+ ROM_LOAD16_WORD_SWAP( "xvsu.03h", 0x000000, 0x80000, CRC(5481155a) SHA1(799a2488684cbead33206498d13261b79624a46e) ) /* also found as rev I */
+ ROM_LOAD16_WORD_SWAP( "xvsu.04h", 0x080000, 0x80000, CRC(1e236388) SHA1(329c08103840fadbc4176785c4b24013a7a2b1bc) ) /* also found as rev I */
+ ROM_LOAD16_WORD_SWAP( "xvs.05a", 0x100000, 0x80000, CRC(7db6025d) SHA1(2d74f48f83f45359bfaca28ab686625766af12ee) )
+ ROM_LOAD16_WORD_SWAP( "xvs.06a", 0x180000, 0x80000, CRC(e8e2c75c) SHA1(929408cb5d98e95cec75ea58e4701b0cbdbcd016) )
+ ROM_LOAD16_WORD_SWAP( "xvs.07", 0x200000, 0x80000, CRC(08f0abed) SHA1(ef16c376232dba63b0b9bc3aa0640f9001ccb68a) )
+ ROM_LOAD16_WORD_SWAP( "xvs.08", 0x280000, 0x80000, CRC(81929675) SHA1(19cf7afbc1daaefec40195e40ba74970f3906a1c) )
+ ROM_LOAD16_WORD_SWAP( "xvs.09", 0x300000, 0x80000, CRC(9641f36b) SHA1(dcba3482d1ba37ccfb30d402793ee063c6621aed) )
+
+ ROM_REGION( 0x2000000, "gfx", 0 )
+ ROMX_LOAD( "xvs.13m", 0x0000000, 0x400000, CRC(f6684efd) SHA1(c0a2f3a9e82ab8b084a500aec71ac633e947328c) , ROM_GROUPWORD | ROM_SKIP(6) )
+ ROMX_LOAD( "xvs.15m", 0x0000002, 0x400000, CRC(29109221) SHA1(898b8f678fd03c462ce0d8eb7fb3441ef601085b) , ROM_GROUPWORD | ROM_SKIP(6) )
+ ROMX_LOAD( "xvs.17m", 0x0000004, 0x400000, CRC(92db3474) SHA1(7b6f4c8ebfdac167b25f35029068b6253c141fe6) , ROM_GROUPWORD | ROM_SKIP(6) )
+ ROMX_LOAD( "xvs.19m", 0x0000006, 0x400000, CRC(3733473c) SHA1(6579da7145c95b3ad00844a5fc8c2e22c23365e2) , ROM_GROUPWORD | ROM_SKIP(6) )
+ ROMX_LOAD( "xvs.14m", 0x1000000, 0x400000, CRC(bcac2e41) SHA1(838ff24f7e8543a787a55a5d592c9517ce3b8b93) , ROM_GROUPWORD | ROM_SKIP(6) )
+ ROMX_LOAD( "xvs.16m", 0x1000002, 0x400000, CRC(ea04a272) SHA1(cd7c79037b5b4a39bef5156433e984dc4dc2c081) , ROM_GROUPWORD | ROM_SKIP(6) )
+ ROMX_LOAD( "xvs.18m", 0x1000004, 0x400000, CRC(b0def86a) SHA1(da3a6705ea7050fc5c2c10d33400ed67be9f455d) , ROM_GROUPWORD | ROM_SKIP(6) )
+ ROMX_LOAD( "xvs.20m", 0x1000006, 0x400000, CRC(4b40ff9f) SHA1(9a981d442132efff09a27408d74646ba357c7357) , ROM_GROUPWORD | ROM_SKIP(6) )
+
+ ROM_REGION( QSOUND_SIZE, "audiocpu", 0 ) /* 64k for the audio CPU (+banks) */
+ ROM_LOAD( "xvs.01", 0x00000, 0x08000, CRC(3999e93a) SHA1(fefcff8a9a5c83df7655a16187cf9ba3e7efbb25) )
+ ROM_CONTINUE( 0x10000, 0x18000 )
+ ROM_LOAD( "xvs.02", 0x28000, 0x20000, CRC(101bdee9) SHA1(75920e88bf46fcd33a7957777a1d799818ffb0d6) )
+
+ ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
+ ROM_LOAD16_WORD_SWAP( "xvs.11m", 0x000000, 0x200000, CRC(9cadcdbc) SHA1(64d3bd53b04daec84c9af4aa3ff010867b3d306d) )
+ ROM_LOAD16_WORD_SWAP( "xvs.12m", 0x200000, 0x200000, CRC(7b11e460) SHA1(a581c84acaaf0ce056841c15a6f36889e88be68d) )
+
+ XMVSSF_USA_KEY
+ROM_END
+
+
+ROM_START( xmvsfur2 )
+ ROM_REGION( CODE_SIZE, "maincpu", 0 ) /* 68000 code */
+ ROM_LOAD16_WORD_SWAP( "xvsu.03d", 0x000000, 0x80000, CRC(bd8b152f) SHA1(6b029b7314ce2516c67e5a71508f86aa01d30ab8) )
+ ROM_LOAD16_WORD_SWAP( "xvsu.04d", 0x080000, 0x80000, CRC(7c7d1da3) SHA1(96dd1f83c8f8053177b91ad31c4c051b28dd0208) )
ROM_LOAD16_WORD_SWAP( "xvs.05a", 0x100000, 0x80000, CRC(7db6025d) SHA1(2d74f48f83f45359bfaca28ab686625766af12ee) )
ROM_LOAD16_WORD_SWAP( "xvs.06a", 0x180000, 0x80000, CRC(e8e2c75c) SHA1(929408cb5d98e95cec75ea58e4701b0cbdbcd016) )
ROM_LOAD16_WORD_SWAP( "xvs.07", 0x200000, 0x80000, CRC(08f0abed) SHA1(ef16c376232dba63b0b9bc3aa0640f9001ccb68a) )
@@ -8296,6 +8814,8 @@ ROM_START( xmvsfur1 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "xvs.11m", 0x000000, 0x200000, CRC(9cadcdbc) SHA1(64d3bd53b04daec84c9af4aa3ff010867b3d306d) )
ROM_LOAD16_WORD_SWAP( "xvs.12m", 0x200000, 0x200000, CRC(7b11e460) SHA1(a581c84acaaf0ce056841c15a6f36889e88be68d) )
+
+ XMVSSF_USA_KEY
ROM_END
ROM_START( xmvsfj )
@@ -8326,6 +8846,8 @@ ROM_START( xmvsfj )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "xvs.11m", 0x000000, 0x200000, CRC(9cadcdbc) SHA1(64d3bd53b04daec84c9af4aa3ff010867b3d306d) )
ROM_LOAD16_WORD_SWAP( "xvs.12m", 0x200000, 0x200000, CRC(7b11e460) SHA1(a581c84acaaf0ce056841c15a6f36889e88be68d) )
+
+ XMVSSF_JAPAN_KEY
ROM_END
ROM_START( xmvsfjr1 )
@@ -8356,6 +8878,8 @@ ROM_START( xmvsfjr1 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "xvs.11m", 0x000000, 0x200000, CRC(9cadcdbc) SHA1(64d3bd53b04daec84c9af4aa3ff010867b3d306d) )
ROM_LOAD16_WORD_SWAP( "xvs.12m", 0x200000, 0x200000, CRC(7b11e460) SHA1(a581c84acaaf0ce056841c15a6f36889e88be68d) )
+
+ XMVSSF_JAPAN_KEY
ROM_END
ROM_START( xmvsfjr2 )
@@ -8386,6 +8910,8 @@ ROM_START( xmvsfjr2 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "xvs.11m", 0x000000, 0x200000, CRC(9cadcdbc) SHA1(64d3bd53b04daec84c9af4aa3ff010867b3d306d) )
ROM_LOAD16_WORD_SWAP( "xvs.12m", 0x200000, 0x200000, CRC(7b11e460) SHA1(a581c84acaaf0ce056841c15a6f36889e88be68d) )
+
+ XMVSSF_JAPAN_KEY
ROM_END
ROM_START( xmvsfa )
@@ -8416,6 +8942,8 @@ ROM_START( xmvsfa )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "xvs.11m", 0x000000, 0x200000, CRC(9cadcdbc) SHA1(64d3bd53b04daec84c9af4aa3ff010867b3d306d) )
ROM_LOAD16_WORD_SWAP( "xvs.12m", 0x200000, 0x200000, CRC(7b11e460) SHA1(a581c84acaaf0ce056841c15a6f36889e88be68d) )
+
+ XMVSSF_ASIA_KEY
ROM_END
ROM_START( xmvsfar1 )
@@ -8446,6 +8974,8 @@ ROM_START( xmvsfar1 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "xvs.11m", 0x000000, 0x200000, CRC(9cadcdbc) SHA1(64d3bd53b04daec84c9af4aa3ff010867b3d306d) )
ROM_LOAD16_WORD_SWAP( "xvs.12m", 0x200000, 0x200000, CRC(7b11e460) SHA1(a581c84acaaf0ce056841c15a6f36889e88be68d) )
+
+ XMVSSF_ASIA_KEY
ROM_END
ROM_START( xmvsfar2 )
@@ -8476,6 +9006,8 @@ ROM_START( xmvsfar2 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "xvs.11m", 0x000000, 0x200000, CRC(9cadcdbc) SHA1(64d3bd53b04daec84c9af4aa3ff010867b3d306d) )
ROM_LOAD16_WORD_SWAP( "xvs.12m", 0x200000, 0x200000, CRC(7b11e460) SHA1(a581c84acaaf0ce056841c15a6f36889e88be68d) )
+
+ XMVSSF_ASIA_KEY
ROM_END
ROM_START( xmvsfar3 )
@@ -8506,6 +9038,8 @@ ROM_START( xmvsfar3 )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "xvs.11m", 0x000000, 0x200000, CRC(9cadcdbc) SHA1(64d3bd53b04daec84c9af4aa3ff010867b3d306d) )
ROM_LOAD16_WORD_SWAP( "xvs.12m", 0x200000, 0x200000, CRC(7b11e460) SHA1(a581c84acaaf0ce056841c15a6f36889e88be68d) )
+
+ XMVSSF_ASIA_KEY
ROM_END
ROM_START( xmvsfh )
@@ -8536,6 +9070,8 @@ ROM_START( xmvsfh )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "xvs.11m", 0x000000, 0x200000, CRC(9cadcdbc) SHA1(64d3bd53b04daec84c9af4aa3ff010867b3d306d) )
ROM_LOAD16_WORD_SWAP( "xvs.12m", 0x200000, 0x200000, CRC(7b11e460) SHA1(a581c84acaaf0ce056841c15a6f36889e88be68d) )
+
+ XMVSSF_HISPANIC_KEY
ROM_END
ROM_START( xmvsfb )
@@ -8566,6 +9102,8 @@ ROM_START( xmvsfb )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "xvs.11m", 0x000000, 0x200000, CRC(9cadcdbc) SHA1(64d3bd53b04daec84c9af4aa3ff010867b3d306d) )
ROM_LOAD16_WORD_SWAP( "xvs.12m", 0x200000, 0x200000, CRC(7b11e460) SHA1(a581c84acaaf0ce056841c15a6f36889e88be68d) )
+
+ XMVSSF_BRAZIL_KEY
ROM_END
@@ -8585,11 +9123,17 @@ void cps_state::init_digital_volume()
m_digital_volume_timer->adjust(attotime::from_msec(100), 0, attotime::from_msec(100));
}
+
+
DRIVER_INIT_MEMBER(cps_state,cps2)
{
/* Decrypt the game - see machine/cps2crpt.c */
DRIVER_INIT_CALL(cps2crpt);
+ DRIVER_INIT_CALL(cps2nc);
+}
+DRIVER_INIT_MEMBER(cps_state, cps2nc)
+{
/* Initialize some video elements */
DRIVER_INIT_CALL(cps2_video);
@@ -8600,6 +9144,7 @@ DRIVER_INIT_MEMBER(cps_state,cps2)
m_maincpu->set_clock_scale(0.7375f); /* RAM access waitstates etc. aren't emulated - slow the CPU to compensate */
}
+
DRIVER_INIT_MEMBER(cps_state,ssf2tb)
{
DRIVER_INIT_CALL(cps2);
@@ -8635,12 +9180,12 @@ DRIVER_INIT_MEMBER(cps_state,singbrd)
READ16_MEMBER( cps_state::gigaman2_dummyqsound_r )
{
return m_gigaman2_dummyqsound_ram[offset];
-};
+}
WRITE16_MEMBER( cps_state::gigaman2_dummyqsound_w )
{
m_gigaman2_dummyqsound_ram[offset] = data;
-};
+}
/* rearrange the graphics data into the normal order */
void cps_state::gigaman2_gfx_reorder()
@@ -8660,19 +9205,17 @@ void cps_state::gigaman2_gfx_reorder()
DRIVER_INIT_MEMBER(cps_state,gigaman2)
{
address_space &space = m_maincpu->space(AS_PROGRAM);
- UINT16 *rom = (UINT16 *)memregion("maincpu")->base();
- int length = memregion("maincpu")->bytes();
gigaman2_gfx_reorder();
- DRIVER_INIT_CALL(cps2);
+ DRIVER_INIT_CALL(cps2nc);
m_gigaman2_dummyqsound_ram = auto_alloc_array(machine(), UINT16, 0x20000 / 2);
save_pointer(NAME(m_gigaman2_dummyqsound_ram), 0x20000 / 2);
space.install_readwrite_handler(0x618000, 0x619fff, read16_delegate(FUNC(cps_state::gigaman2_dummyqsound_r),this), write16_delegate(FUNC(cps_state::gigaman2_dummyqsound_w), this)); // no qsound..
- space.set_decrypted_region(0x000000, (length) - 1, &rom[length/4]);
- m_maincpu->set_encrypted_opcode_range(0, length);
+
+ memcpy(m_decrypted_opcodes, memregion("maincpu")->base()+0x200000, 0x200000);
/* no digital volume switches on this? */
m_digital_volume_timer->adjust(attotime::never, 0, attotime::never);
@@ -8843,6 +9386,7 @@ GAME( 1996, xmvsf, 0, cps2, cps2_2p6b, cps_state, cps2, ROT0,
GAME( 1996, xmvsfr1, xmvsf, cps2, cps2_2p6b, cps_state, cps2, ROT0, "Capcom", "X-Men Vs. Street Fighter (Euro 960910)", GAME_SUPPORTS_SAVE )
GAME( 1996, xmvsfu, xmvsf, cps2, cps2_2p6b, cps_state, cps2, ROT0, "Capcom", "X-Men Vs. Street Fighter (USA 961023)", GAME_SUPPORTS_SAVE )
GAME( 1996, xmvsfur1, xmvsf, cps2, cps2_2p6b, cps_state, cps2, ROT0, "Capcom", "X-Men Vs. Street Fighter (USA 961004)", GAME_SUPPORTS_SAVE )
+GAME( 1996, xmvsfur2, xmvsf, cps2, cps2_2p6b, cps_state, cps2, ROT0, "Capcom", "X-Men Vs. Street Fighter (USA 960910)", GAME_SUPPORTS_SAVE )
GAME( 1996, xmvsfj, xmvsf, cps2, cps2_2p6b, cps_state, cps2, ROT0, "Capcom", "X-Men Vs. Street Fighter (Japan 961004)", GAME_SUPPORTS_SAVE )
GAME( 1996, xmvsfjr1, xmvsf, cps2, cps2_2p6b, cps_state, cps2, ROT0, "Capcom", "X-Men Vs. Street Fighter (Japan 960910)", GAME_SUPPORTS_SAVE )
GAME( 1996, xmvsfjr2, xmvsf, cps2, cps2_2p6b, cps_state, cps2, ROT0, "Capcom", "X-Men Vs. Street Fighter (Japan 960909)", GAME_SUPPORTS_SAVE )
@@ -9004,6 +9548,8 @@ ROM_START( 1944d )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "nff.11m", 0x000000, 0x400000, CRC(243e4e05) SHA1(83281f7290ac105a3f9a7507cbc11317d45ba706) )
ROM_LOAD16_WORD_SWAP( "nff.12m", 0x400000, 0x400000, CRC(4fcf1600) SHA1(36f18c5d92b79433bdf7088b29a244708929d48e) )
+
+ CPS2_DEAD_KEY
ROM_END
ROM_START( 19xxd )
@@ -9034,6 +9580,8 @@ ROM_START( 19xxd )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "19x.11m", 0x000000, 0x200000, CRC(d38beef3) SHA1(134e961b926a97cca5e45d3558efb98f6f278e08) )
ROM_LOAD16_WORD_SWAP( "19x.12m", 0x200000, 0x200000, CRC(d47c96e2) SHA1(3c1b5563f8e7ee1c450b3592fcb319e928caec3c) )
+
+ CPS2_DEAD_KEY
ROM_END
ROM_START( sfz2ad )
@@ -9063,6 +9611,8 @@ ROM_START( sfz2ad )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "sz2.11m", 0x000000, 0x200000, CRC(aa47a601) SHA1(a4d1ee89c84a3b9db06469bb66e85293b5aa9ac9) )
ROM_LOAD16_WORD_SWAP( "sz2.12m", 0x200000, 0x200000, CRC(2237bc53) SHA1(96d5693047e4cf1ed10a8ee1905cea267a278e92) )
+
+ CPS2_DEAD_KEY
ROM_END
ROM_START( avspd )
@@ -9092,6 +9642,8 @@ ROM_START( avspd )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "avp.11m", 0x000000, 0x200000, CRC(83499817) SHA1(e65b0ebd61ddc748842a9d4d92404b5305307623) )
ROM_LOAD16_WORD_SWAP( "avp.12m", 0x200000, 0x200000, CRC(f4110d49) SHA1(f27538776cc1ba8213f19f98728ed8c02508d3ac) )
+
+ CPS2_DEAD_KEY
ROM_END
ROM_START( batcird )
@@ -9121,6 +9673,8 @@ ROM_START( batcird )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "btc.11m", 0x000000, 0x200000, CRC(c27f2229) SHA1(df2459493af40937b6656a16fad43ff51bed2204) )
ROM_LOAD16_WORD_SWAP( "btc.12m", 0x200000, 0x200000, CRC(418a2e33) SHA1(0642ddff2ab9255f154419da24ba644ed63f34ab) )
+
+ CPS2_DEAD_KEY
ROM_END
ROM_START( ddtodd )
@@ -9151,6 +9705,8 @@ ROM_START( ddtodd )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "dad.11m", 0x000000, 0x200000, CRC(0c499b67) SHA1(a8ebd8a1cd6dece8344b7cb0439d85843fb97616) )
ROM_LOAD16_WORD_SWAP( "dad.12m", 0x200000, 0x200000, CRC(2f0b5a4e) SHA1(8d1ebbb811aa469b0f0d29d719d2b9af28fb63a2) )
+
+ CPS2_DEAD_KEY
ROM_END
ROM_START( ddsomud )
@@ -9185,6 +9741,8 @@ ROM_START( ddsomud )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "dd2.11m", 0x000000, 0x200000, CRC(98d0c325) SHA1(7406e8d943d77c468eb418c4113261f4ab973bbf) )
ROM_LOAD16_WORD_SWAP( "dd2.12m", 0x200000, 0x200000, CRC(5ea2e7fa) SHA1(0e6a9fd007f637adcb2226c902394f07de45e803) )
+
+ CPS2_DEAD_KEY
ROM_END
ROM_START( ecofghtrd )
@@ -9211,6 +9769,8 @@ ROM_START( ecofghtrd )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "uec.11m", 0x000000, 0x200000, CRC(81b25d39) SHA1(448adfcc7d98873a48c710d857225cdd1580e5c9) )
ROM_LOAD16_WORD_SWAP( "uec.12m", 0x200000, 0x200000, CRC(27729e52) SHA1(a55c8159adf766dda70cb047f5ac85ce6bc0a3f3) )
+
+ CPS2_DEAD_KEY
ROM_END
ROM_START( gigawingjd )
@@ -9235,6 +9795,8 @@ ROM_START( gigawingjd )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "ggw.11m", 0x000000, 0x400000, CRC(e172acf5) SHA1(d7b0963d66165f3607d887741c5e7ab952bcf2ff) )
ROM_LOAD16_WORD_SWAP( "ggw.12m", 0x400000, 0x400000, CRC(4bee4e8f) SHA1(c440b5a38359ec3b8002f39690b79bf78703f5d0) )
+
+ CPS2_DEAD_KEY
ROM_END
ROM_START( gigawingd )
@@ -9259,6 +9821,8 @@ ROM_START( gigawingd )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "ggw.11m", 0x000000, 0x400000, CRC(e172acf5) SHA1(d7b0963d66165f3607d887741c5e7ab952bcf2ff) )
ROM_LOAD16_WORD_SWAP( "ggw.12m", 0x400000, 0x400000, CRC(4bee4e8f) SHA1(c440b5a38359ec3b8002f39690b79bf78703f5d0) )
+
+ CPS2_DEAD_KEY
ROM_END
ROM_START( hsf2d )
@@ -9288,6 +9852,8 @@ ROM_START( hsf2d )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "hs2.11m", 0x000000, 0x800000, CRC(0e15c359) SHA1(176108b0d76d821a849324680aba0cd04b5016c1) )
+
+ CPS2_DEAD_KEY
ROM_END
ROM_START( megamn2d )
@@ -9314,6 +9880,8 @@ ROM_START( megamn2d )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "rm2.11m", 0x000000, 0x200000, CRC(2106174d) SHA1(0a35d9ca8ebcad74904b20648d5320f839d6377e) )
ROM_LOAD16_WORD_SWAP( "rm2.12m", 0x200000, 0x200000, CRC(546c1636) SHA1(f96b172ab899f2c6ee17a5dd1fb61af9432e3cd2) )
+
+ CPS2_DEAD_KEY
ROM_END
ROM_START( mvscud )
@@ -9348,6 +9916,8 @@ ROM_START( mvscud )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "mvc.11m", 0x000000, 0x400000, CRC(850fe663) SHA1(81e519d05a08855f242ea2e17ee0859b449db895) )
ROM_LOAD16_WORD_SWAP( "mvc.12m", 0x400000, 0x400000, CRC(7ccb1896) SHA1(74caadf3282fcc6acffb1bbe3734106f81124121) )
+
+ CPS2_DEAD_KEY
ROM_END
ROM_START( nwarrud )
@@ -9382,6 +9952,8 @@ ROM_START( nwarrud )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "vph.11m", 0x000000, 0x200000, CRC(e1837d33) SHA1(e3cb69f64767bacbec7286d0b4cd0ce7a0ba13d8) )
ROM_LOAD16_WORD_SWAP( "vph.12m", 0x200000, 0x200000, CRC(fbd3cd90) SHA1(4813c25802ad71b77ca04fd8f3a86344f99f0d6a) )
+
+ CPS2_DEAD_KEY
ROM_END
ROM_START( ringdstd )
@@ -9418,6 +9990,8 @@ ROM_START( ringdstd )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "smb.11m", 0x000000, 0x200000, CRC(c56935f9) SHA1(ca1705e48e31ddc13505e6297bceca2bec1bb209) )
ROM_LOAD16_WORD_SWAP( "smb.12m", 0x200000, 0x200000, CRC(955b0782) SHA1(ee09500e7b44e923126533613bfe26cdabc7ab5f) )
+
+ CPS2_DEAD_KEY
ROM_END
ROM_START( sfad )
@@ -9445,6 +10019,8 @@ ROM_START( sfad )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "sfz.11m", 0x000000, 0x200000, CRC(c4b093cd) SHA1(256526bb693a0b72443f047e060304c9b739acd1) )
ROM_LOAD16_WORD_SWAP( "sfz.12m", 0x200000, 0x200000, CRC(8bdbc4b4) SHA1(0e21c9a75a17a7e7dfd8bb51098c2b9dc4c933ec) )
+
+ CPS2_DEAD_KEY
ROM_END
ROM_START( mshud )
@@ -9476,6 +10052,8 @@ ROM_START( mshud )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "msh.11m", 0x000000, 0x200000, CRC(37ac6d30) SHA1(ec67421fbf4a08a686e76792cb35e9cbf04d022d) )
ROM_LOAD16_WORD_SWAP( "msh.12m", 0x200000, 0x200000, CRC(de092570) SHA1(a03d0df901f6ea79685eaed67db65bee14ec29c6) )
+
+ CPS2_DEAD_KEY
ROM_END
ROM_START( sfz2ald )
@@ -9508,6 +10086,8 @@ ROM_START( sfz2ald )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "sz2.11m", 0x000000, 0x200000, CRC(aa47a601) SHA1(a4d1ee89c84a3b9db06469bb66e85293b5aa9ac9) )
ROM_LOAD16_WORD_SWAP( "sz2.12m", 0x200000, 0x200000, CRC(2237bc53) SHA1(96d5693047e4cf1ed10a8ee1905cea267a278e92) )
+
+ CPS2_DEAD_KEY
ROM_END
ROM_START( sfa3ud )
@@ -9542,6 +10122,8 @@ ROM_START( sfa3ud )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "sz3.11m", 0x000000, 0x400000, CRC(1c89eed1) SHA1(649a0b0a3eb72e2e69e9fb1ac51a58b70daa39f3) )
ROM_LOAD16_WORD_SWAP( "sz3.12m", 0x400000, 0x400000, CRC(f392b13a) SHA1(fa04ce0370144a49bd1d5acd873eef87b0dc9d15) )
+
+ CPS2_DEAD_KEY
ROM_END
ROM_START( spf2xjd )
@@ -9567,6 +10149,8 @@ ROM_START( spf2xjd )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "pzf.11m", 0x000000, 0x200000, CRC(78442743) SHA1(b61190bb586871de6d54af580e3e1d9cc0de0acb) )
ROM_LOAD16_WORD_SWAP( "pzf.12m", 0x200000, 0x200000, CRC(399d2c7b) SHA1(e849dea97b8d16540415c0d9bbc4f9f4eb755ec4) )
+
+ CPS2_DEAD_KEY
ROM_END
ROM_START( vsavd )
@@ -9601,6 +10185,8 @@ ROM_START( vsavd )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "vm3.11m", 0x000000, 0x400000, CRC(e80e956e) SHA1(74181fca4b764fb3c56ceef2cb4c6fd6c18ec4b6) )
ROM_LOAD16_WORD_SWAP( "vm3.12m", 0x400000, 0x400000, CRC(9cd71557) SHA1(7059db25698a0b286314c5961c618f6d2e6f24a1) )
+
+ CPS2_DEAD_KEY
ROM_END
ROM_START( xmcotar1d )
@@ -9635,6 +10221,8 @@ ROM_START( xmcotar1d )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "xmn.11m", 0x000000, 0x200000, CRC(c848a6bc) SHA1(ac8ac564d3c43225822f8bc330eba9f35b24b0a4) )
ROM_LOAD16_WORD_SWAP( "xmn.12m", 0x200000, 0x200000, CRC(729c188f) SHA1(3279774ad8aebbcf0fc779cdfcbe21044dd192ad) )
+
+ CPS2_DEAD_KEY
ROM_END
ROM_START( xmvsfu1d )
@@ -9670,6 +10258,8 @@ ROM_START( xmvsfu1d )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "xvs.11m", 0x000000, 0x200000, CRC(9cadcdbc) SHA1(64d3bd53b04daec84c9af4aa3ff010867b3d306d) )
ROM_LOAD16_WORD_SWAP( "xvs.12m", 0x200000, 0x200000, CRC(7b11e460) SHA1(a581c84acaaf0ce056841c15a6f36889e88be68d) )
+
+ CPS2_DEAD_KEY
ROM_END
ROM_START( dstlku1d )
@@ -9701,6 +10291,8 @@ ROM_START( dstlku1d )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "vam.11m", 0x000000, 0x200000, CRC(4a39deb2) SHA1(7e63e615869958db66a4e52a0272afee5a10e446) )
ROM_LOAD16_WORD_SWAP( "vam.12m", 0x200000, 0x200000, CRC(1a3e5c03) SHA1(c5a556e125d6c3d68da745b4d56cd7a851f2a23d) )
+
+ CPS2_DEAD_KEY
ROM_END
ROM_START( progearud )
@@ -9727,6 +10319,8 @@ ROM_START( progearud )
ROM_LOAD16_WORD_SWAP( "pga-simm.05b", 0x200000, 0x200000, CRC(37a65d86) SHA1(374d562a4648734f82aa2ddb6d258e870896dd45) ) // ROM on a simm
ROM_LOAD16_WORD_SWAP( "pga-simm.06a", 0x400000, 0x200000, CRC(d3f1e934) SHA1(5dcea28c873d0d472f5b94e07d97cd77ace2b252) ) // ROM on a simm
ROM_LOAD16_WORD_SWAP( "pga-simm.06b", 0x600000, 0x200000, CRC(8b39489a) SHA1(fd790efaf37dc2c4c16f657941044e3e2d3c2711) ) // ROM on a simm
+
+ CPS2_DEAD_KEY
ROM_END
ROM_START( progearjd )
@@ -9753,6 +10347,8 @@ ROM_START( progearjd )
ROM_LOAD16_WORD_SWAP( "pga-simm.05b", 0x200000, 0x200000, CRC(37a65d86) SHA1(374d562a4648734f82aa2ddb6d258e870896dd45) ) // ROM on a simm
ROM_LOAD16_WORD_SWAP( "pga-simm.06a", 0x400000, 0x200000, CRC(d3f1e934) SHA1(5dcea28c873d0d472f5b94e07d97cd77ace2b252) ) // ROM on a simm
ROM_LOAD16_WORD_SWAP( "pga-simm.06b", 0x600000, 0x200000, CRC(8b39489a) SHA1(fd790efaf37dc2c4c16f657941044e3e2d3c2711) ) // ROM on a simm
+
+ CPS2_DEAD_KEY
ROM_END
ROM_START( progearjbl )
@@ -9773,6 +10369,8 @@ ROM_START( progearjbl )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "pga.11m", 0x000000, 0x400000, CRC(abdd224e) SHA1(3316708e050204eeee91c642a2546fab80984c60) )
ROM_LOAD16_WORD_SWAP( "pga.12m", 0x400000, 0x400000, CRC(dac53406) SHA1(53fd271495429a7cbdeecbbc62b322f019f854a5) )
+
+ CPS2_DEAD_KEY
ROM_END
ROM_START( ssf2ud )
@@ -9806,6 +10404,8 @@ ROM_START( ssf2ud )
ROM_LOAD( "ssf.q06", 0x280000, 0x080000, CRC(4e79c951) SHA1(1144781d7dc57ef8a6458d982f5c91548ff59e27) )
ROM_LOAD( "ssf.q07", 0x300000, 0x080000, CRC(cdd14313) SHA1(ebe767a9d4b51dba4282fa0a36a546a88620dd59) )
ROM_LOAD( "ssf.q08", 0x380000, 0x080000, CRC(6f5a088c) SHA1(6c0b4690479647a99d76335f174be8455b4ff118) )
+
+ CPS2_DEAD_KEY
ROM_END
ROM_START( ssf2tbd )
@@ -9839,6 +10439,8 @@ ROM_START( ssf2tbd )
ROM_LOAD( "ssf.q06", 0x280000, 0x080000, CRC(4e79c951) SHA1(1144781d7dc57ef8a6458d982f5c91548ff59e27) )
ROM_LOAD( "ssf.q07", 0x300000, 0x080000, CRC(cdd14313) SHA1(ebe767a9d4b51dba4282fa0a36a546a88620dd59) )
ROM_LOAD( "ssf.q08", 0x380000, 0x080000, CRC(6f5a088c) SHA1(6c0b4690479647a99d76335f174be8455b4ff118) )
+
+ CPS2_DEAD_KEY
ROM_END
ROM_START( ssf2xjd )
@@ -9873,6 +10475,8 @@ ROM_START( ssf2xjd )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "sfx.11m", 0x000000, 0x200000, CRC(9bdbd476) SHA1(a8520f77f30b97aae36408e0c4ca1ebbde1808a5) )
ROM_LOAD16_WORD_SWAP( "sfx.12m", 0x200000, 0x200000, CRC(a05e3aab) SHA1(d4eb9cae66c74e956569fea8b815156fbd420f83) )
+
+ CPS2_DEAD_KEY
ROM_END
ROM_START( ssf2tad )
@@ -9907,6 +10511,8 @@ ROM_START( ssf2tad )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "sfx.11m", 0x000000, 0x200000, CRC(9bdbd476) SHA1(a8520f77f30b97aae36408e0c4ca1ebbde1808a5) )
ROM_LOAD16_WORD_SWAP( "sfx.12m", 0x200000, 0x200000, CRC(a05e3aab) SHA1(d4eb9cae66c74e956569fea8b815156fbd420f83) )
+
+ CPS2_DEAD_KEY
ROM_END
ROM_START( sgemfd )
@@ -9935,6 +10541,8 @@ ROM_START( sgemfd )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "pcf.11m", 0x000000, 0x400000, CRC(a5dea005) SHA1(3ae79baf6ff5bd527f82b26f164c7e3c65423ae2) )
ROM_LOAD16_WORD_SWAP( "pcf.12m", 0x400000, 0x400000, CRC(4ce235fe) SHA1(795b94557e954cc0e45fd3778b609064d57a34a2) )
+
+ CPS2_DEAD_KEY
ROM_END
ROM_START( armwar1d )
@@ -9966,6 +10574,8 @@ ROM_START( armwar1d )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "pwg.11m", 0x000000, 0x200000, CRC(a78f7433) SHA1(e47ffba7b9dac9d0dda985c5d966194be18260f7) )
ROM_LOAD16_WORD_SWAP( "pwg.12m", 0x200000, 0x200000, CRC(77438ed0) SHA1(733ca6c6a792e66e2aa12c5fc06dd459527afe4b) )
+
+ CPS2_DEAD_KEY
ROM_END
ROM_START( dimahoud )
@@ -9989,6 +10599,8 @@ ROM_START( dimahoud )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "gmd.11m", 0x000000, 0x400000, CRC(06a65542) SHA1(a1b3df70c90055a3cd59d0149fd18a74eff5bcc9) )
ROM_LOAD16_WORD_SWAP( "gmd.12m", 0x400000, 0x400000, CRC(50bc7a31) SHA1(7283569fc646c39f4c693f14e0ce7ff2ee49111a) )
+
+ CPS2_DEAD_KEY
ROM_END
ROM_START( mmatrixd )
@@ -10014,6 +10626,8 @@ ROM_START( mmatrixd )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "mmx.11m", 0x000000, 0x400000, CRC(4180b39f) SHA1(cabb1c358eae1bb6cfed07f5b92e4acd38650667) )
ROM_LOAD16_WORD_SWAP( "mmx.12m", 0x400000, 0x400000, CRC(95e22a59) SHA1(b3431d170c0a1a0d826ad0af21300b9180e3f114) )
+
+ CPS2_DEAD_KEY
ROM_END
ROM_START( vhunt2d )
@@ -10045,6 +10659,8 @@ ROM_START( vhunt2d )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "vh2.11m", 0x000000, 0x400000, CRC(38922efd) SHA1(8cfb36bdce3a524d0a81fec12ca0cba82222fa30) )
ROM_LOAD16_WORD_SWAP( "vh2.12m", 0x400000, 0x400000, CRC(6e2430af) SHA1(b475faf943bec4171ba0130f287e1948743ca273) )
+
+ CPS2_DEAD_KEY
ROM_END
ROM_START( vsav2d )
@@ -10076,6 +10692,8 @@ ROM_START( vsav2d )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "vs2.11m", 0x000000, 0x400000, CRC(d67e47b7) SHA1(15a3f6779eccb10551ed94edf7e6e406a79b3de7) )
ROM_LOAD16_WORD_SWAP( "vs2.12m", 0x400000, 0x400000, CRC(6d020a14) SHA1(e98f862fac1e357c90949768bb2646263d9981a0) )
+
+ CPS2_DEAD_KEY
ROM_END
ROM_START( csclub1d )
@@ -10118,6 +10736,8 @@ ROM_START( csclub1d )
ROM_LOAD16_WORD_SWAP( "csc.56", 0x280000, 0x080000, CRC(9a345334) SHA1(330291400a73215c9797457507a86c90ba415247))
ROM_LOAD16_WORD_SWAP( "csc.57", 0x300000, 0x080000, CRC(aedc27f2) SHA1(55137f0f22c4823558e6a8ba76011695579a4f1f) )
ROM_LOAD16_WORD_SWAP( "csc.58", 0x380000, 0x080000, CRC(2300b7b3) SHA1(f5ecbb45c24f7de1c1aa435870695551d4e343ca) )
+
+ CPS2_DEAD_KEY
ROM_END
ROM_START( cybotsud )
@@ -10149,6 +10769,8 @@ ROM_START( cybotsud )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "cyb.11m", 0x000000, 0x200000, CRC(362ccab2) SHA1(28e537067d4846f22657ee37166d18b8f05f4da1) )
ROM_LOAD16_WORD_SWAP( "cyb.12m", 0x200000, 0x200000, CRC(7066e9cc) SHA1(eb6a9d4998b3311344d73bae88d661d81609c492) )
+
+ CPS2_DEAD_KEY
ROM_END
ROM_START( cybotsjd )
@@ -10180,6 +10802,8 @@ ROM_START( cybotsjd )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "cyb.11m", 0x000000, 0x200000, CRC(362ccab2) SHA1(28e537067d4846f22657ee37166d18b8f05f4da1) )
ROM_LOAD16_WORD_SWAP( "cyb.12m", 0x200000, 0x200000, CRC(7066e9cc) SHA1(eb6a9d4998b3311344d73bae88d661d81609c492) )
+
+ CPS2_DEAD_KEY
ROM_END
ROM_START( mshvsfu1d )
@@ -10211,6 +10835,8 @@ ROM_START( mshvsfu1d )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "mvs.11m", 0x000000, 0x400000, CRC(86219770) SHA1(4e5b68d382a5aa37f8b0b6434c53a2b95f5f9a4d) )
ROM_LOAD16_WORD_SWAP( "mvs.12m", 0x400000, 0x400000, CRC(f2fd7f68) SHA1(28a30d55d3eaf963006c7cbe7c288099cd3ba536) )
+
+ CPS2_DEAD_KEY
ROM_END
ROM_START( spf2td )
@@ -10236,6 +10862,8 @@ ROM_START( spf2td )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "pzf.11m", 0x000000, 0x200000, CRC(78442743) SHA1(b61190bb586871de6d54af580e3e1d9cc0de0acb) )
ROM_LOAD16_WORD_SWAP( "pzf.12m", 0x200000, 0x200000, CRC(399d2c7b) SHA1(e849dea97b8d16540415c0d9bbc4f9f4eb755ec4) )
+
+ CPS2_DEAD_KEY
ROM_END
ROM_START( sfz3jr2d )
@@ -10267,6 +10895,8 @@ ROM_START( sfz3jr2d )
ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "sz3.11m", 0x000000, 0x400000, CRC(1c89eed1) SHA1(649a0b0a3eb72e2e69e9fb1ac51a58b70daa39f3) )
ROM_LOAD16_WORD_SWAP( "sz3.12m", 0x400000, 0x400000, CRC(f392b13a) SHA1(fa04ce0370144a49bd1d5acd873eef87b0dc9d15) )
+
+ CPS2_DEAD_KEY
ROM_END
ROM_START( sfz2jd )
@@ -10296,6 +10926,8 @@ ROM_START( sfz2jd )
ROM_REGION( 0x400000, "qsound", 0 ) /* QSound samples */
ROM_LOAD16_WORD_SWAP( "sz2.11m", 0x000000, 0x200000, CRC(aa47a601) SHA1(a4d1ee89c84a3b9db06469bb66e85293b5aa9ac9) )
ROM_LOAD16_WORD_SWAP( "sz2.12m", 0x200000, 0x200000, CRC(2237bc53) SHA1(96d5693047e4cf1ed10a8ee1905cea267a278e92) )
+
+ CPS2_DEAD_KEY
ROM_END
diff --git a/src/mame/drivers/cps3.c b/src/mame/drivers/cps3.c
index bb025a6995b..d9b3c214524 100644
--- a/src/mame/drivers/cps3.c
+++ b/src/mame/drivers/cps3.c
@@ -745,13 +745,11 @@ void cps3_state::cps3_decrypt_bios()
int i;
UINT32 *coderegion = (UINT32*)memregion("bios")->base();
- m_decrypted_bios = (UINT32*)memregion("bios")->base();
-
for (i=0;i<0x80000;i+=4)
{
UINT32 dword = coderegion[i/4];
UINT32 xormask = cps3_mask(i, m_key1, m_key2);
- m_decrypted_bios[i/4] = dword ^ xormask;
+ coderegion[i/4] = dword ^ xormask;
}
#if 0
/* Dump to file */
@@ -811,13 +809,6 @@ void cps3_state::init_crypt(UINT32 key1, UINT32 key2, int altEncryption)
m_maincpu->sh2drc_add_fastram(0x040C0030, 0x040C003b, 0, &m_tilemap30_regs_base[0]);
cps3_decrypt_bios();
- m_decrypted_gamerom = auto_alloc_array(machine(), UINT32, 0x1000000/4);
-
-
- m_0xc0000000_ram_decrypted = auto_alloc_array(machine(), UINT32, 0x400/4);
-
- address_space &main = m_maincpu->space(AS_PROGRAM);
- main.set_direct_update_handler(direct_update_delegate(FUNC(cps3_state::cps3_direct_handler), this));
init_common();
}
@@ -1358,43 +1349,6 @@ WRITE32_MEMBER(cps3_state::cps3_0xc0000000_ram_w)
m_0xc0000000_ram_decrypted[offset] = m_0xc0000000_ram[offset]^cps3_mask(offset*4+0xc0000000, m_key1, m_key2);
}
-
-
-DIRECT_UPDATE_MEMBER(cps3_state::cps3_direct_handler)
-{
-// if(DEBUG_PRINTF) printf("address %04x\n",address);
-
- /* BIOS ROM */
- if (address < 0x80000)
- {
- direct.explicit_configure(0x00000, 0x7ffff, 0x7ffff, m_decrypted_bios);
- return ~0;
- }
- /* RAM */
- else if (address >= 0x06000000 && address <= 0x06ffffff)
- {
- UINT8 *decrypted = (UINT8*)m_decrypted_gamerom;
- UINT8 *raw = decrypted;
-
- if (m_altEncryption) raw = (UINT8*) m_user4region;
-
- direct.explicit_configure(0x06000000, 0x06ffffff, 0x00ffffff, raw, decrypted);
-
- return ~0;
- }
- else if (address >= 0xc0000000 && address <= 0xc00003ff)
- {
- //direct->decrypted = (void*)m_0xc0000000_ram_decrypted;
- direct.explicit_configure(0xc0000000, 0xc00003ff, 0x3ff, (UINT8*)m_0xc0000000_ram.target(), (UINT8*)m_0xc0000000_ram_decrypted);
- return ~0;
- }
-
- /* anything else falls through to NOPs */
- direct.explicit_configure(address, address, 0, (UINT8*)m_nops, (UINT8*)m_nops);
- return ~0;
-}
-
-
WRITE32_MEMBER(cps3_state::cram_bank_w)
{
if (ACCESSING_BITS_0_7)
@@ -2249,6 +2203,12 @@ static ADDRESS_MAP_START( cps3_map, AS_PROGRAM, 32, cps3_state )
AM_RANGE(0xc0000000, 0xc00003ff) AM_RAM_WRITE(cps3_0xc0000000_ram_w ) AM_SHARE("0xc0000000_ram") /* Executes code from here */
ADDRESS_MAP_END
+static ADDRESS_MAP_START( decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 32, cps3_state )
+ AM_RANGE(0x00000000, 0x0007ffff) AM_ROM AM_REGION("bios", 0) // Bios ROM
+ AM_RANGE(0x06000000, 0x06ffffff) AM_ROM AM_SHARE("decrypted_gamerom")
+ AM_RANGE(0xc0000000, 0xc00003ff) AM_ROM AM_SHARE("0xc0000000_ram_decrypted")
+ADDRESS_MAP_END
+
static INPUT_PORTS_START( cps3 )
PORT_START("INPUTS")
PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
@@ -2551,8 +2511,9 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_START( cps3, cps3_state )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", SH2, 6250000*4) // external clock is 6.25 Mhz, it sets the intenral multiplier to 4x (this should probably be handled in the core..)
+ MCFG_CPU_ADD("maincpu", SH2, 6250000*4) // external clock is 6.25 Mhz, it sets the internal multiplier to 4x (this should probably be handled in the core..)
MCFG_CPU_PROGRAM_MAP(cps3_map)
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", cps3_state, cps3_vbl_interrupt)
MCFG_CPU_PERIODIC_INT_DRIVER(cps3_state, cps3_other_interrupt, 80) /* ?source? */
MCFG_SH2_DMA_KLUDGE_CB(cps3_state, dma_callback)
diff --git a/src/mame/drivers/crimfght.c b/src/mame/drivers/crimfght.c
index e6f6614e7cf..c9530fa4354 100644
--- a/src/mame/drivers/crimfght.c
+++ b/src/mame/drivers/crimfght.c
@@ -266,7 +266,7 @@ static MACHINE_CONFIG_START( crimfght, crimfght_state )
MCFG_SCREEN_REFRESH_RATE(59.17) /* verified on pcb */
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
MCFG_SCREEN_SIZE(64*8, 32*8)
- MCFG_SCREEN_VISIBLE_AREA(13*8, (64-13)*8-1, 2*8, 30*8-1 )
+ MCFG_SCREEN_VISIBLE_AREA(12*8-2, (64-12)*8-3, 2*8, 30*8-1 )
MCFG_SCREEN_UPDATE_DRIVER(crimfght_state, screen_update_crimfght)
MCFG_SCREEN_PALETTE("palette")
diff --git a/src/mame/drivers/cshooter.c b/src/mame/drivers/cshooter.c
index 597acba64aa..aeacb6e31be 100644
--- a/src/mame/drivers/cshooter.c
+++ b/src/mame/drivers/cshooter.c
@@ -4,7 +4,7 @@
TS 01.05.2006:
- - added sprites, bgmap reading and few ixes here and there
+ - added sprites, bgmap reading and few fixes here and there
airraid and cshootere are a bit "playable" ;) without gfx
@@ -103,7 +103,8 @@ public:
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
m_generic_paletteram_8(*this, "paletteram"),
- m_generic_paletteram2_8(*this, "paletteram2") { }
+ m_generic_paletteram2_8(*this, "paletteram2"),
+ m_decrypted_opcodes(*this, "decrypted_opcodes") { }
required_device<cpu_device> m_maincpu;
optional_device<seibu_sound_device> m_seibu_sound;
@@ -114,6 +115,7 @@ public:
required_device<palette_device> m_palette;
required_shared_ptr<UINT8> m_generic_paletteram_8;
required_shared_ptr<UINT8> m_generic_paletteram2_8;
+ required_shared_ptr<UINT8> m_decrypted_opcodes;
tilemap_t *m_txtilemap;
int m_coin_stat;
@@ -253,7 +255,7 @@ WRITE8_MEMBER(cshooter_state::cshooter_c700_w)
WRITE8_MEMBER(cshooter_state::bank_w)
{
- membank("bank1")->set_base(&memregion("user1")->base()[0x4000*((data>>4)&3)]);
+ membank("bank1")->set_entry((data>>4)&3);
}
@@ -313,6 +315,10 @@ static ADDRESS_MAP_START( airraid_map, AS_PROGRAM, 8, cshooter_state )
AM_RANGE(0xfe00, 0xffff) AM_RAM AM_SHARE("spriteram")
ADDRESS_MAP_END
+static ADDRESS_MAP_START( decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 8, cshooter_state )
+ AM_RANGE(0x0000, 0x7fff) AM_ROM AM_SHARE("decrypted_opcodes")
+ADDRESS_MAP_END
+
#if 0
/* Sound CPU */
@@ -440,9 +446,11 @@ static MACHINE_CONFIG_START( airraid, cshooter_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z80,XTAL_12MHz/2) /* verified on pcb */
MCFG_CPU_PROGRAM_MAP(airraid_map)
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", cshooter_state, cshooter_scanline, "screen", 0, 1)
SEIBU2_AIRRAID_SOUND_SYSTEM_CPU(XTAL_14_31818MHz/4) /* verified on pcb */
+ SEIBU_SOUND_SYSTEM_ENCRYPTED_LOW()
MCFG_QUANTUM_TIME(attotime::from_hz(6000))
@@ -595,29 +603,24 @@ DRIVER_INIT_MEMBER(cshooter_state,cshooter)
DRIVER_INIT_MEMBER(cshooter_state,cshootere)
{
- address_space &space = m_maincpu->space(AS_PROGRAM);
- int A;
UINT8 *rom = memregion("maincpu")->base();
- UINT8 *decrypt = auto_alloc_array(machine(), UINT8, 0x8000);
- space.set_decrypted_region(0x0000, 0x7fff, decrypt);
-
- for (A = 0x0000;A < 0x8000;A++)
+ for (int A = 0x0000;A < 0x8000;A++)
{
/* decode the opcodes */
- decrypt[A] = rom[A];
+ m_decrypted_opcodes[A] = rom[A];
if (BIT(A,5) && !BIT(A,3))
- decrypt[A] ^= 0x40;
+ m_decrypted_opcodes[A] ^= 0x40;
if (BIT(A,10) && !BIT(A,9) && BIT(A,3))
- decrypt[A] ^= 0x20;
+ m_decrypted_opcodes[A] ^= 0x20;
if ((BIT(A,10) ^ BIT(A,9)) && BIT(A,1))
- decrypt[A] ^= 0x02;
+ m_decrypted_opcodes[A] ^= 0x02;
if (BIT(A,9) || !BIT(A,5) || BIT(A,3))
- decrypt[A] = BITSWAP8(decrypt[A],7,6,1,4,3,2,5,0);
+ m_decrypted_opcodes[A] = BITSWAP8(m_decrypted_opcodes[A],7,6,1,4,3,2,5,0);
/* decode the data */
if (BIT(A,5))
@@ -627,8 +630,7 @@ DRIVER_INIT_MEMBER(cshooter_state,cshootere)
rom[A] = BITSWAP8(rom[A],7,6,1,4,3,2,5,0);
}
- membank("bank1")->set_base(&memregion("user1")->base()[0]);
- m_seibu_sound->decrypt("audiocpu",0x2000);
+ membank("bank1")->configure_entries(0, 4, memregion("user1")->base(), 0x4000);
}
diff --git a/src/mame/drivers/csplayh5.c b/src/mame/drivers/csplayh5.c
index 0bc3fae7e59..3a4bd6a0c47 100644
--- a/src/mame/drivers/csplayh5.c
+++ b/src/mame/drivers/csplayh5.c
@@ -443,7 +443,6 @@ TIMER_DEVICE_CALLBACK_MEMBER(csplayh5_state::csplayh5_irq)
if((scanline % 2) == 0)
{
- m_v9958->set_resolution(RENDER_HIGH);
m_v9958->interrupt();
}
}
diff --git a/src/mame/drivers/cv1k.c b/src/mame/drivers/cv1k.c
index f107fe809eb..de470304432 100644
--- a/src/mame/drivers/cv1k.c
+++ b/src/mame/drivers/cv1k.c
@@ -35,6 +35,8 @@ CA019B Do-Don-Pachi Dai-Fukkatsu Black Label
CA021 Akai Katana
CMDL01 Medal Mahjong Moukari Bancho
+ Pirates of Gappori http://web.archive.org/web/20090907145501/http://www.cave.co.jp/gameonline/gappori/
+ Oooku http://web.archive.org/web/20141104001322/http://www.cave.co.jp/gameonline/oooku/
Note: CA018 - Deathsmiles II: Makai no Merry Christmas on unknown custom platform
CA020 - Do-Don-Pachi Dai-ou-jou Tamashii on PGM2 platform
@@ -719,7 +721,7 @@ ROM_START( mmmbanc )
ROM_RELOAD(0x200000,0x200000)
ROM_REGION( 0x8400000, "game", ROMREGION_ERASEFF)
- ROM_LOAD( "u2", 0x000000, 0x8400000, CRC(f3b50c30) SHA1(962327798081b292b2d3fd3b7845c0197f9f2d8a) ) /* (2007/06/05 MASTER VER.) */
+ ROM_LOAD( "u2", 0x000000, 0x8400000, CRC(2e38965a) SHA1(2b58d1cd1a3dbc261d4a46805d2ea015fe22c444) ) /* (2007/06/05 MASTER VER.) */
ROM_REGION( 0x800000, "ymz770", ROMREGION_ERASEFF)
ROM_LOAD16_WORD_SWAP( "u23", 0x000000, 0x400000, CRC(4caaa1bf) SHA1(9b92c13eac05601da4d9bb3eb727c156974e9f0c) )
diff --git a/src/mame/drivers/darkmist.c b/src/mame/drivers/darkmist.c
index eb5d5589b41..35419344046 100644
--- a/src/mame/drivers/darkmist.c
+++ b/src/mame/drivers/darkmist.c
@@ -29,11 +29,15 @@ TODO:
#include "cpu/z80/z80.h"
#include "includes/darkmist.h"
+void darkmist_state::machine_start()
+{
+ membank("bank1")->configure_entries(0, 2, memregion("maincpu")->base() + 0x10000, 0x4000);
+}
WRITE8_MEMBER(darkmist_state::hw_w)
{
m_hw=data;
- membank("bank1")->set_base(&memregion("maincpu")->base()[0x010000+((data&0x80)?0x4000:0)]);
+ membank("bank1")->set_entry((data&0x80)?1:0);
}
static ADDRESS_MAP_START( memmap, AS_PROGRAM, 8, darkmist_state )
@@ -60,6 +64,10 @@ static ADDRESS_MAP_START( memmap, AS_PROGRAM, 8, darkmist_state )
AM_RANGE(0xf000, 0xffff) AM_RAM AM_SHARE("spriteram")
ADDRESS_MAP_END
+static ADDRESS_MAP_START( decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 8, darkmist_state )
+ AM_RANGE(0x0000, 0x7fff) AM_ROM AM_SHARE("decrypted_opcodes")
+ AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1")
+ADDRESS_MAP_END
static INPUT_PORTS_START( darkmist )
PORT_START("P1")
@@ -228,6 +236,7 @@ static MACHINE_CONFIG_START( darkmist, darkmist_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z80,4000000) /* ? MHz */
MCFG_CPU_PROGRAM_MAP(memmap)
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", darkmist_state, scanline, "screen", 0, 1)
MCFG_DEVICE_ADD("t5182", T5182, 0)
@@ -389,20 +398,17 @@ void darkmist_state::decrypt_gfx()
void darkmist_state::decrypt_snd()
{
- int i;
UINT8 *ROM = memregion("t5182_z80")->base();
- for(i=0x0000;i<0x2000;i++)
- ROM[i] = BITSWAP8(ROM[i], 7,1,2,3,4,5,6,0);
+ for (int i = 0x0000; i < 0x8000; i++)
+ ROM[i] = BITSWAP8(ROM[i], 7, 1, 2, 3, 4, 5, 6, 0);
}
DRIVER_INIT_MEMBER(darkmist_state,darkmist)
{
- address_space &space = m_maincpu->space(AS_PROGRAM);
int i, len;
UINT8 *ROM = memregion("maincpu")->base();
dynamic_buffer buffer(0x10000);
- UINT8 *decrypt = auto_alloc_array(machine(), UINT8, 0x8000);
decrypt_gfx();
@@ -429,10 +435,9 @@ DRIVER_INIT_MEMBER(darkmist_state,darkmist)
}
ROM[i] = d;
- decrypt[i] = p;
+ m_decrypted_opcodes[i] = p;
}
- space.set_decrypted_region(0x0000, 0x7fff, decrypt);
membank("bank1")->set_base(&ROM[0x010000]);
/* adr line swaps */
diff --git a/src/mame/drivers/darkseal.c b/src/mame/drivers/darkseal.c
index cd382f78d32..ba14b7a932a 100644
--- a/src/mame/drivers/darkseal.c
+++ b/src/mame/drivers/darkseal.c
@@ -8,6 +8,8 @@
Gate Of Doom (Rev 4) (c) 1990 Data East Corporation (USA version)
Gate of Doom (Rev 1) (c) 1990 Data East Corporation (USA version)
+ Board: DE-0332-2
+
Emulation by Bryan McPhail, mish@tendril.co.uk
2008-08
@@ -225,11 +227,11 @@ GFXDECODE_END
static MACHINE_CONFIG_START( darkseal, darkseal_state )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", M68000,12000000) /* Custom chip 59 */
+ MCFG_CPU_ADD("maincpu", M68000, XTAL_24MHz/2) /* Custom chip 59 */
MCFG_CPU_PROGRAM_MAP(darkseal_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", darkseal_state, irq6_line_hold)/* VBL */
- MCFG_CPU_ADD("audiocpu", H6280, 32220000/4) /* Custom chip 45, Audio section crystal is 32.220 MHz */
+ MCFG_CPU_ADD("audiocpu", H6280, XTAL_32_22MHz/4) /* Custom chip 45, Audio section crystal is 32.220 MHz */
MCFG_CPU_PROGRAM_MAP(sound_map)
/* video hardware */
@@ -283,18 +285,18 @@ static MACHINE_CONFIG_START( darkseal, darkseal_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("ym1", YM2203, 32220000/8)
+ MCFG_SOUND_ADD("ym1", YM2203, XTAL_32_22MHz/8)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.45)
- MCFG_YM2151_ADD("ym2", 32220000/9)
+ MCFG_YM2151_ADD("ym2", XTAL_32_22MHz/9)
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu", 1)) // IRQ2
MCFG_SOUND_ROUTE(0, "mono", 0.55)
MCFG_SOUND_ROUTE(1, "mono", 0.55)
- MCFG_OKIM6295_ADD("oki1", 32220000/32, OKIM6295_PIN7_HIGH)
+ MCFG_OKIM6295_ADD("oki1", XTAL_32_22MHz/32, OKIM6295_PIN7_HIGH)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
- MCFG_OKIM6295_ADD("oki2", 32220000/16, OKIM6295_PIN7_HIGH)
+ MCFG_OKIM6295_ADD("oki2", XTAL_32_22MHz/16, OKIM6295_PIN7_HIGH)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.60)
MACHINE_CONFIG_END
@@ -333,17 +335,17 @@ ROM_END
ROM_START( darkseal1 )
ROM_REGION( 0x80000, "maincpu", 0 ) /* 68000 code */
- ROM_LOAD16_BYTE( "ga_04.j12", 0x00000, 0x20000, CRC(a1a985a9) SHA1(eac3f43ff4016dcc21fe34b6bfed36e0d4b86959) )
- ROM_LOAD16_BYTE( "ga_01.h14", 0x00001, 0x20000, CRC(98bd2940) SHA1(88ac727c3797e646834266320a71aa159e2b2541) )
- ROM_LOAD16_BYTE( "ga_00.h12", 0x40000, 0x20000, CRC(fbf3ac63) SHA1(51af581ee951eedeb4aa413ecbebe8bf4d30613b) )
- ROM_LOAD16_BYTE( "ga_05.j14", 0x40001, 0x20000, CRC(d5e3ae3f) SHA1(12f6e92af115422c6ab6ef1d33675d1e1cd58e10) )
+ ROM_LOAD16_BYTE( "FZ_04-4.J12", 0x00000, 0x20000, CRC(a1a985a9) SHA1(eac3f43ff4016dcc21fe34b6bfed36e0d4b86959) )
+ ROM_LOAD16_BYTE( "FZ_01-1.H14", 0x00001, 0x20000, CRC(98bd2940) SHA1(88ac727c3797e646834266320a71aa159e2b2541) )
+ ROM_LOAD16_BYTE( "FZ_00-2.H12", 0x40000, 0x20000, CRC(fbf3ac63) SHA1(51af581ee951eedeb4aa413ecbebe8bf4d30613b) )
+ ROM_LOAD16_BYTE( "FZ_05-2.J14", 0x40001, 0x20000, CRC(d5e3ae3f) SHA1(12f6e92af115422c6ab6ef1d33675d1e1cd58e10) )
ROM_REGION( 0x10000, "audiocpu", 0 ) /* Sound CPU */
- ROM_LOAD( "fz_06-1.j15", 0x00000, 0x10000, CRC(c4828a6d) SHA1(fbfd0c85730bbe18401879cd68c19aaec9d482d8) )
+ ROM_LOAD( "FZ_06-1.J15", 0x00000, 0x10000, CRC(c4828a6d) SHA1(fbfd0c85730bbe18401879cd68c19aaec9d482d8) )
ROM_REGION( 0x020000, "gfx1", 0 )
- ROM_LOAD( "fz_02.j1", 0x000000, 0x10000, CRC(3c9c3012) SHA1(086c2123725d4aa32838c0b6c82317d9c789c465) ) /* chars */
- ROM_LOAD( "fz_03.j2", 0x010000, 0x10000, CRC(264b90ed) SHA1(0bb1557673107c2d732a9374d5601a6eaf229473) )
+ ROM_LOAD( "FZ_02-1.J1", 0x000000, 0x10000, CRC(3c9c3012) SHA1(086c2123725d4aa32838c0b6c82317d9c789c465) ) /* chars */
+ ROM_LOAD( "FZ_03-1.J2", 0x010000, 0x10000, CRC(264b90ed) SHA1(0bb1557673107c2d732a9374d5601a6eaf229473) )
ROM_REGION( 0x080000, "gfx2", 0 )
ROM_LOAD( "mac-03.h3", 0x000000, 0x80000, CRC(9996f3dc) SHA1(fffd9ecfe142a0c7c3c9c521778ff9c55ea8b225) ) /* tiles 1 */
@@ -356,10 +358,10 @@ ROM_START( darkseal1 )
ROM_LOAD( "mac-01.b3", 0x080000, 0x80000, CRC(b28f7584) SHA1(e02ddd45130a7b50f80b6dd049059dba8071d768) )
ROM_REGION( 0x40000, "oki1", 0 ) /* ADPCM samples */
- ROM_LOAD( "fz_08.l17", 0x00000, 0x20000, CRC(c9bf68e1) SHA1(c81e2534a814fe44c8787946a9fbe18f1743c3b4) )
+ ROM_LOAD( "FZ_08-1.K17", 0x00000, 0x20000, CRC(c9bf68e1) SHA1(c81e2534a814fe44c8787946a9fbe18f1743c3b4) )
ROM_REGION( 0x40000, "oki2", 0 ) /* ADPCM samples */
- ROM_LOAD( "fz_07.k14", 0x00000, 0x20000, CRC(588dd3cb) SHA1(16c4e7670a4967768ddbfd52939d4e6e42268441) )
+ ROM_LOAD( "FZ_07-.K14", 0x00000, 0x20000, CRC(588dd3cb) SHA1(16c4e7670a4967768ddbfd52939d4e6e42268441) )
ROM_END
ROM_START( darksealj )
diff --git a/src/mame/drivers/dblewing.c b/src/mame/drivers/dblewing.c
index bfb9b470842..9663f217f9d 100644
--- a/src/mame/drivers/dblewing.c
+++ b/src/mame/drivers/dblewing.c
@@ -89,7 +89,8 @@ public:
m_sprgen(*this, "spritegen"),
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
- m_deco_tilegen1(*this, "tilegen1")
+ m_deco_tilegen1(*this, "tilegen1"),
+ m_decrypted_opcodes(*this, "decrypted_opcodes")
{ }
optional_device<deco104_device> m_deco104;
/* memory pointers */
@@ -106,6 +107,7 @@ public:
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
required_device<deco16ic_device> m_deco_tilegen1;
+ required_shared_ptr<UINT16> m_decrypted_opcodes;
DECLARE_WRITE_LINE_MEMBER(sound_irq);
DECLARE_READ16_MEMBER(dblewing_prot_r);
DECLARE_WRITE16_MEMBER(dblewing_prot_w);
@@ -179,6 +181,10 @@ static ADDRESS_MAP_START( dblewing_map, AS_PROGRAM, 16, dblewing_state )
AM_RANGE(0xff0000, 0xff3fff) AM_MIRROR(0xc000) AM_RAM
ADDRESS_MAP_END
+static ADDRESS_MAP_START( decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 16, dblewing_state )
+ AM_RANGE(0x000000, 0x07ffff) AM_ROM AM_SHARE("decrypted_opcodes")
+ADDRESS_MAP_END
+
READ8_MEMBER(dblewing_state::irq_latch_r)
{
/* bit 1 of dblewing_sound_irq specifies IRQ command writes */
@@ -362,6 +368,7 @@ static MACHINE_CONFIG_START( dblewing, dblewing_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, XTAL_28MHz/2) /* DE102 */
MCFG_CPU_PROGRAM_MAP(dblewing_map)
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", dblewing_state, irq6_line_hold)
MCFG_CPU_ADD("audiocpu", Z80, XTAL_32_22MHz/9)
@@ -450,7 +457,7 @@ ROM_END
DRIVER_INIT_MEMBER(dblewing_state,dblewing)
{
deco56_decrypt_gfx(machine(), "gfx1");
- deco102_decrypt_cpu(machine(), "maincpu", 0x399d, 0x25, 0x3d);
+ deco102_decrypt_cpu((UINT16 *)memregion("maincpu")->base(), m_decrypted_opcodes, 0x80000, 0x399d, 0x25, 0x3d);
}
diff --git a/src/mame/drivers/ddragon3.c b/src/mame/drivers/ddragon3.c
index a3dbcb9b21c..1766350d8df 100644
--- a/src/mame/drivers/ddragon3.c
+++ b/src/mame/drivers/ddragon3.c
@@ -1172,7 +1172,7 @@ ROM_END
ROM_START( ctribeo ) // only main program code differs from ctribe1 set
ROM_REGION( 0x80000, "maincpu", 0 ) /* 64k for cpu code */
- ROM_LOAD16_BYTE( "28a16-1.ic26", 0x00001, 0x20000, CRC(d108f36f) SHA1(af53fa441b9ddfc639abb573864a9b351633c6B7) )
+ ROM_LOAD16_BYTE( "28a16-1.ic26", 0x00001, 0x20000, CRC(d108f36f) SHA1(af53fa441b9ddfc639abb573864a9b351633c6b7) )
ROM_LOAD16_BYTE( "28a15-1.ic25", 0x00000, 0x20000, CRC(3f5693a3) SHA1(2d4516506ad1d68ac45242fe149bba1b4b53eb45) )
ROM_LOAD16_BYTE( "28j17-0.104", 0x40001, 0x10000, CRC(8c2c6dbd) SHA1(b99b9be6e0bdc8340fedd258819c4df587926a84) )
/* No EVEN rom! */
diff --git a/src/mame/drivers/deadang.c b/src/mame/drivers/deadang.c
index e685c4267d0..f7e6b872502 100644
--- a/src/mame/drivers/deadang.c
+++ b/src/mame/drivers/deadang.c
@@ -244,6 +244,7 @@ static MACHINE_CONFIG_START( deadang, deadang_state )
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer2", deadang_state, sub_scanline, "screen", 0, 1)
SEIBU3A_SOUND_SYSTEM_CPU(XTAL_14_31818MHz/4)
+ SEIBU_SOUND_SYSTEM_ENCRYPTED_LOW()
MCFG_QUANTUM_TIME(attotime::from_hz(60)) // the game stops working with higher interleave rates..
@@ -413,14 +414,12 @@ ROM_END
DRIVER_INIT_MEMBER(deadang_state,deadang)
{
- m_seibu_sound->decrypt("audiocpu", 0x2000);
m_adpcm1->decrypt("adpcm1");
m_adpcm2->decrypt("adpcm2");
}
DRIVER_INIT_MEMBER(deadang_state,ghunter)
{
- m_seibu_sound->decrypt("audiocpu", 0x2000);
m_adpcm1->decrypt("adpcm1");
m_adpcm2->decrypt("adpcm2");
diff --git a/src/mame/drivers/deco32.c b/src/mame/drivers/deco32.c
index 220bf509cb1..90cbed76764 100644
--- a/src/mame/drivers/deco32.c
+++ b/src/mame/drivers/deco32.c
@@ -232,10 +232,8 @@ Notes:
#include "cpu/m6809/m6809.h"
#include "cpu/z80/z80.h"
#include "includes/decocrpt.h"
-#include "machine/eepromser.h"
#include "includes/deco32.h"
#include "sound/2151intf.h"
-#include "sound/okim6295.h"
/**********************************************************************************/
@@ -245,7 +243,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(deco32_state::interrupt_gen)
m_maincpu->set_input_line(ARM_IRQ_LINE, HOLD_LINE);
}
-READ32_MEMBER(deco32_state::deco32_irq_controller_r)
+READ32_MEMBER(deco32_state::irq_controller_r)
{
int vblank;
@@ -281,7 +279,7 @@ READ32_MEMBER(deco32_state::deco32_irq_controller_r)
return 0xffffffff;
}
-WRITE32_MEMBER(deco32_state::deco32_irq_controller_w)
+WRITE32_MEMBER(deco32_state::irq_controller_w)
{
int scanline;
@@ -305,7 +303,7 @@ WRITE32_MEMBER(deco32_state::deco32_irq_controller_w)
}
}
-WRITE32_MEMBER(deco32_state::deco32_sound_w)
+WRITE32_MEMBER(deco32_state::sound_w)
{
soundlatch_byte_w(space,0,data & 0xff);
m_audiocpu->set_input_line(0, HOLD_LINE);
@@ -317,7 +315,7 @@ void deco32_state::deco32_sound_cb( address_space &space, UINT16 data, UINT16 me
m_audiocpu->set_input_line(0, HOLD_LINE);
}
-READ32_MEMBER(deco32_state::deco32_71_r)
+READ32_MEMBER(deco32_state::_71_r)
{
/* Bit 0x80 goes high when sprite DMA is complete, and low
while it's in progress, we don't bother to emulate it */
@@ -349,7 +347,7 @@ WRITE32_MEMBER(deco32_state::fghthist_eeprom_w)
m_eeprom->di_write((data & 0x10) >> 4);
m_eeprom->cs_write((data & 0x40) ? ASSERT_LINE : CLEAR_LINE);
- deco32_pri_w(space,0,data&0x1,0xffffffff); /* Bit 0 - layer priority toggle */
+ pri_w(space,0,data&0x1,0xffffffff); /* Bit 0 - layer priority toggle */
}
else if (!ACCESSING_BITS_8_15)
{
@@ -359,13 +357,13 @@ WRITE32_MEMBER(deco32_state::fghthist_eeprom_w)
/**********************************************************************************/
-READ32_MEMBER(deco32_state::dragngun_service_r)
+READ32_MEMBER(dragngun_state::service_r)
{
// logerror("%08x:Read service\n",space.device().safe_pc());
return ioport("IN2")->read();
}
-READ32_MEMBER(deco32_state::lockload_gun_mirror_r)
+READ32_MEMBER(dragngun_state::lockload_gun_mirror_r)
{
//logerror("%08x:Read gun %d\n",space.device().safe_pc(),offset);
//return ((machine().rand()%0xffff)<<16) | machine().rand()%0xffff;
@@ -375,32 +373,32 @@ READ32_MEMBER(deco32_state::lockload_gun_mirror_r)
}
-READ32_MEMBER(dragngun_state::dragngun_lightgun_r)
+READ32_MEMBER(dragngun_state::lightgun_r)
{
/* Ports 0-3 are read, but seem unused */
- switch (m_dragngun_lightgun_port) {
+ switch (m_lightgun_port) {
case 4: return ioport("LIGHT0_X")->read();
case 5: return ioport("LIGHT1_X")->read();
case 6: return ioport("LIGHT0_Y")->read();
case 7: return ioport("LIGHT1_Y")->read();
}
-// logerror("Illegal lightgun port %d read \n",m_dragngun_lightgun_port);
+// logerror("Illegal lightgun port %d read \n",m_lightgun_port);
return 0;
}
-WRITE32_MEMBER(dragngun_state::dragngun_lightgun_w)
+WRITE32_MEMBER(dragngun_state::lightgun_w)
{
-// logerror("Lightgun port %d\n",m_dragngun_lightgun_port);
- m_dragngun_lightgun_port=offset;
+// logerror("Lightgun port %d\n",m_lightgun_port);
+ m_lightgun_port=offset;
}
-READ32_MEMBER(deco32_state::dragngun_eeprom_r)
+READ32_MEMBER(dragngun_state::eeprom_r)
{
return 0xfffffffe | m_eeprom->do_read();
}
-WRITE32_MEMBER(deco32_state::dragngun_eeprom_w)
+WRITE32_MEMBER(dragngun_state::eeprom_w)
{
if (ACCESSING_BITS_0_7) {
m_eeprom->clk_write((data & 0x2) ? ASSERT_LINE : CLEAR_LINE);
@@ -531,7 +529,7 @@ WRITE32_MEMBER(deco32_state::tattass_control_w)
}
/* Playfield control - Only written in full word memory accesses */
- deco32_pri_w(space,0,data&0x3,0xffffffff); /* Bit 0 - layer priority toggle, Bit 1 - BG2/3 Joint mode (8bpp) */
+ pri_w(space,0,data&0x3,0xffffffff); /* Bit 0 - layer priority toggle, Bit 1 - BG2/3 Joint mode (8bpp) */
/* Sound board reset control */
if (data&0x80)
@@ -585,7 +583,7 @@ WRITE32_MEMBER(deco32_state::nslasher_eeprom_w)
m_eeprom->di_write((data & 0x10) >> 4);
m_eeprom->cs_write((data & 0x40) ? ASSERT_LINE : CLEAR_LINE);
- deco32_pri_w(space,0,data&0x3,0xffffffff); /* Bit 0 - layer priority toggle, Bit 1 - BG2/3 Joint mode (8bpp) */
+ pri_w(space,0,data&0x3,0xffffffff); /* Bit 0 - layer priority toggle, Bit 1 - BG2/3 Joint mode (8bpp) */
}
}
@@ -594,81 +592,81 @@ WRITE32_MEMBER(deco32_state::nslasher_eeprom_w)
/**********************************************************************************/
-READ32_MEMBER(deco32_state::deco32_spriteram_r)
+READ32_MEMBER(deco32_state::spriteram_r)
{
return m_spriteram16[offset] ^ 0xffff0000;
}
-WRITE32_MEMBER(deco32_state::deco32_spriteram_w)
+WRITE32_MEMBER(deco32_state::spriteram_w)
{
data &= 0x0000ffff;
mem_mask &= 0x0000ffff;
COMBINE_DATA(&m_spriteram16[offset]);
}
-WRITE32_MEMBER(deco32_state::deco32_buffer_spriteram_w)
+WRITE32_MEMBER(deco32_state::buffer_spriteram_w)
{
memcpy(m_spriteram16_buffered, m_spriteram16, 0x1000);
}
-READ32_MEMBER(deco32_state::deco32_spriteram2_r)
+READ32_MEMBER(deco32_state::spriteram2_r)
{
return m_spriteram16_2[offset] ^ 0xffff0000;
}
-WRITE32_MEMBER(deco32_state::deco32_spriteram2_w)
+WRITE32_MEMBER(deco32_state::spriteram2_w)
{
data &= 0x0000ffff;
mem_mask &= 0x0000ffff;
COMBINE_DATA(&m_spriteram16_2[offset]);
}
-WRITE32_MEMBER(deco32_state::deco32_buffer_spriteram2_w)
+WRITE32_MEMBER(deco32_state::buffer_spriteram2_w)
{
memcpy(m_spriteram16_2_buffered, m_spriteram16_2, 0x1000);
}
// tattass tests these as 32-bit ram, even if only 16-bits are hooked up to the tilemap chip - does it mirror parts of the dword?
-WRITE32_MEMBER(deco32_state::deco32_pf1_rowscroll_w){ COMBINE_DATA(&m_pf1_rowscroll32[offset]); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&m_pf1_rowscroll[offset]); }
-WRITE32_MEMBER(deco32_state::deco32_pf2_rowscroll_w){ COMBINE_DATA(&m_pf2_rowscroll32[offset]); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&m_pf2_rowscroll[offset]); }
-WRITE32_MEMBER(deco32_state::deco32_pf3_rowscroll_w){ COMBINE_DATA(&m_pf3_rowscroll32[offset]); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&m_pf3_rowscroll[offset]); }
-WRITE32_MEMBER(deco32_state::deco32_pf4_rowscroll_w){ COMBINE_DATA(&m_pf4_rowscroll32[offset]); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&m_pf4_rowscroll[offset]); }
+WRITE32_MEMBER(deco32_state::pf1_rowscroll_w){ COMBINE_DATA(&m_pf1_rowscroll32[offset]); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&m_pf1_rowscroll[offset]); }
+WRITE32_MEMBER(deco32_state::pf2_rowscroll_w){ COMBINE_DATA(&m_pf2_rowscroll32[offset]); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&m_pf2_rowscroll[offset]); }
+WRITE32_MEMBER(deco32_state::pf3_rowscroll_w){ COMBINE_DATA(&m_pf3_rowscroll32[offset]); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&m_pf3_rowscroll[offset]); }
+WRITE32_MEMBER(deco32_state::pf4_rowscroll_w){ COMBINE_DATA(&m_pf4_rowscroll32[offset]); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&m_pf4_rowscroll[offset]); }
static ADDRESS_MAP_START( captaven_map, AS_PROGRAM, 32, deco32_state )
AM_RANGE(0x000000, 0x0fffff) AM_ROM
- AM_RANGE(0x100000, 0x100007) AM_READ(deco32_71_r)
- AM_RANGE(0x100000, 0x100003) AM_WRITE(deco32_buffer_spriteram_w)
+ AM_RANGE(0x100000, 0x100007) AM_READ(_71_r)
+ AM_RANGE(0x100000, 0x100003) AM_WRITE(buffer_spriteram_w)
AM_RANGE(0x108000, 0x108003) AM_WRITENOP /* ? */
- AM_RANGE(0x110000, 0x111fff) AM_READWRITE(deco32_spriteram_r, deco32_spriteram_w)
+ AM_RANGE(0x110000, 0x111fff) AM_READWRITE(spriteram_r, spriteram_w)
AM_RANGE(0x120000, 0x127fff) AM_RAM AM_SHARE("ram") /* Main RAM */
// AM_RANGE(0x128000, 0x128fff) AM_DEVREAD("ioprot", deco146_device,captaven_prot_r)
-// AM_RANGE(0x1280c8, 0x1280cb) AM_WRITE(deco32_sound_w)
+// AM_RANGE(0x1280c8, 0x1280cb) AM_WRITE(sound_w)
AM_RANGE(0x128000, 0x12ffff) AM_READWRITE16(dg_protection_region_0_146_r, dg_protection_region_0_146_w, 0x0000ffff)
- AM_RANGE(0x130000, 0x131fff) AM_RAM_WRITE(deco32_nonbuffered_palette_w) AM_SHARE("paletteram") /* Palette RAM */
- AM_RANGE(0x148000, 0x14800f) AM_READWRITE(deco32_irq_controller_r, deco32_irq_controller_w)
+ AM_RANGE(0x130000, 0x131fff) AM_RAM_WRITE(nonbuffered_palette_w) AM_SHARE("paletteram") /* Palette RAM */
+ AM_RANGE(0x148000, 0x14800f) AM_READWRITE(irq_controller_r, irq_controller_w)
AM_RANGE(0x160000, 0x167fff) AM_RAM /* Extra work RAM */
AM_RANGE(0x168000, 0x168003) AM_READ(captaven_soundcpu_r)
- AM_RANGE(0x178000, 0x178003) AM_WRITE(deco32_pri_w)
+ AM_RANGE(0x178000, 0x178003) AM_WRITE(pri_w)
AM_RANGE(0x180000, 0x18001f) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf_control_dword_r, pf_control_dword_w)
AM_RANGE(0x190000, 0x191fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w)
AM_RANGE(0x192000, 0x193fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w) /* Mirror address - bug in program code */
AM_RANGE(0x194000, 0x195fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w)
- AM_RANGE(0x1a0000, 0x1a3fff) AM_RAM_WRITE(deco32_pf1_rowscroll_w) AM_SHARE("pf1_rowscroll32")
- AM_RANGE(0x1a4000, 0x1a5fff) AM_RAM_WRITE(deco32_pf2_rowscroll_w) AM_SHARE("pf2_rowscroll32")
+ AM_RANGE(0x1a0000, 0x1a3fff) AM_RAM_WRITE(pf1_rowscroll_w) AM_SHARE("pf1_rowscroll32")
+ AM_RANGE(0x1a4000, 0x1a5fff) AM_RAM_WRITE(pf2_rowscroll_w) AM_SHARE("pf2_rowscroll32")
AM_RANGE(0x1c0000, 0x1c001f) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf_control_dword_r, pf_control_dword_w)
AM_RANGE(0x1d0000, 0x1d1fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w)
AM_RANGE(0x1d4000, 0x1d5fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w) // unused
- AM_RANGE(0x1e0000, 0x1e3fff) AM_RAM_WRITE(deco32_pf3_rowscroll_w) AM_SHARE("pf3_rowscroll32")
- AM_RANGE(0x1e4000, 0x1e5fff) AM_RAM_WRITE(deco32_pf4_rowscroll_w) AM_SHARE("pf4_rowscroll32") // unused
+ AM_RANGE(0x1e0000, 0x1e3fff) AM_RAM_WRITE(pf3_rowscroll_w) AM_SHARE("pf3_rowscroll32")
+ AM_RANGE(0x1e4000, 0x1e5fff) AM_RAM_WRITE(pf4_rowscroll_w) AM_SHARE("pf4_rowscroll32") // unused
ADDRESS_MAP_END
@@ -708,31 +706,31 @@ WRITE32_MEMBER( deco32_state::fghthist_protection_region_0_146_w )
static ADDRESS_MAP_START( fghthist_map, AS_PROGRAM, 32, deco32_state )
-// AM_RANGE(0x000000, 0x001fff) AM_ROM AM_WRITE(deco32_pf1_data_w) // wtf??
+// AM_RANGE(0x000000, 0x001fff) AM_ROM AM_WRITE(pf1_data_w) // wtf??
AM_RANGE(0x000000, 0x0fffff) AM_ROM
AM_RANGE(0x100000, 0x11ffff) AM_RAM AM_SHARE("ram")
AM_RANGE(0x120020, 0x12002f) AM_READ(fghthist_control_r)
AM_RANGE(0x12002c, 0x12002f) AM_WRITE(fghthist_eeprom_w)
- AM_RANGE(0x1201fc, 0x1201ff) AM_WRITE(deco32_sound_w)
+ AM_RANGE(0x1201fc, 0x1201ff) AM_WRITE(sound_w)
AM_RANGE(0x140000, 0x140003) AM_WRITENOP /* VBL irq ack */
- AM_RANGE(0x168000, 0x169fff) AM_RAM_WRITE(deco32_buffered_palette_w) AM_SHARE("paletteram")
- AM_RANGE(0x16c008, 0x16c00b) AM_WRITE(deco32_palette_dma_w)
+ AM_RANGE(0x168000, 0x169fff) AM_RAM_WRITE(buffered_palette_w) AM_SHARE("paletteram")
+ AM_RANGE(0x16c008, 0x16c00b) AM_WRITE(palette_dma_w)
//
- AM_RANGE(0x178000, 0x179fff) AM_READWRITE(deco32_spriteram_r, deco32_spriteram_w)
- AM_RANGE(0x17c010, 0x17c013) AM_WRITE(deco32_buffer_spriteram_w)
+ AM_RANGE(0x178000, 0x179fff) AM_READWRITE(spriteram_r, spriteram_w)
+ AM_RANGE(0x17c010, 0x17c013) AM_WRITE(buffer_spriteram_w)
AM_RANGE(0x182000, 0x183fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w)
AM_RANGE(0x184000, 0x185fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w)
- AM_RANGE(0x192000, 0x193fff) AM_RAM_WRITE(deco32_pf1_rowscroll_w) AM_SHARE("pf1_rowscroll32")
- AM_RANGE(0x194000, 0x195fff) AM_RAM_WRITE(deco32_pf2_rowscroll_w) AM_SHARE("pf2_rowscroll32")
+ AM_RANGE(0x192000, 0x193fff) AM_RAM_WRITE(pf1_rowscroll_w) AM_SHARE("pf1_rowscroll32")
+ AM_RANGE(0x194000, 0x195fff) AM_RAM_WRITE(pf2_rowscroll_w) AM_SHARE("pf2_rowscroll32")
AM_RANGE(0x1a0000, 0x1a001f) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf_control_dword_r, pf_control_dword_w)
AM_RANGE(0x1c2000, 0x1c3fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w)
AM_RANGE(0x1c4000, 0x1c5fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w)
- AM_RANGE(0x1d2000, 0x1d3fff) AM_RAM_WRITE(deco32_pf3_rowscroll_w) AM_SHARE("pf3_rowscroll32")
- AM_RANGE(0x1d4000, 0x1d5fff) AM_RAM_WRITE(deco32_pf4_rowscroll_w) AM_SHARE("pf4_rowscroll32")
+ AM_RANGE(0x1d2000, 0x1d3fff) AM_RAM_WRITE(pf3_rowscroll_w) AM_SHARE("pf3_rowscroll32")
+ AM_RANGE(0x1d4000, 0x1d5fff) AM_RAM_WRITE(pf4_rowscroll_w) AM_SHARE("pf4_rowscroll32")
AM_RANGE(0x1e0000, 0x1e001f) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf_control_dword_r, pf_control_dword_w)
AM_RANGE(0x16c000, 0x16c01f) AM_READNOP
@@ -748,24 +746,24 @@ static ADDRESS_MAP_START( fghthsta_memmap, AS_PROGRAM, 32, deco32_state )
AM_RANGE(0x140000, 0x140003) AM_WRITENOP /* VBL irq ack */
AM_RANGE(0x150000, 0x150003) AM_WRITE(fghthist_eeprom_w) /* Volume port/Eprom */
- AM_RANGE(0x168000, 0x169fff) AM_RAM_WRITE(deco32_buffered_palette_w) AM_SHARE("paletteram")
- AM_RANGE(0x16c008, 0x16c00b) AM_WRITE(deco32_palette_dma_w)
+ AM_RANGE(0x168000, 0x169fff) AM_RAM_WRITE(buffered_palette_w) AM_SHARE("paletteram")
+ AM_RANGE(0x16c008, 0x16c00b) AM_WRITE(palette_dma_w)
AM_RANGE(0x16c010, 0x16c013) AM_READNOP
- AM_RANGE(0x178000, 0x179fff) AM_READWRITE(deco32_spriteram_r, deco32_spriteram_w)
- AM_RANGE(0x17c010, 0x17c013) AM_WRITE(deco32_buffer_spriteram_w)
+ AM_RANGE(0x178000, 0x179fff) AM_READWRITE(spriteram_r, spriteram_w)
+ AM_RANGE(0x17c010, 0x17c013) AM_WRITE(buffer_spriteram_w)
AM_RANGE(0x17c020, 0x17c023) AM_READNOP
AM_RANGE(0x182000, 0x183fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w)
AM_RANGE(0x184000, 0x185fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w)
- AM_RANGE(0x192000, 0x193fff) AM_RAM_WRITE(deco32_pf1_rowscroll_w) AM_SHARE("pf1_rowscroll32")
- AM_RANGE(0x194000, 0x195fff) AM_RAM_WRITE(deco32_pf2_rowscroll_w) AM_SHARE("pf2_rowscroll32")
+ AM_RANGE(0x192000, 0x193fff) AM_RAM_WRITE(pf1_rowscroll_w) AM_SHARE("pf1_rowscroll32")
+ AM_RANGE(0x194000, 0x195fff) AM_RAM_WRITE(pf2_rowscroll_w) AM_SHARE("pf2_rowscroll32")
AM_RANGE(0x1a0000, 0x1a001f) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf_control_dword_r, pf_control_dword_w)
AM_RANGE(0x1c2000, 0x1c3fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w)
AM_RANGE(0x1c4000, 0x1c5fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w)
- AM_RANGE(0x1d2000, 0x1d3fff) AM_RAM_WRITE(deco32_pf3_rowscroll_w) AM_SHARE("pf3_rowscroll32")
- AM_RANGE(0x1d4000, 0x1d5fff) AM_RAM_WRITE(deco32_pf4_rowscroll_w) AM_SHARE("pf4_rowscroll32")
+ AM_RANGE(0x1d2000, 0x1d3fff) AM_RAM_WRITE(pf3_rowscroll_w) AM_SHARE("pf3_rowscroll32")
+ AM_RANGE(0x1d4000, 0x1d5fff) AM_RAM_WRITE(pf4_rowscroll_w) AM_SHARE("pf4_rowscroll32")
AM_RANGE(0x1e0000, 0x1e001f) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf_control_dword_r, pf_control_dword_w)
AM_RANGE(0x200000, 0x207fff) AM_READWRITE(fghthist_protection_region_0_146_r, fghthist_protection_region_0_146_w) AM_SHARE("prot32ram") // only maps on 16-bits
@@ -790,7 +788,7 @@ WRITE16_MEMBER( deco32_state::dg_protection_region_0_146_w )
m_deco146->write_data( space, deco146_addr, data, mem_mask, cs );
}
-READ32_MEMBER( dragngun_state::dragngun_unk_video_r)
+READ32_MEMBER( dragngun_state::unk_video_r)
{
return machine().rand();
}
@@ -803,11 +801,11 @@ static ADDRESS_MAP_START( dragngun_map, AS_PROGRAM, 32, dragngun_state )
// AM_RANGE(0x0120000, 0x0120fff) AM_DEVREAD("ioprot", deco146_device, dragngun_prot_r)
AM_RANGE(0x0120000, 0x0127fff) AM_READWRITE16(dg_protection_region_0_146_r, dg_protection_region_0_146_w, 0x0000ffff)
-// AM_RANGE(0x01204c0, 0x01204c3) AM_WRITE(deco32_sound_w)
- AM_RANGE(0x0128000, 0x012800f) AM_READWRITE(deco32_irq_controller_r, deco32_irq_controller_w)
- AM_RANGE(0x0130000, 0x0131fff) AM_RAM_WRITE(deco32_buffered_palette_w) AM_SHARE("paletteram")
+// AM_RANGE(0x01204c0, 0x01204c3) AM_WRITE(sound_w)
+ AM_RANGE(0x0128000, 0x012800f) AM_READWRITE(irq_controller_r, irq_controller_w)
+ AM_RANGE(0x0130000, 0x0131fff) AM_RAM_WRITE(buffered_palette_w) AM_SHARE("paletteram")
AM_RANGE(0x0138000, 0x0138003) AM_NOP /* Palette dma complete in bit 0x8? ack? return 0 else tight loop */
- AM_RANGE(0x0138008, 0x013800b) AM_WRITE(deco32_palette_dma_w)
+ AM_RANGE(0x0138008, 0x013800b) AM_WRITE(palette_dma_w)
AM_RANGE(0x0170100, 0x0170103) AM_WRITENOP
AM_RANGE(0x0170038, 0x017003b) AM_WRITENOP
@@ -817,41 +815,41 @@ static ADDRESS_MAP_START( dragngun_map, AS_PROGRAM, 32, dragngun_state )
AM_RANGE(0x0180000, 0x018001f) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf_control_dword_r, pf_control_dword_w)
AM_RANGE(0x0190000, 0x0191fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w)
AM_RANGE(0x0194000, 0x0195fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w)
- AM_RANGE(0x01a0000, 0x01a3fff) AM_RAM_WRITE(deco32_pf1_rowscroll_w) AM_SHARE("pf1_rowscroll32")
- AM_RANGE(0x01a4000, 0x01a5fff) AM_RAM_WRITE(deco32_pf2_rowscroll_w) AM_SHARE("pf2_rowscroll32")
+ AM_RANGE(0x01a0000, 0x01a3fff) AM_RAM_WRITE(pf1_rowscroll_w) AM_SHARE("pf1_rowscroll32")
+ AM_RANGE(0x01a4000, 0x01a5fff) AM_RAM_WRITE(pf2_rowscroll_w) AM_SHARE("pf2_rowscroll32")
AM_RANGE(0x01c0000, 0x01c001f) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf_control_dword_r, pf_control_dword_w)
AM_RANGE(0x01d0000, 0x01d1fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w)
AM_RANGE(0x01d4000, 0x01d5fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w) // unused
- AM_RANGE(0x01e0000, 0x01e3fff) AM_RAM_WRITE(deco32_pf3_rowscroll_w) AM_SHARE("pf3_rowscroll32")
- AM_RANGE(0x01e4000, 0x01e5fff) AM_RAM_WRITE(deco32_pf4_rowscroll_w) AM_SHARE("pf4_rowscroll32") // unused
+ AM_RANGE(0x01e0000, 0x01e3fff) AM_RAM_WRITE(pf3_rowscroll_w) AM_SHARE("pf3_rowscroll32")
+ AM_RANGE(0x01e4000, 0x01e5fff) AM_RAM_WRITE(pf4_rowscroll_w) AM_SHARE("pf4_rowscroll32") // unused
AM_RANGE(0x0204800, 0x0204fff) AM_RAM // ace? 0x10 byte increments only // 13f ff stuff
- AM_RANGE(0x0208000, 0x0208fff) AM_RAM AM_SHARE("dragngun_lay0")
- AM_RANGE(0x020c000, 0x020cfff) AM_RAM AM_SHARE("dragngun_lay1")
- AM_RANGE(0x0210000, 0x0217fff) AM_RAM AM_SHARE("dragngun_look0")
- AM_RANGE(0x0218000, 0x021ffff) AM_RAM AM_SHARE("dragngun_look1")
+ AM_RANGE(0x0208000, 0x0208fff) AM_RAM AM_SHARE("lay0")
+ AM_RANGE(0x020c000, 0x020cfff) AM_RAM AM_SHARE("lay1")
+ AM_RANGE(0x0210000, 0x0217fff) AM_RAM AM_SHARE("look0")
+ AM_RANGE(0x0218000, 0x021ffff) AM_RAM AM_SHARE("look1")
AM_RANGE(0x0220000, 0x0221fff) AM_RAM AM_SHARE("spriteram") /* Main spriteram */
AM_RANGE(0x0228000, 0x02283ff) AM_RAM //0x10 byte increments only
- AM_RANGE(0x0230000, 0x0230003) AM_WRITE(dragngun_spriteram_dma_w)
+ AM_RANGE(0x0230000, 0x0230003) AM_WRITE(spriteram_dma_w)
AM_RANGE(0x0300000, 0x03fffff) AM_ROM
AM_RANGE(0x0400000, 0x0400003) AM_DEVREADWRITE8("oki3", okim6295_device, read, write, 0x000000ff)
AM_RANGE(0x0410000, 0x0410003) AM_WRITENOP /* Some kind of serial bit-stream - digital volume control? */
- AM_RANGE(0x0420000, 0x0420003) AM_READWRITE(dragngun_eeprom_r, dragngun_eeprom_w)
- AM_RANGE(0x0438000, 0x0438003) AM_READ(dragngun_lightgun_r)
- AM_RANGE(0x0430000, 0x043001f) AM_WRITE(dragngun_lightgun_w)
- AM_RANGE(0x0440000, 0x0440003) AM_READ(dragngun_service_r)
+ AM_RANGE(0x0420000, 0x0420003) AM_READWRITE(eeprom_r, eeprom_w)
+ AM_RANGE(0x0438000, 0x0438003) AM_READ(lightgun_r)
+ AM_RANGE(0x0430000, 0x043001f) AM_WRITE(lightgun_w)
+ AM_RANGE(0x0440000, 0x0440003) AM_READ(service_r)
- AM_RANGE(0x0500000, 0x0500003) AM_WRITE(dragngun_sprite_control_w)
+ AM_RANGE(0x0500000, 0x0500003) AM_WRITE(sprite_control_w)
// this is clearly the dvi video related area
- AM_RANGE(0x1000000, 0x1000007) AM_READ(dragngun_unk_video_r)
+ AM_RANGE(0x1000000, 0x1000007) AM_READ(unk_video_r)
AM_RANGE(0x1000100, 0x1007fff) AM_RAM
AM_RANGE(0x10b0000, 0x10b01ff) AM_RAM
AM_RANGE(0x1400000, 0x1ffffff) AM_ROM AM_REGION("dvi", 0x00000) // reads from here during boss battles when the videos should be displayed at the offsets where the DVI headers are
@@ -863,14 +861,14 @@ static ADDRESS_MAP_START( lockload_map, AS_PROGRAM, 32, dragngun_state )
AM_RANGE(0x000000, 0x0fffff) AM_ROM
AM_RANGE(0x100000, 0x11ffff) AM_RAM AM_SHARE("ram")
// AM_RANGE(0x120000, 0x120fff) AM_DEVREAD("ioprot", deco146_device, dragngun_prot_r)
-// AM_RANGE(0x1204c0, 0x1204c3) AM_WRITE(deco32_sound_w)
+// AM_RANGE(0x1204c0, 0x1204c3) AM_WRITE(sound_w)
AM_RANGE(0x120000, 0x127fff) AM_READWRITE16(dg_protection_region_0_146_r, dg_protection_region_0_146_w, 0x0000ffff)
- AM_RANGE(0x128000, 0x12800f) AM_READWRITE(deco32_irq_controller_r, deco32_irq_controller_w)
+ AM_RANGE(0x128000, 0x12800f) AM_READWRITE(irq_controller_r, irq_controller_w)
- AM_RANGE(0x130000, 0x131fff) AM_RAM_WRITE(deco32_buffered_palette_w) AM_SHARE("paletteram")
+ AM_RANGE(0x130000, 0x131fff) AM_RAM_WRITE(buffered_palette_w) AM_SHARE("paletteram")
AM_RANGE(0x138000, 0x138003) AM_READONLY AM_WRITENOP //palette dma complete in bit 0x8? ack? return 0 else tight loop
- AM_RANGE(0x138008, 0x13800b) AM_WRITE(deco32_palette_dma_w)
+ AM_RANGE(0x138008, 0x13800b) AM_WRITE(palette_dma_w)
AM_RANGE(0x170000, 0x170007) AM_READ(lockload_gun_mirror_r) /* Not on Dragongun */
AM_RANGE(0x178008, 0x17800f) AM_WRITENOP /* Gun read ACK's */
@@ -878,33 +876,33 @@ static ADDRESS_MAP_START( lockload_map, AS_PROGRAM, 32, dragngun_state )
AM_RANGE(0x180000, 0x18001f) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf_control_dword_r, pf_control_dword_w)
AM_RANGE(0x190000, 0x191fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w)
AM_RANGE(0x194000, 0x195fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w)
- AM_RANGE(0x1a0000, 0x1a3fff) AM_RAM_WRITE(deco32_pf1_rowscroll_w) AM_SHARE("pf1_rowscroll32")
- AM_RANGE(0x1a4000, 0x1a5fff) AM_RAM_WRITE(deco32_pf2_rowscroll_w) AM_SHARE("pf2_rowscroll32")
+ AM_RANGE(0x1a0000, 0x1a3fff) AM_RAM_WRITE(pf1_rowscroll_w) AM_SHARE("pf1_rowscroll32")
+ AM_RANGE(0x1a4000, 0x1a5fff) AM_RAM_WRITE(pf2_rowscroll_w) AM_SHARE("pf2_rowscroll32")
AM_RANGE(0x1c0000, 0x1c001f) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf_control_dword_r, pf_control_dword_w)
AM_RANGE(0x1d0000, 0x1d1fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w)
AM_RANGE(0x1d4000, 0x1d5fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w) // unused
- AM_RANGE(0x1e0000, 0x1e3fff) AM_RAM_WRITE(deco32_pf3_rowscroll_w) AM_SHARE("pf3_rowscroll32")
- AM_RANGE(0x1e4000, 0x1e5fff) AM_RAM_WRITE(deco32_pf4_rowscroll_w) AM_SHARE("pf4_rowscroll32") // unused
+ AM_RANGE(0x1e0000, 0x1e3fff) AM_RAM_WRITE(pf3_rowscroll_w) AM_SHARE("pf3_rowscroll32")
+ AM_RANGE(0x1e4000, 0x1e5fff) AM_RAM_WRITE(pf4_rowscroll_w) AM_SHARE("pf4_rowscroll32") // unused
AM_RANGE(0x204800, 0x204fff) AM_RAM //0x10 byte increments only
- AM_RANGE(0x208000, 0x208fff) AM_RAM AM_SHARE("dragngun_lay0")
- AM_RANGE(0x20c000, 0x20cfff) AM_RAM AM_SHARE("dragngun_lay1")
- AM_RANGE(0x210000, 0x217fff) AM_RAM AM_SHARE("dragngun_look0")
- AM_RANGE(0x218000, 0x21ffff) AM_RAM AM_SHARE("dragngun_look1")
+ AM_RANGE(0x208000, 0x208fff) AM_RAM AM_SHARE("lay0")
+ AM_RANGE(0x20c000, 0x20cfff) AM_RAM AM_SHARE("lay1")
+ AM_RANGE(0x210000, 0x217fff) AM_RAM AM_SHARE("look0")
+ AM_RANGE(0x218000, 0x21ffff) AM_RAM AM_SHARE("look1")
AM_RANGE(0x220000, 0x221fff) AM_RAM AM_SHARE("spriteram") /* Main spriteram */
AM_RANGE(0x228000, 0x2283ff) AM_RAM //0x10 byte increments only
- AM_RANGE(0x230000, 0x230003) AM_WRITE(dragngun_spriteram_dma_w)
+ AM_RANGE(0x230000, 0x230003) AM_WRITE(spriteram_dma_w)
AM_RANGE(0x300000, 0x3fffff) AM_ROM
// AM_RANGE(0x400000, 0x400003) AM_DEVREADWRITE8("oki3", okim6295_device, read, write, 0x000000ff)
- AM_RANGE(0x420000, 0x420003) AM_READWRITE(dragngun_eeprom_r, dragngun_eeprom_w)
-// AM_RANGE(0x430000, 0x43001f) AM_WRITE(dragngun_lightgun_w)
-// AM_RANGE(0x438000, 0x438003) AM_READ(dragngun_lightgun_r)
- AM_RANGE(0x440000, 0x440003) AM_READ(dragngun_service_r)
- AM_RANGE(0x500000, 0x500003) AM_WRITE(dragngun_sprite_control_w)
+ AM_RANGE(0x420000, 0x420003) AM_READWRITE(eeprom_r, eeprom_w)
+// AM_RANGE(0x430000, 0x43001f) AM_WRITE(lightgun_w)
+// AM_RANGE(0x438000, 0x438003) AM_READ(lightgun_r)
+ AM_RANGE(0x440000, 0x440003) AM_READ(service_r)
+ AM_RANGE(0x500000, 0x500003) AM_WRITE(sprite_control_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( tattass_map, AS_PROGRAM, 32, deco32_state )
@@ -918,38 +916,37 @@ static ADDRESS_MAP_START( tattass_map, AS_PROGRAM, 32, deco32_state )
AM_RANGE(0x150000, 0x150003) AM_WRITE(tattass_control_w) /* Volume port/Eprom/Priority */
AM_RANGE(0x162000, 0x162fff) AM_RAM /* 'Jack' RAM!? */
- AM_RANGE(0x163000, 0x16309f) AM_RAM_WRITE(deco32_ace_ram_w) AM_SHARE("ace_ram")
+ AM_RANGE(0x163000, 0x16309f) AM_RAM_WRITE(ace_ram_w) AM_SHARE("ace_ram")
AM_RANGE(0x164000, 0x164003) AM_WRITENOP /* Palette control BG2/3 ($1a constant) */
AM_RANGE(0x164004, 0x164007) AM_WRITENOP /* Palette control Obj1 ($6 constant) */
AM_RANGE(0x164008, 0x16400b) AM_WRITENOP /* Palette control Obj2 ($5 constant) */
AM_RANGE(0x16400c, 0x16400f) AM_WRITENOP
- AM_RANGE(0x168000, 0x169fff) AM_RAM_WRITE(deco32_buffered_palette_w) AM_SHARE("paletteram")
+ AM_RANGE(0x168000, 0x169fff) AM_RAM_WRITE(buffered_palette_w) AM_SHARE("paletteram")
AM_RANGE(0x16c000, 0x16c003) AM_WRITENOP
- AM_RANGE(0x16c008, 0x16c00b) AM_WRITE(deco32_palette_dma_w)
+ AM_RANGE(0x16c008, 0x16c00b) AM_WRITE(palette_dma_w)
- AM_RANGE(0x170000, 0x171fff) AM_READWRITE(deco32_spriteram_r, deco32_spriteram_w)
+ AM_RANGE(0x170000, 0x171fff) AM_READWRITE(spriteram_r, spriteram_w)
AM_RANGE(0x174000, 0x174003) AM_WRITENOP /* Sprite DMA mode (2) */
- AM_RANGE(0x174010, 0x174013) AM_WRITE(deco32_buffer_spriteram_w)
+ AM_RANGE(0x174010, 0x174013) AM_WRITE(buffer_spriteram_w)
AM_RANGE(0x174018, 0x17401b) AM_WRITENOP /* Sprite 'CPU' (unused) */
- AM_RANGE(0x178000, 0x179fff) AM_READWRITE(deco32_spriteram2_r, deco32_spriteram2_w)
+ AM_RANGE(0x178000, 0x179fff) AM_READWRITE(spriteram2_r, spriteram2_w)
AM_RANGE(0x17c000, 0x17c003) AM_WRITENOP /* Sprite DMA mode (2) */
- AM_RANGE(0x17c010, 0x17c013) AM_WRITE(deco32_buffer_spriteram2_w)
+ AM_RANGE(0x17c010, 0x17c013) AM_WRITE(buffer_spriteram2_w)
AM_RANGE(0x17c018, 0x17c01b) AM_WRITENOP /* Sprite 'CPU' (unused) */
AM_RANGE(0x182000, 0x183fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w)
AM_RANGE(0x184000, 0x185fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w)
- AM_RANGE(0x192000, 0x193fff) AM_RAM_WRITE(deco32_pf1_rowscroll_w) AM_SHARE("pf1_rowscroll32")
- AM_RANGE(0x194000, 0x195fff) AM_RAM_WRITE(deco32_pf2_rowscroll_w) AM_SHARE("pf2_rowscroll32")
+ AM_RANGE(0x192000, 0x193fff) AM_RAM_WRITE(pf1_rowscroll_w) AM_SHARE("pf1_rowscroll32")
+ AM_RANGE(0x194000, 0x195fff) AM_RAM_WRITE(pf2_rowscroll_w) AM_SHARE("pf2_rowscroll32")
AM_RANGE(0x1a0000, 0x1a001f) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf_control_dword_r, pf_control_dword_w)
AM_RANGE(0x1c2000, 0x1c3fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w)
AM_RANGE(0x1c4000, 0x1c5fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w)
- AM_RANGE(0x1d2000, 0x1d3fff) AM_RAM_WRITE(deco32_pf3_rowscroll_w) AM_SHARE("pf3_rowscroll32")
- AM_RANGE(0x1d4000, 0x1d5fff) AM_RAM_WRITE(deco32_pf4_rowscroll_w) AM_SHARE("pf4_rowscroll32")
+ AM_RANGE(0x1d2000, 0x1d3fff) AM_RAM_WRITE(pf3_rowscroll_w) AM_SHARE("pf3_rowscroll32")
+ AM_RANGE(0x1d4000, 0x1d5fff) AM_RAM_WRITE(pf4_rowscroll_w) AM_SHARE("pf4_rowscroll32")
AM_RANGE(0x1e0000, 0x1e001f) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf_control_dword_r, pf_control_dword_w)
-// AM_RANGE(0x200000, 0x200fff) AM_READWRITE(tattass_prot_r, tattass_prot_w) AM_SHARE("prot32ram")
AM_RANGE(0x200000, 0x207fff) AM_READWRITE16(nslasher_protection_region_0_104_r, nslasher_protection_region_0_104_w, 0xffff0000)
AM_RANGE(0x200000, 0x207fff) AM_READ16(nslasher_debug_r, 0x0000ffff)
ADDRESS_MAP_END
@@ -984,38 +981,37 @@ static ADDRESS_MAP_START( nslasher_map, AS_PROGRAM, 32, deco32_state )
AM_RANGE(0x140000, 0x140003) AM_WRITENOP /* Vblank ack */
AM_RANGE(0x150000, 0x150003) AM_WRITE(nslasher_eeprom_w) /* Volume port/Eprom/Priority */
- AM_RANGE(0x163000, 0x16309f) AM_RAM_WRITE(deco32_ace_ram_w) AM_SHARE("ace_ram") /* 'Ace' RAM!? */
+ AM_RANGE(0x163000, 0x16309f) AM_RAM_WRITE(ace_ram_w) AM_SHARE("ace_ram") /* 'Ace' RAM!? */
AM_RANGE(0x164000, 0x164003) AM_WRITENOP /* Palette control BG2/3 ($1a constant) */
AM_RANGE(0x164004, 0x164007) AM_WRITENOP /* Palette control Obj1 ($4 constant) */
AM_RANGE(0x164008, 0x16400b) AM_WRITENOP /* Palette control Obj2 ($6 constant) */
AM_RANGE(0x16400c, 0x16400f) AM_WRITENOP
- AM_RANGE(0x168000, 0x169fff) AM_RAM_WRITE(deco32_buffered_palette_w) AM_SHARE("paletteram")
+ AM_RANGE(0x168000, 0x169fff) AM_RAM_WRITE(buffered_palette_w) AM_SHARE("paletteram")
AM_RANGE(0x16c000, 0x16c003) AM_WRITENOP
- AM_RANGE(0x16c008, 0x16c00b) AM_WRITE(deco32_palette_dma_w)
+ AM_RANGE(0x16c008, 0x16c00b) AM_WRITE(palette_dma_w)
- AM_RANGE(0x170000, 0x171fff) AM_READWRITE(deco32_spriteram_r, deco32_spriteram_w)
+ AM_RANGE(0x170000, 0x171fff) AM_READWRITE(spriteram_r, spriteram_w)
AM_RANGE(0x174000, 0x174003) AM_WRITENOP /* Sprite DMA mode (2) */
- AM_RANGE(0x174010, 0x174013) AM_WRITE(deco32_buffer_spriteram_w)
+ AM_RANGE(0x174010, 0x174013) AM_WRITE(buffer_spriteram_w)
AM_RANGE(0x174018, 0x17401b) AM_WRITENOP /* Sprite 'CPU' (unused) */
- AM_RANGE(0x178000, 0x179fff) AM_READWRITE(deco32_spriteram2_r, deco32_spriteram2_w)
+ AM_RANGE(0x178000, 0x179fff) AM_READWRITE(spriteram2_r, spriteram2_w)
AM_RANGE(0x17c000, 0x17c003) AM_WRITENOP /* Sprite DMA mode (2) */
- AM_RANGE(0x17c010, 0x17c013) AM_WRITE(deco32_buffer_spriteram2_w)
+ AM_RANGE(0x17c010, 0x17c013) AM_WRITE(buffer_spriteram2_w)
AM_RANGE(0x17c018, 0x17c01b) AM_WRITENOP /* Sprite 'CPU' (unused) */
AM_RANGE(0x182000, 0x183fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w)
AM_RANGE(0x184000, 0x185fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w)
- AM_RANGE(0x192000, 0x193fff) AM_RAM_WRITE(deco32_pf1_rowscroll_w) AM_SHARE("pf1_rowscroll32")
- AM_RANGE(0x194000, 0x195fff) AM_RAM_WRITE(deco32_pf2_rowscroll_w) AM_SHARE("pf2_rowscroll32")
+ AM_RANGE(0x192000, 0x193fff) AM_RAM_WRITE(pf1_rowscroll_w) AM_SHARE("pf1_rowscroll32")
+ AM_RANGE(0x194000, 0x195fff) AM_RAM_WRITE(pf2_rowscroll_w) AM_SHARE("pf2_rowscroll32")
AM_RANGE(0x1a0000, 0x1a001f) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf_control_dword_r, pf_control_dword_w)
AM_RANGE(0x1c2000, 0x1c3fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w)
AM_RANGE(0x1c4000, 0x1c5fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w)
- AM_RANGE(0x1d2000, 0x1d3fff) AM_RAM_WRITE(deco32_pf3_rowscroll_w) AM_SHARE("pf3_rowscroll32")
- AM_RANGE(0x1d4000, 0x1d5fff) AM_RAM_WRITE(deco32_pf4_rowscroll_w) AM_SHARE("pf4_rowscroll32")
+ AM_RANGE(0x1d2000, 0x1d3fff) AM_RAM_WRITE(pf3_rowscroll_w) AM_SHARE("pf3_rowscroll32")
+ AM_RANGE(0x1d4000, 0x1d5fff) AM_RAM_WRITE(pf4_rowscroll_w) AM_SHARE("pf4_rowscroll32")
AM_RANGE(0x1e0000, 0x1e001f) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf_control_dword_r, pf_control_dword_w)
-// AM_RANGE(0x200000, 0x200fff) AM_READWRITE(nslasher_prot_r, nslasher_prot_w) AM_SHARE("prot32ram")
AM_RANGE(0x200000, 0x207fff) AM_READWRITE16(nslasher_protection_region_0_104_r, nslasher_protection_region_0_104_w, 0xffff0000)
AM_RANGE(0x200000, 0x207fff) AM_READ16(nslasher_debug_r, 0x0000ffff) // seems to be debug switches / code activated by this?
@@ -1694,7 +1690,6 @@ static MACHINE_CONFIG_START( captaven, deco32_state )
MCFG_SCREEN_SIZE(42*8, 32*8)
MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
MCFG_SCREEN_UPDATE_DRIVER(deco32_state, screen_update_captaven)
- MCFG_SCREEN_VBLANK_DRIVER(deco32_state, screen_eof_captaven)
MCFG_SCREEN_PALETTE("palette")
MCFG_GFXDECODE_ADD("gfxdecode", "palette", captaven)
@@ -1989,7 +1984,6 @@ static MACHINE_CONFIG_START( dragngun, dragngun_state )
MCFG_SCREEN_SIZE(42*8, 32*8)
MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
MCFG_SCREEN_UPDATE_DRIVER(dragngun_state, screen_update_dragngun)
- MCFG_SCREEN_VBLANK_DRIVER(dragngun_state, screen_eof_dragngun)
//MCFG_SCREEN_PALETTE("palette")
MCFG_BUFFERED_SPRITERAM32_ADD("spriteram")
@@ -2062,7 +2056,7 @@ static MACHINE_CONFIG_START( dragngun, dragngun_state )
MACHINE_CONFIG_END
-TIMER_DEVICE_CALLBACK_MEMBER(deco32_state::lockload_vbl_irq)
+TIMER_DEVICE_CALLBACK_MEMBER(dragngun_state::lockload_vbl_irq)
{
int scanline = param;
@@ -2085,7 +2079,7 @@ static MACHINE_CONFIG_START( lockload, dragngun_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", ARM, 28000000/4)
MCFG_CPU_PROGRAM_MAP(lockload_map)
- MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", deco32_state, lockload_vbl_irq, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", dragngun_state, lockload_vbl_irq, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80, 32220000/8)
MCFG_CPU_PROGRAM_MAP(nslasher_sound)
@@ -2104,7 +2098,6 @@ static MACHINE_CONFIG_START( lockload, dragngun_state )
MCFG_SCREEN_SIZE(42*8, 32*8+22)
MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1)
MCFG_SCREEN_UPDATE_DRIVER(dragngun_state, screen_update_dragngun)
- MCFG_SCREEN_VBLANK_DRIVER(dragngun_state, screen_eof_dragngun)
MCFG_BUFFERED_SPRITERAM32_ADD("spriteram")
@@ -3650,10 +3643,15 @@ DRIVER_INIT_MEMBER(deco32_state,captaven)
{
deco56_decrypt_gfx(machine(), "gfx1");
deco56_decrypt_gfx(machine(), "gfx2");
+
+ save_item(NAME(m_raster_enable));
+ save_item(NAME(m_nslasher_sound_irq));
+ save_item(NAME(m_irq_source));
}
extern void process_dvi_data(UINT8* dvi_data, int offset, int regionsize);
-void dragngun_state::init_dragngun_common()
+
+void dragngun_state::dragngun_init_common()
{
const UINT8 *SRC_RAM = memregion("gfx1")->base();
UINT8 *DST_RAM = memregion("gfx2")->base();
@@ -3681,6 +3679,10 @@ void dragngun_state::init_dragngun_common()
}
#endif
+ save_item(NAME(m_lightgun_port));
+ save_item(NAME(m_raster_enable));
+ save_item(NAME(m_irq_source));
+
// there are DVI headers at 0x000000, 0x580000, 0x800000, 0xB10000, 0xB80000
// process_dvi_data(memregion("dvi")->base(),0x000000, 0x1000000);
// process_dvi_data(memregion("dvi")->base(),0x580000, 0x1000000);
@@ -3691,7 +3693,7 @@ void dragngun_state::init_dragngun_common()
DRIVER_INIT_MEMBER(dragngun_state,dragngun)
{
- init_dragngun_common();
+ dragngun_init_common();
UINT32 *ROM = (UINT32 *)memregion("maincpu")->base();
ROM[0x1b32c/4]=0xe1a00000; // bl $ee000: NOP test switch lock
@@ -3699,7 +3701,7 @@ DRIVER_INIT_MEMBER(dragngun_state,dragngun)
DRIVER_INIT_MEMBER(dragngun_state,dragngunj)
{
- init_dragngun_common();
+ dragngun_init_common();
UINT32 *ROM = (UINT32 *)memregion("maincpu")->base();
ROM[0x1a1b4/4]=0xe1a00000; // bl $ee000: NOP test switch lock
@@ -3723,6 +3725,10 @@ DRIVER_INIT_MEMBER(dragngun_state,lockload)
memcpy(RAM+0x300000,RAM+0x100000,0x100000);
memset(RAM+0x100000,0,0x100000);
+
+ save_item(NAME(m_raster_enable));
+ save_item(NAME(m_nslasher_sound_irq));
+ save_item(NAME(m_irq_source));
// ROM[0x3fe3c0/4]=0xe1a00000;// NOP test switch lock
// ROM[0x3fe3cc/4]=0xe1a00000;// NOP test switch lock
@@ -3746,6 +3752,14 @@ DRIVER_INIT_MEMBER(deco32_state,tattass)
deco56_decrypt_gfx(machine(), "gfx1"); /* 141 */
deco56_decrypt_gfx(machine(), "gfx2"); /* 141 */
+
+ save_item(NAME(m_tattass_eprom_bit));
+ save_item(NAME(m_lastClock));
+ save_item(NAME(m_buffer));
+ save_item(NAME(m_bufPtr));
+ save_item(NAME(m_pendingCommand));
+ save_item(NAME(m_readBitCount));
+ save_item(NAME(m_byteAddr));
}
DRIVER_INIT_MEMBER(deco32_state,nslasher)
@@ -3769,6 +3783,8 @@ DRIVER_INIT_MEMBER(deco32_state,nslasher)
deco156_decrypt(machine());
soundlatch_setclearedvalue(0xff);
+
+ save_item(NAME(m_nslasher_sound_irq));
/* The board for Night Slashers is very close to the Fighter's History and
Tattoo Assassins boards, but has an encrypted ARM cpu. */
@@ -3776,35 +3792,35 @@ DRIVER_INIT_MEMBER(deco32_state,nslasher)
/**********************************************************************************/
-GAME( 1991, captaven, 0, captaven, captaven, deco32_state, captaven, ROT0, "Data East Corporation", "Captain America and The Avengers (Asia Rev 1.4)", 0 )
-GAME( 1991, captavena, captaven, captaven, captaven, deco32_state, captaven, ROT0, "Data East Corporation", "Captain America and The Avengers (Asia Rev 1.0)", 0 )
-GAME( 1991, captavene, captaven, captaven, captaven, deco32_state, captaven, ROT0, "Data East Corporation", "Captain America and The Avengers (UK Rev 1.4)", 0 )
-GAME( 1991, captavenu, captaven, captaven, captaven, deco32_state, captaven, ROT0, "Data East Corporation", "Captain America and The Avengers (US Rev 1.9)", 0 )
-GAME( 1991, captavenuu, captaven, captaven, captaven, deco32_state, captaven, ROT0, "Data East Corporation", "Captain America and The Avengers (US Rev 1.6)", 0 )
-GAME( 1991, captavenua, captaven, captaven, captaven, deco32_state, captaven, ROT0, "Data East Corporation", "Captain America and The Avengers (US Rev 1.4)", 0 )
-GAME( 1991, captavenj, captaven, captaven, captaven, deco32_state, captaven, ROT0, "Data East Corporation", "Captain America and The Avengers (Japan Rev 0.2)", 0 )
+GAME( 1991, captaven, 0, captaven, captaven, deco32_state, captaven, ROT0, "Data East Corporation", "Captain America and The Avengers (Asia Rev 1.4)", GAME_SUPPORTS_SAVE )
+GAME( 1991, captavena, captaven, captaven, captaven, deco32_state, captaven, ROT0, "Data East Corporation", "Captain America and The Avengers (Asia Rev 1.0)", GAME_SUPPORTS_SAVE )
+GAME( 1991, captavene, captaven, captaven, captaven, deco32_state, captaven, ROT0, "Data East Corporation", "Captain America and The Avengers (UK Rev 1.4)", GAME_SUPPORTS_SAVE )
+GAME( 1991, captavenu, captaven, captaven, captaven, deco32_state, captaven, ROT0, "Data East Corporation", "Captain America and The Avengers (US Rev 1.9)", GAME_SUPPORTS_SAVE )
+GAME( 1991, captavenuu, captaven, captaven, captaven, deco32_state, captaven, ROT0, "Data East Corporation", "Captain America and The Avengers (US Rev 1.6)", GAME_SUPPORTS_SAVE )
+GAME( 1991, captavenua, captaven, captaven, captaven, deco32_state, captaven, ROT0, "Data East Corporation", "Captain America and The Avengers (US Rev 1.4)", GAME_SUPPORTS_SAVE )
+GAME( 1991, captavenj, captaven, captaven, captaven, deco32_state, captaven, ROT0, "Data East Corporation", "Captain America and The Avengers (Japan Rev 0.2)", GAME_SUPPORTS_SAVE )
-GAME( 1993, fghthist, 0, fghthist, fghthist, deco32_state, fghthist, ROT0, "Data East Corporation", "Fighter's History (World ver 43-07, DE-0380-2 PCB)", 0 )
-GAME( 1993, fghthistu, fghthist, fghthsta, fghthist, deco32_state, fghthist, ROT0, "Data East Corporation", "Fighter's History (US ver 42-06, DE-0395-1 PCB)", 0 )
-GAME( 1993, fghthistua, fghthist, fghthsta, fghthist, deco32_state, fghthist, ROT0, "Data East Corporation", "Fighter's History (US ver 42-05, DE-0395-1 PCB)", 0 )
-GAME( 1993, fghthistub, fghthist, fghthist, fghthist, deco32_state, fghthist, ROT0, "Data East Corporation", "Fighter's History (US ver 42-03, DE-0380-2 PCB)", 0 )
-GAME( 1993, fghthistj, fghthist, fghthsta, fghthist, deco32_state, fghthist, ROT0, "Data East Corporation", "Fighter's History (Japan ver 41-07, DE-0395-1 PCB)", 0 )
-GAME( 1993, fghthistja, fghthist, fghthist, fghthist, deco32_state, fghthist, ROT0, "Data East Corporation", "Fighter's History (Japan ver 41-05, DE-0380-2 PCB)", 0 )
-GAME( 1993, fghthistjb, fghthist, fghthist, fghthist, deco32_state, fghthist, ROT0, "Data East Corporation", "Fighter's History (Japan ver 41-04, DE-0380-1 PCB)", 0 )
+GAME( 1993, fghthist, 0, fghthist, fghthist, deco32_state, fghthist, ROT0, "Data East Corporation", "Fighter's History (World ver 43-07, DE-0380-2 PCB)", GAME_SUPPORTS_SAVE )
+GAME( 1993, fghthistu, fghthist, fghthsta, fghthist, deco32_state, fghthist, ROT0, "Data East Corporation", "Fighter's History (US ver 42-06, DE-0395-1 PCB)", GAME_SUPPORTS_SAVE )
+GAME( 1993, fghthistua, fghthist, fghthsta, fghthist, deco32_state, fghthist, ROT0, "Data East Corporation", "Fighter's History (US ver 42-05, DE-0395-1 PCB)", GAME_SUPPORTS_SAVE )
+GAME( 1993, fghthistub, fghthist, fghthist, fghthist, deco32_state, fghthist, ROT0, "Data East Corporation", "Fighter's History (US ver 42-03, DE-0380-2 PCB)", GAME_SUPPORTS_SAVE )
+GAME( 1993, fghthistj, fghthist, fghthsta, fghthist, deco32_state, fghthist, ROT0, "Data East Corporation", "Fighter's History (Japan ver 41-07, DE-0395-1 PCB)", GAME_SUPPORTS_SAVE )
+GAME( 1993, fghthistja, fghthist, fghthist, fghthist, deco32_state, fghthist, ROT0, "Data East Corporation", "Fighter's History (Japan ver 41-05, DE-0380-2 PCB)", GAME_SUPPORTS_SAVE )
+GAME( 1993, fghthistjb, fghthist, fghthist, fghthist, deco32_state, fghthist, ROT0, "Data East Corporation", "Fighter's History (Japan ver 41-04, DE-0380-1 PCB)", GAME_SUPPORTS_SAVE )
-GAME( 1994, nslasher, 0, nslasher, nslasher, deco32_state, nslasher, ROT0, "Data East Corporation", "Night Slashers (Korea Rev 1.3)", GAME_IMPERFECT_GRAPHICS )
-GAME( 1994, nslasherj, nslasher, nslasher, nslasher, deco32_state, nslasher, ROT0, "Data East Corporation", "Night Slashers (Japan Rev 1.2)", GAME_IMPERFECT_GRAPHICS )
-GAME( 1994, nslashers, nslasher, nslasher, nslasher, deco32_state, nslasher, ROT0, "Data East Corporation", "Night Slashers (Over Sea Rev 1.2)", GAME_IMPERFECT_GRAPHICS )
-GAME( 1994, nslasheru, nslasher, nslasheru,nslasher, deco32_state, nslasher, ROT0, "Data East Corporation", "Night Slashers (US Rev 1.2, HuC6280 Sound CPU)", GAME_IMPERFECT_GRAPHICS )
+GAME( 1994, nslasher, 0, nslasher, nslasher, deco32_state, nslasher, ROT0, "Data East Corporation", "Night Slashers (Korea Rev 1.3)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
+GAME( 1994, nslasherj, nslasher, nslasher, nslasher, deco32_state, nslasher, ROT0, "Data East Corporation", "Night Slashers (Japan Rev 1.2)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
+GAME( 1994, nslashers, nslasher, nslasher, nslasher, deco32_state, nslasher, ROT0, "Data East Corporation", "Night Slashers (Over Sea Rev 1.2)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
+GAME( 1994, nslasheru, nslasher, nslasheru,nslasher, deco32_state, nslasher, ROT0, "Data East Corporation", "Night Slashers (US Rev 1.2, HuC6280 Sound CPU)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
-GAME( 1994, tattass, 0, tattass, tattass, deco32_state, tattass, ROT0, "Data East Pinball", "Tattoo Assassins (US prototype)", GAME_IMPERFECT_GRAPHICS )
-GAME( 1994, tattassa, tattass, tattass, tattass, deco32_state, tattass, ROT0, "Data East Pinball", "Tattoo Assassins (Asia prototype)", GAME_IMPERFECT_GRAPHICS )
+GAME( 1994, tattass, 0, tattass, tattass, deco32_state, tattass, ROT0, "Data East Pinball", "Tattoo Assassins (US prototype)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
+GAME( 1994, tattassa, tattass, tattass, tattass, deco32_state, tattass, ROT0, "Data East Pinball", "Tattoo Assassins (Asia prototype)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
// Dragon Gun / Lock 'n' Loaded have very different sprite hardware
-GAME( 1993, dragngun, 0, dragngun, dragngun, dragngun_state, dragngun, ROT0, "Data East Corporation", "Dragon Gun (US)", GAME_IMPERFECT_GRAPHICS )
-GAME( 1993, dragngunj, dragngun, dragngun, dragngun, dragngun_state, dragngunj, ROT0, "Data East Corporation", "Dragon Gun (Japan)", GAME_IMPERFECT_GRAPHICS )
+GAME( 1993, dragngun, 0, dragngun, dragngun, dragngun_state, dragngun, ROT0, "Data East Corporation", "Dragon Gun (US)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
+GAME( 1993, dragngunj, dragngun, dragngun, dragngun, dragngun_state, dragngunj, ROT0, "Data East Corporation", "Dragon Gun (Japan)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
-GAME( 1994, lockload, 0, lockload, lockload, dragngun_state, lockload, ROT0, "Data East Corporation", "Locked 'n Loaded (World)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
-GAME( 1994, gunhard, lockload, lockload, lockload, dragngun_state, lockload, ROT0, "Data East Corporation", "Gun Hard (Japan)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
-GAME( 1994, lockloadu, lockload, lockloadu,lockload, dragngun_state, lockload, ROT0, "Data East Corporation", "Locked 'n Loaded (US, Dragon Gun conversion)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) // HuC6280 Sound CPU
+GAME( 1994, lockload, 0, lockload, lockload, dragngun_state, lockload, ROT0, "Data East Corporation", "Locked 'n Loaded (World)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
+GAME( 1994, gunhard, lockload, lockload, lockload, dragngun_state, lockload, ROT0, "Data East Corporation", "Gun Hard (Japan)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
+GAME( 1994, lockloadu, lockload, lockloadu,lockload, dragngun_state, lockload, ROT0, "Data East Corporation", "Locked 'n Loaded (US, Dragon Gun conversion)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) // HuC6280 Sound CPU
diff --git a/src/mame/drivers/dietgo.c b/src/mame/drivers/dietgo.c
index ce9ac1a75ff..c26414b78a8 100644
--- a/src/mame/drivers/dietgo.c
+++ b/src/mame/drivers/dietgo.c
@@ -60,6 +60,10 @@ static ADDRESS_MAP_START( dietgo_map, AS_PROGRAM, 16, dietgo_state )
AM_RANGE(0x380000, 0x38ffff) AM_RAM // mainram
ADDRESS_MAP_END
+static ADDRESS_MAP_START( decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 16, dietgo_state )
+ AM_RANGE(0x000000, 0x07ffff) AM_ROM AM_SHARE("decrypted_opcodes")
+ADDRESS_MAP_END
+
/* Physical memory map (21 bits) */
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, dietgo_state )
@@ -205,6 +209,7 @@ static MACHINE_CONFIG_START( dietgo, dietgo_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, XTAL_28MHz/2) /* DE102 (verified on pcb) */
MCFG_CPU_PROGRAM_MAP(dietgo_map)
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", dietgo_state, irq6_line_hold)
MCFG_CPU_ADD("audiocpu", H6280, XTAL_32_22MHz/4/3) /* Custom chip 45; XIN is 32.220MHZ/4, verified on pcb */
@@ -365,7 +370,7 @@ ROM_END
DRIVER_INIT_MEMBER(dietgo_state,dietgo)
{
deco56_decrypt_gfx(machine(), "gfx1");
- deco102_decrypt_cpu(machine(), "maincpu", 0xe9ba, 0x01, 0x19);
+ deco102_decrypt_cpu((UINT16 *)memregion("maincpu")->base(), m_decrypted_opcodes, 0x80000, 0xe9ba, 0x01, 0x19);
}
GAME( 1992, dietgo, 0, dietgo, dietgo, dietgo_state, dietgo, ROT0, "Data East Corporation", "Diet Go Go (Euro v1.1 1992.09.26)", GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/dmndrby.c b/src/mame/drivers/dmndrby.c
index 3094ff3450e..988e014330b 100644
--- a/src/mame/drivers/dmndrby.c
+++ b/src/mame/drivers/dmndrby.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Angelo Salese, David Haywood, Mike Green
/*******************************************************************************************
diff --git a/src/mame/drivers/dreamwld.c b/src/mame/drivers/dreamwld.c
index ec8ddb5935f..e1c1dff8fd3 100644
--- a/src/mame/drivers/dreamwld.c
+++ b/src/mame/drivers/dreamwld.c
@@ -5,10 +5,11 @@
SemiCom 68020 based hardware
Driver by David Haywood
-Baryon - Future Assault (c) 1997 SemiCom
-Cute Fighter (c) 1998 SemiCom
-Rolling Crush (c) 1999 Trust / SemiCom
-Dream World (c) 2000 SemiCom
+Baryon - Future Assault (c) 1997 SemiCom / Tirano
+Cute Fighter (c) 1998 SemiCom
+Rolling Crush (c) 1999 Trust / SemiCom
+Gaia - The Last Choice of Earth (c) 1999 SemiCom / XESS
+Dream World (c) 2000 SemiCom
Note: There is a SemiCom game known as Lode Quest 1998(?). This game is very similar to Dream World.
It's not known if Lode Quest is a alternate title or a prequel of Dream World.
@@ -121,6 +122,11 @@ public:
required_shared_ptr<UINT32> m_vregs;
required_shared_ptr<UINT32> m_workram;
+ UINT16* m_lineram16;
+
+ DECLARE_READ16_MEMBER(lineram16_r) { return m_lineram16[offset]; }
+ DECLARE_WRITE16_MEMBER(lineram16_w) { COMBINE_DATA(&m_lineram16[offset]); }
+
/* video-related */
tilemap_t *m_bg_tilemap;
tilemap_t *m_bg2_tilemap;
@@ -158,6 +164,7 @@ void dreamwld_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &clipre
UINT32 *source = m_spritebuf1;
UINT32 *finish = m_spritebuf1 + 0x1000 / 4;
UINT16 *redirect = (UINT16 *)memregion("spritelut")->base();
+ int xoffset = 4;
while (source < finish)
{
@@ -181,6 +188,9 @@ void dreamwld_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &clipre
xinc = 16;
yinc = 16;
+ xpos += xoffset;
+ xpos &= 0x1ff;
+
if (xflip)
{
xinc = -16;
@@ -251,19 +261,21 @@ TILE_GET_INFO_MEMBER(dreamwld_state::get_dreamwld_bg2_tile_info)
void dreamwld_state::video_start()
{
- m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dreamwld_state::get_dreamwld_bg_tile_info),this),TILEMAP_SCAN_ROWS, 16, 16, 64,32);
- m_bg2_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dreamwld_state::get_dreamwld_bg2_tile_info),this),TILEMAP_SCAN_ROWS, 16, 16, 64,32);
+ m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dreamwld_state::get_dreamwld_bg_tile_info),this),TILEMAP_SCAN_ROWS, 16, 16, 64,64);
+ m_bg2_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(dreamwld_state::get_dreamwld_bg2_tile_info),this),TILEMAP_SCAN_ROWS, 16, 16, 64,64);
m_bg2_tilemap->set_transparent_pen(0);
- m_bg_tilemap->set_scroll_rows(256); // line scrolling
+ m_bg_tilemap->set_scroll_rows(64*16); // line scrolling
m_bg_tilemap->set_scroll_cols(1);
- m_bg2_tilemap->set_scroll_rows(256); // line scrolling
+ m_bg2_tilemap->set_scroll_rows(64*16); // line scrolling
m_bg2_tilemap->set_scroll_cols(1);
m_spritebuf1 = auto_alloc_array(machine(), UINT32, 0x2000 / 4);
m_spritebuf2 = auto_alloc_array(machine(), UINT32, 0x2000 / 4);
+ m_lineram16 = (UINT16*)auto_alloc_array_clear(this->machine(), UINT16, 0x400 / 2);
+ save_pointer(NAME(m_lineram16), 0x400/2);
}
@@ -287,13 +299,31 @@ UINT32 dreamwld_state::screen_update_dreamwld(screen_device &screen, bitmap_ind1
tmptilemap0 = m_bg_tilemap;
tmptilemap1 = m_bg2_tilemap;
- int layer0_scrolly = m_vregs[(0x400 / 4)] + 32;
- int layer1_scrolly = m_vregs[(0x400 / 4) + 2] + 32;
+ int layer0_scrolly = m_vregs[(0x000 / 4)]+32;
+ int layer1_scrolly = m_vregs[(0x008 / 4)]+32;
+
+ int layer0_scrollx = m_vregs[(0x004 / 4)] + 0;
+ int layer1_scrollx = m_vregs[(0x00c / 4)] + 2;
+
+ UINT32 layer0_ctrl = m_vregs[0x010 / 4];
+ UINT32 layer1_ctrl = m_vregs[0x014 / 4];
+
+ m_tilebank[0] = (layer0_ctrl >> 6) & 1;
+ m_tilebank[1] = (layer1_ctrl >> 6) & 1;
+
+ if (m_tilebank[0] != m_tilebankold[0])
+ {
+ m_tilebankold[0] = m_tilebank[0];
+ m_bg_tilemap->mark_all_dirty();
+ }
+
+ if (m_tilebank[1] != m_tilebankold[1])
+ {
+ m_tilebankold[1] = m_tilebank[1];
+ m_bg2_tilemap->mark_all_dirty();
+ }
+
- int layer0_scrollx = m_vregs[(0x400 / 4) + 1] + 3;
- int layer1_scrollx = m_vregs[(0x400 / 4) + 3] + 5;
- UINT32 layer0_ctrl = m_vregs[0x412 / 4];
- UINT32 layer1_ctrl = m_vregs[0x416 / 4];
tmptilemap0->set_scrolly(0, layer0_scrolly);
tmptilemap1->set_scrolly(0, layer1_scrolly);
@@ -322,56 +352,49 @@ UINT32 dreamwld_state::screen_update_dreamwld(screen_device &screen, bitmap_ind1
{
int x0 = 0, x1 = 0;
+ UINT16* linebase;
+
+
+
/* layer 0 */
- UINT16 *vregs = reinterpret_cast<UINT16 *>(m_vregs.target());
+ linebase = &m_lineram16[0x000];
+
if (layer0_ctrl & 0x0300)
{
if (layer0_ctrl & 0x0200)
/* per-tile rowscroll */
- x0 = vregs[BYTE_XOR_BE(0x000/2 + i/16)];
+ x0 = linebase[((i+32)&0xff)/16];
else
/* per-line rowscroll */
- x0 = vregs[BYTE_XOR_BE(0x000/2 + ((i + layer0_scrolly)&0xff))]; // different handling to psikyo.c? ( + scrolly )
- }
-
+ x0 = linebase[(i+32)&0xff];
+ }
- tmptilemap0->set_scrollx(
- (i + layer0_scrolly) % 256 /*tilemap_width(tm0size) */,
- layer0_scrollx + x0 );
+ tmptilemap0->set_scrollx(
+ (i + layer0_scrolly) & 0x3ff,
+ layer0_scrollx + x0 );
/* layer 1 */
+ linebase = &m_lineram16[0x200/2];
+
if (layer1_ctrl & 0x0300)
{
if (layer1_ctrl & 0x0200)
/* per-tile rowscroll */
- x1 = vregs[BYTE_XOR_BE(0x200/2 + i/16)];
+ x1 = linebase[((i+32)&0xff)/16];
else
/* per-line rowscroll */
- x1 = vregs[BYTE_XOR_BE(0x200/2 + ((i + layer1_scrolly)&0xff))]; // different handling to psikyo.c? ( + scrolly )
+ x1 = linebase[(i+32)&0xff];
}
- tmptilemap1->set_scrollx(
- (i + layer1_scrolly) % 256 /* tilemap_width(tm1size) */,
- layer1_scrollx + x1 );
- }
-
-
- m_tilebank[0] = (m_vregs[(0x400 / 4) + 4] >> 6) & 1;
- m_tilebank[1] = (m_vregs[(0x400 / 4) + 5] >> 6) & 1;
+ tmptilemap1->set_scrollx(
+ (i + layer1_scrolly) & 0x3ff,
+ layer1_scrollx + x1 );
- if (m_tilebank[0] != m_tilebankold[0])
- {
- m_tilebankold[0] = m_tilebank[0];
- m_bg_tilemap->mark_all_dirty();
}
- if (m_tilebank[1] != m_tilebankold[1])
- {
- m_tilebankold[1] = m_tilebank[1];
- m_bg2_tilemap->mark_all_dirty();
- }
+
tmptilemap0->draw(screen, bitmap, cliprect, 0, 0);
tmptilemap1->draw(screen, bitmap, cliprect, 0, 0);
@@ -385,14 +408,14 @@ UINT32 dreamwld_state::screen_update_dreamwld(screen_device &screen, bitmap_ind1
READ32_MEMBER(dreamwld_state::dreamwld_protdata_r)
{
-// static int count = 0;
+ //static int count = 0;
UINT8 *protdata = memregion("user1")->base();
size_t protsize = memregion("user1")->bytes();
UINT8 dat = protdata[(m_protindex++) % protsize];
-// printf("protection read %04x %02x\n", count, dat);
-// count++;
+ //printf("protection read %04x %02x\n", count, dat);
+ //count++;
// real hw returns 00 after end of data, I haven't checked if it's possible to overflow the read counter
// and read out the internal rom.
@@ -434,7 +457,8 @@ static ADDRESS_MAP_START( baryon_map, AS_PROGRAM, 32, dreamwld_state )
AM_RANGE(0x600000, 0x601fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
AM_RANGE(0x800000, 0x801fff) AM_RAM_WRITE(dreamwld_bg_videoram_w ) AM_SHARE("bg_videoram")
AM_RANGE(0x802000, 0x803fff) AM_RAM_WRITE(dreamwld_bg2_videoram_w ) AM_SHARE("bg2_videoram")
- AM_RANGE(0x804000, 0x805fff) AM_RAM AM_SHARE("vregs") // scroll regs etc.
+ AM_RANGE(0x804000, 0x8043ff) AM_READWRITE16(lineram16_r, lineram16_w, 0xffffffff) // linescroll
+ AM_RANGE(0x804400, 0x805fff) AM_RAM AM_SHARE("vregs")
AM_RANGE(0xc00000, 0xc00003) AM_READ_PORT("INPUTS")
AM_RANGE(0xc00004, 0xc00007) AM_READ_PORT("c00004")
@@ -652,6 +676,74 @@ static INPUT_PORTS_START( cutefght )
INPUT_PORTS_END
+static INPUT_PORTS_START( gaialast )
+ PORT_START("INPUTS")
+ PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_COIN1 )
+ PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_COIN2 )
+ PORT_BIT( 0x0000fffc, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0x00010000, IP_ACTIVE_LOW, IPT_START2 )
+ PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
+ PORT_BIT( 0x00040000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
+ PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
+ PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
+ PORT_BIT( 0x00200000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
+ PORT_BIT( 0x00400000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
+ PORT_BIT( 0x00800000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
+ PORT_BIT( 0x01000000, IP_ACTIVE_LOW, IPT_START1 )
+ PORT_BIT( 0x02000000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
+ PORT_BIT( 0x04000000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
+ PORT_BIT( 0x08000000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
+ PORT_BIT( 0x10000000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
+ PORT_BIT( 0x20000000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
+ PORT_BIT( 0x40000000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
+ PORT_BIT( 0x80000000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
+
+ PORT_START("c00004")
+ PORT_BIT( 0x0000ffff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, driver_device,custom_port_read, "DSW")
+ PORT_BIT( 0xffff0000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, driver_device,custom_port_read, "DSW")
+
+ PORT_START("DSW")
+ PORT_DIPNAME( 0x0003, 0x0001, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:1,2")
+ PORT_DIPSETTING( 0x0002, "1" )
+ PORT_DIPSETTING( 0x0003, "2" )
+ PORT_DIPSETTING( 0x0001, "3" )
+ PORT_DIPSETTING( 0x0000, "4" )
+ PORT_DIPNAME( 0x0004, 0x0000, "Bomb Stock" ) PORT_DIPLOCATION("SW2:3")
+ PORT_DIPSETTING( 0x0004, "2" )
+ PORT_DIPSETTING( 0x0000, "3" )
+ PORT_DIPNAME( 0x0008, 0x0000, "Lock Vertical Scroll" ) PORT_DIPLOCATION("SW2:4") // if Off the game pans the screen up/down when you move up/down
+ PORT_DIPSETTING( 0x0008, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
+ PORT_DIPUNUSED_DIPLOC( 0x0010, IP_ACTIVE_LOW, "SW2:5" )
+ PORT_DIPUNUSED_DIPLOC( 0x0020, IP_ACTIVE_LOW, "SW2:6" ) // these are listed as ticket payout in test mode, but I believe
+ PORT_DIPUNUSED_DIPLOC( 0x0040, IP_ACTIVE_LOW, "SW2:7" ) // that to be a leftover from some redemption game
+ PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW2:8")
+ PORT_DIPSETTING( 0x0080, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
+ PORT_DIPNAME( 0x0100, 0x0000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:1") /* Title screen sounds only */
+ PORT_DIPSETTING( 0x0100, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
+ PORT_DIPNAME( 0x0e00, 0x0e00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:2,3,4")
+ PORT_DIPSETTING( 0x0000, DEF_STR( 5C_1C ) )
+ PORT_DIPSETTING( 0x0200, DEF_STR( 4C_1C ) )
+ PORT_DIPSETTING( 0x0400, DEF_STR( 3C_1C ) )
+ PORT_DIPSETTING( 0x0600, DEF_STR( 2C_1C ) )
+ PORT_DIPSETTING( 0x0e00, DEF_STR( 1C_1C ) )
+ PORT_DIPSETTING( 0x0a00, DEF_STR( 2C_3C ) )
+ PORT_DIPSETTING( 0x0c00, DEF_STR( 1C_2C ) )
+ PORT_DIPSETTING( 0x0800, DEF_STR( 1C_3C ) )
+ PORT_DIPNAME( 0x7000, 0x7000, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:5,6,7")
+ PORT_DIPSETTING( 0x2000, "Level 1" ) // listed as 'Level 3' in service mode
+ PORT_DIPSETTING( 0x1000, "Level 2" ) // ^^
+ PORT_DIPSETTING( 0x0000, "Level 3" )
+ PORT_DIPSETTING( 0x7000, "Level 4" )
+ PORT_DIPSETTING( 0x6000, "Level 5" )
+ PORT_DIPSETTING( 0x5000, "Level 6" )
+ PORT_DIPSETTING( 0x4000, "Level 7" )
+ PORT_DIPSETTING( 0x3000, "Level 8" ) // listed as 'Little' in service mode, but still clearly the most difficult
+ PORT_SERVICE_DIPLOC( 0x8000, IP_ACTIVE_LOW, "SW1:8" )
+INPUT_PORTS_END
+
static const gfx_layout layout_16x16x4 =
{
16,16,
@@ -710,7 +802,7 @@ static MACHINE_CONFIG_START( baryon, dreamwld_state )
MCFG_SCREEN_REFRESH_RATE(57.793)
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500))
MCFG_SCREEN_SIZE(512,256)
- MCFG_SCREEN_VISIBLE_AREA(0, 304-1, 0, 224-1)
+ MCFG_SCREEN_VISIBLE_AREA(0, 308-1, 0, 224-1)
MCFG_SCREEN_UPDATE_DRIVER(dreamwld_state, screen_update_dreamwld)
MCFG_SCREEN_VBLANK_DRIVER(dreamwld_state, screen_eof_dreamwld)
MCFG_SCREEN_PALETTE("palette")
@@ -1071,9 +1163,93 @@ ROM_START( dreamwld )
ROM_LOAD( "11.bin", 0x000000, 0x10000, CRC(0da8db45) SHA1(7d5bd71c5b0b28ff74c732edd7c662f46f2ab25b) )
ROM_END
+/*
+
+Gaia - The Last Choice of Earth
+SemiCom / XESS, 1999
+
+PCB Layout
+----------
+
+|-------------------------------------------------|
+| M6295* 27C40* 62256 ACTEL ROM8 |
+|VOL M6295 ROM1 62256 A40MX04 |
+| PAL PAL 32MHz |
+| 62256 62256 PAL |
+| ROM2 ROM4 68EC020 PAL PAL |
+| ROM3 ROM5 PAL PAL |
+|J 62256 62256 PAL |
+|A PAL 27MHz |
+|M PAL |
+|M ACTEL M5M44260 |
+|A 6116 A40MX04 M5M44260 |
+| 6116 |
+| PAL |
+| 6264 PAL |
+| DSW2 6264 |
+| DSW2 8752 ROM9 |
+| ROM6 ROM10 ROM12 |
+|3* 4* ROM7 ROM11 27C160* |
+|-------------------------------------------------|
+
+Same PCB as Cute Fighter / Dream World PCB except one OKI M6295 and it's sample rom are unpopulated
+IE: Same configuration as Rolling Crush
+
+No labels on any of the roms.
+
+Program roms 2 through 5 are MX27C2000
+Rom 1 is a TMS 27C040
+Rom 9 is a MX26C512
+Roms 6 & 7 are MX26C1000
+Roms 8 and 10 through 12 are ST M27C160
+
+* denotes unpopulated components
+ 3 & 4 are 10 pin headers
+
+Main CPU 68EC020FG16 @ 16MHz [32/2]
+AD-65 (OKI MSM6295 rebadged) @ 1MHz [32/32]. pin 7 LOW
+Atmel AT89C52 MCU (secured) @ 16MHZ [32/2]
+
+*/
+
+ROM_START( gaialast )
+ ROM_REGION( 0x200000, "maincpu", 0 )
+ ROM_LOAD32_BYTE( "4", 0x000000, 0x040000, CRC(10cc2dee) SHA1(0719333ff391ee7935c6e4cea7e8e75369aeb9d0) )
+ ROM_LOAD32_BYTE( "5", 0x000001, 0x040000, CRC(c55f6f11) SHA1(13d543b0770bebdd4c6e064b56fd6cc2ec929566) )
+ ROM_LOAD32_BYTE( "2", 0x000002, 0x040000, CRC(549e594a) SHA1(728c6b51cc478ad7251bcbe6d7f4f4e6a2ee4a4e) )
+ ROM_LOAD32_BYTE( "3", 0x000003, 0x040000, CRC(a8e845d8) SHA1(f8c7e702bd747a22e76c861effec4cd3cd2f3fc9) )
+
+ ROM_REGION( 0x10000, "cpu1", 0 ) /* 87C52 MCU Code */
+ ROM_LOAD( "87c52.mcu", 0x00000, 0x10000 , NO_DUMP ) /* can't be dumped. */
+
+ ROM_REGION( 0x6c9, "user1", ROMREGION_ERASEFF ) /* Protection data */
+ ROM_LOAD( "protdata.bin", 0x000, 0x6c9 , CRC(d3403b7b) SHA1(712a7f27fc41b632d584237f7641e8ae20035111) )
+
+ ROM_REGION( 0x80000, "oki1", 0 ) /* OKI Samples */
+ ROM_LOAD( "1", 0x000000, 0x80000, CRC(2dbad410) SHA1(bb788ea14bb605be9af9c8f8adec94ad1c17ab55) )
+
+ ROM_REGION( 0x80000, "oki2", ROMREGION_ERASE00 ) /* OKI Samples - 2nd chip (neither OKI or rom is present, empty sockets) */
+ /* not populared */
+
+ ROM_REGION( 0x800000, "gfx1", 0 ) /* Sprite Tiles - decoded */
+ ROM_LOAD16_WORD_SWAP( "10", 0x000000, 0x200000, CRC(5822ef93) SHA1(8ce22c30f8027f35c5f72eb6ce57a74540dd55da) )
+ ROM_LOAD16_WORD_SWAP( "11", 0x200000, 0x200000, CRC(f4f5770d) SHA1(ac850483cae321d286a09fe93ce7e49725722de0) )
+ ROM_LOAD16_WORD_SWAP( "12", 0x400000, 0x200000, CRC(a1f04571) SHA1(c29b3b3c209b63ad44ebfa5afb4b1832965e0936) )
+
+ ROM_REGION( 0x200000, "gfx2", 0 ) /* BG Tiles - decoded */
+ ROM_LOAD16_WORD_SWAP( "8",0x000000, 0x200000, CRC(32d16985) SHA1(2b7a20eea09e7d2debd42469e9f6ae49310f5747) )
+
+ ROM_REGION( 0x040000, "spritelut", 0 ) /* Sprite Code Lookup ... */
+ ROM_LOAD16_BYTE( "6", 0x000000, 0x020000, CRC(5c82feed) SHA1(1857afecf1081adf015ade1efb5930e3a7deef78) )
+ ROM_LOAD16_BYTE( "7", 0x000001, 0x020000, CRC(9d7f04ae) SHA1(55fb82626060fe0ddc03ed3ef402ccf998063d27) )
+
+ ROM_REGION( 0x10000, "unknown", 0 )
+ ROM_LOAD( "9", 0x000000, 0x10000, CRC(0da8db45) SHA1(7d5bd71c5b0b28ff74c732edd7c662f46f2ab25b) )
+ROM_END
-GAME( 1997, baryon, 0, baryon, baryon, driver_device, 0, ROT270, "SemiCom", "Baryon - Future Assault (set 1)", GAME_SUPPORTS_SAVE )
-GAME( 1997, baryona, baryon, baryon, baryon, driver_device, 0, ROT270, "SemiCom", "Baryon - Future Assault (set 2)", GAME_SUPPORTS_SAVE )
-GAME( 1998, cutefght, 0, dreamwld, cutefght, driver_device, 0, ROT0, "SemiCom", "Cute Fighter", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_GRAPHICS ) // wrong linescroll?
-GAME( 1999, rolcrush, 0, baryon, rolcrush, driver_device, 0, ROT0, "Trust / SemiCom", "Rolling Crush (version 1.07.E - 1999/02/11)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_GRAPHICS ) // wrong
-GAME( 2000, dreamwld, 0, dreamwld, dreamwld, driver_device, 0, ROT0, "SemiCom", "Dream World", GAME_SUPPORTS_SAVE )
+GAME( 1997, baryon, 0, baryon, baryon, driver_device, 0, ROT270, "SemiCom / Tirano", "Baryon - Future Assault (set 1)", GAME_SUPPORTS_SAVE )
+GAME( 1997, baryona, baryon, baryon, baryon, driver_device, 0, ROT270, "SemiCom / Tirano", "Baryon - Future Assault (set 2)", GAME_SUPPORTS_SAVE )
+GAME( 1998, cutefght, 0, dreamwld, cutefght, driver_device, 0, ROT0, "SemiCom", "Cute Fighter", GAME_SUPPORTS_SAVE )
+GAME( 1999, rolcrush, 0, baryon, rolcrush, driver_device, 0, ROT0, "Trust / SemiCom", "Rolling Crush (version 1.07.E - 1999/02/11)", GAME_SUPPORTS_SAVE )
+GAME( 1999, gaialast, 0, baryon, gaialast, driver_device, 0, ROT0, "SemiCom / XESS", "Gaia - The Last Choice of Earth", GAME_SUPPORTS_SAVE )
+GAME( 2000, dreamwld, 0, dreamwld, dreamwld, driver_device, 0, ROT0, "SemiCom", "Dream World", GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/dynax.c b/src/mame/drivers/dynax.c
index b6c4216cb8c..4d31b8125ea 100644
--- a/src/mame/drivers/dynax.c
+++ b/src/mame/drivers/dynax.c
@@ -2659,7 +2659,7 @@ static INPUT_PORTS_START( mjdialq2 )
PORT_DIPNAME( 0x40, 0x40, "Select Special Item" ) /* Allows to select which one of the nine special items you want. */
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
+ PORT_DIPNAME( 0x80, 0x80, "Debug" )
PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
@@ -5352,6 +5352,22 @@ ROM_START( mayab )
ROM_LOAD( "promat02.bin", 0x200, 0x200, CRC(e38eb360) SHA1(739960dd57ec3305edd57aa63816a81ddfbebf3e) )
ROM_END
+ROM_START( mayac )
+ ROM_REGION( 0x90000, "maincpu", 0 ) // Z80 Code
+ ROM_LOAD( "e16", 0x00000, 0x10000, CRC(badafb62) SHA1(eabe390f5b3ca6acd4b194b65b81fda7ddca35b8) )
+ ROM_LOAD( "e15", 0x28000, 0x10000, CRC(7ea5b49a) SHA1(aaae848669d9f88c0660f46cc801e4eb0f5e3b89) )
+
+ ROM_REGION( 0xc0000, "gfx1", 0 )
+ ROM_LOAD( "g18", 0x00000, 0x40000, CRC(b621955c) SHA1(8bb3cf16585f33e81921efe7958cf8ca08e8df7f) )
+ ROM_LOAD( "g16", 0x40000, 0x40000, CRC(26b1c824) SHA1(e1a1a51ef94a3933d5fe4b3d47ad2c1dfb9a1c19) )
+ ROM_LOAD( "g15", 0x80000, 0x40000, CRC(f7c6f77e) SHA1(27ba271ec67504dc0c6f9b20362206bbd4b0d90a) )
+
+ ROM_REGION( 0x400, "proms", 0 ) // Color PROMs
+ ROM_LOAD( "82s147-2.b5", 0x000, 0x200, CRC(5091de2b) SHA1(ae13676cd2fbde1b87c85480283b24440e069ba4) ) // FIXED BITS (0xxxxxxx)
+ ROM_LOAD( "82s147-1.b6", 0x200, 0x200, CRC(6d4940cd) SHA1(33875fd846977f8839fdb0f2a259959994552f35) )
+ROM_END
+
+
ROM_START( inca )
ROM_REGION( 0x90000, "maincpu", 0 ) // Z80 Code
ROM_LOAD( "am27c512.1", 0x00000, 0x10000, CRC(b0d513f7) SHA1(65ef4702302bbfc7c7a77f7353120ee3f5c94b31) )
@@ -5440,12 +5456,11 @@ DRIVER_INIT_MEMBER(dynax_state,blktouch)
}
}
+
-DRIVER_INIT_MEMBER(dynax_state,maya)
+DRIVER_INIT_MEMBER(dynax_state, maya_common)
{
/* Address lines scrambling on 1 z80 rom */
- int i;
- UINT8 *gfx = (UINT8 *)memregion("gfx1")->base();
UINT8 *rom = memregion("maincpu")->base() + 0x28000, *end = rom + 0x10000;
for ( ; rom < end; rom += 8)
{
@@ -5456,13 +5471,39 @@ DRIVER_INIT_MEMBER(dynax_state,maya)
rom[0] = temp[0]; rom[1] = temp[4]; rom[2] = temp[1]; rom[3] = temp[5];
rom[4] = temp[2]; rom[5] = temp[6]; rom[6] = temp[3]; rom[7] = temp[7];
}
+}
+
+
+DRIVER_INIT_MEMBER(dynax_state,maya)
+{
+ DRIVER_INIT_CALL(maya_common);
+
+ UINT8 *gfx = (UINT8 *)memregion("gfx1")->base();
+ int i;
+
+ /* Address lines scrambling on the blitter data roms */
+ {
+ dynamic_buffer rom(0xc0000);
+ memcpy(&rom[0], gfx, 0xc0000);
+ for (i = 0; i < 0xc0000; i++)
+ gfx[i] = rom[BITSWAP24(i, 23, 22, 21, 20, 19, 18, 14, 15, 16, 17, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0)];
+ }
+}
+
+
+DRIVER_INIT_MEMBER(dynax_state,mayac)
+{
+ DRIVER_INIT_CALL(maya_common);
+
+ UINT8 *gfx = (UINT8 *)memregion("gfx1")->base();
+ int i;
/* Address lines scrambling on the blitter data roms */
{
dynamic_buffer rom(0xc0000);
memcpy(&rom[0], gfx, 0xc0000);
for (i = 0; i < 0xc0000; i++)
- gfx[i] = rom[BITSWAP24(i,23,22,21,20,19,18,14,15, 16,17,13,12,11,10,9,8, 7,6,5,4,3,2,1,0)];
+ gfx[i] = rom[BITSWAP24(i, 23, 22, 21, 20, 19, 18, 17, 14, 16, 15, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0)];
}
}
@@ -5501,6 +5542,27 @@ ROM_START( mjdialq2 )
ROM_LOAD( "d52-1.8e", 0x200, 0x200, CRC(8868247a) SHA1(97652025c411b379dfab576dc7f2d8d0d61d0828) )
ROM_END
+// Program roms from a non-working pcb. The other roms match the parent.
+ROM_START( mjdialq2a )
+ ROM_REGION( 0x78000, "maincpu", 0 ) // Z80 Code
+ ROM_LOAD( "5201.2b", 0x00000, 0x10000, CRC(6b735bb0) SHA1(2756e8711cf3be45ec0ca97bce621135df71e9fc) )
+ ROM_RELOAD( 0x10000, 0x08000 ) // 1
+ ROM_CONTINUE( 0x20000, 0x08000 ) // 3
+ ROM_LOAD( "5202.2c", 0x30000, 0x08000, CRC(7819521f) SHA1(57a385b4ff3343dfa47499ddc25db26b3b64a441) ) // 5
+ ROM_CONTINUE( 0x70000, 0x08000 ) // d
+
+ ROM_REGION( 0xa0000, "gfx1", 0 ) // blitter data
+ ROM_LOAD( "5207.2h", 0x00000, 0x20000, CRC(7794cd62) SHA1(7fa2fd50d7c975c381dda36f505df0e152196bb5) )
+ ROM_LOAD( "5206.2g", 0x20000, 0x20000, CRC(9e810021) SHA1(cf1052c96b9da3abb263be1ce8481aeded2c5d00) )
+ ROM_LOAD( "5205.2f", 0x40000, 0x20000, CRC(8c05572f) SHA1(544a5eb8b989fb1195986ed856da04350941ef59) )
+ ROM_LOAD( "5204.2e", 0x60000, 0x20000, CRC(958ef9ab) SHA1(ec768c587dc9e6b691564b6b35abbece252bcd28) )
+ ROM_LOAD( "5203.2d", 0x80000, 0x20000, CRC(706072d7) SHA1(d4692296d234b824961a94390e6d646ed9a7d5fd) )
+
+ ROM_REGION( 0x400, "proms", 0 ) // Color PROMs
+ ROM_LOAD( "d52-2.9e", 0x000, 0x200, CRC(18585ce3) SHA1(7f2e20bb09c1d810910094a6b19e5151666d74ac) ) // FIXED BITS (0xxxxxxx)
+ ROM_LOAD( "d52-1.8e", 0x200, 0x200, CRC(8868247a) SHA1(97652025c411b379dfab576dc7f2d8d0d61d0828) )
+ROM_END
+
/***************************************************************************
@@ -7213,6 +7275,25 @@ ROM_START( hjingi )
ROM_LOAD( "h09.6", 0x00000, 0x20000, CRC(86bde64d) SHA1(d9b79184697044ae8a4d04ea22deca2e14162065) )
ROM_END
+// dump of the program roms only?
+ROM_START( hjingia )
+ ROM_REGION( 0x30000, "maincpu", 0 )
+ ROM_LOAD( "h10b.4a", 0x00000, 0x20000, CRC(a77a062a) SHA1(cae76effd573c20e20172829220587a5d200eb9e) )
+ ROM_RELOAD( 0x10000, 0x20000 )
+
+ ROM_REGION( 0x100000, "gfx1", 0 ) // blitter data
+ ROM_LOAD( "h02.21", 0x00000, 0x20000, CRC(9dde2d59) SHA1(96df4ba97ee9611d9a3c7bcaae9cd97815a7b8a5) )
+ ROM_LOAD( "h03.22", 0x20000, 0x20000, CRC(1ac59443) SHA1(e70fe6184e7090cf7229d83b87db65f7715de2a8) )
+ ROM_LOAD( "h01.20", 0x40000, 0x20000, CRC(24391ddc) SHA1(6a2e3fae4b6d0b1d8073306f37c9fdaa04b69eb8) )
+ ROM_LOAD( "h04.1", 0x60000, 0x20000, CRC(3756c745) SHA1(f275a72d6e07f21148900d24a8018d03504f249f) )
+ ROM_LOAD( "h05.2", 0x80000, 0x20000, CRC(249d360a) SHA1(688fced1298c345a18314d2c88664c757a2de35c) )
+ ROM_LOAD( "h06.3", 0xa0000, 0x20000, CRC(014a4945) SHA1(0cd747787a81226fd4937616a6ce45af731a4049) )
+ ROM_LOAD( "h07.4", 0xc0000, 0x20000, CRC(8b6f8a2d) SHA1(c5f3ec64a7ea3edc556182f42e6da4842d88e0ba) )
+ ROM_LOAD( "h08.5", 0xe0000, 0x20000, CRC(6f996e6e) SHA1(c2b916afbfd257417f0383ad261f3720a027fdd9) )
+
+ ROM_REGION( 0x20000, "gfx2", 0 ) // blitter data
+ ROM_LOAD( "h09.6", 0x00000, 0x20000, CRC(86bde64d) SHA1(d9b79184697044ae8a4d04ea22deca2e14162065) )
+ROM_END
/***************************************************************************
@@ -7294,14 +7375,16 @@ ROM_END
GAME( 1988, janyuki, 0, janyuki, janyuki, driver_device, 0, ROT0, "Dynax", "Jong Yu Ki (Japan)", GAME_SUPPORTS_SAVE )
GAME( 1989, hnkochou, 0, hanamai, hnkochou, driver_device, 0, ROT180, "Dynax", "Hana Kochou (Japan, Bet)", GAME_SUPPORTS_SAVE )
GAME( 1988, hanamai, hnkochou, hanamai, hanamai, driver_device, 0, ROT180, "Dynax", "Hana no Mai (Japan)", GAME_SUPPORTS_SAVE )
-GAME( 1990, hjingi, 0, hjingi, hjingi, driver_device, 0, ROT180, "Dynax", "Hana Jingi (Japan, Bet)", GAME_SUPPORTS_SAVE )
+GAME( 1990, hjingi, 0, hjingi, hjingi, driver_device, 0, ROT180, "Dynax", "Hana Jingi (Japan, Bet)", GAME_SUPPORTS_SAVE ) // 1990 05/01 11:58:24
+GAME( 1990, hjingia, hjingi, hjingi, hjingi, driver_device, 0, ROT180, "Dynax", "Hana Jingi (Japan, Bet, alt.)", GAME_SUPPORTS_SAVE ) // 1990 05/01 11:58:24
GAME( 1989, hnoridur, hjingi, hnoridur, hnoridur, driver_device, 0, ROT180, "Dynax", "Hana Oriduru (Japan)", GAME_SUPPORTS_SAVE )
GAME( 1989, drgpunch, 0, sprtmtch, drgpunch, driver_device, 0, ROT0, "Dynax", "Dragon Punch (Japan)", GAME_SUPPORTS_SAVE )
GAME( 1989, sprtmtch, drgpunch, sprtmtch, sprtmtch, driver_device, 0, ROT0, "Dynax (Fabtek license)", "Sports Match", GAME_SUPPORTS_SAVE )
-/* these 5 are Korean hacks / bootlegs of Dragon Punch / Sports Match */
+/* these 3 are Korean hacks / bootlegs of Dragon Punch / Sports Match */
GAME( 1994, maya, 0, sprtmtch, drgpunch, dynax_state, maya, ROT0, "Promat", "Maya (set 1)", GAME_SUPPORTS_SAVE ) // this set has backgrounds blacked out in attract
GAME( 1994, mayaa, maya, sprtmtch, drgpunch, dynax_state, maya, ROT0, "Promat", "Maya (set 2)", GAME_SUPPORTS_SAVE ) // this set has backgrounds blacked out in attract
GAME( 1994, mayab, maya, sprtmtch, drgpunch, dynax_state, maya, ROT0, "Promat", "Maya (set 3)", GAME_SUPPORTS_SAVE )
+GAME( 1994, mayac, maya, sprtmtch, drgpunch, dynax_state, mayac, ROT0, "Promat", "Maya (set 4, clean)", GAME_SUPPORTS_SAVE )
GAME( 199?, inca, 0, sprtmtch, drgpunch, dynax_state, maya, ROT0, "<unknown>", "Inca", GAME_SUPPORTS_SAVE )
GAME( 199?, blktouch, 0, sprtmtch, drgpunch, dynax_state, blktouch, ROT0, "Yang Gi Co Ltd.", "Black Touch (Korea)", GAME_SUPPORTS_SAVE )
@@ -7311,6 +7394,7 @@ GAME( 1990, mcnpshnt, 0, mcnpshnt, mcnpshnt, driver_device, 0, ROT
GAME( 1990, 7jigen, 0, nanajign, nanajign, driver_device, 0, ROT180, "Dynax", "7jigen no Youseitachi - Mahjong 7 Dimensions (Japan)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
GAME( 1990, jantouki, 0, jantouki, jantouki, driver_device, 0, ROT0, "Dynax", "Jong Tou Ki (Japan)", GAME_SUPPORTS_SAVE )
GAME( 1991, mjdialq2, 0, mjdialq2, mjdialq2, driver_device, 0, ROT180, "Dynax", "Mahjong Dial Q2 (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1991, mjdialq2a,mjdialq2, mjdialq2, mjdialq2, driver_device, 0, ROT180, "Dynax", "Mahjong Dial Q2 (Japan, alt.)", GAME_SUPPORTS_SAVE )
GAME( 1991, yarunara, 0, yarunara, yarunara, driver_device, 0, ROT180, "Dynax", "Mahjong Yarunara (Japan)", GAME_SUPPORTS_SAVE )
GAME( 1991, mjangels, 0, yarunara, yarunara, driver_device, 0, ROT180, "Dynax", "Mahjong Angels - Comic Theater Vol.2 (Japan)", GAME_SUPPORTS_SAVE )
GAME( 1992, quiztvqq, 0, quiztvqq, quiztvqq, driver_device, 0, ROT180, "Dynax", "Quiz TV Gassyuukoku Q&Q (Japan)", GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/dynduke.c b/src/mame/drivers/dynduke.c
index 8d0329907c2..200175fa2a7 100644
--- a/src/mame/drivers/dynduke.c
+++ b/src/mame/drivers/dynduke.c
@@ -283,6 +283,7 @@ static MACHINE_CONFIG_START( dynduke, dynduke_state )
MCFG_CPU_VBLANK_INT_DRIVER("screen", dynduke_state, interrupt)
SEIBU_SOUND_SYSTEM_CPU(14318180/4)
+ SEIBU_SOUND_SYSTEM_ENCRYPTED_FULL()
MCFG_QUANTUM_TIME(attotime::from_hz(3600))
@@ -607,7 +608,6 @@ ROM_END
DRIVER_INIT_MEMBER(dynduke_state,dynduke)
{
- m_seibu_sound->decrypt("audiocpu",0x20000);
}
/* Game Drivers */
diff --git a/src/mame/drivers/electra.c b/src/mame/drivers/electra.c
index 9dde18b782a..4ef8ee27d09 100644
--- a/src/mame/drivers/electra.c
+++ b/src/mame/drivers/electra.c
@@ -5,12 +5,15 @@
Electra discrete hardware games
Game Name
- Avenger (1975) EG-1020
+ Avenger (1975) EG-1020
+ Combo 3 (Tennis, Soccer, Hockey) (1975)
Eliminator IV (1976)
- Flying Fortress (1976) EG-1060 (Taito same name?)
- Pace Car Pro (1975) EG-1000
- UFO Chase (1975) EG-1010
- Wings (1976)
+ Flying Fortress (1976) EG-1060 (Taito same name?)
+ Knockout (1975)
+ Pace Car Pro (1975) EG-1000
+ Pace Race (1974?)
+ UFO Chase (1975) EG-1010
+ Wings / Wings Cocktail (1976)
***************************************************************************/
diff --git a/src/mame/drivers/exidy.c b/src/mame/drivers/exidy.c
index dee3157159f..706dab9d813 100644
--- a/src/mame/drivers/exidy.c
+++ b/src/mame/drivers/exidy.c
@@ -868,7 +868,7 @@ static MACHINE_CONFIG_DERIVED( venture, base )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(venture_map)
- MCFG_QUANTUM_PERFECT_CPU("maincpu")
+ MCFG_QUANTUM_TIME(attotime::from_hz(600))
/* audio hardware */
MCFG_FRAGMENT_ADD(venture_audio)
@@ -890,7 +890,7 @@ static MACHINE_CONFIG_DERIVED( mtrap, venture )
/* basic machine hardware */
- MCFG_QUANTUM_PERFECT_CPU("maincpu")
+ MCFG_QUANTUM_TIME(attotime::from_hz(1920))
/* audio hardware */
MCFG_FRAGMENT_ADD(mtrap_cvsd_audio)
diff --git a/src/mame/drivers/exidyttl.c b/src/mame/drivers/exidyttl.c
index 5ae9538d674..9878e0692f0 100644
--- a/src/mame/drivers/exidyttl.c
+++ b/src/mame/drivers/exidyttl.c
@@ -4,15 +4,18 @@
Exidy discrete hardware games
- Alley Rally (1975)
+ Alley Rally (1975) (AR-1A)
Attack (1977)
Death Race (1976)
Destruction Derby (1975)
- Spiders From Space (1976)
+ Hockey / Tennis (Thumper Bumper?) (1974)
Score (1977)
+ Spiders From Space (1976)
+ Sting (1974)
Super Death Chase (1977)
- Table Football (1975)
- TV Pinball (1974)
+ Table Foosballer / Table Football (1975)
+ Table Pinball (1974)
+ TV Pinball (1974) (PB-4)
***************************************************************************/
diff --git a/src/mame/drivers/expro02.c b/src/mame/drivers/expro02.c
index cd4c5e9b617..9a68c8193b9 100644
--- a/src/mame/drivers/expro02.c
+++ b/src/mame/drivers/expro02.c
@@ -15,6 +15,7 @@
Miss World '96 1996 Comad
Ms/Mr World '96 1996 Comad
Fantasia II 1997 Comad
+ Fantasia II 1998 Comad
The following seem similar but could have other changes
@@ -1619,6 +1620,31 @@ ROM_START( fantsia2a )
ROM_LOAD( "music1.1a", 0xc0000, 0x80000, CRC(864167c2) SHA1(c454b26b6dea993e6bd64546f92beef05e46d7d7) )
ROM_END
+/* sole change seems to be copyright date, PCB has chip references instead of grid references. Not correcting all labels in other sets in case these are legitimate labels */
+ROM_START( fantsia2n )
+ ROM_REGION( 0x500000, "maincpu", 0 ) /* 68000 code */
+ ROM_LOAD16_BYTE( "prog2.g17", 0x000000, 0x80000, CRC(57c59972) SHA1(4b1da928b537cf340a67026d07bc3dfc078b0d0f) )
+ ROM_LOAD16_BYTE( "prog1.f17", 0x000001, 0x80000, CRC(bf2d9a26) SHA1(92f0c1bd32f1e5e0ede3ba847242a212dfae4986) )
+ ROM_LOAD16_BYTE( "scr2.g16", 0x100000, 0x80000, CRC(887b1bc5) SHA1(b6fcdc8a56ea25758f363224d256e9b6c8e30244) )
+ ROM_LOAD16_BYTE( "scr1.f16", 0x100001, 0x80000, CRC(cbba3182) SHA1(a484819940fa1ef18ce679465c31075798748bac) )
+ ROM_LOAD16_BYTE( "scr4.g15", 0x200000, 0x80000, CRC(ce97e411) SHA1(be0ed41362db03f384229c708f2ba4146e5cb501) )
+ ROM_LOAD16_BYTE( "scr3.f15", 0x200001, 0x80000, CRC(480cc2e8) SHA1(38fe57ba1e34537f8be65fcc023ccd43369a5d94) )
+ ROM_LOAD16_BYTE( "scr6.g14", 0x300000, 0x80000, CRC(b29d49de) SHA1(854b76755acf58fb8a4648a0ce72ea6bdf26c555) )
+ ROM_LOAD16_BYTE( "scr5.f14", 0x300001, 0x80000, CRC(d5f88b83) SHA1(518a1f6732149f2851bbedca61f7313c39beb91b) )
+ ROM_LOAD16_BYTE( "scr8.g20", 0x400000, 0x80000, CRC(694ae2b3) SHA1(82b7a565290fce07c8393af4718fd1e6136928e9) )
+ ROM_LOAD16_BYTE( "scr7.f20", 0x400001, 0x80000, CRC(6068712c) SHA1(80a136d76dca566772e34d832ac11b8c7d6ce9ab) )
+
+ ROM_REGION( 0x100000, "gfx1", 0 ) /* sprites */
+ ROM_LOAD( "23_OBJ1.U5", 0x00000, 0x80000, CRC(b45c9234) SHA1(b5eeec91b9c6952b338130458405997e1a51bf2f) )
+ ROM_LOAD( "obj2.2i", 0x80000, 0x80000, CRC(ea6e3861) SHA1(463b40f5441231a0451571a0b8afe1ed0fd4b164) )
+
+ ROM_REGION( 0x140000, "oki", 0 ) /* OKIM6295 samples */
+ /* 00000-2ffff is fixed, 30000-3ffff is bank switched from all the ROMs */
+ ROM_LOAD( "music2.1b", 0x00000, 0x80000, CRC(23cc4f9c) SHA1(06b5342c25de966ce590917c571e5b19af1fef7d) )
+ ROM_RELOAD( 0x40000, 0x80000 )
+ ROM_LOAD( "music1.1a", 0xc0000, 0x80000, CRC(864167c2) SHA1(c454b26b6dea993e6bd64546f92beef05e46d7d7) )
+ROM_END
+
ROM_START( wownfant)
ROM_REGION( 0x500000, "maincpu", 0 ) /* 68000 code */
ROM_LOAD16_BYTE( "ep-4001 42750001 u81.bin", 0x000000, 0x80000, CRC(9942d200) SHA1(d2f69c0949881ef4aef202b564eac069c030a497) )
@@ -1831,6 +1857,7 @@ GAME( 1996, smissw, 0, smissw, missw96, driver_device, 0, ROT0, "C
GAME( 1997, fantsia2, 0, fantsia2, missw96, driver_device, 0, ROT0, "Comad", "Fantasia II (Explicit)", GAME_NO_COCKTAIL )
GAME( 1997, fantsia2a,fantsia2, fantsia2, missw96, driver_device, 0, ROT0, "Comad", "Fantasia II (Less Explicit)", GAME_NO_COCKTAIL )
+GAME( 1998, fantsia2n,fantsia2, fantsia2, missw96, driver_device, 0, ROT0, "Comad", "Fantasia II (1998)", GAME_NO_COCKTAIL )
GAME( 2002, wownfant, 0, fantsia2, missw96, driver_device, 0, ROT0, "Comad", "WOW New Fantasia", GAME_NO_COCKTAIL )
diff --git a/src/mame/drivers/exzisus.c b/src/mame/drivers/exzisus.c
index bf00cbcc4e9..0322ca8b72f 100644
--- a/src/mame/drivers/exzisus.c
+++ b/src/mame/drivers/exzisus.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Yochizo
/***************************************************************************
diff --git a/src/mame/drivers/finalizr.c b/src/mame/drivers/finalizr.c
index f1d84e8e59f..cfd7a23f96f 100644
--- a/src/mame/drivers/finalizr.c
+++ b/src/mame/drivers/finalizr.c
@@ -260,7 +260,7 @@ void finalizr_state::machine_reset()
static MACHINE_CONFIG_START( finalizr, finalizr_state )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", M6809,XTAL_18_432MHz/6) /* ??? */
+ MCFG_CPU_ADD("maincpu", KONAMI1, XTAL_18_432MHz/6) /* ??? */
MCFG_CPU_PROGRAM_MAP(main_map)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", finalizr_state, finalizr_scanline, "screen", 0, 1)
@@ -352,7 +352,6 @@ ROM_END
DRIVER_INIT_MEMBER(finalizr_state,finalizr)
{
- konami1_decode(machine(), "maincpu");
}
diff --git a/src/mame/drivers/firebeat.c b/src/mame/drivers/firebeat.c
index 346691f8098..efb1719ab4a 100644
--- a/src/mame/drivers/firebeat.c
+++ b/src/mame/drivers/firebeat.c
@@ -82,9 +82,9 @@
------------------------------------------------------------------
GQ972 GQ972 2000 Beatmania III
GQ972(?) ? 2001 Beatmania III Append 6th Mix
- GQ972(?) ? 2002 Beatmania III Append 7th Mix
+ GQ972(?) GCB07 2002 Beatmania III Append 7th Mix
GQ972(?) ? 2000 Beatmania III Append Core Remix
- GQ972(?) ? 2003 Beatmania III The Final
+ GQ972(?) GCC01 2003 Beatmania III The Final
GQ974 GQ974 2000 Keyboardmania
GQ974 GCA01 2000 Keyboardmania 2nd Mix
GQ974 GCA12 2001 Keyboardmania 3rd Mix
@@ -92,13 +92,13 @@
GQ977 GQ977 2000 Para Para Dancing
GQ977 GC977 2000 Para Para Paradise 1.1
GQ977 GQA11 2000 Para Para Paradise 1st Mix+
- GQA02(?) ? 2000 Pop'n Music 4
- ??? ? 2000 Pop'n Music 5
- ??? ? 2001 Pop'n Music 6
+ GQA02(?) GQ986 2000 Pop'n Music 4
+ ??? G?A04 2000 Pop'n Music 5
+ ??? GQA16 2001 Pop'n Music 6
GQA02 GCB00 2001 Pop'n Music 7
- ??? ? 2002 Pop'n Music 8
+ ??? GQB30 2002 Pop'n Music 8
??? ? 2000 Pop'n Music Animelo
- ??? ? 2001 Pop'n Music Animelo 2
+ ??? GEA02 2001 Pop'n Music Animelo 2
??? ? 2001 Pop'n Music Mickey Tunes
TODO:
@@ -144,13 +144,9 @@
#include "firebeat.lh"
-struct GCU_REGS
-{
- UINT32 *vram;
- UINT32 vram_read_address;
- UINT32 vram_write_fifo_address;
- UINT32 visible_area;
-};
+#define DUMP_VRAM 0
+#define PRINT_GCU 0
+
struct IBUTTON_SUBKEY
{
@@ -164,136 +160,324 @@ struct IBUTTON
IBUTTON_SUBKEY subkey[3];
};
+#define MCFG_FIREBEAT_GCU_CPU_TAG(_tag) \
+ firebeat_gcu_device::static_set_cpu_tag(*device, _tag);
-
-class firebeat_state : public driver_device
+class firebeat_gcu_device : public device_t
{
public:
- firebeat_state(const machine_config &mconfig, device_type type, const char *tag)
- : driver_device(mconfig, type, tag),
- m_maincpu(*this, "maincpu"),
- m_work_ram(*this, "work_ram"),
- m_flash_main(*this, "flash_main"),
- m_flash_snd1(*this, "flash_snd1"),
- m_flash_snd2(*this, "flash_snd2"),
- m_duart_midi(*this, "duart_midi"),
- m_duart_com(*this, "duart_com"),
- m_kbd0(*this, "kbd0"),
- m_kbd1(*this, "kbd1"),
- m_ata(*this, "ata")
- { }
+ firebeat_gcu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ static void static_set_cpu_tag(device_t &device, const char *tag) { downcast<firebeat_gcu_device &>(device).m_cputag = tag; }
- required_device<ppc4xx_device> m_maincpu;
- required_shared_ptr<UINT32> m_work_ram;
- required_device<fujitsu_29f016a_device> m_flash_main;
- required_device<fujitsu_29f016a_device> m_flash_snd1;
- required_device<fujitsu_29f016a_device> m_flash_snd2;
- optional_device<pc16552_device> m_duart_midi;
- required_device<pc16552_device> m_duart_com;
- optional_device<midi_keyboard_device> m_kbd0;
- optional_device<midi_keyboard_device> m_kbd1;
- required_device<ata_interface_device> m_ata;
+ int draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- UINT8 m_extend_board_irq_enable;
- UINT8 m_extend_board_irq_active;
-// emu_timer *m_keyboard_timer;
- GCU_REGS m_gcu[2];
- int m_tick;
- int m_layer;
- int m_cab_data_ptr;
- const int * m_cur_cab_data;
-// int m_keyboard_state[2];
- UINT8 m_spu_shared_ram[0x400];
- IBUTTON m_ibutton;
- int m_ibutton_state;
- int m_ibutton_read_subkey_ptr;
- UINT8 m_ibutton_subkey_data[0x40];
- DECLARE_READ8_MEMBER(soundram_r);
- DECLARE_DRIVER_INIT(ppd);
- DECLARE_DRIVER_INIT(kbm);
- DECLARE_DRIVER_INIT(ppp);
- DECLARE_MACHINE_START(firebeat);
- DECLARE_MACHINE_RESET(firebeat);
- DECLARE_VIDEO_START(firebeat);
- UINT32 screen_update_firebeat_0(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- UINT32 screen_update_firebeat_1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- INTERRUPT_GEN_MEMBER(firebeat_interrupt);
- DECLARE_READ32_MEMBER(gcu0_r);
- DECLARE_WRITE32_MEMBER(gcu0_w);
- DECLARE_READ32_MEMBER(gcu1_r);
- DECLARE_WRITE32_MEMBER(gcu1_w);
- DECLARE_READ32_MEMBER(input_r);
- DECLARE_READ32_MEMBER(sensor_r );
- DECLARE_READ32_MEMBER(flashram_r);
- DECLARE_WRITE32_MEMBER(flashram_w);
- DECLARE_READ32_MEMBER(soundflash_r);
- DECLARE_WRITE32_MEMBER(soundflash_w);
- DECLARE_WRITE_LINE_MEMBER(ata_interrupt);
- DECLARE_READ32_MEMBER(ata_command_r);
- DECLARE_WRITE32_MEMBER(ata_command_w);
- DECLARE_READ32_MEMBER(ata_control_r);
- DECLARE_WRITE32_MEMBER(ata_control_w);
-// DECLARE_READ32_MEMBER(comm_uart_r);
-// DECLARE_WRITE32_MEMBER(comm_uart_w);
- DECLARE_READ32_MEMBER(cabinet_r);
- DECLARE_READ32_MEMBER(keyboard_wheel_r);
- DECLARE_READ8_MEMBER(midi_uart_r);
- DECLARE_WRITE8_MEMBER(midi_uart_w);
- DECLARE_READ32_MEMBER(extend_board_irq_r);
- DECLARE_WRITE32_MEMBER(extend_board_irq_w);
- DECLARE_WRITE32_MEMBER(lamp_output_w);
- DECLARE_WRITE32_MEMBER(lamp_output_kbm_w);
- DECLARE_WRITE32_MEMBER(lamp_output_ppp_w);
- DECLARE_WRITE32_MEMBER(lamp_output2_w);
- DECLARE_WRITE32_MEMBER(lamp_output2_ppp_w);
- DECLARE_WRITE32_MEMBER(lamp_output3_w);
- DECLARE_WRITE32_MEMBER(lamp_output3_ppp_w);
- DECLARE_READ32_MEMBER(ppc_spu_share_r);
- DECLARE_WRITE32_MEMBER(ppc_spu_share_w);
- DECLARE_READ16_MEMBER(spu_unk_r);
-// TIMER_CALLBACK_MEMBER(keyboard_timer_callback);
- void gcu_draw_object(bitmap_ind16 &bitmap, const rectangle &cliprect, int chip, UINT32 *cmd);
- void gcu_fill_rect(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT32 *cmd);
- void gcu_draw_character(bitmap_ind16 &bitmap, const rectangle &cliprect, int chip, UINT32 *cmd);
- void gcu_exec_display_list(bitmap_ind16 &bitmap, const rectangle &cliprect, int chip, UINT32 address);
- UINT32 update_screen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int chip);
- UINT32 GCU_r(int chip, UINT32 offset, UINT32 mem_mask);
- void GCU_w(int chip, UINT32 offset, UINT32 data, UINT32 mem_mask);
- void set_ibutton(UINT8 *data);
- int ibutton_w(UINT8 data);
- DECLARE_WRITE8_MEMBER(security_w);
- void init_lights(write32_delegate out1, write32_delegate out2, write32_delegate out3);
- void init_firebeat();
- void init_keyboard();
- DECLARE_WRITE_LINE_MEMBER(sound_irq_callback);
- DECLARE_WRITE_LINE_MEMBER(midi_uart_ch0_irq_callback);
- DECLARE_WRITE_LINE_MEMBER(midi_uart_ch1_irq_callback);
+ DECLARE_READ32_MEMBER(read);
+ DECLARE_WRITE32_MEMBER(write);
+
+ struct framebuffer
+ {
+ UINT32 base;
+ int width;
+ int height;
+ };
+
+protected:
+ virtual void device_start();
+ virtual void device_stop();
+ virtual void device_reset();
+
+private:
+ void execute_command(UINT32 *cmd);
+ void execute_display_list(UINT32 addr);
+ void draw_object(UINT32 *cmd);
+ void fill_rect(UINT32 *cmd);
+ void draw_character(UINT32 *cmd);
+ void fb_config(UINT32 *cmd);
+
+ UINT32 *m_vram;
+ UINT32 m_vram_read_addr;
+ UINT32 m_vram_fifo0_addr;
+ UINT32 m_vram_fifo1_addr;
+ UINT32 m_vram_fifo0_mode;
+ UINT32 m_vram_fifo1_mode;
+ UINT32 m_command_fifo0[4];
+ UINT32 m_command_fifo0_ptr;
+ UINT32 m_command_fifo1[4];
+ UINT32 m_command_fifo1_ptr;
+
+ const char* m_cputag;
+ device_t* m_cpu;
+
+ framebuffer m_frame[4];
+ UINT32 m_fb_origin_x;
+ UINT32 m_fb_origin_y;
};
+const device_type FIREBEAT_GCU = &device_creator<firebeat_gcu_device>;
+firebeat_gcu_device::firebeat_gcu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, FIREBEAT_GCU, "FireBeat GCU", tag, owner, clock, "firebeat_gcu", __FILE__)
+{
+}
+
+READ32_MEMBER(firebeat_gcu_device::read)
+{
+ int reg = offset * 4;
+
+ // VRAM Read
+ if (reg >= 0x80 && reg < 0x100)
+ {
+ return m_vram[m_vram_read_addr + offset - 0x20];
+ }
+ switch (reg)
+ {
+ case 0x78: // GCU Status
+ /* ppd checks bits 0x0041 of the upper halfword on interrupt */
+ return 0xffff0005;
+ default:
+ break;
+ }
+ return 0xffffffff;
+}
-VIDEO_START_MEMBER(firebeat_state,firebeat)
+WRITE32_MEMBER(firebeat_gcu_device::write)
{
- m_gcu[0].vram = auto_alloc_array(machine(), UINT32, 0x2000000/4);
- m_gcu[1].vram = auto_alloc_array(machine(), UINT32, 0x2000000/4);
- memset(m_gcu[0].vram, 0, 0x2000000);
- memset(m_gcu[1].vram, 0, 0x2000000);
+ int reg = offset * 4;
+
+ switch (reg)
+ {
+ case 0x10:
+ /* IRQ clear/enable; ppd writes bit off then on in response to interrupt */
+ /* it enables bits 0x41, but 0x01 seems to be the one it cares about */
+ if (ACCESSING_BITS_16_31 && (data & 0x00010000) == 0)
+ m_cpu->execute().set_input_line(INPUT_LINE_IRQ0, CLEAR_LINE);
+ if (ACCESSING_BITS_0_15)
+#if PRINT_GCU
+ printf("%s_w: %02X, %08X, %08X\n", basetag(), reg, data, mem_mask);
+#endif
+ break;
+
+ case 0x14: // ?
+ break;
+
+ case 0x18: // ?
+ break;
+
+ case 0x20: // Framebuffer 0 Origin(?)
+ break;
+
+ case 0x24: // Framebuffer 1 Origin(?)
+ break;
+
+ case 0x28: // Framebuffer 2 Origin(?)
+ break;
+
+ case 0x2c: // Framebuffer 3 Origin(?)
+ break;
+
+ case 0x30: // Framebuffer 0 Dimensions
+ if (ACCESSING_BITS_16_31)
+ m_frame[0].height = (data >> 16) & 0xffff;
+ if (ACCESSING_BITS_0_15)
+ m_frame[0].width = data & 0xffff;
+ break;
+
+ case 0x34: // Framebuffer 1 Dimensions
+ if (ACCESSING_BITS_16_31)
+ m_frame[1].height = (data >> 16) & 0xffff;
+ if (ACCESSING_BITS_0_15)
+ m_frame[1].width = data & 0xffff;
+ break;
+
+ case 0x38: // Framebuffer 2 Dimensions
+ if (ACCESSING_BITS_16_31)
+ m_frame[2].height = (data >> 16) & 0xffff;
+ if (ACCESSING_BITS_0_15)
+ m_frame[2].width = data & 0xffff;
+ break;
+
+ case 0x3c: // Framebuffer 3 Dimensions
+ if (ACCESSING_BITS_16_31)
+ m_frame[3].height = (data >> 16) & 0xffff;
+ if (ACCESSING_BITS_0_15)
+ m_frame[3].width = data & 0xffff;
+ break;
+
+ case 0x40: // Framebuffer 0 Base
+ m_frame[0].base = data;
+#if PRINT_GCU
+ printf("%s FB0 Base: %08X\n", basetag(), data);
+#endif
+ break;
+
+ case 0x44: // Framebuffer 1 Base
+ m_frame[1].base = data;
+#if PRINT_GCU
+ printf("%s FB1 Base: %08X\n", basetag(), data);
+#endif
+ break;
+
+ case 0x48: // Framebuffer 2 Base
+ m_frame[2].base = data;
+#if PRINT_GCU
+ printf("%s FB2 Base: %08X\n", basetag(), data);
+#endif
+ break;
+
+ case 0x4c: // Framebuffer 3 Base
+ m_frame[3].base = data;
+#if PRINT_GCU
+ printf("%s FB3 Base: %08X\n", basetag(), data);
+#endif
+ break;
+
+ case 0x5c: // VRAM Read Address
+ m_vram_read_addr = (data & 0xffffff) / 2;
+ break;
+
+ case 0x60: // VRAM Port 0 Write Address
+ m_vram_fifo0_addr = (data & 0xffffff) / 2;
+ break;
+
+ case 0x68: // VRAM Port 0/1 Mode
+ if (ACCESSING_BITS_16_31)
+ m_vram_fifo0_mode = data >> 16;
+ if (ACCESSING_BITS_0_15)
+ m_vram_fifo1_mode = data & 0xffff;
+ break;
+
+ case 0x70: // VRAM Port 0 Write FIFO
+ if (m_vram_fifo0_mode & 0x100)
+ {
+ // write to command fifo
+ m_command_fifo0[m_command_fifo0_ptr] = data;
+ m_command_fifo0_ptr++;
+
+ // execute when filled
+ if (m_command_fifo0_ptr >= 4)
+ {
+ //printf("GCU FIFO0 exec: %08X %08X %08X %08X\n", m_command_fifo0[0], m_command_fifo0[1], m_command_fifo0[2], m_command_fifo0[3]);
+ execute_command(m_command_fifo0);
+ m_command_fifo0_ptr = 0;
+ }
+ }
+ else
+ {
+ // write to VRAM fifo
+ m_vram[m_vram_fifo0_addr] = data;
+ m_vram_fifo0_addr++;
+ }
+ break;
+
+ case 0x64: // VRAM Port 1 Write Address
+ m_vram_fifo1_addr = (data & 0xffffff) / 2;
+ printf("GCU FIFO1 addr = %08X\n", data);
+ break;
+
+ case 0x74: // VRAM Port 1 Write FIFO
+ printf("GCU FIFO1 write = %08X\n", data);
+
+ if (m_vram_fifo1_mode & 0x100)
+ {
+ // write to command fifo
+ m_command_fifo1[m_command_fifo1_ptr] = data;
+ m_command_fifo1_ptr++;
+
+ // execute when filled
+ if (m_command_fifo1_ptr >= 4)
+ {
+ printf("GCU FIFO1 exec: %08X %08X %08X %08X\n", m_command_fifo1[0], m_command_fifo1[1], m_command_fifo1[2], m_command_fifo1[3]);
+ m_command_fifo1_ptr = 0;
+ }
+ }
+ else
+ {
+ // write to VRAM fifo
+ m_vram[m_vram_fifo1_addr] = data;
+ m_vram_fifo1_addr++;
+ }
+ break;
+
+ default:
+ //printf("%s_w: %02X, %08X, %08X\n", basetag(), reg, data, mem_mask);
+ break;
+ }
}
+int firebeat_gcu_device::draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+{
+ UINT16 *vram16 = (UINT16*)m_vram;
+
+ int x = 0;
+ int y = 0;
+ int width = m_frame[0].width;
+ int height = m_frame[0].height;
+
+ if (width != 0 && height != 0)
+ {
+ rectangle visarea = screen.visible_area();
+ if ((visarea.max_x+1) != width || (visarea.max_y+1) != height)
+ {
+ visarea.max_x = width-1;
+ visarea.max_y = height-1;
+ screen.configure(width, height, visarea, screen.frame_period().attoseconds);
+ }
+ }
+
+ int fb_pitch = 1024;
+
+ for (int j=0; j < height; j++)
+ {
+ UINT16 *d = &bitmap.pix16(j, x);
+ int li = ((j+y) * fb_pitch) + x;
+ UINT32 fbaddr0 = m_frame[0].base + li;
+ UINT32 fbaddr1 = m_frame[1].base + li;
+// UINT32 fbaddr2 = m_frame[2].base + li;
+// UINT32 fbaddr3 = m_frame[3].base + li;
+
+ for (int i=0; i < width; i++)
+ {
+ UINT16 pix0 = vram16[fbaddr0 ^ NATIVE_ENDIAN_VALUE_LE_BE(1,0)];
+ UINT16 pix1 = vram16[fbaddr1 ^ NATIVE_ENDIAN_VALUE_LE_BE(1,0)];
+// UINT16 pix2 = vram16[fbaddr2 ^ NATIVE_ENDIAN_VALUE_LE_BE(1,0)];
+// UINT16 pix3 = vram16[fbaddr3 ^ NATIVE_ENDIAN_VALUE_LE_BE(1,0)];
+
+ if (pix0 & 0x8000)
+ {
+ d[i] = pix0 & 0x7fff;
+ }
+ else
+ {
+ d[i] = pix1 & 0x7fff;
+ }
+
+ fbaddr0++;
+ fbaddr1++;
+// fbaddr2++;
+// fbaddr3++;
+ }
+ }
-void firebeat_state::gcu_draw_object(bitmap_ind16 &bitmap, const rectangle &cliprect, int chip, UINT32 *cmd)
+ return 0;
+}
+
+void firebeat_gcu_device::draw_object(UINT32 *cmd)
{
- // 0x00: xxx----- -------- -------- -------- command type
+ // 0x00: xxx----- -------- -------- -------- command (5)
+ // 0x00: ---x---- -------- -------- -------- 0: absolute coordinates
+ // 1: relative coordinates from framebuffer origin
+ // 0x00: ----xx-- -------- -------- -------- ?
// 0x00: -------- xxxxxxxx xxxxxxxx xxxxxxxx object data address in vram
// 0x01: -------- -------- ------xx xxxxxxxx object x
- // 0x01: -------- ----xxxx xxxxxx-- -------- object y
+ // 0x01: -------- xxxxxxxx xxxxxx-- -------- object y
// 0x01: -----x-- -------- -------- -------- object x flip
// 0x01: ----x--- -------- -------- -------- object y flip
- // 0x01: ---x---- -------- -------- -------- object alpha enable (?)
+ // 0x01: --xx---- -------- -------- -------- object alpha enable (different blend modes?)
+ // 0x01: -x------ -------- -------- -------- object transparency enable (?)
// 0x02: -------- -------- ------xx xxxxxxxx object width
// 0x02: -------- -----xxx xxxxxx-- -------- object x scale
@@ -301,53 +485,49 @@ void firebeat_state::gcu_draw_object(bitmap_ind16 &bitmap, const rectangle &clip
// 0x03: -------- -------- ------xx xxxxxxxx object height
// 0x03: -------- -----xxx xxxxxx-- -------- object y scale
- int x = cmd[1] & 0x3ff;
- int y = (cmd[1] >> 10) & 0x3ff;
- int width = (cmd[2] & 0x3ff) + 1;
- int height = (cmd[3] & 0x3ff) + 1;
- int xscale = (cmd[2] >> 10) & 0x1ff;
- int yscale = (cmd[3] >> 10) & 0x1ff;
- int xflip = (cmd[1] & 0x04000000) ? 1 : 0;
- int yflip = (cmd[1] & 0x08000000) ? 1 : 0;
- int alpha_enable = (cmd[1] & 0x10000000) ? 1 : 0;
- UINT32 address = cmd[0] & 0xffffff;
- int alpha_level = (cmd[2] >> 27) & 0x1f;
+ int x = cmd[1] & 0x3ff;
+ int y = (cmd[1] >> 10) & 0x3fff;
+ int width = (cmd[2] & 0x3ff) + 1;
+ int height = (cmd[3] & 0x3ff) + 1;
+ int xscale = (cmd[2] >> 10) & 0x1ff;
+ int yscale = (cmd[3] >> 10) & 0x1ff;
+ bool xflip = (cmd[1] & 0x04000000) ? true : false;
+ bool yflip = (cmd[1] & 0x08000000) ? true : false;
+ bool alpha_enable = (cmd[1] & 0x30000000) ? true : false;
+ bool trans_enable = (cmd[1] & 0x40000000) ? true : false;
+ UINT32 address = cmd[0] & 0xffffff;
+ int alpha_level = (cmd[2] >> 27) & 0x1f;
+ bool relative_coords = (cmd[0] & 0x10000000) ? true : false;
+
+ if (relative_coords)
+ {
+ x += m_fb_origin_x;
+ y += m_fb_origin_y;
+ }
- int i, j;
- int u, v;
- UINT16 *vr = (UINT16*)m_gcu[chip].vram;
+ UINT16 *vram16 = (UINT16*)m_vram;
if (xscale == 0 || yscale == 0)
{
- xscale = 0x40;
- yscale = 0x40;
return;
}
- //if ((cmd[2] >> 24) != 0x84 && (cmd[2] >> 24) != 0x04 && (cmd[2] >> 24) != 0x00)
- // printf("Unknown value = %d, %d\n", (cmd[2] >> 27) & 0x1f, (cmd[2] >> 22) & 0x1f);
+#if PRINT_GCU
+ printf("%s Draw Object %08X, x %d, y %d, w %d, h %d [%08X %08X %08X %08X]\n", basetag(), address, x, y, width, height, cmd[0], cmd[1], cmd[2], cmd[3]);
+#endif
- width = (((width * 65536) / xscale) * 64) / 65536;
- height = (((height * 65536) / yscale) * 64) / 65536;
+ width = (((width * 65536) / xscale) * 64) / 65536;
+ height = (((height * 65536) / yscale) * 64) / 65536;
- if (y > cliprect.max_y || x > cliprect.max_x) {
- return;
- }
- if ((y+height) > cliprect.max_y) {
- height = cliprect.max_y - y;
- }
- if ((x+width) > cliprect.max_x) {
- width = cliprect.max_x - x;
- }
+ int fb_pitch = 1024;
- v = 0;
- for (j=0; j < height; j++)
+ int v = 0;
+ for (int j=0; j < height; j++)
{
- int xi;
int index;
- UINT16 *d = &bitmap.pix16(j+y, x);
- //int index = address + ((v >> 6) * 1024);
-
+ int xinc;
+ UINT32 fbaddr = ((j+y) * fb_pitch) + x;
+
if (yflip)
{
index = address + ((height - 1 - (v >> 6)) * 1024);
@@ -359,45 +539,26 @@ void firebeat_state::gcu_draw_object(bitmap_ind16 &bitmap, const rectangle &clip
if (xflip)
{
- d += width;
- xi = -1;
+ fbaddr += width;
+ xinc = -1;
}
else
{
- xi = 1;
+ xinc = 1;
}
- u = 0;
- for (i=0; i < width; i++)
+ int u = 0;
+ for (int i=0; i < width; i++)
{
- UINT16 pix = vr[((index + (u >> 6)) ^ 1) & 0xffffff];
-
+ UINT16 pix = vram16[((index + (u >> 6)) ^ NATIVE_ENDIAN_VALUE_LE_BE(1,0)) & 0xffffff];
+ bool draw = !trans_enable || (trans_enable && (pix & 0x8000));
if (alpha_enable)
{
- if (pix & 0x8000)
+ if (draw)
{
if ((pix & 0x7fff) != 0)
{
- //*d = pix & 0x7fff;
- UINT16 srcpix = *d;
- /*
- UINT32 r = pix & 0x7c00;
- UINT32 g = pix & 0x03e0;
- UINT32 b = pix & 0x001f;
-
- UINT32 sr = srcpix & 0x7c00;
- UINT32 sg = srcpix & 0x03e0;
- UINT32 sb = srcpix & 0x001f;
-
- sr += r;
- sg += g;
- sb += b;
- if (sr > 0x7c00) sr = 0x7c00;
- if (sg > 0x03e0) sg = 0x03e0;
- if (sb > 0x001f) sb = 0x001f;
-
- *d = sr | sg | sb;
- */
+ UINT16 srcpix = vram16[fbaddr ^ NATIVE_ENDIAN_VALUE_LE_BE(1,0)];
UINT32 sr = (srcpix >> 10) & 0x1f;
UINT32 sg = (srcpix >> 5) & 0x1f;
@@ -414,22 +575,19 @@ void firebeat_state::gcu_draw_object(bitmap_ind16 &bitmap, const rectangle &clip
if (sg > 0x1f) sg = 0x1f;
if (sb > 0x1f) sb = 0x1f;
- *d = (sr << 10) | (sg << 5) | sb;
+ vram16[fbaddr ^ NATIVE_ENDIAN_VALUE_LE_BE(1,0)] = (sr << 10) | (sg << 5) | sb | 0x8000;
}
}
}
else
{
- if (pix & 0x8000)
+ if (draw)
{
- *d = pix & 0x7fff;
+ vram16[fbaddr ^ NATIVE_ENDIAN_VALUE_LE_BE(1,0)] = pix | 0x8000;
}
}
- if ((cmd[0] & 0x10000000) == 0)
- *d = 0x7fff;
-
- d += xi;
+ fbaddr += xinc;
u += xscale;
}
@@ -437,56 +595,70 @@ void firebeat_state::gcu_draw_object(bitmap_ind16 &bitmap, const rectangle &clip
}
}
-void firebeat_state::gcu_fill_rect(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT32 *cmd)
+void firebeat_gcu_device::fill_rect(UINT32 *cmd)
{
- int i, j;
- int x1, y1, x2, y2;
+ // 0x00: xxx----- -------- -------- -------- command (4)
+ // 0x00: ---x---- -------- -------- -------- 0: absolute coordinates
+ // 1: relative coordinates from framebuffer origin
+ // 0x00: ----xx-- -------- -------- -------- ?
+ // 0x00: -------- -------- ------xx xxxxxxxx width
+ // 0x00: -------- ----xxxx xxxxxx-- -------- height
- int x = cmd[1] & 0x3ff;
- int y = (cmd[1] >> 10) & 0x3ff;
- int width = (cmd[0] & 0x3ff) + 1;
- int height = ((cmd[0] >> 10) & 0x3ff) + 1;
+ // 0x01: -------- -------- ------xx xxxxxxxx x
+ // 0x01: -------- xxxxxxxx xxxxxx-- -------- y
- UINT16 color[4];
+ // 0x02: xxxxxxxx xxxxxxxx -------- -------- fill pattern pixel 0
+ // 0x02: -------- -------- xxxxxxxx xxxxxxxx fill pattern pixel 1
- color[0] = (cmd[2] >> 16);
- color[1] = (cmd[2] >> 0);
- color[2] = (cmd[3] >> 16);
- color[3] = (cmd[3] >> 0);
+ // 0x03: xxxxxxxx xxxxxxxx -------- -------- fill pattern pixel 2
+ // 0x03: -------- -------- xxxxxxxx xxxxxxxx fill pattern pixel 3
- x1 = x;
- x2 = x + width;
- y1 = y;
- y2 = y + height;
+ int x = cmd[1] & 0x3ff;
+ int y = (cmd[1] >> 10) & 0x3fff;
+ int width = (cmd[0] & 0x3ff) + 1;
+ int height = ((cmd[0] >> 10) & 0x3ff) + 1;
+ bool relative_coords = (cmd[0] & 0x10000000) ? true : false;
- if ((color[0] & 0x8000) == 0 && (color[1] & 0x8000) == 0 && (color[2] & 0x8000) == 0 && (color[3] & 0x8000) == 0)
+ if (relative_coords)
{
- // optimization, nothing to fill
- return;
+ x += m_fb_origin_x;
+ y += m_fb_origin_y;
}
- // clip
- if (x1 < cliprect.min_x) x1 = cliprect.min_x;
- if (y1 < cliprect.min_y) y1 = cliprect.min_y;
- if (x2 > cliprect.max_x) x2 = cliprect.max_x;
- if (y2 > cliprect.max_y) y2 = cliprect.max_y;
+ UINT16 color[4];
+ color[0] = (cmd[2] >> 16);
+ color[1] = (cmd[2] & 0xffff);
+ color[2] = (cmd[3] >> 16);
+ color[3] = (cmd[3] & 0xffff);
+
+#if PRINT_GCU
+ printf("%s Fill Rect x %d, y %d, w %d, h %d, %08X %08X [%08X %08X %08X %08X]\n", basetag(), x, y, width, height, cmd[2], cmd[3], cmd[0], cmd[1], cmd[2], cmd[3]);
+#endif
+
+ int x1 = x;
+ int x2 = x + width;
+ int y1 = y;
+ int y2 = y + height;
+
+ UINT16 *vram16 = (UINT16*)m_vram;
+
+ int fb_pitch = 1024;
- for (j=y1; j < y2; j++)
+ for (int j=y1; j < y2; j++)
{
- UINT16 *d = &bitmap.pix16(j);
- for (i=x1; i < x2; i++)
+ UINT32 fbaddr = j * fb_pitch;
+ for (int i=x1; i < x2; i++)
{
- if (color[i&3] & 0x8000)
- {
- d[i] = color[i&3] & 0x7fff;
- }
+ vram16[(fbaddr+i) ^ NATIVE_ENDIAN_VALUE_LE_BE(1,0)] = color[i&3];
}
}
}
-void firebeat_state::gcu_draw_character(bitmap_ind16 &bitmap, const rectangle &cliprect, int chip, UINT32 *cmd)
+void firebeat_gcu_device::draw_character(UINT32 *cmd)
{
- // 0x00: xxx----- -------- -------- -------- command type
+ // 0x00: xxx----- -------- -------- -------- command (7)
+ // 0x00: ---x---- -------- -------- -------- 0: absolute coordinates
+ // 1: relative coordinates from framebuffer base (unverified, should be same as other operations)
// 0x00: -------- xxxxxxxx xxxxxxxx xxxxxxxx character data address in vram
// 0x01: -------- -------- ------xx xxxxxxxx character x
@@ -498,345 +670,316 @@ void firebeat_state::gcu_draw_character(bitmap_ind16 &bitmap, const rectangle &c
// 0x03: xxxxxxxx xxxxxxxx -------- -------- color 2
// 0x03: -------- -------- xxxxxxxx xxxxxxxx color 3
- int i, j;
- int x = cmd[1] & 0x3ff;
- int y = (cmd[1] >> 10) & 0x3ff;
- UINT32 address = cmd[0] & 0xffffff;
+ int x = cmd[1] & 0x3ff;
+ int y = (cmd[1] >> 10) & 0x3ff;
+ UINT32 address = cmd[0] & 0xffffff;
UINT16 color[4];
+ bool relative_coords = (cmd[0] & 0x10000000) ? true : false;
- UINT16 *vr = (UINT16*)m_gcu[chip].vram;
-
- color[0] = (cmd[2] >> 16) & 0xffff;
- color[1] = (cmd[2] >> 0) & 0xffff;
- color[2] = (cmd[3] >> 16) & 0xffff;
- color[3] = (cmd[3] >> 0) & 0xffff;
+ if (relative_coords)
+ {
+ x += m_fb_origin_x;
+ y += m_fb_origin_y;
+ }
+ color[0] = cmd[2] >> 16;
+ color[1] = cmd[2] & 0xffff;
+ color[2] = cmd[3] >> 16;
+ color[3] = cmd[3] & 0xffff;
- if (y > cliprect.max_y || x > cliprect.max_x) {
- return;
- }
+#if PRINT_GCU
+ printf("%s Draw Char %08X, x %d, y %d\n", basetag(), address, x, y);
+#endif
+ UINT16 *vram16 = (UINT16*)m_vram;
+ int fb_pitch = 1024;
- for (j=0; j < 8; j++)
+ for (int j=0; j < 8; j++)
{
- UINT16 *d = &bitmap.pix16(y+j, x);
- UINT16 line = vr[address^1];
+ UINT32 fbaddr = (y+j) * fb_pitch;
+ UINT16 line = vram16[address ^ NATIVE_ENDIAN_VALUE_LE_BE(1,0)];
address += 4;
- for (i=0; i < 8; i++)
+ for (int i=0; i < 8; i++)
{
- int pix = (line >> ((7-i) * 2)) & 3;
- d[i] = color[pix];
+ int p = (line >> ((7-i) * 2)) & 3;
+ vram16[(fbaddr+x+i) ^ NATIVE_ENDIAN_VALUE_LE_BE(1,0)] = color[p] | 0x8000;
}
}
}
-void firebeat_state::gcu_exec_display_list(bitmap_ind16 &bitmap, const rectangle &cliprect, int chip, UINT32 address)
+void firebeat_gcu_device::fb_config(UINT32 *cmd)
+{
+ // 0x00: xxx----- -------- -------- -------- command (3)
+
+ // 0x01: -------- -------- -------- -------- unused?
+
+ // 0x02: -------- -------- ------xx xxxxxxxx Framebuffer Origin X
+
+ // 0x03: -------- -------- --xxxxxx xxxxxxxx Framebuffer Origin Y
+
+#if PRINT_GCU
+ printf("%s FB Config %08X %08X %08X %08X\n", basetag(), cmd[0], cmd[1], cmd[2], cmd[3]);
+#endif
+
+ m_fb_origin_x = cmd[2] & 0x3ff;
+ m_fb_origin_y = cmd[3] & 0x3fff;
+}
+
+void firebeat_gcu_device::execute_display_list(UINT32 addr)
{
+ bool end = false;
+
int counter = 0;
- int end = 0;
- int i = address / 4;
- if (i < 0) i = 0;
- while (!end && counter < 0x1000 && i < (0x2000000/4))
+#if PRINT_GCU
+ printf("%s Exec Display List %08X\n", basetag(), addr);
+#endif
+
+ addr /= 2;
+ while (!end && counter < 0x1000 && addr < (0x2000000/4))
{
- int command;
- UINT32 cmd[4];
- cmd[0] = m_gcu[chip].vram[i+0];
- cmd[1] = m_gcu[chip].vram[i+1];
- cmd[2] = m_gcu[chip].vram[i+2];
- cmd[3] = m_gcu[chip].vram[i+3];
+ UINT32 *cmd = &m_vram[addr];
+ addr += 4;
- command = (cmd[0] >> 29) & 0x7;
+ int command = (cmd[0] >> 29) & 0x7;
switch (command)
{
- case 0x0: // ???
- {
+ case 0: // NOP?
break;
- }
- case 0x1: // Branch
- {
- gcu_exec_display_list(bitmap, cliprect, chip, cmd[0] & 0xffffff);
+ case 1: // Execute display list
+ execute_display_list(cmd[0] & 0xffffff);
break;
- }
- case 0x2: // End of display list
- {
- end = 1;
+ case 2: // End of display list
+ end = true;
break;
- }
- case 0x3: // ???
- {
+ case 3: // Framebuffer config
+ fb_config(cmd);
break;
- }
- case 0x4: // Fill rectangle
- {
- gcu_fill_rect(bitmap, cliprect, cmd);
+ case 4: // Fill rectangle
+ fill_rect(cmd);
break;
- }
- case 0x5: // Draw object
- {
- gcu_draw_object(bitmap, cliprect, chip, cmd);
+ case 5: // Draw object
+ draw_object(cmd);
break;
- }
- case 0x7: // Draw 8x8 Character (2-bits per pixel)
- {
- gcu_draw_character(bitmap, cliprect, chip, cmd);
+ case 7: // Draw 8x8 character (2 bits per pixel)
+ draw_character(cmd);
break;
- }
default:
- //printf("Unknown command %08X %08X %08X %08X at %08X\n", cmd[0], cmd[1], cmd[2], cmd[3], i*4);
+ printf("GCU Unknown command %08X %08X %08X %08X\n", cmd[0], cmd[1], cmd[2], cmd[3]);
break;
}
-
- i += 4;
counter++;
};
}
-UINT32 firebeat_state::update_screen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int chip)
+void firebeat_gcu_device::execute_command(UINT32* cmd)
{
- bitmap.fill(0, cliprect);
-
- if ((core_strnicmp(machine().system().name, "popn", 4) == 0) || (core_strnicmp(machine().system().name, "bm3", 3) == 0))
- {
- gcu_exec_display_list( bitmap, cliprect, chip, 0x1f80000);
- }
- else
- {
- if (m_layer >= 2)
- {
- gcu_exec_display_list(bitmap, cliprect, chip, 0x8000);
- gcu_exec_display_list(bitmap, cliprect, chip, 0x0000);
- gcu_exec_display_list(bitmap, cliprect, chip, 0x10000);
- }
- else if (m_layer == 0)
- {
- gcu_exec_display_list(bitmap, cliprect, chip, 0x200000);
+ int command = (cmd[0] >> 29) & 0x7;
- //gcu_exec_display_list(bitmap, cliprect, chip, 0x186040);
- }
- else if (m_layer == 1)
- {
- gcu_exec_display_list(bitmap, cliprect, chip, 0x1d0800);
-
- gcu_exec_display_list(bitmap, cliprect, chip, 0x1a9440);
- }
- }
+#if PRINT_GCU
+ printf("%s Exec Command %08X, %08X, %08X, %08X\n", basetag(), cmd[0], cmd[1], cmd[2], cmd[3]);
+#endif
- m_tick++;
- if (m_tick >= 5)
+ switch (command)
{
- m_tick = 0;
- if (machine().input().code_pressed(KEYCODE_0))
- {
- m_layer++;
- if (m_layer > 2)
- {
- m_layer = 0;
- }
- }
+ case 0: // NOP?
+ break;
- /*
- if (machine().input().code_pressed_once(KEYCODE_9))
- {
- FILE *file = fopen("vram0.bin", "wb");
- int i;
-
- for (i=0; i < 0x2000000/4; i++)
- {
- fputc((m_gcu[0].vram[i] >> 24) & 0xff, file);
- fputc((m_gcu[0].vram[i] >> 16) & 0xff, file);
- fputc((m_gcu[0].vram[i] >> 8) & 0xff, file);
- fputc((m_gcu[0].vram[i] >> 0) & 0xff, file);
- }
-
- fclose(file);
- file = fopen("vram1.bin", "wb");
-
- for (i=0; i < 0x2000000/4; i++)
- {
- fputc((m_gcu[1].vram[i] >> 24) & 0xff, file);
- fputc((m_gcu[1].vram[i] >> 16) & 0xff, file);
- fputc((m_gcu[1].vram[i] >> 8) & 0xff, file);
- fputc((m_gcu[1].vram[i] >> 0) & 0xff, file);
- }
-
- fclose(file);
- }
- */
- }
+ case 1: // Execute display list
+ execute_display_list(cmd[0] & 0xffffff);
+ break;
- return 0;
-}
+ case 2: // End of display list
+ break;
-UINT32 firebeat_state::screen_update_firebeat_0(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect){ return update_screen(screen, bitmap, cliprect, 0); }
-UINT32 firebeat_state::screen_update_firebeat_1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect){ return update_screen(screen, bitmap, cliprect, 1); }
+ case 3: // Framebuffer config
+ fb_config(cmd);
+ break;
-UINT32 firebeat_state::GCU_r(int chip, UINT32 offset, UINT32 mem_mask)
-{
- int reg = offset * 4;
+ case 4: // Fill rectangle
+ fill_rect(cmd);
+ break;
- /* VRAM Read */
- if (reg >= 0x80 && reg < 0x100)
- {
- return m_gcu[chip].vram[m_gcu[chip].vram_read_address + ((reg/4) - 0x20)];
- }
+ case 5: // Draw object
+ draw_object(cmd);
+ break;
- switch(reg)
- {
- case 0x78: /* GCU Status */
- /* ppd checks bits 0x0041 of the upper halfword on interrupt */
- return 0xffff0005;
+ case 7: // Draw 8x8 character (2 bits per pixel)
+ draw_character(cmd);
+ break;
default:
+ printf("GCU Unknown command %08X %08X %08X %08X\n", cmd[0], cmd[1], cmd[2], cmd[3]);
break;
}
+}
- return 0xffffffff;
+void firebeat_gcu_device::device_start()
+{
+ m_cpu = machine().device(m_cputag);
+
+ m_vram = auto_alloc_array(machine(), UINT32, 0x2000000/4);
+ memset(m_vram, 0, 0x2000000);
}
-void firebeat_state::GCU_w(int chip, UINT32 offset, UINT32 data, UINT32 mem_mask)
+void firebeat_gcu_device::device_reset()
{
- int reg = offset * 4;
+ m_vram_read_addr = 0;
+ m_command_fifo0_ptr = 0;
+ m_command_fifo1_ptr = 0;
+ m_vram_fifo0_addr = 0;
+ m_vram_fifo1_addr = 0;
- if (reg != 0x70 && chip == 0)
+ for (int i=0; i < 4; i++)
{
- //printf("%s:gcu%d_w: %08X, %08X, %08X at %08X\n", machine().describe_context(), chip, data, offset, mem_mask);
- //logerror("%s:gcu%d_w: %08X, %08X, %08X at %08X\n", cmachine->describe_context(), hip, data, offset, mem_mask);
+ m_frame[i].base = 0;
+ m_frame[i].width = 0;
+ m_frame[i].height = 0;
}
+}
- switch(reg)
+void firebeat_gcu_device::device_stop()
+{
+#if DUMP_VRAM
+ char filename[200];
+ sprintf(filename, "%s_vram.bin", basetag());
+ printf("dumping %s\n", filename);
+ FILE *file = fopen(filename, "wb");
+ int i;
+
+ for (i=0; i < 0x2000000/4; i++)
{
- case 0x10: /* ??? */
- /* IRQ clear/enable; ppd writes bit off then on in response to interrupt */
- /* it enables bits 0x41, but 0x01 seems to be the one it cares about */
- if (ACCESSING_BITS_16_31 && (data & 0x0001) == 0)
- m_maincpu->set_input_line(INPUT_LINE_IRQ0, CLEAR_LINE);
- break;
-
- case 0x30:
- //case 0x34:
- //case 0x38:
- //case 0x3c:
- {
- COMBINE_DATA( &m_gcu[chip].visible_area );
- if (ACCESSING_BITS_0_15)
- {
- screen_device_iterator iter(machine().root_device());
- screen_device *screen = iter.byindex(chip);
-
- if (screen != NULL)
- {
- rectangle visarea = screen->visible_area();
- int width, height;
-
- width = (m_gcu[chip].visible_area & 0xffff);
- height = (m_gcu[chip].visible_area >> 16) & 0xffff;
-
- visarea.max_x = width-1;
- visarea.max_y = height-1;
+ fputc((m_vram[i] >> 24) & 0xff, file);
+ fputc((m_vram[i] >> 16) & 0xff, file);
+ fputc((m_vram[i] >> 8) & 0xff, file);
+ fputc((m_vram[i] >> 0) & 0xff, file);
+ }
+
+ fclose(file);
+#endif
+}
- screen->configure(visarea.max_x + 1, visarea.max_y + 1, visarea, screen->frame_period().attoseconds);
- }
- }
- break;
- }
- case 0x40: /* framebuffer config */
- // HACK: switch display lists at the right times for the ParaParaParadise games until we
- // do the video emulation properly
- if (core_strnicmp(machine().system().name, "pp", 2) == 0)
- {
- switch (data)
- {
- case 0x00080000: // post
- m_layer = 0;
- break;
-
- case 0x00008400: // startup tests
- if (m_layer != 2)
- {
- m_layer = 1;
- }
- break;
-
- case 0x00068400: // game & svc menu
- m_layer = 2;
- break;
- }
- }
- else if (core_strnicmp(machine().system().name, "kbm", 3) == 0)
- {
- switch (data)
- {
- case 0x00080000: // post
- m_layer = 0;
- break;
- case 0x0000c400: // game & svn menu
- m_layer = 2;
- break;
- }
- }
- break;
- //case 0x44: /* ??? */
- // break;
- case 0x5c: /* VRAM Read Address */
- m_gcu[chip].vram_read_address = (data & 0xffffff) / 2;
- break;
+class firebeat_state : public driver_device
+{
+public:
+ firebeat_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_work_ram(*this, "work_ram"),
+ m_flash_main(*this, "flash_main"),
+ m_flash_snd1(*this, "flash_snd1"),
+ m_flash_snd2(*this, "flash_snd2"),
+ m_duart_midi(*this, "duart_midi"),
+ m_duart_com(*this, "duart_com"),
+ m_kbd0(*this, "kbd0"),
+ m_kbd1(*this, "kbd1"),
+ m_ata(*this, "ata"),
+ m_gcu0(*this, "gcu0"),
+ m_gcu1(*this, "gcu1")
+ { }
- case 0x60: /* VRAM FIFO Write Address */
- m_gcu[chip].vram_write_fifo_address = (data & 0xffffff) / 2;
+ required_device<ppc4xx_device> m_maincpu;
+ required_shared_ptr<UINT32> m_work_ram;
+ required_device<fujitsu_29f016a_device> m_flash_main;
+ required_device<fujitsu_29f016a_device> m_flash_snd1;
+ required_device<fujitsu_29f016a_device> m_flash_snd2;
+ optional_device<pc16552_device> m_duart_midi;
+ required_device<pc16552_device> m_duart_com;
+ optional_device<midi_keyboard_device> m_kbd0;
+ optional_device<midi_keyboard_device> m_kbd1;
+ required_device<ata_interface_device> m_ata;
+ required_device<firebeat_gcu_device> m_gcu0;
+ required_device<firebeat_gcu_device> m_gcu1;
- // printf("gcu%d_w: %08X, %08X, %08X\n", chip, data, offset, mem_mask);
- break;
+ UINT8 m_extend_board_irq_enable;
+ UINT8 m_extend_board_irq_active;
+// emu_timer *m_keyboard_timer;
+ int m_tick;
+ int m_layer;
+ int m_cab_data_ptr;
+ const int * m_cur_cab_data;
+// int m_keyboard_state[2];
+ UINT8 m_spu_shared_ram[0x400];
+ IBUTTON m_ibutton;
+ int m_ibutton_state;
+ int m_ibutton_read_subkey_ptr;
+ UINT8 m_ibutton_subkey_data[0x40];
+ DECLARE_READ8_MEMBER(soundram_r);
+ DECLARE_DRIVER_INIT(ppd);
+ DECLARE_DRIVER_INIT(kbm);
+ DECLARE_DRIVER_INIT(ppp);
+ DECLARE_MACHINE_START(firebeat);
+ DECLARE_MACHINE_RESET(firebeat);
+ DECLARE_VIDEO_START(firebeat);
+ UINT32 screen_update_firebeat_0(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ UINT32 screen_update_firebeat_1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ INTERRUPT_GEN_MEMBER(firebeat_interrupt);
+ DECLARE_READ32_MEMBER(input_r);
+ DECLARE_READ32_MEMBER(sensor_r );
+ DECLARE_READ32_MEMBER(flashram_r);
+ DECLARE_WRITE32_MEMBER(flashram_w);
+ DECLARE_READ32_MEMBER(soundflash_r);
+ DECLARE_WRITE32_MEMBER(soundflash_w);
+ DECLARE_WRITE_LINE_MEMBER(ata_interrupt);
+ DECLARE_READ32_MEMBER(ata_command_r);
+ DECLARE_WRITE32_MEMBER(ata_command_w);
+ DECLARE_READ32_MEMBER(ata_control_r);
+ DECLARE_WRITE32_MEMBER(ata_control_w);
+// DECLARE_READ32_MEMBER(comm_uart_r);
+// DECLARE_WRITE32_MEMBER(comm_uart_w);
+ DECLARE_READ32_MEMBER(cabinet_r);
+ DECLARE_READ32_MEMBER(keyboard_wheel_r);
+ DECLARE_READ8_MEMBER(midi_uart_r);
+ DECLARE_WRITE8_MEMBER(midi_uart_w);
+ DECLARE_READ32_MEMBER(extend_board_irq_r);
+ DECLARE_WRITE32_MEMBER(extend_board_irq_w);
+ DECLARE_WRITE32_MEMBER(lamp_output_w);
+ DECLARE_WRITE32_MEMBER(lamp_output_kbm_w);
+ DECLARE_WRITE32_MEMBER(lamp_output_ppp_w);
+ DECLARE_WRITE32_MEMBER(lamp_output2_w);
+ DECLARE_WRITE32_MEMBER(lamp_output2_ppp_w);
+ DECLARE_WRITE32_MEMBER(lamp_output3_w);
+ DECLARE_WRITE32_MEMBER(lamp_output3_ppp_w);
+ DECLARE_READ32_MEMBER(ppc_spu_share_r);
+ DECLARE_WRITE32_MEMBER(ppc_spu_share_w);
+ DECLARE_READ16_MEMBER(spu_unk_r);
+// TIMER_CALLBACK_MEMBER(keyboard_timer_callback);
+ void set_ibutton(UINT8 *data);
+ int ibutton_w(UINT8 data);
+ DECLARE_WRITE8_MEMBER(security_w);
+ void init_lights(write32_delegate out1, write32_delegate out2, write32_delegate out3);
+ void init_firebeat();
+ void init_keyboard();
+ DECLARE_WRITE_LINE_MEMBER(sound_irq_callback);
+ DECLARE_WRITE_LINE_MEMBER(midi_uart_ch0_irq_callback);
+ DECLARE_WRITE_LINE_MEMBER(midi_uart_ch1_irq_callback);
+};
- case 0x68: /* Unknown */
- {
- break;
- }
- case 0x70: /* VRAM FIFO Write */
- m_gcu[chip].vram[m_gcu[chip].vram_write_fifo_address] = data;
- m_gcu[chip].vram_write_fifo_address++;
- break;
- default:
- // printf("gcu%d_w: %08X, %08X, %08X\n", chip, data, offset, mem_mask);
- break;
- }
-}
-READ32_MEMBER(firebeat_state::gcu0_r)
-{
- return GCU_r(0, offset, mem_mask);
-}
-WRITE32_MEMBER(firebeat_state::gcu0_w)
-{
- GCU_w(0, offset, data, mem_mask);
-}
-READ32_MEMBER(firebeat_state::gcu1_r)
+VIDEO_START_MEMBER(firebeat_state,firebeat)
{
- return GCU_r(1, offset, mem_mask);
}
-WRITE32_MEMBER(firebeat_state::gcu1_w)
-{
- GCU_w(1, offset, data, mem_mask);
-}
+UINT32 firebeat_state::screen_update_firebeat_0(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect){ return m_gcu0->draw(screen, bitmap, cliprect); }
+UINT32 firebeat_state::screen_update_firebeat_1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect){ return m_gcu1->draw(screen, bitmap, cliprect); }
/*****************************************************************************/
@@ -1508,8 +1651,8 @@ static ADDRESS_MAP_START( firebeat_map, AS_PROGRAM, 32, firebeat_state )
AM_RANGE(0x7dc00000, 0x7dc0000f) AM_DEVREADWRITE8("duart_com", pc16552_device, read, write, 0xffffffff)
AM_RANGE(0x7e000000, 0x7e00003f) AM_DEVREADWRITE8("rtc", rtc65271_device, rtc_r, rtc_w, 0xffffffff)
AM_RANGE(0x7e000100, 0x7e00013f) AM_DEVREADWRITE8("rtc", rtc65271_device, xram_r, xram_w, 0xffffffff)
- AM_RANGE(0x7e800000, 0x7e8000ff) AM_READWRITE(gcu0_r, gcu0_w)
- AM_RANGE(0x7e800100, 0x7e8001ff) AM_READWRITE(gcu1_r, gcu1_w)
+ AM_RANGE(0x7e800000, 0x7e8000ff) AM_DEVREADWRITE("gcu0", firebeat_gcu_device, read, write)
+ AM_RANGE(0x7e800100, 0x7e8001ff) AM_DEVREADWRITE("gcu1", firebeat_gcu_device, read, write)
AM_RANGE(0x7fe00000, 0x7fe0000f) AM_READWRITE(ata_command_r, ata_command_w)
AM_RANGE(0x7fe80000, 0x7fe8000f) AM_READWRITE(ata_control_r, ata_control_w)
AM_RANGE(0x7ff80000, 0x7fffffff) AM_ROM AM_REGION("user1", 0) /* System BIOS */
@@ -1724,6 +1867,12 @@ static MACHINE_CONFIG_START( firebeat, firebeat_state )
/* video hardware */
MCFG_PALETTE_ADD_RRRRRGGGGGBBBBB("palette")
+ MCFG_DEVICE_ADD("gcu0", FIREBEAT_GCU, 0)
+ MCFG_FIREBEAT_GCU_CPU_TAG("maincpu")
+
+ MCFG_DEVICE_ADD("gcu1", FIREBEAT_GCU, 0)
+ MCFG_FIREBEAT_GCU_CPU_TAG("maincpu")
+
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
@@ -1778,6 +1927,12 @@ static MACHINE_CONFIG_START( firebeat2, firebeat_state )
/* video hardware */
MCFG_PALETTE_ADD_RRRRRGGGGGBBBBB("palette")
+ MCFG_DEVICE_ADD("gcu0", FIREBEAT_GCU, 0)
+ MCFG_FIREBEAT_GCU_CPU_TAG("maincpu")
+
+ MCFG_DEVICE_ADD("gcu1", FIREBEAT_GCU, 0)
+ MCFG_FIREBEAT_GCU_CPU_TAG("maincpu")
+
MCFG_SCREEN_ADD("lscreen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
@@ -1830,12 +1985,11 @@ MACHINE_CONFIG_END
enum
{
DS1991_STATE_NORMAL,
- DS1991_STATE_READ_SUBKEY,
+ DS1991_STATE_READ_SUBKEY
};
-
void firebeat_state::set_ibutton(UINT8 *data)
{
int i, j;
diff --git a/src/mame/drivers/firefox.c b/src/mame/drivers/firefox.c
index 236a761b9f6..7d18687fed4 100644
--- a/src/mame/drivers/firefox.c
+++ b/src/mame/drivers/firefox.c
@@ -1,5 +1,5 @@
-// license:???
-// copyright-holders:smf, Aaron Giles, Chris Hardy, Scott Waye
+// license:BSD-3-Clause
+// copyright-holders:smf, Aaron Giles, Chris Hardy
/***************************************************************************
Atari Fire Fox hardware
diff --git a/src/mame/drivers/fortecar.c b/src/mame/drivers/fortecar.c
index 0cbae10e087..1f0dbe28626 100644
--- a/src/mame/drivers/fortecar.c
+++ b/src/mame/drivers/fortecar.c
@@ -1,5 +1,5 @@
// license:???
-// copyright-holders:Angelo Salese, Roberto Fresca, Rob Ragon
+// copyright-holders:Angelo Salese, Roberto Fresca
/*************************************************************************************************
Forte Card
@@ -486,7 +486,7 @@ WRITE8_MEMBER(fortecar_state::ayporta_w)
*/
int i;
- for(i=0;i<8;i++)
+ for(i = 0; i < 8; i++)
output_set_lamp_value(i, (data >> i) & 1);
}
@@ -596,22 +596,22 @@ INPUT_PORTS_END
static const gfx_layout tiles8x8_layout_3bpp =
{
- 8,8,
+ 8, 8,
RGN_FRAC(1,3),
3,
{ RGN_FRAC(2,3)+4, RGN_FRAC(1,3)+4, RGN_FRAC(0,3)+4 },
- { 8,9,10,11,0, 1, 2, 3 },
+ { 8, 9, 10, 11, 0, 1, 2, 3 },
{ 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16 },
16*8
};
static const gfx_layout tiles8x8_layout_6bpp =
{
- 8,8,
+ 8, 8,
RGN_FRAC(1,3),
6,
{ RGN_FRAC(2,3)+0, RGN_FRAC(1,3)+0, RGN_FRAC(0,3)+0, RGN_FRAC(2,3)+4, RGN_FRAC(1,3)+4, RGN_FRAC(0,3)+4 },
- { 8,9,10,11,0, 1, 2, 3 },
+ { 8, 9, 10, 11, 0, 1, 2, 3 },
{ 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16 },
16*8
};
@@ -629,7 +629,7 @@ void fortecar_state::machine_reset()
int i;
/* apparently there's a random fill in there (checked thru trojan TODO: extract proper algorythm) */
- for(i=0;i<m_vram.bytes();i++)
+ for(i = 0; i < m_vram.bytes(); i++)
m_vram[i] = machine().rand();
}
@@ -730,6 +730,6 @@ DRIVER_INIT_MEMBER(fortecar_state,fortecar)
}
-/* YEAR NAME PARENT MACHINE INPUT INIT ROT COMPANY FULLNAME FLAGS LAYOUT */
+/* YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS LAYOUT */
GAMEL( 1994, fortecar, 0, fortecar, fortecar, fortecar_state, fortecar, ROT0, "Fortex Ltd", "Forte Card (Ver 103, English)", GAME_NOT_WORKING, layout_fortecrd )
GAMEL( 1994, fortecrd, fortecar, fortecar, fortecar, fortecar_state, fortecar, ROT0, "Fortex Ltd", "Forte Card (Ver 110, Spanish)", 0, layout_fortecrd )
diff --git a/src/mame/drivers/freekick.c b/src/mame/drivers/freekick.c
index f9043a736f7..25b5a7b6764 100644
--- a/src/mame/drivers/freekick.c
+++ b/src/mame/drivers/freekick.c
@@ -81,7 +81,9 @@ READ8_MEMBER(freekick_state::spinner_r)
WRITE8_MEMBER(freekick_state::pbillrd_bankswitch_w)
{
- membank("bank1")->set_entry(data & 1);
+ m_bank1->set_entry(data & 1);
+ if(m_bank1d)
+ m_bank1d->set_entry(data & 1);
}
WRITE8_MEMBER(freekick_state::nmi_enable_w)
@@ -187,6 +189,11 @@ static ADDRESS_MAP_START( pbillrd_map, AS_PROGRAM, 8, freekick_state )
AM_RANGE(0xfc03, 0xfc03) AM_DEVWRITE("sn4", sn76489a_device, write)
ADDRESS_MAP_END
+static ADDRESS_MAP_START( decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 8, freekick_state )
+ AM_RANGE(0x0000, 0x7fff) AM_ROMBANK("bank0d")
+ AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1d")
+ADDRESS_MAP_END
+
static ADDRESS_MAP_START( freekickb_map, AS_PROGRAM, 8, freekick_state )
AM_RANGE(0x0000, 0xcfff) AM_ROM
AM_RANGE(0xd000, 0xdfff) AM_RAM
@@ -582,7 +589,7 @@ MACHINE_RESET_MEMBER(freekick_state,freekick)
MACHINE_START_MEMBER(freekick_state,pbillrd)
{
- membank("bank1")->configure_entries(0, 2, memregion("maincpu")->base() + 0x10000, 0x4000);
+ m_bank1->configure_entries(0, 2, memregion("maincpu")->base() + 0x8000, 0x4000);
MACHINE_START_CALL_MEMBER(freekick);
}
@@ -645,6 +652,11 @@ static MACHINE_CONFIG_DERIVED( pbillrd, base )
MCFG_MACHINE_RESET_OVERRIDE(freekick_state,freekick)
MACHINE_CONFIG_END
+static MACHINE_CONFIG_DERIVED( pbillrdm, pbillrd )
+ MCFG_CPU_MODIFY("maincpu")
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
+MACHINE_CONFIG_END
+
static MACHINE_CONFIG_DERIVED( freekickb, base )
/* basic machine hardware */
@@ -676,6 +688,7 @@ static MACHINE_CONFIG_DERIVED( gigas, base )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(gigas_map)
MCFG_CPU_IO_MAP(gigas_io_map)
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
MCFG_MACHINE_START_OVERRIDE(freekick_state,freekick)
MCFG_MACHINE_RESET_OVERRIDE(freekick_state,freekick)
@@ -704,11 +717,10 @@ MACHINE_CONFIG_END
*************************************/
ROM_START( pbillrd )
- ROM_REGION( 0x18000, "maincpu", 0 ) /* Z80 Code */
- ROM_LOAD( "pb.18", 0x00000, 0x4000, CRC(9e6275ac) SHA1(482e845e7fb4190da483155bd908ad470373cd5c) )
- ROM_LOAD( "pb.7", 0x04000, 0x4000, CRC(dd438431) SHA1(07a950e38b3f627ecf95e5831e5480abb337a010) )
- ROM_CONTINUE( 0x10000, 0x4000 )
- ROM_LOAD( "pb.9", 0x14000, 0x4000, CRC(089ce80a) SHA1(779be9ba2277a26fbebf4acf9e2f5319a934b0f5) )
+ ROM_REGION( 0x10000, "maincpu", 0 ) /* Z80 Code */
+ ROM_LOAD( "pb.18", 0x0000, 0x4000, CRC(9e6275ac) SHA1(482e845e7fb4190da483155bd908ad470373cd5c) )
+ ROM_LOAD( "pb.7", 0x4000, 0x8000, CRC(dd438431) SHA1(07a950e38b3f627ecf95e5831e5480abb337a010) )
+ ROM_LOAD( "pb.9", 0xc000, 0x4000, CRC(089ce80a) SHA1(779be9ba2277a26fbebf4acf9e2f5319a934b0f5) )
ROM_REGION( 0xc000, "gfx1", 0 ) /* GFX */
ROM_LOAD( "pb.4", 0x000000, 0x04000, CRC(2f4d4dd3) SHA1(ee4facabf591c235c270db4f4d3f612b8c474e57) )
@@ -730,11 +742,10 @@ ROM_START( pbillrd )
ROM_END
ROM_START( pbillrds ) /* Encrytped with a Sega MC-8123 (317-0030) CPU module */
- ROM_REGION( 0x18000, "maincpu", 0 ) /* Z80 Code */
- ROM_LOAD( "10626.8n", 0x00000, 0x4000, CRC(51d725e6) SHA1(d7007c983530780e7fa3686cb7a6d7c382c802fa) ) /* encrypted */
- ROM_LOAD( "10625.8r", 0x04000, 0x4000, CRC(8977c724) SHA1(f00835a04dc6fa7d8c1e382dace515f2aa7d6f44) ) /* encrypted */
- ROM_CONTINUE( 0x10000, 0x4000 )
- ROM_LOAD( "10627.10n", 0x14000, 0x4000, CRC(2335e6dd) SHA1(82352b6f4abea88aad3a96ca63cccccb6e278f48) ) /* encrypted */
+ ROM_REGION( 0x10000, "maincpu", 0 ) /* Z80 Code */
+ ROM_LOAD( "10626.8n", 0x0000, 0x4000, CRC(51d725e6) SHA1(d7007c983530780e7fa3686cb7a6d7c382c802fa) ) /* encrypted */
+ ROM_LOAD( "10625.8r", 0x4000, 0x8000, CRC(8977c724) SHA1(f00835a04dc6fa7d8c1e382dace515f2aa7d6f44) ) /* encrypted */
+ ROM_LOAD( "10627.10n", 0xc000, 0x4000, CRC(2335e6dd) SHA1(82352b6f4abea88aad3a96ca63cccccb6e278f48) ) /* encrypted */
ROM_REGION( 0x2000, "user1", 0 ) /* MC8123 key */
ROM_LOAD( "317-0030.key", 0x0000, 0x2000, CRC(9223f06d) SHA1(51a22a4c80fe273526bde68918c13c6476cec383) )
@@ -761,11 +772,10 @@ ROM_END
// all ROMs were HN4827128G-25, except 17, HN27256G-25
// CPU module marked 3?7-500B, but seems to act the same as above
ROM_START( pbillrdsa )
- ROM_REGION( 0x18000, "maincpu", 0 ) /* Z80 Code */
- ROM_LOAD( "29", 0x00000, 0x4000, CRC(da020258) SHA1(172276061c2e06bcf3477488734a72598412181b) ) /* encrypted */ // label scraped off, might be 20
- ROM_LOAD( "17", 0x04000, 0x4000, CRC(9bb3d467) SHA1(5d61c80c920363cbcb548f4a08434e2a05b3d5f3) ) /* encrypted */
- ROM_CONTINUE( 0x10000, 0x4000 )
- ROM_LOAD( "19", 0x14000, 0x4000, CRC(2335e6dd) SHA1(82352b6f4abea88aad3a96ca63cccccb6e278f48) ) /* encrypted */
+ ROM_REGION( 0x10000, "maincpu", 0 ) /* Z80 Code */
+ ROM_LOAD( "29", 0x0000, 0x4000, CRC(da020258) SHA1(172276061c2e06bcf3477488734a72598412181b) ) /* encrypted */ // label scraped off, might be 20
+ ROM_LOAD( "17", 0x4000, 0x8000, CRC(9bb3d467) SHA1(5d61c80c920363cbcb548f4a08434e2a05b3d5f3) ) /* encrypted */
+ ROM_LOAD( "19", 0xc000, 0x4000, CRC(2335e6dd) SHA1(82352b6f4abea88aad3a96ca63cccccb6e278f48) ) /* encrypted */
ROM_REGION( 0x2000, "user1", 0 ) /* MC8123 key */
ROM_LOAD( "317-0030.key", 0x0000, 0x2000, CRC(9223f06d) SHA1(51a22a4c80fe273526bde68918c13c6476cec383) )
@@ -1034,12 +1044,12 @@ ROM_START( countrunb2 )
ROM_END
ROM_START( gigasm2b )
- ROM_REGION( 2*0x10000, "maincpu", 0 )
- ROM_LOAD( "8.rom", 0x10000, 0x4000, CRC(c00a4a6c) SHA1(0d1bb849c9bfe4e92ad70e4ef19da494c0bd7ba8) )
+ ROM_REGION( 2*0xc000, "maincpu", 0 )
+ ROM_LOAD( "8.rom", 0x0c000, 0x4000, CRC(c00a4a6c) SHA1(0d1bb849c9bfe4e92ad70e4ef19da494c0bd7ba8) )
ROM_CONTINUE( 0x00000, 0x4000 )
- ROM_LOAD( "7.rom", 0x14000, 0x4000, CRC(92bd9045) SHA1(e4d8a94deeb795bb284ca0bd211ed40ed498b172) )
+ ROM_LOAD( "7.rom", 0x10000, 0x4000, CRC(92bd9045) SHA1(e4d8a94deeb795bb284ca0bd211ed40ed498b172) )
ROM_CONTINUE( 0x04000, 0x4000 )
- ROM_LOAD( "9.rom", 0x18000, 0x4000, CRC(a3ef809c) SHA1(6d4098658aa124e10e5edb8e8e3abe0aa26741a1) )
+ ROM_LOAD( "9.rom", 0x14000, 0x4000, CRC(a3ef809c) SHA1(6d4098658aa124e10e5edb8e8e3abe0aa26741a1) )
ROM_CONTINUE( 0x08000, 0x4000 )
ROM_REGION( 0xc000, "gfx1", 0 ) /* GFX */
@@ -1111,10 +1121,10 @@ Note: MCU dump has fixed bits, but read is good. If not correct, it's protected.
*/
ROM_START( gigasb )
- ROM_REGION( 2*0x10000, "maincpu", 0 )
- ROM_LOAD( "g-7", 0x10000, 0x4000, CRC(daf4e88d) SHA1(391dff914ce8e9b7975fc8827c066d7db16c4171) )
+ ROM_REGION( 2*0xc000, "maincpu", 0 )
+ ROM_LOAD( "g-7", 0x0c000, 0x4000, CRC(daf4e88d) SHA1(391dff914ce8e9b7975fc8827c066d7db16c4171) )
ROM_CONTINUE( 0x00000, 0x4000 )
- ROM_LOAD( "g-8", 0x14000, 0x8000, CRC(4ab4c1f1) SHA1(63d8f489c7a8271e99a66d97e6eb0eb252cb2b67) )
+ ROM_LOAD( "g-8", 0x10000, 0x8000, CRC(4ab4c1f1) SHA1(63d8f489c7a8271e99a66d97e6eb0eb252cb2b67) )
ROM_CONTINUE( 0x04000, 0x8000 )
ROM_REGION( 0xc000, "gfx1", 0 ) /* GFX */
@@ -1137,8 +1147,8 @@ ROM_START( gigasb )
ROM_END
ROM_START( oigas )
- ROM_REGION( 2*0x10000, "maincpu", 0 )
- ROM_LOAD( "rom.7", 0x10000, 0x4000, CRC(e5bc04cc) SHA1(ffbd416313a9e49d2f9a7268d5ef48a8b641e480) )
+ ROM_REGION( 2*0xc000, "maincpu", 0 )
+ ROM_LOAD( "rom.7", 0x0c000, 0x4000, CRC(e5bc04cc) SHA1(ffbd416313a9e49d2f9a7268d5ef48a8b641e480) )
ROM_CONTINUE( 0x00000, 0x4000)
ROM_LOAD( "rom.8", 0x04000, 0x8000, CRC(c199060d) SHA1(de8f1e0f941533abbbed25b595b1d51fadbb428d) )
@@ -1174,19 +1184,25 @@ ROM_END
DRIVER_INIT_MEMBER(freekick_state,gigasb)
{
- address_space &space = m_maincpu->space(AS_PROGRAM);
- space.set_decrypted_region(0x0000, 0xbfff, memregion("maincpu")->base() + 0x10000);
+ membank("bank0d")->set_base(memregion("maincpu")->base() + 0xc000);
+ m_bank1d->set_base(memregion("maincpu")->base() + 0x14000);
}
DRIVER_INIT_MEMBER(freekick_state,pbillrds)
{
- mc8123_decrypt_rom(machine(), "maincpu", "user1", "bank1", 2);
+ UINT8 *decrypted_opcodes = auto_alloc_array(machine(), UINT8, 0x10000);
+ mc8123_decode(memregion("maincpu")->base(), decrypted_opcodes, memregion("user1")->base(), 0x10000);
+ membank("bank0d")->set_base(decrypted_opcodes);
+ m_bank1d->configure_entries(0, 2, decrypted_opcodes + 0x8000, 0x4000);
}
DRIVER_INIT_MEMBER(freekick_state,gigas)
{
- mc8123_decrypt_rom(machine(), "maincpu", "user1", NULL, 1);
+ UINT8 *decrypted_opcodes = auto_alloc_array(machine(), UINT8, 0xc000);
+ mc8123_decode(memregion("maincpu")->base(), decrypted_opcodes, memregion("user1")->base(), 0xc000);
+ membank("bank0d")->set_base(decrypted_opcodes);
+ m_bank1d->set_base(decrypted_opcodes + 0x8000);
}
@@ -1203,8 +1219,8 @@ GAME( 1986, gigasb, gigas, gigas, gigas, freekick_state, gigasb, R
GAME( 1986, oigas, gigas , oigas, gigas, freekick_state, gigasb, ROT270, "bootleg", "Oigas (bootleg)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
GAME( 1986, gigasm2b, 0, gigas, gigasm2, freekick_state, gigasb, ROT270, "bootleg", "Gigas Mark II (bootleg)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
GAME( 1987, pbillrd, 0, pbillrd, pbillrd, driver_device, 0, ROT0, "Nihon System", "Perfect Billiard", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
-GAME( 1987, pbillrds, pbillrd, pbillrd, pbillrd, freekick_state, pbillrds,ROT0, "Nihon System", "Perfect Billiard (MC-8123, 317-0030)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
-GAME( 1987, pbillrdsa, pbillrd, pbillrd, pbillrd, freekick_state, pbillrds,ROT0, "Nihon System", "Perfect Billiard (MC-8123, 317-5008)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) // sticker on CPU module different (wrong?) functionality the same
+GAME( 1987, pbillrds, pbillrd, pbillrdm, pbillrd, freekick_state, pbillrds,ROT0, "Nihon System", "Perfect Billiard (MC-8123, 317-0030)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
+GAME( 1987, pbillrdsa, pbillrd, pbillrdm, pbillrd, freekick_state, pbillrds,ROT0, "Nihon System", "Perfect Billiard (MC-8123, 317-5008)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) // sticker on CPU module different (wrong?) functionality the same
GAME( 1987, freekick, 0, freekickb, freekck, driver_device, 0, ROT270, "Nihon System (Merit license)", "Free Kick (NS6201-A 1987.10)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
GAME( 1987, freekicka, freekick, freekickb, freekck, driver_device, 0, ROT270, "Nihon System", "Free Kick (NS6201-A 1987.9)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
GAME( 1987, freekickb1,freekick, freekickb, freekck, driver_device, 0, ROT270, "bootleg", "Free Kick (bootleg set 1)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/fungames.c b/src/mame/drivers/fungames.c
index 918bf73b50c..f6e63408373 100644
--- a/src/mame/drivers/fungames.c
+++ b/src/mame/drivers/fungames.c
@@ -6,7 +6,7 @@
Biplane (1975)
Biplane 4 (1976)
- King
+ King (1976) - unreleased
Race! (1976)
Take 5 (1975)
Take 7 (1975)
diff --git a/src/mame/drivers/funworld.c b/src/mame/drivers/funworld.c
index 33f2bd74e39..f144bb80cff 100644
--- a/src/mame/drivers/funworld.c
+++ b/src/mame/drivers/funworld.c
@@ -5954,7 +5954,6 @@ DRIVER_INIT_MEMBER(funworld_state, multiwin)
******************************************************/
{
UINT8 *ROM = memregion("maincpu")->base();
- address_space &space = m_maincpu->space(AS_PROGRAM);
int x;
@@ -5971,8 +5970,6 @@ DRIVER_INIT_MEMBER(funworld_state, multiwin)
ROM[x+0x10000] = code;
}
-
- space.set_decrypted_region(0x8000, 0xffff, memregion("maincpu")->base() + 0x18000);
}
@@ -5988,7 +5985,6 @@ DRIVER_INIT_MEMBER(funworld_state, royalcdc)
******************************************************/
UINT8 *ROM = memregion("maincpu")->base();
- address_space &space = m_maincpu->space(AS_PROGRAM);
int x;
@@ -6025,8 +6021,6 @@ DRIVER_INIT_MEMBER(funworld_state, royalcdc)
ROM[x+0x10000] = code;
}
-
- space.set_decrypted_region(0x6000, 0xffff, memregion("maincpu")->base() + 0x16000);
}
diff --git a/src/mame/drivers/galaga.c b/src/mame/drivers/galaga.c
index e30cdbca67b..59e998d6e29 100644
--- a/src/mame/drivers/galaga.c
+++ b/src/mame/drivers/galaga.c
@@ -2601,6 +2601,9 @@ ROM_START( xevious )
ROM_LOAD( "xvi-4.3l", 0x0700, 0x0200, CRC(fd8b9d91) SHA1(87ddf0b9d723aabb422d6d416aa9ec6bc246bf34) ) /* sprite lookup table low bits */
ROM_LOAD( "xvi-5.3m", 0x0900, 0x0200, CRC(bf906d82) SHA1(776168a73d3b9f0ce05610acc8a623deae0a572b) ) /* sprite lookup table high bits */
+ ROM_REGION( 0x0200, "pals_vidbd", 0) /* PAL's located on the video board */
+ ROM_LOAD( "XVI-3.1F", 0x0000, 0x0117, CRC(9192d57a) SHA1(5f36db93b6083767f93aa3a0e4bc2d4fc7e27f9c) ) /* N82S153N */
+
ROM_REGION( 0x0200, "namco", 0 ) /* sound PROMs */
ROM_LOAD( "xvi-2.7n", 0x0000, 0x0100, CRC(550f06bc) SHA1(816a0fafa0b084ac11ae1af70a5186539376fc2a) )
ROM_LOAD( "xvi-1.5n", 0x0100, 0x0100, CRC(77245b66) SHA1(0c4d0bee858b97632411c440bea6948a74759746) ) /* timing - not used */
@@ -2653,8 +2656,8 @@ ROM_START( xeviousa )
ROM_LOAD( "xvi-4.3l", 0x0700, 0x0200, CRC(fd8b9d91) SHA1(87ddf0b9d723aabb422d6d416aa9ec6bc246bf34) ) /* sprite lookup table low bits */
ROM_LOAD( "xvi-5.3m", 0x0900, 0x0200, CRC(bf906d82) SHA1(776168a73d3b9f0ce05610acc8a623deae0a572b) ) /* sprite lookup table high bits */
- ROM_REGION( 0x0001, "pals_vidbd", 0) /* PAL's located on the video board */
- ROM_LOAD( "137294-001.1f", 0x0000, 0x0001, NO_DUMP ) /* N82S153N */
+ ROM_REGION( 0x0200, "pals_vidbd", 0) /* PAL's located on the video board */
+ ROM_LOAD( "XVI-3.1F", 0x0000, 0x0117, CRC(9192d57a) SHA1(5f36db93b6083767f93aa3a0e4bc2d4fc7e27f9c) ) /* N82S153N - 137294-001*/
ROM_REGION( 0x0200, "namco", 0 ) /* sound PROMs */
ROM_LOAD( "xvi-2.7n", 0x0000, 0x0100, CRC(550f06bc) SHA1(816a0fafa0b084ac11ae1af70a5186539376fc2a) )
@@ -2701,8 +2704,8 @@ ROM_START( xeviousb )
ROM_LOAD( "xvi-4.3l", 0x0700, 0x0200, CRC(fd8b9d91) SHA1(87ddf0b9d723aabb422d6d416aa9ec6bc246bf34) ) /* sprite lookup table low bits */
ROM_LOAD( "xvi-5.3m", 0x0900, 0x0200, CRC(bf906d82) SHA1(776168a73d3b9f0ce05610acc8a623deae0a572b) ) /* sprite lookup table high bits */
- ROM_REGION( 0x0001, "pals_vidbd", 0) /* PAL's located on the video board */
- ROM_LOAD( "137294-001.1f", 0x0000, 0x0001, NO_DUMP ) /* N82S153N */
+ ROM_REGION( 0x0200, "pals_vidbd", 0) /* PAL's located on the video board */
+ ROM_LOAD( "XVI-3.1F", 0x0000, 0x0117, CRC(9192d57a) SHA1(5f36db93b6083767f93aa3a0e4bc2d4fc7e27f9c) ) /* N82S153N - 137294-001*/
ROM_REGION( 0x0200, "namco", 0 ) /* sound PROMs */
ROM_LOAD( "xvi-2.7n", 0x0000, 0x0100, CRC(550f06bc) SHA1(816a0fafa0b084ac11ae1af70a5186539376fc2a) )
@@ -2752,8 +2755,8 @@ ROM_START( xeviousc )
ROM_LOAD( "xvi-4.3l", 0x0700, 0x0200, CRC(fd8b9d91) SHA1(87ddf0b9d723aabb422d6d416aa9ec6bc246bf34) ) /* sprite lookup table low bits */
ROM_LOAD( "xvi-5.3m", 0x0900, 0x0200, CRC(bf906d82) SHA1(776168a73d3b9f0ce05610acc8a623deae0a572b) ) /* sprite lookup table high bits */
- ROM_REGION( 0x0001, "pals_vidbd", 0) /* PAL's located on the video board */
- ROM_LOAD( "137294-001.1f", 0x0000, 0x0001, NO_DUMP ) /* N82S153N */
+ ROM_REGION( 0x0200, "pals_vidbd", 0) /* PAL's located on the video board */
+ ROM_LOAD( "XVI-3.1F", 0x0000, 0x0117, CRC(9192d57a) SHA1(5f36db93b6083767f93aa3a0e4bc2d4fc7e27f9c) ) /* N82S153N - 137294-001*/
ROM_REGION( 0x0200, "namco", 0 ) /* sound PROMs */
ROM_LOAD( "xvi-2.7n", 0x0000, 0x0100, CRC(550f06bc) SHA1(816a0fafa0b084ac11ae1af70a5186539376fc2a) )
diff --git a/src/mame/drivers/galaxian.c b/src/mame/drivers/galaxian.c
index 83481bf31af..f9276d41095 100644
--- a/src/mame/drivers/galaxian.c
+++ b/src/mame/drivers/galaxian.c
@@ -1355,6 +1355,10 @@ static ADDRESS_MAP_START( mooncrst_map_base, AS_PROGRAM, 8, galaxian_state )
AM_RANGE(0xb800, 0xb800) AM_MIRROR(0x07ff) AM_READ(watchdog_reset_r)
ADDRESS_MAP_END
+static ADDRESS_MAP_START( moonqsr_decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 8, galaxian_state )
+ AM_RANGE(0x0000, 0x3fff) AM_ROM AM_SHARE("decrypted_opcodes")
+ADDRESS_MAP_END
+
static ADDRESS_MAP_START( mooncrst_map, AS_PROGRAM, 8, galaxian_state )
AM_IMPORT_FROM(mooncrst_map_base)
AM_IMPORT_FROM(mooncrst_map_discrete)
@@ -1670,6 +1674,10 @@ static ADDRESS_MAP_START( mshuttle_map, AS_PROGRAM, 8, galaxian_state )
AM_RANGE(0xb800, 0xb800) AM_READ(watchdog_reset_r)
ADDRESS_MAP_END
+static ADDRESS_MAP_START( mshuttle_decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 8, galaxian_state )
+ AM_RANGE(0x0000, 0x7fff) AM_ROM AM_SHARE("decrypted_opcodes")
+ADDRESS_MAP_END
+
static ADDRESS_MAP_START( mshuttle_portmap, AS_IO, 8, galaxian_state )
ADDRESS_MAP_UNMAP_HIGH
ADDRESS_MAP_GLOBAL_MASK(0x0f)
@@ -5192,6 +5200,11 @@ static MACHINE_CONFIG_DERIVED( mooncrst, galaxian_base )
MCFG_FRAGMENT_ADD(mooncrst_audio)
MACHINE_CONFIG_END
+static MACHINE_CONFIG_DERIVED( moonqsr, mooncrst )
+ MCFG_CPU_MODIFY("maincpu")
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(moonqsr_decrypted_opcodes_map)
+MACHINE_CONFIG_END
+
static MACHINE_CONFIG_DERIVED( fantastc, galaxian_base )
@@ -5289,6 +5302,7 @@ static MACHINE_CONFIG_DERIVED( mshuttle, galaxian_base )
/* basic machine hardware */
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(mshuttle_map)
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(mshuttle_decrypted_opcodes_map)
MCFG_CPU_IO_MAP(mshuttle_portmap)
/* sound hardware */
@@ -5965,7 +5979,7 @@ DRIVER_INIT_MEMBER(galaxian_state,mooncrst)
common_init(&galaxian_state::galaxian_draw_bullet, &galaxian_state::galaxian_draw_background, &galaxian_state::mooncrst_extend_tile_info, &galaxian_state::mooncrst_extend_sprite_info);
/* decrypt program code */
- decode_mooncrst(0x8000, memregion("maincpu")->base());
+ decode_mooncrst(0x4000, memregion("maincpu")->base());
}
@@ -5990,15 +6004,11 @@ DRIVER_INIT_MEMBER(galaxian_state,mooncrgx)
DRIVER_INIT_MEMBER(galaxian_state,moonqsr)
{
- address_space &space = m_maincpu->space(AS_PROGRAM);
- UINT8 *decrypt = auto_alloc_array(machine(), UINT8, 0x8000);
-
/* video extensions */
common_init(&galaxian_state::galaxian_draw_bullet, &galaxian_state::galaxian_draw_background, &galaxian_state::moonqsr_extend_tile_info, &galaxian_state::moonqsr_extend_sprite_info);
/* decrypt program code */
- decode_mooncrst(0x8000, decrypt);
- space.set_decrypted_region(0x0000, 0x7fff, decrypt);
+ decode_mooncrst(0x4000, m_decrypted_opcodes);
}
WRITE8_MEMBER(galaxian_state::artic_gfxbank_w)
@@ -6253,14 +6263,9 @@ DRIVER_INIT_MEMBER(galaxian_state,kong)
void galaxian_state::mshuttle_decode(const UINT8 convtable[8][16])
{
- address_space &space = m_maincpu->space(AS_PROGRAM);
UINT8 *rom = memregion("maincpu")->base();
- UINT8 *decrypt = auto_alloc_array(machine(), UINT8, 0x10000);
- int A;
- space.set_decrypted_region(0x0000, 0xffff, decrypt);
-
- for (A = 0x0000;A < 0x10000;A++)
+ for (int A = 0x0000;A < 0x8000;A++)
{
int i,j;
UINT8 src = rom[A];
@@ -6273,7 +6278,7 @@ void galaxian_state::mshuttle_decode(const UINT8 convtable[8][16])
j = (src & 0x01) | ((src & 0x04) >> 1) | ((src & 0x10) >> 2) | ((src & 0x40) >> 3);
/* decode the opcodes */
- decrypt[A] = (src & 0xaa) | convtable[i][j];
+ m_decrypted_opcodes[A] = (src & 0xaa) | convtable[i][j];
}
}
@@ -9151,7 +9156,7 @@ ROM_END
ROM_START( mshuttle )
- ROM_REGION( 2*0x10000, "maincpu", 0 ) /* 64k for code + 64k for decrypted opcodes */
+ ROM_REGION( 0x8000, "maincpu", 0 )
ROM_LOAD( "my05", 0x0000, 0x1000, CRC(83574af1) SHA1(d69c2a0538a49d6c72c3346ac4e3959d91da6c98) )
ROM_LOAD( "my04", 0x1000, 0x1000, CRC(1cfae2c8) SHA1(6c7eeee70e91b8498c41525dcc60f8086cff8da7) )
ROM_LOAD( "my03", 0x2000, 0x1000, CRC(c8b8a368) SHA1(140ba60f55285d1e9f7a262634f5ce5c3470ab71) )
@@ -9173,7 +9178,7 @@ ROM_START( mshuttle )
ROM_END
ROM_START( mshuttle2 )
- ROM_REGION( 2*0x10000, "maincpu", 0 ) /* 64k for code + 64k for decrypted opcodes */
+ ROM_REGION( 0x8000, "maincpu", 0 )
ROM_LOAD( "my05", 0x0000, 0x1000, CRC(83574af1) SHA1(d69c2a0538a49d6c72c3346ac4e3959d91da6c98) )
ROM_LOAD( "my04", 0x1000, 0x1000, CRC(1cfae2c8) SHA1(6c7eeee70e91b8498c41525dcc60f8086cff8da7) )
ROM_LOAD( "my03", 0x2000, 0x1000, CRC(c8b8a368) SHA1(140ba60f55285d1e9f7a262634f5ce5c3470ab71) )
@@ -9197,7 +9202,7 @@ ROM_END
ROM_START( mshuttlej )
- ROM_REGION( 2*0x10000, "maincpu", 0 ) /* 64k for code + 64k for decrypted opcodes */
+ ROM_REGION( 0x8000, "maincpu", 0 )
ROM_LOAD( "mcs.5", 0x0000, 0x1000, CRC(a5a292b4) SHA1(b4e9d969c762f4114eba88051917df122fc7181f) )
ROM_LOAD( "mcs.4", 0x1000, 0x1000, CRC(acdc0f9e) SHA1(8cd6d6566fe3f4090ccb625c3c1e5850a371826f) )
ROM_LOAD( "mcs.3", 0x2000, 0x1000, CRC(c1e3f5d8) SHA1(d3af89d485b1ca21ac879dbe15490dcd1cd64f2a) )
@@ -9220,7 +9225,7 @@ ROM_START( mshuttlej )
ROM_END
ROM_START( mshuttlej2 )
- ROM_REGION( 2*0x10000, "maincpu", 0 ) /* 64k for code + 64k for decrypted opcodes */
+ ROM_REGION( 0x8000, "maincpu", 0 )
ROM_LOAD( "ali5.bin", 0x0000, 0x1000, CRC(320fe630) SHA1(df4fe25989783c8851f41c9b4b63dedfa365c1e9) )
ROM_LOAD( "mcs.4", 0x1000, 0x1000, CRC(acdc0f9e) SHA1(8cd6d6566fe3f4090ccb625c3c1e5850a371826f) )
ROM_LOAD( "mcs.3", 0x2000, 0x1000, CRC(c1e3f5d8) SHA1(d3af89d485b1ca21ac879dbe15490dcd1cd64f2a) )
@@ -9721,25 +9726,34 @@ ROM_START( theend )
ROM_LOAD( "6331-1j.86", 0x0000, 0x0020, CRC(24652bc4) SHA1(d89575f3749c75dc963317fe451ffeffd9856e4d) )
ROM_END
-ROM_START( theends )
+/*
+All labels are in the form of:
+
+THE END (c)
+RA3 13
+1980 STERN
+
+The above example is for IC13
+*/
+ROM_START( theends ) /* The Stern Electronics license */
ROM_REGION( 0x10000, "maincpu", 0 )
- ROM_LOAD( "ic13", 0x0000, 0x0800, CRC(90e5ab14) SHA1(b926801ab1cc1e2787a76ced6c7cffd6fce753d4) )
- ROM_LOAD( "ic14", 0x0800, 0x0800, CRC(950f0a07) SHA1(bde9f3c6cf060dc6f5b7652287b94e04bed7bcf7) )
- ROM_LOAD( "ic15", 0x1000, 0x0800, CRC(6786bcf5) SHA1(7556d3dc51d6a112b6357b8a36df05fd1a4d1cc9) )
- ROM_LOAD( "ic16", 0x1800, 0x0800, CRC(380a0017) SHA1(3354eb328a32537f722fe8a0949ddcab6cf21eb8) )
- ROM_LOAD( "ic17", 0x2000, 0x0800, CRC(af067b7f) SHA1(855c6ddf29fbfea004c7143fe29064abf53801ad) )
- ROM_LOAD( "ic18", 0x2800, 0x0800, CRC(a0411b93) SHA1(d644968758a1b73d13e09b24d24bfec82276e8f4) )
+ ROM_LOAD( "the_end_ra3_13.ic13", 0x0000, 0x0800, CRC(90e5ab14) SHA1(b926801ab1cc1e2787a76ced6c7cffd6fce753d4) )
+ ROM_LOAD( "the_end_ra3_14.ic14", 0x0800, 0x0800, CRC(950f0a07) SHA1(bde9f3c6cf060dc6f5b7652287b94e04bed7bcf7) )
+ ROM_LOAD( "the_end_ra3_15.ic15", 0x1000, 0x0800, CRC(6786bcf5) SHA1(7556d3dc51d6a112b6357b8a36df05fd1a4d1cc9) )
+ ROM_LOAD( "the_end_ra3_16.ic16", 0x1800, 0x0800, CRC(380a0017) SHA1(3354eb328a32537f722fe8a0949ddcab6cf21eb8) )
+ ROM_LOAD( "the_end_ra3_17.ic17", 0x2000, 0x0800, CRC(af067b7f) SHA1(855c6ddf29fbfea004c7143fe29064abf53801ad) )
+ ROM_LOAD( "the_end_ra3_18.ic18", 0x2800, 0x0800, CRC(a0411b93) SHA1(d644968758a1b73d13e09b24d24bfec82276e8f4) )
ROM_REGION( 0x10000, "audiocpu", 0 )
- ROM_LOAD( "ic56", 0x0000, 0x0800, CRC(3b2c2f70) SHA1(bcccdacacfc9a3b5f1412dfba6bb0046d283bccc) )
- ROM_LOAD( "ic55", 0x0800, 0x0800, CRC(e0429e50) SHA1(27678fc3172cbca3ae1eae96e9d8a62561d5ce40) )
+ ROM_LOAD( "the_end_ra3_56.ic56", 0x0000, 0x0800, CRC(3b2c2f70) SHA1(bcccdacacfc9a3b5f1412dfba6bb0046d283bccc) )
+ ROM_LOAD( "the_end_ra2_55.ic55", 0x0800, 0x0800, CRC(e0429e50) SHA1(27678fc3172cbca3ae1eae96e9d8a62561d5ce40) )
ROM_REGION( 0x1000, "gfx1", 0 )
- ROM_LOAD( "ic30", 0x0000, 0x0800, CRC(527fd384) SHA1(92a384899d5acd2c689f637da16a0e2d11a9d9c6) )
- ROM_LOAD( "ic31", 0x0800, 0x0800, CRC(af6d09b6) SHA1(f3ad51dc88aa58fd39195ead978b039e0b0b585c) )
+ ROM_LOAD( "the_end_ra3_30.ic30", 0x0000, 0x0800, CRC(527fd384) SHA1(92a384899d5acd2c689f637da16a0e2d11a9d9c6) )
+ ROM_LOAD( "the_end_ra3_31.ic31", 0x0800, 0x0800, CRC(af6d09b6) SHA1(f3ad51dc88aa58fd39195ead978b039e0b0b585c) )
ROM_REGION( 0x0020, "proms", 0 )
- ROM_LOAD( "6331-1j.86", 0x0000, 0x0020, CRC(24652bc4) SHA1(d89575f3749c75dc963317fe451ffeffd9856e4d) )
+ ROM_LOAD( "6331-1j.86", 0x0000, 0x0020, CRC(24652bc4) SHA1(d89575f3749c75dc963317fe451ffeffd9856e4d) ) /* no label for this chip */
ROM_END
ROM_START( theendb )
@@ -10850,7 +10864,7 @@ GAME( 1980, mooncreg, mooncrst, mooncrst, mooncreg, galaxian_state, moonc
GAME( 1980, mooncrsl, mooncrst, mooncrst, mooncrsl, galaxian_state, mooncrsu, ROT90, "bootleg (Laguna S.A.)", "Cresta Mundo (Laguna S.A. Spanish Moon Cresta bootleg)", GAME_SUPPORTS_SAVE )
GAME( 1980, stera, mooncrst, mooncrst, smooncrs, galaxian_state, mooncrsu, ROT90, "bootleg", "Steraranger (Moon Cresta bootleg)", GAME_SUPPORTS_SAVE )
GAME( 1980, mooncrgx, mooncrst, galaxian, mooncrgx, galaxian_state, mooncrgx, ROT270, "bootleg", "Moon Cresta (Galaxian hardware)", GAME_SUPPORTS_SAVE )
-GAME( 1980, moonqsr, 0, mooncrst, moonqsr, galaxian_state, moonqsr, ROT90, "Nichibutsu", "Moon Quasar", GAME_SUPPORTS_SAVE )
+GAME( 1980, moonqsr, 0, moonqsr, moonqsr, galaxian_state, moonqsr, ROT90, "Nichibutsu", "Moon Quasar", GAME_SUPPORTS_SAVE )
GAME( 1980, moonal2, galaxian, mooncrst, moonal2, galaxian_state, galaxian, ROT90, "Namco / Nichibutsu", "Moon Alien Part 2", GAME_SUPPORTS_SAVE )
GAME( 1980, moonal2b, galaxian, mooncrst, moonal2, galaxian_state, galaxian, ROT90, "Namco / Nichibutsu", "Moon Alien Part 2 (older version)", GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/gambl186.c b/src/mame/drivers/gambl186.c
index d626a9ae425..ba0d4ce90ba 100644
--- a/src/mame/drivers/gambl186.c
+++ b/src/mame/drivers/gambl186.c
@@ -86,13 +86,6 @@ void gambl186_state::machine_start()
membank("data_bank")->configure_entries(0, 4, memregion("data")->base(), 0x40000);
}
-static ADDRESS_MAP_START( gambl186_map, AS_PROGRAM, 16, gambl186_state )
- AM_RANGE(0x00000, 0x0ffff) AM_RAM AM_SHARE("nvram")
- AM_RANGE(0x40000, 0x7ffff) AM_ROMBANK("data_bank") // TODO: way bigger than this, banked?
- AM_RANGE(0xa0000, 0xbffff) AM_DEVREADWRITE8("vga", cirrus_gd5428_device, mem_r, mem_w, 0xffff)
- AM_RANGE(0xc0000, 0xfffff) AM_ROM AM_REGION("ipl",0)
-ADDRESS_MAP_END
-
static const UINT8 password[] = {5, 2, 0, 3, 0, 0, 2, 4, 5, 6, 0x16};
READ16_MEMBER(gambl186_state::comms_r)
@@ -364,6 +357,12 @@ WRITE16_MEMBER(gambl186_state::upd_w)
// m_upd7759->start_w(1);
}
+static ADDRESS_MAP_START( gambl186_map, AS_PROGRAM, 16, gambl186_state )
+ AM_RANGE(0x00000, 0x0ffff) AM_RAM AM_SHARE("nvram")
+ AM_RANGE(0x40000, 0x7ffff) AM_ROMBANK("data_bank")
+ AM_RANGE(0xa0000, 0xbffff) AM_DEVREADWRITE8("vga", cirrus_gd5428_device, mem_r, mem_w, 0xffff)
+ AM_RANGE(0xc0000, 0xfffff) AM_ROM AM_REGION("ipl",0)
+ADDRESS_MAP_END
static ADDRESS_MAP_START( gambl186_io, AS_IO, 16, gambl186_state )
AM_RANGE(0x03b0, 0x03bf) AM_DEVREADWRITE8("vga", cirrus_gd5428_device, port_03b0_r, port_03b0_w, 0xffff)
diff --git a/src/mame/drivers/gameplan.c b/src/mame/drivers/gameplan.c
index a8bc03e56ce..90161a9f3d3 100644
--- a/src/mame/drivers/gameplan.c
+++ b/src/mame/drivers/gameplan.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Chris Moore
/***************************************************************************
diff --git a/src/mame/drivers/gaplus.c b/src/mame/drivers/gaplus.c
index 92015063994..29c03b69b77 100644
--- a/src/mame/drivers/gaplus.c
+++ b/src/mame/drivers/gaplus.c
@@ -144,7 +144,7 @@ TODO:
- schematics show 4 lines going from the 58XX I/O chip to the 26XX (starfield generator).
Function and operation unknown.
-- Add 62XX custom to machine/namcoio.c (though it's quite different from 56XX and 58XX).
+- Complete 62XX custom emulation (machine/namco62.c) (though it's quite different from 56XX and 58XX).
- Is the sprite generator the same as Phozon? This isn't clear yet. They are
very similar, especially in the way the size flags are layed out.
@@ -158,17 +158,7 @@ TODO:
#include "includes/gaplus.h"
-READ8_MEMBER(gaplus_state::gaplus_spriteram_r)
-{
- return m_spriteram[offset];
-}
-
-WRITE8_MEMBER(gaplus_state::gaplus_spriteram_w)
-{
- m_spriteram[offset] = data;
-}
-
-WRITE8_MEMBER(gaplus_state::gaplus_irq_1_ctrl_w)
+WRITE8_MEMBER(gaplus_state::irq_1_ctrl_w)
{
int bit = !BIT(offset, 11);
m_main_irq_mask = bit & 1;
@@ -176,7 +166,7 @@ WRITE8_MEMBER(gaplus_state::gaplus_irq_1_ctrl_w)
m_maincpu->set_input_line(0, CLEAR_LINE);
}
-WRITE8_MEMBER(gaplus_state::gaplus_irq_2_ctrl_w)
+WRITE8_MEMBER(gaplus_state::irq_2_ctrl_w)
{
int bit = offset & 1;
m_sub_irq_mask = bit & 1;
@@ -184,7 +174,7 @@ WRITE8_MEMBER(gaplus_state::gaplus_irq_2_ctrl_w)
m_subcpu->set_input_line(0, CLEAR_LINE);
}
-WRITE8_MEMBER(gaplus_state::gaplus_irq_3_ctrl_w)
+WRITE8_MEMBER(gaplus_state::irq_3_ctrl_w)
{
int bit = !BIT(offset, 13);
m_sub2_irq_mask = bit & 1;
@@ -192,7 +182,7 @@ WRITE8_MEMBER(gaplus_state::gaplus_irq_3_ctrl_w)
m_subcpu2->set_input_line(0, CLEAR_LINE);
}
-WRITE8_MEMBER(gaplus_state::gaplus_sreset_w)
+WRITE8_MEMBER(gaplus_state::sreset_w)
{
int bit = !BIT(offset, 11);
m_subcpu->set_input_line(INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
@@ -200,7 +190,7 @@ WRITE8_MEMBER(gaplus_state::gaplus_sreset_w)
m_namco_15xx->mappy_sound_enable(bit);
}
-WRITE8_MEMBER(gaplus_state::gaplus_freset_w)
+WRITE8_MEMBER(gaplus_state::freset_w)
{
int bit = !BIT(offset, 11);
@@ -242,7 +232,7 @@ TIMER_CALLBACK_MEMBER(gaplus_state::namcoio_run)
}
}
-INTERRUPT_GEN_MEMBER(gaplus_state::gaplus_vblank_main_irq)
+INTERRUPT_GEN_MEMBER(gaplus_state::vblank_main_irq)
{
if(m_main_irq_mask)
m_maincpu->set_input_line(0, ASSERT_LINE);
@@ -266,13 +256,13 @@ INTERRUPT_GEN_MEMBER(gaplus_state::gapluso_vblank_main_irq)
timer_set(attotime::from_usec(50), TIMER_NAMCOIO_RUN, 0);
}
-INTERRUPT_GEN_MEMBER(gaplus_state::gaplus_vblank_sub_irq)
+INTERRUPT_GEN_MEMBER(gaplus_state::vblank_sub_irq)
{
if(m_sub_irq_mask)
m_subcpu->set_input_line(0, ASSERT_LINE);
}
-INTERRUPT_GEN_MEMBER(gaplus_state::gaplus_vblank_sub2_irq)
+INTERRUPT_GEN_MEMBER(gaplus_state::vblank_sub2_irq)
{
if(m_sub2_irq_mask)
m_subcpu2->set_input_line(0, ASSERT_LINE);
@@ -280,32 +270,32 @@ INTERRUPT_GEN_MEMBER(gaplus_state::gaplus_vblank_sub2_irq)
static ADDRESS_MAP_START( cpu1_map, AS_PROGRAM, 8, gaplus_state )
- AM_RANGE(0x0000, 0x07ff) AM_READWRITE(gaplus_videoram_r, gaplus_videoram_w) AM_SHARE("videoram") /* tilemap RAM (shared with CPU #2) */
- AM_RANGE(0x0800, 0x1fff) AM_READWRITE(gaplus_spriteram_r, gaplus_spriteram_w) AM_SHARE("spriteram") /* shared RAM with CPU #2 (includes sprite RAM) */
+ AM_RANGE(0x0000, 0x07ff) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram") /* tilemap RAM (shared with CPU #2) */
+ AM_RANGE(0x0800, 0x1fff) AM_RAM AM_SHARE("spriteram") /* shared RAM with CPU #2 (includes sprite RAM) */
AM_RANGE(0x6000, 0x63ff) AM_DEVREADWRITE("namco", namco_15xx_device, sharedram_r, sharedram_w) /* shared RAM with CPU #3 */
AM_RANGE(0x6800, 0x680f) AM_DEVREADWRITE("namcoio_1", namcoio_device, read, write) /* custom I/O chips interface */
AM_RANGE(0x6810, 0x681f) AM_DEVREADWRITE("namcoio_2", namcoio_device, read, write) /* custom I/O chips interface */
- AM_RANGE(0x6820, 0x682f) AM_READWRITE(gaplus_customio_3_r, gaplus_customio_3_w) AM_SHARE("customio_3") /* custom I/O chip #3 interface */
- AM_RANGE(0x7000, 0x7fff) AM_WRITE(gaplus_irq_1_ctrl_w) /* main CPU irq control */
+ AM_RANGE(0x6820, 0x682f) AM_READWRITE(customio_3_r, customio_3_w) AM_SHARE("customio_3") /* custom I/O chip #3 interface */
+ AM_RANGE(0x7000, 0x7fff) AM_WRITE(irq_1_ctrl_w) /* main CPU irq control */
AM_RANGE(0x7800, 0x7fff) AM_READ(watchdog_reset_r) /* watchdog */
- AM_RANGE(0x8000, 0x8fff) AM_WRITE(gaplus_sreset_w) /* reset CPU #2 & #3, enable sound */
- AM_RANGE(0x9000, 0x9fff) AM_WRITE(gaplus_freset_w) /* reset I/O chips */
- AM_RANGE(0xa000, 0xa7ff) AM_WRITE(gaplus_starfield_control_w) /* starfield control */
+ AM_RANGE(0x8000, 0x8fff) AM_WRITE(sreset_w) /* reset CPU #2 & #3, enable sound */
+ AM_RANGE(0x9000, 0x9fff) AM_WRITE(freset_w) /* reset I/O chips */
+ AM_RANGE(0xa000, 0xa7ff) AM_WRITE(starfield_control_w) /* starfield control */
AM_RANGE(0xa000, 0xffff) AM_ROM /* ROM */
ADDRESS_MAP_END
static ADDRESS_MAP_START( cpu2_map, AS_PROGRAM, 8, gaplus_state )
- AM_RANGE(0x0000, 0x07ff) AM_READWRITE(gaplus_videoram_r, gaplus_videoram_w) /* tilemap RAM (shared with CPU #1) */
- AM_RANGE(0x0800, 0x1fff) AM_READWRITE(gaplus_spriteram_r, gaplus_spriteram_w) /* shared RAM with CPU #1 */
+ AM_RANGE(0x0000, 0x07ff) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram") /* tilemap RAM (shared with CPU #1) */
+ AM_RANGE(0x0800, 0x1fff) AM_RAM AM_SHARE("spriteram") /* shared RAM with CPU #1 */
// AM_RANGE(0x500f, 0x500f) AM_WRITENOP /* ??? written 256 times on startup */
- AM_RANGE(0x6000, 0x6fff) AM_WRITE(gaplus_irq_2_ctrl_w) /* IRQ 2 control */
+ AM_RANGE(0x6000, 0x6fff) AM_WRITE(irq_2_ctrl_w) /* IRQ 2 control */
AM_RANGE(0xa000, 0xffff) AM_ROM /* ROM */
ADDRESS_MAP_END
static ADDRESS_MAP_START( cpu3_map, AS_PROGRAM, 8, gaplus_state )
AM_RANGE(0x0000, 0x03ff) AM_DEVREADWRITE("namco", namco_15xx_device, sharedram_r, sharedram_w) /* shared RAM with the main CPU + sound registers */
AM_RANGE(0x2000, 0x3fff) AM_READWRITE(watchdog_reset_r, watchdog_reset_w) /* watchdog? */
- AM_RANGE(0x4000, 0x7fff) AM_WRITE(gaplus_irq_3_ctrl_w) /* interrupt enable/disable */
+ AM_RANGE(0x4000, 0x7fff) AM_WRITE(irq_3_ctrl_w) /* interrupt enable/disable */
AM_RANGE(0xe000, 0xffff) AM_ROM /* ROM */
ADDRESS_MAP_END
@@ -495,7 +485,7 @@ WRITE8_MEMBER(gaplus_state::out_lamps1)
coin_counter_w(machine(), 1, ~data & 1);
}
-MACHINE_START_MEMBER(gaplus_state,gaplus)
+void gaplus_state::machine_start()
{
switch (m_type)
{
@@ -509,6 +499,10 @@ MACHINE_START_MEMBER(gaplus_state,gaplus)
m_namco56xx = machine().device<namco56xx_device>("namcoio_2");
break;
}
+
+ save_item(NAME(m_main_irq_mask));
+ save_item(NAME(m_sub_irq_mask));
+ save_item(NAME(m_sub2_irq_mask));
}
@@ -517,17 +511,16 @@ static MACHINE_CONFIG_START( gaplus, gaplus_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M6809, 24576000/16) /* 1.536 MHz */
MCFG_CPU_PROGRAM_MAP(cpu1_map)
- MCFG_CPU_VBLANK_INT_DRIVER("screen", gaplus_state, gaplus_vblank_main_irq)
+ MCFG_CPU_VBLANK_INT_DRIVER("screen", gaplus_state, vblank_main_irq)
MCFG_CPU_ADD("sub", M6809, 24576000/16) /* 1.536 MHz */
MCFG_CPU_PROGRAM_MAP(cpu2_map)
- MCFG_CPU_VBLANK_INT_DRIVER("screen", gaplus_state, gaplus_vblank_sub_irq)
+ MCFG_CPU_VBLANK_INT_DRIVER("screen", gaplus_state, vblank_sub_irq)
MCFG_CPU_ADD("sub2", M6809, 24576000/16) /* 1.536 MHz */
MCFG_CPU_PROGRAM_MAP(cpu3_map)
- MCFG_CPU_VBLANK_INT_DRIVER("screen", gaplus_state, gaplus_vblank_sub2_irq)
+ MCFG_CPU_VBLANK_INT_DRIVER("screen", gaplus_state, vblank_sub2_irq)
- MCFG_MACHINE_START_OVERRIDE(gaplus_state, gaplus)
MCFG_QUANTUM_TIME(attotime::from_hz(6000)) /* a high value to ensure proper synchronization of the CPUs */
MCFG_DEVICE_ADD("namcoio_1", NAMCO56XX, 0)
@@ -558,8 +551,8 @@ static MACHINE_CONFIG_START( gaplus, gaplus_state )
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
MCFG_SCREEN_SIZE(36*8, 28*8)
MCFG_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 0*8, 28*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(gaplus_state, screen_update_gaplus)
- MCFG_SCREEN_VBLANK_DRIVER(gaplus_state, screen_eof_gaplus)
+ MCFG_SCREEN_UPDATE_DRIVER(gaplus_state, screen_update)
+ MCFG_SCREEN_VBLANK_DRIVER(gaplus_state, screen_eof)
MCFG_SCREEN_PALETTE("palette")
MCFG_GFXDECODE_ADD("gfxdecode", "palette", gaplus)
@@ -1011,16 +1004,16 @@ DRIVER_INIT_MEMBER(gaplus_state,galaga3)
/* These sets are on revision 2 or 3 PCBs AKA "Namco" PCBs */
-GAME( 1984, gaplus, 0, gapluso, gapluso, gaplus_state, gaplus, ROT90, "Namco", "Gaplus (GP2 rev. B)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
-GAME( 1984, gaplusa, gaplus, gapluso, gapluso, gaplus_state, gaplus, ROT90, "Namco", "Gaplus (GP2)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
-GAME( 1984, gaplusd, gaplus, gaplusd, gapluso, gaplus_state, gaplusd, ROT90, "Namco", "Gaplus (GP2 rev D, alternate hardware)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
-GAME( 1984, galaga3, gaplus, gaplus, gaplus, gaplus_state, galaga3, ROT90, "Namco", "Galaga 3 (GP3 rev. D)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
-GAME( 1984, galaga3a, gaplus, gaplus, gaplus, gaplus_state, galaga3, ROT90, "Namco", "Galaga 3 (GP3 rev. C)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
-GAME( 1984, galaga3b, gaplus, gaplus, gaplus, gaplus_state, galaga3, ROT90, "Namco", "Galaga 3 (GP3)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
+GAME( 1984, gaplus, 0, gapluso, gapluso, gaplus_state, gaplus, ROT90, "Namco", "Gaplus (GP2 rev. B)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
+GAME( 1984, gaplusa, gaplus, gapluso, gapluso, gaplus_state, gaplus, ROT90, "Namco", "Gaplus (GP2)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
+GAME( 1984, gaplusd, gaplus, gaplusd, gapluso, gaplus_state, gaplusd, ROT90, "Namco", "Gaplus (GP2 rev D, alternate hardware)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
+GAME( 1984, galaga3, gaplus, gaplus, gaplus, gaplus_state, galaga3, ROT90, "Namco", "Galaga 3 (GP3 rev. D)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
+GAME( 1984, galaga3a, gaplus, gaplus, gaplus, gaplus_state, galaga3, ROT90, "Namco", "Galaga 3 (GP3 rev. C)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
+GAME( 1984, galaga3b, gaplus, gaplus, gaplus, gaplus_state, galaga3, ROT90, "Namco", "Galaga 3 (GP3)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
/* These sets are on older revision (AKA Midway) 1 PCBs */
-GAME( 1984, galaga3c, gaplus, gaplus, galaga3a, gaplus_state, galaga3, ROT90, "Namco", "Galaga 3 (set 4)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
-GAME( 1984, galaga3m, gaplus, gaplus, galaga3m, gaplus_state, galaga3, ROT90, "Namco", "Galaga 3 (set 5)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
+GAME( 1984, galaga3c, gaplus, gaplus, galaga3a, gaplus_state, galaga3, ROT90, "Namco", "Galaga 3 (set 4)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
+GAME( 1984, galaga3m, gaplus, gaplus, galaga3m, gaplus_state, galaga3, ROT90, "Namco", "Galaga 3 (set 5)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
/* This is an odd mix of Galaga3 and Gaplus, main code seems closest to galaga3m but still has significant changes, copyright is modified to 1992, has Galaga 3 style high scores, PARSEF spelling error on high score table */
-GAME( 1992, gaplust, gaplus, gaplus, galaga3m, gaplus_state, galaga3, ROT90, "bootleg (Tecfri)", "Gaplus (Tecfri PCB)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
+GAME( 1992, gaplust, gaplus, gaplus, galaga3m, gaplus_state, galaga3, ROT90, "bootleg (Tecfri)", "Gaplus (Tecfri PCB)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/gcpinbal.c b/src/mame/drivers/gcpinbal.c
index 252b4cb663c..086f409a1c8 100644
--- a/src/mame/drivers/gcpinbal.c
+++ b/src/mame/drivers/gcpinbal.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:David Graves, R. Belmont
/***************************************************************************
diff --git a/src/mame/drivers/gei.c b/src/mame/drivers/gei.c
index 4bbf06b1bc6..25c3137d872 100644
--- a/src/mame/drivers/gei.c
+++ b/src/mame/drivers/gei.c
@@ -386,7 +386,7 @@ READ8_MEMBER(gei_state::banksel_1_r)
{
membank("bank1")->set_base(memregion("maincpu")->base() + 0x10000);
return 0x03;
-};
+}
READ8_MEMBER(gei_state::banksel_2_r)
{
diff --git a/src/mame/drivers/ghosteo.c b/src/mame/drivers/ghosteo.c
index 91c1fd09a47..298d90784ba 100644
--- a/src/mame/drivers/ghosteo.c
+++ b/src/mame/drivers/ghosteo.c
@@ -69,7 +69,7 @@ ToDo: verify QS1000 hook-up
enum nand_mode_t
{
NAND_M_INIT, // initial state
- NAND_M_READ, // read page data
+ NAND_M_READ // read page data
};
struct nand_t
diff --git a/src/mame/drivers/gladiatr.c b/src/mame/drivers/gladiatr.c
index 482c56808c7..8d538907b5e 100644
--- a/src/mame/drivers/gladiatr.c
+++ b/src/mame/drivers/gladiatr.c
@@ -196,9 +196,7 @@ TODO:
/*Rom bankswitching*/
WRITE8_MEMBER(gladiatr_state::gladiatr_bankswitch_w)
{
- UINT8 *rom = memregion("maincpu")->base() + 0x10000;
-
- membank("bank1")->set_base(rom + 0x6000 * (data & 0x01));
+ membank("bank1")->set_entry(data & 0x01);
}
@@ -249,8 +247,7 @@ MACHINE_RESET_MEMBER(gladiatr_state,gladiator)
{
/* 6809 bank memory set */
{
- UINT8 *rom = memregion("audiocpu")->base() + 0x10000;
- membank("bank2")->set_base(rom);
+ membank("bank2")->set_entry(0);
m_audiocpu->reset();
}
}
@@ -272,10 +269,8 @@ WRITE_LINE_MEMBER(gladiatr_state::gladiator_ym_irq)
/*Sound Functions*/
WRITE8_MEMBER(gladiatr_state::gladiator_adpcm_w)
{
- UINT8 *rom = memregion("audiocpu")->base() + 0x10000;
-
/* bit6 = bank offset */
- membank("bank2")->set_base(rom + ((data & 0x40) ? 0xc000 : 0));
+ membank("bank2")->set_entry((data & 0x40) ? 1 : 0);
m_msm->data_w(data); /* bit0..3 */
m_msm->reset_w(BIT(data, 5)); /* bit 5 */
@@ -997,9 +992,11 @@ DRIVER_INIT_MEMBER(gladiatr_state,gladiatr)
swap_block(rom + 0x26000, rom + 0x2c000, 0x2000);
swap_block(rom + 0x24000, rom + 0x28000, 0x4000);
+ membank("bank1")->configure_entries(0, 2, memregion("maincpu")->base() + 0x10000, 0x6000);
+ membank("bank2")->configure_entries(0, 2, memregion("audiocpu")->base() + 0x10000, 0xc000);
+
/* make sure bank is valid in cpu-reset */
- rom = memregion("audiocpu")->base() + 0x10000;
- membank("bank2")->set_base(rom);
+ membank("bank2")->set_entry(0);
}
diff --git a/src/mame/drivers/goldstar.c b/src/mame/drivers/goldstar.c
index 0e32dedf6b9..51d4291ef4d 100644
--- a/src/mame/drivers/goldstar.c
+++ b/src/mame/drivers/goldstar.c
@@ -10817,7 +10817,7 @@ ROM_END
ROM_START( nc96 )
ROM_REGION( 0x20000, "maincpu", 0 )
- ROM_LOAD( "ch363c1.bin", 0x00000, 0x1000, CRC(e566cea3) SHA1(be81b21267ae2ff64c4dbc58e99a9ff4bf1d21aa) ) // v3.63, C1 Sub-PCB
+ ROM_LOAD( "ch363c1.prom", 0x00000, 0x1000, CRC(e566cea3) SHA1(be81b21267ae2ff64c4dbc58e99a9ff4bf1d21aa) ) // v3.63, C1 Sub-PCB
ROM_CONTINUE(0x4000, 0x1000)
ROM_CONTINUE(0x3000, 0x1000)
ROM_CONTINUE(0x7000, 0x1000)
@@ -10828,8 +10828,8 @@ ROM_START( nc96 )
ROM_CONTINUE(0x8000, 0x8000)
ROM_REGION( 0x20000, "graphics", 0 )
- ROM_LOAD( "chseh.bin", 0x00000, 0x10000, CRC(fb90df1d) SHA1(84ec1f40a014a0043b3c3c999428dd274caba1b8) )
- ROM_LOAD( "chsel.bin", 0x10000, 0x10000, CRC(e0166f3e) SHA1(27e180fe6e03f48771b540e34415eee54951788f) )
+ ROM_LOAD( "ch96seh.bin", 0x00000, 0x10000, CRC(65dee6ba) SHA1(77f5769ed0b745a4735576e9f0ce90dcdd9b5410) ) /* Correct graphics for this set, shows (R)COPYRIGHT(C) 1996 */
+ ROM_LOAD( "ch96sel.bin", 0x10000, 0x10000, CRC(c21cc114) SHA1(f7b6ff5ac34dc1a7332e8c1b9cc40f3b65deac05) ) /* the other set shows a currupted TM graphic */
ROM_REGION( 0x10000, "user1", ROMREGION_ERASEFF )
@@ -10847,13 +10847,9 @@ ROM_START( nc96 )
ROM_COPY( "graphics", 0x00000, 0x04000, 0x2000 )
ROM_COPY( "graphics", 0x10000, 0x06000, 0x2000 )
- // no proms present, using nfb96 ones
ROM_REGION( 0x200, "proms", 0 ) // palette
- ROM_LOAD( "chu19.bin", 0x0000, 0x0100, CRC(fafc43ad) SHA1(e94592b83f19e5f9b6205473c1e06b36405ebfc2) )
- ROM_LOAD( "chu20.bin", 0x0100, 0x0100, CRC(05224f73) SHA1(051c3ee9c63f5436e4f6c355fc308f37910a88ef) )
-
- ROM_REGION( 0x100, "sku1920.bin", 0 ) // colours again?
- ROM_LOAD( "chu1920.bin", 0x0000, 0x0100, CRC(71b0e11d) SHA1(1d2a2a31d8571f580c0cb7f4833823841072b31f) )
+ ROM_LOAD( "82s129a.u84", 0x0000, 0x0100, CRC(fafc43ad) SHA1(e94592b83f19e5f9b6205473c1e06b36405ebfc2) )
+ ROM_LOAD( "82s129a.u79", 0x0100, 0x0100, CRC(05224f73) SHA1(051c3ee9c63f5436e4f6c355fc308f37910a88ef) )
ROM_REGION( 0x80000, "oki", ROMREGION_ERASEFF ) // samples
// none?
@@ -10862,7 +10858,7 @@ ROM_END
ROM_START( nc96a )
ROM_REGION( 0x20000, "maincpu", 0 )
- ROM_LOAD( "ch362c1.bin", 0x00000, 0x1000, CRC(10fa984b) SHA1(92ed9838db28deca038c4a5c080a723075ae0c53) ) // v3.62, C1 Sub-PCB
+ ROM_LOAD( "ch362c1.prom", 0x00000, 0x1000, CRC(10fa984b) SHA1(92ed9838db28deca038c4a5c080a723075ae0c53) ) // v3.62, C1 Sub-PCB
ROM_CONTINUE(0x4000, 0x1000)
ROM_CONTINUE(0x3000, 0x1000)
ROM_CONTINUE(0x7000, 0x1000)
@@ -10873,8 +10869,8 @@ ROM_START( nc96a )
ROM_CONTINUE(0x8000, 0x8000)
ROM_REGION( 0x20000, "graphics", 0 )
- ROM_LOAD( "chseh.bin", 0x00000, 0x10000, CRC(fb90df1d) SHA1(84ec1f40a014a0043b3c3c999428dd274caba1b8) )
- ROM_LOAD( "chsel.bin", 0x10000, 0x10000, CRC(e0166f3e) SHA1(27e180fe6e03f48771b540e34415eee54951788f) )
+ ROM_LOAD( "ch96se-h.vrom2", 0x00000, 0x10000, CRC(fb90df1d) SHA1(84ec1f40a014a0043b3c3c999428dd274caba1b8) )
+ ROM_LOAD( "ch96se-l.vrom1", 0x10000, 0x10000, CRC(e0166f3e) SHA1(27e180fe6e03f48771b540e34415eee54951788f) )
ROM_REGION( 0x10000, "user1", ROMREGION_ERASEFF )
@@ -10892,13 +10888,9 @@ ROM_START( nc96a )
ROM_COPY( "graphics", 0x00000, 0x04000, 0x2000 )
ROM_COPY( "graphics", 0x10000, 0x06000, 0x2000 )
- // no proms present, using nfb96 ones
ROM_REGION( 0x200, "proms", 0 ) // palette
- ROM_LOAD( "chu19.bin", 0x0000, 0x0100, CRC(fafc43ad) SHA1(e94592b83f19e5f9b6205473c1e06b36405ebfc2) )
- ROM_LOAD( "chu20.bin", 0x0100, 0x0100, CRC(05224f73) SHA1(051c3ee9c63f5436e4f6c355fc308f37910a88ef) )
-
- ROM_REGION( 0x100, "sku1920.bin", 0 ) // colours again?
- ROM_LOAD( "chu1920.bin", 0x0000, 0x0100, CRC(71b0e11d) SHA1(1d2a2a31d8571f580c0cb7f4833823841072b31f) )
+ ROM_LOAD( "82s129a.u84", 0x0000, 0x0100, CRC(fafc43ad) SHA1(e94592b83f19e5f9b6205473c1e06b36405ebfc2) )
+ ROM_LOAD( "82s129a.u79", 0x0100, 0x0100, CRC(05224f73) SHA1(051c3ee9c63f5436e4f6c355fc308f37910a88ef) )
ROM_REGION( 0x80000, "oki", ROMREGION_ERASEFF ) // samples
// none?
@@ -10907,6 +10899,47 @@ ROM_END
ROM_START( nc96b )
ROM_REGION( 0x20000, "maincpu", 0 )
+ ROM_LOAD( "ch361c1.prom", 0x00000, 0x1000, CRC(dfdd3869) SHA1(e512dd9370b40285a35d12ba7a05e65ab1c693ab) ) // v3.61, C1 Sub-PCB
+ ROM_CONTINUE(0x4000, 0x1000)
+ ROM_CONTINUE(0x3000, 0x1000)
+ ROM_CONTINUE(0x7000, 0x1000)
+ ROM_CONTINUE(0x1000, 0x1000)
+ ROM_CONTINUE(0x6000, 0x1000)
+ ROM_CONTINUE(0x2000, 0x1000)
+ ROM_CONTINUE(0x5000, 0x1000)
+ ROM_CONTINUE(0x8000, 0x8000)
+
+ ROM_REGION( 0x20000, "graphics", 0 )
+ ROM_LOAD( "ch96se-h.vrom2", 0x00000, 0x10000, CRC(fb90df1d) SHA1(84ec1f40a014a0043b3c3c999428dd274caba1b8) )
+ ROM_LOAD( "ch96se-l.vrom1", 0x10000, 0x10000, CRC(e0166f3e) SHA1(27e180fe6e03f48771b540e34415eee54951788f) )
+
+ ROM_REGION( 0x10000, "user1", ROMREGION_ERASEFF )
+
+ ROM_REGION( 0x18000, "gfx1", 0 )
+ ROM_COPY( "graphics", 0x18000, 0x00000, 0x4000 ) // 1
+ ROM_COPY( "graphics", 0x08000, 0x08000, 0x4000 ) // 1
+ ROM_COPY( "graphics", 0x04000, 0x10000, 0x4000 ) // 1
+ ROM_COPY( "graphics", 0x1c000, 0x04000, 0x4000 ) // 2
+ ROM_COPY( "graphics", 0x0c000, 0x0c000, 0x4000 ) // 2
+ ROM_COPY( "graphics", 0x14000, 0x14000, 0x4000 ) // 2
+
+ ROM_REGION( 0x8000, "gfx2", 0 )
+ ROM_COPY( "graphics", 0x02000, 0x00000, 0x2000 )
+ ROM_COPY( "graphics", 0x12000, 0x02000, 0x2000 )
+ ROM_COPY( "graphics", 0x00000, 0x04000, 0x2000 )
+ ROM_COPY( "graphics", 0x10000, 0x06000, 0x2000 )
+
+ ROM_REGION( 0x200, "proms", 0 ) // palette
+ ROM_LOAD( "82s129a.u84", 0x0000, 0x0100, CRC(fafc43ad) SHA1(e94592b83f19e5f9b6205473c1e06b36405ebfc2) )
+ ROM_LOAD( "82s129a.u79", 0x0100, 0x0100, CRC(05224f73) SHA1(051c3ee9c63f5436e4f6c355fc308f37910a88ef) )
+
+ ROM_REGION( 0x80000, "oki", ROMREGION_ERASEFF ) // samples
+ // none?
+ROM_END
+
+
+ROM_START( nc96c )
+ ROM_REGION( 0x20000, "maincpu", 0 )
ROM_LOAD( "chse354d.bin", 0x00000, 0x1000, CRC(160f7b78) SHA1(537a91317e613676b748d4e4ec7015183872814b) ) // v3.54, D Sub-PCB
ROM_CONTINUE(0x4000, 0x1000)
ROM_CONTINUE(0x3000, 0x1000)
@@ -10918,7 +10951,7 @@ ROM_START( nc96b )
ROM_CONTINUE(0x8000, 0x8000)
ROM_REGION( 0x20000, "graphics", 0 )
- ROM_LOAD( "ch96seh.bin", 0x00000, 0x10000, CRC(65dee6ba) SHA1(77f5769ed0b745a4735576e9f0ce90dcdd9b5410) )
+ ROM_LOAD( "ch96seh.bin", 0x00000, 0x10000, CRC(65dee6ba) SHA1(77f5769ed0b745a4735576e9f0ce90dcdd9b5410) ) /* Correct graphics for this set, shows TM COPYRIGHT(C) 1996 */
ROM_LOAD( "ch96sel.bin", 0x10000, 0x10000, CRC(c21cc114) SHA1(f7b6ff5ac34dc1a7332e8c1b9cc40f3b65deac05) )
ROM_REGION( 0x10000, "user1", ROMREGION_ERASEFF )
@@ -10937,20 +10970,98 @@ ROM_START( nc96b )
ROM_COPY( "graphics", 0x00000, 0x04000, 0x2000 )
ROM_COPY( "graphics", 0x10000, 0x06000, 0x2000 )
- // no proms present, using nfb96 ones
ROM_REGION( 0x200, "proms", 0 ) // palette
- ROM_LOAD( "chu19.bin", 0x0000, 0x0100, CRC(fafc43ad) SHA1(e94592b83f19e5f9b6205473c1e06b36405ebfc2) )
- ROM_LOAD( "chu20.bin", 0x0100, 0x0100, CRC(05224f73) SHA1(051c3ee9c63f5436e4f6c355fc308f37910a88ef) )
+ ROM_LOAD( "82s129a.u84", 0x0000, 0x0100, CRC(fafc43ad) SHA1(e94592b83f19e5f9b6205473c1e06b36405ebfc2) )
+ ROM_LOAD( "82s129a.u79", 0x0100, 0x0100, CRC(05224f73) SHA1(051c3ee9c63f5436e4f6c355fc308f37910a88ef) )
- ROM_REGION( 0x100, "sku1920.bin", 0 ) // colours again?
- ROM_LOAD( "chu1920.bin", 0x0000, 0x0100, CRC(71b0e11d) SHA1(1d2a2a31d8571f580c0cb7f4833823841072b31f) )
+ ROM_REGION( 0x80000, "oki", ROMREGION_ERASEFF ) // samples
+ // none?
+ROM_END
+
+
+ROM_START( nc96d )
+ ROM_REGION( 0x20000, "maincpu", 0 )
+ ROM_LOAD( "chse353d.prom", 0x00000, 0x1000, CRC(fc56f84f) SHA1(a98746ef0dc919ced201c98c835ef0cbd5c18627) ) // v3.54, D Sub-PCB
+ ROM_CONTINUE(0x4000, 0x1000)
+ ROM_CONTINUE(0x3000, 0x1000)
+ ROM_CONTINUE(0x7000, 0x1000)
+ ROM_CONTINUE(0x1000, 0x1000)
+ ROM_CONTINUE(0x6000, 0x1000)
+ ROM_CONTINUE(0x2000, 0x1000)
+ ROM_CONTINUE(0x5000, 0x1000)
+ ROM_CONTINUE(0x8000, 0x8000)
+
+ ROM_REGION( 0x20000, "graphics", 0 )
+ ROM_LOAD( "ch96se-h.vrom2", 0x00000, 0x10000, CRC(fb90df1d) SHA1(84ec1f40a014a0043b3c3c999428dd274caba1b8) )
+ ROM_LOAD( "ch96se-l.vrom1", 0x10000, 0x10000, CRC(e0166f3e) SHA1(27e180fe6e03f48771b540e34415eee54951788f) )
+
+ ROM_REGION( 0x10000, "user1", ROMREGION_ERASEFF )
+
+ ROM_REGION( 0x18000, "gfx1", 0 )
+ ROM_COPY( "graphics", 0x18000, 0x00000, 0x4000 ) // 1
+ ROM_COPY( "graphics", 0x08000, 0x08000, 0x4000 ) // 1
+ ROM_COPY( "graphics", 0x04000, 0x10000, 0x4000 ) // 1
+ ROM_COPY( "graphics", 0x1c000, 0x04000, 0x4000 ) // 2
+ ROM_COPY( "graphics", 0x0c000, 0x0c000, 0x4000 ) // 2
+ ROM_COPY( "graphics", 0x14000, 0x14000, 0x4000 ) // 2
+
+ ROM_REGION( 0x8000, "gfx2", 0 )
+ ROM_COPY( "graphics", 0x02000, 0x00000, 0x2000 )
+ ROM_COPY( "graphics", 0x12000, 0x02000, 0x2000 )
+ ROM_COPY( "graphics", 0x00000, 0x04000, 0x2000 )
+ ROM_COPY( "graphics", 0x10000, 0x06000, 0x2000 )
+
+ ROM_REGION( 0x200, "proms", 0 ) // palette
+ ROM_LOAD( "82s129a.u84", 0x0000, 0x0100, CRC(fafc43ad) SHA1(e94592b83f19e5f9b6205473c1e06b36405ebfc2) )
+ ROM_LOAD( "82s129a.u79", 0x0100, 0x0100, CRC(05224f73) SHA1(051c3ee9c63f5436e4f6c355fc308f37910a88ef) )
ROM_REGION( 0x80000, "oki", ROMREGION_ERASEFF ) // samples
// none?
ROM_END
-ROM_START( nc96c )
+ROM_START( nc96e )
+ ROM_REGION( 0x20000, "maincpu", 0 )
+ ROM_LOAD( "chsesep3_3.40.prom", 0x00000, 0x1000, CRC(0eec1fd1) SHA1(93e096f471376f5efc3b229fd226c48cd623c48d) ) // v3.40, D Sub-PCB
+ ROM_CONTINUE(0x4000, 0x1000)
+ ROM_CONTINUE(0x3000, 0x1000)
+ ROM_CONTINUE(0x7000, 0x1000)
+ ROM_CONTINUE(0x1000, 0x1000)
+ ROM_CONTINUE(0x6000, 0x1000)
+ ROM_CONTINUE(0x2000, 0x1000)
+ ROM_CONTINUE(0x5000, 0x1000)
+ ROM_CONTINUE(0x8000, 0x8000)
+
+ ROM_REGION( 0x20000, "graphics", 0 )
+ ROM_LOAD( "ch96se-h.vrom2", 0x00000, 0x10000, CRC(fb90df1d) SHA1(84ec1f40a014a0043b3c3c999428dd274caba1b8) )
+ ROM_LOAD( "ch96se-l.vrom1", 0x10000, 0x10000, CRC(e0166f3e) SHA1(27e180fe6e03f48771b540e34415eee54951788f) )
+
+ ROM_REGION( 0x10000, "user1", ROMREGION_ERASEFF )
+
+ ROM_REGION( 0x18000, "gfx1", 0 )
+ ROM_COPY( "graphics", 0x18000, 0x00000, 0x4000 ) // 1
+ ROM_COPY( "graphics", 0x08000, 0x08000, 0x4000 ) // 1
+ ROM_COPY( "graphics", 0x04000, 0x10000, 0x4000 ) // 1
+ ROM_COPY( "graphics", 0x1c000, 0x04000, 0x4000 ) // 2
+ ROM_COPY( "graphics", 0x0c000, 0x0c000, 0x4000 ) // 2
+ ROM_COPY( "graphics", 0x14000, 0x14000, 0x4000 ) // 2
+
+ ROM_REGION( 0x8000, "gfx2", 0 )
+ ROM_COPY( "graphics", 0x02000, 0x00000, 0x2000 )
+ ROM_COPY( "graphics", 0x12000, 0x02000, 0x2000 )
+ ROM_COPY( "graphics", 0x00000, 0x04000, 0x2000 )
+ ROM_COPY( "graphics", 0x10000, 0x06000, 0x2000 )
+
+ ROM_REGION( 0x200, "proms", 0 ) // palette
+ ROM_LOAD( "82s129a.u84", 0x0000, 0x0100, CRC(fafc43ad) SHA1(e94592b83f19e5f9b6205473c1e06b36405ebfc2) )
+ ROM_LOAD( "82s129a.u79", 0x0100, 0x0100, CRC(05224f73) SHA1(051c3ee9c63f5436e4f6c355fc308f37910a88ef) )
+
+ ROM_REGION( 0x80000, "oki", ROMREGION_ERASEFF ) // samples
+ // none?
+ROM_END
+
+
+ROM_START( nc96f )
ROM_REGION( 0x20000, "maincpu", 0 )
ROM_LOAD( "chse362dk.bin", 0x00000, 0x1000, CRC(66df35d3) SHA1(da33f6413b8cf7b472023abc3e5cfe6d52ed1418) ) // v3.62, DK Sub-PCB
ROM_CONTINUE(0x4000, 0x1000)
@@ -10982,13 +11093,9 @@ ROM_START( nc96c )
ROM_COPY( "graphics", 0x00000, 0x04000, 0x2000 )
ROM_COPY( "graphics", 0x10000, 0x06000, 0x2000 )
- // no proms present, using nfb96 ones
ROM_REGION( 0x200, "proms", 0 ) // palette
- ROM_LOAD( "chu19.bin", 0x0000, 0x0100, CRC(fafc43ad) SHA1(e94592b83f19e5f9b6205473c1e06b36405ebfc2) )
- ROM_LOAD( "chu20.bin", 0x0100, 0x0100, CRC(05224f73) SHA1(051c3ee9c63f5436e4f6c355fc308f37910a88ef) )
-
- ROM_REGION( 0x100, "sku1920.bin", 0 ) // colours again?
- ROM_LOAD( "chu1920.bin", 0x0000, 0x0100, CRC(71b0e11d) SHA1(1d2a2a31d8571f580c0cb7f4833823841072b31f) )
+ ROM_LOAD( "82s129a.u84", 0x0000, 0x0100, CRC(fafc43ad) SHA1(e94592b83f19e5f9b6205473c1e06b36405ebfc2) )
+ ROM_LOAD( "82s129a.u79", 0x0100, 0x0100, CRC(05224f73) SHA1(051c3ee9c63f5436e4f6c355fc308f37910a88ef) )
ROM_REGION( 0x80000, "oki", ROMREGION_ERASEFF ) // samples
// none?
@@ -13146,8 +13253,11 @@ GAMEL( 2000, nfb96txt, nfb96, amcoe2, nfb96tx, cmaster_state, nfb96_c2,
GAMEL( 1996, nc96, 0, amcoe2, nfb96, cmaster_state, nfb96_c1, ROT0, "Amcoe", "New Cherry '96 Special Edition (v3.63, C1 PCB)", 0, layout_nfb96 ) /* C1 Sub-PCB */
GAMEL( 1996, nc96a, nc96, amcoe2, nfb96, cmaster_state, nfb96_c1, ROT0, "Amcoe", "New Cherry '96 Special Edition (v3.62, C1 PCB)", 0, layout_nfb96 ) /* C1 Sub-PCB */
-GAMEL( 1996, nc96b, nc96, amcoe2, nfb96, cmaster_state, nfb96_d, ROT0, "Amcoe", "New Cherry '96 Special Edition (v3.54, D PCB)", 0, layout_nfb96 ) /* D Sub-PCB */
-GAMEL( 1996, nc96c, nc96, amcoe2, nfb96, cmaster_state, nfb96_dk, ROT0, "Amcoe", "New Cherry '96 Special Edition (v3.62, DK PCB)", 0, layout_nfb96 ) /* DK Sub-PCB */
+GAMEL( 1996, nc96b, nc96, amcoe2, nfb96, cmaster_state, nfb96_c1, ROT0, "Amcoe", "New Cherry '96 Special Edition (v3.61, C1 PCB)", 0, layout_nfb96 ) /* C1 Sub-PCB */
+GAMEL( 1996, nc96c, nc96, amcoe2, nfb96, cmaster_state, nfb96_d, ROT0, "Amcoe", "New Cherry '96 Special Edition (v3.54, D PCB)", 0, layout_nfb96 ) /* D Sub-PCB */
+GAMEL( 1996, nc96d, nc96, amcoe2, nfb96, cmaster_state, nfb96_d, ROT0, "Amcoe", "New Cherry '96 Special Edition (v3.53, D PCB)", 0, layout_nfb96 ) /* D Sub-PCB */
+GAMEL( 1996, nc96e, nc96, amcoe2, nfb96, cmaster_state, nfb96_d, ROT0, "Amcoe", "New Cherry '96 Special Edition (v3.40, D PCB)", 0, layout_nfb96 ) /* D Sub-PCB */
+GAMEL( 1996, nc96f, nc96, amcoe2, nfb96, cmaster_state, nfb96_dk, ROT0, "Amcoe", "New Cherry '96 Special Edition (v3.62, DK PCB)", 0, layout_nfb96 ) /* DK Sub-PCB */
GAMEL( 2000, nc96txt, nc96, amcoe2, nfb96tx, cmaster_state, nfb96_c2, ROT0, "Amcoe", "New Cherry '96 Special Edition (v1.32 Texas XT, C2 PCB)", 0, layout_nfb96tx ) /* ver. tc1.32axt C2 Sub-PCB */
GAME( 2009, fb2010, 0, amcoe2, nfb96tx, cmaster_state, fb2010, ROT0, "Amcoe", "Fruit Bonus 2010", GAME_NOT_WORKING ) // no gfx dumped
diff --git a/src/mame/drivers/gpworld.c b/src/mame/drivers/gpworld.c
index c2dc507d0af..ae4babd485d 100644
--- a/src/mame/drivers/gpworld.c
+++ b/src/mame/drivers/gpworld.c
@@ -33,7 +33,7 @@ Dumping Notes:
27128 EPR-6162A (the "A" letter is handwritten), EPR-6163, EPR-6164, EPR-6157, EPR-6155, EPR-6153
EPR-6151, EPR-6149, EPR-6158, EPR-6156, EPR-6154, EPR-6152, EPR-6150
2732 EPR-6148
- 82S129 PR-5501 (located on video overlay pcb)
+ 82S129 PR-5501 (located on video overlay pcb [834-5175])
(not dumped)
DMPAL16R6JC 315-5072.ic9, 315-5071.ic10
diff --git a/src/mame/drivers/gradius3.c b/src/mame/drivers/gradius3.c
index 4cc70d9ecdf..099ab8690d8 100644
--- a/src/mame/drivers/gradius3.c
+++ b/src/mame/drivers/gradius3.c
@@ -16,6 +16,10 @@
2009-03:
Added dsw locations and verified factory setting based on Guru's notes
+ 2015-05:
+ gradius3js set added, same as normal gradius3j set in content but with
+ some ROMs split and populated differently.
+
***************************************************************************/
#include "emu.h"
@@ -407,6 +411,53 @@ ROM_START( gradius3j )
ROM_LOAD( "945_l11b.c20", 0x60000, 0x20000, CRC(89ea3baf) SHA1(8edcbaa7969185cfac48c02559826d1b8b081f3f) )
ROM_END
+ROM_START( gradius3js )
+ ROM_REGION( 0x40000, "maincpu", 0 )
+ ROM_LOAD16_BYTE( "945_s13.f15", 0x00000, 0x20000, CRC(70c240a2) SHA1(82dc391572e1f61b0182cb031654d71adcdd5f6e) )
+ ROM_LOAD16_BYTE( "945_s12.e15", 0x00001, 0x20000, CRC(bbc300d4) SHA1(e1ca98bc591575285d7bd2d4fefdf35fed10dcb6) )
+
+ ROM_REGION( 0x100000, "sub", 0 )
+ ROM_LOAD16_BYTE( "945_m09.r17", 0x000000, 0x20000, CRC(b4a6df25) SHA1(85533cf140d28f6f81c0b49b8061bda0924a613a) )
+ ROM_LOAD16_BYTE( "945_m08.n17", 0x000001, 0x20000, CRC(74e981d2) SHA1(e7b47a2da01ff73293d2100c48fdf00b33125af5) )
+ ROM_LOAD16_BYTE( "945_l06b.r11", 0x040000, 0x20000, CRC(83772304) SHA1(a90c75a3de670b6ec5e0fc201876d463b4a76766) )
+ ROM_LOAD16_BYTE( "945_l06a.n11", 0x040001, 0x20000, CRC(e1fd75b6) SHA1(6160d80a2f1bf550e85d6253cf521a96f5a644cc) )
+ ROM_LOAD16_BYTE( "945_l07c.r15", 0x080000, 0x20000, CRC(c1e399b6) SHA1(e95bd478dd3beea0175bf9ee4cededb111c4ace1) )
+ ROM_LOAD16_BYTE( "945_l07a.n15", 0x080001, 0x20000, CRC(96222d04) SHA1(b55700f683a556b0e73dbac9c7b4ce485420d21c) )
+ ROM_LOAD16_BYTE( "945_l07d.r13", 0x0c0000, 0x20000, CRC(4c16d4bd) SHA1(01dcf169b78a1e495214b10181401d1920b0c924) )
+ ROM_LOAD16_BYTE( "945_l07b.n13", 0x0c0001, 0x20000, CRC(5e209d01) SHA1(0efa1bbfdc7e2ba1e0bb96245e2bfe961258b446) )
+
+ ROM_REGION( 0x10000, "audiocpu", 0 )
+ ROM_LOAD( "945_m05.d9", 0x00000, 0x10000, CRC(c8c45365) SHA1(b9a7b736b52bca42c7b8c8ed64c8df73e0116158) )
+
+ ROM_REGION( 0x200000, "k051960", 0 ) /* graphics (addressable by the main CPU) */
+ ROM_LOAD32_BYTE( "945_A02A.K2", 0x000000, 0x20000, CRC(fbb81511) SHA1(e7988d52e323e46117f5080c469daf9b119f28a0) )
+ ROM_LOAD32_BYTE( "945_A02C.M2", 0x000001, 0x20000, CRC(031b55e8) SHA1(64ed8dee60bf012df7c1ed496af1c75263c052a6) )
+ ROM_LOAD32_BYTE( "945_A01A.E2", 0x000002, 0x20000, CRC(bace5abb) SHA1(b32df63294c0730f463335b1b760494389c60062) )
+ ROM_LOAD32_BYTE( "945_A01C.H2", 0x000003, 0x20000, CRC(d91b29a6) SHA1(0c3027a08996f4c2b86dd88695241b21c8dffd64) )
+ ROM_LOAD32_BYTE( "945_A02B.K4", 0x080000, 0x20000, CRC(c0fed4ab) SHA1(f01975b13759cae7c8dfd24f9b3f4ac960d32957) )
+ ROM_LOAD32_BYTE( "945_A02D.M4", 0x080001, 0x20000, CRC(d462817c) SHA1(00137e38454e7c3548a1a9553c5ee644916b3959) )
+ ROM_LOAD32_BYTE( "945_A01B.E4", 0x080002, 0x20000, CRC(b426090e) SHA1(06a671a648e3255146fe0c325d5451d4f75f08aa) )
+ ROM_LOAD32_BYTE( "945_A01D.H4", 0x080003, 0x20000, CRC(3990c09a) SHA1(1f6a089c1d03fb95d4d96fecc0379bde26ee2b9d) )
+
+ ROM_LOAD32_BYTE( "945_l04a.k6", 0x100000, 0x20000, CRC(884e21ee) SHA1(ce86dd3a06775e5b1aa09db010dcb674e67828e7) )
+ ROM_LOAD32_BYTE( "945_l04c.m6", 0x100001, 0x20000, CRC(45bcd921) SHA1(e51a8a71362a6fb55124aa1dce74519c0a3c6e3f) )
+ ROM_LOAD32_BYTE( "945_l03a.e6", 0x100002, 0x20000, CRC(a67ef087) SHA1(fd63474f3bbde5dfc53ed4c1db25d6411a8b54d2) )
+ ROM_LOAD32_BYTE( "945_l03c.h6", 0x100003, 0x20000, CRC(a56be17a) SHA1(1d387736144c30fcb5de54235331ab1ff70c356e) )
+ ROM_LOAD32_BYTE( "945_l04b.k8", 0x180000, 0x20000, CRC(843bc67d) SHA1(cdf8421083f24ab27867ed5d08d8949da192b2b9) )
+ ROM_LOAD32_BYTE( "945_l04d.m8", 0x180001, 0x20000, CRC(0a98d08e) SHA1(1e0ca51a2d45c01fa3f11950ddd387f41ddae691) )
+ ROM_LOAD32_BYTE( "945_l03b.e8", 0x180002, 0x20000, CRC(933e68b9) SHA1(f3a39446ca77d17fdbd938bd5f718ae9d5570879) )
+ ROM_LOAD32_BYTE( "945_l03d.h8", 0x180003, 0x20000, CRC(f375e87b) SHA1(6427b966795c907c8e516244872fe52217da62c4) )
+
+ ROM_REGION( 0x0100, "proms", 0 )
+ ROM_LOAD( "945l14.j28", 0x0000, 0x0100, CRC(c778c189) SHA1(847eaf379ba075c25911c6f83dd63ff390534f60) ) /* priority encoder (not used) */
+
+ ROM_REGION( 0x80000, "k007232", 0 ) /* 007232 samples */
+ ROM_LOAD( "945_A10A.C14", 0x00000, 0x20000, CRC(ec717414) SHA1(8c63d5fe01d0833529fca91bc80cdbd8a04174c0) )
+ ROM_LOAD( "945_A10B.C16", 0x20000, 0x20000, CRC(709e30e4) SHA1(27fcea720cd2498f1870c9290d30dcb3dd81d5e5) )
+ ROM_LOAD( "945_l11a.c18", 0x40000, 0x20000, CRC(6043f4eb) SHA1(1c2e9ace1cfdde504b7b6158e3c3f54dc5ae33d4) )
+ ROM_LOAD( "945_l11b.c20", 0x60000, 0x20000, CRC(89ea3baf) SHA1(8edcbaa7969185cfac48c02559826d1b8b081f3f) )
+ROM_END
+
ROM_START( gradius3a )
ROM_REGION( 0x40000, "maincpu", 0 )
ROM_LOAD16_BYTE( "945_13.f15", 0x00000, 0x20000, CRC(9974fe6b) SHA1(c18ad8d7c93bf58d886715d8e210177cf49f220b) )
@@ -450,4 +501,5 @@ ROM_END
GAME( 1989, gradius3, 0, gradius3, gradius3, driver_device, 0, ROT0, "Konami", "Gradius III (World, program code R)", GAME_SUPPORTS_SAVE )
GAME( 1989, gradius3j, gradius3, gradius3, gradius3, driver_device, 0, ROT0, "Konami", "Gradius III (Japan, program code S)", GAME_SUPPORTS_SAVE )
+GAME( 1989, gradius3js, gradius3, gradius3, gradius3, driver_device, 0, ROT0, "Konami", "Gradius III (Japan, program code S, split)", GAME_SUPPORTS_SAVE )
GAME( 1989, gradius3a, gradius3, gradius3, gradius3, driver_device, 0, ROT0, "Konami", "Gradius III (Asia)", GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/grchamp.c b/src/mame/drivers/grchamp.c
index 799e3498574..216a17ad5f0 100644
--- a/src/mame/drivers/grchamp.c
+++ b/src/mame/drivers/grchamp.c
@@ -78,7 +78,20 @@
*
*************************************/
-void grchamp_state::machine_reset()
+void grchamp_state::machine_start()
+{
+ save_item(NAME(m_cpu0_out));
+ save_item(NAME(m_cpu1_out));
+ save_item(NAME(m_comm_latch));
+ save_item(NAME(m_comm_latch2));
+ save_item(NAME(m_ledlatch));
+ save_item(NAME(m_ledaddr));
+ save_item(NAME(m_ledram));
+ save_item(NAME(m_collide));
+ save_item(NAME(m_collmode));
+}
+
+ void grchamp_state::machine_reset()
{
/* if the coin system is 1 way, lock Coin B (Page 40) */
coin_lockout_w(machine(), 1, (ioport("DSWB")->read() & 0x10) ? 1 : 0);
@@ -92,14 +105,14 @@ void grchamp_state::machine_reset()
*
*************************************/
-INTERRUPT_GEN_MEMBER(grchamp_state::grchamp_cpu0_interrupt)
+INTERRUPT_GEN_MEMBER(grchamp_state::cpu0_interrupt)
{
if (m_cpu0_out[0] & 0x01)
device.execute().set_input_line(0, ASSERT_LINE);
}
-INTERRUPT_GEN_MEMBER(grchamp_state::grchamp_cpu1_interrupt)
+INTERRUPT_GEN_MEMBER(grchamp_state::cpu1_interrupt)
{
if (m_cpu1_out[4] & 0x01)
device.execute().set_input_line(0, ASSERT_LINE);
@@ -409,22 +422,22 @@ READ8_MEMBER(grchamp_state::main_to_sub_comm_r)
*
*************************************/
-WRITE8_MEMBER(grchamp_state::grchamp_portA_0_w)
+WRITE8_MEMBER(grchamp_state::portA_0_w)
{
m_discrete->write(space, GRCHAMP_A_DATA, data);
}
-WRITE8_MEMBER(grchamp_state::grchamp_portB_0_w)
+WRITE8_MEMBER(grchamp_state::portB_0_w)
{
m_discrete->write(space, GRCHAMP_B_DATA, 255-data);
}
-WRITE8_MEMBER(grchamp_state::grchamp_portA_2_w)
+WRITE8_MEMBER(grchamp_state::portA_2_w)
{
/* A0/A1 modify the output of AY8910 #2 */
/* A7 contributes to the discrete logic hanging off of AY8910 #0 */
}
-WRITE8_MEMBER(grchamp_state::grchamp_portB_2_w)
+WRITE8_MEMBER(grchamp_state::portB_2_w)
{
/* B0 connects elsewhere */
}
@@ -505,9 +518,9 @@ ADDRESS_MAP_END
/* complete memory map derived from schematics */
static ADDRESS_MAP_START( sub_map, AS_PROGRAM, 8, grchamp_state )
AM_RANGE(0x0000, 0x1fff) AM_ROM
- AM_RANGE(0x2000, 0x27ff) AM_RAM_WRITE(grchamp_left_w) AM_SHARE("leftram")
- AM_RANGE(0x2800, 0x2fff) AM_RAM_WRITE(grchamp_right_w) AM_SHARE("rightram")
- AM_RANGE(0x3000, 0x37ff) AM_RAM_WRITE(grchamp_center_w) AM_SHARE("centerram")
+ AM_RANGE(0x2000, 0x27ff) AM_RAM_WRITE(left_w) AM_SHARE("leftram")
+ AM_RANGE(0x2800, 0x2fff) AM_RAM_WRITE(right_w) AM_SHARE("rightram")
+ AM_RANGE(0x3000, 0x37ff) AM_RAM_WRITE(center_w) AM_SHARE("centerram")
AM_RANGE(0x4000, 0x43ff) AM_MIRROR(0x0400) AM_RAM
AM_RANGE(0x5000, 0x6fff) AM_ROM
ADDRESS_MAP_END
@@ -636,13 +649,13 @@ static MACHINE_CONFIG_START( grchamp, grchamp_state )
MCFG_CPU_ADD("maincpu", Z80, PIXEL_CLOCK/2)
MCFG_CPU_PROGRAM_MAP(main_map)
MCFG_CPU_IO_MAP(main_portmap)
- MCFG_CPU_VBLANK_INT_DRIVER("screen", grchamp_state, grchamp_cpu0_interrupt)
+ MCFG_CPU_VBLANK_INT_DRIVER("screen", grchamp_state, cpu0_interrupt)
/* GAME BOARD */
MCFG_CPU_ADD("sub", Z80, PIXEL_CLOCK/2)
MCFG_CPU_PROGRAM_MAP(sub_map)
MCFG_CPU_IO_MAP(sub_portmap)
- MCFG_CPU_VBLANK_INT_DRIVER("screen", grchamp_state, grchamp_cpu1_interrupt)
+ MCFG_CPU_VBLANK_INT_DRIVER("screen", grchamp_state, cpu1_interrupt)
/* SOUND BOARD */
MCFG_CPU_ADD("audiocpu", Z80, SOUND_CLOCK/2)
@@ -660,23 +673,23 @@ static MACHINE_CONFIG_START( grchamp, grchamp_state )
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_ALWAYS_UPDATE)
MCFG_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART)
- MCFG_SCREEN_UPDATE_DRIVER(grchamp_state, screen_update_grchamp)
+ MCFG_SCREEN_UPDATE_DRIVER(grchamp_state, screen_update)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("ay1", AY8910, SOUND_CLOCK/4) /* 3B */
- MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(grchamp_state, grchamp_portA_0_w))
- MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(grchamp_state, grchamp_portB_0_w))
+ MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(grchamp_state, portA_0_w))
+ MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(grchamp_state, portB_0_w))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.2)
MCFG_SOUND_ADD("ay2", AY8910, SOUND_CLOCK/4)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.2)
MCFG_SOUND_ADD("ay3", AY8910, SOUND_CLOCK/4) /* 1B */
- MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(grchamp_state, grchamp_portA_2_w))
- MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(grchamp_state, grchamp_portB_2_w))
+ MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(grchamp_state, portA_2_w))
+ MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(grchamp_state, portB_2_w))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.2)
MCFG_SOUND_ADD("discrete", DISCRETE, 0)
@@ -747,4 +760,4 @@ ROM_END
*
*************************************/
-GAMEL( 1981, grchamp, 0, grchamp, grchamp, driver_device, 0, ROT270, "Taito", "Grand Champion", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS, layout_grchamp )
+GAMEL( 1981, grchamp, 0, grchamp, grchamp, driver_device, 0, ROT270, "Taito", "Grand Champion", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE, layout_grchamp )
diff --git a/src/mame/drivers/groundfx.c b/src/mame/drivers/groundfx.c
index 94466b9c6f6..a719cdd9223 100644
--- a/src/mame/drivers/groundfx.c
+++ b/src/mame/drivers/groundfx.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Bryan McPhail, David Graves
/***************************************************************************
diff --git a/src/mame/drivers/gstriker.c b/src/mame/drivers/gstriker.c
index ad0e1b7bab5..51f9be4173d 100644
--- a/src/mame/drivers/gstriker.c
+++ b/src/mame/drivers/gstriker.c
@@ -178,6 +178,13 @@ Frequencies: 68k is XTAL_32MHZ/2
******************************************************************************/
+void gstriker_state::machine_start()
+{
+ membank("soundbank")->configure_entries(0, 8, memregion("audiocpu")->base(), 0x8000);
+
+ save_item(NAME(m_dmmy_8f_ret));
+ save_item(NAME(m_pending_command));
+}
/*** MISC READ / WRITE HANDLERS **********************************************/
@@ -207,18 +214,14 @@ READ16_MEMBER(gstriker_state::pending_command_r)
}
#endif
-WRITE8_MEMBER(gstriker_state::gs_sh_pending_command_clear_w)
+WRITE8_MEMBER(gstriker_state::sh_pending_command_clear_w)
{
m_pending_command = 0;
}
-WRITE8_MEMBER(gstriker_state::gs_sh_bankswitch_w)
+WRITE8_MEMBER(gstriker_state::sh_bankswitch_w)
{
- UINT8 *RAM = memregion("audiocpu")->base();
- int bankaddress;
-
- bankaddress = (data & 0x07) * 0x8000;
- membank("bank1")->set_base(&RAM[bankaddress]);
+ membank("soundbank")->set_entry(data & 0x07);
}
/*** GFX DECODE **************************************************************/
@@ -258,15 +261,6 @@ static GFXDECODE_START( gstriker )
GFXDECODE_END
-/*** MORE SOUND RELATED ******************************************************/
-
-WRITE_LINE_MEMBER(gstriker_state::gs_ym2610_irq)
-{
- if (state)
- m_audiocpu->set_input_line(0, ASSERT_LINE);
- else
- m_audiocpu->set_input_line(0, CLEAR_LINE);
-}
/*** MEMORY LAYOUTS **********************************************************/
@@ -297,14 +291,14 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, gstriker_state )
AM_RANGE(0x0000, 0x77ff) AM_ROM
AM_RANGE(0x7800, 0x7fff) AM_RAM
- AM_RANGE(0x8000, 0xffff) AM_ROMBANK("bank1")
+ AM_RANGE(0x8000, 0xffff) AM_ROMBANK("soundbank")
ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_io_map, AS_IO, 8, gstriker_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x03) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
- AM_RANGE(0x04, 0x04) AM_WRITE(gs_sh_bankswitch_w)
- AM_RANGE(0x08, 0x08) AM_WRITE(gs_sh_pending_command_clear_w)
+ AM_RANGE(0x04, 0x04) AM_WRITE(sh_bankswitch_w)
+ AM_RANGE(0x08, 0x08) AM_WRITE(sh_pending_command_clear_w)
AM_RANGE(0x0c, 0x0c) AM_READ(soundlatch_byte_r)
ADDRESS_MAP_END
@@ -530,7 +524,7 @@ static MACHINE_CONFIG_START( gstriker, gstriker_state )
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(5000) /* hand-tuned, it needs a bit */)
MCFG_SCREEN_SIZE(64*8, 64*8)
MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 28*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(gstriker_state, screen_update_gstriker)
+ MCFG_SCREEN_UPDATE_DRIVER(gstriker_state, screen_update)
MCFG_SCREEN_PALETTE("palette")
MCFG_GFXDECODE_ADD("gfxdecode", "palette", gstriker)
@@ -540,9 +534,11 @@ static MACHINE_CONFIG_START( gstriker, gstriker_state )
MCFG_DEVICE_ADD("zoomtilemap", MB60553, 0)
MCFG_MB60553_GFXDECODE("gfxdecode")
+ MCFG_MB60553_GFX_REGION(1)
MCFG_DEVICE_ADD("texttilemap", VS920A, 0)
MCFG_VS920A_GFXDECODE("gfxdecode")
+ MCFG_VS920A_GFX_REGION(0)
MCFG_DEVICE_ADD("vsystem_spr", VSYSTEM_SPR, 0)
@@ -552,12 +548,10 @@ static MACHINE_CONFIG_START( gstriker, gstriker_state )
MCFG_VSYSTEM_SPR_GFXDECODE("gfxdecode")
MCFG_VSYSTEM_SPR_PALETTE("palette")
- MCFG_VIDEO_START_OVERRIDE(gstriker_state,gstriker)
-
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
MCFG_SOUND_ADD("ymsnd", YM2610, 8000000)
- MCFG_YM2610_IRQ_HANDLER(WRITELINE(gstriker_state, gs_ym2610_irq))
+ MCFG_YM2610_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
MCFG_SOUND_ROUTE(0, "lspeaker", 0.25)
MCFG_SOUND_ROUTE(0, "rspeaker", 0.25)
MCFG_SOUND_ROUTE(1, "lspeaker", 1.0)
@@ -576,11 +570,8 @@ static MACHINE_CONFIG_DERIVED( vgoal, gstriker )
MCFG_CPU_PROGRAM_MAP(gstriker_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", gstriker_state, irq1_line_hold)
- MCFG_DEVICE_REPLACE("vsystem_spr", VSYSTEM_SPR, 0)
- MCFG_VSYSTEM_SPR_SET_GFXREGION(2)
+ MCFG_DEVICE_MODIFY("vsystem_spr")
MCFG_VSYSTEM_SPR_SET_TRANSPEN(0xf) // different vs. the other games, find register
- MCFG_VSYSTEM_SPR_GFXDECODE("gfxdecode")
- MCFG_VSYSTEM_SPR_PALETTE("palette")
MACHINE_CONFIG_END
@@ -1010,7 +1001,7 @@ WRITE16_MEMBER(gstriker_state::vbl_toggle_w)
}
}
-void gstriker_state::mcu_init( )
+void gstriker_state::mcu_init()
{
m_dmmy_8f_ret = 0xFFFF;
m_pending_command = 0;
@@ -1021,6 +1012,9 @@ void gstriker_state::mcu_init( )
m_maincpu->space(AS_PROGRAM).install_write_handler(0x20008e, 0x20008f, write16_delegate(FUNC(gstriker_state::twrldc94_prot_reg_w),this));
m_maincpu->space(AS_PROGRAM).install_read_handler(0x20008e, 0x20008f, read16_delegate(FUNC(gstriker_state::twrldc94_prot_reg_r),this));
+
+ save_item(NAME(m_mcu_data));
+ save_item(NAME(m_prot_reg));
}
DRIVER_INIT_MEMBER(gstriker_state,twrldc94)
@@ -1046,13 +1040,13 @@ DRIVER_INIT_MEMBER(gstriker_state,vgoalsoc)
/*** GAME DRIVERS ************************************************************/
-GAME( 1993, gstriker, 0, gstriker, gstriker, driver_device, 0, ROT0, "Human", "Grand Striker", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS )
-GAME( 1993, gstrikera, gstriker, gstriker, gstriker, driver_device, 0, ROT0, "Human", "Grand Striker (Americas)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS )
-GAME( 1993, gstrikerj, gstriker, gstriker, gstriker, driver_device, 0, ROT0, "Human", "Grand Striker (Japan)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS )
+GAME( 1993, gstriker, 0, gstriker, gstriker, driver_device, 0, ROT0, "Human", "Grand Striker", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
+GAME( 1993, gstrikera, gstriker, gstriker, gstriker, driver_device, 0, ROT0, "Human", "Grand Striker (Americas)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
+GAME( 1993, gstrikerj, gstriker, gstriker, gstriker, driver_device, 0, ROT0, "Human", "Grand Striker (Japan)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
/* Similar, but not identical hardware, appear to be protected by an MCU :-( */
-GAME( 1994, vgoalsoc, 0, vgoal, vgoalsoc, gstriker_state, vgoalsoc, ROT0, "Tecmo", "V Goal Soccer (Europe)", GAME_NOT_WORKING ) // has ger/hol/arg/bra/ita/eng/spa/fra
-GAME( 1994, vgoalsca, vgoalsoc, vgoal, vgoalsoc, gstriker_state, vgoalsoc, ROT0, "Tecmo", "V Goal Soccer (US/Japan/Korea)", GAME_NOT_WORKING ) // has ger/hol/arg/bra/ita/kor/usa/jpn
-GAME( 1994, twrldc94, 0, twc94, twrldc94, gstriker_state, twrldc94, ROT0, "Tecmo", "Tecmo World Cup '94 (set 1)", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_GRAPHICS )
-GAME( 1994, twrldc94a,twrldc94, twc94, twrldc94, gstriker_state, twrldc94a, ROT0, "Tecmo", "Tecmo World Cup '94 (set 2)", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_GRAPHICS )
+GAME( 1994, vgoalsoc, 0, vgoal, vgoalsoc, gstriker_state, vgoalsoc, ROT0, "Tecmo", "V Goal Soccer (Europe)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) // has ger/hol/arg/bra/ita/eng/spa/fra
+GAME( 1994, vgoalsca, vgoalsoc, vgoal, vgoalsoc, gstriker_state, vgoalsoc, ROT0, "Tecmo", "V Goal Soccer (US/Japan/Korea)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) // has ger/hol/arg/bra/ita/kor/usa/jpn
+GAME( 1994, twrldc94, 0, twc94, twrldc94, gstriker_state, twrldc94, ROT0, "Tecmo", "Tecmo World Cup '94 (set 1)", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
+GAME( 1994, twrldc94a,twrldc94, twc94, twrldc94, gstriker_state, twrldc94a, ROT0, "Tecmo", "Tecmo World Cup '94 (set 2)", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/guab.c b/src/mame/drivers/guab.c
index 1a284d57c9a..47a250f3074 100644
--- a/src/mame/drivers/guab.c
+++ b/src/mame/drivers/guab.c
@@ -22,6 +22,7 @@
count gets updated in the code. Each game requires a unique
security PAL - maybe this is related? I'm poking the coin values
directly into RAM for now.
+ * Verify WD FDC type
***************************************************************************/
@@ -30,6 +31,8 @@
#include "machine/6840ptm.h"
#include "video/tms34061.h"
#include "sound/sn76496.h"
+#include "machine/wd_fdc.h"
+#include "formats/guab_dsk.h"
/*************************************
@@ -38,9 +41,6 @@
*
*************************************/
-#define LOG_FDC_COMMANDS 0
-#define FDC_LOG(x) do { if (LOG_FDC_COMMANDS) osd_printf_debug x; } while(0)
-
enum int_levels
{
@@ -50,7 +50,7 @@ enum int_levels
INT_6850ACIA = 4,
INT_TMS34061 = 5,
INT_FLOPPYCTRL = 6,
- INT_WATCHDOG_INT = 7,
+ INT_WATCHDOG_INT = 7
};
@@ -61,19 +61,6 @@ struct ef9369
};
-struct wd1770
-{
- UINT32 status;
- UINT8 cmd;
- UINT8 data;
-
- UINT32 side;
- INT32 track;
- INT32 sector;
- UINT32 sptr;
-};
-
-
class guab_state : public driver_device
{
public:
@@ -82,32 +69,35 @@ public:
m_maincpu(*this, "maincpu"),
m_tms34061(*this, "tms34061"),
m_sn(*this, "snsnd"),
+ m_fdc(*this, "fdc"),
+ m_floppy(*this, "fdc:0"),
m_palette(*this, "palette") { }
- /* devices */
- required_device<cpu_device> m_maincpu;
- required_device<tms34061_device> m_tms34061;
- required_device<sn76489_device> m_sn;
- required_device<palette_device> m_palette;
-
- struct ef9369 m_pal;
- emu_timer *m_fdc_timer;
- struct wd1770 m_fdc;
DECLARE_WRITE_LINE_MEMBER(generate_tms34061_interrupt);
DECLARE_WRITE16_MEMBER(guab_tms34061_w);
DECLARE_READ16_MEMBER(guab_tms34061_r);
DECLARE_WRITE16_MEMBER(ef9369_w);
DECLARE_READ16_MEMBER(ef9369_r);
- DECLARE_WRITE16_MEMBER(wd1770_w);
- DECLARE_READ16_MEMBER(wd1770_r);
DECLARE_READ16_MEMBER(io_r);
DECLARE_WRITE16_MEMBER(io_w);
DECLARE_INPUT_CHANGED_MEMBER(coin_inserted);
DECLARE_WRITE_LINE_MEMBER(ptm_irq);
- virtual void machine_start();
- virtual void machine_reset();
UINT32 screen_update_guab(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- TIMER_CALLBACK_MEMBER(fdc_data_callback);
+
+ DECLARE_FLOPPY_FORMATS(floppy_formats);
+
+protected:
+ virtual void machine_start();
+
+private:
+ required_device<cpu_device> m_maincpu;
+ required_device<tms34061_device> m_tms34061;
+ required_device<sn76489_device> m_sn;
+ required_device<wd1773_t> m_fdc;
+ required_device<floppy_connector> m_floppy;
+ required_device<palette_device> m_palette;
+
+ struct ef9369 m_pal;
};
@@ -275,285 +265,6 @@ UINT32 guab_state::screen_update_guab(screen_device &screen, bitmap_ind16 &bitma
}
-/*************************************
- *
- * WD1770 floppy disk controller
- * (just enough to get by...)
- *
- *************************************/
-
-#define USEC_DELAY 40
-#define DISK_SIDES 2
-#define DISK_TRACKS 80
-#define DISK_SECTORS 18
-
-#define DISK_SECTOR_SIZE 256
-#define DISK_TRACK_SIZE (DISK_SECTOR_SIZE * DISK_SECTORS)
-#define DISK_SIDE_SIZE (DISK_TRACK_SIZE * DISK_TRACKS)
-
-enum wd1770_status
-{
- BUSY = 1 << 0,
- DATA_REQUEST = 1 << 1,
- INDEX = 1 << 1,
- LOST_DATA = 1 << 2,
- TRACK_00 = 1 << 2,
- CRC_ERROR = 1 << 3,
- RECORD_NOT_FOUND = 1 << 4,
- RECORD_TYPE = 1 << 5,
- SPIN_UP = 1 << 5,
- WRITE_PROTECT = 1 << 6,
- MOTOR_ON = 1 << 7
-};
-
-
-TIMER_CALLBACK_MEMBER(guab_state::fdc_data_callback)
-{
- struct wd1770 &fdc = m_fdc;
- UINT8* disk = (UINT8*)memregion("user1")->base();
- int more_data = 0;
-
- /*
- Disk dumps are organised as:
-
- Side 0, Track 0: Sectors 0 - 17
- Side 1, Track 0: Sectors 0 - 17
- Side 0, Track 1: Sectors 0 - 17
- Side 1, Track 1: Sectors 0 - 17
- etc.
- */
-
- int idx = 2 * fdc.track * (DISK_TRACK_SIZE) + (fdc.side ? DISK_TRACK_SIZE : 0)+
- fdc.sector * (DISK_SECTOR_SIZE) +
- fdc.sptr;
-
- /* Write or read? */
- if (fdc.cmd & 0x20)
- disk[idx] = fdc.data;
- else
- fdc.data = disk[idx];
-
- fdc.sptr++;
-
- if (fdc.sptr < DISK_SECTOR_SIZE)
- {
- more_data = 1;
- }
- else
- {
- fdc.sptr = 0;
-
- /* Multi-sector read */
- if (fdc.cmd & 0x10)
- {
- ++fdc.sector;
-
- /* Keep going */
- if (fdc.sector < DISK_SECTORS)
- more_data = 1;
- }
- }
-
- if (more_data)
- {
- m_fdc_timer->adjust(attotime::from_usec(USEC_DELAY));
- }
- else
- {
- /* Hack!*/
- fdc.cmd = 0;
- fdc.status &= ~BUSY;
- }
-
- fdc.status |= DATA_REQUEST;
- m_maincpu->set_input_line(INT_FLOPPYCTRL, ASSERT_LINE);
-}
-
-
-WRITE16_MEMBER(guab_state::wd1770_w)
-{
- struct wd1770 &fdc = m_fdc;
- data &= 0xff;
-
- switch (offset)
- {
- case 0:
- {
- UINT8 cmd = (data >> 4) & 0xf;
-
- FDC_LOG(("Command: %x:: ", data));
-
- switch (cmd)
- {
- /**** Type I ****/
- case 0:
- {
- FDC_LOG(("Restore\n"));
- fdc.track = 0;
- break;
- }
-
- case 1:
- {
- FDC_LOG(("Seek to track %d\n", fdc.data));
- fdc.track = fdc.data;
- break;
- }
-
- /* Step */
- case 2:
- case 3:
- {
- FDC_LOG(("Step (not implemented)\n"));
- break;
- }
-
- case 4: case 5:
- {
- if (++fdc.track >= DISK_TRACKS)
- fdc.track = DISK_TRACKS - 1;
-
- FDC_LOG(("Step-in to track %d\n", fdc.track));
- break;
- }
-
- case 6: case 7:
- {
- if (--fdc.track > 0)
- fdc.track = 0;
-
- FDC_LOG(("Step-out to track %d\n", fdc.track));
- break;
- }
-
-
- /**** Type II ****/
- case 8:
- case 9:
- {
- fdc.cmd = data;
- fdc.status |= BUSY;
-
- if (data & 0x10)
- FDC_LOG(("Multi "));
-
- FDC_LOG(("Sector read: H%d T%d S%d\n", fdc.side,
- fdc.track,
- fdc.sector));
-
- /* Set the data read timer */
- m_fdc_timer->adjust(attotime::from_usec(USEC_DELAY));
-
- break;
- }
-
- case 10:
- case 11:
- {
- fdc.cmd = data;
- fdc.status |= BUSY;
-
- if (data & 0x10)
- FDC_LOG(("Multi "));
-
- FDC_LOG(("Sector write: H%d T%d S%d\n", fdc.side,
- fdc.track,
- fdc.sector));
-
- /* Trigger a DRQ interrupt on the CPU */
- m_maincpu->set_input_line(INT_FLOPPYCTRL, ASSERT_LINE);
- fdc.status |= DATA_REQUEST;
- break;
- }
-
- /**** Type III ****/
- case 12: /* Read address */
- case 14: /* Read track */
- case 15: /* Write track */
- {
- FDC_LOG(("Unsupported TYPE III operation\n"));
- break;
- }
-
- /**** Type IV ****/
- case 13:
- {
- /* Stop any operation in progress */
- m_fdc_timer->reset();
- fdc.status &= ~BUSY;
- FDC_LOG(("Force Interrupt\n"));
- break;
- }
- }
-
- break;
- }
- case 1:
- {
- FDC_LOG(("Set track: %d\n", data));
- fdc.track = data;
- break;
- }
- case 2:
- {
- FDC_LOG(("Set sector: %d\n", data));
- fdc.sector = data;
- fdc.sptr = 0;
- break;
- }
- case 3:
- {
- fdc.data = data;
-
- /* Clear the DRQ */
- m_maincpu->set_input_line(INT_FLOPPYCTRL, CLEAR_LINE);
-
- /* Queue an event to write the data if write command was specified */
- if (fdc.cmd & 0x20)
- m_fdc_timer->adjust(attotime::from_usec(USEC_DELAY));
-
- break;
- }
- }
-}
-
-READ16_MEMBER(guab_state::wd1770_r)
-{
- struct wd1770 &fdc = m_fdc;
- UINT16 retval = 0;
-
- switch (offset)
- {
- case 0:
- {
- retval = fdc.status;
- break;
- }
- case 1:
- {
- retval = fdc.track;
- break;
- }
- case 2:
- {
- retval = fdc.sector;
- break;
- }
- case 3:
- {
- retval = fdc.data;
-
- /* Clear the DRQ */
- m_maincpu->set_input_line(INT_FLOPPYCTRL, CLEAR_LINE);
- fdc.status &= ~DATA_REQUEST;
- break;
- }
- }
-
- return retval;
-}
-
-
/****************************************
*
* Hardware inputs (coins, buttons etc)
@@ -606,7 +317,6 @@ INPUT_CHANGED_MEMBER(guab_state::coin_inserted)
WRITE16_MEMBER(guab_state::io_w)
{
- struct wd1770 &fdc = m_fdc;
switch (offset)
{
case 0x10:
@@ -647,7 +357,10 @@ WRITE16_MEMBER(guab_state::io_w)
case 0x31:
{
/* Only JPM knows about the other bits... */
- fdc.side = (data >> 3) & 1;
+ m_floppy->get_device()->ss_w(BIT(data, 3));
+
+ // one of those bits will probably control the motor, we just let it run all the time for now
+ m_floppy->get_device()->mon_w(0);
break;
}
case 0x32:
@@ -681,7 +394,7 @@ static ADDRESS_MAP_START( guab_map, AS_PROGRAM, 16, guab_state )
AM_RANGE(0x0c0080, 0x0c0083) AM_NOP /* ACIA 1 */
AM_RANGE(0x0c00a0, 0x0c00a3) AM_NOP /* ACIA 2 */
AM_RANGE(0x0c00c0, 0x0c00cf) AM_DEVREADWRITE8("6840ptm", ptm6840_device, read, write, 0xff)
- AM_RANGE(0x0c00e0, 0x0c00e7) AM_READWRITE(wd1770_r, wd1770_w)
+ AM_RANGE(0x0c00e0, 0x0c00e7) AM_DEVREADWRITE8("fdc", wd1773_t, read, write, 0x00ff)
AM_RANGE(0x080000, 0x080fff) AM_RAM
AM_RANGE(0x100000, 0x100003) AM_READWRITE(ef9369_r, ef9369_w)
AM_RANGE(0x800000, 0xb0ffff) AM_READWRITE(guab_tms34061_r, guab_tms34061_w)
@@ -770,20 +483,22 @@ INPUT_PORTS_END
void guab_state::machine_start()
{
- m_fdc_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(guab_state::fdc_data_callback),this));
+ m_fdc->set_floppy(m_floppy->get_device());
}
-void guab_state::machine_reset()
-{
- memset(&m_fdc, 0, sizeof(m_fdc));
-}
+FLOPPY_FORMATS_MEMBER( guab_state::floppy_formats )
+ FLOPPY_GUAB_FORMAT
+FLOPPY_FORMATS_END
+
+static SLOT_INTERFACE_START( guab_floppies )
+ SLOT_INTERFACE("dd", FLOPPY_35_DD)
+SLOT_INTERFACE_END
static MACHINE_CONFIG_START( guab, guab_state )
/* TODO: Verify clock */
MCFG_CPU_ADD("maincpu", M68000, 8000000)
MCFG_CPU_PROGRAM_MAP(guab_map)
-
/* TODO: Use real video timings */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
@@ -811,6 +526,15 @@ static MACHINE_CONFIG_START( guab, guab_state )
MCFG_PTM6840_INTERNAL_CLOCK(1000000)
MCFG_PTM6840_EXTERNAL_CLOCKS(0, 0, 0)
MCFG_PTM6840_IRQ_CB(WRITELINE(guab_state, ptm_irq))
+
+ // floppy
+ MCFG_WD1773_ADD("fdc", 8000000)
+ MCFG_WD_FDC_DRQ_CALLBACK(INPUTLINE("maincpu", INT_FLOPPYCTRL))
+
+ MCFG_FLOPPY_DRIVE_ADD("fdc:0", guab_floppies, "dd", guab_state::floppy_formats)
+ MCFG_SLOT_FIXED(true)
+
+ MCFG_SOFTWARE_LIST_ADD("floppy_list", "guab")
MACHINE_CONFIG_END
@@ -826,95 +550,12 @@ ROM_START( guab )
ROM_LOAD16_BYTE( "guab1b1.rom", 0x00001, 0x8000, CRC(af3b5492) SHA1(6fd7f29e6ed2fadccc9246f1ebd049c3f9aeff13) )
ROM_LOAD16_BYTE( "guab2a1.rom", 0x10000, 0x8000, CRC(ae7a162c) SHA1(d69721818b8e4daba776a678b62bc7f44f371a3f) )
ROM_LOAD16_BYTE( "guab2b1.rom", 0x10001, 0x8000, CRC(29aa26a0) SHA1(8d425ad845ccfcd8995dbf6adc1ca17989a5d3ea) )
-
- ROM_REGION( 0xb4000, "user1", 0 )
- ROM_LOAD( "guab3.dsk", 0x00000, 0xb4000, CRC(ecb41e06) SHA1(2900a95046b38312c6035ea394b04b62c1d29f42) )
-ROM_END
-
-ROM_START( guab3a )
- ROM_REGION( 0x20000, "maincpu", 0 )
- ROM_LOAD16_BYTE( "guab1a1.rom", 0x00000, 0x8000, CRC(f23a9d7d) SHA1(f933e131bdcf21cfa6001c8e20fd11d94c7a9450) )
- ROM_LOAD16_BYTE( "guab1b1.rom", 0x00001, 0x8000, CRC(af3b5492) SHA1(6fd7f29e6ed2fadccc9246f1ebd049c3f9aeff13) )
- ROM_LOAD16_BYTE( "guab2a1.rom", 0x10000, 0x8000, CRC(ae7a162c) SHA1(d69721818b8e4daba776a678b62bc7f44f371a3f) )
- ROM_LOAD16_BYTE( "guab2b1.rom", 0x10001, 0x8000, CRC(29aa26a0) SHA1(8d425ad845ccfcd8995dbf6adc1ca17989a5d3ea) )
-
- ROM_REGION( 0xb4000, "user1", 0 )
- ROM_LOAD( "guab7c.dsk", 0x00000, 0xb4000, CRC(f5f10f87) SHA1(80e540339efbfe59b656d6cd4f466a17df84c123) )
-ROM_END
-
-ROM_START( guab4 )
- ROM_REGION( 0x20000, "maincpu", 0 )
- ROM_LOAD16_BYTE( "guab1a1.rom", 0x00000, 0x8000, CRC(f23a9d7d) SHA1(f933e131bdcf21cfa6001c8e20fd11d94c7a9450) )
- ROM_LOAD16_BYTE( "guab1b1.rom", 0x00001, 0x8000, CRC(af3b5492) SHA1(6fd7f29e6ed2fadccc9246f1ebd049c3f9aeff13) )
- ROM_LOAD16_BYTE( "guab2a1.rom", 0x10000, 0x8000, CRC(ae7a162c) SHA1(d69721818b8e4daba776a678b62bc7f44f371a3f) )
- ROM_LOAD16_BYTE( "guab2b1.rom", 0x10001, 0x8000, CRC(29aa26a0) SHA1(8d425ad845ccfcd8995dbf6adc1ca17989a5d3ea) )
-
- ROM_REGION( 0xb4000, "user1", 0 )
- ROM_LOAD( "guab8d.dsk", 0x00000, 0xb4000, CRC(b87c55ce) SHA1(20debbefae194276b0813518634cf52bed093e73) )
-ROM_END
-
-ROM_START( guab6 )
- ROM_REGION( 0x20000, "maincpu", 0 )
- ROM_LOAD16_BYTE( "guab1a1.rom", 0x00000, 0x8000, CRC(f23a9d7d) SHA1(f933e131bdcf21cfa6001c8e20fd11d94c7a9450) )
- ROM_LOAD16_BYTE( "guab1b1.rom", 0x00001, 0x8000, CRC(af3b5492) SHA1(6fd7f29e6ed2fadccc9246f1ebd049c3f9aeff13) )
- ROM_LOAD16_BYTE( "guab2a1.rom", 0x10000, 0x8000, CRC(ae7a162c) SHA1(d69721818b8e4daba776a678b62bc7f44f371a3f) )
- ROM_LOAD16_BYTE( "guab2b1.rom", 0x10001, 0x8000, CRC(29aa26a0) SHA1(8d425ad845ccfcd8995dbf6adc1ca17989a5d3ea) )
-
- ROM_REGION( 0xb4000, "user1", 0 )
- ROM_LOAD( "guabf6.dsk", 0x00000, 0xb4000, CRC(08804c28) SHA1(608d89d598b7acb133814540dba98cea29c6cad6) )
-ROM_END
-
-ROM_START( guab6a )
- ROM_REGION( 0x20000, "maincpu", 0 )
- ROM_LOAD16_BYTE( "guab1a1.rom", 0x00000, 0x8000, CRC(f23a9d7d) SHA1(f933e131bdcf21cfa6001c8e20fd11d94c7a9450) )
- ROM_LOAD16_BYTE( "guab1b1.rom", 0x00001, 0x8000, CRC(af3b5492) SHA1(6fd7f29e6ed2fadccc9246f1ebd049c3f9aeff13) )
- ROM_LOAD16_BYTE( "guab2a1.rom", 0x10000, 0x8000, CRC(ae7a162c) SHA1(d69721818b8e4daba776a678b62bc7f44f371a3f) )
- ROM_LOAD16_BYTE( "guab2b1.rom", 0x10001, 0x8000, CRC(29aa26a0) SHA1(8d425ad845ccfcd8995dbf6adc1ca17989a5d3ea) )
-
- ROM_REGION( 0xb4000, "user1", 0 )
- ROM_LOAD( "guab9f.dsk", 0x00000, 0xb4000, CRC(85329fe9) SHA1(f5ca1956c37b786fa0a4f8f0607a0a2b19d3fbb0) )
-ROM_END
-
-ROM_START( guab7 )
- ROM_REGION( 0x20000, "maincpu", 0 )
- ROM_LOAD16_BYTE( "guab1a1.rom", 0x00000, 0x8000, CRC(f23a9d7d) SHA1(f933e131bdcf21cfa6001c8e20fd11d94c7a9450) )
- ROM_LOAD16_BYTE( "guab1b1.rom", 0x00001, 0x8000, CRC(af3b5492) SHA1(6fd7f29e6ed2fadccc9246f1ebd049c3f9aeff13) )
- ROM_LOAD16_BYTE( "guab2a1.rom", 0x10000, 0x8000, CRC(ae7a162c) SHA1(d69721818b8e4daba776a678b62bc7f44f371a3f) )
- ROM_LOAD16_BYTE( "guab2b1.rom", 0x10001, 0x8000, CRC(29aa26a0) SHA1(8d425ad845ccfcd8995dbf6adc1ca17989a5d3ea) )
-
- ROM_REGION( 0xb4000, "user1", 0 )
- ROM_LOAD( "guab9g.dsk", 0x00000, 0xb4000, CRC(6b8c36f9) SHA1(1d9f4d943f2962603bbe39e5b58befe15954a6d6) )
-ROM_END
-
-ROM_START( guab21 )
- ROM_REGION( 0x20000, "maincpu", 0 )
- ROM_LOAD16_BYTE( "guab1a1.rom", 0x00000, 0x8000, CRC(f23a9d7d) SHA1(f933e131bdcf21cfa6001c8e20fd11d94c7a9450) )
- ROM_LOAD16_BYTE( "guab1b1.rom", 0x00001, 0x8000, CRC(af3b5492) SHA1(6fd7f29e6ed2fadccc9246f1ebd049c3f9aeff13) )
- ROM_LOAD16_BYTE( "guab2a1.rom", 0x10000, 0x8000, CRC(ae7a162c) SHA1(d69721818b8e4daba776a678b62bc7f44f371a3f) )
- ROM_LOAD16_BYTE( "guab2b1.rom", 0x10001, 0x8000, CRC(29aa26a0) SHA1(8d425ad845ccfcd8995dbf6adc1ca17989a5d3ea) )
-
- ROM_REGION( 0xb4000, "user1", 0 )
- ROM_LOAD( "guab21.dsk", 0x00000, 0xb4000, CRC(558ee009) SHA1(d2a02662216e10f80a215044f1929df7255b6136) )
-ROM_END
-
-ROM_START( guab43 )
- ROM_REGION( 0x20000, "maincpu", 0 )
- ROM_LOAD16_BYTE( "guab1a1.rom", 0x00000, 0x8000, CRC(f23a9d7d) SHA1(f933e131bdcf21cfa6001c8e20fd11d94c7a9450) )
- ROM_LOAD16_BYTE( "guab1b1.rom", 0x00001, 0x8000, CRC(af3b5492) SHA1(6fd7f29e6ed2fadccc9246f1ebd049c3f9aeff13) )
- ROM_LOAD16_BYTE( "guab2a1.rom", 0x10000, 0x8000, CRC(ae7a162c) SHA1(d69721818b8e4daba776a678b62bc7f44f371a3f) )
- ROM_LOAD16_BYTE( "guab2b1.rom", 0x10001, 0x8000, CRC(29aa26a0) SHA1(8d425ad845ccfcd8995dbf6adc1ca17989a5d3ea) )
-
- ROM_REGION( 0xb4000, "user1", 0 )
- ROM_LOAD( "guab43.dsk", 0x00000, 0xb3f00, CRC(96167357) SHA1(9d5f66e05ed1086be9699c4149071038f6986e0c) )
ROM_END
ROM_START( crisscrs )
ROM_REGION( 0x20000, "maincpu", 0 )
ROM_LOAD16_BYTE( "crisscross_swe_2a1.ic49", 0x00000, 0x8000, CRC(a7ca8828) SHA1(a28482bb2bc1248a9b5c0b57904c382246a632cc) )
ROM_LOAD16_BYTE( "crisscross_swe_2b1.ic48", 0x00001, 0x8000, CRC(7e280cae) SHA1(18c76459e39549ddba5f0cd7921013ef4f816826) )
-
- ROM_REGION( 0xb4000, "user1", 0 )
- ROM_LOAD( "crisscrs.dsk", 0x00000, 0xb4000, NO_DUMP )
ROM_END
ROM_START( tenup )
@@ -923,20 +564,6 @@ ROM_START( tenup )
ROM_LOAD16_BYTE( "tu-12.bin", 0x00001, 0x8000, CRC(1c7f32b1) SHA1(2b14e2206695ae53909ae838a5c036248d9ab940) )
ROM_LOAD16_BYTE( "tu-13.bin", 0x10000, 0x8000, CRC(d19e2bf7) SHA1(76a9cbd4f604ad39eb0e319a9a6d5a6739b0ed8c) )
ROM_LOAD16_BYTE( "tu-14.bin", 0x10001, 0x8000, CRC(fd8a0c3c) SHA1(f87289ce6f0d2bc9b7d3a0b6deff38ba3aadf391) )
-
- ROM_REGION( 0xb4000, "user1", 0 )
- ROM_LOAD( "10up17.dsk", 0x00000, 0xb4000, CRC(7bc328df) SHA1(5f8e40d8ffc370fb19be9e386befa5fcd1f35a75) )
-ROM_END
-
-ROM_START( tenup3 )
- ROM_REGION( 0x20000, "maincpu", 0 )
- ROM_LOAD16_BYTE( "tu-11.bin", 0x00000, 0x8000, CRC(01843086) SHA1(106a226900e8cf929f89edf801c627f02e4afce3) )
- ROM_LOAD16_BYTE( "tu-12.bin", 0x00001, 0x8000, CRC(1c7f32b1) SHA1(2b14e2206695ae53909ae838a5c036248d9ab940) )
- ROM_LOAD16_BYTE( "tu-13.bin", 0x10000, 0x8000, CRC(d19e2bf7) SHA1(76a9cbd4f604ad39eb0e319a9a6d5a6739b0ed8c) )
- ROM_LOAD16_BYTE( "tu-14.bin", 0x10001, 0x8000, CRC(fd8a0c3c) SHA1(f87289ce6f0d2bc9b7d3a0b6deff38ba3aadf391) )
-
- ROM_REGION( 0xb4000, "user1", 0 )
- ROM_LOAD( "10up3.dsk", 0x00000, 0xb4000, CRC(2767f017) SHA1(1c6551b089c3e3df48e0c03bd502b91fd88f0e94) )
ROM_END
@@ -946,14 +573,6 @@ ROM_END
*
*************************************/
-GAME( 1986, guab, 0, guab, guab, driver_device, 0, ROT0, "JPM", "Give us a Break (3rd edition)", 0 )
-GAME( 1986, guab3a, guab, guab, guab, driver_device, 0, ROT0, "JPM", "Give us a Break (3rd edition alt?)", 0 )
-GAME( 1986, guab4, guab, guab, guab, driver_device, 0, ROT0, "JPM", "Give us a Break (4th edition)", 0 )
-GAME( 1986, guab6, guab, guab, guab, driver_device, 0, ROT0, "JPM", "Give us a Break (6th edition)", 0 )
-GAME( 1986, guab6a, guab, guab, guab, driver_device, 0, ROT0, "JPM", "Give us a Break (6th edition alt?)", 0 )
-GAME( 1986, guab7, guab, guab, guab, driver_device, 0, ROT0, "JPM", "Give us a Break (7th edition)", 0 )
-GAME( 1986, guab21, guab, guab, guab, driver_device, 0, ROT0, "JPM", "Give us a Break (21st edition)", 0 )
-GAME( 1986, guab43, guab, guab, guab, driver_device, 0, ROT0, "JPM", "Give us a Break (43rd edition)", 0 )
-GAME( 1986, crisscrs, 0, guab, guab, driver_device, 0, ROT0, "JPM", "Criss Cross (Sweden)", GAME_NOT_WORKING )
-GAME( 1988, tenup, 0, guab, tenup, driver_device, 0, ROT0, "JPM", "Ten Up (compendium 17)", 0 )
-GAME( 1988, tenup3, tenup, guab, tenup, driver_device, 0, ROT0, "JPM", "Ten Up (compendium 3)", 0 )
+GAME( 1986, guab, 0, guab, guab, driver_device, 0, ROT0, "JPM", "Give us a Break", 0 )
+GAME( 1986, crisscrs, 0, guab, guab, driver_device, 0, ROT0, "JPM", "Criss Cross (Sweden)", GAME_NOT_WORKING )
+GAME( 1988, tenup, 0, guab, tenup, driver_device, 0, ROT0, "JPM", "Ten Up", 0 )
diff --git a/src/mame/drivers/gunbustr.c b/src/mame/drivers/gunbustr.c
index 6d6b73a806f..c17c60159fb 100644
--- a/src/mame/drivers/gunbustr.c
+++ b/src/mame/drivers/gunbustr.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Bryan McPhail, David Graves
/****************************************************************************
diff --git a/src/mame/drivers/gyruss.c b/src/mame/drivers/gyruss.c
index 0001553790b..e894a93edd2 100644
--- a/src/mame/drivers/gyruss.c
+++ b/src/mame/drivers/gyruss.c
@@ -466,7 +466,7 @@ static MACHINE_CONFIG_START( gyruss, gyruss_state )
MCFG_CPU_PROGRAM_MAP(main_cpu1_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", gyruss_state, master_vblank_irq)
- MCFG_CPU_ADD("sub", M6809, MASTER_CLOCK/12) /* 1.536 MHz */
+ MCFG_CPU_ADD("sub", KONAMI1, MASTER_CLOCK/12) /* 1.536 MHz */
MCFG_CPU_PROGRAM_MAP(main_cpu2_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", gyruss_state, slave_vblank_irq)
@@ -681,7 +681,6 @@ ROM_END
DRIVER_INIT_MEMBER(gyruss_state,gyruss)
{
- konami1_decode(machine(), "sub");
}
diff --git a/src/mame/drivers/hexion.c b/src/mame/drivers/hexion.c
index f9098c0a1c9..08c9d911fb2 100644
--- a/src/mame/drivers/hexion.c
+++ b/src/mame/drivers/hexion.c
@@ -101,12 +101,12 @@ WRITE8_MEMBER(hexion_state::coincntr_w)
if ((data & 0xdc) != 0x10) popmessage("coincntr %02x",data);
}
-WRITE_LINE_MEMBER(hexion_state::hexion_irq_ack_w)
+WRITE_LINE_MEMBER(hexion_state::irq_ack_w)
{
m_maincpu->set_input_line(0, CLEAR_LINE);
}
-WRITE_LINE_MEMBER(hexion_state::hexion_nmi_ack_w)
+WRITE_LINE_MEMBER(hexion_state::nmi_ack_w)
{
m_maincpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
}
@@ -115,8 +115,8 @@ static ADDRESS_MAP_START( hexion_map, AS_PROGRAM, 8, hexion_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0x8000, 0x9fff) AM_ROMBANK("bank1")
AM_RANGE(0xa000, 0xbfff) AM_RAM
- AM_RANGE(0xc000, 0xdffe) AM_READWRITE(hexion_bankedram_r, hexion_bankedram_w)
- AM_RANGE(0xdfff, 0xdfff) AM_WRITE(hexion_bankctrl_w)
+ AM_RANGE(0xc000, 0xdffe) AM_READWRITE(bankedram_r, bankedram_w)
+ AM_RANGE(0xdfff, 0xdfff) AM_WRITE(bankctrl_w)
AM_RANGE(0xe000, 0xe000) AM_NOP
AM_RANGE(0xe800, 0xe87f) AM_DEVREADWRITE("k051649", k051649_device, k051649_waveform_r, k051649_waveform_w)
AM_RANGE(0xe880, 0xe889) AM_DEVWRITE("k051649", k051649_device, k051649_frequency_w)
@@ -131,9 +131,9 @@ static ADDRESS_MAP_START( hexion_map, AS_PROGRAM, 8, hexion_state )
AM_RANGE(0xf403, 0xf403) AM_READ_PORT("P2")
AM_RANGE(0xf440, 0xf440) AM_READ_PORT("DSW3")
AM_RANGE(0xf441, 0xf441) AM_READ_PORT("SYSTEM")
- AM_RANGE(0xf480, 0xf480) AM_WRITE(hexion_bankswitch_w)
+ AM_RANGE(0xf480, 0xf480) AM_WRITE(bankswitch_w)
AM_RANGE(0xf4c0, 0xf4c0) AM_WRITE(coincntr_w)
- AM_RANGE(0xf500, 0xf500) AM_WRITE(hexion_gfxrom_select_w)
+ AM_RANGE(0xf500, 0xf500) AM_WRITE(gfxrom_select_w)
AM_RANGE(0xf540, 0xf540) AM_READ(watchdog_reset_r)
ADDRESS_MAP_END
@@ -141,8 +141,8 @@ static ADDRESS_MAP_START( hexionb_map, AS_PROGRAM, 8, hexion_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0x8000, 0x9fff) AM_ROMBANK("bank1")
AM_RANGE(0xa000, 0xbfff) AM_RAM
- AM_RANGE(0xc000, 0xdffe) AM_READWRITE(hexion_bankedram_r, hexion_bankedram_w)
- AM_RANGE(0xdfff, 0xdfff) AM_WRITE(hexion_bankctrl_w)
+ AM_RANGE(0xc000, 0xdffe) AM_READWRITE(bankedram_r, bankedram_w)
+ AM_RANGE(0xdfff, 0xdfff) AM_WRITE(bankctrl_w)
AM_RANGE(0xe000, 0xe000) AM_NOP
AM_RANGE(0xe800, 0xe87f) AM_NOP // all the code to use the k051649 is still present
AM_RANGE(0xe880, 0xe889) AM_NOP // but the bootleg has an additional M6295 @ 0xf5c0 instead
@@ -157,9 +157,9 @@ static ADDRESS_MAP_START( hexionb_map, AS_PROGRAM, 8, hexion_state )
AM_RANGE(0xf403, 0xf403) AM_READ_PORT("P2")
AM_RANGE(0xf440, 0xf440) AM_READ_PORT("DSW3")
AM_RANGE(0xf441, 0xf441) AM_READ_PORT("SYSTEM")
- AM_RANGE(0xf480, 0xf480) AM_WRITE(hexion_bankswitch_w)
+ AM_RANGE(0xf480, 0xf480) AM_WRITE(bankswitch_w)
AM_RANGE(0xf4c0, 0xf4c0) AM_WRITE(coincntr_w)
- AM_RANGE(0xf500, 0xf500) AM_WRITE(hexion_gfxrom_select_w)
+ AM_RANGE(0xf500, 0xf500) AM_WRITE(gfxrom_select_w)
AM_RANGE(0xf540, 0xf540) AM_READ(watchdog_reset_r)
AM_RANGE(0xf5c0, 0xf5c0) AM_DEVWRITE("oki2", okim6295_device, write)
ADDRESS_MAP_END
@@ -224,7 +224,7 @@ static GFXDECODE_START( hexion )
GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 16 )
GFXDECODE_END
-TIMER_DEVICE_CALLBACK_MEMBER(hexion_state::hexion_scanline)
+TIMER_DEVICE_CALLBACK_MEMBER(hexion_state::scanline)
{
int scanline = param;
@@ -240,11 +240,11 @@ static MACHINE_CONFIG_START( hexion, hexion_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z80, XTAL_24MHz/4) /* Z80B 6 MHz @ 17F, xtal verified, divider not verified */
MCFG_CPU_PROGRAM_MAP(hexion_map)
- MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", hexion_state, hexion_scanline, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", hexion_state, scanline, "screen", 0, 1)
MCFG_DEVICE_ADD("k053252", K053252, XTAL_24MHz/2) /* K053252, X0-010(?) @8D, xtal verified, divider not verified */
- MCFG_K053252_INT1_ACK_CB(WRITELINE(hexion_state, hexion_irq_ack_w))
- MCFG_K053252_INT2_ACK_CB(WRITELINE(hexion_state, hexion_nmi_ack_w))
+ MCFG_K053252_INT1_ACK_CB(WRITELINE(hexion_state, irq_ack_w))
+ MCFG_K053252_INT2_ACK_CB(WRITELINE(hexion_state, nmi_ack_w))
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -252,7 +252,7 @@ static MACHINE_CONFIG_START( hexion, hexion_state )
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
MCFG_SCREEN_SIZE(64*8, 36*8)
MCFG_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 0*8, 32*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(hexion_state, screen_update_hexion)
+ MCFG_SCREEN_UPDATE_DRIVER(hexion_state, screen_update)
MCFG_SCREEN_PALETTE("palette")
MCFG_GFXDECODE_ADD("gfxdecode", "palette", hexion)
diff --git a/src/mame/drivers/hyperspt.c b/src/mame/drivers/hyperspt.c
index 826e5e278c0..bbbe2f74a26 100644
--- a/src/mame/drivers/hyperspt.c
+++ b/src/mame/drivers/hyperspt.c
@@ -292,7 +292,7 @@ INTERRUPT_GEN_MEMBER(hyperspt_state::vblank_irq)
static MACHINE_CONFIG_START( hyperspt, hyperspt_state )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", M6809, XTAL_18_432MHz/12) /* verified on pcb */
+ MCFG_CPU_ADD("maincpu", KONAMI1, XTAL_18_432MHz/12) /* verified on pcb */
MCFG_CPU_PROGRAM_MAP(hyperspt_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", hyperspt_state, vblank_irq)
@@ -544,7 +544,6 @@ ROM_END
DRIVER_INIT_MEMBER(hyperspt_state,hyperspt)
{
- konami1_decode(machine(), "maincpu");
}
diff --git a/src/mame/drivers/igs017.c b/src/mame/drivers/igs017.c
index 2a76f9ecc59..c049153dde3 100644
--- a/src/mame/drivers/igs017.c
+++ b/src/mame/drivers/igs017.c
@@ -72,7 +72,8 @@ public:
m_screen(*this, "screen"),
m_palette(*this, "palette"),
m_generic_paletteram_8(*this, "paletteram"),
- m_generic_paletteram_16(*this, "paletteram")
+ m_generic_paletteram_16(*this, "paletteram"),
+ m_decrypted_opcodes(*this, "decrypted_opcodes")
{ }
int m_input_addr;
@@ -89,6 +90,7 @@ public:
required_device<palette_device> m_palette;
optional_shared_ptr<UINT8> m_generic_paletteram_8;
optional_shared_ptr<UINT16> m_generic_paletteram_16;
+ optional_shared_ptr<UINT8> m_decrypted_opcodes;
void igs025_to_igs022_callback( void );
@@ -847,14 +849,12 @@ DRIVER_INIT_MEMBER(igs017_state,starzan)
int size = 0x040000;
UINT8 *data = memregion("maincpu")->base();
- UINT8 *code = auto_alloc_array(machine(), UINT8, size);
+ UINT8 *code = m_decrypted_opcodes;
memcpy(code, data, size);
starzan_decrypt(data, size, false); // data
starzan_decrypt(code, size, true); // opcodes
- m_maincpu->space(AS_PROGRAM).set_decrypted_region(0x00000, 0x3ffff, code);
-
mgcs_flip_sprites();
}
@@ -1349,6 +1349,10 @@ static ADDRESS_MAP_START( iqblocka_map, AS_PROGRAM, 8, igs017_state )
AM_RANGE( 0x10000, 0x3ffff ) AM_ROM
ADDRESS_MAP_END
+static ADDRESS_MAP_START( decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 8, igs017_state )
+ AM_RANGE( 0x00000, 0x3ffff ) AM_ROM AM_SHARE("decrypted_opcodes")
+ADDRESS_MAP_END
+
WRITE8_MEMBER(igs017_state::nmi_enable_w)
{
m_nmi_enable = data & 1;
@@ -3706,6 +3710,10 @@ static MACHINE_CONFIG_START( iqblocka, igs017_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
MACHINE_CONFIG_END
+static MACHINE_CONFIG_DERIVED( starzan, iqblocka )
+ MCFG_DEVICE_MODIFY("maincpu")
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
+MACHINE_CONFIG_END
// mgcs
@@ -4669,5 +4677,5 @@ GAME( 1998, lhzb2a, lhzb2, lhzb2a, lhzb2a, igs017_state, lhzb2a, ROT
GAME( 1998, slqz2, 0, slqz2, slqz2, igs017_state, slqz2, ROT0, "IGS", "Mahjong Shuang Long Qiang Zhu 2 (VS203J)", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION )
GAME( 1999?, tarzan, 0, iqblocka, iqblocka, igs017_state, tarzan, ROT0, "IGS", "Tarzan (V109C)", GAME_NOT_WORKING )
GAME( 1999?, tarzana, tarzan, iqblocka, iqblocka, igs017_state, tarzana, ROT0, "IGS", "Tarzan (V107)", GAME_NOT_WORKING )
-GAME( 2000?, starzan, 0, iqblocka, iqblocka, igs017_state, starzan, ROT0, "IGS / G.F. Gioca", "Super Tarzan (Italy, V100I)", GAME_NOT_WORKING )
+GAME( 2000?, starzan, 0, starzan, iqblocka, igs017_state, starzan, ROT0, "IGS / G.F. Gioca", "Super Tarzan (Italy, V100I)", GAME_NOT_WORKING )
GAME( ????, spkrform, spk116it, spkrform, spkrform, igs017_state, spkrform, ROT0, "IGS", "Super Poker (v100xD03) / Formosa", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION )
diff --git a/src/mame/drivers/itech8.c b/src/mame/drivers/itech8.c
index 514a31fbd1d..ee99b07888e 100644
--- a/src/mame/drivers/itech8.c
+++ b/src/mame/drivers/itech8.c
@@ -505,7 +505,6 @@
#include "machine/6522via.h"
#include "machine/nvram.h"
#include "machine/ticket.h"
-#include "video/tlc34076.h"
#include "includes/itech8.h"
#include "sound/2203intf.h"
#include "sound/2608intf.h"
@@ -526,7 +525,7 @@
*
*************************************/
-void itech8_state::itech8_update_interrupts(int periodic, int tms34061, int blitter)
+void itech8_state::update_interrupts(int periodic, int tms34061, int blitter)
{
device_type main_cpu_type = m_maincpu->type();
@@ -562,21 +561,21 @@ void itech8_state::itech8_update_interrupts(int periodic, int tms34061, int blit
TIMER_CALLBACK_MEMBER(itech8_state::irq_off)
{
- itech8_update_interrupts(0, -1, -1);
+ update_interrupts(0, -1, -1);
}
INTERRUPT_GEN_MEMBER(itech8_state::generate_nmi)
{
/* signal the NMI */
- itech8_update_interrupts(1, -1, -1);
- machine().scheduler().timer_set(attotime::from_usec(1), timer_expired_delegate(FUNC(itech8_state::irq_off),this));
+ update_interrupts(1, -1, -1);
+ m_irq_off_timer->adjust(attotime::from_usec(1));
if (FULL_LOGGING) logerror("------------ VBLANK (%d) --------------\n", m_screen->vpos());
}
-WRITE8_MEMBER(itech8_state::itech8_nmi_ack_w)
+WRITE8_MEMBER(itech8_state::nmi_ack_w)
{
/* doesn't seem to hold for every game (e.g., hstennis) */
/* m_maincpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE);*/
@@ -596,7 +595,28 @@ WRITE8_MEMBER(itech8_state::itech8_nmi_ack_w)
MACHINE_START_MEMBER(itech8_state,sstrike)
{
/* we need to update behind the beam as well */
- machine().scheduler().timer_set(m_screen->time_until_pos(0), timer_expired_delegate(FUNC(itech8_state::behind_the_beam_update),this), 32);
+ m_behind_beam_update_timer = timer_alloc(TIMER_BEHIND_BEAM_UPDATE);
+ m_behind_beam_update_timer->adjust(m_screen->time_until_pos(0), 32);
+
+ itech8_state::machine_start();
+}
+
+void itech8_state::machine_start()
+{
+ if (membank("bank1"))
+ membank("bank1")->configure_entries(0, 2, memregion("maincpu")->base() + 0x4000, 0xc000);
+
+ m_irq_off_timer = timer_alloc(TIMER_IRQ_OFF);
+ m_delayed_sound_data_timer = timer_alloc(TIMER_DELAYED_SOUND_DATA);
+ m_blitter_done_timer = timer_alloc(TIMER_BLITTER_DONE);
+
+ save_item(NAME(m_grom_bank));
+ save_item(NAME(m_blitter_int));
+ save_item(NAME(m_tms34061_int));
+ save_item(NAME(m_periodic_int));
+ save_item(NAME(m_sound_data));
+ save_item(NAME(m_pia_porta_data));
+ save_item(NAME(m_pia_portb_data));
}
void itech8_state::machine_reset()
@@ -606,7 +626,7 @@ void itech8_state::machine_reset()
/* make sure bank 0 is selected */
if (main_cpu_type == M6809 || main_cpu_type == HD6309)
{
- membank("bank1")->set_base(&memregion("maincpu")->base()[0x4000]);
+ membank("bank1")->set_entry(0);
m_maincpu->reset();
}
@@ -619,6 +639,30 @@ void itech8_state::machine_reset()
}
+void itech8_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
+{
+ switch (id)
+ {
+ case TIMER_IRQ_OFF:
+ irq_off(ptr, param);
+ break;
+ case TIMER_BEHIND_BEAM_UPDATE:
+ behind_the_beam_update(ptr, param);
+ break;
+ case TIMER_DELAYED_SOUND_DATA:
+ delayed_sound_data_w(ptr, param);
+ break;
+ case TIMER_BLITTER_DONE:
+ blitter_done(ptr, param);
+ break;
+ case TIMER_DELAYED_Z80_CONTROL:
+ delayed_z80_control_w(ptr, param);
+ break;
+ default:
+ assert_always(FALSE, "Unknown id in itech8_state::device_timer");
+ }
+}
+
/*************************************
*
@@ -639,7 +683,7 @@ TIMER_CALLBACK_MEMBER(itech8_state::behind_the_beam_update)
if (scanline >= 256) scanline = 0;
/* set a new timer */
- machine().scheduler().timer_set(m_screen->time_until_pos(scanline), timer_expired_delegate(FUNC(itech8_state::behind_the_beam_update),this), (scanline << 8) + interval);
+ m_behind_beam_update_timer->adjust(m_screen->time_until_pos(scanline), (scanline << 8) + interval);
}
@@ -650,21 +694,21 @@ TIMER_CALLBACK_MEMBER(itech8_state::behind_the_beam_update)
*
*************************************/
-WRITE8_MEMBER(itech8_state::blitter_w)
+WRITE8_MEMBER(itech8_state::blitter_bank_w)
{
/* bit 0x20 on address 7 controls CPU banking */
if (offset / 2 == 7)
- membank("bank1")->set_base(&memregion("maincpu")->base()[0x4000 + 0xc000 * ((data >> 5) & 1)]);
+ membank("bank1")->set_entry((data >> 5) & 1);
/* the rest is handled by the video hardware */
- itech8_blitter_w(space, offset, data);
+ blitter_w(space, offset, data);
}
WRITE8_MEMBER(itech8_state::rimrockn_bank_w)
{
/* banking is controlled here instead of by the blitter output */
- membank("bank1")->set_base(&memregion("maincpu")->base()[0x4000 + 0xc000 * (data & 3)]);
+ membank("bank1")->set_entry(data & 3);
}
@@ -738,7 +782,7 @@ TIMER_CALLBACK_MEMBER(itech8_state::delayed_sound_data_w)
WRITE8_MEMBER(itech8_state::sound_data_w)
{
- machine().scheduler().synchronize(timer_expired_delegate(FUNC(itech8_state::delayed_sound_data_w),this), data);
+ synchronize(TIMER_DELAYED_SOUND_DATA, data);
}
@@ -749,7 +793,7 @@ WRITE8_MEMBER(itech8_state::gtg2_sound_data_w)
((data & 0x5d) << 1) |
((data & 0x20) >> 3) |
((data & 0x02) << 5);
- machine().scheduler().synchronize(timer_expired_delegate(FUNC(itech8_state::delayed_sound_data_w),this), data);
+ synchronize(TIMER_DELAYED_SOUND_DATA, data);
}
@@ -783,14 +827,14 @@ WRITE16_MEMBER(itech8_state::grom_bank16_w)
WRITE16_MEMBER(itech8_state::display_page16_w)
{
if (ACCESSING_BITS_8_15)
- itech8_page_w(space, 0, ~data >> 8);
+ page_w(space, 0, ~data >> 8);
}
WRITE16_MEMBER(itech8_state::palette16_w)
{
if (ACCESSING_BITS_8_15)
- itech8_palette_w(space, offset / 8, data >> 8);
+ palette_w(space, offset / 8, data >> 8);
}
@@ -803,15 +847,15 @@ WRITE16_MEMBER(itech8_state::palette16_w)
/*------ common layout with TMS34061 at 0000 ------*/
static ADDRESS_MAP_START( tmslo_map, AS_PROGRAM, 8, itech8_state )
- AM_RANGE(0x0000, 0x0fff) AM_READWRITE(itech8_tms34061_r, itech8_tms34061_w)
+ AM_RANGE(0x0000, 0x0fff) AM_READWRITE(tms34061_r, tms34061_w)
AM_RANGE(0x1100, 0x1100) AM_WRITENOP
AM_RANGE(0x1120, 0x1120) AM_WRITE(sound_data_w)
AM_RANGE(0x1140, 0x1140) AM_READ_PORT("40") AM_WRITE(grom_bank_w)
- AM_RANGE(0x1160, 0x1160) AM_READ_PORT("60") AM_WRITE(itech8_page_w)
+ AM_RANGE(0x1160, 0x1160) AM_READ_PORT("60") AM_WRITE(page_w)
AM_RANGE(0x1180, 0x1180) AM_READ_PORT("80") AM_DEVWRITE("tms34061", tms34061_device, latch_w)
- AM_RANGE(0x11a0, 0x11a0) AM_WRITE(itech8_nmi_ack_w)
- AM_RANGE(0x11c0, 0x11df) AM_READ(itech8_blitter_r) AM_WRITE(blitter_w)
- AM_RANGE(0x11e0, 0x11ff) AM_WRITE(itech8_palette_w)
+ AM_RANGE(0x11a0, 0x11a0) AM_WRITE(nmi_ack_w)
+ AM_RANGE(0x11c0, 0x11df) AM_READ(blitter_r) AM_WRITE(blitter_bank_w)
+ AM_RANGE(0x11e0, 0x11ff) AM_WRITE(palette_w)
AM_RANGE(0x2000, 0x3fff) AM_RAM AM_SHARE("nvram")
AM_RANGE(0x4000, 0xffff) AM_ROMBANK("bank1")
ADDRESS_MAP_END
@@ -819,15 +863,15 @@ ADDRESS_MAP_END
/*------ common layout with TMS34061 at 1000 ------*/
static ADDRESS_MAP_START( tmshi_map, AS_PROGRAM, 8, itech8_state )
- AM_RANGE(0x1000, 0x1fff) AM_READWRITE(itech8_tms34061_r, itech8_tms34061_w)
+ AM_RANGE(0x1000, 0x1fff) AM_READWRITE(tms34061_r, tms34061_w)
AM_RANGE(0x0100, 0x0100) AM_WRITENOP
AM_RANGE(0x0120, 0x0120) AM_WRITE(sound_data_w)
AM_RANGE(0x0140, 0x0140) AM_READ_PORT("40") AM_WRITE(grom_bank_w)
- AM_RANGE(0x0160, 0x0160) AM_READ_PORT("60") AM_WRITE(itech8_page_w)
+ AM_RANGE(0x0160, 0x0160) AM_READ_PORT("60") AM_WRITE(page_w)
AM_RANGE(0x0180, 0x0180) AM_READ_PORT("80") AM_DEVWRITE("tms34061", tms34061_device, latch_w)
- AM_RANGE(0x01a0, 0x01a0) AM_WRITE(itech8_nmi_ack_w)
- AM_RANGE(0x01c0, 0x01df) AM_READ(itech8_blitter_r) AM_WRITE(blitter_w)
- AM_RANGE(0x01e0, 0x01ff) AM_WRITE(itech8_palette_w)
+ AM_RANGE(0x01a0, 0x01a0) AM_WRITE(nmi_ack_w)
+ AM_RANGE(0x01c0, 0x01df) AM_READ(blitter_r) AM_WRITE(blitter_bank_w)
+ AM_RANGE(0x01e0, 0x01ff) AM_WRITE(palette_w)
AM_RANGE(0x2000, 0x3fff) AM_RAM AM_SHARE("nvram")
AM_RANGE(0x4000, 0xffff) AM_ROMBANK("bank1")
ADDRESS_MAP_END
@@ -835,15 +879,15 @@ ADDRESS_MAP_END
/*------ Golden Tee Golf II 1992 layout ------*/
static ADDRESS_MAP_START( gtg2_map, AS_PROGRAM, 8, itech8_state )
- AM_RANGE(0x0100, 0x0100) AM_READ_PORT("40") AM_WRITE(itech8_nmi_ack_w)
- AM_RANGE(0x0120, 0x0120) AM_READ_PORT("60") AM_WRITE(itech8_page_w)
- AM_RANGE(0x0140, 0x015f) AM_WRITE(itech8_palette_w)
+ AM_RANGE(0x0100, 0x0100) AM_READ_PORT("40") AM_WRITE(nmi_ack_w)
+ AM_RANGE(0x0120, 0x0120) AM_READ_PORT("60") AM_WRITE(page_w)
+ AM_RANGE(0x0140, 0x015f) AM_WRITE(palette_w)
AM_RANGE(0x0140, 0x0140) AM_READ_PORT("80")
AM_RANGE(0x0160, 0x0160) AM_WRITE(grom_bank_w)
- AM_RANGE(0x0180, 0x019f) AM_READ(itech8_blitter_r) AM_WRITE(blitter_w)
+ AM_RANGE(0x0180, 0x019f) AM_READ(blitter_r) AM_WRITE(blitter_bank_w)
AM_RANGE(0x01c0, 0x01c0) AM_WRITE(gtg2_sound_data_w)
AM_RANGE(0x01e0, 0x01e0) AM_DEVWRITE("tms34061", tms34061_device, latch_w)
- AM_RANGE(0x1000, 0x1fff) AM_READWRITE(itech8_tms34061_r, itech8_tms34061_w)
+ AM_RANGE(0x1000, 0x1fff) AM_READWRITE(tms34061_r, tms34061_w)
AM_RANGE(0x2000, 0x3fff) AM_RAM AM_SHARE("nvram")
AM_RANGE(0x4000, 0xffff) AM_ROMBANK("bank1")
ADDRESS_MAP_END
@@ -859,9 +903,9 @@ static ADDRESS_MAP_START( ninclown_map, AS_PROGRAM, 16, itech8_state )
AM_RANGE(0x100180, 0x100181) AM_READ_PORT("60") AM_WRITE(display_page16_w)
AM_RANGE(0x100240, 0x100241) AM_DEVWRITE8("tms34061", tms34061_device, latch_w, 0xff00)
AM_RANGE(0x100280, 0x100281) AM_READ_PORT("80") AM_WRITENOP
- AM_RANGE(0x100300, 0x10031f) AM_READWRITE8(itech8_blitter_r, itech8_blitter_w, 0xffff)
+ AM_RANGE(0x100300, 0x10031f) AM_READWRITE8(blitter_r, blitter_w, 0xffff)
AM_RANGE(0x100380, 0x1003ff) AM_WRITE(palette16_w)
- AM_RANGE(0x110000, 0x110fff) AM_READWRITE8(itech8_tms34061_r, itech8_tms34061_w, 0xffff)
+ AM_RANGE(0x110000, 0x110fff) AM_READWRITE8(tms34061_r, tms34061_w, 0xffff)
ADDRESS_MAP_END
@@ -1586,7 +1630,7 @@ INPUT_PORTS_END
WRITE_LINE_MEMBER(itech8_state::generate_tms34061_interrupt)
{
- itech8_update_interrupts(-1, state, -1);
+ update_interrupts(-1, state, -1);
if (FULL_LOGGING && state) logerror("------------ DISPLAY INT (%d) --------------\n", m_screen->vpos());
}
@@ -1722,7 +1766,7 @@ static MACHINE_CONFIG_DERIVED( wfortune, itech8_core_hi )
/* video hardware */
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_VISIBLE_AREA(0, 255, 0, 239)
- MCFG_SCREEN_UPDATE_DRIVER(itech8_state, screen_update_itech8_2layer)
+ MCFG_SCREEN_UPDATE_DRIVER(itech8_state, screen_update_2layer)
MACHINE_CONFIG_END
@@ -1736,7 +1780,7 @@ static MACHINE_CONFIG_DERIVED( grmatch, itech8_core_hi )
/* video hardware */
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_VISIBLE_AREA(0, 399, 0, 239)
- MCFG_SCREEN_UPDATE_DRIVER(itech8_state, screen_update_itech8_grmatch)
+ MCFG_SCREEN_UPDATE_DRIVER(itech8_state, screen_update_grmatch)
/* palette updater */
MCFG_TIMER_DRIVER_ADD_SCANLINE("palette_timer", itech8_state, grmatch_palette_update, "screen", 0, 0)
@@ -1752,7 +1796,7 @@ static MACHINE_CONFIG_DERIVED( stratab_hi, itech8_core_hi )
/* video hardware */
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_VISIBLE_AREA(0, 255, 0, 239)
- MCFG_SCREEN_UPDATE_DRIVER(itech8_state, screen_update_itech8_2layer)
+ MCFG_SCREEN_UPDATE_DRIVER(itech8_state, screen_update_2layer)
MACHINE_CONFIG_END
@@ -1765,7 +1809,7 @@ static MACHINE_CONFIG_DERIVED( stratab_lo, itech8_core_lo )
/* video hardware */
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_VISIBLE_AREA(0, 255, 0, 239)
- MCFG_SCREEN_UPDATE_DRIVER(itech8_state, screen_update_itech8_2layer)
+ MCFG_SCREEN_UPDATE_DRIVER(itech8_state, screen_update_2layer)
MACHINE_CONFIG_END
@@ -1811,7 +1855,7 @@ static MACHINE_CONFIG_DERIVED( slikshot_lo_noz80, itech8_core_lo )
/* video hardware */
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_VISIBLE_AREA(0, 255, 0, 239)
- MCFG_SCREEN_UPDATE_DRIVER(itech8_state, screen_update_itech8_2page)
+ MCFG_SCREEN_UPDATE_DRIVER(itech8_state, screen_update_2page)
MACHINE_CONFIG_END
@@ -1831,7 +1875,7 @@ static MACHINE_CONFIG_DERIVED( hstennis_hi, itech8_core_hi )
/* video hardware */
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_VISIBLE_AREA(0, 399, 0, 239)
- MCFG_SCREEN_UPDATE_DRIVER(itech8_state, screen_update_itech8_2page_large)
+ MCFG_SCREEN_UPDATE_DRIVER(itech8_state, screen_update_2page_large)
MACHINE_CONFIG_END
@@ -1843,7 +1887,7 @@ static MACHINE_CONFIG_DERIVED( hstennis_lo, itech8_core_lo )
/* video hardware */
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_VISIBLE_AREA(0, 399, 0, 239)
- MCFG_SCREEN_UPDATE_DRIVER(itech8_state, screen_update_itech8_2page_large)
+ MCFG_SCREEN_UPDATE_DRIVER(itech8_state, screen_update_2page_large)
MACHINE_CONFIG_END
@@ -1859,7 +1903,7 @@ static MACHINE_CONFIG_DERIVED( rimrockn, itech8_core_hi )
/* video hardware */
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_VISIBLE_AREA(24, 375, 0, 239)
- MCFG_SCREEN_UPDATE_DRIVER(itech8_state, screen_update_itech8_2page_large)
+ MCFG_SCREEN_UPDATE_DRIVER(itech8_state, screen_update_2page_large)
MACHINE_CONFIG_END
@@ -1875,7 +1919,7 @@ static MACHINE_CONFIG_DERIVED( ninclown, itech8_core_hi )
/* video hardware */
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_VISIBLE_AREA(64, 423, 0, 239)
- MCFG_SCREEN_UPDATE_DRIVER(itech8_state, screen_update_itech8_2page_large)
+ MCFG_SCREEN_UPDATE_DRIVER(itech8_state, screen_update_2page_large)
MACHINE_CONFIG_END
@@ -1890,7 +1934,7 @@ static MACHINE_CONFIG_DERIVED( gtg2, itech8_core_lo )
/* video hardware */
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_VISIBLE_AREA(0, 255, 0, 239)
- MCFG_SCREEN_UPDATE_DRIVER(itech8_state, screen_update_itech8_2layer)
+ MCFG_SCREEN_UPDATE_DRIVER(itech8_state, screen_update_2layer)
MACHINE_CONFIG_END
@@ -2567,6 +2611,10 @@ DRIVER_INIT_MEMBER(itech8_state,grmatch)
m_maincpu->space(AS_PROGRAM).install_write_handler(0x0160, 0x0160, write8_delegate(FUNC(itech8_state::grmatch_palette_w),this));
m_maincpu->space(AS_PROGRAM).install_write_handler(0x0180, 0x0180, write8_delegate(FUNC(itech8_state::grmatch_xscroll_w),this));
m_maincpu->space(AS_PROGRAM).unmap_write(0x01e0, 0x01ff);
+
+ save_item(NAME(m_grmatch_palcontrol));
+ save_item(NAME(m_grmatch_xscroll));
+ save_item(NAME(m_grmatch_palette));
}
@@ -2575,6 +2623,25 @@ DRIVER_INIT_MEMBER(itech8_state,slikshot)
m_maincpu->space(AS_PROGRAM).install_read_handler (0x0180, 0x0180, read8_delegate(FUNC(itech8_state::slikshot_z80_r),this));
m_maincpu->space(AS_PROGRAM).install_read_handler (0x01cf, 0x01cf, read8_delegate(FUNC(itech8_state::slikshot_z80_control_r),this));
m_maincpu->space(AS_PROGRAM).install_write_handler(0x01cf, 0x01cf, write8_delegate(FUNC(itech8_state::slikshot_z80_control_w),this));
+
+ m_delayed_z80_control_timer = timer_alloc(TIMER_DELAYED_Z80_CONTROL);
+
+ save_item(NAME(m_z80_ctrl));
+ save_item(NAME(m_z80_port_val));
+ save_item(NAME(m_z80_clear_to_send));
+ save_item(NAME(m_sensor0));
+ save_item(NAME(m_sensor1));
+ save_item(NAME(m_sensor2));
+ save_item(NAME(m_sensor3));
+ save_item(NAME(m_curvx));
+ save_item(NAME(m_curvy));
+ save_item(NAME(m_curx));
+ save_item(NAME(m_xbuffer));
+ save_item(NAME(m_ybuffer));
+ save_item(NAME(m_ybuffer_next));
+ save_item(NAME(m_curxpos));
+ save_item(NAME(m_last_ytotal));
+ save_item(NAME(m_crosshair_vis));
}
@@ -2620,8 +2687,9 @@ DRIVER_INIT_MEMBER(itech8_state,rimrockn)
m_maincpu->space(AS_PROGRAM).install_read_port (0x0165, 0x0165, "165");
/* different banking mechanism (disable the old one) */
+ membank("bank1")->configure_entries(0, 4, memregion("maincpu")->base() + 0x4000, 0xc000);
m_maincpu->space(AS_PROGRAM).install_write_handler(0x01a0, 0x01a0, write8_delegate(FUNC(itech8_state::rimrockn_bank_w),this));
- m_maincpu->space(AS_PROGRAM).install_write_handler(0x01c0, 0x01df, write8_delegate(FUNC(itech8_state::itech8_blitter_w),this));
+ m_maincpu->space(AS_PROGRAM).install_write_handler(0x01c0, 0x01df, write8_delegate(FUNC(itech8_state::blitter_w),this));
}
diff --git a/src/mame/drivers/jack.c b/src/mame/drivers/jack.c
index 79148e92564..9b5d0132922 100644
--- a/src/mame/drivers/jack.c
+++ b/src/mame/drivers/jack.c
@@ -192,6 +192,10 @@ static ADDRESS_MAP_START( jack_map, AS_PROGRAM, 8, jack_state )
AM_RANGE(0xc000, 0xffff) AM_ROM
ADDRESS_MAP_END
+static ADDRESS_MAP_START( decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 8, jack_state )
+ AM_RANGE(0x0000, 0x3fff) AM_ROM AM_SHARE("decrypted_opcodes")
+ADDRESS_MAP_END
+
static ADDRESS_MAP_START( striv_map, AS_PROGRAM, 8, jack_state )
AM_RANGE(0xb000, 0xb0ff) AM_WRITENOP
AM_RANGE(0xc000, 0xcfff) AM_READ(striv_question_r)
@@ -929,6 +933,11 @@ static MACHINE_CONFIG_START( jack, jack_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
+static MACHINE_CONFIG_DERIVED( treahunt, jack )
+ MCFG_CPU_MODIFY("maincpu")
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
+MACHINE_CONFIG_END
+
static MACHINE_CONFIG_DERIVED( striv, jack )
@@ -1442,23 +1451,17 @@ DRIVER_INIT_MEMBER(jack_state,zzyzzyxx)
void jack_state::treahunt_decode( )
{
- int A;
- address_space &space = m_maincpu->space(AS_PROGRAM);
UINT8 *rom = memregion("maincpu")->base();
- UINT8 *decrypt = auto_alloc_array(machine(), UINT8, 0x4000);
- int data;
-
- space.set_decrypted_region(0x0000, 0x3fff, decrypt);
/* Thanks to Mike Balfour for helping out with the decryption */
- for (A = 0; A < 0x4000; A++)
+ for (int A = 0; A < 0x4000; A++)
{
- data = rom[A];
+ UINT8 data = rom[A];
if (A & 0x1000)
{
/* unencrypted = D0 D2 D5 D1 D3 D6 D4 D7 */
- decrypt[A] =
+ m_decrypted_opcodes[A] =
((data & 0x01) << 7) |
((data & 0x02) << 3) |
((data & 0x04) << 4) |
@@ -1469,12 +1472,12 @@ void jack_state::treahunt_decode( )
if ((A & 0x04) == 0)
/* unencrypted = !D0 D2 D5 D1 D3 D6 D4 !D7 */
- decrypt[A] ^= 0x81;
+ m_decrypted_opcodes[A] ^= 0x81;
}
else
{
/* unencrypted = !D7 D2 D5 D1 D3 D6 D4 !D0 */
- decrypt[A] =
+ m_decrypted_opcodes[A] =
(~data & 0x81) |
((data & 0x02) << 3) |
((data & 0x04) << 4) |
@@ -1555,7 +1558,7 @@ DRIVER_INIT_MEMBER(jack_state,striv)
GAME( 1982, jack, 0, jack, jack, jack_state, jack, ROT90, "Hara Industries (Cinematronics license)", "Jack the Giantkiller (set 1)", GAME_SUPPORTS_SAVE )
GAME( 1982, jack2, jack, jack, jack2, jack_state, jack, ROT90, "Hara Industries (Cinematronics license)", "Jack the Giantkiller (set 2)", GAME_SUPPORTS_SAVE )
GAME( 1982, jack3, jack, jack, jack3, jack_state, jack, ROT90, "Hara Industries (Cinematronics license)", "Jack the Giantkiller (set 3)", GAME_SUPPORTS_SAVE )
-GAME( 1982, treahunt, jack, jack, treahunt, jack_state, treahunt, ROT90, "Hara Industries", "Treasure Hunt", GAME_SUPPORTS_SAVE )
+GAME( 1982, treahunt, jack, treahunt, treahunt, jack_state, treahunt, ROT90, "Hara Industries", "Treasure Hunt", GAME_SUPPORTS_SAVE )
GAME( 1982, zzyzzyxx, 0, jack, zzyzzyxx, jack_state, zzyzzyxx, ROT90, "Cinematronics / Advanced Microcomputer Systems", "Zzyzzyxx (set 1)", GAME_SUPPORTS_SAVE )
GAME( 1982, zzyzzyxx2, zzyzzyxx, jack, zzyzzyxx, jack_state, zzyzzyxx, ROT90, "Cinematronics / Advanced Microcomputer Systems", "Zzyzzyxx (set 2)", GAME_SUPPORTS_SAVE )
GAME( 1982, brix, zzyzzyxx, jack, zzyzzyxx, jack_state, zzyzzyxx, ROT90, "Cinematronics / Advanced Microcomputer Systems", "Brix", GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/jailbrek.c b/src/mame/drivers/jailbrek.c
index 0142f42e7a9..2a58c3df652 100644
--- a/src/mame/drivers/jailbrek.c
+++ b/src/mame/drivers/jailbrek.c
@@ -246,7 +246,7 @@ void jailbrek_state::machine_reset()
static MACHINE_CONFIG_START( jailbrek, jailbrek_state )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", M6809, MASTER_CLOCK/12)
+ MCFG_CPU_ADD("maincpu", KONAMI1, MASTER_CLOCK/12)
MCFG_CPU_PROGRAM_MAP(jailbrek_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", jailbrek_state, jb_interrupt)
MCFG_CPU_PERIODIC_INT_DRIVER(jailbrek_state, jb_interrupt_nmi, 500) /* ? */
@@ -414,8 +414,6 @@ DRIVER_INIT_MEMBER(jailbrek_state,jailbrek)
SPEECH_ROM[ind] = SPEECH_ROM[ind + 0x2000];
}
}
-
- konami1_decode(machine(), "maincpu");
}
GAME( 1986, jailbrek, 0, jailbrek, jailbrek, jailbrek_state, jailbrek, ROT0, "Konami", "Jail Break", GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/jankenmn.c b/src/mame/drivers/jankenmn.c
index 8654b400c6c..580e3ad2353 100644
--- a/src/mame/drivers/jankenmn.c
+++ b/src/mame/drivers/jankenmn.c
@@ -38,6 +38,16 @@
****************************************************************************
+ General Notes...
+
+ For better experience, use the hi-res external artwork I made.
+
+ Preview: http://www.robertofresca.com/imagenes/jankenmn_full.png
+ Artwork: http://mrdo.mameworld.info/artwork/jankenmn.zip
+ (mirror) http://www.progettoemma.net/mw/jankenmn.zip
+
+****************************************************************************
+
Hardware Notes...
1x LH0080A ; Sharp, Z80A CPU.
@@ -108,27 +118,27 @@
lamps:
- 0 = Multiplier 1 "attarii" (pays x1)
- 1 = Multiplier 2 "ooatari" (pays x2)
+ 00 = Multiplier 1 "attarii" (pays x1)
+ 01 = Multiplier 2 "ooatari" (pays x2)
- 2 = Rock button LED
- 3 = Scissors button LED
- 4 = Paper button LED
+ 02 = Rock button LED
+ 03 = Scissors button LED
+ 04 = Paper button LED
- 5 = Lose
- 6 = Draw
- 7 = Win
+ 05 = Lose
+ 06 = Draw
+ 07 = Win
- 8 = Base Hand
- 9 = Paper components
- 10 = Paper/Scissors components
+ 08 = Base Hand
+ 09 = Paper components
+ 10 = Paper/Scissors common components
11 = Rock components
12 = Scissors components
- 13 = Rock/Scissors components
+ 13 = Rock/Scissors common components
14 = Payout error LED
- Not implemented in internal .lay:
+ Not implemented in the internal layout/artwork:
15 = Rotating blue lamp
@@ -169,7 +179,7 @@ public:
*********************************************/
static const UINT8 led_map[16] = // 7748 IC?
- { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7c,0x07,0x7f,0x67,0x58,0x4c,0x62,0x69,0x78,0x00 };
+ { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0x58, 0x4c, 0x62, 0x69, 0x78, 0x00 };
WRITE8_MEMBER(jankenmn_state::lamps1_w)
{
@@ -182,7 +192,7 @@ WRITE8_MEMBER(jankenmn_state::lamps1_w)
output_set_lamp_value(13, (data & 3) != 0);
// d4-d7: led7seg (remaining credits) right digit
- output_set_digit_value(1, led_map[data >> 4 & 0xf]);
+ output_set_digit_value(1, led_map[data >> 4 & 0x0f]);
// d3: ? (only set if game is over)
}
@@ -222,6 +232,8 @@ WRITE8_MEMBER(jankenmn_state::lamps3_w)
coin_lockout_global_w(machine(), ~data & 0x20);
// d0, d6, d7: N/C?
+ if (data & 0x04)
+ logerror("payout: %02X\n", (data & 0x04));
}
CUSTOM_INPUT_MEMBER(jankenmn_state::hopper_status_r)
@@ -249,6 +261,46 @@ static ADDRESS_MAP_START( jankenmn_port_map, AS_IO, 8, jankenmn_state )
AM_RANGE(0x30, 0x30) AM_WRITENOP // ???
ADDRESS_MAP_END
+/*
+ Writes to port 30h....
+
+ They are coming from different code chunks, but seems that at least
+ they have different functions. Writes from 00B6h are unknown, whilst
+ others coming from 00D6h are counters. Sometimes whilst one increase,
+ the other one decrease. Writes coming from 0103h seems to clear (00)
+ or just end whatever the command sent.
+
+ Other behaviours could point to be different counters.
+
+ Also when you win, and the multipliers start to run, a lot of data
+ is written to the port. Maybe is a leftover, or just a connector to
+ hook the multiplier's 'roulette style' matrix lamps for other Janken
+ Man games...
+
+ ':maincpu' (00B6): unmapped io memory write to 0030 = 01 & FF
+ ':maincpu' (00D6): unmapped io memory write to 0030 = 2F & FF
+ ':maincpu' (0103): unmapped io memory write to 0030 = 00 & FF
+
+ ':maincpu' (00B6): unmapped io memory write to 0030 = F4 & FF
+ ':maincpu' (00D6): unmapped io memory write to 0030 = 30 & FF
+ ':maincpu' (0103): unmapped io memory write to 0030 = 00 & FF
+
+ ':maincpu' (00B6): unmapped io memory write to 0030 = E7 & FF
+ ':maincpu' (00D6): unmapped io memory write to 0030 = 31 & FF
+ ':maincpu' (0103): unmapped io memory write to 0030 = 00 & FF
+
+ ':maincpu' (00B6): unmapped io memory write to 0030 = DA & FF
+ ':maincpu' (00D6): unmapped io memory write to 0030 = 32 & FF
+ ':maincpu' (0103): unmapped io memory write to 0030 = 00 & FF
+
+ ':maincpu' (00B6): unmapped io memory write to 0030 = CD & FF
+ ':maincpu' (00D6): unmapped io memory write to 0030 = 33 & FF
+ ':maincpu' (0103): unmapped io memory write to 0030 = 00 & FF
+
+
+ Need more analysis...
+
+*/
/*********************************************
* Input Ports Definitions *
@@ -256,9 +308,9 @@ ADDRESS_MAP_END
static INPUT_PORTS_START( jankenmn )
PORT_START("IN0")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Guu (Rock)")
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Choki (Scissors)")
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Paa (Paper)")
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_CODE(KEYCODE_Z) PORT_NAME("Guu (Rock)")
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_CODE(KEYCODE_X) PORT_NAME("Choki (Scissors)")
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_CODE(KEYCODE_C) PORT_NAME("Paa (Paper)")
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN3 ) // 100 yen coin
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, jankenmn_state, hopper_status_r, NULL)
@@ -362,5 +414,5 @@ ROM_END
* Game Drivers *
*********************************************/
-/* YEAR NAME PARENT MACHINE INPUT INIT ROT COMPANY FULLNAME FLAGS... LAYOUT */
-GAMEL( 1991, jankenmn, 0, jankenmn, jankenmn, driver_device, 0, ROT0, "Sunwise", "Janken Man Kattara Ageru", GAME_SUPPORTS_SAVE, layout_jankenmn )
+/* YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS... LAYOUT */
+GAMEL( 1991, jankenmn, 0, jankenmn, jankenmn, driver_device, 0, ROT0, "Sunwise", "Janken Man Kattara Ageru", GAME_SUPPORTS_SAVE, layout_jankenmn )
diff --git a/src/mame/drivers/jongkyo.c b/src/mame/drivers/jongkyo.c
index 5b13a9ee921..4536391be9b 100644
--- a/src/mame/drivers/jongkyo.c
+++ b/src/mame/drivers/jongkyo.c
@@ -139,6 +139,7 @@ WRITE8_MEMBER(jongkyo_state::bank_select_w)
m_rom_bank |= mask;
membank("bank1")->set_entry(m_rom_bank);
+ membank("bank1d")->set_entry(m_rom_bank);
}
WRITE8_MEMBER(jongkyo_state::mux_w)
@@ -243,6 +244,11 @@ static ADDRESS_MAP_START( jongkyo_memmap, AS_PROGRAM, 8, jongkyo_state )
AM_RANGE(0x8000, 0xffff) AM_RAM AM_SHARE("videoram")
ADDRESS_MAP_END
+static ADDRESS_MAP_START( decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 8, jongkyo_state )
+ AM_RANGE(0x0000, 0x6bff) AM_ROMBANK("bank0d")
+ AM_RANGE(0x6c00, 0x6fff) AM_ROMBANK("bank1d")
+ADDRESS_MAP_END
+
static ADDRESS_MAP_START( jongkyo_portmap, AS_IO, 8, jongkyo_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
@@ -488,6 +494,7 @@ static MACHINE_CONFIG_START( jongkyo, jongkyo_state )
MCFG_CPU_ADD("maincpu", Z80,JONGKYO_CLOCK/4)
MCFG_CPU_PROGRAM_MAP(jongkyo_memmap)
MCFG_CPU_IO_MAP(jongkyo_portmap)
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", jongkyo_state, irq0_line_hold)
@@ -518,12 +525,13 @@ MACHINE_CONFIG_END
*************************************/
ROM_START( jongkyo )
- ROM_REGION( 0x9000, "maincpu", 0 )
+ ROM_REGION( 0x8c00, "maincpu", 0 )
ROM_LOAD( "epr-6258", 0x00000, 0x02000, CRC(fb8b7bcc) SHA1(8ece7c2c82c237b4b51829d412b2109b96ccd0e7) )
ROM_LOAD( "epr-6259", 0x02000, 0x02000, CRC(e46cde5d) SHA1(1cbe1677cfb3fa9f76ad90d5b1446ce9cefee6b7) )
ROM_LOAD( "epr-6260", 0x04000, 0x02000, CRC(369a5365) SHA1(037a2971a59ab339595b333cbdfd4cbb104de2be) )
- ROM_LOAD( "epr-6262", 0x06000, 0x01000, CRC(ecf50f34) SHA1(ecfa1a9360d8fbcbed457d46e53bae77f6d78c1d) )
- ROM_LOAD( "epr-6261", 0x07000, 0x02000, CRC(9c475ae1) SHA1(b993c2636dafed9f80fa87e71921c3c85c039e45) ) // banked at 6c00-6fff
+ ROM_LOAD( "epr-6262", 0x06000, 0x00c00, CRC(ecf50f34) SHA1(ecfa1a9360d8fbcbed457d46e53bae77f6d78c1d) )
+ ROM_IGNORE(0x400)
+ ROM_LOAD( "epr-6261", 0x06c00, 0x02000, CRC(9c475ae1) SHA1(b993c2636dafed9f80fa87e71921c3c85c039e45) ) // banked at 6c00-6fff
ROM_REGION( 0x300, "proms", 0 )
/* colours */
@@ -544,17 +552,44 @@ ROM_END
DRIVER_INIT_MEMBER(jongkyo_state,jongkyo)
{
- int i;
+ static const UINT8 convtable[32][4] =
+ {
+ /* opcode data address */
+ /* A B C D A B C D */
+ { 0x28,0x08,0xa8,0x88 }, { 0xa0,0xa8,0x20,0x28 }, /* ...0...0...0...0 */
+ { 0x80,0x88,0xa0,0xa8 }, { 0xa0,0xa8,0x20,0x28 }, /* ...0...0...0...1 */
+ { 0xa0,0xa8,0x20,0x28 }, { 0x20,0xa0,0x00,0x80 }, /* ...0...0...1...0 */
+ { 0xa0,0xa8,0x20,0x28 }, { 0x80,0x88,0xa0,0xa8 }, /* ...0...0...1...1 */
+ { 0x08,0x88,0x00,0x80 }, { 0x08,0x88,0x00,0x80 }, /* ...0...1...0...0 */
+ { 0x88,0xa8,0x80,0xa0 }, { 0x08,0x88,0x00,0x80 }, /* ...0...1...0...1 */
+ { 0x20,0xa0,0x00,0x80 }, { 0x20,0xa0,0x00,0x80 }, /* ...0...1...1...0 */
+ { 0x08,0x88,0x00,0x80 }, { 0x08,0x88,0x00,0x80 }, /* ...0...1...1...1 */
+ { 0x88,0xa8,0x80,0xa0 }, { 0xa0,0xa8,0x20,0x28 }, /* ...1...0...0...0 */
+ { 0x80,0x88,0xa0,0xa8 }, { 0x80,0x88,0xa0,0xa8 }, /* ...1...0...0...1 */
+ { 0xa0,0xa8,0x20,0x28 }, { 0x20,0xa0,0x00,0x80 }, /* ...1...0...1...0 */
+ { 0xa0,0xa8,0x20,0x28 }, { 0x80,0x88,0xa0,0xa8 }, /* ...1...0...1...1 */
+ { 0x08,0x88,0x00,0x80 }, { 0x28,0x08,0xa8,0x88 }, /* ...1...1...0...0 */
+ { 0x08,0x88,0x00,0x80 }, { 0x80,0x88,0xa0,0xa8 }, /* ...1...1...0...1 */
+ { 0x28,0x08,0xa8,0x88 }, { 0x20,0xa0,0x00,0x80 }, /* ...1...1...1...0 */
+ { 0x80,0x88,0xa0,0xa8 }, { 0x08,0x88,0x00,0x80 } /* ...1...1...1...1 */
+ };
+
UINT8 *rom = memregion("maincpu")->base();
/* first of all, do a simple bitswap */
- for (i = 0x6000; i < 0x9000; ++i)
+ for (int i = 0x6000; i < 0x8c00; ++i)
{
rom[i] = BITSWAP8(rom[i], 7,6,5,3,4,2,1,0);
}
+ UINT8 *opcodes = auto_alloc_array(machine(), UINT8, 0x6c00+0x400*8);
+
/* then do the standard Sega decryption */
- jongkyo_decode(machine(), "maincpu");
+ sega_decode(rom, opcodes, 0x6c00, convtable, 8, 0x400);
+
+ membank("bank1")->configure_entries(0, 8, rom+0x6c00, 0x400);
+ membank("bank1d")->configure_entries(0, 8, opcodes+0x6c00, 0x400);
+ membank("bank0d")->set_base(opcodes);
}
diff --git a/src/mame/drivers/jpmsys5.c b/src/mame/drivers/jpmsys5.c
index d664f7014c0..85b23a65d63 100644
--- a/src/mame/drivers/jpmsys5.c
+++ b/src/mame/drivers/jpmsys5.c
@@ -53,7 +53,7 @@ enum int_levels
INT_6850ACIA = 4,
INT_WATCHDOG = 5,
INT_FLOPPYCTRL = 6,
- INT_POWERFAIL = 7,
+ INT_POWERFAIL = 7
};
diff --git a/src/mame/drivers/junofrst.c b/src/mame/drivers/junofrst.c
index a5f0180aefd..57bc3dfb294 100644
--- a/src/mame/drivers/junofrst.c
+++ b/src/mame/drivers/junofrst.c
@@ -409,7 +409,7 @@ INTERRUPT_GEN_MEMBER(junofrst_state::_30hz_irq)
static MACHINE_CONFIG_START( junofrst, junofrst_state )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", M6809, 1500000) /* 1.5 MHz ??? */
+ MCFG_CPU_ADD("maincpu", KONAMI1, 1500000) /* 1.5 MHz ??? */
MCFG_CPU_PROGRAM_MAP(main_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", junofrst_state, _30hz_irq)
@@ -507,10 +507,7 @@ ROM_END
DRIVER_INIT_MEMBER(junofrst_state,junofrst)
{
- UINT8 *decrypted = konami1_decode(machine(), "maincpu");
-
membank("bank1")->configure_entries(0, 16, memregion("maincpu")->base() + 0x10000, 0x1000);
- membank("bank1")->configure_decrypted_entries(0, 16, decrypted + 0x10000, 0x1000);
}
diff --git a/src/mame/drivers/kchamp.c b/src/mame/drivers/kchamp.c
index 754b464929f..79f2260bffd 100644
--- a/src/mame/drivers/kchamp.c
+++ b/src/mame/drivers/kchamp.c
@@ -115,6 +115,10 @@ static ADDRESS_MAP_START( kchampvs_map, AS_PROGRAM, 8, kchamp_state )
AM_RANGE(0xe000, 0xffff) AM_ROM
ADDRESS_MAP_END
+static ADDRESS_MAP_START( decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 8, kchamp_state )
+ AM_RANGE(0x0000, 0xffff) AM_ROM AM_SHARE("decrypted_opcodes")
+ADDRESS_MAP_END
+
static ADDRESS_MAP_START( kchampvs_io_map, AS_IO, 8, kchamp_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x00) AM_READ_PORT("P1") AM_WRITE(kchamp_flipscreen_w)
@@ -400,6 +404,7 @@ static MACHINE_CONFIG_START( kchampvs, kchamp_state )
MCFG_CPU_ADD("maincpu", Z80, XTAL_12MHz/4) /* verified on pcb */
MCFG_CPU_PROGRAM_MAP(kchampvs_map)
MCFG_CPU_IO_MAP(kchampvs_io_map)
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", kchamp_state, kc_interrupt)
MCFG_CPU_ADD("audiocpu", Z80, XTAL_12MHz/4) /* verified on pcb */
@@ -701,26 +706,19 @@ ROM_START( karatevs )
ROM_END
-UINT8 *kchamp_state::decrypt_code()
+void kchamp_state::decrypt_code()
{
- address_space &space = m_maincpu->space(AS_PROGRAM);
- UINT8 *decrypted = auto_alloc_array(machine(), UINT8, 0x10000);
UINT8 *rom = memregion("maincpu")->base();
- int A;
-
- space.set_decrypted_region(0x0000, 0xffff, decrypted);
-
- for (A = 0; A < 0x10000; A++)
- decrypted[A] = (rom[A] & 0x55) | ((rom[A] & 0x88) >> 2) | ((rom[A] & 0x22) << 2);
-
- return decrypted;
+ for (int A = 0; A < 0x10000; A++)
+ m_decrypted_opcodes[A] = (rom[A] & 0x55) | ((rom[A] & 0x88) >> 2) | ((rom[A] & 0x22) << 2);
}
DRIVER_INIT_MEMBER(kchamp_state,kchampvs)
{
+ decrypt_code();
+
UINT8 *rom = memregion("maincpu")->base();
- UINT8 *decrypted = decrypt_code();
int A;
/*
@@ -732,14 +730,14 @@ DRIVER_INIT_MEMBER(kchamp_state,kchampvs)
turns the encryption on, but this doesn't explain the
encrypted address for the jump.
*/
- decrypted[0] = rom[0]; /* this is a jump */
+ m_decrypted_opcodes[0] = rom[0]; /* this is a jump */
A = rom[1] + 256 * rom[2];
- decrypted[A] = rom[A]; /* fix opcode on first jump address (again, a jump) */
+ m_decrypted_opcodes[A] = rom[A]; /* fix opcode on first jump address (again, a jump) */
rom[A+1] ^= 0xee; /* fix address of the second jump */
A = rom[A+1] + 256 * rom[A+2];
- decrypted[A] = rom[A]; /* fix third opcode (ld a,$xx) */
+ m_decrypted_opcodes[A] = rom[A]; /* fix third opcode (ld a,$xx) */
A += 2;
- decrypted[A] = rom[A]; /* fix fourth opcode (ld ($xxxx),a */
+ m_decrypted_opcodes[A] = rom[A]; /* fix fourth opcode (ld ($xxxx),a */
/* and from here on, opcodes are encrypted */
m_counter = 0;
diff --git a/src/mame/drivers/kurukuru.c b/src/mame/drivers/kurukuru.c
index 1f8932d863d..048fe8d335a 100644
--- a/src/mame/drivers/kurukuru.c
+++ b/src/mame/drivers/kurukuru.c
@@ -266,7 +266,6 @@ WRITE_LINE_MEMBER(kurukuru_state::kurukuru_vdp_interrupt)
TIMER_DEVICE_CALLBACK_MEMBER(kurukuru_state::kurukuru_vdp_scanline)
{
- m_v9938->set_resolution(0);
m_v9938->interrupt();
}
diff --git a/src/mame/drivers/ladybug.c b/src/mame/drivers/ladybug.c
index b303d8b0f88..6f12067e4f9 100644
--- a/src/mame/drivers/ladybug.c
+++ b/src/mame/drivers/ladybug.c
@@ -142,6 +142,10 @@ static ADDRESS_MAP_START( ladybug_map, AS_PROGRAM, 8, ladybug_state )
AM_RANGE(0xe000, 0xe000) AM_READ_PORT("IN2")
ADDRESS_MAP_END
+static ADDRESS_MAP_START( decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 8, ladybug_state )
+ AM_RANGE(0x0000, 0x5fff) AM_ROM AM_SHARE("decrypted_opcodes")
+ADDRESS_MAP_END
+
static ADDRESS_MAP_START( sraider_cpu1_map, AS_PROGRAM, 8, ladybug_state )
AM_RANGE(0x0000, 0x5fff) AM_ROM
@@ -202,7 +206,7 @@ INPUT_CHANGED_MEMBER(ladybug_state::coin2_inserted)
CUSTOM_INPUT_MEMBER(ladybug_state::ladybug_p1_control_r)
{
- return ioport(LADYBUG_P1_CONTROL_PORT_TAG)->read();
+ return m_p1_control->read();
}
CUSTOM_INPUT_MEMBER(ladybug_state::ladybug_p2_control_r)
@@ -210,10 +214,10 @@ CUSTOM_INPUT_MEMBER(ladybug_state::ladybug_p2_control_r)
UINT32 ret;
/* upright cabinet only uses a single set of controls */
- if (ioport("DSW0")->read() & 0x20)
- ret = ioport(LADYBUG_P2_CONTROL_PORT_TAG)->read();
+ if (m_port_dsw0->read() & 0x20)
+ ret = m_p2_control->read();
else
- ret = ioport(LADYBUG_P1_CONTROL_PORT_TAG)->read();
+ ret = m_p1_control->read();
return ret;
}
@@ -786,6 +790,10 @@ static MACHINE_CONFIG_START( ladybug, ladybug_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
+static MACHINE_CONFIG_DERIVED( dorodon, ladybug )
+ MCFG_CPU_MODIFY("maincpu")
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
+MACHINE_CONFIG_END
static MACHINE_CONFIG_START( sraider, ladybug_state )
@@ -1043,15 +1051,11 @@ DRIVER_INIT_MEMBER(ladybug_state,dorodon)
/* decode the opcodes */
offs_t i;
- address_space &space = m_maincpu->space(AS_PROGRAM);
- UINT8 *decrypted = auto_alloc_array(machine(), UINT8, 0x6000);
UINT8 *rom = memregion("maincpu")->base();
UINT8 *table = memregion("user1")->base();
- space.set_decrypted_region(0x0000, 0x5fff, decrypted);
-
for (i = 0; i < 0x6000; i++)
- decrypted[i] = table[rom[i]];
+ m_decrypted_opcodes[i] = table[rom[i]];
}
@@ -1059,7 +1063,7 @@ GAME( 1981, cavenger, 0, ladybug, cavenger, driver_device, 0, ROT0,
GAME( 1981, ladybug, 0, ladybug, ladybug, driver_device, 0, ROT270, "Universal", "Lady Bug", GAME_SUPPORTS_SAVE )
GAME( 1981, ladybugb, ladybug, ladybug, ladybug, driver_device, 0, ROT270, "bootleg", "Lady Bug (bootleg set 1)", GAME_SUPPORTS_SAVE )
GAME( 1981, ladybgb2, ladybug, ladybug, ladybug, driver_device, 0, ROT270, "bootleg", "Lady Bug (bootleg set 2)", GAME_SUPPORTS_SAVE )
-GAME( 1982, dorodon, 0, ladybug, dorodon, ladybug_state, dorodon, ROT270, "UPL (Falcon license?)", "Dorodon (set 1)", GAME_SUPPORTS_SAVE ) // license or bootleg?
-GAME( 1982, dorodon2, dorodon, ladybug, dorodon, ladybug_state, dorodon, ROT270, "UPL (Falcon license?)", "Dorodon (set 2)", GAME_SUPPORTS_SAVE ) // "
+GAME( 1982, dorodon, 0, dorodon, dorodon, ladybug_state, dorodon, ROT270, "UPL (Falcon license?)", "Dorodon (set 1)", GAME_SUPPORTS_SAVE ) // license or bootleg?
+GAME( 1982, dorodon2, dorodon, dorodon, dorodon, ladybug_state, dorodon, ROT270, "UPL (Falcon license?)", "Dorodon (set 2)", GAME_SUPPORTS_SAVE ) // "
GAME( 1982, snapjack, 0, ladybug, snapjack, driver_device, 0, ROT0, "Universal", "Snap Jack", GAME_SUPPORTS_SAVE )
GAME( 1982, sraider, 0, sraider, sraider, driver_device, 0, ROT270, "Universal", "Space Raider", GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/lastduel.c b/src/mame/drivers/lastduel.c
index 6ba3030d07f..7764c85f1eb 100644
--- a/src/mame/drivers/lastduel.c
+++ b/src/mame/drivers/lastduel.c
@@ -25,7 +25,6 @@ To advance test mode screens:
TODO:
- The seem to be minor priority issues in Mad Gear, but the game might just
be like that. The priority PROM is dumped but currently not used.
-- visible area might be wrong
**************************************************************************
diff --git a/src/mame/drivers/legionna.c b/src/mame/drivers/legionna.c
index 83f37daec27..6143c3df745 100644
--- a/src/mame/drivers/legionna.c
+++ b/src/mame/drivers/legionna.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:David Graves, Angelo Salese, David Haywood, Tomasz Slanina
/***************************************************************************
diff --git a/src/mame/drivers/liberate.c b/src/mame/drivers/liberate.c
index 2e1a7eee959..42a67e605df 100644
--- a/src/mame/drivers/liberate.c
+++ b/src/mame/drivers/liberate.c
@@ -263,6 +263,10 @@ static ADDRESS_MAP_START( liberate_map, AS_PROGRAM, 8, liberate_state )
AM_RANGE(0x8000, 0xffff) AM_ROM
ADDRESS_MAP_END
+static ADDRESS_MAP_START( decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 8, liberate_state )
+ AM_RANGE(0x8000, 0xffff) AM_ROM AM_SHARE("decrypted_opcodes")
+ADDRESS_MAP_END
+
static ADDRESS_MAP_START( prosoccr_map, AS_PROGRAM, 8, liberate_state )
AM_RANGE(0x0000, 0x0fff) AM_RAM
AM_RANGE(0x1000, 0x3fff) AM_ROM /* Mirror of main rom */
@@ -373,54 +377,43 @@ static INPUT_PORTS_START( generic_input )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("DSW1")
- PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) )
+ PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("DSW1:1,2")
PORT_DIPSETTING( 0x00, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x01, DEF_STR( 1C_3C ) )
- PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_B ) )
+ PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("DSW1:3,4")
PORT_DIPSETTING( 0x00, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x0c, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x08, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x04, DEF_STR( 1C_3C ) )
- PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x40, 0x00, DEF_STR( Cabinet ) )
+ PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "DSW1:5")
+ PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "DSW1:6")
+ PORT_DIPNAME( 0x40, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("DSW1:7")
PORT_DIPSETTING( 0x00, DEF_STR( Upright ) )
PORT_DIPSETTING( 0x40, DEF_STR( Cocktail ) )
- PORT_DIPNAME( 0x80, 0x00, "Manufacturer" )
+ PORT_DIPNAME( 0x80, 0x00, "Manufacturer" ) PORT_DIPLOCATION("DSW1:8")
PORT_DIPSETTING( 0x00, "Data East USA" )
PORT_DIPSETTING( 0x80, "Data East Corporation" )
PORT_START("DSW2")
- PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
+ PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) PORT_DIPLOCATION("DSW2:1,2")
+ PORT_DIPSETTING( 0x01, "5" )
+ PORT_DIPSETTING( 0x02, "4" )
+ PORT_DIPSETTING( 0x03, "3" )
+ PORT_DIPSETTING( 0x00, DEF_STR( Infinite ) )
+ PORT_DIPNAME( 0x0c, 0x0c, "Bonus" ) PORT_DIPLOCATION("DSW2:3,4")
+ PORT_DIPSETTING( 0x00, "20000 only" )
+ PORT_DIPSETTING( 0x0c, "20000, every 40000 after" )
+ PORT_DIPSETTING( 0x08, "30000, every 50000 after" )
+ PORT_DIPSETTING( 0x04, "50000, every 70000 after" )
+ PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("DSW2:5,6")
+ PORT_DIPSETTING( 0x30, DEF_STR( Easy ) )
+ PORT_DIPSETTING( 0x20, DEF_STR( Normal ) )
+ PORT_DIPSETTING( 0x10, DEF_STR( Hard ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) )
+ PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "DSW2:7")
+ PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "DSW2:8")
PORT_START("TILT")
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_TILT )
@@ -437,25 +430,10 @@ static INPUT_PORTS_START( boomrang )
PORT_INCLUDE( generic_input )
PORT_MODIFY("DSW2")
- PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
- PORT_DIPSETTING( 0x03, "3" )
- PORT_DIPSETTING( 0x01, "4" )
- PORT_DIPSETTING( 0x02, "5" )
- PORT_DIPSETTING( 0x00, DEF_STR( Infinite ) )
- PORT_DIPNAME( 0x0c, 0x0c, "Bonus" )
- PORT_DIPSETTING( 0x00, "20K Only" )
- PORT_DIPSETTING( 0x0c, "20K & Every 30K" )
- PORT_DIPSETTING( 0x08, "30K & Every 50K" )
- PORT_DIPSETTING( 0x04, "50K & Every 70K" )
- PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) )
- PORT_DIPSETTING( 0x30, DEF_STR( Easy ) )
- PORT_DIPSETTING( 0x20, DEF_STR( Normal ) )
- PORT_DIPSETTING( 0x10, DEF_STR( Hard ) )
- PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) )
- PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) )
+ PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("DSW2:7")
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x80, 0x80, "Invincibility" ) /* Manual calls it "Hit Check Of Boomer" */
+ PORT_DIPNAME( 0x80, 0x80, "Invincibility" ) PORT_DIPLOCATION("DSW2:8") /* Manual calls it "Hit Check Of Boomer" */
PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
INPUT_PORTS_END
@@ -464,22 +442,17 @@ static INPUT_PORTS_START( kamikcab )
PORT_INCLUDE( generic_input )
PORT_MODIFY("DSW2")
- PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
+ PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) PORT_DIPLOCATION("DSW2:1,2")
+ PORT_DIPSETTING( 0x01, "5" )
PORT_DIPSETTING( 0x02, "2" )
PORT_DIPSETTING( 0x03, "3" )
- PORT_DIPSETTING( 0x01, "5" )
PORT_DIPSETTING( 0x00, DEF_STR( Infinite ) )
- PORT_DIPNAME( 0x0c, 0x0c, "Bonus" )
- PORT_DIPSETTING( 0x00, "20000" )
- PORT_DIPSETTING( 0x0c, "20000 Every 30000" )
- PORT_DIPSETTING( 0x08, "30000 Every 40000" )
- PORT_DIPSETTING( 0x04, "40000 Every 50000" )
- PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) )
- PORT_DIPSETTING( 0x30, DEF_STR( Easy ) )
- PORT_DIPSETTING( 0x20, DEF_STR( Normal ) )
- PORT_DIPSETTING( 0x10, DEF_STR( Hard ) )
- PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) )
- PORT_DIPNAME( 0x80, 0x80, "Invincibility (Cheat)" )
+ PORT_DIPNAME( 0x0c, 0x0c, "Bonus" ) PORT_DIPLOCATION("DSW2:3,4")
+ PORT_DIPSETTING( 0x00, "20000 only" )
+ PORT_DIPSETTING( 0x0c, "20000, every 30000 after" )
+ PORT_DIPSETTING( 0x08, "30000, every 40000 after" )
+ PORT_DIPSETTING( 0x04, "40000, every 50000 after" )
+ PORT_DIPNAME( 0x80, 0x80, "Invincibility (Cheat)" ) PORT_DIPLOCATION("DSW2:8")
PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
@@ -500,67 +473,35 @@ static INPUT_PORTS_START( liberate )
PORT_MODIFY("DSW1")
PORT_DIPNAME( 0x80, 0x80, "Manufacturer" )
- PORT_DIPSETTING( 0x00, "(INVALID) Data East USA (Dual Assault)" )
+ PORT_DIPSETTING( 0x00, "(INVALID) Data East USA (Dual Assault)" ) PORT_DIPLOCATION("DSW1:8")
PORT_DIPSETTING( 0x80, "Data East Corporation (Liberation)" )
PORT_MODIFY("DSW2")
- PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
- PORT_DIPSETTING( 0x03, "3" )
- PORT_DIPSETTING( 0x01, "4" )
- PORT_DIPSETTING( 0x02, "5" )
- PORT_DIPSETTING( 0x00, DEF_STR( Infinite ) )
- PORT_DIPNAME( 0x0c, 0x0c, "Bonus" )
- PORT_DIPSETTING( 0x00, "20000" )
- PORT_DIPSETTING( 0x0c, "20000 30000" )
- PORT_DIPSETTING( 0x08, "30000 50000" )
- PORT_DIPSETTING( 0x04, "50000 70000" )
- PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) /* Difficulty? */
- PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) /* Difficulty? */
- PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
+ PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "DSW2:7")
+ PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "DSW2:8")
INPUT_PORTS_END
static INPUT_PORTS_START( prosport )
PORT_INCLUDE( generic_input )
PORT_MODIFY("DSW1")
- PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x04, DEF_STR( On ) )
- PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x08, DEF_STR( On ) )
- PORT_DIPNAME( 0x10, 0x10, "Service" )
+ PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "DSW1:3")
+ PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "DSW1:4")
+ PORT_DIPNAME( 0x10, 0x10, "Service" ) PORT_DIPLOCATION("DSW1:5")
PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x20, 0x20, "Test Mode" )
+ PORT_DIPNAME( 0x20, 0x20, "Test Mode" ) PORT_DIPLOCATION("DSW1:6")
PORT_DIPSETTING( 0x00, "ROM Test" )
PORT_DIPSETTING( 0x20, "Maping Test" )
- PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x80, DEF_STR( On ) )
+ PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "DSW1:8")
PORT_MODIFY("DSW2")
- PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
+ PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "DSW2:1")
+ PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "DSW2:2")
+ PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "DSW2:3")
+ PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "DSW2:4")
+ PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "DSW2:5")
+ PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "DSW2:6")
INPUT_PORTS_END
static INPUT_PORTS_START( dualaslt )
@@ -581,9 +522,7 @@ static INPUT_PORTS_START( liberatb )
PORT_BIT( 0xf9, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_MODIFY("DSW1")
- PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
+ PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "DSW1:8")
PORT_MODIFY("TILT")
PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED )
@@ -593,54 +532,25 @@ static INPUT_PORTS_START( prosoccr )
PORT_INCLUDE( generic_input )
PORT_MODIFY("DSW1")
- PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_B ) ) //maybe reversed coins actually?
- PORT_DIPSETTING( 0x00, DEF_STR( 2C_1C ) )
- PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) )
- PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) )
- PORT_DIPSETTING( 0x01, DEF_STR( 1C_3C ) )
- PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_A ) )
- PORT_DIPSETTING( 0x00, DEF_STR( 2C_1C ) )
- PORT_DIPSETTING( 0x0c, DEF_STR( 1C_1C ) )
- PORT_DIPSETTING( 0x08, DEF_STR( 1C_2C ) )
- PORT_DIPSETTING( 0x04, DEF_STR( 1C_3C ) )
- PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
-
- PORT_MODIFY("DSW2")
- PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
+ PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "DSW1:7")
+ PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "DSW1:8")
+
+ PORT_MODIFY("DSW2") // Imported from decocass version "cpsoccer"
+ PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) ) PORT_DIPLOCATION("DSW2:1") /* Listed as "Number of Balls" */
+ PORT_DIPSETTING( 0x01, "3" )
+ PORT_DIPSETTING( 0x00, "5" )
+ PORT_DIPNAME( 0x06, 0x06, "Number of Nice Goal" ) PORT_DIPLOCATION("DSW2:2,3")
+ PORT_DIPSETTING( 0x00, DEF_STR( None ) )
+ PORT_DIPSETTING( 0x06, "5" )
+ PORT_DIPSETTING( 0x04, "10" )
+ PORT_DIPSETTING( 0x02, "20" )
+ PORT_DIPNAME( 0x08, 0x08, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("DSW2:4")
+ PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x08, DEF_STR( On ) )
+ PORT_DIPNAME( 0x10, 0x10, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("DSW2:5") /* Listed as "Class" */
+ PORT_DIPSETTING( 0x10, DEF_STR( Easy ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( Difficult ) )
+ PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "DSW2:6")
INPUT_PORTS_END
/*************************************
@@ -813,7 +723,7 @@ MACHINE_RESET_MEMBER(liberate_state,liberate)
m_bank = 0;
}
-static MACHINE_CONFIG_START( liberate, liberate_state )
+static MACHINE_CONFIG_START( liberate_base, liberate_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu",DECO16, 2000000)
@@ -855,7 +765,12 @@ static MACHINE_CONFIG_START( liberate, liberate_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
MACHINE_CONFIG_END
-static MACHINE_CONFIG_DERIVED( liberatb, liberate )
+static MACHINE_CONFIG_DERIVED( liberate, liberate_base )
+ MCFG_DEVICE_MODIFY("maincpu")
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
+MACHINE_CONFIG_END
+
+static MACHINE_CONFIG_DERIVED( liberatb, liberate_base )
/* basic machine hardware */
MCFG_CPU_REPLACE("maincpu", M6502, 2000000)
@@ -863,14 +778,14 @@ static MACHINE_CONFIG_DERIVED( liberatb, liberate )
MCFG_CPU_VBLANK_INT_DRIVER("screen", liberate_state, deco16_interrupt)
MACHINE_CONFIG_END
-static MACHINE_CONFIG_DERIVED( boomrang, liberate )
+static MACHINE_CONFIG_DERIVED( boomrang, liberate_base )
MCFG_VIDEO_START_OVERRIDE(liberate_state,boomrang)
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_UPDATE_DRIVER(liberate_state, screen_update_boomrang)
MACHINE_CONFIG_END
-static MACHINE_CONFIG_DERIVED( prosoccr, liberate )
+static MACHINE_CONFIG_DERIVED( prosoccr, liberate_base )
/* basic machine hardware */
MCFG_CPU_MODIFY("maincpu")
@@ -1362,21 +1277,14 @@ DRIVER_INIT_MEMBER(liberate_state,yellowcb)
DRIVER_INIT_MEMBER(liberate_state,liberate)
{
- int A;
- address_space &space = m_maincpu->space(AS_PROGRAM);
- UINT8 *decrypted = auto_alloc_array(machine(), UINT8, 0x10000);
UINT8 *ROM = memregion("maincpu")->base();
- space.set_decrypted_region(0x0000, 0xffff, decrypted);
-
/* Swap bits for opcodes only, not data */
- for (A = 0; A < 0x10000; A++) {
- decrypted[A] = (ROM[A] & 0xd7) | ((ROM[A] & 0x08) << 2) | ((ROM[A] & 0x20) >> 2);
- decrypted[A] = (decrypted[A] & 0xbb) | ((decrypted[A] & 0x04) << 4) | ((decrypted[A] & 0x40) >> 4);
- decrypted[A] = (decrypted[A] & 0x7d) | ((decrypted[A] & 0x02) << 6) | ((decrypted[A] & 0x80) >> 6);
+ for (int A = 0; A < 0x8000; A++) {
+ m_decrypted_opcodes[A] = (ROM[A+0x8000] & 0xd7) | ((ROM[A+0x8000] & 0x08) << 2) | ((ROM[A+0x8000] & 0x20) >> 2);
+ m_decrypted_opcodes[A] = (m_decrypted_opcodes[A] & 0xbb) | ((m_decrypted_opcodes[A] & 0x04) << 4) | ((m_decrypted_opcodes[A] & 0x40) >> 4);
+ m_decrypted_opcodes[A] = (m_decrypted_opcodes[A] & 0x7d) | ((m_decrypted_opcodes[A] & 0x02) << 6) | ((m_decrypted_opcodes[A] & 0x80) >> 6);
}
-
- membank("bank1")->configure_decrypted_entry(0, decrypted + 0x8000);
}
/*************************************
@@ -1386,8 +1294,8 @@ DRIVER_INIT_MEMBER(liberate_state,liberate)
*************************************/
GAME( 1983, prosoccr, 0, prosoccr, prosoccr, liberate_state, prosport, ROT270, "Data East Corporation", "Pro Soccer", GAME_SUPPORTS_SAVE )
-GAME( 1983, prosport, 0, prosport, prosport, liberate_state, prosport, ROT270, "Data East Corporation", "Pro Sports - Bowling, Tennis, and Golf (set 1)", GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
-GAME( 1983, prosporta, prosport, prosport, prosport, liberate_state, prosport, ROT270, "Data East Corporation", "Pro Sports - Bowling, Tennis, and Golf (set 2)", GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
+GAME( 1983, prosport, 0, prosport, prosport, liberate_state, prosport, ROT270, "Data East Corporation", "Pro Sports - Bowling, Tennis, and Golf", GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
+GAME( 1983, prosporta, prosport, prosport, prosport, liberate_state, prosport, ROT270, "Data East Corporation (Digital Controls license)", "Pro Sports - Bowling, Tennis, and Golf (USA)", GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
GAME( 1983, boomrang, 0, boomrang, boomrang, liberate_state, prosport, ROT270, "Data East Corporation", "Boomer Rang'r / Genesis (set 1)", GAME_SUPPORTS_SAVE )
GAME( 1983, boomranga, boomrang, boomrang, boomrang, liberate_state, prosport, ROT270, "Data East Corporation", "Boomer Rang'r / Genesis (set 2)", GAME_SUPPORTS_SAVE )
GAME( 1984, kamikcab, 0, boomrang, kamikcab, liberate_state, prosport, ROT270, "Data East Corporation", "Kamikaze Cabbie", GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/lindbergh.c b/src/mame/drivers/lindbergh.c
index b9a8f6855e9..9d14f057a39 100644
--- a/src/mame/drivers/lindbergh.c
+++ b/src/mame/drivers/lindbergh.c
@@ -573,7 +573,7 @@ GAME(2005, hotd4, lindbios, lindbergh, 0, driver_device, 0, ROT0, "Sega", "H
GAME(2005, vf5, lindbios, lindbergh, 0, driver_device, 0, ROT0, "Sega", "Virtua Fighter 5 (Export)", GAME_NOT_WORKING|GAME_UNEMULATED_PROTECTION|GAME_NO_SOUND)
GAME(2006, abclimax, lindbios, lindbergh, 0, driver_device, 0, ROT0, "Sega", "After Burner Climax (Export)", GAME_NOT_WORKING|GAME_UNEMULATED_PROTECTION|GAME_NO_SOUND)
GAME(2006, letsgoju, lindbios, lindbergh, 0, driver_device, 0, ROT0, "Sega", "Let's Go Jungle (Export)", GAME_NOT_WORKING|GAME_UNEMULATED_PROTECTION|GAME_NO_SOUND)
-GAME(2006, outr2sdx, lindbios, lindbergh, 0, driver_device, 0, ROT0, "Sega", "Outrun 2 SP SDX", GAME_NOT_WORKING|GAME_UNEMULATED_PROTECTION|GAME_NO_SOUND)
+GAME(2006, outr2sdx, lindbios, lindbergh, 0, driver_device, 0, ROT0, "Sega", "OutRun 2 SP SDX", GAME_NOT_WORKING|GAME_UNEMULATED_PROTECTION|GAME_NO_SOUND)
GAME(2006, psmash3, lindbios, lindbergh, 0, driver_device, 0, ROT0, "Sega", "Power Smash 3 / Virtua Tennis 3 (Export)", GAME_NOT_WORKING|GAME_UNEMULATED_PROTECTION|GAME_NO_SOUND)
GAME(2006, vtennis3, lindbios, lindbergh, 0, driver_device, 0, ROT0, "Sega", "Virtua Tennis 3 (Japan)", GAME_NOT_WORKING|GAME_UNEMULATED_PROTECTION|GAME_NO_SOUND)
GAME(2007, 2spicy, lindbios, lindbergh, 0, driver_device, 0, ROT0, "Sega", "2 Spicy", GAME_NOT_WORKING|GAME_UNEMULATED_PROTECTION|GAME_NO_SOUND)
diff --git a/src/mame/drivers/m107.c b/src/mame/drivers/m107.c
index cf5397ac5c9..bc1bd16490b 100644
--- a/src/mame/drivers/m107.c
+++ b/src/mame/drivers/m107.c
@@ -920,6 +920,34 @@ ROM_START( dsoccr94 )
ROM_LOAD( "ds_da0.ic24", 0x000000, 0x100000, CRC(67fc52fd) SHA1(5771e948115af8fe4a6d3f448c03a2a9b42b6f20) )
ROM_END
+ROM_START( dsoccr94k )
+ ROM_REGION( 0x100000, "maincpu", 0 )
+ ROM_LOAD16_BYTE( "ic59_h0.bin", 0x000001, 0x040000, CRC(7b26d8a3) SHA1(03b4a5f0c7bd72bee24065feb22b837b373d936c) )
+ ROM_LOAD16_BYTE( "ic61_l0.bin", 0x000000, 0x040000, CRC(b13f0ff4) SHA1(01d4241019abb16364090b2d00b93864d228ab98) )
+ ROM_LOAD16_BYTE( "ic60_h1.bin", 0x080001, 0x040000, CRC(6109041b) SHA1(063898a88f8a6a9f1510aa55e53a39f037b02903) )
+ ROM_LOAD16_BYTE( "ic62_l1.bin", 0x080000, 0x040000, CRC(97a01f6b) SHA1(e188e28f880f5f3f4d7b49eca639d643989b1468) )
+
+ ROM_REGION( 0x20000, "soundcpu", 0 )
+ ROM_LOAD16_BYTE( "a3-sh0-c-0.ic31", 0x00001, 0x10000, CRC(23fe6ffc) SHA1(896377961cafc19e44d9d889f9fbfdbaedd556da) )
+ ROM_LOAD16_BYTE( "a3-sl0-c-0.ic37", 0x00000, 0x10000, CRC(768132e5) SHA1(1bb64516eb58d3b246f08e1c07f091e78085689f) )
+
+ ROM_REGION( 0x400000, "gfx1", 0 ) /* chars */
+ ROM_LOAD16_BYTE( "ds_c00.ic29", 0x000000, 0x100000, CRC(2d31d418) SHA1(6cd0e362bc2e3f2b20d96ee97a04bff46ee3016a) ) /* MASK ROMs with no "official" rom label */
+ ROM_LOAD16_BYTE( "ds_c10.ic28", 0x000001, 0x100000, CRC(57f7bcd3) SHA1(a38e7cdfdea72d882fba414cae391ba09443e73c) )
+ ROM_LOAD16_BYTE( "ds_c01.ic21", 0x200000, 0x100000, CRC(9d31a464) SHA1(1e38ac296f64d77fabfc0d5f7921a9b7a8424875) )
+ ROM_LOAD16_BYTE( "ds_c11.ic20", 0x200001, 0x100000, CRC(a372e79f) SHA1(6b0889cfc2970028832566e25257927ddc461ea6) )
+
+ ROM_REGION( 0x400000, "gfx2", 0 ) /* sprites */
+ ROM_LOAD( "ds_000.ic11", 0x000000, 0x100000, CRC(366b3e29) SHA1(cb016dcbdc6e8ea56c28c00135263666b07df991) ) /* MASK ROMs with no "official" rom label */
+ ROM_LOAD( "ds_010.ic12", 0x100000, 0x100000, CRC(28a4cc40) SHA1(7f4e1ef995eaadf1945ee22ab3270cb8a21c601d) )
+ ROM_LOAD( "ds_020.ic13", 0x200000, 0x100000, CRC(5a310f7f) SHA1(21969e4247c8328d27118d00604096deaf6700af) )
+ ROM_LOAD( "ds_030.ic14", 0x300000, 0x100000, CRC(328b1f45) SHA1(4cbbd4d9be4fc151d426175bdbd35d8481bf2966) )
+
+ ROM_REGION( 0x100000, "irem", 0 ) /* ADPCM samples */
+ ROM_LOAD( "ds_da0.ic24", 0x000000, 0x100000, CRC(67fc52fd) SHA1(5771e948115af8fe4a6d3f448c03a2a9b42b6f20) )
+ROM_END
+
+
ROM_START( wpksoc )
ROM_REGION( 0x100000, "maincpu", 0 )
ROM_LOAD16_BYTE( "pk-h0-eur-d.h0", 0x000001, 0x040000, CRC(b4917788) SHA1(673294c518eaf28354fa6a3058f9325c6d9ddde6) )
@@ -1016,6 +1044,7 @@ GAME( 1993, airass, 0, airass, firebarr, m107_state, fireba
GAME( 1993, firebarr, airass, firebarr, firebarr, m107_state, firebarr, ROT270, "Irem", "Fire Barrel (Japan)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
GAME( 1994, dsoccr94, 0, dsoccr94, dsoccr94, m107_state, dsoccr94, ROT0, "Irem (Data East Corporation license)", "Dream Soccer '94 (World, M107 hardware)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
+GAME( 1994, dsoccr94k, dsoccr94, dsoccr94, dsoccr94, m107_state, dsoccr94, ROT0, "Irem (Data East Corporation license)", "Dream Soccer '94 (Korea, M107 hardware)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) // default team selected is Korea, so likely a Korean set
GAME( 1995, wpksoc, 0, wpksoc, wpksoc, m107_state, wpksoc, ROT0, "Jaleco", "World PK Soccer", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_NO_COCKTAIL | GAME_MECHANICAL | GAME_SUPPORTS_SAVE )
GAME( 1994, kftgoal, wpksoc, wpksoc, wpksoc, m107_state, wpksoc, ROT0, "Jaleco", "Kick for the Goal", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_NO_COCKTAIL | GAME_MECHANICAL | GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/m62.c b/src/mame/drivers/m62.c
index 00c5fbfbc44..e94b189791d 100644
--- a/src/mame/drivers/m62.c
+++ b/src/mame/drivers/m62.c
@@ -71,7 +71,6 @@ other supported games as well.
#include "emu.h"
#include "cpu/z80/z80.h"
-#include "audio/irem.h"
#include "includes/iremipt.h"
#include "includes/m62.h"
@@ -2182,7 +2181,7 @@ GAME( 1984, kungfumd, kungfum, kungfum, kungfum, driver_device, 0, ROT
GAME( 1984, spartanx, kungfum, kungfum, kungfum, driver_device, 0, ROT0, "Irem", "Spartan X (Japan)", GAME_SUPPORTS_SAVE )
GAME( 1984, kungfub, kungfum, kungfum, kungfum, driver_device, 0, ROT0, "bootleg", "Kung-Fu Master (bootleg set 1)", GAME_SUPPORTS_SAVE )
GAME( 1984, kungfub2, kungfum, kungfum, kungfum, driver_device, 0, ROT0, "bootleg", "Kung-Fu Master (bootleg set 2)", GAME_SUPPORTS_SAVE )
-GAME( 1984, battroad, 0, battroad, battroad, m62_state, battroad, ROT90, "Irem", "The Battle-Road", GAME_IMPERFECT_COLORS | GAME_SUPPORTS_SAVE )
+GAME( 1984, battroad, 0, battroad, battroad, m62_state, battroad, ROT90, "Irem", "The Battle-Road", GAME_SUPPORTS_SAVE )
GAME( 1984, ldrun, 0, ldrun, ldrun, driver_device, 0, ROT0, "Irem (licensed from Broderbund)", "Lode Runner (set 1)", GAME_SUPPORTS_SAVE )
GAME( 1984, ldruna, ldrun, ldrun, ldrun, driver_device, 0, ROT0, "Irem (licensed from Broderbund, Digital Controls Inc. license)", "Lode Runner (set 2)", GAME_SUPPORTS_SAVE )
GAME( 1984, ldrun2, 0, ldrun2, ldrun2, m62_state, ldrun2, ROT0, "Irem (licensed from Broderbund)", "Lode Runner II - The Bungeling Strikes Back", GAME_SUPPORTS_SAVE ) /* Japanese version is called Bangeringu Teikoku No Gyakushuu */
diff --git a/src/mame/drivers/madmotor.c b/src/mame/drivers/madmotor.c
index f2693e8f6ea..1c2be5ea2a2 100644
--- a/src/mame/drivers/madmotor.c
+++ b/src/mame/drivers/madmotor.c
@@ -291,45 +291,46 @@ MACHINE_CONFIG_END
/******************************************************************************/
+/* ROM names all corrected as per exact checksum matching PCB - system11 */
ROM_START( madmotor )
ROM_REGION( 0x80000, "maincpu", 0 ) /* 68000 code */
- ROM_LOAD16_BYTE( "02", 0x00000, 0x20000, CRC(50b554e0) SHA1(e33d0ab5464ab5ff394dd630536ac83baf0aa2c9) )
- ROM_LOAD16_BYTE( "00", 0x00001, 0x20000, CRC(2d6a1b3f) SHA1(fa7058bf907becac56ed9938c5643aaefdf7a2c0) )
- ROM_LOAD16_BYTE( "03", 0x40000, 0x20000, CRC(442a0a52) SHA1(86bb5470d5653d125481250f778c632371dddad8) )
- ROM_LOAD16_BYTE( "01", 0x40001, 0x20000, CRC(e246876e) SHA1(648dca8bab001cfb42618081bbc1efa14118743e) )
+ ROM_LOAD16_BYTE( "02-2.B4", 0x00000, 0x20000, CRC(50b554e0) SHA1(e33d0ab5464ab5ff394dd630536ac83baf0aa2c9) )
+ ROM_LOAD16_BYTE( "00-2.B1", 0x00001, 0x20000, CRC(2d6a1b3f) SHA1(fa7058bf907becac56ed9938c5643aaefdf7a2c0) )
+ ROM_LOAD16_BYTE( "03-2.B6", 0x40000, 0x20000, CRC(442a0a52) SHA1(86bb5470d5653d125481250f778c632371dddad8) )
+ ROM_LOAD16_BYTE( "01-2.B3", 0x40001, 0x20000, CRC(e246876e) SHA1(648dca8bab001cfb42618081bbc1efa14118743e) )
ROM_REGION( 0x10000, "audiocpu", 0 ) /* Sound CPU */
- ROM_LOAD( "14", 0x00000, 0x10000, CRC(1c28a7e5) SHA1(ed30d0a5a8a079677bd34b6d98ab1b15b934b30f) )
+ ROM_LOAD( "14.L7", 0x00000, 0x10000, CRC(1c28a7e5) SHA1(ed30d0a5a8a079677bd34b6d98ab1b15b934b30f) )
ROM_REGION( 0x020000, "gfx1", 0 )
- ROM_LOAD( "04", 0x000000, 0x10000, CRC(833ca3ab) SHA1(7a3e7ebecc1596d2e487595369ad9ba54ced5bfb) ) /* chars */
- ROM_LOAD( "05", 0x010000, 0x10000, CRC(a691fbfe) SHA1(c726a4c15d599feb6883d9b643453e7028fa16d6) )
+ ROM_LOAD( "04.A9", 0x000000, 0x10000, CRC(833ca3ab) SHA1(7a3e7ebecc1596d2e487595369ad9ba54ced5bfb) ) /* chars */
+ ROM_LOAD( "05.A11", 0x010000, 0x10000, CRC(a691fbfe) SHA1(c726a4c15d599feb6883d9b643453e7028fa16d6) )
ROM_REGION( 0x040000, "gfx2", 0 )
- ROM_LOAD( "10", 0x000000, 0x20000, CRC(9dbf482b) SHA1(086e9170d577e502604c180f174fbce53a1e20e5) ) /* tiles */
- ROM_LOAD( "11", 0x020000, 0x20000, CRC(593c48a9) SHA1(1158888f6b836253b8ae9db9b8e352f289b2e815) )
+ ROM_LOAD( "10.A19", 0x000000, 0x20000, CRC(9dbf482b) SHA1(086e9170d577e502604c180f174fbce53a1e20e5) ) /* tiles */
+ ROM_LOAD( "11.A21", 0x020000, 0x20000, CRC(593c48a9) SHA1(1158888f6b836253b8ae9db9b8e352f289b2e815) )
ROM_REGION( 0x080000, "gfx3", 0 )
- ROM_LOAD( "06", 0x000000, 0x20000, CRC(448850e5) SHA1(6a44a42738cf6a55b4bec807e0a3939a42b36793) ) /* tiles */
- ROM_LOAD( "07", 0x020000, 0x20000, CRC(ede4d141) SHA1(7b847372bac043aa397aa5c274f90b9193de9176) )
- ROM_LOAD( "08", 0x040000, 0x20000, CRC(c380e5e5) SHA1(ec87a94e7948b84c96b1577f5a8caebc56e38a94) )
- ROM_LOAD( "09", 0x060000, 0x20000, CRC(1ee3326a) SHA1(bd03e5c4a2e7689260e6cc67288e71ef13f05a4b) )
+ ROM_LOAD( "06.A13", 0x000000, 0x20000, CRC(448850e5) SHA1(6a44a42738cf6a55b4bec807e0a3939a42b36793) ) /* tiles */
+ ROM_LOAD( "07.A14", 0x020000, 0x20000, CRC(ede4d141) SHA1(7b847372bac043aa397aa5c274f90b9193de9176) )
+ ROM_LOAD( "08.A16", 0x040000, 0x20000, CRC(c380e5e5) SHA1(ec87a94e7948b84c96b1577f5a8caebc56e38a94) )
+ ROM_LOAD( "09.A18", 0x060000, 0x20000, CRC(1ee3326a) SHA1(bd03e5c4a2e7689260e6cc67288e71ef13f05a4b) )
ROM_REGION( 0x100000, "gfx4", 0 )
- ROM_LOAD( "15", 0x000000, 0x20000, CRC(90ae9f74) SHA1(806f96fd08fca1beeeaefe3c0fac1991410aa9c4) ) /* sprites */
- ROM_LOAD( "16", 0x020000, 0x20000, CRC(e96ac815) SHA1(a2b22a29ad0a4f144bb09299c454dc7a842a5318) )
- ROM_LOAD( "17", 0x040000, 0x20000, CRC(abad9a1b) SHA1(3cec6b4ef925205efe4a8fb28e08eb58e3ba4019) )
- ROM_LOAD( "18", 0x060000, 0x20000, CRC(96d8d64b) SHA1(54ce87fe2b14b574176d2a1d2b86057b9cd10883) )
- ROM_LOAD( "19", 0x080000, 0x20000, CRC(cbd8c9b8) SHA1(5e86c0298b3eea06920121eecb70e5bee705addf) )
- ROM_LOAD( "20", 0x0a0000, 0x20000, CRC(47f706a8) SHA1(bd4fe499710f8905eb4b8d1ca990f2908feb95e1) )
- ROM_LOAD( "21", 0x0c0000, 0x20000, CRC(9c72d364) SHA1(9290e463273fa1f921279f1bab808d91d3aa9648) )
- ROM_LOAD( "22", 0x0e0000, 0x20000, CRC(1e78aa60) SHA1(f5f58ee6f5efe56e72623e57ce27884551e09bd9) )
+ ROM_LOAD( "15.H11", 0x000000, 0x20000, CRC(90ae9f74) SHA1(806f96fd08fca1beeeaefe3c0fac1991410aa9c4) ) /* sprites */
+ ROM_LOAD( "16.H13", 0x020000, 0x20000, CRC(e96ac815) SHA1(a2b22a29ad0a4f144bb09299c454dc7a842a5318) )
+ ROM_LOAD( "17.H14", 0x040000, 0x20000, CRC(abad9a1b) SHA1(3cec6b4ef925205efe4a8fb28e08eb58e3ba4019) )
+ ROM_LOAD( "18.H16", 0x060000, 0x20000, CRC(96d8d64b) SHA1(54ce87fe2b14b574176d2a1d2b86057b9cd10883) )
+ ROM_LOAD( "19.J13", 0x080000, 0x20000, CRC(cbd8c9b8) SHA1(5e86c0298b3eea06920121eecb70e5bee705addf) )
+ ROM_LOAD( "20.J14", 0x0a0000, 0x20000, CRC(47f706a8) SHA1(bd4fe499710f8905eb4b8d1ca990f2908feb95e1) )
+ ROM_LOAD( "21.J16", 0x0c0000, 0x20000, CRC(9c72d364) SHA1(9290e463273fa1f921279f1bab808d91d3aa9648) )
+ ROM_LOAD( "22.J18", 0x0e0000, 0x20000, CRC(1e78aa60) SHA1(f5f58ee6f5efe56e72623e57ce27884551e09bd9) )
ROM_REGION( 0x40000, "oki1", 0 ) /* ADPCM samples */
- ROM_LOAD( "12", 0x00000, 0x20000, CRC(c202d200) SHA1(8470654923a0e8780dad678f5745f8e3e3be08b2) )
+ ROM_LOAD( "12.H1", 0x00000, 0x20000, CRC(c202d200) SHA1(8470654923a0e8780dad678f5745f8e3e3be08b2) )
ROM_REGION( 0x40000, "oki2", 0 ) /* ADPCM samples */
- ROM_LOAD( "13", 0x00000, 0x20000, CRC(cc4d65e9) SHA1(b9bcaa52c570f94d2f2e5dd84c94773cc4115442) )
+ ROM_LOAD( "13.H3", 0x00000, 0x20000, CRC(cc4d65e9) SHA1(b9bcaa52c570f94d2f2e5dd84c94773cc4115442) )
ROM_END
/******************************************************************************/
diff --git a/src/mame/drivers/mario.c b/src/mame/drivers/mario.c
index fbc160618ad..f213e7c98ea 100644
--- a/src/mame/drivers/mario.c
+++ b/src/mame/drivers/mario.c
@@ -140,6 +140,7 @@ static ADDRESS_MAP_START( mario_map, AS_PROGRAM, 8, mario_state)
AM_RANGE(0x7c00, 0x7c00) AM_READ_PORT("IN0") AM_WRITE(mario_sh1_w) /* Mario run sample */
AM_RANGE(0x7c80, 0x7c80) AM_READ_PORT("IN1") AM_WRITE(mario_sh2_w) /* Luigi run sample */
AM_RANGE(0x7d00, 0x7d00) AM_WRITE(mario_scroll_w)
+ AM_RANGE(0x7e00, 0x7e00) AM_WRITE(mario_sh_tuneselect_w)
AM_RANGE(0x7e80, 0x7e80) AM_WRITE(mario_gfxbank_w)
AM_RANGE(0x7e82, 0x7e82) AM_WRITE(mario_flip_w)
AM_RANGE(0x7e83, 0x7e83) AM_WRITE(mario_palettebank_w)
@@ -147,7 +148,6 @@ static ADDRESS_MAP_START( mario_map, AS_PROGRAM, 8, mario_state)
AM_RANGE(0x7e85, 0x7e85) AM_WRITE(mario_z80dma_rdy_w) /* ==> DMA Chip */
AM_RANGE(0x7f00, 0x7f07) AM_WRITE(mario_sh3_w) /* Sound port */
AM_RANGE(0x7f80, 0x7f80) AM_READ_PORT("DSW") /* DSW */
- AM_RANGE(0x7e00, 0x7e00) AM_WRITE(mario_sh_tuneselect_w)
AM_RANGE(0xf000, 0xffff) AM_ROM
ADDRESS_MAP_END
diff --git a/src/mame/drivers/maygayv1.c b/src/mame/drivers/maygayv1.c
index 9cc4980f307..05ab9377c14 100644
--- a/src/mame/drivers/maygayv1.c
+++ b/src/mame/drivers/maygayv1.c
@@ -804,14 +804,14 @@ WRITE_LINE_MEMBER(maygayv1_state::duart_irq_handler)
{
m_maincpu->set_input_line_and_vector(5, state, m_duart68681->get_irq_vector());
// m_maincpu->set_input_line(5, state ? ASSERT_LINE : CLEAR_LINE);
-};
+}
WRITE_LINE_MEMBER(maygayv1_state::duart_txa)
{
m_d68681_val = state;
m_soundcpu->set_input_line(MCS51_RX_LINE, ASSERT_LINE); // ?
-};
+}
READ8_MEMBER(maygayv1_state::data_to_i8031)
{
diff --git a/src/mame/drivers/mazerbla.c b/src/mame/drivers/mazerbla.c
index a64786d9aa9..722865dbcc8 100644
--- a/src/mame/drivers/mazerbla.c
+++ b/src/mame/drivers/mazerbla.c
@@ -21,7 +21,7 @@ ZPU-2000 - main cpu board (Zentral (sic) Processor Unit)
- 32 dipswitches in 4 banks of 8
- four 'test button' style switches
- one 4Mhz xtal @A1
- - this same board is shared with cliff hanger (clifhgr.c)
+ - this same board is shared with cliff hanger (cliffhgr.c)
CFB-1000 - video/subcpu board (Color Frame Board)
- this board has a sub-cpu on it and four roms (six sockets for roms, two empty)
@@ -48,7 +48,7 @@ VSB-2000 - sound/speech/subcpu board (Voice and Sound Board)
- PROMS: 82s123: @B8 @B9; 82s129: @G8 @G9 (all dumped)
CRF-1001 - RF Filter board for video/audio output
- - this same board is shared with cliff hanger (clifhgr.c)
+ - this same board is shared with cliff hanger (cliffhgr.c)
Versions:
======
@@ -61,7 +61,7 @@ roms for all roms except the zpu-2000 board.
Issues:
======
-Sprites leave trails in both ganes
+Sprites leave trails in both games
Sprites should be transparent (color 0x0f)
Screen flickers heavily in Great Guns (double buffer issue?).
@@ -233,7 +233,6 @@ public:
TIMER_CALLBACK_MEMBER(deferred_ls670_1_w);
TIMER_CALLBACK_MEMBER(delayed_sound_w);
IRQ_CALLBACK_MEMBER(irq_callback);
- void rom_bank_select();
};
@@ -351,15 +350,10 @@ WRITE8_MEMBER(mazerbla_state::cfb_vbank_w)
WRITE8_MEMBER(mazerbla_state::cfb_rom_bank_sel_w)
{
m_gfx_rom_bank = data;
- rom_bank_select();
+
+ membank("bank1")->set_entry(m_gfx_rom_bank);
}
-void mazerbla_state::rom_bank_select()
-{
- membank("bank1")->set_base(memregion("sub2")->base() + (m_gfx_rom_bank * 0x2000) + 0x10000);
-}
-
-
#if 0
WRITE8_MEMBER(mazerbla_state::vcu_video_reg_w)
{
@@ -1386,6 +1380,8 @@ INTERRUPT_GEN_MEMBER(mazerbla_state::sound_interrupt)
void mazerbla_state::machine_start()
{
+ membank("bank1")->configure_entries(0, 256, memregion("sub2")->base() + 0x10000, 0x2000);
+
save_item(NAME(m_vcu_video_reg));
save_item(NAME(m_vcu_gfx_addr));
save_item(NAME(m_vcu_gfx_param_addr));
@@ -1413,8 +1409,6 @@ void mazerbla_state::machine_start()
save_item(NAME(m_vsb_ls273));
save_item(NAME(m_soundlatch));
-
- machine().save().register_postload(save_prepost_delegate(FUNC(mazerbla_state::rom_bank_select), this));
}
void mazerbla_state::machine_reset()
diff --git a/src/mame/drivers/meadwttl.c b/src/mame/drivers/meadwttl.c
index 4313a7740c8..070ba3006b6 100644
--- a/src/mame/drivers/meadwttl.c
+++ b/src/mame/drivers/meadwttl.c
@@ -9,7 +9,9 @@
Cobra Gunship (1976)
Drop Zone 4 (1975)
Flim Flam (1974)
- 4 in 1 Meadows (197?)
+ Gridiron (1977)
+ Meadows 4 in 1 (197?)
+ Star Shooter (1975)
***************************************************************************/
diff --git a/src/mame/drivers/megasys1.c b/src/mame/drivers/megasys1.c
index 3463556bd2d..5f386fb63c2 100644
--- a/src/mame/drivers/megasys1.c
+++ b/src/mame/drivers/megasys1.c
@@ -29,6 +29,7 @@ Year + Game System Protection
Saint Dragon A Yes + Encryption (key 1)
90 RodLand (World) / A Encryption (key 3)
RodLand (Japan) A Encryption (key 2)
+ R&T (Prototype?) A Encryption (key 2)
Phantasm (Japan) / A Encryption (key 1)
91 Avenging Spirit (World) B Inputs
Earth Defense Force B Inputs
@@ -116,6 +117,12 @@ RAM RW 0f0000-0f3fff 0e0000-0effff? <
- Understand a handful of unknown bits in video regs
+- R&T really does have scrambled sound effects on the PCB, those two ROMs being
+ ones which even still had their original labels. Possibly a prototype, only
+ one known to exist. ROM17 is missing on the board, not sure if this is
+ intentional, is the data for the 'secondary' set of levels stored in 17/18?
+ This game has no alternate levels mode either. Socketed encryption chip is
+ unusual.
***************************************************************************/
@@ -3275,78 +3282,116 @@ f0012->84204 f0014->8420c f0016->8400c
ROM_START( rodland )
ROM_REGION( 0x60000, "maincpu", 0 ) /* Main CPU Code */
- ROM_LOAD16_BYTE( "rl_02.rom", 0x000000, 0x020000, CRC(c7e00593) SHA1(055b7bcabf90ed6d5edc2797d0f85a5d49b8693b) )
- ROM_LOAD16_BYTE( "rl_01.rom", 0x000001, 0x020000, CRC(2e748ca1) SHA1(285414af11aad36f3bd7020365ff90eb696d2de3) )
- ROM_LOAD16_BYTE( "rl_03.rom", 0x040000, 0x010000, CRC(62fdf6d7) SHA1(ffde7e7f5b3b548bc980b9dee767f693046ecab2) )
- ROM_LOAD16_BYTE( "rl_04.rom", 0x040001, 0x010000, CRC(44163c86) SHA1(1c56d79531af0312e7cd3dc66cf61b55dd1a6e51) )
+ ROM_LOAD16_BYTE( "JALECO_ROD_LAND_2.ROM2", 0x000000, 0x020000, CRC(c7e00593) SHA1(055b7bcabf90ed6d5edc2797d0f85a5d49b8693b) )
+ ROM_LOAD16_BYTE( "JALECO_ROD_LAND_1.ROM1", 0x000001, 0x020000, CRC(2e748ca1) SHA1(285414af11aad36f3bd7020365ff90eb696d2de3) )
+ ROM_LOAD16_BYTE( "JALECO_ROD_LAND_3.ROM3", 0x040000, 0x010000, CRC(62fdf6d7) SHA1(ffde7e7f5b3b548bc980b9dee767f693046ecab2) )
+ ROM_LOAD16_BYTE( "JALECO_ROD_LAND_4.ROM4", 0x040001, 0x010000, CRC(44163c86) SHA1(1c56d79531af0312e7cd3dc66cf61b55dd1a6e51) )
ROM_REGION( 0x20000, "audiocpu", 0 ) /* Sound CPU Code */
- ROM_LOAD16_BYTE( "rl_05.rom", 0x000000, 0x010000, CRC(c1617c28) SHA1(1b3440055c083b74270fe06b5f42e7d1337efeca) )
- ROM_LOAD16_BYTE( "rl_06.rom", 0x000001, 0x010000, CRC(663392b2) SHA1(99052639e934d1ca18888c9c7fa061c1d3508fd4) )
+ ROM_LOAD16_BYTE( "JALECO_ROD_LAND_5.ROM5", 0x000000, 0x010000, CRC(c1617c28) SHA1(1b3440055c083b74270fe06b5f42e7d1337efeca) )
+ ROM_LOAD16_BYTE( "JALECO_ROD_LAND_6.ROM6", 0x000001, 0x010000, CRC(663392b2) SHA1(99052639e934d1ca18888c9c7fa061c1d3508fd4) )
ROM_REGION( 0x080000, "gfx1", 0 ) /* Scroll 0 */
- ROM_LOAD( "rl_23.rom", 0x000000, 0x020000, CRC(ac60e771) SHA1(97c2ac1ed89c171a0db98befa6c3c10754d64880) )
- ROM_CONTINUE( 0x030000, 0x010000 )
- ROM_CONTINUE( 0x050000, 0x010000 )
- ROM_CONTINUE( 0x020000, 0x010000 )
- ROM_CONTINUE( 0x040000, 0x010000 )
- ROM_CONTINUE( 0x060000, 0x020000 )
+ ROM_LOAD( "LH534H31.ROM14", 0x000000, 0x080000, CRC(8201e1bb) SHA1(3304100dcab7b67cee021869a50f4295c8635814) )
ROM_REGION( 0x080000, "gfx2", 0 ) /* Scroll 1 */
- ROM_LOAD( "rl_18.rom", 0x000000, 0x080000, CRC(f3b30ca6) SHA1(f2f88c24a009b6695f7548aebd37b25d1fd19892) )
+ ROM_LOAD( "LH534H32.ROM18", 0x000000, 0x080000, CRC(f3b30ca6) SHA1(f2f88c24a009b6695f7548aebd37b25d1fd19892) )
ROM_REGION( 0x020000, "gfx3", 0 ) /* Scroll 2 */
- ROM_LOAD( "rl_19.bin", 0x000000, 0x020000, CRC(124d7e8f) SHA1(d7885a10085cc3389bd0e26e9d54adb8929218c0) )
+ ROM_LOAD( "LH2311J0.ROM19", 0x000000, 0x020000, CRC(124d7e8f) SHA1(d7885a10085cc3389bd0e26e9d54adb8929218c0) )
ROM_REGION( 0x080000, "gfx4", 0 ) /* Sprites */
- ROM_LOAD( "rl_14.rom", 0x000000, 0x080000, CRC(08d01bf4) SHA1(b9333d11572f46992cdd668908fbc1c33d841f8d) )
+ ROM_LOAD( "LH534H33.ROM23", 0x000000, 0x080000, CRC(936db174) SHA1(4dfb2c31bc4bbf659184fe18e320d19f326b3ec5) )
ROM_REGION( 0x040000, "oki1", 0 ) /* Samples */
- ROM_LOAD( "rl_10.rom", 0x000000, 0x040000, CRC(e1d1cd99) SHA1(6604111d37455c1bd59c1469d9ee7841e7dec913) )
+ ROM_LOAD( "LH5321T5.ROM10", 0x000000, 0x040000, CRC(e1d1cd99) SHA1(6604111d37455c1bd59c1469d9ee7841e7dec913) )
ROM_REGION( 0x040000, "oki2", 0 ) /* Samples */
- ROM_LOAD( "rl_08.rom", 0x000000, 0x040000, CRC(8a49d3a7) SHA1(68cb8cf2753b39c253d0edaa8ef2c54fd1f6ebe5) )
+ ROM_LOAD( "S202000DR.ROM8", 0x000000, 0x040000, CRC(8a49d3a7) SHA1(68cb8cf2753b39c253d0edaa8ef2c54fd1f6ebe5) )
ROM_REGION( 0x0200, "proms", 0 ) /* Priority PROM */
- ROM_LOAD( "rl.bin", 0x0000, 0x0200, CRC(8914e72d) SHA1(80a664471f14c8ed8544a5e226fdca425ab3c657) )
+ ROM_LOAD( "PS89013A.M14", 0x0000, 0x0200, CRC(8914e72d) SHA1(80a664471f14c8ed8544a5e226fdca425ab3c657) )
ROM_END
ROM_START( rodlandj )
ROM_REGION( 0x60000, "maincpu", 0 ) /* Main CPU Code */
- ROM_LOAD16_BYTE( "rl_2.bin", 0x000000, 0x020000, CRC(b1d2047e) SHA1(75d282b7614c5f4b76ab44e34fea9e87ab8b992c) )
- ROM_LOAD16_BYTE( "rl_1.bin", 0x000001, 0x020000, CRC(3c47c2a3) SHA1(62e66a2f53aeacf92551ba64ae4ce14c2e982bb0) )
- ROM_LOAD16_BYTE( "rl_3.bin", 0x040000, 0x010000, CRC(c5b1075f) SHA1(a8bcc0e9dbb4b731bc0b7e5a8e0efc3d142505b9) )
- ROM_LOAD16_BYTE( "rl_4.bin", 0x040001, 0x010000, CRC(9ec61048) SHA1(71b6af054a528af04e23affff635a9358537cd3b) )
+ ROM_LOAD16_BYTE( "JALECO_ROD_LAND_2.ROM2", 0x000000, 0x020000, CRC(b1d2047e) SHA1(75d282b7614c5f4b76ab44e34fea9e87ab8b992c) )
+ ROM_LOAD16_BYTE( "JALECO_ROD_LAND_1.ROM1", 0x000001, 0x020000, CRC(3c47c2a3) SHA1(62e66a2f53aeacf92551ba64ae4ce14c2e982bb0) )
+ ROM_LOAD16_BYTE( "JALECO_ROD_LAND_3.ROM3", 0x040000, 0x010000, CRC(c5b1075f) SHA1(a8bcc0e9dbb4b731bc0b7e5a8e0efc3d142505b9) )
+ ROM_LOAD16_BYTE( "JALECO_ROD_LAND_4.ROM4", 0x040001, 0x010000, CRC(9ec61048) SHA1(71b6af054a528af04e23affff635a9358537cd3b) )
+
+ ROM_REGION( 0x20000, "audiocpu", 0 ) /* Sound CPU Code */
+ ROM_LOAD16_BYTE( "JALECO_ROD_LAND_5.ROM5", 0x000000, 0x010000, CRC(c1617c28) SHA1(1b3440055c083b74270fe06b5f42e7d1337efeca) )
+ ROM_LOAD16_BYTE( "JALECO_ROD_LAND_6.ROM6", 0x000001, 0x010000, CRC(663392b2) SHA1(99052639e934d1ca18888c9c7fa061c1d3508fd4) )
+
+ ROM_REGION( 0x080000, "gfx1", 0 ) /* Scroll 0 */
+ ROM_LOAD( "LH534H31.ROM14", 0x000000, 0x080000, CRC(8201e1bb) SHA1(3304100dcab7b67cee021869a50f4295c8635814) )
+
+ ROM_REGION( 0x080000, "gfx2", 0 ) /* Scroll 1 */
+ ROM_LOAD( "LH534H32.ROM18", 0x000000, 0x080000, CRC(f3b30ca6) SHA1(f2f88c24a009b6695f7548aebd37b25d1fd19892) )
+
+ ROM_REGION( 0x020000, "gfx3", 0 ) /* Scroll 2 */
+ ROM_LOAD( "LH2311J0.ROM19", 0x000000, 0x020000, CRC(124d7e8f) SHA1(d7885a10085cc3389bd0e26e9d54adb8929218c0) )
+
+ ROM_REGION( 0x080000, "gfx4", 0 ) /* Sprites */
+ ROM_LOAD( "LH534H33.ROM23", 0x000000, 0x080000, CRC(936db174) SHA1(4dfb2c31bc4bbf659184fe18e320d19f326b3ec5) )
+
+ ROM_REGION( 0x040000, "oki1", 0 ) /* Samples */
+ ROM_LOAD( "LH5321T5.ROM10", 0x000000, 0x040000, CRC(e1d1cd99) SHA1(6604111d37455c1bd59c1469d9ee7841e7dec913) )
+
+ ROM_REGION( 0x040000, "oki2", 0 ) /* Samples */
+ ROM_LOAD( "S202000DR.ROM8", 0x000000, 0x040000, CRC(8a49d3a7) SHA1(68cb8cf2753b39c253d0edaa8ef2c54fd1f6ebe5) )
+
+ ROM_REGION( 0x0200, "proms", 0 ) /* Priority PROM */
+ ROM_LOAD( "PS89013A.M14", 0x0000, 0x0200, CRC(8914e72d) SHA1(80a664471f14c8ed8544a5e226fdca425ab3c657) )
+ROM_END
+
+/* probably a prototype, original JP key and unscrambled ROMs, incorrect
+ audio matches PCB */
+ROM_START( rittam )
+ ROM_REGION( 0x60000, "maincpu", 0 ) /* Main CPU Code */
+ ROM_LOAD16_BYTE( "2.ROM2", 0x000000, 0x020000, CRC(93085af2) SHA1(e49dc1e62c1cec75f192ac4608f69c4361ad739a) )
+ ROM_LOAD16_BYTE( "R+T_1.ROM1", 0x000001, 0x020000, CRC(20446c34) SHA1(10753b8c3826468f42c5b1da8cfa60658db60401) )
ROM_REGION( 0x20000, "audiocpu", 0 ) /* Sound CPU Code */
- ROM_LOAD16_BYTE( "rl_05.rom", 0x000000, 0x010000, CRC(c1617c28) SHA1(1b3440055c083b74270fe06b5f42e7d1337efeca) )
- ROM_LOAD16_BYTE( "rl_06.rom", 0x000001, 0x010000, CRC(663392b2) SHA1(99052639e934d1ca18888c9c7fa061c1d3508fd4) )
+ ROM_LOAD16_BYTE( "JALECO_5.ROM5", 0x000000, 0x010000, CRC(ea6600ec) SHA1(392e782a266c5997331df75b15211bced8efb47c) )
+ ROM_LOAD16_BYTE( "JALECO_6.ROM6", 0x000001, 0x010000, CRC(51c3c0bc) SHA1(97d6b49d1816cd02ea50ae5f7909a84e9ca8b06f) )
ROM_REGION( 0x080000, "gfx1", 0 ) /* Scroll 0 */
- /* address and data lines are mangled, but otherwise identical to rl_23.rom */
- ROM_LOAD( "rl_14.bin", 0x000000, 0x080000, CRC(8201e1bb) SHA1(3304100dcab7b67cee021869a50f4295c8635814) )
+ ROM_LOAD( "11.ROM11", 0x000000, 0x020000, CRC(ad2bf897) SHA1(3c449bef7f82aa1d111932361c83ae6661f3bee7) )
+ ROM_LOAD( "12.ROM12", 0x020000, 0x020000, CRC(d0224ed6) SHA1(aa1701b248e9be120a001032052c693bf29c386a) )
+ ROM_LOAD( "13.ROM13", 0x040000, 0x020000, CRC(b1d5d423) SHA1(df0e34797826f4458a26992a84bdd1e790a942d9) )
+ ROM_LOAD( "14.ROM14", 0x060000, 0x020000, CRC(20f8c361) SHA1(9e644041de89b279ed4e2420ac938849c42242f6) )
ROM_REGION( 0x080000, "gfx2", 0 ) /* Scroll 1 */
- ROM_LOAD( "rl_18.rom", 0x000000, 0x080000, CRC(f3b30ca6) SHA1(f2f88c24a009b6695f7548aebd37b25d1fd19892) )
+ ROM_LOAD( "15.ROM15", 0x000000, 0x020000, CRC(90bc97ac) SHA1(bdd3ce2214e99ce6c66982cf21ce0641fbcfeb6d) )
+ ROM_LOAD( "16.ROM16", 0x020000, 0x020000, CRC(e38750aa) SHA1(b231835c204d33c05a854d8450cfd334102a45be) )
+ // ROM17 not populated - not sure why, missing?
+ ROM_LOAD( "18.ROM18", 0x060000, 0x020000, CRC(57ccf24f) SHA1(8d480093359ebea8e053810ad834b5b1f893bb77) )
ROM_REGION( 0x020000, "gfx3", 0 ) /* Scroll 2 */
- ROM_LOAD( "rl_19.bin", 0x000000, 0x020000, CRC(124d7e8f) SHA1(d7885a10085cc3389bd0e26e9d54adb8929218c0) )
+ ROM_LOAD( "19.ROM19", 0x000000, 0x020000, CRC(6daa1081) SHA1(400cfa302b7d7238b966462c4d9272e8b8dad6f1) )
ROM_REGION( 0x080000, "gfx4", 0 ) /* Sprites */
- /* was a bad dump (first and second half identical), reconstructed from rl_14.rom */
- ROM_LOAD( "rl_23.bin", 0x000000, 0x080000, CRC(936db174) SHA1(4dfb2c31bc4bbf659184fe18e320d19f326b3ec5) )
+ ROM_LOAD( "R+T_20.ROM20", 0x000000, 0x020000, CRC(23bc2b0b) SHA1(2aa85b0aa56de367ba8f9c79494b242d1d0db11c) )
+ ROM_LOAD( "21.ROM21", 0x020000, 0x020000, CRC(9d2b0ec4) SHA1(b589697948ba400da061bfa7ac199b35245f6426) )
+ ROM_LOAD( "22.ROM22", 0x040000, 0x020000, CRC(bba2e2cf) SHA1(d718ecf65ad974a981e7f851781c2a83943a4e6e) )
+ ROM_LOAD( "23.ROM23", 0x060000, 0x020000, CRC(05536a18) SHA1(6cc1417d91985bf92dbd0db822dde005a7dc001d) )
ROM_REGION( 0x040000, "oki1", 0 ) /* Samples */
- ROM_LOAD( "rl_10.rom", 0x000000, 0x040000, CRC(e1d1cd99) SHA1(6604111d37455c1bd59c1469d9ee7841e7dec913) )
+ ROM_LOAD( "JALECO_9.ROM9", 0x000000, 0x020000, CRC(065364bd) SHA1(bacb268b1c76c286e89eb823d8c3477ec5f2516c) )
+ ROM_LOAD( "JALECO_10.ROM10", 0x020000, 0x020000, CRC(395df3b2) SHA1(6f69b573e997ba4bb5aabf745843921f0866d209) )
ROM_REGION( 0x040000, "oki2", 0 ) /* Samples */
- ROM_LOAD( "rl_08.rom", 0x000000, 0x040000, CRC(8a49d3a7) SHA1(68cb8cf2753b39c253d0edaa8ef2c54fd1f6ebe5) )
+ ROM_LOAD( "JALECO_7.ROM7", 0x000000, 0x020000, CRC(76fd879f) SHA1(a2169e2efa0c8e804f7d2fac32c655f1379d95e1) )
+ ROM_LOAD( "JALECO_8.ROM8", 0x020000, 0x020000, CRC(a771ab00) SHA1(be547b296ee3fcc0ab7339f2c99d1039ceb3b5bb) )
ROM_REGION( 0x0200, "proms", 0 ) /* Priority PROM */
- ROM_LOAD( "rl.bin", 0x0000, 0x0200, CRC(8914e72d) SHA1(80a664471f14c8ed8544a5e226fdca425ab3c657) )
+ ROM_LOAD( "PS89013A.M14", 0x0000, 0x0200, CRC(8914e72d) SHA1(80a664471f14c8ed8544a5e226fdca425ab3c657) )
ROM_END
+
/* 100% identical to rodlandj, but not encrypted */
ROM_START( rodlandjb )
ROM_REGION( 0x60000, "maincpu", 0 ) /* Main CPU Code */
@@ -3362,30 +3407,25 @@ ROM_START( rodlandjb )
ROM_LOAD16_BYTE( "rl01.bin", 0x000001, 0x010000, CRC(04cf24bc) SHA1(e754cce3c83a7088daf90e753fbb0df9ef7fc9be) )
ROM_REGION( 0x080000, "gfx1", 0 ) /* Scroll 0 */
- ROM_LOAD( "rl_23.rom", 0x000000, 0x020000, CRC(ac60e771) SHA1(97c2ac1ed89c171a0db98befa6c3c10754d64880) )
- ROM_CONTINUE( 0x030000, 0x010000 )
- ROM_CONTINUE( 0x050000, 0x010000 )
- ROM_CONTINUE( 0x020000, 0x010000 )
- ROM_CONTINUE( 0x040000, 0x010000 )
- ROM_CONTINUE( 0x060000, 0x020000 )
+ ROM_LOAD( "LH534H31.ROM14", 0x000000, 0x080000, CRC(8201e1bb) SHA1(3304100dcab7b67cee021869a50f4295c8635814) )
ROM_REGION( 0x080000, "gfx2", 0 ) /* Scroll 1 */
- ROM_LOAD( "rl_18.rom", 0x000000, 0x080000, CRC(f3b30ca6) SHA1(f2f88c24a009b6695f7548aebd37b25d1fd19892) )
+ ROM_LOAD( "LH534H32.ROM18", 0x000000, 0x080000, CRC(f3b30ca6) SHA1(f2f88c24a009b6695f7548aebd37b25d1fd19892) )
ROM_REGION( 0x020000, "gfx3", 0 ) /* Scroll 2 */
- ROM_LOAD( "rl_19.bin", 0x000000, 0x020000, CRC(124d7e8f) SHA1(d7885a10085cc3389bd0e26e9d54adb8929218c0) )
+ ROM_LOAD( "LH2311J0.ROM19", 0x000000, 0x020000, CRC(124d7e8f) SHA1(d7885a10085cc3389bd0e26e9d54adb8929218c0) )
ROM_REGION( 0x080000, "gfx4", 0 ) /* Sprites */
- ROM_LOAD( "rl_14.rom", 0x000000, 0x080000, CRC(08d01bf4) SHA1(b9333d11572f46992cdd668908fbc1c33d841f8d) )
+ ROM_LOAD( "LH534H33.ROM23", 0x000000, 0x080000, CRC(936db174) SHA1(4dfb2c31bc4bbf659184fe18e320d19f326b3ec5) )
ROM_REGION( 0x040000, "oki1", 0 ) /* Samples */
- ROM_LOAD( "rl_10.rom", 0x000000, 0x040000, CRC(e1d1cd99) SHA1(6604111d37455c1bd59c1469d9ee7841e7dec913) )
+ ROM_LOAD( "LH5321T5.ROM10", 0x000000, 0x040000, CRC(e1d1cd99) SHA1(6604111d37455c1bd59c1469d9ee7841e7dec913) )
ROM_REGION( 0x040000, "oki2", 0 ) /* Samples */
- ROM_LOAD( "rl_08.rom", 0x000000, 0x040000, CRC(8a49d3a7) SHA1(68cb8cf2753b39c253d0edaa8ef2c54fd1f6ebe5) )
+ ROM_LOAD( "S202000DR.ROM8", 0x000000, 0x040000, CRC(8a49d3a7) SHA1(68cb8cf2753b39c253d0edaa8ef2c54fd1f6ebe5) )
ROM_REGION( 0x0200, "proms", 0 ) /* Priority PROM */
- ROM_LOAD( "rl.bin", 0x0000, 0x0200, CRC(8914e72d) SHA1(80a664471f14c8ed8544a5e226fdca425ab3c657) )
+ ROM_LOAD( "PS89013A.M14", 0x0000, 0x0200, CRC(8914e72d) SHA1(80a664471f14c8ed8544a5e226fdca425ab3c657) )
ROM_END
@@ -3679,7 +3719,7 @@ ROM_START( tshingen )
ROM_END
-void megasys1_state::rodlandj_gfx_unmangle(const char *region)
+void megasys1_state::rodland_gfx_unmangle(const char *region)
{
UINT8 *rom = memregion(region)->base();
int size = memregion(region)->bytes();
@@ -4003,17 +4043,31 @@ DRIVER_INIT_MEMBER(megasys1_state,phantasm)
DRIVER_INIT_MEMBER(megasys1_state,rodland)
{
+ rodland_gfx_unmangle("gfx1");
+ rodland_gfx_unmangle("gfx4");
+
rodland_rom_decode(machine(), "maincpu");
}
DRIVER_INIT_MEMBER(megasys1_state,rodlandj)
{
- rodlandj_gfx_unmangle("gfx1");
- rodlandj_gfx_unmangle("gfx4");
+ rodland_gfx_unmangle("gfx1");
+ rodland_gfx_unmangle("gfx4");
astyanax_rom_decode(machine(), "maincpu");
}
+DRIVER_INIT_MEMBER(megasys1_state,rodlandjb)
+{
+ rodland_gfx_unmangle("gfx1");
+ rodland_gfx_unmangle("gfx4");
+}
+
+DRIVER_INIT_MEMBER(megasys1_state,rittam)
+{
+ astyanax_rom_decode(machine(), "maincpu");
+}
+
READ16_MEMBER(megasys1_state::soldamj_spriteram16_r)
{
return m_spriteram[offset];
@@ -4150,7 +4204,8 @@ GAME( 1989, stdragon, 0, system_A, stdragon, megasys1_state, std
GAME( 1989, stdragona,stdragon, system_A, stdragon, megasys1_state, stdragona,ROT0, "Jaleco", "Saint Dragon (set 2)", 0 )
GAME( 1990, rodland, 0, system_A, rodland, megasys1_state, rodland, ROT0, "Jaleco", "Rod-Land (World)", 0 )
GAME( 1990, rodlandj, rodland, system_A, rodland, megasys1_state, rodlandj, ROT0, "Jaleco", "Rod-Land (Japan)", 0 )
-GAME( 1990, rodlandjb,rodland, system_A, rodland, driver_device, 0, ROT0, "bootleg","Rod-Land (Japan bootleg)", 0 )
+GAME( 1990, rittam, rodland, system_A, rodland, megasys1_state, rittam, ROT0, "Jaleco", "R&T (Rod-Land prototype?)", 0 )
+GAME( 1990, rodlandjb,rodland, system_A, rodland, megasys1_state, rodlandjb, ROT0, "bootleg","Rod-Land (Japan bootleg)", 0 )
GAME( 1991, avspirit, 0, system_B, avspirit, megasys1_state, avspirit, ROT0, "Jaleco", "Avenging Spirit", 0 )
GAME( 1990, phantasm, avspirit, system_A, phantasm, megasys1_state, phantasm, ROT0, "Jaleco", "Phantasm (Japan)", 0 )
GAME( 1990, monkelf, avspirit, system_B, avspirit, megasys1_state, monkelf, ROT0, "bootleg","Monky Elf (Korean bootleg of Avenging Spirit)", 0 )
diff --git a/src/mame/drivers/megatech.c b/src/mame/drivers/megatech.c
index 02a61342eca..44fed89d187 100644
--- a/src/mame/drivers/megatech.c
+++ b/src/mame/drivers/megatech.c
@@ -791,7 +791,11 @@ MACHINE_CONFIG_END
ROM_SYSTEM_BIOS( 1, "ver0a", "Ver 0 Rev A" ) \
ROMX_LOAD( "epr-12263a.20", 0x000000, 0x8000, CRC(07c3f423) SHA1(50c28bbc2d4349c820d988ae3f20aae3f808545f), ROM_BIOS(2)) \
ROM_SYSTEM_BIOS( 2, "ver0b", "Ver 0 Rev B" ) \
- ROMX_LOAD( "epr-12263b.20", 0x000000, 0x8000, CRC(ca26c87a) SHA1(987a18bede6e54cd73c4434426eb6c302a37cdc5), ROM_BIOS(3))
+ ROMX_LOAD( "epr-12263b.20", 0x000000, 0x8000, CRC(ca26c87a) SHA1(987a18bede6e54cd73c4434426eb6c302a37cdc5), ROM_BIOS(3)) \
+ ROM_SYSTEM_BIOS( 3, "ver0aa","Ver 0 Rev B (alt?)" ) \
+ ROMX_LOAD( "epr-12604a.20", 0x000000, 0x8000, CRC(884e4aa5) SHA1(c9008c431a937c084fb475273093ca0b434b5f47), ROM_BIOS(4))
+
+
/* no games */
ROM_START( megatech )
MEGATECH_BIOS
@@ -1447,7 +1451,7 @@ ROM_END
/* 52 */ GAME( 1991, mt_sonic, megatech, megatech, megatech, mtech_state, mt_crt, ROT0, "Sega", "Sonic The Hedgehog (Mega-Tech, set 1)", GAME_NOT_WORKING )
/* */ GAME( 1991, mt_sonia, mt_sonic, megatech, megatech, mtech_state, mt_crt, ROT0, "Sega", "Sonic The Hedgehog (Mega-Tech, set 2)", GAME_NOT_WORKING )
/* 53 */ GAME( 1990, mt_fshrk, megatech, megatech, megatech, mtech_state, mt_crt, ROT0, "Toaplan / Sega", "Fire Shark (Mega-Tech)", GAME_NOT_WORKING )
-/* 54 */ GAME( 1991, mt_spman, megatech, megatech, megatech, mtech_state, mt_crt, ROT0, "Marvel / Sega", "Spider-Man vs The Kingpin (Mega-Tech)", GAME_NOT_WORKING )
+/* 54 */ GAME( 1991, mt_spman, megatech, megatech, megatech, mtech_state, mt_crt, ROT0, "Sega / Marvel", "Spider-Man vs The Kingpin (Mega-Tech)", GAME_NOT_WORKING )
/* 55 */ GAME( 1991, mt_calga, megatech, megatech, megatech, mtech_state, mt_crt, ROT0, "Sega", "California Games (Mega-Tech)", GAME_NOT_WORKING )
/* 56 */ // unknown
/* 57 */ GAME( 1991, mt_gaxe2, megatech, megatech, megatech, mtech_state, mt_crt, ROT0, "Sega", "Golden Axe II (Mega-Tech)", GAME_NOT_WORKING )
diff --git a/src/mame/drivers/megazone.c b/src/mame/drivers/megazone.c
index 5a82b24de3a..e5bc1f41ff9 100644
--- a/src/mame/drivers/megazone.c
+++ b/src/mame/drivers/megazone.c
@@ -234,7 +234,7 @@ INTERRUPT_GEN_MEMBER(megazone_state::vblank_irq)
static MACHINE_CONFIG_START( megazone, megazone_state )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", M6809, 18432000/9) /* 2 MHz */
+ MCFG_CPU_ADD("maincpu", KONAMI1, 18432000/9) /* 2 MHz */
MCFG_CPU_PROGRAM_MAP(megazone_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", megazone_state, vblank_irq)
@@ -506,7 +506,6 @@ ROM_END
DRIVER_INIT_MEMBER(megazone_state,megazone)
{
- konami1_decode(machine(), "maincpu");
}
GAME( 1983, megazone, 0, megazone, megazone, megazone_state, megazone, ROT90, "Konami", "Mega Zone (Konami set 1)", GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/meritm.c b/src/mame/drivers/meritm.c
index 0556f147df7..c36f3be3b97 100644
--- a/src/mame/drivers/meritm.c
+++ b/src/mame/drivers/meritm.c
@@ -301,10 +301,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(meritm_state::meritm_interrupt)
if((scanline % 2) == 0)
{
- m_v9938_0->set_resolution(RENDER_HIGH);
m_v9938_0->interrupt();
-
- m_v9938_1->set_resolution(RENDER_HIGH);
m_v9938_1->interrupt();
}
}
@@ -372,12 +369,12 @@ void meritm_state::meritm_crt250_switch_banks( )
//logerror( "CRT250: Switching banks: rom = %0x (bank = %x)\n", rombank, m_bank );
membank("bank1")->set_entry(rombank );
-};
+}
WRITE8_MEMBER(meritm_state::meritm_crt250_bank_w)
{
meritm_crt250_switch_banks();
-};
+}
void meritm_state::meritm_switch_banks( )
{
@@ -391,19 +388,19 @@ void meritm_state::meritm_switch_banks( )
membank("bank1")->set_entry(rombank );
membank("bank2")->set_entry(rombank | 0x01);
membank("bank3")->set_entry(rambank);
-};
+}
WRITE8_MEMBER(meritm_state::meritm_psd_a15_w)
{
m_psd_a15 = data;
//logerror( "Writing PSD_A15 with %02x at PC=%04X\n", data, space.device().safe_pc() );
meritm_switch_banks();
-};
+}
WRITE8_MEMBER(meritm_state::meritm_bank_w)
{
meritm_switch_banks();
-};
+}
/*************************************
*
@@ -416,13 +413,13 @@ WRITE8_MEMBER(meritm_state::meritm_crt250_questions_lo_w)
{
m_questions_loword_address &= 0xff00;
m_questions_loword_address |= data;
-};
+}
WRITE8_MEMBER(meritm_state::meritm_crt250_questions_hi_w)
{
m_questions_loword_address &= 0x00ff;
m_questions_loword_address |= (data << 8);
-};
+}
WRITE8_MEMBER(meritm_state::meritm_crt250_questions_bank_w)
{
@@ -466,7 +463,7 @@ WRITE8_MEMBER(meritm_state::meritm_crt250_questions_bank_w)
logerror( "Reading question byte at %06X\n", questions_address | m_questions_loword_address);
*dst = memregion("extra")->base()[questions_address | m_questions_loword_address];
}
-};
+}
/*************************************
@@ -490,7 +487,7 @@ WRITE8_MEMBER(meritm_state::meritm_ds1644_w)
}
//logerror( "Writing RTC, reg = %d, data = %x\n", offset, data);
}
-};
+}
UINT8 meritm_state::binary_to_BCD(UINT8 data)
{
@@ -517,7 +514,7 @@ READ8_MEMBER(meritm_state::meritm_ds1644_r)
m_ram[0x7fff] = binary_to_BCD(systime.local_time.year % 100);
}
return m_ram[rambank*0x2000 + 0x1ff8 + offset];
-};
+}
/*************************************
*
@@ -863,7 +860,7 @@ READ8_MEMBER(meritm_state::meritm_8255_port_c_r)
{
//logerror( "8255 port C read\n" );
return 0xff;
-};
+}
WRITE8_MEMBER(meritm_state::meritm_crt250_port_b_w)
{
@@ -891,7 +888,7 @@ WRITE8_MEMBER(meritm_state::meritm_crt250_port_b_w)
WRITE8_MEMBER(meritm_state::meritm_ay8930_port_b_w)
{
// lamps
-};
+}
/*************************************
*
@@ -917,7 +914,7 @@ READ8_MEMBER(meritm_state::meritm_audio_pio_port_a_r)
*/
return m_vint;
-};
+}
READ8_MEMBER(meritm_state::meritm_audio_pio_port_b_r)
{
@@ -937,7 +934,7 @@ READ8_MEMBER(meritm_state::meritm_audio_pio_port_b_r)
*/
return m_ds1204->read_dq();
-};
+}
WRITE8_MEMBER(meritm_state::meritm_audio_pio_port_a_w)
{
@@ -958,7 +955,7 @@ WRITE8_MEMBER(meritm_state::meritm_audio_pio_port_a_w)
m_bank = (data & 7) | ((data >> 2) & 0x18);
//logerror("Writing BANK with %x (raw = %x)\n", m_bank, data);
-};
+}
WRITE8_MEMBER(meritm_state::meritm_audio_pio_port_b_w)
{
@@ -980,7 +977,7 @@ WRITE8_MEMBER(meritm_state::meritm_audio_pio_port_b_w)
m_ds1204->write_rst((data >> 2) & 1);
m_ds1204->write_clk((data >> 1) & 1);
m_ds1204->write_dq(data & 0x01);
-};
+}
WRITE8_MEMBER(meritm_state::meritm_io_pio_port_a_w)
{
@@ -998,7 +995,7 @@ WRITE8_MEMBER(meritm_state::meritm_io_pio_port_a_w)
7 J3 PE7
*/
-};
+}
WRITE8_MEMBER(meritm_state::meritm_io_pio_port_b_w)
{
@@ -1016,7 +1013,7 @@ WRITE8_MEMBER(meritm_state::meritm_io_pio_port_b_w)
7 J3 PF7
*/
-};
+}
static const z80_daisy_config meritm_daisy_chain[] =
{
@@ -1031,7 +1028,7 @@ MACHINE_START_MEMBER(meritm_state,merit_common)
m_z80pio_0->strobe_b(1);
m_z80pio_1->strobe_a(1);
m_z80pio_1->strobe_b(1);
-};
+}
void meritm_state::machine_start()
{
@@ -1041,13 +1038,13 @@ void meritm_state::machine_start()
MACHINE_START_CALL_MEMBER(merit_common);
save_item(NAME(m_bank));
-};
+}
MACHINE_START_MEMBER(meritm_state,meritm_crt250_questions)
{
meritm_state::machine_start();
save_item(NAME(m_questions_loword_address));
-};
+}
MACHINE_START_MEMBER(meritm_state,meritm_crt250_crt252_crt258)
{
@@ -1069,7 +1066,7 @@ MACHINE_START_MEMBER(meritm_state,meritm_crt260)
save_item(NAME(m_bank));
save_item(NAME(m_psd_a15));
save_pointer(NAME(m_ram), 0x8000);
-};
+}
// from MSX2 driver, may be not accurate for merit games
#define MSX2_XBORDER_PIXELS 16
@@ -2277,7 +2274,7 @@ ROM_END
DRIVER_INIT_MEMBER(meritm_state,megat3te)
{
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xfff8, 0xffff, read8_delegate(FUNC(meritm_state::meritm_ds1644_r), this), write8_delegate(FUNC(meritm_state::meritm_ds1644_w), this));
-};
+}
/* CRT-250 */
GAME( 1987, americna, 0, meritm_crt250, americna, driver_device, 0, ROT0, "Merit", "Americana (9131-00)", GAME_IMPERFECT_GRAPHICS )
diff --git a/src/mame/drivers/mitchell.c b/src/mame/drivers/mitchell.c
index c1ce0a6e4e4..16141bb62a9 100644
--- a/src/mame/drivers/mitchell.c
+++ b/src/mame/drivers/mitchell.c
@@ -120,7 +120,9 @@ WRITE8_MEMBER(mitchell_state::eeprom_serial_w)
WRITE8_MEMBER(mitchell_state::pang_bankswitch_w)
{
- membank("bank1")->set_entry(data & 0x0f);
+ m_bank1->set_entry(data & 0x0f);
+ if(m_bank1d)
+ m_bank1d->set_entry(data & 0x0f);
}
/*************************************
@@ -277,7 +279,13 @@ static ADDRESS_MAP_START( mitchell_map, AS_PROGRAM, 8, mitchell_state )
AM_RANGE(0xc000, 0xc7ff) AM_READWRITE(pang_paletteram_r,pang_paletteram_w) /* Banked palette RAM */
AM_RANGE(0xc800, 0xcfff) AM_READWRITE(pang_colorram_r,pang_colorram_w) AM_SHARE("colorram") /* Attribute RAM */
AM_RANGE(0xd000, 0xdfff) AM_READWRITE(pang_videoram_r,pang_videoram_w) AM_SHARE("videoram")/* Banked char / OBJ RAM */
- AM_RANGE(0xe000, 0xffff) AM_RAM /* Work RAM */
+ AM_RANGE(0xe000, 0xffff) AM_RAM AM_SHARE("ram") /* Work RAM */
+ADDRESS_MAP_END
+
+static ADDRESS_MAP_START( decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 8, mitchell_state )
+ AM_RANGE(0x0000, 0x7fff) AM_ROMBANK("bank0d")
+ AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1d")
+ AM_RANGE(0xe000, 0xffff) AM_RAM AM_SHARE("ram") /* Work RAM */
ADDRESS_MAP_END
static ADDRESS_MAP_START( mitchell_io_map, AS_IO, 8, mitchell_state )
@@ -303,7 +311,7 @@ static ADDRESS_MAP_START( spangbl_map, AS_PROGRAM, 8, mitchell_state )
AM_RANGE(0xc000, 0xc7ff) AM_READWRITE(pang_paletteram_r, pang_paletteram_w) /* Banked palette RAM */
AM_RANGE(0xc800, 0xcfff) AM_READWRITE(pang_colorram_r, pang_colorram_w) AM_SHARE("colorram")/* Attribute RAM */
AM_RANGE(0xd000, 0xdfff) AM_READWRITE(pang_videoram_r, pang_videoram_w) AM_SHARE("videoram") /* Banked char / OBJ RAM */
- AM_RANGE(0xe000, 0xffff) AM_RAM /* Work RAM */
+ AM_RANGE(0xe000, 0xffff) AM_RAM AM_SHARE("ram") /* Work RAM */
ADDRESS_MAP_END
static ADDRESS_MAP_START( spangbl_io_map, AS_IO, 8, mitchell_state )
@@ -1115,6 +1123,7 @@ static MACHINE_CONFIG_START( pang, mitchell_state )
MCFG_CPU_ADD("maincpu",Z80, XTAL_16MHz/2) /* verified on pcb */
MCFG_CPU_PROGRAM_MAP(mitchell_map)
MCFG_CPU_IO_MAP(mitchell_io_map)
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", mitchell_state, mitchell_irq, "screen", 0, 1)
MCFG_MACHINE_START_OVERRIDE(mitchell_state,mitchell)
@@ -1187,6 +1196,7 @@ static MACHINE_CONFIG_DERIVED( spangbl, pangnv )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(spangbl_map)
MCFG_CPU_IO_MAP(spangbl_io_map)
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", mitchell_state, irq0_line_hold)
MCFG_DEVICE_REMOVE("scantimer")
@@ -1215,6 +1225,7 @@ static MACHINE_CONFIG_START( mstworld, mitchell_state )
MCFG_CPU_ADD("maincpu", Z80, 6000000*4)
MCFG_CPU_PROGRAM_MAP(mitchell_map)
MCFG_CPU_IO_MAP(mstworld_io_map)
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", mitchell_state, irq0_line_hold)
MCFG_CPU_ADD("audiocpu", Z80,6000000) /* 6 MHz? */
@@ -1253,6 +1264,7 @@ static MACHINE_CONFIG_START( marukin, mitchell_state )
MCFG_CPU_ADD("maincpu", Z80, XTAL_16MHz/2) /* verified on pcb */
MCFG_CPU_PROGRAM_MAP(mitchell_map)
MCFG_CPU_IO_MAP(mitchell_io_map)
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", mitchell_state, mitchell_irq, "screen", 0, 1)
MCFG_EEPROM_SERIAL_93C46_ADD("eeprom")
@@ -1307,6 +1319,7 @@ static MACHINE_CONFIG_START( pkladiesbl, mitchell_state )
MCFG_CPU_ADD("maincpu", Z80, XTAL_12MHz/2) /* verified on pcb */
MCFG_CPU_PROGRAM_MAP(mitchell_map)
MCFG_CPU_IO_MAP(mitchell_io_map)
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", mitchell_state, mitchell_irq, "screen", 0, 1)
MCFG_EEPROM_SERIAL_93C46_ADD("eeprom")
@@ -2085,58 +2098,58 @@ ROM_END
*
*************************************/
-void mitchell_state::bootleg_decode( )
+void mitchell_state::bootleg_decode()
{
- address_space &space = m_maincpu->space(AS_PROGRAM);
- space.set_decrypted_region(0x0000, 0x7fff, memregion("maincpu")->base() + 0x50000);
- membank("bank1")->configure_decrypted_entries(0, 16, memregion("maincpu")->base() + 0x60000, 0x4000);
+ m_bank1->configure_entries(0, 16, memregion("maincpu")->base() + 0x10000, 0x4000);
+ m_bank0d->set_base(memregion("maincpu")->base() + 0x50000);
+ m_bank1d->configure_entries(0, 16, memregion("maincpu")->base() + 0x60000, 0x4000);
}
-void mitchell_state::configure_banks( )
+void mitchell_state::configure_banks(void (*decode)(UINT8 *src, UINT8 *dst, int size))
{
- membank("bank1")->configure_entries(0, 16, memregion("maincpu")->base() + 0x10000, 0x4000);
+ UINT8 *src = memregion("maincpu")->base();
+ int size = memregion("maincpu")->bytes();
+ UINT8 *dst = auto_alloc_array(machine(), UINT8, size);
+ decode(src, dst, size);
+ m_bank1->configure_entries(0, 16, src + 0x10000, 0x4000);
+ m_bank0d->set_base(dst);
+ m_bank1d->configure_entries(0, 16, dst + 0x10000, 0x4000);
}
DRIVER_INIT_MEMBER(mitchell_state,dokaben)
{
m_input_type = 0;
- mgakuen2_decode(machine());
- configure_banks();
+ configure_banks(mgakuen2_decode);
}
DRIVER_INIT_MEMBER(mitchell_state,pang)
{
m_input_type = 0;
- pang_decode(machine());
- configure_banks();
+ configure_banks(pang_decode);
}
DRIVER_INIT_MEMBER(mitchell_state,pangb)
{
m_input_type = 0;
bootleg_decode();
- configure_banks();
if (m_nvram != NULL)
m_nvram->set_base(&m_dummy_nvram, sizeof(m_dummy_nvram)); /* for pangba */
}
DRIVER_INIT_MEMBER(mitchell_state,cworld)
{
m_input_type = 0;
- cworld_decode(machine());
- configure_banks();
+ configure_banks(cworld_decode);
}
DRIVER_INIT_MEMBER(mitchell_state,hatena)
{
m_input_type = 0;
- hatena_decode(machine());
- configure_banks();
+ configure_banks(hatena_decode);
}
DRIVER_INIT_MEMBER(mitchell_state,spang)
{
m_input_type = 3;
m_nvram->set_base(&memregion("maincpu")->base()[0xe000], 0x80); /* NVRAM */
- spang_decode(machine());
- configure_banks();
+ configure_banks(spang_decode);
}
DRIVER_INIT_MEMBER(mitchell_state,spangbl)
@@ -2144,79 +2157,69 @@ DRIVER_INIT_MEMBER(mitchell_state,spangbl)
m_input_type = 3;
m_nvram->set_base(&memregion("maincpu")->base()[0xe000], 0x80); /* NVRAM */
bootleg_decode();
- configure_banks();
}
DRIVER_INIT_MEMBER(mitchell_state,spangj)
{
m_input_type = 3;
m_nvram->set_base(&memregion("maincpu")->base()[0xe000], 0x80); /* NVRAM */
- spangj_decode(machine());
- configure_banks();
+ configure_banks(spangj_decode);
}
DRIVER_INIT_MEMBER(mitchell_state,sbbros)
{
m_input_type = 3;
m_nvram->set_base(&memregion("maincpu")->base()[0xe000], 0x80); /* NVRAM */
- sbbros_decode(machine());
- configure_banks();
+ configure_banks(sbbros_decode);
}
DRIVER_INIT_MEMBER(mitchell_state,qtono1)
{
m_input_type = 0;
- qtono1_decode(machine());
- configure_banks();
+ configure_banks(qtono1_decode);
}
DRIVER_INIT_MEMBER(mitchell_state,qsangoku)
{
m_input_type = 0;
- qsangoku_decode(machine());
- configure_banks();
+ configure_banks(qsangoku_decode);
}
+
DRIVER_INIT_MEMBER(mitchell_state,mgakuen)
{
m_input_type = 1;
- configure_banks();
+ m_bank1->configure_entries(0, 16, memregion("maincpu")->base() + 0x10000, 0x4000);
m_maincpu->space(AS_IO).install_read_port(0x03, 0x03, "DSW0");
m_maincpu->space(AS_IO).install_read_port(0x04, 0x04, "DSW1");
}
DRIVER_INIT_MEMBER(mitchell_state,mgakuen2)
{
m_input_type = 1;
- mgakuen2_decode(machine());
- configure_banks();
+ configure_banks(mgakuen2_decode);
}
DRIVER_INIT_MEMBER(mitchell_state,pkladies)
{
m_input_type = 1;
- mgakuen2_decode(machine());
- configure_banks();
+ configure_banks(mgakuen2_decode);
}
DRIVER_INIT_MEMBER(mitchell_state,pkladiesbl)
{
m_input_type = 1;
bootleg_decode();
- configure_banks();
}
DRIVER_INIT_MEMBER(mitchell_state,marukin)
{
m_input_type = 1;
- marukin_decode(machine());
- configure_banks();
+ configure_banks(marukin_decode);
}
DRIVER_INIT_MEMBER(mitchell_state,block)
{
m_input_type = 2;
m_nvram->set_base(&memregion("maincpu")->base()[0xff80], 0x80); /* NVRAM */
- block_decode(machine());
- configure_banks();
+ configure_banks(block_decode);
}
DRIVER_INIT_MEMBER(mitchell_state,blockbl)
{
m_input_type = 2;
m_nvram->set_base(&memregion("maincpu")->base()[0xff80], 0x80); /* NVRAM */
bootleg_decode();
- configure_banks();
}
DRIVER_INIT_MEMBER(mitchell_state,mstworld)
@@ -2262,7 +2265,6 @@ DRIVER_INIT_MEMBER(mitchell_state,mstworld)
}
bootleg_decode();
- configure_banks();
}
diff --git a/src/mame/drivers/model1.c b/src/mame/drivers/model1.c
index 7cf50339ff2..8b34dbb22ce 100644
--- a/src/mame/drivers/model1.c
+++ b/src/mame/drivers/model1.c
@@ -742,6 +742,9 @@ TIMER_DEVICE_CALLBACK_MEMBER(model1_state::model1_interrupt)
irq_raise(m_sound_irq);
m_m1audio->check_fifo_irq();
+
+ if (m_m1comm != NULL)
+ m_m1comm->check_vint_irq();
}
}
@@ -902,6 +905,10 @@ static ADDRESS_MAP_START( model1_mem, AS_PROGRAM, 16, model1_state )
AM_RANGE(0x900000, 0x903fff) AM_RAM_WRITE(p_w) AM_SHARE("palette")
AM_RANGE(0x910000, 0x91bfff) AM_RAM AM_SHARE("color_xlat")
+ AM_RANGE(0xb00000, 0xb00fff) AM_DEVREADWRITE8("m1comm", m1comm_device, share_r, share_w, 0xffff)
+ AM_RANGE(0xb01000, 0xb01001) AM_DEVREADWRITE8("m1comm", m1comm_device, cn_r, cn_w, 0x00ff)
+ AM_RANGE(0xb01002, 0xb01003) AM_DEVREADWRITE8("m1comm", m1comm_device, fg_r, fg_w, 0x00ff)
+
AM_RANGE(0xc00000, 0xc0003f) AM_READWRITE(io_r, io_w)
AM_RANGE(0xc00040, 0xc00043) AM_READWRITE(network_ctl_r, network_ctl_w)
@@ -950,6 +957,10 @@ static ADDRESS_MAP_START( model1_vr_mem, AS_PROGRAM, 16, model1_state )
AM_RANGE(0x900000, 0x903fff) AM_RAM_WRITE(p_w) AM_SHARE("palette")
AM_RANGE(0x910000, 0x91bfff) AM_RAM AM_SHARE("color_xlat")
+ AM_RANGE(0xb00000, 0xb00fff) AM_DEVREADWRITE8("m1comm", m1comm_device, share_r, share_w, 0xffff)
+ AM_RANGE(0xb01000, 0xb01001) AM_DEVREADWRITE8("m1comm", m1comm_device, cn_r, cn_w, 0x00ff)
+ AM_RANGE(0xb01002, 0xb01003) AM_DEVREADWRITE8("m1comm", m1comm_device, fg_r, fg_w, 0x00ff)
+
AM_RANGE(0xc00000, 0xc0003f) AM_READWRITE(io_r, io_w)
AM_RANGE(0xc00040, 0xc00043) AM_READWRITE(network_ctl_r, network_ctl_w)
@@ -1541,6 +1552,8 @@ static MACHINE_CONFIG_START( model1, model1_state )
MCFG_VIDEO_START_OVERRIDE(model1_state,model1)
MCFG_SEGAM1AUDIO_ADD("m1audio")
+
+ MCFG_M1COMM_ADD("m1comm")
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED(swa, model1)
@@ -1586,6 +1599,8 @@ static MACHINE_CONFIG_START( model1_vr, model1_state )
MCFG_VIDEO_START_OVERRIDE(model1_state,model1)
MCFG_SEGAM1AUDIO_ADD("m1audio")
+
+ MCFG_M1COMM_ADD("m1comm")
MACHINE_CONFIG_END
GAME( 1993, vf, 0, model1, vf, driver_device, 0, ROT0, "Sega", "Virtua Fighter", GAME_IMPERFECT_GRAPHICS )
diff --git a/src/mame/drivers/model2.c b/src/mame/drivers/model2.c
index 641c454ad4d..6b66fc9f2fd 100644
--- a/src/mame/drivers/model2.c
+++ b/src/mame/drivers/model2.c
@@ -129,7 +129,7 @@
enum {
DSP_TYPE_TGP = 1,
DSP_TYPE_SHARC = 2,
- DSP_TYPE_TGPX4 = 3,
+ DSP_TYPE_TGPX4 = 3
};
diff --git a/src/mame/drivers/model3.c b/src/mame/drivers/model3.c
index f20f4901166..8509fb90664 100644
--- a/src/mame/drivers/model3.c
+++ b/src/mame/drivers/model3.c
@@ -1192,7 +1192,7 @@ static void configure_fast_ram(running_machine &machine)
{
model3_state *state = machine.driver_data<model3_state>();
/* set conservative DRC options */
- machine.device<ppc_device>("maincpu")->ppcdrc_set_options(PPCDRC_COMPATIBLE_OPTIONS - PPCDRC_ACCURATE_SINGLES);
+ machine.device<ppc_device>("maincpu")->ppcdrc_set_options(PPCDRC_COMPATIBLE_OPTIONS);
/* configure fast RAM regions for DRC */
machine.device<ppc_device>("maincpu")->ppcdrc_add_fastram(0x00000000, 0x007fffff, FALSE, state->m_work_ram);
@@ -1556,7 +1556,7 @@ WRITE64_MEMBER(model3_state::model3_sys_w)
m_crom_bank = data >> 56;
data >>= 56;
- data = (~data) & 0x7;
+ data = (~data) & 0xf;
membank("bank1")->set_base(memregion( "user1" )->base() + 0x800000 + (data * 0x800000)); /* banked CROM */
}
@@ -2047,7 +2047,7 @@ INPUT_PORTS_END
#define ROM_LOAD_VROM(name, offset, length, hash) ROMX_LOAD(name, offset, length, hash, ROM_GROUPWORD | ROM_SKIP(14) )
ROM_START( lemans24 ) /* step 1.5, Sega game ID# is 833-13159, ROM board ID# 834-13160 GAME BD LEMANS 24 */
- ROM_REGION64_BE( 0x4800000, "user1", 0 ) /* program + data ROMs */
+ ROM_REGION64_BE( 0x8800000, "user1", 0 ) /* program + data ROMs */
// CROM
ROM_LOAD64_WORD_SWAP( "epr-19887b.17", 0x600006, 0x080000, CRC(2842bb87) SHA1(2acabf3f7281acaf6bab4d3bae9701df3909cf81) )
ROM_LOAD64_WORD_SWAP( "epr-19888b.18", 0x600004, 0x080000, CRC(800d763d) SHA1(4f2865a64d6dda638840d359db3bd2f22b6d1404) )
@@ -2117,7 +2117,7 @@ ROM_END
ROM_START( scud ) /* step 1.5, Sega game ID# is 833-13041, ROM board ID# 834-13072 SPG COMM AUS */
/* There is known to be a ROM board ID# 834-13034 SPG DX AUS with program roms EPR-19634 to EPR-19637 */
- ROM_REGION64_BE( 0x4800000, "user1", 0 ) /* program + data ROMs */
+ ROM_REGION64_BE( 0x8800000, "user1", 0 ) /* program + data ROMs */
// CROM
ROM_LOAD64_WORD_SWAP( "epr-19731.17", 0x0600006, 0x80000, CRC(3ee6447e) SHA1(124697791d90c1b352dd6e33bd3b45535aa92bb5) )
ROM_LOAD64_WORD_SWAP( "epr-19732.18", 0x0600004, 0x80000, CRC(23e864bb) SHA1(0f34d963ee681ca1006f3dec12b593d961e3e442) )
@@ -2192,7 +2192,7 @@ ROM_START( scud ) /* step 1.5, Sega game ID# is 833-13041, ROM board ID# 834-1
ROM_END
ROM_START( scudj ) /* step 1.5, Sega game ID# is 833-13041, ROM board ID# 12934 SPG DX */
- ROM_REGION64_BE( 0x4800000, "user1", 0 ) /* program + data ROMs */
+ ROM_REGION64_BE( 0x8800000, "user1", 0 ) /* program + data ROMs */
// CROM
ROM_LOAD64_WORD_SWAP( "epr-19610.17a", 0x0600006, 0x80000, CRC(53f5cd94) SHA1(e27609165087ef7000b61ce628883561ffe64b22) )
ROM_LOAD64_WORD_SWAP( "epr-19609.18a", 0x0600004, 0x80000, CRC(ec418b68) SHA1(8455db7e174ea00db30b7e61681ac7b7fcd9ba1c) )
@@ -2267,7 +2267,7 @@ ROM_START( scudj ) /* step 1.5, Sega game ID# is 833-13041, ROM board ID# 12934
ROM_END
ROM_START( scuda ) /* step 1.5, Sega game ID# is 833-13041, ROM board ID# 834-13042 SPG FOR COMMUNICATION */
- ROM_REGION64_BE( 0x4800000, "user1", 0 ) /* program + data ROMs */
+ ROM_REGION64_BE( 0x8800000, "user1", 0 ) /* program + data ROMs */
// CROM
ROM_LOAD64_WORD_SWAP( "epr-19688.17", 0x0600006, 0x80000, CRC(a4c85103) SHA1(b2e57f86d0a49e3e88fa7d6a77bbd99039c034bb) )
ROM_LOAD64_WORD_SWAP( "epr-19689.18", 0x0600004, 0x80000, CRC(cbce6d62) SHA1(b6051af013ee80406cfadb0c8acf24b8825ccaf2) )
@@ -2342,7 +2342,7 @@ ROM_START( scuda ) /* step 1.5, Sega game ID# is 833-13041, ROM board ID# 834-1
ROM_END
ROM_START( scudplus ) /* step 1.5, Sega game ID# is 833-13260 SCUD PLUS, ROM board ID# 834-13261 SCUD PLUS */
- ROM_REGION64_BE( 0x4800000, "user1", 0 ) /* program + data ROMs */
+ ROM_REGION64_BE( 0x8800000, "user1", 0 ) /* program + data ROMs */
// CROM
ROM_LOAD64_WORD_SWAP( "epr-20092a.17", 0x0600006, 0x80000, CRC(a94ec57e) SHA1(bda1d9cb38e10a25f7cdde38f30ae13541fdbc5e) )
ROM_LOAD64_WORD_SWAP( "epr-20093a.18", 0x0600004, 0x80000, CRC(4ed2e35d) SHA1(ac149b369db9fc80e63e1ed943d42ccd056dab1b) )
@@ -2423,7 +2423,7 @@ ROM_START( scudplus ) /* step 1.5, Sega game ID# is 833-13260 SCUD PLUS, ROM b
ROM_END
ROM_START( scudplusa ) /* step 1.5, Sega game ID# is 833-13260 SCUD PLUS, ROM board ID# 834-13261 SCUD PLUS */
- ROM_REGION64_BE( 0x4800000, "user1", 0 ) /* program + data ROMs */
+ ROM_REGION64_BE( 0x8800000, "user1", 0 ) /* program + data ROMs */
// CROM
ROM_LOAD64_WORD_SWAP( "epr-20092.17", 0x0600006, 0x80000, CRC(6f9161c1) SHA1(b1c66eeb1bb67664aafa78ad62515204f231f09b) )
ROM_LOAD64_WORD_SWAP( "epr-20093.18", 0x0600004, 0x80000, CRC(9a85c611) SHA1(fb21c29584b205ec14f82318110ecf5821a95c23) )
@@ -2504,7 +2504,7 @@ ROM_START( scudplusa ) /* step 1.5, Sega game ID# is 833-13260 SCUD PLUS, ROM b
ROM_END
ROM_START( vf3 ) /* step 1.0, Sega game ID# is 833-12712, ROM board ID# 834-12821 */
- ROM_REGION64_BE( 0x4800000, "user1", 0 ) /* program + data ROMs */
+ ROM_REGION64_BE( 0x8800000, "user1", 0 ) /* program + data ROMs */
// CROM
ROM_LOAD64_WORD_SWAP( "epr-19227c.17", 0x600006, 0x080000, CRC(a7df4d75) SHA1(1b1186227f830556c5e2b6ca4c2bf20673b22f94) )
ROM_LOAD64_WORD_SWAP( "epr-19228c.18", 0x600004, 0x080000, CRC(9c5727e2) SHA1(f9f8b8cf27fdce08ab2975dbaa8c7a03f5c064fb) )
@@ -2579,7 +2579,7 @@ ROM_START( vf3 ) /* step 1.0, Sega game ID# is 833-12712, ROM board ID# 834-1
ROM_END
ROM_START( vf3a ) /* step 1.0, Sega game ID# is 833-12712, ROM board ID# 834-12821 */
- ROM_REGION64_BE( 0x4800000, "user1", 0 ) /* program + data ROMs */
+ ROM_REGION64_BE( 0x8800000, "user1", 0 ) /* program + data ROMs */
// CROM
ROM_LOAD64_WORD_SWAP( "epr19227a.17", 0x600006, 0x080000, CRC(7139931a) SHA1(57eec80361726143017b1adbfaafbeef0bc4109d) )
ROM_LOAD64_WORD_SWAP( "epr19228a.18", 0x600004, 0x080000, CRC(82f17ab5) SHA1(64714d14e64d97ebeedd1c6e1e832969df9e2324) )
@@ -2654,7 +2654,7 @@ ROM_START( vf3a ) /* step 1.0, Sega game ID# is 833-12712, ROM board ID# 834-1
ROM_END
ROM_START( vf3tb ) /* step 1.0? */
- ROM_REGION64_BE( 0x4800000, "user1", 0 ) /* program + data ROMs */
+ ROM_REGION64_BE( 0x8800000, "user1", 0 ) /* program + data ROMs */
// CROM
ROM_LOAD64_WORD_SWAP( "epr-20126.17", 0x600006, 0x080000, CRC(27ecd3b0) SHA1(a9b913294ac925adb501d3b47f346006b70dfcd6) )
ROM_LOAD64_WORD_SWAP( "epr-20127.18", 0x600004, 0x080000, CRC(5c0f694b) SHA1(ca346d6b249bb7a3015f016d25bfb3050360c8ec) )
@@ -2729,7 +2729,7 @@ ROM_START( vf3tb ) /* step 1.0? */
ROM_END
ROM_START( bass ) /* step 1.0, Sega game ID# is 833-13317, ROM board ID# 834-13318 BSS */
- ROM_REGION64_BE( 0x4800000, "user1", 0 ) /* program + data ROMs */
+ ROM_REGION64_BE( 0x8800000, "user1", 0 ) /* program + data ROMs */
// CROM
ROM_LOAD64_WORD_SWAP( "epr-20643.17", 0x600006, 0x080000, CRC(daf02716) SHA1(b968f8ca602c78b9ca49969ff01f9440f175049a) )
ROM_LOAD64_WORD_SWAP( "epr-20644.18", 0x600004, 0x080000, CRC(c28db2b6) SHA1(0b12fe9e5189714b1aca79c4bba4be57a9e0d5fd) )
@@ -2798,7 +2798,7 @@ ROM_START( bass ) /* step 1.0, Sega game ID# is 833-13317, ROM board ID# 834-1
ROM_END
ROM_START( bassdx ) /* step 1.0, Sega game ID# is 833-13476 BSS DX JPN, ROM board ID# 834-13477 BSS DX JPN */
- ROM_REGION64_BE( 0x4800000, "user1", 0 ) /* program + data ROMs */
+ ROM_REGION64_BE( 0x8800000, "user1", 0 ) /* program + data ROMs */
// CROM
ROM_LOAD64_WORD_SWAP( "epr-20834.17", 0x600006, 0x080000, CRC(17f466a6) SHA1(2abdc432891cc79733fc29903df87af9eba11b32) )
ROM_LOAD64_WORD_SWAP( "epr-20835.18", 0x600004, 0x080000, CRC(f8f19bb2) SHA1(8f1704e532e494086fb5989d0c358ea0a0f6aae5) )
@@ -2892,7 +2892,7 @@ gal16v8d (sega 315-6126)
*/
ROM_START( getbass ) /* step 1.0, Sega game ID# is 833-13416 GET BASS STD, ROM board ID# 834-13417 */
- ROM_REGION64_BE( 0x4800000, "user1", 0 ) /* program + data ROMs */
+ ROM_REGION64_BE( 0x8800000, "user1", 0 ) /* program + data ROMs */
// CROM
ROM_LOAD64_WORD_SWAP( "epr-20309.17", 0x600006, 0x080000, CRC(a42e1033) SHA1(a834eb973e9529338413220a2d8e66ce98d6cb31) )
ROM_LOAD64_WORD_SWAP( "epr-20310.18", 0x600004, 0x080000, CRC(4efcddc9) SHA1(d1362c2a844b605901083e875a6aad817401eb0a) )
@@ -2964,7 +2964,7 @@ ROM_START( getbass ) /* step 1.0, Sega game ID# is 833-13416 GET BASS STD, RO
ROM_END
ROM_START( lostwsga ) /* Step 1.5, PCB cage labeled 834-13172 THE LOST WORLD U/R. Sega game ID# is 833-13171, ROM board ID# 834-13172 REV.A */
- ROM_REGION64_BE( 0x4800000, "user1", 0 ) /* program + data ROMs */
+ ROM_REGION64_BE( 0x8800000, "user1", 0 ) /* program + data ROMs */
// CROM
ROM_LOAD64_WORD_SWAP( "epr-19939a.17", 0x600006, 0x080000, CRC(8788b939) SHA1(30932057f763545568526f85977aa0afc4b66e7d) )
ROM_LOAD64_WORD_SWAP( "epr-19938a.18", 0x600004, 0x080000, CRC(38afe27a) SHA1(718a238ee246eeed9fa698b58493806932d0e7cb) )
@@ -3039,7 +3039,7 @@ ROM_START( lostwsga ) /* Step 1.5, PCB cage labeled 834-13172 THE LOST WORLD U
ROM_END
ROM_START( vs2 ) /* Step 2.0 */
- ROM_REGION64_BE( 0x4800000, "user1", 0 ) /* program + data ROMs */
+ ROM_REGION64_BE( 0x8800000, "user1", 0 ) /* program + data ROMs */
// CROM
ROM_LOAD64_WORD_SWAP( "epr-20467.17", 0x400006, 0x100000, CRC(25d7ae73) SHA1(433a7c1dac1bd5524b018da2ed09f937d527ac3e) )
ROM_LOAD64_WORD_SWAP( "epr-20468.18", 0x400004, 0x100000, CRC(f0f0b6ea) SHA1(b3f545e5a4dd45b97df938093251cc7845c2a1f9) )
@@ -3114,7 +3114,7 @@ ROM_START( vs2 ) /* Step 2.0 */
ROM_END
ROM_START( vs215 ) /* Step 1.5 */
- ROM_REGION64_BE( 0x4800000, "user1", 0 ) /* program + data ROMs */
+ ROM_REGION64_BE( 0x8800000, "user1", 0 ) /* program + data ROMs */
// CROM
ROM_LOAD64_WORD_SWAP( "epr-19900.17", 0x600006, 0x080000, CRC(8fb6045d) SHA1(88497eafc23ba70ab4a43de552a16caccd8dccbe) )
ROM_LOAD64_WORD_SWAP( "epr-19899.18", 0x600004, 0x080000, CRC(8cc2be9f) SHA1(ec82b1312c8d58adb200f4d7f6f9a9c8214415d5) )
@@ -3189,7 +3189,7 @@ ROM_START( vs215 ) /* Step 1.5 */
ROM_END
ROM_START( vs215o ) /* Step 1.5, original release.. might even be for Step 1.0??? */
- ROM_REGION64_BE( 0x4800000, "user1", 0 ) /* program + data ROMs */
+ ROM_REGION64_BE( 0x8800000, "user1", 0 ) /* program + data ROMs */
// CROM
ROM_LOAD64_WORD_SWAP( "epr-19806.17", 0x600006, 0x080000, CRC(95e1b970) SHA1(bcc914088cd08cb0032349b71904757760d947f3) )
ROM_LOAD64_WORD_SWAP( "epr-19805.18", 0x600004, 0x080000, CRC(d9e40606) SHA1(b305e607ffe4226c825a73973a5c8ec1322e8b58) )
@@ -3264,7 +3264,7 @@ ROM_START( vs215o ) /* Step 1.5, original release.. might even be for Step 1.0??
ROM_END
ROM_START( vs298 ) /* Step 2.0, Sega ID# 833-13346, ROM board ID# 834-13347 */
- ROM_REGION64_BE( 0x4800000, "user1", 0 ) /* program + data ROMs */
+ ROM_REGION64_BE( 0x8800000, "user1", 0 ) /* program + data ROMs */
// CROM
ROM_LOAD64_WORD_SWAP( "epr-20917.17", 0x400006, 0x100000, CRC(c3bbb270) SHA1(16b2342031ff72408f2290e775df5c8aa344c2e4) )
ROM_LOAD64_WORD_SWAP( "epr-20918.18", 0x400004, 0x100000, CRC(0e9cdc5b) SHA1(356816d0380c791b9d812ce17fa95123d15bb5e9) )
@@ -3342,7 +3342,7 @@ ROM_START( vs298 ) /* Step 2.0, Sega ID# 833-13346, ROM board ID# 834-13347 */
ROM_END
ROM_START( vs29815 ) /* Step 1.5, ROM board ID# 834-13495 VS2 VER98 STEP 1.5 */
- ROM_REGION64_BE( 0x4800000, "user1", 0 ) /* program + data ROMs */
+ ROM_REGION64_BE( 0x8800000, "user1", 0 ) /* program + data ROMs */
// CROM
ROM_LOAD64_WORD_SWAP( "epr-20909.17", 0x600006, 0x080000, CRC(3dff0d7e) SHA1(c6a6a103f499cd451796ae2480b8c38c3e87a143) )
ROM_LOAD64_WORD_SWAP( "epr-20910.18", 0x600004, 0x080000, CRC(dc75a2e3) SHA1(f1b13674ae20b5b964be593171b9d6008d5a51b7) )
@@ -3417,7 +3417,7 @@ ROM_START( vs29815 ) /* Step 1.5, ROM board ID# 834-13495 VS2 VER98 STEP 1.5
ROM_END
ROM_START( vs2v991 ) /* Step 2.0 */
- ROM_REGION64_BE( 0x4800000, "user1", 0 ) /* program + data ROMs */
+ ROM_REGION64_BE( 0x8800000, "user1", 0 ) /* program + data ROMs */
// CROM
ROM_LOAD64_WORD_SWAP( "epr-21535b.17", 0x400006, 0x100000, CRC(76c5fa8e) SHA1(862438198cb7fdd20beeba53e707a7c59e618ad9) )
ROM_LOAD64_WORD_SWAP( "epr-21536b.18", 0x400004, 0x100000, CRC(1f2bd190) SHA1(19843e6c5626de03eba3cba79c03ce9f2471c183) )
@@ -3495,7 +3495,7 @@ ROM_START( vs2v991 ) /* Step 2.0 */
ROM_END
ROM_START( vs299b ) /* Step 2.0 */
- ROM_REGION64_BE( 0x4800000, "user1", 0 ) /* program + data ROMs */
+ ROM_REGION64_BE( 0x8800000, "user1", 0 ) /* program + data ROMs */
// CROM
ROM_LOAD64_WORD_SWAP( "epr-21550b.17", 0x400006, 0x100000, CRC(c508e488) SHA1(3134d418beaee9f824a0bd0e5441a997b5911d16) )
ROM_LOAD64_WORD_SWAP( "epr-21551b.18", 0x400004, 0x100000, CRC(0bbc40f7) SHA1(4437c7eab621349b826dcc03d1377731260417e8) )
@@ -3573,7 +3573,7 @@ ROM_START( vs299b ) /* Step 2.0 */
ROM_END
ROM_START( vs299a ) /* Step 2.0 */
- ROM_REGION64_BE( 0x4800000, "user1", 0 ) /* program + data ROMs */
+ ROM_REGION64_BE( 0x8800000, "user1", 0 ) /* program + data ROMs */
// CROM
ROM_LOAD64_WORD_SWAP( "epr-21535a.17", 0x400006, 0x100000, CRC(8e4ec341) SHA1(973c71e7a48e728cbcb2465b56e90669fee0ec53) )
ROM_LOAD64_WORD_SWAP( "epr-21536a.18", 0x400004, 0x100000, CRC(95d49d6e) SHA1(80b6655c1ee0f76620e3e2e9425719819a96ccf7) )
@@ -3651,7 +3651,7 @@ ROM_START( vs299a ) /* Step 2.0 */
ROM_END
ROM_START( vs299 ) /* Step 2.0 */
- ROM_REGION64_BE( 0x4800000, "user1", 0 ) /* program + data ROMs */
+ ROM_REGION64_BE( 0x8800000, "user1", 0 ) /* program + data ROMs */
// CROM
ROM_LOAD64_WORD_SWAP( "epr-21535.17", 0x400006, 0x100000, CRC(976a00bf) SHA1(d4be52ff59faa877b169f96ac509a2196cefb908) )
ROM_LOAD64_WORD_SWAP( "epr-21536.18", 0x400004, 0x100000, CRC(9af2b0d5) SHA1(6ec296014228782f372611fe774014d252956b63) )
@@ -3729,7 +3729,7 @@ ROM_START( vs299 ) /* Step 2.0 */
ROM_END
ROM_START( von2 ) /* Step 2.0 */
- ROM_REGION64_BE( 0x4800000, "user1", 0 ) /* program + data ROMs */
+ ROM_REGION64_BE( 0x8800000, "user1", 0 ) /* program + data ROMs */
// CROM
ROM_LOAD64_WORD_SWAP( "epr-20683b.17", 0x000006, 0x200000, CRC(59d9c974) SHA1(c45594ed474a9e8fd074e0d9d5fa6662bc88dee6) )
ROM_LOAD64_WORD_SWAP( "epr-20684b.18", 0x000004, 0x200000, CRC(1fc15431) SHA1(c68c77dfcf5e2702214d64095ce07076d3702a5e) )
@@ -3808,7 +3808,7 @@ ROM_START( von2 ) /* Step 2.0 */
ROM_END
ROM_START( von254g ) /* Step 2.0, Sega game ID# is 833-13789 */
- ROM_REGION64_BE( 0x4800000, "user1", 0 ) /* program + data ROMs */
+ ROM_REGION64_BE( 0x8800000, "user1", 0 ) /* program + data ROMs */
// CROM
ROM_LOAD64_WORD_SWAP( "epr-21788.17", 0x000006, 0x200000, CRC(97066bcf) SHA1(234c45ee1f23b22f61893825eebf31d867cf420f) )
ROM_LOAD64_WORD_SWAP( "epr-21789.18", 0x000004, 0x200000, CRC(3069108f) SHA1(f4e82da677458423abcf07c9c5a837005ed8f1c4) )
@@ -3887,7 +3887,7 @@ ROM_START( von254g ) /* Step 2.0, Sega game ID# is 833-13789 */
ROM_END
ROM_START( skichamp ) /* Step 2.0 */
- ROM_REGION64_BE( 0x4800000, "user1", 0 ) /* program + data ROMs */
+ ROM_REGION64_BE( 0x8800000, "user1", 0 ) /* program + data ROMs */
// CROM
ROM_LOAD64_WORD_SWAP( "epr-20352.17", 0x000006, 0x200000, CRC(c92c2545) SHA1(612c39c935b403484fcda6d36fca50cc5ef726fc) )
ROM_LOAD64_WORD_SWAP( "epr-20353.19", 0x000004, 0x200000, CRC(badf5f04) SHA1(65a502a3fada114a699d0bf22e004d5bf1f5edf5) )
@@ -3959,7 +3959,7 @@ ROM_START( skichamp ) /* Step 2.0 */
ROM_END
ROM_START( swtrilgy ) /* Step 2.1, Sega game ID# is 833-13586, ROM board ID# 834-13587 STAR WARS TRILOGY, Security board ID# 837-13588-COM */
- ROM_REGION64_BE( 0x4800000, "user1", 0 ) /* program + data ROMs */
+ ROM_REGION64_BE( 0x8800000, "user1", 0 ) /* program + data ROMs */
// CROM
ROM_LOAD64_WORD_SWAP( "epr-21379a.17", 0x000006, 0x200000, CRC(24dc1555) SHA1(0a4b458bb09238de0f38ba2805512b5dbee7d58e) )
ROM_LOAD64_WORD_SWAP( "epr-21380a.18", 0x000004, 0x200000, CRC(780fb4e7) SHA1(6650e114bad0e4c3f67b744599dba9845da82f11) )
@@ -4034,7 +4034,7 @@ ROM_START( swtrilgy ) /* Step 2.1, Sega game ID# is 833-13586, ROM board ID# 8
ROM_END
ROM_START( swtrilgya ) /* Step 2.1, Sega game ID# is 833-13586, ROM board ID# 834-13587 STAR WARS TRILOGY, Security board ID# 837-13588-COM */
- ROM_REGION64_BE( 0x4800000, "user1", 0 ) /* program + data ROMs */
+ ROM_REGION64_BE( 0x8800000, "user1", 0 ) /* program + data ROMs */
// CROM
ROM_LOAD64_WORD_SWAP( "epr-21379.17", 0x000006, 0x200000, CRC(61ad51d9) SHA1(b27ea929702bb94c86d03d6c1f479af32230b4d0) )
ROM_LOAD64_WORD_SWAP( "epr-21380.18", 0x000004, 0x200000, CRC(49b182f2) SHA1(9a4e3180f2661c95976963ab17e66a5184bca9a3) )
@@ -4106,7 +4106,7 @@ ROM_START( swtrilgya ) /* Step 2.1, Sega game ID# is 833-13586, ROM board ID# 8
ROM_END
ROM_START( dirtdvls ) /* Step 2.1 - Export version, Sega game ID# is 833-13427, ROM board ID# 834-13528 DRT */
- ROM_REGION64_BE( 0x4800000, "user1", 0 ) /* program + data ROMs */
+ ROM_REGION64_BE( 0x8800000, "user1", 0 ) /* program + data ROMs */
// CROM
ROM_LOAD64_WORD_SWAP( "epr-21062a.17", 0x000006, 0x200000, CRC(64b55254) SHA1(0e5de3786edad77dde08652ac837dc9125e7851c) )
ROM_LOAD64_WORD_SWAP( "epr-21063a.18", 0x000004, 0x200000, CRC(6ab7eb32) SHA1(3a4226d4c786e7b64688af3b8883b4039b8c8407) )
@@ -4170,7 +4170,7 @@ ROM_START( dirtdvls ) /* Step 2.1 - Export version, Sega game ID# is 833-13427
ROM_END
ROM_START( dirtdvlsa ) /* Step 2.1 - Australia version */
- ROM_REGION64_BE( 0x4800000, "user1", 0 ) /* program + data ROMs */
+ ROM_REGION64_BE( 0x8800000, "user1", 0 ) /* program + data ROMs */
// CROM
ROM_LOAD64_WORD_SWAP( "epr-21058a", 0x000006, 0x200000, CRC(4d7fdc8d) SHA1(c45031b4e3ea65519de671e0e11f87e0965e3c93) )
ROM_LOAD64_WORD_SWAP( "epr-21059a", 0x000004, 0x200000, CRC(f31a2aa4) SHA1(b7398db217372885f763efdb909f3e43ccbac34a) )
@@ -4400,7 +4400,7 @@ ROM_START( dayto2pe ) /* Step 2.1, Sega game ID# is 833-13610 DAYTONA USA2 SP,
ROM_END
ROM_START( srally2 ) /* Step 2.0, Sega game ID# is 833-13373, ROM board ID# 834-13374 SRT TWIN */
- ROM_REGION64_BE( 0x4800000, "user1", 0 ) /* program + data ROMs */
+ ROM_REGION64_BE( 0x8800000, "user1", 0 ) /* program + data ROMs */
// CROM
ROM_LOAD64_WORD_SWAP( "epr-20632.17", 0x000006, 0x200000, CRC(6829a801) SHA1(2aa3834f6a8c53f5db57ab52994b8ab3fde2d7c2) )
ROM_LOAD64_WORD_SWAP( "epr-20633.18", 0x000004, 0x200000, CRC(f5a24f24) SHA1(6f741bc53d51ff4b5535dbee35aa490f159945ec) )
@@ -4472,7 +4472,7 @@ ROM_START( srally2 ) /* Step 2.0, Sega game ID# is 833-13373, ROM board ID# 8
ROM_END
ROM_START( srally2x ) /* Step 2.0 */
- ROM_REGION64_BE( 0x4800000, "user1", 0 ) /* program + data ROMs */
+ ROM_REGION64_BE( 0x8800000, "user1", 0 ) /* program + data ROMs */
// CROM
ROM_LOAD64_WORD_SWAP( "epr-20502.17", 0x000006, 0x200000, CRC(af16846d) SHA1(a0babc4dc3809ca1e71eaad4dc2f8c1597575e8b) )
ROM_LOAD64_WORD_SWAP( "epr-20503.18", 0x000004, 0x200000, CRC(6e238b3d) SHA1(78da9abf39a2371d74d6b72b00f2467dfe86c4d5) )
@@ -4541,7 +4541,7 @@ ROM_START( srally2x ) /* Step 2.0 */
ROM_END
ROM_START( harley ) /* Step 2.0, Sega game ID# is 833-13325, ROM board ID# 834-13326 HARLEY DAVIDSON */
- ROM_REGION64_BE( 0x4800000, "user1", 0 ) /* program + data ROMs */
+ ROM_REGION64_BE( 0x8800000, "user1", 0 ) /* program + data ROMs */
// CROM
ROM_LOAD64_WORD_SWAP( "epr-20393b.17", 0x000006, 0x200000, CRC(7d712105) SHA1(35e0849f498de48fcb357495b6e8039740b8e881) )
ROM_LOAD64_WORD_SWAP( "epr-20394b.18", 0x000004, 0x200000, CRC(b4312135) SHA1(79c4306acd8c20f86d16a18de696783f7da9df84) )
@@ -4609,7 +4609,7 @@ ROM_START( harley ) /* Step 2.0, Sega game ID# is 833-13325, ROM board ID# 834-1
ROM_END
ROM_START( harleya ) /* Step 2.0, Sega game ID# is 833-13325, ROM board ID# 834-13326 HARLEY DAVIDSON */
- ROM_REGION64_BE( 0x4800000, "user1", 0 ) /* program + data ROMs */
+ ROM_REGION64_BE( 0x8800000, "user1", 0 ) /* program + data ROMs */
// CROM
ROM_LOAD64_WORD_SWAP( "epr-20393a.17", 0x000006, 0x200000, CRC(b5646556) SHA1(4bff0e140e1d1df7459f7194aa4a335bc4592203) )
ROM_LOAD64_WORD_SWAP( "epr-20394a.18", 0x000004, 0x200000, CRC(ce29e2b6) SHA1(482aaf5480b219b8ac6e4e36a6d64359e1834f44) )
@@ -4677,7 +4677,7 @@ ROM_START( harleya ) /* Step 2.0, Sega game ID# is 833-13325, ROM board ID# 8
ROM_END
ROM_START( fvipers2 ) /* Step 2.0 - Japan version */
- ROM_REGION64_BE( 0x4800000, "user1", 0 ) /* program + data ROMs */
+ ROM_REGION64_BE( 0x8800000, "user1", 0 ) /* program + data ROMs */
// CROM
ROM_LOAD64_WORD_SWAP( "epr-20596a.17", 0x000006, 0x200000, CRC(969ab801) SHA1(a7a2aa71204d1c38a6a8c0605331fd859cb224f1) )
ROM_LOAD64_WORD_SWAP( "epr-20597a.18", 0x000004, 0x200000, CRC(6fcee322) SHA1(d65303f2551902ac5446a35656241628d67f4a63) )
@@ -4915,7 +4915,7 @@ ROM_START( spikeofe ) /* Step 2.1, Sega game ID# is 833-13746, ROM board ID# 8
ROM_END
ROM_START( eca ) /* Step 2.1 Export version */
- ROM_REGION64_BE( 0x4800000, "user1", 0 ) /* program + data ROMs */
+ ROM_REGION64_BE( 0x8800000, "user1", 0 ) /* program + data ROMs */
// CROM
ROM_LOAD64_WORD_SWAP( "epr-22903.17", 0x000006, 0x200000, CRC(53882217) SHA1(163cbc92ff88671882cc1af377ceec80ba9f36db) )
ROM_LOAD64_WORD_SWAP( "epr-22904.18", 0x000004, 0x200000, CRC(0ff828a8) SHA1(2a74414891ceb5989e6ccb6e9d597f7d2e31fec4) ) // == epr-22896.18
@@ -4986,7 +4986,7 @@ ROM_START( eca ) /* Step 2.1 Export version */
ROM_END
ROM_START( ecau ) /* Step 2.1, ROM board ID# 834-13946-01 ECA */
- ROM_REGION64_BE( 0x4800000, "user1", 0 ) /* program + data ROMs */
+ ROM_REGION64_BE( 0x8800000, "user1", 0 ) /* program + data ROMs */
// CROM
ROM_LOAD64_WORD_SWAP( "epr-22895.17", 0x000006, 0x200000, CRC(07df16a0) SHA1(a9ad2b229854a5f4f761565141db738adde28720) )
ROM_LOAD64_WORD_SWAP( "epr-22896.18", 0x000004, 0x200000, CRC(0ff828a8) SHA1(2a74414891ceb5989e6ccb6e9d597f7d2e31fec4) )
@@ -5057,7 +5057,7 @@ ROM_START( ecau ) /* Step 2.1, ROM board ID# 834-13946-01 ECA */
ROM_END
ROM_START( ecap ) /* Step 2.1 - Proto or Location test - No security dongle */
- ROM_REGION64_BE( 0x4800000, "user1", 0 ) /* program + data ROMs */
+ ROM_REGION64_BE( 0x8800000, "user1", 0 ) /* program + data ROMs */
// CROM
// Hand written SEGA labels in this form: TITLE: QQ ROM NO: IC17 CHECK SUM: 551B 9/12-'99
ROM_LOAD64_WORD_SWAP( "qq.ic17", 0x000006, 0x200000, BAD_DUMP CRC(1db889e0) SHA1(b9a5f344685e1d8b5711d8ab426bb886c1008e48) ) /* Check sum: 551B, dated "9/12-'99" */
@@ -5131,7 +5131,7 @@ ROM_START( ecap ) /* Step 2.1 - Proto or Location test - No security dongle */
ROM_END
ROM_START( magtruck ) /* Step 2.1, Sega game ID# is 833-13601-01 (Export), ROM board ID# 834-13600-01 RCS EXP (Export), Security board ID# 837-13599-COM */
- ROM_REGION64_BE( 0x4800000, "user1", 0 ) /* program + data ROMs */
+ ROM_REGION64_BE( 0x8800000, "user1", 0 ) /* program + data ROMs */
// CROM
ROM_LOAD64_WORD_SWAP( "epr-21435.17", 0x000006, 0x200000, CRC(9b169446) SHA1(285cbe5afd439d83c50f0499a878f71b8e5b94e5) )
ROM_LOAD64_WORD_SWAP( "epr-21433.18", 0x000004, 0x200000, CRC(60aa9d76) SHA1(b27741568a4fd0494b2254e468faea569e2d9fef) )
@@ -5261,7 +5261,7 @@ ROM_START( oceanhun ) /* Step 2.0, Sega game ID# is 833-13571, ROM board ID# 8
ROM_END
ROM_START( lamachin ) /* Step 2.0, Sega game ID# is 833-13664, ROM board ID# 834-13665 L.A.MACHINEGUNS, 317-0244-COM security chip (837-13666-COM security board) */
- ROM_REGION64_BE( 0x4800000, "user1", 0 ) /* program + data ROMs */
+ ROM_REGION64_BE( 0x8800000, "user1", 0 ) /* program + data ROMs */
// CROM
ROM_LOAD64_WORD_SWAP( "epr-21483.17", 0x000006, 0x200000, CRC(940637c2) SHA1(89894b603c17d27f57500ec8030eaa7e0e991479) )
ROM_LOAD64_WORD_SWAP( "epr-21484.18", 0x000004, 0x200000, CRC(58102168) SHA1(38dd9a41f653c0a84ac927b476f014c949454ffa) )
@@ -5690,6 +5690,9 @@ DRIVER_INIT_MEMBER(model3_state,scud)
DRIVER_INIT_CALL(model3_15);
/* TODO: network device at 0xC0000000 - FF */
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xf9000000, 0xf90000ff, read64_delegate(FUNC(model3_state::scsi_r),this), write64_delegate(FUNC(model3_state::scsi_w),this));
+
+// UINT32 *rom = (UINT32*)memregion("user1")->base();
+// rom[(0x799de8^4)/4] = 0x00050208; // secret debug menu
}
DRIVER_INIT_MEMBER(model3_state,scudplus)
@@ -5822,6 +5825,15 @@ DRIVER_INIT_MEMBER(model3_state,harley)
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xc0000000, 0xc00fffff, read64_delegate(FUNC(model3_state::network_r),this), write64_delegate(FUNC(model3_state::network_w),this));
}
+DRIVER_INIT_MEMBER(model3_state,harleya)
+{
+ DRIVER_INIT_CALL(model3_20);
+
+ m_network_ram = auto_alloc_array_clear(machine(), UINT64, 0x10000);
+ m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xc0000000, 0xc00fffff, read64_delegate(FUNC(model3_state::network_r),this), write64_delegate(FUNC(model3_state::network_w),this));
+}
+
+
DRIVER_INIT_MEMBER(model3_state,srally2)
{
DRIVER_INIT_CALL(model3_20);
@@ -5937,6 +5949,16 @@ DRIVER_INIT_MEMBER(model3_state,eca)
{
DRIVER_INIT_CALL(model3_20);
DRIVER_INIT_CALL(genprot);
+
+ // base = 0xffc80000
+ UINT32 *rom = (UINT32*)memregion("user1")->base();
+
+ // cabinet network error
+ rom[(0x4a45e4^4)/4] = 0x60000000;
+
+ // this code sometimes gets stuck waiting for [0x1e0064], changed by the sound irq (sound FIFO overflow?)
+ rom[(0x5523b4^4)/4] = 0x60000000;
+ rom[(0x5523d4^4)/4] = 0x60000000;
}
DRIVER_INIT_MEMBER(model3_state,skichamp)
@@ -6002,7 +6024,7 @@ GAME( 1998, vs29815, vs298, model3_15, model3, model3_state, vs29815, ROT0
/* Model 3 Step 2.0 */
GAME( 1997, vs2, 0, model3_20, model3, model3_state, vs2, ROT0, "Sega", "Virtua Striker 2 (Step 2.0)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
GAME( 1997, harley, 0, model3_20, harley, model3_state, harley, ROT0, "Sega", "Harley-Davidson and L.A. Riders (Revision B)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
-GAME( 1997, harleya, harley, model3_20, harley, model3_state, harley, ROT0, "Sega", "Harley-Davidson and L.A. Riders (Revision A)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
+GAME( 1997, harleya, harley, model3_20, harley, model3_state, harleya, ROT0, "Sega", "Harley-Davidson and L.A. Riders (Revision A)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
GAME( 1998, lamachin, 0, model3_20_5881, model3, model3_state, lamachin, ROT0, "Sega", "L.A. Machineguns (Japan)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
GAME( 1998, oceanhun, 0, model3_20_5881, model3, model3_state, oceanhun, ROT0, "Sega", "The Ocean Hunter", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
GAME( 1998, skichamp, 0, model3_20, skichamp, model3_state, skichamp, ROT0, "Sega", "Ski Champ (Japan)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
diff --git a/src/mame/drivers/mouser.c b/src/mame/drivers/mouser.c
index a953d8f4e73..477b2469d5d 100644
--- a/src/mame/drivers/mouser.c
+++ b/src/mame/drivers/mouser.c
@@ -75,9 +75,12 @@ static ADDRESS_MAP_START( mouser_map, AS_PROGRAM, 8, mouser_state )
AM_RANGE(0xb800, 0xb800) AM_READ_PORT("P2") AM_WRITE(mouser_sound_interrupt_w) /* byte to sound cpu */
ADDRESS_MAP_END
+static ADDRESS_MAP_START( decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 8, mouser_state )
+ AM_RANGE(0x0000, 0x5fff) AM_ROM AM_SHARE("decrypted_opcodes")
+ADDRESS_MAP_END
static ADDRESS_MAP_START( mouser_sound_map, AS_PROGRAM, 8, mouser_state )
- AM_RANGE(0x0000, 0x1fff) AM_ROM
+ AM_RANGE(0x0000, 0x0fff) AM_ROM
AM_RANGE(0x2000, 0x23ff) AM_RAM
AM_RANGE(0x3000, 0x3000) AM_READ(mouser_sound_byte_r)
AM_RANGE(0x4000, 0x4000) AM_WRITE(mouser_sound_nmi_clear_w)
@@ -199,6 +202,7 @@ static MACHINE_CONFIG_START( mouser, mouser_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z80, 4000000) /* 4 MHz ? */
MCFG_CPU_PROGRAM_MAP(mouser_map)
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", mouser_state, mouser_nmi_interrupt) /* NMI is masked externally */
MCFG_CPU_ADD("audiocpu", Z80, 4000000) /* ??? */
@@ -232,12 +236,12 @@ MACHINE_CONFIG_END
ROM_START( mouser )
- ROM_REGION( 0x20000, "maincpu", 0 ) /* 64K for data, 64K for encrypted opcodes */
+ ROM_REGION( 0x6000, "maincpu", 0 ) /* 64K for data, 64K for encrypted opcodes */
ROM_LOAD( "m0.5e", 0x0000, 0x2000, CRC(b56e00bc) SHA1(f3b23212590d91f1d19b1c7a98c560fbe5943185) )
ROM_LOAD( "m1.5f", 0x2000, 0x2000, CRC(ae375d49) SHA1(8422f5a4d8560425f0c8612cf6f76029fcfe267c) )
ROM_LOAD( "m2.5j", 0x4000, 0x2000, CRC(ef5817e4) SHA1(5cadc19f20fadf97c95852b280305fe4c75f1d19) )
- ROM_REGION( 0x10000, "audiocpu", 0 )
+ ROM_REGION( 0x1000, "audiocpu", 0 )
ROM_LOAD( "m5.3v", 0x0000, 0x1000, CRC(50705eec) SHA1(252cea3498722318638f0c98ae929463ffd7d0d6) )
ROM_REGION( 0x4000, "gfx1", 0 )
@@ -256,12 +260,12 @@ ROM_END
ROM_START( mouserc )
- ROM_REGION( 0x20000, "maincpu", 0 ) /* 64K for data, 64K for encrypted opcodes */
+ ROM_REGION( 0x6000, "maincpu", 0 ) /* 64K for data, 64K for encrypted opcodes */
ROM_LOAD( "83001.0", 0x0000, 0x2000, CRC(e20f9601) SHA1(f559a470784bda0bee9cab257a548238365acaa6) )
ROM_LOAD( "m1.5f", 0x2000, 0x2000, CRC(ae375d49) SHA1(8422f5a4d8560425f0c8612cf6f76029fcfe267c) ) // 83001.1
ROM_LOAD( "m2.5j", 0x4000, 0x2000, CRC(ef5817e4) SHA1(5cadc19f20fadf97c95852b280305fe4c75f1d19) ) // 83001.2
- ROM_REGION( 0x10000, "audiocpu", 0 )
+ ROM_REGION( 0x1000, "audiocpu", 0 )
ROM_LOAD( "m5.3v", 0x0000, 0x1000, CRC(50705eec) SHA1(252cea3498722318638f0c98ae929463ffd7d0d6) ) // 83001.5
ROM_REGION( 0x4000, "gfx1", 0 )
@@ -284,16 +288,12 @@ DRIVER_INIT_MEMBER(mouser_state,mouser)
/* Decode the opcodes */
offs_t i;
- address_space &space = m_maincpu->space(AS_PROGRAM);
UINT8 *rom = memregion("maincpu")->base();
- UINT8 *decrypted = auto_alloc_array(machine(), UINT8, 0x6000);
UINT8 *table = memregion("user1")->base();
- space.set_decrypted_region(0x0000, 0x5fff, decrypted);
-
for (i = 0; i < 0x6000; i++)
{
- decrypted[i] = table[rom[i]];
+ m_decrypted_opcodes[i] = table[rom[i]];
}
}
diff --git a/src/mame/drivers/mpu4hw.c b/src/mame/drivers/mpu4hw.c
index 33efa218e90..50a7d20ce98 100644
--- a/src/mame/drivers/mpu4hw.c
+++ b/src/mame/drivers/mpu4hw.c
@@ -2394,7 +2394,7 @@ DRIVER_INIT_MEMBER(mpu4_state,m_frkstn)
}
// thanks to Project Amber for descramble information
-void descramble_crystal( UINT8* region, int start, int end, UINT8 extra_xor)
+static void descramble_crystal( UINT8* region, int start, int end, UINT8 extra_xor)
{
for (int i=start;i<end;i++)
{
diff --git a/src/mame/drivers/multigam.c b/src/mame/drivers/multigam.c
index 9419839b329..3030c258208 100644
--- a/src/mame/drivers/multigam.c
+++ b/src/mame/drivers/multigam.c
@@ -379,14 +379,14 @@ WRITE8_MEMBER(multigam_state::multigam_switch_prg_rom)
memcpy(&dst[0x8000], &src[data*0x4000], 0x4000);
memcpy(&dst[0xc000], &src[data*0x4000], 0x4000);
}
-};
+}
WRITE8_MEMBER(multigam_state::multigam_switch_gfx_rom)
{
membank("bank1")->set_base(memregion("gfx1")->base() + (0x2000 * (data & 0x3f)));
set_mirroring(data & 0x40 ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
m_game_gfx_bank = data;
-};
+}
WRITE8_MEMBER(multigam_state::multigam_mapper2_w)
@@ -631,7 +631,7 @@ void multigam_state::multigam_init_mmc3(UINT8 *prg_base, int prg_size, int chr_b
m_multigam3_mmc3_prg_base = prg_base;
m_multigam3_mmc3_chr_bank_base = chr_bank_base;
m_multigam3_mmc3_prg_size = prg_size;
-};
+}
WRITE8_MEMBER(multigam_state::multigm3_mapper2_w)
{
@@ -643,14 +643,14 @@ WRITE8_MEMBER(multigam_state::multigm3_mapper2_w)
{
logerror("Unmapped multigam_mapper2_w: offset = %04X, data = %02X\n", offset, data);
}
-};
+}
WRITE8_MEMBER(multigam_state::multigm3_switch_gfx_rom)
{
set_videorom_bank(0, 8, data & 0x3f, 8);
set_mirroring(data & 0x40 ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
m_game_gfx_bank = data;
-};
+}
WRITE8_MEMBER(multigam_state::multigm3_switch_prg_rom)
{
@@ -682,7 +682,7 @@ WRITE8_MEMBER(multigam_state::multigm3_switch_prg_rom)
memcpy(&dst[0x8000], &src[data*0x4000], 0x4000);
memcpy(&dst[0xc000], &src[data*0x4000], 0x4000);
}
-};
+}
/******************************************************
@@ -889,7 +889,7 @@ void multigam_state::multigam_init_mmc1(UINT8 *prg_base, int prg_size, int chr_b
m_mmc1_chr_bank_base = chr_bank_base;
m_ppu->set_scanline_callback(ppu2c0x_scanline_delegate());
-};
+}
/******************************************************
@@ -1182,7 +1182,7 @@ MACHINE_RESET_MEMBER(multigam_state,multigm3)
address_space &space = m_maincpu->space(AS_PROGRAM);
/* reset the ppu */
multigm3_switch_prg_rom(space, 0, 0x01 );
-};
+}
void multigam_state::machine_start()
{
@@ -1217,7 +1217,7 @@ MACHINE_START_MEMBER(multigam_state,multigm3)
m_ppu->space(AS_PROGRAM).install_read_bank(0x1c00, 0x1fff, "bank9");
set_videorom_bank(0, 8, 0, 8);
-};
+}
MACHINE_START_MEMBER(multigam_state,supergm3)
{
@@ -1430,7 +1430,7 @@ void multigam_state::multigm3_decrypt(UINT8* mem, int memsize, const UINT8* deco
{
mem[i] = decode_nibble[mem[i] & 0x0f] | (decode_nibble[mem[i] >> 4] << 4);
}
-};
+}
DRIVER_INIT_MEMBER(multigam_state,multigm3)
{
@@ -1483,7 +1483,7 @@ DRIVER_INIT_MEMBER(multigam_state,multigmt)
}
multigam_switch_prg_rom(space, 0x0, 0x01);
-};
+}
GAME( 1992, multigam, 0, multigam, multigam, multigam_state, multigam, ROT0, "<unknown>", "Multi Game (set 1)", 0 )
GAME( 1992, multigmb, multigam, multigam, multigam, multigam_state, multigam, ROT0, "<unknown>", "Multi Game (set 2)", 0 )
diff --git a/src/mame/drivers/mustache.c b/src/mame/drivers/mustache.c
index 885c1b2acdf..03d3c02a017 100644
--- a/src/mame/drivers/mustache.c
+++ b/src/mame/drivers/mustache.c
@@ -43,8 +43,7 @@ YM2151:
static ADDRESS_MAP_START( memmap, AS_PROGRAM, 8, mustache_state )
- AM_RANGE(0x0000, 0x7fff) AM_ROM
- AM_RANGE(0x8000, 0xbfff) AM_ROM
+ AM_RANGE(0x0000, 0xbfff) AM_ROM
AM_RANGE(0xc000, 0xcfff) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram")
AM_RANGE(0xd000, 0xd000) AM_DEVWRITE("t5182", t5182_device, sound_irq_w)
AM_RANGE(0xd001, 0xd001) AM_DEVREAD("t5182", t5182_device, sharedram_semaphore_snd_r)
@@ -62,6 +61,11 @@ static ADDRESS_MAP_START( memmap, AS_PROGRAM, 8, mustache_state )
AM_RANGE(0xf000, 0xffff) AM_RAM
ADDRESS_MAP_END
+static ADDRESS_MAP_START( decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 8, mustache_state )
+ AM_RANGE(0x0000, 0x7fff) AM_ROM AM_SHARE("decrypted_opcodes")
+ AM_RANGE(0x8000, 0xbfff) AM_ROM AM_REGION("maincpu", 0x8000)
+ADDRESS_MAP_END
+
/******************************************************************************/
static INPUT_PORTS_START( mustache )
@@ -172,6 +176,7 @@ static MACHINE_CONFIG_START( mustache, mustache_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z80, CPU_CLOCK)
MCFG_CPU_PROGRAM_MAP(memmap)
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", mustache_state, scanline, "screen", 0, 1)
MCFG_DEVICE_ADD("t5182", T5182, 0)
@@ -191,8 +196,6 @@ static MACHINE_CONFIG_START( mustache, mustache_state )
MCFG_PALETTE_INIT_OWNER(mustache_state, mustache)
/* sound hardware */
- MCFG_DEVICE_ADD("seibu_sound", SEIBU_SOUND, 0) // for seibu_sound_decrypt on the MAIN cpu (not sound)
-
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_YM2151_ADD("ymsnd", YM_CLOCK)
@@ -272,7 +275,7 @@ DRIVER_INIT_MEMBER(mustache_state,mustache)
for (i = 0; i < 2*G2; i++)
gfx2[i] = buf[BITSWAP24(i,23,22,21,20,19,18,17,16,15,12,11,10,9,8,7,6,5,4,13,14,3,2,1,0)];
- m_cpu_decrypt->decrypt("maincpu",0x8000);
+ seibu_sound_device::apply_decrypt(memregion("maincpu")->base(), m_decrypted_opcodes, 0x8000);
}
diff --git a/src/mame/drivers/namcos86.c b/src/mame/drivers/namcos86.c
index 7c3c2cce60c..421b639eef4 100644
--- a/src/mame/drivers/namcos86.c
+++ b/src/mame/drivers/namcos86.c
@@ -183,13 +183,11 @@ TODO:
WRITE8_MEMBER(namcos86_state::bankswitch1_w)
{
- UINT8 *base = memregion("cpu1")->base() + 0x10000;
-
/* if the ROM expansion module is available, don't do anything. This avoids conflict */
/* with bankswitch1_ext_w() in wndrmomo */
if (memregion("user1")->base()) return;
- membank("bank1")->set_base(base + ((data & 0x03) * 0x2000));
+ membank("bank1")->set_entry(data & 0x03);
}
WRITE8_MEMBER(namcos86_state::bankswitch1_ext_w)
@@ -198,14 +196,12 @@ WRITE8_MEMBER(namcos86_state::bankswitch1_ext_w)
if (base == 0) return;
- membank("bank1")->set_base(base + ((data & 0x1f) * 0x2000));
+ membank("bank1")->set_entry(data & 0x1f);
}
WRITE8_MEMBER(namcos86_state::bankswitch2_w)
{
- UINT8 *base = memregion("cpu2")->base() + 0x10000;
-
- membank("bank2")->set_base(base + ((data & 0x03) * 0x2000));
+ membank("bank2")->set_entry(data & 0x03);
}
/* Stubs to pass the correct Dip Switch setup to the MCU */
@@ -222,7 +218,6 @@ READ8_MEMBER(namcos86_state::dsw0_r)
rlo |= ( ioport("DSWB")->read() & 0x04 ) >> 1;
rlo |= ( ioport("DSWB")->read() & 0x10 ) >> 2;
rlo |= ( ioport("DSWB")->read() & 0x40 ) >> 3;
-
return rhi | rlo;
}
@@ -276,14 +271,14 @@ WRITE8_MEMBER(namcos86_state::watchdog2_w)
}
-WRITE8_MEMBER(namcos86_state::namcos86_coin_w)
+WRITE8_MEMBER(namcos86_state::coin_w)
{
coin_lockout_global_w(machine(), data & 1);
coin_counter_w(machine(), 0,~data & 2);
coin_counter_w(machine(), 1,~data & 4);
}
-WRITE8_MEMBER(namcos86_state::namcos86_led_w)
+WRITE8_MEMBER(namcos86_state::led_w)
{
set_led_status(machine(), 0,data & 0x08);
set_led_status(machine(), 1,data & 0x10);
@@ -320,23 +315,27 @@ WRITE8_MEMBER(namcos86_state::cus115_w)
}
}
-
-void namcos86_state::machine_reset()
+void namcos86_state::machine_start()
{
- UINT8 *base = memregion("cpu1")->base() + 0x10000;
+ if (!memregion("user1")->base())
+ membank("bank1")->configure_entries(0, 4, memregion("cpu1")->base(), 0x2000);
+ else
+ membank("bank1")->configure_entries(0, 32, memregion("user1")->base(), 0x2000);
- membank("bank1")->set_base(base);
-}
+ if (membank("bank2"))
+ membank("bank2")->configure_entries(0, 4, memregion("cpu2")->base(), 0x2000);
+ save_item(NAME(m_wdog));
+}
static ADDRESS_MAP_START( cpu1_map, AS_PROGRAM, 8, namcos86_state )
- AM_RANGE(0x0000, 0x1fff) AM_READWRITE(rthunder_videoram1_r,rthunder_videoram1_w) AM_SHARE("videoram1")
- AM_RANGE(0x2000, 0x3fff) AM_READWRITE(rthunder_videoram2_r,rthunder_videoram2_w) AM_SHARE("videoram2")
+ AM_RANGE(0x0000, 0x1fff) AM_RAM AM_WRITE(videoram1_w) AM_SHARE("videoram1")
+ AM_RANGE(0x2000, 0x3fff) AM_RAM AM_WRITE(videoram2_w) AM_SHARE("videoram2")
AM_RANGE(0x4000, 0x43ff) AM_DEVREADWRITE("namco", namco_cus30_device, namcos1_cus30_r, namcos1_cus30_w) /* PSG device, shared RAM */
- AM_RANGE(0x4000, 0x5fff) AM_READWRITE(rthunder_spriteram_r,rthunder_spriteram_w)
+ AM_RANGE(0x4000, 0x5fff) AM_RAM AM_WRITE(spriteram_w) AM_SHARE("spriteram")
AM_RANGE(0x6000, 0x7fff) AM_ROMBANK("bank1")
AM_RANGE(0x8000, 0xffff) AM_ROM
@@ -346,72 +345,137 @@ static ADDRESS_MAP_START( cpu1_map, AS_PROGRAM, 8, namcos86_state )
AM_RANGE(0x8000, 0x8000) AM_WRITE(watchdog1_w)
AM_RANGE(0x8400, 0x8400) AM_WRITE(int_ack1_w) /* IRQ acknowledge */
- AM_RANGE(0x8800, 0x8fff) AM_WRITE(rthunder_tilebank_select_w)
+ AM_RANGE(0x8800, 0x8fff) AM_WRITE(tilebank_select_w)
- AM_RANGE(0x9000, 0x9002) AM_WRITE(rthunder_scroll0_w) /* scroll + priority */
+ AM_RANGE(0x9000, 0x9002) AM_WRITE(scroll0_w) /* scroll + priority */
AM_RANGE(0x9003, 0x9003) AM_WRITE(bankswitch1_w)
- AM_RANGE(0x9004, 0x9006) AM_WRITE(rthunder_scroll1_w) /* scroll + priority */
+ AM_RANGE(0x9004, 0x9006) AM_WRITE(scroll1_w) /* scroll + priority */
- AM_RANGE(0x9400, 0x9402) AM_WRITE(rthunder_scroll2_w) /* scroll + priority */
+ AM_RANGE(0x9400, 0x9402) AM_WRITE(scroll2_w) /* scroll + priority */
// { 0x9403, 0x9403 } sub CPU rom bank select would be here
- AM_RANGE(0x9404, 0x9406) AM_WRITE(rthunder_scroll3_w) /* scroll + priority */
+ AM_RANGE(0x9404, 0x9406) AM_WRITE(scroll3_w) /* scroll + priority */
+
+ AM_RANGE(0xa000, 0xa000) AM_WRITE(backcolor_w)
+ADDRESS_MAP_END
+
+
+// skykiddx and hopmappy cpu2 programs do nothing but sit in a loop resetting the watchdog
+// shared RAM is presumably mapped somewhere, but it's impossible to infer from program behaviour
+static ADDRESS_MAP_START( hopmappy_cpu2_map, AS_PROGRAM, 8, namcos86_state )
+ AM_RANGE(0x8000, 0xffff) AM_ROM
+ AM_RANGE(0x9000, 0x9000) AM_WRITE(watchdog2_w)
+ AM_RANGE(0x9400, 0x9400) AM_WRITE(int_ack2_w)
+ADDRESS_MAP_END
+
+static ADDRESS_MAP_START( roishtar_cpu2_map, AS_PROGRAM, 8, namcos86_state )
+ AM_RANGE(0x0000, 0x1fff) AM_RAM_WRITE(spriteram_w) AM_SHARE("spriteram")
+ AM_RANGE(0x4000, 0x5fff) AM_RAM_WRITE(videoram2_w) AM_SHARE("videoram2")
+ AM_RANGE(0x6000, 0x7fff) AM_RAM_WRITE(videoram1_w) AM_SHARE("videoram1")
+ AM_RANGE(0x8000, 0xffff) AM_ROM
+ AM_RANGE(0xa000, 0xa000) AM_WRITE(watchdog2_w)
+ AM_RANGE(0xb000, 0xb000) AM_WRITE(int_ack2_w) // IRQ acknowledge
+ADDRESS_MAP_END
- AM_RANGE(0xa000, 0xa000) AM_WRITE(rthunder_backcolor_w)
+static ADDRESS_MAP_START( genpeitd_cpu2_map, AS_PROGRAM, 8, namcos86_state )
+ AM_RANGE(0x0000, 0x1fff) AM_RAM_WRITE(videoram1_w) AM_SHARE("videoram1")
+ AM_RANGE(0x2000, 0x3fff) AM_RAM_WRITE(videoram2_w) AM_SHARE("videoram2")
+ AM_RANGE(0x4000, 0x5fff) AM_RAM_WRITE(spriteram_w) AM_SHARE("spriteram")
+ AM_RANGE(0x8000, 0xffff) AM_ROM
+ AM_RANGE(0xb000, 0xb000) AM_WRITE(watchdog2_w)
+ AM_RANGE(0x8800, 0x8800) AM_WRITE(int_ack2_w) // IRQ acknowledge
+ADDRESS_MAP_END
+
+static ADDRESS_MAP_START( rthunder_cpu2_map, AS_PROGRAM, 8, namcos86_state )
+ AM_RANGE(0x0000, 0x1fff) AM_RAM_WRITE(spriteram_w) AM_SHARE("spriteram")
+ AM_RANGE(0x2000, 0x3fff) AM_RAM_WRITE(videoram1_w) AM_SHARE("videoram1")
+ AM_RANGE(0x4000, 0x5fff) AM_RAM_WRITE(videoram2_w) AM_SHARE("videoram2")
+ AM_RANGE(0x6000, 0x7fff) AM_ROMBANK("bank2")
+ AM_RANGE(0x8000, 0xffff) AM_ROM
+ AM_RANGE(0x8000, 0x8000) AM_WRITE(watchdog2_w)
+ AM_RANGE(0x8800, 0x8800) AM_WRITE(int_ack2_w) // IRQ acknowledge
+// { 0xd800, 0xd802 } layer 2 scroll registers would be here
+ AM_RANGE(0xd803, 0xd803) AM_WRITE(bankswitch2_w)
+// { 0xd804, 0xd806 } layer 3 scroll registers would be here
+ADDRESS_MAP_END
+
+static ADDRESS_MAP_START( wndrmomo_cpu2_map, AS_PROGRAM, 8, namcos86_state )
+ AM_RANGE(0x2000, 0x3fff) AM_RAM_WRITE(spriteram_w) AM_SHARE("spriteram")
+ AM_RANGE(0x4000, 0x5fff) AM_RAM_WRITE(videoram1_w) AM_SHARE("videoram1")
+ AM_RANGE(0x6000, 0x7fff) AM_RAM_WRITE(videoram2_w) AM_SHARE("videoram2")
+ AM_RANGE(0x8000, 0xffff) AM_ROM
+ AM_RANGE(0xc000, 0xc000) AM_WRITE(watchdog2_w)
+ AM_RANGE(0xc800, 0xc800) AM_WRITE(int_ack2_w) // IRQ acknowledge
+ADDRESS_MAP_END
+
+
+static ADDRESS_MAP_START( common_mcu_map, AS_PROGRAM, 8, namcos86_state )
+ AM_RANGE(0x0000, 0x001f) AM_DEVREADWRITE("mcu", hd63701_cpu_device, m6801_io_r,m6801_io_w)
+ AM_RANGE(0x0080, 0x00ff) AM_RAM
+ AM_RANGE(0x1000, 0x13ff) AM_DEVREADWRITE("namco", namco_cus30_device, namcos1_cus30_r, namcos1_cus30_w)
+ AM_RANGE(0x1400, 0x1fff) AM_RAM
+ AM_RANGE(0x8000, 0xbfff) AM_ROM // external ROM
+ AM_RANGE(0xf000, 0xffff) AM_ROM // internal ROM
+ADDRESS_MAP_END
+
+static ADDRESS_MAP_START( hopmappy_mcu_map, AS_PROGRAM, 8, namcos86_state )
+ AM_IMPORT_FROM(common_mcu_map)
+ AM_RANGE(0x2000, 0x2001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
+ AM_RANGE(0x2020, 0x2020) AM_READ_PORT("IN0")
+ AM_RANGE(0x2021, 0x2021) AM_READ_PORT("IN1")
+ AM_RANGE(0x2030, 0x2030) AM_READ(dsw0_r)
+ AM_RANGE(0x2031, 0x2031) AM_READ(dsw1_r)
+ AM_RANGE(0x8000, 0x8000) AM_WRITENOP // ??? written (not always) at end of interrupt
+ AM_RANGE(0x8800, 0x8800) AM_WRITENOP // ??? written (not always) at end of interrupt
ADDRESS_MAP_END
+static ADDRESS_MAP_START( roishtar_mcu_map, AS_PROGRAM, 8, namcos86_state )
+ AM_IMPORT_FROM(common_mcu_map)
+ AM_RANGE(0x2000, 0x3fff) AM_ROM
+ AM_RANGE(0x6000, 0x6001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
+ AM_RANGE(0x6020, 0x6020) AM_READ_PORT("IN0")
+ AM_RANGE(0x6021, 0x6021) AM_READ_PORT("IN1")
+ AM_RANGE(0x6030, 0x6030) AM_READ(dsw0_r)
+ AM_RANGE(0x6031, 0x6031) AM_READ(dsw1_r)
+ AM_RANGE(0x8000, 0x8000) AM_WRITENOP // ??? written (not always) at end of interrupt
+ AM_RANGE(0x9800, 0x9800) AM_WRITENOP // ??? written (not always) at end of interrupt
+ADDRESS_MAP_END
-#define CPU2_MEMORY(NAME,ADDR_SPRITE,ADDR_VIDEO1,ADDR_VIDEO2,ADDR_ROM,ADDR_BANK,ADDR_WDOG,ADDR_INT) \
-static ADDRESS_MAP_START( NAME##_cpu2_map, AS_PROGRAM, 8, namcos86_state ) \
- AM_RANGE(ADDR_SPRITE+0x0000, ADDR_SPRITE+0x1fff) AM_READWRITE(rthunder_spriteram_r,rthunder_spriteram_w) AM_SHARE("spriteram") \
- AM_RANGE(ADDR_VIDEO1+0x0000, ADDR_VIDEO1+0x1fff) AM_READWRITE(rthunder_videoram1_r,rthunder_videoram1_w) \
- AM_RANGE(ADDR_VIDEO2+0x0000, ADDR_VIDEO2+0x1fff) AM_READWRITE(rthunder_videoram2_r,rthunder_videoram2_w) \
- AM_RANGE(ADDR_ROM+0x0000, ADDR_ROM+0x1fff) AM_ROMBANK("bank2") \
- AM_RANGE(0x8000, 0xffff) AM_ROM \
-/* { ADDR_BANK+0x00, ADDR_BANK+0x02 } layer 2 scroll registers would be here */ \
- AM_RANGE(ADDR_BANK+0x03, ADDR_BANK+0x03) AM_WRITE(bankswitch2_w) \
-/* { ADDR_BANK+0x04, ADDR_BANK+0x06 } layer 3 scroll registers would be here */ \
- AM_RANGE(ADDR_WDOG, ADDR_WDOG) AM_WRITE(watchdog2_w) \
- AM_RANGE(ADDR_INT, ADDR_INT) AM_WRITE(int_ack2_w) /* IRQ acknowledge */ \
+// are these three actually different, or are the I/O ports simply mirrored from 0x2000-0x3fff?
+static ADDRESS_MAP_START( genpeitd_mcu_map, AS_PROGRAM, 8, namcos86_state )
+ AM_IMPORT_FROM(common_mcu_map)
+ AM_RANGE(0x2800, 0x2801) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
+ AM_RANGE(0x2820, 0x2820) AM_READ_PORT("IN0")
+ AM_RANGE(0x2821, 0x2821) AM_READ_PORT("IN1")
+ AM_RANGE(0x2830, 0x2830) AM_READ(dsw0_r)
+ AM_RANGE(0x2831, 0x2831) AM_READ(dsw1_r)
+ AM_RANGE(0x4000, 0x7fff) AM_ROM
+ AM_RANGE(0xa000, 0xa000) AM_WRITENOP // ??? written (not always) at end of interrupt
+ AM_RANGE(0xa800, 0xa800) AM_WRITENOP // ??? written (not always) at end of interrupt
ADDRESS_MAP_END
-#define UNUSED 0x4000
-/* SPRITE VIDEO1 VIDEO2 ROM BANK WDOG IRQACK */
-CPU2_MEMORY( hopmappy, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, 0x9000, UNUSED )
-CPU2_MEMORY( skykiddx, UNUSED, UNUSED, UNUSED, UNUSED, UNUSED, 0x9000, 0x9400 )
-CPU2_MEMORY( roishtar, 0x0000, 0x6000, 0x4000, UNUSED, UNUSED, 0xa000, 0xb000 )
-CPU2_MEMORY( genpeitd, 0x4000, 0x0000, 0x2000, UNUSED, UNUSED, 0xb000, 0x8800 )
-CPU2_MEMORY( rthunder, 0x0000, 0x2000, 0x4000, 0x6000, 0xd800, 0x8000, 0x8800 )
-CPU2_MEMORY( wndrmomo, 0x2000, 0x4000, 0x6000, UNUSED, UNUSED, 0xc000, 0xc800 )
-#undef UNUSED
-
-
-#define MCU_MEMORY(NAME,ADDR_LOWROM,ADDR_INPUT,ADDR_UNK1,ADDR_UNK2) \
-static ADDRESS_MAP_START( NAME##_mcu_map, AS_PROGRAM, 8, namcos86_state ) \
- AM_RANGE(0x0000, 0x001f) AM_DEVREADWRITE("mcu", hd63701_cpu_device, m6801_io_r,m6801_io_w) \
- AM_RANGE(0x0080, 0x00ff) AM_RAM \
- AM_RANGE(0x1000, 0x13ff) AM_DEVREADWRITE("namco", namco_cus30_device, namcos1_cus30_r, namcos1_cus30_w) /* PSG device, shared RAM */ \
- AM_RANGE(0x1400, 0x1fff) AM_RAM \
- AM_RANGE(ADDR_INPUT+0x00, ADDR_INPUT+0x01) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write) \
- AM_RANGE(ADDR_INPUT+0x20, ADDR_INPUT+0x20) AM_READ_PORT("IN0") \
- AM_RANGE(ADDR_INPUT+0x21, ADDR_INPUT+0x21) AM_READ_PORT("IN1") \
- AM_RANGE(ADDR_INPUT+0x30, ADDR_INPUT+0x30) AM_READ(dsw0_r) \
- AM_RANGE(ADDR_INPUT+0x31, ADDR_INPUT+0x31) AM_READ(dsw1_r) \
- AM_RANGE(ADDR_LOWROM, ADDR_LOWROM+0x3fff) AM_ROM \
- AM_RANGE(0x8000, 0xbfff) AM_ROM \
- AM_RANGE(0xf000, 0xffff) AM_ROM \
- AM_RANGE(ADDR_UNK1, ADDR_UNK1) AM_WRITENOP /* ??? written (not always) at end of interrupt */ \
- AM_RANGE(ADDR_UNK2, ADDR_UNK2) AM_WRITENOP /* ??? written (not always) at end of interrupt */ \
+static ADDRESS_MAP_START( rthunder_mcu_map, AS_PROGRAM, 8, namcos86_state )
+ AM_IMPORT_FROM(common_mcu_map)
+ AM_RANGE(0x2000, 0x2001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
+ AM_RANGE(0x2020, 0x2020) AM_READ_PORT("IN0")
+ AM_RANGE(0x2021, 0x2021) AM_READ_PORT("IN1")
+ AM_RANGE(0x2030, 0x2030) AM_READ(dsw0_r)
+ AM_RANGE(0x2031, 0x2031) AM_READ(dsw1_r)
+ AM_RANGE(0x4000, 0x7fff) AM_ROM
+ AM_RANGE(0xb000, 0xb000) AM_WRITENOP // ??? written (not always) at end of interrupt
+ AM_RANGE(0xb800, 0xb800) AM_WRITENOP // ??? written (not always) at end of interrupt
ADDRESS_MAP_END
-#define UNUSED 0x4000
-/* LOWROM INPUT UNK1 UNK2 */
-MCU_MEMORY( hopmappy, UNUSED, 0x2000, 0x8000, 0x8800 )
-MCU_MEMORY( skykiddx, UNUSED, 0x2000, 0x8000, 0x8800 )
-MCU_MEMORY( roishtar, 0x0000, 0x6000, 0x8000, 0x9800 )
-MCU_MEMORY( genpeitd, 0x4000, 0x2800, 0xa000, 0xa800 )
-MCU_MEMORY( rthunder, 0x4000, 0x2000, 0xb000, 0xb800 )
-MCU_MEMORY( wndrmomo, 0x4000, 0x3800, 0xc000, 0xc800 )
-#undef UNUSED
+static ADDRESS_MAP_START( wndrmomo_mcu_map, AS_PROGRAM, 8, namcos86_state )
+ AM_IMPORT_FROM(common_mcu_map)
+ AM_RANGE(0x3800, 0x3801) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
+ AM_RANGE(0x3820, 0x3820) AM_READ_PORT("IN0")
+ AM_RANGE(0x3821, 0x3821) AM_READ_PORT("IN1")
+ AM_RANGE(0x3830, 0x3830) AM_READ(dsw0_r)
+ AM_RANGE(0x3831, 0x3831) AM_READ(dsw1_r)
+ AM_RANGE(0x4000, 0x7fff) AM_ROM
+ AM_RANGE(0xc000, 0xc000) AM_WRITENOP // ??? written (not always) at end of interrupt
+ AM_RANGE(0xc800, 0xc800) AM_WRITENOP // ??? written (not always) at end of interrupt
+ADDRESS_MAP_END
READ8_MEMBER(namcos86_state::readFF)
@@ -422,8 +486,8 @@ READ8_MEMBER(namcos86_state::readFF)
static ADDRESS_MAP_START( mcu_port_map, AS_IO, 8, namcos86_state )
AM_RANGE(M6801_PORT1, M6801_PORT1) AM_READ_PORT("IN2")
AM_RANGE(M6801_PORT2, M6801_PORT2) AM_READ(readFF) /* leds won't work otherwise */
- AM_RANGE(M6801_PORT1, M6801_PORT1) AM_WRITE(namcos86_coin_w)
- AM_RANGE(M6801_PORT2, M6801_PORT2) AM_WRITE(namcos86_led_w)
+ AM_RANGE(M6801_PORT1, M6801_PORT1) AM_WRITE(coin_w)
+ AM_RANGE(M6801_PORT2, M6801_PORT2) AM_WRITE(led_w)
ADDRESS_MAP_END
@@ -1001,8 +1065,8 @@ static MACHINE_CONFIG_START( hopmappy, namcos86_state )
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_RAW_PARAMS(XTAL_49_152MHz/8, 384, 3+8*8, 3+44*8, 264, 2*8, 30*8)
- MCFG_SCREEN_UPDATE_DRIVER(namcos86_state, screen_update_namcos86)
- MCFG_SCREEN_VBLANK_DRIVER(namcos86_state, screen_eof_namcos86)
+ MCFG_SCREEN_UPDATE_DRIVER(namcos86_state, screen_update)
+ MCFG_SCREEN_VBLANK_DRIVER(namcos86_state, screen_eof)
MCFG_SCREEN_PALETTE("palette")
MCFG_GFXDECODE_ADD("gfxdecode", "palette", namcos86)
@@ -1022,17 +1086,6 @@ static MACHINE_CONFIG_START( hopmappy, namcos86_state )
MACHINE_CONFIG_END
-static MACHINE_CONFIG_DERIVED( skykiddx, hopmappy )
-
- /* basic machine hardware */
- MCFG_CPU_MODIFY("cpu2")
- MCFG_CPU_PROGRAM_MAP(skykiddx_cpu2_map)
-
- MCFG_CPU_MODIFY("mcu")
- MCFG_CPU_PROGRAM_MAP(skykiddx_mcu_map)
-MACHINE_CONFIG_END
-
-
static MACHINE_CONFIG_DERIVED( roishtar, hopmappy )
/* basic machine hardware */
@@ -1097,13 +1150,13 @@ MACHINE_CONFIG_END
***************************************************************************/
ROM_START( skykiddx )
- ROM_REGION( 0x18000, "cpu1", 0 )
+ ROM_REGION( 0x10000, "cpu1", 0 )
+ ROM_LOAD( "sk3_2.9d", 0x00000, 0x8000, CRC(74b8f8e2) SHA1(0c9f0a283c764d5db59abea17a7f3285718b4501) )
ROM_LOAD( "sk3_1b.9c", 0x08000, 0x8000, CRC(767b3514) SHA1(7b85e520e56924235d1f4987333f183c914fafc1) )
- ROM_LOAD( "sk3_2.9d", 0x10000, 0x8000, CRC(74b8f8e2) SHA1(0c9f0a283c764d5db59abea17a7f3285718b4501) )
- ROM_REGION( 0x18000, "cpu2", 0 )
- ROM_LOAD( "sk3_3.12c", 0x8000, 0x8000, CRC(6d1084c4) SHA1(0045e01cbeb750c50a561420f1577de8cd881894) )
+ ROM_REGION( 0x10000, "cpu2", 0 )
/* 12d empty */
+ ROM_LOAD( "sk3_3.12c", 0x8000, 0x8000, CRC(6d1084c4) SHA1(0045e01cbeb750c50a561420f1577de8cd881894) )
ROM_REGION( 0x0c000, "gfx1", 0 )
ROM_LOAD( "sk3_9.7r", 0x00000, 0x08000, CRC(48675b17) SHA1(434babcf5454364a17e529daae16e6f623ca75dd) ) /* plane 1,2 */
@@ -1133,13 +1186,13 @@ ROM_START( skykiddx )
ROM_END
ROM_START( skykiddxo )
- ROM_REGION( 0x18000, "cpu1", 0 )
+ ROM_REGION( 0x10000, "cpu1", 0 )
+ ROM_LOAD( "sk3_2.9d", 0x00000, 0x8000, CRC(74b8f8e2) SHA1(0c9f0a283c764d5db59abea17a7f3285718b4501) )
ROM_LOAD( "sk3_1.9c", 0x08000, 0x8000, CRC(5722a291) SHA1(0b3ca2585bf5c18214c1337dce8f92027e9d78c2) )
- ROM_LOAD( "sk3_2.9d", 0x10000, 0x8000, CRC(74b8f8e2) SHA1(0c9f0a283c764d5db59abea17a7f3285718b4501) )
- ROM_REGION( 0x18000, "cpu2", 0 )
- ROM_LOAD( "sk3_3.12c", 0x8000, 0x8000, CRC(6d1084c4) SHA1(0045e01cbeb750c50a561420f1577de8cd881894) )
+ ROM_REGION( 0x10000, "cpu2", 0 )
/* 12d empty */
+ ROM_LOAD( "sk3_3.12c", 0x8000, 0x8000, CRC(6d1084c4) SHA1(0045e01cbeb750c50a561420f1577de8cd881894) )
ROM_REGION( 0x0c000, "gfx1", 0 )
ROM_LOAD( "sk3_9.7r", 0x00000, 0x08000, CRC(48675b17) SHA1(434babcf5454364a17e529daae16e6f623ca75dd) ) /* plane 1,2 */
@@ -1169,13 +1222,13 @@ ROM_START( skykiddxo )
ROM_END
ROM_START( hopmappy )
- ROM_REGION( 0x18000, "cpu1", 0 )
- ROM_LOAD( "hm1_1.9c", 0x08000, 0x8000, CRC(1a83914e) SHA1(6cb96b2518f4b867e20bd5d31ac6913d09c95f06) )
+ ROM_REGION( 0x10000, "cpu1", 0 )
/* 9d empty */
+ ROM_LOAD( "hm1_1.9c", 0x08000, 0x8000, CRC(1a83914e) SHA1(6cb96b2518f4b867e20bd5d31ac6913d09c95f06) )
- ROM_REGION( 0x18000, "cpu2", 0 )
- ROM_LOAD( "hm1_2.12c", 0xc000, 0x4000, CRC(c46cda65) SHA1(1131b4aa0a446569e1eb9f59964548058c7993e2) )
+ ROM_REGION( 0x10000, "cpu2", 0 )
/* 12d empty */
+ ROM_LOAD( "hm1_2.12c", 0xc000, 0x4000, CRC(c46cda65) SHA1(1131b4aa0a446569e1eb9f59964548058c7993e2) )
ROM_REGION( 0x06000, "gfx1", 0 )
ROM_LOAD( "hm1_6.7r", 0x00000, 0x04000, CRC(fd0e8887) SHA1(b76737d22bb1c1ae4d700ea6796e8d91f6ffa275) ) /* plane 1,2 */
@@ -1204,13 +1257,13 @@ ROM_START( hopmappy )
ROM_END
ROM_START( roishtar )
- ROM_REGION( 0x18000, "cpu1", 0 )
+ ROM_REGION( 0x10000, "cpu1", 0 )
+ ROM_LOAD( "ri1_2.9d", 0x04000, 0x2000, CRC(fcd58d91) SHA1(e7b6d7afd7cf6c374ee90d6499ea0f205e742b21) )
ROM_LOAD( "ri1_1c.9c", 0x08000, 0x8000, CRC(14acbacb) SHA1(3c6130f9e5a4ba84be0cc3547c1086707ee3b8e9) )
- ROM_LOAD( "ri1_2.9d", 0x14000, 0x2000, CRC(fcd58d91) SHA1(e7b6d7afd7cf6c374ee90d6499ea0f205e742b21) )
- ROM_REGION( 0x18000, "cpu2", 0 )
- ROM_LOAD( "ri1_3.12c", 0x8000, 0x8000, CRC(a39829f7) SHA1(e08114d5154367a3cc36f1485253f18044a1888d) )
+ ROM_REGION( 0x10000, "cpu2", 0 )
/* 12d empty */
+ ROM_LOAD( "ri1_3.12c", 0x8000, 0x8000, CRC(a39829f7) SHA1(e08114d5154367a3cc36f1485253f18044a1888d) )
ROM_REGION( 0x06000, "gfx1", 0 )
ROM_LOAD( "ri1_14.7r", 0x00000, 0x04000, CRC(de8154b4) SHA1(70a65e4656cf9fcf5c54e84c628ec95393e856fb) ) /* plane 1,2 */
@@ -1246,13 +1299,13 @@ ROM_START( roishtar )
ROM_END
ROM_START( genpeitd )
- ROM_REGION( 0x18000, "cpu1", 0 )
- ROM_LOAD( "gt1_1b.9c", 0x08000, 0x8000, CRC(75396194) SHA1(2a526064fb91b2796c913f3050867352ac63e643) )
+ ROM_REGION( 0x10000, "cpu1", 0 )
/* 9d empty */
+ ROM_LOAD( "gt1_1b.9c", 0x08000, 0x8000, CRC(75396194) SHA1(2a526064fb91b2796c913f3050867352ac63e643) )
- ROM_REGION( 0x18000, "cpu2", 0 )
- ROM_LOAD( "gt1_2.12c", 0xc000, 0x4000, CRC(302f2cb6) SHA1(19c39afb7d49d80aeaaf67a837cd02bfd3d64fbd) )
+ ROM_REGION( 0x10000, "cpu2", 0 )
/* 12d empty */
+ ROM_LOAD( "gt1_2.12c", 0xc000, 0x4000, CRC(302f2cb6) SHA1(19c39afb7d49d80aeaaf67a837cd02bfd3d64fbd) )
ROM_REGION( 0x18000, "gfx1", 0 )
ROM_LOAD( "gt1_7.7r", 0x00000, 0x10000, CRC(ea77a211) SHA1(32b8ae11723b6223b42225805acd0dcab65516a5) ) /* plane 1,2 */
@@ -1297,13 +1350,13 @@ ROM_START( genpeitd )
ROM_END
ROM_START( rthunder )
- ROM_REGION( 0x18000, "cpu1", 0 )
- ROM_LOAD( "rt3_1b.9c", 0x8000, 0x8000, CRC(7d252a1b) SHA1(cb92709e94eb273b3ce44c55cd252170ad1017f4) )
+ ROM_REGION( 0x10000, "cpu1", 0 )
/* 9d empty */
+ ROM_LOAD( "rt3_1b.9c", 0x8000, 0x8000, CRC(7d252a1b) SHA1(cb92709e94eb273b3ce44c55cd252170ad1017f4) )
- ROM_REGION( 0x18000, "cpu2", 0 )
+ ROM_REGION( 0x10000, "cpu2", 0 )
+ ROM_LOAD( "rt3_3.12d", 0x00000, 0x8000, CRC(a13f601c) SHA1(8987174e364d20eeab706c3e0d4e0d3c2b96723c) )
ROM_LOAD( "rt3_2b.12c", 0x08000, 0x8000, CRC(a7ea46ee) SHA1(52e8757aacb4e01f8432125729e2323c48ebc4f5) )
- ROM_LOAD( "rt3_3.12d", 0x10000, 0x8000, CRC(a13f601c) SHA1(8987174e364d20eeab706c3e0d4e0d3c2b96723c) )
ROM_REGION( 0x18000, "gfx1", 0 )
ROM_LOAD( "rt1_7.7r", 0x00000, 0x10000, CRC(a85efa39) SHA1(1ed63b421a93960668cb4558c1ca1b3c86b1f6be) ) /* plane 1,2 */
@@ -1348,13 +1401,13 @@ ROM_START( rthunder )
ROM_END
ROM_START( rthunder2 )
- ROM_REGION( 0x18000, "cpu1", 0 )
- ROM_LOAD( "rt2_1.9c", 0x8000, 0x8000, CRC(7eaa9fdf) SHA1(aecc338b025eb5cd48c26ffb2c658d03478361c8) )
+ ROM_REGION( 0x10000, "cpu1", 0 )
/* 9d empty */
+ ROM_LOAD( "rt2_1.9c", 0x8000, 0x8000, CRC(7eaa9fdf) SHA1(aecc338b025eb5cd48c26ffb2c658d03478361c8) )
- ROM_REGION( 0x18000, "cpu2", 0 )
+ ROM_REGION( 0x10000, "cpu2", 0 )
+ ROM_LOAD( "rt2_3.12d", 0x00000, 0x8000, CRC(f5d439d8) SHA1(87c610913e86c2dca5ec64f7a96ef3a0ddfe5968) )
ROM_LOAD( "rt2_2.12c", 0x08000, 0x8000, CRC(1c0e29e0) SHA1(17f6981d10414d14535835919bb05413498421f1) )
- ROM_LOAD( "rt2_3.12d", 0x10000, 0x8000, CRC(f5d439d8) SHA1(87c610913e86c2dca5ec64f7a96ef3a0ddfe5968) )
ROM_REGION( 0x18000, "gfx1", 0 )
ROM_LOAD( "rt1_7.7r", 0x00000, 0x10000, CRC(a85efa39) SHA1(1ed63b421a93960668cb4558c1ca1b3c86b1f6be) ) /* plane 1,2 */
@@ -1399,13 +1452,13 @@ ROM_START( rthunder2 )
ROM_END
ROM_START( rthunder1 )
- ROM_REGION( 0x18000, "cpu1", 0 )
- ROM_LOAD( "r1", 0x8000, 0x8000, CRC(6f8c1252) SHA1(586f2e33dd16f31131e4ae9423d639fdc6555c9c) )
+ ROM_REGION( 0x10000, "cpu1", 0 )
/* 9d empty */
+ ROM_LOAD( "r1", 0x8000, 0x8000, CRC(6f8c1252) SHA1(586f2e33dd16f31131e4ae9423d639fdc6555c9c) )
- ROM_REGION( 0x18000, "cpu2", 0 )
+ ROM_REGION( 0x10000, "cpu2", 0 )
+ ROM_LOAD( "r3", 0x00000, 0x8000, CRC(aaa82885) SHA1(fc2bec3cf7e2de5f90174a2ed3bacfa94b6819f4) )
ROM_LOAD( "r2", 0x08000, 0x8000, CRC(f22a03d8) SHA1(5b81fc82813978d5cb69402be72b9ccc585fa1d0) )
- ROM_LOAD( "r3", 0x10000, 0x8000, CRC(aaa82885) SHA1(fc2bec3cf7e2de5f90174a2ed3bacfa94b6819f4) )
ROM_REGION( 0x18000, "gfx1", 0 )
ROM_LOAD( "rt1_7.7r", 0x00000, 0x10000, CRC(a85efa39) SHA1(1ed63b421a93960668cb4558c1ca1b3c86b1f6be) ) /* plane 1,2 */
@@ -1450,13 +1503,14 @@ ROM_START( rthunder1 )
ROM_END
ROM_START( wndrmomo )
- ROM_REGION( 0x18000, "cpu1", 0 )
- ROM_LOAD( "wm1_1.9c", 0x8000, 0x8000, CRC(34b50bf0) SHA1(112c8c8a0a16382008cacd2e484f91fa9338d10a) )
+ ROM_REGION( 0x10000, "cpu1", 0 )
/* 9d empty */
+ ROM_LOAD( "wm1_1.9c", 0x8000, 0x8000, CRC(34b50bf0) SHA1(112c8c8a0a16382008cacd2e484f91fa9338d10a) )
- ROM_REGION( 0x18000, "cpu2", 0 )
- ROM_LOAD( "wm1_2.12c", 0x8000, 0x8000, CRC(3181efd0) SHA1(01a2e0e4c8ced6f48b6e70393a3c4152b079e9b0) )
+
+ ROM_REGION( 0x10000, "cpu2", 0 )
/* 12d empty */
+ ROM_LOAD( "wm1_2.12c", 0x8000, 0x8000, CRC(3181efd0) SHA1(01a2e0e4c8ced6f48b6e70393a3c4152b079e9b0) )
ROM_REGION( 0x0c000, "gfx1", 0 )
ROM_LOAD( "wm1_6.7r", 0x00000, 0x08000, CRC(93955fbb) SHA1(cffd457886c40bf709b573237165ae8fa9784e32) ) /* plane 1,2 */
@@ -1557,12 +1611,12 @@ DRIVER_INIT_MEMBER(namcos86_state,namco86)
-GAME( 1986, skykiddx, 0, skykiddx, skykiddx, namcos86_state, namco86, ROT180, "Namco", "Sky Kid Deluxe (set 1)", 0 )
-GAME( 1986, skykiddxo,skykiddx, skykiddx, skykiddx, namcos86_state, namco86, ROT180, "Namco", "Sky Kid Deluxe (set 2)", 0 )
-GAME( 1986, hopmappy, 0, hopmappy, hopmappy, namcos86_state, namco86, ROT0, "Namco", "Hopping Mappy", 0 )
-GAME( 1986, roishtar, 0, roishtar, roishtar, namcos86_state, namco86, ROT0, "Namco", "The Return of Ishtar", 0 )
-GAME( 1986, genpeitd, 0, genpeitd, genpeitd, namcos86_state, namco86, ROT0, "Namco", "Genpei ToumaDen", 0 )
-GAME( 1986, rthunder, 0, rthunder, rthunder, namcos86_state, namco86, ROT0, "Namco", "Rolling Thunder (rev 3)", 0 )
-GAME( 1986, rthunder2,rthunder, rthunder, rthunder1, namcos86_state, namco86, ROT0, "Namco", "Rolling Thunder (rev 2)", 0 )
-GAME( 1986, rthunder1,rthunder, rthunder, rthunder1, namcos86_state, namco86, ROT0, "Namco", "Rolling Thunder (rev 1)", 0 )
-GAME( 1987, wndrmomo, 0, wndrmomo, wndrmomo, namcos86_state, namco86, ROT0, "Namco", "Wonder Momo", GAME_IMPERFECT_GRAPHICS )
+GAME( 1986, skykiddx, 0, hopmappy, skykiddx, namcos86_state, namco86, ROT180, "Namco", "Sky Kid Deluxe (set 1)", GAME_SUPPORTS_SAVE )
+GAME( 1986, skykiddxo,skykiddx, hopmappy, skykiddx, namcos86_state, namco86, ROT180, "Namco", "Sky Kid Deluxe (set 2)", GAME_SUPPORTS_SAVE )
+GAME( 1986, hopmappy, 0, hopmappy, hopmappy, namcos86_state, namco86, ROT0, "Namco", "Hopping Mappy", GAME_SUPPORTS_SAVE )
+GAME( 1986, roishtar, 0, roishtar, roishtar, namcos86_state, namco86, ROT0, "Namco", "The Return of Ishtar", GAME_SUPPORTS_SAVE )
+GAME( 1986, genpeitd, 0, genpeitd, genpeitd, namcos86_state, namco86, ROT0, "Namco", "Genpei ToumaDen", GAME_SUPPORTS_SAVE )
+GAME( 1986, rthunder, 0, rthunder, rthunder, namcos86_state, namco86, ROT0, "Namco", "Rolling Thunder (rev 3)", GAME_SUPPORTS_SAVE )
+GAME( 1986, rthunder2,rthunder, rthunder, rthunder1, namcos86_state, namco86, ROT0, "Namco", "Rolling Thunder (rev 2)", GAME_SUPPORTS_SAVE )
+GAME( 1986, rthunder1,rthunder, rthunder, rthunder1, namcos86_state, namco86, ROT0, "Namco", "Rolling Thunder (rev 1)", GAME_SUPPORTS_SAVE )
+GAME( 1987, wndrmomo, 0, wndrmomo, wndrmomo, namcos86_state, namco86, ROT0, "Namco", "Wonder Momo", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/naomi.c b/src/mame/drivers/naomi.c
index 10977bd1859..ecd32a47570 100644
--- a/src/mame/drivers/naomi.c
+++ b/src/mame/drivers/naomi.c
@@ -67,11 +67,6 @@ TODO (general):
* Shootout Pool Medal
* Shootout Pool Prize
- - "com error occurred between Naomi BD and I/O BD"
- * Samba de Amigo
- * Samba de Amigo (prototype)
- * Samba de Amigo Ver. 2000
-
- other issues:
* Death Crimson OX (boots now, but dies in YUV-mode movie; coining up before it appears to freeze the game)
* La Keyboard (boots fine & attract mode looks OK, but no keyboard)
@@ -275,7 +270,7 @@ Ferrari F355 Challenge (twin, prototype) no cart 22848P* 21 (64Mb) pre
Ferrari F355 Challenge 2 (twin) no cart 23399 21 (64Mb) present 315-6206 317-0287-COM content is the same as regular 171-7919A cart
House of the Dead 2 (prototype) no cart A1E2 21 (64Mb) present 315-6206 present no label on IC42
Inu No Osanpo / Dog Walking (Rev A) 840-0073C 22294A 16 (64Mb) present 315-6206 317-0316-JPN requires 837-13844 JVS IO with DIPSW 1 ON
-Samba de Amigo (prototype) no cart * 21 (64Mb) present 315-6206 317-0270-COM * instead of EPROM have tiny PCB with 2 flashroms on it
+Samba de Amigo (prototype) no cart * 21*(64Mb) present 315-6206 317-0270-COM * only first 14 flash roms contain game data, instead of EPROM have tiny PCB with 2 flashroms on it
Soul Surfer (Rev A) 840-0095C 23838C 21 (64Mb) present 315-6206 not present
Star Horse (server) 840-0055C 23626 17 (64Mb) present 315-6206 not present requires 837-13785 ARCNET&IO BD
The King of Route 66 (Rev A) 840-0087C 23819A 20 (64Mb) present 315-6206 not present content is the same as regular 171-8132A cart
@@ -323,7 +318,7 @@ Airline Pilots (deluxe) (Rev B) ? 21787B 11 (64Mb)
Airline Pilots (Rev A) 840-0005C 21739A 11 (64Mb) present 315-6213 317-0251-COM
Cosmic Smash 840-0044C 23428 8 (64Mb) ? 315-6213 317-0289-COM joystick + 2 buttons
Cosmic Smash (Rev A) 840-0044C 23428A 8 (64Mb) ? 315-6213 317-0289-COM joystick + 2 buttons
-Crazy Taxi 840-0002C 21684 13 (64Mb)* not present 315-6213 317-0248-COM * ic8 and ic9 are not present
+Crazy Taxi 840-0002C 21684 13 (64Mb)* present 315-6213 317-0248-COM * ic8 and ic9 are not present
Dead Or Alive 2 841-0003C 22121 21 (64Mb) present 315-6213 317-5048-COM joystick + 3 buttons
Dead Or Alive 2 Millennium 841-0003C DOA2 M 21 (64Mb) present 315-6213 317-5048-COM joystick + 3 buttons
Death Crimson OX 841-0016C 23524 10 (64Mb) present 315-6213 317-5066-COM
@@ -1099,7 +1094,7 @@ key matrix is shown in below
Guru's Readme
-------------
-Atomis Wave (system overview)
+Atomis Wave (codename SYSTEM X) system overview
Sammy/SEGA, 2002
The Atomiswave System is basically just a Sega Dreamcast using ROM carts.
@@ -1357,7 +1352,7 @@ This type is manufactured by Sega when Sammy merged with Sega.
171-8355A
PC BD A/W 128M FLASH
-837-14608 (sticker for Extreme Hunting 2 Tournament Edition)
+837-14608 (sticker for Extreme Hunting 2 Tournament Edition, Sega Bass Fishing Challenge, Sega Clay Challenge)
837-14695 (sticker for Dirty Pigskin Football)
|----------------------------|
| XC9536* U16 U2* |
@@ -1380,11 +1375,14 @@ Notes:
J2 - 6 pin connector for programming the XC9536 CPLD and/or the flash ROMs
XC9536 - Xilinx XC9536 in-system programmable CPLD (PLCC44), stamped with a
Sega 315-xxxx part number with a sticker over the top of it.
+ all known games on this type ROM BD have the same part# and decryption key.
Game Part# Sticker
---------------------------------------------------------
Extreme Hunting 2 Tournament Edition 315-6428P 315-6248
- Dirty Pigskin Football ? ?
+ Dirty Pigskin Football 315-6248 -
+ Sega Bass Fishing Challenge 315-6248 -
+ Sega Clay Challenge 315-6248 -
U* - Fujitsu MBM29PL12LM-10PCN 128M MirrorFlash TSOP56 flash ROM.
(configured as 16Mbytes x8bit or 8Mwords x16bit)
@@ -1395,6 +1393,37 @@ Notes:
depending on the total data length, some ROMs may be empty.
+Development ROM board:
+
+few unreleased and many prototype game versions known to exist on this ROM board,
+currently only Rumble Fish 2 prototype dumped
+
+PC BD SYSTEMX 3MODE FLASH Rev.B
+1111-00001402
+|--------------------------------------------|
+| CN3 |
+| |
+||-| IC14 IC17 IC20 IC23 |
+|| | XC9536 |
+|| | |
+|| | |
+||CN1 IC12 IC15 IC18 IC21 IC24 IC26 |
+|| | |
+|| | |
+|| | XC2S30 |
+||-| IC13 IC16 IC19 IC22 IC25 IC27 |
+| 17S30 |
+| CN2 |
+|--------------------------------------------|
+Notes:
+ CN1 - This connector plugs into the main board through 'PC RELAY BD SX CRTG V1' adapter.
+ CN2 - 8 pin connector
+ CN3 - 6 pin connector for programming the XC9536 CPLD
+ XC9536 - Xilinx XC9536XL in-system programmable CPLD (PLCC44), stamped JULIE_DEV
+ XC2S30 - Xilinx XC2S30 Spartan-II FPGA (TQFP144), Rumble Fish 2 have printed sticker A08
+ 17S30 - Xilinx 17S30APC OTP Configuration PROM, stamped SXFLS
+ IC12-IC27 - Fujitsu MBM29DL640E 64M TSOP48 flash ROMs
+
Network Board
-------------
@@ -5143,6 +5172,7 @@ IC16 64M A10B DDB4
*/
+// Ver 3.8 (shown on Japan title only)
ROM_START( samba )
NAOMI_BIOS
NAOMI_DEFAULT_EEPROM
@@ -5170,30 +5200,30 @@ ROM_START( samba )
ROM_PARAMETER( ":rom_board:segam2crypt:key", "280a8b5d" )
ROM_END
-// !!! partial dump, only IC22 dumped. without correct flashroms contents game crashes at certain points.
-// prototype - only works with US BIOS
+// prototype - boots on USA BIOS only, have fewer regular songs, but have several sound tracks from Sega games instead (Afterburner, Outrun, Sonic, etc)
ROM_START( sambap )
NAOMI_BIOS
NAOMI_DEFAULT_EEPROM
- ROM_REGION( 0x8800000, "rom_board", ROMREGION_ERASEFF)
+ ROM_REGION( 0x7800000, "rom_board", ROMREGION_ERASEFF)
ROM_LOAD( "sambaproto.ic22",0x000000, 0x0400000, CRC(ca069449) SHA1(03c2498664df187a98b335f1757979ebcf45c591) )
- ROM_LOAD("mpr-22950.ic1", 0x0800000, 0x0800000, CRC(16dee15c) SHA1(b46849e492756ff406bf8956303472255fcf55a5) )
- ROM_LOAD("mpr-22951.ic2", 0x1000000, 0x0800000, CRC(f509496f) SHA1(41281576f7d58c8ede9c0a89bfd46a98d5b97033) )
- ROM_LOAD("mpr-22952.ic3", 0x1800000, 0x0800000, CRC(fb9b3ef0) SHA1(e9d44b673c273e97445a12186496a0594e291542) )
- ROM_LOAD("mpr-22953.ic4", 0x2000000, 0x0800000, CRC(07207ce0) SHA1(b802bb4e78f3737a4e333f819b9a4e0249037288) )
- ROM_LOAD("mpr-22954.ic5", 0x2800000, 0x0800000, CRC(c8e797d1) SHA1(fadbd1e24882787634229003245293ce79ba2617) )
- ROM_LOAD("mpr-22955.ic6", 0x3000000, 0x0800000, CRC(064ef007) SHA1(8325f9aa537ce329e71dce2b588a3d4fc176c37b) )
- ROM_LOAD("mpr-22956.ic7", 0x3800000, 0x0800000, CRC(fe8f2964) SHA1(3a33162f797cd93b7dbb313b531215e340719110) )
- ROM_LOAD("mpr-22957.ic8", 0x4000000, 0x0800000, CRC(74842c01) SHA1(b02884925270edb66831ab502a0aa2f9430adc9f) )
- ROM_LOAD("mpr-22958.ic9", 0x4800000, 0x0800000, CRC(b1ead447) SHA1(06b848eb7f592763768050a1ae82b4cac9499684) )
- ROM_LOAD("mpr-22959.ic10", 0x5000000, 0x0800000, CRC(d32d7983) SHA1(86a9e5eae4598b6998f0ea578d6152e66c1a0df1) )
- ROM_LOAD("mpr-22960.ic11", 0x5800000, 0x0800000, CRC(6c3b228e) SHA1(782c0fda106222be75b1973586c8bf78fd2186e7) )
- ROM_LOAD("mpr-22961.ic12s",0x6000000, 0x0800000, CRC(d6d26a8d) SHA1(7d416f8ac9fbbeb9bfe217ccc8eccf1644511110) )
- ROM_LOAD("mpr-22962.ic13s",0x6800000, 0x0800000, CRC(c2f41101) SHA1(0bf87cbffb7d6a5ab32543cef56c9759f475419a) )
- ROM_LOAD("mpr-22963.ic14s",0x7000000, 0x0800000, CRC(a53e9919) SHA1(d81eb79bc706f85ebfbc56a9b2889ae62d629e8e) )
- ROM_LOAD("mpr-22964.ic15s",0x7800000, 0x0800000, CRC(f581d5a3) SHA1(8cf769f5b0a48951246bb60e9cf58232bcee7bc8) )
- ROM_LOAD("mpr-22965.ic16s",0x8000000, 0x0800000, CRC(8f7bfa8a) SHA1(19f137b1552978d232785c4408805b71835585c6) )
+ ROM_LOAD("ic1s", 0x00800000, 0x00800000, CRC(992a8390) SHA1(5842aaf0c9ed25f58429cae71f90d8e3e41a3efd) )
+ ROM_LOAD("ic2s", 0x01000000, 0x00800000, CRC(330f9185) SHA1(dd2ee044a62179160cd69799ce3727e7cb401da8) )
+ ROM_LOAD("ic3s", 0x01800000, 0x00800000, CRC(719ae0f9) SHA1(f08d1764f19023d510be5e02183eef18a9294a99) )
+ ROM_LOAD("ic4s", 0x02000000, 0x00800000, CRC(941b8208) SHA1(4409d4d83546c57e7c046de2e8a1b25f40acb246) )
+ ROM_LOAD("ic5s", 0x02800000, 0x00800000, CRC(6d12335e) SHA1(9d58040182d7f185733a3aebc833e98d2daec3a5) )
+ ROM_LOAD("ic6s", 0x03000000, 0x00800000, CRC(197540ed) SHA1(b993344b4091c86bc823d6e73814baeab01b9c43) )
+ ROM_LOAD("ic7s", 0x03800000, 0x00800000, CRC(2e0912ba) SHA1(fe010f41f7498a417d143b95617d1cbc8d5c5ec7) )
+ ROM_LOAD("ic8s", 0x04000000, 0x00800000, CRC(10f6b6a2) SHA1(d73fef5edac937b8d294781bbd6197fd8185c589) )
+ ROM_LOAD("ic9s", 0x04800000, 0x00800000, CRC(2b57ce5f) SHA1(0fcf78b3497b918dc1fbc62ffdd2863489eea3ab) )
+ ROM_LOAD("ic10s", 0x05000000, 0x00800000, CRC(7d61643c) SHA1(e48023ec78143e85bdf4605deaba3f355601a856) )
+ ROM_LOAD("ic11s", 0x05800000, 0x00800000, CRC(ca391126) SHA1(a3324b865c134ba9ec3ef33cd158107b55b8bd2e) )
+ ROM_LOAD("ic12s", 0x06000000, 0x00800000, CRC(f028ae87) SHA1(ff868e33d8765c076d687af416a8d658169af2fb) )
+ ROM_LOAD("ic13s", 0x06800000, 0x00800000, CRC(37a15a54) SHA1(11c247caf0cd0ed098d408d273affab87d794169) )
+ ROM_LOAD("ic14s", 0x07000000, 0x00800000, CRC(e0730a2b) SHA1(79ac165cf8d8095ff1661e86d03ad6fd04d2d63c) )
+
+ ROM_REGION(0x84, "some_eeprom", 0)
+ ROM_LOAD( "sflash.ic37", 0x000000, 0x000084, CRC(69d54cc4) SHA1(e036b8537390b9941dbfcb8d3b42ded68c8e9d29) )
// 840-0020 1999 317-0270-COM Naomi
ROM_PARAMETER( ":rom_board:segam2crypt:key", "280a8b5d" )
@@ -7390,8 +7420,8 @@ ROM_START( shaktam )
DISK_IMAGE_READONLY( "gds-0002b", 0, SHA1(c656497b44d5ca4743aa1a8d836af2bfa3484dd5) )
ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF)
- // key PIC is missing
- ROM_LOAD("317-xxxx-com.pic", 0x00, 0x4000, BAD_DUMP CRC(034b7299) SHA1(45118d5f65b21ae599e3ca8e35df847135708d44) )
+ // PIC label is unknown
+ ROM_LOAD("317-xxxx-com.pic", 0x00, 0x4000, CRC(9e1a8971) SHA1(022a1781b5d7346b61defe921dbabf11331834d7) )
ROM_END
ROM_START( sprtjam )
@@ -8505,6 +8535,27 @@ DRIVER_INIT_MEMBER(naomi_state,atomiswave)
aw_ctrl_type = 0;
}
+READ64_MEMBER(naomi_state::xtrmhnt2_hack_r)
+{
+ // disable ALL.Net board check
+ if (space.device().safe_pc() == 0xc03cb30)
+ {
+ dc_ram[0x357fe/8] |= (UINT64)0x200 << 48;
+ dc_ram[0x358e2/8] |= (UINT64)0x200 << 16;
+ dc_ram[0x38bb2/8] |= (UINT64)0x200 << 16;
+ dc_ram[0x38bee/8] |= (UINT64)0x200 << 48;
+ }
+ if (space.device().safe_pc() == 0xc108240)
+ dc_ram[0x9acc8/8] = (dc_ram[0x9acc8/8] & U64(0xffffffffffff0000)) | (UINT64)0x0009;
+ return 0;
+}
+
+DRIVER_INIT_MEMBER(naomi_state,xtrmhnt2)
+{
+ DRIVER_INIT_CALL(atomiswave);
+ m_maincpu->space(AS_PROGRAM).install_read_handler(0x1000000, 0x100011f, read64_delegate(FUNC(naomi_state::xtrmhnt2_hack_r), this));
+}
+
ROM_START( fotns )
AW_BIOS
@@ -8657,15 +8708,15 @@ ROM_END
ROM_START( ngbc )
AW_BIOS
- ROM_REGION( 0xf000000, "rom_board", ROMREGION_ERASE)
- ROM_LOAD( "ax3301p01.fmem1", 0x0000000, 0x0800000, CRC(6dd78275) SHA1(72d4cab58dbcebd666db21aeef190378ef447580) )
- ROM_LOAD( "ax3301m01.mrom1", 0x1000000, 0x2000000, CRC(e6013de9) SHA1(ccbc7c2e76153348646d75938d5c008dc80df17d) )
- ROM_LOAD( "ax3302m01.mrom2", 0x3000000, 0x2000000, CRC(f7cfef6c) SHA1(c9e6231499a9c9c8650d9e61f34ff1fcce8d442c) )
- ROM_LOAD( "ax3303m01.mrom3", 0x5000000, 0x2000000, CRC(0cdf8647) SHA1(0423f96842bef2c2ff454318dc6960b5052c0551) )
- ROM_LOAD( "ax3304m01.mrom4", 0x7000000, 0x2000000, CRC(2f031db0) SHA1(3214735f04fadf160137f0585bfc1a27eeecfac6) )
- ROM_LOAD( "ax3305m01.mrom5", 0x9000000, 0x2000000, CRC(f6668aaa) SHA1(6a78f8f0c7d7a71854ff87329290d38970cfb476) )
- ROM_LOAD( "ax3306m01.mrom6", 0xb000000, 0x2000000, CRC(5cf32fbd) SHA1(b6ae0abe5791b3d6f8db07b8c8ca22219a153801) )
- ROM_LOAD( "ax3307m01.mrom7", 0xd000000, 0x2000000, CRC(26d9da53) SHA1(0015b4be670005a451274de68279b4302fc42a97) )
+ ROM_REGION( 0x14000000, "rom_board", ROMREGION_ERASEFF)
+ ROM_LOAD( "ax3301p01.fmem1", 0x00000000, 0x0800000, CRC(6dd78275) SHA1(72d4cab58dbcebd666db21aeef190378ef447580) )
+ ROM_LOAD( "ax3301m01.mrom1", 0x02000000, 0x2000000, CRC(e6013de9) SHA1(ccbc7c2e76153348646d75938d5c008dc80df17d) )
+ ROM_LOAD( "ax3302m01.mrom2", 0x04000000, 0x2000000, CRC(f7cfef6c) SHA1(c9e6231499a9c9c8650d9e61f34ff1fcce8d442c) )
+ ROM_LOAD( "ax3303m01.mrom3", 0x06000000, 0x2000000, CRC(0cdf8647) SHA1(0423f96842bef2c2ff454318dc6960b5052c0551) )
+ ROM_LOAD( "ax3304m01.mrom4", 0x0a000000, 0x2000000, CRC(2f031db0) SHA1(3214735f04fadf160137f0585bfc1a27eeecfac6) )
+ ROM_LOAD( "ax3305m01.mrom5", 0x0c000000, 0x2000000, CRC(f6668aaa) SHA1(6a78f8f0c7d7a71854ff87329290d38970cfb476) )
+ ROM_LOAD( "ax3306m01.mrom6", 0x0e000000, 0x2000000, CRC(5cf32fbd) SHA1(b6ae0abe5791b3d6f8db07b8c8ca22219a153801) )
+ ROM_LOAD( "ax3307m01.mrom7", 0x12000000, 0x2000000, CRC(26d9da53) SHA1(0015b4be670005a451274de68279b4302fc42a97) )
ROM_REGION( 4, "rom_key", 0 )
ROM_LOAD( "ax3301f01.bin", 0, 4, CRC(9afe949b) SHA1(4f7b039f3287da61a53a2d012993bfb57e1459bd) )
@@ -8808,15 +8859,15 @@ ROM_END
ROM_START( kofxi )
AW_BIOS
- ROM_REGION( 0xf000000, "rom_board", ROMREGION_ERASE)
- ROM_LOAD( "ax3201p01.fmem1", 0x0000000, 0x0800000, CRC(6dbdd71b) SHA1(cce3897b104f5d923d8136485fc80eb9717ff4b5) )
- ROM_LOAD( "ax3201m01.mrom1", 0x1000000, 0x2000000, CRC(7f9d6af9) SHA1(001064ad1b8c3408efe799dc766c2728dc6512a9) )
- ROM_LOAD( "ax3202m01.mrom2", 0x3000000, 0x2000000, CRC(1ae40afa) SHA1(9ee7957c86cc3a71e6971ddcd906a82c5b1e16f1) )
- ROM_LOAD( "ax3203m01.mrom3", 0x5000000, 0x2000000, CRC(8c5e3bfd) SHA1(b5443e2a1b88642cc57c5287a3122376c2d48de9) )
- ROM_LOAD( "ax3204m01.mrom4", 0x7000000, 0x2000000, CRC(ba97f80c) SHA1(36f672fe833e13f0bab036b02c39123066327e20) )
- ROM_LOAD( "ax3205m01.mrom5", 0x9000000, 0x2000000, CRC(3c747067) SHA1(54b7ff73d618e2e4e40c125c6cfe99016e69ad1a) )
- ROM_LOAD( "ax3206m01.mrom6", 0xb000000, 0x2000000, CRC(cb81e5f5) SHA1(07faee02a58ac9c600ab3cdd525d22c16b35222d) )
- ROM_LOAD( "ax3207m01.mrom7", 0xd000000, 0x2000000, CRC(164f6329) SHA1(a72c8cbe4ac7b98edda3d4434f6c81a370b8c39b) )
+ ROM_REGION( 0x14000000, "rom_board", ROMREGION_ERASEFF)
+ ROM_LOAD( "ax3201p01.fmem1", 0x00000000, 0x0800000, CRC(6dbdd71b) SHA1(cce3897b104f5d923d8136485fc80eb9717ff4b5) )
+ ROM_LOAD( "ax3201m01.mrom1", 0x02000000, 0x2000000, CRC(7f9d6af9) SHA1(001064ad1b8c3408efe799dc766c2728dc6512a9) )
+ ROM_LOAD( "ax3202m01.mrom2", 0x04000000, 0x2000000, CRC(1ae40afa) SHA1(9ee7957c86cc3a71e6971ddcd906a82c5b1e16f1) )
+ ROM_LOAD( "ax3203m01.mrom3", 0x06000000, 0x2000000, CRC(8c5e3bfd) SHA1(b5443e2a1b88642cc57c5287a3122376c2d48de9) )
+ ROM_LOAD( "ax3204m01.mrom4", 0x0a000000, 0x2000000, CRC(ba97f80c) SHA1(36f672fe833e13f0bab036b02c39123066327e20) )
+ ROM_LOAD( "ax3205m01.mrom5", 0x0c000000, 0x2000000, CRC(3c747067) SHA1(54b7ff73d618e2e4e40c125c6cfe99016e69ad1a) )
+ ROM_LOAD( "ax3206m01.mrom6", 0x0e000000, 0x2000000, CRC(cb81e5f5) SHA1(07faee02a58ac9c600ab3cdd525d22c16b35222d) )
+ ROM_LOAD( "ax3207m01.mrom7", 0x12000000, 0x2000000, CRC(164f6329) SHA1(a72c8cbe4ac7b98edda3d4434f6c81a370b8c39b) )
ROM_REGION( 4, "rom_key", 0 )
ROM_LOAD( "ax3201f01.bin", 0, 4, CRC(065d7fc6) SHA1(e4f18126e9f4e6747ffc5d0664766986fc07c127) )
@@ -8836,19 +8887,18 @@ ROM_START( dirtypig )
ROM_LOAD( "695-0014.u16", 0x7000000, 0x1000000, CRC(730180a4) SHA1(017b82e2d2744695e3e521d35a8511ecc1c8ab43) )
ROM_REGION( 4, "rom_key", 0 )
- ROM_LOAD( "695-0014.bin", 0, 4, CRC(553dd361) SHA1(a60a26b5ee786cf0bb3d09bb6f00374598fbd7cc) )
+ ROM_LOAD( "315-6248.bin", 0, 4, CRC(553dd361) SHA1(a60a26b5ee786cf0bb3d09bb6f00374598fbd7cc) )
ROM_END
ROM_START( mslug6 )
AW_BIOS
- ROM_REGION( 0xf000000, "rom_board", ROMREGION_ERASE)
+ ROM_REGION( 0xc000000, "rom_board", ROMREGION_ERASEFF)
ROM_LOAD( "ax3001p01.fmem1", 0x0000000, 0x0800000, CRC(af67dbce) SHA1(5aba108caf3e4ced6994bc26e752d4e225c231e8) )
- ROM_LOAD( "ax3001m01.mrom1", 0x1000000, 0x2000000, CRC(e56417ee) SHA1(27692ad5c1093aff0973d2aafd01a5e30c7bfbbe) )
- ROM_LOAD( "ax3002m01.mrom2", 0x3000000, 0x2000000, CRC(1be3bbc1) SHA1(d75ce5c855c9c4eeacdbf84d440c73a94de060fe) )
- ROM_LOAD( "ax3003m01.mrom3", 0x5000000, 0x2000000, CRC(4fe37370) SHA1(85d51db94c3e34265e37b636d6545ed2801ba5a6) )
- ROM_LOAD( "ax3004m01.mrom4", 0x7000000, 0x2000000, CRC(2f4c4c6f) SHA1(5815c28fdaf0429003986e725c0015fe4c08721f) )
- ROM_COPY( "rom_board", 0x7000000, 0x9000000, 0x2000000)
+ ROM_LOAD( "ax3001m01.mrom1", 0x2000000, 0x2000000, CRC(e56417ee) SHA1(27692ad5c1093aff0973d2aafd01a5e30c7bfbbe) )
+ ROM_LOAD( "ax3002m01.mrom2", 0x4000000, 0x2000000, CRC(1be3bbc1) SHA1(d75ce5c855c9c4eeacdbf84d440c73a94de060fe) )
+ ROM_LOAD( "ax3003m01.mrom3", 0x6000000, 0x2000000, CRC(4fe37370) SHA1(85d51db94c3e34265e37b636d6545ed2801ba5a6) )
+ ROM_LOAD( "ax3004m01.mrom4", 0xa000000, 0x2000000, CRC(2f4c4c6f) SHA1(5815c28fdaf0429003986e725c0015fe4c08721f) )
ROM_REGION( 4, "rom_key", 0 )
ROM_LOAD( "ax3001f01.bin", 0, 4, CRC(0b9939e9) SHA1(4ca1225c7c9993542a67035a054ac579ed021de5) )
@@ -8857,15 +8907,15 @@ ROM_END
ROM_START( samsptk )
AW_BIOS
- ROM_REGION( 0x10000000, "rom_board", ROMREGION_ERASE)
- ROM_LOAD( "ax2901p01.fmem1", 0x0000000, 0x0800000, CRC(58e0030b) SHA1(ed8a66833beeb56d83770123eff28df0f25221d1) )
- ROM_LOAD( "ax2901m01.mrom1", 0x1000000, 0x2000000, CRC(dbbbd90d) SHA1(102ee0b249a3e0ca2f659b6c515816c522ad78d0) )
- ROM_LOAD( "ax2902m01.mrom2", 0x3000000, 0x2000000, CRC(a3bd7890) SHA1(9b8d934d6ebc3ef688cd8a6de47657a0663fea10) )
- ROM_LOAD( "ax2903m01.mrom3", 0x5000000, 0x2000000, CRC(56f50fdd) SHA1(8a5a4a99108c0279056998046c7b332e80121dee) )
- ROM_LOAD( "ax2904m01.mrom4", 0x7000000, 0x2000000, CRC(8a3ae175) SHA1(966f527a92e24c8eb770344697f2edf6140cf971) )
- ROM_LOAD( "ax2905m01.mrom5", 0x9000000, 0x2000000, CRC(429877ba) SHA1(88e1f3bc682b18d331e328ef8754065109cf9bda) )
- ROM_LOAD( "ax2906m01.mrom6", 0xb000000, 0x2000000, CRC(cb95298d) SHA1(5fb5d5a0d6801df61101a1b23de0c14ff29ef654) )
- ROM_LOAD( "ax2907m01.mrom7", 0xd000000, 0x2000000, CRC(48015081) SHA1(3c0a0a6dc9ab7bf889579477699e612c3092f9bf) )
+ ROM_REGION( 0x14000000, "rom_board", ROMREGION_ERASEFF)
+ ROM_LOAD( "ax2901p01.fmem1", 0x00000000, 0x0800000, CRC(58e0030b) SHA1(ed8a66833beeb56d83770123eff28df0f25221d1) )
+ ROM_LOAD( "ax2901m01.mrom1", 0x02000000, 0x2000000, CRC(dbbbd90d) SHA1(102ee0b249a3e0ca2f659b6c515816c522ad78d0) )
+ ROM_LOAD( "ax2902m01.mrom2", 0x04000000, 0x2000000, CRC(a3bd7890) SHA1(9b8d934d6ebc3ef688cd8a6de47657a0663fea10) )
+ ROM_LOAD( "ax2903m01.mrom3", 0x06000000, 0x2000000, CRC(56f50fdd) SHA1(8a5a4a99108c0279056998046c7b332e80121dee) )
+ ROM_LOAD( "ax2904m01.mrom4", 0x0a000000, 0x2000000, CRC(8a3ae175) SHA1(966f527a92e24c8eb770344697f2edf6140cf971) )
+ ROM_LOAD( "ax2905m01.mrom5", 0x0c000000, 0x2000000, CRC(429877ba) SHA1(88e1f3bc682b18d331e328ef8754065109cf9bda) )
+ ROM_LOAD( "ax2906m01.mrom6", 0x0e000000, 0x2000000, CRC(cb95298d) SHA1(5fb5d5a0d6801df61101a1b23de0c14ff29ef654) )
+ ROM_LOAD( "ax2907m01.mrom7", 0x12000000, 0x2000000, CRC(48015081) SHA1(3c0a0a6dc9ab7bf889579477699e612c3092f9bf) )
ROM_REGION( 4, "rom_key", 0 )
ROM_LOAD( "ax2901f01.bin", 0, 4, CRC(8a6267aa) SHA1(9705bed35acb87d578f0efcf4f74b2a4b1a7be2e) )
@@ -8888,22 +8938,48 @@ ROM_START( ggx15 )
ROM_LOAD( "ax0801f01.bin", 0, 4, CRC(a36e5017) SHA1(fd763a4c708fe37c7561ba5b5d0b8d2118cff16b) )
ROM_END
+// (C)Dimps Fri Mar 4 19:27:57 2005 NONAME (build 2319)
ROM_START( rumblef2 )
AW_BIOS
- ROM_REGION( 0x10000000, "rom_board", ROMREGION_ERASE)
+ ROM_REGION( 0xe000000, "rom_board", ROMREGION_ERASE)
ROM_LOAD( "ax3401p01.fmem1", 0x0000000, 0x0800000, CRC(a33601cf) SHA1(2dd60a9c3a2517f2257ab69288fa95645de133fa) )
- ROM_LOAD( "ax3401m01.mrom1", 0x1000000, 0x2000000, CRC(60894d4c) SHA1(5b21af3c7c82d4d64bfd8498c26283111ada1298) )
- ROM_LOAD( "ax3402m01.mrom2", 0x3000000, 0x2000000, CRC(e4224cc9) SHA1(dcab06fcf48cda286f93d2b37f03a83abf3230cb) )
- ROM_LOAD( "ax3403m01.mrom3", 0x5000000, 0x2000000, CRC(081c0edb) SHA1(63a3f1b5f9d7ca4367868c492236406f23996cc3) )
- ROM_LOAD( "ax3404m01.mrom4", 0x7000000, 0x2000000, CRC(a426b443) SHA1(617aab42e432a80b0663281fb7faa6c14ef4f149) )
- ROM_LOAD( "ax3405m01.mrom5", 0x9000000, 0x2000000, CRC(4766ce56) SHA1(349b82013a75905ae5520b14a87702c9038a5def) )
- ROM_COPY( "rom_board", 0x9000000, 0xb000000, 0x2000000)
+ ROM_LOAD( "ax3401m01.mrom1", 0x2000000, 0x2000000, CRC(60894d4c) SHA1(5b21af3c7c82d4d64bfd8498c26283111ada1298) )
+ ROM_LOAD( "ax3402m01.mrom2", 0x4000000, 0x2000000, CRC(e4224cc9) SHA1(dcab06fcf48cda286f93d2b37f03a83abf3230cb) )
+ ROM_LOAD( "ax3403m01.mrom3", 0x6000000, 0x2000000, CRC(081c0edb) SHA1(63a3f1b5f9d7ca4367868c492236406f23996cc3) )
+ ROM_LOAD( "ax3404m01.mrom4", 0xa000000, 0x2000000, CRC(a426b443) SHA1(617aab42e432a80b0663281fb7faa6c14ef4f149) )
+ ROM_LOAD( "ax3405m01.mrom5", 0xc000000, 0x2000000, CRC(4766ce56) SHA1(349b82013a75905ae5520b14a87702c9038a5def) )
ROM_REGION( 4, "rom_key", 0 )
ROM_LOAD( "ax3401f01.bin", 0, 4, CRC(952919a1) SHA1(d343fdbbd1d8b651401133f21facc1584bb66c04) )
ROM_END
+// Prototype, have internal text: (C)Dimps Tue Jan 11 14:32:45 2005 NONAME (build 0001)
+ROM_START( rumblf2p )
+ AW_BIOS
+
+ ROM_REGION( 0x8000000, "rom_board", ROMREGION_ERASEFF)
+ ROM_LOAD("ic12", 0x00000000, 0x00800000, CRC(1a0e74ab) SHA1(679787e5fcc0e197f97a00544c1f277d3695df80) )
+ ROM_LOAD("ic13", 0x00800000, 0x00800000, CRC(5630bc83) SHA1(46848b58a55c180d9a92df6914a1a8b9af35cc57) )
+ ROM_LOAD("ic14", 0x01000000, 0x00800000, CRC(7fcfc59c) SHA1(ca2b71fe6dd959d89a7e30363090d38032c3697a) )
+ ROM_LOAD("ic15", 0x01800000, 0x00800000, CRC(eee00692) SHA1(ee630a77c130e64435be544b13cd885ecc7bfeb4) )
+ ROM_LOAD("ic16", 0x02000000, 0x00800000, CRC(cd029db9) SHA1(d5d70dbb3822538afc67efa1e905c520b63cc978) )
+ ROM_LOAD("ic17", 0x02800000, 0x00800000, CRC(223a5b58) SHA1(ab540c994598f5cbe34ec8a62fa96181cd2be6e2) )
+ ROM_LOAD("ic18", 0x03000000, 0x00800000, CRC(5e2d2f67) SHA1(fe348e8e342d0d642a21cd24c57387384f20fa0e) )
+ ROM_LOAD("ic19", 0x03800000, 0x00800000, CRC(3cfb2adc) SHA1(d731674d80e924c250fe3519aef1392d38167aa3) )
+ ROM_LOAD("ic20", 0x04000000, 0x00800000, CRC(2c216a05) SHA1(0677146ecf5abe00368e205fd7da19234a997dd2) )
+ ROM_LOAD("ic21", 0x04800000, 0x00800000, CRC(79540865) SHA1(8ad7b789f25df5405949fef96d0db35ca8e424c3) )
+ ROM_LOAD("ic22", 0x05000000, 0x00800000, CRC(c91d95a0) SHA1(a50e4fffa3cf70459d9bb36f0155e768d4281f39) )
+ ROM_LOAD("ic23", 0x05800000, 0x00800000, CRC(5c39ca18) SHA1(6a29c4b1dd6b8eca5824687a1b501594a6676606) )
+ ROM_LOAD("ic24", 0x06000000, 0x00800000, CRC(858d2775) SHA1(34ca97f348a810c6f950840ef2390334011c6034) )
+ ROM_LOAD("ic25", 0x06800000, 0x00800000, CRC(975d35fb) SHA1(a4cf97a05cbeb830090426915067b3dd15224939) )
+ ROM_LOAD("ic26", 0x07000000, 0x00800000, CRC(ff9a2c4c) SHA1(81ac8fb41d7af605da0dcd92104cef0f045777bf) )
+ // IC27 populated, empty
+
+ ROM_REGION( 4, "rom_key", 0 )
+ ROM_LOAD( "julie_dev.bin", 0, 4, CRC(757054c4) SHA1(7d5556d0940c582adbcf5697c7b81453d0c91153) )
+ROM_END
+
ROM_START( claychal )
AW_BIOS
@@ -8918,7 +8994,7 @@ ROM_START( claychal )
ROM_LOAD( "608-2161.u16", 0x7000000, 0x1000100, CRC(14f8ca87) SHA1(778c048da9434ffda600e35ad5aca29e02cc98c0) )
ROM_REGION( 4, "rom_key", 0 )
- ROM_LOAD( "608-2161.bin", 0x000000, 0x000004, CRC(553dd361) SHA1(a60a26b5ee786cf0bb3d09bb6f00374598fbd7cc) )
+ ROM_LOAD( "315-6248.bin", 0x000000, 0x000004, CRC(553dd361) SHA1(a60a26b5ee786cf0bb3d09bb6f00374598fbd7cc) )
ROM_END
ROM_START( basschal )
@@ -8934,8 +9010,8 @@ ROM_START( basschal )
ROM_LOAD( "610-0811.u14", 0x6000000, 0x1000100, CRC(9f33f186) SHA1(d656f3c11dba50620158394866054e08cdc7f4f0) )
ROM_LOAD( "610-0811.u16", 0x7000000, 0x1000100, CRC(5f0a3bd1) SHA1(39c66fce9ef0660491372e1aa4faff5b21524177) )
- ROM_REGION( 4, "rom_key", 0 ) // same as claychal. lazy!
- ROM_LOAD( "610-0811.bin", 0x000000, 0x000004, CRC(553dd361) SHA1(a60a26b5ee786cf0bb3d09bb6f00374598fbd7cc) )
+ ROM_REGION( 4, "rom_key", 0 )
+ ROM_LOAD( "315-6248.bin", 0x000000, 0x000004, CRC(553dd361) SHA1(a60a26b5ee786cf0bb3d09bb6f00374598fbd7cc) )
ROM_END
/* All games have the regional titles at the start of the IC22 rom in the following order
@@ -8991,8 +9067,8 @@ ROM_END
/* 0017 */ GAME( 1999, otrigger, naomi, naomim2, naomi, naomi_state, naomi, ROT0, "Sega", "OutTrigger (JPN, USA, EXP, KOR, AUS)", GAME_FLAGS )
/* 0018 */ GAME( 1999, sgtetris, naomi, naomim2, naomi, naomi_state, naomi, ROT0, "Sega", "Sega Tetris", GAME_FLAGS )
/* 0019 */ GAME( 1999, dybb99, naomi, naomim2, dybbnao, naomi_state, naomi, ROT0, "Sega", "Dynamite Baseball '99 (JPN) / World Series '99 (USA, EXP, KOR, AUS) (Rev B)", GAME_FLAGS )
-/* 0020 */ GAME( 1999, samba, naomi, naomim2, naomi, naomi_state, naomi, ROT0, "Sega", "Samba De Amigo (JPN) (Rev B)", GAME_FLAGS )
-/* none */ GAME( 1999, sambap, samba, naomim2, naomi, naomi_state, naomi, ROT0, "Sega", "Samba De Amigo (prototype)", GAME_FLAGS )
+/* 0020 */ GAME( 1999, samba, naomi, naomim2, naomi, naomi_state, naomi, ROT0, "Sega", "Samba De Amigo (Rev B)", GAME_FLAGS )
+/* none */ GAME( 1999, sambap, samba, naomim2, naomi, naomi_state, naomi, ROT0, "Sega", "Samba De Amigo (USA, prototype)", GAME_FLAGS )
/* none */ GAME( 2000, virnbap, virnba, naomim2, naomi, naomi_state, naomi, ROT0, "Sega", "Virtua NBA (prototype)", GAME_FLAGS )
/* 0021 */ GAME( 2000, virnbao, virnba, naomim2, naomi, naomi_state, naomi, ROT0, "Sega", "Virtua NBA (JPN, USA, EXP, KOR, AUS) (original)", GAME_FLAGS )
/* 0021-01*/GAME( 2000,virnba, naomi, naomim2, naomi, naomi_state, naomi, ROT0, "Sega", "Virtua NBA (JPN, USA, EXP, KOR, AUS)", GAME_FLAGS )
@@ -9075,7 +9151,7 @@ GAME( 2003, puyofevp, naomi, naomim1, naomi, naomi_state, naomi, ROT0, "Sega", "
/* 0004 */ GAME( 1999, shangril, naomi, naomim2, naomi_mp,naomi_state,naomi_mp,ROT0, "Marvelous Ent.", "Dengen Tenshi Taisen Janshi Shangri-la (JPN, USA, EXP, KOR, AUS)", GAME_FLAGS )
/* 0005 */ GAME( 1999, spawn, naomi, naomim2, naomi, naomi_state, naomi, ROT0, "Todd Mc Farlane / Capcom","Spawn In the Demon's Hand (JPN, USA, EUR, ASI, AUS) (Rev B)", GAME_FLAGS )
/* 0006 */ GAME( 1999, puyoda, naomi, naomim2, naomi, naomi_state, naomi, ROT0, "Compile", "Puyo Puyo Da!", GAME_FLAGS )
-/* 0007-02 */ GAME( 2000,mvsc2, naomi, naomim1, naomi, naomi_state, mvsc2, ROT0, "Marvel / Capcom", "Marvel Vs. Capcom 2 New Age of Heroes (JPN, USA, EUR, ASI, AUS) (Rev A)", GAME_FLAGS )
+/* 0007-02 */ GAME( 2000,mvsc2, naomi, naomim1, naomi, naomi_state, mvsc2, ROT0, "Capcom / Marvel", "Marvel Vs. Capcom 2 New Age of Heroes (JPN, USA, EUR, ASI, AUS) (Rev A)", GAME_FLAGS )
/* 0008 */ GAME( 2000, pstone2, naomi, naomim2, naomi, naomi_state, naomi, ROT0, "Capcom", "Power Stone 2 (JPN, USA, EUR, ASI, AUS)", GAME_FLAGS )
/* 0011 */ GAME( 2000, capsnk, naomi, naomim2, naomi, naomi_state, naomi, ROT0, "Capcom / SNK", "Capcom Vs. SNK Millennium Fight 2000 (JPN, USA, EXP, KOR, AUS) (Rev C)", GAME_FLAGS )
/* 0011 */ GAME( 2000, capsnka, capsnk,naomim2, naomi, naomi_state, naomi, ROT0, "Capcom / SNK", "Capcom Vs. SNK Millennium Fight 2000 (JPN, USA, EXP, KOR, AUS) (Rev A)", GAME_FLAGS )
@@ -9279,15 +9355,16 @@ GAME( 2003, sprtshot, awbios, aw2c, aw2c, naomi_state, atomiswave, ROT0, "Samm
GAME( 2003, ggx15, awbios, aw2c, aw2c, naomi_state, atomiswave, ROT0, "Arc System Works / Sammy", "Guilty Gear X ver. 1.5", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
GAME( 2003, demofist, awbios, aw2c, aw2c, naomi_state, atomiswave, ROT0, "Polygon Magic / Dimps", "Demolish Fist", GAME_FLAGS )
GAME( 2003, dolphin, awbios, aw2c, aw2c, naomi_state, atomiswave, ROT0, "Sammy", "Dolphin Blue", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
+GAME( 2003, kov7sprt, awbios, aw2c, aw2c, naomi_state, atomiswave, ROT0, "IGS / Sammy", "Knights of Valour - The Seven Spirits", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
GAME( 2003, ggisuka, awbios, aw2c, aw2c, naomi_state, atomiswave, ROT0, "Arc System Works / Sammy", "Guilty Gear Isuka", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
GAME( 2004, dirtypig, awbios, aw2c, aw2c, naomi_state, atomiswave, ROT0, "Sammy", "Dirty Pigskin Football", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
GAME( 2004, rumblef, awbios, aw2c, aw2c, naomi_state, atomiswave, ROT0, "Sammy / Dimps", "The Rumble Fish", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
GAME( 2004, rangrmsn, awbios, aw2c, aw1w, naomi_state, atomiswave, ROT0, "Sammy", "Ranger Mission", GAME_FLAGS )
GAME( 2004, salmankt, awbios, aw2c, aw2c, naomi_state, atomiswave, ROT0, "Sammy", "Salary Man Kintarou", GAME_FLAGS )
GAME( 2004, ftspeed, awbios, aw1c, aw1w, naomi_state, atomiswave, ROT0, "Sammy", "Faster Than Speed", GAME_FLAGS )
-GAME( 2004, kov7sprt, awbios, aw2c, aw2c, naomi_state, atomiswave, ROT0, "IGS / Sammy", "Knights of Valour - The Seven Spirits", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
GAME( 2005, vfurlong, awbios, aw2c, aw2c, naomi_state, atomiswave, ROT0, "Sammy", "Net Select Keiba Victory Furlong", GAME_FLAGS )
-GAME( 2004, rumblef2, awbios, aw2c, aw2c, naomi_state, atomiswave, ROT0, "Sammy / Dimps", "The Rumble Fish 2", GAME_FLAGS )
+GAME( 2005, rumblef2, awbios, aw2c, aw2c, naomi_state, atomiswave, ROT0, "Sammy / Dimps", "The Rumble Fish 2", GAME_FLAGS )
+GAME( 2005, rumblf2p,rumblef2,aw2c, aw2c, naomi_state, atomiswave, ROT0, "Sammy / Dimps", "The Rumble Fish 2 (prototype)", GAME_FLAGS )
GAME( 2005, anmlbskt, awbios, aw2c, aw2c, naomi_state, atomiswave, ROT270, "MOSS / Sammy", "Animal Basket", GAME_FLAGS )
GAME( 2005, ngbc, awbios, aw2c, aw2c, naomi_state, atomiswave, ROT0, "Sammy / SNK Playmore", "Neo-Geo Battle Coliseum", GAME_FLAGS )
GAME( 2005, samsptk, awbios, aw2c, aw2c, naomi_state, atomiswave, ROT0, "Sammy / SNK Playmore", "Samurai Spirits Tenkaichi Kenkakuden", GAME_FLAGS )
@@ -9297,6 +9374,6 @@ GAME( 2005, kofnw, awbios, aw2c, aw2c, naomi_state, atomiswave, ROT0, "Samm
GAME( 2005, kofnwj, kofnw, aw2c, aw2c, naomi_state, atomiswave, ROT0, "Sammy / SNK Playmore", "The King of Fighters Neowave (Japan)", GAME_FLAGS )
GAME( 2005, xtrmhunt, awbios, aw2c, aw2c, naomi_state, atomiswave, ROT0, "Sammy", "Extreme Hunting", GAME_FLAGS )
GAME( 2006, mslug6, awbios, aw2c, aw2c, naomi_state, atomiswave, ROT0, "Sega / SNK Playmore", "Metal Slug 6", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
-GAME( 2006, xtrmhnt2, awbios, aw2c, aw2c, naomi_state, atomiswave, ROT0, "Sega", "Extreme Hunting 2", GAME_FLAGS )
+GAME( 2006, xtrmhnt2, awbios, aw2c, aw2c, naomi_state, xtrmhnt2, ROT0, "Sega", "Extreme Hunting 2", GAME_FLAGS )
GAME( 2008, claychal, awbios, aw2c, aw2c, naomi_state, atomiswave, ROT0, "Sega", "Sega Clay Challenge", GAME_FLAGS )
GAME( 2009, basschal, awbios, aw2c, aw2c, naomi_state, atomiswave, ROT0, "Sega", "Sega Bass Fishing Challenge", GAME_FLAGS )
diff --git a/src/mame/drivers/naughtyb.c b/src/mame/drivers/naughtyb.c
index bcc89e59a34..0b974aa43e7 100644
--- a/src/mame/drivers/naughtyb.c
+++ b/src/mame/drivers/naughtyb.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Brad Oliver,Sal and John Bugliarisi,Paul Priest
/***************************************************************************
@@ -416,7 +416,7 @@ static MACHINE_CONFIG_START( naughtyb, naughtyb_state )
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
MCFG_SCREEN_SIZE(36*8, 28*8)
MCFG_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 0*8, 28*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(naughtyb_state, screen_update_naughtyb)
+ MCFG_SCREEN_UPDATE_DRIVER(naughtyb_state, screen_update)
MCFG_SCREEN_PALETTE("palette")
MCFG_GFXDECODE_ADD("gfxdecode", "palette", naughtyb)
@@ -453,7 +453,7 @@ static MACHINE_CONFIG_START( popflame, naughtyb_state )
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
MCFG_SCREEN_SIZE(36*8, 28*8)
MCFG_SCREEN_VISIBLE_AREA(0*8, 36*8-1, 0*8, 28*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(naughtyb_state, screen_update_naughtyb)
+ MCFG_SCREEN_UPDATE_DRIVER(naughtyb_state, screen_update)
MCFG_SCREEN_PALETTE("palette")
MCFG_GFXDECODE_ADD("gfxdecode", "palette", naughtyb)
@@ -832,6 +832,10 @@ DRIVER_INIT_MEMBER(naughtyb_state,popflame)
m_maincpu->space(AS_PROGRAM).install_read_handler(0x9090, 0x9090, read8_delegate(FUNC(naughtyb_state::popflame_protection_r),this));
m_maincpu->space(AS_PROGRAM).install_write_handler(0xb000, 0xb0ff, write8_delegate(FUNC(naughtyb_state::popflame_protection_w),this));
+
+ save_item(NAME(m_popflame_prot_seed));
+ save_item(NAME(m_r_index));
+ save_item(NAME(m_prot_count));
}
@@ -860,18 +864,20 @@ DRIVER_INIT_MEMBER(naughtyb_state,trvmstr)
{
/* install questions' handlers */
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xc000, 0xc002, read8_delegate(FUNC(naughtyb_state::trvmstr_questions_r),this), write8_delegate(FUNC(naughtyb_state::trvmstr_questions_w),this));
+
+ save_item(NAME(m_question_offset));
}
-GAME( 1982, naughtyb, 0, naughtyb, naughtyb, driver_device, 0, ROT90, "Jaleco", "Naughty Boy", 0 )
-GAME( 1982, naughtyba,naughtyb, naughtyb, naughtyb, driver_device, 0, ROT90, "bootleg", "Naughty Boy (bootleg)", 0 )
-GAME( 1982, naughtybc,naughtyb, naughtyb, naughtyb, driver_device, 0, ROT90, "Jaleco (Cinematronics license)", "Naughty Boy (Cinematronics)", 0 )
-GAME( 1982, popflame, 0, popflame, naughtyb, naughtyb_state, popflame, ROT90, "Jaleco", "Pop Flamer (protected)", 0 )
-GAME( 1982, popflamea,popflame, popflame, naughtyb, driver_device, 0, ROT90, "Jaleco", "Pop Flamer (not protected)", 0 )
-GAME( 1982, popflameb,popflame, popflame, naughtyb, driver_device, 0, ROT90, "Jaleco", "Pop Flamer (hack?)", 0 )
-GAME( 1982, popflamen,popflame, naughtyb, naughtyb, driver_device, 0, ROT90, "Jaleco", "Pop Flamer (bootleg on Naughty Boy PCB)", 0 )
-GAME( 1985, trvmstr, 0, naughtyb, trvmstr, naughtyb_state, trvmstr, ROT90, "Enerdyne Technologies Inc.", "Trivia Master (set 1)", 0 )
-GAME( 1985, trvmstra, trvmstr, naughtyb, trvmstr, naughtyb_state, trvmstr, ROT90, "Enerdyne Technologies Inc.", "Trivia Master (set 2)", 0 )
-GAME( 1985, trvmstrb, trvmstr, naughtyb, trvmstr, naughtyb_state, trvmstr, ROT90, "Enerdyne Technologies Inc.", "Trivia Master (set 3)", 0 )
-GAME( 1985, trvmstrc, trvmstr, naughtyb, trvmstr, naughtyb_state, trvmstr, ROT90, "Enerdyne Technologies Inc.", "Trivia Master (set 4)", 0 )
-GAME( 1985, trvgns, trvmstr, naughtyb, trvmstr, naughtyb_state, trvmstr, ROT90, "bootleg", "Trivia Genius", 0 )
+GAME( 1982, naughtyb, 0, naughtyb, naughtyb, driver_device, 0, ROT90, "Jaleco", "Naughty Boy", GAME_SUPPORTS_SAVE )
+GAME( 1982, naughtyba,naughtyb, naughtyb, naughtyb, driver_device, 0, ROT90, "bootleg", "Naughty Boy (bootleg)", GAME_SUPPORTS_SAVE )
+GAME( 1982, naughtybc,naughtyb, naughtyb, naughtyb, driver_device, 0, ROT90, "Jaleco (Cinematronics license)", "Naughty Boy (Cinematronics)", GAME_SUPPORTS_SAVE )
+GAME( 1982, popflame, 0, popflame, naughtyb, naughtyb_state, popflame, ROT90, "Jaleco", "Pop Flamer (protected)", GAME_SUPPORTS_SAVE )
+GAME( 1982, popflamea,popflame, popflame, naughtyb, driver_device, 0, ROT90, "Jaleco", "Pop Flamer (not protected)", GAME_SUPPORTS_SAVE )
+GAME( 1982, popflameb,popflame, popflame, naughtyb, driver_device, 0, ROT90, "Jaleco", "Pop Flamer (hack?)", GAME_SUPPORTS_SAVE )
+GAME( 1982, popflamen,popflame, naughtyb, naughtyb, driver_device, 0, ROT90, "Jaleco", "Pop Flamer (bootleg on Naughty Boy PCB)", GAME_SUPPORTS_SAVE )
+GAME( 1985, trvmstr, 0, naughtyb, trvmstr, naughtyb_state, trvmstr, ROT90, "Enerdyne Technologies Inc.", "Trivia Master (set 1)", GAME_SUPPORTS_SAVE )
+GAME( 1985, trvmstra, trvmstr, naughtyb, trvmstr, naughtyb_state, trvmstr, ROT90, "Enerdyne Technologies Inc.", "Trivia Master (set 2)", GAME_SUPPORTS_SAVE )
+GAME( 1985, trvmstrb, trvmstr, naughtyb, trvmstr, naughtyb_state, trvmstr, ROT90, "Enerdyne Technologies Inc.", "Trivia Master (set 3)", GAME_SUPPORTS_SAVE )
+GAME( 1985, trvmstrc, trvmstr, naughtyb, trvmstr, naughtyb_state, trvmstr, ROT90, "Enerdyne Technologies Inc.", "Trivia Master (set 4)", GAME_SUPPORTS_SAVE )
+GAME( 1985, trvgns, trvmstr, naughtyb, trvmstr, naughtyb_state, trvmstr, ROT90, "bootleg", "Trivia Genius", GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/nbmj8991.c b/src/mame/drivers/nbmj8991.c
index cf83c2ac81b..fedf55349c2 100644
--- a/src/mame/drivers/nbmj8991.c
+++ b/src/mame/drivers/nbmj8991.c
@@ -39,29 +39,15 @@ Notes:
#include "machine/nvram.h"
-WRITE8_MEMBER(nbmj8991_state::nbmj8991_soundbank_w)
+WRITE8_MEMBER(nbmj8991_state::soundbank_w)
{
if (!(data & 0x80)) soundlatch_clear_byte_w(space, 0, 0);
membank("bank1")->set_entry(data & 0x03);
}
-WRITE8_MEMBER(nbmj8991_state::nbmj8991_sound_w)
-{
- soundlatch_byte_w(space, 0, data);
-}
-
-READ8_MEMBER(nbmj8991_state::nbmj8991_sound_r)
-{
- int data;
-
- data = soundlatch_byte_r(space,0);
- return data;
-}
-
void nbmj8991_state::machine_reset()
{
- device_t *audiocpu = m_audiocpu;
- if (audiocpu != NULL && audiocpu->type() == Z80)
+ if (m_audiocpu)
{
membank("bank1")->configure_entries(0, 4, memregion("audiocpu")->base() + 0x8000, 0x8000);
membank("bank1")->set_entry(0);
@@ -109,70 +95,70 @@ DRIVER_INIT_MEMBER(nbmj8991_state,tokimbsj)
static ADDRESS_MAP_START( pstadium_map, AS_PROGRAM, 8, nbmj8991_state )
AM_RANGE(0x0000, 0xefff) AM_ROM
- AM_RANGE(0xf000, 0xf00f) AM_READWRITE(nbmj8991_clut_r,nbmj8991_clut_w)
- AM_RANGE(0xf200, 0xf3ff) AM_RAM_WRITE(nbmj8991_palette_type3_w) AM_SHARE("paletteram")
+ AM_RANGE(0xf000, 0xf00f) AM_READWRITE(clut_r,clut_w)
+ AM_RANGE(0xf200, 0xf3ff) AM_RAM_WRITE(palette_type3_w) AM_SHARE("paletteram")
AM_RANGE(0xf800, 0xffff) AM_RAM AM_SHARE("nvram") // finalbny
ADDRESS_MAP_END
static ADDRESS_MAP_START( triplew1_map, AS_PROGRAM, 8, nbmj8991_state )
AM_RANGE(0x0000, 0xefff) AM_ROM
- AM_RANGE(0xf000, 0xf1ff) AM_RAM_WRITE(nbmj8991_palette_type3_w) AM_SHARE("paletteram")
- AM_RANGE(0xf200, 0xf20f) AM_READWRITE(nbmj8991_clut_r,nbmj8991_clut_w)
+ AM_RANGE(0xf000, 0xf1ff) AM_RAM_WRITE(palette_type3_w) AM_SHARE("paletteram")
+ AM_RANGE(0xf200, 0xf20f) AM_READWRITE(clut_r,clut_w)
AM_RANGE(0xf800, 0xffff) AM_RAM AM_SHARE("nvram") // mjgottub
ADDRESS_MAP_END
static ADDRESS_MAP_START( triplew2_map, AS_PROGRAM, 8, nbmj8991_state )
AM_RANGE(0x0000, 0xefff) AM_ROM
- AM_RANGE(0xf000, 0xf1ff) AM_RAM_WRITE(nbmj8991_palette_type3_w) AM_SHARE("paletteram")
- AM_RANGE(0xf400, 0xf40f) AM_READWRITE(nbmj8991_clut_r,nbmj8991_clut_w)
+ AM_RANGE(0xf000, 0xf1ff) AM_RAM_WRITE(palette_type3_w) AM_SHARE("paletteram")
+ AM_RANGE(0xf400, 0xf40f) AM_READWRITE(clut_r,clut_w)
AM_RANGE(0xf800, 0xffff) AM_RAM
ADDRESS_MAP_END
static ADDRESS_MAP_START( mjlstory_map, AS_PROGRAM, 8, nbmj8991_state )
AM_RANGE(0x0000, 0xefff) AM_ROM
- AM_RANGE(0xf200, 0xf3ff) AM_RAM_WRITE(nbmj8991_palette_type3_w) AM_SHARE("paletteram")
- AM_RANGE(0xf700, 0xf70f) AM_READWRITE(nbmj8991_clut_r,nbmj8991_clut_w)
+ AM_RANGE(0xf200, 0xf3ff) AM_RAM_WRITE(palette_type3_w) AM_SHARE("paletteram")
+ AM_RANGE(0xf700, 0xf70f) AM_READWRITE(clut_r,clut_w)
AM_RANGE(0xf800, 0xffff) AM_RAM
ADDRESS_MAP_END
static ADDRESS_MAP_START( galkoku_map, AS_PROGRAM, 8, nbmj8991_state )
AM_RANGE(0x0000, 0xefff) AM_ROM
- AM_RANGE(0xf000, 0xf00f) AM_READWRITE(nbmj8991_clut_r,nbmj8991_clut_w)
- AM_RANGE(0xf400, 0xf5ff) AM_RAM_WRITE(nbmj8991_palette_type1_w) AM_SHARE("paletteram")
+ AM_RANGE(0xf000, 0xf00f) AM_READWRITE(clut_r,clut_w)
+ AM_RANGE(0xf400, 0xf5ff) AM_RAM_WRITE(palette_type1_w) AM_SHARE("paletteram")
AM_RANGE(0xf800, 0xffff) AM_RAM AM_SHARE("nvram") // hyouban
ADDRESS_MAP_END
static ADDRESS_MAP_START( galkaika_map, AS_PROGRAM, 8, nbmj8991_state )
AM_RANGE(0x0000, 0xefff) AM_ROM
- AM_RANGE(0xf000, 0xf00f) AM_READWRITE(nbmj8991_clut_r,nbmj8991_clut_w)
- AM_RANGE(0xf400, 0xf5ff) AM_RAM_WRITE(nbmj8991_palette_type2_w) AM_SHARE("paletteram")
+ AM_RANGE(0xf000, 0xf00f) AM_READWRITE(clut_r,clut_w)
+ AM_RANGE(0xf400, 0xf5ff) AM_RAM_WRITE(palette_type2_w) AM_SHARE("paletteram")
AM_RANGE(0xf800, 0xffff) AM_RAM AM_SHARE("nvram") // tokimbsj
ADDRESS_MAP_END
static ADDRESS_MAP_START( tokyogal_map, AS_PROGRAM, 8, nbmj8991_state )
AM_RANGE(0x0000, 0xefff) AM_ROM
- AM_RANGE(0xf000, 0xf1ff) AM_RAM_WRITE(nbmj8991_palette_type2_w) AM_SHARE("paletteram")
- AM_RANGE(0xf400, 0xf40f) AM_READWRITE(nbmj8991_clut_r,nbmj8991_clut_w)
+ AM_RANGE(0xf000, 0xf1ff) AM_RAM_WRITE(palette_type2_w) AM_SHARE("paletteram")
+ AM_RANGE(0xf400, 0xf40f) AM_READWRITE(clut_r,clut_w)
AM_RANGE(0xf800, 0xffff) AM_RAM
ADDRESS_MAP_END
static ADDRESS_MAP_START( av2mj1bb_map, AS_PROGRAM, 8, nbmj8991_state )
AM_RANGE(0x0000, 0xefff) AM_ROM
- AM_RANGE(0xf000, 0xf1ff) AM_RAM_WRITE(nbmj8991_palette_type3_w) AM_SHARE("paletteram")
- AM_RANGE(0xf500, 0xf50f) AM_READWRITE(nbmj8991_clut_r,nbmj8991_clut_w)
+ AM_RANGE(0xf000, 0xf1ff) AM_RAM_WRITE(palette_type3_w) AM_SHARE("paletteram")
+ AM_RANGE(0xf500, 0xf50f) AM_READWRITE(clut_r,clut_w)
AM_RANGE(0xf800, 0xffff) AM_RAM
ADDRESS_MAP_END
static ADDRESS_MAP_START( av2mj2rg_map, AS_PROGRAM, 8, nbmj8991_state )
AM_RANGE(0x0000, 0xefff) AM_ROM
- AM_RANGE(0xf000, 0xf00f) AM_READWRITE(nbmj8991_clut_r,nbmj8991_clut_w)
- AM_RANGE(0xf200, 0xf3ff) AM_RAM_WRITE(nbmj8991_palette_type3_w) AM_SHARE("paletteram")
+ AM_RANGE(0xf000, 0xf00f) AM_READWRITE(clut_r,clut_w)
+ AM_RANGE(0xf200, 0xf3ff) AM_RAM_WRITE(palette_type3_w) AM_SHARE("paletteram")
AM_RANGE(0xf800, 0xffff) AM_RAM
ADDRESS_MAP_END
static ADDRESS_MAP_START( galkoku_io_map, AS_IO, 8, nbmj8991_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x00, 0x7f) AM_DEVREAD("nb1413m3", nb1413m3_device, sndrom_r) AM_WRITE(nbmj8991_blitter_w)
+ AM_RANGE(0x00, 0x7f) AM_DEVREAD("nb1413m3", nb1413m3_device, sndrom_r) AM_WRITE(blitter_w)
AM_RANGE(0x80, 0x81) AM_DEVWRITE("fmsnd", ym3812_device, write)
AM_RANGE(0x90, 0x90) AM_DEVREAD("nb1413m3", nb1413m3_device, inputport0_r)
AM_RANGE(0xa0, 0xa0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport1_r, inputportsel_w)
@@ -186,7 +172,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( hyouban_io_map, AS_IO, 8, nbmj8991_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x00, 0x7f) AM_DEVREAD("nb1413m3", nb1413m3_device, sndrom_r) AM_WRITE(nbmj8991_blitter_w)
+ AM_RANGE(0x00, 0x7f) AM_DEVREAD("nb1413m3", nb1413m3_device, sndrom_r) AM_WRITE(blitter_w)
AM_RANGE(0x81, 0x81) AM_DEVREAD("fmsnd", ay8910_device, data_r)
AM_RANGE(0x82, 0x83) AM_DEVWRITE("fmsnd", ay8910_device, data_address_w)
AM_RANGE(0x90, 0x90) AM_DEVREAD("nb1413m3", nb1413m3_device, inputport0_r)
@@ -201,8 +187,8 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( pstadium_io_map, AS_IO, 8, nbmj8991_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x00, 0x7f) AM_WRITE(nbmj8991_blitter_w)
- AM_RANGE(0x80, 0x80) AM_WRITE(nbmj8991_sound_w)
+ AM_RANGE(0x00, 0x7f) AM_WRITE(blitter_w)
+ AM_RANGE(0x80, 0x80) AM_WRITE(soundlatch_byte_w)
AM_RANGE(0x90, 0x90) AM_DEVREAD("nb1413m3", nb1413m3_device, inputport0_r)
AM_RANGE(0xa0, 0xa0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport1_r, inputportsel_w)
AM_RANGE(0xb0, 0xb0) AM_DEVREAD("nb1413m3", nb1413m3_device, inputport2_r) //AM_WRITENOP
@@ -214,8 +200,8 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( av2mj1bb_io_map, AS_IO, 8, nbmj8991_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x00, 0x7f) AM_WRITE(nbmj8991_blitter_w)
- AM_RANGE(0x80, 0x80) AM_WRITE(nbmj8991_sound_w)
+ AM_RANGE(0x00, 0x7f) AM_WRITE(blitter_w)
+ AM_RANGE(0x80, 0x80) AM_WRITE(soundlatch_byte_w)
AM_RANGE(0x90, 0x90) AM_DEVREAD("nb1413m3", nb1413m3_device, inputport0_r)
AM_RANGE(0xa0, 0xa0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport1_r, inputportsel_w)
AM_RANGE(0xb0, 0xb0) AM_DEVREADWRITE("nb1413m3", nb1413m3_device, inputport2_r, vcrctrl_w)
@@ -235,9 +221,9 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( nbmj8991_sound_io_map, AS_IO, 8, nbmj8991_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x00, 0x00) AM_READ(nbmj8991_sound_r) AM_DEVWRITE("dac1", dac_device, write_unsigned8)
+ AM_RANGE(0x00, 0x00) AM_READ(soundlatch_byte_r) AM_DEVWRITE("dac1", dac_device, write_unsigned8)
AM_RANGE(0x02, 0x02) AM_DEVWRITE("dac2", dac_device, write_unsigned8)
- AM_RANGE(0x04, 0x04) AM_WRITE(nbmj8991_soundbank_w)
+ AM_RANGE(0x04, 0x04) AM_WRITE(soundbank_w)
AM_RANGE(0x06, 0x06) AM_WRITENOP
AM_RANGE(0x80, 0x81) AM_DEVWRITE("fmsnd", ym3812_device, write)
ADDRESS_MAP_END
@@ -1401,7 +1387,7 @@ static MACHINE_CONFIG_START( nbmjdrv1, nbmj8991_state ) // galkoku
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
MCFG_SCREEN_SIZE(1024, 512)
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 240-1)
- MCFG_SCREEN_UPDATE_DRIVER(nbmj8991_state, screen_update_nbmj8991_type1)
+ MCFG_SCREEN_UPDATE_DRIVER(nbmj8991_state, screen_update_type1)
MCFG_SCREEN_PALETTE("palette")
MCFG_PALETTE_ADD("palette", 256)
@@ -1437,7 +1423,7 @@ static MACHINE_CONFIG_START( nbmjdrv2, nbmj8991_state ) // pstadium
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
MCFG_SCREEN_SIZE(1024, 512)
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 240-1)
- MCFG_SCREEN_UPDATE_DRIVER(nbmj8991_state, screen_update_nbmj8991_type2)
+ MCFG_SCREEN_UPDATE_DRIVER(nbmj8991_state, screen_update_type2)
MCFG_SCREEN_PALETTE("palette")
MCFG_PALETTE_ADD("palette", 256)
@@ -2148,21 +2134,21 @@ ROM_START( av2mj2rg )
ROM_END
-GAME( 1989, galkoku, 0, galkoku, galkoku, driver_device, 0, ROT180, "Nichibutsu / T.R.Tec", "Mahjong Gal no Kokuhaku (Japan)", 0 )
-GAME( 1989, hyouban, galkoku, hyouban, hyouban, driver_device, 0, ROT180, "Nichibutsu / T.R.Tec", "Mahjong Hyouban Musume [BET] (Japan)", 0 )
-GAME( 1989, galkaika, 0, galkaika, galkaika, nbmj8991_state, galkaika, ROT180, "Nichibutsu / T.R.Tec", "Mahjong Gal no Kaika (Japan)", 0 )
-GAME( 1989, tokyogal, 0, tokyogal, tokyogal, nbmj8991_state, tokyogal, ROT180, "Nichibutsu", "Tokyo Gal Zukan (Japan)", 0 )
-GAME( 1989, tokimbsj, tokyogal, tokimbsj, tokimbsj, nbmj8991_state, tokimbsj, ROT180, "Nichibutsu", "Tokimeki Bishoujo [BET] (Japan)", 0 )
-GAME( 1989, mcontest, 0, mcontest, mcontest, driver_device, 0, ROT180, "Nichibutsu", "Miss Mahjong Contest (Japan)", 0 )
-GAME( 1989, uchuuai, 0, uchuuai, uchuuai, driver_device, 0, ROT180, "Nichibutsu", "Mahjong Uchuu yori Ai wo komete (Japan)", 0 )
-GAME( 1989, triplew1, 0, triplew1, triplew1, driver_device, 0, ROT180, "Nichibutsu", "Mahjong Triple Wars (Japan)", 0 )
-GAME( 1990, pstadium, 0, pstadium, pstadium, driver_device, 0, ROT180, "Nichibutsu", "Mahjong Panic Stadium (Japan)", 0 )
-GAME( 1990, triplew2, 0, triplew2, triplew1, driver_device, 0, ROT180, "Nichibutsu", "Mahjong Triple Wars 2 (Japan)", 0 )
-GAME( 1990, ntopstar, 0, ntopstar, ntopstar, driver_device, 0, ROT180, "Nichibutsu", "Mahjong Nerae! Top Star (Japan)", 0 )
-GAME( 1991, mjlstory, 0, mjlstory, mjlstory, driver_device, 0, ROT180, "Nichibutsu", "Mahjong Jikken Love Story (Japan)", 0 )
-GAME( 1991, vanilla, 0, vanilla, vanilla, driver_device, 0, ROT180, "Nichibutsu", "Mahjong Vanilla Syndrome (Japan)", 0 )
-GAME( 1991, finalbny, vanilla, finalbny, finalbny, nbmj8991_state, finalbny, ROT180, "Nichibutsu", "Mahjong Final Bunny [BET] (Japan)", 0 )
-GAME( 1991, qmhayaku, 0, qmhayaku, qmhayaku, driver_device, 0, ROT180, "Nichibutsu", "Quiz-Mahjong Hayaku Yatteyo! (Japan)", 0 )
-GAME( 1991, mjgottub, 0, mjgottub, mjgottub, driver_device, 0, ROT180, "Nichibutsu", "Medal Mahjong Gottsu ee-kanji [BET] (Japan)", 0 )
-GAME( 1991, av2mj1bb, 0, av2mj1bb, av2mj1bb, driver_device, 0, ROT0, "Miki Syouji / AV Japan", "AV2Mahjong No.1 Bay Bridge no Seijo (Japan)", GAME_NOT_WORKING )
-GAME( 1991, av2mj2rg, 0, av2mj2rg, av2mj2rg, driver_device, 0, ROT0, "Miki Syouji / AV Japan", "AV2Mahjong No.2 Rouge no Kaori (Japan)", GAME_NOT_WORKING )
+GAME( 1989, galkoku, 0, galkoku, galkoku, driver_device, 0, ROT180, "Nichibutsu / T.R.Tec", "Mahjong Gal no Kokuhaku (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1989, hyouban, galkoku, hyouban, hyouban, driver_device, 0, ROT180, "Nichibutsu / T.R.Tec", "Mahjong Hyouban Musume [BET] (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1989, galkaika, 0, galkaika, galkaika, nbmj8991_state, galkaika, ROT180, "Nichibutsu / T.R.Tec", "Mahjong Gal no Kaika (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1989, tokyogal, 0, tokyogal, tokyogal, nbmj8991_state, tokyogal, ROT180, "Nichibutsu", "Tokyo Gal Zukan (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1989, tokimbsj, tokyogal, tokimbsj, tokimbsj, nbmj8991_state, tokimbsj, ROT180, "Nichibutsu", "Tokimeki Bishoujo [BET] (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1989, mcontest, 0, mcontest, mcontest, driver_device, 0, ROT180, "Nichibutsu", "Miss Mahjong Contest (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1989, uchuuai, 0, uchuuai, uchuuai, driver_device, 0, ROT180, "Nichibutsu", "Mahjong Uchuu yori Ai wo komete (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1989, triplew1, 0, triplew1, triplew1, driver_device, 0, ROT180, "Nichibutsu", "Mahjong Triple Wars (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1990, pstadium, 0, pstadium, pstadium, driver_device, 0, ROT180, "Nichibutsu", "Mahjong Panic Stadium (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1990, triplew2, 0, triplew2, triplew1, driver_device, 0, ROT180, "Nichibutsu", "Mahjong Triple Wars 2 (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1990, ntopstar, 0, ntopstar, ntopstar, driver_device, 0, ROT180, "Nichibutsu", "Mahjong Nerae! Top Star (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1991, mjlstory, 0, mjlstory, mjlstory, driver_device, 0, ROT180, "Nichibutsu", "Mahjong Jikken Love Story (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1991, vanilla, 0, vanilla, vanilla, driver_device, 0, ROT180, "Nichibutsu", "Mahjong Vanilla Syndrome (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1991, finalbny, vanilla, finalbny, finalbny, nbmj8991_state, finalbny, ROT180, "Nichibutsu", "Mahjong Final Bunny [BET] (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1991, qmhayaku, 0, qmhayaku, qmhayaku, driver_device, 0, ROT180, "Nichibutsu", "Quiz-Mahjong Hayaku Yatteyo! (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1991, mjgottub, 0, mjgottub, mjgottub, driver_device, 0, ROT180, "Nichibutsu", "Medal Mahjong Gottsu ee-kanji [BET] (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1991, av2mj1bb, 0, av2mj1bb, av2mj1bb, driver_device, 0, ROT0, "Miki Syouji / AV Japan", "AV2Mahjong No.1 Bay Bridge no Seijo (Japan)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
+GAME( 1991, av2mj2rg, 0, av2mj2rg, av2mj2rg, driver_device, 0, ROT0, "Miki Syouji / AV Japan", "AV2Mahjong No.2 Rouge no Kaori (Japan)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/nbmj9195.c b/src/mame/drivers/nbmj9195.c
index 840b74492f6..02a881ccccb 100644
--- a/src/mame/drivers/nbmj9195.c
+++ b/src/mame/drivers/nbmj9195.c
@@ -22,7 +22,6 @@ Notes:
******************************************************************************/
#include "emu.h"
-#include "cpu/z80/tmpz84c011.h"
#include "machine/nvram.h"
#include "includes/nb1413m3.h" // needed for mahjong input controller
#include "sound/3812intf.h"
@@ -30,29 +29,22 @@ Notes:
#include "includes/nbmj9195.h"
-WRITE8_MEMBER(nbmj9195_state::nbmj9195_soundbank_w)
+void nbmj9195_state::machine_start()
{
- UINT8 *SNDROM = memregion("audiocpu")->base();
-
- membank("bank1")->set_base(&SNDROM[0x08000 + (0x8000 * (data & 0x03))]);
-}
-
-READ8_MEMBER(nbmj9195_state::nbmj9195_sound_r)
-{
- return soundlatch_byte_r(space, 0);
-}
-
-WRITE8_MEMBER(nbmj9195_state::nbmj9195_sound_w)
-{
- soundlatch_byte_w(space, 0, data);
+ membank("soundbank")->configure_entries(0, 4, memregion("audiocpu")->base() + 0x8000, 0x8000);
+
+ save_item(NAME(m_inputport));
+ save_item(NAME(m_dipswbitsel));
+ save_item(NAME(m_outcoin_flag));
+ save_item(NAME(m_mscoutm_inputport));
}
-WRITE8_MEMBER(nbmj9195_state::nbmj9195_soundclr_w)
+WRITE8_MEMBER(nbmj9195_state::soundbank_w)
{
- soundlatch_clear_byte_w(space, 0, 0);
+ membank("soundbank")->set_entry(data & 0x03);
}
-void nbmj9195_state::nbmj9195_outcoin_flag_w(int data)
+WRITE8_MEMBER(nbmj9195_state::outcoin_flag_w)
{
// bit0: coin in counter
// bit1: coin out counter
@@ -63,17 +55,17 @@ void nbmj9195_state::nbmj9195_outcoin_flag_w(int data)
else m_outcoin_flag = 1;
}
-WRITE8_MEMBER(nbmj9195_state::nbmj9195_inputportsel_w)
+WRITE8_MEMBER(nbmj9195_state::inputportsel_w)
{
m_inputport = (data ^ 0xff);
}
-int nbmj9195_state::nbmj9195_dipsw_r()
+int nbmj9195_state::dipsw_r()
{
return (((ioport("DSWA")->read() & 0xff) | ((ioport("DSWB")->read() & 0xff) << 8)) >> m_dipswbitsel) & 0x01;
}
-void nbmj9195_state::nbmj9195_dipswbitsel_w(int data)
+WRITE8_MEMBER(nbmj9195_state::dipswbitsel_w)
{
switch (data & 0xc0)
{
@@ -92,7 +84,7 @@ void nbmj9195_state::nbmj9195_dipswbitsel_w(int data)
}
}
-void nbmj9195_state::mscoutm_inputportsel_w( int data)
+WRITE8_MEMBER(nbmj9195_state::mscoutm_inputportsel_w)
{
m_mscoutm_inputport = (data ^ 0xff);
}
@@ -118,13 +110,6 @@ READ8_MEMBER(nbmj9195_state::mscoutm_dipsw_1_r)
/* TMPZ84C011 PIO emulation */
-// mscoutm, imekura, mjegolf
-READ8_MEMBER(nbmj9195_state::mscoutm_cpu_porta_r)
-{
- // COIN IN, ETC...
- return ioport("SYSTEM")->read();
-}
-
READ8_MEMBER(nbmj9195_state::mscoutm_cpu_portb_r)
{
// PLAYER1 KEY, DIPSW A/B
@@ -167,24 +152,6 @@ READ8_MEMBER(nbmj9195_state::mscoutm_cpu_portc_r)
}
}
-
-
-// mscoutm, imekura, mjegolf
-WRITE8_MEMBER(nbmj9195_state::mscoutm_cpu_porta_w)
-{
- mscoutm_inputportsel_w(data); // NB22090
-}
-
-WRITE8_MEMBER(nbmj9195_state::mscoutm_cpu_portd_w)
-{
- nbmj9195_clutsel_w(data);
-}
-
-WRITE8_MEMBER(nbmj9195_state::mscoutm_cpu_porte_w)
-{
- nbmj9195_gfxflag2_w(data); // NB22090
-}
-
// other games
READ8_MEMBER(nbmj9195_state::others_cpu_porta_r)
@@ -207,7 +174,7 @@ READ8_MEMBER(nbmj9195_state::others_cpu_portb_r)
case 0x08:
return ioport("KEY3")->read();
case 0x10:
- return ((ioport("KEY4")->read() & 0x7f) | (nbmj9195_dipsw_r() << 7));
+ return ((ioport("KEY4")->read() & 0x7f) | (dipsw_r() << 7));
default:
return (ioport("KEY0")->read() & ioport("KEY1")->read() & ioport("KEY2")->read() & ioport("KEY3")->read() & (ioport("KEY4")->read() & 0x7f));
}
@@ -233,59 +200,9 @@ READ8_MEMBER(nbmj9195_state::others_cpu_portc_r)
}
}
-
-WRITE8_MEMBER(nbmj9195_state::others_cpu_portc_w)
-{
- nbmj9195_dipswbitsel_w(data);
-}
-
-WRITE8_MEMBER(nbmj9195_state::others_cpu_portd_w)
-{
- nbmj9195_clutsel_w(data);
-}
-
-WRITE8_MEMBER(nbmj9195_state::others_cpu_porte_w)
-{
- nbmj9195_outcoin_flag_w(data);
-}
-
-
-/* TMPZ84C011 sound CPU */
-
-READ8_MEMBER(nbmj9195_state::soundcpu_portd_r)
-{
- return nbmj9195_sound_r(space, 0);
-}
-
-WRITE8_MEMBER(nbmj9195_state::soundcpu_porta_w)
-{
- nbmj9195_soundbank_w(space, 0, data);
-}
-
-WRITE8_MEMBER(nbmj9195_state::soundcpu_dac1_w)
-{
- m_dac1->write_unsigned8(data);
-}
-
-WRITE8_MEMBER(nbmj9195_state::soundcpu_dac2_w)
-{
- m_dac2->write_unsigned8(data);
-}
-
-WRITE8_MEMBER(nbmj9195_state::mscoutm_soundcpu_portb_w)
-{
- m_dac2->write_unsigned8(data);
-}
-
-WRITE8_MEMBER(nbmj9195_state::mscoutm_soundcpu_portc_w)
-{
- m_dac1->write_unsigned8(data);
-}
-
-
WRITE8_MEMBER(nbmj9195_state::soundcpu_porte_w)
{
- if (!(data & 0x01)) nbmj9195_soundclr_w(space, 0, 0);
+ if (!(data & 0x01)) soundlatch_clear_byte_w(space, 0, 0);
}
@@ -304,53 +221,48 @@ void nbmj9195_state::machine_reset()
DRIVER_INIT_MEMBER(nbmj9195_state,nbmj9195)
{
- address_space &space = m_maincpu->space(AS_PROGRAM);
UINT8 *ROM = memregion("audiocpu")->base();
// sound program patch
ROM[0x0213] = 0x00; // DI -> NOP
-
- // initialize sound rom bank
- nbmj9195_soundbank_w(space, 0, 0);
- logerror("DRIVER_INIT( nbmj9195 )\n");
}
static ADDRESS_MAP_START( sailorws_map, AS_PROGRAM, 8, nbmj9195_state )
AM_RANGE(0x0000, 0xefff) AM_ROM
- AM_RANGE(0xf000, 0xf1ff) AM_READWRITE(nbmj9195_palette_r,nbmj9195_palette_w)
+ AM_RANGE(0xf000, 0xf1ff) AM_RAM_WRITE(palette_w) AM_SHARE("paletteram")
AM_RANGE(0xf800, 0xffff) AM_RAM AM_SHARE("nvram")
ADDRESS_MAP_END
static ADDRESS_MAP_START( mjuraden_map, AS_PROGRAM, 8, nbmj9195_state )
AM_RANGE(0x0000, 0xefff) AM_ROM
- AM_RANGE(0xf200, 0xf3ff) AM_READWRITE(nbmj9195_palette_r,nbmj9195_palette_w)
+ AM_RANGE(0xf200, 0xf3ff) AM_RAM_WRITE(palette_w) AM_SHARE("paletteram")
AM_RANGE(0xf800, 0xffff) AM_RAM
ADDRESS_MAP_END
static ADDRESS_MAP_START( koinomp_map, AS_PROGRAM, 8, nbmj9195_state )
AM_RANGE(0x0000, 0xdfff) AM_ROM
- AM_RANGE(0xe000, 0xe1ff) AM_READWRITE(nbmj9195_palette_r,nbmj9195_palette_w)
+ AM_RANGE(0xe000, 0xe1ff) AM_RAM_WRITE(palette_w) AM_SHARE("paletteram")
AM_RANGE(0xe800, 0xefff) AM_RAM AM_SHARE("nvram")
ADDRESS_MAP_END
static ADDRESS_MAP_START( ngpgal_map, AS_PROGRAM, 8, nbmj9195_state )
AM_RANGE(0x0000, 0xcfff) AM_ROM
- AM_RANGE(0xd000, 0xd1ff) AM_READWRITE(nbmj9195_palette_r,nbmj9195_palette_w)
+ AM_RANGE(0xd000, 0xd1ff) AM_RAM_WRITE(palette_w) AM_SHARE("paletteram")
AM_RANGE(0xd800, 0xdfff) AM_RAM
ADDRESS_MAP_END
static ADDRESS_MAP_START( mscoutm_map, AS_PROGRAM, 8, nbmj9195_state )
AM_RANGE(0x0000, 0xdfff) AM_ROM
AM_RANGE(0xe000, 0xe5ff) AM_RAM
- AM_RANGE(0xe600, 0xebff) AM_READWRITE(nbmj9195_nb22090_palette_r,nbmj9195_nb22090_palette_w)
+ AM_RANGE(0xe600, 0xebff) AM_RAM_WRITE(nb22090_palette_w) AM_SHARE("paletteram")
AM_RANGE(0xec00, 0xf1ff) AM_RAM
AM_RANGE(0xf200, 0xffff) AM_RAM
ADDRESS_MAP_END
static ADDRESS_MAP_START( mjegolf_map, AS_PROGRAM, 8, nbmj9195_state )
AM_RANGE(0x0000, 0xdfff) AM_ROM
- AM_RANGE(0xe000, 0xe5ff) AM_READWRITE(nbmj9195_nb22090_palette_r,nbmj9195_nb22090_palette_w)
+ AM_RANGE(0xe000, 0xe5ff) AM_RAM_WRITE(nb22090_palette_w) AM_SHARE("paletteram")
AM_RANGE(0xe600, 0xebff) AM_RAM
AM_RANGE(0xec00, 0xf1ff) AM_RAM
AM_RANGE(0xf200, 0xffff) AM_RAM
@@ -359,264 +271,264 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( mjuraden_io_map, AS_IO, 8, nbmj9195_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x80, 0x81) AM_READ(nbmj9195_blitter_0_r)
- AM_RANGE(0x80, 0x8f) AM_WRITE(nbmj9195_blitter_0_w)
- AM_RANGE(0x90, 0x9f) AM_WRITE(nbmj9195_clut_0_w)
+ AM_RANGE(0x80, 0x81) AM_READ(blitter_0_r)
+ AM_RANGE(0x80, 0x8f) AM_WRITE(blitter_0_w)
+ AM_RANGE(0x90, 0x9f) AM_WRITE(clut_0_w)
- AM_RANGE(0xb0, 0xb0) AM_WRITE(nbmj9195_sound_w)
+ AM_RANGE(0xb0, 0xb0) AM_WRITE(soundlatch_byte_w)
AM_RANGE(0xb2, 0xb2) AM_WRITENOP
AM_RANGE(0xb4, 0xb4) AM_WRITENOP
- AM_RANGE(0xb6, 0xb6) AM_WRITE(nbmj9195_inputportsel_w)
+ AM_RANGE(0xb6, 0xb6) AM_WRITE(inputportsel_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( koinomp_io_map, AS_IO, 8, nbmj9195_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x80, 0x81) AM_READ(nbmj9195_blitter_0_r)
- AM_RANGE(0x80, 0x8f) AM_WRITE(nbmj9195_blitter_0_w)
- AM_RANGE(0x90, 0x9f) AM_WRITE(nbmj9195_clut_0_w)
+ AM_RANGE(0x80, 0x81) AM_READ(blitter_0_r)
+ AM_RANGE(0x80, 0x8f) AM_WRITE(blitter_0_w)
+ AM_RANGE(0x90, 0x9f) AM_WRITE(clut_0_w)
- AM_RANGE(0xa0, 0xa1) AM_READ(nbmj9195_blitter_1_r)
- AM_RANGE(0xa0, 0xaf) AM_WRITE(nbmj9195_blitter_1_w)
- AM_RANGE(0xb0, 0xbf) AM_WRITE(nbmj9195_clut_1_w)
+ AM_RANGE(0xa0, 0xa1) AM_READ(blitter_1_r)
+ AM_RANGE(0xa0, 0xaf) AM_WRITE(blitter_1_w)
+ AM_RANGE(0xb0, 0xbf) AM_WRITE(clut_1_w)
- AM_RANGE(0xc0, 0xc0) AM_WRITE(nbmj9195_sound_w)
+ AM_RANGE(0xc0, 0xc0) AM_WRITE(soundlatch_byte_w)
AM_RANGE(0xc2, 0xc2) AM_WRITENOP
AM_RANGE(0xc4, 0xc4) AM_WRITENOP
- AM_RANGE(0xc6, 0xc6) AM_WRITE(nbmj9195_inputportsel_w)
+ AM_RANGE(0xc6, 0xc6) AM_WRITE(inputportsel_w)
AM_RANGE(0xcf, 0xcf) AM_WRITENOP
ADDRESS_MAP_END
static ADDRESS_MAP_START( patimono_io_map, AS_IO, 8, nbmj9195_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x80, 0x81) AM_READ(nbmj9195_blitter_1_r)
- AM_RANGE(0x80, 0x8f) AM_WRITE(nbmj9195_blitter_1_w)
+ AM_RANGE(0x80, 0x81) AM_READ(blitter_1_r)
+ AM_RANGE(0x80, 0x8f) AM_WRITE(blitter_1_w)
- AM_RANGE(0x90, 0x9f) AM_WRITE(nbmj9195_clut_0_w)
- AM_RANGE(0xa0, 0xa0) AM_WRITE(nbmj9195_sound_w)
+ AM_RANGE(0x90, 0x9f) AM_WRITE(clut_0_w)
+ AM_RANGE(0xa0, 0xa0) AM_WRITE(soundlatch_byte_w)
AM_RANGE(0xa4, 0xa4) AM_WRITENOP
AM_RANGE(0xa8, 0xa8) AM_WRITENOP
- AM_RANGE(0xb0, 0xb8) AM_WRITE(nbmj9195_inputportsel_w)
+ AM_RANGE(0xb0, 0xb8) AM_WRITE(inputportsel_w)
- AM_RANGE(0xc0, 0xc1) AM_READ(nbmj9195_blitter_0_r)
- AM_RANGE(0xc0, 0xcf) AM_WRITE(nbmj9195_blitter_0_w)
- AM_RANGE(0xd0, 0xdf) AM_WRITE(nbmj9195_clut_1_w)
+ AM_RANGE(0xc0, 0xc1) AM_READ(blitter_0_r)
+ AM_RANGE(0xc0, 0xcf) AM_WRITE(blitter_0_w)
+ AM_RANGE(0xd0, 0xdf) AM_WRITE(clut_1_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( mmehyou_io_map, AS_IO, 8, nbmj9195_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x80, 0x81) AM_READ(nbmj9195_blitter_0_r)
- AM_RANGE(0x80, 0x8f) AM_WRITE(nbmj9195_blitter_0_w)
- AM_RANGE(0x90, 0x9f) AM_WRITE(nbmj9195_clut_0_w)
+ AM_RANGE(0x80, 0x81) AM_READ(blitter_0_r)
+ AM_RANGE(0x80, 0x8f) AM_WRITE(blitter_0_w)
+ AM_RANGE(0x90, 0x9f) AM_WRITE(clut_0_w)
- AM_RANGE(0xa0, 0xa0) AM_WRITE(nbmj9195_sound_w)
+ AM_RANGE(0xa0, 0xa0) AM_WRITE(soundlatch_byte_w)
AM_RANGE(0xa4, 0xa4) AM_WRITENOP
AM_RANGE(0xa8, 0xa8) AM_WRITENOP
- AM_RANGE(0xb0, 0xb0) AM_WRITE(nbmj9195_inputportsel_w)
+ AM_RANGE(0xb0, 0xb0) AM_WRITE(inputportsel_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( gal10ren_io_map, AS_IO, 8, nbmj9195_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x60, 0x61) AM_READ(nbmj9195_blitter_0_r)
- AM_RANGE(0x60, 0x6f) AM_WRITE(nbmj9195_blitter_0_w)
- AM_RANGE(0x70, 0x7f) AM_WRITE(nbmj9195_clut_0_w)
+ AM_RANGE(0x60, 0x61) AM_READ(blitter_0_r)
+ AM_RANGE(0x60, 0x6f) AM_WRITE(blitter_0_w)
+ AM_RANGE(0x70, 0x7f) AM_WRITE(clut_0_w)
- AM_RANGE(0xa0, 0xa1) AM_READ(nbmj9195_blitter_1_r)
- AM_RANGE(0xa0, 0xaf) AM_WRITE(nbmj9195_blitter_1_w)
- AM_RANGE(0xb0, 0xbf) AM_WRITE(nbmj9195_clut_1_w)
+ AM_RANGE(0xa0, 0xa1) AM_READ(blitter_1_r)
+ AM_RANGE(0xa0, 0xaf) AM_WRITE(blitter_1_w)
+ AM_RANGE(0xb0, 0xbf) AM_WRITE(clut_1_w)
- AM_RANGE(0xc0, 0xc0) AM_WRITE(nbmj9195_sound_w)
+ AM_RANGE(0xc0, 0xc0) AM_WRITE(soundlatch_byte_w)
AM_RANGE(0xc8, 0xc8) AM_WRITENOP
AM_RANGE(0xd0, 0xd0) AM_WRITENOP
- AM_RANGE(0xd8, 0xd8) AM_WRITE(nbmj9195_inputportsel_w)
+ AM_RANGE(0xd8, 0xd8) AM_WRITE(inputportsel_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( renaiclb_io_map, AS_IO, 8, nbmj9195_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x20, 0x20) AM_WRITE(nbmj9195_sound_w)
+ AM_RANGE(0x20, 0x20) AM_WRITE(soundlatch_byte_w)
AM_RANGE(0x24, 0x24) AM_WRITENOP
AM_RANGE(0x28, 0x28) AM_WRITENOP
- AM_RANGE(0x2c, 0x2c) AM_WRITE(nbmj9195_inputportsel_w)
+ AM_RANGE(0x2c, 0x2c) AM_WRITE(inputportsel_w)
- AM_RANGE(0x60, 0x61) AM_READ(nbmj9195_blitter_0_r)
- AM_RANGE(0x60, 0x6f) AM_WRITE(nbmj9195_blitter_1_w)
- AM_RANGE(0x70, 0x7f) AM_WRITE(nbmj9195_clut_1_w)
+ AM_RANGE(0x60, 0x61) AM_READ(blitter_0_r)
+ AM_RANGE(0x60, 0x6f) AM_WRITE(blitter_1_w)
+ AM_RANGE(0x70, 0x7f) AM_WRITE(clut_1_w)
- AM_RANGE(0xe0, 0xe1) AM_READ(nbmj9195_blitter_1_r)
- AM_RANGE(0xe0, 0xef) AM_WRITE(nbmj9195_blitter_0_w)
- AM_RANGE(0xf0, 0xff) AM_WRITE(nbmj9195_clut_0_w)
+ AM_RANGE(0xe0, 0xe1) AM_READ(blitter_1_r)
+ AM_RANGE(0xe0, 0xef) AM_WRITE(blitter_0_w)
+ AM_RANGE(0xf0, 0xff) AM_WRITE(clut_0_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( mjlaman_io_map, AS_IO, 8, nbmj9195_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x20, 0x20) AM_WRITE(nbmj9195_sound_w)
+ AM_RANGE(0x20, 0x20) AM_WRITE(soundlatch_byte_w)
AM_RANGE(0x22, 0x22) AM_WRITENOP
AM_RANGE(0x24, 0x24) AM_WRITENOP
- AM_RANGE(0x26, 0x26) AM_WRITE(nbmj9195_inputportsel_w)
+ AM_RANGE(0x26, 0x26) AM_WRITE(inputportsel_w)
- AM_RANGE(0x80, 0x81) AM_READ(nbmj9195_blitter_0_r)
- AM_RANGE(0x80, 0x8f) AM_WRITE(nbmj9195_blitter_0_w)
- AM_RANGE(0x90, 0x9f) AM_WRITE(nbmj9195_clut_0_w)
+ AM_RANGE(0x80, 0x81) AM_READ(blitter_0_r)
+ AM_RANGE(0x80, 0x8f) AM_WRITE(blitter_0_w)
+ AM_RANGE(0x90, 0x9f) AM_WRITE(clut_0_w)
- AM_RANGE(0xe0, 0xe1) AM_READ(nbmj9195_blitter_1_r)
- AM_RANGE(0xe0, 0xef) AM_WRITE(nbmj9195_blitter_1_w)
- AM_RANGE(0xf0, 0xff) AM_WRITE(nbmj9195_clut_1_w)
+ AM_RANGE(0xe0, 0xe1) AM_READ(blitter_1_r)
+ AM_RANGE(0xe0, 0xef) AM_WRITE(blitter_1_w)
+ AM_RANGE(0xf0, 0xff) AM_WRITE(clut_1_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( mkeibaou_io_map, AS_IO, 8, nbmj9195_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x80, 0x81) AM_READ(nbmj9195_blitter_0_r)
- AM_RANGE(0x80, 0x8f) AM_WRITE(nbmj9195_blitter_0_w)
- AM_RANGE(0x90, 0x9f) AM_WRITE(nbmj9195_clut_0_w)
+ AM_RANGE(0x80, 0x81) AM_READ(blitter_0_r)
+ AM_RANGE(0x80, 0x8f) AM_WRITE(blitter_0_w)
+ AM_RANGE(0x90, 0x9f) AM_WRITE(clut_0_w)
- AM_RANGE(0xa0, 0xa1) AM_READ(nbmj9195_blitter_1_r)
- AM_RANGE(0xa0, 0xaf) AM_WRITE(nbmj9195_blitter_1_w)
- AM_RANGE(0xb0, 0xbf) AM_WRITE(nbmj9195_clut_1_w)
+ AM_RANGE(0xa0, 0xa1) AM_READ(blitter_1_r)
+ AM_RANGE(0xa0, 0xaf) AM_WRITE(blitter_1_w)
+ AM_RANGE(0xb0, 0xbf) AM_WRITE(clut_1_w)
- AM_RANGE(0xd8, 0xd8) AM_WRITE(nbmj9195_sound_w)
+ AM_RANGE(0xd8, 0xd8) AM_WRITE(soundlatch_byte_w)
AM_RANGE(0xda, 0xda) AM_WRITENOP
AM_RANGE(0xdc, 0xdc) AM_WRITENOP
- AM_RANGE(0xde, 0xde) AM_WRITE(nbmj9195_inputportsel_w)
+ AM_RANGE(0xde, 0xde) AM_WRITE(inputportsel_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( pachiten_io_map, AS_IO, 8, nbmj9195_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x60, 0x61) AM_READ(nbmj9195_blitter_0_r)
- AM_RANGE(0x60, 0x6f) AM_WRITE(nbmj9195_blitter_0_w)
- AM_RANGE(0x70, 0x7f) AM_WRITE(nbmj9195_clut_0_w)
+ AM_RANGE(0x60, 0x61) AM_READ(blitter_0_r)
+ AM_RANGE(0x60, 0x6f) AM_WRITE(blitter_0_w)
+ AM_RANGE(0x70, 0x7f) AM_WRITE(clut_0_w)
- AM_RANGE(0xa0, 0xa1) AM_READ(nbmj9195_blitter_1_r)
- AM_RANGE(0xa0, 0xaf) AM_WRITE(nbmj9195_blitter_1_w)
- AM_RANGE(0xb0, 0xbf) AM_WRITE(nbmj9195_clut_1_w)
+ AM_RANGE(0xa0, 0xa1) AM_READ(blitter_1_r)
+ AM_RANGE(0xa0, 0xaf) AM_WRITE(blitter_1_w)
+ AM_RANGE(0xb0, 0xbf) AM_WRITE(clut_1_w)
- AM_RANGE(0xe0, 0xe0) AM_WRITE(nbmj9195_sound_w)
+ AM_RANGE(0xe0, 0xe0) AM_WRITE(soundlatch_byte_w)
AM_RANGE(0xe2, 0xe2) AM_WRITENOP
AM_RANGE(0xe4, 0xe4) AM_WRITENOP
- AM_RANGE(0xe6, 0xe6) AM_WRITE(nbmj9195_inputportsel_w)
+ AM_RANGE(0xe6, 0xe6) AM_WRITE(inputportsel_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( sailorws_io_map, AS_IO, 8, nbmj9195_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x60, 0x61) AM_READ(nbmj9195_blitter_0_r)
- AM_RANGE(0x60, 0x6f) AM_WRITE(nbmj9195_blitter_0_w)
- AM_RANGE(0x70, 0x7f) AM_WRITE(nbmj9195_clut_0_w)
+ AM_RANGE(0x60, 0x61) AM_READ(blitter_0_r)
+ AM_RANGE(0x60, 0x6f) AM_WRITE(blitter_0_w)
+ AM_RANGE(0x70, 0x7f) AM_WRITE(clut_0_w)
- AM_RANGE(0x80, 0x81) AM_READ(nbmj9195_blitter_1_r)
- AM_RANGE(0x80, 0x8f) AM_WRITE(nbmj9195_blitter_1_w)
- AM_RANGE(0x90, 0x9f) AM_WRITE(nbmj9195_clut_1_w)
+ AM_RANGE(0x80, 0x81) AM_READ(blitter_1_r)
+ AM_RANGE(0x80, 0x8f) AM_WRITE(blitter_1_w)
+ AM_RANGE(0x90, 0x9f) AM_WRITE(clut_1_w)
- AM_RANGE(0xf0, 0xf0) AM_WRITE(nbmj9195_sound_w)
+ AM_RANGE(0xf0, 0xf0) AM_WRITE(soundlatch_byte_w)
AM_RANGE(0xf2, 0xf2) AM_WRITENOP
AM_RANGE(0xf4, 0xf4) AM_WRITENOP
- AM_RANGE(0xf6, 0xf6) AM_WRITE(nbmj9195_inputportsel_w)
+ AM_RANGE(0xf6, 0xf6) AM_WRITE(inputportsel_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( sailorwr_io_map, AS_IO, 8, nbmj9195_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x60, 0x61) AM_READ(nbmj9195_blitter_0_r)
- AM_RANGE(0x60, 0x6f) AM_WRITE(nbmj9195_blitter_0_w)
- AM_RANGE(0x70, 0x7f) AM_WRITE(nbmj9195_clut_0_w)
+ AM_RANGE(0x60, 0x61) AM_READ(blitter_0_r)
+ AM_RANGE(0x60, 0x6f) AM_WRITE(blitter_0_w)
+ AM_RANGE(0x70, 0x7f) AM_WRITE(clut_0_w)
- AM_RANGE(0x80, 0x81) AM_READ(nbmj9195_blitter_1_r)
- AM_RANGE(0x80, 0x8f) AM_WRITE(nbmj9195_blitter_1_w)
- AM_RANGE(0x90, 0x9f) AM_WRITE(nbmj9195_clut_1_w)
+ AM_RANGE(0x80, 0x81) AM_READ(blitter_1_r)
+ AM_RANGE(0x80, 0x8f) AM_WRITE(blitter_1_w)
+ AM_RANGE(0x90, 0x9f) AM_WRITE(clut_1_w)
- AM_RANGE(0xf8, 0xf8) AM_WRITE(nbmj9195_sound_w)
+ AM_RANGE(0xf8, 0xf8) AM_WRITE(soundlatch_byte_w)
AM_RANGE(0xfa, 0xfa) AM_WRITENOP
AM_RANGE(0xfc, 0xfc) AM_WRITENOP
- AM_RANGE(0xfe, 0xfe) AM_WRITE(nbmj9195_inputportsel_w)
+ AM_RANGE(0xfe, 0xfe) AM_WRITE(inputportsel_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( psailor1_io_map, AS_IO, 8, nbmj9195_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x60, 0x61) AM_READ(nbmj9195_blitter_0_r)
- AM_RANGE(0x60, 0x6f) AM_WRITE(nbmj9195_blitter_0_w)
- AM_RANGE(0x70, 0x7f) AM_WRITE(nbmj9195_clut_0_w)
+ AM_RANGE(0x60, 0x61) AM_READ(blitter_0_r)
+ AM_RANGE(0x60, 0x6f) AM_WRITE(blitter_0_w)
+ AM_RANGE(0x70, 0x7f) AM_WRITE(clut_0_w)
- AM_RANGE(0xc0, 0xc1) AM_READ(nbmj9195_blitter_1_r)
- AM_RANGE(0xc0, 0xcf) AM_WRITE(nbmj9195_blitter_1_w)
- AM_RANGE(0xd0, 0xdf) AM_WRITE(nbmj9195_clut_1_w)
+ AM_RANGE(0xc0, 0xc1) AM_READ(blitter_1_r)
+ AM_RANGE(0xc0, 0xcf) AM_WRITE(blitter_1_w)
+ AM_RANGE(0xd0, 0xdf) AM_WRITE(clut_1_w)
- AM_RANGE(0xf0, 0xf0) AM_WRITE(nbmj9195_sound_w)
+ AM_RANGE(0xf0, 0xf0) AM_WRITE(soundlatch_byte_w)
AM_RANGE(0xf2, 0xf2) AM_WRITENOP
AM_RANGE(0xf4, 0xf4) AM_WRITENOP
- AM_RANGE(0xf6, 0xf6) AM_WRITE(nbmj9195_inputportsel_w)
+ AM_RANGE(0xf6, 0xf6) AM_WRITE(inputportsel_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( psailor2_io_map, AS_IO, 8, nbmj9195_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x60, 0x61) AM_READ(nbmj9195_blitter_0_r)
- AM_RANGE(0x60, 0x6f) AM_WRITE(nbmj9195_blitter_0_w)
- AM_RANGE(0x70, 0x7f) AM_WRITE(nbmj9195_clut_0_w)
+ AM_RANGE(0x60, 0x61) AM_READ(blitter_0_r)
+ AM_RANGE(0x60, 0x6f) AM_WRITE(blitter_0_w)
+ AM_RANGE(0x70, 0x7f) AM_WRITE(clut_0_w)
- AM_RANGE(0xa0, 0xa1) AM_READ(nbmj9195_blitter_1_r)
- AM_RANGE(0xa0, 0xaf) AM_WRITE(nbmj9195_blitter_1_w)
- AM_RANGE(0xb0, 0xbf) AM_WRITE(nbmj9195_clut_1_w)
+ AM_RANGE(0xa0, 0xa1) AM_READ(blitter_1_r)
+ AM_RANGE(0xa0, 0xaf) AM_WRITE(blitter_1_w)
+ AM_RANGE(0xb0, 0xbf) AM_WRITE(clut_1_w)
- AM_RANGE(0xe0, 0xe0) AM_WRITE(nbmj9195_sound_w)
+ AM_RANGE(0xe0, 0xe0) AM_WRITE(soundlatch_byte_w)
AM_RANGE(0xe2, 0xe2) AM_WRITENOP
AM_RANGE(0xe4, 0xe4) AM_WRITENOP
- AM_RANGE(0xf6, 0xf6) AM_WRITE(nbmj9195_inputportsel_w)
+ AM_RANGE(0xf6, 0xf6) AM_WRITE(inputportsel_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( otatidai_io_map, AS_IO, 8, nbmj9195_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x60, 0x61) AM_READ(nbmj9195_blitter_0_r)
- AM_RANGE(0x60, 0x6f) AM_WRITE(nbmj9195_blitter_0_w)
- AM_RANGE(0x70, 0x7f) AM_WRITE(nbmj9195_clut_0_w)
+ AM_RANGE(0x60, 0x61) AM_READ(blitter_0_r)
+ AM_RANGE(0x60, 0x6f) AM_WRITE(blitter_0_w)
+ AM_RANGE(0x70, 0x7f) AM_WRITE(clut_0_w)
- AM_RANGE(0x80, 0x81) AM_READ(nbmj9195_blitter_1_r)
- AM_RANGE(0x80, 0x8f) AM_WRITE(nbmj9195_blitter_1_w)
- AM_RANGE(0x90, 0x9f) AM_WRITE(nbmj9195_clut_1_w)
+ AM_RANGE(0x80, 0x81) AM_READ(blitter_1_r)
+ AM_RANGE(0x80, 0x8f) AM_WRITE(blitter_1_w)
+ AM_RANGE(0x90, 0x9f) AM_WRITE(clut_1_w)
- AM_RANGE(0xa0, 0xa0) AM_WRITE(nbmj9195_sound_w)
+ AM_RANGE(0xa0, 0xa0) AM_WRITE(soundlatch_byte_w)
AM_RANGE(0xa8, 0xa8) AM_WRITENOP
AM_RANGE(0xb0, 0xb0) AM_WRITENOP
- AM_RANGE(0xb8, 0xb8) AM_WRITE(nbmj9195_inputportsel_w)
+ AM_RANGE(0xb8, 0xb8) AM_WRITE(inputportsel_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( yosimoto_io_map, AS_IO, 8, nbmj9195_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x60, 0x61) AM_READ(nbmj9195_blitter_0_r)
- AM_RANGE(0x60, 0x6f) AM_WRITE(nbmj9195_blitter_0_w)
- AM_RANGE(0x70, 0x7f) AM_WRITE(nbmj9195_clut_0_w)
+ AM_RANGE(0x60, 0x61) AM_READ(blitter_0_r)
+ AM_RANGE(0x60, 0x6f) AM_WRITE(blitter_0_w)
+ AM_RANGE(0x70, 0x7f) AM_WRITE(clut_0_w)
- AM_RANGE(0x90, 0x90) AM_WRITE(nbmj9195_sound_w)
+ AM_RANGE(0x90, 0x90) AM_WRITE(soundlatch_byte_w)
AM_RANGE(0x94, 0x94) AM_WRITENOP
AM_RANGE(0x98, 0x98) AM_WRITENOP
- AM_RANGE(0x9c, 0x9c) AM_WRITE(nbmj9195_inputportsel_w)
+ AM_RANGE(0x9c, 0x9c) AM_WRITE(inputportsel_w)
- AM_RANGE(0xc0, 0xc1) AM_READ(nbmj9195_blitter_1_r)
- AM_RANGE(0xc0, 0xcf) AM_WRITE(nbmj9195_blitter_1_w)
- AM_RANGE(0xd0, 0xdf) AM_WRITE(nbmj9195_clut_1_w)
+ AM_RANGE(0xc0, 0xc1) AM_READ(blitter_1_r)
+ AM_RANGE(0xc0, 0xcf) AM_WRITE(blitter_1_w)
+ AM_RANGE(0xd0, 0xdf) AM_WRITE(clut_1_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( yosimotm_io_map, AS_IO, 8, nbmj9195_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x60, 0x61) AM_READ(nbmj9195_blitter_0_r)
- AM_RANGE(0x60, 0x6f) AM_WRITE(nbmj9195_blitter_0_w)
- AM_RANGE(0x70, 0x7f) AM_WRITE(nbmj9195_clut_0_w)
+ AM_RANGE(0x60, 0x61) AM_READ(blitter_0_r)
+ AM_RANGE(0x60, 0x6f) AM_WRITE(blitter_0_w)
+ AM_RANGE(0x70, 0x7f) AM_WRITE(clut_0_w)
- AM_RANGE(0x80, 0x81) AM_READ(nbmj9195_blitter_1_r)
- AM_RANGE(0x80, 0x8f) AM_WRITE(nbmj9195_blitter_1_w)
- AM_RANGE(0x90, 0x9f) AM_WRITE(nbmj9195_clut_1_w)
+ AM_RANGE(0x80, 0x81) AM_READ(blitter_1_r)
+ AM_RANGE(0x80, 0x8f) AM_WRITE(blitter_1_w)
+ AM_RANGE(0x90, 0x9f) AM_WRITE(clut_1_w)
- AM_RANGE(0xf0, 0xf0) AM_WRITE(nbmj9195_inputportsel_w)
- AM_RANGE(0xfc, 0xfc) AM_WRITE(nbmj9195_sound_w)
+ AM_RANGE(0xf0, 0xf0) AM_WRITE(inputportsel_w)
+ AM_RANGE(0xfc, 0xfc) AM_WRITE(soundlatch_byte_w)
AM_RANGE(0xf4, 0xf4) AM_NOP
AM_RANGE(0xf8, 0xf8) AM_NOP
ADDRESS_MAP_END
@@ -624,83 +536,83 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( jituroku_io_map, AS_IO, 8, nbmj9195_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x60, 0x61) AM_READ(nbmj9195_blitter_0_r)
- AM_RANGE(0x60, 0x6f) AM_WRITE(nbmj9195_blitter_0_w)
- AM_RANGE(0x70, 0x7f) AM_WRITE(nbmj9195_clut_0_w)
+ AM_RANGE(0x60, 0x61) AM_READ(blitter_0_r)
+ AM_RANGE(0x60, 0x6f) AM_WRITE(blitter_0_w)
+ AM_RANGE(0x70, 0x7f) AM_WRITE(clut_0_w)
- AM_RANGE(0xc0, 0xc1) AM_READ(nbmj9195_blitter_1_r)
- AM_RANGE(0xc0, 0xcf) AM_WRITE(nbmj9195_blitter_1_w)
- AM_RANGE(0xd0, 0xdf) AM_WRITE(nbmj9195_clut_1_w)
+ AM_RANGE(0xc0, 0xc1) AM_READ(blitter_1_r)
+ AM_RANGE(0xc0, 0xcf) AM_WRITE(blitter_1_w)
+ AM_RANGE(0xd0, 0xdf) AM_WRITE(clut_1_w)
- AM_RANGE(0xe0, 0xe0) AM_WRITE(nbmj9195_sound_w)
+ AM_RANGE(0xe0, 0xe0) AM_WRITE(soundlatch_byte_w)
AM_RANGE(0xe8, 0xe8) AM_WRITENOP
AM_RANGE(0xf0, 0xf0) AM_WRITENOP
- AM_RANGE(0xf8, 0xf8) AM_WRITE(nbmj9195_inputportsel_w)
+ AM_RANGE(0xf8, 0xf8) AM_WRITE(inputportsel_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( ngpgal_io_map, AS_IO, 8, nbmj9195_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0xa0, 0xa0) AM_WRITE(nbmj9195_sound_w)
+ AM_RANGE(0xa0, 0xa0) AM_WRITE(soundlatch_byte_w)
AM_RANGE(0xa4, 0xa4) AM_WRITENOP
AM_RANGE(0xa8, 0xa8) AM_WRITENOP
- AM_RANGE(0xb0, 0xb0) AM_WRITE(nbmj9195_inputportsel_w)
+ AM_RANGE(0xb0, 0xb0) AM_WRITE(inputportsel_w)
- AM_RANGE(0xc0, 0xc1) AM_READ(nbmj9195_blitter_0_r)
- AM_RANGE(0xc0, 0xcf) AM_WRITE(nbmj9195_blitter_0_w)
- AM_RANGE(0xd0, 0xdf) AM_WRITE(nbmj9195_clut_0_w)
+ AM_RANGE(0xc0, 0xc1) AM_READ(blitter_0_r)
+ AM_RANGE(0xc0, 0xcf) AM_WRITE(blitter_0_w)
+ AM_RANGE(0xd0, 0xdf) AM_WRITE(clut_0_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( mjgottsu_io_map, AS_IO, 8, nbmj9195_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x80, 0x81) AM_READ(nbmj9195_blitter_0_r)
- AM_RANGE(0x80, 0x8f) AM_WRITE(nbmj9195_blitter_0_w)
- AM_RANGE(0x90, 0x9f) AM_WRITE(nbmj9195_clut_0_w)
+ AM_RANGE(0x80, 0x81) AM_READ(blitter_0_r)
+ AM_RANGE(0x80, 0x8f) AM_WRITE(blitter_0_w)
+ AM_RANGE(0x90, 0x9f) AM_WRITE(clut_0_w)
- AM_RANGE(0xa0, 0xa0) AM_WRITE(nbmj9195_sound_w)
+ AM_RANGE(0xa0, 0xa0) AM_WRITE(soundlatch_byte_w)
AM_RANGE(0xa4, 0xa4) AM_WRITENOP
AM_RANGE(0xa8, 0xa8) AM_WRITENOP
- AM_RANGE(0xb0, 0xb0) AM_WRITE(nbmj9195_inputportsel_w)
+ AM_RANGE(0xb0, 0xb0) AM_WRITE(inputportsel_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( cmehyou_io_map, AS_IO, 8, nbmj9195_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0xa0, 0xa0) AM_WRITE(nbmj9195_sound_w)
+ AM_RANGE(0xa0, 0xa0) AM_WRITE(soundlatch_byte_w)
AM_RANGE(0xa8, 0xa8) AM_WRITENOP
- AM_RANGE(0xb0, 0xb0) AM_WRITE(nbmj9195_inputportsel_w)
+ AM_RANGE(0xb0, 0xb0) AM_WRITE(inputportsel_w)
AM_RANGE(0xb4, 0xb4) AM_WRITENOP
- AM_RANGE(0xc0, 0xc1) AM_READ(nbmj9195_blitter_0_r)
- AM_RANGE(0xc0, 0xcf) AM_WRITE(nbmj9195_blitter_0_w)
- AM_RANGE(0xd0, 0xdf) AM_WRITE(nbmj9195_clut_0_w)
+ AM_RANGE(0xc0, 0xc1) AM_READ(blitter_0_r)
+ AM_RANGE(0xc0, 0xcf) AM_WRITE(blitter_0_w)
+ AM_RANGE(0xd0, 0xdf) AM_WRITE(clut_0_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( mjkoiura_io_map, AS_IO, 8, nbmj9195_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x80, 0x81) AM_READ(nbmj9195_blitter_0_r)
- AM_RANGE(0x80, 0x8f) AM_WRITE(nbmj9195_blitter_0_w)
- AM_RANGE(0x90, 0x9f) AM_WRITE(nbmj9195_clut_0_w)
+ AM_RANGE(0x80, 0x81) AM_READ(blitter_0_r)
+ AM_RANGE(0x80, 0x8f) AM_WRITE(blitter_0_w)
+ AM_RANGE(0x90, 0x9f) AM_WRITE(clut_0_w)
- AM_RANGE(0xa0, 0xa0) AM_WRITE(nbmj9195_sound_w)
+ AM_RANGE(0xa0, 0xa0) AM_WRITE(soundlatch_byte_w)
AM_RANGE(0xa4, 0xa4) AM_WRITENOP
AM_RANGE(0xa8, 0xa8) AM_WRITENOP
- AM_RANGE(0xb0, 0xb0) AM_WRITE(nbmj9195_inputportsel_w)
+ AM_RANGE(0xb0, 0xb0) AM_WRITE(inputportsel_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( mkoiuraa_io_map, AS_IO, 8, nbmj9195_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0xa0, 0xa0) AM_WRITE(nbmj9195_sound_w)
+ AM_RANGE(0xa0, 0xa0) AM_WRITE(soundlatch_byte_w)
AM_RANGE(0xa4, 0xa4) AM_WRITENOP
AM_RANGE(0xa8, 0xa8) AM_WRITENOP
- AM_RANGE(0xb0, 0xb0) AM_WRITE(nbmj9195_inputportsel_w)
+ AM_RANGE(0xb0, 0xb0) AM_WRITE(inputportsel_w)
- AM_RANGE(0xc0, 0xc1) AM_READ(nbmj9195_blitter_0_r)
- AM_RANGE(0xc0, 0xcf) AM_WRITE(nbmj9195_blitter_0_w)
- AM_RANGE(0xd0, 0xdf) AM_WRITE(nbmj9195_clut_0_w)
+ AM_RANGE(0xc0, 0xc1) AM_READ(blitter_0_r)
+ AM_RANGE(0xc0, 0xcf) AM_WRITE(blitter_0_w)
+ AM_RANGE(0xd0, 0xdf) AM_WRITE(clut_0_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( mscoutm_io_map, AS_IO, 8, nbmj9195_state )
@@ -708,18 +620,18 @@ static ADDRESS_MAP_START( mscoutm_io_map, AS_IO, 8, nbmj9195_state )
AM_RANGE(0x80, 0x80) AM_READ(mscoutm_dipsw_1_r)
AM_RANGE(0x82, 0x82) AM_READ(mscoutm_dipsw_0_r)
- AM_RANGE(0x84, 0x84) AM_WRITE(nbmj9195_sound_w)
+ AM_RANGE(0x84, 0x84) AM_WRITE(soundlatch_byte_w)
AM_RANGE(0xa0, 0xa6) AM_WRITENOP // nb22090 param ?
- AM_RANGE(0xc0, 0xc1) AM_READ(nbmj9195_blitter_0_r)
- AM_RANGE(0xc0, 0xcf) AM_WRITE(nbmj9195_blitter_0_w)
+ AM_RANGE(0xc0, 0xc1) AM_READ(blitter_0_r)
+ AM_RANGE(0xc0, 0xcf) AM_WRITE(blitter_0_w)
- AM_RANGE(0xd0, 0xdf) AM_WRITE(nbmj9195_clut_0_w)
- AM_RANGE(0xe0, 0xe1) AM_READ(nbmj9195_blitter_1_r)
- AM_RANGE(0xe0, 0xef) AM_WRITE(nbmj9195_blitter_1_w)
+ AM_RANGE(0xd0, 0xdf) AM_WRITE(clut_0_w)
+ AM_RANGE(0xe0, 0xe1) AM_READ(blitter_1_r)
+ AM_RANGE(0xe0, 0xef) AM_WRITE(blitter_1_w)
- AM_RANGE(0xf0, 0xff) AM_WRITE(nbmj9195_clut_1_w)
+ AM_RANGE(0xf0, 0xff) AM_WRITE(clut_1_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( imekura_io_map, AS_IO, 8, nbmj9195_state )
@@ -727,18 +639,18 @@ static ADDRESS_MAP_START( imekura_io_map, AS_IO, 8, nbmj9195_state )
AM_RANGE(0x80, 0x80) AM_READ(mscoutm_dipsw_1_r)
AM_RANGE(0x82, 0x82) AM_READ(mscoutm_dipsw_0_r)
- AM_RANGE(0x84, 0x84) AM_WRITE(nbmj9195_sound_w)
+ AM_RANGE(0x84, 0x84) AM_WRITE(soundlatch_byte_w)
AM_RANGE(0xb0, 0xb6) AM_WRITENOP // nb22090 param ?
- AM_RANGE(0xc0, 0xc1) AM_READ(nbmj9195_blitter_0_r)
- AM_RANGE(0xc0, 0xcf) AM_WRITE(nbmj9195_blitter_0_w)
+ AM_RANGE(0xc0, 0xc1) AM_READ(blitter_0_r)
+ AM_RANGE(0xc0, 0xcf) AM_WRITE(blitter_0_w)
- AM_RANGE(0xd0, 0xdf) AM_WRITE(nbmj9195_clut_0_w)
+ AM_RANGE(0xd0, 0xdf) AM_WRITE(clut_0_w)
- AM_RANGE(0xe0, 0xe1) AM_READ(nbmj9195_blitter_1_r)
- AM_RANGE(0xe0, 0xef) AM_WRITE(nbmj9195_blitter_1_w)
- AM_RANGE(0xf0, 0xff) AM_WRITE(nbmj9195_clut_1_w)
+ AM_RANGE(0xe0, 0xe1) AM_READ(blitter_1_r)
+ AM_RANGE(0xe0, 0xef) AM_WRITE(blitter_1_w)
+ AM_RANGE(0xf0, 0xff) AM_WRITE(clut_1_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( mjegolf_io_map, AS_IO, 8, nbmj9195_state )
@@ -746,18 +658,18 @@ static ADDRESS_MAP_START( mjegolf_io_map, AS_IO, 8, nbmj9195_state )
AM_RANGE(0x80, 0x86) AM_WRITENOP // nb22090 param ?
- AM_RANGE(0xa0, 0xa1) AM_READ(nbmj9195_blitter_0_r)
- AM_RANGE(0xa0, 0xaf) AM_WRITE(nbmj9195_blitter_0_w)
- AM_RANGE(0xb0, 0xbf) AM_WRITE(nbmj9195_clut_0_w)
+ AM_RANGE(0xa0, 0xa1) AM_READ(blitter_0_r)
+ AM_RANGE(0xa0, 0xaf) AM_WRITE(blitter_0_w)
+ AM_RANGE(0xb0, 0xbf) AM_WRITE(clut_0_w)
- AM_RANGE(0xc0, 0xc1) AM_READ(nbmj9195_blitter_1_r)
- AM_RANGE(0xc0, 0xcf) AM_WRITE(nbmj9195_blitter_1_w)
+ AM_RANGE(0xc0, 0xc1) AM_READ(blitter_1_r)
+ AM_RANGE(0xc0, 0xcf) AM_WRITE(blitter_1_w)
- AM_RANGE(0xd0, 0xdf) AM_WRITE(nbmj9195_clut_1_w)
+ AM_RANGE(0xd0, 0xdf) AM_WRITE(clut_1_w)
AM_RANGE(0xe0, 0xe0) AM_READ(mscoutm_dipsw_1_r)
AM_RANGE(0xe2, 0xe2) AM_READ(mscoutm_dipsw_0_r)
- AM_RANGE(0xe4, 0xe4) AM_WRITE(nbmj9195_sound_w)
+ AM_RANGE(0xe4, 0xe4) AM_WRITE(soundlatch_byte_w)
ADDRESS_MAP_END
@@ -765,7 +677,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( sailorws_sound_map, AS_PROGRAM, 8, nbmj9195_state )
AM_RANGE(0x0000, 0x77ff) AM_ROM
AM_RANGE(0x7800, 0x7fff) AM_RAM
- AM_RANGE(0x8000, 0xffff) AM_ROMBANK("bank1")
+ AM_RANGE(0x8000, 0xffff) AM_ROMBANK("soundbank")
ADDRESS_MAP_END
static ADDRESS_MAP_START( sailorws_sound_io_map, AS_IO, 8, nbmj9195_state )
@@ -783,7 +695,7 @@ TODO: it probably doesn't belong in here. Both CPUs are certainly tmpz84c011 tho
static ADDRESS_MAP_START( shabdama_map, AS_PROGRAM, 8, nbmj9195_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0xe000, 0xe7ff) AM_RAM
-// AM_RANGE(0xd000, 0xd1ff) AM_READWRITE(nbmj9195_palette_r,nbmj9195_palette_w)
+// AM_RANGE(0xd000, 0xd1ff) AM_RAM_WRITE(palette_w) AM_SHARE("paletteram")
// AM_RANGE(0xd800, 0xdfff) AM_RAM
ADDRESS_MAP_END
@@ -791,9 +703,9 @@ static ADDRESS_MAP_START( shabdama_io_map, AS_IO, 8, nbmj9195_state )
// ADDRESS_MAP_UNMAP_HIGH
ADDRESS_MAP_GLOBAL_MASK(0xff)
-// AM_RANGE(0x60, 0x61) AM_READ(nbmj9195_blitter_0_r)
-// AM_RANGE(0x60, 0x6f) AM_WRITE(nbmj9195_blitter_0_w)
-// AM_RANGE(0x70, 0x7f) AM_WRITE(nbmj9195_clut_0_w)
+// AM_RANGE(0x60, 0x61) AM_READ(blitter_0_r)
+// AM_RANGE(0x60, 0x6f) AM_WRITE(blitter_0_w)
+// AM_RANGE(0x70, 0x7f) AM_WRITE(clut_0_w)
ADDRESS_MAP_END
/********************************************************************************
@@ -2765,34 +2677,34 @@ static const z80_daisy_config daisy_chain_sound[] =
// the only difference between these 2 setups is the DAC is swapped, is that intentional?
#define OTHERS_TMZ84C011_SOUND_PORTS \
- MCFG_TMPZ84C011_PORTA_WRITE_CB(WRITE8(nbmj9195_state, soundcpu_porta_w)) \
- MCFG_TMPZ84C011_PORTB_WRITE_CB(WRITE8(nbmj9195_state, soundcpu_dac1_w)) \
- MCFG_TMPZ84C011_PORTC_WRITE_CB(WRITE8(nbmj9195_state, soundcpu_dac2_w)) \
- MCFG_TMPZ84C011_PORTD_READ_CB(READ8(nbmj9195_state, soundcpu_portd_r)) \
+ MCFG_TMPZ84C011_PORTA_WRITE_CB(WRITE8(nbmj9195_state, soundbank_w)) \
+ MCFG_TMPZ84C011_PORTB_WRITE_CB(DEVWRITE8("dac1", dac_device, write_unsigned8)) \
+ MCFG_TMPZ84C011_PORTC_WRITE_CB(DEVWRITE8("dac2", dac_device, write_unsigned8)) \
+ MCFG_TMPZ84C011_PORTD_READ_CB(READ8(nbmj9195_state, soundlatch_byte_r)) \
MCFG_TMPZ84C011_PORTE_WRITE_CB(WRITE8(nbmj9195_state, soundcpu_porte_w))
#define MSCOUTM_TMZ84C011_SOUND_PORTS \
- MCFG_TMPZ84C011_PORTA_WRITE_CB(WRITE8(nbmj9195_state, soundcpu_porta_w)) \
- MCFG_TMPZ84C011_PORTB_WRITE_CB(WRITE8(nbmj9195_state, soundcpu_dac2_w)) \
- MCFG_TMPZ84C011_PORTC_WRITE_CB(WRITE8(nbmj9195_state, soundcpu_dac1_w)) \
- MCFG_TMPZ84C011_PORTD_READ_CB(READ8(nbmj9195_state, soundcpu_portd_r)) \
+ MCFG_TMPZ84C011_PORTA_WRITE_CB(WRITE8(nbmj9195_state, soundbank_w)) \
+ MCFG_TMPZ84C011_PORTB_WRITE_CB(DEVWRITE8("dac2", dac_device, write_unsigned8)) \
+ MCFG_TMPZ84C011_PORTC_WRITE_CB(DEVWRITE8("dac1", dac_device, write_unsigned8)) \
+ MCFG_TMPZ84C011_PORTD_READ_CB(READ8(nbmj9195_state, soundlatch_byte_r)) \
MCFG_TMPZ84C011_PORTE_WRITE_CB(WRITE8(nbmj9195_state, soundcpu_porte_w))
#define MSCOUTM_TMZ84C011_MAIN_PORTS \
- MCFG_TMPZ84C011_PORTA_READ_CB(READ8(nbmj9195_state, mscoutm_cpu_porta_r)) \
- MCFG_TMPZ84C011_PORTA_WRITE_CB(WRITE8(nbmj9195_state, mscoutm_cpu_porta_w)) \
+ MCFG_TMPZ84C011_PORTA_READ_CB(IOPORT("SYSTEM")) \
+ MCFG_TMPZ84C011_PORTA_WRITE_CB(WRITE8(nbmj9195_state, mscoutm_inputportsel_w)) \
MCFG_TMPZ84C011_PORTB_READ_CB(READ8(nbmj9195_state, mscoutm_cpu_portb_r)) \
MCFG_TMPZ84C011_PORTC_READ_CB(READ8(nbmj9195_state, mscoutm_cpu_portc_r)) \
- MCFG_TMPZ84C011_PORTD_WRITE_CB(WRITE8(nbmj9195_state, mscoutm_cpu_portd_w)) \
- MCFG_TMPZ84C011_PORTE_WRITE_CB(WRITE8(nbmj9195_state, mscoutm_cpu_porte_w))
+ MCFG_TMPZ84C011_PORTD_WRITE_CB(WRITE8(nbmj9195_state, clutsel_w)) \
+ MCFG_TMPZ84C011_PORTE_WRITE_CB(WRITE8(nbmj9195_state, gfxflag2_w))
#define OTHERS_TMZ84C011_MAIN_PORTS \
MCFG_TMPZ84C011_PORTA_READ_CB(READ8(nbmj9195_state, others_cpu_porta_r)) \
MCFG_TMPZ84C011_PORTB_READ_CB(READ8(nbmj9195_state, others_cpu_portb_r)) \
MCFG_TMPZ84C011_PORTC_READ_CB(READ8(nbmj9195_state, others_cpu_portc_r)) \
- MCFG_TMPZ84C011_PORTC_WRITE_CB(WRITE8(nbmj9195_state, others_cpu_portc_w)) \
- MCFG_TMPZ84C011_PORTD_WRITE_CB(WRITE8(nbmj9195_state, others_cpu_portd_w)) \
- MCFG_TMPZ84C011_PORTE_WRITE_CB(WRITE8(nbmj9195_state, others_cpu_porte_w))
+ MCFG_TMPZ84C011_PORTC_WRITE_CB(WRITE8(nbmj9195_state, dipswbitsel_w)) \
+ MCFG_TMPZ84C011_PORTD_WRITE_CB(WRITE8(nbmj9195_state, clutsel_w)) \
+ MCFG_TMPZ84C011_PORTE_WRITE_CB(WRITE8(nbmj9195_state, outcoin_flag_w))
static MACHINE_CONFIG_START( NBMJDRV1_base, nbmj9195_state )
@@ -2815,7 +2727,7 @@ static MACHINE_CONFIG_START( NBMJDRV1_base, nbmj9195_state )
MCFG_SCREEN_REFRESH_RATE(60)
MCFG_SCREEN_SIZE(1024, 512) /* no way this is correct */
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 240-1)
- MCFG_SCREEN_UPDATE_DRIVER(nbmj9195_state, screen_update_nbmj9195)
+ MCFG_SCREEN_UPDATE_DRIVER(nbmj9195_state, screen_update)
MCFG_SCREEN_PALETTE("palette")
MCFG_PALETTE_ADD("palette", 256)
@@ -2854,7 +2766,7 @@ static MACHINE_CONFIG_DERIVED( NBMJDRV2, NBMJDRV1_base )
OTHERS_TMZ84C011_SOUND_PORTS
/* video hardware */
- MCFG_VIDEO_START_OVERRIDE(nbmj9195_state,nbmj9195_1layer)
+ MCFG_VIDEO_START_OVERRIDE(nbmj9195_state,_1layer)
MACHINE_CONFIG_END
@@ -2871,9 +2783,7 @@ static MACHINE_CONFIG_DERIVED( NBMJDRV3, NBMJDRV1_base )
MCFG_PALETTE_MODIFY("palette")
MCFG_PALETTE_ENTRIES(512)
- MCFG_VIDEO_START_OVERRIDE(nbmj9195_state,nbmj9195_nb22090)
- MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_UPDATE_DRIVER(nbmj9195_state, screen_update_nbmj9195)
+ MCFG_VIDEO_START_OVERRIDE(nbmj9195_state,nb22090)
MACHINE_CONFIG_END
@@ -3728,38 +3638,38 @@ ROM_START( shabdama )
ROM_END
// YEAR, NAME, PARENT, MACHINE, INPUT, INIT, MONITOR, COMPANY, FULLNAME, FLAGS
-GAME( 1992, mjuraden, 0, mjuraden, mjuraden, nbmj9195_state, nbmj9195, ROT0, "Nichibutsu / Yubis", "Mahjong Uranai Densetsu (Japan)", 0 )
-GAME( 1992, koinomp, 0, koinomp, koinomp, nbmj9195_state, nbmj9195, ROT0, "Nichibutsu", "Mahjong Koi no Magic Potion (Japan)", 0 )
-GAME( 1992, patimono, 0, patimono, patimono, nbmj9195_state, nbmj9195, ROT0, "Nichibutsu", "Mahjong Pachinko Monogatari (Japan)", 0 )
-GAME( 1992, janbari, 0, janbari, janbari, nbmj9195_state, nbmj9195, ROT0, "Nichibutsu / Yubis / AV Japan", "Mahjong Janjan Baribari (Japan)", 0 )
-GAME( 1992, mjanbari, janbari, janbari, mjanbari, nbmj9195_state, nbmj9195, ROT0, "Nichibutsu / Yubis / AV Japan", "Medal Mahjong Janjan Baribari [BET] (Japan)", 0 )
-GAME( 1992, mmehyou, 0, mmehyou, mmehyou, nbmj9195_state, nbmj9195, ROT0, "Nichibutsu / Kawakusu", "Medal Mahjong Circuit no Mehyou [BET] (Japan)", 0 )
-GAME( 1993, ultramhm, 0, ultramhm, ultramhm, nbmj9195_state, nbmj9195, ROT0, "Apple", "Ultra Maru-hi Mahjong (Japan)", 0 )
-GAME( 1993, gal10ren, 0, gal10ren, gal10ren, nbmj9195_state, nbmj9195, ROT0, "Fujic", "Mahjong Gal 10-renpatsu (Japan)", 0 )
-GAME( 1993, renaiclb, 0, renaiclb, renaiclb, nbmj9195_state, nbmj9195, ROT0, "Fujic", "Mahjong Ren-ai Club (Japan)", 0 )
-GAME( 1993, mjlaman, 0, mjlaman, mjlaman, nbmj9195_state, nbmj9195, ROT0, "Nichibutsu / AV Japan", "Mahjong La Man (Japan)", 0 )
-GAME( 1993, mkeibaou, 0, mkeibaou, mkeibaou, nbmj9195_state, nbmj9195, ROT0, "Nichibutsu", "Mahjong Keibaou (Japan)", 0 )
-GAME( 1993, pachiten, 0, pachiten, pachiten, nbmj9195_state, nbmj9195, ROT0, "Nichibutsu / AV Japan / Miki Syouji", "Medal Mahjong Pachi-Slot Tengoku [BET] (Japan)", 0 )
-GAME( 1993, sailorws, 0, sailorws, sailorws, nbmj9195_state, nbmj9195, ROT0, "Nichibutsu", "Mahjong Sailor Wars (Japan set 1)", 0 )
-GAME( 1993, sailorwa, sailorws, sailorws, sailorws, nbmj9195_state, nbmj9195, ROT0, "Nichibutsu", "Mahjong Sailor Wars (Japan set 2)", 0 )
-GAME( 1993, sailorwr, sailorws, sailorwr, sailorwr, nbmj9195_state, nbmj9195, ROT0, "Nichibutsu", "Mahjong Sailor Wars-R [BET] (Japan)", 0 )
-GAME( 1993, wcatcher, 0, otatidai, wcatcher, nbmj9195_state, nbmj9195, ROT0, "Nichibutsu", "Mahjong Wakuwaku Catcher (Japan)", 0 )
-GAME( 1993, jituroku, 0, jituroku, jituroku, nbmj9195_state, nbmj9195, ROT0, "Windom", "Jitsuroku Maru-chi Mahjong (Japan)", 0 )
-GAME( 1994, yosimoto, 0, yosimoto, yosimoto, nbmj9195_state, nbmj9195, ROT0, "Nichibutsu / Yoshimoto Kougyou", "Mahjong Yoshimoto Gekijou (Japan)", 0 )
-GAME( 1994, yosimotm, yosimoto, yosimotm, yosimotm, nbmj9195_state, nbmj9195, ROT0, "Nichibutsu / Yoshimoto Kougyou", "Mahjong Yoshimoto Gekijou [BET] (Japan)", 0 )
-GAME( 1994, psailor1, 0, psailor1, psailor1, nbmj9195_state, nbmj9195, ROT0, "Sphinx", "Bishoujo Janshi Pretty Sailor 18-kin (Japan)", 0 )
-GAME( 1994, psailor2, 0, psailor2, psailor2, nbmj9195_state, nbmj9195, ROT0, "Sphinx", "Bishoujo Janshi Pretty Sailor 2 (Japan)", 0 )
-GAME( 1995, otatidai, 0, otatidai, otatidai, nbmj9195_state, nbmj9195, ROT0, "Sphinx", "Disco Mahjong Otachidai no Okite (Japan)", 0 )
-
-GAME( 1991, ngpgal, 0, ngpgal, ngpgal, nbmj9195_state, nbmj9195, ROT0, "Nichibutsu", "Nekketsu Grand-Prix Gal (Japan)", 0 )
-GAME( 1991, mjgottsu, 0, mjgottsu, mjgottsu, nbmj9195_state, nbmj9195, ROT0, "Nichibutsu", "Mahjong Gottsu ee-kanji (Japan)", 0 )
-GAME( 1991, bakuhatu, mjgottsu, bakuhatu, bakuhatu, nbmj9195_state, nbmj9195, ROT0, "Nichibutsu", "Mahjong Bakuhatsu Junjouden (Japan)", 0 )
-GAME( 1992, cmehyou, 0, cmehyou, cmehyou, nbmj9195_state, nbmj9195, ROT0, "Nichibutsu / Kawakusu", "Mahjong Circuit no Mehyou (Japan)", 0 )
-GAME( 1992, mjkoiura, 0, mjkoiura, mjkoiura, nbmj9195_state, nbmj9195, ROT0, "Nichibutsu", "Mahjong Koi Uranai (Japan set 1)", 0 )
-GAME( 1992, mkoiuraa, mjkoiura, mkoiuraa, mjkoiura, nbmj9195_state, nbmj9195, ROT0, "Nichibutsu", "Mahjong Koi Uranai (Japan set 2)", 0 )
-
-GAME( 1994, mscoutm, 0, mscoutm, mscoutm, nbmj9195_state, nbmj9195, ROT0, "Sphinx / AV Japan", "Mahjong Scout Man (Japan)", 0 )
-GAME( 1994, imekura, 0, imekura, imekura, nbmj9195_state, nbmj9195, ROT0, "Sphinx / AV Japan", "Imekura Mahjong (Japan)", 0 )
-GAME( 1994, mjegolf, 0, mjegolf, mjegolf, nbmj9195_state, nbmj9195, ROT0, "Fujic / AV Japan", "Mahjong Erotica Golf (Japan)", 0 )
-
-GAME( 199?, shabdama, 0, shabdama, mjuraden,nbmj9195_state, nbmj9195, ROT0, "Nichibutsu", "LD Mahjong #4 Shabon-Dama", GAME_NOT_WORKING | GAME_NO_SOUND )
+GAME( 1992, mjuraden, 0, mjuraden, mjuraden, nbmj9195_state, nbmj9195, ROT0, "Nichibutsu / Yubis", "Mahjong Uranai Densetsu (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1992, koinomp, 0, koinomp, koinomp, nbmj9195_state, nbmj9195, ROT0, "Nichibutsu", "Mahjong Koi no Magic Potion (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1992, patimono, 0, patimono, patimono, nbmj9195_state, nbmj9195, ROT0, "Nichibutsu", "Mahjong Pachinko Monogatari (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1992, janbari, 0, janbari, janbari, nbmj9195_state, nbmj9195, ROT0, "Nichibutsu / Yubis / AV Japan", "Mahjong Janjan Baribari (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1992, mjanbari, janbari, janbari, mjanbari, nbmj9195_state, nbmj9195, ROT0, "Nichibutsu / Yubis / AV Japan", "Medal Mahjong Janjan Baribari [BET] (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1992, mmehyou, 0, mmehyou, mmehyou, nbmj9195_state, nbmj9195, ROT0, "Nichibutsu / Kawakusu", "Medal Mahjong Circuit no Mehyou [BET] (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1993, ultramhm, 0, ultramhm, ultramhm, nbmj9195_state, nbmj9195, ROT0, "Apple", "Ultra Maru-hi Mahjong (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1993, gal10ren, 0, gal10ren, gal10ren, nbmj9195_state, nbmj9195, ROT0, "Fujic", "Mahjong Gal 10-renpatsu (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1993, renaiclb, 0, renaiclb, renaiclb, nbmj9195_state, nbmj9195, ROT0, "Fujic", "Mahjong Ren-ai Club (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1993, mjlaman, 0, mjlaman, mjlaman, nbmj9195_state, nbmj9195, ROT0, "Nichibutsu / AV Japan", "Mahjong La Man (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1993, mkeibaou, 0, mkeibaou, mkeibaou, nbmj9195_state, nbmj9195, ROT0, "Nichibutsu", "Mahjong Keibaou (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1993, pachiten, 0, pachiten, pachiten, nbmj9195_state, nbmj9195, ROT0, "Nichibutsu / AV Japan / Miki Syouji", "Medal Mahjong Pachi-Slot Tengoku [BET] (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1993, sailorws, 0, sailorws, sailorws, nbmj9195_state, nbmj9195, ROT0, "Nichibutsu", "Mahjong Sailor Wars (Japan set 1)", GAME_SUPPORTS_SAVE )
+GAME( 1993, sailorwa, sailorws, sailorws, sailorws, nbmj9195_state, nbmj9195, ROT0, "Nichibutsu", "Mahjong Sailor Wars (Japan set 2)", GAME_SUPPORTS_SAVE )
+GAME( 1993, sailorwr, sailorws, sailorwr, sailorwr, nbmj9195_state, nbmj9195, ROT0, "Nichibutsu", "Mahjong Sailor Wars-R [BET] (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1993, wcatcher, 0, otatidai, wcatcher, nbmj9195_state, nbmj9195, ROT0, "Nichibutsu", "Mahjong Wakuwaku Catcher (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1993, jituroku, 0, jituroku, jituroku, nbmj9195_state, nbmj9195, ROT0, "Windom", "Jitsuroku Maru-chi Mahjong (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1994, yosimoto, 0, yosimoto, yosimoto, nbmj9195_state, nbmj9195, ROT0, "Nichibutsu / Yoshimoto Kougyou", "Mahjong Yoshimoto Gekijou (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1994, yosimotm, yosimoto, yosimotm, yosimotm, nbmj9195_state, nbmj9195, ROT0, "Nichibutsu / Yoshimoto Kougyou", "Mahjong Yoshimoto Gekijou [BET] (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1994, psailor1, 0, psailor1, psailor1, nbmj9195_state, nbmj9195, ROT0, "Sphinx", "Bishoujo Janshi Pretty Sailor 18-kin (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1994, psailor2, 0, psailor2, psailor2, nbmj9195_state, nbmj9195, ROT0, "Sphinx", "Bishoujo Janshi Pretty Sailor 2 (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1995, otatidai, 0, otatidai, otatidai, nbmj9195_state, nbmj9195, ROT0, "Sphinx", "Disco Mahjong Otachidai no Okite (Japan)", GAME_SUPPORTS_SAVE )
+
+GAME( 1991, ngpgal, 0, ngpgal, ngpgal, nbmj9195_state, nbmj9195, ROT0, "Nichibutsu", "Nekketsu Grand-Prix Gal (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1991, mjgottsu, 0, mjgottsu, mjgottsu, nbmj9195_state, nbmj9195, ROT0, "Nichibutsu", "Mahjong Gottsu ee-kanji (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1991, bakuhatu, mjgottsu, bakuhatu, bakuhatu, nbmj9195_state, nbmj9195, ROT0, "Nichibutsu", "Mahjong Bakuhatsu Junjouden (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1992, cmehyou, 0, cmehyou, cmehyou, nbmj9195_state, nbmj9195, ROT0, "Nichibutsu / Kawakusu", "Mahjong Circuit no Mehyou (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1992, mjkoiura, 0, mjkoiura, mjkoiura, nbmj9195_state, nbmj9195, ROT0, "Nichibutsu", "Mahjong Koi Uranai (Japan set 1)", GAME_SUPPORTS_SAVE )
+GAME( 1992, mkoiuraa, mjkoiura, mkoiuraa, mjkoiura, nbmj9195_state, nbmj9195, ROT0, "Nichibutsu", "Mahjong Koi Uranai (Japan set 2)", GAME_SUPPORTS_SAVE )
+
+GAME( 1994, mscoutm, 0, mscoutm, mscoutm, nbmj9195_state, nbmj9195, ROT0, "Sphinx / AV Japan", "Mahjong Scout Man (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1994, imekura, 0, imekura, imekura, nbmj9195_state, nbmj9195, ROT0, "Sphinx / AV Japan", "Imekura Mahjong (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1994, mjegolf, 0, mjegolf, mjegolf, nbmj9195_state, nbmj9195, ROT0, "Fujic / AV Japan", "Mahjong Erotica Golf (Japan)", GAME_SUPPORTS_SAVE )
+
+GAME( 199?, shabdama, 0, shabdama, mjuraden,nbmj9195_state, nbmj9195, ROT0, "Nichibutsu", "LD Mahjong #4 Shabon-Dama", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/ninjakd2.c b/src/mame/drivers/ninjakd2.c
index b1c780d6235..7c1b3feeab8 100644
--- a/src/mame/drivers/ninjakd2.c
+++ b/src/mame/drivers/ninjakd2.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Roberto Ventura, Leandro Dardini, Yochizo, Nicola Salmoria
/******************************************************************************
@@ -374,7 +374,6 @@ static ADDRESS_MAP_START( ninjakd2_main_cpu, AS_PROGRAM, 8, ninjakd2_state )
AM_RANGE(0xfa00, 0xffff) AM_RAM AM_SHARE("spriteram")
ADDRESS_MAP_END
-
static ADDRESS_MAP_START( mnight_main_cpu, AS_PROGRAM, 8, ninjakd2_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1")
@@ -454,6 +453,12 @@ static ADDRESS_MAP_START( ninjakd2_sound_cpu, AS_PROGRAM, 8, ninjakd2_state )
AM_RANGE(0xf000, 0xf000) AM_WRITE(ninjakd2_pcm_play_w)
ADDRESS_MAP_END
+
+static ADDRESS_MAP_START( decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 8, ninjakd2_state )
+ AM_RANGE(0x0000, 0x7fff) AM_ROM AM_SHARE("decrypted_opcodes")
+ AM_RANGE(0x8000, 0xbfff) AM_ROM AM_REGION("soundcpu", 0x8000)
+ADDRESS_MAP_END
+
static ADDRESS_MAP_START( ninjakd2_sound_io, AS_IO, 8, ninjakd2_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x01) AM_DEVWRITE("2203.1", ym2203_device, write)
@@ -909,7 +914,7 @@ MACHINE_RESET_MEMBER(ninjakd2_state,omegaf)
/*****************************************************************************/
-static MACHINE_CONFIG_START( ninjakd2, ninjakd2_state )
+static MACHINE_CONFIG_START( ninjakd2_core, ninjakd2_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z80, MAIN_CLOCK_12/2) /* verified */
@@ -956,7 +961,12 @@ static MACHINE_CONFIG_START( ninjakd2, ninjakd2_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
MACHINE_CONFIG_END
-static MACHINE_CONFIG_DERIVED( mnight, ninjakd2 )
+static MACHINE_CONFIG_DERIVED( ninjakd2, ninjakd2_core )
+ MCFG_CPU_MODIFY("soundcpu")
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
+MACHINE_CONFIG_END
+
+static MACHINE_CONFIG_DERIVED( mnight, ninjakd2_core )
/* basic machine hardware */
MCFG_CPU_MODIFY("maincpu")
@@ -969,7 +979,7 @@ static MACHINE_CONFIG_DERIVED( mnight, ninjakd2 )
MCFG_DEVICE_REMOVE("pcm")
MACHINE_CONFIG_END
-static MACHINE_CONFIG_DERIVED( arkarea, ninjakd2 )
+static MACHINE_CONFIG_DERIVED( arkarea, ninjakd2_core )
/* basic machine hardware */
MCFG_CPU_MODIFY("maincpu")
@@ -1469,15 +1479,14 @@ void ninjakd2_state::gfx_unscramble()
DRIVER_INIT_MEMBER(ninjakd2_state,ninjakd2)
{
- mc8123_decrypt_rom(machine(), "soundcpu", "user1", NULL, 0);
+ mc8123_decode(memregion("soundcpu")->base(), m_decrypted_opcodes, memregion("user1")->base(), 0x8000);
gfx_unscramble();
}
DRIVER_INIT_MEMBER(ninjakd2_state,bootleg)
{
- address_space &space = m_soundcpu->space(AS_PROGRAM);
- space.set_decrypted_region(0x0000, 0x7fff, memregion("soundcpu")->base() + 0x10000);
+ memcpy(m_decrypted_opcodes, memregion("soundcpu")->base() + 0x10000, 0x8000);
gfx_unscramble();
}
diff --git a/src/mame/drivers/ninjaw.c b/src/mame/drivers/ninjaw.c
index 6b2b7fe7fc3..e39d2665bf5 100644
--- a/src/mame/drivers/ninjaw.c
+++ b/src/mame/drivers/ninjaw.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:David Graves
/***************************************************************************
diff --git a/src/mame/drivers/nl_breakout.c b/src/mame/drivers/nl_breakout.c
index 9766a98fcce..96da4942764 100644
--- a/src/mame/drivers/nl_breakout.c
+++ b/src/mame/drivers/nl_breakout.c
@@ -133,7 +133,7 @@ CIRCUIT_LAYOUT( breakout )
CHIP("F1", 9316)
NET_C(Y1.Q, F1.2)
- CONNECTION("F1", 14, "H1", 13)
+ CONNECTION("F1", 14, d, 13)
CONNECTION("F1", 13, "H1", 12)
CONNECTION("F1", 15, "E1", 5)
CONNECTION(P, "F1", 1)
@@ -1619,7 +1619,7 @@ CIRCUIT_LAYOUT( breakout )
RES(R33, 47)
- CD_4016_DIP(D9)
+ CD4016_DIP(D9)
NET_C(D9.7, GND)
NET_C(D9.14, V5)
diff --git a/src/mame/drivers/nl_pong.c b/src/mame/drivers/nl_pong.c
index c3373cbb91e..5192b2ec1c7 100644
--- a/src/mame/drivers/nl_pong.c
+++ b/src/mame/drivers/nl_pong.c
@@ -12,11 +12,15 @@
#define FAST_CLOCK (1)
#ifndef __PLIB_PREPROCESSOR__
+#if 0
+#define TTL_7400A_NAND(_name, _A, _B) TTL_7400_NAND(_name, _A, _B)
+#else
#define TTL_7400A_NAND(_name, _A, _B) \
- NET_REGISTER_DEV_X(TTL_7400A_NAND, _name) \
+ NET_REGISTER_DEV(TTL_7400A_NAND, _name) \
NET_CONNECT(_name, A, _A) \
NET_CONNECT(_name, B, _B)
#endif
+#endif
NETLIST_START(lib)
TRUTHTABLE_START(TTL_7400A_NAND, 2, 1, 0, "A,B")
@@ -29,6 +33,8 @@ NETLIST_END()
NETLIST_START(pong_fast)
+ LOCAL_SOURCE(lib)
+
INCLUDE(lib)
SOLVER(Solver, 48000)
PARAM(Solver.PARALLEL, 0) // Don't do parallel solvers
diff --git a/src/mame/drivers/nmk16.c b/src/mame/drivers/nmk16.c
index b383c600a91..d50a17795ee 100644
--- a/src/mame/drivers/nmk16.c
+++ b/src/mame/drivers/nmk16.c
@@ -2337,7 +2337,7 @@ static INPUT_PORTS_START( airattck )
PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:8")
PORT_DIPSETTING( 0x0001, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
- PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:7")
+ PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:7")
PORT_DIPSETTING( 0x0002, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:6,5")
@@ -2345,10 +2345,10 @@ static INPUT_PORTS_START( airattck )
PORT_DIPSETTING( 0x000c, DEF_STR( Normal ) )
PORT_DIPSETTING( 0x0008, DEF_STR( Hard ) )
PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) )
- PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:4")
+ PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:4")
PORT_DIPSETTING( 0x0010, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
- PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:3")
+ PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:3")
PORT_DIPSETTING( 0x0020, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_DIPNAME( 0x00c0, 0x00c0, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:2,1")
@@ -2362,13 +2362,13 @@ static INPUT_PORTS_START( airattck )
PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:7")
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0200, DEF_STR( On ) )
- PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:6")
+ PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:6")
PORT_DIPSETTING( 0x0400, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
- PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:5")
+ PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:5")
PORT_DIPSETTING( 0x0800, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
- PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:4")
+ PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW2:4")
PORT_DIPSETTING( 0x1000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_DIPNAME( 0xe000, 0xe000, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW2:3,2,1")
@@ -3504,6 +3504,15 @@ static INPUT_PORTS_START( firehawk )
PORT_DIPSETTING( 0xa000, DEF_STR( 1C_3C ) )
INPUT_PORTS_END
+static INPUT_PORTS_START( firehawkv )
+ PORT_INCLUDE( firehawk )
+
+ PORT_MODIFY("DSW1")
+ PORT_DIPNAME( 0x0100, 0x0000, "Orientation" ) PORT_DIPLOCATION("SW2:8")
+ PORT_DIPSETTING( 0x0100, "Vertical" )
+ PORT_DIPSETTING( 0x0000, "Horizontal" )
+INPUT_PORTS_END
+
/***************************************************************************
Spectrum 2000
@@ -4938,7 +4947,30 @@ static ADDRESS_MAP_START( afega, AS_PROGRAM, 16, nmk16_state )
AM_RANGE(0x0f0000, 0x0fffff) AM_RAM_WRITE(nmk16_mainram_strange_w) AM_SHARE("mainram")
ADDRESS_MAP_END
-
+// firehawk has 0x100000 bytes of program rom (at least the switchable version) so the above can't work.
+static ADDRESS_MAP_START( firehawk_map, AS_PROGRAM, 16, nmk16_state )
+ ADDRESS_MAP_GLOBAL_MASK(0x3fffff)
+ AM_RANGE(0x000000, 0x0fffff) AM_ROM
+ AM_RANGE(0x280000, 0x280001) AM_READ_PORT("IN0") // Buttons
+ AM_RANGE(0x280002, 0x280003) AM_READ_PORT("IN1") // P1 + P2
+ AM_RANGE(0x280004, 0x280005) AM_READ_PORT("DSW1") // 2 x DSW
+ AM_RANGE(0x280012, 0x280013) AM_READ(afega_unknown_r)
+ AM_RANGE(0x280000, 0x28001d) AM_WRITEONLY //
+ AM_RANGE(0x28001e, 0x28001f) AM_WRITE(afega_soundlatch_w) // To Sound CPU
+/**/AM_RANGE(0x284000, 0x284003) AM_RAM_WRITE(afega_scroll0_w) // Scroll on redhawkb (mirror or changed?..)
+/**/AM_RANGE(0x284004, 0x284007) AM_RAM_WRITE(afega_scroll1_w) // Scroll on redhawkb (mirror or changed?..)
+ AM_RANGE(0x280020, 0x287fff) AM_WRITEONLY //
+/**/AM_RANGE(0x288000, 0x2885ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") // Palette
+ AM_RANGE(0x288600, 0x28bfff) AM_WRITEONLY //
+/**/AM_RANGE(0x28c000, 0x28c003) AM_RAM_WRITE(afega_scroll0_w) AM_SHARE("afega_scroll_0") // Scroll
+/**/AM_RANGE(0x28c004, 0x28c007) AM_RAM_WRITE(afega_scroll1_w) AM_SHARE("afega_scroll_1") //
+ AM_RANGE(0x28c008, 0x28ffff) AM_WRITEONLY //
+/**/AM_RANGE(0x290000, 0x293fff) AM_RAM_WRITE(nmk_bgvideoram0_w) AM_SHARE("nmk_bgvideoram0") // Layer 0 // ?
+/**/AM_RANGE(0x29c000, 0x29c7ff) AM_RAM_WRITE(nmk_txvideoram_w) AM_SHARE("nmk_txvideoram") // Layer 1
+
+ AM_RANGE(0x3c0000, 0x3cffff) AM_RAM_WRITE(nmk16_mainram_strange_w) AM_SHARE("mainram")
+ AM_RANGE(0x3f0000, 0x3fffff) AM_RAM_WRITE(nmk16_mainram_strange_w) AM_SHARE("mainram")
+ADDRESS_MAP_END
/***************************************************************************
@@ -5161,7 +5193,7 @@ static MACHINE_CONFIG_START( firehawk, nmk16_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000,12000000)
- MCFG_CPU_PROGRAM_MAP(afega)
+ MCFG_CPU_PROGRAM_MAP(firehawk_map)
NMK_HACKY_INTERRUPT_TIMING
MCFG_CPU_ADD("audiocpu", Z80,4000000)
@@ -5188,6 +5220,12 @@ static MACHINE_CONFIG_START( firehawk, nmk16_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
+static MACHINE_CONFIG_DERIVED( spec2k, firehawk )
+ MCFG_CPU_MODIFY("maincpu")
+ MCFG_CPU_PROGRAM_MAP(afega)
+MACHINE_CONFIG_END
+
+
static MACHINE_CONFIG_START( twinactn, nmk16_state )
/* basic machine hardware */
@@ -7586,14 +7624,14 @@ ROM_START( firehawkv )
ROM_LOAD( "fhawk_s1.u38", 0x00000, 0x20000, CRC(c6609c39) SHA1(fe9b5f6c3ab42c48cb493fecb1181901efabdb58) )
ROM_REGION( 0x400000, "sprites",0 ) /* Sprites, 16x16x4 */
- ROM_LOAD( "rom.uc1", 0x000000, 0x200000, NO_DUMP )
- ROM_LOAD( "rom.uc2", 0x200000, 0x200000, NO_DUMP )
+ ROM_LOAD( "rom.uc1", 0x000000, 0x200000, NO_DUMP ) // for vertical mode, missing
+ ROM_LOAD( "fhawk_g3.uc2", 0x200000, 0x200000, BAD_DUMP CRC(cae72ff4) SHA1(7dca7164015228ea039deffd234778d0133971ab) ) // for horizontal mode, taken from above
ROM_REGION( 0x800000, "bgtile", 0 ) /* Layer 0, 16x16x8 */
- ROM_LOAD( "rom.uc3", 0x000000, 0x200000, NO_DUMP )
- ROM_LOAD( "rom.uc4", 0x200000, 0x200000, NO_DUMP )
- ROM_LOAD( "rom.uc5", 0x400000, 0x200000, NO_DUMP )
- ROM_LOAD( "rom.uc6", 0x600000, 0x200000, NO_DUMP )
+ ROM_LOAD( "rom.uc3", 0x000000, 0x200000, NO_DUMP ) // for vertical mode, missing
+ ROM_LOAD( "rom.uc4", 0x400000, 0x200000, NO_DUMP ) // for vertical mode, missing
+ ROM_LOAD( "fhawk_g1.uc6", 0x200000, 0x200000, BAD_DUMP CRC(2ab0b06b) SHA1(25362f6a517f188c62bac28b1a7b7b49622b1518) ) // for horizontal mode, taken from above
+ ROM_LOAD( "fhawk_g2.uc5", 0x600000, 0x200000, BAD_DUMP CRC(d11bfa20) SHA1(15142004ab49f7f1e666098211dff0835c61df8d) ) // for horizontal mode, taken from above
ROM_REGION( 0x00100, "fgtile", ROMREGION_ERASEFF ) /* Layer 1, 8x8x4 */
// Unused
@@ -7658,7 +7696,7 @@ DRIVER_INIT_MEMBER(nmk16_state,spec2k)
}
ROM_START( spec2kh )
- ROM_REGION( 0x80000, "maincpu", 0 ) /* 68000 Code */
+ ROM_REGION( 0x100000, "maincpu", 0 ) /* 68000 Code */
ROM_LOAD16_BYTE( "yonatech5.u124", 0x00000, 0x40000, CRC(72ab5c05) SHA1(182a811982b89b8cda0677547ef0625c274f5c6b) )
ROM_LOAD16_BYTE( "yonatech6.u120", 0x00001, 0x40000, CRC(7e44bd9c) SHA1(da59685be14a09ec037743fcec34fb293f7d588d) )
@@ -7683,7 +7721,7 @@ ROM_START( spec2kh )
ROM_END
ROM_START( spec2k )
- ROM_REGION( 0x80000, "maincpu", 0 ) /* 68000 Code */
+ ROM_REGION( 0x100000, "maincpu", 0 ) /* 68000 Code */
ROM_LOAD16_BYTE( "u124", 0x00000, 0x40000, CRC(dbd6f65d) SHA1(0fad9836689fcbee60904ccad59a2a5be09f3139) )
ROM_LOAD16_BYTE( "u120", 0x00001, 0x40000, CRC(be53e243) SHA1(38144b90a35ba144921824a0c4f133339e07f9a1) )
@@ -7867,10 +7905,10 @@ GAME( 1999, popspops, 0, popspops, popspops, nmk16_state, grdnstrm, ROT
GAME( 2000, mangchi, 0, popspops, mangchi, nmk16_state, bubl2000, ROT0, "Afega", "Mang-Chi", 0 )
// these two are very similar games, but the exact parent/clone relationship is unknown
-GAME( 2000, spec2k, 0, firehawk, spec2k, nmk16_state, spec2k, ROT270, "Yona Tech", "Spectrum 2000 (vertical)", GAME_IMPERFECT_GRAPHICS ) // the ships sometimes scroll off the screen if you insert a coin during the attract demo? verify it doesn't happen on real hw(!)
-GAME( 2000, spec2kh, spec2k, firehawk, spec2k, nmk16_state, spec2k, ORIENTATION_FLIP_Y, "Yona Tech", "Spectrum 2000 (horizontal, buggy) (Europe)", 0 ) // this has odd bugs even on real hardware, eg glitchy 3 step destruction sequence of some larger enemies
+GAME( 2000, spec2k, 0, spec2k, spec2k, nmk16_state, spec2k, ROT270, "Yona Tech", "Spectrum 2000 (vertical)", GAME_IMPERFECT_GRAPHICS ) // the ships sometimes scroll off the screen if you insert a coin during the attract demo? verify it doesn't happen on real hw(!)
+GAME( 2000, spec2kh, spec2k, spec2k, spec2k, nmk16_state, spec2k, ORIENTATION_FLIP_Y, "Yona Tech", "Spectrum 2000 (horizontal, buggy) (Europe)", 0 ) // this has odd bugs even on real hardware, eg glitchy 3 step destruction sequence of some larger enemies
GAME( 2001, firehawk, spec2k, firehawk, firehawk, driver_device, 0, ORIENTATION_FLIP_Y, "ESD", "Fire Hawk (horizontal)", 0 )
-GAME( 2001, firehawkv,spec2k, firehawk, firehawk, driver_device, 0, ROT270, "ESD", "Fire Hawk (switchable orientation)", GAME_NOT_WORKING ) // incomplete dump
+GAME( 2001, firehawkv,spec2k, firehawk, firehawkv,driver_device, 0, ORIENTATION_FLIP_Y, "ESD", "Fire Hawk (switchable orientation)", GAME_NOT_WORKING ) // incomplete dump, vertical mode gfx not dumped
// bee-oh board - different display / interrupt timing to others?
GAME( 1991, manybloc, 0, manybloc, manybloc, driver_device, 0, ROT270, "Bee-Oh", "Many Block", GAME_NO_COCKTAIL | GAME_IMPERFECT_SOUND )
diff --git a/src/mame/drivers/nss.c b/src/mame/drivers/nss.c
index 10d2bc70979..e462d4f58be 100644
--- a/src/mame/drivers/nss.c
+++ b/src/mame/drivers/nss.c
@@ -160,9 +160,11 @@ Game Name IC1 IC1 Type IC3 IC3 Type Jump
-------------------------------------------------------------------------------------------------------
Super Mario World NSS-MW-0_PRG LH534J NSS-R_IC3_MW 27C256 CL1 CL2 CL3 CL4 CL5 - Short
SL1 SL2 SL3 SL4 SL5 - Open
+Super Mario World NSS-R__IC1__MW ?LH534J? NSS-R_IC3_MW 27C256 CL1 CL2 CL3 CL4 CL5 - Short
+ SL1 SL2 SL3 SL4 SL5 - Open
Super Tennis NSS-ST-0 LH534J NSS-R_IC3_ST 27C256 CL1 CL2 CL3 CL4 CL5 - Short
SL1 SL2 SL3 SL4 SL5 - Open
-Super Soccer NSS-R_IC1_FS TC574000 NSS-R_IC3_FS 27C256 CL1 CL2 CL3 CL4 CL5 - Open
+Super Soccer NSS-R__IC1__FS TC574000 NSS-R_IC3_FS 27C256 CL1 CL2 CL3 CL4 CL5 - Open
SL1 SL2 SL3 SL4 SL5 - Short
-------------------------------------------------------------------------------------------------------
Note - By setting the jumpers to 'Super Soccer', the other 2 games can use standard EPROMs if required.
@@ -1010,13 +1012,15 @@ ROM_START( nss_smw )
NSS_BIOS
ROM_REGION( 0x100000, "user3", 0 )
ROM_LOAD( "nss-mw-0_prg.ic1", 0x000000, 0x80000, CRC(c46766f2) SHA1(06a6efc246c6fdb83efab1d402d61d2179a84494) )
+ // Note: this rom appears with 2 variations: LH534J mask rom with "NSS-MW-0 // PRG" silkscreen
+ // or ?LH534J mask rom? with "NSS-R // IC1 // MW" label sticker
/* instruction / data rom for bios */
ROM_REGION( 0x8000, "ibios_rom", 0 )
ROM_LOAD( "nss-r__ic3__mw.ic3", 0x0000, 0x8000, CRC(f2c5466e) SHA1(e116f01342fcf359498ed8750741c139093b1fb2) )
ROM_REGION( 0x10, "rp5h01", 0 )
- ROM_LOAD( "security.prm", 0x00, 0x10, CRC(fd700dca) SHA1(6805cefb1856c3498b7a7a049c0d09858afac47c) )
+ ROM_LOAD( "security.prm", 0x00, 0x10, CRC(fd700dca) SHA1(6805cefb1856c3498b7a7a049c0d09858afac47c) ) // Labeled "MW" on yellow sticker
ROM_END
ROM_START( nss_fzer )
diff --git a/src/mame/drivers/nycaptor.c b/src/mame/drivers/nycaptor.c
index ee23e4cedac..b2d060762fe 100644
--- a/src/mame/drivers/nycaptor.c
+++ b/src/mame/drivers/nycaptor.c
@@ -303,7 +303,7 @@ READ8_MEMBER(nycaptor_state::nycaptor_generic_control_r)
WRITE8_MEMBER(nycaptor_state::nycaptor_generic_control_w)
{
m_generic_control_reg = data;
- membank("bank1")->set_base(memregion("maincpu")->base() + 0x10000 + ((data&0x08)>>3)*0x4000 );
+ membank("bank1")->set_entry((data&0x08)>>3);
}
static ADDRESS_MAP_START( nycaptor_master_map, AS_PROGRAM, 8, nycaptor_state )
@@ -404,10 +404,8 @@ READ8_MEMBER(nycaptor_state::cyclshtg_mcu_status_r1)
WRITE8_MEMBER(nycaptor_state::cyclshtg_generic_control_w)
{
- int bank = (data >> 2) & 3;
-
m_generic_control_reg = data;
- membank("bank1")->set_base(memregion("maincpu")->base() + 0x10000 + bank*0x4000 );
+ membank("bank1")->set_entry((data >> 2) & 3);
}
@@ -741,6 +739,11 @@ GFXDECODE_END
void nycaptor_state::machine_start()
{
+ if (m_gametype == 0)
+ membank("bank1")->configure_entries(0, 2, memregion("maincpu")->base() + 0x10000, 0x4000);
+ else
+ membank("bank1")->configure_entries(0, 4, memregion("maincpu")->base() + 0x10000, 0x4000);
+
save_item(NAME(m_generic_control_reg));
save_item(NAME(m_sound_nmi_enable));
save_item(NAME(m_pending_nmi));
diff --git a/src/mame/drivers/othunder.c b/src/mame/drivers/othunder.c
index 81134f2725b..631b3a368c2 100644
--- a/src/mame/drivers/othunder.c
+++ b/src/mame/drivers/othunder.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:David Graves
/***************************************************************************
diff --git a/src/mame/drivers/pacland.c b/src/mame/drivers/pacland.c
index 2bf62a73b25..2f42c13574d 100644
--- a/src/mame/drivers/pacland.c
+++ b/src/mame/drivers/pacland.c
@@ -195,20 +195,27 @@ Notes:
#include "cpu/m6800/m6800.h"
#include "includes/pacland.h"
-WRITE8_MEMBER(pacland_state::pacland_subreset_w)
+
+void pacland_state::machine_start()
+{
+ save_item(NAME(m_main_irq_mask));
+ save_item(NAME(m_mcu_irq_mask));
+}
+
+WRITE8_MEMBER(pacland_state::subreset_w)
{
int bit = !BIT(offset,11);
m_mcu->set_input_line(INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
}
-WRITE8_MEMBER(pacland_state::pacland_flipscreen_w)
+WRITE8_MEMBER(pacland_state::flipscreen_w)
{
int bit = !BIT(offset,11);
flip_screen_set(bit);
}
-READ8_MEMBER(pacland_state::pacland_input_r)
+READ8_MEMBER(pacland_state::input_r)
{
int shift = 4 * (offset & 1);
int port = offset & 2;
@@ -219,20 +226,20 @@ READ8_MEMBER(pacland_state::pacland_input_r)
return r;
}
-WRITE8_MEMBER(pacland_state::pacland_coin_w)
+WRITE8_MEMBER(pacland_state::coin_w)
{
coin_lockout_global_w(machine(), data & 1);
coin_counter_w(machine(), 0, ~data & 2);
coin_counter_w(machine(), 1, ~data & 4);
}
-WRITE8_MEMBER(pacland_state::pacland_led_w)
+WRITE8_MEMBER(pacland_state::led_w)
{
set_led_status(machine(), 0, data & 0x08);
set_led_status(machine(), 1, data & 0x10);
}
-WRITE8_MEMBER(pacland_state::pacland_irq_1_ctrl_w)
+WRITE8_MEMBER(pacland_state::irq_1_ctrl_w)
{
int bit = !BIT(offset, 11);
m_main_irq_mask = bit;
@@ -240,7 +247,7 @@ WRITE8_MEMBER(pacland_state::pacland_irq_1_ctrl_w)
m_maincpu->set_input_line(0, CLEAR_LINE);
}
-WRITE8_MEMBER(pacland_state::pacland_irq_2_ctrl_w)
+WRITE8_MEMBER(pacland_state::irq_2_ctrl_w)
{
int bit = !BIT(offset, 13);
m_mcu_irq_mask = bit;
@@ -251,19 +258,19 @@ WRITE8_MEMBER(pacland_state::pacland_irq_2_ctrl_w)
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, pacland_state )
- AM_RANGE(0x0000, 0x0fff) AM_RAM_WRITE(pacland_videoram_w) AM_SHARE("videoram")
- AM_RANGE(0x1000, 0x1fff) AM_RAM_WRITE(pacland_videoram2_w) AM_SHARE("videoram2")
+ AM_RANGE(0x0000, 0x0fff) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram")
+ AM_RANGE(0x1000, 0x1fff) AM_RAM_WRITE(videoram2_w) AM_SHARE("videoram2")
AM_RANGE(0x2000, 0x37ff) AM_RAM AM_SHARE("spriteram")
- AM_RANGE(0x3800, 0x3801) AM_WRITE(pacland_scroll0_w)
- AM_RANGE(0x3a00, 0x3a01) AM_WRITE(pacland_scroll1_w)
- AM_RANGE(0x3c00, 0x3c00) AM_WRITE(pacland_bankswitch_w)
+ AM_RANGE(0x3800, 0x3801) AM_WRITE(scroll0_w)
+ AM_RANGE(0x3a00, 0x3a01) AM_WRITE(scroll1_w)
+ AM_RANGE(0x3c00, 0x3c00) AM_WRITE(bankswitch_w)
AM_RANGE(0x4000, 0x5fff) AM_ROMBANK("bank1")
AM_RANGE(0x6800, 0x6bff) AM_DEVREADWRITE("namco", namco_cus30_device, namcos1_cus30_r, namcos1_cus30_w) /* PSG device, shared RAM */
- AM_RANGE(0x7000, 0x7fff) AM_WRITE(pacland_irq_1_ctrl_w)
+ AM_RANGE(0x7000, 0x7fff) AM_WRITE(irq_1_ctrl_w)
AM_RANGE(0x7800, 0x7fff) AM_READ(watchdog_reset_r)
AM_RANGE(0x8000, 0xffff) AM_ROM
- AM_RANGE(0x8000, 0x8fff) AM_WRITE(pacland_subreset_w)
- AM_RANGE(0x9000, 0x9fff) AM_WRITE(pacland_flipscreen_w)
+ AM_RANGE(0x8000, 0x8fff) AM_WRITE(subreset_w)
+ AM_RANGE(0x9000, 0x9fff) AM_WRITE(flipscreen_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( mcu_map, AS_PROGRAM, 8, pacland_state )
@@ -271,10 +278,10 @@ static ADDRESS_MAP_START( mcu_map, AS_PROGRAM, 8, pacland_state )
AM_RANGE(0x0080, 0x00ff) AM_RAM
AM_RANGE(0x1000, 0x13ff) AM_DEVREADWRITE("namco", namco_cus30_device, namcos1_cus30_r, namcos1_cus30_w) /* PSG device, shared RAM */
AM_RANGE(0x2000, 0x3fff) AM_WRITE(watchdog_reset_w) /* watchdog? */
- AM_RANGE(0x4000, 0x7fff) AM_WRITE(pacland_irq_2_ctrl_w)
+ AM_RANGE(0x4000, 0x7fff) AM_WRITE(irq_2_ctrl_w)
AM_RANGE(0x8000, 0xbfff) AM_ROM
AM_RANGE(0xc000, 0xc7ff) AM_RAM
- AM_RANGE(0xd000, 0xd003) AM_READ(pacland_input_r)
+ AM_RANGE(0xd000, 0xd003) AM_READ(input_r)
AM_RANGE(0xf000, 0xffff) AM_ROM
ADDRESS_MAP_END
@@ -286,9 +293,9 @@ READ8_MEMBER(pacland_state::readFF)
static ADDRESS_MAP_START( mcu_port_map, AS_IO, 8, pacland_state )
AM_RANGE(M6801_PORT1, M6801_PORT1) AM_READ_PORT("IN2")
- AM_RANGE(M6801_PORT1, M6801_PORT1) AM_WRITE(pacland_coin_w)
+ AM_RANGE(M6801_PORT1, M6801_PORT1) AM_WRITE(coin_w)
AM_RANGE(M6801_PORT2, M6801_PORT2) AM_READ(readFF) /* leds won't work otherwise */
- AM_RANGE(M6801_PORT2, M6801_PORT2) AM_WRITE(pacland_led_w)
+ AM_RANGE(M6801_PORT2, M6801_PORT2) AM_WRITE(led_w)
ADDRESS_MAP_END
@@ -433,7 +440,7 @@ static MACHINE_CONFIG_START( pacland, pacland_state )
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_RAW_PARAMS(XTAL_49_152MHz/8, 384, 3*8, 39*8, 264, 2*8, 30*8)
- MCFG_SCREEN_UPDATE_DRIVER(pacland_state, screen_update_pacland)
+ MCFG_SCREEN_UPDATE_DRIVER(pacland_state, screen_update)
MCFG_SCREEN_PALETTE("palette")
MCFG_GFXDECODE_ADD("gfxdecode", "palette", pacland)
diff --git a/src/mame/drivers/pacman.c b/src/mame/drivers/pacman.c
index 17772c0a202..7c6b1cd941e 100644
--- a/src/mame/drivers/pacman.c
+++ b/src/mame/drivers/pacman.c
@@ -982,6 +982,10 @@ ADDRESS_MAP_END
// The Pacman code uses $5004 and $5005 for LED's and $5007 for coin lockout. This hardware does not
// exist on any Pacman or Puckman board I have seen. DW
+static ADDRESS_MAP_START( patched_opcodes_map, AS_DECRYPTED_OPCODES, 8, pacman_state )
+ AM_RANGE(0x0000, 0x3fff) AM_MIRROR(0x8000) AM_ROM AM_SHARE("patched_opcodes")
+ADDRESS_MAP_END
+
static ADDRESS_MAP_START( birdiy_map, AS_PROGRAM, 8, pacman_state )
AM_RANGE(0x0000, 0x3fff) AM_MIRROR(0x8000) AM_ROM
@@ -3462,6 +3466,11 @@ static MACHINE_CONFIG_START( pacman, pacman_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
+static MACHINE_CONFIG_DERIVED( pacmanp, pacman )
+ MCFG_CPU_MODIFY("maincpu")
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(patched_opcodes_map)
+MACHINE_CONFIG_END
+
static MACHINE_CONFIG_DERIVED( pengojpm, pacman )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(pengojpm_map)
@@ -6371,25 +6380,22 @@ ROM_END
void pacman_state::maketrax_rom_decode()
{
- address_space &space = m_maincpu->space(AS_PROGRAM);
- UINT8 *decrypted = auto_alloc_array(machine(), UINT8, 0x4000);
UINT8 *rom = memregion("maincpu")->base();
/* patch protection using a copy of the opcodes so ROM checksum */
/* tests will not fail */
- space.set_decrypted_region(0x0000, 0x3fff, decrypted);
-
- memcpy(decrypted,rom,0x4000);
-
- decrypted[0x0415] = 0xc9;
- decrypted[0x1978] = 0x18;
- decrypted[0x238e] = 0xc9;
- decrypted[0x3ae5] = 0xe6;
- decrypted[0x3ae7] = 0x00;
- decrypted[0x3ae8] = 0xc9;
- decrypted[0x3aed] = 0x86;
- decrypted[0x3aee] = 0xc0;
- decrypted[0x3aef] = 0xb0;
+
+ memcpy(m_patched_opcodes,rom,0x4000);
+
+ m_patched_opcodes[0x0415] = 0xc9;
+ m_patched_opcodes[0x1978] = 0x18;
+ m_patched_opcodes[0x238e] = 0xc9;
+ m_patched_opcodes[0x3ae5] = 0xe6;
+ m_patched_opcodes[0x3ae7] = 0x00;
+ m_patched_opcodes[0x3ae8] = 0xc9;
+ m_patched_opcodes[0x3aed] = 0x86;
+ m_patched_opcodes[0x3aee] = 0xc0;
+ m_patched_opcodes[0x3aef] = 0xb0;
}
DRIVER_INIT_MEMBER(pacman_state,maketrax)
@@ -6403,25 +6409,22 @@ DRIVER_INIT_MEMBER(pacman_state,maketrax)
void pacman_state::korosuke_rom_decode()
{
- address_space &space = m_maincpu->space(AS_PROGRAM);
- UINT8 *decrypted = auto_alloc_array(machine(), UINT8, 0x4000);
UINT8 *rom = memregion("maincpu")->base();
/* patch protection using a copy of the opcodes so ROM checksum */
/* tests will not fail */
- space.set_decrypted_region(0x0000, 0x3fff, decrypted);
-
- memcpy(decrypted,rom,0x4000);
-
- decrypted[0x044c] = 0xc9;
- decrypted[0x1973] = 0x18;
- decrypted[0x238c] = 0xc9;
- decrypted[0x3ae9] = 0xe6; /* not changed */
- decrypted[0x3aeb] = 0x00;
- decrypted[0x3aec] = 0xc9;
- decrypted[0x3af1] = 0x86;
- decrypted[0x3af2] = 0xc0;
- decrypted[0x3af3] = 0xb0;
+
+ memcpy(m_patched_opcodes,rom,0x4000);
+
+ m_patched_opcodes[0x044c] = 0xc9;
+ m_patched_opcodes[0x1973] = 0x18;
+ m_patched_opcodes[0x238c] = 0xc9;
+ m_patched_opcodes[0x3ae9] = 0xe6; /* not changed */
+ m_patched_opcodes[0x3aeb] = 0x00;
+ m_patched_opcodes[0x3aec] = 0xc9;
+ m_patched_opcodes[0x3af1] = 0x86;
+ m_patched_opcodes[0x3af2] = 0xc0;
+ m_patched_opcodes[0x3af3] = 0xb0;
}
DRIVER_INIT_MEMBER(pacman_state,korosuke)
@@ -6869,18 +6872,18 @@ GAME( 1985, jumpshotp,jumpshot, pacman, jumpshotp,pacman_state, jumpshot, ROT
GAME( 1985, shootbul, 0, pacman, shootbul, pacman_state, jumpshot, ROT90, "Bally Midway", "Shoot the Bull", GAME_SUPPORTS_SAVE )
-GAME( 1981, crush, 0, pacman, maketrax, pacman_state, maketrax, ROT90, "Alpha Denshi Co. / Kural Samno Electric, Ltd.", "Crush Roller (set 1)", GAME_SUPPORTS_SAVE )
+GAME( 1981, crush, 0, pacmanp, maketrax, pacman_state, maketrax, ROT90, "Alpha Denshi Co. / Kural Samno Electric, Ltd.", "Crush Roller (set 1)", GAME_SUPPORTS_SAVE )
GAME( 1981, crush2, crush, pacman, maketrax, driver_device, 0, ROT90, "Alpha Denshi Co. / Kural Esco Electric, Ltd.", "Crush Roller (set 2)", GAME_SUPPORTS_SAVE )
GAME( 1981, crush3, crush, pacman, maketrax, pacman_state, eyes, ROT90, "Alpha Denshi Co. / Kural Electric, Ltd.", "Crush Roller (set 3)", GAME_SUPPORTS_SAVE )
GAME( 1981, crush4, crush, crush4, crush4, driver_device, 0, ROT90, "Alpha Denshi Co. / Kural TWT", "Crush Roller (set 4)", GAME_SUPPORTS_SAVE )
-GAME( 1981, maketrax, crush, pacman, maketrax, pacman_state, maketrax, ROT270, "Alpha Denshi Co. / Kural (Williams license)", "Make Trax (US set 1)", GAME_SUPPORTS_SAVE )
-GAME( 1981, maketrxb, crush, pacman, maketrax, pacman_state, maketrax, ROT270, "Alpha Denshi Co. / Kural (Williams license)", "Make Trax (US set 2)", GAME_SUPPORTS_SAVE )
-GAME( 1981, korosuke, crush, pacman, korosuke, pacman_state, korosuke, ROT90, "Alpha Denshi Co. / Kural Electric, Ltd.", "Korosuke Roller (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1981, maketrax, crush, pacmanp, maketrax, pacman_state, maketrax, ROT270, "Alpha Denshi Co. / Kural (Williams license)", "Make Trax (US set 1)", GAME_SUPPORTS_SAVE )
+GAME( 1981, maketrxb, crush, pacmanp, maketrax, pacman_state, maketrax, ROT270, "Alpha Denshi Co. / Kural (Williams license)", "Make Trax (US set 2)", GAME_SUPPORTS_SAVE )
+GAME( 1981, korosuke, crush, pacmanp, korosuke, pacman_state, korosuke, ROT90, "Alpha Denshi Co. / Kural Electric, Ltd.", "Korosuke Roller (Japan)", GAME_SUPPORTS_SAVE )
GAME( 1981, crushbl, crush, pacman, maketrax, driver_device, 0, ROT90, "bootleg", "Crush Roller (bootleg set 1)", GAME_SUPPORTS_SAVE )
-GAME( 1981, crushbl2, crush, pacman, mbrush, pacman_state, maketrax, ROT90, "bootleg", "Crush Roller (bootleg set 2)", GAME_SUPPORTS_SAVE )
-GAME( 1981, crushbl3, crush, pacman, mbrush, pacman_state, maketrax, ROT90, "bootleg", "Crush Roller (bootleg set 3)", GAME_SUPPORTS_SAVE )
+GAME( 1981, crushbl2, crush, pacmanp, mbrush, pacman_state, maketrax, ROT90, "bootleg", "Crush Roller (bootleg set 2)", GAME_SUPPORTS_SAVE )
+GAME( 1981, crushbl3, crush, pacmanp, mbrush, pacman_state, maketrax, ROT90, "bootleg", "Crush Roller (bootleg set 3)", GAME_SUPPORTS_SAVE )
GAME( 1981, crushs, crush, crushs, crushs, driver_device, 0, ROT90, "bootleg (Sidam)", "Crush Roller (bootleg set 4)", GAME_SUPPORTS_SAVE ) // Sidam PCB, no Sidam text
-GAME( 1981, mbrush, crush, pacman, mbrush, pacman_state, maketrax, ROT90, "bootleg", "Magic Brush (bootleg of Crush Roller)", GAME_SUPPORTS_SAVE )
+GAME( 1981, mbrush, crush, pacmanp, mbrush, pacman_state, maketrax, ROT90, "bootleg", "Magic Brush (bootleg of Crush Roller)", GAME_SUPPORTS_SAVE )
GAME( 1981, paintrlr, crush, pacman, paintrlr, driver_device, 0, ROT90, "bootleg", "Paint Roller (bootleg of Crush Roller)", GAME_SUPPORTS_SAVE )
GAME( 1982, eyes, 0, pacman, eyes, pacman_state, eyes, ROT90, "Techstar (Rock-Ola license)", "Eyes (US set 1)", GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/paradise.c b/src/mame/drivers/paradise.c
index b3fb74d0cf4..c78d0adec2b 100644
--- a/src/mame/drivers/paradise.c
+++ b/src/mame/drivers/paradise.c
@@ -14,8 +14,8 @@ Sound Chips : 2 x AR17961 (OKI M6295) (only 1 in Torus)
---------------------------------------------------------------------------
Year + Game Board#
---------------------------------------------------------------------------
-94+ Paradise YS-1600
-94+ Paradise Deluxe YS-1604
+94 Paradise YS-1600
+94 Paradise Deluxe YS-1604
95 Target Ball YS-2002
96 Penky YS951004
96 Torus YS-0402? Looks identical
@@ -27,8 +27,6 @@ Notes:
paradise: I'm not sure it's working correctly:
- The high scores table can't be entered !?
-- The chance to play a bonus game is very slim. I think I got to play
- a couple in total. Is there a way to trigger them !?
penky: we need to delay the irqs at startup or it won't boot. Either one of
ports 0x2003.r or 0x2005.w starts up the irq timer (confirmed via trojan)
@@ -81,6 +79,11 @@ DIPSW-B
(Slide Show) | Test | |on |
--------------------------------------------------------------------
+2015/06/03 - System11
+Amended above comments - bonus round is triggered by percentage when you
+beat a stage. Added 2 clones. Amended date to 1994 based on Distributor
+sticker from Jan 95 and factory sticker 94*41.
+
***************************************************************************/
#include "emu.h"
@@ -802,9 +805,20 @@ YS-1604
| |
|---------------------------------------------------------|
-The year is not shown but must be >= 1994, since the development system
-(cross compiler?) they used left a "1994.8-1989" in the rom
+Year is assumed to be 1994 based on 94*41 factory sticker and 19/1/95
+operator sticker on a revised version PCB. The year is not shown but
+must be >= 1994, since the development system (cross compiler?) they
+used left a "1994.8-1989" in the rom
+
+Paradise (set 2): No board ID, although some tracks which are wire hacks on
+ YS-1600 PCB are corrected on this version. All roms are labeled as "A-19"
+ Except for the program rom all other data matches Paradise (set 1).
+ NOTE: on this version of the PCB the above listed 4MHz OSC is replaced with
+ a 3.579545MHz OSC
+The Escape version might be the newest revision due to improved slot machine
+ animation on 'girl select' compared to other sets. Except for the program
+ rom all other data matches Paradise (set 1).
***************************************************************************/
ROM_START( paradise )
@@ -833,6 +847,58 @@ ROM_START( paradise )
ROM_LOAD( "u113", 0x00000, 0x80000, CRC(53de6025) SHA1(c94b3778b57ff7f46ce4cff661841019fb187d5d) )
ROM_END
+ROM_START( paradisea )
+ ROM_REGION( 0x40000, "maincpu", 0 ) /* Z80 Code */
+ ROM_LOAD( "a-19.U128", 0x00000, 0x40000, CRC(d47ecb7e) SHA1(74e7a33f2fc4c7c830c53c50541c3d0efd152e98) )
+
+ ROM_REGION( 0x80000, "gfx1", ROMREGION_INVERT) /* 16x16x8 Sprites */
+ ROM_LOAD( "a-19.u114", 0x00000, 0x40000, CRC(c748ba3b) SHA1(ad23bda4e001ca539f849c1ca256de5daf7c233b) )
+ ROM_LOAD( "a-19.u115", 0x40000, 0x40000, CRC(0d517bbb) SHA1(5bf7c5036f3d660901e26f14baaea1a3c0327dfe) )
+
+ ROM_REGION( 0x20000, "gfx2", ROMREGION_INVERT) /* 8x8x4 Background */
+ ROM_LOAD( "a-19.u94", 0x00000, 0x20000, CRC(e3a99209) SHA1(5db79dc1a38d93b458b043499a58516285c65aa8) )
+
+ ROM_REGION( 0x100000, "gfx3", ROMREGION_INVERT) /* 8x8x8 Foreground */
+ ROM_LOAD( "a-19.u92", 0x00000, 0x80000, CRC(633d24f0) SHA1(26b25ec1014fba1a3d0d2bdba0c867c57034647d) )
+ ROM_LOAD( "a-19.u93", 0x80000, 0x80000, CRC(bbf5c632) SHA1(9d31e136f014c2dd7dd988c3aee0adfcfea91bc9) )
+
+ ROM_REGION( 0x40000, "gfx4", ROMREGION_INVERT) /* 8x8x8 Midground */
+ ROM_LOAD( "a-19.u110", 0x00000, 0x20000, CRC(9807a7e6) SHA1(30e2a741a93954cfe672c61c93a990d0c3b25145) )
+ ROM_LOAD( "a-19.u111", 0x20000, 0x20000, CRC(bc9f93f0) SHA1(dd4cfc849a0c0f918ac0dfeb7f00a67aae5a1c13) )
+
+ ROM_REGION( 0x40000, "oki1", 0 ) /* Samples */
+ ROM_LOAD( "a-19.u85", 0x00000, 0x40000, CRC(bf3c3065) SHA1(54dd7ffea2fb3f31ed575e982b82691cddc2581a) )
+
+ ROM_REGION( 0x80000, "oki2", 0 ) /* Samples (banked) */
+ ROM_LOAD( "a-19.u113", 0x00000, 0x80000, CRC(53de6025) SHA1(c94b3778b57ff7f46ce4cff661841019fb187d5d) )
+ROM_END
+
+ROM_START( paradisee ) /* YS-1600 PCB. All labels are simply labeled "Escape" */
+ ROM_REGION( 0x40000, "maincpu", 0 ) /* Z80 Code */
+ ROM_LOAD( "escape.U128", 0x00000, 0x40000, CRC(19b4e854) SHA1(7d7292017df67b7ed3a3e0059334866890c58b83) )
+
+ ROM_REGION( 0x80000, "gfx1", ROMREGION_INVERT) /* 16x16x8 Sprites */
+ ROM_LOAD( "escape.u114", 0x00000, 0x40000, CRC(c748ba3b) SHA1(ad23bda4e001ca539f849c1ca256de5daf7c233b) )
+ ROM_LOAD( "escape.u115", 0x40000, 0x40000, CRC(0d517bbb) SHA1(5bf7c5036f3d660901e26f14baaea1a3c0327dfe) )
+
+ ROM_REGION( 0x20000, "gfx2", ROMREGION_INVERT) /* 8x8x4 Background */
+ ROM_LOAD( "escape.u94", 0x00000, 0x20000, CRC(e3a99209) SHA1(5db79dc1a38d93b458b043499a58516285c65aa8) )
+
+ ROM_REGION( 0x100000, "gfx3", ROMREGION_INVERT) /* 8x8x8 Foreground */
+ ROM_LOAD( "escape.u92", 0x00000, 0x80000, CRC(633d24f0) SHA1(26b25ec1014fba1a3d0d2bdba0c867c57034647d) )
+ ROM_LOAD( "escape.u93", 0x80000, 0x80000, CRC(bbf5c632) SHA1(9d31e136f014c2dd7dd988c3aee0adfcfea91bc9) )
+
+ ROM_REGION( 0x40000, "gfx4", ROMREGION_INVERT) /* 8x8x8 Midground */
+ ROM_LOAD( "escape.u110", 0x00000, 0x20000, CRC(9807a7e6) SHA1(30e2a741a93954cfe672c61c93a990d0c3b25145) )
+ ROM_LOAD( "escape.u111", 0x20000, 0x20000, CRC(bc9f93f0) SHA1(dd4cfc849a0c0f918ac0dfeb7f00a67aae5a1c13) )
+
+ ROM_REGION( 0x40000, "oki1", 0 ) /* Samples */
+ ROM_LOAD( "escape.u85", 0x00000, 0x40000, CRC(bf3c3065) SHA1(54dd7ffea2fb3f31ed575e982b82691cddc2581a) )
+
+ ROM_REGION( 0x80000, "oki2", 0 ) /* Samples (banked) */
+ ROM_LOAD( "escape.u113", 0x00000, 0x80000, CRC(53de6025) SHA1(c94b3778b57ff7f46ce4cff661841019fb187d5d) )
+ROM_END
+
ROM_START( paradlx )
ROM_REGION( 0x40000, "maincpu", 0 ) /* Z80 Code */
ROM_LOAD( "8.u128", 0x00000, 0x40000, CRC(3a45ac9e) SHA1(24e1b508ef582c8429e09929fea387f3a137f0e3) )
@@ -859,8 +925,6 @@ ROM_START( paradlx )
ROM_LOAD( "9.u113", 0x00000, 0x80000, CRC(9c5337f0) SHA1(4d7a8069be4551aad9d7d32d835dcf91be079359) )
ROM_END
-
-
ROM_START( para2dx )
ROM_REGION( 0x40000, "maincpu", 0 ) /* Z80 Code */
ROM_LOAD( "pdx2_u128.bin", 0x00000, 0x40000, CRC(4cbd22e1) SHA1(ad69663109d3127f6472797ec8763097da94b7d4) )
@@ -1244,12 +1308,14 @@ DRIVER_INIT_MEMBER(paradise_state,torus)
***************************************************************************/
-GAME( 199?, paradise, 0, paradise, paradise, paradise_state, paradise, ROT90, "Yun Sung", "Paradise", GAME_SUPPORTS_SAVE ) // year not shown, but should be >=1994
-GAME( 199?, paradlx, 0, paradise, paradise, paradise_state, paradise, ROT90, "Yun Sung", "Paradise Deluxe", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) // "
-GAME( 199?, para2dx, 0, paradise, para2dx, paradise_state, paradise, ROT90, "Yun Sung", "Paradise 2 Deluxe", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) // "
-GAME( 1995, tgtball, 0, tgtball, tgtball, paradise_state, tgtball, ROT0, "Yun Sung", "Target Ball (Nude)", GAME_SUPPORTS_SAVE )
-GAME( 1995, tgtballa, tgtball, tgtball, tgtball, paradise_state, tgtball, ROT0, "Yun Sung", "Target Ball", GAME_SUPPORTS_SAVE )
-GAME( 1996, penky, 0, penky, penky, paradise_state, tgtball, ROT0, "Yun Sung", "Penky", GAME_SUPPORTS_SAVE )
-GAME( 1996, torus, 0, torus, torus, paradise_state, torus, ROT90, "Yun Sung", "Torus", GAME_SUPPORTS_SAVE )
-GAME( 1998, madball, 0, madball, madball, paradise_state, tgtball, ROT0, "Yun Sung", "Mad Ball V2.0", GAME_SUPPORTS_SAVE )
-GAME( 1997, madballn, madball, madball, madball, paradise_state, tgtball, ROT0, "Yun Sung", "Mad Ball V2.0 (With Nudity)", GAME_SUPPORTS_SAVE )
+GAME( 1994, paradise, 0, paradise, paradise, paradise_state, paradise, ROT90, "Yun Sung", "Paradise (set 1)", GAME_SUPPORTS_SAVE )
+GAME( 1994, paradisea, paradise, paradise, paradise, paradise_state, paradise, ROT90, "Yun Sung", "Paradise (set 2)", GAME_SUPPORTS_SAVE )
+GAME( 1994, paradisee, paradise, paradise, paradise, paradise_state, paradise, ROT90, "Yun Sung (Escape license)", "Paradise (Escape)", GAME_SUPPORTS_SAVE )
+GAME( 199?, paradlx, 0, paradise, paradise, paradise_state, paradise, ROT90, "Yun Sung", "Paradise Deluxe", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) // year not shown, but should be >=1994
+GAME( 199?, para2dx, 0, paradise, para2dx, paradise_state, paradise, ROT90, "Yun Sung", "Paradise 2 Deluxe", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) // year not shown, but should be >=1994
+GAME( 1995, tgtball, 0, tgtball, tgtball, paradise_state, tgtball, ROT0, "Yun Sung", "Target Ball (Nude)", GAME_SUPPORTS_SAVE )
+GAME( 1995, tgtballa, tgtball, tgtball, tgtball, paradise_state, tgtball, ROT0, "Yun Sung", "Target Ball", GAME_SUPPORTS_SAVE )
+GAME( 1996, penky, 0, penky, penky, paradise_state, tgtball, ROT0, "Yun Sung", "Penky", GAME_SUPPORTS_SAVE )
+GAME( 1996, torus, 0, torus, torus, paradise_state, torus, ROT90, "Yun Sung", "Torus", GAME_SUPPORTS_SAVE )
+GAME( 1998, madball, 0, madball, madball, paradise_state, tgtball, ROT0, "Yun Sung", "Mad Ball V2.0", GAME_SUPPORTS_SAVE )
+GAME( 1997, madballn, madball, madball, madball, paradise_state, tgtball, ROT0, "Yun Sung", "Mad Ball V2.0 (With Nudity)", GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/pbaction.c b/src/mame/drivers/pbaction.c
index 6c7daa53a91..5e28dda1937 100644
--- a/src/mame/drivers/pbaction.c
+++ b/src/mame/drivers/pbaction.c
@@ -84,8 +84,7 @@ WRITE8_MEMBER(pbaction_state::nmi_mask_w)
}
static ADDRESS_MAP_START( pbaction_map, AS_PROGRAM, 8, pbaction_state )
- AM_RANGE(0x0000, 0x7fff) AM_ROM
- AM_RANGE(0x8000, 0xbfff) AM_ROM
+ AM_RANGE(0x0000, 0xbfff) AM_ROM
AM_RANGE(0xc000, 0xcfff) AM_RAM AM_SHARE("work_ram")
AM_RANGE(0xd000, 0xd3ff) AM_RAM_WRITE(pbaction_videoram2_w) AM_SHARE("videoram2")
AM_RANGE(0xd400, 0xd7ff) AM_RAM_WRITE(pbaction_colorram2_w) AM_SHARE("colorram2")
@@ -102,6 +101,11 @@ static ADDRESS_MAP_START( pbaction_map, AS_PROGRAM, 8, pbaction_state )
AM_RANGE(0xe800, 0xe800) AM_WRITE(pbaction_sh_command_w)
ADDRESS_MAP_END
+static ADDRESS_MAP_START( decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 8, pbaction_state )
+ AM_RANGE(0x0000, 0x7fff) AM_ROM AM_SHARE("decrypted_opcodes")
+ AM_RANGE(0x8000, 0xbfff) AM_ROM AM_REGION("maincpu", 0x8000)
+ADDRESS_MAP_END
+
static ADDRESS_MAP_START( pbaction_sound_map, AS_PROGRAM, 8, pbaction_state )
AM_RANGE(0x0000, 0x1fff) AM_ROM
AM_RANGE(0x4000, 0x47ff) AM_RAM
@@ -312,6 +316,11 @@ static MACHINE_CONFIG_START( pbaction, pbaction_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
MACHINE_CONFIG_END
+static MACHINE_CONFIG_DERIVED( pbactionx, pbaction )
+ MCFG_CPU_MODIFY("maincpu")
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
+MACHINE_CONFIG_END
+
/***************************************************************************
@@ -377,7 +386,7 @@ ROM_START( pbaction2 )
ROM_END
ROM_START( pbaction3 )
- ROM_REGION( 2*0x10000, "maincpu", 0 )
+ ROM_REGION( 0xc000, "maincpu", 0 )
ROM_LOAD( "14.bin", 0x0000, 0x4000, CRC(f17a62eb) SHA1(8dabfc0ad127c154c0293a65df32d52d57dd9755) )
ROM_LOAD( "12.bin", 0x4000, 0x4000, CRC(ec3c64c6) SHA1(6130b80606d717f95e219316c2d3fa0a1980ea1d) )
ROM_LOAD( "13.bin", 0x8000, 0x4000, CRC(c93c851e) SHA1(b41077708fce4ccbcecdeae32af8821ca5322e87) )
@@ -403,7 +412,7 @@ ROM_START( pbaction3 )
ROM_END
ROM_START( pbaction4 )
- ROM_REGION( 2*0x10000, "maincpu", 0 )
+ ROM_REGION( 0xc000, "maincpu", 0 )
ROM_LOAD( "pinball_09.bin", 0x0000, 0x4000, CRC(c8e81ece) SHA1(04eafbd79263225f6c6fb5f04951b54179144f17) )
ROM_IGNORE(0x4000)
ROM_LOAD( "pinball_10.bin", 0x4000, 0x8000, CRC(04b56c7c) SHA1(d09c22fd0235e1c6a9b1978ba69338bb1ae5667d) )
@@ -433,7 +442,7 @@ ROM_START( pbaction4 )
ROM_END
ROM_START( pbaction5 )
- ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_REGION( 0xc000, "maincpu", 0 )
ROM_LOAD( "p16.bin", 0x0000, 0x4000, CRC(ad20b360) SHA1(91e3cdceb1c170580d926b2ed8359c3100f71b11) )
ROM_LOAD( "c15.bin", 0x4000, 0x4000, CRC(057acfe3) SHA1(49c184d7caea0c0e9f0d0e163f2ef42bb9aebf16) )
ROM_LOAD( "p14.bin", 0x8000, 0x2000, CRC(e7412d68) SHA1(e75731d9bea80e0dc09798dd46e3b947fdb54aaa) )
@@ -479,7 +488,7 @@ DRIVER_INIT_MEMBER(pbaction_state,pbactio3)
}
/* then do the standard Sega decryption */
- pbaction_decode(machine(), "maincpu");
+ DRIVER_INIT_CALL(pbactio4);
/* install a protection (?) workaround */
m_maincpu->space(AS_PROGRAM).install_read_handler(0xc000, 0xc000, read8_delegate(FUNC(pbaction_state::pbactio3_prot_kludge_r),this) );
@@ -487,14 +496,36 @@ DRIVER_INIT_MEMBER(pbaction_state,pbactio3)
DRIVER_INIT_MEMBER(pbaction_state,pbactio4)
{
+ static const UINT8 convtable[32][4] =
+ {
+ /* opcode data address */
+ /* A B C D A B C D */
+ { 0xa8,0xa0,0x88,0x80 }, { 0x28,0xa8,0x08,0x88 }, /* ...0...0...0...0 */
+ { 0x28,0x08,0xa8,0x88 }, { 0xa8,0xa0,0x88,0x80 }, /* ...0...0...0...1 */
+ { 0x28,0x20,0xa8,0xa0 }, { 0x28,0xa8,0x08,0x88 }, /* ...0...0...1...0 */
+ { 0x28,0x08,0xa8,0x88 }, { 0x28,0x20,0xa8,0xa0 }, /* ...0...0...1...1 */
+ { 0xa8,0xa0,0x88,0x80 }, { 0xa8,0xa0,0x88,0x80 }, /* ...0...1...0...0 */
+ { 0x28,0x20,0xa8,0xa0 }, { 0x28,0x20,0xa8,0xa0 }, /* ...0...1...0...1 */
+ { 0x28,0x20,0xa8,0xa0 }, { 0x28,0x20,0xa8,0xa0 }, /* ...0...1...1...0 */
+ { 0xa8,0xa0,0x88,0x80 }, { 0x28,0x20,0xa8,0xa0 }, /* ...0...1...1...1 */
+ { 0xa8,0xa0,0x88,0x80 }, { 0x28,0x20,0xa8,0xa0 }, /* ...1...0...0...0 */
+ { 0x28,0x20,0xa8,0xa0 }, { 0xa8,0xa0,0x88,0x80 }, /* ...1...0...0...1 */
+ { 0x28,0x20,0xa8,0xa0 }, { 0xa0,0x80,0xa8,0x88 }, /* ...1...0...1...0 */
+ { 0x28,0x08,0xa8,0x88 }, { 0x28,0x08,0xa8,0x88 }, /* ...1...0...1...1 */
+ { 0xa0,0x80,0xa8,0x88 }, { 0xa8,0xa0,0x88,0x80 }, /* ...1...1...0...0 */
+ { 0x28,0x20,0xa8,0xa0 }, { 0xa8,0x28,0xa0,0x20 }, /* ...1...1...0...1 */
+ { 0xa0,0x80,0xa8,0x88 }, { 0xa8,0xa0,0x88,0x80 }, /* ...1...1...1...0 */
+ { 0xa8,0xa0,0x88,0x80 }, { 0xa8,0x28,0xa0,0x20 } /* ...1...1...1...1 */
+ };
+
/* this one only has the Sega decryption */
- pbaction_decode(machine(), "maincpu");
+ sega_decode(memregion("maincpu")->base(), m_decrypted_opcodes, 0x8000, convtable);
}
-GAME( 1985, pbaction, 0, pbaction, pbaction, driver_device, 0, ROT90, "Tehkan", "Pinball Action (set 1)", GAME_SUPPORTS_SAVE )
-GAME( 1985, pbaction2, pbaction, pbaction, pbaction, driver_device, 0, ROT90, "Tehkan", "Pinball Action (set 2)", GAME_SUPPORTS_SAVE )
-GAME( 1985, pbaction3, pbaction, pbaction, pbaction, pbaction_state, pbactio3, ROT90, "Tehkan", "Pinball Action (set 3, encrypted)", GAME_SUPPORTS_SAVE )
-GAME( 1985, pbaction4, pbaction, pbaction, pbaction, pbaction_state, pbactio4, ROT90, "Tehkan", "Pinball Action (set 4, encrypted)", GAME_SUPPORTS_SAVE )
-GAME( 1985, pbaction5, pbaction, pbaction, pbaction, pbaction_state, pbactio4, ROT90, "Tehkan", "Pinball Action (set 5, encrypted)", GAME_SUPPORTS_SAVE )
+GAME( 1985, pbaction, 0, pbaction, pbaction, driver_device, 0, ROT90, "Tehkan", "Pinball Action (set 1)", GAME_SUPPORTS_SAVE )
+GAME( 1985, pbaction2, pbaction, pbaction, pbaction, driver_device, 0, ROT90, "Tehkan", "Pinball Action (set 2)", GAME_SUPPORTS_SAVE )
+GAME( 1985, pbaction3, pbaction, pbactionx, pbaction, pbaction_state, pbactio3, ROT90, "Tehkan", "Pinball Action (set 3, encrypted)", GAME_SUPPORTS_SAVE )
+GAME( 1985, pbaction4, pbaction, pbactionx, pbaction, pbaction_state, pbactio4, ROT90, "Tehkan", "Pinball Action (set 4, encrypted)", GAME_SUPPORTS_SAVE )
+GAME( 1985, pbaction5, pbaction, pbactionx, pbaction, pbaction_state, pbactio4, ROT90, "Tehkan", "Pinball Action (set 5, encrypted)", GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/pcktgal.c b/src/mame/drivers/pcktgal.c
index 4cc2fea62f5..2e0a7bf2cc9 100644
--- a/src/mame/drivers/pcktgal.c
+++ b/src/mame/drivers/pcktgal.c
@@ -18,36 +18,33 @@
#include "cpu/m6502/m6502.h"
#include "sound/2203intf.h"
#include "sound/3812intf.h"
-#include "sound/msm5205.h"
#include "includes/pcktgal.h"
#include "machine/deco222.h"
/***************************************************************************/
-WRITE8_MEMBER(pcktgal_state::pcktgal_bank_w)
+WRITE8_MEMBER(pcktgal_state::bank_w)
{
- UINT8 *RAM = memregion("maincpu")->base();
+ if (data & 1) { membank("bank1")->set_entry(0); }
+ else { membank("bank1")->set_entry(1); }
- if (data & 1) { membank("bank1")->set_base(&RAM[0x4000]); }
- else { membank("bank1")->set_base(&RAM[0x10000]); }
-
- if (data & 2) { membank("bank2")->set_base(&RAM[0x6000]); }
- else { membank("bank2")->set_base(&RAM[0x12000]); }
+ if (data & 2) { membank("bank2")->set_entry(0); }
+ else { membank("bank2")->set_entry(1); }
}
-WRITE8_MEMBER(pcktgal_state::pcktgal_sound_bank_w)
+WRITE8_MEMBER(pcktgal_state::sound_bank_w)
{
membank("bank3")->set_entry((data >> 2) & 1);
}
-WRITE8_MEMBER(pcktgal_state::pcktgal_sound_w)
+WRITE8_MEMBER(pcktgal_state::sound_w)
{
soundlatch_byte_w(space, 0, data);
m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
-WRITE_LINE_MEMBER(pcktgal_state::pcktgal_adpcm_int)
+WRITE_LINE_MEMBER(pcktgal_state::adpcm_int)
{
m_msm->data_w(m_msm5205next >> 4);
m_msm5205next <<= 4;
@@ -57,12 +54,12 @@ WRITE_LINE_MEMBER(pcktgal_state::pcktgal_adpcm_int)
m_audiocpu->set_input_line(M6502_IRQ_LINE, HOLD_LINE);
}
-WRITE8_MEMBER(pcktgal_state::pcktgal_adpcm_data_w)
+WRITE8_MEMBER(pcktgal_state::adpcm_data_w)
{
m_msm5205next = data;
}
-READ8_MEMBER(pcktgal_state::pcktgal_adpcm_reset_r)
+READ8_MEMBER(pcktgal_state::adpcm_reset_r)
{
m_msm->reset_w(0);
return 0;
@@ -78,8 +75,8 @@ static ADDRESS_MAP_START( pcktgal_map, AS_PROGRAM, 8, pcktgal_state )
AM_RANGE(0x1800, 0x1807) AM_DEVWRITE("tilegen1", deco_bac06_device, pf_control0_8bit_w)
AM_RANGE(0x1810, 0x181f) AM_DEVREADWRITE("tilegen1", deco_bac06_device, pf_control1_8bit_r, pf_control1_8bit_w)
- AM_RANGE(0x1a00, 0x1a00) AM_READ_PORT("P2") AM_WRITE(pcktgal_sound_w)
- AM_RANGE(0x1c00, 0x1c00) AM_READ_PORT("DSW") AM_WRITE(pcktgal_bank_w)
+ AM_RANGE(0x1a00, 0x1a00) AM_READ_PORT("P2") AM_WRITE(sound_w)
+ AM_RANGE(0x1c00, 0x1c00) AM_READ_PORT("DSW") AM_WRITE(bank_w)
AM_RANGE(0x4000, 0x5fff) AM_ROMBANK("bank1")
AM_RANGE(0x6000, 0x7fff) AM_ROMBANK("bank2")
AM_RANGE(0x8000, 0xffff) AM_ROM
@@ -92,10 +89,10 @@ static ADDRESS_MAP_START( pcktgal_sound_map, AS_PROGRAM, 8, pcktgal_state )
AM_RANGE(0x0000, 0x07ff) AM_RAM
AM_RANGE(0x0800, 0x0801) AM_DEVWRITE("ym1", ym2203_device, write)
AM_RANGE(0x1000, 0x1001) AM_DEVWRITE("ym2", ym3812_device, write)
- AM_RANGE(0x1800, 0x1800) AM_WRITE(pcktgal_adpcm_data_w) /* ADPCM data for the MSM5205 chip */
- AM_RANGE(0x2000, 0x2000) AM_WRITE(pcktgal_sound_bank_w)
+ AM_RANGE(0x1800, 0x1800) AM_WRITE(adpcm_data_w) /* ADPCM data for the MSM5205 chip */
+ AM_RANGE(0x2000, 0x2000) AM_WRITE(sound_bank_w)
AM_RANGE(0x3000, 0x3000) AM_READ(soundlatch_byte_r)
- AM_RANGE(0x3400, 0x3400) AM_READ(pcktgal_adpcm_reset_r) /* ? not sure */
+ AM_RANGE(0x3400, 0x3400) AM_READ(adpcm_reset_r) /* ? not sure */
AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank3")
AM_RANGE(0x8000, 0xffff) AM_ROM
ADDRESS_MAP_END
@@ -212,7 +209,12 @@ GFXDECODE_END
void pcktgal_state::machine_start()
{
+ membank("bank1")->configure_entries(0, 2, memregion("maincpu")->base() + 0x4000, 0xc000);
+ membank("bank2")->configure_entries(0, 2, memregion("maincpu")->base() + 0x6000, 0xc000);
membank("bank3")->configure_entries(0, 2, memregion("audiocpu")->base() + 0x10000, 0x4000);
+
+ save_item(NAME(m_msm5205next));
+ save_item(NAME(m_toggle));
}
static MACHINE_CONFIG_START( pcktgal, pcktgal_state )
@@ -255,7 +257,7 @@ static MACHINE_CONFIG_START( pcktgal, pcktgal_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MCFG_SOUND_ADD("msm", MSM5205, 384000)
- MCFG_MSM5205_VCLK_CB(WRITELINE(pcktgal_state, pcktgal_adpcm_int)) /* interrupt function */
+ MCFG_MSM5205_VCLK_CB(WRITELINE(pcktgal_state, adpcm_int)) /* interrupt function */
MCFG_MSM5205_PRESCALER_SELECTOR(MSM5205_S48_4B) /* 8KHz */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.70)
MACHINE_CONFIG_END
@@ -440,9 +442,9 @@ DRIVER_INIT_MEMBER(pcktgal_state,pcktgal)
/***************************************************************************/
-GAME( 1987, pcktgal, 0, pcktgal, pcktgal, pcktgal_state, pcktgal, ROT0, "Data East Corporation", "Pocket Gal (Japan)", 0 )
-GAME( 1987, pcktgalb, pcktgal, bootleg, pcktgal, driver_device, 0, ROT0, "bootleg", "Pocket Gal (bootleg)", 0 )
-GAME( 1989, pcktgal2, pcktgal, pcktgal2,pcktgal, pcktgal_state, pcktgal, ROT0, "Data East Corporation", "Pocket Gal 2 (English)", 0 )
-GAME( 1989, pcktgal2j,pcktgal, pcktgal2,pcktgal, pcktgal_state, pcktgal, ROT0, "Data East Corporation", "Pocket Gal 2 (Japanese)", 0 )
-GAME( 1989, spool3, pcktgal, pcktgal2,pcktgal, pcktgal_state, pcktgal, ROT0, "Data East Corporation", "Super Pool III (English)", 0 )
-GAME( 1990, spool3i, pcktgal, pcktgal2,pcktgal, pcktgal_state, pcktgal, ROT0, "Data East Corporation (I-Vics license)", "Super Pool III (I-Vics)", 0 )
+GAME( 1987, pcktgal, 0, pcktgal, pcktgal, pcktgal_state, pcktgal, ROT0, "Data East Corporation", "Pocket Gal (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1987, pcktgalb, pcktgal, bootleg, pcktgal, driver_device, 0, ROT0, "bootleg", "Pocket Gal (bootleg)", GAME_SUPPORTS_SAVE )
+GAME( 1989, pcktgal2, pcktgal, pcktgal2,pcktgal, pcktgal_state, pcktgal, ROT0, "Data East Corporation", "Pocket Gal 2 (English)", GAME_SUPPORTS_SAVE )
+GAME( 1989, pcktgal2j,pcktgal, pcktgal2,pcktgal, pcktgal_state, pcktgal, ROT0, "Data East Corporation", "Pocket Gal 2 (Japanese)", GAME_SUPPORTS_SAVE )
+GAME( 1989, spool3, pcktgal, pcktgal2,pcktgal, pcktgal_state, pcktgal, ROT0, "Data East Corporation", "Super Pool III (English)", GAME_SUPPORTS_SAVE )
+GAME( 1990, spool3i, pcktgal, pcktgal2,pcktgal, pcktgal_state, pcktgal, ROT0, "Data East Corporation (I-Vics license)", "Super Pool III (I-Vics)", GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/pengo.c b/src/mame/drivers/pengo.c
index 9426df6a282..ab8838127a5 100644
--- a/src/mame/drivers/pengo.c
+++ b/src/mame/drivers/pengo.c
@@ -73,12 +73,14 @@ class pengo_state : public pacman_state
{
public:
pengo_state(const machine_config &mconfig, device_type type, const char *tag)
- : pacman_state(mconfig, type, tag) { }
+ : pacman_state(mconfig, type, tag), m_decrypted_opcodes(*this, "decrypted_opcodes") { }
DECLARE_WRITE8_MEMBER(pengo_coin_counter_w);
DECLARE_WRITE8_MEMBER(irq_mask_w);
DECLARE_DRIVER_INIT(penta);
DECLARE_DRIVER_INIT(pengo);
INTERRUPT_GEN_MEMBER(vblank_irq);
+
+ optional_shared_ptr<UINT8> m_decrypted_opcodes;
};
@@ -125,7 +127,7 @@ static ADDRESS_MAP_START( pengo_map, AS_PROGRAM, 8, pengo_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0x8000, 0x83ff) AM_RAM_WRITE(pacman_videoram_w) AM_SHARE("videoram") /* video and color RAM, scratchpad RAM, sprite codes */
AM_RANGE(0x8400, 0x87ff) AM_RAM_WRITE(pacman_colorram_w) AM_SHARE("colorram")
- AM_RANGE(0x8800, 0x8fef) AM_RAM
+ AM_RANGE(0x8800, 0x8fef) AM_RAM AM_SHARE("mainram")
AM_RANGE(0x8ff0, 0x8fff) AM_RAM AM_SHARE("spriteram")
AM_RANGE(0x9000, 0x901f) AM_DEVWRITE("namco", namco_device, pacman_sound_w)
AM_RANGE(0x9020, 0x902f) AM_WRITEONLY AM_SHARE("spriteram2")
@@ -144,6 +146,13 @@ static ADDRESS_MAP_START( pengo_map, AS_PROGRAM, 8, pengo_state )
ADDRESS_MAP_END
+static ADDRESS_MAP_START( decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 8, pengo_state )
+ AM_RANGE(0x0000, 0x7fff) AM_ROM AM_SHARE("decrypted_opcodes")
+ AM_RANGE(0x8800, 0x8fef) AM_RAM AM_SHARE("mainram")
+ AM_RANGE(0x8ff0, 0x8fff) AM_RAM AM_SHARE("spriteram")
+ADDRESS_MAP_END
+
+
static ADDRESS_MAP_START( jrpacmbl_map, AS_PROGRAM, 8, pengo_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0x8000, 0x87ff) AM_RAM_WRITE(jrpacman_videoram_w) AM_SHARE("videoram")
@@ -366,6 +375,7 @@ static MACHINE_CONFIG_START( pengo, pengo_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z80, MASTER_CLOCK/6)
MCFG_CPU_PROGRAM_MAP(pengo_map)
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", pengo_state, vblank_irq)
/* video hardware */
@@ -389,14 +399,18 @@ static MACHINE_CONFIG_START( pengo, pengo_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
+static MACHINE_CONFIG_DERIVED( pengou, pengo )
-static MACHINE_CONFIG_DERIVED( jrpacmbl, pengo )
+ MCFG_CPU_MODIFY("maincpu")
+ MCFG_DEVICE_REMOVE_ADDRESS_MAP(AS_DECRYPTED_OPCODES)
+MACHINE_CONFIG_END
- /* basic machine hardware */
+static MACHINE_CONFIG_DERIVED( jrpacmbl, pengo )
/* basic machine hardware */
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(jrpacmbl_map)
+ MCFG_DEVICE_REMOVE_ADDRESS_MAP(AS_DECRYPTED_OPCODES)
MCFG_VIDEO_START_OVERRIDE(pengo_state,jrpacman)
MACHINE_CONFIG_END
@@ -631,7 +645,29 @@ ROM_END
DRIVER_INIT_MEMBER(pengo_state,pengo)
{
- pengo_decode(machine(), "maincpu");
+ static const UINT8 convtable[32][4] =
+ {
+ /* opcode data address */
+ /* A B C D A B C D */
+ { 0xa0,0x80,0xa8,0x88 }, { 0x28,0xa8,0x08,0x88 }, /* ...0...0...0...0 */
+ { 0x28,0xa8,0x08,0x88 }, { 0xa0,0x80,0xa8,0x88 }, /* ...0...0...0...1 */
+ { 0xa0,0x80,0x20,0x00 }, { 0xa0,0x80,0x20,0x00 }, /* ...0...0...1...0 */
+ { 0x08,0x28,0x88,0xa8 }, { 0xa0,0x80,0xa8,0x88 }, /* ...0...0...1...1 */
+ { 0x08,0x00,0x88,0x80 }, { 0x28,0xa8,0x08,0x88 }, /* ...0...1...0...0 */
+ { 0xa0,0x80,0x20,0x00 }, { 0x08,0x00,0x88,0x80 }, /* ...0...1...0...1 */
+ { 0xa0,0x80,0x20,0x00 }, { 0xa0,0x80,0x20,0x00 }, /* ...0...1...1...0 */
+ { 0xa0,0x80,0x20,0x00 }, { 0x00,0x08,0x20,0x28 }, /* ...0...1...1...1 */
+ { 0x88,0x80,0x08,0x00 }, { 0xa0,0x80,0x20,0x00 }, /* ...1...0...0...0 */
+ { 0x88,0x80,0x08,0x00 }, { 0x00,0x08,0x20,0x28 }, /* ...1...0...0...1 */
+ { 0x08,0x28,0x88,0xa8 }, { 0x08,0x28,0x88,0xa8 }, /* ...1...0...1...0 */
+ { 0xa0,0x80,0xa8,0x88 }, { 0xa0,0x80,0x20,0x00 }, /* ...1...0...1...1 */
+ { 0x08,0x00,0x88,0x80 }, { 0x88,0x80,0x08,0x00 }, /* ...1...1...0...0 */
+ { 0x00,0x08,0x20,0x28 }, { 0x88,0x80,0x08,0x00 }, /* ...1...1...0...1 */
+ { 0x08,0x28,0x88,0xa8 }, { 0x08,0x28,0x88,0xa8 }, /* ...1...1...1...0 */
+ { 0x08,0x00,0x88,0x80 }, { 0xa0,0x80,0x20,0x00 } /* ...1...1...1...1 */
+ };
+
+ sega_decode(memregion("maincpu")->base(), m_decrypted_opcodes, 0x8000, convtable);
}
@@ -677,14 +713,10 @@ DRIVER_INIT_MEMBER(pengo_state,penta)
{ 0x88,0x0a,0x82,0x00,0xa0,0x22,0xaa,0x28 }, /* ...1...1...0.... */
{ 0x88,0x0a,0x82,0x00,0xa0,0x22,0xaa,0x28 } /* ...1...1...1.... */
};
- address_space &space = m_maincpu->space(AS_PROGRAM);
- UINT8 *decrypt = auto_alloc_array(machine(), UINT8, 0x8000);
- UINT8 *rom = memregion("maincpu")->base();
- int A;
- space.set_decrypted_region(0x0000, 0x7fff, decrypt);
+ UINT8 *rom = memregion("maincpu")->base();
- for (A = 0x0000;A < 0x8000;A++)
+ for (int A = 0x0000;A < 0x8000;A++)
{
int i,j;
UINT8 src;
@@ -706,7 +738,7 @@ DRIVER_INIT_MEMBER(pengo_state,penta)
/* now decode the opcodes */
/* pick the translation table from bits 4, 8 and 12 of the address */
i = ((A >> 4) & 1) + (((A >> 8) & 1) << 1) + (((A >> 12) & 1) << 2);
- decrypt[A] = src ^ opcode_xortable[i][j];
+ m_decrypted_opcodes[A] = src ^ opcode_xortable[i][j];
}
}
@@ -717,11 +749,11 @@ DRIVER_INIT_MEMBER(pengo_state,penta)
*
*************************************/
-GAME( 1982, pengo, 0, pengo, pengo, pengo_state, pengo, ROT90, "Sega", "Pengo (set 1 rev c)", GAME_SUPPORTS_SAVE )
-GAME( 1982, pengo2, pengo, pengo, pengo, pengo_state, pengo, ROT90, "Sega", "Pengo (set 2)", GAME_SUPPORTS_SAVE )
-GAME( 1982, pengo2u, pengo, pengo, pengo, driver_device, 0, ROT90, "Sega", "Pengo (set 2 not encrypted)", GAME_SUPPORTS_SAVE )
-GAME( 1982, pengo3u, pengo, pengo, pengo, driver_device, 0, ROT90, "Sega", "Pengo (set 3 not encrypted)", GAME_SUPPORTS_SAVE )
-GAME( 1982, pengo4, pengo, pengo, pengo, pengo_state, pengo, ROT90, "Sega", "Pengo (set 4)", GAME_SUPPORTS_SAVE )
-GAME( 1982, pengob, pengo, pengo, pengo, pengo_state, penta, ROT90, "bootleg", "Pengo (bootleg)", GAME_SUPPORTS_SAVE )
-GAME( 1982, penta, pengo, pengo, pengo, pengo_state, penta, ROT90, "bootleg", "Penta", GAME_SUPPORTS_SAVE )
+GAME( 1982, pengo, 0, pengo, pengo, pengo_state, pengo, ROT90, "Sega", "Pengo (set 1 rev c)", GAME_SUPPORTS_SAVE )
+GAME( 1982, pengo2, pengo, pengo, pengo, pengo_state, pengo, ROT90, "Sega", "Pengo (set 2)", GAME_SUPPORTS_SAVE )
+GAME( 1982, pengo2u, pengo, pengou, pengo, driver_device, 0, ROT90, "Sega", "Pengo (set 2 not encrypted)", GAME_SUPPORTS_SAVE )
+GAME( 1982, pengo3u, pengo, pengou, pengo, driver_device, 0, ROT90, "Sega", "Pengo (set 3 not encrypted)", GAME_SUPPORTS_SAVE )
+GAME( 1982, pengo4, pengo, pengo, pengo, pengo_state, pengo, ROT90, "Sega", "Pengo (set 4)", GAME_SUPPORTS_SAVE )
+GAME( 1982, pengob, pengo, pengo, pengo, pengo_state, penta, ROT90, "bootleg", "Pengo (bootleg)", GAME_SUPPORTS_SAVE )
+GAME( 1982, penta, pengo, pengo, pengo, pengo_state, penta, ROT90, "bootleg (Grinbee Shouji)", "Penta", GAME_SUPPORTS_SAVE ) // Grinbee Shouji was a subsidiary of Orca
GAME( 1983, jrpacmbl, jrpacman, jrpacmbl, jrpacmbl, driver_device, 0, ROT90, "bootleg", "Jr. Pac-Man (Pengo hardware)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/peplus.c b/src/mame/drivers/peplus.c
index 8bb4f4a01c2..4ab389ab393 100644
--- a/src/mame/drivers/peplus.c
+++ b/src/mame/drivers/peplus.c
@@ -1446,6 +1446,7 @@ ROM_START( pepk1024 ) /* Normal (non-plus) board : Aces and Faces 4 of a Kind Bo
PayTable Js+ 2PR 3K STR FL FH 4K 4K SF RF (Bonus)
--------------------------------------------------------------
???? 1 2 3 4 5 8 25 50 50 250 800
+ % Range: 95.3-97.3% Optimum: 99.3% Hit Frequency: 45.5%
Programs Available: PK1024
*/
ROM_REGION( 0x10000, "maincpu", 0 )
@@ -1614,6 +1615,29 @@ PayTable Js+ 2PR 3K STR FL FH 4K SF RF (Bonus)
ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) ) /* BPROM type DM74LS471 (compatible with N82S135N) verified */
ROM_END
+ROM_START( pepp0021 ) /* Normal board : Standard Draw Poker (PP0021) */
+/*
+PayTable Js+ 2PR 3K STR FL FH 4K SF RF (Bonus)
+----------------------------------------------------------
+ BA 1 2 3 4 5 8 25 50 250 800
+ % Range: 93.8-95.8% Optimum: 97.8% Hit Frequency: 45.3%
+ Programs Available: PP0021
+
+NOTE: REQUIRES Progressive link which is not currently supported
+*/
+ ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD( "pp0021_723-703.u68", 0x00000, 0x10000, CRC(58f2a68b) SHA1(72c0a29016b17f7e308a9e9b2d724771b5e26560) ) /* Game Version: 723, Library Version: 703 */
+
+ ROM_REGION( 0x020000, "gfx1", 0 )
+ ROM_LOAD( "mro-cg740.u72", 0x00000, 0x8000, CRC(72667f6c) SHA1(89843f472cc0329317cfc643c63bdfd11234b194) )
+ ROM_LOAD( "mgo-cg740.u73", 0x08000, 0x8000, CRC(7437254a) SHA1(bba166dece8af58da217796f81117d0b05752b87) )
+ ROM_LOAD( "mbo-cg740.u74", 0x10000, 0x8000, CRC(92e8c33e) SHA1(05344664d6fdd3f4205c50fa4ca76fc46c18cf8f) )
+ ROM_LOAD( "mxo-cg740.u75", 0x18000, 0x8000, CRC(ce4cbe0b) SHA1(4bafcd68be94a5deaae9661584fa0fc940b834bb) )
+
+ ROM_REGION( 0x100, "proms", 0 )
+ ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) ) /* BPROM type DM74LS471 (compatible with N82S135N) verified */
+ROM_END
+
ROM_START( pepp0023 ) /* Normal board : Tens or Better (PP0023) */
/*
PayTable 10s+ 2PR 3K STR FL FH 4K SF RF (Bonus)
@@ -1678,7 +1702,28 @@ PayTable Js+ 2PR 3K STR FL FH 4K SF RF (Bonus)
ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) ) /* BPROM type DM74LS471 (compatible with N82S135N) verified */
ROM_END
-ROM_START( pepp0040a ) /* Normal board : Standard Draw Poker (PP0040) - Multi Regional / Multi Currency - Tournament Mode capable */
+ROM_START( pepp0040a ) /* Normal board : Standard Draw Poker (PP0040) */
+/*
+PayTable Js+ 2PR 3K STR FL FH 4K SF RF (Bonus)
+----------------------------------------------------------
+ WA 1 2 3 4 5 7 20 50 300 800
+ % Range: 91.0-93.0% Optimum: 95.0% Hit Frequency: 45.5%
+ Programs Available: PP0040, X000040P
+*/
+ ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD( "pp0040_979-a0c.u68", 0x00000, 0x10000, CRC(fef4fbfe) SHA1(9f07a2bee990181c9eb40e40b957aa9555ae2586) ) /* Game Version: 979, Library Version: A0C */
+
+ ROM_REGION( 0x020000, "gfx1", 0 )
+ ROM_LOAD( "mro-cg740.u72", 0x00000, 0x8000, CRC(72667f6c) SHA1(89843f472cc0329317cfc643c63bdfd11234b194) )
+ ROM_LOAD( "mgo-cg740.u73", 0x08000, 0x8000, CRC(7437254a) SHA1(bba166dece8af58da217796f81117d0b05752b87) )
+ ROM_LOAD( "mbo-cg740.u74", 0x10000, 0x8000, CRC(92e8c33e) SHA1(05344664d6fdd3f4205c50fa4ca76fc46c18cf8f) )
+ ROM_LOAD( "mxo-cg740.u75", 0x18000, 0x8000, CRC(ce4cbe0b) SHA1(4bafcd68be94a5deaae9661584fa0fc940b834bb) )
+
+ ROM_REGION( 0x100, "proms", 0 )
+ ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) ) /* BPROM type DM74LS471 (compatible with N82S135N) verified */
+ROM_END
+
+ROM_START( pepp0040b ) /* Normal board : Standard Draw Poker (PP0040) - Multi Regional / Multi Currency - Tournament Mode capable */
/*
PayTable Js+ 2PR 3K STR FL FH 4K SF RF (Bonus)
----------------------------------------------------------
@@ -1889,6 +1934,24 @@ PayTable 10s+ 2PR 3K STR FL FH 4K SF RF (Bonus)
ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) ) /* BPROM type DM74LS471 (compatible with N82S135N) verified */
ROM_END
+ROM_START( pepp0048 ) /* Normal board : Joker Poker (PP0048) */
+/*
+ Programs Available: PP0048
+*/
+ ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD( "pp0048_554-544.u68", 0x00000, 0x8000, CRC(c728af7e) SHA1(b4b56bfa34d2b4df22a8e29fae9b8e8f7d708089) ) /* Game Version: 554, Library Version: 544, Video Lib Ver: 544 */
+ ROM_RELOAD( 0x08000, 0x8000) /* 32K version built using earlier gaming libraries */
+
+ ROM_REGION( 0x020000, "gfx1", 0 )
+ ROM_LOAD( "mro-cg740.u72", 0x00000, 0x8000, CRC(72667f6c) SHA1(89843f472cc0329317cfc643c63bdfd11234b194) )
+ ROM_LOAD( "mgo-cg740.u73", 0x08000, 0x8000, CRC(7437254a) SHA1(bba166dece8af58da217796f81117d0b05752b87) )
+ ROM_LOAD( "mbo-cg740.u74", 0x10000, 0x8000, CRC(92e8c33e) SHA1(05344664d6fdd3f4205c50fa4ca76fc46c18cf8f) )
+ ROM_LOAD( "mxo-cg740.u75", 0x18000, 0x8000, CRC(ce4cbe0b) SHA1(4bafcd68be94a5deaae9661584fa0fc940b834bb) )
+
+ ROM_REGION( 0x100, "proms", 0 )
+ ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) ) /* BPROM type DM74LS471 (compatible with N82S135N) verified */
+ROM_END
+
ROM_START( pepp0051 ) /* Normal board : Joker Poker (PP0051) */
/*
w/J w/oJ
@@ -2011,7 +2074,7 @@ PayTable 3K STR FL FH 4K SF 5K RF 4D RF (Bonus)
------------------------------------------------------------
P34A 1 2 2 3 5 9 15 25 200 250 800
% Range: 96.8-98.8% Optimum: 100.8% Hit Frequency: 45.3%
- Programs Available: PP0057
+ Programs Available: PP0057, X000057P
*/
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "pp0057_a47-a76.u68", 0x00000, 0x10000, CRC(44ebb68d) SHA1(4864ba62c225a3ecd576d1a82fcbe1e30d65244d) ) /* Game Version: A47, Library Version: A76 */
@@ -2033,7 +2096,7 @@ PayTable 3K STR FL FH 4K SF 5K RF 4D RF (Bonus)
------------------------------------------------------------
P34A 1 2 2 3 5 9 15 25 200 250 800
% Range: 96.8-98.8% Optimum: 100.8% Hit Frequency: 45.3%
- Programs Available: PP0057
+ Programs Available: PP0057, X000057P
*/
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "pp0057_540-508.u68", 0x00000, 0x8000, CRC(9a8281c2) SHA1(d411294062d7896a7f68a1c4a6295e18787dc7d6) ) /* Game Version: 540, Library Version: 508, Video Lib Ver: 508 */
@@ -2247,6 +2310,51 @@ PayTable 10s+ 2PR 3K STR FL FH 4K SF RF (Bonus)
ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) ) /* BPROM type DM74LS471 (compatible with N82S135N) verified */
ROM_END
+ROM_START( pepp0085 ) /* Normal board : Joker Poker (Two Pair or Better) (PP0085) - Double Up always enabled */
+/*
+ w/J w/oJ
+PayTable 2P 3K STR FL FH 4K SF RF 5K RF (Bonus)
+-----------------------------------------------------------
+ NA 1 2 4 5 8 16 100 100 400 100 800
+ % Range: 93.2-95.2% Optimum: 97.2% Hit Frequency: 30.1%
+ Programs Available: PP0085
+*/
+ ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD( "pp0085_539-530.u68", 0x00000, 0x8000, CRC(f5325205) SHA1(737b25567633eca65ece42601ab0f3cf264fe150) ) /* Game Version: 539, Library Version: 530, Video Lib Ver: 530 */
+ ROM_RELOAD( 0x08000, 0x8000) /* 32K version built using earlier gaming libraries */
+
+ ROM_REGION( 0x020000, "gfx1", 0 )
+ ROM_LOAD( "mro-cg740.u72", 0x00000, 0x8000, CRC(72667f6c) SHA1(89843f472cc0329317cfc643c63bdfd11234b194) )
+ ROM_LOAD( "mgo-cg740.u73", 0x08000, 0x8000, CRC(7437254a) SHA1(bba166dece8af58da217796f81117d0b05752b87) )
+ ROM_LOAD( "mbo-cg740.u74", 0x10000, 0x8000, CRC(92e8c33e) SHA1(05344664d6fdd3f4205c50fa4ca76fc46c18cf8f) )
+ ROM_LOAD( "mxo-cg740.u75", 0x18000, 0x8000, CRC(ce4cbe0b) SHA1(4bafcd68be94a5deaae9661584fa0fc940b834bb) )
+
+ ROM_REGION( 0x100, "proms", 0 )
+ ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) ) /* BPROM type DM74LS471 (compatible with N82S135N) verified */
+ROM_END
+
+ROM_START( pepp0089 ) /* Normal board : Standard Draw Poker (PP0089) */
+/*
+PayTable Js+ 2PR 3K STR FL FH 4K SF RF (Bonus)
+----------------------------------------------------------
+ P11A 1 2 3 4 5 9 25 50 250 800
+ % Range: 92.1-94.1% Optimum: 96.1% Hit Frequency: 45.5%
+ Programs Available: PP0089
+*/
+ ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD( "pp0089_554-544.u68", 0x00000, 0x8000, CRC(1d3e1b84) SHA1(354cfb5c00c9a4c9779bb56ff4541e58cedd442e) ) /* Game Version: 554, Library Version: 544, Video Lib Ver: 544 */
+ ROM_RELOAD( 0x08000, 0x8000) /* 32K version built using earlier gaming libraries */
+
+ ROM_REGION( 0x020000, "gfx1", 0 )
+ ROM_LOAD( "mro-cg740.u72", 0x00000, 0x8000, CRC(72667f6c) SHA1(89843f472cc0329317cfc643c63bdfd11234b194) )
+ ROM_LOAD( "mgo-cg740.u73", 0x08000, 0x8000, CRC(7437254a) SHA1(bba166dece8af58da217796f81117d0b05752b87) )
+ ROM_LOAD( "mbo-cg740.u74", 0x10000, 0x8000, CRC(92e8c33e) SHA1(05344664d6fdd3f4205c50fa4ca76fc46c18cf8f) )
+ ROM_LOAD( "mxo-cg740.u75", 0x18000, 0x8000, CRC(ce4cbe0b) SHA1(4bafcd68be94a5deaae9661584fa0fc940b834bb) )
+
+ ROM_REGION( 0x100, "proms", 0 )
+ ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) ) /* BPROM type DM74LS471 (compatible with N82S135N) verified */
+ROM_END
+
ROM_START( pepp0103 ) /* Normal board : Deuces Wild Poker 1-100 Coin (PP0103) */
/*
w/D w/oD
@@ -2419,7 +2527,7 @@ ROM_START( pepp0127 ) /* Normal board : Deuces Joker Wild Poker (PP0127) */
Wild JKR Wild JKR
PayTable 3K STR FL FH 4K SF 5K RF 4D RF 4D (Bonus)
---------------------------------------------------------------------
- P65N 1 2 3 3 3 6 9 12 25 800 1000 2000
+ P65N 1 2 3 3 3 6 9 12 25 250 1000 2000
% Range: 95.1-97.1% Optimum: 99.1% Hit Frequency: 50.4%
Programs Available: PP0127
*/
@@ -2442,7 +2550,7 @@ ROM_START( pepp0127a ) /* Normal board : Deuces Joker Wild Poker (PP0127) - Mult
Wild JKR Wild JKR
PayTable 3K STR FL FH 4K SF 5K RF 4D RF 4D (Bonus)
---------------------------------------------------------------------
- P65N 1 2 3 3 3 6 9 12 25 800 1000 2000
+ P65N 1 2 3 3 3 6 9 12 25 250 1000 2000
% Range: 95.1-97.1% Optimum: 99.1% Hit Frequency: 50.4%
Programs Available: PP0127
*/
@@ -2459,6 +2567,71 @@ PayTable 3K STR FL FH 4K SF 5K RF 4D RF 4D (Bonus)
ROM_LOAD( "cap1215.u50", 0x0000, 0x0100, CRC(294b7b10) SHA1(a405a4b8547b713c5c02dacb19e7354095a7b584) )
ROM_END
+ROM_START( pepp0130 ) /* Normal board : Aces & Faces (PP0130) */
+/*
+
+ 2-10 J-K
+PayTable Js+ 2PR 3K STR FL FH 4K 4K 4A SF RF (Bonus)
+------------------------------------------------------------------
+ ???? 1 2 3 4 5 8 25 40 80 50 250 800
+ % Range: 95.3-97.3% Optimum: 99.3% Hit Frequency: 45.5%
+ Programs Available: PP0130
+*/
+ ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD( "pp0130_a4y-a6g.u68", 0x00000, 0x10000, CRC(bf9293f2) SHA1(79f5247a2d5447c89e281c618b09c7f7790176a2) ) /* Game Version: A4Y, Library Version: A6G */
+
+ ROM_REGION( 0x020000, "gfx1", 0 )
+ ROM_LOAD( "mro-cg954.u72", 0x00000, 0x8000, CRC(1f9cd61e) SHA1(92a2ca3765ad4eeb7ab96538d4278e0a99d16638) )
+ ROM_LOAD( "mgo-cg954.u73", 0x08000, 0x8000, CRC(ac1dd15d) SHA1(41ddbb05edc3d274a27d4938c29e6a1e7c785cd7) )
+ ROM_LOAD( "mbo-cg954.u74", 0x10000, 0x8000, CRC(cfcb5740) SHA1(8a94536f3b4315c1e6a16a8e5043a80205a3aabe) )
+ ROM_LOAD( "mxo-cg954.u75", 0x18000, 0x8000, CRC(94f63723) SHA1(f53867cc1c07235ff2aba1854459085dd0643c89) )
+
+ ROM_REGION( 0x100, "proms", 0 )
+ ROM_LOAD( "cap953.u50", 0x0000, 0x0100, CRC(6ece50ad) SHA1(bc5761303b09625850ba50263607d11871ea3ed3) )
+ROM_END
+
+ROM_START( pepp0132 ) /* Normal board : Standard Draw Poker (PP0132) */
+/*
+PayTable Js+ 2PR 3K STR FL FH 4K SF RF (Bonus)
+---------------------------------------------------------
+ CA 1 2 3 4 6 9 25 50 250 800
+ % Range: 95.5-97.5% Optimum: 99.5% Hit Frequency: 45.5%
+ Programs Available: PP0132, PP0447, X000447P
+*/
+ ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD( "pp0132_896-914.u68", 0x00000, 0x10000, CRC(ad888692) SHA1(cbc78c546b8f4dc136cc376a0b7aed10faacbac6) ) /* Game Version: 896, Library Version: 914 */
+
+ ROM_REGION( 0x020000, "gfx1", 0 )
+ ROM_LOAD( "mro-cg740.u72", 0x00000, 0x8000, CRC(72667f6c) SHA1(89843f472cc0329317cfc643c63bdfd11234b194) )
+ ROM_LOAD( "mgo-cg740.u73", 0x08000, 0x8000, CRC(7437254a) SHA1(bba166dece8af58da217796f81117d0b05752b87) )
+ ROM_LOAD( "mbo-cg740.u74", 0x10000, 0x8000, CRC(92e8c33e) SHA1(05344664d6fdd3f4205c50fa4ca76fc46c18cf8f) )
+ ROM_LOAD( "mxo-cg740.u75", 0x18000, 0x8000, CRC(ce4cbe0b) SHA1(4bafcd68be94a5deaae9661584fa0fc940b834bb) )
+
+ ROM_REGION( 0x100, "proms", 0 )
+ ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) ) /* BPROM type DM74LS471 (compatible with N82S135N) verified */
+ROM_END
+
+ROM_START( pepp0150 ) /* Normal board : Standard Draw Poker (PP0150) */
+/*
+PayTable Js+ 2PR 3K STR FL FH 4K SF RF (Bonus)
+----------------------------------------------------------
+ KK 1 2 3 4 6 9 25 50 500 500
+ % Range: 94.9-96.9% Optimum: 98.9% Hit Frequency: 45.5%
+ Programs Available: PP0150, X000150P
+*/
+ ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD( "pp0150_a45-a74.u68", 0x00000, 0x10000, CRC(8848dc4b) SHA1(121e885d253aa3c2a72de9e14d64e20d794e53bf) ) /* Game Version: A45, Library Version: A74 */
+
+ ROM_REGION( 0x020000, "gfx1", 0 )
+ ROM_LOAD( "mro-cg740.u72", 0x00000, 0x8000, CRC(72667f6c) SHA1(89843f472cc0329317cfc643c63bdfd11234b194) )
+ ROM_LOAD( "mgo-cg740.u73", 0x08000, 0x8000, CRC(7437254a) SHA1(bba166dece8af58da217796f81117d0b05752b87) )
+ ROM_LOAD( "mbo-cg740.u74", 0x10000, 0x8000, CRC(92e8c33e) SHA1(05344664d6fdd3f4205c50fa4ca76fc46c18cf8f) )
+ ROM_LOAD( "mxo-cg740.u75", 0x18000, 0x8000, CRC(ce4cbe0b) SHA1(4bafcd68be94a5deaae9661584fa0fc940b834bb) )
+
+ ROM_REGION( 0x100, "proms", 0 )
+ ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) ) /* BPROM type DM74LS471 (compatible with N82S135N) verified */
+ROM_END
+
ROM_START( pepp0158 ) /* Normal board : 4 of a Kind Bonus Poker (PP0158) - 03/17/97 @ IGT L97-0628 */
/*
5-K 2-4
@@ -2662,6 +2835,28 @@ PayTable Js+ 2PR 3K STR FL FH 4K 4K* SF RF (Bonus)
ROM_LOAD( "cap953.u50", 0x0000, 0x0100, CRC(6ece50ad) SHA1(bc5761303b09625850ba50263607d11871ea3ed3) )
ROM_END
+ROM_START( pepp0181 ) /* Normal board : Standard Draw Poker (PP0181) */
+/*
+PayTable Js+ 2PR 3K STR FL FH 4K SF RF (Bonus)
+----------------------------------------------------------
+ BA 1 2 3 4 5 8 25 50 250 800
+ % Range: 93.8-95.8% Optimum: 97.8% Hit Frequency: 45.3%
+ Programs Available: PP0181
+*/
+ ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD( "pp0181_648-667.u68", 0x00000, 0x10000, CRC(b38ff1e1) SHA1(ae8d725a3352000c57cef4b7e7a39dbad940e9de) ) /* Game Version: 648, Library Version: 667 */
+
+ ROM_REGION( 0x020000, "gfx1", 0 )
+ ROM_LOAD( "mro-cg740.u72", 0x00000, 0x8000, CRC(72667f6c) SHA1(89843f472cc0329317cfc643c63bdfd11234b194) )
+ ROM_LOAD( "mgo-cg740.u73", 0x08000, 0x8000, CRC(7437254a) SHA1(bba166dece8af58da217796f81117d0b05752b87) )
+ ROM_LOAD( "mbo-cg740.u74", 0x10000, 0x8000, CRC(92e8c33e) SHA1(05344664d6fdd3f4205c50fa4ca76fc46c18cf8f) )
+ ROM_LOAD( "mxo-cg740.u75", 0x18000, 0x8000, CRC(ce4cbe0b) SHA1(4bafcd68be94a5deaae9661584fa0fc940b834bb) )
+
+
+ ROM_REGION( 0x100, "proms", 0 )
+ ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) ) /* BPROM type DM74LS471 (compatible with N82S135N) verified */
+ROM_END
+
ROM_START( pepp0188 ) /* Normal board : Standard Draw Poker (PP0188) */
/*
PayTable Js+ 2PR 3K STR FL FH 4K SF RF (Bonus)
@@ -2794,7 +2989,29 @@ PayTable Js+ 2PR 3K STR FL FH 4K SF RF (Bonus)
ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) ) /* BPROM type DM74LS471 (compatible with N82S135N) verified */
ROM_END
-ROM_START( pepp0197a ) /* Normal board : Standard Draw Poker (PP0197) */
+ROM_START( pepp0197a ) /* Normal board : Standard Draw Poker (PP0197) - 07/29/96 @ IGT L96-1219 */
+/*
+PayTable Js+ 2PR 3K STR FL FH 4K SF RF (Bonus)
+----------------------------------------------------------
+ BA 1 2 3 4 5 8 25 50 250 800
+ % Range: 93.8-95.8% Optimum: 97.8% Hit Frequency: 45.3%
+ Programs Available: PP0197, X000197P & PP0419 - Non Double-up Only
+*/
+ ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD( "pp0197_a14-a2n.u68", 0x00000, 0x10000, CRC(ef472672) SHA1(785ce02b13894e5cb7575e75533451b96e3f4e6d) ) /* Game Version: A14, Library Version: A2N */
+
+ ROM_REGION( 0x020000, "gfx1", 0 )
+ ROM_LOAD( "mro-cg740.u72", 0x00000, 0x8000, CRC(72667f6c) SHA1(89843f472cc0329317cfc643c63bdfd11234b194) )
+ ROM_LOAD( "mgo-cg740.u73", 0x08000, 0x8000, CRC(7437254a) SHA1(bba166dece8af58da217796f81117d0b05752b87) )
+ ROM_LOAD( "mbo-cg740.u74", 0x10000, 0x8000, CRC(92e8c33e) SHA1(05344664d6fdd3f4205c50fa4ca76fc46c18cf8f) )
+ ROM_LOAD( "mxo-cg740.u75", 0x18000, 0x8000, CRC(ce4cbe0b) SHA1(4bafcd68be94a5deaae9661584fa0fc940b834bb) )
+
+
+ ROM_REGION( 0x100, "proms", 0 )
+ ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) ) /* BPROM type DM74LS471 (compatible with N82S135N) verified */
+ROM_END
+
+ROM_START( pepp0197b ) /* Normal board : Standard Draw Poker (PP0197) */
/*
PayTable Js+ 2PR 3K STR FL FH 4K SF RF (Bonus)
----------------------------------------------------------
@@ -2803,7 +3020,7 @@ PayTable Js+ 2PR 3K STR FL FH 4K SF RF (Bonus)
Programs Available: PP0197, X000197P & PP0419 - Non Double-up Only
*/
ROM_REGION( 0x10000, "maincpu", 0 )
- ROM_LOAD( "pp0197_919-a0c.u68", 0x00000, 0x10000, CRC(ae817534) SHA1(b2454609e8275aab00797966c0f4e68eae2911cd) ) /* Game Version: 919, Library Version: A0C */
+ ROM_LOAD( "pp0197_979-a0c.u68", 0x00000, 0x10000, CRC(ae817534) SHA1(b2454609e8275aab00797966c0f4e68eae2911cd) ) /* Game Version: 979, Library Version: A0C */
ROM_REGION( 0x020000, "gfx1", 0 )
ROM_LOAD( "mro-cg740.u72", 0x00000, 0x8000, CRC(72667f6c) SHA1(89843f472cc0329317cfc643c63bdfd11234b194) )
@@ -2816,7 +3033,7 @@ PayTable Js+ 2PR 3K STR FL FH 4K SF RF (Bonus)
ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) ) /* BPROM type DM74LS471 (compatible with N82S135N) verified */
ROM_END
-ROM_START( pepp0197b ) /* Normal board : Standard Draw Poker (Auto Hold in options) (PP0197) */
+ROM_START( pepp0197c ) /* Normal board : Standard Draw Poker (Auto Hold in options) (PP0197) */
/*
PayTable Js+ 2PR 3K STR FL FH 4K SF RF (Bonus)
----------------------------------------------------------
@@ -3016,6 +3233,31 @@ PayTable Js+ 2PR 3K STR FL FH 4K SF RF (Bonus)
ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) ) /* BPROM type DM74LS471 (compatible with N82S135N) verified */
ROM_END
+ROM_START( pepp0223 ) /* Normal board : Deuces Joker Wild Poker (PP0223) */
+/*
+ With w/o w/o With
+ Wild JKR Wild JKR
+PayTable 3K STR FL FH 4K SF 5K RF 4D RF 4D (Bonus)
+---------------------------------------------------------------------
+ P76N 1 1 3 3 3 6 9 12 25 250 1000 2000
+ % Range: 89.6-91.6% Optimum: 93.6% Hit Frequency: 50.3%
+ Programs Available: PP0223
+
+Internally the program erroneously reports a 92.80% return. Superseded by PP0812
+*/
+ ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD( "pp0223_984-a0r.u68", 0x00000, 0x10000, CRC(7254255a) SHA1(345d5d567bcd2af9b374a3345a10f9999c34b2b5) ) /* Game Version: 984, Library Version: A0R */
+
+ ROM_REGION( 0x020000, "gfx1", 0 )
+ ROM_LOAD( "mro-cg1215.u72", 0x00000, 0x8000, CRC(425f57be) SHA1(6d53ae86bec7189a35671a7f691e101a2ed4d8c4) ) /* 06/09/93 @ IGT L93-1585 */
+ ROM_LOAD( "mgo-cg1215.u73", 0x08000, 0x8000, CRC(0f66cd94) SHA1(9ac0cd01aca87e045c4fd6045ed907a092d6b2ee) )
+ ROM_LOAD( "mbo-cg1215.u74", 0x10000, 0x8000, CRC(10f89e44) SHA1(cdc34970b0325a24cfd5c187a4b4dbf42be8fc93) )
+ ROM_LOAD( "mxo-cg1215.u75", 0x18000, 0x8000, CRC(73c24e43) SHA1(f09beaf374ad371db2701767ce6ac5bdb13c445a) )
+
+ ROM_REGION( 0x100, "proms", 0 )
+ ROM_LOAD( "cap1215.u50", 0x0000, 0x0100, CRC(294b7b10) SHA1(a405a4b8547b713c5c02dacb19e7354095a7b584) )
+ROM_END
+
ROM_START( pepp0224 ) /* Normal board : Deuces Wild Poker (No Double-up) (PP0224) */
/*
w/D w/oD
@@ -3133,13 +3375,40 @@ ROM_START( pepp0250 ) /* Normal board : Double Down Stud Poker (PP0250) */
/*
PayTable 6s-10s Js+ 2PR 3K STR FL FH 4K SF RF (Bonus)
------------------------------------------------------------------
- ???? 1 2 3 4 6 6 12 50 200 1000 4000
+ ???? 1 2 3 4 6 9 12 50 200 1000 4000
+ % Range: 94.3-96.3% Optimum: 98.3% Hit Frequency: ??.?%
+ Programs Available: PP0250
+
+NOTE: Newer version with DBV support and requires newer CG2015 instead of CG1019
+*/
+ ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD( "pp0250_a1l-a23.u68", 0x00000, 0x10000, CRC(ae4f1fb8) SHA1(473d1acb8549f86b9da17f9fbbceafc3a3efc6fe) ) /* Game Version: A1L, Library Version: A23 */
+
+ ROM_REGION( 0x020000, "gfx1", 0 )
+ ROM_LOAD( "mro-cg2015.u72", 0x00000, 0x8000, CRC(7f73ee5c) SHA1(b6c5d423c8176555c1f32605c328ffbfcf94b656) ) /* Verified CG set for this version of PP0250 */
+ ROM_LOAD( "mgo-cg2015.u73", 0x08000, 0x8000, CRC(de270e0e) SHA1(41b207f9380f623ab64dc42224275cccd43417ee) )
+ ROM_LOAD( "mbo-cg2015.u74", 0x10000, 0x8000, CRC(02e623d9) SHA1(4c689293f5c5a8eb0b17861cf433ae1e01d83545) )
+ ROM_LOAD( "mxo-cg2015.u75", 0x18000, 0x8000, CRC(0c96b7fc) SHA1(adde93f08db0b957daf77d57a7ab60af3b667f25) )
+
+ ROM_REGION( 0x100, "proms", 0 )
+ ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) ) /* BPROM type DM74LS471 (compatible with N82S135N) verified */
+ROM_END
+
+ROM_START( pepp0250a ) /* Normal board : Double Down Stud Poker (PP0250) */
+/*
+PayTable 6s-10s Js+ 2PR 3K STR FL FH 4K SF RF (Bonus)
+------------------------------------------------------------------
+ ???? 1 2 3 4 6 9 12 50 200 1000 4000
+ % Range: 94.3-96.3% Optimum: 98.3% Hit Frequency: ??.?%
+ Programs Available: PP0250
+
+NOTE: No DBV option and requires CG1019
*/
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "pp0250_733-778.u68", 0x00000, 0x10000, CRC(4c919598) SHA1(fe73503c6ccb3c5746fb96be58cd5b740c819713) ) /* Game Version: 733, Library Version: 778 */
ROM_REGION( 0x020000, "gfx1", 0 )
- ROM_LOAD( "mro-cg1019.u72", 0x00000, 0x8000, CRC(9086dc3c) SHA1(639baef8a9b347015d21817d69265700ff205774) ) /* Verified CG set for PP0250 set */
+ ROM_LOAD( "mro-cg1019.u72", 0x00000, 0x8000, CRC(9086dc3c) SHA1(639baef8a9b347015d21817d69265700ff205774) ) /* Verified CG set for this version of PP0250 */
ROM_LOAD( "mgo-cg1019.u73", 0x08000, 0x8000, CRC(fb538a19) SHA1(1ed480ebdf3ad210511e7e0a0dd4e28466219ae9) ) /* Superseded by CG2015 which also works */
ROM_LOAD( "mbo-cg1019.u74", 0x10000, 0x8000, CRC(493bf604) SHA1(9cbce26ed328e6878ec5f6531ea140e1c17e6753) )
ROM_LOAD( "mxo-cg1019.u75", 0x18000, 0x8000, CRC(064a5c80) SHA1(4d21a7a424258f74d4a1e78c123288799e316228) )
@@ -3303,6 +3572,50 @@ PayTable 3K STR FL FH 4K SF 5K RF 4D RF (Bonus)
ROM_LOAD( "cap1215.u50", 0x0000, 0x0100, CRC(294b7b10) SHA1(a405a4b8547b713c5c02dacb19e7354095a7b584) )
ROM_END
+ROM_START( pepp0291a ) /* Normal board : Deuces Wild Poker (No Double-up) (PP0291) */
+/*
+ w/D w/oD
+PayTable 3K STR FL FH 4K SF 5K RF 4D RF (Bonus)
+------------------------------------------------------------
+ P62A 1 2 3 4 4 9 15 25 200 250 800
+ % Range: 94.9-96.9% Optimum: 98.9% Hit Frequency: 44.4%
+ Programs Available: PP0125, PP0418, X000291P & PP0291 - Non Double-up Only
+*/
+ ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD( "pp0291_961-984.u68", 0x00000, 0x10000, CRC(64c83e70) SHA1(1c75c7c37a359d07b170ab644ebb98d4bce2affe) ) /* Game Version: 961, Library Version: 984 */
+
+ ROM_REGION( 0x020000, "gfx1", 0 )
+ ROM_LOAD( "mro-cg1215.u72", 0x00000, 0x8000, CRC(425f57be) SHA1(6d53ae86bec7189a35671a7f691e101a2ed4d8c4) ) /* 06/09/93 @ IGT L93-1585 */
+ ROM_LOAD( "mgo-cg1215.u73", 0x08000, 0x8000, CRC(0f66cd94) SHA1(9ac0cd01aca87e045c4fd6045ed907a092d6b2ee) )
+ ROM_LOAD( "mbo-cg1215.u74", 0x10000, 0x8000, CRC(10f89e44) SHA1(cdc34970b0325a24cfd5c187a4b4dbf42be8fc93) )
+ ROM_LOAD( "mxo-cg1215.u75", 0x18000, 0x8000, CRC(73c24e43) SHA1(f09beaf374ad371db2701767ce6ac5bdb13c445a) )
+
+ ROM_REGION( 0x100, "proms", 0 )
+ ROM_LOAD( "cap1215.u50", 0x0000, 0x0100, CRC(294b7b10) SHA1(a405a4b8547b713c5c02dacb19e7354095a7b584) )
+ROM_END
+
+ROM_START( pepp0401 ) /* Normal board : 4 of a Kind Bonus Poker (No Double-up) (PP0401) */
+/*
+ 5-K 2-4
+PayTable Js+ 2PR 3K STR FL FH 4K 4K 4A SF RF (Bonus)
+------------------------------------------------------------------
+ P90A 1 2 3 4 5 8 25 40 80 50 250 800
+ % Range: 94.0-96.0% Optimum: 98.0% Hit Frequency: 45.5%
+ Programs Available: PP0401
+*/
+ ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD( "pp0401_789-812.u68", 0x00000, 0x10000, CRC(caad4496) SHA1(cecb469d318f25a3ad49eb0014b57f61e54183c6) ) /* Game Version: 789, Library Version: 812 */
+
+ ROM_REGION( 0x020000, "gfx1", 0 )
+ ROM_LOAD( "mro-cg2003.u72", 0x00000, 0x8000, CRC(0d425f48) SHA1(b60aaf3f4bd76f75f72f6e8dda724bdf795cb521) ) /* 08/30/94 @ IGT L95-0145 */
+ ROM_LOAD( "mgo-cg2003.u73", 0x08000, 0x8000, CRC(add0afc4) SHA1(0519bf2f36cb67140933b2c533e625544f27d16b) )
+ ROM_LOAD( "mbo-cg2003.u74", 0x10000, 0x8000, CRC(8649dec0) SHA1(0024d3a8fd85279552910b14b69b225bda93957f) )
+ ROM_LOAD( "mxo-cg2003.u75", 0x18000, 0x8000, CRC(904631cd) SHA1(d280a2f16b51a04b3f601db3535980a765c60e6f) )
+
+ ROM_REGION( 0x100, "proms", 0 )
+ ROM_LOAD( "cap904.u50", 0x0000, 0x0100, CRC(0eec8336) SHA1(a6585c978dbc2f4f3818e3a5b92f8c28be23c4c0) ) /* BPROM type N82S135N verified */
+ROM_END
+
ROM_START( pepp0409 ) /* Normal board : 4 of a Kind Bonus Poker (No Double-up) (PP0409) */
/*
5-K 2-4
@@ -3335,6 +3648,28 @@ PayTable Js+ 2PR 3K STR FL FH 4K 4K 4A SF RF (Bonus)
Programs Available: PP0265, X000265P, PP0403 & PP0410 - Non Double-up Only
*/
ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD( "pp0410_a46-a75.u68", 0x00000, 0x10000, CRC(41e904ae) SHA1(b63a47c91b9f76f11bd14ccb16dbb4ac86fe7926) ) /* Game Version: A46, Library Version: A75, Game Lib ver: A0Y */
+
+ ROM_REGION( 0x020000, "gfx1", 0 )
+ ROM_LOAD( "mro-cg2003.u72", 0x00000, 0x8000, CRC(0d425f48) SHA1(b60aaf3f4bd76f75f72f6e8dda724bdf795cb521) ) /* 08/30/94 @ IGT L95-0145 */
+ ROM_LOAD( "mgo-cg2003.u73", 0x08000, 0x8000, CRC(add0afc4) SHA1(0519bf2f36cb67140933b2c533e625544f27d16b) )
+ ROM_LOAD( "mbo-cg2003.u74", 0x10000, 0x8000, CRC(8649dec0) SHA1(0024d3a8fd85279552910b14b69b225bda93957f) )
+ ROM_LOAD( "mxo-cg2003.u75", 0x18000, 0x8000, CRC(904631cd) SHA1(d280a2f16b51a04b3f601db3535980a765c60e6f) )
+
+ ROM_REGION( 0x100, "proms", 0 )
+ ROM_LOAD( "cap904.u50", 0x0000, 0x0100, CRC(0eec8336) SHA1(a6585c978dbc2f4f3818e3a5b92f8c28be23c4c0) ) /* BPROM type N82S135N verified */
+ROM_END
+
+ROM_START( pepp0410a ) /* Normal board : 4 of a Kind Bonus Poker (No Double-up) (PP0410) */
+/*
+ 5-K 2-4
+PayTable Js+ 2PR 3K STR FL FH 4K 4K 4A SF RF (Bonus)
+------------------------------------------------------------------
+ P101A 1 2 3 4 5 6 25 40 80 50 250 800
+ % Range: 92.5-94.5% Optimum: 96.9% Hit Frequency: 45.5%
+ Programs Available: PP0265, X000265P, PP0403 & PP0410 - Non Double-up Only
+*/
+ ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "pp0410_a0n-a23.u68", 0x00000, 0x10000, CRC(474f4809) SHA1(8d88647ab4719fdcf6ec0800386f32574b1da66d) ) /* Game Version: A0N, Library Version: A23, Game Lib ver: A0Y */
ROM_REGION( 0x020000, "gfx1", 0 )
@@ -3442,6 +3777,48 @@ PayTable Js+ 2PR 3K STR FL FH 4K SF RF (Bonus)
Programs Available: PP0423
*/
ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD( "pp0423_a45-a74.u68", 0x00000, 0x10000, CRC(b717bb0f) SHA1(89243bec0dc5b2c3907ef6579dfc3fdd28977971) ) /* Game Version: A45, Library Version: A74 */
+
+ ROM_REGION( 0x020000, "gfx1", 0 )
+ ROM_LOAD( "mro-cg740.u72", 0x00000, 0x8000, CRC(72667f6c) SHA1(89843f472cc0329317cfc643c63bdfd11234b194) )
+ ROM_LOAD( "mgo-cg740.u73", 0x08000, 0x8000, CRC(7437254a) SHA1(bba166dece8af58da217796f81117d0b05752b87) )
+ ROM_LOAD( "mbo-cg740.u74", 0x10000, 0x8000, CRC(92e8c33e) SHA1(05344664d6fdd3f4205c50fa4ca76fc46c18cf8f) )
+ ROM_LOAD( "mxo-cg740.u75", 0x18000, 0x8000, CRC(ce4cbe0b) SHA1(4bafcd68be94a5deaae9661584fa0fc940b834bb) )
+
+ ROM_REGION( 0x100, "proms", 0 )
+ ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) ) /* BPROM type DM74LS471 (compatible with N82S135N) verified */
+ROM_END
+
+ROM_START( pepp0423a ) /* Normal board : Standard Draw Poker (No Double-up) (PP0423) */
+/*
+PayTable Js+ 2PR 3K STR FL FH 4K SF RF (Bonus)
+----------------------------------------------------------
+ P11A 1 2 3 4 5 9 25 50 250 800
+ % Range: 92.1-94.1% Optimum: 96.1% Hit Frequency: 45.5%
+ Programs Available: PP0423
+*/
+ ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD( "pp0423_896-914.u68", 0x00000, 0x10000, CRC(c996c539) SHA1(3874c294f4d223596ab537634aaf52bc0494ff85) ) /* Game Version: 896, Library Version: 914 */
+
+ ROM_REGION( 0x020000, "gfx1", 0 )
+ ROM_LOAD( "mro-cg740.u72", 0x00000, 0x8000, CRC(72667f6c) SHA1(89843f472cc0329317cfc643c63bdfd11234b194) )
+ ROM_LOAD( "mgo-cg740.u73", 0x08000, 0x8000, CRC(7437254a) SHA1(bba166dece8af58da217796f81117d0b05752b87) )
+ ROM_LOAD( "mbo-cg740.u74", 0x10000, 0x8000, CRC(92e8c33e) SHA1(05344664d6fdd3f4205c50fa4ca76fc46c18cf8f) )
+ ROM_LOAD( "mxo-cg740.u75", 0x18000, 0x8000, CRC(ce4cbe0b) SHA1(4bafcd68be94a5deaae9661584fa0fc940b834bb) )
+
+ ROM_REGION( 0x100, "proms", 0 )
+ ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) ) /* BPROM type DM74LS471 (compatible with N82S135N) verified */
+ROM_END
+
+ROM_START( pepp0423b ) /* Normal board : Standard Draw Poker (No Double-up) (PP0423) */
+/*
+PayTable Js+ 2PR 3K STR FL FH 4K SF RF (Bonus)
+----------------------------------------------------------
+ P11A 1 2 3 4 5 9 25 50 250 800
+ % Range: 92.1-94.1% Optimum: 96.1% Hit Frequency: 45.5%
+ Programs Available: PP0423
+*/
+ ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "pp0423_836-847.u68", 0x00000, 0x10000, CRC(12eec557) SHA1(3721d068223262260ad22698e7dca0440becc53e) ) /* Game Version: 836, Library Version: 847 */
ROM_REGION( 0x020000, "gfx1", 0 )
@@ -3592,7 +3969,7 @@ PayTable Js+ 2PR 3K STR FL FH 4K SF RF (Bonus)
---------------------------------------------------------
CA 1 2 3 4 6 9 25 50 250 800
% Range: 95.5-97.5% Optimum: 99.5% Hit Frequency: 45.5%
- Programs Available: PP0447, X000447P
+ Programs Available: PP0132, PP0447, X000447P
*/
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "pp0447_a45-a74.u68", 0x00000, 0x10000, CRC(0ef0bb6c) SHA1(d0ef7a83417054f05d32d0a93ed0d5d618f4dfb9) ) /* Game Version: A45, Library Version: A74 */
@@ -3757,6 +4134,26 @@ PayTable As 2P 3K STR FL FH 4K SF RF 5K RF (Bonus)
ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) ) /* BPROM type DM74LS471 (compatible with N82S135N) verified */
ROM_END
+ROM_START( pepp0467 ) /* Normal board : Uknown Bonus Poker (PP0467) */
+/*
+PayTable Js+ 2P 3K STR FL FH 4K ?? SF RF (Bonus)
+-----------------------------------------------------------
+ ???? 1 2 3 4 5 8 25 25 50 250 800
+ Programs Available: PP0467
+*/
+ ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD( "pp0467_823-851.u68", 0x00000, 0x10000, CRC(b19d48ae) SHA1(8a27a791e6f132d70d1ea02860e11fedb8515989) ) /* Game Version: 823, Library Version: 851 */
+
+ ROM_REGION( 0x020000, "gfx1", 0 )
+ ROM_LOAD( "mro-cg2004.u72", 0x00000, 0x8000, CRC(e5e40ea5) SHA1(e0d9e50b30cc0c25c932b2bf444990df1fb2c38c) ) /* 08/31/94 @ IGT L95-0146 */
+ ROM_LOAD( "mgo-cg2004.u73", 0x08000, 0x8000, CRC(12607f1e) SHA1(248e1ecee4e735f5943c50f8c350ca95b81509a7) )
+ ROM_LOAD( "mbo-cg2004.u74", 0x10000, 0x8000, CRC(78c3fb9f) SHA1(2b9847c511888de507a008dec981778ca4dbcd6c) ) /* Supersedes CG740 */
+ ROM_LOAD( "mxo-cg2004.u75", 0x18000, 0x8000, CRC(5aaa4480) SHA1(353c4ce566c944406fce21f2c5045c856ef7a609) )
+
+ ROM_REGION( 0x100, "proms", 0 )
+ ROM_LOAD( "cap740.u50", 0x0000, 0x0100, CRC(6fe619c4) SHA1(49e43dafd010ce0fe9b2a63b96a4ddedcb933c6d) ) /* BPROM type DM74LS471 (compatible with N82S135N) verified */
+ROM_END
+
ROM_START( pepp0488 ) /* Normal board : Standard Draw Poker (PP0488) - 01/12/95 @ IGT L95-0175 */
/*
PayTable Js+ TP 3K STR FL FH 4K SF RF (Bonus)
@@ -4173,6 +4570,28 @@ PayTable As 2PR 3K STR FL FH 4K SF RF 5K RF (Bonus)
ROM_LOAD( "cap904.u50", 0x0000, 0x0100, CRC(0eec8336) SHA1(a6585c978dbc2f4f3818e3a5b92f8c28be23c4c0) ) /* BPROM type N82S135N verified */
ROM_END
+ROM_START( pepp0550 ) /* Normal board : Joker Poker (Two Pair or Better) (PP0550) */
+/*
+ w/J w/oJ
+PayTable 2P 3K STR FL FH 4K SF RF 5K RF (Bonus)
+-----------------------------------------------------------
+ NA 1 2 4 5 8 16 100 100 400 100 800
+ % Range: 93.2-95.2% Optimum: 97.2% Hit Frequency: 30.1%
+ Programs Available: PP0550, X000550P
+*/
+ ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD( "pp0585_a6k-a9g.u68", 0x00000, 0x10000, CRC(1de4ee32) SHA1(0e06a43e7e3988cc2fddd1a57af724f5421d2ca4) ) /* Game Version: A6K, Library Version: A9G */
+
+ ROM_REGION( 0x020000, "gfx1", 0 )
+ ROM_LOAD( "mro-cg2004.u72", 0x00000, 0x8000, CRC(e5e40ea5) SHA1(e0d9e50b30cc0c25c932b2bf444990df1fb2c38c) ) /* 08/31/94 @ IGT L95-0146 */
+ ROM_LOAD( "mgo-cg2004.u73", 0x08000, 0x8000, CRC(12607f1e) SHA1(248e1ecee4e735f5943c50f8c350ca95b81509a7) )
+ ROM_LOAD( "mbo-cg2004.u74", 0x10000, 0x8000, CRC(78c3fb9f) SHA1(2b9847c511888de507a008dec981778ca4dbcd6c) ) /* Supersedes CG740 */
+ ROM_LOAD( "mxo-cg2004.u75", 0x18000, 0x8000, CRC(5aaa4480) SHA1(353c4ce566c944406fce21f2c5045c856ef7a609) )
+
+ ROM_REGION( 0x100, "proms", 0 )
+ ROM_LOAD( "cap904.u50", 0x0000, 0x0100, CRC(0eec8336) SHA1(a6585c978dbc2f4f3818e3a5b92f8c28be23c4c0) ) /* BPROM type N82S135N verified */
+ROM_END
+
ROM_START( pepp0568 ) /* Normal board : Joker Poker (PP0568) */
/*
w/J w/oJ
@@ -4326,11 +4745,56 @@ P437A/4K/5 1 1 3 4 5 6 50 80 160 50 250 800
ROM_LOAD( "cap904.u50", 0x0000, 0x0100, CRC(0eec8336) SHA1(a6585c978dbc2f4f3818e3a5b92f8c28be23c4c0) ) /* BPROM type N82S135N verified */
ROM_END
+ROM_START( pepp0750 ) /* Normal board : Standard Draw Poker (PP0750) */
+/*
+PayTable Js+ 2PR 3K STR FL FH 4K SF RF (Bonus)
+----------------------------------------------------------
+ KQ 1 2 3 4 6 9 25 50 500 625
+ % Range: 95.1-97.1% Optimum: 99.1% Hit Frequency: 45.5%
+ Programs Available: PP0750
+*/
+ ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD( "pp0750_979-a0c.u68", 0x00000, 0x10000, CRC(2224c865) SHA1(6080c29d69c847603b79b7b15f65b32e36d305d8) ) /* Game Version: 979, Library Version: A0C */
+
+ ROM_REGION( 0x020000, "gfx1", 0 )
+ ROM_LOAD( "mro-cg2004.u72", 0x00000, 0x8000, CRC(e5e40ea5) SHA1(e0d9e50b30cc0c25c932b2bf444990df1fb2c38c) ) /* 08/31/94 @ IGT L95-0146 */
+ ROM_LOAD( "mgo-cg2004.u73", 0x08000, 0x8000, CRC(12607f1e) SHA1(248e1ecee4e735f5943c50f8c350ca95b81509a7) )
+ ROM_LOAD( "mbo-cg2004.u74", 0x10000, 0x8000, CRC(78c3fb9f) SHA1(2b9847c511888de507a008dec981778ca4dbcd6c) ) /* Supersedes CG740 */
+ ROM_LOAD( "mxo-cg2004.u75", 0x18000, 0x8000, CRC(5aaa4480) SHA1(353c4ce566c944406fce21f2c5045c856ef7a609) )
+
+ ROM_REGION( 0x100, "proms", 0 )
+ ROM_LOAD( "cap904.u50", 0x0000, 0x0100, CRC(0eec8336) SHA1(a6585c978dbc2f4f3818e3a5b92f8c28be23c4c0) ) /* BPROM type N82S135N verified */
+ROM_END
+
+ROM_START( pepp0757 ) /* Normal board : Double Down Stud Joker Poker (Eights or Better) (PP0757) */
+/*
+ w/J w/oJ
+PayTable 8s+ 2P 3K STR FL FH 4K SF RF 5K RF (Bonus)
+----------------------------------------------------------------
+ ???? 1 2 3 6 9 15 60 100 400 1000 1000 2000
+ % Range: 90.3-92.3% Optimum: 94.3% Hit Frequency: ??.?%
+ Programs Available: PP0757
+*/
+ ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD( "pp0757_a5v-a6d.u68", 0x00000, 0x10000, CRC(dcf3004f) SHA1(c095a874a8813f7100ec430e034530eeb93c4117) ) /* Game Version: A5V, Library Version: A6D */
+
+ ROM_REGION( 0x020000, "gfx1", 0 )
+ ROM_LOAD( "mro-cg2015.u72", 0x00000, 0x8000, CRC(7f73ee5c) SHA1(b6c5d423c8176555c1f32605c328ffbfcf94b656) ) /* Verified CG set for PP0760 set */
+ ROM_LOAD( "mgo-cg2015.u73", 0x08000, 0x8000, CRC(de270e0e) SHA1(41b207f9380f623ab64dc42224275cccd43417ee) )
+ ROM_LOAD( "mbo-cg2015.u74", 0x10000, 0x8000, CRC(02e623d9) SHA1(4c689293f5c5a8eb0b17861cf433ae1e01d83545) )
+ ROM_LOAD( "mxo-cg2015.u75", 0x18000, 0x8000, CRC(0c96b7fc) SHA1(adde93f08db0b957daf77d57a7ab60af3b667f25) )
+
+ ROM_REGION( 0x100, "proms", 0 )
+ ROM_LOAD( "cap904.u50", 0x0000, 0x0100, CRC(0eec8336) SHA1(a6585c978dbc2f4f3818e3a5b92f8c28be23c4c0) ) /* BPROM type N82S135N verified */
+ROM_END
+
ROM_START( pepp0760 ) /* Normal board : Double Down Stud Poker (PP0760) */
/*
PayTable 8s-10s Js+ 2PR 3K STR FL FH 4K SF RF (Bonus)
------------------------------------------------------------------
???? 1 2 3 4 6 9 12 50 200 1000 4000
+ % Range: 86.8-88.8% Optimum: 90.8% Hit Frequency: ??.?%
+ Programs Available: PP0760
*/
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "pp0760_a4v-a6d.u68", 0x00000, 0x10000, CRC(1c26076c) SHA1(612ac66bbb0827b81dc9c6bc23fa7558445481bc) ) /* Game Version: A4V, Library Version: A6D */
@@ -4367,6 +4831,28 @@ PayTable Js+ 2PR 3K STR FL FH 4K 4K 4A SF RF (Bonus)
ROM_LOAD( "cap904.u50", 0x0000, 0x0100, CRC(0eec8336) SHA1(a6585c978dbc2f4f3818e3a5b92f8c28be23c4c0) ) /* BPROM type N82S135N verified */
ROM_END
+ROM_START( pepp0764 ) /* Normal board : 4 of a Kind Bonus Poker (PP0764) */
+/*
+ 5-K 2-4
+PayTable Js+ 2PR 3K STR FL FH 4K 4K 4A SF RF (Bonus)
+------------------------------------------------------------------
+ P596A 1 1 3 6 8 10 25 40 80 50 250 800
+ % Range: 91.8-93.8% Optimum: 95.8% Hit Frequency: 42.3%
+ Programs Available: PP0764, X000764P
+*/
+ ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD( "pp0764_a46-a75.u68", 0x00000, 0x10000, CRC(9176732a) SHA1(4a9898334aa76c483757addb3a28ace71b008c7e) ) /* Game Version: A46, Library Version: A75, Game Lib ver: A0Y */
+
+ ROM_REGION( 0x020000, "gfx1", 0 )
+ ROM_LOAD( "mro-cg2003.u72", 0x00000, 0x8000, CRC(0d425f48) SHA1(b60aaf3f4bd76f75f72f6e8dda724bdf795cb521) ) /* 08/30/94 @ IGT L95-0145 */
+ ROM_LOAD( "mgo-cg2003.u73", 0x08000, 0x8000, CRC(add0afc4) SHA1(0519bf2f36cb67140933b2c533e625544f27d16b) )
+ ROM_LOAD( "mbo-cg2003.u74", 0x10000, 0x8000, CRC(8649dec0) SHA1(0024d3a8fd85279552910b14b69b225bda93957f) )
+ ROM_LOAD( "mxo-cg2003.u75", 0x18000, 0x8000, CRC(904631cd) SHA1(d280a2f16b51a04b3f601db3535980a765c60e6f) )
+
+ ROM_REGION( 0x100, "proms", 0 )
+ ROM_LOAD( "cap904.u50", 0x0000, 0x0100, CRC(0eec8336) SHA1(a6585c978dbc2f4f3818e3a5b92f8c28be23c4c0) ) /* BPROM type N82S135N verified */
+ROM_END
+
ROM_START( pepp0775 ) /* Normal board : Royal Deuces Poker or Royal Sevens Poker?? (PP0775) */
/*
Paytable for Royal Deuces lined up with paytable from PP0775:
@@ -4395,6 +4881,29 @@ PayTable 3K STR FL FH 4K SF 5K RF 4D RF (Bonus)
ROM_LOAD( "capx2312.u43", 0x0000, 0x0200, CRC(66971da6) SHA1(6984a68bc2f01009ad6a7a0705c00e715c29bb65) )
ROM_END
+ROM_START( pepp0812 ) /* Normal board : Deuces Joker Wild Poker (PP0812) */
+/*
+ With w/o w/o With
+ Wild JKR Wild JKR
+PayTable 3K STR FL FH 4K SF 5K RF 4D RF 4D (Bonus)
+---------------------------------------------------------------------
+ P76N 1 1 3 3 3 6 9 12 25 250 1000 2000
+ % Range: 89.6-91.6% Optimum: 93.6% Hit Frequency: 50.3%
+ Programs Available: PP0812
+*/
+ ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD( "pp0812_a47-a76.u68", 0x00000, 0x10000, CRC(0de2a7ec) SHA1(fedb8da0608328a9d33e46af18de25004b1d03de) ) /* Game Version: A47, Library Version: A76 */
+
+ ROM_REGION( 0x020000, "gfx1", 0 )
+ ROM_LOAD( "mro-cg1215.u72", 0x00000, 0x8000, CRC(425f57be) SHA1(6d53ae86bec7189a35671a7f691e101a2ed4d8c4) ) /* 06/09/93 @ IGT L93-1585 */
+ ROM_LOAD( "mgo-cg1215.u73", 0x08000, 0x8000, CRC(0f66cd94) SHA1(9ac0cd01aca87e045c4fd6045ed907a092d6b2ee) )
+ ROM_LOAD( "mbo-cg1215.u74", 0x10000, 0x8000, CRC(10f89e44) SHA1(cdc34970b0325a24cfd5c187a4b4dbf42be8fc93) )
+ ROM_LOAD( "mxo-cg1215.u75", 0x18000, 0x8000, CRC(73c24e43) SHA1(f09beaf374ad371db2701767ce6ac5bdb13c445a) )
+
+ ROM_REGION( 0x100, "proms", 0 )
+ ROM_LOAD( "cap1215.u50", 0x0000, 0x0100, CRC(294b7b10) SHA1(a405a4b8547b713c5c02dacb19e7354095a7b584) )
+ROM_END
+
ROM_START( pepp0816 ) /* Normal board : Treasure Chest Poker (PP0816) */
/*
PayTable Js+ 2PR 3K STR FL FH 4K* SF RF (Bonus)
@@ -6081,6 +6590,31 @@ PayTable 3K STR FL FH 4K SF 5K RF 4D RF (Bonus)
ROM_LOAD( "capx1321.u43", 0x0000, 0x0200, CRC(4b57569f) SHA1(fa29c0f627e7ce79951ec6dadec114864144f37d) )
ROM_END
+ROM_START( pex0057p ) /* Superboard : Deuces Wild Poker (X000057P+XP000038) */
+/*
+ w/D w/oD
+PayTable 3K STR FL FH 4K SF 5K RF 4D RF (Bonus)
+------------------------------------------------------------
+ P34A 1 2 2 3 5 9 15 25 200 250 800
+ % Range: 96.8-98.8% Optimum: 100.8% Hit Frequency: 45.3%
+ Programs Available: PP0057, X000057P
+*/
+ ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD( "xp000038.u67", 0x00000, 0x10000, CRC(8707ab9e) SHA1(3e00a2ad8017e1495c6d6fe900d0efa68a1772b8) ) /* 09/05/95 @ IGT L95-2452 */
+
+ ROM_REGION( 0x10000, "user1", 0 )
+ ROM_LOAD( "x000057p.u66", 0x00000, 0x10000, CRC(2046710a) SHA1(3fcc7c3069ea54d0e4982814aca1d7b327bb2074) ) /* Deuces Wild Poker - 05/04/95 @ IGT L95-1143 */
+
+ ROM_REGION( 0x020000, "gfx1", 0 )
+ ROM_LOAD( "mro-cg2185.u77", 0x00000, 0x8000, CRC(7e64bd1a) SHA1(e988a380ee58078bf5bdc7747e83aed1393cfad8) ) /* 07/10/95 @ IGT L95-1506 */
+ ROM_LOAD( "mgo-cg2185.u78", 0x08000, 0x8000, CRC(d4127893) SHA1(75039c45ba6fd171a66876c91abc3191c7feddfc) )
+ ROM_LOAD( "mbo-cg2185.u79", 0x10000, 0x8000, CRC(17dba955) SHA1(5f77379c88839b3a04e235e4fb0120c77e17b60e) )
+ ROM_LOAD( "mxo-cg2185.u80", 0x18000, 0x8000, CRC(583eb3b1) SHA1(4a2952424969917fb1594698a779fe5a1e99bff5) )
+
+ ROM_REGION( 0x200, "proms", 0 )
+ ROM_LOAD( "capx1321.u43", 0x0000, 0x0200, CRC(4b57569f) SHA1(fa29c0f627e7ce79951ec6dadec114864144f37d) )
+ROM_END
+
ROM_START( pex0060p ) /* Superboard : Standard Draw Poker (X000060P+XP000038) */
/*
PayTable Js+ 2PR 3K STR FL FH 4K SF RF (Bonus)
@@ -6715,10 +7249,36 @@ PayTable Ks+ 2P 3K STR FL FH 4K SF RF 5K RF (Bonus)
ROM_LOAD( "x000459p.u66", 0x00000, 0x10000, CRC(03cef341) SHA1(3813c4781ca6d164880f6d06a7d6dbae29012e7d) ) /* Joker Poker */
ROM_REGION( 0x020000, "gfx1", 0 )
- ROM_LOAD( "mro-cg2296.u77", 0x00000, 0x8000, CRC(d0d92665) SHA1(2c686ee28b69ff975951ccafd8e5030fde640773) ) /* Slovenia + XP000155 */
- ROM_LOAD( "mgo-cg2296.u78", 0x08000, 0x8000, CRC(d05fd16e) SHA1(f66b5ba8b4cf4f97ed46ec44cef43fed29bdd492) )
- ROM_LOAD( "mbo-cg2296.u79", 0x10000, 0x8000, CRC(6db6a435) SHA1(7ea0d6df1f7e0c4fe389437bf04d1f5a798c68ef) )
- ROM_LOAD( "mxo-cg2296.u80", 0x18000, 0x8000, CRC(4faeb79e) SHA1(f69277b729ba88860efc6b9a3d4956f245cc2943) )
+ ROM_LOAD( "mro-cg2324.u77", 0x00000, 0x8000, CRC(6eceef42) SHA1(a2ddd2a3290c41e510f483c6b633fe0002694d0b) )
+ ROM_LOAD( "mgo-cg2324.u78", 0x08000, 0x8000, CRC(26d0acbe) SHA1(09a9127deb88185cd5b748bac657461eadb2f48f) )
+ ROM_LOAD( "mbo-cg2324.u79", 0x10000, 0x8000, CRC(47baee32) SHA1(d8af09022ccb5fc06aa3aa4c200a734b66cbee00) )
+ ROM_LOAD( "mxo-cg2324.u80", 0x18000, 0x8000, CRC(60449fc0) SHA1(251d1e04786b70c1d2bc7b02f3b69cd58ac76398) )
+
+ ROM_REGION( 0x200, "proms", 0 )
+ ROM_LOAD( "capx1321.u43", 0x0000, 0x0200, CRC(4b57569f) SHA1(fa29c0f627e7ce79951ec6dadec114864144f37d) )
+ROM_END
+
+ROM_START( pex0489p ) /* Superboard : Double Down Stud Deuces Wild Poker (X000489P+XP000038) */
+/*
+
+ w/D w/oD
+PayTable Ks+ 2P 3K STR FL FH 4K SF 5K RF 4D RF (Bonus)
+-----------------------------------------------------------------------
+ ???? 1 1 2 3 4 5 6 12 15 100 400 1000 2000
+ % Range: 91.3-93.3% Optimum: 95.3% Hit Frequency: 45.3%
+ Programs Available: PP0489, X000489P
+*/
+ ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD( "xp000038.u67", 0x00000, 0x10000, CRC(8707ab9e) SHA1(3e00a2ad8017e1495c6d6fe900d0efa68a1772b8) ) /* Errors with INCOMPATIBLE EPROM error, no dumped program works with this DATA set */
+
+ ROM_REGION( 0x10000, "user1", 0 )
+ ROM_LOAD( "x000489p.u66", 0x00000, 0x10000, CRC(73d21c66) SHA1(0f863037a34549f4255dedda70b4401d288eee01) ) /* Double Down Stud Deuces Wild Poker */
+
+ ROM_REGION( 0x020000, "gfx1", 0 )
+ ROM_LOAD( "mro-cg2185.u77", 0x00000, 0x8000, CRC(7e64bd1a) SHA1(e988a380ee58078bf5bdc7747e83aed1393cfad8) ) /* 07/10/95 @ IGT L95-1506 */
+ ROM_LOAD( "mgo-cg2185.u78", 0x08000, 0x8000, CRC(d4127893) SHA1(75039c45ba6fd171a66876c91abc3191c7feddfc) )
+ ROM_LOAD( "mbo-cg2185.u79", 0x10000, 0x8000, CRC(17dba955) SHA1(5f77379c88839b3a04e235e4fb0120c77e17b60e) )
+ ROM_LOAD( "mxo-cg2185.u80", 0x18000, 0x8000, CRC(583eb3b1) SHA1(4a2952424969917fb1594698a779fe5a1e99bff5) )
ROM_REGION( 0x200, "proms", 0 )
ROM_LOAD( "capx1321.u43", 0x0000, 0x0200, CRC(4b57569f) SHA1(fa29c0f627e7ce79951ec6dadec114864144f37d) )
@@ -6749,7 +7309,7 @@ PayTable 3K STR FL FH 4K SF 5K RF 4D RF (Bonus)
ROM_LOAD( "capx1321.u43", 0x0000, 0x0200, CRC(4b57569f) SHA1(fa29c0f627e7ce79951ec6dadec114864144f37d) )
ROM_END
-ROM_START( pex0514p ) /* Superboard : Double Double Bonus Poker (X000514P+XP000038) */
+ROM_START( pex0514p ) /* Superboard : Double Bonus Poker (X000514P+XP000038) */
/*
5-K 2-4
PayTable Js+ 2PR 3K STR FL FH 4K 4K 4A SF RF (Bonus)
@@ -6774,7 +7334,7 @@ PayTable Js+ 2PR 3K STR FL FH 4K 4K 4A SF RF (Bonus)
ROM_LOAD( "capx1321.u43", 0x0000, 0x0200, CRC(4b57569f) SHA1(fa29c0f627e7ce79951ec6dadec114864144f37d) )
ROM_END
-ROM_START( pex0515p ) /* Superboard : Double Double Bonus Poker (X000515P+XP000038) */
+ROM_START( pex0515p ) /* Superboard : Double Bonus Poker (X000515P+XP000038) */
/*
5-K 2-4
PayTable Js+ 2PR 3K STR FL FH 4K 4K 4A SF RF (Bonus)
@@ -6799,12 +7359,12 @@ PayTable Js+ 2PR 3K STR FL FH 4K 4K 4A SF RF (Bonus)
ROM_LOAD( "capx1321.u43", 0x0000, 0x0200, CRC(4b57569f) SHA1(fa29c0f627e7ce79951ec6dadec114864144f37d) )
ROM_END
-ROM_START( pex0516p ) /* Superboard : Double Double Bonus Poker (X000516P+XP000038) */
+ROM_START( pex0516p ) /* Superboard : Double Bonus Poker (X000516P+XP000038) */
/*
5-K 2-4
PayTable Js+ 2PR 3K STR FL FH 4K 4K 4A SF RF (Bonus)
-----------------------------------------------------------------
- P325A 1 2 3 4 5 8 50 80 160 50 250 800
+ P325A 1 2 3 4 5 9 50 80 160 50 250 800
% Range: 93.8-95.8% Optimum: 97.8% Hit Frequency: 44.5%
Programs Available: PP0516, X000516P & PP0540 - Non Double-up Only
*/
@@ -6883,7 +7443,7 @@ PayTable 2P 3K STR FL FH 4K SF RF 5K RF (Bonus)
-----------------------------------------------------------
NA 1 2 4 5 8 16 100 100 400 100 800
% Range: 93.2-95.2% Optimum: 97.2% Hit Frequency: 30.1%
- Programs Available: X000550P
+ Programs Available: PP0550, X000550P
Internally the program erroneously reports a 95.50% return. Superseded by X002338P
@@ -6904,6 +7464,30 @@ Internally the program erroneously reports a 95.50% return. Superseded by X00233
ROM_LOAD( "capx1321.u43", 0x0000, 0x0200, CRC(4b57569f) SHA1(fa29c0f627e7ce79951ec6dadec114864144f37d) )
ROM_END
+ROM_START( pex0557p ) /* Superboard : Standard Draw Poker (X000557P+XP000038) */
+/*
+PayTable Js+ 2PR 3K STR FL FH 4K SF RF (Bonus)
+----------------------------------------------------------
+ WA 1 2 3 4 5 7 20 50 300 800
+ % Range: 91.0-93.0% Optimum: 95.0% Hit Frequency: 45.5%
+ Programs Available: X000557P
+*/
+ ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD( "xp000038.u67", 0x00000, 0x10000, CRC(8707ab9e) SHA1(3e00a2ad8017e1495c6d6fe900d0efa68a1772b8) ) /* 09/05/95 @ IGT L95-2452 */
+
+ ROM_REGION( 0x10000, "user1", 0 )
+ ROM_LOAD( "x000557p.u66", 0x00000, 0x10000, CRC(98c16858) SHA1(d428ae712b7ee45ce6e4f7d9b1c75687655be140) ) /* Standard Draw Poker */
+
+ ROM_REGION( 0x020000, "gfx1", 0 )
+ ROM_LOAD( "mro-cg2185.u77", 0x00000, 0x8000, CRC(7e64bd1a) SHA1(e988a380ee58078bf5bdc7747e83aed1393cfad8) ) /* 07/10/95 @ IGT L95-1506 */
+ ROM_LOAD( "mgo-cg2185.u78", 0x08000, 0x8000, CRC(d4127893) SHA1(75039c45ba6fd171a66876c91abc3191c7feddfc) )
+ ROM_LOAD( "mbo-cg2185.u79", 0x10000, 0x8000, CRC(17dba955) SHA1(5f77379c88839b3a04e235e4fb0120c77e17b60e) )
+ ROM_LOAD( "mxo-cg2185.u80", 0x18000, 0x8000, CRC(583eb3b1) SHA1(4a2952424969917fb1594698a779fe5a1e99bff5) )
+
+ ROM_REGION( 0x200, "proms", 0 )
+ ROM_LOAD( "capx1321.u43", 0x0000, 0x0200, CRC(4b57569f) SHA1(fa29c0f627e7ce79951ec6dadec114864144f37d) )
+ROM_END
+
ROM_START( pex0568p ) /* Superboard : Joker Poker (X000568P+XP000038) */
/*
w/J w/oJ
@@ -6929,6 +7513,30 @@ PayTable Ks+ 2P 3K STR FL FH 4K SF RF 5K RF (Bonus)
ROM_LOAD( "capx1321.u43", 0x0000, 0x0200, CRC(4b57569f) SHA1(fa29c0f627e7ce79951ec6dadec114864144f37d) )
ROM_END
+ROM_START( pex0578p ) /* Superboard : Standard Draw Poker (X000578P+XP000038) */
+/*
+PayTable Js+ 2PR 3K STR FL FH 4K SF RF (Bonus)
+----------------------------------------------------------
+ BA 1 2 3 4 5 8 25 50 250 800
+ % Range: 93.8-95.8% Optimum: 97.8% Hit Frequency: 45.3%
+ Programs Available: X000578P
+*/
+ ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD( "xp000038.u67", 0x00000, 0x10000, CRC(8707ab9e) SHA1(3e00a2ad8017e1495c6d6fe900d0efa68a1772b8) ) /* 09/05/95 @ IGT L95-2452 */
+
+ ROM_REGION( 0x10000, "user1", 0 )
+ ROM_LOAD( "x000578p.u66", 0x00000, 0x10000, CRC(08f34909) SHA1(b6f2f5b0aab289bb51cb67c85f0db0411321a2ae) ) /* Standard Draw Poker */
+
+ ROM_REGION( 0x020000, "gfx1", 0 )
+ ROM_LOAD( "mro-cg2185.u77", 0x00000, 0x8000, CRC(7e64bd1a) SHA1(e988a380ee58078bf5bdc7747e83aed1393cfad8) ) /* 07/10/95 @ IGT L95-1506 */
+ ROM_LOAD( "mgo-cg2185.u78", 0x08000, 0x8000, CRC(d4127893) SHA1(75039c45ba6fd171a66876c91abc3191c7feddfc) )
+ ROM_LOAD( "mbo-cg2185.u79", 0x10000, 0x8000, CRC(17dba955) SHA1(5f77379c88839b3a04e235e4fb0120c77e17b60e) )
+ ROM_LOAD( "mxo-cg2185.u80", 0x18000, 0x8000, CRC(583eb3b1) SHA1(4a2952424969917fb1594698a779fe5a1e99bff5) )
+
+ ROM_REGION( 0x200, "proms", 0 )
+ ROM_LOAD( "capx1321.u43", 0x0000, 0x0200, CRC(4b57569f) SHA1(fa29c0f627e7ce79951ec6dadec114864144f37d) )
+ROM_END
+
ROM_START( pex0581p ) /* Superboard : 4 of a Kind Bonus Poker (X000581P+XP000038) */
/*
5-K 2-4
@@ -7204,6 +7812,61 @@ PayTable Js+ 2PR 3K STR FL FH 4K 4K 4A SF RF (Bonus)
ROM_LOAD( "capx1321.u43", 0x0000, 0x0200, CRC(4b57569f) SHA1(fa29c0f627e7ce79951ec6dadec114864144f37d) )
ROM_END
+ROM_START( pex2021p ) /* Superboard : Lucky Deal Poker (X002021P+XP000112) */
+/*
+ 5-K 2-4
+PayTable Js+ 2PR 3K STR FL FH 4K 4K 4A SF RF (Bonus)
+-----------------------------------------------------------------
+ P566AL 1 1 3 5 7 10 25 40 80 50 250 800
+ % Range: 94.2-98.2% Optimum: 98.2% Hit Frequency: 43.0%
+ Programs Available: X002021P
+
+Straights or Better on the initial deal PAY DOUBLE!
+
+*/
+ ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD( "xp000112.u67", 0x00000, 0x10000, CRC(c1ae96ad) SHA1(da109602f0fbe9b225cdcd60be0613fd41014864) )
+
+ ROM_REGION( 0x10000, "user1", 0 )
+ ROM_LOAD( "x002021p.u66", 0x00000, 0x10000, CRC(bf7f6f41) SHA1(c04fcab15da546929f8e15037f33cd99da4ae286) ) /* Lucky Deal Poker */
+
+ ROM_REGION( 0x020000, "gfx1", 0 )
+ ROM_LOAD( "mro-cg2324.u77", 0x00000, 0x8000, CRC(6eceef42) SHA1(a2ddd2a3290c41e510f483c6b633fe0002694d0b) )
+ ROM_LOAD( "mgo-cg2324.u78", 0x08000, 0x8000, CRC(26d0acbe) SHA1(09a9127deb88185cd5b748bac657461eadb2f48f) )
+ ROM_LOAD( "mbo-cg2324.u79", 0x10000, 0x8000, CRC(47baee32) SHA1(d8af09022ccb5fc06aa3aa4c200a734b66cbee00) )
+ ROM_LOAD( "mxo-cg2324.u80", 0x18000, 0x8000, CRC(60449fc0) SHA1(251d1e04786b70c1d2bc7b02f3b69cd58ac76398) )
+
+ ROM_REGION( 0x200, "proms", 0 )
+ ROM_LOAD( "capx1321.u43", 0x0000, 0x0200, CRC(4b57569f) SHA1(fa29c0f627e7ce79951ec6dadec114864144f37d) )
+ROM_END
+
+ROM_START( pex2024p ) /* Superboard : Double Bonus Poker (X002024P+XP000038) */
+/*
+ 5-K 2-4
+PayTable Js+ 2PR 3K STR FL FH 4K 4K 4A SF RF (Bonus)
+-----------------------------------------------------------------
+ P325A 1 2 3 4 5 9 50 80 160 50 250 800
+ % Range: 93.8-95.8% Optimum: 97.8% Hit Frequency: 44.5%
+ Programs Available: X002024P
+
+NOTE: Same as X000516P, except MAX Coin (set to 5) CANNOT be changed
+*/
+ ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD( "xp000038.u67", 0x00000, 0x10000, CRC(8707ab9e) SHA1(3e00a2ad8017e1495c6d6fe900d0efa68a1772b8) ) /* 09/05/95 @ IGT L95-2452 */
+
+ ROM_REGION( 0x10000, "user1", 0 )
+ ROM_LOAD( "x002024p.u66", 0x00000, 0x10000, CRC(8f9ab38c) SHA1(703f1f5c5ca1ab7032019e41da6ffac6fc47929a) ) /* Double Bonus Poker */
+
+ ROM_REGION( 0x020000, "gfx1", 0 )
+ ROM_LOAD( "mro-cg2185.u77", 0x00000, 0x8000, CRC(7e64bd1a) SHA1(e988a380ee58078bf5bdc7747e83aed1393cfad8) ) /* 07/10/95 @ IGT L95-1506 */
+ ROM_LOAD( "mgo-cg2185.u78", 0x08000, 0x8000, CRC(d4127893) SHA1(75039c45ba6fd171a66876c91abc3191c7feddfc) )
+ ROM_LOAD( "mbo-cg2185.u79", 0x10000, 0x8000, CRC(17dba955) SHA1(5f77379c88839b3a04e235e4fb0120c77e17b60e) )
+ ROM_LOAD( "mxo-cg2185.u80", 0x18000, 0x8000, CRC(583eb3b1) SHA1(4a2952424969917fb1594698a779fe5a1e99bff5) )
+
+ ROM_REGION( 0x200, "proms", 0 )
+ ROM_LOAD( "capx1321.u43", 0x0000, 0x0200, CRC(4b57569f) SHA1(fa29c0f627e7ce79951ec6dadec114864144f37d) )
+ROM_END
+
ROM_START( pex2025p ) /* Superboard : Deuces Wild Bonus Poker (X002025P+XP000019) */
/*
w/D 6-K 3-5 w/A w/oD
@@ -8461,6 +9124,31 @@ PayTable Js+ 2PR 3K STR FL FH 4K 4K 4A A,2-4 2-4 SF RF (Bonus)
ROM_LOAD( "capx1321.u43", 0x0000, 0x0200, CRC(4b57569f) SHA1(fa29c0f627e7ce79951ec6dadec114864144f37d) )
ROM_END
+ROM_START( pex2312p ) /* Superboard : Triple Bonus Poker Plus (X002312P+XP000112) */
+/*
+ 5-K 2-4
+PayTable Js+ 2PR 3K STR FL FH 4K 4K 4A SF RF (Bonus)
+-----------------------------------------------------------------
+ P919BA 1 1 3 4 5 8 50 120 240 100 250 800
+ % Range: 94.7-96.7% Optimum: 98.7% Hit Frequency: 44.7%
+ Programs Available: X002312P
+*/
+ ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD( "xp000112.u67", 0x00000, 0x10000, CRC(c1ae96ad) SHA1(da109602f0fbe9b225cdcd60be0613fd41014864) )
+
+ ROM_REGION( 0x10000, "user1", 0 )
+ ROM_LOAD( "x002312p.u66", 0x00000, 0x10000, CRC(d3b405b5) SHA1(321ce89a12c7d4849379731f45482c567c25b3a1) ) /* Triple Bonus Poker Plus */
+
+ ROM_REGION( 0x020000, "gfx1", 0 )
+ ROM_LOAD( "mro-cg2324.u77", 0x00000, 0x8000, CRC(6eceef42) SHA1(a2ddd2a3290c41e510f483c6b633fe0002694d0b) )
+ ROM_LOAD( "mgo-cg2324.u78", 0x08000, 0x8000, CRC(26d0acbe) SHA1(09a9127deb88185cd5b748bac657461eadb2f48f) )
+ ROM_LOAD( "mbo-cg2324.u79", 0x10000, 0x8000, CRC(47baee32) SHA1(d8af09022ccb5fc06aa3aa4c200a734b66cbee00) )
+ ROM_LOAD( "mxo-cg2324.u80", 0x18000, 0x8000, CRC(60449fc0) SHA1(251d1e04786b70c1d2bc7b02f3b69cd58ac76398) )
+
+ ROM_REGION( 0x200, "proms", 0 )
+ ROM_LOAD( "capx1321.u43", 0x0000, 0x0200, CRC(4b57569f) SHA1(fa29c0f627e7ce79951ec6dadec114864144f37d) )
+ROM_END
+
ROM_START( pex2314p ) /* Superboard : Triple Bonus Poker Plus (X002314P+XP000112) */
/*
5-K 2-4
@@ -8561,6 +9249,30 @@ PayTable Js+ 2PR 3K STR FL FH 4K 4K 4A SF RF (Bonus)
ROM_LOAD( "capx1321.u43", 0x0000, 0x0200, CRC(4b57569f) SHA1(fa29c0f627e7ce79951ec6dadec114864144f37d) )
ROM_END
+ROM_START( pex2412p ) /* Superboard : Standard Draw with 5 decks - Two Pair or Better (X002412P+XP000096) */
+/*
+ % Range: 93.7-95.7% Optimum: 97.7% Hit Frequency: 44.6%
+ Programs Available: X002412P
+
+NOTE: This version uses 5 separate decks of cards, one deck for each HOLD button.
+ So things like a suited 5K are possible. Sadly, there's no paytable displayed
+*/
+ ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD( "xp000096.u67", 0x00000, 0x10000, CRC(5aca14e1) SHA1(13bcb8069f9d704983632bb60db119f7308f9d80) )
+
+ ROM_REGION( 0x10000, "user1", 0 )
+ ROM_LOAD( "x002412p.u66", 0x00000, 0x10000, CRC(43c250d1) SHA1(868a8ab1795b05c2e57a9b8bf3b2b6be688783e9) ) /* Deuces Wild Bonus Poker - French */
+
+ ROM_REGION( 0x020000, "gfx1", 0 )
+ ROM_LOAD( "mro-cg2315.u77", 0x00000, 0x8000, CRC(2c2bb000) SHA1(46135803c9a3066aaaccbf998d91ae3270ab99c4) )
+ ROM_LOAD( "mgo-cg2315.u78", 0x08000, 0x8000, CRC(0be4e10e) SHA1(e050f0386edf6810d8bebaeb442eb9386af1b86f) )
+ ROM_LOAD( "mbo-cg2315.u79", 0x10000, 0x8000, CRC(0942c045) SHA1(1ce6a0b32eaea64f27d4ee998716e0fddb64baf4) )
+ ROM_LOAD( "mxo-cg2315.u80", 0x18000, 0x8000, CRC(93e3b230) SHA1(7a672fa5bef43208e3870e51e29c3c7b1d02e262) )
+
+ ROM_REGION( 0x200, "proms", 0 )
+ ROM_LOAD( "capx2315.u43", 0x0000, 0x0200, CRC(690869af) SHA1(e057ce63a687f566d3ef181ac1829107073783f7) )
+ROM_END
+
ROM_START( pex2419p ) /* Superboard : Deuces Wild Bonus Poker - French (X002419P+XP000064) */
/*
Same payouts as X002027P English Deuces Wild Bonus Poker:
@@ -8692,6 +9404,35 @@ PayTable 2P 3K STR FL FH 4K SF RF 5K RF (Bonus)
ROM_LOAD( "capx1321.u43", 0x0000, 0x0200, CRC(4b57569f) SHA1(fa29c0f627e7ce79951ec6dadec114864144f37d) )
ROM_END
+ROM_START( pex2474p ) /* Superboard : Double Double Bonus Plus (X002474P+XP000038) */
+/*
+ 2-4
+ JJJ55 66633 222AA 4K 4A
+ QQQ55 88844 5-K 2-4 or with with
+PayTable Js+ 2PR 3K STR FL FH KKK55 TTT55 4K 4K 44422 4A A,2-4 2-4 SF RF (Bonus)
+--------------------------------------------------------------------------------------------------
+ ???? 1 1 3 4 5 7 25 25 50 80 85 160 160 400 50 250 800
+ % Range: 94.1-96.1% Optimum: 98.1% Hit Frequency: 44.8%
+ Programs Available: X002474P
+
+NOTE: This DATA rom is compatible with the Multi-Poker XMP00030 + CG2451 set below
+*/
+ ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD( "xp000038.u67", 0x00000, 0x10000, CRC(8707ab9e) SHA1(3e00a2ad8017e1495c6d6fe900d0efa68a1772b8) ) /* Errors with INCOMPATIBLE EPROM error, no dumped program works with this DATA set */
+
+ ROM_REGION( 0x10000, "user1", 0 )
+ ROM_LOAD( "x002474p.u66", 0x00000, 0x10000, CRC(74cc1423) SHA1(0522cee3a7e123ce51739c69f38915ca92bd03e5) ) /* Double Double Bonus Plus */
+
+ ROM_REGION( 0x020000, "gfx1", 0 )
+ ROM_LOAD( "mro-cg2275.u77", 0x00000, 0x8000, CRC(15d5d6b8) SHA1(61b6821d4cc059732bc3831bf19bf01aa3910b31) )
+ ROM_LOAD( "mgo-cg2275.u78", 0x08000, 0x8000, CRC(bcb49579) SHA1(d5d9f523304582fa6f0a0c69aade77629bdec006) )
+ ROM_LOAD( "mbo-cg2275.u79", 0x10000, 0x8000, CRC(9f893787) SHA1(0b79d5cbac920394d5f5c04d0d9d3727e0060366) )
+ ROM_LOAD( "mxo-cg2275.u80", 0x18000, 0x8000, CRC(6187c68b) SHA1(7777b141fd1379d37d93a228b2e2159476c2b89e) )
+
+ ROM_REGION( 0x200, "proms", 0 )
+ ROM_LOAD( "capx1321.u43", 0x0000, 0x0200, CRC(4b57569f) SHA1(fa29c0f627e7ce79951ec6dadec114864144f37d) )
+ROM_END
+
ROM_START( pex2478p ) /* Superboard : Joker Poker - French (X002478P+XP000154) */
/*
w/J w/oJ
@@ -9275,8 +10016,8 @@ Jacks or Better CA 99.50%
Double Bonus Poker P323A 99.10%
*/
ROM_REGION( 0x10000, "maincpu", 0 )
- ROM_LOAD( "xmp00006.u67", 0x00000, 0x10000, CRC(d61f1677) SHA1(2eca1315d6aa310a54de2dfa369e443a07495b76) ) /* 07/25/96 @ IGT L96-2041 - Linkable Progressive */
- /* Known to be found with XMP00003, XMP00006 or XMP00024 programs */
+ ROM_LOAD( "xmp00020.u67", 0x00000, 0x10000, CRC(0f6d0706) SHA1(fccf6c93daab0694d1e35e7cdd6bae303a3fddd9) )
+ /* Also known to be found with XMP00003, XMP00006 or XMP00024 programs */
ROM_REGION( 0x10000, "user1", 0 )
ROM_LOAD( "xm00006p.u66", 0x00000, 0x10000, CRC(b464ee79) SHA1(8768e52c66881c8f327055124ff31bcad79fd027) ) /* 03/08/96 @ IGT NV */
@@ -9354,11 +10095,11 @@ Combined average payout percent: 98.47%
Game Type PayTable Payout
-------------------------------------
-Aces & Faces ????? 99.20%
+Aces & Faces ????? 99.30%
Bonus Poker Deluxe P200A 98.50%
Deuces Wild Poker P62A 98.90%
Jacks or Better BB 97.80%
-Double Aces & Faces ????? 99.30%
+Double Aces & Faces ????? 99.20%
*/
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "xmp00002.u67", 0x00000, 0x10000, CRC(d5624ac8) SHA1(6b778b0e7ddb81123c6038920b3447e05a0556b2) ) /* 09/07/95 @ IGT L95-2183 - Linkable Progressive */
@@ -9697,10 +10438,12 @@ GAMEL(1987, pepp0009, pepp0002, peplus, peplus_poker, peplus_state, nonplus,
GAMEL(1987, pepp0010, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0010) Standard Draw Poker", 0, layout_pe_poker )
GAMEL(1987, pepp0014, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0014) Standard Draw Poker (International)", 0, layout_pe_poker )
GAMEL(1987, pepp0014a, pepp0002, peplus, peplus_poker, peplus_state, nonplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0014) Standard Draw Poker", 0, layout_pe_poker )
+GAMEL(1987, pepp0021, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0021) Standard Draw Poker", GAME_NOT_WORKING, layout_pe_poker) /* Progressive with link ONLY */
GAMEL(1987, pepp0023, pepp0002, peplus, peplus_poker, peplus_state, nonplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0023) 10's or Better", 0, layout_pe_poker )
GAMEL(1987, pepp0038, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0038) Standard Draw Poker", 0, layout_pe_poker )
-GAMEL(1987, pepp0040, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0040) Standard Draw Poker", 0, layout_pe_poker )
-GAMEL(1987, pepp0040a, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0040) Standard Draw Poker (International)", 0, layout_pe_poker )
+GAMEL(1987, pepp0040, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0040) Standard Draw Poker (set 1)", 0, layout_pe_poker )
+GAMEL(1987, pepp0040a, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0040) Standard Draw Poker (set 2)", 0, layout_pe_poker )
+GAMEL(1987, pepp0040b, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0040) Standard Draw Poker (International)", 0, layout_pe_poker )
GAMEL(1987, pepp0041, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0041) Standard Draw Poker", 0, layout_pe_poker )
GAMEL(1987, pepp0042, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0042) 10's or Better", 0, layout_pe_poker )
GAMEL(1987, pepp0043, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0043) 10's or Better", 0, layout_pe_poker )
@@ -9710,6 +10453,7 @@ GAMEL(1987, pepp0045, pepp0002, peplus, peplus_poker, peplus_state, peplus,
GAMEL(1987, pepp0046, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0046) 10's or Better (set 1)", 0, layout_pe_poker )
GAMEL(1987, pepp0046a, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0046) 10's or Better (International)",0, layout_pe_poker )
GAMEL(1987, pepp0046b, pepp0002, peplus, peplus_poker, peplus_state, nonplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0046) 10's or Better (set 2)", 0, layout_pe_poker )
+GAMEL(1987, pepp0048, pepp0053, peplus, peplus_poker, peplus_state, nonplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0048) Joker Poker", 0, layout_pe_poker )
GAMEL(1987, pepp0051, pepp0053, peplus, peplus_poker, peplus_state, nonplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0051) Joker Poker", 0, layout_pe_poker )
GAMEL(1987, pepp0053, 0, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0053) Joker Poker (Aces or Better)", 0, layout_pe_poker )
GAMEL(1987, pepp0055, 0, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0055) Deuces Wild Poker (set 1)", 0, layout_pe_poker )
@@ -9726,6 +10470,8 @@ GAMEL(1987, pepp0063, pepp0002, peplus, peplus_poker, peplus_state, nonplus,
GAMEL(1987, pepp0064, pepp0053, peplus, peplus_poker, peplus_state, nonplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0064) Joker Poker", 0, layout_pe_poker )
GAMEL(1987, pepp0065, pepp0053, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0065) Joker Poker (Aces or Better)", 0, layout_pe_poker )
GAMEL(1987, pepp0083, pepp0002, peplus, peplus_poker, peplus_state, nonplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0083) 10's or Better", 0, layout_pe_poker )
+GAMEL(1987, pepp0085, pepp0002, peplus, peplus_poker, peplus_state, nonplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0085) Joker Poker (Two Pair or Better)", 0, layout_pe_poker )
+GAMEL(1987, pepp0089, pepp0002, peplus, peplus_poker, peplus_state, nonplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0089) Standard Draw Poker", 0, layout_pe_poker )
GAMEL(1987, pepp0103, pepp0055, peplus, peplus_poker, peplus_state, nonplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0103) Deuces Wild Poker", 0, layout_pe_poker )
GAMEL(1987, pepp0116, pepp0002, peplus, peplus_poker, peplus_state, nonplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0116) Standard Draw Poker", 0, layout_pe_poker )
GAMEL(1987, pepp0116a, pepp0002, peplus, peplus_poker, peplus_state, nonplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0116) Standard Draw Poker (Mirage)", 0, layout_pe_poker )
@@ -9735,6 +10481,9 @@ GAMEL(1987, pepp0125, pepp0055, peplus, peplus_poker, peplus_state, nonplus,
GAMEL(1987, pepp0126, pepp0055, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0126) Deuces Wild Poker", 0, layout_pe_poker )
GAMEL(1987, pepp0127, 0, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0127) Deuces Joker Wild Poker", 0, layout_pe_poker )
GAMEL(1987, pepp0127a, pepp0127, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0127) Deuces Joker Wild Poker (International)", 0, layout_pe_poker )
+GAMEL(1987, pepp0130, 0, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0130) Aces and Faces", 0, layout_pe_poker )
+GAMEL(1987, pepp0132, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0132) Standard Draw Poker", 0, layout_pe_poker )
+GAMEL(1987, pepp0150, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0150) Standard Draw Poker", 0, layout_pe_poker )
GAMEL(1987, pepp0158, 0, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0158) 4 of a Kind Bonus Poker (set 1)", 0, layout_pe_poker )
GAMEL(1987, pepp0158a, pepp0158, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0158) 4 of a Kind Bonus Poker (set 2)", 0, layout_pe_poker )
GAMEL(1987, pepp0158b, pepp0158, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0158) 4 of a Kind Bonus Poker (set 3)", 0, layout_pe_poker )
@@ -9744,6 +10493,7 @@ GAMEL(1987, pepp0159, pepp0002, peplus, peplus_poker, peplus_state, peplus,
GAMEL(1987, pepp0171, pepp0053, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0171) Joker Poker", 0, layout_pe_poker )
GAMEL(1987, pepp0171a, pepp0053, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0171) Joker Poker (International)", 0, layout_pe_poker )
GAMEL(1987, pepp0178, pepp0158, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0178) 4 of a Kind Bonus Poker (Operator selectable special 4 of a Kind)", 0, layout_pe_poker )
+GAMEL(1987, pepp0181, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0181) Standard Draw Poker", 0, layout_pe_poker )
GAMEL(1987, pepp0188, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0188) Standard Draw Poker (set 1)", 0, layout_pe_poker )
GAMEL(1987, pepp0188a, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0188) Standard Draw Poker (set 2)", 0, layout_pe_poker )
GAMEL(1987, pepp0190, pepp0055, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0190) Deuces Wild Poker (set 1)", 0, layout_pe_poker )
@@ -9752,6 +10502,7 @@ GAMEL(1987, pepp0190b, pepp0055, peplus, peplus_poker, peplus_state, peplus,
GAMEL(1987, pepp0197, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0197) Standard Draw Poker (set 1)", 0, layout_pe_poker )
GAMEL(1987, pepp0197a, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0197) Standard Draw Poker (set 2)", 0, layout_pe_poker )
GAMEL(1987, pepp0197b, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0197) Standard Draw Poker (set 3)", 0, layout_pe_poker )
+GAMEL(1987, pepp0197c, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0197) Standard Draw Poker (set 4)", 0, layout_pe_poker )
GAMEL(1987, pepp0203, pepp0158, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0203) 4 of a Kind Bonus Poker (set 1)", 0, layout_pe_poker )
GAMEL(1987, pepp0203a, pepp0158, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0203) 4 of a Kind Bonus Poker (set 2)", 0, layout_pe_poker )
GAMEL(1987, pepp0203b, pepp0158, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0203) 4 of a Kind Bonus Poker (set 3)", 0, layout_pe_poker )
@@ -9760,26 +10511,33 @@ GAMEL(1987, pepp0203d, pepp0158, peplus, peplus_poker, peplus_state, peplus,
GAMEL(1987, pepp0219, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0219) Standard Draw Poker", 0, layout_pe_poker )
GAMEL(1987, pepp0221, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0221) Standard Draw Poker (set 1)", 0, layout_pe_poker )
GAMEL(1987, pepp0221a, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0221) Standard Draw Poker (set 2)", 0, layout_pe_poker )
+GAMEL(1987, pepp0223, pepp0127, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0223) Deuces Joker Wild Poker", 0, layout_pe_poker )
GAMEL(1987, pepp0224, pepp0055, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0224) Deuces Wild Poker (set 1)", 0, layout_pe_poker )
GAMEL(1987, pepp0224a, pepp0055, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0224) Deuces Wild Poker (set 2)", 0, layout_pe_poker )
GAMEL(1987, pepp0230, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0230) Standard Draw Poker", 0, layout_pe_poker )
GAMEL(1987, pepp0242, pepp0055, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0242) Deuces Wild Poker (International English/Spanish)", 0, layout_pe_poker )
GAMEL(1987, pepp0249, pepp0055, peplus, peplus_poker, peplus_state, nonplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0249) Deuces Wild Poker", 0, layout_pe_poker )
-GAMEL(1987, pepp0250, 0, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0250) Double Down Stud Poker", 0, layout_pe_poker )
+GAMEL(1987, pepp0250, 0, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0250) Double Down Stud Poker (set 1)", 0, layout_pe_poker )
+GAMEL(1987, pepp0250a, pepp0250, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0250) Double Down Stud Poker (set 2)", 0, layout_pe_poker )
GAMEL(1987, pepp0265, pepp0158, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0265) 4 of a Kind Bonus Poker (set 1)", 0, layout_pe_poker )
GAMEL(1987, pepp0265a, pepp0158, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0265) 4 of a Kind Bonus Poker (set 2)", 0, layout_pe_poker )
GAMEL(1987, pepp0265b, pepp0158, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0265) 4 of a Kind Bonus Poker (International)", 0, layout_pe_poker )
GAMEL(1987, pepp0274, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0274) Standard Draw Poker", 0, layout_pe_poker )
GAMEL(1987, pepp0288, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0288) Standard Draw Poker (Spanish)", 0, layout_pe_poker )
GAMEL(1987, pepp0290, pepp0055, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0290) Deuces Wild Poker", 0, layout_pe_poker )
-GAMEL(1987, pepp0291, pepp0055, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0291) Deuces Wild Poker", 0, layout_pe_poker )
+GAMEL(1987, pepp0291, pepp0055, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0291) Deuces Wild Poker (set 1)", 0, layout_pe_poker )
+GAMEL(1987, pepp0291a, pepp0055, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0291) Deuces Wild Poker (set 2)", 0, layout_pe_poker )
+GAMEL(1987, pepp0401, pepp0158, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0401) 4 of a Kind Bonus Poker", 0, layout_pe_poker )
GAMEL(1987, pepp0409, pepp0158, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0409) 4 of a Kind Bonus Poker", 0, layout_pe_poker )
-GAMEL(1987, pepp0410, pepp0158, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0410) 4 of a Kind Bonus Poker", 0, layout_pe_poker )
+GAMEL(1987, pepp0410, pepp0158, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0410) 4 of a Kind Bonus Poker (set 1)", 0, layout_pe_poker )
+GAMEL(1987, pepp0410a, pepp0158, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0410) 4 of a Kind Bonus Poker (set 2)", 0, layout_pe_poker )
GAMEL(1987, pepp0417, pepp0055, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0417) Deuces Wild Poker (set 1)", 0, layout_pe_poker )
GAMEL(1987, pepp0417a, pepp0055, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0417) Deuces Wild Poker (set 2)", 0, layout_pe_poker )
GAMEL(1987, pepp0419, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0419) Standard Draw Poker", 0, layout_pe_poker )
GAMEL(1987, pepp0420, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0420) Standard Draw Poker", 0, layout_pe_poker )
-GAMEL(1987, pepp0423, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0423) Standard Draw Poker", 0, layout_pe_poker )
+GAMEL(1987, pepp0423, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0423) Standard Draw Poker (set 1)", 0, layout_pe_poker )
+GAMEL(1987, pepp0423a, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0423) Standard Draw Poker (set 2)", 0, layout_pe_poker )
+GAMEL(1987, pepp0423b, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0423) Standard Draw Poker (set 3)", 0, layout_pe_poker )
GAMEL(1987, pepp0426, pepp0053, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0426) Joker Poker", 0, layout_pe_poker )
GAMEL(1987, pepp0428, pepp0053, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0428) Joker Poker", 0, layout_pe_poker )
GAMEL(1987, pepp0429, pepp0053, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0429) Joker Poker (Aces or Better, set 1)", 0, layout_pe_poker )
@@ -9793,6 +10551,7 @@ GAMEL(1987, pepp0449a, pepp0002, peplus, peplus_poker, peplus_state, peplus,
GAMEL(1987, pepp0452, 0, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0452) Double Deuces Wild Poker", 0, layout_pe_poker )
GAMEL(1987, pepp0454, pepp0434, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0454) Bonus Poker Deluxe", 0, layout_pe_poker )
GAMEL(1987, pepp0455, pepp0053, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0455) Joker Poker", 0, layout_pe_poker )
+GAMEL(1987, pepp0467, pepp0158, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0467) 4 of a Kind Bonus Poker", 0, layout_pe_poker )
GAMEL(1987, pepp0458, pepp0053, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0458) Joker Poker (Aces or Better)", 0, layout_pe_poker )
GAMEL(1985, pepp0488, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0488) Standard Draw Poker (Arizona Charlie's)", 0, layout_pe_poker )
GAMEL(1987, pepp0508, 0, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0508) Loose Deuce Deuces Wild! Poker",0, layout_pe_poker )
@@ -9813,6 +10572,7 @@ GAMEL(1987, pepp0538, pepp0514, peplus, peplus_poker, peplus_state, peplus,
GAMEL(1987, pepp0540, pepp0514, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0540) Double Bonus Poker", 0, layout_pe_poker )
GAMEL(1987, pepp0542, 0, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0542) One Eyed Jacks Wild Poker (CG2243)", 0, layout_pe_poker )
GAMEL(1987, pepp0542a, pepp0542, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0542) One Eyed Jacks Wild Poker (CG2020)", 0, layout_pe_poker )
+GAMEL(1987, pepp0550, pepp0053, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0550) Joker Poker (Two Pair or Better)", 0, layout_pe_poker )
GAMEL(1987, pepp0568, pepp0053, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0568) Joker Poker", 0, layout_pe_poker )
GAMEL(1987, pepp0585, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0585) Standard Draw Poker", 0, layout_pe_poker )
GAMEL(1987, pepp0713, pepp0434, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0713) Bonus Poker Deluxe", 0, layout_pe_poker )
@@ -9820,9 +10580,13 @@ GAMEL(1987, pepp0725, pepp0514, peplus, peplus_poker, peplus_state, peplus,
GAMEL(1987, pepp0725a, pepp0514, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0725) Double Bonus Poker (set 2)", 0, layout_pe_poker )
GAMEL(1987, pepp0726, pepp0514, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0726) Double Bonus Poker", 0, layout_pe_poker )
GAMEL(1987, pepp0728, pepp0514, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0728) Double Bonus Poker", 0, layout_pe_poker )
+GAMEL(1987, pepp0750, pepp0002, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0750) Standard Draw Poker", 0, layout_pe_poker )
+GAMEL(1987, pepp0757, pepp0250, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0757) Double Down Stud Joker Poker", 0, layout_pe_poker )
GAMEL(1987, pepp0760, pepp0250, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0760) Double Down Stud Poker", 0, layout_pe_poker )
GAMEL(1987, pepp0763, pepp0158, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0763) 4 of a Kind Bonus Poker", 0, layout_pe_poker )
+GAMEL(1987, pepp0764, pepp0158, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0764) 4 of a Kind Bonus Poker", 0, layout_pe_poker )
GAMEL(1987, pepp0775, 0, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0775) Royal Deuces Poker??", GAME_IMPERFECT_GRAPHICS, layout_pe_poker ) /* Wrong CG graphics & CAP */
+GAMEL(1987, pepp0812, pepp0127, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0812) Deuces Joker Wild Poker", 0, layout_pe_poker )
GAMEL(1987, pepp0816, 0, peplus, peplus_poker, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PP0816) Treasure Chest Poker", GAME_IMPERFECT_GRAPHICS, layout_pe_poker ) /* Wrong CG graphics & CAP - Missing "Bonus" at MAX Bet for 4 of a Kind & Treasure Chest graphics */
/* Normal board : International Poker */
@@ -9914,6 +10678,7 @@ GAMEL(1995, pex0055po, pex0055p, peplus, peplus_poker, peplus_state, peplussb,
GAMEL(1995, pex0055pp, pex0055p, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000055P+XP000104) Deuces Wild Poker", 0, layout_pe_poker )
GAMEL(1995, pex0055pq, pex0055p, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000055P+XP000112) Deuces Wild Poker", 0, layout_pe_poker )
GAMEL(1995, pex0055pr, pex0055p, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000055P+XP000126) Deuces Wild Poker", 0, layout_pe_poker )
+GAMEL(1995, pex0057p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000057P+XP000038) Deuces Wild Poker", 0, layout_pe_poker )
GAMEL(1995, pex0060p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000060P+XP000038) Standard Draw Poker", 0, layout_pe_poker )
GAMEL(1995, pex0124p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000124P+XP000053) Deuces Wild Poker", 0, layout_pe_poker )
GAMEL(1995, pex0150p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000150P+XP000038) Standard Draw Poker", 0, layout_pe_poker )
@@ -9940,6 +10705,7 @@ GAMEL(1995, pex0455p, 0, peplus, peplus_poker, peplus_state, peplussb,
GAMEL(1995, pex0458p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000458P+XP000038) Joker Poker (Aces or Better)", 0, layout_pe_poker )
GAMEL(1995, pex0459p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000459P+XP000038) Joker Poker", 0, layout_pe_poker )
GAMEL(1995, pex0459pa, pex0459p, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000459P+XP000155) Joker Poker", 0, layout_pe_poker )
+GAMEL(1995, pex0489p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000489P+XP000038) Double Down Stud Deuces Wild Poker", GAME_NOT_WORKING, layout_pe_poker ) /* Needs unknown PE+ GAME POKER program to run */
GAMEL(1995, pex0508p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000508P+XP000038) Loose Deuce Deuces Wild! Poker", 0, layout_pe_poker )
GAMEL(1995, pex0514p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000514P+XP000038) Double Bonus Poker", 0, layout_pe_poker )
GAMEL(1995, pex0515p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000515P+XP000038) Double Bonus Poker", 0, layout_pe_poker )
@@ -9947,7 +10713,9 @@ GAMEL(1995, pex0516p, 0, peplus, peplus_poker, peplus_state, peplussb,
GAMEL(1995, pex0536p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000536P+XP000038) Joker Poker", 0, layout_pe_poker )
GAMEL(1995, pex0537p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000537P+XP000038) Standard Draw Poker", 0, layout_pe_poker )
GAMEL(1995, pex0550p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000550P+XP000055) Joker Poker (Two Pair or Better)", 0, layout_pe_poker )
+GAMEL(1995, pex0557p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000557P+XP000038) Standard Draw Poker", 0, layout_pe_poker )
GAMEL(1995, pex0568p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000568P+XP000038) Joker Poker", 0, layout_pe_poker )
+GAMEL(1995, pex0578p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000578P+XP000038) Standard Draw Poker", 0, layout_pe_poker )
GAMEL(1995, pex0581p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000581P+XP000038) 4 of a Kind Bonus Poker", 0, layout_pe_poker )
GAMEL(1995, pex0588p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000588P+XP000038) Joker Poker", 0, layout_pe_poker )
GAMEL(1995, pex0725p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000725P+XP000038) Double Bonus Poker", 0, layout_pe_poker )
@@ -9959,6 +10727,8 @@ GAMEL(1995, pex2010p, 0, peplus, peplus_poker, peplus_state, peplussb,
GAMEL(1995, pex2016p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002016P+XP000038) Full House Bonus Poker", 0, layout_pe_poker )
GAMEL(1995, pex2017p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002017P+XP000038) Full House Bonus Poker", 0, layout_pe_poker )
GAMEL(1995, pex2018p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002018P+XP000038) Full House Bonus Poker", 0, layout_pe_poker )
+GAMEL(1995, pex2021p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002021P+XP000112) Lucky Deal Poker", 0, layout_pe_poker )
+GAMEL(1995, pex2024p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002024P+XP000038) Double Bonus Poker", 0, layout_pe_poker )
GAMEL(1995, pex2025p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002025P+XP000019) Deuces Wild Bonus Poker", 0, layout_pe_poker )
GAMEL(1995, pex2026p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002026P+XP000019) Deuces Wild Bonus Poker", 0, layout_pe_poker )
GAMEL(1995, pex2027p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002027P+XP000019) Deuces Wild Bonus Poker", 0, layout_pe_poker )
@@ -10007,15 +10777,18 @@ GAMEL(1995, pex2306p, 0, peplus, peplus_poker, peplus_state, peplussb,
GAMEL(1995, pex2307p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002307P+XP000112) Triple Double Bonus Poker", 0, layout_pe_poker )
GAMEL(1995, pex2308p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002308P+XP000112) Triple Double Bonus Poker", 0, layout_pe_poker )
GAMEL(1995, pex2310p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002310P+XP000112) Triple Double Bonus Poker", 0, layout_pe_poker )
+GAMEL(1995, pex2312p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002312P+XP000112) Triple Bonus Poker Plus", 0, layout_pe_poker )
GAMEL(1995, pex2314p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002314P+XP000112) Triple Bonus Poker Plus", 0, layout_pe_poker )
GAMEL(1995, pex2374p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002374P+XP000112) Super Aces Poker", 0, layout_pe_poker )
GAMEL(1995, pex2377p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002377P+XP000112) Super Double Bonus Poker", 0, layout_pe_poker )
GAMEL(1995, pex2386p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002386P+XP000038) 4 of a Kind Bonus Poker", 0,layout_pe_poker )
+GAMEL(1995, pex2412p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002412P+XP000096) Standard Draw with 5 decks (Two Pair or Better)", 0, layout_pe_poker )
GAMEL(1995, pex2419p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002419P+XP000064) Deuces Wild Bonus Poker - French", 0, layout_pe_poker )
GAMEL(1995, pex2420p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002420P+XP000064) Deuces Wild Bonus Poker - French", 0, layout_pe_poker )
GAMEL(1995, pex2421p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002421P+XP000064) Deuces Wild Bonus Poker - French", 0, layout_pe_poker )
GAMEL(1995, pex2440p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002440P+XP000053) Deuces Wild Poker", 0, layout_pe_poker )
GAMEL(1995, pex2461p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002461P+XP000055) Joker Poker (Two Pair or Better)", 0, layout_pe_poker )
+GAMEL(1995, pex2474p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002474P+XP000038) Double Double Bonus Plus", GAME_NOT_WORKING, layout_pe_poker ) /* Needs unknown PE+ GAME POKER program to run */
GAMEL(1995, pex2478p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002478P+XP000154) Joker Poker - French", 0, layout_pe_poker )
GAMEL(1995, pex2479p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002479P+XP000154) Joker Poker - French", 0, layout_pe_poker )
GAMEL(1995, pex2480p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002480P+XP000154) Joker Poker (Aces or Better) - French", 0, layout_pe_poker )
@@ -10039,7 +10812,7 @@ GAMEL(1995, pexm002p, pexm001p, peplus, peplus_poker, peplus_state, peplussb,
GAMEL(1995, pexm003p, pexm001p, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (XM00003P+XMP00024) Multi-Poker", 0, layout_pe_poker )
GAMEL(1995, pexm004p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (XM00004P+XMP00002) Multi-Poker", 0, layout_pe_poker )
GAMEL(1995, pexm005p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (XM00005P+XMP00004) Multi-Poker", 0, layout_pe_poker )
-GAMEL(1995, pexm006p, pexm001p, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (XM00006P+XMP00006) Multi-Poker", 0, layout_pe_poker )
+GAMEL(1995, pexm006p, pexm001p, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (XM00006P+XMP00020) Multi-Poker", 0, layout_pe_poker )
GAMEL(1995, pexm007p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (XM00007P+XMP00006) Multi-Poker", 0, layout_pe_poker )
GAMEL(1995, pexm008p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (XM00008P+XMP00006) Multi-Poker", 0, layout_pe_poker )
GAMEL(1995, pexm009p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (XM00009P+XMP00002) Multi-Poker", GAME_IMPERFECT_GRAPHICS, layout_pe_poker ) /* Needs unknown CG2??? graphics roms for correct MENU game banners */
diff --git a/src/mame/drivers/pktgaldx.c b/src/mame/drivers/pktgaldx.c
index c29d8089f28..7dd4af0c82b 100644
--- a/src/mame/drivers/pktgaldx.c
+++ b/src/mame/drivers/pktgaldx.c
@@ -109,6 +109,10 @@ static ADDRESS_MAP_START( pktgaldx_map, AS_PROGRAM, 16, pktgaldx_state )
AM_RANGE(0x170000, 0x17ffff) AM_RAM
ADDRESS_MAP_END
+static ADDRESS_MAP_START( decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 16, pktgaldx_state )
+ AM_RANGE(0x000000, 0x07ffff) AM_ROM AM_SHARE("decrypted_opcodes")
+ADDRESS_MAP_END
+
/* Pocket Gal Deluxe (bootleg!) */
@@ -320,6 +324,7 @@ static MACHINE_CONFIG_START( pktgaldx, pktgaldx_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 14000000)
MCFG_CPU_PROGRAM_MAP(pktgaldx_map)
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", pktgaldx_state, irq6_line_hold)
@@ -474,7 +479,7 @@ ROM_END
DRIVER_INIT_MEMBER(pktgaldx_state,pktgaldx)
{
deco56_decrypt_gfx(machine(), "gfx1");
- deco102_decrypt_cpu(machine(), "maincpu", 0x42ba, 0x00, 0x00);
+ deco102_decrypt_cpu((UINT16 *)memregion("maincpu")->base(), m_decrypted_opcodes, 0x80000, 0x42ba, 0x00, 0x00);
}
GAME( 1992, pktgaldx, 0, pktgaldx, pktgaldx, pktgaldx_state, pktgaldx, ROT0, "Data East Corporation", "Pocket Gal Deluxe (Euro v3.00)", GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/plygonet.c b/src/mame/drivers/plygonet.c
index de3714e9768..eceb82dbefd 100644
--- a/src/mame/drivers/plygonet.c
+++ b/src/mame/drivers/plygonet.c
@@ -314,30 +314,6 @@ READ16_MEMBER(polygonet_state::dsp56k_bootload_r)
return 0x7fff;
}
-DIRECT_UPDATE_MEMBER(polygonet_state::plygonet_dsp56k_direct_handler)
-{
- /* Call the dsp's update handler first */
- if (!m_dsp56k_update_handler.isnull())
- {
- if (m_dsp56k_update_handler(direct, address) == ~0)
- return ~0;
- }
-
- /* If the requested region wasn't in there, see if it needs to be caught driver-side */
- if (address >= (0x7000<<1) && address <= (0x7fff<<1))
- {
- direct.explicit_configure(0x7000<<1, 0x7fff<<1, (0xfff<<1) | 1, m_dsp56k_p_mirror);
- return ~0;
- }
- else if (address >= (0x8000<<1) && address <= (0x87ff<<1))
- {
- direct.explicit_configure(0x8000<<1, 0x87ff<<1, (0x7ff<<1) | 1, m_dsp56k_p_8000);
- return ~0;
- }
-
- return address;
-}
-
/* The dsp56k's Port C Data register (0xffe3) :
Program code (function 4e) configures it as general purpose output I/O pins (ffc1 = 0000 & ffc3 = 0fff).
@@ -756,10 +732,6 @@ DRIVER_INIT_MEMBER(polygonet_state,polygonet)
memset(m_dsp56k_bank02_ram, 0, sizeof(m_dsp56k_bank02_ram));
memset(m_dsp56k_shared_ram_16, 0, sizeof(m_dsp56k_shared_ram_16));
memset(m_dsp56k_bank04_ram, 0, sizeof(m_dsp56k_bank04_ram));
-
- /* The dsp56k occasionally executes out of mapped memory */
- address_space &space = machine().device<dsp56k_device>("dsp")->space(AS_PROGRAM);
- m_dsp56k_update_handler = space.set_direct_update_handler(direct_update_delegate(FUNC(polygonet_state::plygonet_dsp56k_direct_handler), this));
}
diff --git a/src/mame/drivers/pong.c b/src/mame/drivers/pong.c
index 3f855cd247c..4e29ead9ada 100644
--- a/src/mame/drivers/pong.c
+++ b/src/mame/drivers/pong.c
@@ -86,9 +86,9 @@ enum input_changed_enum
IC_VR2
};
-NETLIST_EXTERNAL(pongdoubles);
-NETLIST_EXTERNAL(pong_fast);
-NETLIST_EXTERNAL(breakout);
+NETLIST_EXTERNAL(pongdoubles)
+NETLIST_EXTERNAL(pong_fast)
+NETLIST_EXTERNAL(breakout)
class ttl_mono_state : public driver_device
{
@@ -216,7 +216,9 @@ private:
static NETLIST_START(pong)
- NETLIST_MEMREGION("maincpu")
+ MEMREGION_SOURCE("maincpu")
+ PARAM(NETLIST.USE_DEACTIVATE, 1)
+ INCLUDE(pong_schematics)
NETLIST_END()
diff --git a/src/mame/drivers/poolshrk.c b/src/mame/drivers/poolshrk.c
index 78e6d6f16fc..b8794ba80bc 100644
--- a/src/mame/drivers/poolshrk.c
+++ b/src/mame/drivers/poolshrk.c
@@ -19,14 +19,11 @@ DRIVER_INIT_MEMBER(poolshrk_state,poolshrk)
UINT8* pSprite = memregion("gfx1")->base();
UINT8* pOffset = memregion("proms")->base();
- int i;
- int j;
-
/* re-arrange sprite data using the PROM */
- for (i = 0; i < 16; i++)
+ for (int i = 0; i < 16; i++)
{
- for (j = 0; j < 16; j++)
+ for (int j = 0; j < 16; j++)
{
UINT16 v =
(pSprite[0] << 0xC) |
@@ -44,16 +41,18 @@ DRIVER_INIT_MEMBER(poolshrk_state,poolshrk)
pSprite += 4;
}
}
+
+ save_item(NAME(m_da_latch));
}
-WRITE8_MEMBER(poolshrk_state::poolshrk_da_latch_w)
+WRITE8_MEMBER(poolshrk_state::da_latch_w)
{
m_da_latch = data & 15;
}
-WRITE8_MEMBER(poolshrk_state::poolshrk_led_w)
+WRITE8_MEMBER(poolshrk_state::led_w)
{
if (offset & 2)
set_led_status(machine(), 0, offset & 1);
@@ -62,7 +61,7 @@ WRITE8_MEMBER(poolshrk_state::poolshrk_led_w)
}
-WRITE8_MEMBER(poolshrk_state::poolshrk_watchdog_w)
+WRITE8_MEMBER(poolshrk_state::watchdog_w)
{
if ((offset & 3) == 3)
{
@@ -71,7 +70,7 @@ WRITE8_MEMBER(poolshrk_state::poolshrk_watchdog_w)
}
-READ8_MEMBER(poolshrk_state::poolshrk_input_r)
+READ8_MEMBER(poolshrk_state::input_r)
{
static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3" };
UINT8 val = ioport(portnames[offset & 3])->read();
@@ -91,7 +90,7 @@ READ8_MEMBER(poolshrk_state::poolshrk_input_r)
}
-READ8_MEMBER(poolshrk_state::poolshrk_irq_reset_r)
+READ8_MEMBER(poolshrk_state::irq_reset_r)
{
m_maincpu->set_input_line(0, CLEAR_LINE);
@@ -105,15 +104,15 @@ static ADDRESS_MAP_START( poolshrk_cpu_map, AS_PROGRAM, 8, poolshrk_state )
AM_RANGE(0x0400, 0x07ff) AM_MIRROR(0x2000) AM_WRITEONLY AM_SHARE("playfield_ram")
AM_RANGE(0x0800, 0x080f) AM_MIRROR(0x23f0) AM_WRITEONLY AM_SHARE("hpos_ram")
AM_RANGE(0x0c00, 0x0c0f) AM_MIRROR(0x23f0) AM_WRITEONLY AM_SHARE("vpos_ram")
- AM_RANGE(0x1000, 0x13ff) AM_MIRROR(0x2000) AM_READWRITE(poolshrk_input_r, poolshrk_watchdog_w)
- AM_RANGE(0x1400, 0x17ff) AM_MIRROR(0x2000) AM_WRITE(poolshrk_scratch_sound_w)
- AM_RANGE(0x1800, 0x1bff) AM_MIRROR(0x2000) AM_WRITE(poolshrk_score_sound_w)
- AM_RANGE(0x1c00, 0x1fff) AM_MIRROR(0x2000) AM_WRITE(poolshrk_click_sound_w)
+ AM_RANGE(0x1000, 0x13ff) AM_MIRROR(0x2000) AM_READWRITE(input_r, watchdog_w)
+ AM_RANGE(0x1400, 0x17ff) AM_MIRROR(0x2000) AM_WRITE(scratch_sound_w)
+ AM_RANGE(0x1800, 0x1bff) AM_MIRROR(0x2000) AM_WRITE(score_sound_w)
+ AM_RANGE(0x1c00, 0x1fff) AM_MIRROR(0x2000) AM_WRITE(click_sound_w)
AM_RANGE(0x4000, 0x4000) AM_NOP /* diagnostic ROM location */
- AM_RANGE(0x6000, 0x63ff) AM_WRITE(poolshrk_da_latch_w)
- AM_RANGE(0x6400, 0x67ff) AM_WRITE(poolshrk_bump_sound_w)
- AM_RANGE(0x6800, 0x6bff) AM_READ(poolshrk_irq_reset_r)
- AM_RANGE(0x6c00, 0x6fff) AM_WRITE(poolshrk_led_w)
+ AM_RANGE(0x6000, 0x63ff) AM_WRITE(da_latch_w)
+ AM_RANGE(0x6400, 0x67ff) AM_WRITE(bump_sound_w)
+ AM_RANGE(0x6800, 0x6bff) AM_READ(irq_reset_r)
+ AM_RANGE(0x6c00, 0x6fff) AM_WRITE(led_w)
AM_RANGE(0x7000, 0x7fff) AM_ROM
ADDRESS_MAP_END
@@ -225,7 +224,7 @@ static MACHINE_CONFIG_START( poolshrk, poolshrk_state )
MCFG_SCREEN_REFRESH_RATE(60)
MCFG_SCREEN_SIZE(256, 256)
MCFG_SCREEN_VISIBLE_AREA(1, 255, 24, 255)
- MCFG_SCREEN_UPDATE_DRIVER(poolshrk_state, screen_update_poolshrk)
+ MCFG_SCREEN_UPDATE_DRIVER(poolshrk_state, screen_update)
MCFG_SCREEN_PALETTE("palette")
MCFG_GFXDECODE_ADD("gfxdecode", "palette", poolshrk)
@@ -258,4 +257,4 @@ ROM_START( poolshrk )
ROM_END
-GAME( 1977, poolshrk, 0, poolshrk, poolshrk, poolshrk_state, poolshrk, 0, "Atari", "Poolshark", 0 )
+GAME( 1977, poolshrk, 0, poolshrk, poolshrk, poolshrk_state, poolshrk, 0, "Atari", "Poolshark", GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/popeye.c b/src/mame/drivers/popeye.c
index a72ac4ad073..6ec651e3bed 100644
--- a/src/mame/drivers/popeye.c
+++ b/src/mame/drivers/popeye.c
@@ -51,6 +51,10 @@ NETLIST_END()
static NETLIST_START(nl_popeye)
+ /* register hard coded netlists */
+
+ LOCAL_SOURCE(nl_popeye_imp_changer)
+
/* Standard stuff */
SOLVER(Solver, 48000)
diff --git a/src/mame/drivers/pse.c b/src/mame/drivers/pse.c
index 40fa2859b3c..a1408b00c3c 100644
--- a/src/mame/drivers/pse.c
+++ b/src/mame/drivers/pse.c
@@ -1,15 +1,24 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Fabio Priuli,Dave Widel, gregf
/***************************************************************************
Project Support Engineering Games
- Game Name DATA
- --------------------------------
- Maneater (1975) YES
- Knights in Armor (1976) YES
- Desert Patrol (1977) YES
- Game Tree (1978) YES
+ Game Name DATA
+ -------------------------------------
+ 1-2-4 Cocktail Table (197?) UNKNOWN
+ Bazooka (1977) YES
+ Desert Patrol (1977) YES
+ Espana (cabinet) (197?) NO
+ Frenzy (1975) UNKNOWN
+ Game Tree (1978) YES
+ Hodge Podge (197?) UNKNOWN
+ Knights in Armor (1976) YES
+ Maneater (1975) YES
+ Play Five (1975?) UNKNOWN
+ Scandia (cabinet) (1975) NO
+ Two Game (1974) UNKNOWN
+ U.N. Command (1977) UNKNOWN
***************************************************************************/
diff --git a/src/mame/drivers/psikyosh.c b/src/mame/drivers/psikyosh.c
index 19eb3b07d4f..083a653e68d 100644
--- a/src/mame/drivers/psikyosh.c
+++ b/src/mame/drivers/psikyosh.c
@@ -434,7 +434,7 @@ P1KEY11 29|30 P2KEY11
KEY8 = 0x1000, // JAMMA P1 Left
KEY9 = 0x2000, // JAMMA P1 Right
KEY10 = 0x0020, // JAMMA P2 Right
- KEY11 = 0x0800, // JAMMA P1 Button 1
+ KEY11 = 0x0800 // JAMMA P1 Button 1
}; // Mahjong->JAMMA mapping specific to this game pcb
UINT16 key_codes[] = { // treated as IP_ACTIVE_LOW, game inverts them upon reading
diff --git a/src/mame/drivers/raiden.c b/src/mame/drivers/raiden.c
index 2ffeb0a93d6..dcc96275db7 100644
--- a/src/mame/drivers/raiden.c
+++ b/src/mame/drivers/raiden.c
@@ -301,7 +301,11 @@ static MACHINE_CONFIG_START( raiden, raiden_state )
SEIBU_SOUND_SYSTEM_YM3812_RAIDEN_INTERFACE(XTAL_14_31818MHz/4,XTAL_12MHz/12) // frequency and pin 7 verified (pin set in audio\seibu.h)
MACHINE_CONFIG_END
-static MACHINE_CONFIG_DERIVED( raidenu, raiden )
+static MACHINE_CONFIG_DERIVED( raidene, raiden )
+ SEIBU_SOUND_SYSTEM_ENCRYPTED_FULL()
+MACHINE_CONFIG_END
+
+static MACHINE_CONFIG_DERIVED( raidenu, raidene )
/* basic machine hardware */
MCFG_CPU_MODIFY("maincpu")
@@ -616,7 +620,6 @@ void raiden_state::common_decrypt()
DRIVER_INIT_MEMBER(raiden_state,raiden)
{
common_decrypt();
- m_seibu_sound->decrypt("audiocpu",0x20000);
}
DRIVER_INIT_MEMBER(raiden_state,raidenk)
@@ -626,17 +629,16 @@ DRIVER_INIT_MEMBER(raiden_state,raidenk)
DRIVER_INIT_MEMBER(raiden_state,raidenu)
{
- m_seibu_sound->decrypt("audiocpu",0x20000);
}
/***************************************************************************/
/* Same PCB, differ by region byte(s) */
-GAME( 1990, raiden, 0, raiden, raiden, raiden_state, raiden, ROT270, "Seibu Kaihatsu", "Raiden (set 1)", GAME_SUPPORTS_SAVE )
-GAME( 1990, raidena, raiden, raiden, raiden, raiden_state, raiden, ROT270, "Seibu Kaihatsu", "Raiden (set 2)", GAME_SUPPORTS_SAVE )
-GAME( 1990, raidenu, raiden, raiden, raiden, raiden_state, raiden, ROT270, "Seibu Kaihatsu (Fabtek license)", "Raiden (US set 1)", GAME_SUPPORTS_SAVE )
-GAME( 1990, raident, raiden, raiden, raiden, raiden_state, raiden, ROT270, "Seibu Kaihatsu (Liang HWA Electronics license)", "Raiden (Taiwan)", GAME_SUPPORTS_SAVE )
+GAME( 1990, raiden, 0, raidene, raiden, raiden_state, raiden, ROT270, "Seibu Kaihatsu", "Raiden (set 1)", GAME_SUPPORTS_SAVE )
+GAME( 1990, raidena, raiden, raidene, raiden, raiden_state, raiden, ROT270, "Seibu Kaihatsu", "Raiden (set 2)", GAME_SUPPORTS_SAVE )
+GAME( 1990, raidenu, raiden, raidene, raiden, raiden_state, raiden, ROT270, "Seibu Kaihatsu (Fabtek license)", "Raiden (US set 1)", GAME_SUPPORTS_SAVE )
+GAME( 1990, raident, raiden, raidene, raiden, raiden_state, raiden, ROT270, "Seibu Kaihatsu (Liang HWA Electronics license)", "Raiden (Taiwan)", GAME_SUPPORTS_SAVE )
/* Same as above, but the sound CPU code is not encrypted */
GAME( 1990, raidenk, raiden, raiden, raiden, raiden_state, raidenk, ROT270, "Seibu Kaihatsu (IBL Corporation license)", "Raiden (Korea)", GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/rainbow.c b/src/mame/drivers/rainbow.c
index 9472563f769..b548f2b98bd 100644
--- a/src/mame/drivers/rainbow.c
+++ b/src/mame/drivers/rainbow.c
@@ -675,18 +675,18 @@ static MACHINE_CONFIG_START( rbisland, rbisland_state )
MACHINE_CONFIG_END
-/* Jumping: The PCB has 2 Xtals, 24MHz and 18,432MHz */
+/* Jumping: The PCB has 2 Xtals, 18.432MHz and 24MHz */
static MACHINE_CONFIG_START( jumping, rbisland_state )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", M68000, XTAL_24MHz/3) /* not verified but matches original */
+ MCFG_CPU_ADD("maincpu", M68000, XTAL_18_432MHz/2) /* verified on pcb */
MCFG_CPU_PROGRAM_MAP(jumping_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", rbisland_state, irq4_line_hold)
- MCFG_CPU_ADD("audiocpu", Z80, XTAL_18_432MHz/6) /* not verified but music tempo matches original */
+ MCFG_CPU_ADD("audiocpu", Z80, XTAL_24MHz/4) /* verified on pcb */
MCFG_CPU_PROGRAM_MAP(jumping_sound_map)
- MCFG_QUANTUM_TIME(attotime::from_hz(600)) /* 10 CPU slices per frame - enough ? */
+ MCFG_QUANTUM_TIME(attotime::from_hz(600)) /* 10 CPU slices per frame - enough unless otherwise */
/* video hardware */
@@ -713,13 +713,19 @@ static MACHINE_CONFIG_START( jumping, rbisland_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("ym1", YM2203, XTAL_18_432MHz/6) /* not verified */
+ MCFG_SOUND_ADD("ym1", YM2203, XTAL_24MHz/8) /* verified on pcb */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
- MCFG_SOUND_ADD("ym2", YM2203, XTAL_18_432MHz/6) /* not verified */
+ MCFG_SOUND_ADD("ym2", YM2203, XTAL_24MHz/8) /* verified on pcb */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
MACHINE_CONFIG_END
+/* Imnoe PCB uses 16MHz CPU crystal instead of 18.432 for CPU */
+static MACHINE_CONFIG_DERIVED( jumpingi, jumping )
+ MCFG_CPU_REPLACE("maincpu", M68000, XTAL_16MHz/2) /* verified on pcb */
+ MCFG_CPU_PROGRAM_MAP(jumping_map)
+ MCFG_CPU_VBLANK_INT_DRIVER("screen", rbisland_state, irq4_line_hold)
+MACHINE_CONFIG_END
/***************************************************************************
DRIVERS
@@ -894,7 +900,49 @@ ROM_START( jumpinga )
ROM_LOAD( "pal16l8a.ic51.bin", 0x000, 0x104, CRC(c1e6cb8f) SHA1(9908e62bb9b806047b7a344bb62334bd696b9fc8) ) // z80 address decoder?
ROM_END
-
+/* red 'Imnoe' PCB */
+ROM_START( jumpingi )
+ ROM_REGION( 0xa0000, "maincpu", 0 )
+ ROM_LOAD16_BYTE( "05.IC3", 0x00000, 0x20000, CRC(69ac4af4) SHA1(39055573e412e2591f7a68f9fee5919528529544) )
+ ROM_LOAD16_BYTE( "03.IC6", 0x00001, 0x20000, CRC(38975cdc) SHA1(23c02a4574a95904805d5f458c06c77c14d11c14) )
+ ROM_LOAD16_BYTE( "06.IC2", 0x40000, 0x20000, CRC(3ebb0fb8) SHA1(1b41b305623d121255eb70cb992e4d9da13abd82) ) // b22-03.23
+ ROM_LOAD16_BYTE( "04.IC5", 0x40001, 0x20000, CRC(91625e7f) SHA1(765afd973d9b82bb496b04beca284bf2769d6e6f) ) // b22-04.24
+ ROM_LOAD16_BYTE( "02", 0x80001, 0x10000, CRC(0810d327) SHA1(fe91ac02e617bde413dc8a20b7cbcaf3e20aeb28) ) /* c-chip substitute */
+
+ ROM_REGION( 0x14000, "audiocpu", 0 )
+ ROM_LOAD( "01.IC53", 0x00000, 0x8000, CRC(8527c00e) SHA1(86e3824caca39aca4ca4df63bb4474adacfc4c53) )
+ ROM_CONTINUE( 0x10000, 0x4000 )
+ ROM_CONTINUE( 0x0c000, 0x4000 )
+
+ ROM_REGION( 0x80000, "gfx1", 0 )
+ ROM_LOAD( "13.IC8", 0x00000, 0x10000, CRC(65b76309) SHA1(1e345726e137f4c56d4bf239651c986fd53a16c3) ) /* tiles */
+ ROM_LOAD( "14.IC7", 0x10000, 0x10000, CRC(43a94283) SHA1(d6a05cbc7b996a8e7f1520563f6fada9a59021a4) )
+ ROM_LOAD( "11.IC10", 0x20000, 0x10000, CRC(e61933fb) SHA1(02bc0e1a7a3ce9e15fb83b28ce8fafb0b8d80ebd) )
+ ROM_LOAD( "12.IC9", 0x30000, 0x10000, CRC(ed031eb2) SHA1(905be4d890ff7bb8a4d8ad85b2a11483fb4d67eb) )
+ ROM_LOAD( "09.IC12", 0x40000, 0x10000, CRC(312700ca) SHA1(c79edc9c25f364d0afd79aaa21cfe2fe46044314) )
+ ROM_LOAD( "10.IC11", 0x50000, 0x10000, CRC(de3b0b88) SHA1(14b8871821e4c0abbb9967c5aa282cf4e67884fe) )
+ ROM_LOAD( "07.IC14", 0x60000, 0x10000, CRC(9fdc6c8e) SHA1(ff4e1a98dc982bce2f9d235cac62c7166f477f64) )
+ ROM_LOAD( "08.IC13", 0x70000, 0x10000, CRC(06226492) SHA1(834280ec49e61a0c9c6b6fe2033e1b20bd1bffbf) )
+
+ ROM_REGION( 0xa0000, "gfx2", ROMREGION_INVERT )
+ ROM_LOAD( "15.IC62", 0x00000, 0x10000, CRC(8548db6c) SHA1(675cd301259d5ed16098a38ac58b27b5ccd91264) ) /* sprites */
+ ROM_LOAD( "19.IC61", 0x10000, 0x10000, CRC(89b3d8ee) SHA1(8491de6e8292e58b9a8696be15827bcb1ea42845) )
+ ROM_LOAD( "23.IC60", 0x20000, 0x08000, CRC(662a2f1e) SHA1(1c5e8b1f0623e64faf9cd60f9653fc5957191a9b) )
+ ROM_LOAD( "16.IC78", 0x28000, 0x10000, CRC(925865e1) SHA1(457de50bc03e8b949ac7d46ae4188201e87574a8) )
+ ROM_LOAD( "20.IC77", 0x38000, 0x10000, CRC(b09695d1) SHA1(e6d315f9befb7b47f42668d573a1102e52d78aea) )
+ ROM_LOAD( "24.IC76", 0x48000, 0x08000, CRC(41937743) SHA1(890c832a7cf87e6fe749d4824b02d57e10872bdf) )
+ ROM_LOAD( "17.IC93", 0x50000, 0x10000, CRC(f644eeab) SHA1(9d45e9dfb08e8c90b4b10f5dc383fa4732161a81) )
+ ROM_LOAD( "21.IC92", 0x60000, 0x10000, CRC(16e1b0ff) SHA1(1467a317d07a447d01113e6b6b9f5aca30cb0dcb) )
+ ROM_LOAD( "25.IC91", 0x70000, 0x08000, CRC(d886c014) SHA1(9327c332c98a81451e9e0624344d2601ef06e490) )
+ ROM_LOAD( "18.IC121", 0x78000, 0x10000, CRC(93df1e4d) SHA1(b100d265b973254ec9cd44b6c32f62b4bac3b732) )
+ ROM_LOAD( "22.IC120", 0x88000, 0x10000, CRC(7c4e893b) SHA1(eceecb38554157ee24d228a2c722dad750a6a07d) )
+ ROM_LOAD( "26.IC119", 0x98000, 0x08000, CRC(7e1d58d8) SHA1(d586a018c3ec3e6e6a39992170d324361e03c68a) )
+
+ ROM_REGION( 0x200, "pals", 0 )
+ ROM_LOAD( "JP2.IC56", 0x000, 0x104, CRC(12e9a7b8) SHA1(a0ce8b6083c9adfcb4bdbca87f63a01f292525f3) ) // PAL16R6A-2CN
+ ROM_LOAD( "JP1.IC13", 0x000, 0x144, CRC(76944f81) SHA1(ab78e4e157ffdc13aea5dc360268b2640e60d19c) ) // PAL20L8A-2CNS
+ ROM_LOAD( "JP3.IC51", 0x000, 0x104, CRC(c1e6cb8f) SHA1(9908e62bb9b806047b7a344bb62334bd696b9fc8) ) // PAL16L8A-2CN z80 address decoder?
+ROM_END
DRIVER_INIT_MEMBER(rbisland_state,rbisland)
{
@@ -925,4 +973,5 @@ GAME( 1987, rbisland, 0, rbisland, rbisland, rbisland_state, rbisland,
GAME( 1987, rbislando, rbisland, rbisland, rbisland, rbisland_state, rbisland, ROT0, "Taito Corporation", "Rainbow Islands (old version)", GAME_SUPPORTS_SAVE )
GAME( 1988, rbislande, rbisland, rbisland, rbisland, rbisland_state, rbislande, ROT0, "Taito Corporation", "Rainbow Islands (Extra)", GAME_SUPPORTS_SAVE )
GAME( 1989, jumping, rbisland, jumping, jumping, rbisland_state, jumping, ROT0, "bootleg", "Jumping (set 1)", GAME_SUPPORTS_SAVE )
-GAME( 1989, jumpinga, rbisland, jumping, jumping, rbisland_state, jumping, ROT0, "bootleg (Seyutu)", "Jumping (set 2)", GAME_SUPPORTS_SAVE )
+GAME( 1988, jumpinga, rbisland, jumping, jumping, rbisland_state, jumping, ROT0, "bootleg (Seyutu)", "Jumping (set 2)", GAME_SUPPORTS_SAVE )
+GAME( 1988, jumpingi, rbisland, jumpingi, jumping, rbisland_state, jumping, ROT0, "bootleg (Seyutu)", "Jumping (set 3, Imnoe PCB)", GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/ramtek.c b/src/mame/drivers/ramtek.c
index a7d0683580d..89fc8a9ecab 100644
--- a/src/mame/drivers/ramtek.c
+++ b/src/mame/drivers/ramtek.c
@@ -15,7 +15,7 @@
Lie Detector (1976) UNKNOWN Unreleased Unreleased
Sea Battle (1976/04) UNKNOWN
Soccer (1973/11) YES 500880 500889
- Trivia (1975/11) YES
+ Trivia (1975/11) YES 550436
Volly (1973/03?) YES 500378A 500322A
Wipe Out (1974/01) YES 500986B/C 500963B/?
@@ -25,8 +25,8 @@
Game Name Clone Of
---------------------------------------------------------------------------------
Batter Up (1974/??) Baseball (1974/10)
- Crossfire (1974/01) (registered trademark?) Knock Out (Ramtek, 1974/09)?
Countdown (1974/02) Wipe Out (Ramtek, 1974/01)
+ Crossfire (1974/01) (registered trademark?) Knock Out (Ramtek, 1974/09)?
Elimination (1973/12?) (registered trademark?) unused name for Countdown (1974/02)
Flip-Out (1974/05?) Clean Sweep (Ramtek, 1974/06)
Hockey (1973/??) Hockey (Ramtek, 1973/11)
diff --git a/src/mame/drivers/rastersp.c b/src/mame/drivers/rastersp.c
index 3b01e34fd03..a7397db632c 100644
--- a/src/mame/drivers/rastersp.c
+++ b/src/mame/drivers/rastersp.c
@@ -84,7 +84,7 @@ public:
SPORT_TIMER_COUNTER = 0x45,
SPORT_TIMER_PERIOD = 0x46,
SPORT_DATA_TX = 0x48,
- SPORT_DATA_RX = 0x4c,
+ SPORT_DATA_RX = 0x4c
};
enum irq_status
@@ -93,7 +93,7 @@ public:
IRQ_UART = 2,
IRQ_DSP = 4,
IRQ_VBLANK = 5,
- IRQ_SCSI = 7,
+ IRQ_SCSI = 7
};
required_device<cpu_device> m_maincpu;
diff --git a/src/mame/drivers/rocnrope.c b/src/mame/drivers/rocnrope.c
index 16c5fd25116..cd39c4af89e 100644
--- a/src/mame/drivers/rocnrope.c
+++ b/src/mame/drivers/rocnrope.c
@@ -199,7 +199,7 @@ INTERRUPT_GEN_MEMBER(rocnrope_state::vblank_irq)
static MACHINE_CONFIG_START( rocnrope, rocnrope_state )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", M6809, MASTER_CLOCK / 3 / 4) /* Verified in schematics */
+ MCFG_CPU_ADD("maincpu", KONAMI1, MASTER_CLOCK / 3 / 4) /* Verified in schematics */
MCFG_CPU_PROGRAM_MAP(rocnrope_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", rocnrope_state, vblank_irq)
@@ -356,14 +356,11 @@ ROM_END
DRIVER_INIT_MEMBER(rocnrope_state,rocnrope)
{
- UINT8 *decrypted = konami1_decode(machine(), "maincpu");
-
- decrypted[0x703d] = 0x98; /* fix one instruction */
+ memregion("maincpu")->base()[0x703d] = 0x98^0x88; /* fix one instruction */
}
DRIVER_INIT_MEMBER(rocnrope_state,rocnropk)
{
- konami1_decode(machine(), "maincpu");
}
diff --git a/src/mame/drivers/rohga.c b/src/mame/drivers/rohga.c
index 8f4cda6f672..8f423eb1ea8 100644
--- a/src/mame/drivers/rohga.c
+++ b/src/mame/drivers/rohga.c
@@ -1453,11 +1453,13 @@ ROM_START( wizdfire )
ROM_LOAD16_BYTE( "mas08", 0x000001, 0x080000, CRC(e224fb7a) SHA1(9aa92fb98bddff313db2077c4db102e94c7af09b) ) /* Sprites #2 */
ROM_LOAD16_BYTE( "mas09", 0x000000, 0x080000, CRC(5f6deb41) SHA1(850d0e157b4355e866ec770a2012293b2c55648f) )
- ROM_REGION(0x80000, "oki1", 0 ) /* Oki samples */
- ROM_LOAD( "mas10", 0x00000, 0x80000, CRC(6edc06a7) SHA1(8ab92cca9d4a5d4fed3d99737c6f023f3f606db2) )
+ ROM_REGION(0x100000, "oki1", 0 ) /* Oki samples */
+ // hack, sample banks 0/1 are used for the Japanese version and 2/3 are used for the English version, I can't find the bankswitch, so swap the halves.
+ ROM_LOAD( "mas10", 0x80000, 0x80000, CRC(f4b4c8a1) SHA1(c9e80c55e42a78e358b6b14dadc3be7b28bd5d62) )
+ ROM_CONTINUE(0x00000, 0x80000)
- ROM_REGION(0x80000, "oki2", 0 ) /* Oki samples */
- ROM_LOAD( "mas11", 0x00000, 0x80000, CRC(c2f0a4f2) SHA1(af71d649aea273c17d7fbcf8693e8a1d4b31f7f8) )
+ ROM_REGION(0x080000, "oki2", 0 ) /* Oki samples */
+ ROM_LOAD( "mas11", 0x00000, 0x080000, CRC(c2f0a4f2) SHA1(af71d649aea273c17d7fbcf8693e8a1d4b31f7f8) )
ROM_REGION( 1024, "proms", 0 )
ROM_LOAD( "mb7122h.16l", 0x00000, 0x400, CRC(2bee57cc) SHA1(bc48670aa7c39f6ff7fae4c819eab22ed2db875b) ) /* Priority (unused) */
@@ -1497,11 +1499,13 @@ ROM_START( wizdfireu )
ROM_LOAD16_BYTE( "mas08", 0x000001, 0x080000, CRC(e224fb7a) SHA1(9aa92fb98bddff313db2077c4db102e94c7af09b) ) /* Sprites #2 */
ROM_LOAD16_BYTE( "mas09", 0x000000, 0x080000, CRC(5f6deb41) SHA1(850d0e157b4355e866ec770a2012293b2c55648f) )
- ROM_REGION(0x80000, "oki1", 0 ) /* Oki samples */
- ROM_LOAD( "mas10", 0x00000, 0x80000, CRC(6edc06a7) SHA1(8ab92cca9d4a5d4fed3d99737c6f023f3f606db2) )
+ ROM_REGION(0x100000, "oki1", 0 ) /* Oki samples */
+ // hack, sample banks 0/1 are used for the Japanese version and 2/3 are used for the English version, I can't find the bankswitch, so swap the halves
+ ROM_LOAD( "mas10", 0x80000, 0x80000, CRC(f4b4c8a1) SHA1(c9e80c55e42a78e358b6b14dadc3be7b28bd5d62) )
+ ROM_CONTINUE(0x00000, 0x80000)
- ROM_REGION(0x80000, "oki2", 0 ) /* Oki samples */
- ROM_LOAD( "mas11", 0x00000, 0x80000, CRC(c2f0a4f2) SHA1(af71d649aea273c17d7fbcf8693e8a1d4b31f7f8) )
+ ROM_REGION(0x080000, "oki2", 0 ) /* Oki samples */
+ ROM_LOAD( "mas11", 0x00000, 0x080000, CRC(c2f0a4f2) SHA1(af71d649aea273c17d7fbcf8693e8a1d4b31f7f8) )
ROM_REGION( 1024, "proms", 0 )
ROM_LOAD( "mb7122h.16l", 0x00000, 0x400, CRC(2bee57cc) SHA1(bc48670aa7c39f6ff7fae4c819eab22ed2db875b) ) /* Priority (unused) */
@@ -1541,11 +1545,11 @@ ROM_START( darkseal2 )
ROM_LOAD16_BYTE( "mas08", 0x000001, 0x080000, CRC(e224fb7a) SHA1(9aa92fb98bddff313db2077c4db102e94c7af09b) ) /* Sprites #2 */
ROM_LOAD16_BYTE( "mas09", 0x000000, 0x080000, CRC(5f6deb41) SHA1(850d0e157b4355e866ec770a2012293b2c55648f) )
- ROM_REGION(0x80000, "oki1", 0 ) /* Oki samples */
- ROM_LOAD( "mas10", 0x00000, 0x80000, BAD_DUMP CRC(6edc06a7) SHA1(8ab92cca9d4a5d4fed3d99737c6f023f3f606db2) ) // Incorrect ROM for this version
+ ROM_REGION(0x100000, "oki1", 0 ) /* Oki samples */
+ ROM_LOAD( "mas10", 0x00000, 0x100000, CRC(f4b4c8a1) SHA1(c9e80c55e42a78e358b6b14dadc3be7b28bd5d62) )
- ROM_REGION(0x80000, "oki2", 0 ) /* Oki samples */
- ROM_LOAD( "mas11", 0x00000, 0x80000, CRC(c2f0a4f2) SHA1(af71d649aea273c17d7fbcf8693e8a1d4b31f7f8) )
+ ROM_REGION(0x080000, "oki2", 0 ) /* Oki samples */
+ ROM_LOAD( "mas11", 0x00000, 0x080000, CRC(c2f0a4f2) SHA1(af71d649aea273c17d7fbcf8693e8a1d4b31f7f8) )
ROM_REGION( 1024, "proms", 0 )
ROM_LOAD( "mb7122h.16l", 0x00000, 0x400, CRC(2bee57cc) SHA1(bc48670aa7c39f6ff7fae4c819eab22ed2db875b) ) /* Priority (unused) */
diff --git a/src/mame/drivers/route16.c b/src/mame/drivers/route16.c
index 6398361ae81..8d362e08ca5 100644
--- a/src/mame/drivers/route16.c
+++ b/src/mame/drivers/route16.c
@@ -982,6 +982,6 @@ GAME( 1980, speakres, 0, speakres, speakres, driver_device, 0, ROT
GAME( 1980, speakresb,speakres, speakres, speakres, driver_device, 0, ROT270, "bootleg", "Speak & Rescue (bootleg)", GAME_SUPPORTS_SAVE )
GAME( 1980, stratvox, speakres, stratvox, stratvox, driver_device, 0, ROT270, "Sun Electronics (Taito license)", "Stratovox", GAME_SUPPORTS_SAVE )
GAME( 1980, stratvoxb,speakres, stratvox, stratvox, driver_device, 0, ROT270, "bootleg", "Stratovox (bootleg)", GAME_SUPPORTS_SAVE )
-GAME( 1980, spacecho, speakres, spacecho, spacecho, driver_device, 0, ROT270, "bootleg", "Space Echo (set 1)", GAME_SUPPORTS_SAVE )
-GAME( 1980, spacecho2,speakres, spacecho, spacecho, driver_device, 0, ROT270, "bootleg", "Space Echo (set 2)", GAME_SUPPORTS_SAVE )
+GAME( 1980, spacecho, speakres, spacecho, spacecho, driver_device, 0, ROT270, "bootleg (Gayton Games)", "Space Echo (set 1)", GAME_SUPPORTS_SAVE )
+GAME( 1980, spacecho2,speakres, spacecho, spacecho, driver_device, 0, ROT270, "bootleg (Gayton Games)", "Space Echo (set 2)", GAME_SUPPORTS_SAVE )
GAME( 1981, ttmahjng, 0, ttmahjng, ttmahjng, driver_device, 0, ROT0, "Taito", "T.T Mahjong", GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/royalmah.c b/src/mame/drivers/royalmah.c
index b2fcac39f6e..8ba70c82847 100644
--- a/src/mame/drivers/royalmah.c
+++ b/src/mame/drivers/royalmah.c
@@ -132,9 +132,10 @@ public:
UINT8 m_flip_screen;
DECLARE_WRITE8_MEMBER(royalmah_palbank_w);
+ DECLARE_WRITE8_MEMBER(royalmah_rom_w);
+ DECLARE_WRITE8_MEMBER(tahjong_bank_w);
DECLARE_WRITE8_MEMBER(mjderngr_coin_w);
DECLARE_WRITE8_MEMBER(mjderngr_palbank_w);
- DECLARE_WRITE8_MEMBER(royalmah_rom_w);
DECLARE_WRITE8_MEMBER(input_port_select_w);
DECLARE_READ8_MEMBER(majs101b_dsw_r);
DECLARE_READ8_MEMBER(suzume_dsw_r);
@@ -404,6 +405,21 @@ READ8_MEMBER(royalmah_state::suzume_dsw_r)
}
}
+WRITE8_MEMBER(royalmah_state::tahjong_bank_w)
+{
+ UINT8 *rom = memregion("maincpu")->base();
+ int address;
+
+logerror("%04x: bank %02x\n",space.device().safe_pc(),data);
+
+ data &= 0x01;
+
+ address = 0x10000 + data * 0x4000;
+
+ membank("bank1")->set_base(&rom[address]);
+}
+
+
WRITE8_MEMBER(royalmah_state::suzume_bank_w)
{
UINT8 *rom = memregion("maincpu")->base();
@@ -541,7 +557,6 @@ static ADDRESS_MAP_START( royalmah_map, AS_PROGRAM, 8, royalmah_state )
AM_RANGE( 0x8000, 0xffff ) AM_WRITEONLY AM_SHARE("videoram")
ADDRESS_MAP_END
-
static ADDRESS_MAP_START( mjapinky_map, AS_PROGRAM, 8, royalmah_state )
AM_RANGE( 0x0000, 0x6fff ) AM_ROM AM_WRITE(royalmah_rom_w )
AM_RANGE( 0x7000, 0x77ff ) AM_RAM AM_SHARE("nvram")
@@ -551,6 +566,13 @@ static ADDRESS_MAP_START( mjapinky_map, AS_PROGRAM, 8, royalmah_state )
AM_RANGE( 0x8000, 0xffff ) AM_WRITEONLY AM_SHARE("videoram")
ADDRESS_MAP_END
+static ADDRESS_MAP_START( tahjong_map, AS_PROGRAM, 8, royalmah_state )
+ AM_RANGE( 0x0000, 0x3fff ) AM_ROM AM_WRITE(royalmah_rom_w )
+ AM_RANGE( 0x4000, 0x6fff ) AM_ROMBANK( "bank1" ) AM_WRITE(royalmah_rom_w )
+ AM_RANGE( 0x7000, 0x7fff ) AM_RAM AM_SHARE("nvram")
+ AM_RANGE( 0x8000, 0xffff ) AM_WRITEONLY AM_SHARE("videoram")
+ADDRESS_MAP_END
+
@@ -572,6 +594,16 @@ static ADDRESS_MAP_START( ippatsu_iomap, AS_IO, 8, royalmah_state )
AM_RANGE( 0x13, 0x13 ) AM_READ_PORT("DSW3")
ADDRESS_MAP_END
+static ADDRESS_MAP_START( tahjong_iomap, AS_IO, 8, royalmah_state )
+ ADDRESS_MAP_GLOBAL_MASK(0xff)
+ AM_RANGE( 0x01, 0x01 ) AM_DEVREAD("aysnd", ay8910_device, data_r)
+ AM_RANGE( 0x02, 0x03 ) AM_DEVWRITE("aysnd", ay8910_device, data_address_w)
+ AM_RANGE( 0x10, 0x10 ) AM_READ_PORT("DSW1") AM_WRITE(royalmah_palbank_w )
+ AM_RANGE( 0x11, 0x11 ) AM_READ_PORT("SYSTEM") AM_WRITE(input_port_select_w )
+ AM_RANGE( 0x12, 0x12 ) AM_WRITE(tahjong_bank_w)
+ AM_RANGE( 0x13, 0x13 ) AM_READ_PORT("DSW2")
+ADDRESS_MAP_END
+
static ADDRESS_MAP_START( suzume_iomap, AS_IO, 8, royalmah_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE( 0x01, 0x01 ) AM_DEVREAD("aysnd", ay8910_device, data_r)
@@ -676,7 +708,6 @@ static ADDRESS_MAP_START( mjapinky_iomap, AS_IO, 8, royalmah_state )
AM_RANGE( 0x11, 0x11 ) AM_READ_PORT("SYSTEM") AM_WRITE(input_port_select_w )
ADDRESS_MAP_END
-
static ADDRESS_MAP_START( janoh_map, AS_PROGRAM, 8, royalmah_state )
AM_RANGE( 0x0000, 0x6fff ) AM_ROM AM_WRITE(royalmah_rom_w )
AM_RANGE( 0x7000, 0x7fff ) AM_RAM AM_SHARE("nvram")
@@ -1415,6 +1446,58 @@ static INPUT_PORTS_START( royalmah )
PORT_DIPSETTING( 0x80, DEF_STR( On ) )
INPUT_PORTS_END
+static INPUT_PORTS_START( tahjong )
+ PORT_INCLUDE( mjctrl1 )
+
+ PORT_MODIFY("KEY5")
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) // "COIN2"
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN3 ) // "COIN1", but not working
+
+ PORT_START("DSW1") // port $10
+ PORT_DIPNAME( 0x07, 0x07, "SWB:1,2,3" ) PORT_DIPLOCATION("SWB:1,2,3") // only with bets on
+ PORT_DIPSETTING( 0x00, "0" )
+ PORT_DIPSETTING( 0x01, "1" )
+ PORT_DIPSETTING( 0x02, "2" )
+ PORT_DIPSETTING( 0x03, "3" )
+ PORT_DIPSETTING( 0x04, "4" )
+ PORT_DIPSETTING( 0x05, "5" )
+ PORT_DIPSETTING( 0x06, "5 (6)" )
+ PORT_DIPSETTING( 0x07, "5 (7)" )
+ PORT_DIPUNKNOWN_DIPLOC(0x08, 0x08, "SWB:4")
+ PORT_DIPUNKNOWN_DIPLOC(0x10, 0x10, "SWB:5")
+ PORT_DIPNAME( 0x60, 0x60, "Winnings" ) PORT_DIPLOCATION("SWB:6,7")
+ PORT_DIPSETTING( 0x40, "30 30 10 10 5 5 1 1" )
+ PORT_DIPSETTING( 0x20, "32 24 16 12 8 4 2 1" )
+ PORT_DIPSETTING( 0x60, "100 50 30 10 5 4 3 2" )
+ PORT_DIPSETTING( 0x00, "200 50 30 10 5 4 3 2" )
+ PORT_DIPUNKNOWN_DIPLOC(0x80, 0x80, "SWB:8")
+
+ PORT_START("DSW2") // port $13
+ PORT_DIPNAME( 0x07, 0x07, "Pay Out Rate" ) PORT_DIPLOCATION("SWA:1,2,3")
+ PORT_DIPSETTING( 0x00, "50%" )
+ PORT_DIPSETTING( 0x04, "62%" )
+ PORT_DIPSETTING( 0x02, "68%" )
+ PORT_DIPSETTING( 0x06, "71%" )
+ PORT_DIPSETTING( 0x01, "75%" )
+ PORT_DIPSETTING( 0x05, "78%" )
+ PORT_DIPSETTING( 0x03, "81%" )
+ PORT_DIPSETTING( 0x07, "90%" )
+ PORT_DIPNAME( 0x18, 0x18, "Maximum Bet" ) PORT_DIPLOCATION("SWA:4,5")
+ PORT_DIPSETTING( 0x00, "1" )
+ PORT_DIPSETTING( 0x08, "5" )
+ PORT_DIPSETTING( 0x10, "10" )
+ PORT_DIPSETTING( 0x18, "20" )
+ PORT_DIPNAME( 0x20, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SWA:6")
+ PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
+ PORT_DIPSETTING( 0x20, DEF_STR( 1C_2C ) )
+ PORT_DIPNAME( 0x40, 0x40, "Allow Bets" ) PORT_DIPLOCATION("SWA:7")
+ PORT_DIPSETTING( 0x00, DEF_STR( No ) )
+ PORT_DIPSETTING( 0x40, DEF_STR( Yes ) )
+ PORT_DIPNAME( 0x80, 0x80, "Note Rate" ) PORT_DIPLOCATION("SWA:8")
+ PORT_DIPSETTING( 0x00, "5" )
+ PORT_DIPSETTING( 0x80, "10" )
+INPUT_PORTS_END
+
static INPUT_PORTS_START( janyoup2 )
PORT_INCLUDE( royalmah )
@@ -3280,6 +3363,13 @@ static MACHINE_CONFIG_DERIVED( dondenmj, royalmah )
MCFG_CPU_IO_MAP(dondenmj_iomap)
MACHINE_CONFIG_END
+static MACHINE_CONFIG_DERIVED( tahjong, royalmah )
+ MCFG_CPU_MODIFY("maincpu")
+ MCFG_CPU_CLOCK(8000000/2) /* 4 MHz ? */
+ MCFG_CPU_PROGRAM_MAP(tahjong_map)
+ MCFG_CPU_IO_MAP(tahjong_iomap)
+MACHINE_CONFIG_END
+
static MACHINE_CONFIG_DERIVED( makaijan, royalmah )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_CLOCK(8000000/2) /* 4 MHz ? */
@@ -3509,6 +3599,22 @@ ROM_START( openmj )
ROM_LOAD( "82s123.prm", 0x00, 0x20, CRC(d3007282) SHA1(e4d863ab193e49208ed0f59dcddb1da0492314f6) )
ROM_END
+ROM_START( tahjong )
+ ROM_REGION( 0x20000, "maincpu", 0 )
+ ROM_LOAD( "p1.bin", 0x00000, 0x1000, CRC(49c922b3) SHA1(6672a4f739d428b722ab22e7ca93064211557abc) )
+ ROM_LOAD( "p2.bin", 0x01000, 0x1000, CRC(c33e3cc3) SHA1(707c437f180ddd2916b5806f208e0a478207d528) )
+ ROM_LOAD( "p3.bin", 0x02000, 0x1000, CRC(9e741a74) SHA1(6c8e8eb04331d48b72e2be270c13dbf8deb76005) )
+ ROM_LOAD( "p4.bin", 0x03000, 0x1000, CRC(dc6ae62b) SHA1(d0c51047f734c885b7f19972c1bf0408199fde51) )
+ ROM_LOAD( "p5.bin", 0x04000, 0x1000, CRC(cc9123a3) SHA1(75276045247a0c9ac5810be01f3b58ad63101f9b) ) // same as royalmj (unused)
+ ROM_LOAD( "p6.bin", 0x05000, 0x1000, CRC(92150a0f) SHA1(5c97ba5014abdba4afc78e02e7d90e6ca4d777ac) ) // ""
+
+ ROM_LOAD( "s1.bin", 0x10000, 0x4000, CRC(beff21af) SHA1(4dc40a1ac4e36401b1ad8ae3954af6e5001e0a67) )
+ ROM_LOAD( "s2.bin", 0x14000, 0x4000, CRC(fed42e7c) SHA1(31136dff07bd1883dc2d107823ba83a34abf003d) )
+
+ ROM_REGION( 0x0020, "proms", 0 )
+ ROM_LOAD( "18s030n.6k", 0x0000, 0x0020, NO_DUMP )
+ROM_END
+
ROM_START( janputer )
ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF )
ROM_LOAD( "1.bin", 0x0000, 0x2000, CRC(f36f4222) SHA1(ce18c273a59f86cb17ea6ba8a3daefc3d750df1e) )
@@ -4800,40 +4906,41 @@ DRIVER_INIT_MEMBER(royalmah_state,janptr96)
machine().device<nvram_device>("nvram")->set_base(m_janptr96_nvram, 0x1000 * 9);
}
-GAME( 1981, royalmj, 0, royalmah, royalmah, driver_device, 0, ROT0, "Nichibutsu", "Royal Mahjong (Japan, v1.13)", 0 )
-GAME( 1981?, openmj, royalmj, royalmah, royalmah, driver_device, 0, ROT0, "Sapporo Mechanic", "Open Mahjong [BET] (Japan)", 0 )
-GAME( 1982, royalmah, royalmj, royalmah, royalmah, driver_device, 0, ROT0, "bootleg", "Royal Mahjong (Falcon bootleg, v1.01)", 0 )
-GAME( 1983, janyoup2, royalmj, ippatsu, janyoup2, driver_device, 0, ROT0, "Cosmo Denshi", "Janyou Part II (ver 7.03, July 1 1983)",0 )
-GAME( 1981, janputer, 0, royalmah, royalmah, driver_device, 0, ROT0, "bootleg (Public Software Ltd. / Mes)", "New Double Bet Mahjong (bootleg of Janputer)", 0 ) // the original Janputer (Sanritsu) is not yet dumped
-GAME( 1984, janoh, 0, royalmah, royalmah, driver_device, 0, ROT0, "Toaplan", "Jan Oh (set 1)", GAME_NOT_WORKING )
-GAME( 1984, janoha, janoh, janoh, royalmah, driver_device, 0, ROT0, "Toaplan", "Jan Oh (set 2)", GAME_NOT_WORKING ) // this one is complete?
-GAME( 1985, jansou, 0, jansou, jansou, driver_device, 0, ROT0, "Dyna", "Jansou (set 1)", GAME_NOT_WORKING|GAME_NO_SOUND )
-GAME( 1985, jansoua, jansou, jansou, jansou, driver_device, 0, ROT0, "Dyna", "Jansou (set 2)", 0 )
-GAME( 1986, dondenmj, 0, dondenmj, majs101b, driver_device, 0, ROT0, "Dyna Electronics", "Don Den Mahjong [BET] (Japan)", 0 )
-GAME( 1986, ippatsu, 0, ippatsu, ippatsu, royalmah_state, ippatsu, ROT0, "Public Software / Paradais", "Ippatsu Gyakuten [BET] (Japan)", 0 )
-GAME( 1986, suzume, 0, suzume, suzume, driver_device, 0, ROT0, "Dyna Electronics", "Watashiha Suzumechan (Japan)", 0 )
-GAME( 1986, mjsiyoub, 0, royalmah, royalmah, driver_device, 0, ROT0, "Visco", "Mahjong Shiyou (Japan)", GAME_NOT_WORKING )
-GAME( 1986, mjsenka, 0, royalmah, royalmah, driver_device, 0, ROT0, "Visco", "Mahjong Senka (Japan)", GAME_NOT_WORKING )
-GAME( 1986, mjyarou, 0, royalmah, royalmah, driver_device, 0, ROT0, "Visco / Video System", "Mahjong Yarou [BET] (Japan)", GAME_NOT_WORKING )
-GAME( 1986?, mjclub, 0, mjclub, mjclub, driver_device, 0, ROT0, "Xex", "Mahjong Club [BET] (Japan)", 0 )
-GAME( 1987, mjdiplob, 0, mjdiplob, mjdiplob, driver_device, 0, ROT0, "Dynax", "Mahjong Diplomat [BET] (Japan)", 0 )
-GAME( 1987, tontonb, 0, tontonb, tontonb, driver_device, 0, ROT0, "Dynax", "Tonton [BET] (Japan set 1)", 0 )
-GAME( 1987, makaijan, 0, makaijan, makaijan, driver_device, 0, ROT0, "Dynax", "Makaijan [BET] (Japan)", 0 )
-GAME( 1988, majs101b, 0, majs101b, majs101b, driver_device, 0, ROT0, "Dynax", "Mahjong Studio 101 [BET] (Japan)", 0 )
-GAME( 1988, mjapinky, 0, mjapinky, mjapinky, driver_device, 0, ROT0, "Dynax", "Almond Pinky [BET] (Japan)", 0 )
-GAME( 1989, mjdejavu, 0, mjdejavu, mjdejavu, driver_device, 0, ROT0, "Dynax", "Mahjong Shinkirou Deja Vu (Japan)", 0 )
-GAME( 1989, mjdejav2, mjdejavu, mjdejavu, mjdejavu, driver_device, 0, ROT0, "Dynax", "Mahjong Shinkirou Deja Vu 2 (Japan)", 0 )
-GAME( 1989, mjderngr, 0, mjderngr, mjderngr, driver_device, 0, ROT0, "Dynax", "Mahjong Derringer (Japan)", 0 )
-GAME( 1989, daisyari, 0, daisyari, daisyari, driver_device, 0, ROT0, "Best System", "Daisyarin [BET] (Japan)", 0 )
-GAME( 1990, mjifb, 0, mjifb, mjifb, driver_device, 0, ROT0, "Dynax", "Mahjong If...? [BET]", 0 )
-GAME( 1990, mjifb2, mjifb, mjifb, mjifb, driver_device, 0, ROT0, "Dynax", "Mahjong If...? [BET](2921)", 0 )
-GAME( 1990, mjifb3, mjifb, mjifb, mjifb, driver_device, 0, ROT0, "Dynax", "Mahjong If...? [BET](2931)", 0 )
-GAME( 1991, mjvegasa, 0, mjvegasa, mjvegasa, driver_device, 0, ROT0, "Dynax", "Mahjong Vegas (Japan, unprotected)", 0 )
-GAME( 1991, mjvegas, mjvegasa, mjvegasa, mjvegasa, driver_device, 0, ROT0, "Dynax", "Mahjong Vegas (Japan)", GAME_NOT_WORKING )
-GAME( 1992, cafetime, 0, cafetime, cafetime, driver_device, 0, ROT0, "Dynax", "Mahjong Cafe Time", 0 )
-GAME( 1993, cafedoll, 0, mjifb, mjifb, driver_device, 0, ROT0, "Dynax", "Mahjong Cafe Doll (Japan)", GAME_NOT_WORKING )
-GAME( 1995, mjtensin, 0, mjtensin, mjtensin, driver_device, 0, ROT0, "Dynax", "Mahjong Tensinhai (Japan)", GAME_NOT_WORKING )
+GAME( 1981, royalmj, 0, royalmah, royalmah, driver_device, 0, ROT0, "Nichibutsu", "Royal Mahjong (Japan, v1.13)", 0 )
+GAME( 1981?, openmj, royalmj, royalmah, royalmah, driver_device, 0, ROT0, "Sapporo Mechanic", "Open Mahjong [BET] (Japan)", 0 )
+GAME( 1982, royalmah, royalmj, royalmah, royalmah, driver_device, 0, ROT0, "bootleg", "Royal Mahjong (Falcon bootleg, v1.01)", 0 )
+GAME( 1983, janyoup2, royalmj, ippatsu, janyoup2, driver_device, 0, ROT0, "Cosmo Denshi", "Janyou Part II (ver 7.03, July 1 1983)",0 )
+GAME( 1985, tahjong, royalmj, tahjong, tahjong, driver_device, 0, ROT0, "Bally Pond / Nasco", "Tahjong Yakitori (ver. 2-1)", GAME_WRONG_COLORS ) // 1985 Jun. 17
+GAME( 1981, janputer, 0, royalmah, royalmah, driver_device, 0, ROT0, "bootleg (Public Software Ltd. / Mes)", "New Double Bet Mahjong (bootleg of Janputer)", 0 ) // the original Janputer (Sanritsu) is not yet dumped
+GAME( 1984, janoh, 0, royalmah, royalmah, driver_device, 0, ROT0, "Toaplan", "Jan Oh (set 1)", GAME_NOT_WORKING )
+GAME( 1984, janoha, janoh, janoh, royalmah, driver_device, 0, ROT0, "Toaplan", "Jan Oh (set 2)", GAME_NOT_WORKING ) // this one is complete?
+GAME( 1985, jansou, 0, jansou, jansou, driver_device, 0, ROT0, "Dyna", "Jansou (set 1)", GAME_NOT_WORKING|GAME_NO_SOUND )
+GAME( 1985, jansoua, jansou, jansou, jansou, driver_device, 0, ROT0, "Dyna", "Jansou (set 2)", 0 )
+GAME( 1986, dondenmj, 0, dondenmj, majs101b, driver_device, 0, ROT0, "Dyna Electronics", "Don Den Mahjong [BET] (Japan)", 0 )
+GAME( 1986, ippatsu, 0, ippatsu, ippatsu, royalmah_state, ippatsu, ROT0, "Public Software / Paradais", "Ippatsu Gyakuten [BET] (Japan)", 0 )
+GAME( 1986, suzume, 0, suzume, suzume, driver_device, 0, ROT0, "Dyna Electronics", "Watashiha Suzumechan (Japan)", 0 )
+GAME( 1986, mjsiyoub, 0, royalmah, royalmah, driver_device, 0, ROT0, "Visco", "Mahjong Shiyou (Japan)", GAME_NOT_WORKING )
+GAME( 1986, mjsenka, 0, royalmah, royalmah, driver_device, 0, ROT0, "Visco", "Mahjong Senka (Japan)", GAME_NOT_WORKING )
+GAME( 1986, mjyarou, 0, royalmah, royalmah, driver_device, 0, ROT0, "Visco / Video System", "Mahjong Yarou [BET] (Japan)", GAME_NOT_WORKING )
+GAME( 1986?, mjclub, 0, mjclub, mjclub, driver_device, 0, ROT0, "Xex", "Mahjong Club [BET] (Japan)", 0 )
+GAME( 1987, mjdiplob, 0, mjdiplob, mjdiplob, driver_device, 0, ROT0, "Dynax", "Mahjong Diplomat [BET] (Japan)", 0 )
+GAME( 1987, tontonb, 0, tontonb, tontonb, driver_device, 0, ROT0, "Dynax", "Tonton [BET] (Japan set 1)", 0 )
+GAME( 1987, makaijan, 0, makaijan, makaijan, driver_device, 0, ROT0, "Dynax", "Makaijan [BET] (Japan)", 0 )
+GAME( 1988, majs101b, 0, majs101b, majs101b, driver_device, 0, ROT0, "Dynax", "Mahjong Studio 101 [BET] (Japan)", 0 )
+GAME( 1988, mjapinky, 0, mjapinky, mjapinky, driver_device, 0, ROT0, "Dynax", "Almond Pinky [BET] (Japan)", 0 )
+GAME( 1989, mjdejavu, 0, mjdejavu, mjdejavu, driver_device, 0, ROT0, "Dynax", "Mahjong Shinkirou Deja Vu (Japan)", 0 )
+GAME( 1989, mjdejav2, mjdejavu, mjdejavu, mjdejavu, driver_device, 0, ROT0, "Dynax", "Mahjong Shinkirou Deja Vu 2 (Japan)", 0 )
+GAME( 1989, mjderngr, 0, mjderngr, mjderngr, driver_device, 0, ROT0, "Dynax", "Mahjong Derringer (Japan)", 0 )
+GAME( 1989, daisyari, 0, daisyari, daisyari, driver_device, 0, ROT0, "Best System", "Daisyarin [BET] (Japan)", 0 )
+GAME( 1990, mjifb, 0, mjifb, mjifb, driver_device, 0, ROT0, "Dynax", "Mahjong If...? [BET]", 0 )
+GAME( 1990, mjifb2, mjifb, mjifb, mjifb, driver_device, 0, ROT0, "Dynax", "Mahjong If...? [BET](2921)", 0 )
+GAME( 1990, mjifb3, mjifb, mjifb, mjifb, driver_device, 0, ROT0, "Dynax", "Mahjong If...? [BET](2931)", 0 )
+GAME( 1991, mjvegasa, 0, mjvegasa, mjvegasa, driver_device, 0, ROT0, "Dynax", "Mahjong Vegas (Japan, unprotected)", 0 )
+GAME( 1991, mjvegas, mjvegasa, mjvegasa, mjvegasa, driver_device, 0, ROT0, "Dynax", "Mahjong Vegas (Japan)", GAME_NOT_WORKING )
+GAME( 1992, cafetime, 0, cafetime, cafetime, driver_device, 0, ROT0, "Dynax", "Mahjong Cafe Time", 0 )
+GAME( 1993, cafedoll, 0, mjifb, mjifb, driver_device, 0, ROT0, "Dynax", "Mahjong Cafe Doll (Japan)", GAME_NOT_WORKING )
+GAME( 1995, mjtensin, 0, mjtensin, mjtensin, driver_device, 0, ROT0, "Dynax", "Mahjong Tensinhai (Japan)", GAME_NOT_WORKING )
GAME( 1996, janptr96, 0, janptr96, janptr96, royalmah_state, janptr96, ROT0, "Dynax", "Janputer '96 (Japan)", 0 )
GAME( 1997, janptrsp, 0, janptr96, janptr96, royalmah_state, janptr96, ROT0, "Dynax", "Janputer Special (Japan)", 0 )
-GAME( 1999, cafebrk, 0, mjifb, mjifb, driver_device, 0, ROT0, "Nakanihon / Dynax", "Mahjong Cafe Break", GAME_NOT_WORKING )
-GAME( 1999, cafepara, 0, mjifb, mjifb, driver_device, 0, ROT0, "Techno-Top", "Mahjong Cafe Paradise", GAME_NOT_WORKING )
+GAME( 1999, cafebrk, 0, mjifb, mjifb, driver_device, 0, ROT0, "Nakanihon / Dynax", "Mahjong Cafe Break", GAME_NOT_WORKING )
+GAME( 1999, cafepara, 0, mjifb, mjifb, driver_device, 0, ROT0, "Techno-Top", "Mahjong Cafe Paradise", GAME_NOT_WORKING )
diff --git a/src/mame/drivers/rungun.c b/src/mame/drivers/rungun.c
index 16ea4753484..985b1c5acd8 100644
--- a/src/mame/drivers/rungun.c
+++ b/src/mame/drivers/rungun.c
@@ -484,6 +484,52 @@ ROM_START( runguna )
ROM_LOAD( "runguna.nv", 0x0000, 0x080, CRC(7bbf0e3c) SHA1(0fd3c9400e9b97a06517e0c8620f773a383100fd) )
ROM_END
+// This set fails the rom checks on 18n,16n and 21n even on real hardware but is clearly a different code revision to the above sets.
+// The rom at 21N is the same between all sets so it failing makes very little sense.
+// The date code places this at month before the other EAA sets, so maybe it's a prototype and the checksums in the ROM hadn't
+// been finalized yet.
+
+ROM_START( rungunb )
+ /* main program Europe Version AA 1993, 9.10 */
+ ROM_REGION( 0x300000, "maincpu", 0)
+ ROM_LOAD16_BYTE( "4.18n", 0x000000, 0x80000, CRC(d6515edb) SHA1(4c30c5df231945027a7d3c54e250b0a246ae3b17))
+ ROM_LOAD16_BYTE( "5.16n", 0x000001, 0x80000, CRC(f2f03eec) SHA1(081fd43b83e148694d34349b826bd02e0a1f85c9))
+
+ /* data (Guru 1 megabyte redump) */
+ ROM_LOAD16_BYTE( "247b01.23n", 0x200000, 0x80000, CRC(2d774f27) SHA1(c48de9cb9daba25603b8278e672f269807aa0b20) )
+ ROM_CONTINUE( 0x100000, 0x80000)
+ ROM_LOAD16_BYTE( "247b02.21n", 0x200001, 0x80000, CRC(d088c9de) SHA1(19d7ad4120f7cfed9cae862bb0c799fdad7ab15c) )
+ ROM_CONTINUE( 0x100001, 0x80000)
+
+ /* sound program */
+ ROM_REGION( 0x030000, "soundcpu", 0 )
+ ROM_LOAD("1.13g", 0x000000, 0x20000, CRC(c0b35df9) SHA1(a0c73d993eb32bd0cd192351b5f86794efd91949) )
+ ROM_RELOAD( 0x010000, 0x20000 )
+
+ /* '936 tiles */
+ ROM_REGION( 0x400000, "gfx1", 0)
+ ROM_LOAD( "247-a13", 0x000000, 0x200000, CRC(cc194089) SHA1(b5af94f5f583d282ac1499b371bbaac8b2fedc03) )
+
+ /* sprites */
+ ROM_REGION( 0x800000, "gfx2", 0)
+ ROM_LOAD64_WORD( "247-a11", 0x000000, 0x200000, CRC(c3f60854) SHA1(cbee7178ab9e5aa6a5aeed0511e370e29001fb01) ) // 5y
+ ROM_LOAD64_WORD( "247-a08", 0x000002, 0x200000, CRC(3e315eef) SHA1(898bc4d5ad244e5f91cbc87820b5d0be99ef6662) ) // 2u
+ ROM_LOAD64_WORD( "247-a09", 0x000004, 0x200000, CRC(5ca7bc06) SHA1(83c793c68227399f93bd1ed167dc9ed2aaac4167) ) // 2y
+ ROM_LOAD64_WORD( "247-a10", 0x000006, 0x200000, CRC(a5ccd243) SHA1(860b88ade1a69f8b6c5b8206424814b386343571) ) // 5u
+
+ /* TTL text plane ("fix layer") */
+ ROM_REGION( 0x20000, "gfx3", 0)
+ ROM_LOAD( "247-a12", 0x000000, 0x20000, CRC(57a8d26e) SHA1(0431d10b76d77c26a1f6f2b55d9dbcfa959e1cd0) )
+
+ /* sound data */
+ ROM_REGION( 0x400000, "shared", 0)
+ ROM_LOAD( "247-a06", 0x000000, 0x200000, CRC(b8b2a67e) SHA1(a873d32f4b178c714743664fa53c0dca29cb3ce4) )
+ ROM_LOAD( "247-a07", 0x200000, 0x200000, CRC(0108142d) SHA1(4dc6a36d976dad9c0da5a5b1f01f2eb3b369c99d) )
+
+ ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
+ ROM_LOAD( "runguna.nv", 0x0000, 0x080, CRC(7bbf0e3c) SHA1(0fd3c9400e9b97a06517e0c8620f773a383100fd) )
+ROM_END
+
ROM_START( rungunu )
/* main program US Version AB 1993 10.12 */
ROM_REGION( 0x300000, "maincpu", 0)
@@ -608,6 +654,7 @@ ROM_END
GAME( 1993, rungun, 0, rng, rng, driver_device, 0, ROT0, "Konami", "Run and Gun (ver EAA 1993 10.8)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
GAME( 1993, runguna, rungun, rng, rng, driver_device, 0, ROT0, "Konami", "Run and Gun (ver EAA 1993 10.4)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
+GAME( 1993, rungunb, rungun, rng, rng, driver_device, 0, ROT0, "Konami", "Run and Gun (ver EAA 1993 9.10, prototype?)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
GAME( 1993, rungunu, rungun, rng, rng, driver_device, 0, ROT0, "Konami", "Run and Gun (ver UAB 1993 10.12)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE | GAME_NOT_WORKING ) // runs twice as fast as it should, broken inputs!
GAME( 1993, rungunua, rungun, rng, rng, driver_device, 0, ROT0, "Konami", "Run and Gun (ver UBA 1993 10.8)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE | GAME_NOT_WORKING ) // runs twice as fast as it should, broken inputs! broken attract!
GAME( 1993, slmdunkj, rungun, rng, rng, driver_device, 0, ROT0, "Konami", "Slam Dunk (ver JAA 1993 10.8)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/sangho.c b/src/mame/drivers/sangho.c
index 6d1bd3e73d3..ae13e716046 100644
--- a/src/mame/drivers/sangho.c
+++ b/src/mame/drivers/sangho.c
@@ -444,7 +444,6 @@ TIMER_DEVICE_CALLBACK_MEMBER(sangho_state::sangho_interrupt)
if((scanline % 2) == 0)
{
- m_v9958->set_resolution(RENDER_HIGH);
m_v9958->interrupt();
}
}
diff --git a/src/mame/drivers/sbasketb.c b/src/mame/drivers/sbasketb.c
index b59065aec78..707d2be2c77 100644
--- a/src/mame/drivers/sbasketb.c
+++ b/src/mame/drivers/sbasketb.c
@@ -184,7 +184,7 @@ INTERRUPT_GEN_MEMBER(sbasketb_state::vblank_irq)
static MACHINE_CONFIG_START( sbasketb, sbasketb_state )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", M6809, 1400000) /* 1.400 MHz ??? */
+ MCFG_CPU_ADD("maincpu", KONAMI1, 1400000) /* 1.400 MHz ??? */
MCFG_CPU_PROGRAM_MAP(sbasketb_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", sbasketb_state, vblank_irq)
@@ -220,6 +220,13 @@ static MACHINE_CONFIG_START( sbasketb, sbasketb_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
+MACHINE_CONFIG_DERIVED(sbasketbu, sbasketb)
+ MCFG_DEVICE_REMOVE("maincpu")
+ MCFG_CPU_ADD("maincpu", M6809, 1400000) /* 1.400 MHz ??? */
+ MCFG_CPU_PROGRAM_MAP(sbasketb_map)
+ MCFG_CPU_VBLANK_INT_DRIVER("screen", sbasketb_state, vblank_irq)
+MACHINE_CONFIG_END
+
/***************************************************************************
@@ -396,10 +403,9 @@ ROM_END
DRIVER_INIT_MEMBER(sbasketb_state,sbasketb)
{
- konami1_decode(machine(), "maincpu");
}
-GAME( 1984, sbasketb, 0, sbasketb, sbasketb, sbasketb_state, sbasketb, ROT90, "Konami", "Super Basketball (version I, encrypted)", GAME_SUPPORTS_SAVE )
-GAME( 1984, sbasketh, sbasketb, sbasketb, sbasketb, driver_device, 0, ROT90, "Konami", "Super Basketball (version H, unprotected)", GAME_SUPPORTS_SAVE )
-GAME( 1984, sbasketg, sbasketb, sbasketb, sbasketb, sbasketb_state, sbasketb, ROT90, "Konami", "Super Basketball (version G, encrypted)", GAME_SUPPORTS_SAVE )
-GAME( 1984, sbaskete, sbasketb, sbasketb, sbasketb, sbasketb_state, sbasketb, ROT90, "Konami", "Super Basketball (version E, encrypted)", GAME_SUPPORTS_SAVE )
+GAME( 1984, sbasketb, 0, sbasketb, sbasketb, sbasketb_state, sbasketb, ROT90, "Konami", "Super Basketball (version I, encrypted)", GAME_SUPPORTS_SAVE )
+GAME( 1984, sbasketh, sbasketb, sbasketbu, sbasketb, driver_device, 0, ROT90, "Konami", "Super Basketball (version H, unprotected)", GAME_SUPPORTS_SAVE )
+GAME( 1984, sbasketg, sbasketb, sbasketb, sbasketb, sbasketb_state, sbasketb, ROT90, "Konami", "Super Basketball (version G, encrypted)", GAME_SUPPORTS_SAVE )
+GAME( 1984, sbaskete, sbasketb, sbasketb, sbasketb, sbasketb_state, sbasketb, ROT90, "Konami", "Super Basketball (version E, encrypted)", GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/sbowling.c b/src/mame/drivers/sbowling.c
index 1620ba04bcc..ee2d6004428 100644
--- a/src/mame/drivers/sbowling.c
+++ b/src/mame/drivers/sbowling.c
@@ -55,33 +55,37 @@ public:
m_videoram(*this, "videoram"),
m_gfxdecode(*this, "gfxdecode") { }
- int m_bgmap;
required_device<cpu_device> m_maincpu;
required_shared_ptr<UINT8> m_videoram;
required_device<gfxdecode_device> m_gfxdecode;
- int m_sbw_system;
- tilemap_t *m_sb_tilemap;
+ int m_bgmap;
+ int m_system;
+ tilemap_t *m_tilemap;
bitmap_ind16 *m_tmpbitmap;
UINT32 m_color_prom_address;
UINT8 m_pix_sh;
UINT8 m_pix[2];
- DECLARE_WRITE8_MEMBER(sbw_videoram_w);
+ DECLARE_WRITE8_MEMBER(videoram_w);
DECLARE_WRITE8_MEMBER(pix_shift_w);
DECLARE_WRITE8_MEMBER(pix_data_w);
DECLARE_READ8_MEMBER(pix_data_r);
DECLARE_WRITE8_MEMBER(system_w);
DECLARE_WRITE8_MEMBER(graph_control_w);
DECLARE_READ8_MEMBER(controls_r);
- TILE_GET_INFO_MEMBER(get_sb_tile_info);
+
+ TILE_GET_INFO_MEMBER(get_tile_info);
+ TIMER_DEVICE_CALLBACK_MEMBER(interrupt);
+
virtual void video_start();
DECLARE_PALETTE_INIT(sbowling);
- UINT32 screen_update_sbowling(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- TIMER_DEVICE_CALLBACK_MEMBER(sbw_interrupt);
+
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ void postload();
};
-TILE_GET_INFO_MEMBER(sbowling_state::get_sb_tile_info)
+TILE_GET_INFO_MEMBER(sbowling_state::get_tile_info)
{
UINT8 *rom = memregion("user1")->base();
int tileno = rom[tile_index + m_bgmap * 1024];
@@ -96,13 +100,14 @@ static void plot_pixel_sbw(bitmap_ind16 *tmpbitmap, int x, int y, int col, int f
y = 255-y;
x = 247-x;
}
+
tmpbitmap->pix16(y, x) = col;
}
-WRITE8_MEMBER(sbowling_state::sbw_videoram_w)
+WRITE8_MEMBER(sbowling_state::videoram_w)
{
int flip = flip_screen();
- int x,y,i,v1,v2;
+ int x,y,v1,v2;
m_videoram[offset] = data;
@@ -114,7 +119,7 @@ WRITE8_MEMBER(sbowling_state::sbw_videoram_w)
v1 = m_videoram[offset];
v2 = m_videoram[offset+0x2000];
- for (i = 0; i < 8; i++)
+ for (int i = 0; i < 8; i++)
{
plot_pixel_sbw(m_tmpbitmap, x++, y, m_color_prom_address | ( ((v1&1)*0x20) | ((v2&1)*0x40) ), flip);
v1 >>= 1;
@@ -122,10 +127,10 @@ WRITE8_MEMBER(sbowling_state::sbw_videoram_w)
}
}
-UINT32 sbowling_state::screen_update_sbowling(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+UINT32 sbowling_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
bitmap.fill(0x18, cliprect);
- m_sb_tilemap->draw(screen, bitmap, cliprect, 0, 0);
+ m_tilemap->draw(screen, bitmap, cliprect, 0, 0);
copybitmap_trans(bitmap, *m_tmpbitmap, 0, 0, 0, 0, cliprect, m_color_prom_address);
return 0;
}
@@ -133,7 +138,21 @@ UINT32 sbowling_state::screen_update_sbowling(screen_device &screen, bitmap_ind1
void sbowling_state::video_start()
{
m_tmpbitmap = auto_bitmap_ind16_alloc(machine(),32*8,32*8);
- m_sb_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(sbowling_state::get_sb_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(sbowling_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+
+ save_item(NAME(m_bgmap));
+ save_item(NAME(m_system));
+ save_item(NAME(m_color_prom_address));
+ save_item(NAME(m_pix_sh));
+ save_item(NAME(m_pix));
+ machine().save().register_postload(save_prepost_delegate(FUNC(sbowling_state::postload), this));
+}
+
+void sbowling_state::postload()
+{
+ address_space &space = m_maincpu->space(AS_PROGRAM);
+ for (int offs = 0; offs < 0x4000; offs++)
+ videoram_w(space, offs, m_videoram[offs]);
}
WRITE8_MEMBER(sbowling_state::pix_shift_w)
@@ -161,7 +180,7 @@ READ8_MEMBER(sbowling_state::pix_data_r)
-TIMER_DEVICE_CALLBACK_MEMBER(sbowling_state::sbw_interrupt)
+TIMER_DEVICE_CALLBACK_MEMBER(sbowling_state::interrupt)
{
int scanline = param;
@@ -186,13 +205,13 @@ WRITE8_MEMBER(sbowling_state::system_w)
flip_screen_set(data&1);
- if ((m_sbw_system^data)&1)
+ if ((m_system^data)&1)
{
int offs;
for (offs = 0;offs < 0x4000; offs++)
- sbw_videoram_w(space, offs, m_videoram[offs]);
+ videoram_w(space, offs, m_videoram[offs]);
}
- m_sbw_system = data;
+ m_system = data;
}
WRITE8_MEMBER(sbowling_state::graph_control_w)
@@ -210,12 +229,12 @@ WRITE8_MEMBER(sbowling_state::graph_control_w)
m_color_prom_address = ((data&0x07)<<7) | ((data&0xc0)>>3);
m_bgmap = ((data>>4)^3) & 0x3;
- m_sb_tilemap->mark_all_dirty();
+ m_tilemap->mark_all_dirty();
}
READ8_MEMBER(sbowling_state::controls_r)
{
- if (m_sbw_system & 2)
+ if (m_system & 2)
return ioport("TRACKY")->read();
else
return ioport("TRACKX")->read();
@@ -223,7 +242,7 @@ READ8_MEMBER(sbowling_state::controls_r)
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, sbowling_state )
AM_RANGE(0x0000, 0x2fff) AM_ROM
- AM_RANGE(0x8000, 0xbfff) AM_RAM_WRITE(sbw_videoram_w) AM_SHARE("videoram")
+ AM_RANGE(0x8000, 0xbfff) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram")
AM_RANGE(0xf800, 0xf801) AM_DEVWRITE("aysnd", ay8910_device, address_data_w)
AM_RANGE(0xf801, 0xf801) AM_DEVREAD("aysnd", ay8910_device, data_r)
AM_RANGE(0xfc00, 0xffff) AM_RAM
@@ -343,7 +362,6 @@ GFXDECODE_END
PALETTE_INIT_MEMBER(sbowling_state, sbowling)
{
const UINT8 *color_prom = memregion("proms")->base();
- int i;
static const int resistances_rg[3] = { 470, 270, 100 };
static const int resistances_b[2] = { 270, 100 };
@@ -355,7 +373,7 @@ PALETTE_INIT_MEMBER(sbowling_state, sbowling)
3, resistances_rg, outputs_g, 0, 100,
2, resistances_b, outputs_b, 0, 100);
- for (i = 0;i < palette.entries();i++)
+ for (int i = 0;i < palette.entries();i++)
{
int bit0,bit1,bit2,r,g,b;
@@ -384,14 +402,14 @@ static MACHINE_CONFIG_START( sbowling, sbowling_state )
MCFG_CPU_ADD("maincpu", I8080, XTAL_19_968MHz/10) /* ? */
MCFG_CPU_PROGRAM_MAP(main_map)
MCFG_CPU_IO_MAP(port_map)
- MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", sbowling_state, sbw_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", sbowling_state, interrupt, "screen", 0, 1)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
MCFG_SCREEN_SIZE(32*8, 262) /* vert size taken from mw8080bw */
MCFG_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 4*8, 32*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(sbowling_state, screen_update_sbowling)
+ MCFG_SCREEN_UPDATE_DRIVER(sbowling_state, screen_update)
MCFG_SCREEN_PALETTE("palette")
MCFG_GFXDECODE_ADD("gfxdecode", "palette", sbowling)
@@ -425,4 +443,4 @@ ROM_START( sbowling )
ROM_LOAD( "kb09.6m", 0x0400, 0x0400, CRC(e29191a6) SHA1(9a2c78a96ef6d118f4dacbea0b7d454b66a452ae))
ROM_END
-GAME( 1982, sbowling, 0, sbowling, sbowling, driver_device, 0, ROT90, "Taito Corporation", "Strike Bowling",GAME_IMPERFECT_SOUND)
+GAME( 1982, sbowling, 0, sbowling, sbowling, driver_device, 0, ROT90, "Taito Corporation", "Strike Bowling", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/scramble.c b/src/mame/drivers/scramble.c
index bbe27542d99..ad73e39448f 100644
--- a/src/mame/drivers/scramble.c
+++ b/src/mame/drivers/scramble.c
@@ -405,6 +405,11 @@ static ADDRESS_MAP_START( harem_map, AS_PROGRAM, 8, scramble_state )
AM_RANGE(0x8000, 0x9fff) AM_ROMBANK("rombank") // bitswapped rom
ADDRESS_MAP_END
+static ADDRESS_MAP_START( decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 8, scramble_state )
+ AM_RANGE(0x0000, 0x1fff) AM_ROM AM_REGION("maincpu", 0)
+ AM_RANGE(0x8000, 0x9fff) AM_ROMBANK("rombank_decrypted")
+ADDRESS_MAP_END
+
static ADDRESS_MAP_START( harem_sound_map, AS_PROGRAM, 8, scramble_state )
AM_RANGE(0x0000, 0x2fff) AM_ROM
AM_RANGE(0x6000, 0x6000) AM_READNOP
@@ -1675,6 +1680,7 @@ static MACHINE_CONFIG_DERIVED( harem, scramble )
/* basic machine hardware */
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(harem_map)
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
MCFG_CPU_MODIFY("audiocpu")
MCFG_CPU_PROGRAM_MAP(harem_sound_map)
diff --git a/src/mame/drivers/segac2.c b/src/mame/drivers/segac2.c
index da14bf458ad..0b5aa9676a6 100644
--- a/src/mame/drivers/segac2.c
+++ b/src/mame/drivers/segac2.c
@@ -109,9 +109,6 @@ public:
required_shared_ptr<UINT16> m_paletteram;
- /* internal states */
- UINT8 m_misc_io_data[0x10]; /* holds values written to the I/O chip */
-
/* protection-related tracking */
segac2_prot_delegate m_prot_func; /* emulation of protection chip */
UINT8 m_prot_write_buf; /* remembers what was written */
@@ -172,10 +169,10 @@ public:
DECLARE_WRITE16_MEMBER( segac2_upd7759_w );
DECLARE_READ16_MEMBER( palette_r );
DECLARE_WRITE16_MEMBER( palette_w );
- DECLARE_WRITE16_MEMBER( control_w );
- DECLARE_READ16_MEMBER( prot_r );
- DECLARE_WRITE16_MEMBER( prot_w );
- DECLARE_WRITE16_MEMBER( counter_timer_w );
+ DECLARE_WRITE8_MEMBER( control_w );
+ DECLARE_READ8_MEMBER( prot_r );
+ DECLARE_WRITE8_MEMBER( prot_w );
+ DECLARE_WRITE8_MEMBER( counter_timer_w );
DECLARE_READ16_MEMBER( printer_r );
DECLARE_WRITE16_MEMBER( print_club_camera_w );
DECLARE_READ16_MEMBER(ichirjbl_prot_r);
@@ -220,7 +217,6 @@ public:
MACHINE_START_MEMBER(segac2_state,segac2)
{
- save_item(NAME(m_misc_io_data));
save_item(NAME(m_prot_write_buf));
save_item(NAME(m_prot_read_buf));
@@ -476,11 +472,8 @@ WRITE8_MEMBER(segac2_state::io_porth_w)
******************************************************************************/
-WRITE16_MEMBER(segac2_state::control_w )
+WRITE8_MEMBER(segac2_state::control_w)
{
- /* skip if not LSB */
- if (!ACCESSING_BITS_0_7)
- return;
data &= 0x0f;
/* bit 0 controls display enable */
@@ -511,7 +504,7 @@ WRITE16_MEMBER(segac2_state::control_w )
******************************************************************************/
/* protection chip reads */
-READ16_MEMBER(segac2_state::prot_r )
+READ8_MEMBER(segac2_state::prot_r)
{
if (LOG_PROTECTION) logerror("%06X:protection r=%02X\n", space.device().safe_pcbase(), m_prot_read_buf);
return m_prot_read_buf | 0xf0;
@@ -519,16 +512,12 @@ READ16_MEMBER(segac2_state::prot_r )
/* protection chip writes */
-WRITE16_MEMBER(segac2_state::prot_w )
+WRITE8_MEMBER(segac2_state::prot_w)
{
int new_sp_palbase = (data >> 2) & 3;
int new_bg_palbase = data & 3;
int table_index;
- /* only works for the LSB */
- if (!ACCESSING_BITS_0_7)
- return;
-
/* compute the table index */
table_index = (m_prot_write_buf << 4) | m_prot_read_buf;
@@ -562,42 +551,38 @@ WRITE16_MEMBER(segac2_state::prot_w )
******************************************************************************/
-WRITE16_MEMBER(segac2_state::counter_timer_w )
+WRITE8_MEMBER(segac2_state::counter_timer_w)
{
- /* only LSB matters */
- if (ACCESSING_BITS_0_7)
+ /*int value = data & 1;*/
+ switch (data & 0x1e)
{
- /*int value = data & 1;*/
- switch (data & 0x1e)
- {
- case 0x00: /* player 1 start/stop */
- case 0x02: /* player 2 start/stop */
- case 0x04: /* ??? */
- case 0x06: /* ??? */
- case 0x08: /* player 1 game timer? */
- case 0x0a: /* player 2 game timer? */
- case 0x0c: /* ??? */
- case 0x0e: /* ??? */
- break;
-
- case 0x10: /* coin counter */
-// coin_counter_w(space.machine(), 0,1);
-// coin_counter_w(space.machine(), 0,0);
- break;
-
- case 0x12: /* set coinage info -- followed by two 4-bit values */
- break;
-
- case 0x14: /* game timer? (see Tant-R) */
- case 0x16: /* intro timer? (see Tant-R) */
- case 0x18: /* ??? */
- case 0x1a: /* ??? */
- case 0x1c: /* ??? */
- break;
-
- case 0x1e: /* reset */
- break;
- }
+ case 0x00: /* player 1 start/stop */
+ case 0x02: /* player 2 start/stop */
+ case 0x04: /* ??? */
+ case 0x06: /* ??? */
+ case 0x08: /* player 1 game timer? */
+ case 0x0a: /* player 2 game timer? */
+ case 0x0c: /* ??? */
+ case 0x0e: /* ??? */
+ break;
+
+ case 0x10: /* coin counter */
+// coin_counter_w(space.machine(), 0,1);
+// coin_counter_w(space.machine(), 0,0);
+ break;
+
+ case 0x12: /* set coinage info -- followed by two 4-bit values */
+ break;
+
+ case 0x14: /* game timer? (see Tant-R) */
+ case 0x16: /* intro timer? (see Tant-R) */
+ case 0x18: /* ??? */
+ case 0x1a: /* ??? */
+ case 0x1c: /* ??? */
+ break;
+
+ case 0x1e: /* reset */
+ break;
}
}
@@ -610,12 +595,12 @@ WRITE16_MEMBER(segac2_state::counter_timer_w )
******************************************************************************/
-READ16_MEMBER(segac2_state::printer_r )
+READ16_MEMBER(segac2_state::printer_r)
{
return m_cam_data;
}
-WRITE16_MEMBER(segac2_state::print_club_camera_w )
+WRITE16_MEMBER(segac2_state::print_club_camera_w)
{
m_cam_data = data;
}
@@ -633,11 +618,11 @@ WRITE16_MEMBER(segac2_state::print_club_camera_w )
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, segac2_state )
AM_RANGE(0x000000, 0x1fffff) AM_ROM
- AM_RANGE(0x800000, 0x800001) AM_MIRROR(0x13fdfe) AM_READWRITE(prot_r, prot_w)
- AM_RANGE(0x800200, 0x800201) AM_MIRROR(0x13fdfe) AM_WRITE(control_w)
+ AM_RANGE(0x800000, 0x800001) AM_MIRROR(0x13fdfe) AM_READWRITE8(prot_r, prot_w, 0x00ff)
+ AM_RANGE(0x800200, 0x800201) AM_MIRROR(0x13fdfe) AM_WRITE8(control_w, 0x00ff)
AM_RANGE(0x840000, 0x84001f) AM_MIRROR(0x13fee0) AM_DEVREADWRITE8("io", sega_315_5296_device, read, write, 0x00ff)
AM_RANGE(0x840100, 0x840107) AM_MIRROR(0x13fef8) AM_DEVREADWRITE8("ymsnd", ym3438_device, read, write, 0x00ff)
- AM_RANGE(0x880100, 0x880101) AM_MIRROR(0x13fefe) AM_WRITE(counter_timer_w)
+ AM_RANGE(0x880100, 0x880101) AM_MIRROR(0x13fefe) AM_WRITE8(counter_timer_w, 0x00ff)
AM_RANGE(0x8c0000, 0x8c0fff) AM_MIRROR(0x13f000) AM_READWRITE(palette_r, palette_w) AM_SHARE("paletteram")
AM_RANGE(0xc00000, 0xc0001f) AM_MIRROR(0x18ff00) AM_DEVREADWRITE("gen_vdp", sega315_5313_device, vdp_r, vdp_w)
AM_RANGE(0xe00000, 0xe0ffff) AM_MIRROR(0x1f0000) AM_RAM AM_SHARE("nvram")
diff --git a/src/mame/drivers/segae.c b/src/mame/drivers/segae.c
index eb824bc8d54..e02daa3d88d 100644
--- a/src/mame/drivers/segae.c
+++ b/src/mame/drivers/segae.c
@@ -311,7 +311,12 @@ public:
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_vdp1(*this, "vdp1"),
- m_vdp2(*this, "vdp2") { }
+ m_vdp2(*this, "vdp2"),
+ m_decrypted_opcodes(*this, "decrypted_opcodes"),
+ m_maincpu_region(*this, "maincpu"),
+ m_bank1(*this, "bank1"),
+ m_bank0d(*this, "bank0d"),
+ m_bank1d(*this, "bank1d") { }
DECLARE_WRITE8_MEMBER( bank_write );
DECLARE_WRITE_LINE_MEMBER( int_callback );
@@ -332,6 +337,12 @@ public:
required_device<sega315_5124_device> m_vdp1;
required_device<sega315_5124_device> m_vdp2;
+ optional_shared_ptr<UINT8> m_decrypted_opcodes;
+ required_memory_region m_maincpu_region;
+ required_memory_bank m_bank1;
+ optional_memory_bank m_bank0d;
+ optional_memory_bank m_bank1d;
+
// Analog input related
UINT8 m_port_select;
UINT16 m_last1;
@@ -358,7 +369,19 @@ public:
static ADDRESS_MAP_START( systeme_map, AS_PROGRAM, 8, systeme_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM /* Fixed ROM */
AM_RANGE(0x8000, 0xbfff) AM_READ_BANK("bank1") AM_WRITE_BANK("vram_write") /* Banked ROM */
- AM_RANGE(0xc000, 0xffff) AM_RAM
+ AM_RANGE(0xc000, 0xffff) AM_RAM AM_SHARE("mainram")
+ADDRESS_MAP_END
+
+static ADDRESS_MAP_START( decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 8, systeme_state )
+ AM_RANGE(0x0000, 0x7fff) AM_ROM AM_SHARE("decrypted_opcodes")
+ AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1")
+ AM_RANGE(0xc000, 0xffff) AM_RAM AM_SHARE("mainram")
+ADDRESS_MAP_END
+
+static ADDRESS_MAP_START( banked_decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 8, systeme_state )
+ AM_RANGE(0x0000, 0x7fff) AM_ROMBANK("bank0d")
+ AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1d")
+ AM_RANGE(0xc000, 0xffff) AM_RAM AM_SHARE("mainram")
ADDRESS_MAP_END
@@ -396,7 +419,9 @@ WRITE8_MEMBER( systeme_state::bank_write )
membank("vdp1_bank")->set_entry((data >> 7) & 1);
membank("vdp2_bank")->set_entry((data >> 6) & 1);
membank("vram_write")->set_entry(data >> 5);
- membank("bank1")->set_entry(data & 0x0f);
+ m_bank1->set_entry(data & 0x0f);
+ if(m_bank1d)
+ m_bank1d->set_entry(data & 0x0f);
}
@@ -404,7 +429,7 @@ void systeme_state::machine_start()
{
membank("vdp1_bank")->configure_entries(0, 2, m_vram[0], 0x4000);
membank("vdp2_bank")->configure_entries(0, 2, m_vram[1], 0x4000);
- membank("bank1")->configure_entries(0, 16, memregion("maincpu")->base() + 0x10000, 0x4000);
+ m_bank1->configure_entries(0, 16, m_maincpu_region->base() + 0x10000, 0x4000);
for (int i = 7; i >= 0; i--)
{
@@ -909,7 +934,7 @@ ROM_START( fantzn2 )
ROM_LOAD( "epr-11414.ic4", 0x30000, 0x10000, CRC(6f7a9f5f) SHA1(b53aa2eded781c80466a79b7d81383b9a875d0be) )
ROM_LOAD( "epr-11412.ic2", 0x40000, 0x10000, CRC(b14db5af) SHA1(04c7fb659385438b3d8f9fb66800eb7b6373bda9) )
- ROM_REGION( 0x2000, "user1", 0 ) /* MC8123 key */
+ ROM_REGION( 0x2000, "key", 0 ) /* MC8123 key */
ROM_LOAD( "317-0057.key", 0x0000, 0x2000, CRC(ee43d0f0) SHA1(72cb75a4d8352fe372db12046a59ea044360d5c3) )
ROM_END
@@ -923,7 +948,7 @@ ROM_START( opaopa )
ROM_LOAD( "epr11221.ic3", 0x20000, 0x08000, CRC(4ca132a2) SHA1(cb4e4c01b6ab070eef37c0603190caafe6236ccd) ) /* encrypted */
ROM_LOAD( "epr11220.ic2", 0x28000, 0x08000, CRC(a165e2ef) SHA1(498ff4c5d3a2658567393378c56be6ed86ac0384) ) /* encrypted */
- ROM_REGION( 0x2000, "user1", 0 ) /* MC8123 key */
+ ROM_REGION( 0x2000, "key", 0 ) /* MC8123 key */
ROM_LOAD( "317-0042.key", 0x0000, 0x2000, CRC(d6312538) SHA1(494ac7f080775c21dc7d369e6ea78f3299e6975a) )
ROM_END
@@ -988,6 +1013,16 @@ static MACHINE_CONFIG_START( systeme, systeme_state )
MACHINE_CONFIG_END
+static MACHINE_CONFIG_DERIVED( systemex, systeme )
+ MCFG_DEVICE_MODIFY("maincpu")
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
+MACHINE_CONFIG_END
+
+static MACHINE_CONFIG_DERIVED( systemeb, systeme )
+ MCFG_DEVICE_MODIFY("maincpu")
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(banked_decrypted_opcodes_map)
+MACHINE_CONFIG_END
+
DRIVER_INIT_MEMBER(systeme_state, hangonjr)
{
m_maincpu->space(AS_IO).install_read_handler(0xf8, 0xf8, read8_delegate(FUNC(systeme_state::hangonjr_port_f8_read), this));
@@ -997,7 +1032,58 @@ DRIVER_INIT_MEMBER(systeme_state, hangonjr)
DRIVER_INIT_MEMBER(systeme_state, astrofl)
{
- sega_315_5177_decode(machine(), "maincpu");
+ // 315-5177
+ static const UINT8 xor_table[128] =
+ {
+ 0x04,0x54,0x51,0x15,0x40,0x44,0x01,0x51,0x55,0x10,0x44,0x41,
+ 0x05,0x55,0x50,0x14,0x41,0x45,0x00,0x50,0x54,0x11,0x45,0x40,
+ 0x04,0x54,0x51,0x15,0x40,0x44,0x01,0x51,0x55,0x10,0x44,0x41,
+ 0x05,0x55,0x50,0x14,0x41,0x45,0x00,0x50,0x54,0x11,0x45,0x40,
+ 0x04,0x54,0x51,0x15,0x40,0x44,0x01,0x51,0x55,0x10,0x44,0x41,
+ 0x05,0x55,0x50,0x14,
+
+ 0x04,0x54,0x51,0x15,0x40,0x44,0x01,0x51,0x55,0x10,0x44,0x41,
+ 0x05,0x55,0x50,0x14,0x41,0x45,0x00,0x50,0x54,0x11,0x45,0x40,
+ 0x04,0x54,0x51,0x15,0x40,0x44,0x01,0x51,0x55,0x10,0x44,0x41,
+ 0x05,0x55,0x50,0x14,0x41,0x45,0x00,0x50,0x54,0x11,0x45,0x40,
+ 0x04,0x54,0x51,0x15,0x40,0x44,0x01,0x51,0x55,0x10,0x44,0x41,
+ 0x05,0x55,0x50,0x14,
+ };
+
+ static const int swap_table[128] =
+ {
+ 0,0,0,0,
+ 1,1,1,1,1,
+ 2,2,2,2,2,
+ 3,3,3,3,
+ 4,4,4,4,4,
+ 5,5,5,5,5,
+ 6,6,6,6,6,
+ 7,7,7,7,7,
+ 8,8,8,8,
+ 9,9,9,9,9,
+ 10,10,10,10,10,
+ 11,11,11,11,11,
+ 12,12,12,12,12,
+ 13,13,
+
+ 8,8,8,8,
+ 9,9,9,9,9,
+ 10,10,10,10,10,
+ 11,11,11,11,
+ 12,12,12,12,12,
+ 13,13,13,13,13,
+ 14,14,14,14,14,
+ 15,15,15,15,15,
+ 16,16,16,16,
+ 17,17,17,17,17,
+ 18,18,18,18,18,
+ 19,19,19,19,19,
+ 20,20,20,20,20,
+ 21,21,
+ };
+
+ sega_decode_2(m_maincpu_region->base(), m_decrypted_opcodes, xor_table, swap_table);
}
@@ -1010,21 +1096,25 @@ DRIVER_INIT_MEMBER(systeme_state, ridleofp)
DRIVER_INIT_MEMBER(systeme_state, opaopa)
{
- mc8123_decrypt_rom(machine(), "maincpu", "user1", "bank1", 8);
+ UINT8 *banked_decrypted_opcodes = auto_alloc_array(machine(), UINT8, m_maincpu_region->bytes());
+ mc8123_decode(m_maincpu_region->base(), banked_decrypted_opcodes, memregion("key")->base(), m_maincpu_region->bytes());
+
+ m_bank0d->set_base(banked_decrypted_opcodes);
+ m_bank1d->configure_entries(0, 16, banked_decrypted_opcodes + 0x10000, 0x4000);
}
DRIVER_INIT_MEMBER(systeme_state, fantzn2)
{
- mc8123_decrypt_rom(machine(), "maincpu", "user1", NULL, 0);
+ mc8123_decode(m_maincpu_region->base(), m_decrypted_opcodes, memregion("key")->base(), 0x8000);
}
-// YEAR, NAME, PARENT, MACHINE, INPUT, INIT, MONITOR,COMPANY,FULLNAME,FLAGS
-GAME( 1985, hangonjr, 0, systeme, hangonjr, systeme_state, hangonjr, ROT0, "Sega", "Hang-On Jr.", GAME_SUPPORTS_SAVE )
-GAME( 1986, transfrm, 0, systeme, transfrm, driver_device, 0, ROT0, "Sega", "Transformer", GAME_SUPPORTS_SAVE )
-GAME( 1986, astrofl, transfrm, systeme, transfrm, systeme_state, astrofl, ROT0, "Sega", "Astro Flash (Japan)", GAME_SUPPORTS_SAVE )
-GAME( 1986, ridleofp, 0, systeme, ridleofp, systeme_state, ridleofp, ROT90, "Sega / Nasco", "Riddle of Pythagoras (Japan)", GAME_SUPPORTS_SAVE )
-GAME( 1987, opaopa, 0, systeme, opaopa, systeme_state, opaopa, ROT0, "Sega", "Opa Opa (MC-8123, 317-0042)", GAME_SUPPORTS_SAVE )
-GAME( 1988, fantzn2, 0, systeme, fantzn2, systeme_state, fantzn2, ROT0, "Sega", "Fantasy Zone II - The Tears of Opa-Opa (MC-8123, 317-0057)", GAME_SUPPORTS_SAVE )
-GAME( 1988, tetrisse, 0, systeme, tetrisse, driver_device, 0, ROT0, "Sega", "Tetris (Japan, System E)", GAME_SUPPORTS_SAVE )
+// YEAR, NAME, PARENT, MACHINE, INPUT, INIT, MONITOR,COMPANY,FULLNAME,FLAGS
+GAME( 1985, hangonjr, 0, systeme, hangonjr, systeme_state, hangonjr, ROT0, "Sega", "Hang-On Jr.", GAME_SUPPORTS_SAVE )
+GAME( 1986, transfrm, 0, systeme, transfrm, driver_device, 0, ROT0, "Sega", "Transformer", GAME_SUPPORTS_SAVE )
+GAME( 1986, astrofl, transfrm, systemex, transfrm, systeme_state, astrofl, ROT0, "Sega", "Astro Flash (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1986, ridleofp, 0, systeme, ridleofp, systeme_state, ridleofp, ROT90, "Sega / Nasco", "Riddle of Pythagoras (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1987, opaopa, 0, systemeb, opaopa, systeme_state, opaopa, ROT0, "Sega", "Opa Opa (MC-8123, 317-0042)", GAME_SUPPORTS_SAVE )
+GAME( 1988, fantzn2, 0, systemex, fantzn2, systeme_state, fantzn2, ROT0, "Sega", "Fantasy Zone II - The Tears of Opa-Opa (MC-8123, 317-0057)", GAME_SUPPORTS_SAVE )
+GAME( 1988, tetrisse, 0, systeme, tetrisse, driver_device, 0, ROT0, "Sega", "Tetris (Japan, System E)", GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/segag80r.c b/src/mame/drivers/segag80r.c
index ea0f834432a..490bee85605 100644
--- a/src/mame/drivers/segag80r.c
+++ b/src/mame/drivers/segag80r.c
@@ -322,6 +322,13 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, segag80r_state )
AM_RANGE(0xe000, 0xffff) AM_RAM_WRITE(vidram_w) AM_SHARE("videoram")
ADDRESS_MAP_END
+static ADDRESS_MAP_START( decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 8, segag80r_state )
+ AM_RANGE(0x0000, 0x7fff) AM_ROM AM_SHARE("decrypted_opcodes")
+ AM_RANGE(0x8000, 0xbfff) AM_ROM AM_REGION("maincpu", 0x8000)
+ AM_RANGE(0xc800, 0xcfff) AM_RAM_WRITE(mainram_w) AM_SHARE("mainram")
+ AM_RANGE(0xe000, 0xffff) AM_RAM_WRITE(vidram_w) AM_SHARE("videoram")
+ADDRESS_MAP_END
+
/* complete memory map derived from schematics */
static ADDRESS_MAP_START( main_portmap, AS_IO, 8, segag80r_state )
@@ -877,6 +884,10 @@ static MACHINE_CONFIG_DERIVED( monsterb, g80r_base )
MCFG_FRAGMENT_ADD(monsterb_sound_board)
MACHINE_CONFIG_END
+static MACHINE_CONFIG_DERIVED( monster2, monsterb )
+ MCFG_CPU_MODIFY("maincpu")
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
+MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( pignewt, g80r_base )
@@ -897,6 +908,7 @@ static MACHINE_CONFIG_DERIVED( sindbadm, g80r_base )
/* basic machine hardware */
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_IO_MAP(sindbadm_portmap)
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", segag80r_state, sindbadm_vblank_start)
MCFG_DEVICE_ADD("ppi8255", I8255A, 0)
@@ -1497,11 +1509,34 @@ DRIVER_INIT_MEMBER(segag80r_state,monsterb)
DRIVER_INIT_MEMBER(segag80r_state,monster2)
{
+ static const UINT8 convtable[32][4] =
+ {
+ /* opcode data address */
+ /* A B C D A B C D */
+ { 0x88,0x08,0x80,0x00 }, { 0x00,0x08,0x20,0x28 }, /* ...0...0...0...0 */
+ { 0x28,0xa8,0x08,0x88 }, { 0x28,0xa8,0x08,0x88 }, /* ...0...0...0...1 */
+ { 0x28,0x20,0xa8,0xa0 }, { 0x28,0x20,0xa8,0xa0 }, /* ...0...0...1...0 */
+ { 0x88,0x08,0x80,0x00 }, { 0x88,0x08,0x80,0x00 }, /* ...0...0...1...1 */
+ { 0x00,0x08,0x20,0x28 }, { 0x88,0x08,0x80,0x00 }, /* ...0...1...0...0 */
+ { 0xa0,0x80,0x20,0x00 }, { 0x80,0x88,0x00,0x08 }, /* ...0...1...0...1 */
+ { 0x88,0x08,0x80,0x00 }, { 0xa0,0x80,0x20,0x00 }, /* ...0...1...1...0 */
+ { 0x88,0x08,0x80,0x00 }, { 0x28,0x20,0xa8,0xa0 }, /* ...0...1...1...1 */
+ { 0x28,0xa8,0x08,0x88 }, { 0x80,0x88,0x00,0x08 }, /* ...1...0...0...0 */
+ { 0x80,0x88,0x00,0x08 }, { 0x00,0x08,0x20,0x28 }, /* ...1...0...0...1 */
+ { 0x28,0x20,0xa8,0xa0 }, { 0x28,0xa8,0x08,0x88 }, /* ...1...0...1...0 */
+ { 0x00,0x08,0x20,0x28 }, { 0x80,0xa0,0x88,0xa8 }, /* ...1...0...1...1 */
+ { 0x80,0x88,0x00,0x08 }, { 0xa0,0x80,0x20,0x00 }, /* ...1...1...0...0 */
+ { 0x80,0xa0,0x88,0xa8 }, { 0xa0,0x80,0x20,0x00 }, /* ...1...1...0...1 */
+ { 0xa0,0x80,0x20,0x00 }, { 0x80,0xa0,0x88,0xa8 }, /* ...1...1...1...0 */
+ { 0x28,0x20,0xa8,0xa0 }, { 0x00,0x08,0x20,0x28 } /* ...1...1...1...1 */
+ };
+
+ sega_decode(memregion("maincpu")->base(), m_decrypted_opcodes, 0x8000, convtable);
+
address_space &iospace = m_maincpu->space(AS_IO);
address_space &pgmspace = m_maincpu->space(AS_PROGRAM);
/* configure the 315-5006 security chip */
- spatter_decode(machine(), "maincpu");
m_decrypt = segag80_security(0);
/* configure video */
@@ -1546,11 +1581,34 @@ DRIVER_INIT_MEMBER(segag80r_state,pignewt)
DRIVER_INIT_MEMBER(segag80r_state,sindbadm)
{
+ static const UINT8 convtable[32][4] =
+ {
+ /* opcode data address */
+ /* A B C D A B C D */
+ { 0x28,0xa8,0x08,0x88 }, { 0x88,0x80,0x08,0x00 }, /* ...0...0...0...0 */
+ { 0xa8,0xa0,0x88,0x80 }, { 0x00,0x20,0x80,0xa0 }, /* ...0...0...0...1 */
+ { 0xa8,0xa0,0x88,0x80 }, { 0x00,0x20,0x80,0xa0 }, /* ...0...0...1...0 */
+ { 0x28,0xa8,0x08,0x88 }, { 0x88,0x80,0x08,0x00 }, /* ...0...0...1...1 */
+ { 0xa8,0x88,0xa0,0x80 }, { 0xa0,0x20,0xa8,0x28 }, /* ...0...1...0...0 */
+ { 0x28,0xa8,0x08,0x88 }, { 0x88,0x80,0x08,0x00 }, /* ...0...1...0...1 */
+ { 0xa8,0xa0,0x88,0x80 }, { 0x00,0x20,0x80,0xa0 }, /* ...0...1...1...0 */
+ { 0xa8,0xa0,0x88,0x80 }, { 0x00,0x20,0x80,0xa0 }, /* ...0...1...1...1 */
+ { 0x28,0xa8,0x08,0x88 }, { 0x88,0x80,0x08,0x00 }, /* ...1...0...0...0 */
+ { 0x28,0xa8,0x08,0x88 }, { 0x88,0x80,0x08,0x00 }, /* ...1...0...0...1 */
+ { 0xa8,0xa0,0x88,0x80 }, { 0x00,0x20,0x80,0xa0 }, /* ...1...0...1...0 */
+ { 0xa8,0xa0,0x88,0x80 }, { 0x00,0x20,0x80,0xa0 }, /* ...1...0...1...1 */
+ { 0x28,0xa8,0x08,0x88 }, { 0x88,0x80,0x08,0x00 }, /* ...1...1...0...0 */
+ { 0xa8,0x88,0xa0,0x80 }, { 0xa0,0x20,0xa8,0x28 }, /* ...1...1...0...1 */
+ { 0x28,0xa8,0x08,0x88 }, { 0x88,0x80,0x08,0x00 }, /* ...1...1...1...0 */
+ { 0x28,0xa8,0x08,0x88 }, { 0x88,0x80,0x08,0x00 } /* ...1...1...1...1 */
+ };
+
+ sega_decode(memregion("maincpu")->base(), m_decrypted_opcodes, 0x8000, convtable);
+
address_space &iospace = m_maincpu->space(AS_IO);
address_space &pgmspace = m_maincpu->space(AS_PROGRAM);
/* configure the encrypted Z80 */
- sindbadm_decode(machine(), "maincpu");
m_decrypt = segag80_security(0);
/* configure video */
@@ -1585,7 +1643,7 @@ GAME( 1981, spaceod2, spaceod, spaceod, spaceod, segag80r_state, spaceod, R
GAME( 1982, monsterb, 0, monsterb, monsterb, segag80r_state, monsterb, ROT270, "Sega", "Monster Bash", GAME_IMPERFECT_SOUND )
/* 2-board G-80 system */
-GAME( 1982, monsterb2, monsterb, monsterb, monsterb, segag80r_state, monster2, ROT270, "Sega", "Monster Bash (2 board version)", GAME_IMPERFECT_SOUND )
+GAME( 1982, monsterb2, monsterb, monster2, monsterb, segag80r_state, monster2, ROT270, "Sega", "Monster Bash (2 board version)", GAME_IMPERFECT_SOUND )
GAME( 1983, pignewt, 0, pignewt, pignewt, segag80r_state, pignewt, ROT270, "Sega", "Pig Newton (version C)", GAME_IMPERFECT_SOUND )
GAME( 1983, pignewta, pignewt, pignewt, pignewta, segag80r_state, pignewt, ROT270, "Sega", "Pig Newton (version A)", GAME_IMPERFECT_SOUND )
GAME( 1983, sindbadm, 0, sindbadm, sindbadm, segag80r_state, sindbadm, ROT270, "Sega", "Sindbad Mystery", 0 )
diff --git a/src/mame/drivers/segahang.c b/src/mame/drivers/segahang.c
index d1dd85fc686..fdd896e745c 100644
--- a/src/mame/drivers/segahang.c
+++ b/src/mame/drivers/segahang.c
@@ -426,6 +426,11 @@ static ADDRESS_MAP_START( hangon_map, AS_PROGRAM, 16, segahang_state )
AM_RANGE(0xe00000, 0xffffff) AM_READWRITE(hangon_io_r, hangon_io_w)
ADDRESS_MAP_END
+static ADDRESS_MAP_START( decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 16, segahang_state )
+ ADDRESS_MAP_UNMAP_HIGH
+ AM_RANGE(0x000000, 0x03ffff) AM_ROM AM_SHARE("decrypted_opcodes")
+ADDRESS_MAP_END
+
static ADDRESS_MAP_START( sharrier_map, AS_PROGRAM, 16, segahang_state )
ADDRESS_MAP_UNMAP_HIGH
AM_RANGE(0x000000, 0x03ffff) AM_ROM
@@ -959,11 +964,17 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( endurobl, sharrier_base )
+ MCFG_CPU_MODIFY("maincpu")
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
+
MCFG_FRAGMENT_ADD(sound_board_2203)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( endurob2, sharrier_base )
+ MCFG_CPU_MODIFY("maincpu")
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
+
MCFG_FRAGMENT_ADD(sound_board_2203x2)
MACHINE_CONFIG_END
@@ -1777,13 +1788,10 @@ DRIVER_INIT_MEMBER(segahang_state,enduror)
DRIVER_INIT_MEMBER(segahang_state,endurobl)
{
DRIVER_INIT_CALL(enduror);
-
// assemble decrypted half of ROM and register it
UINT16 *rom = reinterpret_cast<UINT16 *>(memregion("maincpu")->base());
- UINT16 *decrypt = auto_alloc_array(machine(), UINT16, 0x40000/2);
- memcpy(decrypt + 0x00000/2, rom + 0x30000/2, 0x10000);
- memcpy(decrypt + 0x10000/2, rom + 0x10000/2, 0x20000);
- m_maincpu->space(AS_PROGRAM).set_decrypted_region(0x000000, 0x03ffff, decrypt);
+ memcpy(m_decrypted_opcodes + 0x00000/2, rom + 0x30000/2, 0x10000);
+ memcpy(m_decrypted_opcodes + 0x10000/2, rom + 0x10000/2, 0x20000);
}
DRIVER_INIT_MEMBER(segahang_state,endurob2)
@@ -1792,9 +1800,7 @@ DRIVER_INIT_MEMBER(segahang_state,endurob2)
// assemble decrypted half of ROM and register it
UINT16 *rom = reinterpret_cast<UINT16 *>(memregion("maincpu")->base());
- UINT16 *decrypt = auto_alloc_array(machine(), UINT16, 0x40000/2);
- memcpy(decrypt, rom, 0x30000);
- m_maincpu->space(AS_PROGRAM).set_decrypted_region(0x000000, 0x03ffff, decrypt);
+ memcpy(m_decrypted_opcodes, rom, 0x30000);
}
diff --git a/src/mame/drivers/segam1.c b/src/mame/drivers/segam1.c
new file mode 100644
index 00000000000..a39ada35922
--- /dev/null
+++ b/src/mame/drivers/segam1.c
@@ -0,0 +1,111 @@
+// license:BSD-3-Clause
+// copyright-holders:David Haywood
+/*
+
+Sega M1 hardware (837-7571) (PCB)
+
+Sega Bingo Multicart (837-10675) (Sticker on PCB)
+
+used for redemption / gambling style machines in a satellite setup
+
+based on Caribbean Boule the following hardware setup is used
+
+One X-Board (segaxbd.c) drives a large rear-projection monitor which all players view to see the main game progress.
+
+Multiple M1 boards ("satellite" board) for each player for them to view information privately.
+
+One 'link' board which connects everything together. The link board has audio hardware, a 68K, and a Z80 as
+well as a huge bank of UARTS and toslink connectors, but no video. it's possible the main game logic runs
+on the 'link' board.
+
+
+Unfortunately we don't have any dumps of anything other than an M1 board right now.
+
+---
+
+is this related to (or a component of?) bingoc.c, the EPR numbers are much lower there tho
+so it's probably an earlier version of the same thing or one of the 'link' boards?
+
+uses s24 style tilemaps (ram based?)
+
+
+*/
+
+
+#include "emu.h"
+#include "cpu/m68000/m68000.h"
+
+
+
+class segam1_state : public driver_device
+{
+public:
+ segam1_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu")
+ { }
+
+ virtual void video_start();
+ UINT32 screen_update_segam1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ required_device<cpu_device> m_maincpu;
+};
+
+void segam1_state::video_start()
+{
+}
+
+UINT32 segam1_state::screen_update_segam1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+{
+ return 0;
+}
+
+
+
+static ADDRESS_MAP_START( segam1_map, AS_PROGRAM, 16, segam1_state )
+ AM_RANGE(0x000000, 0x03ffff) AM_ROM
+ADDRESS_MAP_END
+
+
+static INPUT_PORTS_START( segam1 )
+INPUT_PORTS_END
+
+
+
+
+static MACHINE_CONFIG_START( segam1, segam1_state )
+
+ MCFG_CPU_ADD("maincpu", M68000, XTAL_20MHz/2)
+ MCFG_CPU_PROGRAM_MAP(segam1_map)
+// MCFG_CPU_VBLANK_INT_DRIVER("screen", segam1_state, irq1_line_hold)
+
+
+ MCFG_SCREEN_ADD("screen", RASTER)
+ MCFG_SCREEN_REFRESH_RATE(60)
+ MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
+ MCFG_SCREEN_SIZE(64*8, 32*8)
+ MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1)
+ MCFG_SCREEN_UPDATE_DRIVER(segam1_state, screen_update_segam1)
+ MCFG_SCREEN_PALETTE("palette")
+
+ MCFG_PALETTE_ADD("palette", 0x200)
+ MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB)
+
+ MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+MACHINE_CONFIG_END
+
+
+ROM_START( bingpty )
+ ROM_REGION( 0x40000, "maincpu", 0 ) /* 68000 Code */
+ ROM_LOAD16_BYTE( "epr-16648b.bin", 0x00000, 0x20000, CRC(e4fceb4c) SHA1(0a248bb328d2f6d72d540baefbe62838f4b76585) )
+ ROM_LOAD16_BYTE( "epr-16649b.bin", 0x00001, 0x20000, CRC(736d8bbd) SHA1(c359ad513d4a7693cbb1a27ce26f89849e894d05) )
+
+ ROM_REGION( 0x20000, "audiocpu", 0 ) /* Z80 Code */
+ ROM_LOAD( "epr-14845.bin", 0x00000, 0x20000, CRC(90d47101) SHA1(7bc002c104e3dbde1986aaec54112d5658eab523) )
+
+ ROM_REGION( 0x8000, "m1comm", 0 ) /* Z80 Code */
+ ROM_LOAD( "epr-14221a.bin", 0x00000, 0x8000, CRC(a13e67a4) SHA1(4cd269c7f04a64ae7806c8784f86bf6553a25d85) )
+
+ // dumps of the X-Board part, and the LINK PCB are missing.
+ROM_END
+
+GAME( 199?, bingpty, 0, segam1, segam1, driver_device, 0, ROT0, "Sega", "Bingo Party Multicart (Rev B) (M1 Satellite board)", GAME_NOT_WORKING | GAME_NO_SOUND )
diff --git a/src/mame/drivers/segaorun.c b/src/mame/drivers/segaorun.c
index c80dc050f02..7181c1a848c 100644
--- a/src/mame/drivers/segaorun.c
+++ b/src/mame/drivers/segaorun.c
@@ -465,7 +465,7 @@ void segaorun_state::memory_mapper(sega_315_5195_mapper_device &mapper, UINT8 in
case 0:
mapper.map_as_ram(0x60000, 0x08000, 0xf98000, "workram", write16_delegate());
- mapper.map_as_rom(0x00000, 0x60000, 0xf80000, "rom0base", 0x00000, write16_delegate());
+ mapper.map_as_rom(0x00000, 0x60000, 0xf80000, "rom0base", "decrypted_rom0base", 0x00000, write16_delegate());
break;
}
}
diff --git a/src/mame/drivers/segas16a.c b/src/mame/drivers/segas16a.c
index 2001e28b832..6313f3dee38 100644
--- a/src/mame/drivers/segas16a.c
+++ b/src/mame/drivers/segas16a.c
@@ -974,6 +974,10 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, segas16a_state )
AM_RANGE(0xf800, 0xffff) AM_RAM
ADDRESS_MAP_END
+static ADDRESS_MAP_START( sound_decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 8, segas16a_state )
+ AM_RANGE(0x0000, 0x7fff) AM_ROM AM_SHARE("sound_decrypted_opcodes")
+ADDRESS_MAP_END
+
static ADDRESS_MAP_START( sound_portmap, AS_IO, 8, segas16a_state )
ADDRESS_MAP_UNMAP_HIGH
ADDRESS_MAP_GLOBAL_MASK(0xff)
@@ -1964,6 +1968,11 @@ static MACHINE_CONFIG_DERIVED( system16a_no7751, system16a )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
+static MACHINE_CONFIG_DERIVED( system16a_no7751p, system16a_no7751 )
+ MCFG_DEVICE_MODIFY("soundcpu")
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(sound_decrypted_opcodes_map)
+MACHINE_CONFIG_END
+
/*
static MACHINE_CONFIG_DERIVED( system16a_i8751_no7751, system16a_i8751 )
MCFG_DEVICE_REMOVE("n7751")
@@ -3503,7 +3512,59 @@ DRIVER_INIT_MEMBER(segas16a_state,quartet)
DRIVER_INIT_MEMBER(segas16a_state,fantzonep)
{
DRIVER_INIT_CALL(generic);
- sega_315_5177_decode(machine(), "soundcpu");
+
+ // 315-5177
+ static const UINT8 xor_table[128] =
+ {
+ 0x04,0x54,0x51,0x15,0x40,0x44,0x01,0x51,0x55,0x10,0x44,0x41,
+ 0x05,0x55,0x50,0x14,0x41,0x45,0x00,0x50,0x54,0x11,0x45,0x40,
+ 0x04,0x54,0x51,0x15,0x40,0x44,0x01,0x51,0x55,0x10,0x44,0x41,
+ 0x05,0x55,0x50,0x14,0x41,0x45,0x00,0x50,0x54,0x11,0x45,0x40,
+ 0x04,0x54,0x51,0x15,0x40,0x44,0x01,0x51,0x55,0x10,0x44,0x41,
+ 0x05,0x55,0x50,0x14,
+
+ 0x04,0x54,0x51,0x15,0x40,0x44,0x01,0x51,0x55,0x10,0x44,0x41,
+ 0x05,0x55,0x50,0x14,0x41,0x45,0x00,0x50,0x54,0x11,0x45,0x40,
+ 0x04,0x54,0x51,0x15,0x40,0x44,0x01,0x51,0x55,0x10,0x44,0x41,
+ 0x05,0x55,0x50,0x14,0x41,0x45,0x00,0x50,0x54,0x11,0x45,0x40,
+ 0x04,0x54,0x51,0x15,0x40,0x44,0x01,0x51,0x55,0x10,0x44,0x41,
+ 0x05,0x55,0x50,0x14,
+ };
+
+ static const int swap_table[128] =
+ {
+ 0,0,0,0,
+ 1,1,1,1,1,
+ 2,2,2,2,2,
+ 3,3,3,3,
+ 4,4,4,4,4,
+ 5,5,5,5,5,
+ 6,6,6,6,6,
+ 7,7,7,7,7,
+ 8,8,8,8,
+ 9,9,9,9,9,
+ 10,10,10,10,10,
+ 11,11,11,11,11,
+ 12,12,12,12,12,
+ 13,13,
+
+ 8,8,8,8,
+ 9,9,9,9,9,
+ 10,10,10,10,10,
+ 11,11,11,11,
+ 12,12,12,12,12,
+ 13,13,13,13,13,
+ 14,14,14,14,14,
+ 15,15,15,15,15,
+ 16,16,16,16,
+ 17,17,17,17,17,
+ 18,18,18,18,18,
+ 19,19,19,19,19,
+ 20,20,20,20,20,
+ 21,21,
+ };
+
+ sega_decode_2(memregion("soundcpu")->base(), m_sound_decrypted_opcodes, xor_table, swap_table);
}
DRIVER_INIT_MEMBER(segas16a_state,sdi)
@@ -3545,7 +3606,7 @@ GAME( 1986, alexkidd, 0, system16a, alexkidd, segas16a
GAME( 1986, alexkidd1, alexkidd, system16a_fd1089a, alexkidd, segas16a_state,generic, ROT0, "Sega", "Alex Kidd: The Lost Stars (set 1, FD1089A 317-0021)", GAME_SUPPORTS_SAVE )
GAME( 1986, fantzone, 0, system16a_no7751, fantzone, segas16a_state,generic, ROT0, "Sega", "Fantasy Zone (Rev A, unprotected)", GAME_SUPPORTS_SAVE )
GAME( 1986, fantzone1, fantzone, system16a_no7751, fantzone, segas16a_state,generic, ROT0, "Sega", "Fantasy Zone (unprotected)", GAME_SUPPORTS_SAVE )
-GAME( 1986, fantzonep, fantzone, system16a_no7751, fantzone, segas16a_state,fantzonep, ROT0, "Sega", "Fantasy Zone (317-5000)", GAME_SUPPORTS_SAVE )
+GAME( 1986, fantzonep, fantzone, system16a_no7751p, fantzone, segas16a_state,fantzonep, ROT0, "Sega", "Fantasy Zone (317-5000)", GAME_SUPPORTS_SAVE )
GAME( 1986, fantzonepr, fantzone, system16a_no7751, fantzone, segas16a_state,generic, ROT0, "Sega", "Fantasy Zone (prototype)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) // bad / missing gfx roms
GAME( 1988, passsht16a, passsht, system16a_fd1094, passsht16a, segas16a_state,passsht16a, ROT270, "Sega", "Passing Shot (Japan, 4 Players, System 16A, FD1094 317-0071)", GAME_SUPPORTS_SAVE )
GAME( 1987, sdi, 0, system16a_fd1089b_no7751, sdi, segas16a_state,sdi, ROT0, "Sega", "SDI - Strategic Defense Initiative (Japan, newer, System 16A, FD1089B 317-0027)", GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/segas16b.c b/src/mame/drivers/segas16b.c
index 6b2206f5bbf..8c8955577d5 100644
--- a/src/mame/drivers/segas16b.c
+++ b/src/mame/drivers/segas16b.c
@@ -926,8 +926,8 @@ void segas16b_state::memory_mapper(sega_315_5195_mapper_device &mapper, UINT8 in
case 2: // 3rd ROM base, or board-specific banking
switch (m_romboard)
{
- case ROM_BOARD_171_5358_SMALL: mapper.map_as_rom(0x00000, 0x20000, 0xfe0000, "rom2base", 0x20000, write16_delegate()); break;
- case ROM_BOARD_171_5358: mapper.map_as_rom(0x00000, 0x20000, 0xfe0000, "rom2base", 0x40000, write16_delegate()); break;
+ case ROM_BOARD_171_5358_SMALL: mapper.map_as_rom(0x00000, 0x20000, 0xfe0000, "rom2base", "decrypted_rom2base", 0x20000, write16_delegate()); break;
+ case ROM_BOARD_171_5358: mapper.map_as_rom(0x00000, 0x20000, 0xfe0000, "rom2base", "decrypted_rom2base", 0x40000, write16_delegate()); break;
case ROM_BOARD_171_5521:
case ROM_BOARD_171_5704: mapper.map_as_handler(0x00000, 0x10000, 0xff0000, read16_delegate(), write16_delegate(FUNC(segas16b_state::rom_5704_bank_w), this)); break;
case ROM_BOARD_171_5797: mapper.map_as_handler(0x00000, 0x10000, 0xff0000, read16_delegate(FUNC(segas16b_state::unknown_rgn2_r), this), write16_delegate(FUNC(segas16b_state::unknown_rgn2_w), this)); break;
@@ -939,10 +939,10 @@ void segas16b_state::memory_mapper(sega_315_5195_mapper_device &mapper, UINT8 in
case 1: // 2nd ROM base, banking & math, or sound for Korean games
switch (m_romboard)
{
- case ROM_BOARD_171_5358_SMALL: mapper.map_as_rom(0x00000, 0x20000, 0xfe0000, "rom1base", 0x10000, write16_delegate()); break;
- case ROM_BOARD_171_5358: mapper.map_as_rom(0x00000, 0x20000, 0xfe0000, "rom1base", 0x20000, write16_delegate()); break;
+ case ROM_BOARD_171_5358_SMALL: mapper.map_as_rom(0x00000, 0x20000, 0xfe0000, "rom1base", "decrypted_rom1base", 0x10000, write16_delegate()); break;
+ case ROM_BOARD_171_5358: mapper.map_as_rom(0x00000, 0x20000, 0xfe0000, "rom1base", "decrypted_rom1base", 0x20000, write16_delegate()); break;
case ROM_BOARD_171_5521:
- case ROM_BOARD_171_5704: mapper.map_as_rom(0x00000, 0x40000, 0xfc0000, "rom1base", 0x40000, write16_delegate()); break;
+ case ROM_BOARD_171_5704: mapper.map_as_rom(0x00000, 0x40000, 0xfc0000, "rom1base", "decrypted_rom1base", 0x40000, write16_delegate()); break;
case ROM_BOARD_KOREAN: mapper.map_as_handler(0x00000, 0x10000, 0xff0000, read16_delegate(), write16_delegate(FUNC(segas16b_state::atomicp_sound_w), this)); break;
case ROM_BOARD_171_5797: mapper.map_as_handler(0x00000, 0x04000, 0xffc000, read16_delegate(FUNC(segas16b_state::rom_5797_bank_math_r), this), write16_delegate(FUNC(segas16b_state::rom_5797_bank_math_w), this)); break;
default: assert(false);
@@ -952,12 +952,12 @@ void segas16b_state::memory_mapper(sega_315_5195_mapper_device &mapper, UINT8 in
case 0: // 1st ROM base
switch (m_romboard)
{
- case ROM_BOARD_171_5358_SMALL: mapper.map_as_rom(0x00000, 0x20000, 0xfe0000, "rom0base", 0x00000, write16_delegate()); break;
- case ROM_BOARD_171_5358: mapper.map_as_rom(0x00000, 0x20000, 0xfe0000, "rom0base", 0x00000, write16_delegate()); break;
+ case ROM_BOARD_171_5358_SMALL: mapper.map_as_rom(0x00000, 0x20000, 0xfe0000, "rom0base", "decrypted_rom0base", 0x00000, write16_delegate()); break;
+ case ROM_BOARD_171_5358: mapper.map_as_rom(0x00000, 0x20000, 0xfe0000, "rom0base", "decrypted_rom0base", 0x00000, write16_delegate()); break;
case ROM_BOARD_171_5521:
- case ROM_BOARD_171_5704: mapper.map_as_rom(0x00000, 0x40000, 0xfc0000, "rom0base", 0000000, write16_delegate()); break;
- case ROM_BOARD_KOREAN: mapper.map_as_rom(0x00000, 0x40000, 0xfc0000, "rom0base", 0000000, write16_delegate()); break;
- case ROM_BOARD_171_5797: mapper.map_as_rom(0x00000, 0x80000, 0xf80000, "rom0base", 0000000, write16_delegate()); break;
+ case ROM_BOARD_171_5704: mapper.map_as_rom(0x00000, 0x40000, 0xfc0000, "rom0base", "decrypted_rom0base", 0000000, write16_delegate()); break;
+ case ROM_BOARD_KOREAN: mapper.map_as_rom(0x00000, 0x40000, 0xfc0000, "rom0base", "decrypted_rom0base", 0000000, write16_delegate()); break;
+ case ROM_BOARD_171_5797: mapper.map_as_rom(0x00000, 0x80000, 0xf80000, "rom0base", "decrypted_rom0base", 0000000, write16_delegate()); break;
default: assert(false);
}
break;
@@ -1742,6 +1742,12 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, segas16b_state )
AM_RANGE(0xf800, 0xffff) AM_RAM
ADDRESS_MAP_END
+static ADDRESS_MAP_START( sound_decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 8, segas16b_state )
+ ADDRESS_MAP_UNMAP_HIGH
+ AM_RANGE(0x0000, 0x7fff) AM_ROM AM_SHARE("sound_decrypted_opcodes")
+ AM_RANGE(0x8000, 0xdfff) AM_ROMBANK("soundbank")
+ADDRESS_MAP_END
+
static ADDRESS_MAP_START( sound_portmap, AS_IO, 8, segas16b_state )
ADDRESS_MAP_UNMAP_HIGH
ADDRESS_MAP_GLOBAL_MASK(0xff)
@@ -3320,6 +3326,10 @@ static MACHINE_CONFIG_START( system16b, segas16b_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.48)
MACHINE_CONFIG_END
+static MACHINE_CONFIG_DERIVED( system16b_mc8123, system16b )
+ MCFG_CPU_MODIFY("soundcpu")
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(sound_decrypted_opcodes_map)
+MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( system16b_fd1089a, system16b )
MCFG_CPU_REPLACE("maincpu", FD1089A, MASTER_CLOCK_10MHz)
@@ -4538,6 +4548,48 @@ ROM_START( dunkshot )
ROM_LOAD( "317-0022.key", 0x0000, 0x2000, CRC(4eedc66d) SHA1(50588fa13bf25a2d1322579cdc9937450543c978) )
ROM_END
+ROM_START( dunkshota ) // several roms had replacement? (different style to others) labels with 'T' markings, content identical.
+ ROM_REGION( 0x30000, "maincpu", 0 ) // 68000 code
+ ROM_LOAD16_BYTE( "epr-10520a.a1", 0x000001, 0x8000, CRC(16e213ba) SHA1(efddff17d1802ccbea9eac69cedef62fa6b9a640) )
+ ROM_LOAD16_BYTE( "epr-10523a.a4", 0x000000, 0x8000, CRC(22e3f074) SHA1(acdb6952308957244355bedb9cc627314a0139ef) )
+ ROM_LOAD16_BYTE( "epr-10521.a2", 0x010001, 0x8000, CRC(e2d5f97a) SHA1(bf7b4a029580633fee65be89d5c9c83ff76a8484) ) // == epr-10468.a2
+ ROM_LOAD16_BYTE( "epr-10524.a5", 0x010000, 0x8000, CRC(22777314) SHA1(fbc35505a94c8d4bdb44ee058e9e2e9e9b377c5c) ) // == epr-10471.a5
+ ROM_LOAD16_BYTE( "epr-10522.a3", 0x020001, 0x8000, CRC(e5b5f754) SHA1(af02c46437e3cf62331753dc405211b7f90e3f62) )
+ ROM_LOAD16_BYTE( "epr-10525.a6", 0x020000, 0x8000, CRC(7f41f334) SHA1(631f6113f3c0c47f2dd1ee0ea6e7db4321d7366d) )
+
+ ROM_REGION( 0x18000, "gfx1", 0 ) // tiles
+ ROM_LOAD( "epr-10528.b9", 0x00000, 0x8000, CRC(a8a3762d) SHA1(af75df6eda0df903e2b3f9680cd128da4227961d) )
+ ROM_LOAD( "epr-10529.b10", 0x08000, 0x8000, CRC(80cbff50) SHA1(3641ee337194d56d774bf1be91939d03f3c0f77b) )
+ ROM_LOAD( "epr-10530.b11", 0x10000, 0x8000, CRC(2dbe1e52) SHA1(a6b74f88e2f47322fbde1f6682cae58caf79f6c8) )
+
+ ROM_REGION16_BE( 0x80000, "sprites", 0 ) // sprites
+ ROM_LOAD16_BYTE( "epr-10481.b5", 0x00000, 0x8000, CRC(feb04bc9) SHA1(233dc8e3b887a88ac114723d58a909a58f0ae771) )
+ ROM_RELOAD( 0x10000, 0x8000 )
+ ROM_LOAD16_BYTE( "epr-10477.b1", 0x00001, 0x8000, CRC(f9d3b2cb) SHA1(b530fe16882c718122bfd1de098f39e54993de28) )
+ ROM_RELOAD( 0x10001, 0x8000 )
+ ROM_LOAD16_BYTE( "epr-10482.b6", 0x20000, 0x8000, CRC(5bc07618) SHA1(f4c88f81b407d467f958181770ea4fd32aab3daf) )
+ ROM_RELOAD( 0x30000, 0x8000 )
+ ROM_LOAD16_BYTE( "epr-10478.b2", 0x20001, 0x8000, CRC(5b5c5c92) SHA1(1c6f1cafa0788678c80ade11560f4a8d8bb7272a) )
+ ROM_RELOAD( 0x30001, 0x8000 )
+ ROM_LOAD16_BYTE( "epr-10483.b7", 0x40000, 0x8000, CRC(7cab4f9e) SHA1(2310a9fe604f78d74d84bea301c95e6f0e6a6085) )
+ ROM_RELOAD( 0x50000, 0x8000 )
+ ROM_LOAD16_BYTE( "epr-10479.b3", 0x40001, 0x8000, CRC(e84190a0) SHA1(23a8799adf81e1884a8c6b4c55397b8bca2f1850) )
+ ROM_RELOAD( 0x50001, 0x8000 )
+ ROM_LOAD16_BYTE( "epr-10527.b8", 0x60000, 0x8000, CRC(39b1a242) SHA1(cf0c0768d006a18345b66dd389acba1e8192ec53) )
+ ROM_RELOAD( 0x70000, 0x8000 )
+ ROM_LOAD16_BYTE( "epr-10526.b4", 0x60001, 0x8000, CRC(bf200754) SHA1(60900d80cfea147b011813dde558c1d39fdd274c) )
+ ROM_RELOAD( 0x70001, 0x8000 )
+
+ ROM_REGION( 0x50000, "soundcpu", 0 ) // sound CPU
+ ROM_LOAD( "epr-10473.a7", 0x00000, 0x08000, CRC(7f1f5a27) SHA1(7ff91b95c883b395ab4ff5e440d78e553a09e623) )
+ ROM_LOAD( "epr-10474.a8", 0x10000, 0x08000, CRC(419a656e) SHA1(aa734ae835761badeb069f99acc5fded2a19b3a3) )
+ ROM_LOAD( "epr-10475.a9", 0x20000, 0x08000, CRC(17d55e85) SHA1(0c414bafecbfaa82679cc155f15f5255c186358d) )
+ ROM_LOAD( "epr-10476.a10", 0x30000, 0x08000, CRC(a6be0956) SHA1(fc4d6e25e0b46679f94fddbb1850fb0b02f8d84b) )
+
+ ROM_REGION( 0x2000, "maincpu:key", 0 ) // decryption key
+ ROM_LOAD( "317-0022.key", 0x0000, 0x2000, CRC(4eedc66d) SHA1(50588fa13bf25a2d1322579cdc9937450543c978) )
+ROM_END
+
ROM_START( dunkshoto )
ROM_REGION( 0x30000, "maincpu", 0 ) // 68000 code
@@ -6717,7 +6769,7 @@ DRIVER_INIT_MEMBER(segas16b_state,aceattac_5358)
DRIVER_INIT_MEMBER(segas16b_state,aliensyn7_5358_small)
{
DRIVER_INIT_CALL(generic_5358_small);
- mc8123_decrypt_rom(machine(), "soundcpu", "mcu", NULL, 0);
+ mc8123_decode(memregion("soundcpu")->base(), m_sound_decrypted_opcodes, memregion("mcu")->base(), 0x8000);
}
DRIVER_INIT_MEMBER(segas16b_state,altbeast_5521)
@@ -6741,7 +6793,7 @@ DRIVER_INIT_MEMBER(segas16b_state,altbeas5_5521)
DRIVER_INIT_MEMBER(segas16b_state,altbeas4_5521)
{
DRIVER_INIT_CALL(generic_5521);
- mc8123_decrypt_rom(machine(), "soundcpu", "mcu", NULL, 0);
+ mc8123_decode(memregion("soundcpu")->base(), m_sound_decrypted_opcodes, memregion("mcu")->base(), 0x8000);
}
DRIVER_INIT_MEMBER(segas16b_state,ddux_5704)
@@ -6799,7 +6851,7 @@ DRIVER_INIT_MEMBER(segas16b_state,passshtj_5358)
DRIVER_INIT_MEMBER(segas16b_state,cencourt_5358)
{
DRIVER_INIT_CALL(passshtj_5358);
- mc8123_decrypt_rom(machine(), "soundcpu", "mcu", NULL, 0);
+ mc8123_decode(memregion("soundcpu")->base(), m_sound_decrypted_opcodes, memregion("mcu")->base(), 0x8000);
}
DRIVER_INIT_MEMBER(segas16b_state,sdi_5358_small)
@@ -6817,13 +6869,13 @@ DRIVER_INIT_MEMBER(segas16b_state,defense_5358_small)
DRIVER_INIT_MEMBER(segas16b_state,shinobi4_5521)
{
DRIVER_INIT_CALL(generic_5521);
- mc8123_decrypt_rom(machine(), "soundcpu", "mcu", NULL, 0);
+ mc8123_decode(memregion("soundcpu")->base(), m_sound_decrypted_opcodes, memregion("mcu")->base(), 0x8000);
}
DRIVER_INIT_MEMBER(segas16b_state,shinobi3_5358)
{
DRIVER_INIT_CALL(generic_5358);
- mc8123_decrypt_rom(machine(), "soundcpu", "mcu", NULL, 0);
+ mc8123_decode(memregion("soundcpu")->base(), m_sound_decrypted_opcodes, memregion("mcu")->base(), 0x8000);
}
DRIVER_INIT_MEMBER(segas16b_state,sjryuko_5358_small)
@@ -6868,7 +6920,7 @@ DRIVER_INIT_MEMBER(segas16b_state,snapper)
GAME( 1988, aceattac, 0, system16b_fd1094, aceattac, segas16b_state,aceattac_5358, ROT270, "Sega", "Ace Attacker (FD1094 317-0059)", 0 )
GAME( 1987, aliensyn, 0, system16b, aliensyn, segas16b_state,generic_5358_small, ROT0, "Sega", "Alien Syndrome (set 4, System 16B, unprotected)", 0 )
-GAME( 1987, aliensyn7, aliensyn, system16b, aliensyn, segas16b_state,aliensyn7_5358_small, ROT0, "Sega", "Alien Syndrome (set 7, System 16B, MC-8123B 317-00xx)", 0 )
+GAME( 1987, aliensyn7, aliensyn, system16b_mc8123, aliensyn, segas16b_state,aliensyn7_5358_small, ROT0, "Sega", "Alien Syndrome (set 7, System 16B, MC-8123B 317-00xx)", 0 )
GAME( 1987, aliensyn3, aliensyn, system16b_fd1089a, aliensyn, segas16b_state,generic_5358_small, ROT0, "Sega", "Alien Syndrome (set 3, System 16B, FD1089A 317-0033)", 0 )
GAME( 1987, aliensynj, aliensyn, system16b_fd1089a, aliensynj,segas16b_state,generic_5358_small, ROT0, "Sega", "Alien Syndrome (set 6, Japan, new, System 16B, FD1089A 317-0033)", 0 )
@@ -6876,9 +6928,9 @@ GAME( 1988, altbeast, 0, system16b_i8751, altbeast, segas16b_state,
GAME( 1988, altbeastj, altbeast, system16b_i8751, altbeast, segas16b_state,altbeasj_5521, ROT0, "Sega", "Juuouki (set 7, Japan, 8751 317-0077)", 0 )
GAME( 1988, altbeast6, altbeast, system16b_i8751, altbeast, segas16b_state,altbeas5_5521, ROT0, "Sega", "Altered Beast (set 6, 8751 317-0076)", 0 )
GAME( 1988, altbeast5, altbeast, system16b_fd1094, altbeast, segas16b_state,generic_5521, ROT0, "Sega", "Altered Beast (set 5, FD1094 317-0069)", 0 )
-GAME( 1988, altbeast4, altbeast, system16b, altbeast, segas16b_state,altbeas4_5521, ROT0, "Sega", "Altered Beast (set 4, MC-8123B 317-0066)", 0 )
+GAME( 1988, altbeast4, altbeast, system16b_mc8123, altbeast, segas16b_state,altbeas4_5521, ROT0, "Sega", "Altered Beast (set 4, MC-8123B 317-0066)", 0 )
GAME( 1988, altbeastj3, altbeast, system16b_fd1094, altbeast, segas16b_state,generic_5521, ROT0, "Sega", "Juuouki (set 3, Japan, FD1094 317-0068)", 0 )
-GAME( 1988, altbeast2, altbeast, system16b, altbeast, segas16b_state,altbeas4_5521, ROT0, "Sega", "Altered Beast (set 2, MC-8123B 317-0066)", 0 )
+GAME( 1988, altbeast2, altbeast, system16b_mc8123, altbeast, segas16b_state,altbeas4_5521, ROT0, "Sega", "Altered Beast (set 2, MC-8123B 317-0066)", 0 )
GAME( 1988, altbeastj1, altbeast, system16b_fd1094, altbeast, segas16b_state,generic_5521, ROT0, "Sega", "Juuouki (set 1, Japan, FD1094 317-0065)", 0 )
GAME( 1990, aurail, 0, system16b, aurail, segas16b_state,generic_5704, ROT0, "Sega / Westone", "Aurail (set 3, US, unprotected)", 0 )
@@ -6903,6 +6955,7 @@ GAME( 1988, dduxj, ddux, system16b_fd1094, ddux, segas16b_state,
GAME( 1988, ddux1, ddux, system16b_i8751, ddux, segas16b_state,ddux_5704, ROT0, "Sega", "Dynamite Dux (set 1, 8751 317-0095)", 0 )
GAME( 1987, dunkshot, 0, system16b_fd1089a, dunkshot, segas16b_state,dunkshot_5358_small,ROT0, "Sega", "Dunk Shot (Rev C, FD1089A 317-0022)", 0 )
+GAME( 1987, dunkshota, dunkshot, system16b_fd1089a, dunkshot, segas16b_state,dunkshot_5358_small,ROT0, "Sega", "Dunk Shot (Rev A, FD1089A 317-0022)", 0 )
GAME( 1986, dunkshoto, dunkshot, system16b_fd1089a, dunkshot, segas16b_state,dunkshot_5358_small,ROT0, "Sega", "Dunk Shot (FD1089A 317-0022)", 0 )
GAME( 1989, eswat, 0, system16b_fd1094_5797,eswat, segas16b_state,generic_5797, ROT0, "Sega", "E-Swat - Cyber Police (set 4, World, FD1094 317-0130)", 0 )
@@ -6931,7 +6984,7 @@ GAME( 1989, mvpj, mvp, system16b_fd1094, mvp, segas16b_state,
GAME( 1988, passsht, 0, system16b_fd1094, passsht, segas16b_state,generic_5358, ROT270, "Sega", "Passing Shot (World, 2 Players, FD1094 317-0080)", 0 )
GAME( 1988, passshta, passsht, system16b_fd1094, passshtj, segas16b_state,passshtj_5358, ROT270, "Sega", "Passing Shot (World, 4 Players, FD1094 317-0074)", 0 )
GAME( 1988, passshtj, passsht, system16b_fd1094, passshtj, segas16b_state,passshtj_5358, ROT270, "Sega", "Passing Shot (Japan, 4 Players, FD1094 317-0070)", 0 )
-GAME( 1988, cencourt, passsht, system16b, cencourt, segas16b_state,cencourt_5358, ROT270, "Sega", "Center Court (World, 4 Players, prototype, MC-8123B)", 0 )
+GAME( 1988, cencourt, passsht, system16b_mc8123, cencourt, segas16b_state,cencourt_5358, ROT270, "Sega", "Center Court (World, 4 Players, prototype, MC-8123B)", 0 )
GAME( 1991, riotcity, 0, system16b, riotcity, segas16b_state,generic_5704, ROT0, "Sega / Westone", "Riot City (Japan)", 0 )
@@ -6942,8 +6995,8 @@ GAME( 1987, sdib, sdi, system16b_fd1089a, sdi, segas16b_state,
GAME( 1987, sdibl, sdi, system16b, sdi, segas16b_state,sdi_5358_small, ROT0, "bootleg", "SDI - Strategic Defense Initiative (bootleg)", 0 )
GAME( 1987, shinobi5, shinobi, system16b, shinobi, segas16b_state,generic_5521, ROT0, "Sega", "Shinobi (set 5, System 16B, unprotected)", 0 )
-GAME( 1987, shinobi4, shinobi, system16b, shinobi, segas16b_state,shinobi4_5521, ROT0, "Sega", "Shinobi (set 4, System 16B, MC-8123B 317-0054)", 0 )
-GAME( 1987, shinobi3, shinobi, system16b, shinobi, segas16b_state,shinobi3_5358, ROT0, "Sega", "Shinobi (set 3, System 16B, MC-8123B 317-0054)", 0 )
+GAME( 1987, shinobi4, shinobi, system16b_mc8123, shinobi, segas16b_state,shinobi4_5521, ROT0, "Sega", "Shinobi (set 4, System 16B, MC-8123B 317-0054)", 0 )
+GAME( 1987, shinobi3, shinobi, system16b_mc8123, shinobi, segas16b_state,shinobi3_5358, ROT0, "Sega", "Shinobi (set 3, System 16B, MC-8123B 317-0054)", 0 )
GAME( 1987, shinobi2, shinobi, system16b_fd1094, shinobi, segas16b_state,generic_5358, ROT0, "Sega", "Shinobi (set 2, System 16B, FD1094 317-0049)", 0 )
GAME( 1987, sonicbom, 0, system16b_fd1094, sonicbom, segas16b_state,generic_5358, ROT270, "Sega", "Sonic Boom (FD1094 317-0053)", 0 )
diff --git a/src/mame/drivers/segas18.c b/src/mame/drivers/segas18.c
index afd68a1d736..609a0509227 100644
--- a/src/mame/drivers/segas18.c
+++ b/src/mame/drivers/segas18.c
@@ -84,13 +84,13 @@ void segas18_state::memory_mapper(sega_315_5195_mapper_device &mapper, UINT8 ind
switch (m_romboard)
{
case ROM_BOARD_171_SHADOW: mapper.map_as_handler(0x00000, 0x00010, 0xfffff0, read16_delegate(FUNC(segas18_state::genesis_vdp_r), this), write16_delegate(FUNC(segas18_state::genesis_vdp_w), this)); break;
- case ROM_BOARD_171_5874: mapper.map_as_rom(0x00000, 0x80000, 0xf80000, "rom1base", 0x80000, write16_delegate()); break;
+ case ROM_BOARD_171_5874: mapper.map_as_rom(0x00000, 0x80000, 0xf80000, "rom1base", "decrypted_rom1base", 0x80000, write16_delegate()); break;
case ROM_BOARD_171_5987: if (romsize <= 0x100000)
- mapper.map_as_rom(0x00000, 0x80000, 0xf80000, "rom1base", 0x80000, write16_delegate(FUNC(segas18_state::rom_5987_bank_w), this));
+ mapper.map_as_rom(0x00000, 0x80000, 0xf80000, "rom1base", "decrypted_rom1base", 0x80000, write16_delegate(FUNC(segas18_state::rom_5987_bank_w), this));
else
- mapper.map_as_rom(0x00000,0x100000, 0xf00000, "rom1base",0x100000, write16_delegate(FUNC(segas18_state::rom_5987_bank_w), this));
+ mapper.map_as_rom(0x00000,0x100000, 0xf00000, "rom1base", "decrypted_rom1base",0x100000, write16_delegate(FUNC(segas18_state::rom_5987_bank_w), this));
break;
- case ROM_BOARD_837_7525: mapper.map_as_rom(0x00000, 0x80000, 0xf80000, "rom1base", 0x80000, write16_delegate(FUNC(segas18_state::rom_837_7525_bank_w), this));
+ case ROM_BOARD_837_7525: mapper.map_as_rom(0x00000, 0x80000, 0xf80000, "rom1base", "decrypted_rom1base", 0x80000, write16_delegate(FUNC(segas18_state::rom_837_7525_bank_w), this));
break;
default: assert(false);
@@ -101,12 +101,12 @@ void segas18_state::memory_mapper(sega_315_5195_mapper_device &mapper, UINT8 ind
switch (m_romboard)
{
case ROM_BOARD_171_SHADOW:
- case ROM_BOARD_171_5874: mapper.map_as_rom(0x00000, 0x80000, 0xf80000, "rom0base", 0x00000, write16_delegate()); break;
+ case ROM_BOARD_171_5874: mapper.map_as_rom(0x00000, 0x80000, 0xf80000, "rom0base", "decrypted_rom0base", 0x00000, write16_delegate()); break;
case ROM_BOARD_837_7525:
case ROM_BOARD_171_5987: if (romsize <= 0x100000)
- mapper.map_as_rom(0x00000, 0x80000, 0xf80000, "rom0base", 0x00000, write16_delegate());
+ mapper.map_as_rom(0x00000, 0x80000, 0xf80000, "rom0base", "decrypted_rom0base", 0x00000, write16_delegate());
else
- mapper.map_as_rom(0x00000,0x100000, 0xf00000, "rom0base", 0x00000, write16_delegate());
+ mapper.map_as_rom(0x00000,0x100000, 0xf00000, "rom0base", "decrypted_rom0base", 0x00000, write16_delegate());
break;
default: assert(false);
}
diff --git a/src/mame/drivers/segas24.c b/src/mame/drivers/segas24.c
index 4c691aa7898..c7f49105306 100644
--- a/src/mame/drivers/segas24.c
+++ b/src/mame/drivers/segas24.c
@@ -1978,7 +1978,7 @@ ROM_START( hotrod )
ROM_LOAD16_BYTE( "epr-11338.ic1", 0x000001, 0x20000, CRC(7d4a7ff3) SHA1(3d3af04d990d232ba0a8fe155de59bc632a0a461) )
ROM_REGION( 0x1d6000, "floppy", 0)
- ROM_LOAD( "ds3-5000-01d_3p_turbo.img", 0x000000, 0x1d6000, CRC(627e8053) SHA1(d1a95f99078f5a29cccacfb1b30c3c9ead7b605c) )
+ ROM_LOAD( "ds3-5000-01d_3p_turbo.img", 0x000000, 0x1d6000, CRC(842006fd) SHA1(d5432f58c0fb39f2bf62786a0d842bdd469ab2cb) )
ROM_END
ROM_START( hotroda )
@@ -1987,7 +1987,16 @@ ROM_START( hotroda )
ROM_LOAD16_BYTE( "epr-11338.ic1", 0x000001, 0x20000, CRC(7d4a7ff3) SHA1(3d3af04d990d232ba0a8fe155de59bc632a0a461) )
ROM_REGION( 0x1d6000, "floppy", 0)
- ROM_LOAD( "ds3-5000-01d.img", 0x000000, 0x1d6000, CRC(abf67b02) SHA1(f397435eaad691ff5a38d6d1d27840ed95a62df3) ) // World? 3 Player TURBO
+ ROM_LOAD( "ds3-5000-01d.img", 0x000000, 0x1d6000, CRC(e25c6b63) SHA1(fbf86d2ebccd8053b990939f63f5497907d18321) )
+ROM_END
+
+ROM_START( hotrodja )
+ ROM_REGION( 0x100000, "maincpu", 0 ) /* 68000 code */
+ ROM_LOAD16_BYTE( "epr-11339.ic2", 0x000000, 0x20000, CRC(75130e73) SHA1(e079739f4a3da3807aac570442c5afef1a7d7b0e) )
+ ROM_LOAD16_BYTE( "epr-11338.ic1", 0x000001, 0x20000, CRC(7d4a7ff3) SHA1(3d3af04d990d232ba0a8fe155de59bc632a0a461) )
+
+ ROM_REGION( 0x1d6000, "floppy", 0)
+ ROM_LOAD( "ds3-5000-01a-rev-b.img", 0x000000, 0x1d6000, CRC(c18f6dca) SHA1(6f2b5a9567a340324a5f3fb57a3b744de0924a23) )
ROM_END
ROM_START( hotrodj )
@@ -1996,7 +2005,7 @@ ROM_START( hotrodj )
ROM_LOAD16_BYTE( "epr-11338.ic1", 0x000001, 0x20000, CRC(7d4a7ff3) SHA1(3d3af04d990d232ba0a8fe155de59bc632a0a461) )
ROM_REGION( 0x1d6000, "floppy", 0)
- ROM_LOAD( "ds3-5000-01a-rev-b.img", 0x000000, 0x1d6000, CRC(a39a0c2d) SHA1(ea8104c2266c48f480837aa7679c0a6f0c5e5452) ) // Japanese 4 Player
+ ROM_LOAD( "ds3-5000-01a-rev-c.img", 0x000000, 0x1d6000, CRC(852f9b5f) SHA1(159e161f55beed0f90cce8a73b0aeb4564d6af90) )
ROM_END
ROM_START( qgh )
@@ -2071,7 +2080,7 @@ ROM_START( bnzabros )
ROM_RELOAD ( 0x180001, 0x40000)
ROM_REGION( 0x1c2000, "floppy", 0)
- ROM_LOAD( "ds3-5000-07d.img", 0x000000, 0x1c2000, CRC(ea7a3302) SHA1(5f92efb2e1135c1f3eeca38ba5789739a22dbd11) ) /* Region letter needs to be verfied */
+ ROM_LOAD( "ds3-5000-07d.img", 0x000000, 0x1c2000, CRC(2e70251f) SHA1(1c2616dfa5cc15e8ebf1424012f2dd66f3a001a1) ) /* Region letter needs to be verfied */
ROM_END
ROM_START( bnzabrosj )
@@ -2111,7 +2120,7 @@ ROM_START( sspirits )
ROM_LOAD16_BYTE( "epr-12186.ic1", 0x000001, 0x20000, CRC(ce76319d) SHA1(0ede61f0700f9161285c768fa97636f0e42b96f8) )
ROM_REGION( 0x1c2000, "floppy", 0)
- ROM_LOAD( "ds3-5000-02-.img", 0x000000, 0x1c2000, CRC(cefbda69) SHA1(5b47ae0f1584ce1eb697246273ba761bd9e981c1) )
+ ROM_LOAD( "ds3-5000-02-.img", 0x000000, 0x1c2000, CRC(179b98e9) SHA1(f6fc52c599c336d5c6f7aa199515268b4b3218a8) )
ROM_END
ROM_START( sspiritj )
@@ -2157,7 +2166,7 @@ ROM_START( sgmastc )
ROM_LOAD( "317-0058-05c.key", 0x0000, 0x2000, CRC(ae0eabe5) SHA1(692d7565bf9c5b32cc80bb4bd88c9193aa04cbb0) )
ROM_REGION( 0x1c2000, "floppy", 0)
- ROM_LOAD( "ds3-5000-05c.img", 0x000000, 0x1c2000, CRC(06c4f834) SHA1(5e178ed0edff7721c93f76da2e03ae188dc5efa4) )
+ ROM_LOAD( "ds3-5000-05c.img", 0x000000, 0x1c2000, CRC(63a6ef3a) SHA1(f39fe0bf8930de994b1a77e0ba787d249d73c5e5) )
ROM_END
ROM_START( sgmastj )
@@ -2466,7 +2475,8 @@ DRIVER_INIT_MEMBER(segas24_state,roughrac)
/* Disk Based Games */
/* 01 */GAME( 1988, hotrod, 0, system24_floppy, hotrod, segas24_state, hotrod, ROT0, "Sega", "Hot Rod (World, 3 Players, Turbo set 1, Floppy Based)", 0 )
/* 01 */GAME( 1988, hotroda, hotrod, system24_floppy, hotrod, segas24_state, hotrod, ROT0, "Sega", "Hot Rod (World, 3 Players, Turbo set 2, Floppy Based)", 0 )
-/* 01 */GAME( 1988, hotrodj, hotrod, system24_floppy, hotrodj, segas24_state, hotrod, ROT0, "Sega", "Hot Rod (Japan, 4 Players, Floppy Based)", 0 )
+/* 01 */GAME( 1988, hotrodj, hotrod, system24_floppy, hotrodj, segas24_state, hotrod, ROT0, "Sega", "Hot Rod (Japan, 4 Players, Floppy Based, Rev C)", 0 )
+/* 01 */GAME( 1988, hotrodja, hotrod, system24_floppy, hotrodj, segas24_state, hotrod, ROT0, "Sega", "Hot Rod (Japan, 4 Players, Floppy Based, Rev B)", 0 )
/* 02 */GAME( 1988, sspirits, 0, system24_floppy, sspirits, segas24_state, sspirits, ROT270, "Sega", "Scramble Spirits (World, Floppy Based)", 0 )
/* 02 */GAME( 1988, sspiritj, sspirits, system24_floppy, sspirits, segas24_state, sspiritj, ROT270, "Sega", "Scramble Spirits (Japan, Floppy DS3-5000-02-REV-A Based)", 0 )
/* 02 */GAME( 1988, sspirtfc, sspirits, system24_floppy_fd1094, sspirits, segas24_state, sspirits, ROT270, "Sega", "Scramble Spirits (World, Floppy Based, FD1094 317-0058-02c)", GAME_NOT_WORKING ) /* MISSING disk image */
diff --git a/src/mame/drivers/segas32.c b/src/mame/drivers/segas32.c
index 43b3986b6bd..7c509fd6302 100644
--- a/src/mame/drivers/segas32.c
+++ b/src/mame/drivers/segas32.c
@@ -9,7 +9,10 @@
Still to do:
* fix protection
* fix jpark correctly
- * f1lap link
+ * priorities in multi32 appear wrong - stadium cross map screen
+ and title fight ingame backgrounds
+ * should f1lap be set up as a twin cabinet / direct link or can it
+ be operated as a single screen, unlike f1en/air rescue
****************************************************************************
@@ -503,6 +506,28 @@ orunners: Interleaved with the dj and << >> buttons is the data the drives the
#include "radr.lh"
+const device_type SEGA_S32_PCB = &device_creator<segas32_state>;
+
+segas32_state::segas32_state(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, SEGA_S32_PCB, "Sega System 32 PCB", tag, owner, clock, "segas32_pcb", __FILE__),
+ m_z80_shared_ram(*this,"z80_shared_ram"),
+ m_ga2_dpram(*this,"ga2_dpram"),
+ m_system32_workram(*this,"workram"),
+ m_system32_videoram(*this,"videoram", 0),
+ m_system32_spriteram(*this,"spriteram", 0),
+ m_system32_paletteram(*this,"paletteram", 0) ,
+ m_maincpu(*this, "maincpu"),
+ m_soundcpu(*this, "soundcpu"),
+ m_multipcm(*this, "sega"),
+ m_eeprom(*this, "eeprom"),
+ m_gfxdecode(*this, "gfxdecode"),
+ m_screen(*this, "screen"),
+ m_palette(*this, "palette"),
+ m_irq_timer_0(*this, "v60_irq0"),
+ m_irq_timer_1(*this, "v60_irq1"),
+ m_s32comm(*this, "s32comm")
+{
+}
/*************************************
@@ -535,21 +560,35 @@ orunners: Interleaved with the dj and << >> buttons is the data the drives the
*
*************************************/
-MACHINE_RESET_MEMBER(segas32_state,system32)
+void segas32_state::device_start()
+{
+ common_start(0);
+}
+
+void segas32_v25_state::device_start()
+{
+ common_start(0);
+}
+
+void sega_multi32_state::device_start()
+{
+ common_start(1);
+}
+
+void segas32_state::device_reset()
{
/* initialize the interrupt controller */
memset(m_v60_irq_control, 0xff, sizeof(m_v60_irq_control));
/* allocate timers */
- m_v60_irq_timer[0] = machine().device<timer_device>("v60_irq0");
- m_v60_irq_timer[1] = machine().device<timer_device>("v60_irq1");
+ m_v60_irq_timer[0] = m_irq_timer_0;
+ m_v60_irq_timer[1] = m_irq_timer_1;
/* clear IRQ lines */
m_maincpu->set_input_line(0, CLEAR_LINE);
}
-
/*************************************
*
* Interrupt controller
@@ -723,6 +762,8 @@ INTERRUPT_GEN_MEMBER(segas32_state::start_of_vblank_int)
machine().scheduler().timer_set(m_screen->time_until_pos(0), timer_expired_delegate(FUNC(segas32_state::end_of_vblank_int),this));
if (m_system32_prot_vblank)
(this->*m_system32_prot_vblank)();
+ if (m_s32comm != NULL)
+ m_s32comm->check_vint_irq();
}
@@ -1325,6 +1366,9 @@ static ADDRESS_MAP_START( system32_map, AS_PROGRAM, 16, segas32_state )
AM_RANGE(0x600000, 0x60ffff) AM_MIRROR(0x0e0000) AM_READWRITE(system32_paletteram_r, system32_paletteram_w) AM_SHARE("paletteram.0")
AM_RANGE(0x610000, 0x61007f) AM_MIRROR(0x0eff80) AM_READWRITE(system32_mixer_r, system32_mixer_w)
AM_RANGE(0x700000, 0x701fff) AM_MIRROR(0x0fe000) AM_READWRITE(shared_ram_16_r, shared_ram_16_w)
+ AM_RANGE(0x800000, 0x800fff) AM_DEVREADWRITE8("s32comm", s32comm_device, share_r, share_w, 0x00ff)
+ AM_RANGE(0x801000, 0x801001) AM_DEVREADWRITE8("s32comm", s32comm_device, cn_r, cn_w, 0x00ff)
+ AM_RANGE(0x801002, 0x801003) AM_DEVREADWRITE8("s32comm", s32comm_device, fg_r, fg_w, 0x00ff)
AM_RANGE(0xc00000, 0xc0001f) AM_MIRROR(0x0fff80) AM_READWRITE(io_chip_r, io_chip_w)
AM_RANGE(0xc00040, 0xc0007f) AM_MIRROR(0x0fff80) AM_READWRITE(io_expansion_r, io_expansion_w)
AM_RANGE(0xd00000, 0xd0000f) AM_MIRROR(0x07fff0) AM_READWRITE(interrupt_control_16_r, interrupt_control_16_w)
@@ -1346,6 +1390,9 @@ static ADDRESS_MAP_START( multi32_map, AS_PROGRAM, 32, segas32_state )
AM_RANGE(0x680000, 0x68ffff) AM_MIRROR(0x060000) AM_READWRITE(multi32_paletteram_1_r, multi32_paletteram_1_w) AM_SHARE("paletteram.1")
AM_RANGE(0x690000, 0x69007f) AM_MIRROR(0x06ff80) AM_WRITE(multi32_mixer_1_w)
AM_RANGE(0x700000, 0x701fff) AM_MIRROR(0x0fe000) AM_READWRITE(shared_ram_32_r, shared_ram_32_w)
+ AM_RANGE(0x800000, 0x800fff) AM_DEVREADWRITE8("s32comm", s32comm_device, share_r, share_w, 0x00ff00ff)
+ AM_RANGE(0x801000, 0x801003) AM_DEVREADWRITE8("s32comm", s32comm_device, cn_r, cn_w, 0x000000ff)
+ AM_RANGE(0x801000, 0x801003) AM_DEVREADWRITE8("s32comm", s32comm_device, fg_r, fg_w, 0x00ff0000)
AM_RANGE(0xc00000, 0xc0001f) AM_MIRROR(0x07ff80) AM_READWRITE(io_chip_0_r, io_chip_0_w)
AM_RANGE(0xc00040, 0xc0007f) AM_MIRROR(0x07ff80) AM_READWRITE(io_expansion_0_r, io_expansion_0_w)
AM_RANGE(0xc80000, 0xc8001f) AM_MIRROR(0x07ff80) AM_READWRITE(io_chip_1_r, io_chip_1_w)
@@ -1424,8 +1471,9 @@ ADDRESS_MAP_END
*
*************************************/
+
static INPUT_PORTS_START( system32_generic )
- PORT_START("P1_A")
+ PORT_START("mainpcb:P1_A")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 )
@@ -1435,7 +1483,7 @@ static INPUT_PORTS_START( system32_generic )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
- PORT_START("P2_A")
+ PORT_START("mainpcb:P2_A")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
@@ -1445,13 +1493,13 @@ static INPUT_PORTS_START( system32_generic )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
- PORT_START("PORTC_A")
+ PORT_START("mainpcb:PORTC_A")
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("PORTD_A")
+ PORT_START("mainpcb:PORTD_A")
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("SERVICE12_A")
+ PORT_START("mainpcb:SERVICE12_A")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 )
@@ -1460,37 +1508,87 @@ static INPUT_PORTS_START( system32_generic )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_START("SERVICE34_A")
+ PORT_START("mainpcb:SERVICE34_A")
PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE3 ) /* sometimes mirrors SERVICE1 */
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE4 ) /* tends to also work as a test switch */
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, do_read)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("mainpcb:eeprom", eeprom_serial_93cxx_device, do_read)
- PORT_START("PORTG_A")
+ PORT_START("mainpcb:PORTG_A")
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("PORTH_A")
+ PORT_START("mainpcb:PORTH_A")
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
INPUT_PORTS_END
+static INPUT_PORTS_START( system32_generic_slave )
+ PORT_START("slavepcb:P1_A")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 )
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
+
+ PORT_START("slavepcb:P2_A")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
+
+ PORT_START("slavepcb:PORTC_A")
+ PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
+
+ PORT_START("slavepcb:PORTD_A")
+ PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
+
+ PORT_START("slavepcb:SERVICE12_A")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE1 )
+ PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW )
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN4 )
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START3 )
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START4 )
+ PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNKNOWN )
+
+ PORT_START("slavepcb:SERVICE34_A")
+ PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNKNOWN )
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE3 ) /* sometimes mirrors SERVICE1 */
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE4 ) /* tends to also work as a test switch */
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("slavepcb:eeprom", eeprom_serial_93cxx_device, do_read)
+
+ PORT_START("slavepcb:PORTG_A")
+ PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
+
+ PORT_START("slavepcb:PORTH_A")
+ PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
+INPUT_PORTS_END
+
static INPUT_PORTS_START( multi32_generic )
PORT_INCLUDE( system32_generic )
- PORT_START("P1_B")
+ PORT_START("mainpcb:P1_B")
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("P2_B")
+ PORT_START("mainpcb:P2_B")
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("PORTC_B")
+ PORT_START("mainpcb:PORTC_B")
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("PORTD_B")
+ PORT_START("mainpcb:PORTD_B")
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("SERVICE12_B")
+ PORT_START("mainpcb:SERVICE12_B")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE2 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 )
@@ -1498,14 +1596,14 @@ static INPUT_PORTS_START( multi32_generic )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_START("SERVICE34_B")
+ PORT_START("mainpcb:SERVICE34_B")
PORT_BIT( 0x7f, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, do_read)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("mainpcb:eeprom", eeprom_serial_93cxx_device, do_read)
- PORT_START("PORTG_B")
+ PORT_START("mainpcb:PORTG_B")
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("PORTH_B")
+ PORT_START("mainpcb:PORTH_B")
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
INPUT_PORTS_END
@@ -1520,54 +1618,80 @@ INPUT_PORTS_END
static INPUT_PORTS_START( arescue )
PORT_INCLUDE( system32_generic )
- PORT_MODIFY("P1_A")
+ PORT_MODIFY("mainpcb:P1_A")
PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_MODIFY("P2_A")
+ PORT_MODIFY("mainpcb:P2_A")
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_MODIFY("SERVICE12_A")
+ PORT_MODIFY("mainpcb:SERVICE12_A")
PORT_BIT( 0x38, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_MODIFY("SERVICE34_A")
+ PORT_MODIFY("mainpcb:SERVICE34_A")
PORT_BIT( 0x30, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("ANALOG1")
+ PORT_START("mainpcb:ANALOG1")
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(30) PORT_KEYDELTA(10) PORT_REVERSE
- PORT_START("ANALOG2")
+ PORT_START("mainpcb:ANALOG2")
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_SENSITIVITY(30) PORT_KEYDELTA(10)
- PORT_START("ANALOG3")
+ PORT_START("mainpcb:ANALOG3")
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Z ) PORT_SENSITIVITY(30) PORT_KEYDELTA(10)
+
+ PORT_INCLUDE( system32_generic_slave )
+
+ PORT_MODIFY("slavepcb:P1_A")
+ PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
+
+ PORT_MODIFY("slavepcb:P2_A")
+ PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
+
+ PORT_MODIFY("slavepcb:SERVICE12_A")
+ PORT_BIT( 0x38, IP_ACTIVE_LOW, IPT_UNUSED )
+
+ PORT_MODIFY("slavepcb:SERVICE34_A")
+ PORT_BIT( 0x30, IP_ACTIVE_LOW, IPT_UNUSED )
+
+ PORT_START("slavepcb:ANALOG1")
+ PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(30) PORT_KEYDELTA(10) PORT_REVERSE PORT_PLAYER(2)
+
+ PORT_START("slavepcb:ANALOG2")
+ PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_SENSITIVITY(30) PORT_KEYDELTA(10) PORT_PLAYER(2)
+
+ PORT_START("slavepcb:ANALOG3")
+ PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Z ) PORT_SENSITIVITY(30) PORT_KEYDELTA(10) PORT_PLAYER(2)
+
INPUT_PORTS_END
static INPUT_PORTS_START( alien3 )
PORT_INCLUDE( system32_generic )
- PORT_MODIFY("P1_A")
+ PORT_MODIFY("mainpcb:P1_A")
PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_MODIFY("P2_A")
+ PORT_MODIFY("mainpcb:P2_A")
PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_MODIFY("SERVICE12_A")
+ PORT_MODIFY("mainpcb:SERVICE12_A")
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE2 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("ANALOG1")
+ PORT_START("mainpcb:ANALOG1")
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(50) PORT_KEYDELTA(5)
- PORT_START("ANALOG2")
+ PORT_START("mainpcb:ANALOG2")
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_SENSITIVITY(50) PORT_KEYDELTA(5)
- PORT_START("ANALOG3")
+ PORT_START("mainpcb:ANALOG3")
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(50) PORT_KEYDELTA(5) PORT_PLAYER(2)
- PORT_START("ANALOG4")
+ PORT_START("mainpcb:ANALOG4")
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_SENSITIVITY(50) PORT_KEYDELTA(5) PORT_PLAYER(2)
INPUT_PORTS_END
@@ -1575,13 +1699,13 @@ INPUT_PORTS_END
static INPUT_PORTS_START( arabfgt )
PORT_INCLUDE( system32_generic )
- PORT_MODIFY("P1_A")
+ PORT_MODIFY("mainpcb:P1_A")
PORT_BIT( 0x0c, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_MODIFY("P2_A")
+ PORT_MODIFY("mainpcb:P2_A")
PORT_BIT( 0x0c, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("EXTRA1")
+ PORT_START("mainpcb:EXTRA1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
PORT_BIT( 0x0c, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1590,7 +1714,7 @@ static INPUT_PORTS_START( arabfgt )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3)
- PORT_START("EXTRA2")
+ PORT_START("mainpcb:EXTRA2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4)
PORT_BIT( 0x0c, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1599,7 +1723,7 @@ static INPUT_PORTS_START( arabfgt )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(4)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(4)
- PORT_START("EXTRA3")
+ PORT_START("mainpcb:EXTRA3")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START3 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START4 )
PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1608,11 +1732,11 @@ INPUT_PORTS_END
static INPUT_PORTS_START( arabfgtu )
PORT_INCLUDE( arabfgt )
- PORT_MODIFY("SERVICE12_A")
+ PORT_MODIFY("mainpcb:SERVICE12_A")
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN4 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN3 )
- PORT_MODIFY("EXTRA3")
+ PORT_MODIFY("mainpcb:EXTRA3")
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 )
INPUT_PORTS_END
@@ -1621,13 +1745,13 @@ INPUT_PORTS_END
static INPUT_PORTS_START( brival )
PORT_INCLUDE( system32_generic )
- PORT_MODIFY("P1_A")
+ PORT_MODIFY("mainpcb:P1_A")
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_MODIFY("P2_A")
+ PORT_MODIFY("mainpcb:P2_A")
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("EXTRA2")
+ PORT_START("mainpcb:EXTRA2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(2)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(2)
@@ -1642,17 +1766,17 @@ INPUT_PORTS_END
static INPUT_PORTS_START( darkedge )
PORT_INCLUDE( system32_generic )
- PORT_MODIFY("P1_A")
+ PORT_MODIFY("mainpcb:P1_A")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 )
- PORT_MODIFY("P2_A")
+ PORT_MODIFY("mainpcb:P2_A")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
- PORT_START("EXTRA2")
+ PORT_START("mainpcb:EXTRA2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(2)
@@ -1672,19 +1796,19 @@ INPUT_PORTS_END
static INPUT_PORTS_START( f1en )
PORT_INCLUDE( system32_generic )
- PORT_MODIFY("P1_A")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CODE(KEYCODE_SPACE) PORT_NAME("Gear Up")
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_CODE(KEYCODE_LSHIFT) PORT_NAME("Gear Down")
+ PORT_MODIFY("mainpcb:P1_A")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CODE(KEYCODE_SPACE) PORT_NAME("mainpcb:Gear Up")
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_CODE(KEYCODE_LSHIFT) PORT_NAME("mainpcb:Gear Down")
PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_MODIFY("P2_A")
+ PORT_MODIFY("mainpcb:P2_A")
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_MODIFY("SERVICE12_A")
+ PORT_MODIFY("mainpcb:SERVICE12_A")
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_MODIFY("SERVICE34_A")
+ PORT_MODIFY("mainpcb:SERVICE34_A")
PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
@@ -1699,34 +1823,73 @@ static INPUT_PORTS_START( f1en )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_BIT( 0x30, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("ANALOG1")
- PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_NAME("Steering Wheel")
+ PORT_START("mainpcb:ANALOG1")
+ PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_NAME("mainpcb:Steering Wheel")
- PORT_START("ANALOG2")
- PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_NAME("Gas Pedal")
+ PORT_START("mainpcb:ANALOG2")
+ PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_NAME("mainpcb:Gas Pedal")
+
+ PORT_START("mainpcb:ANALOG3")
+ PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_NAME("mainpcb:Brake Pedal")
+
+ PORT_INCLUDE( system32_generic_slave )
+
+ PORT_MODIFY("slavepcb:P1_A")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("slavepcb:Gear Up") PORT_PLAYER(2)
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("slavepcb:Gear Down") PORT_PLAYER(2)
+ PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNUSED )
+
+ PORT_MODIFY("slavepcb:P2_A")
+ PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
+
+ PORT_MODIFY("slavepcb:SERVICE12_A")
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
+
+ PORT_MODIFY("slavepcb:SERVICE34_A")
+ PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( On ) )
+ PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( On ) )
+ PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( On ) )
+ PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( On ) )
+ PORT_BIT( 0x30, IP_ACTIVE_LOW, IPT_UNUSED )
+
+ PORT_START("slavepcb:ANALOG1")
+ PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_NAME("slavepcb:Steering Wheel") PORT_PLAYER(2)
+
+ PORT_START("slavepcb:ANALOG2")
+ PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_NAME("slavepcb:Gas Pedal") PORT_PLAYER(2)
+
+ PORT_START("slavepcb:ANALOG3")
+ PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_NAME("slavepcb:Brake Pedal") PORT_PLAYER(2)
- PORT_START("ANALOG3")
- PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_NAME("Brake Pedal")
INPUT_PORTS_END
static INPUT_PORTS_START( f1lap )
PORT_INCLUDE( system32_generic )
- PORT_MODIFY("P1_A")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CODE(KEYCODE_SPACE) PORT_NAME("Gear Up")
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_CODE(KEYCODE_LSHIFT) PORT_NAME("Gear Down")
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_CODE(KEYCODE_Z) PORT_NAME("Overtake")
+ PORT_MODIFY("mainpcb:P1_A")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CODE(KEYCODE_SPACE) PORT_NAME("mainpcb:Gear Up")
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_CODE(KEYCODE_LSHIFT) PORT_NAME("mainpcb:Gear Down")
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_CODE(KEYCODE_Z) PORT_NAME("mainpcb:Overtake")
PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_MODIFY("P2_A")
+ PORT_MODIFY("mainpcb:P2_A")
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_MODIFY("SERVICE12_A")
+ PORT_MODIFY("mainpcb:SERVICE12_A")
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_MODIFY("SERVICE34_A")
+ PORT_MODIFY("mainpcb:SERVICE34_A")
PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
@@ -1749,21 +1912,21 @@ static INPUT_PORTS_START( f1lap )
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_START("ANALOG1")
- PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_SENSITIVITY(50) PORT_KEYDELTA(20) PORT_NAME("Steering Wheel")
+ PORT_START("mainpcb:ANALOG1")
+ PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_SENSITIVITY(50) PORT_KEYDELTA(20) PORT_NAME("mainpcb:Steering Wheel")
- PORT_START("ANALOG2")
- PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_SENSITIVITY(50) PORT_KEYDELTA(20) PORT_NAME("Gas Pedal")
+ PORT_START("mainpcb:ANALOG2")
+ PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_SENSITIVITY(50) PORT_KEYDELTA(20) PORT_NAME("mainpcb:Gas Pedal")
- PORT_START("ANALOG3")
- PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_SENSITIVITY(50) PORT_KEYDELTA(20) PORT_NAME("Brake Pedal")
+ PORT_START("mainpcb:ANALOG3")
+ PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_SENSITIVITY(50) PORT_KEYDELTA(20) PORT_NAME("mainpcb:Brake Pedal")
INPUT_PORTS_END
static INPUT_PORTS_START( ga2 )
PORT_INCLUDE( system32_generic )
- PORT_START("EXTRA1")
+ PORT_START("mainpcb:EXTRA1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3)
@@ -1773,7 +1936,7 @@ static INPUT_PORTS_START( ga2 )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3)
- PORT_START("EXTRA2")
+ PORT_START("mainpcb:EXTRA2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(4)
@@ -1783,7 +1946,7 @@ static INPUT_PORTS_START( ga2 )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(4)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(4)
- PORT_START("EXTRA3")
+ PORT_START("mainpcb:EXTRA3")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START3 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START4 )
PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1792,11 +1955,11 @@ INPUT_PORTS_END
static INPUT_PORTS_START( ga2u )
PORT_INCLUDE( ga2 )
- PORT_MODIFY("SERVICE12_A")
+ PORT_MODIFY("mainpcb:SERVICE12_A")
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN4 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN3 )
- PORT_MODIFY("EXTRA3")
+ PORT_MODIFY("mainpcb:EXTRA3")
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 )
INPUT_PORTS_END
@@ -1805,7 +1968,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( harddunk )
PORT_INCLUDE( multi32_generic )
- PORT_MODIFY("P1_A")
+ PORT_MODIFY("mainpcb:P1_A")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
@@ -1815,7 +1978,7 @@ static INPUT_PORTS_START( harddunk )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
- PORT_MODIFY("P2_A")
+ PORT_MODIFY("mainpcb:P2_A")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
@@ -1825,12 +1988,12 @@ static INPUT_PORTS_START( harddunk )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
- PORT_MODIFY("SERVICE12_A")
+ PORT_MODIFY("mainpcb:SERVICE12_A")
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_MODIFY("P1_B")
+ PORT_MODIFY("mainpcb:P1_B")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(4)
@@ -1840,7 +2003,7 @@ static INPUT_PORTS_START( harddunk )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(4)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(4)
- PORT_MODIFY("P2_B")
+ PORT_MODIFY("mainpcb:P2_B")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(5)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(5)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(5)
@@ -1850,12 +2013,12 @@ static INPUT_PORTS_START( harddunk )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(5)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(5)
- PORT_MODIFY("SERVICE12_B")
+ PORT_MODIFY("mainpcb:SERVICE12_B")
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START4 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START5 )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_START("EXTRA1")
+ PORT_START("mainpcb:EXTRA1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3)
@@ -1865,7 +2028,7 @@ static INPUT_PORTS_START( harddunk )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3)
- PORT_START("EXTRA2")
+ PORT_START("mainpcb:EXTRA2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(6)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(6)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(6)
@@ -1875,7 +2038,7 @@ static INPUT_PORTS_START( harddunk )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(6)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(6)
- PORT_START("EXTRA3")
+ PORT_START("mainpcb:EXTRA3")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START3 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START6 )
PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -1885,10 +2048,10 @@ INPUT_PORTS_END
static INPUT_PORTS_START( holo )
PORT_INCLUDE( system32_generic )
- PORT_MODIFY("P1_A")
+ PORT_MODIFY("mainpcb:P1_A")
PORT_BIT( 0x0c, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_MODIFY("P2_A")
+ PORT_MODIFY("mainpcb:P2_A")
PORT_BIT( 0x0c, IP_ACTIVE_LOW, IPT_UNUSED )
INPUT_PORTS_END
@@ -1896,22 +2059,22 @@ INPUT_PORTS_END
static INPUT_PORTS_START( jpark )
PORT_INCLUDE( system32_generic )
- PORT_MODIFY("P1_A")
+ PORT_MODIFY("mainpcb:P1_A")
PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_MODIFY("P2_A")
+ PORT_MODIFY("mainpcb:P2_A")
PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("ANALOG1")
+ PORT_START("mainpcb:ANALOG1")
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(50) PORT_KEYDELTA(5)
- PORT_START("ANALOG2")
+ PORT_START("mainpcb:ANALOG2")
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_SENSITIVITY(50) PORT_KEYDELTA(5)
- PORT_START("ANALOG3")
+ PORT_START("mainpcb:ANALOG3")
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(50) PORT_KEYDELTA(5) PORT_PLAYER(2)
- PORT_START("ANALOG4")
+ PORT_START("mainpcb:ANALOG4")
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_SENSITIVITY(50) PORT_KEYDELTA(5) PORT_PLAYER(2)
INPUT_PORTS_END
@@ -1919,44 +2082,44 @@ INPUT_PORTS_END
static INPUT_PORTS_START( orunners )
PORT_INCLUDE( multi32_generic )
- PORT_MODIFY("P1_A")
+ PORT_MODIFY("mainpcb:P1_A")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_CODE(KEYCODE_SPACE) /* shift up */
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_CODE(KEYCODE_LSHIFT) /* shift down */
PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_MODIFY("P2_A")
+ PORT_MODIFY("mainpcb:P2_A")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_CODE(KEYCODE_Z) /* DJ/music */
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) PORT_CODE(KEYCODE_X) /* << */
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1) PORT_CODE(KEYCODE_C) /* >> */
PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_MODIFY("P1_B")
+ PORT_MODIFY("mainpcb:P1_B")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_CODE(KEYCODE_Q) /* shift up */
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_CODE(KEYCODE_W) /* shift down */
PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_MODIFY("P2_B")
+ PORT_MODIFY("mainpcb:P2_B")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) /* DJ/music */
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) /* << */
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(2) /* >> */
PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_START("ANALOG1")
+ PORT_START("mainpcb:ANALOG1")
PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_SENSITIVITY(30) PORT_KEYDELTA(10) PORT_PLAYER(1)
- PORT_START("ANALOG2")
+ PORT_START("mainpcb:ANALOG2")
PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_SENSITIVITY(30) PORT_KEYDELTA(10) PORT_PLAYER(1)
- PORT_START("ANALOG3")
+ PORT_START("mainpcb:ANALOG3")
PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_SENSITIVITY(30) PORT_KEYDELTA(10) PORT_PLAYER(1)
- PORT_START("ANALOG4")
+ PORT_START("mainpcb:ANALOG4")
PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_SENSITIVITY(30) PORT_KEYDELTA(10) PORT_PLAYER(2)
- PORT_START("ANALOG7")
+ PORT_START("mainpcb:ANALOG7")
PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_SENSITIVITY(30) PORT_KEYDELTA(10) PORT_PLAYER(2)
- PORT_START("ANALOG8")
+ PORT_START("mainpcb:ANALOG8")
PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_SENSITIVITY(30) PORT_KEYDELTA(10) PORT_PLAYER(2)
INPUT_PORTS_END
@@ -1964,20 +2127,20 @@ INPUT_PORTS_END
static INPUT_PORTS_START( radm )
PORT_INCLUDE( system32_generic )
- PORT_MODIFY("P1_A")
+ PORT_MODIFY("mainpcb:P1_A")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CODE(KEYCODE_SPACE) PORT_NAME("Light")
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_CODE(KEYCODE_LSHIFT) PORT_NAME("Wiper")
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CODE(KEYCODE_SPACE) PORT_NAME("mainpcb:Light")
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_CODE(KEYCODE_LSHIFT) PORT_NAME("mainpcb:Wiper")
PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_MODIFY("P2_A")
+ PORT_MODIFY("mainpcb:P2_A")
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_MODIFY("SERVICE12_A")
+ PORT_MODIFY("mainpcb:SERVICE12_A")
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_MODIFY("SERVICE34_A")
+ PORT_MODIFY("mainpcb:SERVICE34_A")
PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
@@ -1992,13 +2155,13 @@ static INPUT_PORTS_START( radm )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_BIT( 0x30, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("ANALOG1")
+ PORT_START("mainpcb:ANALOG1")
PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_SENSITIVITY(30) PORT_KEYDELTA(10)
- PORT_START("ANALOG2")
+ PORT_START("mainpcb:ANALOG2")
PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_SENSITIVITY(30) PORT_KEYDELTA(10)
- PORT_START("ANALOG3")
+ PORT_START("mainpcb:ANALOG3")
PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_SENSITIVITY(30) PORT_KEYDELTA(10)
INPUT_PORTS_END
@@ -2006,18 +2169,18 @@ INPUT_PORTS_END
static INPUT_PORTS_START( radr )
PORT_INCLUDE( system32_generic )
- PORT_MODIFY("P1_A")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CODE(KEYCODE_SPACE) PORT_NAME("Gear Change") PORT_TOGGLE
+ PORT_MODIFY("mainpcb:P1_A")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CODE(KEYCODE_SPACE) PORT_NAME("mainpcb:Gear Change") PORT_TOGGLE
PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_MODIFY("P2_A")
+ PORT_MODIFY("mainpcb:P2_A")
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_MODIFY("SERVICE12_A")
+ PORT_MODIFY("mainpcb:SERVICE12_A")
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_MODIFY("SERVICE34_A")
+ PORT_MODIFY("mainpcb:SERVICE34_A")
PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
@@ -2032,13 +2195,13 @@ static INPUT_PORTS_START( radr )
PORT_DIPSETTING( 0x00, "Automatic" )
PORT_BIT( 0x30, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("ANALOG1")
+ PORT_START("mainpcb:ANALOG1")
PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_SENSITIVITY(30) PORT_KEYDELTA(10)
- PORT_START("ANALOG2")
+ PORT_START("mainpcb:ANALOG2")
PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_SENSITIVITY(30) PORT_KEYDELTA(10)
- PORT_START("ANALOG3")
+ PORT_START("mainpcb:ANALOG3")
PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_SENSITIVITY(30) PORT_KEYDELTA(10)
INPUT_PORTS_END
@@ -2046,33 +2209,33 @@ INPUT_PORTS_END
static INPUT_PORTS_START( scross )
PORT_INCLUDE( multi32_generic )
- PORT_MODIFY("P1_A")
+ PORT_MODIFY("mainpcb:P1_A")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_CODE(KEYCODE_SPACE) /* P1 Attack */
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_CODE(KEYCODE_LSHIFT) /* P1 Wheelie */
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_CODE(KEYCODE_LALT) /* P1 Brake */
PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_MODIFY("P1_B")
+ PORT_MODIFY("mainpcb:P1_B")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_CODE(KEYCODE_Q) /* P2 Attack */
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_CODE(KEYCODE_W) /* P2 Wheelie */
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_CODE(KEYCODE_S) /* P2 Brake */
PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_MODIFY("P2_A")
+ PORT_MODIFY("mainpcb:P2_A")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("ANALOG1")
+ PORT_START("mainpcb:ANALOG1")
PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_SENSITIVITY(30) PORT_KEYDELTA(10) PORT_REVERSE PORT_PLAYER(1)
- PORT_START("ANALOG2")
+ PORT_START("mainpcb:ANALOG2")
PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_SENSITIVITY(30) PORT_KEYDELTA(10) PORT_PLAYER(1)
- PORT_START("ANALOG3")
+ PORT_START("mainpcb:ANALOG3")
PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_SENSITIVITY(30) PORT_KEYDELTA(10) PORT_REVERSE PORT_PLAYER(2)
- PORT_START("ANALOG4")
+ PORT_START("mainpcb:ANALOG4")
PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_SENSITIVITY(30) PORT_KEYDELTA(10) PORT_PLAYER(2)
INPUT_PORTS_END
@@ -2080,18 +2243,18 @@ INPUT_PORTS_END
static INPUT_PORTS_START( slipstrm )
PORT_INCLUDE( system32_generic )
- PORT_MODIFY("P1_A")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CODE(KEYCODE_SPACE) PORT_NAME("Gear Change") PORT_TOGGLE
+ PORT_MODIFY("mainpcb:P1_A")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CODE(KEYCODE_SPACE) PORT_NAME("mainpcb:Gear Change") PORT_TOGGLE
PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_MODIFY("P2_A")
+ PORT_MODIFY("mainpcb:P2_A")
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_MODIFY("SERVICE12_A")
+ PORT_MODIFY("mainpcb:SERVICE12_A")
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_MODIFY("SERVICE34_A")
+ PORT_MODIFY("mainpcb:SERVICE34_A")
PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
@@ -2106,13 +2269,13 @@ static INPUT_PORTS_START( slipstrm )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_BIT( 0x30, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("ANALOG1")
+ PORT_START("mainpcb:ANALOG1")
PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_SENSITIVITY(30) PORT_KEYDELTA(10)
- PORT_START("ANALOG2")
+ PORT_START("mainpcb:ANALOG2")
PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_SENSITIVITY(30) PORT_KEYDELTA(10)
- PORT_START("ANALOG3")
+ PORT_START("mainpcb:ANALOG3")
PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_SENSITIVITY(30) PORT_KEYDELTA(10)
INPUT_PORTS_END
@@ -2120,34 +2283,34 @@ INPUT_PORTS_END
static INPUT_PORTS_START( sonic )
PORT_INCLUDE( system32_generic )
- PORT_MODIFY("P1_A")
+ PORT_MODIFY("mainpcb:P1_A")
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_MODIFY("P2_A")
+ PORT_MODIFY("mainpcb:P2_A")
PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_MODIFY("SERVICE12_A")
+ PORT_MODIFY("mainpcb:SERVICE12_A")
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN3 )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START3 )
- PORT_START("TRACKX1")
+ PORT_START("mainpcb:TRACKX1")
PORT_BIT( 0xff, 0, IPT_TRACKBALL_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(30) PORT_REVERSE PORT_PLAYER(1)
- PORT_START("TRACKY1")
+ PORT_START("mainpcb:TRACKY1")
PORT_BIT( 0xff, 0, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(30) PORT_PLAYER(1)
- PORT_START("TRACKX2")
+ PORT_START("mainpcb:TRACKX2")
PORT_BIT( 0xff, 0, IPT_TRACKBALL_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(30) PORT_REVERSE PORT_PLAYER(2)
- PORT_START("TRACKY2")
+ PORT_START("mainpcb:TRACKY2")
PORT_BIT( 0xff, 0, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(30) PORT_PLAYER(2)
- PORT_START("TRACKX3")
+ PORT_START("mainpcb:TRACKX3")
PORT_BIT( 0xff, 0, IPT_TRACKBALL_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(30) PORT_REVERSE PORT_PLAYER(3)
- PORT_START("TRACKY3")
+ PORT_START("mainpcb:TRACKY3")
PORT_BIT( 0xff, 0, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(30) PORT_PLAYER(3)
INPUT_PORTS_END
@@ -2155,13 +2318,13 @@ INPUT_PORTS_END
static INPUT_PORTS_START( spidman )
PORT_INCLUDE( system32_generic )
- PORT_MODIFY("P1_A")
+ PORT_MODIFY("mainpcb:P1_A")
PORT_BIT( 0x0c, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_MODIFY("P2_A")
+ PORT_MODIFY("mainpcb:P2_A")
PORT_BIT( 0x0c, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("EXTRA1")
+ PORT_START("mainpcb:EXTRA1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
PORT_BIT( 0x0c, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -2170,7 +2333,7 @@ static INPUT_PORTS_START( spidman )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3)
- PORT_START("EXTRA2")
+ PORT_START("mainpcb:EXTRA2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4)
PORT_BIT( 0x0c, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -2179,7 +2342,7 @@ static INPUT_PORTS_START( spidman )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(4)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(4)
- PORT_START("EXTRA3")
+ PORT_START("mainpcb:EXTRA3")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START3 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START4 )
PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -2189,11 +2352,11 @@ INPUT_PORTS_END
static INPUT_PORTS_START( spidmanu )
PORT_INCLUDE( spidman )
- PORT_MODIFY("SERVICE12_A")
+ PORT_MODIFY("mainpcb:SERVICE12_A")
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN4 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN3 )
- PORT_MODIFY("EXTRA3")
+ PORT_MODIFY("mainpcb:EXTRA3")
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 )
INPUT_PORTS_END
@@ -2207,39 +2370,39 @@ INPUT_PORTS_END
static INPUT_PORTS_START( titlef )
PORT_INCLUDE( multi32_generic )
- PORT_MODIFY("P1_A")
+ PORT_MODIFY("mainpcb:P1_A")
PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN ) PORT_PLAYER(1)
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP ) PORT_PLAYER(1)
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT ) PORT_PLAYER(1)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT ) PORT_PLAYER(1)
- PORT_MODIFY("P2_A")
+ PORT_MODIFY("mainpcb:P2_A")
PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN ) PORT_PLAYER(1)
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP ) PORT_PLAYER(1)
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_RIGHT ) PORT_PLAYER(1)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_LEFT ) PORT_PLAYER(1)
- PORT_MODIFY("SERVICE12_A")
+ PORT_MODIFY("mainpcb:SERVICE12_A")
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_MODIFY("P1_B")
+ PORT_MODIFY("mainpcb:P1_B")
PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN ) PORT_PLAYER(2)
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP ) PORT_PLAYER(2)
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT ) PORT_PLAYER(2)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT ) PORT_PLAYER(2)
- PORT_MODIFY("P2_B")
+ PORT_MODIFY("mainpcb:P2_B")
PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN ) PORT_PLAYER(2)
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP ) PORT_PLAYER(2)
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_RIGHT ) PORT_PLAYER(2)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_LEFT ) PORT_PLAYER(2)
- PORT_MODIFY("SERVICE12_B")
+ PORT_MODIFY("mainpcb:SERVICE12_B")
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START3 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START4 )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -2272,35 +2435,6 @@ GFXDECODE_END
-/*************************************
- *
- * Dual PCB shared memory comms
- *
- *************************************/
-
-// Both arescue and f1en appear to use an identical shared RAM system.
-
-
-WRITE16_MEMBER(segas32_state::dual_pcb_comms_w)
-{
- COMBINE_DATA(&m_dual_pcb_comms[offset]);
-}
-
-READ16_MEMBER(segas32_state::dual_pcb_comms_r)
-{
- return m_dual_pcb_comms[offset];
-}
-
-
-/* There must be something on the comms board for this?
- Probably not a dip/solder link/trace cut, but maybe
- just whichever way the cables are plugged in?
- Both f1en and arescue master units try to set bit 1... */
-READ16_MEMBER(segas32_state::dual_pcb_masterslave)
-{
- return 0; // 0/1 master/slave
-}
-
/*************************************
@@ -2309,7 +2443,8 @@ READ16_MEMBER(segas32_state::dual_pcb_masterslave)
*
*************************************/
-static MACHINE_CONFIG_START( system32, segas32_state )
+
+static MACHINE_CONFIG_FRAGMENT( system32 )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", V60, MASTER_CLOCK/2)
@@ -2320,7 +2455,6 @@ static MACHINE_CONFIG_START( system32, segas32_state )
MCFG_CPU_PROGRAM_MAP(system32_sound_map)
MCFG_CPU_IO_MAP(system32_sound_portmap)
- MCFG_MACHINE_RESET_OVERRIDE(segas32_state,system32)
MCFG_EEPROM_SERIAL_93C46_ADD("eeprom")
@@ -2337,8 +2471,6 @@ static MACHINE_CONFIG_START( system32, segas32_state )
MCFG_SCREEN_VISIBLE_AREA(0*8, 52*8-1, 0*8, 28*8-1)
MCFG_SCREEN_UPDATE_DRIVER(segas32_state, screen_update_system32)
- MCFG_VIDEO_START_OVERRIDE(segas32_state,system32)
-
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
@@ -2354,10 +2486,27 @@ static MACHINE_CONFIG_START( system32, segas32_state )
MCFG_RF5C68_ADD("rfsnd", RFC_CLOCK/4)
MCFG_SOUND_ROUTE(0, "lspeaker", 0.55)
MCFG_SOUND_ROUTE(1, "rspeaker", 0.55)
+
+ MCFG_S32COMM_ADD("s32comm")
MACHINE_CONFIG_END
+const device_type SEGA_S32_REGULAR_DEVICE = &device_creator<segas32_regular_state>;
+
+segas32_regular_state::segas32_regular_state(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : segas32_state(mconfig, tag, owner, clock)
+{
+}
+
+machine_config_constructor segas32_regular_state::device_mconfig_additions() const
+{
+ return MACHINE_CONFIG_NAME( system32 );
+}
+
+
+
-static MACHINE_CONFIG_DERIVED( system32_v25, system32 )
+static MACHINE_CONFIG_FRAGMENT( system32_v25 )
+ MCFG_FRAGMENT_ADD( system32 )
/* add a V25 for protection */
MCFG_CPU_ADD("mcu", V25, 10000000)
@@ -2365,8 +2514,20 @@ static MACHINE_CONFIG_DERIVED( system32_v25, system32 )
MCFG_V25_CONFIG(ga2_v25_opcode_table)
MACHINE_CONFIG_END
+const device_type SEGA_S32_V25_DEVICE = &device_creator<segas32_v25_state>;
-static MACHINE_CONFIG_START( multi32, segas32_state )
+segas32_v25_state::segas32_v25_state(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : segas32_state(mconfig, tag, owner, clock)
+{
+}
+
+machine_config_constructor segas32_v25_state::device_mconfig_additions() const
+{
+ return MACHINE_CONFIG_NAME( system32_v25 );
+}
+
+
+static MACHINE_CONFIG_FRAGMENT( multi32 )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", V70, MULTI32_CLOCK/2)
@@ -2377,7 +2538,6 @@ static MACHINE_CONFIG_START( multi32, segas32_state )
MCFG_CPU_PROGRAM_MAP(multi32_sound_map)
MCFG_CPU_IO_MAP(multi32_sound_portmap)
- MCFG_MACHINE_RESET_OVERRIDE(segas32_state,system32)
MCFG_EEPROM_SERIAL_93C46_ADD("eeprom")
@@ -2401,8 +2561,6 @@ static MACHINE_CONFIG_START( multi32, segas32_state )
MCFG_SCREEN_VISIBLE_AREA(0*8, 52*8-1, 0*8, 28*8-1)
MCFG_SCREEN_UPDATE_DRIVER(segas32_state, screen_update_multi32_right)
- MCFG_VIDEO_START_OVERRIDE(segas32_state,multi32)
-
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
@@ -2414,9 +2572,88 @@ static MACHINE_CONFIG_START( multi32, segas32_state )
MCFG_SOUND_ADD("sega", MULTIPCM, MASTER_CLOCK/4)
MCFG_SOUND_ROUTE(1, "lspeaker", 1.0)
MCFG_SOUND_ROUTE(0, "rspeaker", 1.0)
+
+ MCFG_S32COMM_ADD("s32comm")
MACHINE_CONFIG_END
+const device_type SEGA_MULTI32_DEVICE = &device_creator<sega_multi32_state>;
+
+sega_multi32_state::sega_multi32_state(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : segas32_state(mconfig, tag, owner, clock)
+{
+}
+
+machine_config_constructor sega_multi32_state::device_mconfig_additions() const
+{
+ return MACHINE_CONFIG_NAME( multi32 );
+}
+
+
+class segas32_new_state : public driver_device
+{
+public:
+ segas32_new_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_mainpcb(*this, "mainpcb"),
+ m_slavepcb(*this, "slavepcb")
+ { }
+
+ required_device<segas32_state> m_mainpcb;
+ optional_device<segas32_state> m_slavepcb;
+
+ DECLARE_DRIVER_INIT(titlef);
+ DECLARE_DRIVER_INIT(slipstrm);
+ DECLARE_DRIVER_INIT(radm);
+ DECLARE_DRIVER_INIT(holo);
+ DECLARE_DRIVER_INIT(svf);
+ DECLARE_DRIVER_INIT(jleague);
+ DECLARE_DRIVER_INIT(arescue);
+ DECLARE_DRIVER_INIT(jpark);
+ DECLARE_DRIVER_INIT(ga2);
+ DECLARE_DRIVER_INIT(scross);
+ DECLARE_DRIVER_INIT(spidman);
+ DECLARE_DRIVER_INIT(sonicp);
+ DECLARE_DRIVER_INIT(f1en);
+ DECLARE_DRIVER_INIT(dbzvrvs);
+ DECLARE_DRIVER_INIT(brival);
+ DECLARE_DRIVER_INIT(harddunk);
+ DECLARE_DRIVER_INIT(arabfgt);
+ DECLARE_DRIVER_INIT(sonic);
+ DECLARE_DRIVER_INIT(alien3);
+ DECLARE_DRIVER_INIT(darkedge);
+ DECLARE_DRIVER_INIT(radr);
+ DECLARE_DRIVER_INIT(f1lap);
+ DECLARE_DRIVER_INIT(orunners);
+
+ UINT16* m_dual_pcb_comms;
+ DECLARE_WRITE16_MEMBER(dual_pcb_comms_w);
+ DECLARE_READ16_MEMBER(dual_pcb_comms_r);
+ DECLARE_READ16_MEMBER(dual_pcb_masterslave);
+ DECLARE_READ16_MEMBER(dual_pcb_slave);
+
+
+};
+
+
+
+static MACHINE_CONFIG_START( sega_system32, segas32_new_state )
+ MCFG_DEVICE_ADD("mainpcb", SEGA_S32_REGULAR_DEVICE, 0)
+MACHINE_CONFIG_END
+
+// for air rescue & f1en where there is a sub-board containing shared ram sitting underneath the ROM board bridging 2 PCBs (not a network link)
+static MACHINE_CONFIG_START( sega_system32_dual_direct, segas32_new_state )
+ MCFG_DEVICE_ADD("mainpcb", SEGA_S32_REGULAR_DEVICE, 0)
+ MCFG_DEVICE_ADD("slavepcb", SEGA_S32_REGULAR_DEVICE, 0)
+MACHINE_CONFIG_END
+
+static MACHINE_CONFIG_START( sega_system32_v25, segas32_new_state )
+ MCFG_DEVICE_ADD("mainpcb", SEGA_S32_V25_DEVICE, 0)
+MACHINE_CONFIG_END
+
+static MACHINE_CONFIG_START( sega_multi32, segas32_new_state )
+ MCFG_DEVICE_ADD("mainpcb", SEGA_MULTI32_DEVICE, 0)
+MACHINE_CONFIG_END
/*************************************
*
@@ -2424,6 +2661,7 @@ MACHINE_CONFIG_END
*
*************************************/
+
#define ROM_LOAD_x2(name, base, length, crc) \
ROM_LOAD( name, base + 0 * length, length, crc ) \
ROM_RELOAD( base + 1 * length, length )
@@ -2526,25 +2764,25 @@ MACHINE_CONFIG_END
*/
ROM_START( arescue )
- ROM_REGION( 0x200000, "maincpu", 0 ) /* v60 code + data */
+ ROM_REGION( 0x200000, "mainpcb:maincpu", 0 ) /* v60 code + data */
ROM_LOAD_x4( "epr-14540.ic13", 0x000000, 0x020000, CRC(c2b4e5d0) SHA1(69f8ddded5095df9012663d0ded61b78f1692a8d) )
ROM_LOAD_x4( "epr-14539.ic6", 0x080000, 0x020000, CRC(1a1b5532) SHA1(f3651470222036703b7ecedb6e91e4cdb3d20df7) )
ROM_LOAD16_BYTE( "epr-14509.ic14", 0x100000, 0x080000, CRC(daa5a356) SHA1(ca87242c59de5ab5f9406635bee758a855fe20bc) )
ROM_LOAD16_BYTE( "epr-14508.ic7", 0x100001, 0x080000, CRC(6702c14d) SHA1(dc9324f16a3e3238f5ccdade9451d6823a50b563) )
- ROM_REGION( 0x500000, "soundcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x500000, "mainpcb:soundcpu", 0 ) /* sound CPU */
ROM_LOAD_x4( "epr-14513.ic35", 0x100000, 0x40000, CRC(f9a884cd) SHA1(73010fff5e0257355e08e78838c74af86ed364ce) )
ROM_LOAD_x2( "mpr-14512.ic31", 0x200000, 0x80000, CRC(9da48051) SHA1(2d41148d089a75362ed0fde577eca919213ac666) )
ROM_LOAD_x2( "mpr-14511.ic26", 0x300000, 0x80000, CRC(074c53cc) SHA1(9c89843bbe8058123c25b7f8f86de754ddbca2bb) )
ROM_LOAD_x2( "mpr-14510.ic22", 0x400000, 0x80000, CRC(5ea6d52d) SHA1(d424082468940bb91ab424ac7812839792ed4e88) )
- ROM_REGION( 0x200000, "gfx1", 0 ) /* tiles */
+ ROM_REGION( 0x200000, "mainpcb:gfx1", 0 ) /* tiles */
ROM_LOAD32_BYTE( "mpr-14496.ic25", 0x000003, 0x080000, CRC(737da16c) SHA1(52247d9bc2924e90d040bef484a541b1f4a9026f) )
ROM_LOAD32_BYTE( "mpr-14497.ic29", 0x000001, 0x080000, CRC(ebd7ed17) SHA1(2307dc28501965432d2ff55a21698efdce014401) )
ROM_LOAD32_BYTE( "mpr-14498.ic34", 0x000002, 0x080000, CRC(d4a764bd) SHA1(8434a9225ed1e01e8b1cfe169268e42cd3ce6ee3) )
ROM_LOAD32_BYTE( "mpr-14499.ic38", 0x000000, 0x080000, CRC(fadc4b2b) SHA1(01c02a4dfad1ab19bac8b81b61d37fdc035bc5c5) )
- ROM_REGION32_BE( 0x800000, "gfx2", 0 ) /* sprites */
+ ROM_REGION32_BE( 0x800000, "mainpcb:gfx2", 0 ) /* sprites */
ROMX_LOAD( "mpr-14500.ic24", 0x000007, 0x100000, CRC(0a064e9b) SHA1(264761f4aacaeeac9426528caf180404cd7f6e18) , ROM_SKIP(7) )
ROMX_LOAD( "mpr-14501.ic28", 0x000006, 0x100000, CRC(4662bb41) SHA1(80774e680468e9ba9c5dd5eeaa4791fa3b3722fd) , ROM_SKIP(7) )
ROMX_LOAD( "mpr-14502.ic33", 0x000005, 0x100000, CRC(988555a9) SHA1(355e44319fd51358329cc7cd226e4c4725e045cb) , ROM_SKIP(7) )
@@ -2554,8 +2792,37 @@ ROM_START( arescue )
ROMX_LOAD( "mpr-14506.ic32", 0x000001, 0x100000, CRC(5dd8fb6b) SHA1(7d21cacb2c9dba5db2547b6d8e89397e0424ee8e) , ROM_SKIP(7) )
ROMX_LOAD( "mpr-14507.ic36", 0x000000, 0x100000, CRC(db3f59ec) SHA1(96dcb3827354773fc2911c62260a27e90dcbe96a) , ROM_SKIP(7) )
- ROM_REGION( 0x20000, "user2", 0 ) /* NEC uPD77P25 DSP Internal ROM */
+ ROM_REGION( 0x20000, "user2", 0 ) /* NEC uPD77P25 DSP Internal ROM */ // ONLY PRESENT ON ONE PCB STACK
ROM_LOAD( "d7725.01", 0x000000, 0x002800, CRC(a7ec5644) SHA1(e9b05c70b639ee289e557dfd9a6c724b36338e2b) )
+
+ ROM_REGION( 0x200000, "slavepcb:maincpu", 0 ) /* v60 code + data */
+ ROM_LOAD_x4( "epr-14540.ic13", 0x000000, 0x020000, CRC(c2b4e5d0) SHA1(69f8ddded5095df9012663d0ded61b78f1692a8d) )
+ ROM_LOAD_x4( "epr-14539.ic6", 0x080000, 0x020000, CRC(1a1b5532) SHA1(f3651470222036703b7ecedb6e91e4cdb3d20df7) )
+ ROM_LOAD16_BYTE( "epr-14509.ic14", 0x100000, 0x080000, CRC(daa5a356) SHA1(ca87242c59de5ab5f9406635bee758a855fe20bc) )
+ ROM_LOAD16_BYTE( "epr-14508.ic7", 0x100001, 0x080000, CRC(6702c14d) SHA1(dc9324f16a3e3238f5ccdade9451d6823a50b563) )
+
+ ROM_REGION( 0x500000, "slavepcb:soundcpu", 0 ) /* sound CPU */
+ ROM_LOAD_x4( "epr-14513.ic35", 0x100000, 0x40000, CRC(f9a884cd) SHA1(73010fff5e0257355e08e78838c74af86ed364ce) )
+ ROM_LOAD_x2( "mpr-14512.ic31", 0x200000, 0x80000, CRC(9da48051) SHA1(2d41148d089a75362ed0fde577eca919213ac666) )
+ ROM_LOAD_x2( "mpr-14511.ic26", 0x300000, 0x80000, CRC(074c53cc) SHA1(9c89843bbe8058123c25b7f8f86de754ddbca2bb) )
+ ROM_LOAD_x2( "mpr-14510.ic22", 0x400000, 0x80000, CRC(5ea6d52d) SHA1(d424082468940bb91ab424ac7812839792ed4e88) )
+
+ ROM_REGION( 0x200000, "slavepcb:gfx1", 0 ) /* tiles */
+ ROM_LOAD32_BYTE( "mpr-14496.ic25", 0x000003, 0x080000, CRC(737da16c) SHA1(52247d9bc2924e90d040bef484a541b1f4a9026f) )
+ ROM_LOAD32_BYTE( "mpr-14497.ic29", 0x000001, 0x080000, CRC(ebd7ed17) SHA1(2307dc28501965432d2ff55a21698efdce014401) )
+ ROM_LOAD32_BYTE( "mpr-14498.ic34", 0x000002, 0x080000, CRC(d4a764bd) SHA1(8434a9225ed1e01e8b1cfe169268e42cd3ce6ee3) )
+ ROM_LOAD32_BYTE( "mpr-14499.ic38", 0x000000, 0x080000, CRC(fadc4b2b) SHA1(01c02a4dfad1ab19bac8b81b61d37fdc035bc5c5) )
+
+ ROM_REGION32_BE( 0x800000, "slavepcb:gfx2", 0 ) /* sprites */
+ ROMX_LOAD( "mpr-14500.ic24", 0x000007, 0x100000, CRC(0a064e9b) SHA1(264761f4aacaeeac9426528caf180404cd7f6e18) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14501.ic28", 0x000006, 0x100000, CRC(4662bb41) SHA1(80774e680468e9ba9c5dd5eeaa4791fa3b3722fd) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14502.ic33", 0x000005, 0x100000, CRC(988555a9) SHA1(355e44319fd51358329cc7cd226e4c4725e045cb) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14503.ic37", 0x000004, 0x100000, CRC(90556aca) SHA1(24df62af55048db66d50c7034c5460330d231bf5) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14504.ic23", 0x000003, 0x100000, CRC(46dd038d) SHA1(9530a52e2e7388437c20ebcb19bf84c8b3b5086b) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14505.ic27", 0x000002, 0x100000, CRC(be142c1f) SHA1(224631e00c2458c39c6a2ef7978c2b1131fb4da2) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14506.ic32", 0x000001, 0x100000, CRC(5dd8fb6b) SHA1(7d21cacb2c9dba5db2547b6d8e89397e0424ee8e) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14507.ic36", 0x000000, 0x100000, CRC(db3f59ec) SHA1(96dcb3827354773fc2911c62260a27e90dcbe96a) , ROM_SKIP(7) )
+
ROM_END
/**************************************************************************************************************************
@@ -2572,25 +2839,25 @@ ROM_END
requires additional math DSP to be emulated
*/
ROM_START( arescuej )
- ROM_REGION( 0x200000, "maincpu", 0 ) /* v60 code + data */
+ ROM_REGION( 0x200000, "mainpcb:maincpu", 0 ) /* v60 code + data */
ROM_LOAD_x4( "epr-14515.ic13", 0x000000, 0x020000, CRC(fb5eefbd) SHA1(f2739ad2e168843fe992d7fb546ffd859fa6c17a) )
ROM_LOAD_x4( "epr-14514.ic6", 0x080000, 0x020000, CRC(ebf6dfc5) SHA1(2146dc23f1268124b6ad3cd00416a71fc56130bf) )
ROM_LOAD16_BYTE( "epr-14509.ic14", 0x100000, 0x080000, CRC(daa5a356) SHA1(ca87242c59de5ab5f9406635bee758a855fe20bc) )
ROM_LOAD16_BYTE( "epr-14508.ic7", 0x100001, 0x080000, CRC(6702c14d) SHA1(dc9324f16a3e3238f5ccdade9451d6823a50b563) )
- ROM_REGION( 0x500000, "soundcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x500000, "mainpcb:soundcpu", 0 ) /* sound CPU */
ROM_LOAD_x4( "epr-14513.ic35", 0x100000, 0x40000, CRC(f9a884cd) SHA1(73010fff5e0257355e08e78838c74af86ed364ce) )
ROM_LOAD_x2( "mpr-14512.ic31", 0x200000, 0x80000, CRC(9da48051) SHA1(2d41148d089a75362ed0fde577eca919213ac666) )
ROM_LOAD_x2( "mpr-14511.ic26", 0x300000, 0x80000, CRC(074c53cc) SHA1(9c89843bbe8058123c25b7f8f86de754ddbca2bb) )
ROM_LOAD_x2( "mpr-14510.ic22", 0x400000, 0x80000, CRC(5ea6d52d) SHA1(d424082468940bb91ab424ac7812839792ed4e88) )
- ROM_REGION( 0x200000, "gfx1", 0 ) /* tiles */
+ ROM_REGION( 0x200000, "mainpcb:gfx1", 0 ) /* tiles */
ROM_LOAD32_BYTE( "mpr-14496.ic25", 0x000003, 0x080000, CRC(737da16c) SHA1(52247d9bc2924e90d040bef484a541b1f4a9026f) )
ROM_LOAD32_BYTE( "mpr-14497.ic29", 0x000001, 0x080000, CRC(ebd7ed17) SHA1(2307dc28501965432d2ff55a21698efdce014401) )
ROM_LOAD32_BYTE( "mpr-14498.ic34", 0x000002, 0x080000, CRC(d4a764bd) SHA1(8434a9225ed1e01e8b1cfe169268e42cd3ce6ee3) )
ROM_LOAD32_BYTE( "mpr-14499.ic38", 0x000000, 0x080000, CRC(fadc4b2b) SHA1(01c02a4dfad1ab19bac8b81b61d37fdc035bc5c5) )
- ROM_REGION32_BE( 0x800000, "gfx2", 0 ) /* sprites */
+ ROM_REGION32_BE( 0x800000, "mainpcb:gfx2", 0 ) /* sprites */
ROMX_LOAD( "mpr-14500.ic24", 0x000007, 0x100000, CRC(0a064e9b) SHA1(264761f4aacaeeac9426528caf180404cd7f6e18) , ROM_SKIP(7) )
ROMX_LOAD( "mpr-14501.ic28", 0x000006, 0x100000, CRC(4662bb41) SHA1(80774e680468e9ba9c5dd5eeaa4791fa3b3722fd) , ROM_SKIP(7) )
ROMX_LOAD( "mpr-14502.ic33", 0x000005, 0x100000, CRC(988555a9) SHA1(355e44319fd51358329cc7cd226e4c4725e045cb) , ROM_SKIP(7) )
@@ -2600,8 +2867,37 @@ ROM_START( arescuej )
ROMX_LOAD( "mpr-14506.ic32", 0x000001, 0x100000, CRC(5dd8fb6b) SHA1(7d21cacb2c9dba5db2547b6d8e89397e0424ee8e) , ROM_SKIP(7) )
ROMX_LOAD( "mpr-14507.ic36", 0x000000, 0x100000, CRC(db3f59ec) SHA1(96dcb3827354773fc2911c62260a27e90dcbe96a) , ROM_SKIP(7) )
- ROM_REGION( 0x20000, "user2", 0 ) /* NEC uPD77P25 DSP Internal ROM */
+ ROM_REGION( 0x20000, "user2", 0 ) /* NEC uPD77P25 DSP Internal ROM */ // ONLY PRESENT ON ONE PCB STACK
ROM_LOAD( "d7725.01", 0x000000, 0x002800, CRC(a7ec5644) SHA1(e9b05c70b639ee289e557dfd9a6c724b36338e2b) )
+
+ ROM_REGION( 0x200000, "slavepcb:maincpu", 0 ) /* v60 code + data */
+ ROM_LOAD_x4( "epr-14515.ic13", 0x000000, 0x020000, CRC(fb5eefbd) SHA1(f2739ad2e168843fe992d7fb546ffd859fa6c17a) )
+ ROM_LOAD_x4( "epr-14514.ic6", 0x080000, 0x020000, CRC(ebf6dfc5) SHA1(2146dc23f1268124b6ad3cd00416a71fc56130bf) )
+ ROM_LOAD16_BYTE( "epr-14509.ic14", 0x100000, 0x080000, CRC(daa5a356) SHA1(ca87242c59de5ab5f9406635bee758a855fe20bc) )
+ ROM_LOAD16_BYTE( "epr-14508.ic7", 0x100001, 0x080000, CRC(6702c14d) SHA1(dc9324f16a3e3238f5ccdade9451d6823a50b563) )
+
+ ROM_REGION( 0x500000, "slavepcb:soundcpu", 0 ) /* sound CPU */
+ ROM_LOAD_x4( "epr-14513.ic35", 0x100000, 0x40000, CRC(f9a884cd) SHA1(73010fff5e0257355e08e78838c74af86ed364ce) )
+ ROM_LOAD_x2( "mpr-14512.ic31", 0x200000, 0x80000, CRC(9da48051) SHA1(2d41148d089a75362ed0fde577eca919213ac666) )
+ ROM_LOAD_x2( "mpr-14511.ic26", 0x300000, 0x80000, CRC(074c53cc) SHA1(9c89843bbe8058123c25b7f8f86de754ddbca2bb) )
+ ROM_LOAD_x2( "mpr-14510.ic22", 0x400000, 0x80000, CRC(5ea6d52d) SHA1(d424082468940bb91ab424ac7812839792ed4e88) )
+
+ ROM_REGION( 0x200000, "slavepcb:gfx1", 0 ) /* tiles */
+ ROM_LOAD32_BYTE( "mpr-14496.ic25", 0x000003, 0x080000, CRC(737da16c) SHA1(52247d9bc2924e90d040bef484a541b1f4a9026f) )
+ ROM_LOAD32_BYTE( "mpr-14497.ic29", 0x000001, 0x080000, CRC(ebd7ed17) SHA1(2307dc28501965432d2ff55a21698efdce014401) )
+ ROM_LOAD32_BYTE( "mpr-14498.ic34", 0x000002, 0x080000, CRC(d4a764bd) SHA1(8434a9225ed1e01e8b1cfe169268e42cd3ce6ee3) )
+ ROM_LOAD32_BYTE( "mpr-14499.ic38", 0x000000, 0x080000, CRC(fadc4b2b) SHA1(01c02a4dfad1ab19bac8b81b61d37fdc035bc5c5) )
+
+ ROM_REGION32_BE( 0x800000, "slavepcb:gfx2", 0 ) /* sprites */
+ ROMX_LOAD( "mpr-14500.ic24", 0x000007, 0x100000, CRC(0a064e9b) SHA1(264761f4aacaeeac9426528caf180404cd7f6e18) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14501.ic28", 0x000006, 0x100000, CRC(4662bb41) SHA1(80774e680468e9ba9c5dd5eeaa4791fa3b3722fd) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14502.ic33", 0x000005, 0x100000, CRC(988555a9) SHA1(355e44319fd51358329cc7cd226e4c4725e045cb) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14503.ic37", 0x000004, 0x100000, CRC(90556aca) SHA1(24df62af55048db66d50c7034c5460330d231bf5) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14504.ic23", 0x000003, 0x100000, CRC(46dd038d) SHA1(9530a52e2e7388437c20ebcb19bf84c8b3b5086b) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14505.ic27", 0x000002, 0x100000, CRC(be142c1f) SHA1(224631e00c2458c39c6a2ef7978c2b1131fb4da2) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14506.ic32", 0x000001, 0x100000, CRC(5dd8fb6b) SHA1(7d21cacb2c9dba5db2547b6d8e89397e0424ee8e) , ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-14507.ic36", 0x000000, 0x100000, CRC(db3f59ec) SHA1(96dcb3827354773fc2911c62260a27e90dcbe96a) , ROM_SKIP(7) )
+
ROM_END
@@ -2618,23 +2914,23 @@ ROM_END
A/D BD NO. 837-7536
*/
ROM_START( alien3 )
- ROM_REGION( 0x200000, "maincpu", 0 ) /* v60 code + data */
+ ROM_REGION( 0x200000, "mainpcb:maincpu", 0 ) /* v60 code + data */
ROM_LOAD_x2( "epr-15943.ic17", 0x000000, 0x040000, CRC(ac4591aa) SHA1(677155a3ebdac6602525e06adb25d287eaf9e089) )
ROM_LOAD_x2( "epr-15942.ic8", 0x080000, 0x040000, CRC(a1e1d0ec) SHA1(10d8d2235a67a4ba475fe98124c6a4a5311592b5) )
ROM_LOAD16_BYTE( "mpr-15855.ic18", 0x100000, 0x080000, CRC(a6fadabe) SHA1(328bbb54651eef197ba13f1bd9228f3f4de7ee5e) )
ROM_LOAD16_BYTE( "mpr-15854.ic9", 0x100001, 0x080000, CRC(d1aec392) SHA1(f48804fe0151e83ad45e912b55db8ae8ddebd2ad) )
- ROM_REGION( 0x500000, "soundcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x500000, "mainpcb:soundcpu", 0 ) /* sound CPU */
ROM_LOAD_x4( "epr-15859.ic36", 0x100000, 0x040000, CRC(91b55bd0) SHA1(23b85a006a91c2a5eb1cee14172fd0d8b7732518) )
ROM_LOAD( "mpr-15858.ic35", 0x200000, 0x100000, CRC(2eb64c10) SHA1(b2dbe86b82e889f4a9850cf4aa6596a139c1c3d6) )
ROM_LOAD( "mpr-15857.ic34", 0x300000, 0x100000, CRC(915c56df) SHA1(7031f937c826af17caf7ec8cbb6155d0a55bd38a) )
ROM_LOAD( "mpr-15856.ic24", 0x400000, 0x100000, CRC(a5ef4f1f) SHA1(e8da7a995955e80872a25bd75465c590b649cfab) )
- ROM_REGION( 0x400000, "gfx1", 0 ) /* tiles */
+ ROM_REGION( 0x400000, "mainpcb:gfx1", 0 ) /* tiles */
ROM_LOAD16_BYTE( "mpr-15863.ic14", 0x000000, 0x200000, CRC(9d36b645) SHA1(2977047780b615b64c3b4aec78fef0643d40490e) )
ROM_LOAD16_BYTE( "mpr-15862.ic5", 0x000001, 0x200000, CRC(9e277d25) SHA1(9f191484a42391268306a8d2d95c340ce8b2d6cd) )
- ROM_REGION32_BE( 0x1000000, "gfx2", 0 ) /* sprites */
+ ROM_REGION32_BE( 0x1000000, "mainpcb:gfx2", 0 ) /* sprites */
ROMX_LOAD( "mpr-15864.ic32", 0x000000, 0x200000, CRC(58207157) SHA1(d1b0c7edac8b89b1322398d4cd3a976a88bc0b56) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-15866.ic30", 0x000002, 0x200000, CRC(9c53732c) SHA1(9aa5103cc10b4927c16e0cf102b64a15dd038756) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-15868.ic28", 0x000004, 0x200000, CRC(62d556e8) SHA1(d70cab0881784a3d4dd06d0c99587ca6054c2dc4) , ROM_SKIP(6)|ROM_GROUPWORD )
@@ -2644,7 +2940,7 @@ ROM_START( alien3 )
ROMX_LOAD( "mpr-15869.ic27", 0x800004, 0x200000, CRC(dd4b137f) SHA1(7316dce32d35bf468defae5e6ed86910a37a2457) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-15871.ic25", 0x800006, 0x200000, CRC(58eb10ae) SHA1(23f2a72dc7b2d7b5c8a979952f81608296805745) , ROM_SKIP(6)|ROM_GROUPWORD )
- ROM_REGION16_BE( 0x80, "eeprom", 0 )
+ ROM_REGION16_BE( 0x80, "mainpcb:eeprom", 0 )
ROM_LOAD16_WORD( "93c45_eeprom.ic76", 0x0000, 0x0080, CRC(6e1d9df3) SHA1(2fd818bc393fb96e945fa37a63c8a3c4aff2f79f) )
ROM_END
@@ -2659,23 +2955,23 @@ ROM_END
A/D BD NO. 837-7536
*/
ROM_START( alien3u )
- ROM_REGION( 0x200000, "maincpu", 0 ) /* v60 code + data */
+ ROM_REGION( 0x200000, "mainpcb:maincpu", 0 ) /* v60 code + data */
ROM_LOAD_x2( "epr-15941.ic17", 0x000000, 0x040000, CRC(bf8c257f) SHA1(d08b77d2e3f5af0da7e7d8727fbe7fc0eb1153ff) )
ROM_LOAD_x2( "epr-15940a.ic8", 0x080000, 0x040000, CRC(8840b51e) SHA1(0aa6945000676b1adc535b1557a1455d62aed9f5) )
ROM_LOAD16_BYTE( "mpr-15855.ic18", 0x100000, 0x080000, CRC(a6fadabe) SHA1(328bbb54651eef197ba13f1bd9228f3f4de7ee5e) )
ROM_LOAD16_BYTE( "mpr-15854.ic9", 0x100001, 0x080000, CRC(d1aec392) SHA1(f48804fe0151e83ad45e912b55db8ae8ddebd2ad) )
- ROM_REGION( 0x500000, "soundcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x500000, "mainpcb:soundcpu", 0 ) /* sound CPU */
ROM_LOAD_x4( "epr-15859.ic36", 0x100000, 0x040000, CRC(91b55bd0) SHA1(23b85a006a91c2a5eb1cee14172fd0d8b7732518) )
ROM_LOAD( "mpr-15858.ic35", 0x200000, 0x100000, CRC(2eb64c10) SHA1(b2dbe86b82e889f4a9850cf4aa6596a139c1c3d6) )
ROM_LOAD( "mpr-15857.ic34", 0x300000, 0x100000, CRC(915c56df) SHA1(7031f937c826af17caf7ec8cbb6155d0a55bd38a) )
ROM_LOAD( "mpr-15856.ic24", 0x400000, 0x100000, CRC(a5ef4f1f) SHA1(e8da7a995955e80872a25bd75465c590b649cfab) )
- ROM_REGION( 0x400000, "gfx1", 0 ) /* tiles */
+ ROM_REGION( 0x400000, "mainpcb:gfx1", 0 ) /* tiles */
ROM_LOAD16_BYTE( "mpr-15863.ic14", 0x000000, 0x200000, CRC(9d36b645) SHA1(2977047780b615b64c3b4aec78fef0643d40490e) )
ROM_LOAD16_BYTE( "mpr-15862.ic5", 0x000001, 0x200000, CRC(9e277d25) SHA1(9f191484a42391268306a8d2d95c340ce8b2d6cd) )
- ROM_REGION32_BE( 0x1000000, "gfx2", 0 ) /* sprites */
+ ROM_REGION32_BE( 0x1000000, "mainpcb:gfx2", 0 ) /* sprites */
ROMX_LOAD( "mpr-15864.ic32", 0x000000, 0x200000, CRC(58207157) SHA1(d1b0c7edac8b89b1322398d4cd3a976a88bc0b56) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-15866.ic30", 0x000002, 0x200000, CRC(9c53732c) SHA1(9aa5103cc10b4927c16e0cf102b64a15dd038756) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-15868.ic28", 0x000004, 0x200000, CRC(62d556e8) SHA1(d70cab0881784a3d4dd06d0c99587ca6054c2dc4) , ROM_SKIP(6)|ROM_GROUPWORD )
@@ -2685,7 +2981,7 @@ ROM_START( alien3u )
ROMX_LOAD( "mpr-15869.ic27", 0x800004, 0x200000, CRC(dd4b137f) SHA1(7316dce32d35bf468defae5e6ed86910a37a2457) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-15871.ic25", 0x800006, 0x200000, CRC(58eb10ae) SHA1(23f2a72dc7b2d7b5c8a979952f81608296805745) , ROM_SKIP(6)|ROM_GROUPWORD )
- ROM_REGION16_BE( 0x80, "eeprom", 0 )
+ ROM_REGION16_BE( 0x80, "mainpcb:eeprom", 0 )
ROM_LOAD16_WORD( "93c45_eeprom.ic76", 0x0000, 0x0080, CRC(6e1d9df3) SHA1(2fd818bc393fb96e945fa37a63c8a3c4aff2f79f) )
ROM_END
@@ -2697,12 +2993,12 @@ ROM_END
protected via a custom V25 with encrypted code
*/
ROM_START( arabfgt )
- ROM_REGION( 0x200000, "maincpu", 0 ) /* v60 code + data */
+ ROM_REGION( 0x200000, "mainpcb:maincpu", 0 ) /* v60 code + data */
ROM_LOAD_x8( "epr-14609.ic8", 0x000000, 0x020000, CRC(6a43c7fb) SHA1(70e9f9fa5f867f0455d62ff2690ad19055d79363) )
ROM_LOAD16_BYTE_x2( "epr-14592.ic18", 0x100000, 0x040000, CRC(f7dff316) SHA1(338690a1404dde6e7e66067f23605a247c7d0f5b) )
ROM_LOAD16_BYTE_x2( "epr-14591.ic9", 0x100001, 0x040000, CRC(bbd940fb) SHA1(99c17aba890935eaf7ea468492da03103288eb1b) )
- ROM_REGION( 0x500000, "soundcpu", 0 ) /* sound CPU + banks */
+ ROM_REGION( 0x500000, "mainpcb:soundcpu", 0 ) /* sound CPU + banks */
ROM_LOAD_x8( "epr-14596.ic36", 0x100000, 0x020000, CRC(bd01faec) SHA1(c909dcb8ef2672c4b0060d911d295e445ca311eb) )
ROM_LOAD( "mpr-14595f.ic35", 0x200000, 0x100000, CRC(5173d1af) SHA1(dccda644488d0c561c8ff7fa9619bd9504d8d9c6) )
ROM_LOAD( "mpr-14594f.ic34", 0x300000, 0x100000, CRC(01777645) SHA1(7bcbe7687bd80b94bd3b2b3099cdd036bf7e0cd3) )
@@ -2712,11 +3008,11 @@ ROM_START( arabfgt )
ROM_LOAD( "epr-14468-01.u3", 0x00000, 0x10000, CRC(c3c591e4) SHA1(53e48066e85b61d0c456618d14334a509b354cb3) )
ROM_RELOAD( 0xf0000, 0x10000)
- ROM_REGION( 0x400000, "gfx1", 0 ) /* tiles */
+ ROM_REGION( 0x400000, "mainpcb:gfx1", 0 ) /* tiles */
ROM_LOAD16_BYTE( "mpr-14599f.ic14", 0x000000, 0x200000, CRC(94f1cf10) SHA1(34ec86487bcb6726c025149c319f00a854eb7a1d) )
ROM_LOAD16_BYTE( "mpr-14598f.ic5", 0x000001, 0x200000, CRC(010656f3) SHA1(31619c022cba4f250ce174f186d3e34444f60faf) )
- ROM_REGION32_BE( 0x1000000, "gfx2", 0 ) /* sprites */
+ ROM_REGION32_BE( 0x1000000, "mainpcb:gfx2", 0 ) /* sprites */
ROMX_LOAD( "mpr-14600f.ic32", 0x000000, 0x200000, CRC(e860988a) SHA1(328581877c0890519c854f75f0976b0e9c4560f8) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-14602.ic30", 0x000002, 0x200000, CRC(64524e4d) SHA1(86246185ab5ab638a73991c9e3aeb07c6d51be4f) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-14604.ic28", 0x000004, 0x200000, CRC(5f8d5167) SHA1(1b08495e5a4cc2530c2895e47abd0e0b75496c68) , ROM_SKIP(6)|ROM_GROUPWORD )
@@ -2732,12 +3028,12 @@ ROM_END
protected via a custom V25 with encrypted code
*/
ROM_START( arabfgtu )
- ROM_REGION( 0x200000, "maincpu", 0 ) /* v60 code + data */
+ ROM_REGION( 0x200000, "mainpcb:maincpu", 0 ) /* v60 code + data */
ROM_LOAD_x8( "epr-14608.ic8", 0x000000, 0x020000, CRC(cd5efba9) SHA1(a7daf8e95d31359753c984c447e93d40f43a179d) )
ROM_LOAD16_BYTE_x2( "epr-14592.ic18", 0x100000, 0x040000, CRC(f7dff316) SHA1(338690a1404dde6e7e66067f23605a247c7d0f5b) )
ROM_LOAD16_BYTE_x2( "epr-14591.ic9", 0x100001, 0x040000, CRC(bbd940fb) SHA1(99c17aba890935eaf7ea468492da03103288eb1b) )
- ROM_REGION( 0x500000, "soundcpu", 0 ) /* sound CPU + banks */
+ ROM_REGION( 0x500000, "mainpcb:soundcpu", 0 ) /* sound CPU + banks */
ROM_LOAD_x8( "epr-14596.ic36", 0x100000, 0x020000, CRC(bd01faec) SHA1(c909dcb8ef2672c4b0060d911d295e445ca311eb) )
ROM_LOAD( "mpr-14595f.ic35", 0x200000, 0x100000, CRC(5173d1af) SHA1(dccda644488d0c561c8ff7fa9619bd9504d8d9c6) )
ROM_LOAD( "mpr-14594f.ic34", 0x300000, 0x100000, CRC(01777645) SHA1(7bcbe7687bd80b94bd3b2b3099cdd036bf7e0cd3) )
@@ -2747,11 +3043,11 @@ ROM_START( arabfgtu )
ROM_LOAD( "epr-14468-01.u3", 0x00000, 0x10000, CRC(c3c591e4) SHA1(53e48066e85b61d0c456618d14334a509b354cb3) )
ROM_RELOAD( 0xf0000, 0x10000)
- ROM_REGION( 0x400000, "gfx1", 0 ) /* tiles */
+ ROM_REGION( 0x400000, "mainpcb:gfx1", 0 ) /* tiles */
ROM_LOAD16_BYTE( "mpr-14599f.ic14", 0x000000, 0x200000, CRC(94f1cf10) SHA1(34ec86487bcb6726c025149c319f00a854eb7a1d) )
ROM_LOAD16_BYTE( "mpr-14598f.ic5", 0x000001, 0x200000, CRC(010656f3) SHA1(31619c022cba4f250ce174f186d3e34444f60faf) )
- ROM_REGION32_BE( 0x1000000, "gfx2", 0 ) /* sprites */
+ ROM_REGION32_BE( 0x1000000, "mainpcb:gfx2", 0 ) /* sprites */
ROMX_LOAD( "mpr-14600f.ic32", 0x000000, 0x200000, CRC(e860988a) SHA1(328581877c0890519c854f75f0976b0e9c4560f8) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-14602.ic30", 0x000002, 0x200000, CRC(64524e4d) SHA1(86246185ab5ab638a73991c9e3aeb07c6d51be4f) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-14604.ic28", 0x000004, 0x200000, CRC(5f8d5167) SHA1(1b08495e5a4cc2530c2895e47abd0e0b75496c68) , ROM_SKIP(6)|ROM_GROUPWORD )
@@ -2767,12 +3063,12 @@ ROM_END
protected via a custom V25 with encrypted code
*/
ROM_START( arabfgtj )
- ROM_REGION( 0x200000, "maincpu", 0 ) /* v60 code + data */
+ ROM_REGION( 0x200000, "mainpcb:maincpu", 0 ) /* v60 code + data */
ROM_LOAD_x8( "epr-14597.ic8", 0x000000, 0x020000, CRC(7a6fe222) SHA1(f730e9d44ad20dbaa59f6311a077c889e0aec8e4) )
ROM_LOAD16_BYTE_x2( "epr-14592.ic18", 0x100000, 0x040000, CRC(f7dff316) SHA1(338690a1404dde6e7e66067f23605a247c7d0f5b) )
ROM_LOAD16_BYTE_x2( "epr-14591.ic9", 0x100001, 0x040000, CRC(bbd940fb) SHA1(99c17aba890935eaf7ea468492da03103288eb1b) )
- ROM_REGION( 0x500000, "soundcpu", 0 ) /* sound CPU + banks */
+ ROM_REGION( 0x500000, "mainpcb:soundcpu", 0 ) /* sound CPU + banks */
ROM_LOAD_x8( "epr-14596.ic36", 0x100000, 0x020000, CRC(bd01faec) SHA1(c909dcb8ef2672c4b0060d911d295e445ca311eb) )
ROM_LOAD( "mpr-14595f.ic35", 0x200000, 0x100000, CRC(5173d1af) SHA1(dccda644488d0c561c8ff7fa9619bd9504d8d9c6) )
ROM_LOAD( "mpr-14594f.ic34", 0x300000, 0x100000, CRC(01777645) SHA1(7bcbe7687bd80b94bd3b2b3099cdd036bf7e0cd3) )
@@ -2782,11 +3078,11 @@ ROM_START( arabfgtj )
ROM_LOAD( "epr-14468-01.u3", 0x00000, 0x10000, CRC(c3c591e4) SHA1(53e48066e85b61d0c456618d14334a509b354cb3) )
ROM_RELOAD( 0xf0000, 0x10000)
- ROM_REGION( 0x400000, "gfx1", 0 ) /* tiles */
+ ROM_REGION( 0x400000, "mainpcb:gfx1", 0 ) /* tiles */
ROM_LOAD16_BYTE( "mpr-14599f.ic14", 0x000000, 0x200000, CRC(94f1cf10) SHA1(34ec86487bcb6726c025149c319f00a854eb7a1d) )
ROM_LOAD16_BYTE( "mpr-14598f.ic5", 0x000001, 0x200000, CRC(010656f3) SHA1(31619c022cba4f250ce174f186d3e34444f60faf) )
- ROM_REGION32_BE( 0x1000000, "gfx2", 0 ) /* sprites */
+ ROM_REGION32_BE( 0x1000000, "mainpcb:gfx2", 0 ) /* sprites */
ROMX_LOAD( "mpr-14600f.ic32", 0x000000, 0x200000, CRC(e860988a) SHA1(328581877c0890519c854f75f0976b0e9c4560f8) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-14602.ic30", 0x000002, 0x200000, CRC(64524e4d) SHA1(86246185ab5ab638a73991c9e3aeb07c6d51be4f) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-14604.ic28", 0x000004, 0x200000, CRC(5f8d5167) SHA1(1b08495e5a4cc2530c2895e47abd0e0b75496c68) , ROM_SKIP(6)|ROM_GROUPWORD )
@@ -2805,22 +3101,22 @@ ROM_END
protected via FD1149 317-0212
*/
ROM_START( brival )
- ROM_REGION( 0x200000, "maincpu", 0 ) /* v60 code + data */
+ ROM_REGION( 0x200000, "mainpcb:maincpu", 0 ) /* v60 code + data */
ROM_LOAD_x8( "epr-15722.ic8", 0x000000, 0x020000, CRC(138141c0) SHA1(aca2a46ee1008e91c65a09e79c76d5175e7df5e8) )
ROM_LOAD16_BYTE( "epr-15723.ic18", 0x100000, 0x080000, CRC(4ff40d39) SHA1(b33a656f976ec7a1a2268e7b9a81d5b84f3d9ca3) )
ROM_LOAD16_BYTE( "epr-15724.ic9", 0x100001, 0x080000, CRC(3ff8a052) SHA1(f484a8e15a022f9ff290e662ab27f96f9f0ad24e) )
- ROM_REGION( 0x500000, "soundcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x500000, "mainpcb:soundcpu", 0 ) /* sound CPU */
ROM_LOAD_x8( "epr-15725.ic36", 0x100000, 0x020000, CRC(ea1407d7) SHA1(68b571341f032278e87a38739ba8084b7a6062d3) )
ROM_LOAD( "mpr-15627.ic35", 0x200000, 0x100000, CRC(8a8388c5) SHA1(7ee03feb975cc576a3d8651fd41976ca87d60894) )
ROM_LOAD( "mpr-15626.ic34", 0x300000, 0x100000, CRC(83306d1e) SHA1(feb08902b51c0013d9417832cdf198e36cdfc28c) )
ROM_LOAD( "mpr-15625.ic24", 0x400000, 0x100000, CRC(3ce82932) SHA1(f2107bc2591f46a51c9f0d706933b1ae69db91f9) )
- ROM_REGION( 0x400000, "gfx1", 0 ) /* tiles */
+ ROM_REGION( 0x400000, "mainpcb:gfx1", 0 ) /* tiles */
ROM_LOAD16_BYTE( "mpr-15629.ic14", 0x000000, 0x200000, CRC(2c8dd96d) SHA1(4a42a30485c19eb4f4a9d518a3dff3ae11911d01) )
ROM_LOAD16_BYTE( "mpr-15628.ic5", 0x000001, 0x200000, CRC(58d4ca40) SHA1(b1633acc803bba7e8283a9663b49abeda662a74d) )
- ROM_REGION32_BE( 0x1000000, "gfx2", 0 ) /* sprites */
+ ROM_REGION32_BE( 0x1000000, "mainpcb:gfx2", 0 ) /* sprites */
ROMX_LOAD( "mpr-15637.ic32", 0x000000, 0x200000, CRC(b6cf2f05) SHA1(a308d40ce5165e03fccf7fcd615ee111f7840fdc) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-15635.ic30", 0x000002, 0x200000, CRC(70f2eb2b) SHA1(9868c8b0dd8ce810a0e32f51e702eee7e1c9a967) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-15633.ic28", 0x000004, 0x200000, CRC(005dfed5) SHA1(f555620d75d3886a890307be9df9c0879bcda695) , ROM_SKIP(6)|ROM_GROUPWORD )
@@ -2836,12 +3132,12 @@ ROM_END
protected via FD1149 317-0212
*/
ROM_START( brivalj )
- ROM_REGION( 0x200000, "maincpu", 0 ) /* v60 code + data */
+ ROM_REGION( 0x200000, "mainpcb:maincpu", 0 ) /* v60 code + data */
ROM_LOAD_x8( "epr-15720.ic8", 0x000000, 0x020000, CRC(0d182d78) SHA1(53e9e5898869ea4a354dc3e9a78d8b8e9a7274c9) )
ROM_LOAD16_BYTE( "epr-15723.ic18", 0x100000, 0x080000, CRC(4ff40d39) SHA1(b33a656f976ec7a1a2268e7b9a81d5b84f3d9ca3) )
ROM_LOAD16_BYTE( "epr-15724.ic9", 0x100001, 0x080000, CRC(3ff8a052) SHA1(f484a8e15a022f9ff290e662ab27f96f9f0ad24e) )
- ROM_REGION( 0x500000, "soundcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x500000, "mainpcb:soundcpu", 0 ) /* sound CPU */
ROM_LOAD_x8( "epr-15725.ic36", 0x100000, 0x020000, CRC(ea1407d7) SHA1(68b571341f032278e87a38739ba8084b7a6062d3) )
ROM_LOAD( "mpr-15627.ic35", 0x200000, 0x100000, CRC(8a8388c5) SHA1(7ee03feb975cc576a3d8651fd41976ca87d60894) )
ROM_LOAD( "mpr-15626.ic34", 0x300000, 0x100000, CRC(83306d1e) SHA1(feb08902b51c0013d9417832cdf198e36cdfc28c) )
@@ -2851,11 +3147,11 @@ ROM_START( brivalj )
in the parent set, but Sega did change the part numbers so they might be correct, the others
are suspicious, the changes are very similar but the part numbers haven't changed. We really
need a 3rd board to verify */
- ROM_REGION( 0x400000, "gfx1", 0 ) /* tiles */
+ ROM_REGION( 0x400000, "mainpcb:gfx1", 0 ) /* tiles */
ROM_LOAD16_BYTE( "mpr-14599f.ic14", 0x000000, 0x200000, CRC(1de17e83) SHA1(04ee14b863f93b42a5bd1b6da71cff54ef11d4b7) ) /* Rom # matches tile rom # from Arabian Fight ??? */
ROM_LOAD16_BYTE( "mpr-14598f.ic5", 0x000001, 0x200000, CRC(cafb0de9) SHA1(94c6bfc7a4081dee373e9466a7b6f80889696087) ) /* Rom # matchrs tile rom # from Arabian Fight ??? */
- ROM_REGION32_BE( 0x1000000, "gfx2", 0 ) /* sprites */
+ ROM_REGION32_BE( 0x1000000, "mainpcb:gfx2", 0 ) /* sprites */
ROMX_LOAD( "brivalj_mp15637.32", 0x000000, 0x200000, CRC(f39844c0) SHA1(c48dc8cccdd9d3756cf99a983c6a89ed43fcda22) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "brivalj_mp15635.30", 0x000002, 0x200000, CRC(263cf6d1) SHA1(7accd214502fd050edc0901c9929d6069dae4d00) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "brivalj_mp15633.28", 0x000004, 0x200000, CRC(44e9a88b) SHA1(57a930b9c3b83c889df54de60c90f847c2dcb614) , ROM_SKIP(6)|ROM_GROUPWORD )
@@ -2874,20 +3170,20 @@ ROM_END
protected via FD1149 317-0204
*/
ROM_START( darkedge )
- ROM_REGION( 0x200000, "maincpu", 0 ) /* v60 code + data */
+ ROM_REGION( 0x200000, "mainpcb:maincpu", 0 ) /* v60 code + data */
ROM_LOAD_x2( "epr-15246.ic8", 0x000000, 0x080000, CRC(c0bdceeb) SHA1(9cf670cf9a8691f259c75c1d9c6cb14e8a70bb72) )
- ROM_REGION( 0x500000, "soundcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x500000, "mainpcb:soundcpu", 0 ) /* sound CPU */
ROM_LOAD_x8( "epr-15243.ic36", 0x100000, 0x020000, CRC(08ca5f11) SHA1(c2c48d2f02770941a93794f82cb407d6264904d2) )
ROM_LOAD( "mpr-15242.ic35", 0x200000, 0x100000, CRC(ffb7d917) SHA1(bfeae1a2bd7250edb695b7034f6b1f851f6fd48a) )
ROM_LOAD( "mpr-15241.ic34", 0x300000, 0x100000, CRC(8eccc4fe) SHA1(119724b9b6d2b51ad4f065ebf74d200960090e68) )
ROM_LOAD( "mpr-15240.ic24", 0x400000, 0x100000, CRC(867d59e8) SHA1(fb1c0d26dbb1bde9d8bc86419cd911b8e37bf923) )
- ROM_REGION( 0x100000, "gfx1", 0 ) /* tiles */
+ ROM_REGION( 0x100000, "mainpcb:gfx1", 0 ) /* tiles */
ROM_LOAD16_BYTE( "mpr-15248.ic14", 0x000000, 0x080000, CRC(185b308b) SHA1(a49c1b752b3c4355560e0cd712fb9a096140e37b) )
ROM_LOAD16_BYTE( "mpr-15247.ic5", 0x000001, 0x080000, CRC(be21548c) SHA1(2e315aadc2a0b781c3ee3fe71c75eb1f43514eff) )
- ROM_REGION32_BE( 0x1000000, "gfx2", 0 ) /* sprites */
+ ROM_REGION32_BE( 0x1000000, "mainpcb:gfx2", 0 ) /* sprites */
ROMX_LOAD( "mpr-15249.ic32", 0x000000, 0x200000, CRC(2b4371a8) SHA1(47f448bfbc068f2d0cdedd81bcd280823d5758a3) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-15251.ic30", 0x000002, 0x200000, CRC(efe2d689) SHA1(af22153ea3afdde3732f881087c642170f91d745) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-15253.ic28", 0x000004, 0x200000, CRC(8356ed01) SHA1(a28747813807361c7d0c722a94e194caea8bfab6) , ROM_SKIP(6)|ROM_GROUPWORD )
@@ -2903,20 +3199,20 @@ ROM_END
protected via FD1149 317-0204
*/
ROM_START( darkedgej )
- ROM_REGION( 0x200000, "maincpu", 0 ) /* v60 code + data */
+ ROM_REGION( 0x200000, "mainpcb:maincpu", 0 ) /* v60 code + data */
ROM_LOAD_x2( "epr-15244.ic8", 0x000000, 0x080000, CRC(0db138cb) SHA1(79ccb754e0d816b395b536a6d9c5a6e93168a913) )
- ROM_REGION( 0x500000, "soundcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x500000, "mainpcb:soundcpu", 0 ) /* sound CPU */
ROM_LOAD_x8( "epr-15243.ic36", 0x100000, 0x020000, CRC(08ca5f11) SHA1(c2c48d2f02770941a93794f82cb407d6264904d2) )
ROM_LOAD( "mpr-15242.ic35", 0x200000, 0x100000, CRC(ffb7d917) SHA1(bfeae1a2bd7250edb695b7034f6b1f851f6fd48a) )
ROM_LOAD( "mpr-15241.ic34", 0x300000, 0x100000, CRC(8eccc4fe) SHA1(119724b9b6d2b51ad4f065ebf74d200960090e68) )
ROM_LOAD( "mpr-15240.ic24", 0x400000, 0x100000, CRC(867d59e8) SHA1(fb1c0d26dbb1bde9d8bc86419cd911b8e37bf923) )
- ROM_REGION( 0x100000, "gfx1", 0 ) /* tiles */
+ ROM_REGION( 0x100000, "mainpcb:gfx1", 0 ) /* tiles */
ROM_LOAD16_BYTE( "mpr-15248.ic14", 0x000000, 0x080000, CRC(185b308b) SHA1(a49c1b752b3c4355560e0cd712fb9a096140e37b) )
ROM_LOAD16_BYTE( "mpr-15247.ic5", 0x000001, 0x080000, CRC(be21548c) SHA1(2e315aadc2a0b781c3ee3fe71c75eb1f43514eff) )
- ROM_REGION32_BE( 0x1000000, "gfx2", 0 ) /* sprites */
+ ROM_REGION32_BE( 0x1000000, "mainpcb:gfx2", 0 ) /* sprites */
ROMX_LOAD( "mpr-15249.ic32", 0x000000, 0x200000, CRC(2b4371a8) SHA1(47f448bfbc068f2d0cdedd81bcd280823d5758a3) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-15251.ic30", 0x000002, 0x200000, CRC(efe2d689) SHA1(af22153ea3afdde3732f881087c642170f91d745) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-15253.ic28", 0x000004, 0x200000, CRC(8356ed01) SHA1(a28747813807361c7d0c722a94e194caea8bfab6) , ROM_SKIP(6)|ROM_GROUPWORD )
@@ -2935,21 +3231,21 @@ ROM_END
protected via FD1149 317-0215/0217
*/
ROM_START( dbzvrvs )
- ROM_REGION( 0x200000, "maincpu", 0 ) /* v60 code + data */
+ ROM_REGION( 0x200000, "mainpcb:maincpu", 0 ) /* v60 code + data */
ROM_LOAD( "16543", 0x000000, 0x080000, CRC(7b9bc6f5) SHA1(556fd8471bf471e41fc6a50471c2be1bd6b98697) )
ROM_LOAD( "16542.a", 0x080000, 0x080000, CRC(6449ab22) SHA1(03e6cdacf77f2ff80dd6798094deac5486f2c840) )
- ROM_REGION( 0x500000, "soundcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x500000, "mainpcb:soundcpu", 0 ) /* sound CPU */
ROM_LOAD_x4( "16541", 0x100000, 0x040000, CRC(1d61d836) SHA1(c6b1b54d41d2650abeaf69a31aa76c4462531880) )
ROM_LOAD( "16540", 0x200000, 0x100000, CRC(b6f9bb43) SHA1(823f29a2fc4b9315e8c58616dbd095d45d366c8b) )
ROM_LOAD( "16539", 0x300000, 0x100000, CRC(38c26418) SHA1(2442933e13c83209e904c1dec677aeda91b75290) )
ROM_LOAD( "16538", 0x400000, 0x100000, CRC(4d402c31) SHA1(2df160fd7e70f3d7b52fef2a2082e68966fd1535) )
- ROM_REGION( 0x200000, "gfx1", 0 ) /* tiles */
+ ROM_REGION( 0x200000, "mainpcb:gfx1", 0 ) /* tiles */
ROM_LOAD16_BYTE( "16545", 0x000000, 0x100000, CRC(51748bac) SHA1(b1cae16b62a8d29117c0adb140eb09c1092f6c37) )
ROM_LOAD16_BYTE( "16544", 0x000001, 0x100000, CRC(f6c93dfc) SHA1(a006cedb7d0151ccc8d22e6588b1c39e099da182) )
- ROM_REGION32_BE( 0x1000000, "gfx2", 0 ) /* sprites */
+ ROM_REGION32_BE( 0x1000000, "mainpcb:gfx2", 0 ) /* sprites */
ROMX_LOAD( "16546", 0x000000, 0x200000, CRC(96f4be31) SHA1(ce3281630180d91de7850e9b1062382817fe0b1d) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "16548", 0x000002, 0x200000, CRC(00377f59) SHA1(cf0f808d7730f334c5ac80d3171fa457be9ac88e) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "16550", 0x000004, 0x200000, CRC(168e8966) SHA1(a18ec30f1358b09bcde6d8d2dbe0a82bea3bdae9) , ROM_SKIP(6)|ROM_GROUPWORD )
@@ -2975,24 +3271,51 @@ ROM_END
A/D BD NO. 837-7536
*/
ROM_START( f1en )
- ROM_REGION( 0x200000, "maincpu", 0 ) /* v60 code + data */
+ ROM_REGION( 0x200000, "mainpcb:maincpu", 0 ) /* v60 code + data */
+ ROM_LOAD_x8( "epr-14452a.ic6", 0x000000, 0x020000, CRC(b5b4a9d9) SHA1(6699c15dc1155c3cee33a06d320acbff0ab5ad11) )
+ ROM_LOAD16_BYTE_x2( "epr-14445.ic14", 0x100000, 0x040000, CRC(d06261ab) SHA1(6e1c4ce4e49a142fd5b1ecac98145960d7afd567) )
+ ROM_LOAD16_BYTE_x2( "epr-14444.ic7", 0x100001, 0x040000, CRC(07724354) SHA1(9d7f64a80553c4ae0e9cf716478fd5c4b8277470) )
+
+ ROM_REGION( 0x500000, "mainpcb:soundcpu", 0 ) /* sound CPU */
+ ROM_LOAD_x8( "epr-14449.ic35", 0x100000, 0x020000, CRC(2d29699c) SHA1(cae02e5533a0edd3b3b4a54a1a43321285e06416) )
+ ROM_LOAD_x2( "epr-14448.ic31", 0x200000, 0x080000, CRC(87ca1e8d) SHA1(739274171c13983a60d061176095645419dade49) )
+ ROM_LOAD_x2( "epr-14447.ic26", 0x300000, 0x080000, CRC(db1cfcbd) SHA1(c76eb2ced5571a548ad00709097dd272747127a2) )
+ ROM_LOAD_x2( "epr-14446.ic22", 0x400000, 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_REGION32_BE( 0x800000, "mainpcb:gfx2", 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) )
+
+ ROM_REGION( 0x200000, "slavepcb:maincpu", 0 ) /* v60 code + data */
ROM_LOAD_x8( "epr-14452a.ic6", 0x000000, 0x020000, CRC(b5b4a9d9) SHA1(6699c15dc1155c3cee33a06d320acbff0ab5ad11) )
ROM_LOAD16_BYTE_x2( "epr-14445.ic14", 0x100000, 0x040000, CRC(d06261ab) SHA1(6e1c4ce4e49a142fd5b1ecac98145960d7afd567) )
ROM_LOAD16_BYTE_x2( "epr-14444.ic7", 0x100001, 0x040000, CRC(07724354) SHA1(9d7f64a80553c4ae0e9cf716478fd5c4b8277470) )
- ROM_REGION( 0x500000, "soundcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x500000, "slavepcb:soundcpu", 0 ) /* sound CPU */
ROM_LOAD_x8( "epr-14449.ic35", 0x100000, 0x020000, CRC(2d29699c) SHA1(cae02e5533a0edd3b3b4a54a1a43321285e06416) )
ROM_LOAD_x2( "epr-14448.ic31", 0x200000, 0x080000, CRC(87ca1e8d) SHA1(739274171c13983a60d061176095645419dade49) )
ROM_LOAD_x2( "epr-14447.ic26", 0x300000, 0x080000, CRC(db1cfcbd) SHA1(c76eb2ced5571a548ad00709097dd272747127a2) )
ROM_LOAD_x2( "epr-14446.ic22", 0x400000, 0x080000, CRC(646ec2cb) SHA1(67e453f128ae227e22c68f55d0d3f5831fbeb2f9) )
- ROM_REGION( 0x100000, "gfx1", 0 ) /* tiles */
+ 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_REGION32_BE( 0x800000, "gfx2", 0 ) /* sprites */
+ ROM_REGION32_BE( 0x800000, "slavepcb:gfx2", 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) )
@@ -3001,6 +3324,7 @@ ROM_START( f1en )
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) )
+
ROM_END
/**************************************************************************************************************************
@@ -3015,24 +3339,51 @@ ROM_END
A/D BD NO. 837-7536
*/
ROM_START( f1enu ) // ROM PCB number is 834-8439-04
- ROM_REGION( 0x200000, "maincpu", 0 ) /* v60 code + data */
+ ROM_REGION( 0x200000, "mainpcb:maincpu", 0 ) /* v60 code + data */
+ ROM_LOAD_x8( "epr-14451a.ic6", 0x000000, 0x020000, CRC(e17259c9) SHA1(be789b7630b7265e19ea2c80f603caff9cec37f8) )
+ ROM_LOAD16_BYTE_x2( "epr-14445.ic14", 0x100000, 0x040000, CRC(d06261ab) SHA1(6e1c4ce4e49a142fd5b1ecac98145960d7afd567) )
+ ROM_LOAD16_BYTE_x2( "epr-14444.ic7", 0x100001, 0x040000, CRC(07724354) SHA1(9d7f64a80553c4ae0e9cf716478fd5c4b8277470) )
+
+ ROM_REGION( 0x500000, "mainpcb:soundcpu", 0 ) /* sound CPU */
+ ROM_LOAD_x8( "epr-14449.ic35", 0x100000, 0x020000, CRC(2d29699c) SHA1(cae02e5533a0edd3b3b4a54a1a43321285e06416) )
+ ROM_LOAD_x2( "epr-14448.ic31", 0x200000, 0x080000, CRC(87ca1e8d) SHA1(739274171c13983a60d061176095645419dade49) )
+ ROM_LOAD_x2( "epr-14447.ic26", 0x300000, 0x080000, CRC(db1cfcbd) SHA1(c76eb2ced5571a548ad00709097dd272747127a2) )
+ ROM_LOAD_x2( "epr-14446.ic22", 0x400000, 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_REGION32_BE( 0x800000, "mainpcb:gfx2", 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) )
+
+ ROM_REGION( 0x200000, "slavepcb:maincpu", 0 ) /* v60 code + data */
ROM_LOAD_x8( "epr-14451a.ic6", 0x000000, 0x020000, CRC(e17259c9) SHA1(be789b7630b7265e19ea2c80f603caff9cec37f8) )
ROM_LOAD16_BYTE_x2( "epr-14445.ic14", 0x100000, 0x040000, CRC(d06261ab) SHA1(6e1c4ce4e49a142fd5b1ecac98145960d7afd567) )
ROM_LOAD16_BYTE_x2( "epr-14444.ic7", 0x100001, 0x040000, CRC(07724354) SHA1(9d7f64a80553c4ae0e9cf716478fd5c4b8277470) )
- ROM_REGION( 0x500000, "soundcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x500000, "slavepcb:soundcpu", 0 ) /* sound CPU */
ROM_LOAD_x8( "epr-14449.ic35", 0x100000, 0x020000, CRC(2d29699c) SHA1(cae02e5533a0edd3b3b4a54a1a43321285e06416) )
ROM_LOAD_x2( "epr-14448.ic31", 0x200000, 0x080000, CRC(87ca1e8d) SHA1(739274171c13983a60d061176095645419dade49) )
ROM_LOAD_x2( "epr-14447.ic26", 0x300000, 0x080000, CRC(db1cfcbd) SHA1(c76eb2ced5571a548ad00709097dd272747127a2) )
ROM_LOAD_x2( "epr-14446.ic22", 0x400000, 0x080000, CRC(646ec2cb) SHA1(67e453f128ae227e22c68f55d0d3f5831fbeb2f9) )
- ROM_REGION( 0x100000, "gfx1", 0 ) /* tiles */
+ 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_REGION32_BE( 0x800000, "gfx2", 0 ) /* sprites */
+ ROM_REGION32_BE( 0x800000, "slavepcb:gfx2", 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) )
@@ -3055,24 +3406,51 @@ ROM_END
A/D BD NO. 837-7536
*/
ROM_START( f1enj ) // ROM PCB number is 834-8439-04
- ROM_REGION( 0x200000, "maincpu", 0 ) /* v60 code + data */
+ ROM_REGION( 0x200000, "mainpcb:maincpu", 0 ) /* v60 code + data */
ROM_LOAD_x8( "epr-14450a.ic6", 0x000000, 0x020000, CRC(10f62723) SHA1(68fcd6655798f348678e3cc8857c6d1cb46e0987) )
ROM_LOAD16_BYTE_x2( "epr-14445.ic14", 0x100000, 0x040000, CRC(d06261ab) SHA1(6e1c4ce4e49a142fd5b1ecac98145960d7afd567) )
ROM_LOAD16_BYTE_x2( "epr-14444.ic7", 0x100001, 0x040000, CRC(07724354) SHA1(9d7f64a80553c4ae0e9cf716478fd5c4b8277470) )
- ROM_REGION( 0x500000, "soundcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x500000, "mainpcb:soundcpu", 0 ) /* sound CPU */
ROM_LOAD_x8( "epr-14449.ic35", 0x100000, 0x020000, CRC(2d29699c) SHA1(cae02e5533a0edd3b3b4a54a1a43321285e06416) )
ROM_LOAD_x2( "epr-14448.ic31", 0x200000, 0x080000, CRC(87ca1e8d) SHA1(739274171c13983a60d061176095645419dade49) )
ROM_LOAD_x2( "epr-14447.ic26", 0x300000, 0x080000, CRC(db1cfcbd) SHA1(c76eb2ced5571a548ad00709097dd272747127a2) )
ROM_LOAD_x2( "epr-14446.ic22", 0x400000, 0x080000, CRC(646ec2cb) SHA1(67e453f128ae227e22c68f55d0d3f5831fbeb2f9) )
- ROM_REGION( 0x100000, "gfx1", 0 ) /* tiles */
+ 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_REGION32_BE( 0x800000, "gfx2", 0 ) /* sprites */
+ ROM_REGION32_BE( 0x800000, "mainpcb:gfx2", 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) )
+
+ ROM_REGION( 0x200000, "slavepcb:maincpu", 0 ) /* v60 code + data */
+ ROM_LOAD_x8( "epr-14450a.ic6", 0x000000, 0x020000, CRC(10f62723) SHA1(68fcd6655798f348678e3cc8857c6d1cb46e0987) )
+ ROM_LOAD16_BYTE_x2( "epr-14445.ic14", 0x100000, 0x040000, CRC(d06261ab) SHA1(6e1c4ce4e49a142fd5b1ecac98145960d7afd567) )
+ ROM_LOAD16_BYTE_x2( "epr-14444.ic7", 0x100001, 0x040000, CRC(07724354) SHA1(9d7f64a80553c4ae0e9cf716478fd5c4b8277470) )
+
+ ROM_REGION( 0x500000, "slavepcb:soundcpu", 0 ) /* sound CPU */
+ ROM_LOAD_x8( "epr-14449.ic35", 0x100000, 0x020000, CRC(2d29699c) SHA1(cae02e5533a0edd3b3b4a54a1a43321285e06416) )
+ ROM_LOAD_x2( "epr-14448.ic31", 0x200000, 0x080000, CRC(87ca1e8d) SHA1(739274171c13983a60d061176095645419dade49) )
+ ROM_LOAD_x2( "epr-14447.ic26", 0x300000, 0x080000, CRC(db1cfcbd) SHA1(c76eb2ced5571a548ad00709097dd272747127a2) )
+ ROM_LOAD_x2( "epr-14446.ic22", 0x400000, 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_REGION32_BE( 0x800000, "slavepcb:gfx2", 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) )
@@ -3091,23 +3469,23 @@ ROM_END
protected via FD1149 317-0210
*/
ROM_START( f1lap )
- ROM_REGION( 0x200000, "maincpu", 0 ) /* v60 code + data */
+ ROM_REGION( 0x200000, "mainpcb:maincpu", 0 ) /* v60 code + data */
ROM_LOAD_x4( "epr-15598.ic17", 0x000000, 0x020000, CRC(9feab7cd) SHA1(2a14c0df39e7bdae12a34679fabc6abb7618e27d) )
ROM_LOAD_x4( "epr-15611.ic8", 0x080000, 0x020000, CRC(0d8c97c2) SHA1(863c606c58faddc2bdaeb69f9079266155ff9a96) )
ROM_LOAD16_BYTE_x2( "epr-15596.ic18", 0x100000, 0x040000, CRC(20e92909) SHA1(b974c79e11bfbd1cee61f9041cf79971fd96db3a) )
ROM_LOAD16_BYTE_x2( "epr-15597.ic9", 0x100001, 0x040000, CRC(cd1ccddb) SHA1(ff0371a8010141d1ab81b5eba555ae7c64e5da37) )
- ROM_REGION( 0x500000, "soundcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x500000, "mainpcb:soundcpu", 0 ) /* sound CPU */
ROM_LOAD_x8( "epr-15592.ic36", 0x100000, 0x020000, CRC(7c055cc8) SHA1(169beb83dfae86dd408aa92b3c214b8f607825fc) )
ROM_LOAD( "mpr-15593.ic35", 0x200000, 0x100000, CRC(e7300441) SHA1(33c264f0e6326689ba75026932c0932868e83b25) )
ROM_LOAD( "mpr-15594.ic34", 0x300000, 0x100000, CRC(7f4ca3bb) SHA1(dc53a1857d619e574acb4c0587a6ba844df2d283) )
ROM_LOAD( "mpr-15595.ic24", 0x400000, 0x100000, CRC(3fbdad9a) SHA1(573ea2242f79c7d3b6bf0e6745f6b07a621834ac) )
- ROM_REGION( 0x400000, "gfx1", 0 ) /* tiles */
+ ROM_REGION( 0x400000, "mainpcb:gfx1", 0 ) /* tiles */
ROM_LOAD16_BYTE( "mpr-15608.ic14", 0x000000, 0x200000, CRC(64462c69) SHA1(9501e83c52e3e16f73b94cef975b5a31b2ee5476) )
ROM_LOAD16_BYTE( "mpr-15609.ic5", 0x000001, 0x200000, CRC(d586e455) SHA1(aea190d31c590216eb19766ba749b1e9b710bdce) )
- ROM_REGION32_BE( 0x1000000, "gfx2", 0 ) /* sprites */
+ ROM_REGION32_BE( 0x1000000, "mainpcb:gfx2", 0 ) /* sprites */
ROMX_LOAD( "mpr-15600.ic32", 0x000000, 0x200000, CRC(d2698d23) SHA1(996fbcc1d0814e6f14fa7e4870ece077ecda54e6) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-15602.ic30", 0x000002, 0x200000, CRC(1674764d) SHA1(bc39757a5d25df1a088f874ca2442854eb551e48) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-15604.ic28", 0x000004, 0x200000, CRC(1552bbb9) SHA1(77edd3f9d8dec87fa0445d264309e6164eba9313) , ROM_SKIP(6)|ROM_GROUPWORD )
@@ -3126,23 +3504,23 @@ ROM_END
protected via FD1149 317-0210
*/
ROM_START( f1lapj )
- ROM_REGION( 0x200000, "maincpu", 0 ) /* v60 code + data */
+ ROM_REGION( 0x200000, "mainpcb:maincpu", 0 ) /* v60 code + data */
ROM_LOAD_x4( "epr-15598.ic17", 0x000000, 0x020000, CRC(9feab7cd) SHA1(2a14c0df39e7bdae12a34679fabc6abb7618e27d) )
ROM_LOAD_x4( "epr-15599.ic8", 0x080000, 0x020000, CRC(5c5ac112) SHA1(2c071946e33f0700a832c7aad36f639acd35f555) )
ROM_LOAD16_BYTE_x2( "epr-15596.ic18", 0x100000, 0x040000, CRC(20e92909) SHA1(b974c79e11bfbd1cee61f9041cf79971fd96db3a) )
ROM_LOAD16_BYTE_x2( "epr-15597.ic9", 0x100001, 0x040000, CRC(cd1ccddb) SHA1(ff0371a8010141d1ab81b5eba555ae7c64e5da37) )
- ROM_REGION( 0x500000, "soundcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x500000, "mainpcb:soundcpu", 0 ) /* sound CPU */
ROM_LOAD_x8( "epr-15592.ic36", 0x100000, 0x020000, CRC(7c055cc8) SHA1(169beb83dfae86dd408aa92b3c214b8f607825fc) )
ROM_LOAD( "mpr-15593.ic35", 0x200000, 0x100000, CRC(e7300441) SHA1(33c264f0e6326689ba75026932c0932868e83b25) )
ROM_LOAD( "mpr-15594.ic34", 0x300000, 0x100000, CRC(7f4ca3bb) SHA1(dc53a1857d619e574acb4c0587a6ba844df2d283) )
ROM_LOAD( "mpr-15595.ic24", 0x400000, 0x100000, CRC(3fbdad9a) SHA1(573ea2242f79c7d3b6bf0e6745f6b07a621834ac) )
- ROM_REGION( 0x400000, "gfx1", 0 ) /* tiles */
+ ROM_REGION( 0x400000, "mainpcb:gfx1", 0 ) /* tiles */
ROM_LOAD16_BYTE( "mpr-15608.ic14", 0x000000, 0x200000, CRC(64462c69) SHA1(9501e83c52e3e16f73b94cef975b5a31b2ee5476) )
ROM_LOAD16_BYTE( "mpr-15609.ic5", 0x000001, 0x200000, CRC(d586e455) SHA1(aea190d31c590216eb19766ba749b1e9b710bdce) )
- ROM_REGION32_BE( 0x1000000, "gfx2", 0 ) /* sprites */
+ ROM_REGION32_BE( 0x1000000, "mainpcb:gfx2", 0 ) /* sprites */
ROMX_LOAD( "mpr-15600.ic32", 0x000000, 0x200000, CRC(d2698d23) SHA1(996fbcc1d0814e6f14fa7e4870ece077ecda54e6) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-15602.ic30", 0x000002, 0x200000, CRC(1674764d) SHA1(bc39757a5d25df1a088f874ca2442854eb551e48) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-15604.ic28", 0x000004, 0x200000, CRC(1552bbb9) SHA1(77edd3f9d8dec87fa0445d264309e6164eba9313) , ROM_SKIP(6)|ROM_GROUPWORD )
@@ -3164,26 +3542,26 @@ ROM_END
protected via a custom V25 with encrypted code
*/
ROM_START( ga2 )
- ROM_REGION( 0x200000, "maincpu", 0 ) /* v60 code + data */
+ ROM_REGION( 0x200000, "mainpcb:maincpu", 0 ) /* v60 code + data */
ROM_LOAD_x4( "epr-14961b.ic17", 0x000000, 0x020000, CRC(d9cd8885) SHA1(dc9d1f01770bd23ba5959e300badbc5093a149bc) )
ROM_LOAD_x4( "epr-14958b.ic8", 0x080000, 0x020000, CRC(0be324a3) SHA1(5e5f457548906453eaa8d326c353b47353eab73d) )
ROM_LOAD16_BYTE_x2( "epr-15148b.ic18", 0x100000, 0x040000, CRC(c477a9fd) SHA1(a9d60f801c12fd067e5ad1801a92c84edd13bd08) )
ROM_LOAD16_BYTE_x2( "epr-15147b.ic9", 0x100001, 0x040000, CRC(1bb676ea) SHA1(125ffd13204f48be23e20b281c42c2307888c40b) )
- ROM_REGION( 0x500000, "soundcpu", 0 ) /* sound CPU + banks */
+ ROM_REGION( 0x500000, "mainpcb:soundcpu", 0 ) /* sound CPU + banks */
ROM_LOAD_x16( "epr-14945.ic36", 0x100000, 0x010000, CRC(4781d4cb) SHA1(bd1b774b3cd0c3e0290c55e426f66d6820d21d0f) )
ROM_LOAD( "mpr-14944.ic35", 0x200000, 0x100000, CRC(fd4d4b86) SHA1(e14b9cd6004bf9ecd902e37b433b828241361b46) )
ROM_LOAD( "mpr-14943.ic34", 0x300000, 0x100000, CRC(24d40333) SHA1(38faf8f3eac317a163e93bd2247fe98189b13d2d) )
ROM_LOAD( "mpr-14942.ic24", 0x400000, 0x100000, CRC(a89b0e90) SHA1(e14c62418eb7f9a2deb2a6dcf635bedc1c73c253) )
- ROM_REGION( 0x100000, "mcu", 0 ) /* Protection CPU */
+ ROM_REGION( 0x100000, "mainpcb:mcu", 0 ) /* Protection CPU */
ROM_LOAD( "epr-14468-02.u3", 0x00000, 0x10000, CRC(77634daa) SHA1(339169d164b9ed7dc3787b084d33effdc8e9efc1) ) /* located on separate sub board */
- ROM_REGION( 0x400000, "gfx1", 0 ) /* tiles */
+ ROM_REGION( 0x400000, "mainpcb:gfx1", 0 ) /* tiles */
ROM_LOAD16_BYTE( "mpr-14948.ic14", 0x000000, 0x200000, CRC(75050d4a) SHA1(51d6bc9935abcf30af438e69c2cf4e09f57a803f) )
ROM_LOAD16_BYTE( "mpr-14947.ic5", 0x000001, 0x200000, CRC(b53e62f4) SHA1(5aa0f198e6eb070b77b0d180d30c0228a9bc691e) )
- ROM_REGION32_BE( 0x1000000, "gfx2", 0 ) /* sprites */
+ ROM_REGION32_BE( 0x1000000, "mainpcb:gfx2", 0 ) /* sprites */
ROMX_LOAD( "mpr-14949.ic32", 0x000000, 0x200000, CRC(152c716c) SHA1(448d16ea036b66e886119c00af543dfa5e53fd84) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-14951.ic30", 0x000002, 0x200000, CRC(fdb1a534) SHA1(3126b595bf69bf9952fedf8f9c6743eb10489dc6) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-14953.ic28", 0x000004, 0x200000, CRC(33bd1c15) SHA1(4e16562e3357d4db54b20543073e8f1fd6f74b1f) , ROM_SKIP(6)|ROM_GROUPWORD )
@@ -3204,26 +3582,26 @@ Sub board: 834-8529-02
*/
ROM_START( ga2u )
- ROM_REGION( 0x200000, "maincpu", 0 ) /* v60 code + data */
+ ROM_REGION( 0x200000, "mainpcb:maincpu", 0 ) /* v60 code + data */
ROM_LOAD_x4( "epr-14960a.ic17", 0x000000, 0x020000, CRC(87182fea) SHA1(bb669ea7091f1ea34589a565490effa934ca44a3) )
ROM_LOAD_x4( "epr-14957a.ic8", 0x080000, 0x020000, CRC(ab787cf4) SHA1(7e19bb3e5d587b5009efc9f9fa52aecaef0eedc4) )
ROM_LOAD16_BYTE_x2( "epr-15146a.ic18", 0x100000, 0x040000, CRC(7293d5c3) SHA1(535a8b4b4a05546b321cee8de6733edfc1f71589) )
ROM_LOAD16_BYTE_x2( "epr-15145a.ic9", 0x100001, 0x040000, CRC(0da61782) SHA1(f0302d747e5d55663095bb38732af423104c33ea) )
- ROM_REGION( 0x500000, "soundcpu", 0 ) /* sound CPU + banks */
+ ROM_REGION( 0x500000, "mainpcb:soundcpu", 0 ) /* sound CPU + banks */
ROM_LOAD_x16( "epr-14945.ic36", 0x100000, 0x010000, CRC(4781d4cb) SHA1(bd1b774b3cd0c3e0290c55e426f66d6820d21d0f) )
ROM_LOAD( "mpr-14944.ic35", 0x200000, 0x100000, CRC(fd4d4b86) SHA1(e14b9cd6004bf9ecd902e37b433b828241361b46) )
ROM_LOAD( "mpr-14943.ic34", 0x300000, 0x100000, CRC(24d40333) SHA1(38faf8f3eac317a163e93bd2247fe98189b13d2d) )
ROM_LOAD( "mpr-14942.ic24", 0x400000, 0x100000, CRC(a89b0e90) SHA1(e14c62418eb7f9a2deb2a6dcf635bedc1c73c253) )
- ROM_REGION( 0x100000, "mcu", 0 ) /* Protection CPU */
+ ROM_REGION( 0x100000, "mainpcb:mcu", 0 ) /* Protection CPU */
ROM_LOAD( "epr-14468-02.u3", 0x00000, 0x10000, CRC(77634daa) SHA1(339169d164b9ed7dc3787b084d33effdc8e9efc1) ) /* located on separate sub board */
- ROM_REGION( 0x400000, "gfx1", 0 ) /* tiles */
+ ROM_REGION( 0x400000, "mainpcb:gfx1", 0 ) /* tiles */
ROM_LOAD16_BYTE( "mpr-14948.ic14", 0x000000, 0x200000, CRC(75050d4a) SHA1(51d6bc9935abcf30af438e69c2cf4e09f57a803f) )
ROM_LOAD16_BYTE( "mpr-14947.ic5", 0x000001, 0x200000, CRC(b53e62f4) SHA1(5aa0f198e6eb070b77b0d180d30c0228a9bc691e) )
- ROM_REGION32_BE( 0x1000000, "gfx2", 0 ) /* sprites */
+ ROM_REGION32_BE( 0x1000000, "mainpcb:gfx2", 0 ) /* sprites */
ROMX_LOAD( "mpr-14949.ic32", 0x000000, 0x200000, CRC(152c716c) SHA1(448d16ea036b66e886119c00af543dfa5e53fd84) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-14951.ic30", 0x000002, 0x200000, CRC(fdb1a534) SHA1(3126b595bf69bf9952fedf8f9c6743eb10489dc6) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-14953.ic28", 0x000004, 0x200000, CRC(33bd1c15) SHA1(4e16562e3357d4db54b20543073e8f1fd6f74b1f) , ROM_SKIP(6)|ROM_GROUPWORD )
@@ -3239,26 +3617,26 @@ ROM_END
protected via a custom V25 with encrypted code
*/
ROM_START( ga2j )
- ROM_REGION( 0x200000, "maincpu", 0 ) /* v60 code + data */
+ ROM_REGION( 0x200000, "mainpcb:maincpu", 0 ) /* v60 code + data */
ROM_LOAD_x4( "epr-14956.ic17", 0x000000, 0x020000, CRC(f1929177) SHA1(7dc39c40eff9fb46c2e51d1e83478cd6970e3951) )
ROM_LOAD_x4( "epr-14946.ic8", 0x080000, 0x020000, CRC(eacafe94) SHA1(d41a7e1ee2df9e053b559be0a1a6d2ae520fd3e4) )
ROM_LOAD16_BYTE_x2( "epr-14941.ic18", 0x100000, 0x040000, CRC(0ffb8203) SHA1(b27dce634d203af8abb6ddfb656d4c48eb54af01) )
ROM_LOAD16_BYTE_x2( "epr-14940.ic9", 0x100001, 0x040000, CRC(3b5b3084) SHA1(ea17f6b7fd413fe3808f822cec84c993c9b75aa2) )
- ROM_REGION( 0x500000, "soundcpu", 0 ) /* sound CPU + banks */
+ ROM_REGION( 0x500000, "mainpcb:soundcpu", 0 ) /* sound CPU + banks */
ROM_LOAD_x16( "epr-14945.ic36", 0x100000, 0x010000, CRC(4781d4cb) SHA1(bd1b774b3cd0c3e0290c55e426f66d6820d21d0f) )
ROM_LOAD( "mpr-14944.ic35", 0x200000, 0x100000, CRC(fd4d4b86) SHA1(e14b9cd6004bf9ecd902e37b433b828241361b46) )
ROM_LOAD( "mpr-14943.ic34", 0x300000, 0x100000, CRC(24d40333) SHA1(38faf8f3eac317a163e93bd2247fe98189b13d2d) )
ROM_LOAD( "mpr-14942.ic24", 0x400000, 0x100000, CRC(a89b0e90) SHA1(e14c62418eb7f9a2deb2a6dcf635bedc1c73c253) )
- ROM_REGION( 0x100000, "mcu", 0 ) /* Protection CPU */
+ ROM_REGION( 0x100000, "mainpcb:mcu", 0 ) /* Protection CPU */
ROM_LOAD( "epr-14468-02.u3", 0x00000, 0x10000, CRC(77634daa) SHA1(339169d164b9ed7dc3787b084d33effdc8e9efc1) ) /* located on separate sub board */
- ROM_REGION( 0x400000, "gfx1", 0 ) /* tiles */
+ ROM_REGION( 0x400000, "mainpcb:gfx1", 0 ) /* tiles */
ROM_LOAD16_BYTE( "mpr-14948.ic14", 0x000000, 0x200000, CRC(75050d4a) SHA1(51d6bc9935abcf30af438e69c2cf4e09f57a803f) )
ROM_LOAD16_BYTE( "mpr-14947.ic5", 0x000001, 0x200000, CRC(b53e62f4) SHA1(5aa0f198e6eb070b77b0d180d30c0228a9bc691e) )
- ROM_REGION32_BE( 0x1000000, "gfx2", 0 ) /* sprites */
+ ROM_REGION32_BE( 0x1000000, "mainpcb:gfx2", 0 ) /* sprites */
ROMX_LOAD( "mpr-14949.ic32", 0x000000, 0x200000, CRC(152c716c) SHA1(448d16ea036b66e886119c00af543dfa5e53fd84) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-14951.ic30", 0x000002, 0x200000, CRC(fdb1a534) SHA1(3126b595bf69bf9952fedf8f9c6743eb10489dc6) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-14953.ic28", 0x000004, 0x200000, CRC(33bd1c15) SHA1(4e16562e3357d4db54b20543073e8f1fd6f74b1f) , ROM_SKIP(6)|ROM_GROUPWORD )
@@ -3277,19 +3655,19 @@ ROM_END
not protected
*/
ROM_START( harddunk )
- ROM_REGION( 0x200000, "maincpu", 0 ) /* v60 code */
+ ROM_REGION( 0x200000, "mainpcb:maincpu", 0 ) /* v60 code */
ROM_LOAD32_WORD_x2( "epr-16512.ic37", 0x000000, 0x40000, CRC(1a7de085) SHA1(2e0dac1f7715089b7f6b1035c859ffe2d674932f) )
/* the following is the same as 16509.ic40 but with a different name, unusual for Sega */
ROM_LOAD32_WORD_x2( "epr-16513.ic40", 0x000002, 0x40000, CRC(603dee75) SHA1(32ae964a4b57d470b4900cca6e06329f1a75a6e6) )
- ROM_REGION( 0x180000, "soundcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x180000, "mainpcb:soundcpu", 0 ) /* sound CPU */
ROM_LOAD_x4( "epr-16505.ic31", 0x100000, 0x20000, CRC(eeb90a07) SHA1(d1c2132897994b2e85fd5a97222b9fcd61bc421e) )
- ROM_REGION( 0x100000, "gfx1", 0 ) /* tiles */
+ ROM_REGION( 0x100000, "mainpcb:gfx1", 0 ) /* tiles */
ROM_LOAD16_BYTE( "mpr-16503.ic3", 0x000000, 0x080000, CRC(ac1b6f1a) SHA1(56482931adf7fe551acf796b74cd8af3773d4fef) )
ROM_LOAD16_BYTE( "mpr-16504.ic11", 0x000001, 0x080000, CRC(7c61fcd8) SHA1(ca4354f90fada752bf11ee22a7798a8aa22b1c61) )
- ROM_REGION32_BE( 0x1000000, "gfx2", 0 ) /* sprites */
+ ROM_REGION32_BE( 0x1000000, "mainpcb:gfx2", 0 ) /* sprites */
ROMX_LOAD( "mpr-16495.ic14", 0x000000, 0x200000, CRC(6e5f26be) SHA1(146761072bbed08f4a9df8a474b34fab61afaa4f) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-16497.ic15", 0x000002, 0x200000, CRC(42ab5859) SHA1(f50c51eb81186aec5f747ecab4c5c928f8701afc) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-16499.ic10", 0x000004, 0x200000, CRC(a290ea36) SHA1(2503b44174f23a9d323caab86553977d1d6d9c94) , ROM_SKIP(6)|ROM_GROUPWORD )
@@ -3299,7 +3677,7 @@ ROM_START( harddunk )
ROMX_LOAD( "mpr-16500.ic18", 0x800004, 0x200000, CRC(452c0be3) SHA1(af87ce4618bae2d791c1baed34ba7f853af664ff) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-16502.ic41", 0x800006, 0x200000, CRC(ffc3147e) SHA1(12d882dec3098674d27058a8009e8778555f477a) , ROM_SKIP(6)|ROM_GROUPWORD )
- ROM_REGION( 0x400000, "sega", 0 ) /* Sega PCM sound data */
+ ROM_REGION( 0x400000, "mainpcb:sega", 0 ) /* Sega PCM sound data */
ROM_LOAD( "mpr-16506.1", 0x000000, 0x200000, CRC(e779f5ed) SHA1(462d1bbe8bb12a0c5a6d6c613c720b26ec21cb25) )
ROM_LOAD( "mpr-16507.2", 0x200000, 0x200000, CRC(31e068d3) SHA1(9ac88b15af441fb3b31ce759c565b60a09039571) )
ROM_END
@@ -3309,18 +3687,18 @@ ROM_END
not protected
*/
ROM_START( harddunkj )
- ROM_REGION( 0x200000, "maincpu", 0 ) /* v60 code */
+ ROM_REGION( 0x200000, "mainpcb:maincpu", 0 ) /* v60 code */
ROM_LOAD32_WORD_x2( "epr-16508.ic37", 0x000000, 0x40000, CRC(b3713be5) SHA1(8123638a838e41fcc0d32e14382421b521eff94f) )
ROM_LOAD32_WORD_x2( "epr-16509.ic40", 0x000002, 0x40000, CRC(603dee75) SHA1(32ae964a4b57d470b4900cca6e06329f1a75a6e6) )
- ROM_REGION( 0x180000, "soundcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x180000, "mainpcb:soundcpu", 0 ) /* sound CPU */
ROM_LOAD_x4( "epr-16505.ic31", 0x100000, 0x20000, CRC(eeb90a07) SHA1(d1c2132897994b2e85fd5a97222b9fcd61bc421e) )
- ROM_REGION( 0x100000, "gfx1", 0 ) /* tiles */
+ ROM_REGION( 0x100000, "mainpcb:gfx1", 0 ) /* tiles */
ROM_LOAD16_BYTE( "mpr-16503.ic3", 0x000000, 0x080000, CRC(ac1b6f1a) SHA1(56482931adf7fe551acf796b74cd8af3773d4fef) )
ROM_LOAD16_BYTE( "mpr-16504.ic11", 0x000001, 0x080000, CRC(7c61fcd8) SHA1(ca4354f90fada752bf11ee22a7798a8aa22b1c61) )
- ROM_REGION32_BE( 0x1000000, "gfx2", 0 ) /* sprites */
+ ROM_REGION32_BE( 0x1000000, "mainpcb:gfx2", 0 ) /* sprites */
ROMX_LOAD( "mpr-16495.ic14", 0x000000, 0x200000, CRC(6e5f26be) SHA1(146761072bbed08f4a9df8a474b34fab61afaa4f) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-16497.ic15", 0x000002, 0x200000, CRC(42ab5859) SHA1(f50c51eb81186aec5f747ecab4c5c928f8701afc) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-16499.ic10", 0x000004, 0x200000, CRC(a290ea36) SHA1(2503b44174f23a9d323caab86553977d1d6d9c94) , ROM_SKIP(6)|ROM_GROUPWORD )
@@ -3330,7 +3708,7 @@ ROM_START( harddunkj )
ROMX_LOAD( "mpr-16500.ic18", 0x800004, 0x200000, CRC(452c0be3) SHA1(af87ce4618bae2d791c1baed34ba7f853af664ff) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-16502.ic41", 0x800006, 0x200000, CRC(ffc3147e) SHA1(12d882dec3098674d27058a8009e8778555f477a) , ROM_SKIP(6)|ROM_GROUPWORD )
- ROM_REGION( 0x400000, "sega", 0 ) /* Sega PCM sound data */
+ ROM_REGION( 0x400000, "mainpcb:sega", 0 ) /* Sega PCM sound data */
ROM_LOAD( "mpr-16506.ic1", 0x000000, 0x200000, CRC(e779f5ed) SHA1(462d1bbe8bb12a0c5a6d6c613c720b26ec21cb25) )
ROM_LOAD( "mpr-16507.ic2", 0x200000, 0x200000, CRC(31e068d3) SHA1(9ac88b15af441fb3b31ce759c565b60a09039571) )
ROM_END
@@ -3346,22 +3724,22 @@ Rom board: 834-8888-01
*/
ROM_START( holo )
- ROM_REGION( 0x200000, "maincpu", 0 ) /* v60 code + data */
+ ROM_REGION( 0x200000, "mainpcb:maincpu", 0 ) /* v60 code + data */
ROM_LOAD_x4( "epr-14977a", 0x000000, 0x020000, CRC(e0d7e288) SHA1(3126041ba73f21fac0207bf5c63230c61180f564) )
ROM_LOAD_x4( "epr-14976a", 0x080000, 0x020000, CRC(e56f13be) SHA1(3d9e7add8feaa35c4c2e8bda84ae251087bd5e40) )
ROM_LOAD16_BYTE_x4( "epr-15011", 0x100000, 0x020000, CRC(b9f59f59) SHA1(f8c91fa877cf53153bec3d7850eab38227cc18ba) )
ROM_LOAD16_BYTE_x4( "epr-15010", 0x100001, 0x020000, CRC(0c09c57b) SHA1(028a9fe1c625be218ba90906308d25d69d4de4c4) )
- ROM_REGION( 0x500000, "soundcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x500000, "mainpcb:soundcpu", 0 ) /* sound CPU */
ROM_LOAD_x8( "epr-14965", 0x100000, 0x020000, CRC(3a918cfe) SHA1(f43ecbc9e774873e868bc921321541b308ea1a3c) )
ROM_LOAD( "mpr-14964", 0x200000, 0x100000, CRC(7ff581d5) SHA1(ab81bd70937319e4edc8924bdb493d5ef1ec096a) )
ROM_LOAD( "mpr-14963", 0x300000, 0x100000, CRC(0974a60e) SHA1(87d770edcee9c9e8f37d36ab28c5aa5d685ea849) )
ROM_LOAD( "mpr-14962", 0x400000, 0x100000, CRC(6b2e694e) SHA1(7874bdfd534231c7756e0e0d9fc7a3d5bdba74d3) )
- ROM_REGION( 0x000100, "gfx1", ROMREGION_ERASEFF ) /* tiles */
+ ROM_REGION( 0x000100, "mainpcb:gfx1", ROMREGION_ERASEFF ) /* tiles */
/* game doesn't use bg tilemaps */
- ROM_REGION32_BE( 0x800000, "gfx2", 0 ) /* sprites */
+ ROM_REGION32_BE( 0x800000, "mainpcb:gfx2", 0 ) /* sprites */
ROMX_LOAD( "mpr-14973", 0x000000, 0x100000, CRC(b3c3ff6b) SHA1(94e8dbfae37a5b122ee3d471aad1f758e4a39b9e) , ROM_SKIP(7) )
ROMX_LOAD( "mpr-14972", 0x000001, 0x100000, CRC(0c161374) SHA1(413ab45deb687ecdbdc06ae98aa32ad8a0d80e0c) , ROM_SKIP(7) )
ROMX_LOAD( "mpr-14971", 0x000002, 0x100000, CRC(dfcf6fdf) SHA1(417291b54010be20dd6738a70d372b580615a8bb) , ROM_SKIP(7) )
@@ -3383,22 +3761,22 @@ ROM_END
A/D BD NO: 837-7536-91
*/
ROM_START( jpark )
- ROM_REGION( 0x200000, "maincpu", 0 ) /* v60 code + data */
+ ROM_REGION( 0x200000, "mainpcb:maincpu", 0 ) /* v60 code + data */
ROM_LOAD_x2( "epr-16402a.ic8", 0x000000, 0x80000, CRC(c70db239) SHA1(fd79dfd1ce194fcc8ccb58117bc845cdfe9943b1) )
ROM_LOAD16_BYTE( "epr-16395.ic18", 0x100000, 0x80000, CRC(ac5a01d6) SHA1(df6bffdf5723cb8790a9c1c0ab271989a758bdd8) )
ROM_LOAD16_BYTE( "epr-16394.ic9", 0x100001, 0x80000, CRC(c08c3a8a) SHA1(923cf256d863656336401fa75103b42298cb3822) )
- ROM_REGION( 0x500000, "soundcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x500000, "mainpcb:soundcpu", 0 ) /* sound CPU */
ROM_LOAD_x4( "epr-16399.ic36", 0x100000, 0x040000, CRC(b09b2fe3) SHA1(bf8d646bab65fcc4ece8c2bd9a3df389e5860ed6) )
ROM_LOAD( "mpr-16398.ic35", 0x200000, 0x100000, CRC(fa710ca6) SHA1(1fd625070eef5f99d7be07606aeeff9282e32532) )
ROM_LOAD( "mpr-16397.ic34", 0x300000, 0x100000, CRC(6e96e0be) SHA1(422b783b72127b80a23043b2dd1c04f5772f436e) )
ROM_LOAD( "mpr-16396.ic24", 0x400000, 0x100000, CRC(f69a2dc4) SHA1(3f02b10976852916c58e852f3161a857784fe36b) )
- ROM_REGION( 0x400000, "gfx1", 0 ) /* tiles */
+ ROM_REGION( 0x400000, "mainpcb:gfx1", 0 ) /* tiles */
ROM_LOAD16_BYTE( "mpr-16404.ic14", 0x000000, 0x200000, CRC(11283807) SHA1(99e465c3fc31e640740b8257a349e203f026754a) )
ROM_LOAD16_BYTE( "mpr-16403.ic5", 0x000001, 0x200000, CRC(02530a9b) SHA1(b43e1b47f74c801bfc599cbe893fb8dc13453dd0) )
- ROM_REGION32_BE( 0x1000000, "gfx2", 0 ) /* sprites */
+ ROM_REGION32_BE( 0x1000000, "mainpcb:gfx2", 0 ) /* sprites */
ROMX_LOAD( "mpr-16405.ic32", 0x000000, 0x200000, CRC(b425f182) SHA1(66c6bd29dd3450db816b895c4c9c5208a66aae67) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-16407.ic30", 0x000002, 0x200000, CRC(bc49ffd9) SHA1(a50ba7ddccfdfd7638c4041978b39c1559afbbb4) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-16409.ic28", 0x000004, 0x200000, CRC(fe73660d) SHA1(ec1a3ea5303d2ccb9e327da18476969953626e1c) , ROM_SKIP(6)|ROM_GROUPWORD )
@@ -3419,22 +3797,22 @@ ROM_END
ROM BD: 834-10545-03
*/
ROM_START( jparkj )
- ROM_REGION( 0x200000, "maincpu", 0 ) /* v60 code + data */
+ ROM_REGION( 0x200000, "mainpcb:maincpu", 0 ) /* v60 code + data */
ROM_LOAD_x2( "epr-16400a.ic8", 0x000000, 0x80000, CRC(1e03dbfe) SHA1(b7c274769ff483e687749ff20b1dc0fc38e8ef82) )
ROM_LOAD16_BYTE( "epr-16395.ic18", 0x100000, 0x80000, CRC(ac5a01d6) SHA1(df6bffdf5723cb8790a9c1c0ab271989a758bdd8) )
ROM_LOAD16_BYTE( "epr-16394.ic9", 0x100001, 0x80000, CRC(c08c3a8a) SHA1(923cf256d863656336401fa75103b42298cb3822) )
- ROM_REGION( 0x500000, "soundcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x500000, "mainpcb:soundcpu", 0 ) /* sound CPU */
ROM_LOAD_x4( "epr-16399.ic36", 0x100000, 0x040000, CRC(b09b2fe3) SHA1(bf8d646bab65fcc4ece8c2bd9a3df389e5860ed6) )
ROM_LOAD( "mpr-16398.ic35", 0x200000, 0x100000, CRC(fa710ca6) SHA1(1fd625070eef5f99d7be07606aeeff9282e32532) )
ROM_LOAD( "mpr-16397.ic34", 0x300000, 0x100000, CRC(6e96e0be) SHA1(422b783b72127b80a23043b2dd1c04f5772f436e) )
ROM_LOAD( "mpr-16396.ic24", 0x400000, 0x100000, CRC(f69a2dc4) SHA1(3f02b10976852916c58e852f3161a857784fe36b) )
- ROM_REGION( 0x400000, "gfx1", 0 ) /* tiles */
+ ROM_REGION( 0x400000, "mainpcb:gfx1", 0 ) /* tiles */
ROM_LOAD16_BYTE( "mpr-16404.ic14", 0x000000, 0x200000, CRC(11283807) SHA1(99e465c3fc31e640740b8257a349e203f026754a) )
ROM_LOAD16_BYTE( "mpr-16403.ic5", 0x000001, 0x200000, CRC(02530a9b) SHA1(b43e1b47f74c801bfc599cbe893fb8dc13453dd0) )
- ROM_REGION32_BE( 0x1000000, "gfx2", 0 ) /* sprites */
+ ROM_REGION32_BE( 0x1000000, "mainpcb:gfx2", 0 ) /* sprites */
ROMX_LOAD( "mpr-16405.ic32", 0x000000, 0x200000, CRC(b425f182) SHA1(66c6bd29dd3450db816b895c4c9c5208a66aae67) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-16407.ic30", 0x000002, 0x200000, CRC(bc49ffd9) SHA1(a50ba7ddccfdfd7638c4041978b39c1559afbbb4) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-16409.ic28", 0x000004, 0x200000, CRC(fe73660d) SHA1(ec1a3ea5303d2ccb9e327da18476969953626e1c) , ROM_SKIP(6)|ROM_GROUPWORD )
@@ -3455,22 +3833,22 @@ ROM_END
ROM BD: 834-10545-03
*/
ROM_START( jparkja )
- ROM_REGION( 0x200000, "maincpu", 0 ) /* v60 code + data */
+ ROM_REGION( 0x200000, "mainpcb:maincpu", 0 ) /* v60 code + data */
ROM_LOAD_x2( "epr-16400.ic8", 0x000000, 0x80000, CRC(321c3411) SHA1(c53e7ed5f2e523741a521c9cd271123ab557cc4a) )
ROM_LOAD16_BYTE( "epr-16395.ic18", 0x100000, 0x80000, CRC(ac5a01d6) SHA1(df6bffdf5723cb8790a9c1c0ab271989a758bdd8) )
ROM_LOAD16_BYTE( "epr-16394.ic9", 0x100001, 0x80000, CRC(c08c3a8a) SHA1(923cf256d863656336401fa75103b42298cb3822) )
- ROM_REGION( 0x500000, "soundcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x500000, "mainpcb:soundcpu", 0 ) /* sound CPU */
ROM_LOAD_x4( "epr-16399.ic36", 0x100000, 0x040000, CRC(b09b2fe3) SHA1(bf8d646bab65fcc4ece8c2bd9a3df389e5860ed6) )
ROM_LOAD( "mpr-16398.ic35", 0x200000, 0x100000, CRC(fa710ca6) SHA1(1fd625070eef5f99d7be07606aeeff9282e32532) )
ROM_LOAD( "mpr-16397.ic34", 0x300000, 0x100000, CRC(6e96e0be) SHA1(422b783b72127b80a23043b2dd1c04f5772f436e) )
ROM_LOAD( "mpr-16396.ic24", 0x400000, 0x100000, CRC(f69a2dc4) SHA1(3f02b10976852916c58e852f3161a857784fe36b) )
- ROM_REGION( 0x400000, "gfx1", 0 ) /* tiles */
+ ROM_REGION( 0x400000, "mainpcb:gfx1", 0 ) /* tiles */
ROM_LOAD16_BYTE( "mpr-16404.ic14", 0x000000, 0x200000, CRC(11283807) SHA1(99e465c3fc31e640740b8257a349e203f026754a) )
ROM_LOAD16_BYTE( "mpr-16403.ic5", 0x000001, 0x200000, CRC(02530a9b) SHA1(b43e1b47f74c801bfc599cbe893fb8dc13453dd0) )
- ROM_REGION32_BE( 0x1000000, "gfx2", 0 ) /* sprites */
+ ROM_REGION32_BE( 0x1000000, "mainpcb:gfx2", 0 ) /* sprites */
ROMX_LOAD( "mpr-16405.ic32", 0x000000, 0x200000, CRC(b425f182) SHA1(66c6bd29dd3450db816b895c4c9c5208a66aae67) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-16407.ic30", 0x000002, 0x200000, CRC(bc49ffd9) SHA1(a50ba7ddccfdfd7638c4041978b39c1559afbbb4) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-16409.ic28", 0x000004, 0x200000, CRC(fe73660d) SHA1(ec1a3ea5303d2ccb9e327da18476969953626e1c) , ROM_SKIP(6)|ROM_GROUPWORD )
@@ -3491,22 +3869,22 @@ ROM_END
ROM BD: 834-10545-03
*/
ROM_START( jparkjc )
- ROM_REGION( 0x200000, "maincpu", 0 ) /* v60 code + data */
+ ROM_REGION( 0x200000, "mainpcb:maincpu", 0 ) /* v60 code + data */
ROM_LOAD_x2( "epr-16400a.ic8", 0x000000, 0x80000, CRC(1e03dbfe) SHA1(b7c274769ff483e687749ff20b1dc0fc38e8ef82) )
ROM_LOAD16_BYTE( "epr-16395.ic18", 0x100000, 0x80000, CRC(ac5a01d6) SHA1(df6bffdf5723cb8790a9c1c0ab271989a758bdd8) )
ROM_LOAD16_BYTE( "epr-16394.ic9", 0x100001, 0x80000, CRC(c08c3a8a) SHA1(923cf256d863656336401fa75103b42298cb3822) )
- ROM_REGION( 0x500000, "soundcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x500000, "mainpcb:soundcpu", 0 ) /* sound CPU */
ROM_LOAD_x4( "epr-16630.ic36", 0x100000, 0x040000, CRC(955855eb) SHA1(c7a325ba0009139c2cc263cd457dbc0d527c7582) )
ROM_LOAD( "mpr-16398.ic35", 0x200000, 0x100000, CRC(fa710ca6) SHA1(1fd625070eef5f99d7be07606aeeff9282e32532) )
ROM_LOAD( "mpr-16397.ic34", 0x300000, 0x100000, CRC(6e96e0be) SHA1(422b783b72127b80a23043b2dd1c04f5772f436e) )
ROM_LOAD( "mpr-16396.ic24", 0x400000, 0x100000, CRC(f69a2dc4) SHA1(3f02b10976852916c58e852f3161a857784fe36b) )
- ROM_REGION( 0x400000, "gfx1", 0 ) /* tiles */
+ ROM_REGION( 0x400000, "mainpcb:gfx1", 0 ) /* tiles */
ROM_LOAD16_BYTE( "mpr-16404.ic14", 0x000000, 0x200000, CRC(11283807) SHA1(99e465c3fc31e640740b8257a349e203f026754a) )
ROM_LOAD16_BYTE( "mpr-16403.ic5", 0x000001, 0x200000, CRC(02530a9b) SHA1(b43e1b47f74c801bfc599cbe893fb8dc13453dd0) )
- ROM_REGION32_BE( 0x1000000, "gfx2", 0 ) /* sprites */
+ ROM_REGION32_BE( 0x1000000, "mainpcb:gfx2", 0 ) /* sprites */
ROMX_LOAD( "mpr-16405.ic32", 0x000000, 0x200000, CRC(b425f182) SHA1(66c6bd29dd3450db816b895c4c9c5208a66aae67) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-16407.ic30", 0x000002, 0x200000, CRC(bc49ffd9) SHA1(a50ba7ddccfdfd7638c4041978b39c1559afbbb4) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-16409.ic28", 0x000004, 0x200000, CRC(fe73660d) SHA1(ec1a3ea5303d2ccb9e327da18476969953626e1c) , ROM_SKIP(6)|ROM_GROUPWORD )
@@ -3529,20 +3907,20 @@ ROM_END
SCSI CD board is 839-0572-01. It use a Fujitsu MB89352AP for SCSI + a Sony CXD1095Q for I/O + 8Mhz quartz
*/
ROM_START( kokoroj2 )
- ROM_REGION( 0x200000, "maincpu", 0 ) /* v60 code + data */
+ ROM_REGION( 0x200000, "mainpcb:maincpu", 0 ) /* v60 code + data */
ROM_LOAD_x8( "epr-16186.ic8", 0x000000, 0x20000, CRC(8c3afb6e) SHA1(68c3c066a943b1ea8e3bee06c7c8279b5a12e7f7) )
ROM_LOAD16_BYTE( "epr-16183.ic18", 0x100000, 0x80000, CRC(4844432f) SHA1(b127169d0f108e0b99ec81814a5c3c45bb82e0b1) )
ROM_LOAD16_BYTE( "epr-16182.ic9", 0x100001, 0x80000, CRC(a27f5f5f) SHA1(c2bbd1632bce0851cf8ab45d3ccbec1076e67f5e) )
- ROM_REGION( 0x500000, "soundcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x500000, "mainpcb:soundcpu", 0 ) /* sound CPU */
ROM_LOAD_x4( "epr-16185.ic36", 0x100000, 0x020000, CRC(afb97c4d) SHA1(f6e77d932824f93d89559a9cb3b2d678d5fc6940) )
ROM_LOAD( "mpr-16184.ic35", 0x200000, 0x080000, CRC(dbd44a85) SHA1(e7341d2ef27c580bff365b5c546da2adb72faee8) )
- ROM_REGION( 0x400000, "gfx1", 0 ) /* tiles */
+ ROM_REGION( 0x400000, "mainpcb:gfx1", 0 ) /* tiles */
ROM_LOAD16_BYTE( "mpr-16188.ic14", 0x000000, 0x200000, CRC(83a450ab) SHA1(1d0b45512d784ed1d82135b84c7c540f92d789f7) )
ROM_LOAD16_BYTE( "mpr-16187.ic5", 0x000001, 0x200000, CRC(98b62f8b) SHA1(eaf98efd9eac7b7c385138a8a4dbc94b0ca38df5) )
- ROM_REGION32_BE( 0x1000000, "gfx2", 0 ) /* sprites */
+ ROM_REGION32_BE( 0x1000000, "mainpcb:gfx2", 0 ) /* sprites */
ROMX_LOAD( "mpr-16189.ic32", 0x000000, 0x200000, CRC(0937f713) SHA1(4b2b09ec8ed97794ad3824d1c57eae7f7e01379c) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-16191.ic30", 0x000002, 0x200000, CRC(cfef4aaa) SHA1(bc8a252dcbdb8facdd91eda7aed0f56fe7529d15) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-16193.ic28", 0x000004, 0x200000, CRC(a0706e4e) SHA1(1f36d952971c05db4190b229aa4957db3e5224f1) , ROM_SKIP(6)|ROM_GROUPWORD )
@@ -3572,20 +3950,20 @@ ROM_END
COMM BD. 837-8792
*/
ROM_START( orunners )
- ROM_REGION( 0x200000, "maincpu", 0 ) /* v60 code */
+ 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_REGION( 0x180000, "soundcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x180000, "mainpcb:soundcpu", 0 ) /* sound CPU */
ROM_LOAD( "epr15550.ic31", 0x100000, 0x80000, CRC(0205d2ed) SHA1(3475479e1a45fe96eefbe53842758898db7accbf) )
- ROM_REGION( 0x400000, "gfx1", 0 ) /* tiles */
+ 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_REGION32_BE( 0x1000000, "gfx2", 0 ) /* sprites */
+ ROM_REGION32_BE( 0x1000000, "mainpcb:gfx2", 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 )
@@ -3595,7 +3973,7 @@ ROM_START( orunners )
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 )
- ROM_REGION( 0x400000, "sega", 0 ) /* Sega PCM sound data */
+ 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_END
@@ -3610,20 +3988,20 @@ ROM_END
COMM BD. 837-8792
*/
ROM_START( orunnersu )
- ROM_REGION( 0x200000, "maincpu", 0 ) /* v60 code */
+ 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_REGION( 0x180000, "soundcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x180000, "mainpcb:soundcpu", 0 ) /* sound CPU */
ROM_LOAD( "epr15550.ic31", 0x100000, 0x80000, CRC(0205d2ed) SHA1(3475479e1a45fe96eefbe53842758898db7accbf) )
- ROM_REGION( 0x400000, "gfx1", 0 ) /* tiles */
+ 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_REGION32_BE( 0x1000000, "gfx2", 0 ) /* sprites */
+ ROM_REGION32_BE( 0x1000000, "mainpcb:gfx2", 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 )
@@ -3633,7 +4011,7 @@ ROM_START( orunnersu )
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 )
- ROM_REGION( 0x400000, "sega", 0 ) /* Sega PCM sound data */
+ 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_END
@@ -3648,20 +4026,20 @@ ROM_END
COMM BD. 837-8792
*/
ROM_START( orunnersj )
- ROM_REGION( 0x200000, "maincpu", 0 ) /* v60 code */
+ 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_REGION( 0x180000, "soundcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x180000, "mainpcb:soundcpu", 0 ) /* sound CPU */
ROM_LOAD( "epr15550.ic31", 0x100000, 0x80000, CRC(0205d2ed) SHA1(3475479e1a45fe96eefbe53842758898db7accbf) )
- ROM_REGION( 0x400000, "gfx1", 0 ) /* tiles */
+ 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_REGION32_BE( 0x1000000, "gfx2", 0 ) /* sprites */
+ ROM_REGION32_BE( 0x1000000, "mainpcb:gfx2", 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 )
@@ -3671,7 +4049,7 @@ ROM_START( orunnersj )
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 )
- ROM_REGION( 0x400000, "sega", 0 ) /* Sega PCM sound data */
+ 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_END
@@ -3705,24 +4083,24 @@ Export: EPR-13693.ic21 (dumped)
Japanese version is undumped. There is likely a Japanese specific sound rom at IC20 (EPR-13524.ic20 ??)
*/
ROM_START( radm )
- ROM_REGION( 0x200000, "maincpu", 0 ) /* v60 code + data */
+ ROM_REGION( 0x200000, "mainpcb:maincpu", 0 ) /* v60 code + data */
ROM_LOAD_x8( "epr-13693.ic21", 0x000000, 0x020000, CRC(3f09a211) SHA1(e0e011d7069745e9bf0395bc1375d0f8b9c46dab) )
ROM_LOAD16_BYTE( "epr-13525.ic37", 0x100000, 0x080000, CRC(62ad83a0) SHA1(b537176ebca15d91db04d5d7ab36aa967d41288e) )
ROM_LOAD16_BYTE( "epr-13526.ic38", 0x100001, 0x080000, CRC(59ea372a) SHA1(e7a5d59586652c59c23e07e0a99ecc740fb6144d) )
- ROM_REGION( 0x500000, "soundcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x500000, "mainpcb:soundcpu", 0 ) /* sound CPU */
ROM_LOAD_x8( "epr-13527.ic9", 0x100000, 0x020000, CRC(a2e3fbbe) SHA1(2787bbef696ab3f2b7855ac991867837d3de54cd) )
ROM_LOAD_x2( "epr-13523.ic14", 0x200000, 0x080000, CRC(d5563697) SHA1(eb3fd3dbfea383ac1bb5d2e1552723994cb4693d) )
ROM_LOAD_x2( "epr-13699.ic20", 0x300000, 0x080000, CRC(33fd2913) SHA1(60b664559b4989446b1c7d875432e53a36fe27df) )
ROM_LOAD_x2( "epr-13523.ic22", 0x400000, 0x080000, CRC(d5563697) SHA1(eb3fd3dbfea383ac1bb5d2e1552723994cb4693d) ) /* Deluxe or Upright manuals don't show this rom */
- ROM_REGION( 0x200000, "gfx1", 0 ) /* tiles */
+ ROM_REGION( 0x200000, "mainpcb:gfx1", 0 ) /* tiles */
ROM_LOAD32_BYTE( "mpr-13519.ic3", 0x000000, 0x080000, CRC(bedc9534) SHA1(7b3f7a47b6c0ca6707dc3c1167f3564d43adb32f) )
ROM_LOAD32_BYTE( "mpr-13520.ic7", 0x000002, 0x080000, CRC(3532e91a) SHA1(669c8d27b4b48e1ab9d6d30b0994f5a4e5169118) )
ROM_LOAD32_BYTE( "mpr-13521.ic12", 0x000001, 0x080000, CRC(e9bca903) SHA1(18a73c830b9755262a1c525e3ad5ae084117b64d) )
ROM_LOAD32_BYTE( "mpr-13522.ic18", 0x000003, 0x080000, CRC(25e04648) SHA1(617e794e8f7aa2a435bac917b8968699fe88dafb) )
- ROM_REGION32_BE( 0x800000, "gfx2", 0 ) /* sprites */
+ ROM_REGION32_BE( 0x800000, "mainpcb:gfx2", 0 ) /* sprites */
ROMX_LOAD( "mpr-13511.ic1", 0x000000, 0x100000, CRC(f8f15b11) SHA1(da6c2b8c3a94c4c263583f046823eaea818aff7c) , ROM_SKIP(7) )
ROMX_LOAD( "mpr-13512.ic5", 0x000001, 0x100000, CRC(d0be34a6) SHA1(b42a63e30f0f7a94de8a825ca93cf8efdb7a7648) , ROM_SKIP(7) )
ROMX_LOAD( "mpr-13513.ic10", 0x000002, 0x100000, CRC(feef1982) SHA1(bdf906317079a12c48ef4fca5bef0d437e9bf050) , ROM_SKIP(7) )
@@ -3735,7 +4113,7 @@ ROM_START( radm )
ROM_REGION( 0x8000, "user2", 0 ) /* unused (cabinet motor?) */
ROM_LOAD( "epr-13686.bin", 0x00000, 0x8000, CRC(317a2857) SHA1(e0788dc7a7d214d9c4d26b24e44c1a0dc9ae477c) ) /* cabinet movement */
- ROM_REGION16_BE( 0x80, "eeprom", 0 )
+ ROM_REGION16_BE( 0x80, "mainpcb:eeprom", 0 )
ROM_LOAD16_WORD( "eeprom-radm.ic76", 0x0000, 0x0080, CRC(b1737c06) SHA1(29448a6effeb53322a93158feb9a62bc6ad31f21) )
ROM_END
@@ -3744,24 +4122,24 @@ ROM_END
not protected
*/
ROM_START( radmu )
- ROM_REGION( 0x200000, "maincpu", 0 ) /* v60 code + data */
+ ROM_REGION( 0x200000, "mainpcb:maincpu", 0 ) /* v60 code + data */
ROM_LOAD_x8( "epr-13690.ic21", 0x000000, 0x020000, CRC(21637dec) SHA1(b9921effb10a72f3bdca4d540149c7f46662b716) )
ROM_LOAD16_BYTE( "epr-13525.ic37", 0x100000, 0x080000, CRC(62ad83a0) SHA1(b537176ebca15d91db04d5d7ab36aa967d41288e) )
ROM_LOAD16_BYTE( "epr-13526.ic38", 0x100001, 0x080000, CRC(59ea372a) SHA1(e7a5d59586652c59c23e07e0a99ecc740fb6144d) )
- ROM_REGION( 0x500000, "soundcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x500000, "mainpcb:soundcpu", 0 ) /* sound CPU */
ROM_LOAD_x8( "epr-13527.ic9", 0x100000, 0x020000, CRC(a2e3fbbe) SHA1(2787bbef696ab3f2b7855ac991867837d3de54cd) )
ROM_LOAD_x2( "epr-13523.ic14", 0x200000, 0x080000, CRC(d5563697) SHA1(eb3fd3dbfea383ac1bb5d2e1552723994cb4693d) )
ROM_LOAD_x2( "epr-13699.ic20", 0x300000, 0x080000, CRC(33fd2913) SHA1(60b664559b4989446b1c7d875432e53a36fe27df) )
ROM_LOAD_x2( "epr-13523.ic22", 0x400000, 0x080000, CRC(d5563697) SHA1(eb3fd3dbfea383ac1bb5d2e1552723994cb4693d) ) /* Deluxe or Upright manuals don't show this rom */
- ROM_REGION( 0x200000, "gfx1", 0 ) /* tiles */
+ ROM_REGION( 0x200000, "mainpcb:gfx1", 0 ) /* tiles */
ROM_LOAD32_BYTE( "mpr-13519.ic3", 0x000000, 0x080000, CRC(bedc9534) SHA1(7b3f7a47b6c0ca6707dc3c1167f3564d43adb32f) )
ROM_LOAD32_BYTE( "mpr-13520.ic7", 0x000002, 0x080000, CRC(3532e91a) SHA1(669c8d27b4b48e1ab9d6d30b0994f5a4e5169118) )
ROM_LOAD32_BYTE( "mpr-13521.ic12", 0x000001, 0x080000, CRC(e9bca903) SHA1(18a73c830b9755262a1c525e3ad5ae084117b64d) )
ROM_LOAD32_BYTE( "mpr-13522.ic18", 0x000003, 0x080000, CRC(25e04648) SHA1(617e794e8f7aa2a435bac917b8968699fe88dafb) )
- ROM_REGION32_BE( 0x800000, "gfx2", 0 ) /* sprites */
+ ROM_REGION32_BE( 0x800000, "mainpcb:gfx2", 0 ) /* sprites */
ROMX_LOAD( "mpr-13511.ic1", 0x000000, 0x100000, CRC(f8f15b11) SHA1(da6c2b8c3a94c4c263583f046823eaea818aff7c) , ROM_SKIP(7) )
ROMX_LOAD( "mpr-13512.ic5", 0x000001, 0x100000, CRC(d0be34a6) SHA1(b42a63e30f0f7a94de8a825ca93cf8efdb7a7648) , ROM_SKIP(7) )
ROMX_LOAD( "mpr-13513.ic10", 0x000002, 0x100000, CRC(feef1982) SHA1(bdf906317079a12c48ef4fca5bef0d437e9bf050) , ROM_SKIP(7) )
@@ -3774,7 +4152,7 @@ ROM_START( radmu )
ROM_REGION( 0x8000, "user2", 0 ) /* unused (cabinet motor?) */
ROM_LOAD( "epr-13686.bin", 0x00000, 0x8000, CRC(317a2857) SHA1(e0788dc7a7d214d9c4d26b24e44c1a0dc9ae477c) ) /* cabinet movement */
- ROM_REGION16_BE( 0x80, "eeprom", 0 )
+ ROM_REGION16_BE( 0x80, "mainpcb:eeprom", 0 )
ROM_LOAD16_WORD( "eeprom-radm.ic76", 0x0000, 0x0080, CRC(b1737c06) SHA1(29448a6effeb53322a93158feb9a62bc6ad31f21) )
ROM_END
@@ -3792,24 +4170,24 @@ A/D BD NO. 837-7536
*/
ROM_START( radr )
- ROM_REGION( 0x200000, "maincpu", 0 ) /* v60 code + data */
+ ROM_REGION( 0x200000, "mainpcb:maincpu", 0 ) /* v60 code + data */
ROM_LOAD_x8( "epr-14241.ic21", 0x000000, 0x020000, CRC(59a5f63d) SHA1(325a26a09475ddc828de71e71a1d3043f3959cec) )
ROM_LOAD16_BYTE( "epr-14106.ic37", 0x100000, 0x080000, CRC(e73c63bf) SHA1(30fb68eaa7d02a232c873bd7751cac7d0fa08e44) )
ROM_LOAD16_BYTE( "epr-14107.ic38", 0x100001, 0x080000, CRC(832f797a) SHA1(b0c16ef7bd8d37f592975052ba9da3da70a2fc79) )
- ROM_REGION( 0x500000, "soundcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x500000, "mainpcb:soundcpu", 0 ) /* sound CPU */
ROM_LOAD_x8( "epr-14108.ic9", 0x100000, 0x020000, CRC(38a99b4d) SHA1(b6455e6b29bfef41c5e0ebe3a8064889b7e5f5fd) )
ROM_LOAD_x2( "epr-14109.ic14", 0x200000, 0x080000, CRC(b42e5833) SHA1(da94ce7c1d7a581a1aa6b79b323c67a919918808) )
ROM_LOAD_x2( "epr-14110.ic20", 0x300000, 0x080000, CRC(b495e7dc) SHA1(b4143fcee10e0649378fdb1e3f5a0a2c585414ec) )
ROM_LOAD_x2( "epr-14237.ic22", 0x400000, 0x080000, CRC(0a4b4b29) SHA1(98447a587f903ba03e17d6a145b7c8bfddf25c4d) )
- ROM_REGION( 0x100000, "gfx1", 0 ) /* tiles */
+ ROM_REGION( 0x100000, "mainpcb:gfx1", 0 ) /* tiles */
ROM_LOAD32_BYTE( "epr-14102.ic3", 0x000000, 0x040000, CRC(5626e80f) SHA1(9844817295a8cd8a9b09da6681b0c1fbfe82618e) )
ROM_LOAD32_BYTE( "epr-14103.ic7", 0x000002, 0x040000, CRC(08c7e804) SHA1(cf45b1934edc43cb3a0ed72159949cb0dd00d701) )
ROM_LOAD32_BYTE( "epr-14104.ic12", 0x000001, 0x040000, CRC(b0173646) SHA1(1ba4edc033e0e4f5a1e02987e9f6b8b1650b46d7) )
ROM_LOAD32_BYTE( "epr-14105.ic18", 0x000003, 0x040000, CRC(614843b6) SHA1(d4f2cd3b024f7152d6e89237f0da06adea2efe57) )
- ROM_REGION32_BE( 0x800000, "gfx2", 0 ) /* sprites */
+ ROM_REGION32_BE( 0x800000, "mainpcb:gfx2", 0 ) /* sprites */
ROMX_LOAD( "mpr-13511.ic1", 0x000000, 0x100000, CRC(f8f15b11) SHA1(da6c2b8c3a94c4c263583f046823eaea818aff7c) , ROM_SKIP(7) )
ROMX_LOAD( "mpr-13512.ic5", 0x000001, 0x100000, CRC(d0be34a6) SHA1(b42a63e30f0f7a94de8a825ca93cf8efdb7a7648) , ROM_SKIP(7) )
ROMX_LOAD( "mpr-13513.ic10", 0x000002, 0x100000, CRC(feef1982) SHA1(bdf906317079a12c48ef4fca5bef0d437e9bf050) , ROM_SKIP(7) )
@@ -3822,7 +4200,7 @@ ROM_START( radr )
ROM_REGION( 0x8000, "user2", 0 ) /* unused */
ROM_LOAD( "epr-14084.17", 0x00000, 0x8000, CRC(f14ed074) SHA1(e1bb23eac85e3236046527c5c7688f6f23d43aef) ) /* cabinet link */
- ROM_REGION16_BE( 0x80, "eeprom", 0 )
+ ROM_REGION16_BE( 0x80, "mainpcb:eeprom", 0 )
ROM_LOAD16_WORD( "eeprom-radr.ic76", 0x0000, 0x0080, CRC(602032c6) SHA1(fecf14017e537fe870457d2a8d4f86ec6d442b90) )
ROM_END
@@ -3837,24 +4215,24 @@ A/D BD NO. 837-7536
*/
ROM_START( radru )
- ROM_REGION( 0x200000, "maincpu", 0 ) /* v60 code + data */
+ ROM_REGION( 0x200000, "mainpcb:maincpu", 0 ) /* v60 code + data */
ROM_LOAD_x8( "epr-14240.ic21", 0x000000, 0x020000, CRC(8473e7ab) SHA1(fbd883dc804d7de6ce239b68c6e6ae3a54e9e03c) )
ROM_LOAD16_BYTE( "epr-14106.ic37", 0x100000, 0x080000, CRC(e73c63bf) SHA1(30fb68eaa7d02a232c873bd7751cac7d0fa08e44) )
ROM_LOAD16_BYTE( "epr-14107.ic38", 0x100001, 0x080000, CRC(832f797a) SHA1(b0c16ef7bd8d37f592975052ba9da3da70a2fc79) )
- ROM_REGION( 0x500000, "soundcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x500000, "mainpcb:soundcpu", 0 ) /* sound CPU */
ROM_LOAD_x8( "epr-14108.ic9", 0x100000, 0x020000, CRC(38a99b4d) SHA1(b6455e6b29bfef41c5e0ebe3a8064889b7e5f5fd) )
ROM_LOAD_x2( "epr-14109.ic14", 0x200000, 0x080000, CRC(b42e5833) SHA1(da94ce7c1d7a581a1aa6b79b323c67a919918808) )
ROM_LOAD_x2( "epr-14110.ic20", 0x300000, 0x080000, CRC(b495e7dc) SHA1(b4143fcee10e0649378fdb1e3f5a0a2c585414ec) )
ROM_LOAD_x2( "epr-14237.ic22", 0x400000, 0x080000, CRC(0a4b4b29) SHA1(98447a587f903ba03e17d6a145b7c8bfddf25c4d) )
- ROM_REGION( 0x100000, "gfx1", 0 ) /* tiles */
+ ROM_REGION( 0x100000, "mainpcb:gfx1", 0 ) /* tiles */
ROM_LOAD32_BYTE( "epr-14102.ic3", 0x000000, 0x040000, CRC(5626e80f) SHA1(9844817295a8cd8a9b09da6681b0c1fbfe82618e) )
ROM_LOAD32_BYTE( "epr-14103.ic7", 0x000002, 0x040000, CRC(08c7e804) SHA1(cf45b1934edc43cb3a0ed72159949cb0dd00d701) )
ROM_LOAD32_BYTE( "epr-14104.ic12", 0x000001, 0x040000, CRC(b0173646) SHA1(1ba4edc033e0e4f5a1e02987e9f6b8b1650b46d7) )
ROM_LOAD32_BYTE( "epr-14105.ic16", 0x000003, 0x040000, CRC(614843b6) SHA1(d4f2cd3b024f7152d6e89237f0da06adea2efe57) )
- ROM_REGION32_BE( 0x800000, "gfx2", 0 ) /* sprites */
+ ROM_REGION32_BE( 0x800000, "mainpcb:gfx2", 0 ) /* sprites */
ROMX_LOAD( "mpr-13511.ic1", 0x000000, 0x100000, CRC(f8f15b11) SHA1(da6c2b8c3a94c4c263583f046823eaea818aff7c) , ROM_SKIP(7) )
ROMX_LOAD( "mpr-13512.ic5", 0x000001, 0x100000, CRC(d0be34a6) SHA1(b42a63e30f0f7a94de8a825ca93cf8efdb7a7648) , ROM_SKIP(7) )
ROMX_LOAD( "mpr-13513.ic10", 0x000002, 0x100000, CRC(feef1982) SHA1(bdf906317079a12c48ef4fca5bef0d437e9bf050) , ROM_SKIP(7) )
@@ -3867,7 +4245,7 @@ ROM_START( radru )
ROM_REGION( 0x8000, "user2", 0 ) /* unused */
ROM_LOAD( "epr-14084.17", 0x00000, 0x8000, CRC(f14ed074) SHA1(e1bb23eac85e3236046527c5c7688f6f23d43aef) ) /* cabinet link */
- ROM_REGION16_BE( 0x80, "eeprom", 0 )
+ ROM_REGION16_BE( 0x80, "mainpcb:eeprom", 0 )
ROM_LOAD16_WORD( "eeprom-radr.ic76", 0x0000, 0x0080, CRC(602032c6) SHA1(fecf14017e537fe870457d2a8d4f86ec6d442b90) )
ROM_END
@@ -3882,24 +4260,24 @@ A/D BD NO. 837-7536
*/
ROM_START( radrj )
- ROM_REGION( 0x200000, "maincpu", 0 ) /* v60 code + data */
+ ROM_REGION( 0x200000, "mainpcb:maincpu", 0 ) /* v60 code + data */
ROM_LOAD_x8( "epr-14111.ic21", 0x000000, 0x020000, CRC(7adc6d17) SHA1(fc312a30b077ba060b6d98ab6ecccd2e16b32fc2) )
ROM_LOAD16_BYTE( "epr-14106.ic37", 0x100000, 0x080000, CRC(e73c63bf) SHA1(30fb68eaa7d02a232c873bd7751cac7d0fa08e44) )
ROM_LOAD16_BYTE( "epr-14107.ic38", 0x100001, 0x080000, CRC(832f797a) SHA1(b0c16ef7bd8d37f592975052ba9da3da70a2fc79) )
- ROM_REGION( 0x500000, "soundcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x500000, "mainpcb:soundcpu", 0 ) /* sound CPU */
ROM_LOAD_x8( "epr-14108.ic9", 0x100000, 0x020000, CRC(38a99b4d) SHA1(b6455e6b29bfef41c5e0ebe3a8064889b7e5f5fd) )
ROM_LOAD_x2( "epr-14109.ic14", 0x200000, 0x080000, CRC(b42e5833) SHA1(da94ce7c1d7a581a1aa6b79b323c67a919918808) )
ROM_LOAD_x2( "epr-14110.ic20", 0x300000, 0x080000, CRC(b495e7dc) SHA1(b4143fcee10e0649378fdb1e3f5a0a2c585414ec) )
ROM_LOAD_x2( "epr-14237.ic22", 0x400000, 0x080000, CRC(0a4b4b29) SHA1(98447a587f903ba03e17d6a145b7c8bfddf25c4d) )
- ROM_REGION( 0x100000, "gfx1", 0 ) /* tiles */
+ ROM_REGION( 0x100000, "mainpcb:gfx1", 0 ) /* tiles */
ROM_LOAD32_BYTE( "epr-14102.ic3", 0x000000, 0x040000, CRC(5626e80f) SHA1(9844817295a8cd8a9b09da6681b0c1fbfe82618e) )
ROM_LOAD32_BYTE( "epr-14103.ic7", 0x000002, 0x040000, CRC(08c7e804) SHA1(cf45b1934edc43cb3a0ed72159949cb0dd00d701) )
ROM_LOAD32_BYTE( "epr-14104.ic12", 0x000001, 0x040000, CRC(b0173646) SHA1(1ba4edc033e0e4f5a1e02987e9f6b8b1650b46d7) )
ROM_LOAD32_BYTE( "epr-14105.ic16", 0x000003, 0x040000, CRC(614843b6) SHA1(d4f2cd3b024f7152d6e89237f0da06adea2efe57) )
- ROM_REGION32_BE( 0x800000, "gfx2", 0 ) /* sprites */
+ ROM_REGION32_BE( 0x800000, "mainpcb:gfx2", 0 ) /* sprites */
ROMX_LOAD( "mpr-13511.ic1", 0x000000, 0x100000, CRC(f8f15b11) SHA1(da6c2b8c3a94c4c263583f046823eaea818aff7c) , ROM_SKIP(7) )
ROMX_LOAD( "mpr-13512.ic5", 0x000001, 0x100000, CRC(d0be34a6) SHA1(b42a63e30f0f7a94de8a825ca93cf8efdb7a7648) , ROM_SKIP(7) )
ROMX_LOAD( "mpr-13513.ic10", 0x000002, 0x100000, CRC(feef1982) SHA1(bdf906317079a12c48ef4fca5bef0d437e9bf050) , ROM_SKIP(7) )
@@ -3912,7 +4290,7 @@ ROM_START( radrj )
ROM_REGION( 0x8000, "user2", 0 ) /* unused */
ROM_LOAD( "epr-14084.17", 0x00000, 0x8000, CRC(f14ed074) SHA1(e1bb23eac85e3236046527c5c7688f6f23d43aef) ) /* cabinet link */
- ROM_REGION16_BE( 0x80, "eeprom", 0 )
+ ROM_REGION16_BE( 0x80, "mainpcb:eeprom", 0 )
ROM_LOAD16_WORD( "eeprom-radr.ic76", 0x0000, 0x0080, CRC(602032c6) SHA1(fecf14017e537fe870457d2a8d4f86ec6d442b90) )
ROM_END
@@ -3928,22 +4306,22 @@ ROM_END
A/D BD NO. 837-7536
*/
ROM_START( slipstrm )
- ROM_REGION( 0x200000, "maincpu", 0 ) /* v60 code + data */
+ ROM_REGION( 0x200000, "mainpcb:maincpu", 0 ) /* v60 code + data */
ROM_LOAD_x2( "s32b_prg01.ic6", 0x000000, 0x080000, CRC(7d066307) SHA1(d87e04167263b435b77830db02ed58651ccc020c) )
ROM_LOAD16_BYTE( "s32_dat00.ic14",0x100000, 0x080000, CRC(c3ff6309) SHA1(dcc857736fe0f15aa7909c3ee88a7e239c8f0228) )
ROM_LOAD16_BYTE( "s32_dat01.ic7", 0x100001, 0x080000, CRC(0e605c81) SHA1(47c64195cab9a07b234d5a375d26168e53ffaa17) )
- ROM_REGION( 0x500000, "soundcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x500000, "mainpcb:soundcpu", 0 ) /* sound CPU */
ROM_LOAD_x8( "s32_snd00.ic35", 0x100000, 0x020000, CRC(0fee2278) SHA1(7533a03c3fc46d65dfdd07bddf1e6e0bbc368752) )
ROM_LOAD_x2( "s32_snd01.ic31", 0x200000, 0x080000, CRC(ae7be5f2) SHA1(ba089355e64864435bcc3b0c208e4bce1ea66295) )
- ROM_REGION( 0x200000, "gfx1", 0 ) /* tiles */
+ ROM_REGION( 0x200000, "mainpcb:gfx1", 0 ) /* tiles */
ROM_LOAD32_BYTE( "s32_scr00.ic38", 0x000000, 0x080000, CRC(3cbb2d0b) SHA1(b94006347b72cd60a889b0e279f62f677cedfd2e) )
ROM_LOAD32_BYTE( "s32_scr01.ic34", 0x000002, 0x080000, CRC(4167be55) SHA1(96b34d311b318c00c3fad917e341589a70ba0a15) )
ROM_LOAD32_BYTE( "s32_scr02.ic29", 0x000001, 0x080000, CRC(52c4bb85) SHA1(4fbee1072a19c75c25b5fd269acc75640923d69c) )
ROM_LOAD32_BYTE( "s32_scr03.ic25", 0x000003, 0x080000, CRC(4948604a) SHA1(d5a1b9781fef7976a59a0af9b755a04fcacf9381) )
- ROM_REGION32_BE( 0x400000, "gfx2", 0 ) /* sprites */
+ ROM_REGION32_BE( 0x400000, "mainpcb:gfx2", 0 ) /* sprites */
ROMX_LOAD( "s32_obj00.ic36", 0x000000, 0x80000, CRC(cffe9e0d) SHA1(5272d54ff142de927a9abd61f3646e963c7d22c4) , ROM_SKIP(7) )
ROMX_LOAD( "s32_obj01.ic32", 0x000001, 0x80000, CRC(4ebd1383) SHA1(ce35f4d15e7904bfde55e58cdde925cba8002763) , ROM_SKIP(7) )
ROMX_LOAD( "s32_obj02.ic27", 0x000002, 0x80000, CRC(b3cf4fe2) SHA1(e13199522e1e3e8b9cfe72cc29b33f25dad542ef) , ROM_SKIP(7) )
@@ -3963,22 +4341,22 @@ ROM_END
A/D BD NO. 837-7536
*/
ROM_START( slipstrmh )
- ROM_REGION( 0x200000, "maincpu", 0 ) /* v60 code + data */
+ ROM_REGION( 0x200000, "mainpcb:maincpu", 0 ) /* v60 code + data */
ROM_LOAD_x2( "s32h_prg01.ic6", 0x000000, 0x080000, CRC(ab778297) SHA1(e440d44b20f2f7478ef7d86af90af5eb7b9a545a) )
ROM_LOAD16_BYTE( "s32_dat00.ic14",0x100000, 0x080000, CRC(c3ff6309) SHA1(dcc857736fe0f15aa7909c3ee88a7e239c8f0228) )
ROM_LOAD16_BYTE( "s32_dat01.ic7", 0x100001, 0x080000, CRC(0e605c81) SHA1(47c64195cab9a07b234d5a375d26168e53ffaa17) )
- ROM_REGION( 0x500000, "soundcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x500000, "mainpcb:soundcpu", 0 ) /* sound CPU */
ROM_LOAD_x8( "s32_snd00.ic35", 0x100000, 0x020000, CRC(0fee2278) SHA1(7533a03c3fc46d65dfdd07bddf1e6e0bbc368752) )
ROM_LOAD_x2( "s32_snd01.ic31", 0x200000, 0x080000, CRC(ae7be5f2) SHA1(ba089355e64864435bcc3b0c208e4bce1ea66295) )
- ROM_REGION( 0x200000, "gfx1", 0 ) /* tiles */
+ ROM_REGION( 0x200000, "mainpcb:gfx1", 0 ) /* tiles */
ROM_LOAD32_BYTE( "s32_scr00.ic38", 0x000000, 0x080000, CRC(3cbb2d0b) SHA1(b94006347b72cd60a889b0e279f62f677cedfd2e) )
ROM_LOAD32_BYTE( "s32_scr01.ic34", 0x000002, 0x080000, CRC(4167be55) SHA1(96b34d311b318c00c3fad917e341589a70ba0a15) )
ROM_LOAD32_BYTE( "s32_scr02.ic29", 0x000001, 0x080000, CRC(52c4bb85) SHA1(4fbee1072a19c75c25b5fd269acc75640923d69c) )
ROM_LOAD32_BYTE( "s32_scr03.ic25", 0x000003, 0x080000, CRC(4948604a) SHA1(d5a1b9781fef7976a59a0af9b755a04fcacf9381) )
- ROM_REGION32_BE( 0x400000, "gfx2", 0 ) /* sprites */
+ ROM_REGION32_BE( 0x400000, "mainpcb:gfx2", 0 ) /* sprites */
ROMX_LOAD( "s32_obj00.ic36", 0x000000, 0x80000, CRC(cffe9e0d) SHA1(5272d54ff142de927a9abd61f3646e963c7d22c4) , ROM_SKIP(7) )
ROMX_LOAD( "s32_obj01.ic32", 0x000001, 0x80000, CRC(4ebd1383) SHA1(ce35f4d15e7904bfde55e58cdde925cba8002763) , ROM_SKIP(7) )
ROMX_LOAD( "s32_obj02.ic27", 0x000002, 0x80000, CRC(b3cf4fe2) SHA1(e13199522e1e3e8b9cfe72cc29b33f25dad542ef) , ROM_SKIP(7) )
@@ -4001,23 +4379,23 @@ Sega ROM BD ID# 834-9496
*/
ROM_START( sonic )
- ROM_REGION( 0x200000, "maincpu", 0 ) /* v60 code + data */
+ ROM_REGION( 0x200000, "mainpcb:maincpu", 0 ) /* v60 code + data */
ROM_LOAD_x4( "epr-15787c.ic17", 0x000000, 0x020000, CRC(25e3c27e) SHA1(8f173cd5c7c817dcccdcad9be5781cfaa081d73e) )
ROM_LOAD_x4( "epr-15786c.ic8", 0x080000, 0x020000, CRC(efe9524c) SHA1(8020e734704a8f989919ee5ad92f70035de717f0) )
ROM_LOAD16_BYTE_x2( "epr-15781c.ic18", 0x100000, 0x040000, CRC(65b06c25) SHA1(9f524012a7adbc71737f90fc556f0ce9adc2bcf8) )
ROM_LOAD16_BYTE_x2( "epr-15780c.ic9", 0x100001, 0x040000, CRC(2db66fd2) SHA1(54582c0d5977649a38fc3a2c0fe4d7b1959abc76) )
- ROM_REGION( 0x500000, "soundcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x500000, "mainpcb:soundcpu", 0 ) /* sound CPU */
ROM_LOAD_x4( "epr-15785.ic36", 0x100000, 0x040000, CRC(0fe7422e) SHA1(b7eaf4736ba155965317bb4ef3b33fc122635151) )
ROM_LOAD( "mpr-15784.ic35", 0x200000, 0x100000, CRC(42f06714) SHA1(30e45bb2d9b492f0c1acc4fbe1e5869f0559300b) )
ROM_LOAD( "mpr-15783.ic34", 0x300000, 0x100000, CRC(e4220eea) SHA1(a546c8bfc24e0695cf79c49e1a867d2595a1ed7f) )
ROM_LOAD( "mpr-15782.ic33", 0x400000, 0x100000, CRC(cf56b5a0) SHA1(5786228aab120c3361524ba93b418b24fd5b8ffb) ) // (this is the only rom unchanged from the prototype)
- ROM_REGION( 0x200000, "gfx1", 0 ) /* tiles */
+ ROM_REGION( 0x200000, "mainpcb:gfx1", 0 ) /* tiles */
ROM_LOAD16_BYTE( "mpr-15789.ic14", 0x000000, 0x100000, CRC(4378f12b) SHA1(826e0550a3c5f2b6e59c6531ac03658a4f826651) )
ROM_LOAD16_BYTE( "mpr-15788.ic5", 0x000001, 0x100000, CRC(a6ed5d7a) SHA1(d30f26b452d380e7657e044e144f7dbbc4dc13e5) )
- ROM_REGION32_BE( 0x1000000, "gfx2", 0 ) /* sprites */
+ ROM_REGION32_BE( 0x1000000, "mainpcb:gfx2", 0 ) /* sprites */
ROMX_LOAD( "mpr-15790.ic32", 0x000000, 0x200000, CRC(c69d51b1) SHA1(7644fb64457855f9ed87ca25ddc28c21bcb61fd9) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-15792.ic30", 0x000002, 0x200000, CRC(1006bb67) SHA1(38c752e634aa94b1a23c09c4dba6388b7d0358af) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-15794.ic28", 0x000004, 0x200000, CRC(8672b480) SHA1(61659e3856cdff0b2bca190a7e60c81b86ea2089) , ROM_SKIP(6)|ROM_GROUPWORD )
@@ -4037,25 +4415,25 @@ ROM_END
not protected
*/
ROM_START( sonicp )
- ROM_REGION( 0x200000, "maincpu", 0 ) /* v60 code + data */
+ ROM_REGION( 0x200000, "mainpcb:maincpu", 0 ) /* v60 code + data */
ROM_LOAD_x4( "sonpg0.bin", 0x000000, 0x20000, CRC(da05dcbb) SHA1(c2ced1f3aee92b0e531d5cd7611d4811f2ae95e7) )
ROM_LOAD_x4( "sonpg1.bin", 0x080000, 0x20000, CRC(c57dc5c5) SHA1(5741bdd52ee7181d883129885838b36f4af8a04c) )
ROM_LOAD16_BYTE_x2( "sonpd0.bin", 0x100000, 0x40000, CRC(a7da7546) SHA1(0a10573b21cd38d58380698bc18b0256dbb24044) )
ROM_LOAD16_BYTE_x2( "sonpd1.bin", 0x100001, 0x40000, CRC(c30e4c70) SHA1(897b6f62921694fe3c63677908f76eaf38b7b92f) )
- ROM_REGION( 0x500000, "soundcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x500000, "mainpcb:soundcpu", 0 ) /* sound CPU */
ROM_LOAD_x4( "sonsnd0.bin", 0x100000, 0x040000, CRC(569c8d4b) SHA1(9f1f6da6adbea043cc5ad853806fcb7bf683c832) )
ROM_LOAD( "sonsnd1.bin", 0x200000, 0x100000, CRC(f4fa5a21) SHA1(14a364ba7744ff0b44423d8d6bab990fe534ff29) )
ROM_LOAD( "sonsnd2.bin", 0x300000, 0x100000, CRC(e1bd45a5) SHA1(b411757853d61588e5223b48b5124cc00b3d65dd) )
ROM_LOAD( "sonsnd3.bin", 0x400000, 0x100000, CRC(cf56b5a0) SHA1(5786228aab120c3361524ba93b418b24fd5b8ffb) )
- ROM_REGION( 0x200000, "gfx1", 0 ) /* tiles */
+ ROM_REGION( 0x200000, "mainpcb:gfx1", 0 ) /* tiles */
ROM_LOAD32_BYTE( "sonscl0.bin", 0x000000, 0x080000, CRC(445e31b9) SHA1(5678dfda74a09b5ac673448b222d11df4ca23aff) )
ROM_LOAD32_BYTE( "sonscl1.bin", 0x000002, 0x080000, CRC(3d234181) SHA1(2e8c14ad36be76f5f5fc6a3ee152f1abc8bf0ddd) )
ROM_LOAD32_BYTE( "sonscl2.bin", 0x000001, 0x080000, CRC(a5de28b2) SHA1(49a16ac10cf01b5b8802b8b015a2e403086c206a) )
ROM_LOAD32_BYTE( "sonscl3.bin", 0x000003, 0x080000, CRC(7ce7554b) SHA1(8def3acae6baafbe9e350f18e245a9a833df5cc4) )
- ROM_REGION32_BE( 0x800000, "gfx2", 0 ) /* sprites */
+ ROM_REGION32_BE( 0x800000, "mainpcb:gfx2", 0 ) /* sprites */
ROMX_LOAD( "sonobj0.bin", 0x000000, 0x100000, CRC(ceea18e3) SHA1(f902a7e2f8e126fd7a7862c55de32ce6352a7716) , ROM_SKIP(7) )
ROMX_LOAD( "sonobj1.bin", 0x000001, 0x100000, CRC(6bbc226b) SHA1(5ef4256b6a93891daf1349def6db3bc428e5f4f3) , ROM_SKIP(7) )
ROMX_LOAD( "sonobj2.bin", 0x000002, 0x100000, CRC(fcd5ef0e) SHA1(e3e50d4838ac3cce41d69ee6cd31981fbe422a4b) , ROM_SKIP(7) )
@@ -4074,25 +4452,25 @@ ROM_END
not protected
*/
ROM_START( spidman )
- ROM_REGION( 0x200000, "maincpu", 0 ) /* v60 code + data */
+ ROM_REGION( 0x200000, "mainpcb:maincpu", 0 ) /* v60 code + data */
ROM_LOAD_x4( "epr-14307.ic13", 0x000000, 0x020000, CRC(d900219c) SHA1(d59654db1fc0ec4d5f8cda9000ab4bd3bb36cdfc) )
ROM_LOAD_x4( "epr-14306.ic7", 0x080000, 0x020000, CRC(64379dc6) SHA1(7efc7175351186c54f141161a395e63b1cc7e7a5) )
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) )
- ROM_REGION( 0x500000, "soundcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x500000, "mainpcb:soundcpu", 0 ) /* sound CPU */
ROM_LOAD_x4( "epr-14285.ic35", 0x100000, 0x040000, CRC(25aefad6) SHA1(10153f4e773a0f55378f869eb1d85156e85f893f) )
ROM_LOAD_x2( "mpr-14284.ic31", 0x200000, 0x080000, CRC(760542d4) SHA1(dcac73869c02fefd328bd6bdbcbdb3b68b0647da) )
ROM_LOAD_x2( "mpr-14283.ic26", 0x300000, 0x080000, CRC(c863a91c) SHA1(afdc76bbb9b207cfcb47d437248a757d03212f4e) )
ROM_LOAD_x2( "mpr-14282.ic22", 0x400000, 0x080000, CRC(ea20979e) SHA1(9b70ef055da8c7c56da54b7edef2379678e7c50f) )
- ROM_REGION( 0x400000, "gfx1", 0 ) /* tiles */
+ ROM_REGION( 0x400000, "mainpcb:gfx1", 0 ) /* tiles */
ROM_LOAD32_BYTE( "mpr-14291-s.ic38", 0x000000, 0x100000, CRC(490f95a1) SHA1(f220788670b76164ac414ed9b16a422f719be267) )
ROM_LOAD32_BYTE( "mpr-14290-s.ic34", 0x000002, 0x100000, CRC(a144162d) SHA1(d43f12dd9f690cdfcebb6c7b515ff7dc7dcaa377) )
ROM_LOAD32_BYTE( "mpr-14289-s.ic29", 0x000001, 0x100000, CRC(38570582) SHA1(a9d810a02a1f5a6849c79d65fbebff21a4b82b59) )
ROM_LOAD32_BYTE( "mpr-14288-s.ic25", 0x000003, 0x100000, CRC(3188b636) SHA1(bc0adeeca5040caa563ee1e0eded9c323ca23446) )
- ROM_REGION32_BE( 0x800000, "gfx2", 0 ) /* sprites */
+ ROM_REGION32_BE( 0x800000, "mainpcb:gfx2", 0 ) /* sprites */
ROMX_LOAD( "mpr-14299-h.ic36", 0x000000, 0x100000, CRC(ce59231b) SHA1(bcb1f11b74935694d0617ec8df66db2cc57b6219) , ROM_SKIP(7) )
ROMX_LOAD( "mpr-14298-h.ic32", 0x000001, 0x100000, CRC(2745c84c) SHA1(5a0528c921cba7a1047d3a2ece79925103d719a1) , ROM_SKIP(7) )
ROMX_LOAD( "mpr-14297-h.ic27", 0x000002, 0x100000, CRC(29cb9450) SHA1(7dc38d23a2f0cee2f4edde05c1a6f0dc83f331db) , ROM_SKIP(7) )
@@ -4116,25 +4494,25 @@ Input sub board: 837-7968
*/
ROM_START( spidmanu )
- ROM_REGION( 0x200000, "maincpu", 0 ) /* v60 code + data */
+ ROM_REGION( 0x200000, "mainpcb:maincpu", 0 ) /* v60 code + data */
ROM_LOAD_x4( "epr-14303a.ic13", 0x000000, 0x020000, CRC(7f1bd28f) SHA1(cff57e66d09682baf44aace99d698ad305f6a3d5) )
ROM_LOAD_x4( "epr-14302a.ic7", 0x080000, 0x020000, CRC(d954c40a) SHA1(436c81779274861de79dc6ce2c0fcc65bfd52098) )
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) )
- ROM_REGION( 0x500000, "soundcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x500000, "mainpcb:soundcpu", 0 ) /* sound CPU */
ROM_LOAD_x4( "epr-14285.ic35", 0x100000, 0x040000, CRC(25aefad6) SHA1(10153f4e773a0f55378f869eb1d85156e85f893f) )
ROM_LOAD_x2( "mpr-14284.ic31", 0x200000, 0x080000, CRC(760542d4) SHA1(dcac73869c02fefd328bd6bdbcbdb3b68b0647da) )
ROM_LOAD_x2( "mpr-14283.ic26", 0x300000, 0x080000, CRC(c863a91c) SHA1(afdc76bbb9b207cfcb47d437248a757d03212f4e) )
ROM_LOAD_x2( "mpr-14282.ic22", 0x400000, 0x080000, CRC(ea20979e) SHA1(9b70ef055da8c7c56da54b7edef2379678e7c50f) )
- ROM_REGION( 0x400000, "gfx1", 0 ) /* tiles */
+ ROM_REGION( 0x400000, "mainpcb:gfx1", 0 ) /* tiles */
ROM_LOAD32_BYTE( "mpr-14291-s.ic38", 0x000000, 0x100000, CRC(490f95a1) SHA1(f220788670b76164ac414ed9b16a422f719be267) )
ROM_LOAD32_BYTE( "mpr-14290-s.ic34", 0x000002, 0x100000, CRC(a144162d) SHA1(d43f12dd9f690cdfcebb6c7b515ff7dc7dcaa377) )
ROM_LOAD32_BYTE( "mpr-14289-s.ic29", 0x000001, 0x100000, CRC(38570582) SHA1(a9d810a02a1f5a6849c79d65fbebff21a4b82b59) )
ROM_LOAD32_BYTE( "mpr-14288-s.ic25", 0x000003, 0x100000, CRC(3188b636) SHA1(bc0adeeca5040caa563ee1e0eded9c323ca23446) )
- ROM_REGION32_BE( 0x800000, "gfx2", 0 ) /* sprites */
+ ROM_REGION32_BE( 0x800000, "mainpcb:gfx2", 0 ) /* sprites */
ROMX_LOAD( "mpr-14299-h.ic36", 0x000000, 0x100000, CRC(ce59231b) SHA1(bcb1f11b74935694d0617ec8df66db2cc57b6219) , ROM_SKIP(7) )
ROMX_LOAD( "mpr-14298-h.ic32", 0x000001, 0x100000, CRC(2745c84c) SHA1(5a0528c921cba7a1047d3a2ece79925103d719a1) , ROM_SKIP(7) )
ROMX_LOAD( "mpr-14297-h.ic27", 0x000002, 0x100000, CRC(29cb9450) SHA1(7dc38d23a2f0cee2f4edde05c1a6f0dc83f331db) , ROM_SKIP(7) )
@@ -4154,25 +4532,25 @@ Rom board: 834-8332
*/
ROM_START( spidmanj )
- ROM_REGION( 0x200000, "maincpu", 0 ) /* v60 code + data */
+ 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_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) )
- ROM_REGION( 0x500000, "soundcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x500000, "mainpcb:soundcpu", 0 ) /* sound CPU */
ROM_LOAD_x4( "epr-14285.ic35", 0x100000, 0x040000, CRC(25aefad6) SHA1(10153f4e773a0f55378f869eb1d85156e85f893f) )
ROM_LOAD_x2( "mpr-14284.ic31", 0x200000, 0x080000, CRC(760542d4) SHA1(dcac73869c02fefd328bd6bdbcbdb3b68b0647da) )
ROM_LOAD_x2( "mpr-14283.ic26", 0x300000, 0x080000, CRC(c863a91c) SHA1(afdc76bbb9b207cfcb47d437248a757d03212f4e) )
ROM_LOAD_x2( "mpr-14282.ic22", 0x400000, 0x080000, CRC(ea20979e) SHA1(9b70ef055da8c7c56da54b7edef2379678e7c50f) )
- ROM_REGION( 0x400000, "gfx1", 0 ) /* tiles */
+ ROM_REGION( 0x400000, "mainpcb:gfx1", 0 ) /* tiles */
ROM_LOAD32_BYTE( "mpr-14291-s.ic38", 0x000000, 0x100000, CRC(490f95a1) SHA1(f220788670b76164ac414ed9b16a422f719be267) )
ROM_LOAD32_BYTE( "mpr-14290-s.ic34", 0x000002, 0x100000, CRC(a144162d) SHA1(d43f12dd9f690cdfcebb6c7b515ff7dc7dcaa377) )
ROM_LOAD32_BYTE( "mpr-14289-s.ic29", 0x000001, 0x100000, CRC(38570582) SHA1(a9d810a02a1f5a6849c79d65fbebff21a4b82b59) )
ROM_LOAD32_BYTE( "mpr-14288-s.ic25", 0x000003, 0x100000, CRC(3188b636) SHA1(bc0adeeca5040caa563ee1e0eded9c323ca23446) )
- ROM_REGION32_BE( 0x800000, "gfx2", 0 ) /* sprites */
+ ROM_REGION32_BE( 0x800000, "mainpcb:gfx2", 0 ) /* sprites */
ROMX_LOAD( "mpr-14299-h.ic36", 0x000000, 0x100000, CRC(ce59231b) SHA1(bcb1f11b74935694d0617ec8df66db2cc57b6219) , ROM_SKIP(7) )
ROMX_LOAD( "mpr-14298-h.ic32", 0x000001, 0x100000, CRC(2745c84c) SHA1(5a0528c921cba7a1047d3a2ece79925103d719a1) , ROM_SKIP(7) )
ROMX_LOAD( "mpr-14297-h.ic27", 0x000002, 0x100000, CRC(29cb9450) SHA1(7dc38d23a2f0cee2f4edde05c1a6f0dc83f331db) , ROM_SKIP(7) )
@@ -4189,20 +4567,20 @@ ROM_END
not protected
*/
ROM_START( scross )
- ROM_REGION( 0x200000, "maincpu", 0 ) /* v60 code */
+ 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_REGION( 0x180000, "soundcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x180000, "mainpcb:soundcpu", 0 ) /* sound CPU */
ROM_LOAD_x4( "epr-15192.ic31", 0x100000, 0x20000, CRC(7524290b) SHA1(ee58be2c0c4293ee19622b96ca493f4ce4da0038) )
- ROM_REGION( 0x400000, "gfx1", 0 ) /* tiles */
+ ROM_REGION( 0x400000, "mainpcb:gfx1", 0 ) /* tiles */
ROM_LOAD16_BYTE( "mpr-15020.ic3", 0x000000, 0x100000, CRC(de47006a) SHA1(dbef7b9ff8c39992b8596d38985e65c627d6fa79) )
ROM_LOAD16_BYTE( "mpr-15021.ic11", 0x000001, 0x100000, CRC(3677db02) SHA1(7aeeb85f1632253fcdc8f7881512066e97837e5e) )
- ROM_REGION32_BE( 0x1000000, "gfx2", 0 ) /* sprites */
+ ROM_REGION32_BE( 0x1000000, "mainpcb:gfx2", 0 ) /* sprites */
ROMX_LOAD( "mpr-15022.ic14", 0x000000, 0x100000, CRC(baee6fd5) SHA1(ddf022c61f0805af45a84c65eb5d01006c153c07) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-15024.ic15", 0x000002, 0x100000, CRC(b9f339e2) SHA1(4b9a392459132a19d62928ef3939e1f2356e3994) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-15026.ic10", 0x000004, 0x100000, CRC(b72e8df6) SHA1(a7a87f79814b022985121e163c7f88244c50e427) , ROM_SKIP(6)|ROM_GROUPWORD )
@@ -4212,7 +4590,7 @@ ROM_START( scross )
ROMX_LOAD( "mpr-15027.ic18", 0x800004, 0x100000, CRC(b765efb8) SHA1(61f3865f92b36ca4b3cd20c0716a7121755eea73) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-15029.ic41", 0x800006, 0x100000, CRC(cf8e3b2b) SHA1(c158810d9d82b10a753bc739d1f56572042dac0b) , ROM_SKIP(6)|ROM_GROUPWORD )
- ROM_REGION( 0x400000, "sega", 0 ) /* Sega PCM sound data */
+ ROM_REGION( 0x400000, "mainpcb:sega", 0 ) /* Sega PCM sound data */
ROM_LOAD( "mpr-15031.ic1", 0x000000, 0x100000, CRC(6af139dc) SHA1(2378c2ad0c52c114eb93206a6fbee723c038d030) )
ROM_LOAD( "mpr-15032.ic2", 0x200000, 0x100000, CRC(915d6096) SHA1(e1f670949b1254f5a3c3131993ca9b3baa4d9f6b) )
@@ -4221,21 +4599,21 @@ ROM_START( scross )
ROM_END
ROM_START( scrossa )
- ROM_REGION( 0x200000, "maincpu", 0 ) /* v60 code */
+ 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( "mpr-15018.ic36", 0x100000, 0x080000, CRC(3a98385e) SHA1(8088d337655030c28e290da4bbf44cb647dab66c) )
ROM_LOAD32_WORD( "mpr-15019.ic39", 0x100002, 0x080000, CRC(8bf4ac83) SHA1(e594d9d9b42d0765ed8a20a40b7dd92b75124d34) )
- ROM_REGION( 0x180000, "soundcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x180000, "mainpcb:soundcpu", 0 ) /* sound CPU */
ROM_LOAD_x4( "epr-15192.ic31", 0x100000, 0x20000, CRC(7524290b) SHA1(ee58be2c0c4293ee19622b96ca493f4ce4da0038) )
- ROM_REGION( 0x400000, "gfx1", 0 ) /* tiles */
+ ROM_REGION( 0x400000, "mainpcb:gfx1", 0 ) /* tiles */
ROM_LOAD16_BYTE( "mpr-15020.ic3", 0x000000, 0x100000, CRC(de47006a) SHA1(dbef7b9ff8c39992b8596d38985e65c627d6fa79) )
ROM_LOAD16_BYTE( "mpr-15021.ic11", 0x000001, 0x100000, CRC(3677db02) SHA1(7aeeb85f1632253fcdc8f7881512066e97837e5e) )
- ROM_REGION32_BE( 0x1000000, "gfx2", 0 ) /* sprites */
+ ROM_REGION32_BE( 0x1000000, "mainpcb:gfx2", 0 ) /* sprites */
ROMX_LOAD( "mpr-15022.ic14", 0x000000, 0x100000, CRC(baee6fd5) SHA1(ddf022c61f0805af45a84c65eb5d01006c153c07) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-15024.ic15", 0x000002, 0x100000, CRC(b9f339e2) SHA1(4b9a392459132a19d62928ef3939e1f2356e3994) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-15026.ic10", 0x000004, 0x100000, CRC(b72e8df6) SHA1(a7a87f79814b022985121e163c7f88244c50e427) , ROM_SKIP(6)|ROM_GROUPWORD )
@@ -4245,7 +4623,7 @@ ROM_START( scrossa )
ROMX_LOAD( "mpr-15027.ic18", 0x800004, 0x100000, CRC(b765efb8) SHA1(61f3865f92b36ca4b3cd20c0716a7121755eea73) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-15029.ic41", 0x800006, 0x100000, CRC(cf8e3b2b) SHA1(c158810d9d82b10a753bc739d1f56572042dac0b) , ROM_SKIP(6)|ROM_GROUPWORD )
- ROM_REGION( 0x400000, "sega", 0 ) /* Sega PCM sound data */
+ ROM_REGION( 0x400000, "mainpcb:sega", 0 ) /* Sega PCM sound data */
ROM_LOAD( "mpr-15031.ic1", 0x000000, 0x100000, CRC(6af139dc) SHA1(2378c2ad0c52c114eb93206a6fbee723c038d030) )
ROM_LOAD( "mpr-15032.ic2", 0x200000, 0x100000, CRC(915d6096) SHA1(e1f670949b1254f5a3c3131993ca9b3baa4d9f6b) )
@@ -4259,20 +4637,20 @@ ROM_END
*/
ROM_START( scrossu )
- ROM_REGION( 0x200000, "maincpu", 0 ) /* v60 code */
+ ROM_REGION( 0x200000, "mainpcb:maincpu", 0 ) /* v60 code */
ROM_LOAD32_WORD_x2( "epr-15091.ic37", 0x000000, 0x040000, CRC(2c572293) SHA1(6377a6eb6084f7332ce6eeaaf0c37200da792d0c) )
ROM_LOAD32_WORD_x2( "epr-15092.ic40", 0x000002, 0x040000, CRC(6e3e175a) SHA1(feaca0720646e2a4b78b376e99dc86788adb98e7) )
ROM_LOAD32_WORD( "epr-15018.ic36", 0x100000, 0x080000, CRC(3a98385e) SHA1(8088d337655030c28e290da4bbf44cb647dab66c) )
ROM_LOAD32_WORD( "epr-15019.ic39", 0x100002, 0x080000, CRC(8bf4ac83) SHA1(e594d9d9b42d0765ed8a20a40b7dd92b75124d34) )
- ROM_REGION( 0x180000, "soundcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x180000, "mainpcb:soundcpu", 0 ) /* sound CPU */
ROM_LOAD_x4( "epr-15192.ic31", 0x100000, 0x20000, CRC(7524290b) SHA1(ee58be2c0c4293ee19622b96ca493f4ce4da0038) )
- ROM_REGION( 0x400000, "gfx1", 0 ) /* tiles */
+ ROM_REGION( 0x400000, "mainpcb:gfx1", 0 ) /* tiles */
ROM_LOAD16_BYTE( "mpr-15020.ic3", 0x000000, 0x100000, CRC(de47006a) SHA1(dbef7b9ff8c39992b8596d38985e65c627d6fa79) )
ROM_LOAD16_BYTE( "mpr-15021.ic11", 0x000001, 0x100000, CRC(3677db02) SHA1(7aeeb85f1632253fcdc8f7881512066e97837e5e) )
- ROM_REGION32_BE( 0x1000000, "gfx2", 0 ) /* sprites */
+ ROM_REGION32_BE( 0x1000000, "mainpcb:gfx2", 0 ) /* sprites */
ROMX_LOAD( "mpr-15022.ic14", 0x000000, 0x100000, CRC(baee6fd5) SHA1(ddf022c61f0805af45a84c65eb5d01006c153c07) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-15024.ic15", 0x000002, 0x100000, CRC(b9f339e2) SHA1(4b9a392459132a19d62928ef3939e1f2356e3994) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-15026.ic10", 0x000004, 0x100000, CRC(b72e8df6) SHA1(a7a87f79814b022985121e163c7f88244c50e427) , ROM_SKIP(6)|ROM_GROUPWORD )
@@ -4282,7 +4660,7 @@ ROM_START( scrossu )
ROMX_LOAD( "mpr-15027.ic18", 0x800004, 0x100000, CRC(b765efb8) SHA1(61f3865f92b36ca4b3cd20c0716a7121755eea73) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-15029.ic41", 0x800006, 0x100000, CRC(cf8e3b2b) SHA1(c158810d9d82b10a753bc739d1f56572042dac0b) , ROM_SKIP(6)|ROM_GROUPWORD )
- ROM_REGION( 0x400000, "sega", 0 ) /* Sega PCM sound data */
+ ROM_REGION( 0x400000, "mainpcb:sega", 0 ) /* Sega PCM sound data */
ROM_LOAD( "mpr-15031.ic1", 0x000000, 0x100000, CRC(6af139dc) SHA1(2378c2ad0c52c114eb93206a6fbee723c038d030) )
ROM_LOAD( "mpr-15032.ic2", 0x200000, 0x100000, CRC(915d6096) SHA1(e1f670949b1254f5a3c3131993ca9b3baa4d9f6b) )
ROM_END
@@ -4295,23 +4673,23 @@ ROM_END
protected via FD1149 317-0222
*/
ROM_START( svf )
- ROM_REGION( 0x200000, "maincpu", 0 ) /* v60 code + data */
+ ROM_REGION( 0x200000, "mainpcb:maincpu", 0 ) /* v60 code + data */
ROM_LOAD_x4( "epr-16872a.ic17", 0x000000, 0x020000, CRC(1f383b00) SHA1(c3af01743de5ff09ada19879902842efdbceb595) )
ROM_LOAD_x4( "epr-16871a.ic8", 0x080000, 0x020000, CRC(f7061bd7) SHA1(b46f4f2ecda8f521c0a91f2f2c2445b72cbc2874) )
ROM_LOAD16_BYTE( "epr-16865.ic18", 0x100000, 0x080000, CRC(9198ca9f) SHA1(0f6271ce8a07e4ab7fdce38964055510f2ebfd4e) )
ROM_LOAD16_BYTE( "epr-16864.ic9", 0x100001, 0x080000, CRC(201a940e) SHA1(e19d76141844dbdedee0698ea50edbb898ab55e9) )
- ROM_REGION( 0x500000, "soundcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x500000, "mainpcb:soundcpu", 0 ) /* sound CPU */
ROM_LOAD_x8( "epr-16866.ic36", 0x100000, 0x020000, CRC(74431350) SHA1(d3208b595423b5b0f25ee90db213112a09906f8f) )
ROM_LOAD( "mpr-16779.ic35", 0x200000, 0x100000, CRC(7055e859) SHA1(cde27fa4aaf0ee54063ee68794e9a6075581fff5) )
ROM_LOAD( "mpr-16778.ic34", 0x300000, 0x100000, CRC(feedaecf) SHA1(25c14ccb85c467dc0c8e85b61f8f86f4396c0cc7) )
ROM_LOAD( "mpr-16777.ic24", 0x400000, 0x100000, CRC(14b5d5df) SHA1(1b0b0a31294b1bbc16d2046b374d584a1b00a78c) )
- ROM_REGION( 0x200000, "gfx1", 0 ) /* tiles */
+ ROM_REGION( 0x200000, "mainpcb:gfx1", 0 ) /* tiles */
ROM_LOAD16_BYTE( "mpr-16784.ic14", 0x000000, 0x100000, CRC(4608efe2) SHA1(9b41aa28f50af770e854ef9fdff1a55da7b7b131) )
ROM_LOAD16_BYTE( "mpr-16783.ic5", 0x000001, 0x100000, CRC(042eabe7) SHA1(a11df5c21d85f0c96dbdcaf57be37a79658ad648) )
- ROM_REGION32_BE( 0x1000000, "gfx2", 0 ) /* sprites */
+ ROM_REGION32_BE( 0x1000000, "mainpcb:gfx2", 0 ) /* sprites */
ROMX_LOAD( "mpr-16785.ic32", 0x000000, 0x200000, CRC(51f775ce) SHA1(125b40bf47304d37b92e81df5081c81d9af6c8a2) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-16787.ic30", 0x000002, 0x200000, CRC(dee7a204) SHA1(29acff4d5dd68609ac46853860788206d18262ab) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-16789.ic28", 0x000004, 0x200000, CRC(6b6c8ad3) SHA1(97b0078c851845c31dcf0fe4b2a88393dcdf8988) , ROM_SKIP(6)|ROM_GROUPWORD )
@@ -4327,23 +4705,23 @@ ROM_END
protected via FD1149 317-0222
*/
ROM_START( svs )
- ROM_REGION( 0x200000, "maincpu", 0 ) /* v60 code + data */
+ ROM_REGION( 0x200000, "mainpcb:maincpu", 0 ) /* v60 code + data */
ROM_LOAD_x4( "epr-16883a.ic17", 0x000000, 0x020000, CRC(e1c0c3ce) SHA1(12dd8d9d1a2c2c7bf1ab652a6a6f947384d79577) )
ROM_LOAD_x4( "epr-16882a.ic8", 0x080000, 0x020000, CRC(1161bbbe) SHA1(3cfeed9ea947eed79aeb5674d54de45d15fb6e1f) )
ROM_LOAD16_BYTE( "epr-16865.ic18", 0x100000, 0x080000, CRC(9198ca9f) SHA1(0f6271ce8a07e4ab7fdce38964055510f2ebfd4e) )
ROM_LOAD16_BYTE( "epr-16864.ic9", 0x100001, 0x080000, CRC(201a940e) SHA1(e19d76141844dbdedee0698ea50edbb898ab55e9) )
- ROM_REGION( 0x500000, "soundcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x500000, "mainpcb:soundcpu", 0 ) /* sound CPU */
ROM_LOAD_x4( "epr-16868.ic36", 0x100000, 0x040000, CRC(47aa4ec7) SHA1(baea18aaac0314f769f1e36fdbe8aedf62862544) ) /* same as jleague but with a different part number */
ROM_LOAD( "mpr-16779.ic35", 0x200000, 0x100000, CRC(7055e859) SHA1(cde27fa4aaf0ee54063ee68794e9a6075581fff5) )
ROM_LOAD( "mpr-16778.ic34", 0x300000, 0x100000, CRC(feedaecf) SHA1(25c14ccb85c467dc0c8e85b61f8f86f4396c0cc7) )
ROM_LOAD( "mpr-16777.ic24", 0x400000, 0x100000, CRC(14b5d5df) SHA1(1b0b0a31294b1bbc16d2046b374d584a1b00a78c) )
- ROM_REGION( 0x200000, "gfx1", 0 ) /* tiles */
+ ROM_REGION( 0x200000, "mainpcb:gfx1", 0 ) /* tiles */
ROM_LOAD16_BYTE( "mpr-16784.ic14", 0x000000, 0x100000, CRC(4608efe2) SHA1(9b41aa28f50af770e854ef9fdff1a55da7b7b131) )
ROM_LOAD16_BYTE( "mpr-16783.ic5", 0x000001, 0x100000, CRC(042eabe7) SHA1(a11df5c21d85f0c96dbdcaf57be37a79658ad648) )
- ROM_REGION32_BE( 0x1000000, "gfx2", 0 ) /* sprites */
+ ROM_REGION32_BE( 0x1000000, "mainpcb:gfx2", 0 ) /* sprites */
ROMX_LOAD( "mpr-16785.ic32", 0x000000, 0x200000, CRC(51f775ce) SHA1(125b40bf47304d37b92e81df5081c81d9af6c8a2) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-16787.ic30", 0x000002, 0x200000, CRC(dee7a204) SHA1(29acff4d5dd68609ac46853860788206d18262ab) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-16789.ic28", 0x000004, 0x200000, CRC(6b6c8ad3) SHA1(97b0078c851845c31dcf0fe4b2a88393dcdf8988) , ROM_SKIP(6)|ROM_GROUPWORD )
@@ -4363,23 +4741,23 @@ ROM_END
*/
ROM_START( jleague )
- ROM_REGION( 0x200000, "maincpu", 0 ) /* v60 code + data */
+ ROM_REGION( 0x200000, "mainpcb:maincpu", 0 ) /* v60 code + data */
ROM_LOAD_x4( "epr-16782.ic17", 0x000000, 0x020000, CRC(f0278944) SHA1(49e3842231ee5abdd6205b598309153d6b4ddc02) )
ROM_LOAD_x4( "epr-16781.ic8", 0x080000, 0x020000, CRC(7df9529b) SHA1(de3633f4941ff3877c4cb8b53e080eccea19f22e) )
ROM_LOAD16_BYTE( "epr-16776.ic18", 0x100000, 0x080000, CRC(e8694626) SHA1(d4318a9a6b1cc5c719bff9c25b7398dd2ea1e18b) )
ROM_LOAD16_BYTE( "epr-16775.ic9", 0x100001, 0x080000, CRC(e81e2c3d) SHA1(2900710f1dec6cf71875c82a56584ba45ed3a545) )
- ROM_REGION( 0x500000, "soundcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x500000, "mainpcb:soundcpu", 0 ) /* sound CPU */
ROM_LOAD_x4( "epr-16780.ic36", 0x100000, 0x040000, CRC(47aa4ec7) SHA1(baea18aaac0314f769f1e36fdbe8aedf62862544) )
ROM_LOAD( "mpr-16779.ic35", 0x200000, 0x100000, CRC(7055e859) SHA1(cde27fa4aaf0ee54063ee68794e9a6075581fff5) )
ROM_LOAD( "mpr-16778.ic34", 0x300000, 0x100000, CRC(feedaecf) SHA1(25c14ccb85c467dc0c8e85b61f8f86f4396c0cc7) )
ROM_LOAD( "mpr-16777.ic24", 0x400000, 0x100000, CRC(14b5d5df) SHA1(1b0b0a31294b1bbc16d2046b374d584a1b00a78c) )
- ROM_REGION( 0x200000, "gfx1", 0 ) /* tiles */
+ ROM_REGION( 0x200000, "mainpcb:gfx1", 0 ) /* tiles */
ROM_LOAD16_BYTE( "mpr-16784.ic14", 0x000000, 0x100000, CRC(4608efe2) SHA1(9b41aa28f50af770e854ef9fdff1a55da7b7b131) )
ROM_LOAD16_BYTE( "mpr-16783.ic5", 0x000001, 0x100000, CRC(042eabe7) SHA1(a11df5c21d85f0c96dbdcaf57be37a79658ad648) )
- ROM_REGION32_BE( 0x1000000, "gfx2", 0 ) /* sprites */
+ ROM_REGION32_BE( 0x1000000, "mainpcb:gfx2", 0 ) /* sprites */
ROMX_LOAD( "mpr-16785.ic32", 0x000000, 0x200000, CRC(51f775ce) SHA1(125b40bf47304d37b92e81df5081c81d9af6c8a2) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-16787.ic30", 0x000002, 0x200000, CRC(dee7a204) SHA1(29acff4d5dd68609ac46853860788206d18262ab) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-16789.ic28", 0x000004, 0x200000, CRC(6b6c8ad3) SHA1(97b0078c851845c31dcf0fe4b2a88393dcdf8988) , ROM_SKIP(6)|ROM_GROUPWORD )
@@ -4404,18 +4782,18 @@ Rom board: 834-9413-02
*/
ROM_START( titlef )
- ROM_REGION( 0x200000, "maincpu", 0 ) /* v60 code */
+ ROM_REGION( 0x200000, "mainpcb:maincpu", 0 ) /* v60 code */
ROM_LOAD32_WORD_x2( "epr-15388.ic37", 0x000000, 0x40000, CRC(db1eefbd) SHA1(7059a1d5c9364d836c1d922071a108cbde661e0a) )
ROM_LOAD32_WORD_x2( "epr-15389.ic40", 0x000002, 0x40000, CRC(da9f60a3) SHA1(87a7bea04e51e3c241871e83ff7322c6a07bd106) )
- ROM_REGION( 0x180000, "soundcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x180000, "mainpcb:soundcpu", 0 ) /* sound CPU */
ROM_LOAD_x4( "epr-15384.ic31", 0x100000, 0x20000, CRC(0f7d208d) SHA1(5425120480f813210fae28951e8bfd5acb08ca53) )
- ROM_REGION( 0x400000, "gfx1", 0 ) /* tiles */
+ ROM_REGION( 0x400000, "mainpcb:gfx1", 0 ) /* tiles */
ROM_LOAD16_BYTE( "mpr-15381.ic3", 0x000000, 0x200000, CRC(162cc4d6) SHA1(2369d3d76ab5ef8f033aa45530ab957f0e5ff028) )
ROM_LOAD16_BYTE( "mpr-15382.ic11", 0x000001, 0x200000, CRC(fd03a130) SHA1(040c36383ef5d8298af714958cd5b0a4c7556ae7) )
- ROM_REGION32_BE( 0x1000000, "gfx2", 0 ) /* sprites */
+ ROM_REGION32_BE( 0x1000000, "mainpcb:gfx2", 0 ) /* sprites */
ROMX_LOAD( "mpr-15379.ic14", 0x000000, 0x200000, CRC(e5c74b11) SHA1(67e4460efe5dcd88ffc12024b255efc843e6a8b5) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-15375.ic15", 0x000002, 0x200000, CRC(046a9b50) SHA1(2b4c53f2a0264835cb7197daa9b3461c212541e8) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-15371.ic10", 0x000004, 0x200000, CRC(999046c6) SHA1(37ce4e8aaf537b5366eacabaf36e4477b5624121) , ROM_SKIP(6)|ROM_GROUPWORD )
@@ -4425,7 +4803,7 @@ ROM_START( titlef )
ROMX_LOAD( "mpr-15372.ic18", 0x800004, 0x200000, CRC(c187c36a) SHA1(bb55c2a768a43ef19a7847a4aa113523fee26c20) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-15374.ic41", 0x800006, 0x200000, CRC(e026aab0) SHA1(75dfaef6d50c3d1d7f27aa5e44fcbc0ff2173c6f) , ROM_SKIP(6)|ROM_GROUPWORD )
- ROM_REGION( 0x400000, "sega", 0 ) /* Sega PCM sound data */
+ ROM_REGION( 0x400000, "mainpcb:sega", 0 ) /* Sega PCM sound data */
ROM_LOAD( "mpr-15385.ic1", 0x000000, 0x200000, CRC(5a9b0aa0) SHA1(d208aa165f9eea05e3b8c3f406ff44374e4f6887) )
ROM_END
@@ -4440,18 +4818,18 @@ Rom board: 834-9413-01
*/
ROM_START( titlefu )
- ROM_REGION( 0x200000, "maincpu", 0 ) /* v60 code */
+ ROM_REGION( 0x200000, "mainpcb:maincpu", 0 ) /* v60 code */
ROM_LOAD32_WORD_x4( "epr-15386.ic37", 0x000000, 0x40000, CRC(e36e2516) SHA1(b6a73d6136ff8a13831b6db0fbc8a585f2acf254) )
ROM_LOAD32_WORD_x4( "epr-15387.ic40", 0x000002, 0x40000, CRC(e63406d3) SHA1(cd105862b2267d1d3af588cda70e6e4c1cca1da2) )
- ROM_REGION( 0x180000, "soundcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x180000, "mainpcb:soundcpu", 0 ) /* sound CPU */
ROM_LOAD_x4( "epr-15384.ic31", 0x100000, 0x20000, CRC(0f7d208d) SHA1(5425120480f813210fae28951e8bfd5acb08ca53) )
- ROM_REGION( 0x400000, "gfx1", 0 ) /* tiles */
+ ROM_REGION( 0x400000, "mainpcb:gfx1", 0 ) /* tiles */
ROM_LOAD16_BYTE( "mpr-15381.ic3", 0x000000, 0x200000, CRC(162cc4d6) SHA1(2369d3d76ab5ef8f033aa45530ab957f0e5ff028) )
ROM_LOAD16_BYTE( "mpr-15382.ic11", 0x000001, 0x200000, CRC(fd03a130) SHA1(040c36383ef5d8298af714958cd5b0a4c7556ae7) )
- ROM_REGION32_BE( 0x1000000, "gfx2", 0 ) /* sprites */
+ ROM_REGION32_BE( 0x1000000, "mainpcb:gfx2", 0 ) /* sprites */
ROMX_LOAD( "mpr-15379.ic14", 0x000000, 0x200000, CRC(e5c74b11) SHA1(67e4460efe5dcd88ffc12024b255efc843e6a8b5) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-15375.ic15", 0x000002, 0x200000, CRC(046a9b50) SHA1(2b4c53f2a0264835cb7197daa9b3461c212541e8) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-15371.ic10", 0x000004, 0x200000, CRC(999046c6) SHA1(37ce4e8aaf537b5366eacabaf36e4477b5624121) , ROM_SKIP(6)|ROM_GROUPWORD )
@@ -4461,7 +4839,7 @@ ROM_START( titlefu )
ROMX_LOAD( "mpr-15372.ic18", 0x800004, 0x200000, CRC(c187c36a) SHA1(bb55c2a768a43ef19a7847a4aa113523fee26c20) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-15374.ic41", 0x800006, 0x200000, CRC(e026aab0) SHA1(75dfaef6d50c3d1d7f27aa5e44fcbc0ff2173c6f) , ROM_SKIP(6)|ROM_GROUPWORD )
- ROM_REGION( 0x400000, "sega", 0 ) /* Sega PCM sound data */
+ ROM_REGION( 0x400000, "mainpcb:sega", 0 ) /* Sega PCM sound data */
ROM_LOAD( "mpr-15385.ic1", 0x000000, 0x200000, CRC(5a9b0aa0) SHA1(d208aa165f9eea05e3b8c3f406ff44374e4f6887) )
ROM_END
@@ -4476,18 +4854,18 @@ Rom board: 834-9413-03
*/
ROM_START( titlefj )
- ROM_REGION( 0x200000, "maincpu", 0 ) /* v60 code */
+ ROM_REGION( 0x200000, "mainpcb:maincpu", 0 ) /* v60 code */
ROM_LOAD32_WORD_x4( "epr-15377.ic37", 0x000000, 0x40000, CRC(1868403c) SHA1(d34a3a05e5a3bb2e6159f95d1e22d264bf553cda) )
ROM_LOAD32_WORD_x4( "epr-15378.ic40", 0x000002, 0x40000, CRC(44487b0a) SHA1(4aefd063bf148334d5f43d69f497766d50ffca30) )
- ROM_REGION( 0x180000, "soundcpu", 0 ) /* sound CPU */
+ ROM_REGION( 0x180000, "mainpcb:soundcpu", 0 ) /* sound CPU */
ROM_LOAD_x4( "epr-15384.ic31", 0x100000, 0x20000, CRC(0f7d208d) SHA1(5425120480f813210fae28951e8bfd5acb08ca53) )
- ROM_REGION( 0x400000, "gfx1", 0 ) /* tiles */
+ ROM_REGION( 0x400000, "mainpcb:gfx1", 0 ) /* tiles */
ROM_LOAD16_BYTE( "mpr-15381.ic3", 0x000000, 0x200000, CRC(162cc4d6) SHA1(2369d3d76ab5ef8f033aa45530ab957f0e5ff028) )
ROM_LOAD16_BYTE( "mpr-15382.ic11", 0x000001, 0x200000, CRC(fd03a130) SHA1(040c36383ef5d8298af714958cd5b0a4c7556ae7) )
- ROM_REGION32_BE( 0x1000000, "gfx2", 0 ) /* sprites */
+ ROM_REGION32_BE( 0x1000000, "mainpcb:gfx2", 0 ) /* sprites */
ROMX_LOAD( "mpr-15379.ic14", 0x000000, 0x200000, CRC(e5c74b11) SHA1(67e4460efe5dcd88ffc12024b255efc843e6a8b5) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-15375.ic15", 0x000002, 0x200000, CRC(046a9b50) SHA1(2b4c53f2a0264835cb7197daa9b3461c212541e8) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-15371.ic10", 0x000004, 0x200000, CRC(999046c6) SHA1(37ce4e8aaf537b5366eacabaf36e4477b5624121) , ROM_SKIP(6)|ROM_GROUPWORD )
@@ -4497,7 +4875,7 @@ ROM_START( titlefj )
ROMX_LOAD( "mpr-15372.ic18", 0x800004, 0x200000, CRC(c187c36a) SHA1(bb55c2a768a43ef19a7847a4aa113523fee26c20) , ROM_SKIP(6)|ROM_GROUPWORD )
ROMX_LOAD( "mpr-15374.ic41", 0x800006, 0x200000, CRC(e026aab0) SHA1(75dfaef6d50c3d1d7f27aa5e44fcbc0ff2173c6f) , ROM_SKIP(6)|ROM_GROUPWORD )
- ROM_REGION( 0x400000, "sega", 0 ) /* Sega PCM sound data */
+ ROM_REGION( 0x400000, "mainpcb:sega", 0 ) /* Sega PCM sound data */
ROM_LOAD( "mpr-15385.ic1", 0x000000, 0x200000, CRC(5a9b0aa0) SHA1(d208aa165f9eea05e3b8c3f406ff44374e4f6887) )
ROM_END
@@ -4703,39 +5081,107 @@ void segas32_state::scross_sw2_output( int which, UINT16 data )
*
*************************************/
-DRIVER_INIT_MEMBER(segas32_state,alien3)
+WRITE16_MEMBER(segas32_new_state::dual_pcb_comms_w)
{
- segas32_common_init(read16_delegate(FUNC(segas32_state::analog_custom_io_r),this), write16_delegate(FUNC(segas32_state::analog_custom_io_w),this));
- m_sw1_output = &segas32_state::alien3_sw1_output;
+ COMBINE_DATA(&m_dual_pcb_comms[offset]);
+}
+
+READ16_MEMBER(segas32_new_state::dual_pcb_comms_r)
+{
+ return m_dual_pcb_comms[offset];
}
-READ16_MEMBER(segas32_state::arescue_handshake_r)
+
+/* There must be something on the comms board for this?
+ Probably not a dip/solder link/trace cut, but maybe
+ just whichever way the cables are plugged in?
+ Both f1en and arescue master units try to set bit 1... */
+READ16_MEMBER(segas32_new_state::dual_pcb_masterslave)
{
- return 0;
+ return 0; // 0/1 master/slave
}
-READ16_MEMBER(segas32_state::arescue_slavebusy_r)
+READ16_MEMBER(segas32_new_state::dual_pcb_slave)
{
- return 0x100; // prevents master trying to synch to slave.
+ return 1; // 0/1 master/slave
}
-DRIVER_INIT_MEMBER(segas32_state,arescue)
+
+
+
+DRIVER_INIT_MEMBER(segas32_new_state,titlef) { m_mainpcb->init_titlef(); }
+DRIVER_INIT_MEMBER(segas32_new_state,slipstrm) { m_mainpcb->init_slipstrm(); }
+DRIVER_INIT_MEMBER(segas32_new_state,radm) { m_mainpcb->init_radm(); }
+DRIVER_INIT_MEMBER(segas32_new_state,holo) { m_mainpcb->init_holo(); }
+DRIVER_INIT_MEMBER(segas32_new_state,svf) { m_mainpcb->init_svf(); }
+DRIVER_INIT_MEMBER(segas32_new_state,jleague) { m_mainpcb->init_jleague(); }
+DRIVER_INIT_MEMBER(segas32_new_state,jpark) { m_mainpcb->init_jpark(); }
+DRIVER_INIT_MEMBER(segas32_new_state,ga2) { m_mainpcb->init_ga2(); }
+DRIVER_INIT_MEMBER(segas32_new_state,scross) { m_mainpcb->init_scross(); }
+DRIVER_INIT_MEMBER(segas32_new_state,spidman) { m_mainpcb->init_spidman(); }
+DRIVER_INIT_MEMBER(segas32_new_state,sonicp) { m_mainpcb->init_sonicp(); }
+DRIVER_INIT_MEMBER(segas32_new_state,dbzvrvs) { m_mainpcb->init_dbzvrvs(); }
+DRIVER_INIT_MEMBER(segas32_new_state,brival) { m_mainpcb->init_brival(); }
+DRIVER_INIT_MEMBER(segas32_new_state,harddunk) { m_mainpcb->init_harddunk(); }
+DRIVER_INIT_MEMBER(segas32_new_state,arabfgt) { m_mainpcb->init_arabfgt(); }
+DRIVER_INIT_MEMBER(segas32_new_state,sonic) { m_mainpcb->init_sonic(); }
+DRIVER_INIT_MEMBER(segas32_new_state,alien3) { m_mainpcb->init_alien3(); }
+DRIVER_INIT_MEMBER(segas32_new_state,darkedge) { m_mainpcb->init_darkedge(); }
+DRIVER_INIT_MEMBER(segas32_new_state,radr) { m_mainpcb->init_radr(); }
+DRIVER_INIT_MEMBER(segas32_new_state,orunners) { m_mainpcb->init_orunners(); }
+
+DRIVER_INIT_MEMBER(segas32_new_state, arescue)
{
- segas32_common_init(read16_delegate(FUNC(segas32_state::analog_custom_io_r),this), write16_delegate(FUNC(segas32_state::analog_custom_io_w),this));
- m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xa00000, 0xa00007, read16_delegate(FUNC(segas32_state::arescue_dsp_r),this), write16_delegate(FUNC(segas32_state::arescue_dsp_w),this));
+ m_mainpcb->init_arescue(1);
+ m_slavepcb->init_arescue(0);
+
+ m_dual_pcb_comms = auto_alloc_array(machine(), UINT16, 0x1000/2);
+ m_mainpcb->m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x810000, 0x810fff, read16_delegate(FUNC(segas32_new_state::dual_pcb_comms_r),this), write16_delegate(FUNC(segas32_new_state::dual_pcb_comms_w),this));
+ m_mainpcb->m_maincpu->space(AS_PROGRAM).install_read_handler(0x818000, 0x818003, read16_delegate(FUNC(segas32_new_state::dual_pcb_masterslave),this));
+
+ m_slavepcb->m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x810000, 0x810fff, read16_delegate(FUNC(segas32_new_state::dual_pcb_comms_r),this), write16_delegate(FUNC(segas32_new_state::dual_pcb_comms_w),this));
+ m_slavepcb->m_maincpu->space(AS_PROGRAM).install_read_handler(0x818000, 0x818003, read16_delegate(FUNC(segas32_new_state::dual_pcb_slave),this));
+}
+
+DRIVER_INIT_MEMBER(segas32_new_state,f1en) {
+ m_mainpcb->init_f1en();
+ m_slavepcb->init_f1en();
m_dual_pcb_comms = auto_alloc_array(machine(), UINT16, 0x1000/2);
- m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x810000, 0x810fff, read16_delegate(FUNC(segas32_state::dual_pcb_comms_r),this), write16_delegate(FUNC(segas32_state::dual_pcb_comms_w),this));
- m_maincpu->space(AS_PROGRAM).install_read_handler(0x818000, 0x818003, read16_delegate(FUNC(segas32_state::dual_pcb_masterslave),this));
+ memset(m_dual_pcb_comms, 0xff, 0x1000 / 2);
+
+ m_mainpcb->m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x810000, 0x810fff, read16_delegate(FUNC(segas32_new_state::dual_pcb_comms_r),this), write16_delegate(FUNC(segas32_new_state::dual_pcb_comms_w),this));
+ m_mainpcb->m_maincpu->space(AS_PROGRAM).install_read_handler(0x818000, 0x818003, read16_delegate(FUNC(segas32_new_state::dual_pcb_masterslave),this));
+
+ m_slavepcb->m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x810000, 0x810fff, read16_delegate(FUNC(segas32_new_state::dual_pcb_comms_r),this), write16_delegate(FUNC(segas32_new_state::dual_pcb_comms_w),this));
+ m_slavepcb->m_maincpu->space(AS_PROGRAM).install_read_handler(0x818000, 0x818003, read16_delegate(FUNC(segas32_new_state::dual_pcb_slave),this));
+}
+
+DRIVER_INIT_MEMBER(segas32_new_state,f1lap)
+{
+ m_mainpcb->init_f1lap();
+}
- m_maincpu->space(AS_PROGRAM).install_read_handler(0x810000, 0x810001, read16_delegate(FUNC(segas32_state::arescue_handshake_r),this));
- m_maincpu->space(AS_PROGRAM).install_read_handler(0x81000e, 0x81000f, read16_delegate(FUNC(segas32_state::arescue_slavebusy_r),this));
+
+void segas32_state::init_alien3(void)
+{
+ segas32_common_init(read16_delegate(FUNC(segas32_state::analog_custom_io_r), this), write16_delegate(FUNC(segas32_state::analog_custom_io_w), this));
+ m_sw1_output = &segas32_state::alien3_sw1_output;
+}
+
+void segas32_state::init_arescue(int m_hasdsp)
+{
+ segas32_common_init(read16_delegate(FUNC(segas32_state::analog_custom_io_r),this), write16_delegate(FUNC(segas32_state::analog_custom_io_w),this));
+ if (m_hasdsp) m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xa00000, 0xa00007, read16_delegate(FUNC(segas32_state::arescue_dsp_r),this), write16_delegate(FUNC(segas32_state::arescue_dsp_w),this));
+
+ for (int i = 0; i < 6; i++)
+ m_arescue_dsp_io[i] = 0x00;
m_sw1_output = &segas32_state::arescue_sw1_output;
}
-DRIVER_INIT_MEMBER(segas32_state,arabfgt)
+void segas32_state::init_arabfgt(void)
{
segas32_common_init(read16_delegate(FUNC(segas32_state::extra_custom_io_r),this), write16_delegate());
@@ -4745,7 +5191,7 @@ DRIVER_INIT_MEMBER(segas32_state,arabfgt)
}
-DRIVER_INIT_MEMBER(segas32_state,brival)
+void segas32_state::init_brival(void)
{
segas32_common_init(read16_delegate(FUNC(segas32_state::extra_custom_io_r),this), write16_delegate());
@@ -4756,7 +5202,7 @@ DRIVER_INIT_MEMBER(segas32_state,brival)
}
-DRIVER_INIT_MEMBER(segas32_state,darkedge)
+void segas32_state::init_darkedge(void)
{
segas32_common_init(read16_delegate(FUNC(segas32_state::extra_custom_io_r),this), write16_delegate());
@@ -4765,7 +5211,7 @@ DRIVER_INIT_MEMBER(segas32_state,darkedge)
m_system32_prot_vblank = &segas32_state::darkedge_fd1149_vblank;
}
-DRIVER_INIT_MEMBER(segas32_state,dbzvrvs)
+void segas32_state::init_dbzvrvs(void)
{
segas32_common_init(read16_delegate(), write16_delegate());
@@ -4773,24 +5219,11 @@ DRIVER_INIT_MEMBER(segas32_state,dbzvrvs)
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xa00000, 0xa7ffff, read16_delegate(FUNC(segas32_state::dbzvrvs_protection_r),this), write16_delegate(FUNC(segas32_state::dbzvrvs_protection_w),this));
}
-WRITE16_MEMBER(segas32_state::f1en_comms_echo_w)
-{
- // pretend that slave is following master op, enables attract mode video with sound
- if (ACCESSING_BITS_0_7)
- space.write_byte( 0x810049, data );
-}
-DRIVER_INIT_MEMBER(segas32_state,f1en)
+void segas32_state::init_f1en(void)
{
segas32_common_init(read16_delegate(FUNC(segas32_state::analog_custom_io_r),this), write16_delegate(FUNC(segas32_state::analog_custom_io_w),this));
- m_dual_pcb_comms = auto_alloc_array(machine(), UINT16, 0x1000/2);
- memset(m_dual_pcb_comms, 0xff, 0x1000 / 2);
-
- m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x810000, 0x810fff, read16_delegate(FUNC(segas32_state::dual_pcb_comms_r),this), write16_delegate(FUNC(segas32_state::dual_pcb_comms_w),this));
- m_maincpu->space(AS_PROGRAM).install_read_handler(0x818000, 0x818003, read16_delegate(FUNC(segas32_state::dual_pcb_masterslave),this));
-
- m_maincpu->space(AS_PROGRAM).install_write_handler(0x810048, 0x810049, write16_delegate(FUNC(segas32_state::f1en_comms_echo_w),this));
m_sw1_output = &segas32_state::radm_sw1_output;
}
@@ -4798,22 +5231,18 @@ DRIVER_INIT_MEMBER(segas32_state,f1en)
-DRIVER_INIT_MEMBER(segas32_state,f1lap)
+void segas32_state::init_f1lap(void)
{
segas32_common_init(read16_delegate(FUNC(segas32_state::analog_custom_io_r),this), write16_delegate(FUNC(segas32_state::analog_custom_io_w),this));
-
- m_dual_pcb_comms = auto_alloc_array(machine(), UINT16, 0x1000/2);
- m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x800000, 0x800fff, read16_delegate(FUNC(segas32_state::dual_pcb_comms_r),this), write16_delegate(FUNC(segas32_state::dual_pcb_comms_w),this));
- m_maincpu->space(AS_PROGRAM).install_read_handler(0x801000, 0x801003, read16_delegate(FUNC(segas32_state::dual_pcb_masterslave),this));
-
-// m_maincpu->space(AS_PROGRAM).install_write_handler(0x800048, 0x800049, write16_delegate(FUNC(segas32_state::f1en_comms_echo_w),this));
m_system32_prot_vblank = &segas32_state::f1lap_fd1149_vblank;
m_sw1_output = &segas32_state::f1lap_sw1_output;
+
+ m_s32comm->set_linktype(15612); // EPR-15612
}
-DRIVER_INIT_MEMBER(segas32_state,ga2)
+void segas32_state::init_ga2(void)
{
segas32_common_init(read16_delegate(FUNC(segas32_state::extra_custom_io_r),this), write16_delegate());
@@ -4822,7 +5251,7 @@ DRIVER_INIT_MEMBER(segas32_state,ga2)
}
-DRIVER_INIT_MEMBER(segas32_state,harddunk)
+void segas32_state::init_harddunk(void)
{
segas32_common_init(read16_delegate(FUNC(segas32_state::extra_custom_io_r),this), write16_delegate());
m_sw1_output = &segas32_state::harddunk_sw1_output;
@@ -4831,13 +5260,13 @@ DRIVER_INIT_MEMBER(segas32_state,harddunk)
}
-DRIVER_INIT_MEMBER(segas32_state,holo)
+void segas32_state::init_holo(void)
{
segas32_common_init(read16_delegate(), write16_delegate());
}
-DRIVER_INIT_MEMBER(segas32_state,jpark)
+void segas32_state::init_jpark(void)
{
/* Temp. Patch until we emulate the 'Drive Board', thanks to Malice */
UINT16 *pROM = (UINT16 *)memregion("maincpu")->base();
@@ -4851,15 +5280,17 @@ DRIVER_INIT_MEMBER(segas32_state,jpark)
}
-DRIVER_INIT_MEMBER(segas32_state,orunners)
+void segas32_state::init_orunners(void)
{
segas32_common_init(read16_delegate(FUNC(segas32_state::analog_custom_io_r),this), write16_delegate(FUNC(segas32_state::orunners_custom_io_w),this));
m_sw1_output = &segas32_state::orunners_sw1_output;
m_sw2_output = &segas32_state::orunners_sw2_output;
+
+ m_s32comm->set_linktype(15033); // EPR-15033
}
-DRIVER_INIT_MEMBER(segas32_state,radm)
+void segas32_state::init_radm(void)
{
segas32_common_init(read16_delegate(FUNC(segas32_state::analog_custom_io_r),this), write16_delegate(FUNC(segas32_state::analog_custom_io_w),this));
m_sw1_output = &segas32_state::radm_sw1_output;
@@ -4867,31 +5298,35 @@ DRIVER_INIT_MEMBER(segas32_state,radm)
}
-DRIVER_INIT_MEMBER(segas32_state,radr)
+void segas32_state::init_radr(void)
{
segas32_common_init(read16_delegate(FUNC(segas32_state::analog_custom_io_r),this), write16_delegate(FUNC(segas32_state::analog_custom_io_w),this));
m_sw1_output = &segas32_state::radm_sw1_output;
m_sw2_output = &segas32_state::radr_sw2_output;
+
+ m_s32comm->set_linktype(14084); // EPR-14084
}
-DRIVER_INIT_MEMBER(segas32_state,scross)
+void segas32_state::init_scross(void)
{
segas32_common_init(read16_delegate(FUNC(segas32_state::analog_custom_io_r),this), write16_delegate(FUNC(segas32_state::analog_custom_io_w),this));
m_soundcpu->space(AS_PROGRAM).install_write_handler(0xb0, 0xbf, write8_delegate(FUNC(segas32_state::scross_bank_w),this));
m_sw1_output = &segas32_state::scross_sw1_output;
m_sw2_output = &segas32_state::scross_sw2_output;
+
+ m_s32comm->set_linktype(15033); // EPR-15033
}
-DRIVER_INIT_MEMBER(segas32_state,slipstrm)
+void segas32_state::init_slipstrm(void)
{
segas32_common_init(read16_delegate(FUNC(segas32_state::analog_custom_io_r),this), write16_delegate(FUNC(segas32_state::analog_custom_io_w),this));
}
-DRIVER_INIT_MEMBER(segas32_state,sonic)
+void segas32_state::init_sonic(void)
{
segas32_common_init(read16_delegate(FUNC(segas32_state::sonic_custom_io_r),this), write16_delegate(FUNC(segas32_state::sonic_custom_io_w),this));
@@ -4900,32 +5335,32 @@ DRIVER_INIT_MEMBER(segas32_state,sonic)
}
-DRIVER_INIT_MEMBER(segas32_state,sonicp)
+void segas32_state::init_sonicp(void)
{
segas32_common_init(read16_delegate(FUNC(segas32_state::sonic_custom_io_r),this), write16_delegate(FUNC(segas32_state::sonic_custom_io_w),this));
}
-DRIVER_INIT_MEMBER(segas32_state,spidman)
+void segas32_state::init_spidman(void)
{
segas32_common_init(read16_delegate(FUNC(segas32_state::extra_custom_io_r),this), write16_delegate());
}
-DRIVER_INIT_MEMBER(segas32_state,svf)
+void segas32_state::init_svf(void)
{
segas32_common_init(read16_delegate(), write16_delegate());
}
-DRIVER_INIT_MEMBER(segas32_state,jleague)
+void segas32_state::init_jleague(void)
{
segas32_common_init(read16_delegate(), write16_delegate());
m_maincpu->space(AS_PROGRAM).install_write_handler(0x20F700, 0x20F705, write16_delegate(FUNC(segas32_state::jleague_protection_w),this));
}
-DRIVER_INIT_MEMBER(segas32_state,titlef)
+void segas32_state::init_titlef(void)
{
segas32_common_init(read16_delegate(), write16_delegate());
m_sw1_output = &segas32_state::titlef_sw1_output;
@@ -4933,62 +5368,83 @@ DRIVER_INIT_MEMBER(segas32_state,titlef)
}
-
/*************************************
*
* Game driver(s)
*
*************************************/
-GAME( 1992, arescue, 0, system32, arescue, segas32_state, arescue, ROT0, "Sega", "Air Rescue (US)", GAME_IMPERFECT_GRAPHICS )
-GAME( 1992, arescuej, arescue, system32, arescue, segas32_state, arescue, ROT0, "Sega", "Air Rescue (Japan)", GAME_IMPERFECT_GRAPHICS )
-GAME( 1993, alien3, 0, system32, alien3, segas32_state, alien3, ROT0, "Sega", "Alien3: The Gun (World)", GAME_IMPERFECT_GRAPHICS )
-GAME( 1993, alien3u, alien3, system32, alien3, segas32_state, alien3, ROT0, "Sega", "Alien3: The Gun (US)", GAME_IMPERFECT_GRAPHICS )
-GAME( 1991, arabfgt, 0, system32, arabfgt, segas32_state, arabfgt, ROT0, "Sega", "Arabian Fight (World)", GAME_IMPERFECT_GRAPHICS ) /* Released in 03.1992 */
-GAME( 1991, arabfgtu, arabfgt, system32, arabfgtu, segas32_state, arabfgt, ROT0, "Sega", "Arabian Fight (US)", GAME_IMPERFECT_GRAPHICS )
-GAME( 1991, arabfgtj, arabfgt, system32, arabfgt, segas32_state, arabfgt, ROT0, "Sega", "Arabian Fight (Japan)", GAME_IMPERFECT_GRAPHICS )
-GAME( 1992, brival, 0, system32, brival, segas32_state, brival, ROT0, "Sega", "Burning Rival (World)", GAME_IMPERFECT_GRAPHICS )
-GAME( 1992, brivalj, brival, system32, brival, segas32_state, brival, ROT0, "Sega", "Burning Rival (Japan)", GAME_IMPERFECT_GRAPHICS )
-GAME( 1992, darkedge, 0, system32, darkedge, segas32_state, darkedge, ROT0, "Sega", "Dark Edge (World)", GAME_IMPERFECT_GRAPHICS )
-GAME( 1992, darkedgej, darkedge, system32, darkedge, segas32_state, darkedge, ROT0, "Sega", "Dark Edge (Japan)", GAME_IMPERFECT_GRAPHICS )
-GAME( 1994, dbzvrvs, 0, system32, dbzvrvs, segas32_state, dbzvrvs, ROT0, "Sega / Banpresto", "Dragon Ball Z V.R.V.S. (Japan)", GAME_IMPERFECT_GRAPHICS)
-GAME( 1991, f1en, 0, system32, f1en, segas32_state, f1en, ROT0, "Sega", "F1 Exhaust Note (World)", GAME_IMPERFECT_GRAPHICS )
-GAME( 1991, f1enu, f1en, system32, f1en, segas32_state, f1en, ROT0, "Sega", "F1 Exhaust Note (US)", GAME_IMPERFECT_GRAPHICS )
-GAME( 1991, f1enj, f1en, system32, f1en, segas32_state, f1en, ROT0, "Sega", "F1 Exhaust Note (Japan)", GAME_IMPERFECT_GRAPHICS )
-GAME( 1993, f1lap, 0, system32, f1lap, segas32_state, f1lap, ROT0, "Sega", "F1 Super Lap (World)", GAME_IMPERFECT_GRAPHICS )
-GAME( 1993, f1lapj, f1lap, system32, f1lap, segas32_state, f1lap, ROT0, "Sega", "F1 Super Lap (Japan)", GAME_IMPERFECT_GRAPHICS )
-GAME( 1992, ga2, 0, system32_v25, ga2, segas32_state, ga2, ROT0, "Sega", "Golden Axe: The Revenge of Death Adder (World)", GAME_IMPERFECT_GRAPHICS )
-GAME( 1992, ga2u, ga2, system32_v25, ga2u, segas32_state, ga2, ROT0, "Sega", "Golden Axe: The Revenge of Death Adder (US)", GAME_IMPERFECT_GRAPHICS )
-GAME( 1992, ga2j, ga2, system32_v25, ga2, segas32_state, ga2, ROT0, "Sega", "Golden Axe: The Revenge of Death Adder (Japan)", GAME_IMPERFECT_GRAPHICS )
-GAME( 1992, holo, 0, system32, holo, segas32_state, holo, ORIENTATION_FLIP_Y, "Sega", "Holosseum (US)", GAME_IMPERFECT_GRAPHICS )
-GAME( 1993, jpark, 0, system32, jpark, segas32_state, jpark, ROT0, "Sega", "Jurassic Park (World)", GAME_IMPERFECT_GRAPHICS ) /* Released in 02.1994 */
-GAME( 1993, jparkj, jpark, system32, jpark, segas32_state, jpark, ROT0, "Sega", "Jurassic Park (Japan, Rev A, Deluxe)", GAME_IMPERFECT_GRAPHICS )
-GAME( 1993, jparkja, jpark, system32, jpark, segas32_state, jpark, ROT0, "Sega", "Jurassic Park (Japan, Deluxe)", GAME_IMPERFECT_GRAPHICS )
-GAME( 1993, jparkjc, jpark, system32, jpark, segas32_state, jpark, ROT0, "Sega", "Jurassic Park (Japan, Rev A, Conversion)", GAME_IMPERFECT_GRAPHICS )
-GAME( 1994, kokoroj2, 0, system32, radr, segas32_state, radr, ROT0, "Sega", "Kokoroji 2", GAME_IMPERFECT_GRAPHICS | GAME_NOT_WORKING) /* uses an Audio CD */
-GAME( 1990, radm, 0, system32, radm, segas32_state, radm, ROT0, "Sega", "Rad Mobile (World)", GAME_IMPERFECT_GRAPHICS ) /* Released in 02.1991 */
-GAME( 1990, radmu, radm, system32, radm, segas32_state, radm, ROT0, "Sega", "Rad Mobile (US)", GAME_IMPERFECT_GRAPHICS )
-GAMEL(1991, radr, 0, system32, radr, segas32_state, radr, ROT0, "Sega", "Rad Rally (World)", GAME_IMPERFECT_GRAPHICS, layout_radr )
-GAMEL(1991, radru, radr, system32, radr, segas32_state, radr, ROT0, "Sega", "Rad Rally (US)", GAME_IMPERFECT_GRAPHICS, layout_radr )
-GAMEL(1991, radrj, radr, system32, radr, segas32_state, radr, ROT0, "Sega", "Rad Rally (Japan)", GAME_IMPERFECT_GRAPHICS, layout_radr )
-GAMEL(1995, slipstrm, 0, system32, slipstrm, segas32_state, slipstrm, ROT0, "Capcom", "Slip Stream (Brazil 950515)", GAME_IMPERFECT_GRAPHICS, layout_radr )
-GAMEL(1995, slipstrmh, slipstrm, system32, slipstrm, segas32_state, slipstrm, ROT0, "Capcom", "Slip Stream (Hispanic 950515)", GAME_IMPERFECT_GRAPHICS, layout_radr )
-GAME( 1992, sonic, 0, system32, sonic, segas32_state, sonic, ROT0, "Sega", "SegaSonic The Hedgehog (Japan, rev. C)", GAME_IMPERFECT_GRAPHICS )
-GAME( 1992, sonicp, sonic, system32, sonic, segas32_state, sonicp, ROT0, "Sega", "SegaSonic The Hedgehog (Japan, prototype)", GAME_IMPERFECT_GRAPHICS )
-GAME( 1991, spidman, 0, system32, spidman, segas32_state, spidman, ROT0, "Sega", "Spider-Man: The Videogame (World)", GAME_IMPERFECT_GRAPHICS )
-GAME( 1991, spidmanu, spidman, system32, spidmanu, segas32_state, spidman, ROT0, "Sega", "Spider-Man: The Videogame (US)", GAME_IMPERFECT_GRAPHICS )
-GAME( 1991, spidmanj, spidman, system32, spidman, segas32_state, spidman, ROT0, "Sega", "Spider-Man: The Videogame (Japan)", GAME_IMPERFECT_GRAPHICS )
-GAME( 1994, svf, 0, system32, svf, segas32_state, svf, ROT0, "Sega", "Super Visual Football: European Sega Cup", GAME_IMPERFECT_GRAPHICS )
-GAME( 1994, svs, svf, system32, svf, segas32_state, svf, ROT0, "Sega", "Super Visual Soccer: Sega Cup (US)", GAME_IMPERFECT_GRAPHICS )
-GAME( 1994, jleague, svf, system32, svf, segas32_state, jleague, ROT0, "Sega", "The J.League 1994 (Japan)", GAME_IMPERFECT_GRAPHICS )
-GAME( 1994, harddunk, 0, multi32, harddunk, segas32_state, harddunk, ROT0, "Sega", "Hard Dunk (World)", GAME_IMPERFECT_GRAPHICS )
-GAME( 1994, harddunkj, harddunk, multi32, harddunk, segas32_state, harddunk, ROT0, "Sega", "Hard Dunk (Japan)", GAME_IMPERFECT_GRAPHICS )
-GAME( 1992, orunners, 0, multi32, orunners, segas32_state, orunners, ROT0, "Sega", "OutRunners (World)", GAME_IMPERFECT_GRAPHICS )
-GAME( 1992, orunnersu, orunners, multi32, orunners, segas32_state, orunners, ROT0, "Sega", "OutRunners (US)", GAME_IMPERFECT_GRAPHICS )
-GAME( 1992, orunnersj, orunners, multi32, orunners, segas32_state, orunners, ROT0, "Sega", "OutRunners (Japan)", GAME_IMPERFECT_GRAPHICS )
-GAME( 1992, scross, 0, multi32, scross, segas32_state, scross, ROT0, "Sega", "Stadium Cross (World)", GAME_IMPERFECT_GRAPHICS )
-GAME( 1992, scrossa, scross, multi32, scross, segas32_state, scross, ROT0, "Sega", "Stadium Cross (World, alt)", GAME_IMPERFECT_GRAPHICS )
-GAME( 1992, scrossu, scross, multi32, scross, segas32_state, scross, ROT0, "Sega", "Stadium Cross (US)", GAME_IMPERFECT_GRAPHICS )
-GAME( 1992, titlef, 0, multi32, titlef, segas32_state, titlef, ROT0, "Sega", "Title Fight (World)", GAME_IMPERFECT_GRAPHICS )
-GAME( 1992, titlefu, titlef, multi32, titlef, segas32_state, titlef, ROT0, "Sega", "Title Fight (US)", GAME_IMPERFECT_GRAPHICS )
-GAME( 1992, titlefj, titlef, multi32, titlef, segas32_state, titlef, ROT0, "Sega", "Title Fight (Japan)", GAME_IMPERFECT_GRAPHICS )
+GAME( 1992, arescue, 0, sega_system32_dual_direct, arescue, segas32_new_state, arescue, ROT0, "Sega", "Air Rescue (US)", GAME_IMPERFECT_GRAPHICS )
+GAME( 1992, arescuej, arescue, sega_system32_dual_direct, arescue, segas32_new_state, arescue, ROT0, "Sega", "Air Rescue (Japan)", GAME_IMPERFECT_GRAPHICS )
+
+GAME( 1993, alien3, 0, sega_system32, alien3, segas32_new_state, alien3, ROT0, "Sega", "Alien3: The Gun (World)", GAME_IMPERFECT_GRAPHICS )
+GAME( 1993, alien3u, alien3, sega_system32, alien3, segas32_new_state, alien3, ROT0, "Sega", "Alien3: The Gun (US)", GAME_IMPERFECT_GRAPHICS )
+
+GAME( 1991, arabfgt, 0, sega_system32, arabfgt, segas32_new_state, arabfgt, ROT0, "Sega", "Arabian Fight (World)", GAME_IMPERFECT_GRAPHICS ) /* Released in 03.1992 */
+GAME( 1991, arabfgtu, arabfgt, sega_system32, arabfgtu, segas32_new_state, arabfgt, ROT0, "Sega", "Arabian Fight (US)", GAME_IMPERFECT_GRAPHICS )
+GAME( 1991, arabfgtj, arabfgt, sega_system32, arabfgt, segas32_new_state, arabfgt, ROT0, "Sega", "Arabian Fight (Japan)", GAME_IMPERFECT_GRAPHICS )
+
+GAME( 1992, brival, 0, sega_system32, brival, segas32_new_state, brival, ROT0, "Sega", "Burning Rival (World)", GAME_IMPERFECT_GRAPHICS )
+GAME( 1992, brivalj, brival, sega_system32, brival, segas32_new_state, brival, ROT0, "Sega", "Burning Rival (Japan)", GAME_IMPERFECT_GRAPHICS )
+
+GAME( 1992, darkedge, 0, sega_system32, darkedge, segas32_new_state, darkedge, ROT0, "Sega", "Dark Edge (World)", GAME_IMPERFECT_GRAPHICS )
+GAME( 1992, darkedgej, darkedge, sega_system32, darkedge, segas32_new_state, darkedge, ROT0, "Sega", "Dark Edge (Japan)", GAME_IMPERFECT_GRAPHICS )
+
+GAME( 1994, dbzvrvs, 0, sega_system32, dbzvrvs, segas32_new_state, dbzvrvs, ROT0, "Sega / Banpresto", "Dragon Ball Z V.R.V.S. (Japan)", GAME_IMPERFECT_GRAPHICS)
+
+GAME( 1991, f1en, 0, sega_system32_dual_direct, f1en, segas32_new_state, f1en, ROT0, "Sega", "F1 Exhaust Note (World)", GAME_IMPERFECT_GRAPHICS )
+GAME( 1991, f1enu, f1en, sega_system32_dual_direct, f1en, segas32_new_state, f1en, ROT0, "Sega", "F1 Exhaust Note (US)", GAME_IMPERFECT_GRAPHICS )
+GAME( 1991, f1enj, f1en, sega_system32_dual_direct, f1en, segas32_new_state, f1en, ROT0, "Sega", "F1 Exhaust Note (Japan)", GAME_IMPERFECT_GRAPHICS )
+
+GAME( 1993, f1lap, 0, sega_system32, f1lap, segas32_new_state, f1lap, ROT0, "Sega", "F1 Super Lap (World)", GAME_IMPERFECT_GRAPHICS )
+GAME( 1993, f1lapj, f1lap, sega_system32, f1lap, segas32_new_state, f1lap, ROT0, "Sega", "F1 Super Lap (Japan)", GAME_IMPERFECT_GRAPHICS )
+
+GAME( 1992, ga2, 0, sega_system32_v25, ga2, segas32_new_state, ga2, ROT0, "Sega", "Golden Axe: The Revenge of Death Adder (World)", GAME_IMPERFECT_GRAPHICS )
+GAME( 1992, ga2u, ga2, sega_system32_v25, ga2u, segas32_new_state, ga2, ROT0, "Sega", "Golden Axe: The Revenge of Death Adder (US)", GAME_IMPERFECT_GRAPHICS )
+GAME( 1992, ga2j, ga2, sega_system32_v25, ga2, segas32_new_state, ga2, ROT0, "Sega", "Golden Axe: The Revenge of Death Adder (Japan)", GAME_IMPERFECT_GRAPHICS )
+
+GAME( 1992, holo, 0, sega_system32, holo, segas32_new_state, holo, ORIENTATION_FLIP_Y, "Sega", "Holosseum (US)", GAME_IMPERFECT_GRAPHICS )
+
+GAME( 1993, jpark, 0, sega_system32, jpark, segas32_new_state, jpark, ROT0, "Sega", "Jurassic Park (World)", GAME_IMPERFECT_GRAPHICS ) /* Released in 02.1994 */
+GAME( 1993, jparkj, jpark, sega_system32, jpark, segas32_new_state, jpark, ROT0, "Sega", "Jurassic Park (Japan, Rev A, Deluxe)", GAME_IMPERFECT_GRAPHICS )
+GAME( 1993, jparkja, jpark, sega_system32, jpark, segas32_new_state, jpark, ROT0, "Sega", "Jurassic Park (Japan, Deluxe)", GAME_IMPERFECT_GRAPHICS )
+GAME( 1993, jparkjc, jpark, sega_system32, jpark, segas32_new_state, jpark, ROT0, "Sega", "Jurassic Park (Japan, Rev A, Conversion)", GAME_IMPERFECT_GRAPHICS )
+
+GAME( 1994, kokoroj2, 0, sega_system32, radr, segas32_new_state, radr, ROT0, "Sega", "Kokoroji 2", GAME_IMPERFECT_GRAPHICS | GAME_NOT_WORKING) /* uses an Audio CD */
+
+GAME( 1990, radm, 0, sega_system32, radm, segas32_new_state, radm, ROT0, "Sega", "Rad Mobile (World)", GAME_IMPERFECT_GRAPHICS ) /* Released in 02.1991 */
+GAME( 1990, radmu, radm, sega_system32, radm, segas32_new_state, radm, ROT0, "Sega", "Rad Mobile (US)", GAME_IMPERFECT_GRAPHICS )
+
+GAMEL(1991, radr, 0, sega_system32, radr, segas32_new_state, radr, ROT0, "Sega", "Rad Rally (World)", GAME_IMPERFECT_GRAPHICS, layout_radr )
+GAMEL(1991, radru, radr, sega_system32, radr, segas32_new_state, radr, ROT0, "Sega", "Rad Rally (US)", GAME_IMPERFECT_GRAPHICS, layout_radr )
+GAMEL(1991, radrj, radr, sega_system32, radr, segas32_new_state, radr, ROT0, "Sega", "Rad Rally (Japan)", GAME_IMPERFECT_GRAPHICS, layout_radr )
+
+GAMEL(1995, slipstrm, 0, sega_system32, slipstrm, segas32_new_state, slipstrm, ROT0, "Capcom", "Slip Stream (Brazil 950515)", GAME_IMPERFECT_GRAPHICS, layout_radr )
+GAMEL(1995, slipstrmh, slipstrm, sega_system32, slipstrm, segas32_new_state, slipstrm, ROT0, "Capcom", "Slip Stream (Hispanic 950515)", GAME_IMPERFECT_GRAPHICS, layout_radr )
+
+GAME( 1992, sonic, 0, sega_system32, sonic, segas32_new_state, sonic, ROT0, "Sega", "SegaSonic The Hedgehog (Japan, rev. C)", GAME_IMPERFECT_GRAPHICS )
+GAME( 1992, sonicp, sonic, sega_system32, sonic, segas32_new_state, sonicp, ROT0, "Sega", "SegaSonic The Hedgehog (Japan, prototype)", GAME_IMPERFECT_GRAPHICS )
+
+GAME( 1991, spidman, 0, sega_system32, spidman, segas32_new_state, spidman, ROT0, "Sega", "Spider-Man: The Videogame (World)", GAME_IMPERFECT_GRAPHICS )
+GAME( 1991, spidmanu, spidman, sega_system32, spidmanu, segas32_new_state, spidman, ROT0, "Sega", "Spider-Man: The Videogame (US)", GAME_IMPERFECT_GRAPHICS )
+GAME( 1991, spidmanj, spidman, sega_system32, spidman, segas32_new_state, spidman, ROT0, "Sega", "Spider-Man: The Videogame (Japan)", GAME_IMPERFECT_GRAPHICS )
+
+GAME( 1994, svf, 0, sega_system32, svf, segas32_new_state, svf, ROT0, "Sega", "Super Visual Football: European Sega Cup", GAME_IMPERFECT_GRAPHICS )
+GAME( 1994, svs, svf, sega_system32, svf, segas32_new_state, svf, ROT0, "Sega", "Super Visual Soccer: Sega Cup (US)", GAME_IMPERFECT_GRAPHICS )
+GAME( 1994, jleague, svf, sega_system32, svf, segas32_new_state, jleague, ROT0, "Sega", "The J.League 1994 (Japan)", GAME_IMPERFECT_GRAPHICS )
+
+
+GAME( 1994, harddunk, 0, sega_multi32, harddunk, segas32_new_state, harddunk, ROT0, "Sega", "Hard Dunk (World)", GAME_IMPERFECT_GRAPHICS )
+GAME( 1994, harddunkj, harddunk, sega_multi32, harddunk, segas32_new_state, harddunk, ROT0, "Sega", "Hard Dunk (Japan)", GAME_IMPERFECT_GRAPHICS )
+
+GAME( 1992, orunners, 0, sega_multi32, orunners, segas32_new_state, orunners, ROT0, "Sega", "OutRunners (World)", GAME_IMPERFECT_GRAPHICS )
+GAME( 1992, orunnersu, orunners, sega_multi32, orunners, segas32_new_state, orunners, ROT0, "Sega", "OutRunners (US)", GAME_IMPERFECT_GRAPHICS )
+GAME( 1992, orunnersj, orunners, sega_multi32, orunners, segas32_new_state, orunners, ROT0, "Sega", "OutRunners (Japan)", GAME_IMPERFECT_GRAPHICS )
+
+GAME( 1992, scross, 0, sega_multi32, scross, segas32_new_state, scross, ROT0, "Sega", "Stadium Cross (World)", GAME_IMPERFECT_GRAPHICS )
+GAME( 1992, scrossa, scross, sega_multi32, scross, segas32_new_state, scross, ROT0, "Sega", "Stadium Cross (World, alt)", GAME_IMPERFECT_GRAPHICS )
+GAME( 1992, scrossu, scross, sega_multi32, scross, segas32_new_state, scross, ROT0, "Sega", "Stadium Cross (US)", GAME_IMPERFECT_GRAPHICS )
+
+GAME( 1992, titlef, 0, sega_multi32, titlef, segas32_new_state, titlef, ROT0, "Sega", "Title Fight (World)", GAME_IMPERFECT_GRAPHICS )
+GAME( 1992, titlefu, titlef, sega_multi32, titlef, segas32_new_state, titlef, ROT0, "Sega", "Title Fight (US)", GAME_IMPERFECT_GRAPHICS )
+GAME( 1992, titlefj, titlef, sega_multi32, titlef, segas32_new_state, titlef, ROT0, "Sega", "Title Fight (Japan)", GAME_IMPERFECT_GRAPHICS )
diff --git a/src/mame/drivers/segaybd.c b/src/mame/drivers/segaybd.c
index e406b0a10ba..42f99a0b35d 100644
--- a/src/mame/drivers/segaybd.c
+++ b/src/mame/drivers/segaybd.c
@@ -828,6 +828,19 @@ static ADDRESS_MAP_START( link_portmap, AS_IO, 8, segaybd_state )
ADDRESS_MAP_END
+static ADDRESS_MAP_START( motor_map, AS_PROGRAM, 8, segaybd_state )
+ ADDRESS_MAP_UNMAP_HIGH
+ AM_RANGE(0x0000, 0x7fff) AM_ROM
+ AM_RANGE(0x8000, 0xffff) AM_RAM
+ADDRESS_MAP_END
+
+/*
+static ADDRESS_MAP_START( motor_portmap, AS_IO, 8, segaybd_state )
+ ADDRESS_MAP_UNMAP_HIGH
+ ADDRESS_MAP_GLOBAL_MASK(0xff)
+ADDRESS_MAP_END
+*/
+
//**************************************************************************
// GENERIC PORT DEFINITIONS
//**************************************************************************
@@ -1422,6 +1435,15 @@ static MACHINE_CONFIG_DERIVED( yboard_link, yboard )
MCFG_MB8421_INTR_HANDLER(WRITELINE(segaybd_state, mb8421_intr))
MACHINE_CONFIG_END
+static MACHINE_CONFIG_DERIVED( yboard_deluxe, yboard )
+
+ // basic machine hardware
+ MCFG_CPU_ADD("motorcpu", Z80, XTAL_16MHz/2 ) // 8 Mhz(guessed)
+ MCFG_CPU_PROGRAM_MAP(motor_map)
+// MCFG_CPU_IO_MAP(motor_portmap)
+
+MACHINE_CONFIG_END
+
//**************************************************************************
// ROM DEFINITIONS
//**************************************************************************
@@ -1431,7 +1453,7 @@ MACHINE_CONFIG_END
//*************************************************************************************************************************
//*************************************************************************************************************************
// Galaxy Force, Sega Y-board
-// Sega Game ID: 831-6614 (two PCB board stack
+// Sega Game ID: 831-6614 (two PCB board stack)
//
// NOTE: An original PCB is very hard to locate intact. Most of these boards were upgraded to Galaxy Force 2 through a
// chip swap upgrade.
@@ -1441,7 +1463,7 @@ MACHINE_CONFIG_END
//*************************************************************************************************************************
//*************************************************************************************************************************
//*************************************************************************************************************************
-// Galaxy Force 2, Sega Y-board
+// Galaxy Force 2 (World), Sega Y-board
// CPU: 68000 (317-????)
//
ROM_START( gforce2 )
@@ -1513,13 +1535,87 @@ ROM_START( gforce2 )
ROM_RELOAD( 0x120000, 0x20000 )
ROM_RELOAD( 0x140000, 0x20000 )
ROM_RELOAD( 0x160000, 0x20000 )
+ROM_END
+
+// Galaxy Force 2 (World, Super Deluxe unit), Sega Y-board
+// CPU: 68000 (317-????)
+//
+ROM_START( gforce2sd )
+ ROM_REGION( 0x080000, "maincpu", 0 ) // M
+ ROM_LOAD16_BYTE( "epr-11688.25", 0x000000, 0x20000, CRC(c845f2df) SHA1(17586a5f83170e99f28cd35b28e85e503e7bbe75) )
+ ROM_LOAD16_BYTE( "epr-11687.24", 0x000001, 0x20000, CRC(1cbefbbf) SHA1(28d473707cf042baca9d3a75ef22a5beb8c993f7) )
+
+ ROM_REGION( 0x040000, "subx", 0 ) // X
+ ROM_LOAD16_BYTE( "epr-11875.81", 0x000000, 0x20000, CRC(c81701c6) SHA1(00c269f18c5eded7a0e4b6354779cd80db827409) )
+ ROM_LOAD16_BYTE( "epr-11874.80", 0x000001, 0x20000, CRC(5301fd79) SHA1(60a751c168d519cd45a9575e138514d580bce9b6) )
+
+ ROM_REGION( 0x040000, "suby", 0 ) // Y
+ ROM_LOAD16_BYTE( "epr-11816b.54", 0x000000, 0x20000, CRC(317dd0c2) SHA1(7f1c7dcfb111385e2a94912975c2f9bfe78445ac) )
+ ROM_LOAD16_BYTE( "epr-11815b.53", 0x000001, 0x20000, CRC(f1fb22f1) SHA1(da3ce521b0a19b391913c35af34084d29edceca7) )
+
+ ROM_REGION16_BE( 0x080000, "bsprites", 0 )
+ ROM_LOAD16_BYTE( "mpr-11467.16", 0x000000, 0x20000, CRC(6e60e736) SHA1(73086744cb2fe1ce162f851cb879755c21819b33) )
+ ROM_LOAD16_BYTE( "mpr-11468.14", 0x000001, 0x20000, CRC(74ca9ca5) SHA1(c6f27ce43ef270088e6155c8240fd15afa5729fd) )
+ ROM_LOAD16_BYTE( "epr-11694.17", 0x040000, 0x20000, CRC(7e297b84) SHA1(bbf1aa2b0b6b1f9fdaf9bea77d24b7f4f9320696) )
+ ROM_LOAD16_BYTE( "epr-11695.15", 0x040001, 0x20000, CRC(38a864be) SHA1(ef7d89511713d695f6a454c42f079d3507d9690d) )
+
+ ROM_REGION64_BE( 0x400000, "ysprites", 0)
+ ROMX_LOAD( "mpr-11469.67", 0x000000, 0x20000, CRC(ed7a2299) SHA1(1aecf9ccba1fed0b7908008e798c522251a08b0f), ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-11470.75", 0x000001, 0x20000, CRC(34dea550) SHA1(da95b8346c3530573461553629af4cc493bbb4af), ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-11477.63", 0x000002, 0x20000, CRC(a2784653) SHA1(00a123d1fc8116ca678d6d8dbf1a5450feee014d), ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-11478.71", 0x000003, 0x20000, CRC(8b778993) SHA1(015ae757d26cd6e69bdf79e237f62743a8f41e0c), ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-11471.86", 0x000004, 0x20000, CRC(f1974069) SHA1(c8beb1a2ce430e3e6478c87c7053a58f8f31a140), ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-11472.114", 0x000005, 0x20000, CRC(0d24409a) SHA1(ee00e23b0c548918b89dd48ed3f8b0370388659e), ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-11479.82", 0x000006, 0x20000, CRC(ecd6138a) SHA1(bbc157a1f9b7e24d16e6f126d95c448736e83791), ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-11480.110", 0x000007, 0x20000, CRC(64ad66c5) SHA1(aaab6999aa88b3340b16ee1188a8432477e16625), ROM_SKIP(7) )
+
+ ROMX_LOAD( "mpr-11473.66", 0x100000, 0x20000, CRC(0538c6ec) SHA1(9397db188f12cf8cd91841794134760f30f83893), ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-11474.74", 0x100001, 0x20000, CRC(eb923c50) SHA1(f997d2bc7f674eae4243eaf640d8faffa41d9521), ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-11481.62", 0x100002, 0x20000, CRC(78e652b6) SHA1(8c70609172908131fef8cbe05f810dbd3d120eba), ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-11482.70", 0x100003, 0x20000, CRC(2f879766) SHA1(ca5835d0bb77fe7de83ad336a82111cb2f96cd41), ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-11475.85", 0x100004, 0x20000, CRC(69cfec89) SHA1(db2a9b03fff727f198fb5cbfb9c281ac3bbc5623), ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-11476.113", 0x100005, 0x20000, CRC(a60b9b79) SHA1(6e9aa51923c12f5658bd17deb6c032e08c91dade), ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-11483.81", 0x100006, 0x20000, CRC(d5d3a505) SHA1(fa7662346b954d3faf0e8fcf138004231676845c), ROM_SKIP(7) )
+ ROMX_LOAD( "mpr-11484.109", 0x100007, 0x20000, CRC(b8a56a50) SHA1(ccbc391d6f60b88630d7a93b8bb6e365a8d59ed8), ROM_SKIP(7) )
+
+ ROMX_LOAD( "epr-11696.65", 0x200000, 0x20000, CRC(99e8e49e) SHA1(ab6e1d74af412ec2f939043d7dc26f4b2e34a528), ROM_SKIP(7) )
+ ROMX_LOAD( "epr-11697.73", 0x200001, 0x20000, CRC(7545c52e) SHA1(bdb0ccf233e10e9449aa367db5a5b5f209bee969), ROM_SKIP(7) )
+ ROMX_LOAD( "epr-11700.61", 0x200002, 0x20000, CRC(e13839c1) SHA1(4975b5314797d11c782b0478eaa84eaf9980b1cd), ROM_SKIP(7) )
+ ROMX_LOAD( "epr-11701.69", 0x200003, 0x20000, CRC(9fb3d365) SHA1(bfcf4abfa91aa41b16f01b7bafe97cd865167fbc), ROM_SKIP(7) )
+ ROMX_LOAD( "epr-11698.84", 0x200004, 0x20000, CRC(cfeba3e2) SHA1(826b73858ca5ea05688246d36b1f607356974ca9), ROM_SKIP(7) )
+ ROMX_LOAD( "epr-11699.112", 0x200005, 0x20000, CRC(4a00534a) SHA1(9a637b45b140420937b232bf690ef8bc3d43f5ad), ROM_SKIP(7) )
+ ROMX_LOAD( "epr-11702.80", 0x200006, 0x20000, CRC(2a09c627) SHA1(c6b0a618b4ddd9d227d3472544b62ebef966b041), ROM_SKIP(7) )
+ ROMX_LOAD( "epr-11703.108", 0x200007, 0x20000, CRC(43bb7d9f) SHA1(e36d208937f56f0af14292184c80ca939c32c378), ROM_SKIP(7) )
+
+ ROMX_LOAD( "epr-11524.64", 0x300000, 0x20000, CRC(5d35849f) SHA1(b86fb230ed0901dfdb525e7a47d9c9ad8031a3f6), ROM_SKIP(7) )
+ ROMX_LOAD( "epr-11525.72", 0x300001, 0x20000, CRC(9ae47552) SHA1(43268dd5f79282aabd8972994437de1b2d2acc40), ROM_SKIP(7) )
+ ROMX_LOAD( "epr-11532.60", 0x300002, 0x20000, CRC(b3565ddb) SHA1(3208744d43a11f4de8a6b626cc9113ad63d36807), ROM_SKIP(7) )
+ ROMX_LOAD( "epr-11533.68", 0x300003, 0x20000, CRC(f5d16e8a) SHA1(3b5c1582794a0e69707264879b544ac48afd9337), ROM_SKIP(7) )
+ ROMX_LOAD( "epr-11526.83", 0x300004, 0x20000, CRC(094cb3f0) SHA1(4b30e24dfd33c9922ffd5665cd9631b1f24243da), ROM_SKIP(7) )
+ ROMX_LOAD( "epr-11527.111", 0x300005, 0x20000, CRC(e821a144) SHA1(eeec0e51798645cce8f9a7e686178268398977fb), ROM_SKIP(7) )
+ ROMX_LOAD( "epr-11534.79", 0x300006, 0x20000, CRC(b7f0ad7c) SHA1(987b198692db365f3a81e88e5eec526775c318c6), ROM_SKIP(7) )
+ ROMX_LOAD( "epr-11535.107", 0x300007, 0x20000, CRC(95da7a46) SHA1(ffe6cd80eecc7c53a1155396ede0720d975d2c3b), ROM_SKIP(7) )
+
+ ROM_REGION( 0x10000, "soundcpu", 0 ) // Z80 sound CPU
+ ROM_LOAD( "epr-11693.102", 0x000000, 0x10000, CRC(0497785c) SHA1(f077e71efdc96d6eb3f1a1f989650466554fb13a) ) // 11516A
+
+ ROM_REGION( 0x200000, "pcm", ROMREGION_ERASEFF ) // SegaPCM samples
+ ROM_LOAD( "mpr-11465.107", 0x000000, 0x80000, CRC(e1436dab) SHA1(363f4c111de38cb1d82b245e4fcc65308f506e6a) )
+ ROM_LOAD( "epr-11516.106", 0x080000, 0x20000, CRC(19d0e17f) SHA1(7171131226cf1fe260a2db310fad2ec264adca26) )
+ ROM_RELOAD( 0x0a0000, 0x20000 )
+ ROM_RELOAD( 0x0c0000, 0x20000 )
+ ROM_RELOAD( 0x0e0000, 0x20000 )
+ ROM_LOAD( "epr-11814.105", 0x100000, 0x20000, CRC(0b05d376) SHA1(8d0c0be2fd9dbc714c82c7cd1c439d5ff65e1317) ) // 11517
+ ROM_RELOAD( 0x120000, 0x20000 )
+ ROM_RELOAD( 0x140000, 0x20000 )
+ ROM_RELOAD( 0x160000, 0x20000 )
- ROM_REGION( 0x10000, "motorcpu", 0 ) // Z80 motor CPU (for super deluxe unit)
+ ROM_REGION( 0x10000, "motorcpu", 0 ) // Z80 motor CPU
ROM_LOAD( "motorpcb.prg", 0x000000, 0x08000, CRC(fecee31e) SHA1(b50a26896a71d4741bbdc4ae51c3702585531b7e) ) // sega epr label??
ROM_END
//*************************************************************************************************************************
-// Galaxy Force 2, Sega Y-board
+// Galaxy Force 2 (Japan, Rev A), Sega Y-board
// CPU: 68000 (317-????)
//
ROM_START( gforce2ja )
@@ -1594,7 +1690,7 @@ ROM_START( gforce2ja )
ROM_END
//*************************************************************************************************************************
-// Galaxy Force 2, Sega Y-board
+// Galaxy Force 2 (Japan), Sega Y-board
// CPU: 68000 (317-????)
//
ROM_START( gforce2j )
@@ -1672,12 +1768,88 @@ ROM_END
//*************************************************************************************************************************
//*************************************************************************************************************************
//*************************************************************************************************************************
-// G-Loc, Sega Y-board
+// G-Loc (World), Sega Y-board
+// CPU: 68000 (317-????)
+// CPU BD 837-7403
+// VIDEO BD 837-7301-02
+// GAME BD 834-7300-07 G-LOC
+//
+ROM_START( gloc )
+ ROM_REGION( 0x080000, "maincpu", 0 ) // M
+ ROM_LOAD16_BYTE( "epr-13172.25", 0x000000, 0x20000, CRC(75e7174c) SHA1(ef052a6973cf49267463a0c14e8c392a083c62fb) )
+ ROM_LOAD16_BYTE( "epr-13171.24", 0x000001, 0x20000, CRC(90733468) SHA1(1c540c447321e323473462e8c26c59163e0e3b6d) )
+ ROM_LOAD16_BYTE( "epr-13028.27", 0x040000, 0x20000, CRC(b6aa2edf) SHA1(07259fc48cd0f63fbd0a8dadf2294575cd790c85) )
+ ROM_LOAD16_BYTE( "epr-13027.26", 0x040001, 0x20000, CRC(6463c87a) SHA1(882d980a1568ca777364822295e173224509f842) )
+
+ ROM_REGION( 0x040000, "subx", 0 ) // X
+ ROM_LOAD16_BYTE( "epr-13032.81", 0x000000, 0x20000, CRC(7da09c4e) SHA1(09ec269c07f07549aa9851585eac0a5195e25bf9) )
+ ROM_LOAD16_BYTE( "epr-13031.80", 0x000001, 0x20000, CRC(f3c7e3f4) SHA1(927c0cf05e7a72d79fdf19bbe7b18bf167feccd6) )
+
+ ROM_REGION( 0x040000, "suby", 0 ) // Y
+ ROM_LOAD16_BYTE( "epr-13030.54", 0x000000, 0x20000, CRC(81abcabf) SHA1(cb4e817d66a7f384aa9757758c51cd1bf7347dd0) )
+ ROM_LOAD16_BYTE( "epr-13029.53", 0x000001, 0x20000, CRC(f3638efb) SHA1(f82a46fc8616cbe0235746161c587e54adecfe50) )
+
+ ROM_REGION16_BE( 0x200000, "bsprites", 0)
+ ROM_LOAD16_BYTE( "epr-13039.16", 0x000000, 0x80000, CRC(d7e1266d) SHA1(b0fc4cc60a7e876ae2af343bba6da3fb926ea9c5) )
+ ROM_LOAD16_BYTE( "epr-13037.14", 0x000001, 0x80000, CRC(b801a250) SHA1(7d1f6a1f2022a4f302f22d11fa79057cf8134ad2) )
+ ROM_LOAD16_BYTE( "epr-13040.17", 0x100000, 0x80000, CRC(4aeb3a85) SHA1(5521fd2d3956839bdbe7b70a9e60cd9fb72a42f1) )
+ ROM_LOAD16_BYTE( "epr-13038.15", 0x100001, 0x80000, CRC(0b2edb6d) SHA1(04944d6e6f020cd6d33641110847706516630227) )
+
+ ROM_REGION64_BE( 0x1000000, "ysprites", 0 )
+ ROMX_LOAD( "epr-13048.67", 0x000000, 0x80000, CRC(fe1eb0dd) SHA1(5e292fc0b83505eb289e026d4be24c9038ef1418), ROM_SKIP(7) )
+ ROMX_LOAD( "epr-13056.75", 0x000001, 0x80000, CRC(5904f8e6) SHA1(fbb01dadc796624c360d44b7631e3f1f285abf2e), ROM_SKIP(7) )
+ ROMX_LOAD( "epr-13044.63", 0x000002, 0x80000, CRC(4d931f89) SHA1(ff603f4347e4728a2849d9f480893ad0af7abc5c), ROM_SKIP(7) )
+ ROMX_LOAD( "epr-13052.71", 0x000003, 0x80000, CRC(0291f040) SHA1(610dee2a31445f4a054111b7005278560a9c0702), ROM_SKIP(7) )
+ ROMX_LOAD( "epr-13064.86", 0x000004, 0x80000, CRC(5f8e651b) SHA1(f1a957e68dea40c23f6a5a208358ec6d6515fe60), ROM_SKIP(7) )
+ ROMX_LOAD( "epr-13072.114", 0x000005, 0x80000, CRC(6b85641a) SHA1(143a4684d5f303cd30880a2d5728dccbdd168da4), ROM_SKIP(7) )
+ ROMX_LOAD( "epr-13060.82", 0x000006, 0x80000, CRC(ee16ad97) SHA1(6af38cfaf694f686f8e4223fb0b13cd350a8b9e5), ROM_SKIP(7) )
+ ROMX_LOAD( "epr-13068.110", 0x000007, 0x80000, CRC(64d52bbb) SHA1(b6eab546edb2443e5da6c94ec811ec5084212e60), ROM_SKIP(7) )
+
+ ROMX_LOAD( "epr-13047.66", 0x400000, 0x80000, CRC(53340832) SHA1(8ece8a71ea8ed80458121622307a137fb13931f6), ROM_SKIP(7) )
+ ROMX_LOAD( "epr-13055.74", 0x400001, 0x80000, CRC(39b6b665) SHA1(d915db1d9bfe0c6ad3f7b447ce0cfdb42ec66ffe), ROM_SKIP(7) )
+ ROMX_LOAD( "epr-13043.62", 0x400002, 0x80000, CRC(208f16fd) SHA1(ce96708ea9886af4aba8730cbb98c0ca72b96f57), ROM_SKIP(7) )
+ ROMX_LOAD( "epr-13051.70", 0x400003, 0x80000, CRC(ad62cbd4) SHA1(09c008ce5cb97575a4312d2f22566bda72ecc4e2), ROM_SKIP(7) )
+ ROMX_LOAD( "epr-13063.85", 0x400004, 0x80000, CRC(c580bf6d) SHA1(cb72970377ad2acce499059aa8155711b8da8a11), ROM_SKIP(7) )
+ ROMX_LOAD( "epr-13071.113", 0x400005, 0x80000, CRC(df99ef99) SHA1(12648844c6e78dbd573b7bf0c981edb4d3012b58), ROM_SKIP(7) )
+ ROMX_LOAD( "epr-13059.81", 0x400006, 0x80000, CRC(4c982558) SHA1(e04902af2740ca098cd6bbf1f57cb25562754a76), ROM_SKIP(7) )
+ ROMX_LOAD( "epr-13067.109", 0x400007, 0x80000, CRC(f97f6119) SHA1(6f91fc28a1260ca4f1c695863717b27d1e45dc32), ROM_SKIP(7) )
+
+ ROMX_LOAD( "epr-13046.65", 0x800000, 0x80000, CRC(c75a86e9) SHA1(8a180e1e2dd06eb81e2aa4ef73b83879cf6afc1b), ROM_SKIP(7) )
+ ROMX_LOAD( "epr-13054.73", 0x800001, 0x80000, CRC(2934549a) SHA1(058b2966141d0db6bb8557d65c77b3458aca9358), ROM_SKIP(7) )
+ ROMX_LOAD( "epr-13042.61", 0x800002, 0x80000, CRC(53ed97af) SHA1(22dffa434eb98e5bca1e429b69553a3540dc54a7), ROM_SKIP(7) )
+ ROMX_LOAD( "epr-13050.69", 0x800003, 0x80000, CRC(04429068) SHA1(d7d8738809fd959ed428796b2bd1b589b74522c6), ROM_SKIP(7) )
+ ROMX_LOAD( "epr-13062.84", 0x800004, 0x80000, CRC(4fdb4ee3) SHA1(d76065b9abe5c3cf692567d3a8746a231748340d), ROM_SKIP(7) )
+ ROMX_LOAD( "epr-13070.112", 0x800005, 0x80000, CRC(52ea130e) SHA1(860cb3a1701066e595518c49b696b7b7a3994ada), ROM_SKIP(7) )
+ ROMX_LOAD( "epr-13058.80", 0x800006, 0x80000, CRC(19ff1626) SHA1(029e231c3322467b5e2e52eea11df4f645460468), ROM_SKIP(7) )
+ ROMX_LOAD( "epr-13066.108", 0x800007, 0x80000, CRC(bc70a250) SHA1(25189854cc01855b6e3589b85490f30dda029f86), ROM_SKIP(7) )
+
+ ROMX_LOAD( "epr-13045.64", 0xc00000, 0x80000, CRC(54d5bc6d) SHA1(18a301c9e6c4a352f300a438d85c6e6952bf0738), ROM_SKIP(7) )
+ ROMX_LOAD( "epr-13053.72", 0xc00001, 0x80000, CRC(9502af13) SHA1(1a8c0fcd10f4c86af69c0107f486ca2eb8863f93), ROM_SKIP(7) )
+ ROMX_LOAD( "epr-13041.60", 0xc00002, 0x80000, CRC(d0a7402c) SHA1(8932503c570ec49fdb4706f4015608bd060bafa0), ROM_SKIP(7) )
+ ROMX_LOAD( "epr-13049.68", 0xc00003, 0x80000, CRC(5b9c0b6c) SHA1(17f2460b7dc0bd34dca3f90f2b553df4a7149147), ROM_SKIP(7) )
+ ROMX_LOAD( "epr-13061.83", 0xc00004, 0x80000, CRC(7b95ec3b) SHA1(284aba4effd9d376a7a8f510a6f675fcb3393d09), ROM_SKIP(7) )
+ ROMX_LOAD( "epr-13069.111", 0xc00005, 0x80000, CRC(e1f538f0) SHA1(55dc85faed1d5a7f2d586bac7e524c3fef3c53b4), ROM_SKIP(7) )
+ ROMX_LOAD( "epr-13057.79", 0xc00006, 0x80000, CRC(73baefee) SHA1(6e86edc8229dd6112034a7df79f7341a4120dc6b), ROM_SKIP(7) )
+ ROMX_LOAD( "epr-13065.107", 0xc00007, 0x80000, CRC(8937a655) SHA1(d38726a8a6fe68a002ac8d17f70ab83c2f814aa2), ROM_SKIP(7) )
+
+ ROM_REGION( 0x10000, "soundcpu", 0 ) // Z80 sound CPU
+ ROM_LOAD( "epr-13033.102", 0x000000, 0x10000, CRC(6df5e827) SHA1(ec260886a27ba00690490500fcf4ebf07fb35205) )
+
+ ROM_REGION( 0x200000, "pcm", ROMREGION_ERASEFF ) // SegaPCM samples
+ ROM_LOAD( "epr-13036.107", 0x000000, 0x80000, CRC(7890c26c) SHA1(97e0678bb571de5cf732804f8909e5cbd24980f1) )
+ ROM_LOAD( "epr-13035.106", 0x080000, 0x80000, CRC(009fa13e) SHA1(c7b224b471696b12332fc7c403c127b19c297df7) )
+ ROM_LOAD( "epr-13034.105", 0x100000, 0x80000, CRC(cd22d95d) SHA1(857aa320df0b3fb44fc8a5526ba5ee82cc74fe63) )
+ROM_END
+
+//*************************************************************************************************************************
+// G-Loc (US), Sega Y-board
// CPU: 68000 (317-????)
// VIDEO BD 837-7301-01
// GAME BD 834-7300-04 G-LOC
//
-ROM_START( gloc )
+// No "For use in..." region notice, but displays the FBI "Winners Don't Use Drugs" splash screen during attract sequence
+//
+ROM_START( glocu )
ROM_REGION( 0x080000, "maincpu", 0 ) // M
ROM_LOAD16_BYTE( "epr-13170.25", 0x000000, 0x20000, CRC(45189229) SHA1(01d18f6e4887633475baf610f455fad4ed7981e4) )
ROM_LOAD16_BYTE( "epr-13169.24", 0x000001, 0x20000, CRC(1b47cd6e) SHA1(694f489766f25e4c1f1fef6db79de347688ad80a) )
@@ -1749,7 +1921,7 @@ ROM_END
ROM_START( glocr360 )
ROM_REGION( 0x080000, "maincpu", 0 ) // M
ROM_LOAD16_BYTE( "epr-13623.25", 0x000000, 0x20000, CRC(58ad10e7) SHA1(3760ede1d1c089f6c8b2ec88b2f25bce67add467) )
- ROM_LOAD16_BYTE( "epr-13622.24", 0x000001, 0x20000, CRC(c4e68dbf) SHA1(f85e6fdf159e19342e5a9278f004e95752af7d55) )
+ ROM_LOAD16_BYTE( "epr-13622.24", 0x000001, 0x20000, CRC(c4e68dbf) SHA1(f85e6fdf159e19342e5a9278f004e95752af7d55) )
ROM_LOAD16_BYTE( "epr-13323a.27", 0x040000, 0x20000, CRC(02e24a33) SHA1(4955b13e5e90945dfb9066597b16df63c2a09552) )
ROM_LOAD16_BYTE( "epr-13322a.26", 0x040001, 0x20000, CRC(94f67740) SHA1(3d1be8dc9c370cd024fae19bb0b2663995d13d0e) )
@@ -1817,7 +1989,7 @@ ROM_END
//*************************************************************************************************************************
//*************************************************************************************************************************
//*************************************************************************************************************************
-// Power Drift, Sega Y-board
+// Power Drift (World, Rev A), Sega Y-board
// CPU: 68000 (317-????)
// CPU BD POWER DRIFT 837-6695-08 (or 837-6695-09)
// VIDEO BD POWER DRIFT 837-6696-01 (or 837-6696-02)
@@ -1903,6 +2075,7 @@ ROM_START( pdrift )
ROM_END
//*************************************************************************************************************************
+// Power Drift (World)
//
ROM_START( pdrifta )
ROM_REGION( 0x080000, "maincpu", 0 ) // M
@@ -1985,6 +2158,7 @@ ROM_START( pdrifta )
ROM_END
//*************************************************************************************************************************
+// Power Drift (World)
// Earlier set based on eprom numbers & Sega Eprom/Mask Rom Locations sheet 421-7708
//
ROM_START( pdrifte )
@@ -2068,7 +2242,7 @@ ROM_START( pdrifte )
ROM_END
//*************************************************************************************************************************
-// Power Drift, Sega Y-board
+// Power Drift (Japan), Sega Y-board
// CPU: 68000 (317-????)
// CPU BD POWER DRIFT 837-6695-08 (or 837-6695-09)
// VIDEO BD POWER DRIFT 837-6696-01 (or 837-6696-02)
@@ -2154,88 +2328,88 @@ ROM_START( pdriftj )
ROM_END
//*************************************************************************************************************************
-// Power Drift, Sega Y-board Link version
+// Power Drift (Japan), Sega Y-board Link version
// Sega Game ID: 833-6697
//
// This was just 6 loose program roms + 4 sprite roms + the link PCBs, other roms could be incorrect
//
ROM_START(pdriftl)
ROM_REGION(0x080000, "maincpu", 0) // M
- ROM_LOAD16_BYTE("epr-12107a.25", 0x000000, 0x20000, CRC(0acaed3c) SHA1(0a3d86346b7a75a53b07311c095a879a22048590))
- ROM_LOAD16_BYTE("epr-12106a.24", 0x000001, 0x20000, CRC(d222f7a6) SHA1(ce73b9a155c0ebd4b1c0c71c80fd3dce6043dcf6))
+ ROM_LOAD16_BYTE("epr-12107a.25", 0x000000, 0x20000, CRC(0acaed3c) SHA1(0a3d86346b7a75a53b07311c095a879a22048590) )
+ ROM_LOAD16_BYTE("epr-12106a.24", 0x000001, 0x20000, CRC(d222f7a6) SHA1(ce73b9a155c0ebd4b1c0c71c80fd3dce6043dcf6) )
// 26+27 not tested, probably not used
ROM_REGION(0x040000, "subx", 0) // X
- ROM_LOAD16_BYTE("epr-12111.81", 0x000000, 0x20000, CRC(41b0622c) SHA1(9751c88f4c0df2e0852cee071683c8e6156da8cb))
- ROM_LOAD16_BYTE("epr-12110.80", 0x000001, 0x20000, CRC(26db4865) SHA1(963c10156cddf44abc86dbe66349bc83656eda15))
+ ROM_LOAD16_BYTE("epr-12111.81", 0x000000, 0x20000, CRC(41b0622c) SHA1(9751c88f4c0df2e0852cee071683c8e6156da8cb) )
+ ROM_LOAD16_BYTE("epr-12110.80", 0x000001, 0x20000, CRC(26db4865) SHA1(963c10156cddf44abc86dbe66349bc83656eda15) )
ROM_REGION(0x040000, "suby", 0) // Y
- ROM_LOAD16_BYTE("epr-12109.54", 0x000000, 0x20000, CRC(256350b8) SHA1(72b05d3583d63766690fed4827ec586e832168d1))
- ROM_LOAD16_BYTE("epr-12108.53", 0x000001, 0x20000, CRC(a3a56771) SHA1(f41d466f31a1b833d21a7011314c48d5056409eb))
+ ROM_LOAD16_BYTE("epr-12109.54", 0x000000, 0x20000, CRC(256350b8) SHA1(72b05d3583d63766690fed4827ec586e832168d1) )
+ ROM_LOAD16_BYTE("epr-12108.53", 0x000001, 0x20000, CRC(a3a56771) SHA1(f41d466f31a1b833d21a7011314c48d5056409eb) )
ROM_REGION16_BE(0x080000, "bsprites", 0)
- ROM_LOAD16_BYTE("epr-12114.16", 0x000000, 0x20000, CRC(8b07e8eb) SHA1(22a4aff968d6de52372b7b2b5322d353f7b835ef))
- ROM_LOAD16_BYTE("epr-12115.14", 0x000001, 0x20000, CRC(045b2912) SHA1(697c8eff69bf1a23745d24171f0b50635cf8513e))
- ROM_LOAD16_BYTE("epr-12112.17", 0x040000, 0x20000, CRC(5dd13e81) SHA1(74ced668a36480a2ce9e3667e4915bfee2391534))
- ROM_LOAD16_BYTE("epr-12113.15", 0x040001, 0x20000, CRC(69b8bd5a) SHA1(e312b60fff672363326b6169be7aff6b943d27c9))
+ ROM_LOAD16_BYTE("epr-12114.16", 0x000000, 0x20000, CRC(8b07e8eb) SHA1(22a4aff968d6de52372b7b2b5322d353f7b835ef) )
+ ROM_LOAD16_BYTE("epr-12115.14", 0x000001, 0x20000, CRC(045b2912) SHA1(697c8eff69bf1a23745d24171f0b50635cf8513e) )
+ ROM_LOAD16_BYTE("epr-12112.17", 0x040000, 0x20000, CRC(5dd13e81) SHA1(74ced668a36480a2ce9e3667e4915bfee2391534) )
+ ROM_LOAD16_BYTE("epr-12113.15", 0x040001, 0x20000, CRC(69b8bd5a) SHA1(e312b60fff672363326b6169be7aff6b943d27c9) )
ROM_REGION64_BE(0x400000, "ysprites", 0)
- ROMX_LOAD("epr-11757.67", 0x000000, 0x20000, CRC(e46dc478) SHA1(baf79e230aef3d63fb50373b2b1626f7c56ee94f), ROM_SKIP(7))
- ROMX_LOAD("epr-11758.75", 0x000001, 0x20000, CRC(5b435c87) SHA1(6b42b08e73957c36cd8faa896ca14461d00afd29), ROM_SKIP(7))
- ROMX_LOAD("epr-11773.63", 0x000002, 0x20000, CRC(1b5d5758) SHA1(54f58a274740a0566e0553d145c0c284ffd1d36b), ROM_SKIP(7))
- ROMX_LOAD("epr-11774.71", 0x000003, 0x20000, CRC(2ca0c170) SHA1(7de74c045bf084659ba70da9458d720125ff25ae), ROM_SKIP(7))
- ROMX_LOAD("epr-11759.86", 0x000004, 0x20000, CRC(ac8111f6) SHA1(6412716dc97ae697b438d9c9cd554d1087416bc2), ROM_SKIP(7))
- ROMX_LOAD("epr-11760.114", 0x000005, 0x20000, CRC(91282af9) SHA1(fddee7982949b7da724c7830e7bd139aeb84672d), ROM_SKIP(7))
- ROMX_LOAD("epr-11775.82", 0x000006, 0x20000, CRC(48225793) SHA1(ee003c2ea24c14e0968da94bac139735660932fe), ROM_SKIP(7))
- ROMX_LOAD("epr-11776.110", 0x000007, 0x20000, CRC(78c46198) SHA1(d299e631843da47cb7a46103d52a3dabfab71746), ROM_SKIP(7))
-
- ROMX_LOAD("epr-11761.66", 0x100000, 0x20000, CRC(baa5d065) SHA1(56dc71814e3f0f327781b0c1587038351c60f7b7), ROM_SKIP(7))
- ROMX_LOAD("epr-11762.74", 0x100001, 0x20000, CRC(1d1af7a5) SHA1(86c02565b5aca201588c98678fb0c54faa8d4d6b), ROM_SKIP(7))
- ROMX_LOAD("epr-11777.62", 0x100002, 0x20000, CRC(9662dd32) SHA1(454ec914b6c936f692bf90d2232c8169acec470a), ROM_SKIP(7))
- ROMX_LOAD("epr-11778.70", 0x100003, 0x20000, CRC(2dfb7494) SHA1(4b9f1609e425c5e634e95dbc2d0ca820dd9212bc), ROM_SKIP(7))
- ROMX_LOAD("epr-11763.85", 0x100004, 0x20000, CRC(1ee23407) SHA1(776c868e0e4e601fd6d0a83561b064b4be0560e2), ROM_SKIP(7))
- ROMX_LOAD("epr-11764.113", 0x100005, 0x20000, CRC(e859305e) SHA1(aafcc3209a4fb6e0e8169ae6cce386b370b824f7), ROM_SKIP(7))
- ROMX_LOAD("epr-11779.81", 0x100006, 0x20000, CRC(a49cd793) SHA1(efe77949be39a2ff88b50bfb2b4664b9267d9a09), ROM_SKIP(7))
- ROMX_LOAD("epr-11780.109", 0x100007, 0x20000, CRC(d514ed81) SHA1(fbac3ad085363972a79e77aebb7fdae2200e7cda), ROM_SKIP(7))
-
- ROMX_LOAD("epr-11765.65", 0x200000, 0x20000, CRC(649e2dff) SHA1(a6c61b71d08b31a0ca175ab0404e2eaf1d09ccc2), ROM_SKIP(7))
- ROMX_LOAD("epr-11766.73", 0x200001, 0x20000, CRC(d92fb7fc) SHA1(2f5c2d88ae0766351b9efe8ffcbebc88fc3a6c59), ROM_SKIP(7))
- ROMX_LOAD("epr-11781.61", 0x200002, 0x20000, CRC(9692d4cd) SHA1(967351ba2c781ca865e3c1ee9eeef1aad2247c27), ROM_SKIP(7))
- ROMX_LOAD("epr-11782.69", 0x200003, 0x20000, CRC(c913bb43) SHA1(9bc15a3180cf4c3134bb55e99e6092f0faf95c56), ROM_SKIP(7))
- ROMX_LOAD("epr-11767.84", 0x200004, 0x20000, CRC(1f8ad054) SHA1(289f5795116ee29540f28e35c3b4f72adeca7891), ROM_SKIP(7))
- ROMX_LOAD("epr-11768.112", 0x200005, 0x20000, CRC(db2c4053) SHA1(a5b6daa6deb7afb0019e289acb81c82d507ec93a), ROM_SKIP(7))
- ROMX_LOAD("epr-11783.80", 0x200006, 0x20000, CRC(6d189007) SHA1(dd871ea3166fdcb59d49707d35dde8b6c7fdc76b), ROM_SKIP(7))
- ROMX_LOAD("epr-11784.108", 0x200007, 0x20000, CRC(57f5fd64) SHA1(6aff54d3f3f76ce0f1a93485d1a35a3987d456d9), ROM_SKIP(7))
-
- ROMX_LOAD("epr-11769.64", 0x300000, 0x20000, CRC(28f0ab51) SHA1(d7cb7b83e5d85eb59d34cfd5c0d8e6c7ff81e24c), ROM_SKIP(7))
- ROMX_LOAD("epr-11770.72", 0x300001, 0x20000, CRC(d7557ea9) SHA1(62430505d399ee2cc0f94e03144860056345573c), ROM_SKIP(7))
- ROMX_LOAD("epr-11785.60", 0x300002, 0x20000, CRC(e6ef32c4) SHA1(869ba3816f5e3125f613f3b284fec74cd19db79e), ROM_SKIP(7))
- ROMX_LOAD("epr-11786.68", 0x300003, 0x20000, CRC(2066b49d) SHA1(905ce70c921043d07591422a87fedd6e897ff38e), ROM_SKIP(7))
- ROMX_LOAD("epr-11771.83", 0x300004, 0x20000, CRC(67635618) SHA1(f690ace026130ecb95532c92f2ad3741d0d167c1), ROM_SKIP(7))
- ROMX_LOAD("epr-11772.111", 0x300005, 0x20000, CRC(0f798d3a) SHA1(71565ce28b93ae50d64af8c965fba6408a07f031), ROM_SKIP(7))
- ROMX_LOAD("epr-11787.79", 0x300006, 0x20000, CRC(e631dc12) SHA1(3fd6db2eb297890b35dec566b6a90fc2d96bd085), ROM_SKIP(7))
- ROMX_LOAD("epr-11788.107", 0x300007, 0x20000, CRC(8464c66e) SHA1(af93cbcc50acbd929d0298fb9a75da0369e13ff7), ROM_SKIP(7))
+ ROMX_LOAD("epr-11757.67", 0x000000, 0x20000, CRC(e46dc478) SHA1(baf79e230aef3d63fb50373b2b1626f7c56ee94f), ROM_SKIP(7) )
+ ROMX_LOAD("epr-11758.75", 0x000001, 0x20000, CRC(5b435c87) SHA1(6b42b08e73957c36cd8faa896ca14461d00afd29), ROM_SKIP(7) )
+ ROMX_LOAD("epr-11773.63", 0x000002, 0x20000, CRC(1b5d5758) SHA1(54f58a274740a0566e0553d145c0c284ffd1d36b), ROM_SKIP(7) )
+ ROMX_LOAD("epr-11774.71", 0x000003, 0x20000, CRC(2ca0c170) SHA1(7de74c045bf084659ba70da9458d720125ff25ae), ROM_SKIP(7) )
+ ROMX_LOAD("epr-11759.86", 0x000004, 0x20000, CRC(ac8111f6) SHA1(6412716dc97ae697b438d9c9cd554d1087416bc2), ROM_SKIP(7) )
+ ROMX_LOAD("epr-11760.114", 0x000005, 0x20000, CRC(91282af9) SHA1(fddee7982949b7da724c7830e7bd139aeb84672d), ROM_SKIP(7) )
+ ROMX_LOAD("epr-11775.82", 0x000006, 0x20000, CRC(48225793) SHA1(ee003c2ea24c14e0968da94bac139735660932fe), ROM_SKIP(7) )
+ ROMX_LOAD("epr-11776.110", 0x000007, 0x20000, CRC(78c46198) SHA1(d299e631843da47cb7a46103d52a3dabfab71746), ROM_SKIP(7) )
+
+ ROMX_LOAD("epr-11761.66", 0x100000, 0x20000, CRC(baa5d065) SHA1(56dc71814e3f0f327781b0c1587038351c60f7b7), ROM_SKIP(7) )
+ ROMX_LOAD("epr-11762.74", 0x100001, 0x20000, CRC(1d1af7a5) SHA1(86c02565b5aca201588c98678fb0c54faa8d4d6b), ROM_SKIP(7) )
+ ROMX_LOAD("epr-11777.62", 0x100002, 0x20000, CRC(9662dd32) SHA1(454ec914b6c936f692bf90d2232c8169acec470a), ROM_SKIP(7) )
+ ROMX_LOAD("epr-11778.70", 0x100003, 0x20000, CRC(2dfb7494) SHA1(4b9f1609e425c5e634e95dbc2d0ca820dd9212bc), ROM_SKIP(7) )
+ ROMX_LOAD("epr-11763.85", 0x100004, 0x20000, CRC(1ee23407) SHA1(776c868e0e4e601fd6d0a83561b064b4be0560e2), ROM_SKIP(7) )
+ ROMX_LOAD("epr-11764.113", 0x100005, 0x20000, CRC(e859305e) SHA1(aafcc3209a4fb6e0e8169ae6cce386b370b824f7), ROM_SKIP(7) )
+ ROMX_LOAD("epr-11779.81", 0x100006, 0x20000, CRC(a49cd793) SHA1(efe77949be39a2ff88b50bfb2b4664b9267d9a09), ROM_SKIP(7) )
+ ROMX_LOAD("epr-11780.109", 0x100007, 0x20000, CRC(d514ed81) SHA1(fbac3ad085363972a79e77aebb7fdae2200e7cda), ROM_SKIP(7) )
+
+ ROMX_LOAD("epr-11765.65", 0x200000, 0x20000, CRC(649e2dff) SHA1(a6c61b71d08b31a0ca175ab0404e2eaf1d09ccc2), ROM_SKIP(7) )
+ ROMX_LOAD("epr-11766.73", 0x200001, 0x20000, CRC(d92fb7fc) SHA1(2f5c2d88ae0766351b9efe8ffcbebc88fc3a6c59), ROM_SKIP(7) )
+ ROMX_LOAD("epr-11781.61", 0x200002, 0x20000, CRC(9692d4cd) SHA1(967351ba2c781ca865e3c1ee9eeef1aad2247c27), ROM_SKIP(7) )
+ ROMX_LOAD("epr-11782.69", 0x200003, 0x20000, CRC(c913bb43) SHA1(9bc15a3180cf4c3134bb55e99e6092f0faf95c56), ROM_SKIP(7) )
+ ROMX_LOAD("epr-11767.84", 0x200004, 0x20000, CRC(1f8ad054) SHA1(289f5795116ee29540f28e35c3b4f72adeca7891), ROM_SKIP(7) )
+ ROMX_LOAD("epr-11768.112", 0x200005, 0x20000, CRC(db2c4053) SHA1(a5b6daa6deb7afb0019e289acb81c82d507ec93a), ROM_SKIP(7) )
+ ROMX_LOAD("epr-11783.80", 0x200006, 0x20000, CRC(6d189007) SHA1(dd871ea3166fdcb59d49707d35dde8b6c7fdc76b), ROM_SKIP(7) )
+ ROMX_LOAD("epr-11784.108", 0x200007, 0x20000, CRC(57f5fd64) SHA1(6aff54d3f3f76ce0f1a93485d1a35a3987d456d9), ROM_SKIP(7) )
+
+ ROMX_LOAD("epr-11769.64", 0x300000, 0x20000, CRC(28f0ab51) SHA1(d7cb7b83e5d85eb59d34cfd5c0d8e6c7ff81e24c), ROM_SKIP(7) )
+ ROMX_LOAD("epr-11770.72", 0x300001, 0x20000, CRC(d7557ea9) SHA1(62430505d399ee2cc0f94e03144860056345573c), ROM_SKIP(7) )
+ ROMX_LOAD("epr-11785.60", 0x300002, 0x20000, CRC(e6ef32c4) SHA1(869ba3816f5e3125f613f3b284fec74cd19db79e), ROM_SKIP(7) )
+ ROMX_LOAD("epr-11786.68", 0x300003, 0x20000, CRC(2066b49d) SHA1(905ce70c921043d07591422a87fedd6e897ff38e), ROM_SKIP(7) )
+ ROMX_LOAD("epr-11771.83", 0x300004, 0x20000, CRC(67635618) SHA1(f690ace026130ecb95532c92f2ad3741d0d167c1), ROM_SKIP(7) )
+ ROMX_LOAD("epr-11772.111", 0x300005, 0x20000, CRC(0f798d3a) SHA1(71565ce28b93ae50d64af8c965fba6408a07f031), ROM_SKIP(7) )
+ ROMX_LOAD("epr-11787.79", 0x300006, 0x20000, CRC(e631dc12) SHA1(3fd6db2eb297890b35dec566b6a90fc2d96bd085), ROM_SKIP(7) )
+ ROMX_LOAD("epr-11788.107", 0x300007, 0x20000, CRC(8464c66e) SHA1(af93cbcc50acbd929d0298fb9a75da0369e13ff7), ROM_SKIP(7) )
ROM_REGION(0x10000, "soundcpu", 0) // Z80 sound CPU
- ROM_LOAD("epr-11899.102", 0x000000, 0x10000, CRC(ed9fa889) SHA1(25d1a069254b34c31d8ee82d301ada895e8dc391))
+ ROM_LOAD("epr-11899.102", 0x000000, 0x10000, CRC(ed9fa889) SHA1(25d1a069254b34c31d8ee82d301ada895e8dc391) )
ROM_REGION(0x200000, "pcm", ROMREGION_ERASEFF) // SegaPCM samples
- ROM_LOAD("mpr-11754.107", 0x000000, 0x80000, CRC(ebeb8484) SHA1(269f33cb1a9be126bada858e25291385d48686a2))
- ROM_LOAD("epr-11756.105", 0x080000, 0x20000, CRC(12e43f8a) SHA1(0f9a11ba6b7c1a352daa1146a01ce147945e91e4))
+ ROM_LOAD("mpr-11754.107", 0x000000, 0x80000, CRC(ebeb8484) SHA1(269f33cb1a9be126bada858e25291385d48686a2) )
+ ROM_LOAD("epr-11756.105", 0x080000, 0x20000, CRC(12e43f8a) SHA1(0f9a11ba6b7c1a352daa1146a01ce147945e91e4) )
ROM_RELOAD( 0x0a0000, 0x20000)
ROM_RELOAD( 0x0c0000, 0x20000)
ROM_RELOAD( 0x0e0000, 0x20000)
- ROM_LOAD("epr-11755.106", 0x100000, 0x20000, CRC(c2db1244) SHA1(c98fe17c9f04a639a862cc2a86fab17d1f5d025c))
+ ROM_LOAD("epr-11755.106", 0x100000, 0x20000, CRC(c2db1244) SHA1(c98fe17c9f04a639a862cc2a86fab17d1f5d025c) )
ROM_RELOAD( 0x120000, 0x20000)
ROM_RELOAD( 0x140000, 0x20000)
ROM_RELOAD( 0x160000, 0x20000)
ROM_REGION(0x100000, "user1", 0)
// These are mpr-11754.107 split into 4 roms. They would be located on a Sega 839-0221 daughter card.
- ROM_LOAD("epr-11895.ic1", 0x000000, 0x20000, CRC(ee99a6fd) SHA1(4444826e751d9186e6d46b081e47cd99ee3cf853))
- ROM_LOAD("epr-11896.ic2", 0x000000, 0x20000, CRC(4bebc015) SHA1(307022ea1c1ee87c9ef3782526888c48c3c69fd2))
- ROM_LOAD("epr-11897.ic3", 0x000000, 0x20000, CRC(4463cb95) SHA1(e86fd4611cf83fe72d59950a60fc8c3a7381a1c7))
- ROM_LOAD("epr-11898.ic4", 0x000000, 0x20000, CRC(5d19d767) SHA1(d335cd3ef57c75e388df04b04fc3e2881a3902cf))
+ ROM_LOAD("epr-11895.ic1", 0x000000, 0x20000, CRC(ee99a6fd) SHA1(4444826e751d9186e6d46b081e47cd99ee3cf853) )
+ ROM_LOAD("epr-11896.ic2", 0x000000, 0x20000, CRC(4bebc015) SHA1(307022ea1c1ee87c9ef3782526888c48c3c69fd2) )
+ ROM_LOAD("epr-11897.ic3", 0x000000, 0x20000, CRC(4463cb95) SHA1(e86fd4611cf83fe72d59950a60fc8c3a7381a1c7) )
+ ROM_LOAD("epr-11898.ic4", 0x000000, 0x20000, CRC(5d19d767) SHA1(d335cd3ef57c75e388df04b04fc3e2881a3902cf) )
ROM_REGION(0x10000, "linkcpu", 0) // Z80 link board CPU
ROM_LOAD("epr-12028", 0x000000, 0x08000, CRC(bb682a92) SHA1(0445bdbca0db9edecd826da37cd2d3afc57c5cf6) )
@@ -2245,7 +2419,7 @@ ROM_END
//*************************************************************************************************************************
//*************************************************************************************************************************
//*************************************************************************************************************************
-// Rail Chase World, Sega Y-board
+// Rail Chase (World), Sega Y-board
// CPU: 68000 (317-????)
// CPU BD 837-8073-05
// VIDEO BD 837-8074-01
@@ -2263,8 +2437,8 @@ ROM_START( rchase )
ROM_LOAD16_BYTE( "epr-13991a.80", 0x000001, 0x20000, CRC(299e3c7c) SHA1(e4903816ec364e9352abd1180e8a609fed75e1a7) )
ROM_REGION( 0x040000, "suby", 0 ) // Y
- ROM_LOAD16_BYTE( "epr-14092.54", 0x000000, 0x20000, CRC(18eb23c5) SHA1(53e5681c7450a3879ed80c1680168d6295caa887) )
- ROM_LOAD16_BYTE( "epr-14091.53", 0x000001, 0x20000, CRC(72a56f71) SHA1(d45d3072ea92b5dde5c70138e56e7f0ca248880e) )
+ ROM_LOAD16_BYTE( "epr-14092.54", 0x000000, 0x20000, CRC(18eb23c5) SHA1(53e5681c7450a3879ed80c1680168d6295caa887) ) // same as epr-13990.54 below
+ ROM_LOAD16_BYTE( "epr-14091.53", 0x000001, 0x20000, CRC(72a56f71) SHA1(d45d3072ea92b5dde5c70138e56e7f0ca248880e) ) // 1 byte difference between regions
ROM_REGION16_BE( 0x080000, "bsprites", 0 )
ROM_LOAD16_BYTE( "mpr-13999.16", 0x000000, 0x40000, CRC(9a1dd53c) SHA1(cb01f2c64554914ea693879dfcb498181a1e7a9a) )
@@ -2308,7 +2482,7 @@ ROM_START( rchase )
ROM_END
//*************************************************************************************************************************
-// Rail Chase Japan, Sega Y-board
+// Rail Chase (Japan), Sega Y-board
// CPU: 68000 (317-????)
//
ROM_START( rchasej )
@@ -2323,8 +2497,8 @@ ROM_START( rchasej )
ROM_LOAD16_BYTE( "epr-13991a.80", 0x000001, 0x20000, CRC(299e3c7c) SHA1(e4903816ec364e9352abd1180e8a609fed75e1a7) )
ROM_REGION( 0x040000, "suby", 0 ) // Y
- ROM_LOAD16_BYTE( "epr-13990.54.verify", 0x000000, 0x20000, CRC(18eb23c5) SHA1(53e5681c7450a3879ed80c1680168d6295caa887) ) // Need to verify EPR #, same as epr-14092.54 above
- ROM_LOAD16_BYTE( "epr-13989.53.verify", 0x000001, 0x20000, CRC(8f4f824e) SHA1(d470f23ce2dca4e75b7b714175d47338c41bb721) ) // Need to verify EPR #
+ ROM_LOAD16_BYTE( "epr-13990.54", 0x000000, 0x20000, CRC(18eb23c5) SHA1(53e5681c7450a3879ed80c1680168d6295caa887) )
+ ROM_LOAD16_BYTE( "epr-13989.53", 0x000001, 0x20000, CRC(8f4f824e) SHA1(d470f23ce2dca4e75b7b714175d47338c41bb721) )
ROM_REGION16_BE( 0x080000, "bsprites", 0 )
ROM_LOAD16_BYTE( "mpr-13999.16", 0x000000, 0x40000, CRC(9a1dd53c) SHA1(cb01f2c64554914ea693879dfcb498181a1e7a9a) )
@@ -2590,10 +2764,12 @@ DRIVER_INIT_MEMBER(segaybd_state,rchase)
// YEAR, NAME, PARENT, MACHINE, INPUT, INIT, MONITOR,COMPANY,FULLNAME,FLAGS, LAYOUT
GAME( 1988, gforce2, 0, yboard, gforce2, segaybd_state, gforce2, ROT0, "Sega", "Galaxy Force 2", GAME_SUPPORTS_SAVE )
-GAME( 1988, gforce2j, gforce2, yboard, gforce2, segaybd_state, gforce2, ROT0, "Sega", "Galaxy Force 2 (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1988, gforce2sd, gforce2, yboard_deluxe, gforce2, segaybd_state, gforce2, ROT0, "Sega", "Galaxy Force 2 (Super Deluxe unit)", GAME_SUPPORTS_SAVE )
GAME( 1988, gforce2ja, gforce2, yboard, gforce2, segaybd_state, gforce2, ROT0, "Sega", "Galaxy Force 2 (Japan, Rev A)", GAME_SUPPORTS_SAVE )
+GAME( 1988, gforce2j, gforce2, yboard, gforce2, segaybd_state, gforce2, ROT0, "Sega", "Galaxy Force 2 (Japan)", GAME_SUPPORTS_SAVE )
-GAME( 1990, gloc, 0, yboard, gloc, segaybd_state, gloc, ROT0, "Sega", "G-LOC Air Battle (US)", GAME_SUPPORTS_SAVE )
+GAME( 1990, gloc, 0, yboard, gloc, segaybd_state, gloc, ROT0, "Sega", "G-LOC Air Battle (World)", GAME_SUPPORTS_SAVE )
+GAME( 1990, glocu, gloc, yboard, gloc, segaybd_state, gloc, ROT0, "Sega", "G-LOC Air Battle (US)", GAME_SUPPORTS_SAVE )
GAME( 1990, glocr360, gloc, yboard, glocr360, segaybd_state, r360, ROT0, "Sega", "G-LOC R360", GAME_SUPPORTS_SAVE )
GAMEL(1988, pdrift, 0, yboard, pdrift, segaybd_state, pdrift, ROT0, "Sega", "Power Drift (World, Rev A)", GAME_SUPPORTS_SAVE, layout_pdrift )
diff --git a/src/mame/drivers/seicross.c b/src/mame/drivers/seicross.c
index 4a6294e52ba..380023ace2d 100644
--- a/src/mame/drivers/seicross.c
+++ b/src/mame/drivers/seicross.c
@@ -127,7 +127,7 @@ static ADDRESS_MAP_START( mcu_nvram_map, AS_PROGRAM, 8, seicross_state )
AM_RANGE(0x0000, 0x007f) AM_RAM
AM_RANGE(0x1000, 0x10ff) AM_RAM AM_SHARE("nvram")
AM_RANGE(0x2000, 0x2000) AM_DEVWRITE("dac", dac_device, write_unsigned8)
- AM_RANGE(0x8000, 0xf7ff) AM_ROM
+ AM_RANGE(0x8000, 0xf7ff) AM_ROM AM_REGION("maincpu", 0)
AM_RANGE(0xf800, 0xffff) AM_RAM AM_SHARE("share1")
ADDRESS_MAP_END
@@ -137,10 +137,14 @@ static ADDRESS_MAP_START( mcu_no_nvram_map, AS_PROGRAM, 8, seicross_state )
AM_RANGE(0x1005, 0x1005) AM_READ_PORT("DSW2") /* DSW2 */
AM_RANGE(0x1006, 0x1006) AM_READ_PORT("DSW3") /* DSW3 */
AM_RANGE(0x2000, 0x2000) AM_DEVWRITE("dac", dac_device, write_unsigned8)
- AM_RANGE(0x8000, 0xf7ff) AM_ROM
+ AM_RANGE(0x8000, 0xf7ff) AM_ROM AM_REGION("maincpu", 0)
AM_RANGE(0xf800, 0xffff) AM_RAM AM_SHARE("share1")
ADDRESS_MAP_END
+static ADDRESS_MAP_START( decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 8, seicross_state )
+ AM_RANGE(0x8000, 0xf7ff) AM_ROM AM_SHARE("decrypted_opcodes")
+ AM_RANGE(0xf800, 0xffff) AM_RAM AM_SHARE("share1")
+ADDRESS_MAP_END
@@ -427,6 +431,11 @@ static MACHINE_CONFIG_DERIVED( nvram, no_nvram )
MCFG_NVRAM_ADD_CUSTOM_DRIVER("nvram", seicross_state, nvram_init)
MACHINE_CONFIG_END
+static MACHINE_CONFIG_DERIVED( friskytb, nvram )
+ MCFG_CPU_MODIFY("mcu")
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
+MACHINE_CONFIG_END
+
/***************************************************************************
@@ -435,7 +444,7 @@ MACHINE_CONFIG_END
***************************************************************************/
ROM_START( friskyt )
- ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_REGION( 0x7800, "maincpu", 0 )
ROM_LOAD( "ftom.01", 0x0000, 0x1000, CRC(bce5d486) SHA1(b3226d5737490f18092227a663e89ad48f39d82c) )
ROM_LOAD( "ftom.02", 0x1000, 0x1000, CRC(63157d6e) SHA1(2792f3d918ffee3818eca98f52192a069ab60678) )
ROM_LOAD( "ftom.03", 0x2000, 0x1000, CRC(c8d9ef2c) SHA1(43dd6bfd93188004b977b97120df28c028e8582b) )
@@ -445,9 +454,6 @@ ROM_START( friskyt )
ROM_LOAD( "ftom.07", 0x6000, 0x1000, CRC(b2ef303a) SHA1(a7150457b454e15c06fa832d42dd1f0e165fcd6e) )
ROM_LOAD( "ft8_8.rom", 0x7000, 0x0800, CRC(10461a24) SHA1(c1f98316a4e90a2a6ef4953708b90c9546caaedd) )
- ROM_REGION( 0x10000, "mcu", 0 ) /* 64k for the protection mcu */
- ROM_COPY( "maincpu", 0x0000, 0x8000, 0x8000 ) /* shares the main program ROMs and RAM with the main CPU. */
-
ROM_REGION( 0x4000, "gfx1", 0 )
ROM_LOAD( "ftom.11", 0x0000, 0x1000, CRC(1ec6ff65) SHA1(aab589c89cd14549b35f4dece5d3c231033c0c1a) )
ROM_LOAD( "ftom.12", 0x1000, 0x1000, CRC(3b8f40b5) SHA1(08e0c1fce11ee6c507c28b0d659c5b010f2f2b6f) )
@@ -460,7 +466,7 @@ ROM_START( friskyt )
ROM_END
ROM_START( friskyta )
- ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_REGION( 0x7800, "maincpu", 0 )
ROM_LOAD( "ft.01", 0x0000, 0x1000, CRC(0ea46e19) SHA1(3feb3ee882926c0efa602cf92e6879e84a6050ed) )
ROM_LOAD( "ft.02", 0x1000, 0x1000, CRC(4f7b8662) SHA1(400c47d7ab5f3a749dbadb2286255b969ec48348) )
ROM_LOAD( "ft.03", 0x2000, 0x1000, CRC(1eb1b77c) SHA1(c08d6c1f1bbe2d41b0f6336a0c53ec993556e6b4) )
@@ -470,9 +476,6 @@ ROM_START( friskyta )
ROM_LOAD( "ft.07", 0x6000, 0x1000, CRC(0ba02b2e) SHA1(1260c16d589fca37bf58ee28a4795f4b6333d0b9) )
ROM_LOAD( "ft8_8.rom", 0x7000, 0x0800, CRC(10461a24) SHA1(c1f98316a4e90a2a6ef4953708b90c9546caaedd) )
- ROM_REGION( 0x10000, "mcu", 0 ) /* 64k for the protection mcu */
- ROM_COPY( "maincpu", 0x0000, 0x8000, 0x8000 ) /* shares the main program ROMs and RAM with the main CPU. */
-
ROM_REGION( 0x4000, "gfx1", 0 )
ROM_LOAD( "ft.11", 0x0000, 0x1000, CRC(956d924a) SHA1(e61bf5f187932c6cb676b4120cd95fe422f6a1a6) )
ROM_LOAD( "ft.12", 0x1000, 0x1000, CRC(c028d3b8) SHA1(9e8768b9658f8b05ade4dd5fb2ecde4a52627bc1) )
@@ -486,7 +489,7 @@ ROM_END
ROM_START( friskytb )
- ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_REGION( 0x7800, "maincpu", 0 )
ROM_LOAD( "1.3a", 0x0000, 0x1000, CRC(554bdb0f) SHA1(d56a421329c5191599983009e841cd84d5b7c710) )
ROM_LOAD( "2.3b", 0x1000, 0x1000, CRC(0658633a) SHA1(3bf09e0d77bd8fcb66563c82c849c0cc45d9cacf) )
ROM_LOAD( "3.3d", 0x2000, 0x1000, CRC(c8de15ff) SHA1(1bb2108700e9f8aa9c5416324a2d0bdd05e8ff25) )
@@ -496,9 +499,6 @@ ROM_START( friskytb )
ROM_LOAD( "7.3i", 0x6000, 0x1000, CRC(aa36a6b8) SHA1(bf8af71313459a775b07dcfdce455077c4f499bf) )
ROM_LOAD( "8.3j", 0x7000, 0x0800, CRC(10461a24) SHA1(c1f98316a4e90a2a6ef4953708b90c9546caaedd) )
- ROM_REGION( 0x10000, "mcu", 0 ) /* 64k for the protection mcu */
- ROM_COPY( "maincpu", 0x0000, 0x8000, 0x8000 ) /* shares the main program ROMs and RAM with the main CPU. */
-
ROM_REGION( 0x4000, "gfx1", 0 )
ROM_LOAD( "11.7l", 0x0000, 0x1000, CRC(caa93315) SHA1(af8fd135c0a9c0278705975c127a91f246341da1) ) // 99.707031% - tile 0x69 is blank vs ft.11 (it's the symbol used for lives, instead this set shows lives to the left of the HIGH SCORE text using different gfx)
ROM_LOAD( "12.7n", 0x1000, 0x1000, CRC(c028d3b8) SHA1(9e8768b9658f8b05ade4dd5fb2ecde4a52627bc1) )
@@ -511,7 +511,7 @@ ROM_START( friskytb )
ROM_END
ROM_START( radrad )
- ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_REGION( 0x7800, "maincpu", 0 )
ROM_LOAD( "1.3a", 0x0000, 0x1000, CRC(b1e958ca) SHA1(3ab5fc3314f202ba527470eacbb76d52fe969bca) )
ROM_LOAD( "2.3b", 0x1000, 0x1000, CRC(30ba76b3) SHA1(e6af1fc35fdc71d5436f0d29e5722cbcb4409196) )
ROM_LOAD( "3.3c", 0x2000, 0x1000, CRC(1c9f397b) SHA1(7f556c5bef5309d5048c3b9671b88ad646a8b648) )
@@ -521,9 +521,6 @@ ROM_START( radrad )
ROM_LOAD( "7.3g", 0x6000, 0x1000, CRC(02b1f9c9) SHA1(6b857ae477d3c92a58494140ffa3337dba8e77cc) )
ROM_LOAD( "8.3h", 0x7000, 0x0800, CRC(911c90e8) SHA1(94fa91e767ab27a1616f1768f97a44a59a3f3294) )
- ROM_REGION( 0x10000, "mcu", 0 ) /* 64k for the protection mcu */
- ROM_COPY( "maincpu", 0x0000, 0x8000, 0x8000 ) /* shares the main program ROMs and RAM with the main CPU. */
-
ROM_REGION( 0x4000, "gfx1", 0 )
ROM_LOAD( "11.l7", 0x0000, 0x1000, CRC(4ace7afb) SHA1(3c495f106505d5dfed93393db1f1b3842f603448) )
ROM_LOAD( "12.n7", 0x1000, 0x1000, CRC(b19b8473) SHA1(42160f978f8e209a89be097b5cfc7ac0aeec49c5) )
@@ -539,7 +536,7 @@ ROM_START( radrad )
ROM_END
ROM_START( seicross )
- ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_REGION( 0x7800, "maincpu", 0 )
ROM_LOAD( "smc1", 0x0000, 0x1000, CRC(f6c3aeca) SHA1(d57019e80f7e3d47ca74f54604e92d40ba9819fc) )
ROM_LOAD( "smc2", 0x1000, 0x1000, CRC(0ec6c218) SHA1(d8cffea48d8afd229f2008399afe3858c13653e5) )
ROM_LOAD( "smc3", 0x2000, 0x1000, CRC(ceb3c8f4) SHA1(e49f834637b4addcf362cd010e31802c3e145cbe) )
@@ -549,9 +546,6 @@ ROM_START( seicross )
ROM_LOAD( "smc7", 0x6000, 0x1000, CRC(13052b03) SHA1(2866f2533a788f734310a74789f762f3fa17a57a) )
ROM_LOAD( "smc8", 0x7000, 0x0800, CRC(2093461d) SHA1(0d640bc7ee1e9ffe32580e3143677475145b06d2) )
- ROM_REGION( 0x10000, "mcu", 0 ) /* 64k for the protection mcu */
- ROM_COPY( "maincpu", 0x0000, 0x8000, 0x8000 ) /* shares the main program ROMs and RAM with the main CPU. */
-
ROM_REGION( 0x4000, "gfx1", 0 )
ROM_LOAD( "sz11.7k", 0x0000, 0x1000, CRC(fbd9b91d) SHA1(6b3581f4b518c058b970d569ced07dd7dc6a87e6) )
ROM_LOAD( "smcd", 0x1000, 0x1000, CRC(c3c953c4) SHA1(a96937a48b59b7e992e53d279c10a5f3ea7f9a6f) )
@@ -567,7 +561,7 @@ ROM_START( seicross )
ROM_END
ROM_START( sectrzon )
- ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_REGION( 0x7800, "maincpu", 0 )
ROM_LOAD( "sz1.3a", 0x0000, 0x1000, CRC(f0a45cb4) SHA1(ab3b8d78e25cdbb2fd6a6c0718ae13767364994d) )
ROM_LOAD( "sz2.3c", 0x1000, 0x1000, CRC(fea68ddb) SHA1(b9ed0cad9a2ded04bcc7042d975b77be63313070) )
ROM_LOAD( "sz3.3d", 0x2000, 0x1000, CRC(baad4294) SHA1(e7fc3ccc940de6df8d786c986b602127c9db9ebb) )
@@ -577,9 +571,6 @@ ROM_START( sectrzon )
ROM_LOAD( "sz7.3i", 0x6000, 0x1000, CRC(7b34dc1c) SHA1(fb163a908c991cd214e0d2d685e74563a460a929) )
ROM_LOAD( "sz8.3j", 0x7000, 0x0800, CRC(9933526a) SHA1(2178ef8653f1d60be28bcaebe1033ef7ae480157) )
- ROM_REGION( 0x10000, "mcu", 0 ) /* 64k for the protection mcu */
- ROM_COPY( "maincpu", 0x0000, 0x8000, 0x8000 ) /* shares the main program ROMs and RAM with the main CPU. */
-
ROM_REGION( 0x4000, "gfx1", 0 )
ROM_LOAD( "sz11.7k", 0x0000, 0x1000, CRC(fbd9b91d) SHA1(6b3581f4b518c058b970d569ced07dd7dc6a87e6) )
ROM_LOAD( "sz12.7m", 0x1000, 0x1000, CRC(2bdef9ad) SHA1(50fe41e81c1307317b4fb6b47bf0619d141c42ff) )
@@ -596,21 +587,18 @@ ROM_END
DRIVER_INIT_MEMBER(seicross_state,friskytb)
{
- UINT8 *ROM = memregion("mcu")->base();
- address_space &space = m_mcu->space(AS_PROGRAM);
+ UINT8 *ROM = memregion("maincpu")->base();
// this code is in ROM 6.3h, maps to MCU at dxxx
- for (int i = 0; i < 0x8000; i++)
+ for (int i = 0; i < 0x7800; i++)
{
- ROM[i] = BITSWAP8(ROM[i + 0x8000], 6, 7, 5, 4, 3, 2, 0, 1);
+ m_decrypted_opcodes[i] = BITSWAP8(ROM[i], 6, 7, 5, 4, 3, 2, 0, 1);
}
-
- space.set_decrypted_region(0x8000, 0xffff, ROM);
}
GAME( 1981, friskyt, 0, nvram, friskyt, driver_device, 0, ROT0, "Nichibutsu", "Frisky Tom (set 1)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
GAME( 1981, friskyta, friskyt, nvram, friskyt, driver_device, 0, ROT0, "Nichibutsu", "Frisky Tom (set 2)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
-GAME( 1981, friskytb, friskyt, nvram, friskyt, seicross_state, friskytb, ROT0, "Nichibutsu", "Frisky Tom (set 3, encrypted)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) // protection mcu runs encrypted opcodes
+GAME( 1981, friskytb, friskyt, friskytb, friskyt, seicross_state, friskytb, ROT0, "Nichibutsu", "Frisky Tom (set 3, encrypted)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) // protection mcu runs encrypted opcodes
GAME( 1982, radrad, 0, no_nvram, radrad, driver_device, 0, ROT0, "Nichibutsu USA", "Radical Radial", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
GAME( 1984, seicross, 0, no_nvram, seicross, driver_device, 0, ROT90, "Nichibutsu / Alice", "Seicross", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
GAME( 1984, sectrzon, seicross, no_nvram, seicross, driver_device, 0, ROT90, "Nichibutsu / Alice", "Sector Zone", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/senjyo.c b/src/mame/drivers/senjyo.c
index 16b3440d986..decc626fc7d 100644
--- a/src/mame/drivers/senjyo.c
+++ b/src/mame/drivers/senjyo.c
@@ -166,8 +166,12 @@ static ADDRESS_MAP_START( senjyo_map, AS_PROGRAM, 8, senjyo_state )
AM_RANGE(0xd005, 0xd005) AM_READ_PORT("DSW2")
ADDRESS_MAP_END
+static ADDRESS_MAP_START( decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 8, senjyo_state )
+ AM_RANGE(0x0000, 0x7fff) AM_ROM AM_SHARE("decrypted_opcodes")
+ADDRESS_MAP_END
+
static ADDRESS_MAP_START( senjyo_sound_map, AS_PROGRAM, 8, senjyo_state )
- AM_RANGE(0x0000, 0x3fff) AM_ROM
+ AM_RANGE(0x0000, 0x1fff) AM_ROM
AM_RANGE(0x4000, 0x43ff) AM_RAM
AM_RANGE(0x8000, 0x8000) AM_DEVWRITE("sn1", sn76496_device, write)
AM_RANGE(0x9000, 0x9000) AM_DEVWRITE("sn2", sn76496_device, write)
@@ -233,7 +237,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( starforb_sound_map, AS_PROGRAM, 8, senjyo_state )
- AM_RANGE(0x0000, 0x3fff) AM_ROM
+ AM_RANGE(0x0000, 0x1fff) AM_ROM
AM_RANGE(0x4000, 0x43ff) AM_RAM
AM_RANGE(0x8000, 0x8000) AM_DEVWRITE("sn1", sn76496_device, write)
AM_RANGE(0x9000, 0x9000) AM_DEVWRITE("sn2", sn76496_device, write)
@@ -606,8 +610,12 @@ static MACHINE_CONFIG_START( senjyo, senjyo_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.05)
MACHINE_CONFIG_END
+static MACHINE_CONFIG_DERIVED( senjyox, senjyo )
+ MCFG_CPU_MODIFY("maincpu")
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
+MACHINE_CONFIG_END
-static MACHINE_CONFIG_DERIVED( starforb, senjyo )
+static MACHINE_CONFIG_DERIVED( starforb, senjyox )
/* basic machine hardware */
MCFG_CPU_MODIFY("maincpu")
@@ -625,13 +633,13 @@ MACHINE_CONFIG_END
***************************************************************************/
ROM_START( senjyo )
- ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_REGION( 0x8000, "maincpu", 0 )
ROM_LOAD( "08m_05t.bin", 0x0000, 0x2000, CRC(b1f3544d) SHA1(59997164dfb740fce1862d89754be7517303161a) )
ROM_LOAD( "08k_04t.bin", 0x2000, 0x2000, CRC(e34468a8) SHA1(1931788e4ebe0dab9525f795b639be6544a6b31a) )
ROM_LOAD( "08j_03t.bin", 0x4000, 0x2000, CRC(c33aedee) SHA1(5adf83268ef7b91194dea41204bdb931a14f2158) )
ROM_LOAD( "08f_02t.bin", 0x6000, 0x2000, CRC(0ef4db9e) SHA1(0dcb216495f4328c44cc0af87ffb0bd255b7dc1a) )
- ROM_REGION( 0x10000, "sub", 0 ) /* 64k for sound board */
+ ROM_REGION( 0x2000, "sub", 0 )
ROM_LOAD( "02h_01t.bin", 0x0000, 0x2000, CRC(c1c24455) SHA1(24a2ab9e4df793f68f51bbe6a1313f38d951a8af) )
ROM_REGION( 0x03000, "gfx1", 0 )
@@ -666,11 +674,11 @@ ROM_START( senjyo )
ROM_END
ROM_START( starforc )
- ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_REGION( 0x8000, "maincpu", 0 )
ROM_LOAD( "3.3p", 0x0000, 0x4000, CRC(8ba27691) SHA1(2b8b1e634ef5bed5c61a078e64a6dda77f84cdf5) )
ROM_LOAD( "2.3mn", 0x4000, 0x4000, CRC(0fc4d2d6) SHA1(0743e3928d5cc0e3f1bcdaf4b0cc83aeb7a2f7a8) )
- ROM_REGION( 0x10000, "sub", 0 ) /* 64k for sound board */
+ ROM_REGION( 0x2000, "sub", 0 ) /* 64k for sound board */
ROM_LOAD( "1.3hj", 0x0000, 0x2000, CRC(2735bb22) SHA1(1bd0558e05b41aebab3911991969512df904fea5) )
ROM_REGION( 0x03000, "gfx1", 0 )
@@ -703,13 +711,13 @@ ROM_START( starforc )
ROM_END
ROM_START( starforcb )
- ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_REGION( 0x8000, "maincpu", 0 )
ROM_LOAD( "a2.8m", 0x0000, 0x2000, CRC(e81e8b7d) SHA1(829a082a335a0cf5bf8cc97bee96e62271f03ff4) )
ROM_LOAD( "a3.8k", 0x2000, 0x2000, CRC(7e98f0ab) SHA1(76eb387fbf5d04b7951a115d29076d1fd21346c4) )
ROM_LOAD( "a4.8j", 0x4000, 0x2000, CRC(285bc599) SHA1(c2f294a5e3ca39084e8f8503d6e9e00885ad0609) )
ROM_LOAD( "a5.8f", 0x6000, 0x2000, CRC(74d328b1) SHA1(3098438d47f650507de8b1d0aecfca81663cbe9c) )
- ROM_REGION( 0x10000, "sub", 0 ) /* 64k for sound board */
+ ROM_REGION( 0x2000, "sub", 0 )
ROM_LOAD( "a0.2e", 0x0000, 0x2000, CRC(5ab0e2fa) SHA1(78f0290d1e006a39bb8ee5a29cf229ed2c1f2b09) )
ROM_REGION( 0x03000, "gfx1", 0 )
@@ -745,13 +753,13 @@ ROM_START( starforcb )
ROM_END
ROM_START( starforca )
- ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_REGION( 0x8000, "maincpu", 0 )
ROM_LOAD( "5.bin", 0x0000, 0x2000, CRC(7691bbd4) SHA1(efcab11ea0ed58b6a47c9d7a994c921dfaa1b47e) )
ROM_LOAD( "4.bin", 0x2000, 0x2000, CRC(32f3c34e) SHA1(9ecaa46fe296c2f2e9c8faf3d40085c0f10acbe1) )
ROM_LOAD( "3.bin", 0x4000, 0x2000, CRC(5e99cfa0) SHA1(d16d5247f4afb7abb5b8331ad7ae9d4d1f6d6554) )
ROM_LOAD( "2.bin", 0x6000, 0x2000, CRC(311c6e59) SHA1(ff3ba96ffade7602d3b150dae4bdc1c02a148576) )
- ROM_REGION( 0x10000, "sub", 0 ) /* 64k for sound board */
+ ROM_REGION( 0x2000, "sub", 0 )
ROM_LOAD( "0.bin", 0x0000, 0x2000, CRC(a277c268) SHA1(99ed8439119fa4b850ad8aadb7ff3e54d4cd40be) )
ROM_REGION( 0x03000, "gfx1", 0 )
@@ -787,13 +795,13 @@ ROM_START( starforca )
ROM_END
ROM_START( starforce )
- ROM_REGION( 2*0x10000, "maincpu", 0 ) /* 64k for code + 64k for decrypted opcodes */
+ ROM_REGION( 0x8000, "maincpu", 0 )
ROM_LOAD( "starfore.005", 0x0000, 0x2000, CRC(825f7ebe) SHA1(d63fd516e075bcc28d42189216b95bbf491a4cd1) )
ROM_LOAD( "starfore.004", 0x2000, 0x2000, CRC(fbcecb65) SHA1(0406ae134915539a171603ecdd1b549f98dd048c) )
ROM_LOAD( "starfore.003", 0x4000, 0x2000, CRC(9f8013b9) SHA1(5398c97d84b4458ff926e07d6189d60565fbd8f1) )
ROM_LOAD( "starfore.002", 0x6000, 0x2000, CRC(f8111eba) SHA1(cf3295ffae4e36e87aea4332613f2cafb51522ce) )
- ROM_REGION( 0x10000, "sub", 0 ) /* 64k for sound board */
+ ROM_REGION( 0x2000, "sub", 0 )
ROM_LOAD( "starfore.000", 0x0000, 0x2000, CRC(a277c268) SHA1(99ed8439119fa4b850ad8aadb7ff3e54d4cd40be) )
ROM_REGION( 0x03000, "gfx1", 0 )
@@ -826,11 +834,11 @@ ROM_START( starforce )
ROM_END
ROM_START( megaforc )
- ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_REGION( 0x8000, "maincpu", 0 )
ROM_LOAD( "mf3.bin", 0x0000, 0x4000, CRC(d3ea82ec) SHA1(e15fda65ba24517cc04abc55b5d079a33327553c) )
ROM_LOAD( "mf2.bin", 0x4000, 0x4000, CRC(aa320718) SHA1(cbbf8e4d06a1ecf77d776058d965afdaa7f5b47f) )
- ROM_REGION( 0x10000, "sub", 0 ) /* 64k for sound board */
+ ROM_REGION( 0x2000, "sub", 0 )
ROM_LOAD( "1.3hj", 0x0000, 0x2000, CRC(2735bb22) SHA1(1bd0558e05b41aebab3911991969512df904fea5) )
ROM_REGION( 0x03000, "gfx1", 0 )
@@ -863,11 +871,11 @@ ROM_START( megaforc )
ROM_END
ROM_START( baluba )
- ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_REGION( 0x8000, "maincpu", 0 )
ROM_LOAD( "0", 0x0000, 0x4000, CRC(0e2ebe32) SHA1(d5cac260b19dc4e8d2064a7e3de5d52ab0eb95d0) )
ROM_LOAD( "1", 0x4000, 0x4000, CRC(cde97076) SHA1(ef47851b2ed0d820e1564545795b707d00d5c6ce) )
- ROM_REGION( 0x10000, "sub", 0 ) /* 64k for sound board */
+ ROM_REGION( 0x2000, "sub", 0 )
ROM_LOAD( "2", 0x0000, 0x2000, CRC(441fbc64) SHA1(3853f80043e28e06a3ee399e3cd261b3ee94e0b9) )
ROM_REGION( 0x03000, "gfx1", 0 )
@@ -907,8 +915,29 @@ DRIVER_INIT_MEMBER(senjyo_state,starforc)
}
DRIVER_INIT_MEMBER(senjyo_state,starfore)
{
- /* encrypted CPU */
- suprloco_decode(machine(), "maincpu");
+ static const UINT8 convtable[32][4] =
+ {
+ /* opcode data address */
+ /* A B C D A B C D */
+ { 0x20,0x00,0xa0,0x80 }, { 0xa8,0xa0,0x88,0x80 }, /* ...0...0...0...0 */
+ { 0x20,0x00,0xa0,0x80 }, { 0xa8,0xa0,0x88,0x80 }, /* ...0...0...0...1 */
+ { 0x20,0x00,0xa0,0x80 }, { 0xa8,0xa0,0x88,0x80 }, /* ...0...0...1...0 */
+ { 0x88,0x08,0x80,0x00 }, { 0xa0,0x80,0xa8,0x88 }, /* ...0...0...1...1 */
+ { 0x88,0x08,0x80,0x00 }, { 0xa0,0x80,0xa8,0x88 }, /* ...0...1...0...0 */
+ { 0x20,0x00,0xa0,0x80 }, { 0xa8,0xa0,0x88,0x80 }, /* ...0...1...0...1 */
+ { 0x88,0x08,0x80,0x00 }, { 0xa0,0x80,0xa8,0x88 }, /* ...0...1...1...0 */
+ { 0x28,0xa8,0x08,0x88 }, { 0x88,0x80,0x08,0x00 }, /* ...0...1...1...1 */
+ { 0x20,0x00,0xa0,0x80 }, { 0xa8,0xa0,0x88,0x80 }, /* ...1...0...0...0 */
+ { 0x88,0x08,0x80,0x00 }, { 0xa0,0x80,0xa8,0x88 }, /* ...1...0...0...1 */
+ { 0x88,0x08,0x80,0x00 }, { 0xa0,0x80,0xa8,0x88 }, /* ...1...0...1...0 */
+ { 0x20,0x00,0xa0,0x80 }, { 0xa8,0xa0,0x88,0x80 }, /* ...1...0...1...1 */
+ { 0x88,0x08,0x80,0x00 }, { 0xa0,0x80,0xa8,0x88 }, /* ...1...1...0...0 */
+ { 0x28,0xa8,0x08,0x88 }, { 0x88,0x80,0x08,0x00 }, /* ...1...1...0...1 */
+ { 0x20,0x00,0xa0,0x80 }, { 0xa8,0xa0,0x88,0x80 }, /* ...1...1...1...0 */
+ { 0x88,0x08,0x80,0x00 }, { 0xa0,0x80,0xa8,0x88 } /* ...1...1...1...1 */
+ };
+
+ sega_decode(memregion("maincpu")->base(), m_decrypted_opcodes, 0x8000, convtable);
m_is_senjyo = 0;
m_scrollhack = 0;
@@ -916,8 +945,29 @@ DRIVER_INIT_MEMBER(senjyo_state,starfore)
DRIVER_INIT_MEMBER(senjyo_state,starfora)
{
- /* encrypted CPU */
- yamato_decode(machine(), "maincpu");
+ static const UINT8 convtable[32][4] =
+ {
+ /* opcode data address */
+ /* A B C D A B C D */
+ { 0x88,0xa8,0x08,0x28 }, { 0x88,0xa8,0x80,0xa0 }, /* ...0...0...0...0 */
+ { 0x20,0xa0,0x28,0xa8 }, { 0x88,0xa8,0x80,0xa0 }, /* ...0...0...0...1 */
+ { 0x88,0xa8,0x80,0xa0 }, { 0x88,0xa8,0x80,0xa0 }, /* ...0...0...1...0 */
+ { 0x88,0xa8,0x80,0xa0 }, { 0x20,0xa0,0x28,0xa8 }, /* ...0...0...1...1 */
+ { 0x88,0xa8,0x08,0x28 }, { 0x88,0xa8,0x08,0x28 }, /* ...0...1...0...0 */
+ { 0x88,0xa8,0x80,0xa0 }, { 0x88,0xa8,0x80,0xa0 }, /* ...0...1...0...1 */
+ { 0x20,0xa0,0x28,0xa8 }, { 0x20,0xa0,0x28,0xa8 }, /* ...0...1...1...0 */
+ { 0x88,0xa8,0x80,0xa0 }, { 0x88,0xa8,0x80,0xa0 }, /* ...0...1...1...1 */
+ { 0x20,0xa0,0x28,0xa8 }, { 0x88,0xa8,0x08,0x28 }, /* ...1...0...0...0 */
+ { 0x20,0xa0,0x28,0xa8 }, { 0x28,0x20,0xa8,0xa0 }, /* ...1...0...0...1 */
+ { 0xa0,0x20,0x80,0x00 }, { 0x20,0xa0,0x28,0xa8 }, /* ...1...0...1...0 */
+ { 0x28,0x20,0xa8,0xa0 }, { 0x20,0xa0,0x28,0xa8 }, /* ...1...0...1...1 */
+ { 0x20,0xa0,0x28,0xa8 }, { 0x88,0xa8,0x08,0x28 }, /* ...1...1...0...0 */
+ { 0x88,0xa8,0x08,0x28 }, { 0x88,0xa8,0x08,0x28 }, /* ...1...1...0...1 */
+ { 0xa0,0x20,0x80,0x00 }, { 0x88,0x08,0x80,0x00 }, /* ...1...1...1...0 */
+ { 0x20,0xa0,0x28,0xa8 }, { 0x00,0x08,0x20,0x28 } /* ...1...1...1...1 */
+ };
+
+ sega_decode(memregion("maincpu")->base(), m_decrypted_opcodes, 0x8000, convtable);
m_is_senjyo = 0;
m_scrollhack = 1;
@@ -932,8 +982,8 @@ DRIVER_INIT_MEMBER(senjyo_state,senjyo)
GAME( 1983, senjyo, 0, senjyo, senjyo, senjyo_state, senjyo, ROT90, "Tehkan", "Senjyo", GAME_SUPPORTS_SAVE )
GAME( 1984, starforc, 0, senjyo, starforc, senjyo_state, starforc, ROT90, "Tehkan", "Star Force", GAME_SUPPORTS_SAVE )
-GAME( 1984, starforce,starforc, senjyo, starforc, senjyo_state, starfore, ROT90, "Tehkan", "Star Force (encrypted, set 1)", GAME_SUPPORTS_SAVE )
+GAME( 1984, starforce,starforc, senjyox, starforc, senjyo_state, starfore, ROT90, "Tehkan", "Star Force (encrypted, set 1)", GAME_SUPPORTS_SAVE )
GAME( 1984, starforcb,starforc, starforb,starforc, senjyo_state, starfore, ROT90, "bootleg", "Star Force (encrypted, bootleg)", GAME_SUPPORTS_SAVE )
-GAME( 1984, starforca,starforc, senjyo, starforc, senjyo_state, starfora, ROT90, "Tehkan", "Star Force (encrypted, set 2)", GAME_SUPPORTS_SAVE )
+GAME( 1984, starforca,starforc, senjyox, starforc, senjyo_state, starfora, ROT90, "Tehkan", "Star Force (encrypted, set 2)", GAME_SUPPORTS_SAVE )
GAME( 1985, megaforc, starforc, senjyo, starforc, senjyo_state, starforc, ROT90, "Tehkan (Video Ware license)", "Mega Force", GAME_SUPPORTS_SAVE )
GAME( 1986, baluba, 0, senjyo, baluba, senjyo_state, starforc, ROT90, "Able Corp, Ltd.", "Baluba-louk no Densetsu (Japan)", GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/seta.c b/src/mame/drivers/seta.c
index d456ec77f50..9f22097eb51 100644
--- a/src/mame/drivers/seta.c
+++ b/src/mame/drivers/seta.c
@@ -94,6 +94,7 @@ Notes:
DIP Locations verified from manuals for:
- Zing Zing Zip
- Extreme Downhill
+- Kero Kero Keroppi's Let's Play Together
TODO:
- I think the best way to correctly align tilemaps and sprites and account for
@@ -1996,7 +1997,7 @@ static ADDRESS_MAP_START( wrofaero_map, AS_PROGRAM, 16, seta_state )
#else
AM_RANGE(0xd00000, 0xd00007) AM_WRITENOP // ?
#endif
- AM_RANGE(0xe00000, 0xe00001) AM_WRITENOP // ? VBlank IRQ Ack
+ AM_RANGE(0xe00000, 0xe00001) AM_WRITE(watchdog_reset16_w)
AM_RANGE(0xf00000, 0xf00001) AM_WRITENOP // ? Sound IRQ Ack
ADDRESS_MAP_END
@@ -6765,55 +6766,49 @@ static INPUT_PORTS_START( keroppi )
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("DSW") //2 DSWs - $600001 & 3.b
- PORT_DIPNAME( 0x0001, 0x0001, "Unknown 2-1" ) PORT_DIPLOCATION("SW2:1")
- PORT_DIPSETTING( 0x0001, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
- PORT_DIPNAME( 0x0002, 0x0002, "Unknown 2-2" ) PORT_DIPLOCATION("SW2:2")
- PORT_DIPSETTING( 0x0002, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
- PORT_DIPNAME( 0x0004, 0x0004, "Unknown 2-3" ) PORT_DIPLOCATION("SW2:3")
- PORT_DIPSETTING( 0x0004, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
- PORT_DIPNAME( 0x0008, 0x0008, "Unknown 2-4" ) PORT_DIPLOCATION("SW2:4")
- PORT_DIPSETTING( 0x0008, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
- PORT_DIPNAME( 0x0010, 0x0010, "Unknown 2-5" ) PORT_DIPLOCATION("SW2:5")
- PORT_DIPSETTING( 0x0010, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
- PORT_DIPNAME( 0x0020, 0x0020, "Unknown 2-6" ) PORT_DIPLOCATION("SW2:6")
- PORT_DIPSETTING( 0x0020, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
- PORT_DIPNAME( 0x0040, 0x0040, "Unknown 2-7" ) PORT_DIPLOCATION("SW2:7")
- PORT_DIPSETTING( 0x0040, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
- PORT_DIPNAME( 0x0080, 0x0080, "Unknown 2-8" ) PORT_DIPLOCATION("SW2:8")
- PORT_DIPSETTING( 0x0080, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
-
- PORT_DIPNAME( 0x0100, 0x0100, "Unknown 1-1" ) PORT_DIPLOCATION("SW1:1")
- PORT_DIPSETTING( 0x0100, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
- PORT_DIPNAME( 0x0200, 0x0200, "Unknown 1-2" ) PORT_DIPLOCATION("SW1:2")
- PORT_DIPSETTING( 0x0200, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
- PORT_DIPNAME( 0x0400, 0x0400, "Unknown 1-3" ) PORT_DIPLOCATION("SW1:3")
- PORT_DIPSETTING( 0x0400, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
- PORT_DIPNAME( 0x0800, 0x0800, "Unknown 1-4" ) PORT_DIPLOCATION("SW1:4")
- PORT_DIPSETTING( 0x0800, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
+ PORT_DIPNAME( 0x0003, 0x0003, "Obstacle Course Payout Setting" ) PORT_DIPLOCATION("SW2:1,2")
+ PORT_DIPSETTING( 0x0000, "Highest (0, 3, 5, 7, 15 Tickets)" )
+ PORT_DIPSETTING( 0x0001, "High (0, 3, 4, 5, 10 Tickets)" )
+ PORT_DIPSETTING( 0x0002, "Low (0, 1, 2, 3, 6 Tickets)" )
+ PORT_DIPSETTING( 0x0003, "Medium (0, 2, 3, 4, 8 Tickets)" )
+ PORT_DIPNAME( 0x000c, 0x000c, "Treasure Hunt Payout Setting" ) PORT_DIPLOCATION("SW2:3,4")
+ PORT_DIPSETTING( 0x0000, "Highest (5, 10, 15 Tickets)" )
+ PORT_DIPSETTING( 0x0004, "High (5, 7, 10 Tickets)" )
+ PORT_DIPSETTING( 0x0008, "Low (1, 3, 5 Tickets)" )
+ PORT_DIPSETTING( 0x000c, "Medium (3, 5, 7 Tickets)" )
+ PORT_DIPNAME( 0x0030, 0x0030, "New Jersey Payout Setting" ) PORT_DIPLOCATION("SW2:5,6")
+ PORT_DIPSETTING( 0x0000, "Always Payout 5 Tickets" )
+ PORT_DIPSETTING( 0x0010, "Always Payout 3 Tickets" )
+ PORT_DIPSETTING( 0x0020, "Always Payout 1 Ticket" )
+ PORT_DIPSETTING( 0x0030, DEF_STR( Off ) )
+ PORT_DIPNAME( 0x00c0, 0x00c0, "Mercy Ticket Payout Setting (Treasure Hunt Only" ) PORT_DIPLOCATION("SW2:7,8")
+ PORT_DIPSETTING( 0x0000, "No Payout" )
+ PORT_DIPSETTING( 0x0040, "3 Tickets" )
+ PORT_DIPSETTING( 0x0080, "2 Tickets" )
+ PORT_DIPSETTING( 0x00c0, "1 Ticket" )
+
+ PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1,2")
+ PORT_DIPSETTING( 0x0000, DEF_STR( 4C_1C ) )
+ PORT_DIPSETTING( 0x0100, DEF_STR( 3C_1C ) )
+ PORT_DIPSETTING( 0x0200, DEF_STR( 2C_1C ) )
+ PORT_DIPSETTING( 0x0300, DEF_STR( 1C_1C ) )
+ PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:3")
+ PORT_DIPSETTING( 0x0400, DEF_STR( On ) )
+ PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
+ PORT_DIPNAME( 0x0800, 0x0800, "Vending Style" ) PORT_DIPLOCATION("SW1:4")
+ PORT_DIPSETTING( 0x0800, "Ticket" )
+ PORT_DIPSETTING( 0x0000, "No Vending" )
PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW1:5")
PORT_DIPSETTING( 0x1000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
- PORT_DIPNAME( 0x2000, 0x2000, "Unknown 1-6" ) PORT_DIPLOCATION("SW1:6")
- PORT_DIPSETTING( 0x2000, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
- PORT_DIPNAME( 0x4000, 0x4000, "Unknown 1-7" ) PORT_DIPLOCATION("SW1:7")
- PORT_DIPSETTING( 0x4000, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
- PORT_DIPNAME( 0x8000, 0x8000, "Unknown 1-8" ) PORT_DIPLOCATION("SW1:8")
- PORT_DIPSETTING( 0x8000, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
+ PORT_DIPNAME( 0x6000, 0x6000, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:6,7")
+ PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) )
+ PORT_DIPSETTING( 0x2000, DEF_STR( Hard ) )
+ PORT_DIPSETTING( 0x4000, DEF_STR( Easy ) )
+ PORT_DIPSETTING( 0x6000, DEF_STR( Normal ) )
+ PORT_DIPNAME( 0x8000, 0x8000, "Payout Setting" ) PORT_DIPLOCATION("SW1:8")
+ PORT_DIPSETTING( 0x8000, "Normal Payout" )
+ PORT_DIPSETTING( 0x0000, "No Payout" )
INPUT_PORTS_END
@@ -7777,11 +7772,10 @@ static MACHINE_CONFIG_START( twineagl, seta_state )
MCFG_VIDEO_START_OVERRIDE(seta_state,twineagl_1_layer)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("x1snd", X1_010, 16000000) /* 16 MHz */
- MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
- MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -7872,7 +7866,7 @@ static MACHINE_CONFIG_START( usclssic, seta_state )
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
- MCFG_SCREEN_SIZE(64*8, 33*8)
+ MCFG_SCREEN_SIZE(64*8, 32*8)
MCFG_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 1*8, 31*8-1)
MCFG_SCREEN_UPDATE_DRIVER(seta_state, screen_update_usclssic)
MCFG_SCREEN_PALETTE("palette")
@@ -7886,12 +7880,11 @@ static MACHINE_CONFIG_START( usclssic, seta_state )
MCFG_VIDEO_START_OVERRIDE(seta_state,seta_1_layer)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("x1snd", X1_010, 16000000) /* 16 MHz */
MCFG_X1_010_ADDRESS(0x1000)
- MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
- MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -7982,11 +7975,10 @@ static MACHINE_CONFIG_START( metafox, seta_state )
MCFG_VIDEO_START_OVERRIDE(seta_state,seta_1_layer)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("x1snd", X1_010, 16000000) /* 16 MHz */
- MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
- MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -8021,11 +8013,10 @@ static MACHINE_CONFIG_START( atehate, seta_state )
MCFG_VIDEO_START_OVERRIDE(seta_state,seta_no_layers)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("x1snd", X1_010, 16000000) /* 16 MHz */
- MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
- MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -8070,11 +8061,10 @@ static MACHINE_CONFIG_START( blandia, seta_state )
MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("x1snd", X1_010, 16000000) /* 16 MHz */
- MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
- MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( blandiap, seta_state )
@@ -8108,11 +8098,10 @@ static MACHINE_CONFIG_START( blandiap, seta_state )
MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("x1snd", X1_010, 16000000) /* 16 MHz */
- MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
- MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -8147,11 +8136,10 @@ static MACHINE_CONFIG_START( blockcar, seta_state )
MCFG_VIDEO_START_OVERRIDE(seta_state,seta_no_layers)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("x1snd", X1_010, 16000000) /* 16 MHz */
- MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
- MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -8185,8 +8173,7 @@ static MACHINE_CONFIG_DERIVED( blockcarb, blockcar )
MCFG_DEVICE_REMOVE("x1snd")
MCFG_OKIM6295_ADD("oki", 1000000, OKIM6295_PIN7_HIGH) // clock frequency & pin 7 not verified
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -8222,11 +8209,10 @@ static MACHINE_CONFIG_START( daioh, seta_state )
MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("x1snd", X1_010, XTAL_16MHz) /* 16 MHz, Verified from PCB audio */
- MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
- MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -8261,11 +8247,10 @@ static MACHINE_CONFIG_START( daiohp, seta_state )
MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("x1snd", X1_010, XTAL_16MHz) /* 16 MHz, Verified from PCB audio */
- MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
- MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
/***************************************************************************
@@ -8306,11 +8291,10 @@ static MACHINE_CONFIG_START( drgnunit, seta_state )
MCFG_VIDEO_START_OVERRIDE(seta_state,seta_1_layer)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("x1snd", X1_010, 16000000) /* 16 MHz */
- MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
- MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
/* Same as qzkklogy, but with a 16MHz CPU and different
@@ -8438,11 +8422,10 @@ static MACHINE_CONFIG_START( eightfrc, seta_state )
MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("x1snd", X1_010, 16000000) /* 16 MHz */
- MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
- MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -8551,11 +8534,10 @@ static MACHINE_CONFIG_START( gundhara, seta_state )
MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("x1snd", X1_010, 16000000) /* 16 MHz */
- MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
- MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -8597,11 +8579,10 @@ static MACHINE_CONFIG_START( jjsquawk, seta_state )
MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("x1snd", X1_010, 16000000) /* 16 MHz */
- MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
- MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( jjsquawb, seta_state )
@@ -8634,11 +8615,10 @@ static MACHINE_CONFIG_START( jjsquawb, seta_state )
MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("x1snd", X1_010, 16000000) /* 16 MHz */
- MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
- MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
/***************************************************************************
@@ -8677,11 +8657,10 @@ static MACHINE_CONFIG_START( kamenrid, seta_state )
MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("x1snd", X1_010, 16000000) /* 16 MHz */
- MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
- MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
/***************************************************************************
@@ -8802,11 +8781,10 @@ static MACHINE_CONFIG_START( krzybowl, seta_state )
MCFG_VIDEO_START_OVERRIDE(seta_state,seta_no_layers)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("x1snd", X1_010, 16000000) /* 16 MHz */
- MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
- MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -8849,11 +8827,10 @@ static MACHINE_CONFIG_START( madshark, seta_state )
MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("x1snd", X1_010, 16000000) /* 16 MHz */
- MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
- MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
/***************************************************************************
@@ -8892,11 +8869,10 @@ static MACHINE_CONFIG_START( magspeed, seta_state )
MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("x1snd", X1_010, 16000000) /* 16 MHz */
- MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
- MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -8942,11 +8918,10 @@ static MACHINE_CONFIG_START( msgundam, seta_state )
MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("x1snd", X1_010, 16000000) /* 16 MHz */
- MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
- MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -9103,11 +9078,10 @@ static MACHINE_CONFIG_START( rezon, seta_state )
MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("x1snd", X1_010, 16000000) /* 16 MHz */
- MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
- MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -9145,11 +9119,10 @@ static MACHINE_CONFIG_START( thunderl, seta_state )
MCFG_VIDEO_START_OVERRIDE(seta_state,seta_no_layers)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("x1snd", X1_010, 16000000) /* 16 MHz */
- MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
- MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -9184,8 +9157,7 @@ static MACHINE_CONFIG_DERIVED( thunderlbl, thunderl )
MCFG_DEVICE_REMOVE("x1snd")
MCFG_YM2151_ADD("ymsnd", 10000000/2)
- MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
- MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -9257,11 +9229,10 @@ static MACHINE_CONFIG_START( wits, seta_state )
MCFG_VIDEO_START_OVERRIDE(seta_state,seta_no_layers)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("x1snd", X1_010, 16000000) /* 16 MHz */
- MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
- MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -9296,11 +9267,10 @@ static MACHINE_CONFIG_START( umanclub, seta_state )
MCFG_VIDEO_START_OVERRIDE(seta_state,seta_no_layers)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("x1snd", X1_010, 16000000) /* 16 MHz */
- MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
- MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -9391,11 +9361,10 @@ static MACHINE_CONFIG_START( wrofaero, seta_state )
MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("x1snd", X1_010, 16000000) /* 16 MHz */
- MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
- MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -9440,11 +9409,10 @@ static MACHINE_CONFIG_START( zingzip, seta_state )
MCFG_VIDEO_START_OVERRIDE(seta_state,seta_2_layers)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("x1snd", X1_010, 16000000) /* 16 MHz */
- MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
- MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -9460,8 +9428,7 @@ static MACHINE_CONFIG_DERIVED( zingzipbl, zingzip )
MCFG_DEVICE_REMOVE("x1snd")
MCFG_OKIM6295_ADD("oki", 1000000, OKIM6295_PIN7_HIGH)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
/***************************************************************************
@@ -9495,11 +9462,10 @@ static MACHINE_CONFIG_START( pairlove, seta_state )
MCFG_VIDEO_START_OVERRIDE(seta_state,seta_no_layers)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("x1snd", X1_010, 16000000) /* 16 MHz */
- MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
- MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -10868,6 +10834,52 @@ ROM_START( gundhara )
ROM_CONTINUE( 0x000000, 0x080000 )
ROM_END
+/* Chinese factory board, possibly bootleg but appears to come from the
+ same factory as normal boards same as daiohc. Modified layout allowing
+ split ROMs */
+ROM_START( gundharac )
+ ROM_REGION( 0x200000, "maincpu", 0 ) /* 68000 Code */
+ ROM_LOAD16_BYTE( "4.U3", 0x000000, 0x080000, CRC(14e9970a) SHA1(31964bd290cc94c40684adf3a5d129b1c3addc3b) )
+ ROM_LOAD16_BYTE( "2.U4", 0x000001, 0x080000, CRC(96dfc658) SHA1(f570bc49758535eb00d93ecce9f75832f97a0d8d) )
+ ROM_LOAD16_BYTE( "3.U103", 0x100000, 0x080000, CRC(312f58e2) SHA1(a74819d2f84a00c233489893f12c9ab1a98459cf) )
+ ROM_LOAD16_BYTE( "1.U102", 0x100001, 0x080000, CRC(8d23a23c) SHA1(9e9a6488db424c81a97edcb7115cc070fe35c077) )
+
+ ROM_REGION( 0x800000, "gfx1", 0 ) /* Sprites */
+ ROM_LOAD16_BYTE( "19.U140", 0x000000, 0x080000, CRC(32d92c28) SHA1(7ba67f715f094aacf2dc2399809e4dfc7e4ca241) )
+ ROM_LOAD16_BYTE( "23.U142", 0x000001, 0x080000, CRC(ff44db9b) SHA1(76ecd3ce3b6b33f3ae0b0454d58cf37d545dd72c) )
+ ROM_LOAD16_BYTE( "21.U141", 0x100000, 0x080000, CRC(1901dc08) SHA1(b19428a7510d6e28a39bdf6ecc9732e3c2d19214) )
+ ROM_LOAD16_BYTE( "25.U143", 0x100001, 0x080000, CRC(877289a2) SHA1(7482320e319d7b641fabba5aeeaa1237b693a219) )
+ ROM_LOAD16_BYTE( "18.U140-B", 0x200000, 0x080000, CRC(4f023fb0) SHA1(815765c9783e44762bf57a3fbfad4385c316343a) )
+ ROM_LOAD16_BYTE( "22.U142-B", 0x200001, 0x080000, CRC(6f3fe7e7) SHA1(71bc347c06678f4ae7850799da6346c6447bf3c0) )
+ ROM_LOAD16_BYTE( "20.U141-B", 0x300000, 0x080000, CRC(7f1932e0) SHA1(13262a7322ad29cf7c85461204a3518e900c6145) )
+ ROM_LOAD16_BYTE( "24.U143-B", 0x300001, 0x080000, CRC(066a2e2b) SHA1(186729918a89535484ab86dd58caf20ccce81501) )
+ ROM_LOAD16_BYTE( "9.U144", 0x400000, 0x080000, CRC(6b4a531f) SHA1(701d6b2d87a742c8a2ab36331bd843dcd3309eae) )
+ ROM_LOAD16_BYTE( "13.U146", 0x400001, 0x080000, CRC(45be3df4) SHA1(36667bf5e4b80d17a9d7b6ce4df7498f94681c46) )
+ ROM_LOAD16_BYTE( "11.U145", 0x500000, 0x080000, CRC(f5210aa5) SHA1(4834d905f699dbec1cdacea6b320271c291aa2a7) )
+ ROM_LOAD16_BYTE( "15.U147", 0x500001, 0x080000, CRC(17003119) SHA1(a2edd65c98bc654b541dad3e3783d90931c97597) )
+ ROM_LOAD16_BYTE( "8.U144-B", 0x600000, 0x080000, CRC(ad9d9338) SHA1(33d6c881a20e2150017cc26f929473291e561718) )
+ ROM_LOAD16_BYTE( "12.U146-B", 0x600001, 0x080000, CRC(0fd4c062) SHA1(7f418d43d9ba884c504f6fe3c04b11724412ac6b) )
+ ROM_LOAD16_BYTE( "10.U145-B", 0x700000, 0x080000, CRC(7c5d12b9) SHA1(6ee45c4da6994540852153752e2818a8ea8ecf1a) )
+ ROM_LOAD16_BYTE( "14.U147-B", 0x700001, 0x080000, CRC(5a8af50f) SHA1(3b7937ba720fcbbc5e29c1b95a97c29e8ff5490a) )
+
+ ROM_REGION( 0x200000, "gfx2", 0 ) /* Layer 1 */
+ ROM_LOAD16_BYTE( "5.U148", 0x000000, 0x080000, CRC(0c740f9b) SHA1(f6d135c3318ff0d50d40921aa108b1b332c1a086) )
+ ROM_LOAD16_BYTE( "6.U150", 0x000001, 0x080000, CRC(ba60eb98) SHA1(7204269816332bbb3401d9f20a513372ffe78500) )
+ ROM_LOAD16_BYTE( "7.U154", 0x100000, 0x080000, CRC(b768e666) SHA1(473fa52c16c0a9f321e6429947a3e0fc1ef22f7e) )
+
+ ROM_REGION( 0x400000, "gfx3", 0 ) /* Layer 2 */
+ ROM_LOAD16_BYTE( "26.U164", 0x000000, 0x080000, CRC(be3ccaba) SHA1(98f8b83cbed00932866375d21f86ee5c9bddb2a6) )
+ ROM_LOAD16_BYTE( "28.U166", 0x000001, 0x080000, CRC(8a650a4e) SHA1(1f6eda27b39ad052e3d9a8a72cb0a072e7be4487) )
+ ROM_LOAD16_BYTE( "27.U165", 0x100000, 0x080000, CRC(47994ff0) SHA1(25211a9af01f77788578bb524619d95b5b86e241) )
+ ROM_LOAD16_BYTE( "29.U167", 0x100001, 0x080000, CRC(453c3d3f) SHA1(151528b6b1e7f8c059d67dbaca61e7c382e9ce04) )
+ ROM_LOAD16_BYTE( "16.U152", 0x200000, 0x080000, CRC(5ccc500b) SHA1(d3a2a5658cac8d788e0a1189c184309b8394b10a) )
+ ROM_LOAD16_BYTE( "17.U153", 0x300000, 0x080000, CRC(5586d086) SHA1(e43d5e8834701f40389400f68a99353e67598f6d) )
+
+ ROM_REGION( 0x100000, "x1snd", 0 ) /* Samples */
+ ROM_LOAD( "30.U69", 0x000000, 0x080000, CRC(3111a98a) SHA1(75e17a0113060a10551b2b8c17b19890eb7aa0a6) )
+ ROM_LOAD( "31.U70", 0x080000, 0x080000, CRC(30cb2524) SHA1(85deb83262bbe481404705e163e5eb9362985b01) )
+ROM_END
+
ROM_START( sokonuke )
ROM_REGION( 0x100000, "maincpu", 0 ) /* 68000 Code */
ROM_LOAD16_BYTE( "001-001.bin", 0x000000, 0x080000, CRC(9d0aa3ca) SHA1(f641c46f2c6e7f82bb9184daac62938afb607c09) )
@@ -11668,6 +11680,7 @@ GAME( 1993, keroppij, keroppi, keroppij, keroppij,driver_device, 0, ROT
GAME( 1995, extdwnhl, 0, extdwnhl, extdwnhl, driver_device, 0, ROT0, "Sammy Industries Japan", "Extreme Downhill (v1.5)", GAME_IMPERFECT_GRAPHICS )
GAME( 1995, gundhara, 0, gundhara, gundhara, driver_device, 0, ROT270, "Banpresto", "Gundhara", 0 )
+GAME( 1995, gundharac, gundhara,gundhara, gundhara, driver_device, 0, ROT270, "Banpresto", "Gundhara (Chinese, bootleg?)", 0 )
GAME( 1995, sokonuke, 0, extdwnhl, sokonuke, driver_device, 0, ROT0, "Sammy Industries", "Sokonuke Taisen Game (Japan)", GAME_IMPERFECT_SOUND )
diff --git a/src/mame/drivers/sg1000a.c b/src/mame/drivers/sg1000a.c
index dbee65b80ea..2da7f13e8f1 100644
--- a/src/mame/drivers/sg1000a.c
+++ b/src/mame/drivers/sg1000a.c
@@ -126,13 +126,15 @@ class sg1000a_state : public driver_device
public:
sg1000a_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_decrypted_opcodes(*this, "decrypted_opcodes") { }
DECLARE_WRITE_LINE_MEMBER(vdp_interrupt);
DECLARE_WRITE8_MEMBER(sg1000a_coin_counter_w);
DECLARE_DRIVER_INIT(sg1000a);
DECLARE_DRIVER_INIT(chwrestl);
required_device<cpu_device> m_maincpu;
+ optional_shared_ptr<UINT8> m_decrypted_opcodes;
};
@@ -143,11 +145,15 @@ public:
*************************************/
static ADDRESS_MAP_START( program_map, AS_PROGRAM, 8, sg1000a_state )
- AM_RANGE(0x0000, 0x7fff) AM_ROM // separate region needed for decrypting
- AM_RANGE(0x8000, 0xbfff) AM_ROM
+ AM_RANGE(0x0000, 0xbfff) AM_ROM
AM_RANGE(0xc000, 0xc3ff) AM_RAM AM_MIRROR(0x400)
ADDRESS_MAP_END
+static ADDRESS_MAP_START( decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 8, sg1000a_state )
+ AM_RANGE(0x0000, 0x7fff) AM_ROM AM_SHARE("decrypted_opcodes")
+ AM_RANGE(0x8000, 0xbfff) AM_ROM AM_REGION("maincpu", 0x8000)
+ADDRESS_MAP_END
+
static ADDRESS_MAP_START( io_map, AS_IO, 8, sg1000a_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x7f, 0x7f) AM_DEVWRITE("snsnd", sn76489_device, write)
@@ -285,6 +291,11 @@ static MACHINE_CONFIG_START( sg1000a, sg1000a_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
+static MACHINE_CONFIG_DERIVED( sg1000ax, sg1000a )
+ MCFG_CPU_MODIFY("maincpu")
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
+MACHINE_CONFIG_END
+
/*************************************
*
* ROM definitions
@@ -324,8 +335,30 @@ DRIVER_INIT_MEMBER(sg1000a_state,sg1000a)
DRIVER_INIT_MEMBER(sg1000a_state,chwrestl)
{
+ static const UINT8 convtable[32][4] =
+ {
+ /* opcode data address */
+ /* A B C D A B C D */
+ { 0x28,0x08,0xa8,0x88 }, { 0x88,0x80,0x08,0x00 }, /* ...0...0...0...0 */
+ { 0x28,0x08,0xa8,0x88 }, { 0x28,0xa8,0x08,0x88 }, /* ...0...0...0...1 */
+ { 0x88,0x80,0x08,0x00 }, { 0x88,0x08,0x80,0x00 }, /* ...0...0...1...0 */
+ { 0x88,0x08,0x80,0x00 }, { 0x28,0xa8,0x08,0x88 }, /* ...0...0...1...1 */
+ { 0x28,0x08,0xa8,0x88 }, { 0x88,0x80,0x08,0x00 }, /* ...0...1...0...0 */
+ { 0x88,0x80,0x08,0x00 }, { 0x88,0x80,0x08,0x00 }, /* ...0...1...0...1 */
+ { 0x88,0x08,0x80,0x00 }, { 0x88,0x08,0x80,0x00 }, /* ...0...1...1...0 */
+ { 0xa0,0x80,0xa8,0x88 }, { 0xa0,0x80,0xa8,0x88 }, /* ...0...1...1...1 */
+ { 0x80,0xa0,0x00,0x20 }, { 0x28,0x08,0xa8,0x88 }, /* ...1...0...0...0 */
+ { 0x28,0xa8,0x08,0x88 }, { 0x28,0x08,0xa8,0x88 }, /* ...1...0...0...1 */
+ { 0x80,0xa0,0x00,0x20 }, { 0x80,0xa0,0x00,0x20 }, /* ...1...0...1...0 */
+ { 0x28,0xa8,0x08,0x88 }, { 0x80,0xa0,0x00,0x20 }, /* ...1...0...1...1 */
+ { 0xa0,0x80,0xa8,0x88 }, { 0x28,0x08,0xa8,0x88 }, /* ...1...1...0...0 */
+ { 0x80,0xa0,0x00,0x20 }, { 0xa0,0x80,0xa8,0x88 }, /* ...1...1...0...1 */
+ { 0xa0,0x80,0xa8,0x88 }, { 0x80,0xa0,0x00,0x20 }, /* ...1...1...1...0 */
+ { 0xa0,0x80,0xa8,0x88 }, { 0xa0,0x80,0xa8,0x88 } /* ...1...1...1...1 */
+ };
+
DRIVER_INIT_CALL(sg1000a);
- regulus_decode(machine(), "maincpu");
+ sega_decode(memregion("maincpu")->base(), m_decrypted_opcodes, 0x8000, convtable);
}
/*************************************
@@ -334,6 +367,6 @@ DRIVER_INIT_MEMBER(sg1000a_state,chwrestl)
*
*************************************/
-GAME( 1984, chboxing, 0, sg1000a, chboxing, sg1000a_state, sg1000a, ROT0, "Sega", "Champion Boxing", 0 )
-GAME( 1985, chwrestl, 0, sg1000a, chwrestl, sg1000a_state, chwrestl, ROT0, "Sega", "Champion Pro Wrestling", 0 )
-GAME( 1985, dokidoki, 0, sg1000a, dokidoki, sg1000a_state, sg1000a, ROT0, "Sega", "Doki Doki Penguin Land", 0 )
+GAME( 1984, chboxing, 0, sg1000a, chboxing, sg1000a_state, sg1000a, ROT0, "Sega", "Champion Boxing", 0 )
+GAME( 1985, chwrestl, 0, sg1000ax, chwrestl, sg1000a_state, chwrestl, ROT0, "Sega", "Champion Pro Wrestling", 0 )
+GAME( 1985, dokidoki, 0, sg1000a, dokidoki, sg1000a_state, sg1000a, ROT0, "Sega", "Doki Doki Penguin Land", 0 )
diff --git a/src/mame/drivers/shisen.c b/src/mame/drivers/shisen.c
index fc71a4cfeff..cc5b58b7125 100644
--- a/src/mame/drivers/shisen.c
+++ b/src/mame/drivers/shisen.c
@@ -14,7 +14,7 @@ driver by Nicola Salmoria
#include "sound/2151intf.h"
#include "includes/shisen.h"
-READ8_MEMBER(shisen_state::sichuan2_dsw1_r)
+READ8_MEMBER(shisen_state::dsw1_r)
{
int ret = ioport("DSW1")->read();
@@ -33,7 +33,7 @@ READ8_MEMBER(shisen_state::sichuan2_dsw1_r)
return ret;
}
-WRITE8_MEMBER(shisen_state::sichuan2_coin_w)
+WRITE8_MEMBER(shisen_state::coin_w)
{
if ((data & 0xf9) != 0x01) logerror("coin ctrl = %02x\n",data);
@@ -46,16 +46,16 @@ WRITE8_MEMBER(shisen_state::sichuan2_coin_w)
static ADDRESS_MAP_START( shisen_map, AS_PROGRAM, 8, shisen_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1")
- AM_RANGE(0xc800, 0xcaff) AM_RAM_WRITE(sichuan2_paletteram_w) AM_SHARE("paletteram")
- AM_RANGE(0xd000, 0xdfff) AM_RAM_WRITE(sichuan2_videoram_w) AM_SHARE("videoram")
+ AM_RANGE(0xc800, 0xcaff) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram")
+ AM_RANGE(0xd000, 0xdfff) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram")
AM_RANGE(0xe000, 0xffff) AM_RAM
ADDRESS_MAP_END
static ADDRESS_MAP_START( shisen_io_map, AS_IO, 8, shisen_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x00, 0x00) AM_READWRITE(sichuan2_dsw1_r, sichuan2_coin_w)
+ AM_RANGE(0x00, 0x00) AM_READWRITE(dsw1_r, coin_w)
AM_RANGE(0x01, 0x01) AM_READ_PORT("DSW2") AM_DEVWRITE("m72", m72_audio_device, sound_command_byte_w)
- AM_RANGE(0x02, 0x02) AM_READ_PORT("P1") AM_WRITE(sichuan2_bankswitch_w)
+ AM_RANGE(0x02, 0x02) AM_READ_PORT("P1") AM_WRITE(bankswitch_w)
AM_RANGE(0x03, 0x03) AM_READ_PORT("P2")
AM_RANGE(0x04, 0x04) AM_READ_PORT("COIN")
ADDRESS_MAP_END
@@ -222,7 +222,7 @@ static MACHINE_CONFIG_START( shisen, shisen_state )
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
MCFG_SCREEN_SIZE(64*8, 32*8)
MCFG_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 0*8, 32*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(shisen_state, screen_update_sichuan2)
+ MCFG_SCREEN_UPDATE_DRIVER(shisen_state, screen_update)
MCFG_SCREEN_PALETTE("palette")
MCFG_GFXDECODE_ADD("gfxdecode", "palette", shisen)
@@ -423,7 +423,7 @@ ROM_START( matchit )
/* no samples on this board */
ROM_END
-GAME( 1989, matchit, 0, shisen, matchit, driver_device, 0, ROT0, "Tamtex", "Match It", 0 )
-GAME( 1989, shisen, matchit, shisen, shisen, driver_device, 0, ROT0, "Tamtex", "Shisensho - Joshiryo-Hen (Japan)", 0 )
-GAME( 1989, sichuan2, matchit, shisen, shisen, driver_device, 0, ROT0, "hack", "Sichuan II (hack, set 1)", 0 )
-GAME( 1989, sichuan2a,matchit, shisen, shisen, driver_device, 0, ROT0, "hack", "Sichuan II (hack, set 2)", 0 )
+GAME( 1989, matchit, 0, shisen, matchit, driver_device, 0, ROT0, "Tamtex", "Match It", GAME_SUPPORTS_SAVE )
+GAME( 1989, shisen, matchit, shisen, shisen, driver_device, 0, ROT0, "Tamtex", "Shisensho - Joshiryo-Hen (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1989, sichuan2, matchit, shisen, shisen, driver_device, 0, ROT0, "hack", "Sichuan II (hack, set 1)", GAME_SUPPORTS_SAVE )
+GAME( 1989, sichuan2a,matchit, shisen, shisen, driver_device, 0, ROT0, "hack", "Sichuan II (hack, set 2)", GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/sidearms.c b/src/mame/drivers/sidearms.c
index 742a9493e01..cdcfac70ddb 100644
--- a/src/mame/drivers/sidearms.c
+++ b/src/mame/drivers/sidearms.c
@@ -10,6 +10,13 @@
Change Log:
+MAY-2015 System11
+
+- added turtshipko and turtshipkn.
+- amended comments for T-5 instances, A14 is tied high on the PCBs hence the need to load the higher half of the ROM only
+- order of age is guessed - turtshipko has grey bullets and a different level order, 3x horizontal and then 3x vertical (as far as tested). Bullets probably fixed based on feedback before it was licensed to Sharp Image and Pacific Games - differences between US/JP/Korea versions previously in MAME are minimal.
+- turtshipkn I assume is newer, the disclaimer is in pure Korean and the orange bullets are retained. Given the 88/9 release date from the startup screen it would seem unlikely that this came out first, then got grey bullets and back to orange in time for it to still be a 1988 game in other countries.
+
JUL-2003 AAT
- cleaned video and corrected screen flipping
@@ -906,7 +913,7 @@ ROM_START( turtship )
ROM_REGION( 0x04000, "gfx1", 0 )
ROM_LOAD( "t-5.8k", 0x00000, 0x04000, CRC(35c3dbc5) SHA1(6700c72e5e0f7bd1429d342cb5d3daccd6b1b70f) ) /* characters */
- ROM_CONTINUE( 0x00000, 0x04000 ) /* is the first half used? */
+ ROM_CONTINUE( 0x00000, 0x04000 ) /* A14 tied high, only upper half is used */
ROM_REGION( 0x80000, "gfx2", 0 )
ROM_LOAD( "t-8.1d", 0x00000, 0x10000, CRC(30a857f0) SHA1(a2d261e8104d0459067bdbdd71662fe8d6917da1) ) /* tiles */
@@ -939,7 +946,8 @@ ROM_START( turtshipj )
ROM_REGION( 0x04000, "gfx1", 0 )
ROM_LOAD( "t-5.8k", 0x00000, 0x04000, CRC(35c3dbc5) SHA1(6700c72e5e0f7bd1429d342cb5d3daccd6b1b70f) ) /* characters */
- ROM_CONTINUE( 0x00000, 0x04000 ) /* is the first half used? */
+ ROM_CONTINUE( 0x00000, 0x04000 ) /* A14 tied high, only upper half is used */
+
ROM_REGION( 0x80000, "gfx2", 0 )
ROM_LOAD( "t-8.1d", 0x00000, 0x10000, CRC(30a857f0) SHA1(a2d261e8104d0459067bdbdd71662fe8d6917da1) ) /* tiles */
@@ -970,7 +978,7 @@ ROM_START( turtshipk )
ROM_REGION( 0x10000, "audiocpu", 0 )
ROM_LOAD( "t-4.8a", 0x00000, 0x08000, CRC(1cbe48e8) SHA1(6ac5981d36a44595bb8dc847c54c7be7b374f82c) )
- ROM_REGION( 0x04000, "gfx1", 0 )
+ ROM_REGION( 0x04000, "gfx1", 0 ) /* Really a 27128? */
ROM_LOAD( "turtship.005", 0x00000, 0x04000, CRC(651fef75) SHA1(9c821a2ee30c222987f0d4192133776490d6a4e0) ) /* characters */
ROM_REGION( 0x80000, "gfx2", 0 )
@@ -993,6 +1001,73 @@ ROM_START( turtshipk )
ROM_LOAD( "turtship.016", 0x00000, 0x08000, CRC(affd51dd) SHA1(3338aa1fdd6b9926acc215f7f3656d70803f1832) )
ROM_END
+ROM_START( turtshipko )
+ ROM_REGION( 0x20000, "maincpu", 0 ) /* 64k for code + banked ROMs images */
+ ROM_LOAD( "T-3.G5", 0x00000, 0x08000, CRC(cd789535) SHA1(3c4f94c751645b61066177fbf3157924ad177c32) )
+ ROM_LOAD( "T-2.G3", 0x08000, 0x08000, CRC(253678c0) SHA1(1470fd936003462d480c759658628ea085d4bd71) )
+ ROM_LOAD( "T-1.E3", 0x10000, 0x08000, CRC(d6fdc376) SHA1(3f4e1fde8b83e3762f9499dfe291309efe940093) )
+
+ ROM_REGION( 0x10000, "audiocpu", 0 )
+ ROM_LOAD( "T-4.A8", 0x00000, 0x08000, CRC(1cbe48e8) SHA1(6ac5981d36a44595bb8dc847c54c7be7b374f82c) )
+
+ ROM_REGION( 0x04000, "gfx1", 0 )
+ ROM_LOAD( "T-5.K8", 0x00000, 0x04000, CRC(35c3dbc5) SHA1(6700c72e5e0f7bd1429d342cb5d3daccd6b1b70f) ) /* characters */
+ ROM_CONTINUE( 0x00000, 0x04000 ) /* A14 tied high, only upper half is used */
+
+ ROM_REGION( 0x80000, "gfx2", 0 )
+ ROM_LOAD( "T-8.D1", 0x00000, 0x10000, CRC(2f0b2336) SHA1(a869e0a50aab7d29afbca46fa04bd470488a8eeb) ) /* tiles */
+ ROM_LOAD( "T-10.C3", 0x10000, 0x10000, CRC(6a0072f4) SHA1(d74b53ed90a4d01020a179f263a39b7547b8f82e) )
+ ROM_RELOAD( 0x30000, 0x10000)
+ ROM_LOAD( "T-11.D3", 0x20000, 0x10000, CRC(53da6cb1) SHA1(52720746298adb01828f959f81b385d268c94343) )
+ ROM_LOAD( "T-6.A1", 0x40000, 0x10000, CRC(a7cce654) SHA1(f6c99622dcacc1d76021ca29b0bbceefbb75c499) )
+ ROM_LOAD( "T-7.C1", 0x50000, 0x10000, CRC(90dd8415) SHA1(8e9d43ff9164fb287ab82df7da8890976b9d21c7) )
+ ROM_RELOAD( 0x70000, 0x10000)
+ ROM_LOAD( "T-9.A3", 0x60000, 0x10000, CRC(44762916) SHA1(3427066fc02d1b9b71a59ac41d3332d5cd8d1423) )
+
+ ROM_REGION( 0x40000, "gfx3", 0 )
+ ROM_LOAD( "T-13.I1", 0x00000, 0x10000, CRC(1cc87f50) SHA1(d7d8a4376b556675dafa0a407bb34b6017f17e7d) ) /* sprites */
+ ROM_LOAD( "T-15.I3", 0x10000, 0x10000, CRC(775ee5d9) SHA1(e39eb558cc2d5cdf4c87b96f85af72e5600b995e) )
+ ROM_LOAD( "T-12.G1", 0x20000, 0x10000, CRC(57783312) SHA1(57942e8c3b7be63ea62bae3c104cb2842eb6b755) )
+ ROM_LOAD( "T-14.G3", 0x30000, 0x10000, CRC(a30e3346) SHA1(150a837fb5d4705df9e8e9a94f78cff0e1c57d64) )
+
+ ROM_REGION( 0x08000, "gfx4", 0 ) /* background tilemaps */
+ ROM_LOAD( "T-16.F9", 0x00000, 0x08000, CRC(9b377277) SHA1(4858560e35144727aea958023f3df785baa994a8) )
+ROM_END
+
+ROM_START( turtshipkn )
+ ROM_REGION( 0x20000, "maincpu", 0 ) /* 64k for code + banked ROMs images */
+ ROM_LOAD( "T-3.G5", 0x00000, 0x08000, CRC(529b091c) SHA1(9a3a885dbf1f9d3c3c326418efdcb4f6f96eb4ae) )
+ ROM_LOAD( "T-2.G3", 0x08000, 0x08000, CRC(d2f30195) SHA1(d64f088ed776658563943e8cde086842d0d899f8) )
+ ROM_LOAD( "T-1.E3", 0x10000, 0x08000, CRC(2d02da90) SHA1(5cf059e04e145861f9877cefa2c7168e6ded19ac) )
+
+ ROM_REGION( 0x10000, "audiocpu", 0 )
+ ROM_LOAD( "T-4.A8", 0x00000, 0x08000, CRC(1cbe48e8) SHA1(6ac5981d36a44595bb8dc847c54c7be7b374f82c) )
+
+ ROM_REGION( 0x04000, "gfx1", 0 )
+ ROM_LOAD( "T-5.K8", 0x00000, 0x04000, CRC(5c2ee02d) SHA1(c8d3dbdaab943c1639795915cf275951501a2a77) ) /* characters */
+ ROM_CONTINUE( 0x00000, 0x04000 ) /* A14 tied high, only upper half is used */
+
+ ROM_REGION( 0x80000, "gfx2", 0 )
+ ROM_LOAD( "T-8.D1", 0x00000, 0x10000, CRC(2f0b2336) SHA1(a869e0a50aab7d29afbca46fa04bd470488a8eeb) ) /* tiles */
+ ROM_LOAD( "T-10.C3", 0x10000, 0x10000, CRC(6a0072f4) SHA1(d74b53ed90a4d01020a179f263a39b7547b8f82e) )
+ ROM_RELOAD( 0x30000, 0x10000)
+ ROM_LOAD( "T-11.D3", 0x20000, 0x10000, CRC(53da6cb1) SHA1(52720746298adb01828f959f81b385d268c94343) )
+ ROM_LOAD( "T-6.A1", 0x40000, 0x10000, CRC(a7cce654) SHA1(f6c99622dcacc1d76021ca29b0bbceefbb75c499) )
+ ROM_LOAD( "T-7.C1", 0x50000, 0x10000, CRC(90dd8415) SHA1(8e9d43ff9164fb287ab82df7da8890976b9d21c7) )
+ ROM_RELOAD( 0x70000, 0x10000)
+ ROM_LOAD( "T-9.A3", 0x60000, 0x10000, CRC(44762916) SHA1(3427066fc02d1b9b71a59ac41d3332d5cd8d1423) )
+
+ ROM_REGION( 0x40000, "gfx3", 0 )
+ ROM_LOAD( "T-13.I1", 0x00000, 0x10000, CRC(1cc87f50) SHA1(d7d8a4376b556675dafa0a407bb34b6017f17e7d) ) /* sprites */
+ ROM_LOAD( "T-15.I3", 0x10000, 0x10000, CRC(3bf91fb8) SHA1(1c8368dc8d52c3c48a85391f00c91a80fa5d781d) )
+ ROM_LOAD( "T-12.G1", 0x20000, 0x10000, CRC(57783312) SHA1(57942e8c3b7be63ea62bae3c104cb2842eb6b755) )
+ ROM_LOAD( "T-14.G3", 0x30000, 0x10000, CRC(ee162dc0) SHA1(127b3cb3ddd47aa8ee70cad2d54b1306ad8f10e8) )
+
+ ROM_REGION( 0x08000, "gfx4", 0 ) /* background tilemaps */
+ ROM_LOAD( "T-16.F9", 0x00000, 0x08000, CRC(9b377277) SHA1(4858560e35144727aea958023f3df785baa994a8) )
+ROM_END
+
+
ROM_START( dyger )
ROM_REGION( 0x20000, "maincpu", 0 ) /* 64k for code + banked ROMs images */
ROM_LOAD( "d-3.5g", 0x00000, 0x08000, CRC(bae9882e) SHA1(88194e58673ebd0841e9e07482842f6dbb823afc) )
@@ -1153,6 +1228,8 @@ GAME( 1986, sidearmsj, sidearms, sidearms, sidearms, sidearms_state, sidearms,
GAME( 1988, turtship, 0, turtship, turtship, sidearms_state, turtship, ROT0, "Philko (Sharp Image license)", "Turtle Ship (North America)", GAME_SUPPORTS_SAVE )
GAME( 1988, turtshipj,turtship, turtship, turtship, sidearms_state, turtship, ROT0, "Philko (Pacific Games license)", "Turtle Ship (Japan)", GAME_SUPPORTS_SAVE )
GAME( 1988, turtshipk,turtship, turtship, turtship, sidearms_state, turtship, ROT0, "Philko", "Turtle Ship (Korea)", GAME_SUPPORTS_SAVE )
+GAME( 1988, turtshipko,turtship, turtship, turtship, sidearms_state, turtship, ROT0, "Philko", "Turtle Ship (Korea, older)", GAME_SUPPORTS_SAVE )
+GAME( 1988, turtshipkn, turtship, turtship, turtship, sidearms_state, turtship, ROT0, "Philko", "Turtle Ship (Korea, 88/9)", GAME_SUPPORTS_SAVE )
GAME( 1989, dyger, 0, turtship, dyger, sidearms_state, dyger, ROT270, "Philko", "Dyger (Korea set 1)", GAME_SUPPORTS_SAVE )
GAME( 1989, dygera, dyger, turtship, dyger, sidearms_state, dyger, ROT270, "Philko", "Dyger (Korea set 2)", GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/slapshot.c b/src/mame/drivers/slapshot.c
index e7329d9e4a3..f804ae18664 100644
--- a/src/mame/drivers/slapshot.c
+++ b/src/mame/drivers/slapshot.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:David Graves
/***************************************************************************
@@ -453,7 +453,7 @@ GFXDECODE_END
void slapshot_state::machine_start()
{
membank("z80bank")->configure_entries(0, 4, memregion("audiocpu")->base(), 0x4000);
-
+
m_int6_timer = timer_alloc(TIMER_SLAPSHOT_INTERRUPT6);
}
diff --git a/src/mame/drivers/smsmcorp.c b/src/mame/drivers/smsmcorp.c
index 9797e7514e6..a99d68b16a2 100644
--- a/src/mame/drivers/smsmcorp.c
+++ b/src/mame/drivers/smsmcorp.c
@@ -286,7 +286,7 @@ READ8_MEMBER(smsmfg_state::link_r)
return m_communication_port_status;
}
return 0;
-};
+}
WRITE8_MEMBER(smsmfg_state::link_w)
{
diff --git a/src/mame/drivers/snk.c b/src/mame/drivers/snk.c
index f000803d50f..1088dd68140 100644
--- a/src/mame/drivers/snk.c
+++ b/src/mame/drivers/snk.c
@@ -3979,12 +3979,6 @@ static MACHINE_CONFIG_DERIVED( chopper1, bermudat )
MCFG_CPU_MODIFY("audiocpu")
MCFG_CPU_PROGRAM_MAP(YM3812_Y8950_sound_map)
- /* video hardware */
- MCFG_SCREEN_MODIFY("screen")
- // this visible area matches the flyer
- MCFG_SCREEN_SIZE(51*8, 28*8)
- MCFG_SCREEN_VISIBLE_AREA(1*8, 50*8-1, 0*8, 28*8-1)
-
/* sound hardware */
MCFG_SOUND_REPLACE("ym1", YM3812, 4000000)
MCFG_YM3812_IRQ_HANDLER(WRITELINE(snk_state, ymirq_callback_1))
diff --git a/src/mame/drivers/snk68.c b/src/mame/drivers/snk68.c
index 53353339b11..351dde82014 100644
--- a/src/mame/drivers/snk68.c
+++ b/src/mame/drivers/snk68.c
@@ -50,14 +50,9 @@ Notes:
/******************************************************************************/
-READ16_MEMBER(snk68_state::sound_status_r)
+void snk68_state::machine_start()
{
- return (m_sound_status << 8);
-}
-
-WRITE8_MEMBER(snk68_state::sound_status_w)
-{
- m_sound_status = data;
+ save_item(NAME(m_invert_controls));
}
READ16_MEMBER(snk68_state::control_1_r)
@@ -65,11 +60,6 @@ READ16_MEMBER(snk68_state::control_1_r)
return (ioport("P1")->read() + (ioport("P2")->read() << 8));
}
-READ16_MEMBER(snk68_state::control_2_r)
-{
- return ioport("SYSTEM")->read();
-}
-
READ16_MEMBER(snk68_state::rotary_1_r)
{
return (( ~(1 << ioport("ROT1")->read()) )<<8)&0xff00;
@@ -119,16 +109,16 @@ static ADDRESS_MAP_START( pow_map, AS_PROGRAM, 16, snk68_state )
AM_RANGE(0x040000, 0x043fff) AM_RAM
AM_RANGE(0x080000, 0x080001) AM_READ(control_1_r)
AM_RANGE(0x080000, 0x080001) AM_WRITE(sound_w)
- AM_RANGE(0x0c0000, 0x0c0001) AM_READ(control_2_r)
- AM_RANGE(0x0c0000, 0x0c0001) AM_WRITE(pow_flipscreen16_w) // + char bank
+ AM_RANGE(0x0c0000, 0x0c0001) AM_READ_PORT("SYSTEM")
+ AM_RANGE(0x0c0000, 0x0c0001) AM_WRITE(pow_flipscreen_w) // + char bank
AM_RANGE(0x0e0000, 0x0e0001) AM_READNOP /* Watchdog or IRQ ack */
AM_RANGE(0x0e8000, 0x0e8001) AM_READNOP /* Watchdog or IRQ ack */
AM_RANGE(0x0f0000, 0x0f0001) AM_READ_PORT("DSW1")
AM_RANGE(0x0f0008, 0x0f0009) AM_READ_PORT("DSW2")
// AM_RANGE(0x0f0008, 0x0f0009) AM_WRITENOP /* ?? */
AM_RANGE(0x100000, 0x100fff) AM_READWRITE(pow_fg_videoram_r, pow_fg_videoram_w) AM_MIRROR(0x1000) AM_SHARE("pow_fg_videoram") // 8-bit
- AM_RANGE(0x200000, 0x207fff) AM_READWRITE(pow_spriteram_r, pow_spriteram_w) AM_SHARE("spriteram") // only partially populated
- AM_RANGE(0x400000, 0x400fff) AM_RAM_WRITE(pow_paletteram16_word_w) AM_SHARE("paletteram")
+ AM_RANGE(0x200000, 0x207fff) AM_READWRITE(spriteram_r, spriteram_w) AM_SHARE("spriteram") // only partially populated
+ AM_RANGE(0x400000, 0x400fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
ADDRESS_MAP_END
static ADDRESS_MAP_START( searchar_map, AS_PROGRAM, 16, snk68_state )
@@ -137,7 +127,7 @@ static ADDRESS_MAP_START( searchar_map, AS_PROGRAM, 16, snk68_state )
AM_RANGE(0x080000, 0x080005) AM_READ(protcontrols_r) /* Player 1 & 2 */
AM_RANGE(0x080000, 0x080001) AM_WRITE(sound_w)
AM_RANGE(0x080006, 0x080007) AM_WRITE(protection_w) /* top byte unknown, bottom is protection in ikari3 and streetsm */
- AM_RANGE(0x0c0000, 0x0c0001) AM_WRITE(searchar_flipscreen16_w)
+ AM_RANGE(0x0c0000, 0x0c0001) AM_WRITE(searchar_flipscreen_w)
AM_RANGE(0x0c0000, 0x0c0001) AM_READ(rotary_1_r) /* Player 1 rotary */
AM_RANGE(0x0c8000, 0x0c8001) AM_READ(rotary_2_r) /* Player 2 rotary */
AM_RANGE(0x0d0000, 0x0d0001) AM_READ(rotary_lsb_r) /* Extra rotary bits */
@@ -146,11 +136,11 @@ static ADDRESS_MAP_START( searchar_map, AS_PROGRAM, 16, snk68_state )
// AM_RANGE(0x0f0000, 0x0f0001) AM_WRITENOP /* ?? */
AM_RANGE(0x0f0000, 0x0f0001) AM_READ_PORT("DSW1")
AM_RANGE(0x0f0008, 0x0f0009) AM_READ_PORT("DSW2")
- AM_RANGE(0x0f8000, 0x0f8001) AM_READ(sound_status_r)
- AM_RANGE(0x100000, 0x107fff) AM_READWRITE(pow_spriteram_r, pow_spriteram_w) AM_SHARE("spriteram") // only partially populated
+ AM_RANGE(0x0f8000, 0x0f8001) AM_READ8(soundlatch2_byte_r, 0xff00)
+ AM_RANGE(0x100000, 0x107fff) AM_READWRITE(spriteram_r, spriteram_w) AM_SHARE("spriteram") // only partially populated
AM_RANGE(0x200000, 0x200fff) AM_RAM_WRITE(searchar_fg_videoram_w) AM_MIRROR(0x1000) AM_SHARE("pow_fg_videoram") /* Mirror is used by Ikari 3 */
- AM_RANGE(0x300000, 0x33ffff) AM_ROMBANK("bank1") /* Extra code bank */
- AM_RANGE(0x400000, 0x400fff) AM_RAM_WRITE(pow_paletteram16_word_w) AM_SHARE("paletteram")
+ AM_RANGE(0x300000, 0x33ffff) AM_ROM AM_REGION("user1", 0) /* Extra code bank */
+ AM_RANGE(0x400000, 0x400fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
ADDRESS_MAP_END
/******************************************************************************/
@@ -158,7 +148,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, snk68_state )
AM_RANGE(0x0000, 0xefff) AM_ROM
AM_RANGE(0xf000, 0xf7ff) AM_RAM
- AM_RANGE(0xf800, 0xf800) AM_READ(soundlatch_byte_r) AM_WRITE(sound_status_w)
+ AM_RANGE(0xf800, 0xf800) AM_READ(soundlatch_byte_r) AM_WRITE(soundlatch2_byte_w)
ADDRESS_MAP_END
WRITE8_MEMBER(snk68_state::D7759_write_port_0_w)
@@ -588,12 +578,12 @@ static MACHINE_CONFIG_START( pow, snk68_state )
// give a theoretical refresh rate of 59.1856Hz while the measured
// rate on a SAR board is 59.16Hz.
MCFG_SCREEN_RAW_PARAMS(XTAL_24MHz/4, 384, 0, 256, 264, 16, 240)
- MCFG_SCREEN_UPDATE_DRIVER(snk68_state, screen_update_pow)
+ MCFG_SCREEN_UPDATE_DRIVER(snk68_state, screen_update)
MCFG_SCREEN_PALETTE("palette")
MCFG_GFXDECODE_ADD("gfxdecode", "palette", pow)
MCFG_PALETTE_ADD("palette", 0x800)
-
+ MCFG_PALETTE_FORMAT(xRGBRRRRGGGGBBBB_bit0)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
@@ -745,6 +735,8 @@ ROM_START( streetsm1 )
ROM_REGION( 0x20000, "upd", 0 ) /* UPD7759 samples */
ROM_LOAD( "s2-6.18d", 0x000000, 0x20000, CRC(47db1605) SHA1(ae00e633eb98567f04ff97e3d63e04e049d955ec) )
+
+ ROM_REGION16_BE( 0x40000, "user1", ROMREGION_ERASE00 ) /* Extra code bank */
ROM_END
ROM_START( streetsmw )
@@ -771,6 +763,8 @@ ROM_START( streetsmw )
ROM_REGION( 0x20000, "upd", 0 ) /* UPD7759 samples */
ROM_LOAD( "s2-6.18d", 0x000000, 0x20000, CRC(47db1605) SHA1(ae00e633eb98567f04ff97e3d63e04e049d955ec) )
+
+ ROM_REGION16_BE( 0x40000, "user1", ROMREGION_ERASE00 ) /* Extra code bank */
ROM_END
ROM_START( streetsmj )
@@ -797,6 +791,8 @@ ROM_START( streetsmj )
ROM_REGION( 0x20000, "upd", 0 ) /* UPD7759 samples */
ROM_LOAD( "s2-6.18d", 0x000000, 0x20000, CRC(47db1605) SHA1(ae00e633eb98567f04ff97e3d63e04e049d955ec) )
+
+ ROM_REGION16_BE( 0x40000, "user1", ROMREGION_ERASE00 ) /* Extra code bank */
ROM_END
ROM_START( ikari3 )
@@ -1067,23 +1063,16 @@ ROM_END
/******************************************************************************/
-DRIVER_INIT_MEMBER(snk68_state,searchar)
-{
- membank("bank1")->set_base(memregion("user1")->base());
-}
-
-/******************************************************************************/
-
-GAME( 1988, pow, 0, pow, pow, driver_device, 0, ROT0, "SNK", "P.O.W. - Prisoners of War (US version 1)", 0 )
-GAME( 1988, powj, pow, pow, powj, driver_device, 0, ROT0, "SNK", "Datsugoku - Prisoners of War (Japan)", 0 )
-GAME( 1989, streetsm, 0, pow, streetsm, driver_device, 0, ROT0, "SNK", "Street Smart (US version 2)", 0 )
-GAME( 1989, streetsm1, streetsm, searchar, streetsm, driver_device, 0, ROT0, "SNK", "Street Smart (US version 1)", 0 )
-GAME( 1989, streetsmw, streetsm, searchar, streetsj, driver_device, 0, ROT0, "SNK", "Street Smart (World version 1)", 0 )
-GAME( 1989, streetsmj, streetsm, searchar, streetsj, driver_device, 0, ROT0, "SNK", "Street Smart (Japan version 1)", 0 )
-GAME( 1989, ikari3, 0, searchar, ikari3, snk68_state, searchar, ROT0, "SNK", "Ikari III - The Rescue (World, 8-Way Joystick)", 0 )
-GAME( 1989, ikari3u, ikari3, searchar, ikari3, snk68_state, searchar, ROT0, "SNK", "Ikari III - The Rescue (US, Rotary Joystick)", 0 )
-GAME( 1989, ikari3j, ikari3, searchar, ikari3, snk68_state, searchar, ROT0, "SNK", "Ikari Three (Japan, Rotary Joystick)", 0 )
-GAME( 1989, ikari3k, ikari3, searchar, ikari3, snk68_state, searchar, ROT0, "SNK", "Ikari Three (Korea, 8-Way Joystick)", 0 )
-GAME( 1989, searchar, 0, searchar, searchar, snk68_state, searchar, ROT90, "SNK", "SAR - Search And Rescue (World)", 0 )
-GAME( 1989, searcharu, searchar, searchar, searchar, snk68_state, searchar, ROT90, "SNK", "SAR - Search And Rescue (US)", 0 )
-GAME( 1989, searcharj, searchar, searchar, searchar, snk68_state, searchar, ROT90, "SNK", "SAR - Search And Rescue (Japan)", 0 )
+GAME( 1988, pow, 0, pow, pow, driver_device, 0, ROT0, "SNK", "P.O.W. - Prisoners of War (US version 1)", GAME_SUPPORTS_SAVE )
+GAME( 1988, powj, pow, pow, powj, driver_device, 0, ROT0, "SNK", "Datsugoku - Prisoners of War (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1989, streetsm, 0, pow, streetsm, driver_device, 0, ROT0, "SNK", "Street Smart (US version 2)", GAME_SUPPORTS_SAVE )
+GAME( 1989, streetsm1, streetsm, searchar, streetsm, driver_device, 0, ROT0, "SNK", "Street Smart (US version 1)", GAME_SUPPORTS_SAVE )
+GAME( 1989, streetsmw, streetsm, searchar, streetsj, driver_device, 0, ROT0, "SNK", "Street Smart (World version 1)", GAME_SUPPORTS_SAVE )
+GAME( 1989, streetsmj, streetsm, searchar, streetsj, driver_device, 0, ROT0, "SNK", "Street Smart (Japan version 1)", GAME_SUPPORTS_SAVE )
+GAME( 1989, ikari3, 0, searchar, ikari3, driver_device, 0, ROT0, "SNK", "Ikari III - The Rescue (World, 8-Way Joystick)", GAME_SUPPORTS_SAVE )
+GAME( 1989, ikari3u, ikari3, searchar, ikari3, driver_device, 0, ROT0, "SNK", "Ikari III - The Rescue (US, Rotary Joystick)", GAME_SUPPORTS_SAVE )
+GAME( 1989, ikari3j, ikari3, searchar, ikari3, driver_device, 0, ROT0, "SNK", "Ikari Three (Japan, Rotary Joystick)", GAME_SUPPORTS_SAVE )
+GAME( 1989, ikari3k, ikari3, searchar, ikari3, driver_device, 0, ROT0, "SNK", "Ikari Three (Korea, 8-Way Joystick)", GAME_SUPPORTS_SAVE )
+GAME( 1989, searchar, 0, searchar, searchar, driver_device, 0, ROT90, "SNK", "SAR - Search And Rescue (World)", GAME_SUPPORTS_SAVE )
+GAME( 1989, searcharu, searchar, searchar, searchar, driver_device, 0, ROT90, "SNK", "SAR - Search And Rescue (US)", GAME_SUPPORTS_SAVE )
+GAME( 1989, searcharj, searchar, searchar, searchar, driver_device, 0, ROT90, "SNK", "SAR - Search And Rescue (Japan)", GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/snowbros.c b/src/mame/drivers/snowbros.c
index dee53e1e965..0da2ca54e44 100644
--- a/src/mame/drivers/snowbros.c
+++ b/src/mame/drivers/snowbros.c
@@ -1654,11 +1654,11 @@ MACHINE_RESET_MEMBER(snowbros_state,finalttr)
static MACHINE_CONFIG_START( snowbros, snowbros_state )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", M68000, 8000000) /* 8 Mhz - confirmed */
+ MCFG_CPU_ADD("maincpu", M68000, XTAL_16MHz/2) /* 8 Mhz - confirmed */
MCFG_CPU_PROGRAM_MAP(snowbros_map)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", snowbros_state, snowbros_irq, "screen", 0, 1)
- MCFG_CPU_ADD("soundcpu", Z80, 6000000) /* 6 MHz - confirmed */
+ MCFG_CPU_ADD("soundcpu", Z80, XTAL_12MHz/2) /* 6 MHz - confirmed */
MCFG_CPU_PROGRAM_MAP(sound_map)
MCFG_CPU_IO_MAP(sound_io_map)
@@ -1683,7 +1683,7 @@ static MACHINE_CONFIG_START( snowbros, snowbros_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("ymsnd", YM3812, 3000000)
+ MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_12MHz/4) /* 3 MHz - confirmed */
MCFG_YM3812_IRQ_HANDLER(INPUTLINE("soundcpu", 0))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -1731,12 +1731,11 @@ static MACHINE_CONFIG_DERIVED( semicom, snowbros )
MACHINE_CONFIG_END
-
static MACHINE_CONFIG_DERIVED( semicom_mcu, semicom )
/* basic machine hardware */
- MCFG_CPU_ADD("protection", I8052, 16000000) // AT89C52
+ MCFG_CPU_ADD("protection", I8052, XTAL_16MHz) // AT89C52
MCFG_CPU_PROGRAM_MAP(protection_map)
MCFG_CPU_IO_MAP(protection_iomap)
MACHINE_CONFIG_END
@@ -1746,34 +1745,15 @@ static MACHINE_CONFIG_DERIVED( semiprot, semicom )
MCFG_MACHINE_RESET_OVERRIDE (snowbros_state, semiprot )
MACHINE_CONFIG_END
-/*
-
-Honey Doll - Barko Corp 1995
-
-Rom Board include a Cypress cy7C382-0JC chip
-
-Main Board :
-
-CPU : 1 X MC68000P12
- 1 X Z80B
-
-1 X Oki M6295
-2 X Cypress CY7C384A-XJC
-
-2 x quartz - 12Mhz and 16Mhz
-
-
-See included pics
-*/
static MACHINE_CONFIG_START( honeydol, snowbros_state )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", M68000, 16000000)
+ MCFG_CPU_ADD("maincpu", M68000, XTAL_12MHz) /* MC68000P12 @ 12MHz */
MCFG_CPU_PROGRAM_MAP(honeydol_map)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", snowbros_state, snowbros_irq, "screen", 0, 1)
- MCFG_CPU_ADD("soundcpu", Z80, 4000000)
+ MCFG_CPU_ADD("soundcpu", Z80, XTAL_16MHz/4) /* 4Mhz (16MHz/4) like SemiCom or 6MHz (12MHz/2) like snowbros??? */
MCFG_CPU_PROGRAM_MAP(honeydol_sound_map)
MCFG_CPU_IO_MAP(honeydol_sound_io_map)
@@ -1795,23 +1775,23 @@ static MACHINE_CONFIG_START( honeydol, snowbros_state )
/* sound hardware */
- MCFG_SOUND_ADD("ymsnd", YM3812, 3000000)
+ MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_12MHz/4) /* 3Mhz */
MCFG_YM3812_IRQ_HANDLER(INPUTLINE("soundcpu", 0))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
- MCFG_OKIM6295_ADD("oki", 999900, OKIM6295_PIN7_HIGH) /* freq? */
+ MCFG_OKIM6295_ADD("oki", XTAL_16MHz/16, OKIM6295_PIN7_HIGH) /* freq? */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( twinadv, snowbros_state )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", M68000, 16000000) // or 12
+ MCFG_CPU_ADD("maincpu", M68000, XTAL_12MHz) /* 12MHz like Honey Dolls ? */
MCFG_CPU_PROGRAM_MAP(twinadv_map)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", snowbros_state, snowbros_irq, "screen", 0, 1)
- MCFG_CPU_ADD("soundcpu", Z80, 4000000)
+ MCFG_CPU_ADD("soundcpu", Z80, XTAL_16MHz/4) /* 4Mhz (16MHz/4) like SemiCom or 6MHz (12MHz/2) like snowbros??? */
MCFG_CPU_PROGRAM_MAP(sound_map)
MCFG_CPU_IO_MAP(twinadv_sound_io_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", snowbros_state, irq0_line_hold)
@@ -1833,7 +1813,7 @@ static MACHINE_CONFIG_START( twinadv, snowbros_state )
MCFG_SPEAKER_STANDARD_MONO("mono")
/* sound hardware */
- MCFG_OKIM6295_ADD("oki", 12000000/12, OKIM6295_PIN7_HIGH) /* freq? */
+ MCFG_OKIM6295_ADD("oki", XTAL_16MHz/16, OKIM6295_PIN7_HIGH) /* freq? */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -1859,15 +1839,15 @@ Intel P8752 (mcu)
static MACHINE_CONFIG_DERIVED( finalttr, semicom )
MCFG_CPU_MODIFY("maincpu")
- MCFG_CPU_CLOCK(12000000)
+ MCFG_CPU_CLOCK(XTAL_12MHz)
MCFG_CPU_PROGRAM_MAP(finalttr_map)
MCFG_CPU_MODIFY("soundcpu")
- MCFG_CPU_CLOCK(3578545)
+ MCFG_CPU_CLOCK(XTAL_3_579545MHz)
MCFG_MACHINE_RESET_OVERRIDE (snowbros_state, finalttr )
- MCFG_SOUND_REPLACE("ymsnd", YM2151, 4000000)
+ MCFG_SOUND_REPLACE("ymsnd", YM2151, XTAL_3_579545MHz) /* possible but less likely 4MHz (12MHz/3) */
MCFG_YM2151_IRQ_HANDLER(INPUTLINE("soundcpu", 0))
MCFG_SOUND_ROUTE(0, "mono", 0.08)
MCFG_SOUND_ROUTE(1, "mono", 0.08)
@@ -1883,10 +1863,10 @@ static MACHINE_CONFIG_DERIVED( _4in1, semicom )
MCFG_GFXDECODE_MODIFY("gfxdecode", snowbros)
MACHINE_CONFIG_END
-static MACHINE_CONFIG_START( snowbro3, snowbros_state )
+static MACHINE_CONFIG_START( snowbro3, snowbros_state ) /* PCB has 16MHz & 12MHz OSCs */
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", M68000, 16000000) /* 16mhz or 12mhz ? */
+ MCFG_CPU_ADD("maincpu", M68000, XTAL_12MHz) /* MC68000P10 CPU @ 12mhz or 8MHz (16MHz/2) ? */
MCFG_CPU_PROGRAM_MAP(snowbros3_map)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", snowbros_state, snowbros3_irq, "screen", 0, 1)
@@ -1906,7 +1886,7 @@ static MACHINE_CONFIG_START( snowbro3, snowbros_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_OKIM6295_ADD("oki", 999900, OKIM6295_PIN7_HIGH) // clock frequency & pin 7 not verified
+ MCFG_OKIM6295_ADD("oki", XTAL_16MHz/16, OKIM6295_PIN7_HIGH) // clock frequency & pin 7 not verified
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
@@ -2064,6 +2044,24 @@ ROM_END
/* Barko */
+/*
+
+Honey Doll - Barko Corp 1995
+
+Rom Board include a Cypress cy7C382-0JC chip
+
+Main Board :
+
+CPU : 1 X MC68000P12
+ 1 X Z80B
+
+1 X Oki M6295
+2 X Cypress CY7C384A-XJC
+
+2 x quartz - 12Mhz and 16Mhz
+
+*/
+
ROM_START( honeydol )
ROM_REGION( 0x40000, "maincpu", 0 )
ROM_LOAD16_BYTE( "d-16.uh12", 0x00001, 0x20000, CRC(cee1a2e3) SHA1(6d1ff5358ec704616b724eea2ab9b60b84709eb1) )
@@ -2725,11 +2723,11 @@ GAME( 1995, hyperpacb,hyperpac, semicom, hyperpac, driver_device, 0,
GAME( 1996, cookbib2, 0, semiprot, cookbib2, snowbros_state, cookbib2, ROT0, "SemiCom", "Cookie & Bibi 2", GAME_SUPPORTS_SAVE )
GAME( 1996, toppyrap, 0, semiprot, toppyrap, driver_device, 0, ROT0, "SemiCom", "Toppy & Rappy", GAME_SUPPORTS_SAVE )
GAME( 1997, cookbib3, 0, semiprot, cookbib3, snowbros_state, cookbib3, ROT0, "SemiCom", "Cookie & Bibi 3", GAME_SUPPORTS_SAVE )
-GAME( 1997, pzlbreak, 0, semiprot, pzlbreak, snowbros_state, pzlbreak, ROT0, "SemiCom", "Puzzle Break", GAME_SUPPORTS_SAVE )
+GAME( 1997, pzlbreak, 0, semiprot, pzlbreak, snowbros_state, pzlbreak, ROT0, "SemiCom / Tirano", "Puzzle Break", GAME_SUPPORTS_SAVE )
GAME( 1997, suhosong, 0, semiprot, suhosong, driver_device, 0, ROT0, "SemiCom", "Su Ho Seong", GAME_SUPPORTS_SAVE )
-GAME( 1997, twinkle, 0, semiprot, twinkle, driver_device, 0, ROT0, "SemiCom", "Twinkle", GAME_SUPPORTS_SAVE )
-GAME( 1998, 3in1semi, 0, semiprot, moremore, snowbros_state, 3in1semi, ROT0, "SemiCom", "XESS - The New Revolution (SemiCom 3-in-1)", GAME_SUPPORTS_SAVE )
-GAME( 1999, mcheonru, 0, semiprot, mcheonru, snowbros_state, 3in1semi, ROT0, "SemiCom", "Ma Cheon Ru", GAME_SUPPORTS_SAVE )
+GAME( 1997, twinkle, 0, semiprot, twinkle, driver_device, 0, ROT0, "SemiCom / Tirano", "Twinkle", GAME_SUPPORTS_SAVE )
+GAME( 1998, 3in1semi, 0, semiprot, moremore, snowbros_state, 3in1semi, ROT0, "SemiCom / XESS", "New HyperMan (3-in-1 with Cookie & Bibi & HyperMan)", GAME_SUPPORTS_SAVE )
+GAME( 1999, mcheonru, 0, semiprot, mcheonru, snowbros_state, 3in1semi, ROT0, "SemiCom / AceVer", "Ma Cheon Ru", GAME_SUPPORTS_SAVE ) // a flyer exists for an English version called Arirang, AceVer team logo is displayed on it
GAME( 1999, moremore, 0, semiprot, moremore, snowbros_state, 3in1semi, ROT0, "SemiCom / Exit", "More More", GAME_SUPPORTS_SAVE )
GAME( 1999, moremorp, 0, semiprot, moremore, snowbros_state, 3in1semi, ROT0, "SemiCom / Exit", "More More Plus", GAME_SUPPORTS_SAVE )
// This is very similar to the SemiCom titles, but unprotected.
diff --git a/src/mame/drivers/spacefb.c b/src/mame/drivers/spacefb.c
index e71440f1164..6dfb2178091 100644
--- a/src/mame/drivers/spacefb.c
+++ b/src/mame/drivers/spacefb.c
@@ -126,6 +126,18 @@
*************************************/
+void spacefb_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
+{
+ switch(id)
+ {
+ case TIMER_INTERRUPT:
+ interrupt_callback(ptr, param);
+ break;
+ default:
+ assert_always(FALSE, "Unknown id in spacefb_state::device_timer");
+ }
+}
+
TIMER_CALLBACK_MEMBER(spacefb_state::interrupt_callback)
{
int next_vpos;
@@ -144,13 +156,6 @@ TIMER_CALLBACK_MEMBER(spacefb_state::interrupt_callback)
m_interrupt_timer->adjust(m_screen->time_until_pos(next_vpos));
}
-
-void spacefb_state::create_interrupt_timer()
-{
- m_interrupt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(spacefb_state::interrupt_callback),this));
-}
-
-
void spacefb_state::start_interrupt_timer()
{
m_interrupt_timer->adjust(m_screen->time_until_pos(SPACEFB_INT_TRIGGER_COUNT_1));
@@ -166,7 +171,9 @@ void spacefb_state::start_interrupt_timer()
void spacefb_state::machine_start()
{
- create_interrupt_timer();
+ m_interrupt_timer = timer_alloc(TIMER_INTERRUPT);
+
+ save_item(NAME(m_sound_latch));
}
@@ -181,9 +188,9 @@ void spacefb_state::machine_reset()
{
address_space &space = m_maincpu->space(AS_IO);
/* the 3 output ports are cleared on reset */
- spacefb_port_0_w(space, 0, 0);
- spacefb_port_1_w(space, 0, 0);
- spacefb_port_2_w(space, 0, 0);
+ port_0_w(space, 0, 0);
+ port_1_w(space, 0, 0);
+ port_2_w(space, 0, 0);
start_interrupt_timer();
}
@@ -226,18 +233,18 @@ static ADDRESS_MAP_START( spacefb_main_io_map, AS_IO, 8, spacefb_state )
AM_RANGE(0x03, 0x03) AM_READ_PORT("DSW")
AM_RANGE(0x04, 0x07) AM_READNOP /* yes, this is correct (1-of-8 decoder) */
- AM_RANGE(0x00, 0x00) AM_MIRROR(0x04) AM_WRITE(spacefb_port_0_w)
- AM_RANGE(0x01, 0x01) AM_MIRROR(0x04) AM_WRITE(spacefb_port_1_w)
- AM_RANGE(0x02, 0x02) AM_MIRROR(0x04) AM_WRITE(spacefb_port_2_w)
+ AM_RANGE(0x00, 0x00) AM_MIRROR(0x04) AM_WRITE(port_0_w)
+ AM_RANGE(0x01, 0x01) AM_MIRROR(0x04) AM_WRITE(port_1_w)
+ AM_RANGE(0x02, 0x02) AM_MIRROR(0x04) AM_WRITE(port_2_w)
AM_RANGE(0x03, 0x03) AM_MIRROR(0x04) AM_WRITENOP
ADDRESS_MAP_END
static ADDRESS_MAP_START( spacefb_audio_io_map, AS_IO, 8, spacefb_state )
AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_DEVWRITE("dac", dac_device, write_unsigned8)
- AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_READ(spacefb_audio_p2_r)
- AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_READ(spacefb_audio_t0_r)
- AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ(spacefb_audio_t1_r)
+ AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_READ(audio_p2_r)
+ AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_READ(audio_t0_r)
+ AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ(audio_t1_r)
ADDRESS_MAP_END
@@ -344,7 +351,7 @@ static MACHINE_CONFIG_START( spacefb, spacefb_state )
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_RAW_PARAMS(SPACEFB_PIXEL_CLOCK, SPACEFB_HTOTAL, SPACEFB_HBEND, SPACEFB_HBSTART, SPACEFB_VTOTAL, SPACEFB_VBEND, SPACEFB_VBSTART)
- MCFG_SCREEN_UPDATE_DRIVER(spacefb_state, screen_update_spacefb)
+ MCFG_SCREEN_UPDATE_DRIVER(spacefb_state, screen_update)
/* audio hardware */
MCFG_FRAGMENT_ADD(spacefb_audio)
@@ -597,12 +604,12 @@ ROM_END
*
*************************************/
-GAME( 1980, spacefb, 0, spacefb, spacefb, driver_device, 0, ROT270, "Nintendo", "Space Firebird (rev. 04-u)", GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND )
-GAME( 1980, spacefbe, spacefb, spacefb, spacefb, driver_device, 0, ROT270, "Nintendo", "Space Firebird (rev. 03-e set 1)", GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND )
-GAME( 1980, spacefbe2,spacefb, spacefb, spacefb, driver_device, 0, ROT270, "Nintendo", "Space Firebird (rev. 03-e set 2)", GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND )
-GAME( 1980, spacefba, spacefb, spacefb, spacefb, driver_device, 0, ROT270, "Nintendo", "Space Firebird (rev. 02-a)", GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND )
-GAME( 1980, spacefbg, spacefb, spacefb, spacefb, driver_device, 0, ROT270, "Nintendo (Gremlin license)", "Space Firebird (Gremlin)", GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND )
-GAME( 1980, spacebrd, spacefb, spacefb, spacefb, driver_device, 0, ROT270, "bootleg (Karateco)", "Space Bird (bootleg)", GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND )
-GAME( 1980, spacefbb, spacefb, spacefb, spacefb, driver_device, 0, ROT270, "bootleg", "Space Firebird (bootleg)", GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND )
-GAME( 1980, spacedem, spacefb, spacefb, spacedem, driver_device, 0, ROT270, "Nintendo (Fortrek license)", "Space Demon", GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND )
-GAME( 1980, starwarr, spacefb, spacefb, spacefb, driver_device, 0, ROT270, "bootleg? (Potomac Mortgage)", "Star Warrior", GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND )
+GAME( 1980, spacefb, 0, spacefb, spacefb, driver_device, 0, ROT270, "Nintendo", "Space Firebird (rev. 04-u)", GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
+GAME( 1980, spacefbe, spacefb, spacefb, spacefb, driver_device, 0, ROT270, "Nintendo", "Space Firebird (rev. 03-e set 1)", GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
+GAME( 1980, spacefbe2,spacefb, spacefb, spacefb, driver_device, 0, ROT270, "Nintendo", "Space Firebird (rev. 03-e set 2)", GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
+GAME( 1980, spacefba, spacefb, spacefb, spacefb, driver_device, 0, ROT270, "Nintendo", "Space Firebird (rev. 02-a)", GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
+GAME( 1980, spacefbg, spacefb, spacefb, spacefb, driver_device, 0, ROT270, "Nintendo (Gremlin license)", "Space Firebird (Gremlin)", GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
+GAME( 1980, spacebrd, spacefb, spacefb, spacefb, driver_device, 0, ROT270, "bootleg (Karateco)", "Space Bird (bootleg)", GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
+GAME( 1980, spacefbb, spacefb, spacefb, spacefb, driver_device, 0, ROT270, "bootleg", "Space Firebird (bootleg)", GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
+GAME( 1980, spacedem, spacefb, spacefb, spacedem, driver_device, 0, ROT270, "Nintendo (Fortrek license)", "Space Demon", GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
+GAME( 1980, starwarr, spacefb, spacefb, spacefb, driver_device, 0, ROT270, "bootleg? (Potomac Mortgage)", "Star Warrior", GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/spbactn.c b/src/mame/drivers/spbactn.c
index d4fcfec56a1..e05ddd35483 100644
--- a/src/mame/drivers/spbactn.c
+++ b/src/mame/drivers/spbactn.c
@@ -84,7 +84,7 @@ The manual defines the controls as 4 push buttons:
TODO : (also check the notes from the galspnbl.c driver)
- - coin insertion is not recognized consistenly.
+ - coin insertion is not recognized consistently.
- rewrite video, do single pass sprite render, move sprite code to device, share with gaiden.c etc.
- convert to tilemaps
- all the unknown regs
@@ -580,7 +580,7 @@ ROM_START( spbactnp )
/* does this have an extra (horizontal) screen maybe, with the girls being displayed on that instead of the main one.. */
- ROM_REGION( 0x10000, "extracpu", 0 ) // what? it's annother z80 rom... unused for now
+ ROM_REGION( 0x10000, "extracpu", 0 ) // what? it's another z80 rom... unused for now
ROM_LOAD( "6204_6-6.29c", 0x00000, 0x10000, CRC(e8250c26) SHA1(9b669878790c8e3c5d80f165b5ffa1d6830f4696) )
ROM_REGION( 0x080000, "gfx4", 0 ) /* 8x8 BG Tiles */ // more 8x8 tiles, with the girl graphics? unused for now .. for horizontal orientation??
@@ -592,6 +592,6 @@ ROM_START( spbactnp )
ROM_LOAD( "tcm1.19g.bin", 0x00000, 0x53, CRC(2c54354a) SHA1(11d8b6cdaf052b5a9fbcf6b6fbf99c5f89575cfa) )
ROM_END
-GAME( 1991, spbactn, 0, spbactn, spbactn, driver_device, 0, ROT90, "Tecmo", "Super Pinball Action (US)", GAME_IMPERFECT_GRAPHICS )
-GAME( 1991, spbactnj, spbactn, spbactn, spbactn, driver_device, 0, ROT90, "Tecmo", "Super Pinball Action (Japan)", GAME_IMPERFECT_GRAPHICS )
-GAME( 1989, spbactnp, spbactn, spbactnp, spbactn, driver_device, 0, ROT90, "Tecmo", "Super Pinball Action (prototype)", GAME_NOT_WORKING ) // early proto, (c) date is 2 years earlier!
+GAME( 1991, spbactn, 0, spbactn, spbactn, driver_device, 0, ROT90, "Tecmo", "Super Pinball Action (US)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
+GAME( 1991, spbactnj, spbactn, spbactn, spbactn, driver_device, 0, ROT90, "Tecmo", "Super Pinball Action (Japan)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
+GAME( 1989, spbactnp, spbactn, spbactnp, spbactn, driver_device, 0, ROT90, "Tecmo", "Super Pinball Action (prototype)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) // early proto, (c) date is 2 years earlier!
diff --git a/src/mame/drivers/spdodgeb.c b/src/mame/drivers/spdodgeb.c
index 637b619bdca..add856999d4 100644
--- a/src/mame/drivers/spdodgeb.c
+++ b/src/mame/drivers/spdodgeb.c
@@ -4,7 +4,7 @@
Super Dodge Ball / Nekketsu Koukou Dodgeball Bu
-briver by Paul Hampson and Nicola Salmoria
+driver by Paul Hampson and Nicola Salmoria
TODO:
- sprite lag (the real game has quite a bit of lag too)
@@ -27,7 +27,6 @@ Notes:
#include "cpu/m6502/m6502.h"
#include "cpu/m6809/m6809.h"
#include "sound/3812intf.h"
-#include "sound/msm5205.h"
#include "includes/spdodgeb.h"
@@ -244,17 +243,17 @@ WRITE8_MEMBER(spdodgeb_state::mcu63701_w)
static ADDRESS_MAP_START( spdodgeb_map, AS_PROGRAM, 8, spdodgeb_state )
AM_RANGE(0x0000, 0x0fff) AM_RAM
AM_RANGE(0x1000, 0x10ff) AM_WRITEONLY AM_SHARE("spriteram")
- AM_RANGE(0x2000, 0x2fff) AM_RAM_WRITE(spdodgeb_videoram_w) AM_SHARE("videoram")
+ AM_RANGE(0x2000, 0x2fff) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram")
AM_RANGE(0x3000, 0x3000) AM_READ_PORT("IN0") //AM_WRITENOP
AM_RANGE(0x3001, 0x3001) AM_READ_PORT("DSW") //AM_WRITENOP
AM_RANGE(0x3002, 0x3002) AM_WRITE(sound_command_w)
// AM_RANGE(0x3003, 0x3003) AM_WRITENOP
- AM_RANGE(0x3004, 0x3004) AM_WRITE(spdodgeb_scrollx_lo_w)
+ AM_RANGE(0x3004, 0x3004) AM_WRITE(scrollx_lo_w)
// AM_RANGE(0x3005, 0x3005) AM_WRITENOP /* mcu63701_output_w */
- AM_RANGE(0x3006, 0x3006) AM_WRITE(spdodgeb_ctrl_w) /* scroll hi, flip screen, bank switch, palette select */
+ AM_RANGE(0x3006, 0x3006) AM_WRITE(ctrl_w) /* scroll hi, flip screen, bank switch, palette select */
AM_RANGE(0x3800, 0x3800) AM_WRITE(mcu63701_w)
AM_RANGE(0x3801, 0x3805) AM_READ(mcu63701_r)
- AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank1")
+ AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("mainbank")
AM_RANGE(0x8000, 0xffff) AM_ROM
ADDRESS_MAP_END
@@ -380,6 +379,20 @@ static GFXDECODE_START( spdodgeb )
GFXDECODE_END
+void spdodgeb_state::machine_start()
+{
+ save_item(NAME(m_toggle));
+ save_item(NAME(m_adpcm_pos));
+ save_item(NAME(m_adpcm_end));
+ save_item(NAME(m_adpcm_idle));
+ save_item(NAME(m_adpcm_data));
+ save_item(NAME(m_mcu63701_command));
+ save_item(NAME(m_inputs));
+ save_item(NAME(m_tapc));
+ save_item(NAME(m_last_port));
+ save_item(NAME(m_last_dash));
+}
+
void spdodgeb_state::machine_reset()
{
m_toggle = 0;
@@ -399,7 +412,7 @@ static MACHINE_CONFIG_START( spdodgeb, spdodgeb_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M6502, XTAL_12MHz/6) /* 2MHz ? */
MCFG_CPU_PROGRAM_MAP(spdodgeb_map)
- MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", spdodgeb_state, spdodgeb_interrupt, "screen", 0, 1) /* 1 IRQ every 8 visible scanlines, plus NMI for vblank */
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", spdodgeb_state, interrupt, "screen", 0, 1) /* 1 IRQ every 8 visible scanlines, plus NMI for vblank */
MCFG_CPU_ADD("audiocpu", M6809, XTAL_12MHz/6) /* 2MHz ? */
MCFG_CPU_PROGRAM_MAP(spdodgeb_sound_map)
@@ -407,7 +420,7 @@ static MACHINE_CONFIG_START( spdodgeb, spdodgeb_state )
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_RAW_PARAMS(XTAL_12MHz/2, 384, 0, 256, 272, 0, 240)
- MCFG_SCREEN_UPDATE_DRIVER(spdodgeb_state, screen_update_spdodgeb)
+ MCFG_SCREEN_UPDATE_DRIVER(spdodgeb_state, screen_update)
MCFG_SCREEN_PALETTE("palette")
MCFG_GFXDECODE_ADD("gfxdecode", "palette", spdodgeb)
@@ -561,6 +574,6 @@ ROM_END
-GAME( 1987, spdodgeb, 0, spdodgeb, spdodgeb, driver_device, 0, ROT0, "Technos Japan", "Super Dodge Ball (US)", 0 )
-GAME( 1987, nkdodge, spdodgeb, spdodgeb, spdodgeb, driver_device, 0, ROT0, "Technos Japan", "Nekketsu Koukou Dodgeball Bu (Japan)", 0 )
-GAME( 1987, nkdodgeb, spdodgeb, spdodgeb, spdodgeb, driver_device, 0, ROT0, "bootleg", "Nekketsu Koukou Dodgeball Bu (Japan, bootleg)", 0 )
+GAME( 1987, spdodgeb, 0, spdodgeb, spdodgeb, driver_device, 0, ROT0, "Technos Japan", "Super Dodge Ball (US)", GAME_SUPPORTS_SAVE )
+GAME( 1987, nkdodge, spdodgeb, spdodgeb, spdodgeb, driver_device, 0, ROT0, "Technos Japan", "Nekketsu Koukou Dodgeball Bu (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1987, nkdodgeb, spdodgeb, spdodgeb, spdodgeb, driver_device, 0, ROT0, "bootleg", "Nekketsu Koukou Dodgeball Bu (Japan, bootleg)", GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/sprcros2.c b/src/mame/drivers/sprcros2.c
index 473fbce281a..45b231384f8 100644
--- a/src/mame/drivers/sprcros2.c
+++ b/src/mame/drivers/sprcros2.c
@@ -64,10 +64,8 @@ Notes:
-WRITE8_MEMBER(sprcros2_state::sprcros2_m_port7_w)
+WRITE8_MEMBER(sprcros2_state::m_port7_w)
{
- UINT8 *RAM = memregion("master")->base();
-
//76543210
//x------- unused
//-x------ bankswitch halves of scm-01.10k into c000-dfff
@@ -78,17 +76,15 @@ WRITE8_MEMBER(sprcros2_state::sprcros2_m_port7_w)
//-------x nmi enable
if((m_port7^data)&0x40)
- membank("bank1")->set_base(&RAM[0x10000+((data&0x40)<<7)]);
+ membank("masterbank")->set_entry((data&0x40)>>6);
machine().tilemap().set_flip_all(data&0x02?(TILEMAP_FLIPX|TILEMAP_FLIPY):0 );
m_port7 = data;
}
-WRITE8_MEMBER(sprcros2_state::sprcros2_s_port3_w)
+WRITE8_MEMBER(sprcros2_state::s_port3_w)
{
- UINT8 *RAM = memregion("slave")->base();
-
//76543210
//xxxx---- unused
//----x--- bankswitch halves of scs-27.5k into c000-dfff
@@ -96,15 +92,15 @@ WRITE8_MEMBER(sprcros2_state::sprcros2_s_port3_w)
//-------x nmi enable
if((m_s_port3^data)&0x08)
- membank("bank2")->set_base(&RAM[0x10000+((data&0x08)<<10)]);
+ membank("slavebank")->set_entry((data&0x08)>>3);
m_s_port3 = data;
}
static ADDRESS_MAP_START( sprcros2_master_map, AS_PROGRAM, 8, sprcros2_state )
AM_RANGE(0x0000, 0xbfff) AM_ROM
- AM_RANGE(0xc000, 0xdfff) AM_ROMBANK("bank1")
- AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(sprcros2_fgvideoram_w) AM_SHARE("fgvideoram")
+ AM_RANGE(0xc000, 0xdfff) AM_ROMBANK("masterbank")
+ AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(fgvideoram_w) AM_SHARE("fgvideoram")
AM_RANGE(0xe800, 0xe817) AM_RAM //always zero
AM_RANGE(0xe818, 0xe83f) AM_RAM AM_SHARE("spriteram")
AM_RANGE(0xe840, 0xefff) AM_RAM //always zero
@@ -119,13 +115,13 @@ static ADDRESS_MAP_START( sprcros2_master_io_map, AS_IO, 8, sprcros2_state )
AM_RANGE(0x02, 0x02) AM_READ_PORT("EXTRA") AM_DEVWRITE("sn3", sn76489_device, write)
AM_RANGE(0x04, 0x04) AM_READ_PORT("DSW1")
AM_RANGE(0x05, 0x05) AM_READ_PORT("DSW2")
- AM_RANGE(0x07, 0x07) AM_WRITE(sprcros2_m_port7_w)
+ AM_RANGE(0x07, 0x07) AM_WRITE(m_port7_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( sprcros2_slave_map, AS_PROGRAM, 8, sprcros2_state )
AM_RANGE(0x0000, 0xbfff) AM_ROM
- AM_RANGE(0xc000, 0xdfff) AM_ROMBANK("bank2")
- AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(sprcros2_bgvideoram_w) AM_SHARE("bgvideoram")
+ AM_RANGE(0xc000, 0xdfff) AM_ROMBANK("slavebank")
+ AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(bgvideoram_w) AM_SHARE("bgvideoram")
AM_RANGE(0xe800, 0xefff) AM_RAM //always zero
AM_RANGE(0xf000, 0xf7ff) AM_RAM
AM_RANGE(0xf800, 0xffff) AM_RAM AM_SHARE("share1")
@@ -133,9 +129,9 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( sprcros2_slave_io_map, AS_IO, 8, sprcros2_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x00, 0x00) AM_WRITE(sprcros2_bgscrollx_w)
- AM_RANGE(0x01, 0x01) AM_WRITE(sprcros2_bgscrolly_w)
- AM_RANGE(0x03, 0x03) AM_WRITE(sprcros2_s_port3_w)
+ AM_RANGE(0x00, 0x00) AM_WRITE(bgscrollx_w)
+ AM_RANGE(0x01, 0x01) AM_WRITE(bgscrolly_w)
+ AM_RANGE(0x03, 0x03) AM_WRITE(s_port3_w)
ADDRESS_MAP_END
static INPUT_PORTS_START( sprcros2 )
@@ -230,7 +226,7 @@ static GFXDECODE_START( sprcros2 )
GFXDECODE_ENTRY( "gfx3", 0, sprcros2_fglayout, 512, 64 )
GFXDECODE_END
-TIMER_DEVICE_CALLBACK_MEMBER(sprcros2_state::sprcros2_m_interrupt)
+TIMER_DEVICE_CALLBACK_MEMBER(sprcros2_state::m_interrupt)
{
int scanline = param;
@@ -246,7 +242,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(sprcros2_state::sprcros2_m_interrupt)
}
}
-INTERRUPT_GEN_MEMBER(sprcros2_state::sprcros2_s_interrupt)
+INTERRUPT_GEN_MEMBER(sprcros2_state::s_interrupt)
{
if(m_s_port3&0x01)
device.execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
@@ -254,6 +250,9 @@ INTERRUPT_GEN_MEMBER(sprcros2_state::sprcros2_s_interrupt)
void sprcros2_state::machine_start()
{
+ membank("masterbank")->configure_entries(0, 2, memregion("master")->base() + 0x10000, 0x2000);
+ membank("slavebank")->configure_entries(0, 2, memregion("slave")->base() + 0x10000, 0x2000);
+
save_item(NAME(m_port7));
save_item(NAME(m_s_port3));
}
@@ -264,12 +263,12 @@ static MACHINE_CONFIG_START( sprcros2, sprcros2_state )
MCFG_CPU_ADD("master", Z80,10000000/2)
MCFG_CPU_PROGRAM_MAP(sprcros2_master_map)
MCFG_CPU_IO_MAP(sprcros2_master_io_map)
- MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", sprcros2_state, sprcros2_m_interrupt, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", sprcros2_state, m_interrupt, "screen", 0, 1)
MCFG_CPU_ADD("slave", Z80,10000000/2)
MCFG_CPU_PROGRAM_MAP(sprcros2_slave_map)
MCFG_CPU_IO_MAP(sprcros2_slave_io_map)
- MCFG_CPU_PERIODIC_INT_DRIVER(sprcros2_state, sprcros2_s_interrupt, 2*60) //2 nmis
+ MCFG_CPU_PERIODIC_INT_DRIVER(sprcros2_state, s_interrupt, 2*60) //2 nmis
/* video hardware */
@@ -278,7 +277,7 @@ static MACHINE_CONFIG_START( sprcros2, sprcros2_state )
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
MCFG_SCREEN_SIZE(32*8, 32*8)
MCFG_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 2*8, 30*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(sprcros2_state, screen_update_sprcros2)
+ MCFG_SCREEN_UPDATE_DRIVER(sprcros2_state, screen_update)
MCFG_SCREEN_PALETTE("palette")
MCFG_GFXDECODE_ADD("gfxdecode", "palette", sprcros2)
@@ -372,5 +371,5 @@ ROM_START( sprcros2a )
ROM_LOAD( "sc-60.4k", 0x0320, 0x0100, CRC(d7a4e57d) SHA1(6db02ec6aa55b05422cb505e63c71e36b4b11b4a) ) //fg clut
ROM_END
-GAME( 1986, sprcros2, 0, sprcros2, sprcros2, driver_device, 0, ROT0, "GM Shoji", "Super Cross II (Japan, set 1)", 0 )
-GAME( 1986, sprcros2a,sprcros2, sprcros2, sprcros2, driver_device, 0, ROT0, "GM Shoji", "Super Cross II (Japan, set 2)", 0 )
+GAME( 1986, sprcros2, 0, sprcros2, sprcros2, driver_device, 0, ROT0, "GM Shoji", "Super Cross II (Japan, set 1)", GAME_SUPPORTS_SAVE )
+GAME( 1986, sprcros2a,sprcros2, sprcros2, sprcros2, driver_device, 0, ROT0, "GM Shoji", "Super Cross II (Japan, set 2)", GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/srmp2.c b/src/mame/drivers/srmp2.c
index b1fe1c166eb..f3fb40cdd0d 100644
--- a/src/mame/drivers/srmp2.c
+++ b/src/mame/drivers/srmp2.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Yochizo, Takahiro Nogi
/***************************************************************************
diff --git a/src/mame/drivers/srmp5.c b/src/mame/drivers/srmp5.c
index ec442c8ea2b..14d281bdcd8 100644
--- a/src/mame/drivers/srmp5.c
+++ b/src/mame/drivers/srmp5.c
@@ -243,6 +243,15 @@ UINT32 srmp5_state::screen_update_srmp5(screen_device &screen, bitmap_rgb32 &bit
void srmp5_state::machine_start()
{
membank("bank1")->configure_entries(0, 256, memregion("maincpu")->base(), 0x4000);
+
+ save_item(NAME(m_input_select));
+ save_item(NAME(m_cmd1));
+ save_item(NAME(m_cmd2));
+ save_item(NAME(m_cmd_stat));
+ save_item(NAME(m_chrbank));
+ save_pointer(NAME(m_tileram), 0x100000/2);
+ save_pointer(NAME(m_sprram), 0x80000/2);
+ save_item(NAME(m_vidregs));
}
WRITE32_MEMBER(srmp5_state::bank_w)
@@ -610,4 +619,4 @@ DRIVER_INIT_MEMBER(srmp5_state,srmp5)
#endif
}
-GAME( 1994, srmp5, 0, srmp5, srmp5, srmp5_state, srmp5, ROT0, "Seta", "Super Real Mahjong P5", GAME_IMPERFECT_GRAPHICS)
+GAME( 1994, srmp5, 0, srmp5, srmp5, srmp5_state, srmp5, ROT0, "Seta", "Super Real Mahjong P5", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/ssingles.c b/src/mame/drivers/ssingles.c
index 362ea470021..d8893cb1f71 100644
--- a/src/mame/drivers/ssingles.c
+++ b/src/mame/drivers/ssingles.c
@@ -1,7 +1,8 @@
// license:LGPL-2.1+
// copyright-holders:Tomasz Slanina
/*
- 'Swinging Singles' by Ent. Ent. Ltd
+ 'Swinging Singles' US distribution by Ent. Ent. Ltd
+ Original Japan release is 'Utamaro' by 'Yachiyo' (undumped!)
driver by Tomasz Slanina
@@ -664,5 +665,5 @@ DRIVER_INIT_MEMBER(ssingles_state,ssingles)
save_item(NAME(m_colorram));
}
-GAME( 1983, ssingles, 0, ssingles, ssingles, ssingles_state, ssingles, ROT90, "Entertainment Enterprises, Ltd.", "Swinging Singles", GAME_SUPPORTS_SAVE | GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND )
+GAME( 1983, ssingles, 0, ssingles, ssingles, ssingles_state, ssingles, ROT90, "Yachiyo Denki (Entertainment Enterprises, Ltd. license)", "Swinging Singles (US)", GAME_SUPPORTS_SAVE | GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND )
GAME( 1983, atamanot, 0, atamanot, ssingles, ssingles_state, ssingles, ROT90, "Yachiyo Denki / Uni Enterprize", "Computer Quiz Atama no Taisou (Japan)", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION )
diff --git a/src/mame/drivers/starcrus.c b/src/mame/drivers/starcrus.c
index b33dbe0df33..de3c7d087ab 100644
--- a/src/mame/drivers/starcrus.c
+++ b/src/mame/drivers/starcrus.c
@@ -22,18 +22,18 @@ static ADDRESS_MAP_START( starcrus_map, AS_PROGRAM, 8, starcrus_state )
ADDRESS_MAP_END
static ADDRESS_MAP_START( starcrus_io_map, AS_IO, 8, starcrus_state )
- AM_RANGE(0x00, 0x00) AM_READ_PORT("P1") AM_WRITE(starcrus_s1_x_w)
- AM_RANGE(0x01, 0x01) AM_READ_PORT("P2") AM_WRITE(starcrus_s1_y_w)
- AM_RANGE(0x02, 0x02) AM_READWRITE(starcrus_coll_det_r, starcrus_s2_x_w)
- AM_RANGE(0x03, 0x03) AM_READ_PORT("DSW") AM_WRITE(starcrus_s2_y_w)
- AM_RANGE(0x04, 0x04) AM_WRITE(starcrus_p1_x_w)
- AM_RANGE(0x05, 0x05) AM_WRITE(starcrus_p1_y_w)
- AM_RANGE(0x06, 0x06) AM_WRITE(starcrus_p2_x_w)
- AM_RANGE(0x07, 0x07) AM_WRITE(starcrus_p2_y_w)
- AM_RANGE(0x08, 0x08) AM_WRITE(starcrus_ship_parm_1_w)
- AM_RANGE(0x09, 0x09) AM_WRITE(starcrus_ship_parm_2_w)
- AM_RANGE(0x0a, 0x0a) AM_WRITE(starcrus_proj_parm_1_w)
- AM_RANGE(0x0b, 0x0b) AM_WRITE(starcrus_proj_parm_2_w)
+ AM_RANGE(0x00, 0x00) AM_READ_PORT("P1") AM_WRITE(s1_x_w)
+ AM_RANGE(0x01, 0x01) AM_READ_PORT("P2") AM_WRITE(s1_y_w)
+ AM_RANGE(0x02, 0x02) AM_READWRITE(coll_det_r, s2_x_w)
+ AM_RANGE(0x03, 0x03) AM_READ_PORT("DSW") AM_WRITE(s2_y_w)
+ AM_RANGE(0x04, 0x04) AM_WRITE(p1_x_w)
+ AM_RANGE(0x05, 0x05) AM_WRITE(p1_y_w)
+ AM_RANGE(0x06, 0x06) AM_WRITE(p2_x_w)
+ AM_RANGE(0x07, 0x07) AM_WRITE(p2_y_w)
+ AM_RANGE(0x08, 0x08) AM_WRITE(ship_parm_1_w)
+ AM_RANGE(0x09, 0x09) AM_WRITE(ship_parm_2_w)
+ AM_RANGE(0x0a, 0x0a) AM_WRITE(proj_parm_1_w)
+ AM_RANGE(0x0b, 0x0b) AM_WRITE(proj_parm_2_w)
ADDRESS_MAP_END
@@ -144,7 +144,7 @@ static MACHINE_CONFIG_START( starcrus, starcrus_state )
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
MCFG_SCREEN_SIZE(32*8, 32*8)
MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(starcrus_state, screen_update_starcrus)
+ MCFG_SCREEN_UPDATE_DRIVER(starcrus_state, screen_update)
MCFG_SCREEN_PALETTE("palette")
MCFG_GFXDECODE_ADD("gfxdecode", "palette", starcrus)
@@ -189,4 +189,4 @@ ROM_START( starcrus )
ROM_END
-GAME( 1977, starcrus, 0, starcrus, starcrus, driver_device, 0, ROT0, "RamTek", "Star Cruiser", GAME_IMPERFECT_SOUND )
+GAME( 1977, starcrus, 0, starcrus, starcrus, driver_device, 0, ROT0, "RamTek", "Star Cruiser", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/stfight.c b/src/mame/drivers/stfight.c
index 75467910f10..9a2d235754b 100644
--- a/src/mame/drivers/stfight.c
+++ b/src/mame/drivers/stfight.c
@@ -275,6 +275,10 @@ static ADDRESS_MAP_START( cpu1_map, AS_PROGRAM, 8, stfight_state )
AM_RANGE(0xf000, 0xffff) AM_RAM AM_SHARE("sprite_ram")
ADDRESS_MAP_END
+static ADDRESS_MAP_START( decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 8, stfight_state )
+ AM_RANGE(0x0000, 0x7fff) AM_ROM AM_SHARE("decrypted_opcodes")
+ADDRESS_MAP_END
+
static ADDRESS_MAP_START( cshooter_cpu1_map, AS_PROGRAM, 8, stfight_state )
AM_RANGE(0xc801, 0xc801) AM_WRITE(stfight_bank_w)
AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(cshooter_text_w) AM_SHARE("tx_vram")
@@ -536,6 +540,7 @@ static MACHINE_CONFIG_START( stfight, stfight_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z80, XTAL_12MHz / 4)
MCFG_CPU_PROGRAM_MAP(cpu1_map)
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", stfight_state, stfight_vb_interrupt)
MCFG_CPU_ADD("audiocpu", Z80, XTAL_12MHz / 4)
@@ -589,6 +594,7 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( cshooter, stfight )
MCFG_CPU_REPLACE("maincpu", Z80, XTAL_12MHz / 2)
MCFG_CPU_PROGRAM_MAP(cshooter_cpu1_map)
+ MCFG_DEVICE_REMOVE_ADDRESS_MAP(AS_DECRYPTED_OPCODES)
MCFG_CPU_VBLANK_INT_DRIVER("screen", stfight_state, stfight_vb_interrupt)
MCFG_CPU_REPLACE("audiocpu", Z80, XTAL_12MHz / 2)
diff --git a/src/mame/drivers/suna8.c b/src/mame/drivers/suna8.c
index 1c0c379e343..6c587027dae 100644
--- a/src/mame/drivers/suna8.c
+++ b/src/mame/drivers/suna8.c
@@ -73,15 +73,15 @@ DRIVER_INIT_MEMBER(suna8_state,hardhead)
rom[i] = BITSWAP8(rom[i], 7,6,5,3,4,2,1,0) ^ 0x58;
}
- membank("bank1")->configure_entries(0, 16, memregion("maincpu")->base() + 0x10000, 0x4000);
+ m_bank0d->set_base(memregion("maincpu")->base());
+ m_bank1->configure_entries(0, 16, memregion("maincpu")->base() + 0x10000, 0x4000);
}
/* Non encrypted bootleg */
DRIVER_INIT_MEMBER(suna8_state,hardhedb)
{
- address_space &space = m_maincpu->space(AS_PROGRAM);
- space.set_decrypted_region(0x0000, 0x7fff, memregion("maincpu")->base() + 0x48000);
- membank("bank1")->configure_entries(0, 16, memregion("maincpu")->base() + 0x10000, 0x4000);
+ m_bank0d->set_base(memregion("maincpu")->base() + 0x48000);
+ m_bank1->configure_entries(0, 16, memregion("maincpu")->base() + 0x10000, 0x4000);
}
/***************************************************************************
@@ -137,14 +137,13 @@ DRIVER_INIT_MEMBER(suna8_state, brickzn_common)
m_decrypt = brickzn_decrypt();
// Non-banked opcodes
- address_space &space = m_maincpu->space(AS_PROGRAM);
- space.set_decrypted_region(0x0000, 0x7fff, m_decrypt);
+ m_bank0d->set_base(m_decrypt);
// Data banks: 00-0f normal data decryption, 10-1f alternate data decryption:
- membank("bank1")->configure_entries(0, 16*2, memregion("maincpu")->base() + 0x10000, 0x4000);
+ m_bank1->configure_entries(0, 16*2, memregion("maincpu")->base() + 0x10000, 0x4000);
// Opcode banks: 00-1f normal opcode decryption:
- membank("bank1")->configure_decrypted_entries(0, 16, m_decrypt + 0x10000, 0x4000);
- membank("bank1")->configure_decrypted_entries(16, 16, m_decrypt + 0x10000, 0x4000);
+ m_bank1d->configure_entries(0, 16, m_decrypt + 0x10000, 0x4000);
+ m_bank1d->configure_entries(16, 16, m_decrypt + 0x10000, 0x4000);
}
DRIVER_INIT_MEMBER(suna8_state,brickzn)
@@ -203,14 +202,7 @@ DRIVER_INIT_MEMBER(suna8_state,brickznv4)
DRIVER_INIT_MEMBER(suna8_state,brickzn11)
{
- // No encryption
- UINT8 *decrypt = memregion("maincpu")->base();
-
- // Data banks: 00-0f normal data decryption, 10-1f alternate data decryption:
- membank("bank1")->configure_entries(0, 16*2, memregion("maincpu")->base() + 0x10000, 0x4000);
- // Opcode banks: 00-1f normal opcode decryption:
- membank("bank1")->configure_decrypted_entries(0, 16, decrypt + 0x10000, 0x4000);
- membank("bank1")->configure_decrypted_entries(16, 16, decrypt + 0x10000, 0x4000);
+ m_bank1->configure_entries(0, 16*2, memregion("maincpu")->base() + 0x10000, 0x4000);
}
@@ -220,14 +212,13 @@ DRIVER_INIT_MEMBER(suna8_state,brickzn11)
DRIVER_INIT_MEMBER(suna8_state,hardhea2)
{
- address_space &space = m_maincpu->space(AS_PROGRAM);
UINT8 *RAM = memregion("maincpu")->base();
size_t size = memregion("maincpu")->bytes();
UINT8 *decrypt = auto_alloc_array(machine(), UINT8, size);
UINT8 x;
int i;
- space.set_decrypted_region(0x0000, 0x7fff, decrypt);
+ m_bank0d->set_base(decrypt);
/* Address lines scrambling */
memcpy(decrypt, RAM, size);
@@ -296,7 +287,7 @@ rom13: 0?, 1y, 2n, 3n ?,?,?,? (palettes)
RAM[i] = BITSWAP8(RAM[i], 5,6,7,4,3,2,1,0) ^ 0x41;
}
- membank("bank1")->configure_entries(0, 16, memregion("maincpu")->base() + 0x10000, 0x4000);
+ m_bank1->configure_entries(0, 16, memregion("maincpu")->base() + 0x10000, 0x4000);
membank("bank2")->configure_entries(0, 2, auto_alloc_array(machine(), UINT8, 0x2000 * 2), 0x2000);
}
@@ -307,14 +298,13 @@ rom13: 0?, 1y, 2n, 3n ?,?,?,? (palettes)
DRIVER_INIT_MEMBER(suna8_state,starfigh)
{
- address_space &space = m_maincpu->space(AS_PROGRAM);
UINT8 *RAM = memregion("maincpu")->base();
size_t size = memregion("maincpu")->bytes();
UINT8 *decrypt = auto_alloc_array(machine(), UINT8, size);
UINT8 x;
int i;
- space.set_decrypted_region(0x0000, 0x7fff, decrypt);
+ m_bank0d->set_base(decrypt);
/* Address lines scrambling */
memcpy(decrypt, RAM, size);
@@ -383,7 +373,7 @@ DRIVER_INIT_MEMBER(suna8_state,starfigh)
decrypt[0x2696] = 0xc9; // work ram writes disable, corrupt next routine
decrypt[0x4e9a] = 0x00; // work ram writes disable, flip background sprite
- membank("bank1")->configure_entries(0, 16, memregion("maincpu")->base() + 0x10000, 0x4000);
+ m_bank1->configure_entries(0, 16, memregion("maincpu")->base() + 0x10000, 0x4000);
}
@@ -393,14 +383,13 @@ DRIVER_INIT_MEMBER(suna8_state,starfigh)
DRIVER_INIT_MEMBER(suna8_state,sparkman)
{
- address_space &space = m_maincpu->space(AS_PROGRAM);
UINT8 *RAM = memregion("maincpu")->base();
size_t size = memregion("maincpu")->bytes();
UINT8 *decrypt = auto_alloc_array(machine(), UINT8, size);
UINT8 x;
int i;
- space.set_decrypted_region(0x0000, 0x7fff, decrypt);
+ m_bank0d->set_base(decrypt);
/* Address lines scrambling */
memcpy(decrypt, RAM, size);
@@ -467,7 +456,7 @@ DRIVER_INIT_MEMBER(suna8_state,sparkman)
decrypt[0x1ac4] = 0x00;
decrypt[0x1ac5] = 0x00;
- membank("bank1")->configure_entries(0, 16, memregion("maincpu")->base() + 0x10000, 0x4000);
+ m_bank1->configure_entries(0, 16, memregion("maincpu")->base() + 0x10000, 0x4000);
}
/***************************************************************************
@@ -538,7 +527,7 @@ WRITE8_MEMBER(suna8_state::hardhead_bankswitch_w)
int bank = data & 0x0f;
if (data & ~0xef) logerror("CPU #0 - PC %04X: unknown bank bits: %02X\n",space.device().safe_pc(),data);
- membank("bank1")->set_entry(bank);
+ m_bank1->set_entry(bank);
}
@@ -571,7 +560,6 @@ static ADDRESS_MAP_START( hardhead_map, AS_PROGRAM, 8, suna8_state )
AM_RANGE(0xe000, 0xffff) AM_RAM_WRITE(suna8_spriteram_w) AM_SHARE("spriteram") // Sprites
ADDRESS_MAP_END
-
static ADDRESS_MAP_START( hardhead_io_map, AS_IO, 8, suna8_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x00) AM_READNOP // ? IRQ Ack
@@ -595,7 +583,7 @@ WRITE8_MEMBER(suna8_state::rranger_bankswitch_w)
if (data & ~0xf7) logerror("CPU #0 - PC %04X: unknown bank bits: %02X\n",space.device().safe_pc(),data);
- membank("bank1")->set_entry(bank);
+ m_bank1->set_entry(bank);
flip_screen_set(data & 0x20);
coin_lockout_w ( machine(), 0, data & 0x40);
@@ -694,7 +682,9 @@ WRITE8_MEMBER(suna8_state::brickzn_rombank_w)
if (data & ~0x0f) logerror("CPU #0 - PC %04X: unknown rom bank bits: %02X\n",space.device().safe_pc(),data);
- membank("bank1")->set_entry(bank + (membank("bank1")->entry() & 0x10));
+ m_bank1->set_entry(bank + (m_bank1->entry() & 0x10));
+ if(m_bank1d)
+ m_bank1d->set_entry(m_bank1->entry());
m_rombank = data;
}
@@ -812,13 +802,11 @@ WRITE8_MEMBER(suna8_state::brickzn_multi_w)
if (m_prot_opcode_toggle == 0)
{
- address_space &space = m_maincpu->space(AS_PROGRAM);
- space.set_decrypted_region(0x0000, 0x7fff, m_decrypt);
+ m_bank0d->set_base(m_decrypt);
}
else
{
- address_space &space = m_maincpu->space(AS_PROGRAM);
- space.set_decrypted_region(0x0000, 0x7fff, memregion("maincpu")->base());
+ m_bank0d->set_base(memregion("maincpu")->base());
}
}
}
@@ -838,7 +826,9 @@ WRITE8_MEMBER(suna8_state::brickzn_prot2_w)
m_remap_sound = ((m_prot2 ^ data) == 0xf8) ? 1 : 0;
// Select alternate data decryption, see code at 787e:
- membank("bank1")->set_entry((membank("bank1")->entry() & 0x0f) + ((m_prot2 == (data | 0xdc)) ? 0x10 : 0));
+ m_bank1->set_entry((m_bank1->entry() & 0x0f) + ((m_prot2 == (data | 0xdc)) ? 0x10 : 0));
+ if(m_bank1d)
+ m_bank1d->set_entry(m_bank1->entry());
m_prot2_prev = m_prot2;
m_prot2 = data;
@@ -885,6 +875,11 @@ static ADDRESS_MAP_START( brickzn_map, AS_PROGRAM, 8, suna8_state )
AM_RANGE(0xe000, 0xffff) AM_READWRITE(suna8_banked_spriteram_r, suna8_banked_spriteram_w) // Sprites (Banked)
ADDRESS_MAP_END
+static ADDRESS_MAP_START( decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 8, suna8_state )
+ AM_RANGE(0x0000, 0x7fff) AM_ROMBANK("bank0d")
+ AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1d")
+ADDRESS_MAP_END
+
static ADDRESS_MAP_START( brickzn_io_map, AS_IO, 8, suna8_state )
AM_RANGE(0x0000, 0x0000) AM_WRITE(brickzn_disab_palram_w ) // Disable Palette RAM
AM_RANGE(0x00a1, 0x00a1) AM_WRITE(brickzn_enab_palram_w ) // Enable Palette RAM
@@ -940,7 +935,7 @@ WRITE8_MEMBER(suna8_state::hardhea2_rombank_w)
if (data & ~0x0f) logerror("CPU #0 - PC %04X: unknown rom bank bits: %02X\n",space.device().safe_pc(),data);
- membank("bank1")->set_entry(bank);
+ m_bank1->set_entry(bank);
m_rombank = data;
}
@@ -1079,7 +1074,7 @@ WRITE8_MEMBER(suna8_state::starfigh_leds_w)
int bank = m_rombank_latch & 0x0f;
- membank("bank1")->set_entry(bank);
+ m_bank1->set_entry(bank);
m_rombank = m_rombank_latch;
logerror("CPU #0 - PC %04X: rom bank = %02X\n",space.device().safe_pc(), m_rombank);
@@ -1192,7 +1187,7 @@ WRITE8_MEMBER(suna8_state::sparkman_rombank_w)
int bank = m_rombank_latch & 0x0f;
- membank("bank1")->set_entry(bank);
+ m_bank1->set_entry(bank);
m_rombank = m_rombank_latch;
logerror("CPU #0 - PC %04X: rom bank = %02X\n",space.device().safe_pc(), m_rombank);
@@ -1868,6 +1863,7 @@ static MACHINE_CONFIG_START( hardhead, suna8_state )
MCFG_CPU_ADD("maincpu", Z80, SUNA8_MASTER_CLOCK / 4) /* verified on pcb */
MCFG_CPU_PROGRAM_MAP(hardhead_map)
MCFG_CPU_IO_MAP(hardhead_io_map)
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", suna8_state, irq0_line_hold) /* No NMI */
MCFG_CPU_ADD("audiocpu", Z80, SUNA8_MASTER_CLOCK / 8) /* verified on pcb */
@@ -1892,23 +1888,20 @@ static MACHINE_CONFIG_START( hardhead, suna8_state )
MCFG_VIDEO_START_OVERRIDE(suna8_state,suna8_textdim12)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("ymsnd", YM3812, SUNA8_MASTER_CLOCK / 8) /* verified on pcb */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MCFG_SOUND_ADD("aysnd", AY8910, SUNA8_MASTER_CLOCK / 16) /* verified on pcb */
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(suna8_state, suna8_play_samples_w))
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(suna8_state, suna8_samples_number_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.30)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.30)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
MCFG_SOUND_ADD("samples", SAMPLES, 0)
MCFG_SAMPLES_CHANNELS(1)
MCFG_SAMPLES_START_CB(suna8_state, sh_start)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
MACHINE_CONFIG_END
@@ -1925,6 +1918,7 @@ static MACHINE_CONFIG_START( rranger, suna8_state )
MCFG_CPU_ADD("maincpu", Z80, SUNA8_MASTER_CLOCK / 4) /* ? */
MCFG_CPU_PROGRAM_MAP(rranger_map)
MCFG_CPU_IO_MAP(rranger_io_map)
+// MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", suna8_state, irq0_line_hold) /* IRQ & NMI ! */
MCFG_CPU_ADD("audiocpu", Z80, SUNA8_MASTER_CLOCK / 8) /* verified on pcb */
@@ -1948,23 +1942,20 @@ static MACHINE_CONFIG_START( rranger, suna8_state )
MCFG_VIDEO_START_OVERRIDE(suna8_state,suna8_textdim8)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("ym1", YM2203, SUNA8_MASTER_CLOCK / 16) /* verified on pcb */
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(suna8_state, rranger_play_samples_w))
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(suna8_state, suna8_samples_number_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.90)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.90)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90)
MCFG_SOUND_ADD("ym2", YM2203, SUNA8_MASTER_CLOCK / 16) /* verified on pcb */
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.90)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.90)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90)
MCFG_SOUND_ADD("samples", SAMPLES, 0)
MCFG_SAMPLES_CHANNELS(1)
MCFG_SAMPLES_START_CB(suna8_state, sh_start)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
MACHINE_CONFIG_END
@@ -1979,7 +1970,9 @@ MACHINE_RESET_MEMBER(suna8_state,brickzn)
m_protection_val = m_prot2 = m_prot2_prev = 0xff;
m_paletteram_enab = 1; // for brickzn11
m_remap_sound = 0;
- membank("bank1")->set_entry(0);
+ m_bank1->set_entry(0);
+ if(m_bank1d)
+ m_bank1d->set_entry(0);
}
static MACHINE_CONFIG_START( brickzn11, suna8_state )
@@ -2015,34 +2008,33 @@ static MACHINE_CONFIG_START( brickzn11, suna8_state )
MCFG_VIDEO_START_OVERRIDE(suna8_state,suna8_brickzn)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("ymsnd", YM3812, SUNA8_MASTER_CLOCK / 8) // 3MHz (measured)
MCFG_YM3812_IRQ_HANDLER(INPUTLINE("audiocpu", 0))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MCFG_SOUND_ADD("aysnd", AY8910, SUNA8_MASTER_CLOCK / 16) // 1.5MHz (measured)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.33)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.33)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33)
MCFG_DAC_ADD("dac1")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.17)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.17)
MCFG_DAC_ADD("dac2")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.17)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.17)
MCFG_DAC_ADD("dac3")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.17)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.17)
MCFG_DAC_ADD("dac4")
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.17)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.17)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( brickzn, brickzn11 )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(brickzn_map)
MCFG_CPU_IO_MAP(brickzn_io_map)
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
MACHINE_CONFIG_END
@@ -2073,6 +2065,7 @@ static MACHINE_CONFIG_DERIVED( hardhea2, brickzn )
MCFG_CPU_ADD("maincpu", Z80, SUNA8_MASTER_CLOCK / 4) /* SUNA T568009 */
MCFG_CPU_PROGRAM_MAP(hardhea2_map)
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", suna8_state, hardhea2_interrupt, "screen", 0, 1)
MCFG_MACHINE_RESET_OVERRIDE(suna8_state,hardhea2)
@@ -2092,6 +2085,7 @@ static MACHINE_CONFIG_START( starfigh, suna8_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z80, SUNA8_MASTER_CLOCK / 4) /* ? */
MCFG_CPU_PROGRAM_MAP(starfigh_map)
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", suna8_state, hardhea2_interrupt, "screen", 0, 1)
/* The sound section is identical to that of hardhead */
@@ -2117,23 +2111,20 @@ static MACHINE_CONFIG_START( starfigh, suna8_state )
MCFG_VIDEO_START_OVERRIDE(suna8_state,suna8_starfigh)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("ymsnd", YM3812, SUNA8_MASTER_CLOCK / 6)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
+ MCFG_SOUND_ADD("ymsnd", YM3812, SUNA8_MASTER_CLOCK / 8)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MCFG_SOUND_ADD("aysnd", AY8910, SUNA8_MASTER_CLOCK / 16)
MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(suna8_state, suna8_play_samples_w))
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(suna8_state, suna8_samples_number_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
MCFG_SOUND_ADD("samples", SAMPLES, 0)
MCFG_SAMPLES_CHANNELS(1)
MCFG_SAMPLES_START_CB(suna8_state, sh_start)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
MACHINE_CONFIG_END
@@ -2146,6 +2137,7 @@ static MACHINE_CONFIG_START( sparkman, suna8_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z80, SUNA8_MASTER_CLOCK / 4) /* ? */
MCFG_CPU_PROGRAM_MAP(sparkman_map)
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", suna8_state, hardhea2_interrupt, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80, SUNA8_MASTER_CLOCK / 4) /* ? */
@@ -2170,23 +2162,20 @@ static MACHINE_CONFIG_START( sparkman, suna8_state )
MCFG_VIDEO_START_OVERRIDE(suna8_state,suna8_sparkman)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
+ MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("ymsnd", YM3812, SUNA8_MASTER_CLOCK / 6)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
+ MCFG_SOUND_ADD("ymsnd", YM3812, SUNA8_MASTER_CLOCK / 8)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MCFG_SOUND_ADD("aysnd", AY8910, SUNA8_MASTER_CLOCK / 16)
- MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(suna8_state, suna8_play_samples_w))
+ MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(suna8_state, suna8_play_samples_w)) // two sample roms
MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(suna8_state, suna8_samples_number_w))
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.30)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.30)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
MCFG_SOUND_ADD("samples", SAMPLES, 0)
MCFG_SAMPLES_CHANNELS(1)
MCFG_SAMPLES_START_CB(suna8_state, sh_start)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
MACHINE_CONFIG_END
@@ -2232,6 +2221,9 @@ Sound processor - Z80
***************************************************************************/
+// The sample rom is from srange with 1 byte changed (first byte is FF here, instead of 77)
+// (laugh sound used when scoring a goal at the end of level 1)
+
ROM_START( hardhead )
ROM_REGION( 0x48000, "maincpu", 0 ) /* Main Z80 Code */
ROM_LOAD( "p1", 0x00000, 0x8000, CRC(c6147926) SHA1(8d1609aaeac344c6aec102e92d34caab22a8ec64) ) // 1988,9,14
@@ -2926,7 +2918,7 @@ ROM_END
DRIVER_INIT_MEMBER(suna8_state,suna8)
{
- membank("bank1")->configure_entries(0, 16, memregion("maincpu")->base() + 0x10000, 0x4000);
+ m_bank1->configure_entries(0, 16, memregion("maincpu")->base() + 0x10000, 0x4000);
}
GAME( 1988, sranger, 0, rranger, rranger, suna8_state, suna8, ROT0, "SunA", "Super Ranger (v2.0)", 0 )
diff --git a/src/mame/drivers/superchs.c b/src/mame/drivers/superchs.c
index 129dd90d7de..f19beb885cd 100644
--- a/src/mame/drivers/superchs.c
+++ b/src/mame/drivers/superchs.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Bryan McPhail, David Graves
/****************************************************************************
diff --git a/src/mame/drivers/suprloco.c b/src/mame/drivers/suprloco.c
index 587fdb4e004..7ac0c12c437 100644
--- a/src/mame/drivers/suprloco.c
+++ b/src/mame/drivers/suprloco.c
@@ -36,8 +36,7 @@ WRITE8_MEMBER(suprloco_state::soundport_w)
}
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, suprloco_state )
- AM_RANGE(0x0000, 0x7fff) AM_ROM
- AM_RANGE(0x8000, 0xbfff) AM_ROM
+ AM_RANGE(0x0000, 0xbfff) AM_ROM
AM_RANGE(0xc000, 0xc1ff) AM_RAM AM_SHARE("spriteram")
AM_RANGE(0xc800, 0xc800) AM_READ_PORT("SYSTEM")
AM_RANGE(0xd000, 0xd000) AM_READ_PORT("P1")
@@ -52,6 +51,11 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, suprloco_state )
AM_RANGE(0xf800, 0xffff) AM_RAM
ADDRESS_MAP_END
+static ADDRESS_MAP_START( decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 8, suprloco_state )
+ AM_RANGE(0x0000, 0x7fff) AM_ROM AM_SHARE("decrypted_opcodes")
+ AM_RANGE(0x8000, 0xbfff) AM_ROM AM_REGION("maincpu", 0x8000)
+ADDRESS_MAP_END
+
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, suprloco_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0x8000, 0x87ff) AM_RAM
@@ -165,6 +169,7 @@ static MACHINE_CONFIG_START( suprloco, suprloco_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z80, 4000000) /* 4 MHz (?) */
MCFG_CPU_PROGRAM_MAP(main_map)
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", suprloco_state, irq0_line_hold)
MCFG_CPU_ADD("audiocpu", Z80, 4000000)
@@ -202,7 +207,7 @@ MACHINE_CONFIG_END
***************************************************************************/
ROM_START( suprloco )
- ROM_REGION( 2*0x10000, "maincpu", 0 ) /* 64k for code + 64k for decrypted opcodes */
+ ROM_REGION( 0xc000, "maincpu", 0 )
ROM_LOAD( "epr-5226a.37", 0x0000, 0x4000, CRC(33b02368) SHA1(c6e3116ad4b52bcc3174de5770f7a7ce024790d5) ) /* encrypted */
ROM_LOAD( "epr-5227a.15", 0x4000, 0x4000, CRC(a5e67f50) SHA1(1dd52e4cf00ce414fe1db8259c9976cdc23513b4) ) /* encrypted */
ROM_LOAD( "epr-5228.28", 0x8000, 0x4000, CRC(a597828a) SHA1(61004d112591fd2d752c39df71c1304d9308daae) )
@@ -231,7 +236,7 @@ ROM_START( suprloco )
ROM_END
ROM_START( suprlocoo )
- ROM_REGION( 2*0x10000, "maincpu", 0 ) /* 64k for code + 64k for decrypted opcodes */
+ ROM_REGION( 0xc000, "maincpu", 0 )
ROM_LOAD( "epr-5226.37", 0x0000, 0x4000, CRC(57f514dd) SHA1(707800b90a22547a56b01d1e11775e9ee5555d23) ) /* encrypted */
ROM_LOAD( "epr-5227.15", 0x4000, 0x4000, CRC(5a1d2fb0) SHA1(fdb9416e5530718245fd597073a63feddb233c3c) ) /* encrypted */
ROM_LOAD( "epr-5228.28", 0x8000, 0x4000, CRC(a597828a) SHA1(61004d112591fd2d752c39df71c1304d9308daae) )
@@ -292,9 +297,30 @@ DRIVER_INIT_MEMBER(suprloco_state,suprloco)
}
}
+ static const UINT8 convtable[32][4] =
+ {
+ /* opcode data address */
+ /* A B C D A B C D */
+ { 0x20,0x00,0xa0,0x80 }, { 0xa8,0xa0,0x88,0x80 }, /* ...0...0...0...0 */
+ { 0x20,0x00,0xa0,0x80 }, { 0xa8,0xa0,0x88,0x80 }, /* ...0...0...0...1 */
+ { 0x20,0x00,0xa0,0x80 }, { 0xa8,0xa0,0x88,0x80 }, /* ...0...0...1...0 */
+ { 0x88,0x08,0x80,0x00 }, { 0xa0,0x80,0xa8,0x88 }, /* ...0...0...1...1 */
+ { 0x88,0x08,0x80,0x00 }, { 0xa0,0x80,0xa8,0x88 }, /* ...0...1...0...0 */
+ { 0x20,0x00,0xa0,0x80 }, { 0xa8,0xa0,0x88,0x80 }, /* ...0...1...0...1 */
+ { 0x88,0x08,0x80,0x00 }, { 0xa0,0x80,0xa8,0x88 }, /* ...0...1...1...0 */
+ { 0x28,0xa8,0x08,0x88 }, { 0x88,0x80,0x08,0x00 }, /* ...0...1...1...1 */
+ { 0x20,0x00,0xa0,0x80 }, { 0xa8,0xa0,0x88,0x80 }, /* ...1...0...0...0 */
+ { 0x88,0x08,0x80,0x00 }, { 0xa0,0x80,0xa8,0x88 }, /* ...1...0...0...1 */
+ { 0x88,0x08,0x80,0x00 }, { 0xa0,0x80,0xa8,0x88 }, /* ...1...0...1...0 */
+ { 0x20,0x00,0xa0,0x80 }, { 0xa8,0xa0,0x88,0x80 }, /* ...1...0...1...1 */
+ { 0x88,0x08,0x80,0x00 }, { 0xa0,0x80,0xa8,0x88 }, /* ...1...1...0...0 */
+ { 0x28,0xa8,0x08,0x88 }, { 0x88,0x80,0x08,0x00 }, /* ...1...1...0...1 */
+ { 0x20,0x00,0xa0,0x80 }, { 0xa8,0xa0,0x88,0x80 }, /* ...1...1...1...0 */
+ { 0x88,0x08,0x80,0x00 }, { 0xa0,0x80,0xa8,0x88 } /* ...1...1...1...1 */
+ };
/* decrypt program ROMs */
- suprloco_decode(machine(), "maincpu");
+ sega_decode(memregion("maincpu")->base(), m_decrypted_opcodes, 0x8000, convtable);
}
diff --git a/src/mame/drivers/system1.c b/src/mame/drivers/system1.c
index e21fa0d4987..6cbaa042973 100644
--- a/src/mame/drivers/system1.c
+++ b/src/mame/drivers/system1.c
@@ -358,13 +358,20 @@ static const UINT8 cc_ex[0x100] = {
void system1_state::machine_start()
{
- UINT32 numbanks = (memregion("maincpu")->bytes() - 0x10000) / 0x4000;
+ UINT32 numbanks = (m_maincpu_region->bytes() - 0x10000) / 0x4000;
if (numbanks > 0)
- membank("bank1")->configure_entries(0, numbanks, memregion("maincpu")->base() + 0x10000, 0x4000);
+ m_bank1->configure_entries(0, numbanks, m_maincpu_region->base() + 0x10000, 0x4000);
else
- membank("bank1")->configure_entry(0, memregion("maincpu")->base() + 0x8000);
- membank("bank1")->set_entry(0);
+ m_bank1->configure_entry(0, m_maincpu_region->base() + 0x8000);
+ m_bank1->set_entry(0);
+
+ if (m_banked_decrypted_opcodes)
+ {
+ m_bank0d->set_base(m_banked_decrypted_opcodes);
+ m_bank1d->configure_entries(0, numbanks, m_banked_decrypted_opcodes + 0x10000, 0x4000);
+ m_bank1d->set_entry(0);
+ }
m_maincpu->z80_set_cycle_tables(cc_op, cc_cb, cc_ed, cc_xy, cc_xycb, cc_ex);
@@ -400,14 +407,16 @@ void system1_state::machine_reset()
void system1_state::bank44_custom_w(UINT8 data, UINT8 prevdata)
{
/* bank bits are bits 6 and 2 */
- membank("bank1")->set_entry(((data & 0x40) >> 5) | ((data & 0x04) >> 2));
+ m_bank1->set_entry(((data & 0x40) >> 5) | ((data & 0x04) >> 2));
}
void system1_state::bank0c_custom_w(UINT8 data, UINT8 prevdata)
{
/* bank bits are bits 3 and 2 */
- membank("bank1")->set_entry((data & 0x0c) >> 2);
+ m_bank1->set_entry((data & 0x0c) >> 2);
+ if(m_bank1d)
+ m_bank1d->set_entry((data & 0x0c) >> 2);
}
@@ -592,7 +601,7 @@ READ8_MEMBER(system1_state::mcu_io_r)
return m_maincpu->space(AS_PROGRAM).read_byte(offset);
case 1:
- return memregion("maincpu")->base()[offset + 0x10000];
+ return m_maincpu_region->base()[offset + 0x10000];
case 2:
return m_maincpu->space(AS_IO).read_byte(offset);
@@ -733,6 +742,22 @@ static ADDRESS_MAP_START( system1_map, AS_PROGRAM, 8, system1_state )
AM_RANGE(0xfc00, 0xffff) AM_WRITE(system1_sprite_collision_reset_w)
ADDRESS_MAP_END
+static ADDRESS_MAP_START( decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 8, system1_state )
+ AM_RANGE(0x0000, 0x7fff) AM_ROM AM_SHARE("decrypted_opcodes")
+ AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1")
+ AM_RANGE(0xc000, 0xcfff) AM_RAM AM_SHARE("ram")
+ AM_RANGE(0xd000, 0xd7ff) AM_RAM AM_SHARE("spriteram")
+ AM_RANGE(0xd800, 0xdfff) AM_RAM_WRITE(system1_paletteram_w) AM_SHARE("paletteram")
+ADDRESS_MAP_END
+
+static ADDRESS_MAP_START( banked_decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 8, system1_state )
+ AM_RANGE(0x0000, 0x7fff) AM_ROMBANK("bank0d")
+ AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1d")
+ AM_RANGE(0xc000, 0xcfff) AM_RAM AM_SHARE("ram")
+ AM_RANGE(0xd000, 0xd7ff) AM_RAM AM_SHARE("spriteram")
+ AM_RANGE(0xd800, 0xdfff) AM_RAM_WRITE(system1_paletteram_w) AM_SHARE("paletteram")
+ADDRESS_MAP_END
+
/* same as normal System 1 except address map is shuffled (RAM/collision are swapped) */
static ADDRESS_MAP_START( nobo_map, AS_PROGRAM, 8, system1_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM
@@ -2146,6 +2171,12 @@ static MACHINE_CONFIG_START( sys1ppi, system1_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
MACHINE_CONFIG_END
+static MACHINE_CONFIG_DERIVED( sys1ppix, sys1ppi )
+ MCFG_DEVICE_MODIFY("maincpu")
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
+MACHINE_CONFIG_END
+
+
/* reduced visible area for scrolling games */
static MACHINE_CONFIG_DERIVED( sys1ppis, sys1ppi )
@@ -2154,6 +2185,10 @@ static MACHINE_CONFIG_DERIVED( sys1ppis, sys1ppi )
MCFG_SCREEN_VISIBLE_AREA(2*(0*8+8), 2*(32*8-1-8), 0*8, 28*8-1)
MACHINE_CONFIG_END
+static MACHINE_CONFIG_DERIVED( sys1ppisx, sys1ppis )
+ MCFG_DEVICE_MODIFY("maincpu")
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
+MACHINE_CONFIG_END
/* revised board with 128kbit ROMs and a Z80 PIO for outputs */
@@ -2169,6 +2204,11 @@ static MACHINE_CONFIG_DERIVED( sys1pio, sys1ppi )
MCFG_Z80PIO_OUT_PB_CB(WRITE8(system1_state, videomode_w))
MACHINE_CONFIG_END
+static MACHINE_CONFIG_DERIVED( sys1piox, sys1pio )
+ MCFG_DEVICE_MODIFY("maincpu")
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
+MACHINE_CONFIG_END
+
/* reduced visible area for scrolling games */
static MACHINE_CONFIG_DERIVED( sys1pios, sys1pio )
@@ -2177,6 +2217,10 @@ static MACHINE_CONFIG_DERIVED( sys1pios, sys1pio )
MCFG_SCREEN_VISIBLE_AREA(2*(0*8+8), 2*(32*8-1-8), 0*8, 28*8-1)
MACHINE_CONFIG_END
+static MACHINE_CONFIG_DERIVED( sys1piosx, sys1pios )
+ MCFG_DEVICE_MODIFY("maincpu")
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
+MACHINE_CONFIG_END
/* this describes the additional 8751 MCU when present */
@@ -2223,6 +2267,16 @@ static MACHINE_CONFIG_DERIVED( sys2, sys1ppi )
MCFG_SCREEN_UPDATE_DRIVER(system1_state, screen_update_system2)
MACHINE_CONFIG_END
+static MACHINE_CONFIG_DERIVED( sys2x, sys2 )
+ MCFG_DEVICE_MODIFY("maincpu")
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
+MACHINE_CONFIG_END
+
+static MACHINE_CONFIG_DERIVED( sys2xb, sys2 )
+ MCFG_DEVICE_MODIFY("maincpu")
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(banked_decrypted_opcodes_map)
+MACHINE_CONFIG_END
+
static MACHINE_CONFIG_DERIVED( sys2m, sys2 )
MCFG_FRAGMENT_ADD( mcu )
MACHINE_CONFIG_END
@@ -2235,6 +2289,11 @@ static MACHINE_CONFIG_DERIVED( sys2row, sys2 )
MCFG_SCREEN_UPDATE_DRIVER(system1_state, screen_update_system2_rowscroll)
MACHINE_CONFIG_END
+static MACHINE_CONFIG_DERIVED( sys2rowxb, sys2row )
+ MCFG_DEVICE_MODIFY("maincpu")
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(banked_decrypted_opcodes_map)
+MACHINE_CONFIG_END
+
static MACHINE_CONFIG_DERIVED( sys2rowm, sys2row )
MCFG_FRAGMENT_ADD( mcu )
MACHINE_CONFIG_END
@@ -4688,55 +4747,704 @@ ROM_END
DRIVER_INIT_MEMBER(system1_state,bank00)
{
m_videomode_custom = NULL;
+ m_banked_decrypted_opcodes = NULL;
}
+
DRIVER_INIT_MEMBER(system1_state,bank44)
{
m_videomode_custom = &system1_state::bank44_custom_w;
+ m_banked_decrypted_opcodes = NULL;
}
DRIVER_INIT_MEMBER(system1_state,bank0c)
{
m_videomode_custom = &system1_state::bank0c_custom_w;
+ m_banked_decrypted_opcodes = NULL;
+}
+
+DRIVER_INIT_MEMBER(system1_state,regulus)
+{
+ static const UINT8 convtable[32][4] =
+ {
+ /* opcode data address */
+ /* A B C D A B C D */
+ { 0x28,0x08,0xa8,0x88 }, { 0x88,0x80,0x08,0x00 }, /* ...0...0...0...0 */
+ { 0x28,0x08,0xa8,0x88 }, { 0x28,0xa8,0x08,0x88 }, /* ...0...0...0...1 */
+ { 0x88,0x80,0x08,0x00 }, { 0x88,0x08,0x80,0x00 }, /* ...0...0...1...0 */
+ { 0x88,0x08,0x80,0x00 }, { 0x28,0xa8,0x08,0x88 }, /* ...0...0...1...1 */
+ { 0x28,0x08,0xa8,0x88 }, { 0x88,0x80,0x08,0x00 }, /* ...0...1...0...0 */
+ { 0x88,0x80,0x08,0x00 }, { 0x88,0x80,0x08,0x00 }, /* ...0...1...0...1 */
+ { 0x88,0x08,0x80,0x00 }, { 0x88,0x08,0x80,0x00 }, /* ...0...1...1...0 */
+ { 0xa0,0x80,0xa8,0x88 }, { 0xa0,0x80,0xa8,0x88 }, /* ...0...1...1...1 */
+ { 0x80,0xa0,0x00,0x20 }, { 0x28,0x08,0xa8,0x88 }, /* ...1...0...0...0 */
+ { 0x28,0xa8,0x08,0x88 }, { 0x28,0x08,0xa8,0x88 }, /* ...1...0...0...1 */
+ { 0x80,0xa0,0x00,0x20 }, { 0x80,0xa0,0x00,0x20 }, /* ...1...0...1...0 */
+ { 0x28,0xa8,0x08,0x88 }, { 0x80,0xa0,0x00,0x20 }, /* ...1...0...1...1 */
+ { 0xa0,0x80,0xa8,0x88 }, { 0x28,0x08,0xa8,0x88 }, /* ...1...1...0...0 */
+ { 0x80,0xa0,0x00,0x20 }, { 0xa0,0x80,0xa8,0x88 }, /* ...1...1...0...1 */
+ { 0xa0,0x80,0xa8,0x88 }, { 0x80,0xa0,0x00,0x20 }, /* ...1...1...1...0 */
+ { 0xa0,0x80,0xa8,0x88 }, { 0xa0,0x80,0xa8,0x88 } /* ...1...1...1...1 */
+ };
+
+ DRIVER_INIT_CALL(bank00);
+ sega_decode(m_maincpu_region->base(), m_decrypted_opcodes, 0x8000, convtable);
+}
+
+DRIVER_INIT_MEMBER(system1_state,mrviking)
+{
+ static const UINT8 convtable[32][4] =
+ {
+ /* opcode data address */
+ /* A B C D A B C D */
+ { 0x28,0xa8,0x08,0x88 }, { 0x88,0x80,0x08,0x00 }, /* ...0...0...0...0 */
+ { 0x88,0x08,0x80,0x00 }, { 0x88,0x80,0x08,0x00 }, /* ...0...0...0...1 */
+ { 0x28,0x08,0xa8,0x88 }, { 0x28,0xa8,0x08,0x88 }, /* ...0...0...1...0 */
+ { 0x88,0x08,0x80,0x00 }, { 0x88,0x08,0x80,0x00 }, /* ...0...0...1...1 */
+ { 0x28,0x08,0xa8,0x88 }, { 0x88,0x80,0x08,0x00 }, /* ...0...1...0...0 */
+ { 0x88,0x80,0x08,0x00 }, { 0x28,0xa8,0x08,0x88 }, /* ...0...1...0...1 */
+ { 0xa0,0x80,0xa8,0x88 }, { 0x28,0x08,0xa8,0x88 }, /* ...0...1...1...0 */
+ { 0xa0,0x80,0xa8,0x88 }, { 0xa0,0x80,0xa8,0x88 }, /* ...0...1...1...1 */
+ { 0x88,0x80,0x08,0x00 }, { 0x88,0x80,0x08,0x00 }, /* ...1...0...0...0 */
+ { 0x88,0x08,0x80,0x00 }, { 0x88,0x80,0x08,0x00 }, /* ...1...0...0...1 */
+ { 0xa0,0x80,0x20,0x00 }, { 0x28,0x08,0xa8,0x88 }, /* ...1...0...1...0 */
+ { 0xa0,0x80,0x20,0x00 }, { 0x88,0x08,0x80,0x00 }, /* ...1...0...1...1 */
+ { 0x28,0x08,0xa8,0x88 }, { 0xa0,0x80,0x20,0x00 }, /* ...1...1...0...0 */
+ { 0xa0,0x80,0x20,0x00 }, { 0xa0,0x80,0x20,0x00 }, /* ...1...1...0...1 */
+ { 0xa0,0x80,0xa8,0x88 }, { 0x28,0x08,0xa8,0x88 }, /* ...1...1...1...0 */
+ { 0xa0,0x80,0x20,0x00 }, { 0xa0,0x80,0xa8,0x88 } /* ...1...1...1...1 */
+ };
+
+ DRIVER_INIT_CALL(bank00);
+ sega_decode(m_maincpu_region->base(), m_decrypted_opcodes, 0x8000, convtable);
+}
+
+DRIVER_INIT_MEMBER(system1_state,swat)
+{
+ static const UINT8 convtable[32][4] =
+ {
+ /* opcode data address */
+ /* A B C D A B C D */
+ { 0x88,0x08,0x80,0x00 }, { 0xa0,0xa8,0x80,0x88 }, /* ...0...0...0...0 */
+ { 0x88,0x08,0x80,0x00 }, { 0x88,0xa8,0x80,0xa0 }, /* ...0...0...0...1 */
+ { 0xa0,0x80,0x20,0x00 }, { 0x88,0x08,0x80,0x00 }, /* ...0...0...1...0 */
+ { 0xa0,0xa8,0x80,0x88 }, { 0x88,0x08,0x80,0x00 }, /* ...0...0...1...1 */
+ { 0x28,0x20,0xa8,0xa0 }, { 0xa0,0xa8,0x80,0x88 }, /* ...0...1...0...0 */
+ { 0x88,0xa8,0x80,0xa0 }, { 0x28,0x20,0xa8,0xa0 }, /* ...0...1...0...1 */
+ { 0xa0,0x80,0x20,0x00 }, { 0xa0,0xa8,0x80,0x88 }, /* ...0...1...1...0 */
+ { 0x28,0x20,0xa8,0xa0 }, { 0xa0,0xa8,0x80,0x88 }, /* ...0...1...1...1 */
+ { 0xa0,0x80,0x20,0x00 }, { 0xa0,0x80,0x20,0x00 }, /* ...1...0...0...0 */
+ { 0xa0,0x20,0x80,0x00 }, { 0x88,0xa8,0x80,0xa0 }, /* ...1...0...0...1 */
+ { 0xa0,0x20,0x80,0x00 }, { 0xa0,0x20,0x80,0x00 }, /* ...1...0...1...0 */
+ { 0xa0,0x20,0x80,0x00 }, { 0xa0,0x20,0x80,0x00 }, /* ...1...0...1...1 */
+ { 0xa0,0x80,0x20,0x00 }, { 0xa0,0x80,0x20,0x00 }, /* ...1...1...0...0 */
+ { 0x88,0xa8,0x80,0xa0 }, { 0x28,0x20,0xa8,0xa0 }, /* ...1...1...0...1 */
+ { 0xa0,0xa8,0x80,0x88 }, { 0xa0,0x80,0x20,0x00 }, /* ...1...1...1...0 */
+ { 0x28,0x20,0xa8,0xa0 }, { 0xa0,0xa8,0x80,0x88 } /* ...1...1...1...1 */
+ };
+
+ DRIVER_INIT_CALL(bank00);
+ sega_decode(m_maincpu_region->base(), m_decrypted_opcodes, 0x8000, convtable);
+}
+
+DRIVER_INIT_MEMBER(system1_state,flicky)
+{
+ static const UINT8 convtable[32][4] =
+ {
+ /* opcode data address */
+ /* A B C D A B C D */
+ { 0x08,0x88,0x00,0x80 }, { 0xa0,0x80,0xa8,0x88 }, /* ...0...0...0...0 */
+ { 0x80,0x00,0xa0,0x20 }, { 0x88,0x80,0x08,0x00 }, /* ...0...0...0...1 */
+ { 0xa0,0x80,0xa8,0x88 }, { 0x28,0x08,0x20,0x00 }, /* ...0...0...1...0 */
+ { 0x28,0x08,0x20,0x00 }, { 0xa0,0x80,0xa8,0x88 }, /* ...0...0...1...1 */
+ { 0x08,0x88,0x00,0x80 }, { 0x80,0x00,0xa0,0x20 }, /* ...0...1...0...0 */
+ { 0x80,0x00,0xa0,0x20 }, { 0x88,0x80,0x08,0x00 }, /* ...0...1...0...1 */
+ { 0x28,0x08,0x20,0x00 }, { 0x28,0x08,0x20,0x00 }, /* ...0...1...1...0 */
+ { 0x28,0x08,0x20,0x00 }, { 0x88,0x80,0x08,0x00 }, /* ...0...1...1...1 */
+ { 0x08,0x88,0x00,0x80 }, { 0xa8,0x88,0x28,0x08 }, /* ...1...0...0...0 */
+ { 0xa8,0x88,0x28,0x08 }, { 0x80,0x00,0xa0,0x20 }, /* ...1...0...0...1 */
+ { 0x28,0x08,0x20,0x00 }, { 0x88,0x80,0x08,0x00 }, /* ...1...0...1...0 */
+ { 0xa8,0x88,0x28,0x08 }, { 0x88,0x80,0x08,0x00 }, /* ...1...0...1...1 */
+ { 0x08,0x88,0x00,0x80 }, { 0x80,0x00,0xa0,0x20 }, /* ...1...1...0...0 */
+ { 0xa8,0x88,0x28,0x08 }, { 0x80,0x00,0xa0,0x20 }, /* ...1...1...0...1 */
+ { 0x28,0x08,0x20,0x00 }, { 0x28,0x08,0x20,0x00 }, /* ...1...1...1...0 */
+ { 0x08,0x88,0x00,0x80 }, { 0x88,0x80,0x08,0x00 } /* ...1...1...1...1 */
+ };
+
+ DRIVER_INIT_CALL(bank00);
+ sega_decode(m_maincpu_region->base(), m_decrypted_opcodes, 0x8000, convtable);
+}
+
+DRIVER_INIT_MEMBER(system1_state,wmatch)
+{
+ static const UINT8 convtable[32][4] =
+ {
+ /* opcode data address */
+ /* A B C D A B C D */
+ { 0x88,0xa8,0x80,0xa0 }, { 0xa0,0x80,0x20,0x00 }, /* ...0...0...0...0 */
+ { 0x08,0x88,0x00,0x80 }, { 0x88,0xa8,0x80,0xa0 }, /* ...0...0...0...1 */
+ { 0x20,0x00,0xa0,0x80 }, { 0x20,0x28,0xa0,0xa8 }, /* ...0...0...1...0 */
+ { 0x20,0x28,0xa0,0xa8 }, { 0xa0,0x80,0x20,0x00 }, /* ...0...0...1...1 */
+ { 0xa8,0x28,0x88,0x08 }, { 0xa8,0x28,0x88,0x08 }, /* ...0...1...0...0 */
+ { 0x08,0x88,0x00,0x80 }, { 0xa8,0x28,0x88,0x08 }, /* ...0...1...0...1 */
+ { 0xa8,0x28,0x88,0x08 }, { 0x20,0x28,0xa0,0xa8 }, /* ...0...1...1...0 */
+ { 0xa8,0x28,0x88,0x08 }, { 0xa8,0x28,0x88,0x08 }, /* ...0...1...1...1 */
+ { 0x20,0x28,0xa0,0xa8 }, { 0x88,0xa8,0x80,0xa0 }, /* ...1...0...0...0 */
+ { 0x88,0xa8,0x80,0xa0 }, { 0x20,0x28,0xa0,0xa8 }, /* ...1...0...0...1 */
+ { 0x20,0x28,0xa0,0xa8 }, { 0xa0,0x80,0x20,0x00 }, /* ...1...0...1...0 */
+ { 0x20,0x28,0xa0,0xa8 }, { 0x20,0x28,0xa0,0xa8 }, /* ...1...0...1...1 */
+ { 0x20,0x00,0xa0,0x80 }, { 0x20,0x28,0xa0,0xa8 }, /* ...1...1...0...0 */
+ { 0xa8,0x28,0x88,0x08 }, { 0xa0,0x80,0x20,0x00 }, /* ...1...1...0...1 */
+ { 0x20,0x28,0xa0,0xa8 }, { 0x20,0x28,0xa0,0xa8 }, /* ...1...1...1...0 */
+ { 0xa8,0x28,0x88,0x08 }, { 0xa8,0x28,0x88,0x08 } /* ...1...1...1...1 */
+ };
+
+ DRIVER_INIT_CALL(bank00);
+ sega_decode(m_maincpu_region->base(), m_decrypted_opcodes, 0x8000, convtable);
+}
+
+DRIVER_INIT_MEMBER(system1_state,bullfgtj)
+{
+ static const UINT8 convtable[32][4] =
+ {
+ /* opcode data address */
+ /* A B C D A B C D */
+ { 0xa0,0xa8,0x20,0x28 }, { 0x80,0xa0,0x00,0x20 }, /* ...0...0...0...0 */
+ { 0x20,0x28,0x00,0x08 }, { 0x20,0x28,0x00,0x08 }, /* ...0...0...0...1 */
+ { 0xa0,0xa8,0x20,0x28 }, { 0x08,0x28,0x00,0x20 }, /* ...0...0...1...0 */
+ { 0x88,0x08,0xa8,0x28 }, { 0x88,0x08,0xa8,0x28 }, /* ...0...0...1...1 */
+ { 0xa0,0xa8,0x20,0x28 }, { 0x20,0x28,0x00,0x08 }, /* ...0...1...0...0 */
+ { 0x28,0xa8,0x20,0xa0 }, { 0x20,0x28,0x00,0x08 }, /* ...0...1...0...1 */
+ { 0xa0,0xa8,0x20,0x28 }, { 0x08,0x28,0x00,0x20 }, /* ...0...1...1...0 */
+ { 0x88,0x08,0xa8,0x28 }, { 0x88,0x08,0xa8,0x28 }, /* ...0...1...1...1 */
+ { 0x28,0xa8,0x20,0xa0 }, { 0xa0,0xa8,0x20,0x28 }, /* ...1...0...0...0 */
+ { 0x88,0x08,0xa8,0x28 }, { 0x80,0xa0,0x00,0x20 }, /* ...1...0...0...1 */
+ { 0x28,0xa8,0x20,0xa0 }, { 0x08,0x28,0x00,0x20 }, /* ...1...0...1...0 */
+ { 0x28,0xa8,0x20,0xa0 }, { 0x80,0xa0,0x00,0x20 }, /* ...1...0...1...1 */
+ { 0x20,0x28,0x00,0x08 }, { 0x20,0x28,0x00,0x08 }, /* ...1...1...0...0 */
+ { 0x88,0x08,0xa8,0x28 }, { 0x20,0x28,0x00,0x08 }, /* ...1...1...0...1 */
+ { 0x08,0x28,0x00,0x20 }, { 0x80,0xa0,0x00,0x20 }, /* ...1...1...1...0 */
+ { 0x08,0x28,0x00,0x20 }, { 0x88,0x08,0xa8,0x28 } /* ...1...1...1...1 */
+ };
+
+ DRIVER_INIT_CALL(bank00);
+ sega_decode(m_maincpu_region->base(), m_decrypted_opcodes, 0x8000, convtable);
+}
+
+DRIVER_INIT_MEMBER(system1_state,spatter)
+{
+ static const UINT8 convtable[32][4] =
+ {
+ /* opcode data address */
+ /* A B C D A B C D */
+ { 0x88,0x08,0x80,0x00 }, { 0x00,0x08,0x20,0x28 }, /* ...0...0...0...0 */
+ { 0x28,0xa8,0x08,0x88 }, { 0x28,0xa8,0x08,0x88 }, /* ...0...0...0...1 */
+ { 0x28,0x20,0xa8,0xa0 }, { 0x28,0x20,0xa8,0xa0 }, /* ...0...0...1...0 */
+ { 0x88,0x08,0x80,0x00 }, { 0x88,0x08,0x80,0x00 }, /* ...0...0...1...1 */
+ { 0x00,0x08,0x20,0x28 }, { 0x88,0x08,0x80,0x00 }, /* ...0...1...0...0 */
+ { 0xa0,0x80,0x20,0x00 }, { 0x80,0x88,0x00,0x08 }, /* ...0...1...0...1 */
+ { 0x88,0x08,0x80,0x00 }, { 0xa0,0x80,0x20,0x00 }, /* ...0...1...1...0 */
+ { 0x88,0x08,0x80,0x00 }, { 0x28,0x20,0xa8,0xa0 }, /* ...0...1...1...1 */
+ { 0x28,0xa8,0x08,0x88 }, { 0x80,0x88,0x00,0x08 }, /* ...1...0...0...0 */
+ { 0x80,0x88,0x00,0x08 }, { 0x00,0x08,0x20,0x28 }, /* ...1...0...0...1 */
+ { 0x28,0x20,0xa8,0xa0 }, { 0x28,0xa8,0x08,0x88 }, /* ...1...0...1...0 */
+ { 0x00,0x08,0x20,0x28 }, { 0x80,0xa0,0x88,0xa8 }, /* ...1...0...1...1 */
+ { 0x80,0x88,0x00,0x08 }, { 0xa0,0x80,0x20,0x00 }, /* ...1...1...0...0 */
+ { 0x80,0xa0,0x88,0xa8 }, { 0xa0,0x80,0x20,0x00 }, /* ...1...1...0...1 */
+ { 0xa0,0x80,0x20,0x00 }, { 0x80,0xa0,0x88,0xa8 }, /* ...1...1...1...0 */
+ { 0x28,0x20,0xa8,0xa0 }, { 0x00,0x08,0x20,0x28 } /* ...1...1...1...1 */
+ };
+
+ DRIVER_INIT_CALL(bank00);
+ sega_decode(m_maincpu_region->base(), m_decrypted_opcodes, 0x8000, convtable);
+}
+
+DRIVER_INIT_MEMBER(system1_state,pitfall2)
+{
+ static const UINT8 convtable[32][4] =
+ {
+ /* opcode data address */
+ /* A B C D A B C D */
+ { 0xa0,0x80,0xa8,0x88 }, { 0xa0,0x80,0xa8,0x88 }, /* ...0...0...0...0 */
+ { 0x08,0x88,0x28,0xa8 }, { 0x28,0xa8,0x20,0xa0 }, /* ...0...0...0...1 */
+ { 0xa0,0x80,0xa8,0x88 }, { 0xa0,0x80,0xa8,0x88 }, /* ...0...0...1...0 */
+ { 0xa0,0xa8,0x20,0x28 }, { 0xa0,0xa8,0x20,0x28 }, /* ...0...0...1...1 */
+ { 0xa0,0x80,0xa8,0x88 }, { 0x20,0x00,0xa0,0x80 }, /* ...0...1...0...0 */
+ { 0x28,0xa8,0x20,0xa0 }, { 0x20,0x00,0xa0,0x80 }, /* ...0...1...0...1 */
+ { 0xa0,0xa8,0x20,0x28 }, { 0xa0,0xa8,0x20,0x28 }, /* ...0...1...1...0 */
+ { 0x28,0xa8,0x20,0xa0 }, { 0xa0,0xa8,0x20,0x28 }, /* ...0...1...1...1 */
+ { 0x20,0x00,0xa0,0x80 }, { 0x80,0x88,0xa0,0xa8 }, /* ...1...0...0...0 */
+ { 0x80,0x88,0xa0,0xa8 }, { 0x80,0x88,0xa0,0xa8 }, /* ...1...0...0...1 */
+ { 0xa0,0xa8,0x20,0x28 }, { 0xa0,0x80,0xa8,0x88 }, /* ...1...0...1...0 */
+ { 0x80,0x88,0xa0,0xa8 }, { 0x28,0xa8,0x20,0xa0 }, /* ...1...0...1...1 */
+ { 0x20,0x00,0xa0,0x80 }, { 0x80,0x88,0xa0,0xa8 }, /* ...1...1...0...0 */
+ { 0x80,0x88,0xa0,0xa8 }, { 0x20,0x00,0xa0,0x80 }, /* ...1...1...0...1 */
+ { 0xa0,0xa8,0x20,0x28 }, { 0xa0,0x80,0xa8,0x88 }, /* ...1...1...1...0 */
+ { 0x80,0x88,0xa0,0xa8 }, { 0x28,0xa8,0x20,0xa0 } /* ...1...1...1...1 */
+ };
+
+ DRIVER_INIT_CALL(bank00);
+ sega_decode(m_maincpu_region->base(), m_decrypted_opcodes, 0x8000, convtable);
+}
+
+DRIVER_INIT_MEMBER(system1_state,nprinces)
+{
+ static const UINT8 convtable[32][4] =
+ {
+ /* opcode data address */
+ /* A B C D A B C D */
+ { 0x08,0x88,0x00,0x80 }, { 0xa0,0x20,0x80,0x00 }, /* ...0...0...0...0 */
+ { 0xa8,0xa0,0x28,0x20 }, { 0x88,0xa8,0x80,0xa0 }, /* ...0...0...0...1 */
+ { 0x88,0x80,0x08,0x00 }, { 0x28,0x08,0xa8,0x88 }, /* ...0...0...1...0 */
+ { 0x88,0xa8,0x80,0xa0 }, { 0x28,0x08,0xa8,0x88 }, /* ...0...0...1...1 */
+ { 0x88,0xa8,0x80,0xa0 }, { 0xa0,0x20,0x80,0x00 }, /* ...0...1...0...0 */
+ { 0xa8,0xa0,0x28,0x20 }, { 0xa8,0xa0,0x28,0x20 }, /* ...0...1...0...1 */
+ { 0x88,0x80,0x08,0x00 }, { 0x88,0xa8,0x80,0xa0 }, /* ...0...1...1...0 */
+ { 0x88,0xa8,0x80,0xa0 }, { 0x88,0xa8,0x80,0xa0 }, /* ...0...1...1...1 */
+ { 0xa0,0x20,0x80,0x00 }, { 0xa0,0x20,0x80,0x00 }, /* ...1...0...0...0 */
+ { 0x08,0x88,0x00,0x80 }, { 0x28,0x08,0xa8,0x88 }, /* ...1...0...0...1 */
+ { 0x88,0xa8,0x80,0xa0 }, { 0x88,0x80,0x08,0x00 }, /* ...1...0...1...0 */
+ { 0x88,0xa8,0x80,0xa0 }, { 0x28,0x08,0xa8,0x88 }, /* ...1...0...1...1 */
+ { 0x88,0xa8,0x80,0xa0 }, { 0x88,0xa8,0x80,0xa0 }, /* ...1...1...0...0 */
+ { 0x88,0xa8,0x80,0xa0 }, { 0x88,0xa8,0x80,0xa0 }, /* ...1...1...0...1 */
+ { 0x88,0x80,0x08,0x00 }, { 0x88,0x80,0x08,0x00 }, /* ...1...1...1...0 */
+ { 0x08,0x88,0x00,0x80 }, { 0x28,0x08,0xa8,0x88 } /* ...1...1...1...1 */
+ };
+
+ DRIVER_INIT_CALL(bank00);
+ sega_decode(m_maincpu_region->base(), m_decrypted_opcodes, 0x8000, convtable);
+}
+
+DRIVER_INIT_MEMBER(system1_state,seganinj)
+{
+ static const UINT8 convtable[32][4] =
+ {
+ /* opcode data address */
+ /* A B C D A B C D */
+ { 0x88,0xa8,0x80,0xa0 }, { 0x88,0x08,0x80,0x00 }, /* ...0...0...0...0 */
+ { 0x28,0xa8,0x08,0x88 }, { 0xa0,0xa8,0x80,0x88 }, /* ...0...0...0...1 */
+ { 0xa8,0xa0,0x28,0x20 }, { 0xa8,0xa0,0x28,0x20 }, /* ...0...0...1...0 */
+ { 0x28,0xa8,0x08,0x88 }, { 0xa0,0xa8,0x80,0x88 }, /* ...0...0...1...1 */
+ { 0x28,0x08,0xa8,0x88 }, { 0x28,0x08,0xa8,0x88 }, /* ...0...1...0...0 */
+ { 0x28,0xa8,0x08,0x88 }, { 0x88,0x08,0x80,0x00 }, /* ...0...1...0...1 */
+ { 0x28,0x08,0xa8,0x88 }, { 0x28,0x08,0xa8,0x88 }, /* ...0...1...1...0 */
+ { 0x28,0xa8,0x08,0x88 }, { 0xa8,0xa0,0x28,0x20 }, /* ...0...1...1...1 */
+ { 0x88,0x08,0x80,0x00 }, { 0x88,0xa8,0x80,0xa0 }, /* ...1...0...0...0 */
+ { 0xa0,0xa8,0x80,0x88 }, { 0x28,0xa8,0x08,0x88 }, /* ...1...0...0...1 */
+ { 0xa8,0xa0,0x28,0x20 }, { 0x88,0xa8,0x80,0xa0 }, /* ...1...0...1...0 */
+ { 0xa8,0xa0,0x28,0x20 }, { 0x28,0xa8,0x08,0x88 }, /* ...1...0...1...1 */
+ { 0x28,0x08,0xa8,0x88 }, { 0x88,0xa8,0x80,0xa0 }, /* ...1...1...0...0 */
+ { 0x28,0x08,0xa8,0x88 }, { 0x28,0x08,0xa8,0x88 }, /* ...1...1...0...1 */
+ { 0x88,0xa8,0x80,0xa0 }, { 0x88,0xa8,0x80,0xa0 }, /* ...1...1...1...0 */
+ { 0xa8,0xa0,0x28,0x20 }, { 0x28,0x08,0xa8,0x88 } /* ...1...1...1...1 */
+ };
+
+ DRIVER_INIT_CALL(bank00);
+ sega_decode(m_maincpu_region->base(), m_decrypted_opcodes, 0x8000, convtable);
+}
+
+DRIVER_INIT_MEMBER(system1_state,imsorry)
+{
+ static const UINT8 convtable[32][4] =
+ {
+ /* opcode data address */
+ /* A B C D A B C D */
+ { 0x88,0x08,0x80,0x00 }, { 0x00,0x20,0x80,0xa0 }, /* ...0...0...0...0 */
+ { 0x00,0x20,0x80,0xa0 }, { 0x88,0x08,0x80,0x00 }, /* ...0...0...0...1 */
+ { 0x88,0x08,0xa8,0x28 }, { 0x00,0x20,0x80,0xa0 }, /* ...0...0...1...0 */
+ { 0x00,0x20,0x80,0xa0 }, { 0x88,0x08,0xa8,0x28 }, /* ...0...0...1...1 */
+ { 0x00,0x20,0x80,0xa0 }, { 0x08,0x00,0x88,0x80 }, /* ...0...1...0...0 */
+ { 0x00,0x20,0x80,0xa0 }, { 0x20,0x28,0xa0,0xa8 }, /* ...0...1...0...1 */
+ { 0x20,0x28,0xa0,0xa8 }, { 0x00,0x20,0x80,0xa0 }, /* ...0...1...1...0 */
+ { 0x20,0x28,0xa0,0xa8 }, { 0x88,0x08,0xa8,0x28 }, /* ...0...1...1...1 */
+ { 0x88,0x08,0x80,0x00 }, { 0x08,0x00,0x88,0x80 }, /* ...1...0...0...0 */
+ { 0x08,0x00,0x88,0x80 }, { 0x88,0x08,0x80,0x00 }, /* ...1...0...0...1 */
+ { 0x08,0x28,0x00,0x20 }, { 0x08,0x28,0x00,0x20 }, /* ...1...0...1...0 */
+ { 0x88,0x08,0x80,0x00 }, { 0x08,0x28,0x00,0x20 }, /* ...1...0...1...1 */
+ { 0x08,0x28,0x00,0x20 }, { 0x08,0x00,0x88,0x80 }, /* ...1...1...0...0 */
+ { 0x08,0x28,0x00,0x20 }, { 0x20,0x28,0xa0,0xa8 }, /* ...1...1...0...1 */
+ { 0x20,0x28,0xa0,0xa8 }, { 0x08,0x28,0x00,0x20 }, /* ...1...1...1...0 */
+ { 0x20,0x28,0xa0,0xa8 }, { 0x08,0x28,0x00,0x20 } /* ...1...1...1...1 */
+ };
+
+ DRIVER_INIT_CALL(bank00);
+ sega_decode(m_maincpu_region->base(), m_decrypted_opcodes, 0x8000, convtable);
+}
+
+DRIVER_INIT_MEMBER(system1_state,teddybb)
+{
+ static const UINT8 convtable[32][4] =
+ {
+ /* opcode data address */
+ /* A B C D A B C D */
+ { 0x20,0x28,0x00,0x08 }, { 0x80,0x00,0xa0,0x20 }, /* ...0...0...0...0 */
+ { 0x20,0x28,0x00,0x08 }, { 0xa0,0xa8,0x20,0x28 }, /* ...0...0...0...1 */
+ { 0x28,0x08,0xa8,0x88 }, { 0xa0,0x80,0xa8,0x88 }, /* ...0...0...1...0 */
+ { 0xa0,0xa8,0x20,0x28 }, { 0xa0,0x80,0xa8,0x88 }, /* ...0...0...1...1 */
+ { 0x20,0x28,0x00,0x08 }, { 0x28,0x08,0xa8,0x88 }, /* ...0...1...0...0 */
+ { 0xa0,0xa8,0x20,0x28 }, { 0xa0,0xa8,0x20,0x28 }, /* ...0...1...0...1 */
+ { 0xa0,0x80,0xa8,0x88 }, { 0x28,0x08,0xa8,0x88 }, /* ...0...1...1...0 */
+ { 0xa0,0xa8,0x20,0x28 }, { 0x28,0x08,0xa8,0x88 }, /* ...0...1...1...1 */
+ { 0x80,0x00,0xa0,0x20 }, { 0x80,0x00,0xa0,0x20 }, /* ...1...0...0...0 */
+ { 0xa0,0x20,0xa8,0x28 }, { 0xa0,0xa8,0x20,0x28 }, /* ...1...0...0...1 */
+ { 0xa0,0x20,0xa8,0x28 }, { 0xa0,0x80,0xa8,0x88 }, /* ...1...0...1...0 */
+ { 0xa0,0x80,0xa8,0x88 }, { 0xa0,0x80,0xa8,0x88 }, /* ...1...0...1...1 */
+ { 0x80,0x00,0xa0,0x20 }, { 0x20,0x28,0x00,0x08 }, /* ...1...1...0...0 */
+ { 0xa0,0xa8,0x20,0x28 }, { 0xa0,0x20,0xa8,0x28 }, /* ...1...1...0...1 */
+ { 0x80,0x00,0xa0,0x20 }, { 0xa0,0x80,0xa8,0x88 }, /* ...1...1...1...0 */
+ { 0xa0,0xa8,0x20,0x28 }, { 0xa0,0x20,0xa8,0x28 } /* ...1...1...1...1 */
+ };
+
+ DRIVER_INIT_CALL(bank00);
+ sega_decode(m_maincpu_region->base(), m_decrypted_opcodes, 0x8000, convtable);
+}
+
+DRIVER_INIT_MEMBER(system1_state,myheroj)
+{
+ static const UINT8 convtable[32][4] =
+ {
+ /* opcode data address */
+ /* A B C D A B C D */
+ { 0x20,0x00,0xa0,0x80 }, { 0x80,0xa0,0x88,0xa8 }, /* ...0...0...0...0 */
+ { 0x20,0x00,0xa0,0x80 }, { 0x80,0xa0,0x88,0xa8 }, /* ...0...0...0...1 */
+ { 0xa8,0xa0,0x88,0x80 }, { 0xa8,0xa0,0x88,0x80 }, /* ...0...0...1...0 */
+ { 0x08,0x88,0x00,0x80 }, { 0x80,0xa0,0x88,0xa8 }, /* ...0...0...1...1 */
+ { 0x20,0x00,0xa0,0x80 }, { 0x28,0xa8,0x08,0x88 }, /* ...0...1...0...0 */
+ { 0x20,0x00,0xa0,0x80 }, { 0x08,0x88,0x00,0x80 }, /* ...0...1...0...1 */
+ { 0x28,0xa8,0x08,0x88 }, { 0xa8,0xa0,0x88,0x80 }, /* ...0...1...1...0 */
+ { 0x08,0x88,0x00,0x80 }, { 0xa8,0xa0,0x88,0x80 }, /* ...0...1...1...1 */
+ { 0x28,0xa8,0x08,0x88 }, { 0x20,0x00,0xa0,0x80 }, /* ...1...0...0...0 */
+ { 0x80,0xa0,0x88,0xa8 }, { 0x20,0x00,0xa0,0x80 }, /* ...1...0...0...1 */
+ { 0x80,0xa0,0x88,0xa8 }, { 0x80,0xa0,0x88,0xa8 }, /* ...1...0...1...0 */
+ { 0xa8,0xa0,0x88,0x80 }, { 0x80,0xa0,0x88,0xa8 }, /* ...1...0...1...1 */
+ { 0x88,0x80,0x08,0x00 }, { 0x88,0x80,0x08,0x00 }, /* ...1...1...0...0 */
+ { 0x88,0x80,0x08,0x00 }, { 0x08,0x88,0x00,0x80 }, /* ...1...1...0...1 */
+ { 0x88,0x80,0x08,0x00 }, { 0xa8,0xa0,0x88,0x80 }, /* ...1...1...1...0 */
+ { 0x88,0x80,0x08,0x00 }, { 0xa8,0xa0,0x88,0x80 } /* ...1...1...1...1 */
+ };
+
+ DRIVER_INIT_CALL(bank00);
+ sega_decode(m_maincpu_region->base(), m_decrypted_opcodes, 0x8000, convtable);
+}
+
+DRIVER_INIT_MEMBER(system1_state,4dwarrio)
+{
+ // 315-5162
+ static const UINT8 xor_table[128] =
+ {
+ 0x40,0x10,0x50,0x04,0x44,0x14,0x54,0x01,0x41,0x11,0x51,0x05,0x45,0x15,0x55,
+ 0x00,0x40,0x10,0x50,0x04,0x44,0x14,0x54,0x01,0x41,0x11,0x51,0x05,0x45,0x15,0x55,
+ 0x00,0x40,0x10,0x50,0x04,0x44,0x14,0x54,0x01,0x41,0x11,0x51,0x05,0x45,0x15,0x55,
+ 0x00,0x40,0x10,0x50,0x04,0x44,0x14,0x54,0x01,0x41,0x11,0x51,0x05,0x45,0x15,0x55,
+ 0x00,0x40,0x10,0x50,0x04,0x44,0x14,0x54,0x01,0x41,0x11,0x51,0x05,0x45,0x15,0x55,
+ 0x00,0x40,0x10,0x50,0x04,0x44,0x14,0x54,0x01,0x41,0x11,0x51,0x05,0x45,0x15,0x55,
+ 0x00,0x40,0x10,0x50,0x04,0x44,0x14,0x54,0x01,0x41,0x11,0x51,0x05,0x45,0x15,0x55,
+ 0x00,0x40,0x10,0x50,0x04,0x44,0x14,0x54,0x01,0x41,0x11,0x51,0x05,0x45,0x15,0x55,
+ 0x00,
+ };
+
+ static const int swap_table[128] =
+ {
+ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
+ 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
+ 12,
+ };
+
+ DRIVER_INIT_CALL(bank00);
+ sega_decode_2(m_maincpu_region->base(), m_decrypted_opcodes, xor_table, swap_table);
+}
+
+DRIVER_INIT_MEMBER(system1_state,wboy)
+{
+ // 315-5177
+ static const UINT8 xor_table[128] =
+ {
+ 0x04,0x54,0x51,0x15,0x40,0x44,0x01,0x51,0x55,0x10,0x44,0x41,
+ 0x05,0x55,0x50,0x14,0x41,0x45,0x00,0x50,0x54,0x11,0x45,0x40,
+ 0x04,0x54,0x51,0x15,0x40,0x44,0x01,0x51,0x55,0x10,0x44,0x41,
+ 0x05,0x55,0x50,0x14,0x41,0x45,0x00,0x50,0x54,0x11,0x45,0x40,
+ 0x04,0x54,0x51,0x15,0x40,0x44,0x01,0x51,0x55,0x10,0x44,0x41,
+ 0x05,0x55,0x50,0x14,
+
+ 0x04,0x54,0x51,0x15,0x40,0x44,0x01,0x51,0x55,0x10,0x44,0x41,
+ 0x05,0x55,0x50,0x14,0x41,0x45,0x00,0x50,0x54,0x11,0x45,0x40,
+ 0x04,0x54,0x51,0x15,0x40,0x44,0x01,0x51,0x55,0x10,0x44,0x41,
+ 0x05,0x55,0x50,0x14,0x41,0x45,0x00,0x50,0x54,0x11,0x45,0x40,
+ 0x04,0x54,0x51,0x15,0x40,0x44,0x01,0x51,0x55,0x10,0x44,0x41,
+ 0x05,0x55,0x50,0x14,
+ };
+
+ static const int swap_table[128] =
+ {
+ 0,0,0,0,
+ 1,1,1,1,1,
+ 2,2,2,2,2,
+ 3,3,3,3,
+ 4,4,4,4,4,
+ 5,5,5,5,5,
+ 6,6,6,6,6,
+ 7,7,7,7,7,
+ 8,8,8,8,
+ 9,9,9,9,9,
+ 10,10,10,10,10,
+ 11,11,11,11,11,
+ 12,12,12,12,12,
+ 13,13,
+
+ 8,8,8,8,
+ 9,9,9,9,9,
+ 10,10,10,10,10,
+ 11,11,11,11,
+ 12,12,12,12,12,
+ 13,13,13,13,13,
+ 14,14,14,14,14,
+ 15,15,15,15,15,
+ 16,16,16,16,
+ 17,17,17,17,17,
+ 18,18,18,18,18,
+ 19,19,19,19,19,
+ 20,20,20,20,20,
+ 21,21,
+ };
+
+ DRIVER_INIT_CALL(bank00);
+ sega_decode_2(m_maincpu_region->base(), m_decrypted_opcodes, xor_table, swap_table);
+}
+
+DRIVER_INIT_MEMBER(system1_state,wboy2)
+{
+ // 315-5178
+ static const UINT8 xor_table[128] =
+ {
+ 0x00,0x55,0x45,0x05,0x11,0x41,0x01,0x14,0x44,0x50,0x10,
+ 0x00,0x55,0x15,0x05,0x51,0x41,0x01,0x14,0x44,0x04,0x10,
+ 0x40,0x55,0x15,0x05,0x51,0x11,
+ 0x01,0x54,0x44,0x04,0x10,0x40,0x00,0x15,0x45,0x51,0x11,
+ 0x01,0x54,0x14,0x04,0x50,0x40,0x00,0x15,0x45,0x05,0x11,
+ 0x41,0x54,0x14,0x04,0x50,0x10,
+ 0x00,0x55,0x45,0x05,0x11,0x41,0x01,0x14,
+
+ 0x00,0x55,0x45,0x05,0x11,0x41,0x01,0x14,0x44,0x50,0x10,
+ 0x00,0x55,0x15,0x05,0x51,0x41,0x01,0x14,0x44,0x04,0x10,
+ 0x40,0x55,0x15,0x05,0x51,0x11,
+ 0x01,0x54,0x44,0x04,0x10,0x40,0x00,0x15,0x45,0x51,0x11,
+ 0x01,0x54,0x14,0x04,0x50,0x40,0x00,0x15,0x45,0x05,0x11,
+ 0x41,0x54,0x14,0x04,0x50,0x10,
+ 0x00,0x55,0x45,0x05,0x11,0x41,0x01,0x14,
+ };
+
+ static const int swap_table[128] =
+ {
+ 2,
+ 3, 5, 7, 1, 3, 5, 7, 1, 3, 5, 7,
+ 0, 2, 4, 6, 0, 2, 4, 6, 0, 2, 4,
+ 5, 7, 1, 3, 5, 7, 1, 3, 5, 7, 1, 3,
+ 4, 6, 0, 2, 4, 6, 0, 2, 4, 6,
+ 8,
+ 1, 3, 5, 7, 1, 3, 5, 7, 1, 3, 5,
+ 6, 0, 2, 4, 6, 0, 2,
+
+ 10,
+ 11,13,15, 9,11,13,15, 9,11,13,15,
+ 8,10,12,14, 8,10,12,14, 8,10,12,
+ 13,15, 9,11,13,15, 9,11,13,15, 9,11,
+ 12,14, 8,10,12,14, 8,10,12,14,
+ 16,
+ 9,11,13,15, 9,11,13,15, 9,11,13,
+ 14, 8,10,12,14, 8,10,
+ };
+
+ DRIVER_INIT_CALL(bank00);
+ sega_decode_2(m_maincpu_region->base(), m_decrypted_opcodes, xor_table, swap_table);
+}
+
+DRIVER_INIT_MEMBER(system1_state,wboyo)
+{
+ static const UINT8 convtable[32][4] =
+ {
+ /* opcode data address */
+ /* A B C D A B C D */
+ { 0x88,0xa8,0x80,0xa0 }, { 0xa0,0x80,0xa8,0x88 }, /* ...0...0...0...0 */
+ { 0x88,0xa8,0x80,0xa0 }, { 0x88,0x80,0x08,0x00 }, /* ...0...0...0...1 */
+ { 0xa0,0x80,0xa8,0x88 }, { 0x88,0xa8,0x80,0xa0 }, /* ...0...0...1...0 */
+ { 0x88,0xa8,0x80,0xa0 }, { 0x88,0x80,0x08,0x00 }, /* ...0...0...1...1 */
+ { 0xa0,0x80,0xa8,0x88 }, { 0x88,0x80,0x08,0x00 }, /* ...0...1...0...0 */
+ { 0x88,0x80,0x08,0x00 }, { 0x88,0x80,0x08,0x00 }, /* ...0...1...0...1 */
+ { 0xa0,0x80,0xa8,0x88 }, { 0x88,0x80,0x08,0x00 }, /* ...0...1...1...0 */
+ { 0x88,0x80,0x08,0x00 }, { 0x28,0x08,0xa8,0x88 }, /* ...0...1...1...1 */
+ { 0xa0,0x20,0xa8,0x28 }, { 0x88,0xa8,0x80,0xa0 }, /* ...1...0...0...0 */
+ { 0xa0,0x20,0xa8,0x28 }, { 0x88,0xa8,0x80,0xa0 }, /* ...1...0...0...1 */
+ { 0xa0,0x20,0xa8,0x28 }, { 0x88,0xa8,0x80,0xa0 }, /* ...1...0...1...0 */
+ { 0x88,0xa8,0x80,0xa0 }, { 0x28,0x08,0xa8,0x88 }, /* ...1...0...1...1 */
+ { 0x28,0xa8,0x08,0x88 }, { 0xa0,0x20,0xa8,0x28 }, /* ...1...1...0...0 */
+ { 0xa0,0x20,0xa8,0x28 }, { 0x28,0xa8,0x08,0x88 }, /* ...1...1...0...1 */
+ { 0x28,0xa8,0x08,0x88 }, { 0xa0,0x20,0xa8,0x28 }, /* ...1...1...1...0 */
+ { 0x28,0x08,0xa8,0x88 }, { 0x28,0xa8,0x08,0x88 } /* ...1...1...1...1 */
+ };
+
+ DRIVER_INIT_CALL(bank00);
+ sega_decode(m_maincpu_region->base(), m_decrypted_opcodes, 0x8000, convtable);
+}
+
+DRIVER_INIT_MEMBER(system1_state,blockgal)
+{
+ DRIVER_INIT_CALL(bank00);
+ mc8123_decode(m_maincpu_region->base(), m_decrypted_opcodes, memregion("key")->base(), 0x8000);
+}
+
+DRIVER_INIT_MEMBER(system1_state,hvymetal)
+{
+ static const UINT8 convtable[32][4] =
+ {
+ /* opcode data address */
+ /* A B C D A B C D */
+ { 0x88,0xa8,0x80,0xa0 }, { 0xa0,0x80,0xa8,0x88 }, /* ...0...0...0...0 */
+ { 0x88,0xa8,0x80,0xa0 }, { 0x88,0x80,0x08,0x00 }, /* ...0...0...0...1 */
+ { 0xa0,0x80,0xa8,0x88 }, { 0x88,0xa8,0x80,0xa0 }, /* ...0...0...1...0 */
+ { 0x88,0xa8,0x80,0xa0 }, { 0x88,0x80,0x08,0x00 }, /* ...0...0...1...1 */
+ { 0xa0,0x80,0xa8,0x88 }, { 0x88,0x80,0x08,0x00 }, /* ...0...1...0...0 */
+ { 0x88,0x80,0x08,0x00 }, { 0x88,0x80,0x08,0x00 }, /* ...0...1...0...1 */
+ { 0xa0,0x80,0xa8,0x88 }, { 0x88,0x80,0x08,0x00 }, /* ...0...1...1...0 */
+ { 0x88,0x80,0x08,0x00 }, { 0x28,0x08,0xa8,0x88 }, /* ...0...1...1...1 */
+ { 0xa0,0x20,0xa8,0x28 }, { 0x88,0xa8,0x80,0xa0 }, /* ...1...0...0...0 */
+ { 0xa0,0x20,0xa8,0x28 }, { 0x88,0xa8,0x80,0xa0 }, /* ...1...0...0...1 */
+ { 0xa0,0x20,0xa8,0x28 }, { 0x88,0xa8,0x80,0xa0 }, /* ...1...0...1...0 */
+ { 0x88,0xa8,0x80,0xa0 }, { 0x28,0x08,0xa8,0x88 }, /* ...1...0...1...1 */
+ { 0x28,0xa8,0x08,0x88 }, { 0xa0,0x20,0xa8,0x28 }, /* ...1...1...0...0 */
+ { 0xa0,0x20,0xa8,0x28 }, { 0x28,0xa8,0x08,0x88 }, /* ...1...1...0...1 */
+ { 0x28,0xa8,0x08,0x88 }, { 0xa0,0x20,0xa8,0x28 }, /* ...1...1...1...0 */
+ { 0x28,0x08,0xa8,0x88 }, { 0x28,0xa8,0x08,0x88 } /* ...1...1...1...1 */
+ };
+
+ DRIVER_INIT_CALL(bank44);
+ sega_decode(m_maincpu_region->base(), m_decrypted_opcodes, 0x8000, convtable);
+}
+
+DRIVER_INIT_MEMBER(system1_state,gardia)
+{
+ // 317-0006
+ DRIVER_INIT_CALL(bank44);
+ sega_decode_317(m_maincpu_region->base(), m_decrypted_opcodes, 2);
+}
+
+DRIVER_INIT_MEMBER(system1_state,gardiab)
+{
+ // 317-0007
+ DRIVER_INIT_CALL(bank44);
+ sega_decode_317(m_maincpu_region->base(), m_decrypted_opcodes, 3);
+}
+
+DRIVER_INIT_MEMBER(system1_state,wbml)
+{
+ DRIVER_INIT_CALL(bank0c);
+ m_banked_decrypted_opcodes = auto_alloc_array(machine(), UINT8, m_maincpu_region->bytes());
+ mc8123_decode(m_maincpu_region->base(), m_banked_decrypted_opcodes, memregion("key")->base(), m_maincpu_region->bytes());
+}
+
+DRIVER_INIT_MEMBER(system1_state,ufosensi)
+{
+ DRIVER_INIT_CALL(bank0c);
+ m_banked_decrypted_opcodes = auto_alloc_array(machine(), UINT8, m_maincpu_region->bytes());
+ mc8123_decode(m_maincpu_region->base(), m_banked_decrypted_opcodes, memregion("key")->base(), m_maincpu_region->bytes());
+}
+
+DRIVER_INIT_MEMBER(system1_state,wboysys2)
+{
+ // 315-5177
+ static const UINT8 xor_table[128] =
+ {
+ 0x04,0x54,0x51,0x15,0x40,0x44,0x01,0x51,0x55,0x10,0x44,0x41,
+ 0x05,0x55,0x50,0x14,0x41,0x45,0x00,0x50,0x54,0x11,0x45,0x40,
+ 0x04,0x54,0x51,0x15,0x40,0x44,0x01,0x51,0x55,0x10,0x44,0x41,
+ 0x05,0x55,0x50,0x14,0x41,0x45,0x00,0x50,0x54,0x11,0x45,0x40,
+ 0x04,0x54,0x51,0x15,0x40,0x44,0x01,0x51,0x55,0x10,0x44,0x41,
+ 0x05,0x55,0x50,0x14,
+
+ 0x04,0x54,0x51,0x15,0x40,0x44,0x01,0x51,0x55,0x10,0x44,0x41,
+ 0x05,0x55,0x50,0x14,0x41,0x45,0x00,0x50,0x54,0x11,0x45,0x40,
+ 0x04,0x54,0x51,0x15,0x40,0x44,0x01,0x51,0x55,0x10,0x44,0x41,
+ 0x05,0x55,0x50,0x14,0x41,0x45,0x00,0x50,0x54,0x11,0x45,0x40,
+ 0x04,0x54,0x51,0x15,0x40,0x44,0x01,0x51,0x55,0x10,0x44,0x41,
+ 0x05,0x55,0x50,0x14,
+ };
+
+ static const int swap_table[128] =
+ {
+ 0,0,0,0,
+ 1,1,1,1,1,
+ 2,2,2,2,2,
+ 3,3,3,3,
+ 4,4,4,4,4,
+ 5,5,5,5,5,
+ 6,6,6,6,6,
+ 7,7,7,7,7,
+ 8,8,8,8,
+ 9,9,9,9,9,
+ 10,10,10,10,10,
+ 11,11,11,11,11,
+ 12,12,12,12,12,
+ 13,13,
+
+ 8,8,8,8,
+ 9,9,9,9,9,
+ 10,10,10,10,10,
+ 11,11,11,11,
+ 12,12,12,12,12,
+ 13,13,13,13,13,
+ 14,14,14,14,14,
+ 15,15,15,15,15,
+ 16,16,16,16,
+ 17,17,17,17,17,
+ 18,18,18,18,18,
+ 19,19,19,19,19,
+ 20,20,20,20,20,
+ 21,21,
+ };
+
+ DRIVER_INIT_CALL(bank0c);
+ sega_decode_2(m_maincpu_region->base(), m_decrypted_opcodes, xor_table, swap_table);
}
-DRIVER_INIT_MEMBER(system1_state,regulus) { DRIVER_INIT_CALL(bank00); regulus_decode(machine(), "maincpu"); }
-DRIVER_INIT_MEMBER(system1_state,mrviking) { DRIVER_INIT_CALL(bank00); mrviking_decode(machine(), "maincpu"); }
-DRIVER_INIT_MEMBER(system1_state,swat) { DRIVER_INIT_CALL(bank00); swat_decode(machine(), "maincpu"); }
-DRIVER_INIT_MEMBER(system1_state,flicky) { DRIVER_INIT_CALL(bank00); flicky_decode(machine(), "maincpu"); }
-DRIVER_INIT_MEMBER(system1_state,wmatch) { DRIVER_INIT_CALL(bank00); wmatch_decode(machine(), "maincpu"); }
-DRIVER_INIT_MEMBER(system1_state,bullfgtj) { DRIVER_INIT_CALL(bank00); bullfgtj_decode(machine(), "maincpu"); }
-DRIVER_INIT_MEMBER(system1_state,spatter) { DRIVER_INIT_CALL(bank00); spatter_decode(machine(), "maincpu"); }
-DRIVER_INIT_MEMBER(system1_state,pitfall2) { DRIVER_INIT_CALL(bank00); pitfall2_decode(machine(), "maincpu"); }
-DRIVER_INIT_MEMBER(system1_state,nprinces) { DRIVER_INIT_CALL(bank00); nprinces_decode(machine(), "maincpu"); }
-DRIVER_INIT_MEMBER(system1_state,seganinj) { DRIVER_INIT_CALL(bank00); seganinj_decode(machine(), "maincpu"); }
-DRIVER_INIT_MEMBER(system1_state,imsorry) { DRIVER_INIT_CALL(bank00); imsorry_decode(machine(), "maincpu"); }
-DRIVER_INIT_MEMBER(system1_state,teddybb) { DRIVER_INIT_CALL(bank00); teddybb_decode(machine(), "maincpu"); }
-DRIVER_INIT_MEMBER(system1_state,myheroj) { DRIVER_INIT_CALL(bank00); myheroj_decode(machine(), "maincpu"); }
-DRIVER_INIT_MEMBER(system1_state,4dwarrio) { DRIVER_INIT_CALL(bank00); sega_315_5162_decode(machine(), "maincpu"); }
-DRIVER_INIT_MEMBER(system1_state,wboy) { DRIVER_INIT_CALL(bank00); sega_315_5177_decode(machine(), "maincpu"); }
-DRIVER_INIT_MEMBER(system1_state,wboy2) { DRIVER_INIT_CALL(bank00); sega_315_5178_decode(machine(), "maincpu"); }
-DRIVER_INIT_MEMBER(system1_state,wboyo) { DRIVER_INIT_CALL(bank00); hvymetal_decode(machine(), "maincpu"); }
-DRIVER_INIT_MEMBER(system1_state,blockgal) { DRIVER_INIT_CALL(bank00); mc8123_decrypt_rom(machine(), "maincpu", "key", NULL, 0); }
-
-DRIVER_INIT_MEMBER(system1_state,hvymetal) { DRIVER_INIT_CALL(bank44); hvymetal_decode(machine(), "maincpu"); }
-DRIVER_INIT_MEMBER(system1_state,gardia) { DRIVER_INIT_CALL(bank44); sega_317_0006_decode(machine(), "maincpu"); }
-DRIVER_INIT_MEMBER(system1_state,gardiab) { DRIVER_INIT_CALL(bank44); sega_317_0007_decode(machine(), "maincpu"); }
-
-DRIVER_INIT_MEMBER(system1_state,wbml) { DRIVER_INIT_CALL(bank0c); mc8123_decrypt_rom(machine(), "maincpu", "key", "bank1", 4); }
-DRIVER_INIT_MEMBER(system1_state,ufosensi) { DRIVER_INIT_CALL(bank0c); mc8123_decrypt_rom(machine(), "maincpu", "key", "bank1", 4); }
-DRIVER_INIT_MEMBER(system1_state,wboysys2) { DRIVER_INIT_CALL(bank0c); sega_315_5177_decode(machine(), "maincpu"); }
DRIVER_INIT_MEMBER(system1_state,dakkochn)
{
m_videomode_custom = &system1_state::dakkochn_custom_w;
-
- mc8123_decrypt_rom(machine(), "maincpu", "key", "bank1", 4);
+ m_banked_decrypted_opcodes = auto_alloc_array(machine(), UINT8, m_maincpu_region->bytes());
+ mc8123_decode(m_maincpu_region->base(), m_banked_decrypted_opcodes, memregion("key")->base(), m_maincpu_region->bytes());
}
DRIVER_INIT_MEMBER(system1_state,myherok)
{
+ static const UINT8 convtable[32][4] =
+ {
+ /* opcode data address */
+ /* A B C D A B C D */
+ { 0x20,0x00,0xa0,0x80 }, { 0x80,0xa0,0x88,0xa8 }, /* ...0...0...0...0 */
+ { 0x20,0x00,0xa0,0x80 }, { 0x80,0xa0,0x88,0xa8 }, /* ...0...0...0...1 */
+ { 0xa8,0xa0,0x88,0x80 }, { 0xa8,0xa0,0x88,0x80 }, /* ...0...0...1...0 */
+ { 0x08,0x88,0x00,0x80 }, { 0x80,0xa0,0x88,0xa8 }, /* ...0...0...1...1 */
+ { 0x20,0x00,0xa0,0x80 }, { 0x28,0xa8,0x08,0x88 }, /* ...0...1...0...0 */
+ { 0x20,0x00,0xa0,0x80 }, { 0x08,0x88,0x00,0x80 }, /* ...0...1...0...1 */
+ { 0x28,0xa8,0x08,0x88 }, { 0xa8,0xa0,0x88,0x80 }, /* ...0...1...1...0 */
+ { 0x08,0x88,0x00,0x80 }, { 0xa8,0xa0,0x88,0x80 }, /* ...0...1...1...1 */
+ { 0x28,0xa8,0x08,0x88 }, { 0x20,0x00,0xa0,0x80 }, /* ...1...0...0...0 */
+ { 0x80,0xa0,0x88,0xa8 }, { 0x20,0x00,0xa0,0x80 }, /* ...1...0...0...1 */
+ { 0x80,0xa0,0x88,0xa8 }, { 0x80,0xa0,0x88,0xa8 }, /* ...1...0...1...0 */
+ { 0xa8,0xa0,0x88,0x80 }, { 0x80,0xa0,0x88,0xa8 }, /* ...1...0...1...1 */
+ { 0x88,0x80,0x08,0x00 }, { 0x88,0x80,0x08,0x00 }, /* ...1...1...0...0 */
+ { 0x88,0x80,0x08,0x00 }, { 0x08,0x88,0x00,0x80 }, /* ...1...1...0...1 */
+ { 0x88,0x80,0x08,0x00 }, { 0xa8,0xa0,0x88,0x80 }, /* ...1...1...1...0 */
+ { 0x88,0x80,0x08,0x00 }, { 0xa8,0xa0,0x88,0x80 } /* ...1...1...1...1 */
+ };
+
+
int A;
UINT8 *rom;
@@ -4744,7 +5452,7 @@ DRIVER_INIT_MEMBER(system1_state,myherok)
/* additionally to the usual protection, all the program ROMs have data lines */
/* D0 and D1 swapped. */
- rom = memregion("maincpu")->base();
+ rom = m_maincpu_region->base();
for (A = 0;A < 0xc000;A++)
rom[A] = (rom[A] & 0xfc) | ((rom[A] & 1) << 1) | ((rom[A] & 2) >> 1);
@@ -4778,13 +5486,13 @@ DRIVER_INIT_MEMBER(system1_state,myherok)
}
}
- myheroj_decode(machine(), "maincpu");
+ sega_decode(m_maincpu_region->base(), m_decrypted_opcodes, 0x8000, convtable);
}
READ8_MEMBER(system1_state::nob_start_r)
{
/* in reality, it's likely some M1-dependent behavior */
- return (space.device().safe_pc() <= 0x0003) ? 0x80 : memregion("maincpu")->base()[1];
+ return (space.device().safe_pc() <= 0x0003) ? 0x80 : m_maincpu_region->base()[1];
}
DRIVER_INIT_MEMBER(system1_state,nob)
@@ -4809,7 +5517,7 @@ DRIVER_INIT_MEMBER(system1_state,nobb)
/* Patch to get PRG ROMS ('T', 'R' and 'S) status as "GOOD" in the "test mode" */
/* not really needed */
-// UINT8 *ROM = memregion("maincpu")->base();
+// UINT8 *ROM = m_maincpu_region->base();
// ROM[0x3296] = 0x18; // 'jr' instead of 'jr z' - 'T' (PRG Main ROM)
// ROM[0x32be] = 0x18; // 'jr' instead of 'jr z' - 'R' (Banked ROM 1)
@@ -4837,18 +5545,16 @@ DRIVER_INIT_MEMBER(system1_state,nobb)
DRIVER_INIT_MEMBER(system1_state,bootleg)
{
- address_space &space = m_maincpu->space(AS_PROGRAM);
- space.set_decrypted_region(0x0000, 0x7fff, memregion("maincpu")->base() + 0x10000);
DRIVER_INIT_CALL(bank00);
+ memcpy(m_decrypted_opcodes, m_maincpu_region->base() + 0x10000, 0x8000);
}
DRIVER_INIT_MEMBER(system1_state,bootsys2)
{
- address_space &space = m_maincpu->space(AS_PROGRAM);
- space.set_decrypted_region(0x0000, 0x7fff, memregion("maincpu")->base() + 0x20000);
- membank("bank1")->configure_decrypted_entries(0, 4, memregion("maincpu")->base() + 0x30000, 0x4000);
DRIVER_INIT_CALL(bank0c);
+ m_bank0d->set_base(m_maincpu_region->base() + 0x20000);
+ m_bank1d->configure_entries(0, 4, m_maincpu_region->base() + 0x30000, 0x4000);
}
DRIVER_INIT_MEMBER(system1_state,choplift)
@@ -4882,84 +5588,84 @@ DRIVER_INIT_MEMBER(system1_state,shtngmst)
*************************************/
/* PPI-based System 1 */
-GAME( 1983, starjack, 0, sys1ppis, starjack, system1_state, bank00, ROT270, "Sega", "Star Jacker (Sega)", GAME_SUPPORTS_SAVE )
-GAME( 1983, starjacks, starjack, sys1ppis, starjacks, system1_state, bank00, ROT270, "Sega (Stern Electronics license)", "Star Jacker (Stern Electronics)", GAME_SUPPORTS_SAVE )
-GAME( 1983, upndown, 0, sys1ppi, upndown, system1_state, nprinces, ROT270, "Sega", "Up'n Down (315-5030)", GAME_SUPPORTS_SAVE )
-GAME( 1983, upndownu, upndown, sys1ppi, upndown, system1_state, bank00, ROT270, "Sega", "Up'n Down (not encrypted)", GAME_SUPPORTS_SAVE )
-GAME( 1983, regulus, 0, sys1ppi, regulus, system1_state, regulus, ROT270, "Sega", "Regulus (315-5033, Rev A.)", GAME_SUPPORTS_SAVE )
-GAME( 1983, reguluso, regulus, sys1ppi, reguluso, system1_state, regulus, ROT270, "Sega", "Regulus (315-5033)", GAME_SUPPORTS_SAVE )
-GAME( 1983, regulusu, regulus, sys1ppi, regulus, system1_state, bank00, ROT270, "Sega", "Regulus (not encrypted)", GAME_SUPPORTS_SAVE )
-GAME( 1984, mrviking, 0, sys1ppis, mrviking, system1_state, mrviking, ROT270, "Sega", "Mister Viking (315-5041)", GAME_SUPPORTS_SAVE )
-GAME( 1984, mrvikingj, mrviking, sys1ppis, mrvikingj, system1_state, mrviking, ROT270, "Sega", "Mister Viking (315-5041, Japan)", GAME_SUPPORTS_SAVE )
-GAME( 1984, swat, 0, sys1ppi, swat, system1_state, swat, ROT270, "Coreland / Sega", "SWAT (315-5048)", GAME_SUPPORTS_SAVE )
-GAME( 1984, flickyo, flicky, sys1ppi, flicky, system1_state, flicky, ROT0, "Sega", "Flicky (64k Version, System 1, 315-5051, set 1)", GAME_SUPPORTS_SAVE )
-GAME( 1984, flickys1, flicky, sys1ppi, flickys1, system1_state, flicky, ROT0, "Sega", "Flicky (64k Version, System 1, 315-5051, set 2)", GAME_SUPPORTS_SAVE )
-GAME( 1984, wmatch, 0, sys1ppis, wmatch, system1_state, wmatch, ROT270, "Sega", "Water Match (315-5064)", GAME_SUPPORTS_SAVE )
-GAME( 1984, bullfgt, 0, sys1ppi, bullfgt, system1_state, bullfgtj, ROT0, "Coreland / Sega", "Bullfight (315-5065)", GAME_SUPPORTS_SAVE )
-GAME( 1985, nprinces, seganinj, sys1ppi, seganinj, system1_state, flicky, ROT0, "bootleg?", "Ninja Princess (315-5051, 64k Ver. bootleg?)", GAME_SUPPORTS_SAVE )
-GAME( 1985, nprincesu, seganinj, sys1ppi, seganinj, system1_state, bank00, ROT0, "Sega", "Ninja Princess (64k Ver. not encrypted)", GAME_SUPPORTS_SAVE )
-GAME( 1986, wboy2, wboy, sys1ppi, wboy, system1_state, wboy2, ROT0, "Escape (Sega license)", "Wonder Boy (set 2, 315-5178)", GAME_SUPPORTS_SAVE )
-GAME( 1986, wboy2u, wboy, sys1ppi, wboy, system1_state, bank00, ROT0, "Escape (Sega license)", "Wonder Boy (set 2, not encrypted)", GAME_SUPPORTS_SAVE )
-GAME( 1986, wbdeluxe, wboy, sys1ppi, wbdeluxe, system1_state, bank00, ROT0, "Escape (Sega license)", "Wonder Boy Deluxe", GAME_SUPPORTS_SAVE )
-GAME( 1986, nob, 0, nobm, nob, system1_state, nob, ROT270, "Coreland / Data East Corporation", "Noboranka (Japan)", GAME_SUPPORTS_SAVE )
-GAME( 1986, nobb, nob, nob, nob, system1_state, nobb, ROT270, "bootleg (Game Electronics)", "Noboranka (Japan, bootleg)", GAME_SUPPORTS_SAVE )
+GAME( 1983, starjack, 0, sys1ppis, starjack, system1_state, bank00, ROT270, "Sega", "Star Jacker (Sega)", GAME_SUPPORTS_SAVE )
+GAME( 1983, starjacks, starjack, sys1ppis, starjacks, system1_state, bank00, ROT270, "Sega (Stern Electronics license)", "Star Jacker (Stern Electronics)", GAME_SUPPORTS_SAVE )
+GAME( 1983, upndown, 0, sys1ppix, upndown, system1_state, nprinces, ROT270, "Sega", "Up'n Down (315-5030)", GAME_SUPPORTS_SAVE )
+GAME( 1983, upndownu, upndown, sys1ppi, upndown, system1_state, bank00, ROT270, "Sega", "Up'n Down (not encrypted)", GAME_SUPPORTS_SAVE )
+GAME( 1983, regulus, 0, sys1ppix, regulus, system1_state, regulus, ROT270, "Sega", "Regulus (315-5033, Rev A.)", GAME_SUPPORTS_SAVE )
+GAME( 1983, reguluso, regulus, sys1ppix, reguluso, system1_state, regulus, ROT270, "Sega", "Regulus (315-5033)", GAME_SUPPORTS_SAVE )
+GAME( 1983, regulusu, regulus, sys1ppi, regulus, system1_state, bank00, ROT270, "Sega", "Regulus (not encrypted)", GAME_SUPPORTS_SAVE )
+GAME( 1984, mrviking, 0, sys1ppisx, mrviking, system1_state, mrviking, ROT270, "Sega", "Mister Viking (315-5041)", GAME_SUPPORTS_SAVE )
+GAME( 1984, mrvikingj, mrviking, sys1ppisx, mrvikingj, system1_state, mrviking, ROT270, "Sega", "Mister Viking (315-5041, Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1984, swat, 0, sys1ppix, swat, system1_state, swat, ROT270, "Coreland / Sega", "SWAT (315-5048)", GAME_SUPPORTS_SAVE )
+GAME( 1984, flickyo, flicky, sys1ppix, flicky, system1_state, flicky, ROT0, "Sega", "Flicky (64k Version, System 1, 315-5051, set 1)", GAME_SUPPORTS_SAVE )
+GAME( 1984, flickys1, flicky, sys1ppix, flickys1, system1_state, flicky, ROT0, "Sega", "Flicky (64k Version, System 1, 315-5051, set 2)", GAME_SUPPORTS_SAVE )
+GAME( 1984, wmatch, 0, sys1ppisx, wmatch, system1_state, wmatch, ROT270, "Sega", "Water Match (315-5064)", GAME_SUPPORTS_SAVE )
+GAME( 1984, bullfgt, 0, sys1ppix, bullfgt, system1_state, bullfgtj, ROT0, "Coreland / Sega", "Bullfight (315-5065)", GAME_SUPPORTS_SAVE )
+GAME( 1985, nprinces, seganinj, sys1ppix, seganinj, system1_state, flicky, ROT0, "bootleg?", "Ninja Princess (315-5051, 64k Ver. bootleg?)", GAME_SUPPORTS_SAVE )
+GAME( 1985, nprincesu, seganinj, sys1ppi, seganinj, system1_state, bank00, ROT0, "Sega", "Ninja Princess (64k Ver. not encrypted)", GAME_SUPPORTS_SAVE )
+GAME( 1986, wboy2, wboy, sys1ppix, wboy, system1_state, wboy2, ROT0, "Escape (Sega license)", "Wonder Boy (set 2, 315-5178)", GAME_SUPPORTS_SAVE )
+GAME( 1986, wboy2u, wboy, sys1ppi, wboy, system1_state, bank00, ROT0, "Escape (Sega license)", "Wonder Boy (set 2, not encrypted)", GAME_SUPPORTS_SAVE )
+GAME( 1986, wbdeluxe, wboy, sys1ppi, wbdeluxe, system1_state, bank00, ROT0, "Escape (Sega license)", "Wonder Boy Deluxe", GAME_SUPPORTS_SAVE )
+GAME( 1986, nob, 0, nobm, nob, system1_state, nob, ROT270, "Coreland / Data East Corporation", "Noboranka (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1986, nobb, nob, nob, nob, system1_state, nobb, ROT270, "bootleg (Game Electronics)", "Noboranka (Japan, bootleg)", GAME_SUPPORTS_SAVE )
/* PIO-based System 1 */
-GAME( 1984, flicky, 0, sys1pio, flicky, system1_state, flicky, ROT0, "Sega", "Flicky (128k Version, System 2, 315-5051)", GAME_SUPPORTS_SAVE )
-GAME( 1984, flickys2, flicky, sys1pio, flickys2, system1_state, bank00, ROT0, "Sega", "Flicky (128k Version, System 2, not encrypted)", GAME_SUPPORTS_SAVE )
-GAME( 1984, thetogyu, bullfgt, sys1pio, bullfgt, system1_state, bullfgtj, ROT0, "Coreland / Sega", "The Togyu (315-5065, Japan)", GAME_SUPPORTS_SAVE )
-GAME( 1984, spatter, 0, sys1pios, spatter, system1_state, spatter, ROT0, "Sega", "Spatter (set 1)", GAME_SUPPORTS_SAVE )
-GAME( 1984, spattera, spatter, sys1pios, spatter, system1_state, spatter, ROT0, "Sega", "Spatter (315-5099)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
-GAME( 1984, ssanchan, spatter, sys1pios, spatter, system1_state, spatter, ROT0, "Sega", "Sanrin San Chan (Japan)", GAME_SUPPORTS_SAVE )
-GAME( 1985, pitfall2, 0, sys1pio, pitfall2, system1_state, pitfall2, ROT0, "Sega", "Pitfall II (315-5093)", GAME_SUPPORTS_SAVE )
-GAME( 1985, pitfall2a, pitfall2, sys1pio, pitfall2, system1_state, pitfall2, ROT0, "Sega", "Pitfall II (315-5093, Flicky Conversion)", GAME_SUPPORTS_SAVE )
-GAME( 1985, pitfall2u, pitfall2, sys1pio, pitfall2u, system1_state, bank00, ROT0, "Sega", "Pitfall II (not encrypted)", GAME_SUPPORTS_SAVE )
-GAME( 1985, seganinj, 0, sys1pio, seganinj, system1_state, seganinj, ROT0, "Sega", "Sega Ninja (315-5102)", GAME_SUPPORTS_SAVE )
-GAME( 1985, seganinju, seganinj, sys1pio, seganinj, system1_state, bank00, ROT0, "Sega", "Sega Ninja (not encrypted)", GAME_SUPPORTS_SAVE )
-GAME( 1985, ninja, seganinj, sys1pio, seganinj, system1_state, seganinj, ROT0, "Sega", "Ninja (315-5102)", GAME_SUPPORTS_SAVE )
-GAME( 1985, nprinceso, seganinj, sys1pio, seganinj, system1_state, nprinces, ROT0, "Sega", "Ninja Princess (315-5098, 128k Ver.)", GAME_SUPPORTS_SAVE )
-GAME( 1985, nprincesb, seganinj, sys1pio, seganinj, system1_state, flicky, ROT0, "bootleg?", "Ninja Princess (315-5051?, 128k Ver. bootleg?)", GAME_SUPPORTS_SAVE )
-GAME( 1985, imsorry, 0, sys1pio, imsorry, system1_state, imsorry, ROT0, "Coreland / Sega", "I'm Sorry (315-5110, US)", GAME_SUPPORTS_SAVE )
-GAME( 1985, imsorryj, imsorry, sys1pio, imsorry, system1_state, imsorry, ROT0, "Coreland / Sega", "Gonbee no I'm Sorry (315-5110, Japan)", GAME_SUPPORTS_SAVE )
-GAME( 1985, teddybb, 0, sys1pio, teddybb, system1_state, teddybb, ROT0, "Sega", "TeddyBoy Blues (315-5115, New Ver.)", GAME_SUPPORTS_SAVE )
-GAME( 1985, teddybbo, teddybb, sys1pio, teddybb, system1_state, teddybb, ROT0, "Sega", "TeddyBoy Blues (315-5115, Old Ver.)", GAME_SUPPORTS_SAVE )
-GAME( 1985, teddybbobl, teddybb, sys1pio, teddybb, system1_state, teddybb, ROT0, "bootleg", "TeddyBoy Blues (Old Ver. bootleg)", GAME_SUPPORTS_SAVE )
-GAME( 1985, myhero, 0, sys1pio, myhero, system1_state, bank00, ROT0, "Coreland / Sega", "My Hero (US, not encrypted)", GAME_SUPPORTS_SAVE )
-GAME( 1985, sscandal, myhero, sys1pio, myhero, system1_state, myheroj, ROT0, "Coreland / Sega", "Seishun Scandal (315-5132, Japan)", GAME_SUPPORTS_SAVE )
-GAME( 1985, myherok, myhero, sys1pio, myhero, system1_state, myherok, ROT0, "Coreland / Sega", "My Hero (Korea)", GAME_SUPPORTS_SAVE )
-GAME( 1985, 4dwarrio, 0, sys1pio, 4dwarrio, system1_state, 4dwarrio, ROT0, "Coreland / Sega", "4-D Warriors (315-5162)", GAME_SUPPORTS_SAVE )
-GAME( 1986, raflesia, 0, sys1pio, raflesia, system1_state, 4dwarrio, ROT270, "Coreland / Sega", "Rafflesia (315-5162)", GAME_SUPPORTS_SAVE )
-GAME( 1986, wboy, 0, sys1pio, wboy, system1_state, wboy, ROT0, "Escape (Sega license)", "Wonder Boy (set 1, 315-5177)", GAME_SUPPORTS_SAVE )
-GAME( 1986, wboyo, wboy, sys1pio, wboy, system1_state, wboyo, ROT0, "Escape (Sega license)", "Wonder Boy (set 1, 315-5135)", GAME_SUPPORTS_SAVE )
-GAME( 1986, wboy3, wboy, sys1pio, wboy3, system1_state, wboyo, ROT0, "Escape (Sega license)", "Wonder Boy (set 3, 315-5135)", GAME_SUPPORTS_SAVE )
-GAME( 1986, wboy4, wboy, sys1pio, wboy, system1_state, 4dwarrio, ROT0, "Escape (Sega license)", "Wonder Boy (315-5162, 4-D Warriors Conversion)", GAME_SUPPORTS_SAVE )
-GAME( 1986, wboyu, wboy, sys1pio, wboyu, system1_state, bank00, ROT0, "Escape (Sega license)", "Wonder Boy (prototype?)", GAME_SUPPORTS_SAVE ) // appears to be a very early / unfinished version.
-GAME( 1986, wboy5, wboy, sys1pio, wboy3, system1_state, wboyo, ROT0, "bootleg", "Wonder Boy (set 5, bootleg)", GAME_SUPPORTS_SAVE )
-GAME( 1986, wboyub, wboy, sys1pio, wboy, system1_state, wboyo, ROT0, "bootleg", "Wonder Boy (US bootleg)", GAME_SUPPORTS_SAVE | GAME_NOT_WORKING )
-GAME( 1987, blockgal, 0, sys1pio, blockgal, system1_state, blockgal, ROT90, "Sega / Vic Tokai","Block Gal (MC-8123B, 317-0029)", GAME_SUPPORTS_SAVE)
+GAME( 1984, flicky, 0, sys1piox, flicky, system1_state, flicky, ROT0, "Sega", "Flicky (128k Version, System 2, 315-5051)", GAME_SUPPORTS_SAVE )
+GAME( 1984, flickys2, flicky, sys1pio, flickys2, system1_state, bank00, ROT0, "Sega", "Flicky (128k Version, System 2, not encrypted)", GAME_SUPPORTS_SAVE )
+GAME( 1984, thetogyu, bullfgt, sys1piox, bullfgt, system1_state, bullfgtj, ROT0, "Coreland / Sega", "The Togyu (315-5065, Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1984, spatter, 0, sys1piosx, spatter, system1_state, spatter, ROT0, "Sega", "Spatter (set 1)", GAME_SUPPORTS_SAVE )
+GAME( 1984, spattera, spatter, sys1piosx, spatter, system1_state, spatter, ROT0, "Sega", "Spatter (315-5099)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
+GAME( 1984, ssanchan, spatter, sys1piosx, spatter, system1_state, spatter, ROT0, "Sega", "Sanrin San Chan (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1985, pitfall2, 0, sys1piox, pitfall2, system1_state, pitfall2, ROT0, "Sega", "Pitfall II (315-5093)", GAME_SUPPORTS_SAVE )
+GAME( 1985, pitfall2a, pitfall2, sys1piox, pitfall2, system1_state, pitfall2, ROT0, "Sega", "Pitfall II (315-5093, Flicky Conversion)", GAME_SUPPORTS_SAVE )
+GAME( 1985, pitfall2u, pitfall2, sys1pio, pitfall2u, system1_state, bank00, ROT0, "Sega", "Pitfall II (not encrypted)", GAME_SUPPORTS_SAVE )
+GAME( 1985, seganinj, 0, sys1piox, seganinj, system1_state, seganinj, ROT0, "Sega", "Sega Ninja (315-5102)", GAME_SUPPORTS_SAVE )
+GAME( 1985, seganinju, seganinj, sys1pio, seganinj, system1_state, bank00, ROT0, "Sega", "Sega Ninja (not encrypted)", GAME_SUPPORTS_SAVE )
+GAME( 1985, ninja, seganinj, sys1piox, seganinj, system1_state, seganinj, ROT0, "Sega", "Ninja (315-5102)", GAME_SUPPORTS_SAVE )
+GAME( 1985, nprinceso, seganinj, sys1piox, seganinj, system1_state, nprinces, ROT0, "Sega", "Ninja Princess (315-5098, 128k Ver.)", GAME_SUPPORTS_SAVE )
+GAME( 1985, nprincesb, seganinj, sys1piox, seganinj, system1_state, flicky, ROT0, "bootleg?", "Ninja Princess (315-5051?, 128k Ver. bootleg?)", GAME_SUPPORTS_SAVE )
+GAME( 1985, imsorry, 0, sys1piox, imsorry, system1_state, imsorry, ROT0, "Coreland / Sega", "I'm Sorry (315-5110, US)", GAME_SUPPORTS_SAVE )
+GAME( 1985, imsorryj, imsorry, sys1piox, imsorry, system1_state, imsorry, ROT0, "Coreland / Sega", "Gonbee no I'm Sorry (315-5110, Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1985, teddybb, 0, sys1piox, teddybb, system1_state, teddybb, ROT0, "Sega", "TeddyBoy Blues (315-5115, New Ver.)", GAME_SUPPORTS_SAVE )
+GAME( 1985, teddybbo, teddybb, sys1piox, teddybb, system1_state, teddybb, ROT0, "Sega", "TeddyBoy Blues (315-5115, Old Ver.)", GAME_SUPPORTS_SAVE )
+GAME( 1985, teddybbobl, teddybb, sys1piox, teddybb, system1_state, teddybb, ROT0, "bootleg", "TeddyBoy Blues (Old Ver. bootleg)", GAME_SUPPORTS_SAVE )
+GAME( 1985, myhero, 0, sys1pio, myhero, system1_state, bank00, ROT0, "Coreland / Sega", "My Hero (US, not encrypted)", GAME_SUPPORTS_SAVE )
+GAME( 1985, sscandal, myhero, sys1piox, myhero, system1_state, myheroj, ROT0, "Coreland / Sega", "Seishun Scandal (315-5132, Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1985, myherok, myhero, sys1piox, myhero, system1_state, myherok, ROT0, "Coreland / Sega", "My Hero (Korea)", GAME_SUPPORTS_SAVE )
+GAME( 1985, 4dwarrio, 0, sys1piox, 4dwarrio, system1_state, 4dwarrio, ROT0, "Coreland / Sega", "4-D Warriors (315-5162)", GAME_SUPPORTS_SAVE )
+GAME( 1986, raflesia, 0, sys1piox, raflesia, system1_state, 4dwarrio, ROT270, "Coreland / Sega", "Rafflesia (315-5162)", GAME_SUPPORTS_SAVE )
+GAME( 1986, wboy, 0, sys1piox, wboy, system1_state, wboy, ROT0, "Escape (Sega license)", "Wonder Boy (set 1, 315-5177)", GAME_SUPPORTS_SAVE )
+GAME( 1986, wboyo, wboy, sys1piox, wboy, system1_state, wboyo, ROT0, "Escape (Sega license)", "Wonder Boy (set 1, 315-5135)", GAME_SUPPORTS_SAVE )
+GAME( 1986, wboy3, wboy, sys1piox, wboy3, system1_state, wboyo, ROT0, "Escape (Sega license)", "Wonder Boy (set 3, 315-5135)", GAME_SUPPORTS_SAVE )
+GAME( 1986, wboy4, wboy, sys1piox, wboy, system1_state, 4dwarrio, ROT0, "Escape (Sega license)", "Wonder Boy (315-5162, 4-D Warriors Conversion)", GAME_SUPPORTS_SAVE )
+GAME( 1986, wboyu, wboy, sys1pio, wboyu, system1_state, bank00, ROT0, "Escape (Sega license)", "Wonder Boy (prototype?)", GAME_SUPPORTS_SAVE ) // appears to be a very early / unfinished version.
+GAME( 1986, wboy5, wboy, sys1piox, wboy3, system1_state, wboyo, ROT0, "bootleg", "Wonder Boy (set 5, bootleg)", GAME_SUPPORTS_SAVE )
+GAME( 1986, wboyub, wboy, sys1piox, wboy, system1_state, wboyo, ROT0, "bootleg", "Wonder Boy (US bootleg)", GAME_SUPPORTS_SAVE | GAME_NOT_WORKING )
+GAME( 1987, blockgal, 0, sys1piox, blockgal, system1_state, blockgal, ROT90, "Sega / Vic Tokai","Block Gal (MC-8123B, 317-0029)", GAME_SUPPORTS_SAVE)
/* PIO-based System 1 with ROM banking */
-GAME( 1985, hvymetal, 0, sys1pio, hvymetal, system1_state, hvymetal, ROT0, "Sega", "Heavy Metal (315-5135)", GAME_SUPPORTS_SAVE )
-GAME( 1986, gardia, 0, sys1pio, gardia, system1_state, gardia, ROT270, "Coreland / Sega", "Gardia (317-0006)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE)
-GAME( 1986, brain, 0, sys1pio, brain, system1_state, bank44, ROT0, "Coreland / Sega", "Brain", GAME_SUPPORTS_SAVE )
+GAME( 1985, hvymetal, 0, sys1piox, hvymetal, system1_state, hvymetal, ROT0, "Sega", "Heavy Metal (315-5135)", GAME_SUPPORTS_SAVE )
+GAME( 1986, gardia, 0, sys1piox, gardia, system1_state, gardia, ROT270, "Coreland / Sega", "Gardia (317-0006)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE)
+GAME( 1986, brain, 0, sys1pio, brain, system1_state, bank44, ROT0, "Coreland / Sega", "Brain", GAME_SUPPORTS_SAVE )
/* System 2 */
-GAME( 1985, choplift, 0, sys2rowm, choplift, system1_state, choplift, ROT0, "Sega (licensed from Dan Gorlin)", "Choplifter (8751 315-5151)", GAME_SUPPORTS_SAVE )
-GAME( 1985, chopliftu, choplift, sys2row, choplift, system1_state, bank0c, ROT0, "Sega (licensed from Dan Gorlin)", "Choplifter (unprotected)", GAME_SUPPORTS_SAVE )
-GAME( 1985, chopliftbl, choplift, sys2row, choplift, system1_state, bank0c, ROT0, "bootleg", "Choplifter (bootleg)", GAME_SUPPORTS_SAVE )
-GAME( 1985, shtngmst, 0, sys2m, shtngmst, system1_state, shtngmst, ROT0, "Sega", "Shooting Master (8751 315-5159)", GAME_SUPPORTS_SAVE | GAME_NOT_WORKING )
-GAME( 1985, shtngmste, shtngmst, sys2m, shtngmst, system1_state, shtngmst, ROT0, "Sega / EVG", "Shooting Master (EVG, 8751 315-5159a)", GAME_SUPPORTS_SAVE )
-GAME( 1986, gardiab, gardia, sys2, gardia, system1_state, gardiab, ROT270, "bootleg", "Gardia (317-0007?, bootleg)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
-GAME( 1986, wboysys2, wboy, sys2, wboysys2, system1_state, wboysys2, ROT0, "Escape (Sega license)", "Wonder Boy (system 2)", GAME_SUPPORTS_SAVE )
-GAME( 1987, tokisens, 0, sys2, tokisens, system1_state, bank0c, ROT90, "Sega", "Toki no Senshi - Chrono Soldier", GAME_SUPPORTS_SAVE )
-GAME( 1987, wbml, 0, sys2, wbml, system1_state, wbml, ROT0, "Sega / Westone", "Wonder Boy in Monster Land (Japan New Ver., MC-8123, 317-0043)", GAME_SUPPORTS_SAVE )
-GAME( 1987, wbmljo, wbml, sys2, wbml, system1_state, wbml, ROT0, "Sega / Westone", "Wonder Boy in Monster Land (Japan Old Ver., MC-8123, 317-0043)", GAME_SUPPORTS_SAVE )
-GAME( 1987, wbmljb, wbml, sys2, wbml, system1_state, bootsys2, ROT0, "bootleg", "Wonder Boy in Monster Land (Japan bootleg)", GAME_SUPPORTS_SAVE )
-GAME( 1987, wbmlb, wbml, sys2, wbml, system1_state, bootsys2, ROT0, "bootleg", "Wonder Boy in Monster Land (English bootleg set 1)", GAME_SUPPORTS_SAVE)
-GAME( 1987, wbmlbg, wbml, sys2, wbml, system1_state, bootsys2, ROT0, "bootleg (Galaxy Electronics)", "Wonder Boy in Monster Land (English bootleg set 2)", GAME_SUPPORTS_SAVE )
-GAME( 1987, wbmlbge, wbml, sys2, wbml, system1_state, bootsys2, ROT0, "bootleg (Gecas)", "Wonder Boy in Monster Land (English bootleg set 3)", GAME_SUPPORTS_SAVE )
-GAME( 2009, wbmlvc, wbml, sys2, wbml, system1_state, bootsys2, ROT0, "Sega", "Wonder Boy in Monster Land (English, Virtual Console)", GAME_SUPPORTS_SAVE )
-GAME( 1987, dakkochn, 0, sys2, dakkochn, system1_state, dakkochn, ROT0, "White Board", "DakkoChan House (MC-8123B, 317-5014)", GAME_SUPPORTS_SAVE )
-GAME( 1987, blockgalb, blockgal, sys2, blockgal, system1_state, bootleg, ROT90, "bootleg", "Block Gal (bootleg)", GAME_SUPPORTS_SAVE )
-GAME( 1988, ufosensi, 0, sys2row, ufosensi, system1_state, ufosensi, ROT0, "Sega", "Ufo Senshi Yohko Chan (MC-8123, 317-0064)", GAME_SUPPORTS_SAVE )
-GAME( 1988, ufosensib, ufosensi, sys2row, ufosensi, system1_state, bootsys2, ROT0, "bootleg", "Ufo Senshi Yohko Chan (bootleg, not encrypted)", GAME_SUPPORTS_SAVE )
+GAME( 1985, choplift, 0, sys2rowm, choplift, system1_state, choplift, ROT0, "Sega (licensed from Dan Gorlin)", "Choplifter (8751 315-5151)", GAME_SUPPORTS_SAVE )
+GAME( 1985, chopliftu, choplift, sys2row, choplift, system1_state, bank0c, ROT0, "Sega (licensed from Dan Gorlin)", "Choplifter (unprotected)", GAME_SUPPORTS_SAVE )
+GAME( 1985, chopliftbl, choplift, sys2row, choplift, system1_state, bank0c, ROT0, "bootleg", "Choplifter (bootleg)", GAME_SUPPORTS_SAVE )
+GAME( 1985, shtngmst, 0, sys2m, shtngmst, system1_state, shtngmst, ROT0, "Sega", "Shooting Master (8751 315-5159)", GAME_SUPPORTS_SAVE | GAME_NOT_WORKING )
+GAME( 1985, shtngmste, shtngmst, sys2m, shtngmst, system1_state, shtngmst, ROT0, "Sega / EVG", "Shooting Master (EVG, 8751 315-5159a)", GAME_SUPPORTS_SAVE )
+GAME( 1986, gardiab, gardia, sys2x, gardia, system1_state, gardiab, ROT270, "bootleg", "Gardia (317-0007?, bootleg)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
+GAME( 1986, wboysys2, wboy, sys2x, wboysys2, system1_state, wboysys2, ROT0, "Escape (Sega license)", "Wonder Boy (system 2)", GAME_SUPPORTS_SAVE )
+GAME( 1987, tokisens, 0, sys2, tokisens, system1_state, bank0c, ROT90, "Sega", "Toki no Senshi - Chrono Soldier", GAME_SUPPORTS_SAVE )
+GAME( 1987, wbml, 0, sys2xb, wbml, system1_state, wbml, ROT0, "Sega / Westone", "Wonder Boy in Monster Land (Japan New Ver., MC-8123, 317-0043)", GAME_SUPPORTS_SAVE )
+GAME( 1987, wbmljo, wbml, sys2xb, wbml, system1_state, wbml, ROT0, "Sega / Westone", "Wonder Boy in Monster Land (Japan Old Ver., MC-8123, 317-0043)", GAME_SUPPORTS_SAVE )
+GAME( 1987, wbmljb, wbml, sys2xb, wbml, system1_state, bootsys2, ROT0, "bootleg", "Wonder Boy in Monster Land (Japan bootleg)", GAME_SUPPORTS_SAVE )
+GAME( 1987, wbmlb, wbml, sys2xb, wbml, system1_state, bootsys2, ROT0, "bootleg", "Wonder Boy in Monster Land (English bootleg set 1)", GAME_SUPPORTS_SAVE)
+GAME( 1987, wbmlbg, wbml, sys2xb, wbml, system1_state, bootsys2, ROT0, "bootleg (Galaxy Electronics)", "Wonder Boy in Monster Land (English bootleg set 2)", GAME_SUPPORTS_SAVE )
+GAME( 1987, wbmlbge, wbml, sys2xb, wbml, system1_state, bootsys2, ROT0, "bootleg (Gecas)", "Wonder Boy in Monster Land (English bootleg set 3)", GAME_SUPPORTS_SAVE )
+GAME( 2009, wbmlvc, wbml, sys2xb, wbml, system1_state, bootsys2, ROT0, "Sega", "Wonder Boy in Monster Land (English, Virtual Console)", GAME_SUPPORTS_SAVE )
+GAME( 1987, dakkochn, 0, sys2xb, dakkochn, system1_state, dakkochn, ROT0, "White Board", "DakkoChan House (MC-8123B, 317-5014)", GAME_SUPPORTS_SAVE )
+GAME( 1987, blockgalb, blockgal, sys2x, blockgal, system1_state, bootleg, ROT90, "bootleg", "Block Gal (bootleg)", GAME_SUPPORTS_SAVE )
+GAME( 1988, ufosensi, 0, sys2rowxb, ufosensi, system1_state, ufosensi, ROT0, "Sega", "Ufo Senshi Yohko Chan (MC-8123, 317-0064)", GAME_SUPPORTS_SAVE )
+GAME( 1988, ufosensib, ufosensi, sys2rowxb, ufosensi, system1_state, bootsys2, ROT0, "bootleg", "Ufo Senshi Yohko Chan (bootleg, not encrypted)", GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/system16.c b/src/mame/drivers/system16.c
index 692c99e659f..2c0723f6f18 100644
--- a/src/mame/drivers/system16.c
+++ b/src/mame/drivers/system16.c
@@ -625,6 +625,10 @@ static ADDRESS_MAP_START( bayrouteb1_map, AS_PROGRAM, 16, segas1x_bootleg_state
AM_RANGE(0x902002, 0x902003) AM_READ_PORT("DSW1")
ADDRESS_MAP_END
+static ADDRESS_MAP_START( decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 16, segas1x_bootleg_state )
+ AM_RANGE(0x000000, 0x0bffff) AM_ROM AM_SHARE("decrypted_opcodes")
+ADDRESS_MAP_END
+
void segas1x_bootleg_state::datsu_set_pages( )
{
UINT16 page;
@@ -2159,6 +2163,7 @@ static MACHINE_CONFIG_START( goldnaxeb1, segas1x_bootleg_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 10000000)
MCFG_CPU_PROGRAM_MAP(goldnaxeb1_map)
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", segas1x_bootleg_state, sys16_interrupt)
@@ -2187,6 +2192,7 @@ static MACHINE_CONFIG_DERIVED( goldnaxeb2, goldnaxeb1 )
/* basic machine hardware */
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(goldnaxeb2_map)
+ MCFG_DEVICE_REMOVE_ADDRESS_MAP(AS_DECRYPTED_OPCODES)
MACHINE_CONFIG_END
@@ -2202,6 +2208,7 @@ static MACHINE_CONFIG_DERIVED( bayrouteb2, goldnaxeb1 )
/* basic machine hardware */
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(bayrouteb2_map)
+ MCFG_DEVICE_REMOVE_ADDRESS_MAP(AS_DECRYPTED_OPCODES)
MCFG_FRAGMENT_ADD(system16_datsu_sound)
@@ -3462,29 +3469,24 @@ DRIVER_INIT_MEMBER(segas1x_bootleg_state,wb3bbl)
DRIVER_INIT_MEMBER(segas1x_bootleg_state,goldnaxeb1)
{
int i;
- UINT8 *ROM = memregion("maincpu")->base();
+ UINT16 *ROM = (UINT16 *)memregion("maincpu")->base();
UINT8 *KEY = memregion("decryption")->base();
- address_space &space = m_maincpu->space(AS_PROGRAM);
- UINT8 data[0x1000];
+ UINT16 data[0x800];
// the decryption key is in a rom (part of an MSDOS executable...)
for (i = 0; i < 0x800; i++)
{
- KEY[i] = KEY[i] ^ 0xff;
- data[(i * 2) + 0] = ((KEY[i] & 0x80) >> 1) | ((KEY[i] & 0x40) >> 2) | ((KEY[i] & 0x20) >> 3) | ((KEY[i] & 0x10) >> 4);
- data[(i * 2) + 1] = ((KEY[i] & 0x08) << 3) | ((KEY[i] & 0x04) << 2) | ((KEY[i] & 0x02) << 1) | ((KEY[i] & 0x01) << 0);
+ UINT8 k = KEY[i] ^ 0xff;
+ data[i] = ((k & 0x80) << 7) | ((k & 0x40) << 6) | ((k & 0x20) << 5) | ((k & 0x10) << 4) | ((k & 0x08) << 3) | ((k & 0x04) << 2) | ((k & 0x02) << 1) | ((k & 0x01) << 0);
}
- m_decrypted_region = auto_alloc_array(machine(), UINT8, 0xc0000);
- memcpy(m_decrypted_region, ROM, 0xc0000);
+ memcpy(m_decrypted_opcodes, ROM, 0xc0000);
- for (i = 0; i < 0x40000; i++)
+ for (i = 0; i < 0x20000; i++)
{
- m_decrypted_region[i] = ROM[i] ^ data[(i & 0xfff) ^ 1];
+ m_decrypted_opcodes[i] = ROM[i] ^ data[i & 0x7ff];
}
- space.set_decrypted_region(0x00000, 0xbffff, m_decrypted_region);
-
DRIVER_INIT_CALL(common);
m_spritebank_type = 1;
@@ -3499,23 +3501,20 @@ DRIVER_INIT_MEMBER(segas1x_bootleg_state,bayrouteb1)
//
// for now we use the code which is present in the unprotected bootleg set
// and modify the rom to use it
- UINT16 *ROM2;
- UINT16 *decrypted_region2;
// decrypt
DRIVER_INIT_CALL(goldnaxeb1);
- ROM2 = (UINT16*)memregion("maincpu")->base();
- decrypted_region2 = (UINT16*)m_decrypted_region;
+ UINT16 *ROM = (UINT16*)memregion("maincpu")->base();
// patch interrupt vector
- ROM2[0x0070/2] = 0x000b;
- ROM2[0x0072/2] = 0xf000;
+ ROM[0x0070/2] = 0x000b;
+ ROM[0x0072/2] = 0xf000;
// patch check for code in RAM
- decrypted_region2[0x107e/2] = 0x48e7;
- decrypted_region2[0x1080/2] = 0x000b;
- decrypted_region2[0x1082/2] = 0xf000;
+ m_decrypted_opcodes[0x107e/2] = 0x48e7;
+ m_decrypted_opcodes[0x1080/2] = 0x000b;
+ m_decrypted_opcodes[0x1082/2] = 0xf000;
}
DRIVER_INIT_MEMBER(segas1x_bootleg_state,bayrouteb2)
diff --git a/src/mame/drivers/taito_f2.c b/src/mame/drivers/taito_f2.c
index 562f64d8d28..80a69da57db 100644
--- a/src/mame/drivers/taito_f2.c
+++ b/src/mame/drivers/taito_f2.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:David Graves, Bryan McPhail, Brad Oliver, Andrew Prime, Brian Troha, Nicola Salmoria
/***************************************************************************
diff --git a/src/mame/drivers/taito_f3.c b/src/mame/drivers/taito_f3.c
index 7069f935676..a1b87821dab 100644
--- a/src/mame/drivers/taito_f3.c
+++ b/src/mame/drivers/taito_f3.c
@@ -1336,6 +1336,9 @@ ROM_START( scfinals ) /* This is the single PCB version */
ROM_LOAD16_BYTE("d49-04.38", 0x000000, 0x200000, CRC(44b365a9) SHA1(14c4a6b193a0069360406c74c500ba24f2a55b62) ) // C8 C9 CA CB
// half empty
ROM_LOAD16_BYTE("d49-05.41", 0x600000, 0x100000, CRC(ed894fe1) SHA1(5bf2fb6abdcf25bc525a2c3b29dbf7aca0b18fea) ) // -std-
+
+ ROM_REGION16_BE( 0x80, "eeprom", 0 )
+ ROM_LOAD( "scfinals.nv", 0x0000, 0x0080, CRC(f25945fc) SHA1(9eed644767b5bd2a13f9158e81c94fd36ba63d71) )
ROM_END
ROM_START( scfinalso ) /* Cart version */
@@ -1368,6 +1371,9 @@ ROM_START( scfinalso ) /* Cart version */
ROM_LOAD16_BYTE("d49-04.38", 0x000000, 0x200000, CRC(44b365a9) SHA1(14c4a6b193a0069360406c74c500ba24f2a55b62) ) // C8 C9 CA CB
// half empty
ROM_LOAD16_BYTE("d49-05.41", 0x600000, 0x100000, CRC(ed894fe1) SHA1(5bf2fb6abdcf25bc525a2c3b29dbf7aca0b18fea) ) // -std-
+
+ ROM_REGION16_BE( 0x80, "eeprom", 0 )
+ ROM_LOAD( "scfinalso.nv", 0x0000, 0x0080, CRC(1319752e) SHA1(7d1890ebc7d4e2074d3e820e3991b5c57756ad92) )
ROM_END
ROM_START( lightbr )
@@ -3828,14 +3834,6 @@ DRIVER_INIT_MEMBER(taito_f3_state,trstaroj)
DRIVER_INIT_MEMBER(taito_f3_state,scfinals)
{
- UINT32 *RAM = (UINT32 *)memregion("maincpu")->base();
-
- /* Doesn't boot without this - eprom related? */
- RAM[0x5af0/4]=0x4e710000|(RAM[0x5af0/4]&0xffff);
-
- /* Rom checksum error */
- RAM[0xdd0/4]=0x4e750000;
-
m_f3_game=SCFINALS;
tile_decode(machine());
}
diff --git a/src/mame/drivers/taito_h.c b/src/mame/drivers/taito_h.c
index f45f88b8202..c6940176889 100644
--- a/src/mame/drivers/taito_h.c
+++ b/src/mame/drivers/taito_h.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Yochizo
/***************************************************************************
diff --git a/src/mame/drivers/taito_x.c b/src/mame/drivers/taito_x.c
index 7b0aa2defaa..46bf1bb2e65 100644
--- a/src/mame/drivers/taito_x.c
+++ b/src/mame/drivers/taito_x.c
@@ -1054,7 +1054,7 @@ ROM_START( superman )
ROM_REGION( 0x80000, "ymsnd", 0 ) /* ADPCM samples */
ROM_LOAD( "b61-01.e18", 0x00000, 0x80000, CRC(3cf99786) SHA1(f6febf9bda87ca04f0a5890d0e8001c26dfa6c81) )
- ROM_REGION( 0x10000, "cchip", 0 ) /* 64k for TC0030CMD (C-Chip protection, Z80 with embedded 64K rom + 64K RAM) */
+ ROM_REGION( 0x10000, "cchip", 0 ) /* 64k for TC0030CMD (C-Chip protection, uPD78C11 with embedded 4K maskrom, 8k eprom, 8k RAM) */
ROM_LOAD( "b61_11.m11", 0x00000, 0x10000, NO_DUMP )
ROM_END
diff --git a/src/mame/drivers/taito_z.c b/src/mame/drivers/taito_z.c
index 459fb7ecdbf..2e641b04db5 100644
--- a/src/mame/drivers/taito_z.c
+++ b/src/mame/drivers/taito_z.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:David Graves
/***************************************************************************
diff --git a/src/mame/drivers/taitoair.c b/src/mame/drivers/taitoair.c
index 237616a349a..55a61decafe 100644
--- a/src/mame/drivers/taitoair.c
+++ b/src/mame/drivers/taitoair.c
@@ -121,7 +121,6 @@ Stephh's notes (based on the game M68000 code and some tests) :
TODO (TC0080VCO issues shared with TaitoH driver)
----
- - Need to implement BG1 : sprite priority. Currently not clear how this works.
- Fix sprite coordinates.
- Improve zoom y coordinate.
@@ -138,16 +137,15 @@ the TMS320C25 is being used as a co-processor to relieve the
along with the 68000.
Gradiation RAM is used to display a rotatable gradient background.
-The rotation is most likely handled by the TC0430GRW ROZ chip.
+The rotation is handled by the TC0430GRW ROZ chip which outputs
+coordinates for a X=a1+b1*x+c1*y, Y=a2+b2*x+c2*y mapping. The
+coordinates are used unconventionally as indices in a color palette.
"Power common ram" is for communication with a processor
controlling the sit-in-cabinet (deluxe mechanized version only).
The interface is similar to that used by Midnight Landing
and though undumped, the motor CPU program may be identical.
-[Offer dip-selectable kludge of the analogue stick inputs so that
-keyboard play is possible?]
-
Unknown control bits remain in the 0x140000 write.
@@ -160,15 +158,13 @@ DIPs are the same as topland, which is clearly wrong if you try
them ("SWB:7,8" do not set Coin B to multiple credits for each
coin!)
-Therefore, some verificiation could still be needed, once the
+Therefore, some verification could still be needed, once the
emulation is complete.
Topland
-------
-Sprite/tile priority bad.
-
After demo game in attract, palette seems too dark for a while.
Palette corruption has occurred with areas not restored after a fade.
Don't know why. (Perhaps 68000 relies on feedback from co-processor
@@ -186,38 +182,18 @@ discarded. But the cpu waits for a bit to be zero... some
sort of frame flag or some "ready" message from the 3d h/w
perhaps? The two writes seem to take only two values.
-
-Ainferno
---------
-
-Sprite/tile priority bad.
-
-More unmapped 320C25 reads and writes. This could be some sort of
-I/O device?? The MCU program is longer than the Topland one.
-
-cpu #2 (PC=000000C3): unmapped memory word write to 00006808 = 00FD & FFFF
-cpu #2 (PC=000000C8): unmapped memory word write to 00006810 = FF38 & FFFF
-cpu #2 (PC=000005A0): unmapped memory word write to 00006836 = 804E & FFFF
-cpu #2 (PC=000005B2): unmapped memory word write to 00006830 = FFFF & FFFF
-cpu #2 (PC=000005B5): unmapped memory word write to 00006832 = FFFE & FFFF
-cpu #2 (PC=000005B8): unmapped memory word write to 00006834 = FBCA & FFFF
-cpu #2 (PC=000005B9): unmapped memory word read from 00006836 & FFFF
-cpu #2 (PC=000005CC): unmapped memory word write to 00006830 = FFFF & FFFF
-cpu #2 (PC=000005CF): unmapped memory word write to 00006832 = FFFE & FFFF
-cpu #2 (PC=000005D2): unmapped memory word write to 00006834 = FBCA & FFFF
-cpu #2 (PC=000005D3): unmapped memory word read from 00006836 & FFFF
-cpu #2 (PC=000005E6): unmapped memory word write to 00006830 = FFFF & FFFF
-cpu #2 (PC=000005E9): unmapped memory word write to 00006832 = FFFE & FFFF
-cpu #2 (PC=000005EC): unmapped memory word write to 00006834 = FC8F & FFFF
-cpu #2 (PC=000005ED): unmapped memory word read from 00006836 & FFFF
-cpu #2 (PC=00000600): unmapped memory word write to 00006830 = FFFF & FFFF
-cpu #2 (PC=00000603): unmapped memory word write to 00006832 = FFFE & FFFF
-cpu #2 (PC=00000606): unmapped memory word write to 00006834 = FC8F & FFFF
-cpu #2 (PC=00000607): unmapped memory word read from 00006836 & FFFF
-cpu #2 (PC=00000609): unmapped memory word read from 00006838 & FFFF
-cpu #2 (PC=0000060E): unmapped memory word read from 0000683A & FFFF
-
****************************************************************************/
+/*!
+ @todo - Framebuffer DMA requires palette switch to be selected dynamically, see at first stage Course Select in Top Landing.
+ My gut feeling is that 3d poly fill operation actually copies to internal buffer then a DMA op actually do the buffer-to-screen copy, including gradiation ROZ too;
+ - Air Inferno: missing landing monitor camera (blackened);
+ - Air Inferno: missing 3d HUD graphics;
+ - Air Inferno: Expert course has wrong 3d geometry;
+ - Air Inferno: Almost surely crashing during replay has missing smoke effect, looks quit odd atm.
+ - Top Landing: Night stages might have wrong priority for stars-above-sea;
+ - Input limiters / analog thresholds for both games;
+ - Special thanks to syq for being a cunt.
+ */
#include "emu.h"
#include "cpu/z80/z80.h"
@@ -241,6 +217,7 @@ WRITE16_MEMBER(taitoair_state::system_control_w)
m_dsp->set_input_line(INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE);
+ m_gradbank = (data & 0x40);
logerror("68K:%06x writing %04x to TMS32025. %s HOLD , %s RESET\n", space.device().safe_pcbase(), data, ((data & 4) ? "Clear" : "Assert"), ((data & 1) ? "Clear" : "Assert"));
}
@@ -313,15 +290,6 @@ WRITE16_MEMBER(taitoair_state::airsys_gradram_w)
g = (g << 1) | (g & 1);
b = (b << 1) | (b & 1);
- /* TODO: I'm sure that normal paletteram and gradiation ram mixes in some way ... */
- //pal_r = ((m_paletteram[(offset >> 7) + 0x300] & 0x000f) >> 0) * 0x11;
- //pal_g = ((m_paletteram[(offset >> 7) + 0x300] & 0x01e0) >> 5) * 0x11;
- //pal_b = ((m_paletteram[(offset >> 7) + 0x300] & 0x7c00) >> 10) * 0x11;
-
- //if(r == 0) { r = (pal_r); }
- //if(g == 0) { g = (pal_g); }
- //if(b == 0) { b = (pal_b); }
-
m_palette->set_pen_color(offset+0x2000, r, g, b);
}
@@ -376,6 +344,33 @@ WRITE8_MEMBER(taitoair_state::sound_bankswitch_w)
membank("z80bank")->set_entry(data & 3);
}
+/*!
+ @brief Framebuffer DMA control
+ @regs [0] x--- ---- ---- ---- copy framebuffer to the screen
+ [0] --x- ---- ---- ---- unknown, used on POST test
+ [0] 1001 1111 1111 1111 used by Air Inferno after erase op, erase -> copy?
+ [0] 0001 1111 1111 1111 erase op?
+ [1] xxxx xxxx xxxx xxxx fill value? 0xffff by Top Landing, 0x0000 Air Inferno
+ [2] (unused)
+ [3] both games uses 0xb7, most likely a register setting.
+*/
+WRITE16_MEMBER(taitoair_state::dma_regs_w)
+{
+ printf("%08x %04x\n",offset,data);
+
+ if(offset == 0 && ACCESSING_BITS_8_15)
+ {
+ if(data == 0x1fff)
+ {
+ fb_erase_op();
+ }
+ else if(data & 0x8000)
+ {
+ /*! @todo it also flushes current palette. */
+ fb_copy_op();
+ }
+ }
+}
/***********************************************************
MEMORY STRUCTURES
@@ -385,13 +380,13 @@ static ADDRESS_MAP_START( airsys_map, AS_PROGRAM, 16, taitoair_state )
AM_RANGE(0x000000, 0x0bffff) AM_ROM
AM_RANGE(0x0c0000, 0x0cffff) AM_RAM AM_SHARE("m68000_mainram")
AM_RANGE(0x140000, 0x140001) AM_WRITE(system_control_w) /* Pause the TMS32025 */
- AM_RANGE(0x180000, 0x187fff) AM_RAM_WRITE(airsys_gradram_w) AM_SHARE("gradram") /* "gradiation ram (0/1)" */
+ AM_RANGE(0x180000, 0x187fff) AM_RAM_WRITE(airsys_gradram_w) AM_SHARE("gradram") /* "gradiation ram (0/1)" */
AM_RANGE(0x188000, 0x189fff) AM_MIRROR(0x2000) AM_RAM_WRITE(airsys_paletteram16_w) AM_SHARE("paletteram")
AM_RANGE(0x800000, 0x820fff) AM_DEVREADWRITE("tc0080vco", tc0080vco_device, word_r, word_w) /* tilemaps, sprites */
- AM_RANGE(0x906000, 0x906007) AM_RAM // DMA?
+ AM_RANGE(0x906000, 0x906007) AM_WRITE(dma_regs_w) // DMA?
AM_RANGE(0x908000, 0x90ffff) AM_RAM AM_SHARE("line_ram") /* "line ram" */
AM_RANGE(0x910000, 0x91ffff) AM_RAM AM_SHARE("dsp_ram") /* "dsp common ram" (TMS320C25) */
- AM_RANGE(0x980000, 0x98000f) AM_RAM AM_SHARE("backregs") /* TC0430GRW? */
+ AM_RANGE(0x980000, 0x98000f) AM_RAM AM_SHARE("tc0430grw") /* TC0430GRW roz transform coefficients */
AM_RANGE(0xa00000, 0xa00007) AM_READ(stick_input_r)
AM_RANGE(0xa00100, 0xa00107) AM_READ(stick2_input_r)
AM_RANGE(0xa00200, 0xa0020f) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_device, read, write, 0x00ff) /* other I/O */
@@ -418,33 +413,101 @@ ADDRESS_MAP_END
/********************************** TMS32025 ********************************/
-/*
-Air Inferno:
+WRITE16_MEMBER(taitoair_state::dsp_test_start_w)
+{
+ m_dsp_test_object_type = data;
+ m_dsp_test_or_clip = 0;
+ m_dsp_test_and_clip = 0xf;
+}
-write to 0x3404 - almost always 0x00fd / 0xff38 (253, -200)
-write to 0x3408 /
+WRITE16_MEMBER(taitoair_state::dsp_test_x_w)
+{
+ m_dsp_test_x = data;
+}
-write to 0x341b - May not be numeric - it's weird. stays stable,
- then freaks out just before "quad: unknown value 0066"
- This function seems to break things up into different polygon
- 'classes'
+WRITE16_MEMBER(taitoair_state::dsp_test_y_w)
+{
+ m_dsp_test_y = data;
+}
-write to 0x3418 - X value
-write to 0x3419 - Y value
-write to 0x341a - Z value
-read to 0x341b, puts data to internal RAM 0x380 - 0x384 - 0x388 - 0x38c
+WRITE16_MEMBER(taitoair_state::dsp_test_z_w)
+{
+ m_dsp_test_z = data;
+}
-checks 0x341c - if != to 0 then skip ... ?
-checks 0x341d - if == to 0 then skip ... ?
+READ16_MEMBER(taitoair_state::dsp_test_point_r)
+{
+ UINT16 r = 0;
+ if(m_dsp_test_x < -m_dsp_test_z)
+ r |= 1;
+ if(m_dsp_test_x > m_dsp_test_z)
+ r |= 2;
+ if(m_dsp_test_y < -m_dsp_test_z)
+ r |= 4;
+ if(m_dsp_test_y > m_dsp_test_z)
+ r |= 8;
+
+ m_dsp_test_or_clip |= r;
+ m_dsp_test_and_clip &= r;
+ return r;
+}
-write to 0x3405 ; X value
-write to 0x3409 ; Y value
-write to 0x3406 ; Z value
-write to 0x340a ; Z value
-read to 0x340b, puts to line RAM (y) with offset + 0x160
-read to 0x3407, puts to line RAM (x) with offset + 0x5d
+READ16_MEMBER(taitoair_state::dsp_test_or_clip_r)
+{
+ return m_dsp_test_or_clip;
+}
+
+READ16_MEMBER(taitoair_state::dsp_test_and_clip_r)
+{
+ return m_dsp_test_and_clip;
+}
+
+WRITE16_MEMBER(taitoair_state::dsp_muldiv_a_1_w)
+{
+ m_dsp_muldiv_a_1 = data;
+}
+
+WRITE16_MEMBER(taitoair_state::dsp_muldiv_b_1_w)
+{
+ m_dsp_muldiv_b_1 = data;
+}
+
+WRITE16_MEMBER(taitoair_state::dsp_muldiv_c_1_w)
+{
+ m_dsp_muldiv_c_1 = data;
+}
+
+READ16_MEMBER(taitoair_state::dsp_muldiv_1_r)
+{
+ if(m_dsp_muldiv_c_1 == 0)
+ return 0xffff; /**< @todo true value? */
+
+ return m_dsp_muldiv_a_1*m_dsp_muldiv_b_1/m_dsp_muldiv_c_1;
+}
+
+WRITE16_MEMBER(taitoair_state::dsp_muldiv_a_2_w)
+{
+ m_dsp_muldiv_a_2 = data;
+}
+
+WRITE16_MEMBER(taitoair_state::dsp_muldiv_b_2_w)
+{
+ m_dsp_muldiv_b_2 = data;
+}
+
+WRITE16_MEMBER(taitoair_state::dsp_muldiv_c_2_w)
+{
+ m_dsp_muldiv_c_2 = data;
+}
+
+READ16_MEMBER(taitoair_state::dsp_muldiv_2_r)
+{
+ if(m_dsp_muldiv_c_2 == 0)
+ return 0xffff; /**< @todo true value? */
+
+ return m_dsp_muldiv_a_2*m_dsp_muldiv_b_2/m_dsp_muldiv_c_2;
+}
-*/
static ADDRESS_MAP_START( DSP_map_program, AS_PROGRAM, 16, taitoair_state )
AM_RANGE(0x0000, 0x1fff) AM_ROM
@@ -453,18 +516,23 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( DSP_map_data, AS_DATA, 16, taitoair_state )
AM_RANGE(0x2003, 0x2003) AM_READNOP //bit 0 DMA status flag or vblank
AM_RANGE(0x3000, 0x3002) AM_WRITE(dsp_flags_w)
- AM_RANGE(0x3404, 0x3404) AM_WRITE(dsp_frustum_left_w)
- AM_RANGE(0x3405, 0x3405) AM_WRITE(dsp_x_eyecoord_w)
- AM_RANGE(0x3406, 0x3406) AM_WRITE(dsp_z_eyecoord_w)
- AM_RANGE(0x3407, 0x3407) AM_READ(dsp_x_return_r)
- AM_RANGE(0x3408, 0x3408) AM_WRITE(dsp_frustum_bottom_w)
- AM_RANGE(0x3409, 0x3409) AM_WRITE(dsp_y_eyecoord_w)
- AM_RANGE(0x340a, 0x340a) AM_WRITE(dsp_rasterize_w) /* Just a (lame) guess */
- AM_RANGE(0x340b, 0x340b) AM_READ(dsp_y_return_r)
-// AM_RANGE(0x3418, 0x341a) AM_WRITE(dsp_sqrt_w)
-// AM_RANGE(0x341b, 0x341b) AM_WRITE(dsp_sqrt_r)
-// AM_RANGE(0x341c, 0x341c) AM_READ(dsp_sqrt_flags1_r)
-// AM_RANGE(0x341d, 0x341d) AM_READ(dsp_sqrt_flags2_r)
+ AM_RANGE(0x3404, 0x3404) AM_WRITE(dsp_muldiv_a_1_w)
+ AM_RANGE(0x3405, 0x3405) AM_WRITE(dsp_muldiv_b_1_w)
+ AM_RANGE(0x3406, 0x3406) AM_WRITE(dsp_muldiv_c_1_w)
+ AM_RANGE(0x3407, 0x3407) AM_READ(dsp_muldiv_1_r)
+
+ AM_RANGE(0x3408, 0x3408) AM_WRITE(dsp_muldiv_a_2_w)
+ AM_RANGE(0x3409, 0x3409) AM_WRITE(dsp_muldiv_b_2_w)
+ AM_RANGE(0x340a, 0x340a) AM_WRITE(dsp_muldiv_c_2_w)
+ AM_RANGE(0x340b, 0x340b) AM_READ(dsp_muldiv_2_r)
+
+ AM_RANGE(0x3418, 0x3418) AM_WRITE(dsp_test_x_w)
+ AM_RANGE(0x3419, 0x3419) AM_WRITE(dsp_test_y_w)
+ AM_RANGE(0x341a, 0x341a) AM_WRITE(dsp_test_z_w)
+ AM_RANGE(0x341b, 0x341b) AM_READWRITE(dsp_test_point_r, dsp_test_start_w)
+ AM_RANGE(0x341c, 0x341c) AM_READ(dsp_test_and_clip_r)
+ AM_RANGE(0x341d, 0x341d) AM_READ(dsp_test_or_clip_r)
+
AM_RANGE(0x4000, 0x7fff) AM_READWRITE(lineram_r, lineram_w)
AM_RANGE(0x8000, 0xffff) AM_READWRITE(dspram_r, dspram_w)
ADDRESS_MAP_END
@@ -524,10 +592,10 @@ static INPUT_PORTS_START( topland )
PORT_BIT( 0x00ff, 0x0000, IPT_AD_STICK_Z ) PORT_MINMAX(0x0080,0x007f) PORT_SENSITIVITY(30) PORT_KEYDELTA(40) PORT_PLAYER(1) PORT_REVERSE
PORT_START(STICK2_PORT_TAG)
- PORT_BIT( 0xffff, 0x0000, IPT_AD_STICK_X ) PORT_MINMAX(0xf800,0x07ff) PORT_SENSITIVITY(30) PORT_KEYDELTA(40) PORT_PLAYER(1)
+ PORT_BIT( 0x0fff, 0x0000, IPT_AD_STICK_X ) PORT_MINMAX(0x00800, 0x07ff) PORT_SENSITIVITY(100) PORT_KEYDELTA(20) PORT_PLAYER(1)
PORT_START(STICK3_PORT_TAG)
- PORT_BIT( 0xffff, 0x0000, IPT_AD_STICK_Y ) PORT_MINMAX(0xf800,0x07ff) PORT_SENSITIVITY(30) PORT_KEYDELTA(40) PORT_PLAYER(1)
+ PORT_BIT( 0x0fff, 0x0000, IPT_AD_STICK_Y ) PORT_MINMAX(0x00800, 0x07ff) PORT_SENSITIVITY(100) PORT_KEYDELTA(20) PORT_PLAYER(1)
INPUT_PORTS_END
static INPUT_PORTS_START( ainferno )
@@ -584,10 +652,10 @@ static INPUT_PORTS_START( ainferno )
PORT_BIT( 0x00ff, 0x0000, IPT_AD_STICK_Z ) PORT_MINMAX(0x0080,0x007f) PORT_SENSITIVITY(30) PORT_KEYDELTA(40) PORT_PLAYER(1) PORT_REVERSE
PORT_START(STICK2_PORT_TAG)
- PORT_BIT( 0xffff, 0x0000, IPT_AD_STICK_X ) PORT_MINMAX(0xf800,0x7ff) PORT_SENSITIVITY(30) PORT_KEYDELTA(40) PORT_PLAYER(1)
+ PORT_BIT( 0x0fff, 0x0000, IPT_AD_STICK_X ) PORT_MINMAX(0x00800, 0x07ff) PORT_SENSITIVITY(100) PORT_KEYDELTA(20) PORT_PLAYER(1)
PORT_START(STICK3_PORT_TAG)
- PORT_BIT( 0xffff, 0x0000, IPT_AD_STICK_Y ) PORT_MINMAX(0xf800,0x7ff) PORT_SENSITIVITY(30) PORT_KEYDELTA(40) PORT_PLAYER(1)
+ PORT_BIT( 0x0fff, 0x0000, IPT_AD_STICK_Y ) PORT_MINMAX(0x00800, 0x07ff) PORT_SENSITIVITY(100) PORT_KEYDELTA(20) PORT_PLAYER(1)
INPUT_PORTS_END
@@ -634,7 +702,7 @@ void taitoair_state::machine_start()
{
membank("z80bank")->configure_entries(0, 4, memregion("audiocpu")->base(), 0x4000);
- save_item(NAME(m_q.col));
+ save_item(NAME(m_q.header));
save_item(NAME(m_q.pcount));
for (int i = 0; i < TAITOAIR_POLY_MAX_PT; i++)
@@ -685,7 +753,7 @@ static MACHINE_CONFIG_START( airsys, taitoair_state )
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
- MCFG_SCREEN_SIZE(64*16, 64*16)
+ MCFG_SCREEN_SIZE(64*16, 32*16)
MCFG_SCREEN_VISIBLE_AREA(0*16, 32*16-1, 3*16, 28*16-1)
MCFG_SCREEN_UPDATE_DRIVER(taitoair_state, screen_update_taitoair)
MCFG_SCREEN_PALETTE("palette")
@@ -892,6 +960,6 @@ ROM_END
/* ( YEAR NAME PARENT MACHINE INPUT INIT MONITOR COMPANY FULLNAME */
-GAME( 1988, topland, 0, airsys, topland, driver_device, 0, ROT0, "Taito Corporation Japan", "Top Landing (World)", GAME_NOT_WORKING )
+GAME( 1988, topland, 0, airsys, topland, driver_device, 0, ROT0, "Taito Corporation Japan", "Top Landing (World)", GAME_IMPERFECT_GRAPHICS )
GAME( 1990, ainferno, 0, airsys, ainferno, driver_device, 0, ROT0, "Taito America Corporation", "Air Inferno (US)", GAME_NOT_WORKING )
GAME( 1990, ainfernoj,ainferno, airsys, ainferno, driver_device, 0, ROT0, "Taito Corporation Japan", "Air Inferno (Japan)", GAME_NOT_WORKING )
diff --git a/src/mame/drivers/taitottl.c b/src/mame/drivers/taitottl.c
index 244e991f942..c1327509c02 100644
--- a/src/mame/drivers/taitottl.c
+++ b/src/mame/drivers/taitottl.c
@@ -5,54 +5,57 @@
Taito Discrete Hardware Games
- Game Name(s) Part #'s Data PROM/ROM Chip Numbers
- ---------------------------------------------------------+--------------+---------+---------------------------------------
- Astro Race (11/1973) UNKNOWN
- Attack (09/1976) UNKNOWN
- Attack UFO (08/1974) UNKNOWN
- Avenger (??/1976) (clone of Electra's Avenger) UNKNOWN
- Ball Park/TT Ball Park (??/1974) UNKNOWN
- Basketball (04/1974) UNKNOWN
- Bombs Away (??/1977) UNKNOWN
- Cisco/Fisco 400 (04/1977) UNKNOWN
- Clean Sweep (??/1976) (clone of Ramtek's Clean Sweep) UNKNOWN
- Clean Sweep II (??/1976) (clone of Ramtek's Clean Sweep) UNKNOWN
- Crashing Race (06/1976) UNKNOWN
- Cross Fire (08/1977) (aka Bazooka) UNKNOWN
- Davis Cup (12/1973) UNKNOWN
- Dead Heat (??/1975) UNKNOWN
- Elepong (07/1973) UNKNOWN
- Flying Fortress (??/1977) UNKNOWN
- Flying Fortress II (06/1977) UNKNOWN
- Gunman (10/1977) YES 8 x 32bytes (or 11? )
- Interceptor (03/1976) UNKNOWN
- Missile-X (??/1977) YES 10 - (5 x 512bytes, 5x32bytes)
- Pro Hockey (11/1973) UNKNOWN
- Road Champion (04/1977) UNKNOWN
- Road Champion S (06/1977) UNKNOWN
- Soccer (11/1973) UNKNOWN
- Soccer DX (??/1977) UNKNOWN
- Speed Race (11/1974) UNKNOWN
- Speed Race CL-5 (10/1978) UNKNOWN
- Speed Race Color (10/1978) UNKNOWN
- Speed Race DX (08/1975) UNKNOWN
- Speed Race Twin (04/1976) UNKNOWN
- Speed Race GP-5 (??/1980) UNKNOWN
- Super Block (02/1978) UNKNOWN
- Super Speed Race (12/1977) UNKNOWN
- Super Speed Race V (07/1978) UNKNOWN
- Super Speed Race GP-V (??/1980) UNKNOWN
- Table Football (??/1977) UNKNOWN
- Tahitian (??/1975) UNKNOWN
- Tennis (??/1977) UNKNOWN
- T. T. Block (08/1977) YES 1 x 2048bytes
- T. T. Block C (05/1978) UNKNOWN
- T. T. Block CU (08/1978) UNKNOWN
- T. T. Speed Race (??/1978) UNKNOWN
- Wall Block (08/1978) UNKNOWN
- Wall Break (01/1977) UNKNOWN
- Western Gun (09/1975) UNKNOWN
- Zun Zun Block (04/1979) YES 3 - (2 x 512bytes, 1 x 32bytes)
+ Game Name(s) Part #'s Data PROM/ROM Chip Numbers
+ ----------------------------------------------------------------+--------------+---------+---------------------------------------
+ Astro Race (11/1973) (clone of Atari's Space Race) UNKNOWN
+ Anti-Aircraft (1975) (clone of Atari's Anti-Aircraft) YES
+ Attack (09/1976) UNKNOWN
+ Attack UFO (08/1974) UNKNOWN
+ Avenger (??/1976) (clone of Electra's Avenger) YES
+ Ball Park/TT Ball Park (??/1974) (clone of Midway's Ball Park) YES
+ Basketball (04/1974) (clone of Midway's TV Basketball) YES
+ Bombs Away (??/1977) (clone of Meadows' Bombs Away) YES
+ Cisco/Fisco 400 (04/1977) UNKNOWN
+ Clean Sweep (??/1976) (clone of Ramtek's Clean Sweep) YES
+ Clean Sweep II (??/1976) (clone of Ramtek's Clean Sweep) YES
+ Crashing Race (06/1976) (clone of Atari's Crash'n Score?) UNKNOWN
+ Cross Fire (08/1977) (clone of PSE's Bazooka) YES
+ Davis Cup (12/1973) (clone of Atari's Coupe Davis / Pong Doubles?) UNKNOWN
+ Dead Heat (??/1975) UNKNOWN
+ Elepong (07/1973) UNKNOWN
+ Flying Fortress (??/1977) (clone of Electra's Flying Fortress?) UNKNOWN
+ Flying Fortress II (06/1977) UNKNOWN
+ Gunman (10/1977) YES 8 x 32bytes (or 11? )
+ Interceptor (03/1976) UNKNOWN
+ Missile-X (??/1977) YES 10 - (5 x 512bytes, 5x32bytes)
+ Pro Hockey (11/1973) UNKNOWN
+ Road Champion (04/1977) (clone of Williams' Road Champion?) UNKNOWN
+ Road Champion S (06/1977) UNKNOWN
+ Soccer (11/1973) UNKNOWN
+ Soccer DX (??/1977) UNKNOWN
+ Speed Race (11/1974) UNKNOWN
+ Speed Race CL-5 (10/1978) UNKNOWN
+ Speed Race Color (10/1978) UNKNOWN
+ Speed Race DX (08/1975) UNKNOWN
+ Speed Race Twin (04/1976) UNKNOWN
+ Speed Race GP-5 (??/1980) UNKNOWN
+ Super Block (02/1978) UNKNOWN
+ Super High-Way (10/1977)? UNKNOWN
+ Super Speed Race (12/1977) UNKNOWN
+ Super Speed Race V (07/1978) UNKNOWN
+ Super Speed Race GP-V (??/1980) UNKNOWN
+ Table Football (??/1977) (clone of Exidy's Table Football?) UNKNOWN
+ Tahitian (??/1975) UNKNOWN
+ Tennis (??/1977) UNKNOWN
+ T. T. Ball Park (??/1974) (clone of Midway's Ball Park) YES
+ T. T. Block (08/1977) YES 1 x 2048bytes
+ T. T. Block C (05/1978) UNKNOWN
+ T. T. Block CU (08/1978) UNKNOWN
+ T. T. Speed Race (??/1978) UNKNOWN
+ Wall Block (08/1978) UNKNOWN
+ Wall Break (01/1977) UNKNOWN
+ Western Gun (09/1975) UNKNOWN
+ Zun Zun Block (04/1979) YES 3 - (2 x 512bytes, 1 x 32bytes)
***************************************************************************/
diff --git a/src/mame/drivers/taitotz.c b/src/mame/drivers/taitotz.c
index 5c3c9865404..0ef77c8a859 100644
--- a/src/mame/drivers/taitotz.c
+++ b/src/mame/drivers/taitotz.c
@@ -652,7 +652,7 @@ private:
POLY_V = 2,
POLY_NX = 3,
POLY_NY = 4,
- POLY_NZ = 5,
+ POLY_NZ = 5
};
//static const float ZBUFFER_MAX = 10000000000.0f;
diff --git a/src/mame/drivers/tapatune.c b/src/mame/drivers/tapatune.c
index 2f5e6ec3da9..f2e0978f2d8 100644
--- a/src/mame/drivers/tapatune.c
+++ b/src/mame/drivers/tapatune.c
@@ -54,14 +54,15 @@ class tapatune_state : public driver_device
public:
tapatune_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
- m_videocpu(*this, "videocpu"),
m_maincpu(*this, "maincpu"),
+ m_videocpu(*this, "videocpu"),
m_bsmt(*this, "bsmt"),
m_videoram(*this, "videoram") {}
- optional_device<cpu_device> m_videocpu;
required_device<cpu_device> m_maincpu;
+ optional_device<cpu_device> m_videocpu;
required_device<bsmt2000_device> m_bsmt;
+
optional_shared_ptr<UINT16> m_videoram;
UINT8 m_paletteram[0x300];
@@ -589,5 +590,5 @@ ROM_END
*
*************************************/
-GAME(1994, tapatune, 0, tapatune, tapatune, driver_device, 0, ROT0, "Moloney Manufacturing Inc. / Creative Electronics and Software", "Tap a Tune", 0 )
-GAME(1994, srockbwl, 0, tapatune_base, tapatune, driver_device, 0, ROT0, "Bromley", "Super Rock and Bowl (V1.1)", GAME_IS_SKELETON_MECHANICAL )
+GAME(1994, tapatune, 0, tapatune, tapatune, driver_device, 0, ROT0, "Moloney Manufacturing Inc. / Creative Electronics and Software", "Tap a Tune", GAME_SUPPORTS_SAVE )
+GAME(1994, srockbwl, 0, tapatune_base, tapatune, driver_device, 0, ROT0, "Bromley", "Super Rock and Bowl (V1.1)", GAME_IS_SKELETON_MECHANICAL | GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/tcl.c b/src/mame/drivers/tcl.c
index 2c975602f4d..48a5b93c25f 100644
--- a/src/mame/drivers/tcl.c
+++ b/src/mame/drivers/tcl.c
@@ -173,7 +173,6 @@ DRIVER_INIT_MEMBER(tcl_state,tcl)
{
/* only the first part is decrypted (and verified)*/
- address_space &space = m_maincpu->space(AS_PROGRAM);
UINT8 *dest = memregion("maincpu")->base();
int len = memregion("maincpu")->bytes();
dynamic_buffer src(len);
@@ -197,8 +196,6 @@ DRIVER_INIT_MEMBER(tcl_state,tcl)
WRITEDEST((src[idx]^0x11)^0xf0); // abcdefgh -> ABCdefgH
}
}
-
- space.set_decrypted_region(0x0000, 0x7fff, dest+0x10000);
}
GAME( 1995, tcl, 0, tcl, tcl, tcl_state, tcl, ROT0, "Uniwang", "Taiwan Chess Legend", GAME_NOT_WORKING )
diff --git a/src/mame/drivers/thedealr.c b/src/mame/drivers/thedealr.c
new file mode 100644
index 00000000000..c67f752bdf6
--- /dev/null
+++ b/src/mame/drivers/thedealr.c
@@ -0,0 +1,586 @@
+// license:BSD-3-Clause
+// copyright-holders:Luca Elia
+/***************************************************************************
+
+ The Dealer (Visco Games)
+
+ Driver by Luca Elia
+ This game runs on Seta Hardware
+
+ P0-040A PCB:
+
+ R65C02P2 x 2
+ X0-009 (Intel 8742 MCU?)
+
+ X1-001
+ X1-002
+ X1-003
+ X1-004
+ X1-006
+
+ Yamaha YM2149F
+
+ MC68B50P ACIA
+
+ DSW8 x 4, Reset Button
+ CR2032 3V Battery
+ XTAL 16MHz
+
+***************************************************************************/
+
+#include "emu.h"
+#include "cpu/m6502/r65c02.h"
+#include "video/seta001.h"
+#include "sound/ay8910.h"
+#include "machine/nvram.h"
+
+class thedealr_state : public driver_device
+{
+public:
+ thedealr_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_subcpu(*this, "subcpu"),
+ m_seta001(*this, "spritegen"),
+ m_palette(*this, "palette")
+ { }
+
+ // devices
+ required_device<cpu_device> m_maincpu;
+ required_device<cpu_device> m_subcpu;
+ required_device<seta001_device> m_seta001;
+ required_device<palette_device> m_palette;
+
+ // IOX
+ DECLARE_READ8_MEMBER(iox_r);
+ DECLARE_WRITE8_MEMBER(iox_w);
+ DECLARE_READ8_MEMBER(iox_status_r);
+ UINT8 m_iox_cmd, m_iox_ret, m_iox_status, m_iox_leds, m_iox_coins;
+ void iox_reset();
+
+ // memory map
+ DECLARE_READ8_MEMBER(irq_ack_r);
+ DECLARE_WRITE8_MEMBER(unk_w);
+
+ // machine
+ DECLARE_MACHINE_START(thedealr);
+ DECLARE_MACHINE_RESET(thedealr);
+ TIMER_DEVICE_CALLBACK_MEMBER(thedealr_interrupt);
+
+ // video
+ DECLARE_PALETTE_INIT(thedealr);
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ void screen_eof(screen_device &screen, bool state);
+};
+
+/***************************************************************************
+
+ Video
+
+***************************************************************************/
+
+PALETTE_INIT_MEMBER(thedealr_state,thedealr)
+{
+ const UINT8 *color_prom = memregion("proms")->base();
+
+ for (int i = 0; i < palette.entries(); i++)
+ {
+ int col = (color_prom[i] << 8) + color_prom[i + 512];
+ palette.set_pen_color(i, pal5bit(col >> 10), pal5bit(col >> 5), pal5bit(col >> 0));
+ }
+}
+
+UINT32 thedealr_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+{
+ bitmap.fill(0x1f0, cliprect);
+
+ m_seta001->set_bg_yoffsets( 0x11+1, -0x10 ); // + is up (down with flip)
+ m_seta001->set_fg_yoffsets( -0x12+1, -0x01 );
+
+ m_seta001->draw_sprites(screen, bitmap, cliprect, 0x1000, 1);
+ return 0;
+}
+
+void thedealr_state::screen_eof(screen_device &screen, bool state)
+{
+ // rising edge
+ if (state)
+ m_seta001->setac_eof();
+}
+
+/***************************************************************************
+
+ IOX (i8742 MCU?) Simulation
+
+***************************************************************************/
+
+#define IOX_OUT_FULL 0x01
+#define IOX_IN_FULL 0x02
+#define IOX_WAITDATA 0x80
+
+void thedealr_state::iox_reset()
+{
+ m_iox_status = 0x00;
+ m_iox_ret = 0x00;
+ m_iox_cmd = 0xff;
+ m_iox_leds = 0x00;
+ m_iox_coins = 0x00;
+}
+
+MACHINE_RESET_MEMBER(thedealr_state,thedealr)
+{
+ iox_reset();
+}
+
+// 3400
+READ8_MEMBER(thedealr_state::iox_r)
+{
+ UINT8 ret = m_iox_ret;
+ m_iox_status &= ~IOX_OUT_FULL;
+
+ logerror("%s: IOX read %02X\n", machine().describe_context(), ret);
+ return ret;
+}
+WRITE8_MEMBER(thedealr_state::iox_w)
+{
+ if (m_iox_status & IOX_WAITDATA)
+ {
+ m_iox_status &= ~IOX_WAITDATA;
+ logerror("%s: IOX data %02X <- %02X\n", machine().describe_context(), m_iox_cmd, data);
+
+ switch (m_iox_cmd)
+ {
+ case 0x20: // leds
+ m_iox_leds = data;
+ set_led_status(machine(), 0, data & 0x01); // bet
+ set_led_status(machine(), 1, data & 0x02); // deal
+ set_led_status(machine(), 2, data & 0x04);
+ set_led_status(machine(), 3, data & 0x08);
+ set_led_status(machine(), 4, data & 0x10); // hold 1-5?
+ set_led_status(machine(), 5, data & 0x20);
+ set_led_status(machine(), 6, data & 0x40);
+ set_led_status(machine(), 7, data & 0x80);
+ break;
+
+ case 0x40: // coin counters
+ m_iox_coins = data;
+ coin_counter_w(machine(), 0, (~data) & 0x02); // coin1 or service coin
+ coin_counter_w(machine(), 1, (~data) & 0x04); // coupon
+ coin_counter_w(machine(), 2, (~data) & 0x08); // service coin
+ coin_counter_w(machine(), 3, (~data) & 0x10); // coin-out
+ if ((~data) & 0xe1)
+ logerror("%s: unknown bits written to command %02X: %02X\n", machine().describe_context(), m_iox_cmd, data);
+ break;
+
+ default:
+ logerror("%s: data for unknown command written %02X = %02X\n", machine().describe_context(), m_iox_cmd, data);
+ break;
+ }
+
+// popmessage("LED: %02X COIN: %02X", m_iox_leds, m_iox_coins);
+ }
+ else
+ {
+ m_iox_cmd = data;
+ logerror("%s: IOX command %02X\n", machine().describe_context(), m_iox_cmd);
+
+ switch (m_iox_cmd)
+ {
+ case 0x01: // inputs?
+ {
+ UINT16 buttons = ioport("IOX")->read();
+ m_iox_ret = 0;
+ for (int i = 0; i < 16; ++i)
+ {
+ if (buttons & (1<<i))
+ {
+ m_iox_ret = i + 1;
+ break;
+ }
+ }
+ m_iox_status |= IOX_OUT_FULL;
+ break;
+ }
+
+// case 0x04: // ? at boot
+
+ case 0x08: // return iox version
+ m_iox_ret = 0x54;
+ m_iox_status |= IOX_OUT_FULL;
+ break;
+
+ case 0x20: // leds
+ m_iox_status |= IOX_WAITDATA;
+ break;
+
+ case 0x40: // coin counters
+ m_iox_status |= IOX_WAITDATA;
+ break;
+
+ case 0x80: // store param?
+ m_iox_status |= IOX_WAITDATA;
+ break;
+
+ case 0x81: // store param?
+ m_iox_status |= IOX_WAITDATA;
+ break;
+
+ case 0xff: // reset
+ iox_reset();
+ break;
+
+ default:
+ logerror("%s: IOX unknown command %02X\n", machine().describe_context(), m_iox_cmd);
+ }
+ }
+}
+
+// 3401
+READ8_MEMBER(thedealr_state::iox_status_r)
+{
+ // bit 0 - Out buff full?
+ // bit 1 - In buff full?
+ // bit 7 - Ready for more data?
+ return m_iox_status;
+}
+
+/***************************************************************************
+
+ Memory Maps - Main CPU
+
+***************************************************************************/
+
+READ8_MEMBER(thedealr_state::irq_ack_r)
+{
+ m_maincpu->set_input_line(INPUT_LINE_IRQ0, CLEAR_LINE);
+ return 0;
+}
+
+WRITE8_MEMBER(thedealr_state::unk_w)
+{
+ // bit 1 - ? 1 during game
+ // bit 2 - ? 0 during game
+ // bit 3 - ? 1 during game
+ // bit 7 - ? 0 during game
+// popmessage("UNK %02x", data);
+}
+
+static ADDRESS_MAP_START( thedealr, AS_PROGRAM, 8, thedealr_state )
+ AM_RANGE(0x0000, 0x07ff) AM_RAM AM_SHARE("nvram")
+
+ AM_RANGE(0x2000, 0x2000) AM_RAM // w ff at boot (after clearing commram)
+
+ AM_RANGE(0x2400, 0x2400) AM_READ(irq_ack_r) // r = irq ack.
+ AM_RANGE(0x2400, 0x2400) AM_WRITE(unk_w) // w = ?
+
+ AM_RANGE(0x2800, 0x2800) AM_READ_PORT("COINS") AM_WRITENOP // rw
+
+ AM_RANGE(0x2801, 0x2801) AM_READ_PORT("DSW4")
+ AM_RANGE(0x2c00, 0x2c00) AM_READ_PORT("DSW3")
+
+ AM_RANGE(0x3400, 0x3400) AM_READWRITE(iox_r, iox_w)
+ AM_RANGE(0x3401, 0x3401) AM_READ(iox_status_r)
+
+ AM_RANGE(0x3000, 0x3000) AM_RAM // rw, comm in test mode
+ AM_RANGE(0x3001, 0x3001) AM_RAM // rw, ""
+
+ AM_RANGE(0x3800, 0x3bff) AM_RAM AM_SHARE("commram")
+
+ AM_RANGE(0x3c00, 0x3c00) AM_DEVREADWRITE("aysnd", ay8910_device, data_r, address_w)
+ AM_RANGE(0x3c01, 0x3c01) AM_DEVWRITE ("aysnd", ay8910_device, data_w)
+
+ AM_RANGE(0x8000, 0x8000) AM_WRITE(watchdog_reset_w)
+ AM_RANGE(0x8000, 0xffff) AM_ROM AM_REGION("maincpu", 0)
+ADDRESS_MAP_END
+
+/***************************************************************************
+
+ Memory Maps - Sub CPU
+
+***************************************************************************/
+
+static ADDRESS_MAP_START( thedealr_sub, AS_PROGRAM, 8, thedealr_state )
+ // Work RAM
+ AM_RANGE(0x0000, 0x00ff) AM_RAM
+ AM_RANGE(0x0100, 0x01ff) AM_RAM
+
+ // Sprites
+ AM_RANGE(0x0800, 0x27ff) AM_RAM AM_DEVREADWRITE("spritegen", seta001_device, spritecodelow_r8, spritecodelow_w8)
+ AM_RANGE(0x2800, 0x3fff) AM_RAM AM_DEVREADWRITE("spritegen", seta001_device, spritecodehigh_r8, spritecodehigh_w8)
+ AM_RANGE(0x4000, 0x42ff) AM_RAM AM_DEVREADWRITE("spritegen", seta001_device, spriteylow_r8, spriteylow_w8)
+ AM_RANGE(0x4300, 0x4303) AM_DEVWRITE("spritegen", seta001_device, spritectrl_w8)
+ AM_RANGE(0x4800, 0x4800) AM_DEVWRITE("spritegen", seta001_device, spritebgflag_w8) // enable / disable background transparency
+
+ // Comm RAM
+ AM_RANGE(0x5800, 0x5bff) AM_RAM AM_SHARE("commram")
+
+ // ROM
+ AM_RANGE(0x6000, 0x7fff) AM_ROM AM_REGION("subcpu", 0x0000)
+ AM_RANGE(0x8000, 0xffff) AM_ROM AM_REGION("subcpu", 0x8000)
+ADDRESS_MAP_END
+
+/***************************************************************************
+
+ Input Ports
+
+***************************************************************************/
+
+static INPUT_PORTS_START( thedealr )
+ PORT_START("IOX")
+ PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_POKER_HOLD5 ) // HL5 (hold 5)
+ PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_GAMBLE_HALF ) // 1/2 (half gamble)
+ PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_GAMBLE_LOW ) PORT_NAME("Small") // SML (small)
+ PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_NAME("Reset") // RST (reset)
+ PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_GAMBLE_KEYOUT ) // PAY
+ PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_SERVICE2 ) // (unused?)
+ PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_POKER_BET ) // BET (bet)
+ PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_POKER_CANCEL ) // MET (cancel? keep pressed to show stats)
+ PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_GAMBLE_HIGH ) PORT_NAME("Big") // BIG (big)
+ PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_GAMBLE_D_UP ) // D.U (double up?)
+ PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_GAMBLE_DEAL ) PORT_NAME("Deal / Draw") // D.D (deal/draw, advance in test mode, trigger leds)
+ PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_GAMBLE_TAKE ) // T.S (take score?)
+ PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_POKER_HOLD4 ) // HL4 (hold 4)
+ PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_POKER_HOLD3 ) // HL3 (hold 3)
+ PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_POKER_HOLD2 ) // HL2 (hold 2)
+ PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_POKER_HOLD1 ) // HL1 (hold 1)
+ // DRP in test mode is an optional (via DSW) coin drop sensor?
+
+ PORT_START("COINS")
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE3 ) PORT_NAME("MSN?") // !MSN
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE4 ) PORT_NAME("Attendant Clear?") // !ACL (reset jackpots, only if there are no credits)
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) // A.P (attendant payout? clears credits, port 0 = ef)
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_TILT ) // TLT (tilt)
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SPECIAL ) // HOV (hopper?)
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) // CPN (coupon, port 3 = fb)
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(5) // CS2
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) // CS1 (coin1, port 3 = fd)
+
+ PORT_START("DSW1")
+ PORT_DIPNAME( 0x07, 0x07, "SW1:1,2,3" ) PORT_DIPLOCATION("SW1:1,2,3") // table at EEFC
+ PORT_DIPSETTING( 0x07, "0" )
+ PORT_DIPSETTING( 0x06, "1" )
+ PORT_DIPSETTING( 0x05, "2" )
+ PORT_DIPSETTING( 0x04, "3" )
+ PORT_DIPSETTING( 0x03, "4" )
+ PORT_DIPSETTING( 0x02, "5" )
+ PORT_DIPSETTING( 0x01, "6" )
+ PORT_DIPSETTING( 0x00, "7" )
+ PORT_DIPNAME( 0x18, 0x18, "SW1:4,5" ) PORT_DIPLOCATION("SW1:4,5")
+ PORT_DIPSETTING( 0x18, "0" )
+ PORT_DIPSETTING( 0x10, "1" )
+ PORT_DIPSETTING( 0x08, "2" )
+ PORT_DIPSETTING( 0x00, "3" )
+ PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW1:6" )
+/*
+ Switches 7 & 8 control the payout as follows:
+
+ Off/Off Off/On On/Off On/On Notes
+ ---------------------------------------------------------------------------------------------
+Jackpot MB 5000 5000 5000 2000 Ryl Flush bonus at Max Bet
+ Jackpot 2500 2500 2500 1000 Ryl Flush bonus at 5 coins + 500 (or 200) per coin up to Max Bet
+ Mini JP 1500 1500 1000 500 Str Flush bonus at Max Bet
+ Ryl Flush 500 500 500 200 x Bet
+ Str Flush 150 150 100 50 x Bet
+ 4K 60 60 40 25 x Bet
+Full House 10 10 10 8 x Bet
+ Flush 7 6 7 6 x Bet
+ Straight 5 5 5 5 x Bet
+ 3K 3 3 3 4 x Bet
+ Two pair 2 2 2 2 x Bet
+ Jacks+ 1 1 1 1 x Bet (When enabled - DSW 3-2)
+
+Return Rate 111.9% 110.7% 106.6% 105.8% Jacks or Better
+Return Rate 94.7% 92.9% 89.4% 87.8% Two Pair
+
+NOTE: Jackpot & Mini Jackpot values based on 10 Coin Max Bet. Values increase with higher Max Bet values.
+
+Calculated returns based on 1 coin bet and paytable as shown above, Two Pair through Royal Flush without bonuses.
+*/
+ PORT_DIPNAME( 0xc0, 0xc0, "Payout Percentage" ) PORT_DIPLOCATION("SW1:7,8")
+ PORT_DIPSETTING( 0x00, "87.8%" ) PORT_CONDITION("DSW3", 0x02, EQUALS, 0x02)
+ PORT_DIPSETTING( 0x40, "89.4%" ) PORT_CONDITION("DSW3", 0x02, EQUALS, 0x02)
+ PORT_DIPSETTING( 0x80, "92.9%" ) PORT_CONDITION("DSW3", 0x02, EQUALS, 0x02)
+ PORT_DIPSETTING( 0xc0, "94.7%" ) PORT_CONDITION("DSW3", 0x02, EQUALS, 0x02)
+ PORT_DIPSETTING( 0x00, "105.8%" ) PORT_CONDITION("DSW3", 0x02, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x40, "106.6%" ) PORT_CONDITION("DSW3", 0x02, EQUALS, 0x00)
+ PORT_DIPSETTING( 0x80, "110.7%" ) PORT_CONDITION("DSW3", 0x02, EQUALS, 0x00)
+ PORT_DIPSETTING( 0xc0, "111.9%" ) PORT_CONDITION("DSW3", 0x02, EQUALS, 0x00)
+
+ PORT_START("DSW2")
+ PORT_SERVICE_DIPLOC( 0x01, IP_ACTIVE_LOW, "SW2:1" )
+ PORT_DIPNAME( 0x06, 0x06, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW2:2,3")
+ PORT_DIPSETTING( 0x06, DEF_STR( 1C_1C ) )
+ PORT_DIPSETTING( 0x04, DEF_STR( 1C_2C ) )
+ PORT_DIPSETTING( 0x02, DEF_STR( 1C_5C ) )
+ PORT_DIPSETTING( 0x00, "1 Coin/10 Credits" )
+ PORT_DIPNAME( 0x18, 0x18, "SW2:4,5" ) PORT_DIPLOCATION("SW2:4,5")
+ PORT_DIPSETTING( 0x18, "0" )
+ PORT_DIPSETTING( 0x10, "1" )
+ PORT_DIPSETTING( 0x08, "2" )
+ PORT_DIPSETTING( 0x00, "3" )
+ PORT_DIPNAME( 0xe0, 0xe0, "Max Bet" ) PORT_DIPLOCATION("SW2:6,7,8")
+ PORT_DIPSETTING( 0xc0, "5" )
+ PORT_DIPSETTING( 0xe0, "10" )
+ PORT_DIPSETTING( 0xa0, "20" )
+ PORT_DIPSETTING( 0x80, "20 Duplicate" )
+ PORT_DIPSETTING( 0x40, "30" )
+ PORT_DIPSETTING( 0x00, "30 Duplicate" )
+ PORT_DIPSETTING( 0x60, "60" )
+ PORT_DIPSETTING( 0x20, "60 Duplicate" )
+
+ PORT_START("DSW3")
+ PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "SW3:1" )
+ PORT_DIPNAME( 0x02, 0x02, "Lowest Paid Hand" ) PORT_DIPLOCATION("SW3:2")
+ PORT_DIPSETTING( 0x02, "Two Pair" )
+ PORT_DIPSETTING( 0x00, "Jacks or Better" )
+ PORT_DIPNAME( 0x04, 0x04, "Double Up" ) PORT_DIPLOCATION("SW3:3")
+ PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( On ) )
+ PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW3:4" )
+ PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW3:5" )
+/*
+Fever Mode:
+ Overrides Jacks or Better
+ 3 of a Kind winning hand Jacks or higher enters Fever Mode
+ You start with a pair of your 3 of a Kind cards & you draw 3 cards each hand.
+ Jacks through Kings get 5 Fever Mode Draws
+ Aces get 15 Fever Mode Draws
+*/
+ PORT_DIPNAME( 0x20, 0x20, "Fever Mode" ) PORT_DIPLOCATION("SW3:6")
+ PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( On ) )
+ PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW3:7" ) /* Overrides Coinage - 1C / 1C */
+ PORT_DIPNAME( 0x80, 0x80, "Coin In / Coin Out" ) PORT_DIPLOCATION("SW3:8") /* No credit - payout waiting for hopper??? */
+ PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( On ) )
+
+ PORT_START("DSW4")
+ PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "SW4:7" ) // X in service mode
+ PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW4:8" ) // ""
+ PORT_DIPNAME( 0x04, 0x04, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW4:1")
+ PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( On ) )
+ PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW4:2" ) // "Excess switch time" error
+ PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW4:3" )
+ PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW4:4" )
+ PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW4:5" )
+ PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW4:6" )
+INPUT_PORTS_END
+
+/***************************************************************************
+
+ Graphics Layouts
+
+***************************************************************************/
+
+// The bitplanes are separated (but there are 2 per rom)
+static const gfx_layout layout_planes_2roms =
+{
+ 16,16,
+ RGN_FRAC(1,2),
+ 4,
+ {RGN_FRAC(1,2)+8, RGN_FRAC(1,2)+0, 8, 0},
+ {0,1,2,3,4,5,6,7, 128,129,130,131,132,133,134,135},
+ {0*16,1*16,2*16,3*16,4*16,5*16,6*16,7*16,
+ 16*16,17*16,18*16,19*16,20*16,21*16,22*16,23*16 },
+ 16*16*2
+};
+
+static GFXDECODE_START( thedealr )
+ GFXDECODE_ENTRY( "gfx1", 0, layout_planes_2roms, 0, 32 )
+GFXDECODE_END
+
+/***************************************************************************
+
+ Machine Drivers
+
+***************************************************************************/
+
+MACHINE_START_MEMBER(thedealr_state,thedealr)
+{
+ save_item(NAME(m_iox_status));
+ save_item(NAME(m_iox_ret));
+ save_item(NAME(m_iox_cmd));
+ save_item(NAME(m_iox_leds));
+ save_item(NAME(m_iox_coins));
+}
+
+/*
+ It takes $19 IRQs to cycle through the IOX routines (read version/inputs, write outputs).
+ With a single IRQ per frame this would translate to acknowledging inputs only every 0.4 seconds!
+ Hence we generate more IRQs than that in a frame. Besides, with a single VBLANK IRQ,
+ the two 65C02 fail to sync properly on boot with error $26 and/or $27 (commram[0]) !?
+*/
+TIMER_DEVICE_CALLBACK_MEMBER(thedealr_state::thedealr_interrupt)
+{
+ int scanline = param;
+
+ if((scanline % 8) == 0)
+ m_maincpu->set_input_line(INPUT_LINE_IRQ0, ASSERT_LINE);
+}
+
+static MACHINE_CONFIG_START( thedealr, thedealr_state )
+
+ // basic machine hardware
+ MCFG_CPU_ADD("maincpu", R65C02, XTAL_16MHz/8) // 2 MHz?
+ MCFG_CPU_PROGRAM_MAP(thedealr)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", thedealr_state, thedealr_interrupt, "screen", 0, 1)
+
+ MCFG_CPU_ADD("subcpu", R65C02, XTAL_16MHz/8) // 2 MHz?
+ MCFG_CPU_PROGRAM_MAP(thedealr_sub)
+ MCFG_CPU_VBLANK_INT_DRIVER("screen", thedealr_state, nmi_line_pulse)
+
+ MCFG_NVRAM_ADD_0FILL("nvram")
+
+ MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0)
+ MCFG_SETA001_SPRITE_GFXDECODE("gfxdecode")
+ MCFG_SETA001_SPRITE_PALETTE("palette")
+
+ MCFG_MACHINE_RESET_OVERRIDE(thedealr_state,thedealr)
+ MCFG_MACHINE_START_OVERRIDE(thedealr_state,thedealr)
+
+ // video hardware
+ MCFG_SCREEN_ADD("screen", RASTER)
+ MCFG_SCREEN_REFRESH_RATE(60)
+ MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
+ MCFG_SCREEN_SIZE(512, 256)
+ MCFG_SCREEN_VISIBLE_AREA(0, 384-1, 0+30, 256-1)
+ MCFG_SCREEN_UPDATE_DRIVER(thedealr_state, screen_update)
+ MCFG_SCREEN_VBLANK_DRIVER(thedealr_state, screen_eof)
+ MCFG_SCREEN_PALETTE("palette")
+
+ MCFG_GFXDECODE_ADD("gfxdecode", "palette", thedealr)
+ MCFG_PALETTE_ADD("palette", 512)
+ MCFG_PALETTE_INIT_OWNER(thedealr_state,thedealr)
+
+ // sound hardware
+ MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SOUND_ADD("aysnd", YM2149, XTAL_16MHz/8) // 2 MHz?
+ MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW2"))
+ MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSW1"))
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+MACHINE_CONFIG_END
+
+/***************************************************************************
+
+ ROMs Loading
+
+***************************************************************************/
+
+ROM_START( thedealr )
+ ROM_REGION( 0x8000, "maincpu", 0 )
+ ROM_LOAD( "xb4_002", 0x00000, 0x08000, CRC(022fc8c4) SHA1(f29909ac22df9390f5bc1dec5f4dc5ae2c4d2e61) )
+
+ ROM_REGION( 0x10000, "subcpu", 0 )
+ ROM_LOAD( "xb3_002", 0x00000, 0x10000, CRC(53a37fa4) SHA1(2adfea2dd08f298cda885bc72606d03f8af886a0) )
+
+ ROM_REGION( 0x100000, "gfx1", 0 )
+ ROM_LOAD( "xb0-002-w45.u42", 0x00000, 0x80000, CRC(41ec6a57) SHA1(d3f0508d5f4054fd2b0ee5227325a95fd1272aad) )
+ ROM_LOAD( "xb0-001-w44.u41", 0x80000, 0x80000, CRC(bdaca555) SHA1(5ae1dc1514993fd804a101182735d5fb6815f720) )
+
+ ROM_REGION( 0x0400, "proms", 0 )
+ ROM_LOAD( "xb0-u65.u65", 0x000, 0x200, CRC(5969a133) SHA1(f92f17949c1974d779d31741afd137f9217af3b9) )
+ ROM_LOAD( "xb0-u68.u68", 0x200, 0x200, CRC(c0c54d43) SHA1(5ce352fb888c8e683014c73e6da00ec95f2ae572) )
+ROM_END
+
+GAME( 1988?, thedealr, 0, thedealr, thedealr, driver_device, 0, ROT0, "Visco Games", "The Dealer (Visco)", GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/thunderx.c b/src/mame/drivers/thunderx.c
index 4aff5b7d41f..89b9124a30e 100644
--- a/src/mame/drivers/thunderx.c
+++ b/src/mame/drivers/thunderx.c
@@ -649,7 +649,7 @@ static MACHINE_CONFIG_START( scontra, thunderx_state )
MCFG_SCREEN_REFRESH_RATE(59.17) /* verified on pcb */
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
MCFG_SCREEN_SIZE(64*8, 32*8)
- MCFG_SCREEN_VISIBLE_AREA(14*8, (64-14)*8-1, 2*8, 30*8-1 )
+ MCFG_SCREEN_VISIBLE_AREA(12*8, (64-12)*8-1, 2*8, 30*8-1 ) /* verified on scontra and thunderx PCBs */
MCFG_SCREEN_UPDATE_DRIVER(thunderx_state, screen_update)
MCFG_SCREEN_PALETTE("palette")
diff --git a/src/mame/drivers/timeplt.c b/src/mame/drivers/timeplt.c
index 77a299ca5b4..4032228bb3d 100644
--- a/src/mame/drivers/timeplt.c
+++ b/src/mame/drivers/timeplt.c
@@ -699,7 +699,8 @@ GAME( 1982, timeplt, 0, timeplt, timeplt, driver_device, 0, ROT90, "Kona
GAME( 1982, timepltc, timeplt, timeplt, timeplt, driver_device, 0, ROT90, "Konami (Centuri license)", "Time Pilot (Centuri)", GAME_SUPPORTS_SAVE )
GAME( 1982, timeplta, timeplt, timeplt, timeplt, driver_device, 0, ROT90, "Konami (Atari license)", "Time Pilot (Atari)", GAME_SUPPORTS_SAVE )
GAME( 1982, spaceplt, timeplt, timeplt, timeplt, driver_device, 0, ROT90, "bootleg", "Space Pilot", GAME_SUPPORTS_SAVE )
+
GAME( 1988, psurge, 0, psurge, psurge, driver_device, 0, ROT270, "Vision Electronics", "Power Surge", GAME_SUPPORTS_SAVE )
-// ROM says manufactured by Peni Soft for these two ... no, I'm not going to add THAT -.-"
-GAME( 1988, chkun, 0, chkun, chkun, driver_device, 0, ROT90, "<unknown>", "Chance Kun (Japan)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND )
-GAME( 1987, bikkuric, 0, bikkuric,bikkuric, driver_device,0, ROT90, "<unknown>", "Bikkuri Card (Japan)", GAME_SUPPORTS_SAVE )
+
+GAME( 1988, chkun, 0, chkun, chkun, driver_device, 0, ROT90, "Peni", "Chance Kun (Japan)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND )
+GAME( 1987, bikkuric, 0, bikkuric,bikkuric, driver_device,0, ROT90, "Peni", "Bikkuri Card (Japan)", GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/tmaster.c b/src/mame/drivers/tmaster.c
index bf8a1312cc5..162e2c49ecc 100644
--- a/src/mame/drivers/tmaster.c
+++ b/src/mame/drivers/tmaster.c
@@ -227,7 +227,7 @@ WRITE_LINE_MEMBER(tmaster_state::write_oki_bank1)
WRITE_LINE_MEMBER(tmaster_state::duart_irq_handler)
{
m_maincpu->set_input_line_and_vector(4, state, m_duart->get_irq_vector());
-};
+}
/***************************************************************************
diff --git a/src/mame/drivers/tmnt.c b/src/mame/drivers/tmnt.c
index 9127510ddf4..7dab98b981e 100644
--- a/src/mame/drivers/tmnt.c
+++ b/src/mame/drivers/tmnt.c
@@ -2084,7 +2084,7 @@ static MACHINE_CONFIG_START( tmnt, tmnt_state )
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
MCFG_SCREEN_SIZE(64*8, 32*8)
//MCFG_SCREEN_VISIBLE_AREA(13*8, (64-13)*8-1, 2*8, 30*8-1 )
- MCFG_SCREEN_VISIBLE_AREA(13*8-8, (64-13)*8-1+8, 2*8, 30*8-1 )
+ MCFG_SCREEN_VISIBLE_AREA(12*8, (64-12)*8-1, 2*8, 30*8-1 )
MCFG_SCREEN_UPDATE_DRIVER(tmnt_state, screen_update_tmnt)
MCFG_SCREEN_PALETTE("palette")
// We see something strange in the left 8 pixels and the right 8 pixels, but it is same as real PCB.
@@ -2198,7 +2198,7 @@ static MACHINE_CONFIG_START( lgtnfght, tmnt_state )
MCFG_SCREEN_REFRESH_RATE(60)
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
MCFG_SCREEN_SIZE(64*8, 32*8)
- MCFG_SCREEN_VISIBLE_AREA(14*8, (64-14)*8-1, 2*8, 30*8-1 )
+ MCFG_SCREEN_VISIBLE_AREA(12*8, (64-12)*8-1, 2*8, 30*8-1 )
MCFG_SCREEN_UPDATE_DRIVER(tmnt_state, screen_update_lgtnfght)
MCFG_SCREEN_PALETTE("palette")
@@ -2236,7 +2236,7 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_START( blswhstl, tmnt_state )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", M68000, 16000000) /* 16 MHz */
+ MCFG_CPU_ADD("maincpu", M68000, XTAL_32MHz/2) /* Confirmed */
MCFG_CPU_PROGRAM_MAP(blswhstl_main_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", tmnt_state, punkshot_interrupt)
@@ -2255,7 +2255,7 @@ static MACHINE_CONFIG_START( blswhstl, tmnt_state )
MCFG_SCREEN_REFRESH_RATE(60)
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
MCFG_SCREEN_SIZE(64*8, 32*8)
- MCFG_SCREEN_VISIBLE_AREA(14*8, (64-15)*8-1, 2*8, 30*8-1 )
+ MCFG_SCREEN_VISIBLE_AREA(12*8, (64-12)*8-1, 2*8, 30*8-1 )
MCFG_SCREEN_UPDATE_DRIVER(tmnt_state, screen_update_lgtnfght)
MCFG_SCREEN_VBLANK_DRIVER(tmnt_state, screen_eof_blswhstl)
MCFG_SCREEN_PALETTE("palette")
@@ -3265,6 +3265,31 @@ ROM_START( blswhstl )
ROM_LOAD( "blswhstl.nv", 0x0000, 0x080, CRC(87434e3f) SHA1(458d21cfc0ef3415c0b09d8d748263b9218bdb24) )
ROM_END
+ROM_START( blswhstla )
+ ROM_REGION( 0x80000, "maincpu", 0 ) /* 4*128k for 68000 code */
+ ROM_LOAD16_BYTE( "060_m02.e09", 0x000000, 0x20000, CRC(bc9dd08f) SHA1(463634e1d8f3419b840beef0cedfc9c060166d0c) )
+ ROM_LOAD16_BYTE( "060_m03.g09", 0x000001, 0x20000, CRC(7b6ee4a4) SHA1(d6c9d60058accd6f9ac6c2b9306057efc3fee461) )
+ ROM_LOAD16_BYTE( "060_m09.e11", 0x040000, 0x20000, CRC(14628736) SHA1(87f7a65cffb87085b3e21043bd46fbb7db9266dd) )
+ ROM_LOAD16_BYTE( "060_m10.g11", 0x040001, 0x20000, CRC(f738ad4a) SHA1(5aea4afa4bf935d3e92856eff745f61ed4d98165) )
+
+ ROM_REGION( 0x10000, "audiocpu", 0 )
+ ROM_LOAD( "060j01.f3", 0x0000, 0x10000, CRC(f9d9a673) SHA1(8e5631c20dc37913cc7fa84f7ef786ff1ef85f09) )
+
+ ROM_REGION( 0x100000, "k052109", 0 ) /* tiles */
+ ROM_LOAD32_WORD_SWAP( "060e07.k16", 0x000000, 0x080000, CRC(c400edf3) SHA1(3f507df8804c1774e2e213f5eb8be0aa7e818d65) )
+ ROM_LOAD32_WORD_SWAP( "060e08.k12", 0x000002, 0x080000, CRC(70dddba1) SHA1(2acb94f249cf89b3d53798a6ee1c960f84a04d2e) )
+
+ ROM_REGION( 0x100000, "k053245", 0 ) /* sprites */
+ ROM_LOAD32_WORD_SWAP( "060e06.k7", 0x000000, 0x080000, CRC(09381492) SHA1(5a3008dec99a8e0043405e9c4f5145794b8606e0) )
+ ROM_LOAD32_WORD_SWAP( "060e05.k3", 0x000002, 0x080000, CRC(32454241) SHA1(7a246b255ff30118c4f8e07e6ba03a22fd5ddc8a) )
+
+ ROM_REGION( 0x100000, "k053260", 0 ) /* samples for the 053260 */
+ ROM_LOAD( "060e04.d1", 0x0000, 0x100000, CRC(c680395d) SHA1(acde593a5ec501e89c8aaca6c4fbacf707a727e1) )
+
+ ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
+ ROM_LOAD( "blswhstl.nv", 0x0000, 0x080, CRC(87434e3f) SHA1(458d21cfc0ef3415c0b09d8d748263b9218bdb24) )
+ROM_END
+
ROM_START( detatwin )
ROM_REGION( 0x80000, "maincpu", 0 ) /* 4*128k for 68000 code */
ROM_LOAD16_BYTE( "060_j02.e09", 0x000000, 0x20000, CRC(11b761ac) SHA1(1a143b0a43da48bdcfe085a2a9d1a2de0329fafd) )
@@ -3354,8 +3379,6 @@ ROM_START( glfgreatj )
ROM_LOAD( "061e04.1d", 0x0000, 0x100000, CRC(7921d8df) SHA1(19ca4850ec489cca245e90a41bfc22493cd52263) )
ROM_END
-
-
ROM_START( tmnt2 )
ROM_REGION( 0x100000, "maincpu", 0 ) /* 4*128k for 68000 code */
ROM_LOAD16_BYTE( "063uaa02.8e", 0x000000, 0x20000, CRC(58d5c93d) SHA1(6618678ec2da33d2ee6335cca7c9d49e9148b799) )
@@ -3412,7 +3435,6 @@ ROM_START( tmnt22pu )
ROM_LOAD( "tmnt2_uda.nv", 0x0000, 0x080, CRC(44928d33) SHA1(44024927987f6bb8bdac3dbd1fdc81d7b55c0f5a) )
ROM_END
-
ROM_START( tmht22pe )
ROM_REGION( 0x100000, "maincpu", 0 ) /* 4*128k for 68000 code */
ROM_LOAD16_BYTE( "063eba02.8e", 0x000000, 0x20000, CRC(99409094) SHA1(18059da85c59eb6ce193111bb8c7bd6601b1e698) )
@@ -3441,7 +3463,6 @@ ROM_START( tmht22pe )
ROM_LOAD( "tmnt2_eba.nv", 0x0000, 0x080, CRC(c0a3ed50) SHA1(6deec720c7f1c607740076cb8b5b5becd175aed0) )
ROM_END
-
ROM_START( tmnt2a )
ROM_REGION( 0x100000, "maincpu", 0 ) /* 4*128k for 68000 code */
ROM_LOAD16_BYTE( "063ada02.8e", 0x000000, 0x20000, CRC(4f11b587) SHA1(111051da23ce7035405b4d12c0f18dcc1d6c8ddc) )
@@ -3470,7 +3491,6 @@ ROM_START( tmnt2a )
ROM_LOAD( "tmnt2_ada.nv", 0x0000, 0x080, CRC(063068a0) SHA1(c1da5319428fd8fb60305a2d7cc166596b2fe5a4) )
ROM_END
-
ROM_START( qgakumon )
ROM_REGION( 0x100000, "maincpu", 0 ) /* 4*256k for 68000 code */
ROM_LOAD16_BYTE( "248jaa02.8e", 0x000000, 0x40000, CRC(fab79410) SHA1(8b1a8946ee65505608cf026c9fca87365ccef089) )
@@ -3771,6 +3791,31 @@ ROM_START( ssridersjbd )
ROM_LOAD( "ssriders_jbd.nv", 0x0000, 0x080, CRC(006200e3) SHA1(a6a0640c1a6d69a41db90f1fc935e97f2fa68553) )
ROM_END
+ROM_START( ssridersjad )
+ ROM_REGION( 0xc0000, "maincpu", 0 ) /* 2*256k and 2*128k for 68000 code */
+ ROM_LOAD16_BYTE( "064jad02.8e", 0x000000, 0x40000, CRC(13709ee6) SHA1(89f047711c2d978382fa8259d5dba9223a9c96db) )
+ ROM_LOAD16_BYTE( "064jad03.8g", 0x000001, 0x40000, CRC(2fa32229) SHA1(15027f8903389ddc57ada3f79ee5595520b06936) )
+ ROM_LOAD16_BYTE( "064eab04.10e", 0x080000, 0x20000, CRC(ef2315bd) SHA1(2c8b11321cb5fdb78d760fabca666c0d8cc5b298) )
+ ROM_LOAD16_BYTE( "064eab05.10g", 0x080001, 0x20000, CRC(51d6fbc4) SHA1(e80de7d155b7f263c48ef4ae2702059be3c18e76) )
+
+ ROM_REGION( 0x10000, "audiocpu", 0 )
+ ROM_LOAD( "064e01.2f", 0x0000, 0x10000, CRC(44b9bc52) SHA1(4654d6e14c6956c40a19cb41155accb63f0da338) )
+
+ ROM_REGION( 0x100000, "k052109", 0 ) /* tiles */
+ ROM_LOAD32_WORD( "064e12.16k", 0x000000, 0x080000, CRC(e2bdc619) SHA1(04449deb267b0beacfa33640b593eb16194aa0d9) )
+ ROM_LOAD32_WORD( "064e11.12k", 0x000002, 0x080000, CRC(2d8ca8b0) SHA1(7c882f79c2402cf75979c681071007d76e4db9ae) )
+
+ ROM_REGION( 0x200000, "k053245", 0 ) /* sprites */
+ ROM_LOAD32_WORD( "064e09.7l", 0x000000, 0x100000, CRC(4160c372) SHA1(0b36181e5ccd785c7fb89b9f41e458066a42c3b0) )
+ ROM_LOAD32_WORD( "064e07.3l", 0x000002, 0x100000, CRC(64dd673c) SHA1(bea4d17a71dd21c635866ee69b4892dc9d0ab455) )
+
+ ROM_REGION( 0x100000, "k053260", 0 ) /* samples for the 053260 */
+ ROM_LOAD( "064e06.1d", 0x0000, 0x100000, CRC(59810df9) SHA1(a0affc6330bdbfab1447dc0cf13c20ff708c2c71) )
+
+ ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
+ ROM_LOAD( "ssriders_jad.nv", 0x0000, 0x080, CRC(8962058c) SHA1(2aa470d02c7047c637d216690c281a144b70b4c3) )
+ROM_END
+
ROM_START( ssridersjac )
ROM_REGION( 0xc0000, "maincpu", 0 ) /* 2*256k and 2*128k for 68000 code */
ROM_LOAD16_BYTE( "064jac02.8e", 0x000000, 0x40000, CRC(64a35f6f) SHA1(161127360e68054898cbe4d90382cf1682c8870b) )
@@ -4092,7 +4137,7 @@ DRIVER_INIT_MEMBER(tmnt_state,cuebrick)
}
// YEAR, NAME, PARENT, MACHINE, INPUT, INIT, MONITOR,COMPANY,FULLNAME,FLAGS
-GAME( 1989, cuebrick, 0, cuebrick, cuebrick, tmnt_state, cuebrick, ROT0, "Konami", "Cue Brick (World version D)", GAME_SUPPORTS_SAVE )
+GAME( 1989, cuebrick, 0, cuebrick, cuebrick, tmnt_state, cuebrick, ROT0, "Konami", "Cue Brick (World, version D)", GAME_SUPPORTS_SAVE )
GAME( 1989, mia, 0, mia, mia, tmnt_state, mia, ROT0, "Konami", "M.I.A. - Missing in Action (version T)", GAME_SUPPORTS_SAVE )
GAME( 1989, mia2, mia, mia, mia, tmnt_state, mia, ROT0, "Konami", "M.I.A. - Missing in Action (version S)", GAME_SUPPORTS_SAVE )
@@ -4118,8 +4163,9 @@ GAME( 1990, lgtnfghta, lgtnfght, lgtnfght, lgtnfght, driver_device, 0,
GAME( 1990, lgtnfghtu, lgtnfght, lgtnfght, lgtnfght, driver_device, 0, ROT90, "Konami", "Lightning Fighters (US)", GAME_SUPPORTS_SAVE )
GAME( 1990, trigon, lgtnfght, lgtnfght, trigon, driver_device, 0, ROT90, "Konami", "Trigon (Japan)", GAME_SUPPORTS_SAVE )
-GAME( 1991, blswhstl, 0, blswhstl, blswhstl, driver_device, 0, ROT90, "Konami", "Bells & Whistles (Version L)", GAME_SUPPORTS_SAVE )
-GAME( 1991, detatwin, blswhstl, blswhstl, blswhstl, driver_device, 0, ROT90, "Konami", "Detana!! Twin Bee (Japan ver. J)", GAME_SUPPORTS_SAVE )
+GAME( 1991, blswhstl, 0, blswhstl, blswhstl, driver_device, 0, ROT90, "Konami", "Bells & Whistles (World, version L)", GAME_SUPPORTS_SAVE )
+GAME( 1991, blswhstla, blswhstl, blswhstl, blswhstl, driver_device, 0, ROT90, "Konami", "Bells & Whistles (Asia, version M)", GAME_SUPPORTS_SAVE )
+GAME( 1991, detatwin, blswhstl, blswhstl, blswhstl, driver_device, 0, ROT90, "Konami", "Detana!! Twin Bee (Japan, version J)", GAME_SUPPORTS_SAVE )
GAME( 1991, glfgreat, 0, glfgreat, glfgreat, driver_device, 0, ROT0, "Konami", "Golfing Greats", GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
GAME( 1991, glfgreatj, glfgreat, glfgreat, glfgreatj, driver_device, 0, ROT0, "Konami", "Golfing Greats (Japan)", GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
@@ -4141,6 +4187,7 @@ GAME( 1991, ssridersuab, ssriders, ssriders, ssridr4p, driver_device, 0,
GAME( 1991, ssridersubc, ssriders, ssriders, ssriders, driver_device, 0, ROT0, "Konami", "Sunset Riders (2 Players ver UBC)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
GAME( 1991, ssridersadd, ssriders, ssriders, ssrid4ps, driver_device, 0, ROT0, "Konami", "Sunset Riders (4 Players ver ADD)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
GAME( 1991, ssridersabd, ssriders, ssriders, ssriders, driver_device, 0, ROT0, "Konami", "Sunset Riders (2 Players ver ABD)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
+GAME( 1991, ssridersjad, ssriders, ssriders, ssrid4ps, driver_device, 0, ROT0, "Konami", "Sunset Riders (4 Players ver JAD)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
GAME( 1991, ssridersjac, ssriders, ssriders, ssrid4ps, driver_device, 0, ROT0, "Konami", "Sunset Riders (4 Players ver JAC)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
GAME( 1991, ssridersjbd, ssriders, ssriders, ssriders, driver_device, 0, ROT0, "Konami", "Sunset Riders (2 Players ver JBD)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
GAME( 1991, ssridersb, ssriders, sunsetbl, sunsetbl, driver_device, 0, ROT0, "bootleg","Sunset Riders (bootleg 4 Players ver ADD)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/tnzs.c b/src/mame/drivers/tnzs.c
index 52891d5a5fb..0d4b7800206 100644
--- a/src/mame/drivers/tnzs.c
+++ b/src/mame/drivers/tnzs.c
@@ -2194,6 +2194,8 @@ ROM_START( drtoppelj )
ROM_LOAD( "b19-12.16f", 0x0200, 0x200, CRC(5754e9d8) SHA1(8c7d29e22c90b1f72929b95675dc15e431aae044) ) /* lo bytes, AM27S29 or compatible like MB7124 */
ROM_END
+/* M6100309A PCB
+ PO-0038A */
ROM_START( kageki )
ROM_REGION( 0x20000, "maincpu", 0 )
ROM_LOAD( "b35-16.11c", 0x00000, 0x10000, CRC(a4e6fd58) SHA1(7cfe5b3fa6c88cdab45719f5b58541270825ad30) ) /* US ver */
@@ -2464,6 +2466,9 @@ ROM_START( tnzs )
ROM_LOAD( "b53-23.3", 0xa0000, 0x20000, CRC(74acfb9b) SHA1(90b544ed7ede7565660bdd13c94c15c54423cda9) )
ROM_LOAD( "b53-20.2", 0xc0000, 0x20000, CRC(095d0dc0) SHA1(ced2937d0594fa00ae344a4e3a3cba23772dc160) )
ROM_LOAD( "b53-21.1", 0xe0000, 0x20000, CRC(9800c54d) SHA1(761647177d621ac2cdd8b009876eed35809f3c92) )
+
+ ROM_REGION( 0x10000, "pal", 0 )
+ ROM_LOAD( "b53-15.pal16l8a.subpcb.ic6.jed", 0x00000, 0x01000, NO_DUMP) // on sub pcb
ROM_END
ROM_START( tnzsj )
@@ -2485,16 +2490,29 @@ ROM_START( tnzsj )
ROM_LOAD( "b53-23.3", 0xa0000, 0x20000, CRC(74acfb9b) SHA1(90b544ed7ede7565660bdd13c94c15c54423cda9) )
ROM_LOAD( "b53-20.2", 0xc0000, 0x20000, CRC(095d0dc0) SHA1(ced2937d0594fa00ae344a4e3a3cba23772dc160) )
ROM_LOAD( "b53-21.1", 0xe0000, 0x20000, CRC(9800c54d) SHA1(761647177d621ac2cdd8b009876eed35809f3c92) )
+
+ ROM_REGION( 0x10000, "pal", 0 )
+ ROM_LOAD( "b53-15.pal16l8a.subpcb.ic6.jed", 0x00000, 0x01000, NO_DUMP) // on sub pcb
ROM_END
-/* tnzs - old style PCB sets */
+/* tnzs - old style PCB sets
+The New Zealand Story
+Taito, 1988
+Taito ID: K1100356A
+ J1100156A
+ MAIN PCB
+Seta ID: PO-041A
+*/
+/* This pcb is similar but not identical to the Chuka Taisen pcb above;
+ there is an M-chip i8742 (with Taito silkscreen) and no 3rd z80.
+ There is no sub-pcb like the later TNZS pcb has. */
ROM_START( tnzsjo )
ROM_REGION( 0x20000, "maincpu", 0 ) /* 64k + bankswitch areas for the first CPU */
- ROM_LOAD( "b53-10.32", 0x00000, 0x20000, CRC(a73745c6) SHA1(73eb38e75e08312d752332f988dc655084b4a86d) )
+ ROM_LOAD( "b53-10.u32", 0x00000, 0x20000, CRC(a73745c6) SHA1(73eb38e75e08312d752332f988dc655084b4a86d) )
ROM_REGION( 0x10000, "sub", 0 ) /* 64k for the second CPU */
- ROM_LOAD( "b53-11.38", 0x00000, 0x10000, CRC(9784d443) SHA1(bc3647aac9974031dbe4898417fbaa99841f9548) )
+ ROM_LOAD( "b53-11.u38", 0x00000, 0x10000, CRC(9784d443) SHA1(bc3647aac9974031dbe4898417fbaa99841f9548) )
ROM_REGION( 0x10000, "mcu", 0 ) /* M-Chip (i8742 internal ROM) */
ROM_LOAD( "b53-09.u46", 0x0000, 0x0800, CRC(a4bfce19) SHA1(9340862d5bdc1ad4799dc92cae9bce1428b47478) )
@@ -2509,6 +2527,11 @@ ROM_START( tnzsjo )
ROM_LOAD( "b53-03.3", 0xa0000, 0x20000, CRC(74acfb9b) SHA1(90b544ed7ede7565660bdd13c94c15c54423cda9) )
ROM_LOAD( "b53-02.2", 0xc0000, 0x20000, CRC(095d0dc0) SHA1(ced2937d0594fa00ae344a4e3a3cba23772dc160) )
ROM_LOAD( "b53-01.1", 0xe0000, 0x20000, CRC(9800c54d) SHA1(761647177d621ac2cdd8b009876eed35809f3c92) )
+
+ ROM_REGION( 0x10000, "pal", 0 ) /* these are marked b06 and so are probably shared with extermination */
+ ROM_LOAD( "b06-12.pal16l8a.ic26.jed", 0x00000, 0x01000, NO_DUMP)
+ ROM_LOAD( "b06-13.pal16l8a.ic25.jed", 0x01000, 0x01000, NO_DUMP)
+ ROM_LOAD( "b06-14.pal16x8a.icxx.jed", 0x02000, 0x01000, NO_DUMP) // does this chip exist?
ROM_END
ROM_START( tnzso )
@@ -2519,7 +2542,7 @@ ROM_END
ROM_LOAD( "u38", 0x00000, 0x10000, CRC(60340d63) SHA1(12a26d19dc8e407e502f25617a5a4c9cea131ce2) )
ROM_REGION( 0x10000, "mcu", 0 ) /* M-Chip (i8742 internal ROM) */
- ROM_LOAD( "b53-06.u46", 0x0000, 0x0800, CRC(a4bfce19) SHA1(9340862d5bdc1ad4799dc92cae9bce1428b47478) )
+ ROM_LOAD( "b53-09.u46", 0x0000, 0x0800, CRC(a4bfce19) SHA1(9340862d5bdc1ad4799dc92cae9bce1428b47478) )
ROM_REGION( 0x100000, "gfx1", 0 )
/* ROMs taken from another set (the ones from this set were read incorrectly) */
@@ -2531,6 +2554,12 @@ ROM_END
ROM_LOAD( "b53-03.3", 0xa0000, 0x20000, CRC(74acfb9b) SHA1(90b544ed7ede7565660bdd13c94c15c54423cda9) )
ROM_LOAD( "b53-02.2", 0xc0000, 0x20000, CRC(095d0dc0) SHA1(ced2937d0594fa00ae344a4e3a3cba23772dc160) )
ROM_LOAD( "b53-01.1", 0xe0000, 0x20000, CRC(9800c54d) SHA1(761647177d621ac2cdd8b009876eed35809f3c92) )
+
+ ROM_REGION( 0x10000, "pal", 0 ) /* PALS not directly observed on this board but assumed to exist */
+ /* these are marked b06 and so are probably shared with extermination */
+ ROM_LOAD( "b06-12.pal16l8a.ic26.jed", 0x00000, 0x01000, NO_DUMP)
+ ROM_LOAD( "b06-13.pal16l8a.ic25.jed", 0x01000, 0x01000, NO_DUMP)
+ ROM_LOAD( "b06-14.pal16x8a.icxx.jed", 0x02000, 0x01000, NO_DUMP) // does this chip exist?
ROM_END
ROM_START( tnzsop )
@@ -2552,6 +2581,12 @@ ROM_START( tnzsop )
ROM_LOAD( "ns_a05.rom", 0xa0000, 0x20000, CRC(6e762e20) SHA1(66731fe4053b9c09bc9c95d10aba212db08b4636) )
ROM_LOAD( "ns_a04.rom", 0xc0000, 0x20000, CRC(e1fd1b9d) SHA1(6027491b927c2ab9c77fbf8895da1abcfbe32d62) )
ROM_LOAD( "ns_a02.rom", 0xe0000, 0x20000, CRC(2ab06bda) SHA1(2b208b564e55c258665e1f66b26fe14a6c68eb96) )
+
+ ROM_REGION( 0x10000, "pal", 0 ) /* PALS not directly observed on this board but assumed to exist */
+ /* these are marked b06 and so are probably shared with extermination */
+ ROM_LOAD( "b06-12.pal16l8a.ic26.jed", 0x00000, 0x01000, NO_DUMP)
+ ROM_LOAD( "b06-13.pal16l8a.ic25.jed", 0x01000, 0x01000, NO_DUMP)
+ ROM_LOAD( "b06-14.pal16x8a.icxx.jed", 0x02000, 0x01000, NO_DUMP) // does this chip exist?
ROM_END
/*
diff --git a/src/mame/drivers/toaplan1.c b/src/mame/drivers/toaplan1.c
index e1a7dc09a64..1998a201404 100644
--- a/src/mame/drivers/toaplan1.c
+++ b/src/mame/drivers/toaplan1.c
@@ -958,7 +958,17 @@ static INPUT_PORTS_START( toaplan1_3b )
TOAPLAN_JOY_UDLR_3_BUTTONS( 2 )
INPUT_PORTS_END
-#define TOAPLAN1_PLAYER_INPUT( player, button3, options ) \
+#define TOAPLAN1_PLAYER_INPUT( player, button3 ) \
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(player) PORT_8WAY \
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(player) PORT_8WAY \
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(player) PORT_8WAY \
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(player) PORT_8WAY \
+ PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(player) \
+ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(player) \
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, button3 ) PORT_PLAYER(player) \
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
+
+#define TOAPLAN1_PLAYER_INPUT_COCKTAIL( player, button3, options ) \
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(player) options PORT_8WAY \
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(player) options PORT_8WAY \
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(player) options PORT_8WAY \
@@ -1264,10 +1274,10 @@ static INPUT_PORTS_START( demonwld )
TOAPLAN1_VBLANK_INPUT
PORT_START("P1")
- TOAPLAN1_PLAYER_INPUT( 1, IPT_BUTTON3, )
+ TOAPLAN1_PLAYER_INPUT( 1, IPT_BUTTON3 )
PORT_START("P2")
- TOAPLAN1_PLAYER_INPUT( 2, IPT_BUTTON3, )
+ TOAPLAN1_PLAYER_INPUT( 2, IPT_BUTTON3 )
PORT_START("DSWA") /* DSW A */
PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unused ) )
@@ -1348,10 +1358,10 @@ static INPUT_PORTS_START( fireshrk )
TOAPLAN1_VBLANK_INPUT
PORT_START("P1")
- TOAPLAN1_PLAYER_INPUT( 1, IPT_UNKNOWN, )
+ TOAPLAN1_PLAYER_INPUT( 1, IPT_UNKNOWN )
PORT_START("P2")
- TOAPLAN1_PLAYER_INPUT( 2, IPT_UNKNOWN, PORT_COCKTAIL )
+ TOAPLAN1_PLAYER_INPUT_COCKTAIL( 2, IPT_UNKNOWN, PORT_COCKTAIL )
PORT_START("DSWA") /* DSW A */
PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) )
@@ -1475,7 +1485,7 @@ static INPUT_PORTS_START( samesame2 )
PORT_INCLUDE( samesame )
PORT_MODIFY("P2")
- TOAPLAN1_PLAYER_INPUT( 2, IPT_UNKNOWN, )
+ TOAPLAN1_PLAYER_INPUT( 2, IPT_UNKNOWN )
PORT_MODIFY("DSWA") /* DSW A */
PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) ) /* No cocktail */
diff --git a/src/mame/drivers/toaplan2.c b/src/mame/drivers/toaplan2.c
index baaed59f364..f704fde1ac2 100644
--- a/src/mame/drivers/toaplan2.c
+++ b/src/mame/drivers/toaplan2.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Quench, Yochizo, David Haywood
/*****************************************************************************
diff --git a/src/mame/drivers/toki.c b/src/mame/drivers/toki.c
index fc6d7cdf076..aad35f84649 100644
--- a/src/mame/drivers/toki.c
+++ b/src/mame/drivers/toki.c
@@ -403,6 +403,13 @@ static MACHINE_CONFIG_START( toki, toki_state ) /* KOYO 20.000MHz near the cpu *
SEIBU_SOUND_SYSTEM_YM3812_RAIDEN_INTERFACE(XTAL_14_31818MHz/4,XTAL_12MHz/12) /* verifed on pcb */
MACHINE_CONFIG_END
+static MACHINE_CONFIG_DERIVED( tokie, toki )
+ SEIBU_SOUND_SYSTEM_ENCRYPTED_LOW()
+MACHINE_CONFIG_END
+
+static MACHINE_CONFIG_DERIVED( tokic, toki )
+ SEIBU_SOUND_SYSTEM_ENCRYPTED_CUSTOM()
+MACHINE_CONFIG_END
static MACHINE_CONFIG_START( tokib, toki_state )
@@ -757,8 +764,6 @@ DRIVER_INIT_MEMBER(toki_state,toki)
{
ROM[i] = buffer[BITSWAP24(i,23,22,21,20,19,18,17,16,13,14,15,12,11,10,9,8,7,6,5,4,3,2,1,0)];
}
-
- m_seibu_sound->decrypt("audiocpu",0x2000);
}
@@ -821,16 +826,12 @@ DRIVER_INIT_MEMBER(toki_state,jujuba)
/* Decrypt data for z80 program */
{
- address_space &space = m_audiocpu->space(AS_PROGRAM);
- UINT8 *decrypt = auto_alloc_array(machine(), UINT8, 0x20000);
+ UINT8 *decrypt = m_seibu_sound->get_custom_decrypt();
UINT8 *rom = memregion("audiocpu")->base();
- int i;
memcpy(decrypt,rom,0x20000);
- space.set_decrypted_region(0x0000, 0x1fff, decrypt);
-
- for (i = 0;i < 0x2000;i++)
+ for (int i = 0;i < 0x2000;i++)
{
UINT8 src = decrypt[i];
rom[i] = src^0x55;
@@ -852,15 +853,15 @@ DRIVER_INIT_MEMBER(toki_state,jujuba)
// these 2 are both unique revisions
-GAME( 1989, toki, 0, toki, toki, toki_state, toki, ROT0, "TAD Corporation", "Toki (World, set 1)", GAME_SUPPORTS_SAVE )
-GAME( 1989, tokiu, toki, toki, toki, toki_state, toki, ROT0, "TAD Corporation (Fabtek license)", "Toki (US, set 1)", GAME_SUPPORTS_SAVE )
+GAME( 1989, toki, 0, tokie, toki, toki_state, toki, ROT0, "TAD Corporation", "Toki (World, set 1)", GAME_SUPPORTS_SAVE )
+GAME( 1989, tokiu, toki, tokie, toki, toki_state, toki, ROT0, "TAD Corporation (Fabtek license)", "Toki (US, set 1)", GAME_SUPPORTS_SAVE )
// these 3 are all the same revision, only the region byte differs
-GAME( 1989, tokia, toki, toki, toki, toki_state, toki, ROT0, "TAD Corporation", "Toki (World, set 2)", GAME_SUPPORTS_SAVE )
-GAME( 1989, tokiua,toki, toki, toki, toki_state, toki, ROT0, "TAD Corporation (Fabtek license)", "Toki (US, set 2)", GAME_SUPPORTS_SAVE )
-GAME( 1989, juju, toki, toki, toki, toki_state, toki, ROT0, "TAD Corporation", "JuJu Densetsu (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1989, tokia, toki, tokie, toki, toki_state, toki, ROT0, "TAD Corporation", "Toki (World, set 2)", GAME_SUPPORTS_SAVE )
+GAME( 1989, tokiua,toki, tokie, toki, toki_state, toki, ROT0, "TAD Corporation (Fabtek license)", "Toki (US, set 2)", GAME_SUPPORTS_SAVE )
+GAME( 1989, juju, toki, tokie, toki, toki_state, toki, ROT0, "TAD Corporation", "JuJu Densetsu (Japan)", GAME_SUPPORTS_SAVE )
GAME( 1990, tokib, toki, tokib, tokib, toki_state, tokib, ROT0, "bootleg (Datsu)", "Toki (Datsu bootleg)", GAME_SUPPORTS_SAVE )
GAME( 1990, jujub, toki, tokib, tokib, toki_state, tokib, ROT0, "bootleg (Playmark)", "JuJu Densetsu (Playmark bootleg)", GAME_SUPPORTS_SAVE )
/* Sound hardware seems to have been slightly modified, the coins are handled ok, but there is no music and bad sfx. Program roms have a slight bitswap, Flipscreen also seems to be ignored */
-GAME( 1989, jujuba, toki, toki, toki, toki_state, jujuba, ROT180, "bootleg", "JuJu Densetsu (Japan, bootleg)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) // bootleg of tokia/juju revison
+GAME( 1989, jujuba, toki, tokic, toki, toki_state, jujuba, ROT180, "bootleg", "JuJu Densetsu (Japan, bootleg)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) // bootleg of tokia/juju revison
diff --git a/src/mame/drivers/tonton.c b/src/mame/drivers/tonton.c
index 49130852c45..204d1bec059 100644
--- a/src/mame/drivers/tonton.c
+++ b/src/mame/drivers/tonton.c
@@ -215,7 +215,6 @@ void tonton_state::machine_reset()
TIMER_DEVICE_CALLBACK_MEMBER(tonton_state::tonton_interrupt)
{
- m_v9938->set_resolution(0);
m_v9938->interrupt();
}
diff --git a/src/mame/drivers/topspeed.c b/src/mame/drivers/topspeed.c
index 1bab838ec81..f080a163f34 100644
--- a/src/mame/drivers/topspeed.c
+++ b/src/mame/drivers/topspeed.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:David Graves
/***************+************************************************************
diff --git a/src/mame/drivers/trackfld.c b/src/mame/drivers/trackfld.c
index 7ff93fb34ca..2aa78acb812 100644
--- a/src/mame/drivers/trackfld.c
+++ b/src/mame/drivers/trackfld.c
@@ -892,7 +892,7 @@ INTERRUPT_GEN_MEMBER(trackfld_state::vblank_nmi)
static MACHINE_CONFIG_START( trackfld, trackfld_state )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", M6809, MASTER_CLOCK/6/2) /* a guess for now */
+ MCFG_CPU_ADD("maincpu", KONAMI1, MASTER_CLOCK/6/2) /* a guess for now */
MCFG_CPU_PROGRAM_MAP(main_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", trackfld_state, vblank_irq)
@@ -1010,8 +1010,11 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( mastkin, trackfld )
/* basic machine hardware */
- MCFG_CPU_MODIFY("maincpu")
+ MCFG_DEVICE_REMOVE("maincpu")
+
+ MCFG_CPU_ADD("maincpu", M6809, MASTER_CLOCK/6/2) /* a guess for now */
MCFG_CPU_PROGRAM_MAP(mastkin_map)
+ MCFG_CPU_VBLANK_INT_DRIVER("screen", trackfld_state, vblank_irq)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( wizzquiz, trackfld )
@@ -1421,24 +1424,14 @@ ROM_END
DRIVER_INIT_MEMBER(trackfld_state,trackfld)
{
- konami1_decode(machine(), "maincpu");
}
DRIVER_INIT_MEMBER(trackfld_state,atlantol)
{
address_space &space = m_maincpu->space(AS_PROGRAM);
UINT8 *rom = memregion("maincpu")->base();
- UINT8 *decrypt;
- int A;
-
- /* "konami1" encrypted opcodes */
- decrypt = konami1_decode(machine(), "maincpu");
-
- /* not encrypted opcodes */
- for (A = 0; A < 0x6000; A++)
- decrypt[A] = rom[A];
- space.set_decrypted_region(0x0000, 0xffff, decrypt);
+ machine().device<konami1_device>("maincpu")->set_encryption_boundary(0x6000);
space.install_write_handler(0x0800, 0x0800, write8_delegate(FUNC(trackfld_state::atlantol_gfxbank_w),this));
space.nop_write(0x1000, 0x1000);
diff --git a/src/mame/drivers/ttchamp.c b/src/mame/drivers/ttchamp.c
index 48981ebf535..cf85d0a47e8 100644
--- a/src/mame/drivers/ttchamp.c
+++ b/src/mame/drivers/ttchamp.c
@@ -116,7 +116,7 @@ public:
PIC_SET_READADDRESS = 1,
PIC_SET_WRITEADDRESS = 2,
PIC_SET_WRITELATCH = 3,
- PIC_SET_READLATCH = 4,
+ PIC_SET_READLATCH = 4
} picmodex;
diff --git a/src/mame/drivers/tumbleb.c b/src/mame/drivers/tumbleb.c
index 7d9ef7b06a0..767266ea44f 100644
--- a/src/mame/drivers/tumbleb.c
+++ b/src/mame/drivers/tumbleb.c
@@ -3650,11 +3650,11 @@ GAME( 1996, carket, 0, htchctch, carket, tumbleb_state, carket, R
GAME( 1996, wondl96, 0, cookbib_mcu, wondl96, tumbleb_state, wondl96, ROT0, "SemiCom", "Wonder League '96 (Korea)", GAME_SUPPORTS_SAVE )
-GAME( 1996, sdfight, 0, sdfight, sdfight, tumbleb_state, bcstory, ROT0, "SemiCom", "SD Fighters (Korea)", GAME_SUPPORTS_SAVE )
+GAME( 1996, sdfight, 0, sdfight, sdfight, tumbleb_state, bcstory, ROT0, "SemiCom / Tirano", "SD Fighters (Korea)", GAME_SUPPORTS_SAVE )
-GAME( 1997, bcstry, 0, bcstory, bcstory, tumbleb_state, bcstory, ROT0, "SemiCom", "B.C. Story (set 1)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) // gfx offsets?
-GAME( 1997, bcstrya, bcstry, bcstory, bcstory, tumbleb_state, bcstory, ROT0, "SemiCom", "B.C. Story (set 2)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) // gfx offsets?
+GAME( 1997, bcstry, 0, bcstory, bcstory, tumbleb_state, bcstory, ROT0, "SemiCom / Tirano", "B.C. Story (set 1)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) // gfx offsets?
+GAME( 1997, bcstrya, bcstry, bcstory, bcstory, tumbleb_state, bcstory, ROT0, "SemiCom / Tirano", "B.C. Story (set 2)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) // gfx offsets?
-GAME( 1997, semibase, 0, semibase, semibase, tumbleb_state, bcstory, ROT0, "SemiCom", "MuHanSeungBu (SemiCom Baseball) (Korea)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )// sprite offsets..
+GAME( 1997, semibase, 0, semibase, semibase, tumbleb_state, bcstory, ROT0, "SemiCom / DMD", "MuHanSeungBu (SemiCom Baseball) (Korea)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )// sprite offsets..
-GAME( 1998, dquizgo, 0, cookbib, dquizgo, tumbleb_state, dquizgo, ROT0, "SemiCom", "Date Quiz Go Go (Korea)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) // check layer offsets
+GAME( 1998, dquizgo, 0, cookbib, dquizgo, tumbleb_state, dquizgo, ROT0, "SemiCom / AceVer", "Date Quiz Go Go (Korea)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) // check layer offsets
diff --git a/src/mame/drivers/turbo.c b/src/mame/drivers/turbo.c
index 29c981cee60..c54f52d4310 100644
--- a/src/mame/drivers/turbo.c
+++ b/src/mame/drivers/turbo.c
@@ -539,7 +539,6 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( buckrog_map, AS_PROGRAM, 8, turbo_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM
- AM_RANGE(0x8000, 0xbfff) AM_ROM
AM_RANGE(0xc000, 0xc7ff) AM_RAM_WRITE(turbo_videoram_w) AM_SHARE("videoram") // FIX PAGE
AM_RANGE(0xc800, 0xc803) AM_MIRROR(0x07fc) AM_DEVREAD("i8255_0", i8255_device, read) AM_WRITE(buckrog_i8255_0_w) // 8255
AM_RANGE(0xd000, 0xd003) AM_MIRROR(0x07fc) AM_DEVREADWRITE("i8255_1", i8255_device, read, write) // 8255
@@ -555,6 +554,9 @@ static ADDRESS_MAP_START( buckrog_map, AS_PROGRAM, 8, turbo_state )
AM_RANGE(0xf800, 0xffff) AM_RAM // SCRATCH
ADDRESS_MAP_END
+static ADDRESS_MAP_START( decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 8, turbo_state )
+ AM_RANGE(0x0000, 0x7fff) AM_ROM AM_SHARE("decrypted_opcodes")
+ADDRESS_MAP_END
static ADDRESS_MAP_START( buckrog_cpu2_map, AS_PROGRAM, 8, turbo_state )
AM_RANGE(0x0000, 0x1fff) AM_ROM
@@ -919,6 +921,7 @@ static MACHINE_CONFIG_START( buckrog, turbo_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z80, MASTER_CLOCK/4)
MCFG_CPU_PROGRAM_MAP(buckrog_map)
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", turbo_state, irq0_line_hold)
MCFG_CPU_ADD("subcpu", Z80, MASTER_CLOCK/4)
@@ -960,7 +963,10 @@ static MACHINE_CONFIG_START( buckrog, turbo_state )
MCFG_FRAGMENT_ADD(buckrog_samples)
MACHINE_CONFIG_END
-
+static MACHINE_CONFIG_DERIVED( buckrogu, buckrog )
+ MCFG_CPU_MODIFY("maincpu")
+ MCFG_DEVICE_REMOVE_ADDRESS_MAP(AS_DECRYPTED_OPCODES)
+MACHINE_CONFIG_END
/*************************************
*
@@ -1078,9 +1084,118 @@ ROM_END
ROM_START( turbob )
ROM_REGION( 0x6000, "maincpu", 0 )
- ROM_LOAD( "epr-1363.cpu-ic76", 0x0000, 0x2000, CRC(5c110fb6) SHA1(fdcdf488bd112db12aa22c4b7e9f34004185d4ce) )
- ROM_LOAD( "epr-1364.cpu-ic89", 0x2000, 0x2000, CRC(6a341693) SHA1(428927c4a14bf82225875012c255d25dcffaf2ab) )
- ROM_LOAD( "epr-1365.cpu-ic103", 0x4000, 0x2000, CRC(3b6b0dc8) SHA1(3ebfa3f9fabd444ee105591acb6984b6b3523725) )
+ // B revision label on 1st rom, A revision for 2nd / 3rd, 2nd rom was faulty, 3rd rom matched existing set, existing 2nd rom passes rom check.
+ ROM_LOAD( "epr-1363_t5b.ic76", 0x0000, 0x2000, CRC(f7f28149) SHA1(08aec3edd6d756b14b2f10fe5abd22ac83c79fcc) ) /* CPU module stamped as 834-0128 */
+ ROM_LOAD( "epr-1364_t5a.ic89", 0x2000, 0x2000, CRC(6a341693) SHA1(428927c4a14bf82225875012c255d25dcffaf2ab) )
+ ROM_LOAD( "epr-1365_t5a.ic103", 0x4000, 0x2000, CRC(3b6b0dc8) SHA1(3ebfa3f9fabd444ee105591acb6984b6b3523725) )
+
+ ROM_REGION( 0x20000, "sprites", 0 ) /* sprite data */
+ ROM_LOAD( "epr-1246.prom-ic84", 0x00000, 0x2000, CRC(555bfe9a) SHA1(1e56385475eeff044dcd9b44a154991d3efe995e) ) /* level 0 */
+ ROM_RELOAD( 0x02000, 0x2000 )
+ ROM_LOAD( "epr-1247.prom-ic86", 0x04000, 0x2000, CRC(c8c5e4d5) SHA1(da70297340ddea0cd7fe04f2d94ea65f8202d0e5) ) /* level 1 */
+ ROM_RELOAD( 0x06000, 0x2000 )
+ ROM_LOAD( "epr-1248.prom-ic88", 0x08000, 0x2000, CRC(82fe5b94) SHA1(b96688ca0cfd90fdc4ee7c2e6c0b66726cc5713c) ) /* level 2 */
+ ROM_RELOAD( 0x0a000, 0x2000 )
+ ROM_LOAD( "epr-1249.prom-ic90", 0x0c000, 0x2000, CRC(e258e009) SHA1(598d382db0f789ea2fde749b7467abed545de25a) ) /* level 3 */
+ ROM_LOAD( "epr-1250.prom-ic108",0x0e000, 0x2000, CRC(aee6e05e) SHA1(99b9b1ec996746ddf713ed38192f350f1f32a847) )
+ ROM_LOAD( "epr-1251.prom-ic92", 0x10000, 0x2000, CRC(292573de) SHA1(3ddc980d11478a6a6e4082c2f76c1ab82ffe2f36) ) /* level 4 */
+ ROM_LOAD( "epr-1252.prom-ic110",0x12000, 0x2000, CRC(aee6e05e) SHA1(99b9b1ec996746ddf713ed38192f350f1f32a847) )
+ ROM_LOAD( "epr-1253.prom-ic94", 0x14000, 0x2000, CRC(92783626) SHA1(13979eb964112436182d2a92f21803bcc28f4a4a) ) /* level 5 */
+ ROM_LOAD( "epr-1254.prom-ic112",0x16000, 0x2000, CRC(aee6e05e) SHA1(99b9b1ec996746ddf713ed38192f350f1f32a847) )
+ ROM_LOAD( "epr-1255.prom-ic32", 0x18000, 0x2000, CRC(485dcef9) SHA1(0f760ebb42cc2580a29758c72428a41d74477ce6) ) /* level 6 */
+ ROM_LOAD( "epr-1256.prom-ic47", 0x1a000, 0x2000, CRC(aee6e05e) SHA1(99b9b1ec996746ddf713ed38192f350f1f32a847) )
+ ROM_LOAD( "epr-1257.prom-ic34", 0x1c000, 0x2000, CRC(4ca984ce) SHA1(99f294fb203f23929b44baa2dd1825c67dde08a1) ) /* level 7 */
+ ROM_LOAD( "epr-1258.prom-ic49", 0x1e000, 0x2000, CRC(aee6e05e) SHA1(99b9b1ec996746ddf713ed38192f350f1f32a847) )
+
+ ROM_REGION( 0x1000, "fgtiles", 0 ) /* foreground data */
+ ROM_LOAD( "epr-1244.cpu-ic111", 0x0000, 0x0800, CRC(17f67424) SHA1(6126562510f1509f3487faaa3b9d7470ab600a2c) )
+ ROM_LOAD( "epr-1245.cpu-ic122", 0x0800, 0x0800, CRC(2ba0b46b) SHA1(5d4d4f19ad7a911c7b37db190a420faf665546b4) )
+
+ ROM_REGION( 0x4800, "road", 0 ) /* road data */
+ ROM_LOAD( "epr-1125.cpu-ic1", 0x0000, 0x0800, CRC(65b5d44b) SHA1(bbdd5db013c9d876e9666f17c48569c7531bfc08) )
+ ROM_LOAD( "epr-1126.cpu-ic2", 0x0800, 0x0800, CRC(685ace1b) SHA1(99c8d36ac910169b27676d18c894433c2ba44853) )
+ ROM_LOAD( "epr-1127.cpu-ic13", 0x1000, 0x0800, CRC(9233c9ca) SHA1(cbf9a0f564d8ace1ccd701c1769dbc001d465851) )
+ ROM_LOAD( "epr-1238.cpu-ic14", 0x1800, 0x0800, CRC(d94fd83f) SHA1(1e3a68259d2ede623d5a7306fdf693a4eab301f0) )
+ ROM_LOAD( "epr-1239.cpu-ic27", 0x2000, 0x0800, CRC(4c41124f) SHA1(d73a9441552c77fb3078553195794311a950d589) )
+ ROM_LOAD( "epr-1240.cpu-ic28", 0x2800, 0x0800, CRC(371d6282) SHA1(f5902b357d976822d46aa6404b7bd30855d435a9) )
+ ROM_LOAD( "epr-1241.cpu-ic41", 0x3000, 0x0800, CRC(1109358a) SHA1(27a5351a4e87309671e72115299420315a93dba6) )
+ ROM_LOAD( "epr-1242.cpu-ic42", 0x3800, 0x0800, CRC(04866769) SHA1(1f9c0d53766fdaf8de57d3df05f291c2ca3dc5fb) )
+ ROM_LOAD( "epr-1243.cpu-ic74", 0x4000, 0x0800, CRC(29854c48) SHA1(cab89bc30f83d9746931ddf6f95a6d0c8a517e5d) )
+
+ ROM_REGION( 0x1020, "proms", 0 ) /* various PROMs */
+ ROM_LOAD( "pr-1114.prom-ic13", 0x0000, 0x0020, CRC(78aded46) SHA1(c78afe804f8b8e837b0c502de5b8715a41fb92b9) ) /* road red/green color table */
+ ROM_LOAD( "pr-1115.prom-ic18", 0x0020, 0x0020, CRC(5394092c) SHA1(129ff61104979ff6a3c3af8bf81c04ae9b133c9e) ) /* road collision/enable */
+ ROM_LOAD( "pr-1116.prom-ic20", 0x0040, 0x0020, CRC(3956767d) SHA1(073aaf57175526660fcf7af2e16e7f1d1aaba9a9) ) /* collision detection */
+ ROM_LOAD( "pr-1117.prom-ic21", 0x0060, 0x0020, CRC(f06d9907) SHA1(f11db7800f41b03e79f5eef8d7ef3ae0a6277518) ) /* road green/blue color table */
+ ROM_LOAD( "pr-1118.cpu-ic99", 0x0100, 0x0100, CRC(07324cfd) SHA1(844abc2042d6810fa34d84ff1ed57744886c6ea6) ) /* background color table */
+ ROM_LOAD( "pr-1119.cpu-ic50", 0x0200, 0x0200, CRC(57ebd4bc) SHA1(932649da3537666f95833a8a8aff506217bd9aa1) ) /* sprite Y scaling */
+ ROM_LOAD( "pr-1120.cpu-ic62", 0x0400, 0x0200, CRC(8dd4c8a8) SHA1(e8d9cf08f115d57c44746fa0ff28f47b064b4193) ) /* video timing */
+ ROM_LOAD( "pr-1121.prom-ic29", 0x0600, 0x0200, CRC(7692f497) SHA1(42468c0705df9928e15ff8deb7e793a6c0c04353) ) /* palette */
+ ROM_LOAD( "pr-1122.prom-ic11", 0x0800, 0x0400, CRC(1a86ce70) SHA1(cab708b9a089b2e28f2298c1e4fae6e200923527) ) /* sprite priorities */
+ ROM_LOAD( "pr-1123.prom-ic12", 0x0c00, 0x0400, CRC(02d2cb52) SHA1(c34d6b60355747ce20fcb8d322df0e188d187f10) ) /* sprite/road/background priorities */
+ ROM_LOAD( "pr-1279.sound-ic40", 0x1000, 0x0020, CRC(b369a6ae) SHA1(dda7c6cf58ce5173f29a3084c85393c0c4587086) ) /* sound board PROM */
+ROM_END
+
+ROM_START( turboc )
+ ROM_REGION( 0x6000, "maincpu", 0 )
+ ROM_LOAD( "epr-1363_t5a.ic76", 0x0000, 0x2000, CRC(5c110fb6) SHA1(fdcdf488bd112db12aa22c4b7e9f34004185d4ce) )
+ ROM_LOAD( "epr-1364_t5a.ic89", 0x2000, 0x2000, CRC(6a341693) SHA1(428927c4a14bf82225875012c255d25dcffaf2ab) )
+ ROM_LOAD( "epr-1365_t5a.ic103", 0x4000, 0x2000, CRC(3b6b0dc8) SHA1(3ebfa3f9fabd444ee105591acb6984b6b3523725) )
+
+ ROM_REGION( 0x20000, "sprites", 0 ) /* sprite data */
+ ROM_LOAD( "epr-1246.prom-ic84", 0x00000, 0x2000, CRC(555bfe9a) SHA1(1e56385475eeff044dcd9b44a154991d3efe995e) ) /* level 0 */
+ ROM_RELOAD( 0x02000, 0x2000 )
+ ROM_LOAD( "epr-1247.prom-ic86", 0x04000, 0x2000, CRC(c8c5e4d5) SHA1(da70297340ddea0cd7fe04f2d94ea65f8202d0e5) ) /* level 1 */
+ ROM_RELOAD( 0x06000, 0x2000 )
+ ROM_LOAD( "epr-1248.prom-ic88", 0x08000, 0x2000, CRC(82fe5b94) SHA1(b96688ca0cfd90fdc4ee7c2e6c0b66726cc5713c) ) /* level 2 */
+ ROM_RELOAD( 0x0a000, 0x2000 )
+ ROM_LOAD( "epr-1249.prom-ic90", 0x0c000, 0x2000, CRC(e258e009) SHA1(598d382db0f789ea2fde749b7467abed545de25a) ) /* level 3 */
+ ROM_LOAD( "epr-1250.prom-ic108",0x0e000, 0x2000, CRC(aee6e05e) SHA1(99b9b1ec996746ddf713ed38192f350f1f32a847) )
+ ROM_LOAD( "epr-1251.prom-ic92", 0x10000, 0x2000, CRC(292573de) SHA1(3ddc980d11478a6a6e4082c2f76c1ab82ffe2f36) ) /* level 4 */
+ ROM_LOAD( "epr-1252.prom-ic110",0x12000, 0x2000, CRC(aee6e05e) SHA1(99b9b1ec996746ddf713ed38192f350f1f32a847) )
+ ROM_LOAD( "epr-1253.prom-ic94", 0x14000, 0x2000, CRC(92783626) SHA1(13979eb964112436182d2a92f21803bcc28f4a4a) ) /* level 5 */
+ ROM_LOAD( "epr-1254.prom-ic112",0x16000, 0x2000, CRC(aee6e05e) SHA1(99b9b1ec996746ddf713ed38192f350f1f32a847) )
+ ROM_LOAD( "epr-1255.prom-ic32", 0x18000, 0x2000, CRC(485dcef9) SHA1(0f760ebb42cc2580a29758c72428a41d74477ce6) ) /* level 6 */
+ ROM_LOAD( "epr-1256.prom-ic47", 0x1a000, 0x2000, CRC(aee6e05e) SHA1(99b9b1ec996746ddf713ed38192f350f1f32a847) )
+ ROM_LOAD( "epr-1257.prom-ic34", 0x1c000, 0x2000, CRC(4ca984ce) SHA1(99f294fb203f23929b44baa2dd1825c67dde08a1) ) /* level 7 */
+ ROM_LOAD( "epr-1258.prom-ic49", 0x1e000, 0x2000, CRC(aee6e05e) SHA1(99b9b1ec996746ddf713ed38192f350f1f32a847) )
+
+ ROM_REGION( 0x1000, "fgtiles", 0 ) /* foreground data */
+ ROM_LOAD( "epr-1244.cpu-ic111", 0x0000, 0x0800, CRC(17f67424) SHA1(6126562510f1509f3487faaa3b9d7470ab600a2c) )
+ ROM_LOAD( "epr-1245.cpu-ic122", 0x0800, 0x0800, CRC(2ba0b46b) SHA1(5d4d4f19ad7a911c7b37db190a420faf665546b4) )
+
+ ROM_REGION( 0x4800, "road", 0 ) /* road data */
+ ROM_LOAD( "epr-1125.cpu-ic1", 0x0000, 0x0800, CRC(65b5d44b) SHA1(bbdd5db013c9d876e9666f17c48569c7531bfc08) )
+ ROM_LOAD( "epr-1126.cpu-ic2", 0x0800, 0x0800, CRC(685ace1b) SHA1(99c8d36ac910169b27676d18c894433c2ba44853) )
+ ROM_LOAD( "epr-1127.cpu-ic13", 0x1000, 0x0800, CRC(9233c9ca) SHA1(cbf9a0f564d8ace1ccd701c1769dbc001d465851) )
+ ROM_LOAD( "epr-1238.cpu-ic14", 0x1800, 0x0800, CRC(d94fd83f) SHA1(1e3a68259d2ede623d5a7306fdf693a4eab301f0) )
+ ROM_LOAD( "epr-1239.cpu-ic27", 0x2000, 0x0800, CRC(4c41124f) SHA1(d73a9441552c77fb3078553195794311a950d589) )
+ ROM_LOAD( "epr-1240.cpu-ic28", 0x2800, 0x0800, CRC(371d6282) SHA1(f5902b357d976822d46aa6404b7bd30855d435a9) )
+ ROM_LOAD( "epr-1241.cpu-ic41", 0x3000, 0x0800, CRC(1109358a) SHA1(27a5351a4e87309671e72115299420315a93dba6) )
+ ROM_LOAD( "epr-1242.cpu-ic42", 0x3800, 0x0800, CRC(04866769) SHA1(1f9c0d53766fdaf8de57d3df05f291c2ca3dc5fb) )
+ ROM_LOAD( "epr-1243.cpu-ic74", 0x4000, 0x0800, CRC(29854c48) SHA1(cab89bc30f83d9746931ddf6f95a6d0c8a517e5d) )
+
+ ROM_REGION( 0x1020, "proms", 0 ) /* various PROMs */
+ ROM_LOAD( "pr-1114.prom-ic13", 0x0000, 0x0020, CRC(78aded46) SHA1(c78afe804f8b8e837b0c502de5b8715a41fb92b9) ) /* road red/green color table */
+ ROM_LOAD( "pr-1115.prom-ic18", 0x0020, 0x0020, CRC(5394092c) SHA1(129ff61104979ff6a3c3af8bf81c04ae9b133c9e) ) /* road collision/enable */
+ ROM_LOAD( "pr-1116.prom-ic20", 0x0040, 0x0020, CRC(3956767d) SHA1(073aaf57175526660fcf7af2e16e7f1d1aaba9a9) ) /* collision detection */
+ ROM_LOAD( "pr-1117.prom-ic21", 0x0060, 0x0020, CRC(f06d9907) SHA1(f11db7800f41b03e79f5eef8d7ef3ae0a6277518) ) /* road green/blue color table */
+ ROM_LOAD( "pr-1118.cpu-ic99", 0x0100, 0x0100, CRC(07324cfd) SHA1(844abc2042d6810fa34d84ff1ed57744886c6ea6) ) /* background color table */
+ ROM_LOAD( "pr-1119.cpu-ic50", 0x0200, 0x0200, CRC(57ebd4bc) SHA1(932649da3537666f95833a8a8aff506217bd9aa1) ) /* sprite Y scaling */
+ ROM_LOAD( "pr-1120.cpu-ic62", 0x0400, 0x0200, CRC(8dd4c8a8) SHA1(e8d9cf08f115d57c44746fa0ff28f47b064b4193) ) /* video timing */
+ ROM_LOAD( "pr-1121.prom-ic29", 0x0600, 0x0200, CRC(7692f497) SHA1(42468c0705df9928e15ff8deb7e793a6c0c04353) ) /* palette */
+ ROM_LOAD( "pr-1122.prom-ic11", 0x0800, 0x0400, CRC(1a86ce70) SHA1(cab708b9a089b2e28f2298c1e4fae6e200923527) ) /* sprite priorities */
+ ROM_LOAD( "pr-1123.prom-ic12", 0x0c00, 0x0400, CRC(02d2cb52) SHA1(c34d6b60355747ce20fcb8d322df0e188d187f10) ) /* sprite/road/background priorities */
+ ROM_LOAD( "pr-1279.sound-ic40", 0x1000, 0x0020, CRC(b369a6ae) SHA1(dda7c6cf58ce5173f29a3084c85393c0c4587086) ) /* sound board PROM */
+ROM_END
+
+
+ROM_START( turbod )
+ ROM_REGION( 0x6000, "maincpu", 0 )
+ // no letter on rom labels, numbered 1363-1365, possibly the original 1363-1365 revision? - service mode still shows the older EPR-1262 through EPR-1264 tho?
+ ROM_LOAD( "1363.ic76", 0x0000, 0x2000, CRC(b6329a00) SHA1(02ca3d7703607bc0390a14d838fafb01a3e3cdef) ) /* CPU module stamped as 834-0128 */
+ ROM_LOAD( "1364.ic89", 0x2000, 0x2000, CRC(3192f83b) SHA1(78dabb75e38f5f8331bfc43dce852a4c4397f874) )
+ ROM_LOAD( "1365.ic103", 0x4000, 0x2000, CRC(23a3303a) SHA1(bcc4ab9203060b4043d779b7a242abc583093dbb) )
ROM_REGION( 0x20000, "sprites", 0 ) /* sprite data */
ROM_LOAD( "epr-1246.prom-ic84", 0x00000, 0x2000, CRC(555bfe9a) SHA1(1e56385475eeff044dcd9b44a154991d3efe995e) ) /* level 0 */
@@ -1130,6 +1245,60 @@ ROM_START( turbob )
ROM_END
+ROM_START( turbobl )
+ ROM_REGION( 0x6000, "maincpu", 0 )
+ ROM_LOAD( "ic76.bin", 0x0000, 0x2000, CRC(c208373b) SHA1(c1b8de41fe5cb20a262f8e8d1326deb9c8bdfe90) )
+ ROM_LOAD( "ic89.bin", 0x2000, 0x2000, CRC(93ebc86a) SHA1(26b78ef19610c88ce7783f7b7749b6fb34e6287d) )
+ ROM_LOAD( "ic103.bin", 0x4000, 0x2000, CRC(71876f74) SHA1(078b8b93971caa4e14f5e95fadf8c209b20d266e) )
+
+ ROM_REGION( 0x20000, "sprites", 0 ) /* sprite data */
+ ROM_LOAD( "a-ic84.bin", 0x00000, 0x2000, CRC(555bfe9a) SHA1(1e56385475eeff044dcd9b44a154991d3efe995e) ) /* level 0 */
+ ROM_RELOAD( 0x02000, 0x2000 )
+ ROM_LOAD( "b-ic86.bin", 0x04000, 0x2000, CRC(82fe5b94) SHA1(b96688ca0cfd90fdc4ee7c2e6c0b66726cc5713c) ) /* level 1 */ // ic86 and ic88 roms seem swapped compared to other sets, is it correct?
+ ROM_RELOAD( 0x06000, 0x2000 )
+ ROM_LOAD( "c-ic88.bin", 0x08000, 0x2000, CRC(95182020) SHA1(cd392a311da222727ce92801cb9d926ccdb08797) ) /* level 2 */
+ ROM_RELOAD( 0x0a000, 0x2000 )
+ ROM_LOAD( "e-ic90.bin", 0x0c000, 0x2000, CRC(0e857f82) SHA1(fbf0dcd11fd4fa09235c3f05d8e284b7dcc8f303) ) /* level 3 */
+ ROM_LOAD( "d-ic99.bin", 0x0e000, 0x2000, CRC(aee6e05e) SHA1(99b9b1ec996746ddf713ed38192f350f1f32a847) )
+ ROM_LOAD( "g-ic92.bin", 0x10000, 0x2000, CRC(292573de) SHA1(3ddc980d11478a6a6e4082c2f76c1ab82ffe2f36) ) /* level 4 */
+ ROM_LOAD( "f-ic100.bin",0x12000, 0x2000, CRC(aee6e05e) SHA1(99b9b1ec996746ddf713ed38192f350f1f32a847) )
+ ROM_LOAD( "k-ic94.bin", 0x14000, 0x2000, CRC(92783626) SHA1(13979eb964112436182d2a92f21803bcc28f4a4a) ) /* level 5 */
+ ROM_LOAD( "h-ic101.bin",0x16000, 0x2000, CRC(aee6e05e) SHA1(99b9b1ec996746ddf713ed38192f350f1f32a847) )
+ ROM_LOAD( "p-ic32.bin", 0x18000, 0x2000, CRC(485dcef9) SHA1(0f760ebb42cc2580a29758c72428a41d74477ce6) ) /* level 6 */
+ ROM_LOAD( "n-ic47.bin", 0x1a000, 0x2000, CRC(aee6e05e) SHA1(99b9b1ec996746ddf713ed38192f350f1f32a847) )
+ ROM_LOAD( "m-ic34.bin", 0x1c000, 0x2000, CRC(4ca984ce) SHA1(99f294fb203f23929b44baa2dd1825c67dde08a1) ) /* level 7 */
+ ROM_LOAD( "l-ic49.bin", 0x1e000, 0x2000, CRC(aee6e05e) SHA1(99b9b1ec996746ddf713ed38192f350f1f32a847) )
+
+ ROM_REGION( 0x1000, "fgtiles", 0 ) /* foreground data */
+ ROM_LOAD( "ic111.bin", 0x0000, 0x0800, CRC(fab3899b) SHA1(7e869084ab9ec9902490f5f40b7902c6c1f6d7c9) )
+ ROM_LOAD( "ic122.bin", 0x0800, 0x0800, CRC(e5fab290) SHA1(3c25e327105dcdba129a776bb73928683063818c) )
+
+ ROM_REGION( 0x4800, "road", 0 ) /* road data */
+ ROM_LOAD( "ic1.bin", 0x0000, 0x1000, CRC(c2f649a6) SHA1(a5b0ff6920187003fa2375ba2c5dfcd39382a9ed) )
+ ROM_LOAD( "ic13.bin", 0x1000, 0x1000, CRC(fefcf3be) SHA1(d1b56a8826fec2fcb8e586b7ca4ae67e9b52c911) )
+ ROM_LOAD( "ic27.bin", 0x2000, 0x1000, CRC(83195ee5) SHA1(482684e71db41234a31767763066dfc1c61de743) )
+ ROM_LOAD( "ic41.bin", 0x3000, 0x1000, CRC(3158a549) SHA1(1bae6d90dc8c924ba467d617dee7870d73dd0bea) )
+ ROM_LOAD( "ic74.bin", 0x4000, 0x0800, CRC(29854c48) SHA1(cab89bc30f83d9746931ddf6f95a6d0c8a517e5d) )
+
+ ROM_REGION( 0x100, "unkproms", 0 ) /* various PROMs */
+ ROM_LOAD( "ic90.bin", 0x0000, 0x0100, CRC(eb2fd7a2) SHA1(2c50ab05305bed4e336fc198f58dc3aa06a3bdfd) ) // bootleg specific?
+
+ ROM_REGION( 0x1020, "proms", 0 ) /* various PROMs */
+ ROM_LOAD( "74s288.ic13", 0x0000, 0x0020, CRC(78aded46) SHA1(c78afe804f8b8e837b0c502de5b8715a41fb92b9) ) /* road red/green color table */
+ ROM_LOAD( "74s288.ic18", 0x0020, 0x0020, CRC(172d0835) SHA1(e2125f5025d69021b799d0c80b61e05af53ec633) ) /* road collision/enable */ // different
+ ROM_LOAD( "74s288.ic20", 0x0040, 0x0020, CRC(3956767d) SHA1(073aaf57175526660fcf7af2e16e7f1d1aaba9a9) ) /* collision detection */
+ ROM_LOAD( "74s288.ic21", 0x0060, 0x0020, CRC(f06d9907) SHA1(f11db7800f41b03e79f5eef8d7ef3ae0a6277518) ) /* road green/blue color table */
+ ROM_LOAD( "ic99.bin", 0x0100, 0x0100, CRC(59f36e1c) SHA1(0d3ea6218f4ef1ac3181903e31eeea7786141f52) ) /* background color table */ // different
+
+ // PROMs below weren't in this zip, missing?
+ ROM_LOAD( "pr-1119.cpu-ic50", 0x0200, 0x0200, CRC(57ebd4bc) SHA1(932649da3537666f95833a8a8aff506217bd9aa1) ) /* sprite Y scaling */
+ ROM_LOAD( "pr-1120.cpu-ic62", 0x0400, 0x0200, CRC(8dd4c8a8) SHA1(e8d9cf08f115d57c44746fa0ff28f47b064b4193) ) /* video timing */
+ ROM_LOAD( "pr-1121.prom-ic29", 0x0600, 0x0200, CRC(7692f497) SHA1(42468c0705df9928e15ff8deb7e793a6c0c04353) ) /* palette */
+ ROM_LOAD( "pr-1122.prom-ic11", 0x0800, 0x0400, CRC(1a86ce70) SHA1(cab708b9a089b2e28f2298c1e4fae6e200923527) ) /* sprite priorities */
+ ROM_LOAD( "pr-1123.prom-ic12", 0x0c00, 0x0400, CRC(02d2cb52) SHA1(c34d6b60355747ce20fcb8d322df0e188d187f10) ) /* sprite/road/background priorities */
+ ROM_LOAD( "pr-1279.sound-ic40", 0x1000, 0x0020, CRC(b369a6ae) SHA1(dda7c6cf58ce5173f29a3084c85393c0c4587086) ) /* sound board PROM */
+ROM_END
+
ROM_START( subroc3d )
ROM_REGION( 0xa000, "maincpu", 0 )
ROM_LOAD( "epr-1614a.cpu-ic88", 0x0000, 0x2000, CRC(0ed856b4) SHA1(c2f48170365a53bff312ca20df5b74466de6349a) )
@@ -1178,7 +1347,7 @@ ROM_END
ROM_START( buckrog ) /* CPU BOARD Sega ID# 834-5158-01, ROM BOARD Sega ID# 834-5152-01 */
- ROM_REGION( 0xc000, "maincpu", 0 )
+ ROM_REGION( 0x8000, "maincpu", 0 )
ROM_LOAD( "epr-5265.cpu-ic3", 0x0000, 0x4000, CRC(f0055e97) SHA1(f6ee2afd6fef710949087d1cb04cbc242d1fa9f5) ) /* encrypted Z80 code, SEGA 315-5014 CPU */
ROM_LOAD( "epr-5266.cpu-ic4", 0x4000, 0x4000, CRC(7d084c39) SHA1(ef2c0a2a59e14d9e196fd3837139fc5acf0f63be) ) /* encrypted Z80 code, SEGA 315-5014 CPU */
@@ -1584,7 +1753,28 @@ DRIVER_INIT_MEMBER(turbo_state,turbo_enc)
DRIVER_INIT_MEMBER(turbo_state,buckrog_enc)
{
- buckrog_decode(machine(), "maincpu");
+ static const UINT8 convtable[32][4] =
+ {
+ /* opcode data address */
+ /* A B C D A B C D */
+ { 0x80,0x00,0x88,0x08 }, { 0x28,0x20,0xa8,0xa0 }, /* ...0...0...0...0 */
+ { 0x88,0xa8,0x80,0xa0 }, { 0xa0,0x80,0x20,0x00 }, /* ...0...0...0...1 */
+ { 0x28,0xa8,0x08,0x88 }, { 0xa8,0xa0,0x88,0x80 }, /* ...0...0...1...0 */
+ { 0x80,0x00,0x88,0x08 }, { 0x28,0x20,0xa8,0xa0 }, /* ...0...0...1...1 */
+ { 0x88,0xa8,0x80,0xa0 }, { 0xa0,0x80,0x20,0x00 }, /* ...0...1...0...0 */
+ { 0x80,0x00,0x88,0x08 }, { 0x28,0x20,0xa8,0xa0 }, /* ...0...1...0...1 */
+ { 0x28,0xa8,0x08,0x88 }, { 0xa8,0xa0,0x88,0x80 }, /* ...0...1...1...0 */
+ { 0x88,0xa8,0x80,0xa0 }, { 0xa0,0x80,0x20,0x00 }, /* ...0...1...1...1 */
+ { 0x28,0xa8,0x08,0x88 }, { 0xa8,0xa0,0x88,0x80 }, /* ...1...0...0...0 */
+ { 0x80,0x00,0x88,0x08 }, { 0x28,0x20,0xa8,0xa0 }, /* ...1...0...0...1 */
+ { 0x80,0x00,0x88,0x08 }, { 0x28,0x20,0xa8,0xa0 }, /* ...1...0...1...0 */
+ { 0x88,0xa8,0x80,0xa0 }, { 0xa0,0x80,0x20,0x00 }, /* ...1...0...1...1 */
+ { 0x80,0x00,0x88,0x08 }, { 0x28,0x20,0xa8,0xa0 }, /* ...1...1...0...0 */
+ { 0x88,0xa8,0x80,0xa0 }, { 0xa0,0x80,0x20,0x00 }, /* ...1...1...0...1 */
+ { 0x88,0xa8,0x80,0xa0 }, { 0xa0,0x80,0x20,0x00 }, /* ...1...1...1...0 */
+ { 0x28,0xa8,0x08,0x88 }, { 0xa8,0xa0,0x88,0x80 } /* ...1...1...1...1 */
+ };
+ sega_decode(memregion("maincpu")->base(), m_decrypted_opcodes, 0x8000, convtable);
}
@@ -1595,11 +1785,16 @@ DRIVER_INIT_MEMBER(turbo_state,buckrog_enc)
*
*************************************/
-GAMEL( 1981, turbo, 0, turbo, turbo, driver_device, 0, ROT270, "Sega", "Turbo", GAME_IMPERFECT_SOUND , layout_turbo )
-GAMEL( 1981, turboa, turbo, turbo, turbo, turbo_state, turbo_enc, ROT270, "Sega", "Turbo (encrypted set 1)", GAME_IMPERFECT_SOUND , layout_turbo )
-GAMEL( 1981, turbob, turbo, turbo, turbo, turbo_state, turbo_enc, ROT270, "Sega", "Turbo (encrypted set 2)", GAME_IMPERFECT_SOUND , layout_turbo )
-GAMEL( 1982, subroc3d, 0, subroc3d, subroc3d, driver_device, 0, ORIENTATION_FLIP_X, "Sega", "Subroc-3D", GAME_IMPERFECT_SOUND , layout_subroc3d )
-GAMEL( 1982, buckrog, 0, buckrog, buckrog, turbo_state, buckrog_enc, ROT0, "Sega", "Buck Rogers: Planet of Zoom", GAME_IMPERFECT_SOUND , layout_buckrog )
-GAMEL( 1982, buckrogn, buckrog, buckrog, buckrog, driver_device, 0, ROT0, "Sega", "Buck Rogers: Planet of Zoom (not encrypted, set 1)", GAME_IMPERFECT_SOUND , layout_buckrog )
-GAMEL( 1982, buckrogn2,buckrog, buckrog, buckrog, driver_device, 0, ROT0, "Sega", "Buck Rogers: Planet of Zoom (not encrypted, set 2)", GAME_IMPERFECT_SOUND , layout_buckrog )
-GAMEL( 1982, zoom909, buckrog, buckrog, buckrog, turbo_state, buckrog_enc, ROT0, "Sega", "Zoom 909", GAME_IMPERFECT_SOUND, layout_buckrog )
+GAMEL( 1981, turbo, 0, turbo, turbo, driver_device, 0, ROT270, "Sega", "Turbo (program 1513-1515)", GAME_IMPERFECT_SOUND , layout_turbo )
+GAMEL( 1981, turboa, turbo, turbo, turbo, turbo_state, turbo_enc, ROT270, "Sega", "Turbo (encrypted, program 1262-1264)", GAME_IMPERFECT_SOUND , layout_turbo )
+GAMEL( 1981, turbob, turbo, turbo, turbo, turbo_state, turbo_enc, ROT270, "Sega", "Turbo (encrypted, program 1363-1365 rev B)", GAME_IMPERFECT_SOUND , layout_turbo )
+GAMEL( 1981, turboc, turbo, turbo, turbo, turbo_state, turbo_enc, ROT270, "Sega", "Turbo (encrypted, program 1363-1365 rev A)", GAME_IMPERFECT_SOUND , layout_turbo )
+GAMEL( 1981, turbod, turbo, turbo, turbo, turbo_state, turbo_enc, ROT270, "Sega", "Turbo (encrypted, program 1363-1365)", GAME_IMPERFECT_SOUND , layout_turbo ) // but still reports 1262-1264 in the test mode?
+GAMEL( 1981, turbobl, turbo, turbo, turbo, driver_device, 0, ROT270, "bootleg", "Indianapolis (bootleg of Turbo)", GAME_IMPERFECT_SOUND , layout_turbo ) // decrypted bootleg of a 1262-1264 set
+
+GAMEL( 1982, subroc3d, 0, subroc3d, subroc3d, driver_device, 0, ORIENTATION_FLIP_X, "Sega", "Subroc-3D", GAME_IMPERFECT_SOUND , layout_subroc3d )
+
+GAMEL( 1982, buckrog, 0, buckrog, buckrog, turbo_state, buckrog_enc, ROT0, "Sega", "Buck Rogers: Planet of Zoom", GAME_IMPERFECT_SOUND , layout_buckrog )
+GAMEL( 1982, buckrogn, buckrog, buckrogu, buckrog, driver_device, 0, ROT0, "Sega", "Buck Rogers: Planet of Zoom (not encrypted, set 1)", GAME_IMPERFECT_SOUND , layout_buckrog )
+GAMEL( 1982, buckrogn2,buckrog, buckrogu, buckrog, driver_device, 0, ROT0, "Sega", "Buck Rogers: Planet of Zoom (not encrypted, set 2)", GAME_IMPERFECT_SOUND , layout_buckrog )
+GAMEL( 1982, zoom909, buckrog, buckrog, buckrog, turbo_state, buckrog_enc, ROT0, "Sega", "Zoom 909", GAME_IMPERFECT_SOUND, layout_buckrog )
diff --git a/src/mame/drivers/twin16.c b/src/mame/drivers/twin16.c
index 82522648a12..db0bfd2eaec 100644
--- a/src/mame/drivers/twin16.c
+++ b/src/mame/drivers/twin16.c
@@ -1282,5 +1282,5 @@ GAME( 1988, gradius2b, vulcan, twin16, vulcan, twin16_state, twin16,
GAME( 1988, fround, 0, fround, fround, fround_state, fround, ROT0, "Konami", "The Final Round (version M)", GAME_SUPPORTS_SAVE )
GAME( 1988, froundl, fround, fround, fround, fround_state, fround, ROT0, "Konami", "The Final Round (version L)", GAME_SUPPORTS_SAVE )
GAME( 1988, hpuncher, fround, twin16, fround, twin16_state, twin16, ROT0, "Konami", "Hard Puncher (Japan)", GAME_SUPPORTS_SAVE )
-GAME( 1989, miaj, mia, miaj, miaj, twin16_state, twin16, ROT0, "Konami", "M.I.A. - Missing in Action (Japan)", GAME_SUPPORTS_SAVE )
+GAME( 1989, miaj, mia, miaj, miaj, twin16_state, twin16, ROT0, "Konami", "M.I.A. - Missing in Action (version R) (Japan)", GAME_SUPPORTS_SAVE )
GAME( 1989, cuebrickj, cuebrick, cuebrickj, cuebrickj, cuebrickj_state, cuebrickj, ROT0, "Konami", "Cue Brick (Japan)", GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/undrfire.c b/src/mame/drivers/undrfire.c
index 077bb746270..57e1cb5a7e7 100644
--- a/src/mame/drivers/undrfire.c
+++ b/src/mame/drivers/undrfire.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Bryan McPhail, David Graves
/***************************************************************************
diff --git a/src/mame/drivers/vamphalf.c b/src/mame/drivers/vamphalf.c
index 7d601fefa28..87cdd763ad3 100644
--- a/src/mame/drivers/vamphalf.c
+++ b/src/mame/drivers/vamphalf.c
@@ -33,8 +33,7 @@
Notes:
- Mr Kicker is also known to exist (not dumped) on the F-E1-16-010 PCB that
- Semicom also used for Toy Land Adventure & SemiComDate Quiz Go Go Episode 2 game.
+ Mr Kicker: The F-E1-16-010 PCB version still needs proper speed ups
Mr Kicker: Doesn't boot without a valid default eeprom, but no longer seems to fail
after you get a high score (since eeprom rewrite).
@@ -50,7 +49,6 @@
Undumped Semicom games on similar hardware:
Red Wyvern - A semi-sequel or update?
Same time era, but unknown hardware:
- Gaia The last Choice of the Earth (c) 1998 (might be Baryon Future Assault type hardware)
Choice III: Joker's Dream (c) 2001
TODO:
@@ -141,7 +139,8 @@ public:
DECLARE_READ32_MEMBER(wyvernwg_speedup_r);
DECLARE_READ32_MEMBER(wyvernwga_speedup_r);
DECLARE_READ32_MEMBER(finalgdr_speedup_r);
- DECLARE_READ32_MEMBER(mrkicker_speedup_r);
+ DECLARE_READ32_MEMBER(mrkickera_speedup_r);
+ DECLARE_READ16_MEMBER(mrkicker_speedup_r);
DECLARE_READ16_MEMBER(dquizgo2_speedup_r);
DECLARE_READ32_MEMBER(aoh_speedup_r);
DECLARE_READ16_MEMBER(jmpbreak_speedup_r);
@@ -162,6 +161,7 @@ public:
DECLARE_WRITE32_MEMBER(finalgdr_oki_bank_w);
DECLARE_WRITE32_MEMBER(aoh_oki_bank_w);
DECLARE_WRITE16_MEMBER(boonggab_oki_bank_w);
+ DECLARE_WRITE16_MEMBER(mrkicker_oki_bank_w);
DECLARE_WRITE32_MEMBER(wyvernwg_snd_w);
DECLARE_WRITE16_MEMBER(misncrft_snd_w);
DECLARE_READ8_MEMBER(qs1000_p1_r);
@@ -171,7 +171,7 @@ public:
DECLARE_DRIVER_INIT(vamphalf);
DECLARE_DRIVER_INIT(vamphafk);
DECLARE_DRIVER_INIT(coolmini);
- DECLARE_DRIVER_INIT(mrkicker);
+ DECLARE_DRIVER_INIT(mrkickera);
DECLARE_DRIVER_INIT(mrdig);
DECLARE_DRIVER_INIT(jmpbreak);
DECLARE_DRIVER_INIT(dtfamily);
@@ -187,6 +187,7 @@ public:
DECLARE_DRIVER_INIT(boonggab);
DECLARE_DRIVER_INIT(wyvernwg);
DECLARE_DRIVER_INIT(yorijori);
+ DECLARE_DRIVER_INIT(mrkicker);
UINT32 screen_update_common(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_aoh(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
@@ -339,6 +340,12 @@ WRITE16_MEMBER(vamphalf_state::boonggab_oki_bank_w)
m_oki->set_bank_base(0x40000 * (data & 0x7));
}
+
+WRITE16_MEMBER(vamphalf_state::mrkicker_oki_bank_w)
+{
+ m_oki->set_bank_base(0x40000 * (data & 0x3));
+}
+
WRITE16_MEMBER(vamphalf_state::boonggab_prize_w)
{
if(offset)
@@ -450,6 +457,7 @@ static ADDRESS_MAP_START( misncrft_io, AS_IO, 16, vamphalf_state )
ADDRESS_MAP_END
static ADDRESS_MAP_START( coolmini_io, AS_IO, 16, vamphalf_state )
+// AM_RANGE(0x002, 0x003) AM_WRITE(mrkicker_oki_bank_w) // not coolmini?, installed on init
AM_RANGE(0x200, 0x203) AM_WRITE(flipscreen_w)
AM_RANGE(0x300, 0x303) AM_READ_PORT("SYSTEM")
AM_RANGE(0x304, 0x307) AM_READ_PORT("P1_P2")
@@ -499,7 +507,7 @@ static ADDRESS_MAP_START( finalgdr_io, AS_IO, 32, vamphalf_state )
AM_RANGE(0x60a0, 0x60a3) AM_WRITE(finalgdr_oki_bank_w)
ADDRESS_MAP_END
-static ADDRESS_MAP_START( mrkicker_io, AS_IO, 32, vamphalf_state )
+static ADDRESS_MAP_START( mrkickera_io, AS_IO, 32, vamphalf_state )
AM_RANGE(0x2400, 0x2403) AM_READ(eeprom32_r)
AM_RANGE(0x4000, 0x4003) AM_READNOP //?
AM_RANGE(0x4000, 0x4003) AM_WRITE(finalgdr_eeprom_w)
@@ -513,6 +521,8 @@ static ADDRESS_MAP_START( mrkicker_io, AS_IO, 32, vamphalf_state )
AM_RANGE(0x7c00, 0x7c03) AM_READ_PORT("SYSTEM")
ADDRESS_MAP_END
+
+
static ADDRESS_MAP_START( jmpbreak_io, AS_IO, 16, vamphalf_state )
AM_RANGE(0x0c0, 0x0c3) AM_NOP // ?
AM_RANGE(0x100, 0x103) AM_WRITENOP // ?
@@ -975,8 +985,9 @@ static MACHINE_CONFIG_START( common, vamphalf_state )
MCFG_CPU_VBLANK_INT_DRIVER("screen", vamphalf_state, irq1_line_hold)
MCFG_EEPROM_SERIAL_93C46_ADD("eeprom")
- MCFG_EEPROM_ERASE_TIME(attotime::from_usec(250)) // coolmini requires fast erase
- MCFG_EEPROM_WRITE_TIME(attotime::from_usec(250)) // dtfamily requires fast write
+ // various games require fast timing to save settings, probably because our Hyperstone core timings are incorrect
+ MCFG_EEPROM_ERASE_TIME(attotime::from_usec(1))
+ MCFG_EEPROM_WRITE_TIME(attotime::from_usec(1))
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -1095,10 +1106,10 @@ static MACHINE_CONFIG_DERIVED( finalgdr, common )
MCFG_FRAGMENT_ADD(sound_ym_oki)
MACHINE_CONFIG_END
-static MACHINE_CONFIG_DERIVED( mrkicker, common )
+static MACHINE_CONFIG_DERIVED( mrkickera, common )
MCFG_CPU_REPLACE("maincpu", E132T, XTAL_50MHz) /* 50 MHz */
MCFG_CPU_PROGRAM_MAP(common_32bit_map)
- MCFG_CPU_IO_MAP(mrkicker_io)
+ MCFG_CPU_IO_MAP(mrkickera_io)
MCFG_CPU_VBLANK_INT_DRIVER("screen", vamphalf_state, irq1_line_hold)
MCFG_NVRAM_ADD_0FILL("nvram")
@@ -1106,6 +1117,8 @@ static MACHINE_CONFIG_DERIVED( mrkicker, common )
MCFG_FRAGMENT_ADD(sound_ym_oki)
MACHINE_CONFIG_END
+
+
static MACHINE_CONFIG_START( aoh, vamphalf_state )
MCFG_CPU_ADD("maincpu", E132XN, XTAL_20MHz*4) /* 4x internal multiplier */
MCFG_CPU_PROGRAM_MAP(aoh_map)
@@ -2164,7 +2177,6 @@ ROM_END
Mr. Kicker (c) SemiCom
SEMICOM-003b
-
+---------------------------------------------+
| +------+ |
| YM3012 | U7 | |
@@ -2205,12 +2217,56 @@ SW1 is the reset button
SW2 is the setup button
VR1 is the volume adjust pot
+
+F-E1-16-010
++-----------------------------------------------+
+| VR1 YM3012 VROM1 |
+| YM2151 M6295 ROML03 ROMU03|
+| CRAM2 ROML02 ROMU02|
+| CRAM1 ROML01 ROMU01|
+| MEM1L ROML00 ROMU00|
+|J MEM1U |
+|A MEM2 +----------++----------+ |
+|M | || | |
+|M MEM3 |Quicklogic||Quicklogic| 2|
+|A | QL2003- || QL2003- | 8|
+| MEM6 | XPL84C || XPL84C | M|
+| | || | H|
+| MEM7 +----------++----------+ z|
+| GAL |
+| 93C46 ROM1* |
+|P1 P2 50MHz E1-16T DRAM1 ROM2 |
++-----------------------------------------------+
+
+Notes:
+CPU - Hyperstone E1-16T @ 50.000MHz
+
+DRAM1 - LG Semi GM71C18163 1M x16 EDO DRAM (SOJ44)
+CRAMx - W24M257AK-15 32K x8 SRAM (SOJ28)
+MEMx - UM61256FK-15 32K x8 SRAM (SOJ28)
+
+Oki M6295 rebaged as AD-65
+YM3012/YM2151 rebaged as BS902/KA51
+
+ P1 - Reset push button
+ P2 - Setup push button
+VR1 - Volume adjust pot
+
+ROMs:
+ ROML00 & ROMH00 - Macronix MX29F1610MC-12 SOP44 16MBit FlashROM
+ ROML01 & ROMH01 - Unpopulated space for MX29F1610MC-12 SOP44 16MBit FlashROM
+ ROML02 & ROMH02 - Unpopulated space for MX29F1610MC-12 SOP44 16MBit FlashROM
+ ROML03 & ROMH03 - Unpopulated space for MX29F1610MC-12 SOP44 16MBit FlashROM
+ VROM1 - MX 27C2000 2MBit DIP32 EPROM
+ * ROM1 - Unpopulated space for DIP32 EPROM (up to 4MBit)
+ ROM2 - 27C040 4MBit DIP32 EPROM
+
*/
-ROM_START( mrkicker )
+ROM_START( mrkickera )
ROM_REGION32_BE( 0x100000, "user1", ROMREGION_ERASE00 ) /* Hyperstone CPU Code */
/* rom0 empty */
- ROM_LOAD( "2-semicom.rom1", 0x080000, 0x080000, CRC(d3da29ca) SHA1(b843c650096a1c6d50f99e354ec0c93eb4406c5b) )
+ ROM_LOAD( "2-semicom.rom1", 0x080000, 0x080000, CRC(d3da29ca) SHA1(b843c650096a1c6d50f99e354ec0c93eb4406c5b) ) /* SEMICOM-003b PCB */
ROM_REGION( 0x800000, "gfx1", 0 ) /* gfx data */
ROM_LOAD32_WORD( "roml00", 0x000000, 0x200000, CRC(c677aac3) SHA1(356073a29260e8e6c29dd12b2113b30140c6108c) )
@@ -2233,10 +2289,41 @@ ROM_START( mrkicker )
ROM_COPY( "user2", 0x000000, 0x0c0000, 0x020000)
ROM_COPY( "user2", 0x060000, 0x0e0000, 0x020000)
- ROM_REGION16_BE( 0x80, "eeprom", 0 ) /* Default EEPROM (it doesn't boot without and the game code crashes) */
+ ROM_REGION16_BE( 0x80, "eeprom", 0 ) /* Default EEPROM (it doesn't boot without and the game code crashes) (game also refuses to boot if program attempts to rewrite it, CPU bug or protection?) */
ROM_LOAD( "eeprom-mrkicker.bin", 0x0000, 0x0080, CRC(87afb8f7) SHA1(444203b793c1d7929fc5916f18b510198719cd38) )
ROM_END
+ROM_START( mrkicker )
+ ROM_REGION16_BE( 0x100000, "user1", ROMREGION_ERASE00 ) /* Hyperstone CPU Code */
+ /* rom1 empty */
+ ROM_LOAD( "3-semicom.rom2", 0x080000, 0x080000, CRC(3f7fa08b) SHA1(dbffd44d8387e6ed1a4b5ec85ccf64d69a108d88) ) /* F-E1-16-010 PCB */
+
+ ROM_REGION( 0x800000, "gfx1", 0 ) /* gfx data */
+ ROM_LOAD32_WORD( "roml00", 0x000000, 0x200000, CRC(c677aac3) SHA1(356073a29260e8e6c29dd12b2113b30140c6108c) )
+ ROM_LOAD32_WORD( "romh00", 0x000002, 0x200000, CRC(b6337d4a) SHA1(2f46e2933af7fd0f71083900d5e6e4f602ab4c66) )
+ /* roml01 empty */
+ /* romh01 empty */
+ /* roml02 empty */
+ /* romh02 empty */
+ /* roml03 empty */
+ /* romh03 empty */
+
+ ROM_REGION( 0x080000, "user2", 0 ) /* Oki Samples */
+ ROM_LOAD( "11-semicom.vrom1", 0x000000, 0x080000, CRC(e8141fcd) SHA1(256fd1987030e0a1df0a66a228c1fea996cda686) ) /* same data as above */
+
+ /* $00000-$20000 stays the same in all sound banks, */
+ /* the second half of the bank is what gets switched */
+ ROM_REGION( 0x100000, "oki", 0 ) /* Samples */
+ ROM_COPY( "user2", 0x000000, 0x000000, 0x020000)
+ ROM_COPY( "user2", 0x000000, 0x020000, 0x020000)
+ ROM_COPY( "user2", 0x000000, 0x040000, 0x020000)
+ ROM_COPY( "user2", 0x020000, 0x060000, 0x020000)
+ ROM_COPY( "user2", 0x000000, 0x080000, 0x020000)
+ ROM_COPY( "user2", 0x040000, 0x0a0000, 0x020000)
+ ROM_COPY( "user2", 0x000000, 0x0c0000, 0x020000)
+ ROM_COPY( "user2", 0x060000, 0x0e0000, 0x020000)
+ROM_END
+
/*
Age Of Heroes - Silkroad 2
Unico, 2001
@@ -2568,7 +2655,7 @@ READ32_MEMBER(vamphalf_state::finalgdr_speedup_r)
return m_wram32[0x005e874/4];
}
-READ32_MEMBER(vamphalf_state::mrkicker_speedup_r)
+READ32_MEMBER(vamphalf_state::mrkickera_speedup_r)
{
UINT32 pc = space.device().safe_pc();
if(pc == 0x469de || pc == 0x46a36)
@@ -2582,6 +2669,17 @@ READ32_MEMBER(vamphalf_state::mrkicker_speedup_r)
return m_wram32[0x00701a4/4];
}
+READ16_MEMBER(vamphalf_state::mrkicker_speedup_r)
+{
+ UINT32 pc = space.device().safe_pc();
+ if(pc == 0x41ec6)
+ {
+ space.device().execute().eat_cycles(50);
+ }
+
+ return m_wram[0x00063fc0/2];
+}
+
READ16_MEMBER(vamphalf_state::dquizgo2_speedup_r)
{
@@ -2704,6 +2802,15 @@ DRIVER_INIT_MEMBER(vamphalf_state,coolmini)
m_flip_bit = 1;
}
+DRIVER_INIT_MEMBER(vamphalf_state,mrkicker)
+{
+ m_maincpu->space(AS_PROGRAM).install_read_handler(0x00063fc0, 0x00063fc1, read16_delegate(FUNC(vamphalf_state::mrkicker_speedup_r), this));
+ m_maincpu->space(AS_IO).install_write_handler(0x002, 0x003, write16_delegate(FUNC(vamphalf_state::mrkicker_oki_bank_w), this));
+
+ m_palshift = 0;
+ m_flip_bit = 1;
+}
+
DRIVER_INIT_MEMBER(vamphalf_state,suplup)
{
m_maincpu->space(AS_PROGRAM).install_read_handler(0x0011605c, 0x0011605f, read16_delegate(FUNC(vamphalf_state::suplup_speedup_r), this));
@@ -2801,12 +2908,12 @@ DRIVER_INIT_MEMBER(vamphalf_state,finalgdr)
save_item(NAME(m_semicom_prot_which));
}
-DRIVER_INIT_MEMBER(vamphalf_state,mrkicker)
+DRIVER_INIT_MEMBER(vamphalf_state,mrkickera)
{
// backup ram isn't used
m_finalgdr_backupram_bank = 1;
m_finalgdr_backupram = auto_alloc_array(machine(), UINT8, 0x80*0x100);
- m_maincpu->space(AS_PROGRAM).install_read_handler(0x00701a4, 0x00701a7, read32_delegate(FUNC(vamphalf_state::mrkicker_speedup_r), this));
+ m_maincpu->space(AS_PROGRAM).install_read_handler(0x00701a4, 0x00701a7, read32_delegate(FUNC(vamphalf_state::mrkickera_speedup_r), this));
machine().device<nvram_device>("nvram")->set_base(m_finalgdr_backupram, 0x80*0x100);
m_palshift = 0;
@@ -2894,7 +3001,8 @@ GAME( 2000, misncrfta, misncrft, misncrft, common, vamphalf_state, misncrft, R
GAME( 2000, mrdig, 0, mrdig, common, vamphalf_state, mrdig, ROT0, "Sun", "Mr. Dig", GAME_SUPPORTS_SAVE )
GAME( 2001, dtfamily, 0, coolmini, common, vamphalf_state, dtfamily, ROT0, "SemiCom", "Diet Family", GAME_SUPPORTS_SAVE )
GAME( 2001, finalgdr, 0, finalgdr, finalgdr, vamphalf_state, finalgdr, ROT0, "SemiCom", "Final Godori (Korea, version 2.20.5915)", GAME_SUPPORTS_SAVE )
-GAME( 2001, mrkicker, 0, mrkicker, finalgdr, vamphalf_state, mrkicker, ROT0, "SemiCom", "Mr. Kicker", GAME_SUPPORTS_SAVE )
+GAME( 2001, mrkicker, 0, coolmini, common, vamphalf_state, mrkicker,ROT0, "SemiCom", "Mr. Kicker (F-E1-16-010 PCB)", GAME_SUPPORTS_SAVE )
+GAME( 2001, mrkickera, mrkicker, mrkickera,finalgdr, vamphalf_state, mrkickera, ROT0, "SemiCom", "Mr. Kicker (SEMICOM-003b PCB)", GAME_SUPPORTS_SAVE | GAME_NOT_WORKING ) // if you allow eeprom saving works then this set corrupts the eeprom and then won't boot
GAME( 2001, toyland, 0, coolmini, common, vamphalf_state, toyland, ROT0, "SemiCom", "Toy Land Adventure", GAME_SUPPORTS_SAVE )
GAME( 2001, wivernwg, 0, wyvernwg, common, vamphalf_state, wyvernwg, ROT270, "SemiCom", "Wivern Wings", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
GAME( 2001, wyvernwg, wivernwg, wyvernwg, common, vamphalf_state, wyvernwg, ROT270, "SemiCom (Game Vision license)", "Wyvern Wings (set 1)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/vastar.c b/src/mame/drivers/vastar.c
index 28b5d9ebb11..105dc168696 100644
--- a/src/mame/drivers/vastar.c
+++ b/src/mame/drivers/vastar.c
@@ -105,6 +105,12 @@ Vsync : 60.58hz
#include "sound/ay8910.h"
#include "includes/vastar.h"
+
+void vastar_state::machine_start()
+{
+ save_item(NAME(m_nmi_mask));
+}
+
void vastar_state::machine_reset()
{
/* we must start with the second CPU halted */
@@ -119,7 +125,7 @@ void vastar_state::machine_reset()
m_spriteram3 = m_fgvideoram + 0x800;
}
-WRITE8_MEMBER(vastar_state::vastar_hold_cpu2_w)
+WRITE8_MEMBER(vastar_state::hold_cpu2_w)
{
/* I'm not sure that this works exactly like this */
m_subcpu->set_input_line(INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE);
@@ -138,10 +144,10 @@ WRITE8_MEMBER(vastar_state::nmi_mask_w)
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, vastar_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM
- AM_RANGE(0x8000, 0x8fff) AM_RAM_WRITE(vastar_bg2videoram_w) AM_SHARE("bg2videoram") AM_MIRROR(0x2000)
- AM_RANGE(0x9000, 0x9fff) AM_RAM_WRITE(vastar_bg1videoram_w) AM_SHARE("bg1videoram") AM_MIRROR(0x2000)
+ AM_RANGE(0x8000, 0x8fff) AM_RAM_WRITE(bg2videoram_w) AM_SHARE("bg2videoram") AM_MIRROR(0x2000)
+ AM_RANGE(0x9000, 0x9fff) AM_RAM_WRITE(bg1videoram_w) AM_SHARE("bg1videoram") AM_MIRROR(0x2000)
AM_RANGE(0xc000, 0xc000) AM_WRITEONLY AM_SHARE("sprite_priority") /* sprite/BG priority */
- AM_RANGE(0xc400, 0xcfff) AM_RAM_WRITE(vastar_fgvideoram_w) AM_SHARE("fgvideoram") // fg videoram + sprites
+ AM_RANGE(0xc400, 0xcfff) AM_RAM_WRITE(fgvideoram_w) AM_SHARE("fgvideoram") // fg videoram + sprites
AM_RANGE(0xe000, 0xe000) AM_READWRITE(watchdog_reset_r, watchdog_reset_w)
AM_RANGE(0xf000, 0xf7ff) AM_RAM AM_SHARE("sharedram")
ADDRESS_MAP_END
@@ -150,7 +156,7 @@ static ADDRESS_MAP_START( main_port_map, AS_IO, 8, vastar_state )
ADDRESS_MAP_GLOBAL_MASK(0x0f)
AM_RANGE(0x00, 0x00) AM_WRITE(nmi_mask_w)
AM_RANGE(0x01, 0x01) AM_WRITE(flip_screen_w)
- AM_RANGE(0x02, 0x02) AM_WRITE(vastar_hold_cpu2_w)
+ AM_RANGE(0x02, 0x02) AM_WRITE(hold_cpu2_w)
ADDRESS_MAP_END
@@ -432,7 +438,7 @@ static MACHINE_CONFIG_START( vastar, vastar_state )
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
MCFG_SCREEN_SIZE(32*8, 32*8)
MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(vastar_state, screen_update_vastar)
+ MCFG_SCREEN_UPDATE_DRIVER(vastar_state, screen_update)
MCFG_SCREEN_PALETTE("palette")
MCFG_GFXDECODE_ADD("gfxdecode", "palette", vastar)
@@ -643,8 +649,8 @@ ROM_START( pprobe )
ROM_END
-GAME( 1983, vastar, 0, vastar, vastar, driver_device, 0, ROT90, "Sesame Japan", "Vastar (set 1)", 0 )
-GAME( 1983, vastar2, vastar, vastar, vastar, driver_device, 0, ROT90, "Sesame Japan", "Vastar (set 2)", 0 )
-GAME( 1983, vastar3, vastar, vastar, vastar, driver_device, 0, ROT90, "Sesame Japan", "Vastar (set 3)", 0 )
-GAME( 1983, vastar4, vastar, vastar, vastar4,driver_device, 0, ROT90, "Sesame Japan", "Vastar (set 4)", 0 )
-GAME( 1985, pprobe, 0, vastar, pprobe, driver_device, 0, ROT90, "Crux / Kyugo?", "Planet Probe (prototype?)", 0 ) // has no Copyright, probably because Crux didn't have a trading name at this point?
+GAME( 1983, vastar, 0, vastar, vastar, driver_device, 0, ROT90, "Orca (Sesame Japan license)", "Vastar (set 1)", GAME_SUPPORTS_SAVE ) // Sesame Japan was a brand of Fujikousan
+GAME( 1983, vastar2, vastar, vastar, vastar, driver_device, 0, ROT90, "Orca (Sesame Japan license)", "Vastar (set 2)", GAME_SUPPORTS_SAVE )
+GAME( 1983, vastar3, vastar, vastar, vastar, driver_device, 0, ROT90, "Orca (Sesame Japan license)", "Vastar (set 3)", GAME_SUPPORTS_SAVE )
+GAME( 1983, vastar4, vastar, vastar, vastar4,driver_device, 0, ROT90, "Orca (Sesame Japan license)", "Vastar (set 4)", GAME_SUPPORTS_SAVE )
+GAME( 1985, pprobe, 0, vastar, pprobe, driver_device, 0, ROT90, "Crux / Kyugo?", "Planet Probe (prototype?)", GAME_SUPPORTS_SAVE ) // has no Copyright, probably because Crux didn't have a trading name at this point?
diff --git a/src/mame/drivers/vcombat.c b/src/mame/drivers/vcombat.c
index 895e9c6f8cf..59f2e785435 100644
--- a/src/mame/drivers/vcombat.c
+++ b/src/mame/drivers/vcombat.c
@@ -98,8 +98,6 @@ public:
vcombat_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_tlc34076(*this, "tlc34076"),
- m_vid_0_shared_ram(*this, "vid_0_ram"),
- m_vid_1_shared_ram(*this, "vid_1_ram"),
m_framebuffer_ctrl(*this, "fb_control"),
m_maincpu(*this, "maincpu"),
m_soundcpu(*this, "soundcpu"),
@@ -110,8 +108,6 @@ public:
UINT16* m_m68k_framebuffer[2];
UINT16* m_i860_framebuffer[2][2];
required_device<tlc34076_device> m_tlc34076;
- required_shared_ptr<UINT16> m_vid_0_shared_ram;
- required_shared_ptr<UINT16> m_vid_1_shared_ram;
required_shared_ptr<UINT16> m_framebuffer_ctrl;
int m_crtc_select;
DECLARE_WRITE16_MEMBER(main_video_write);
@@ -125,8 +121,6 @@ public:
DECLARE_WRITE64_MEMBER(v0_fb_w);
DECLARE_WRITE64_MEMBER(v1_fb_w);
DECLARE_WRITE16_MEMBER(crtc_w);
- DECLARE_DIRECT_UPDATE_MEMBER(vcombat_vid_0_direct_handler);
- DECLARE_DIRECT_UPDATE_MEMBER(vcombat_vid_1_direct_handler);
DECLARE_WRITE16_MEMBER(vcombat_dac_w);
DECLARE_WRITE_LINE_MEMBER(sound_update);
DECLARE_DRIVER_INIT(shadfgtr);
@@ -435,38 +429,10 @@ MACHINE_RESET_MEMBER(vcombat_state,shadfgtr)
}
-DIRECT_UPDATE_MEMBER(vcombat_state::vcombat_vid_0_direct_handler)
-{
- if (address >= 0xfffc0000 && address <= 0xffffffff)
- {
- direct.explicit_configure(0xfffc0000, 0xffffffff, 0x3ffff, m_vid_0_shared_ram);
- return ~0;
- }
- return address;
-}
-
-DIRECT_UPDATE_MEMBER(vcombat_state::vcombat_vid_1_direct_handler)
-{
- if (address >= 0xfffc0000 && address <= 0xffffffff)
- {
- direct.explicit_configure(0xfffc0000, 0xffffffff, 0x3ffff, m_vid_1_shared_ram);
- return ~0;
- }
- return address;
-}
-
-
DRIVER_INIT_MEMBER(vcombat_state,vcombat)
{
UINT8 *ROM = memregion("maincpu")->base();
- /* The two i860s execute out of RAM */
- address_space &v0space = m_vid_0->space(AS_PROGRAM);
- v0space.set_direct_update_handler(direct_update_delegate(FUNC(vcombat_state::vcombat_vid_0_direct_handler), this));
-
- address_space &v1space = m_vid_1->space(AS_PROGRAM);
- v1space.set_direct_update_handler(direct_update_delegate(FUNC(vcombat_state::vcombat_vid_1_direct_handler), this));
-
/* Allocate the 68000 framebuffers */
m_m68k_framebuffer[0] = auto_alloc_array(machine(), UINT16, 0x8000);
m_m68k_framebuffer[1] = auto_alloc_array(machine(), UINT16, 0x8000);
@@ -506,10 +472,6 @@ DRIVER_INIT_MEMBER(vcombat_state,shadfgtr)
m_i860_framebuffer[0][1] = auto_alloc_array(machine(), UINT16, 0x8000);
m_i860_framebuffer[1][0] = NULL;
m_i860_framebuffer[1][1] = NULL;
-
- /* The i860 executes out of RAM */
- address_space &space = m_vid_0->space(AS_PROGRAM);
- space.set_direct_update_handler(direct_update_delegate(FUNC(vcombat_state::vcombat_vid_0_direct_handler), this));
}
diff --git a/src/mame/drivers/vendetta.c b/src/mame/drivers/vendetta.c
index f4ebce8f1e0..e468f581e81 100644
--- a/src/mame/drivers/vendetta.c
+++ b/src/mame/drivers/vendetta.c
@@ -571,6 +571,31 @@ ROM_START( vendettar )
ROM_LOAD( "vendettar.nv", 0x0000, 0x080, CRC(ec3f0449) SHA1(da35b98cd10bfabe9df3ede05462fabeb0e01ca9) )
ROM_END
+ROM_START( vendettaz )
+ ROM_REGION( 0x48000, "maincpu", 0 ) /* code + banked roms + banked ram */
+ ROM_LOAD( "081z01.bin", 0x10000, 0x38000, CRC(4d225a8d) SHA1(fe8f6e63d033cf04c9a287d870db244fddb81f03) )
+ ROM_CONTINUE( 0x08000, 0x08000 )
+
+ ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for the sound CPU */
+ ROM_LOAD( "081b02", 0x000000, 0x10000, CRC(4c604d9b) SHA1(22d979f5dbde7912dd927bf5538fdbfc5b82905e) )
+
+ ROM_REGION( 0x100000, "k052109", 0 ) /* tiles */
+ ROM_LOAD32_WORD( "081a09", 0x000000, 0x080000, CRC(b4c777a9) SHA1(cc2b1dff4404ecd72b604e25d00fffdf7f0f8b52) )
+ ROM_LOAD32_WORD( "081a08", 0x000002, 0x080000, CRC(272ac8d9) SHA1(2da12fe4c13921bf0d4ebffec326f8d207ec4fad) )
+
+ ROM_REGION( 0x400000, "gfx2", 0 ) /* graphics ( don't dispose as the program can read them ) */
+ ROM_LOAD64_WORD( "081a04", 0x000000, 0x100000, CRC(464b9aa4) SHA1(28066ff0a07c3e56e7192918a882778c1b316b37) ) /* sprites */
+ ROM_LOAD64_WORD( "081a05", 0x000002, 0x100000, CRC(4e173759) SHA1(ce803f2aca7d7dedad00ab30e112443848747bd2) ) /* sprites */
+ ROM_LOAD64_WORD( "081a06", 0x000004, 0x100000, CRC(e9fe6d80) SHA1(2b7fc9d7fe43cd85dc8b975fe639c273cb0d9256) ) /* sprites */
+ ROM_LOAD64_WORD( "081a07", 0x000006, 0x100000, CRC(8a22b29a) SHA1(be539f21518e13038ab1d4cc2b2a901dd3e621f4) ) /* sprites */
+
+ ROM_REGION( 0x100000, "k053260", 0 ) /* 053260 samples */
+ ROM_LOAD( "081a03", 0x000000, 0x100000, CRC(14b6baea) SHA1(fe15ee57f19f5acaad6c1642d51f390046a7468a) )
+
+ ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
+ ROM_LOAD( "vendetta.nv", 0x0000, 0x080, CRC(fbac4e30) SHA1(d3ff3a392550d9b06400b9292a44bdac7ba5c801) )
+ROM_END
+
ROM_START( vendetta2p )
ROM_REGION( 0x48000, "maincpu", 0 ) /* code + banked roms + banked ram */
ROM_LOAD( "081w01", 0x10000, 0x38000, CRC(cee57132) SHA1(8b6413877e127511daa76278910c2ee3247d613a) )
@@ -596,6 +621,7 @@ ROM_START( vendetta2p )
ROM_LOAD( "vendetta.nv", 0x0000, 0x080, CRC(fbac4e30) SHA1(d3ff3a392550d9b06400b9292a44bdac7ba5c801) )
ROM_END
+
ROM_START( vendetta2peba )
ROM_REGION( 0x48000, "maincpu", 0 ) /* code + banked roms + banked ram */
ROM_LOAD( "081-eb-a01.17c", 0x10000, 0x38000, CRC(8430bb52) SHA1(54e896510fa44e76b0640b17150210fbf6b3b5bc)) // Label was unclear apart from EB stamp on the middle line. Bottom line looked like 401, but probably A01
@@ -770,7 +796,8 @@ DRIVER_INIT_MEMBER(vendetta_state,esckids)
GAME( 1991, vendetta, 0, vendetta, vendet4p, vendetta_state, vendetta, ROT0, "Konami", "Vendetta (World, 4 Players, ver. T)", GAME_SUPPORTS_SAVE )
-GAME( 1991, vendettar, vendetta, vendetta, vendet4p, vendetta_state, vendetta, ROT0, "Konami", "Vendetta (World, 4 Players, ver. R)", GAME_SUPPORTS_SAVE )
+GAME( 1991, vendettar, vendetta, vendetta, vendet4p, vendetta_state, vendetta, ROT0, "Konami", "Vendetta (US, 4 Players, ver. R)", GAME_SUPPORTS_SAVE )
+GAME( 1991, vendettaz, vendetta, vendetta, vendet4p, vendetta_state, vendetta, ROT0, "Konami", "Vendetta (Asia, 4 Players, ver. Z)", GAME_SUPPORTS_SAVE )
GAME( 1991, vendetta2p, vendetta, vendetta, vendetta, vendetta_state, vendetta, ROT0, "Konami", "Vendetta (World, 2 Players, ver. W)", GAME_SUPPORTS_SAVE )
GAME( 1991, vendetta2peba,vendetta,vendetta, vendetta, vendetta_state, vendetta, ROT0, "Konami", "Vendetta (World, 2 Players, ver. EB-A?)", GAME_SUPPORTS_SAVE )
GAME( 1991, vendetta2pu, vendetta, vendetta, vendetta, vendetta_state, vendetta, ROT0, "Konami", "Vendetta (Asia, 2 Players, ver. U)", GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/vicdual.c b/src/mame/drivers/vicdual.c
index bbbbe302140..3a1148fe2ec 100644
--- a/src/mame/drivers/vicdual.c
+++ b/src/mame/drivers/vicdual.c
@@ -92,7 +92,7 @@ void vicdual_state::assert_coin_status()
m_coin_status = 1;
}
-CUSTOM_INPUT_MEMBER(vicdual_state::vicdual_read_coin_status)
+CUSTOM_INPUT_MEMBER(vicdual_state::read_coin_status)
{
return m_coin_status;
}
@@ -150,25 +150,25 @@ int vicdual_state::get_vcounter()
}
-CUSTOM_INPUT_MEMBER(vicdual_state::vicdual_get_64v)
+CUSTOM_INPUT_MEMBER(vicdual_state::get_64v)
{
return (get_vcounter() >> 6) & 0x01;
}
-CUSTOM_INPUT_MEMBER(vicdual_state::vicdual_get_vblank_comp)
+CUSTOM_INPUT_MEMBER(vicdual_state::get_vblank_comp)
{
return (get_vcounter() < VICDUAL_VBSTART);
}
-CUSTOM_INPUT_MEMBER(vicdual_state::vicdual_get_composite_blank_comp)
+CUSTOM_INPUT_MEMBER(vicdual_state::get_composite_blank_comp)
{
- return (vicdual_get_vblank_comp(field, 0) && !m_screen->hblank());
+ return (get_vblank_comp(field, 0) && !m_screen->hblank());
}
-CUSTOM_INPUT_MEMBER(vicdual_state::vicdual_get_timer_value)
+CUSTOM_INPUT_MEMBER(vicdual_state::get_timer_value)
{
/* return the state of the timer (old code claims "4MHz square wave", but it was toggled once every 2msec, or 500Hz) */
return machine().time().as_ticks(500) & 1;
@@ -184,7 +184,7 @@ CUSTOM_INPUT_MEMBER(vicdual_state::vicdual_get_timer_value)
#define COLOR_BW_PORT_TAG "COLOR_BW"
-int vicdual_state::vicdual_is_cabinet_color()
+int vicdual_state::is_cabinet_color()
{
return (ioport(COLOR_BW_PORT_TAG)->read_safe(0) & 1) ? 0 : 1;
}
@@ -205,14 +205,14 @@ int vicdual_state::vicdual_is_cabinet_color()
*************************************/
-WRITE8_MEMBER(vicdual_state::vicdual_videoram_w)
+WRITE8_MEMBER(vicdual_state::videoram_w)
{
m_screen->update_now();
m_videoram[offset] = data;
}
-WRITE8_MEMBER(vicdual_state::vicdual_characterram_w)
+WRITE8_MEMBER(vicdual_state::characterram_w)
{
m_screen->update_now();
m_characterram[offset] = data;
@@ -241,10 +241,6 @@ void vicdual_state::machine_start()
save_item(NAME(m_psgData));
}
-void vicdual_state::machine_reset()
-{
-}
-
static MACHINE_CONFIG_START( vicdual_root, vicdual_state )
@@ -286,9 +282,9 @@ WRITE8_MEMBER(vicdual_state::depthch_io_w)
static ADDRESS_MAP_START( depthch_map, AS_PROGRAM, 8, vicdual_state )
AM_RANGE(0x0000, 0x3fff) AM_MIRROR(0x4000) AM_ROM
- AM_RANGE(0x8000, 0x83ff) AM_MIRROR(0x7000) AM_RAM_WRITE(vicdual_videoram_w) AM_SHARE("videoram")
+ AM_RANGE(0x8000, 0x83ff) AM_MIRROR(0x7000) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram")
AM_RANGE(0x8400, 0x87ff) AM_MIRROR(0x7000) AM_RAM
- AM_RANGE(0x8800, 0x8fff) AM_MIRROR(0x7000) AM_RAM_WRITE(vicdual_characterram_w) AM_SHARE("characterram")
+ AM_RANGE(0x8800, 0x8fff) AM_MIRROR(0x7000) AM_RAM_WRITE(characterram_w) AM_SHARE("characterram")
ADDRESS_MAP_END
@@ -315,9 +311,9 @@ static INPUT_PORTS_START( depthch )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
PORT_START("IN1")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_get_64v, NULL)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_64v, NULL)
PORT_BIT( 0x7e, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_read_coin_status, NULL)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, read_coin_status, NULL)
PORT_COIN_DEFAULT
INPUT_PORTS_END
@@ -332,7 +328,7 @@ static MACHINE_CONFIG_DERIVED( depthch, vicdual_root )
/* video hardware */
MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_UPDATE_DRIVER(vicdual_state, screen_update_vicdual_bw)
+ MCFG_SCREEN_UPDATE_DRIVER(vicdual_state, screen_update_bw)
/* audio hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
@@ -369,9 +365,9 @@ static ADDRESS_MAP_START( safari_map, AS_PROGRAM, 8, vicdual_state )
AM_RANGE(0x0000, 0x3fff) AM_ROM
AM_RANGE(0x4000, 0x7fff) AM_NOP /* unused */
AM_RANGE(0x8000, 0x8fff) AM_MIRROR(0x3000) AM_RAM
- AM_RANGE(0xc000, 0xc3ff) AM_MIRROR(0x3000) AM_RAM_WRITE(vicdual_videoram_w) AM_SHARE("videoram")
+ AM_RANGE(0xc000, 0xc3ff) AM_MIRROR(0x3000) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram")
AM_RANGE(0xc400, 0xc7ff) AM_MIRROR(0x3000) AM_RAM
- AM_RANGE(0xc800, 0xcfff) AM_MIRROR(0x3000) AM_RAM_WRITE(vicdual_characterram_w) AM_SHARE("characterram")
+ AM_RANGE(0xc800, 0xcfff) AM_MIRROR(0x3000) AM_RAM_WRITE(characterram_w) AM_SHARE("characterram")
ADDRESS_MAP_END
@@ -396,7 +392,7 @@ static INPUT_PORTS_START( safari )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_START("IN1")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_get_64v, NULL)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_64v, NULL)
PORT_BIT( 0x0e, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coinage ) )
PORT_DIPSETTING( 0x00, DEF_STR( 4C_1C ) )
@@ -404,7 +400,7 @@ static INPUT_PORTS_START( safari )
PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_read_coin_status, NULL)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, read_coin_status, NULL)
PORT_COIN_DEFAULT
INPUT_PORTS_END
@@ -419,7 +415,7 @@ static MACHINE_CONFIG_DERIVED( safari, vicdual_root )
/* video hardware */
MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_UPDATE_DRIVER(vicdual_state, screen_update_vicdual_bw)
+ MCFG_SCREEN_UPDATE_DRIVER(vicdual_state, screen_update_bw)
MACHINE_CONFIG_END
@@ -450,9 +446,9 @@ WRITE8_MEMBER(vicdual_state::frogs_io_w)
static ADDRESS_MAP_START( frogs_map, AS_PROGRAM, 8, vicdual_state )
AM_RANGE(0x0000, 0x3fff) AM_MIRROR(0x4000) AM_ROM
- AM_RANGE(0x8000, 0x83ff) AM_MIRROR(0x7000) AM_RAM_WRITE(vicdual_videoram_w) AM_SHARE("videoram")
+ AM_RANGE(0x8000, 0x83ff) AM_MIRROR(0x7000) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram")
AM_RANGE(0x8400, 0x87ff) AM_MIRROR(0x7000) AM_RAM
- AM_RANGE(0x8800, 0x8fff) AM_MIRROR(0x7000) AM_RAM_WRITE(vicdual_characterram_w) AM_SHARE("characterram")
+ AM_RANGE(0x8800, 0x8fff) AM_MIRROR(0x7000) AM_RAM_WRITE(characterram_w) AM_SHARE("characterram")
ADDRESS_MAP_END
@@ -488,9 +484,9 @@ static INPUT_PORTS_START( frogs )
PORT_CONFSETTING( 0x40, DEF_STR( 1C_1C ) )
PORT_START("IN1")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_get_64v, NULL)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_64v, NULL)
PORT_BIT( 0x7e, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_read_coin_status, NULL)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, read_coin_status, NULL)
PORT_COIN_DEFAULT
@@ -525,7 +521,7 @@ static MACHINE_CONFIG_DERIVED( frogs, vicdual_root )
/* video hardware */
MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_UPDATE_DRIVER(vicdual_state, screen_update_vicdual_bw)
+ MCFG_SCREEN_UPDATE_DRIVER(vicdual_state, screen_update_bw)
/* audio hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
@@ -568,16 +564,16 @@ WRITE8_MEMBER(vicdual_state::headon_io_w)
{
if (offset & 0x01) assert_coin_status();
if (offset & 0x02) headon_audio_w(space, 0, data);
- if (offset & 0x04) { /* vicdual_palette_bank_w(0, data) */ } /* not written to */
+ if (offset & 0x04) { /* palette_bank_w(0, data) */ } /* not written to */
}
static ADDRESS_MAP_START( headon_map, AS_PROGRAM, 8, vicdual_state )
AM_RANGE(0x0000, 0x1fff) AM_MIRROR(0x6000) AM_ROM
AM_RANGE(0x8000, 0xbfff) AM_NOP /* unused */
- AM_RANGE(0xc000, 0xc3ff) AM_MIRROR(0x3000) AM_RAM_WRITE(vicdual_videoram_w) AM_SHARE("videoram")
+ AM_RANGE(0xc000, 0xc3ff) AM_MIRROR(0x3000) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram")
AM_RANGE(0xc400, 0xc7ff) AM_MIRROR(0x3000) AM_RAM
- AM_RANGE(0xc800, 0xcfff) AM_MIRROR(0x3000) AM_RAM_WRITE(vicdual_characterram_w) AM_SHARE("characterram")
+ AM_RANGE(0xc800, 0xcfff) AM_MIRROR(0x3000) AM_RAM_WRITE(characterram_w) AM_SHARE("characterram")
ADDRESS_MAP_END
@@ -616,9 +612,9 @@ static INPUT_PORTS_START( headon )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY
PORT_START("IN1")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_get_64v, NULL)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_64v, NULL)
PORT_BIT( 0x7e, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_read_coin_status, NULL)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, read_coin_status, NULL)
PORT_CABINET_COLOR_OR_BW
@@ -642,10 +638,10 @@ static INPUT_PORTS_START( headonmz )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY
PORT_START("IN1")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_get_64v, NULL)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_64v, NULL)
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) // protection? (check on startup)
PORT_BIT( 0x7a, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_read_coin_status, NULL)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, read_coin_status, NULL)
PORT_CABINET_COLOR_OR_BW
@@ -678,12 +674,12 @@ static INPUT_PORTS_START( supcrash )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY
PORT_START("IN1")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_get_timer_value, NULL)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_timer_value, NULL)
PORT_DIPNAME( 0x04, 0x04, "Rom Test" )
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_BIT( 0x7a, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_read_coin_status, NULL)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, read_coin_status, NULL)
PORT_COIN_DEFAULT
INPUT_PORTS_END
@@ -701,9 +697,9 @@ static INPUT_PORTS_START( carnivalh )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("IN1")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_get_composite_blank_comp, NULL)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_composite_blank_comp, NULL)
PORT_BIT( 0x7e, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_read_coin_status, NULL)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, read_coin_status, NULL)
PORT_CABINET_COLOR_OR_BW
@@ -745,9 +741,9 @@ static INPUT_PORTS_START( sspaceat )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_START("IN2")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_get_timer_value, NULL)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_timer_value, NULL)
PORT_BIT( 0x7e, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_read_coin_status, NULL)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, read_coin_status, NULL)
PORT_CABINET_COLOR_OR_BW
@@ -764,7 +760,7 @@ static MACHINE_CONFIG_DERIVED( headon, vicdual_root )
/* video hardware */
MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_UPDATE_DRIVER(vicdual_state, screen_update_vicdual_bw_or_color)
+ MCFG_SCREEN_UPDATE_DRIVER(vicdual_state, screen_update_bw_or_color)
/* audio hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
@@ -775,7 +771,7 @@ static MACHINE_CONFIG_DERIVED( headons, headon )
/* video hardware */
MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_UPDATE_DRIVER(vicdual_state, screen_update_vicdual_bw)
+ MCFG_SCREEN_UPDATE_DRIVER(vicdual_state, screen_update_bw)
MACHINE_CONFIG_END
@@ -788,7 +784,7 @@ static MACHINE_CONFIG_DERIVED( sspaceat, vicdual_root )
/* video hardware */
MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_UPDATE_DRIVER(vicdual_state, screen_update_vicdual_bw_or_color)
+ MCFG_SCREEN_UPDATE_DRIVER(vicdual_state, screen_update_bw_or_color)
MACHINE_CONFIG_END
@@ -818,7 +814,7 @@ WRITE8_MEMBER(vicdual_state::headon2_io_w)
{
if (offset & 0x01) assert_coin_status();
if (offset & 0x02) headon_audio_w(space, 0, data);
- if (offset & 0x04) vicdual_palette_bank_w(space, 0, data);
+ if (offset & 0x04) palette_bank_w(space, 0, data);
if (offset & 0x08) { /* schematics show this as going into a shifter circuit, but never written to */ }
if (offset & 0x10) { /* schematics show this as going to an edge connector, but never written to */ }
if (offset & 0x18) logerror("********* Write to port %x\n", offset);
@@ -831,7 +827,7 @@ WRITE8_MEMBER(vicdual_state::digger_io_w)
if (offset & 0x02) { /* digger_audio_1_w(0, data) */ }
if (offset & 0x04)
{
- vicdual_palette_bank_w(space, 0, data & 0x03);
+ palette_bank_w(space, 0, data & 0x03);
/* digger_audio_2_w(0, data & 0xfc); */
}
@@ -844,9 +840,9 @@ WRITE8_MEMBER(vicdual_state::digger_io_w)
static ADDRESS_MAP_START( headon2_map, AS_PROGRAM, 8, vicdual_state )
AM_RANGE(0x0000, 0x1fff) AM_MIRROR(0x6000) AM_ROM
/* AM_RANGE(0x8000, 0x80ff) AM_MIRROR(0x3f00) */ /* schematics show this as battery backed RAM, but doesn't appear to be used */
- AM_RANGE(0xc000, 0xc3ff) AM_MIRROR(0x3000) AM_RAM_WRITE(vicdual_videoram_w) AM_SHARE("videoram")
+ AM_RANGE(0xc000, 0xc3ff) AM_MIRROR(0x3000) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram")
AM_RANGE(0xc400, 0xc7ff) AM_MIRROR(0x3000) AM_RAM
- AM_RANGE(0xc800, 0xcfff) AM_MIRROR(0x3000) AM_RAM_WRITE(vicdual_characterram_w) AM_SHARE("characterram")
+ AM_RANGE(0xc800, 0xcfff) AM_MIRROR(0x3000) AM_RAM_WRITE(characterram_w) AM_SHARE("characterram")
ADDRESS_MAP_END
@@ -889,12 +885,12 @@ static INPUT_PORTS_START( headon2 )
PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
PORT_START("IN2")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_get_timer_value, NULL)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_timer_value, NULL)
PORT_DIPNAME( 0x02, 0x02, DEF_STR( Demo_Sounds ) )
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x02, DEF_STR( On ) )
PORT_BIT( 0x7c, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_read_coin_status, NULL)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, read_coin_status, NULL)
PORT_COIN_DEFAULT
INPUT_PORTS_END
@@ -923,12 +919,12 @@ static INPUT_PORTS_START( car2 )
PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* probably unused */
PORT_START("IN2")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_get_timer_value, NULL)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_timer_value, NULL)
PORT_DIPNAME( 0x02, 0x02, DEF_STR( Demo_Sounds ) )
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x02, DEF_STR( On ) )
PORT_BIT( 0x7c, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_read_coin_status, NULL)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, read_coin_status, NULL)
PORT_COIN_DEFAULT
INPUT_PORTS_END
@@ -966,10 +962,10 @@ static INPUT_PORTS_START( digger )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_START("IN2")
-// PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_get_timer_value, NULL) // it's like this according to the schematics, but gameplay speed is too fast;
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_get_composite_blank_comp, NULL) // gameplay speed is correct now, there's likely an error in the schematics then...
+// PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_timer_value, NULL) // it's like this according to the schematics, but gameplay speed is too fast;
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_composite_blank_comp, NULL) // gameplay speed is correct now, there's likely an error in the schematics then...
PORT_BIT( 0x7e, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_read_coin_status, NULL)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, read_coin_status, NULL)
PORT_COIN_DEFAULT
INPUT_PORTS_END
@@ -984,7 +980,7 @@ static MACHINE_CONFIG_DERIVED( headon2, vicdual_root )
/* video hardware */
MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_UPDATE_DRIVER(vicdual_state, screen_update_vicdual_color)
+ MCFG_SCREEN_UPDATE_DRIVER(vicdual_state, screen_update_color)
/* audio hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
@@ -996,7 +992,7 @@ static MACHINE_CONFIG_DERIVED( headon2bw, headon2 )
/* basic machine hardware */
/* video hardware */
MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_UPDATE_DRIVER(vicdual_state, screen_update_vicdual_bw)
+ MCFG_SCREEN_UPDATE_DRIVER(vicdual_state, screen_update_bw)
MACHINE_CONFIG_END
@@ -1009,7 +1005,7 @@ static MACHINE_CONFIG_DERIVED( digger, vicdual_root )
/* video hardware */
MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_UPDATE_DRIVER(vicdual_state, screen_update_vicdual_color)
+ MCFG_SCREEN_UPDATE_DRIVER(vicdual_state, screen_update_color)
MACHINE_CONFIG_END
@@ -1034,7 +1030,7 @@ WRITE8_MEMBER(vicdual_state::invho2_io_w)
if (offset & 0x01) invho2_audio_w(space, 0, data);
if (offset & 0x02) invinco_audio_w(space, 0, data);
if (offset & 0x08) assert_coin_status();
- if (offset & 0x40) vicdual_palette_bank_w(space, 0, data);
+ if (offset & 0x40) palette_bank_w(space, 0, data);
}
@@ -1043,7 +1039,7 @@ WRITE8_MEMBER(vicdual_state::invds_io_w)
if (offset & 0x01) invinco_audio_w(space, 0, data);
if (offset & 0x02) { /* deepscan_audio_w(0, data) */ }
if (offset & 0x08) assert_coin_status();
- if (offset & 0x40) vicdual_palette_bank_w(space, 0, data);
+ if (offset & 0x40) palette_bank_w(space, 0, data);
}
WRITE8_MEMBER(vicdual_state::carhntds_io_w)
@@ -1051,7 +1047,7 @@ WRITE8_MEMBER(vicdual_state::carhntds_io_w)
if (offset & 0x01) { /* invinco_audio_w(space, 0, data); */ }
if (offset & 0x02) { /* deepscan_audio_w(0, data) */ }
if (offset & 0x08) assert_coin_status();
- if (offset & 0x40) vicdual_palette_bank_w(space, 0, data);
+ if (offset & 0x40) palette_bank_w(space, 0, data);
}
@@ -1060,14 +1056,14 @@ WRITE8_MEMBER(vicdual_state::sspacaho_io_w)
if (offset & 0x01) invho2_audio_w(space, 0, data);
if (offset & 0x02) { /* sspaceatt_audio_w(space, 0, data) */ }
if (offset & 0x08) assert_coin_status();
- if (offset & 0x40) vicdual_palette_bank_w(space, 0, data);
+ if (offset & 0x40) palette_bank_w(space, 0, data);
}
WRITE8_MEMBER(vicdual_state::tranqgun_io_w)
{
if (offset & 0x01) { /* tranqgun_audio_w(space, 0, data) */ }
- if (offset & 0x02) vicdual_palette_bank_w(space, 0, data);
+ if (offset & 0x02) palette_bank_w(space, 0, data);
if (offset & 0x08) assert_coin_status();
}
@@ -1077,7 +1073,7 @@ WRITE8_MEMBER(vicdual_state::spacetrk_io_w)
if (offset & 0x01) { /* spacetrk_audio_w(space, 0, data) */ }
if (offset & 0x02) { /* spacetrk_audio_w(space, 0, data) */ }
if (offset & 0x08) assert_coin_status();
- if (offset & 0x40) vicdual_palette_bank_w(space, 0, data);
+ if (offset & 0x40) palette_bank_w(space, 0, data);
}
@@ -1086,14 +1082,14 @@ WRITE8_MEMBER(vicdual_state::carnival_io_w)
if (offset & 0x01) carnival_audio_1_w(space, 0, data);
if (offset & 0x02) carnival_audio_2_w(space, 0, data);
if (offset & 0x08) assert_coin_status();
- if (offset & 0x40) vicdual_palette_bank_w(space, 0, data);
+ if (offset & 0x40) palette_bank_w(space, 0, data);
}
WRITE8_MEMBER(vicdual_state::brdrline_io_w)
{
if (offset & 0x01) { /* brdrline_audio_w(space, 0, data) */ }
- if (offset & 0x02) vicdual_palette_bank_w(space, 0, data);
+ if (offset & 0x02) palette_bank_w(space, 0, data);
if (offset & 0x08) assert_coin_status();
}
@@ -1103,7 +1099,7 @@ WRITE8_MEMBER(vicdual_state::pulsar_io_w)
if (offset & 0x01) pulsar_audio_1_w(space, 0, data);
if (offset & 0x02) pulsar_audio_2_w(space, 0, data);
if (offset & 0x08) assert_coin_status();
- if (offset & 0x40) vicdual_palette_bank_w(space, 0, data);
+ if (offset & 0x40) palette_bank_w(space, 0, data);
}
@@ -1120,22 +1116,22 @@ WRITE8_MEMBER(vicdual_state::alphaho_io_w)
if (offset & 0x01) { /* headon_audio_w(0, data) */ }
if (offset & 0x02) { /* alphaf_audio_w(0, data) */ }
if (offset & 0x08) assert_coin_status();
- if (offset & 0x40) vicdual_palette_bank_w(space, 0, data);
+ if (offset & 0x40) palette_bank_w(space, 0, data);
}
static ADDRESS_MAP_START( vicdual_dualgame_map, AS_PROGRAM, 8, vicdual_state )
AM_RANGE(0x0000, 0x3fff) AM_MIRROR(0x4000) AM_ROM
- AM_RANGE(0x8000, 0x83ff) AM_MIRROR(0x7000) AM_RAM_WRITE(vicdual_videoram_w) AM_SHARE("videoram")
+ AM_RANGE(0x8000, 0x83ff) AM_MIRROR(0x7000) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram")
AM_RANGE(0x8400, 0x87ff) AM_MIRROR(0x7000) AM_RAM
- AM_RANGE(0x8800, 0x8fff) AM_MIRROR(0x7000) AM_RAM_WRITE(vicdual_characterram_w) AM_SHARE("characterram")
+ AM_RANGE(0x8800, 0x8fff) AM_MIRROR(0x7000) AM_RAM_WRITE(characterram_w) AM_SHARE("characterram")
ADDRESS_MAP_END
static ADDRESS_MAP_START( carhntds_dualgame_map, AS_PROGRAM, 8, vicdual_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM // also has part of a rom mapped at 0x4000
- AM_RANGE(0x8000, 0x83ff) AM_MIRROR(0x7000) AM_RAM_WRITE(vicdual_videoram_w) AM_SHARE("videoram")
+ AM_RANGE(0x8000, 0x83ff) AM_MIRROR(0x7000) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram")
AM_RANGE(0x8400, 0x87ff) AM_MIRROR(0x7000) AM_RAM
- AM_RANGE(0x8800, 0x8fff) AM_MIRROR(0x7000) AM_RAM_WRITE(vicdual_characterram_w) AM_SHARE("characterram")
+ AM_RANGE(0x8800, 0x8fff) AM_MIRROR(0x7000) AM_RAM_WRITE(characterram_w) AM_SHARE("characterram")
ADDRESS_MAP_END
static ADDRESS_MAP_START( invho2_io_map, AS_IO, 8, vicdual_state )
@@ -1291,7 +1287,7 @@ ADDRESS_MAP_END
/* several of the games' lives DIPs are spread across two input ports */
-CUSTOM_INPUT_MEMBER(vicdual_state::vicdual_fake_lives_r)
+CUSTOM_INPUT_MEMBER(vicdual_state::fake_lives_r)
{
static const char *const portnames[] = { "FAKE_LIVES1", "FAKE_LIVES2" };
@@ -1308,7 +1304,7 @@ static INPUT_PORTS_START( invho2 )
PORT_START("IN0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_fake_lives_r, (void *)0x001)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, fake_lives_r, (void *)0x001)
PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:5") // SW1 @ C1, 6-pos (is #6 unconnected?)
PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
@@ -1319,8 +1315,8 @@ static INPUT_PORTS_START( invho2 )
PORT_START("IN1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_fake_lives_r, (void *)0x002)
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_get_composite_blank_comp, NULL)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, fake_lives_r, (void *)0x002)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_composite_blank_comp, NULL)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1328,8 +1324,8 @@ static INPUT_PORTS_START( invho2 )
PORT_START("IN2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_fake_lives_r, (void *)0x101)
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_get_timer_value, NULL)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, fake_lives_r, (void *)0x101)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_timer_value, NULL)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1337,8 +1333,8 @@ static INPUT_PORTS_START( invho2 )
PORT_START("IN3")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_fake_lives_r, (void *)0x102)
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_read_coin_status, NULL)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, fake_lives_r, (void *)0x102)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, read_coin_status, NULL)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Game Select") PORT_TOGGLE
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1371,7 +1367,7 @@ static INPUT_PORTS_START( carhntds )
PORT_START("IN0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_fake_lives_r, (void *)0x001)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, fake_lives_r, (void *)0x001)
PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:5") // SW1 @ C1, 6-pos (is #6 unconnected?)
PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
@@ -1382,8 +1378,8 @@ static INPUT_PORTS_START( carhntds )
PORT_START("IN1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_fake_lives_r, (void *)0x002)
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_get_composite_blank_comp, NULL)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, fake_lives_r, (void *)0x002)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_composite_blank_comp, NULL)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1391,8 +1387,8 @@ static INPUT_PORTS_START( carhntds )
PORT_START("IN2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_fake_lives_r, (void *)0x101)
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_get_timer_value, NULL)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, fake_lives_r, (void *)0x101)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_timer_value, NULL)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1400,8 +1396,8 @@ static INPUT_PORTS_START( carhntds )
PORT_START("IN3")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_fake_lives_r, (void *)0x102)
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_read_coin_status, NULL)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, fake_lives_r, (void *)0x102)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, read_coin_status, NULL)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Game Select") PORT_TOGGLE
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1428,7 +1424,7 @@ static INPUT_PORTS_START( invds )
PORT_START("IN0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_fake_lives_r, (void *)0x001)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, fake_lives_r, (void *)0x001)
PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:5") // SW1 @ C1, 6-pos (is #6 unconnected?)
PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
@@ -1439,8 +1435,8 @@ static INPUT_PORTS_START( invds )
PORT_START("IN1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_fake_lives_r, (void *)0x002)
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_get_composite_blank_comp, NULL)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, fake_lives_r, (void *)0x002)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_composite_blank_comp, NULL)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1448,8 +1444,8 @@ static INPUT_PORTS_START( invds )
PORT_START("IN2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_fake_lives_r, (void *)0x101)
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_get_timer_value, NULL)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, fake_lives_r, (void *)0x101)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_timer_value, NULL)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1457,8 +1453,8 @@ static INPUT_PORTS_START( invds )
PORT_START("IN3")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_fake_lives_r, (void *)0x102)
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_read_coin_status, NULL)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, fake_lives_r, (void *)0x102)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, read_coin_status, NULL)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Game Select") PORT_TOGGLE
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1486,7 +1482,7 @@ static INPUT_PORTS_START( sspacaho )
PORT_START("IN0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_fake_lives_r, (void *)0x001)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, fake_lives_r, (void *)0x001)
PORT_DIPNAME( 0x08, 0x00, "Head On Lives" ) PORT_DIPLOCATION("SW1:5") // SW1 @ C1, 6-pos (is #6 unconnected?)
PORT_DIPSETTING( 0x00, "3" )
PORT_DIPSETTING( 0x08, "4" )
@@ -1497,8 +1493,8 @@ static INPUT_PORTS_START( sspacaho )
PORT_START("IN1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_fake_lives_r, (void *)0x002)
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_get_composite_blank_comp, NULL)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, fake_lives_r, (void *)0x002)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_composite_blank_comp, NULL)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1509,7 +1505,7 @@ static INPUT_PORTS_START( sspacaho )
PORT_DIPNAME( 0x04, 0x00, "Space Attack Bonus Life" ) PORT_DIPLOCATION("SW1:3")
PORT_DIPSETTING( 0x00, "10000" )
PORT_DIPSETTING( 0x04, "15000" )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_get_timer_value, NULL)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_timer_value, NULL)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1520,7 +1516,7 @@ static INPUT_PORTS_START( sspacaho )
PORT_DIPNAME( 0x04, 0x00, "Space Attack Final UFO Bonus" ) PORT_DIPLOCATION("SW1:4")
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_read_coin_status, NULL)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, read_coin_status, NULL)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Game Select") PORT_TOGGLE
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1556,7 +1552,7 @@ static INPUT_PORTS_START( tranqgun )
PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:2")
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_get_vblank_comp, NULL)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_vblank_comp, NULL)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1567,7 +1563,7 @@ static INPUT_PORTS_START( tranqgun )
PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:3")
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_get_timer_value, NULL)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_timer_value, NULL)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1578,7 +1574,7 @@ static INPUT_PORTS_START( tranqgun )
PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:4")
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_read_coin_status, NULL)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, read_coin_status, NULL)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1607,7 +1603,7 @@ static INPUT_PORTS_START( spacetrk )
PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:2") // unknown, but used
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_get_composite_blank_comp, NULL)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_composite_blank_comp, NULL)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1618,7 +1614,7 @@ static INPUT_PORTS_START( spacetrk )
PORT_DIPNAME( 0x04, 0x04, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:3")
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x04, DEF_STR( On ) )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_get_timer_value, NULL)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_timer_value, NULL)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1629,7 +1625,7 @@ static INPUT_PORTS_START( spacetrk )
PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:4")
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_read_coin_status, NULL)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, read_coin_status, NULL)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1679,7 +1675,7 @@ static INPUT_PORTS_START( carnival )
PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:2")
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_get_composite_blank_comp, NULL)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_composite_blank_comp, NULL)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1690,7 +1686,7 @@ static INPUT_PORTS_START( carnival )
PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:3")
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_get_timer_value, NULL)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_timer_value, NULL)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1701,7 +1697,7 @@ static INPUT_PORTS_START( carnival )
PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:4")
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_read_coin_status, NULL)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, read_coin_status, NULL)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1728,7 +1724,7 @@ static INPUT_PORTS_START( brdrline )
PORT_START("IN0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_fake_lives_r, (void *)0x001)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, fake_lives_r, (void *)0x001)
PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:5") // SW1 @ C1, 8-pos (is 6-8 unconnected?)
PORT_DIPSETTING( 0x00, DEF_STR( Upright ) )
PORT_DIPSETTING( 0x08, DEF_STR( Cocktail ) )
@@ -1739,8 +1735,8 @@ static INPUT_PORTS_START( brdrline )
PORT_START("IN1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_fake_lives_r, (void *)0x002)
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_get_vblank_comp, NULL)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, fake_lives_r, (void *)0x002)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_vblank_comp, NULL)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1748,8 +1744,8 @@ static INPUT_PORTS_START( brdrline )
PORT_START("IN2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_fake_lives_r, (void *)0x004)
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_get_64v, NULL) /* yes, this is different */
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, fake_lives_r, (void *)0x004)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_64v, NULL) /* yes, this is different */
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1760,7 +1756,7 @@ static INPUT_PORTS_START( brdrline )
PORT_DIPNAME( 0x04, 0x04, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:4")
PORT_DIPSETTING( 0x04, "15000" )
PORT_DIPSETTING( 0x00, "20000" )
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_read_coin_status, NULL)
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, read_coin_status, NULL)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1801,7 +1797,7 @@ static INPUT_PORTS_START( pulsar )
PORT_START("IN0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_fake_lives_r, (void *)0x001)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, fake_lives_r, (void *)0x001)
PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:5") // SW1 @ C1, 6-pos (is #6 unconnected?)
PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
@@ -1812,8 +1808,8 @@ static INPUT_PORTS_START( pulsar )
PORT_START("IN1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_fake_lives_r, (void *)0x002)
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_get_composite_blank_comp, NULL)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, fake_lives_r, (void *)0x002)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_composite_blank_comp, NULL)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1824,7 +1820,7 @@ static INPUT_PORTS_START( pulsar )
PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:3")
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_get_timer_value, NULL)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_timer_value, NULL)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1835,7 +1831,7 @@ static INPUT_PORTS_START( pulsar )
PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:4")
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_read_coin_status, NULL)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, read_coin_status, NULL)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1871,7 +1867,7 @@ static INPUT_PORTS_START( heiankyo )
PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:2") // bonus life?
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_get_composite_blank_comp, NULL)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_composite_blank_comp, NULL)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1882,7 +1878,7 @@ static INPUT_PORTS_START( heiankyo )
PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:3") // bonus life?
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_get_timer_value, NULL)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_timer_value, NULL)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* has to be 0, protection? */
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1893,7 +1889,7 @@ static INPUT_PORTS_START( heiankyo )
PORT_DIPNAME( 0x04, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:4")
PORT_DIPSETTING( 0x00, "3" )
PORT_DIPSETTING( 0x04, "5" )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_read_coin_status, NULL)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, read_coin_status, NULL)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1906,7 +1902,7 @@ static INPUT_PORTS_START( alphaho )
PORT_START("IN0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_fake_lives_r, (void *)0x001)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, fake_lives_r, (void *)0x001)
PORT_DIPNAME( 0x08, 0x00, "Head On Lives" ) PORT_DIPLOCATION("SW1:5") // SW1 @ C1, 6-pos (is #6 unconnected?)
PORT_DIPSETTING( 0x00, "3" )
PORT_DIPSETTING( 0x08, "4" )
@@ -1917,8 +1913,8 @@ static INPUT_PORTS_START( alphaho )
PORT_START("IN1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_fake_lives_r, (void *)0x002)
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_get_composite_blank_comp, NULL)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, fake_lives_r, (void *)0x002)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_composite_blank_comp, NULL)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1929,7 +1925,7 @@ static INPUT_PORTS_START( alphaho )
PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:3")
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_get_timer_value, NULL)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_timer_value, NULL)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1940,7 +1936,7 @@ static INPUT_PORTS_START( alphaho )
PORT_DIPNAME( 0x04, 0x00, "Alpha Fighter Unknown" ) PORT_DIPLOCATION("SW1:4") // related to soccer frequency (code at 0x4950)
PORT_DIPSETTING( 0x00, DEF_STR ( Off ) )
PORT_DIPSETTING( 0x04, DEF_STR ( On ) )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_read_coin_status, NULL)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, read_coin_status, NULL)
PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Game Select") PORT_TOGGLE
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1964,7 +1960,7 @@ static MACHINE_CONFIG_DERIVED( vicdual_dualgame_root, vicdual_root )
/* video hardware */
MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_UPDATE_DRIVER(vicdual_state, screen_update_vicdual_color)
+ MCFG_SCREEN_UPDATE_DRIVER(vicdual_state, screen_update_color)
MACHINE_CONFIG_END
@@ -2122,16 +2118,16 @@ WRITE8_MEMBER(vicdual_state::samurai_io_w)
{
if (offset & 0x02) { /* samurai_audio_w(0, data) */ }
if (offset & 0x08) assert_coin_status();
- if (offset & 0x40) vicdual_palette_bank_w(space, 0, data);
+ if (offset & 0x40) palette_bank_w(space, 0, data);
}
/* dual game hardware */
static ADDRESS_MAP_START( samurai_map, AS_PROGRAM, 8, vicdual_state )
AM_RANGE(0x0000, 0x3fff) AM_MIRROR(0x4000) AM_ROM AM_WRITE(samurai_protection_w)
- AM_RANGE(0x8000, 0x83ff) AM_MIRROR(0x7000) AM_RAM_WRITE(vicdual_videoram_w) AM_SHARE("videoram")
+ AM_RANGE(0x8000, 0x83ff) AM_MIRROR(0x7000) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram")
AM_RANGE(0x8400, 0x87ff) AM_MIRROR(0x7000) AM_RAM
- AM_RANGE(0x8800, 0x8fff) AM_MIRROR(0x7000) AM_RAM_WRITE(vicdual_characterram_w) AM_SHARE("characterram")
+ AM_RANGE(0x8800, 0x8fff) AM_MIRROR(0x7000) AM_RAM_WRITE(characterram_w) AM_SHARE("characterram")
ADDRESS_MAP_END
@@ -2169,7 +2165,7 @@ static INPUT_PORTS_START( samurai )
PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:2") // unknown, but used
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_get_composite_blank_comp, NULL)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_composite_blank_comp, NULL)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -2180,7 +2176,7 @@ static INPUT_PORTS_START( samurai )
PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:3")
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_get_timer_value, NULL)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_timer_value, NULL)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -2191,7 +2187,7 @@ static INPUT_PORTS_START( samurai )
PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:4")
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_read_coin_status, NULL)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, read_coin_status, NULL)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -2219,7 +2215,7 @@ static MACHINE_CONFIG_DERIVED( samurai, vicdual_root )
/* video hardware */
MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_UPDATE_DRIVER(vicdual_state, screen_update_vicdual_color)
+ MCFG_SCREEN_UPDATE_DRIVER(vicdual_state, screen_update_color)
MACHINE_CONFIG_END
@@ -2245,16 +2241,16 @@ WRITE8_MEMBER(vicdual_state::nsub_io_w)
{
if (offset & 0x01) assert_coin_status();
if (offset & 0x02) { /* nsub_audio_w(0, data) */ }
- if (offset & 0x04) vicdual_palette_bank_w(space, 0, data);
+ if (offset & 0x04) palette_bank_w(space, 0, data);
}
static ADDRESS_MAP_START( nsub_map, AS_PROGRAM, 8, vicdual_state )
AM_RANGE(0x0000, 0x3fff) AM_MIRROR(0x4000) AM_ROM
AM_RANGE(0x8000, 0xbfff) AM_NOP /* unused */
- AM_RANGE(0xc000, 0xc3ff) AM_MIRROR(0x3000) AM_RAM_WRITE(vicdual_videoram_w) AM_SHARE("videoram")
+ AM_RANGE(0xc000, 0xc3ff) AM_MIRROR(0x3000) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram")
AM_RANGE(0xc400, 0xc7ff) AM_MIRROR(0x3000) AM_RAM
- AM_RANGE(0xc800, 0xcfff) AM_MIRROR(0x3000) AM_RAM_WRITE(vicdual_characterram_w) AM_SHARE("characterram")
+ AM_RANGE(0xc800, 0xcfff) AM_MIRROR(0x3000) AM_RAM_WRITE(characterram_w) AM_SHARE("characterram")
ADDRESS_MAP_END
@@ -2333,9 +2329,9 @@ static INPUT_PORTS_START( nsub )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
PORT_START("IN1")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_get_composite_blank_comp, NULL)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_composite_blank_comp, NULL)
PORT_BIT( 0x7e, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_read_coin_status, NULL)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, read_coin_status, NULL)
PORT_START("COIN")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, vicdual_state,nsub_coin_in, (void*)0)
@@ -2400,7 +2396,7 @@ static MACHINE_CONFIG_DERIVED( nsub, vicdual_root )
/* video hardware */
MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_UPDATE_DRIVER(vicdual_state, screen_update_vicdual_color)
+ MCFG_SCREEN_UPDATE_DRIVER(vicdual_state, screen_update_color)
MACHINE_CONFIG_END
@@ -2427,16 +2423,16 @@ WRITE8_MEMBER(vicdual_state::invinco_io_w)
{
if (offset & 0x01) assert_coin_status();
if (offset & 0x02) invinco_audio_w(space, 0, data);
- if (offset & 0x04) vicdual_palette_bank_w(space, 0, data);
+ if (offset & 0x04) palette_bank_w(space, 0, data);
}
static ADDRESS_MAP_START( invinco_map, AS_PROGRAM, 8, vicdual_state )
AM_RANGE(0x0000, 0x3fff) AM_MIRROR(0x4000) AM_ROM
AM_RANGE(0x8000, 0xbfff) AM_NOP /* unused */
- AM_RANGE(0xc000, 0xc3ff) AM_MIRROR(0x3000) AM_RAM_WRITE(vicdual_videoram_w) AM_SHARE("videoram")
+ AM_RANGE(0xc000, 0xc3ff) AM_MIRROR(0x3000) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram")
AM_RANGE(0xc400, 0xc7ff) AM_MIRROR(0x3000) AM_RAM
- AM_RANGE(0xc800, 0xcfff) AM_MIRROR(0x3000) AM_RAM_WRITE(vicdual_characterram_w) AM_SHARE("characterram")
+ AM_RANGE(0xc800, 0xcfff) AM_MIRROR(0x3000) AM_RAM_WRITE(characterram_w) AM_SHARE("characterram")
ADDRESS_MAP_END
@@ -2481,9 +2477,9 @@ static INPUT_PORTS_START( invinco )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_START("IN2")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_get_composite_blank_comp, NULL)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, get_composite_blank_comp, NULL)
PORT_BIT( 0x7e, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state,vicdual_read_coin_status, NULL)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vicdual_state, read_coin_status, NULL)
PORT_COIN_DEFAULT
INPUT_PORTS_END
@@ -2498,7 +2494,7 @@ static MACHINE_CONFIG_DERIVED( invinco, vicdual_root )
/* video hardware */
MCFG_SCREEN_MODIFY("screen")
- MCFG_SCREEN_UPDATE_DRIVER(vicdual_state, screen_update_vicdual_color)
+ MCFG_SCREEN_UPDATE_DRIVER(vicdual_state, screen_update_color)
/* audio hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
@@ -3609,48 +3605,48 @@ ROM_END
*
*************************************/
-GAMEL(1977, depthch, 0, depthch, depthch, driver_device, 0, ROT0, "Gremlin", "Depthcharge", GAME_IMPERFECT_SOUND, layout_depthch )
-GAMEL(1977, depthcho, depthch, depthch, depthch, driver_device, 0, ROT0, "Gremlin", "Depthcharge (older)", GAME_IMPERFECT_SOUND, layout_depthch )
-GAMEL(1977, subhunt, depthch, depthch, depthch, driver_device, 0, ROT0, "Gremlin (Taito license)", "Sub Hunter", GAME_IMPERFECT_SOUND, layout_depthch )
-GAME( 1977, safari, 0, safari, safari, driver_device, 0, ROT0, "Gremlin", "Safari (set 1)", GAME_NO_SOUND )
-GAME( 1977, safaria, safari, safari, safari, driver_device, 0, ROT0, "Gremlin", "Safari (set 2, bootleg?)", GAME_NO_SOUND ) // on a bootleg board, but seems a different code revision too
-GAME( 1978, frogs, 0, frogs, frogs, driver_device, 0, ROT0, "Gremlin", "Frogs", GAME_IMPERFECT_SOUND )
-GAME( 1979, sspaceat, 0, sspaceat, sspaceat, driver_device, 0, ROT270, "Sega", "Space Attack (upright set 1)", GAME_NO_SOUND )
-GAME( 1979, sspaceat2, sspaceat, sspaceat, sspaceat, driver_device, 0, ROT270, "Sega", "Space Attack (upright set 2)", GAME_NO_SOUND )
-GAME( 1979, sspaceat3, sspaceat, sspaceat, sspaceat, driver_device, 0, ROT270, "Sega", "Space Attack (upright set 3)", GAME_NO_SOUND )
-GAME( 1979, sspaceatc, sspaceat, sspaceat, sspaceat, driver_device, 0, ROT270, "Sega", "Space Attack (cocktail)", GAME_NO_SOUND )
-GAME( 1979, sspacaho, 0, sspacaho, sspacaho, driver_device, 0, ROT270, "Sega", "Space Attack / Head On", GAME_NO_SOUND )
-GAME( 1979, headon, 0, headon, headon, driver_device, 0, ROT0, "Gremlin", "Head On (2 players)", GAME_IMPERFECT_SOUND )
-GAME( 1979, headon1, headon, headon, headon, driver_device, 0, ROT0, "Gremlin", "Head On (1 player)", GAME_IMPERFECT_SOUND )
-GAME( 1979, headons, headon, headons, headons, driver_device, 0, ROT0, "bootleg (Sidam)", "Head On (Sidam bootleg, set 1)", GAME_IMPERFECT_SOUND )
-GAME( 1979, headonsa, headon, headons, headons, driver_device, 0, ROT0, "bootleg (Sidam)", "Head On (Sidam bootleg, set 2)", GAME_NOT_WORKING ) // won't coin up?
-GAME( 1979, headonmz, headon, headon, headonmz, driver_device, 0, ROT0, "bootleg", "Head On (bootleg, alt maze)", 0 )
-GAME( 1979, supcrash, headon, headons, supcrash, driver_device, 0, ROT0, "bootleg", "Super Crash (bootleg of Head On)", GAME_NO_SOUND )
-GAME( 1979, hocrash, headon, headons, headons, driver_device, 0, ROT0, "bootleg (Fraber)", "Crash (bootleg of Head On)", GAME_IMPERFECT_SOUND )
-GAME( 1979, headon2, 0, headon2, headon2, driver_device, 0, ROT0, "Sega", "Head On 2", GAME_IMPERFECT_SOUND )
-GAME( 1979, headon2s, headon2, headon2bw, car2, driver_device, 0, ROT0, "bootleg (Sidam)", "Head On 2 (Sidam bootleg)", GAME_NOT_WORKING ) // won't coin up?
-GAME( 1979, car2, headon2, headon2bw, car2, driver_device, 0, ROT0, "bootleg (RZ Bologna)", "Car 2 (bootleg of Head On 2)", GAME_IMPERFECT_SOUND ) // title still says 'HeadOn 2'
-GAME( 1979, invho2, 0, invho2, invho2, driver_device, 0, ROT270, "Sega", "Invinco / Head On 2", GAME_IMPERFECT_SOUND )
-GAME( 1980, nsub, 0, nsub, nsub, driver_device, 0, ROT270, "Sega", "N-Sub (upright)", GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND ) // this is the upright set. cocktail set still needs to be dumped
-GAME( 1980, samurai, 0, samurai, samurai, driver_device, 0, ROT270, "Sega", "Samurai", GAME_NO_SOUND )
-GAME( 1979, invinco, 0, invinco, invinco, driver_device, 0, ROT270, "Sega", "Invinco", GAME_IMPERFECT_SOUND )
-GAME( 1979, invds, 0, invds, invds, driver_device, 0, ROT270, "Sega", "Invinco / Deep Scan", GAME_IMPERFECT_SOUND )
-GAME( 1979, carhntds, 0, carhntds, carhntds, driver_device, 0, ROT270, "Sega", "Car Hunt / Deep Scan (France)", GAME_NO_SOUND )
-GAME( 1980, tranqgun, 0, tranqgun, tranqgun, driver_device, 0, ROT270, "Sega", "Tranquilizer Gun", GAME_NO_SOUND )
-GAME( 1980, spacetrk, 0, spacetrk, spacetrk, driver_device, 0, ROT270, "Sega", "Space Trek (upright)", GAME_NO_SOUND )
-GAME( 1980, spacetrkc, spacetrk, spacetrk, spacetrkc, driver_device, 0, ROT270, "Sega", "Space Trek (cocktail)", GAME_NO_SOUND )
-GAME( 1980, carnival, 0, carnival, carnival, driver_device, 0, ROT270, "Sega", "Carnival (upright)", GAME_IMPERFECT_SOUND )
-GAME( 1980, carnivalc, carnival, carnival, carnivalc, driver_device, 0, ROT270, "Sega", "Carnival (cocktail)", GAME_IMPERFECT_SOUND )
-GAME( 1980, carnivalh, carnival, carnivalh, carnivalh, driver_device, 0, ROT270, "Sega", "Carnival (Head On hardware, set 1)", GAME_IMPERFECT_SOUND )
-GAME( 1980, carnivalha, carnival, carnivalh, carnivalh, driver_device, 0, ROT270, "Sega", "Carnival (Head On hardware, set 2)", GAME_IMPERFECT_SOUND )
-GAME( 1981, brdrline, 0, brdrline, brdrline, driver_device, 0, ROT270, "Sega", "Borderline", GAME_NO_SOUND )
-GAME( 1981, starrkr, brdrline, brdrline, starrkr, driver_device, 0, ROT270, "Sega", "Star Raker", GAME_NO_SOUND )
-GAME( 1981, brdrlins, brdrline, brdrline, brdrline, driver_device, 0, ROT270, "bootleg (Sidam)", "Borderline (Sidam bootleg)", GAME_NO_SOUND )
-GAME( 1981, brdrlinb, brdrline, brdrline, brdrline, driver_device, 0, ROT270, "bootleg (Karateco)", "Borderline (Karateco bootleg)", GAME_NO_SOUND )
-GAME( 1981, brdrlinet, brdrline, tranqgun, tranqgun, driver_device, 0, ROT270, "Sega", "Borderline (Tranquilizer Gun conversion)", GAME_NO_SOUND ) // official factory conversion
-GAME( 198?, startrks, 0, headons, headons, driver_device, 0, ROT0, "bootleg (Sidam)", "Star Trek (Head On hardware)", GAME_IMPERFECT_SOUND )
-
-GAME( 1980, digger, 0, digger, digger, driver_device, 0, ROT270, "Sega", "Digger", GAME_NO_SOUND )
-GAME( 1981, pulsar, 0, pulsar, pulsar, driver_device, 0, ROT270, "Sega", "Pulsar", GAME_IMPERFECT_SOUND )
-GAME( 1979, heiankyo, 0, heiankyo, heiankyo, driver_device, 0, ROT270, "Denki Onkyo", "Heiankyo Alien", GAME_NO_SOUND )
-GAME( 19??, alphaho, 0, alphaho, alphaho, driver_device, 0, ROT270, "Data East Corporation", "Alpha Fighter / Head On", GAME_WRONG_COLORS | GAME_NO_SOUND )
+GAMEL(1977, depthch, 0, depthch, depthch, driver_device, 0, ROT0, "Gremlin", "Depthcharge", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE, layout_depthch )
+GAMEL(1977, depthcho, depthch, depthch, depthch, driver_device, 0, ROT0, "Gremlin", "Depthcharge (older)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE, layout_depthch )
+GAMEL(1977, subhunt, depthch, depthch, depthch, driver_device, 0, ROT0, "Gremlin (Taito license)", "Sub Hunter", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE, layout_depthch )
+GAME( 1977, safari, 0, safari, safari, driver_device, 0, ROT0, "Gremlin", "Safari (set 1)", GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
+GAME( 1977, safaria, safari, safari, safari, driver_device, 0, ROT0, "Gremlin", "Safari (set 2, bootleg?)", GAME_NO_SOUND | GAME_SUPPORTS_SAVE ) // on a bootleg board, but seems a different code revision too
+GAME( 1978, frogs, 0, frogs, frogs, driver_device, 0, ROT0, "Gremlin", "Frogs", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
+GAME( 1979, sspaceat, 0, sspaceat, sspaceat, driver_device, 0, ROT270, "Sega", "Space Attack (upright set 1)", GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
+GAME( 1979, sspaceat2, sspaceat, sspaceat, sspaceat, driver_device, 0, ROT270, "Sega", "Space Attack (upright set 2)", GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
+GAME( 1979, sspaceat3, sspaceat, sspaceat, sspaceat, driver_device, 0, ROT270, "Sega", "Space Attack (upright set 3)", GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
+GAME( 1979, sspaceatc, sspaceat, sspaceat, sspaceat, driver_device, 0, ROT270, "Sega", "Space Attack (cocktail)", GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
+GAME( 1979, sspacaho, 0, sspacaho, sspacaho, driver_device, 0, ROT270, "Sega", "Space Attack / Head On", GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
+GAME( 1979, headon, 0, headon, headon, driver_device, 0, ROT0, "Gremlin", "Head On (2 players)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
+GAME( 1979, headon1, headon, headon, headon, driver_device, 0, ROT0, "Gremlin", "Head On (1 player)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
+GAME( 1979, headons, headon, headons, headons, driver_device, 0, ROT0, "bootleg (Sidam)", "Head On (Sidam bootleg, set 1)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
+GAME( 1979, headonsa, headon, headons, headons, driver_device, 0, ROT0, "bootleg (Sidam)", "Head On (Sidam bootleg, set 2)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) // won't coin up?
+GAME( 1979, headonmz, headon, headon, headonmz, driver_device, 0, ROT0, "bootleg", "Head On (bootleg, alt maze)", GAME_SUPPORTS_SAVE )
+GAME( 1979, supcrash, headon, headons, supcrash, driver_device, 0, ROT0, "bootleg", "Super Crash (bootleg of Head On)", GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
+GAME( 1979, hocrash, headon, headons, headons, driver_device, 0, ROT0, "bootleg (Fraber)", "Crash (bootleg of Head On)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
+GAME( 1979, headon2, 0, headon2, headon2, driver_device, 0, ROT0, "Sega", "Head On 2", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
+GAME( 1979, headon2s, headon2, headon2bw, car2, driver_device, 0, ROT0, "bootleg (Sidam)", "Head On 2 (Sidam bootleg)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) // won't coin up?
+GAME( 1979, car2, headon2, headon2bw, car2, driver_device, 0, ROT0, "bootleg (RZ Bologna)", "Car 2 (bootleg of Head On 2)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) // title still says 'HeadOn 2'
+GAME( 1979, invho2, 0, invho2, invho2, driver_device, 0, ROT270, "Sega", "Invinco / Head On 2", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
+GAME( 1980, nsub, 0, nsub, nsub, driver_device, 0, ROT270, "Sega", "N-Sub (upright)", GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND | GAME_SUPPORTS_SAVE ) // this is the upright set. cocktail set still needs to be dumped
+GAME( 1980, samurai, 0, samurai, samurai, driver_device, 0, ROT270, "Sega", "Samurai", GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
+GAME( 1979, invinco, 0, invinco, invinco, driver_device, 0, ROT270, "Sega", "Invinco", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
+GAME( 1979, invds, 0, invds, invds, driver_device, 0, ROT270, "Sega", "Invinco / Deep Scan", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
+GAME( 1979, carhntds, 0, carhntds, carhntds, driver_device, 0, ROT270, "Sega", "Car Hunt / Deep Scan (France)", GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
+GAME( 1980, tranqgun, 0, tranqgun, tranqgun, driver_device, 0, ROT270, "Sega", "Tranquilizer Gun", GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
+GAME( 1980, spacetrk, 0, spacetrk, spacetrk, driver_device, 0, ROT270, "Sega", "Space Trek (upright)", GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
+GAME( 1980, spacetrkc, spacetrk, spacetrk, spacetrkc, driver_device, 0, ROT270, "Sega", "Space Trek (cocktail)", GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
+GAME( 1980, carnival, 0, carnival, carnival, driver_device, 0, ROT270, "Sega", "Carnival (upright)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
+GAME( 1980, carnivalc, carnival, carnival, carnivalc, driver_device, 0, ROT270, "Sega", "Carnival (cocktail)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
+GAME( 1980, carnivalh, carnival, carnivalh, carnivalh, driver_device, 0, ROT270, "Sega", "Carnival (Head On hardware, set 1)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
+GAME( 1980, carnivalha, carnival, carnivalh, carnivalh, driver_device, 0, ROT270, "Sega", "Carnival (Head On hardware, set 2)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
+GAME( 1981, brdrline, 0, brdrline, brdrline, driver_device, 0, ROT270, "Sega", "Borderline", GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
+GAME( 1981, starrkr, brdrline, brdrline, starrkr, driver_device, 0, ROT270, "Sega", "Star Raker", GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
+GAME( 1981, brdrlins, brdrline, brdrline, brdrline, driver_device, 0, ROT270, "bootleg (Sidam)", "Borderline (Sidam bootleg)", GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
+GAME( 1981, brdrlinb, brdrline, brdrline, brdrline, driver_device, 0, ROT270, "bootleg (Karateco)", "Borderline (Karateco bootleg)", GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
+GAME( 1981, brdrlinet, brdrline, tranqgun, tranqgun, driver_device, 0, ROT270, "Sega", "Borderline (Tranquilizer Gun conversion)", GAME_NO_SOUND | GAME_SUPPORTS_SAVE ) // official factory conversion
+GAME( 198?, startrks, 0, headons, headons, driver_device, 0, ROT0, "bootleg (Sidam)", "Star Trek (Head On hardware)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
+
+GAME( 1980, digger, 0, digger, digger, driver_device, 0, ROT270, "Sega", "Digger", GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
+GAME( 1981, pulsar, 0, pulsar, pulsar, driver_device, 0, ROT270, "Sega", "Pulsar", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
+GAME( 1979, heiankyo, 0, heiankyo, heiankyo, driver_device, 0, ROT270, "Denki Onkyo", "Heiankyo Alien", GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
+GAME( 19??, alphaho, 0, alphaho, alphaho, driver_device, 0, ROT270, "Data East Corporation", "Alpha Fighter / Head On", GAME_WRONG_COLORS | GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/vigilant.c b/src/mame/drivers/vigilant.c
index 3afcf8c8fdc..b5bbe84a920 100644
--- a/src/mame/drivers/vigilant.c
+++ b/src/mame/drivers/vigilant.c
@@ -689,7 +689,7 @@ ROM_START( vigilantg ) // US Rev G
ROM_LOAD( "VG_B-1B.ic1", 0x0400, 0x0117, CRC(922e5167) SHA1(08efdfdfeb35f3f73b6fd3d5c0c2a386dea5f617) )
ROM_END
-ROM_START( vigilano ) // US (earliest base version)
+ROM_START( vigilanto ) // US (earliest base version)
ROM_REGION( 0x30000, "maincpu", 0 ) /* 64k for code + 128k for bankswitching */
ROM_LOAD( "VG_A-8H-.ic55", 0x00000, 0x08000, CRC(8d15109e) SHA1(9ef57047a0b53cd0143a260193b33e3d5680ca71) )
ROM_LOAD( "VG_A-8L-.ic57", 0x10000, 0x10000, CRC(7f95799b) SHA1(a371671c3c26976314aaac4e410bff0f13a8a085) )
@@ -884,7 +884,7 @@ ROM_START( vigilantd ) // Japan Rev D
ROM_LOAD( "VG_B-1B.ic1", 0x0400, 0x0117, CRC(922e5167) SHA1(08efdfdfeb35f3f73b6fd3d5c0c2a386dea5f617) )
ROM_END
-ROM_START( vigilanbl ) /* Bootleg */
+ROM_START( vigilantbl ) /* Bootleg */
ROM_REGION( 0x30000, "maincpu", 0 ) /* 64k for code + 128k for bankswitching */
ROM_LOAD( "g07_c03.bin", 0x00000, 0x08000, CRC(9dcca081) SHA1(6d086b70e6bf1fbafa746ef5c82334645f199be9) )
ROM_LOAD( "j07_c04.bin", 0x10000, 0x10000, CRC(e0159105) SHA1(da6d74ec075863c67c0ce21b07a54029d138f688) )
@@ -1055,17 +1055,17 @@ ROM_START( buccanrsa )
ROM_LOAD( "prom2.u99", 0x0300, 0x0100, CRC(e0aa8869) SHA1(ac8bdfeba69420ba56ec561bf3d0f1229d02cea2) )
ROM_END
-GAME( 1988, vigilant, 0, vigilant, vigilant, driver_device, 0, ROT0, "Irem", "Vigilante (World, Rev E)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
+GAME( 1988, vigilant, 0, vigilant, vigilant, driver_device, 0, ROT0, "Irem", "Vigilante (World, Rev E)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
GAME( 1988, vigilantg, vigilant, vigilant, vigilant, driver_device, 0, ROT0, "Irem (Data East license)", "Vigilante (US, Rev G)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
-GAME( 1988, vigilano, vigilant, vigilant, vigilant, driver_device, 0, ROT0, "Irem (Data East license)", "Vigilante (US)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
+GAME( 1988, vigilanto, vigilant, vigilant, vigilant, driver_device, 0, ROT0, "Irem (Data East license)", "Vigilante (US)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
GAME( 1988, vigilanta, vigilant, vigilant, vigilant, driver_device, 0, ROT0, "Irem", "Vigilante (World, Rev A)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
GAME( 1988, vigilantb, vigilant, vigilant, vigilant, driver_device, 0, ROT0, "Irem (Data East license)", "Vigilante (US, Rev B)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
GAME( 1988, vigilantc, vigilant, vigilant, vigilant, driver_device, 0, ROT0, "Irem", "Vigilante (World, Rev C)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
GAME( 1988, vigilantd, vigilant, vigilant, vigilant, driver_device, 0, ROT0, "Irem", "Vigilante (Japan, Rev D)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
-GAME( 1988, vigilanbl, vigilant, vigilant, vigilant, driver_device, 0, ROT0, "bootleg", "Vigilante (bootleg)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
+GAME( 1988, vigilantbl, vigilant, vigilant, vigilant, driver_device, 0, ROT0, "bootleg", "Vigilante (bootleg)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
-GAME( 1988, kikcubic, 0, kikcubic, kikcubic, driver_device, 0, ROT0, "Irem", "Meikyu Jima (Japan)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) /* English title is Kickle Cubicle */
-GAME( 1988, kikcubicb, kikcubic, kikcubic, kikcubic, driver_device, 0, ROT0, "bootleg", "Kickle Cubele", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
+GAME( 1988, kikcubic, 0, kikcubic, kikcubic, driver_device, 0, ROT0, "Irem", "Meikyu Jima (Japan)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) /* English title is Kickle Cubicle */
+GAME( 1988, kikcubicb, kikcubic, kikcubic, kikcubic, driver_device, 0, ROT0, "bootleg", "Kickle Cubele", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
-GAME( 1989, buccanrs, 0, buccanrs, buccanrs, driver_device, 0, ROT0, "Duintronic", "Buccaneers (set 1)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
-GAME( 1989, buccanrsa, buccanrs, buccanrs, buccanra, driver_device, 0, ROT0, "Duintronic", "Buccaneers (set 2)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
+GAME( 1989, buccanrs, 0, buccanrs, buccanrs, driver_device, 0, ROT0, "Duintronic", "Buccaneers (set 1)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
+GAME( 1989, buccanrsa, buccanrs, buccanrs, buccanra, driver_device, 0, ROT0, "Duintronic", "Buccaneers (set 2)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/vlc.c b/src/mame/drivers/vlc.c
index 6ad4eb24a36..10fbb98d550 100644
--- a/src/mame/drivers/vlc.c
+++ b/src/mame/drivers/vlc.c
@@ -329,7 +329,7 @@ void nevada_state::nvram_init(nvram_device &nvram, void *data, size_t size)
WRITE_LINE_MEMBER(nevada_state::duart18_irq_handler)
{
m_maincpu->set_input_line_and_vector(4, state, m_duart18_68681->get_irq_vector());
-};
+}
/***************************************************************************/
/***************************************************************************/
@@ -344,7 +344,7 @@ WRITE_LINE_MEMBER(nevada_state::duart18_irq_handler)
WRITE_LINE_MEMBER(nevada_state::duart39_irq_handler)
{
m_maincpu->set_input_line_and_vector(3, state, m_duart39_68681->get_irq_vector());
-};
+}
/***************************************************************************/
/***************************************************************************/
@@ -360,7 +360,7 @@ WRITE_LINE_MEMBER(nevada_state::duart39_irq_handler)
WRITE_LINE_MEMBER(nevada_state::duart40_irq_handler)
{
m_maincpu->set_input_line_and_vector(5, state, m_duart40_68681->get_irq_vector());
-};
+}
/***************************************************************************/
/********************* RTC SECTION ********************************/
diff --git a/src/mame/drivers/warpwarp.c b/src/mame/drivers/warpwarp.c
index 4e868343715..69a95f87cd1 100644
--- a/src/mame/drivers/warpwarp.c
+++ b/src/mame/drivers/warpwarp.c
@@ -135,6 +135,13 @@ Notes:
#define MASTER_CLOCK XTAL_18_432MHz
+void warpwarp_state::machine_start()
+{
+ save_item(NAME(m_geebee_bgw));
+ save_item(NAME(m_ball_on));
+ save_item(NAME(m_ball_h));
+ save_item(NAME(m_ball_v));
+}
/* Interrupt Gen */
INTERRUPT_GEN_MEMBER(warpwarp_state::vblank_irq)
@@ -733,7 +740,7 @@ static MACHINE_CONFIG_START( geebee, warpwarp_state )
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK/3, 384, 0, 272, 264, 0, 224)
- MCFG_SCREEN_UPDATE_DRIVER(warpwarp_state, screen_update_geebee)
+ MCFG_SCREEN_UPDATE_DRIVER(warpwarp_state, screen_update)
MCFG_SCREEN_PALETTE("palette")
MCFG_GFXDECODE_ADD("gfxdecode", "palette", 1k)
@@ -770,7 +777,7 @@ static MACHINE_CONFIG_START( bombbee, warpwarp_state )
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK/3, 384, 0, 272, 264, 0, 224)
- MCFG_SCREEN_UPDATE_DRIVER(warpwarp_state, screen_update_geebee)
+ MCFG_SCREEN_UPDATE_DRIVER(warpwarp_state, screen_update)
MCFG_SCREEN_PALETTE("palette")
MCFG_GFXDECODE_ADD("gfxdecode", "palette", color)
@@ -986,18 +993,18 @@ DRIVER_INIT_MEMBER(warpwarp_state,warpwarp)
/* B & W games */
-GAMEL(1978, geebee, 0, geebee, geebee, warpwarp_state, geebee, ROT90, "Namco", "Gee Bee (Japan)", 0, layout_geebee )
-GAMEL(1978, geebeeb, geebee, geebee, geebeeb, warpwarp_state, geebee, ROT90, "Namco (F.lli Bertolino license)", "Gee Bee (Europe)", 0, layout_geebee ) // Fratelli Bertolino
-GAMEL(1978, geebeeg, geebee, geebee, geebee, warpwarp_state, geebee, ROT90, "Namco (Gremlin license)", "Gee Bee (US)", 0, layout_geebee )
+GAMEL(1978, geebee, 0, geebee, geebee, warpwarp_state, geebee, ROT90, "Namco", "Gee Bee (Japan)", GAME_SUPPORTS_SAVE, layout_geebee )
+GAMEL(1978, geebeeb, geebee, geebee, geebeeb, warpwarp_state, geebee, ROT90, "Namco (F.lli Bertolino license)", "Gee Bee (Europe)", GAME_SUPPORTS_SAVE, layout_geebee ) // Fratelli Bertolino
+GAMEL(1978, geebeeg, geebee, geebee, geebee, warpwarp_state, geebee, ROT90, "Namco (Gremlin license)", "Gee Bee (US)", GAME_SUPPORTS_SAVE, layout_geebee )
-GAMEL(1980, navarone, 0, navarone, navarone, warpwarp_state, navarone, ROT90, "Namco", "Navarone", GAME_IMPERFECT_SOUND, layout_navarone )
-GAME( 1980, kaitein, kaitei, navarone, kaitein, warpwarp_state, kaitein, ROT90, "K.K. Tokki (Namco license)", "Kaitei Takara Sagashi (Namco license)", 0 ) // pretty sure it didn't have a color overlay
-GAME( 1980, kaitei, 0, navarone, kaitei, warpwarp_state, kaitei, ROT90, "K.K. Tokki", "Kaitei Takara Sagashi", 0 ) // "
-GAME( 1980, sos, 0, navarone, sos, warpwarp_state, sos, ROT90, "Namco", "SOS", GAME_IMPERFECT_SOUND ) // developed by Shoei?
+GAMEL(1980, navarone, 0, navarone, navarone, warpwarp_state, navarone, ROT90, "Namco", "Navarone", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE, layout_navarone )
+GAME( 1980, kaitein, kaitei, navarone, kaitein, warpwarp_state, kaitein, ROT90, "K.K. Tokki (Namco license)", "Kaitei Takara Sagashi (Namco license)", GAME_SUPPORTS_SAVE ) // pretty sure it didn't have a color overlay
+GAME( 1980, kaitei, 0, navarone, kaitei, warpwarp_state, kaitei, ROT90, "K.K. Tokki", "Kaitei Takara Sagashi", GAME_SUPPORTS_SAVE ) // "
+GAME( 1980, sos, 0, navarone, sos, warpwarp_state, sos, ROT90, "Namco", "SOS", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) // developed by Shoei?
/* Color games */
-GAME( 1979, bombbee, 0, bombbee, bombbee, warpwarp_state, bombbee, ROT90, "Namco", "Bomb Bee", 0 )
-GAME( 1979, cutieq, 0, bombbee, cutieq, warpwarp_state, bombbee, ROT90, "Namco", "Cutie Q", 0 )
-GAME( 1981, warpwarp, 0, warpwarp, warpwarp, warpwarp_state, warpwarp, ROT90, "Namco", "Warp & Warp", 0 )
-GAME( 1981, warpwarpr, warpwarp, warpwarp, warpwarpr, warpwarp_state, warpwarp, ROT90, "Namco (Rock-Ola license)", "Warp Warp (Rock-Ola set 1)", 0 )
-GAME( 1981, warpwarpr2, warpwarp, warpwarp, warpwarpr, warpwarp_state, warpwarp, ROT90, "Namco (Rock-Ola license)", "Warp Warp (Rock-Ola set 2)", 0 )
+GAME( 1979, bombbee, 0, bombbee, bombbee, warpwarp_state, bombbee, ROT90, "Namco", "Bomb Bee", GAME_SUPPORTS_SAVE )
+GAME( 1979, cutieq, 0, bombbee, cutieq, warpwarp_state, bombbee, ROT90, "Namco", "Cutie Q", GAME_SUPPORTS_SAVE )
+GAME( 1981, warpwarp, 0, warpwarp, warpwarp, warpwarp_state, warpwarp, ROT90, "Namco", "Warp & Warp", GAME_SUPPORTS_SAVE )
+GAME( 1981, warpwarpr, warpwarp, warpwarp, warpwarpr, warpwarp_state, warpwarp, ROT90, "Namco (Rock-Ola license)", "Warp Warp (Rock-Ola set 1)", GAME_SUPPORTS_SAVE )
+GAME( 1981, warpwarpr2, warpwarp, warpwarp, warpwarpr, warpwarp_state, warpwarp, ROT90, "Namco (Rock-Ola license)", "Warp Warp (Rock-Ola set 2)", GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/warriorb.c b/src/mame/drivers/warriorb.c
index a1bd87c55e5..59a03d31071 100644
--- a/src/mame/drivers/warriorb.c
+++ b/src/mame/drivers/warriorb.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:David Graves
/***************************************************************************
diff --git a/src/mame/drivers/wgp.c b/src/mame/drivers/wgp.c
index 03d8c97e055..1efa83564ed 100644
--- a/src/mame/drivers/wgp.c
+++ b/src/mame/drivers/wgp.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:David Graves
/***************************************************************************
diff --git a/src/mame/drivers/wiz.c b/src/mame/drivers/wiz.c
index a0490bbd343..ab881a9a3e1 100644
--- a/src/mame/drivers/wiz.c
+++ b/src/mame/drivers/wiz.c
@@ -328,6 +328,10 @@ static ADDRESS_MAP_START( kungfut_main_map, AS_PROGRAM, 8, wiz_state )
AM_RANGE(0xf818, 0xf818) AM_WRITE(wiz_bgcolor_w)
ADDRESS_MAP_END
+static ADDRESS_MAP_START( decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 8, wiz_state )
+ AM_RANGE(0x0000, 0xbfff) AM_ROM AM_SHARE("decrypted_opcodes")
+ADDRESS_MAP_END
+
static ADDRESS_MAP_START( wiz_main_map, AS_PROGRAM, 8, wiz_state )
AM_RANGE(0xc800, 0xc801) AM_WRITE(wiz_coin_counter_w)
AM_RANGE(0xd400, 0xd400) AM_READ(wiz_protection_r)
@@ -830,6 +834,7 @@ static MACHINE_CONFIG_DERIVED( stinger, kungfut )
/* basic machine hardware */
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(stinger_main_map)
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
/* basic machine hardware */
MCFG_CPU_MODIFY("audiocpu")
@@ -849,6 +854,9 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( scion, stinger )
+ MCFG_CPU_MODIFY("maincpu")
+ MCFG_DEVICE_REMOVE_ADDRESS_MAP(AS_DECRYPTED_OPCODES)
+
/* video hardware */
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_VISIBLE_AREA(2*8, 32*8-1, 2*8, 30*8-1)
@@ -863,12 +871,12 @@ MACHINE_CONFIG_END
***************************************************************************/
ROM_START( kungfut )
- ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_REGION( 0xc000, "maincpu", 0 )
ROM_LOAD( "p1.bin", 0x0000, 0x4000, CRC(b1e56960) SHA1(993388bbb663412110d1012be9ffc00b06fce4d0) )
ROM_LOAD( "p3.bin", 0x4000, 0x4000, CRC(6fc346f8) SHA1(bd1663fa780e41eafd668bf502b40c9750270e55) )
ROM_LOAD( "p2.bin", 0x8000, 0x4000, CRC(042cc9c5) SHA1(09f87e240c2aaa19fe7b8cb548ded828ab67b18b) )
- ROM_REGION( 0x10000, "audiocpu", 0 )
+ ROM_REGION( 0x2000, "audiocpu", 0 )
ROM_LOAD( "1.bin", 0x0000, 0x2000, CRC(68028a5d) SHA1(2fabf5e55e09a34cd090d123737d31970e4086e8) )
ROM_REGION( 0x6000, "gfx1", 0 )
@@ -888,12 +896,12 @@ ROM_START( kungfut )
ROM_END
ROM_START( kungfuta )
- ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_REGION( 0xc000, "maincpu", 0 )
ROM_LOAD( "kungfu.01", 0x0000, 0x4000, CRC(48dada70) SHA1(a90901d2aef73d4fa9d9c80769b82a3fead0a0f9) )
ROM_LOAD( "kungfu.02", 0x4000, 0x4000, CRC(c08c5152) SHA1(c5db3ee1ee165708d93d296b51a5bb43265ac75f) )
ROM_LOAD( "kungfu.03", 0x8000, 0x4000, CRC(09b8670c) SHA1(170e7cbf87727d940e959fa7a0328b4cc1aba195) )
- ROM_REGION( 0x10000, "audiocpu", 0 )
+ ROM_REGION( 0x2000, "audiocpu", 0 )
ROM_LOAD( "kungfu.04", 0x0000, 0x2000, CRC(352bff48) SHA1(87d2408d31e1326ec810debcb2c724d1f003ae7b) )
ROM_REGION( 0x6000, "gfx1", 0 )
@@ -913,12 +921,12 @@ ROM_START( kungfuta )
ROM_END
ROM_START( wiz )
- ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_REGION( 0xc000, "maincpu", 0 )
ROM_LOAD( "ic07_01.bin", 0x0000, 0x4000, CRC(c05f2c78) SHA1(98b93234684a3a228552ef41a08512fef1befedd) )
ROM_LOAD( "ic05_03.bin", 0x4000, 0x4000, CRC(7978d879) SHA1(866efdff3c111793d5a3cc2fa0b03a2b4e371c49) )
ROM_LOAD( "ic06_02.bin", 0x8000, 0x4000, CRC(9c406ad2) SHA1(cd82c3dc622886b6ebb30ba565f3c34d5a4e229b) )
- ROM_REGION( 0x10000, "audiocpu", 0 )
+ ROM_REGION( 0x2000, "audiocpu", 0 )
ROM_LOAD( "ic57_10.bin", 0x0000, 0x2000, CRC(8a7575bd) SHA1(5470c4c3a40139f45db7a9e260f40b5244f10123) )
ROM_REGION( 0x6000, "gfx1", 0 ) /* sprites/chars */
@@ -941,12 +949,12 @@ ROM_START( wiz )
ROM_END
ROM_START( wizt )
- ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_REGION( 0xc000, "maincpu", 0 )
ROM_LOAD( "wiz1.bin", 0x0000, 0x4000, CRC(5a6d3c60) SHA1(faeb7e7ddeee9638ec046655e87f866d81fdbee0) )
ROM_LOAD( "ic05_03.bin", 0x4000, 0x4000, CRC(7978d879) SHA1(866efdff3c111793d5a3cc2fa0b03a2b4e371c49) )
ROM_LOAD( "ic06_02.bin", 0x8000, 0x4000, CRC(9c406ad2) SHA1(cd82c3dc622886b6ebb30ba565f3c34d5a4e229b) )
- ROM_REGION( 0x10000, "audiocpu", 0 )
+ ROM_REGION( 0x2000, "audiocpu", 0 )
ROM_LOAD( "ic57_10.bin", 0x0000, 0x2000, CRC(8a7575bd) SHA1(5470c4c3a40139f45db7a9e260f40b5244f10123) )
ROM_REGION( 0x6000, "gfx1", 0 ) /* sprites/chars */
@@ -970,12 +978,12 @@ ROM_END
/* was marked as Wiz Alt Sound */
ROM_START( wizta )
- ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_REGION( 0xc000, "maincpu", 0 )
ROM_LOAD( "ic7", 0x0000, 0x4000, CRC(b2ec49ad) SHA1(f1624995e9d426dd69d6567a91713aa023e716ad) )
ROM_LOAD( "ic5", 0x4000, 0x4000, CRC(f7e8f792) SHA1(2c1f82e6f6b2573d8bf0a27fb344fe86f475ddef) )
ROM_LOAD( "ic6", 0x8000, 0x4000, CRC(9c406ad2) SHA1(cd82c3dc622886b6ebb30ba565f3c34d5a4e229b) )
- ROM_REGION( 0x10000, "audiocpu", 0 )
+ ROM_REGION( 0x2000, "audiocpu", 0 )
ROM_LOAD( "ic57", 0x0000, 0x2000, CRC(8a7575bd) SHA1(5470c4c3a40139f45db7a9e260f40b5244f10123) )
ROM_REGION( 0x6000, "gfx1", 0 ) /* sprites/chars */
@@ -998,14 +1006,14 @@ ROM_START( wizta )
ROM_END
ROM_START( stinger )
- ROM_REGION( 0x10000, "maincpu", 0 ) /* 64k for code + 64k for decrypted opcodes */
+ ROM_REGION( 0xc000, "maincpu", 0 )
ROM_LOAD( "1-5j.bin", 0x0000, 0x2000, CRC(1a2ca600) SHA1(473e89f2c49f6e6f38df5d6fc2267ffecf84c6c8) ) /* encrypted */
ROM_LOAD( "2-6j.bin", 0x2000, 0x2000, CRC(957cd39c) SHA1(38bb589b3bfd962415b31d1151adf4bdb661122f) ) /* encrypted */
ROM_LOAD( "3-8j.bin", 0x4000, 0x2000, CRC(404c932e) SHA1(c23eac49e06ff38564062c0e8c8cdadf877f1d6a) ) /* encrypted */
ROM_LOAD( "4-9j.bin", 0x6000, 0x2000, CRC(2d570f91) SHA1(31d54d9fd5254c33f07c605bd6112c7eb53c42a1) ) /* encrypted */
ROM_LOAD( "5-10j.bin", 0x8000, 0x2000, CRC(c841795c) SHA1(e03860813c03ca1c737935accc2b5fe87c6b624a) ) /* encrypted */
- ROM_REGION( 0x10000, "audiocpu", 0 )
+ ROM_REGION( 0x2000, "audiocpu", 0 )
ROM_LOAD( "6-9f.bin", 0x0000, 0x2000, CRC(79757f0c) SHA1(71be938c32c6a84618763761786ecc5d7d47581a) )
ROM_REGION( 0x6000, "gfx1", 0 ) /* sprites/chars */
@@ -1025,14 +1033,14 @@ ROM_START( stinger )
ROM_END
ROM_START( stinger2 )
- ROM_REGION( 0x10000, "maincpu", 0 ) /* 64k for code + 64k for decrypted opcodes */
+ ROM_REGION( 0xc000, "maincpu", 0 )
ROM_LOAD( "n1.bin", 0x0000, 0x2000, CRC(f2d2790c) SHA1(0e5e92ef45b5bc27b0818f83c89b3bda0e701403) ) /* encrypted */
ROM_LOAD( "n2.bin", 0x2000, 0x2000, CRC(8fd2d8d8) SHA1(d3318a81fddeb3fa50d01569c1e1145e26ce7277) ) /* encrypted */
ROM_LOAD( "n3.bin", 0x4000, 0x2000, CRC(f1794d36) SHA1(7954500f489c0bc58cda8e7ffc2e4474759fdc33) ) /* encrypted */
ROM_LOAD( "n4.bin", 0x6000, 0x2000, CRC(230ba682) SHA1(c419ffebd021d41b3f5021948007fb6bcdb1cdf7) ) /* encrypted */
ROM_LOAD( "n5.bin", 0x8000, 0x2000, CRC(a03a01da) SHA1(28fecac7a821ac4718242919840266a907160df0) ) /* encrypted */
- ROM_REGION( 0x10000, "audiocpu", 0 )
+ ROM_REGION( 0x2000, "audiocpu", 0 )
ROM_LOAD( "6-9f.bin", 0x0000, 0x2000, CRC(79757f0c) SHA1(71be938c32c6a84618763761786ecc5d7d47581a) )
ROM_REGION( 0x6000, "gfx1", 0 ) /* sprites/chars */
@@ -1052,14 +1060,14 @@ ROM_START( stinger2 )
ROM_END
ROM_START( scion )
- ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_REGION( 0xc000, "maincpu", 0 )
ROM_LOAD( "sc1", 0x0000, 0x2000, CRC(8dcad575) SHA1(3f194ece25e730b1cbbf3f332bbdebc3a6a72b0f) )
ROM_LOAD( "sc2", 0x2000, 0x2000, CRC(f608e0ba) SHA1(e55b0ad4dc117339d45a999e13760f4ab3ca4ce0) )
ROM_LOAD( "sc3", 0x4000, 0x2000, CRC(915289b9) SHA1(b32b40f93de4501619486a8c5a8367d3b2e357a6) )
ROM_LOAD( "4.9j", 0x6000, 0x2000, CRC(0f40d002) SHA1(13b04f3902ebdda02670fcb667e181cf70594c37) )
ROM_LOAD( "5.10j", 0x8000, 0x2000, CRC(dc4923b7) SHA1(ec5c22ef1f9ba0fe4da3de62a63a44aa3ff850f4) )
- ROM_REGION( 0x10000, "audiocpu", 0 )
+ ROM_REGION( 0x2000, "audiocpu", 0 )
ROM_LOAD( "sc6", 0x0000, 0x2000, CRC(09f5f9c1) SHA1(83e489f32597880fb1a13f0bafedd275facb21f7) )
ROM_REGION( 0x6000, "gfx1", 0 ) /* sprites/chars */
@@ -1079,14 +1087,14 @@ ROM_START( scion )
ROM_END
ROM_START( scionc )
- ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_REGION( 0xc000, "maincpu", 0 )
ROM_LOAD( "1.5j", 0x0000, 0x2000, CRC(5aaf571e) SHA1(53becfad13e95012dce6597625c64dcba9ac4433) )
ROM_LOAD( "2.6j", 0x2000, 0x2000, CRC(d5a66ac9) SHA1(3192da12b2d6a07e203999ed97cdba16d4917a98) )
ROM_LOAD( "3.8j", 0x4000, 0x2000, CRC(6e616f28) SHA1(ea32add6173251152ca84426c098c92ace123878) )
ROM_LOAD( "4.9j", 0x6000, 0x2000, CRC(0f40d002) SHA1(13b04f3902ebdda02670fcb667e181cf70594c37) )
ROM_LOAD( "5.10j", 0x8000, 0x2000, CRC(dc4923b7) SHA1(ec5c22ef1f9ba0fe4da3de62a63a44aa3ff850f4) )
- ROM_REGION( 0x10000, "audiocpu", 0 )
+ ROM_REGION( 0x2000, "audiocpu", 0 )
ROM_LOAD( "6.9f", 0x0000, 0x2000, CRC(a66a0ce6) SHA1(b2d6a8ded007c362c58496ead33d1561a982440a) )
ROM_REGION( 0x6000, "gfx1", 0 ) /* sprites/chars */
@@ -1115,15 +1123,11 @@ DRIVER_INIT_MEMBER(wiz_state,stinger)
{ 5,3,7, 0x80 },
{ 5,7,3, 0x28 }
};
- address_space &space = m_maincpu->space(AS_PROGRAM);
+
UINT8 *rom = memregion("maincpu")->base();
- int size = memregion("maincpu")->bytes();
- UINT8 *decrypt = auto_alloc_array(machine(), UINT8, size);
const UINT8 *tbl;
- space.set_decrypted_region(0x0000, 0xffff, decrypt);
-
- for (int a = 0x0000; a < 0x10000; a++)
+ for (int a = 0x0000; a < 0xc000; a++)
{
int row;
UINT8 src;
@@ -1131,7 +1135,7 @@ DRIVER_INIT_MEMBER(wiz_state,stinger)
if (a & 0x2040)
{
/* not encrypted */
- decrypt[a] = rom[a];
+ m_decrypted_opcodes[a] = rom[a];
}
else
{
@@ -1142,7 +1146,7 @@ DRIVER_INIT_MEMBER(wiz_state,stinger)
/* decode the opcodes */
tbl = swap_xor_table[row];
- decrypt[a] = BITSWAP8(src, tbl[0], 6, tbl[1], 4, tbl[2], 2, 1, 0) ^ tbl[3];
+ m_decrypted_opcodes[a] = BITSWAP8(src, tbl[0], 6, tbl[1], 4, tbl[2], 2, 1, 0) ^ tbl[3];
}
}
}
diff --git a/src/mame/drivers/zaxxon.c b/src/mame/drivers/zaxxon.c
index 0b09caa8cab..fe3fba97f2f 100644
--- a/src/mame/drivers/zaxxon.c
+++ b/src/mame/drivers/zaxxon.c
@@ -438,6 +438,9 @@ static ADDRESS_MAP_START( zaxxon_map, AS_PROGRAM, 8, zaxxon_state )
AM_RANGE(0xe0fb, 0xe0fb) AM_MIRROR(0x1f00) AM_WRITE(zaxxon_bg_enable_w)
ADDRESS_MAP_END
+static ADDRESS_MAP_START( decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 8, zaxxon_state )
+ AM_RANGE(0x0000, 0x5fff) AM_ROM AM_SHARE("decrypted_opcodes")
+ADDRESS_MAP_END
/* derived from Zaxxon, different sound hardware */
static ADDRESS_MAP_START( ixion_map, AS_PROGRAM, 8, zaxxon_state )
@@ -939,9 +942,20 @@ static MACHINE_CONFIG_DERIVED( zaxxon, root )
MCFG_FRAGMENT_ADD(zaxxon_samples)
MACHINE_CONFIG_END
+static MACHINE_CONFIG_DERIVED( szaxxon, zaxxon )
+
+ /* encryption */
+ MCFG_DEVICE_MODIFY("maincpu")
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
+MACHINE_CONFIG_END
+
static MACHINE_CONFIG_DERIVED( futspy, root )
+ /* encryption */
+ MCFG_DEVICE_MODIFY("maincpu")
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
+
/* video hardware */
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_UPDATE_DRIVER(zaxxon_state, screen_update_futspy)
@@ -956,6 +970,7 @@ static MACHINE_CONFIG_DERIVED( razmataz, root )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(ixion_map)
+ MCFG_CPU_DECRYPTED_OPCODES_MAP(decrypted_opcodes_map)
MCFG_DEVICE_REMOVE("ppi8255")
@@ -1429,14 +1444,13 @@ ROM_START( tiptop ) /* 3 board stack */
ROM_END
-
/*************************************
*
- * ROM decryption
+ * Driver initialization
*
*************************************/
-void zaxxon_state::zaxxonj_decode(const char *cputag)
+DRIVER_INIT_MEMBER(zaxxon_state,zaxxonj)
{
/*
the values vary, but the translation mask is always laid out like this:
@@ -1480,15 +1494,9 @@ void zaxxon_state::zaxxonj_decode(const char *cputag)
{ 0x02,0x08,0x2a,0x20,0x20,0x2a,0x08,0x02 } /* .......1...1...1 */
};
- int A;
- address_space &space = machine().device(cputag)->memory().space(AS_PROGRAM);
- UINT8 *rom = memregion(cputag)->base();
- int size = memregion(cputag)->bytes();
- UINT8 *decrypt = auto_alloc_array(machine(), UINT8, size);
-
- space.set_decrypted_region(0x0000, size - 1, decrypt);
+ UINT8 *rom = memregion("maincpu")->base();
- for (A = 0x0000; A < size; A++)
+ for (int A = 0x0000; A < 0x6000; A++)
{
int i,j;
UINT8 src;
@@ -1509,41 +1517,96 @@ void zaxxon_state::zaxxonj_decode(const char *cputag)
/* now decode the opcodes */
/* pick the translation table from bits 0, 4, and 8 of the address */
i = ((A >> 0) & 1) + (((A >> 4) & 1) << 1) + (((A >> 8) & 1) << 2);
- decrypt[A] = src ^ opcode_xortable[i][j];
+ m_decrypted_opcodes[A] = src ^ opcode_xortable[i][j];
}
}
-
-/*************************************
- *
- * Driver initialization
- *
- *************************************/
-
-DRIVER_INIT_MEMBER(zaxxon_state,zaxxonj)
-{
- zaxxonj_decode("maincpu");
-}
-
-
DRIVER_INIT_MEMBER(zaxxon_state,szaxxon)
{
- szaxxon_decode(machine(), "maincpu");
+ static const UINT8 convtable[32][4] =
+ {
+ /* opcode data address */
+ /* A B C D A B C D */
+ { 0x88,0xa8,0x80,0xa0 }, { 0x28,0x20,0xa8,0xa0 }, /* ...0...0...0...0 */
+ { 0x08,0x28,0x88,0xa8 }, { 0x88,0x80,0x08,0x00 }, /* ...0...0...0...1 */
+ { 0xa8,0x28,0xa0,0x20 }, { 0x20,0xa0,0x00,0x80 }, /* ...0...0...1...0 */
+ { 0x88,0xa8,0x80,0xa0 }, { 0x28,0x20,0xa8,0xa0 }, /* ...0...0...1...1 */
+ { 0x08,0x28,0x88,0xa8 }, { 0x88,0x80,0x08,0x00 }, /* ...0...1...0...0 */
+ { 0x88,0xa8,0x80,0xa0 }, { 0x28,0x20,0xa8,0xa0 }, /* ...0...1...0...1 */
+ { 0xa8,0x28,0xa0,0x20 }, { 0x20,0xa0,0x00,0x80 }, /* ...0...1...1...0 */
+ { 0x08,0x28,0x88,0xa8 }, { 0x88,0x80,0x08,0x00 }, /* ...0...1...1...1 */
+ { 0x08,0x28,0x88,0xa8 }, { 0x88,0x80,0x08,0x00 }, /* ...1...0...0...0 */
+ { 0x88,0xa8,0x80,0xa0 }, { 0x28,0x20,0xa8,0xa0 }, /* ...1...0...0...1 */
+ { 0x88,0xa8,0x80,0xa0 }, { 0x28,0x20,0xa8,0xa0 }, /* ...1...0...1...0 */
+ { 0xa8,0x28,0xa0,0x20 }, { 0x20,0xa0,0x00,0x80 }, /* ...1...0...1...1 */
+ { 0xa8,0x28,0xa0,0x20 }, { 0x20,0xa0,0x00,0x80 }, /* ...1...1...0...0 */
+ { 0xa8,0x28,0xa0,0x20 }, { 0x20,0xa0,0x00,0x80 }, /* ...1...1...0...1 */
+ { 0x08,0x28,0x88,0xa8 }, { 0x88,0x80,0x08,0x00 }, /* ...1...1...1...0 */
+ { 0x88,0xa8,0x80,0xa0 }, { 0x28,0x20,0xa8,0xa0 } /* ...1...1...1...1 */
+ };
+
+ sega_decode(memregion("maincpu")->base(), m_decrypted_opcodes, 0x6000, convtable);
}
DRIVER_INIT_MEMBER(zaxxon_state,futspy)
{
- futspy_decode(machine(), "maincpu");
+ static const UINT8 convtable[32][4] =
+ {
+ /* opcode data address */
+ /* A B C D A B C D */
+ { 0x28,0x08,0x20,0x00 }, { 0x28,0x08,0x20,0x00 }, /* ...0...0...0...0 */
+ { 0x80,0x00,0xa0,0x20 }, { 0x08,0x88,0x00,0x80 }, /* ...0...0...0...1 */
+ { 0x80,0x00,0xa0,0x20 }, { 0x08,0x88,0x00,0x80 }, /* ...0...0...1...0 */
+ { 0xa0,0x80,0x20,0x00 }, { 0x20,0x28,0xa0,0xa8 }, /* ...0...0...1...1 */
+ { 0x28,0x08,0x20,0x00 }, { 0x88,0x80,0xa8,0xa0 }, /* ...0...1...0...0 */
+ { 0x80,0x00,0xa0,0x20 }, { 0x08,0x88,0x00,0x80 }, /* ...0...1...0...1 */
+ { 0x80,0x00,0xa0,0x20 }, { 0x20,0x28,0xa0,0xa8 }, /* ...0...1...1...0 */
+ { 0x20,0x28,0xa0,0xa8 }, { 0x08,0x88,0x00,0x80 }, /* ...0...1...1...1 */
+ { 0x88,0x80,0xa8,0xa0 }, { 0x28,0x08,0x20,0x00 }, /* ...1...0...0...0 */
+ { 0x80,0x00,0xa0,0x20 }, { 0xa0,0x80,0x20,0x00 }, /* ...1...0...0...1 */
+ { 0x20,0x28,0xa0,0xa8 }, { 0x08,0x88,0x00,0x80 }, /* ...1...0...1...0 */
+ { 0x80,0x00,0xa0,0x20 }, { 0x20,0x28,0xa0,0xa8 }, /* ...1...0...1...1 */
+ { 0x88,0x80,0xa8,0xa0 }, { 0x88,0x80,0xa8,0xa0 }, /* ...1...1...0...0 */
+ { 0x80,0x00,0xa0,0x20 }, { 0x08,0x88,0x00,0x80 }, /* ...1...1...0...1 */
+ { 0x80,0x00,0xa0,0x20 }, { 0x28,0x08,0x20,0x00 }, /* ...1...1...1...0 */
+ { 0x20,0x28,0xa0,0xa8 }, { 0xa0,0x80,0x20,0x00 } /* ...1...1...1...1 */
+ };
+
+ sega_decode(memregion("maincpu")->base(), m_decrypted_opcodes, 0x6000, convtable);
}
DRIVER_INIT_MEMBER(zaxxon_state,razmataz)
{
- address_space &pgmspace = m_maincpu->space(AS_PROGRAM);
+ // Note: same as nprinces
+ static const UINT8 convtable[32][4] =
+ {
+ /* opcode data address */
+ /* A B C D A B C D */
+ { 0x08,0x88,0x00,0x80 }, { 0xa0,0x20,0x80,0x00 }, /* ...0...0...0...0 */
+ { 0xa8,0xa0,0x28,0x20 }, { 0x88,0xa8,0x80,0xa0 }, /* ...0...0...0...1 */
+ { 0x88,0x80,0x08,0x00 }, { 0x28,0x08,0xa8,0x88 }, /* ...0...0...1...0 */
+ { 0x88,0xa8,0x80,0xa0 }, { 0x28,0x08,0xa8,0x88 }, /* ...0...0...1...1 */
+ { 0x88,0xa8,0x80,0xa0 }, { 0xa0,0x20,0x80,0x00 }, /* ...0...1...0...0 */
+ { 0xa8,0xa0,0x28,0x20 }, { 0xa8,0xa0,0x28,0x20 }, /* ...0...1...0...1 */
+ { 0x88,0x80,0x08,0x00 }, { 0x88,0xa8,0x80,0xa0 }, /* ...0...1...1...0 */
+ { 0x88,0xa8,0x80,0xa0 }, { 0x88,0xa8,0x80,0xa0 }, /* ...0...1...1...1 */
+ { 0xa0,0x20,0x80,0x00 }, { 0xa0,0x20,0x80,0x00 }, /* ...1...0...0...0 */
+ { 0x08,0x88,0x00,0x80 }, { 0x28,0x08,0xa8,0x88 }, /* ...1...0...0...1 */
+ { 0x88,0xa8,0x80,0xa0 }, { 0x88,0x80,0x08,0x00 }, /* ...1...0...1...0 */
+ { 0x88,0xa8,0x80,0xa0 }, { 0x28,0x08,0xa8,0x88 }, /* ...1...0...1...1 */
+ { 0x88,0xa8,0x80,0xa0 }, { 0x88,0xa8,0x80,0xa0 }, /* ...1...1...0...0 */
+ { 0x88,0xa8,0x80,0xa0 }, { 0x88,0xa8,0x80,0xa0 }, /* ...1...1...0...1 */
+ { 0x88,0x80,0x08,0x00 }, { 0x88,0x80,0x08,0x00 }, /* ...1...1...1...0 */
+ { 0x08,0x88,0x00,0x80 }, { 0x28,0x08,0xa8,0x88 } /* ...1...1...1...1 */
+ };
+
- nprinces_decode(machine(), "maincpu");
+ sega_decode(memregion("maincpu")->base(), m_decrypted_opcodes, 0x6000, convtable);
+
+ address_space &pgmspace = m_maincpu->space(AS_PROGRAM);
/* additional input ports are wired */
pgmspace.install_read_port(0xc004, 0xc004, 0, 0x18f3, "SW04");
@@ -1570,19 +1633,19 @@ DRIVER_INIT_MEMBER(zaxxon_state,razmataz)
GAME( 1982, zaxxon, 0, zaxxon, zaxxon, driver_device, 0, ROT90, "Sega", "Zaxxon (set 1)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
GAME( 1982, zaxxon2, zaxxon, zaxxon, zaxxon, driver_device, 0, ROT90, "Sega", "Zaxxon (set 2)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
GAME( 1982, zaxxon3, zaxxon, zaxxon, zaxxon, driver_device, 0, ROT90, "Sega", "Zaxxon (set 3)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
-GAME( 1982, zaxxonj, zaxxon, zaxxon, zaxxon, zaxxon_state, zaxxonj, ROT90, "Sega", "Zaxxon (Japan)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
-GAME( 1982, zaxxonb, zaxxon, zaxxon, zaxxon, zaxxon_state, zaxxonj, ROT90, "bootleg", "Jackson", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
+GAME( 1982, zaxxonj, zaxxon, szaxxon, zaxxon, zaxxon_state, zaxxonj, ROT90, "Sega", "Zaxxon (Japan)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
+GAME( 1982, zaxxonb, zaxxon, szaxxon, zaxxon, zaxxon_state, zaxxonj, ROT90, "bootleg", "Jackson", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
/* standard Zaxxon hardware but extra sound board plugged into 8255 PPI socket and encrypted cpu */
-GAME( 1982, szaxxon, 0, zaxxon, szaxxon, zaxxon_state, szaxxon, ROT90, "Sega", "Super Zaxxon (315-5013)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
+GAME( 1982, szaxxon, 0, szaxxon, szaxxon, zaxxon_state, szaxxon, ROT90, "Sega", "Super Zaxxon (315-5013)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
/* standard Zaxxon hardware? but encrypted cpu */
-GAME( 1984, futspy, 0, futspy, futspy, zaxxon_state, futspy, ROT90, "Sega", "Future Spy (315-5061)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
+GAME( 1984, futspy, 0, futspy, futspy, zaxxon_state, futspy, ROT90, "Sega", "Future Spy (315-5061)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
/* these games run on modified Zaxxon hardware with no skewing, extra inputs, and a */
/* G-80 Universal Sound Board */
-GAME( 1983, razmataz, 0, razmataz, razmataz, zaxxon_state, razmataz, ROT90, "Sega", "Razzmatazz", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
-GAME( 1983, ixion, 0, razmataz, ixion, zaxxon_state, szaxxon, ROT270, "Sega", "Ixion (prototype)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE)
+GAME( 1983, razmataz, 0, razmataz, razmataz, zaxxon_state, razmataz, ROT90, "Sega", "Razzmatazz", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
+GAME( 1983, ixion, 0, razmataz, ixion, zaxxon_state, szaxxon, ROT270, "Sega", "Ixion (prototype)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE)
/* these games run on a slightly newer Zaxxon hardware with more ROM space and a */
/* custom sprite DMA chip */
diff --git a/src/mame/etc/doxy_driver.h b/src/mame/etc/doxy_driver.h
index 906af7379d4..66e90c178b8 100644
--- a/src/mame/etc/doxy_driver.h
+++ b/src/mame/etc/doxy_driver.h
@@ -1,11 +1,11 @@
/*! @file doxy_driver.h
@license BSD-3-Clause
@copyright Angelo Salese & the MAME team
-
+
@basehw 4enraya
Main CPU: Z80
Sound Chip: AY8910
-
+
@memmap 4enraya,Z80
0x0000-0xbfff ROM
0xc000-0xcfff work RAM
@@ -27,14 +27,13 @@
*/
-/**
+/**
template for Doxygen commenting style for drivers
All accepted special commands that aren't in Doxygen needs to be hooked up into the ini file.
memmap/iomap/irq -> [%s,%s] -> [name_of_romset,cpu_name]
irqnum -> type of irq, might accept one or two commands (for vectors)
irqname -> A description of the irq used, might use brief and extended description.
-
+
@sa http://www.stack.nl/~dimitri/doxygen/manual/commands.html
@todo needs discussion for accepted standardized syntax
*/
-
diff --git a/src/mame/includes/angelkds.h b/src/mame/includes/angelkds.h
index d40f622a265..96009b248c9 100644
--- a/src/mame/includes/angelkds.h
+++ b/src/mame/includes/angelkds.h
@@ -19,7 +19,8 @@ public:
m_subcpu(*this, "sub"),
m_maincpu(*this, "maincpu"),
m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_decrypted_opcodes(*this, "decrypted_opcodes") { }
/* memory pointers */
required_shared_ptr<UINT8> m_bgtopvideoram;
@@ -71,4 +72,5 @@ public:
required_device<cpu_device> m_maincpu;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
+ optional_shared_ptr<UINT8> m_decrypted_opcodes;
};
diff --git a/src/mame/includes/appoooh.h b/src/mame/includes/appoooh.h
index 85036346278..15dd19a26af 100644
--- a/src/mame/includes/appoooh.h
+++ b/src/mame/includes/appoooh.h
@@ -13,10 +13,11 @@ public:
m_spriteram_2(*this, "spriteram_2"),
m_bg_videoram(*this, "bg_videoram"),
m_bg_colorram(*this, "bg_colorram"),
- m_msm(*this, "msm"),
+ m_decrypted_opcodes(*this, "decrypted_opcodes"),
m_maincpu(*this, "maincpu"),
m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_msm(*this, "msm") { }
/* memory pointers */
required_shared_ptr<UINT8> m_spriteram;
@@ -25,6 +26,7 @@ public:
required_shared_ptr<UINT8> m_spriteram_2;
required_shared_ptr<UINT8> m_bg_videoram;
required_shared_ptr<UINT8> m_bg_colorram;
+ optional_shared_ptr<UINT8> m_decrypted_opcodes;
/* video-related */
tilemap_t *m_fg_tilemap;
@@ -37,16 +39,19 @@ public:
UINT32 m_adpcm_address;
/* devices */
+ required_device<cpu_device> m_maincpu;
+ required_device<gfxdecode_device> m_gfxdecode;
+ required_device<palette_device> m_palette;
required_device<msm5205_device> m_msm;
UINT8 m_nmi_mask;
- DECLARE_WRITE8_MEMBER(appoooh_adpcm_w);
- DECLARE_WRITE8_MEMBER(appoooh_scroll_w);
- DECLARE_WRITE8_MEMBER(appoooh_fg_videoram_w);
- DECLARE_WRITE8_MEMBER(appoooh_fg_colorram_w);
- DECLARE_WRITE8_MEMBER(appoooh_bg_videoram_w);
- DECLARE_WRITE8_MEMBER(appoooh_bg_colorram_w);
- DECLARE_WRITE8_MEMBER(appoooh_out_w);
+ DECLARE_WRITE8_MEMBER(adpcm_w);
+ DECLARE_WRITE8_MEMBER(scroll_w);
+ DECLARE_WRITE8_MEMBER(fg_videoram_w);
+ DECLARE_WRITE8_MEMBER(fg_colorram_w);
+ DECLARE_WRITE8_MEMBER(bg_videoram_w);
+ DECLARE_WRITE8_MEMBER(bg_colorram_w);
+ DECLARE_WRITE8_MEMBER(out_w);
DECLARE_DRIVER_INIT(robowres);
DECLARE_DRIVER_INIT(robowresb);
TILE_GET_INFO_MEMBER(get_fg_tile_info);
@@ -61,10 +66,7 @@ public:
INTERRUPT_GEN_MEMBER(vblank_irq);
void appoooh_draw_sprites( bitmap_ind16 &dest_bmp, const rectangle &cliprect, gfx_element *gfx, UINT8 *sprite );
void robowres_draw_sprites( bitmap_ind16 &dest_bmp, const rectangle &cliprect, gfx_element *gfx, UINT8 *sprite );
- DECLARE_WRITE_LINE_MEMBER(appoooh_adpcm_int);
- required_device<cpu_device> m_maincpu;
- required_device<gfxdecode_device> m_gfxdecode;
- required_device<palette_device> m_palette;
+ DECLARE_WRITE_LINE_MEMBER(adpcm_int);
};
#define CHR1_OFST 0x00 /* palette page of char set #1 */
diff --git a/src/mame/includes/argus.h b/src/mame/includes/argus.h
index 362c4e1aef7..9df650ef079 100644
--- a/src/mame/includes/argus.h
+++ b/src/mame/includes/argus.h
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Yochizo
#include "video/jalblend.h"
diff --git a/src/mame/includes/asuka.h b/src/mame/includes/asuka.h
index ec96ca568a4..9c0f1fdb8b7 100644
--- a/src/mame/includes/asuka.h
+++ b/src/mame/includes/asuka.h
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:David Graves, Brian Troha
/*************************************************************************
diff --git a/src/mame/includes/atarisy2.h b/src/mame/includes/atarisy2.h
index 05345676cbe..17ed588662a 100644
--- a/src/mame/includes/atarisy2.h
+++ b/src/mame/includes/atarisy2.h
@@ -21,7 +21,6 @@ public:
m_audiocpu(*this, "audiocpu"),
m_mob(*this, "mob"),
m_slapstic_base(*this, "slapstic_base"),
- m_bankselect(*this, "bankselect"),
m_playfield_tilemap(*this, "playfield"),
m_alpha_tilemap(*this, "alpha"),
m_rombank1(*this, "rombank1"),
@@ -36,7 +35,6 @@ public:
required_shared_ptr<UINT16> m_slapstic_base;
UINT8 m_interrupt_enable;
- required_shared_ptr<UINT16> m_bankselect;
required_device<tilemap_device> m_playfield_tilemap;
required_device<tilemap_device> m_alpha_tilemap;
@@ -50,8 +48,8 @@ public:
UINT8 m_p2portwr_state;
UINT8 m_p2portrd_state;
- required_shared_ptr<UINT16> m_rombank1;
- required_shared_ptr<UINT16> m_rombank2;
+ required_memory_bank m_rombank1;
+ required_memory_bank m_rombank2;
required_shared_ptr<UINT16> m_generic_paletteram_16;
required_device<atari_slapstic_device> m_slapstic;
@@ -94,7 +92,6 @@ public:
DECLARE_WRITE8_MEMBER(tms5220_w);
DECLARE_WRITE8_MEMBER(tms5220_strobe_w);
DECLARE_WRITE8_MEMBER(coincount_w);
- DECLARE_DIRECT_UPDATE_MEMBER(atarisy2_direct_handler);
DECLARE_DRIVER_INIT(ssprint);
DECLARE_DRIVER_INIT(apb);
DECLARE_DRIVER_INIT(csprint);
diff --git a/src/mame/includes/battlera.h b/src/mame/includes/battlera.h
index 6ab2b1dbe3f..f7fb769e464 100644
--- a/src/mame/includes/battlera.h
+++ b/src/mame/includes/battlera.h
@@ -3,7 +3,6 @@
#include "sound/msm5205.h"
#include "video/huc6260.h"
#include "video/huc6270.h"
-#include "video/huc6202.h"
#define MAIN_CLOCK 21477270
@@ -19,30 +18,24 @@ public:
m_huc6260(*this, "huc6260")
{ }
+ required_device<cpu_device> m_maincpu;
+ required_device<cpu_device> m_audiocpu;
+ required_device<msm5205_device> m_msm;
+ required_device<screen_device> m_screen;
+ required_device<huc6260_device> m_huc6260;
+
int m_control_port_select;
int m_msm5205next;
int m_toggle;
- int m_inc_value;
- int m_irq_enable;
- int m_rcr_enable;
- int m_sb_enable;
- int m_bb_enable;
- int m_bldwolf_vblank;
- required_device<cpu_device> m_maincpu;
- DECLARE_WRITE8_MEMBER(battlera_sound_w);
+ DECLARE_WRITE8_MEMBER(sound_w);
DECLARE_WRITE8_MEMBER(control_data_w);
DECLARE_READ8_MEMBER(control_data_r);
- DECLARE_WRITE8_MEMBER(battlera_adpcm_data_w);
-
- DECLARE_WRITE8_MEMBER(battlera_adpcm_reset_w);
+ DECLARE_WRITE8_MEMBER(adpcm_data_w);
+ DECLARE_WRITE8_MEMBER(adpcm_reset_w);
+ DECLARE_WRITE_LINE_MEMBER(adpcm_int);
+ virtual void machine_start();
- DECLARE_WRITE_LINE_MEMBER(battlera_adpcm_int);
- required_device<cpu_device> m_audiocpu;
- required_device<msm5205_device> m_msm;
- required_device<screen_device> m_screen;
- optional_device<huc6260_device> m_huc6260;
UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- DECLARE_WRITE_LINE_MEMBER(pce_irq_changed);
};
diff --git a/src/mame/includes/boogwing.h b/src/mame/includes/boogwing.h
index 2941973ac05..0c7a9a7d317 100644
--- a/src/mame/includes/boogwing.h
+++ b/src/mame/includes/boogwing.h
@@ -35,7 +35,8 @@ public:
m_pf4_rowscroll(*this, "pf4_rowscroll"),
m_sprgen1(*this, "spritegen1"),
m_sprgen2(*this, "spritegen2"),
- m_palette(*this, "palette")
+ m_palette(*this, "palette"),
+ m_decrypted_opcodes(*this, "decrypted_opcodes")
{ }
/* devices */
@@ -57,6 +58,7 @@ public:
required_device<decospr_device> m_sprgen1;
required_device<decospr_device> m_sprgen2;
required_device<palette_device> m_palette;
+ required_shared_ptr<UINT16> m_decrypted_opcodes;
DECLARE_WRITE8_MEMBER(sound_bankswitch_w);
DECLARE_DRIVER_INIT(boogwing);
diff --git a/src/mame/includes/bublbobl.h b/src/mame/includes/bublbobl.h
index aff69a0391d..61a18a94ca8 100644
--- a/src/mame/includes/bublbobl.h
+++ b/src/mame/includes/bublbobl.h
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Chris Moore, Nicola Salmoria
class bublbobl_state : public driver_device
diff --git a/src/mame/includes/cclimber.h b/src/mame/includes/cclimber.h
index 9939d71fe13..14489ef1f5f 100644
--- a/src/mame/includes/cclimber.h
+++ b/src/mame/includes/cclimber.h
@@ -5,6 +5,10 @@ class cclimber_state : public driver_device
public:
cclimber_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_audiocpu(*this, "audiocpu"),
+ m_gfxdecode(*this, "gfxdecode"),
+ m_palette(*this, "palette"),
m_bigsprite_videoram(*this, "bigspriteram"),
m_videoram(*this, "videoram"),
m_column_scroll(*this, "column_scroll"),
@@ -17,10 +21,12 @@ public:
m_swimmer_background_color(*this, "bgcolor"),
m_toprollr_bg_videoram(*this, "bg_videoram"),
m_toprollr_bg_coloram(*this, "bg_coloram"),
- m_maincpu(*this, "maincpu"),
- m_audiocpu(*this, "audiocpu"),
- m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette") { }
+ m_decrypted_opcodes(*this, "decrypted_opcodes") { }
+
+ required_device<cpu_device> m_maincpu;
+ optional_device<cpu_device> m_audiocpu;
+ required_device<gfxdecode_device> m_gfxdecode;
+ required_device<palette_device> m_palette;
required_shared_ptr<UINT8> m_bigsprite_videoram;
required_shared_ptr<UINT8> m_videoram;
@@ -34,6 +40,7 @@ public:
optional_shared_ptr<UINT8> m_swimmer_background_color;
optional_shared_ptr<UINT8> m_toprollr_bg_videoram;
optional_shared_ptr<UINT8> m_toprollr_bg_coloram;
+ optional_shared_ptr<UINT8> m_decrypted_opcodes;
UINT8 m_yamato_p0;
UINT8 m_yamato_p1;
@@ -42,6 +49,7 @@ public:
tilemap_t *m_pf_tilemap;
tilemap_t *m_bs_tilemap;
tilemap_t *m_toproller_bg_tilemap;
+
DECLARE_WRITE8_MEMBER(swimmer_sh_soundlatch_w);
DECLARE_WRITE8_MEMBER(yamato_p0_w);
DECLARE_WRITE8_MEMBER(yamato_p1_w);
@@ -51,6 +59,8 @@ public:
DECLARE_WRITE8_MEMBER(nmi_mask_w);
DECLARE_WRITE8_MEMBER(cclimber_colorram_w);
DECLARE_WRITE8_MEMBER(cannonb_flip_screen_w);
+
+ virtual void machine_start();
DECLARE_DRIVER_INIT(cclimber);
DECLARE_DRIVER_INIT(yamato);
DECLARE_DRIVER_INIT(ckongb);
@@ -59,12 +69,6 @@ public:
DECLARE_DRIVER_INIT(cannonb2);
DECLARE_DRIVER_INIT(cannonb);
DECLARE_DRIVER_INIT(dking);
- TILE_GET_INFO_MEMBER(cclimber_get_pf_tile_info);
- TILE_GET_INFO_MEMBER(swimmer_get_pf_tile_info);
- TILE_GET_INFO_MEMBER(toprollr_get_pf_tile_info);
- TILE_GET_INFO_MEMBER(cclimber_get_bs_tile_info);
- TILE_GET_INFO_MEMBER(toprollr_get_bs_tile_info);
- TILE_GET_INFO_MEMBER(toproller_get_bg_tile_info);
DECLARE_MACHINE_RESET(cclimber);
DECLARE_VIDEO_START(cclimber);
DECLARE_PALETTE_INIT(cclimber);
@@ -73,11 +77,18 @@ public:
DECLARE_PALETTE_INIT(yamato);
DECLARE_VIDEO_START(toprollr);
DECLARE_PALETTE_INIT(toprollr);
+
+ TILE_GET_INFO_MEMBER(cclimber_get_pf_tile_info);
+ TILE_GET_INFO_MEMBER(swimmer_get_pf_tile_info);
+ TILE_GET_INFO_MEMBER(toprollr_get_pf_tile_info);
+ TILE_GET_INFO_MEMBER(cclimber_get_bs_tile_info);
+ TILE_GET_INFO_MEMBER(toprollr_get_bs_tile_info);
+ TILE_GET_INFO_MEMBER(toproller_get_bg_tile_info);
+
UINT32 screen_update_cclimber(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_swimmer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_yamato(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_toprollr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- INTERRUPT_GEN_MEMBER(vblank_irq);
void swimmer_set_background_pen();
void draw_playfield(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void cclimber_draw_bigsprite(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
@@ -87,8 +98,6 @@ public:
void swimmer_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, gfx_element *gfx);
void cclimber_decode(const UINT8 convtable[8][16]);
void cannonb_patch();
- required_device<cpu_device> m_maincpu;
- optional_device<cpu_device> m_audiocpu;
- required_device<gfxdecode_device> m_gfxdecode;
- required_device<palette_device> m_palette;
+
+ INTERRUPT_GEN_MEMBER(vblank_irq);
};
diff --git a/src/mame/includes/cdi.h b/src/mame/includes/cdi.h
index 5aa1b386f75..9e40bd93d5f 100644
--- a/src/mame/includes/cdi.h
+++ b/src/mame/includes/cdi.h
@@ -58,16 +58,16 @@ public:
virtual void machine_start();
virtual void video_start();
DECLARE_MACHINE_RESET(cdi);
- DECLARE_MACHINE_RESET(quizrd12);
- DECLARE_MACHINE_RESET(quizrd17);
- DECLARE_MACHINE_RESET(quizrd18);
- DECLARE_MACHINE_RESET(quizrd22);
- DECLARE_MACHINE_RESET(quizrd23);
- DECLARE_MACHINE_RESET(quizrd32);
- DECLARE_MACHINE_RESET(quizrd34);
- DECLARE_MACHINE_RESET(quizrr40);
- DECLARE_MACHINE_RESET(quizrr41);
- DECLARE_MACHINE_RESET(quizrr42);
+ DECLARE_MACHINE_RESET(quizard12);
+ DECLARE_MACHINE_RESET(quizard17);
+ DECLARE_MACHINE_RESET(quizard18);
+ DECLARE_MACHINE_RESET(quizard22);
+ DECLARE_MACHINE_RESET(quizard23);
+ DECLARE_MACHINE_RESET(quizard32);
+ DECLARE_MACHINE_RESET(quizard34);
+ DECLARE_MACHINE_RESET(quizard4r40);
+ DECLARE_MACHINE_RESET(quizard4r41);
+ DECLARE_MACHINE_RESET(quizard4r42);
UINT32 screen_update_cdimono1(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
UINT32 screen_update_cdimono1_lcd(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
};
diff --git a/src/mame/includes/cheekyms.h b/src/mame/includes/cheekyms.h
index d40d9e4dc77..4e6ce443d99 100644
--- a/src/mame/includes/cheekyms.h
+++ b/src/mame/includes/cheekyms.h
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Lee Taylor, Chris Moore
/*************************************************************************
diff --git a/src/mame/includes/commando.h b/src/mame/includes/commando.h
index 0d3f78f873a..ad7fe963494 100644
--- a/src/mame/includes/commando.h
+++ b/src/mame/includes/commando.h
@@ -21,7 +21,8 @@ public:
m_audiocpu(*this, "audiocpu"),
m_maincpu(*this, "maincpu"),
m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_decrypted_opcodes(*this, "decrypted_opcodes") { }
/* memory pointers */
required_device<buffered_spriteram8_device> m_spriteram;
@@ -58,4 +59,5 @@ public:
required_device<cpu_device> m_maincpu;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
+ optional_shared_ptr<UINT8> m_decrypted_opcodes;
};
diff --git a/src/mame/includes/cps1.h b/src/mame/includes/cps1.h
index 6f5ee69fb46..96e22f1c686 100644
--- a/src/mame/includes/cps1.h
+++ b/src/mame/includes/cps1.h
@@ -116,7 +116,8 @@ public:
m_msm_2(*this, "msm2"),
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_decrypted_opcodes(*this, "decrypted_opcodes") { }
/* memory pointers */
// cps1
@@ -212,6 +213,7 @@ public:
required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
+ optional_shared_ptr<UINT16> m_decrypted_opcodes;
DECLARE_READ16_MEMBER(cps1_hack_dsw_r);
DECLARE_READ16_MEMBER(cps1_in1_r);
@@ -271,6 +273,7 @@ public:
DECLARE_DRIVER_INIT(ganbare);
DECLARE_DRIVER_INIT(cps2_video);
DECLARE_DRIVER_INIT(cps2);
+ DECLARE_DRIVER_INIT(cps2nc);
DECLARE_DRIVER_INIT(cps2crpt);
DECLARE_DRIVER_INIT(ssf2tb);
DECLARE_DRIVER_INIT(pzloop2);
@@ -301,6 +304,7 @@ public:
TIMER_DEVICE_CALLBACK_MEMBER(cps2_interrupt);
TIMER_CALLBACK_MEMBER(cps2_update_digital_volume);
+ void kabuki_setup(void (*decode)(UINT8 *src, UINT8 *dst));
/* fcrash handlers */
DECLARE_DRIVER_INIT(kodb);
diff --git a/src/mame/includes/cps3.h b/src/mame/includes/cps3.h
index efbde9ea77d..2ff488f0445 100644
--- a/src/mame/includes/cps3.h
+++ b/src/mame/includes/cps3.h
@@ -28,7 +28,9 @@ public:
m_tilemap40_regs_base(*this, "tmap40_regs"),
m_tilemap50_regs_base(*this, "tmap50_regs"),
m_fullscreenzoom(*this, "fullscreenzoom"),
- m_0xc0000000_ram(*this, "0xc0000000_ram")
+ m_0xc0000000_ram(*this, "0xc0000000_ram"),
+ m_decrypted_gamerom(*this, "decrypted_gamerom"),
+ m_0xc0000000_ram_decrypted(*this, "0xc0000000_ram_decrypted")
{ }
required_device<sh2_device> m_maincpu;
@@ -45,13 +47,12 @@ public:
required_shared_ptr<UINT32> m_tilemap50_regs_base;
required_shared_ptr<UINT32> m_fullscreenzoom;
required_shared_ptr<UINT32> m_0xc0000000_ram;
+ required_shared_ptr<UINT32> m_decrypted_gamerom;
+ required_shared_ptr<UINT32> m_0xc0000000_ram_decrypted;
fujitsu_29f016a_device *m_simm[7][8];
- UINT32* m_decrypted_bios;
- UINT32* m_decrypted_gamerom;
UINT32 m_cram_gfxflash_bank;
UINT32* m_nops;
- UINT32* m_0xc0000000_ram_decrypted;
UINT32* m_char_ram;
UINT32* m_eeprom;
UINT32 m_ss_pal_base;
@@ -111,7 +112,6 @@ public:
DECLARE_WRITE32_MEMBER(cps3_unk_vidregs_w);
DECLARE_READ32_MEMBER(cps3_colourram_r);
DECLARE_WRITE32_MEMBER(cps3_colourram_w);
- DECLARE_DIRECT_UPDATE_MEMBER(cps3_direct_handler);
DECLARE_DRIVER_INIT(sfiii3);
DECLARE_DRIVER_INIT(sfiii);
DECLARE_DRIVER_INIT(redearth);
diff --git a/src/mame/includes/darkmist.h b/src/mame/includes/darkmist.h
index f7f0e0704bf..07b63ff6108 100644
--- a/src/mame/includes/darkmist.h
+++ b/src/mame/includes/darkmist.h
@@ -15,7 +15,8 @@ public:
m_scroll(*this, "scroll"),
m_videoram(*this, "videoram"),
m_workram(*this, "workram"),
- m_spriteram(*this, "spriteram") { }
+ m_spriteram(*this, "spriteram"),
+ m_decrypted_opcodes(*this, "decrypted_opcodes") { }
required_device<cpu_device> m_maincpu;
required_device<t5182_device> m_t5182;
@@ -27,6 +28,7 @@ public:
required_shared_ptr<UINT8> m_videoram;
required_shared_ptr<UINT8> m_workram;
required_shared_ptr<UINT8> m_spriteram;
+ optional_shared_ptr<UINT8> m_decrypted_opcodes;
int m_hw;
tilemap_t *m_bgtilemap;
@@ -39,6 +41,7 @@ public:
TILE_GET_INFO_MEMBER(get_fgtile_info);
TILE_GET_INFO_MEMBER(get_txttile_info);
+ virtual void machine_start();
DECLARE_DRIVER_INIT(darkmist);
virtual void video_start();
DECLARE_PALETTE_INIT(darkmist);
diff --git a/src/mame/includes/deco32.h b/src/mame/includes/deco32.h
index 0d5bf5dcc9e..a03efc5adce 100644
--- a/src/mame/includes/deco32.h
+++ b/src/mame/includes/deco32.h
@@ -21,12 +21,6 @@ public:
m_deco104(*this, "ioprot104"),
m_decobsmt(*this, "decobsmt"),
m_spriteram(*this, "spriteram"),
- m_ram(*this, "ram"),
- m_pf1_rowscroll32(*this, "pf1_rowscroll32"),
- m_pf2_rowscroll32(*this, "pf2_rowscroll32"),
- m_pf3_rowscroll32(*this, "pf3_rowscroll32"),
- m_pf4_rowscroll32(*this, "pf4_rowscroll32"),
- m_ace_ram(*this, "ace_ram"),
m_sprgen(*this, "spritegen"),
m_sprgen1(*this, "spritegen1"),
m_sprgen2(*this, "spritegen2"),
@@ -39,7 +33,13 @@ public:
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
m_palette(*this, "palette"),
- m_generic_paletteram_32(*this, "paletteram")
+ m_ram(*this, "ram"),
+ m_pf1_rowscroll32(*this, "pf1_rowscroll32"),
+ m_pf2_rowscroll32(*this, "pf2_rowscroll32"),
+ m_pf3_rowscroll32(*this, "pf3_rowscroll32"),
+ m_pf4_rowscroll32(*this, "pf4_rowscroll32"),
+ m_generic_paletteram_32(*this, "paletteram"),
+ m_ace_ram(*this, "ace_ram")
{ }
required_device<cpu_device> m_maincpu;
@@ -48,101 +48,110 @@ public:
optional_device<deco104_device> m_deco104;
optional_device<decobsmt_device> m_decobsmt;
optional_device<buffered_spriteram32_device> m_spriteram;
- required_shared_ptr<UINT32> m_ram;
- // we use the pointers below to store a 32-bit copy..
- required_shared_ptr<UINT32> m_pf1_rowscroll32;
- required_shared_ptr<UINT32> m_pf2_rowscroll32;
- required_shared_ptr<UINT32> m_pf3_rowscroll32;
- required_shared_ptr<UINT32> m_pf4_rowscroll32;
-
- optional_shared_ptr<UINT32> m_ace_ram;
optional_device<decospr_device> m_sprgen;
optional_device<decospr_device> m_sprgen1;
optional_device<decospr_device> m_sprgen2;
optional_device<deco_zoomspr_device> m_sprgenzoom;
-
optional_device<eeprom_serial_93cxx_device> m_eeprom;
optional_device<okim6295_device> m_oki1;
optional_device<okim6295_device> m_oki2;
-
- int m_raster_enable;
- timer_device *m_raster_irq_timer;
- UINT8 m_nslasher_sound_irq;
-
- int m_tattass_eprom_bit;
- int m_lastClock;
- char m_buffer[32];
- int m_bufPtr;
- int m_pendingCommand;
- int m_readBitCount;
- int m_byteAddr;
-
- int m_ace_ram_dirty;
- int m_has_ace_ram;
-
- UINT8 *m_dirty_palette;
-
- int m_pri;
- bitmap_ind16 *m_tilemap_alpha_bitmap;
-
-
- UINT16 m_spriteram16[0x1000];
- UINT16 m_spriteram16_buffered[0x1000];
- UINT16 m_spriteram16_2[0x1000];
- UINT16 m_spriteram16_2_buffered[0x1000];
- UINT16 m_pf1_rowscroll[0x1000];
- UINT16 m_pf2_rowscroll[0x1000];
- UINT16 m_pf3_rowscroll[0x1000];
- UINT16 m_pf4_rowscroll[0x1000];
-
required_device<deco16ic_device> m_deco_tilegen1;
required_device<deco16ic_device> m_deco_tilegen2;
-
required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
+
+ required_shared_ptr<UINT32> m_ram;
+ // we use the pointers below to store a 32-bit copy..
+ required_shared_ptr<UINT32> m_pf1_rowscroll32;
+ required_shared_ptr<UINT32> m_pf2_rowscroll32;
+ required_shared_ptr<UINT32> m_pf3_rowscroll32;
+ required_shared_ptr<UINT32> m_pf4_rowscroll32;
required_shared_ptr<UINT32> m_generic_paletteram_32;
+ optional_shared_ptr<UINT32> m_ace_ram;
- UINT8 m_irq_source;
- DECLARE_WRITE_LINE_MEMBER(sound_irq_nslasher);
- DECLARE_READ32_MEMBER(deco32_irq_controller_r);
- DECLARE_WRITE32_MEMBER(deco32_irq_controller_w);
- DECLARE_WRITE32_MEMBER(deco32_sound_w);
- DECLARE_READ32_MEMBER(deco32_71_r);
+ int m_raster_enable; // captaven, dragongun and lockload
+ timer_device *m_raster_irq_timer; // captaven, dragongun and lockload
+ UINT8 m_nslasher_sound_irq; // nslasher and lockload
+ UINT8 m_irq_source; // captaven, dragongun and lockload
+ int m_tattass_eprom_bit; // tattass
+ int m_lastClock; // tattass
+ char m_buffer[32]; // tattass
+ int m_bufPtr; // tattass
+ int m_pendingCommand; // tattass
+ int m_readBitCount; // tattass
+ int m_byteAddr; // tattass
+ int m_ace_ram_dirty; // nslasher and tattass
+ int m_has_ace_ram; // all - config
+ UINT8 *m_dirty_palette; // all but captaven
+ int m_pri; // captaven, fghthist, nslasher and tattass
+ bitmap_ind16 *m_tilemap_alpha_bitmap; // nslasher
+ UINT16 m_spriteram16[0x1000]; // captaven, fghthist, nslasher and tattass
+ UINT16 m_spriteram16_buffered[0x1000]; // captaven, fghthist, nslasher and tattass
+ UINT16 m_spriteram16_2[0x1000]; //nslasher and tattass
+ UINT16 m_spriteram16_2_buffered[0x1000]; //nslasher and tattass
+ UINT16 m_pf1_rowscroll[0x1000]; // common
+ UINT16 m_pf2_rowscroll[0x1000]; // common
+ UINT16 m_pf3_rowscroll[0x1000]; // common
+ UINT16 m_pf4_rowscroll[0x1000]; // common
+
+ // common
+ DECLARE_WRITE32_MEMBER(pf1_rowscroll_w);
+ DECLARE_WRITE32_MEMBER(pf2_rowscroll_w);
+ DECLARE_WRITE32_MEMBER(pf3_rowscroll_w);
+ DECLARE_WRITE32_MEMBER(pf4_rowscroll_w);
+ DECLARE_WRITE8_MEMBER(sound_bankswitch_w);
+
+ // captaven
+ DECLARE_READ32_MEMBER(_71_r);
DECLARE_READ32_MEMBER(captaven_soundcpu_r);
+ DECLARE_WRITE32_MEMBER(nonbuffered_palette_w);
+
+ // fghthist
+ DECLARE_WRITE32_MEMBER(sound_w);
DECLARE_READ32_MEMBER(fghthist_control_r);
DECLARE_WRITE32_MEMBER(fghthist_eeprom_w);
- DECLARE_READ32_MEMBER(dragngun_service_r);
- DECLARE_READ32_MEMBER(lockload_gun_mirror_r);
- DECLARE_READ32_MEMBER(tattass_prot_r);
- DECLARE_WRITE32_MEMBER(tattass_prot_w);
- DECLARE_WRITE32_MEMBER(tattass_control_w);
- //DECLARE_READ32_MEMBER(nslasher_prot_r);
- DECLARE_READ16_MEMBER( nslasher_protection_region_0_104_r );
- DECLARE_WRITE16_MEMBER( nslasher_protection_region_0_104_w );
- DECLARE_READ16_MEMBER( nslasher_debug_r );
+ DECLARE_READ32_MEMBER(fghthist_protection_region_0_146_r);
+ DECLARE_WRITE32_MEMBER(fghthist_protection_region_0_146_w);
+ // nslasher
DECLARE_WRITE32_MEMBER(nslasher_eeprom_w);
- //DECLARE_WRITE32_MEMBER(nslasher_prot_w);
- DECLARE_READ32_MEMBER(deco32_spriteram_r);
- DECLARE_WRITE32_MEMBER(deco32_spriteram_w);
- DECLARE_WRITE32_MEMBER(deco32_buffer_spriteram_w);
- DECLARE_READ32_MEMBER(deco32_spriteram2_r);
- DECLARE_WRITE32_MEMBER(deco32_spriteram2_w);
- DECLARE_WRITE32_MEMBER(deco32_buffer_spriteram2_w);
- DECLARE_WRITE32_MEMBER(deco32_pf1_rowscroll_w);
- DECLARE_WRITE32_MEMBER(deco32_pf2_rowscroll_w);
- DECLARE_WRITE32_MEMBER(deco32_pf3_rowscroll_w);
- DECLARE_WRITE32_MEMBER(deco32_pf4_rowscroll_w);
+
+ // tattass
+ DECLARE_WRITE32_MEMBER(tattass_control_w);
+
+ // nslasher and lockload
+ DECLARE_WRITE_LINE_MEMBER(sound_irq_nslasher);
DECLARE_READ8_MEMBER(latch_r);
- DECLARE_WRITE32_MEMBER(deco32_pri_w);
- DECLARE_WRITE32_MEMBER(deco32_ace_ram_w);
- DECLARE_WRITE32_MEMBER(deco32_nonbuffered_palette_w);
- DECLARE_WRITE32_MEMBER(deco32_buffered_palette_w);
- DECLARE_WRITE32_MEMBER(deco32_palette_dma_w);
- DECLARE_READ32_MEMBER(dragngun_eeprom_r);
- DECLARE_WRITE32_MEMBER(dragngun_eeprom_w);
- DECLARE_WRITE8_MEMBER(sound_bankswitch_w);
+
+ // captaven, dragongun and lockload
+ DECLARE_READ32_MEMBER(irq_controller_r);
+ DECLARE_WRITE32_MEMBER(irq_controller_w);
+
+ // nslasher and tattass
+ DECLARE_READ16_MEMBER(nslasher_protection_region_0_104_r);
+ DECLARE_WRITE16_MEMBER(nslasher_protection_region_0_104_w);
+ DECLARE_READ16_MEMBER(nslasher_debug_r);
+ DECLARE_READ32_MEMBER(spriteram2_r);
+ DECLARE_WRITE32_MEMBER(spriteram2_w);
+ DECLARE_WRITE32_MEMBER(buffer_spriteram2_w);
+ DECLARE_WRITE32_MEMBER(ace_ram_w);
+
+ // captaven, fghthist, nslasher and tattass
+ DECLARE_READ32_MEMBER(spriteram_r);
+ DECLARE_WRITE32_MEMBER(spriteram_w);
+ DECLARE_WRITE32_MEMBER(buffer_spriteram_w);
+ DECLARE_WRITE32_MEMBER(pri_w);
+
+ // all but captaven
+ DECLARE_WRITE32_MEMBER(buffered_palette_w);
+ DECLARE_WRITE32_MEMBER(palette_dma_w);
+
+ // captaven, dragongun and lockload
+ DECLARE_READ16_MEMBER(dg_protection_region_0_146_r);
+ DECLARE_WRITE16_MEMBER(dg_protection_region_0_146_w);
+
+ virtual void video_start();
DECLARE_DRIVER_INIT(tattass);
DECLARE_DRIVER_INIT(nslasher);
DECLARE_DRIVER_INIT(captaven);
@@ -151,23 +160,19 @@ public:
DECLARE_VIDEO_START(captaven);
DECLARE_VIDEO_START(fghthist);
DECLARE_VIDEO_START(nslasher);
+
+ INTERRUPT_GEN_MEMBER(deco32_vbl_interrupt);
+ TIMER_DEVICE_CALLBACK_MEMBER(interrupt_gen);
+
UINT32 screen_update_captaven(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_fghthist(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
UINT32 screen_update_nslasher(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
- void screen_eof_captaven(screen_device &screen, bool state);
- INTERRUPT_GEN_MEMBER(deco32_vbl_interrupt);
- TIMER_DEVICE_CALLBACK_MEMBER(interrupt_gen);
- TIMER_DEVICE_CALLBACK_MEMBER(lockload_vbl_irq);
void updateAceRam();
void mixDualAlphaSprites(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, gfx_element *gfx0, gfx_element *gfx1, int mixAlphaTilemap);
UINT16 port_a_fghthist(int unused);
UINT16 port_b_fghthist(int unused);
UINT16 port_c_fghthist(int unused);
- READ32_MEMBER( fghthist_protection_region_0_146_r );
- WRITE32_MEMBER( fghthist_protection_region_0_146_w );
- READ16_MEMBER( dg_protection_region_0_146_r );
- WRITE16_MEMBER( dg_protection_region_0_146_w );
void deco32_sound_cb( address_space &space, UINT16 data, UINT16 mem_mask );
UINT16 port_b_nslasher(int unused);
@@ -186,37 +191,43 @@ class dragngun_state : public deco32_state
public:
dragngun_state(const machine_config &mconfig, device_type type, const char *tag)
: deco32_state(mconfig, type, tag),
- m_dragngun_sprite_layout_0_ram(*this, "dragngun_lay0"),
- m_dragngun_sprite_layout_1_ram(*this, "dragngun_lay1"),
- m_dragngun_sprite_lookup_0_ram(*this, "dragngun_look0"),
- m_dragngun_sprite_lookup_1_ram(*this, "dragngun_look1")
+ m_sprite_layout_0_ram(*this, "lay0"),
+ m_sprite_layout_1_ram(*this, "lay1"),
+ m_sprite_lookup_0_ram(*this, "look0"),
+ m_sprite_lookup_1_ram(*this, "look1")
{ }
- required_shared_ptr<UINT32> m_dragngun_sprite_layout_0_ram;
- required_shared_ptr<UINT32> m_dragngun_sprite_layout_1_ram;
- required_shared_ptr<UINT32> m_dragngun_sprite_lookup_0_ram;
- required_shared_ptr<UINT32> m_dragngun_sprite_lookup_1_ram;
-
- UINT32 m_dragngun_sprite_ctrl;
- int m_dragngun_lightgun_port;
- DECLARE_READ32_MEMBER(dragngun_lightgun_r);
- DECLARE_WRITE32_MEMBER(dragngun_lightgun_w);
- DECLARE_WRITE32_MEMBER(dragngun_sprite_control_w);
- DECLARE_WRITE32_MEMBER(dragngun_spriteram_dma_w);
+ required_shared_ptr<UINT32> m_sprite_layout_0_ram;
+ required_shared_ptr<UINT32> m_sprite_layout_1_ram;
+ required_shared_ptr<UINT32> m_sprite_lookup_0_ram;
+ required_shared_ptr<UINT32> m_sprite_lookup_1_ram;
+
+ UINT32 m_sprite_ctrl;
+ int m_lightgun_port;
+ bitmap_rgb32 m_temp_render_bitmap;
+
+ DECLARE_READ32_MEMBER(lightgun_r);
+ DECLARE_WRITE32_MEMBER(lightgun_w);
+ DECLARE_WRITE32_MEMBER(sprite_control_w);
+ DECLARE_WRITE32_MEMBER(spriteram_dma_w);
+ DECLARE_READ32_MEMBER(unk_video_r);
+ DECLARE_READ32_MEMBER(service_r);
+ DECLARE_READ32_MEMBER(eeprom_r);
+ DECLARE_WRITE32_MEMBER(eeprom_w);
+ DECLARE_READ32_MEMBER(lockload_gun_mirror_r);
+
+ virtual void video_start();
DECLARE_DRIVER_INIT(dragngun);
DECLARE_DRIVER_INIT(dragngunj);
DECLARE_DRIVER_INIT(lockload);
DECLARE_VIDEO_START(dragngun);
DECLARE_VIDEO_START(lockload);
+ void dragngun_init_common();
+
+ TIMER_DEVICE_CALLBACK_MEMBER(lockload_vbl_irq);
+
UINT32 screen_update_dragngun(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
- void init_dragngun_common();
- void screen_eof_dragngun(screen_device &screen, bool state);
- void dragngun_draw_sprites( bitmap_rgb32 &bitmap, const rectangle &cliprect, const UINT32 *spritedata);
- READ32_MEMBER( dragngun_unk_video_r );
DECO16IC_BANK_CB_MEMBER(bank_1_callback);
DECO16IC_BANK_CB_MEMBER(bank_2_callback);
-
- bitmap_rgb32 m_temp_render_bitmap;
-
};
diff --git a/src/mame/includes/decocrpt.h b/src/mame/includes/decocrpt.h
index 3bfcd1c6e8a..6ea05a3b7a0 100644
--- a/src/mame/includes/decocrpt.h
+++ b/src/mame/includes/decocrpt.h
@@ -9,7 +9,7 @@ void deco56_remap_gfx(running_machine &machine, const char *tag);
/*----------- defined in machine/deco102.c -----------*/
-void deco102_decrypt_cpu(running_machine &machine, const char *cputag, int address_xor, int data_select_xor, int opcode_select_xor);
+void deco102_decrypt_cpu(UINT16 *rom, UINT16 *opcodes, int size, int address_xor, int data_select_xor, int opcode_select_xor);
/*----------- defined in machine/deco156.c -----------*/
diff --git a/src/mame/includes/dietgo.h b/src/mame/includes/dietgo.h
index 8211cec1b8e..12c47ebf49e 100644
--- a/src/mame/includes/dietgo.h
+++ b/src/mame/includes/dietgo.h
@@ -24,7 +24,8 @@ public:
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
m_deco_tilegen1(*this, "tilegen1"),
- m_decocomn(*this, "deco_common")
+ m_decocomn(*this, "deco_common"),
+ m_decrypted_opcodes(*this, "decrypted_opcodes")
{ }
optional_device<deco104_device> m_deco104;
@@ -40,6 +41,7 @@ public:
required_device<cpu_device> m_audiocpu;
required_device<deco16ic_device> m_deco_tilegen1;
required_device<decocomn_device> m_decocomn;
+ required_shared_ptr<UINT16> m_decrypted_opcodes;
DECLARE_DRIVER_INIT(dietgo);
virtual void machine_start();
UINT32 screen_update_dietgo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
diff --git a/src/mame/includes/dynax.h b/src/mame/includes/dynax.h
index 378d23739b0..694487d4120 100644
--- a/src/mame/includes/dynax.h
+++ b/src/mame/includes/dynax.h
@@ -226,6 +226,8 @@ public:
DECLARE_DRIVER_INIT(blktouch);
DECLARE_DRIVER_INIT(mjelct3a);
DECLARE_DRIVER_INIT(mjreach);
+ DECLARE_DRIVER_INIT(maya_common);
+ DECLARE_DRIVER_INIT(mayac);
DECLARE_DRIVER_INIT(maya);
UINT32 screen_update_hanamai(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
diff --git a/src/mame/includes/exzisus.h b/src/mame/includes/exzisus.h
index 6fdc1fd10a0..3d8c00d5ebe 100644
--- a/src/mame/includes/exzisus.h
+++ b/src/mame/includes/exzisus.h
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Yochizo
class exzisus_state : public driver_device
{
diff --git a/src/mame/includes/freekick.h b/src/mame/includes/freekick.h
index f2bb788d160..514cbfb7c2b 100644
--- a/src/mame/includes/freekick.h
+++ b/src/mame/includes/freekick.h
@@ -11,7 +11,9 @@ public:
m_spriteram(*this, "spriteram"),
m_maincpu(*this, "maincpu"),
m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_bank1(*this, "bank1"),
+ m_bank1d(*this, "bank1d") { }
/* memory pointers */
required_shared_ptr<UINT8> m_videoram;
@@ -63,4 +65,5 @@ public:
required_device<cpu_device> m_maincpu;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
+ optional_memory_bank m_bank1, m_bank1d;
};
diff --git a/src/mame/includes/galastrm.h b/src/mame/includes/galastrm.h
index 5bede2632db..5ac71d4cc79 100644
--- a/src/mame/includes/galastrm.h
+++ b/src/mame/includes/galastrm.h
@@ -5,7 +5,7 @@
#include "video/tc0100scn.h"
#include "video/tc0480scp.h"
-struct tempsprite
+struct gs_tempsprite
{
int gfx;
int code,color;
@@ -53,8 +53,8 @@ public:
int m_tc0610_1_addr;
UINT32 m_mem[2];
INT16 m_tc0610_ctrl_reg[2][8];
- struct tempsprite *m_spritelist;
- struct tempsprite *m_sprite_ptr_pre;
+ struct gs_tempsprite *m_spritelist;
+ struct gs_tempsprite *m_sprite_ptr_pre;
bitmap_ind16 m_tmpbitmaps;
bitmap_ind16 m_polybitmap;
legacy_poly_manager *m_poly;
diff --git a/src/mame/includes/galaxian.h b/src/mame/includes/galaxian.h
index 871581a0c06..500a419e203 100644
--- a/src/mame/includes/galaxian.h
+++ b/src/mame/includes/galaxian.h
@@ -54,7 +54,8 @@ public:
m_videoram(*this, "videoram"),
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_decrypted_opcodes(*this, "decrypted_opcodes") { }
required_device<cpu_device> m_maincpu;
optional_device<cpu_device> m_audiocpu;
@@ -73,6 +74,7 @@ public:
required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
+ optional_shared_ptr<UINT8> m_decrypted_opcodes;
int m_bullets_base;
int m_sprites_base;
diff --git a/src/mame/includes/gameplan.h b/src/mame/includes/gameplan.h
index 21e29d9b7d8..700a2e1e4ea 100644
--- a/src/mame/includes/gameplan.h
+++ b/src/mame/includes/gameplan.h
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Chris Moore
/***************************************************************************
diff --git a/src/mame/includes/gaplus.h b/src/mame/includes/gaplus.h
index b4b63246d50..42ec05e4fb4 100644
--- a/src/mame/includes/gaplus.h
+++ b/src/mame/includes/gaplus.h
@@ -34,27 +34,28 @@ public:
m_subcpu2(*this, "sub2"),
m_namco_15xx(*this, "namco"),
m_samples(*this, "samples") ,
- m_customio_3(*this,"customio_3"),
- m_videoram(*this,"videoram"),
- m_spriteram(*this,"spriteram"),
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_customio_3(*this,"customio_3"),
+ m_videoram(*this,"videoram"),
+ m_spriteram(*this,"spriteram") { }
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_subcpu;
required_device<cpu_device> m_subcpu2;
required_device<namco_15xx_device> m_namco_15xx;
required_device<samples_device> m_samples;
- required_shared_ptr<UINT8> m_customio_3;
- required_shared_ptr<UINT8> m_videoram;
- required_shared_ptr<UINT8> m_spriteram;
required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
namco58xx_device *m_namco58xx;
namco56xx_device *m_namco56xx;
+ required_shared_ptr<UINT8> m_customio_3;
+ required_shared_ptr<UINT8> m_videoram;
+ required_shared_ptr<UINT8> m_spriteram;
+
int m_type;
tilemap_t *m_bg_tilemap;
@@ -64,36 +65,38 @@ public:
UINT8 m_main_irq_mask;
UINT8 m_sub_irq_mask;
UINT8 m_sub2_irq_mask;
- DECLARE_READ8_MEMBER(gaplus_spriteram_r);
- DECLARE_WRITE8_MEMBER(gaplus_spriteram_w);
- DECLARE_WRITE8_MEMBER(gaplus_irq_1_ctrl_w);
- DECLARE_WRITE8_MEMBER(gaplus_irq_2_ctrl_w);
- DECLARE_WRITE8_MEMBER(gaplus_irq_3_ctrl_w);
- DECLARE_WRITE8_MEMBER(gaplus_sreset_w);
- DECLARE_WRITE8_MEMBER(gaplus_freset_w);
- DECLARE_WRITE8_MEMBER(gaplus_customio_3_w);
- DECLARE_READ8_MEMBER(gaplus_customio_3_r);
- DECLARE_READ8_MEMBER(gaplus_videoram_r);
- DECLARE_WRITE8_MEMBER(gaplus_videoram_w);
- DECLARE_WRITE8_MEMBER(gaplus_starfield_control_w);
+
+ DECLARE_WRITE8_MEMBER(irq_1_ctrl_w);
+ DECLARE_WRITE8_MEMBER(irq_2_ctrl_w);
+ DECLARE_WRITE8_MEMBER(irq_3_ctrl_w);
+ DECLARE_WRITE8_MEMBER(sreset_w);
+ DECLARE_WRITE8_MEMBER(freset_w);
+ DECLARE_WRITE8_MEMBER(customio_3_w);
+ DECLARE_READ8_MEMBER(customio_3_r);
+ DECLARE_WRITE8_MEMBER(videoram_w);
+ DECLARE_WRITE8_MEMBER(starfield_control_w);
DECLARE_WRITE8_MEMBER(out_lamps0);
DECLARE_WRITE8_MEMBER(out_lamps1);
- DECLARE_MACHINE_START(gaplus);
+
DECLARE_DRIVER_INIT(gaplus);
DECLARE_DRIVER_INIT(gaplusd);
DECLARE_DRIVER_INIT(galaga3);
- TILEMAP_MAPPER_MEMBER(tilemap_scan);
- TILE_GET_INFO_MEMBER(get_tile_info);
+ virtual void machine_start();
virtual void machine_reset();
virtual void video_start();
DECLARE_PALETTE_INIT(gaplus);
- UINT32 screen_update_gaplus(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- void screen_eof_gaplus(screen_device &screen, bool state);
- INTERRUPT_GEN_MEMBER(gaplus_vblank_main_irq);
+
+ TILEMAP_MAPPER_MEMBER(tilemap_scan);
+ TILE_GET_INFO_MEMBER(get_tile_info);
+
+ INTERRUPT_GEN_MEMBER(vblank_main_irq);
INTERRUPT_GEN_MEMBER(gapluso_vblank_main_irq);
- INTERRUPT_GEN_MEMBER(gaplus_vblank_sub_irq);
- INTERRUPT_GEN_MEMBER(gaplus_vblank_sub2_irq);
+ INTERRUPT_GEN_MEMBER(vblank_sub_irq);
+ INTERRUPT_GEN_MEMBER(vblank_sub2_irq);
TIMER_CALLBACK_MEMBER(namcoio_run);
+
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ void screen_eof(screen_device &screen, bool state);
void starfield_init();
void starfield_render(bitmap_ind16 &bitmap);
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect );
diff --git a/src/mame/includes/gcpinbal.h b/src/mame/includes/gcpinbal.h
index 261f63545fe..57d0abf0eec 100644
--- a/src/mame/includes/gcpinbal.h
+++ b/src/mame/includes/gcpinbal.h
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:David Graves, R. Belmont
#include "sound/okim6295.h"
diff --git a/src/mame/includes/grchamp.h b/src/mame/includes/grchamp.h
index b14083bdae5..a9c4d4dbf66 100644
--- a/src/mame/includes/grchamp.h
+++ b/src/mame/includes/grchamp.h
@@ -13,19 +13,34 @@ class grchamp_state : public driver_device
public:
grchamp_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
- m_radarram(*this, "radarram"),
- m_videoram(*this, "videoram"),
- m_spriteram(*this, "spriteram"),
- m_leftram(*this, "leftram"),
- m_rightram(*this, "rightram"),
- m_centerram(*this, "centerram"),
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
m_subcpu(*this, "sub"),
m_discrete(*this, "discrete"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
- m_screen(*this, "screen") { }
+ m_screen(*this, "screen"),
+ m_radarram(*this, "radarram"),
+ m_videoram(*this, "videoram"),
+ m_spriteram(*this, "spriteram"),
+ m_leftram(*this, "leftram"),
+ m_rightram(*this, "rightram"),
+ m_centerram(*this, "centerram") { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<cpu_device> m_audiocpu;
+ required_device<cpu_device> m_subcpu;
+ required_device<discrete_device> m_discrete;
+ required_device<gfxdecode_device> m_gfxdecode;
+ required_device<palette_device> m_palette;
+ required_device<screen_device> m_screen;
+
+ required_shared_ptr<UINT8> m_radarram;
+ required_shared_ptr<UINT8> m_videoram;
+ required_shared_ptr<UINT8> m_spriteram;
+ required_shared_ptr<UINT8> m_leftram;
+ required_shared_ptr<UINT8> m_rightram;
+ required_shared_ptr<UINT8> m_centerram;
UINT8 m_cpu0_out[16];
UINT8 m_cpu1_out[16];
@@ -40,13 +55,6 @@ public:
UINT16 m_collide;
UINT8 m_collmode;
- required_shared_ptr<UINT8> m_radarram;
- required_shared_ptr<UINT8> m_videoram;
- required_shared_ptr<UINT8> m_spriteram;
- required_shared_ptr<UINT8> m_leftram;
- required_shared_ptr<UINT8> m_rightram;
- required_shared_ptr<UINT8> m_centerram;
-
bitmap_ind16 m_work_bitmap;
tilemap_t * m_text_tilemap;
tilemap_t * m_left_tilemap;
@@ -64,37 +72,34 @@ public:
DECLARE_WRITE8_MEMBER(main_to_sub_comm_w);
DECLARE_READ8_MEMBER(main_to_sub_comm_r);
UINT8 get_pc3259_bits(int offs);
- DECLARE_WRITE8_MEMBER(grchamp_left_w);
- DECLARE_WRITE8_MEMBER(grchamp_center_w);
- DECLARE_WRITE8_MEMBER(grchamp_right_w);
- DECLARE_WRITE8_MEMBER(grchamp_portA_0_w);
- DECLARE_WRITE8_MEMBER(grchamp_portB_0_w);
- DECLARE_WRITE8_MEMBER(grchamp_portA_2_w);
- DECLARE_WRITE8_MEMBER(grchamp_portB_2_w);
+ DECLARE_WRITE8_MEMBER(left_w);
+ DECLARE_WRITE8_MEMBER(center_w);
+ DECLARE_WRITE8_MEMBER(right_w);
+ DECLARE_WRITE8_MEMBER(portA_0_w);
+ DECLARE_WRITE8_MEMBER(portB_0_w);
+ DECLARE_WRITE8_MEMBER(portA_2_w);
+ DECLARE_WRITE8_MEMBER(portB_2_w);
+
TILE_GET_INFO_MEMBER(get_text_tile_info);
TILE_GET_INFO_MEMBER(get_left_tile_info);
TILE_GET_INFO_MEMBER(get_right_tile_info);
TILE_GET_INFO_MEMBER(get_center_tile_info);
- DECLARE_PALETTE_INIT(grchamp);
TILEMAP_MAPPER_MEMBER(get_memory_offset);
+
+ DECLARE_PALETTE_INIT(grchamp);
+ virtual void machine_start();
virtual void machine_reset();
virtual void video_start();
- void palette_generate();
- UINT32 screen_update_grchamp(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
- INTERRUPT_GEN_MEMBER(grchamp_cpu0_interrupt);
- INTERRUPT_GEN_MEMBER(grchamp_cpu1_interrupt);
+
+ INTERRUPT_GEN_MEMBER(cpu0_interrupt);
+ INTERRUPT_GEN_MEMBER(cpu1_interrupt);
TIMER_CALLBACK_MEMBER(main_to_sub_comm_sync_w);
+
+ UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
void draw_objects(int y, UINT8 *objdata);
int collision_check(bitmap_ind16 &bitmap, int which );
void draw_fog(bitmap_ind16 &bitmap, const rectangle &cliprect, int fog);
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
- required_device<cpu_device> m_maincpu;
- required_device<cpu_device> m_audiocpu;
- required_device<cpu_device> m_subcpu;
- required_device<discrete_device> m_discrete;
- required_device<gfxdecode_device> m_gfxdecode;
- required_device<palette_device> m_palette;
- required_device<screen_device> m_screen;
};
/* Discrete Sound Input Nodes */
diff --git a/src/mame/includes/groundfx.h b/src/mame/includes/groundfx.h
index 845c8982b67..16c122c2116 100644
--- a/src/mame/includes/groundfx.h
+++ b/src/mame/includes/groundfx.h
@@ -1,9 +1,9 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Bryan McPhail, David Graves
#include "video/tc0100scn.h"
#include "video/tc0480scp.h"
-struct tempsprite
+struct gfx_tempsprite
{
int gfx;
int code,color;
@@ -43,7 +43,7 @@ public:
UINT16 m_coin_word;
UINT16 m_frame_counter;
UINT16 m_port_sel;
- struct tempsprite *m_spritelist;
+ struct gfx_tempsprite *m_spritelist;
UINT16 m_rotate_ctrl[8];
rectangle m_hack_cliprect;
diff --git a/src/mame/includes/gstriker.h b/src/mame/includes/gstriker.h
index 3465b4c4579..8f894dd3365 100644
--- a/src/mame/includes/gstriker.h
+++ b/src/mame/includes/gstriker.h
@@ -14,69 +14,66 @@ class gstriker_state : public driver_device
public:
gstriker_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
- m_CG10103_m_vram(*this, "cg10103_m_vram"),
- m_work_ram(*this, "work_ram"),
+ m_maincpu(*this, "maincpu"),
+ m_audiocpu(*this, "audiocpu"),
m_spr(*this, "vsystem_spr"),
m_bg(*this, "zoomtilemap"),
m_tx(*this, "texttilemap"),
- m_maincpu(*this, "maincpu"),
- m_audiocpu(*this, "audiocpu"),
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
m_palette(*this, "palette"),
+ m_CG10103_m_vram(*this, "cg10103_m_vram"),
+ m_work_ram(*this, "work_ram"),
m_mixerregs1(*this, "mixerregs1"),
m_mixerregs2(*this, "mixerregs2")
{ }
- virtual void machine_start()
- {
- }
-
- required_shared_ptr<UINT16> m_CG10103_m_vram;
- required_shared_ptr<UINT16> m_work_ram;
+ required_device<cpu_device> m_maincpu;
+ required_device<cpu_device> m_audiocpu;
required_device<vsystem_spr_device> m_spr;
required_device<mb60553_zooming_tilemap_device> m_bg;
required_device<vs920a_text_tilemap_device> m_tx;
+ required_device<gfxdecode_device> m_gfxdecode;
+ required_device<screen_device> m_screen;
+ required_device<palette_device> m_palette;
+
+ required_shared_ptr<UINT16> m_CG10103_m_vram;
+ required_shared_ptr<UINT16> m_work_ram;
+ required_shared_ptr<UINT16> m_mixerregs1;
+ required_shared_ptr<UINT16> m_mixerregs2;
UINT16 m_dmmy_8f_ret;
int m_pending_command;
-
int m_gametype;
UINT16 m_mcu_data;
UINT16 m_prot_reg[2];
-
+ // common
DECLARE_READ16_MEMBER(dmmy_8f);
DECLARE_WRITE16_MEMBER(sound_command_w);
DECLARE_READ16_MEMBER(pending_command_r);
- DECLARE_WRITE8_MEMBER(gs_sh_pending_command_clear_w);
- DECLARE_WRITE8_MEMBER(gs_sh_bankswitch_w);
+ DECLARE_WRITE8_MEMBER(sh_pending_command_clear_w);
+ DECLARE_WRITE8_MEMBER(sh_bankswitch_w);
+
+ // vgoalsoc and twrldc
DECLARE_WRITE16_MEMBER(twrldc94_mcu_w);
DECLARE_READ16_MEMBER(twrldc94_mcu_r);
DECLARE_WRITE16_MEMBER(twrldc94_prot_reg_w);
DECLARE_READ16_MEMBER(twrldc94_prot_reg_r);
+
+ // vgoalsoc only
DECLARE_READ16_MEMBER(vbl_toggle_r);
DECLARE_WRITE16_MEMBER(vbl_toggle_w);
-
+ virtual void machine_start();
+ virtual void video_start();
DECLARE_DRIVER_INIT(twrldc94a);
DECLARE_DRIVER_INIT(vgoalsoc);
DECLARE_DRIVER_INIT(twrldc94);
- DECLARE_VIDEO_START(gstriker);
-
- UINT32 screen_update_gstriker(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
-
- void mcu_init( );
- DECLARE_WRITE_LINE_MEMBER(gs_ym2610_irq);
- required_device<cpu_device> m_maincpu;
- required_device<cpu_device> m_audiocpu;
- required_device<gfxdecode_device> m_gfxdecode;
- required_device<screen_device> m_screen;
- required_device<palette_device> m_palette;
- required_shared_ptr<UINT16> m_mixerregs1;
- required_shared_ptr<UINT16> m_mixerregs2;
+ void mcu_init();
};
#endif
diff --git a/src/mame/includes/gunbustr.h b/src/mame/includes/gunbustr.h
index 8e3f15bfe0c..3a258082ba7 100644
--- a/src/mame/includes/gunbustr.h
+++ b/src/mame/includes/gunbustr.h
@@ -1,9 +1,9 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Bryan McPhail, David Graves
#include "machine/eepromser.h"
#include "video/tc0480scp.h"
-struct tempsprite
+struct gb_tempsprite
{
int gfx;
int code,color;
@@ -44,7 +44,7 @@ public:
bool m_coin_lockout;
UINT16 m_coin_word;
- struct tempsprite *m_spritelist;
+ struct gb_tempsprite *m_spritelist;
UINT32 m_mem[2];
DECLARE_WRITE32_MEMBER(gunbustr_input_w);
diff --git a/src/mame/includes/hexion.h b/src/mame/includes/hexion.h
index 17ac18e42f2..7e1dec0ed85 100644
--- a/src/mame/includes/hexion.h
+++ b/src/mame/includes/hexion.h
@@ -15,6 +15,7 @@ public:
required_device<cpu_device> m_maincpu;
required_device<k053252_device> m_k053252;
required_device<gfxdecode_device> m_gfxdecode;
+
UINT8 *m_vram[2];
UINT8 *m_unkram;
int m_bankctrl;
@@ -22,18 +23,23 @@ public:
int m_pmcbank;
int m_gfxrom_select;
tilemap_t *m_bg_tilemap[2];
+
DECLARE_WRITE8_MEMBER(coincntr_w);
- DECLARE_WRITE8_MEMBER(hexion_bankswitch_w);
- DECLARE_READ8_MEMBER(hexion_bankedram_r);
- DECLARE_WRITE8_MEMBER(hexion_bankedram_w);
- DECLARE_WRITE8_MEMBER(hexion_bankctrl_w);
- DECLARE_WRITE8_MEMBER(hexion_gfxrom_select_w);
- DECLARE_WRITE_LINE_MEMBER(hexion_irq_ack_w);
- DECLARE_WRITE_LINE_MEMBER(hexion_nmi_ack_w);
+ DECLARE_WRITE8_MEMBER(bankswitch_w);
+ DECLARE_READ8_MEMBER(bankedram_r);
+ DECLARE_WRITE8_MEMBER(bankedram_w);
+ DECLARE_WRITE8_MEMBER(bankctrl_w);
+ DECLARE_WRITE8_MEMBER(gfxrom_select_w);
+ DECLARE_WRITE_LINE_MEMBER(irq_ack_w);
+ DECLARE_WRITE_LINE_MEMBER(nmi_ack_w);
+
TILE_GET_INFO_MEMBER(get_tile_info0);
TILE_GET_INFO_MEMBER(get_tile_info1);
+
+ TIMER_DEVICE_CALLBACK_MEMBER(scanline);
+
virtual void video_start();
- UINT32 screen_update_hexion(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- TIMER_DEVICE_CALLBACK_MEMBER(hexion_scanline);
+
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
inline void get_tile_info(tile_data &tileinfo,int tile_index,UINT8 *ram);
};
diff --git a/src/mame/includes/itech8.h b/src/mame/includes/itech8.h
index 7369ae79673..efa9d1426df 100644
--- a/src/mame/includes/itech8.h
+++ b/src/mame/includes/itech8.h
@@ -22,18 +22,28 @@ public:
m_subcpu(*this, "sub"),
m_tms34061(*this, "tms34061"),
m_tlc34076(*this, "tlc34076"),
- m_visarea(0, 0, 0, 0),
- m_screen(*this, "screen") { }
+ m_screen(*this, "screen"),
+ m_visarea(0, 0, 0, 0) { }
+
+ enum
+ {
+ TIMER_IRQ_OFF,
+ TIMER_BEHIND_BEAM_UPDATE,
+ TIMER_DELAYED_SOUND_DATA,
+ TIMER_BLITTER_DONE,
+ TIMER_DELAYED_Z80_CONTROL
+ };
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_soundcpu;
optional_device<cpu_device> m_subcpu;
required_device<tms34061_device> m_tms34061;
required_device<tlc34076_device> m_tlc34076;
- rectangle m_visarea;
required_device<screen_device> m_screen;
- UINT8 m_grom_bank;
+
+ rectangle m_visarea;
+ UINT8 m_grom_bank;
UINT8 m_blitter_int;
UINT8 m_tms34061_int;
UINT8 m_periodic_int;
@@ -63,15 +73,21 @@ public:
UINT8 m_fetch_rle_count;
UINT8 m_fetch_rle_value;
UINT8 m_fetch_rle_literal;
- struct tms34061_display m_tms_state;
UINT8 *m_grom_base;
UINT32 m_grom_size;
UINT8 m_grmatch_palcontrol;
UINT8 m_grmatch_xscroll;
rgb_t m_grmatch_palette[2][16];
+ emu_timer *m_irq_off_timer;
+ emu_timer *m_behind_beam_update_timer;
+ emu_timer *m_delayed_sound_data_timer;
+ emu_timer *m_blitter_done_timer;
+ emu_timer *m_delayed_z80_control_timer;
+
+ // common
DECLARE_WRITE_LINE_MEMBER(generate_tms34061_interrupt);
- DECLARE_WRITE8_MEMBER(itech8_nmi_ack_w);
- DECLARE_WRITE8_MEMBER(blitter_w);
+ DECLARE_WRITE8_MEMBER(nmi_ack_w);
+ DECLARE_WRITE8_MEMBER(blitter_bank_w);
DECLARE_WRITE8_MEMBER(rimrockn_bank_w);
DECLARE_WRITE8_MEMBER(pia_portb_out);
DECLARE_WRITE8_MEMBER(sound_data_w);
@@ -81,18 +97,20 @@ public:
DECLARE_WRITE16_MEMBER(grom_bank16_w);
DECLARE_WRITE16_MEMBER(display_page16_w);
DECLARE_WRITE16_MEMBER(palette16_w);
- DECLARE_WRITE8_MEMBER(itech8_palette_w);
- DECLARE_WRITE8_MEMBER(itech8_page_w);
- DECLARE_READ8_MEMBER(itech8_blitter_r);
- DECLARE_WRITE8_MEMBER(itech8_blitter_w);
- DECLARE_WRITE8_MEMBER(itech8_tms34061_w);
- DECLARE_READ8_MEMBER(itech8_tms34061_r);
+ DECLARE_WRITE8_MEMBER(palette_w);
+ DECLARE_WRITE8_MEMBER(page_w);
+ DECLARE_READ8_MEMBER(blitter_r);
+ DECLARE_WRITE8_MEMBER(blitter_w);
+ DECLARE_WRITE8_MEMBER(tms34061_w);
+ DECLARE_READ8_MEMBER(tms34061_r);
DECLARE_WRITE8_MEMBER(grmatch_palette_w);
DECLARE_WRITE8_MEMBER(grmatch_xscroll_w);
- DECLARE_CUSTOM_INPUT_MEMBER(special_r);
- DECLARE_CUSTOM_INPUT_MEMBER(gtg_mux);
DECLARE_WRITE8_MEMBER(pia_porta_out);
DECLARE_WRITE8_MEMBER(ym2203_portb_out);
+
+ DECLARE_CUSTOM_INPUT_MEMBER(special_r);
+ DECLARE_CUSTOM_INPUT_MEMBER(gtg_mux);
+
DECLARE_DRIVER_INIT(rimrockn);
DECLARE_DRIVER_INIT(grmatch);
DECLARE_DRIVER_INIT(peggle);
@@ -101,27 +119,31 @@ public:
DECLARE_DRIVER_INIT(arligntn);
DECLARE_DRIVER_INIT(hstennis);
DECLARE_DRIVER_INIT(sstrike);
+ virtual void machine_start();
virtual void machine_reset();
virtual void video_start();
DECLARE_VIDEO_START(slikshot);
DECLARE_MACHINE_START(sstrike);
- UINT32 screen_update_itech8_2layer(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
- UINT32 screen_update_itech8_grmatch(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
+
+ UINT32 screen_update_2layer(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
+ UINT32 screen_update_grmatch(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
UINT32 screen_update_slikshot(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
- UINT32 screen_update_itech8_2page(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
- UINT32 screen_update_itech8_2page_large(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
+ UINT32 screen_update_2page(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
+ UINT32 screen_update_2page_large(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
+
INTERRUPT_GEN_MEMBER(generate_nmi);
TIMER_CALLBACK_MEMBER(irq_off);
TIMER_CALLBACK_MEMBER(behind_the_beam_update);
TIMER_CALLBACK_MEMBER(delayed_sound_data_w);
TIMER_CALLBACK_MEMBER(blitter_done);
TIMER_DEVICE_CALLBACK_MEMBER(grmatch_palette_update);
+
inline UINT8 fetch_next_raw();
inline void consume_raw(int count);
inline UINT8 fetch_next_rle();
inline void consume_rle(int count);
void perform_blit(address_space &space);
- void itech8_update_interrupts(int periodic, int tms34061, int blitter);
+ void update_interrupts(int periodic, int tms34061, int blitter);
/*----------- defined in machine/slikshot.c -----------*/
@@ -143,4 +165,7 @@ public:
UINT16 *sens0, UINT16 *sens1, UINT16 *sens2, UINT16 *sens3);
void compute_sensors();
TIMER_CALLBACK_MEMBER( delayed_z80_control_w );
+
+protected:
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
};
diff --git a/src/mame/includes/jack.h b/src/mame/includes/jack.h
index 968eec9b8df..c108a89eaef 100644
--- a/src/mame/includes/jack.h
+++ b/src/mame/includes/jack.h
@@ -18,7 +18,8 @@ public:
m_videoram(*this, "videoram"),
m_colorram(*this, "colorram"),
m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette")
+ m_palette(*this, "palette"),
+ m_decrypted_opcodes(*this, "decrypted_opcodes")
{ }
/* device- and memory pointers */
@@ -30,6 +31,7 @@ public:
required_shared_ptr<UINT8> m_colorram;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
+ optional_shared_ptr<UINT8> m_decrypted_opcodes;
/* video-related */
tilemap_t *m_bg_tilemap;
diff --git a/src/mame/includes/kchamp.h b/src/mame/includes/kchamp.h
index 6ef9a7ddb13..6e44d71bc80 100644
--- a/src/mame/includes/kchamp.h
+++ b/src/mame/includes/kchamp.h
@@ -19,7 +19,8 @@ public:
m_maincpu(*this, "maincpu"),
m_msm(*this, "msm"),
m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_decrypted_opcodes(*this, "decrypted_opcodes") { }
/* memory pointers */
required_shared_ptr<UINT8> m_videoram;
@@ -62,10 +63,11 @@ public:
INTERRUPT_GEN_MEMBER(sound_int);
void kchamp_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect );
void kchampvs_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect );
- UINT8 *decrypt_code();
+ void decrypt_code();
DECLARE_WRITE_LINE_MEMBER(msmint);
required_device<cpu_device> m_maincpu;
optional_device<msm5205_device> m_msm;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
+ optional_shared_ptr<UINT8> m_decrypted_opcodes;
};
diff --git a/src/mame/includes/ladybug.h b/src/mame/includes/ladybug.h
index bd78dd7e0e9..8b7308edf5c 100644
--- a/src/mame/includes/ladybug.h
+++ b/src/mame/includes/ladybug.h
@@ -19,7 +19,11 @@ public:
m_grid_data(*this, "grid_data"),
m_maincpu(*this, "maincpu"),
m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_port_dsw0(*this, "DSW0"),
+ m_p1_control(*this, "CONTP1"),
+ m_p2_control(*this, "CONTP2"),
+ m_decrypted_opcodes(*this, "decrypted_opcodes") { }
/* memory pointers */
required_shared_ptr<UINT8> m_videoram;
@@ -51,6 +55,10 @@ public:
required_device<cpu_device> m_maincpu;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
+ optional_ioport m_port_dsw0;
+ optional_ioport m_p1_control;
+ optional_ioport m_p2_control;
+ optional_shared_ptr<UINT8> m_decrypted_opcodes;
DECLARE_READ8_MEMBER(sraider_sound_low_r);
DECLARE_READ8_MEMBER(sraider_sound_high_r);
diff --git a/src/mame/includes/legionna.h b/src/mame/includes/legionna.h
index 5b6cca2b169..ed64c30b16c 100644
--- a/src/mame/includes/legionna.h
+++ b/src/mame/includes/legionna.h
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:David Graves, Angelo Salese, David Haywood, Tomasz Slanina
#include "sound/okim6295.h"
#include "audio/seibu.h"
diff --git a/src/mame/includes/liberate.h b/src/mame/includes/liberate.h
index 487792089b0..442c5ca5b70 100644
--- a/src/mame/includes/liberate.h
+++ b/src/mame/includes/liberate.h
@@ -14,7 +14,8 @@ public:
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_decrypted_opcodes(*this, "decrypted_opcodes") { }
optional_shared_ptr<UINT8> m_paletteram;
optional_shared_ptr<UINT8> m_bg_vram; /* prosport */
@@ -40,6 +41,7 @@ public:
required_device<cpu_device> m_audiocpu;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
+ optional_shared_ptr<UINT8> m_decrypted_opcodes;
DECLARE_READ8_MEMBER(deco16_bank_r);
DECLARE_READ8_MEMBER(deco16_io_r);
diff --git a/src/mame/includes/m62.h b/src/mame/includes/m62.h
index 9a508876b61..5b48f4bfaef 100644
--- a/src/mame/includes/m62.h
+++ b/src/mame/includes/m62.h
@@ -1,5 +1,8 @@
// license:BSD-3-Clause
// copyright-holders:smf, David Haywood
+
+#include "audio/irem.h"
+
class m62_state : public driver_device
{
public:
@@ -11,7 +14,9 @@ public:
m_scrollram(*this, "scrollram"),
m_maincpu(*this, "maincpu"),
m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_audio(*this, "irem_audio")
+ { }
/* memory pointers */
required_shared_ptr<UINT8> m_spriteram;
@@ -119,4 +124,5 @@ public:
required_device<cpu_device> m_maincpu;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
+ required_device<irem_audio_device> m_audio;
};
diff --git a/src/mame/includes/megasys1.h b/src/mame/includes/megasys1.h
index a86bf170484..869ff11f182 100644
--- a/src/mame/includes/megasys1.h
+++ b/src/mame/includes/megasys1.h
@@ -126,6 +126,8 @@ public:
DECLARE_DRIVER_INIT(iganinju);
DECLARE_DRIVER_INIT(cybattlr);
DECLARE_DRIVER_INIT(rodlandj);
+ DECLARE_DRIVER_INIT(rittam);
+ DECLARE_DRIVER_INIT(rodlandjb);
DECLARE_DRIVER_INIT(avspirit);
DECLARE_DRIVER_INIT(monkelf);
DECLARE_DRIVER_INIT(edf);
@@ -150,7 +152,7 @@ public:
void create_tilemaps();
void megasys1_priority_create();
void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap,const rectangle &cliprect);
- void rodlandj_gfx_unmangle(const char *region);
+ void rodland_gfx_unmangle(const char *region);
void jitsupro_gfx_unmangle(const char *region);
void stdragona_gfx_unmangle(const char *region);
DECLARE_WRITE_LINE_MEMBER(irqhandler);
diff --git a/src/mame/includes/micro3d.h b/src/mame/includes/micro3d.h
index e4fe37b871c..01b9a52dfea 100644
--- a/src/mame/includes/micro3d.h
+++ b/src/mame/includes/micro3d.h
@@ -29,9 +29,17 @@ enum planes
CLIP_X_MIN,
CLIP_X_MAX,
CLIP_Y_MIN,
- CLIP_Y_MAX,
+ CLIP_Y_MAX
};
+enum dac_registers {
+ VCF,
+ VCQ,
+ VCA,
+ PAN
+};
+
+
class micro3d_state : public driver_device
{
public:
@@ -196,7 +204,7 @@ struct lp_filter
biquad ProtoCoef[2];
};
-struct filter_state
+struct m3d_filter_state
{
double capval;
double exponent;
@@ -221,24 +229,24 @@ protected:
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
private:
// internal state
- union
- {
- struct
- {
- UINT8 m_vcf;
- UINT8 m_vcq;
- UINT8 m_vca;
- UINT8 m_pan;
- };
+// union
+// {
+// struct
+// {
+// UINT8 m_vcf;
+// UINT8 m_vcq;
+// UINT8 m_vca;
+// UINT8 m_pan;
+// };
UINT8 m_dac[4];
- };
+// };
float m_gain;
UINT32 m_noise_shift;
UINT8 m_noise_value;
UINT8 m_noise_subcount;
- filter_state m_noise_filters[4];
+ m3d_filter_state m_noise_filters[4];
lp_filter m_filter;
sound_stream *m_stream;
};
diff --git a/src/mame/includes/mitchell.h b/src/mame/includes/mitchell.h
index 497c50460d5..9f27109fc78 100644
--- a/src/mame/includes/mitchell.h
+++ b/src/mame/includes/mitchell.h
@@ -25,7 +25,10 @@ public:
m_eeprom(*this, "eeprom"),
m_msm(*this, "msm"),
m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette"){ }
+ m_palette(*this, "palette"),
+ m_bank1(*this, "bank1"),
+ m_bank0d(*this, "bank0d"),
+ m_bank1d(*this, "bank1d") { }
/* devices */
required_device<cpu_device> m_maincpu;
@@ -40,6 +43,9 @@ public:
optional_device<msm5205_device> m_msm;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
+ required_memory_bank m_bank1;
+ optional_memory_bank m_bank0d;
+ optional_memory_bank m_bank1d;
/* video-related */
tilemap_t *m_bg_tilemap;
@@ -117,7 +123,7 @@ public:
UINT32 screen_update_pang(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(mitchell_irq);
void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect );
- void bootleg_decode( );
- void configure_banks( );
+ void bootleg_decode();
+ void configure_banks(void (*decode)(UINT8 *src, UINT8 *dst, int size));
DECLARE_WRITE_LINE_MEMBER(spangbl_adpcm_int);
};
diff --git a/src/mame/includes/model1.h b/src/mame/includes/model1.h
index 86bb9679847..dce16b83fe1 100644
--- a/src/mame/includes/model1.h
+++ b/src/mame/includes/model1.h
@@ -2,6 +2,7 @@
// copyright-holders:Olivier Galibert
#include "audio/dsbz80.h"
#include "audio/segam1audio.h"
+#include "machine/m1comm.h"
#include "cpu/v60/v60.h"
#define DECLARE_TGP_FUNCTION(name) void name()
@@ -16,6 +17,7 @@ public:
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_m1audio(*this, "m1audio"),
+ m_m1comm(*this, "m1comm"),
m_dsbz80(*this, DSBZ80_TAG),
m_tgp(*this, "tgp"),
m_screen(*this, "screen"),
@@ -29,6 +31,7 @@ public:
required_device<v60_device> m_maincpu; // V60
required_device<segam1audio_device> m_m1audio; // Model 1 standard sound board
+ optional_device<m1comm_device> m_m1comm; // Model 1 communication board
optional_device<dsbz80_device> m_dsbz80; // Digital Sound Board
optional_device<mb86233_cpu_device> m_tgp;
required_device<screen_device> m_screen;
diff --git a/src/mame/includes/model3.h b/src/mame/includes/model3.h
index 096691a831a..f2b63678309 100644
--- a/src/mame/includes/model3.h
+++ b/src/mame/includes/model3.h
@@ -22,14 +22,6 @@ struct cached_texture
rgb_t data[1];
};
-struct m3_plane
-{
- float x;
- float y;
- float z;
- float d;
-};
-
struct m3_vertex
{
float x;
@@ -47,9 +39,11 @@ struct m3_clip_vertex
float x;
float y;
float z;
+ float w;
float u;
float v;
float i;
+ float s;
};
struct m3_triangle
@@ -149,7 +143,7 @@ public:
UINT8 m_id_data[32];
INT32 m_id_size;
int m_tdo;
- UINT8 m_layer_priority;
+ UINT16 m_layer_priority;
UINT32 m_layer_modulate_r;
UINT32 m_layer_modulate_g;
UINT32 m_layer_modulate_b;
@@ -175,12 +169,13 @@ public:
int m_list_depth;
MATRIX *m_matrix_stack;
MATRIX m_coordinate_system;
- float m_viewport_focal_length;
- int m_viewport_region_x;
- int m_viewport_region_y;
- int m_viewport_region_width;
- int m_viewport_region_height;
- m3_plane m_clip_plane[5];
+ MATRIX m_projection_matrix;
+ float m_viewport_x;
+ float m_viewport_y;
+ float m_viewport_width;
+ float m_viewport_height;
+ float m_viewport_near;
+ float m_viewport_far;
UINT32 m_matrix_base_address;
cached_texture *m_texcache[2][1024/32][2048/32];
@@ -249,6 +244,7 @@ public:
DECLARE_DRIVER_INIT(daytona2);
DECLARE_DRIVER_INIT(eca);
DECLARE_DRIVER_INIT(srally2);
+ DECLARE_DRIVER_INIT(harleya);
DECLARE_DRIVER_INIT(skichamp);
DECLARE_DRIVER_INIT(spikeofe);
DECLARE_DRIVER_INIT(scud);
@@ -302,11 +298,12 @@ public:
void reset_triangle_buffers();
m3_triangle* push_triangle(bool alpha);
void draw_layers(bitmap_rgb32 &bitmap, const rectangle &cliprect);
- void draw_layer(bitmap_rgb32 &bitmap, const rectangle &cliprect, int layer, int bitdepth, int sx, int sy);
+ void draw_layer(bitmap_rgb32 &bitmap, const rectangle &cliprect, int layer, int sx, int sy, int prio);
void draw_3d_layer(bitmap_rgb32 &bitmap, const rectangle &cliprect);
void invalidate_texture(int page, int texx, int texy, int texwidth, int texheight);
cached_texture *get_texture(int page, int texx, int texy, int texwidth, int texheight, int format);
inline void write_texture16(int xpos, int ypos, int width, int height, int page, UINT16 *data);
+ inline void write_texture8(int xpos, int ypos, int width, int height, int page, int upper, int lower, UINT16 *data);
void real3d_upload_texture(UINT32 header, UINT32 *data);
void init_matrix_stack();
void get_top_matrix(MATRIX *out);
@@ -316,6 +313,7 @@ public:
void translate_matrix_stack(float x, float y, float z);
void draw_model(UINT32 addr);
UINT32 *get_memory_pointer(UINT32 address);
+ void set_projection(float left, float right, float top, float bottom, float near, float far);
void load_matrix(int matrix_num, MATRIX *out);
void traverse_list4(int lod_num, UINT32 address);
void traverse_list(UINT32 address);
diff --git a/src/mame/includes/mouser.h b/src/mame/includes/mouser.h
index 4b103f80d22..3fb99eb8877 100644
--- a/src/mame/includes/mouser.h
+++ b/src/mame/includes/mouser.h
@@ -17,7 +17,8 @@ public:
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_decrypted_opcodes(*this, "decrypted_opcodes") { }
/* memory pointers */
required_shared_ptr<UINT8> m_videoram;
@@ -33,6 +34,7 @@ public:
required_device<cpu_device> m_audiocpu;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
+ optional_shared_ptr<UINT8> m_decrypted_opcodes;
DECLARE_WRITE8_MEMBER(mouser_nmi_enable_w);
DECLARE_WRITE8_MEMBER(mouser_sound_interrupt_w);
diff --git a/src/mame/includes/mustache.h b/src/mame/includes/mustache.h
index 0e89e93c77a..df464eadbac 100644
--- a/src/mame/includes/mustache.h
+++ b/src/mame/includes/mustache.h
@@ -8,21 +8,21 @@ public:
mustache_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
- m_cpu_decrypt(*this, "seibu_sound"),
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
m_palette(*this, "palette"),
m_videoram(*this, "videoram"),
- m_spriteram(*this, "spriteram") { }
+ m_spriteram(*this, "spriteram"),
+ m_decrypted_opcodes(*this, "decrypted_opcodes") { }
required_device<cpu_device> m_maincpu;
- required_device<seibu_sound_device> m_cpu_decrypt;
required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
required_shared_ptr<UINT8> m_videoram;
required_shared_ptr<UINT8> m_spriteram;
+ required_shared_ptr<UINT8> m_decrypted_opcodes;
tilemap_t *m_bg_tilemap;
int m_control_byte;
diff --git a/src/mame/includes/namcos1.h b/src/mame/includes/namcos1.h
index bd7b320bdb8..8a5296ca76f 100644
--- a/src/mame/includes/namcos1.h
+++ b/src/mame/includes/namcos1.h
@@ -68,9 +68,6 @@ public:
int m_copy_sprites;
UINT8 m_drawmode_table[16];
- DECLARE_DIRECT_UPDATE_MEMBER(direct_handler_main);
- DECLARE_DIRECT_UPDATE_MEMBER(direct_handler_sub);
-
DECLARE_WRITE_LINE_MEMBER(subres_w);
DECLARE_WRITE8_MEMBER(irq_ack_w);
DECLARE_READ8_MEMBER(dsw_r);
@@ -138,6 +135,5 @@ public:
void init_DACs();
private:
- inline offs_t direct_handler(int whichcpu, direct_read_data &direct, offs_t address);
inline void get_tile_info(tile_data &tileinfo,int tile_index,UINT8 *info_vram);
};
diff --git a/src/mame/includes/namcos22.h b/src/mame/includes/namcos22.h
index 5534a95dcf7..61a0830fa96 100644
--- a/src/mame/includes/namcos22.h
+++ b/src/mame/includes/namcos22.h
@@ -93,9 +93,9 @@ struct namcos22_scenenode
struct namcos22_object_data
{
/* poly / sprites */
- rgbint fogcolor;
- rgbint fadecolor;
- rgbint polycolor;
+ rgbaint_t fogcolor;
+ rgbaint_t fadecolor;
+ rgbaint_t polycolor;
const pen_t *pens;
bitmap_rgb32 *destbase;
bitmap_ind8 *primap;
diff --git a/src/mame/includes/namcos86.h b/src/mame/includes/namcos86.h
index eb114022533..3915293b9f4 100644
--- a/src/mame/includes/namcos86.h
+++ b/src/mame/includes/namcos86.h
@@ -7,25 +7,26 @@ class namcos86_state : public driver_device
public:
namcos86_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
- m_rthunder_videoram1(*this, "videoram1"),
- m_rthunder_videoram2(*this, "videoram2"),
- m_rthunder_spriteram(*this, "spriteram"),
m_cpu1(*this, "cpu1"),
m_cpu2(*this, "cpu2"),
m_cus30(*this, "namco"),
m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_rthunder_videoram1(*this, "videoram1"),
+ m_rthunder_videoram2(*this, "videoram2"),
+ m_rthunder_spriteram(*this, "spriteram") { }
- UINT8 *m_spriteram;
- int m_wdog;
- required_shared_ptr<UINT8> m_rthunder_videoram1;
- required_shared_ptr<UINT8> m_rthunder_videoram2;
- required_shared_ptr<UINT8> m_rthunder_spriteram;
required_device<cpu_device> m_cpu1;
required_device<cpu_device> m_cpu2;
required_device<namco_cus30_device> m_cus30;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
+ required_shared_ptr<UINT8> m_rthunder_videoram1;
+ required_shared_ptr<UINT8> m_rthunder_videoram2;
+ required_shared_ptr<UINT8> m_rthunder_spriteram;
+
+ UINT8 *m_spriteram;
+ int m_wdog;
int m_tilebank;
int m_xscroll[4];
int m_yscroll[4];
@@ -33,6 +34,7 @@ public:
int m_backcolor;
const UINT8 *m_tile_address_prom;
int m_copy_sprites;
+
DECLARE_WRITE8_MEMBER(bankswitch1_w);
DECLARE_WRITE8_MEMBER(bankswitch1_ext_w);
DECLARE_WRITE8_MEMBER(bankswitch2_w);
@@ -42,32 +44,34 @@ public:
DECLARE_WRITE8_MEMBER(int_ack2_w);
DECLARE_WRITE8_MEMBER(watchdog1_w);
DECLARE_WRITE8_MEMBER(watchdog2_w);
- DECLARE_WRITE8_MEMBER(namcos86_coin_w);
- DECLARE_WRITE8_MEMBER(namcos86_led_w);
+ DECLARE_WRITE8_MEMBER(coin_w);
+ DECLARE_WRITE8_MEMBER(led_w);
DECLARE_WRITE8_MEMBER(cus115_w);
DECLARE_READ8_MEMBER(readFF);
- DECLARE_READ8_MEMBER(rthunder_videoram1_r);
- DECLARE_WRITE8_MEMBER(rthunder_videoram1_w);
- DECLARE_READ8_MEMBER(rthunder_videoram2_r);
- DECLARE_WRITE8_MEMBER(rthunder_videoram2_w);
- DECLARE_WRITE8_MEMBER(rthunder_tilebank_select_w);
- DECLARE_WRITE8_MEMBER(rthunder_scroll0_w);
- DECLARE_WRITE8_MEMBER(rthunder_scroll1_w);
- DECLARE_WRITE8_MEMBER(rthunder_scroll2_w);
- DECLARE_WRITE8_MEMBER(rthunder_scroll3_w);
- DECLARE_WRITE8_MEMBER(rthunder_backcolor_w);
- DECLARE_READ8_MEMBER(rthunder_spriteram_r);
- DECLARE_WRITE8_MEMBER(rthunder_spriteram_w);
- DECLARE_DRIVER_INIT(namco86);
+ DECLARE_WRITE8_MEMBER(videoram1_w);
+ DECLARE_WRITE8_MEMBER(videoram2_w);
+ DECLARE_WRITE8_MEMBER(tilebank_select_w);
+ DECLARE_WRITE8_MEMBER(scroll0_w);
+ DECLARE_WRITE8_MEMBER(scroll1_w);
+ DECLARE_WRITE8_MEMBER(scroll2_w);
+ DECLARE_WRITE8_MEMBER(scroll3_w);
+ DECLARE_WRITE8_MEMBER(backcolor_w);
+ DECLARE_WRITE8_MEMBER(spriteram_w);
+
TILE_GET_INFO_MEMBER(get_tile_info0);
TILE_GET_INFO_MEMBER(get_tile_info1);
TILE_GET_INFO_MEMBER(get_tile_info2);
TILE_GET_INFO_MEMBER(get_tile_info3);
- virtual void machine_reset();
+
+ DECLARE_DRIVER_INIT(namco86);
+ virtual void machine_start();
virtual void video_start();
DECLARE_PALETTE_INIT(namcos86);
- UINT32 screen_update_namcos86(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- void screen_eof_namcos86(screen_device &screen, bool state);
+
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ void screen_eof(screen_device &screen, bool state);
+ void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ void scroll_w(address_space &space, int offset, int data, int layer);
private:
inline void get_tile_info(tile_data &tileinfo,int tile_index,int layer,UINT8 *vram);
diff --git a/src/mame/includes/naomi.h b/src/mame/includes/naomi.h
index f140feb2e16..3e1e6c80eb0 100644
--- a/src/mame/includes/naomi.h
+++ b/src/mame/includes/naomi.h
@@ -56,6 +56,7 @@ class naomi_state : public dc_state
DECLARE_WRITE_LINE_MEMBER(sh4_aica_irq);
DECLARE_MACHINE_RESET(naomi);
DECLARE_DRIVER_INIT(atomiswave);
+ DECLARE_DRIVER_INIT(xtrmhnt2);
DECLARE_DRIVER_INIT(naomigd);
DECLARE_DRIVER_INIT(ggxx);
DECLARE_DRIVER_INIT(ggxxrl);
@@ -104,6 +105,7 @@ class naomi_state : public dc_state
DECLARE_READ64_MEMBER( naomigd_ggxxrl_idle_skip_r );
DECLARE_READ64_MEMBER( naomigd_sfz3ugd_idle_skip_r );
DECLARE_READ64_MEMBER( hotd2_idle_skip_r );
+ DECLARE_READ64_MEMBER( xtrmhnt2_hack_r );
};
MACHINE_CONFIG_EXTERN(naomi_aw_base);
diff --git a/src/mame/includes/naughtyb.h b/src/mame/includes/naughtyb.h
index 42aa42b5f1c..f6af5f83363 100644
--- a/src/mame/includes/naughtyb.h
+++ b/src/mame/includes/naughtyb.h
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Brad Oliver,Sal and John Bugliarisi,Paul Priest
#include "audio/pleiads.h"
@@ -7,19 +7,16 @@ class naughtyb_state : public driver_device
public:
naughtyb_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
- m_videoram(*this, "videoram"),
- m_videoram2(*this, "videoram2"),
- m_scrollreg(*this, "scrollreg"),
m_maincpu(*this, "maincpu"),
m_naughtyb_custom(*this, "naughtyb_custom"),
m_popflame_custom(*this, "popflame_custom"),
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_videoram(*this, "videoram"),
+ m_videoram2(*this, "videoram2"),
+ m_scrollreg(*this, "scrollreg") { }
- required_shared_ptr<UINT8> m_videoram;
- required_shared_ptr<UINT8> m_videoram2;
- required_shared_ptr<UINT8> m_scrollreg;
required_device<cpu_device> m_maincpu;
optional_device<naughtyb_sound_device> m_naughtyb_custom;
optional_device<popflame_sound_device> m_popflame_custom;
@@ -27,6 +24,9 @@ public:
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
+ required_shared_ptr<UINT8> m_videoram;
+ required_shared_ptr<UINT8> m_videoram2;
+ required_shared_ptr<UINT8> m_scrollreg;
UINT8 m_popflame_prot_seed;
int m_r_index;
@@ -36,6 +36,7 @@ public:
UINT8 m_palreg;
int m_bankreg;
bitmap_ind16 m_tmpbitmap;
+
DECLARE_READ8_MEMBER(in0_port_r);
DECLARE_READ8_MEMBER(dsw0_port_r);
DECLARE_READ8_MEMBER(popflame_protection_r);
@@ -44,11 +45,13 @@ public:
DECLARE_WRITE8_MEMBER(trvmstr_questions_w);
DECLARE_WRITE8_MEMBER(naughtyb_videoreg_w);
DECLARE_WRITE8_MEMBER(popflame_videoreg_w);
+
DECLARE_INPUT_CHANGED_MEMBER(coin_inserted);
+
DECLARE_DRIVER_INIT(trvmstr);
DECLARE_DRIVER_INIT(popflame);
virtual void video_start();
DECLARE_PALETTE_INIT(naughtyb);
- UINT32 screen_update_naughtyb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
};
diff --git a/src/mame/includes/nbmj8991.h b/src/mame/includes/nbmj8991.h
index 580e171f66c..d5bfab76958 100644
--- a/src/mame/includes/nbmj8991.h
+++ b/src/mame/includes/nbmj8991.h
@@ -19,8 +19,14 @@ public:
required_device<nb1413m3_device> m_nb1413m3;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
+
required_shared_ptr<UINT8> m_generic_paletteram_8;
+ enum
+ {
+ TIMER_BLITTER
+ };
+
int m_scrollx;
int m_scrolly;
int m_blitter_destx;
@@ -39,26 +45,32 @@ public:
UINT8 *m_videoram;
UINT8 *m_clut;
int m_flipscreen_old;
- DECLARE_WRITE8_MEMBER(nbmj8991_soundbank_w);
- DECLARE_WRITE8_MEMBER(nbmj8991_sound_w);
- DECLARE_READ8_MEMBER(nbmj8991_sound_r);
- DECLARE_WRITE8_MEMBER(nbmj8991_palette_type1_w);
- DECLARE_WRITE8_MEMBER(nbmj8991_palette_type2_w);
- DECLARE_WRITE8_MEMBER(nbmj8991_palette_type3_w);
- DECLARE_WRITE8_MEMBER(nbmj8991_blitter_w);
- DECLARE_READ8_MEMBER(nbmj8991_clut_r);
- DECLARE_WRITE8_MEMBER(nbmj8991_clut_w);
+ emu_timer *m_blitter_timer;
+
+ DECLARE_WRITE8_MEMBER(soundbank_w);
+ DECLARE_WRITE8_MEMBER(palette_type1_w);
+ DECLARE_WRITE8_MEMBER(palette_type2_w);
+ DECLARE_WRITE8_MEMBER(palette_type3_w);
+ DECLARE_WRITE8_MEMBER(blitter_w);
+ DECLARE_READ8_MEMBER(clut_r);
+ DECLARE_WRITE8_MEMBER(clut_w);
DECLARE_CUSTOM_INPUT_MEMBER(nb1413m3_busyflag_r);
+
DECLARE_DRIVER_INIT(galkaika);
DECLARE_DRIVER_INIT(tokimbsj);
DECLARE_DRIVER_INIT(tokyogal);
DECLARE_DRIVER_INIT(finalbny);
virtual void machine_reset();
virtual void video_start();
- UINT32 screen_update_nbmj8991_type1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- UINT32 screen_update_nbmj8991_type2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- TIMER_CALLBACK_MEMBER(blitter_timer_callback);
- void nbmj8991_vramflip();
+
+ UINT32 screen_update_type1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ UINT32 screen_update_type2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ void vramflip();
void update_pixel(int x, int y);
- void nbmj8991_gfxdraw();
+ void gfxdraw();
+
+ void postload();
+
+protected:
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
};
diff --git a/src/mame/includes/nbmj9195.h b/src/mame/includes/nbmj9195.h
index 70380d2ab49..41be8fc1ad5 100644
--- a/src/mame/includes/nbmj9195.h
+++ b/src/mame/includes/nbmj9195.h
@@ -29,7 +29,8 @@ public:
m_dac1(*this, "dac1"),
m_dac2(*this, "dac2"),
m_screen(*this, "screen"),
- m_palette(*this, "palette")
+ m_palette(*this, "palette"),
+ m_palette_ptr(*this, "paletteram")
{ }
required_device<tmpz84c011_device> m_maincpu;
@@ -37,14 +38,13 @@ public:
required_device<dac_device> m_dac2;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
+
+ optional_shared_ptr<UINT8> m_palette_ptr; //shabdama doesn't use it at least for now
int m_inputport;
int m_dipswbitsel;
int m_outcoin_flag;
int m_mscoutm_inputport;
- UINT8 *m_nvram;
- size_t m_nvram_size;
-
int m_scrollx[VRAM_MAX];
int m_scrolly[VRAM_MAX];
int m_scrollx_raster[VRAM_MAX][SCANLINE_MAX];
@@ -69,67 +69,52 @@ public:
bitmap_ind16 m_tmpbitmap[VRAM_MAX];
UINT16 *m_videoram[VRAM_MAX];
UINT16 *m_videoworkram[VRAM_MAX];
- UINT8 *m_palette_ptr;
- UINT8 *m_nb22090_palette;
UINT8 *m_clut[VRAM_MAX];
int m_flipscreen_old[VRAM_MAX];
- DECLARE_WRITE8_MEMBER(nbmj9195_soundbank_w);
- DECLARE_READ8_MEMBER(nbmj9195_sound_r);
- DECLARE_WRITE8_MEMBER(nbmj9195_sound_w);
- DECLARE_WRITE8_MEMBER(nbmj9195_soundclr_w);
- DECLARE_WRITE8_MEMBER(nbmj9195_inputportsel_w);
+ emu_timer *m_blitter_timer;
+
+ DECLARE_WRITE8_MEMBER(soundbank_w);
+ DECLARE_WRITE8_MEMBER(inputportsel_w);
DECLARE_READ8_MEMBER(mscoutm_dipsw_0_r);
DECLARE_READ8_MEMBER(mscoutm_dipsw_1_r);
-
- DECLARE_READ8_MEMBER(mscoutm_cpu_porta_r);
DECLARE_READ8_MEMBER(mscoutm_cpu_portb_r);
DECLARE_READ8_MEMBER(mscoutm_cpu_portc_r);
- DECLARE_WRITE8_MEMBER(mscoutm_cpu_porta_w);
- DECLARE_WRITE8_MEMBER(mscoutm_cpu_portd_w);
- DECLARE_WRITE8_MEMBER(mscoutm_cpu_porte_w);
DECLARE_READ8_MEMBER(others_cpu_porta_r);
DECLARE_READ8_MEMBER(others_cpu_portb_r);
DECLARE_READ8_MEMBER(others_cpu_portc_r);
- DECLARE_WRITE8_MEMBER(others_cpu_portc_w);
- DECLARE_WRITE8_MEMBER(others_cpu_portd_w);
- DECLARE_WRITE8_MEMBER(others_cpu_porte_w);
- DECLARE_READ8_MEMBER(soundcpu_portd_r);
- DECLARE_WRITE8_MEMBER(soundcpu_porta_w);
- DECLARE_WRITE8_MEMBER(soundcpu_dac1_w);
- DECLARE_WRITE8_MEMBER(soundcpu_dac2_w);
- DECLARE_WRITE8_MEMBER(mscoutm_soundcpu_portb_w);
- DECLARE_WRITE8_MEMBER(mscoutm_soundcpu_portc_w);
DECLARE_WRITE8_MEMBER(soundcpu_porte_w);
+ DECLARE_WRITE8_MEMBER(palette_w);
+ DECLARE_WRITE8_MEMBER(nb22090_palette_w);
+ DECLARE_WRITE8_MEMBER(blitter_0_w);
+ DECLARE_WRITE8_MEMBER(blitter_1_w);
+ DECLARE_READ8_MEMBER(blitter_0_r);
+ DECLARE_READ8_MEMBER(blitter_1_r);
+ DECLARE_WRITE8_MEMBER(clut_0_w);
+ DECLARE_WRITE8_MEMBER(clut_1_w);
+ DECLARE_WRITE8_MEMBER(clutsel_w);
+ DECLARE_WRITE8_MEMBER(gfxflag2_w);
+ DECLARE_WRITE8_MEMBER(outcoin_flag_w);
+ DECLARE_WRITE8_MEMBER(dipswbitsel_w);
+ DECLARE_WRITE8_MEMBER(mscoutm_inputportsel_w);
- DECLARE_READ8_MEMBER(nbmj9195_palette_r);
- DECLARE_WRITE8_MEMBER(nbmj9195_palette_w);
- DECLARE_READ8_MEMBER(nbmj9195_nb22090_palette_r);
- DECLARE_WRITE8_MEMBER(nbmj9195_nb22090_palette_w);
- DECLARE_WRITE8_MEMBER(nbmj9195_blitter_0_w);
- DECLARE_WRITE8_MEMBER(nbmj9195_blitter_1_w);
- DECLARE_READ8_MEMBER(nbmj9195_blitter_0_r);
- DECLARE_READ8_MEMBER(nbmj9195_blitter_1_r);
- DECLARE_WRITE8_MEMBER(nbmj9195_clut_0_w);
- DECLARE_WRITE8_MEMBER(nbmj9195_clut_1_w);
DECLARE_DRIVER_INIT(nbmj9195);
+ virtual void machine_start();
virtual void machine_reset();
virtual void video_start();
- DECLARE_VIDEO_START(nbmj9195_1layer);
- DECLARE_VIDEO_START(nbmj9195_nb22090);
- UINT32 screen_update_nbmj9195(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ DECLARE_VIDEO_START(_1layer);
+ DECLARE_VIDEO_START(nb22090);
+
INTERRUPT_GEN_MEMBER(ctc0_trg1);
- int nbmj9195_blitter_r(int offset, int vram);
- void nbmj9195_blitter_w(int offset, int data, int vram);
- void nbmj9195_clutsel_w(int data);
- void nbmj9195_clut_w(int offset, int data, int vram);
- void nbmj9195_gfxflag2_w(int data);
- void nbmj9195_vramflip(int vram);
+
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ int blitter_r(int offset, int vram);
+ void blitter_w(int offset, int data, int vram);
+ void clut_w(int offset, int data, int vram);
+ void vramflip(int vram);
void update_pixel(int vram, int x, int y);
- void nbmj9195_gfxdraw(int vram);
- void nbmj9195_outcoin_flag_w(int data);
- int nbmj9195_dipsw_r();
- void nbmj9195_dipswbitsel_w(int data);
- void mscoutm_inputportsel_w(int data);
+ void gfxdraw(int vram);
+ int dipsw_r();
+ void postload();
protected:
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
diff --git a/src/mame/includes/ninjakd2.h b/src/mame/includes/ninjakd2.h
index ed38065f97a..b2d15ca1980 100644
--- a/src/mame/includes/ninjakd2.h
+++ b/src/mame/includes/ninjakd2.h
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Roberto Ventura, Leandro Dardini, Yochizo, Nicola Salmoria
/******************************************************************************
@@ -21,7 +21,8 @@ public:
m_spriteram(*this, "spriteram"),
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
- m_palette(*this, "palette")
+ m_palette(*this, "palette"),
+ m_decrypted_opcodes(*this, "decrypted_opcodes")
{ }
required_device<cpu_device> m_maincpu;
@@ -33,6 +34,7 @@ public:
required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
+ optional_shared_ptr<UINT8> m_decrypted_opcodes;
const INT16* m_sampledata;
UINT8 m_omegaf_io_protection[3];
diff --git a/src/mame/includes/ninjaw.h b/src/mame/includes/ninjaw.h
index 9c3ef61f0a5..6a2f2a50770 100644
--- a/src/mame/includes/ninjaw.h
+++ b/src/mame/includes/ninjaw.h
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:David Graves
/*************************************************************************
diff --git a/src/mame/includes/othunder.h b/src/mame/includes/othunder.h
index 3dc3e5ba4a9..3a7e3db10b4 100644
--- a/src/mame/includes/othunder.h
+++ b/src/mame/includes/othunder.h
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:David Graves
/*************************************************************************
diff --git a/src/mame/includes/pacland.h b/src/mame/includes/pacland.h
index 5222ed084d8..c19f153013a 100644
--- a/src/mame/includes/pacland.h
+++ b/src/mame/includes/pacland.h
@@ -7,19 +7,16 @@ class pacland_state : public driver_device
public:
pacland_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
- m_videoram(*this, "videoram"),
- m_videoram2(*this, "videoram2"),
- m_spriteram(*this, "spriteram"),
m_maincpu(*this, "maincpu"),
m_mcu(*this, "mcu"),
m_cus30(*this, "namco"),
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_videoram(*this, "videoram"),
+ m_videoram2(*this, "videoram2"),
+ m_spriteram(*this, "spriteram") { }
- required_shared_ptr<UINT8> m_videoram;
- required_shared_ptr<UINT8> m_videoram2;
- required_shared_ptr<UINT8> m_spriteram;
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_mcu;
required_device<namco_cus30_device> m_cus30;
@@ -27,6 +24,10 @@ public:
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
+ required_shared_ptr<UINT8> m_videoram;
+ required_shared_ptr<UINT8> m_videoram2;
+ required_shared_ptr<UINT8> m_spriteram;
+
UINT8 m_palette_bank;
const UINT8 *m_color_prom;
tilemap_t *m_bg_tilemap;
@@ -37,26 +38,32 @@ public:
UINT16 m_scroll1;
UINT8 m_main_irq_mask;
UINT8 m_mcu_irq_mask;
- DECLARE_WRITE8_MEMBER(pacland_subreset_w);
- DECLARE_WRITE8_MEMBER(pacland_flipscreen_w);
- DECLARE_READ8_MEMBER(pacland_input_r);
- DECLARE_WRITE8_MEMBER(pacland_coin_w);
- DECLARE_WRITE8_MEMBER(pacland_led_w);
- DECLARE_WRITE8_MEMBER(pacland_irq_1_ctrl_w);
- DECLARE_WRITE8_MEMBER(pacland_irq_2_ctrl_w);
+
+ DECLARE_WRITE8_MEMBER(subreset_w);
+ DECLARE_WRITE8_MEMBER(flipscreen_w);
+ DECLARE_READ8_MEMBER(input_r);
+ DECLARE_WRITE8_MEMBER(coin_w);
+ DECLARE_WRITE8_MEMBER(led_w);
+ DECLARE_WRITE8_MEMBER(irq_1_ctrl_w);
+ DECLARE_WRITE8_MEMBER(irq_2_ctrl_w);
DECLARE_READ8_MEMBER(readFF);
- DECLARE_WRITE8_MEMBER(pacland_videoram_w);
- DECLARE_WRITE8_MEMBER(pacland_videoram2_w);
- DECLARE_WRITE8_MEMBER(pacland_scroll0_w);
- DECLARE_WRITE8_MEMBER(pacland_scroll1_w);
- DECLARE_WRITE8_MEMBER(pacland_bankswitch_w);
+ DECLARE_WRITE8_MEMBER(videoram_w);
+ DECLARE_WRITE8_MEMBER(videoram2_w);
+ DECLARE_WRITE8_MEMBER(scroll0_w);
+ DECLARE_WRITE8_MEMBER(scroll1_w);
+ DECLARE_WRITE8_MEMBER(bankswitch_w);
+
TILE_GET_INFO_MEMBER(get_bg_tile_info);
TILE_GET_INFO_MEMBER(get_fg_tile_info);
+
+ virtual void machine_start();
virtual void video_start();
DECLARE_PALETTE_INIT(pacland);
- UINT32 screen_update_pacland(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
INTERRUPT_GEN_MEMBER(main_vblank_irq);
INTERRUPT_GEN_MEMBER(mcu_vblank_irq);
+
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void switch_palette();
void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int flip, int whichmask);
void draw_fg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int priority );
diff --git a/src/mame/includes/pacman.h b/src/mame/includes/pacman.h
index 06c6c4d995b..d62272914f5 100644
--- a/src/mame/includes/pacman.h
+++ b/src/mame/includes/pacman.h
@@ -23,7 +23,8 @@ public:
m_s2650games_tileram(*this, "s2650_tileram"),
m_rocktrv2_prot_data(*this, "rocktrv2_prot"),
m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette")
+ m_palette(*this, "palette"),
+ m_patched_opcodes(*this, "patched_opcodes")
{ }
required_device<cpu_device> m_maincpu;
@@ -37,6 +38,7 @@ public:
optional_shared_ptr<UINT8> m_rocktrv2_prot_data;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
+ optional_shared_ptr<UINT8> m_patched_opcodes;
UINT8 m_cannonb_bit_to_read;
int m_mystery;
diff --git a/src/mame/includes/pbaction.h b/src/mame/includes/pbaction.h
index a6e7e74fcf2..13fc38633c6 100644
--- a/src/mame/includes/pbaction.h
+++ b/src/mame/includes/pbaction.h
@@ -20,7 +20,8 @@ public:
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_decrypted_opcodes(*this, "decrypted_opcodes") { }
/* memory pointers */
required_shared_ptr<UINT8> m_videoram;
@@ -41,6 +42,7 @@ public:
required_device<cpu_device> m_audiocpu;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
+ optional_shared_ptr<UINT8> m_decrypted_opcodes;
UINT8 m_nmi_mask;
DECLARE_WRITE8_MEMBER(pbaction_sh_command_w);
diff --git a/src/mame/includes/pcktgal.h b/src/mame/includes/pcktgal.h
index 2ce40e08e97..b28c2bf4e81 100644
--- a/src/mame/includes/pcktgal.h
+++ b/src/mame/includes/pcktgal.h
@@ -12,30 +12,34 @@ public:
m_audiocpu(*this, "audiocpu"),
m_msm(*this, "msm"),
m_tilegen1(*this, "tilegen1"),
- m_spriteram(*this, "spriteram"),
m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_spriteram(*this, "spriteram") { }
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
required_device<msm5205_device> m_msm;
required_device<deco_bac06_device> m_tilegen1;
- required_shared_ptr<UINT8> m_spriteram;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
- DECLARE_WRITE8_MEMBER(pcktgal_bank_w);
- DECLARE_WRITE8_MEMBER(pcktgal_sound_bank_w);
- DECLARE_WRITE8_MEMBER(pcktgal_sound_w);
- DECLARE_WRITE8_MEMBER(pcktgal_adpcm_data_w);
- DECLARE_READ8_MEMBER(pcktgal_adpcm_reset_r);
- DECLARE_DRIVER_INIT(pcktgal);
+ required_shared_ptr<UINT8> m_spriteram;
+
int m_msm5205next;
int m_toggle;
+
+ DECLARE_WRITE8_MEMBER(bank_w);
+ DECLARE_WRITE8_MEMBER(sound_bank_w);
+ DECLARE_WRITE8_MEMBER(sound_w);
+ DECLARE_WRITE8_MEMBER(adpcm_data_w);
+ DECLARE_READ8_MEMBER(adpcm_reset_r);
+ DECLARE_WRITE_LINE_MEMBER(adpcm_int);
+
+ DECLARE_DRIVER_INIT(pcktgal);
DECLARE_PALETTE_INIT(pcktgal);
virtual void machine_start();
+
UINT32 screen_update_pcktgal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_pcktgalb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
- DECLARE_WRITE_LINE_MEMBER(pcktgal_adpcm_int);
};
diff --git a/src/mame/includes/pktgaldx.h b/src/mame/includes/pktgaldx.h
index b185d8f2727..02b1143ff21 100644
--- a/src/mame/includes/pktgaldx.h
+++ b/src/mame/includes/pktgaldx.h
@@ -28,7 +28,8 @@ public:
m_deco_tilegen1(*this, "tilegen1"),
m_decocomn(*this, "deco_common"),
m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_decrypted_opcodes(*this, "decrypted_opcodes") { }
optional_device<deco104_device> m_deco104;
@@ -49,6 +50,7 @@ public:
optional_device<decocomn_device> m_decocomn;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
+ optional_shared_ptr<UINT16> m_decrypted_opcodes;
DECLARE_READ16_MEMBER(pckgaldx_unknown_r);
DECLARE_READ16_MEMBER(pckgaldx_protection_r);
diff --git a/src/mame/includes/plygonet.h b/src/mame/includes/plygonet.h
index 7c1175e06f2..033cce2a1b3 100644
--- a/src/mame/includes/plygonet.h
+++ b/src/mame/includes/plygonet.h
@@ -48,8 +48,6 @@ public:
UINT8 m_sys0;
UINT8 m_sys1;
- direct_update_delegate m_dsp56k_update_handler;
-
/* TTL text plane stuff */
int m_ttl_gfx_index;
tilemap_t *m_ttl_tilemap;
@@ -95,7 +93,6 @@ public:
DECLARE_WRITE32_MEMBER(polygonet_ttl_ram_w);
DECLARE_READ32_MEMBER(polygonet_roz_ram_r);
DECLARE_WRITE32_MEMBER(polygonet_roz_ram_w);
- DIRECT_UPDATE_MEMBER(plygonet_dsp56k_direct_handler);
DECLARE_DRIVER_INIT(polygonet);
TILE_GET_INFO_MEMBER(ttl_get_tile_info);
TILE_GET_INFO_MEMBER(roz_get_tile_info);
diff --git a/src/mame/includes/poolshrk.h b/src/mame/includes/poolshrk.h
index 530f113bf95..f19ce377095 100644
--- a/src/mame/includes/poolshrk.h
+++ b/src/mame/includes/poolshrk.h
@@ -15,37 +15,43 @@ class poolshrk_state : public driver_device
public:
poolshrk_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
- m_playfield_ram(*this, "playfield_ram"),
- m_hpos_ram(*this, "hpos_ram"),
- m_vpos_ram(*this, "vpos_ram"),
- m_discrete(*this, "discrete"),
m_maincpu(*this, "maincpu"),
m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_discrete(*this, "discrete"),
+ m_playfield_ram(*this, "playfield_ram"),
+ m_hpos_ram(*this, "hpos_ram"),
+ m_vpos_ram(*this, "vpos_ram") { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<gfxdecode_device> m_gfxdecode;
+ required_device<palette_device> m_palette;
+ required_device<discrete_device> m_discrete;
- int m_da_latch;
required_shared_ptr<UINT8> m_playfield_ram;
required_shared_ptr<UINT8> m_hpos_ram;
required_shared_ptr<UINT8> m_vpos_ram;
- required_device<discrete_device> m_discrete;
+
tilemap_t* m_bg_tilemap;
- DECLARE_WRITE8_MEMBER(poolshrk_da_latch_w);
- DECLARE_WRITE8_MEMBER(poolshrk_led_w);
- DECLARE_WRITE8_MEMBER(poolshrk_watchdog_w);
- DECLARE_READ8_MEMBER(poolshrk_input_r);
- DECLARE_READ8_MEMBER(poolshrk_irq_reset_r);
- DECLARE_DRIVER_INIT(poolshrk);
+ int m_da_latch;
+
+ DECLARE_WRITE8_MEMBER(da_latch_w);
+ DECLARE_WRITE8_MEMBER(led_w);
+ DECLARE_WRITE8_MEMBER(watchdog_w);
+ DECLARE_READ8_MEMBER(input_r);
+ DECLARE_READ8_MEMBER(irq_reset_r);
+ DECLARE_WRITE8_MEMBER(scratch_sound_w);
+ DECLARE_WRITE8_MEMBER(score_sound_w);
+ DECLARE_WRITE8_MEMBER(click_sound_w);
+ DECLARE_WRITE8_MEMBER(bump_sound_w);
+
TILE_GET_INFO_MEMBER(get_tile_info);
+
+ DECLARE_DRIVER_INIT(poolshrk);
virtual void video_start();
DECLARE_PALETTE_INIT(poolshrk);
- UINT32 screen_update_poolshrk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- DECLARE_WRITE8_MEMBER(poolshrk_scratch_sound_w);
- DECLARE_WRITE8_MEMBER(poolshrk_score_sound_w);
- DECLARE_WRITE8_MEMBER(poolshrk_click_sound_w);
- DECLARE_WRITE8_MEMBER(poolshrk_bump_sound_w);
- required_device<cpu_device> m_maincpu;
- required_device<gfxdecode_device> m_gfxdecode;
- required_device<palette_device> m_palette;
+
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
};
diff --git a/src/mame/includes/segag80r.h b/src/mame/includes/segag80r.h
index e6477326079..eaa3107ec3a 100644
--- a/src/mame/includes/segag80r.h
+++ b/src/mame/includes/segag80r.h
@@ -35,7 +35,8 @@ public:
m_005snd(*this, "005"),
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_decrypted_opcodes(*this, "decrypted_opcodes") { }
required_shared_ptr<UINT8> m_mainram;
required_shared_ptr<UINT8> m_videoram;
@@ -51,6 +52,7 @@ public:
required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
+ optional_shared_ptr<UINT8> m_decrypted_opcodes;
std::vector<UINT8> m_paletteram;
diff --git a/src/mame/includes/segahang.h b/src/mame/includes/segahang.h
index 664841e7983..7d6e6e84813 100644
--- a/src/mame/includes/segahang.h
+++ b/src/mame/includes/segahang.h
@@ -35,7 +35,8 @@ public:
m_segaic16road(*this, "segaic16road"),
m_workram(*this, "workram"),
m_sharrier_video(false),
- m_adc_select(0)
+ m_adc_select(0),
+ m_decrypted_opcodes(*this, "decrypted_opcodes")
{ }
// PPI read/write callbacks
@@ -107,5 +108,6 @@ protected:
// internal state
UINT8 m_adc_select;
bool m_shadow;
+ optional_shared_ptr<UINT16> m_decrypted_opcodes;
TIMER_DEVICE_CALLBACK_MEMBER(hangon_irq);
};
diff --git a/src/mame/includes/segas16a.h b/src/mame/includes/segas16a.h
index 2a76c10dbaf..0656dd391a9 100644
--- a/src/mame/includes/segas16a.h
+++ b/src/mame/includes/segas16a.h
@@ -38,6 +38,7 @@ public:
m_segaic16vid(*this, "segaic16vid"),
m_sprites(*this, "sprites"),
m_workram(*this, "nvram"),
+ m_sound_decrypted_opcodes(*this, "sound_decrypted_opcodes"),
m_video_control(0),
m_mcu_control(0),
m_n7751_command(0),
@@ -136,6 +137,7 @@ protected:
// memory pointers
required_shared_ptr<UINT16> m_workram;
+ optional_shared_ptr<UINT8> m_sound_decrypted_opcodes;
// configuration
read16_delegate m_custom_io_r;
diff --git a/src/mame/includes/segas16b.h b/src/mame/includes/segas16b.h
index c3df7a7fe44..33c74ae4f99 100644
--- a/src/mame/includes/segas16b.h
+++ b/src/mame/includes/segas16b.h
@@ -49,7 +49,8 @@ public:
m_hwc_input_value(0),
m_mj_input_num(0),
m_mj_last_val(0),
- m_gfxdecode(*this, "gfxdecode")
+ m_gfxdecode(*this, "gfxdecode"),
+ m_sound_decrypted_opcodes(*this, "sound_decrypted_opcodes")
{ }
// memory mapping
@@ -203,6 +204,7 @@ protected:
UINT8 m_mj_last_val;
required_device<gfxdecode_device> m_gfxdecode;
+ optional_shared_ptr<UINT8> m_sound_decrypted_opcodes;
};
diff --git a/src/mame/includes/segas32.h b/src/mame/includes/segas32.h
index 3e51fe9e2d1..2353fb26c3c 100644
--- a/src/mame/includes/segas32.h
+++ b/src/mame/includes/segas32.h
@@ -8,26 +8,15 @@
#include "machine/eepromser.h"
#include "sound/multipcm.h"
+#include "machine/s32comm.h"
-class segas32_state : public driver_device
+
+
+class segas32_state : public device_t
{
public:
- segas32_state(const machine_config &mconfig, device_type type, const char *tag)
- : driver_device(mconfig, type, tag),
- m_z80_shared_ram(*this,"z80_shared_ram"),
- m_ga2_dpram(*this,"ga2_dpram"),
- m_system32_workram(*this,"workram"),
- m_system32_videoram(*this,"videoram", 0),
- m_system32_spriteram(*this,"spriteram", 0),
- m_system32_paletteram(*this,"paletteram", 0) ,
- m_maincpu(*this, "maincpu"),
- m_soundcpu(*this, "soundcpu"),
- m_multipcm(*this, "sega"),
- m_eeprom(*this, "eeprom"),
- m_gfxdecode(*this, "gfxdecode"),
- m_screen(*this, "screen"),
- m_palette(*this, "palette") { }
+ segas32_state(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
required_shared_ptr<UINT8> m_z80_shared_ram;
optional_shared_ptr<UINT8> m_ga2_dpram;
@@ -44,6 +33,10 @@ public:
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
+ required_device<timer_device> m_irq_timer_0;
+ required_device<timer_device> m_irq_timer_1;
+ optional_device<s32comm_device> m_s32comm;
+
typedef void (segas32_state::*sys32_output_callback)(int which, UINT16 data);
struct layer_info
@@ -82,7 +75,6 @@ public:
sys32_output_callback m_sw1_output;
sys32_output_callback m_sw2_output;
sys32_output_callback m_sw3_output;
- UINT16* m_dual_pcb_comms;
UINT16 *m_system32_protram;
UINT16 m_system32_displayenable[2];
UINT16 m_system32_tilebank_external;
@@ -175,41 +167,11 @@ public:
DECLARE_WRITE8_MEMBER(sound_bank_hi_w);
DECLARE_READ8_MEMBER(sound_dummy_r);
DECLARE_WRITE8_MEMBER(sound_dummy_w);
- DECLARE_WRITE16_MEMBER(dual_pcb_comms_w);
- DECLARE_READ16_MEMBER(dual_pcb_comms_r);
- DECLARE_READ16_MEMBER(dual_pcb_masterslave);
- DECLARE_READ16_MEMBER(arescue_handshake_r);
- DECLARE_READ16_MEMBER(arescue_slavebusy_r);
- DECLARE_WRITE16_MEMBER(f1en_comms_echo_w);
+
DECLARE_WRITE8_MEMBER(multipcm_bank_w);
DECLARE_WRITE8_MEMBER(scross_bank_w);
- DECLARE_DRIVER_INIT(titlef);
- DECLARE_DRIVER_INIT(slipstrm);
- DECLARE_DRIVER_INIT(radm);
- DECLARE_DRIVER_INIT(holo);
- DECLARE_DRIVER_INIT(svf);
- DECLARE_DRIVER_INIT(jleague);
- DECLARE_DRIVER_INIT(arescue);
- DECLARE_DRIVER_INIT(jpark);
- DECLARE_DRIVER_INIT(ga2);
- DECLARE_DRIVER_INIT(scross);
- DECLARE_DRIVER_INIT(spidman);
- DECLARE_DRIVER_INIT(sonicp);
- DECLARE_DRIVER_INIT(f1en);
- DECLARE_DRIVER_INIT(dbzvrvs);
- DECLARE_DRIVER_INIT(brival);
- DECLARE_DRIVER_INIT(harddunk);
- DECLARE_DRIVER_INIT(arabfgt);
- DECLARE_DRIVER_INIT(sonic);
- DECLARE_DRIVER_INIT(alien3);
- DECLARE_DRIVER_INIT(darkedge);
- DECLARE_DRIVER_INIT(radr);
- DECLARE_DRIVER_INIT(f1lap);
- DECLARE_DRIVER_INIT(orunners);
+
TILE_GET_INFO_MEMBER(get_tile_info);
- DECLARE_MACHINE_RESET(system32);
- DECLARE_VIDEO_START(system32);
- DECLARE_VIDEO_START(multi32);
UINT32 screen_update_system32(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
UINT32 screen_update_multi32_left(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
UINT32 screen_update_multi32_right(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
@@ -262,6 +224,7 @@ public:
void scross_sw1_output( int which, UINT16 data );
void scross_sw2_output( int which, UINT16 data );
int compute_clipping_extents(screen_device &screen, int enable, int clipout, int clipmask, const rectangle &cliprect, struct extents_list *list);
+ void compute_tilemap_flips(int bgnum, int &flipx, int &flipy);
void update_tilemap_zoom(screen_device &screen, struct layer_info *layer, const rectangle &cliprect, int bgnum);
void update_tilemap_rowscroll(screen_device &screen, struct layer_info *layer, const rectangle &cliprect, int bgnum);
void update_tilemap_text(screen_device &screen, struct layer_info *layer, const rectangle &cliprect);
@@ -272,7 +235,70 @@ public:
void clear_sound_irq(int which);
void darkedge_fd1149_vblank();
void f1lap_fd1149_vblank();
+
+ void init_alien3(void);
+ void init_arescue(int m_hasdsp);
+ void init_arabfgt(void);
+ void init_brival(void);
+ void init_darkedge(void);
+ void init_dbzvrvs(void);
+ void init_f1en(void);
+ void init_f1lap(void);
+ void init_ga2(void);
+ void init_harddunk(void);
+ void init_holo(void);
+ void init_jpark(void);
+ void init_orunners(void);
+ void init_radm(void);
+ void init_radr(void);
+ void init_scross(void);
+ void init_slipstrm(void);
+ void init_sonic(void);
+ void init_sonicp(void);
+ void init_spidman(void);
+ void init_svf(void);
+ void init_jleague(void);
+ void init_titlef(void);
+
+protected:
+ virtual void device_start();
+ virtual void device_reset();
+};
+
+class segas32_regular_state : public segas32_state
+{
+public:
+ segas32_regular_state(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+protected:
+ virtual machine_config_constructor device_mconfig_additions() const;
+// virtual void device_start();
+// virtual void device_reset();
+};
+
+class segas32_v25_state : public segas32_state
+{
+public:
+ segas32_v25_state(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+protected:
+ virtual machine_config_constructor device_mconfig_additions() const;
+ virtual void device_start();
+// virtual void device_reset();
+};
+
+class sega_multi32_state : public segas32_state
+{
+public:
+ sega_multi32_state(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+protected:
+ virtual machine_config_constructor device_mconfig_additions() const;
+ virtual void device_start();
+// virtual void device_reset();
};
/*----------- defined in machine/segas32.c -----------*/
extern const UINT8 ga2_v25_opcode_table[];
+
+extern const device_type SEGA_S32_PCB;
diff --git a/src/mame/includes/seicross.h b/src/mame/includes/seicross.h
index 3093784d8f8..d54177825fe 100644
--- a/src/mame/includes/seicross.h
+++ b/src/mame/includes/seicross.h
@@ -16,7 +16,8 @@ public:
m_videoram(*this, "videoram"),
m_row_scroll(*this, "row_scroll"),
m_spriteram2(*this, "spriteram2"),
- m_colorram(*this, "colorram") { }
+ m_colorram(*this, "colorram"),
+ m_decrypted_opcodes(*this, "decrypted_opcodes") { }
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_mcu;
@@ -29,6 +30,7 @@ public:
required_shared_ptr<UINT8> m_row_scroll;
required_shared_ptr<UINT8> m_spriteram2;
required_shared_ptr<UINT8> m_colorram;
+ optional_shared_ptr<UINT8> m_decrypted_opcodes;
UINT8 m_portb;
tilemap_t *m_bg_tilemap;
diff --git a/src/mame/includes/senjyo.h b/src/mame/includes/senjyo.h
index 524b75d8a67..7ed3af920b9 100644
--- a/src/mame/includes/senjyo.h
+++ b/src/mame/includes/senjyo.h
@@ -30,7 +30,8 @@ public:
m_bg3videoram(*this, "bg3videoram"),
m_radarram(*this, "radarram"),
m_bgstripesram(*this, "bgstripesram"),
- m_generic_paletteram_8(*this, "paletteram") { }
+ m_generic_paletteram_8(*this, "paletteram"),
+ m_decrypted_opcodes(*this, "decrypted_opcodes") { }
/* devices */
required_device<cpu_device> m_maincpu;
@@ -56,6 +57,7 @@ public:
required_shared_ptr<UINT8> m_radarram;
required_shared_ptr<UINT8> m_bgstripesram;
required_shared_ptr<UINT8> m_generic_paletteram_8;
+ optional_shared_ptr<UINT8> m_decrypted_opcodes;
// game specific initialization
int m_is_senjyo;
diff --git a/src/mame/includes/shisen.h b/src/mame/includes/shisen.h
index 43c11e1e6e0..a93ddf0e5c8 100644
--- a/src/mame/includes/shisen.h
+++ b/src/mame/includes/shisen.h
@@ -7,29 +7,33 @@ class shisen_state : public driver_device
public:
shisen_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
- m_paletteram(*this, "paletteram"),
- m_videoram(*this, "videoram"),
m_maincpu(*this, "maincpu"),
m_audio (*this, "m72"),
m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette") { }
-
- required_shared_ptr<UINT8> m_paletteram;
- required_shared_ptr<UINT8> m_videoram;
+ m_palette(*this, "palette"),
+ m_paletteram(*this, "paletteram"),
+ m_videoram(*this, "videoram") { }
required_device<cpu_device> m_maincpu;
required_device<m72_audio_device> m_audio;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
+ required_shared_ptr<UINT8> m_paletteram;
+ required_shared_ptr<UINT8> m_videoram;
+
int m_gfxbank;
tilemap_t *m_bg_tilemap;
- DECLARE_READ8_MEMBER(sichuan2_dsw1_r);
- DECLARE_WRITE8_MEMBER(sichuan2_coin_w);
- DECLARE_WRITE8_MEMBER(sichuan2_videoram_w);
- DECLARE_WRITE8_MEMBER(sichuan2_bankswitch_w);
- DECLARE_WRITE8_MEMBER(sichuan2_paletteram_w);
+
+ DECLARE_READ8_MEMBER(dsw1_r);
+ DECLARE_WRITE8_MEMBER(coin_w);
+ DECLARE_WRITE8_MEMBER(videoram_w);
+ DECLARE_WRITE8_MEMBER(bankswitch_w);
+ DECLARE_WRITE8_MEMBER(paletteram_w);
+
TILE_GET_INFO_MEMBER(get_bg_tile_info);
+
virtual void video_start();
- UINT32 screen_update_sichuan2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
};
diff --git a/src/mame/includes/slapshot.h b/src/mame/includes/slapshot.h
index 355cdcd4ae9..61c541b0759 100644
--- a/src/mame/includes/slapshot.h
+++ b/src/mame/includes/slapshot.h
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:David Graves
/*************************************************************************
@@ -49,7 +49,7 @@ public:
required_device<tc0640fio_device> m_tc0640fio;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
-
+
/* memory pointers */
required_shared_ptr<UINT16> m_spriteram;
required_shared_ptr<UINT16> m_spriteext;
diff --git a/src/mame/includes/snk68.h b/src/mame/includes/snk68.h
index f85bacc549d..c9b5334303e 100644
--- a/src/mame/includes/snk68.h
+++ b/src/mame/includes/snk68.h
@@ -7,59 +7,58 @@ class snk68_state : public driver_device
public:
snk68_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
- m_pow_fg_videoram(*this, "pow_fg_videoram"),
- m_spriteram(*this, "spriteram"),
- m_paletteram(*this, "paletteram"),
m_maincpu(*this, "maincpu"),
m_soundcpu(*this, "soundcpu"),
m_upd7759(*this, "upd"),
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
- m_palette(*this, "palette") { }
+ m_pow_fg_videoram(*this, "pow_fg_videoram"),
+ m_spriteram(*this, "spriteram") { }
- int m_invert_controls;
- int m_sound_status;
+ required_device<cpu_device> m_maincpu;
+ required_device<cpu_device> m_soundcpu;
+ required_device<upd7759_device> m_upd7759;
+ required_device<gfxdecode_device> m_gfxdecode;
+ required_device<screen_device> m_screen;
required_shared_ptr<UINT16> m_pow_fg_videoram;
-
required_shared_ptr<UINT16> m_spriteram;
- required_shared_ptr<UINT16> m_paletteram;
- int m_sprite_flip_axis;
+
+ UINT8 m_invert_controls;
+ bool m_sprite_flip_axis;
tilemap_t *m_fg_tilemap;
- int m_flipscreen;
UINT32 m_fg_tile_offset;
- DECLARE_READ16_MEMBER(sound_status_r);
- DECLARE_WRITE8_MEMBER(sound_status_w);
- DECLARE_READ16_MEMBER(control_1_r);
- DECLARE_READ16_MEMBER(control_2_r);
- DECLARE_READ16_MEMBER(rotary_1_r);
- DECLARE_READ16_MEMBER(rotary_2_r);
- DECLARE_READ16_MEMBER(rotary_lsb_r);
- DECLARE_READ16_MEMBER(protcontrols_r);
- DECLARE_WRITE16_MEMBER(protection_w);
+
+ // common
DECLARE_WRITE16_MEMBER(sound_w);
- DECLARE_READ16_MEMBER(pow_spriteram_r);
- DECLARE_WRITE16_MEMBER(pow_spriteram_w);
+ DECLARE_READ16_MEMBER(spriteram_r);
+ DECLARE_WRITE16_MEMBER(spriteram_w);
+ DECLARE_WRITE8_MEMBER(D7759_write_port_0_w);
+ DECLARE_WRITE8_MEMBER(D7759_upd_reset_w);
+
+ // pow and streetsm
DECLARE_READ16_MEMBER(pow_fg_videoram_r);
DECLARE_WRITE16_MEMBER(pow_fg_videoram_w);
+ DECLARE_WRITE16_MEMBER(pow_flipscreen_w);
+ DECLARE_READ16_MEMBER(control_1_r);
+
+ // searchar and ikari3
DECLARE_WRITE16_MEMBER(searchar_fg_videoram_w);
- DECLARE_WRITE16_MEMBER(pow_flipscreen16_w);
- DECLARE_WRITE16_MEMBER(searchar_flipscreen16_w);
- DECLARE_WRITE16_MEMBER(pow_paletteram16_word_w);
- DECLARE_WRITE8_MEMBER(D7759_write_port_0_w);
- DECLARE_WRITE8_MEMBER(D7759_upd_reset_w);
- DECLARE_DRIVER_INIT(searchar);
+ DECLARE_WRITE16_MEMBER(searchar_flipscreen_w);
+ DECLARE_READ16_MEMBER(protcontrols_r);
+ DECLARE_WRITE16_MEMBER(protection_w);
+ DECLARE_READ16_MEMBER(rotary_1_r);
+ DECLARE_READ16_MEMBER(rotary_2_r);
+ DECLARE_READ16_MEMBER(rotary_lsb_r);
+
TILE_GET_INFO_MEMBER(get_pow_tile_info);
TILE_GET_INFO_MEMBER(get_searchar_tile_info);
+
+ virtual void machine_start();
virtual void video_start();
DECLARE_VIDEO_START(searchar);
- UINT32 screen_update_pow(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void common_video_start();
+
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int group);
- required_device<cpu_device> m_maincpu;
- required_device<cpu_device> m_soundcpu;
- required_device<upd7759_device> m_upd7759;
- required_device<gfxdecode_device> m_gfxdecode;
- required_device<screen_device> m_screen;
- required_device<palette_device> m_palette;
};
diff --git a/src/mame/includes/spacefb.h b/src/mame/includes/spacefb.h
index 8476eb7a917..513c3a1679c 100644
--- a/src/mame/includes/spacefb.h
+++ b/src/mame/includes/spacefb.h
@@ -31,32 +31,43 @@ class spacefb_state : public driver_device
public:
spacefb_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
- m_videoram(*this, "videoram"),
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
m_samples(*this, "samples"),
- m_screen(*this, "screen") { }
+ m_screen(*this, "screen"),
+ m_videoram(*this, "videoram") { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<cpu_device> m_audiocpu;
+ required_device<samples_device> m_samples;
+ required_device<screen_device> m_screen;
+
+ required_shared_ptr<UINT8> m_videoram;
UINT8 m_sound_latch;
emu_timer *m_interrupt_timer;
- required_shared_ptr<UINT8> m_videoram;
UINT8 *m_object_present_map;
UINT8 m_port_0;
UINT8 m_port_2;
UINT32 m_star_shift_reg;
double m_color_weights_rg[3];
double m_color_weights_b[2];
- DECLARE_WRITE8_MEMBER(spacefb_port_0_w);
- DECLARE_WRITE8_MEMBER(spacefb_port_2_w);
- DECLARE_READ8_MEMBER(spacefb_audio_p2_r);
- DECLARE_READ8_MEMBER(spacefb_audio_t0_r);
- DECLARE_READ8_MEMBER(spacefb_audio_t1_r);
- DECLARE_WRITE8_MEMBER(spacefb_port_1_w);
+
+ DECLARE_WRITE8_MEMBER(port_0_w);
+ DECLARE_WRITE8_MEMBER(port_1_w);
+ DECLARE_WRITE8_MEMBER(port_2_w);
+ DECLARE_READ8_MEMBER(audio_p2_r);
+ DECLARE_READ8_MEMBER(audio_t0_r);
+ DECLARE_READ8_MEMBER(audio_t1_r);
+
virtual void machine_start();
virtual void machine_reset();
virtual void video_start();
- UINT32 screen_update_spacefb(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
+
TIMER_CALLBACK_MEMBER(interrupt_callback);
+ void start_interrupt_timer();
+
+ UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
inline void shift_star_generator();
void get_starfield_pens(pen_t *pens);
void draw_starfield(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
@@ -64,12 +75,15 @@ public:
void draw_bullet(offs_t offs, pen_t pen, bitmap_rgb32 &bitmap, const rectangle &cliprect, int flip);
void draw_sprite(offs_t offs, pen_t *pens, bitmap_rgb32 &bitmap, const rectangle &cliprect, int flip);
void draw_objects(bitmap_rgb32 &bitmap, const rectangle &cliprect);
- void create_interrupt_timer();
- void start_interrupt_timer();
- required_device<cpu_device> m_maincpu;
- required_device<cpu_device> m_audiocpu;
- required_device<samples_device> m_samples;
- required_device<screen_device> m_screen;
+
+protected:
+
+ enum
+ {
+ TIMER_INTERRUPT
+ };
+
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
};
/*----------- defined in audio/spacefb.c -----------*/
diff --git a/src/mame/includes/spbactn.h b/src/mame/includes/spbactn.h
index fd8074c28a3..9924a0e46fe 100644
--- a/src/mame/includes/spbactn.h
+++ b/src/mame/includes/spbactn.h
@@ -9,20 +9,28 @@ class spbactn_state : public driver_device
public:
spbactn_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
- m_bgvideoram(*this, "bgvideoram"),
- m_fgvideoram(*this, "fgvideoram"),
- m_spvideoram(*this, "spvideoram"),
- m_extraram(*this, "extraram"),
- m_extraram2(*this, "extraram2"),
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
m_palette(*this, "palette"),
m_sprgen(*this, "spritegen"),
- m_mixer(*this, "mixer")
+ m_mixer(*this, "mixer"),
+ m_bgvideoram(*this, "bgvideoram"),
+ m_fgvideoram(*this, "fgvideoram"),
+ m_spvideoram(*this, "spvideoram"),
+ m_extraram(*this, "extraram"),
+ m_extraram2(*this, "extraram2")
{ }
+ required_device<cpu_device> m_maincpu;
+ required_device<cpu_device> m_audiocpu;
+ required_device<gfxdecode_device> m_gfxdecode;
+ required_device<screen_device> m_screen;
+ required_device<palette_device> m_palette;
+ required_device<tecmo_spr_device> m_sprgen;
+ required_device<tecmo_mix_device> m_mixer;
+
required_shared_ptr<UINT16> m_bgvideoram;
required_shared_ptr<UINT16> m_fgvideoram;
required_shared_ptr<UINT16> m_spvideoram;
@@ -74,14 +82,4 @@ public:
{
return 0xffff;
}
- required_device<cpu_device> m_maincpu;
- required_device<cpu_device> m_audiocpu;
- required_device<gfxdecode_device> m_gfxdecode;
- required_device<screen_device> m_screen;
- required_device<palette_device> m_palette;
- required_device<tecmo_spr_device> m_sprgen;
- required_device<tecmo_mix_device> m_mixer;
-
-
-
};
diff --git a/src/mame/includes/spdodgeb.h b/src/mame/includes/spdodgeb.h
index 2dd4ad26571..54ec83d83df 100644
--- a/src/mame/includes/spdodgeb.h
+++ b/src/mame/includes/spdodgeb.h
@@ -13,15 +13,26 @@ class spdodgeb_state : public driver_device
public:
spdodgeb_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
- m_videoram(*this, "videoram"),
- m_spriteram(*this, "spriteram"),
m_maincpu(*this,"maincpu"),
m_audiocpu(*this, "audiocpu"),
m_msm1(*this, "msm1"),
m_msm2(*this, "msm2"),
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_videoram(*this, "videoram"),
+ m_spriteram(*this, "spriteram") { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<cpu_device> m_audiocpu;
+ required_device<msm5205_device> m_msm1;
+ required_device<msm5205_device> m_msm2;
+ required_device<gfxdecode_device> m_gfxdecode;
+ required_device<screen_device> m_screen;
+ required_device<palette_device> m_palette;
+
+ required_shared_ptr<UINT8> m_videoram;
+ required_shared_ptr<UINT8> m_spriteram;
int m_toggle;
int m_adpcm_pos[2];
@@ -41,38 +52,35 @@ public:
int m_countdown[2][2];
int m_prev[2];
#endif
- required_shared_ptr<UINT8> m_videoram;
int m_tile_palbank;
int m_sprite_palbank;
tilemap_t *m_bg_tilemap;
int m_lastscroll;
- required_shared_ptr<UINT8> m_spriteram;
- required_device<cpu_device> m_maincpu;
DECLARE_WRITE8_MEMBER(sound_command_w);
DECLARE_WRITE8_MEMBER(spd_adpcm_w);
DECLARE_READ8_MEMBER(mcu63701_r);
DECLARE_WRITE8_MEMBER(mcu63701_w);
- DECLARE_WRITE8_MEMBER(spdodgeb_scrollx_lo_w);
- DECLARE_WRITE8_MEMBER(spdodgeb_ctrl_w);
- DECLARE_WRITE8_MEMBER(spdodgeb_videoram_w);
+ DECLARE_WRITE8_MEMBER(scrollx_lo_w);
+ DECLARE_WRITE8_MEMBER(ctrl_w);
+ DECLARE_WRITE8_MEMBER(videoram_w);
+ DECLARE_WRITE_LINE_MEMBER(spd_adpcm_int_1);
+ DECLARE_WRITE_LINE_MEMBER(spd_adpcm_int_2);
+
TILEMAP_MAPPER_MEMBER(background_scan);
TILE_GET_INFO_MEMBER(get_bg_tile_info);
+
+ virtual void machine_start();
virtual void machine_reset();
virtual void video_start();
DECLARE_PALETTE_INIT(spdodgeb);
- UINT32 screen_update_spdodgeb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- TIMER_DEVICE_CALLBACK_MEMBER(spdodgeb_interrupt);
+
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect );
- void mcu63705_update_inputs();
+
+ TIMER_DEVICE_CALLBACK_MEMBER(interrupt);
DECLARE_CUSTOM_INPUT_MEMBER(mcu63705_busy_r);
+
+ void mcu63705_update_inputs();
void spd_adpcm_int(msm5205_device *device, int chip);
- DECLARE_WRITE_LINE_MEMBER(spd_adpcm_int_1);
- DECLARE_WRITE_LINE_MEMBER(spd_adpcm_int_2);
- required_device<cpu_device> m_audiocpu;
- required_device<msm5205_device> m_msm1;
- required_device<msm5205_device> m_msm2;
- required_device<gfxdecode_device> m_gfxdecode;
- required_device<screen_device> m_screen;
- required_device<palette_device> m_palette;
};
diff --git a/src/mame/includes/sprcros2.h b/src/mame/includes/sprcros2.h
index 4d6cdcfee2f..c0b312005d3 100644
--- a/src/mame/includes/sprcros2.h
+++ b/src/mame/includes/sprcros2.h
@@ -5,40 +5,45 @@ class sprcros2_state : public driver_device
public:
sprcros2_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
- m_fgvideoram(*this, "fgvideoram"),
- m_bgvideoram(*this, "bgvideoram"),
- m_spriteram(*this, "spriteram"),
m_master(*this,"master"),
m_slave(*this,"slave"),
m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_fgvideoram(*this, "fgvideoram"),
+ m_bgvideoram(*this, "bgvideoram"),
+ m_spriteram(*this, "spriteram") { }
+
+ required_device<cpu_device> m_master;
+ required_device<cpu_device> m_slave;
+ required_device<gfxdecode_device> m_gfxdecode;
+ required_device<palette_device> m_palette;
+
+ required_shared_ptr<UINT8> m_fgvideoram;
+ required_shared_ptr<UINT8> m_bgvideoram;
+ required_shared_ptr<UINT8> m_spriteram;
UINT8 m_s_port3;
UINT8 m_port7;
tilemap_t *m_bgtilemap;
tilemap_t *m_fgtilemap;
- required_shared_ptr<UINT8> m_fgvideoram;
- required_shared_ptr<UINT8> m_bgvideoram;
- required_shared_ptr<UINT8> m_spriteram;
- required_device<cpu_device> m_master;
- required_device<cpu_device> m_slave;
- required_device<gfxdecode_device> m_gfxdecode;
- required_device<palette_device> m_palette;
+ DECLARE_WRITE8_MEMBER(m_port7_w);
+ DECLARE_WRITE8_MEMBER(s_port3_w);
+ DECLARE_WRITE8_MEMBER(fgvideoram_w);
+ DECLARE_WRITE8_MEMBER(bgvideoram_w);
+ DECLARE_WRITE8_MEMBER(bgscrollx_w);
+ DECLARE_WRITE8_MEMBER(bgscrolly_w);
+
+ TILE_GET_INFO_MEMBER(get_bgtile_info);
+ TILE_GET_INFO_MEMBER(get_fgtile_info);
- DECLARE_WRITE8_MEMBER(sprcros2_m_port7_w);
- DECLARE_WRITE8_MEMBER(sprcros2_s_port3_w);
- DECLARE_WRITE8_MEMBER(sprcros2_fgvideoram_w);
- DECLARE_WRITE8_MEMBER(sprcros2_bgvideoram_w);
- DECLARE_WRITE8_MEMBER(sprcros2_bgscrollx_w);
- DECLARE_WRITE8_MEMBER(sprcros2_bgscrolly_w);
- TILE_GET_INFO_MEMBER(get_sprcros2_bgtile_info);
- TILE_GET_INFO_MEMBER(get_sprcros2_fgtile_info);
virtual void machine_start();
virtual void video_start();
DECLARE_PALETTE_INIT(sprcros2);
- UINT32 screen_update_sprcros2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- INTERRUPT_GEN_MEMBER(sprcros2_s_interrupt);
- TIMER_DEVICE_CALLBACK_MEMBER(sprcros2_m_interrupt);
+
+ INTERRUPT_GEN_MEMBER(s_interrupt);
+ TIMER_DEVICE_CALLBACK_MEMBER(m_interrupt);
+
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect);
};
diff --git a/src/mame/includes/srmp2.h b/src/mame/includes/srmp2.h
index e4d48edd5e1..6162c62b584 100644
--- a/src/mame/includes/srmp2.h
+++ b/src/mame/includes/srmp2.h
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Yochizo, Takahiro Nogi
#include "sound/msm5205.h"
#include "video/seta001.h"
diff --git a/src/mame/includes/starcrus.h b/src/mame/includes/starcrus.h
index 96e006cae87..ac5400433e4 100644
--- a/src/mame/includes/starcrus.h
+++ b/src/mame/includes/starcrus.h
@@ -11,6 +11,11 @@ public:
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette") { }
+ required_device<cpu_device> m_maincpu;
+ required_device<samples_device> m_samples;
+ required_device<gfxdecode_device> m_gfxdecode;
+ required_device<palette_device> m_palette;
+
bitmap_ind16 *m_ship1_vid;
bitmap_ind16 *m_ship2_vid;
bitmap_ind16 *m_proj1_vid;
@@ -43,27 +48,26 @@ public:
int m_explode_sound_playing;
int m_launch1_sound_playing;
int m_launch2_sound_playing;
- DECLARE_WRITE8_MEMBER(starcrus_s1_x_w);
- DECLARE_WRITE8_MEMBER(starcrus_s1_y_w);
- DECLARE_WRITE8_MEMBER(starcrus_s2_x_w);
- DECLARE_WRITE8_MEMBER(starcrus_s2_y_w);
- DECLARE_WRITE8_MEMBER(starcrus_p1_x_w);
- DECLARE_WRITE8_MEMBER(starcrus_p1_y_w);
- DECLARE_WRITE8_MEMBER(starcrus_p2_x_w);
- DECLARE_WRITE8_MEMBER(starcrus_p2_y_w);
- DECLARE_WRITE8_MEMBER(starcrus_ship_parm_1_w);
- DECLARE_WRITE8_MEMBER(starcrus_ship_parm_2_w);
- DECLARE_WRITE8_MEMBER(starcrus_proj_parm_1_w);
- DECLARE_WRITE8_MEMBER(starcrus_proj_parm_2_w);
- DECLARE_READ8_MEMBER(starcrus_coll_det_r);
+
+ DECLARE_WRITE8_MEMBER(s1_x_w);
+ DECLARE_WRITE8_MEMBER(s1_y_w);
+ DECLARE_WRITE8_MEMBER(s2_x_w);
+ DECLARE_WRITE8_MEMBER(s2_y_w);
+ DECLARE_WRITE8_MEMBER(p1_x_w);
+ DECLARE_WRITE8_MEMBER(p1_y_w);
+ DECLARE_WRITE8_MEMBER(p2_x_w);
+ DECLARE_WRITE8_MEMBER(p2_y_w);
+ DECLARE_WRITE8_MEMBER(ship_parm_1_w);
+ DECLARE_WRITE8_MEMBER(ship_parm_2_w);
+ DECLARE_WRITE8_MEMBER(proj_parm_1_w);
+ DECLARE_WRITE8_MEMBER(proj_parm_2_w);
+ DECLARE_READ8_MEMBER(coll_det_r);
+
virtual void video_start();
- UINT32 screen_update_starcrus(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
int collision_check_s1s2();
int collision_check_p1p2();
int collision_check_s1p1p2();
int collision_check_s2p1p2();
- required_device<cpu_device> m_maincpu;
- required_device<samples_device> m_samples;
- required_device<gfxdecode_device> m_gfxdecode;
- required_device<palette_device> m_palette;
};
diff --git a/src/mame/includes/stfight.h b/src/mame/includes/stfight.h
index 48e66bdd91c..07a0669fd9d 100644
--- a/src/mame/includes/stfight.h
+++ b/src/mame/includes/stfight.h
@@ -22,7 +22,8 @@ public:
m_text_attr_ram(*this, "text_attr_ram"),
m_tx_vram(*this, "tx_vram"),
m_vh_latch_ram(*this, "vh_latch_ram"),
- m_sprite_ram(*this, "sprite_ram") { }
+ m_sprite_ram(*this, "sprite_ram"),
+ m_decrypted_opcodes(*this, "decrypted_opcodes") { }
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
@@ -36,6 +37,7 @@ public:
optional_shared_ptr<UINT8> m_tx_vram;
required_shared_ptr<UINT8> m_vh_latch_ram;
required_shared_ptr<UINT8> m_sprite_ram;
+ optional_shared_ptr<UINT8> m_decrypted_opcodes;
UINT8 *m_decrypt;
UINT8 m_fm_data;
diff --git a/src/mame/includes/suna8.h b/src/mame/includes/suna8.h
index 41ff298e1ab..379250fae09 100644
--- a/src/mame/includes/suna8.h
+++ b/src/mame/includes/suna8.h
@@ -19,7 +19,9 @@ public:
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
m_palette(*this, "palette"),
-
+ m_bank0d(*this, "bank0d"),
+ m_bank1(*this, "bank1"),
+ m_bank1d(*this, "bank1d"),
m_prot_opcode_toggle(0),
m_remap_sound(0)
{ }
@@ -34,6 +36,9 @@ public:
required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
+ optional_memory_bank m_bank0d;
+ required_memory_bank m_bank1;
+ optional_memory_bank m_bank1d;
UINT8 m_rombank;
UINT8 m_rombank_latch;
@@ -63,7 +68,7 @@ public:
// samples
INT16 *m_samplebuf;
- int m_sample;
+ int m_sample, m_play;
int m_numsamples;
#if TILEMAPS
diff --git a/src/mame/includes/superchs.h b/src/mame/includes/superchs.h
index 7e6cfaf9b70..05993a82556 100644
--- a/src/mame/includes/superchs.h
+++ b/src/mame/includes/superchs.h
@@ -1,10 +1,10 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Bryan McPhail, David Graves
#include "machine/eepromser.h"
#include "video/tc0480scp.h"
-struct tempsprite
+struct schs_tempsprite
{
int gfx;
int code,color;
@@ -34,7 +34,7 @@ public:
required_shared_ptr<UINT32> m_spriteram;
required_shared_ptr<UINT32> m_shared_ram;
- struct tempsprite *m_spritelist;
+ struct schs_tempsprite *m_spritelist;
UINT32 m_mem[2];
DECLARE_READ16_MEMBER(shared_ram_r);
diff --git a/src/mame/includes/suprloco.h b/src/mame/includes/suprloco.h
index 2b3e99190dd..7d7f84d9b3b 100644
--- a/src/mame/includes/suprloco.h
+++ b/src/mame/includes/suprloco.h
@@ -10,7 +10,8 @@ public:
m_gfxdecode(*this, "gfxdecode"),
m_spriteram(*this, "spriteram"),
m_videoram(*this, "videoram"),
- m_scrollram(*this, "scrollram") { }
+ m_scrollram(*this, "scrollram"),
+ m_decrypted_opcodes(*this, "decrypted_opcodes") { }
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
@@ -19,6 +20,7 @@ public:
required_shared_ptr<UINT8> m_spriteram;
required_shared_ptr<UINT8> m_videoram;
required_shared_ptr<UINT8> m_scrollram;
+ required_shared_ptr<UINT8> m_decrypted_opcodes;
tilemap_t *m_bg_tilemap;
int m_control;
diff --git a/src/mame/includes/system1.h b/src/mame/includes/system1.h
index fabb4bb0848..c6d7e437841 100644
--- a/src/mame/includes/system1.h
+++ b/src/mame/includes/system1.h
@@ -19,7 +19,12 @@ public:
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
m_palette(*this, "palette"),
- m_generic_paletteram_8(*this, "paletteram") { }
+ m_generic_paletteram_8(*this, "paletteram"),
+ m_decrypted_opcodes(*this, "decrypted_opcodes"),
+ m_maincpu_region(*this, "maincpu"),
+ m_bank1(*this, "bank1"),
+ m_bank0d(*this, "bank0d"),
+ m_bank1d(*this, "bank1d") { }
optional_device<i8255_device> m_ppi8255;
required_shared_ptr<UINT8> m_ram;
@@ -137,4 +142,11 @@ public:
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;
required_shared_ptr<UINT8> m_generic_paletteram_8;
+ optional_shared_ptr<UINT8> m_decrypted_opcodes;
+ required_memory_region m_maincpu_region;
+ required_memory_bank m_bank1;
+ optional_memory_bank m_bank0d;
+ optional_memory_bank m_bank1d;
+
+ UINT8 *m_banked_decrypted_opcodes;
};
diff --git a/src/mame/includes/system16.h b/src/mame/includes/system16.h
index f2171e180ce..91ad78b88d8 100644
--- a/src/mame/includes/system16.h
+++ b/src/mame/includes/system16.h
@@ -24,7 +24,8 @@ public:
m_soundcpu(*this, "soundcpu"),
m_msm(*this, "5205"),
m_upd7759(*this, "7759"),
- m_gfxdecode(*this, "gfxdecode") { }
+ m_gfxdecode(*this, "gfxdecode"),
+ m_decrypted_opcodes(*this, "decrypted_opcodes") { }
required_shared_ptr<UINT16> m_textram;
optional_shared_ptr<UINT16> m_bg0_tileram;
@@ -121,6 +122,7 @@ public:
optional_device<msm5205_device> m_msm;
optional_device<upd7759_device> m_upd7759;
required_device<gfxdecode_device> m_gfxdecode;
+ optional_shared_ptr<UINT16> m_decrypted_opcodes;
DECLARE_WRITE16_MEMBER(sound_command_nmi_w);
DECLARE_WRITE16_MEMBER(sound_command_w);
diff --git a/src/mame/includes/taito_f2.h b/src/mame/includes/taito_f2.h
index 84709a891c5..98c9f772fbb 100644
--- a/src/mame/includes/taito_f2.h
+++ b/src/mame/includes/taito_f2.h
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:David Graves, Bryan McPhail, Brad Oliver, Andrew Prime, Brian Troha, Nicola Salmoria
#include "machine/taitoio.h"
#include "sound/okim6295.h"
diff --git a/src/mame/includes/taito_h.h b/src/mame/includes/taito_h.h
index 00bbf10bb91..d2b6ae0f845 100644
--- a/src/mame/includes/taito_h.h
+++ b/src/mame/includes/taito_h.h
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Yochizo
/*************************************************************************
diff --git a/src/mame/includes/taito_z.h b/src/mame/includes/taito_z.h
index 0e529cdd8e3..cad38ea63e9 100644
--- a/src/mame/includes/taito_z.h
+++ b/src/mame/includes/taito_z.h
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:David Graves
/*************************************************************************
diff --git a/src/mame/includes/taitoair.h b/src/mame/includes/taitoair.h
index 66a373e83e9..356801eede6 100644
--- a/src/mame/includes/taitoair.h
+++ b/src/mame/includes/taitoair.h
@@ -18,7 +18,7 @@ struct taitoair_spoint {
struct taitoair_poly {
struct taitoair_spoint p[TAITOAIR_POLY_MAX_PT];
int pcount;
- int col;
+ UINT16 header;
};
@@ -32,7 +32,7 @@ public:
m_dsp_ram(*this, "dsp_ram"),
m_paletteram(*this, "paletteram"),
m_gradram(*this, "gradram"),
- m_backregs(*this, "backregs"),
+ m_tc0430grw(*this, "tc0430grw"),
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
m_dsp(*this, "dsp"),
@@ -49,7 +49,7 @@ public:
required_shared_ptr<UINT16> m_dsp_ram; // Shared 68000/TMS32025 RAM
required_shared_ptr<UINT16> m_paletteram;
required_shared_ptr<UINT16> m_gradram;
- required_shared_ptr<UINT16> m_backregs;
+ required_shared_ptr<UINT16> m_tc0430grw;
/* video-related */
taitoair_poly m_q;
@@ -74,6 +74,37 @@ public:
INT16 m_frustumBottom;
INT16 m_eyecoordBuffer[4]; /* homogeneous */
+ bool m_gradbank;
+
+ DECLARE_READ16_MEMBER(dsp_m_r);
+ DECLARE_WRITE16_MEMBER(dsp_m_w);
+
+ UINT16 m_dsp_test_object_type;
+ INT16 m_dsp_test_or_clip, m_dsp_test_and_clip;
+ INT16 m_dsp_test_x, m_dsp_test_y, m_dsp_test_z;
+
+ DECLARE_WRITE16_MEMBER(dsp_test_start_w);
+ DECLARE_WRITE16_MEMBER(dsp_test_x_w);
+ DECLARE_WRITE16_MEMBER(dsp_test_y_w);
+ DECLARE_WRITE16_MEMBER(dsp_test_z_w);
+ DECLARE_READ16_MEMBER(dsp_test_point_r);
+ DECLARE_READ16_MEMBER(dsp_test_or_clip_r);
+ DECLARE_READ16_MEMBER(dsp_test_and_clip_r);
+
+ INT16 m_dsp_muldiv_a_1, m_dsp_muldiv_b_1, m_dsp_muldiv_c_1;
+
+ DECLARE_WRITE16_MEMBER(dsp_muldiv_a_1_w);
+ DECLARE_WRITE16_MEMBER(dsp_muldiv_b_1_w);
+ DECLARE_WRITE16_MEMBER(dsp_muldiv_c_1_w);
+ DECLARE_READ16_MEMBER(dsp_muldiv_1_r);
+
+ INT16 m_dsp_muldiv_a_2, m_dsp_muldiv_b_2, m_dsp_muldiv_c_2;
+
+ DECLARE_WRITE16_MEMBER(dsp_muldiv_a_2_w);
+ DECLARE_WRITE16_MEMBER(dsp_muldiv_b_2_w);
+ DECLARE_WRITE16_MEMBER(dsp_muldiv_c_2_w);
+ DECLARE_READ16_MEMBER(dsp_muldiv_2_r);
+
//bitmap_ind16 *m_buffer3d;
DECLARE_WRITE16_MEMBER(system_control_w);
DECLARE_READ16_MEMBER(lineram_r);
@@ -88,22 +119,19 @@ public:
DECLARE_READ16_MEMBER(stick2_input_r);
DECLARE_WRITE8_MEMBER(sound_bankswitch_w);
DECLARE_WRITE16_MEMBER(dsp_flags_w);
- DECLARE_WRITE16_MEMBER(dsp_x_eyecoord_w);
- DECLARE_WRITE16_MEMBER(dsp_y_eyecoord_w);
- DECLARE_WRITE16_MEMBER(dsp_z_eyecoord_w);
- DECLARE_WRITE16_MEMBER(dsp_frustum_left_w);
- DECLARE_WRITE16_MEMBER(dsp_frustum_bottom_w);
- DECLARE_WRITE16_MEMBER(dsp_rasterize_w);
- DECLARE_READ16_MEMBER(dsp_x_return_r);
- DECLARE_READ16_MEMBER(dsp_y_return_r);
+ DECLARE_WRITE16_MEMBER(dma_regs_w);
+
virtual void machine_start();
virtual void machine_reset();
virtual void video_start();
UINT32 screen_update_taitoair(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int priority );
- void fill_slope( bitmap_ind16 &bitmap, const rectangle &cliprect, int color, INT32 x1, INT32 x2, INT32 sl1, INT32 sl2, INT32 y1, INT32 y2, INT32 *nx1, INT32 *nx2 );
- void multVecMtx(const INT16* vec4, const float* m, float* result);
- void airInfernoFrustum(const INT16 leftExtent, const INT16 bottomExtent, float* m);
+ int draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect );
+ int draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int start_offset );
+ void fb_copy_op(void);
+ void fb_fill_op(void);
+ void fb_erase_op(void);
+
+ void fill_slope( bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16 header, INT32 x1, INT32 x2, INT32 sl1, INT32 sl2, INT32 y1, INT32 y2, INT32 *nx1, INT32 *nx2 );
void fill_poly( bitmap_ind16 &bitmap, const rectangle &cliprect, const struct taitoair_poly *q );
int projectEyeCoordToScreen(float* projectionMatrix,const int Res,INT16* eyePoint3d,int type);
DECLARE_WRITE_LINE_MEMBER(irqhandler);
diff --git a/src/mame/includes/taitoipt.h b/src/mame/includes/taitoipt.h
index 7e79c8c2725..d41f6d05322 100644
--- a/src/mame/includes/taitoipt.h
+++ b/src/mame/includes/taitoipt.h
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:David Graves, Bryan McPhail, Brad Oliver, Andrew Prime, Brian Troha, Nicola Salmoria
/*******************************************************************************
diff --git a/src/mame/includes/toaplan2.h b/src/mame/includes/toaplan2.h
index 354758b4002..85e5ccc0a0d 100644
--- a/src/mame/includes/toaplan2.h
+++ b/src/mame/includes/toaplan2.h
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Quench, Yochizo, David Haywood
/**************** Machine stuff ******************/
//#define USE_HD64x180 /* Define if CPU support is available */
diff --git a/src/mame/includes/topspeed.h b/src/mame/includes/topspeed.h
index efecd20ac9d..b0ade884b72 100644
--- a/src/mame/includes/topspeed.h
+++ b/src/mame/includes/topspeed.h
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:David Graves
/*************************************************************************
diff --git a/src/mame/includes/turbo.h b/src/mame/includes/turbo.h
index d2d72d99b22..c982ca3b7e4 100644
--- a/src/mame/includes/turbo.h
+++ b/src/mame/includes/turbo.h
@@ -34,6 +34,7 @@ public:
m_videoram(*this, "videoram"),
m_spriteram(*this, "spriteram"),
m_sprite_position(*this, "spritepos"),
+ m_decrypted_opcodes(*this, "decrypted_opcodes"),
m_samples(*this, "samples"),
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen")
@@ -55,6 +56,7 @@ public:
required_shared_ptr<UINT8> m_videoram;
required_shared_ptr<UINT8> m_spriteram;
required_shared_ptr<UINT8> m_sprite_position;
+ optional_shared_ptr<UINT8> m_decrypted_opcodes;
required_device<samples_device> m_samples;
diff --git a/src/mame/includes/tx1.h b/src/mame/includes/tx1.h
index 235d564437f..0f4b5bf9f29 100644
--- a/src/mame/includes/tx1.h
+++ b/src/mame/includes/tx1.h
@@ -56,9 +56,9 @@ struct sn74s516_t
union
{
#ifdef LSB_FIRST
- struct { UINT16 W; INT16 Z; };
+ struct { UINT16 W; INT16 Z; } as16bit;
#else
- struct { INT16 Z; UINT16 W; };
+ struct { INT16 Z; UINT16 W; } as16bit;
#endif
INT32 ZW32;
} ZW;
@@ -241,9 +241,9 @@ struct pit8253_state
union
{
#ifdef LSB_FIRST
- struct { UINT8 LSB; UINT8 MSB; };
+ struct { UINT8 LSB; UINT8 MSB; } as8bit;
#else
- struct { UINT8 MSB; UINT8 LSB; };
+ struct { UINT8 MSB; UINT8 LSB; } as8bit;
#endif
UINT16 val;
} counts[3];
diff --git a/src/mame/includes/undrfire.h b/src/mame/includes/undrfire.h
index 982e91f5ae7..4060c0a543d 100644
--- a/src/mame/includes/undrfire.h
+++ b/src/mame/includes/undrfire.h
@@ -1,10 +1,10 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Bryan McPhail, David Graves
#include "machine/eepromser.h"
#include "video/tc0100scn.h"
#include "video/tc0480scp.h"
-struct tempsprite
+struct uf_tempsprite
{
int gfx;
int code,color;
@@ -45,7 +45,7 @@ public:
UINT16 m_coin_word;
UINT16 m_port_sel;
int m_frame_counter;
- struct tempsprite *m_spritelist;
+ struct uf_tempsprite *m_spritelist;
UINT16 m_rotate_ctrl[8];
UINT8 m_dislayer[6];
required_shared_ptr<UINT32> m_spriteram;
diff --git a/src/mame/includes/vastar.h b/src/mame/includes/vastar.h
index bc9edc51d7e..24a4c4f3630 100644
--- a/src/mame/includes/vastar.h
+++ b/src/mame/includes/vastar.h
@@ -5,15 +5,20 @@ class vastar_state : public driver_device
public:
vastar_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_subcpu(*this, "sub"),
+ m_gfxdecode(*this, "gfxdecode"),
+ m_palette(*this, "palette"),
m_bg1videoram(*this, "bg1videoram"),
m_bg2videoram(*this, "bg2videoram"),
m_fgvideoram(*this, "fgvideoram"),
m_sprite_priority(*this, "sprite_priority"),
- m_sharedram(*this, "sharedram"),
- m_maincpu(*this, "maincpu"),
- m_subcpu(*this, "sub"),
- m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette") { }
+ m_sharedram(*this, "sharedram") { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<cpu_device> m_subcpu;
+ required_device<gfxdecode_device> m_gfxdecode;
+ required_device<palette_device> m_palette;
required_shared_ptr<UINT8> m_bg1videoram;
required_shared_ptr<UINT8> m_bg2videoram;
@@ -31,25 +36,25 @@ public:
tilemap_t *m_fg_tilemap;
tilemap_t *m_bg1_tilemap;
tilemap_t *m_bg2_tilemap;
-
-
UINT8 m_nmi_mask;
- DECLARE_WRITE8_MEMBER(vastar_hold_cpu2_w);
+
+ DECLARE_WRITE8_MEMBER(hold_cpu2_w);
DECLARE_WRITE8_MEMBER(flip_screen_w);
DECLARE_WRITE8_MEMBER(nmi_mask_w);
- DECLARE_WRITE8_MEMBER(vastar_fgvideoram_w);
- DECLARE_WRITE8_MEMBER(vastar_bg1videoram_w);
- DECLARE_WRITE8_MEMBER(vastar_bg2videoram_w);
+ DECLARE_WRITE8_MEMBER(fgvideoram_w);
+ DECLARE_WRITE8_MEMBER(bg1videoram_w);
+ DECLARE_WRITE8_MEMBER(bg2videoram_w);
+
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();
virtual void machine_reset();
virtual void video_start();
- UINT32 screen_update_vastar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- INTERRUPT_GEN_MEMBER(vblank_irq);
+
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect);
- required_device<cpu_device> m_maincpu;
- required_device<cpu_device> m_subcpu;
- required_device<gfxdecode_device> m_gfxdecode;
- required_device<palette_device> m_palette;
+
+ INTERRUPT_GEN_MEMBER(vblank_irq);
};
diff --git a/src/mame/includes/vicdual.h b/src/mame/includes/vicdual.h
index f183d8c72a7..4c2fe9801a2 100644
--- a/src/mame/includes/vicdual.h
+++ b/src/mame/includes/vicdual.h
@@ -23,9 +23,9 @@ public:
m_discrete(*this, "discrete"),
m_coinstate_timer(*this, "coinstate"),
m_nsub_coinage_timer(*this, "nsub_coin"),
+ m_screen(*this, "screen"),
m_videoram(*this, "videoram"),
- m_characterram(*this, "characterram"),
- m_screen(*this, "screen")
+ m_characterram(*this, "characterram")
{ }
required_device<cpu_device> m_maincpu;
@@ -35,25 +35,30 @@ public:
optional_device<discrete_device> m_discrete;
required_device<timer_device> m_coinstate_timer;
optional_device<timer_device> m_nsub_coinage_timer;
+ required_device<screen_device> m_screen;
+
required_shared_ptr<UINT8> m_videoram;
required_shared_ptr<UINT8> m_characterram;
- required_device<screen_device> m_screen;
UINT8 m_coin_status;
UINT8 m_palette_bank;
UINT8 m_samurai_protection_data;
int m_nsub_coin_counter;
int m_nsub_play_counter;
-
int m_port1State;
int m_port2State;
int m_psgData;
+ emu_timer *m_frogs_croak_timer;
void coin_in();
void assert_coin_status();
- DECLARE_WRITE8_MEMBER(vicdual_videoram_w);
- DECLARE_WRITE8_MEMBER(vicdual_characterram_w);
+ // common
+ DECLARE_WRITE8_MEMBER(videoram_w);
+ DECLARE_WRITE8_MEMBER(characterram_w);
+ DECLARE_WRITE8_MEMBER(palette_bank_w);
+
+ // game specific
DECLARE_READ8_MEMBER(depthch_io_r);
DECLARE_WRITE8_MEMBER(depthch_io_w);
DECLARE_READ8_MEMBER(safari_io_r);
@@ -83,7 +88,6 @@ public:
DECLARE_WRITE8_MEMBER(nsub_io_w);
DECLARE_READ8_MEMBER(invinco_io_r);
DECLARE_WRITE8_MEMBER(invinco_io_w);
- DECLARE_WRITE8_MEMBER(vicdual_palette_bank_w);
/*----------- defined in audio/vicdual.c -----------*/
DECLARE_WRITE8_MEMBER( frogs_audio_w );
@@ -109,12 +113,12 @@ public:
DECLARE_WRITE8_MEMBER( pulsar_audio_1_w );
DECLARE_WRITE8_MEMBER( pulsar_audio_2_w );
- DECLARE_CUSTOM_INPUT_MEMBER(vicdual_read_coin_status);
- DECLARE_CUSTOM_INPUT_MEMBER(vicdual_get_64v);
- DECLARE_CUSTOM_INPUT_MEMBER(vicdual_get_vblank_comp);
- DECLARE_CUSTOM_INPUT_MEMBER(vicdual_get_composite_blank_comp);
- DECLARE_CUSTOM_INPUT_MEMBER(vicdual_get_timer_value);
- DECLARE_CUSTOM_INPUT_MEMBER(vicdual_fake_lives_r);
+ DECLARE_CUSTOM_INPUT_MEMBER(read_coin_status);
+ DECLARE_CUSTOM_INPUT_MEMBER(get_64v);
+ DECLARE_CUSTOM_INPUT_MEMBER(get_vblank_comp);
+ DECLARE_CUSTOM_INPUT_MEMBER(get_composite_blank_comp);
+ DECLARE_CUSTOM_INPUT_MEMBER(get_timer_value);
+ DECLARE_CUSTOM_INPUT_MEMBER(fake_lives_r);
DECLARE_CUSTOM_INPUT_MEMBER(samurai_protection_r);
DECLARE_INPUT_CHANGED_MEMBER(coin_changed);
DECLARE_INPUT_CHANGED_MEMBER(nsub_coin_in);
@@ -128,13 +132,12 @@ public:
DECLARE_MACHINE_START(frogs_audio);
virtual void machine_start();
- virtual void machine_reset();
- UINT32 screen_update_vicdual_bw(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
- UINT32 screen_update_vicdual_bw_or_color(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
- UINT32 screen_update_vicdual_color(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
+ UINT32 screen_update_bw(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
+ UINT32 screen_update_bw_or_color(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
+ UINT32 screen_update_color(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
int get_vcounter();
- int vicdual_is_cabinet_color();
+ int is_cabinet_color();
};
MACHINE_CONFIG_EXTERN( carnival_audio );
diff --git a/src/mame/includes/warpwarp.h b/src/mame/includes/warpwarp.h
index da3eb75ac29..d50cf1cef5f 100644
--- a/src/mame/includes/warpwarp.h
+++ b/src/mame/includes/warpwarp.h
@@ -8,19 +8,20 @@ public:
warpwarp_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
+ m_gfxdecode(*this, "gfxdecode"),
m_warpwarp_sound(*this, "warpwarp_custom"),
m_geebee_sound(*this, "geebee_custom"),
m_geebee_videoram(*this, "geebee_videoram"),
- m_videoram(*this, "videoram"),
- m_gfxdecode(*this, "gfxdecode")
+ m_videoram(*this, "videoram")
{ }
required_device<cpu_device> m_maincpu;
+ required_device<gfxdecode_device> m_gfxdecode;
optional_device<warpwarp_sound_device> m_warpwarp_sound;
optional_device<geebee_sound_device> m_geebee_sound;
optional_shared_ptr<UINT8> m_geebee_videoram;
optional_shared_ptr<UINT8> m_videoram;
- required_device<gfxdecode_device> m_gfxdecode;
+
int m_geebee_bgw;
int m_ball_on;
int m_ball_h;
@@ -30,16 +31,22 @@ public:
int m_ball_sizey;
int m_handle_joystick;
tilemap_t *m_bg_tilemap;
- DECLARE_READ8_MEMBER(geebee_in_r);
- DECLARE_WRITE8_MEMBER(geebee_out6_w);
- DECLARE_WRITE8_MEMBER(geebee_out7_w);
+
+ // warpwarp and bombbee
DECLARE_READ8_MEMBER(warpwarp_sw_r);
DECLARE_WRITE8_MEMBER(warpwarp_out0_w);
DECLARE_WRITE8_MEMBER(warpwarp_out3_w);
- DECLARE_WRITE8_MEMBER(geebee_videoram_w);
DECLARE_WRITE8_MEMBER(warpwarp_videoram_w);
DECLARE_READ8_MEMBER(warpwarp_dsw1_r);
DECLARE_READ8_MEMBER(warpwarp_vol_r);
+
+ //geebee and navarone
+ DECLARE_READ8_MEMBER(geebee_in_r);
+ DECLARE_WRITE8_MEMBER(geebee_out6_w);
+ DECLARE_WRITE8_MEMBER(geebee_out7_w);
+ DECLARE_WRITE8_MEMBER(geebee_videoram_w);
+
+ virtual void machine_start();
DECLARE_DRIVER_INIT(navarone);
DECLARE_DRIVER_INIT(geebee);
DECLARE_DRIVER_INIT(kaitein);
@@ -47,18 +54,21 @@ public:
DECLARE_DRIVER_INIT(sos);
DECLARE_DRIVER_INIT(kaitei);
DECLARE_DRIVER_INIT(bombbee);
- TILEMAP_MAPPER_MEMBER(tilemap_scan);
- TILE_GET_INFO_MEMBER(geebee_get_tile_info);
- TILE_GET_INFO_MEMBER(navarone_get_tile_info);
- TILE_GET_INFO_MEMBER(warpwarp_get_tile_info);
DECLARE_VIDEO_START(geebee);
DECLARE_PALETTE_INIT(geebee);
DECLARE_VIDEO_START(warpwarp);
DECLARE_PALETTE_INIT(warpwarp);
DECLARE_VIDEO_START(navarone);
DECLARE_PALETTE_INIT(navarone);
- UINT32 screen_update_geebee(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- INTERRUPT_GEN_MEMBER(vblank_irq);
- inline void geebee_plot(bitmap_ind16 &bitmap, const rectangle &cliprect, int x, int y, pen_t pen);
+
+ TILEMAP_MAPPER_MEMBER(tilemap_scan);
+ TILE_GET_INFO_MEMBER(geebee_get_tile_info);
+ TILE_GET_INFO_MEMBER(navarone_get_tile_info);
+ TILE_GET_INFO_MEMBER(warpwarp_get_tile_info);
+
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ inline void plot(bitmap_ind16 &bitmap, const rectangle &cliprect, int x, int y, pen_t pen);
void draw_ball(bitmap_ind16 &bitmap, const rectangle &cliprect,pen_t pen);
+
+ INTERRUPT_GEN_MEMBER(vblank_irq);
};
diff --git a/src/mame/includes/warriorb.h b/src/mame/includes/warriorb.h
index e1b12476c39..9040c66b46c 100644
--- a/src/mame/includes/warriorb.h
+++ b/src/mame/includes/warriorb.h
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:David Graves
/*************************************************************************
diff --git a/src/mame/includes/wgp.h b/src/mame/includes/wgp.h
index cde714d9dd3..6f2416a4326 100644
--- a/src/mame/includes/wgp.h
+++ b/src/mame/includes/wgp.h
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:David Graves
/*************************************************************************
diff --git a/src/mame/includes/wiz.h b/src/mame/includes/wiz.h
index 4b132a697c5..e68dd786b0d 100644
--- a/src/mame/includes/wiz.h
+++ b/src/mame/includes/wiz.h
@@ -25,7 +25,8 @@ public:
m_attrram(*this, "attrram"),
m_attrram2(*this, "attrram2"),
m_spriteram(*this, "spriteram"),
- m_spriteram2(*this, "spriteram2")
+ m_spriteram2(*this, "spriteram2"),
+ m_decrypted_opcodes(*this, "decrypted_opcodes")
{ }
required_device<cpu_device> m_maincpu;
@@ -42,6 +43,7 @@ public:
required_shared_ptr<UINT8> m_attrram2;
required_shared_ptr<UINT8> m_spriteram;
required_shared_ptr<UINT8> m_spriteram2;
+ optional_shared_ptr<UINT8> m_decrypted_opcodes;
INT32 m_flipx;
INT32 m_flipy;
diff --git a/src/mame/includes/zaxxon.h b/src/mame/includes/zaxxon.h
index e89aeacea1b..ffea0ee6c61 100644
--- a/src/mame/includes/zaxxon.h
+++ b/src/mame/includes/zaxxon.h
@@ -19,7 +19,8 @@ public:
m_dials(*this, "DIAL"),
m_videoram(*this, "videoram"),
m_spriteram(*this, "spriteram"),
- m_colorram(*this, "colorram") { }
+ m_colorram(*this, "colorram"),
+ m_decrypted_opcodes(*this, "decrypted_opcodes") { }
required_device<cpu_device> m_maincpu;
optional_device<samples_device> m_samples;
@@ -31,6 +32,7 @@ public:
required_shared_ptr<UINT8> m_videoram;
optional_shared_ptr<UINT8> m_spriteram;
optional_shared_ptr<UINT8> m_colorram;
+ optional_shared_ptr<UINT8> m_decrypted_opcodes;
UINT8 m_int_enabled;
UINT8 m_coin_status[3];
diff --git a/src/mame/layout/chsuper.lay b/src/mame/layout/chsuper.lay
index c3a385ebb24..7fa3f452215 100644
--- a/src/mame/layout/chsuper.lay
+++ b/src/mame/layout/chsuper.lay
@@ -173,7 +173,7 @@
<color red="0.1" green="0.05" blue="0.0" />
</rect>
</element>
-
+
<element name="start_b" defstate="0">
<rect state="1">
<color red="0.0" green="0.8" blue="0.0" />
@@ -257,6 +257,6 @@
<bezel name="lamp6" element="start" inputtag="IN0" inputmask="0x08">
<bounds x="3.57" y="3.07" width="0.31" height="0.20" />
</bezel>
-
+
</view>
</mamelayout>
diff --git a/src/mame/layout/radr.lay b/src/mame/layout/radr.lay
index 799496138de..29b5a3e4f48 100644
--- a/src/mame/layout/radr.lay
+++ b/src/mame/layout/radr.lay
@@ -52,7 +52,7 @@
<screen index="0">
<bounds x="0" y="0" width="640" height="480" />
</screen>
- <bezel element="shifter" inputtag="P1_A" inputmask="0x01">
+ <bezel element="shifter" inputtag="mainpcb:P1_A" inputmask="0x01">
<bounds x="606" y="414" width="32" height="64" />
<color alpha="0.6" />
</bezel>
@@ -61,7 +61,7 @@
<screen index="0">
<bounds x="0" y="0" width="640" height="480" />
</screen>
- <bezel element="shifter" inputtag="P1_A" inputmask="0x01">
+ <bezel element="shifter" inputtag="mainpcb:P1_A" inputmask="0x01">
<bounds x="2" y="414" width="32" height="64" />
<color alpha="0.6" />
</bezel>
diff --git a/src/mame/layout/superbug.lay b/src/mame/layout/superbug.lay
index 80dd0549bad..1672c4d6724 100644
--- a/src/mame/layout/superbug.lay
+++ b/src/mame/layout/superbug.lay
@@ -3,7 +3,10 @@
<!-- NOTE: highlight should be a bit star-shaped, not doable in MAME internal layout -->
- <element name="highlight_explosion"><disk><color red="0.875" green="1.0" blue="0.125" /></disk></element>
+ <element name="highlight_explosion">
+ <rect><color red="1.0" green="1.0" blue="1.0" /></rect>
+ <disk><color red="0.875" green="1.0" blue="0.125" /></disk>
+ </element>
<element name="static_green"><rect><color red="0.125" green="0.875" blue="0" /></rect></element>
diff --git a/src/mame/machine/315-5838_317-0229_comp.h b/src/mame/machine/315-5838_317-0229_comp.h
index 74cf265ebbe..4584cd96203 100644
--- a/src/mame/machine/315-5838_317-0229_comp.h
+++ b/src/mame/machine/315-5838_317-0229_comp.h
@@ -39,7 +39,7 @@ public:
}
DECLARE_READ32_MEMBER(decathlt_prot1_r);
- DECLARE_READ32_MEMBER(decathlt_prot2_r);;
+ DECLARE_READ32_MEMBER(decathlt_prot2_r);
UINT32 genericdecathlt_prot_r(UINT32 mem_mask, int channel);
void write_prot_data(UINT32 data, UINT32 mem_mask, int channel, int rev_words);
diff --git a/src/mame/machine/atarigen.h b/src/mame/machine/atarigen.h
index 69ca704078b..208e103fd19 100644
--- a/src/mame/machine/atarigen.h
+++ b/src/mame/machine/atarigen.h
@@ -218,7 +218,7 @@ private:
{
TID_SCANLINE_INT,
TID_TILEROW_UPDATE,
- TID_EOF,
+ TID_EOF
};
// internal helpers
diff --git a/src/mame/machine/awboard.c b/src/mame/machine/awboard.c
index b94a170ae48..8f0c575e5be 100644
--- a/src/mame/machine/awboard.c
+++ b/src/mame/machine/awboard.c
@@ -3,6 +3,7 @@
#include "emu.h"
#include "awboard.h"
+#include <algorithm>
/*
@@ -70,6 +71,56 @@ Atomiswave ROM board specs from Cah4e3 @ http://cah4e3.wordpress.com/2009/07/26/
from AW_MPR_FIRST_FILE_INDEX register. Cannot be used for reading EPR-ROM
data nor even MPR-ROM file system sub-area data.
+ AW_PIO_DATA Register addres: 0x5f7080
+ +-------------------------------------------------------------------------------+
+ | bit15-0 |
+ +-------------------------------------------------------------------------------+
+ | Read/Write word from/to ROM board address space |
+ +-------------------------------------------------------------------------------+
+
+ Using this register data can be read or written to ROM BD at AW_EPR_OFFSET directly,
+ decryption is not used, flash ROMs (re)programming via CFI commands possible.
+
+ Type 2 ROM BD have MPR_BANK register at AW_EPR_OFFSET 007fffff, which selects
+ 1 of 4 mask ROM banks.
+
+ROM board internal layouts:
+
+ Type 1:
+
+ 00000000 - 00800000 IC18 flash ROM
+ 00800000 - 01000000 unk, probably mirror of above
+ 01000000 - 02000000 IC10 \
+ ..... mask ROMs
+ 07000000 - 08000000 IC17 /
+
+ Type 2:
+
+ 00000000 - 00800000 FMEM1 flash ROM
+ 00800000 - 01000000 FMEM2 flash ROM
+ 01000000 - 02000000 unk, probably mirror of above
+ 02000000 - 04000000 MROM1 MROM4 MROM7 MROM10 \
+ 04000000 - 06000000 MROM2 MROM5 MROM8 MROM11 banked mask ROMs
+ 06000000 - 08000000 MROM3 MROM6 MROM9 MROM12 /
+
+ Type 3:
+
+ 00000000 - 01000000 U3 flash ROM
+ 01000000 - 02000000 U1 flash ROM
+ 02000000 - 03000000 U4 flash ROM
+ 03000000 - 04000000 U2 flash ROM
+ 04000000 - 05000000 U15 flash ROM
+ 05000000 - 06000000 U17 flash ROM
+ 06000000 - 07000000 U14 flash ROM
+ 07000000 - 08000000 U16 flash ROM
+
+ Development:
+
+ 00000000 - 00800000 IC12 \
+ ..... flash ROMs
+ 07800000 - 08000000 IC27 /
+
+
In short:
EPR-ROM
@@ -116,7 +167,6 @@ ADDRESS_MAP_END
aw_rom_board::aw_rom_board(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: naomi_g1_device(mconfig, AW_ROM_BOARD, "Sammy Atomiswave ROM Board", tag, owner, clock, "aw_rom_board", __FILE__)
{
- region_is_decrypted = false;
keyregion = 0;
}
@@ -188,7 +238,7 @@ UINT16 aw_rom_board::decrypt(UINT16 cipherText, UINT32 address, const UINT32 key
aux = BITSWAP16(cipherText,
pbox[15],pbox[14],pbox[13],pbox[12],pbox[11],pbox[10],pbox[9],pbox[8],
pbox[7],pbox[6],pbox[5],pbox[4],pbox[3],pbox[2],pbox[1],pbox[0]);
- aux = aux ^ BITSWAP16(address >> 1, 13,5,2, 14,10,9,4, 15,11,6,1, 12,8,7,3,0);
+ aux = aux ^ BITSWAP16(address, 13,5,2, 14,10,9,4, 15,11,6,1, 12,8,7,3,0);
b0 = aux&0x1f;
b1 = (aux>>5)&0xf;
@@ -203,12 +253,8 @@ UINT16 aw_rom_board::decrypt(UINT16 cipherText, UINT32 address, const UINT32 key
return ((b3<<13)|(b2<<9)|(b1<<5)|b0)^(key&0xffff);
}
-void aw_rom_board::decrypt_region()
+void aw_rom_board::set_key()
{
- if(region_is_decrypted)
- return;
- region_is_decrypted = true;
-
if(!m_region)
throw emu_fatalerror("AW-ROM-BOARD: region %s is missing\n", tag());
@@ -223,17 +269,15 @@ void aw_rom_board::decrypt_region()
throw emu_fatalerror("AW-ROM-BOARD: key region %s has incorrect size (%d, expected 4)\n", keyregion, kr->bytes());
const UINT8 *krp = kr->base();
- UINT32 key = (krp[0] << 24) | (krp[1] << 16) | (krp[2] << 8) | krp[3];
- UINT16 *src = (UINT16 *)m_region->base();
- UINT32 rom_size = m_region->bytes();
- for(UINT32 i=0; i<rom_size/2; i++)
- src[i] = decrypt(src[i], i*2, key);
+ rombd_key = (krp[0] << 24) | (krp[1] << 16) | (krp[2] << 8) | krp[3];
}
void aw_rom_board::device_start()
{
naomi_g1_device::device_start();
- decrypt_region();
+ set_key();
+
+ mpr_offset = decrypt16(0x58/2) | (decrypt16(0x5a/2) << 16);
save_item(NAME(epr_offset));
save_item(NAME(mpr_record_index));
@@ -241,7 +285,7 @@ void aw_rom_board::device_start()
save_item(NAME(mpr_file_offset));
save_item(NAME(dma_offset));
save_item(NAME(dma_limit));
- save_item(NAME(adjust_off));
+ save_item(NAME(mpr_bank));
}
void aw_rom_board::device_reset()
@@ -251,7 +295,7 @@ void aw_rom_board::device_reset()
mpr_record_index = 0;
mpr_first_file_index = 0;
mpr_file_offset = 0;
- adjust_off = 0;
+ mpr_bank = 0;
dma_offset = 0;
dma_limit = 0;
@@ -259,8 +303,10 @@ void aw_rom_board::device_reset()
READ16_MEMBER(aw_rom_board::pio_r)
{
- // FIXME: this must return original encrypted data, used by Extreme Hunt 2 in ROM TEST
- UINT16 retval = m_region->u16(epr_offset * 2);
+ UINT32 roffset = epr_offset & 0x3ffffff;
+ if (roffset >= (mpr_offset / 2))
+ roffset += mpr_bank * 0x4000000;
+ UINT16 retval = (m_region->bytes() > roffset) ? m_region->u16(roffset) : 0;
epr_offset++;
return retval;
}
@@ -268,8 +314,8 @@ READ16_MEMBER(aw_rom_board::pio_r)
WRITE16_MEMBER(aw_rom_board::pio_w)
{
// write to ROM board address space, including FlashROM programming using CFI (TODO)
- if (epr_offset == 0x7fffff) // special register which changes ROMBD addressing
- adjust_off = data;
+ if (epr_offset == 0x7fffff)
+ mpr_bank = data & 3;
epr_offset++;
}
@@ -305,7 +351,7 @@ WRITE16_MEMBER(aw_rom_board::mpr_file_offsetl_w)
WRITE16_MEMBER(aw_rom_board::mpr_file_offseth_w)
{
- mpr_file_offset = ((mpr_file_offset & 0x0000ffff) | ((data -(adjust_off*0x0100))<< 16));
+ mpr_file_offset = (mpr_file_offset & 0x0000ffff) | (data << 16);
recalc_dma_offset(MPR_FILE);
}
@@ -315,21 +361,28 @@ void aw_rom_board::recalc_dma_offset(int mode)
switch(mode) {
case EPR:
dma_offset = epr_offset * 2;
- dma_limit = 0x1000000;
+ dma_limit = mpr_offset;
break;
case MPR_RECORD:
- dma_offset = 0x1000000 + mpr_record_index * 0x40;
- dma_limit = m_region->bytes();
+ dma_offset = mpr_offset + mpr_record_index * 0x40;
+ dma_limit = std::min((UINT32)0x8000000, m_region->bytes());
break;
case MPR_FILE: {
- const UINT8 *entry = m_region->base() + 0x1000000 + mpr_first_file_index * 0x40;
- dma_offset = 0x1000000 + (entry[8] | (entry[9] << 8) | (entry[10] << 16) | (entry[11] << 24)) + mpr_file_offset*2;
- dma_limit = m_region->bytes();
+ UINT32 filedata_offs = (mpr_bank * 0x8000000 + mpr_offset + mpr_first_file_index * 0x40 + 8) / 2;
+ dma_offset = decrypt16(filedata_offs) | (decrypt16(filedata_offs + 1) << 16);
+ dma_offset = (mpr_offset + dma_offset + mpr_file_offset * 2) & 0x7ffffff;
+ dma_limit = std::min((UINT32)0x8000000, m_region->bytes());
break;
}
}
+
+ if (dma_offset >= mpr_offset) {
+ UINT32 bank_base = mpr_bank * 0x8000000;
+ dma_offset += bank_base;
+ dma_limit = std::min(dma_limit + bank_base, m_region->bytes());
+ }
}
void aw_rom_board::dma_get_position(UINT8 *&base, UINT32 &limit, bool to_mainram)
@@ -340,8 +393,11 @@ void aw_rom_board::dma_get_position(UINT8 *&base, UINT32 &limit, bool to_mainram
return;
}
- limit = dma_limit - dma_offset;
- base = m_region->base() + dma_offset;
+ UINT32 offset = dma_offset / 2;
+ for (int i = 0; i < 16; i++)
+ decrypted_buf[i] = decrypt16(offset + i);
+ base = (UINT8*)decrypted_buf;
+ limit = 32;
}
void aw_rom_board::dma_advance(UINT32 size)
diff --git a/src/mame/machine/awboard.h b/src/mame/machine/awboard.h
index b6ad34fd0a8..b1008762ba8 100644
--- a/src/mame/machine/awboard.h
+++ b/src/mame/machine/awboard.h
@@ -38,10 +38,11 @@ private:
enum { EPR, MPR_RECORD, MPR_FILE };
const char *keyregion;
- bool region_is_decrypted;
-
+ UINT32 rombd_key;
+ UINT32 mpr_offset, mpr_bank;
UINT32 epr_offset, mpr_file_offset;
- UINT16 mpr_record_index, mpr_first_file_index, adjust_off;
+ UINT16 mpr_record_index, mpr_first_file_index;
+ UINT16 decrypted_buf[16];
UINT32 dma_offset, dma_limit;
@@ -55,8 +56,9 @@ private:
static const int permutation_table[4][16];
static const sbox_set sboxes_table[4];
static UINT16 decrypt(UINT16 cipherText, UINT32 address, const UINT32 key);
+ UINT16 decrypt16(UINT32 address) { return decrypt(m_region->u16(address), address, rombd_key); }
- void decrypt_region();
+ void set_key();
void recalc_dma_offset(int mode);
};
diff --git a/src/mame/machine/bublbobl.c b/src/mame/machine/bublbobl.c
index 5fb2ad4e140..84a3a6c125b 100644
--- a/src/mame/machine/bublbobl.c
+++ b/src/mame/machine/bublbobl.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Chris Moore, Nicola Salmoria
/***************************************************************************
diff --git a/src/mame/machine/cclimber.c b/src/mame/machine/cclimber.c
index 803d1c00947..8eb1b531d63 100644
--- a/src/mame/machine/cclimber.c
+++ b/src/mame/machine/cclimber.c
@@ -8,14 +8,9 @@
void cclimber_state::cclimber_decode(const UINT8 convtable[8][16])
{
- address_space &space = m_maincpu->space(AS_PROGRAM);
UINT8 *rom = memregion("maincpu")->base();
- UINT8 *decrypt = auto_alloc_array(machine(), UINT8, 0x10000);
- int A;
-
- space.set_decrypted_region(0x0000, 0xffff, decrypt);
- for (A = 0x0000;A < 0x10000;A++)
+ for (int A = 0x0000;A < 0x6000;A++)
{
int i,j;
UINT8 src = rom[A];
@@ -28,7 +23,7 @@ void cclimber_state::cclimber_decode(const UINT8 convtable[8][16])
j = (src & 0x01) | ((src & 0x04) >> 1) | ((src & 0x10) >> 2) | ((src & 0x40) >> 3);
/* decode the opcodes */
- decrypt[A] = (src & 0xaa) | convtable[i][j];
+ m_decrypted_opcodes[A] = (src & 0xaa) | convtable[i][j];
}
}
diff --git a/src/mame/machine/cdicdic.c b/src/mame/machine/cdicdic.c
index 332f962b6fd..f3099930d1b 100644
--- a/src/mame/machine/cdicdic.c
+++ b/src/mame/machine/cdicdic.c
@@ -542,7 +542,7 @@ void cdicdic_device::sample_trigger()
if(m_decode_addr == 0xffff)
{
- verboselog(machine(), 0, "Decode stop requested, stopping playback\n" );
+ verboselog(machine(), 0, "%s", "Decode stop requested, stopping playback\n" );
m_audio_sample_timer->adjust(attotime::never);
return;
}
@@ -550,11 +550,11 @@ void cdicdic_device::sample_trigger()
if(!m_decode_delay)
{
// Indicate that data has been decoded
- verboselog(machine(), 0, "Flagging that audio data has been decoded\n" );
+ verboselog(machine(), 0, "%s", "Flagging that audio data has been decoded\n" );
m_audio_buffer |= 0x8000;
// Set the CDIC interrupt line
- verboselog(machine(), 0, "Setting CDIC interrupt line for soundmap decode\n" );
+ verboselog(machine(), 0, "%s", "Setting CDIC interrupt line for soundmap decode\n" );
state->m_maincpu->set_input_line_vector(M68K_IRQ_4, 128);
state->m_maincpu->set_input_line(M68K_IRQ_4, ASSERT_LINE);
}
@@ -576,7 +576,7 @@ void cdicdic_device::sample_trigger()
verboselog(machine(), 0, "Updated m_decode_addr, new value is %04x\n", m_decode_addr );
//// Delay for Frequency * (18*28*2*size in bytes) before requesting more data
- verboselog(machine(), 0, "Data is valid, setting up a new callback\n" );
+ verboselog(machine(), 0, "%s", "Data is valid, setting up a new callback\n" );
m_decode_period = attotime::from_hz(CDIC_SAMPLE_BUF_FREQ(m_ram, m_decode_addr & 0x3ffe)) * (18*28*2*CDIC_SAMPLE_BUF_SIZE(m_ram, m_decode_addr & 0x3ffe));
m_audio_sample_timer->adjust(m_decode_period);
//dmadac_enable(&dmadac[0], 2, 0);
@@ -586,7 +586,7 @@ void cdicdic_device::sample_trigger()
// Swap buffer positions to indicate our new buffer position at the next read
m_decode_addr ^= 0x1a00;
- verboselog(machine(), 0, "Data is not valid, indicating to shut down on the next audio sample\n" );
+ verboselog(machine(), 0, "%s", "Data is not valid, indicating to shut down on the next audio sample\n" );
m_decode_addr = 0xffff;
m_audio_sample_timer->adjust(m_decode_period);
}
@@ -695,7 +695,7 @@ void cdicdic_device::process_delayed_command()
if(((buffer[CDIC_SECTOR_SUBMODE2] & (CDIC_SUBMODE_FORM | CDIC_SUBMODE_DATA | CDIC_SUBMODE_AUDIO | CDIC_SUBMODE_VIDEO)) == (CDIC_SUBMODE_FORM | CDIC_SUBMODE_AUDIO)) &&
(m_channel & m_audio_channel & (1 << buffer[CDIC_SECTOR_CHAN2])))
{
- verboselog(machine(), 0, "Audio sector\n" );
+ verboselog(machine(), 0, "%s", "Audio sector\n" );
m_x_buffer |= 0x8000;
//m_data_buffer |= 0x4000;
@@ -709,7 +709,7 @@ void cdicdic_device::process_delayed_command()
decode_audio_sector(((UINT8*)m_ram) + ((m_data_buffer & 5) * 0xa00 + 4), 0);
//printf( "Setting CDIC interrupt line\n" );
- verboselog(machine(), 0, "Setting CDIC interrupt line for audio sector\n" );
+ verboselog(machine(), 0, "%s", "Setting CDIC interrupt line for audio sector\n" );
state->m_maincpu->set_input_line_vector(M68K_IRQ_4, 128);
state->m_maincpu->set_input_line(M68K_IRQ_4, ASSERT_LINE);
}
@@ -728,13 +728,13 @@ void cdicdic_device::process_delayed_command()
(buffer[CDIC_SECTOR_SUBMODE2] & CDIC_SUBMODE_EOF) == CDIC_SUBMODE_EOF)
{
//printf( "Setting CDIC interrupt line\n" );
- verboselog(machine(), 0, "Setting CDIC interrupt line for message sector\n" );
+ verboselog(machine(), 0, "%s", "Setting CDIC interrupt line for message sector\n" );
state->m_maincpu->set_input_line_vector(M68K_IRQ_4, 128);
state->m_maincpu->set_input_line(M68K_IRQ_4, ASSERT_LINE);
}
else
{
- verboselog(machine(), 0, "Message sector, ignored\n" );
+ verboselog(machine(), 0, "%s", "Message sector, ignored\n" );
}
}
else
@@ -748,7 +748,7 @@ void cdicdic_device::process_delayed_command()
}
//printf( "Setting CDIC interrupt line\n" );
- verboselog(machine(), 0, "Setting CDIC interrupt line for data sector\n" );
+ verboselog(machine(), 0, "%s", "Setting CDIC interrupt line for data sector\n" );
state->m_maincpu->set_input_line_vector(M68K_IRQ_4, 128);
state->m_maincpu->set_input_line(M68K_IRQ_4, ASSERT_LINE);
}
@@ -843,7 +843,7 @@ void cdicdic_device::process_delayed_command()
m_ram[(m_data_buffer & 5) * (0xa00/2) + (index - 6)] = (buffer[index*2] << 8) | buffer[index*2 + 1];
}
- verboselog(machine(), 0, "Setting CDIC interrupt line for CDDA sector\n" );
+ verboselog(machine(), 0, "%s", "Setting CDIC interrupt line for CDDA sector\n" );
state->m_maincpu->set_input_line_vector(M68K_IRQ_4, 128);
state->m_maincpu->set_input_line(M68K_IRQ_4, ASSERT_LINE);
break;
@@ -894,7 +894,7 @@ void cdicdic_device::process_delayed_command()
m_time = next_msf << 8;
- verboselog(machine(), 0, "Setting CDIC interrupt line for Seek sector\n" );
+ verboselog(machine(), 0, "%s", "Setting CDIC interrupt line for Seek sector\n" );
state->m_maincpu->set_input_line_vector(M68K_IRQ_4, 128);
state->m_maincpu->set_input_line(M68K_IRQ_4, ASSERT_LINE);
break;
@@ -944,7 +944,7 @@ READ16_MEMBER( cdicdic_device::regs_r )
if(!((m_audio_buffer | m_x_buffer) & 0x8000))
{
state->m_maincpu->set_input_line(M68K_IRQ_4, CLEAR_LINE);
- verboselog(machine(), 0, "Clearing CDIC interrupt line\n" );
+ verboselog(machine(), 0, "%s", "Clearing CDIC interrupt line\n" );
////printf("Clearing CDIC interrupt line\n" );
}
verboselog(machine(), 0, "cdic_r: Audio Buffer Register = %04x & %04x\n", temp, mem_mask);
@@ -958,7 +958,7 @@ READ16_MEMBER( cdicdic_device::regs_r )
if(!((m_audio_buffer | m_x_buffer) & 0x8000))
{
state->m_maincpu->set_input_line(M68K_IRQ_4, CLEAR_LINE);
- verboselog(machine(), 0, "Clearing CDIC interrupt line\n" );
+ verboselog(machine(), 0, "%s", "Clearing CDIC interrupt line\n" );
////printf("Clearing CDIC interrupt line\n" );
}
verboselog(machine(), 0, "cdic_r: X-Buffer Register = %04x & %04x\n", temp, mem_mask);
diff --git a/src/mame/machine/cdislave.c b/src/mame/machine/cdislave.c
index 4bfa5952115..99f9b73e753 100644
--- a/src/mame/machine/cdislave.c
+++ b/src/mame/machine/cdislave.c
@@ -56,7 +56,7 @@ TIMER_CALLBACK_MEMBER( cdislave_device::trigger_readback_int )
{
cdi_state *state = machine().driver_data<cdi_state>();
- verboselog(machine(), 0, "Asserting IRQ2\n" );
+ verboselog(machine(), 0, "%s", "Asserting IRQ2\n" );
state->m_maincpu->set_input_line_vector(M68K_IRQ_2, 26);
state->m_maincpu->set_input_line(M68K_IRQ_2, ASSERT_LINE);
m_interrupt_timer->adjust(attotime::never);
@@ -140,7 +140,7 @@ READ16_MEMBER( cdislave_device::slave_r )
case 0xf3:
case 0xf4:
case 0xf7:
- verboselog(machine(), 0, "slave_r: De-asserting IRQ2\n" );
+ verboselog(machine(), 0, "%s", "slave_r: De-asserting IRQ2\n" );
state->m_maincpu->set_input_line(M68K_IRQ_2, CLEAR_LINE);
break;
}
diff --git a/src/mame/machine/cps2crpt.c b/src/mame/machine/cps2crpt.c
index 9af7cf4d248..d8d41771203 100644
--- a/src/mame/machine/cps2crpt.c
+++ b/src/mame/machine/cps2crpt.c
@@ -632,12 +632,8 @@ static void optimise_sboxes(struct optimised_sbox* out, const struct sbox* in)
-static void cps2_decrypt(running_machine &machine, const UINT32 *master_key, UINT32 upper_limit)
+static void cps2_decrypt(running_machine &machine, UINT16 *rom, UINT16 *dec, int length, const UINT32 *master_key, UINT32 lower_limit, UINT32 upper_limit)
{
- address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- UINT16 *rom = (UINT16 *)machine.root_device().memregion("maincpu")->base();
- int length = machine.root_device().memregion("maincpu")->bytes();
- UINT16 *dec = auto_alloc_array(machine, UINT16, length/2);
int i;
UINT32 key1[4];
struct optimised_sbox sboxes1[4*4];
@@ -714,16 +710,13 @@ static void cps2_decrypt(running_machine &machine, const UINT32 *master_key, UIN
&sboxes2[0*4], &sboxes2[1*4], &sboxes2[2*4], &sboxes2[3*4],
key2[0], key2[1], key2[2], key2[3]);
}
- // copy the unencrypted part (not really needed)
+ // copy the unencrypted part
while (a < length/2)
{
dec[a] = rom[a];
a += 0x10000;
}
}
-
- space.set_decrypted_region(0x000000, length - 1, dec);
- ((m68000_base_device*)machine.device("maincpu"))->set_encrypted_opcode_range(0, length);
}
@@ -743,284 +736,29 @@ struct game_keys
};
-/*
-(1) On a dead board, the only encrypted range is actually FF0000-FFFFFF.
-It doesn't start from 0, and it's the upper half of a 128kB bank.
-*/
-
-static const struct game_keys keys_table[] =
-{
- // name key upper watchdog
- { "dead", { 0xffffffff,0xffffffff }, /*(1)*/ }, // ffff ffff ffff
- { "ssf2", { 0x23456789,0xabcdef01 }, 0x400000 }, // 0838 0007 2000 btst #7,$2000
- { "ssf2r1", { 0x23456789,0xabcdef01 }, 0x400000 }, // 0838 0007 2000 btst #7,$2000
- { "ssf2u", { 0x12345678,0x9abcdef0 }, 0x400000 }, // 0838 0007 2000 btst #7,$2000
- { "ssf2a", { 0x3456789a,0xbcdef012 }, 0x400000 }, // 0838 0007 2000 btst #7,$2000
- { "ssf2ar1", { 0x3456789a,0xbcdef012 }, 0x400000 }, // 0838 0007 2000 btst #7,$2000
- { "ssf2j", { 0x01234567,0x89abcdef }, 0x400000 }, // 0838 0007 2000 btst #7,$2000
- { "ssf2jr1", { 0x01234567,0x89abcdef }, 0x400000 }, // 0838 0007 2000 btst #7,$2000
- { "ssf2jr2", { 0x01234567,0x89abcdef }, 0x400000 }, // 0838 0007 2000 btst #7,$2000
- { "ssf2h", { 0x56789abc,0xdef01234 }, 0x400000 }, // 0838 0007 2000 btst #7,$2000
- { "ssf2tb", { 0x89abcdef,0x01234567 }, 0x400000 }, // 0838 0007 2000 btst #7,$2000
- { "ssf2tbr1", { 0x89abcdef,0x01234567 }, 0x400000 }, // 0838 0007 2000 btst #7,$2000
- { "ssf2tbj", { 0x6789abcd,0xef012345 }, 0x400000 }, // 0838 0007 2000 btst #7,$2000
- { "ssf2tbh", { 0xbcdef012,0x3456789a }, 0x400000 }, // 0838 0007 2000 btst #7,$2000
- { "ddtod", { 0x4767fe08,0x14ca35d9 }, 0x180000 }, // 0C78 1019 4000 cmpi.w #$1019,$4000
- { "ddtodr1", { 0x4767fe08,0x14ca35d9 }, 0x180000 }, // 0C78 1019 4000 cmpi.w #$1019,$4000
- { "ddtodu", { 0xeca19c3d,0x24736bf0 }, 0x180000 }, // 0C78 1019 4000 cmpi.w #$1019,$4000
- { "ddtodur1", { 0xeca19c3d,0x24736bf0 }, 0x180000 }, // 0C78 1019 4000 cmpi.w #$1019,$4000
- { "ddtodj", { 0x4510e79c,0xf36b8a2d }, 0x180000 }, // 0C78 1019 4000 cmpi.w #$1019,$4000
- { "ddtodjr1", { 0x4510e79c,0xf36b8a2d }, 0x180000 }, // 0C78 1019 4000 cmpi.w #$1019,$4000
- { "ddtodjr2", { 0x4510e79c,0xf36b8a2d }, 0x180000 }, // 0C78 1019 4000 cmpi.w #$1019,$4000
- { "ddtoda", { 0xdecac105,0x19710411 }, 0x180000 }, // 0C78 1019 4000 cmpi.w #$1019,$4000
- { "ddtodar1", { 0xdecac105,0x19710411 }, 0x180000 }, // 0C78 1019 4000 cmpi.w #$1019,$4000
- { "ddtodh", { 0x19691019,0xe825dde0 }, 0x180000 }, // 0C78 1019 4000 cmpi.w #$1019,$4000
- { "ddtodhr1", { 0x19691019,0xe825dde0 }, 0x180000 }, // 0C78 1019 4000 cmpi.w #$1019,$4000
- { "ddtodhr2", { 0x19691019,0xe825dde0 }, 0x180000 }, // 0C78 1019 4000 cmpi.w #$1019,$4000
- { "ecofghtr", { 0x931031dc,0xba987654 }, 0x200000 }, // 0838 0003 7345 btst #3,$7345
- { "ecofghtru",{ 0x931031ed,0xcba98765 }, 0x200000 }, // 0838 0003 7345 btst #3,$7345
- { "ecofghtru1",{ 0x931031ed,0xcba98765 }, 0x200000 }, // 0838 0003 7345 btst #3,$7345
- { "uecology", { 0x931031fe,0xdcba9876 }, 0x200000 }, // 0838 0003 7345 btst #3,$7345
- { "ecofghtra",{ 0x931031ba,0x98765432 }, 0x200000 }, // 0838 0003 7345 btst #3,$7345
- { "ecofghtrh",{ 0x931031cb,0xa9876543 }, 0x200000 }, // 0838 0003 7345 btst #3,$7345
- { "ssf2t", { 0x944e8302,0x56d3143c }, 0x400000 }, // 0838 0007 2000 btst #7,$2000
- { "ssf2ta", { 0x94c4d002,0x664a1471 }, 0x400000 }, // 0838 0007 2000 btst #7,$2000
- { "ssf2tu", { 0x94fa8902,0x4c77143f }, 0x400000 }, // 0838 0007 2000 btst #7,$2000
- { "ssf2tur1", { 0x94fa8902,0x4c77143f }, 0x400000 }, // 0838 0007 2000 btst #7,$2000
- { "ssf2xj", { 0x942a5702,0x05ac140e }, 0x400000 }, // 0838 0007 2000 btst #7,$2000
- { "ssf2xjr", { 0x943c2b02,0x7acd1422 }, 0x400000 }, // 0838 0007 2000 btst #7,$2000 // curious, not the usual Japan key on the rent version
- { "xmcota", { 0x3bc6eda4,0x97f80251 }, 0x100000 }, // 0C80 1972 0301 cmpi.l #$19720301,D0
- { "xmcotar1", { 0x3bc6eda4,0x97f80251 }, 0x100000 }, // 0C80 1972 0301 cmpi.l #$19720301,D0
- { "xmcotau", { 0x32a57ecd,0x98016f4b }, 0x100000 }, // 0C80 1972 0301 cmpi.l #$19720301,D0
- { "xmcotah", { 0xf5e8dc34,0xa096b217 }, 0x100000 }, // 0C80 1972 0301 cmpi.l #$19720301,D0
- { "xmcotahr1",{ 0xf5e8dc34,0xa096b217 }, 0x100000 }, // 0C80 1972 0301 cmpi.l #$19720301,D0
- { "xmcotaj", { 0x46027315,0xaf8bcd9e }, 0x100000 }, // 0C80 1972 0301 cmpi.l #$19720301,D0
- { "xmcotaj1", { 0x46027315,0xaf8bcd9e }, 0x100000 }, // 0C80 1972 0301 cmpi.l #$19720301,D0
- { "xmcotaj2", { 0x46027315,0xaf8bcd9e }, 0x100000 }, // 0C80 1972 0301 cmpi.l #$19720301,D0
- { "xmcotaj3", { 0x46027315,0xaf8bcd9e }, 0x100000 }, // 0C80 1972 0301 cmpi.l #$19720301,D0
- { "xmcotajr", { 0x46027315,0xaf8bcd9e }, 0x100000 }, // 0C80 1972 0301 cmpi.l #$19720301,D0
- { "xmcotaa", { 0x0795a4e2,0xdb3f861c }, 0x100000 }, // 0C80 1972 0301 cmpi.l #$19720301,D0
- { "xmcotaar1",{ 0x0795a4e2,0xdb3f861c }, 0x100000 }, // 0C80 1972 0301 cmpi.l #$19720301,D0
- { "armwar", { 0x9e9d4c0b,0x8a39081f }, 0x100000 }, // 3039 0080 4020 move.w $00804020,D0
- { "armwarr1", { 0x9e9d4c0b,0x8a39081f }, 0x100000 }, // 3039 0080 4020 move.w $00804020,D0
- { "armwaru", { 0xd4c0b8a3,0x9081f9e9 }, 0x100000 }, // 3039 0080 4020 move.w $00804020,D0
- { "armwaru1", { 0xd4c0b8a3,0x9081f9e9 }, 0x100000 }, // 3039 0080 4020 move.w $00804020,D0
- { "pgear", { 0x9d4c0b8a,0x39081f9e }, 0x100000 }, // 3039 0080 4020 move.w $00804020,D0
- { "pgearr1", { 0x9d4c0b8a,0x39081f9e }, 0x100000 }, // 3039 0080 4020 move.w $00804020,D0
- { "armwara", { 0x1f9e9d4c,0x0b8a3908 }, 0x100000 }, // 3039 0080 4020 move.w $00804020,D0
- { "armwarar1",{ 0x1f9e9d4c,0x0b8a3908 }, 0x100000 }, // 3039 0080 4020 move.w $00804020,D0
- { "avsp", { 0x15208f79,0x4ade6cb3 }, 0x100000 }, // 0C80 1234 5678 cmpi.l #$12345678,D0
- { "avspu", { 0xb4f61089,0xccf75a23 }, 0x100000 }, // 0C80 1234 5678 cmpi.l #$12345678,D0
- { "avspj", { 0xe9dcb8fa,0x51372064 }, 0x100000 }, // 0C80 1234 5678 cmpi.l #$12345678,D0
- { "avspa", { 0xc168f3bd,0x2e4a5970 }, 0x100000 }, // 0C80 1234 5678 cmpi.l #$12345678,D0
- { "avsph", { 0x712b690a,0x43cd8e5f }, 0x100000 }, // 0C80 1234 5678 cmpi.l #$12345678,D0
- { "dstlk", { 0x13d8a7a8,0x0008b090 }, 0x100000 }, // 0838 0000 6160 btst #0,$6160
- { "dstlku", { 0x1e80ebf0,0x10227119 }, 0x100000 }, // 0838 0000 6160 btst #0,$6160
- { "dstlkur1", { 0x1e80ebf0,0x10227119 }, 0x100000 }, // 0838 0000 6160 btst #0,$6160
- { "dstlka", { 0x205d8398,0x06221971 }, 0x100000 }, // 0838 0000 6160 btst #0,$6160
- { "dstlkh", { 0x22463efe,0x011169aa }, 0x100000 }, // 0838 0000 6160 btst #0,$6160
- { "vampj", { 0xefcb0804,0x026819ae }, 0x100000 }, // 0838 0000 6160 btst #0,$6160
- { "vampja", { 0xefcb0804,0x026819ae }, 0x100000 }, // 0838 0000 6160 btst #0,$6160
- { "vampjr1", { 0xefcb0804,0x026819ae }, 0x100000 }, // 0838 0000 6160 btst #0,$6160
- { "ringdest", { 0x19940727,0x17444903 }, 0x180000 }, // 3039 0080 4020 move.w $00804020,D0
- { "smbomb", { 0x19940209,0x17031403 }, 0x180000 }, // 3039 0080 4020 move.w $00804020,D0
- { "smbombr1", { 0x19940209,0x17031403 }, 0x180000 }, // 3039 0080 4020 move.w $00804020,D0
- { "ringdesta",{ 0x19940727,0x17452103 }, 0x180000 }, // 3039 0080 4020 move.w $00804020,D0
- { "cybots", { 0x45425943,0x05090901 }, 0x100000 }, // 0C38 00FF 0C38 cmpi.b #$FF,$0C38
- { "cybotsu", { 0x43050909,0x01554259 }, 0x100000 }, // 0C38 00FF 0C38 cmpi.b #$FF,$0C38
- { "cybotsj", { 0x05090901,0x4a425943 }, 0x100000 }, // 0C38 00FF 0C38 cmpi.b #$FF,$0C38
- { "msh", { 0x1a11ee26,0xe7955d17 }, 0x100000 }, // 0C81 1966 0419 cmpi.l #$19660419,D1
- { "mshu", { 0x8705a24e,0x4a17319b }, 0x100000 }, // 0C81 1966 0419 cmpi.l #$19660419,D1
- { "mshj", { 0x05e88219,0x31ad2142 }, 0x100000 }, // 0C81 1966 0419 cmpi.l #$19660419,D1
- { "mshjr1", { 0x05e88219,0x31ad2142 }, 0x100000 }, // 0C81 1966 0419 cmpi.l #$19660419,D1
- { "msha", { 0x457aeb01,0x3897c53d }, 0x100000 }, // 0C81 1966 0419 cmpi.l #$19660419,D1
- { "mshh", { 0xfc4c5a50,0xb59cc190 }, 0x100000 }, // 0C81 1966 0419 cmpi.l #$19660419,D1
- { "mshb", { 0x7a152416,0xad27f8e6 }, 0x100000 }, // 0C81 1966 0419 cmpi.l #$19660419,D1
- { "nwarr", { 0x1019d145,0x03f05a05 }, 0x180000 }, // 0838 0000 6160 btst #0,$6160
- { "nwarru", { 0x104a7d0c,0x3f1b7a1e }, 0x180000 }, // 0838 0000 6160 btst #0,$6160
- { "nwarrh", { 0xc4961b01,0x2a946020 }, 0x180000 }, // 0838 0000 6160 btst #0,$6160
- { "nwarrb", { 0x17c67109,0xb7362a20 }, 0x180000 }, // 0838 0000 6160 btst #0,$6160
- { "nwarra", { 0x4e940d0c,0x39b861a4 }, 0x180000 }, // 0838 0000 6160 btst #0,$6160
- { "vhuntj", { 0x1135b2c3,0xa4e9d7f2 }, 0x180000 }, // 0838 0000 6160 btst #0,$6160
- { "vhuntjr1s",{ 0x1135b2c3,0xa4e9d7f2 }, 0x180000 }, // 0838 0000 6160 btst #0,$6160
- { "vhuntjr1", { 0x1135b2c3,0xa4e9d7f2 }, 0x180000 }, // 0838 0000 6160 btst #0,$6160
- { "vhuntjr2", { 0x1135b2c3,0xa4e9d7f2 }, 0x180000 }, // 0838 0000 6160 btst #0,$6160
- { "sfa", { 0x0f895d6e,0xc4273a1b }, 0x080000 }, // 0C80 0564 2194 cmpi.l #$05642194,D0
- { "sfar1", { 0x0f895d6e,0xc4273a1b }, 0x080000 }, // 0C80 0564 2194 cmpi.l #$05642194,D0
- { "sfar2", { 0x0f895d6e,0xc4273a1b }, 0x080000 }, // 0C80 0564 2194 cmpi.l #$05642194,D0
- { "sfar3", { 0x0f895d6e,0xc4273a1b }, 0x080000 }, // 0C80 0564 2194 cmpi.l #$05642194,D0
- { "sfau", { 0x25bead36,0x97cf4018 }, 0x080000 }, // 0C80 0564 2194 cmpi.l #$05642194,D0
- { "sfza", { 0xe43dc508,0x621b9a7f }, 0x080000 }, // 0C80 0564 2194 cmpi.l #$05642194,D0
- { "sfzar1", { 0xe43dc508,0x621b9a7f }, 0x080000 }, // 0C80 0564 2194 cmpi.l #$05642194,D0
- { "sfzj", { 0x8db3167a,0xc29e0f45 }, 0x080000 }, // 0C80 0564 2194 cmpi.l #$05642194,D0
- { "sfzjr1", { 0x8db3167a,0xc29e0f45 }, 0x080000 }, // 0C80 0564 2194 cmpi.l #$05642194,D0
- { "sfzjr2", { 0x8db3167a,0xc29e0f45 }, 0x080000 }, // 0C80 0564 2194 cmpi.l #$05642194,D0
- { "sfzh", { 0x876b0e39,0x5ca24fd1 }, 0x080000 }, // 0C80 0564 2194 cmpi.l #$05642194,D0
- { "sfzhr1", { 0x876b0e39,0x5ca24fd1 }, 0x080000 }, // 0C80 0564 2194 cmpi.l #$05642194,D0
- { "sfzb", { 0xef415bd3,0x7a92c680 }, 0x080000 }, // 0C80 0564 2194 cmpi.l #$05642194,D0
- { "sfzbr1", { 0xef415bd3,0x7a92c680 }, 0x080000 }, // 0C80 0564 2194 cmpi.l #$05642194,D0
- { "mmancp2u", { 0x054893fa,0x94642525 }, 0x100000 }, // 0C80 0564 2194 cmpi.l #$05642194,D0
- { "mmancp2ur1",{0x054893fa,0x94642525 }, 0x100000 }, // 0C80 0564 2194 cmpi.l #$05642194,D0
- { "rmancp2j", { 0x07215501,0x37fa32d0 }, 0x100000 }, // 0C80 0564 2194 cmpi.l #$05642194,D0
- { "19xx", { 0x0e07181f,0x5fd0f080 }, 0x200000 }, // 0C81 0095 1101 cmpi.l #$00951101,D1
- { "19xxa", { 0xcce74cf5,0xb7da3711 }, 0x200000 }, // 0C81 0095 1101 cmpi.l #$00951101,D1
- { "19xxar1", { 0xcce74cf5,0xb7da3711 }, 0x200000 }, // 0C81 0095 1101 cmpi.l #$00951101,D1
- { "19xxj", { 0x00115df8,0x000ff87e }, 0x200000 }, // 0C81 0095 1101 cmpi.l #$00951101,D1
- { "19xxjr1", { 0x00115df8,0x000ff87e }, 0x200000 }, // 0C81 0095 1101 cmpi.l #$00951101,D1
- { "19xxjr2", { 0x00115df8,0x000ff87e }, 0x200000 }, // 0C81 0095 1101 cmpi.l #$00951101,D1
- { "19xxh", { 0x5d49bafa,0xf7216c9f }, 0x200000 }, // 0C81 0095 1101 cmpi.l #$00951101,D1
- { "19xxb", { 0xe5f9476a,0x2dfb623f }, 0x200000 }, // 0C81 0095 1101 cmpi.l #$00951101,D1
- { "ddsom", { 0x87889abc,0xd81f5f63 }, 0x100000 }, // 0C81 1966 0419 cmpi.l #$19660419,D1
- { "ddsomr1", { 0x87889abc,0xd81f5f63 }, 0x100000 }, // 0C81 1966 0419 cmpi.l #$19660419,D1
- { "ddsomr2", { 0x87889abc,0xd81f5f63 }, 0x100000 }, // 0C81 1966 0419 cmpi.l #$19660419,D1
- { "ddsomr3", { 0x87889abc,0xd81f5f63 }, 0x100000 }, // 0C81 1966 0419 cmpi.l #$19660419,D1
- { "ddsomu", { 0x489f0526,0x1bcd3e7a }, 0x100000 }, // 0C81 1966 0419 cmpi.l #$19660419,D1
- { "ddsomur1", { 0x489f0526,0x1bcd3e7a }, 0x100000 }, // 0C81 1966 0419 cmpi.l #$19660419,D1
- { "ddsomj", { 0xae92fa94,0x315a9045 }, 0x100000 }, // 0C81 1966 0419 cmpi.l #$19660419,D1
- { "ddsomjr1", { 0xae92fa94,0x315a9045 }, 0x100000 }, // 0C81 1966 0419 cmpi.l #$19660419,D1
- { "ddsoma", { 0x8719abcd,0xef028345 }, 0x100000 }, // 0C81 1966 0419 cmpi.l #$19660419,D1
- { "ddsomar1", { 0x8719abcd,0xef028345 }, 0x100000 }, // 0C81 1966 0419 cmpi.l #$19660419,D1
- { "ddsomh", { 0x42134245,0x120de607 }, 0x100000 }, // 0C81 1966 0419 cmpi.l #$19660419,D1
- { "ddsomb", { 0x7149a782,0xf3a5bfce }, 0x100000 }, // 0C81 1966 0419 cmpi.l #$19660419,D1
- { "megaman2", { 0x50501cac,0xed346550 }, 0x100000 }, // 0C80 0164 7101 cmpi.l #$01647101,D0
- { "megaman2a",{ 0x3f148a2b,0xd6790a15 }, 0x100000 }, // 0C80 0164 7101 cmpi.l #$01647101,D0
- { "rockman2j",{ 0x319eca73,0x10551270 }, 0x100000 }, // 0C80 0164 7101 cmpi.l #$01647101,D0
- { "megaman2h",{ 0x765573ca,0x250210d0 }, 0x100000 }, // 0C80 0164 7101 cmpi.l #$01647101,D0
- { "qndream", { 0x5804ea73,0xf66b0798 }, 0x080000 }, // 0C81 1973 0827 cmpi.l #$19730827,D1
- { "sfa2", { 0xfc4acf9c,0x3bfbe1f9 }, 0x100000 }, // 0C80 3039 9783 cmpi.l #$30399783,D0
- { "sfa2u", { 0x1bbf3d96,0x8af4614a }, 0x100000 }, // 0C80 3039 9783 cmpi.l #$30399783,D0
- { "sfa2ur1", { 0x1bbf3d96,0x8af4614a }, 0x100000 }, // 0C80 3039 9783 cmpi.l #$30399783,D0
- { "sfz2j", { 0x83f47e99,0xda772111 }, 0x100000 }, // 0C80 3039 9783 cmpi.l #$30399783,D0
- { "sfz2jr1", { 0x83f47e99,0xda772111 }, 0x100000 }, // 0C80 3039 9783 cmpi.l #$30399783,D0
- { "sfz2a", { 0xafc2e8f4,0x43789487 }, 0x100000 }, // 0C80 3039 9783 cmpi.l #$30399783,D0
- { "sfz2b", { 0xac134599,0x61f8bb2e }, 0x100000 }, // 0C80 3039 9783 cmpi.l #$30399783,D0
- { "sfz2br1", { 0xac134599,0x61f8bb2e }, 0x100000 }, // 0C80 3039 9783 cmpi.l #$30399783,D0
- { "sfz2h", { 0xf98a2d42,0x597b089f }, 0x100000 }, // 0C80 3039 9783 cmpi.l #$30399783,D0
- { "sfz2n", { 0xe32bf89c,0xa57b46dc }, 0x100000 }, // 0C80 3039 9783 cmpi.l #$30399783,D0
- { "sfz2al", { 0xf172c0d0,0x040621a6 }, 0x100000 }, // 0C80 8E73 9110 cmpi.l #$8E739110,D0
- { "sfz2alj", { 0x99450c88,0xa00a2c4d }, 0x100000 }, // 0C80 8E73 9110 cmpi.l #$8E739110,D0
- { "sfz2alh", { 0x95f15b7c,0x200c08c6 }, 0x100000 }, // 0C80 8E73 9110 cmpi.l #$8E739110,D0
- { "sfz2alb", { 0x73cd4a28,0xff83af1c }, 0x100000 }, // 0C80 8E73 9110 cmpi.l #$8E739110,D0
- { "spf2t", { 0xdde26f09,0x55821ee7 }, 0x040000 }, // 0C80 3039 9819 cmpi.l #$30399819,D0
- { "spf2tu", { 0x706a8750,0x7d0fc185 }, 0x040000 }, // 0C80 3039 9819 cmpi.l #$30399819,D0
- { "spf2xj", { 0xb12c835a,0xe90976ff }, 0x040000 }, // 0C80 3039 9819 cmpi.l #$30399819,D0
- { "spf2ta", { 0x9c48e1ab,0xd60f34fb }, 0x040000 }, // 0C80 3039 9819 cmpi.l #$30399819,D0
- { "spf2th", { 0x51ed8cab,0x228f85b6 }, 0x040000 }, // 0C80 3039 9819 cmpi.l #$30399819,D0
- { "xmvsf", { 0xbdcf8519,0x3fb2acea }, 0x100000 }, // 0C81 1972 0327 cmpi.l #$19720327,D1
- { "xmvsfr1", { 0xbdcf8519,0x3fb2acea }, 0x100000 }, // 0C81 1972 0327 cmpi.l #$19720327,D1
- { "xmvsfu", { 0x4fcb03d2,0xf8653bc1 }, 0x100000 }, // 0C81 1972 0327 cmpi.l #$19720327,D1
- { "xmvsfur1", { 0x4fcb03d2,0xf8653bc1 }, 0x100000 }, // 0C81 1972 0327 cmpi.l #$19720327,D1
- { "xmvsfj", { 0x38df93bc,0x210373ac }, 0x100000 }, // 0C81 1972 0327 cmpi.l #$19720327,D1
- { "xmvsfjr1", { 0x38df93bc,0x210373ac }, 0x100000 }, // 0C81 1972 0327 cmpi.l #$19720327,D1
- { "xmvsfjr2", { 0x38df93bc,0x210373ac }, 0x100000 }, // 0C81 1972 0327 cmpi.l #$19720327,D1
- { "xmvsfa", { 0x7438fc3e,0x19abed90 }, 0x100000 }, // 0C81 1972 0327 cmpi.l #$19720327,D1
- { "xmvsfar1", { 0x7438fc3e,0x19abed90 }, 0x100000 }, // 0C81 1972 0327 cmpi.l #$19720327,D1
- { "xmvsfar2", { 0x7438fc3e,0x19abed90 }, 0x100000 }, // 0C81 1972 0327 cmpi.l #$19720327,D1
- { "xmvsfar3", { 0x7438fc3e,0x19abed90 }, 0x100000 }, // 0C81 1972 0327 cmpi.l #$19720327,D1
- { "xmvsfh", { 0x835fb2d0,0x42fa9137 }, 0x100000 }, // 0C81 1972 0327 cmpi.l #$19720327,D1
- { "xmvsfb", { 0x8ead9e4a,0xb02184f0 }, 0x100000 }, // 0C81 1972 0327 cmpi.l #$19720327,D1
- { "batcir", { 0xd195e597,0x3cbce2b5 }, 0x200000 }, // 0C81 0097 0131 cmpi.l #$00970131,D1
- { "batcira", { 0x1e5d80cb,0x98882ec7 }, 0x200000 }, // 0C81 0097 0131 cmpi.l #$00970131,D1
- { "batcirj", { 0x00ff4dd8,0x000008e8 }, 0x200000 }, // 0C81 0097 0131 cmpi.l #$00970131,D1
- { "csclub", { 0x662e9fa0,0x4210e7c1 }, 0x200000 }, // 0C81 0097 0310 cmpi.l #$00970310,D1
- { "csclub1", { 0x662e9fa0,0x4210e7c1 }, 0x200000 }, // 0C81 0097 0310 cmpi.l #$00970310,D1
- { "cscluba", { 0x1366de2a,0x9ab42937 }, 0x200000 }, // 0C81 0097 0310 cmpi.l #$00970310,D1
- { "csclubj", { 0x4a2d0be5,0x56c013c0 }, 0x200000 }, // 0C81 0097 0310 cmpi.l #$00970310,D1
- { "csclubjy", { 0x4a2d0be5,0x56c013c0 }, 0x200000 }, // 0C81 0097 0310 cmpi.l #$00970310,D1
- { "csclubh", { 0xf014a8a7,0x2e7794d0 }, 0x200000 }, // 0C81 0097 0310 cmpi.l #$00970310,D1
- { "mshvsf", { 0x1384ae60,0x9cd725bf }, 0x100000 }, // 0C81 1972 1027 cmpi.l #$19721027,D1
- { "mshvsfu", { 0xa36d4971,0xcef51b28 }, 0x100000 }, // 0C81 1972 1027 cmpi.l #$19721027,D1
- { "mshvsfu1", { 0xa36d4971,0xcef51b28 }, 0x100000 }, // 0C81 1972 1027 cmpi.l #$19721027,D1
- { "mshvsfj", { 0x5dc391f8,0xa627e0b4 }, 0x100000 }, // 0C81 1972 1027 cmpi.l #$19721027,D1
- { "mshvsfj1", { 0x5dc391f8,0xa627e0b4 }, 0x100000 }, // 0C81 1972 1027 cmpi.l #$19721027,D1
- { "mshvsfj2", { 0x5dc391f8,0xa627e0b4 }, 0x100000 }, // 0C81 1972 1027 cmpi.l #$19721027,D1
- { "mshvsfh", { 0x7e916fc4,0x03ab852d }, 0x100000 }, // 0C81 1972 1027 cmpi.l #$19721027,D1
- { "mshvsfa", { 0x52e3fa61,0x0c497bd8 }, 0x100000 }, // 0C81 1972 1027 cmpi.l #$19721027,D1
- { "mshvsfa1", { 0x52e3fa61,0x0c497bd8 }, 0x100000 }, // 0C81 1972 1027 cmpi.l #$19721027,D1
- { "mshvsfb", { 0xda68c749,0x5bf3e201 }, 0x100000 }, // 0C81 1972 1027 cmpi.l #$19721027,D1
- { "mshvsfb1", { 0xda68c749,0x5bf3e201 }, 0x100000 }, // 0C81 1972 1027 cmpi.l #$19721027,D1
- { "sgemf", { 0x84234976,0x5e0fbb7e }, 0x080000 }, // 0C80 1F74 0D12 cmpi.l #$1F740D12,D0
- { "pfghtj", { 0x97d2ebc0,0x308f94d7 }, 0x080000 }, // 0C80 1F74 0D12 cmpi.l #$1F740D12,D0
- { "sgemfa", { 0x090b412a,0xc47ee993 }, 0x080000 }, // 0C80 1F74 0D12 cmpi.l #$1F740D12,D0
- { "sgemfh", { 0x8163a71b,0x7c8fd224 }, 0x080000 }, // 0C80 1F74 0D12 cmpi.l #$1F740D12,D0
- { "vhunt2", { 0x36c1eba3,0x26b10f18 }, 0x100000 }, // 0C80 0692 0760 cmpi.l #$06920760,D0
- { "vhunt2r1", { 0x36c1eba3,0x26b10f18 }, 0x100000 }, // 0C80 0692 0760 cmpi.l #$06920760,D0
- { "vsav", { 0xe0cd5881,0x71babb70 }, 0x100000 }, // 0C80 726A 4BAF cmpi.l #$726A4BAF,D0
- { "vsavu", { 0xa62ea0ee,0x573e03e6 }, 0x100000 }, // 0C80 726A 4BAF cmpi.l #$726A4BAF,D0
- { "vsavj", { 0xfa8f4e33,0xa4b881b9 }, 0x100000 }, // 0C80 726A 4BAF cmpi.l #$726A4BAF,D0
- { "vsava", { 0x47ee9930,0x90b412ac }, 0x100000 }, // 0C80 726A 4BAF cmpi.l #$726A4BAF,D0
- { "vsavh", { 0xb2d37c8d,0xd3b7aadd }, 0x100000 }, // 0C80 726A 4BAF cmpi.l #$726A4BAF,D0
- { "vsav2", { 0xd681e4f4,0x60371edf }, 0x100000 }, // 0C80 0692 0760 cmpi.l #$06920760,D0
- { "mvsc", { 0x48025ade,0x1c697b27 }, 0x100000 }, // 0C81 1972 0121 cmpi.l #$19720121,D1
- { "mvscr1", { 0x48025ade,0x1c697b27 }, 0x100000 }, // 0C81 1972 0121 cmpi.l #$19720121,D1
- { "mvscu", { 0x692dc41b,0x7ef1c805 }, 0x100000 }, // 0C81 1972 0121 cmpi.l #$19720121,D1
- { "mvscur1", { 0x692dc41b,0x7ef1c805 }, 0x100000 }, // 0C81 1972 0121 cmpi.l #$19720121,D1
- { "mvscj", { 0xafc16138,0x97123eb0 }, 0x100000 }, // 0C81 1972 0121 cmpi.l #$19720121,D1
- { "mvscjr1", { 0xafc16138,0x97123eb0 }, 0x100000 }, // 0C81 1972 0121 cmpi.l #$19720121,D1
- { "mvscjsing",{ 0xafc16138,0x97123eb0 }, 0x100000 }, // 0C81 1972 0121 cmpi.l #$19720121,D1
- { "mvsca", { 0xf248aec6,0x7905cd17 }, 0x100000 }, // 0C81 1972 0121 cmpi.l #$19720121,D1
- { "mvscar1", { 0xf248aec6,0x7905cd17 }, 0x100000 }, // 0C81 1972 0121 cmpi.l #$19720121,D1
- { "mvsch", { 0x9d5c7a23,0xe56b18ef }, 0x100000 }, // 0C81 1972 0121 cmpi.l #$19720121,D1
- { "mvscb", { 0x0874d6eb,0x51c2b798 }, 0x100000 }, // 0C81 1972 0121 cmpi.l #$19720121,D1
- { "sfa3", { 0x6abfc8e0,0x2780ddc1 }, 0x100000 }, // 0C80 1C62 F5A8 cmpi.l #$1C62F5A8,D0
- { "sfa3u", { 0xe7bbf0e5,0x67943248 }, 0x100000 }, // 0C80 1C62 F5A8 cmpi.l #$1C62F5A8,D0
- { "sfa3ur1", { 0xe7bbf0e5,0x67943248 }, 0x100000 }, // 0C80 1C62 F5A8 cmpi.l #$1C62F5A8,D0
- { "sfa3h", { 0x8422df8c,0x7b17a361 }, 0x100000 }, // 0C80 1C62 F5A8 cmpi.l #$1C62F5A8,D0
- { "sfa3hr1", { 0x8422df8c,0x7b17a361 }, 0x100000 }, // 0C80 1C62 F5A8 cmpi.l #$1C62F5A8,D0
- { "sfa3b", { 0xd421c0b2,0x8116d296 }, 0x100000 }, // 0C80 1C62 F5A8 cmpi.l #$1C62F5A8,D0
- { "sfz3j", { 0x7d49f803,0x0cbe2d79 }, 0x100000 }, // 0C80 1C62 F5A8 cmpi.l #$1C62F5A8,D0
- { "sfz3jr1", { 0x7d49f803,0x0cbe2d79 }, 0x100000 }, // 0C80 1C62 F5A8 cmpi.l #$1C62F5A8,D0
- { "sfz3jr2", { 0x7d49f803,0x0cbe2d79 }, 0x100000 }, // 0C80 1C62 F5A8 cmpi.l #$1C62F5A8,D0
- { "sfz3a", { 0x990b9301,0xa4e42c7e }, 0x100000 }, // 0C80 1C62 F5A8 cmpi.l #$1C62F5A8,D0
- { "sfz3ar1", { 0x990b9301,0xa4e42c7e }, 0x100000 }, // 0C80 1C62 F5A8 cmpi.l #$1C62F5A8,D0
- { "jyangoku", { 0x6ca42ae6,0x92f63f59 }, /*?*/ }, // 0C80 3652 1573 cmpi.l #$36521573,D0
- { "hsf2", { 0x5a369ddd,0xfea3189c }, 0x100000 }, // 0838 0007 2000 btst #7,$2000
- { "hsf2a", { 0xb8ed3630,0xaae30a3d }, 0x100000 }, // 0838 0007 2000 btst #7,$2000
- { "hsf2j", { 0x65d82fe0,0xdbb83e47 }, 0x100000 }, // 0838 0007 2000 btst #7,$2000
- { "gigawing", { 0xe52de290,0x1b60d780 }, 0x100000 }, // 0C81 1972 1027 cmpi.l #$19721027,D1
- { "gigawingj",{ 0x1126196a,0xbef50895 }, 0x100000 }, // 0C81 1972 1027 cmpi.l #$19721027,D1
- { "gigawinga",{ 0x3506a85a,0x66b1b768 }, 0x100000 }, // 0C81 1972 1027 cmpi.l #$19721027,D1
- { "gigawingh",{ 0xcea74211,0x400da385 }, 0x100000 }, // 0C81 1972 1027 cmpi.l #$19721027,D1
- { "gigawingb",{ 0x0fe745b0,0x96ef7f9d }, 0x100000 }, // 0C81 1972 1027 cmpi.l #$19721027,D1
- { "mmatrix", { 0xac9ebd79,0x410467df }, 0x180000 }, // B6C0 B447 BACF cmpa.w D0,A3 cmp.w D7,D2 cmpa.w A7,A5
- { "mmatrixj", { 0x4df81e95,0x72ed9823 }, 0x180000 }, // B6C0 B447 BACF cmpa.w D0,A3 cmp.w D7,D2 cmpa.w A7,A5
- { "mpang", { 0x95f741c6,0xe547a21b }, 0x100000 }, // 0C84 347D 89A3 cmpi.l #$347D89A3,D4
- { "mpangr1", { 0x95f741c6,0xe547a21b }, 0x100000 }, // 0C84 347D 89A3 cmpi.l #$347D89A3,D4
- { "mpangu", { 0x95f741c6,0xe547a21b }, 0x100000 }, // 0C84 347D 89A3 cmpi.l #$347D89A3,D4
- { "mpangj", { 0x95f741c6,0xe547a21b }, 0x100000 }, // 0C84 347D 89A3 cmpi.l #$347D89A3,D4
- { "pzloop2", { 0xa054f812,0xc40d36b4 }, 0x400000 }, // 0C82 9A73 15F1 cmpi.l #$9A7315F1,D2
- { "pzloop2j", { 0xa054f812,0xc40d36b4 }, 0x400000 }, // 0C82 9A73 15F1 cmpi.l #$9A7315F1,D2
- { "pzloop2jr1",{ 0xa054f812,0xc40d36b4 }, 0x400000 }, // 0C82 9A73 15F1 cmpi.l #$9A7315F1,D2
- { "choko", { 0xd3fb12c6,0x7f8e17b5 }, 0x400000 }, // 0C86 4D17 5B3C cmpi.l #$4D175B3C,D6
- { "dimahoo", { 0x0ddb8e40,0x2817fd2b }, 0x080000 }, // BE4C B244 B6C5 cmp.w A4,D7 cmp.w D4,D1 cmpa.w D5,A3
- { "dimahoou", { 0x6575af59,0xb0fea691 }, 0x080000 }, // BE4C B244 B6C5 cmp.w A4,D7 cmp.w D4,D1 cmpa.w D5,A3
- { "gmahou", { 0x97f7be58,0x6121eb62 }, 0x080000 }, // BE4C B244 B6C5 cmp.w A4,D7 cmp.w D4,D1 cmpa.w D5,A3
- { "1944", { 0x1d3e724c,0x8b59fc7a }, 0x080000 }, // 0C86 7B5D 94F1 cmpi.l #$7B5D94F1,D6
- { "1944j", { 0x23d79c3a,0xe18b2746 }, 0x080000 }, // 0C86 7B5D 94F1 cmpi.l #$7B5D94F1,D6
- { "progear", { 0x639ad8c6,0xef130df3 }, 0x400000 }, // 0C81 63A1 B8D3 cmpi.l #$63A1B8D3,D1
- { "progearj", { 0x9f7edc56,0x39fb47be }, 0x400000 }, // 0C81 63A1 B8D3 cmpi.l #$63A1B8D3,D1
- { "progeara", { 0x658ab128,0xfddc9b5e }, 0x400000 }, // 0C81 63A1 B8D3 cmpi.l #$63A1B8D3,D1
-
- { NULL, { 0,0 }, 0 } // end of table
-};
DRIVER_INIT_MEMBER(cps_state,cps2crpt)
{
- const char *gamename = machine().system().name;
- const struct game_keys *k = &keys_table[0];
+ UINT32 key[2];
+ UINT32 lower;
+ UINT32 upper;
- while (k->name)
- {
- if (strcmp(k->name, gamename) == 0)
- {
- // we have a proper key so use it to decrypt
- cps2_decrypt(machine(), k->keys, k->upper_limit ? k->upper_limit : 0x400000);
+ std::string skey1 = parameter("cryptkey1");;
+ key[0] = strtoll(skey1.c_str(), 0, 16);
- break;
- }
- ++k;
- }
+ std::string skey2 = parameter("cryptkey2");
+ key[1] = strtoll(skey2.c_str(), 0, 16);
+
+ std::string slower = parameter("cryptlower");
+ lower = strtoll(slower.c_str(), 0, 16);
+
+ std::string supper = parameter("cryptupper");
+ upper = strtoll(supper.c_str(), 0, 16);
+
+ // we have a proper key so use it to decrypt
+ if (lower!=0xff0000) // don't run the decrypt on 'dead key' games for now
+ cps2_decrypt(machine(), (UINT16 *)memregion("maincpu")->base(), m_decrypted_opcodes, memregion("maincpu")->bytes(), key, lower,upper);
}
diff --git a/src/mame/machine/cps2crypt.h b/src/mame/machine/cps2crypt.h
new file mode 100644
index 00000000000..d9033be2ed6
--- /dev/null
+++ b/src/mame/machine/cps2crypt.h
@@ -0,0 +1,225 @@
+// license:BSD-3-Clause
+// copyright-holders:David Haywood
+
+// CPS2 keys
+
+#define CRYPT_PARAMS( _key1, _key2, _lower, _upper ) \
+ ROM_PARAMETER( "cryptkey1", _key1 ) \
+ ROM_PARAMETER( "cryptkey2", _key2 ) \
+ ROM_PARAMETER( "cryptlower", _lower ) \
+ ROM_PARAMETER( "cryptupper", _upper )
+// the watchdog opcode sequence should also be a parameter if we want to emulate that too?
+
+
+
+// On a dead board, the only encrypted range is actually FF0000-FFFFFF.
+// It doesn't start from 0, and it's the upper half of a 128kB bank.
+
+// key1 key2 lowwer upper watchdog
+#define CPS2_DEAD_KEY CRYPT_PARAMS( "ffffffff","ffffffff", "ff0000", "ffffff" ) // ffff ffff ffff
+
+#define SSF2_WORLD_KEY CRYPT_PARAMS( "23456789","abcdef01", "000000", "400000" ) // 0838 0007 2000 btst #7,$2000
+#define SSF2_USA_KEY CRYPT_PARAMS( "12345678","9abcdef0", "000000", "400000" ) // 0838 0007 2000 btst #7,$2000
+#define SSF2_ASIA_KEY CRYPT_PARAMS( "3456789a","bcdef012", "000000", "400000" ) // 0838 0007 2000 btst #7,$2000
+#define SSF2_JAPAN_KEY CRYPT_PARAMS( "01234567","89abcdef", "000000", "400000" ) // 0838 0007 2000 btst #7,$2000
+#define SSF2_HISPANIC_KEY CRYPT_PARAMS( "56789abc","def01234", "000000", "400000" ) // 0838 0007 2000 btst #7,$2000
+
+#define SSF2TB_WORLD_KEY CRYPT_PARAMS( "89abcdef","01234567", "000000", "400000" ) // 0838 0007 2000 btst #7,$2000
+#define SSF2TB_JAPAN_KEY CRYPT_PARAMS( "6789abcd","ef012345", "000000", "400000" ) // 0838 0007 2000 btst #7,$2000
+#define SSF2TB_HISPANIC_KEY CRYPT_PARAMS( "bcdef012","3456789a", "000000", "400000" ) // 0838 0007 2000 btst #7,$2000
+
+#define DDTOD_WORLD_KEY CRYPT_PARAMS( "4767fe08","14ca35d9", "000000", "180000" ) // 0C78 1019 4000 cmpi.w #$1019,$4000
+#define DDTOD_USA_KEY CRYPT_PARAMS( "eca19c3d","24736bf0", "000000", "180000" ) // 0C78 1019 4000 cmpi.w #$1019,$4000
+#define DDTOD_JAPAN_KEY CRYPT_PARAMS( "4510e79c","f36b8a2d", "000000", "180000" ) // 0C78 1019 4000 cmpi.w #$1019,$4000
+#define DDTOD_ASIA_KEY CRYPT_PARAMS( "decac105","19710411", "000000", "180000" ) // 0C78 1019 4000 cmpi.w #$1019,$4000
+#define DDTOD_HISPANIC_KEY CRYPT_PARAMS( "19691019","e825dde0", "000000", "180000" ) // 0C78 1019 4000 cmpi.w #$1019,$4000
+
+#define ECOFGHTR_WORLD_KEY CRYPT_PARAMS( "931031dc","ba987654", "000000", "200000" ) // 0838 0003 7345 btst #3,$7345
+#define ECOFGHTR_USA_KEY CRYPT_PARAMS( "931031ed","cba98765", "000000", "200000" ) // 0838 0003 7345 btst #3,$7345
+#define ECOFGHTR_JAPAN_KEY CRYPT_PARAMS( "931031fe","dcba9876", "000000", "200000" ) // 0838 0003 7345 btst #3,$7345
+#define ECOFGHTR_ASIA_KEY CRYPT_PARAMS( "931031ba","98765432", "000000", "200000" ) // 0838 0003 7345 btst #3,$7345
+#define ECOFGHTR_HISPANIC_KEY CRYPT_PARAMS( "931031cb","a9876543", "000000", "200000" ) // 0838 0003 7345 btst #3,$7345
+
+#define SSF2T_WORLD_KEY CRYPT_PARAMS( "944e8302","56d3143c", "000000", "400000" ) // 0838 0007 2000 btst #7,$2000
+#define SSF2T_ASIA_KEY CRYPT_PARAMS( "94c4d002","664a1471", "000000", "400000" ) // 0838 0007 2000 btst #7,$2000
+#define SSF2T_USA_KEY CRYPT_PARAMS( "94fa8902","4c77143f", "000000", "400000" ) // 0838 0007 2000 btst #7,$2000
+#define SSF2T_JAPAN_KEY CRYPT_PARAMS( "942a5702","05ac140e", "000000", "400000" ) // 0838 0007 2000 btst #7,$2000
+#define SSF2T_JAPAN_RENTAL_KEY CRYPT_PARAMS( "943c2b02","7acd1422", "000000", "400000" ) // 0838 0007 2000 btst #7,$2000 // curious, not the usual Japan key on the rent version
+
+#define XMCOTA_WORLD_KEY CRYPT_PARAMS( "3bc6eda4","97f80251", "000000", "100000" ) // 0C80 1972 0301 cmpi.l #$19720301,D0
+#define XMCOTA_USA_KEY CRYPT_PARAMS( "32a57ecd","98016f4b", "000000", "100000" ) // 0C80 1972 0301 cmpi.l #$19720301,D0
+#define XMCOTA_HISPANIC_KEY CRYPT_PARAMS( "f5e8dc34","a096b217", "000000", "100000" ) // 0C80 1972 0301 cmpi.l #$19720301,D0
+#define XMCOTA_JAPAN_KEY CRYPT_PARAMS( "46027315","af8bcd9e", "000000", "100000" ) // 0C80 1972 0301 cmpi.l #$19720301,D0
+#define XMCOTA_ASIA_KEY CRYPT_PARAMS( "0795a4e2","db3f861c", "000000", "100000" ) // 0C80 1972 0301 cmpi.l #$19720301,D0
+
+#define ARMWAR_WORLD_KEY CRYPT_PARAMS( "9e9d4c0b","8a39081f", "000000", "100000" ) // 3039 0080 4020 move.w $00804020,D0
+#define ARMWAR_USA_KEY CRYPT_PARAMS( "d4c0b8a3","9081f9e9", "000000", "100000" ) // 3039 0080 4020 move.w $00804020,D0
+#define ARMWAR_JAPAN_KEY CRYPT_PARAMS( "9d4c0b8a","39081f9e", "000000", "100000" ) // 3039 0080 4020 move.w $00804020,D0
+#define ARMWAR_ASIA_KEY CRYPT_PARAMS( "1f9e9d4c","0b8a3908", "000000", "100000" ) // 3039 0080 4020 move.w $00804020,D0
+
+#define AVSP_WORLD_KEY CRYPT_PARAMS( "15208f79","4ade6cb3", "000000", "100000" ) // 0C80 1234 5678 cmpi.l #$12345678,D0
+#define AVSP_USA_KEY CRYPT_PARAMS( "b4f61089","ccf75a23", "000000", "100000" ) // 0C80 1234 5678 cmpi.l #$12345678,D0
+#define AVSP_JAPAN_KEY CRYPT_PARAMS( "e9dcb8fa","51372064", "000000", "100000" ) // 0C80 1234 5678 cmpi.l #$12345678,D0
+#define AVSP_ASIA_KEY CRYPT_PARAMS( "c168f3bd","2e4a5970", "000000", "100000" ) // 0C80 1234 5678 cmpi.l #$12345678,D0
+#define AVSP_HISPANIC_KEY CRYPT_PARAMS( "712b690a","43cd8e5f", "000000", "100000" ) // 0C80 1234 5678 cmpi.l #$12345678,D0
+
+#define DSTLK_WORLD_KEY CRYPT_PARAMS( "13d8a7a8","0008b090", "000000", "100000" ) // 0838 0000 6160 btst #0,$6160
+#define DSTLK_USA_KEY CRYPT_PARAMS( "1e80ebf0","10227119", "000000", "100000" ) // 0838 0000 6160 btst #0,$6160
+#define DSTLK_ASIA_KEY CRYPT_PARAMS( "205d8398","06221971", "000000", "100000" ) // 0838 0000 6160 btst #0,$6160
+#define DSTLK_HISPANIC_KEY CRYPT_PARAMS( "22463efe","011169aa", "000000", "100000" ) // 0838 0000 6160 btst #0,$6160
+#define DSTLK_JAPAN_KEY CRYPT_PARAMS( "efcb0804","026819ae", "000000", "100000" ) // 0838 0000 6160 btst #0,$6160
+
+#define RINGDEST_WORLD_KEY CRYPT_PARAMS( "19940727","17444903", "000000", "180000" ) // 3039 0080 4020 move.w $00804020,D0
+#define RINGDEST_JAPAN_KEY CRYPT_PARAMS( "19940209","17031403", "000000", "180000" ) // 3039 0080 4020 move.w $00804020,D0
+#define RINGDEST_ASIA_KEY CRYPT_PARAMS( "19940727","17452103", "000000", "180000" ) // 3039 0080 4020 move.w $00804020,D0
+
+#define CYBOTS_WORLD_KEY CRYPT_PARAMS( "45425943","05090901", "000000", "100000" ) // 0C38 00FF 0C38 cmpi.b #$FF,$0C38
+#define CYBOTS_USA_KEY CRYPT_PARAMS( "43050909","01554259", "000000", "100000" ) // 0C38 00FF 0C38 cmpi.b #$FF,$0C38
+#define CYBOTS_JAPAN_KEY CRYPT_PARAMS( "05090901","4a425943", "000000", "100000" ) // 0C38 00FF 0C38 cmpi.b #$FF,$0C38
+
+#define MSH_WORLD_KEY CRYPT_PARAMS( "1a11ee26","e7955d17", "000000", "100000" ) // 0C81 1966 0419 cmpi.l #$19660419,D1
+#define MSH_USA_KEY CRYPT_PARAMS( "8705a24e","4a17319b", "000000", "100000" ) // 0C81 1966 0419 cmpi.l #$19660419,D1
+#define MSH_JAPAN_KEY CRYPT_PARAMS( "05e88219","31ad2142", "000000", "100000" ) // 0C81 1966 0419 cmpi.l #$19660419,D1
+#define MSH_ASIA_KEY CRYPT_PARAMS( "457aeb01","3897c53d", "000000", "100000" ) // 0C81 1966 0419 cmpi.l #$19660419,D1
+#define MSH_HISPANIC_KEY CRYPT_PARAMS( "fc4c5a50","b59cc190", "000000", "100000" ) // 0C81 1966 0419 cmpi.l #$19660419,D1
+#define MSH_BRAZIL_KEY CRYPT_PARAMS( "7a152416","ad27f8e6", "000000", "100000" ) // 0C81 1966 0419 cmpi.l #$19660419,D1
+
+#define NWARR_WORLD_KEY CRYPT_PARAMS( "1019d145","03f05a05", "000000", "180000" ) // 0838 0000 6160 btst #0,$6160
+#define NWARR_USA_KEY CRYPT_PARAMS( "104a7d0c","3f1b7a1e", "000000", "180000" ) // 0838 0000 6160 btst #0,$6160
+#define NWARR_HISPANIC_KEY CRYPT_PARAMS( "c4961b01","2a946020", "000000", "180000" ) // 0838 0000 6160 btst #0,$6160
+#define NWARR_BRAZIL_KEY CRYPT_PARAMS( "17c67109","b7362a20", "000000", "180000" ) // 0838 0000 6160 btst #0,$6160
+#define NWARR_ASIA_KEY CRYPT_PARAMS( "4e940d0c","39b861a4", "000000", "180000" ) // 0838 0000 6160 btst #0,$6160
+#define NWARR_JAPAN_KEY CRYPT_PARAMS( "1135b2c3","a4e9d7f2", "000000", "180000" ) // 0838 0000 6160 btst #0,$6160
+
+#define SFA_WORLD_KEY CRYPT_PARAMS( "0f895d6e","c4273a1b", "000000", "080000" ) // 0C80 0564 2194 cmpi.l #$05642194,D0
+#define SFA_USA_KEY CRYPT_PARAMS( "25bead36","97cf4018", "000000", "080000" ) // 0C80 0564 2194 cmpi.l #$05642194,D0
+#define SFA_ASIA_KEY CRYPT_PARAMS( "e43dc508","621b9a7f", "000000", "080000" ) // 0C80 0564 2194 cmpi.l #$05642194,D0
+#define SFA_JAPAN_KEY CRYPT_PARAMS( "8db3167a","c29e0f45", "000000", "080000" ) // 0C80 0564 2194 cmpi.l #$05642194,D0
+#define SFA_HISPANIC_KEY CRYPT_PARAMS( "876b0e39","5ca24fd1", "000000", "080000" ) // 0C80 0564 2194 cmpi.l #$05642194,D0
+#define SFA_BRAZIL_KEY CRYPT_PARAMS( "ef415bd3","7a92c680", "000000", "080000" ) // 0C80 0564 2194 cmpi.l #$05642194,D0
+
+#define MMANCP2_USA_KEY CRYPT_PARAMS( "054893fa","94642525", "000000", "100000" ) // 0C80 0564 2194 cmpi.l #$05642194,D0
+#define MMANCP2_JAPAN_KEY CRYPT_PARAMS( "07215501","37fa32d0", "000000", "100000" ) // 0C80 0564 2194 cmpi.l #$05642194,D0
+
+#define _19XX_USA_KEY CRYPT_PARAMS( "0e07181f","5fd0f080", "000000", "200000" ) // 0C81 0095 1101 cmpi.l #$00951101,D1
+#define _19XX_ASIA_KEY CRYPT_PARAMS( "cce74cf5","b7da3711", "000000", "200000" ) // 0C81 0095 1101 cmpi.l #$00951101,D1
+#define _19XX_JAPAN_KEY CRYPT_PARAMS( "00115df8","000ff87e", "000000", "200000" ) // 0C81 0095 1101 cmpi.l #$00951101,D1
+#define _19XX_HISPANIC_KEY CRYPT_PARAMS( "5d49bafa","f7216c9f", "000000", "200000" ) // 0C81 0095 1101 cmpi.l #$00951101,D1
+#define _19XX_BRAZIL_KEY CRYPT_PARAMS( "e5f9476a","2dfb623f", "000000", "200000" ) // 0C81 0095 1101 cmpi.l #$00951101,D1
+
+#define DDSOM_WORLD_KEY CRYPT_PARAMS( "87889abc","d81f5f63", "000000", "100000" ) // 0C81 1966 0419 cmpi.l #$19660419,D1
+#define DDSOM_USA_KEY CRYPT_PARAMS( "489f0526","1bcd3e7a", "000000", "100000" ) // 0C81 1966 0419 cmpi.l #$19660419,D1
+#define DDSOM_JAPAN_KEY CRYPT_PARAMS( "ae92fa94","315a9045", "000000", "100000" ) // 0C81 1966 0419 cmpi.l #$19660419,D1
+#define DDSOM_ASIA_KEY CRYPT_PARAMS( "8719abcd","ef028345", "000000", "100000" ) // 0C81 1966 0419 cmpi.l #$19660419,D1
+#define DDSOM_HISPANIC_KEY CRYPT_PARAMS( "42134245","120de607", "000000", "100000" ) // 0C81 1966 0419 cmpi.l #$19660419,D1
+#define DDSOM_BRAZIL_KEY CRYPT_PARAMS( "7149a782","f3a5bfce", "000000", "100000" ) // 0C81 1966 0419 cmpi.l #$19660419,D1
+
+#define MEGAMAN2_USA_KEY CRYPT_PARAMS( "50501cac","ed346550", "000000", "100000" ) // 0C80 0164 7101 cmpi.l #$01647101,D0
+#define MEGAMAN2_ASIA_KEY CRYPT_PARAMS( "3f148a2b","d6790a15", "000000", "100000" ) // 0C80 0164 7101 cmpi.l #$01647101,D0
+#define MEGAMAN2_JAPAN_KEY CRYPT_PARAMS( "319eca73","10551270", "000000", "100000" ) // 0C80 0164 7101 cmpi.l #$01647101,D0
+#define MEGAMAN2_HISPANIC_KEY CRYPT_PARAMS( "765573ca","250210d0", "000000", "100000" ) // 0C80 0164 7101 cmpi.l #$01647101,D0
+
+#define QNDREAM_JAPAN_KEY CRYPT_PARAMS( "5804ea73","f66b0798", "000000", "080000" ) // 0C81 1973 0827 cmpi.l #$19730827,D1
+
+#define SFA2_WORLD_KEY CRYPT_PARAMS( "fc4acf9c","3bfbe1f9", "000000", "100000" ) // 0C80 3039 9783 cmpi.l #$30399783,D0
+#define SFA2_USA_KEY CRYPT_PARAMS( "1bbf3d96","8af4614a", "000000", "100000" ) // 0C80 3039 9783 cmpi.l #$30399783,D0
+#define SFA2_JAPAN_KEY CRYPT_PARAMS( "83f47e99","da772111", "000000", "100000" ) // 0C80 3039 9783 cmpi.l #$30399783,D0
+#define SFA2_ASIA_KEY CRYPT_PARAMS( "afc2e8f4","43789487", "000000", "100000" ) // 0C80 3039 9783 cmpi.l #$30399783,D0
+#define SFA2_BRAZIL_KEY CRYPT_PARAMS( "ac134599","61f8bb2e", "000000", "100000" ) // 0C80 3039 9783 cmpi.l #$30399783,D0
+#define SFA2_HISPANIC_KEY CRYPT_PARAMS( "f98a2d42","597b089f", "000000", "100000" ) // 0C80 3039 9783 cmpi.l #$30399783,D0
+#define SFA2_OCEANIA_KEY CRYPT_PARAMS( "e32bf89c","a57b46dc", "000000", "100000" ) // 0C80 3039 9783 cmpi.l #$30399783,D0
+
+#define SFZ2AL_ASIA_KEY CRYPT_PARAMS( "f172c0d0","040621a6", "000000", "100000" ) // 0C80 8E73 9110 cmpi.l #$8E739110,D0
+#define SFZ2AL_JAPAN_KEY CRYPT_PARAMS( "99450c88","a00a2c4d", "000000", "100000" ) // 0C80 8E73 9110 cmpi.l #$8E739110,D0
+#define SFZ2AL_HISPANIC_KEY CRYPT_PARAMS( "95f15b7c","200c08c6", "000000", "100000" ) // 0C80 8E73 9110 cmpi.l #$8E739110,D0
+#define SFZ2AL_BRAZIL_KEY CRYPT_PARAMS( "73cd4a28","ff83af1c", "000000", "100000" ) // 0C80 8E73 9110 cmpi.l #$8E739110,D0
+
+#define SPF2T_WORLD_KEY CRYPT_PARAMS( "dde26f09","55821ee7", "000000", "040000" ) // 0C80 3039 9819 cmpi.l #$30399819,D0
+#define SPF2T_USA_KEY CRYPT_PARAMS( "706a8750","7d0fc185", "000000", "040000" ) // 0C80 3039 9819 cmpi.l #$30399819,D0
+#define SPF2T_JAPAN_KEY CRYPT_PARAMS( "b12c835a","e90976ff", "000000", "040000" ) // 0C80 3039 9819 cmpi.l #$30399819,D0
+#define SPF2T_ASIA_KEY CRYPT_PARAMS( "9c48e1ab","d60f34fb", "000000", "040000" ) // 0C80 3039 9819 cmpi.l #$30399819,D0
+#define SPF2T_HISPANIC_KEY CRYPT_PARAMS( "51ed8cab","228f85b6", "000000", "040000" ) // 0C80 3039 9819 cmpi.l #$30399819,D0
+
+#define XMVSSF_WORLD_KEY CRYPT_PARAMS( "bdcf8519","3fb2acea", "000000", "100000" ) // 0C81 1972 0327 cmpi.l #$19720327,D1
+#define XMVSSF_USA_KEY CRYPT_PARAMS( "4fcb03d2","f8653bc1", "000000", "100000" ) // 0C81 1972 0327 cmpi.l #$19720327,D1
+#define XMVSSF_JAPAN_KEY CRYPT_PARAMS( "38df93bc","210373ac", "000000", "100000" ) // 0C81 1972 0327 cmpi.l #$19720327,D1
+#define XMVSSF_ASIA_KEY CRYPT_PARAMS( "7438fc3e","19abed90", "000000", "100000" ) // 0C81 1972 0327 cmpi.l #$19720327,D1
+#define XMVSSF_HISPANIC_KEY CRYPT_PARAMS( "835fb2d0","42fa9137", "000000", "100000" ) // 0C81 1972 0327 cmpi.l #$19720327,D1
+#define XMVSSF_BRAZIL_KEY CRYPT_PARAMS( "8ead9e4a","b02184f0", "000000", "100000" ) // 0C81 1972 0327 cmpi.l #$19720327,D1
+
+#define BATCIR_WORLD_KEY CRYPT_PARAMS( "d195e597","3cbce2b5", "000000", "200000" ) // 0C81 0097 0131 cmpi.l #$00970131,D1
+#define BATCIR_ASIA_KEY CRYPT_PARAMS( "1e5d80cb","98882ec7", "000000", "200000" ) // 0C81 0097 0131 cmpi.l #$00970131,D1
+#define BATCIR_JAPAN_KEY CRYPT_PARAMS( "00ff4dd8","000008e8", "000000", "200000" ) // 0C81 0097 0131 cmpi.l #$00970131,D1
+
+#define CSCLUB_WORLD_KEY CRYPT_PARAMS( "662e9fa0","4210e7c1", "000000", "200000" ) // 0C81 0097 0310 cmpi.l #$00970310,D1
+#define CSCLUB_ASIA_KEY CRYPT_PARAMS( "1366de2a","9ab42937", "000000", "200000" ) // 0C81 0097 0310 cmpi.l #$00970310,D1
+#define CSCLUB_JAPAN_KEY CRYPT_PARAMS( "4a2d0be5","56c013c0", "000000", "200000" ) // 0C81 0097 0310 cmpi.l #$00970310,D1
+#define CSCLUB_HISPANIC_KEY CRYPT_PARAMS( "f014a8a7","2e7794d0", "000000", "200000" ) // 0C81 0097 0310 cmpi.l #$00970310,D1
+
+#define MSHVSSF_WORLD_KEY CRYPT_PARAMS( "1384ae60","9cd725bf", "000000", "100000" ) // 0C81 1972 1027 cmpi.l #$19721027,D1
+#define MSHVSSF_USA_KEY CRYPT_PARAMS( "a36d4971","cef51b28", "000000", "100000" ) // 0C81 1972 1027 cmpi.l #$19721027,D1
+#define MSHVSSF_JAPAN_KEY CRYPT_PARAMS( "5dc391f8","a627e0b4", "000000", "100000" ) // 0C81 1972 1027 cmpi.l #$19721027,D1
+#define MSHVSSF_HISPANIC_KEY CRYPT_PARAMS( "7e916fc4","03ab852d", "000000", "100000" ) // 0C81 1972 1027 cmpi.l #$19721027,D1
+#define MSHVSSF_ASIA_KEY CRYPT_PARAMS( "52e3fa61","0c497bd8", "000000", "100000" ) // 0C81 1972 1027 cmpi.l #$19721027,D1
+#define MSHVSSF_BRAZIL_KEY CRYPT_PARAMS( "da68c749","5bf3e201", "000000", "100000" ) // 0C81 1972 1027 cmpi.l #$19721027,D1
+
+#define SGEMF_USA_KEY CRYPT_PARAMS( "84234976","5e0fbb7e", "000000", "080000" ) // 0C80 1F74 0D12 cmpi.l #$1F740D12,D0
+#define SGEMF_JAPAN_KEY CRYPT_PARAMS( "97d2ebc0","308f94d7", "000000", "080000" ) // 0C80 1F74 0D12 cmpi.l #$1F740D12,D0
+#define SGEMF_ASIA_KEY CRYPT_PARAMS( "090b412a","c47ee993", "000000", "080000" ) // 0C80 1F74 0D12 cmpi.l #$1F740D12,D0
+#define SGEMF_HISPANIC_KEY CRYPT_PARAMS( "8163a71b","7c8fd224", "000000", "080000" ) // 0C80 1F74 0D12 cmpi.l #$1F740D12,D0
+
+#define VHUNT2_JAPAN_KEY CRYPT_PARAMS( "36c1eba3","26b10f18", "000000", "100000" ) // 0C80 0692 0760 cmpi.l #$06920760,D0
+
+#define VSAV_WORLD_KEY CRYPT_PARAMS( "e0cd5881","71babb70", "000000", "100000" ) // 0C80 726A 4BAF cmpi.l #$726A4BAF,D0
+#define VSAV_USA_KEY CRYPT_PARAMS( "a62ea0ee","573e03e6", "000000", "100000" ) // 0C80 726A 4BAF cmpi.l #$726A4BAF,D0
+#define VSAV_JAPAN_KEY CRYPT_PARAMS( "fa8f4e33","a4b881b9", "000000", "100000" ) // 0C80 726A 4BAF cmpi.l #$726A4BAF,D0
+#define VSAV_ASIA_KEY CRYPT_PARAMS( "47ee9930","90b412ac", "000000", "100000" ) // 0C80 726A 4BAF cmpi.l #$726A4BAF,D0
+#define VSAV_HISPANIC_KEY CRYPT_PARAMS( "b2d37c8d","d3b7aadd", "000000", "100000" ) // 0C80 726A 4BAF cmpi.l #$726A4BAF,D0
+
+#define VSAV2_JAPAN_KEY CRYPT_PARAMS( "d681e4f4","60371edf", "000000", "100000" ) // 0C80 0692 0760 cmpi.l #$06920760,D0
+
+#define MVSC_WORLD_KEY CRYPT_PARAMS( "48025ade","1c697b27", "000000", "100000" ) // 0C81 1972 0121 cmpi.l #$19720121,D1
+#define MVSC_USA_KEY CRYPT_PARAMS( "692dc41b","7ef1c805", "000000", "100000" ) // 0C81 1972 0121 cmpi.l #$19720121,D1
+#define MVSC_JAPAN_KEY CRYPT_PARAMS( "afc16138","97123eb0", "000000", "100000" ) // 0C81 1972 0121 cmpi.l #$19720121,D1
+#define MVSC_ASIA_KEY CRYPT_PARAMS( "f248aec6","7905cd17", "000000", "100000" ) // 0C81 1972 0121 cmpi.l #$19720121,D1
+#define MVSC_HISPANIC_KEY CRYPT_PARAMS( "9d5c7a23","e56b18ef", "000000", "100000" ) // 0C81 1972 0121 cmpi.l #$19720121,D1
+#define MVSC_BRAZIL_KEY CRYPT_PARAMS( "0874d6eb","51c2b798", "000000", "100000" ) // 0C81 1972 0121 cmpi.l #$19720121,D1
+
+#define SFA3_WORLD_KEY CRYPT_PARAMS( "6abfc8e0","2780ddc1", "000000", "100000" ) // 0C80 1C62 F5A8 cmpi.l #$1C62F5A8,D0
+#define SFA3_USA_KEY CRYPT_PARAMS( "e7bbf0e5","67943248", "000000", "100000" ) // 0C80 1C62 F5A8 cmpi.l #$1C62F5A8,D0
+#define SFA3_HISPANIC_KEY CRYPT_PARAMS( "8422df8c","7b17a361", "000000", "100000" ) // 0C80 1C62 F5A8 cmpi.l #$1C62F5A8,D0
+#define SFA3_BRAZIL_KEY CRYPT_PARAMS( "d421c0b2","8116d296", "000000", "100000" ) // 0C80 1C62 F5A8 cmpi.l #$1C62F5A8,D0
+#define SFA3_JAPAN_KEY CRYPT_PARAMS( "7d49f803","0cbe2d79", "000000", "100000" ) // 0C80 1C62 F5A8 cmpi.l #$1C62F5A8,D0
+#define SFA3_ASIA_KEY CRYPT_PARAMS( "990b9301","a4e42c7e", "000000", "100000" ) // 0C80 1C62 F5A8 cmpi.l #$1C62F5A8,D0
+
+#define JYANGOKU_JAPAN_KEY CRYPT_PARAMS( "6ca42ae6","92f63f59", "000000", "400000" ) // 0C80 3652 1573 cmpi.l #$36521573,D0 // range unknown
+
+#define HSF2_USA_KEY CRYPT_PARAMS( "5a369ddd","fea3189c", "000000", "100000" ) // 0838 0007 2000 btst #7,$2000
+#define HSF2_ASIA_KEY CRYPT_PARAMS( "b8ed3630","aae30a3d", "000000", "100000" ) // 0838 0007 2000 btst #7,$2000
+#define HSF2_JAPAN_KEY CRYPT_PARAMS( "65d82fe0","dbb83e47", "000000", "100000" ) // 0838 0007 2000 btst #7,$2000
+
+#define GIGAWING_USA_KEY CRYPT_PARAMS( "e52de290","1b60d780", "000000", "100000" ) // 0C81 1972 1027 cmpi.l #$19721027,D1
+#define GIGAWING_JAPAN_KEY CRYPT_PARAMS( "1126196a","bef50895", "000000", "100000" ) // 0C81 1972 1027 cmpi.l #$19721027,D1
+#define GIGAWING_ASIA_KEY CRYPT_PARAMS( "3506a85a","66b1b768", "000000", "100000" ) // 0C81 1972 1027 cmpi.l #$19721027,D1
+#define GIGAWING_HISPANIC_KEY CRYPT_PARAMS( "cea74211","400da385", "000000", "100000" ) // 0C81 1972 1027 cmpi.l #$19721027,D1
+#define GIGAWING_BRAZIL_KEY CRYPT_PARAMS( "0fe745b0","96ef7f9d", "000000", "100000" ) // 0C81 1972 1027 cmpi.l #$19721027,D1
+
+#define MMATRIX_USA_KEY CRYPT_PARAMS( "ac9ebd79","410467df", "000000", "180000" ) // B6C0 B447 BACF cmpa.w D0,A3 cmp.w D7,D2 cmpa.w A7,A5
+#define MMATRIX_JAPAN_KEY CRYPT_PARAMS( "4df81e95","72ed9823", "000000", "180000" ) // B6C0 B447 BACF cmpa.w D0,A3 cmp.w D7,D2 cmpa.w A7,A5
+
+#define MPANG_ALLREGIONS_KEY CRYPT_PARAMS( "95f741c6","e547a21b", "000000", "100000" ) // 0C84 347D 89A3 cmpi.l #$347D89A3,D4
+
+#define PZLOOP2_ALLREGIONS_KEY CRYPT_PARAMS( "a054f812","c40d36b4", "000000", "400000" ) // 0C82 9A73 15F1 cmpi.l #$9A7315F1,D2
+
+#define CHOKO_JAPAN_KEY CRYPT_PARAMS( "d3fb12c6","7f8e17b5", "000000", "400000" ) // 0C86 4D17 5B3C cmpi.l #$4D175B3C,D6
+
+#define DIMAHOO_WORLD_KEY CRYPT_PARAMS( "0ddb8e40","2817fd2b", "000000", "080000" ) // BE4C B244 B6C5 cmp.w A4,D7 cmp.w D4,D1 cmpa.w D5,A3
+#define DIMAHOO_USA_KEY CRYPT_PARAMS( "6575af59","b0fea691", "000000", "080000" ) // BE4C B244 B6C5 cmp.w A4,D7 cmp.w D4,D1 cmpa.w D5,A3
+#define DIMAHOO_JAPAN_KEY CRYPT_PARAMS( "97f7be58","6121eb62", "000000", "080000" ) // BE4C B244 B6C5 cmp.w A4,D7 cmp.w D4,D1 cmpa.w D5,A3
+
+#define _1944_USA_KEY CRYPT_PARAMS( "1d3e724c","8b59fc7a", "000000", "080000" ) // 0C86 7B5D 94F1 cmpi.l #$7B5D94F1,D6
+#define _1944_JAPAN_KEY CRYPT_PARAMS( "23d79c3a","e18b2746", "000000", "080000" ) // 0C86 7B5D 94F1 cmpi.l #$7B5D94F1,D6
+
+#define PROGEAR_USA_KEY CRYPT_PARAMS( "639ad8c6","ef130df3", "000000", "400000" ) // 0C81 63A1 B8D3 cmpi.l #$63A1B8D3,D1
+#define PROGEAR_JAPAN_KEY CRYPT_PARAMS( "9f7edc56","39fb47be", "000000", "400000" ) // 0C81 63A1 B8D3 cmpi.l #$63A1B8D3,D1
+#define PROGEAR_ASIA_KEY CRYPT_PARAMS( "658ab128","fddc9b5e", "000000", "400000" ) // 0C81 63A1 B8D3 cmpi.l #$63A1B8D3,D1
diff --git a/src/mame/machine/deco102.c b/src/mame/machine/deco102.c
index 5441ae9b0a6..3f0c79143f3 100644
--- a/src/mame/machine/deco102.c
+++ b/src/mame/machine/deco102.c
@@ -49,21 +49,13 @@ static UINT16 decrypt(UINT16 data, int address, int select_xor)
bs[8],bs[9],bs[10],bs[11],bs[12],bs[13],bs[14],bs[15]);
}
-void deco102_decrypt_cpu(running_machine &machine, const char *cputag, int address_xor, int data_select_xor, int opcode_select_xor)
+void deco102_decrypt_cpu(UINT16 *rom, UINT16 *opcodes, int size, int address_xor, int data_select_xor, int opcode_select_xor)
{
- int i;
- address_space &space = machine.device(cputag)->memory().space(AS_PROGRAM);
- UINT16 *rom = (UINT16 *)machine.root_device().memregion(cputag)->base();
- int size = machine.root_device().memregion(cputag)->bytes();
- UINT16 *opcodes = auto_alloc_array(machine, UINT16, size / 2);
std::vector<UINT16> buf(size / 2);
memcpy(&buf[0], rom, size);
- space.set_decrypted_region(0, size - 1, opcodes);
- ((m68000_base_device*)machine.device(cputag))->set_encrypted_opcode_range(0, size);
-
- for (i = 0; i < size / 2; i++)
+ for (int i = 0; i < size / 2; i++)
{
int src;
diff --git a/src/mame/machine/deco222.c b/src/mame/machine/deco222.c
index ebc6dc46f9a..1df8a720dd2 100644
--- a/src/mame/machine/deco222.c
+++ b/src/mame/machine/deco222.c
@@ -25,9 +25,9 @@ void deco_222_device::device_reset()
static_cast<mi_decrypt *>(mintf)->had_written = false;
}
-UINT8 deco_222_device::mi_decrypt::read_decrypted(UINT16 adr)
+UINT8 deco_222_device::mi_decrypt::read_sync(UINT16 adr)
{
- return BITSWAP8(direct->read_raw_byte(adr) ,7,5,6,4,3,2,1,0);
+ return BITSWAP8(direct->read_byte(adr) ,7,5,6,4,3,2,1,0);
}
@@ -49,7 +49,7 @@ void deco_c10707_device::device_reset()
static_cast<mi_decrypt *>(mintf)->had_written = false;
}
-UINT8 deco_c10707_device::mi_decrypt::read_decrypted(UINT16 adr)
+UINT8 deco_c10707_device::mi_decrypt::read_sync(UINT16 adr)
{
- return BITSWAP8(direct->read_raw_byte(adr) ,7,5,6,4,3,2,1,0);
+ return BITSWAP8(direct->read_byte(adr) ,7,5,6,4,3,2,1,0);
}
diff --git a/src/mame/machine/deco222.h b/src/mame/machine/deco222.h
index d221d59b91e..042e2bbbd98 100644
--- a/src/mame/machine/deco222.h
+++ b/src/mame/machine/deco222.h
@@ -14,7 +14,7 @@ protected:
bool had_written;
virtual ~mi_decrypt() {}
- virtual UINT8 read_decrypted(UINT16 adr);
+ virtual UINT8 read_sync(UINT16 adr);
};
virtual void device_start();
@@ -36,7 +36,7 @@ protected:
bool had_written;
virtual ~mi_decrypt() {}
- virtual UINT8 read_decrypted(UINT16 adr);
+ virtual UINT8 read_sync(UINT16 adr);
};
virtual void device_start();
diff --git a/src/mame/machine/decocpu6.c b/src/mame/machine/decocpu6.c
index 98542ff12fb..957c602976f 100644
--- a/src/mame/machine/decocpu6.c
+++ b/src/mame/machine/decocpu6.c
@@ -24,10 +24,10 @@ void deco_cpu6_device::device_reset()
m6502_device::device_reset();
}
-UINT8 deco_cpu6_device::mi_decrypt::read_decrypted(UINT16 adr)
+UINT8 deco_cpu6_device::mi_decrypt::read_sync(UINT16 adr)
{
if (adr&1)
- return BITSWAP8(direct->read_raw_byte(adr),6,4,7,5,3,2,1,0);
+ return BITSWAP8(direct->read_byte(adr),6,4,7,5,3,2,1,0);
else
- return direct->read_raw_byte(adr);
+ return direct->read_byte(adr);
}
diff --git a/src/mame/machine/decocpu6.h b/src/mame/machine/decocpu6.h
index 6e6fc64effa..678338027fc 100644
--- a/src/mame/machine/decocpu6.h
+++ b/src/mame/machine/decocpu6.h
@@ -13,7 +13,7 @@ protected:
class mi_decrypt : public mi_default_normal {
public:
virtual ~mi_decrypt() {}
- virtual UINT8 read_decrypted(UINT16 adr);
+ virtual UINT8 read_sync(UINT16 adr);
};
virtual void device_start();
diff --git a/src/mame/machine/decocpu7.c b/src/mame/machine/decocpu7.c
index e77f47b057f..dc6bb85dff8 100644
--- a/src/mame/machine/decocpu7.c
+++ b/src/mame/machine/decocpu7.c
@@ -20,9 +20,9 @@ void deco_cpu7_device::device_reset()
static_cast<mi_decrypt *>(mintf)->had_written = false;
}
-UINT8 deco_cpu7_device::mi_decrypt::read_decrypted(UINT16 adr)
+UINT8 deco_cpu7_device::mi_decrypt::read_sync(UINT16 adr)
{
- UINT8 res = direct->read_raw_byte(adr);
+ UINT8 res = direct->read_byte(adr);
if(had_written) {
had_written = false;
if((adr & 0x0104) == 0x0104)
diff --git a/src/mame/machine/decocpu7.h b/src/mame/machine/decocpu7.h
index 0cf2dbf4bfd..26f67a11fc1 100644
--- a/src/mame/machine/decocpu7.h
+++ b/src/mame/machine/decocpu7.h
@@ -14,7 +14,7 @@ protected:
bool had_written;
virtual ~mi_decrypt() {}
- virtual UINT8 read_decrypted(UINT16 adr);
+ virtual UINT8 read_sync(UINT16 adr);
virtual void write(UINT16 adr, UINT8 val);
};
diff --git a/src/mame/machine/fd1089.c b/src/mame/machine/fd1089.c
index c9cea731f83..c273c4949b4 100644
--- a/src/mame/machine/fd1089.c
+++ b/src/mame/machine/fd1089.c
@@ -208,6 +208,9 @@ const fd1089_base_device::decrypt_parameters fd1089_base_device::s_data_params_a
{ 0xac, 1,6,3,5,0,7,4,2 },
};
+static ADDRESS_MAP_START( decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 16, fd1094_device )
+ AM_RANGE(0x00000, 0xfffff) AM_ROM AM_SHARE(":fd1089_decrypted_opcodes")
+ADDRESS_MAP_END
//**************************************************************************
@@ -219,10 +222,14 @@ const fd1089_base_device::decrypt_parameters fd1089_base_device::s_data_params_a
//-------------------------------------------------
fd1089_base_device::fd1089_base_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source)
- : m68000_device(mconfig, tag, owner, clock, shortname, source)
+ : m68000_device(mconfig, tag, owner, clock, shortname, source),
+ m_decrypted_opcodes(*this, ":fd1089_decrypted_opcodes")
{
// override the name after the m68000 initializes
m_name.assign(name);
+
+ // add the decrypted opcodes map
+ m_address_map[AS_DECRYPTED_OPCODES] = ADDRESS_MAP_NAME(decrypted_opcodes_map);
}
fd1089a_device::fd1089a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
@@ -257,18 +264,12 @@ void fd1089_base_device::device_start()
// determine length and resize our internal buffers
UINT32 romsize = region()->bytes();
m_plaintext.resize(romsize/2);
- m_decrypted_opcodes.resize(romsize/2);
// copy the plaintext
memcpy(&m_plaintext[0], rombase, romsize);
// decrypt it, overwriting original data with the decrypted data
decrypt(0x000000, romsize, &m_plaintext[0], &m_decrypted_opcodes[0], rombase);
-
- // mark the ROM region as decrypted, pointing to the opcodes (if it is mapped)
- address_space &program = space(AS_PROGRAM);
- if (program.get_read_ptr(0) != NULL)
- program.set_decrypted_region(0x000000, romsize - 1, &m_decrypted_opcodes[0]);
}
diff --git a/src/mame/machine/fd1089.h b/src/mame/machine/fd1089.h
index 0e66d1e2bdc..e8e106b5136 100644
--- a/src/mame/machine/fd1089.h
+++ b/src/mame/machine/fd1089.h
@@ -57,7 +57,7 @@ protected:
// internal state
const UINT8 * m_key;
std::vector<UINT16> m_plaintext;
- std::vector<UINT16> m_decrypted_opcodes;
+ required_shared_ptr<UINT16> m_decrypted_opcodes;
// internal types
struct decrypt_parameters
diff --git a/src/mame/machine/fd1094.c b/src/mame/machine/fd1094.c
index 32c369ef221..edf6dc09989 100644
--- a/src/mame/machine/fd1094.c
+++ b/src/mame/machine/fd1094.c
@@ -35,8 +35,8 @@
if bit 13 of the current value is 1; the fourth one is executed whenever one
of the first three has been executed; the fifth one is always executed. Every
step can be thought as consisting of a serie of operations, with some steps
- avoiding some of them: a uncondicional bitswap, some conditional XORs,
- a unconditional XOR and some condicional bitswaps.
+ avoiding some of them: a unconditional bitswap, some conditional XORs,
+ a unconditional XOR and some conditional bitswaps.
In the end, the decryption of a value at a given address is controlled by 32
boolean variables; 8 of them change at every address (repeating after 0x2000
@@ -472,6 +472,9 @@ const UINT16 fd1094_device::s_masked_opcodes[] =
0xde3a,0xde7a,0xdeba,0xdefa, 0xdffa
};
+static ADDRESS_MAP_START( decrypted_opcodes_map, AS_DECRYPTED_OPCODES, 16, fd1094_device )
+ AM_RANGE(0x00000, 0xfffff) AM_ROMBANK(":fd1094_decrypted_opcodes")
+ADDRESS_MAP_END
//**************************************************************************
@@ -534,7 +537,8 @@ UINT16 *fd1094_decryption_cache::decrypted_opcodes(UINT8 state)
return &m_decrypted_opcodes[state][0];
// otherwise, allocate and decrypt
- m_decrypted_opcodes[state].resize(m_size);
+ m_decrypted_opcodes[state].resize(0x200000/2);
+ memset(&m_decrypted_opcodes[state][0], 0, 0x200000);
m_fd1094.decrypt(m_baseaddress, m_size, m_rgnoffset, &m_decrypted_opcodes[state][0], state);
return &m_decrypted_opcodes[state][0];
}
@@ -552,6 +556,7 @@ UINT16 *fd1094_decryption_cache::decrypted_opcodes(UINT8 state)
fd1094_device::fd1094_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: m68000_device(mconfig, tag, owner, clock, "fd1094", __FILE__),
+ m_decrypted_opcodes_bank(*this, ":fd1094_decrypted_opcodes"),
m_state(0x00),
m_irqmode(false),
m_cache(*this),
@@ -562,6 +567,9 @@ fd1094_device::fd1094_device(const machine_config &mconfig, const char *tag, dev
// override the name after the m68000 initializes
m_name.assign("FD1094");
+ // add the decrypted opcodes map
+ m_address_map[AS_DECRYPTED_OPCODES] = ADDRESS_MAP_NAME(decrypted_opcodes_map);
+
// create the initial masked opcode table
memset(m_masked_opcodes_lookup, 0, sizeof(m_masked_opcodes_lookup));
for (int index = 0; index < ARRAY_LENGTH(s_masked_opcodes); index++)
@@ -575,6 +583,8 @@ fd1094_device::fd1094_device(const machine_config &mconfig, const char *tag, dev
for (int opcode = 0; opcode < 65536; opcode += 2)
if ((opcode & 0xff80) == 0x4e80 || (opcode & 0xf0f8) == 0x50c8 || (opcode & 0xf000) == 0x6000)
m_masked_opcodes_lookup[1][opcode >> 4] |= 1 << ((opcode >> 1) & 7);
+
+ m_state_change = state_change_delegate(FUNC(fd1094_device::default_state_change), this);
}
@@ -625,9 +635,6 @@ void fd1094_device::change_state(int newstate)
void fd1094_device::device_start()
{
- // start the base device
- m68000_device::device_start();
-
// find the key
m_key = memregion("key")->base();
if (m_key == NULL)
@@ -655,13 +662,12 @@ void fd1094_device::device_start()
if (m_srcbase == NULL)
throw emu_fatalerror("FD1094 found no data to decrypt!");
- // if address 0 is mapped to ROM, assume this is a state memory mapping and
- // use the internal state change callback
- if (space(AS_PROGRAM).get_read_ptr(0) != NULL)
- m_state_change = state_change_delegate(FUNC(fd1094_device::default_state_change), this);
-
// determine length and configure our cache
m_cache.configure(0x000000, m_srcbytes, 0x000000);
+ change_state(STATE_RESET);
+
+ // start the base device
+ m68000_device::device_start();
// register for the state changing callbacks we need in the m68000
set_cmpild_callback(write32_delegate(FUNC(fd1094_device::cmp_callback),this));
@@ -683,7 +689,7 @@ void fd1094_device::device_reset()
// flush the cache and switch to the reset state
m_cache.reset();
change_state(STATE_RESET);
-
+ fprintf(stderr, "reset done\n");
// reset the parent
m68000_device::device_reset();
}
@@ -913,7 +919,7 @@ void fd1094_device::decrypt(offs_t baseaddr, UINT32 size, const UINT16 *srcptr,
void fd1094_device::default_state_change(UINT8 state)
{
- space(AS_PROGRAM).set_decrypted_region(0x000000, m_srcbytes - 1, m_cache.decrypted_opcodes(state));
+ m_decrypted_opcodes_bank->set_base(m_cache.decrypted_opcodes(state));
}
diff --git a/src/mame/machine/fd1094.h b/src/mame/machine/fd1094.h
index 3439a4c288c..db5eb5cb83e 100644
--- a/src/mame/machine/fd1094.h
+++ b/src/mame/machine/fd1094.h
@@ -88,6 +88,8 @@ public:
};
protected:
+ required_memory_bank m_decrypted_opcodes_bank;
+
// device overrides
virtual void device_start();
virtual void device_reset();
diff --git a/src/mame/machine/fddebug.c b/src/mame/machine/fddebug.c
index 9abaec03ef2..0a78590cb5c 100644
--- a/src/mame/machine/fddebug.c
+++ b/src/mame/machine/fddebug.c
@@ -442,7 +442,7 @@ INLINE int pc_is_valid(address_space &space, UINT32 pc, UINT32 flags)
return 0;
if (pc & 0xff000000)
return 0;
- if (space.direct().read_decrypted_ptr(pc) == NULL)
+ if (space.direct().read_ptr(pc) == NULL)
return 0;
return 1;
}
diff --git a/src/mame/machine/gaplus.c b/src/mame/machine/gaplus.c
index a89f6505ced..377ea6f6233 100644
--- a/src/mame/machine/gaplus.c
+++ b/src/mame/machine/gaplus.c
@@ -2,7 +2,7 @@
// copyright-holders:Manuel Abadia, Ernesto Corvi, Nicola Salmoria
/***************************************************************************
- machine.c
+ gaplus.c
Functions to emulate general aspects of the machine (RAM, ROM, interrupts,
I/O ports)
@@ -20,7 +20,7 @@
* *
************************************************************************************/
-WRITE8_MEMBER(gaplus_state::gaplus_customio_3_w)
+WRITE8_MEMBER(gaplus_state::customio_3_w)
{
if ((offset == 0x09) && (data >= 0x0f))
m_samples->start(0,0);
@@ -29,7 +29,7 @@ WRITE8_MEMBER(gaplus_state::gaplus_customio_3_w)
}
-READ8_MEMBER(gaplus_state::gaplus_customio_3_r)
+READ8_MEMBER(gaplus_state::customio_3_r)
{
int mode = m_customio_3[8];
diff --git a/src/mame/machine/inder_sb.c b/src/mame/machine/inder_sb.c
index 99b45e98568..5b62cabb5c8 100644
--- a/src/mame/machine/inder_sb.c
+++ b/src/mame/machine/inder_sb.c
@@ -26,10 +26,10 @@ inder_sb_device::inder_sb_device(const machine_config &mconfig, const char *tag,
// hacks for test purposes, these are installed over the program rom so we know when irqs are actually taken
-READ8_MEMBER(inder_sb_device::megaphx_02cc_hack_r) { /*logerror("%04x audicpu IRQ hack 0x02cc\n", machine().device("audiocpu")->safe_pc());*/ int bank = m_soundbank[0] & 7; membank("snddata")->set_entry(bank); return memregion("audiocpu")->base()[0x02cc]; };
-READ8_MEMBER(inder_sb_device::megaphx_02e6_hack_r) { /*logerror("%04x audicpu IRQ hack 0x02e6\n", machine().device("audiocpu")->safe_pc());*/ int bank = m_soundbank[1] & 7; membank("snddata")->set_entry(bank); return memregion("audiocpu")->base()[0x02e6]; };
-READ8_MEMBER(inder_sb_device::megaphx_0309_hack_r) { /*logerror("%04x audicpu IRQ hack 0x0309\n", machine().device("audiocpu")->safe_pc());*/ int bank = m_soundbank[2] & 7; membank("snddata")->set_entry(bank); return memregion("audiocpu")->base()[0x0309]; };
-READ8_MEMBER(inder_sb_device::megaphx_0323_hack_r) { /*logerror("%04x audicpu IRQ hack 0x0323\n", machine().device("audiocpu")->safe_pc());*/ int bank = m_soundbank[3] & 7; membank("snddata")->set_entry(bank); return memregion("audiocpu")->base()[0x0323]; };
+READ8_MEMBER(inder_sb_device::megaphx_02cc_hack_r) { /*logerror("%04x audicpu IRQ hack 0x02cc\n", machine().device("audiocpu")->safe_pc());*/ int bank = m_soundbank[0] & 7; membank("snddata")->set_entry(bank); return memregion("audiocpu")->base()[0x02cc]; }
+READ8_MEMBER(inder_sb_device::megaphx_02e6_hack_r) { /*logerror("%04x audicpu IRQ hack 0x02e6\n", machine().device("audiocpu")->safe_pc());*/ int bank = m_soundbank[1] & 7; membank("snddata")->set_entry(bank); return memregion("audiocpu")->base()[0x02e6]; }
+READ8_MEMBER(inder_sb_device::megaphx_0309_hack_r) { /*logerror("%04x audicpu IRQ hack 0x0309\n", machine().device("audiocpu")->safe_pc());*/ int bank = m_soundbank[2] & 7; membank("snddata")->set_entry(bank); return memregion("audiocpu")->base()[0x0309]; }
+READ8_MEMBER(inder_sb_device::megaphx_0323_hack_r) { /*logerror("%04x audicpu IRQ hack 0x0323\n", machine().device("audiocpu")->safe_pc());*/ int bank = m_soundbank[3] & 7; membank("snddata")->set_entry(bank); return memregion("audiocpu")->base()[0x0323]; }
diff --git a/src/mame/machine/iteagle_fpga.c b/src/mame/machine/iteagle_fpga.c
index 19e6a190a1e..9a70dedc446 100644
--- a/src/mame/machine/iteagle_fpga.c
+++ b/src/mame/machine/iteagle_fpga.c
@@ -50,6 +50,17 @@ void iteagle_fpga_device::device_start()
bank_infos[2].adr = 0x000e0000 & (~(bank_infos[2].size - 1));
m_timer = timer_alloc(0, NULL);
+
+ // virtpool nvram
+ memset(m_ram, 0, sizeof(m_ram));
+ // byte 0x10 is check sum of first 16 bytes
+ // when corrupt the fw writes the following
+ m_ram[0x00/4] = 0x00010207;
+ m_ram[0x04/4] = 0x04010101;
+ m_ram[0x08/4] = 0x01030101;
+ m_ram[0x0c/4] = 0x00000001;
+ m_ram[0x10/4] = 0x00000018;
+
}
void iteagle_fpga_device::device_reset()
diff --git a/src/mame/machine/kabuki.c b/src/mame/machine/kabuki.c
index 038c1f5f422..4be230bc609 100644
--- a/src/mame/machine/kabuki.c
+++ b/src/mame/machine/kabuki.c
@@ -160,58 +160,37 @@ static void kabuki_decode(UINT8 *src,UINT8 *dest_op,UINT8 *dest_data,
-static void mitchell_decode(running_machine &machine, int swap_key1,int swap_key2,int addr_key,int xor_key)
+static void mitchell_decode(UINT8 *src, UINT8 *dst, int size, int swap_key1,int swap_key2,int addr_key,int xor_key)
{
- address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *rom = machine.root_device().memregion("maincpu")->base();
- UINT8 *decrypt = auto_alloc_array(machine, UINT8, machine.root_device().memregion("maincpu")->bytes());
- int numbanks = (machine.root_device().memregion("maincpu")->bytes() - 0x10000) / 0x4000;
- int i;
-
- space.set_decrypted_region(0x0000, 0x7fff, decrypt);
- kabuki_decode(rom,decrypt,rom,0x0000,0x8000, swap_key1,swap_key2,addr_key,xor_key);
-
- rom += 0x10000;
- decrypt += 0x10000;
- for (i = 0; i < numbanks; i++)
- kabuki_decode(rom+i*0x4000,decrypt+i*0x4000,rom+i*0x4000,0x8000,0x4000, swap_key1,swap_key2,addr_key,xor_key);
-
- machine.root_device().membank("bank1")->configure_decrypted_entries(0, numbanks, decrypt, 0x4000);
-/*
- {
- FILE *f;
- f = fopen("a","wb");
- fwrite(rom,1,0x8000,f);
- fwrite(rom+0x10000,1,0x40000,f);
- fclose(f);
- }
-*/
+ int numbanks = (size - 0x10000) / 0x4000;
+
+ kabuki_decode(src,dst,src,0x0000,0x8000, swap_key1,swap_key2,addr_key,xor_key);
+
+ src += 0x10000;
+ dst += 0x10000;
+ for (int i = 0; i < numbanks; i++)
+ kabuki_decode(src+i*0x4000,dst+i*0x4000,src+i*0x4000,0x8000,0x4000, swap_key1,swap_key2,addr_key,xor_key);
}
-void mgakuen2_decode(running_machine &machine) { mitchell_decode(machine,0x76543210,0x01234567,0xaa55,0xa5); }
-void pang_decode(running_machine &machine) { mitchell_decode(machine,0x01234567,0x76543210,0x6548,0x24); }
-void cworld_decode(running_machine &machine) { mitchell_decode(machine,0x04152637,0x40516273,0x5751,0x43); }
-void hatena_decode(running_machine &machine) { mitchell_decode(machine,0x45670123,0x45670123,0x5751,0x43); }
-void spang_decode(running_machine &machine) { mitchell_decode(machine,0x45670123,0x45670123,0x5852,0x43); }
-void spangj_decode(running_machine &machine) { mitchell_decode(machine,0x45123670,0x67012345,0x55aa,0x5a); }
-void sbbros_decode(running_machine &machine) { mitchell_decode(machine,0x45670123,0x45670123,0x2130,0x12); }
-void marukin_decode(running_machine &machine) { mitchell_decode(machine,0x54321076,0x54321076,0x4854,0x4f); }
-void qtono1_decode(running_machine &machine) { mitchell_decode(machine,0x12345670,0x12345670,0x1111,0x11); }
-void qsangoku_decode(running_machine &machine) { mitchell_decode(machine,0x23456701,0x23456701,0x1828,0x18); }
-void block_decode(running_machine &machine) { mitchell_decode(machine,0x02461357,0x64207531,0x0002,0x01); }
+void mgakuen2_decode(UINT8 *src, UINT8 *dst, int size) { mitchell_decode(src,dst,size,0x76543210,0x01234567,0xaa55,0xa5); }
+void pang_decode(UINT8 *src, UINT8 *dst, int size) { mitchell_decode(src,dst,size,0x01234567,0x76543210,0x6548,0x24); }
+void cworld_decode(UINT8 *src, UINT8 *dst, int size) { mitchell_decode(src,dst,size,0x04152637,0x40516273,0x5751,0x43); }
+void hatena_decode(UINT8 *src, UINT8 *dst, int size) { mitchell_decode(src,dst,size,0x45670123,0x45670123,0x5751,0x43); }
+void spang_decode(UINT8 *src, UINT8 *dst, int size) { mitchell_decode(src,dst,size,0x45670123,0x45670123,0x5852,0x43); }
+void spangj_decode(UINT8 *src, UINT8 *dst, int size) { mitchell_decode(src,dst,size,0x45123670,0x67012345,0x55aa,0x5a); }
+void sbbros_decode(UINT8 *src, UINT8 *dst, int size) { mitchell_decode(src,dst,size,0x45670123,0x45670123,0x2130,0x12); }
+void marukin_decode(UINT8 *src, UINT8 *dst, int size) { mitchell_decode(src,dst,size,0x54321076,0x54321076,0x4854,0x4f); }
+void qtono1_decode(UINT8 *src, UINT8 *dst, int size) { mitchell_decode(src,dst,size,0x12345670,0x12345670,0x1111,0x11); }
+void qsangoku_decode(UINT8 *src, UINT8 *dst, int size) { mitchell_decode(src,dst,size,0x23456701,0x23456701,0x1828,0x18); }
+void block_decode(UINT8 *src, UINT8 *dst, int size) { mitchell_decode(src,dst,size,0x02461357,0x64207531,0x0002,0x01); }
-static void cps1_decode(running_machine &machine,int swap_key1,int swap_key2,int addr_key,int xor_key)
+static void cps1_decode(UINT8 *src, UINT8 *dst,int swap_key1,int swap_key2,int addr_key,int xor_key)
{
- address_space &space = machine.device("audiocpu")->memory().space(AS_PROGRAM);
- UINT8 *decrypt = auto_alloc_array(machine, UINT8, 0x8000);
- UINT8 *rom = machine.root_device().memregion("audiocpu")->base();
-
- space.set_decrypted_region(0x0000, 0x7fff, decrypt);
- kabuki_decode(rom,decrypt,rom,0x0000,0x8000, swap_key1,swap_key2,addr_key,xor_key);
+ kabuki_decode(src,dst,src,0x0000,0x8000, swap_key1,swap_key2,addr_key,xor_key);
}
-void wof_decode(running_machine &machine) { cps1_decode(machine,0x01234567,0x54163072,0x5151,0x51); }
-void dino_decode(running_machine &machine) { cps1_decode(machine,0x76543210,0x24601357,0x4343,0x43); }
-void punisher_decode(running_machine &machine) { cps1_decode(machine,0x67452103,0x75316024,0x2222,0x22); }
-void slammast_decode(running_machine &machine) { cps1_decode(machine,0x54321076,0x65432107,0x3131,0x19); }
+void wof_decode(UINT8 *src, UINT8 *dst) { cps1_decode(src,dst,0x01234567,0x54163072,0x5151,0x51); }
+void dino_decode(UINT8 *src, UINT8 *dst) { cps1_decode(src,dst,0x76543210,0x24601357,0x4343,0x43); }
+void punisher_decode(UINT8 *src, UINT8 *dst) { cps1_decode(src,dst,0x67452103,0x75316024,0x2222,0x22); }
+void slammast_decode(UINT8 *src, UINT8 *dst) { cps1_decode(src,dst,0x54321076,0x65432107,0x3131,0x19); }
diff --git a/src/mame/machine/kabuki.h b/src/mame/machine/kabuki.h
index e5e1b9bfc76..1b9165bea07 100644
--- a/src/mame/machine/kabuki.h
+++ b/src/mame/machine/kabuki.h
@@ -2,18 +2,18 @@
// copyright-holders:Nicola Salmoria
#include "emu.h"
-void mgakuen2_decode(running_machine &machine);
-void pang_decode(running_machine &machine);
-void cworld_decode(running_machine &machine);
-void hatena_decode(running_machine &machine);
-void spang_decode(running_machine &machine);
-void spangj_decode(running_machine &machine);
-void sbbros_decode(running_machine &machine);
-void marukin_decode(running_machine &machine);
-void qtono1_decode(running_machine &machine);
-void qsangoku_decode(running_machine &machine);
-void block_decode(running_machine &machine);
-void wof_decode(running_machine &machine);
-void dino_decode(running_machine &machine);
-void punisher_decode(running_machine &machine);
-void slammast_decode(running_machine &machine);
+void mgakuen2_decode(UINT8 *src, UINT8 *dst, int size);
+void pang_decode(UINT8 *src, UINT8 *dst, int size);
+void cworld_decode(UINT8 *src, UINT8 *dst, int size);
+void hatena_decode(UINT8 *src, UINT8 *dst, int size);
+void spang_decode(UINT8 *src, UINT8 *dst, int size);
+void spangj_decode(UINT8 *src, UINT8 *dst, int size);
+void sbbros_decode(UINT8 *src, UINT8 *dst, int size);
+void marukin_decode(UINT8 *src, UINT8 *dst, int size);
+void qtono1_decode(UINT8 *src, UINT8 *dst, int size);
+void qsangoku_decode(UINT8 *src, UINT8 *dst, int size);
+void block_decode(UINT8 *src, UINT8 *dst, int size);
+void wof_decode(UINT8 *src, UINT8 *dst);
+void dino_decode(UINT8 *src, UINT8 *dst);
+void punisher_decode(UINT8 *src, UINT8 *dst);
+void slammast_decode(UINT8 *src, UINT8 *dst);
diff --git a/src/mame/machine/konami1.c b/src/mame/machine/konami1.c
index 75d4a2b01b4..c0240bcbc78 100644
--- a/src/mame/machine/konami1.c
+++ b/src/mame/machine/konami1.c
@@ -1,60 +1,50 @@
// license:BSD-3-Clause
-// copyright-holders:Nicola Salmoria, Chris Hardy
+// copyright-holders:Olivier Galibert
/***************************************************************************
- The Konami_1 CPU is a 6809 with opcodes scrambled. Here is how to
- descramble them.
+ The Konami_1 CPU is a 6809 with opcodes scrambled.
***************************************************************************/
#include "emu.h"
#include "konami1.h"
+const device_type KONAMI1 = &device_creator<konami1_device>;
-static UINT8 konami1_decodebyte( UINT8 opcode, UINT16 address )
+konami1_device::konami1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : m6809_base_device(mconfig, "KONAMI-1", tag, owner, clock, KONAMI1, 1, "konami1", __FILE__)
{
-/*
->
-> CPU_D7 = (EPROM_D7 & ~ADDRESS_1) | (~EPROM_D7 & ADDRESS_1) >
-> CPU_D6 = EPROM_D6
->
-> CPU_D5 = (EPROM_D5 & ADDRESS_1) | (~EPROM_D5 & ~ADDRESS_1) >
-> CPU_D4 = EPROM_D4
->
-> CPU_D3 = (EPROM_D3 & ~ADDRESS_3) | (~EPROM_D3 & ADDRESS_3) >
-> CPU_D2 = EPROM_D2
->
-> CPU_D1 = (EPROM_D1 & ADDRESS_3) | (~EPROM_D1 & ~ADDRESS_3) >
-> CPU_D0 = EPROM_D0
->
-*/
- UINT8 xormask;
-
-
- xormask = 0;
- if (address & 0x02) xormask |= 0x80;
- else xormask |= 0x20;
- if (address & 0x08) xormask |= 0x08;
- else xormask |= 0x02;
-
- return opcode ^ xormask;
+ m_boundary = 0x0000;
}
+void konami1_device::device_start()
+{
+ m_mintf = new mi_konami1(m_boundary);
+ m6809_base_device::device_start();
+}
-
-UINT8 *konami1_decode(running_machine &machine, const char *cpu)
+void konami1_device::set_encryption_boundary(UINT16 adr)
{
- address_space &space = machine.device(cpu)->memory().space(AS_PROGRAM);
- const UINT8 *rom = machine.root_device().memregion(cpu)->base();
- int size = machine.root_device().memregion(cpu)->bytes();
- int A;
+ m_boundary = adr;
+ if(m_mintf)
+ static_cast<mi_konami1 *>(m_mintf)->m_boundary = adr;
+}
- UINT8 *decrypted = auto_alloc_array(machine, UINT8, size);
- space.set_decrypted_region(0x0000, 0xffff, decrypted);
+konami1_device::mi_konami1::mi_konami1(UINT16 adr)
+{
+ m_boundary = adr;
+}
- for (A = 0;A < size;A++)
- {
- decrypted[A] = konami1_decodebyte(rom[A],A);
+UINT8 konami1_device::mi_konami1::read_opcode(UINT16 adr)
+{
+ UINT8 val = m_sdirect->read_byte(adr);
+ if(adr < m_boundary)
+ return val;
+ switch(adr & 0xa) {
+ default:
+ case 0x0: return val ^ 0x22;
+ case 0x2: return val ^ 0x82;
+ case 0x8: return val ^ 0x28;
+ case 0xa: return val ^ 0x88;
}
- return decrypted;
}
diff --git a/src/mame/machine/konami1.h b/src/mame/machine/konami1.h
index 00697959658..1efadd4eee4 100644
--- a/src/mame/machine/konami1.h
+++ b/src/mame/machine/konami1.h
@@ -1,3 +1,26 @@
// license:BSD-3-Clause
-// copyright-holders:Nicola Salmoria, Chris Hardy
-UINT8 *konami1_decode(running_machine &machine, const char *cpu);
+// copyright-holders:Olivier Galibert
+
+#include "cpu/m6809/m6809.h"
+
+class konami1_device : public m6809_base_device {
+public:
+ konami1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ void set_encryption_boundary(UINT16 adr);
+
+protected:
+ class mi_konami1 : public mi_default {
+ public:
+ UINT16 m_boundary;
+ mi_konami1(UINT16 boundary);
+ virtual ~mi_konami1() {}
+ virtual UINT8 read_opcode(UINT16 adr);
+ };
+
+ UINT16 m_boundary;
+
+ virtual void device_start();
+};
+
+extern const device_type KONAMI1;
diff --git a/src/mame/machine/m1comm.c b/src/mame/machine/m1comm.c
new file mode 100644
index 00000000000..03177efcaef
--- /dev/null
+++ b/src/mame/machine/m1comm.c
@@ -0,0 +1,571 @@
+// license:BSD-3-Clause
+// copyright-holders:Ariane Fugmann
+
+/*
+Comm PCB
+--------
+
+MODEL-1 COMMUNICATION BD 837-8842 171-6293B (C) SEGA 1992
+|--------------------------------------------------------------------------------|
+| |
+| MB89237A MB89374 |
+| JP4 LED1 |
+| 15112.17 Z80 |
+| JP2 JP3 75179 |
+| MB8464 315-5624 JP6 |
+| 315-5547 |
+| 315-5611 SW1 PC910 CN4|
+| |
+| PC910 CN5|
+| MB8421 MB8431 JP7 |
+| JP5 |
+| JP8 CN7|
+| CN1 CN2 |
+| |---------------------------------| |---------------------------------| CN6|
+| |---------------------------------| |---------------------------------| |
+|--------------------------------------------------------------------------------|
+Notes:
+ 15112.17 - AMD AM27C100 128k x8 EPROM (DIP32, labelled 'EPR-15112')
+ Z80 - Zilog Z0840004PSC Z80 CPU, running at 4.000MHz (DIP40)
+ MB8464 - Fujitsu MB8464 8k x8 SRAM (DIP28)
+ MB8421 - Fujitsu MB8421-12LP 2k x8 SRAM (SDIP52)
+ MB8431 - Fujitsu MB8431-90LP 2k x8 SRAM (SDIP52)
+ MB89237A - Fujitsu MB89237A DMA-Controller (DIP20) [most likely i8237A clone]
+ MB89374 - Fujitsu MB89374 Data Link Controller (SDIP42)
+ 75179 - Texas Instruments SN75179 Differential Driver and Receiver Pair (DIP8)
+ 315-5547 - AMI 18CV8PC-25 PAL (DIP20)
+ 315-5624 - MMI PAL16L8BCN PAL (DIP20)
+ 315-5611 - Lattice GAL16V8A PAL (DIP20)
+ PC910 - Sharp PC910 opto-isolator (x2, DIP8)
+ SW1 - Push Button Switch (enables board)
+ CN1, CN2 - Connectors to join Comm board to Video board
+ CN4 - 8 pin connector (DIFFERENTIAL port)
+ CN5 - 6 pin connector (SERIAL port)
+ CN6, CN7 - TOSLINK-Connectors for network optical cable link
+ JP2 - Jumper, set to 2-3 (connected to EPROM A15)
+ JP3 - Jumper, set to 1-2 (connected to EPROM A16)
+ JP4 - Jumper, set to 1-2
+ JP5 - Jumper, shorted (enables TOSLINK RX channel)
+ JP6 - Jumper, not shorted (enables DIFFERERENTIAL RX channel)
+ JP7 - Jumper, not shorted (enables SERIAL RX channel)
+ JP8 - Jumper, set to 1-2 (selects CLOCK SOURCE)
+*/
+
+#include "machine/m1comm.h"
+
+#define Z80_TAG "m1commcpu"
+
+//#define __M1COMM_VERBOSE__
+
+/*************************************
+ * M1COMM Memory Map
+ *************************************/
+static ADDRESS_MAP_START( m1comm_mem, AS_PROGRAM, 8, m1comm_device )
+ AM_RANGE(0x0000, 0x7fff) AM_ROM
+ AM_RANGE(0x8000, 0x9fff) AM_RAM
+ AM_RANGE(0xC000, 0xffff) AM_READWRITE(share_r, share_w)
+ADDRESS_MAP_END
+
+/*************************************
+ * M1COMM I/O Map
+ *************************************/
+static ADDRESS_MAP_START( m1comm_io, AS_IO, 8, m1comm_device )
+ ADDRESS_MAP_GLOBAL_MASK(0xff)
+ AM_RANGE(0x00, 0x1F) AM_READWRITE(dlc_reg_r, dlc_reg_w)
+ AM_RANGE(0x20, 0x2F) AM_READWRITE(dma_reg_r, dma_reg_w)
+ AM_RANGE(0x40, 0x40) AM_READWRITE(syn_r, syn_w)
+ AM_RANGE(0x60, 0x60) AM_READWRITE(zfg_r, zfg_w)
+ AM_RANGE(0xFFFF, 0xFFFF) AM_RAM
+ADDRESS_MAP_END
+
+MACHINE_CONFIG_FRAGMENT( m1comm )
+ MCFG_CPU_ADD(Z80_TAG, Z80, 4000000) /* 32 MHz / 8 */
+ MCFG_CPU_PROGRAM_MAP(m1comm_mem)
+ MCFG_CPU_IO_MAP(m1comm_io)
+MACHINE_CONFIG_END
+
+ROM_START( m1comm )
+ ROM_REGION( 0x20000, Z80_TAG, ROMREGION_ERASEFF )
+ ROM_LOAD( "epr-15112.17", 0x0000, 0x20000, CRC(4950E771) )
+ROM_END
+
+//**************************************************************************
+// GLOBAL VARIABLES
+//**************************************************************************
+
+const device_type M1COMM = &device_creator<m1comm_device>;
+
+//-------------------------------------------------
+// machine_config_additions - device-specific
+// machine configurations
+//-------------------------------------------------
+
+machine_config_constructor m1comm_device::device_mconfig_additions() const
+{
+ return MACHINE_CONFIG_NAME( m1comm );
+}
+
+//-------------------------------------------------
+// rom_region - device-specific ROM region
+//-------------------------------------------------
+
+const rom_entry *m1comm_device::device_rom_region() const
+{
+ return ROM_NAME( m1comm );
+}
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// m1comm_device - constructor
+//-------------------------------------------------
+
+m1comm_device::m1comm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ device_t(mconfig, M1COMM, "MODEL-1 COMMUNICATION BD", tag, owner, clock, "m1comm", __FILE__),
+ m_commcpu(*this, Z80_TAG),
+ m_line_rx(OPEN_FLAG_WRITE | OPEN_FLAG_CREATE ),
+ m_line_tx(OPEN_FLAG_READ)
+{
+ // prepare localhost "filename"
+ m_localhost[0] = 0;
+ strcat(m_localhost, "socket.");
+ strcat(m_localhost, mconfig.options().comm_localhost());
+ strcat(m_localhost, ":");
+ strcat(m_localhost, mconfig.options().comm_localport());
+
+ // prepare remotehost "filename"
+ m_remotehost[0] = 0;
+ strcat(m_remotehost, "socket.");
+ strcat(m_remotehost, mconfig.options().comm_remotehost());
+ strcat(m_remotehost, ":");
+ strcat(m_remotehost, mconfig.options().comm_remoteport());
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void m1comm_device::device_start()
+{
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void m1comm_device::device_reset()
+{
+ m_syn = 0;
+ m_zfg = 0;
+ m_cn = 0;
+ m_fg = 0;
+
+ m_commcpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
+}
+
+READ8_MEMBER(m1comm_device::dlc_reg_r)
+{
+ // dirty hack to keep Z80 in RESET state
+ if (!m_cn)
+ {
+ device_reset();
+ return 0xFF;
+ }
+ // dirty hack to keep Z80 in RESET state
+
+ UINT8 result = m_dlc_reg[offset];
+#ifdef __M1COMM_VERBOSE__
+ printf("m1comm-dlc_reg_r: read register %02x for value %02x\n", offset, result);
+#endif
+ return result;
+}
+
+WRITE8_MEMBER(m1comm_device::dlc_reg_w)
+{
+ m_dlc_reg[offset] = data;
+#ifdef __M1COMM_VERBOSE__
+ printf("m1comm-dlc_reg_w: write register %02x for value %02x\n", offset, data);
+#endif
+}
+
+READ8_MEMBER(m1comm_device::dma_reg_r)
+{
+ UINT8 result = m_dma_reg[offset];
+#ifdef __M1COMM_VERBOSE__
+ printf("m1comm-dma_reg_r: read register %02x for value %02x\n", offset, result);
+#endif
+ return result;
+}
+
+WRITE8_MEMBER(m1comm_device::dma_reg_w)
+{
+#ifdef __M1COMM_VERBOSE__
+ printf("m1comm-dma_reg_w: %02x %02x\n", offset, data);
+#endif
+ m_dma_reg[offset] = data;
+}
+
+READ8_MEMBER(m1comm_device::syn_r)
+{
+ UINT8 result = m_syn | 0xFC;
+#ifdef __M1COMM_VERBOSE__
+ printf("m1comm-syn_r: read register %02x for value %02x\n", offset, result);
+#endif
+ return result;
+}
+
+WRITE8_MEMBER(m1comm_device::syn_w)
+{
+ m_syn = data & 0x03;
+
+#ifdef __M1COMM_VERBOSE__
+ switch (data & 0x02)
+ {
+ case 0x00:
+ printf("m1comm-syn_w: VINT disabled\n");
+ break;
+
+ case 0x02:
+ printf("m1comm-syn_w: VINT enabled\n");
+ break;
+
+ default:
+ printf("m1comm-syn_w: %02x\n", data);
+ break;
+ }
+#endif
+}
+
+READ8_MEMBER(m1comm_device::zfg_r)
+{
+ UINT8 result = m_zfg | (~m_fg << 7) | 0x7e;
+#ifdef __M1COMM_VERBOSE__
+ printf("m1comm-zfg_r: read register %02x for value %02x\n", offset, result);
+#endif
+ return result;
+}
+
+WRITE8_MEMBER(m1comm_device::zfg_w)
+{
+#ifdef __M1COMM_VERBOSE__
+ printf("m1comm-zfg_w: %02x\n", data);
+#endif
+ m_zfg = data & 0x01;
+}
+
+READ8_MEMBER(m1comm_device::share_r)
+{
+ return m_shared[offset];
+}
+
+WRITE8_MEMBER(m1comm_device::share_w)
+{
+ m_shared[offset] = data;
+}
+
+READ8_MEMBER(m1comm_device::cn_r)
+{
+ return m_cn | 0xfe;
+}
+
+WRITE8_MEMBER(m1comm_device::cn_w)
+{
+ m_cn = data & 0x01;
+
+#ifndef __M1COMM_SIMULATION__
+ if (!m_cn)
+ device_reset();
+ else
+ m_commcpu->set_input_line(INPUT_LINE_RESET, CLEAR_LINE);
+#else
+ if (!m_cn)
+ {
+ // reset command
+ printf("M1COMM: board disabled\n");
+ m_linkenable = 0x00;
+ }
+ else
+ {
+ // init command
+ printf("M1COMM: board enabled\n");
+ m_linkenable = 0x01;
+ m_linkid = 0x00;
+ m_linkalive = 0x00;
+ m_linkcount = 0x00;
+ m_linktimer = 0x00e8; // 58 fps * 4s
+ }
+#endif
+}
+
+READ8_MEMBER(m1comm_device::fg_r)
+{
+ return m_fg | (~m_zfg << 7) | 0x7e;
+}
+
+WRITE8_MEMBER(m1comm_device::fg_w)
+{
+ if (!m_cn)
+ return;
+
+ m_fg = data & 0x01;
+}
+
+void m1comm_device::check_vint_irq()
+{
+#ifndef __M1COMM_SIMULATION__
+ if (m_syn & 0x02)
+ {
+ m_commcpu->set_input_line_and_vector(0, HOLD_LINE, 0xef);
+#ifdef __M1COMM_VERBOSE__
+ printf("m1comm-INT5\n");
+#endif
+ }
+#else
+ comm_tick();
+#endif
+}
+
+#ifdef __M1COMM_SIMULATION__
+void m1comm_device::comm_tick()
+{
+ if (m_linkenable == 0x01)
+ {
+ int frameStart = 0x0010;
+ int frameOffset = 0x0000;
+ int frameSize = 0x01c4;
+ int dataSize = frameSize + 1;
+ int togo = 0;
+ int recv = 0;
+ int idx = 0;
+
+ bool isMaster = (m_shared[1] == 0x01);
+ bool isSlave = (m_shared[1] == 0x02);
+ bool isRelay = (m_shared[1] == 0x00);
+
+ // if link not yet established...
+ if (m_linkalive == 0x00)
+ {
+ // waiting...
+ m_shared[0] = 0x05;
+
+ // check rx socket
+ if (!m_line_rx.is_open())
+ {
+ printf("M1COMM: listen on %s\n", m_localhost);
+ m_line_rx.open(m_localhost);
+ }
+
+ // check tx socket
+ if (!m_line_tx.is_open())
+ {
+ printf("M1COMM: connect to %s\n", m_remotehost);
+ m_line_tx.open(m_remotehost);
+ }
+
+ // if both sockets are there check ring
+ if ((m_line_rx.is_open()) && (m_line_tx.is_open()))
+ {
+ // try to read one messages
+ recv = m_line_rx.read(m_buffer, dataSize);
+ while (recv != 0)
+ {
+ // check if complete message
+ if (recv == dataSize)
+ {
+ // check if message id
+ idx = m_buffer[0];
+
+ // 0xFF - link id
+ if (idx == 0xff)
+ {
+ if (isMaster)
+ {
+ // master gets first id and starts next state
+ m_linkid = 0x01;
+ m_linkcount = m_buffer[1];
+ m_linktimer = 0x01;
+ }
+ else if (isSlave || isRelay)
+ {
+ // slave gets own id
+ if (isSlave)
+ {
+ m_buffer[1]++;
+ m_linkid = m_buffer[1];
+ }
+
+ // slave and relay forward message
+ m_line_tx.write(m_buffer, dataSize);
+ }
+ }
+
+ // 0xFE - link size
+ else if (idx == 0xfe)
+ {
+ if (isSlave || isRelay)
+ {
+ m_linkcount = m_buffer[1];
+
+ // slave and relay forward message
+ m_line_tx.write(m_buffer, dataSize);
+ }
+
+ // consider it done
+ printf("M1COMM: link established - id %02x of %02x\n", m_linkid, m_linkcount);
+ m_linkalive = 0x01;
+
+ // write to shared mem
+ m_shared[0] = 0x01;
+ m_shared[2] = m_linkid;
+ m_shared[3] = m_linkcount;
+ }
+ }
+ else
+ {
+ // got only part of a message - read the rest (and drop it)
+ // TODO: combine parts and push to "ring buffer"
+ togo = dataSize - recv;
+ while (togo > 0){
+ recv = m_line_rx.read(m_buffer, togo);
+ togo -= recv;
+ }
+ printf("M1COMM: droped a message...\n");
+ }
+
+ if (m_linkalive == 0x00)
+ recv = m_line_rx.read(m_buffer, dataSize);
+ else
+ recv = 0;
+ }
+
+ // if we are master and link is not yet established
+ if (isMaster && (m_linkalive == 0x00))
+ {
+ // send first packet
+ if (m_linktimer == 0x00)
+ {
+ m_buffer[0] = 0xff;
+ m_buffer[1] = 0x01;
+ m_line_tx.write(m_buffer, dataSize);
+ }
+
+ // send second packet
+ else if (m_linktimer == 0x01)
+ {
+ m_buffer[0] = 0xfe;
+ m_buffer[1] = m_linkcount;
+ m_line_tx.write(m_buffer, dataSize);
+
+ // consider it done
+ printf("M1COMM: link established - id %02x of %02x\n", m_linkid, m_linkcount);
+ m_linkalive = 0x01;
+
+ // write to shared mem
+ m_shared[0] = 0x01;
+ m_shared[2] = m_linkid;
+ m_shared[3] = m_linkcount;
+ }
+
+ else if (m_linktimer > 0x02)
+ {
+ // decrease delay timer
+ m_linktimer--;
+ if (m_linktimer == 0x02)
+ m_linktimer = 0x00;
+ }
+ }
+ }
+ }
+
+ // update "ring buffer" if link established
+ if (m_linkalive == 0x01)
+ {
+ int togo = 0;
+ // try to read one messages
+ int recv = m_line_rx.read(m_buffer, dataSize);
+ while (recv != 0)
+ {
+ // check if complete message
+ if (recv == dataSize)
+ {
+ // check if valid id
+ int idx = m_buffer[0];
+ if (idx > 0 && idx <= m_linkcount) {
+ // if not our own message
+ if (idx != m_linkid)
+ {
+ // save message to "ring buffer"
+ frameOffset = frameStart + (idx * frameSize);
+ for (int j = 0x00 ; j < frameSize ; j++)
+ {
+ m_shared[frameOffset + j] = m_buffer[1 + j];
+ }
+
+ // forward message to other nodes
+ m_line_tx.write(m_buffer, dataSize);
+ }
+ } else {
+ if (!isMaster && idx == 0xf0){
+ // 0xF0 - master addional bytes
+ for (int j = 0x06 ; j < 0x10 ; j++)
+ {
+ m_shared[j] = m_buffer[1 + j];
+ }
+
+ // forward message to other nodes
+ m_line_tx.write(m_buffer, dataSize);
+ }
+ }
+ }
+ else
+ {
+ // got only part of a message - read the rest (and drop it)
+ // TODO: combine parts and push to "ring buffer"
+ togo = dataSize - recv;
+ while (togo > 0){
+ recv = m_line_rx.read(m_buffer, togo);
+ togo -= recv;
+ }
+ printf("M1COMM: droped a message...\n");
+ }
+ recv = m_line_rx.read(m_buffer, dataSize);
+ }
+
+ // update "ring buffer" if link established
+ // live relay does not send data
+ if (m_linkid != 0x00 && m_shared[5] != 0x00)
+ {
+ m_buffer[0] = m_linkid;
+ frameOffset = frameStart + (m_linkid * frameSize);
+ for (int j = 0x00 ; j < frameSize ; j++)
+ {
+ // push message to "ring buffer"
+ m_shared[frameOffset + j] = m_shared[frameStart + j];
+ m_buffer[1 + j] = m_shared[frameStart + j];
+ }
+ // push message to other nodes
+ m_line_tx.write(m_buffer, dataSize);
+
+ // master sends some additional status bytes
+ if (isMaster){
+ m_buffer[0] = 0xf0;
+ for (int j = 0x00 ; j < frameSize ; j++)
+ {
+ m_buffer[1 + j] = 0x00;
+ }
+ for (int j = 0x06 ; j < 0x10 ; j++)
+ {
+ m_buffer[1 + j] = m_shared[j];
+ }
+ // push message to other nodes
+ m_line_tx.write(m_buffer, dataSize);
+ }
+ }
+ // clear 05
+ m_shared[5] = 0x00;
+ }
+ }
+}
+#endif \ No newline at end of file
diff --git a/src/mame/machine/m1comm.h b/src/mame/machine/m1comm.h
new file mode 100644
index 00000000000..85c0b3eb834
--- /dev/null
+++ b/src/mame/machine/m1comm.h
@@ -0,0 +1,98 @@
+// license:BSD-3-Clause
+// copyright-holders:Ariane Fugmann
+#pragma once
+
+#ifndef __M1COMM_H__
+#define __M1COMM_H__
+
+#define __M1COMM_SIMULATION__
+
+#include "emu.h"
+#include "cpu/z80/z80.h"
+
+#define MCFG_M1COMM_ADD(_tag ) \
+ MCFG_DEVICE_ADD(_tag, M1COMM, 0)
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class m1comm_device : public device_t
+{
+public:
+ // construction/destruction
+ m1comm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ // optional information overrides
+ virtual machine_config_constructor device_mconfig_additions() const;
+
+ required_device<z80_device> m_commcpu;
+
+ // internal API - stuff that happens on the comm board
+ // MB89374 registers
+ DECLARE_READ8_MEMBER(dlc_reg_r);
+ DECLARE_WRITE8_MEMBER(dlc_reg_w);
+ // MB89237A registers
+ DECLARE_READ8_MEMBER(dma_reg_r);
+ DECLARE_WRITE8_MEMBER(dma_reg_w);
+ // single bit registers (74LS74)
+ DECLARE_READ8_MEMBER(syn_r);
+ DECLARE_WRITE8_MEMBER(syn_w);
+ DECLARE_READ8_MEMBER(zfg_r);
+ DECLARE_WRITE8_MEMBER(zfg_w);
+ // shared memory 4k
+ DECLARE_READ8_MEMBER(share_r);
+ DECLARE_WRITE8_MEMBER(share_w);
+
+ // public API - stuff that gets called from the model1
+ // shared memory 4k
+ // reads/writes at I/O 0xB00xxx
+ // - share_r
+ // - share_w
+ // single bit registers (74LS74)
+ // reads/writes at I/O 0xB01000
+ DECLARE_READ8_MEMBER(cn_r);
+ DECLARE_WRITE8_MEMBER(cn_w);
+ // reads/writes at I/O 0xB01002
+ DECLARE_READ8_MEMBER(fg_r);
+ DECLARE_WRITE8_MEMBER(fg_w);
+
+ // IRQ logic - 5 = VINT, 7 = DLC
+ void check_vint_irq();
+
+protected:
+ // device-level overrides
+ virtual void device_start();
+ virtual void device_reset();
+ virtual const rom_entry *device_rom_region() const;
+
+private:
+ UINT8 m_shared[0x1000]; // 2x 2k = 4k; model1 accesses this with 16bit data and 11bit address (A0 to A10)
+ UINT8 m_dlc_reg[0x20]; // MB89374 registers
+ UINT8 m_dma_reg[0x20]; // MB89237A registers
+ UINT8 m_syn; // bit0 is stored; purpose unknown, bit1 is used to enable/disable VINT/IRQ5
+ UINT8 m_zfg; // z80 flip gate? purpose unknown, bit0 is stored
+ UINT8 m_cn; // bit0 is used to enable/disable the comm board
+ UINT8 m_fg; // flip gate? purpose unknown, bit0 is stored, bit7 is connected to ZFG bit 0
+
+ emu_file m_line_rx; // rx line - can be either differential, simple serial or toslink
+ emu_file m_line_tx; // tx line - is differential, simple serial and toslink
+ char m_localhost[256];
+ char m_remotehost[256];
+ UINT8 m_buffer[0x1000];
+
+#ifdef __M1COMM_SIMULATION__
+ UINT8 m_linkenable;
+ UINT16 m_linktimer;
+ UINT8 m_linkalive;
+ UINT8 m_linkid;
+ UINT8 m_linkcount;
+
+ void comm_tick();
+#endif
+};
+
+// device type definition
+extern const device_type M1COMM;
+
+#endif /* __M1COMM_H__ */
diff --git a/src/mame/machine/mathbox.c b/src/mame/machine/mathbox.c
index 5a7ae2f2b17..7b014ed1158 100644
--- a/src/mame/machine/mathbox.c
+++ b/src/mame/machine/mathbox.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Eric Smith
/*
* mathbox.c: math box simulation (Battlezone/Red Baron/Tempest)
diff --git a/src/mame/machine/mathbox.h b/src/mame/machine/mathbox.h
index 5ff280477b2..bbc35505b8d 100644
--- a/src/mame/machine/mathbox.h
+++ b/src/mame/machine/mathbox.h
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Eric Smith
/*
* mathbox.h: math box simulation (Battlezone/Red Baron/Tempest)
diff --git a/src/mame/machine/mc8123.c b/src/mame/machine/mc8123.c
index a82c841347d..a6327cf0895 100644
--- a/src/mame/machine/mc8123.c
+++ b/src/mame/machine/mc8123.c
@@ -377,46 +377,17 @@ static UINT8 mc8123_decrypt(offs_t addr,UINT8 val,const UINT8 *key,int opcode)
return decrypt(val,key[tbl_num + (opcode ? 0 : 0x1000)],opcode);
}
-
-void mc8123_decrypt_rom(running_machine &machine, const char *cpu, const char *keyrgn, const char *bankname, int numbanks)
+void mc8123_decode(UINT8 *rom, UINT8 *opcodes, const UINT8 *key, int length)
{
- address_space &space = machine.device(cpu)->memory().space(AS_PROGRAM);
- int fixed_length = numbanks == 1 ? 0xc000 : 0x8000;
- UINT8 *decrypted1 = auto_alloc_array(machine, UINT8, fixed_length);
- UINT8 *decrypted2 = numbanks > 1 ? auto_alloc_array(machine, UINT8, 0x4000 * numbanks) : 0;
- UINT8 *rom = machine.root_device().memregion(cpu)->base();
- UINT8 *key = machine.root_device().memregion(keyrgn)->base();
- int A, bank;
-
- space.set_decrypted_region(0x0000, fixed_length-1, decrypted1);
-
- for (A = 0x0000;A < fixed_length;A++)
+ for (int A = 0x0000;A < length;A++)
{
+ int adr = A >= 0xc000 ? (A & 0x3fff) | 0x8000 : A;
UINT8 src = rom[A];
/* decode the opcodes */
- decrypted1[A] = mc8123_decrypt(A,src,key,1);
+ opcodes[A] = mc8123_decrypt(adr,src,key,1);
/* decode the data */
- rom[A] = mc8123_decrypt(A,src,key,0);
- }
-
- if (bankname != NULL)
- {
- machine.root_device().membank(bankname)->configure_decrypted_entries(0, numbanks, decrypted2, 0x4000);
-
- for (bank = 0; bank < numbanks; ++bank)
- {
- for (A = 0x8000;A < 0xc000;A++)
- {
- UINT8 src = rom[0x8000 + 0x4000*bank + A];
-
- /* decode the opcodes */
- decrypted2[0x4000 * bank + (A-0x8000)] = mc8123_decrypt(A,src,key,1);
-
- /* decode the data */
- rom[0x8000 + 0x4000*bank + A] = mc8123_decrypt(A,src,key,0);
- }
- }
+ rom[A] = mc8123_decrypt(adr,src,key,0);
}
}
diff --git a/src/mame/machine/mc8123.h b/src/mame/machine/mc8123.h
index 02caa2cbe0f..6887b4f644c 100644
--- a/src/mame/machine/mc8123.h
+++ b/src/mame/machine/mc8123.h
@@ -8,6 +8,6 @@
// this function assumes a fixed portion of ROM at 0000-7FFF, and
// an arbitrary amount of banks at 8000-BFFF.
-// numbanks may be 0, meaning there is no ROM to decrypt at 8000-BFFF,
-// or 1, meaning 0000-BFFF will be decrypted as a single unit.
-void mc8123_decrypt_rom(running_machine &machine, const char *cpu, const char *keyrgn, const char *bankname, int numbanks);
+
+void mc8123_decode(UINT8 *rom, UINT8 *opcodes, const UINT8 *key, int length);
+
diff --git a/src/mame/machine/micro3d.c b/src/mame/machine/micro3d.c
index 9d825ff427d..9d9eb6c7f99 100644
--- a/src/mame/machine/micro3d.c
+++ b/src/mame/machine/micro3d.c
@@ -33,7 +33,7 @@
WRITE_LINE_MEMBER(micro3d_state::duart_irq_handler)
{
m_maincpu->set_input_line_and_vector(3, state, m_duart68681->get_irq_vector());
-};
+}
WRITE_LINE_MEMBER(micro3d_state::duart_txb)
{
@@ -41,7 +41,7 @@ WRITE_LINE_MEMBER(micro3d_state::duart_txb)
m_audiocpu->set_input_line(MCS51_RX_LINE, ASSERT_LINE);
// TODO: next line should be behind a timer callback which lasts one audiocpu clock cycle
m_audiocpu->set_input_line(MCS51_RX_LINE, CLEAR_LINE);
-};
+}
READ8_MEMBER(micro3d_state::data_to_i8031)
{
diff --git a/src/mame/machine/namcoio.h b/src/mame/machine/namcoio.h
index f8f7d9d6f15..70b9240db33 100644
--- a/src/mame/machine/namcoio.h
+++ b/src/mame/machine/namcoio.h
@@ -37,7 +37,7 @@ protected:
enum {
TYPE_NAMCO56XX,
TYPE_NAMCO58XX,
- TYPE_NAMCO59XX,
+ TYPE_NAMCO59XX
};
// internal state
diff --git a/src/mame/machine/namcos1.c b/src/mame/machine/namcos1.c
index b4f1d044c42..6c6667bd8b8 100644
--- a/src/mame/machine/namcos1.c
+++ b/src/mame/machine/namcos1.c
@@ -488,34 +488,6 @@ WRITE8_MEMBER(namcos1_state::sound_bankswitch_w)
* *
*******************************************************************************/
-// These direct handlers are merely for speed - taking two trips
-// through the memory system for every opcode fetch is rather slow
-
-DIRECT_UPDATE_MEMBER(namcos1_state::direct_handler_main)
-{
- return direct_handler(0, direct, address);
-}
-
-DIRECT_UPDATE_MEMBER(namcos1_state::direct_handler_sub)
-{
- return direct_handler(1, direct, address);
-}
-
-inline offs_t namcos1_state::direct_handler(int whichcpu, direct_read_data &direct, offs_t address)
-{
- offs_t remapped_address = m_c117->remap(whichcpu, address);
-
- // if not in ROM, return
- if (remapped_address < 0x400000) return address;
-
- // calculate the base of the 8KB ROM page
- remapped_address &= 0x3fe000;
-
- direct.explicit_configure(address & 0xe000, address | 0x1fff, 0x1fff, &m_rom[remapped_address]);
- return ~0;
-}
-
-
WRITE_LINE_MEMBER(namcos1_state::subres_w)
{
// logerror("reset control pc=%04x %02x\n",space.device().safe_pc(),data);
@@ -641,9 +613,6 @@ void namcos1_state::driver_init()
}
}
- m_maincpu->space(AS_PROGRAM).set_direct_update_handler(direct_update_delegate(FUNC(namcos1_state::direct_handler_main), this));
- m_subcpu->space(AS_PROGRAM).set_direct_update_handler(direct_update_delegate(FUNC(namcos1_state::direct_handler_sub), this));
-
// kludge! see notes
m_mcu->space(AS_PROGRAM).install_write_handler(0xc000, 0xc000, write8_delegate(FUNC(namcos1_state::mcu_patch_w), this));
diff --git a/src/mame/machine/playch10.c b/src/mame/machine/playch10.c
index 85792eefe67..44d35252341 100644
--- a/src/mame/machine/playch10.c
+++ b/src/mame/machine/playch10.c
@@ -1076,7 +1076,7 @@ WRITE8_MEMBER(playch10_state::hboard_rom_switch_w)
}
};
gboard_rom_switch_w(space,offset,data);
-};
+}
DRIVER_INIT_MEMBER(playch10_state,pchboard)
diff --git a/src/mame/machine/s32comm.c b/src/mame/machine/s32comm.c
new file mode 100644
index 00000000000..abacdd7a75c
--- /dev/null
+++ b/src/mame/machine/s32comm.c
@@ -0,0 +1,1003 @@
+// license:BSD-3-Clause
+// copyright-holders:Ariane Fugmann
+
+/*
+Sega System 32 Comm PCB 837-9409
+( http://images.arianchen.de/sega-comm/f1superlap_comm.jpg )
+|--------------------------------------------------------------------------------|
+| |-----------------| |---------------------------------| |
+| |-----------------| |---------------------------------| |
+| CNJ PAL CNH |
+| MB89374 |
+| Z80 |
+| MB89237A |
+| PAL 15612.17 |
+| |
+| MB8464 MB8464 |
+| CN? |
+| |---------------------------------| |
+| |---------------------------------| LED CN? CN? CNK |
+|--------------------------------------------------------------------------------|
+ Setup:
+ Z80 - Zilog Z0840004PSC Z80 CPU, running at 4.000MHz (DIP40)
+ MB89237A - Fujitsu MB89237A DMA-Controller (DIP20) [most likely i8237A clone]
+ MB89374 - Fujitsu MB89374 Data Link Controller (SDIP42)
+ MB8464 - Fujitsu MB8464 8k x8 SRAM (DIP28)
+ MB8421 - Fujitsu MB8421-12LP 2k x8 SRAM (SDIP52)
+
+ Board:
+ 837-9409 F1 Super Lap
+
+ EEPROM:
+ 14084.17 Rad Rally
+ 15612.17 F1 Super Lap
+
+Sega System Multi32 Comm PCB 837-8792-91
+( http://images.arianchen.de/sega-comm/orunners-front.jpg )
+|--------------------------------------------------------------------------------|
+| |---------------------------------| |---------------------------------| |
+| |---------------------------------| |---------------------------------| |
+| CN3 CN4 |
+| |
+| Z80 MB89374 MB89237A MB8421 |
+| |
+| 15033.17 315-5610 |
+| |
+| MB8464A 315-5506 |
+| CN1 CN2 |
+| |---------------------------------| |---------------------------------| |
+| |---------------------------------| |---------------------------------| |
+| CN8 CN9 |
+|--------------------------------------------------------------------------------|
+ Setup:
+ 15033.17 - INTEL D27C100 128k x8 EPROM (DIP32, labelled 'EPR-15033')
+ Z80 - Zilog Z0840004PSC Z80 CPU, running at 4.000MHz (DIP40)
+ MB89237A - Fujitsu MB89237A DMA-Controller (DIP20) [most likely i8237A clone]
+ MB89374 - Fujitsu MB89374 Data Link Controller (SDIP42)
+ MB8421 - Fujitsu MB8421-12LP 2k x8 SRAM (SDIP52)
+ MB8464A - Fujitsu MB8464-10LL 8k x8 SRAM (DIP28)
+ 315-5611 - Lattice GAL16V8A PAL (DIP20)
+ 315-5506 - Lattice GAL16V8A PAL (DIP20)
+
+ Board:
+ 837-8792 OutRunners, Stadium Cross
+
+ EEPROM:
+ 15033.17 OutRunners, Stadium Cross
+*/
+
+#include "machine/s32comm.h"
+
+//#define __S32COMM_VERBOSE__
+
+MACHINE_CONFIG_FRAGMENT( s32comm )
+MACHINE_CONFIG_END
+
+//**************************************************************************
+// GLOBAL VARIABLES
+//**************************************************************************
+
+const device_type S32COMM = &device_creator<s32comm_device>;
+
+//-------------------------------------------------
+// machine_config_additions - device-specific
+// machine configurations
+//-------------------------------------------------
+
+machine_config_constructor s32comm_device::device_mconfig_additions() const
+{
+ return MACHINE_CONFIG_NAME( s32comm );
+}
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// s32comm_device - constructor
+//-------------------------------------------------
+
+s32comm_device::s32comm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ device_t(mconfig, S32COMM, "SYSTEM32 COMMUNICATION BD", tag, owner, clock, "s32comm", __FILE__),
+ m_line_rx(OPEN_FLAG_WRITE | OPEN_FLAG_CREATE ),
+ m_line_tx(OPEN_FLAG_READ)
+{
+ // prepare localhost "filename"
+ m_localhost[0] = 0;
+ strcat(m_localhost, "socket.");
+ strcat(m_localhost, mconfig.options().comm_localhost());
+ strcat(m_localhost, ":");
+ strcat(m_localhost, mconfig.options().comm_localport());
+
+ // prepare remotehost "filename"
+ m_remotehost[0] = 0;
+ strcat(m_remotehost, "socket.");
+ strcat(m_remotehost, mconfig.options().comm_remotehost());
+ strcat(m_remotehost, ":");
+ strcat(m_remotehost, mconfig.options().comm_remoteport());
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void s32comm_device::device_start()
+{
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void s32comm_device::device_reset()
+{
+ m_zfg = 0;
+ m_cn = 0;
+ m_fg = 0;
+}
+
+READ8_MEMBER(s32comm_device::zfg_r)
+{
+ UINT8 result = m_zfg | 0xFE;
+#ifdef __S32COMM_VERBOSE__
+ printf("s32comm-zfg_r: read register %02x for value %02x\n", offset, result);
+#endif
+ return result;
+}
+
+WRITE8_MEMBER(s32comm_device::zfg_w)
+{
+#ifdef __S32COMM_VERBOSE__
+ printf("s32comm-zfg_w: %02x\n", data);
+#endif
+ m_zfg = data & 0x01;
+}
+
+READ8_MEMBER(s32comm_device::share_r)
+{
+ UINT8 result = m_shared[offset];
+#ifdef __S32COMM_VERBOSE__
+ printf("s32comm-share_r: read shared memory %02x for value %02x\n", offset, result);
+#endif
+ return result;
+}
+
+WRITE8_MEMBER(s32comm_device::share_w)
+{
+#ifdef __S32COMM_VERBOSE__
+ printf("s32comm-share_w: %02x %02x\n", offset, data);
+#endif
+ m_shared[offset] = data;
+}
+
+READ8_MEMBER(s32comm_device::cn_r)
+{
+ return m_cn | 0xFE;
+}
+
+WRITE8_MEMBER(s32comm_device::cn_w)
+{
+ m_cn = data & 0x01;
+
+#ifndef __S32COMM_SIMULATION__
+ if (!m_cn)
+ device_reset();
+#else
+ if (!m_cn)
+ {
+ // reset command
+ printf("S32COMM: board disabled\n");
+ m_linkenable = 0x00;
+ }
+ else
+ {
+ // init command
+ printf("S32COMM: board enabled\n");
+ m_linkenable = 0x01;
+ m_linkid = 0x00;
+ m_linkalive = 0x00;
+ m_linkcount = 0x00;
+ m_linktimer = 0x04; //0x00E8; // 58 fps * 4s
+
+ comm_tick();
+ }
+#endif
+}
+
+READ8_MEMBER(s32comm_device::fg_r)
+{
+ return m_fg | (~m_zfg << 7) | 0x7E;
+}
+
+WRITE8_MEMBER(s32comm_device::fg_w)
+{
+ if (!m_cn)
+ return;
+
+ m_fg = data & 0x01;
+}
+
+void s32comm_device::check_vint_irq()
+{
+#ifndef __S32COMM_SIMULATION__
+#else
+ comm_tick();
+#endif
+}
+
+#ifdef __S32COMM_SIMULATION__
+void s32comm_device::set_linktype(UINT16 linktype)
+{
+ m_linktype = linktype;
+
+ switch (m_linktype)
+ {
+ case 14084:
+ // Rad Rally
+ printf("S32COMM: set mode 'EPR-14084 - Rad Rally'\n");
+ break;
+ case 15033:
+ // Stadium Cross / OutRunners
+ printf("S32COMM: set mode 'EPR-15033 - Stadium Cross / OutRunners'\n");
+ break;
+ case 15612:
+ // F1 Super Lap
+ printf("S32COMM: set mode 'EPR-15612 - F1 Super Lap'\n");
+ break;
+ }
+}
+
+void s32comm_device::comm_tick()
+{
+ switch (m_linktype)
+ {
+ case 14084:
+ // Rad Rally
+ comm_tick_14084();
+ break;
+ case 15033:
+ // Stadium Cross / OutRunners
+ comm_tick_15033();
+ break;
+ case 15612:
+ // F1 Super Lap
+ comm_tick_15612();
+ break;
+ }
+}
+
+void s32comm_device::comm_tick_14084()
+{
+ if (m_linkenable == 0x01)
+ {
+ int frameStart = 0x0480;
+ int frameOffset = 0x0000;
+ int frameSize = 0x0080;
+ int dataSize = frameSize + 1;
+ int togo = 0;
+ int recv = 0;
+ int idx = 0;
+
+ bool isMaster = (m_shared[2] == 0x01);
+ bool isSlave = (m_shared[2] == 0x00);
+ bool isRelay = (m_shared[2] == 0xFF);
+
+ // if link not yet established...
+ if (m_linkalive == 0x00)
+ {
+ // waiting...
+ m_shared[4] = 0x00;
+
+ // check rx socket
+ if (!m_line_rx.is_open())
+ {
+ printf("S32COMM: listen on %s\n", m_localhost);
+ m_line_rx.open(m_localhost);
+ }
+
+ // check tx socket
+ if (!m_line_tx.is_open())
+ {
+ printf("S32COMM: connect to %s\n", m_remotehost);
+ m_line_tx.open(m_remotehost);
+ }
+
+ // if both sockets are there check ring
+ if ((m_line_rx.is_open()) && (m_line_tx.is_open()))
+ {
+ // try to read one messages
+ recv = m_line_rx.read(m_buffer, dataSize);
+ while (recv != 0)
+ {
+ // check if complete message
+ if (recv == dataSize)
+ {
+ // check if message id
+ idx = m_buffer[0];
+
+ // 0xFF - link id
+ if (idx == 0xFF)
+ {
+ if (isMaster)
+ {
+ // master gets first id and starts next state
+ m_linkid = 0x01;
+ m_linkcount = m_buffer[1];
+ m_linktimer = 0x01;
+ }
+ else if (isSlave || isRelay)
+ {
+ // slave gets own id
+ if (isSlave)
+ {
+ m_buffer[1]++;
+ m_linkid = m_buffer[1];
+ }
+
+ // slave and relay forward message
+ m_line_tx.write(m_buffer, dataSize);
+ }
+ }
+
+ // 0xFE - link size
+ else if (idx == 0xFE)
+ {
+ if (isSlave || isRelay)
+ {
+ m_linkcount = m_buffer[1];
+
+ // slave and relay forward message
+ m_line_tx.write(m_buffer, dataSize);
+ }
+
+ // consider it done
+ printf("S32COMM: link established - id %02x of %02x\n", m_linkid, m_linkcount);
+ m_linkalive = 0x01;
+
+ // write to shared mem
+ m_shared[4] = 0x01;
+ m_shared[1] = m_linkid;
+ m_shared[0] = m_linkcount;
+ }
+ }
+ else
+ {
+ // got only part of a message - read the rest (and drop it)
+ // TODO: combine parts and push to "ring buffer"
+ togo = dataSize - recv;
+ while (togo > 0){
+ recv = m_line_rx.read(m_buffer, togo);
+ togo -= recv;
+ }
+ printf("S32COMM: droped a message...\n");
+ }
+
+ if (m_linkalive == 0x00)
+ recv = m_line_rx.read(m_buffer, dataSize);
+ else
+ recv = 0;
+ }
+
+ // if we are master and link is not yet established
+ if (isMaster && (m_linkalive == 0x00))
+ {
+ // send first packet
+ if (m_linktimer == 0x00)
+ {
+ m_buffer[0] = 0xFF;
+ m_buffer[1] = 0x01;
+ m_line_tx.write(m_buffer, dataSize);
+ }
+
+ // send second packet
+ else if (m_linktimer == 0x01)
+ {
+ m_buffer[0] = 0xFE;
+ m_buffer[1] = m_linkcount;
+ m_line_tx.write(m_buffer, dataSize);
+
+ // consider it done
+ printf("S32COMM: link established - id %02x of %02x\n", m_linkid, m_linkcount);
+ m_linkalive = 0x01;
+
+ // write to shared mem
+ m_shared[4] = 0x01;
+ m_shared[1] = m_linkid;
+ m_shared[0] = m_linkcount;
+ }
+
+ else if (m_linktimer > 0x02)
+ {
+ // decrease delay timer
+ m_linktimer--;
+ if (m_linktimer == 0x02)
+ m_linktimer = 0x00;
+ }
+ }
+ }
+ }
+
+ // update "ring buffer" if link established
+ if (m_linkalive == 0x01)
+ {
+ int togo = 0;
+ // try to read one messages
+ int recv = m_line_rx.read(m_buffer, dataSize);
+ while (recv != 0)
+ {
+ // check if complete message
+ if (recv == dataSize)
+ {
+ // check if valid id
+ int idx = m_buffer[0];
+ if (idx > 0 && idx <= m_linkcount) {
+ // if not our own message
+ if (idx != m_linkid)
+ {
+ // save message to "ring buffer"
+ frameOffset = idx * frameSize;
+ for (int j = 0x00 ; j < frameSize ; j++)
+ {
+ m_shared[frameOffset + j] = m_buffer[1 + j];
+ }
+
+ // forward message to other nodes
+ m_line_tx.write(m_buffer, dataSize);
+ }
+ } else {
+ if (!isMaster && idx == 0xF0){
+ // 0xF0 - master addional bytes
+ for (int j = 0x05 ; j < 0x10 ; j++)
+ {
+ m_shared[j] = m_buffer[1 + j];
+ }
+
+ // forward message to other nodes
+ m_line_tx.write(m_buffer, dataSize);
+ }
+ }
+ }
+ else
+ {
+ // got only part of a message - read the rest (and drop it)
+ // TODO: combine parts and push to "ring buffer"
+ togo = dataSize - recv;
+ while (togo > 0){
+ recv = m_line_rx.read(m_buffer, togo);
+ togo -= recv;
+ }
+ printf("S32COMM: droped a message...\n");
+ }
+ recv = m_line_rx.read(m_buffer, dataSize);
+ }
+
+ // update "ring buffer" if link established
+ // live relay does not send data
+ if (m_linkid != 0x00 && m_shared[3] != 0x00)
+ {
+ m_buffer[0] = m_linkid;
+ frameOffset = m_linkid * frameSize;
+ for (int j = 0x00 ; j < frameSize ; j++)
+ {
+ // push message to "ring buffer"
+ m_shared[frameOffset + j] = m_shared[frameStart + j];
+ m_buffer[1 + j] = m_shared[frameStart + j];
+ }
+ // push message to other nodes
+ m_line_tx.write(m_buffer, dataSize);
+
+ // master sends some additional status bytes
+ if (isMaster){
+ m_buffer[0] = 0xF0;
+ for (int j = 0x00 ; j < frameSize ; j++)
+ {
+ m_buffer[1 + j] = 0x00;
+ }
+ for (int j = 0x05 ; j < 0x10 ; j++)
+ {
+ m_buffer[1 + j] = m_shared[j];
+ }
+ // push message to other nodes
+ m_line_tx.write(m_buffer, dataSize);
+ }
+ }
+
+ // clear 03
+ m_shared[3] = 0x00;
+ }
+ }
+}
+
+void s32comm_device::comm_tick_15033()
+{
+ if (m_linkenable == 0x01)
+ {
+ int frameStartTX = 0x0710;
+ int frameStartRX = 0x0010;
+ int frameOffset = 0x0000;
+ int frameSize = 0x00E0;
+ int dataSize = frameSize + 1;
+ int togo = 0;
+ int recv = 0;
+ int idx = 0;
+
+ bool isMaster = (m_shared[2] == 0x01);
+ bool isSlave = (m_shared[2] == 0x00);
+ bool isRelay = (m_shared[2] == 0x02);
+
+ // if link not yet established - Z80 reply check?
+ if (m_linkalive == 0x00 && m_shared[0] == 0x56 && m_shared[1] == 0x37 && m_shared[2] == 0x30)
+ {
+ for (int j = 0x003 ; j < 0x0800 ; j++)
+ {
+ m_shared[j] = 0;
+ }
+ m_shared[0x08] = 0x5A;
+ m_shared[0x09] = 0x38;
+ m_shared[0x0A] = 0x30;
+ }
+ else if (m_linkalive == 0x00)
+ {
+ // waiting...
+ m_shared[4] = 0x00;
+
+ // check rx socket
+ if (!m_line_rx.is_open())
+ {
+ printf("S32COMM: listen on %s\n", m_localhost);
+ m_line_rx.open(m_localhost);
+ }
+
+ // check tx socket
+ if (!m_line_tx.is_open())
+ {
+ printf("S32COMM: connect to %s\n", m_remotehost);
+ m_line_tx.open(m_remotehost);
+ }
+
+ // if both sockets are there check ring
+ if ((m_line_rx.is_open()) && (m_line_tx.is_open()))
+ {
+ // try to read one messages
+ recv = m_line_rx.read(m_buffer, dataSize);
+ while (recv != 0)
+ {
+ // check if complete message
+ if (recv == dataSize)
+ {
+ // check if message id
+ idx = m_buffer[0];
+
+ // 0xFF - link id
+ if (idx == 0xFF)
+ {
+ if (isMaster)
+ {
+ // master gets first id and starts next state
+ m_linkid = 0x01;
+ m_linkcount = m_buffer[1];
+ m_linktimer = 0x01;
+ }
+ else if (isSlave || isRelay)
+ {
+ // slave gets own id
+ if (isSlave)
+ {
+ m_buffer[1]++;
+ m_linkid = m_buffer[1];
+ }
+
+ // slave and relay forward message
+ m_line_tx.write(m_buffer, dataSize);
+ }
+ }
+
+ // 0xFE - link size
+ else if (idx == 0xFE)
+ {
+ if (isSlave || isRelay)
+ {
+ m_linkcount = m_buffer[1];
+
+ // slave and relay forward message
+ m_line_tx.write(m_buffer, dataSize);
+ }
+
+ // consider it done
+ printf("S32COMM: link established - id %02x of %02x\n", m_linkid, m_linkcount);
+ m_linkalive = 0x01;
+
+ // write to shared mem
+ m_shared[4] = 0x01;
+ m_shared[1] = m_linkid;
+ m_shared[0] = m_linkcount;
+ }
+ }
+ else
+ {
+ // got only part of a message - read the rest (and drop it)
+ // TODO: combine parts and push to "ring buffer"
+ togo = dataSize - recv;
+ while (togo > 0){
+ recv = m_line_rx.read(m_buffer, togo);
+ togo -= recv;
+ }
+ printf("S32COMM: droped a message...\n");
+ }
+
+ if (m_linkalive == 0x00)
+ recv = m_line_rx.read(m_buffer, dataSize);
+ else
+ recv = 0;
+ }
+
+ // if we are master and link is not yet established
+ if (isMaster && (m_linkalive == 0x00))
+ {
+ // send first packet
+ if (m_linktimer == 0x00)
+ {
+ m_buffer[0] = 0xFF;
+ m_buffer[1] = 0x01;
+ m_line_tx.write(m_buffer, dataSize);
+ }
+
+ // send second packet
+ else if (m_linktimer == 0x01)
+ {
+ m_buffer[0] = 0xFE;
+ m_buffer[1] = m_linkcount;
+ m_line_tx.write(m_buffer, dataSize);
+
+ // consider it done
+ printf("S32COMM: link established - id %02x of %02x\n", m_linkid, m_linkcount);
+ m_linkalive = 0x01;
+
+ // write to shared mem
+ m_shared[4] = 0x01;
+ m_shared[1] = m_linkid;
+ m_shared[0] = m_linkcount;
+ }
+
+ else if (m_linktimer > 0x02)
+ {
+ // decrease delay timer
+ m_linktimer--;
+ if (m_linktimer == 0x02)
+ m_linktimer = 0x00;
+ }
+ }
+ }
+ }
+
+ // update "ring buffer" if link established
+ if (m_linkalive == 0x01)
+ {
+ int togo = 0;
+ // try to read one messages
+ int recv = m_line_rx.read(m_buffer, dataSize);
+ while (recv != 0)
+ {
+ // check if complete message
+ if (recv == dataSize)
+ {
+ // check if valid id
+ int idx = m_buffer[0];
+ if (idx > 0 && idx <= m_linkcount) {
+ // if not our own message
+ if (idx != m_linkid)
+ {
+ // save message to "ring buffer"
+ frameOffset = frameStartRX + ((idx - 1) * frameSize);
+ for (int j = 0x00 ; j < frameSize ; j++)
+ {
+ m_shared[frameOffset + j] = m_buffer[1 + j];
+ }
+
+ // forward message to other nodes
+ m_line_tx.write(m_buffer, dataSize);
+ }
+ } else {
+ if (!isMaster && idx == 0xF0){
+ // 0xF0 - master addional bytes
+ for (int j = 0x05 ; j < 0x10 ; j++)
+ {
+ m_shared[j] = m_buffer[1 + j];
+ }
+
+ // forward message to other nodes
+ m_line_tx.write(m_buffer, dataSize);
+ }
+ }
+ }
+ else
+ {
+ // got only part of a message - read the rest (and drop it)
+ // TODO: combine parts and push to "ring buffer"
+ togo = dataSize - recv;
+ while (togo > 0){
+ recv = m_line_rx.read(m_buffer, togo);
+ togo -= recv;
+ }
+ printf("S32COMM: droped a message...\n");
+ }
+ recv = m_line_rx.read(m_buffer, dataSize);
+ }
+
+ // update "ring buffer" if link established
+ // live relay does not send data
+ if (m_linkid != 0x00 && m_shared[3] != 0x00)
+ {
+ m_buffer[0] = m_linkid;
+ frameOffset = frameStartRX + ((m_linkid - 1) * frameSize);
+ for (int j = 0x00 ; j < frameSize ; j++)
+ {
+ // push message to "ring buffer"
+ m_shared[frameOffset + j] = m_shared[frameStartTX + j];
+ m_buffer[1 + j] = m_shared[frameStartTX + j];
+ }
+ // push message to other nodes
+ m_line_tx.write(m_buffer, dataSize);
+
+ // master sends some additional status bytes
+ if (isMaster){
+ m_buffer[0] = 0xF0;
+ for (int j = 0x00 ; j < frameSize ; j++)
+ {
+ m_buffer[1 + j] = 0x00;
+ }
+ for (int j = 0x05 ; j < 0x10 ; j++)
+ {
+ m_buffer[1 + j] = m_shared[j];
+ }
+ // push message to other nodes
+ m_line_tx.write(m_buffer, dataSize);
+ }
+ }
+ // clear 03
+ m_shared[3] = 0x00;
+ }
+ }
+}
+
+void s32comm_device::comm_tick_15612()
+{
+ if (m_linkenable == 0x01)
+ {
+ int frameStart = 0x0010;
+ int frameOffset = 0x0000;
+ int frameSize = 0x00E0;
+ int dataSize = frameSize + 1;
+ int togo = 0;
+ int recv = 0;
+ int idx = 0;
+
+ bool isMaster = (m_shared[1] == 0x01);
+ bool isSlave = (m_shared[1] == 0x02);
+ bool isRelay = (m_shared[1] == 0x00);
+
+ // if link not yet established...
+ if (m_linkalive == 0x00)
+ {
+ // waiting...
+ m_shared[0] = 0x05;
+
+ // check rx socket
+ if (!m_line_rx.is_open())
+ {
+ printf("S32COMM: listen on %s\n", m_localhost);
+ m_line_rx.open(m_localhost);
+ }
+
+ // check tx socket
+ if (!m_line_tx.is_open())
+ {
+ printf("S32COMM: connect to %s\n", m_remotehost);
+ m_line_tx.open(m_remotehost);
+ }
+
+ // if both sockets are there check ring
+ if ((m_line_rx.is_open()) && (m_line_tx.is_open()))
+ {
+ // try to read one messages
+ recv = m_line_rx.read(m_buffer, dataSize);
+ while (recv != 0)
+ {
+ // check if complete message
+ if (recv == dataSize)
+ {
+ // check if message id
+ idx = m_buffer[0];
+
+ // 0xFF - link id
+ if (idx == 0xFF)
+ {
+ if (isMaster)
+ {
+ // master gets first id and starts next state
+ m_linkid = 0x01;
+ m_linkcount = m_buffer[1];
+ m_linktimer = 0x01;
+ }
+ else if (isSlave || isRelay)
+ {
+ // slave gets own id
+ if (isSlave)
+ {
+ m_buffer[1]++;
+ m_linkid = m_buffer[1];
+ }
+
+ // slave and relay forward message
+ m_line_tx.write(m_buffer, dataSize);
+ }
+ }
+
+ // 0xFE - link size
+ else if (idx == 0xFE)
+ {
+ if (isSlave || isRelay)
+ {
+ m_linkcount = m_buffer[1];
+
+ // slave and relay forward message
+ m_line_tx.write(m_buffer, dataSize);
+ }
+
+ // consider it done
+ printf("S32COMM: link established - id %02x of %02x\n", m_linkid, m_linkcount);
+ m_linkalive = 0x01;
+
+ // write to shared mem
+ m_shared[0] = 0x01;
+ m_shared[2] = m_linkid;
+ m_shared[3] = m_linkcount;
+ }
+ }
+ else
+ {
+ // got only part of a message - read the rest (and drop it)
+ // TODO: combine parts and push to "ring buffer"
+ togo = dataSize - recv;
+ while (togo > 0){
+ recv = m_line_rx.read(m_buffer, togo);
+ togo -= recv;
+ }
+ printf("S32COMM: droped a message...\n");
+ }
+
+ if (m_linkalive == 0x00)
+ recv = m_line_rx.read(m_buffer, dataSize);
+ else
+ recv = 0;
+ }
+
+ // if we are master and link is not yet established
+ if (isMaster && (m_linkalive == 0x00))
+ {
+ // send first packet
+ if (m_linktimer == 0x00)
+ {
+ m_buffer[0] = 0xFF;
+ m_buffer[1] = 0x01;
+ m_line_tx.write(m_buffer, dataSize);
+ }
+
+ // send second packet
+ else if (m_linktimer == 0x01)
+ {
+ m_buffer[0] = 0xFE;
+ m_buffer[1] = m_linkcount;
+ m_line_tx.write(m_buffer, dataSize);
+
+ // consider it done
+ printf("S32COMM: link established - id %02x of %02x\n", m_linkid, m_linkcount);
+ m_linkalive = 0x01;
+
+ // write to shared mem
+ m_shared[0] = 0x01;
+ m_shared[2] = m_linkid;
+ m_shared[3] = m_linkcount;
+ }
+
+ else if (m_linktimer > 0x02)
+ {
+ // decrease delay timer
+ m_linktimer--;
+ if (m_linktimer == 0x02)
+ m_linktimer = 0x00;
+ }
+ }
+ }
+ }
+
+ // update "ring buffer" if link established
+ if (m_linkalive == 0x01)
+ {
+ int togo = 0;
+ // try to read one messages
+ int recv = m_line_rx.read(m_buffer, dataSize);
+ while (recv != 0)
+ {
+ // check if complete message
+ if (recv == dataSize)
+ {
+ // check if valid id
+ int idx = m_buffer[0];
+ if (idx > 0 && idx <= m_linkcount) {
+ // if not our own message
+ if (idx != m_linkid)
+ {
+ // save message to "ring buffer"
+ frameOffset = frameStart + (idx * frameSize);
+ for (int j = 0x00 ; j < frameSize ; j++)
+ {
+ m_shared[frameOffset + j] = m_buffer[1 + j];
+ }
+
+ // forward message to other nodes
+ m_line_tx.write(m_buffer, dataSize);
+ }
+ } else {
+ if (!isMaster && idx == 0xF0){
+ // 0xF0 - master addional bytes
+ for (int j = 0x05 ; j < 0x10 ; j++)
+ {
+ m_shared[j] = m_buffer[1 + j];
+ }
+
+ // forward message to other nodes
+ m_line_tx.write(m_buffer, dataSize);
+ }
+ }
+ }
+ else
+ {
+ // got only part of a message - read the rest (and drop it)
+ // TODO: combine parts and push to "ring buffer"
+ togo = dataSize - recv;
+ while (togo > 0){
+ recv = m_line_rx.read(m_buffer, togo);
+ togo -= recv;
+ }
+ printf("S32COMM: droped a message...\n");
+ }
+ recv = m_line_rx.read(m_buffer, dataSize);
+ }
+
+ // update "ring buffer" if link established
+ // live relay does not send data
+ if (m_linkid != 0x00 && m_shared[4] != 0x00)
+ {
+ m_buffer[0] = m_linkid;
+ frameOffset = frameStart + (m_linkid * frameSize);
+ for (int j = 0x00 ; j < frameSize ; j++)
+ {
+ // push message to "ring buffer"
+ m_shared[frameOffset + j] = m_shared[frameStart + j];
+ m_buffer[1 + j] = m_shared[frameStart + j];
+ }
+ // push message to other nodes
+ m_line_tx.write(m_buffer, dataSize);
+
+ // master sends some additional status bytes
+ if (isMaster){
+ m_buffer[0] = 0xF0;
+ for (int j = 0x00 ; j < frameSize ; j++)
+ {
+ m_buffer[1 + j] = 0x00;
+ }
+ for (int j = 0x05 ; j < 0x10 ; j++)
+ {
+ m_buffer[1 + j] = m_shared[j];
+ }
+ // push message to other nodes
+ m_line_tx.write(m_buffer, dataSize);
+ }
+ }
+ // clear 04
+ m_shared[4] = 0x00;
+ }
+ }
+}
+#endif
diff --git a/src/mame/machine/s32comm.h b/src/mame/machine/s32comm.h
new file mode 100644
index 00000000000..e76cba98862
--- /dev/null
+++ b/src/mame/machine/s32comm.h
@@ -0,0 +1,91 @@
+// license:BSD-3-Clause
+// copyright-holders:Ariane Fugmann
+#pragma once
+
+#ifndef __S32COMM_H__
+#define __S32COMM_H__
+
+#define __S32COMM_SIMULATION__
+
+#include "emu.h"
+
+#define MCFG_S32COMM_ADD(_tag ) \
+ MCFG_DEVICE_ADD(_tag, S32COMM, 0)
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class s32comm_device : public device_t
+{
+public:
+ // construction/destruction
+ s32comm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ // optional information overrides
+ virtual machine_config_constructor device_mconfig_additions() const;
+
+ // single bit registers (74LS74)
+ DECLARE_READ8_MEMBER(zfg_r);
+ DECLARE_WRITE8_MEMBER(zfg_w);
+ // shared memory 2k
+ DECLARE_READ8_MEMBER(share_r);
+ DECLARE_WRITE8_MEMBER(share_w);
+
+ // public API - stuff that gets called from host
+ // shared memory 2k
+ // reads/writes at I/O 0x800xxx
+ // - share_r
+ // - share_w
+ // single bit registers (74LS74)
+ // reads/writes at I/O 0x801000
+ DECLARE_READ8_MEMBER(cn_r);
+ DECLARE_WRITE8_MEMBER(cn_w);
+ // reads/writes at I/O 0x801002
+ DECLARE_READ8_MEMBER(fg_r);
+ DECLARE_WRITE8_MEMBER(fg_w);
+
+ // IRQ logic - 5 = VINT, 7 = DLC
+ void check_vint_irq();
+#ifdef __S32COMM_SIMULATION__
+ void set_linktype(UINT16 linktype);
+#endif
+
+protected:
+ // device-level overrides
+ virtual void device_start();
+ virtual void device_reset();
+
+private:
+ UINT8 m_shared[0x800]; // 2k shared memory
+ UINT8 m_zfg; // z80 flip gate? purpose unknown, bit0 is stored
+ UINT8 m_cn; // bit0 is used to enable/disable the comm board
+ UINT8 m_fg; // flip gate? purpose unknown, bit0 is stored, bit7 is connected to ZFG bit 0
+
+ emu_file m_line_rx; // rx line - can be either differential, simple serial or toslink
+ emu_file m_line_tx; // tx line - is differential, simple serial and toslink
+ char m_localhost[256];
+ char m_remotehost[256];
+ UINT8 m_buffer[0x800];
+
+#ifdef __S32COMM_SIMULATION__
+ UINT8 m_linkenable;
+ UINT16 m_linktimer;
+ UINT8 m_linkalive;
+ UINT8 m_linkid;
+ UINT8 m_linkcount;
+
+ UINT16 m_linktype;
+
+ void comm_tick();
+
+ void comm_tick_14084();
+ void comm_tick_15033();
+ void comm_tick_15612();
+#endif
+};
+
+// device type definition
+extern const device_type S32COMM;
+
+#endif /* __S32COMM_H__ */
diff --git a/src/mame/machine/scramble.c b/src/mame/machine/scramble.c
index e51701679ab..eeea8613ee1 100644
--- a/src/mame/machine/scramble.c
+++ b/src/mame/machine/scramble.c
@@ -624,7 +624,7 @@ WRITE8_MEMBER(scramble_state::harem_decrypt_clk_w)
}
membank("rombank")->set_base (m_harem_decrypted_data + 0x2000 * bank);
- membank("rombank")->set_base_decrypted (m_harem_decrypted_opcodes + 0x2000 * bank);
+ membank("rombank_decrypted")->set_base (m_harem_decrypted_opcodes + 0x2000 * bank);
// logerror("%s: decrypt mode = %02x (bank %x) active\n", machine().describe_context(), m_harem_decrypt_mode, bank);
@@ -674,5 +674,5 @@ DRIVER_INIT_MEMBER(scramble_state,harem)
}
membank("rombank")->set_base (m_harem_decrypted_data);
- membank("rombank")->set_base_decrypted (m_harem_decrypted_opcodes);
+ membank("rombank_decrypted")->set_base (m_harem_decrypted_opcodes);
}
diff --git a/src/mame/machine/segacrp2.c b/src/mame/machine/segacrp2.c
index e0d128363ad..b5cff3a5d0e 100644
--- a/src/mame/machine/segacrp2.c
+++ b/src/mame/machine/segacrp2.c
@@ -47,10 +47,9 @@
#include "segacrp2.h"
-static void sega_decode_2(running_machine &machine,const char *cputag,
- const UINT8 xor_table[128],const int swap_table[128])
+void sega_decode_2(UINT8 *rom, UINT8 *decrypted,
+ const UINT8 xor_table[128],const int swap_table[128])
{
- int A;
static const UINT8 swaptable[24][4] =
{
{ 6,4,2,0 }, { 4,6,2,0 }, { 2,4,6,0 }, { 0,4,2,6 },
@@ -62,14 +61,7 @@ static void sega_decode_2(running_machine &machine,const char *cputag,
};
- address_space &space = machine.device(cputag)->memory().space(AS_PROGRAM);
- UINT8 *rom = machine.root_device().memregion(cputag)->base();
- UINT8 *decrypted = auto_alloc_array(machine, UINT8, 0x8000);
-
- space.set_decrypted_region(0x0000, 0x7fff, decrypted);
-
-
- for (A = 0x0000;A < 0x8000;A++)
+ for (int A = 0x0000;A < 0x8000;A++)
{
int row;
UINT8 src;
@@ -93,187 +85,6 @@ static void sega_decode_2(running_machine &machine,const char *cputag,
}
-
-void sega_315_5162_decode(running_machine &machine, const char *cputag)
-{
- static const UINT8 xor_table[128] =
- {
- 0x40,0x10,0x50,0x04,0x44,0x14,0x54,0x01,0x41,0x11,0x51,0x05,0x45,0x15,0x55,
- 0x00,0x40,0x10,0x50,0x04,0x44,0x14,0x54,0x01,0x41,0x11,0x51,0x05,0x45,0x15,0x55,
- 0x00,0x40,0x10,0x50,0x04,0x44,0x14,0x54,0x01,0x41,0x11,0x51,0x05,0x45,0x15,0x55,
- 0x00,0x40,0x10,0x50,0x04,0x44,0x14,0x54,0x01,0x41,0x11,0x51,0x05,0x45,0x15,0x55,
- 0x00,0x40,0x10,0x50,0x04,0x44,0x14,0x54,0x01,0x41,0x11,0x51,0x05,0x45,0x15,0x55,
- 0x00,0x40,0x10,0x50,0x04,0x44,0x14,0x54,0x01,0x41,0x11,0x51,0x05,0x45,0x15,0x55,
- 0x00,0x40,0x10,0x50,0x04,0x44,0x14,0x54,0x01,0x41,0x11,0x51,0x05,0x45,0x15,0x55,
- 0x00,0x40,0x10,0x50,0x04,0x44,0x14,0x54,0x01,0x41,0x11,0x51,0x05,0x45,0x15,0x55,
- 0x00,
- };
-
- static const int swap_table[128] =
- {
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
- 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
- 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
- 12,
- };
-
-
- sega_decode_2(machine,cputag,xor_table,swap_table);
-}
-
-
-void sega_315_5177_decode(running_machine &machine, const char *cputag)
-{
- static const UINT8 xor_table[128] =
- {
- 0x04,0x54,0x51,0x15,0x40,0x44,0x01,0x51,0x55,0x10,0x44,0x41,
- 0x05,0x55,0x50,0x14,0x41,0x45,0x00,0x50,0x54,0x11,0x45,0x40,
- 0x04,0x54,0x51,0x15,0x40,0x44,0x01,0x51,0x55,0x10,0x44,0x41,
- 0x05,0x55,0x50,0x14,0x41,0x45,0x00,0x50,0x54,0x11,0x45,0x40,
- 0x04,0x54,0x51,0x15,0x40,0x44,0x01,0x51,0x55,0x10,0x44,0x41,
- 0x05,0x55,0x50,0x14,
-
- 0x04,0x54,0x51,0x15,0x40,0x44,0x01,0x51,0x55,0x10,0x44,0x41,
- 0x05,0x55,0x50,0x14,0x41,0x45,0x00,0x50,0x54,0x11,0x45,0x40,
- 0x04,0x54,0x51,0x15,0x40,0x44,0x01,0x51,0x55,0x10,0x44,0x41,
- 0x05,0x55,0x50,0x14,0x41,0x45,0x00,0x50,0x54,0x11,0x45,0x40,
- 0x04,0x54,0x51,0x15,0x40,0x44,0x01,0x51,0x55,0x10,0x44,0x41,
- 0x05,0x55,0x50,0x14,
- };
-
- static const int swap_table[128] =
- {
- 0,0,0,0,
- 1,1,1,1,1,
- 2,2,2,2,2,
- 3,3,3,3,
- 4,4,4,4,4,
- 5,5,5,5,5,
- 6,6,6,6,6,
- 7,7,7,7,7,
- 8,8,8,8,
- 9,9,9,9,9,
- 10,10,10,10,10,
- 11,11,11,11,11,
- 12,12,12,12,12,
- 13,13,
-
- 8,8,8,8,
- 9,9,9,9,9,
- 10,10,10,10,10,
- 11,11,11,11,
- 12,12,12,12,12,
- 13,13,13,13,13,
- 14,14,14,14,14,
- 15,15,15,15,15,
- 16,16,16,16,
- 17,17,17,17,17,
- 18,18,18,18,18,
- 19,19,19,19,19,
- 20,20,20,20,20,
- 21,21,
- };
-
-
- sega_decode_2(machine,cputag,xor_table,swap_table);
-}
-
-
-void sega_315_5178_decode(running_machine &machine, const char *cputag)
-{
- static const UINT8 xor_table[128] =
- {
- 0x00,0x55,0x45,0x05,0x11,0x41,0x01,0x14,0x44,0x50,0x10,
- 0x00,0x55,0x15,0x05,0x51,0x41,0x01,0x14,0x44,0x04,0x10,
- 0x40,0x55,0x15,0x05,0x51,0x11,
- 0x01,0x54,0x44,0x04,0x10,0x40,0x00,0x15,0x45,0x51,0x11,
- 0x01,0x54,0x14,0x04,0x50,0x40,0x00,0x15,0x45,0x05,0x11,
- 0x41,0x54,0x14,0x04,0x50,0x10,
- 0x00,0x55,0x45,0x05,0x11,0x41,0x01,0x14,
-
- 0x00,0x55,0x45,0x05,0x11,0x41,0x01,0x14,0x44,0x50,0x10,
- 0x00,0x55,0x15,0x05,0x51,0x41,0x01,0x14,0x44,0x04,0x10,
- 0x40,0x55,0x15,0x05,0x51,0x11,
- 0x01,0x54,0x44,0x04,0x10,0x40,0x00,0x15,0x45,0x51,0x11,
- 0x01,0x54,0x14,0x04,0x50,0x40,0x00,0x15,0x45,0x05,0x11,
- 0x41,0x54,0x14,0x04,0x50,0x10,
- 0x00,0x55,0x45,0x05,0x11,0x41,0x01,0x14,
- };
-
- static const int swap_table[128] =
- {
- 2,
- 3, 5, 7, 1, 3, 5, 7, 1, 3, 5, 7,
- 0, 2, 4, 6, 0, 2, 4, 6, 0, 2, 4,
- 5, 7, 1, 3, 5, 7, 1, 3, 5, 7, 1, 3,
- 4, 6, 0, 2, 4, 6, 0, 2, 4, 6,
- 8,
- 1, 3, 5, 7, 1, 3, 5, 7, 1, 3, 5,
- 6, 0, 2, 4, 6, 0, 2,
-
- 10,
- 11,13,15, 9,11,13,15, 9,11,13,15,
- 8,10,12,14, 8,10,12,14, 8,10,12,
- 13,15, 9,11,13,15, 9,11,13,15, 9,11,
- 12,14, 8,10,12,14, 8,10,12,14,
- 16,
- 9,11,13,15, 9,11,13,15, 9,11,13,
- 14, 8,10,12,14, 8,10,
- };
-
-
- sega_decode_2(machine,cputag,xor_table,swap_table);
-}
-
-
-void sega_315_5179_decode(running_machine &machine, const char *cputag)
-{
- static const UINT8 xor_table[128] =
- {
- 0x00,0x45,0x41,0x14,0x10,0x55,0x51,0x01,0x04,0x40,0x45,0x11,0x14,0x50,
- 0x00,0x05,0x41,0x44,0x10,0x15,0x51,0x54,0x04,
- 0x00,0x45,0x41,0x14,0x10,0x55,0x05,0x01,0x44,0x40,0x15,0x11,0x54,0x50,
- 0x00,0x05,0x41,0x44,0x10,0x15,0x51,0x01,0x04,
- 0x40,0x45,0x11,0x14,0x50,0x55,0x05,0x01,0x44,0x40,0x15,0x11,0x54,0x04,
- 0x00,0x45,0x41,0x14,0x50,
- 0x00,0x05,0x41,0x44,0x10,0x15,0x51,0x54,0x04,
- 0x00,0x45,0x41,0x14,0x50,0x55,0x05,0x01,0x44,0x40,0x15,0x11,0x54,0x50,
- 0x00,0x05,0x41,0x44,0x10,0x55,0x51,0x01,0x04,
- 0x40,0x45,0x11,0x14,0x50,0x55,0x05,0x01,0x44,0x40,0x15,0x51,0x54,0x04,
- 0x00,0x45,0x41,0x14,0x10,0x55,0x51,0x01,0x04,
- 0x40,0x45,0x11,0x54,0x50,0x00,0x05,0x41,
- };
-
- static const int swap_table[128] =
- {
- 8, 9,11,13,15, 0, 2, 4, 6,
- 8, 9,11,13,15, 1, 2, 4, 6,
- 8, 9,11,13,15, 1, 2, 4, 6,
- 8, 9,11,13,15, 1, 2, 4, 6,
- 8,10,11,13,15, 1, 2, 4, 6,
- 8,10,11,13,15, 1, 2, 4, 6,
- 8,10,11,13,15, 1, 3, 4, 6,
- 8,
- 7, 1, 2, 4, 6, 0, 1, 3, 5,
- 7, 1, 2, 4, 6, 0, 1, 3, 5,
- 7, 1, 2, 4, 6, 0, 2, 3, 5,
- 7, 1, 2, 4, 6, 0, 2, 3, 5,
- 7, 1, 2, 4, 6, 0, 2, 3, 5,
- 7, 1, 3, 4, 6, 0, 2, 3, 5,
- 7, 1, 3, 4, 6, 0, 2, 4, 5,
- 7,
- };
-
-
- sega_decode_2(machine,cputag,xor_table,swap_table);
-}
-
-
/******************************************************************************
These games (all 317-000x CPUs) use the same algorithm, but the key doesn't
@@ -281,7 +92,7 @@ void sega_315_5179_decode(running_machine &machine, const char *cputag)
******************************************************************************/
-static void sega_decode_317(running_machine &machine, const char *cputag, int shift)
+void sega_decode_317(UINT8 *rom, UINT8 *decrypted, int shift)
{
static const UINT8 xor_table[128+3] =
{
@@ -309,10 +120,5 @@ static void sega_decode_317(running_machine &machine, const char *cputag, int sh
10,20, 1,
};
- sega_decode_2( machine, cputag, xor_table + shift, swap_table + shift );
+ sega_decode_2(rom, decrypted, xor_table + shift, swap_table + shift);
}
-
-void sega_317_0004_decode(running_machine &machine, const char *cputag) { sega_decode_317( machine, cputag, 0 ); }
-void sega_317_0005_decode(running_machine &machine, const char *cputag) { sega_decode_317( machine, cputag, 1 ); }
-void sega_317_0006_decode(running_machine &machine, const char *cputag) { sega_decode_317( machine, cputag, 2 ); }
-void sega_317_0007_decode(running_machine &machine, const char *cputag) { sega_decode_317( machine, cputag, 3 ); }
diff --git a/src/mame/machine/segacrp2.h b/src/mame/machine/segacrp2.h
index 36493c9edf0..a842ef8096b 100644
--- a/src/mame/machine/segacrp2.h
+++ b/src/mame/machine/segacrp2.h
@@ -1,10 +1,7 @@
// license:BSD-3-Clause
// copyright-holders:Nicola Salmoria
-void sega_315_5162_decode(running_machine &machine, const char *cputag);
-void sega_315_5177_decode(running_machine &machine, const char *cputag);
-void sega_315_5178_decode(running_machine &machine, const char *cputag);
-void sega_315_5179_decode(running_machine &machine, const char *cputag);
-void sega_317_0004_decode(running_machine &machine, const char *cputag);
-void sega_317_0005_decode(running_machine &machine, const char *cputag);
-void sega_317_0006_decode(running_machine &machine, const char *cputag);
-void sega_317_0007_decode(running_machine &machine, const char *cputag);
+
+void sega_decode_2(UINT8 *rom, UINT8 *decrypted,
+ const UINT8 xor_table[128],const int swap_table[128]);
+
+void sega_decode_317(UINT8 *rom, UINT8 *decrypted, int shift);
diff --git a/src/mame/machine/segacrpt.c b/src/mame/machine/segacrpt.c
index 48c152a7ed6..e577ac786c8 100644
--- a/src/mame/machine/segacrpt.c
+++ b/src/mame/machine/segacrpt.c
@@ -215,26 +215,21 @@ static void look_for_known_plaintext(void)
}
#endif
-static void sega_decode(running_machine &machine, const char *cputag, const UINT8 convtable[32][4])
+void sega_decode(UINT8 *data, UINT8 *opcodes, int size, const UINT8 convtable[32][4], int bank_count, int bank_size)
{
- int A;
-
- address_space &space = machine.device(cputag)->memory().space(AS_PROGRAM);
- int length = machine.root_device().memregion(cputag)->bytes();
- int cryptlen = MIN(length, 0x8000);
- UINT8 *rom = machine.root_device().memregion(cputag)->base();
- UINT8 *decrypted = auto_alloc_array(machine, UINT8, 0xc000);
-
- space.set_decrypted_region(0x0000, cryptlen - 1, decrypted);
-
- for (A = 0x0000;A < cryptlen;A++)
+ for (int A = 0x0000;A < size + bank_count*bank_size;A++)
{
int xorval = 0;
- UINT8 src = rom[A];
+ UINT8 src = data[A];
+ int adr;
+ if(A < size || !bank_count)
+ adr = A;
+ else
+ adr = size + ((A - size) % bank_size);
/* pick the translation table from bits 0, 4, 8 and 12 of the address */
- int row = (A & 1) + (((A >> 4) & 1) << 1) + (((A >> 8) & 1) << 2) + (((A >> 12) & 1) << 3);
+ int row = (adr & 1) + (((adr >> 4) & 1) << 1) + (((adr >> 8) & 1) << 2) + (((adr >> 12) & 1) << 3);
/* pick the offset in the table from bits 3 and 5 of the source data */
int col = ((src >> 3) & 1) + (((src >> 5) & 1) << 1);
@@ -246,826 +241,14 @@ static void sega_decode(running_machine &machine, const char *cputag, const UINT
}
/* decode the opcodes */
- decrypted[A] = (src & ~0xa8) | (convtable[2*row][col] ^ xorval);
+ opcodes[A] = (src & ~0xa8) | (convtable[2*row][col] ^ xorval);
/* decode the data */
- rom[A] = (src & ~0xa8) | (convtable[2*row+1][col] ^ xorval);
+ data[A] = (src & ~0xa8) | (convtable[2*row+1][col] ^ xorval);
if (convtable[2*row][col] == 0xff) /* table incomplete! (for development) */
- decrypted[A] = 0xee;
+ opcodes[A] = 0xee;
if (convtable[2*row+1][col] == 0xff) /* table incomplete! (for development) */
- rom[A] = 0xee;
- }
-
- /* this is a kludge to catch anyone who has code that crosses the encrypted/ */
- /* decrypted boundary. ssanchan does it */
- if (length > 0x8000)
- {
- int bytes = MIN(length - 0x8000, 0x4000);
- memcpy(&decrypted[0x8000], &rom[0x8000], bytes);
- }
-}
-
-
-
-void buckrog_decode(running_machine &machine, const char *cputag)
-{
- static const UINT8 convtable[32][4] =
- {
- /* opcode data address */
- /* A B C D A B C D */
- { 0x80,0x00,0x88,0x08 }, { 0x28,0x20,0xa8,0xa0 }, /* ...0...0...0...0 */
- { 0x88,0xa8,0x80,0xa0 }, { 0xa0,0x80,0x20,0x00 }, /* ...0...0...0...1 */
- { 0x28,0xa8,0x08,0x88 }, { 0xa8,0xa0,0x88,0x80 }, /* ...0...0...1...0 */
- { 0x80,0x00,0x88,0x08 }, { 0x28,0x20,0xa8,0xa0 }, /* ...0...0...1...1 */
- { 0x88,0xa8,0x80,0xa0 }, { 0xa0,0x80,0x20,0x00 }, /* ...0...1...0...0 */
- { 0x80,0x00,0x88,0x08 }, { 0x28,0x20,0xa8,0xa0 }, /* ...0...1...0...1 */
- { 0x28,0xa8,0x08,0x88 }, { 0xa8,0xa0,0x88,0x80 }, /* ...0...1...1...0 */
- { 0x88,0xa8,0x80,0xa0 }, { 0xa0,0x80,0x20,0x00 }, /* ...0...1...1...1 */
- { 0x28,0xa8,0x08,0x88 }, { 0xa8,0xa0,0x88,0x80 }, /* ...1...0...0...0 */
- { 0x80,0x00,0x88,0x08 }, { 0x28,0x20,0xa8,0xa0 }, /* ...1...0...0...1 */
- { 0x80,0x00,0x88,0x08 }, { 0x28,0x20,0xa8,0xa0 }, /* ...1...0...1...0 */
- { 0x88,0xa8,0x80,0xa0 }, { 0xa0,0x80,0x20,0x00 }, /* ...1...0...1...1 */
- { 0x80,0x00,0x88,0x08 }, { 0x28,0x20,0xa8,0xa0 }, /* ...1...1...0...0 */
- { 0x88,0xa8,0x80,0xa0 }, { 0xa0,0x80,0x20,0x00 }, /* ...1...1...0...1 */
- { 0x88,0xa8,0x80,0xa0 }, { 0xa0,0x80,0x20,0x00 }, /* ...1...1...1...0 */
- { 0x28,0xa8,0x08,0x88 }, { 0xa8,0xa0,0x88,0x80 } /* ...1...1...1...1 */
- };
-
-
- sega_decode(machine, cputag, convtable);
-}
-
-
-void pengo_decode(running_machine &machine, const char *cputag)
-{
- static const UINT8 convtable[32][4] =
- {
- /* opcode data address */
- /* A B C D A B C D */
- { 0xa0,0x80,0xa8,0x88 }, { 0x28,0xa8,0x08,0x88 }, /* ...0...0...0...0 */
- { 0x28,0xa8,0x08,0x88 }, { 0xa0,0x80,0xa8,0x88 }, /* ...0...0...0...1 */
- { 0xa0,0x80,0x20,0x00 }, { 0xa0,0x80,0x20,0x00 }, /* ...0...0...1...0 */
- { 0x08,0x28,0x88,0xa8 }, { 0xa0,0x80,0xa8,0x88 }, /* ...0...0...1...1 */
- { 0x08,0x00,0x88,0x80 }, { 0x28,0xa8,0x08,0x88 }, /* ...0...1...0...0 */
- { 0xa0,0x80,0x20,0x00 }, { 0x08,0x00,0x88,0x80 }, /* ...0...1...0...1 */
- { 0xa0,0x80,0x20,0x00 }, { 0xa0,0x80,0x20,0x00 }, /* ...0...1...1...0 */
- { 0xa0,0x80,0x20,0x00 }, { 0x00,0x08,0x20,0x28 }, /* ...0...1...1...1 */
- { 0x88,0x80,0x08,0x00 }, { 0xa0,0x80,0x20,0x00 }, /* ...1...0...0...0 */
- { 0x88,0x80,0x08,0x00 }, { 0x00,0x08,0x20,0x28 }, /* ...1...0...0...1 */
- { 0x08,0x28,0x88,0xa8 }, { 0x08,0x28,0x88,0xa8 }, /* ...1...0...1...0 */
- { 0xa0,0x80,0xa8,0x88 }, { 0xa0,0x80,0x20,0x00 }, /* ...1...0...1...1 */
- { 0x08,0x00,0x88,0x80 }, { 0x88,0x80,0x08,0x00 }, /* ...1...1...0...0 */
- { 0x00,0x08,0x20,0x28 }, { 0x88,0x80,0x08,0x00 }, /* ...1...1...0...1 */
- { 0x08,0x28,0x88,0xa8 }, { 0x08,0x28,0x88,0xa8 }, /* ...1...1...1...0 */
- { 0x08,0x00,0x88,0x80 }, { 0xa0,0x80,0x20,0x00 } /* ...1...1...1...1 */
- };
-
-
- sega_decode(machine, cputag, convtable);
-}
-
-
-void szaxxon_decode(running_machine &machine, const char *cputag)
-{
- static const UINT8 convtable[32][4] =
- {
- /* opcode data address */
- /* A B C D A B C D */
- { 0x88,0xa8,0x80,0xa0 }, { 0x28,0x20,0xa8,0xa0 }, /* ...0...0...0...0 */
- { 0x08,0x28,0x88,0xa8 }, { 0x88,0x80,0x08,0x00 }, /* ...0...0...0...1 */
- { 0xa8,0x28,0xa0,0x20 }, { 0x20,0xa0,0x00,0x80 }, /* ...0...0...1...0 */
- { 0x88,0xa8,0x80,0xa0 }, { 0x28,0x20,0xa8,0xa0 }, /* ...0...0...1...1 */
- { 0x08,0x28,0x88,0xa8 }, { 0x88,0x80,0x08,0x00 }, /* ...0...1...0...0 */
- { 0x88,0xa8,0x80,0xa0 }, { 0x28,0x20,0xa8,0xa0 }, /* ...0...1...0...1 */
- { 0xa8,0x28,0xa0,0x20 }, { 0x20,0xa0,0x00,0x80 }, /* ...0...1...1...0 */
- { 0x08,0x28,0x88,0xa8 }, { 0x88,0x80,0x08,0x00 }, /* ...0...1...1...1 */
- { 0x08,0x28,0x88,0xa8 }, { 0x88,0x80,0x08,0x00 }, /* ...1...0...0...0 */
- { 0x88,0xa8,0x80,0xa0 }, { 0x28,0x20,0xa8,0xa0 }, /* ...1...0...0...1 */
- { 0x88,0xa8,0x80,0xa0 }, { 0x28,0x20,0xa8,0xa0 }, /* ...1...0...1...0 */
- { 0xa8,0x28,0xa0,0x20 }, { 0x20,0xa0,0x00,0x80 }, /* ...1...0...1...1 */
- { 0xa8,0x28,0xa0,0x20 }, { 0x20,0xa0,0x00,0x80 }, /* ...1...1...0...0 */
- { 0xa8,0x28,0xa0,0x20 }, { 0x20,0xa0,0x00,0x80 }, /* ...1...1...0...1 */
- { 0x08,0x28,0x88,0xa8 }, { 0x88,0x80,0x08,0x00 }, /* ...1...1...1...0 */
- { 0x88,0xa8,0x80,0xa0 }, { 0x28,0x20,0xa8,0xa0 } /* ...1...1...1...1 */
- };
-
-
- sega_decode(machine, cputag, convtable);
-}
-
-
-void suprloco_decode(running_machine &machine, const char *cputag)
-{
- static const UINT8 convtable[32][4] =
- {
- /* opcode data address */
- /* A B C D A B C D */
- { 0x20,0x00,0xa0,0x80 }, { 0xa8,0xa0,0x88,0x80 }, /* ...0...0...0...0 */
- { 0x20,0x00,0xa0,0x80 }, { 0xa8,0xa0,0x88,0x80 }, /* ...0...0...0...1 */
- { 0x20,0x00,0xa0,0x80 }, { 0xa8,0xa0,0x88,0x80 }, /* ...0...0...1...0 */
- { 0x88,0x08,0x80,0x00 }, { 0xa0,0x80,0xa8,0x88 }, /* ...0...0...1...1 */
- { 0x88,0x08,0x80,0x00 }, { 0xa0,0x80,0xa8,0x88 }, /* ...0...1...0...0 */
- { 0x20,0x00,0xa0,0x80 }, { 0xa8,0xa0,0x88,0x80 }, /* ...0...1...0...1 */
- { 0x88,0x08,0x80,0x00 }, { 0xa0,0x80,0xa8,0x88 }, /* ...0...1...1...0 */
- { 0x28,0xa8,0x08,0x88 }, { 0x88,0x80,0x08,0x00 }, /* ...0...1...1...1 */
- { 0x20,0x00,0xa0,0x80 }, { 0xa8,0xa0,0x88,0x80 }, /* ...1...0...0...0 */
- { 0x88,0x08,0x80,0x00 }, { 0xa0,0x80,0xa8,0x88 }, /* ...1...0...0...1 */
- { 0x88,0x08,0x80,0x00 }, { 0xa0,0x80,0xa8,0x88 }, /* ...1...0...1...0 */
- { 0x20,0x00,0xa0,0x80 }, { 0xa8,0xa0,0x88,0x80 }, /* ...1...0...1...1 */
- { 0x88,0x08,0x80,0x00 }, { 0xa0,0x80,0xa8,0x88 }, /* ...1...1...0...0 */
- { 0x28,0xa8,0x08,0x88 }, { 0x88,0x80,0x08,0x00 }, /* ...1...1...0...1 */
- { 0x20,0x00,0xa0,0x80 }, { 0xa8,0xa0,0x88,0x80 }, /* ...1...1...1...0 */
- { 0x88,0x08,0x80,0x00 }, { 0xa0,0x80,0xa8,0x88 } /* ...1...1...1...1 */
- };
-
-
- sega_decode(machine, cputag, convtable);
-}
-
-
-void yamato_decode(running_machine &machine, const char *cputag)
-{
- static const UINT8 convtable[32][4] =
- {
- /* opcode data address */
- /* A B C D A B C D */
- { 0x88,0xa8,0x08,0x28 }, { 0x88,0xa8,0x80,0xa0 }, /* ...0...0...0...0 */
- { 0x20,0xa0,0x28,0xa8 }, { 0x88,0xa8,0x80,0xa0 }, /* ...0...0...0...1 */
- { 0x88,0xa8,0x80,0xa0 }, { 0x88,0xa8,0x80,0xa0 }, /* ...0...0...1...0 */
- { 0x88,0xa8,0x80,0xa0 }, { 0x20,0xa0,0x28,0xa8 }, /* ...0...0...1...1 */
- { 0x88,0xa8,0x08,0x28 }, { 0x88,0xa8,0x08,0x28 }, /* ...0...1...0...0 */
- { 0x88,0xa8,0x80,0xa0 }, { 0x88,0xa8,0x80,0xa0 }, /* ...0...1...0...1 */
- { 0x20,0xa0,0x28,0xa8 }, { 0x20,0xa0,0x28,0xa8 }, /* ...0...1...1...0 */
- { 0x88,0xa8,0x80,0xa0 }, { 0x88,0xa8,0x80,0xa0 }, /* ...0...1...1...1 */
- { 0x20,0xa0,0x28,0xa8 }, { 0x88,0xa8,0x08,0x28 }, /* ...1...0...0...0 */
- { 0x20,0xa0,0x28,0xa8 }, { 0x28,0x20,0xa8,0xa0 }, /* ...1...0...0...1 */
- { 0xa0,0x20,0x80,0x00 }, { 0x20,0xa0,0x28,0xa8 }, /* ...1...0...1...0 */
- { 0x28,0x20,0xa8,0xa0 }, { 0x20,0xa0,0x28,0xa8 }, /* ...1...0...1...1 */
- { 0x20,0xa0,0x28,0xa8 }, { 0x88,0xa8,0x08,0x28 }, /* ...1...1...0...0 */
- { 0x88,0xa8,0x08,0x28 }, { 0x88,0xa8,0x08,0x28 }, /* ...1...1...0...1 */
- { 0xa0,0x20,0x80,0x00 }, { 0x88,0x08,0x80,0x00 }, /* ...1...1...1...0 */
- { 0x20,0xa0,0x28,0xa8 }, { 0x00,0x08,0x20,0x28 } /* ...1...1...1...1 */
- };
-
-
- sega_decode(machine, cputag, convtable);
-}
-
-void toprollr_decode(running_machine &machine, const char *cputag, const char *regiontag)
-{
- /* same tables as in Yamato, but encrypted ROM is banked */
- UINT8 *decrypted;
-
- static const UINT8 convtable[32][4] =
- {
- /* opcode data address */
- /* A B C D A B C D */
- { 0x88,0xa8,0x08,0x28 }, { 0x88,0xa8,0x80,0xa0 }, /* ...0...0...0...0 */
- { 0x20,0xa0,0x28,0xa8 }, { 0x88,0xa8,0x80,0xa0 }, /* ...0...0...0...1 */
- { 0x88,0xa8,0x80,0xa0 }, { 0x88,0xa8,0x80,0xa0 }, /* ...0...0...1...0 */
- { 0x88,0xa8,0x80,0xa0 }, { 0x20,0xa0,0x28,0xa8 }, /* ...0...0...1...1 */
- { 0x88,0xa8,0x08,0x28 }, { 0x88,0xa8,0x08,0x28 }, /* ...0...1...0...0 */
- { 0x88,0xa8,0x80,0xa0 }, { 0x88,0xa8,0x80,0xa0 }, /* ...0...1...0...1 */
- { 0x20,0xa0,0x28,0xa8 }, { 0x20,0xa0,0x28,0xa8 }, /* ...0...1...1...0 */
- { 0x88,0xa8,0x80,0xa0 }, { 0x88,0xa8,0x80,0xa0 }, /* ...0...1...1...1 */
- { 0x20,0xa0,0x28,0xa8 }, { 0x88,0xa8,0x08,0x28 }, /* ...1...0...0...0 */
- { 0x20,0xa0,0x28,0xa8 }, { 0x28,0x20,0xa8,0xa0 }, /* ...1...0...0...1 */
- { 0xa0,0x20,0x80,0x00 }, { 0x20,0xa0,0x28,0xa8 }, /* ...1...0...1...0 */
- { 0x28,0x20,0xa8,0xa0 }, { 0x20,0xa0,0x28,0xa8 }, /* ...1...0...1...1 */
- { 0x20,0xa0,0x28,0xa8 }, { 0x88,0xa8,0x08,0x28 }, /* ...1...1...0...0 */
- { 0x88,0xa8,0x08,0x28 }, { 0x88,0xa8,0x08,0x28 }, /* ...1...1...0...1 */
- { 0xa0,0x20,0x80,0x00 }, { 0x88,0x08,0x80,0x00 }, /* ...1...1...1...0 */
- { 0x20,0xa0,0x28,0xa8 }, { 0x00,0x08,0x20,0x28 } /* ...1...1...1...1 */
- };
-
- int A;
-
- address_space &space = machine.device(cputag)->memory().space(AS_PROGRAM);
- UINT8 *rom = machine.root_device().memregion(regiontag)->base();
- int bankstart;
- decrypted = auto_alloc_array(machine, UINT8, 0x6000*3);
-
-
- for(bankstart=0;bankstart<0x6000*3;bankstart+=0x6000)
- for (A = 0x0000;A < 0x6000;A++)
- {
- int xorval = 0;
-
- UINT8 src = rom[A+bankstart];
-
- /* pick the translation table from bits 0, 4, 8 and 12 of the address */
- int row = (A & 1) + (((A >> 4) & 1) << 1) + (((A >> 8) & 1) << 2) + (((A >> 12) & 1) << 3);
-
- /* pick the offset in the table from bits 3 and 5 of the source data */
- int col = ((src >> 3) & 1) + (((src >> 5) & 1) << 1);
- /* the bottom half of the translation table is the mirror image of the top */
- if (src & 0x80)
- {
- col = 3 - col;
- xorval = 0xa8;
- }
-
- /* decode the opcodes */
- decrypted[A+bankstart] = (src & ~0xa8) | (convtable[2*row][col] ^ xorval);
-
- /* decode the data */
- rom[A+bankstart] = (src & ~0xa8) | (convtable[2*row+1][col] ^ xorval);
- }
-
- machine.root_device().membank("bank1")->configure_entries(0,3, machine.root_device().memregion(regiontag)->base(),0x6000);
- machine.root_device().membank("bank1")->configure_decrypted_entries(0,3,decrypted,0x6000);
- space.set_decrypted_region(0x0000, 0x5fff, decrypted);
- space.machine().root_device().membank("bank1")->set_entry(0);
-}
-
-
-void sindbadm_decode(running_machine &machine, const char *cputag)
-{
- static const UINT8 convtable[32][4] =
- {
- /* opcode data address */
- /* A B C D A B C D */
- { 0x28,0xa8,0x08,0x88 }, { 0x88,0x80,0x08,0x00 }, /* ...0...0...0...0 */
- { 0xa8,0xa0,0x88,0x80 }, { 0x00,0x20,0x80,0xa0 }, /* ...0...0...0...1 */
- { 0xa8,0xa0,0x88,0x80 }, { 0x00,0x20,0x80,0xa0 }, /* ...0...0...1...0 */
- { 0x28,0xa8,0x08,0x88 }, { 0x88,0x80,0x08,0x00 }, /* ...0...0...1...1 */
- { 0xa8,0x88,0xa0,0x80 }, { 0xa0,0x20,0xa8,0x28 }, /* ...0...1...0...0 */
- { 0x28,0xa8,0x08,0x88 }, { 0x88,0x80,0x08,0x00 }, /* ...0...1...0...1 */
- { 0xa8,0xa0,0x88,0x80 }, { 0x00,0x20,0x80,0xa0 }, /* ...0...1...1...0 */
- { 0xa8,0xa0,0x88,0x80 }, { 0x00,0x20,0x80,0xa0 }, /* ...0...1...1...1 */
- { 0x28,0xa8,0x08,0x88 }, { 0x88,0x80,0x08,0x00 }, /* ...1...0...0...0 */
- { 0x28,0xa8,0x08,0x88 }, { 0x88,0x80,0x08,0x00 }, /* ...1...0...0...1 */
- { 0xa8,0xa0,0x88,0x80 }, { 0x00,0x20,0x80,0xa0 }, /* ...1...0...1...0 */
- { 0xa8,0xa0,0x88,0x80 }, { 0x00,0x20,0x80,0xa0 }, /* ...1...0...1...1 */
- { 0x28,0xa8,0x08,0x88 }, { 0x88,0x80,0x08,0x00 }, /* ...1...1...0...0 */
- { 0xa8,0x88,0xa0,0x80 }, { 0xa0,0x20,0xa8,0x28 }, /* ...1...1...0...1 */
- { 0x28,0xa8,0x08,0x88 }, { 0x88,0x80,0x08,0x00 }, /* ...1...1...1...0 */
- { 0x28,0xa8,0x08,0x88 }, { 0x88,0x80,0x08,0x00 } /* ...1...1...1...1 */
- };
-
-
- sega_decode(machine, cputag, convtable);
-}
-
-
-void regulus_decode(running_machine &machine, const char *cputag)
-{
- static const UINT8 convtable[32][4] =
- {
- /* opcode data address */
- /* A B C D A B C D */
- { 0x28,0x08,0xa8,0x88 }, { 0x88,0x80,0x08,0x00 }, /* ...0...0...0...0 */
- { 0x28,0x08,0xa8,0x88 }, { 0x28,0xa8,0x08,0x88 }, /* ...0...0...0...1 */
- { 0x88,0x80,0x08,0x00 }, { 0x88,0x08,0x80,0x00 }, /* ...0...0...1...0 */
- { 0x88,0x08,0x80,0x00 }, { 0x28,0xa8,0x08,0x88 }, /* ...0...0...1...1 */
- { 0x28,0x08,0xa8,0x88 }, { 0x88,0x80,0x08,0x00 }, /* ...0...1...0...0 */
- { 0x88,0x80,0x08,0x00 }, { 0x88,0x80,0x08,0x00 }, /* ...0...1...0...1 */
- { 0x88,0x08,0x80,0x00 }, { 0x88,0x08,0x80,0x00 }, /* ...0...1...1...0 */
- { 0xa0,0x80,0xa8,0x88 }, { 0xa0,0x80,0xa8,0x88 }, /* ...0...1...1...1 */
- { 0x80,0xa0,0x00,0x20 }, { 0x28,0x08,0xa8,0x88 }, /* ...1...0...0...0 */
- { 0x28,0xa8,0x08,0x88 }, { 0x28,0x08,0xa8,0x88 }, /* ...1...0...0...1 */
- { 0x80,0xa0,0x00,0x20 }, { 0x80,0xa0,0x00,0x20 }, /* ...1...0...1...0 */
- { 0x28,0xa8,0x08,0x88 }, { 0x80,0xa0,0x00,0x20 }, /* ...1...0...1...1 */
- { 0xa0,0x80,0xa8,0x88 }, { 0x28,0x08,0xa8,0x88 }, /* ...1...1...0...0 */
- { 0x80,0xa0,0x00,0x20 }, { 0xa0,0x80,0xa8,0x88 }, /* ...1...1...0...1 */
- { 0xa0,0x80,0xa8,0x88 }, { 0x80,0xa0,0x00,0x20 }, /* ...1...1...1...0 */
- { 0xa0,0x80,0xa8,0x88 }, { 0xa0,0x80,0xa8,0x88 } /* ...1...1...1...1 */
- };
-
-
- sega_decode(machine, cputag, convtable);
-}
-
-
-void mrviking_decode(running_machine &machine, const char *cputag)
-{
- static const UINT8 convtable[32][4] =
- {
- /* opcode data address */
- /* A B C D A B C D */
- { 0x28,0xa8,0x08,0x88 }, { 0x88,0x80,0x08,0x00 }, /* ...0...0...0...0 */
- { 0x88,0x08,0x80,0x00 }, { 0x88,0x80,0x08,0x00 }, /* ...0...0...0...1 */
- { 0x28,0x08,0xa8,0x88 }, { 0x28,0xa8,0x08,0x88 }, /* ...0...0...1...0 */
- { 0x88,0x08,0x80,0x00 }, { 0x88,0x08,0x80,0x00 }, /* ...0...0...1...1 */
- { 0x28,0x08,0xa8,0x88 }, { 0x88,0x80,0x08,0x00 }, /* ...0...1...0...0 */
- { 0x88,0x80,0x08,0x00 }, { 0x28,0xa8,0x08,0x88 }, /* ...0...1...0...1 */
- { 0xa0,0x80,0xa8,0x88 }, { 0x28,0x08,0xa8,0x88 }, /* ...0...1...1...0 */
- { 0xa0,0x80,0xa8,0x88 }, { 0xa0,0x80,0xa8,0x88 }, /* ...0...1...1...1 */
- { 0x88,0x80,0x08,0x00 }, { 0x88,0x80,0x08,0x00 }, /* ...1...0...0...0 */
- { 0x88,0x08,0x80,0x00 }, { 0x88,0x80,0x08,0x00 }, /* ...1...0...0...1 */
- { 0xa0,0x80,0x20,0x00 }, { 0x28,0x08,0xa8,0x88 }, /* ...1...0...1...0 */
- { 0xa0,0x80,0x20,0x00 }, { 0x88,0x08,0x80,0x00 }, /* ...1...0...1...1 */
- { 0x28,0x08,0xa8,0x88 }, { 0xa0,0x80,0x20,0x00 }, /* ...1...1...0...0 */
- { 0xa0,0x80,0x20,0x00 }, { 0xa0,0x80,0x20,0x00 }, /* ...1...1...0...1 */
- { 0xa0,0x80,0xa8,0x88 }, { 0x28,0x08,0xa8,0x88 }, /* ...1...1...1...0 */
- { 0xa0,0x80,0x20,0x00 }, { 0xa0,0x80,0xa8,0x88 } /* ...1...1...1...1 */
- };
-
-
- sega_decode(machine, cputag, convtable);
-}
-
-
-void swat_decode(running_machine &machine, const char *cputag)
-{
- static const UINT8 convtable[32][4] =
- {
- /* opcode data address */
- /* A B C D A B C D */
- { 0x88,0x08,0x80,0x00 }, { 0xa0,0xa8,0x80,0x88 }, /* ...0...0...0...0 */
- { 0x88,0x08,0x80,0x00 }, { 0x88,0xa8,0x80,0xa0 }, /* ...0...0...0...1 */
- { 0xa0,0x80,0x20,0x00 }, { 0x88,0x08,0x80,0x00 }, /* ...0...0...1...0 */
- { 0xa0,0xa8,0x80,0x88 }, { 0x88,0x08,0x80,0x00 }, /* ...0...0...1...1 */
- { 0x28,0x20,0xa8,0xa0 }, { 0xa0,0xa8,0x80,0x88 }, /* ...0...1...0...0 */
- { 0x88,0xa8,0x80,0xa0 }, { 0x28,0x20,0xa8,0xa0 }, /* ...0...1...0...1 */
- { 0xa0,0x80,0x20,0x00 }, { 0xa0,0xa8,0x80,0x88 }, /* ...0...1...1...0 */
- { 0x28,0x20,0xa8,0xa0 }, { 0xa0,0xa8,0x80,0x88 }, /* ...0...1...1...1 */
- { 0xa0,0x80,0x20,0x00 }, { 0xa0,0x80,0x20,0x00 }, /* ...1...0...0...0 */
- { 0xa0,0x20,0x80,0x00 }, { 0x88,0xa8,0x80,0xa0 }, /* ...1...0...0...1 */
- { 0xa0,0x20,0x80,0x00 }, { 0xa0,0x20,0x80,0x00 }, /* ...1...0...1...0 */
- { 0xa0,0x20,0x80,0x00 }, { 0xa0,0x20,0x80,0x00 }, /* ...1...0...1...1 */
- { 0xa0,0x80,0x20,0x00 }, { 0xa0,0x80,0x20,0x00 }, /* ...1...1...0...0 */
- { 0x88,0xa8,0x80,0xa0 }, { 0x28,0x20,0xa8,0xa0 }, /* ...1...1...0...1 */
- { 0xa0,0xa8,0x80,0x88 }, { 0xa0,0x80,0x20,0x00 }, /* ...1...1...1...0 */
- { 0x28,0x20,0xa8,0xa0 }, { 0xa0,0xa8,0x80,0x88 } /* ...1...1...1...1 */
- };
-
-
- sega_decode(machine, cputag, convtable);
-}
-
-
-void flicky_decode(running_machine &machine, const char *cputag)
-{
- static const UINT8 convtable[32][4] =
- {
- /* opcode data address */
- /* A B C D A B C D */
- { 0x08,0x88,0x00,0x80 }, { 0xa0,0x80,0xa8,0x88 }, /* ...0...0...0...0 */
- { 0x80,0x00,0xa0,0x20 }, { 0x88,0x80,0x08,0x00 }, /* ...0...0...0...1 */
- { 0xa0,0x80,0xa8,0x88 }, { 0x28,0x08,0x20,0x00 }, /* ...0...0...1...0 */
- { 0x28,0x08,0x20,0x00 }, { 0xa0,0x80,0xa8,0x88 }, /* ...0...0...1...1 */
- { 0x08,0x88,0x00,0x80 }, { 0x80,0x00,0xa0,0x20 }, /* ...0...1...0...0 */
- { 0x80,0x00,0xa0,0x20 }, { 0x88,0x80,0x08,0x00 }, /* ...0...1...0...1 */
- { 0x28,0x08,0x20,0x00 }, { 0x28,0x08,0x20,0x00 }, /* ...0...1...1...0 */
- { 0x28,0x08,0x20,0x00 }, { 0x88,0x80,0x08,0x00 }, /* ...0...1...1...1 */
- { 0x08,0x88,0x00,0x80 }, { 0xa8,0x88,0x28,0x08 }, /* ...1...0...0...0 */
- { 0xa8,0x88,0x28,0x08 }, { 0x80,0x00,0xa0,0x20 }, /* ...1...0...0...1 */
- { 0x28,0x08,0x20,0x00 }, { 0x88,0x80,0x08,0x00 }, /* ...1...0...1...0 */
- { 0xa8,0x88,0x28,0x08 }, { 0x88,0x80,0x08,0x00 }, /* ...1...0...1...1 */
- { 0x08,0x88,0x00,0x80 }, { 0x80,0x00,0xa0,0x20 }, /* ...1...1...0...0 */
- { 0xa8,0x88,0x28,0x08 }, { 0x80,0x00,0xa0,0x20 }, /* ...1...1...0...1 */
- { 0x28,0x08,0x20,0x00 }, { 0x28,0x08,0x20,0x00 }, /* ...1...1...1...0 */
- { 0x08,0x88,0x00,0x80 }, { 0x88,0x80,0x08,0x00 } /* ...1...1...1...1 */
- };
-
-
- sega_decode(machine, cputag, convtable);
-}
-
-
-void futspy_decode(running_machine &machine, const char *cputag)
-{
- static const UINT8 convtable[32][4] =
- {
- /* opcode data address */
- /* A B C D A B C D */
- { 0x28,0x08,0x20,0x00 }, { 0x28,0x08,0x20,0x00 }, /* ...0...0...0...0 */
- { 0x80,0x00,0xa0,0x20 }, { 0x08,0x88,0x00,0x80 }, /* ...0...0...0...1 */
- { 0x80,0x00,0xa0,0x20 }, { 0x08,0x88,0x00,0x80 }, /* ...0...0...1...0 */
- { 0xa0,0x80,0x20,0x00 }, { 0x20,0x28,0xa0,0xa8 }, /* ...0...0...1...1 */
- { 0x28,0x08,0x20,0x00 }, { 0x88,0x80,0xa8,0xa0 }, /* ...0...1...0...0 */
- { 0x80,0x00,0xa0,0x20 }, { 0x08,0x88,0x00,0x80 }, /* ...0...1...0...1 */
- { 0x80,0x00,0xa0,0x20 }, { 0x20,0x28,0xa0,0xa8 }, /* ...0...1...1...0 */
- { 0x20,0x28,0xa0,0xa8 }, { 0x08,0x88,0x00,0x80 }, /* ...0...1...1...1 */
- { 0x88,0x80,0xa8,0xa0 }, { 0x28,0x08,0x20,0x00 }, /* ...1...0...0...0 */
- { 0x80,0x00,0xa0,0x20 }, { 0xa0,0x80,0x20,0x00 }, /* ...1...0...0...1 */
- { 0x20,0x28,0xa0,0xa8 }, { 0x08,0x88,0x00,0x80 }, /* ...1...0...1...0 */
- { 0x80,0x00,0xa0,0x20 }, { 0x20,0x28,0xa0,0xa8 }, /* ...1...0...1...1 */
- { 0x88,0x80,0xa8,0xa0 }, { 0x88,0x80,0xa8,0xa0 }, /* ...1...1...0...0 */
- { 0x80,0x00,0xa0,0x20 }, { 0x08,0x88,0x00,0x80 }, /* ...1...1...0...1 */
- { 0x80,0x00,0xa0,0x20 }, { 0x28,0x08,0x20,0x00 }, /* ...1...1...1...0 */
- { 0x20,0x28,0xa0,0xa8 }, { 0xa0,0x80,0x20,0x00 } /* ...1...1...1...1 */
- };
-
-
- sega_decode(machine, cputag, convtable);
-}
-
-
-void wmatch_decode(running_machine &machine, const char *cputag)
-{
- static const UINT8 convtable[32][4] =
- {
- /* opcode data address */
- /* A B C D A B C D */
- { 0x88,0xa8,0x80,0xa0 }, { 0xa0,0x80,0x20,0x00 }, /* ...0...0...0...0 */
- { 0x08,0x88,0x00,0x80 }, { 0x88,0xa8,0x80,0xa0 }, /* ...0...0...0...1 */
- { 0x20,0x00,0xa0,0x80 }, { 0x20,0x28,0xa0,0xa8 }, /* ...0...0...1...0 */
- { 0x20,0x28,0xa0,0xa8 }, { 0xa0,0x80,0x20,0x00 }, /* ...0...0...1...1 */
- { 0xa8,0x28,0x88,0x08 }, { 0xa8,0x28,0x88,0x08 }, /* ...0...1...0...0 */
- { 0x08,0x88,0x00,0x80 }, { 0xa8,0x28,0x88,0x08 }, /* ...0...1...0...1 */
- { 0xa8,0x28,0x88,0x08 }, { 0x20,0x28,0xa0,0xa8 }, /* ...0...1...1...0 */
- { 0xa8,0x28,0x88,0x08 }, { 0xa8,0x28,0x88,0x08 }, /* ...0...1...1...1 */
- { 0x20,0x28,0xa0,0xa8 }, { 0x88,0xa8,0x80,0xa0 }, /* ...1...0...0...0 */
- { 0x88,0xa8,0x80,0xa0 }, { 0x20,0x28,0xa0,0xa8 }, /* ...1...0...0...1 */
- { 0x20,0x28,0xa0,0xa8 }, { 0xa0,0x80,0x20,0x00 }, /* ...1...0...1...0 */
- { 0x20,0x28,0xa0,0xa8 }, { 0x20,0x28,0xa0,0xa8 }, /* ...1...0...1...1 */
- { 0x20,0x00,0xa0,0x80 }, { 0x20,0x28,0xa0,0xa8 }, /* ...1...1...0...0 */
- { 0xa8,0x28,0x88,0x08 }, { 0xa0,0x80,0x20,0x00 }, /* ...1...1...0...1 */
- { 0x20,0x28,0xa0,0xa8 }, { 0x20,0x28,0xa0,0xa8 }, /* ...1...1...1...0 */
- { 0xa8,0x28,0x88,0x08 }, { 0xa8,0x28,0x88,0x08 } /* ...1...1...1...1 */
- };
-
-
- sega_decode(machine, cputag, convtable);
-}
-
-
-void bullfgtj_decode(running_machine &machine, const char *cputag)
-{
- static const UINT8 convtable[32][4] =
- {
- /* opcode data address */
- /* A B C D A B C D */
- { 0xa0,0xa8,0x20,0x28 }, { 0x80,0xa0,0x00,0x20 }, /* ...0...0...0...0 */
- { 0x20,0x28,0x00,0x08 }, { 0x20,0x28,0x00,0x08 }, /* ...0...0...0...1 */
- { 0xa0,0xa8,0x20,0x28 }, { 0x08,0x28,0x00,0x20 }, /* ...0...0...1...0 */
- { 0x88,0x08,0xa8,0x28 }, { 0x88,0x08,0xa8,0x28 }, /* ...0...0...1...1 */
- { 0xa0,0xa8,0x20,0x28 }, { 0x20,0x28,0x00,0x08 }, /* ...0...1...0...0 */
- { 0x28,0xa8,0x20,0xa0 }, { 0x20,0x28,0x00,0x08 }, /* ...0...1...0...1 */
- { 0xa0,0xa8,0x20,0x28 }, { 0x08,0x28,0x00,0x20 }, /* ...0...1...1...0 */
- { 0x88,0x08,0xa8,0x28 }, { 0x88,0x08,0xa8,0x28 }, /* ...0...1...1...1 */
- { 0x28,0xa8,0x20,0xa0 }, { 0xa0,0xa8,0x20,0x28 }, /* ...1...0...0...0 */
- { 0x88,0x08,0xa8,0x28 }, { 0x80,0xa0,0x00,0x20 }, /* ...1...0...0...1 */
- { 0x28,0xa8,0x20,0xa0 }, { 0x08,0x28,0x00,0x20 }, /* ...1...0...1...0 */
- { 0x28,0xa8,0x20,0xa0 }, { 0x80,0xa0,0x00,0x20 }, /* ...1...0...1...1 */
- { 0x20,0x28,0x00,0x08 }, { 0x20,0x28,0x00,0x08 }, /* ...1...1...0...0 */
- { 0x88,0x08,0xa8,0x28 }, { 0x20,0x28,0x00,0x08 }, /* ...1...1...0...1 */
- { 0x08,0x28,0x00,0x20 }, { 0x80,0xa0,0x00,0x20 }, /* ...1...1...1...0 */
- { 0x08,0x28,0x00,0x20 }, { 0x88,0x08,0xa8,0x28 } /* ...1...1...1...1 */
- };
-
-
- sega_decode(machine, cputag, convtable);
-}
-
-
-void pbaction_decode(running_machine &machine, const char *cputag)
-{
- static const UINT8 convtable[32][4] =
- {
- /* opcode data address */
- /* A B C D A B C D */
- { 0xa8,0xa0,0x88,0x80 }, { 0x28,0xa8,0x08,0x88 }, /* ...0...0...0...0 */
- { 0x28,0x08,0xa8,0x88 }, { 0xa8,0xa0,0x88,0x80 }, /* ...0...0...0...1 */
- { 0x28,0x20,0xa8,0xa0 }, { 0x28,0xa8,0x08,0x88 }, /* ...0...0...1...0 */
- { 0x28,0x08,0xa8,0x88 }, { 0x28,0x20,0xa8,0xa0 }, /* ...0...0...1...1 */
- { 0xa8,0xa0,0x88,0x80 }, { 0xa8,0xa0,0x88,0x80 }, /* ...0...1...0...0 */
- { 0x28,0x20,0xa8,0xa0 }, { 0x28,0x20,0xa8,0xa0 }, /* ...0...1...0...1 */
- { 0x28,0x20,0xa8,0xa0 }, { 0x28,0x20,0xa8,0xa0 }, /* ...0...1...1...0 */
- { 0xa8,0xa0,0x88,0x80 }, { 0x28,0x20,0xa8,0xa0 }, /* ...0...1...1...1 */
- { 0xa8,0xa0,0x88,0x80 }, { 0x28,0x20,0xa8,0xa0 }, /* ...1...0...0...0 */
- { 0x28,0x20,0xa8,0xa0 }, { 0xa8,0xa0,0x88,0x80 }, /* ...1...0...0...1 */
- { 0x28,0x20,0xa8,0xa0 }, { 0xa0,0x80,0xa8,0x88 }, /* ...1...0...1...0 */
- { 0x28,0x08,0xa8,0x88 }, { 0x28,0x08,0xa8,0x88 }, /* ...1...0...1...1 */
- { 0xa0,0x80,0xa8,0x88 }, { 0xa8,0xa0,0x88,0x80 }, /* ...1...1...0...0 */
- { 0x28,0x20,0xa8,0xa0 }, { 0xa8,0x28,0xa0,0x20 }, /* ...1...1...0...1 */
- { 0xa0,0x80,0xa8,0x88 }, { 0xa8,0xa0,0x88,0x80 }, /* ...1...1...1...0 */
- { 0xa8,0xa0,0x88,0x80 }, { 0xa8,0x28,0xa0,0x20 } /* ...1...1...1...1 */
- };
-
-
- sega_decode(machine, cputag, convtable);
-}
-
-
-void spatter_decode(running_machine &machine, const char *cputag)
-{
- static const UINT8 convtable[32][4] =
- {
- /* opcode data address */
- /* A B C D A B C D */
- { 0x88,0x08,0x80,0x00 }, { 0x00,0x08,0x20,0x28 }, /* ...0...0...0...0 */
- { 0x28,0xa8,0x08,0x88 }, { 0x28,0xa8,0x08,0x88 }, /* ...0...0...0...1 */
- { 0x28,0x20,0xa8,0xa0 }, { 0x28,0x20,0xa8,0xa0 }, /* ...0...0...1...0 */
- { 0x88,0x08,0x80,0x00 }, { 0x88,0x08,0x80,0x00 }, /* ...0...0...1...1 */
- { 0x00,0x08,0x20,0x28 }, { 0x88,0x08,0x80,0x00 }, /* ...0...1...0...0 */
- { 0xa0,0x80,0x20,0x00 }, { 0x80,0x88,0x00,0x08 }, /* ...0...1...0...1 */
- { 0x88,0x08,0x80,0x00 }, { 0xa0,0x80,0x20,0x00 }, /* ...0...1...1...0 */
- { 0x88,0x08,0x80,0x00 }, { 0x28,0x20,0xa8,0xa0 }, /* ...0...1...1...1 */
- { 0x28,0xa8,0x08,0x88 }, { 0x80,0x88,0x00,0x08 }, /* ...1...0...0...0 */
- { 0x80,0x88,0x00,0x08 }, { 0x00,0x08,0x20,0x28 }, /* ...1...0...0...1 */
- { 0x28,0x20,0xa8,0xa0 }, { 0x28,0xa8,0x08,0x88 }, /* ...1...0...1...0 */
- { 0x00,0x08,0x20,0x28 }, { 0x80,0xa0,0x88,0xa8 }, /* ...1...0...1...1 */
- { 0x80,0x88,0x00,0x08 }, { 0xa0,0x80,0x20,0x00 }, /* ...1...1...0...0 */
- { 0x80,0xa0,0x88,0xa8 }, { 0xa0,0x80,0x20,0x00 }, /* ...1...1...0...1 */
- { 0xa0,0x80,0x20,0x00 }, { 0x80,0xa0,0x88,0xa8 }, /* ...1...1...1...0 */
- { 0x28,0x20,0xa8,0xa0 }, { 0x00,0x08,0x20,0x28 } /* ...1...1...1...1 */
- };
-
-
- sega_decode(machine, cputag, convtable);
-}
-
-
-void jongkyo_decode(running_machine &machine, const char *cputag)
-{
- /* encrypted ROM is banked */
- UINT8 *decrypted;
-
- static const UINT8 convtable[32][4] =
- {
- /* opcode data address */
- /* A B C D A B C D */
- { 0x28,0x08,0xa8,0x88 }, { 0xa0,0xa8,0x20,0x28 }, /* ...0...0...0...0 */
- { 0x80,0x88,0xa0,0xa8 }, { 0xa0,0xa8,0x20,0x28 }, /* ...0...0...0...1 */
- { 0xa0,0xa8,0x20,0x28 }, { 0x20,0xa0,0x00,0x80 }, /* ...0...0...1...0 */
- { 0xa0,0xa8,0x20,0x28 }, { 0x80,0x88,0xa0,0xa8 }, /* ...0...0...1...1 */
- { 0x08,0x88,0x00,0x80 }, { 0x08,0x88,0x00,0x80 }, /* ...0...1...0...0 */
- { 0x88,0xa8,0x80,0xa0 }, { 0x08,0x88,0x00,0x80 }, /* ...0...1...0...1 */
- { 0x20,0xa0,0x00,0x80 }, { 0x20,0xa0,0x00,0x80 }, /* ...0...1...1...0 */
- { 0x08,0x88,0x00,0x80 }, { 0x08,0x88,0x00,0x80 }, /* ...0...1...1...1 */
- { 0x88,0xa8,0x80,0xa0 }, { 0xa0,0xa8,0x20,0x28 }, /* ...1...0...0...0 */
- { 0x80,0x88,0xa0,0xa8 }, { 0x80,0x88,0xa0,0xa8 }, /* ...1...0...0...1 */
- { 0xa0,0xa8,0x20,0x28 }, { 0x20,0xa0,0x00,0x80 }, /* ...1...0...1...0 */
- { 0xa0,0xa8,0x20,0x28 }, { 0x80,0x88,0xa0,0xa8 }, /* ...1...0...1...1 */
- { 0x08,0x88,0x00,0x80 }, { 0x28,0x08,0xa8,0x88 }, /* ...1...1...0...0 */
- { 0x08,0x88,0x00,0x80 }, { 0x80,0x88,0xa0,0xa8 }, /* ...1...1...0...1 */
- { 0x28,0x08,0xa8,0x88 }, { 0x20,0xa0,0x00,0x80 }, /* ...1...1...1...0 */
- { 0x80,0x88,0xa0,0xa8 }, { 0x08,0x88,0x00,0x80 } /* ...1...1...1...1 */
- };
-
- int A;
-
- address_space &space = machine.device(cputag)->memory().space(AS_PROGRAM);
- UINT8 *rom = machine.root_device().memregion(cputag)->base();
- decrypted = auto_alloc_array(machine, UINT8, 0x9000);
-
- for (A = 0x0000;A < 0x9000;A++)
- {
- int xorval = 0;
-
- UINT8 src = rom[A];
-
- /* pick the translation table from bits 0, 4, 8 and 12 of the address */
- int row = (A & 1) + (((A >> 4) & 1) << 1) + (((A >> 8) & 1) << 2) + (((A >> 12) & 1) << 3);
-
- /* pick the offset in the table from bits 3 and 5 of the source data */
- int col = ((src >> 3) & 1) + (((src >> 5) & 1) << 1);
- /* the bottom half of the translation table is the mirror image of the top */
- if (src & 0x80)
- {
- col = 3 - col;
- xorval = 0xa8;
- }
-
- /* special handling for banked area */
- if (A >= 0x7000)
- row = (A & 1) + (((A >> 4) & 1) << 1) + (((A >> 8) & 1) << 2);
-
- /* decode the opcodes */
- decrypted[A] = (src & ~0xa8) | (convtable[2*row][col] ^ xorval);
-
- /* decode the data */
- rom[A] = (src & ~0xa8) | (convtable[2*row+1][col] ^ xorval);
+ data[A] = 0xee;
}
-
- machine.root_device().membank("bank1")->configure_entries(0,8, machine.root_device().memregion(cputag)->base()+0x7000,0x0400);
- machine.root_device().membank("bank1")->configure_decrypted_entries(0,8,decrypted+0x7000,0x0400);
- space.set_decrypted_region(0x0000, 0x6bff, decrypted);
- machine.root_device().membank("bank1")->set_entry(0);
-}
-
-
-void pitfall2_decode(running_machine &machine, const char *cputag)
-{
- static const UINT8 convtable[32][4] =
- {
- /* opcode data address */
- /* A B C D A B C D */
- { 0xa0,0x80,0xa8,0x88 }, { 0xa0,0x80,0xa8,0x88 }, /* ...0...0...0...0 */
- { 0x08,0x88,0x28,0xa8 }, { 0x28,0xa8,0x20,0xa0 }, /* ...0...0...0...1 */
- { 0xa0,0x80,0xa8,0x88 }, { 0xa0,0x80,0xa8,0x88 }, /* ...0...0...1...0 */
- { 0xa0,0xa8,0x20,0x28 }, { 0xa0,0xa8,0x20,0x28 }, /* ...0...0...1...1 */
- { 0xa0,0x80,0xa8,0x88 }, { 0x20,0x00,0xa0,0x80 }, /* ...0...1...0...0 */
- { 0x28,0xa8,0x20,0xa0 }, { 0x20,0x00,0xa0,0x80 }, /* ...0...1...0...1 */
- { 0xa0,0xa8,0x20,0x28 }, { 0xa0,0xa8,0x20,0x28 }, /* ...0...1...1...0 */
- { 0x28,0xa8,0x20,0xa0 }, { 0xa0,0xa8,0x20,0x28 }, /* ...0...1...1...1 */
- { 0x20,0x00,0xa0,0x80 }, { 0x80,0x88,0xa0,0xa8 }, /* ...1...0...0...0 */
- { 0x80,0x88,0xa0,0xa8 }, { 0x80,0x88,0xa0,0xa8 }, /* ...1...0...0...1 */
- { 0xa0,0xa8,0x20,0x28 }, { 0xa0,0x80,0xa8,0x88 }, /* ...1...0...1...0 */
- { 0x80,0x88,0xa0,0xa8 }, { 0x28,0xa8,0x20,0xa0 }, /* ...1...0...1...1 */
- { 0x20,0x00,0xa0,0x80 }, { 0x80,0x88,0xa0,0xa8 }, /* ...1...1...0...0 */
- { 0x80,0x88,0xa0,0xa8 }, { 0x20,0x00,0xa0,0x80 }, /* ...1...1...0...1 */
- { 0xa0,0xa8,0x20,0x28 }, { 0xa0,0x80,0xa8,0x88 }, /* ...1...1...1...0 */
- { 0x80,0x88,0xa0,0xa8 }, { 0x28,0xa8,0x20,0xa0 } /* ...1...1...1...1 */
- };
-
-
- sega_decode(machine, cputag, convtable);
-}
-
-
-void nprinces_decode(running_machine &machine, const char *cputag)
-{
- static const UINT8 convtable[32][4] =
- {
- /* opcode data address */
- /* A B C D A B C D */
- { 0x08,0x88,0x00,0x80 }, { 0xa0,0x20,0x80,0x00 }, /* ...0...0...0...0 */
- { 0xa8,0xa0,0x28,0x20 }, { 0x88,0xa8,0x80,0xa0 }, /* ...0...0...0...1 */
- { 0x88,0x80,0x08,0x00 }, { 0x28,0x08,0xa8,0x88 }, /* ...0...0...1...0 */
- { 0x88,0xa8,0x80,0xa0 }, { 0x28,0x08,0xa8,0x88 }, /* ...0...0...1...1 */
- { 0x88,0xa8,0x80,0xa0 }, { 0xa0,0x20,0x80,0x00 }, /* ...0...1...0...0 */
- { 0xa8,0xa0,0x28,0x20 }, { 0xa8,0xa0,0x28,0x20 }, /* ...0...1...0...1 */
- { 0x88,0x80,0x08,0x00 }, { 0x88,0xa8,0x80,0xa0 }, /* ...0...1...1...0 */
- { 0x88,0xa8,0x80,0xa0 }, { 0x88,0xa8,0x80,0xa0 }, /* ...0...1...1...1 */
- { 0xa0,0x20,0x80,0x00 }, { 0xa0,0x20,0x80,0x00 }, /* ...1...0...0...0 */
- { 0x08,0x88,0x00,0x80 }, { 0x28,0x08,0xa8,0x88 }, /* ...1...0...0...1 */
- { 0x88,0xa8,0x80,0xa0 }, { 0x88,0x80,0x08,0x00 }, /* ...1...0...1...0 */
- { 0x88,0xa8,0x80,0xa0 }, { 0x28,0x08,0xa8,0x88 }, /* ...1...0...1...1 */
- { 0x88,0xa8,0x80,0xa0 }, { 0x88,0xa8,0x80,0xa0 }, /* ...1...1...0...0 */
- { 0x88,0xa8,0x80,0xa0 }, { 0x88,0xa8,0x80,0xa0 }, /* ...1...1...0...1 */
- { 0x88,0x80,0x08,0x00 }, { 0x88,0x80,0x08,0x00 }, /* ...1...1...1...0 */
- { 0x08,0x88,0x00,0x80 }, { 0x28,0x08,0xa8,0x88 } /* ...1...1...1...1 */
- };
-
-
- sega_decode(machine, cputag, convtable);
-}
-
-
-void seganinj_decode(running_machine &machine, const char *cputag)
-{
- static const UINT8 convtable[32][4] =
- {
- /* opcode data address */
- /* A B C D A B C D */
- { 0x88,0xa8,0x80,0xa0 }, { 0x88,0x08,0x80,0x00 }, /* ...0...0...0...0 */
- { 0x28,0xa8,0x08,0x88 }, { 0xa0,0xa8,0x80,0x88 }, /* ...0...0...0...1 */
- { 0xa8,0xa0,0x28,0x20 }, { 0xa8,0xa0,0x28,0x20 }, /* ...0...0...1...0 */
- { 0x28,0xa8,0x08,0x88 }, { 0xa0,0xa8,0x80,0x88 }, /* ...0...0...1...1 */
- { 0x28,0x08,0xa8,0x88 }, { 0x28,0x08,0xa8,0x88 }, /* ...0...1...0...0 */
- { 0x28,0xa8,0x08,0x88 }, { 0x88,0x08,0x80,0x00 }, /* ...0...1...0...1 */
- { 0x28,0x08,0xa8,0x88 }, { 0x28,0x08,0xa8,0x88 }, /* ...0...1...1...0 */
- { 0x28,0xa8,0x08,0x88 }, { 0xa8,0xa0,0x28,0x20 }, /* ...0...1...1...1 */
- { 0x88,0x08,0x80,0x00 }, { 0x88,0xa8,0x80,0xa0 }, /* ...1...0...0...0 */
- { 0xa0,0xa8,0x80,0x88 }, { 0x28,0xa8,0x08,0x88 }, /* ...1...0...0...1 */
- { 0xa8,0xa0,0x28,0x20 }, { 0x88,0xa8,0x80,0xa0 }, /* ...1...0...1...0 */
- { 0xa8,0xa0,0x28,0x20 }, { 0x28,0xa8,0x08,0x88 }, /* ...1...0...1...1 */
- { 0x28,0x08,0xa8,0x88 }, { 0x88,0xa8,0x80,0xa0 }, /* ...1...1...0...0 */
- { 0x28,0x08,0xa8,0x88 }, { 0x28,0x08,0xa8,0x88 }, /* ...1...1...0...1 */
- { 0x88,0xa8,0x80,0xa0 }, { 0x88,0xa8,0x80,0xa0 }, /* ...1...1...1...0 */
- { 0xa8,0xa0,0x28,0x20 }, { 0x28,0x08,0xa8,0x88 } /* ...1...1...1...1 */
- };
-
-
- sega_decode(machine, cputag, convtable);
-}
-
-
-void imsorry_decode(running_machine &machine, const char *cputag)
-{
- static const UINT8 convtable[32][4] =
- {
- /* opcode data address */
- /* A B C D A B C D */
- { 0x88,0x08,0x80,0x00 }, { 0x00,0x20,0x80,0xa0 }, /* ...0...0...0...0 */
- { 0x00,0x20,0x80,0xa0 }, { 0x88,0x08,0x80,0x00 }, /* ...0...0...0...1 */
- { 0x88,0x08,0xa8,0x28 }, { 0x00,0x20,0x80,0xa0 }, /* ...0...0...1...0 */
- { 0x00,0x20,0x80,0xa0 }, { 0x88,0x08,0xa8,0x28 }, /* ...0...0...1...1 */
- { 0x00,0x20,0x80,0xa0 }, { 0x08,0x00,0x88,0x80 }, /* ...0...1...0...0 */
- { 0x00,0x20,0x80,0xa0 }, { 0x20,0x28,0xa0,0xa8 }, /* ...0...1...0...1 */
- { 0x20,0x28,0xa0,0xa8 }, { 0x00,0x20,0x80,0xa0 }, /* ...0...1...1...0 */
- { 0x20,0x28,0xa0,0xa8 }, { 0x88,0x08,0xa8,0x28 }, /* ...0...1...1...1 */
- { 0x88,0x08,0x80,0x00 }, { 0x08,0x00,0x88,0x80 }, /* ...1...0...0...0 */
- { 0x08,0x00,0x88,0x80 }, { 0x88,0x08,0x80,0x00 }, /* ...1...0...0...1 */
- { 0x08,0x28,0x00,0x20 }, { 0x08,0x28,0x00,0x20 }, /* ...1...0...1...0 */
- { 0x88,0x08,0x80,0x00 }, { 0x08,0x28,0x00,0x20 }, /* ...1...0...1...1 */
- { 0x08,0x28,0x00,0x20 }, { 0x08,0x00,0x88,0x80 }, /* ...1...1...0...0 */
- { 0x08,0x28,0x00,0x20 }, { 0x20,0x28,0xa0,0xa8 }, /* ...1...1...0...1 */
- { 0x20,0x28,0xa0,0xa8 }, { 0x08,0x28,0x00,0x20 }, /* ...1...1...1...0 */
- { 0x20,0x28,0xa0,0xa8 }, { 0x08,0x28,0x00,0x20 } /* ...1...1...1...1 */
- };
-
-
- sega_decode(machine, cputag, convtable);
-}
-
-
-void teddybb_decode(running_machine &machine, const char *cputag)
-{
- static const UINT8 convtable[32][4] =
- {
- /* opcode data address */
- /* A B C D A B C D */
- { 0x20,0x28,0x00,0x08 }, { 0x80,0x00,0xa0,0x20 }, /* ...0...0...0...0 */
- { 0x20,0x28,0x00,0x08 }, { 0xa0,0xa8,0x20,0x28 }, /* ...0...0...0...1 */
- { 0x28,0x08,0xa8,0x88 }, { 0xa0,0x80,0xa8,0x88 }, /* ...0...0...1...0 */
- { 0xa0,0xa8,0x20,0x28 }, { 0xa0,0x80,0xa8,0x88 }, /* ...0...0...1...1 */
- { 0x20,0x28,0x00,0x08 }, { 0x28,0x08,0xa8,0x88 }, /* ...0...1...0...0 */
- { 0xa0,0xa8,0x20,0x28 }, { 0xa0,0xa8,0x20,0x28 }, /* ...0...1...0...1 */
- { 0xa0,0x80,0xa8,0x88 }, { 0x28,0x08,0xa8,0x88 }, /* ...0...1...1...0 */
- { 0xa0,0xa8,0x20,0x28 }, { 0x28,0x08,0xa8,0x88 }, /* ...0...1...1...1 */
- { 0x80,0x00,0xa0,0x20 }, { 0x80,0x00,0xa0,0x20 }, /* ...1...0...0...0 */
- { 0xa0,0x20,0xa8,0x28 }, { 0xa0,0xa8,0x20,0x28 }, /* ...1...0...0...1 */
- { 0xa0,0x20,0xa8,0x28 }, { 0xa0,0x80,0xa8,0x88 }, /* ...1...0...1...0 */
- { 0xa0,0x80,0xa8,0x88 }, { 0xa0,0x80,0xa8,0x88 }, /* ...1...0...1...1 */
- { 0x80,0x00,0xa0,0x20 }, { 0x20,0x28,0x00,0x08 }, /* ...1...1...0...0 */
- { 0xa0,0xa8,0x20,0x28 }, { 0xa0,0x20,0xa8,0x28 }, /* ...1...1...0...1 */
- { 0x80,0x00,0xa0,0x20 }, { 0xa0,0x80,0xa8,0x88 }, /* ...1...1...1...0 */
- { 0xa0,0xa8,0x20,0x28 }, { 0xa0,0x20,0xa8,0x28 } /* ...1...1...1...1 */
- };
-
-
- sega_decode(machine, cputag, convtable);
-}
-
-
-void myheroj_decode(running_machine &machine, const char *cputag)
-{
- static const UINT8 convtable[32][4] =
- {
- /* opcode data address */
- /* A B C D A B C D */
- { 0x20,0x00,0xa0,0x80 }, { 0x80,0xa0,0x88,0xa8 }, /* ...0...0...0...0 */
- { 0x20,0x00,0xa0,0x80 }, { 0x80,0xa0,0x88,0xa8 }, /* ...0...0...0...1 */
- { 0xa8,0xa0,0x88,0x80 }, { 0xa8,0xa0,0x88,0x80 }, /* ...0...0...1...0 */
- { 0x08,0x88,0x00,0x80 }, { 0x80,0xa0,0x88,0xa8 }, /* ...0...0...1...1 */
- { 0x20,0x00,0xa0,0x80 }, { 0x28,0xa8,0x08,0x88 }, /* ...0...1...0...0 */
- { 0x20,0x00,0xa0,0x80 }, { 0x08,0x88,0x00,0x80 }, /* ...0...1...0...1 */
- { 0x28,0xa8,0x08,0x88 }, { 0xa8,0xa0,0x88,0x80 }, /* ...0...1...1...0 */
- { 0x08,0x88,0x00,0x80 }, { 0xa8,0xa0,0x88,0x80 }, /* ...0...1...1...1 */
- { 0x28,0xa8,0x08,0x88 }, { 0x20,0x00,0xa0,0x80 }, /* ...1...0...0...0 */
- { 0x80,0xa0,0x88,0xa8 }, { 0x20,0x00,0xa0,0x80 }, /* ...1...0...0...1 */
- { 0x80,0xa0,0x88,0xa8 }, { 0x80,0xa0,0x88,0xa8 }, /* ...1...0...1...0 */
- { 0xa8,0xa0,0x88,0x80 }, { 0x80,0xa0,0x88,0xa8 }, /* ...1...0...1...1 */
- { 0x88,0x80,0x08,0x00 }, { 0x88,0x80,0x08,0x00 }, /* ...1...1...0...0 */
- { 0x88,0x80,0x08,0x00 }, { 0x08,0x88,0x00,0x80 }, /* ...1...1...0...1 */
- { 0x88,0x80,0x08,0x00 }, { 0xa8,0xa0,0x88,0x80 }, /* ...1...1...1...0 */
- { 0x88,0x80,0x08,0x00 }, { 0xa8,0xa0,0x88,0x80 } /* ...1...1...1...1 */
- };
-
-
- sega_decode(machine, cputag, convtable);
-}
-
-
-void hvymetal_decode(running_machine &machine, const char *cputag)
-{
- static const UINT8 convtable[32][4] =
- {
- /* opcode data address */
- /* A B C D A B C D */
- { 0x88,0xa8,0x80,0xa0 }, { 0xa0,0x80,0xa8,0x88 }, /* ...0...0...0...0 */
- { 0x88,0xa8,0x80,0xa0 }, { 0x88,0x80,0x08,0x00 }, /* ...0...0...0...1 */
- { 0xa0,0x80,0xa8,0x88 }, { 0x88,0xa8,0x80,0xa0 }, /* ...0...0...1...0 */
- { 0x88,0xa8,0x80,0xa0 }, { 0x88,0x80,0x08,0x00 }, /* ...0...0...1...1 */
- { 0xa0,0x80,0xa8,0x88 }, { 0x88,0x80,0x08,0x00 }, /* ...0...1...0...0 */
- { 0x88,0x80,0x08,0x00 }, { 0x88,0x80,0x08,0x00 }, /* ...0...1...0...1 */
- { 0xa0,0x80,0xa8,0x88 }, { 0x88,0x80,0x08,0x00 }, /* ...0...1...1...0 */
- { 0x88,0x80,0x08,0x00 }, { 0x28,0x08,0xa8,0x88 }, /* ...0...1...1...1 */
- { 0xa0,0x20,0xa8,0x28 }, { 0x88,0xa8,0x80,0xa0 }, /* ...1...0...0...0 */
- { 0xa0,0x20,0xa8,0x28 }, { 0x88,0xa8,0x80,0xa0 }, /* ...1...0...0...1 */
- { 0xa0,0x20,0xa8,0x28 }, { 0x88,0xa8,0x80,0xa0 }, /* ...1...0...1...0 */
- { 0x88,0xa8,0x80,0xa0 }, { 0x28,0x08,0xa8,0x88 }, /* ...1...0...1...1 */
- { 0x28,0xa8,0x08,0x88 }, { 0xa0,0x20,0xa8,0x28 }, /* ...1...1...0...0 */
- { 0xa0,0x20,0xa8,0x28 }, { 0x28,0xa8,0x08,0x88 }, /* ...1...1...0...1 */
- { 0x28,0xa8,0x08,0x88 }, { 0xa0,0x20,0xa8,0x28 }, /* ...1...1...1...0 */
- { 0x28,0x08,0xa8,0x88 }, { 0x28,0xa8,0x08,0x88 } /* ...1...1...1...1 */
- };
-
-
- sega_decode(machine, cputag, convtable);
-}
-
-
-void lvcards_decode(running_machine &machine, const char *cputag)
-{
- static const UINT8 convtable[32][4] =
- {
- /* opcode data address */
- /* A B C D A B C D */
- { 0xa8,0x88,0xa0,0x80 }, { 0xa8,0x28,0x88,0x08 }, /* ...0...0...0...0 */
- { 0xa8,0x28,0x88,0x08 }, { 0xa8,0x28,0x88,0x08 }, /* ...0...0...0...1 */
- { 0xa0,0x80,0x20,0x00 }, { 0xa0,0x80,0x20,0x00 }, /* ...0...0...1...0 */
- { 0xa8,0xa0,0x88,0x80 }, { 0xa8,0xa0,0x88,0x80 }, /* ...0...0...1...1 */
- { 0xa8,0x28,0x88,0x08 }, { 0xa8,0x28,0xa0,0x20 }, /* ...0...1...0...0 */
- { 0xa8,0x28,0x88,0x08 }, { 0xa8,0x28,0x88,0x08 }, /* ...0...1...0...1 */
- { 0xa0,0x80,0x20,0x00 }, { 0xa0,0x80,0x20,0x00 }, /* ...0...1...1...0 */
- { 0xa8,0x88,0xa0,0x80 }, { 0xa8,0x88,0xa0,0x80 }, /* ...0...1...1...1 */
- { 0xa8,0x88,0xa0,0x80 }, { 0xa8,0x28,0x88,0x08 }, /* ...1...0...0...0 */
- { 0x88,0x80,0x08,0x00 }, { 0x88,0x80,0x08,0x00 }, /* ...1...0...0...1 */
- { 0xa8,0x28,0x88,0x08 }, { 0x88,0x80,0x08,0x00 }, /* ...1...0...1...0 */
- { 0xa8,0x28,0x88,0x08 }, { 0xa8,0x28,0x88,0x08 }, /* ...1...0...1...1 */
- { 0xa8,0x28,0x88,0x08 }, { 0xa8,0x88,0xa0,0x80 }, /* ...1...1...0...0 */
- { 0xa8,0x88,0xa0,0x80 }, { 0x88,0x80,0x08,0x00 }, /* ...1...1...0...1 */
- { 0x88,0x80,0x08,0x00 }, { 0xa8,0x28,0x88,0x08 }, /* ...1...1...1...0 */
- { 0xa8,0x28,0x88,0x08 }, { 0xa8,0x88,0xa0,0x80 } /* ...1...1...1...1 */
- };
-
-
- sega_decode(machine, cputag, convtable);
}
diff --git a/src/mame/machine/segacrpt.h b/src/mame/machine/segacrpt.h
index c0d42bad383..ba6fc16ca72 100644
--- a/src/mame/machine/segacrpt.h
+++ b/src/mame/machine/segacrpt.h
@@ -1,27 +1,4 @@
// license:BSD-3-Clause
// copyright-holders:Nicola Salmoria
-void buckrog_decode(running_machine &machine, const char *cputag);
-void pengo_decode(running_machine &machine, const char *cputag);
-void szaxxon_decode(running_machine &machine, const char *cputag);
-void suprloco_decode(running_machine &machine, const char *cputag);
-void yamato_decode(running_machine &machine, const char *cputag);
-void toprollr_decode(running_machine &machine, const char *cputag, const char *regiontag);
-void sindbadm_decode(running_machine &machine, const char *cputag);
-void regulus_decode(running_machine &machine, const char *cputag);
-void mrviking_decode(running_machine &machine, const char *cputag);
-void swat_decode(running_machine &machine, const char *cputag);
-void flicky_decode(running_machine &machine, const char *cputag);
-void futspy_decode(running_machine &machine, const char *cputag);
-void wmatch_decode(running_machine &machine, const char *cputag);
-void bullfgtj_decode(running_machine &machine, const char *cputag);
-void pbaction_decode(running_machine &machine, const char *cputag);
-void spatter_decode(running_machine &machine, const char *cputag);
-void jongkyo_decode(running_machine &machine, const char *cputag);
-void pitfall2_decode(running_machine &machine, const char *cputag);
-void nprinces_decode(running_machine &machine, const char *cputag);
-void seganinj_decode(running_machine &machine, const char *cputag);
-void imsorry_decode(running_machine &machine, const char *cputag);
-void teddybb_decode(running_machine &machine, const char *cputag);
-void myheroj_decode(running_machine &machine, const char *cputag);
-void hvymetal_decode(running_machine &machine, const char *cputag);
-void lvcards_decode(running_machine &machine, const char *cputag);
+
+void sega_decode(UINT8 *data, UINT8 *opcodes, int size, const UINT8 convtable[32][4], int bank_count = 0, int bank_size = 0);
diff --git a/src/mame/machine/segaic16.c b/src/mame/machine/segaic16.c
index 5976fbc1be8..19ab5ef6906 100644
--- a/src/mame/machine/segaic16.c
+++ b/src/mame/machine/segaic16.c
@@ -179,6 +179,7 @@ sega_315_5195_mapper_device::sega_315_5195_mapper_device(const machine_config &m
m_cputag(NULL),
m_cpu(NULL),
m_space(NULL),
+ m_decrypted_space(NULL),
m_curregion(0)
{
}
@@ -354,7 +355,7 @@ READ8_MEMBER( sega_315_5195_mapper_device::read )
// map_as_rom - map a region as ROM data
//-------------------------------------------------
-void sega_315_5195_mapper_device::map_as_rom(UINT32 offset, UINT32 length, offs_t mirror, const char *bank_name, offs_t rgnoffset, write16_delegate whandler)
+void sega_315_5195_mapper_device::map_as_rom(UINT32 offset, UINT32 length, offs_t mirror, const char *bank_name, const char *decrypted_bank_name, offs_t rgnoffset, write16_delegate whandler)
{
// determine parameters
region_info info;
@@ -377,14 +378,17 @@ void sega_315_5195_mapper_device::map_as_rom(UINT32 offset, UINT32 length, offs_
// map now
m_space->install_read_bank(info.start, romend, 0, info.mirror, bank_name);
+ if (m_decrypted_space)
+ m_decrypted_space->install_read_bank(info.start, romend, 0, info.mirror, decrypted_bank_name);
// configure the bank
memory_bank *bank = owner()->membank(bank_name);
+ memory_bank *decrypted_bank = owner()->membank(decrypted_bank_name);
UINT8 *memptr = m_cpu->region()->base() + rgnoffset;
bank->set_base(memptr);
// remember this bank, and decrypt if necessary
- m_banks[m_curregion].set(bank, info.start, romend, rgnoffset, memptr);
+ m_banks[m_curregion].set(bank, decrypted_bank, info.start, romend, rgnoffset, memptr);
}
// either install a write handler if provided or unmap the region
@@ -524,6 +528,8 @@ void sega_315_5195_mapper_device::device_start()
if (m_space == NULL)
throw emu_fatalerror("Unable to find program address space on device '%s'", m_cputag);
+ m_decrypted_space = m_cpu->has_space(AS_DECRYPTED_OPCODES) ? &m_cpu->space(AS_DECRYPTED_OPCODES) : NULL;
+
// register for saves
save_item(NAME(m_regs));
}
@@ -597,6 +603,7 @@ void sega_315_5195_mapper_device::update_mapping()
sega_315_5195_mapper_device::decrypt_bank::decrypt_bank()
: m_bank(NULL),
+ m_decrypted_bank(NULL),
m_start(0),
m_end(0),
m_rgnoffs(~0),
@@ -647,7 +654,7 @@ void sega_315_5195_mapper_device::decrypt_bank::set_decrypt(fd1094_device *fd109
// a change
//-------------------------------------------------
-void sega_315_5195_mapper_device::decrypt_bank::set(memory_bank *bank, offs_t start, offs_t end, offs_t rgnoffs, UINT8 *src)
+void sega_315_5195_mapper_device::decrypt_bank::set(memory_bank *bank, memory_bank *decrypted_bank, offs_t start, offs_t end, offs_t rgnoffs, UINT8 *src)
{
// ignore if not encrypted
if (m_fd1089 == NULL && m_fd1094_cache == NULL)
@@ -662,6 +669,7 @@ void sega_315_5195_mapper_device::decrypt_bank::set(memory_bank *bank, offs_t st
// update to the current state
m_bank = bank;
+ m_decrypted_bank = decrypted_bank;
m_start = start;
m_end = end;
m_rgnoffs = rgnoffs;
@@ -692,12 +700,12 @@ void sega_315_5195_mapper_device::decrypt_bank::update()
{
m_fd1089_decrypted.resize((m_end + 1 - m_start) / 2);
m_fd1089->decrypt(m_start, m_end + 1 - m_start, m_rgnoffs, &m_fd1089_decrypted[0], reinterpret_cast<UINT16 *>(m_srcptr));
- m_bank->set_base_decrypted(&m_fd1089_decrypted[0]);
+ m_decrypted_bank->set_base(&m_fd1089_decrypted[0]);
}
// fd1094 case
if (m_fd1094_cache != NULL)
- m_bank->set_base_decrypted(m_fd1094_cache->decrypted_opcodes(m_fd1094_cache->fd1094().state()));
+ m_decrypted_bank->set_base(m_fd1094_cache->decrypted_opcodes(m_fd1094_cache->fd1094().state()));
}
diff --git a/src/mame/machine/segaic16.h b/src/mame/machine/segaic16.h
index 4472e24d3db..58d772975a3 100644
--- a/src/mame/machine/segaic16.h
+++ b/src/mame/machine/segaic16.h
@@ -101,7 +101,7 @@ public:
DECLARE_WRITE8_MEMBER( write );
// mapping helpers
- void map_as_rom(UINT32 offset, UINT32 length, offs_t mirror, const char *bank_name, offs_t rgnoffset, write16_delegate whandler);
+ void map_as_rom(UINT32 offset, UINT32 length, offs_t mirror, const char *bank_name, const char *decrypted_bank_name, offs_t rgnoffset, write16_delegate whandler);
void map_as_ram(UINT32 offset, UINT32 length, offs_t mirror, const char *bank_share_name, write16_delegate whandler);
void map_as_handler(UINT32 offset, UINT32 length, offs_t mirror, read16_delegate rhandler, write16_delegate whandler);
@@ -135,8 +135,8 @@ private:
// configuration
void set_decrypt(fd1089_base_device *fd1089);
void set_decrypt(fd1094_device *fd1094);
- void clear() { set(NULL, 0, 0, ~0, NULL); }
- void set(memory_bank *bank, offs_t start, offs_t end, offs_t rgnoffs, UINT8 *src);
+ void clear() { set(NULL, NULL, 0, 0, ~0, NULL); }
+ void set(memory_bank *bank, memory_bank *decrypted_bank, offs_t start, offs_t end, offs_t rgnoffs, UINT8 *src);
// updating
void update();
@@ -145,6 +145,7 @@ private:
private:
// internal state
memory_bank * m_bank;
+ memory_bank * m_decrypted_bank;
offs_t m_start;
offs_t m_end;
offs_t m_rgnoffs;
@@ -168,6 +169,7 @@ private:
// internal state
m68000_device * m_cpu;
address_space * m_space;
+ address_space * m_decrypted_space;
UINT8 m_regs[0x20];
UINT8 m_curregion;
decrypt_bank m_banks[8];
diff --git a/src/mame/machine/slapstic.c b/src/mame/machine/slapstic.c
index 60f6a26233d..5adf0c91d7f 100644
--- a/src/mame/machine/slapstic.c
+++ b/src/mame/machine/slapstic.c
@@ -821,7 +821,7 @@ int atari_slapstic_device::alt2_kludge(address_space &space, offs_t offset)
if (MATCHES_MASK_VALUE(space.device().safe_pc() >> 1, slapstic.alt1))
{
/* now look for a move.w (An),(An) or cmpm.w (An)+,(An)+ */
- UINT16 opcode = space.direct().read_decrypted_word(space.device().safe_pcbase() & 0xffffff);
+ UINT16 opcode = space.direct().read_word(space.device().safe_pcbase() & 0xffffff);
if ((opcode & 0xf1f8) == 0x3090 || (opcode & 0xf1f8) == 0xb148)
{
/* fetch the value of the register for the second operand, and see */
diff --git a/src/mame/machine/slikshot.c b/src/mame/machine/slikshot.c
index 9730571258f..5edf4f56311 100644
--- a/src/mame/machine/slikshot.c
+++ b/src/mame/machine/slikshot.c
@@ -509,7 +509,7 @@ TIMER_CALLBACK_MEMBER( itech8_state::delayed_z80_control_w )
WRITE8_MEMBER(itech8_state::slikshot_z80_control_w )
{
- machine().scheduler().synchronize(timer_expired_delegate(FUNC(itech8_state::delayed_z80_control_w),this), data);
+ synchronize(TIMER_DELAYED_Z80_CONTROL, data);
}
@@ -543,7 +543,7 @@ UINT32 itech8_state::screen_update_slikshot(screen_device &screen, bitmap_rgb32
int temp, i;
/* draw the normal video first */
- screen_update_itech8_2page(screen, bitmap, cliprect);
+ screen_update_2page(screen, bitmap, cliprect);
/* add the current X,Y positions to the list */
m_xbuffer[m_ybuffer_next % YBUFFER_COUNT] = ioport("FAKEX")->read_safe(0);
diff --git a/src/mame/machine/stfight.c b/src/mame/machine/stfight.c
index ff6e07476a5..f0aba6a01c3 100644
--- a/src/mame/machine/stfight.c
+++ b/src/mame/machine/stfight.c
@@ -39,18 +39,14 @@ Encryption PAL 16R4 on CPU board
DRIVER_INIT_MEMBER(stfight_state,empcity)
{
- address_space &space = m_maincpu->space(AS_PROGRAM);
UINT8 *rom = memregion("maincpu")->base();
- m_decrypt = auto_alloc_array(machine(), UINT8, 0x8000);
- space.set_decrypted_region(0x0000, 0x7fff, m_decrypt);
-
for (UINT32 A = 0; A < 0x8000; ++A)
{
UINT8 src = rom[A];
// decode opcode
- m_decrypt[A] =
+ m_decrypted_opcodes[A] =
( src & 0xA6 ) |
( ( ( ( src << 2 ) ^ src ) << 3 ) & 0x40 ) |
( ~( ( src ^ ( A >> 1 ) ) >> 2 ) & 0x10 ) |
diff --git a/src/mame/machine/tx1.c b/src/mame/machine/tx1.c
index 0760fa17bc9..4442622ee34 100644
--- a/src/mame/machine/tx1.c
+++ b/src/mame/machine/tx1.c
@@ -138,8 +138,8 @@ static void sn_divide(running_machine &machine)
if (SN74S516.X == 0)
{
osd_printf_debug("%s:SN74S516 tried to divide by zero\n", machine.describe_context());
- SN74S516.ZW.Z = (INT16)0xffff;
- SN74S516.ZW.W = 0xffff;
+ SN74S516.ZW.as16bit.Z = (INT16)0xffff;
+ SN74S516.ZW.as16bit.W = 0xffff;
SN74S516.ZWfl = 0;
return;
}
@@ -160,8 +160,8 @@ static void sn_divide(running_machine &machine)
}
case 0x6664:
{
- Z = SN74S516.ZW.W / SN74S516.X;
- W = SN74S516.ZW.W % SN74S516.X;
+ Z = SN74S516.ZW.as16bit.W / SN74S516.X;
+ W = SN74S516.ZW.as16bit.W % SN74S516.X;
break;
}
default:
@@ -174,8 +174,8 @@ static void sn_divide(running_machine &machine)
if (Z > 0xffff)
Z |= 0xff00;
- SN74S516.ZW.Z = Z;
- SN74S516.ZW.W = W;
+ SN74S516.ZW.as16bit.Z = Z;
+ SN74S516.ZW.as16bit.W = W;
SN74S516.ZWfl = 0;
}
@@ -205,9 +205,9 @@ static void kick_sn74s516(running_machine &machine, UINT16 *data, const int ins)
#define LOAD_X (SN74S516.X = *data)
#define LOAD_Y (SN74S516.Y = *data)
-#define LOAD_Z (SN74S516.ZW.Z = *data)
-#define LOAD_W (SN74S516.ZW.W = *data)
-#define READ_ZW *data = SN74S516.ZWfl ? SN74S516.ZW.W : SN74S516.ZW.Z; \
+#define LOAD_Z (SN74S516.ZW.as16bit.Z = *data)
+#define LOAD_W (SN74S516.ZW.as16bit.W = *data)
+#define READ_ZW *data = SN74S516.ZWfl ? SN74S516.ZW.as16bit.W : SN74S516.ZW.as16bit.Z; \
SN74S516.ZWfl ^= 1;
#define UPDATE_SEQUENCE (SN74S516.code = (SN74S516.code << 4) | ins)
@@ -359,7 +359,7 @@ static void kick_sn74s516(running_machine &machine, UINT16 *data, const int ins)
else if (ins == 7)
{
/* 6667 = Load X, Load Z, Load W, Clear Z */
- SN74S516.ZW.Z = 0;
+ SN74S516.ZW.as16bit.Z = 0;
sn74s516_update(machine, ins);
}
break;
@@ -955,7 +955,7 @@ enum
BB_MUX_DPROE,
BB_MUX_PPOE,
BB_MUX_INSCL,
- BB_MUX_ILDEN,
+ BB_MUX_ILDEN
};
#define BB_SET_INS0_BIT do { if (!(ins & 0x4) && math.i0ff) ins |= math.i0ff;} while(0)
diff --git a/src/mame/mess.lst b/src/mame/mess.lst
index f3250b67668..d66b03e9bd9 100644
--- a/src/mame/mess.lst
+++ b/src/mame/mess.lst
@@ -180,13 +180,14 @@ ai1000 // Casio AI-1000
cfx9850 // Casio CFX-9850
// Coleco
-coleco // ColecoVision (Original BIOS)
-colecop // Colecovision PAL (Italy)
+coleco // ColecoVision (Original BIOS)
+colecop // Colecovision PAL (Italy)
svi603 // Spectravideo SVI-603 Coleco Game Adapter
czz50 // Bit Corporation Chuang Zao Zhe 50
-dina // Telegames Dina
-prsarcde // Telegames Personal Arcade
-adam // Coleco Adam
+dina // Telegames Dina
+prsarcde // Telegames Personal Arcade
+adam // Coleco Adam
+onyx // Microdigital ONYX (Brazilian Coleco clone / unreleased prototype)
// NEC
pce // PC/Engine NEC 1987-1993
@@ -282,6 +283,9 @@ odyssey3 // Magnavox Odyssey 3 / Command Center (prototype)
// Makerbot
replica1 // Makerbot Replicator 1 desktop 3d printer
+// Metamaquina
+metamaq2 // Metamaquina 2 desktop 3d printer
+
// Hartung, Watara, ...
gmaster // Hartung Gamemaster
@@ -423,8 +427,12 @@ dsp5500 // Apollo Server DSP5500 (1991)
apple1 // Jul 1976 Apple 1
apple2 // Apr 1977 Apple ][
apple2p // Jun 1979 Apple ][+
+elppa // 198? Victor do Brasil Elppa II+
+maxxi // 1982 Polymax Maxxi
prav82 // Pravetz 82
prav8m // Pravetz 8M
+uniap2en // 1982 Unitron AP II (in English)
+uniap2pt // 1982 Unitron AP II (in Brazilian Portuguese)
apple2jp // ??? ???? Apple ][j+
apple2e // Jan 1983 Apple //e
apple2euk // Jan 1983 Apple //e (UK)
@@ -735,7 +743,6 @@ europc // 1988 Schneider Euro PC (CGA or Hercules)
compc1 // 1984 Commodore PC-1
pc10iii // 1987 Commodore PC-10 III
pc7000 // 1985 Sharp PC-7000
-olypeopl // Olympia People PC
sx16 // Sanyo SX-16
mbc16 // Sanyo MBC-16
ataripc3
@@ -744,6 +751,7 @@ ssam88s
// Non-PC msdos
pcd // Siemens PC-D
slicer // 1983 Slicer Computers
+olypeopl // Olympia People PC
// PC Junior
ibmpcjr // 1984 IBM PC Jr
@@ -876,6 +884,9 @@ spt1740 // Symbol SPT 1740
osborne1 // 1981 Osborne-1
osbexec // 1982 Osborne Executive
+// Regnecentralen
+rc759 // 1984 RC759
+
// Research Machines
nimbus // RM Nimbus 186
@@ -1579,6 +1590,9 @@ hbf9sp
fsa1gt
fsa1st
+// Microsoft
+xbox
+
// NASCOM Microcomputers
nascom1 // 1978 Nascom 1
nascom2 // 1979 Nascom 2
@@ -1706,6 +1720,7 @@ hp9k340
hp9k370
hp9k380
hp9k382
+hp64k
// SpectraVideo
svi318 // SVI-318 (PAL)
@@ -2178,6 +2193,11 @@ cfrogger // Coleco
// hh_pic16
maniac // Ideal
+// hh_sm510
+ktopgun // Konami
+ktmnt // Konami
+gnwmndon // Nintendo
+
// hh_tms1k
mathmagi // APF
amaztron // Coleco
@@ -2195,7 +2215,7 @@ gpoker // Gakken
gjackpot // Gakken
elecdet // Ideal
starwbc // Kenner
-starwbcp // Kenner (prototype)
+starwbcp // Kenner (patent)
astro // Kosmos
comp4 // Milton Bradley
simon // Milton Bradley
@@ -2204,7 +2224,7 @@ bigtrak // Milton Bradley
cnsector // Parker Bros
merlin // Parker Bros
stopthie // Parker Bros
-stopthiep // Parker Bros (prototype)
+stopthiep // Parker Bros (patent)
bankshot // Parker Bros
splitsec // Parker Bros
mmerlin // Parker Bros
@@ -2273,6 +2293,7 @@ bcs3b
bcs3c
bob85
c80
+ds348 //Sigtron Daruma
mc1000
d6809
mk85
@@ -2281,6 +2302,8 @@ elwro800
fk1
et3400
amu880
+i7000
+icatel
interact
jr100
jr100u
@@ -2417,6 +2440,7 @@ indiana
vector4
unistar
dual68
+sdk80
sdk85
rpc86
isbc86
@@ -2680,3 +2704,4 @@ leapstertv
excali64
bitgrpha
bitgrphb
+tvgame
diff --git a/src/mame/nl.lst b/src/mame/nl.lst
new file mode 100644
index 00000000000..67723374e4b
--- /dev/null
+++ b/src/mame/nl.lst
@@ -0,0 +1,31 @@
+// license:BSD-3-Clause
+// copyright-holders:Aaron Giles
+/******************************************************************************
+
+ nl.lst
+
+ List of all drivers using netlist code. This file is parsed by then
+ genie build system.
+
+******************************************************************************/
+
+1942 // 12/1984 (c) 1984
+1942a // 12/1984 (c) 1984
+1942abl // bootleg
+1942b // 12/1984 (c) 1984
+1942w // 12/1984 (c) 1984 + Williams Electronics license (c) 1985
+1942p // prototype
+1942h // hack (Two Bit Score?)
+popeye // (c) 1982
+popeyeu // (c) 1982
+popeyef // (c) 1982
+popeyebl // bootleg
+
+// mario
+
+
+// Atari 100% TTL
+pong // (c) 1972 Atari
+pongd // (c) 1975 Atari
+pongf // (c) 1972 Atari
+breakout // (c) 1976 Atari
diff --git a/src/mame/video/aerofgt.c b/src/mame/video/aerofgt.c
index da481ef19fa..2c455b6bf29 100644
--- a/src/mame/video/aerofgt.c
+++ b/src/mame/video/aerofgt.c
@@ -298,8 +298,8 @@ UINT32 aerofgt_state::screen_update_pspikes(screen_device &screen, bitmap_ind16
screen.priority().fill(0, cliprect);
m_bg1_tilemap->draw(screen, bitmap, cliprect, 0, 0);
- m_spr_old->turbofrc_draw_sprites(m_spriteram3,m_spriteram3.bytes(),m_spritepalettebank, bitmap, cliprect, screen.priority(), 0);
m_spr_old->turbofrc_draw_sprites(m_spriteram3,m_spriteram3.bytes(),m_spritepalettebank, bitmap, cliprect, screen.priority(), 1);
+ m_spr_old->turbofrc_draw_sprites(m_spriteram3,m_spriteram3.bytes(),m_spritepalettebank, bitmap, cliprect, screen.priority(), 0);
return 0;
}
@@ -317,11 +317,11 @@ UINT32 aerofgt_state::screen_update_karatblz(screen_device &screen, bitmap_ind16
m_bg2_tilemap->draw(screen, bitmap, cliprect, 0, 0);
/* we use the priority buffer so sprites are drawn front to back */
- m_spr_old2->turbofrc_draw_sprites(m_spriteram3+0x200,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0);
m_spr_old2->turbofrc_draw_sprites(m_spriteram3+0x200,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1);
+ m_spr_old2->turbofrc_draw_sprites(m_spriteram3+0x200,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0);
- m_spr_old->turbofrc_draw_sprites(m_spriteram3+0x000,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0);
m_spr_old->turbofrc_draw_sprites(m_spriteram3+0x000,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1);
+ m_spr_old->turbofrc_draw_sprites(m_spriteram3+0x000,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0);
return 0;
}
@@ -343,11 +343,11 @@ UINT32 aerofgt_state::screen_update_spinlbrk(screen_device &screen, bitmap_ind16
m_bg2_tilemap->draw(screen, bitmap, cliprect, 0, 1);
/* we use the priority buffer so sprites are drawn front to back */
- m_spr_old->turbofrc_draw_sprites(m_spriteram3+0x000,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1);
m_spr_old->turbofrc_draw_sprites(m_spriteram3+0x000,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0);
+ m_spr_old->turbofrc_draw_sprites(m_spriteram3+0x000,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1);
- m_spr_old2->turbofrc_draw_sprites(m_spriteram3+0x200,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1);
m_spr_old2->turbofrc_draw_sprites(m_spriteram3+0x200,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0);
+ m_spr_old2->turbofrc_draw_sprites(m_spriteram3+0x200,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1);
return 0;
}
@@ -370,11 +370,11 @@ UINT32 aerofgt_state::screen_update_turbofrc(screen_device &screen, bitmap_ind16
m_bg2_tilemap->draw(screen, bitmap, cliprect, 0, 1);
/* we use the priority buffer so sprites are drawn front to back */
- m_spr_old2->turbofrc_draw_sprites(m_spriteram3+0x200,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0); //enemy
- m_spr_old2->turbofrc_draw_sprites(m_spriteram3+0x200,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1); //enemy
+ m_spr_old2->turbofrc_draw_sprites(m_spriteram3+0x200,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1); //ship
+ m_spr_old2->turbofrc_draw_sprites(m_spriteram3+0x200,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0); //intro
- m_spr_old->turbofrc_draw_sprites(m_spriteram3+0x000,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0); //ship
- m_spr_old->turbofrc_draw_sprites(m_spriteram3+0x000,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1); //intro
+ m_spr_old->turbofrc_draw_sprites(m_spriteram3+0x000,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1); //enemy
+ m_spr_old->turbofrc_draw_sprites(m_spriteram3+0x000,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0); //enemy
return 0;
}
diff --git a/src/mame/video/appoooh.c b/src/mame/video/appoooh.c
index eb04a7d17c4..487b865145b 100644
--- a/src/mame/video/appoooh.c
+++ b/src/mame/video/appoooh.c
@@ -143,37 +143,37 @@ VIDEO_START_MEMBER(appoooh_state,appoooh)
save_item(NAME(m_priority));
}
-WRITE8_MEMBER(appoooh_state::appoooh_scroll_w)
+WRITE8_MEMBER(appoooh_state::scroll_w)
{
m_scroll_x = data;
}
-WRITE8_MEMBER(appoooh_state::appoooh_fg_videoram_w)
+WRITE8_MEMBER(appoooh_state::fg_videoram_w)
{
m_fg_videoram[offset] = data;
m_fg_tilemap->mark_tile_dirty(offset);
}
-WRITE8_MEMBER(appoooh_state::appoooh_fg_colorram_w)
+WRITE8_MEMBER(appoooh_state::fg_colorram_w)
{
m_fg_colorram[offset] = data;
m_fg_tilemap->mark_tile_dirty(offset);
}
-WRITE8_MEMBER(appoooh_state::appoooh_bg_videoram_w)
+WRITE8_MEMBER(appoooh_state::bg_videoram_w)
{
m_bg_videoram[offset] = data;
m_bg_tilemap->mark_tile_dirty(offset);
}
-WRITE8_MEMBER(appoooh_state::appoooh_bg_colorram_w)
+WRITE8_MEMBER(appoooh_state::bg_colorram_w)
{
m_bg_colorram[offset] = data;
m_bg_tilemap->mark_tile_dirty(offset);
}
-WRITE8_MEMBER(appoooh_state::appoooh_out_w)
+WRITE8_MEMBER(appoooh_state::out_w)
{
/* bit 0 controls NMI */
m_nmi_mask = data & 1;
@@ -191,9 +191,7 @@ WRITE8_MEMBER(appoooh_state::appoooh_out_w)
/* bit 6 ROM bank select */
{
- UINT8 *RAM = memregion("maincpu")->base();
-
- membank("bank1")->set_base(&RAM[data&0x40 ? 0x10000 : 0x0a000]);
+ membank("bank1")->set_entry((data&0x40) ? 1 : 0);
}
/* bit 7 unknown (used) */
diff --git a/src/mame/video/argus.c b/src/mame/video/argus.c
index ccd6530aa65..868fcec2947 100644
--- a/src/mame/video/argus.c
+++ b/src/mame/video/argus.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Yochizo
/***************************************************************************
diff --git a/src/mame/video/asuka.c b/src/mame/video/asuka.c
index 60d30f15bd4..7ae0cebbbac 100644
--- a/src/mame/video/asuka.c
+++ b/src/mame/video/asuka.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:David Graves, Brian Troha
#include "emu.h"
#include "includes/asuka.h"
diff --git a/src/mame/video/atarimo.h b/src/mame/video/atarimo.h
index 7804ab3b57c..de8ad2adbb6 100644
--- a/src/mame/video/atarimo.h
+++ b/src/mame/video/atarimo.h
@@ -126,7 +126,7 @@ private:
// timer IDs
enum
{
- TID_FORCE_UPDATE,
+ TID_FORCE_UPDATE
};
// internal helpers
diff --git a/src/mame/video/avgdvg.c b/src/mame/video/avgdvg.c
index 66ef84ca034..1b5d6b3b37b 100644
--- a/src/mame/video/avgdvg.c
+++ b/src/mame/video/avgdvg.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Eric Smith, Brad Oliver, Bernd Wiebelt, Aaron Giles, Andrew Caldwell
/*************************************************************************
diff --git a/src/mame/video/avgdvg.h b/src/mame/video/avgdvg.h
index 2a455974dc0..79f923e7f46 100644
--- a/src/mame/video/avgdvg.h
+++ b/src/mame/video/avgdvg.h
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Eric Smith, Brad Oliver, Bernd Wiebelt, Aaron Giles, Andrew Caldwell
#ifndef __AVGDVG__
#define __AVGDVG__
diff --git a/src/mame/video/battlera.c b/src/mame/video/battlera.c
deleted file mode 100644
index 2e3489c3610..00000000000
--- a/src/mame/video/battlera.c
+++ /dev/null
@@ -1,3 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Bryan McPhail
-// delete me
diff --git a/src/mame/video/bublbobl.c b/src/mame/video/bublbobl.c
index 9ec2ca6bb37..5efdd4db370 100644
--- a/src/mame/video/bublbobl.c
+++ b/src/mame/video/bublbobl.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Chris Moore, Nicola Salmoria
/***************************************************************************
diff --git a/src/mame/video/cclimber.c b/src/mame/video/cclimber.c
index 80c614148aa..f8574855a67 100644
--- a/src/mame/video/cclimber.c
+++ b/src/mame/video/cclimber.c
@@ -2,7 +2,7 @@
// copyright-holders:Nicola Salmoria
/***************************************************************************
- video.c
+ cclimber.c
Functions to emulate the video hardware of the machine.
diff --git a/src/mame/video/cheekyms.c b/src/mame/video/cheekyms.c
index ec317af70ec..99a98580f82 100644
--- a/src/mame/video/cheekyms.c
+++ b/src/mame/video/cheekyms.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Lee Taylor, Chris Moore
/*************************************************************************
Universal Cheeky Mouse Driver
diff --git a/src/mame/video/cps1.c b/src/mame/video/cps1.c
index e45331e2192..73e51719582 100644
--- a/src/mame/video/cps1.c
+++ b/src/mame/video/cps1.c
@@ -151,6 +151,7 @@ Varth: Operation Thunderstorm (World 920612) 1992 89624B-? VA
Varth: Operation Thunderstorm (World 920714) 89624B-3 VA24B IOB1 88622-C-5 CPS-B-04 DL-0411-10005 None
Varth: Operation Thunderstorm (USA 920612) 91635B-2 VA63B BPRG1 IOB1 88622-C-5 CPS-B-04 DL-0411-10005 None
Varth: Operation Thunderstorm* (Japan 920714) 88622B-3 VA22B LWIO 92641C-1 CPS-B-21 DL-0921-10014 IOC1
+Varth: Operation Thunderstorm* (Japan Resale Ver. 920714) 91634B-2 VA63B BPRG1 IOB1 92641C-1 CPS-B-21 DL-0921-10014 IOC1
Quiz & Dragons: Capcom Quiz Game* (USA 920701) 1992 89625B-1 QD22B IOB1 92641C-1 CPS-B-21 DL-0921-10014 IOC1
Quiz & Dragons: Capcom Quiz Game (Japan Resale Ver. 940921) 1994 91634B-2 QAD63B BPRG1 IOB1 92631C-6 CPS-B-21 DL-0921-10014 C632 IOC1
@@ -1536,6 +1537,7 @@ static const struct CPS1config cps1_config_table[]=
{"varthr1", CPS_B_04, mapper_VA63B }, /* CPSB test has been patched out (60=0008) register is also written to, possibly leftover from development */ // wrong, this set uses VA24B, dumped but equations still not added
{"varthu", CPS_B_04, mapper_VA63B }, /* CPSB test has been patched out (60=0008) register is also written to, possibly leftover from development */
{"varthj", CPS_B_21_BT5, mapper_VA22B }, /* CPSB test has been patched out (72=0001) register is also written to, possibly leftover from development */
+ {"varthjr", CPS_B_21_BT5, mapper_VA63B }, /* CPSB test has been patched out (72=0001) register is also written to, possibly leftover from development */
{"cworld2j", CPS_B_21_BT6, mapper_Q522B, 0x36, 0, 0x34 }, /* (ports 36, 34 probably leftover input code from another game) */
{"cworld2ja", CPS_B_21_DEF, mapper_Q522B }, // patched set, no battery, could be desuicided // wrong, this set uses Q529B, still not dumped
{"cworld2jb", CPS_B_21_BT6, mapper_Q522B, 0x36, 0, 0x34 }, // wrong, this set uses Q563B, still not dumped
diff --git a/src/mame/video/deco32.c b/src/mame/video/deco32.c
index c739522ef5d..122285f9674 100644
--- a/src/mame/video/deco32.c
+++ b/src/mame/video/deco32.c
@@ -5,24 +5,24 @@
/******************************************************************************/
-WRITE32_MEMBER(deco32_state::deco32_pri_w)
+WRITE32_MEMBER(deco32_state::pri_w)
{
m_pri=data;
}
-WRITE32_MEMBER(dragngun_state::dragngun_sprite_control_w)
+WRITE32_MEMBER(dragngun_state::sprite_control_w)
{
- m_dragngun_sprite_ctrl=data;
+ m_sprite_ctrl=data;
}
-WRITE32_MEMBER(dragngun_state::dragngun_spriteram_dma_w)
+WRITE32_MEMBER(dragngun_state::spriteram_dma_w)
{
/* DMA spriteram to private sprite chip area, and clear cpu ram */
m_spriteram->copy();
memset(m_spriteram->live(),0,0x2000);
}
-WRITE32_MEMBER(deco32_state::deco32_ace_ram_w)
+WRITE32_MEMBER(deco32_state::ace_ram_w)
{
/* Some notes pieced together from Tattoo Assassins info:
@@ -98,7 +98,7 @@ void deco32_state::updateAceRam()
/* Later games have double buffered paletteram - the real palette ram is
only updated on a DMA call */
-WRITE32_MEMBER(deco32_state::deco32_nonbuffered_palette_w)
+WRITE32_MEMBER(deco32_state::nonbuffered_palette_w)
{
int r,g,b;
@@ -111,13 +111,13 @@ WRITE32_MEMBER(deco32_state::deco32_nonbuffered_palette_w)
m_palette->set_pen_color(offset,rgb_t(r,g,b));
}
-WRITE32_MEMBER(deco32_state::deco32_buffered_palette_w)
+WRITE32_MEMBER(deco32_state::buffered_palette_w)
{
COMBINE_DATA(&m_generic_paletteram_32[offset]);
m_dirty_palette[offset]=1;
}
-WRITE32_MEMBER(deco32_state::deco32_palette_dma_w)
+WRITE32_MEMBER(deco32_state::palette_dma_w)
{
const int m=m_palette->entries();
int r,g,b,i;
@@ -145,9 +145,22 @@ WRITE32_MEMBER(deco32_state::deco32_palette_dma_w)
/******************************************************************************/
+void deco32_state::video_start()
+{
+ save_item(NAME(m_pri));
+ save_item(NAME(m_spriteram16));
+ save_item(NAME(m_spriteram16_buffered));
+ save_item(NAME(m_pf1_rowscroll));
+ save_item(NAME(m_pf2_rowscroll));
+ save_item(NAME(m_pf3_rowscroll));
+ save_item(NAME(m_pf4_rowscroll));
+}
+
VIDEO_START_MEMBER(deco32_state,captaven)
{
m_has_ace_ram=0;
+
+ deco32_state::video_start();
}
VIDEO_START_MEMBER(deco32_state,fghthist)
@@ -155,6 +168,37 @@ VIDEO_START_MEMBER(deco32_state,fghthist)
m_dirty_palette = auto_alloc_array(machine(), UINT8, 4096);
m_sprgen->alloc_sprite_bitmap();
m_has_ace_ram=0;
+
+ save_pointer(NAME(m_dirty_palette), 4096);
+ deco32_state::video_start();
+}
+
+VIDEO_START_MEMBER(deco32_state,nslasher)
+{
+ int width, height;
+ m_dirty_palette = auto_alloc_array(machine(), UINT8, 4096);
+ width = m_screen->width();
+ height = m_screen->height();
+ m_tilemap_alpha_bitmap=auto_bitmap_ind16_alloc(machine(), width, height );
+ m_sprgen1->alloc_sprite_bitmap();
+ m_sprgen2->alloc_sprite_bitmap();
+ memset(m_dirty_palette,0,4096);
+ m_has_ace_ram=1;
+
+ save_pointer(NAME(m_dirty_palette), 4096);
+ save_item(NAME(m_ace_ram_dirty));
+ save_item(NAME(m_spriteram16_2));
+ save_item(NAME(m_spriteram16_2_buffered));
+
+ deco32_state::video_start();
+}
+
+void dragngun_state::video_start()
+{
+ save_item(NAME(m_pf1_rowscroll));
+ save_item(NAME(m_pf2_rowscroll));
+ save_item(NAME(m_pf3_rowscroll));
+ save_item(NAME(m_pf4_rowscroll));
}
VIDEO_START_MEMBER(dragngun_state,dragngun)
@@ -163,11 +207,11 @@ VIDEO_START_MEMBER(dragngun_state,dragngun)
m_screen->register_screen_bitmap(m_temp_render_bitmap);
memset(m_dirty_palette,0,4096);
-
- save_item(NAME(m_dragngun_sprite_ctrl));
+
m_has_ace_ram=0;
-
+ save_item(NAME(m_sprite_ctrl));
+ save_pointer(NAME(m_dirty_palette), 4096);
}
VIDEO_START_MEMBER(dragngun_state,lockload)
@@ -177,40 +221,21 @@ VIDEO_START_MEMBER(dragngun_state,lockload)
memset(m_dirty_palette,0,4096);
- save_item(NAME(m_dragngun_sprite_ctrl));
m_has_ace_ram=0;
-}
-VIDEO_START_MEMBER(deco32_state,nslasher)
-{
- int width, height;
- m_dirty_palette = auto_alloc_array(machine(), UINT8, 4096);
- width = m_screen->width();
- height = m_screen->height();
- m_tilemap_alpha_bitmap=auto_bitmap_ind16_alloc(machine(), width, height );
- m_sprgen1->alloc_sprite_bitmap();
- m_sprgen2->alloc_sprite_bitmap();
- memset(m_dirty_palette,0,4096);
- save_item(NAME(m_pri));
- m_has_ace_ram=1;
+ save_item(NAME(m_sprite_ctrl));
+ save_pointer(NAME(m_dirty_palette), 4096);
}
-
/******************************************************************************/
-void deco32_state::screen_eof_captaven(screen_device &screen, bool state)
-{
-}
-
-void dragngun_state::screen_eof_dragngun(screen_device &screen, bool state)
-{
-}
-
/******************************************************************************/
UINT32 deco32_state::screen_update_captaven(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- machine().tilemap().set_flip_all(flip_screen() ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
+ address_space &space = machine().driver_data()->generic_space();
+ UINT16 flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff);
+ flip_screen_set(BIT(flip, 7));
screen.priority().fill(0, cliprect);
bitmap.fill(m_palette->pen(0x000), cliprect); // Palette index not confirmed
@@ -267,7 +292,7 @@ UINT32 dragngun_state::screen_update_dragngun(screen_device &screen, bitmap_rgb3
{
rectangle clip(cliprect.min_x, cliprect.max_x, 8, 247);
- m_sprgenzoom->dragngun_draw_sprites(bitmap,clip,m_spriteram->buffer(), m_dragngun_sprite_layout_0_ram, m_dragngun_sprite_layout_1_ram, m_dragngun_sprite_lookup_0_ram, m_dragngun_sprite_lookup_1_ram, m_dragngun_sprite_ctrl, screen.priority(), m_temp_render_bitmap );
+ m_sprgenzoom->dragngun_draw_sprites(bitmap,clip,m_spriteram->buffer(), m_sprite_layout_0_ram, m_sprite_layout_1_ram, m_sprite_lookup_0_ram, m_sprite_lookup_1_ram, m_sprite_ctrl, screen.priority(), m_temp_render_bitmap );
}
diff --git a/src/mame/video/dooyong.c b/src/mame/video/dooyong.c
index 1258f347978..2e2376a7f82 100644
--- a/src/mame/video/dooyong.c
+++ b/src/mame/video/dooyong.c
@@ -346,6 +346,12 @@ UINT32 dooyong_z80_ym2203_state::screen_update_lastday(screen_device &screen, bi
bitmap.fill(m_palette->black_pen(), cliprect);
screen.priority().fill(0, cliprect);
+ /* Text layer is offset on this machine */
+ if (!flip_screen())
+ m_tx_tilemap->set_scrolly(0, 8);
+ else
+ m_tx_tilemap->set_scrolly(0, -8);
+
m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 1);
m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 2);
m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 4);
@@ -361,6 +367,12 @@ UINT32 dooyong_z80_ym2203_state::screen_update_gulfstrm(screen_device &screen, b
bitmap.fill(m_palette->black_pen(), cliprect);
screen.priority().fill(0, cliprect);
+ /* Text layer is offset on this machine */
+ if (!flip_screen())
+ m_tx_tilemap->set_scrolly(0, 8);
+ else
+ m_tx_tilemap->set_scrolly(0, -8);
+
m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 1);
m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 2);
m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 4);
@@ -455,9 +467,6 @@ VIDEO_START_MEMBER(dooyong_z80_ym2203_state, lastday)
m_fg_tilemap->set_transparent_pen(15);
m_tx_tilemap->set_transparent_pen(15);
- /* Text layer is offset on this machine */
- m_tx_tilemap->set_scrolly(0, 8);
-
memset(m_bgscroll8, 0, 0x10);
memset(m_bg2scroll8, 0, 0x10);
memset(m_fgscroll8, 0, 0x10);
@@ -492,9 +501,6 @@ VIDEO_START_MEMBER(dooyong_z80_ym2203_state, gulfstrm)
m_fg_tilemap->set_transparent_pen(15);
m_tx_tilemap->set_transparent_pen(15);
- /* Text layer is offset on this machine */
- m_tx_tilemap->set_scrolly(0, 8);
-
memset(m_bgscroll8, 0, 0x10);
memset(m_bg2scroll8, 0, 0x10);
memset(m_fgscroll8, 0, 0x10);
diff --git a/src/mame/video/exzisus.c b/src/mame/video/exzisus.c
index 9081509f6bb..5b255658bf1 100644
--- a/src/mame/video/exzisus.c
+++ b/src/mame/video/exzisus.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Yochizo
/***************************************************************************
diff --git a/src/mame/video/gaelco3d.c b/src/mame/video/gaelco3d.c
index 4b445d40234..f0b45a94ee9 100644
--- a/src/mame/video/gaelco3d.c
+++ b/src/mame/video/gaelco3d.c
@@ -224,11 +224,11 @@ void gaelco3d_renderer::render_noz_noperspective(INT32 scanline, const extent_t
int pixeloffs = (tex + (v >> 8) * 4096 + (u >> 8)) & endmask;
if (pixeloffs >= m_texmask_size || !m_texmask[pixeloffs])
{
- rgb_t rgb00 = palsource[m_texture[pixeloffs]];
- rgb_t rgb01 = palsource[m_texture[(pixeloffs + 1) & endmask]];
- rgb_t rgb10 = palsource[m_texture[(pixeloffs + 4096) & endmask]];
- rgb_t rgb11 = palsource[m_texture[(pixeloffs + 4097) & endmask]];
- UINT32 filtered = rgb_bilinear_filter(rgb00, rgb01, rgb10, rgb11, u, v);
+ UINT32 rgb00 = palsource[m_texture[pixeloffs]];
+ UINT32 rgb01 = palsource[m_texture[(pixeloffs + 1) & endmask]];
+ UINT32 rgb10 = palsource[m_texture[(pixeloffs + 4096) & endmask]];
+ UINT32 rgb11 = palsource[m_texture[(pixeloffs + 4097) & endmask]];
+ const UINT32 filtered = rgbaint_t::bilinear_filter(rgb00, rgb01, rgb10, rgb11, u, v);
dest[x] = (filtered & 0x1f) | ((filtered & 0x1ff800) >> 6);
zbuf[x] = zbufval;
}
@@ -271,11 +271,11 @@ void gaelco3d_renderer::render_normal(INT32 scanline, const extent_t &extent, co
int pixeloffs = (tex + (v >> 8) * 4096 + (u >> 8)) & endmask;
if (pixeloffs >= m_texmask_size || !m_texmask[pixeloffs])
{
- rgb_t rgb00 = palsource[m_texture[pixeloffs]];
- rgb_t rgb01 = palsource[m_texture[(pixeloffs + 1) & endmask]];
- rgb_t rgb10 = palsource[m_texture[(pixeloffs + 4096) & endmask]];
- rgb_t rgb11 = palsource[m_texture[(pixeloffs + 4097) & endmask]];
- UINT32 filtered = rgb_bilinear_filter(rgb00, rgb01, rgb10, rgb11, u, v);
+ UINT32 rgb00 = palsource[m_texture[pixeloffs]];
+ UINT32 rgb01 = palsource[m_texture[(pixeloffs + 1) & endmask]];
+ UINT32 rgb10 = palsource[m_texture[(pixeloffs + 4096) & endmask]];
+ UINT32 rgb11 = palsource[m_texture[(pixeloffs + 4097) & endmask]];
+ const UINT32 filtered = rgbaint_t::bilinear_filter(rgb00, rgb01, rgb10, rgb11, u, v);
dest[x] = (filtered & 0x1f) | ((filtered & 0x1ff800) >> 6);
zbuf[x] = (zbufval < 0) ? -zbufval : zbufval;
}
@@ -321,11 +321,11 @@ void gaelco3d_renderer::render_alphablend(INT32 scanline, const extent_t &extent
int pixeloffs = (tex + (v >> 8) * 4096 + (u >> 8)) & endmask;
if (pixeloffs >= m_texmask_size || !m_texmask[pixeloffs])
{
- rgb_t rgb00 = palsource[m_texture[pixeloffs]];
- rgb_t rgb01 = palsource[m_texture[(pixeloffs + 1) & endmask]];
- rgb_t rgb10 = palsource[m_texture[(pixeloffs + 4096) & endmask]];
- rgb_t rgb11 = palsource[m_texture[(pixeloffs + 4097) & endmask]];
- UINT32 filtered = rgb_bilinear_filter(rgb00, rgb01, rgb10, rgb11, u, v) >> 1;
+ UINT32 rgb00 = palsource[m_texture[pixeloffs]];
+ UINT32 rgb01 = palsource[m_texture[(pixeloffs + 1) & endmask]];
+ UINT32 rgb10 = palsource[m_texture[(pixeloffs + 4096) & endmask]];
+ UINT32 rgb11 = palsource[m_texture[(pixeloffs + 4097) & endmask]];
+ const UINT32 filtered = rgbaint_t::bilinear_filter(rgb00, rgb01, rgb10, rgb11, u, v) >> 1;
dest[x] = ((filtered & 0x0f) | ((filtered & 0x0f7800) >> 6)) + ((dest[x] >> 1) & 0x3def);
zbuf[x] = (zbufval < 0) ? -zbufval : zbufval;
}
diff --git a/src/mame/video/galastrm.c b/src/mame/video/galastrm.c
index 622837c4bc0..d37ccb5bef3 100644
--- a/src/mame/video/galastrm.c
+++ b/src/mame/video/galastrm.c
@@ -7,7 +7,7 @@
#define X_OFFSET 96
#define Y_OFFSET 60
-struct poly_extra_data
+struct gs_poly_extra_data
{
bitmap_ind16 *texbase;
};
@@ -28,12 +28,12 @@ void galastrm_state::galastrm_exit()
void galastrm_state::video_start()
{
- m_spritelist = auto_alloc_array(machine(), struct tempsprite, 0x4000);
+ m_spritelist = auto_alloc_array(machine(), struct gs_tempsprite, 0x4000);
m_screen->register_screen_bitmap(m_tmpbitmaps);
m_screen->register_screen_bitmap(m_polybitmap);
- m_poly = poly_alloc(machine(), 16, sizeof(poly_extra_data), POLYFLAG_ALLOW_QUADS);
+ m_poly = poly_alloc(machine(), 16, sizeof(gs_poly_extra_data), POLYFLAG_ALLOW_QUADS);
machine().add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(galastrm_state::galastrm_exit), this));
}
@@ -191,7 +191,7 @@ logerror("Sprite number %04x had %02x invalid chunks\n",tilenum,bad_chunks);
void galastrm_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, const int *primasks, int priority)
{
- struct tempsprite *sprite_ptr = m_sprite_ptr_pre;
+ struct gs_tempsprite *sprite_ptr = m_sprite_ptr_pre;
while (sprite_ptr != m_spritelist)
{
@@ -217,7 +217,7 @@ void galastrm_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, c
static void tc0610_draw_scanline(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid)
{
- const poly_extra_data *extra = (const poly_extra_data *)extradata;
+ const gs_poly_extra_data *extra = (const gs_poly_extra_data *)extradata;
bitmap_ind16 *destmap = (bitmap_ind16 *)dest;
UINT16 *framebuffer = &destmap->pix16(scanline);
bitmap_ind16 *texbase = extra->texbase;
@@ -239,7 +239,7 @@ static void tc0610_draw_scanline(void *dest, INT32 scanline, const poly_extent *
void galastrm_state::tc0610_rotate_draw(bitmap_ind16 &bitmap, bitmap_ind16 &srcbitmap, const rectangle &clip)
{
- poly_extra_data *extra = (poly_extra_data *)poly_get_extra_data(m_poly);
+ gs_poly_extra_data *extra = (gs_poly_extra_data *)poly_get_extra_data(m_poly);
poly_draw_scanline_func callback;
poly_vertex vert[4];
int rsx = m_tc0610_ctrl_reg[1][0];
diff --git a/src/mame/video/gameplan.c b/src/mame/video/gameplan.c
index 9d51a2b59ef..e20324372e0 100644
--- a/src/mame/video/gameplan.c
+++ b/src/mame/video/gameplan.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Chris Moore
/***************************************************************************
diff --git a/src/mame/video/gaplus.c b/src/mame/video/gaplus.c
index 58ceda4e4b3..491316ae7ac 100644
--- a/src/mame/video/gaplus.c
+++ b/src/mame/video/gaplus.c
@@ -2,7 +2,7 @@
// copyright-holders:Manuel Abadia, Ernesto Corvi, Nicola Salmoria
/***************************************************************************
- video.c
+ gaplus.c
Functions to emulate the video hardware of the machine.
@@ -183,6 +183,15 @@ void gaplus_state::video_start()
m_bg_tilemap->configure_groups(*m_gfxdecode->gfx(0), 0xff);
starfield_init();
+
+ save_item(NAME(m_starfield_control));
+
+ for (int i = 0; i < MAX_STARS; i++)
+ {
+ save_item(NAME(m_stars[i].x), i);
+ save_item(NAME(m_stars[i].y), i);
+ // col and set aren't changed after init
+ }
}
@@ -193,18 +202,13 @@ void gaplus_state::video_start()
***************************************************************************/
-READ8_MEMBER(gaplus_state::gaplus_videoram_r)
-{
- return m_videoram[offset];
-}
-
-WRITE8_MEMBER(gaplus_state::gaplus_videoram_w)
+WRITE8_MEMBER(gaplus_state::videoram_w)
{
m_videoram[offset] = data;
m_bg_tilemap->mark_tile_dirty(offset & 0x3ff);
}
-WRITE8_MEMBER(gaplus_state::gaplus_starfield_control_w)
+WRITE8_MEMBER(gaplus_state::starfield_control_w)
{
offset &= 3;
m_starfield_control[offset] = data;
@@ -298,7 +302,7 @@ void gaplus_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect
}
}
-UINT32 gaplus_state::screen_update_gaplus(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+UINT32 gaplus_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
/* flip screen control is embedded in RAM */
flip_screen_set(m_spriteram[0x1f7f-0x800] & 1);
@@ -319,7 +323,7 @@ UINT32 gaplus_state::screen_update_gaplus(screen_device &screen, bitmap_ind16 &b
}
-void gaplus_state::screen_eof_gaplus(screen_device &screen, bool state)/* update starfields */
+void gaplus_state::screen_eof(screen_device &screen, bool state)/* update starfields */
{
// falling edge
if (!state)
diff --git a/src/mame/video/gcpinbal.c b/src/mame/video/gcpinbal.c
index a69fafb4c17..7c95e87381c 100644
--- a/src/mame/video/gcpinbal.c
+++ b/src/mame/video/gcpinbal.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:David Graves, R. Belmont
#include "emu.h"
#include "includes/gcpinbal.h"
diff --git a/src/mame/video/grchamp.c b/src/mame/video/grchamp.c
index 42c9c9c4c03..668fe88cd01 100644
--- a/src/mame/video/grchamp.c
+++ b/src/mame/video/grchamp.c
@@ -53,19 +53,19 @@ PALETTE_INIT_MEMBER(grchamp_state, grchamp)
}
-WRITE8_MEMBER(grchamp_state::grchamp_left_w)
+WRITE8_MEMBER(grchamp_state::left_w)
{
m_leftram[offset] = data;
m_left_tilemap->mark_tile_dirty(offset);
}
-WRITE8_MEMBER(grchamp_state::grchamp_center_w)
+WRITE8_MEMBER(grchamp_state::center_w)
{
m_centerram[offset] = data;
m_center_tilemap->mark_tile_dirty(offset);
}
-WRITE8_MEMBER(grchamp_state::grchamp_right_w)
+WRITE8_MEMBER(grchamp_state::right_w)
{
m_rightram[offset] = data;
m_right_tilemap->mark_tile_dirty(offset);
@@ -343,7 +343,7 @@ void grchamp_state::draw_objects(int y, UINT8 *objdata)
}
-UINT32 grchamp_state::screen_update_grchamp(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
+UINT32 grchamp_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
static const rgb_t objpix_lookup[8] =
{
diff --git a/src/mame/video/groundfx.c b/src/mame/video/groundfx.c
index de894dd98b8..0f5d385845e 100644
--- a/src/mame/video/groundfx.c
+++ b/src/mame/video/groundfx.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Bryan McPhail, David Graves
#include "emu.h"
#include "includes/groundfx.h"
@@ -7,7 +7,7 @@
void groundfx_state::video_start()
{
- m_spritelist = auto_alloc_array(machine(), struct tempsprite, 0x4000);
+ m_spritelist = auto_alloc_array(machine(), struct gfx_tempsprite, 0x4000);
/* Hack */
m_hack_cliprect.set(69, 250, 24 + 5, 24 + 44);
@@ -74,7 +74,7 @@ void groundfx_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap,co
/* pdrawgfx() needs us to draw sprites front to back, so we have to build a list
while processing sprite ram and then draw them all at the end */
- struct tempsprite *sprite_ptr = m_spritelist;
+ struct gfx_tempsprite *sprite_ptr = m_spritelist;
for (offs = (m_spriteram.bytes()/4-4);offs >= 0;offs -= 4)
{
diff --git a/src/mame/video/gstriker.c b/src/mame/video/gstriker.c
index 5d78bc9c0aa..d106abed893 100644
--- a/src/mame/video/gstriker.c
+++ b/src/mame/video/gstriker.c
@@ -9,7 +9,7 @@
-UINT32 gstriker_state::screen_update_gstriker(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+UINT32 gstriker_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
bitmap.fill(m_mixerregs1[8]&0x07ff, cliprect); // complete guess, causes green behind test grid in twc94 and blue behind title screen on gstriker
@@ -34,13 +34,11 @@ UINT32 gstriker_state::screen_update_gstriker(screen_device &screen, bitmap_ind1
return 0;
}
-VIDEO_START_MEMBER(gstriker_state, gstriker)
+void gstriker_state::video_start()
{
// Initalize the chip for the score plane
- m_tx->set_gfx_region(0);
m_tx->get_tilemap()->set_transparent_pen(0xf);
// Initalize the chip for the screen plane
- m_bg->set_gfx_region(1);
m_bg->get_tilemap()->set_transparent_pen(0xf);
}
diff --git a/src/mame/video/gunbustr.c b/src/mame/video/gunbustr.c
index ad0867d78d3..854f46c72f7 100644
--- a/src/mame/video/gunbustr.c
+++ b/src/mame/video/gunbustr.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Bryan McPhail, David Graves
#include "emu.h"
#include "includes/gunbustr.h"
@@ -7,7 +7,7 @@
void gunbustr_state::video_start()
{
- m_spritelist = auto_alloc_array(machine(), struct tempsprite, 0x4000);
+ m_spritelist = auto_alloc_array(machine(), struct gb_tempsprite, 0x4000);
}
/************************************************************
@@ -69,7 +69,7 @@ void gunbustr_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap,co
/* pdrawgfx() needs us to draw sprites front to back, so we have to build a list
while processing sprite ram and then draw them all at the end */
- struct tempsprite *sprite_ptr = m_spritelist;
+ struct gb_tempsprite *sprite_ptr = m_spritelist;
for (offs = (m_spriteram.bytes()/4-4);offs >= 0;offs -= 4)
{
diff --git a/src/mame/video/hexion.c b/src/mame/video/hexion.c
index de60226cc97..30e867a1428 100644
--- a/src/mame/video/hexion.c
+++ b/src/mame/video/hexion.c
@@ -51,6 +51,8 @@ void hexion_state::video_start()
m_vram[0] = memregion("maincpu")->base() + 0x30000;
m_vram[1] = m_vram[0] + 0x2000;
m_unkram = m_vram[1] + 0x2000;
+
+ membank("bank1")->configure_entries(0, 16, memregion("maincpu")->base() + 0x10000, 0x2000);
}
@@ -61,12 +63,10 @@ void hexion_state::video_start()
***************************************************************************/
-WRITE8_MEMBER(hexion_state::hexion_bankswitch_w)
+WRITE8_MEMBER(hexion_state::bankswitch_w)
{
- UINT8 *rom = memregion("maincpu")->base() + 0x10000;
-
/* bits 0-3 select ROM bank */
- membank("bank1")->set_base(rom + 0x2000 * (data & 0x0f));
+ membank("bank1")->set_entry(data & 0x0f);
/* does bit 6 trigger the 052591? */
if (data & 0x40)
@@ -85,7 +85,7 @@ if (data & 0x30)
//logerror("%04x: bankswitch_w %02x\n",space.device().safe_pc(),data);
}
-READ8_MEMBER(hexion_state::hexion_bankedram_r)
+READ8_MEMBER(hexion_state::bankedram_r)
{
if (m_gfxrom_select && offset < 0x1000)
{
@@ -106,7 +106,7 @@ READ8_MEMBER(hexion_state::hexion_bankedram_r)
}
}
-WRITE8_MEMBER(hexion_state::hexion_bankedram_w)
+WRITE8_MEMBER(hexion_state::bankedram_w)
{
if (m_bankctrl == 3 && offset == 0 && (data & 0xfe) == 0)
{
@@ -138,13 +138,13 @@ WRITE8_MEMBER(hexion_state::hexion_bankedram_w)
logerror("%04x: bankedram_w offset %04x, data %02x, bankctrl = %02x\n",space.device().safe_pc(),offset,data,m_bankctrl);
}
-WRITE8_MEMBER(hexion_state::hexion_bankctrl_w)
+WRITE8_MEMBER(hexion_state::bankctrl_w)
{
//logerror("%04x: bankctrl_w %02x\n",space.device().safe_pc(),data);
m_bankctrl = data;
}
-WRITE8_MEMBER(hexion_state::hexion_gfxrom_select_w)
+WRITE8_MEMBER(hexion_state::gfxrom_select_w)
{
//logerror("%04x: gfxrom_select_w %02x\n",space.device().safe_pc(),data);
m_gfxrom_select = data;
@@ -158,7 +158,7 @@ WRITE8_MEMBER(hexion_state::hexion_gfxrom_select_w)
***************************************************************************/
-UINT32 hexion_state::screen_update_hexion(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+UINT32 hexion_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
m_bg_tilemap[1]->draw(screen, bitmap, cliprect, 0,0);
m_bg_tilemap[0]->draw(screen, bitmap, cliprect, 0,0);
diff --git a/src/mame/video/itech8.c b/src/mame/video/itech8.c
index 0a961039fa3..a6be480e81f 100644
--- a/src/mame/video/itech8.c
+++ b/src/mame/video/itech8.c
@@ -90,7 +90,6 @@
***************************************************************************/
#include "emu.h"
-#include "video/tlc34076.h"
#include "cpu/m6809/m6809.h"
#include "includes/itech8.h"
@@ -112,18 +111,18 @@
*
*************************************/
-#define BLITTER_ADDRHI blitter_data[0]
-#define BLITTER_ADDRLO blitter_data[1]
-#define BLITTER_FLAGS blitter_data[2]
-#define BLITTER_STATUS blitter_data[3]
-#define BLITTER_WIDTH blitter_data[4]
-#define BLITTER_HEIGHT blitter_data[5]
-#define BLITTER_MASK blitter_data[6]
-#define BLITTER_OUTPUT blitter_data[7]
-#define BLITTER_XSTART blitter_data[8]
-#define BLITTER_YCOUNT blitter_data[9]
-#define BLITTER_XSTOP blitter_data[10]
-#define BLITTER_YSKIP blitter_data[11]
+#define BLITTER_ADDRHI m_blitter_data[0]
+#define BLITTER_ADDRLO m_blitter_data[1]
+#define BLITTER_FLAGS m_blitter_data[2]
+#define BLITTER_STATUS m_blitter_data[3]
+#define BLITTER_WIDTH m_blitter_data[4]
+#define BLITTER_HEIGHT m_blitter_data[5]
+#define BLITTER_MASK m_blitter_data[6]
+#define BLITTER_OUTPUT m_blitter_data[7]
+#define BLITTER_XSTART m_blitter_data[8]
+#define BLITTER_YCOUNT m_blitter_data[9]
+#define BLITTER_XSTOP m_blitter_data[10]
+#define BLITTER_YSKIP m_blitter_data[11]
#define BLITFLAG_SHIFT 0x01
#define BLITFLAG_XFLIP 0x02
@@ -150,6 +149,14 @@ void itech8_state::video_start()
/* fetch the GROM base */
m_grom_base = memregion("grom")->base();
m_grom_size = memregion("grom")->bytes();
+
+ save_item(NAME(m_blitter_data));
+ save_item(NAME(m_blit_in_progress));
+ save_item(NAME(m_page_select));
+ save_item(NAME(m_fetch_offset));
+ save_item(NAME(m_fetch_rle_count));
+ save_item(NAME(m_fetch_rle_value));
+ save_item(NAME(m_fetch_rle_literal));
}
@@ -160,7 +167,7 @@ void itech8_state::video_start()
*
*************************************/
-WRITE8_MEMBER(itech8_state::itech8_palette_w)
+WRITE8_MEMBER(itech8_state::palette_w)
{
m_tlc34076->write(space, offset/2, data);
}
@@ -173,7 +180,7 @@ WRITE8_MEMBER(itech8_state::itech8_palette_w)
*
*************************************/
-WRITE8_MEMBER(itech8_state::itech8_page_w)
+WRITE8_MEMBER(itech8_state::page_w)
{
m_screen->update_partial(m_screen->vpos());
logerror("%04x:display_page = %02X (%d)\n", space.device().safe_pc(), data, m_screen->vpos());
@@ -256,7 +263,6 @@ inline void itech8_state::consume_rle(int count)
void itech8_state::perform_blit(address_space &space)
{
- UINT8 *blitter_data = m_blitter_data;
offs_t addr = m_tms34061->m_display.regs[TMS34061_XYADDRESS] | ((m_tms34061->m_display.regs[TMS34061_XYOFFSET] & 0x300) << 8);
UINT8 shift = (BLITTER_FLAGS & BLITFLAG_SHIFT) ? 4 : 0;
int transparent = (BLITTER_FLAGS & BLITFLAG_TRANSPARENT);
@@ -395,7 +401,7 @@ TIMER_CALLBACK_MEMBER(itech8_state::blitter_done)
{
/* turn off blitting and generate an interrupt */
m_blit_in_progress = 0;
- itech8_update_interrupts(-1, -1, 1);
+ update_interrupts(-1, -1, 1);
if (FULL_LOGGING) logerror("------------ BLIT DONE (%d) --------------\n", m_screen->vpos());
}
@@ -408,7 +414,7 @@ TIMER_CALLBACK_MEMBER(itech8_state::blitter_done)
*
*************************************/
-READ8_MEMBER(itech8_state::itech8_blitter_r)
+READ8_MEMBER(itech8_state::blitter_r)
{
int result = m_blitter_data[offset / 2];
static const char *const portnames[] = { "AN_C", "AN_D", "AN_E", "AN_F" };
@@ -422,7 +428,7 @@ READ8_MEMBER(itech8_state::itech8_blitter_r)
/* a read from offset 3 clears the interrupt and returns the status */
if (offset == 3)
{
- itech8_update_interrupts(-1, -1, 0);
+ update_interrupts(-1, -1, 0);
if (m_blit_in_progress)
result |= 0x80;
else
@@ -437,13 +443,11 @@ READ8_MEMBER(itech8_state::itech8_blitter_r)
}
-WRITE8_MEMBER(itech8_state::itech8_blitter_w)
+WRITE8_MEMBER(itech8_state::blitter_w)
{
- UINT8 *blitter_data = m_blitter_data;
-
/* low bit seems to be ignored */
offset /= 2;
- blitter_data[offset] = data;
+ m_blitter_data[offset] = data;
/* a write to offset 3 starts things going */
if (offset == 3)
@@ -453,18 +457,18 @@ WRITE8_MEMBER(itech8_state::itech8_blitter_w)
{
logerror("Blit: XY=%1X%04X SRC=%02X%02X%02X SIZE=%3dx%3d FLAGS=%02x",
(m_tms34061->m_display.regs[TMS34061_XYOFFSET] >> 8) & 0x0f, m_tms34061->m_display.regs[TMS34061_XYADDRESS],
- m_grom_bank, blitter_data[0], blitter_data[1],
- blitter_data[4], blitter_data[5],
- blitter_data[2]);
+ m_grom_bank, m_blitter_data[0], m_blitter_data[1],
+ m_blitter_data[4], m_blitter_data[5],
+ m_blitter_data[2]);
logerror(" %02X %02X %02X [%02X] %02X %02X %02X [%02X]-%02X %02X %02X %02X [%02X %02X %02X %02X]\n",
- blitter_data[0], blitter_data[1],
- blitter_data[2], blitter_data[3],
- blitter_data[4], blitter_data[5],
- blitter_data[6], blitter_data[7],
- blitter_data[8], blitter_data[9],
- blitter_data[10], blitter_data[11],
- blitter_data[12], blitter_data[13],
- blitter_data[14], blitter_data[15]);
+ m_blitter_data[0], m_blitter_data[1],
+ m_blitter_data[2], m_blitter_data[3],
+ m_blitter_data[4], m_blitter_data[5],
+ m_blitter_data[6], m_blitter_data[7],
+ m_blitter_data[8], m_blitter_data[9],
+ m_blitter_data[10], m_blitter_data[11],
+ m_blitter_data[12], m_blitter_data[13],
+ m_blitter_data[14], m_blitter_data[15]);
}
/* perform the blit */
@@ -472,7 +476,7 @@ WRITE8_MEMBER(itech8_state::itech8_blitter_w)
m_blit_in_progress = 1;
/* set a timer to go off when we're done */
- machine().scheduler().timer_set(attotime::from_hz(12000000/4) * (BLITTER_WIDTH * BLITTER_HEIGHT + 12), timer_expired_delegate(FUNC(itech8_state::blitter_done),this));
+ m_blitter_done_timer->adjust(attotime::from_hz(12000000/4) * (BLITTER_WIDTH * BLITTER_HEIGHT + 12));
}
/* debugging */
@@ -487,7 +491,7 @@ WRITE8_MEMBER(itech8_state::itech8_blitter_w)
*
*************************************/
-WRITE8_MEMBER(itech8_state::itech8_tms34061_w)
+WRITE8_MEMBER(itech8_state::tms34061_w)
{
int func = (offset >> 9) & 7;
int col = offset & 0xff;
@@ -502,7 +506,7 @@ WRITE8_MEMBER(itech8_state::itech8_tms34061_w)
}
-READ8_MEMBER(itech8_state::itech8_tms34061_r)
+READ8_MEMBER(itech8_state::tms34061_r)
{
int func = (offset >> 9) & 7;
int col = offset & 0xff;
@@ -570,7 +574,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(itech8_state::grmatch_palette_update)
*
*************************************/
-UINT32 itech8_state::screen_update_itech8_2layer(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
+UINT32 itech8_state::screen_update_2layer(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
UINT32 page_offset;
int x, y;
@@ -606,7 +610,7 @@ UINT32 itech8_state::screen_update_itech8_2layer(screen_device &screen, bitmap_r
}
-UINT32 itech8_state::screen_update_itech8_grmatch(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
+UINT32 itech8_state::screen_update_grmatch(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
UINT32 page_offset;
int x, y;
@@ -653,7 +657,7 @@ UINT32 itech8_state::screen_update_itech8_grmatch(screen_device &screen, bitmap_
}
-UINT32 itech8_state::screen_update_itech8_2page(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
+UINT32 itech8_state::screen_update_2page(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
UINT32 page_offset;
int x, y;
@@ -684,7 +688,7 @@ UINT32 itech8_state::screen_update_itech8_2page(screen_device &screen, bitmap_rg
}
-UINT32 itech8_state::screen_update_itech8_2page_large(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
+UINT32 itech8_state::screen_update_2page_large(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
UINT32 page_offset;
int x, y;
diff --git a/src/mame/video/k001005.h b/src/mame/video/k001005.h
index cd4418fadd2..779baa3cbd9 100644
--- a/src/mame/video/k001005.h
+++ b/src/mame/video/k001005.h
@@ -36,7 +36,7 @@ enum k001005_param
K001005_FOG_R,
K001005_FOG_G,
K001005_FOG_B,
- K001005_FAR_Z,
+ K001005_FAR_Z
};
diff --git a/src/mame/video/kaneko_tmap.c b/src/mame/video/kaneko_tmap.c
index fc181d924cc..d74b87f52d5 100644
--- a/src/mame/video/kaneko_tmap.c
+++ b/src/mame/video/kaneko_tmap.c
@@ -197,8 +197,8 @@ void kaneko_view2_tilemap_device::kaneko16_vram_w(offs_t offset, UINT16 data, UI
m_tmap[_N_]->mark_tile_dirty(offset/2);
}
-void kaneko_view2_tilemap_device::kaneko16_prepare(bitmap_ind16 &bitmap, const rectangle &cliprect) { kaneko16_prepare_common(bitmap, cliprect); };
-void kaneko_view2_tilemap_device::kaneko16_prepare(bitmap_rgb32 &bitmap, const rectangle &cliprect) { kaneko16_prepare_common(bitmap, cliprect); };
+void kaneko_view2_tilemap_device::kaneko16_prepare(bitmap_ind16 &bitmap, const rectangle &cliprect) { kaneko16_prepare_common(bitmap, cliprect); }
+void kaneko_view2_tilemap_device::kaneko16_prepare(bitmap_rgb32 &bitmap, const rectangle &cliprect) { kaneko16_prepare_common(bitmap, cliprect); }
template<class _BitmapClass>
void kaneko_view2_tilemap_device::kaneko16_prepare_common(_BitmapClass &bitmap, const rectangle &cliprect)
diff --git a/src/mame/video/legionna.c b/src/mame/video/legionna.c
index b37c6d5ef05..5fccd7a222e 100644
--- a/src/mame/video/legionna.c
+++ b/src/mame/video/legionna.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:David Graves, Angelo Salese, David Haywood, Tomasz Slanina
/***************************************************************************
diff --git a/src/mame/video/m62.c b/src/mame/video/m62.c
index 87b994a0cd1..50c8cd2356a 100644
--- a/src/mame/video/m62.c
+++ b/src/mame/video/m62.c
@@ -92,14 +92,14 @@ static const res_net_info m62_sprite_net_info =
};
-/* this is a complete guess */
static const res_net_info battroad_char_net_info =
{
RES_NET_VCC_5V | RES_NET_VIN_TTL_OUT,
{
+ { RES_NET_AMP_NONE, 0, 0, 2, { 470, 220 } },
{ RES_NET_AMP_NONE, 0, 0, 3, { 1000, 470, 220 } },
- { RES_NET_AMP_NONE, 0, 0, 3, { 1000, 470, 220 } },
- { RES_NET_AMP_NONE, 0, 0, 2, { 470, 220 } }
+ { RES_NET_AMP_NONE, 0, 0, 3, { 1000, 470, 220 } }
+
}
};
@@ -155,8 +155,8 @@ static const res_net_decode_info battroad_char_decode_info =
0x000, 0x01f, /* start/end */
/* R G B */
{ 0x600, 0x600, 0x600 }, /* offsets */
- { 0, 3, 6 }, /* shifts */
- { 0x07, 0x07, 0x03 } /* masks */
+ { 6, 3, 0 }, /* shifts */
+ { 0x03, 0x07, 0x07 } /* masks */
};
@@ -292,7 +292,7 @@ void m62_state::register_savestate( )
WRITE8_MEMBER(m62_state::m62_flipscreen_w)
{
/* screen flip is handled both by software and hardware */
- data ^= ~ioport("DSW2")->read() & 1;
+ data ^= ((~ioport("DSW2")->read()) & 1);
m_flipscreen = data & 0x01;
if (m_flipscreen)
@@ -302,6 +302,10 @@ WRITE8_MEMBER(m62_state::m62_flipscreen_w)
coin_counter_w(machine(), 0, data & 2);
coin_counter_w(machine(), 1, data & 4);
+
+ /* Sound inhibit ... connected to D6 which is not present on any board */
+ if (m_audio->m_audio_SINH != NULL)
+ m_audio->m_audio_SINH->write((data >> 3) & 1);
}
WRITE8_MEMBER(m62_state::m62_hscroll_low_w)
diff --git a/src/mame/video/mb60553.c b/src/mame/video/mb60553.c
index b712003ff66..c6569ddba63 100644
--- a/src/mame/video/mb60553.c
+++ b/src/mame/video/mb60553.c
@@ -16,9 +16,17 @@ const device_type MB60553 = &device_creator<mb60553_zooming_tilemap_device>;
mb60553_zooming_tilemap_device::mb60553_zooming_tilemap_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, MB60553, "MB60553 Zooming Tilemap", tag, owner, clock, "mb60553", __FILE__),
- m_m_gfx_region(0),
+ m_vram(NULL),
+ m_pal_base(0),
+ m_lineram(NULL),
+ m_gfx_region(0),
m_gfxdecode(*this)
{
+ for (int i = 0; i < 8; i++)
+ {
+ m_regs[i] = 0;
+ m_bank[i] = 0;
+ }
}
@@ -32,7 +40,9 @@ void mb60553_zooming_tilemap_device::device_start()
save_pointer(NAME(m_lineram), 0x1000/2);
save_pointer(NAME(m_vram), 0x4000/2);
-
+ save_item(NAME(m_pal_base));
+ save_item(NAME(m_bank));
+ save_item(NAME(m_regs));
m_tmap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(mb60553_zooming_tilemap_device::get_tile_info),this),tilemap_mapper_delegate(FUNC(mb60553_zooming_tilemap_device::twc94_scan),this), 16,16,128,64);
m_tmap->set_transparent_pen(0);
@@ -46,7 +56,7 @@ void mb60553_zooming_tilemap_device::device_reset()
void mb60553_zooming_tilemap_device::set_gfx_region(device_t &device, int gfxregion)
{
mb60553_zooming_tilemap_device &dev = downcast<mb60553_zooming_tilemap_device &>(device);
- dev.m_m_gfx_region = gfxregion;
+ dev.m_gfx_region = gfxregion;
}
void mb60553_zooming_tilemap_device::static_set_gfxdecode_tag(device_t &device, const char *tag)
@@ -115,7 +125,7 @@ TILE_GET_INFO_MEMBER(mb60553_zooming_tilemap_device::get_tile_info)
pal = (data >> 12) & 0xF;
bankno = (data >> 9) & 0x7;
- SET_TILE_INFO_MEMBER(m_m_gfx_region, tileno + m_bank[bankno] * 0x200, pal + m_pal_base, 0);
+ SET_TILE_INFO_MEMBER(m_gfx_region, tileno + m_bank[bankno] * 0x200, pal + m_pal_base, 0);
}
void mb60553_zooming_tilemap_device::reg_written( int num_reg)
@@ -176,14 +186,6 @@ void mb60553_zooming_tilemap_device::set_pal_base( int pal_base)
m_pal_base = pal_base;
}
-void mb60553_zooming_tilemap_device::set_gfx_region( int gfx_region)
-{
- m_m_gfx_region = gfx_region;
-}
-
-
-
-
void mb60553_zooming_tilemap_device::draw_roz_core(screen_device &screen, bitmap_ind16 &destbitmap, const rectangle &cliprect,
UINT32 startx, UINT32 starty, int incxx, int incxy, int incyx, int incyy, bool wraparound)
diff --git a/src/mame/video/mb60553.h b/src/mame/video/mb60553.h
index 248eca97e82..b958178054f 100644
--- a/src/mame/video/mb60553.h
+++ b/src/mame/video/mb60553.h
@@ -19,7 +19,6 @@ public:
void reg_written( int num_reg);
TILE_GET_INFO_MEMBER(get_tile_info);
void set_pal_base( int m_pal_base);
- void set_gfx_region( int m_gfx_region);
void draw( screen_device &screen, bitmap_ind16& bitmap, const rectangle &cliprect, int priority);
tilemap_t* get_tilemap();
@@ -44,7 +43,7 @@ protected:
private:
- UINT8 m_m_gfx_region;
+ UINT8 m_gfx_region;
required_device<gfxdecode_device> m_gfxdecode;
diff --git a/src/mame/video/mcd212.c b/src/mame/video/mcd212.c
index 5baa84b59e4..7ae7051916e 100644
--- a/src/mame/video/mcd212.c
+++ b/src/mame/video/mcd212.c
@@ -819,7 +819,7 @@ void mcd212_device::process_vsr(int channel, UINT8 *pixels_r, UINT8 *pixels_g, U
if(m_channel[channel].dcr & MCD212_DCR_CM)
{
// 4-bit Bitmap
- verboselog(machine, 0, "Unsupported display mode: 4-bit Bitmap\n" );
+ verboselog(machine, 0, "%s", "Unsupported display mode: 4-bit Bitmap\n" );
}
else
{
@@ -1000,7 +1000,7 @@ void mcd212_device::process_vsr(int channel, UINT8 *pixels_r, UINT8 *pixels_g, U
case MCD212_DDR_FT_RLE:
if(m_channel[channel].dcr & MCD212_DCR_CM)
{
- verboselog(machine, 0, "Unsupported display mode: 4-bit RLE\n" );
+ verboselog(machine, 0, "%s", "Unsupported display mode: 4-bit RLE\n" );
done = 1;
}
else
@@ -1427,7 +1427,7 @@ TIMER_CALLBACK_MEMBER( mcd212_device::perform_scan )
if(scanline == 0)
{
// Process ICA
- verboselog(machine, 6, "Frame Start\n" );
+ verboselog(machine, 6, "%s", "Frame Start\n" );
m_channel[0].csrr &= 0x7f;
for(int index = 0; index < 2; index++)
{
diff --git a/src/mame/video/micro3d.c b/src/mame/video/micro3d.c
index b1e41470df5..256624092b9 100644
--- a/src/mame/video/micro3d.c
+++ b/src/mame/video/micro3d.c
@@ -27,7 +27,7 @@ enum
{
STATE_DRAW_CMD,
STATE_DRAW_CMD_DATA,
- STATE_DRAW_VTX_DATA,
+ STATE_DRAW_VTX_DATA
};
diff --git a/src/mame/video/midzeus.c b/src/mame/video/midzeus.c
index 28582266053..f3694d1e23e 100644
--- a/src/mame/video/midzeus.c
+++ b/src/mame/video/midzeus.c
@@ -35,7 +35,7 @@
*
*************************************/
-struct poly_extra_data
+struct mz_poly_extra_data
{
const void * palbase;
const void * texbase;
@@ -260,7 +260,7 @@ VIDEO_START_MEMBER(midzeus_state,midzeus)
m_palette->set_pen_color(i, pal5bit(i >> 10), pal5bit(i >> 5), pal5bit(i >> 0));
/* initialize polygon engine */
- poly = poly_alloc(machine(), 10000, sizeof(poly_extra_data), POLYFLAG_ALLOW_QUADS);
+ poly = poly_alloc(machine(), 10000, sizeof(mz_poly_extra_data), POLYFLAG_ALLOW_QUADS);
/* we need to cleanup on exit */
machine().add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(midzeus_state::exit_handler), this));
@@ -623,7 +623,7 @@ void midzeus_state::zeus_register_update(offs_t offset)
// m_zeusbase[0x46] = ??? = 0x00000000
// m_zeusbase[0x4c] = ??? = 0x00808080 (brightness?)
// m_zeusbase[0x4e] = ??? = 0x00808080 (brightness?)
- poly_extra_data *extra = (poly_extra_data *)poly_get_extra_data(poly);
+ mz_poly_extra_data *extra = (mz_poly_extra_data *)poly_get_extra_data(poly);
poly_vertex vert[4];
vert[0].x = (INT16)m_zeusbase[0x08];
@@ -1084,7 +1084,7 @@ void midzeus_state::zeus_draw_model(UINT32 texdata, int logit)
void midzeus_state::zeus_draw_quad(int long_fmt, const UINT32 *databuffer, UINT32 texdata, int logit)
{
poly_draw_scanline_func callback;
- poly_extra_data *extra;
+ mz_poly_extra_data *extra;
poly_vertex clipvert[8];
poly_vertex vert[4];
float uscale, vscale;
@@ -1212,7 +1212,7 @@ void midzeus_state::zeus_draw_quad(int long_fmt, const UINT32 *databuffer, UINT3
clipvert[i].y += 0.0005f;
}
- extra = (poly_extra_data *)poly_get_extra_data(poly);
+ extra = (mz_poly_extra_data *)poly_get_extra_data(poly);
if ((ctrl_word & 0x000c0000) == 0x000c0000)
{
@@ -1269,7 +1269,7 @@ void midzeus_state::zeus_draw_quad(int long_fmt, const UINT32 *databuffer, UINT3
static void render_poly_texture(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid)
{
- const poly_extra_data *extra = (const poly_extra_data *)extradata;
+ const mz_poly_extra_data *extra = (const mz_poly_extra_data *)extradata;
INT32 curz = extent->param[0].start;
INT32 curu = extent->param[1].start;
INT32 curv = extent->param[2].start;
@@ -1305,12 +1305,11 @@ static void render_poly_texture(void *dest, INT32 scanline, const poly_extent *e
rgb_t color1 = WAVERAM_READ16(palbase, texel1);
rgb_t color2 = WAVERAM_READ16(palbase, texel2);
rgb_t color3 = WAVERAM_READ16(palbase, texel3);
- rgb_t filtered;
color0 = ((color0 & 0x7fe0) << 6) | (color0 & 0x1f);
color1 = ((color1 & 0x7fe0) << 6) | (color1 & 0x1f);
color2 = ((color2 & 0x7fe0) << 6) | (color2 & 0x1f);
color3 = ((color3 & 0x7fe0) << 6) | (color3 & 0x1f);
- filtered = rgb_bilinear_filter(color0, color1, color2, color3, curu, curv);
+ rgb_t filtered = rgbaint_t::bilinear_filter(color0, color1, color2, color3, curu, curv);
WAVERAM_WRITEPIX(zeus_renderbase, scanline, x, ((filtered >> 6) & 0x7fe0) | (filtered & 0x1f));
*depthptr = depth;
}
@@ -1325,7 +1324,7 @@ static void render_poly_texture(void *dest, INT32 scanline, const poly_extent *e
static void render_poly_shade(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid)
{
- const poly_extra_data *extra = (const poly_extra_data *)extradata;
+ const mz_poly_extra_data *extra = (const mz_poly_extra_data *)extradata;
int x;
for (x = extent->startx; x < extent->stopx; x++)
@@ -1352,7 +1351,7 @@ static void render_poly_shade(void *dest, INT32 scanline, const poly_extent *ext
static void render_poly_solid(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid)
{
- const poly_extra_data *extra = (const poly_extra_data *)extradata;
+ const mz_poly_extra_data *extra = (const mz_poly_extra_data *)extradata;
UINT16 color = extra->solidcolor;
INT32 curz = (INT32)(extent->param[0].start);
INT32 curv = extent->param[2].start;
@@ -1378,7 +1377,7 @@ static void render_poly_solid(void *dest, INT32 scanline, const poly_extent *ext
static void render_poly_solid_fixedz(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid)
{
- const poly_extra_data *extra = (const poly_extra_data *)extradata;
+ const mz_poly_extra_data *extra = (const mz_poly_extra_data *)extradata;
UINT16 color = extra->solidcolor;
UINT16 depth = extra->zoffset;
int x;
diff --git a/src/mame/video/midzeus2.c b/src/mame/video/midzeus2.c
index 99da14a5275..db96c9bf8e4 100644
--- a/src/mame/video/midzeus2.c
+++ b/src/mame/video/midzeus2.c
@@ -1289,16 +1289,15 @@ static void render_poly_8bit(void *dest, INT32 scanline, const poly_extent *exte
UINT8 texel3 = get_texel_8bit(texbase, v1, u1, texwidth);
if (texel0 != transcolor)
{
- rgb_t color0 = WAVERAM_READ16(palbase, texel0);
- rgb_t color1 = WAVERAM_READ16(palbase, texel1);
- rgb_t color2 = WAVERAM_READ16(palbase, texel2);
- rgb_t color3 = WAVERAM_READ16(palbase, texel3);
- rgb_t filtered;
+ UINT32 color0 = WAVERAM_READ16(palbase, texel0);
+ UINT32 color1 = WAVERAM_READ16(palbase, texel1);
+ UINT32 color2 = WAVERAM_READ16(palbase, texel2);
+ UINT32 color3 = WAVERAM_READ16(palbase, texel3);
color0 = ((color0 & 0x7c00) << 9) | ((color0 & 0x3e0) << 6) | ((color0 & 0x1f) << 3);
color1 = ((color1 & 0x7c00) << 9) | ((color1 & 0x3e0) << 6) | ((color1 & 0x1f) << 3);
color2 = ((color2 & 0x7c00) << 9) | ((color2 & 0x3e0) << 6) | ((color2 & 0x1f) << 3);
color3 = ((color3 & 0x7c00) << 9) | ((color3 & 0x3e0) << 6) | ((color3 & 0x1f) << 3);
- filtered = rgb_bilinear_filter(color0, color1, color2, color3, curu, curv);
+ rgb_t filtered = rgbaint_t::bilinear_filter(color0, color1, color2, color3, curu, curv);
WAVERAM_WRITEPIX(zeus_renderbase, scanline, x, filtered);
*depthptr = depth;
}
diff --git a/src/mame/video/model2.c b/src/mame/video/model2.c
index 106ba7f4aa0..56ba04cd024 100644
--- a/src/mame/video/model2.c
+++ b/src/mame/video/model2.c
@@ -139,7 +139,7 @@ struct quad_m2
UINT8 luma;
};
-struct poly_extra_data
+struct m2_poly_extra_data
{
model2_state * state;
UINT32 lumabase;
@@ -927,7 +927,7 @@ static const poly_draw_scanline_func render_funcs[8] =
static void model2_3d_render( model2_state *state, bitmap_rgb32 &bitmap, triangle *tri, const rectangle &cliprect )
{
legacy_poly_manager *poly = state->m_poly;
- poly_extra_data *extra = (poly_extra_data *)poly_get_extra_data(poly);
+ m2_poly_extra_data *extra = (m2_poly_extra_data *)poly_get_extra_data(poly);
UINT8 renderer;
/* select renderer based on attributes (bit15 = checker, bit14 = textured, bit13 = transparent */
@@ -2707,7 +2707,7 @@ VIDEO_START_MEMBER(model2_state,model2)
m_sys24_bitmap.allocate(width, height+4);
- m_poly = poly_alloc(machine(), 4000, sizeof(poly_extra_data), 0);
+ m_poly = poly_alloc(machine(), 4000, sizeof(m2_poly_extra_data), 0);
machine().add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(model2_state::model2_exit), this));
/* initialize the hardware rasterizer */
diff --git a/src/mame/video/model2rd.inc b/src/mame/video/model2rd.inc
index d646b8a3a11..07c744e08cc 100644
--- a/src/mame/video/model2rd.inc
+++ b/src/mame/video/model2rd.inc
@@ -59,7 +59,7 @@
static void MODEL2_FUNC_NAME(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid)
{
#if !defined( MODEL2_TRANSLUCENT)
- const poly_extra_data *extra = (const poly_extra_data *)extradata;
+ const m2_poly_extra_data *extra = (const m2_poly_extra_data *)extradata;
model2_state *state = extra->state;
bitmap_rgb32 *destmap = (bitmap_rgb32 *)dest;
UINT32 *p = &destmap->pix32(scanline);
@@ -111,7 +111,7 @@ static void MODEL2_FUNC_NAME(void *dest, INT32 scanline, const poly_extent *exte
/* textured render path */
static void MODEL2_FUNC_NAME(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid)
{
- const poly_extra_data *extra = (const poly_extra_data *)extradata;
+ const m2_poly_extra_data *extra = (const m2_poly_extra_data *)extradata;
model2_state *state = extra->state;
bitmap_rgb32 *destmap = (bitmap_rgb32 *)dest;
UINT32 *p = &destmap->pix32(scanline);
diff --git a/src/mame/video/model3.c b/src/mame/video/model3.c
index 70da1deaacf..4a1458d533a 100644
--- a/src/mame/video/model3.c
+++ b/src/mame/video/model3.c
@@ -5,6 +5,18 @@
#include "video/rgbutil.h"
#include "includes/model3.h"
+/*
+ TODO:
+ - Tilemap flash effect
+ - Fog
+ - Mipmapping
+ - Mipmap uploads smaller than a tile
+ - Some of the 4-bit and 8-bit textures need their alpha values rechecked
+ - Spotlights
+ - Recheck normal vector transform
+
+*/
+
#define ENABLE_BILINEAR 1
#define TRI_PARAM_TEXTURE_PAGE 0x1
@@ -12,8 +24,9 @@
#define TRI_PARAM_TEXTURE_MIRROR_V 0x4
#define TRI_PARAM_TEXTURE_ENABLE 0x8
#define TRI_PARAM_ALPHA_TEST 0x10
+#define TRI_PARAM_COLOR_MOD 0x20
-#define TRI_BUFFER_SIZE 35000
+#define TRI_BUFFER_SIZE 50000
#define TRI_ALPHA_BUFFER_SIZE 15000
struct model3_polydata
@@ -41,7 +54,9 @@ public:
void clear_fb();
void clear_zb();
void draw_scanline_solid(INT32 scanline, const extent_t &extent, const model3_polydata &extradata, int threadid);
+ void draw_scanline_solid_trans(INT32 scanline, const extent_t &extent, const model3_polydata &extradata, int threadid);
void draw_scanline_tex(INT32 scanline, const extent_t &extent, const model3_polydata &extradata, int threadid);
+ void draw_scanline_tex_colormod(INT32 scanline, const extent_t &extent, const model3_polydata &extradata, int threadid);
void draw_scanline_tex_contour(INT32 scanline, const extent_t &extent, const model3_polydata &extradata, int threadid);
void draw_scanline_tex_trans(INT32 scanline, const extent_t &extent, const model3_polydata &extradata, int threadid);
void draw_scanline_tex_alpha(INT32 scanline, const extent_t &extent, const model3_polydata &extradata, int threadid);
@@ -136,7 +151,7 @@ void model3_state::video_start()
static const gfx_layout char4_layout =
{
8, 8,
- 30720,
+ 31744,
4,
{ 0,1,2,3 },
{ 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4 },
@@ -147,7 +162,7 @@ void model3_state::video_start()
static const gfx_layout char8_layout =
{
8, 8,
- 15360,
+ 15872,
8,
{ 0,1,2,3,4,5,6,7 },
{ 4*8, 5*8, 6*8, 7*8, 0*8, 1*8, 2*8, 3*8 },
@@ -183,12 +198,6 @@ void model3_state::video_start()
m_vid_reg0 = 0;
- m_viewport_focal_length = 300.;
- m_viewport_region_x = 0;
- m_viewport_region_y = 0;
- m_viewport_region_width = 496;
- m_viewport_region_height = 384;
-
m_layer4[0] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(model3_state::tile_info_layer0_4bit), this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
m_layer8[0] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(model3_state::tile_info_layer0_8bit), this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
m_layer4[1] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(model3_state::tile_info_layer1_4bit), this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64);
@@ -253,14 +262,18 @@ void model3_state::draw_texture_sheet(bitmap_ind16 &bitmap, const rectangle &cli
}
#endif
-void model3_state::draw_layer(bitmap_rgb32 &bitmap, const rectangle &cliprect, int layer, int bitdepth, int sx, int sy)
+void model3_state::draw_layer(bitmap_rgb32 &bitmap, const rectangle &cliprect, int layer, int sx, int sy, int prio)
{
+ int bitdepth = (m_layer_priority & (0x10 << layer)) ? 1 : 0;
+// int layer_prio = (m_layer_priority & (0x1 << layer)) ? 1 : 0;
+
tilemap_t *tmap = bitdepth ? m_layer4[layer] : m_layer8[layer];
bitmap_ind16 &pixmap = tmap->pixmap();
const pen_t *pens = m_palette->pens();
UINT32* palram = (UINT32*)&m_paletteram64[0];
UINT16* rowscroll_ram = (UINT16*)&m_m3_char_ram[0x1ec00];
+ UINT32* rowmask_ram = (UINT32*)&m_m3_char_ram[0x1ee00];
int x1 = cliprect.min_x;
int y1 = cliprect.min_y;
@@ -287,6 +300,12 @@ void model3_state::draw_layer(bitmap_rgb32 &bitmap, const rectangle &cliprect, i
if (rowscroll & 0x100)
rowscroll |= ~0x1ff;
+ UINT16 rowmask;
+ if (prio && (layer == 1 || layer == 2))
+ rowmask = BYTE_REVERSE32(rowmask_ram[(y & 0x1ff) ^ NATIVE_ENDIAN_VALUE_LE_BE(1,0)]) & 0xffff;
+ else
+ rowmask = 0xffff;
+
int iix = ix & 0x1ff;
int rx1 = x1 - (rowscroll * 2);
@@ -302,10 +321,15 @@ void model3_state::draw_layer(bitmap_rgb32 &bitmap, const rectangle &cliprect, i
for (int x = rx1; x <= rx2; x++)
{
- UINT16 p0 = src[iix & 0x1ff];
- if ((palram[p0^NATIVE_ENDIAN_VALUE_LE_BE(1,0)] & NATIVE_ENDIAN_VALUE_LE_BE(0x00800000,0x00008000)) == 0)
+ UINT32 mask = rowmask & (1 << ((iix & 0x1ff) >> 5));
+
+ if (mask)
{
- dst[x] = pens[p0];
+ UINT16 p0 = src[iix & 0x1ff];
+ if ((palram[p0^NATIVE_ENDIAN_VALUE_LE_BE(1,0)] & NATIVE_ENDIAN_VALUE_LE_BE(0x00800000,0x00008000)) == 0)
+ {
+ dst[x] = pens[p0];
+ }
}
iix++;
}
@@ -339,26 +363,26 @@ UINT32 model3_state::screen_update_model3(screen_device &screen, bitmap_rgb32 &b
// render enabled layers with priority 0
if ((layer_data[3] & 0x80000000) && (m_layer_priority & 0x8) == 0)
- draw_layer(bitmap, cliprect, 3, m_layer_priority & 0x80, layer_scroll_x[3], layer_scroll_y[3]);
+ draw_layer(bitmap, cliprect, 3, layer_scroll_x[3], layer_scroll_y[3], 0);
if ((layer_data[2] & 0x80000000) && (m_layer_priority & 0x4) == 0)
- draw_layer(bitmap, cliprect, 2, m_layer_priority & 0x40, layer_scroll_x[2], layer_scroll_y[2]);
+ draw_layer(bitmap, cliprect, 2, layer_scroll_x[2], layer_scroll_y[2], 0);
if ((layer_data[1] & 0x80000000) && (m_layer_priority & 0x2) == 0)
- draw_layer(bitmap, cliprect, 1, m_layer_priority & 0x20, layer_scroll_x[1], layer_scroll_y[1]);
+ draw_layer(bitmap, cliprect, 1, layer_scroll_x[1], layer_scroll_y[1], 0);
if ((layer_data[0] & 0x80000000) && (m_layer_priority & 0x1) == 0)
- draw_layer(bitmap, cliprect, 0, m_layer_priority & 0x10, layer_scroll_x[0], layer_scroll_y[0]);
+ draw_layer(bitmap, cliprect, 0, layer_scroll_x[0], layer_scroll_y[0], 0);
// render 3D
m_renderer->draw(bitmap, cliprect);
// render enabled layers with priority 1
if ((layer_data[3] & 0x80000000) && (m_layer_priority & 0x8) != 0)
- draw_layer(bitmap, cliprect, 3, m_layer_priority & 0x80, layer_scroll_x[3], layer_scroll_y[3]);
+ draw_layer(bitmap, cliprect, 3, layer_scroll_x[3], layer_scroll_y[3], 1);
if ((layer_data[2] & 0x80000000) && (m_layer_priority & 0x4) != 0)
- draw_layer(bitmap, cliprect, 2, m_layer_priority & 0x40, layer_scroll_x[2], layer_scroll_y[2]);
- if ((layer_data[1] & 0x80000000) && (m_layer_priority & 0x2) != 0)
- draw_layer(bitmap, cliprect, 1, m_layer_priority & 0x20, layer_scroll_x[1], layer_scroll_y[1]);
+ draw_layer(bitmap, cliprect, 2, layer_scroll_x[2], layer_scroll_y[2], 1);
if ((layer_data[0] & 0x80000000) && (m_layer_priority & 0x1) != 0)
- draw_layer(bitmap, cliprect, 0, m_layer_priority & 0x10, layer_scroll_x[0], layer_scroll_y[0]);
+ draw_layer(bitmap, cliprect, 0, layer_scroll_x[0], layer_scroll_y[0], 1);
+ if ((layer_data[1] & 0x80000000) && (m_layer_priority & 0x2) != 0)
+ draw_layer(bitmap, cliprect, 1, layer_scroll_x[1], layer_scroll_y[1], 1);
return 0;
}
@@ -422,7 +446,8 @@ WRITE64_MEMBER(model3_state::model3_tile_w)
0xF1180010: VBL IRQ acknowledge
- 0xF1180020: -------- x------- -------- -------- Layer 3 bitdepth (0 = 8-bit, 1 = 4-bit)
+ 0xF1180020: xxxxxxxx -------- -------- -------- ?
+ -------- x------- -------- -------- Layer 3 bitdepth (0 = 8-bit, 1 = 4-bit)
-------- -x------ -------- -------- Layer 2 bitdepth (0 = 8-bit, 1 = 4-bit)
-------- --x----- -------- -------- Layer 1 bitdepth (0 = 8-bit, 1 = 4-bit)
-------- ---x---- -------- -------- Layer 0 bitdepth (0 = 8-bit, 1 = 4-bit)
@@ -571,50 +596,53 @@ cached_texture *model3_state::get_texture(int page, int texx, int texy, int texw
}
break;
- case 1: /* 4-bit grayscale in low nibble */
+ case 1: /* A4L4 interleaved */
for (x = 0; x < pixwidth; x++)
{
- UINT8 grayvalue = pal4bit(texsrc[x] >> 0);
- alpha &= dest[x] = rgb_t(0xff, grayvalue, grayvalue, grayvalue);
+ UINT8 grayvalue = pal4bit(texsrc[x] & 0xf);
+ UINT8 a = pal4bit((texsrc[x] >> 4) & 0xf);
+ alpha &= dest[x] = rgb_t(a, grayvalue, grayvalue, grayvalue);
}
break;
- case 2: /* 4-bit grayscale in 2nd nibble */
+ case 2: /* A4L4? */
for (x = 0; x < pixwidth; x++)
{
- UINT8 grayvalue = pal4bit(texsrc[x] >> 4);
- alpha &= dest[x] = rgb_t(0xff, grayvalue, grayvalue, grayvalue);
+ UINT8 grayvalue = pal4bit((texsrc[x] >> 0) & 0xf);
+ UINT8 a = pal4bit((texsrc[x] >> 4) & 0xf);
+ alpha &= dest[x] = rgb_t(a, grayvalue, grayvalue, grayvalue);
}
break;
- case 3: /* 4-bit grayscale in 3rd nibble */
+ case 3: /* A4L4 interleaved */
for (x = 0; x < pixwidth; x++)
{
- UINT8 grayvalue = pal4bit(texsrc[x] >> 8);
- alpha &= dest[x] = rgb_t(0xff, grayvalue, grayvalue, grayvalue);
+ UINT8 grayvalue = pal4bit((texsrc[x] >> 8) & 0xf);
+ UINT8 a = pal4bit((texsrc[x] >> 12) & 0xf);
+ alpha &= dest[x] = rgb_t(a, grayvalue, grayvalue, grayvalue);
}
break;
case 4: /* 8-bit A4L4 */
for (x = 0; x < pixwidth; x++)
{
- UINT8 pixdata = texsrc[x / 2] >> ((~x & 1) * 8);
- alpha &= dest[x] = rgb_t(pal4bit(pixdata >> 4), pal4bit(~pixdata), pal4bit(~pixdata), pal4bit(~pixdata));
+ UINT8 pixdata = texsrc[x] >> 8;
+ alpha &= dest[x] = rgb_t(pal4bit(pixdata), pal4bit(pixdata >> 4), pal4bit(pixdata >> 4), pal4bit(pixdata >> 4));
}
break;
- case 5: /* 8-bit grayscale */
+ case 5: /* L8 */
for (x = 0; x < pixwidth; x++)
{
- UINT8 grayvalue = texsrc[x / 2] >> ((~x & 1) * 8);
+ UINT8 grayvalue = texsrc[x];
alpha &= dest[x] = rgb_t(0xff, grayvalue, grayvalue, grayvalue);
}
break;
- case 6: /* 4-bit grayscale in high nibble */
+ case 6: /* L8 */
for (x = 0; x < pixwidth; x++)
{
- UINT8 grayvalue = pal4bit(texsrc[x] >> 12);
+ UINT8 grayvalue = texsrc[x] >> 8;
alpha &= dest[x] = rgb_t(0xff, grayvalue, grayvalue, grayvalue);
}
break;
@@ -688,23 +716,23 @@ cached_texture *model3_state::get_texture(int page, int texx, int texy, int texw
0x01: Child node pointer (inherits parameters from this node)
0x02: Sibling node pointer
- 0x03: Unknown (float)
+ 0x03: (float) Focal length? Affected by frustum angles and viewport size
0x04: Sun light vector Z-component (float)
0x05: Sun light vector X-component (float)
0x06: Sun light vector Y-component (float)
0x07: Sun light intensity (float)
- 0x08: Far Clip plane Z
- 0x09: Far Clip plane Distance
- 0x0a: Near Clip plane Z
- 0x0b: Near Clip plane Distance
- 0x0c: Left Clip plane Z
- 0x0d: Left Clip plane X
- 0x0e: Top Clip plane Z
- 0x0f: Top Clip plane Y
- 0x10: Right Clip plane Z
- 0x11: Right Clip plane X
- 0x12: Bottom Clip plane Z
- 0x13: Bottom Clip plane Y
+ 0x08: ? (float) Affected by left and right angle
+ 0x09: ? (float) Affected by top and bottom angle
+ 0x0a: ? (float) Affected by top and bottom angle
+ 0x0b: ? (float) Affected by left and right angle
+ 0x0c: (float) Frustum Left Angle Y (these angles are defined in polar coordinates)
+ 0x0d: (float) Frustum Left Angle X
+ 0x0e: (float) Frustum Top Angle Y
+ 0x0f: (float) Frustum Top Angle X
+ 0x10: (float) Frustum Right Angle Y
+ 0x11: (float) Frustum Right Angle X
+ 0x12: (float) Frustum Bottom Angle Y
+ 0x13: (float) Frustum Bottom Angle X
0x14: xxxxxxxx xxxxxxxx -------- -------- Viewport height (14.2 fixed-point)
-------- -------- xxxxxxxx xxxxxxxx Viewport width (14.2 fixed-point)
@@ -735,7 +763,7 @@ cached_texture *model3_state::get_texture(int page, int texx, int texy, int texw
-------- -------- -----xxx -------- Light RGB Fog (RGB111?)
-------- -------- -------- xxxxxxxx Scroll Fog (0.8 fixed-point?) What is this???
- 0x21: ?
+ 0x21: ? seen 8.0, 0.125, 1000000000.0
0x22: Fog Color (RGB888)
0x23: Fog Density (float)
@@ -818,19 +846,24 @@ cached_texture *model3_state::get_texture(int page, int texx, int texy, int texw
Polygon Data
- 0x00: -------- xxxxxxxx xxxxxx-- -------- Polygon ID
+ 0x00: x------- -------- -------- -------- Supermodel says specular enable
+ -xxxxx-- -------- -------- -------- ?
+ ------xx xxxxxxxx xxxxxx-- -------- Polygon ID
-------- -------- -------- -x------ 0 = Triangle, 1 = Quad
-------- -------- -------- ----x--- Vertex 3 shared from previous polygon
-------- -------- -------- -----x-- Vertex 2 shared from previous polygon
-------- -------- -------- ------x- Vertex 1 shared from previous polygon
-------- -------- -------- -------x Vertex 0 shared from previous polygon
- xxxxxxxx -------- -------- x-xx---- ?
+ -------- -------- -------- x-xx---- ?
-------- -------- ------xx -------- Broken polygons in srally2 set these (a way to mark them for HW to not render?)
0x01: xxxxxxxx xxxxxxxx xxxxxxxx -------- Polygon normal X coordinate (2.22 fixed point)
-------- -------- -------- -x------ UV format (0 = 13.3, 1 = 16.0)
+ -------- -------- -------- ---x---- 1 = Double-sided polygon
-------- -------- -------- -----x-- If set, this is the last polygon
- -------- -------- -------- x-xxx-xx ?
+ -------- -------- -------- ------x- Poly color, 1 = RGB, 0 = color table
+ -------- -------- -------- x-x-x--x ?
+
0x02: xxxxxxxx xxxxxxxx xxxxxxxx -------- Polygon normal Y coordinate (2.22 fixed point)
-------- -------- -------- ------x- Texture U mirror enable
@@ -844,7 +877,8 @@ cached_texture *model3_state::get_texture(int page, int texx, int texy, int texw
0x04: xxxxxxxx xxxxxxxx xxxxxxxx -------- Color (RGB888)
-------- -------- -------- -x------ Texture page
-------- -------- -------- ---xxxxx Upper 5 bits of texture U coordinate
- -------- -------- -------- x-x----- ?
+ -------- -------- -------- x------- ?
+ -------- -------- -------- --x----- ?
0x05: xxxxxxxx xxxxxxxx xxxxxxxx -------- Specular color?
-------- -------- -------- x------- Low bit of texture U coordinate
@@ -852,15 +886,28 @@ cached_texture *model3_state::get_texture(int page, int texx, int texy, int texw
-------- -------- -------- -xx----- ?
0x06: x------- -------- -------- -------- Texture contour enable
- -xxxxxxx -------- -------- -------- Specularity?
+ -xxxxx-- -------- -------- -------- Fixed shading?
+ ------x- -------- -------- -------- Enable fixed shading?
+ -------x -------- -------- -------- Could be high priority polygon?
-------- x------- -------- -------- 1 = disable transparency?
- -------- -xxxxx-- -------- -------- Polygon transparency (0 = fully transparent)
+ -------- -xxxxx-- -------- -------- Polygon translucency (0 = fully transparent)
-------- -------x -------- -------- 1 = disable lighting
- -------- -------- xxxxx--- -------- Polygon luminosity
+ -------- -------- xxxxx--- -------- Polygon light modifier (Amount that a luminous polygon will burn through fog.
+ Valid range is 0.0 to 1.0. 0.0 is completely fogged;
+ 1.0 has no fog.)
-------- -------- -----x-- -------- Texture enable
-------- -------- ------xx x------- Texture format
-------- -------- -------- -------x Alpha enable?
- -------- ------x- -------- -xxxxxx- ?
+ -------- ------x- -------- -------- Never seen set?
+ -------- -------- -------- -----xx- Always set?
+ -------- -------- -------- -xxxx--- ?
+
+ TODO: Bits to find (from Real3D dev guide):
+ SetHighPriority(): Indicates that the polygon has higher priority than others in scene
+ PolygonIsLayered(): Indicates a stencil polygon.
+ DoSmoothShading(): Indicates that the polygon will be smooth shaded
+ void SetNPScale ( float np_scale ) ; Sets the texture lod scale for the polygon. A value greater than 1 will increase the
+ range of the transition of texture level of detail.
Vertex entry
@@ -904,7 +951,7 @@ WRITE64_MEMBER(model3_state::real3d_polygon_ram_w)
}
}
-static const UINT8 texture_decode[64] =
+static const UINT8 texture_decode16[64] =
{
0, 1, 4, 5, 8, 9, 12, 13,
2, 3, 6, 7, 10, 11, 14, 15,
@@ -916,6 +963,18 @@ static const UINT8 texture_decode[64] =
50, 51, 54, 55, 58, 59, 62, 63
};
+static const UINT8 texture_decode8[32] =
+{
+ 1, 3, 5, 7,
+ 0, 2, 4, 6,
+ 9, 11, 13, 15,
+ 8, 10, 12, 14,
+ 17, 19, 21, 23,
+ 16, 18, 20, 22,
+ 25, 27, 29, 31,
+ 24, 26, 28, 30
+};
+
inline void model3_state::write_texture16(int xpos, int ypos, int width, int height, int page, UINT16 *data)
{
int x,y,i,j;
@@ -928,7 +987,7 @@ inline void model3_state::write_texture16(int xpos, int ypos, int width, int hei
int b = 0;
for(j=y; j < y+8; j++) {
for(i=x; i < x+8; i++) {
- *texture++ = data[texture_decode[b^1]];
+ *texture++ = data[texture_decode16[b^1]];
++b;
}
texture += 2048-8;
@@ -938,28 +997,76 @@ inline void model3_state::write_texture16(int xpos, int ypos, int width, int hei
}
}
-#ifdef UNUSED_FUNCTION
-inline void model3_state::write_texture8(int xpos, int ypos, int width, int height, int page, UINT16 *data)
+inline void model3_state::write_texture8(int xpos, int ypos, int width, int height, int page, int upper, int lower, UINT16 *data)
{
int x,y,i,j;
- UINT16 color = 0x7c00;
- for(y=ypos; y < ypos+(height/2); y+=4)
+ for(y=ypos; y < ypos+height; y+=8)
{
for(x=xpos; x < xpos+width; x+=8)
{
UINT16 *texture = &m_texture_ram[page][y*2048+x];
- for(j=y; j < y+4; j++) {
- for(i=x; i < x+8; i++) {
- *texture = color;
+ int b = 0;
+ for(j=y; j < y+8; j++)
+ {
+ for(i=x; i < x+8; i+=2)
+ {
+ UINT16 d = data[texture_decode8[b]];
+
+ if (upper)
+ *texture = (*texture & 0xff) | (d & 0xff00);
+ if (lower)
+ *texture = (*texture & 0xff00) | ((d >> 8) & 0xff);
+ texture++;
+
+ if (upper)
+ *texture = (*texture & 0xff) | ((d & 0xff) << 8);
+ if (lower)
+ *texture = (*texture & 0xff00) | (d & 0xff);
texture++;
+
+ ++b;
}
texture += 2048-8;
}
+ data += 32;
}
}
}
-#endif
+
+/*
+ Texture header:
+
+ -------- -------- -------- --xxxxxx X-position
+ -------- -------- ----xxxx x------- Y-position
+ -------- -------x xx------ -------- Width
+ -------- ----xxx- -------- -------- Height
+ -------- ---x---- -------- -------- Texture page
+ -------- --x----- -------- -------- Write 8-bit data to the lower byte of texel
+ -------- -x------ -------- -------- Write 8-bit data to the upper byte of texel
+ -------- x------- -------- -------- Bitdepth, 0 = 8-bit, 1 = 16-bit
+ xxxxxxxx -------- -------- -------- Texture type
+ 0x00 = texture with mipmaps
+ 0x01 = texture without mipmaps
+ 0x02 = only mipmaps
+ 0x80 = possibly gamma table
+
+*/
+
+static const int mipmap_coords[9][2] =
+{
+ { 1024, 512 },
+ { 1536, 768 },
+ { 1792, 896 },
+ { 1920, 960 },
+ { 1984, 992 },
+ { 2016, 1008 },
+ { 2032, 1016 },
+ { 2040, 1020 },
+ { 2044, 1022 },
+};
+
+static const int mipmap_divider[9] = { 2, 4, 8, 16, 32, 64, 128, 256, 512 };
void model3_state::real3d_upload_texture(UINT32 header, UINT32 *data)
{
@@ -968,36 +1075,100 @@ void model3_state::real3d_upload_texture(UINT32 header, UINT32 *data)
int xpos = (header & 0x3f) * 32;
int ypos = ((header >> 7) & 0x1f) * 32;
int page = (header >> 20) & 0x1;
- //int bitdepth = (header >> 23) & 0x1;
+ int bitdepth = (header >> 23) & 0x1;
+ int upper_byte = (header >> 22) & 0x1;
+ int lower_byte = (header >> 21) & 0x1;
+
+ //printf("write tex: %08X, w %d, h %d, x %d, y %d, p %d, b %d\n", header, width, height, xpos, ypos, page, bitdepth);
switch(header >> 24)
{
case 0x00: /* Texture with mipmaps */
- //if(bitdepth) {
- write_texture16(xpos, ypos, width, height, page, (UINT16*)data);
- invalidate_texture(page, header & 0x3f, (header >> 7) & 0x1f, (header >> 14) & 0x7, (header >> 17) & 0x7);
- //} else {
- /* TODO: 8-bit textures are weird. need to figure out some additional bits */
- //logerror("W: %d, H: %d, X: %d, Y: %d, P: %d, Bit: %d, : %08X, %08X\n", width, height, xpos, ypos, page, bitdepth, header & 0x00681040, header);
- //write_texture8(xpos, ypos, width, height, page, (UINT16*)data);
- //}
+ {
+ int x = xpos;
+ int y = ypos;
+ int w = width;
+ int h = height;
+
+ int mipmap = 0;
+
+ while (w >= 8 && h >= 8)
+ {
+ if (bitdepth)
+ {
+ write_texture16(x, y, w, h, page, (UINT16*)data);
+ }
+ else
+ {
+ //printf("write tex8: %08X, w %d, h %d, x %d, y %d, p %d, b %d\n", header, width, height, xpos, ypos, page, bitdepth);
+ write_texture8(x, y, w, h, page, upper_byte, lower_byte, (UINT16*)data);
+ }
+
+ data += (w * h * (bitdepth ? 2 : 1)) / 4;
+ w /= 2;
+ h /= 2;
+
+ x = mipmap_coords[mipmap][0] + (xpos / mipmap_divider[mipmap]);
+ y = mipmap_coords[mipmap][1] + (ypos / mipmap_divider[mipmap]);
+ mipmap++;
+ }
+
+ invalidate_texture(page, header & 0x3f, (header >> 7) & 0x1f, (header >> 14) & 0x7, (header >> 17) & 0x7);
break;
+ }
case 0x01: /* Texture without mipmaps */
- //if(bitdepth) {
+ {
+ if (bitdepth)
+ {
write_texture16(xpos, ypos, width, height, page, (UINT16*)data);
- invalidate_texture(page, header & 0x3f, (header >> 7) & 0x1f, (header >> 14) & 0x7, (header >> 17) & 0x7);
- //} else {
- /* TODO: 8-bit textures are weird. need to figure out some additional bits */
- //logerror("W: %d, H: %d, X: %d, Y: %d, P: %d, Bit: %d, : %08X, %08X\n", width, height, xpos, ypos, page, bitdepth, header & 0x00681040, header);
- //write_texture8(xpos, ypos, width, height, page, (UINT16*)data);
- //}
+ }
+ else
+ {
+ //printf("write tex8: %08X, w %d, h %d, x %d, y %d, p %d, b %d\n", header, width, height, xpos, ypos, page, bitdepth);
+ write_texture8(xpos, ypos, width, height, page, upper_byte, lower_byte, (UINT16*)data);
+ }
+
+ invalidate_texture(page, header & 0x3f, (header >> 7) & 0x1f, (header >> 14) & 0x7, (header >> 17) & 0x7);
break;
+ }
case 0x02: /* Only mipmaps */
+ {
+ int x = mipmap_coords[0][0] + (xpos / mipmap_divider[0]);
+ int y = mipmap_coords[0][1] + (ypos / mipmap_divider[0]);
+ int w = width / 2;
+ int h = height / 2;
+
+ int mipmap = 1;
+
+ while (w >= 8 && h >= 8)
+ {
+ if (bitdepth)
+ {
+ write_texture16(x, y, w, h, page, (UINT16*)data);
+ }
+ else
+ {
+ //printf("write tex8: %08X, w %d, h %d, x %d, y %d, p %d, b %d\n", header, width, height, xpos, ypos, page, bitdepth);
+ write_texture8(x, y, w, h, page, upper_byte, lower_byte, (UINT16*)data);
+ }
+
+ data += (w * h * (bitdepth ? 2 : 1)) / 4;
+ w /= 2;
+ h /= 2;
+
+ x = mipmap_coords[mipmap][0] + (xpos / mipmap_divider[mipmap]);
+ y = mipmap_coords[mipmap][1] + (ypos / mipmap_divider[mipmap]);
+ mipmap++;
+ }
+
+ invalidate_texture(page, header & 0x3f, (header >> 7) & 0x1f, (header >> 14) & 0x7, (header >> 17) & 0x7);
break;
+ }
case 0x80: /* Gamma-table ? */
break;
default:
- fatalerror("Unknown texture type: %02X\n", header >> 24);
+ fatalerror("Unknown texture type: %02X (%08X)\n", header >> 24, header);
+ break;
}
}
@@ -1022,13 +1193,6 @@ void model3_state::real3d_display_list_end()
reset_triangle_buffers();
real3d_traverse_display_list();
- /*
- m_renderer->draw_opaque_triangles(m_tri_buffer, m_tri_buffer_ptr);
- m_renderer->draw_alpha_triangles(m_tri_alpha_buffer, m_tri_alpha_buffer_ptr);
-
- m_renderer->wait_for_polys();
- */
-
for (int i=0; i < 4; i++)
{
int ticount, tiacount;
@@ -1241,78 +1405,145 @@ void model3_state::translate_matrix_stack(float x, float y, float z)
matrix_multiply(tm, m_matrix_stack[m_matrix_stack_ptr], &m_matrix_stack[m_matrix_stack_ptr]);
}
+void model3_state::set_projection(float left, float right, float top, float bottom, float near, float far)
+{
+ float l = near * tanf(left * 0.5f);
+ float r = near * tanf(right * 0.5f);
+ float t = near * tanf(top * 0.5f );
+ float b = near * tanf(bottom * 0.5f);
+
+ m_projection_matrix[0][0] = (2.0f * near) / (l - r);
+ m_projection_matrix[0][1] = 0.0f;
+ m_projection_matrix[0][2] = (r + l) / (r - l);
+ m_projection_matrix[0][3] = 0.0f;
+ m_projection_matrix[1][0] = 0.0f;
+ m_projection_matrix[1][1] = (2.0f * near) / (t - b);
+ m_projection_matrix[1][2] = (t + b) / (t - b);
+ m_projection_matrix[1][3] = 0.0f;
+ m_projection_matrix[2][0] = 0.0f;
+ m_projection_matrix[2][1] = 0.0f;
+ m_projection_matrix[2][2] = -(far + near) / (far - near);
+ m_projection_matrix[2][3] = -(2.0f * far * near) / (far - near);
+ m_projection_matrix[3][0] = 0.0f;
+ m_projection_matrix[3][1] = 0.0f;
+ m_projection_matrix[3][2] = -1.0f;
+ m_projection_matrix[3][3] = 0.0f;
+}
+
/*****************************************************************************/
/* transformation and rasterizing */
-INLINE bool is_point_inside(float x, float y, float z, m3_plane cp)
+static int clip_w(const m3_clip_vertex* v, int num_vertices, m3_clip_vertex* out)
{
- float s = (x * cp.x) + (y * cp.y) + (z * cp.z) + cp.d;
- if (s >= 0.0f)
- return true;
- else
- return false;
-}
+ if (num_vertices <= 0)
+ return 0;
-INLINE float line_plane_intersection(const m3_clip_vertex *v1, const m3_clip_vertex *v2, m3_plane cp)
-{
- float x = v1->x - v2->x;
- float y = v1->y - v2->y;
- float z = v1->z - v2->z;
- float t = ((cp.x * v1->x) + (cp.y * v1->y) + (cp.z * v1->z)) / ((cp.x * x) + (cp.y * y) + (cp.z * z));
- return t;
-}
+ const float W_PLANE = 0.000001f;
-static int clip_polygon(const m3_clip_vertex *v, int num_vertices, m3_plane cp, m3_clip_vertex *vout)
-{
m3_clip_vertex clipv[10];
int clip_verts = 0;
- float t;
- int i;
int previ = num_vertices - 1;
- for (i=0; i < num_vertices; i++)
+ for (int i=0; i < num_vertices; i++)
{
- bool v1_in = is_point_inside(v[i].x, v[i].y, v[i].z, cp);
- bool v2_in = is_point_inside(v[previ].x, v[previ].y, v[previ].z, cp);
+ int v1_side = (v[i].w < W_PLANE) ? -1 : 1;
+ int v2_side = (v[previ].w < W_PLANE) ? -1 : 1;
- if (v1_in && v2_in) /* edge is completely inside the volume */
+ if ((v1_side * v2_side) < 0) // edge goes through W plane
{
- clipv[clip_verts] = v[i];
+ // insert vertex at intersection point
+ float wdiv = v[previ].w - v[i].w;
+ if (wdiv == 0.0f) // 0 edge means degenerate polygon
+ return 0;
+
+ float t = fabs((W_PLANE - v[previ].w) / wdiv);
+
+ clipv[clip_verts].x = v[previ].x + ((v[i].x - v[previ].x) * t);
+ clipv[clip_verts].y = v[previ].y + ((v[i].y - v[previ].y) * t);
+ clipv[clip_verts].z = v[previ].z + ((v[i].z - v[previ].z) * t);
+ clipv[clip_verts].w = v[previ].w + ((v[i].w - v[previ].w) * t);
+ clipv[clip_verts].u = v[previ].u + ((v[i].u - v[previ].u) * t);
+ clipv[clip_verts].v = v[previ].v + ((v[i].v - v[previ].v) * t);
+ clipv[clip_verts].i = v[previ].i + ((v[i].i - v[previ].i) * t);
+ clipv[clip_verts].s = v[previ].s + ((v[i].s - v[previ].s) * t);
++clip_verts;
}
- else if (!v1_in && v2_in) /* edge is entering the volume */
+ if (v1_side > 0) // current point is inside
{
- /* insert vertex at intersection point */
- t = line_plane_intersection(&v[i], &v[previ], cp);
- clipv[clip_verts].x = v[i].x + ((v[previ].x - v[i].x) * t);
- clipv[clip_verts].y = v[i].y + ((v[previ].y - v[i].y) * t);
- clipv[clip_verts].z = v[i].z + ((v[previ].z - v[i].z) * t);
- clipv[clip_verts].u = v[i].u + ((v[previ].u - v[i].u) * t);
- clipv[clip_verts].v = v[i].v + ((v[previ].v - v[i].v) * t);
- clipv[clip_verts].i = v[i].i + ((v[previ].i - v[i].i) * t);
+ clipv[clip_verts] = v[i];
++clip_verts;
}
- else if (v1_in && !v2_in) /* edge is leaving the volume */
+
+ previ = i;
+ }
+
+ memcpy(&out[0], &clipv[0], sizeof(out[0]) * clip_verts);
+ return clip_verts;
+}
+
+static int clip(const m3_clip_vertex* v, int num_vertices, m3_clip_vertex* out, int axis, int sign)
+{
+ if (num_vertices <= 0)
+ return 0;
+
+ m3_clip_vertex clipv[10];
+ int clip_verts = 0;
+
+ int previ = num_vertices - 1;
+
+ for (int i=0; i < num_vertices; i++)
+ {
+ int v1_side, v2_side;
+ float* v1a = (float*)&v[i];
+ float* v2a = (float*)&v[previ];
+
+ float v1_axis, v2_axis;
+
+ if (sign) // +axis
+ {
+ v1_axis = v1a[axis];
+ v2_axis = v2a[axis];
+ }
+ else // -axis
{
- /* insert vertex at intersection point */
- t = line_plane_intersection(&v[i], &v[previ], cp);
- clipv[clip_verts].x = v[i].x + ((v[previ].x - v[i].x) * t);
- clipv[clip_verts].y = v[i].y + ((v[previ].y - v[i].y) * t);
- clipv[clip_verts].z = v[i].z + ((v[previ].z - v[i].z) * t);
- clipv[clip_verts].u = v[i].u + ((v[previ].u - v[i].u) * t);
- clipv[clip_verts].v = v[i].v + ((v[previ].v - v[i].v) * t);
- clipv[clip_verts].i = v[i].i + ((v[previ].i - v[i].i) * t);
- ++clip_verts;
+ v1_axis = -v1a[axis];
+ v2_axis = -v2a[axis];
+ }
+
+ v1_side = (v1_axis <= v[i].w) ? 1 : -1;
+ v2_side = (v2_axis <= v[previ].w) ? 1 : -1;
- /* insert the existing vertex */
+ if ((v1_side * v2_side) < 0) // edge goes through W plane
+ {
+ // insert vertex at intersection point
+ float wdiv = ((v[previ].w - v2_axis) - (v[i].w - v1_axis));
+
+ if (wdiv == 0.0f) // 0 edge means degenerate polygon
+ return 0;
+
+ float t = fabs((v[previ].w - v2_axis) / wdiv);
+
+ clipv[clip_verts].x = v[previ].x + ((v[i].x - v[previ].x) * t);
+ clipv[clip_verts].y = v[previ].y + ((v[i].y - v[previ].y) * t);
+ clipv[clip_verts].z = v[previ].z + ((v[i].z - v[previ].z) * t);
+ clipv[clip_verts].w = v[previ].w + ((v[i].w - v[previ].w) * t);
+ clipv[clip_verts].u = v[previ].u + ((v[i].u - v[previ].u) * t);
+ clipv[clip_verts].v = v[previ].v + ((v[i].v - v[previ].v) * t);
+ clipv[clip_verts].i = v[previ].i + ((v[i].i - v[previ].i) * t);
+ clipv[clip_verts].s = v[previ].s + ((v[i].s - v[previ].s) * t);
+ ++clip_verts;
+ }
+ if (v1_side > 0) // current point is inside
+ {
clipv[clip_verts] = v[i];
++clip_verts;
}
previ = i;
}
- memcpy(&vout[0], &clipv[0], sizeof(vout[0]) * clip_verts);
+
+ memcpy(&out[0], &clipv[0], sizeof(out[0]) * clip_verts);
return clip_verts;
}
@@ -1368,7 +1599,14 @@ void model3_state::draw_model(UINT32 addr)
m3_clip_vertex clip_vert[10];
MATRIX transform_matrix;
- float center_x, center_y;
+ MATRIX vp_matrix;
+ MATRIX coord_matrix;
+
+ memset(&coord_matrix, 0, sizeof(coord_matrix));
+ coord_matrix[0][0] = m_coordinate_system[0][1];
+ coord_matrix[1][1] = m_coordinate_system[1][2];
+ coord_matrix[2][2] = -m_coordinate_system[2][0];
+ coord_matrix[3][3] = 1.0f;
if (m_step < 0x15) // position coordinates are 17.7 fixed-point in Step 1.0
fixed_point_fraction = 1.0f / 128.0f;
@@ -1377,9 +1615,9 @@ void model3_state::draw_model(UINT32 addr)
get_top_matrix(&transform_matrix);
- /* current viewport center coordinates on screen */
- center_x = (float)(m_viewport_region_x + (m_viewport_region_width / 2));
- center_y = (float)(m_viewport_region_y + (m_viewport_region_height / 2));
+ // make view-projection matrix
+ matrix_multiply(transform_matrix, coord_matrix, &transform_matrix);
+ matrix_multiply(transform_matrix, m_projection_matrix, &vp_matrix);
memset(prev_vertex, 0, sizeof(prev_vertex));
@@ -1448,24 +1686,29 @@ void model3_state::draw_model(UINT32 addr)
/* Copy current vertices as previous vertices */
memcpy(prev_vertex, vertex, sizeof(m3_vertex) * 4);
- color = (header[4] >> 8) & 0xffffff;
+ if (header[1] & 0x2)
+ {
+ color = (header[4] >> 8) & 0xffffff;
+ }
+ else
+ {
+ int ci = (header[4] >> 8) & 0x7ff;
+ color = m_polygon_ram[0x400 + ci];
+ }
+
polygon_transparency = (header[6] & 0x800000) ? 32 : ((header[6] >> 18) & 0x1f);
/* transform polygon normal to view-space */
sn[0] = (normal[0] * transform_matrix[0][0]) +
- (normal[1] * transform_matrix[1][0]) +
- (normal[2] * transform_matrix[2][0]);
- sn[1] = (normal[0] * transform_matrix[0][1]) +
+ (normal[1] * transform_matrix[0][1]) +
+ (normal[2] * transform_matrix[0][2]);
+ sn[1] = (normal[0] * transform_matrix[1][0]) +
(normal[1] * transform_matrix[1][1]) +
- (normal[2] * transform_matrix[2][1]);
- sn[2] = (normal[0] * transform_matrix[0][2]) +
- (normal[1] * transform_matrix[1][2]) +
+ (normal[2] * transform_matrix[1][2]);
+ sn[2] = (normal[0] * transform_matrix[2][0]) +
+ (normal[1] * transform_matrix[2][1]) +
(normal[2] * transform_matrix[2][2]);
- sn[0] *= m_coordinate_system[0][1];
- sn[1] *= m_coordinate_system[1][2];
- sn[2] *= m_coordinate_system[2][0];
-
// TODO: depth bias
// transform and light vertices
for (i = 0; i < num_vertices; i++)
@@ -1477,36 +1720,38 @@ void model3_state::draw_model(UINT32 addr)
vect[2] = vertex[i].z;
vect[3] = 1.0f;
- // transform to world-space
- matrix_multiply_vector(transform_matrix, vect, &p[i]);
+ // transform to projection space
+ matrix_multiply_vector(vp_matrix, vect, &p[i]);
- // apply coordinate system
- clip_vert[i].x = p[i][0] * m_coordinate_system[0][1];
- clip_vert[i].y = p[i][1] * m_coordinate_system[1][2];
- clip_vert[i].z = p[i][2] * m_coordinate_system[2][0];
- clip_vert[i].u = vertex[i].u * texture_coord_scale;
- clip_vert[i].v = vertex[i].v * texture_coord_scale;
+ clip_vert[i].x = p[i][0];
+ clip_vert[i].y = p[i][1];
+ clip_vert[i].z = p[i][2];
+ clip_vert[i].w = p[i][3];
+
+ clip_vert[i].u = vertex[i].u * texture_coord_scale * 256.0f; // 8 bits of subtexel accuracy for bilinear filtering
+ clip_vert[i].v = vertex[i].v * texture_coord_scale * 256.0f;
// transform vertex normal
VECTOR3 n;
n[0] = (vertex[i].nx * transform_matrix[0][0]) +
- (vertex[i].ny * transform_matrix[1][0]) +
- (vertex[i].nz * transform_matrix[2][0]);
- n[0] *= m_coordinate_system[0][1];
- n[1] = (vertex[i].nx * transform_matrix[0][1]) +
+ (vertex[i].ny * transform_matrix[0][1]) +
+ (vertex[i].nz * transform_matrix[0][2]);
+ n[1] = (vertex[i].nx * transform_matrix[1][0]) +
(vertex[i].ny * transform_matrix[1][1]) +
- (vertex[i].nz * transform_matrix[2][1]);
- n[1] *= m_coordinate_system[1][2];
- n[2] = (vertex[i].nx * transform_matrix[0][2]) +
- (vertex[i].ny * transform_matrix[1][2]) +
+ (vertex[i].nz * transform_matrix[1][2]);
+ n[2] = (vertex[i].nx * transform_matrix[2][0]) +
+ (vertex[i].ny * transform_matrix[2][1]) +
(vertex[i].nz * transform_matrix[2][2]);
- n[2] *= m_coordinate_system[2][0];
// lighting
float intensity;
if ((header[6] & 0x10000) == 0)
{
float dot = dot_product3(n, m_parallel_light);
+
+ if (header[1] & 0x10)
+ dot = fabs(dot);
+
intensity = ((dot * m_parallel_light_intensity) + m_ambient_light_intensity) * 255.0f;
if (intensity > 255.0f)
{
@@ -1519,43 +1764,55 @@ void model3_state::draw_model(UINT32 addr)
}
else
{
- // apply luminosity
- intensity = ((float)((header[6] >> 11) & 0x1f) / 31.0f) * 255.0f;
+ intensity = 255.0f;
}
clip_vert[i].i = intensity;
}
/* clip against view frustum */
- num_vertices = clip_polygon(clip_vert, num_vertices, m_clip_plane[0], clip_vert);
- num_vertices = clip_polygon(clip_vert, num_vertices, m_clip_plane[1], clip_vert);
- num_vertices = clip_polygon(clip_vert, num_vertices, m_clip_plane[2], clip_vert);
- num_vertices = clip_polygon(clip_vert, num_vertices, m_clip_plane[3], clip_vert);
- num_vertices = clip_polygon(clip_vert, num_vertices, m_clip_plane[4], clip_vert);
+ num_vertices = clip_w(clip_vert, num_vertices, clip_vert);
+ num_vertices = clip(clip_vert, num_vertices, clip_vert, 0, 0); // W <= -X
+ num_vertices = clip(clip_vert, num_vertices, clip_vert, 0, 1); // W <= +X
+ num_vertices = clip(clip_vert, num_vertices, clip_vert, 1, 0); // W <= -Y
+ num_vertices = clip(clip_vert, num_vertices, clip_vert, 1, 1); // W <= +X
+ num_vertices = clip(clip_vert, num_vertices, clip_vert, 2, 0); // W <= -Z
+ num_vertices = clip(clip_vert, num_vertices, clip_vert, 2, 1); // W <= +Z
+
+ /* divide by W, transform to screen coords */
+ for(i=0; i < num_vertices; i++)
+ {
+ float oow = 1.0f / clip_vert[i].w;
+
+ clip_vert[i].x *= oow;
+ clip_vert[i].y *= oow;
+ clip_vert[i].z *= oow;
+ clip_vert[i].u *= oow;
+ clip_vert[i].v *= oow;
+
+ clip_vert[i].x = (((clip_vert[i].x * 0.5f) + 0.5f) * m_viewport_width) + m_viewport_x;
+ clip_vert[i].y = (((clip_vert[i].y * 0.5f) + 0.5f) * m_viewport_height) + m_viewport_y;
+ clip_vert[i].z = (((clip_vert[i].z * 0.5f) + 0.5f) * (m_viewport_far - m_viewport_near)) + m_viewport_near;
+ }
/* backface culling */
- if( (header[6] & 0x800000) && (!(header[1] & 0x0010)) ) {
- if(sn[0]*clip_vert[0].x + sn[1]*clip_vert[0].y + sn[2]*clip_vert[0].z >0)
+ if( (header[6] & 0x800000) && (!(header[1] & 0x0010)) )
+ {
+ if (sn[0]*clip_vert[0].x + sn[1]*clip_vert[0].y + sn[2]*clip_vert[0].z > 0)
back_face = 1;
else
back_face = 0;
}
else
+ {
back_face = 0; //no culling for transparent or two-sided polygons
+ }
+
+ back_face = 0;
if (!back_face)
{
- /* homogeneous Z-divide, screen-space transformation */
- for(i=0; i < num_vertices; i++)
- {
- float ooz = 1.0f / clip_vert[i].z;
- clip_vert[i].x = ((clip_vert[i].x * ooz) * m_viewport_focal_length) + center_x;
- clip_vert[i].y = ((clip_vert[i].y * ooz) * m_viewport_focal_length) + center_y;
- clip_vert[i].u *= ooz;
- clip_vert[i].v *= ooz;
- }
-
-
+ bool colormod = false;
cached_texture* texture;
if (header[6] & 0x0000400)
@@ -1566,6 +1823,9 @@ void model3_state::draw_model(UINT32 addr)
int tex_height = (header[3] & 0x7);
int tex_format = (header[6] >> 7) & 0x7;
+ if (tex_format != 0 && tex_format != 7) // enable color modulation if this is not a color texture
+ colormod = true;
+
if (tex_width >= 6 || tex_height >= 6) // srally2 poly ram has degenerate polys with 2k tex size (cpu bug or intended?)
return;
@@ -1578,7 +1838,7 @@ void model3_state::draw_model(UINT32 addr)
for (i=2; i < num_vertices; i++)
{
- bool alpha = (header[6] & 0x1) || (header[6] & 0x80000000); // put to alpha buffer if there's any transparency involved
+ bool alpha = (header[6] & 0x1) || ((header[6] & 0x800000) == 0); // put to alpha buffer if there's any transparency involved
m3_triangle* tri = push_triangle(alpha);
// bail out if tri buffer is maxed out (happens during harley boot)
@@ -1593,12 +1853,13 @@ void model3_state::draw_model(UINT32 addr)
tri->transparency = polygon_transparency;
tri->color = color;
- tri->param = 0;
- tri->param |= (header[4] & 0x40) ? TRI_PARAM_TEXTURE_PAGE : 0;
- tri->param |= (header[6] & 0x00000400) ? TRI_PARAM_TEXTURE_ENABLE : 0;
- tri->param |= (header[2] & 0x2) ? TRI_PARAM_TEXTURE_MIRROR_U : 0;
- tri->param |= (header[2] & 0x1) ? TRI_PARAM_TEXTURE_MIRROR_V : 0;
- tri->param |= (header[6] & 0x80000000) ? TRI_PARAM_ALPHA_TEST : 0;
+ tri->param = 0;
+ tri->param |= (header[4] & 0x40) ? TRI_PARAM_TEXTURE_PAGE : 0;
+ tri->param |= (header[6] & 0x00000400) ? TRI_PARAM_TEXTURE_ENABLE : 0;
+ tri->param |= (header[2] & 0x2) ? TRI_PARAM_TEXTURE_MIRROR_U : 0;
+ tri->param |= (header[2] & 0x1) ? TRI_PARAM_TEXTURE_MIRROR_V : 0;
+ tri->param |= (header[6] & 0x80000000) ? TRI_PARAM_ALPHA_TEST : 0;
+ tri->param |= (colormod) ? TRI_PARAM_COLOR_MOD : 0;
}
}
}
@@ -1754,8 +2015,6 @@ void model3_state::draw_viewport(int pri, UINT32 address)
{
const UINT32 *node = get_memory_pointer(address);
UINT32 link_address;
- float /*viewport_left, viewport_right, */viewport_top, viewport_bottom;
- float /*fov_x,*/ fov_y;
link_address = node[1];
@@ -1769,28 +2028,33 @@ void model3_state::draw_viewport(int pri, UINT32 address)
return;
/* set viewport parameters */
- m_viewport_region_x = (node[26] & 0xffff) >> 4; /* 12.4 fixed point */
- m_viewport_region_y = ((node[26] >> 16) & 0xffff) >> 4;
- m_viewport_region_width = (node[20] & 0xffff) >> 2; /* 14.2 fixed point */
- m_viewport_region_height = ((node[20] >> 16) & 0xffff) >> 2;
-
- /* frustum plane angles */
- //viewport_left = RADIAN_TO_DEGREE(asin(*(float *)&node[12]));
- //viewport_right = RADIAN_TO_DEGREE(asin(*(float *)&node[16]));
- viewport_top = RADIAN_TO_DEGREE(asin(*(float *)&node[14]));
- viewport_bottom = RADIAN_TO_DEGREE(asin(*(float *)&node[18]));
-
- /* build clipping planes */
- m_clip_plane[0].x = *(float *)&node[13]; m_clip_plane[0].y = 0.0f; m_clip_plane[0].z = *(float *)&node[12]; m_clip_plane[0].d = 0.0f;
- m_clip_plane[1].x = *(float *)&node[17]; m_clip_plane[1].y = 0.0f; m_clip_plane[1].z = *(float *)&node[16]; m_clip_plane[1].d = 0.0f;
- m_clip_plane[2].x = 0.0f; m_clip_plane[2].y = *(float *)&node[15]; m_clip_plane[2].z = *(float *)&node[14]; m_clip_plane[2].d = 0.0f;
- m_clip_plane[3].x = 0.0f; m_clip_plane[3].y = *(float *)&node[19]; m_clip_plane[3].z = *(float *)&node[18]; m_clip_plane[3].d = 0.0f;
- m_clip_plane[4].x = 0.0f; m_clip_plane[4].y = 0.0f; m_clip_plane[4].z = 1.0f; m_clip_plane[4].d = 1.0f;
-
- /* compute field of view */
- //fov_x = viewport_left + viewport_right;
- fov_y = viewport_top + viewport_bottom;
- m_viewport_focal_length = (m_viewport_region_height / 2) / tan( (fov_y * M_PI / 180.0f) / 2.0f );
+ m_viewport_x = (float)(node[26] & 0xffff) / 16.0f; /* 12.4 fixed point */
+ m_viewport_y = (float)((node[26] >> 16) & 0xffff) / 16.0f;
+ m_viewport_width = (float)(node[20] & 0xffff) / 4.0f; /* 14.2 fixed point */
+ m_viewport_height = (float)((node[20] >> 16) & 0xffff) / 4.0f;
+
+ m_viewport_near = 1.0f;
+ m_viewport_far = 100000.0f;
+
+ /* set up frustum */
+ float frustum_left = atan2(*(float *)&node[12], *(float *)&node[13]);
+ float frustum_right = -atan2(*(float *)&node[16], -*(float *)&node[17]);
+ float frustum_top = atan2(*(float *)&node[14], *(float *)&node[15]);
+ float frustum_bottom = -atan2(*(float *)&node[18], -*(float *)&node[19]);
+// float frustum_1 = atan2(*(float *)&node[9], *(float *)&node[8]);
+// float frustum_2 = atan2(*(float *)&node[11], *(float *)&node[10]);
+
+ /*
+ printf("%f\n", *(float *)&node[3]);
+ printf("0: %f, 1: %f, 2: %f, 3: %f\n", *(float *)&node[8], *(float *)&node[9], *(float *)&node[10], *(float *)&node[11]);
+ printf("4: %f, 5: %f, 6: %f, 7: %f\n", *(float *)&node[12], *(float *)&node[13], *(float *)&node[14], *(float *)&node[15]);
+ printf("8: %f, 9: %f, A: %f, B: %f\n", *(float *)&node[16], *(float *)&node[17], *(float *)&node[18], *(float *)&node[19]);
+ printf("fl = %f, fr = %f, ft = %f, fb = %f\n", RADIAN_TO_DEGREE(frustum_left), RADIAN_TO_DEGREE(frustum_right), RADIAN_TO_DEGREE(frustum_top), RADIAN_TO_DEGREE(frustum_bottom));
+ printf("f1 = %f, f2 = %f\n", RADIAN_TO_DEGREE(frustum_1), RADIAN_TO_DEGREE(frustum_2));
+ */
+
+ set_projection(frustum_left, frustum_right, frustum_top, frustum_bottom, m_viewport_near, m_viewport_far);
+
m_matrix_base_address = node[22];
/* TODO: where does node[23] point to ? LOD table ? */
@@ -1798,7 +2062,7 @@ void model3_state::draw_viewport(int pri, UINT32 address)
/* set lighting parameters */
m_parallel_light[0] = *(float *)&node[5];
m_parallel_light[1] = *(float *)&node[6];
- m_parallel_light[2] = -*(float *)&node[4];
+ m_parallel_light[2] = *(float *)&node[4];
m_parallel_light_intensity = *(float *)&node[7];
m_ambient_light_intensity = (UINT8)(node[36] >> 8) / 256.0f;
@@ -1893,10 +2157,10 @@ void model3_renderer::draw_opaque_triangles(const m3_triangle* tris, int num_tri
{
v[i].x = tri->v[i].x;
v[i].y = tri->v[i].y;
- v[i].p[0] = tri->v[i].z;
- v[i].p[1] = 1.0f / tri->v[i].z;
- v[i].p[2] = tri->v[i].u * 256.0f; // 8 bits of subtexel precision for bilinear filtering
- v[i].p[3] = tri->v[i].v * 256.0f;
+ v[i].p[0] = tri->v[i].w;
+ v[i].p[1] = 1.0f / tri->v[i].w;
+ v[i].p[2] = tri->v[i].u;
+ v[i].p[3] = tri->v[i].v;
v[i].p[4] = tri->v[i].i;
}
@@ -1904,8 +2168,19 @@ void model3_renderer::draw_opaque_triangles(const m3_triangle* tris, int num_tri
extra.texture = tri->texture;
extra.transparency = tri->transparency;
extra.texture_param = tri->param;
+ extra.color = tri->color;
- render_triangle(cliprect, render_delegate(FUNC(model3_renderer::draw_scanline_tex), this), 5, v[0], v[1], v[2]);
+ if (tri->param & TRI_PARAM_ALPHA_TEST)
+ {
+ render_triangle(cliprect, render_delegate(FUNC(model3_renderer::draw_scanline_tex_contour), this), 5, v[0], v[1], v[2]);
+ }
+ else
+ {
+ if (tri->param & TRI_PARAM_COLOR_MOD)
+ render_triangle(cliprect, render_delegate(FUNC(model3_renderer::draw_scanline_tex_colormod), this), 5, v[0], v[1], v[2]);
+ else
+ render_triangle(cliprect, render_delegate(FUNC(model3_renderer::draw_scanline_tex), this), 5, v[0], v[1], v[2]);
+ }
}
else
{
@@ -1913,7 +2188,7 @@ void model3_renderer::draw_opaque_triangles(const m3_triangle* tris, int num_tri
{
v[i].x = tri->v[i].x;
v[i].y = tri->v[i].y;
- v[i].p[0] = tri->v[i].z;
+ v[i].p[0] = tri->v[i].w;
v[i].p[1] = tri->v[i].i;
}
@@ -1947,10 +2222,10 @@ void model3_renderer::draw_alpha_triangles(const m3_triangle* tris, int num_tris
{
v[i].x = tri->v[i].x;
v[i].y = tri->v[i].y;
- v[i].p[0] = tri->v[i].z;
- v[i].p[1] = 1.0f / tri->v[i].z;
- v[i].p[2] = tri->v[i].u * 256.0f; // 8 bits of subtexel precision for bilinear filtering
- v[i].p[3] = tri->v[i].v * 256.0f;
+ v[i].p[0] = tri->v[i].w;
+ v[i].p[1] = 1.0f / tri->v[i].w;
+ v[i].p[2] = tri->v[i].u;
+ v[i].p[3] = tri->v[i].v;
v[i].p[4] = tri->v[i].i;
}
@@ -1959,14 +2234,7 @@ void model3_renderer::draw_alpha_triangles(const m3_triangle* tris, int num_tris
extra.transparency = tri->transparency;
extra.texture_param = tri->param;
- if (tri->param & TRI_PARAM_ALPHA_TEST)
- {
- render_triangle(cliprect, render_delegate(FUNC(model3_renderer::draw_scanline_tex_contour), this), 5, v[0], v[1], v[2]);
- }
- else
- {
- render_triangle(cliprect, render_delegate(FUNC(model3_renderer::draw_scanline_tex_alpha), this), 5, v[0], v[1], v[2]);
- }
+ render_triangle(cliprect, render_delegate(FUNC(model3_renderer::draw_scanline_tex_alpha), this), 5, v[0], v[1], v[2]);
}
else
{
@@ -1974,15 +2242,15 @@ void model3_renderer::draw_alpha_triangles(const m3_triangle* tris, int num_tris
{
v[i].x = tri->v[i].x;
v[i].y = tri->v[i].y;
- v[i].p[0] = tri->v[i].z;
+ v[i].p[0] = tri->v[i].w;
v[i].p[1] = tri->v[i].i;
}
model3_polydata &extra = object_data_alloc();
extra.color = tri->color;
+ extra.transparency = tri->transparency;
- // TODO: scanline renderer for solid /w transparency
- render_triangle(cliprect, render_delegate(FUNC(model3_renderer::draw_scanline_solid), this), 2, v[0], v[1], v[2]);
+ render_triangle(cliprect, render_delegate(FUNC(model3_renderer::draw_scanline_solid_trans), this), 2, v[0], v[1], v[2]);
}
}
}
@@ -1998,36 +2266,54 @@ void model3_renderer::draw_scanline_solid(INT32 scanline, const extent_t &extent
float in = extent.param[1].start;
float inz = extent.param[1].dpdx;
- int pr = polydata.color & 0xff0000;
- int pg = polydata.color & 0xff00;
- int pb = polydata.color & 0xff;
+ rgbaint_t color(polydata.color);
+
+ for (int x = extent.startx; x < extent.stopx; x++)
+ {
+ if (z <= zb[x])
+ {
+ rgbaint_t c(color);
+
+ c.scale_imm_and_clamp((int)in);
- int srctrans = polydata.transparency;
- int desttrans = 32 - polydata.transparency;
+ fb[x] = 0xff000000 | c.to_rgba_clamp();
+ zb[x] = z;
+ }
+
+ in += inz;
+ z += dz;
+ }
+}
+
+void model3_renderer::draw_scanline_solid_trans(INT32 scanline, const extent_t &extent, const model3_polydata &polydata, int threadid)
+{
+ UINT32 *fb = &m_fb->pix32(scanline);
+ float *zb = (float*)&m_zb->pix32(scanline);
+
+ float z = extent.param[0].start;
+ float dz = extent.param[0].dpdx;
+
+ float in = extent.param[1].start;
+ float inz = extent.param[1].dpdx;
+
+ rgbaint_t color(polydata.color);
+
+ int trans = (polydata.transparency << 3) | (polydata.transparency >> 2);
for (int x = extent.startx; x < extent.stopx; x++)
{
- if (z < zb[x])
+ if (z <= zb[x])
{
- int ii = (int)(in);
+ rgbaint_t c(color);
- int r = (pr * ii) >> 8;
- int g = (pg * ii) >> 8;
- int b = (pb * ii) >> 8;
+ c.scale_imm_and_clamp((int)in);
- if (srctrans != 0x1f)
+ if (trans != 0xff)
{
- UINT32 orig = fb[x];
- r = (r * srctrans) >> 5;
- g = (g * srctrans) >> 5;
- b = (b * srctrans) >> 5;
- r += ((orig & 0x00ff0000) * desttrans) >> 5;
- g += ((orig & 0x0000ff00) * desttrans) >> 5;
- b += ((orig & 0x000000ff) * desttrans) >> 5;
+ c.blend(rgbaint_t(fb[x]), trans);
}
- fb[x] = 0xff000000 | (r & 0xff0000) | (g & 0xff00) | (b & 0xff);
- zb[x] = z;
+ fb[x] = 0xff000000 | c.to_rgba_clamp();
}
in += inz;
@@ -2058,7 +2344,7 @@ do {
UINT32 pix01 = texture->data[(v1 << width) + u2]; \
UINT32 pix10 = texture->data[(v2 << width) + u1]; \
UINT32 pix11 = texture->data[(v2 << width) + u2]; \
- texel = rgba_bilinear_filter(pix00, pix01, pix10, pix11, u, v); \
+ texel = rgbaint_t::bilinear_filter(pix00, pix01, pix10, pix11, u, v); \
} while(0);
#if ENABLE_BILINEAR
@@ -2090,18 +2376,63 @@ void model3_renderer::draw_scanline_tex(INT32 scanline, const extent_t &extent,
for (int x = extent.startx; x < extent.stopx; x++)
{
- if (z < zb[x])
+ if (z <= zb[x])
{
UINT32 texel;
- TEX_FETCH();
+ TEX_FETCH(); // TODO fetch rgbaint_t instead
- int ii = in;
+ rgbaint_t color(texel);
- UINT32 r = ((texel & 0xff0000) * ii) >> 8;
- UINT32 g = ((texel & 0xff00) * ii) >> 8;
- UINT32 b = ((texel & 0xff) * ii) >> 8;
+ color.scale_imm_and_clamp((int)in);
- fb[x] = 0xff000000 | (r & 0xff0000) | (g & 0xff00) | (b & 0xff);
+ fb[x] = 0xff000000 | color.to_rgba_clamp();
+ zb[x] = z;
+ }
+
+ ooz += dooz;
+ uoz += duoz;
+ voz += dvoz;
+ in += inz;
+ z += dz;
+ }
+}
+
+void model3_renderer::draw_scanline_tex_colormod(INT32 scanline, const extent_t &extent, const model3_polydata &polydata, int threadid)
+{
+ UINT32 *fb = &m_fb->pix32(scanline);
+ float *zb = (float*)&m_zb->pix32(scanline);
+ const cached_texture *texture = polydata.texture;
+
+ float z = extent.param[0].start;
+ float dz = extent.param[0].dpdx;
+ float ooz = extent.param[1].start;
+ float dooz = extent.param[1].dpdx;
+ float uoz = extent.param[2].start;
+ float duoz = extent.param[2].dpdx;
+ float voz = extent.param[3].start;
+ float dvoz = extent.param[3].dpdx;
+ float in = extent.param[4].start;
+ float inz = extent.param[4].dpdx;
+
+ UINT32 umask = (((polydata.texture_param & TRI_PARAM_TEXTURE_MIRROR_U) ? 64 : 32) << texture->width) - 1;
+ UINT32 vmask = (((polydata.texture_param & TRI_PARAM_TEXTURE_MIRROR_V) ? 64 : 32) << texture->height) - 1;
+ UINT32 width = 6 + texture->width;
+
+ rgbaint_t polycolor(polydata.color);
+
+ for (int x = extent.startx; x < extent.stopx; x++)
+ {
+ if (z <= zb[x])
+ {
+ UINT32 texel;
+ TEX_FETCH(); // TODO fetch rgbaint_t instead
+
+ rgbaint_t color(texel);
+
+ color.scale_and_clamp(polycolor);
+ color.scale_imm_and_clamp((int)in);
+
+ fb[x] = 0xff000000 | color.to_rgba_clamp();
zb[x] = z;
}
@@ -2134,9 +2465,11 @@ void model3_renderer::draw_scanline_tex_contour(INT32 scanline, const extent_t &
UINT32 vmask = (((polydata.texture_param & TRI_PARAM_TEXTURE_MIRROR_V) ? 64 : 32) << texture->height) - 1;
UINT32 width = 6 + texture->width;
+ rgbaint_t polycolor(polydata.color);
+
for (int x = extent.startx; x < extent.stopx; x++)
{
- if (z < zb[x])
+ if (z <= zb[x])
{
UINT32 texel;
TEX_FETCH();
@@ -2144,19 +2477,13 @@ void model3_renderer::draw_scanline_tex_contour(INT32 scanline, const extent_t &
UINT32 fa = texel >> 24;
if (fa >= 0xf8)
{
- UINT32 r = ((texel & 0x00ff0000) * fa) >> 8;
- UINT32 g = ((texel & 0x0000ff00) * fa) >> 8;
- UINT32 b = ((texel & 0x000000ff) * fa) >> 8;
-
- UINT32 orig = fb[x];
-
- int minalpha = 255 - fa;
+ rgbaint_t color(texel);
- r += ((orig & 0x00ff0000) * minalpha) >> 8;
- g += ((orig & 0x0000ff00) * minalpha) >> 8;
- b += ((orig & 0x000000ff) * minalpha) >> 8;
+ color.scale_and_clamp(polycolor);
+ color.scale_imm_and_clamp((int)in);
+ color.blend(rgbaint_t(fb[x]), fa);
- fb[x] = 0xff000000 | (r & 0xff0000) | (g & 0xff00) | (b & 0xff);
+ fb[x] = 0xff000000 | color.to_rgba_clamp();
zb[x] = z;
}
}
@@ -2186,37 +2513,28 @@ void model3_renderer::draw_scanline_tex_trans(INT32 scanline, const extent_t &ex
float in = extent.param[4].start;
float inz = extent.param[4].dpdx;
- int srctrans = polydata.transparency;
- int desttrans = 32 - polydata.transparency;
+ int trans = (polydata.transparency << 3) | (polydata.transparency >> 2);
UINT32 umask = (((polydata.texture_param & TRI_PARAM_TEXTURE_MIRROR_U) ? 64 : 32) << texture->width) - 1;
UINT32 vmask = (((polydata.texture_param & TRI_PARAM_TEXTURE_MIRROR_V) ? 64 : 32) << texture->height) - 1;
UINT32 width = 6 + texture->width;
+ rgbaint_t polycolor(polydata.color);
+
for (int x = extent.startx; x < extent.stopx; x++)
{
- if (z < zb[x])
+ if (z <= zb[x])
{
UINT32 texel;
TEX_FETCH();
- int ii = (int)in;
-
- UINT32 r = ((texel & 0x00ff0000) * ii) >> 8;
- UINT32 g = ((texel & 0x0000ff00) * ii) >> 8;
- UINT32 b = ((texel & 0x000000ff) * ii) >> 8;
-
- r = (r * srctrans) >> 5;
- g = (g * srctrans) >> 5;
- b = (b * srctrans) >> 5;
-
- UINT32 orig = fb[x];
+ rgbaint_t color(texel);
- r += ((orig & 0x00ff0000) * desttrans) >> 5;
- g += ((orig & 0x0000ff00) * desttrans) >> 5;
- b += ((orig & 0x000000ff) * desttrans) >> 5;
+ color.scale_and_clamp(polycolor);
+ color.scale_imm_and_clamp((int)in);
+ color.blend(rgbaint_t(fb[x]), trans);
- fb[x] = 0xff000000 | (r & 0xff0000) | (g & 0xff00) | (b & 0xff);
+ fb[x] = 0xff000000 | color.to_rgba_clamp();
}
ooz += dooz;
@@ -2253,7 +2571,7 @@ void model3_renderer::draw_scanline_tex_alpha(INT32 scanline, const extent_t &ex
for (int x = extent.startx; x < extent.stopx; x++)
{
- if (z < zb[x])
+ if (z <= zb[x])
{
UINT32 texel;
TEX_FETCH();
@@ -2261,24 +2579,12 @@ void model3_renderer::draw_scanline_tex_alpha(INT32 scanline, const extent_t &ex
UINT32 fa = texel >> 24;
if (fa != 0)
{
- int ii = (int)in;
-
- UINT32 r = ((texel & 0x00ff0000) * ii) >> 8;
- UINT32 g = ((texel & 0x0000ff00) * ii) >> 8;
- UINT32 b = ((texel & 0x000000ff) * ii) >> 8;
-
- r = (r * fa) >> 8;
- g = (g * fa) >> 8;
- b = (b * fa) >> 8;
-
- UINT32 orig = fb[x];
+ rgbaint_t color(texel);
- int minalpha = 255 - fa;
- r += ((orig & 0x00ff0000) * minalpha) >> 8;
- g += ((orig & 0x0000ff00) * minalpha) >> 8;
- b += ((orig & 0x000000ff) * minalpha) >> 8;
+ color.scale_imm_and_clamp((int)in);
+ color.blend(rgbaint_t(fb[x]), fa);
- fb[x] = 0xff000000 | (r & 0xff0000) | (g & 0xff00) | (b & 0xff);
+ fb[x] = 0xff000000 | color.to_rgba_clamp();
}
}
diff --git a/src/mame/video/n64.c b/src/mame/video/n64.c
index 4a8e0027194..18fb90d6fdb 100644
--- a/src/mame/video/n64.c
+++ b/src/mame/video/n64.c
@@ -26,6 +26,10 @@ TODO:
#include "emu.h"
#include "video/n64.h"
+#include "video/rdpblend.h"
+#include "video/rdptpipe.h"
+
+#include <algorithm>
#define LOG_RDP_EXECUTION 0
@@ -61,9 +65,9 @@ bool n64_rdp::rdp_range_check(UINT32 addr)
// The functions in this file should be moved into the parent Processor class.
#include "rdpfiltr.inc"
-void n64_rdp::get_alpha_cvg(UINT8* comb_alpha, rdp_span_aux* userdata, const rdp_poly_state &object)
+INT32 n64_rdp::get_alpha_cvg(INT32 comb_alpha, rdp_span_aux* userdata, const rdp_poly_state &object)
{
- INT32 temp = *comb_alpha;
+ INT32 temp = comb_alpha;
INT32 temp2 = userdata->m_current_pix_cvg;
INT32 temp3 = 0;
@@ -80,7 +84,7 @@ void n64_rdp::get_alpha_cvg(UINT8* comb_alpha, rdp_span_aux* userdata, const rdp
{
temp = 0xff;
}
- *comb_alpha = temp;
+ return temp;
}
/*****************************************************************************/
@@ -152,90 +156,13 @@ void n64_rdp::video_update16(n64_periphs* n64, bitmap_rgb32 &bitmap)
for(INT32 i = 0; i < hres; i++)
{
- color_t c;
- //INT32 r, g, b;
-
UINT16 pix = frame_buffer[pixels ^ WORD_ADDR_XOR];
- //m_misc_state.m_current_pix_cvg = ((pix & 1) << 2) | (hidden_buffer[pixels ^ BYTE_ADDR_XOR] & 3);
-
- //if(divot)
- //{
- // if(i > 0 && i < (hres - 1))
- // {
- // prev_cvg = ((frame_buffer[(pixels - 1)^WORD_ADDR_XOR] & 1) << 2) | (hidden_buffer[(pixels - 1)^BYTE_ADDR_XOR] & 3);
- // next_cvg = ((frame_buffer[(pixels + 1)^WORD_ADDR_XOR] & 1) << 2) | (hidden_buffer[(pixels + 1)^BYTE_ADDR_XOR] & 3);
- // }
- //}
- c.i.r = ((pix >> 8) & 0xf8) | (pix >> 13);
- c.i.g = ((pix >> 3) & 0xf8) | ((pix >> 8) & 0x07);
- c.i.b = ((pix << 2) & 0xf8) | ((pix >> 3) & 0x07);
-
- //if(fsaa)
- //{
- //if (/*!vibuffering &&*/ state->m_rdp.m_misc_state.m_current_pix_cvg < 7 && i > 1 && j > 1 && i < (hres - 2) && j < (vres - 2))
- //{
- //video_filter16(&c.i.r, &c.i.g, &c.i.b, &frame_buffer[pixels ^ WORD_ADDR_XOR],&hidden_buffer[pixels ^ BYTE_ADDR_XOR], n64->vi_width);
- //}
- //}
- //else if (dither_filter && state->m_rdp.m_misc_state.m_current_pix_cvg == 7 && i > 0 && j > 0 && i < (hres - 1) && j < (vres - 1))
- //{
- //if (vibuffering)
- //{
- // restore_filter16_buffer(&r, &g, &b, &ViBuffer[i][j], n64->vi_width);
- //}
- //else
- //{
- //restore_filter16(&c.i.r, &c.i.g, &c.i.b, &frame_buffer[pixels ^ WORD_ADDR_XOR], pixels ^ WORD_ADDR_XOR, n64->vi_width);
- //}
- //}
- //if(divot)
- //{
- //if (i > 0 && i < (hres - 1) && (m_misc_state.m_current_pix_cvg != 7 || prev_cvg != 7 || next_cvg != 7))
- //{
- //if (vibuffering)
- //{
- // divot_filter16_buffer(&r, &g, &b, &ViBuffer[i][j]);
- //}
- //else
- //{
- //divot_filter16(&c.i.r, &c.i.g, &c.i.b, &frame_buffer[pixels ^ WORD_ADDR_XOR], pixels ^ WORD_ADDR_XOR);
- //}
- //}
- //}
-
- /*
- if (gamma_dither)
- {
- dith = screen.machine().rand() & 0x3f;
- }
- if (gamma)
- {
- if (gamma_dither)
- {
- r = m_gamma_dither_table[(r << 6)|dith];
- g = m_gamma_dither_table[(g << 6)|dith];
- b = m_gamma_dither_table[(b << 6)|dith];
- }
- else
- {
- r = m_gamma_table[r];
- g = m_gamma_table[g];
- b = m_gamma_table[b];
- }
- }
- else if (gamma_dither)
- {
- if (r < 255)
- r += (dith & 1);
- if (g < 255)
- g += (dith & 1);
- if (b < 255)
- b += (dith & 1);
- }
- */
- pixels++;
- d[i] = c.c >> 8;//(r << 16) | (g << 8) | b; // Fix me for endianness
+ const UINT8 r = ((pix >> 8) & 0xf8) | (pix >> 13);
+ const UINT8 g = ((pix >> 3) & 0xf8) | ((pix >> 8) & 0x07);
+ const UINT8 b = ((pix << 2) & 0xf8) | ((pix >> 3) & 0x07);
+ d[i] = (r << 16) | (g << 8) | b;
+ pixels++;
}
pixels +=invisiblewidth;
}
@@ -432,181 +359,156 @@ INT32 n64_rdp::alpha_combiner_equation(INT32 a, INT32 b, INT32 c, INT32 d)
return a;
}
-void n64_rdp::set_suba_input_rgb(UINT8** input_r, UINT8** input_g, UINT8** input_b, INT32 code, rdp_span_aux* userdata)
+void n64_rdp::set_suba_input_rgb(color_t** input, INT32 code, rdp_span_aux* userdata)
{
switch (code & 0xf)
{
- case 0: *input_r = &userdata->m_combined_color.i.r; *input_g = &userdata->m_combined_color.i.g; *input_b = &userdata->m_combined_color.i.b; break;
- case 1: *input_r = &userdata->m_texel0_color.i.r; *input_g = &userdata->m_texel0_color.i.g; *input_b = &userdata->m_texel0_color.i.b; break;
- case 2: *input_r = &userdata->m_texel1_color.i.r; *input_g = &userdata->m_texel1_color.i.g; *input_b = &userdata->m_texel1_color.i.b; break;
- case 3: *input_r = &userdata->m_prim_color.i.r; *input_g = &userdata->m_prim_color.i.g; *input_b = &userdata->m_prim_color.i.b; break;
- case 4: *input_r = &userdata->m_shade_color.i.r; *input_g = &userdata->m_shade_color.i.g; *input_b = &userdata->m_shade_color.i.b; break;
- case 5: *input_r = &userdata->m_env_color.i.r; *input_g = &userdata->m_env_color.i.g; *input_b = &userdata->m_env_color.i.b; break;
- case 6: *input_r = &m_one.i.r; *input_g = &m_one.i.g; *input_b = &m_one.i.b; break;
- case 7: *input_r = &userdata->m_noise_color.i.r; *input_g = &userdata->m_noise_color.i.g; *input_b = &userdata->m_noise_color.i.b; break;
+ case 0: *input = &userdata->m_combined_color; break;
+ case 1: *input = &userdata->m_texel0_color; break;
+ case 2: *input = &userdata->m_texel1_color; break;
+ case 3: *input = &userdata->m_prim_color; break;
+ case 4: *input = &userdata->m_shade_color; break;
+ case 5: *input = &userdata->m_env_color; break;
+ case 6: *input = &m_one; break;
+ case 7: *input = &userdata->m_noise_color; break;
case 8: case 9: case 10: case 11: case 12: case 13: case 14: case 15:
{
- *input_r = &m_zero.i.r; *input_g = &m_zero.i.g; *input_b = &m_zero.i.b; break;
+ *input = &m_zero; break;
}
}
}
-void n64_rdp::set_subb_input_rgb(UINT8** input_r, UINT8** input_g, UINT8** input_b, INT32 code, rdp_span_aux* userdata)
+void n64_rdp::set_subb_input_rgb(color_t** input, INT32 code, rdp_span_aux* userdata)
{
switch (code & 0xf)
{
- case 0: *input_r = &userdata->m_combined_color.i.r; *input_g = &userdata->m_combined_color.i.g; *input_b = &userdata->m_combined_color.i.b; break;
- case 1: *input_r = &userdata->m_texel0_color.i.r; *input_g = &userdata->m_texel0_color.i.g; *input_b = &userdata->m_texel0_color.i.b; break;
- case 2: *input_r = &userdata->m_texel1_color.i.r; *input_g = &userdata->m_texel1_color.i.g; *input_b = &userdata->m_texel1_color.i.b; break;
- case 3: *input_r = &userdata->m_prim_color.i.r; *input_g = &userdata->m_prim_color.i.g; *input_b = &userdata->m_prim_color.i.b; break;
- case 4: *input_r = &userdata->m_shade_color.i.r; *input_g = &userdata->m_shade_color.i.g; *input_b = &userdata->m_shade_color.i.b; break;
- case 5: *input_r = &userdata->m_env_color.i.r; *input_g = &userdata->m_env_color.i.g; *input_b = &userdata->m_env_color.i.b; break;
+ case 0: *input = &userdata->m_combined_color; break;
+ case 1: *input = &userdata->m_texel0_color; break;
+ case 2: *input = &userdata->m_texel1_color; break;
+ case 3: *input = &userdata->m_prim_color; break;
+ case 4: *input = &userdata->m_shade_color; break;
+ case 5: *input = &userdata->m_env_color; break;
case 6: fatalerror("SET_SUBB_RGB_INPUT: key_center\n");
- case 7: *input_r = (UINT8*)&m_k4; *input_g = (UINT8*)&m_k4; *input_b = (UINT8*)&m_k4; break;
+ case 7: *input = &userdata->m_k4; break;
case 8: case 9: case 10: case 11: case 12: case 13: case 14: case 15:
{
- *input_r = &m_zero.i.r; *input_g = &m_zero.i.g; *input_b = &m_zero.i.b; break;
+ *input = &m_zero; break;
}
}
}
-void n64_rdp::set_mul_input_rgb(UINT8** input_r, UINT8** input_g, UINT8** input_b, INT32 code, rdp_span_aux* userdata)
+void n64_rdp::set_mul_input_rgb(color_t** input, INT32 code, rdp_span_aux* userdata)
{
switch (code & 0x1f)
{
- case 0: *input_r = &userdata->m_combined_color.i.r; *input_g = &userdata->m_combined_color.i.g; *input_b = &userdata->m_combined_color.i.b; break;
- case 1: *input_r = &userdata->m_texel0_color.i.r; *input_g = &userdata->m_texel0_color.i.g; *input_b = &userdata->m_texel0_color.i.b; break;
- case 2: *input_r = &userdata->m_texel1_color.i.r; *input_g = &userdata->m_texel1_color.i.g; *input_b = &userdata->m_texel1_color.i.b; break;
- case 3: *input_r = &userdata->m_prim_color.i.r; *input_g = &userdata->m_prim_color.i.g; *input_b = &userdata->m_prim_color.i.b; break;
- case 4: *input_r = &userdata->m_shade_color.i.r; *input_g = &userdata->m_shade_color.i.g; *input_b = &userdata->m_shade_color.i.b; break;
- case 5: *input_r = &userdata->m_env_color.i.r; *input_g = &userdata->m_env_color.i.g; *input_b = &userdata->m_env_color.i.b; break;
- case 6: *input_r = &userdata->m_key_scale.i.r; *input_g = &userdata->m_key_scale.i.g; *input_b = &userdata->m_key_scale.i.b; break;
- case 7: *input_r = &userdata->m_combined_color.i.a; *input_g = &userdata->m_combined_color.i.a; *input_b = &userdata->m_combined_color.i.a; break;
- case 8: *input_r = &userdata->m_texel0_color.i.a; *input_g = &userdata->m_texel0_color.i.a; *input_b = &userdata->m_texel0_color.i.a; break;
- case 9: *input_r = &userdata->m_texel1_color.i.a; *input_g = &userdata->m_texel1_color.i.a; *input_b = &userdata->m_texel1_color.i.a; break;
- case 10: *input_r = &userdata->m_prim_color.i.a; *input_g = &userdata->m_prim_color.i.a; *input_b = &userdata->m_prim_color.i.a; break;
- case 11: *input_r = &userdata->m_shade_color.i.a; *input_g = &userdata->m_shade_color.i.a; *input_b = &userdata->m_shade_color.i.a; break;
- case 12: *input_r = &userdata->m_env_color.i.a; *input_g = &userdata->m_env_color.i.a; *input_b = &userdata->m_env_color.i.a; break;
- case 13: *input_r = &userdata->m_lod_fraction; *input_g = &userdata->m_lod_fraction; *input_b = &userdata->m_lod_fraction; break;
- case 14: *input_r = &userdata->m_prim_lod_fraction; *input_g = &userdata->m_prim_lod_fraction; *input_b = &userdata->m_prim_lod_fraction; break;
- case 15: *input_r = (UINT8*)&m_k5; *input_g = (UINT8*)&m_k5; *input_b = (UINT8*)&m_k5; break;
+ case 0: *input = &userdata->m_combined_color; break;
+ case 1: *input = &userdata->m_texel0_color; break;
+ case 2: *input = &userdata->m_texel1_color; break;
+ case 3: *input = &userdata->m_prim_color; break;
+ case 4: *input = &userdata->m_shade_color; break;
+ case 5: *input = &userdata->m_env_color; break;
+ case 6: *input = &userdata->m_key_scale; break;
+ case 7: *input = &userdata->m_combined_alpha; break;
+ case 8: *input = &userdata->m_texel0_alpha; break;
+ case 9: *input = &userdata->m_texel1_alpha; break;
+ case 10: *input = &userdata->m_prim_alpha; break;
+ case 11: *input = &userdata->m_shade_alpha; break;
+ case 12: *input = &userdata->m_env_alpha; break;
+ case 13: *input = &userdata->m_lod_fraction; break;
+ case 14: *input = &userdata->m_prim_lod_fraction; break;
+ case 15: *input = &userdata->m_k5; break;
case 16: case 17: case 18: case 19: case 20: case 21: case 22: case 23:
case 24: case 25: case 26: case 27: case 28: case 29: case 30: case 31:
{
- *input_r = &m_zero.i.r; *input_g = &m_zero.i.g; *input_b = &m_zero.i.b; break;
+ *input = &m_zero; break;
}
}
}
-void n64_rdp::set_add_input_rgb(UINT8** input_r, UINT8** input_g, UINT8** input_b, INT32 code, rdp_span_aux* userdata)
+void n64_rdp::set_add_input_rgb(color_t** input, INT32 code, rdp_span_aux* userdata)
{
switch (code & 0x7)
{
- case 0: *input_r = &userdata->m_combined_color.i.r; *input_g = &userdata->m_combined_color.i.g; *input_b = &userdata->m_combined_color.i.b; break;
- case 1: *input_r = &userdata->m_texel0_color.i.r; *input_g = &userdata->m_texel0_color.i.g; *input_b = &userdata->m_texel0_color.i.b; break;
- case 2: *input_r = &userdata->m_texel1_color.i.r; *input_g = &userdata->m_texel1_color.i.g; *input_b = &userdata->m_texel1_color.i.b; break;
- case 3: *input_r = &userdata->m_prim_color.i.r; *input_g = &userdata->m_prim_color.i.g; *input_b = &userdata->m_prim_color.i.b; break;
- case 4: *input_r = &userdata->m_shade_color.i.r; *input_g = &userdata->m_shade_color.i.g; *input_b = &userdata->m_shade_color.i.b; break;
- case 5: *input_r = &userdata->m_env_color.i.r; *input_g = &userdata->m_env_color.i.g; *input_b = &userdata->m_env_color.i.b; break;
- case 6: *input_r = &m_one.i.r; *input_g = &m_one.i.g; *input_b = &m_one.i.b; break;
- case 7: *input_r = &m_zero.i.r; *input_g = &m_zero.i.g; *input_b = &m_zero.i.b; break;
+ case 0: *input = &userdata->m_combined_color; break;
+ case 1: *input = &userdata->m_texel0_color; break;
+ case 2: *input = &userdata->m_texel1_color; break;
+ case 3: *input = &userdata->m_prim_color; break;
+ case 4: *input = &userdata->m_shade_color; break;
+ case 5: *input = &userdata->m_env_color; break;
+ case 6: *input = &m_one; break;
+ case 7: *input = &m_zero; break;
}
}
-void n64_rdp::set_sub_input_alpha(UINT8** input, INT32 code, rdp_span_aux* userdata)
+void n64_rdp::set_sub_input_alpha(color_t** input, INT32 code, rdp_span_aux* userdata)
{
switch (code & 0x7)
{
- case 0: *input = &userdata->m_combined_color.i.a; break;
- case 1: *input = &userdata->m_texel0_color.i.a; break;
- case 2: *input = &userdata->m_texel1_color.i.a; break;
- case 3: *input = &userdata->m_prim_color.i.a; break;
- case 4: *input = &userdata->m_shade_color.i.a; break;
- case 5: *input = &userdata->m_env_color.i.a; break;
- case 6: *input = &m_one.i.a; break;
- case 7: *input = &m_zero.i.a; break;
+ case 0: *input = &userdata->m_combined_alpha; break;
+ case 1: *input = &userdata->m_texel0_alpha; break;
+ case 2: *input = &userdata->m_texel1_alpha; break;
+ case 3: *input = &userdata->m_prim_alpha; break;
+ case 4: *input = &userdata->m_shade_alpha; break;
+ case 5: *input = &userdata->m_env_alpha; break;
+ case 6: *input = &m_one; break;
+ case 7: *input = &m_zero; break;
}
}
-void n64_rdp::set_mul_input_alpha(UINT8** input, INT32 code, rdp_span_aux* userdata)
+void n64_rdp::set_mul_input_alpha(color_t** input, INT32 code, rdp_span_aux* userdata)
{
switch (code & 0x7)
{
case 0: *input = &userdata->m_lod_fraction; break;
- case 1: *input = &userdata->m_texel0_color.i.a; break;
- case 2: *input = &userdata->m_texel1_color.i.a; break;
- case 3: *input = &userdata->m_prim_color.i.a; break;
- case 4: *input = &userdata->m_shade_color.i.a; break;
- case 5: *input = &userdata->m_env_color.i.a; break;
+ case 1: *input = &userdata->m_texel0_alpha; break;
+ case 2: *input = &userdata->m_texel1_alpha; break;
+ case 3: *input = &userdata->m_prim_alpha; break;
+ case 4: *input = &userdata->m_shade_alpha; break;
+ case 5: *input = &userdata->m_env_alpha; break;
case 6: *input = &userdata->m_prim_lod_fraction; break;
- case 7: *input = &m_zero.i.a; break;
+ case 7: *input = &m_zero; break;
}
}
-void n64_rdp::set_blender_input(INT32 cycle, INT32 which, UINT8** input_r, UINT8** input_g, UINT8** input_b, UINT8** input_a, INT32 a, INT32 b, rdp_span_aux* userdata)
+void n64_rdp::set_blender_input(INT32 cycle, INT32 which, color_t** input_rgb, color_t** input_a, INT32 a, INT32 b, rdp_span_aux* userdata)
{
switch (a & 0x3)
{
case 0:
- {
- if (cycle == 0)
- {
- *input_r = &userdata->m_pixel_color.i.r;
- *input_g = &userdata->m_pixel_color.i.g;
- *input_b = &userdata->m_pixel_color.i.b;
- }
- else
- {
- *input_r = &userdata->m_blended_pixel_color.i.r;
- *input_g = &userdata->m_blended_pixel_color.i.g;
- *input_b = &userdata->m_blended_pixel_color.i.b;
- }
+ *input_rgb = cycle == 0 ? &userdata->m_pixel_color : &userdata->m_blended_pixel_color;
break;
- }
case 1:
- {
- *input_r = &userdata->m_memory_color.i.r;
- *input_g = &userdata->m_memory_color.i.g;
- *input_b = &userdata->m_memory_color.i.b;
+ *input_rgb = &userdata->m_memory_color;
break;
- }
case 2:
- {
- *input_r = &userdata->m_blend_color.i.r;
- *input_g = &userdata->m_blend_color.i.g;
- *input_b = &userdata->m_blend_color.i.b;
+ *input_rgb = &userdata->m_blend_color;
break;
- }
case 3:
- {
- *input_r = &userdata->m_fog_color.i.r;
- *input_g = &userdata->m_fog_color.i.g;
- *input_b = &userdata->m_fog_color.i.b;
+ *input_rgb = &userdata->m_fog_color;
break;
- }
}
if (which == 0)
{
switch (b & 0x3)
{
- case 0: *input_a = &userdata->m_pixel_color.i.a; break;
- case 1: *input_a = &userdata->m_fog_color.i.a; break;
- case 2: *input_a = &userdata->m_shade_color.i.a; break;
- case 3: *input_a = &m_zero.i.a; break;
+ case 0: *input_a = &userdata->m_pixel_color; break;
+ case 1: *input_a = &userdata->m_fog_color; break;
+ case 2: *input_a = &userdata->m_shade_color; break;
+ case 3: *input_a = &m_zero; break;
}
}
else
{
switch (b & 0x3)
{
- case 0: *input_a = &userdata->m_inv_pixel_color.i.a; break;
- case 1: *input_a = &userdata->m_memory_color.i.a; break;
- case 2: *input_a = &m_one.i.a; break;
- case 3: *input_a = &m_zero.i.a; break;
+ case 0: *input_a = &userdata->m_inv_pixel_color; break;
+ case 1: *input_a = &userdata->m_memory_color; break;
+ case 2: *input_a = &m_one; break;
+ case 3: *input_a = &m_zero; break;
}
}
}
@@ -2067,287 +1969,145 @@ void n64_rdp::draw_triangle(bool shade, bool texture, bool zbuffer, bool rect)
rdp_poly_state* object = NULL;
bool valid = false;
- if(flip)
+ INT32* minx = flip ? &minxhx : &minxmx;
+ INT32* maxx = flip ? &maxxmx : &maxxhx;
+ INT32* startx = flip ? maxx : minx;
+ INT32* endx = flip ? minx : maxx;
+
+ for (INT32 k = ycur; k <= ylfar; k++)
{
- for (INT32 k = ycur; k <= ylfar; k++)
+ if (k == ym)
{
- if (k == ym)
- {
- xleft = xl & ~1;
- xleft_inc = (dxldy >> 2) & ~1;
- }
+ xleft = xl & ~1;
+ xleft_inc = (dxldy >> 2) & ~1;
+ }
- const INT32 xstart = xleft >> 16; // 319
- const INT32 xend = xright >> 16; // 0
- const INT32 j = k >> 2;
- const INT32 spanidx = (k - ycur) >> 2;
- const INT32 spix = k & 3;
- const bool valid_y = !(k < yh || k >= yl);
+ const INT32 xstart = xleft >> 16;
+ const INT32 xend = xright >> 16;
+ const INT32 j = k >> 2;
+ const INT32 spanidx = (k - ycur) >> 2;
+ const INT32 spix = k & 3;
+ bool valid_y = !(k < yh || k >= yl);
- if (spanidx >= 0 && spanidx < 2048)
+ if (spanidx >= 0 && spanidx < 2048)
+ {
+ majorxint[spix] = xend;
+ minorxint[spix] = xstart;
+ majorx[spix] = xright;
+ minorx[spix] = xleft;
+
+ if (spix == 0)
{
- majorxint[spix] = xend; // 0
- minorxint[spix] = xstart; // 319
- majorx[spix] = xright; // 0x00000000
- minorx[spix] = xleft; // 0x013f0000
+ *maxx = 0;
+ *minx = 0xfff;
+ }
- if (spix == 0)
+ if (valid_y)
+ {
+ if (flip)
{
- maxxmx = 0;
- minxhx = 0xfff;
+ *maxx = std::max(xstart, *maxx);
+ *minx = std::min(xend, *minx);
}
-
- if (valid_y)
+ else
{
- maxxmx = (xstart > maxxmx) ? xstart : maxxmx;
- minxhx = (xend < minxhx) ? xend : minxhx;
+ *minx = std::min(xstart, *minx);
+ *maxx = std::max(xend, *maxx);
}
+ }
- if (spix == 0)
+ if (spix == 0)
+ {
+ if(new_object)
{
- if(new_object)
- {
- object = &object_data_alloc();
- memcpy(object->m_tmem, m_tmem, 0x1000);
- new_object = false;
- }
-
- spans[spanidx].userdata = (void*)((UINT8*)m_aux_buf + m_aux_buf_ptr);
- m_aux_buf_ptr += sizeof(rdp_span_aux);
-
- if(m_aux_buf_ptr >= EXTENT_AUX_COUNT)
- {
- fatalerror("n64_rdp::draw_triangle: span aux buffer overflow\n");
- }
-
- rdp_span_aux* userdata = (rdp_span_aux*)spans[spanidx].userdata;
- valid = true;
-
- userdata->m_tmem = object->m_tmem;
-
- userdata->m_blend_color = m_blend_color;
- userdata->m_prim_color = m_prim_color;
- userdata->m_env_color = m_env_color;
- userdata->m_fog_color = m_fog_color;
- userdata->m_key_scale = m_key_scale;
- userdata->m_lod_fraction = m_lod_fraction;
- userdata->m_prim_lod_fraction = m_prim_lod_fraction;
-
- // Setup blender data for this scanline
- set_blender_input(0, 0, &userdata->m_color_inputs.blender1a_r[0],
- &userdata->m_color_inputs.blender1a_g[0],
- &userdata->m_color_inputs.blender1a_b[0],
- &userdata->m_color_inputs.blender1b_a[0], m_other_modes.blend_m1a_0, m_other_modes.blend_m1b_0, userdata);
- set_blender_input(0, 1, &userdata->m_color_inputs.blender2a_r[0],
- &userdata->m_color_inputs.blender2a_g[0],
- &userdata->m_color_inputs.blender2a_b[0],
- &userdata->m_color_inputs.blender2b_a[0], m_other_modes.blend_m2a_0, m_other_modes.blend_m2b_0, userdata);
- set_blender_input(1, 0, &userdata->m_color_inputs.blender1a_r[1],
- &userdata->m_color_inputs.blender1a_g[1],
- &userdata->m_color_inputs.blender1a_b[1],
- &userdata->m_color_inputs.blender1b_a[1], m_other_modes.blend_m1a_1, m_other_modes.blend_m1b_1, userdata);
- set_blender_input(1, 1, &userdata->m_color_inputs.blender2a_r[1],
- &userdata->m_color_inputs.blender2a_g[1],
- &userdata->m_color_inputs.blender2a_b[1],
- &userdata->m_color_inputs.blender2b_a[1], m_other_modes.blend_m2a_1, m_other_modes.blend_m2b_1, userdata);
-
- // Setup color combiner data for this scanline
- set_suba_input_rgb(&userdata->m_color_inputs.combiner_rgbsub_a_r[0], &userdata->m_color_inputs.combiner_rgbsub_a_g[0], &userdata->m_color_inputs.combiner_rgbsub_a_b[0], m_combine.sub_a_rgb0, userdata);
- set_subb_input_rgb(&userdata->m_color_inputs.combiner_rgbsub_b_r[0], &userdata->m_color_inputs.combiner_rgbsub_b_g[0], &userdata->m_color_inputs.combiner_rgbsub_b_b[0], m_combine.sub_b_rgb0, userdata);
- set_mul_input_rgb(&userdata->m_color_inputs.combiner_rgbmul_r[0], &userdata->m_color_inputs.combiner_rgbmul_g[0], &userdata->m_color_inputs.combiner_rgbmul_b[0], m_combine.mul_rgb0, userdata);
- set_add_input_rgb(&userdata->m_color_inputs.combiner_rgbadd_r[0], &userdata->m_color_inputs.combiner_rgbadd_g[0], &userdata->m_color_inputs.combiner_rgbadd_b[0], m_combine.add_rgb0, userdata);
- set_sub_input_alpha(&userdata->m_color_inputs.combiner_alphasub_a[0], m_combine.sub_a_a0, userdata);
- set_sub_input_alpha(&userdata->m_color_inputs.combiner_alphasub_b[0], m_combine.sub_b_a0, userdata);
- set_mul_input_alpha(&userdata->m_color_inputs.combiner_alphamul[0], m_combine.mul_a0, userdata);
- set_sub_input_alpha(&userdata->m_color_inputs.combiner_alphaadd[0], m_combine.add_a0, userdata);
-
- set_suba_input_rgb(&userdata->m_color_inputs.combiner_rgbsub_a_r[1], &userdata->m_color_inputs.combiner_rgbsub_a_g[1], &userdata->m_color_inputs.combiner_rgbsub_a_b[1], m_combine.sub_a_rgb1, userdata);
- set_subb_input_rgb(&userdata->m_color_inputs.combiner_rgbsub_b_r[1], &userdata->m_color_inputs.combiner_rgbsub_b_g[1], &userdata->m_color_inputs.combiner_rgbsub_b_b[1], m_combine.sub_b_rgb1, userdata);
- set_mul_input_rgb(&userdata->m_color_inputs.combiner_rgbmul_r[1], &userdata->m_color_inputs.combiner_rgbmul_g[1], &userdata->m_color_inputs.combiner_rgbmul_b[1], m_combine.mul_rgb1, userdata);
- set_add_input_rgb(&userdata->m_color_inputs.combiner_rgbadd_r[1], &userdata->m_color_inputs.combiner_rgbadd_g[1], &userdata->m_color_inputs.combiner_rgbadd_b[1], m_combine.add_rgb1, userdata);
- set_sub_input_alpha(&userdata->m_color_inputs.combiner_alphasub_a[1], m_combine.sub_a_a1, userdata);
- set_sub_input_alpha(&userdata->m_color_inputs.combiner_alphasub_b[1], m_combine.sub_b_a1, userdata);
- set_mul_input_alpha(&userdata->m_color_inputs.combiner_alphamul[1], m_combine.mul_a1, userdata);
- set_sub_input_alpha(&userdata->m_color_inputs.combiner_alphaadd[1], m_combine.add_a1, userdata);
+ object = &object_data_alloc();
+ memcpy(object->m_tmem, m_tmem, 0x1000);
+ new_object = false;
}
- if (spix == 3)
- {
- spans[spanidx].startx = maxxmx;
- spans[spanidx].stopx = minxhx;
- compute_cvg_flip(spans, majorx, minorx, majorxint, minorxint, j, yh, yl, ycur >> 2);
- }
+ spans[spanidx].userdata = (void*)((UINT8*)m_aux_buf + m_aux_buf_ptr);
+ valid = true;
+ m_aux_buf_ptr += sizeof(rdp_span_aux);
- if (spix == ldflag)
+ if(m_aux_buf_ptr >= EXTENT_AUX_COUNT)
{
- ((rdp_span_aux*)spans[spanidx].userdata)->m_unscissored_rx = xend;
- xfrac = ((xright >> 8) & 0xff);
- spans[spanidx].param[SPAN_R].start = ((r >> 9) << 9) + drdiff - (xfrac * drdxh);
- spans[spanidx].param[SPAN_G].start = ((g >> 9) << 9) + dgdiff - (xfrac * dgdxh);
- spans[spanidx].param[SPAN_B].start = ((b >> 9) << 9) + dbdiff - (xfrac * dbdxh);
- spans[spanidx].param[SPAN_A].start = ((a >> 9) << 9) + dadiff - (xfrac * dadxh);
- spans[spanidx].param[SPAN_S].start = (((s >> 9) << 9) + dsdiff - (xfrac * dsdxh)) & ~0x1f;
- spans[spanidx].param[SPAN_T].start = (((t >> 9) << 9) + dtdiff - (xfrac * dtdxh)) & ~0x1f;
- spans[spanidx].param[SPAN_W].start = (((w >> 9) << 9) + dwdiff - (xfrac * dwdxh)) & ~0x1f;
- spans[spanidx].param[SPAN_Z].start = ((z >> 9) << 9) + dzdiff - (xfrac * dzdxh);
+ fatalerror("n64_rdp::draw_triangle: span aux buffer overflow\n");
}
- }
- if (spix == 3)
- {
- r += drde;
- g += dgde;
- b += dbde;
- a += dade;
- s += dsde;
- t += dtde;
- w += dwde;
- z += dzde;
+ rdp_span_aux* userdata = (rdp_span_aux*)spans[spanidx].userdata;
+ userdata->m_tmem = object->m_tmem;
+
+ userdata->m_blend_color = m_blend_color;
+ userdata->m_prim_color = m_prim_color;
+ userdata->m_env_color = m_env_color;
+ userdata->m_fog_color = m_fog_color;
+ userdata->m_prim_alpha = m_prim_alpha;
+ userdata->m_env_alpha = m_env_alpha;
+ userdata->m_key_scale = m_key_scale;
+ userdata->m_lod_fraction = m_lod_fraction;
+ userdata->m_prim_lod_fraction = m_prim_lod_fraction;
+
+ // Setup blender data for this scanline
+ set_blender_input(0, 0, &userdata->m_color_inputs.blender1a_rgb[0], &userdata->m_color_inputs.blender1b_a[0], m_other_modes.blend_m1a_0, m_other_modes.blend_m1b_0, userdata);
+ set_blender_input(0, 1, &userdata->m_color_inputs.blender2a_rgb[0], &userdata->m_color_inputs.blender2b_a[0], m_other_modes.blend_m2a_0, m_other_modes.blend_m2b_0, userdata);
+ set_blender_input(1, 0, &userdata->m_color_inputs.blender1a_rgb[1], &userdata->m_color_inputs.blender1b_a[1], m_other_modes.blend_m1a_1, m_other_modes.blend_m1b_1, userdata);
+ set_blender_input(1, 1, &userdata->m_color_inputs.blender2a_rgb[1], &userdata->m_color_inputs.blender2b_a[1], m_other_modes.blend_m2a_1, m_other_modes.blend_m2b_1, userdata);
+
+ // Setup color combiner data for this scanline
+ set_suba_input_rgb(&userdata->m_color_inputs.combiner_rgbsub_a[0], m_combine.sub_a_rgb0, userdata);
+ set_subb_input_rgb(&userdata->m_color_inputs.combiner_rgbsub_b[0], m_combine.sub_b_rgb0, userdata);
+ set_mul_input_rgb(&userdata->m_color_inputs.combiner_rgbmul[0], m_combine.mul_rgb0, userdata);
+ set_add_input_rgb(&userdata->m_color_inputs.combiner_rgbadd[0], m_combine.add_rgb0, userdata);
+ set_sub_input_alpha(&userdata->m_color_inputs.combiner_alphasub_a[0], m_combine.sub_a_a0, userdata);
+ set_sub_input_alpha(&userdata->m_color_inputs.combiner_alphasub_b[0], m_combine.sub_b_a0, userdata);
+ set_mul_input_alpha(&userdata->m_color_inputs.combiner_alphamul[0], m_combine.mul_a0, userdata);
+ set_sub_input_alpha(&userdata->m_color_inputs.combiner_alphaadd[0], m_combine.add_a0, userdata);
+
+ set_suba_input_rgb(&userdata->m_color_inputs.combiner_rgbsub_a[1], m_combine.sub_a_rgb1, userdata);
+ set_subb_input_rgb(&userdata->m_color_inputs.combiner_rgbsub_b[1], m_combine.sub_b_rgb1, userdata);
+ set_mul_input_rgb(&userdata->m_color_inputs.combiner_rgbmul[1], m_combine.mul_rgb1, userdata);
+ set_add_input_rgb(&userdata->m_color_inputs.combiner_rgbadd[1], m_combine.add_rgb1, userdata);
+ set_sub_input_alpha(&userdata->m_color_inputs.combiner_alphasub_a[1], m_combine.sub_a_a1, userdata);
+ set_sub_input_alpha(&userdata->m_color_inputs.combiner_alphasub_b[1], m_combine.sub_b_a1, userdata);
+ set_mul_input_alpha(&userdata->m_color_inputs.combiner_alphamul[1], m_combine.mul_a1, userdata);
+ set_sub_input_alpha(&userdata->m_color_inputs.combiner_alphaadd[1], m_combine.add_a1, userdata);
}
- xleft += xleft_inc;
- xright += xright_inc;
- }
- }
- else
- {
- for (INT32 k = ycur; k <= ylfar; k++)
- {
- if (k == ym)
+ if (spix == 3)
{
- xleft = xl & ~1;
- xleft_inc = (dxldy >> 2) & ~1;
+ spans[spanidx].startx = *startx;
+ spans[spanidx].stopx = *endx;
+ ((this)->*(m_compute_cvg[flip]))(spans, majorx, minorx, majorxint, minorxint, j, yh, yl, ycur >> 2);
}
- const INT32 xstart = xleft >> 16;
- const INT32 xend = xright >> 16;
- const INT32 j = k >> 2;
- const INT32 spanidx = j - (ycur >> 2);
- const INT32 spix = k & 3;
- bool valid_y = !(k < yh || k >= yl);
-
- if (k >= 0 && k < 0x1000)
+ if (spix == ldflag)
{
- majorxint[spix] = xend;
- minorxint[spix] = xstart;
- majorx[spix] = xright;
- minorx[spix] = xleft;
-
- if (spix == 0)
- {
- maxxhx = 0;
- minxmx = 0xfff;
- }
-
- if (valid_y)
- {
- minxmx = (xstart < minxmx) ? xstart : minxmx;
- maxxhx = (xend > maxxhx) ? xend : maxxhx;
- }
-
- if (spix == 0)
- {
- if(new_object)
- {
- object = &object_data_alloc();
- memcpy(object->m_tmem, m_tmem, 0x1000);
- new_object = false;
- }
-
- spans[spanidx].userdata = (void*)((UINT8*)m_aux_buf + m_aux_buf_ptr);
- valid = true;
- m_aux_buf_ptr += sizeof(rdp_span_aux);
-
- if(m_aux_buf_ptr >= EXTENT_AUX_COUNT)
- {
- fatalerror("n64_rdp::draw_triangle: span aux buffer overflow\n");
- }
-
- rdp_span_aux* userdata = (rdp_span_aux*)spans[spanidx].userdata;
- userdata->m_tmem = object->m_tmem;
-
- userdata->m_blend_color = m_blend_color;
- userdata->m_prim_color = m_prim_color;
- userdata->m_env_color = m_env_color;
- userdata->m_fog_color = m_fog_color;
- userdata->m_key_scale = m_key_scale;
- userdata->m_lod_fraction = m_lod_fraction;
- userdata->m_prim_lod_fraction = m_prim_lod_fraction;
-
- // Setup blender data for this scanline
- set_blender_input(0, 0, &userdata->m_color_inputs.blender1a_r[0],
- &userdata->m_color_inputs.blender1a_g[0],
- &userdata->m_color_inputs.blender1a_b[0],
- &userdata->m_color_inputs.blender1b_a[0], m_other_modes.blend_m1a_0, m_other_modes.blend_m1b_0, userdata);
- set_blender_input(0, 1, &userdata->m_color_inputs.blender2a_r[0],
- &userdata->m_color_inputs.blender2a_g[0],
- &userdata->m_color_inputs.blender2a_b[0],
- &userdata->m_color_inputs.blender2b_a[0], m_other_modes.blend_m2a_0, m_other_modes.blend_m2b_0, userdata);
- set_blender_input(1, 0, &userdata->m_color_inputs.blender1a_r[1],
- &userdata->m_color_inputs.blender1a_g[1],
- &userdata->m_color_inputs.blender1a_b[1],
- &userdata->m_color_inputs.blender1b_a[1], m_other_modes.blend_m1a_1, m_other_modes.blend_m1b_1, userdata);
- set_blender_input(1, 1, &userdata->m_color_inputs.blender2a_r[1],
- &userdata->m_color_inputs.blender2a_g[1],
- &userdata->m_color_inputs.blender2a_b[1],
- &userdata->m_color_inputs.blender2b_a[1], m_other_modes.blend_m2a_1, m_other_modes.blend_m2b_1, userdata);
-
- // Setup color combiner data for this scanline
- set_suba_input_rgb(&userdata->m_color_inputs.combiner_rgbsub_a_r[0], &userdata->m_color_inputs.combiner_rgbsub_a_g[0], &userdata->m_color_inputs.combiner_rgbsub_a_b[0], m_combine.sub_a_rgb0, userdata);
- set_subb_input_rgb(&userdata->m_color_inputs.combiner_rgbsub_b_r[0], &userdata->m_color_inputs.combiner_rgbsub_b_g[0], &userdata->m_color_inputs.combiner_rgbsub_b_b[0], m_combine.sub_b_rgb0, userdata);
- set_mul_input_rgb(&userdata->m_color_inputs.combiner_rgbmul_r[0], &userdata->m_color_inputs.combiner_rgbmul_g[0], &userdata->m_color_inputs.combiner_rgbmul_b[0], m_combine.mul_rgb0, userdata);
- set_add_input_rgb(&userdata->m_color_inputs.combiner_rgbadd_r[0], &userdata->m_color_inputs.combiner_rgbadd_g[0], &userdata->m_color_inputs.combiner_rgbadd_b[0], m_combine.add_rgb0, userdata);
- set_sub_input_alpha(&userdata->m_color_inputs.combiner_alphasub_a[0], m_combine.sub_a_a0, userdata);
- set_sub_input_alpha(&userdata->m_color_inputs.combiner_alphasub_b[0], m_combine.sub_b_a0, userdata);
- set_mul_input_alpha(&userdata->m_color_inputs.combiner_alphamul[0], m_combine.mul_a0, userdata);
- set_sub_input_alpha(&userdata->m_color_inputs.combiner_alphaadd[0], m_combine.add_a0, userdata);
-
- set_suba_input_rgb(&userdata->m_color_inputs.combiner_rgbsub_a_r[1], &userdata->m_color_inputs.combiner_rgbsub_a_g[1], &userdata->m_color_inputs.combiner_rgbsub_a_b[1], m_combine.sub_a_rgb1, userdata);
- set_subb_input_rgb(&userdata->m_color_inputs.combiner_rgbsub_b_r[1], &userdata->m_color_inputs.combiner_rgbsub_b_g[1], &userdata->m_color_inputs.combiner_rgbsub_b_b[1], m_combine.sub_b_rgb1, userdata);
- set_mul_input_rgb(&userdata->m_color_inputs.combiner_rgbmul_r[1], &userdata->m_color_inputs.combiner_rgbmul_g[1], &userdata->m_color_inputs.combiner_rgbmul_b[1], m_combine.mul_rgb1, userdata);
- set_add_input_rgb(&userdata->m_color_inputs.combiner_rgbadd_r[1], &userdata->m_color_inputs.combiner_rgbadd_g[1], &userdata->m_color_inputs.combiner_rgbadd_b[1], m_combine.add_rgb1, userdata);
- set_sub_input_alpha(&userdata->m_color_inputs.combiner_alphasub_a[1], m_combine.sub_a_a1, userdata);
- set_sub_input_alpha(&userdata->m_color_inputs.combiner_alphasub_b[1], m_combine.sub_b_a1, userdata);
- set_mul_input_alpha(&userdata->m_color_inputs.combiner_alphamul[1], m_combine.mul_a1, userdata);
- set_sub_input_alpha(&userdata->m_color_inputs.combiner_alphaadd[1], m_combine.add_a1, userdata);
- }
-
- if (spix == 3)
- {
- spans[spanidx].startx = minxmx;
- spans[spanidx].stopx = maxxhx;
- compute_cvg_noflip(spans, majorx, minorx, majorxint, minorxint, j, yh, yl, ycur >> 2);
- }
-
- if (spix == ldflag)
- {
- ((rdp_span_aux*)spans[spanidx].userdata)->m_unscissored_rx = xend;
- xfrac = ((xright >> 8) & 0xff);
- spans[spanidx].param[SPAN_R].start = ((r >> 9) << 9) + drdiff - (xfrac * drdxh);
- spans[spanidx].param[SPAN_G].start = ((g >> 9) << 9) + dgdiff - (xfrac * dgdxh);
- spans[spanidx].param[SPAN_B].start = ((b >> 9) << 9) + dbdiff - (xfrac * dbdxh);
- spans[spanidx].param[SPAN_A].start = ((a >> 9) << 9) + dadiff - (xfrac * dadxh);
- spans[spanidx].param[SPAN_S].start = (((s >> 9) << 9) + dsdiff - (xfrac * dsdxh)) & ~0x1f;
- spans[spanidx].param[SPAN_T].start = (((t >> 9) << 9) + dtdiff - (xfrac * dtdxh)) & ~0x1f;
- spans[spanidx].param[SPAN_W].start = (((w >> 9) << 9) + dwdiff - (xfrac * dwdxh)) & ~0x1f;
- spans[spanidx].param[SPAN_Z].start = ((z >> 9) << 9) + dzdiff - (xfrac * dzdxh);
- }
+ ((rdp_span_aux*)spans[spanidx].userdata)->m_unscissored_rx = xend;
+ xfrac = ((xright >> 8) & 0xff);
+ spans[spanidx].param[SPAN_R].start = ((r >> 9) << 9) + drdiff - (xfrac * drdxh);
+ spans[spanidx].param[SPAN_G].start = ((g >> 9) << 9) + dgdiff - (xfrac * dgdxh);
+ spans[spanidx].param[SPAN_B].start = ((b >> 9) << 9) + dbdiff - (xfrac * dbdxh);
+ spans[spanidx].param[SPAN_A].start = ((a >> 9) << 9) + dadiff - (xfrac * dadxh);
+ spans[spanidx].param[SPAN_S].start = (((s >> 9) << 9) + dsdiff - (xfrac * dsdxh)) & ~0x1f;
+ spans[spanidx].param[SPAN_T].start = (((t >> 9) << 9) + dtdiff - (xfrac * dtdxh)) & ~0x1f;
+ spans[spanidx].param[SPAN_W].start = (((w >> 9) << 9) + dwdiff - (xfrac * dwdxh)) & ~0x1f;
+ spans[spanidx].param[SPAN_Z].start = ((z >> 9) << 9) + dzdiff - (xfrac * dzdxh);
}
+ }
- if (spix == 3)
- {
- r += drde;
- g += dgde;
- b += dbde;
- a += dade;
- s += dsde;
- t += dtde;
- w += dwde;
- z += dzde;
- }
- xleft += xleft_inc;
- xright += xright_inc;
+ if (spix == 3)
+ {
+ r += drde;
+ g += dgde;
+ b += dbde;
+ a += dade;
+ s += dsde;
+ t += dtde;
+ w += dwde;
+ z += dzde;
}
+ xleft += xleft_inc;
+ xright += xright_inc;
}
if(!new_object && valid)
@@ -2547,13 +2307,13 @@ void n64_rdp::cmd_sync_full(UINT32 w1, UINT32 w2)
void n64_rdp::cmd_set_key_gb(UINT32 w1, UINT32 w2)
{
- m_key_scale.i.b = w2 & 0xff;
- m_key_scale.i.g = (w2 >> 16) & 0xff;
+ m_key_scale.set_b(w2 & 0xff);
+ m_key_scale.set_g((w2 >> 16) & 0xff);
}
void n64_rdp::cmd_set_key_r(UINT32 w1, UINT32 w2)
{
- m_key_scale.i.r = w2 & 0xff;
+ m_key_scale.set_r(w2 & 0xff);
}
void n64_rdp::cmd_set_fill_color32(UINT32 w1, UINT32 w2)
@@ -2565,19 +2325,19 @@ void n64_rdp::cmd_set_fill_color32(UINT32 w1, UINT32 w2)
void n64_rdp::cmd_set_convert(UINT32 w1, UINT32 w2)
{
if(!m_pipe_clean) { m_pipe_clean = true; wait("SetConvert"); }
- INT32 k0 = (w1 >> 13) & 0xff;
- INT32 k1 = (w1 >> 4) & 0xff;
- INT32 k2 = ((w1 & 7) << 5) | ((w2 >> 27) & 0x1f);
- INT32 k3 = (w2 >> 18) & 0xff;
- INT32 k4 = (w2 >> 9) & 0xff;
- INT32 k5 = w2 & 0xff;
- k0 = ((w1 >> 21) & 1) ? (-(0x100 - k0)) : k0;
- k1 = ((w1 >> 12) & 1) ? (-(0x100 - k1)) : k1;
- k2 = (w1 & 0xf) ? (-(0x100 - k2)) : k2;
- k3 = ((w2 >> 26) & 1) ? (-(0x100 - k3)) : k3;
- k4 = ((w2 >> 17) & 1) ? (-(0x100 - k4)) : k4;
- k5 = ((w2 >> 8) & 1) ? (-(0x100 - k5)) : k5;
- set_yuv_factors(k0, k1, k2, k3, k4, k5);
+ INT32 k0 = (w1 >> 13) & 0x1ff;
+ INT32 k1 = (w1 >> 4) & 0x1ff;
+ INT32 k2 = ((w1 & 0xf) << 5) | ((w2 >> 27) & 0x1f);
+ INT32 k3 = (w2 >> 18) & 0x1ff;
+ INT32 k4 = (w2 >> 9) & 0x1ff;
+ INT32 k5 = w2 & 0x1ff;
+
+ k0 = (SIGN9(k0) << 1) + 1;
+ k1 = (SIGN9(k1) << 1) + 1;
+ k2 = (SIGN9(k2) << 1) + 1;
+ k3 = (SIGN9(k3) << 1) + 1;
+
+ set_yuv_factors(rgbaint_t(0, k0, k2, k3), rgbaint_t(0, 0, k1, 0), rgbaint_t(k4, k4, k4, k4), rgbaint_t(k5, k5, k5, k5));
}
void n64_rdp::cmd_set_scissor(UINT32 w1, UINT32 w2)
@@ -2685,6 +2445,9 @@ void n64_rdp::cmd_load_tlut(UINT32 w1, UINT32 w2)
}
default: fatalerror("RDP: load_tlut: size = %d\n", m_misc_state.m_ti_size);
}
+
+ m_tiles[tilenum].sth = rgbaint_t(m_tiles[tilenum].sh, m_tiles[tilenum].sh, m_tiles[tilenum].th, m_tiles[tilenum].th);
+ m_tiles[tilenum].stl = rgbaint_t(m_tiles[tilenum].sl, m_tiles[tilenum].sl, m_tiles[tilenum].tl, m_tiles[tilenum].tl);
}
void n64_rdp::cmd_set_tile_size(UINT32 w1, UINT32 w2)
@@ -2697,6 +2460,9 @@ void n64_rdp::cmd_set_tile_size(UINT32 w1, UINT32 w2)
m_tiles[tilenum].tl = (w1 >> 0) & 0xfff;
m_tiles[tilenum].sh = (w2 >> 12) & 0xfff;
m_tiles[tilenum].th = (w2 >> 0) & 0xfff;
+
+ m_tiles[tilenum].sth = rgbaint_t(m_tiles[tilenum].sh, m_tiles[tilenum].sh, m_tiles[tilenum].th, m_tiles[tilenum].th);
+ m_tiles[tilenum].stl = rgbaint_t(m_tiles[tilenum].sl, m_tiles[tilenum].sl, m_tiles[tilenum].tl, m_tiles[tilenum].tl);
}
void n64_rdp::cmd_load_block(UINT32 w1, UINT32 w2)
@@ -2859,6 +2625,9 @@ void n64_rdp::cmd_load_block(UINT32 w1, UINT32 w2)
}
tile[tilenum].th = tl;
}
+
+ m_tiles[tilenum].sth = rgbaint_t(m_tiles[tilenum].sh, m_tiles[tilenum].sh, m_tiles[tilenum].th, m_tiles[tilenum].th);
+ m_tiles[tilenum].stl = rgbaint_t(m_tiles[tilenum].sl, m_tiles[tilenum].sl, m_tiles[tilenum].tl, m_tiles[tilenum].tl);
}
void n64_rdp::cmd_load_tile(UINT32 w1, UINT32 w2)
@@ -2891,6 +2660,7 @@ void n64_rdp::cmd_load_tile(UINT32 w1, UINT32 w2)
}
topad = 0; // ????
*/
+
switch (m_misc_state.m_ti_size)
{
case PIXEL_SIZE_8BIT:
@@ -2978,12 +2748,14 @@ void n64_rdp::cmd_load_tile(UINT32 w1, UINT32 w2)
default: fatalerror("RDP: load_tile: size = %d\n", m_misc_state.m_ti_size);
}
+
+ m_tiles[tilenum].sth = rgbaint_t(m_tiles[tilenum].sh, m_tiles[tilenum].sh, m_tiles[tilenum].th, m_tiles[tilenum].th);
+ m_tiles[tilenum].stl = rgbaint_t(m_tiles[tilenum].sl, m_tiles[tilenum].sl, m_tiles[tilenum].tl, m_tiles[tilenum].tl);
}
void n64_rdp::cmd_set_tile(UINT32 w1, UINT32 w2)
{
//wait("SetTile");
-
const INT32 tilenum = (w2 >> 24) & 0x7;
n64_tile_t* tex_tile = &m_tiles[tilenum];
@@ -3007,8 +2779,16 @@ void n64_rdp::cmd_set_tile(UINT32 w1, UINT32 w2)
tex_tile->rshift_t = (tex_tile->shift_t < 11) ? tex_tile->shift_t : 0;
tex_tile->wrapped_mask_s = (tex_tile->mask_s > 10 ? 10 : tex_tile->mask_s);
tex_tile->wrapped_mask_t = (tex_tile->mask_t > 10 ? 10 : tex_tile->mask_t);
+ tex_tile->wrapped_mask = rgbaint_t(tex_tile->wrapped_mask_s, tex_tile->wrapped_mask_s, tex_tile->wrapped_mask_t, tex_tile->wrapped_mask_t);
tex_tile->clamp_s = tex_tile->cs || !tex_tile->mask_s;
tex_tile->clamp_t = tex_tile->ct || !tex_tile->mask_t;
+ tex_tile->mm = rgbaint_t(tex_tile->ms ? ~0 : 0, tex_tile->ms ? ~0 : 0, tex_tile->mt ? ~0 : 0, tex_tile->mt ? ~0 : 0);
+ tex_tile->invmm = rgbaint_t(tex_tile->ms ? 0 : ~0, tex_tile->ms ? 0 : ~0, tex_tile->mt ? 0 : ~0, tex_tile->mt ? 0 : ~0);
+ tex_tile->mask = rgbaint_t(tex_tile->mask_s ? ~0 : 0, tex_tile->mask_s ? ~0 : 0, tex_tile->mask_t ? ~0 : 0, tex_tile->mask_t ? ~0 : 0);
+ tex_tile->invmask = rgbaint_t(tex_tile->mask_s ? 0 : ~0, tex_tile->mask_s ? 0 : ~0, tex_tile->mask_t ? 0 : ~0, tex_tile->mask_t ? 0 : ~0);
+ tex_tile->lshift = rgbaint_t(tex_tile->lshift_s, tex_tile->lshift_s, tex_tile->lshift_t, tex_tile->lshift_t);
+ tex_tile->rshift = rgbaint_t(tex_tile->rshift_s, tex_tile->rshift_s, tex_tile->rshift_t, tex_tile->rshift_t);
+ tex_tile->clamp_st = rgbaint_t(tex_tile->clamp_s ? ~0 : 0, tex_tile->clamp_s ? ~0 : 0, tex_tile->clamp_t ? ~0 : 0, tex_tile->clamp_t ? ~0 : 0);
if (tex_tile->format == FORMAT_I && tex_tile->size > PIXEL_SIZE_8BIT)
{
@@ -3030,7 +2810,6 @@ void n64_rdp::cmd_set_tile(UINT32 w1, UINT32 w2)
void n64_rdp::cmd_fill_rect(UINT32 w1, UINT32 w2)
{
//if(m_pending_mode_block) { wait("Block on pending mode-change"); m_pending_mode_block = false; }
-
const UINT32 xh = (w2 >> 12) & 0xfff;
const UINT32 xl = (w1 >> 12) & 0xfff;
const UINT32 yh = (w2 >> 0) & 0xfff;
@@ -3060,24 +2839,28 @@ void n64_rdp::cmd_fill_rect(UINT32 w1, UINT32 w2)
void n64_rdp::cmd_set_fog_color(UINT32 w1, UINT32 w2)
{
- m_fog_color.c = w2;
+ m_fog_color.set(w2 & 0xff, (w2 >> 24) & 0xff, (w2 >> 16) & 0xff, (w2 >> 8) & 0xff);
}
void n64_rdp::cmd_set_blend_color(UINT32 w1, UINT32 w2)
{
- m_blend_color.c = w2;
+ m_blend_color.set(w2 & 0xff, (w2 >> 24) & 0xff, (w2 >> 16) & 0xff, (w2 >> 8) & 0xff);
}
void n64_rdp::cmd_set_prim_color(UINT32 w1, UINT32 w2)
{
m_misc_state.m_min_level = (w1 >> 8) & 0x1f;
- m_prim_lod_fraction = w1 & 0xff;
- m_prim_color.c = w2;
+ const UINT8 prim_lod_fraction = w1 & 0xff;
+ m_prim_lod_fraction.set(prim_lod_fraction, prim_lod_fraction, prim_lod_fraction, prim_lod_fraction);
+
+ m_prim_color.set(w2 & 0xff, (w2 >> 24) & 0xff, (w2 >> 16) & 0xff, (w2 >> 8) & 0xff);
+ m_prim_alpha.set(w2 & 0xff, w2 & 0xff, w2 & 0xff, w2 & 0xff);
}
void n64_rdp::cmd_set_env_color(UINT32 w1, UINT32 w2)
{
- m_env_color.c = w2;
+ m_env_color.set(w2 & 0xff, (w2 >> 24) & 0xff, (w2 >> 16) & 0xff, (w2 >> 8) & 0xff);
+ m_env_alpha.set(w2 & 0xff, w2 & 0xff, w2 & 0xff, w2 & 0xff);
}
void n64_rdp::cmd_set_combine(UINT32 w1, UINT32 w2)
@@ -3258,6 +3041,8 @@ void n64_rdp::process_command_list()
n64_rdp::n64_rdp(n64_state &state) : poly_manager<UINT32, rdp_poly_state, 8, 32000>(state.machine())
{
+ ignore = false;
+ dolog = false;
m_aux_buf_ptr = 0;
m_aux_buf = NULL;
m_pipe_clean = true;
@@ -3272,13 +3057,8 @@ n64_rdp::n64_rdp(n64_state &state) : poly_manager<UINT32, rdp_poly_state, 8, 320
m_current = 0;
m_status = 0x88;
- for (INT32 i = 0; i < 8; i++)
- {
- m_tiles[i].num = i;
- }
-
- m_one.c = 0xffffffff;
- m_zero.c = 0x00000000;
+ m_one.set(0xff, 0xff, 0xff, 0xff);
+ m_zero.set(0, 0, 0, 0);
m_tmem = NULL;
@@ -3286,7 +3066,7 @@ n64_rdp::n64_rdp(n64_state &state) : poly_manager<UINT32, rdp_poly_state, 8, 320
//memset(m_hidden_bits, 3, 8388608);
- m_prim_lod_fraction = 0;
+ m_prim_lod_fraction.set(0, 0, 0, 0);
for (INT32 i = 0; i < 256; i++)
{
@@ -3337,6 +3117,9 @@ n64_rdp::n64_rdp(n64_state &state) : poly_manager<UINT32, rdp_poly_state, 8, 320
{
m_dzpix_normalize[i] = (UINT16)normalize_dzpix(i & 0xffff);
}
+
+ m_compute_cvg[0] = &n64_rdp::compute_cvg_noflip;
+ m_compute_cvg[1] = &n64_rdp::compute_cvg_flip;
}
void n64_state::video_start()
@@ -3415,3 +3198,828 @@ UINT32 n64_state::screen_update_n64(screen_device &screen, bitmap_rgb32 &bitmap,
return 0;
}
+
+void n64_rdp::render_spans(INT32 start, INT32 end, INT32 tilenum, bool flip, extent_t* spans, bool rect, rdp_poly_state* object)
+{
+ const INT32 clipy1 = m_scissor.m_yh;
+ const INT32 clipy2 = m_scissor.m_yl;
+ INT32 offset = 0;
+
+ if (clipy2 <= 0)
+ {
+ return;
+ }
+
+ if (start < clipy1)
+ {
+ offset = clipy1 - start;
+ start = clipy1;
+ }
+ if (start >= clipy2)
+ {
+ offset = start - (clipy2 - 1);
+ start = clipy2 - 1;
+ }
+ if (end < clipy1)
+ {
+ end = clipy1;
+ }
+ if (end >= clipy2)
+ {
+ end = clipy2 - 1;
+ }
+
+ object->m_rdp = this;
+ memcpy(&object->m_misc_state, &m_misc_state, sizeof(misc_state_t));
+ memcpy(&object->m_other_modes, &m_other_modes, sizeof(other_modes_t));
+ memcpy(&object->m_span_base, &m_span_base, sizeof(span_base_t));
+ memcpy(&object->m_scissor, &m_scissor, sizeof(rectangle_t));
+ memcpy(&object->m_tiles, &m_tiles, 8 * sizeof(n64_tile_t));
+ object->tilenum = tilenum;
+ object->flip = flip;
+ object->m_fill_color = m_fill_color;
+ object->rect = rect;
+
+ switch(m_other_modes.cycle_type)
+ {
+ case CYCLE_TYPE_1:
+ render_triangle_custom(m_visarea, render_delegate(FUNC(n64_rdp::span_draw_1cycle), this), start, (end - start) + 1, spans + offset);
+ break;
+
+ case CYCLE_TYPE_2:
+ render_triangle_custom(m_visarea, render_delegate(FUNC(n64_rdp::span_draw_2cycle), this), start, (end - start) + 1, spans + offset);
+ break;
+
+ case CYCLE_TYPE_COPY:
+ render_triangle_custom(m_visarea, render_delegate(FUNC(n64_rdp::span_draw_copy), this), start, (end - start) + 1, spans + offset);
+ break;
+
+ case CYCLE_TYPE_FILL:
+ render_triangle_custom(m_visarea, render_delegate(FUNC(n64_rdp::span_draw_fill), this), start, (end - start) + 1, spans + offset);
+ break;
+ }
+ //wait();
+}
+
+void n64_rdp::rgbaz_clip(INT32 sr, INT32 sg, INT32 sb, INT32 sa, INT32* sz, rdp_span_aux* userdata)
+{
+ userdata->m_shade_color.set(sa, sr, sg, sb);
+ userdata->m_shade_color.clamp_and_clear(0xfffffe00);
+ UINT32 a = userdata->m_shade_color.get_a();
+ userdata->m_shade_alpha.set(a, a, a, a);
+
+ INT32 zanded = (*sz) & 0x60000;
+
+ zanded >>= 17;
+ switch(zanded)
+ {
+ case 0: *sz &= 0x3ffff; break;
+ case 1: *sz &= 0x3ffff; break;
+ case 2: *sz = 0x3ffff; break;
+ case 3: *sz = 0x3ffff; break;
+ }
+}
+
+void n64_rdp::rgbaz_correct_triangle(INT32 offx, INT32 offy, INT32* r, INT32* g, INT32* b, INT32* a, INT32* z, rdp_span_aux* userdata, const rdp_poly_state &object)
+{
+ if (userdata->m_current_pix_cvg == 8)
+ {
+ *r >>= 2;
+ *g >>= 2;
+ *b >>= 2;
+ *a >>= 2;
+ *z = (*z >> 3) & 0x7ffff;
+ }
+ else
+ {
+ INT32 summand_xr = offx * SIGN13(object.m_span_base.m_span_dr >> 14);
+ INT32 summand_yr = offy * SIGN13(object.m_span_base.m_span_drdy >> 14);
+ INT32 summand_xb = offx * SIGN13(object.m_span_base.m_span_db >> 14);
+ INT32 summand_yb = offy * SIGN13(object.m_span_base.m_span_dbdy >> 14);
+ INT32 summand_xg = offx * SIGN13(object.m_span_base.m_span_dg >> 14);
+ INT32 summand_yg = offy * SIGN13(object.m_span_base.m_span_dgdy >> 14);
+ INT32 summand_xa = offx * SIGN13(object.m_span_base.m_span_da >> 14);
+ INT32 summand_ya = offy * SIGN13(object.m_span_base.m_span_dady >> 14);
+
+ INT32 summand_xz = offx * SIGN22(object.m_span_base.m_span_dz >> 10);
+ INT32 summand_yz = offy * SIGN22(object.m_span_base.m_span_dzdy >> 10);
+
+ *r = ((*r << 2) + summand_xr + summand_yr) >> 4;
+ *g = ((*g << 2) + summand_xg + summand_yg) >> 4;
+ *b = ((*b << 2) + summand_xb + summand_yb) >> 4;
+ *a = ((*a << 2) + summand_xa + summand_ya) >> 4;
+ *z = (((*z << 2) + summand_xz + summand_yz) >> 5) & 0x7ffff;
+ }
+}
+
+inline void n64_rdp::write_pixel(UINT32 curpixel, color_t& color, rdp_span_aux* userdata, const rdp_poly_state &object)
+{
+ if (object.m_misc_state.m_fb_size == 2) // 16-bit framebuffer
+ {
+ const UINT32 fb = (object.m_misc_state.m_fb_address >> 1) + curpixel;
+
+ UINT16 finalcolor;
+ if (object.m_other_modes.color_on_cvg && !userdata->m_pre_wrap)
+ {
+ finalcolor = RREADIDX16(fb) & 0xfffe;
+ }
+ else
+ {
+ color.shr_imm(3);
+ finalcolor = (color.get_r() << 11) | (color.get_g() << 6) | (color.get_b() << 1);
+ }
+
+ switch (object.m_other_modes.cvg_dest)
+ {
+ case 0:
+ if (userdata->m_blend_enable)
+ {
+ UINT32 finalcvg = userdata->m_current_pix_cvg + userdata->m_current_mem_cvg;
+ if (finalcvg & 8)
+ {
+ finalcvg = 7;
+ }
+ RWRITEIDX16(fb, finalcolor | (finalcvg >> 2));
+ HWRITEADDR8(fb, finalcvg & 3);
+ }
+ else
+ {
+ const UINT32 finalcvg = (userdata->m_current_pix_cvg - 1) & 7;
+ RWRITEIDX16(fb, finalcolor | (finalcvg >> 2));
+ HWRITEADDR8(fb, finalcvg & 3);
+ }
+ break;
+ case 1:
+ {
+ const UINT32 finalcvg = (userdata->m_current_pix_cvg + userdata->m_current_mem_cvg) & 7;
+ RWRITEIDX16(fb, finalcolor | (finalcvg >> 2));
+ HWRITEADDR8(fb, finalcvg & 3);
+ break;
+ }
+ case 2:
+ RWRITEIDX16(fb, finalcolor | 1);
+ HWRITEADDR8(fb, 3);
+ break;
+ case 3:
+ RWRITEIDX16(fb, finalcolor | (userdata->m_current_mem_cvg >> 2));
+ HWRITEADDR8(fb, userdata->m_current_mem_cvg & 3);
+ break;
+ }
+ }
+ else // 32-bit framebuffer
+ {
+ const UINT32 fb = (object.m_misc_state.m_fb_address >> 2) + curpixel;
+
+ UINT32 finalcolor;
+ if (object.m_other_modes.color_on_cvg && !userdata->m_pre_wrap)
+ {
+ finalcolor = RREADIDX32(fb) & 0xffffff00;
+ }
+ else
+ {
+ finalcolor = (color.get_r() << 24) | (color.get_g() << 16) | (color.get_b() << 8);
+ }
+
+ switch (object.m_other_modes.cvg_dest)
+ {
+ case 0:
+ if (userdata->m_blend_enable)
+ {
+ UINT32 finalcvg = userdata->m_current_pix_cvg + userdata->m_current_mem_cvg;
+ if (finalcvg & 8)
+ {
+ finalcvg = 7;
+ }
+
+ RWRITEIDX32(fb, finalcolor | (finalcvg << 5));
+ }
+ else
+ {
+ RWRITEIDX32(fb, finalcolor | (((userdata->m_current_pix_cvg - 1) & 7) << 5));
+ }
+ break;
+ case 1:
+ RWRITEIDX32(fb, finalcolor | (((userdata->m_current_pix_cvg + userdata->m_current_mem_cvg) & 7) << 5));
+ break;
+ case 2:
+ RWRITEIDX32(fb, finalcolor | 0xE0);
+ break;
+ case 3:
+ RWRITEIDX32(fb, finalcolor | (userdata->m_current_mem_cvg << 5));
+ break;
+ }
+ }
+}
+
+inline void n64_rdp::read_pixel(UINT32 curpixel, rdp_span_aux* userdata, const rdp_poly_state &object)
+{
+ if (object.m_misc_state.m_fb_size == 2) // 16-bit framebuffer
+ {
+ const UINT16 fword = RREADIDX16((object.m_misc_state.m_fb_address >> 1) + curpixel);
+
+ userdata->m_memory_color.set(0, GETHICOL(fword), GETMEDCOL(fword), GETLOWCOL(fword));
+ if (object.m_other_modes.image_read_en)
+ {
+ UINT8 hbyte = HREADADDR8((object.m_misc_state.m_fb_address >> 1) + curpixel);
+ userdata->m_memory_color.set_a(userdata->m_current_mem_cvg << 5);
+ userdata->m_current_mem_cvg = ((fword & 1) << 2) | (hbyte & 3);
+ }
+ else
+ {
+ userdata->m_memory_color.set_a(0xff);
+ userdata->m_current_mem_cvg = 7;
+ }
+ }
+ else // 32-bit framebuffer
+ {
+ const UINT32 mem = RREADIDX32((object.m_misc_state.m_fb_address >> 2) + curpixel);
+ userdata->m_memory_color.set(0, (mem >> 24) & 0xff, (mem >> 16) & 0xff, (mem >> 8) & 0xff);
+ if (object.m_other_modes.image_read_en)
+ {
+ userdata->m_memory_color.set_a(mem & 0xff);
+ userdata->m_current_mem_cvg = (mem >> 5) & 7;
+ }
+ else
+ {
+ userdata->m_memory_color.set_a(0xff);
+ userdata->m_current_mem_cvg = 7;
+ }
+ }
+}
+
+inline void n64_rdp::copy_pixel(UINT32 curpixel, color_t& color, const rdp_poly_state &object)
+{
+ const UINT32 current_pix_cvg = color.get_a() ? 7 : 0;
+ const UINT8 r = color.get_r(); // Vectorize me
+ const UINT8 g = color.get_g();
+ const UINT8 b = color.get_b();
+ if (object.m_misc_state.m_fb_size == 2) // 16-bit framebuffer
+ {
+ RWRITEIDX16((object.m_misc_state.m_fb_address >> 1) + curpixel, ((r >> 3) << 11) | ((g >> 3) << 6) | ((b >> 3) << 1) | ((current_pix_cvg >> 2) & 1));
+ HWRITEADDR8((object.m_misc_state.m_fb_address >> 1) + curpixel, current_pix_cvg & 3);
+ }
+ else // 32-bit framebuffer
+ {
+ RWRITEIDX32((object.m_misc_state.m_fb_address >> 2) + curpixel, (r << 24) | (g << 16) | (b << 8) | (current_pix_cvg << 5));
+ }
+}
+
+inline void n64_rdp::fill_pixel(UINT32 curpixel, const rdp_poly_state &object)
+{
+ if (object.m_misc_state.m_fb_size == 2) // 16-bit framebuffer
+ {
+ UINT16 val;
+ if (curpixel & 1)
+ {
+ val = object.m_fill_color & 0xffff;
+ }
+ else
+ {
+ val = (object.m_fill_color >> 16) & 0xffff;
+ }
+ RWRITEIDX16((object.m_misc_state.m_fb_address >> 1) + curpixel, val);
+ HWRITEADDR8((object.m_misc_state.m_fb_address >> 1) + curpixel, ((val & 1) << 1) | (val & 1));
+ }
+ else // 32-bit framebuffer
+ {
+ RWRITEIDX32((object.m_misc_state.m_fb_address >> 2) + curpixel, object.m_fill_color);
+ HWRITEADDR8((object.m_misc_state.m_fb_address >> 1) + (curpixel << 1), (object.m_fill_color & 0x10000) ? 3 : 0);
+ HWRITEADDR8((object.m_misc_state.m_fb_address >> 1) + (curpixel << 1) + 1, (object.m_fill_color & 0x1) ? 3 : 0);
+ }
+}
+
+void n64_rdp::span_draw_1cycle(INT32 scanline, const extent_t &extent, const rdp_poly_state &object, INT32 threadid)
+{
+ assert(object.m_misc_state.m_fb_size >= 2 && object.m_misc_state.m_fb_size < 4);
+
+ const INT32 clipx1 = object.m_scissor.m_xh;
+ const INT32 clipx2 = object.m_scissor.m_xl;
+ const INT32 tilenum = object.tilenum;
+ const bool flip = object.flip;
+
+ span_param_t r; r.w = extent.param[SPAN_R].start;
+ span_param_t g; g.w = extent.param[SPAN_G].start;
+ span_param_t b; b.w = extent.param[SPAN_B].start;
+ span_param_t a; a.w = extent.param[SPAN_A].start;
+ span_param_t z; z.w = extent.param[SPAN_Z].start;
+ span_param_t s; s.w = extent.param[SPAN_S].start;
+ span_param_t t; t.w = extent.param[SPAN_T].start;
+ span_param_t w; w.w = extent.param[SPAN_W].start;
+
+ const UINT32 zb = object.m_misc_state.m_zb_address >> 1;
+ const UINT32 zhb = object.m_misc_state.m_zb_address;
+
+#ifdef PTR64
+ assert(extent.userdata != (const void *)0xcccccccccccccccc);
+#else
+ assert(extent.userdata != (const void *)0xcccccccc);
+#endif
+ rdp_span_aux* userdata = (rdp_span_aux*)extent.userdata;
+
+ m_tex_pipe.calculate_clamp_diffs(tilenum, userdata, object);
+
+ const bool partialreject = (userdata->m_color_inputs.blender2b_a[0] == &userdata->m_inv_pixel_color && userdata->m_color_inputs.blender1b_a[0] == &userdata->m_pixel_color);
+ const INT32 sel0 = (userdata->m_color_inputs.blender2b_a[0] == &userdata->m_memory_color) ? 1 : 0;
+
+ INT32 drinc, dginc, dbinc, dainc;
+ INT32 dzinc, dzpix;
+ INT32 dsinc, dtinc, dwinc;
+ INT32 xinc;
+
+ if (!flip)
+ {
+ drinc = -object.m_span_base.m_span_dr;
+ dginc = -object.m_span_base.m_span_dg;
+ dbinc = -object.m_span_base.m_span_db;
+ dainc = -object.m_span_base.m_span_da;
+ dzinc = -object.m_span_base.m_span_dz;
+ dsinc = -object.m_span_base.m_span_ds;
+ dtinc = -object.m_span_base.m_span_dt;
+ dwinc = -object.m_span_base.m_span_dw;
+ xinc = -1;
+ }
+ else
+ {
+ drinc = object.m_span_base.m_span_dr;
+ dginc = object.m_span_base.m_span_dg;
+ dbinc = object.m_span_base.m_span_db;
+ dainc = object.m_span_base.m_span_da;
+ dzinc = object.m_span_base.m_span_dz;
+ dsinc = object.m_span_base.m_span_ds;
+ dtinc = object.m_span_base.m_span_dt;
+ dwinc = object.m_span_base.m_span_dw;
+ xinc = 1;
+ }
+
+ const INT32 fb_index = object.m_misc_state.m_fb_width * scanline;
+
+ const INT32 xstart = extent.startx;
+ const INT32 xend = userdata->m_unscissored_rx;
+ const INT32 xend_scissored = extent.stopx;
+
+ INT32 x = xend;
+
+ const INT32 length = flip ? (xstart - xend) : (xend - xstart);
+
+ if(object.m_other_modes.z_source_sel)
+ {
+ z.w = object.m_misc_state.m_primitive_z;
+ dzpix = object.m_misc_state.m_primitive_dz;
+ dzinc = 0;
+ }
+ else
+ {
+ dzpix = object.m_span_base.m_span_dzpix;
+ }
+
+ if (object.m_misc_state.m_fb_size < 2 || object.m_misc_state.m_fb_size > 4)
+ fatalerror("unsupported m_fb_size %d\n", object.m_misc_state.m_fb_size);
+
+ const INT32 blend_index = (object.m_other_modes.alpha_cvg_select ? 2 : 0) | ((object.m_other_modes.rgb_dither_sel < 3) ? 1 : 0);
+ const INT32 cycle0 = ((object.m_other_modes.sample_type & 1) << 1) | (object.m_other_modes.bi_lerp0 & 1);
+
+ INT32 sss = 0;
+ INT32 sst = 0;
+
+ if (object.m_other_modes.persp_tex_en)
+ {
+ tc_div(s.w >> 16, t.w >> 16, w.w >> 16, &sss, &sst);
+ }
+ else
+ {
+ tc_div_no_perspective(s.w >> 16, t.w >> 16, w.w >> 16, &sss, &sst);
+ }
+
+ userdata->m_start_span = true;
+ for (INT32 j = 0; j <= length; j++)
+ {
+ INT32 sr = r.w >> 14;
+ INT32 sg = g.w >> 14;
+ INT32 sb = b.w >> 14;
+ INT32 sa = a.w >> 14;
+ INT32 sz = (z.w >> 10) & 0x3fffff;
+ const bool valid_x = (flip) ? (x >= xend_scissored) : (x <= xend_scissored);
+
+ if (x >= clipx1 && x < clipx2 && valid_x)
+ {
+ UINT8 offx, offy;
+ lookup_cvmask_derivatives(userdata->m_cvg[x], &offx, &offy, userdata);
+
+ m_tex_pipe.lod_1cycle(&sss, &sst, s.w, t.w, w.w, dsinc, dtinc, dwinc, userdata, object);
+
+ rgbaz_correct_triangle(offx, offy, &sr, &sg, &sb, &sa, &sz, userdata, object);
+ rgbaz_clip(sr, sg, sb, sa, &sz, userdata);
+
+ ((m_tex_pipe).*(m_tex_pipe.m_cycle[cycle0]))(&userdata->m_texel0_color, &userdata->m_texel0_color, sss, sst, tilenum, 0, userdata, object);
+ UINT32 t0a = userdata->m_texel0_color.get_a();
+ userdata->m_texel0_alpha.set(t0a, t0a, t0a, t0a);
+
+ const UINT8 noise = rand() << 3; // Not accurate
+ userdata->m_noise_color.set(0, noise, noise, noise);
+
+ rgbaint_t rgbsub_a(*userdata->m_color_inputs.combiner_rgbsub_a[1]);
+ rgbaint_t rgbsub_b(*userdata->m_color_inputs.combiner_rgbsub_b[1]);
+ rgbaint_t rgbmul(*userdata->m_color_inputs.combiner_rgbmul[1]);
+ rgbaint_t rgbadd(*userdata->m_color_inputs.combiner_rgbadd[1]);
+
+ rgbsub_a.merge_alpha(*userdata->m_color_inputs.combiner_alphasub_a[1]);
+ rgbsub_b.merge_alpha(*userdata->m_color_inputs.combiner_alphasub_b[1]);
+ rgbmul.merge_alpha(*userdata->m_color_inputs.combiner_alphamul[1]);
+ rgbadd.merge_alpha(*userdata->m_color_inputs.combiner_alphaadd[1]);
+
+ rgbsub_a.sign_extend(0x180, 0xfffffe00);
+ rgbsub_b.sign_extend(0x180, 0xfffffe00);
+ rgbadd.sign_extend(0x180, 0xfffffe00);
+
+ rgbadd.shl_imm(8);
+ rgbsub_a.sub(rgbsub_b);
+ rgbsub_a.mul(rgbmul);
+ rgbsub_a.add(rgbadd);
+ rgbsub_a.add_imm(0x0080);
+ rgbsub_a.sra_imm(8);
+ rgbsub_a.clamp_and_clear(0xfffffe00);
+
+ userdata->m_pixel_color = rgbsub_a;
+
+ //Alpha coverage combiner
+ userdata->m_pixel_color.set_a(get_alpha_cvg(userdata->m_pixel_color.get_a(), userdata, object));
+
+ const UINT32 curpixel = fb_index + x;
+ const UINT32 zbcur = zb + curpixel;
+ const UINT32 zhbcur = zhb + curpixel;
+
+ read_pixel(curpixel, userdata, object);
+
+ if(z_compare(zbcur, zhbcur, sz, dzpix, userdata, object))
+ {
+ INT32 cdith = 0;
+ INT32 adith = 0;
+ get_dither_values(scanline, j, &cdith, &adith, object);
+
+ color_t blended_pixel;
+ bool rendered = ((&m_blender)->*(m_blender.blend1[(userdata->m_blend_enable << 2) | blend_index]))(blended_pixel, cdith, adith, partialreject, sel0, userdata, object);
+
+ if (rendered)
+ {
+ write_pixel(curpixel, blended_pixel, userdata, object);
+ if (object.m_other_modes.z_update_en)
+ {
+ z_store(object, zbcur, zhbcur, sz, userdata->m_dzpix_enc);
+ }
+ }
+ }
+
+ sss = userdata->m_precomp_s;
+ sst = userdata->m_precomp_t;
+ }
+
+ r.w += drinc;
+ g.w += dginc;
+ b.w += dbinc;
+ a.w += dainc;
+ s.w += dsinc;
+ t.w += dtinc;
+ w.w += dwinc;
+ z.w += dzinc;
+
+ x += xinc;
+ }
+}
+
+void n64_rdp::span_draw_2cycle(INT32 scanline, const extent_t &extent, const rdp_poly_state &object, INT32 threadid)
+{
+ assert(object.m_misc_state.m_fb_size >= 2 && object.m_misc_state.m_fb_size < 4);
+
+ const INT32 clipx1 = object.m_scissor.m_xh;
+ const INT32 clipx2 = object.m_scissor.m_xl;
+ const INT32 tilenum = object.tilenum;
+ const bool flip = object.flip;
+
+ span_param_t r; r.w = extent.param[SPAN_R].start;
+ span_param_t g; g.w = extent.param[SPAN_G].start;
+ span_param_t b; b.w = extent.param[SPAN_B].start;
+ span_param_t a; a.w = extent.param[SPAN_A].start;
+ span_param_t z; z.w = extent.param[SPAN_Z].start;
+ span_param_t s; s.w = extent.param[SPAN_S].start;
+ span_param_t t; t.w = extent.param[SPAN_T].start;
+ span_param_t w; w.w = extent.param[SPAN_W].start;
+
+ const UINT32 zb = object.m_misc_state.m_zb_address >> 1;
+ const UINT32 zhb = object.m_misc_state.m_zb_address;
+
+ INT32 tile2 = (tilenum + 1) & 7;
+ INT32 tile1 = tilenum;
+ const UINT32 prim_tile = tilenum;
+
+ INT32 newtile1 = tile1;
+ INT32 news = 0;
+ INT32 newt = 0;
+
+#ifdef PTR64
+ assert(extent.userdata != (const void *)0xcccccccccccccccc);
+#else
+ assert(extent.userdata != (const void *)0xcccccccc);
+#endif
+ rdp_span_aux* userdata = (rdp_span_aux*)extent.userdata;
+
+ m_tex_pipe.calculate_clamp_diffs(tile1, userdata, object);
+
+ bool partialreject = (userdata->m_color_inputs.blender2b_a[1] == &userdata->m_inv_pixel_color && userdata->m_color_inputs.blender1b_a[1] == &userdata->m_pixel_color);
+ INT32 sel0 = (userdata->m_color_inputs.blender2b_a[0] == &userdata->m_memory_color) ? 1 : 0;
+ INT32 sel1 = (userdata->m_color_inputs.blender2b_a[1] == &userdata->m_memory_color) ? 1 : 0;
+
+ INT32 drinc, dginc, dbinc, dainc;
+ INT32 dzinc, dzpix;
+ INT32 dsinc, dtinc, dwinc;
+ INT32 xinc;
+
+ if (!flip)
+ {
+ drinc = -object.m_span_base.m_span_dr;
+ dginc = -object.m_span_base.m_span_dg;
+ dbinc = -object.m_span_base.m_span_db;
+ dainc = -object.m_span_base.m_span_da;
+ dzinc = -object.m_span_base.m_span_dz;
+ dsinc = -object.m_span_base.m_span_ds;
+ dtinc = -object.m_span_base.m_span_dt;
+ dwinc = -object.m_span_base.m_span_dw;
+ xinc = -1;
+ }
+ else
+ {
+ drinc = object.m_span_base.m_span_dr;
+ dginc = object.m_span_base.m_span_dg;
+ dbinc = object.m_span_base.m_span_db;
+ dainc = object.m_span_base.m_span_da;
+ dzinc = object.m_span_base.m_span_dz;
+ dsinc = object.m_span_base.m_span_ds;
+ dtinc = object.m_span_base.m_span_dt;
+ dwinc = object.m_span_base.m_span_dw;
+ xinc = 1;
+ }
+
+ const INT32 fb_index = object.m_misc_state.m_fb_width * scanline;
+
+ INT32 cdith = 0;
+ INT32 adith = 0;
+
+ const INT32 xstart = extent.startx;
+ const INT32 xend = userdata->m_unscissored_rx;
+ const INT32 xend_scissored = extent.stopx;
+
+ INT32 x = xend;
+
+ const INT32 length = flip ? (xstart - xend) : (xend - xstart);
+
+ if(object.m_other_modes.z_source_sel)
+ {
+ z.w = object.m_misc_state.m_primitive_z;
+ dzpix = object.m_misc_state.m_primitive_dz;
+ dzinc = 0;
+ }
+ else
+ {
+ dzpix = object.m_span_base.m_span_dzpix;
+ }
+
+ if (object.m_misc_state.m_fb_size < 2 || object.m_misc_state.m_fb_size > 4)
+ fatalerror("unsupported m_fb_size %d\n", object.m_misc_state.m_fb_size);
+
+ const INT32 blend_index = (object.m_other_modes.alpha_cvg_select ? 2 : 0) | ((object.m_other_modes.rgb_dither_sel < 3) ? 1 : 0);
+ const INT32 cycle0 = ((object.m_other_modes.sample_type & 1) << 1) | (object.m_other_modes.bi_lerp0 & 1);
+ const INT32 cycle1 = ((object.m_other_modes.sample_type & 1) << 1) | (object.m_other_modes.bi_lerp1 & 1);
+
+ INT32 sss = 0;
+ INT32 sst = 0;
+
+ if (object.m_other_modes.persp_tex_en)
+ {
+ tc_div(s.w >> 16, t.w >> 16, w.w >> 16, &sss, &sst);
+ }
+ else
+ {
+ tc_div_no_perspective(s.w >> 16, t.w >> 16, w.w >> 16, &sss, &sst);
+ }
+
+ userdata->m_start_span = true;
+ for (INT32 j = 0; j <= length; j++)
+ {
+ INT32 sr = r.w >> 14;
+ INT32 sg = g.w >> 14;
+ INT32 sb = b.w >> 14;
+ INT32 sa = a.w >> 14;
+ INT32 sz = (z.w >> 10) & 0x3fffff;
+ color_t c1;
+ color_t c2;
+
+ const bool valid_x = (flip) ? (x >= xend_scissored) : (x <= xend_scissored);
+
+ if (x >= clipx1 && x < clipx2 && valid_x)
+ {
+ const UINT32 compidx = m_compressed_cvmasks[userdata->m_cvg[x]];
+ userdata->m_current_pix_cvg = cvarray[compidx].cvg;
+ userdata->m_current_cvg_bit = cvarray[compidx].cvbit;
+ const UINT8 offx = cvarray[compidx].xoff;
+ const UINT8 offy = cvarray[compidx].yoff;
+ //lookup_cvmask_derivatives(userdata->m_cvg[x], &offx, &offy, userdata);
+
+ m_tex_pipe.lod_2cycle(&sss, &sst, s.w, t.w, w.w, dsinc, dtinc, dwinc, prim_tile, &tile1, &tile2, userdata, object);
+
+ news = userdata->m_precomp_s;
+ newt = userdata->m_precomp_t;
+ m_tex_pipe.lod_2cycle_limited(&news, &newt, s.w + dsinc, t.w + dtinc, w.w + dwinc, dsinc, dtinc, dwinc, prim_tile, &newtile1, object);
+
+ rgbaz_correct_triangle(offx, offy, &sr, &sg, &sb, &sa, &sz, userdata, object);
+ rgbaz_clip(sr, sg, sb, sa, &sz, userdata);
+
+ ((m_tex_pipe).*(m_tex_pipe.m_cycle[cycle0]))(&userdata->m_texel0_color, &userdata->m_texel0_color, sss, sst, tile1, 0, userdata, object);
+ ((m_tex_pipe).*(m_tex_pipe.m_cycle[cycle1]))(&userdata->m_texel1_color, &userdata->m_texel0_color, sss, sst, tile2, 1, userdata, object);
+ ((m_tex_pipe).*(m_tex_pipe.m_cycle[cycle1]))(&userdata->m_next_texel_color, &userdata->m_next_texel_color, sss, sst, tile2, 1, userdata, object);
+
+ UINT32 t0a = userdata->m_texel0_color.get_a();
+ UINT32 t1a = userdata->m_texel1_color.get_a();
+ UINT32 tna = userdata->m_next_texel_color.get_a();
+ userdata->m_texel0_alpha.set(t0a, t0a, t0a, t0a);
+ userdata->m_texel1_alpha.set(t1a, t1a, t1a, t1a);
+ userdata->m_next_texel_alpha.set(tna, tna, tna, tna);
+
+ const UINT8 noise = rand() << 3; // Not accurate
+ userdata->m_noise_color.set(0, noise, noise, noise);
+
+ rgbaint_t rgbsub_a(*userdata->m_color_inputs.combiner_rgbsub_a[0]);
+ rgbaint_t rgbsub_b(*userdata->m_color_inputs.combiner_rgbsub_b[0]);
+ rgbaint_t rgbmul(*userdata->m_color_inputs.combiner_rgbmul[0]);
+ rgbaint_t rgbadd(*userdata->m_color_inputs.combiner_rgbadd[0]);
+
+ rgbsub_a.merge_alpha(*userdata->m_color_inputs.combiner_alphasub_a[0]);
+ rgbsub_b.merge_alpha(*userdata->m_color_inputs.combiner_alphasub_b[0]);
+ rgbmul.merge_alpha(*userdata->m_color_inputs.combiner_alphamul[0]);
+ rgbadd.merge_alpha(*userdata->m_color_inputs.combiner_alphaadd[0]);
+
+ rgbsub_a.sign_extend(0x180, 0xfffffe00);
+ rgbsub_b.sign_extend(0x180, 0xfffffe00);
+ rgbadd.sign_extend(0x180, 0xfffffe00);
+
+ rgbadd.shl_imm(8);
+ rgbsub_a.sub(rgbsub_b);
+ rgbsub_a.mul(rgbmul);
+
+ rgbsub_a.add(rgbadd);
+ rgbsub_a.add_imm(0x0080);
+ rgbsub_a.sra_imm(8);
+ rgbsub_a.clamp_and_clear(0xfffffe00);
+
+ userdata->m_combined_color.set(rgbsub_a);
+ userdata->m_texel0_color.set(userdata->m_texel1_color);
+ userdata->m_texel1_color.set(userdata->m_next_texel_color);
+
+ UINT32 ca = userdata->m_combined_color.get_a();
+ userdata->m_combined_alpha.set(ca, ca, ca, ca);
+ userdata->m_texel0_alpha.set(userdata->m_texel1_alpha);
+ userdata->m_texel1_alpha.set(userdata->m_next_texel_alpha);
+
+ rgbsub_a.set(*userdata->m_color_inputs.combiner_rgbsub_a[1]);
+ rgbsub_b.set(*userdata->m_color_inputs.combiner_rgbsub_b[1]);
+ rgbmul.set(*userdata->m_color_inputs.combiner_rgbmul[1]);
+ rgbadd.set(*userdata->m_color_inputs.combiner_rgbadd[1]);
+
+ rgbsub_a.merge_alpha(*userdata->m_color_inputs.combiner_alphasub_a[1]);
+ rgbsub_b.merge_alpha(*userdata->m_color_inputs.combiner_alphasub_b[1]);
+ rgbmul.merge_alpha(*userdata->m_color_inputs.combiner_alphamul[1]);
+ rgbadd.merge_alpha(*userdata->m_color_inputs.combiner_alphaadd[1]);
+
+ rgbsub_a.sign_extend(0x180, 0xfffffe00);
+ rgbsub_b.sign_extend(0x180, 0xfffffe00);
+ rgbadd.sign_extend(0x180, 0xfffffe00);
+
+ rgbadd.shl_imm(8);
+ rgbsub_a.sub(rgbsub_b);
+ rgbsub_a.mul(rgbmul);
+ rgbsub_a.add(rgbadd);
+ rgbsub_a.add_imm(0x0080);
+ rgbsub_a.sra_imm(8);
+ rgbsub_a.clamp_and_clear(0xfffffe00);
+
+ userdata->m_pixel_color.set(rgbsub_a);
+
+ //Alpha coverage combiner
+ userdata->m_pixel_color.set_a(get_alpha_cvg(userdata->m_pixel_color.get_a(), userdata, object));
+
+ const UINT32 curpixel = fb_index + x;
+ const UINT32 zbcur = zb + curpixel;
+ const UINT32 zhbcur = zhb + curpixel;
+
+ read_pixel(curpixel, userdata, object);
+
+ if(z_compare(zbcur, zhbcur, sz, dzpix, userdata, object))
+ {
+ get_dither_values(scanline, j, &cdith, &adith, object);
+
+ color_t blended_pixel;
+ bool rendered = ((&m_blender)->*(m_blender.blend2[(userdata->m_blend_enable << 2) | blend_index]))(blended_pixel, cdith, adith, partialreject, sel0, sel1, userdata, object);
+
+ if (rendered)
+ {
+ write_pixel(curpixel, blended_pixel, userdata, object);
+ if (object.m_other_modes.z_update_en)
+ {
+ z_store(object, zbcur, zhbcur, sz, userdata->m_dzpix_enc);
+ }
+ }
+ }
+ sss = userdata->m_precomp_s;
+ sst = userdata->m_precomp_t;
+ }
+
+ r.w += drinc;
+ g.w += dginc;
+ b.w += dbinc;
+ a.w += dainc;
+ s.w += dsinc;
+ t.w += dtinc;
+ w.w += dwinc;
+ z.w += dzinc;
+
+ x += xinc;
+ }
+}
+
+void n64_rdp::span_draw_copy(INT32 scanline, const extent_t &extent, const rdp_poly_state &object, INT32 threadid)
+{
+ const INT32 clipx1 = object.m_scissor.m_xh;
+ const INT32 clipx2 = object.m_scissor.m_xl;
+ const INT32 tilenum = object.tilenum;
+ const bool flip = object.flip;
+
+ rdp_span_aux* userdata = (rdp_span_aux*)extent.userdata;
+ const INT32 xstart = extent.startx;
+ const INT32 xend = userdata->m_unscissored_rx;
+ const INT32 xend_scissored = extent.stopx;
+ const INT32 xinc = flip ? 1 : -1;
+ const INT32 length = flip ? (xstart - xend) : (xend - xstart);
+
+ span_param_t s; s.w = extent.param[SPAN_S].start;
+ span_param_t t; t.w = extent.param[SPAN_T].start;
+
+ const INT32 ds = object.m_span_base.m_span_ds / 4;
+ const INT32 dt = object.m_span_base.m_span_dt / 4;
+ const INT32 dsinc = flip ? (ds) : -ds;
+ const INT32 dtinc = flip ? (dt) : -dt;
+
+ const INT32 fb_index = object.m_misc_state.m_fb_width * scanline;
+
+ INT32 x = xend;
+
+ for (INT32 j = 0; j <= length; j++)
+ {
+ const bool valid_x = (flip) ? (x >= xend_scissored) : (x <= xend_scissored);
+
+ if (x >= clipx1 && x < clipx2 && valid_x)
+ {
+ INT32 sss = s.h.h;
+ INT32 sst = t.h.h;
+ m_tex_pipe.copy(&userdata->m_texel0_color, sss, sst, tilenum, object, userdata);
+
+ UINT32 curpixel = fb_index + x;
+ if ((userdata->m_texel0_color.get_a() != 0) || (!object.m_other_modes.alpha_compare_en))
+ {
+ copy_pixel(curpixel, userdata->m_texel0_color, object);
+ }
+ }
+
+ s.w += dsinc;
+ t.w += dtinc;
+ x += xinc;
+ }
+}
+
+void n64_rdp::span_draw_fill(INT32 scanline, const extent_t &extent, const rdp_poly_state &object, INT32 threadid)
+{
+ assert(object.m_misc_state.m_fb_size >= 2 && object.m_misc_state.m_fb_size < 4);
+
+ const bool flip = object.flip;
+
+ const INT32 clipx1 = object.m_scissor.m_xh;
+ const INT32 clipx2 = object.m_scissor.m_xl;
+
+ const INT32 xinc = flip ? 1 : -1;
+
+ const INT32 fb_index = object.m_misc_state.m_fb_width * scanline;
+
+ const INT32 xstart = extent.startx;
+ const INT32 xend_scissored = extent.stopx;
+
+ INT32 x = xend_scissored;
+
+ const INT32 length = flip ? (xstart - xend_scissored) : (xend_scissored - xstart);
+
+ for (INT32 j = 0; j <= length; j++)
+ {
+ if (x >= clipx1 && x < clipx2)
+ {
+ fill_pixel(fb_index + x, object);
+ }
+
+ x += xinc;
+ }
+}
diff --git a/src/mame/video/n64.h b/src/mame/video/n64.h
index b17445e00d8..3900bc72048 100644
--- a/src/mame/video/n64.h
+++ b/src/mame/video/n64.h
@@ -6,8 +6,6 @@
#include "emu.h"
#include "includes/n64.h"
#include "video/poly.h"
-#include "video/rdpblend.h"
-#include "video/rdptpipe.h"
/*****************************************************************************/
@@ -119,8 +117,6 @@
#define SPAN_W (6)
#define SPAN_Z (7)
-#define RDP_CVG_SPAN_MAX (1024)
-
#define EXTENT_AUX_COUNT (sizeof(rdp_span_aux)*(480*192)) // Screen coverage *192, more or less
/*****************************************************************************/
@@ -128,291 +124,9 @@
class n64_periphs;
class n64_rdp;
-struct misc_state_t;
-struct other_modes_t;
-struct combine_mdoes_t;
-struct color_inputs_t;
-struct span_base_t;
-struct rectangle_t;
-
-class color_t
-{
- public:
- color_t()
- {
- c = 0;
- }
-
- union
- {
- UINT32 c;
-#ifdef LSB_FIRST
- struct { UINT8 a, b, g, r; } i;
-#else
- struct { UINT8 r, g, b, a; } i;
-#endif
- };
-};
-
-enum
-{
- BIT_DEPTH_32 = 0,
- BIT_DEPTH_16,
-
- BIT_DEPTH_COUNT
-};
-
-class SpanParam
-{
- public:
- union
- {
- UINT32 w;
-#ifdef LSB_FIRST
- struct { UINT16 l; INT16 h; } h;
-#else
- struct { INT16 h; UINT16 l; } h;
-#endif
- };
-};
-
-struct n64_tile_t
-{
- INT32 format; // Image data format: RGBA, YUV, CI, IA, I
- INT32 size; // Size of texel element: 4b, 8b, 16b, 32b
- INT32 line; // Size of tile line in bytes
- INT32 tmem; // Starting tmem address for this tile in bytes
- INT32 palette; // Palette number for 4b CI texels
- INT32 ct, mt, cs, ms; // Clamp / mirror enable bits for S / T direction
- INT32 mask_t, shift_t, mask_s, shift_s; // Mask values / LOD shifts
- INT32 lshift_s, rshift_s, lshift_t, rshift_t;
- INT32 wrapped_mask_s, wrapped_mask_t;
- bool clamp_s, clamp_t;
- UINT16 sl, tl, sh, th; // 10.2 fixed-point, starting and ending texel row / column
- INT32 num;
-};
-
-struct span_base_t
-{
- INT32 m_span_dr;
- INT32 m_span_dg;
- INT32 m_span_db;
- INT32 m_span_da;
- INT32 m_span_ds;
- INT32 m_span_dt;
- INT32 m_span_dw;
- INT32 m_span_dz;
- INT32 m_span_dymax;
- INT32 m_span_dzpix;
- INT32 m_span_drdy;
- INT32 m_span_dgdy;
- INT32 m_span_dbdy;
- INT32 m_span_dady;
- INT32 m_span_dzdy;
-};
-
-struct misc_state_t
-{
- misc_state_t()
- {
- m_max_level = 0;
- m_min_level = 0;
- }
-
- INT32 m_fb_format; // Framebuffer pixel format index (0 - I, 1 - IA, 2 - CI, 3 - RGBA)
- INT32 m_fb_size; // Framebuffer pixel size index (0 - 4bpp, 1 - 8bpp, 2 - 16bpp, 3 - 32bpp)
- INT32 m_fb_width; // Framebuffer width, in pixels
- INT32 m_fb_height; // Framebuffer height, in pixels
- UINT32 m_fb_address; // Framebuffer source address offset (in bytes) from start of RDRAM
-
- UINT32 m_zb_address; // Z-buffer source address offset (in bytes) from start of RDRAM
-
- INT32 m_ti_format; // Format for Texture Interface (TI) transfers
- INT32 m_ti_size; // Size (in bytes) of TI transfers
- INT32 m_ti_width; // Width (in pixels) of TI transfers
- UINT32 m_ti_address; // Destination address for TI transfers
-
- UINT8 m_random_seed; // %HACK%, adds 19 each time it's read and is more or less random
-
- UINT32 m_max_level; // Maximum LOD level for texture filtering
- UINT32 m_min_level; // Minimum LOD level for texture filtering
-
- UINT16 m_primitive_z; // Forced Z value for current primitive, if applicable
- UINT16 m_primitive_dz; // Forced Delta-Z value for current primitive, if applicable
-};
-
-struct combine_modes_t
-{
- INT32 sub_a_rgb0;
- INT32 sub_b_rgb0;
- INT32 mul_rgb0;
- INT32 add_rgb0;
- INT32 sub_a_a0;
- INT32 sub_b_a0;
- INT32 mul_a0;
- INT32 add_a0;
-
- INT32 sub_a_rgb1;
- INT32 sub_b_rgb1;
- INT32 mul_rgb1;
- INT32 add_rgb1;
- INT32 sub_a_a1;
- INT32 sub_b_a1;
- INT32 mul_a1;
- INT32 add_a1;
-};
-
-struct other_modes_t
-{
- INT32 cycle_type;
- bool persp_tex_en;
- bool detail_tex_en;
- bool sharpen_tex_en;
- bool tex_lod_en;
- bool en_tlut;
- bool tlut_type;
- bool sample_type;
- bool mid_texel;
- bool bi_lerp0;
- bool bi_lerp1;
- bool convert_one;
- bool key_en;
- INT32 rgb_dither_sel;
- INT32 alpha_dither_sel;
- INT32 blend_m1a_0;
- INT32 blend_m1a_1;
- INT32 blend_m1b_0;
- INT32 blend_m1b_1;
- INT32 blend_m2a_0;
- INT32 blend_m2a_1;
- INT32 blend_m2b_0;
- INT32 blend_m2b_1;
- INT32 tex_edge;
- INT32 force_blend;
- INT32 blend_shift;
- bool alpha_cvg_select;
- bool cvg_times_alpha;
- INT32 z_mode;
- INT32 cvg_dest;
- bool color_on_cvg;
- UINT8 image_read_en;
- bool z_update_en;
- bool z_compare_en;
- bool antialias_en;
- bool z_source_sel;
- INT32 dither_alpha_en;
- INT32 alpha_compare_en;
- INT32 alpha_dither_mode;
-};
-
-struct color_inputs_t
-{
- // combiner inputs
- UINT8* combiner_rgbsub_a_r[2];
- UINT8* combiner_rgbsub_a_g[2];
- UINT8* combiner_rgbsub_a_b[2];
- UINT8* combiner_rgbsub_b_r[2];
- UINT8* combiner_rgbsub_b_g[2];
- UINT8* combiner_rgbsub_b_b[2];
- UINT8* combiner_rgbmul_r[2];
- UINT8* combiner_rgbmul_g[2];
- UINT8* combiner_rgbmul_b[2];
- UINT8* combiner_rgbadd_r[2];
- UINT8* combiner_rgbadd_g[2];
- UINT8* combiner_rgbadd_b[2];
-
- UINT8* combiner_alphasub_a[2];
- UINT8* combiner_alphasub_b[2];
- UINT8* combiner_alphamul[2];
- UINT8* combiner_alphaadd[2];
-
- // blender input
- UINT8* blender1a_r[2];
- UINT8* blender1a_g[2];
- UINT8* blender1a_b[2];
- UINT8* blender1b_a[2];
- UINT8* blender2a_r[2];
- UINT8* blender2a_g[2];
- UINT8* blender2a_b[2];
- UINT8* blender2b_a[2];
-};
-
-// This is enormous and horrible
-struct rdp_span_aux
-{
- UINT32 m_unscissored_rx;
- UINT16 m_cvg[RDP_CVG_SPAN_MAX];
- color_t m_memory_color;
- color_t m_pixel_color;
- color_t m_inv_pixel_color;
- color_t m_blended_pixel_color;
- color_t m_combined_color;
- color_t m_texel0_color;
- color_t m_texel1_color;
- color_t m_next_texel_color;
- color_t m_blend_color; /* constant blend color */
- color_t m_prim_color; /* flat primitive color */
- color_t m_env_color; /* generic color constant ('environment') */
- color_t m_fog_color; /* generic color constant ('fog') */
- color_t m_shade_color; /* gouraud-shaded color */
- color_t m_key_scale; /* color-keying constant */
- color_t m_noise_color; /* noise */
- UINT8 m_lod_fraction; /* Z-based LOD fraction for this poly */
- UINT8 m_prim_lod_fraction; /* fixed LOD fraction for this poly */
- color_inputs_t m_color_inputs;
- UINT32 m_current_pix_cvg;
- UINT32 m_current_mem_cvg;
- UINT32 m_current_cvg_bit;
- INT32 m_shift_a;
- INT32 m_shift_b;
- INT32 m_precomp_s;
- INT32 m_precomp_t;
- INT32 m_blend_enable;
- bool m_pre_wrap;
- INT32 m_dzpix_enc;
- UINT8* m_tmem; /* pointer to texture cache for this polygon */
- bool m_start_span;
- INT32 m_clamp_s_diff[8];
- INT32 m_clamp_t_diff[8];
-};
-
-struct rectangle_t
-{
- UINT16 m_xl; // 10.2 fixed-point
- UINT16 m_yl; // 10.2 fixed-point
- UINT16 m_xh; // 10.2 fixed-point
- UINT16 m_yh; // 10.2 fixed-point
-};
-
-struct z_decompress_entry_t
-{
- UINT32 shift;
- UINT32 add;
-};
-
-struct cv_mask_derivative_t
-{
- UINT8 cvg;
- UINT8 cvbit;
- UINT8 xoff;
- UINT8 yoff;
-};
-
-struct rdp_poly_state
-{
- n64_rdp* m_rdp; /* pointer back to the RDP state */
-
- misc_state_t m_misc_state; /* miscellaneous rasterizer bits */
- other_modes_t m_other_modes; /* miscellaneous rasterizer bits (2) */
- span_base_t m_span_base; /* span initial values for triangle rasterization */
- rectangle_t m_scissor; /* screen-space scissor bounds */
- UINT32 m_fill_color; /* poly fill color */
- n64_tile_t m_tiles[8]; /* texture tile state */
- UINT8 m_tmem[0x1000]; /* texture cache */
- INT32 tilenum; /* texture tile index */
- bool flip; /* left-major / right-major flip */
- bool rect; /* primitive is rectangle (vs. triangle) */
-};
+#include "video/n64types.h"
+#include "video/rdpblend.h"
+#include "video/rdptpipe.h"
typedef void (*rdp_command_t)(UINT32 w1, UINT32 w2);
@@ -439,6 +153,13 @@ public:
memset(m_tiles, 0, 8 * sizeof(n64_tile_t));
memset(m_cmd_data, 0, sizeof(m_cmd_data));
+
+ for (INT32 i = 0; i < 8; i++)
+ {
+ m_tiles[i].num = i;
+ m_tiles[i].invmm = rgbaint_t(~0, ~0, ~0, ~0);
+ m_tiles[i].invmask = rgbaint_t(~0, ~0, ~0, ~0);
+ }
}
void process_command_list();
@@ -463,12 +184,12 @@ public:
// Color Combiner
INT32 color_combiner_equation(INT32 a, INT32 b, INT32 c, INT32 d);
INT32 alpha_combiner_equation(INT32 a, INT32 b, INT32 c, INT32 d);
- void set_suba_input_rgb(UINT8** input_r, UINT8** input_g, UINT8** input_b, INT32 code, rdp_span_aux* userdata);
- void set_subb_input_rgb(UINT8** input_r, UINT8** input_g, UINT8** input_b, INT32 code, rdp_span_aux* userdata);
- void set_mul_input_rgb(UINT8** input_r, UINT8** input_g, UINT8** input_b, INT32 code, rdp_span_aux* userdata);
- void set_add_input_rgb(UINT8** input_r, UINT8** input_g, UINT8** input_b, INT32 code, rdp_span_aux* userdata);
- void set_sub_input_alpha(UINT8** input, INT32 code, rdp_span_aux* userdata);
- void set_mul_input_alpha(UINT8** input, INT32 code, rdp_span_aux* userdata);
+ void set_suba_input_rgb(color_t** input, INT32 code, rdp_span_aux* userdata);
+ void set_subb_input_rgb(color_t** input, INT32 code, rdp_span_aux* userdata);
+ void set_mul_input_rgb(color_t** input, INT32 code, rdp_span_aux* userdata);
+ void set_add_input_rgb(color_t** input, INT32 code, rdp_span_aux* userdata);
+ void set_sub_input_alpha(color_t** input, INT32 code, rdp_span_aux* userdata);
+ void set_mul_input_alpha(color_t** input, INT32 code, rdp_span_aux* userdata);
// Texture memory
UINT8* get_tmem8() { return m_tmem; }
@@ -478,16 +199,12 @@ public:
UINT8 get_random() { return m_misc_state.m_random_seed += 0x13; }
// YUV Factors
- void set_yuv_factors(INT32 k0, INT32 k1, INT32 k2, INT32 k3, INT32 k4, INT32 k5) { m_k0 = k0; m_k1 = k1; m_k2 = k2; m_k3 = k3; m_k4 = k4; m_k5 = k5; }
- INT32 get_k0() const { return m_k0; }
- INT32 get_k1() const { return m_k1; }
- INT32 get_k2() const { return m_k2; }
- INT32 get_k3() const { return m_k3; }
- INT32* get_k4() { return &m_k4; }
- INT32* get_k5() { return &m_k5; }
+ void set_yuv_factors(color_t k023, color_t k1, color_t k4, color_t k5) { m_k023 = k023; m_k1 = k1; m_k4 = k4; m_k5 = k5; }
+ color_t& get_k023() { return m_k023; }
+ color_t& get_k1() { return m_k1; }
// Blender-related (move into RDP::Blender)
- void set_blender_input(INT32 cycle, INT32 which, UINT8** input_r, UINT8** input_g, UINT8** input_b, UINT8** input_a, INT32 a, INT32 b, rdp_span_aux* userdata);
+ void set_blender_input(INT32 cycle, INT32 which, color_t** input_rgb, color_t** input_a, INT32 a, INT32 b, rdp_span_aux* userdata);
// Span rasterization
void span_draw_1cycle(INT32 scanline, const extent_t &extent, const rdp_poly_state &object, INT32 threadid);
@@ -500,7 +217,7 @@ public:
void tc_div_no_perspective(INT32 ss, INT32 st, INT32 sw, INT32* sss, INT32* sst);
UINT32 get_log2(UINT32 lod_clamp);
void render_spans(INT32 start, INT32 end, INT32 tilenum, bool flip, extent_t* spans, bool rect, rdp_poly_state* object);
- void get_alpha_cvg(UINT8* comb_alpha, rdp_span_aux* userdata, const rdp_poly_state &object);
+ INT32 get_alpha_cvg(INT32 comb_alpha, rdp_span_aux* userdata, const rdp_poly_state &object);
void z_store(const rdp_poly_state &object, UINT32 zcurpixel, UINT32 dzcurpixel, UINT32 z, UINT32 enc);
UINT32 z_decompress(UINT32 zcurpixel);
@@ -566,11 +283,13 @@ public:
// Color constants
color_t m_blend_color; /* constant blend color */
color_t m_prim_color; /* flat primitive color */
+ color_t m_prim_alpha; /* flat primitive alpha */
color_t m_env_color; /* generic color constant ('environment') */
+ color_t m_env_alpha; /* generic alpha constant ('environment') */
color_t m_fog_color; /* generic color constant ('fog') */
color_t m_key_scale; /* color-keying constant */
- UINT8 m_lod_fraction; /* Z-based LOD fraction for this poly */
- UINT8 m_prim_lod_fraction; /* fixed LOD fraction for this poly */
+ color_t m_lod_fraction; /* Z-based LOD fraction for this poly */
+ color_t m_prim_lod_fraction; /* fixed LOD fraction for this poly */
color_t m_one;
color_t m_zero;
@@ -595,8 +314,6 @@ public:
rectangle m_visarea;
void draw_triangle(bool shade, bool texture, bool zbuffer, bool rect);
- void compute_cvg_noflip(extent_t* spans, INT32* majorx, INT32* minorx, INT32* majorxint, INT32* minorxint, INT32 scanline, INT32 yh, INT32 yl, INT32 base);
- void compute_cvg_flip(extent_t* spans, INT32* majorx, INT32* minorx, INT32* majorxint, INT32* minorxint, INT32 scanline, INT32 yh, INT32 yl, INT32 base);
void* m_aux_buf;
UINT32 m_aux_buf_ptr;
@@ -607,9 +324,12 @@ public:
n64_tile_t m_tiles[8];
private:
- void write_pixel(UINT32 curpixel, INT32 r, INT32 g, INT32 b, rdp_span_aux* userdata, const rdp_poly_state &object);
+ void compute_cvg_noflip(extent_t* spans, INT32* majorx, INT32* minorx, INT32* majorxint, INT32* minorxint, INT32 scanline, INT32 yh, INT32 yl, INT32 base);
+ void compute_cvg_flip(extent_t* spans, INT32* majorx, INT32* minorx, INT32* majorxint, INT32* minorxint, INT32 scanline, INT32 yh, INT32 yl, INT32 base);
+
+ void write_pixel(UINT32 curpixel, color_t& color, rdp_span_aux* userdata, const rdp_poly_state &object);
void read_pixel(UINT32 curpixel, rdp_span_aux* userdata, const rdp_poly_state &object);
- void copy_pixel(UINT32 curpixel, INT32 r, INT32 g, INT32 b, INT32 m_current_pix_cvg, const rdp_poly_state &object);
+ void copy_pixel(UINT32 curpixel, color_t& color, const rdp_poly_state &object);
void fill_pixel(UINT32 curpixel, const rdp_poly_state &object);
void precalc_cvmask_derivatives(void);
@@ -618,6 +338,9 @@ private:
void video_update16(n64_periphs* n64, bitmap_rgb32 &bitmap);
void video_update32(n64_periphs* n64, bitmap_rgb32 &bitmap);
+ typedef void (n64_rdp::*compute_cvg_t) (extent_t* spans, INT32* majorx, INT32* minorx, INT32* majorxint, INT32* minorxint, INT32 scanline, INT32 yh, INT32 yl, INT32 base);
+ compute_cvg_t m_compute_cvg[2];
+
running_machine* m_machine;
combine_modes_t m_combine;
@@ -644,12 +367,10 @@ private:
UINT8* m_tmem;
// YUV factors
- INT32 m_k0;
- INT32 m_k1;
- INT32 m_k2;
- INT32 m_k3;
- INT32 m_k4;
- INT32 m_k5;
+ color_t m_k023;
+ color_t m_k1;
+ color_t m_k4;
+ color_t m_k5;
// Texture perspective division
INT32 m_norm_point_rom[64];
@@ -667,6 +388,10 @@ private:
static const INT32 s_rdp_command_length[];
static const char* s_image_format[];
static const char* s_image_size[];
+
+public:
+ bool ignore;
+ bool dolog;
};
#endif // _VIDEO_N64_H_
diff --git a/src/mame/video/n64types.h b/src/mame/video/n64types.h
new file mode 100644
index 00000000000..fedac9e0225
--- /dev/null
+++ b/src/mame/video/n64types.h
@@ -0,0 +1,341 @@
+// license:BSD-3-Clause
+// copyright-holders:Ryan Holtz
+
+#ifndef _VIDEO_N64TYPES_H_
+#define _VIDEO_N64TYPES_H_
+
+#include "video/rgbutil.h"
+
+struct misc_state_t
+{
+ misc_state_t()
+ {
+ m_max_level = 0;
+ m_min_level = 0;
+ }
+
+ INT32 m_fb_format; // Framebuffer pixel format index (0 - I, 1 - IA, 2 - CI, 3 - RGBA)
+ INT32 m_fb_size; // Framebuffer pixel size index (0 - 4bpp, 1 - 8bpp, 2 - 16bpp, 3 - 32bpp)
+ INT32 m_fb_width; // Framebuffer width, in pixels
+ INT32 m_fb_height; // Framebuffer height, in pixels
+ UINT32 m_fb_address; // Framebuffer source address offset (in bytes) from start of RDRAM
+
+ UINT32 m_zb_address; // Z-buffer source address offset (in bytes) from start of RDRAM
+
+ INT32 m_ti_format; // Format for Texture Interface (TI) transfers
+ INT32 m_ti_size; // Size (in bytes) of TI transfers
+ INT32 m_ti_width; // Width (in pixels) of TI transfers
+ UINT32 m_ti_address; // Destination address for TI transfers
+
+ UINT8 m_random_seed; // %HACK%, adds 19 each time it's read and is more or less random
+
+ UINT32 m_max_level; // Maximum LOD level for texture filtering
+ UINT32 m_min_level; // Minimum LOD level for texture filtering
+
+ UINT16 m_primitive_z; // Forced Z value for current primitive, if applicable
+ UINT16 m_primitive_dz; // Forced Delta-Z value for current primitive, if applicable
+};
+
+#if 0
+class color_t
+{
+ public:
+ color_t()
+ {
+ c = 0;
+ }
+
+ color_t(UINT32 color)
+ {
+ set(color);
+ }
+
+ color_t(UINT8 a, UINT8 r, UINT8 g, UINT8 b)
+ {
+ set(a, r, g, b);
+ }
+
+ inline void set(color_t& other)
+ {
+ c = other.c;
+ }
+
+ inline void set(UINT32 color)
+ {
+ i.a = (color >> 24) & 0xff;
+ i.r = (color >> 16) & 0xff;
+ i.g = (color >> 8) & 0xff;
+ i.b = color & 0xff;
+ }
+
+ void set(UINT8 a, UINT8 r, UINT8 g, UINT8 b)
+ {
+ i.a = a;
+ i.r = r;
+ i.g = g;
+ i.b = b;
+ }
+
+ inline void set_direct(UINT32 color)
+ {
+ c = color;
+ }
+
+ UINT32 get()
+ {
+ return i.a << 24 | i.r << 16 | i.g << 8 | i.b;
+ }
+
+ union
+ {
+ UINT32 c;
+#ifdef LSB_FIRST
+ struct { UINT8 a, b, g, r; } i;
+#else
+ struct { UINT8 r, g, b, a; } i;
+#endif
+ };
+};
+#else
+#define color_t rgbaint_t
+#endif
+
+enum
+{
+ BIT_DEPTH_32 = 0,
+ BIT_DEPTH_16,
+
+ BIT_DEPTH_COUNT
+};
+
+struct n64_tile_t
+{
+ INT32 format; // Image data format: RGBA, YUV, CI, IA, I
+ INT32 size; // Size of texel element: 4b, 8b, 16b, 32b
+ INT32 line; // Size of tile line in bytes
+ INT32 tmem; // Starting tmem address for this tile in bytes
+ INT32 palette; // Palette number for 4b CI texels
+ INT32 ct, mt, cs, ms; // Clamp / mirror enable bits for S / T direction
+ INT32 mask_t, shift_t, mask_s, shift_s; // Mask values / LOD shifts
+ INT32 lshift_s, rshift_s, lshift_t, rshift_t;
+ INT32 wrapped_mask_s, wrapped_mask_t;
+ bool clamp_s, clamp_t;
+ rgbaint_t mm, invmm;
+ rgbaint_t wrapped_mask;
+ rgbaint_t mask;
+ rgbaint_t invmask;
+ rgbaint_t lshift;
+ rgbaint_t rshift;
+ rgbaint_t sth;
+ rgbaint_t stl;
+ rgbaint_t clamp_st;
+ UINT16 sl, tl, sh, th; // 10.2 fixed-point, starting and ending texel row / column
+ INT32 num;
+};
+
+struct span_base_t
+{
+ INT32 m_span_dr;
+ INT32 m_span_dg;
+ INT32 m_span_db;
+ INT32 m_span_da;
+ INT32 m_span_ds;
+ INT32 m_span_dt;
+ INT32 m_span_dw;
+ INT32 m_span_dz;
+ INT32 m_span_dymax;
+ INT32 m_span_dzpix;
+ INT32 m_span_drdy;
+ INT32 m_span_dgdy;
+ INT32 m_span_dbdy;
+ INT32 m_span_dady;
+ INT32 m_span_dzdy;
+};
+
+struct combine_modes_t
+{
+ INT32 sub_a_rgb0;
+ INT32 sub_b_rgb0;
+ INT32 mul_rgb0;
+ INT32 add_rgb0;
+ INT32 sub_a_a0;
+ INT32 sub_b_a0;
+ INT32 mul_a0;
+ INT32 add_a0;
+
+ INT32 sub_a_rgb1;
+ INT32 sub_b_rgb1;
+ INT32 mul_rgb1;
+ INT32 add_rgb1;
+ INT32 sub_a_a1;
+ INT32 sub_b_a1;
+ INT32 mul_a1;
+ INT32 add_a1;
+};
+
+struct color_inputs_t
+{
+ // combiner inputs
+ color_t* combiner_rgbsub_a[2];
+ color_t* combiner_rgbsub_b[2];
+ color_t* combiner_rgbmul[2];
+ color_t* combiner_rgbadd[2];
+
+ color_t* combiner_alphasub_a[2];
+ color_t* combiner_alphasub_b[2];
+ color_t* combiner_alphamul[2];
+ color_t* combiner_alphaadd[2];
+
+ // blender input
+ color_t* blender1a_rgb[2];
+ color_t* blender1b_a[2];
+ color_t* blender2a_rgb[2];
+ color_t* blender2b_a[2];
+};
+
+struct other_modes_t
+{
+ INT32 cycle_type;
+ bool persp_tex_en;
+ bool detail_tex_en;
+ bool sharpen_tex_en;
+ bool tex_lod_en;
+ bool en_tlut;
+ bool tlut_type;
+ bool sample_type;
+ bool mid_texel;
+ bool bi_lerp0;
+ bool bi_lerp1;
+ bool convert_one;
+ bool key_en;
+ INT32 rgb_dither_sel;
+ INT32 alpha_dither_sel;
+ INT32 blend_m1a_0;
+ INT32 blend_m1a_1;
+ INT32 blend_m1b_0;
+ INT32 blend_m1b_1;
+ INT32 blend_m2a_0;
+ INT32 blend_m2a_1;
+ INT32 blend_m2b_0;
+ INT32 blend_m2b_1;
+ INT32 tex_edge;
+ INT32 force_blend;
+ INT32 blend_shift;
+ bool alpha_cvg_select;
+ bool cvg_times_alpha;
+ INT32 z_mode;
+ INT32 cvg_dest;
+ bool color_on_cvg;
+ UINT8 image_read_en;
+ bool z_update_en;
+ bool z_compare_en;
+ bool antialias_en;
+ bool z_source_sel;
+ INT32 dither_alpha_en;
+ INT32 alpha_compare_en;
+ INT32 alpha_dither_mode;
+};
+
+struct rectangle_t
+{
+ UINT16 m_xl; // 10.2 fixed-point
+ UINT16 m_yl; // 10.2 fixed-point
+ UINT16 m_xh; // 10.2 fixed-point
+ UINT16 m_yh; // 10.2 fixed-point
+};
+
+struct rdp_poly_state
+{
+ n64_rdp* m_rdp; /* pointer back to the RDP state */
+
+ misc_state_t m_misc_state; /* miscellaneous rasterizer bits */
+ other_modes_t m_other_modes; /* miscellaneous rasterizer bits (2) */
+ span_base_t m_span_base; /* span initial values for triangle rasterization */
+ rectangle_t m_scissor; /* screen-space scissor bounds */
+ UINT32 m_fill_color; /* poly fill color */
+ n64_tile_t m_tiles[8]; /* texture tile state */
+ UINT8 m_tmem[0x1000]; /* texture cache */
+ INT32 tilenum; /* texture tile index */
+ bool flip; /* left-major / right-major flip */
+ bool rect; /* primitive is rectangle (vs. triangle) */
+};
+
+#define RDP_CVG_SPAN_MAX (1024)
+
+// This is enormous and horrible
+struct rdp_span_aux
+{
+ UINT32 m_unscissored_rx;
+ UINT16 m_cvg[RDP_CVG_SPAN_MAX];
+ color_t m_memory_color;
+ color_t m_pixel_color;
+ color_t m_inv_pixel_color;
+ color_t m_blended_pixel_color;
+
+ color_t m_combined_color;
+ color_t m_combined_alpha;
+ color_t m_texel0_color;
+ color_t m_texel0_alpha;
+ color_t m_texel1_color;
+ color_t m_texel1_alpha;
+ color_t m_next_texel_color;
+ color_t m_next_texel_alpha;
+ color_t m_blend_color; /* constant blend color */
+ color_t m_prim_color; /* flat primitive color */
+ color_t m_prim_alpha; /* flat primitive alpha */
+ color_t m_env_color; /* generic color constant ('environment') */
+ color_t m_env_alpha; /* generic alpha constant ('environment') */
+ color_t m_fog_color; /* generic color constant ('fog') */
+ color_t m_shade_color; /* gouraud-shaded color */
+ color_t m_shade_alpha; /* gouraud-shaded alpha */
+ color_t m_key_scale; /* color-keying constant */
+ color_t m_noise_color; /* noise */
+ color_t m_lod_fraction; /* Z-based LOD fraction for this poly */
+ color_t m_prim_lod_fraction; /* fixed LOD fraction for this poly */
+ color_t m_k4;
+ color_t m_k5;
+ color_inputs_t m_color_inputs;
+ UINT32 m_current_pix_cvg;
+ UINT32 m_current_mem_cvg;
+ UINT32 m_current_cvg_bit;
+ INT32 m_shift_a;
+ INT32 m_shift_b;
+ INT32 m_precomp_s;
+ INT32 m_precomp_t;
+ INT32 m_blend_enable;
+ bool m_pre_wrap;
+ INT32 m_dzpix_enc;
+ UINT8* m_tmem; /* pointer to texture cache for this polygon */
+ bool m_start_span;
+ rgbaint_t m_clamp_diff[8];
+};
+
+struct z_decompress_entry_t
+{
+ UINT32 shift;
+ UINT32 add;
+};
+
+struct cv_mask_derivative_t
+{
+ UINT8 cvg;
+ UINT8 cvbit;
+ UINT8 xoff;
+ UINT8 yoff;
+};
+
+class span_param_t
+{
+ public:
+ union
+ {
+ UINT32 w;
+#ifdef LSB_FIRST
+ struct { UINT16 l; INT16 h; } h;
+#else
+ struct { INT16 h; UINT16 l; } h;
+#endif
+ };
+};
+
+#endif // _VIDEO_N64TYPES_H_
diff --git a/src/mame/video/namcos22.c b/src/mame/video/namcos22.c
index 83e13a33a80..8801fa0a10b 100644
--- a/src/mame/video/namcos22.c
+++ b/src/mame/video/namcos22.c
@@ -83,9 +83,9 @@ void namcos22_renderer::renderscanline_uvi_full(INT32 scanline, const extent_t &
int fogfactor = 0xff - extra.fogfactor;
int fadefactor = 0xff - extra.fadefactor;
int alphafactor = 0xff - m_state.m_poly_translucency;
- rgbint fogcolor = extra.fogcolor;
- rgbint fadecolor = extra.fadecolor;
- rgbint polycolor = extra.polycolor;
+ rgbaint_t fogcolor = extra.fogcolor;
+ rgbaint_t fadecolor = extra.fadecolor;
+ rgbaint_t polycolor = extra.polycolor;
int polyfade_enabled = extra.pfade_enabled;
int penmask = 0xff;
int penshift = 0;
@@ -118,18 +118,17 @@ void namcos22_renderer::renderscanline_uvi_full(INT32 scanline, const extent_t &
for (int x = extent.startx; x < extent.stopx; x++)
{
float ooz = 1.0f / z;
- int tx = (int)(u * ooz);
- int ty = (int)(v * ooz) + bn;
- int to = ((ty & 0xfff0) << 4) | ((tx & 0xff0) >> 4);
- int pen = ttdata[(ttmap[to] << 8) | tt_ayx_to_pixel[ttattr[to] << 8 | (ty << 4 & 0xf0) | (tx & 0xf)]];
+ INT32 tx = (int)(u * ooz);
+ INT32 ty = (int)(v * ooz) + bn;
+ INT32 to = ((ty & 0xfff0) << 4) | ((tx & 0xff0) >> 4);
+ INT32 pen = ttdata[(ttmap[to] << 8) | tt_ayx_to_pixel[ttattr[to] << 8 | (ty << 4 & 0xf0) | (tx & 0xf)]];
// pen = 0x55; // debug: disable textures
- rgbint rgb;
- rgb_to_rgbint(&rgb, pens[pen >> penshift & penmask]);
+ rgbaint_t rgb(pens[pen >> penshift & penmask]);
// apply shading before fog
- int shade = i*ooz;
- rgbint_scale_immediate_and_clamp(&rgb, shade << 2);
+ INT32 shade = i*ooz;
+ rgb.scale_imm_and_clamp(shade << 2);
// per-z distance fogging
if (zfog_enabled)
@@ -142,26 +141,30 @@ void namcos22_renderer::renderscanline_uvi_full(INT32 scanline, const extent_t &
if (fogfactor > 0)
{
if (fogfactor > 0xff) fogfactor = 0xff;
- rgbint_blend(&rgb, &fogcolor, 0xff - fogfactor);
+ rgb.blend(fogcolor, 0xff - fogfactor);
}
}
else if (fogfactor != 0xff) // direct
- rgbint_blend(&rgb, &fogcolor, fogfactor);
+ {
+ rgb.blend(fogcolor, fogfactor);
+ }
if (polyfade_enabled)
- rgbint_scale_channel_and_clamp(&rgb, &polycolor);
+ {
+ rgb.scale_and_clamp(polycolor);
+ }
if (fadefactor != 0xff)
- rgbint_blend(&rgb, &fadecolor, fadefactor);
+ {
+ rgb.blend(fadecolor, fadefactor);
+ }
if (alphafactor != 0xff)
{
- rgbint mix;
- rgb_to_rgbint(&mix, dest[x]);
- rgbint_blend(&rgb, &mix, alphafactor);
+ rgb.blend(rgbaint_t(dest[x]), alphafactor);
}
- dest[x] = rgbint_to_rgb(&rgb);
+ dest[x] = rgb.to_rgba();
primap[x] |= prioverchar;
u += du;
@@ -181,8 +184,7 @@ void namcos22_renderer::renderscanline_uvi_full(INT32 scanline, const extent_t &
int pen = ttdata[(ttmap[to] << 8) | tt_ayx_to_pixel[ttattr[to] << 8 | (ty << 4 & 0xf0) | (tx & 0xf)]];
// pen = 0x55; // debug: disable textures
- rgbint rgb;
- rgb_to_rgbint(&rgb, pens[pen >> penshift & penmask]);
+ rgbaint_t rgb(pens[pen >> penshift & penmask]);
// per-z distance fogging
if (zfog_enabled)
@@ -193,19 +195,25 @@ void namcos22_renderer::renderscanline_uvi_full(INT32 scanline, const extent_t &
else cz = (cz < 0) ? 0 : 0x1fff;
fogfactor = czram[NATIVE_ENDIAN_VALUE_LE_BE(3, 0) ^ cz];
if (fogfactor != 0)
- rgbint_blend(&rgb, &fogcolor, 0xff - fogfactor);
+ {
+ rgb.blend(fogcolor, 0xff - fogfactor);
+ }
}
else if (fogfactor != 0xff) // direct
- rgbint_blend(&rgb, &fogcolor, fogfactor);
+ {
+ rgb.blend(fogcolor, fogfactor);
+ }
// apply shading after fog
int shade = i*ooz;
- rgbint_scale_immediate_and_clamp(&rgb, shade << 2);
+ rgb.scale_imm_and_clamp(shade << 2);
if (polyfade_enabled)
- rgbint_scale_channel_and_clamp(&rgb, &polycolor);
+ {
+ rgb.scale_and_clamp(polycolor);
+ }
- dest[x] = rgbint_to_rgb(&rgb);
+ dest[x] = rgb.to_rgba();
primap[x] |= prioverchar;
u += du;
@@ -227,8 +235,8 @@ void namcos22_renderer::renderscanline_sprite(INT32 scanline, const extent_t &ex
int alphafactor = extra.alpha;
int fogfactor = 0xff - extra.fogfactor;
int fadefactor = 0xff - extra.fadefactor;
- rgbint fogcolor = extra.fogcolor;
- rgbint fadecolor = extra.fadecolor;
+ rgbaint_t fogcolor(extra.fogcolor);
+ rgbaint_t fadecolor(extra.fadecolor);
UINT8 *source = (UINT8 *)extra.source + y_index * extra.line_modulo;
UINT32 *dest = &extra.destbase->pix32(scanline);
UINT8 *primap = &extra.primap->pix8(scanline);
@@ -238,23 +246,24 @@ void namcos22_renderer::renderscanline_sprite(INT32 scanline, const extent_t &ex
int pen = source[(int)x_index];
if (pen != 0xff)
{
- rgbint rgb;
- rgb_to_rgbint(&rgb, pal[pen]);
+ rgbaint_t rgb(pal[pen]);
if (fogfactor != 0xff)
- rgbint_blend(&rgb, &fogcolor, fogfactor);
+ {
+ rgb.blend(fogcolor, fogfactor);
+ }
if (fadefactor != 0xff)
- rgbint_blend(&rgb, &fadecolor, fadefactor);
+ {
+ rgb.blend(fadecolor, fadefactor);
+ }
if (alphafactor != 0xff)
{
- rgbint mix;
- rgb_to_rgbint(&mix, dest[x]);
- rgbint_blend(&rgb, &mix, alphafactor);
+ rgb.blend(rgbaint_t(dest[x]), alphafactor);
}
- dest[x] = rgbint_to_rgb(&rgb);
+ dest[x] = rgb.to_rgba();
primap[x] |= prioverchar;
}
x_index += dx;
@@ -356,12 +365,12 @@ void namcos22_renderer::poly3d_drawquad(screen_device &screen, bitmap_rgb32 &bit
if (m_state.m_mixer_flags & 1)
{
extra.fadefactor = m_state.m_screen_fade_factor;
- rgb_comp_to_rgbint(&extra.fadecolor, m_state.m_screen_fade_r, m_state.m_screen_fade_g, m_state.m_screen_fade_b);
+ extra.fadecolor.set(0, m_state.m_screen_fade_r, m_state.m_screen_fade_g, m_state.m_screen_fade_b);
}
// poly fade
extra.pfade_enabled = m_state.m_poly_fade_enabled;
- rgb_comp_to_rgbint(&extra.polycolor, m_state.m_poly_fade_r, m_state.m_poly_fade_g, m_state.m_poly_fade_b);
+ extra.polycolor.set(0, m_state.m_poly_fade_r, m_state.m_poly_fade_g, m_state.m_poly_fade_b);
/* poly fog (not completely accurate yet)
@@ -432,7 +441,7 @@ void namcos22_renderer::poly3d_drawquad(screen_device &screen, bitmap_rgb32 &bit
if (nthword(m_state.m_czattr, 4) & (4 << (cztype * 4)))
{
int delta = (INT16)nthword(m_state.m_czattr, cztype);
- rgb_comp_to_rgbint(&extra.fogcolor, m_state.m_fog_r, m_state.m_fog_g, m_state.m_fog_b);
+ extra.fogcolor.set(0, m_state.m_fog_r, m_state.m_fog_g, m_state.m_fog_b);
if (direct)
{
int cz = ((flags & 0x1fff00) + cz_adjust) >> 8;
@@ -462,7 +471,7 @@ void namcos22_renderer::poly3d_drawquad(screen_device &screen, bitmap_rgb32 &bit
if (m_state.m_mixer_flags & 1)
{
extra.pfade_enabled = m_state.m_poly_fade_enabled;
- rgb_comp_to_rgbint(&extra.polycolor, m_state.m_poly_fade_r, m_state.m_poly_fade_g, m_state.m_poly_fade_b);
+ extra.polycolor.set(0, m_state.m_poly_fade_r, m_state.m_poly_fade_g, m_state.m_poly_fade_b);
}
// poly fog
@@ -470,7 +479,7 @@ void namcos22_renderer::poly3d_drawquad(screen_device &screen, bitmap_rgb32 &bit
{
int cztype = flags & 3;
int czcolor = cztype & nthbyte(&m_state.m_fog_colormask, cztype);
- rgb_comp_to_rgbint(&extra.fogcolor, m_state.m_fog_r_per_cztype[czcolor], m_state.m_fog_g_per_cztype[czcolor], m_state.m_fog_b_per_cztype[czcolor]);
+ extra.fogcolor.set(0, m_state.m_fog_r_per_cztype[czcolor], m_state.m_fog_g_per_cztype[czcolor], m_state.m_fog_b_per_cztype[czcolor]);
if (direct)
{
@@ -555,7 +564,7 @@ void namcos22_renderer::poly3d_drawsprite(
if (m_state.m_mixer_flags & 2)
{
extra.fadefactor = m_state.m_screen_fade_factor;
- rgb_comp_to_rgbint(&extra.fadecolor, m_state.m_screen_fade_r, m_state.m_screen_fade_g, m_state.m_screen_fade_b);
+ extra.fadecolor.set(0, m_state.m_screen_fade_r, m_state.m_screen_fade_g, m_state.m_screen_fade_b);
}
// fog, 0xfe is a special case for sprite priority over textlayer
@@ -563,7 +572,7 @@ void namcos22_renderer::poly3d_drawsprite(
{
// or does it fetch from poly-cz ram? that will break timecris though
extra.fogfactor = cz_factor;
- rgb_comp_to_rgbint(&extra.fogcolor, m_state.m_fog_r, m_state.m_fog_g, m_state.m_fog_b);
+ extra.fogcolor.set(0, m_state.m_fog_r, m_state.m_fog_g, m_state.m_fog_b);
}
render_triangle_fan(m_cliprect, render_delegate(FUNC(namcos22_renderer::renderscanline_sprite), this), 2, 4, vert);
@@ -1883,8 +1892,7 @@ void namcos22_state::namcos22s_mix_text_layer(screen_device &screen, bitmap_rgb3
// prepare fader
bool fade_enabled = (m_mixer_flags & 2) && m_screen_fade_factor;
int fade_factor = 0xff - m_screen_fade_factor;
- rgbint fade_color;
- rgb_comp_to_rgbint(&fade_color, m_screen_fade_r, m_screen_fade_g, m_screen_fade_b);
+ rgbaint_t fade_color(0, m_screen_fade_r, m_screen_fade_g, m_screen_fade_b);
// mix textlayer with poly/sprites
for (int y = cliprect.min_y; y <= cliprect.max_y; y++)
@@ -1897,8 +1905,7 @@ void namcos22_state::namcos22s_mix_text_layer(screen_device &screen, bitmap_rgb3
// skip if transparent or under poly/sprite
if (pri[x] == prival)
{
- rgbint rgb;
- rgb_to_rgbint(&rgb, pens[src[x]]);
+ rgbaint_t rgb(pens[src[x]]);
// apply alpha
if (alpha_factor)
@@ -1906,9 +1913,7 @@ void namcos22_state::namcos22s_mix_text_layer(screen_device &screen, bitmap_rgb3
UINT8 pen = src[x] & 0xff;
if ((pen & 0xf) == alpha_mask || pen == alpha_check12 || pen == alpha_check13)
{
- rgbint mix;
- rgb_to_rgbint(&mix, dest[x]);
- rgbint_blend(&rgb, &mix, 0xff - alpha_factor);
+ rgb.blend(rgbaint_t(dest[x]), 0xff - alpha_factor);
}
}
@@ -1916,29 +1921,27 @@ void namcos22_state::namcos22s_mix_text_layer(screen_device &screen, bitmap_rgb3
if (spot_enabled)
{
UINT8 pen = src[x] & 0xff;
- rgbint mix;
- rgb_to_rgbint(&mix, dest[x]);
+ rgbaint_t mix(dest[x]);
if (spot_flags & 8)
{
// mix with per-channel brightness
- rgbint shade;
- rgb_comp_to_rgbint(&shade,
- (0xff - (m_spotram[pen << 2 | 1] & 0xff)) << 2,
- (0xff - (m_spotram[pen << 2 | 2] & 0xff)) << 2,
- (0xff - (m_spotram[pen << 2 | 3] & 0xff)) << 2
- );
- rgbint_scale_channel_and_clamp(&mix, &shade);
+ rgbaint_t shade(0, (0xff - (m_spotram[pen << 2 | 1] & 0xff)) << 2, (0xff - (m_spotram[pen << 2 | 2] & 0xff)) << 2, (0xff - (m_spotram[pen << 2 | 3] & 0xff)) << 2);
+ mix.scale_and_clamp(shade);
}
int spot_factor = 0xff - (m_spotram[pen << 2] & 0xff);
if (spot_factor < spot_limit)
- rgbint_blend(&rgb, &mix, spot_factor);
+ {
+ rgb.blend(mix, spot_factor);
+ }
}
if (fade_enabled)
- rgbint_blend(&rgb, &fade_color, fade_factor);
+ {
+ rgb.blend(fade_color, fade_factor);
+ }
- dest[x] = rgbint_to_rgb(&rgb);
+ dest[x] = rgb.to_rgba();
}
}
}
@@ -1954,12 +1957,13 @@ void namcos22_state::namcos22_mix_text_layer(screen_device &screen, bitmap_rgb32
// prepare fader and shadow factor
bool fade_enabled = m_mixer_flags & 2 && m_poly_fade_enabled;
bool shadow_enabled = (m_mixer_flags & 0x100) != 0; // ? (ridgerac is the only game not using shadow)
- rgbint fade_color, rgb_mix[3];
- rgb_comp_to_rgbint(&fade_color, m_poly_fade_r, m_poly_fade_g, m_poly_fade_b);
- rgb_comp_to_rgbint(&rgb_mix[0], nthbyte(m_mixer, 0x08), nthbyte(m_mixer, 0x09), nthbyte(m_mixer, 0x0a)); // pen c
- rgb_comp_to_rgbint(&rgb_mix[1], nthbyte(m_mixer, 0x0b), nthbyte(m_mixer, 0x0c), nthbyte(m_mixer, 0x0d)); // pen d
- rgb_comp_to_rgbint(&rgb_mix[2], nthbyte(m_mixer, 0x0e), nthbyte(m_mixer, 0x0f), nthbyte(m_mixer, 0x10)); // pen e
+ rgbaint_t fade_color(0, m_poly_fade_r, m_poly_fade_g, m_poly_fade_b);
+ rgbaint_t rgb_mix[3] = {
+ rgbaint_t(0, nthbyte(m_mixer, 0x08), nthbyte(m_mixer, 0x09), nthbyte(m_mixer, 0x0a)), // pen c
+ rgbaint_t(0, nthbyte(m_mixer, 0x0b), nthbyte(m_mixer, 0x0c), nthbyte(m_mixer, 0x0d)), // pen d
+ rgbaint_t(0, nthbyte(m_mixer, 0x0e), nthbyte(m_mixer, 0x0f), nthbyte(m_mixer, 0x10)) // pen e
+ };
// mix textlayer with poly/sprites
for (int y = cliprect.min_y; y <= cliprect.max_y; y++)
@@ -1973,7 +1977,7 @@ void namcos22_state::namcos22_mix_text_layer(screen_device &screen, bitmap_rgb32
if (pri[x] == 2)
{
// apply shadow
- rgbint rgb;
+ rgbaint_t rgb;
switch (src[x] & 0xff)
{
case 0xfc:
@@ -1981,24 +1985,26 @@ void namcos22_state::namcos22_mix_text_layer(screen_device &screen, bitmap_rgb32
case 0xfe:
if (shadow_enabled)
{
- rgb_to_rgbint(&rgb, dest[x]);
- rgbint_scale_channel_and_clamp(&rgb, &rgb_mix[(src[x] & 0xf) - 0xc]);
+ rgb.set(dest[x]);
+ rgb.scale_and_clamp(rgb_mix[(src[x] & 0xf) - 0xc]);
break;
}
// (fall through)
default:
- rgb_to_rgbint(&rgb, pens[src[x]]);
+ rgb.set(pens[src[x]]);
break;
}
if (fade_enabled)
- rgbint_scale_channel_and_clamp(&rgb, &fade_color);
+ {
+ rgb.scale_and_clamp(fade_color);
+ }
// BTANB note: fading to white does not affect color channels set to 00,
// eg. a rr-gg-bb of 3f-7f-00 will fade to ff-ff-00 and not ff-ff-ff
// seen in victlapw attract mode
- dest[x] = rgbint_to_rgb(&rgb);
+ dest[x] = rgb.to_rgba();
}
}
}
@@ -2279,15 +2285,13 @@ UINT32 namcos22_state::screen_update_namcos22s(screen_device &screen, bitmap_rgb
screen.priority().fill(0, cliprect);
// background color
- rgbint bg_color;
- rgb_comp_to_rgbint(&bg_color, nthbyte(m_mixer, 0x08), nthbyte(m_mixer, 0x09), nthbyte(m_mixer, 0x0a));
+ rgbaint_t bg_color(0, nthbyte(m_mixer, 0x08), nthbyte(m_mixer, 0x09), nthbyte(m_mixer, 0x0a));
if (m_mixer_flags & 1 && m_screen_fade_factor)
{
- rgbint fade_color;
- rgb_comp_to_rgbint(&fade_color, m_screen_fade_r, m_screen_fade_g, m_screen_fade_b);
- rgbint_blend(&bg_color, &fade_color, 0xff - m_screen_fade_factor);
+ rgbaint_t fade_color(0, m_screen_fade_r, m_screen_fade_g, m_screen_fade_b);
+ bg_color.blend(fade_color, 0xff - m_screen_fade_factor);
}
- bitmap.fill(rgbint_to_rgb(&bg_color), cliprect);
+ bitmap.fill(bg_color.to_rgba(), cliprect);
// layers
UINT8 layer = nthbyte(m_mixer, 0x1f);
diff --git a/src/mame/video/namcos86.c b/src/mame/video/namcos86.c
index 0f59c3245c9..2878127fd33 100644
--- a/src/mame/video/namcos86.c
+++ b/src/mame/video/namcos86.c
@@ -148,6 +148,12 @@ void namcos86_state::video_start()
}
m_spriteram = m_rthunder_spriteram + 0x1800;
+
+ save_item(NAME(m_tilebank));
+ save_item(NAME(m_xscroll));
+ save_item(NAME(m_yscroll));
+ save_item(NAME(m_backcolor));
+ save_item(NAME(m_copy_sprites));
}
@@ -158,29 +164,19 @@ void namcos86_state::video_start()
***************************************************************************/
-READ8_MEMBER(namcos86_state::rthunder_videoram1_r)
-{
- return m_rthunder_videoram1[offset];
-}
-
-WRITE8_MEMBER(namcos86_state::rthunder_videoram1_w)
+WRITE8_MEMBER(namcos86_state::videoram1_w)
{
m_rthunder_videoram1[offset] = data;
m_bg_tilemap[offset/0x1000]->mark_tile_dirty((offset & 0xfff)/2);
}
-READ8_MEMBER(namcos86_state::rthunder_videoram2_r)
-{
- return m_rthunder_videoram2[offset];
-}
-
-WRITE8_MEMBER(namcos86_state::rthunder_videoram2_w)
+WRITE8_MEMBER(namcos86_state::videoram2_w)
{
m_rthunder_videoram2[offset] = data;
m_bg_tilemap[2+offset/0x1000]->mark_tile_dirty((offset & 0xfff)/2);
}
-WRITE8_MEMBER(namcos86_state::rthunder_tilebank_select_w)
+WRITE8_MEMBER(namcos86_state::tilebank_select_w)
{
int bit = BIT(offset,10);
if (m_tilebank != bit)
@@ -191,53 +187,46 @@ WRITE8_MEMBER(namcos86_state::rthunder_tilebank_select_w)
}
}
-static void scroll_w(address_space &space, int offset, int data, int layer)
+void namcos86_state::scroll_w(address_space &space, int offset, int data, int layer)
{
- namcos86_state *state = space.machine().driver_data<namcos86_state>();
switch (offset)
{
case 0:
- state->m_xscroll[layer] = (state->m_xscroll[layer]&0xff)|(data<<8);
+ m_xscroll[layer] = (m_xscroll[layer]&0xff)|(data<<8);
break;
case 1:
- state->m_xscroll[layer] = (state->m_xscroll[layer]&0xff00)|data;
+ m_xscroll[layer] = (m_xscroll[layer]&0xff00)|data;
break;
case 2:
- state->m_yscroll[layer] = data;
+ m_yscroll[layer] = data;
break;
}
}
-WRITE8_MEMBER(namcos86_state::rthunder_scroll0_w)
+WRITE8_MEMBER(namcos86_state::scroll0_w)
{
scroll_w(space,offset,data,0);
}
-WRITE8_MEMBER(namcos86_state::rthunder_scroll1_w)
+WRITE8_MEMBER(namcos86_state::scroll1_w)
{
scroll_w(space,offset,data,1);
}
-WRITE8_MEMBER(namcos86_state::rthunder_scroll2_w)
+WRITE8_MEMBER(namcos86_state::scroll2_w)
{
scroll_w(space,offset,data,2);
}
-WRITE8_MEMBER(namcos86_state::rthunder_scroll3_w)
+WRITE8_MEMBER(namcos86_state::scroll3_w)
{
scroll_w(space,offset,data,3);
}
-WRITE8_MEMBER(namcos86_state::rthunder_backcolor_w)
+WRITE8_MEMBER(namcos86_state::backcolor_w)
{
m_backcolor = data;
}
-
-READ8_MEMBER(namcos86_state::rthunder_spriteram_r)
-{
- return m_rthunder_spriteram[offset];
-}
-
-WRITE8_MEMBER(namcos86_state::rthunder_spriteram_w)
+WRITE8_MEMBER(namcos86_state::spriteram_w)
{
m_rthunder_spriteram[offset] = data;
@@ -273,17 +262,16 @@ sprite format:
15 xxxxxxxx Y position
*/
-static void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+void namcos86_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- namcos86_state *state = screen.machine().driver_data<namcos86_state>();
- const UINT8 *source = &state->m_spriteram[0x0800-0x20]; /* the last is NOT a sprite */
- const UINT8 *finish = &state->m_spriteram[0];
- gfx_element *gfx = state->m_gfxdecode->gfx(2);
+ const UINT8 *source = &m_spriteram[0x0800-0x20]; /* the last is NOT a sprite */
+ const UINT8 *finish = &m_spriteram[0];
+ gfx_element *gfx = m_gfxdecode->gfx(2);
- int sprite_xoffs = state->m_spriteram[0x07f5] + ((state->m_spriteram[0x07f4] & 1) << 8);
- int sprite_yoffs = state->m_spriteram[0x07f7];
+ int sprite_xoffs = m_spriteram[0x07f5] + ((m_spriteram[0x07f4] & 1) << 8);
+ int sprite_yoffs = m_spriteram[0x07f7];
- int bank_sprites = state->m_gfxdecode->gfx(2)->elements() / 8;
+ int bank_sprites = m_gfxdecode->gfx(2)->elements() / 8;
while (source >= finish)
{
@@ -311,7 +299,7 @@ static void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rect
sx += sprite_xoffs;
sy -= sprite_yoffs;
- if (state->flip_screen())
+ if (flip_screen())
{
sx = -sx - sizex;
sy = -sy - sizey;
@@ -337,10 +325,8 @@ static void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rect
void namcos86_state::set_scroll(int layer)
{
- int scrollx,scrolly;
-
- scrollx = m_xscroll[layer];
- scrolly = m_yscroll[layer];
+ int scrollx = m_xscroll[layer];
+ int scrolly = m_yscroll[layer];
if (flip_screen())
{
scrollx = -scrollx;
@@ -351,10 +337,8 @@ void namcos86_state::set_scroll(int layer)
}
-UINT32 namcos86_state::screen_update_namcos86(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+UINT32 namcos86_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- int layer;
-
/* flip screen is embedded in the sprite control registers */
flip_screen_set(m_spriteram[0x07f6] & 1);
set_scroll(0);
@@ -366,11 +350,9 @@ UINT32 namcos86_state::screen_update_namcos86(screen_device &screen, bitmap_ind1
bitmap.fill(m_gfxdecode->gfx(0)->colorbase() + 8*m_backcolor+7, cliprect);
- for (layer = 0;layer < 8;layer++)
+ for (int layer = 0;layer < 8;layer++)
{
- int i;
-
- for (i = 3;i >= 0;i--)
+ for (int i = 3;i >= 0;i--)
{
if (((m_xscroll[i] & 0x0e00) >> 9) == layer)
m_bg_tilemap[i]->draw(screen, bitmap, cliprect, 0,layer,0);
@@ -382,20 +364,17 @@ UINT32 namcos86_state::screen_update_namcos86(screen_device &screen, bitmap_ind1
}
-void namcos86_state::screen_eof_namcos86(screen_device &screen, bool state)
+void namcos86_state::screen_eof(screen_device &screen, bool state)
{
// rising edge
if (state)
{
if (m_copy_sprites)
{
- UINT8 *spriteram = m_spriteram;
- int i,j;
-
- for (i = 0;i < 0x800;i += 16)
+ for (int i = 0;i < 0x800;i += 16)
{
- for (j = 10;j < 16;j++)
- spriteram[i+j] = spriteram[i+j - 6];
+ for (int j = 10;j < 16;j++)
+ m_spriteram[i+j] = m_spriteram[i+j - 6];
}
m_copy_sprites = 0;
diff --git a/src/mame/video/naughtyb.c b/src/mame/video/naughtyb.c
index 7a9da39b827..137a5bd71e7 100644
--- a/src/mame/video/naughtyb.c
+++ b/src/mame/video/naughtyb.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Brad Oliver,Sal and John Bugliarisi,Paul Priest
/***************************************************************************
@@ -64,7 +64,6 @@ PALETTE_INIT_MEMBER(naughtyb_state, naughtyb)
const UINT8 *color_prom = memregion("proms")->base();
static const int resistances[2] = { 270, 130 };
double weights[2];
- int i;
/* compute the color output resistor weights */
compute_resistor_weights(0, 255, -1.0,
@@ -72,7 +71,7 @@ PALETTE_INIT_MEMBER(naughtyb_state, naughtyb)
2, resistances, weights, 0, 0,
0, 0, 0, 0, 0);
- for (i = 0;i < palette.entries(); i++)
+ for (int i = 0;i < palette.entries(); i++)
{
int bit0, bit1;
int r, g, b;
@@ -108,6 +107,10 @@ void naughtyb_state::video_start()
/* Naughty Boy has a virtual screen twice as large as the visible screen */
m_tmpbitmap.allocate(68*8,28*8,m_screen->format());
+
+ save_item(NAME(m_cocktail));
+ save_item(NAME(m_palreg));
+ save_item(NAME(m_bankreg));
}
@@ -183,19 +186,15 @@ WRITE8_MEMBER(naughtyb_state::popflame_videoreg_w)
***************************************************************************/
-UINT32 naughtyb_state::screen_update_naughtyb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+UINT32 naughtyb_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
const rectangle scrollvisiblearea(2*8, 34*8-1, 0*8, 28*8-1);
const rectangle leftvisiblearea(0*8, 2*8-1, 0*8, 28*8-1);
const rectangle rightvisiblearea(34*8, 36*8-1, 0*8, 28*8-1);
- UINT8 *videoram = m_videoram;
- bitmap_ind16 &tmpbitmap = m_tmpbitmap;
- int offs;
-
// for every character in the Video RAM
- for (offs = 0x800 - 1; offs >= 0; offs--)
+ for (int offs = 0x800 - 1; offs >= 0; offs--)
{
int sx,sy;
@@ -226,15 +225,15 @@ UINT32 naughtyb_state::screen_update_naughtyb(screen_device &screen, bitmap_ind1
}
}
- m_gfxdecode->gfx(0)->opaque(tmpbitmap,tmpbitmap.cliprect(),
+ m_gfxdecode->gfx(0)->opaque(m_tmpbitmap,m_tmpbitmap.cliprect(),
m_videoram2[offs] + 256 * m_bankreg,
(m_videoram2[offs] >> 5) + 8 * m_palreg,
m_cocktail,m_cocktail,
8*sx,8*sy);
- m_gfxdecode->gfx(1)->transpen(tmpbitmap,tmpbitmap.cliprect(),
- videoram[offs] + 256*m_bankreg,
- (videoram[offs] >> 5) + 8 * m_palreg,
+ m_gfxdecode->gfx(1)->transpen(m_tmpbitmap,m_tmpbitmap.cliprect(),
+ m_videoram[offs] + 256*m_bankreg,
+ (m_videoram[offs] >> 5) + 8 * m_palreg,
m_cocktail,m_cocktail,
8*sx,8*sy,0);
}
@@ -243,11 +242,11 @@ UINT32 naughtyb_state::screen_update_naughtyb(screen_device &screen, bitmap_ind1
{
int scrollx;
- copybitmap(bitmap,tmpbitmap,0,0,-66*8,0,leftvisiblearea);
- copybitmap(bitmap,tmpbitmap,0,0,-30*8,0,rightvisiblearea);
+ copybitmap(bitmap,m_tmpbitmap,0,0,-66*8,0,leftvisiblearea);
+ copybitmap(bitmap,m_tmpbitmap,0,0,-30*8,0,rightvisiblearea);
scrollx = ( m_cocktail ) ? *m_scrollreg - 239 : -*m_scrollreg + 16;
- copyscrollbitmap(bitmap,tmpbitmap,1,&scrollx,0,0,scrollvisiblearea);
+ copyscrollbitmap(bitmap,m_tmpbitmap,1,&scrollx,0,0,scrollvisiblearea);
}
return 0;
}
diff --git a/src/mame/video/nbmj8991.c b/src/mame/video/nbmj8991.c
index 05250aea3b2..cc688e9d1ab 100644
--- a/src/mame/video/nbmj8991.c
+++ b/src/mame/video/nbmj8991.c
@@ -16,7 +16,7 @@
******************************************************************************/
-WRITE8_MEMBER(nbmj8991_state::nbmj8991_palette_type1_w)
+WRITE8_MEMBER(nbmj8991_state::palette_type1_w)
{
int r, g, b;
@@ -33,7 +33,7 @@ WRITE8_MEMBER(nbmj8991_state::nbmj8991_palette_type1_w)
m_palette->set_pen_color((offset >> 1), pal4bit(r), pal4bit(g), pal4bit(b));
}
-WRITE8_MEMBER(nbmj8991_state::nbmj8991_palette_type2_w)
+WRITE8_MEMBER(nbmj8991_state::palette_type2_w)
{
int r, g, b;
@@ -50,7 +50,7 @@ WRITE8_MEMBER(nbmj8991_state::nbmj8991_palette_type2_w)
m_palette->set_pen_color((offset / 2), pal5bit(r), pal5bit(g), pal5bit(b));
}
-WRITE8_MEMBER(nbmj8991_state::nbmj8991_palette_type3_w)
+WRITE8_MEMBER(nbmj8991_state::palette_type3_w)
{
int r, g, b;
@@ -71,7 +71,7 @@ WRITE8_MEMBER(nbmj8991_state::nbmj8991_palette_type3_w)
******************************************************************************/
-WRITE8_MEMBER(nbmj8991_state::nbmj8991_blitter_w)
+WRITE8_MEMBER(nbmj8991_state::blitter_w)
{
int gfxlen = memregion("gfx1")->bytes();
@@ -84,13 +84,13 @@ WRITE8_MEMBER(nbmj8991_state::nbmj8991_blitter_w)
case 0x04: m_blitter_sizex = data; break;
case 0x05: m_blitter_sizey = data;
/* writing here also starts the blit */
- nbmj8991_gfxdraw();
+ gfxdraw();
break;
case 0x06: m_blitter_direction_x = (data & 0x01) ? 1 : 0;
m_blitter_direction_y = (data & 0x02) ? 1 : 0;
m_flipscreen = (data & 0x04) ? 0 : 1;
m_dispflag = (data & 0x10) ? 0 : 1;
- nbmj8991_vramflip();
+ vramflip();
break;
case 0x07: break;
case 0x10: m_blitter_destx = (m_blitter_destx & 0xff00) | data; break;
@@ -115,12 +115,12 @@ WRITE8_MEMBER(nbmj8991_state::nbmj8991_blitter_w)
}
}
-READ8_MEMBER(nbmj8991_state::nbmj8991_clut_r)
+READ8_MEMBER(nbmj8991_state::clut_r)
{
return m_clut[offset];
}
-WRITE8_MEMBER(nbmj8991_state::nbmj8991_clut_w)
+WRITE8_MEMBER(nbmj8991_state::clut_w)
{
m_clut[((m_clutsel & 0x7f) * 0x10) + (offset & 0x0f)] = data;
}
@@ -129,7 +129,7 @@ WRITE8_MEMBER(nbmj8991_state::nbmj8991_clut_w)
******************************************************************************/
-void nbmj8991_state::nbmj8991_vramflip()
+void nbmj8991_state::vramflip()
{
int x, y;
UINT8 color1, color2;
@@ -165,12 +165,19 @@ void nbmj8991_state::update_pixel(int x, int y)
m_tmpbitmap.pix16(y, x) = color;
}
-TIMER_CALLBACK_MEMBER(nbmj8991_state::blitter_timer_callback)
+void nbmj8991_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
- m_nb1413m3->m_busyflag = 1;
+ switch (id)
+ {
+ case TIMER_BLITTER:
+ m_nb1413m3->m_busyflag = 1;
+ break;
+ default:
+ assert_always(FALSE, "Unknown id in nbmj8991_state::device_timer");
+ }
}
-void nbmj8991_state::nbmj8991_gfxdraw()
+void nbmj8991_state::gfxdraw()
{
UINT8 *GFX = memregion("gfx1")->base();
int width = m_screen->width();
@@ -272,7 +279,7 @@ void nbmj8991_state::nbmj8991_gfxdraw()
}
m_nb1413m3->m_busyflag = 0;
- machine().scheduler().timer_set(attotime::from_nsec(1650) * m_nb1413m3->m_busyctr, timer_expired_delegate(FUNC(nbmj8991_state::blitter_timer_callback),this));
+ m_blitter_timer->adjust(attotime::from_nsec(1650) * m_nb1413m3->m_busyctr);
}
/******************************************************************************
@@ -281,6 +288,8 @@ void nbmj8991_state::nbmj8991_gfxdraw()
******************************************************************************/
void nbmj8991_state::video_start()
{
+ m_blitter_timer = timer_alloc(TIMER_BLITTER);
+
int width = m_screen->width();
int height = m_screen->height();
@@ -288,9 +297,35 @@ void nbmj8991_state::video_start()
m_videoram = auto_alloc_array(machine(), UINT8, width * height);
m_clut = auto_alloc_array(machine(), UINT8, 0x800);
memset(m_videoram, 0x00, (width * height * sizeof(UINT8)));
+
+ m_screen_refresh = 1;
+
+ save_item(NAME(m_scrollx));
+ save_item(NAME(m_scrolly));
+ save_item(NAME(m_blitter_destx));
+ save_item(NAME(m_blitter_desty));
+ save_item(NAME(m_blitter_sizex));
+ save_item(NAME(m_blitter_sizey));
+ save_item(NAME(m_blitter_src_addr));
+ save_item(NAME(m_blitter_direction_x));
+ save_item(NAME(m_blitter_direction_y));
+ save_item(NAME(m_gfxrom));
+ save_item(NAME(m_dispflag));
+ save_item(NAME(m_flipscreen));
+ save_item(NAME(m_clutsel));
+ save_pointer(NAME(m_videoram), width * height);
+ save_pointer(NAME(m_clut), 0x800);
+ save_item(NAME(m_flipscreen_old));
+
+ machine().save().register_postload(save_prepost_delegate(FUNC(nbmj8991_state::postload), this));
+}
+
+void nbmj8991_state::postload()
+{
+ m_screen_refresh = 1;
}
-UINT32 nbmj8991_state::screen_update_nbmj8991_type1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+UINT32 nbmj8991_state::screen_update_type1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
int x, y;
@@ -329,7 +364,7 @@ UINT32 nbmj8991_state::screen_update_nbmj8991_type1(screen_device &screen, bitma
return 0;
}
-UINT32 nbmj8991_state::screen_update_nbmj8991_type2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+UINT32 nbmj8991_state::screen_update_type2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
int x, y;
diff --git a/src/mame/video/nbmj9195.c b/src/mame/video/nbmj9195.c
index 9008644153a..e77948865ab 100644
--- a/src/mame/video/nbmj9195.c
+++ b/src/mame/video/nbmj9195.c
@@ -16,47 +16,36 @@
******************************************************************************/
-READ8_MEMBER(nbmj9195_state::nbmj9195_palette_r)
-{
- return m_palette_ptr[offset];
-}
-WRITE8_MEMBER(nbmj9195_state::nbmj9195_palette_w)
+WRITE8_MEMBER(nbmj9195_state::palette_w)
{
- int r, g, b;
-
m_palette_ptr[offset] = data;
if (offset & 1)
{
offset &= 0x1fe;
- r = ((m_palette_ptr[offset + 0] & 0x0f) >> 0);
- g = ((m_palette_ptr[offset + 0] & 0xf0) >> 4);
- b = ((m_palette_ptr[offset + 1] & 0x0f) >> 0);
+ int r = ((m_palette_ptr[offset + 0] & 0x0f) >> 0);
+ int g = ((m_palette_ptr[offset + 0] & 0xf0) >> 4);
+ int b = ((m_palette_ptr[offset + 1] & 0x0f) >> 0);
m_palette->set_pen_color((offset >> 1), pal4bit(r), pal4bit(g), pal4bit(b));
}
}
-READ8_MEMBER(nbmj9195_state::nbmj9195_nb22090_palette_r)
-{
- return m_nb22090_palette[offset];
-}
-
-WRITE8_MEMBER(nbmj9195_state::nbmj9195_nb22090_palette_w)
+WRITE8_MEMBER(nbmj9195_state::nb22090_palette_w)
{
int r, g, b;
int offs_h, offs_l;
- m_nb22090_palette[offset] = data;
+ m_palette_ptr[offset] = data;
offs_h = (offset / 0x0300);
offs_l = (offset & 0x00ff);
- r = m_nb22090_palette[(0x000 + (offs_h * 0x300) + offs_l)];
- g = m_nb22090_palette[(0x100 + (offs_h * 0x300) + offs_l)];
- b = m_nb22090_palette[(0x200 + (offs_h * 0x300) + offs_l)];
+ r = m_palette_ptr[(0x000 + (offs_h * 0x300) + offs_l)];
+ g = m_palette_ptr[(0x100 + (offs_h * 0x300) + offs_l)];
+ b = m_palette_ptr[(0x200 + (offs_h * 0x300) + offs_l)];
m_palette->set_pen_color(((offs_h * 0x100) + offs_l), rgb_t(r, g, b));
}
@@ -65,7 +54,7 @@ WRITE8_MEMBER(nbmj9195_state::nbmj9195_nb22090_palette_w)
******************************************************************************/
-int nbmj9195_state::nbmj9195_blitter_r(int offset, int vram)
+int nbmj9195_state::blitter_r(int offset, int vram)
{
int ret;
UINT8 *GFXROM = memregion("gfx1")->base();
@@ -80,7 +69,7 @@ int nbmj9195_state::nbmj9195_blitter_r(int offset, int vram)
return ret;
}
-void nbmj9195_state::nbmj9195_blitter_w(int offset, int data, int vram)
+void nbmj9195_state::blitter_w(int offset, int data, int vram)
{
int new_line;
@@ -94,7 +83,7 @@ void nbmj9195_state::nbmj9195_blitter_w(int offset, int data, int vram)
// if (data & 0x20) popmessage("Unknown GFX Flag!! (0x20)");
m_flipscreen[vram] = (data & 0x40) ? 0 : 1;
m_dispflag[vram] = (data & 0x80) ? 1 : 0;
- nbmj9195_vramflip(vram);
+ vramflip(vram);
break;
case 0x01: m_scrollx[vram] = (m_scrollx[vram] & 0x0100) | data; break;
case 0x02: m_scrollx[vram] = (m_scrollx[vram] & 0x00ff) | ((data << 8) & 0x0100);
@@ -121,23 +110,23 @@ void nbmj9195_state::nbmj9195_blitter_w(int offset, int data, int vram)
case 0x0b: m_blitter_destx[vram] = (m_blitter_destx[vram] & 0x00ff) | (data << 8); break;
case 0x0c: m_blitter_desty[vram] = (m_blitter_desty[vram] & 0xff00) | data; break;
case 0x0d: m_blitter_desty[vram] = (m_blitter_desty[vram] & 0x00ff) | (data << 8);
- nbmj9195_gfxdraw(vram);
+ gfxdraw(vram);
break;
default: break;
}
}
-void nbmj9195_state::nbmj9195_clutsel_w(int data)
+WRITE8_MEMBER(nbmj9195_state::clutsel_w)
{
m_clutsel = data;
}
-void nbmj9195_state::nbmj9195_clut_w(int offset, int data, int vram)
+void nbmj9195_state::clut_w(int offset, int data, int vram)
{
m_clut[vram][((m_clutsel & 0xff) * 0x10) + (offset & 0x0f)] = data;
}
-void nbmj9195_state::nbmj9195_gfxflag2_w(int data)
+WRITE8_MEMBER(nbmj9195_state::gfxflag2_w)
{
m_gfxflag2 = data;
}
@@ -146,7 +135,7 @@ void nbmj9195_state::nbmj9195_gfxflag2_w(int data)
******************************************************************************/
-void nbmj9195_state::nbmj9195_vramflip(int vram)
+void nbmj9195_state::vramflip(int vram)
{
int x, y;
UINT16 color1, color2;
@@ -202,7 +191,7 @@ void nbmj9195_state::device_timer(emu_timer &timer, device_timer_id id, int para
}
}
-void nbmj9195_state::nbmj9195_gfxdraw(int vram)
+void nbmj9195_state::gfxdraw(int vram)
{
UINT8 *GFX = memregion("gfx1")->base();
int width = m_screen->width();
@@ -359,38 +348,63 @@ void nbmj9195_state::nbmj9195_gfxdraw(int vram)
m_nb19010_busyflag = 0;
/* 1650ns per count */
- timer_set(attotime::from_nsec(m_nb19010_busyctr * 1650), TIMER_BLITTER);
+ m_blitter_timer->adjust(attotime::from_nsec(m_nb19010_busyctr * 1650));
}
/******************************************************************************
******************************************************************************/
-WRITE8_MEMBER(nbmj9195_state::nbmj9195_blitter_0_w){ nbmj9195_blitter_w(offset, data, 0); }
-WRITE8_MEMBER(nbmj9195_state::nbmj9195_blitter_1_w){ nbmj9195_blitter_w(offset, data, 1); }
+WRITE8_MEMBER(nbmj9195_state::blitter_0_w){ blitter_w(offset, data, 0); }
+WRITE8_MEMBER(nbmj9195_state::blitter_1_w){ blitter_w(offset, data, 1); }
-READ8_MEMBER(nbmj9195_state::nbmj9195_blitter_0_r){ return nbmj9195_blitter_r(offset, 0); }
-READ8_MEMBER(nbmj9195_state::nbmj9195_blitter_1_r){ return nbmj9195_blitter_r(offset, 1); }
+READ8_MEMBER(nbmj9195_state::blitter_0_r){ return blitter_r(offset, 0); }
+READ8_MEMBER(nbmj9195_state::blitter_1_r){ return blitter_r(offset, 1); }
-WRITE8_MEMBER(nbmj9195_state::nbmj9195_clut_0_w){ nbmj9195_clut_w(offset, data, 0); }
-WRITE8_MEMBER(nbmj9195_state::nbmj9195_clut_1_w){ nbmj9195_clut_w(offset, data, 1); }
+WRITE8_MEMBER(nbmj9195_state::clut_0_w){ clut_w(offset, data, 0); }
+WRITE8_MEMBER(nbmj9195_state::clut_1_w){ clut_w(offset, data, 1); }
/******************************************************************************
******************************************************************************/
-VIDEO_START_MEMBER(nbmj9195_state,nbmj9195_1layer)
+VIDEO_START_MEMBER(nbmj9195_state,_1layer)
{
int width = m_screen->width();
int height = m_screen->height();
+
+ m_blitter_timer = timer_alloc(TIMER_BLITTER);
m_screen->register_screen_bitmap(m_tmpbitmap[0]);
m_videoram[0] = auto_alloc_array_clear(machine(), UINT16, width * height);
- m_palette_ptr = auto_alloc_array(machine(), UINT8, 0x200);
m_clut[0] = auto_alloc_array(machine(), UINT8, 0x1000);
m_scanline[0] = m_scanline[1] = SCANLINE_MIN;
m_nb19010_busyflag = 1;
m_gfxdraw_mode = 0;
+
+ save_item(NAME(m_scrollx));
+ save_item(NAME(m_scrolly));
+ save_item(NAME(m_scrollx_raster));
+ save_item(NAME(m_blitter_destx));
+ save_item(NAME(m_blitter_desty));
+ save_item(NAME(m_blitter_sizex));
+ save_item(NAME(m_blitter_sizey));
+ save_item(NAME(m_blitter_src_addr));
+ save_item(NAME(m_blitter_direction_x));
+ save_item(NAME(m_blitter_direction_y));
+ save_item(NAME(m_dispflag));
+ save_item(NAME(m_flipscreen));
+ save_item(NAME(m_clutmode));
+ save_item(NAME(m_transparency));
+ save_item(NAME(m_clutsel));
+ save_item(NAME(m_gfxflag2));
+ save_item(NAME(m_gfxdraw_mode));
+ save_item(NAME(m_nb19010_busyctr));
+ save_item(NAME(m_nb19010_busyflag));
+ save_pointer(NAME(m_videoram[0]), width * height);
+ save_pointer(NAME(m_clut[0]), 0x1000);
+ save_item(NAME(m_flipscreen_old));
+ machine().save().register_postload(save_prepost_delegate(FUNC(nbmj9195_state::postload), this));
}
void nbmj9195_state::video_start()
@@ -398,34 +412,64 @@ void nbmj9195_state::video_start()
int width = m_screen->width();
int height = m_screen->height();
+ m_blitter_timer = timer_alloc(TIMER_BLITTER);
+
m_screen->register_screen_bitmap(m_tmpbitmap[0]);
m_screen->register_screen_bitmap(m_tmpbitmap[1]);
m_videoram[0] = auto_alloc_array_clear(machine(), UINT16, width * height);
m_videoram[1] = auto_alloc_array_clear(machine(), UINT16, width * height);
- m_palette_ptr = auto_alloc_array(machine(), UINT8, 0x200);
m_clut[0] = auto_alloc_array(machine(), UINT8, 0x1000);
m_clut[1] = auto_alloc_array(machine(), UINT8, 0x1000);
m_scanline[0] = m_scanline[1] = SCANLINE_MIN;
m_nb19010_busyflag = 1;
m_gfxdraw_mode = 1;
+ m_screen_refresh = 1;
+
+ save_item(NAME(m_scrollx));
+ save_item(NAME(m_scrolly));
+ save_item(NAME(m_scrollx_raster));
+ save_item(NAME(m_blitter_destx));
+ save_item(NAME(m_blitter_desty));
+ save_item(NAME(m_blitter_sizex));
+ save_item(NAME(m_blitter_sizey));
+ save_item(NAME(m_blitter_src_addr));
+ save_item(NAME(m_blitter_direction_x));
+ save_item(NAME(m_blitter_direction_y));
+ save_item(NAME(m_dispflag));
+ save_item(NAME(m_flipscreen));
+ save_item(NAME(m_clutmode));
+ save_item(NAME(m_transparency));
+ save_item(NAME(m_clutsel));
+ save_item(NAME(m_gfxflag2));
+ save_item(NAME(m_gfxdraw_mode));
+ save_item(NAME(m_nb19010_busyctr));
+ save_item(NAME(m_nb19010_busyflag));
+ save_pointer(NAME(m_videoram[0]), width * height);
+ save_pointer(NAME(m_videoram[1]), width * height);
+ save_pointer(NAME(m_clut[0]), 0x1000);
+ save_pointer(NAME(m_clut[1]), 0x1000);
+ save_item(NAME(m_flipscreen_old));
+ machine().save().register_postload(save_prepost_delegate(FUNC(nbmj9195_state::postload), this));
}
-VIDEO_START_MEMBER(nbmj9195_state,nbmj9195_nb22090)
+void nbmj9195_state::postload()
{
+ m_screen_refresh = 1;
+}
+
+VIDEO_START_MEMBER(nbmj9195_state,nb22090)
+{
+ nbmj9195_state::video_start();
+
int width = m_screen->width();
int height = m_screen->height();
- m_screen->register_screen_bitmap(m_tmpbitmap[0]);
- m_screen->register_screen_bitmap(m_tmpbitmap[1]);
- m_videoram[0] = auto_alloc_array_clear(machine(), UINT16, width * height);
- m_videoram[1] = auto_alloc_array_clear(machine(), UINT16, width * height);
m_videoworkram[0] = auto_alloc_array_clear(machine(), UINT16, width * height);
m_videoworkram[1] = auto_alloc_array_clear(machine(), UINT16, width * height);
- m_nb22090_palette = auto_alloc_array(machine(), UINT8, 0xc00);
- m_clut[0] = auto_alloc_array(machine(), UINT8, 0x1000);
- m_clut[1] = auto_alloc_array(machine(), UINT8, 0x1000);
- m_scanline[0] = m_scanline[1] = SCANLINE_MIN;
- m_nb19010_busyflag = 1;
+
+ save_pointer(NAME(m_videoworkram[0]), width * height);
+ save_pointer(NAME(m_videoworkram[1]), width * height);
+
m_gfxdraw_mode = 2;
}
@@ -433,7 +477,7 @@ VIDEO_START_MEMBER(nbmj9195_state,nbmj9195_nb22090)
******************************************************************************/
-UINT32 nbmj9195_state::screen_update_nbmj9195(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+UINT32 nbmj9195_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
int i;
int x, y;
diff --git a/src/mame/video/ninjakd2.c b/src/mame/video/ninjakd2.c
index 8d168e67a1b..9ff710e57e4 100644
--- a/src/mame/video/ninjakd2.c
+++ b/src/mame/video/ninjakd2.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Roberto Ventura, Leandro Dardini, Yochizo, Nicola Salmoria
/******************************************************************************
diff --git a/src/mame/video/ninjaw.c b/src/mame/video/ninjaw.c
index 3fd1ab35d58..360e96087a9 100644
--- a/src/mame/video/ninjaw.c
+++ b/src/mame/video/ninjaw.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:David Graves
#include "emu.h"
#include "includes/ninjaw.h"
diff --git a/src/mame/video/othunder.c b/src/mame/video/othunder.c
index a9de852b75d..7afd22b5c5f 100644
--- a/src/mame/video/othunder.c
+++ b/src/mame/video/othunder.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:David Graves
#include "emu.h"
#include "includes/othunder.h"
diff --git a/src/mame/video/pacland.c b/src/mame/video/pacland.c
index c6eeed9e7d3..1dfdaa798fe 100644
--- a/src/mame/video/pacland.c
+++ b/src/mame/video/pacland.c
@@ -189,8 +189,6 @@ TILE_GET_INFO_MEMBER(pacland_state::get_fg_tile_info)
void pacland_state::video_start()
{
- int color;
-
m_screen->register_screen_bitmap(m_fg_bitmap);
m_fg_bitmap.fill(0xffff);
@@ -204,13 +202,15 @@ void pacland_state::video_start()
/* create one group per color code; for each group, set the transparency mask
to correspond to the pens that are 0x7f or 0xff */
assert(m_gfxdecode->gfx(0)->colors() <= TILEMAP_NUM_GROUPS);
- for (color = 0; color < m_gfxdecode->gfx(0)->colors(); color++)
+ for (int color = 0; color < m_gfxdecode->gfx(0)->colors(); color++)
{
UINT32 mask = m_palette->transpen_mask(*m_gfxdecode->gfx(0), color, 0x7f);
mask |= m_palette->transpen_mask(*m_gfxdecode->gfx(0), color, 0xff);
m_fg_tilemap->set_transmask(color, mask, 0);
}
+ membank("bank1")->configure_entries(0, 8, memregion("maincpu")->base() + 0x10000, 0x2000);
+
save_item(NAME(m_palette_bank));
save_item(NAME(m_scroll0));
save_item(NAME(m_scroll1));
@@ -224,35 +224,31 @@ void pacland_state::video_start()
***************************************************************************/
-WRITE8_MEMBER(pacland_state::pacland_videoram_w)
+WRITE8_MEMBER(pacland_state::videoram_w)
{
m_videoram[offset] = data;
m_fg_tilemap->mark_tile_dirty(offset / 2);
}
-WRITE8_MEMBER(pacland_state::pacland_videoram2_w)
+WRITE8_MEMBER(pacland_state::videoram2_w)
{
m_videoram2[offset] = data;
m_bg_tilemap->mark_tile_dirty(offset / 2);
}
-WRITE8_MEMBER(pacland_state::pacland_scroll0_w)
+WRITE8_MEMBER(pacland_state::scroll0_w)
{
m_scroll0 = data + 256 * offset;
}
-WRITE8_MEMBER(pacland_state::pacland_scroll1_w)
+WRITE8_MEMBER(pacland_state::scroll1_w)
{
m_scroll1 = data + 256 * offset;
}
-WRITE8_MEMBER(pacland_state::pacland_bankswitch_w)
+WRITE8_MEMBER(pacland_state::bankswitch_w)
{
- int bankaddress;
- UINT8 *RAM = memregion("maincpu")->base();
-
- bankaddress = 0x10000 + ((data & 0x07) << 13);
- membank("bank1")->set_base(&RAM[bankaddress]);
+ membank("bank1")->set_entry(data & 0x07);
// pbc = data & 0x20;
@@ -277,9 +273,8 @@ void pacland_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, co
UINT8 *spriteram = m_spriteram + 0x780;
UINT8 *spriteram_2 = spriteram + 0x800;
UINT8 *spriteram_3 = spriteram_2 + 0x800;
- int offs;
- for (offs = 0;offs < 0x80;offs += 2)
+ for (int offs = 0;offs < 0x80;offs += 2)
{
static const int gfx_offs[2][2] =
{
@@ -333,15 +328,13 @@ void pacland_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, co
void pacland_state::draw_fg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int priority )
{
- int y, x;
-
/* draw tilemap transparently over it; this will leave invalid pens (0xffff)
anywhere where the fg_tilemap should be transparent; note that we assume
the fg_bitmap has been pre-erased to 0xffff */
m_fg_tilemap->draw(screen, m_fg_bitmap, cliprect, priority, 0);
/* now copy the fg_bitmap to the destination wherever the sprite pixel allows */
- for (y = cliprect.min_y; y <= cliprect.max_y; y++)
+ for (int y = cliprect.min_y; y <= cliprect.max_y; y++)
{
const UINT8 *pri = &screen.priority().pix8(y);
UINT16 *src = &m_fg_bitmap.pix16(y);
@@ -349,7 +342,7 @@ void pacland_state::draw_fg(screen_device &screen, bitmap_ind16 &bitmap, const r
/* only copy if the priority bitmap is 0 (no high priority sprite) and the
source pixel is not the invalid pen; also clear to 0xffff when finished */
- for (x = cliprect.min_x; x <= cliprect.max_x; x++)
+ for (int x = cliprect.min_x; x <= cliprect.max_x; x++)
{
UINT16 pix = src[x];
if (pix != 0xffff)
@@ -363,12 +356,11 @@ void pacland_state::draw_fg(screen_device &screen, bitmap_ind16 &bitmap, const r
}
-UINT32 pacland_state::screen_update_pacland(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+UINT32 pacland_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- int row;
int flip = flip_screen();
- for (row = 5; row < 29; row++)
+ for (int row = 5; row < 29; row++)
m_fg_tilemap->set_scrollx(row, m_scroll0 - (flip ? 7 : 0));
m_bg_tilemap->set_scrollx(0, m_scroll1);
diff --git a/src/mame/video/pcktgal.c b/src/mame/video/pcktgal.c
index eb91d2580b5..205c931fcf3 100644
--- a/src/mame/video/pcktgal.c
+++ b/src/mame/video/pcktgal.c
@@ -6,9 +6,8 @@
PALETTE_INIT_MEMBER(pcktgal_state, pcktgal)
{
const UINT8 *color_prom = memregion("proms")->base();
- int i;
- for (i = 0;i < palette.entries();i++)
+ for (int i = 0;i < palette.entries();i++)
{
int bit0,bit1,bit2,bit3,r,g,b;
@@ -34,21 +33,18 @@ PALETTE_INIT_MEMBER(pcktgal_state, pcktgal)
void pcktgal_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- UINT8 *spriteram = m_spriteram;
- int offs;
-
- for (offs = 0;offs < m_spriteram.bytes();offs += 4)
+ for (int offs = 0;offs < m_spriteram.bytes();offs += 4)
{
- if (spriteram[offs] != 0xf8)
+ if (m_spriteram[offs] != 0xf8)
{
int sx,sy,flipx,flipy;
- sx = 240 - spriteram[offs+2];
- sy = 240 - spriteram[offs];
+ sx = 240 - m_spriteram[offs+2];
+ sy = 240 - m_spriteram[offs];
- flipx = spriteram[offs+1] & 0x04;
- flipy = spriteram[offs+1] & 0x02;
+ flipx = m_spriteram[offs+1] & 0x04;
+ flipy = m_spriteram[offs+1] & 0x02;
if (flip_screen()) {
sx=240-sx;
sy=240-sy;
@@ -57,8 +53,8 @@ void pcktgal_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect
}
m_gfxdecode->gfx(1)->transpen(bitmap,cliprect,
- spriteram[offs+3] + ((spriteram[offs+1] & 1) << 8),
- (spriteram[offs+1] & 0x70) >> 4,
+ m_spriteram[offs+3] + ((m_spriteram[offs+1] & 1) << 8),
+ (m_spriteram[offs+1] & 0x70) >> 4,
flipx,flipy,
sx,sy,0);
}
diff --git a/src/mame/video/poolshrk.c b/src/mame/video/poolshrk.c
index 939380ff7f1..fe5169bcf27 100644
--- a/src/mame/video/poolshrk.c
+++ b/src/mame/video/poolshrk.c
@@ -27,17 +27,15 @@ void poolshrk_state::video_start()
}
-UINT32 poolshrk_state::screen_update_poolshrk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+UINT32 poolshrk_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- int i;
-
m_bg_tilemap->mark_all_dirty();
bitmap.fill(0, cliprect);
/* draw sprites */
- for (i = 0; i < 16; i++)
+ for (int i = 0; i < 16; i++)
{
int hpos = m_hpos_ram[i];
int vpos = m_vpos_ram[i];
diff --git a/src/mame/video/powervr2.c b/src/mame/video/powervr2.c
index fb5319ff8c6..95638a3681d 100644
--- a/src/mame/video/powervr2.c
+++ b/src/mame/video/powervr2.c
@@ -119,9 +119,9 @@ inline INT32 powervr2_device::clamp(INT32 in, INT32 min, INT32 max)
// Perform a standard bilinear filter across four pixels
inline UINT32 powervr2_device::bilinear_filter(UINT32 c0, UINT32 c1, UINT32 c2, UINT32 c3, float u, float v)
{
- UINT32 ui = (u * 256.0f);
- UINT32 vi = (v * 256.0f);
- return rgba_bilinear_filter(c0, c1, c3, c2, ui, vi);
+ const UINT32 ui = (u * 256.0f);
+ const UINT32 vi = (v * 256.0f);
+ return rgbaint_t::bilinear_filter(c0, c1, c3, c2, ui, vi);
}
// Multiply with alpha value in bits 31-24
diff --git a/src/mame/video/rdpblend.c b/src/mame/video/rdpblend.c
index 98030ee11fb..f71cda4599f 100644
--- a/src/mame/video/rdpblend.c
+++ b/src/mame/video/rdpblend.c
@@ -88,428 +88,368 @@ bool n64_blender_t::alpha_reject(rdp_span_aux* userdata, const rdp_poly_state& o
return false;
case 2:
- return userdata->m_pixel_color.i.a < userdata->m_blend_color.i.a;
+ return userdata->m_pixel_color.get_a() < userdata->m_blend_color.get_a();
case 3:
- return userdata->m_pixel_color.i.a < (rand() & 0xff);
+ return userdata->m_pixel_color.get_a() < (rand() & 0xff);
default:
return false;
}
}
-bool n64_blender_t::cycle1_noblend_noacvg_nodither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, rdp_span_aux* userdata, const rdp_poly_state& object)
+bool n64_blender_t::cycle1_noblend_noacvg_nodither(color_t& blended_pixel, int dith, int adseed, int partialreject, int sel0, rdp_span_aux* userdata, const rdp_poly_state& object)
{
- userdata->m_pixel_color.i.a = m_alpha_dither[(userdata->m_pixel_color.i.a << 3) | adseed];
- userdata->m_shade_color.i.a = m_alpha_dither[(userdata->m_shade_color.i.a << 3) | adseed];
+ userdata->m_pixel_color.set_a(m_alpha_dither[((UINT8)userdata->m_pixel_color.get_a() << 3) | adseed]);
+ userdata->m_shade_color.set_a(m_alpha_dither[((UINT8)userdata->m_shade_color.get_a() << 3) | adseed]);
if (test_for_reject(userdata, object))
{
return false;
}
- *fr = *userdata->m_color_inputs.blender1a_r[0];
- *fg = *userdata->m_color_inputs.blender1a_g[0];
- *fb = *userdata->m_color_inputs.blender1a_b[0];
+ blended_pixel.set(*userdata->m_color_inputs.blender1a_rgb[0]);
return true;
}
-bool n64_blender_t::cycle1_noblend_noacvg_dither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, rdp_span_aux* userdata, const rdp_poly_state& object)
+bool n64_blender_t::cycle1_noblend_noacvg_dither(color_t& blended_pixel, int dith, int adseed, int partialreject, int sel0, rdp_span_aux* userdata, const rdp_poly_state& object)
{
- userdata->m_pixel_color.i.a = m_alpha_dither[(userdata->m_pixel_color.i.a << 3) | adseed];
- userdata->m_shade_color.i.a = m_alpha_dither[(userdata->m_shade_color.i.a << 3) | adseed];
+ userdata->m_pixel_color.set_a(m_alpha_dither[((UINT8)userdata->m_pixel_color.get_a() << 3) | adseed]);
+ userdata->m_shade_color.set_a(m_alpha_dither[((UINT8)userdata->m_shade_color.get_a() << 3) | adseed]);
if (test_for_reject(userdata, object))
{
return false;
}
- *fr = m_color_dither[((*userdata->m_color_inputs.blender1a_r[0] & 0xff) << 3) | dith];
- *fg = m_color_dither[((*userdata->m_color_inputs.blender1a_g[0] & 0xff) << 3) | dith];
- *fb = m_color_dither[((*userdata->m_color_inputs.blender1a_b[0] & 0xff) << 3) | dith];
+
+ rgbaint_t index(*userdata->m_color_inputs.blender1a_rgb[0]);
+ index.shl_imm(3);
+ index.or_imm(dith);
+ index.and_imm(0x7ff);
+ blended_pixel.set(0, m_color_dither[index.get_r32()], m_color_dither[index.get_g32()], m_color_dither[index.get_b32()]);
return true;
}
-bool n64_blender_t::cycle1_noblend_acvg_nodither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, rdp_span_aux* userdata, const rdp_poly_state& object)
+bool n64_blender_t::cycle1_noblend_acvg_nodither(color_t& blended_pixel, int dith, int adseed, int partialreject, int sel0, rdp_span_aux* userdata, const rdp_poly_state& object)
{
- userdata->m_shade_color.i.a = m_alpha_dither[(userdata->m_shade_color.i.a << 3) | adseed];
+ userdata->m_shade_color.set_a(m_alpha_dither[((UINT8)userdata->m_shade_color.get_a() << 3) | adseed]);
if (test_for_reject(userdata, object))
{
return false;
}
- *fr = *userdata->m_color_inputs.blender1a_r[0];
- *fg = *userdata->m_color_inputs.blender1a_g[0];
- *fb = *userdata->m_color_inputs.blender1a_b[0];
+ blended_pixel.set(*userdata->m_color_inputs.blender1a_rgb[0]);
return true;
}
-bool n64_blender_t::cycle1_noblend_acvg_dither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, rdp_span_aux* userdata, const rdp_poly_state& object)
+bool n64_blender_t::cycle1_noblend_acvg_dither(color_t& blended_pixel, int dith, int adseed, int partialreject, int sel0, rdp_span_aux* userdata, const rdp_poly_state& object)
{
- userdata->m_shade_color.i.a = m_alpha_dither[(userdata->m_shade_color.i.a << 3) | adseed];
+ userdata->m_shade_color.set_a(m_alpha_dither[((UINT8)userdata->m_shade_color.get_a() << 3) | adseed]);
if (test_for_reject(userdata, object))
{
return false;
}
- *fr = m_color_dither[((*userdata->m_color_inputs.blender1a_r[0] & 0xff) << 3) | dith];
- *fg = m_color_dither[((*userdata->m_color_inputs.blender1a_g[0] & 0xff) << 3) | dith];
- *fb = m_color_dither[((*userdata->m_color_inputs.blender1a_b[0] & 0xff) << 3) | dith];
+
+ rgbaint_t index(*userdata->m_color_inputs.blender1a_rgb[0]);
+ index.shl_imm(3);
+ index.or_imm(dith);
+ index.and_imm(0x7ff);
+ blended_pixel.set(0, m_color_dither[index.get_r32()], m_color_dither[index.get_g32()], m_color_dither[index.get_b32()]);
return true;
}
-bool n64_blender_t::cycle1_blend_noacvg_nodither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, rdp_span_aux* userdata, const rdp_poly_state& object)
+bool n64_blender_t::cycle1_blend_noacvg_nodither(color_t& blended_pixel, int dith, int adseed, int partialreject, int sel0, rdp_span_aux* userdata, const rdp_poly_state& object)
{
- INT32 r, g, b;
-
- userdata->m_pixel_color.i.a = m_alpha_dither[(userdata->m_pixel_color.i.a << 3) | adseed];
- userdata->m_shade_color.i.a = m_alpha_dither[(userdata->m_shade_color.i.a << 3) | adseed];
+ userdata->m_pixel_color.set_a(m_alpha_dither[((UINT8)userdata->m_pixel_color.get_a() << 3) | adseed]);
+ userdata->m_shade_color.set_a(m_alpha_dither[((UINT8)userdata->m_shade_color.get_a() << 3) | adseed]);
if (test_for_reject(userdata, object))
{
return false;
}
- blend_with_partial_reject(&r, &g, &b, 0, partialreject, sel0, userdata, object);
-
- *fr = r;
- *fg = g;
- *fb = b;
+ blend_with_partial_reject(blended_pixel, 0, partialreject, sel0, userdata, object);
return true;
}
-bool n64_blender_t::cycle1_blend_noacvg_dither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, rdp_span_aux* userdata, const rdp_poly_state& object)
+bool n64_blender_t::cycle1_blend_noacvg_dither(color_t& blended_pixel, int dith, int adseed, int partialreject, int sel0, rdp_span_aux* userdata, const rdp_poly_state& object)
{
- INT32 r, g, b;
-
- userdata->m_pixel_color.i.a = m_alpha_dither[(userdata->m_pixel_color.i.a << 3) | adseed];
- userdata->m_shade_color.i.a = m_alpha_dither[(userdata->m_shade_color.i.a << 3) | adseed];
+ userdata->m_pixel_color.set_a(m_alpha_dither[((UINT8)userdata->m_pixel_color.get_a() << 3) | adseed]);
+ userdata->m_shade_color.set_a(m_alpha_dither[((UINT8)userdata->m_shade_color.get_a() << 3) | adseed]);
if (test_for_reject(userdata, object))
{
return false;
}
- blend_with_partial_reject(&r, &g, &b, 0, partialreject, sel0, userdata, object);
+ color_t rgb;
+ blend_with_partial_reject(rgb, 0, partialreject, sel0, userdata, object);
- *fr = m_color_dither[((r & 0xff) << 3) | dith];
- *fg = m_color_dither[((g & 0xff) << 3) | dith];
- *fb = m_color_dither[((b & 0xff) << 3) | dith];
+ rgb.shl_imm(3);
+ rgb.or_imm(dith);
+ rgb.and_imm(0x7ff);
+ blended_pixel.set(0, m_color_dither[rgb.get_r32()], m_color_dither[rgb.get_g32()], m_color_dither[rgb.get_b32()]);
return true;
}
-bool n64_blender_t::cycle1_blend_acvg_nodither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, rdp_span_aux* userdata, const rdp_poly_state& object)
+bool n64_blender_t::cycle1_blend_acvg_nodither(color_t& blended_pixel, int dith, int adseed, int partialreject, int sel0, rdp_span_aux* userdata, const rdp_poly_state& object)
{
- INT32 r, g, b;
-
- userdata->m_shade_color.i.a = m_alpha_dither[(userdata->m_shade_color.i.a << 3) | adseed];
+ userdata->m_shade_color.set_a(m_alpha_dither[((UINT8)userdata->m_shade_color.get_a() << 3) | adseed]);
if (test_for_reject(userdata, object))
{
return false;
}
- blend_with_partial_reject(&r, &g, &b, 0, partialreject, sel0, userdata, object);
-
- *fr = r;
- *fg = g;
- *fb = b;
+ blend_with_partial_reject(blended_pixel, 0, partialreject, sel0, userdata, object);
return true;
}
-bool n64_blender_t::cycle1_blend_acvg_dither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, rdp_span_aux* userdata, const rdp_poly_state& object)
+bool n64_blender_t::cycle1_blend_acvg_dither(color_t& blended_pixel, int dith, int adseed, int partialreject, int sel0, rdp_span_aux* userdata, const rdp_poly_state& object)
{
- INT32 r, g, b;
-
- userdata->m_shade_color.i.a = m_alpha_dither[(userdata->m_shade_color.i.a << 3) | adseed];
+ userdata->m_shade_color.set_a(m_alpha_dither[((UINT8)userdata->m_shade_color.get_a() << 3) | adseed]);
if (test_for_reject(userdata, object))
{
return false;
}
- blend_with_partial_reject(&r, &g, &b, 0, partialreject, sel0, userdata, object);
+ color_t rgb;
+ blend_with_partial_reject(rgb, 0, partialreject, sel0, userdata, object);
- *fr = m_color_dither[((r & 0xff) << 3) | dith];
- *fg = m_color_dither[((g & 0xff) << 3) | dith];
- *fb = m_color_dither[((b & 0xff) << 3) | dith];
+ rgb.shl_imm(3);
+ rgb.or_imm(dith);
+ rgb.and_imm(0x7ff);
+ blended_pixel.set(0, m_color_dither[rgb.get_r32()], m_color_dither[rgb.get_g32()], m_color_dither[rgb.get_b32()]);
return true;
}
-bool n64_blender_t::cycle2_noblend_noacvg_nodither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux* userdata, const rdp_poly_state& object)
+bool n64_blender_t::cycle2_noblend_noacvg_nodither(color_t& blended_pixel, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux* userdata, const rdp_poly_state& object)
{
- INT32 r, g, b;
-
- userdata->m_pixel_color.i.a = m_alpha_dither[(userdata->m_pixel_color.i.a << 3) | adseed];
- userdata->m_shade_color.i.a = m_alpha_dither[(userdata->m_shade_color.i.a << 3) | adseed];
+ userdata->m_pixel_color.set_a(m_alpha_dither[((UINT8)userdata->m_pixel_color.get_a() << 3) | adseed]);
+ userdata->m_shade_color.set_a(m_alpha_dither[((UINT8)userdata->m_shade_color.get_a() << 3) | adseed]);
if (test_for_reject(userdata, object))
{
return false;
}
- userdata->m_inv_pixel_color.i.a = 0xff - *userdata->m_color_inputs.blender1b_a[0];
- blend_pipe(0, sel0, &r, &g, &b, userdata, object);
+ userdata->m_inv_pixel_color.set_a(0xff - userdata->m_color_inputs.blender1b_a[0]->get_a());
+ blend_pipe(0, sel0, userdata->m_blended_pixel_color, userdata, object);
+ userdata->m_blended_pixel_color.set_a(userdata->m_pixel_color.get_a());
- userdata->m_blended_pixel_color.i.r = r;
- userdata->m_blended_pixel_color.i.g = g;
- userdata->m_blended_pixel_color.i.b = b;
- userdata->m_blended_pixel_color.i.a = userdata->m_pixel_color.i.a;
- *fr = *userdata->m_color_inputs.blender1a_r[1];
- *fg = *userdata->m_color_inputs.blender1a_g[1];
- *fb = *userdata->m_color_inputs.blender1a_b[1];
+ blended_pixel.set(*userdata->m_color_inputs.blender1a_rgb[1]);
return true;
}
-bool n64_blender_t::cycle2_noblend_noacvg_dither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux* userdata, const rdp_poly_state& object)
+bool n64_blender_t::cycle2_noblend_noacvg_dither(color_t& blended_pixel, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux* userdata, const rdp_poly_state& object)
{
- INT32 r, g, b;
-
- userdata->m_pixel_color.i.a = m_alpha_dither[(userdata->m_pixel_color.i.a << 3) | adseed];
- userdata->m_shade_color.i.a = m_alpha_dither[(userdata->m_shade_color.i.a << 3) | adseed];
+ userdata->m_pixel_color.set_a(m_alpha_dither[((UINT8)userdata->m_pixel_color.get_a() << 3) | adseed]);
+ userdata->m_shade_color.set_a(m_alpha_dither[((UINT8)userdata->m_shade_color.get_a() << 3) | adseed]);
if (test_for_reject(userdata, object))
{
return false;
}
- userdata->m_inv_pixel_color.i.a = 0xff - *userdata->m_color_inputs.blender1b_a[0];
- blend_pipe(0, sel0, &r, &g, &b, userdata, object);
+ userdata->m_inv_pixel_color.set_a(0xff - (UINT8)userdata->m_color_inputs.blender1b_a[0]->get_a());
+ blend_pipe(0, sel0, userdata->m_blended_pixel_color, userdata, object);
+ userdata->m_blended_pixel_color.set_a(userdata->m_pixel_color.get_a());
- userdata->m_blended_pixel_color.i.r = r;
- userdata->m_blended_pixel_color.i.g = g;
- userdata->m_blended_pixel_color.i.b = b;
- userdata->m_blended_pixel_color.i.a = userdata->m_pixel_color.i.a;
- *fr = m_color_dither[((*userdata->m_color_inputs.blender1a_r[1] & 0xff) << 3) | dith];
- *fg = m_color_dither[((*userdata->m_color_inputs.blender1a_g[1] & 0xff) << 3) | dith];
- *fb = m_color_dither[((*userdata->m_color_inputs.blender1a_b[1] & 0xff) << 3) | dith];
+ rgbaint_t index(*userdata->m_color_inputs.blender1a_rgb[1]);
+ index.shl_imm(3);
+ index.or_imm(dith);
+ index.and_imm(0x7ff);
+ blended_pixel.set(0, m_color_dither[index.get_r32()], m_color_dither[index.get_g32()], m_color_dither[index.get_b32()]);
return true;
}
-bool n64_blender_t::cycle2_noblend_acvg_nodither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux* userdata, const rdp_poly_state& object)
+bool n64_blender_t::cycle2_noblend_acvg_nodither(color_t& blended_pixel, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux* userdata, const rdp_poly_state& object)
{
- INT32 r, g, b;
-
- userdata->m_shade_color.i.a = m_alpha_dither[(userdata->m_shade_color.i.a << 3) | adseed];
+ userdata->m_shade_color.set_a(m_alpha_dither[((UINT8)userdata->m_shade_color.get_a() << 3) | adseed]);
if (test_for_reject(userdata, object))
{
return false;
}
- userdata->m_inv_pixel_color.i.a = 0xff - *userdata->m_color_inputs.blender1b_a[0];
- blend_pipe(0, sel0, &r, &g, &b, userdata, object);
+ userdata->m_inv_pixel_color.set_a(0xff - userdata->m_color_inputs.blender1b_a[0]->get_a());
+ blend_pipe(0, sel0, userdata->m_blended_pixel_color, userdata, object);
+ userdata->m_blended_pixel_color.set_a(userdata->m_pixel_color.get_a());
- userdata->m_blended_pixel_color.i.r = r;
- userdata->m_blended_pixel_color.i.g = g;
- userdata->m_blended_pixel_color.i.b = b;
- userdata->m_blended_pixel_color.i.a = userdata->m_pixel_color.i.a;
- *fr = *userdata->m_color_inputs.blender1a_r[1];
- *fg = *userdata->m_color_inputs.blender1a_g[1];
- *fb = *userdata->m_color_inputs.blender1a_b[1];
+ blended_pixel.set(*userdata->m_color_inputs.blender1a_rgb[1]);
return true;
}
-bool n64_blender_t::cycle2_noblend_acvg_dither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux* userdata, const rdp_poly_state& object)
+bool n64_blender_t::cycle2_noblend_acvg_dither(color_t& blended_pixel, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux* userdata, const rdp_poly_state& object)
{
- INT32 r, g, b;
-
- userdata->m_shade_color.i.a = m_alpha_dither[(userdata->m_shade_color.i.a << 3) | adseed];
+ userdata->m_shade_color.set_a(m_alpha_dither[((UINT8)userdata->m_shade_color.get_a() << 3) | adseed]);
if (test_for_reject(userdata, object))
{
return false;
}
- userdata->m_inv_pixel_color.i.a = 0xff - *userdata->m_color_inputs.blender1b_a[0];
- blend_pipe(0, sel0, &r, &g, &b, userdata, object);
+ userdata->m_inv_pixel_color.set_a(0xff - userdata->m_color_inputs.blender1b_a[0]->get_a());
+ blend_pipe(0, sel0, userdata->m_blended_pixel_color, userdata, object);
+ userdata->m_blended_pixel_color.set_a(userdata->m_pixel_color.get_a());
- userdata->m_blended_pixel_color.i.r = r;
- userdata->m_blended_pixel_color.i.g = g;
- userdata->m_blended_pixel_color.i.b = b;
- userdata->m_blended_pixel_color.i.a = userdata->m_pixel_color.i.a;
- *fr = m_color_dither[((*userdata->m_color_inputs.blender1a_r[1] & 0xff) << 3) | dith];
- *fg = m_color_dither[((*userdata->m_color_inputs.blender1a_g[1] & 0xff) << 3) | dith];
- *fb = m_color_dither[((*userdata->m_color_inputs.blender1a_b[1] & 0xff) << 3) | dith];
+ rgbaint_t index(*userdata->m_color_inputs.blender1a_rgb[1]);
+ index.shl_imm(3);
+ index.or_imm(dith);
+ index.and_imm(0x7ff);
+ blended_pixel.set(0, m_color_dither[index.get_r32()], m_color_dither[index.get_g32()], m_color_dither[index.get_b32()]);
return true;
}
-bool n64_blender_t::cycle2_blend_noacvg_nodither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux* userdata, const rdp_poly_state& object)
+bool n64_blender_t::cycle2_blend_noacvg_nodither(color_t& blended_pixel, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux* userdata, const rdp_poly_state& object)
{
- INT32 r, g, b;
-
- userdata->m_pixel_color.i.a = m_alpha_dither[(userdata->m_pixel_color.i.a << 3) | adseed];
- userdata->m_shade_color.i.a = m_alpha_dither[(userdata->m_shade_color.i.a << 3) | adseed];
+ userdata->m_pixel_color.set_a(m_alpha_dither[((UINT8)userdata->m_pixel_color.get_a() << 3) | adseed]);
+ userdata->m_shade_color.set_a(m_alpha_dither[((UINT8)userdata->m_shade_color.get_a() << 3) | adseed]);
if (test_for_reject(userdata, object))
{
return false;
}
- userdata->m_inv_pixel_color.i.a = 0xff - *userdata->m_color_inputs.blender1b_a[0];
- blend_pipe(0, sel0, &r, &g, &b, userdata, object);
-
- userdata->m_blended_pixel_color.i.r = r;
- userdata->m_blended_pixel_color.i.g = g;
- userdata->m_blended_pixel_color.i.b = b;
- userdata->m_blended_pixel_color.i.a = userdata->m_pixel_color.i.a;
+ userdata->m_inv_pixel_color.set_a(0xff - userdata->m_color_inputs.blender1b_a[0]->get_a());
+ blend_pipe(0, sel0, userdata->m_blended_pixel_color, userdata, object);
+ userdata->m_blended_pixel_color.set_a(userdata->m_pixel_color.get_a());
- blend_with_partial_reject(&r, &g, &b, 1, partialreject, sel1, userdata, object);
-
- *fr = r;
- *fg = g;
- *fb = b;
+ blend_with_partial_reject(blended_pixel, 1, partialreject, sel1, userdata, object);
return true;
}
-bool n64_blender_t::cycle2_blend_noacvg_dither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux* userdata, const rdp_poly_state& object)
+bool n64_blender_t::cycle2_blend_noacvg_dither(color_t& blended_pixel, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux* userdata, const rdp_poly_state& object)
{
- INT32 r, g, b;
-
- userdata->m_pixel_color.i.a = m_alpha_dither[(userdata->m_pixel_color.i.a << 3) | adseed];
- userdata->m_shade_color.i.a = m_alpha_dither[(userdata->m_shade_color.i.a << 3) | adseed];
+ userdata->m_pixel_color.set_a(m_alpha_dither[(userdata->m_pixel_color.get_a() << 3) | adseed]);
+ userdata->m_shade_color.set_a(m_alpha_dither[(userdata->m_shade_color.get_a() << 3) | adseed]);
if (test_for_reject(userdata, object))
{
return false;
}
- userdata->m_inv_pixel_color.i.a = 0xff - *userdata->m_color_inputs.blender1b_a[0];
- blend_pipe(0, sel0, &r, &g, &b, userdata, object);
-
- userdata->m_blended_pixel_color.i.r = r;
- userdata->m_blended_pixel_color.i.g = g;
- userdata->m_blended_pixel_color.i.b = b;
- userdata->m_blended_pixel_color.i.a = userdata->m_pixel_color.i.a;
+ userdata->m_inv_pixel_color.set_a(0xff - userdata->m_color_inputs.blender1b_a[0]->get_a());
+ blend_pipe(0, sel0, userdata->m_blended_pixel_color, userdata, object);
+ userdata->m_blended_pixel_color.set_a(userdata->m_pixel_color.get_a());
- blend_with_partial_reject(&r, &g, &b, 1, partialreject, sel1, userdata, object);
+ color_t rgb;
+ blend_with_partial_reject(rgb, 1, partialreject, sel1, userdata, object);
- *fr = m_color_dither[((r & 0xff) << 3) | dith];
- *fg = m_color_dither[((g & 0xff) << 3) | dith];
- *fb = m_color_dither[((b & 0xff) << 3) | dith];
+ rgb.shl_imm(3);
+ rgb.or_imm(dith);
+ rgb.and_imm(0x7ff);
+ blended_pixel.set(0, m_color_dither[rgb.get_r32()], m_color_dither[rgb.get_g32()], m_color_dither[rgb.get_b32()]);
return true;
}
-bool n64_blender_t::cycle2_blend_acvg_nodither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux* userdata, const rdp_poly_state& object)
+bool n64_blender_t::cycle2_blend_acvg_nodither(color_t& blended_pixel, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux* userdata, const rdp_poly_state& object)
{
- INT32 r, g, b;
-
- userdata->m_shade_color.i.a = m_alpha_dither[(userdata->m_shade_color.i.a << 3) | adseed];
+ userdata->m_shade_color.set_a(m_alpha_dither[(userdata->m_shade_color.get_a() << 3) | adseed]);
if (test_for_reject(userdata, object))
{
return false;
}
- userdata->m_inv_pixel_color.i.a = 0xff - *userdata->m_color_inputs.blender1b_a[0];
- blend_pipe(0, sel0, &r, &g, &b, userdata, object);
-
- userdata->m_blended_pixel_color.i.r = r;
- userdata->m_blended_pixel_color.i.g = g;
- userdata->m_blended_pixel_color.i.b = b;
- userdata->m_blended_pixel_color.i.a = userdata->m_pixel_color.i.a;
-
- blend_with_partial_reject(&r, &g, &b, 1, partialreject, sel1, userdata, object);
+ userdata->m_inv_pixel_color.set_a(0xff - userdata->m_color_inputs.blender1b_a[0]->get_a());
+ blend_pipe(0, sel0, userdata->m_blended_pixel_color, userdata, object);
+ userdata->m_blended_pixel_color.set_a(userdata->m_pixel_color.get_a());
- *fr = r;
- *fg = g;
- *fb = b;
+ blend_with_partial_reject(blended_pixel, 1, partialreject, sel1, userdata, object);
return true;
}
-bool n64_blender_t::cycle2_blend_acvg_dither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux* userdata, const rdp_poly_state& object)
+bool n64_blender_t::cycle2_blend_acvg_dither(color_t& blended_pixel, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux* userdata, const rdp_poly_state& object)
{
- INT32 r, g, b;
-
- userdata->m_shade_color.i.a = m_alpha_dither[(userdata->m_shade_color.i.a << 3) | adseed];
+ userdata->m_shade_color.set_a(m_alpha_dither[(userdata->m_shade_color.get_a() << 3) | adseed]);
if (test_for_reject(userdata, object))
{
return false;
}
- userdata->m_inv_pixel_color.i.a = 0xff - *userdata->m_color_inputs.blender1b_a[0];
- blend_pipe(0, sel0, &r, &g, &b, userdata, object);
-
- userdata->m_blended_pixel_color.i.r = r;
- userdata->m_blended_pixel_color.i.g = g;
- userdata->m_blended_pixel_color.i.b = b;
- userdata->m_blended_pixel_color.i.a = userdata->m_pixel_color.i.a;
+ userdata->m_inv_pixel_color.set_a(0xff - userdata->m_color_inputs.blender1b_a[0]->get_a());
+ blend_pipe(0, sel0, userdata->m_blended_pixel_color, userdata, object);
+ userdata->m_blended_pixel_color.set_a(userdata->m_pixel_color.get_a());
- blend_with_partial_reject(&r, &g, &b, 1, partialreject, sel1, userdata, object);
+ color_t rgb;
+ blend_with_partial_reject(rgb, 1, partialreject, sel1, userdata, object);
- *fr = m_color_dither[((r & 0xff) << 3) | dith];
- *fg = m_color_dither[((g & 0xff) << 3) | dith];
- *fb = m_color_dither[((b & 0xff) << 3) | dith];
+ rgb.shl_imm(3);
+ rgb.or_imm(dith);
+ rgb.and_imm(0x7ff);
+ blended_pixel.set(0, m_color_dither[rgb.get_r32()], m_color_dither[rgb.get_g32()], m_color_dither[rgb.get_b32()]);
return true;
}
-void n64_blender_t::blend_with_partial_reject(INT32* r, INT32* g, INT32* b, INT32 cycle, INT32 partialreject, INT32 select, rdp_span_aux* userdata, const rdp_poly_state& object)
+void n64_blender_t::blend_with_partial_reject(color_t& out, INT32 cycle, INT32 partialreject, INT32 select, rdp_span_aux* userdata, const rdp_poly_state& object)
{
- if (partialreject && userdata->m_pixel_color.i.a >= 0xff)
+ if (partialreject && userdata->m_pixel_color.get_a() >= 0xff)
{
- *r = *userdata->m_color_inputs.blender1a_r[cycle];
- *g = *userdata->m_color_inputs.blender1a_g[cycle];
- *b = *userdata->m_color_inputs.blender1a_b[cycle];
+ out.set(*userdata->m_color_inputs.blender1a_rgb[cycle]);
}
else
{
- userdata->m_inv_pixel_color.i.a = 0xff - *userdata->m_color_inputs.blender1b_a[cycle];
- blend_pipe(cycle, select, r, g, b, userdata, object);
+ userdata->m_inv_pixel_color.set_a(0xff - userdata->m_color_inputs.blender1b_a[cycle]->get_a());
+ blend_pipe(cycle, select, out, userdata, object);
}
}
-void n64_blender_t::blend_pipe(const int cycle, const int special, int* r_out, int* g_out, int* b_out, rdp_span_aux* userdata, const rdp_poly_state& object)
+void n64_blender_t::blend_pipe(const int cycle, const int special, color_t& out, rdp_span_aux* userdata, const rdp_poly_state& object)
{
const INT32 mask = 0xff &~ (0x73 * special);
const INT32 shift_a = 3 + userdata->m_shift_a * special;
const INT32 shift_b = 3 + userdata->m_shift_b * special;
- const INT32 blend1a = (*userdata->m_color_inputs.blender1b_a[cycle] >> shift_a) & mask;
- const INT32 blend2a = (*userdata->m_color_inputs.blender2b_a[cycle] >> shift_b) & mask;
+ const INT32 blend1a = (userdata->m_color_inputs.blender1b_a[cycle]->get_a() >> shift_a) & mask;
+ const INT32 blend2a = (userdata->m_color_inputs.blender2b_a[cycle]->get_a() >> shift_b) & mask;
const INT32 special_shift = special << 1;
- INT32 r = (((int)(*userdata->m_color_inputs.blender1a_r[cycle]) * (int)(blend1a))) + (((int)(*userdata->m_color_inputs.blender2a_r[cycle]) * (int)(blend2a)));
- INT32 g = (((int)(*userdata->m_color_inputs.blender1a_g[cycle]) * (int)(blend1a))) + (((int)(*userdata->m_color_inputs.blender2a_g[cycle]) * (int)(blend2a)));
- INT32 b = (((int)(*userdata->m_color_inputs.blender1a_b[cycle]) * (int)(blend1a))) + (((int)(*userdata->m_color_inputs.blender2a_b[cycle]) * (int)(blend2a)));
+ rgbaint_t temp(*userdata->m_color_inputs.blender1a_rgb[cycle]);
+ temp.mul_imm(blend1a);
- r += ((int)*userdata->m_color_inputs.blender2a_r[cycle]) << special_shift;
- g += ((int)*userdata->m_color_inputs.blender2a_g[cycle]) << special_shift;
- b += ((int)*userdata->m_color_inputs.blender2a_b[cycle]) << special_shift;
+ rgbaint_t secondary(*userdata->m_color_inputs.blender2a_rgb[cycle]);
+ rgbaint_t other(*userdata->m_color_inputs.blender2a_rgb[cycle]);
+ other.mul_imm(blend2a);
- r >>= object.m_other_modes.blend_shift;
- g >>= object.m_other_modes.blend_shift;
- b >>= object.m_other_modes.blend_shift;
+ temp.add(other);
+ secondary.shl_imm(special_shift);
+ temp.add(secondary);
+ temp.shr_imm(object.m_other_modes.blend_shift);
+ INT32 factor_sum = 0;
if (!object.m_other_modes.force_blend)
{
- INT32 factor_sum = ((blend1a >> 2) + (blend2a >> 2) + 1) & 0xf;
+ factor_sum = ((blend1a >> 2) + (blend2a >> 2) + 1) & 0xf;
if (factor_sum)
{
- r /= factor_sum;
- g /= factor_sum;
- b /= factor_sum;
+ temp.set_r(temp.get_r32() / factor_sum);
+ temp.set_g(temp.get_g32() / factor_sum);
+ temp.set_b(temp.get_b32() / factor_sum);
}
else
{
- r = g = b = 0xff;
+ temp.set(0, 0xff, 0xff, 0xff);
}
}
- *r_out = min(r, 255);
- *g_out = min(g, 255);
- *b_out = min(b, 255);
+ temp.min(255);
+ out.set(temp);
}
inline INT32 n64_blender_t::min(const INT32 x, const INT32 min)
diff --git a/src/mame/video/rdpblend.h b/src/mame/video/rdpblend.h
index 89d97e7a5c3..75f51cea7ea 100644
--- a/src/mame/video/rdpblend.h
+++ b/src/mame/video/rdpblend.h
@@ -17,19 +17,13 @@
#define _VIDEO_RDPBLEND_H_
#include "emu.h"
-
-struct other_modes_t;
-struct misc_state_t;
-class n64_rdp;
-struct rdp_span_aux;
-class color_t;
-struct rdp_poly_state;
+#include "video/n64.h"
class n64_blender_t
{
public:
- typedef bool (n64_blender_t::*blender1)(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, rdp_span_aux* userdata, const rdp_poly_state& object);
- typedef bool (n64_blender_t::*blender2)(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux* userdata, const rdp_poly_state& object);
+ typedef bool (n64_blender_t::*blender1)(color_t& blended_pixel, int dith, int adseed, int partialreject, int sel0, rdp_span_aux* userdata, const rdp_poly_state& object);
+ typedef bool (n64_blender_t::*blender2)(color_t& blended_pixel, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux* userdata, const rdp_poly_state& object);
n64_blender_t();
@@ -48,26 +42,26 @@ class n64_blender_t
INT32 min(const INT32 x, const INT32 min);
bool alpha_reject(rdp_span_aux* userdata, const rdp_poly_state& object);
bool test_for_reject(rdp_span_aux* userdata, const rdp_poly_state& object);
- void blend_pipe(const int cycle, const int special, int* r_out, int* g_out, int* b_out, rdp_span_aux* userdata, const rdp_poly_state& object);
- void blend_with_partial_reject(INT32* r, INT32* g, INT32* b, INT32 cycle, INT32 partialreject, INT32 select, rdp_span_aux* userdata, const rdp_poly_state& object);
-
- bool cycle1_noblend_noacvg_nodither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, rdp_span_aux* userdata, const rdp_poly_state& object);
- bool cycle1_noblend_noacvg_dither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, rdp_span_aux* userdata, const rdp_poly_state& object);
- bool cycle1_noblend_acvg_nodither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, rdp_span_aux* userdata, const rdp_poly_state& object);
- bool cycle1_noblend_acvg_dither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, rdp_span_aux* userdata, const rdp_poly_state& object);
- bool cycle1_blend_noacvg_nodither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, rdp_span_aux* userdata, const rdp_poly_state& object);
- bool cycle1_blend_noacvg_dither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, rdp_span_aux* userdata, const rdp_poly_state& object);
- bool cycle1_blend_acvg_nodither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, rdp_span_aux* userdata, const rdp_poly_state& object);
- bool cycle1_blend_acvg_dither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, rdp_span_aux* userdata, const rdp_poly_state& object);
-
- bool cycle2_noblend_noacvg_nodither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux* userdata, const rdp_poly_state& object);
- bool cycle2_noblend_noacvg_dither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux* userdata, const rdp_poly_state& object);
- bool cycle2_noblend_acvg_nodither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux* userdata, const rdp_poly_state& object);
- bool cycle2_noblend_acvg_dither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux* userdata, const rdp_poly_state& object);
- bool cycle2_blend_noacvg_nodither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux* userdata, const rdp_poly_state& object);
- bool cycle2_blend_noacvg_dither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux* userdata, const rdp_poly_state& object);
- bool cycle2_blend_acvg_nodither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux* userdata, const rdp_poly_state& object);
- bool cycle2_blend_acvg_dither(INT32* fr, INT32* fg, INT32* fb, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux* userdata, const rdp_poly_state& object);
+ void blend_pipe(const int cycle, const int special, color_t& out, rdp_span_aux* userdata, const rdp_poly_state& object);
+ void blend_with_partial_reject(color_t& out, INT32 cycle, INT32 partialreject, INT32 select, rdp_span_aux* userdata, const rdp_poly_state& object);
+
+ bool cycle1_noblend_noacvg_nodither(color_t& blended_pixel, int dith, int adseed, int partialreject, int sel0, rdp_span_aux* userdata, const rdp_poly_state& object);
+ bool cycle1_noblend_noacvg_dither(color_t& blended_pixel, int dith, int adseed, int partialreject, int sel0, rdp_span_aux* userdata, const rdp_poly_state& object);
+ bool cycle1_noblend_acvg_nodither(color_t& blended_pixel, int dith, int adseed, int partialreject, int sel0, rdp_span_aux* userdata, const rdp_poly_state& object);
+ bool cycle1_noblend_acvg_dither(color_t& blended_pixel, int dith, int adseed, int partialreject, int sel0, rdp_span_aux* userdata, const rdp_poly_state& object);
+ bool cycle1_blend_noacvg_nodither(color_t& blended_pixel, int dith, int adseed, int partialreject, int sel0, rdp_span_aux* userdata, const rdp_poly_state& object);
+ bool cycle1_blend_noacvg_dither(color_t& blended_pixel, int dith, int adseed, int partialreject, int sel0, rdp_span_aux* userdata, const rdp_poly_state& object);
+ bool cycle1_blend_acvg_nodither(color_t& blended_pixel, int dith, int adseed, int partialreject, int sel0, rdp_span_aux* userdata, const rdp_poly_state& object);
+ bool cycle1_blend_acvg_dither(color_t& blended_pixel, int dith, int adseed, int partialreject, int sel0, rdp_span_aux* userdata, const rdp_poly_state& object);
+
+ bool cycle2_noblend_noacvg_nodither(color_t& blended_pixel, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux* userdata, const rdp_poly_state& object);
+ bool cycle2_noblend_noacvg_dither(color_t& blended_pixel, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux* userdata, const rdp_poly_state& object);
+ bool cycle2_noblend_acvg_nodither(color_t& blended_pixel, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux* userdata, const rdp_poly_state& object);
+ bool cycle2_noblend_acvg_dither(color_t& blended_pixel, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux* userdata, const rdp_poly_state& object);
+ bool cycle2_blend_noacvg_nodither(color_t& blended_pixel, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux* userdata, const rdp_poly_state& object);
+ bool cycle2_blend_noacvg_dither(color_t& blended_pixel, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux* userdata, const rdp_poly_state& object);
+ bool cycle2_blend_acvg_nodither(color_t& blended_pixel, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux* userdata, const rdp_poly_state& object);
+ bool cycle2_blend_acvg_dither(color_t& blended_pixel, int dith, int adseed, int partialreject, int sel0, int sel1, rdp_span_aux* userdata, const rdp_poly_state& object);
INT32 dither_alpha(INT32 alpha, INT32 dither);
INT32 dither_color(INT32 color, INT32 dither);
diff --git a/src/mame/video/rdpfiltr.inc b/src/mame/video/rdpfiltr.inc
index c70dfb50e19..31f10f4858a 100644
--- a/src/mame/video/rdpfiltr.inc
+++ b/src/mame/video/rdpfiltr.inc
@@ -1,5 +1,6 @@
// license:BSD-3-Clause
// copyright-holders:Ryan Holtz
+#if 0
INLINE void video_filter16(int *out_r, int *out_g, int *out_b, UINT16* vbuff, UINT8* hbuff, const UINT32 hres);
INLINE void divot_filter16(UINT8* r, UINT8* g, UINT8* b, UINT16* fbuff, UINT32 fbuff_index);
INLINE void restore_filter16(INT32* r, INT32* g, INT32* b, UINT16* fbuff, UINT32 fbuff_index, UINT32 hres);
@@ -613,3 +614,4 @@ INLINE UINT32 ge_two(UINT32 enb)
}
return 0;
}
+#endif
diff --git a/src/mame/video/rdpspn16.c b/src/mame/video/rdpspn16.c
deleted file mode 100644
index d36e14f7733..00000000000
--- a/src/mame/video/rdpspn16.c
+++ /dev/null
@@ -1,808 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Ryan Holtz
-/******************************************************************************
-
-
- SGI/Nintendo Reality Display Processor span-drawing functions
- -------------------
-
- by MooglyGuy
- based on initial C code by Ville Linde
- contains additional improvements from angrylion, Ziggy, Gonetz and Orkin
-
-
-******************************************************************************/
-
-#include "emu.h"
-#include "includes/n64.h"
-#include "video/n64.h"
-
-void n64_rdp::render_spans(INT32 start, INT32 end, INT32 tilenum, bool flip, extent_t* spans, bool rect, rdp_poly_state* object)
-{
- const INT32 clipy1 = m_scissor.m_yh;
- const INT32 clipy2 = m_scissor.m_yl;
- INT32 offset = 0;
-
- if (clipy2 <= 0)
- {
- return;
- }
-
- if (start < clipy1)
- {
- offset = clipy1 - start;
- start = clipy1;
- }
- if (start >= clipy2)
- {
- offset = start - (clipy2 - 1);
- start = clipy2 - 1;
- }
- if (end < clipy1)
- {
- end = clipy1;
- }
- if (end >= clipy2)
- {
- end = clipy2 - 1;
- }
-
- object->m_rdp = this;
- memcpy(&object->m_misc_state, &m_misc_state, sizeof(misc_state_t));
- memcpy(&object->m_other_modes, &m_other_modes, sizeof(other_modes_t));
- memcpy(&object->m_span_base, &m_span_base, sizeof(span_base_t));
- memcpy(&object->m_scissor, &m_scissor, sizeof(rectangle_t));
- memcpy(&object->m_tiles, &m_tiles, 8 * sizeof(n64_tile_t));
- object->tilenum = tilenum;
- object->flip = flip;
- object->m_fill_color = m_fill_color;
- object->rect = rect;
-
- switch(m_other_modes.cycle_type)
- {
- case CYCLE_TYPE_1:
- render_triangle_custom(m_visarea, render_delegate(FUNC(n64_rdp::span_draw_1cycle), this), start, (end - start) + 1, spans + offset);
- break;
-
- case CYCLE_TYPE_2:
- render_triangle_custom(m_visarea, render_delegate(FUNC(n64_rdp::span_draw_2cycle), this), start, (end - start) + 1, spans + offset);
- break;
-
- case CYCLE_TYPE_COPY:
- render_triangle_custom(m_visarea, render_delegate(FUNC(n64_rdp::span_draw_copy), this), start, (end - start) + 1, spans + offset);
- break;
-
- case CYCLE_TYPE_FILL:
- render_triangle_custom(m_visarea, render_delegate(FUNC(n64_rdp::span_draw_fill), this), start, (end - start) + 1, spans + offset);
- break;
- }
- //wait();
-}
-
-void n64_rdp::rgbaz_clip(INT32 sr, INT32 sg, INT32 sb, INT32 sa, INT32* sz, rdp_span_aux* userdata)
-{
- userdata->m_shade_color.i.r = s_special_9bit_clamptable[sr & 0x1ff];
- userdata->m_shade_color.i.g = s_special_9bit_clamptable[sg & 0x1ff];
- userdata->m_shade_color.i.b = s_special_9bit_clamptable[sb & 0x1ff];
- userdata->m_shade_color.i.a = s_special_9bit_clamptable[sa & 0x1ff];
-
- INT32 zanded = (*sz) & 0x60000;
-
- zanded >>= 17;
- switch(zanded)
- {
- case 0: *sz &= 0x3ffff; break;
- case 1: *sz &= 0x3ffff; break;
- case 2: *sz = 0x3ffff; break;
- case 3: *sz = 0x3ffff; break;
- }
-}
-
-void n64_rdp::rgbaz_correct_triangle(INT32 offx, INT32 offy, INT32* r, INT32* g, INT32* b, INT32* a, INT32* z, rdp_span_aux* userdata, const rdp_poly_state &object)
-{
- if (userdata->m_current_pix_cvg == 8)
- {
- *r >>= 2;
- *g >>= 2;
- *b >>= 2;
- *a >>= 2;
- *z = (*z >> 3) & 0x7ffff;
- }
- else
- {
- INT32 summand_xr = offx * SIGN13(object.m_span_base.m_span_dr >> 14);
- INT32 summand_yr = offy * SIGN13(object.m_span_base.m_span_drdy >> 14);
- INT32 summand_xb = offx * SIGN13(object.m_span_base.m_span_db >> 14);
- INT32 summand_yb = offy * SIGN13(object.m_span_base.m_span_dbdy >> 14);
- INT32 summand_xg = offx * SIGN13(object.m_span_base.m_span_dg >> 14);
- INT32 summand_yg = offy * SIGN13(object.m_span_base.m_span_dgdy >> 14);
- INT32 summand_xa = offx * SIGN13(object.m_span_base.m_span_da >> 14);
- INT32 summand_ya = offy * SIGN13(object.m_span_base.m_span_dady >> 14);
-
- INT32 summand_xz = offx * SIGN22(object.m_span_base.m_span_dz >> 10);
- INT32 summand_yz = offy * SIGN22(object.m_span_base.m_span_dzdy >> 10);
-
- *r = ((*r << 2) + summand_xr + summand_yr) >> 4;
- *g = ((*g << 2) + summand_xg + summand_yg) >> 4;
- *b = ((*b << 2) + summand_xb + summand_yb) >> 4;
- *a = ((*a << 2) + summand_xa + summand_ya) >> 4;
- *z = (((*z << 2) + summand_xz + summand_yz) >> 5) & 0x7ffff;
- }
-}
-
-inline void n64_rdp::write_pixel(UINT32 curpixel, INT32 r, INT32 g, INT32 b, rdp_span_aux* userdata, const rdp_poly_state &object)
-{
- if (object.m_misc_state.m_fb_size == 2) // 16-bit framebuffer
- {
- const UINT32 fb = (object.m_misc_state.m_fb_address >> 1) + curpixel;
-
- UINT16 finalcolor;
- if (object.m_other_modes.color_on_cvg && !userdata->m_pre_wrap)
- {
- finalcolor = RREADIDX16(fb) & 0xfffe;
- }
- else
- {
- finalcolor = ((r >> 3) << 11) | ((g >> 3) << 6) | ((b >> 3) << 1);
- }
-
- switch (object.m_other_modes.cvg_dest)
- {
- case 0:
- if (userdata->m_blend_enable)
- {
- UINT32 finalcvg = userdata->m_current_pix_cvg + userdata->m_current_mem_cvg;
- if (finalcvg & 8)
- {
- finalcvg = 7;
- }
- RWRITEIDX16(fb, finalcolor | (finalcvg >> 2));
- HWRITEADDR8(fb, finalcvg & 3);
- }
- else
- {
- const UINT32 finalcvg = (userdata->m_current_pix_cvg - 1) & 7;
- RWRITEIDX16(fb, finalcolor | (finalcvg >> 2));
- HWRITEADDR8(fb, finalcvg & 3);
- }
- break;
- case 1:
- {
- const UINT32 finalcvg = (userdata->m_current_pix_cvg + userdata->m_current_mem_cvg) & 7;
- RWRITEIDX16(fb, finalcolor | (finalcvg >> 2));
- HWRITEADDR8(fb, finalcvg & 3);
- break;
- }
- case 2:
- RWRITEIDX16(fb, finalcolor | 1);
- HWRITEADDR8(fb, 3);
- break;
- case 3:
- RWRITEIDX16(fb, finalcolor | (userdata->m_current_mem_cvg >> 2));
- HWRITEADDR8(fb, userdata->m_current_mem_cvg & 3);
- break;
- }
- }
- else // 32-bit framebuffer
- {
- const UINT32 fb = (object.m_misc_state.m_fb_address >> 2) + curpixel;
-
- UINT32 finalcolor;
- if (object.m_other_modes.color_on_cvg && !userdata->m_pre_wrap)
- {
- finalcolor = RREADIDX32(fb) & 0xffffff00;
- }
- else
- {
- finalcolor = (r << 24) | (g << 16) | (b << 8);
- }
-
- switch (object.m_other_modes.cvg_dest)
- {
- case 0:
- if (userdata->m_blend_enable)
- {
- UINT32 finalcvg = userdata->m_current_pix_cvg + userdata->m_current_mem_cvg;
- if (finalcvg & 8)
- {
- finalcvg = 7;
- }
-
- RWRITEIDX32(fb, finalcolor | (finalcvg << 5));
- }
- else
- {
- RWRITEIDX32(fb, finalcolor | (((userdata->m_current_pix_cvg - 1) & 7) << 5));
- }
- break;
- case 1:
- RWRITEIDX32(fb, finalcolor | (((userdata->m_current_pix_cvg + userdata->m_current_mem_cvg) & 7) << 5));
- break;
- case 2:
- RWRITEIDX32(fb, finalcolor | 0xE0);
- break;
- case 3:
- RWRITEIDX32(fb, finalcolor | (userdata->m_current_mem_cvg << 5));
- break;
- }
- }
-}
-
-inline void n64_rdp::read_pixel(UINT32 curpixel, rdp_span_aux* userdata, const rdp_poly_state &object)
-{
- if (object.m_misc_state.m_fb_size == 2) // 16-bit framebuffer
- {
- UINT16 fword;
-
- if (object.m_other_modes.image_read_en)
- {
- fword = RREADIDX16((object.m_misc_state.m_fb_address >> 1) + curpixel);
- UINT8 hbyte = HREADADDR8((object.m_misc_state.m_fb_address >> 1) + curpixel);
- userdata->m_memory_color.i.a = userdata->m_current_mem_cvg << 5;
- userdata->m_current_mem_cvg = ((fword & 1) << 2) | (hbyte & 3);
- }
- else
- {
- fword = RREADIDX16((object.m_misc_state.m_fb_address >> 1) + curpixel);
- userdata->m_memory_color.i.a = 0xff;
- userdata->m_current_mem_cvg = 7;
- }
-
- userdata->m_memory_color.i.r = GETHICOL(fword);
- userdata->m_memory_color.i.g = GETMEDCOL(fword);
- userdata->m_memory_color.i.b = GETLOWCOL(fword);
- }
- else // 32-bit framebuffer
- {
- UINT32 mem;
-
- if (object.m_other_modes.image_read_en)
- {
- mem = RREADIDX32((object.m_misc_state.m_fb_address >> 2) + curpixel);
- userdata->m_memory_color.i.a = (mem) & 0xff;
- userdata->m_current_mem_cvg = (mem >> 5) & 7;
- }
- else
- {
- mem = RREADIDX32((object.m_misc_state.m_fb_address >> 2) + curpixel);
- userdata->m_memory_color.i.a = 0xff;
- userdata->m_current_mem_cvg = 7;
- }
-
- userdata->m_memory_color.i.r = (mem >> 24) & 0xff;
- userdata->m_memory_color.i.g = (mem >> 16) & 0xff;
- userdata->m_memory_color.i.b = (mem >> 8) & 0xff;
- }
-}
-
-inline void n64_rdp::copy_pixel(UINT32 curpixel, INT32 r, INT32 g, INT32 b, INT32 m_current_pix_cvg, const rdp_poly_state &object)
-{
- if (object.m_misc_state.m_fb_size == 2) // 16-bit framebuffer
- {
- RWRITEIDX16((object.m_misc_state.m_fb_address >> 1) + curpixel, ((r >> 3) << 11) | ((g >> 3) << 6) | ((b >> 3) << 1) | ((m_current_pix_cvg >> 2) & 1));
- HWRITEADDR8((object.m_misc_state.m_fb_address >> 1) + curpixel, m_current_pix_cvg & 3);
- }
- else // 32-bit framebuffer
- {
- RWRITEIDX32((object.m_misc_state.m_fb_address >> 2) + curpixel, (r << 24) | (g << 16) | (b << 8) | (m_current_pix_cvg << 5));
- }
-}
-
-inline void n64_rdp::fill_pixel(UINT32 curpixel, const rdp_poly_state &object)
-{
- if (object.m_misc_state.m_fb_size == 2) // 16-bit framebuffer
- {
- UINT16 val;
- if (curpixel & 1)
- {
- val = object.m_fill_color & 0xffff;
- }
- else
- {
- val = (object.m_fill_color >> 16) & 0xffff;
- }
- RWRITEIDX16((object.m_misc_state.m_fb_address >> 1) + curpixel, val);
- HWRITEADDR8((object.m_misc_state.m_fb_address >> 1) + curpixel, ((val & 1) << 1) | (val & 1));
- }
- else // 32-bit framebuffer
- {
- RWRITEIDX32((object.m_misc_state.m_fb_address >> 2) + curpixel, object.m_fill_color);
- HWRITEADDR8((object.m_misc_state.m_fb_address >> 1) + (curpixel << 1), (object.m_fill_color & 0x10000) ? 3 : 0);
- HWRITEADDR8((object.m_misc_state.m_fb_address >> 1) + (curpixel << 1) + 1, (object.m_fill_color & 0x1) ? 3 : 0);
- }
-}
-
-void n64_rdp::span_draw_1cycle(INT32 scanline, const extent_t &extent, const rdp_poly_state &object, INT32 threadid)
-{
- assert(object.m_misc_state.m_fb_size >= 2 && object.m_misc_state.m_fb_size < 4);
-
- const INT32 clipx1 = object.m_scissor.m_xh;
- const INT32 clipx2 = object.m_scissor.m_xl;
- const INT32 tilenum = object.tilenum;
- const bool flip = object.flip;
-
- SpanParam r; r.w = extent.param[SPAN_R].start;
- SpanParam g; g.w = extent.param[SPAN_G].start;
- SpanParam b; b.w = extent.param[SPAN_B].start;
- SpanParam a; a.w = extent.param[SPAN_A].start;
- SpanParam z; z.w = extent.param[SPAN_Z].start;
- SpanParam s; s.w = extent.param[SPAN_S].start;
- SpanParam t; t.w = extent.param[SPAN_T].start;
- SpanParam w; w.w = extent.param[SPAN_W].start;
-
- const UINT32 zb = object.m_misc_state.m_zb_address >> 1;
- const UINT32 zhb = object.m_misc_state.m_zb_address;
-
-#ifdef PTR64
- assert(extent.userdata != (const void *)0xcccccccccccccccc);
-#else
- assert(extent.userdata != (const void *)0xcccccccc);
-#endif
- rdp_span_aux* userdata = (rdp_span_aux*)extent.userdata;
-
- m_tex_pipe.calculate_clamp_diffs(tilenum, userdata, object);
-
- const bool partialreject = (userdata->m_color_inputs.blender2b_a[0] == &userdata->m_inv_pixel_color.i.a && userdata->m_color_inputs.blender1b_a[0] == &userdata->m_pixel_color.i.a);
- const INT32 sel0 = (userdata->m_color_inputs.blender2b_a[0] == &userdata->m_memory_color.i.a) ? 1 : 0;
-
- INT32 drinc, dginc, dbinc, dainc;
- INT32 dzinc, dzpix;
- INT32 dsinc, dtinc, dwinc;
- INT32 xinc;
-
- if (!flip)
- {
- drinc = -object.m_span_base.m_span_dr;
- dginc = -object.m_span_base.m_span_dg;
- dbinc = -object.m_span_base.m_span_db;
- dainc = -object.m_span_base.m_span_da;
- dzinc = -object.m_span_base.m_span_dz;
- dsinc = -object.m_span_base.m_span_ds;
- dtinc = -object.m_span_base.m_span_dt;
- dwinc = -object.m_span_base.m_span_dw;
- xinc = -1;
- }
- else
- {
- drinc = object.m_span_base.m_span_dr;
- dginc = object.m_span_base.m_span_dg;
- dbinc = object.m_span_base.m_span_db;
- dainc = object.m_span_base.m_span_da;
- dzinc = object.m_span_base.m_span_dz;
- dsinc = object.m_span_base.m_span_ds;
- dtinc = object.m_span_base.m_span_dt;
- dwinc = object.m_span_base.m_span_dw;
- xinc = 1;
- }
-
- const INT32 fb_index = object.m_misc_state.m_fb_width * scanline;
-
- const INT32 xstart = extent.startx;
- const INT32 xend = userdata->m_unscissored_rx;
- const INT32 xend_scissored = extent.stopx;
-
- INT32 x = xend;
-
- const INT32 length = flip ? (xstart - xend) : (xend - xstart);
- INT32 fir, fig, fib;
-
- if(object.m_other_modes.z_source_sel)
- {
- z.w = object.m_misc_state.m_primitive_z;
- dzpix = object.m_misc_state.m_primitive_dz;
- dzinc = 0;
- }
- else
- {
- dzpix = object.m_span_base.m_span_dzpix;
- }
-
- if (object.m_misc_state.m_fb_size < 2 || object.m_misc_state.m_fb_size > 4)
- fatalerror("unsupported m_fb_size %d\n", object.m_misc_state.m_fb_size);
-
- const INT32 blend_index = (object.m_other_modes.alpha_cvg_select ? 2 : 0) | ((object.m_other_modes.rgb_dither_sel < 3) ? 1 : 0);
- const INT32 cycle0 = ((object.m_other_modes.sample_type & 1) << 1) | (object.m_other_modes.bi_lerp0 & 1);
-
- INT32 sss = 0;
- INT32 sst = 0;
-
- if (object.m_other_modes.persp_tex_en)
- {
- tc_div(s.w >> 16, t.w >> 16, w.w >> 16, &sss, &sst);
- }
- else
- {
- tc_div_no_perspective(s.w >> 16, t.w >> 16, w.w >> 16, &sss, &sst);
- }
-
- userdata->m_start_span = true;
- for (INT32 j = 0; j <= length; j++)
- {
- INT32 sr = r.w >> 14;
- INT32 sg = g.w >> 14;
- INT32 sb = b.w >> 14;
- INT32 sa = a.w >> 14;
- INT32 sz = (z.w >> 10) & 0x3fffff;
- const bool valid_x = (flip) ? (x >= xend_scissored) : (x <= xend_scissored);
-
- if (x >= clipx1 && x < clipx2 && valid_x)
- {
- UINT8 offx, offy;
- lookup_cvmask_derivatives(userdata->m_cvg[x], &offx, &offy, userdata);
-
- m_tex_pipe.lod_1cycle(&sss, &sst, s.w, t.w, w.w, dsinc, dtinc, dwinc, userdata, object);
-
- rgbaz_correct_triangle(offx, offy, &sr, &sg, &sb, &sa, &sz, userdata, object);
- rgbaz_clip(sr, sg, sb, sa, &sz, userdata);
-
- ((m_tex_pipe).*(m_tex_pipe.m_cycle[cycle0]))(&userdata->m_texel0_color, &userdata->m_texel0_color, sss, sst, tilenum, 0, userdata, object);
- //m_tex_pipe.Cycle(&userdata->m_texel0_color, &userdata->m_texel0_color, sss, sst, tilenum, 0, userdata, object);
-
- userdata->m_noise_color.i.r = userdata->m_noise_color.i.g = userdata->m_noise_color.i.b = rand() << 3; // Not accurate
-
- userdata->m_pixel_color.i.r = color_combiner_equation(*userdata->m_color_inputs.combiner_rgbsub_a_r[1],*userdata->m_color_inputs.combiner_rgbsub_b_r[1],*userdata->m_color_inputs.combiner_rgbmul_r[1],*userdata->m_color_inputs.combiner_rgbadd_r[1]);
- userdata->m_pixel_color.i.g = color_combiner_equation(*userdata->m_color_inputs.combiner_rgbsub_a_g[1],*userdata->m_color_inputs.combiner_rgbsub_b_g[1],*userdata->m_color_inputs.combiner_rgbmul_g[1],*userdata->m_color_inputs.combiner_rgbadd_g[1]);
- userdata->m_pixel_color.i.b = color_combiner_equation(*userdata->m_color_inputs.combiner_rgbsub_a_b[1],*userdata->m_color_inputs.combiner_rgbsub_b_b[1],*userdata->m_color_inputs.combiner_rgbmul_b[1],*userdata->m_color_inputs.combiner_rgbadd_b[1]);
- userdata->m_pixel_color.i.a = alpha_combiner_equation(*userdata->m_color_inputs.combiner_alphasub_a[1],*userdata->m_color_inputs.combiner_alphasub_b[1],*userdata->m_color_inputs.combiner_alphamul[1],*userdata->m_color_inputs.combiner_alphaadd[1]);
-
- //Alpha coverage combiner
- get_alpha_cvg(&userdata->m_pixel_color.i.a, userdata, object);
-
- const UINT32 curpixel = fb_index + x;
- const UINT32 zbcur = zb + curpixel;
- const UINT32 zhbcur = zhb + curpixel;
-
- read_pixel(curpixel, userdata, object);
-
- if(z_compare(zbcur, zhbcur, sz, dzpix, userdata, object))
- {
- INT32 cdith = 0;
- INT32 adith = 0;
- get_dither_values(scanline, j, &cdith, &adith, object);
-
- if (((userdata->m_blend_enable << 2) | blend_index) != 5 && machine().input().code_pressed(KEYCODE_B))
- {
- printf("1:%d\n", (userdata->m_blend_enable << 2) | blend_index);
- }
- bool rendered = ((&m_blender)->*(m_blender.blend1[(userdata->m_blend_enable << 2) | blend_index]))(&fir, &fig, &fib, cdith, adith, partialreject, sel0, userdata, object);
-
- if (rendered)
- {
- write_pixel(curpixel, fir, fig, fib, userdata, object);
- if (object.m_other_modes.z_update_en)
- {
- z_store(object, zbcur, zhbcur, sz, userdata->m_dzpix_enc);
- }
- }
- }
-
- sss = userdata->m_precomp_s;
- sst = userdata->m_precomp_t;
- }
-
- r.w += drinc;
- g.w += dginc;
- b.w += dbinc;
- a.w += dainc;
- s.w += dsinc;
- t.w += dtinc;
- w.w += dwinc;
- z.w += dzinc;
-
- x += xinc;
- }
-}
-
-void n64_rdp::span_draw_2cycle(INT32 scanline, const extent_t &extent, const rdp_poly_state &object, INT32 threadid)
-{
- assert(object.m_misc_state.m_fb_size >= 2 && object.m_misc_state.m_fb_size < 4);
-
- const INT32 clipx1 = object.m_scissor.m_xh;
- const INT32 clipx2 = object.m_scissor.m_xl;
- const INT32 tilenum = object.tilenum;
- const bool flip = object.flip;
-
- SpanParam r; r.w = extent.param[SPAN_R].start;
- SpanParam g; g.w = extent.param[SPAN_G].start;
- SpanParam b; b.w = extent.param[SPAN_B].start;
- SpanParam a; a.w = extent.param[SPAN_A].start;
- SpanParam z; z.w = extent.param[SPAN_Z].start;
- SpanParam s; s.w = extent.param[SPAN_S].start;
- SpanParam t; t.w = extent.param[SPAN_T].start;
- SpanParam w; w.w = extent.param[SPAN_W].start;
-
- const UINT32 zb = object.m_misc_state.m_zb_address >> 1;
- const UINT32 zhb = object.m_misc_state.m_zb_address;
-
- INT32 tile2 = (tilenum + 1) & 7;
- INT32 tile1 = tilenum;
- const UINT32 prim_tile = tilenum;
-
- INT32 newtile1 = tile1;
- INT32 news = 0;
- INT32 newt = 0;
-
-#ifdef PTR64
- assert(extent.userdata != (const void *)0xcccccccccccccccc);
-#else
- assert(extent.userdata != (const void *)0xcccccccc);
-#endif
- rdp_span_aux* userdata = (rdp_span_aux*)extent.userdata;
-
- m_tex_pipe.calculate_clamp_diffs(tile1, userdata, object);
-
- bool partialreject = (userdata->m_color_inputs.blender2b_a[1] == &userdata->m_inv_pixel_color.i.a && userdata->m_color_inputs.blender1b_a[1] == &userdata->m_pixel_color.i.a);
- INT32 sel0 = (userdata->m_color_inputs.blender2b_a[0] == &userdata->m_memory_color.i.a) ? 1 : 0;
- INT32 sel1 = (userdata->m_color_inputs.blender2b_a[1] == &userdata->m_memory_color.i.a) ? 1 : 0;
-
- INT32 drinc, dginc, dbinc, dainc;
- INT32 dzinc, dzpix;
- INT32 dsinc, dtinc, dwinc;
- INT32 xinc;
-
- if (!flip)
- {
- drinc = -object.m_span_base.m_span_dr;
- dginc = -object.m_span_base.m_span_dg;
- dbinc = -object.m_span_base.m_span_db;
- dainc = -object.m_span_base.m_span_da;
- dzinc = -object.m_span_base.m_span_dz;
- dsinc = -object.m_span_base.m_span_ds;
- dtinc = -object.m_span_base.m_span_dt;
- dwinc = -object.m_span_base.m_span_dw;
- xinc = -1;
- }
- else
- {
- drinc = object.m_span_base.m_span_dr;
- dginc = object.m_span_base.m_span_dg;
- dbinc = object.m_span_base.m_span_db;
- dainc = object.m_span_base.m_span_da;
- dzinc = object.m_span_base.m_span_dz;
- dsinc = object.m_span_base.m_span_ds;
- dtinc = object.m_span_base.m_span_dt;
- dwinc = object.m_span_base.m_span_dw;
- xinc = 1;
- }
-
- const INT32 fb_index = object.m_misc_state.m_fb_width * scanline;
-
- INT32 cdith = 0;
- INT32 adith = 0;
-
- const INT32 xstart = extent.startx;
- const INT32 xend = userdata->m_unscissored_rx;
- const INT32 xend_scissored = extent.stopx;
-
- INT32 x = xend;
-
- const INT32 length = flip ? (xstart - xend) : (xend - xstart);
- INT32 fir, fig, fib;
-
- if(object.m_other_modes.z_source_sel)
- {
- z.w = object.m_misc_state.m_primitive_z;
- dzpix = object.m_misc_state.m_primitive_dz;
- dzinc = 0;
- }
- else
- {
- dzpix = object.m_span_base.m_span_dzpix;
- }
-
- if (object.m_misc_state.m_fb_size < 2 || object.m_misc_state.m_fb_size > 4)
- fatalerror("unsupported m_fb_size %d\n", object.m_misc_state.m_fb_size);
-
- const INT32 blend_index = (object.m_other_modes.alpha_cvg_select ? 2 : 0) | ((object.m_other_modes.rgb_dither_sel < 3) ? 1 : 0);
- const INT32 cycle0 = ((object.m_other_modes.sample_type & 1) << 1) | (object.m_other_modes.bi_lerp0 & 1);
- const INT32 cycle1 = ((object.m_other_modes.sample_type & 1) << 1) | (object.m_other_modes.bi_lerp1 & 1);
-
- INT32 sss = 0;
- INT32 sst = 0;
-
- if (object.m_other_modes.persp_tex_en)
- {
- tc_div(s.w >> 16, t.w >> 16, w.w >> 16, &sss, &sst);
- }
- else
- {
- tc_div_no_perspective(s.w >> 16, t.w >> 16, w.w >> 16, &sss, &sst);
- }
-
- userdata->m_start_span = true;
- for (INT32 j = 0; j <= length; j++)
- {
- INT32 sr = r.w >> 14;
- INT32 sg = g.w >> 14;
- INT32 sb = b.w >> 14;
- INT32 sa = a.w >> 14;
- INT32 sz = (z.w >> 10) & 0x3fffff;
- color_t c1;
- color_t c2;
-
- const bool valid_x = (flip) ? (x >= xend_scissored) : (x <= xend_scissored);
-
- if (x >= clipx1 && x < clipx2 && valid_x)
- {
- const UINT32 compidx = m_compressed_cvmasks[userdata->m_cvg[x]];
- userdata->m_current_pix_cvg = cvarray[compidx].cvg;
- userdata->m_current_cvg_bit = cvarray[compidx].cvbit;
- const UINT8 offx = cvarray[compidx].xoff;
- const UINT8 offy = cvarray[compidx].yoff;
- //lookup_cvmask_derivatives(userdata->m_cvg[x], &offx, &offy, userdata);
-
- m_tex_pipe.lod_2cycle(&sss, &sst, s.w, t.w, w.w, dsinc, dtinc, dwinc, prim_tile, &tile1, &tile2, userdata, object);
-
- news = userdata->m_precomp_s;
- newt = userdata->m_precomp_t;
- m_tex_pipe.lod_2cycle_limited(&news, &newt, s.w + dsinc, t.w + dtinc, w.w + dwinc, dsinc, dtinc, dwinc, prim_tile, &newtile1, object);
-
- rgbaz_correct_triangle(offx, offy, &sr, &sg, &sb, &sa, &sz, userdata, object);
- rgbaz_clip(sr, sg, sb, sa, &sz, userdata);
-
- ((m_tex_pipe).*(m_tex_pipe.m_cycle[cycle0]))(&userdata->m_texel0_color, &userdata->m_texel0_color, sss, sst, tile1, 0, userdata, object);
- ((m_tex_pipe).*(m_tex_pipe.m_cycle[cycle1]))(&userdata->m_texel1_color, &userdata->m_texel0_color, sss, sst, tile2, 1, userdata, object);
- ((m_tex_pipe).*(m_tex_pipe.m_cycle[cycle1]))(&userdata->m_next_texel_color, &userdata->m_next_texel_color, sss, sst, tile2, 1, userdata, object);
-
- userdata->m_noise_color.i.r = userdata->m_noise_color.i.g = userdata->m_noise_color.i.b = rand() << 3; // Not accurate
- userdata->m_combined_color.i.r = color_combiner_equation(*userdata->m_color_inputs.combiner_rgbsub_a_r[0],
- *userdata->m_color_inputs.combiner_rgbsub_b_r[0],
- *userdata->m_color_inputs.combiner_rgbmul_r[0],
- *userdata->m_color_inputs.combiner_rgbadd_r[0]);
- userdata->m_combined_color.i.g = color_combiner_equation(*userdata->m_color_inputs.combiner_rgbsub_a_g[0],
- *userdata->m_color_inputs.combiner_rgbsub_b_g[0],
- *userdata->m_color_inputs.combiner_rgbmul_g[0],
- *userdata->m_color_inputs.combiner_rgbadd_g[0]);
- userdata->m_combined_color.i.b = color_combiner_equation(*userdata->m_color_inputs.combiner_rgbsub_a_b[0],
- *userdata->m_color_inputs.combiner_rgbsub_b_b[0],
- *userdata->m_color_inputs.combiner_rgbmul_b[0],
- *userdata->m_color_inputs.combiner_rgbadd_b[0]);
- userdata->m_combined_color.i.a = alpha_combiner_equation(*userdata->m_color_inputs.combiner_alphasub_a[0],
- *userdata->m_color_inputs.combiner_alphasub_b[0],
- *userdata->m_color_inputs.combiner_alphamul[0],
- *userdata->m_color_inputs.combiner_alphaadd[0]);
-
- userdata->m_texel0_color = userdata->m_texel1_color;
- userdata->m_texel1_color = userdata->m_next_texel_color;
-
- userdata->m_pixel_color.i.r = color_combiner_equation(*userdata->m_color_inputs.combiner_rgbsub_a_r[1],
- *userdata->m_color_inputs.combiner_rgbsub_b_r[1],
- *userdata->m_color_inputs.combiner_rgbmul_r[1],
- *userdata->m_color_inputs.combiner_rgbadd_r[1]);
- userdata->m_pixel_color.i.g = color_combiner_equation(*userdata->m_color_inputs.combiner_rgbsub_a_g[1],
- *userdata->m_color_inputs.combiner_rgbsub_b_g[1],
- *userdata->m_color_inputs.combiner_rgbmul_g[1],
- *userdata->m_color_inputs.combiner_rgbadd_g[1]);
- userdata->m_pixel_color.i.b = color_combiner_equation(*userdata->m_color_inputs.combiner_rgbsub_a_b[1],
- *userdata->m_color_inputs.combiner_rgbsub_b_b[1],
- *userdata->m_color_inputs.combiner_rgbmul_b[1],
- *userdata->m_color_inputs.combiner_rgbadd_b[1]);
- userdata->m_pixel_color.i.a = alpha_combiner_equation(*userdata->m_color_inputs.combiner_alphasub_a[1],
- *userdata->m_color_inputs.combiner_alphasub_b[1],
- *userdata->m_color_inputs.combiner_alphamul[1],
- *userdata->m_color_inputs.combiner_alphaadd[1]);
-
- //Alpha coverage combiner
- get_alpha_cvg(&userdata->m_pixel_color.i.a, userdata, object);
-
- const UINT32 curpixel = fb_index + x;
- const UINT32 zbcur = zb + curpixel;
- const UINT32 zhbcur = zhb + curpixel;
-
- read_pixel(curpixel, userdata, object);
-
- if(z_compare(zbcur, zhbcur, sz, dzpix, userdata, object))
- {
- get_dither_values(scanline, j, &cdith, &adith, object);
-
- if (((userdata->m_blend_enable << 2) | blend_index) != 5 && machine().input().code_pressed(KEYCODE_B))
- {
- printf("2:%d\n", (userdata->m_blend_enable << 2) | blend_index);
- }
- bool rendered = ((&m_blender)->*(m_blender.blend2[(userdata->m_blend_enable << 2) | blend_index]))(&fir, &fig, &fib, cdith, adith, partialreject, sel0, sel1, userdata, object);
-
- if (rendered)
- {
- write_pixel(curpixel, fir, fig, fib, userdata, object);
- if (object.m_other_modes.z_update_en)
- {
- z_store(object, zbcur, zhbcur, sz, userdata->m_dzpix_enc);
- }
- }
- }
- sss = userdata->m_precomp_s;
- sst = userdata->m_precomp_t;
- }
-
- r.w += drinc;
- g.w += dginc;
- b.w += dbinc;
- a.w += dainc;
- s.w += dsinc;
- t.w += dtinc;
- w.w += dwinc;
- z.w += dzinc;
-
- x += xinc;
- }
-}
-
-void n64_rdp::span_draw_copy(INT32 scanline, const extent_t &extent, const rdp_poly_state &object, INT32 threadid)
-{
- const INT32 clipx1 = object.m_scissor.m_xh;
- const INT32 clipx2 = object.m_scissor.m_xl;
- const INT32 tilenum = object.tilenum;
- const bool flip = object.flip;
-
- rdp_span_aux* userdata = (rdp_span_aux*)extent.userdata;
- const INT32 xstart = extent.startx;
- const INT32 xend = userdata->m_unscissored_rx;
- const INT32 xend_scissored = extent.stopx;
- const INT32 xinc = flip ? 1 : -1;
- const INT32 length = flip ? (xstart - xend) : (xend - xstart);
-
- SpanParam s; s.w = extent.param[SPAN_S].start;
- SpanParam t; t.w = extent.param[SPAN_T].start;
-
- const INT32 ds = object.m_span_base.m_span_ds / 4;
- const INT32 dt = object.m_span_base.m_span_dt / 4;
- const INT32 dsinc = flip ? (ds) : -ds;
- const INT32 dtinc = flip ? (dt) : -dt;
-
- const INT32 fb_index = object.m_misc_state.m_fb_width * scanline;
-
- INT32 x = xend;
-
- for (INT32 j = 0; j <= length; j++)
- {
- const bool valid_x = (flip) ? (x >= xend_scissored) : (x <= xend_scissored);
-
- if (x >= clipx1 && x < clipx2 && valid_x)
- {
- INT32 sss = s.h.h;
- INT32 sst = t.h.h;
- m_tex_pipe.copy(&userdata->m_texel0_color, sss, sst, tilenum, object, userdata);
-
- UINT32 curpixel = fb_index + x;
- if ((userdata->m_texel0_color.i.a != 0) || (!object.m_other_modes.alpha_compare_en))
- {
- copy_pixel(curpixel, userdata->m_texel0_color.i.r, userdata->m_texel0_color.i.g, userdata->m_texel0_color.i.b, userdata->m_texel0_color.i.a ? 7 : 0, object);
- }
- }
-
- s.w += dsinc;
- t.w += dtinc;
- x += xinc;
- }
-}
-
-void n64_rdp::span_draw_fill(INT32 scanline, const extent_t &extent, const rdp_poly_state &object, INT32 threadid)
-{
- assert(object.m_misc_state.m_fb_size >= 2 && object.m_misc_state.m_fb_size < 4);
-
- const bool flip = object.flip;
-
- const INT32 clipx1 = object.m_scissor.m_xh;
- const INT32 clipx2 = object.m_scissor.m_xl;
-
- const INT32 xinc = flip ? 1 : -1;
-
- const INT32 fb_index = object.m_misc_state.m_fb_width * scanline;
-
- const INT32 xstart = extent.startx;
- const INT32 xend_scissored = extent.stopx;
-
- INT32 x = xend_scissored;
-
- const INT32 length = flip ? (xstart - xend_scissored) : (xend_scissored - xstart);
-
- for (INT32 j = 0; j <= length; j++)
- {
- if (x >= clipx1 && x < clipx2)
- {
- fill_pixel(fb_index + x, object);
- }
-
- x += xinc;
- }
-}
diff --git a/src/mame/video/rdptpipe.c b/src/mame/video/rdptpipe.c
index e4b04bb6a42..d574cd13133 100644
--- a/src/mame/video/rdptpipe.c
+++ b/src/mame/video/rdptpipe.c
@@ -15,7 +15,9 @@
#include "emu.h"
#include "includes/n64.h"
+#include "video/rdptpipe.h"
#include "video/n64.h"
+#include "video/rgbutil.h"
#define RELATIVE(x, y) ((((x) >> 3) - (y)) << 3) | (x & 7);
@@ -27,12 +29,7 @@ void n64_texture_pipe_t::set_machine(running_machine &machine)
for(INT32 i = 0; i < 0x10000; i++)
{
- color_t c;
- c.i.r = m_rdp->m_replicated_rgba[(i >> 11) & 0x1f];
- c.i.g = m_rdp->m_replicated_rgba[(i >> 6) & 0x1f];
- c.i.b = m_rdp->m_replicated_rgba[(i >> 1) & 0x1f];
- c.i.a = (i & 1) ? 0xff : 0x00;
- m_expand_16to32_table[i] = c.c;
+ m_expand_16to32_table[i] = color_t((i & 1) ? 0xff : 0x00, m_rdp->m_replicated_rgba[(i >> 11) & 0x1f], m_rdp->m_replicated_rgba[(i >> 6) & 0x1f], m_rdp->m_replicated_rgba[(i >> 1) & 0x1f]);
}
for(UINT32 i = 0; i < 0x80000; i++)
@@ -61,413 +58,310 @@ void n64_texture_pipe_t::set_machine(running_machine &machine)
}
}
}
-}
-void n64_texture_pipe_t::mask(INT32* S, INT32* T, const n64_tile_t& tile)
-{
- if (tile.mask_s)
- {
- INT32 wrap = *S >> tile.wrapped_mask_s;
- wrap &= 1;
- if (tile.ms && wrap)
- {
- *S = (~(*S));
- }
- *S &= m_maskbits_table[tile.mask_s];
- }
-
- if (tile.mask_t)
- {
- INT32 wrap = *T >> tile.wrapped_mask_t;
- wrap &= 1;
- if (tile.mt && wrap)
- {
- *T = (~(*T));
- }
- *T &= m_maskbits_table[tile.mask_t];
- }
+ m_st2_add.set(1, 0, 1, 0);
+ m_v1.set(1, 1, 1, 1);
}
-void n64_texture_pipe_t::mask_coupled(INT32* S, INT32* S1, INT32* T, INT32* T1, const n64_tile_t& tile)
+void n64_texture_pipe_t::mask(rgbaint_t& sstt, const n64_tile_t& tile)
{
- if (tile.mask_s)
- {
- const INT32 maskbits_s = m_maskbits_table[tile.mask_s];
- if (tile.ms)
- {
- const INT32 swrapthreshold = tile.mask_s > 10 ? 10 : tile.mask_s;
- const INT32 wrap = (*S >> swrapthreshold) & 1;
- const INT32 wrap1 = (*S1 >> swrapthreshold) & 1;
- if (wrap)
- {
- *S = (~(*S));
- }
- if (wrap1)
- {
- *S1 = (~(*S1));
- }
- }
- *S &= maskbits_s;
- *S1 &= maskbits_s;
- }
-
- if (tile.mask_t)
- {
- const INT32 maskbits_t = m_maskbits_table[tile.mask_t];
- if (tile.mt)
- {
- const INT32 twrapthreshold = tile.mask_t > 10 ? 10 : tile.mask_t;
- const INT32 wrap = (*T >> twrapthreshold) & 1;
- const INT32 wrap1 = (*T1 >> twrapthreshold) & 1;
- if (wrap)
- {
- *T = (~(*T));
- }
- if (wrap1)
- {
- *T1 = (~(*T1));
- }
- }
- *T &= maskbits_t;
- *T1 &= maskbits_t;
- }
+ UINT32 s_mask_bits = m_maskbits_table[tile.mask_s];
+ UINT32 t_mask_bits = m_maskbits_table[tile.mask_t];
+ rgbaint_t maskbits(s_mask_bits, s_mask_bits, t_mask_bits, t_mask_bits);
+
+ rgbaint_t do_wrap(sstt);
+ do_wrap.sra(tile.wrapped_mask);
+ do_wrap.and_reg(m_v1);
+ do_wrap.cmpeq(m_v1);
+ do_wrap.and_reg(tile.mm);
+
+ rgbaint_t wrapped(sstt);
+ wrapped.xor_reg(do_wrap);
+ wrapped.and_reg(maskbits);
+ wrapped.and_reg(tile.mask);
+ sstt.and_reg(tile.invmask);
+ sstt.or_reg(wrapped);
}
-void n64_texture_pipe_t::shift_cycle(INT32* S, INT32* T, bool* maxs, bool* maxt, const n64_tile_t& tile)
+rgbaint_t n64_texture_pipe_t::shift_cycle(rgbaint_t& st, const n64_tile_t& tile)
{
- INT32 sss = (INT32)(INT16)*S;
- sss >>= tile.rshift_s;
- sss <<= tile.lshift_s;
- sss = (INT32)(INT16)sss;
- *maxs = ((sss >> 3) >= tile.sh);
- *S = (((sss >> 3) - tile.sl) << 3) | (sss & 7);
-
- INT32 sst = (INT32)(INT16)*T;
- sst >>= tile.rshift_t;
- sst <<= tile.lshift_t;
- *T = (INT32)(INT16)sst;
- *maxt = ((*T >> 3) >= tile.th);
- *T = (((sst >> 3) - tile.tl) << 3) | (sst & 7);
+ st.sign_extend(0x00008000, 0xffff8000);
+ st.sra(tile.rshift);
+ st.shl(tile.lshift);
+
+ rgbaint_t maxst(st);
+ maxst.sra_imm(3);
+ rgbaint_t maxst_eq(maxst);
+ maxst.cmpgt(tile.sth);
+ maxst_eq.cmpeq(tile.sth);
+ maxst.or_reg(maxst_eq);
+
+ rgbaint_t stlsb(st);
+ stlsb.and_imm(7);
+
+ st.sra_imm(3);
+ st.sub(tile.stl);
+ st.shl_imm(3);
+ st.or_reg(stlsb);
+
+ return maxst;
}
-void n64_texture_pipe_t::shift_copy(INT32* S, INT32* T, const n64_tile_t& tile)
+inline void n64_texture_pipe_t::shift_copy(rgbaint_t& st, const n64_tile_t& tile)
{
- INT32 sss = (INT32)(INT16)*S;
- sss >>= tile.rshift_s;
- sss <<= tile.lshift_s;
- *S = (INT32)(INT16)sss;
-
- INT32 sst = (INT32)(INT16)*T;
- sst >>= tile.rshift_t;
- sst <<= tile.lshift_t;
- *T = (INT32)(INT16)sst;
+ st.shr(tile.rshift);
+ st.shl(tile.lshift);
}
-void n64_texture_pipe_t::clamp_cycle(INT32* S, INT32* T, INT32* SFRAC, INT32* TFRAC, const bool maxs, const bool maxt, const INT32 tilenum, const n64_tile_t& tile, rdp_span_aux* userdata)
+void n64_texture_pipe_t::clamp_cycle(rgbaint_t& st, rgbaint_t& stfrac, rgbaint_t& maxst, const INT32 tilenum, const n64_tile_t& tile, rdp_span_aux* userdata)
{
- if (tile.clamp_s)
- {
- if (*S & 0x10000)
- {
- *S = 0;
- *SFRAC = 0;
- }
- else if (maxs)
- {
- *S = userdata->m_clamp_s_diff[tilenum];
- *SFRAC = 0;
- }
- else
- {
- *S = (SIGN17(*S) >> 5) & 0x1fff;
- }
- }
- else
- {
- *S = (SIGN17(*S) >> 5) & 0x1fff;
- }
-
- if (tile.clamp_t)
- {
- if (*T & 0x10000)
- {
- *T = 0;
- *TFRAC = 0;
- }
- else if (maxt)
- {
- *T = userdata->m_clamp_t_diff[tilenum];
- *TFRAC = 0;
- }
- else
- {
- *T = (SIGN17(*T) >> 5) & 0x1fff;
- }
- }
- else
- {
- *T = (SIGN17(*T) >> 5) & 0x1fff;
- }
+ rgbaint_t not_clamp(tile.clamp_st);
+ not_clamp.xor_imm(0xffffffff);
+
+ rgbaint_t highbit_mask(0x10000, 0x10000, 0x10000, 0x10000);
+ rgbaint_t highbit(st);
+ highbit.and_reg(highbit_mask);
+ highbit.cmpeq(highbit_mask);
+
+ rgbaint_t not_highbit(highbit);
+ not_highbit.xor_imm(0xffffffff);
+
+ rgbaint_t not_maxst(maxst);
+ not_maxst.xor_imm(0xffffffff);
+ not_maxst.and_reg(not_highbit);
+ not_maxst.or_reg(not_clamp);
+
+ rgbaint_t shifted_st(st);
+ shifted_st.sign_extend(0x00010000, 0xffff0000);
+ shifted_st.shr_imm(5);
+ shifted_st.and_imm(0x1fff);
+ shifted_st.and_reg(not_maxst);
+ stfrac.and_reg(not_maxst);
+
+ rgbaint_t clamp_diff(userdata->m_clamp_diff[tilenum]);
+ clamp_diff.and_reg(tile.clamp_st);
+ clamp_diff.and_reg(maxst);
+
+ st.set(shifted_st);
+ st.or_reg(clamp_diff);
}
-void n64_texture_pipe_t::clamp_cycle_light(INT32* S, INT32* T, const bool maxs, const bool maxt, const INT32 tilenum, const n64_tile_t& tile, rdp_span_aux* userdata)
+void n64_texture_pipe_t::clamp_cycle_light(rgbaint_t& st, rgbaint_t& maxst, const INT32 tilenum, const n64_tile_t& tile, rdp_span_aux* userdata)
{
- if (tile.clamp_s)
- {
- if (*S & 0x10000)
- {
- *S = 0;
- }
- else if (maxs)
- {
- *S = userdata->m_clamp_s_diff[tilenum];
- }
- else
- {
- *S = (SIGN17(*S) >> 5) & 0x1fff;
- }
- }
- else
- {
- *S = (SIGN17(*S) >> 5) & 0x1fff;
- }
-
- if (tile.clamp_t)
- {
- if (*T & 0x10000)
- {
- *T = 0;
- }
- else if (maxt)
- {
- *T = userdata->m_clamp_t_diff[tilenum];
- }
- else
- {
- *T = (SIGN17(*T) >> 5) & 0x1fff;
- }
- }
- else
- {
- *T = (SIGN17(*T) >> 5) & 0x1fff;
- }
+ rgbaint_t not_clamp(tile.clamp_st);
+ not_clamp.xor_imm(0xffffffff);
+
+ rgbaint_t highbit_mask(0x10000, 0x10000, 0x10000, 0x10000);
+ rgbaint_t highbit(st);
+ highbit.and_reg(highbit_mask);
+ highbit.cmpeq(highbit_mask);
+
+ rgbaint_t not_highbit(highbit);
+ not_highbit.xor_imm(0xffffffff);
+
+ rgbaint_t not_maxst(maxst);
+ not_maxst.xor_imm(0xffffffff);
+ not_maxst.and_reg(not_highbit);
+ not_maxst.or_reg(not_clamp);
+
+ rgbaint_t shifted_st(st);
+ shifted_st.sign_extend(0x00010000, 0xffff0000);
+ shifted_st.shr_imm(5);
+ shifted_st.and_imm(0x1fff);
+ shifted_st.and_reg(not_maxst);
+
+ rgbaint_t clamp_diff(userdata->m_clamp_diff[tilenum]);
+ clamp_diff.and_reg(tile.clamp_st);
+ clamp_diff.and_reg(maxst);
+
+ st.set(shifted_st);
+ st.or_reg(clamp_diff);
}
void n64_texture_pipe_t::cycle_nearest(color_t* TEX, color_t* prev, INT32 SSS, INT32 SST, UINT32 tilenum, UINT32 cycle, rdp_span_aux* userdata, const rdp_poly_state& object)
{
- // const n64_tile_t* tiles = object.m_tiles;
const n64_tile_t& tile = object.m_tiles[tilenum];
- const UINT32 tformat = tile.format;
- const UINT32 tsize = tile.size;
- const UINT32 tpal = tile.palette;
- const UINT32 index = (tformat << 4) | (tsize << 2) | ((UINT32) object.m_other_modes.en_tlut << 1) | (UINT32) object.m_other_modes.tlut_type;
-
- color_t t0;
-
- INT32 sss1 = SSS, sst1 = SST;
- bool maxs, maxt;
- shift_cycle(&sss1, &sst1, &maxs, &maxt, tile);
- clamp_cycle_light(&sss1, &sst1, maxs, maxt, tilenum, tile, userdata);
- mask(&sss1, &sst1, tile);
-
- UINT32 tbase = tile.tmem + ((tile.line * sst1) & 0x1ff);
-
- t0.c = ((this)->*(m_texel_fetch[index]))(sss1, sst1, tbase, tpal, userdata);
-
- const INT32 newk0 = SIGN9(m_rdp->get_k0());
- const INT32 newk1 = SIGN9(m_rdp->get_k1());
- const INT32 newk2 = SIGN9(m_rdp->get_k2());
- const INT32 newk3 = SIGN9(m_rdp->get_k3());
- const INT32 invk0 = ~newk0;
- const INT32 invk1 = ~newk1;
- const INT32 invk2 = ~newk2;
- const INT32 invk3 = ~newk3;
+ const UINT32 index = (tile.format << 4) | (tile.size << 2) | ((UINT32) object.m_other_modes.en_tlut << 1) | (UINT32) object.m_other_modes.tlut_type;
+
+ rgbaint_t st(0, SSS, 0, SST);
+ rgbaint_t maxst = shift_cycle(st, tile);
+ clamp_cycle_light(st, maxst, tilenum, tile, userdata);
+ mask(st, tile);
+
+ UINT32 tbase = tile.tmem + ((tile.line * st.get_b32()) & 0x1ff);
+
+ rgbaint_t t0;
+ ((this)->*(m_texel_fetch[index]))(t0, st.get_r32(), st.get_b32(), tbase, tile.palette, userdata);
if (object.m_other_modes.convert_one && cycle)
{
- t0 = *prev;
+ t0.set(*prev);
}
- t0.i.r = SIGN9(t0.i.r);
- t0.i.g = SIGN9(t0.i.g);
- t0.i.b = SIGN9(t0.i.b);
- TEX->i.r = t0.i.b + (((newk0 - invk0) * t0.i.g + 0x80) >> 8);
- TEX->i.g = t0.i.b + (((newk1 - invk1) * t0.i.r + (newk2 - invk2) * t0.i.g + 0x80) >> 8);
- TEX->i.b = t0.i.b + (((newk3 - invk3) * t0.i.r + 0x80) >> 8);
- TEX->i.a = t0.i.b;
- TEX->i.r &= 0x1ff;
- TEX->i.g &= 0x1ff;
- TEX->i.b &= 0x1ff;
- TEX->i.a &= 0x1ff;
+
+ t0.sign_extend(0x00000100, 0xffffff00);
+
+ rgbaint_t k1r(m_rdp->get_k1());
+ k1r.mul_imm(t0.get_r32());
+
+ TEX->set(m_rdp->get_k023());
+ TEX->mul_imm(t0.get_g32());
+ TEX->add(k1r);
+ TEX->add_imm(0x80);
+ TEX->shr_imm(8);
+ TEX->add_imm(t0.get_b32());
+ TEX->and_imm(0x1ff);
}
void n64_texture_pipe_t::cycle_nearest_lerp(color_t* TEX, color_t* prev, INT32 SSS, INT32 SST, UINT32 tilenum, UINT32 cycle, rdp_span_aux* userdata, const rdp_poly_state& object)
{
- const n64_tile_t* tiles = object.m_tiles;
- const n64_tile_t& tile = tiles[tilenum];
- const UINT32 tformat = tile.format;
- const UINT32 tsize = tile.size;
- const UINT32 tpal = tile.palette;
- const UINT32 index = (tformat << 4) | (tsize << 2) | ((UINT32) object.m_other_modes.en_tlut << 1) | (UINT32) object.m_other_modes.tlut_type;
-
- color_t t0;
+ const n64_tile_t& tile = object.m_tiles[tilenum];
+ const UINT32 index = (tile.format << 4) | (tile.size << 2) | ((UINT32) object.m_other_modes.en_tlut << 1) | (UINT32) object.m_other_modes.tlut_type;
- INT32 sss1 = SSS, sst1 = SST;
- bool maxs, maxt;
- shift_cycle(&sss1, &sst1, &maxs, &maxt, tile);
- clamp_cycle_light(&sss1, &sst1, maxs, maxt, tilenum, tile, userdata);
- mask(&sss1, &sst1, tile);
+ rgbaint_t st(0, SSS, 0, SST);
+ rgbaint_t maxst = shift_cycle(st, tile);
+ clamp_cycle_light(st, maxst, tilenum, tile, userdata);
+ mask(st, tile);
- UINT32 tbase = tile.tmem + ((tile.line * sst1) & 0x1ff);
+ UINT32 tbase = tile.tmem + ((tile.line * st.get_b32()) & 0x1ff);
- (*TEX).c = ((this)->*(m_texel_fetch[index]))(sss1, sst1, tbase, tpal, userdata);
+ ((this)->*(m_texel_fetch[index]))(*TEX, st.get_r32(), st.get_b32(), tbase, tile.palette, userdata);
}
void n64_texture_pipe_t::cycle_linear(color_t* TEX, color_t* prev, INT32 SSS, INT32 SST, UINT32 tilenum, UINT32 cycle, rdp_span_aux* userdata, const rdp_poly_state& object)
{
- const n64_tile_t* tiles = object.m_tiles;
- const n64_tile_t& tile = tiles[tilenum];
-
- const UINT32 tpal = tile.palette;
+ const n64_tile_t& tile = object.m_tiles[tilenum];
const UINT32 index = (tile.format << 4) | (tile.size << 2) | ((UINT32) object.m_other_modes.en_tlut << 1) | (UINT32) object.m_other_modes.tlut_type;
- INT32 sss1 = SSS, sst1 = SST;
- bool maxs, maxt;
- shift_cycle(&sss1, &sst1, &maxs, &maxt, tile);
-
- INT32 sfrac = sss1 & 0x1f;
- INT32 tfrac = sst1 & 0x1f;
+ rgbaint_t st(0, SSS, 0, SST);
+ rgbaint_t maxst = shift_cycle(st, tile);
+ rgbaint_t stfrac(st);
+ stfrac.and_imm(0x1f);
- clamp_cycle(&sss1, &sst1, &sfrac, &tfrac, maxs, maxt, tilenum, tile, userdata);
+ clamp_cycle(st, stfrac, maxst, tilenum, tile, userdata);
- INT32 sss2 = sss1 + 1;
- INT32 sst2 = sst1 + 1;
+ mask(st, tile);
- mask_coupled(&sss1, &sss2, &sst1, &sst2, tile);
+ const UINT32 tbase = tile.tmem + ((tile.line * st.get_b32()) & 0x1ff);
- const UINT32 tbase = tile.tmem + ((tile.line * sst1) & 0x1ff);
+ bool upper = ((stfrac.get_r32() + stfrac.get_b32()) >= 0x20);
- bool upper = ((sfrac + tfrac) >= 0x20);
-
- INT32 invsf = 0;
- INT32 invtf = 0;
+ rgbaint_t invstf;
if (upper)
{
- invsf = 0x20 - sfrac;
- invsf <<= 3;
-
- invtf = 0x20 - tfrac;
- invtf <<= 3;
+ invstf.set(stfrac);
+ invstf.subr_imm(0x20);
+ invstf.shl_imm(3);
}
+ else
+ {
+ invstf.set(0, 0, 0, 0);
+ }
+
+ stfrac.shl_imm(3);
- sfrac <<= 3;
- tfrac <<= 3;
-
- color_t t0;
- t0.c = ((this)->*(m_texel_fetch[index]))(sss1, sst1, tbase, tpal, userdata);
- const INT32 newk0 = SIGN9(m_rdp->get_k0());
- const INT32 newk1 = SIGN9(m_rdp->get_k1());
- const INT32 newk2 = SIGN9(m_rdp->get_k2());
- const INT32 newk3 = SIGN9(m_rdp->get_k3());
- const INT32 invk0 = ~newk0;
- const INT32 invk1 = ~newk1;
- const INT32 invk2 = ~newk2;
- const INT32 invk3 = ~newk3;
+ rgbaint_t t0;
+ ((this)->*(m_texel_fetch[index]))(t0, st.get_r32(), st.get_b32(), tbase, tile.palette, userdata);
if (object.m_other_modes.convert_one && cycle)
{
- t0 = *prev;
+ t0.set(*prev);
}
- t0.i.r = SIGN9(t0.i.r); t0.i.g = SIGN9(t0.i.g); t0.i.b = SIGN9(t0.i.b);
- TEX->i.r = t0.i.b + (((newk0 - invk0) * t0.i.g + 0x80) >> 8);
- TEX->i.g = t0.i.b + (((newk1 - invk1) * t0.i.r + (newk2 - invk2) * t0.i.g + 0x80) >> 8);
- TEX->i.b = t0.i.b + (((newk3 - invk3) * t0.i.r + 0x80) >> 8);
- TEX->i.a = t0.i.b;
- TEX->i.r &= 0x1ff;
- TEX->i.g &= 0x1ff;
- TEX->i.b &= 0x1ff;
- TEX->i.a &= 0x1ff;
+
+ t0.sign_extend(0x00000100, 0xffffff00);
+
+ rgbaint_t k1r(m_rdp->get_k1());
+ k1r.mul_imm(t0.get_r32());
+
+ TEX->set(m_rdp->get_k023());
+ TEX->mul_imm(t0.get_g32());
+ TEX->add(k1r);
+ TEX->add_imm(0x80);
+ TEX->shr_imm(8);
+ TEX->add_imm(t0.get_b32());
+ TEX->and_imm(0x1ff);
}
void n64_texture_pipe_t::cycle_linear_lerp(color_t* TEX, color_t* prev, INT32 SSS, INT32 SST, UINT32 tilenum, UINT32 cycle, rdp_span_aux* userdata, const rdp_poly_state& object)
{
- const n64_tile_t* tiles = object.m_tiles;
- const n64_tile_t& tile = tiles[tilenum];
+ const n64_tile_t& tile = object.m_tiles[tilenum];
UINT32 tpal = tile.palette;
UINT32 index = (tile.format << 4) | (tile.size << 2) | ((UINT32) object.m_other_modes.en_tlut << 1) | (UINT32) object.m_other_modes.tlut_type;
- INT32 sss1 = SSS, sst1 = SST;
- bool maxs, maxt;
- shift_cycle(&sss1, &sst1, &maxs, &maxt, tile);
-
- INT32 sfrac = sss1 & 0x1f;
- INT32 tfrac = sst1 & 0x1f;
+ rgbaint_t sstt(SSS, SSS, SST, SST);
+ rgbaint_t maxst = shift_cycle(sstt, tile);
+ rgbaint_t stfrac = sstt;
+ stfrac.and_imm(0x1f);
- clamp_cycle(&sss1, &sst1, &sfrac, &tfrac, maxs, maxt, tilenum, tile, userdata);
+ clamp_cycle(sstt, stfrac, maxst, tilenum, tile, userdata);
- INT32 sss2 = sss1 + 1;
- INT32 sst2 = sst1 + 1;
+ sstt.add(m_st2_add);
- mask_coupled(&sss1, &sss2, &sst1, &sst2, tile);
+ mask(sstt, tile);
- const UINT32 tbase1 = tile.tmem + ((tile.line * sst1) & 0x1ff);
- const UINT32 tbase2 = tile.tmem + ((tile.line * sst2) & 0x1ff);
+ const UINT32 tbase1 = tile.tmem + ((tile.line * sstt.get_b32()) & 0x1ff);
+ const UINT32 tbase2 = tile.tmem + ((tile.line * sstt.get_g32()) & 0x1ff);
- bool upper = ((sfrac + tfrac) >= 0x20);
+ bool upper = ((stfrac.get_r32() + stfrac.get_b32()) >= 0x20);
- INT32 invsf = 0;
- INT32 invtf = 0;
+ rgbaint_t invstf;
if (upper)
{
- invsf = 0x20 - sfrac;
- invsf <<= 3;
-
- invtf = 0x20 - tfrac;
- invtf <<= 3;
+ invstf.set(stfrac);
+ invstf.subr_imm(0x20);
+ invstf.shl_imm(3);
}
- INT32 center = (sfrac == 0x10) && (tfrac == 0x10) && object.m_other_modes.mid_texel;
+ stfrac.shl_imm(3);
+
+ bool center = (stfrac.get_r32() == 0x10) && (stfrac.get_b32() == 0x10) && object.m_other_modes.mid_texel;
- sfrac <<= 3;
- tfrac <<= 3;
+ rgbaint_t t2;
+ ((this)->*(m_texel_fetch[index]))(*TEX, sstt.get_a32(), sstt.get_b32(), tbase1, tpal, userdata);
+ ((this)->*(m_texel_fetch[index]))(t2, sstt.get_r32(), sstt.get_g32(), tbase2, tpal, userdata);
- color_t t1;
- color_t t2;
- t1.c = ((this)->*(m_texel_fetch[index]))(sss2, sst1, tbase1, tpal, userdata);
- t2.c = ((this)->*(m_texel_fetch[index]))(sss1, sst2, tbase2, tpal, userdata);
if (!center)
{
if (upper)
{
- color_t t3;
- t3.c = ((this)->*(m_texel_fetch[index]))(sss2, sst2, tbase2, tpal, userdata);
- TEX->i.r = t3.i.r + (((invsf * (t2.i.r - t3.i.r)) + (invtf * (t1.i.r - t3.i.r)) + 0x80) >> 8);
- TEX->i.g = t3.i.g + (((invsf * (t2.i.g - t3.i.g)) + (invtf * (t1.i.g - t3.i.g)) + 0x80) >> 8);
- TEX->i.b = t3.i.b + (((invsf * (t2.i.b - t3.i.b)) + (invtf * (t1.i.b - t3.i.b)) + 0x80) >> 8);
- TEX->i.a = t3.i.a + (((invsf * (t2.i.a - t3.i.a)) + (invtf * (t1.i.a - t3.i.a)) + 0x80) >> 8);
+ rgbaint_t t3;
+ ((this)->*(m_texel_fetch[index]))(t3, sstt.get_a32(), sstt.get_g32(), tbase2, tpal, userdata);
+
+ TEX->sub(t3);
+ t2.sub(t3);
+
+ TEX->mul_imm(invstf.get_b32());
+ t2.mul_imm(invstf.get_r32());
+
+ TEX->add(t2);
+ TEX->add_imm(0x0080);
+ TEX->sra_imm(8);
+ TEX->add(t3);
}
else
{
- color_t t0;
- t0.c = ((this)->*(m_texel_fetch[index]))(sss1, sst1, tbase1, tpal, userdata);
- TEX->i.r = t0.i.r + (((sfrac * (t1.i.r - t0.i.r)) + (tfrac * (t2.i.r - t0.i.r)) + 0x80) >> 8);
- TEX->i.g = t0.i.g + (((sfrac * (t1.i.g - t0.i.g)) + (tfrac * (t2.i.g - t0.i.g)) + 0x80) >> 8);
- TEX->i.b = t0.i.b + (((sfrac * (t1.i.b - t0.i.b)) + (tfrac * (t2.i.b - t0.i.b)) + 0x80) >> 8);
- TEX->i.a = t0.i.a + (((sfrac * (t1.i.a - t0.i.a)) + (tfrac * (t2.i.a - t0.i.a)) + 0x80) >> 8);
+ rgbaint_t t0;
+ ((this)->*(m_texel_fetch[index]))(t0, sstt.get_r32(), sstt.get_b32(), tbase1, tpal, userdata);
+
+ TEX->sub(t0);
+ t2.sub(t0);
+
+ TEX->mul_imm(stfrac.get_r32());
+ t2.mul_imm(stfrac.get_b32());
+
+ TEX->add(t2);
+ TEX->add_imm(0x80);
+ TEX->sra_imm(8);
+ TEX->add(t0);
}
- TEX->i.r &= 0x1ff;
- TEX->i.g &= 0x1ff;
- TEX->i.b &= 0x1ff;
- TEX->i.a &= 0x1ff;
}
else
{
- color_t t0;
- color_t t3;
- t0.c = ((this)->*(m_texel_fetch[index]))(sss1, sst1, 1, tpal, userdata);
- t3.c = ((this)->*(m_texel_fetch[index]))(sss2, sst2, tbase2, tpal, userdata);
- TEX->i.r = (t0.i.r + t1.i.r + t2.i.r + t3.i.r) >> 2;
- TEX->i.g = (t0.i.g + t1.i.g + t2.i.g + t3.i.g) >> 2;
- TEX->i.b = (t0.i.b + t1.i.b + t2.i.b + t3.i.b) >> 2;
- TEX->i.a = (t0.i.a + t1.i.a + t2.i.a + t3.i.a) >> 2;
+ rgbaint_t t0, t3;
+ ((this)->*(m_texel_fetch[index]))(t0, sstt.get_r32(), sstt.get_b32(), tbase1, tpal, userdata);
+ ((this)->*(m_texel_fetch[index]))(t3, sstt.get_a32(), sstt.get_g32(), tbase2, tpal, userdata);
+ TEX->add(t0);
+ TEX->add(t2);
+ TEX->add(t3);
+ TEX->sra(2);
}
}
@@ -476,19 +370,22 @@ void n64_texture_pipe_t::copy(color_t* TEX, INT32 SSS, INT32 SST, UINT32 tilenum
const n64_tile_t* tiles = object.m_tiles;
const n64_tile_t& tile = tiles[tilenum];
- INT32 sss1 = SSS;
- INT32 sst1 = SST;
- shift_copy(&sss1, &sst1, tile);
- sss1 = (((sss1 >> 3) - tile.sl) << 3) | (sss1 & 7);
- sss1 = (SIGN17(sss1) >> 5) & 0x1fff;
-
- sst1 = (((sst1 >> 3) - tile.tl) << 3) | (sst1 & 7);
- sst1 = (SIGN17(sst1) >> 5) & 0x1fff;
- mask(&sss1, &sst1, tile);
+ rgbaint_t st(0, SSS, 0, SST);
+ shift_copy(st, tile);
+ rgbaint_t stlsb(st);
+ stlsb.and_imm(7);
+ st.shr_imm(3);
+ st.sub(rgbaint_t(0, tile.sl, 0, tile.tl));
+ st.shl_imm(3);
+ st.add(stlsb);
+ st.sign_extend(0x00010000, 0xffff0000);
+ st.shr_imm(5);
+ st.and_imm(0x1fff);
+ mask(st, tile);
const UINT32 index = (tile.format << 4) | (tile.size << 2) | ((UINT32) object.m_other_modes.en_tlut << 1) | (UINT32) object.m_other_modes.tlut_type;
- const UINT32 tbase = tile.tmem + ((tile.line * sst1) & 0x1ff);
- TEX->c = ((this)->*(m_texel_fetch[index]))(sss1, sst1, tbase, tile.palette, userdata);
+ const UINT32 tbase = tile.tmem + ((tile.line * st.get_b32()) & 0x1ff);
+ ((this)->*(m_texel_fetch[index]))(*TEX, st.get_r32(), st.get_b32(), tbase, tile.palette, userdata);
}
void n64_texture_pipe_t::lod_1cycle(INT32* sss, INT32* sst, const INT32 s, const INT32 t, const INT32 w, const INT32 dsinc, const INT32 dtinc, const INT32 dwinc, rdp_span_aux* userdata, const rdp_poly_state& object)
@@ -541,24 +438,27 @@ void n64_texture_pipe_t::lod_1cycle(INT32* sss, INT32* sst, const INT32 s, const
const bool magnify = (lod < 32);
const bool distant = ((lod & 0x6000) || (l_tile >= object.m_misc_state.m_max_level));
- userdata->m_lod_fraction = ((lod << 3) >> l_tile) & 0xff;
+ UINT8 lod_fraction = ((lod << 3) >> l_tile) & 0xff;
if(!object.m_other_modes.sharpen_tex_en && !object.m_other_modes.detail_tex_en)
{
if (distant)
{
- userdata->m_lod_fraction = 0xff;
+ lod_fraction = 0xff;
}
else if (magnify)
{
- userdata->m_lod_fraction = 0;
+ lod_fraction = 0;
}
}
+ userdata->m_lod_fraction.set(lod_fraction, lod_fraction, lod_fraction, lod_fraction);
+ /* FIXME: ???
if(object.m_other_modes.sharpen_tex_en && magnify)
{
- userdata->m_lod_fraction |= 0x100;
+ userdata->m_lod_fraction |= 0x100;
}
+ */
}
void n64_texture_pipe_t::lod_2cycle(INT32* sss, INT32* sst, const INT32 s, const INT32 t, const INT32 w, const INT32 dsinc, const INT32 dtinc, const INT32 dwinc, const INT32 prim_tile, INT32* t1, INT32* t2, rdp_span_aux* userdata, const rdp_poly_state& object)
@@ -611,24 +511,27 @@ void n64_texture_pipe_t::lod_2cycle(INT32* sss, INT32* sst, const INT32 s, const
const bool magnify = (lod < 32);
const bool distant = ((lod & 0x6000) || (l_tile >= object.m_misc_state.m_max_level));
- userdata->m_lod_fraction = ((lod << 3) >> l_tile) & 0xff;
+ UINT8 lod_fraction = ((lod << 3) >> l_tile) & 0xff;
if(!object.m_other_modes.sharpen_tex_en && !object.m_other_modes.detail_tex_en)
{
if (distant)
{
- userdata->m_lod_fraction = 0xff;
+ lod_fraction = 0xff;
}
else if (magnify)
{
- userdata->m_lod_fraction = 0;
+ lod_fraction = 0;
}
}
+ userdata->m_lod_fraction.set(lod_fraction, lod_fraction, lod_fraction, lod_fraction);
+
+ /* FIXME: ???
if(object.m_other_modes.sharpen_tex_en && magnify)
{
- userdata->m_lod_fraction |= 0x100;
- }
+ userdata->m_lod_fraction |= 0x100;
+ }*/
if (object.m_other_modes.tex_lod_en)
{
@@ -751,24 +654,20 @@ void n64_texture_pipe_t::calculate_clamp_diffs(UINT32 prim_tile, rdp_span_aux* u
{
for (INT32 start = 0; start <= 7; start++)
{
- userdata->m_clamp_s_diff[start] = (tiles[start].sh >> 2) - (tiles[start].sl >> 2);
- userdata->m_clamp_t_diff[start] = (tiles[start].th >> 2) - (tiles[start].tl >> 2);
+ userdata->m_clamp_diff[start].set((tiles[start].sh >> 2) - (tiles[start].sl >> 2), (tiles[start].sh >> 2) - (tiles[start].sl >> 2), (tiles[start].th >> 2) - (tiles[start].tl >> 2), (tiles[start].th >> 2) - (tiles[start].tl >> 2));
}
}
else
{
const INT32 start = prim_tile;
const INT32 end = (prim_tile + 1) & 7;
- userdata->m_clamp_s_diff[start] = (tiles[start].sh >> 2) - (tiles[start].sl >> 2);
- userdata->m_clamp_t_diff[start] = (tiles[start].th >> 2) - (tiles[start].tl >> 2);
- userdata->m_clamp_s_diff[end] = (tiles[end].sh >> 2) - (tiles[end].sl >> 2);
- userdata->m_clamp_t_diff[end] = (tiles[end].th >> 2) - (tiles[end].tl >> 2);
+ userdata->m_clamp_diff[start].set((tiles[start].sh >> 2) - (tiles[start].sl >> 2), (tiles[start].sh >> 2) - (tiles[start].sl >> 2), (tiles[start].th >> 2) - (tiles[start].tl >> 2), (tiles[start].th >> 2) - (tiles[start].tl >> 2));
+ userdata->m_clamp_diff[end].set((tiles[end].sh >> 2) - (tiles[end].sl >> 2), (tiles[end].sh >> 2) - (tiles[end].sl >> 2), (tiles[end].th >> 2) - (tiles[end].tl >> 2), (tiles[end].th >> 2) - (tiles[end].tl >> 2));
}
}
else//1-cycle or copy
{
- userdata->m_clamp_s_diff[prim_tile] = (tiles[prim_tile].sh >> 2) - (tiles[prim_tile].sl >> 2);
- userdata->m_clamp_t_diff[prim_tile] = (tiles[prim_tile].th >> 2) - (tiles[prim_tile].tl >> 2);
+ userdata->m_clamp_diff[prim_tile].set((tiles[prim_tile].sh >> 2) - (tiles[prim_tile].sl >> 2), (tiles[prim_tile].sh >> 2) - (tiles[prim_tile].sl >> 2), (tiles[prim_tile].th >> 2) - (tiles[prim_tile].tl >> 2), (tiles[prim_tile].th >> 2) - (tiles[prim_tile].tl >> 2));
}
}
@@ -777,7 +676,7 @@ void n64_texture_pipe_t::calculate_clamp_diffs(UINT32 prim_tile, rdp_span_aux* u
static INT32 sTexAddrSwap16[2] = { WORD_ADDR_XOR, WORD_XOR_DWORD_SWAP };
static INT32 sTexAddrSwap8[2] = { BYTE_ADDR_XOR, BYTE_XOR_DWORD_SWAP };
-UINT32 n64_texture_pipe_t::fetch_rgba16_tlut0(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata)
+void n64_texture_pipe_t::fetch_rgba16_tlut0(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata)
{
INT32 taddr = (((tbase << 2) + s) ^ sTexAddrSwap16[t & 1]) & 0x7ff;
@@ -785,48 +684,37 @@ UINT32 n64_texture_pipe_t::fetch_rgba16_tlut0(INT32 s, INT32 t, INT32 tbase, INT
c = ((UINT16*)(userdata->m_tmem + 0x800))[(c >> 8) << 2];
#if USE_64K_LUT
- return m_expand_16to32_table[c];
+ out.set(m_expand_16to32_table[c]);
#else
- color_t color;
- color.i.r = GET_HI_RGBA16_TMEM(c);
- color.i.g = GET_MED_RGBA16_TMEM(c);
- color.i.b = GET_LOW_RGBA16_TMEM(c);
- color.i.a = (c & 1) * 0xff;
- return color.c;
+ out.set((c & 1) * 0xff, GET_HI_RGBA16_TMEM(c), GET_MED_RGBA16_TMEM(c), GET_LOW_RGBA16_TMEM(c));
#endif
}
-UINT32 n64_texture_pipe_t::fetch_rgba16_tlut1(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata)
+void n64_texture_pipe_t::fetch_rgba16_tlut1(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata)
{
const INT32 taddr = (((tbase << 2) + s) ^ sTexAddrSwap16[t & 1]) & 0x7ff;
UINT16 c = ((UINT16*)userdata->m_tmem)[taddr];
c = ((UINT16*)(userdata->m_tmem + 0x800))[(c >> 8) << 2];
- color_t color;
- color.i.r = color.i.g = color.i.b = (c >> 8) & 0xff;
- color.i.a = c & 0xff;
- return color.c;
+ const UINT8 k = (c >> 8) & 0xff;
+ out.set(c & 0xff, k, k, k);
}
-UINT32 n64_texture_pipe_t::fetch_rgba16_raw(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata)
+void n64_texture_pipe_t::fetch_rgba16_raw(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata)
{
const INT32 taddr = (((tbase << 2) + s) ^ sTexAddrSwap16[t & 1]) & 0x7ff;
+ const UINT16 c = ((UINT16*)userdata->m_tmem)[taddr];
+
#if USE_64K_LUT
- return m_expand_16to32_table[((UINT16*)userdata->m_tmem)[taddr]];
+ out.set(m_expand_16to32_table[c]);
#else
- const UINT16 c = ((UINT16*)userdata->m_tmem)[taddr];
- color_t color;
- color.i.r = GET_HI_RGBA16_TMEM(c);
- color.i.g = GET_MED_RGBA16_TMEM(c);
- color.i.b = GET_LOW_RGBA16_TMEM(c);
- color.i.a = (c & 1) * 0xff;
- return color.c;
+ out.set((c & 1) * 0xff, GET_HI_RGBA16_TMEM(c), GET_MED_RGBA16_TMEM(c), GET_LOW_RGBA16_TMEM(c));
#endif
}
-UINT32 n64_texture_pipe_t::fetch_rgba32_tlut0(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata)
+void n64_texture_pipe_t::fetch_rgba32_tlut0(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata)
{
const UINT32 *tc = ((UINT32*)userdata->m_tmem);
const INT32 taddr = (((tbase << 2) + s) ^ sTexAddrSwap16[t & 1]) & 0x3ff;
@@ -835,18 +723,13 @@ UINT32 n64_texture_pipe_t::fetch_rgba32_tlut0(INT32 s, INT32 t, INT32 tbase, INT
c = ((UINT16*)(userdata->m_tmem + 0x800))[(c >> 24) << 2];
#if USE_64K_LUT
- return m_expand_16to32_table[c];
+ out.set(m_expand_16to32_table[c]);
#else
- color_t color;
- color.i.r = GET_HI_RGBA16_TMEM(c);
- color.i.g = GET_MED_RGBA16_TMEM(c);
- color.i.b = GET_LOW_RGBA16_TMEM(c);
- color.i.a = (c & 1) * 0xff;
- return color.c;
+ out.set((c & 1) * 0xff, GET_HI_RGBA16_TMEM(c), GET_MED_RGBA16_TMEM(c), GET_LOW_RGBA16_TMEM(c));
#endif
}
-UINT32 n64_texture_pipe_t::fetch_rgba32_tlut1(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata)
+void n64_texture_pipe_t::fetch_rgba32_tlut1(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata)
{
const UINT32 *tc = ((UINT32*)userdata->m_tmem);
const INT32 taddr = (((tbase << 2) + s) ^ sTexAddrSwap16[t & 1]) & 0x3ff;
@@ -854,31 +737,23 @@ UINT32 n64_texture_pipe_t::fetch_rgba32_tlut1(INT32 s, INT32 t, INT32 tbase, INT
UINT32 c = tc[taddr];
c = ((UINT16*)(userdata->m_tmem + 0x800))[(c >> 24) << 2];
- color_t color;
- color.i.r = color.i.g = color.i.b = (c >> 8) & 0xff;
- color.i.a = c & 0xff;
-
- return color.c;
+ const UINT8 k = (c >> 8) & 0xff;
+ out.set(c & 0xff, k, k, k);
}
-UINT32 n64_texture_pipe_t::fetch_rgba32_raw(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata)
+void n64_texture_pipe_t::fetch_rgba32_raw(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata)
{
const INT32 taddr = (((tbase << 2) + s) ^ sTexAddrSwap16[t & 1]) & 0x3ff;
- UINT32 c = ((UINT16*)userdata->m_tmem)[taddr];
- color_t color;
- color.i.r = (c >> 8) & 0xff;
- color.i.g = c & 0xff;
- c = ((UINT16*)userdata->m_tmem)[taddr | 0x400];
- color.i.b = (c >> 8) & 0xff;
- color.i.a = c & 0xff;
+ const UINT16 cl = ((UINT16*)userdata->m_tmem)[taddr];
+ const UINT16 ch = ((UINT16*)userdata->m_tmem)[taddr | 0x400];
- return color.c;
+ out.set(ch & 0xff, cl >> 8, cl & 0xff, ch >> 8);
}
-UINT32 n64_texture_pipe_t::fetch_nop(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata) { return 0; }
+void n64_texture_pipe_t::fetch_nop(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata) { }
-UINT32 n64_texture_pipe_t::fetch_yuv(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata)
+void n64_texture_pipe_t::fetch_yuv(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata)
{
const UINT16 *tc = ((UINT16*)userdata->m_tmem);
@@ -895,16 +770,10 @@ UINT32 n64_texture_pipe_t::fetch_yuv(INT32 s, INT32 t, INT32 tbase, INT32 tpal,
u |= ((u & 0x80) << 1);
v |= ((v & 0x80) << 1);
- color_t color;
- color.i.r = u;
- color.i.g = v;
- color.i.b = y;
- color.i.a = y;
-
- return color.c;
+ out.set(y & 0xff, y & 0xff, u & 0xff, v & 0xff);
}
-UINT32 n64_texture_pipe_t::fetch_ci4_tlut0(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata)
+void n64_texture_pipe_t::fetch_ci4_tlut0(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata)
{
const UINT8 *tc = userdata->m_tmem;
const INT32 taddr = ((((tbase << 4) + s) >> 1) ^ sTexAddrSwap8[t & 1]) & 0x7ff;
@@ -913,18 +782,13 @@ UINT32 n64_texture_pipe_t::fetch_ci4_tlut0(INT32 s, INT32 t, INT32 tbase, INT32
const UINT16 c = ((UINT16*)(userdata->m_tmem + 0x800))[((tpal << 4) | p) << 2];
#if USE_64K_LUT
- return m_expand_16to32_table[c];
+ out.set(m_expand_16to32_table[c]);
#else
- color_t color;
- color.i.r = GET_HI_RGBA16_TMEM(c);
- color.i.g = GET_MED_RGBA16_TMEM(c);
- color.i.b = GET_LOW_RGBA16_TMEM(c);
- color.i.a = (c & 1) * 0xff;
- return color.c;
+ out.set((c & 1) * 0xff, GET_HI_RGBA16_TMEM(c), GET_MED_RGBA16_TMEM(c), GET_LOW_RGBA16_TMEM(c));
#endif
}
-UINT32 n64_texture_pipe_t::fetch_ci4_tlut1(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata)
+void n64_texture_pipe_t::fetch_ci4_tlut1(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata)
{
const UINT8 *tc = userdata->m_tmem;
INT32 taddr = ((((tbase << 4) + s) >> 1) ^ sTexAddrSwap8[t & 1]) & 0x7ff;
@@ -932,14 +796,11 @@ UINT32 n64_texture_pipe_t::fetch_ci4_tlut1(INT32 s, INT32 t, INT32 tbase, INT32
const UINT8 p = (s & 1) ? (tc[taddr] & 0xf) : (tc[taddr] >> 4);
const UINT16 c = ((UINT16*)(userdata->m_tmem + 0x800))[((tpal << 4) | p) << 2];
- color_t color;
- color.i.r = color.i.g = color.i.b = (c >> 8) & 0xff;
- color.i.a = c & 0xff;
-
- return color.c;
+ const UINT8 k = (c >> 8) & 0xff;
+ out.set(c & 0xff, k, k, k);
}
-UINT32 n64_texture_pipe_t::fetch_ci4_raw(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata)
+void n64_texture_pipe_t::fetch_ci4_raw(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata)
{
const UINT8 *tc = userdata->m_tmem;
const INT32 taddr = ((((tbase << 4) + s) >> 1) ^ sTexAddrSwap8[t & 1]) & 0xfff;
@@ -947,13 +808,10 @@ UINT32 n64_texture_pipe_t::fetch_ci4_raw(INT32 s, INT32 t, INT32 tbase, INT32 tp
UINT8 p = (s & 1) ? (tc[taddr] & 0xf) : (tc[taddr] >> 4);
p = (tpal << 4) | p;
- color_t color;
- color.i.r = color.i.g = color.i.b = color.i.a = p;
-
- return color.c;
+ out.set(p, p, p, p);
}
-UINT32 n64_texture_pipe_t::fetch_ci8_tlut0(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata)
+void n64_texture_pipe_t::fetch_ci8_tlut0(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata)
{
const UINT8 *tc = userdata->m_tmem;
const INT32 taddr = (((tbase << 3) + s) ^ sTexAddrSwap8[t & 1]) & 0x7ff;
@@ -962,18 +820,13 @@ UINT32 n64_texture_pipe_t::fetch_ci8_tlut0(INT32 s, INT32 t, INT32 tbase, INT32
const UINT16 c = ((UINT16*)(userdata->m_tmem + 0x800))[p << 2];
#if USE_64K_LUT
- return m_expand_16to32_table[c];
+ out.set(m_expand_16to32_table[c]);
#else
- color_t color;
- color.i.r = GET_HI_RGBA16_TMEM(c);
- color.i.g = GET_MED_RGBA16_TMEM(c);
- color.i.b = GET_LOW_RGBA16_TMEM(c);
- color.i.a = (c & 1) * 0xff;
- return color.c;
+ out.set((c & 1) * 0xff, GET_HI_RGBA16_TMEM(c), GET_MED_RGBA16_TMEM(c), GET_LOW_RGBA16_TMEM(c));
#endif
}
-UINT32 n64_texture_pipe_t::fetch_ci8_tlut1(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata)
+void n64_texture_pipe_t::fetch_ci8_tlut1(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata)
{
const UINT8 *tc = userdata->m_tmem;
const INT32 taddr = (((tbase << 3) + s) ^ sTexAddrSwap8[t & 1]) & 0x7ff;
@@ -981,25 +834,20 @@ UINT32 n64_texture_pipe_t::fetch_ci8_tlut1(INT32 s, INT32 t, INT32 tbase, INT32
const UINT8 p = tc[taddr];
const UINT16 c = ((UINT16*)(userdata->m_tmem + 0x800))[p << 2];
- color_t color;
- color.i.r = color.i.g = color.i.b = (c >> 8) & 0xff;
- color.i.a = c & 0xff;
-
- return color.c;
+ const UINT8 k = (c >> 8) & 0xff;
+ out.set(c & 0xff, k, k, k);
}
-UINT32 n64_texture_pipe_t::fetch_ci8_raw(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata)
+void n64_texture_pipe_t::fetch_ci8_raw(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata)
{
const UINT8 *tc = userdata->m_tmem;
const INT32 taddr = (((tbase << 3) + s) ^ sTexAddrSwap8[t & 1]) & 0xfff;
- color_t color;
- color.i.r = color.i.g = color.i.b = color.i.a = tc[taddr];
-
- return color.c;
+ const UINT8 p = tc[taddr];
+ out.set(p, p, p, p);
}
-UINT32 n64_texture_pipe_t::fetch_ia4_tlut0(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata)
+void n64_texture_pipe_t::fetch_ia4_tlut0(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata)
{
const UINT8 *tc = userdata->m_tmem;
const INT32 taddr = ((((tbase << 4) + s) >> 1) ^ sTexAddrSwap8[t & 1]) & 0x7ff;
@@ -1008,18 +856,13 @@ UINT32 n64_texture_pipe_t::fetch_ia4_tlut0(INT32 s, INT32 t, INT32 tbase, INT32
const UINT16 c = ((UINT16*)(userdata->m_tmem + 0x800))[((tpal << 4) | p) << 2];
#if USE_64K_LUT
- return m_expand_16to32_table[c];
+ out.set(m_expand_16to32_table[c]);
#else
- color_t color;
- color.i.r = GET_HI_RGBA16_TMEM(c);
- color.i.g = GET_MED_RGBA16_TMEM(c);
- color.i.b = GET_LOW_RGBA16_TMEM(c);
- color.i.a = (c & 1) * 0xff;
- return color.c;
+ out.set((c & 1) * 0xff, GET_HI_RGBA16_TMEM(c), GET_MED_RGBA16_TMEM(c), GET_LOW_RGBA16_TMEM(c));
#endif
}
-UINT32 n64_texture_pipe_t::fetch_ia4_tlut1(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata)
+void n64_texture_pipe_t::fetch_ia4_tlut1(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata)
{
const UINT8 *tc = userdata->m_tmem;
const INT32 taddr = ((((tbase << 4) + s) >> 1) ^ sTexAddrSwap8[t & 1]) & 0x7ff;
@@ -1027,14 +870,11 @@ UINT32 n64_texture_pipe_t::fetch_ia4_tlut1(INT32 s, INT32 t, INT32 tbase, INT32
const UINT8 p = ((s) & 1) ? (tc[taddr] & 0xf) : (tc[taddr] >> 4);
const UINT16 c = ((UINT16*)(userdata->m_tmem + 0x800))[((tpal << 4) | p) << 2];
- color_t color;
- color.i.r = color.i.g = color.i.b = (c >> 8) & 0xff;
- color.i.a = c & 0xff;
-
- return color.c;
+ const UINT8 k = (c >> 8) & 0xff;
+ out.set(c & 0xff, k, k, k);
}
-UINT32 n64_texture_pipe_t::fetch_ia4_raw(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata)
+void n64_texture_pipe_t::fetch_ia4_raw(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata)
{
const UINT8 *tc = userdata->m_tmem;
const INT32 taddr = ((((tbase << 4) + s) >> 1) ^ sTexAddrSwap8[t & 1]) & 0xfff;
@@ -1043,16 +883,10 @@ UINT32 n64_texture_pipe_t::fetch_ia4_raw(INT32 s, INT32 t, INT32 tbase, INT32 tp
UINT8 i = p & 0xe;
i = (i << 4) | (i << 1) | (i >> 2);
- color_t color;
- color.i.r = i;
- color.i.g = i;
- color.i.b = i;
- color.i.a = (p & 1) * 0xff;
-
- return color.c;
+ out.set((p & 1) * 0xff, i, i, i);
}
-UINT32 n64_texture_pipe_t::fetch_ia8_tlut0(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata)
+void n64_texture_pipe_t::fetch_ia8_tlut0(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata)
{
const UINT8 *tc = userdata->m_tmem;
const INT32 taddr = (((tbase << 3) + s) ^ sTexAddrSwap8[t & 1]) & 0x7ff;
@@ -1061,18 +895,13 @@ UINT32 n64_texture_pipe_t::fetch_ia8_tlut0(INT32 s, INT32 t, INT32 tbase, INT32
const UINT16 c = ((UINT16*)(userdata->m_tmem + 0x800))[p << 2];
#if USE_64K_LUT
- return m_expand_16to32_table[c];
+ out.set(m_expand_16to32_table[c]);
#else
- color_t color;
- color.i.r = GET_HI_RGBA16_TMEM(c);
- color.i.g = GET_MED_RGBA16_TMEM(c);
- color.i.b = GET_LOW_RGBA16_TMEM(c);
- color.i.a = (c & 1) * 0xff;
- return color.c;
+ out.set((c & 1) * 0xff, GET_HI_RGBA16_TMEM(c), GET_MED_RGBA16_TMEM(c), GET_LOW_RGBA16_TMEM(c));
#endif
}
-UINT32 n64_texture_pipe_t::fetch_ia8_tlut1(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata)
+void n64_texture_pipe_t::fetch_ia8_tlut1(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata)
{
const UINT8 *tc = userdata->m_tmem;
const INT32 taddr = (((tbase << 3) + s) ^ sTexAddrSwap8[t & 1]) & 0x7ff;
@@ -1080,14 +909,11 @@ UINT32 n64_texture_pipe_t::fetch_ia8_tlut1(INT32 s, INT32 t, INT32 tbase, INT32
const UINT8 p = tc[taddr];
const UINT16 c = ((UINT16*)(userdata->m_tmem + 0x800))[p << 2];
- color_t color;
- color.i.r = color.i.g = color.i.b = (c >> 8) & 0xff;
- color.i.a = c & 0xff;
-
- return color.c;
+ const UINT8 k = (c >> 8) & 0xff;
+ out.set(c & 0xff, k, k, k);
}
-UINT32 n64_texture_pipe_t::fetch_ia8_raw(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata)
+void n64_texture_pipe_t::fetch_ia8_raw(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata)
{
const UINT8 *tc = userdata->m_tmem;
const INT32 taddr = (((tbase << 3) + s) ^ sTexAddrSwap8[t & 1]) & 0xfff;
@@ -1096,16 +922,10 @@ UINT32 n64_texture_pipe_t::fetch_ia8_raw(INT32 s, INT32 t, INT32 tbase, INT32 tp
UINT8 i = p & 0xf0;
i |= (i >> 4);
- color_t color;
- color.i.r = i;
- color.i.g = i;
- color.i.b = i;
- color.i.a = ((p & 0xf) << 4) | (p & 0xf);
-
- return color.c;
+ out.set(((p << 4) | (p & 0xf)) & 0xff, i, i, i);
}
-UINT32 n64_texture_pipe_t::fetch_ia16_tlut0(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata)
+void n64_texture_pipe_t::fetch_ia16_tlut0(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata)
{
const UINT16 *tc = ((UINT16*)userdata->m_tmem);
const INT32 taddr = (((tbase << 2) + s) ^ sTexAddrSwap16[t & 1]) & 0x3ff;
@@ -1114,18 +934,13 @@ UINT32 n64_texture_pipe_t::fetch_ia16_tlut0(INT32 s, INT32 t, INT32 tbase, INT32
c = ((UINT16*)(userdata->m_tmem + 0x800))[(c >> 8) << 2];
#if USE_64K_LUT
- return m_expand_16to32_table[c];
+ out.set(m_expand_16to32_table[c]);
#else
- color_t color;
- color.i.r = GET_HI_RGBA16_TMEM(c);
- color.i.g = GET_MED_RGBA16_TMEM(c);
- color.i.b = GET_LOW_RGBA16_TMEM(c);
- color.i.a = (c & 1) * 0xff;
- return color.c;
+ out.set((c & 1) * 0xff, GET_HI_RGBA16_TMEM(c), GET_MED_RGBA16_TMEM(c), GET_LOW_RGBA16_TMEM(c));
#endif
}
-UINT32 n64_texture_pipe_t::fetch_ia16_tlut1(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata)
+void n64_texture_pipe_t::fetch_ia16_tlut1(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata)
{
const UINT16 *tc = ((UINT16*)userdata->m_tmem);
const INT32 taddr = (((tbase << 2) + s) ^ sTexAddrSwap16[t & 1]) & 0x3ff;
@@ -1133,31 +948,21 @@ UINT32 n64_texture_pipe_t::fetch_ia16_tlut1(INT32 s, INT32 t, INT32 tbase, INT32
UINT16 c = tc[taddr];
c = ((UINT16*)(userdata->m_tmem + 0x800))[(c >> 8) << 2];
- color_t color;
- color.i.r = color.i.g = color.i.b = (c >> 8) & 0xff;
- color.i.a = c & 0xff;
-
- return color.c;
+ const UINT8 k = (c >> 8) & 0xff;
+ out.set(c & 0xff, k, k, k);
}
-UINT32 n64_texture_pipe_t::fetch_ia16_raw(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata)
+void n64_texture_pipe_t::fetch_ia16_raw(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata)
{
const UINT16 *tc = ((UINT16*)userdata->m_tmem);
const INT32 taddr = (((tbase << 2) + s) ^ sTexAddrSwap16[t & 1]) & 0x7ff;
const UINT16 c = tc[taddr];
const UINT8 i = (c >> 8);
-
- color_t color;
- color.i.r = i;
- color.i.g = i;
- color.i.b = i;
- color.i.a = c & 0xff;
-
- return color.c;
+ out.set(c & 0xff, i, i, i);
}
-UINT32 n64_texture_pipe_t::fetch_i4_tlut0(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata)
+void n64_texture_pipe_t::fetch_i4_tlut0(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata)
{
const UINT8 *tc = userdata->m_tmem;
const INT32 taddr = ((((tbase << 4) + s) >> 1) ^ sTexAddrSwap8[t & 1]) & 0x7ff;
@@ -1167,18 +972,13 @@ UINT32 n64_texture_pipe_t::fetch_i4_tlut0(INT32 s, INT32 t, INT32 tbase, INT32 t
const UINT16 k = ((UINT16*)(userdata->m_tmem + 0x800))[((tpal << 4) | c) << 2];
#if USE_64K_LUT
- return m_expand_16to32_table[k];
+ out.set(m_expand_16to32_table[k]);
#else
- color_t color;
- color.i.r = GET_HI_RGBA16_TMEM(k);
- color.i.g = GET_MED_RGBA16_TMEM(k);
- color.i.b = GET_LOW_RGBA16_TMEM(k);
- color.i.a = (k & 1) * 0xff;
- return color.c;
+ out.set((c & 1) * 0xff, GET_HI_RGBA16_TMEM(c), GET_MED_RGBA16_TMEM(c), GET_LOW_RGBA16_TMEM(c));
#endif
}
-UINT32 n64_texture_pipe_t::fetch_i4_tlut1(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata)
+void n64_texture_pipe_t::fetch_i4_tlut1(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata)
{
const UINT8 *tc = userdata->m_tmem;
const INT32 taddr = ((((tbase << 4) + s) >> 1) ^ sTexAddrSwap8[t & 1]) & 0x7ff;
@@ -1187,14 +987,11 @@ UINT32 n64_texture_pipe_t::fetch_i4_tlut1(INT32 s, INT32 t, INT32 tbase, INT32 t
const UINT8 c = ((s & 1)) ? (byteval & 0xf) : ((byteval >> 4) & 0xf);
const UINT16 k = ((UINT16*)(userdata->m_tmem + 0x800))[((tpal << 4) | c) << 2];
- color_t color;
- color.i.r = color.i.g = color.i.b = (k >> 8) & 0xff;
- color.i.a = k & 0xff;
-
- return color.c;
+ const UINT8 i = (k >> 8) & 0xff;
+ out.set(k & 0xff, i, i, i);
}
-UINT32 n64_texture_pipe_t::fetch_i4_raw(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata)
+void n64_texture_pipe_t::fetch_i4_raw(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata)
{
const UINT8 *tc = userdata->m_tmem;
const INT32 taddr = ((((tbase << 4) + s) >> 1) ^ sTexAddrSwap8[t & 1]) & 0xfff;
@@ -1203,16 +1000,10 @@ UINT32 n64_texture_pipe_t::fetch_i4_raw(INT32 s, INT32 t, INT32 tbase, INT32 tpa
UINT8 c = ((s & 1)) ? (byteval & 0xf) : ((byteval >> 4) & 0xf);
c |= (c << 4);
- color_t color;
- color.i.r = c;
- color.i.g = c;
- color.i.b = c;
- color.i.a = c;
-
- return color.c;
+ out.set(c, c, c, c);
}
-UINT32 n64_texture_pipe_t::fetch_i8_tlut0(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata)
+void n64_texture_pipe_t::fetch_i8_tlut0(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata)
{
const UINT8 *tc = userdata->m_tmem;
const INT32 taddr = (((tbase << 3) + s) ^ sTexAddrSwap8[t & 1]) & 0x7ff;
@@ -1221,18 +1012,13 @@ UINT32 n64_texture_pipe_t::fetch_i8_tlut0(INT32 s, INT32 t, INT32 tbase, INT32 t
const UINT16 k = ((UINT16*)(userdata->m_tmem + 0x800))[c << 2];
#if USE_64K_LUT
- return m_expand_16to32_table[k];
+ out.set(m_expand_16to32_table[k]);
#else
- color_t color;
- color.i.r = GET_HI_RGBA16_TMEM(k);
- color.i.g = GET_MED_RGBA16_TMEM(k);
- color.i.b = GET_LOW_RGBA16_TMEM(k);
- color.i.a = (k & 1) * 0xff;
- return color.c;
+ out.set((c & 1) * 0xff, GET_HI_RGBA16_TMEM(c), GET_MED_RGBA16_TMEM(c), GET_LOW_RGBA16_TMEM(c));
#endif
}
-UINT32 n64_texture_pipe_t::fetch_i8_tlut1(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata)
+void n64_texture_pipe_t::fetch_i8_tlut1(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata)
{
const UINT8 *tc = userdata->m_tmem;
const INT32 taddr = (((tbase << 3) + s) ^ sTexAddrSwap8[t & 1]) & 0x7ff;
@@ -1240,25 +1026,16 @@ UINT32 n64_texture_pipe_t::fetch_i8_tlut1(INT32 s, INT32 t, INT32 tbase, INT32 t
const UINT8 c = tc[taddr];
const UINT16 k = ((UINT16*)(userdata->m_tmem + 0x800))[c << 2];
- color_t color;
- color.i.r = color.i.g = color.i.b = (k >> 8) & 0xff;
- color.i.a = k & 0xff;
-
- return color.c;
+ const UINT8 i = (k >> 8) & 0xff;
+ out.set(k & 0xff, i, i, i);
}
-UINT32 n64_texture_pipe_t::fetch_i8_raw(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata)
+void n64_texture_pipe_t::fetch_i8_raw(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata)
{
const UINT8 *tc = userdata->m_tmem;
const INT32 taddr = (((tbase << 3) + s) ^ sTexAddrSwap8[t & 1]) & 0xfff;
const UINT8 c = tc[taddr];
- color_t color;
- color.i.r = c;
- color.i.g = c;
- color.i.b = c;
- color.i.a = c;
-
- return color.c;
+ out.set(c, c, c, c);
}
diff --git a/src/mame/video/rdptpipe.h b/src/mame/video/rdptpipe.h
index 3142d511b01..81898fb1432 100644
--- a/src/mame/video/rdptpipe.h
+++ b/src/mame/video/rdptpipe.h
@@ -17,23 +17,17 @@
#define _VIDEO_RDPTEXPIPE_H_
#include "emu.h"
-
-struct other_modes_t;
-struct misc_state_t;
-class color_t;
-struct rdp_span_aux;
-struct rdp_poly_state;
-struct n64_tile_t;
+#include "video/n64types.h"
class n64_texture_pipe_t
{
public:
- typedef UINT32 (n64_texture_pipe_t::*texel_fetcher_t) (INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
+ typedef void (n64_texture_pipe_t::*texel_fetcher_t) (rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
typedef void (n64_texture_pipe_t::*texel_cycler_t) (color_t* TEX, color_t* prev, INT32 SSS, INT32 SST, UINT32 tilenum, UINT32 cycle, rdp_span_aux* userdata, const rdp_poly_state& object);
n64_texture_pipe_t()
{
- m_maskbits_table[0] = 0x3ff;
+ m_maskbits_table[0] = 0xffff;
for(int i = 1; i < 16; i++)
{
m_maskbits_table[i] = ((UINT16)(0xffff) >> (16 - i)) & 0x3ff;
@@ -114,57 +108,59 @@ class n64_texture_pipe_t
bool m_start_span;
private:
- void mask(INT32* S, INT32* T, const n64_tile_t& tile);
- void mask_coupled(INT32* S, INT32* S1, INT32* T, INT32* T1, const n64_tile_t& tile);
-
- void shift_cycle(INT32* S, INT32* T, bool* maxs, bool* maxt, const n64_tile_t& tile);
- void shift_copy(INT32* S, INT32* T, const n64_tile_t& tile);
-
- void clamp_cycle(INT32* S, INT32* T, INT32* SFRAC, INT32* TFRAC, const bool maxs, const bool maxt, const INT32 tilenum, const n64_tile_t& tile, rdp_span_aux* userdata);
- void clamp_cycle_light(INT32* S, INT32* T, const bool maxs, const bool maxt, const INT32 tilenum, const n64_tile_t& tile, rdp_span_aux* userdata);
-
- UINT32 fetch_nop(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
-
- UINT32 fetch_rgba16_tlut0(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
- UINT32 fetch_rgba16_tlut1(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
- UINT32 fetch_rgba16_raw(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
- UINT32 fetch_rgba32_tlut0(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
- UINT32 fetch_rgba32_tlut1(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
- UINT32 fetch_rgba32_raw(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
-
- UINT32 fetch_yuv(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
-
- UINT32 fetch_ci4_tlut0(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
- UINT32 fetch_ci4_tlut1(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
- UINT32 fetch_ci4_raw(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
- UINT32 fetch_ci8_tlut0(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
- UINT32 fetch_ci8_tlut1(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
- UINT32 fetch_ci8_raw(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
-
- UINT32 fetch_ia4_tlut0(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
- UINT32 fetch_ia4_tlut1(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
- UINT32 fetch_ia4_raw(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
- UINT32 fetch_ia8_tlut0(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
- UINT32 fetch_ia8_tlut1(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
- UINT32 fetch_ia8_raw(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
- UINT32 fetch_ia16_tlut0(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
- UINT32 fetch_ia16_tlut1(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
- UINT32 fetch_ia16_raw(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
-
- UINT32 fetch_i4_tlut0(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
- UINT32 fetch_i4_tlut1(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
- UINT32 fetch_i4_raw(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
- UINT32 fetch_i8_tlut0(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
- UINT32 fetch_i8_tlut1(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
- UINT32 fetch_i8_raw(INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
+ void mask(rgbaint_t& sstt, const n64_tile_t& tile);
+
+ rgbaint_t shift_cycle(rgbaint_t& st, const n64_tile_t& tile);
+ void shift_copy(rgbaint_t& st, const n64_tile_t& tile);
+
+ void clamp_cycle(rgbaint_t& st, rgbaint_t& stfrac, rgbaint_t& maxst, const INT32 tilenum, const n64_tile_t& tile, rdp_span_aux* userdata);
+ void clamp_cycle_light(rgbaint_t& st, rgbaint_t& maxst, const INT32 tilenum, const n64_tile_t& tile, rdp_span_aux* userdata);
+
+ void fetch_nop(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
+
+ void fetch_rgba16_tlut0(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
+ void fetch_rgba16_tlut1(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
+ void fetch_rgba16_raw(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
+ void fetch_rgba32_tlut0(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
+ void fetch_rgba32_tlut1(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
+ void fetch_rgba32_raw(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
+
+ void fetch_yuv(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
+
+ void fetch_ci4_tlut0(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
+ void fetch_ci4_tlut1(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
+ void fetch_ci4_raw(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
+ void fetch_ci8_tlut0(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
+ void fetch_ci8_tlut1(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
+ void fetch_ci8_raw(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
+
+ void fetch_ia4_tlut0(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
+ void fetch_ia4_tlut1(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
+ void fetch_ia4_raw(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
+ void fetch_ia8_tlut0(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
+ void fetch_ia8_tlut1(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
+ void fetch_ia8_raw(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
+ void fetch_ia16_tlut0(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
+ void fetch_ia16_tlut1(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
+ void fetch_ia16_raw(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
+
+ void fetch_i4_tlut0(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
+ void fetch_i4_tlut1(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
+ void fetch_i4_raw(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
+ void fetch_i8_tlut0(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
+ void fetch_i8_tlut1(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
+ void fetch_i8_raw(rgbaint_t& out, INT32 s, INT32 t, INT32 tbase, INT32 tpal, rdp_span_aux* userdata);
texel_fetcher_t m_texel_fetch[16*5];
n64_rdp* m_rdp;
INT32 m_maskbits_table[16];
- UINT32 m_expand_16to32_table[0x10000];
+ color_t m_expand_16to32_table[0x10000];
UINT16 m_lod_lookup[0x80000];
+
+ rgbaint_t m_st2_add;
+ rgbaint_t m_v1;
};
#endif // _VIDEO_RDPTEXPIPE_H_
diff --git a/src/mame/video/rltennis.c b/src/mame/video/rltennis.c
index 84b0c6514b0..0600a31899f 100644
--- a/src/mame/video/rltennis.c
+++ b/src/mame/video/rltennis.c
@@ -83,7 +83,7 @@ enum
BLT_FLAGS,
BLT_UNK,
BLT_START,
- BLT_UNK2,
+ BLT_UNK2
};
enum
@@ -91,7 +91,7 @@ enum
BITMAP_BG=0,
BITMAP_FG_1,
BITMAP_FG_2,
- BITMAP_FG_DISPLAY,
+ BITMAP_FG_DISPLAY
};
#define BLTFLAG_DST_X_DIR (1<<0)
diff --git a/src/mame/video/segas24.c b/src/mame/video/segas24.c
index 3a9c0f24a6a..f8e19e7aeb5 100644
--- a/src/mame/video/segas24.c
+++ b/src/mame/video/segas24.c
@@ -28,7 +28,7 @@ namespace {
segas24_mixer *mixer;
};
-};
+}
UINT32 segas24_state::screen_update_system24(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
diff --git a/src/mame/video/segas32.c b/src/mame/video/segas32.c
index a967425b98b..65458e8bee9 100644
--- a/src/mame/video/segas32.c
+++ b/src/mame/video/segas32.c
@@ -41,7 +41,8 @@
$31FF00 : w--- ---- ---- ---- : Screen width (0= 320, 1= 412)
---- f--- ---- ---- : Bitmap format (1= 8bpp, 0= 4bpp)
---- -t-- ---- ---- : Tile banking related
- ---- --f- ---- ---- : 1= All layers X+Y flip
+ ---- --f- ---- ---- : 1= Global X/Y flip? (most games?)
+ ---- ---f ---- ---- : 1= prohbit Y flip? (Air Rescue 2nd screen title, also gets set on one of the intro sequence screens)
---- ---- ---- 4--- : 1= X+Y flip for NBG3
---- ---- ---- -2-- : 1= X+Y flip for NBG2
---- ---- ---- --1- : 1= X+Y flip for NBG1
@@ -209,6 +210,9 @@
void segas32_state::common_start(int multi32)
{
+ if(!m_gfxdecode->started())
+ throw device_missing_dependencies();
+
int tmap;
/* remember whether or not we are multi32 */
@@ -245,24 +249,20 @@ void segas32_state::common_start(int multi32)
m_solid_ffff = auto_alloc_array(machine(), UINT16, 512);
memset(m_solid_ffff, 0xff, sizeof(m_solid_ffff[0]) * 512);
+ memset(m_system32_videoram, 0x00, 0x20000);
+
/* initialize videoram */
m_system32_videoram[0x1ff00/2] = 0x8000;
-}
+ memset(m_mixer_control, 0xff, sizeof(m_mixer_control[0][0]) * 0x80 );
-VIDEO_START_MEMBER(segas32_state,system32)
-{
- common_start(0);
-}
-VIDEO_START_MEMBER(segas32_state,multi32)
-{
- common_start(1);
}
+
/*************************************
*
* Sprite management
@@ -832,6 +832,23 @@ int segas32_state::compute_clipping_extents(screen_device &screen, int enable, i
}
+void segas32_state::compute_tilemap_flips(int bgnum, int &flipx, int &flipy)
+{
+ /* determine if we're flipped */
+ int global_flip = (m_system32_videoram[0x1ff00 / 2] >> 9)&1;
+
+ flipx = global_flip;
+ flipy = global_flip;
+
+ int layer_flip = (m_system32_videoram[0x1ff00 / 2] >> bgnum) & 1;
+
+ flipy ^= layer_flip;
+ flipx ^= layer_flip;
+
+ // this bit is set on Air Rescue (screen 2) title screen, during the Air Rescue introduction demo, and in f1en when you win a single player race
+ // it seems to prohibit (at least) the per-tilemap y flipping (maybe global y can override it)
+ if ((m_system32_videoram[0x1ff00 / 2] >> 8) & 1) flipy = 0;
+}
/*************************************
*
@@ -870,7 +887,7 @@ void segas32_state::update_tilemap_zoom(screen_device &screen, struct segas32_st
UINT32 srcx, srcx_start, srcy;
UINT32 srcxstep, srcystep;
int dstxstep, dstystep;
- int flip, opaque;
+ int opaque;
int x, y;
/* get the tilemaps */
@@ -881,9 +898,10 @@ void segas32_state::update_tilemap_zoom(screen_device &screen, struct segas32_st
//opaque = (m_system32_videoram[0x1ff8e/2] >> (8 + bgnum)) & 1;
//if (screen.machine().input().code_pressed(KEYCODE_Z) && bgnum == 0) opaque = 1;
//if (screen.machine().input().code_pressed(KEYCODE_X) && bgnum == 1) opaque = 1;
+ int flipx, flipy;
- /* determine if we're flipped */
- flip = ((m_system32_videoram[0x1ff00/2] >> 9) ^ (m_system32_videoram[0x1ff00/2] >> bgnum)) & 1;
+ // todo determine flipping
+ compute_tilemap_flips(bgnum, flipx, flipy);
/* determine the clipping */
clipenable = (m_system32_videoram[0x1ff02/2] >> (11 + bgnum)) & 1;
@@ -923,16 +941,22 @@ void segas32_state::update_tilemap_zoom(screen_device &screen, struct segas32_st
srcy += cliprect.min_y * srcystep;
/* if we're flipped, simply adjust the start/step parameters */
- if (flip)
+ if (flipy)
{
const rectangle &visarea = screen.visible_area();
- srcx_start += (visarea.max_x - 2 * cliprect.min_x) * srcxstep;
srcy += (visarea.max_y - 2 * cliprect.min_y) * srcystep;
- srcxstep = -srcxstep;
srcystep = -srcystep;
}
+ if (flipx)
+ {
+ const rectangle &visarea = screen.visible_area();
+
+ srcx_start += (visarea.max_x - 2 * cliprect.min_x) * srcxstep;
+ srcxstep = -srcxstep;
+ }
+
/* loop over the target rows */
for (y = cliprect.min_y; y <= cliprect.max_y; y++)
{
@@ -1013,6 +1037,7 @@ void segas32_state::update_tilemap_zoom(screen_device &screen, struct segas32_st
*
*************************************/
+
void segas32_state::update_tilemap_rowscroll(screen_device &screen, struct segas32_state::layer_info *layer, const rectangle &cliprect, int bgnum)
{
int clipenable, clipout, clips, clipdraw_start;
@@ -1023,7 +1048,7 @@ void segas32_state::update_tilemap_rowscroll(screen_device &screen, struct segas
int xscroll, yscroll;
UINT16 *table;
int srcx, srcy;
- int flip, opaque;
+ int opaque;
int x, y;
/* get the tilemaps */
@@ -1035,8 +1060,11 @@ void segas32_state::update_tilemap_rowscroll(screen_device &screen, struct segas
//if (screen.machine().input().code_pressed(KEYCODE_C) && bgnum == 2) opaque = 1;
//if (screen.machine().input().code_pressed(KEYCODE_V) && bgnum == 3) opaque = 1;
- /* determine if we're flipped */
- flip = ((m_system32_videoram[0x1ff00/2] >> 9) ^ (m_system32_videoram[0x1ff00/2] >> bgnum)) & 1;
+ int flipx, flipy;
+
+ // todo determine flipping
+ compute_tilemap_flips(bgnum, flipx, flipy);
+
/* determine the clipping */
clipenable = (m_system32_videoram[0x1ff02/2] >> (11 + bgnum)) & 1;
@@ -1072,37 +1100,34 @@ void segas32_state::update_tilemap_rowscroll(screen_device &screen, struct segas
int srcxstep;
/* if we're not flipped, things are straightforward */
- if (!flip)
+ if (!flipx)
{
- /* get starting scroll values */
srcx = cliprect.min_x + xscroll;
- srcxstep = 1;
- srcy = yscroll + y;
-
- /* apply row scroll/select */
- if (rowscroll)
- srcx += table[0x000 + 0x100 * (bgnum - 2) + y] & 0x3ff;
- if (rowselect)
- srcy = (yscroll + table[0x200 + 0x100 * (bgnum - 2) + y]) & 0x1ff;
+ srcxstep = 1;
+ }
+ else
+ {
+ srcx = cliprect.max_x + xscroll;
+ srcxstep = -1;
}
- /* otherwise, we have to do some contortions */
+ if (!flipy)
+ {
+ srcy = yscroll + y;
+ }
else
{
const rectangle &visarea = screen.visible_area();
-
- /* get starting scroll values */
- srcx = cliprect.max_x + xscroll;
- srcxstep = -1;
srcy = yscroll + visarea.max_y - y;
-
- /* apply row scroll/select */
- if (rowscroll)
- srcx += table[0x000 + 0x100 * (bgnum - 2) + y] & 0x3ff;
- if (rowselect)
- srcy = (yscroll + table[0x200 + 0x100 * (bgnum - 2) + y]) & 0x1ff;
}
+ /* apply row scroll/select */
+ if (rowscroll)
+ srcx += table[0x000 + 0x100 * (bgnum - 2) + y] & 0x3ff;
+ if (rowselect)
+ srcy = (yscroll + table[0x200 + 0x100 * (bgnum - 2) + y]) & 0x1ff;
+
+
/* look up the pages and get their source pixmaps */
bitmap_ind16 &tm0 = tilemaps[((srcy >> 7) & 2) + 0]->pixmap();
bitmap_ind16 &tm1 = tilemaps[((srcy >> 7) & 2) + 1]->pixmap();
diff --git a/src/mame/video/seta.c b/src/mame/video/seta.c
index 9b2367532b3..fa82df8d97b 100644
--- a/src/mame/video/seta.c
+++ b/src/mame/video/seta.c
@@ -144,8 +144,8 @@ Note: if MAME_DEBUG is defined, pressing Z with:
static const game_offset game_offsets[] =
{
/* only sprites */
- { "tndrcade", { -1, 0 } }, // correct (wall at beginning of game)
- { "tndrcadej",{ -1, 0 } }, // "
+ { "tndrcade", { 0, 0 } }, // correct (start grid, wall at beginning of game)
+ { "tndrcadej",{ 0, 0 } }, // "
{ "wits", { 0, 0 } }, // unknown
{ "thunderl", { 0, 0 } }, // unknown
{ "wiggie", { 0, 0 } }, // some problems but they seem y co-ordinate related?
@@ -185,20 +185,22 @@ static const game_offset game_offsets[] =
{ "blandia", { 0, 8 }, { -2, 6 } }, // correct (test grid, startup bg)
{ "blandiap", { 0, 8 }, { -2, 6 } }, // "
{ "zingzip", { 0, 0 }, { -1, -2 } }, // sprites unknown, tilemaps correct (test grid)
- { "eightfrc", { 3, 4 }, { 0, 0 } }, // unknown
- { "daioh", { 1, 1 }, { -1, -1 } }, // correct? (launch window and test grid are right, but planet is wrong)
- { "daioha", { 1, 1 }, { -1, -1 } }, // "
+ { "eightfrc", { 3, 4 }, { 0, 0 } }, // correct (test mode)
+ { "daioh", { 0, 0 }, { -1, -1 } }, // correct (test grid, planet)
+ { "daioha", { 0, 0 }, { -1, -1 } }, // "
+ { "daiohc", { 0, 0 }, { -1, -1 } }, // "
+ { "daiohp", { 0, 0 }, { -1, -1 } }, // "
{ "msgundam", { 0, 0 }, { -2, -2 } }, // correct (test grid, banpresto logo)
{ "msgundam1",{ 0, 0 }, { -2, -2 } }, // "
{ "oisipuzl", { 1, 1 }, { -1, -1 } }, // correct (test mode) flip screen not supported?
{ "triplfun", { 1, 1 }, { -1, -1 } }, // "
- { "wrofaero", { 0, 0 }, { 0, 0 } }, // unknown
+ { "wrofaero", { 0, 0 }, { 0, 0 } }, // correct (test mode)
{ "jjsquawk", { 1, 1 }, { -1, -1 } }, // correct (test mode)
{ "jjsquawkb",{ 1, 1 }, { -1, -1 } }, // "
{ "kamenrid", { 0, 0 }, { -2, -2 } }, // correct (map, banpresto logo)
{ "extdwnhl", { 0, 0 }, { -2, -2 } }, // correct (test grid, background images)
{ "sokonuke", { 0, 0 }, { -2, -2 } }, // correct (game selection, test grid)
- { "gundhara", { 0, 0 }, { 0, 0 } }, // unknown, flip screen not supported?
+ { "gundhara", { 0, 0 }, { 0, 0 } }, // correct (test mode)
{ "zombraid", { 0, 0 }, { -2, -2 } }, // correct for normal, flip screen not working yet
{ "zombraidp", { 0, 0 }, { -2, -2 } }, // correct for normal, flip screen not working yet
{ "zombraidpj", { 0, 0 }, { -2, -2 } }, // correct for normal, flip screen not working yet
@@ -550,7 +552,8 @@ VIDEO_START_MEMBER(seta_state,seta_no_layers)
// position kludges
m_seta001->set_fg_xoffsets(m_global_offsets->sprite_offs[1], m_global_offsets->sprite_offs[0]);
- m_seta001->set_fg_yoffsets( -0x0a, 0x0e );
+ m_seta001->set_fg_yoffsets( -0x12, 0x0e );
+ m_seta001->set_bg_yoffsets( 0x1, -0x1 );
}
diff --git a/src/mame/video/shisen.c b/src/mame/video/shisen.c
index 411137174ba..09b44481daa 100644
--- a/src/mame/video/shisen.c
+++ b/src/mame/video/shisen.c
@@ -3,26 +3,21 @@
#include "emu.h"
#include "includes/shisen.h"
-WRITE8_MEMBER(shisen_state::sichuan2_videoram_w)
+WRITE8_MEMBER(shisen_state::videoram_w)
{
m_videoram[offset] = data;
m_bg_tilemap->mark_tile_dirty(offset / 2);
}
-WRITE8_MEMBER(shisen_state::sichuan2_bankswitch_w)
+WRITE8_MEMBER(shisen_state::bankswitch_w)
{
- int bankaddress;
- int bank;
- UINT8 *RAM = memregion("maincpu")->base();
-
if (data & 0xc0) logerror("bank switch %02x\n",data);
/* bits 0-2 select ROM bank */
- bankaddress = 0x10000 + (data & 0x07) * 0x4000;
- membank("bank1")->set_base(&RAM[bankaddress]);
+ membank("bank1")->set_entry(data & 0x07);
/* bits 3-5 select gfx bank */
- bank = (data & 0x38) >> 3;
+ int bank = (data & 0x38) >> 3;
if (m_gfxbank != bank)
{
@@ -33,7 +28,7 @@ WRITE8_MEMBER(shisen_state::sichuan2_bankswitch_w)
/* bits 6-7 unknown */
}
-WRITE8_MEMBER(shisen_state::sichuan2_paletteram_w)
+WRITE8_MEMBER(shisen_state::paletteram_w)
{
m_paletteram[offset] = data;
@@ -55,9 +50,13 @@ void shisen_state::video_start()
{
m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(shisen_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS,
8, 8, 64, 32);
+
+ membank("bank1")->configure_entries(0, 8, memregion("maincpu")->base() + 0x10000, 0x4000);
+
+ save_item(NAME(m_gfxbank));
}
-UINT32 shisen_state::screen_update_sichuan2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+UINT32 shisen_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
// on Irem boards, screen flip is handled in both hardware and software.
// this game doesn't have cocktail mode so if there's software control we don't
diff --git a/src/mame/video/slapshot.c b/src/mame/video/slapshot.c
index 78dffc81df3..f470e3d606b 100644
--- a/src/mame/video/slapshot.c
+++ b/src/mame/video/slapshot.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:David Graves
#include "emu.h"
#include "includes/slapshot.h"
diff --git a/src/mame/video/snk68.c b/src/mame/video/snk68.c
index 520365b070e..7cc4faf59b0 100644
--- a/src/mame/video/snk68.c
+++ b/src/mame/video/snk68.c
@@ -53,9 +53,7 @@ TILE_GET_INFO_MEMBER(snk68_state::get_searchar_tile_info)
void snk68_state::common_video_start()
{
m_fg_tilemap->set_transparent_pen(0);
-
- m_fg_tilemap->set_scrolldx(0, m_screen->width() - 256);
- m_fg_tilemap->set_scrolldy(0, m_screen->height() - 256);
+ save_item(NAME(m_sprite_flip_axis));
}
void snk68_state::video_start()
@@ -64,6 +62,8 @@ void snk68_state::video_start()
m_fg_tile_offset = 0;
common_video_start();
+
+ save_item(NAME(m_fg_tile_offset));
}
VIDEO_START_MEMBER(snk68_state,searchar)
@@ -79,7 +79,7 @@ VIDEO_START_MEMBER(snk68_state,searchar)
***************************************************************************/
-READ16_MEMBER(snk68_state::pow_spriteram_r)
+READ16_MEMBER(snk68_state::spriteram_r)
{
// streetsj expects the MSB of every 32-bit word to be FF. Presumably RAM
// exists only for 3 bytes out of 4 and the fourth is unmapped.
@@ -89,24 +89,23 @@ READ16_MEMBER(snk68_state::pow_spriteram_r)
return m_spriteram[offset];
}
-WRITE16_MEMBER(snk68_state::pow_spriteram_w)
+WRITE16_MEMBER(snk68_state::spriteram_w)
{
- UINT16 *spriteram16 = m_spriteram;
- UINT16 newword = spriteram16[offset];
+ UINT16 newword = m_spriteram[offset];
if (!(offset & 1))
data |= 0xff00;
COMBINE_DATA(&newword);
- if (spriteram16[offset] != newword)
+ if (m_spriteram[offset] != newword)
{
int vpos = m_screen->vpos();
if (vpos > 0)
m_screen->update_partial(vpos - 1);
- spriteram16[offset] = newword;
+ m_spriteram[offset] = newword;
}
}
@@ -130,12 +129,11 @@ WRITE16_MEMBER(snk68_state::searchar_fg_videoram_w)
m_fg_tilemap->mark_tile_dirty(offset >> 1);
}
-WRITE16_MEMBER(snk68_state::pow_flipscreen16_w)
+WRITE16_MEMBER(snk68_state::pow_flipscreen_w)
{
if (ACCESSING_BITS_0_7)
{
- m_flipscreen = data & 0x08;
- machine().tilemap().set_flip_all(m_flipscreen ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
+ flip_screen_set(data & 0x08);
m_sprite_flip_axis = data & 0x04; // for streetsm? though might not be present on this board
@@ -147,32 +145,15 @@ WRITE16_MEMBER(snk68_state::pow_flipscreen16_w)
}
}
-WRITE16_MEMBER(snk68_state::searchar_flipscreen16_w)
+WRITE16_MEMBER(snk68_state::searchar_flipscreen_w)
{
if (ACCESSING_BITS_0_7)
{
- m_flipscreen = data & 0x08;
- machine().tilemap().set_flip_all(m_flipscreen ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0);
-
+ flip_screen_set(data & 0x08);
m_sprite_flip_axis = data & 0x04;
}
}
-WRITE16_MEMBER(snk68_state::pow_paletteram16_word_w)
-{
- UINT16 newword;
- int r,g,b;
-
- COMBINE_DATA(&m_paletteram[offset]);
- newword = m_paletteram[offset];
-
- r = ((newword >> 7) & 0x1e) | ((newword >> 14) & 0x01);
- g = ((newword >> 3) & 0x1e) | ((newword >> 13) & 0x01) ;
- b = ((newword << 1) & 0x1e) | ((newword >> 12) & 0x01) ;
-
- m_palette->set_pen_color(offset,pal5bit(r),pal5bit(g),pal5bit(b));
-}
-
/***************************************************************************
@@ -182,21 +163,18 @@ WRITE16_MEMBER(snk68_state::pow_paletteram16_word_w)
void snk68_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int group)
{
- UINT16 *spriteram16 = m_spriteram;
- int flipscreen = m_flipscreen;
- int sprite_flip_axis = m_sprite_flip_axis;
- const UINT16* tiledata = &spriteram16[0x800*group];
+ const UINT16* tiledata = &m_spriteram[0x800*group];
// pow has 0x4000 tiles and independent x/y flipping
// the other games have > 0x4000 tiles and flipping in only one direction
// (globally selected)
- int const is_pow = (m_gfxdecode->gfx(1)->elements() <= 0x4000);
- int offs;
+ bool const is_pow = (m_gfxdecode->gfx(1)->elements() <= 0x4000);
+ bool const flip = flip_screen();
- for (offs = 0; offs < 0x800; offs += 0x40)
+ for (int offs = 0; offs < 0x800; offs += 0x40)
{
- int mx = (spriteram16[offs + 2*group] & 0xff) << 4;
- int my = spriteram16[offs + 2*group + 1];
+ int mx = (m_spriteram[offs + 2*group] & 0xff) << 4;
+ int my = m_spriteram[offs + 2*group + 1];
int i;
mx = mx | (my >> 12);
@@ -204,7 +182,7 @@ void snk68_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect,
mx = ((mx + 16) & 0x1ff) - 16;
my = -my;
- if (flipscreen)
+ if (flip)
{
mx = 240 - mx;
my = 240 - my;
@@ -229,7 +207,7 @@ void snk68_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect,
}
else
{
- if (sprite_flip_axis)
+ if (m_sprite_flip_axis)
{
fx = 0;
fy = tile & 0x8000;
@@ -242,7 +220,7 @@ void snk68_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect,
tile &= 0x7fff;
}
- if (flipscreen)
+ if (flip)
{
fx = !fx;
fy = !fy;
@@ -259,7 +237,7 @@ void snk68_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect,
tiledata += 2;
}
- if (flipscreen)
+ if (flip)
my -= 16;
else
my += 16;
@@ -268,7 +246,7 @@ void snk68_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect,
}
-UINT32 snk68_state::screen_update_pow(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+UINT32 snk68_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
bitmap.fill(0x7ff, cliprect);
diff --git a/src/mame/video/spacefb.c b/src/mame/video/spacefb.c
index d5a829aaee2..c663655dc32 100644
--- a/src/mame/video/spacefb.c
+++ b/src/mame/video/spacefb.c
@@ -17,14 +17,14 @@
*
*************************************/
-WRITE8_MEMBER(spacefb_state::spacefb_port_0_w)
+WRITE8_MEMBER(spacefb_state::port_0_w)
{
m_screen->update_now();
m_port_0 = data;
}
-WRITE8_MEMBER(spacefb_state::spacefb_port_2_w)
+WRITE8_MEMBER(spacefb_state::port_2_w)
{
m_screen->update_now();
m_port_2 = data;
@@ -88,6 +88,11 @@ void spacefb_state::video_start()
but most likely, the actual star position is random as the hardware
uses whatever value is on the shift register on power-up */
m_star_shift_reg = 0x18f89;
+
+ save_pointer(NAME(m_object_present_map), width * height);
+ save_item(NAME(m_port_0));
+ save_item(NAME(m_port_2));
+ save_item(NAME(m_star_shift_reg));
}
@@ -391,7 +396,7 @@ void spacefb_state::draw_objects(bitmap_rgb32 &bitmap, const rectangle &cliprect
*
*************************************/
-UINT32 spacefb_state::screen_update_spacefb(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
+UINT32 spacefb_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
draw_objects(bitmap, cliprect);
draw_starfield(screen, bitmap, cliprect);
diff --git a/src/mame/video/spdodgeb.c b/src/mame/video/spdodgeb.c
index 4c2ea801c7a..79fdef1cfa6 100644
--- a/src/mame/video/spdodgeb.c
+++ b/src/mame/video/spdodgeb.c
@@ -8,10 +8,8 @@
PALETTE_INIT_MEMBER(spdodgeb_state, spdodgeb)
{
const UINT8 *color_prom = memregion("proms")->base();
- int i;
-
- for (i = 0;i < palette.entries();i++)
+ for (int i = 0;i < palette.entries();i++)
{
int bit0,bit1,bit2,bit3,r,g,b;
@@ -73,6 +71,12 @@ TILE_GET_INFO_MEMBER(spdodgeb_state::get_bg_tile_info)
void spdodgeb_state::video_start()
{
m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(spdodgeb_state::get_bg_tile_info),this),tilemap_mapper_delegate(FUNC(spdodgeb_state::background_scan),this),8,8,64,32);
+
+ membank("mainbank")->configure_entries(0, 2, memregion("maincpu")->base() + 0x10000, 0x4000);
+
+ save_item(NAME(m_tile_palbank));
+ save_item(NAME(m_sprite_palbank));
+ save_item(NAME(m_lastscroll));
}
@@ -83,7 +87,7 @@ void spdodgeb_state::video_start()
***************************************************************************/
-TIMER_DEVICE_CALLBACK_MEMBER(spdodgeb_state::spdodgeb_interrupt)
+TIMER_DEVICE_CALLBACK_MEMBER(spdodgeb_state::interrupt)
{
int scanline = param;
@@ -99,20 +103,18 @@ TIMER_DEVICE_CALLBACK_MEMBER(spdodgeb_state::spdodgeb_interrupt)
}
}
-WRITE8_MEMBER(spdodgeb_state::spdodgeb_scrollx_lo_w)
+WRITE8_MEMBER(spdodgeb_state::scrollx_lo_w)
{
m_lastscroll = (m_lastscroll & 0x100) | data;
}
-WRITE8_MEMBER(spdodgeb_state::spdodgeb_ctrl_w)
+WRITE8_MEMBER(spdodgeb_state::ctrl_w)
{
- UINT8 *rom = memregion("maincpu")->base();
-
/* bit 0 = flip screen */
flip_screen_set(data & 0x01);
/* bit 1 = ROM bank switch */
- membank("bank1")->set_base(rom + 0x10000 + 0x4000 * ((~data & 0x02) >> 1));
+ membank("mainbank")->set_entry((~data & 0x02) >> 1);
/* bit 2 = scroll high bit */
m_lastscroll = (m_lastscroll & 0x0ff) | ((data & 0x04) << 6);
@@ -128,7 +130,7 @@ WRITE8_MEMBER(spdodgeb_state::spdodgeb_ctrl_w)
m_sprite_palbank = (data & 0xc0) >> 6;
}
-WRITE8_MEMBER(spdodgeb_state::spdodgeb_videoram_w)
+WRITE8_MEMBER(spdodgeb_state::videoram_w)
{
m_videoram[offset] = data;
m_bg_tilemap->mark_tile_dirty(offset & 0x7ff);
@@ -148,22 +150,17 @@ WRITE8_MEMBER(spdodgeb_state::spdodgeb_videoram_w)
void spdodgeb_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect )
{
- UINT8 *spriteram = m_spriteram;
gfx_element *gfx = m_gfxdecode->gfx(1);
- UINT8 *src;
- int i;
-
- src = spriteram;
/* 240-SY Z|F|CLR|WCH WHICH SX
xxxxxxxx x|x|xxx|xxx xxxxxxxx xxxxxxxx
*/
- for (i = 0;i < m_spriteram.bytes();i += 4)
+ for (int i = 0;i < m_spriteram.bytes();i += 4)
{
- int attr = src[i+1];
- int which = src[i+2]+((attr & 0x07)<<8);
- int sx = src[i+3];
- int sy = 240 - src[i];
+ int attr = m_spriteram[i+1];
+ int which = m_spriteram[i+2]+((attr & 0x07)<<8);
+ int sx = m_spriteram[i+3];
+ int sy = 240 - m_spriteram[i];
int size = (attr & 0x80) >> 7;
int color = (attr & 0x38) >> 3;
int flipx = ~attr & 0x40;
@@ -203,7 +200,7 @@ void spdodgeb_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprec
#undef DRAW_SPRITE
-UINT32 spdodgeb_state::screen_update_spdodgeb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+UINT32 spdodgeb_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
m_bg_tilemap->set_scrollx(0,m_lastscroll+5);
m_bg_tilemap->draw(screen, bitmap, cliprect, 0,0);
diff --git a/src/mame/video/sprcros2.c b/src/mame/video/sprcros2.c
index c1745e0e8e1..a64da9bfafc 100644
--- a/src/mame/video/sprcros2.c
+++ b/src/mame/video/sprcros2.c
@@ -59,19 +59,19 @@ PALETTE_INIT_MEMBER(sprcros2_state, sprcros2)
}
}
-WRITE8_MEMBER(sprcros2_state::sprcros2_fgvideoram_w)
+WRITE8_MEMBER(sprcros2_state::fgvideoram_w)
{
m_fgvideoram[offset] = data;
m_fgtilemap->mark_tile_dirty(offset&0x3ff);
}
-WRITE8_MEMBER(sprcros2_state::sprcros2_bgvideoram_w)
+WRITE8_MEMBER(sprcros2_state::bgvideoram_w)
{
m_bgvideoram[offset] = data;
m_bgtilemap->mark_tile_dirty(offset&0x3ff);
}
-WRITE8_MEMBER(sprcros2_state::sprcros2_bgscrollx_w)
+WRITE8_MEMBER(sprcros2_state::bgscrollx_w)
{
if(m_port7&0x02)
m_bgtilemap->set_scrollx(0, 0x100-data);
@@ -79,12 +79,12 @@ WRITE8_MEMBER(sprcros2_state::sprcros2_bgscrollx_w)
m_bgtilemap->set_scrollx(0, data);
}
-WRITE8_MEMBER(sprcros2_state::sprcros2_bgscrolly_w)
+WRITE8_MEMBER(sprcros2_state::bgscrolly_w)
{
m_bgtilemap->set_scrolly(0, data);
}
-TILE_GET_INFO_MEMBER(sprcros2_state::get_sprcros2_bgtile_info)
+TILE_GET_INFO_MEMBER(sprcros2_state::get_bgtile_info)
{
UINT32 tile_number = m_bgvideoram[tile_index];
UINT8 attr = m_bgvideoram[tile_index + 0x400];
@@ -103,7 +103,7 @@ TILE_GET_INFO_MEMBER(sprcros2_state::get_sprcros2_bgtile_info)
(attr&0x08)?TILE_FLIPX:0);
}
-TILE_GET_INFO_MEMBER(sprcros2_state::get_sprcros2_fgtile_info)
+TILE_GET_INFO_MEMBER(sprcros2_state::get_fgtile_info)
{
UINT32 tile_number = m_fgvideoram[tile_index];
UINT8 attr = m_fgvideoram[tile_index + 0x400];
@@ -126,8 +126,8 @@ TILE_GET_INFO_MEMBER(sprcros2_state::get_sprcros2_fgtile_info)
void sprcros2_state::video_start()
{
- m_bgtilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(sprcros2_state::get_sprcros2_bgtile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
- m_fgtilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(sprcros2_state::get_sprcros2_fgtile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_bgtilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(sprcros2_state::get_bgtile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
+ m_fgtilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(sprcros2_state::get_fgtile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
m_fgtilemap->configure_groups(*m_gfxdecode->gfx(2), 0);
}
@@ -178,7 +178,7 @@ void sprcros2_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect
}
}
-UINT32 sprcros2_state::screen_update_sprcros2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+UINT32 sprcros2_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
m_bgtilemap->draw(screen, bitmap, cliprect, 0, 0);
draw_sprites(bitmap, cliprect);
diff --git a/src/mame/video/srmp2.c b/src/mame/video/srmp2.c
index 0b1d8252fb4..8970d15dd3c 100644
--- a/src/mame/video/srmp2.c
+++ b/src/mame/video/srmp2.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Yochizo, Takahiro Nogi
/***************************************************************************
diff --git a/src/mame/video/starcrus.c b/src/mame/video/starcrus.c
index ca77db7227b..69a080d653a 100644
--- a/src/mame/video/starcrus.c
+++ b/src/mame/video/starcrus.c
@@ -10,14 +10,14 @@
/* The collision detection techniques use in this driver
are well explained in the comments in the sprint2 driver */
-WRITE8_MEMBER(starcrus_state::starcrus_s1_x_w){ m_s1_x = data^0xff; }
-WRITE8_MEMBER(starcrus_state::starcrus_s1_y_w){ m_s1_y = data^0xff; }
-WRITE8_MEMBER(starcrus_state::starcrus_s2_x_w){ m_s2_x = data^0xff; }
-WRITE8_MEMBER(starcrus_state::starcrus_s2_y_w){ m_s2_y = data^0xff; }
-WRITE8_MEMBER(starcrus_state::starcrus_p1_x_w){ m_p1_x = data^0xff; }
-WRITE8_MEMBER(starcrus_state::starcrus_p1_y_w){ m_p1_y = data^0xff; }
-WRITE8_MEMBER(starcrus_state::starcrus_p2_x_w){ m_p2_x = data^0xff; }
-WRITE8_MEMBER(starcrus_state::starcrus_p2_y_w){ m_p2_y = data^0xff; }
+WRITE8_MEMBER(starcrus_state::s1_x_w){ m_s1_x = data^0xff; }
+WRITE8_MEMBER(starcrus_state::s1_y_w){ m_s1_y = data^0xff; }
+WRITE8_MEMBER(starcrus_state::s2_x_w){ m_s2_x = data^0xff; }
+WRITE8_MEMBER(starcrus_state::s2_y_w){ m_s2_y = data^0xff; }
+WRITE8_MEMBER(starcrus_state::p1_x_w){ m_p1_x = data^0xff; }
+WRITE8_MEMBER(starcrus_state::p1_y_w){ m_p1_y = data^0xff; }
+WRITE8_MEMBER(starcrus_state::p2_x_w){ m_p2_x = data^0xff; }
+WRITE8_MEMBER(starcrus_state::p2_y_w){ m_p2_y = data^0xff; }
void starcrus_state::video_start()
{
@@ -26,9 +26,33 @@ void starcrus_state::video_start()
m_proj1_vid = auto_bitmap_ind16_alloc(machine(), 16, 16);
m_proj2_vid = auto_bitmap_ind16_alloc(machine(), 16, 16);
+
+ save_item(NAME(m_s1_x));
+ save_item(NAME(m_s1_y));
+ save_item(NAME(m_s2_x));
+ save_item(NAME(m_s2_y));
+ save_item(NAME(m_p1_x));
+ save_item(NAME(m_p1_y));
+ save_item(NAME(m_p2_x));
+ save_item(NAME(m_p2_y));
+ save_item(NAME(m_p1_sprite));
+ save_item(NAME(m_p2_sprite));
+ save_item(NAME(m_s1_sprite));
+ save_item(NAME(m_s2_sprite));
+ save_item(NAME(m_engine1_on));
+ save_item(NAME(m_engine2_on));
+ save_item(NAME(m_explode1_on));
+ save_item(NAME(m_explode2_on));
+ save_item(NAME(m_launch1_on));
+ save_item(NAME(m_launch2_on));
+ save_item(NAME(m_collision_reg));
+ save_item(NAME(m_engine_sound_playing));
+ save_item(NAME(m_explode_sound_playing));
+ save_item(NAME(m_launch1_sound_playing));
+ save_item(NAME(m_launch2_sound_playing));
}
-WRITE8_MEMBER(starcrus_state::starcrus_ship_parm_1_w)
+WRITE8_MEMBER(starcrus_state::ship_parm_1_w)
{
m_s1_sprite = data&0x1f;
m_engine1_on = ((data&0x20)>>5)^0x01;
@@ -51,7 +75,7 @@ WRITE8_MEMBER(starcrus_state::starcrus_ship_parm_1_w)
}
}
-WRITE8_MEMBER(starcrus_state::starcrus_ship_parm_2_w)
+WRITE8_MEMBER(starcrus_state::ship_parm_2_w)
{
m_s2_sprite = data&0x1f;
set_led_status(machine(), 2,~data & 0x80); /* game over lamp */
@@ -77,7 +101,7 @@ WRITE8_MEMBER(starcrus_state::starcrus_ship_parm_2_w)
}
-WRITE8_MEMBER(starcrus_state::starcrus_proj_parm_1_w)
+WRITE8_MEMBER(starcrus_state::proj_parm_1_w)
{
m_p1_sprite = data&0x0f;
m_launch1_on = ((data&0x20)>>5)^0x01;
@@ -114,7 +138,7 @@ WRITE8_MEMBER(starcrus_state::starcrus_proj_parm_1_w)
}
}
-WRITE8_MEMBER(starcrus_state::starcrus_proj_parm_2_w)
+WRITE8_MEMBER(starcrus_state::proj_parm_2_w)
{
m_p2_sprite = data&0x0f;
m_launch2_on = ((data&0x20)>>5)^0x01;
@@ -390,7 +414,7 @@ int starcrus_state::collision_check_s2p1p2()
return 0;
}
-UINT32 starcrus_state::screen_update_starcrus(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+UINT32 starcrus_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
bitmap.fill(0, cliprect);
@@ -465,7 +489,7 @@ UINT32 starcrus_state::screen_update_starcrus(screen_device &screen, bitmap_ind1
return 0;
}
-READ8_MEMBER(starcrus_state::starcrus_coll_det_r)
+READ8_MEMBER(starcrus_state::coll_det_r)
{
return m_collision_reg ^ 0xff;
}
diff --git a/src/mame/video/suna8.c b/src/mame/video/suna8.c
index da80dfedab8..df18140d405 100644
--- a/src/mame/video/suna8.c
+++ b/src/mame/video/suna8.c
@@ -381,7 +381,7 @@ void suna8_state::draw_normal_sprites(bitmap_ind16 &bitmap,const rectangle &clip
m_gfxdecode->gfx(which)->transpen(bitmap,cliprect,
tile + (attr & 0x3)*0x100 + gfxbank,
- (((attr >> 2) & 0xf) | colorbank) + 0x10 * m_palettebank, // hardhea2 player2
+ (((attr >> 2) & 0xf) ^ colorbank) + 0x10 * m_palettebank, // player2 in hardhea2 and sparkman
tile_flipx, tile_flipy,
sx, sy, 0xf);
}
diff --git a/src/mame/video/superchs.c b/src/mame/video/superchs.c
index 171ebd697e4..fe42cfbdd9b 100644
--- a/src/mame/video/superchs.c
+++ b/src/mame/video/superchs.c
@@ -1,11 +1,11 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Bryan McPhail, David Graves
#include "emu.h"
#include "includes/superchs.h"
void superchs_state::video_start()
{
- m_spritelist = auto_alloc_array(machine(), struct tempsprite, 0x4000);
+ m_spritelist = auto_alloc_array(machine(), struct schs_tempsprite, 0x4000);
}
/************************************************************
@@ -67,7 +67,7 @@ void superchs_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap,co
/* pdrawgfx() needs us to draw sprites front to back, so we have to build a list
while processing sprite ram and then draw them all at the end */
- struct tempsprite *sprite_ptr = m_spritelist;
+ struct schs_tempsprite *sprite_ptr = m_spritelist;
for (offs = (m_spriteram.bytes()/4-4);offs >= 0;offs -= 4)
{
diff --git a/src/mame/video/taito_f2.c b/src/mame/video/taito_f2.c
index 0fc366488ac..9c073b6891d 100644
--- a/src/mame/video/taito_f2.c
+++ b/src/mame/video/taito_f2.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:David Graves, Bryan McPhail, Brad Oliver, Andrew Prime, Brian Troha, Nicola Salmoria
#include "emu.h"
#include "includes/taito_f2.h"
diff --git a/src/mame/video/taito_h.c b/src/mame/video/taito_h.c
index 97a34a95d1f..80c6f8522dd 100644
--- a/src/mame/video/taito_h.c
+++ b/src/mame/video/taito_h.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Yochizo
/***************************************************************************
diff --git a/src/mame/video/taito_z.c b/src/mame/video/taito_z.c
index 13ca87b78f5..0b040bad155 100644
--- a/src/mame/video/taito_z.c
+++ b/src/mame/video/taito_z.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:David Graves
#include "emu.h"
#include "includes/taito_z.h"
diff --git a/src/mame/video/taitoair.c b/src/mame/video/taitoair.c
index 6993721bbd5..16af0809cd7 100644
--- a/src/mame/video/taitoair.c
+++ b/src/mame/video/taitoair.c
@@ -70,11 +70,20 @@ static const int zoomy_conv_table[] =
Screen refresh
***************************************************************************/
-void taitoair_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int priority )
+int taitoair_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect )
+{
+ return draw_sprites(bitmap,cliprect, 0x3f8 / 2);
+}
+
+/*!
+ @param start_offset DMA sprite offset source
+ @return value acquired by a pause flag acquisition.
+ */
+int taitoair_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int start_offset )
{
/* Y chain size is 16/32?/64/64? pixels. X chain size
is always 64 pixels. */
-
+ //const UINT16 stop_values[4] = { 0xc00, 0, 0, 0 };
address_space &space = machine().driver_data()->generic_space();
static const int size[] = { 1, 2, 4, 4 };
int x0, y0, x, y, dx, dy, ex, ey, zx, zy;
@@ -84,12 +93,19 @@ void taitoair_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &clipre
int tile_offs; /* sprite chain offset */
int zoomx, zoomy; /* zoom value */
- for (offs = 0x03f8 / 2; offs >= 0; offs -= 0x008 / 2)
+ for (offs = start_offset; offs >= 0; offs -= 0x008 / 2)
{
- /* TODO: remove this aberration of nature */
- if (offs < 0x01b0 && priority == 0) continue;
- if (offs >= 0x01b0 && priority == 1) continue;
-
+ /*!
+ Starting at a particular sequence, sprite DMA seems to stop there and resume via "something",
+ effectively drawing any other sprite with better priority in the framebuffer scheme of things.
+
+ @todo reported sequence for DMA pause flag is 0x0c** 0x0000 0x0000 0x0000.
+ Verify how exactly via HW test. Continuing may be determined by a DMA bit write.
+ */
+ if(m_tc0080vco->sprram_r(space, offs + 0, 0xffff) == 0xc00 ||
+ m_tc0080vco->sprram_r(space, offs + 0, 0xffff) == 0xcff) // Air Inferno
+ return offs - 8/2;
+
x0 = m_tc0080vco->sprram_r(space, offs + 1, 0xffff) & 0x3ff;
y0 = m_tc0080vco->sprram_r(space, offs + 0, 0xffff) & 0x3ff;
zoomx = (m_tc0080vco->sprram_r(space, offs + 2, 0xffff) & 0x7f00) >> 8;
@@ -97,6 +113,7 @@ void taitoair_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &clipre
tile_offs = (m_tc0080vco->sprram_r(space, offs + 3, 0xffff) & 0x1fff) << 2;
ysize = size[(m_tc0080vco->sprram_r(space, offs, 0xffff) & 0x0c00) >> 10];
+
if (tile_offs)
{
/* Convert zoomy value to real value as zoomx */
@@ -181,9 +198,11 @@ void taitoair_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &clipre
}
}
}
+
+ return 0;
}
-void taitoair_state::fill_slope( bitmap_ind16 &bitmap, const rectangle &cliprect, int color, INT32 x1, INT32 x2, INT32 sl1, INT32 sl2, INT32 y1, INT32 y2, INT32 *nx1, INT32 *nx2 )
+void taitoair_state::fill_slope( bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16 header, INT32 x1, INT32 x2, INT32 sl1, INT32 sl2, INT32 y1, INT32 y2, INT32 *nx1, INT32 *nx2 )
{
if (y1 > cliprect.max_y)
return;
@@ -240,19 +259,26 @@ void taitoair_state::fill_slope( bitmap_ind16 &bitmap, const rectangle &cliprect
if (xx2 > cliprect.max_x)
xx2 = cliprect.max_x;
- if(color & 0x40)
+ if(header & 0x4000 && machine().input().code_pressed(KEYCODE_Q))
{
- /* Non-terrain elements are colored with this. */
- base_color = (color & 0x3f) + 0x340;
+ base_color = machine().rand() & 0x3fff;
grad_col = 0;
}
- else
+ else if(m_paletteram[(header & 0xff)+0x300] & 0x8000)
{
/* Terrain elements, with a gradient applied. */
- /* TODO: it's unknown if gradient color applies by global screen Y coordinate or there's a calculation to somewhere ... */
- base_color = ((color & 0x3f) * 0x80) + 0x2040;
+ /*! @todo it's unknown if gradient color applies by global screen Y coordinate or there's a calculation to somewhere ... */
+ base_color = ((header & 0x3f) * 0x80) + 0x2040;
+ if(header & 0x3fe0)
+ base_color = machine().rand() & 0x3fff;
grad_col = (y1 >> 3) & 0x3f;
}
+ else
+ {
+ /* Non-terrain elements are colored with this. */
+ base_color = (header & 0xff) + 0x300;
+ grad_col = 0;
+ }
while (xx1 <= xx2)
{
@@ -275,7 +301,7 @@ void taitoair_state::fill_poly( bitmap_ind16 &bitmap, const rectangle &cliprect,
INT32 sl1, sl2, cury, limy, x1, x2;
int pmin, pmax, i, ps1, ps2;
struct taitoair_spoint p[TAITOAIR_POLY_MAX_PT * 2];
- int color = q->col;
+ UINT16 header = q->header;
int pcount = q->pcount;
for (i = 0; i < pcount; i++)
@@ -316,7 +342,7 @@ void taitoair_state::fill_poly( bitmap_ind16 &bitmap, const rectangle &cliprect,
{
if (p[ps1 - 1].y == p[ps2 + 1].y)
{
- fill_slope(bitmap, cliprect, color, x1, x2, sl1, sl2, cury, p[ps1 - 1].y, &x1, &x2);
+ fill_slope(bitmap, cliprect, header, x1, x2, sl1, sl2, cury, p[ps1 - 1].y, &x1, &x2);
cury = p[ps1 - 1].y;
if (cury >= limy)
break;
@@ -335,7 +361,7 @@ void taitoair_state::fill_poly( bitmap_ind16 &bitmap, const rectangle &cliprect,
}
else if (p[ps1 - 1].y < p[ps2 + 1].y)
{
- fill_slope(bitmap, cliprect, color, x1, x2, sl1, sl2, cury, p[ps1 - 1].y, &x1, &x2);
+ fill_slope(bitmap, cliprect, header, x1, x2, sl1, sl2, cury, p[ps1 - 1].y, &x1, &x2);
cury = p[ps1 - 1].y;
if (cury >= limy)
break;
@@ -347,7 +373,7 @@ void taitoair_state::fill_poly( bitmap_ind16 &bitmap, const rectangle &cliprect,
}
else
{
- fill_slope(bitmap, cliprect, color, x1, x2, sl1, sl2, cury, p[ps2 + 1].y, &x1, &x2);
+ fill_slope(bitmap, cliprect, header, x1, x2, sl1, sl2, cury, p[ps2 + 1].y, &x1, &x2);
cury = p[ps2 + 1].y;
if (cury >= limy)
break;
@@ -364,12 +390,9 @@ void taitoair_state::fill_poly( bitmap_ind16 &bitmap, const rectangle &cliprect,
dsp handlers
***************************************************************************/
-/*
- TODO: still don't know how this works. It calls three values (0x1fff-0x5fff-0xdfff), for two or three offsets.
- In theory this should fit into framebuffer draw, display, clear and swap in some way.
-*/
-WRITE16_MEMBER(taitoair_state::dsp_flags_w)
+void taitoair_state::fb_copy_op()
{
+ /*! @todo declare once */
rectangle cliprect;
/* printf("%04x -> %d\n",data,offset); */
@@ -378,186 +401,99 @@ WRITE16_MEMBER(taitoair_state::dsp_flags_w)
cliprect.min_y = 3*16;
cliprect.max_x = m_screen->width() - 1;
cliprect.max_y = m_screen->height() - 1;
-
- {
- /* clear and copy operation if offset is 0x3001 */
- if(offset == 1)
- {
- /* clear screen fb */
- m_framebuffer[1]->fill(0, cliprect);
- /* copy buffer fb into screen fb (at this stage we are ready to draw) */
- copybitmap_trans(*m_framebuffer[1], *m_framebuffer[0], 0, 0, 0, 0, cliprect, 0);
- /* now clear buffer fb */
- m_framebuffer[0]->fill(0, cliprect);
- }
-
- /* if offset 0x3001 OR 0x3002 we put data in the buffer fb */
- if(offset)
- {
- if (m_line_ram[0x3fff])
- {
- int adr = 0x3fff;
-// struct taitoair_poly q;
-
- while (adr >= 0 && m_line_ram[adr] && m_line_ram[adr] != 0x4000)
- {
- int pcount;
- if (!(m_line_ram[adr] & 0x8000) || adr < 10)
- {
- logerror("quad: unknown value %04x at %04x\n", m_line_ram[adr], adr);
- break;
- }
- m_q.col = m_line_ram[adr] & 0x7f;//((m_line_ram[adr] & 0x007f) * 0x80) + 0x2040;
-
- adr--;
- pcount = 0;
- while (pcount < TAITOAIR_POLY_MAX_PT && adr >= 1 && !(m_line_ram[adr] & 0xc000))
- {
- m_q.p[pcount].y = m_line_ram[adr] + 3 * 16;
- m_q.p[pcount].x = m_line_ram[adr - 1];
- pcount++;
- adr -= 2;
- }
- adr--;
- m_q.pcount = pcount;
- fill_poly(*m_framebuffer[0], cliprect, &m_q);
- }
- }
- }
- }
+
+ /* clear screen fb */
+ m_framebuffer[1]->fill(0, cliprect);
+ /* copy buffer fb into screen fb (at this stage we are ready to draw) */
+ copybitmap_trans(*m_framebuffer[1], *m_framebuffer[0], 0, 0, 0, 0, cliprect, 0);
+ /* now clear buffer fb */
+ m_framebuffer[0]->fill(0, cliprect);
}
-WRITE16_MEMBER(taitoair_state::dsp_x_eyecoord_w)
+void taitoair_state::fb_erase_op()
{
- m_eyecoordBuffer[0] = data;
-}
+ /*! @todo declare once */
+ rectangle cliprect;
-WRITE16_MEMBER(taitoair_state::dsp_y_eyecoord_w)
-{
- m_eyecoordBuffer[1] = data;
-}
+ /* printf("%04x -> %d\n",data,offset); */
-WRITE16_MEMBER(taitoair_state::dsp_z_eyecoord_w)
-{
- m_eyecoordBuffer[2] = data;
+ cliprect.min_x = 0;
+ cliprect.min_y = 3*16;
+ cliprect.max_x = m_screen->width() - 1;
+ cliprect.max_y = m_screen->height() - 1;
+
+ m_framebuffer[0]->fill(0, cliprect);
+ //m_framebuffer[1]->fill(0, cliprect);
}
-WRITE16_MEMBER(taitoair_state::dsp_frustum_left_w)
+void taitoair_state::fb_fill_op()
{
- /* Strange. It comes in as it it were the right side of the screen */
- m_frustumLeft = -data;
-}
+ /*! @todo declare once */
+ rectangle cliprect;
-WRITE16_MEMBER(taitoair_state::dsp_frustum_bottom_w)
-{
- m_frustumBottom = data;
-}
+ /* printf("%04x -> %d\n",data,offset); */
+ cliprect.min_x = 0;
+ cliprect.min_y = 3*16;
+ cliprect.max_x = m_screen->width() - 1;
+ cliprect.max_y = m_screen->height() - 1;
+
+ if (m_line_ram[0x3fff])
+ {
+ int adr = 0x3fff;
-void taitoair_state::multVecMtx(const INT16* vec4, const float* m, float* result)
-{
-#define M(row,col) m[col*4+row]
- result[0] = vec4[0]*M(0,0) + vec4[1]*M(1,0) + vec4[2]*M(2,0) + vec4[3]*M(3,0);
- result[1] = vec4[0]*M(0,1) + vec4[1]*M(1,1) + vec4[2]*M(2,1) + vec4[3]*M(3,1);
- result[2] = vec4[0]*M(0,2) + vec4[1]*M(1,2) + vec4[2]*M(2,2) + vec4[3]*M(3,2);
-
- float w = vec4[0]*M(0,3) + vec4[1]*M(1,3) + vec4[2]*M(2,3) + vec4[3]*M(3,3);
- result[0] /= w;
- result[1] /= w;
- result[2] /= w;
-#undef M
+ while (adr >= 0 && m_line_ram[adr] && m_line_ram[adr] != 0x4000)
+ {
+ int pcount = 0;
+ m_q.header = m_line_ram[adr--];
+ while (pcount < TAITOAIR_POLY_MAX_PT && adr >= 1 && !(m_line_ram[adr] & 0xc000))
+ {
+ m_q.p[pcount].y = m_line_ram[adr--] + 3 * 16;
+ m_q.p[pcount].x = m_line_ram[adr--];
+ pcount++;
+ }
+ adr--;
+ m_q.pcount = pcount;
+ if (!(m_line_ram[adr] & 0x8000))
+ {
+ m_q.header |= 0x4000;
+ logerror("special poly at %04x\n", adr);
+ while(adr >= 0 && !(m_line_ram[adr] & 0xc000))
+ adr--;
+ }
+ fill_poly(*m_framebuffer[0], cliprect, &m_q);
+ }
+ }
}
-int taitoair_state::projectEyeCoordToScreen(float* projectionMatrix,const int Res,INT16* eyePoint3d,int type)
+/*!
+ @todo still don't know how this works. It calls three values (0x1fff-0x5fff-0xdfff), for two or three offsets.
+ In theory this should fit into framebuffer draw, display, clear and swap in some way.
+*/
+WRITE16_MEMBER(taitoair_state::dsp_flags_w)
{
- /* Return (-1, -1) if the eye point is behind camera */
- int res = -10000;
- if (eyePoint3d[2] <= 0.0 && eyePoint3d[0] <= 0.0)
- return -10000;
- if (eyePoint3d[2] <= 0.0 && eyePoint3d[0] >= 0.0)
- return 10000;
-
- /* Coordinate system flip */
- eyePoint3d[0] *= -1;
-
- /* Nothing fancy about this homogeneous worldspace coordinate */
- eyePoint3d[3] = 1;
-
- float deviceCoordinates[3];
- multVecMtx(eyePoint3d, projectionMatrix, deviceCoordinates);
-
- /* We're only interested if it projects within the device */
- // if ( ( deviceCoordinates[type] >= -1.0) && ( deviceCoordinates[type] <= 1.0))
- res = (int)( deviceCoordinates[type] * (Res-1) );
-
- return res;
-}
+ rectangle cliprect;
-void taitoair_state::airInfernoFrustum(const INT16 leftExtent, const INT16 bottomExtent, float* m)
-{
- /* Hard-coded near and far clipping planes :( */
- float nearZ = 1.0f;
- float farZ = 10000.0f;
- float left = 1.0f;
- float right = -1.0f;
- float bottom = (float)(-bottomExtent) / leftExtent;
- float top = (float)(bottomExtent) / leftExtent;
-
- float x = (2.0f*nearZ) / (right-left);
- float y = (2.0f*nearZ) / (top-bottom);
- float a = (right+left) / (right-left);
- float b = (top+bottom) / (top-bottom);
- float c = -(farZ+nearZ) / ( farZ-nearZ);
- float d = -(2.0f*farZ*nearZ) / (farZ-nearZ);
-
-#define M(row,col) m[col*4+row]
- M(0,0) = x; M(0,1) = 0.0F; M(0,2) = a; M(0,3) = 0.0F;
- M(1,0) = 0.0F; M(1,1) = y; M(1,2) = b; M(1,3) = 0.0F;
- M(2,0) = 0.0F; M(2,1) = 0.0F; M(2,2) = c; M(2,3) = d;
- M(3,0) = 0.0F; M(3,1) = 0.0F; M(3,2) = -1.0F; M(3,3) = 0.0F;
-#undef M
-}
+ /* printf("%04x -> %d\n",data,offset); */
-WRITE16_MEMBER(taitoair_state::dsp_rasterize_w)
-{
-}
+ cliprect.min_x = 0;
+ cliprect.min_y = 3*16;
+ cliprect.max_x = m_screen->width() - 1;
+ cliprect.max_y = m_screen->height() - 1;
-READ16_MEMBER(taitoair_state::dsp_x_return_r)
-{
- /* Construct a frustum from the system's most recently set left and bottom extents */
- float m[16];
- airInfernoFrustum(m_frustumLeft, m_frustumBottom, m);
- int res;
-
- res = projectEyeCoordToScreen(m,
- 32*16, /* x max screen size */
- m_eyecoordBuffer,0);
-
- // Extremely poor man's clipping :-P
- if (res == -10000) return -32*8;
- if (res == 10000) return 32*8-1;
- if (res > 32*8-1) res = 32*8-1;
- if (res < -32*8) res = -32*8;
- return res;
-}
+ {
+ /* clear and copy operation if offset is 0x3001 */
+ if(offset == 1)
+ {
+ fb_copy_op();
+ }
-READ16_MEMBER(taitoair_state::dsp_y_return_r)
-{
- /* Construct a frustum from the system's most recently set left and bottom extents */
- float m[16];
- airInfernoFrustum(m_frustumLeft, m_frustumBottom, m);
-
- int res;
- res = projectEyeCoordToScreen(m,
- 28*16, /* y max screen size */
- m_eyecoordBuffer, 1);
-
- // Extremely poor man's clipping :-P
- if (res == -10000) return 28*7;
- if (res == 10000) return 28*7;
- if (res > 28*7) res = 28*7;
- if (res < -28*7) res = -28*7;
- return res;
+ /* if offset 0x3001 OR 0x3002 we put data in the buffer fb */
+ if(offset)
+ {
+ fb_fill_op();
+ }
+ }
}
void taitoair_state::video_start()
@@ -573,51 +509,63 @@ void taitoair_state::video_start()
UINT32 taitoair_state::screen_update_taitoair(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
+ int sprite_ptr;
m_tc0080vco->tilemap_update();
- bitmap.fill(0, cliprect);
-
- {
- int x,y;
-
- /*
- [0x980000-3] dword for Y 0
- [0x980004-7] dword for rotation param 0
- [0x980008-b] dword for Y 1
- [0x98000c-f] dword for rotation param 1
- */
-
- for(y=cliprect.min_y;y<cliprect.max_y/2;y++)
- {
- for(x=cliprect.min_x;x<cliprect.max_x;x++)
- {
- bitmap.pix16(y, x) = 0x2000 + (0x3f - ((y >> 2) & 0x3f));
- }
- }
-
- #if 0
- for(y=cliprect.max_y/2;y<cliprect.max_y;y++)
- {
- for(x=cliprect.min_x;x<cliprect.max_x;x++)
- {
- bitmap.pix16(y, x) = 0x2040 + (0x3f - ((y >> 2) & 0x3f));
+ UINT32 counter1 = (m_tc0430grw[0] << 16) | m_tc0430grw[1];
+ UINT32 inc1x = INT16(m_tc0430grw[2]);
+ UINT32 inc1y = INT16(m_tc0430grw[3]);
+ UINT32 counter2 = (m_tc0430grw[4] << 16) | m_tc0430grw[5];
+ UINT32 inc2x = INT16(m_tc0430grw[6]);
+ UINT32 inc2y = INT16(m_tc0430grw[7]);
+
+ // Deltas are 118/31
+ int dx = cliprect.min_x + 118;
+ int dy = cliprect.min_y - 48 + 31;
+
+ counter1 += dx*inc1x + dy*inc1y;
+ counter2 += dx*inc2x + dy*inc2y;
+
+ for(int y = cliprect.min_y; y <= cliprect.max_y; y++) {
+ UINT32 c1b = counter1;
+ UINT32 c2b = counter2;
+ UINT16 *dest = &bitmap.pix(y, cliprect.min_x);
+ for(int x = cliprect.min_x; x <= cliprect.max_x; x++) {
+ UINT16 base = 0;
+ UINT32 cntr = 0;
+ if(c2b & 0x800000) {
+ base = 0x2040;
+ cntr = c2b;
+ } else if(c1b & 0x800000) {
+ base = 0x2000;
+ cntr = c1b;
}
+ if(m_gradbank == true)
+ base|= 0x1000;
+
+ *dest++ = base | (cntr >= 0x83f000 ? 0x3f : (cntr >> 12) & 0x3f);
+
+ c1b += inc1x;
+ c2b += inc2x;
}
- #endif
+ counter1 += inc1y;
+ counter2 += inc2y;
}
+
- m_tc0080vco->tilemap_draw(screen, bitmap, cliprect, 0, 0, 0);
-
- draw_sprites(bitmap, cliprect, 0);
copybitmap_trans(bitmap, *m_framebuffer[1], 0, 0, 0, 0, cliprect, 0);
- m_tc0080vco->tilemap_draw(screen, bitmap, cliprect, 1, 0, 0);
+ m_tc0080vco->tilemap_draw(screen, bitmap, cliprect, 0, 0, 0);
- draw_sprites(bitmap, cliprect, 1);
+ sprite_ptr = draw_sprites(bitmap, cliprect);
+ m_tc0080vco->tilemap_draw(screen, bitmap, cliprect, 1, 0, 0);
+
m_tc0080vco->tilemap_draw(screen, bitmap, cliprect, 2, 0, 0);
+ draw_sprites(bitmap, cliprect, sprite_ptr);
+
/* Hacky 3d bitmap */
//copybitmap_trans(bitmap, m_buffer3d, 0, 0, 0, 0, cliprect, 0);
//m_buffer3d->fill(0, cliprect);
diff --git a/src/mame/video/toaplan2.c b/src/mame/video/toaplan2.c
index 4a0b2f72a3e..b47d98d2015 100644
--- a/src/mame/video/toaplan2.c
+++ b/src/mame/video/toaplan2.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Quench, Yochizo, David Haywood
/***************************************************************************
diff --git a/src/mame/video/topspeed.c b/src/mame/video/topspeed.c
index 84f7d9d98b4..ac04cfda610 100644
--- a/src/mame/video/topspeed.c
+++ b/src/mame/video/topspeed.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:David Graves
#include "emu.h"
#include "includes/topspeed.h"
diff --git a/src/mame/video/undrfire.c b/src/mame/video/undrfire.c
index f5e6e3606f8..ab2f2a187ec 100644
--- a/src/mame/video/undrfire.c
+++ b/src/mame/video/undrfire.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Bryan McPhail, David Graves
#include "emu.h"
#include "includes/undrfire.h"
@@ -11,7 +11,7 @@ void undrfire_state::video_start()
{
int i;
- m_spritelist = auto_alloc_array(machine(), struct tempsprite, 0x4000);
+ m_spritelist = auto_alloc_array(machine(), struct uf_tempsprite, 0x4000);
for (i = 0; i < 16384; i++) /* Fix later - some weird colours in places */
m_palette->set_pen_color(i, rgb_t(0,0,0));
@@ -77,7 +77,7 @@ void undrfire_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap,co
/* pdrawgfx() needs us to draw sprites front to back, so we have to build a list
while processing sprite ram and then draw them all at the end */
- struct tempsprite *sprite_ptr = m_spritelist;
+ struct uf_tempsprite *sprite_ptr = m_spritelist;
for (offs = (m_spriteram.bytes()/4-4);offs >= 0;offs -= 4)
{
@@ -222,7 +222,7 @@ void undrfire_state::draw_sprites_cbombers(screen_device &screen, bitmap_ind16 &
/* pdrawgfx() needs us to draw sprites front to back, so we have to build a list
while processing sprite ram and then draw them all at the end */
- struct tempsprite *sprite_ptr = m_spritelist;
+ struct uf_tempsprite *sprite_ptr = m_spritelist;
for (offs = (m_spriteram.bytes()/4-4);offs >= 0;offs -= 4)
{
diff --git a/src/mame/video/vastar.c b/src/mame/video/vastar.c
index 20581773470..b9b869707a8 100644
--- a/src/mame/video/vastar.c
+++ b/src/mame/video/vastar.c
@@ -2,7 +2,7 @@
// copyright-holders:Allard van der Bas
/***************************************************************************
- video.c
+ vastar.c
Functions to emulate the video hardware of the machine.
@@ -20,12 +20,9 @@
TILE_GET_INFO_MEMBER(vastar_state::get_fg_tile_info)
{
- UINT8 *videoram = m_fgvideoram;
- int code, color, fxy;
-
- code = videoram[tile_index + 0x800] | (videoram[tile_index + 0x400] << 8);
- color = videoram[tile_index];
- fxy = (code & 0xc00) >> 10; // maybe, based on the other layers
+ int code = m_fgvideoram[tile_index + 0x800] | (m_fgvideoram[tile_index + 0x400] << 8);
+ int color = m_fgvideoram[tile_index];
+ int fxy = (code & 0xc00) >> 10; // maybe, based on the other layers
SET_TILE_INFO_MEMBER(0,
code,
color & 0x3f,
@@ -34,12 +31,9 @@ TILE_GET_INFO_MEMBER(vastar_state::get_fg_tile_info)
TILE_GET_INFO_MEMBER(vastar_state::get_bg1_tile_info)
{
- UINT8 *videoram = m_bg1videoram;
- int code, color, fxy;
-
- code = videoram[tile_index + 0x800] | (videoram[tile_index] << 8);
- color = videoram[tile_index + 0xc00];
- fxy = (code & 0xc00) >> 10;
+ int code = m_bg1videoram[tile_index + 0x800] | (m_bg1videoram[tile_index] << 8);
+ int color = m_bg1videoram[tile_index + 0xc00];
+ int fxy = (code & 0xc00) >> 10;
SET_TILE_INFO_MEMBER(4,
code,
color & 0x3f,
@@ -48,12 +42,9 @@ TILE_GET_INFO_MEMBER(vastar_state::get_bg1_tile_info)
TILE_GET_INFO_MEMBER(vastar_state::get_bg2_tile_info)
{
- UINT8 *videoram = m_bg2videoram;
- int code, color, fxy;
-
- code = videoram[tile_index + 0x800] | (videoram[tile_index] << 8);
- color = videoram[tile_index + 0xc00];
- fxy = (code & 0xc00) >> 10;
+ int code = m_bg2videoram[tile_index + 0x800] | (m_bg2videoram[tile_index] << 8);
+ int color = m_bg2videoram[tile_index + 0xc00];
+ int fxy = (code & 0xc00) >> 10;
SET_TILE_INFO_MEMBER(3,
code,
color & 0x3f,
@@ -88,19 +79,19 @@ void vastar_state::video_start()
***************************************************************************/
-WRITE8_MEMBER(vastar_state::vastar_fgvideoram_w)
+WRITE8_MEMBER(vastar_state::fgvideoram_w)
{
m_fgvideoram[offset] = data;
m_fg_tilemap->mark_tile_dirty(offset & 0x3ff);
}
-WRITE8_MEMBER(vastar_state::vastar_bg1videoram_w)
+WRITE8_MEMBER(vastar_state::bg1videoram_w)
{
m_bg1videoram[offset] = data;
m_bg1_tilemap->mark_tile_dirty(offset & 0x3ff);
}
-WRITE8_MEMBER(vastar_state::vastar_bg2videoram_w)
+WRITE8_MEMBER(vastar_state::bg2videoram_w)
{
m_bg2videoram[offset] = data;
m_bg2_tilemap->mark_tile_dirty(offset & 0x3ff);
@@ -123,25 +114,17 @@ WRITE8_MEMBER(vastar_state::vastar_bg2videoram_w)
// forward order instead
void vastar_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect)
{
- UINT8 *spriteram = m_spriteram1;
- UINT8 *spriteram_2 = m_spriteram2;
- UINT8 *spriteram_3 = m_spriteram3;
- int offs;
-
-// for (offs = 0; offs < 0x40; offs += 2)
- for (offs = 0x40-2; offs >=0; offs -= 2)
+// for (int offs = 0; offs < 0x40; offs += 2)
+ for (int offs = 0x40-2; offs >=0; offs -= 2)
{
- int code, sx, sy, color, flipx, flipy;
-
-
- code = ((spriteram_3[offs] & 0xfc) >> 2) + ((spriteram_2[offs] & 0x01) << 6)
+ int code = ((m_spriteram3[offs] & 0xfc) >> 2) + ((m_spriteram2[offs] & 0x01) << 6)
+ ((offs & 0x20) << 2);
- sx = spriteram_3[offs + 1];
- sy = spriteram[offs];
- color = spriteram[offs + 1] & 0x3f;
- flipx = spriteram_3[offs] & 0x02;
- flipy = spriteram_3[offs] & 0x01;
+ int sx = m_spriteram3[offs + 1];
+ int sy = m_spriteram1[offs];
+ int color = m_spriteram1[offs + 1] & 0x3f;
+ int flipx = m_spriteram3[offs] & 0x02;
+ int flipy = m_spriteram3[offs] & 0x01;
if (flip_screen())
{
@@ -149,7 +132,7 @@ void vastar_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect)
flipy = !flipy;
}
- if (spriteram_2[offs] & 0x08) /* double width */
+ if (m_spriteram2[offs] & 0x08) /* double width */
{
if (!flip_screen())
sy = 224 - sy;
@@ -180,11 +163,9 @@ void vastar_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect)
}
}
-UINT32 vastar_state::screen_update_vastar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+UINT32 vastar_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- int i;
-
- for (i = 0;i < 32;i++)
+ for (int i = 0;i < 32;i++)
{
m_bg1_tilemap->set_scrolly(i,m_bg1_scroll[i]);
m_bg2_tilemap->set_scrolly(i,m_bg2_scroll[i]);
diff --git a/src/mame/video/vectrex.c b/src/mame/video/vectrex.c
index fd857fe8993..b78c096e343 100644
--- a/src/mame/video/vectrex.c
+++ b/src/mame/video/vectrex.c
@@ -30,7 +30,7 @@ enum {
A_ZR,
A_Z,
A_AUDIO,
- A_Y,
+ A_Y
};
/*********************************************************************
diff --git a/src/mame/video/vicdual.c b/src/mame/video/vicdual.c
index 1f955565e1b..6b79523fdee 100644
--- a/src/mame/video/vicdual.c
+++ b/src/mame/video/vicdual.c
@@ -23,14 +23,14 @@ static const pen_t pens_from_color_prom[] =
};
-WRITE8_MEMBER(vicdual_state::vicdual_palette_bank_w)
+WRITE8_MEMBER(vicdual_state::palette_bank_w)
{
m_screen->update_partial(m_screen->vpos());
m_palette_bank = data & 3;
}
-UINT32 vicdual_state::screen_update_vicdual_bw(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
+UINT32 vicdual_state::screen_update_bw(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
UINT8 x = 0;
UINT8 y = cliprect.min_y;
@@ -80,7 +80,7 @@ UINT32 vicdual_state::screen_update_vicdual_bw(screen_device &screen, bitmap_rgb
}
-UINT32 vicdual_state::screen_update_vicdual_color(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
+UINT32 vicdual_state::screen_update_color(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
UINT8 *color_prom = (UINT8 *)memregion("proms")->base();
UINT8 x = 0;
@@ -138,12 +138,12 @@ UINT32 vicdual_state::screen_update_vicdual_color(screen_device &screen, bitmap_
}
-UINT32 vicdual_state::screen_update_vicdual_bw_or_color(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
+UINT32 vicdual_state::screen_update_bw_or_color(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
- if (vicdual_is_cabinet_color())
- screen_update_vicdual_color(screen, bitmap, cliprect);
+ if (is_cabinet_color())
+ screen_update_color(screen, bitmap, cliprect);
else
- screen_update_vicdual_bw(screen, bitmap, cliprect);
+ screen_update_bw(screen, bitmap, cliprect);
return 0;
}
diff --git a/src/mame/video/vs920a.c b/src/mame/video/vs920a.c
index 7918de69ecc..b655f09a625 100644
--- a/src/mame/video/vs920a.c
+++ b/src/mame/video/vs920a.c
@@ -34,6 +34,8 @@ const device_type VS920A = &device_creator<vs920a_text_tilemap_device>;
vs920a_text_tilemap_device::vs920a_text_tilemap_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, VS920A, "VS920A Text Tilemap", tag, owner, clock, "vs920a", __FILE__),
+ m_vram(NULL),
+ m_pal_base(0),
m_gfx_region(0),
m_gfxdecode(*this)
@@ -48,6 +50,7 @@ void vs920a_text_tilemap_device::device_start()
m_vram = (UINT16*)auto_alloc_array_clear(this->machine(), UINT16, 0x1000/2);
save_pointer(NAME(m_vram), 0x1000/2);
+ save_item(NAME(m_pal_base));
m_tmap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(vs920a_text_tilemap_device::get_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,32);
@@ -108,11 +111,6 @@ void vs920a_text_tilemap_device::set_pal_base(int pal_base)
m_pal_base = pal_base;
}
-void vs920a_text_tilemap_device::set_gfx_region(int gfx_region)
-{
- m_gfx_region = gfx_region;
-}
-
void vs920a_text_tilemap_device::draw(screen_device &screen, bitmap_ind16& bitmap, const rectangle &cliprect, int priority)
{
m_tmap->draw(screen, bitmap, cliprect, 0, priority);
diff --git a/src/mame/video/vs920a.h b/src/mame/video/vs920a.h
index 2605d3a0518..ef452294152 100644
--- a/src/mame/video/vs920a.h
+++ b/src/mame/video/vs920a.h
@@ -16,7 +16,6 @@ public:
TILE_GET_INFO_MEMBER(get_tile_info);
tilemap_t* get_tilemap();
void set_pal_base(int m_pal_base);
- void set_gfx_region(int m_gfx_region);
void draw(screen_device &screen, bitmap_ind16& bitmap, const rectangle &cliprect, int priority);
DECLARE_WRITE16_MEMBER(vram_w);
diff --git a/src/mame/video/vsystem_spr.c b/src/mame/video/vsystem_spr.c
index 7eb034013e6..411bce03264 100644
--- a/src/mame/video/vsystem_spr.c
+++ b/src/mame/video/vsystem_spr.c
@@ -85,6 +85,8 @@ vsystem_spr_device::vsystem_spr_device(const machine_config &mconfig, const char
m_pal_mask = 0x3f;
m_newtilecb = vsystem_tile_indirection_delegate(FUNC(vsystem_spr_device::tile_callback_noindirect), this);
+
+ memset(&m_curr_sprite, 0, sizeof(m_curr_sprite));
}
//-------------------------------------------------
@@ -175,6 +177,20 @@ void vsystem_spr_device::device_start()
{
// bind our handler
m_newtilecb.bind_relative_to(*owner());
+
+ save_item(NAME(m_pal_base));
+
+ save_item(NAME(m_curr_sprite.ox));
+ save_item(NAME(m_curr_sprite.xsize));
+ save_item(NAME(m_curr_sprite.zoomx));
+ save_item(NAME(m_curr_sprite.oy));
+ save_item(NAME(m_curr_sprite.ysize));
+ save_item(NAME(m_curr_sprite.zoomy));
+ save_item(NAME(m_curr_sprite.flipx));
+ save_item(NAME(m_curr_sprite.flipy));
+ save_item(NAME(m_curr_sprite.color));
+ save_item(NAME(m_curr_sprite.pri));
+ save_item(NAME(m_curr_sprite.map));
}
void vsystem_spr_device::device_reset()
@@ -205,21 +221,21 @@ void vsystem_spr_device::get_sprite_attributes(UINT16* ram)
xxxx xxxx xxxx xxxx map start (lsb)
*/
- curr_sprite.oy = (ram[0] & 0x01ff);
- curr_sprite.ysize = (ram[0] & 0x0e00) >> 9;
- curr_sprite.zoomy = (ram[0] & 0xf000) >> 12;
+ m_curr_sprite.oy = (ram[0] & 0x01ff);
+ m_curr_sprite.ysize = (ram[0] & 0x0e00) >> 9;
+ m_curr_sprite.zoomy = (ram[0] & 0xf000) >> 12;
- curr_sprite.ox = (ram[1] & 0x01ff);
- curr_sprite.xsize = (ram[1] & 0x0e00) >> 9;
- curr_sprite.zoomx = (ram[1] & 0xf000) >> 12;
+ m_curr_sprite.ox = (ram[1] & 0x01ff);
+ m_curr_sprite.xsize = (ram[1] & 0x0e00) >> 9;
+ m_curr_sprite.zoomx = (ram[1] & 0xf000) >> 12;
- curr_sprite.flipx = (ram[2] & 0x4000);
- curr_sprite.flipy = (ram[2] & 0x8000);
- curr_sprite.color = (ram[2] & 0x3f00) >> 8;
- curr_sprite.pri = (ram[2] & 0x3000) >> 12;
- curr_sprite.map = (ram[2] & 0x0001) << 16;
+ m_curr_sprite.flipx = (ram[2] & 0x4000);
+ m_curr_sprite.flipy = (ram[2] & 0x8000);
+ m_curr_sprite.color = (ram[2] & 0x3f00) >> 8;
+ m_curr_sprite.pri = (ram[2] & 0x3000) >> 12;
+ m_curr_sprite.map = (ram[2] & 0x0001) << 16;
- curr_sprite.map |= (ram[3] & 0xffff);
+ m_curr_sprite.map |= (ram[3] & 0xffff);
}
@@ -228,12 +244,12 @@ void vsystem_spr_device::common_sprite_drawgfx(bitmap_ind16 &bitmap, const recta
gfx_element *gfx = m_gfxdecode->gfx(m_gfx_region);
int priority_mask = 0x00;
- curr_sprite.oy += m_yoffs;
- curr_sprite.ox += m_xoffs;
+ m_curr_sprite.oy += m_yoffs;
+ m_curr_sprite.ox += m_xoffs;
if (m_pdraw)
{
- switch (curr_sprite.pri)
+ switch (m_curr_sprite.pri)
{
default:
case 0: priority_mask = 0x00; break;
@@ -243,39 +259,39 @@ void vsystem_spr_device::common_sprite_drawgfx(bitmap_ind16 &bitmap, const recta
}
}
- curr_sprite.zoomx = 32 - curr_sprite.zoomx;
- curr_sprite.zoomy = 32 - curr_sprite.zoomy;
+ m_curr_sprite.zoomx = 32 - m_curr_sprite.zoomx;
+ m_curr_sprite.zoomy = 32 - m_curr_sprite.zoomy;
int ystart, yend, yinc;
- if (!curr_sprite.flipy) { ystart = 0; yend = curr_sprite.ysize+1; yinc = 1; }
- else { ystart = curr_sprite.ysize; yend = -1; yinc = -1; }
+ if (!m_curr_sprite.flipy) { ystart = 0; yend = m_curr_sprite.ysize+1; yinc = 1; }
+ else { ystart = m_curr_sprite.ysize; yend = -1; yinc = -1; }
int ycnt = ystart;
while (ycnt != yend)
{
int xstart, xend, xinc;
- if (!curr_sprite.flipx) { xstart = 0; xend = curr_sprite.xsize+1; xinc = 1; }
- else { xstart = curr_sprite.xsize; xend = -1; xinc = -1; }
+ if (!m_curr_sprite.flipx) { xstart = 0; xend = m_curr_sprite.xsize+1; xinc = 1; }
+ else { xstart = m_curr_sprite.xsize; xend = -1; xinc = -1; }
int xcnt = xstart;
while (xcnt != xend)
{
- int startno = m_newtilecb(curr_sprite.map++);
+ int startno = m_newtilecb(m_curr_sprite.map++);
if (m_pdraw)
{
- gfx->prio_zoom_transpen(bitmap,cliprect, startno, curr_sprite.color + m_pal_base, curr_sprite.flipx, curr_sprite.flipy, curr_sprite.ox + xcnt * curr_sprite.zoomx/2, curr_sprite.oy + ycnt * curr_sprite.zoomy/2, curr_sprite.zoomx << 11, curr_sprite.zoomy << 11, priority_bitmap, priority_mask, m_transpen);
- gfx->prio_zoom_transpen(bitmap,cliprect, startno, curr_sprite.color + m_pal_base, curr_sprite.flipx, curr_sprite.flipy, -0x200+curr_sprite.ox + xcnt * curr_sprite.zoomx/2, curr_sprite.oy + ycnt * curr_sprite.zoomy/2, curr_sprite.zoomx << 11, curr_sprite.zoomy << 11, priority_bitmap, priority_mask, m_transpen);
- gfx->prio_zoom_transpen(bitmap,cliprect, startno, curr_sprite.color + m_pal_base, curr_sprite.flipx, curr_sprite.flipy, curr_sprite.ox + xcnt * curr_sprite.zoomx/2, -0x200+curr_sprite.oy + ycnt * curr_sprite.zoomy/2, curr_sprite.zoomx << 11, curr_sprite.zoomy << 11, priority_bitmap, priority_mask, m_transpen);
- gfx->prio_zoom_transpen(bitmap,cliprect, startno, curr_sprite.color + m_pal_base, curr_sprite.flipx, curr_sprite.flipy, -0x200+curr_sprite.ox + xcnt * curr_sprite.zoomx/2, -0x200+curr_sprite.oy + ycnt * curr_sprite.zoomy/2, curr_sprite.zoomx << 11, curr_sprite.zoomy << 11, priority_bitmap, priority_mask, m_transpen);
+ gfx->prio_zoom_transpen(bitmap,cliprect, startno, m_curr_sprite.color + m_pal_base, m_curr_sprite.flipx, m_curr_sprite.flipy, m_curr_sprite.ox + xcnt * m_curr_sprite.zoomx/2, m_curr_sprite.oy + ycnt * m_curr_sprite.zoomy/2, m_curr_sprite.zoomx << 11, m_curr_sprite.zoomy << 11, priority_bitmap, priority_mask, m_transpen);
+ gfx->prio_zoom_transpen(bitmap,cliprect, startno, m_curr_sprite.color + m_pal_base, m_curr_sprite.flipx, m_curr_sprite.flipy, -0x200+m_curr_sprite.ox + xcnt * m_curr_sprite.zoomx/2, m_curr_sprite.oy + ycnt * m_curr_sprite.zoomy/2, m_curr_sprite.zoomx << 11, m_curr_sprite.zoomy << 11, priority_bitmap, priority_mask, m_transpen);
+ gfx->prio_zoom_transpen(bitmap,cliprect, startno, m_curr_sprite.color + m_pal_base, m_curr_sprite.flipx, m_curr_sprite.flipy, m_curr_sprite.ox + xcnt * m_curr_sprite.zoomx/2, -0x200+m_curr_sprite.oy + ycnt * m_curr_sprite.zoomy/2, m_curr_sprite.zoomx << 11, m_curr_sprite.zoomy << 11, priority_bitmap, priority_mask, m_transpen);
+ gfx->prio_zoom_transpen(bitmap,cliprect, startno, m_curr_sprite.color + m_pal_base, m_curr_sprite.flipx, m_curr_sprite.flipy, -0x200+m_curr_sprite.ox + xcnt * m_curr_sprite.zoomx/2, -0x200+m_curr_sprite.oy + ycnt * m_curr_sprite.zoomy/2, m_curr_sprite.zoomx << 11, m_curr_sprite.zoomy << 11, priority_bitmap, priority_mask, m_transpen);
}
else
{
- gfx->zoom_transpen(bitmap,cliprect, startno, curr_sprite.color + m_pal_base, curr_sprite.flipx, curr_sprite.flipy, curr_sprite.ox + xcnt * curr_sprite.zoomx/2, curr_sprite.oy + ycnt * curr_sprite.zoomy/2, curr_sprite.zoomx << 11, curr_sprite.zoomy << 11, m_transpen);
- gfx->zoom_transpen(bitmap,cliprect, startno, curr_sprite.color + m_pal_base, curr_sprite.flipx, curr_sprite.flipy, -0x200+curr_sprite.ox + xcnt * curr_sprite.zoomx/2, curr_sprite.oy + ycnt * curr_sprite.zoomy/2, curr_sprite.zoomx << 11, curr_sprite.zoomy << 11, m_transpen);
- gfx->zoom_transpen(bitmap,cliprect, startno, curr_sprite.color + m_pal_base, curr_sprite.flipx, curr_sprite.flipy, curr_sprite.ox + xcnt * curr_sprite.zoomx/2, -0x200+curr_sprite.oy + ycnt * curr_sprite.zoomy/2, curr_sprite.zoomx << 11, curr_sprite.zoomy << 11, m_transpen);
- gfx->zoom_transpen(bitmap,cliprect, startno, curr_sprite.color + m_pal_base, curr_sprite.flipx, curr_sprite.flipy, -0x200+curr_sprite.ox + xcnt * curr_sprite.zoomx/2, -0x200+curr_sprite.oy + ycnt * curr_sprite.zoomy/2, curr_sprite.zoomx << 11, curr_sprite.zoomy << 11, m_transpen);
+ gfx->zoom_transpen(bitmap,cliprect, startno, m_curr_sprite.color + m_pal_base, m_curr_sprite.flipx, m_curr_sprite.flipy, m_curr_sprite.ox + xcnt * m_curr_sprite.zoomx/2, m_curr_sprite.oy + ycnt * m_curr_sprite.zoomy/2, m_curr_sprite.zoomx << 11, m_curr_sprite.zoomy << 11, m_transpen);
+ gfx->zoom_transpen(bitmap,cliprect, startno, m_curr_sprite.color + m_pal_base, m_curr_sprite.flipx, m_curr_sprite.flipy, -0x200+m_curr_sprite.ox + xcnt * m_curr_sprite.zoomx/2, m_curr_sprite.oy + ycnt * m_curr_sprite.zoomy/2, m_curr_sprite.zoomx << 11, m_curr_sprite.zoomy << 11, m_transpen);
+ gfx->zoom_transpen(bitmap,cliprect, startno, m_curr_sprite.color + m_pal_base, m_curr_sprite.flipx, m_curr_sprite.flipy, m_curr_sprite.ox + xcnt * m_curr_sprite.zoomx/2, -0x200+m_curr_sprite.oy + ycnt * m_curr_sprite.zoomy/2, m_curr_sprite.zoomx << 11, m_curr_sprite.zoomy << 11, m_transpen);
+ gfx->zoom_transpen(bitmap,cliprect, startno, m_curr_sprite.color + m_pal_base, m_curr_sprite.flipx, m_curr_sprite.flipy, -0x200+m_curr_sprite.ox + xcnt * m_curr_sprite.zoomx/2, -0x200+m_curr_sprite.oy + ycnt * m_curr_sprite.zoomy/2, m_curr_sprite.zoomx << 11, m_curr_sprite.zoomy << 11, m_transpen);
}
xcnt+=xinc;
}
@@ -325,12 +341,12 @@ void vsystem_spr_device::draw_sprites( UINT16* spriteram, int spriteram_bytes, s
get_sprite_attributes(&spriteram[attr_start]);
- curr_sprite.color &= m_pal_mask;
+ m_curr_sprite.color &= m_pal_mask;
// hack for aero fighters and other which still call us multiple times with different priorities instead of using the pdrawgfx version
if (prihack_mask != -1)
{
- if ((curr_sprite.pri & prihack_mask) == prihack_val)
+ if ((m_curr_sprite.pri & prihack_mask) == prihack_val)
common_sprite_drawgfx(bitmap, cliprect, screen.priority());
}
else
diff --git a/src/mame/video/vsystem_spr.h b/src/mame/video/vsystem_spr.h
index e7a098dcd41..a7f53665efc 100644
--- a/src/mame/video/vsystem_spr.h
+++ b/src/mame/video/vsystem_spr.h
@@ -41,15 +41,15 @@ public:
UINT32 tile_callback_noindirect(UINT32 tile);
vsystem_tile_indirection_delegate m_newtilecb;
+ // inline config
int m_xoffs, m_yoffs;
bool m_pdraw;
-
- UINT16* m_vram;
- UINT16 m_pal_base;
UINT16 m_pal_mask;
UINT8 m_gfx_region;
UINT8 m_transpen;
+ UINT16 m_pal_base;
+
struct vsystem_sprite_attributes
{
int ox;
@@ -63,7 +63,7 @@ public:
int color;
int pri;
UINT32 map;
- } curr_sprite;
+ } m_curr_sprite;
void get_sprite_attributes(UINT16* ram);
void common_sprite_drawgfx(bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap);
diff --git a/src/mame/video/warpwarp.c b/src/mame/video/warpwarp.c
index ada74e22dab..de018da6033 100644
--- a/src/mame/video/warpwarp.c
+++ b/src/mame/video/warpwarp.c
@@ -2,7 +2,7 @@
// copyright-holders:Chris Hardy
/***************************************************************************
- video.c
+ warpwarp.c
Functions to emulate the video hardware of the machine.
@@ -63,7 +63,6 @@ PALETTE_INIT_MEMBER(warpwarp_state,navarone)
PALETTE_INIT_MEMBER(warpwarp_state,warpwarp)
{
- int i;
static const int resistances_tiles_rg[] = { 1600, 820, 390 };
static const int resistances_tiles_b[] = { 820, 390 };
static const int resistance_ball[] = { 220 };
@@ -75,7 +74,7 @@ PALETTE_INIT_MEMBER(warpwarp_state,warpwarp)
2, resistances_tiles_b, weights_tiles_b, 150, 0,
1, resistance_ball, weight_ball, 150, 0);
- for (i = 0; i < 0x100; i++)
+ for (int i = 0; i < 0x100; i++)
{
int bit0, bit1, bit2;
int r,g,b;
@@ -206,7 +205,7 @@ WRITE8_MEMBER(warpwarp_state::warpwarp_videoram_w)
***************************************************************************/
-inline void warpwarp_state::geebee_plot(bitmap_ind16 &bitmap, const rectangle &cliprect, int x, int y, pen_t pen)
+inline void warpwarp_state::plot(bitmap_ind16 &bitmap, const rectangle &cliprect, int x, int y, pen_t pen)
{
if (cliprect.contains(x, y))
bitmap.pix16(y, x) = pen;
@@ -229,11 +228,11 @@ void warpwarp_state::draw_ball(bitmap_ind16 &bitmap, const rectangle &cliprect,p
for (i = m_ball_sizey;i > 0;i--)
for (j = m_ball_sizex;j > 0;j--)
- geebee_plot(bitmap, cliprect, x-j, y-i, pen);
+ plot(bitmap, cliprect, x-j, y-i, pen);
}
}
-UINT32 warpwarp_state::screen_update_geebee(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+UINT32 warpwarp_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
m_bg_tilemap->draw(screen, bitmap, cliprect, 0,0);
diff --git a/src/mame/video/warriorb.c b/src/mame/video/warriorb.c
index ce34a8a4606..33659f53af2 100644
--- a/src/mame/video/warriorb.c
+++ b/src/mame/video/warriorb.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:David Graves
#include "emu.h"
#include "includes/warriorb.h"
diff --git a/src/mame/video/wgp.c b/src/mame/video/wgp.c
index 602f2150af1..9cd1ef49871 100644
--- a/src/mame/video/wgp.c
+++ b/src/mame/video/wgp.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:David Graves
#include "emu.h"
#include "includes/wgp.h"
diff --git a/src/mess/audio/mac.c b/src/mess/audio/mac.c
index b93b4d86e0d..7a0b7a93a62 100644
--- a/src/mess/audio/mac.c
+++ b/src/mess/audio/mac.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Nathan Woods, Raphael Nabet, R. Belmont
/***************************************************************************
diff --git a/src/mess/audio/mea8000.h b/src/mess/audio/mea8000.h
index 7510ff2617c..5d09ee938c9 100644
--- a/src/mess/audio/mea8000.h
+++ b/src/mess/audio/mea8000.h
@@ -35,7 +35,7 @@ enum mea8000_state
MEA8000_STOPPED, /* nothing to do, timer disabled */
MEA8000_WAIT_FIRST, /* received pitch, wait for first full trame, timer disabled */
MEA8000_STARTED, /* playing a frame, timer on */
- MEA8000_SLOWING, /* repating last frame with decreasing amplitude, timer on */
+ MEA8000_SLOWING /* repeating last frame with decreasing amplitude, timer on */
};
ALLOW_SAVE_TYPE( mea8000_state );
diff --git a/src/mess/drivers/a310.c b/src/mess/drivers/a310.c
index e262865d15c..91018398b42 100644
--- a/src/mess/drivers/a310.c
+++ b/src/mess/drivers/a310.c
@@ -377,7 +377,7 @@ static MACHINE_CONFIG_START( a310, a310_state )
MCFG_RAM_DEFAULT_SIZE("2M")
MCFG_RAM_EXTRA_OPTIONS("512K, 1M, 4M, 8M, 16M")
- MCFG_WD1772x_ADD("fdc", 8000000 / 1) // TODO: frequency
+ MCFG_WD1772_ADD("fdc", 8000000 / 1) // TODO: frequency
MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE( a310_state, a310_wd177x_intrq_w))
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(a310_state, a310_wd177x_drq_w))
MCFG_FLOPPY_DRIVE_ADD("fdc:0", a310_floppies, "35dd", a310_state::floppy_formats)
diff --git a/src/mess/drivers/abc1600.c b/src/mess/drivers/abc1600.c
index f12862cc3e5..57580466632 100644
--- a/src/mess/drivers/abc1600.c
+++ b/src/mess/drivers/abc1600.c
@@ -895,7 +895,7 @@ static MACHINE_CONFIG_START( abc1600, abc1600_state )
MCFG_NMC9306_ADD(NMC9306_TAG)
MCFG_E0516_ADD(E050_C16PC_TAG, XTAL_32_768kHz)
- MCFG_FD1797x_ADD(SAB1797_02P_TAG, XTAL_64MHz/64)
+ MCFG_FD1797_ADD(SAB1797_02P_TAG, XTAL_64MHz/64)
MCFG_WD_FDC_INTRQ_CALLBACK(DEVWRITELINE(Z8536B1_TAG, z8536_device, pb7_w))
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(abc1600_state, fdc_drq_w))
diff --git a/src/mess/drivers/abc80.c b/src/mess/drivers/abc80.c
index 3bafffb10fc..101f4e8865e 100644
--- a/src/mess/drivers/abc80.c
+++ b/src/mess/drivers/abc80.c
@@ -269,7 +269,7 @@ READ8_MEMBER( abc80_state::pio_pa_r )
data |= (m_key_strobe << 7);
return data;
-};
+}
READ8_MEMBER( abc80_state::pio_pb_r )
{
@@ -305,7 +305,7 @@ READ8_MEMBER( abc80_state::pio_pb_r )
if (LOG) logerror("%s %s read tape latch %u\n", machine().time().as_string(), machine().describe_context(), m_tape_in_latch);
return data;
-};
+}
WRITE8_MEMBER( abc80_state::pio_pb_w )
{
@@ -333,15 +333,15 @@ WRITE8_MEMBER( abc80_state::pio_pb_w )
// cassette motor
if (BIT(data, 5))
{
- if (!m_cassette_timer->enabled()) if (LOG) logerror("%s %s started cassette motor\n", machine().time().as_string(), machine().describe_context());
+ if (!m_motor) if (LOG) logerror("%s %s started cassette motor\n", machine().time().as_string(), machine().describe_context());
m_cassette->change_state(CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR);
- m_cassette_timer->enable(true);
+ m_motor = true;
}
else
{
- if (m_cassette_timer->enabled()) if (LOG) logerror("%s %s stopped cassette motor\n", machine().time().as_string(), machine().describe_context());
+ if (m_motor) if (LOG) logerror("%s %s stopped cassette motor\n", machine().time().as_string(), machine().describe_context());
m_cassette->change_state(CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR);
- m_cassette_timer->enable(false);
+ m_motor = false;
}
// cassette data
@@ -356,7 +356,7 @@ WRITE8_MEMBER( abc80_state::pio_pb_w )
m_pio->pb7_w(m_tape_in_latch);
}
-};
+}
//-------------------------------------------------
@@ -420,6 +420,8 @@ void abc80_state::device_timer(emu_timer &timer, device_timer_id id, int param,
case TIMER_ID_CASSETTE:
{
+ if (!m_motor) return;
+
int tape_in = m_cassette->input() > 0;
if (m_tape_in != tape_in)
@@ -469,12 +471,14 @@ void abc80_state::machine_start()
// start timers
m_cassette_timer = timer_alloc(TIMER_ID_CASSETTE);
m_cassette_timer->adjust(attotime::from_hz(44100), 0, attotime::from_hz(44100));
- m_cassette_timer->enable(false);
// register for state saving
save_item(NAME(m_key_data));
save_item(NAME(m_key_strobe));
save_item(NAME(m_pio_astb));
+ save_item(NAME(m_latch));
+ save_item(NAME(m_blink));
+ save_item(NAME(m_motor));
save_item(NAME(m_tape_in));
save_item(NAME(m_tape_in_latch));
}
diff --git a/src/mess/drivers/ace.c b/src/mess/drivers/ace.c
index b1416ff675b..06cbec86d42 100644
--- a/src/mess/drivers/ace.c
+++ b/src/mess/drivers/ace.c
@@ -599,7 +599,7 @@ READ8_MEMBER( ace_state::pio_pa_r )
*/
return 0;
-};
+}
WRITE8_MEMBER( ace_state::pio_pa_w )
{
@@ -620,7 +620,7 @@ WRITE8_MEMBER( ace_state::pio_pa_w )
// centronics strobe
m_centronics->write_strobe(!BIT(data, 6));
-};
+}
//**************************************************************************
// MACHINE INITIALIZATION
diff --git a/src/mess/drivers/advision.c b/src/mess/drivers/advision.c
index cc940c75896..324e04ba842 100644
--- a/src/mess/drivers/advision.c
+++ b/src/mess/drivers/advision.c
@@ -78,7 +78,7 @@ static MACHINE_CONFIG_START( advision, advision_state )
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
MCFG_SCREEN_UPDATE_DRIVER(advision_state, screen_update)
MCFG_SCREEN_SIZE(320, 200)
- MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 200-1)
+ MCFG_SCREEN_VISIBLE_AREA(84, 235, 60, 142)
MCFG_SCREEN_PALETTE("palette")
MCFG_PALETTE_ADD("palette", 8)
MCFG_PALETTE_INIT_OWNER(advision_state, advision)
diff --git a/src/mess/drivers/alphatro.c b/src/mess/drivers/alphatro.c
index 6c9c00c3757..355ad41a8d8 100644
--- a/src/mess/drivers/alphatro.c
+++ b/src/mess/drivers/alphatro.c
@@ -54,7 +54,7 @@ class alphatro_state : public driver_device
public:
enum
{
- TIMER_SYSTEM,
+ TIMER_SYSTEM
};
alphatro_state(const machine_config &mconfig, device_type type, const char *tag)
diff --git a/src/mess/drivers/altos5.c b/src/mess/drivers/altos5.c
index c58741feeb1..db9876fc1d0 100644
--- a/src/mess/drivers/altos5.c
+++ b/src/mess/drivers/altos5.c
@@ -430,7 +430,7 @@ static MACHINE_CONFIG_START( altos5, altos5_state )
MCFG_RS232_CTS_HANDLER(DEVWRITELINE("z80sio", z80dart_device, ctsb_w))
MCFG_TIMER_DRIVER_ADD_PERIODIC("ctc_tick", altos5_state, ctc_tick, attotime::from_hz(XTAL_8MHz / 4))
- MCFG_FD1797x_ADD("fdc", XTAL_8MHz / 8)
+ MCFG_FD1797_ADD("fdc", XTAL_8MHz / 8)
MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(altos5_state, fdc_intrq_w))
MCFG_WD_FDC_DRQ_CALLBACK(DEVWRITELINE("z80dma", z80dma_device, rdy_w))
MCFG_FLOPPY_DRIVE_ADD("fdc:0", altos5_floppies, "525qd", floppy_image_device::default_floppy_formats)
diff --git a/src/mess/drivers/ampro.c b/src/mess/drivers/ampro.c
index 6e17ad92ffb..8dccc887192 100644
--- a/src/mess/drivers/ampro.c
+++ b/src/mess/drivers/ampro.c
@@ -179,7 +179,7 @@ static MACHINE_CONFIG_START( ampro, ampro_state )
MCFG_RS232_RXD_HANDLER(DEVWRITELINE("z80dart", z80dart_device, rxa_w))
MCFG_TIMER_DRIVER_ADD_PERIODIC("ctc_tick", ampro_state, ctc_tick, attotime::from_hz(XTAL_16MHz / 8))
- MCFG_WD1772x_ADD("fdc", XTAL_16MHz / 2)
+ MCFG_WD1772_ADD("fdc", XTAL_16MHz / 2)
MCFG_FLOPPY_DRIVE_ADD("fdc:0", ampro_floppies, "525dd", floppy_image_device::default_floppy_formats)
MCFG_SOFTWARE_LIST_ADD("flop_list", "ampro")
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/amstrad.c b/src/mess/drivers/amstrad.c
index b6ed946e1e9..e38f820c85b 100644
--- a/src/mess/drivers/amstrad.c
+++ b/src/mess/drivers/amstrad.c
@@ -563,25 +563,25 @@ static INPUT_PORTS_START( plus )
The connectors' description for both CPCs and CPC+'s can be found at http://www.hardwarebook.info/Category:Computer */
PORT_START("analog.0")
- PORT_BIT(0x3f , 0, IPT_TRACKBALL_X)
+ PORT_BIT(0x3f , 0, IPT_AD_STICK_X)
PORT_SENSITIVITY(100)
PORT_KEYDELTA(10)
PORT_PLAYER(1)
PORT_START("analog.1")
- PORT_BIT(0x3f , 0, IPT_TRACKBALL_Y)
+ PORT_BIT(0x3f , 0, IPT_AD_STICK_Y)
PORT_SENSITIVITY(100)
PORT_KEYDELTA(10)
PORT_PLAYER(1)
PORT_START("analog.2")
- PORT_BIT(0x3f , 0, IPT_TRACKBALL_X)
+ PORT_BIT(0x3f , 0, IPT_AD_STICK_X)
PORT_SENSITIVITY(100)
PORT_KEYDELTA(10)
PORT_PLAYER(2)
PORT_START("analog.3")
- PORT_BIT(0x3f , 0, IPT_TRACKBALL_Y)
+ PORT_BIT(0x3f , 0, IPT_AD_STICK_Y)
PORT_SENSITIVITY(100)
PORT_KEYDELTA(10)
PORT_PLAYER(2)
@@ -780,6 +780,7 @@ speed of 3.8 MHz */
static SLOT_INTERFACE_START( amstrad_floppies )
SLOT_INTERFACE( "3ssdd", FLOPPY_3_SSDD )
+ SLOT_INTERFACE( "35ssdd", FLOPPY_35_DD )
SLOT_INTERFACE_END
static SLOT_INTERFACE_START( aleste_floppies )
@@ -795,6 +796,23 @@ static MACHINE_CONFIG_FRAGMENT( cpcplus_cartslot )
MCFG_SOFTWARE_LIST_ADD("cart_list", "gx4000")
MACHINE_CONFIG_END
+SLOT_INTERFACE_START(cpc464_exp_cards)
+ SLOT_INTERFACE("ddi1", CPC_DDI1)
+ SLOT_INTERFACE("ssa1", CPC_SSA1)
+ SLOT_INTERFACE("dkspeech", CPC_DKSPEECH)
+ SLOT_INTERFACE("rom", CPC_ROM)
+ SLOT_INTERFACE("multiface2", CPC_MFACE2)
+ SLOT_INTERFACE("pds", CPC_PDS)
+ SLOT_INTERFACE("rs232", CPC_RS232)
+ SLOT_INTERFACE("amsrs232", CPC_RS232_AMS)
+ SLOT_INTERFACE("sf2", CPC_SYMBIFACE2)
+ SLOT_INTERFACE("amdrum", CPC_AMDRUM)
+ SLOT_INTERFACE("playcity", CPC_PLAYCITY)
+ SLOT_INTERFACE("smartwatch", CPC_SMARTWATCH)
+ SLOT_INTERFACE("brunword4", CPC_BRUNWORD_MK4)
+ SLOT_INTERFACE("hd20", CPC_HD20)
+SLOT_INTERFACE_END
+
SLOT_INTERFACE_START(cpc_exp_cards)
SLOT_INTERFACE("ssa1", CPC_SSA1)
SLOT_INTERFACE("dkspeech", CPC_DKSPEECH)
@@ -808,6 +826,7 @@ SLOT_INTERFACE_START(cpc_exp_cards)
SLOT_INTERFACE("playcity", CPC_PLAYCITY)
SLOT_INTERFACE("smartwatch", CPC_SMARTWATCH)
SLOT_INTERFACE("brunword4", CPC_BRUNWORD_MK4)
+ SLOT_INTERFACE("hd20", CPC_HD20)
SLOT_INTERFACE_END
SLOT_INTERFACE_START(cpcplus_exp_cards)
@@ -821,6 +840,7 @@ SLOT_INTERFACE_START(cpcplus_exp_cards)
SLOT_INTERFACE("amdrum", CPC_AMDRUM)
SLOT_INTERFACE("playcity", CPC_PLAYCITY)
SLOT_INTERFACE("smartwatch", CPC_SMARTWATCH)
+ SLOT_INTERFACE("hd20", CPC_HD20)
SLOT_INTERFACE_END
SLOT_INTERFACE_START(amstrad_centronics_devices)
@@ -833,7 +853,7 @@ SLOT_INTERFACE_START(amstrad_centronics_devices)
SLOT_INTERFACE("digiblst", CENTRONICS_DIGIBLASTER)
SLOT_INTERFACE_END
-static MACHINE_CONFIG_START( amstrad_nofdc, amstrad_state )
+static MACHINE_CONFIG_START( amstrad_base, amstrad_state )
/* Machine hardware */
MCFG_CPU_ADD("maincpu", Z80, XTAL_16MHz / 4)
MCFG_CPU_PROGRAM_MAP(amstrad_mem)
@@ -894,8 +914,11 @@ static MACHINE_CONFIG_START( amstrad_nofdc, amstrad_state )
MCFG_SOFTWARE_LIST_ADD("cass_list","cpc_cass")
+MACHINE_CONFIG_END
+
+static MACHINE_CONFIG_DERIVED( cpc464, amstrad_base )
MCFG_DEVICE_ADD("exp", CPC_EXPANSION_SLOT, 0)
- MCFG_DEVICE_SLOT_INTERFACE(cpc_exp_cards, NULL, false)
+ MCFG_DEVICE_SLOT_INTERFACE(cpc464_exp_cards, NULL, false)
MCFG_CPC_EXPANSION_SLOT_OUT_IRQ_CB(INPUTLINE("maincpu", 0))
MCFG_CPC_EXPANSION_SLOT_OUT_NMI_CB(INPUTLINE("maincpu", INPUT_LINE_NMI))
MCFG_CPC_EXPANSION_SLOT_OUT_ROMDIS_CB(WRITELINE(amstrad_state, cpc_romdis)) // ROMDIS
@@ -903,21 +926,50 @@ static MACHINE_CONFIG_START( amstrad_nofdc, amstrad_state )
/* internal ram */
MCFG_RAM_ADD(RAM_TAG)
- MCFG_RAM_DEFAULT_SIZE("128K")
- MCFG_RAM_EXTRA_OPTIONS("64K,320K,576K")
+ MCFG_RAM_DEFAULT_SIZE("64K")
+ MCFG_RAM_EXTRA_OPTIONS("128K,320K,576K")
MACHINE_CONFIG_END
-static MACHINE_CONFIG_DERIVED( amstrad, amstrad_nofdc )
+static MACHINE_CONFIG_DERIVED( cpc664, amstrad_base )
MCFG_UPD765A_ADD("upd765", true, true)
-
MCFG_FLOPPY_DRIVE_ADD("upd765:0", amstrad_floppies, "3ssdd", floppy_image_device::default_floppy_formats)
- MCFG_FLOPPY_DRIVE_ADD("upd765:1", amstrad_floppies, "3ssdd", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("upd765:1", amstrad_floppies, "35ssdd", floppy_image_device::default_floppy_formats)
+ MCFG_SOFTWARE_LIST_ADD("flop_list","cpc_flop")
+ MCFG_DEVICE_ADD("exp", CPC_EXPANSION_SLOT, 0)
+ MCFG_DEVICE_SLOT_INTERFACE(cpc_exp_cards, NULL, false)
+ MCFG_CPC_EXPANSION_SLOT_OUT_IRQ_CB(INPUTLINE("maincpu", 0))
+ MCFG_CPC_EXPANSION_SLOT_OUT_NMI_CB(INPUTLINE("maincpu", INPUT_LINE_NMI))
+ MCFG_CPC_EXPANSION_SLOT_OUT_ROMDIS_CB(WRITELINE(amstrad_state, cpc_romdis)) // ROMDIS
+ MCFG_CPC_EXPANSION_SLOT_ROM_SELECT(WRITE8(amstrad_state,rom_select))
+
+ /* internal ram */
+ MCFG_RAM_ADD(RAM_TAG)
+ MCFG_RAM_DEFAULT_SIZE("64K")
+ MCFG_RAM_EXTRA_OPTIONS("128K,320K,576K")
+MACHINE_CONFIG_END
+
+static MACHINE_CONFIG_DERIVED( cpc6128, amstrad_base )
+ MCFG_UPD765A_ADD("upd765", true, true)
+ MCFG_FLOPPY_DRIVE_ADD("upd765:0", amstrad_floppies, "3ssdd", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("upd765:1", amstrad_floppies, "35ssdd", floppy_image_device::default_floppy_formats)
MCFG_SOFTWARE_LIST_ADD("flop_list","cpc_flop")
+
+ MCFG_DEVICE_ADD("exp", CPC_EXPANSION_SLOT, 0)
+ MCFG_DEVICE_SLOT_INTERFACE(cpc_exp_cards, NULL, false)
+ MCFG_CPC_EXPANSION_SLOT_OUT_IRQ_CB(INPUTLINE("maincpu", 0))
+ MCFG_CPC_EXPANSION_SLOT_OUT_NMI_CB(INPUTLINE("maincpu", INPUT_LINE_NMI))
+ MCFG_CPC_EXPANSION_SLOT_OUT_ROMDIS_CB(WRITELINE(amstrad_state, cpc_romdis)) // ROMDIS
+ MCFG_CPC_EXPANSION_SLOT_ROM_SELECT(WRITE8(amstrad_state,rom_select))
+
+ /* internal ram */
+ MCFG_RAM_ADD(RAM_TAG)
+ MCFG_RAM_DEFAULT_SIZE("128K")
+ MCFG_RAM_EXTRA_OPTIONS("320K,576K")
MACHINE_CONFIG_END
-static MACHINE_CONFIG_DERIVED( kccomp, amstrad )
+static MACHINE_CONFIG_DERIVED( kccomp, cpc6128 )
MCFG_MACHINE_START_OVERRIDE(amstrad_state,kccomp)
MCFG_MACHINE_RESET_OVERRIDE(amstrad_state,kccomp)
@@ -989,7 +1041,7 @@ static MACHINE_CONFIG_START( cpcplus, amstrad_state )
MCFG_FRAGMENT_ADD(cpcplus_cartslot)
MCFG_FLOPPY_DRIVE_ADD("upd765:0", amstrad_floppies, "3ssdd", floppy_image_device::default_floppy_formats)
- MCFG_FLOPPY_DRIVE_ADD("upd765:1", amstrad_floppies, "3ssdd", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("upd765:1", amstrad_floppies, "35ssdd", floppy_image_device::default_floppy_formats)
MCFG_DEVICE_ADD("exp", CPC_EXPANSION_SLOT, 0)
MCFG_DEVICE_SLOT_INTERFACE(cpcplus_exp_cards, NULL, false)
@@ -1057,7 +1109,7 @@ static MACHINE_CONFIG_START( gx4000, amstrad_state )
MACHINE_CONFIG_END
-static MACHINE_CONFIG_DERIVED( aleste, amstrad )
+static MACHINE_CONFIG_DERIVED( aleste, cpc6128 )
MCFG_MACHINE_START_OVERRIDE(amstrad_state,aleste)
MCFG_MACHINE_RESET_OVERRIDE(amstrad_state,aleste)
@@ -1132,7 +1184,6 @@ ROM_START( cpc464 )
ROM_REGION(0x01c000, "maincpu", 0)
/* load the os to offset 0x01000 from memory base */
ROM_LOAD("cpc464.rom", 0x10000, 0x8000, CRC(40852f25) SHA1(56d39c463da60968d93e58b4ba0e675829412a20))
- ROM_LOAD("cpcados.rom", 0x18000, 0x4000, CRC(1fe22ecd) SHA1(39102c8e9cb55fcc0b9b62098780ed4a3cb6a4bb))
ROM_END
@@ -1195,14 +1246,14 @@ ROM_END
*
*************************************/
-/* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */
-COMP( 1984, cpc464, 0, 0, amstrad, cpc464, driver_device, 0, "Amstrad plc", "Amstrad CPC464", 0 )
-COMP( 1985, cpc664, cpc464, 0, amstrad, cpc664, driver_device, 0, "Amstrad plc", "Amstrad CPC664", 0 )
-COMP( 1985, cpc6128, cpc464, 0, amstrad, cpc6128, driver_device, 0, "Amstrad plc", "Amstrad CPC6128", 0 )
-COMP( 1985, cpc6128f, cpc464, 0, amstrad, cpc6128f, driver_device, 0, "Amstrad plc", "Amstrad CPC6128 (France, AZERTY Keyboard)", 0 )
-COMP( 1985, cpc6128s, cpc464, 0, amstrad, cpc6128s, driver_device, 0, "Amstrad plc", "Amstrad CPC6128 (Sweden/Finland)", 0 )
-COMP( 1990, cpc464p, 0, 0, cpcplus, plus, driver_device, 0, "Amstrad plc", "Amstrad CPC464+", 0 )
-COMP( 1990, cpc6128p, 0, 0, cpcplus, plus, driver_device, 0, "Amstrad plc", "Amstrad CPC6128+", 0 )
-CONS( 1990, gx4000, 0, 0, gx4000, gx4000, driver_device, 0, "Amstrad plc", "Amstrad GX4000", 0 )
-COMP( 1989, kccomp, cpc464, 0, kccomp, kccomp, driver_device, 0, "VEB Mikroelektronik", "KC Compact", 0 )
-COMP( 1993, al520ex, cpc464, 0, aleste, aleste, driver_device, 0, "Patisonic", "Aleste 520EX", GAME_IMPERFECT_SOUND )
+/* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */
+COMP( 1984, cpc464, 0, 0, cpc464, cpc464, driver_device, 0, "Amstrad plc", "Amstrad CPC464", 0 )
+COMP( 1985, cpc664, cpc464, 0, cpc664, cpc664, driver_device, 0, "Amstrad plc", "Amstrad CPC664", 0 )
+COMP( 1985, cpc6128, cpc464, 0, cpc6128, cpc6128, driver_device, 0, "Amstrad plc", "Amstrad CPC6128", 0 )
+COMP( 1985, cpc6128f, cpc464, 0, cpc6128, cpc6128f, driver_device, 0, "Amstrad plc", "Amstrad CPC6128 (France, AZERTY Keyboard)", 0 )
+COMP( 1985, cpc6128s, cpc464, 0, cpc6128, cpc6128s, driver_device, 0, "Amstrad plc", "Amstrad CPC6128 (Sweden/Finland)", 0 )
+COMP( 1990, cpc464p, 0, 0, cpcplus, plus, driver_device, 0, "Amstrad plc", "Amstrad CPC464+", 0 )
+COMP( 1990, cpc6128p, 0, 0, cpcplus, plus, driver_device, 0, "Amstrad plc", "Amstrad CPC6128+", 0 )
+CONS( 1990, gx4000, 0, 0, gx4000, gx4000, driver_device, 0, "Amstrad plc", "Amstrad GX4000", 0 )
+COMP( 1989, kccomp, cpc464, 0, kccomp, kccomp, driver_device, 0, "VEB Mikroelektronik", "KC Compact", 0 )
+COMP( 1993, al520ex, cpc464, 0, aleste, aleste, driver_device, 0, "Patisonic", "Aleste 520EX", GAME_IMPERFECT_SOUND )
diff --git a/src/mess/drivers/apexc.c b/src/mess/drivers/apexc.c
index 01be1660fa9..bc5515274e9 100644
--- a/src/mess/drivers/apexc.c
+++ b/src/mess/drivers/apexc.c
@@ -1,4 +1,4 @@
-// license:???
+// license:GPL-2.0+
// copyright-holders:Raphael Nabet, Robbbert
/*
drivers/apexc.c : APEXC driver
diff --git a/src/mess/drivers/apf.c b/src/mess/drivers/apf.c
index c873cc9c48c..c46b7dd3701 100644
--- a/src/mess/drivers/apf.c
+++ b/src/mess/drivers/apf.c
@@ -1,10 +1,10 @@
-// license:GPL-2.0+
-// copyright-holders:Peter Trauner
+// license:BSD-3-Clause
+// copyright-holders:Robbbert
/******************************************************************************
-driver by ?
+Driver completely rewritten by Robbbert in a process begun on 2014-01-22.
-PeT around February 2008:
+Based on the previous work done by PeT around February 2008, and possible others prior.
added apfm1000 cartridge loading
fixed apfm1000 pads
added apf video mode
@@ -62,6 +62,7 @@ ToDo:
- Add back the disk support when we can get some info on it
(6600, 6500-6503 wd179x disc controller? 6400, 6401)
- Need to add back the disk format in the new wdc code
+ (40 tracks, 1 head, 8 sectors, 256 bytes sector length, first sector id 1)
- Need disk-based software
@@ -494,23 +495,6 @@ static SLOT_INTERFACE_START( apf_floppies )
SLOT_INTERFACE( "525dd", FLOPPY_525_SSDD )
SLOT_INTERFACE_END
-#if 0
-static LEGACY_FLOPPY_OPTIONS_START(apfimag)
- LEGACY_FLOPPY_OPTION(apfimag, "apd", "APF disk image", basicdsk_identify_default, basicdsk_construct_default, NULL,
- HEADS([1])
- TRACKS([40])
- SECTORS([8])
- SECTOR_LENGTH([256])
- FIRST_SECTOR_ID([1]))
-LEGACY_FLOPPY_OPTIONS_END
-
-static const floppy_interface apfimag_floppy_interface =
-{
- FLOPPY_STANDARD_5_25_SSDD_40,
- LEGACY_FLOPPY_OPTIONS_NAME(apfimag),
- NULL
-};
-#endif
static SLOT_INTERFACE_START(apf_cart)
SLOT_INTERFACE_INTERNAL("std", APF_ROM_STD)
@@ -576,7 +560,7 @@ static MACHINE_CONFIG_DERIVED( apfimag, apfm1000 )
MCFG_CASSETTE_FORMATS(apf_cassette_formats)
MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_SPEAKER_ENABLED | CASSETTE_MOTOR_DISABLED)
- MCFG_FD1771x_ADD("fdc", 1000000) // guess
+ MCFG_FD1771_ADD("fdc", 1000000) // guess
MCFG_FLOPPY_DRIVE_ADD("fdc:0", apf_floppies, "525dd", floppy_image_device::default_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("fdc:1", apf_floppies, "525dd", floppy_image_device::default_floppy_formats)
diff --git a/src/mess/drivers/apollo.c b/src/mess/drivers/apollo.c
index 1bd1fe9a2cf..d6ddecf3fd9 100644
--- a/src/mess/drivers/apollo.c
+++ b/src/mess/drivers/apollo.c
@@ -597,11 +597,20 @@ WRITE16_MEMBER(apollo_state::apollo_atbus_io_w)
READ16_MEMBER(apollo_state::apollo_atbus_memory_r)
{
- return 0xffff;
+ // Motorola CPU is MSB first, ISA Bus is LSB first
+ UINT16 data = m_isa->prog16_swap_r(space, offset, mem_mask);
+
+ SLOG2(("apollo_atbus_memory_r at %08x = %04x & %04x", offset*2, data, mem_mask));
+
+ return data;
}
WRITE16_MEMBER(apollo_state::apollo_atbus_memory_w)
{
+ SLOG2(("apollo_atbus_memory_w at %08x = %04x & %04x", offset*2, data, mem_mask));
+
+ // Motorola CPU is MSB first, ISA Bus is LSB first
+ m_isa->prog16_swap_w(space, offset, data, mem_mask);
}
/***************************************************************************
@@ -703,8 +712,6 @@ static ADDRESS_MAP_START(dn3500_map, AS_PROGRAM, 32, apollo_state )
AM_RANGE(ATBUS_IO_BASE, ATBUS_IO_END) AM_READWRITE16(apollo_atbus_io_r, apollo_atbus_io_w, 0xffffffff)
- AM_RANGE(0x080000, 0x081fff) AM_ROM /* 3C505 boot ROM */
-
// FIXME: must match with RAM size in driver/apollo_sio.c
// AM_RANGE(DN3500_RAM_BASE, DN3500_RAM_END) AM_RAM /* 8MB RAM */
AM_RANGE(DN3500_RAM_BASE, DN3500_RAM_END) AM_RAM_WRITE(ram_with_parity_w) AM_SHARE("messram")
@@ -743,8 +750,6 @@ static ADDRESS_MAP_START(dsp3500_map, AS_PROGRAM, 32, apollo_state )
AM_RANGE(ATBUS_IO_BASE, ATBUS_IO_END) AM_READWRITE16(apollo_atbus_io_r, apollo_atbus_io_w, 0xffffffff)
- AM_RANGE(0x080000, 0x081fff) AM_ROM /* 3C505 boot ROM */
-
AM_RANGE(DN3500_RAM_BASE, DN3500_RAM_END) AM_RAM_WRITE(ram_with_parity_w) AM_SHARE("messram")
AM_RANGE(ATBUS_MEMORY_BASE, ATBUS_MEMORY_END) AM_READWRITE16(apollo_atbus_memory_r, apollo_atbus_memory_w, 0xffffffff)
@@ -777,8 +782,6 @@ static ADDRESS_MAP_START(dn3000_map, AS_PROGRAM, 32, apollo_state )
AM_RANGE(ATBUS_IO_BASE, ATBUS_IO_END) AM_READWRITE16(apollo_atbus_io_r, apollo_atbus_io_w, 0xffffffff)
- AM_RANGE(0x080000, 0x081fff) AM_ROM /* 3C505 boot ROM */
-
// FIXME: must match with RAM size in driver/apollo_sio.c
// AM_RANGE(DN3000_RAM_BASE, DN3000_RAM_END) AM_RAM /* 8MB RAM */
AM_RANGE(DN3000_RAM_BASE, DN3000_RAM_END) AM_RAM_WRITE(ram_with_parity_w) AM_SHARE("messram")
@@ -807,8 +810,6 @@ static ADDRESS_MAP_START(dsp3000_map, AS_PROGRAM, 32, apollo_state )
AM_RANGE(ATBUS_IO_BASE, ATBUS_IO_END) AM_READWRITE16(apollo_atbus_io_r, apollo_atbus_io_w, 0xffffffff)
- AM_RANGE(0x080000, 0x081fff) AM_ROM /* 3C505 boot ROM */
-
// FIXME: must match with RAM size in driver/apollo_sio.c
// AM_RANGE(DN3000_RAM_BASE, DN3000_RAM_END) AM_RAM /* 8MB RAM */
AM_RANGE(DN3000_RAM_BASE, DN3000_RAM_END) AM_RAM_WRITE(ram_with_parity_w) AM_SHARE("messram")
@@ -851,8 +852,6 @@ static ADDRESS_MAP_START(dn5500_map, AS_PROGRAM, 32, apollo_state )
AM_RANGE(ATBUS_IO_BASE, ATBUS_IO_END) AM_READWRITE16(apollo_atbus_io_r, apollo_atbus_io_w, 0xffffffff)
- AM_RANGE(0x080000, 0x081fff) AM_ROM /* 3C505 boot ROM */
-
// FIXME: must match with RAM size in driver/apollo_sio.c
// AM_RANGE(DN3500_RAM_BASE, DN3500_RAM_END) AM_RAM /* 8MB RAM */
AM_RANGE(DN5500_RAM_BASE, DN5500_RAM_END) AM_RAM_WRITE(ram_with_parity_w) AM_SHARE("messram")
@@ -894,8 +893,6 @@ static ADDRESS_MAP_START(dsp5500_map, AS_PROGRAM, 32, apollo_state )
AM_RANGE(ATBUS_IO_BASE, ATBUS_IO_END) AM_READWRITE16(apollo_atbus_io_r, apollo_atbus_io_w, 0xffffffff)
- AM_RANGE(0x080000, 0x081fff) AM_ROM /* 3C505 boot ROM */
-
// FIXME: must match with RAM size in driver/apollo_sio.c
AM_RANGE(DN5500_RAM_BASE, DN5500_RAM_END) AM_RAM_WRITE(ram_with_parity_w) AM_SHARE("messram")
diff --git a/src/mess/drivers/apple2.c b/src/mess/drivers/apple2.c
index 4c06eac3b7b..b6b71ffcdd3 100644
--- a/src/mess/drivers/apple2.c
+++ b/src/mess/drivers/apple2.c
@@ -1372,6 +1372,19 @@ ROM_START(apple2p) /* the autoboot apple2+ with applesoft (microsoft-written) ba
ROM_LOAD ( "341-0020-00.f8", 0x3800, 0x0800, CRC(079589c4) SHA1(a28852ff997b4790e53d8d0352112c4b1a395098)) /* 341-0020-00: Autostart Monitor/Applesoft Basic $f800; Was sometimes mounted on Language card; Label(from Apple Language Card - Front.jpg): S 8115 // C68018 // 341-0020-00 */
ROM_END
+ROM_START(elppa)
+ ROM_REGION(0x0800,"gfx1",0)
+ ROM_LOAD ( "elppa.chr", 0x0000, 0x0800, BAD_DUMP CRC(64f415c6) SHA1(f9d312f128c9557d9d6ac03bfad6c3ddf83e5659)) // Taken from 341-0036.chr used in apple2p
+
+ ROM_REGION(0x4000,"maincpu",0)
+ ROM_LOAD ( "elppa.d0", 0x1000, 0x0800, CRC(ce5b0e7e) SHA1(2c1a0aa023ae6deb2bddb8937345ee354028aeef))
+ ROM_LOAD ( "elppa.d8", 0x1800, 0x0800, CRC(bd409bad) SHA1(5145d238042938efbb9b71e0a4ef9a980b0e38de))
+ ROM_LOAD ( "elppa.e0", 0x2000, 0x0800, CRC(4c997c88) SHA1(70b639d8cbafcd5367d2f9dfd6890e5d1c6890f0))
+ ROM_LOAD ( "elppa.e8", 0x2800, 0x0800, CRC(5719871a) SHA1(37501be96d36d041667c15d63e0c1eff2f7dd4e9))
+ ROM_LOAD ( "elppa.f0", 0x3000, 0x0800, CRC(9a04eecf) SHA1(e6bf91ed28464f42b807f798fc6422e5948bf581))
+ ROM_LOAD ( "elppa.f8", 0x3800, 0x0800, CRC(62c0c761) SHA1(19f28544fd5021a2d72e6015b3183c462c0e86f8))
+ROM_END
+
ROM_START(prav82)
ROM_REGION(0x0800,"gfx1",0)
ROM_LOAD ( "pravetz82.chr", 0x0000, 0x0800, BAD_DUMP CRC(8c55c984) SHA1(5a5a202000576b88b4ae2e180dd2d1b9b337b594)) // Taken from Agat computer
@@ -1397,6 +1410,26 @@ ROM_START(prav8m)
ROM_LOAD ( "pravetz8m.f8", 0x3800, 0x0800, CRC(5bab0a46) SHA1(f6c0817ce37d2e2c43f482c339acaede0a73359b))
ROM_END
+ROM_START(uniap2pt)
+ ROM_REGION(0x1000,"gfx1",0)
+ ROM_LOAD ( "unitron.chr", 0x0000, 0x1000, CRC(7fdd1af6) SHA1(2f4f90d90f2f3a8c1fbea304e1072780fb22e698))
+
+ ROM_REGION(0x4000,"maincpu",0)
+ ROM_LOAD ( "unitron_pt.d0", 0x1000, 0x1000, CRC(311beae6) SHA1(f6379aba9ac982850edc314c93a393844a3349ef))
+ ROM_LOAD ( "unitron.e0" , 0x2000, 0x1000, CRC(0d494efd) SHA1(a2fd1223a3ca0cfee24a6afe66ea3c4c144dd98e))
+ ROM_LOAD ( "unitron.f0" , 0x3000, 0x1000, CRC(8e047c4a) SHA1(78c57c0e00dfce7fdec9437fe2b4c25def447e5d))
+ROM_END
+
+ROM_START(uniap2en)
+ ROM_REGION(0x1000,"gfx1",0)
+ ROM_LOAD ( "unitron.chr", 0x0000, 0x1000, CRC(7fdd1af6) SHA1(2f4f90d90f2f3a8c1fbea304e1072780fb22e698))
+
+ ROM_REGION(0x4000,"maincpu",0)
+ ROM_LOAD ( "unitron_en.d0", 0x1000, 0x1000, CRC(24d73c7b) SHA1(d17a15868dc875c67061c95ec53a6b2699d3a425))
+ ROM_LOAD ( "unitron.e0" , 0x2000, 0x1000, CRC(0d494efd) SHA1(a2fd1223a3ca0cfee24a6afe66ea3c4c144dd98e))
+ ROM_LOAD ( "unitron.f0" , 0x3000, 0x1000, CRC(8e047c4a) SHA1(78c57c0e00dfce7fdec9437fe2b4c25def447e5d))
+ROM_END
+
/*
J-Plus ROM numbers confirmed by:
http://mirrors.apple2.org.za/Apple%20II%20Documentation%20Project/Computers/Apple%20II/Apple%20II%20j-plus/Photos/Apple%20II%20j-plus%20-%20Motherboard.jpg
@@ -1415,6 +1448,19 @@ ROM_START(apple2jp)
ROM_LOAD ( "341-0047.f8", 0x3800, 0x0800, CRC(6ea8379b) SHA1(00a75ae3b58e1917ad640249366f654608589cf4))
ROM_END
+ROM_START(maxxi)
+ ROM_REGION(0x0800,"gfx1",0)
+ ROM_LOAD ( "maxxi.chr", 0x0000, 0x0800, BAD_DUMP CRC(64f415c6) SHA1(f9d312f128c9557d9d6ac03bfad6c3ddf83e5659)) // Taken from 341-0036.chr used in apple2p
+
+ ROM_REGION(0x4000,"maincpu",0)
+ ROM_LOAD ( "maxxi.d0", 0x1000, 0x1000, CRC(7831f025) SHA1(0eb4161e5223c0dde2d140fcbace80d292ff9dc6))
+ ROM_LOAD ( "maxxi.e0", 0x2000, 0x1000, CRC(0d494efd) SHA1(a2fd1223a3ca0cfee24a6afe66ea3c4c144dd98e))
+ ROM_LOAD ( "maxxi.f0", 0x3000, 0x1000, CRC(34e4d01b) SHA1(44853b2d59ddd234db76c1a0d529180fb1e008ef))
+
+ ROM_REGION(0x0800,"keyboard",0)
+ ROM_LOAD ( "maxxi_teclado.rom", 0x0000, 0x0800, CRC(10c2d5b6) SHA1(226036d2f6f8fa5675303640ee1e5f0bab1135c6))
+ROM_END
+
ROM_START(ace100)
ROM_REGION(0x0800,"gfx1",0)
ROM_LOAD ( "ace100.chr", 0x0000, 0x0800, BAD_DUMP CRC(64f415c6) SHA1(f9d312f128c9557d9d6ac03bfad6c3ddf83e5659)) // copy of a2.chr - real Ace chr is undumped
@@ -1519,8 +1565,12 @@ ROM_END
COMP( 1977, apple2, 0, 0, apple2, apple2, driver_device, 0, "Apple Computer", "Apple ][", GAME_SUPPORTS_SAVE )
COMP( 1979, apple2p, apple2, 0, apple2p, apple2p, driver_device, 0, "Apple Computer", "Apple ][+", GAME_SUPPORTS_SAVE )
COMP( 1980, apple2jp, apple2, 0, apple2p, apple2p, driver_device, 0, "Apple Computer", "Apple ][ J-Plus", GAME_SUPPORTS_SAVE )
+COMP( 198?, elppa, apple2, 0, apple2p, apple2p, driver_device, 0, "Victor do Brasil", "Elppa II+", GAME_SUPPORTS_SAVE )
+COMP( 1982, maxxi, apple2, 0, apple2p, apple2p, driver_device, 0, "Polymax", "Maxxi", GAME_SUPPORTS_SAVE )
COMP( 1982, prav82, apple2, 0, apple2p, apple2p, driver_device, 0, "Pravetz", "Pravetz 82", GAME_SUPPORTS_SAVE )
COMP( 1982, ace100, apple2, 0, apple2, apple2p, driver_device, 0, "Franklin Computer", "Franklin Ace 100", GAME_SUPPORTS_SAVE )
+COMP( 1982, uniap2en, apple2, 0, apple2p, apple2p, driver_device, 0, "Unitron Eletrônica", "Unitron AP II (in English)", GAME_SUPPORTS_SAVE )
+COMP( 1982, uniap2pt, apple2, 0, apple2p, apple2p, driver_device, 0, "Unitron Eletrônica", "Unitron AP II (in Brazilian Portuguese)", GAME_SUPPORTS_SAVE )
COMP( 1983, agat7, apple2, 0, apple2p, apple2p, driver_device, 0, "Agat", "Agat-7", GAME_NOT_WORKING) // disk controller ROM JSRs to $FCA8 which is a delay on apple II, illegal instruction crash here :(
// reverse font direction -\/
COMP( 1984, ivelultr, apple2, 0, apple2p, apple2p, driver_device, 0, "Ivasim", "Ivel Ultra", GAME_SUPPORTS_SAVE )
diff --git a/src/mess/drivers/apple2e.c b/src/mess/drivers/apple2e.c
index e270fa4d6fa..62b97a5b930 100644
--- a/src/mess/drivers/apple2e.c
+++ b/src/mess/drivers/apple2e.c
@@ -2973,30 +2973,6 @@ INPUT_PORTS_START( apple2ep )
PORT_INCLUDE(apple2_sysconfig)
INPUT_PORTS_END
-/* according to Steve Nickolas (author of Dapple), our original palette would
- * have been more appropriate for an Apple IIgs. So we've substituted in the
- * Robert Munafo palette instead, which is more accurate on 8-bit Apples
- */
-static const rgb_t apple2_palette[] =
-{
- rgb_t::black,
- rgb_t(0xE3, 0x1E, 0x60), /* Dark Red */
- rgb_t(0x60, 0x4E, 0xBD), /* Dark Blue */
- rgb_t(0xFF, 0x44, 0xFD), /* Purple */
- rgb_t(0x00, 0xA3, 0x60), /* Dark Green */
- rgb_t(0x9C, 0x9C, 0x9C), /* Dark Gray */
- rgb_t(0x14, 0xCF, 0xFD), /* Medium Blue */
- rgb_t(0xD0, 0xC3, 0xFF), /* Light Blue */
- rgb_t(0x60, 0x72, 0x03), /* Brown */
- rgb_t(0xFF, 0x6A, 0x3C), /* Orange */
- rgb_t(0x9C, 0x9C, 0x9C), /* Light Grey */
- rgb_t(0xFF, 0xA0, 0xD0), /* Pink */
- rgb_t(0x14, 0xF5, 0x3C), /* Light Green */
- rgb_t(0xD0, 0xDD, 0x8D), /* Yellow */
- rgb_t(0x72, 0xFF, 0xD0), /* Aquamarine */
- rgb_t(0xFF, 0xFF, 0xFF) /* White */
-};
-
static SLOT_INTERFACE_START(apple2_cards)
SLOT_INTERFACE("diskii", A2BUS_DISKII) /* Disk II Controller Card */
SLOT_INTERFACE("diskiing", A2BUS_DISKIING) /* Disk II Controller Card, cycle-accurate version */
diff --git a/src/mess/drivers/applix.c b/src/mess/drivers/applix.c
index c3914a1ced1..752a9b8af2c 100644
--- a/src/mess/drivers/applix.c
+++ b/src/mess/drivers/applix.c
@@ -884,7 +884,7 @@ static MACHINE_CONFIG_START( applix, applix_state )
MCFG_CASSETTE_ADD("cassette")
MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_MUTED)
- MCFG_WD1772x_ADD("fdc", XTAL_16MHz / 2) //connected to Z80H clock pin
+ MCFG_WD1772_ADD("fdc", XTAL_16MHz / 2) //connected to Z80H clock pin
MCFG_FLOPPY_DRIVE_ADD("fdc:0", applix_floppies, "35dd", applix_state::floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("fdc:1", applix_floppies, "35dd", applix_state::floppy_formats)
MCFG_TIMER_DRIVER_ADD_PERIODIC("applix_c", applix_state, cass_timer, attotime::from_hz(100000))
diff --git a/src/mess/drivers/apricot.c b/src/mess/drivers/apricot.c
index 322ddf731c7..943acc251d2 100644
--- a/src/mess/drivers/apricot.c
+++ b/src/mess/drivers/apricot.c
@@ -9,8 +9,6 @@
***************************************************************************/
-#include "bus/centronics/ctronics.h"
-#include "bus/rs232/rs232.h"
#include "cpu/i86/i86.h"
#include "cpu/i8089/i8089.h"
#include "machine/ram.h"
@@ -21,8 +19,12 @@
#include "machine/wd_fdc.h"
#include "video/mc6845.h"
#include "sound/sn76496.h"
+#include "machine/apricotkb_hle.h"
#include "imagedev/flopdrv.h"
#include "formats/apridisk.h"
+#include "bus/centronics/ctronics.h"
+#include "bus/rs232/rs232.h"
+#include "bus/apricot/expansion.h"
//**************************************************************************
@@ -35,9 +37,8 @@ public:
apricot_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
m_cpu(*this, "ic91"),
- m_ram(*this, RAM_TAG),
m_iop(*this, "ic71"),
- m_sn(*this, "ic7"),
+ m_ram(*this, RAM_TAG),
m_crtc(*this, "ic30"),
m_ppi(*this, "ic17"),
m_pic(*this, "ic31"),
@@ -54,13 +55,46 @@ public:
m_data_selector_rts(1),
m_video_mode(0),
m_display_on(1),
- m_display_enabled(0)
+ m_display_enabled(0),
+ m_centronics_fault(1),
+ m_centronics_perror(1),
+ m_bus_locked(0)
{ }
- required_device<cpu_device> m_cpu;
- required_device<ram_device> m_ram;
+ DECLARE_FLOPPY_FORMATS(floppy_formats);
+
+ DECLARE_WRITE_LINE_MEMBER(i8086_lock_w);
+ DECLARE_WRITE8_MEMBER(i8089_ca1_w);
+ DECLARE_WRITE8_MEMBER(i8089_ca2_w);
+ DECLARE_WRITE8_MEMBER(i8255_portb_w);
+ DECLARE_READ8_MEMBER(i8255_portc_r);
+ DECLARE_WRITE8_MEMBER(i8255_portc_w);
+ DECLARE_WRITE_LINE_MEMBER(timer_out1);
+ DECLARE_WRITE_LINE_MEMBER(timer_out2);
+ DECLARE_WRITE_LINE_MEMBER(fdc_intrq_w);
+ DECLARE_READ8_MEMBER(sio_da_r);
+ DECLARE_READ8_MEMBER(sio_ca_r);
+ DECLARE_READ8_MEMBER(sio_db_r);
+ DECLARE_READ8_MEMBER(sio_cb_r);
+
+ DECLARE_WRITE_LINE_MEMBER(write_centronics_fault);
+ DECLARE_WRITE_LINE_MEMBER(write_centronics_perror);
+
+ DECLARE_WRITE_LINE_MEMBER(apricot_mc6845_de) { m_display_enabled = state; };
+
+ DECLARE_WRITE_LINE_MEMBER(data_selector_dtr_w) { m_data_selector_dtr = state; };
+ DECLARE_WRITE_LINE_MEMBER(data_selector_rts_w) { m_data_selector_rts = state; };
+
+ MC6845_UPDATE_ROW(crtc_update_row);
+ UINT32 screen_update_apricot(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
+
+protected:
+ virtual void machine_start();
+
+private:
+ required_device<i8086_cpu_device> m_cpu;
required_device<i8089_device> m_iop;
- required_device<sn76489_device> m_sn;
+ required_device<ram_device> m_ram;
required_device<mc6845_device> m_crtc;
required_device<i8255_device> m_ppi;
required_device<pic8259_device> m_pic;
@@ -68,33 +102,12 @@ public:
required_device<z80sio0_device> m_sio;
required_device<rs232_port_device> m_rs232;
required_device<centronics_device> m_centronics;
- required_device<wd2793_t> m_fdc;
+ required_device<wd2797_t> m_fdc;
required_device<floppy_connector> m_floppy0;
required_device<floppy_connector> m_floppy1;
required_device<palette_device> m_palette;
required_shared_ptr<UINT16> m_screen_buffer;
- DECLARE_WRITE8_MEMBER( i8089_ca1_w );
- DECLARE_WRITE8_MEMBER( i8089_ca2_w );
- DECLARE_WRITE8_MEMBER( i8255_portb_w );
- DECLARE_READ8_MEMBER( i8255_portc_r );
- DECLARE_WRITE8_MEMBER( i8255_portc_w );
- DECLARE_WRITE_LINE_MEMBER( timer_out1 );
- DECLARE_WRITE_LINE_MEMBER( timer_out2 );
- DECLARE_WRITE_LINE_MEMBER( wd2793_intrq_w );
-
- DECLARE_WRITE_LINE_MEMBER( write_centronics_fault );
- DECLARE_WRITE_LINE_MEMBER( write_centronics_perror );
-
- DECLARE_WRITE_LINE_MEMBER( apricot_mc6845_de ) { m_display_enabled = state; };
-
- DECLARE_WRITE_LINE_MEMBER( data_selector_dtr_w ) { m_data_selector_dtr = state; };
- DECLARE_WRITE_LINE_MEMBER( data_selector_rts_w ) { m_data_selector_rts = state; };
-
- MC6845_UPDATE_ROW( crtc_update_row );
-
- virtual void machine_start();
-
int m_data_selector_dtr;
int m_data_selector_rts;
@@ -103,10 +116,10 @@ public:
int m_display_enabled;
- UINT32 screen_update_apricot(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
-
int m_centronics_fault;
int m_centronics_perror;
+
+ int m_bus_locked;
};
@@ -154,15 +167,29 @@ READ8_MEMBER( apricot_state::i8255_portc_r )
WRITE8_MEMBER( apricot_state::i8255_portb_w )
{
+ // bit 0, crt reset
+ // bit 1, not connected
+
m_display_on = BIT(data, 3);
m_video_mode = BIT(data, 4);
+ floppy_image_device *floppy = NULL;
+
+ // bit 5, enable disk select
+ // bit 6, disk select
if (!BIT(data, 5))
- m_fdc->set_floppy(BIT(data, 6) ? m_floppy1->get_device() : m_floppy0->get_device());
+ floppy = BIT(data, 6) ? m_floppy1->get_device() : m_floppy0->get_device();
+
+ m_fdc->set_floppy(floppy);
+
+ // bit 2, head load (motor on is wired to be active once a disk has been inserted)
+ // we just let the motor run all the time for now
+ if (floppy)
+ floppy->mon_w(0);
// switch video modes
- m_crtc->set_clock( m_video_mode ? XTAL_15MHz / 10 : XTAL_15MHz / 16);
- m_crtc->set_hpixels_per_column( m_video_mode ? 10 : 16);
+ m_crtc->set_clock(m_video_mode ? XTAL_15MHz / 10 : XTAL_15MHz / 16);
+ m_crtc->set_hpixels_per_column(m_video_mode ? 10 : 16);
// PB7 Centronics transceiver direction. 0 = output, 1 = input
}
@@ -195,19 +222,56 @@ WRITE_LINE_MEMBER( apricot_state::timer_out2 )
}
}
+READ8_MEMBER( apricot_state::sio_da_r )
+{
+ if (m_bus_locked)
+ return m_sio->m1_r();
+
+ return m_sio->da_r(space, offset);
+}
+
+READ8_MEMBER( apricot_state::sio_ca_r )
+{
+ if (m_bus_locked)
+ return m_sio->m1_r();
+
+ return m_sio->ca_r(space, offset);
+}
+
+READ8_MEMBER( apricot_state::sio_cb_r )
+{
+ if (m_bus_locked)
+ return m_sio->m1_r();
+
+ return m_sio->cb_r(space, offset);
+}
+
+READ8_MEMBER( apricot_state::sio_db_r )
+{
+ if (m_bus_locked)
+ return m_sio->m1_r();
+
+ return m_sio->db_r(space, offset);
+}
+
+
//**************************************************************************
// FLOPPY
//**************************************************************************
-WRITE_LINE_MEMBER( apricot_state::wd2793_intrq_w )
+WRITE_LINE_MEMBER( apricot_state::fdc_intrq_w )
{
m_pic->ir4_w(state);
m_iop->ext1_w(state);
}
+FLOPPY_FORMATS_MEMBER( apricot_state::floppy_formats )
+ FLOPPY_APRIDISK_FORMAT
+FLOPPY_FORMATS_END
+
static SLOT_INTERFACE_START( apricot_floppies )
- SLOT_INTERFACE( "d31v", SONY_OA_D31V )
- SLOT_INTERFACE( "d32w", SONY_OA_D32W )
+ SLOT_INTERFACE("d31v", SONY_OA_D31V)
+ SLOT_INTERFACE("d32w", SONY_OA_D32W)
SLOT_INTERFACE_END
@@ -227,36 +291,36 @@ UINT32 apricot_state::screen_update_apricot(screen_device &screen, bitmap_rgb32
MC6845_UPDATE_ROW( apricot_state::crtc_update_row )
{
- UINT8 *ram = m_ram->pointer();
const pen_t *pen = m_palette->pens();
- int i, x;
- if (m_video_mode)
+ for (int i = 0; i < x_count; i++)
{
- // text mode
- for (i = 0; i < x_count; i++)
+ UINT16 code = m_screen_buffer[(ma + i) & 0x7ff];
+ UINT16 offset = ((code & 0x7ff) << 5) | (ra << 1);
+ UINT16 data = m_cpu->space(AS_PROGRAM).read_word(offset);
+
+ if (m_video_mode)
{
- UINT16 code = m_screen_buffer[(ma + i) & 0x7ff];
- UINT16 offset = ((code & 0x7ff) << 5) | (ra << 1);
- UINT16 data = ram[offset + 1] << 8 | ram[offset];
int fill = 0;
+ if (i == cursor_x) fill = 1; // cursor?
if (BIT(code, 12) && BIT(data, 14)) fill = 1; // strike-through?
if (BIT(code, 13) && BIT(data, 15)) fill = 1; // underline?
// draw 10 pixels of the character
- for (x = 0; x <= 10; x++)
+ for (int x = 0; x <= 10; x++)
{
int color = fill ? 1 : BIT(data, x);
if (BIT(code, 15)) color = !color; // reverse?
bitmap.pix32(y, x + i*10) = pen[color ? 1 + BIT(code, 14) : 0];
}
}
- }
- else
- {
- // graphics mode
- fatalerror("Graphics mode not implemented!\n");
+ else
+ {
+ // draw 16 pixels of the cell
+ for (int x = 0; x <= 16; x++)
+ bitmap.pix32(y, x + i*16) = pen[BIT(data, x)];
+ }
}
}
@@ -266,13 +330,12 @@ MC6845_UPDATE_ROW( apricot_state::crtc_update_row )
void apricot_state::machine_start()
{
- // install shared memory to the main cpu and the iop
- m_cpu->space(AS_PROGRAM).install_ram(0x00000, m_ram->size() - 1, m_ram->pointer());
- m_iop->space(AS_PROGRAM).install_ram(0x00000, m_ram->size() - 1, m_ram->pointer());
+ membank("ram")->set_base(m_ram->pointer());
+}
- // motor on is connected to gnd
- m_floppy0->get_device()->mon_w(0);
- m_floppy1->get_device()->mon_w(0);
+WRITE_LINE_MEMBER( apricot_state::i8086_lock_w )
+{
+ m_bus_locked = state;
}
@@ -281,19 +344,21 @@ void apricot_state::machine_start()
//**************************************************************************
static ADDRESS_MAP_START( apricot_mem, AS_PROGRAM, 16, apricot_state )
-// AM_RANGE(0x00000, 0x3ffff) AM_RAMBANK("standard_ram")
-// AM_RANGE(0x40000, 0xeffff) AM_RAMBANK("expansion_ram")
+ AM_RANGE(0x00000, 0x3ffff) AM_RAMBANK("ram")
AM_RANGE(0xf0000, 0xf0fff) AM_MIRROR(0x7000) AM_RAM AM_SHARE("screen_buffer")
AM_RANGE(0xfc000, 0xfffff) AM_MIRROR(0x4000) AM_ROM AM_REGION("bootstrap", 0)
ADDRESS_MAP_END
static ADDRESS_MAP_START( apricot_io, AS_IO, 16, apricot_state )
AM_RANGE(0x00, 0x03) AM_DEVREADWRITE8("ic31", pic8259_device, read, write, 0x00ff)
- AM_RANGE(0x40, 0x47) AM_DEVREADWRITE8("ic68", wd2793_t, read, write, 0x00ff)
+ AM_RANGE(0x40, 0x47) AM_DEVREADWRITE8("ic68", wd2797_t, read, write, 0x00ff)
AM_RANGE(0x48, 0x4f) AM_DEVREADWRITE8("ic17", i8255_device, read, write, 0x00ff)
AM_RANGE(0x50, 0x51) AM_MIRROR(0x06) AM_DEVWRITE8("ic7", sn76489_device, write, 0x00ff)
AM_RANGE(0x58, 0x5f) AM_DEVREADWRITE8("ic16", pit8253_device, read, write, 0x00ff)
- AM_RANGE(0x60, 0x67) AM_DEVREADWRITE8("ic15", z80sio0_device, ba_cd_r, ba_cd_w, 0x00ff)
+ AM_RANGE(0x60, 0x61) AM_READ8(sio_da_r, 0x00ff) AM_DEVWRITE8("ic15", z80sio0_device, da_w, 0x00ff)
+ AM_RANGE(0x62, 0x63) AM_READ8(sio_ca_r, 0x00ff) AM_DEVWRITE8("ic15", z80sio0_device, ca_w, 0x00ff)
+ AM_RANGE(0x64, 0x65) AM_READ8(sio_db_r, 0x00ff) AM_DEVWRITE8("ic15", z80sio0_device, db_w, 0x00ff)
+ AM_RANGE(0x66, 0x67) AM_READ8(sio_cb_r, 0x00ff) AM_DEVWRITE8("ic15", z80sio0_device, cb_w, 0x00ff)
AM_RANGE(0x68, 0x69) AM_MIRROR(0x04) AM_DEVWRITE8("ic30", mc6845_device, address_w, 0x00ff)
AM_RANGE(0x6a, 0x6b) AM_MIRROR(0x04) AM_DEVREADWRITE8("ic30", mc6845_device, register_r, register_w, 0x00ff)
AM_RANGE(0x70, 0x71) AM_MIRROR(0x04) AM_WRITE8(i8089_ca1_w, 0x00ff)
@@ -312,6 +377,7 @@ static MACHINE_CONFIG_START( apricot, apricot_state )
MCFG_CPU_PROGRAM_MAP(apricot_mem)
MCFG_CPU_IO_MAP(apricot_io)
MCFG_CPU_IRQ_ACKNOWLEDGE_DEVICE("ic31", pic8259_device, inta_cb)
+ MCFG_I8086_LOCK_HANDLER(WRITELINE(apricot_state, i8086_lock_w))
// i/o cpu
MCFG_CPU_ADD("ic71", I8089, XTAL_15MHz / 3)
@@ -321,6 +387,10 @@ static MACHINE_CONFIG_START( apricot, apricot_state )
MCFG_I8089_SINTR1(DEVWRITELINE("ic31", pic8259_device, ir0_w))
MCFG_I8089_SINTR2(DEVWRITELINE("ic31", pic8259_device, ir1_w))
+ // ram
+ MCFG_RAM_ADD(RAM_TAG)
+ MCFG_RAM_DEFAULT_SIZE("256k")
+
// video hardware
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_SIZE(800, 400)
@@ -331,6 +401,7 @@ static MACHINE_CONFIG_START( apricot, apricot_state )
MCFG_PALETTE_ADD_MONOCHROME_GREEN_HIGHLIGHT("palette")
MCFG_MC6845_ADD("ic30", MC6845, "screen", XTAL_15MHz / 10)
+ MCFG_MC6845_INTERLACE_ADJUST(1)
MCFG_MC6845_SHOW_BORDER_AREA(false)
MCFG_MC6845_CHAR_WIDTH(10)
MCFG_MC6845_UPDATE_ROW_CB(apricot_state, crtc_update_row)
@@ -341,11 +412,6 @@ static MACHINE_CONFIG_START( apricot, apricot_state )
MCFG_SOUND_ADD("ic7", SN76489, XTAL_4MHz / 2)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
- // internal ram
- MCFG_RAM_ADD(RAM_TAG)
- MCFG_RAM_DEFAULT_SIZE("256k")
- MCFG_RAM_EXTRA_OPTIONS("384k,512k") // with 1 or 2 128k expansion boards
-
// devices
MCFG_DEVICE_ADD("ic17", I8255A, 0)
MCFG_I8255_IN_PORTA_CB(DEVREAD8("cent_data_in", input_buffer_device, read))
@@ -369,6 +435,7 @@ static MACHINE_CONFIG_START( apricot, apricot_state )
MCFG_Z80DART_OUT_DTRA_CB(DEVWRITELINE("rs232", rs232_port_device, write_dtr))
MCFG_Z80DART_OUT_RTSA_CB(DEVWRITELINE("rs232", rs232_port_device, write_rts))
MCFG_Z80DART_OUT_WRDYA_CB(DEVWRITELINE("ic71", i8089_device, drq2_w))
+ MCFG_Z80DART_OUT_TXDB_CB(DEVWRITELINE("keyboard", apricot_keyboard_hle_device, rxd_w))
MCFG_Z80DART_OUT_DTRB_CB(WRITELINE(apricot_state, data_selector_dtr_w))
MCFG_Z80DART_OUT_RTSB_CB(WRITELINE(apricot_state, data_selector_rts_w))
MCFG_Z80DART_OUT_INT_CB(DEVWRITELINE("ic31", pic8259_device, ir5_w))
@@ -377,10 +444,14 @@ static MACHINE_CONFIG_START( apricot, apricot_state )
MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, NULL)
// note: missing a receive clock callback to support external clock mode
// (m_data_selector_rts == 1 and m_data_selector_dtr == 0)
- MCFG_RS232_RXD_HANDLER(DEVWRITELINE("ic15", z80dart_device, rxa_w))
- MCFG_RS232_DCD_HANDLER(DEVWRITELINE("ic15", z80dart_device, dcda_w))
- MCFG_RS232_DSR_HANDLER(DEVWRITELINE("ic15", z80dart_device, synca_w))
- MCFG_RS232_CTS_HANDLER(DEVWRITELINE("ic15", z80dart_device, ctsa_w))
+ MCFG_RS232_RXD_HANDLER(DEVWRITELINE("ic15", z80sio0_device, rxa_w))
+ MCFG_RS232_DCD_HANDLER(DEVWRITELINE("ic15", z80sio0_device, dcda_w))
+ MCFG_RS232_DSR_HANDLER(DEVWRITELINE("ic15", z80sio0_device, synca_w))
+ MCFG_RS232_CTS_HANDLER(DEVWRITELINE("ic15", z80sio0_device, ctsa_w))
+
+ // keyboard (hle)
+ MCFG_APRICOT_KEYBOARD_ADD("keyboard")
+ MCFG_APRICOT_KEYBOARD_TXD_HANDLER(DEVWRITELINE("ic15", z80sio0_device, rxb_w))
// centronics printer
MCFG_CENTRONICS_ADD("centronics", centronics_devices, "printer")
@@ -395,11 +466,17 @@ static MACHINE_CONFIG_START( apricot, apricot_state )
MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics")
// floppy
- MCFG_WD2793x_ADD("ic68", XTAL_4MHz / 2)
- MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(apricot_state, wd2793_intrq_w))
+ MCFG_WD2797_ADD("ic68", XTAL_4MHz / 2)
+ MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(apricot_state, fdc_intrq_w))
MCFG_WD_FDC_DRQ_CALLBACK(DEVWRITELINE("ic71", i8089_device, drq1_w))
- MCFG_FLOPPY_DRIVE_ADD("ic68:0", apricot_floppies, "d32w", floppy_image_device::default_floppy_formats)
- MCFG_FLOPPY_DRIVE_ADD("ic68:1", apricot_floppies, "d32w", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("ic68:0", apricot_floppies, "d32w", apricot_state::floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("ic68:1", apricot_floppies, "d32w", apricot_state::floppy_formats)
+
+ // expansion bus
+ MCFG_EXPANSION_ADD("exp", "ic91")
+ MCFG_EXPANSION_IOP_ADD("ic71")
+ MCFG_EXPANSION_SLOT_ADD("exp:1", apricot_expansion_cards, NULL)
+ MCFG_EXPANSION_SLOT_ADD("exp:2", apricot_expansion_cards, NULL)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( apricotxi, apricot )
diff --git a/src/mess/drivers/apricotf.c b/src/mess/drivers/apricotf.c
index 6acd59dab3f..bd9cec58e96 100644
--- a/src/mess/drivers/apricotf.c
+++ b/src/mess/drivers/apricotf.c
@@ -24,9 +24,89 @@
*/
-#include "includes/apricotf.h"
+#include "emu.h"
+#include "cpu/i86/i86.h"
+#include "cpu/z80/z80daisy.h"
+#include "imagedev/flopdrv.h"
+#include "machine/apricotkb.h"
+#include "machine/buffer.h"
+#include "bus/centronics/ctronics.h"
+#include "machine/wd_fdc.h"
+#include "machine/z80ctc.h"
+#include "machine/z80dart.h"
+#include "formats/apridisk.h"
+//**************************************************************************
+// MACROS / CONSTANTS
+//**************************************************************************
+
+#define SCREEN_TAG "screen"
+#define I8086_TAG "10d"
+#define Z80CTC_TAG "13d"
+#define Z80SIO2_TAG "15d"
+#define WD2797_TAG "5f"
+#define CENTRONICS_TAG "centronics"
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> f1_state
+
+class f1_state : public driver_device
+{
+public:
+ f1_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, I8086_TAG),
+ m_ctc(*this, Z80CTC_TAG),
+ m_sio(*this, Z80SIO2_TAG),
+ m_fdc(*this, WD2797_TAG),
+ m_floppy0(*this, WD2797_TAG ":0"),
+ m_floppy1(*this, WD2797_TAG ":1"),
+ m_centronics(*this, CENTRONICS_TAG),
+ m_cent_data_out(*this, "cent_data_out"),
+ m_ctc_int(CLEAR_LINE),
+ m_sio_int(CLEAR_LINE),
+ m_p_scrollram(*this, "p_scrollram"),
+ m_p_paletteram(*this, "p_paletteram"),
+ m_palette(*this, "palette")
+ { }
+
+ DECLARE_FLOPPY_FORMATS(floppy_formats);
+
+ virtual void machine_start();
+
+ required_device<cpu_device> m_maincpu;
+ required_device<z80ctc_device> m_ctc;
+ required_device<z80sio2_device> m_sio;
+ required_device<wd2797_t> m_fdc;
+ required_device<floppy_connector> m_floppy0;
+ required_device<floppy_connector> m_floppy1;
+ required_device<centronics_device> m_centronics;
+ required_device<output_latch_device> m_cent_data_out;
+ int m_ctc_int;
+ int m_sio_int;
+ required_shared_ptr<UINT16> m_p_scrollram;
+ required_shared_ptr<UINT16> m_p_paletteram;
+ required_device<palette_device> m_palette;
+
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ DECLARE_READ16_MEMBER( palette_r );
+ DECLARE_WRITE16_MEMBER( palette_w );
+ DECLARE_WRITE8_MEMBER( system_w );
+ DECLARE_WRITE_LINE_MEMBER( sio_int_w );
+ DECLARE_WRITE_LINE_MEMBER( ctc_int_w );
+ DECLARE_WRITE_LINE_MEMBER( ctc_z1_w );
+ DECLARE_WRITE_LINE_MEMBER( ctc_z2_w );
+
+ int m_40_80;
+ int m_200_256;
+};
+
//**************************************************************************
// VIDEO
@@ -250,6 +330,10 @@ WRITE_LINE_MEMBER( f1_state::ctc_z2_w )
// floppy
//-------------------------------------------------
+FLOPPY_FORMATS_MEMBER( f1_state::floppy_formats )
+ FLOPPY_APRIDISK_FORMAT
+FLOPPY_FORMATS_END
+
static SLOT_INTERFACE_START( apricotf_floppies )
SLOT_INTERFACE( "d31v", SONY_OA_D31V )
SLOT_INTERFACE( "d32w", SONY_OA_D32W )
@@ -300,12 +384,12 @@ static MACHINE_CONFIG_START( act_f1, f1_state )
MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", CENTRONICS_TAG)
// floppy
- MCFG_WD2797x_ADD(WD2797_TAG, XTAL_4MHz / 2 /* ? */)
+ MCFG_WD2797_ADD(WD2797_TAG, XTAL_4MHz / 2 /* ? */)
MCFG_WD_FDC_INTRQ_CALLBACK(INPUTLINE(I8086_TAG, INPUT_LINE_NMI))
MCFG_WD_FDC_DRQ_CALLBACK(INPUTLINE(I8086_TAG, INPUT_LINE_TEST))
- MCFG_FLOPPY_DRIVE_ADD(WD2797_TAG ":0", apricotf_floppies, "d32w", floppy_image_device::default_floppy_formats)
- MCFG_FLOPPY_DRIVE_ADD(WD2797_TAG ":1", apricotf_floppies, "d32w", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD(WD2797_TAG ":0", apricotf_floppies, "d32w", f1_state::floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD(WD2797_TAG ":1", apricotf_floppies, "d32w", f1_state::floppy_formats)
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/apricotp.c b/src/mess/drivers/apricotp.c
index f19887f7c56..d9132dfd2bd 100644
--- a/src/mess/drivers/apricotp.c
+++ b/src/mess/drivers/apricotp.c
@@ -1,8 +1,8 @@
// license:LGPL-2.1+
-// copyright-holders:Angelo Salese, Dirk Best
+// copyright-holders:Angelo Salese
/***************************************************************************
- ACT Apricot F1 series
+ ACT Apricot FP
preliminary driver by Angelo Salese
@@ -24,15 +24,44 @@
*/
-#include "includes/apricotp.h"
+#include "emu.h"
+#include "cpu/i86/i86.h"
+#include "cpu/m6800/m6800.h"
+#include "machine/am9517a.h"
+#include "machine/apricotkb.h"
+#include "bus/centronics/ctronics.h"
+#include "machine/pic8259.h"
+#include "machine/pit8253.h"
+#include "machine/ram.h"
+#include "machine/wd_fdc.h"
+#include "machine/z80dart.h"
+#include "sound/sn76496.h"
+#include "video/mc6845.h"
+#include "formats/apridisk.h"
#include "apricotp.lh"
-
//**************************************************************************
-// MACROS/CONSTANTS
+// MACROS / CONSTANTS
//**************************************************************************
+#define I8086_TAG "ic7"
+#define I8284_TAG "ic30"
+#define I8237_TAG "ic17"
+#define I8259A_TAG "ic51"
+#define I8253A5_TAG "ic20"
+#define TMS4500_TAG "ic42"
+#define MC6845_TAG "ic69"
+#define HD63B01V1_TAG "ic29"
+#define AD7574_TAG "ic34"
+#define AD1408_TAG "ic37"
+#define Z80SIO0_TAG "ic6"
+#define WD2797_TAG "ic5"
+#define SN76489AN_TAG "ic13"
+#define CENTRONICS_TAG "centronics"
+#define SCREEN_LCD_TAG "screen0"
+#define SCREEN_CRT_TAG "screen1"
+
enum
{
LED_STOP = 0,
@@ -45,6 +74,86 @@ enum
};
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> fp_state
+
+class fp_state : public driver_device
+{
+public:
+ fp_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, I8086_TAG),
+ m_soundcpu(*this, HD63B01V1_TAG),
+ m_dmac(*this, I8237_TAG),
+ m_pic(*this, I8259A_TAG),
+ m_pit(*this, I8253A5_TAG),
+ m_sio(*this, Z80SIO0_TAG),
+ m_fdc(*this, WD2797_TAG),
+ m_crtc(*this, MC6845_TAG),
+ m_ram(*this, RAM_TAG),
+ m_floppy0(*this, WD2797_TAG":0"),
+ m_floppy1(*this, WD2797_TAG":1"),
+ m_floppy(NULL),
+ m_centronics(*this, CENTRONICS_TAG),
+ m_work_ram(*this, "work_ram"),
+ m_video_ram(*this, "video_ram")
+ { }
+
+ DECLARE_FLOPPY_FORMATS(floppy_formats);
+
+ required_device<cpu_device> m_maincpu;
+ required_device<cpu_device> m_soundcpu;
+ required_device<am9517a_device> m_dmac;
+ required_device<pic8259_device> m_pic;
+ required_device<pit8253_device> m_pit;
+ required_device<z80dart_device> m_sio;
+ required_device<wd2797_t> m_fdc;
+ required_device<mc6845_device> m_crtc;
+ required_device<ram_device> m_ram;
+ required_device<floppy_connector> m_floppy0;
+ required_device<floppy_connector> m_floppy1;
+ floppy_image_device *m_floppy;
+ required_device<centronics_device> m_centronics;
+
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ virtual void video_start();
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ MC6845_UPDATE_ROW(update_row);
+ DECLARE_READ16_MEMBER( mem_r );
+ DECLARE_WRITE16_MEMBER( mem_w );
+ DECLARE_READ8_MEMBER( prtr_snd_r );
+ DECLARE_WRITE8_MEMBER( pint_clr_w );
+ DECLARE_WRITE8_MEMBER( ls_w );
+ DECLARE_WRITE8_MEMBER( contrast_w );
+ DECLARE_WRITE8_MEMBER( palette_w );
+ DECLARE_WRITE16_MEMBER( video_w );
+ DECLARE_WRITE8_MEMBER( lat_w );
+
+ void lat_ls259_w(offs_t offset, int state);
+
+ optional_shared_ptr<UINT16> m_work_ram;
+
+ // video state
+ optional_shared_ptr<UINT16> m_video_ram;
+ UINT8 m_video;
+
+ int m_centronics_busy;
+ int m_centronics_select;
+ int m_centronics_fault;
+ int m_centronics_perror;
+
+ DECLARE_WRITE_LINE_MEMBER( write_centronics_busy );
+ DECLARE_WRITE_LINE_MEMBER( write_centronics_select );
+ DECLARE_WRITE_LINE_MEMBER( write_centronics_fault );
+ DECLARE_WRITE_LINE_MEMBER( write_centronics_perror );
+};
+
//**************************************************************************
// VIDEO
@@ -211,10 +320,7 @@ void fp_state::lat_ls259_w(offs_t offset, int state)
m_fdc->set_floppy(m_floppy);
if (m_floppy)
- {
- m_floppy->set_rpm(600);
m_floppy->mon_w(0);
- }
}
break;
}
@@ -399,20 +505,6 @@ INPUT_PORTS_END
*/
-static SLOT_INTERFACE_START( fp_floppies )
- SLOT_INTERFACE( "35dd", FLOPPY_35_DD ) // Sony OA-D32W (600 rpm)
-SLOT_INTERFACE_END
-/*
-static LEGACY_FLOPPY_OPTIONS_START( act )
- LEGACY_FLOPPY_OPTION( img2hd, "dsk", "2HD disk image", basicdsk_identify_default, basicdsk_construct_default, NULL,
- HEADS([2])
- TRACKS([80])
- SECTORS([16])
- SECTOR_LENGTH([256])
- FIRST_SECTOR_ID([1]))
-LEGACY_FLOPPY_OPTIONS_END
-*/
-
WRITE_LINE_MEMBER( fp_state::write_centronics_busy )
{
m_centronics_busy = state;
@@ -467,6 +559,15 @@ void fp_state::machine_reset()
// MACHINE DRIVERS
//**************************************************************************
+FLOPPY_FORMATS_MEMBER( fp_state::floppy_formats )
+ FLOPPY_APRIDISK_FORMAT
+FLOPPY_FORMATS_END
+
+static SLOT_INTERFACE_START( fp_floppies )
+ SLOT_INTERFACE("d32w", SONY_OA_D32W)
+SLOT_INTERFACE_END
+
+
//-------------------------------------------------
// MACHINE_CONFIG( fp )
//-------------------------------------------------
@@ -531,12 +632,12 @@ static MACHINE_CONFIG_START( fp, fp_state )
MCFG_Z80SIO0_ADD(Z80SIO0_TAG, 2500000, 0, 0, 0, 0)
MCFG_Z80DART_OUT_INT_CB(DEVWRITELINE(I8259A_TAG, pic8259_device, ir4_w))
- MCFG_WD2797x_ADD(WD2797_TAG, 2000000)
+ MCFG_WD2797_ADD(WD2797_TAG, 2000000)
MCFG_WD_FDC_INTRQ_CALLBACK(DEVWRITELINE(I8259A_TAG, pic8259_device, ir1_w))
MCFG_WD_FDC_DRQ_CALLBACK(DEVWRITELINE(I8237_TAG, am9517a_device, dreq1_w))
- MCFG_FLOPPY_DRIVE_ADD(WD2797_TAG":0", fp_floppies, "35dd", floppy_image_device::default_floppy_formats)
- MCFG_FLOPPY_DRIVE_ADD(WD2797_TAG":1", fp_floppies, NULL, floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD(WD2797_TAG ":0", fp_floppies, "d32w", fp_state::floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD(WD2797_TAG ":1", fp_floppies, NULL, fp_state::floppy_formats)
MCFG_CENTRONICS_ADD("centronics", centronics_devices, "printer")
MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(fp_state, write_centronics_busy))
diff --git a/src/mess/drivers/atarist.c b/src/mess/drivers/atarist.c
index 46ad6a90e95..719433bd0ad 100644
--- a/src/mess/drivers/atarist.c
+++ b/src/mess/drivers/atarist.c
@@ -2099,7 +2099,7 @@ static MACHINE_CONFIG_START( st, st_state )
// devices
- MCFG_WD1772x_ADD(WD1772_TAG, Y2/4)
+ MCFG_WD1772_ADD(WD1772_TAG, Y2/4)
MCFG_WD_FDC_INTRQ_CALLBACK(DEVWRITELINE(MC68901_TAG, mc68901_device, i5_w)) MCFG_DEVCB_INVERT
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(st_state, fdc_drq_w))
MCFG_FLOPPY_DRIVE_ADD(WD1772_TAG ":0", atari_floppies, "35dd", st_state::floppy_formats)
@@ -2190,7 +2190,7 @@ static MACHINE_CONFIG_START( megast, megast_state )
// devices
MCFG_DEVICE_ADD(RP5C15_TAG, RP5C15, XTAL_32_768kHz)
- MCFG_WD1772x_ADD(WD1772_TAG, Y2/4)
+ MCFG_WD1772_ADD(WD1772_TAG, Y2/4)
MCFG_WD_FDC_INTRQ_CALLBACK(DEVWRITELINE(MC68901_TAG, mc68901_device, i5_w)) MCFG_DEVCB_INVERT
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(st_state, fdc_drq_w))
MCFG_FLOPPY_DRIVE_ADD(WD1772_TAG ":0", atari_floppies, "35dd", st_state::floppy_formats)
@@ -2288,7 +2288,7 @@ static MACHINE_CONFIG_START( ste, ste_state )
// devices
- MCFG_WD1772x_ADD(WD1772_TAG, Y2/4)
+ MCFG_WD1772_ADD(WD1772_TAG, Y2/4)
MCFG_WD_FDC_INTRQ_CALLBACK(DEVWRITELINE(MC68901_TAG, mc68901_device, i5_w)) MCFG_DEVCB_INVERT
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(st_state, fdc_drq_w))
MCFG_FLOPPY_DRIVE_ADD(WD1772_TAG ":0", atari_floppies, "35dd", st_state::floppy_formats)
@@ -2401,7 +2401,7 @@ static MACHINE_CONFIG_START( stbook, stbook_state )
MCFG_MC68901_OUT_TDO_CB(WRITELINE(st_state, mfp_tdo_w))
MCFG_MC68901_OUT_SO_CB(DEVWRITELINE(RS232_TAG, rs232_port_device, write_txd))
- MCFG_WD1772x_ADD(WD1772_TAG, U517/2)
+ MCFG_WD1772_ADD(WD1772_TAG, U517/2)
MCFG_WD_FDC_INTRQ_CALLBACK(DEVWRITELINE(MC68901_TAG, mc68901_device, i5_w)) MCFG_DEVCB_INVERT
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(st_state, fdc_drq_w))
MCFG_FLOPPY_DRIVE_ADD(WD1772_TAG ":0", atari_floppies, "35dd", 0, st_state::floppy_formats)
@@ -2453,7 +2453,7 @@ MACHINE_CONFIG_END
// MACHINE_CONFIG( tt030 )
//-------------------------------------------------
-static MACHINE_CONFIG_DERIVED( tt030, st )
+static MACHINE_CONFIG_DERIVED( tt030, ste )
MACHINE_CONFIG_END
@@ -2461,7 +2461,7 @@ MACHINE_CONFIG_END
// MACHINE_CONFIG( falcon )
//-------------------------------------------------
-static MACHINE_CONFIG_DERIVED( falcon, st )
+static MACHINE_CONFIG_DERIVED( falcon, ste )
MACHINE_CONFIG_END
@@ -2469,7 +2469,7 @@ MACHINE_CONFIG_END
// MACHINE_CONFIG( falcon40 )
//-------------------------------------------------
-static MACHINE_CONFIG_DERIVED( falcon40, st )
+static MACHINE_CONFIG_DERIVED( falcon40, ste )
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/ax20.c b/src/mess/drivers/ax20.c
index b2328c9406b..9e8ec2268e0 100644
--- a/src/mess/drivers/ax20.c
+++ b/src/mess/drivers/ax20.c
@@ -18,8 +18,7 @@
#include "emu.h"
#include "cpu/i86/i86.h"
-#include "imagedev/flopdrv.h"
-#include "formats/basicdsk.h"
+#include "bus/isa/fdc.h"
class ax20_state : public driver_device
{
@@ -29,18 +28,37 @@ public:
m_maincpu(*this, "maincpu"),
m_p_vram(*this, "p_vram"),
m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_fdc(*this, "fdc") { }
required_device<cpu_device> m_maincpu;
+ required_shared_ptr<UINT8> m_p_vram;
+ required_device<gfxdecode_device> m_gfxdecode;
+ required_device<palette_device> m_palette;
+ required_device<i8272a_device> m_fdc;
virtual void machine_start();
UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- required_shared_ptr<UINT8> m_p_vram;
- required_device<gfxdecode_device> m_gfxdecode;
- required_device<palette_device> m_palette;
+ DECLARE_READ8_MEMBER(unk_r);
+ DECLARE_WRITE8_MEMBER(tc_w);
+ DECLARE_WRITE8_MEMBER(ctl_w);
};
+READ8_MEMBER(ax20_state::unk_r)
+{
+ return 0;
+}
+
+WRITE8_MEMBER(ax20_state::tc_w)
+{
+ m_fdc->tc_w((data & 0xf0) == 0xf0);
+}
+
+WRITE8_MEMBER(ax20_state::ctl_w)
+{
+ m_fdc->subdevice<floppy_connector>("0")->get_device()->mon_w(!(data & 1));
+}
UINT32 ax20_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
@@ -68,6 +86,10 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START(ax20_io, AS_IO, 8, ax20_state)
ADDRESS_MAP_UNMAP_HIGH
+ AM_RANGE(0xffc0, 0xffc0) AM_WRITE(tc_w)
+ AM_RANGE(0xffd0, 0xffd0) AM_WRITE(ctl_w)
+ AM_RANGE(0xffe0, 0xffe0) AM_READ(unk_r)
+ AM_RANGE(0xff80, 0xff81) AM_DEVICE("fdc", i8272a_device, map)
ADDRESS_MAP_END
/* Input ports */
@@ -94,12 +116,9 @@ static GFXDECODE_START( ax20 )
GFXDECODE_ENTRY( "chargen", 0x0000, ax20_charlayout, 0, 1 )
GFXDECODE_END
-static const floppy_interface ax20_floppy_interface =
-{
- FLOPPY_STANDARD_5_25_DSDD_40, // TODO
- LEGACY_FLOPPY_OPTIONS_NAME(default),
- NULL
-};
+static SLOT_INTERFACE_START( ax20_floppies )
+ SLOT_INTERFACE( "525dd", FLOPPY_525_DD )
+SLOT_INTERFACE_END
static MACHINE_CONFIG_START( ax20, ax20_state )
/* basic machine hardware */
@@ -118,8 +137,10 @@ static MACHINE_CONFIG_START( ax20, ax20_state )
MCFG_GFXDECODE_ADD("gfxdecode", "palette", ax20)
MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette")
+ MCFG_I8272A_ADD("fdc", true)
+
/* Devices */
- MCFG_LEGACY_FLOPPY_DRIVE_ADD(FLOPPY_0, ax20_floppy_interface)
+ MCFG_FLOPPY_DRIVE_ADD("fdc:0", ax20_floppies, "525dd", isa8_fdc_device::floppy_formats)
MACHINE_CONFIG_END
/* ROM definition */
diff --git a/src/mess/drivers/b2m.c b/src/mess/drivers/b2m.c
index 1c4d9c66546..724dfb4fadf 100644
--- a/src/mess/drivers/b2m.c
+++ b/src/mess/drivers/b2m.c
@@ -234,7 +234,7 @@ static MACHINE_CONFIG_START( b2m, b2m_state )
/* uart */
MCFG_DEVICE_ADD("uart", I8251, 0)
- MCFG_FD1793x_ADD("fd1793", XTAL_8MHz / 8)
+ MCFG_FD1793_ADD("fd1793", XTAL_8MHz / 8)
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(b2m_state, b2m_fdc_drq))
MCFG_FLOPPY_DRIVE_ADD("fd0", b2m_floppies, "525qd", b2m_state::b2m_floppy_formats)
diff --git a/src/mess/drivers/bbc.c b/src/mess/drivers/bbc.c
index 5a4df8785ac..5dfce63e4ef 100644
--- a/src/mess/drivers/bbc.c
+++ b/src/mess/drivers/bbc.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Gordon Jefferyes, Nigel Barnes
/******************************************************************************
BBC Model A,B
@@ -776,7 +776,7 @@ static MACHINE_CONFIG_DERIVED( bbcb, bbca )
MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(bbc_floppy_interface)
- MCFG_WD1770x_ADD("wd177x", XTAL_16MHz / 2)
+ MCFG_WD1770_ADD("wd177x", XTAL_16MHz / 2)
MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(bbc_state, bbc_wd177x_intrq_w))
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(bbc_state, bbc_wd177x_drq_w))
@@ -840,7 +840,7 @@ static MACHINE_CONFIG_DERIVED( bbcb_us, bbca )
MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(bbc_floppy_interface)
- MCFG_WD1770x_ADD("wd177x", XTAL_16MHz / 2)
+ MCFG_WD1770_ADD("wd177x", XTAL_16MHz / 2)
MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(bbc_state, bbc_wd177x_intrq_w))
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(bbc_state, bbc_wd177x_drq_w))
@@ -1001,7 +1001,7 @@ static MACHINE_CONFIG_START( bbcm, bbc_state )
MCFG_VIA6522_IRQ_HANDLER(WRITELINE(bbc_state, bbcb_via_user_irq_w))
/* fdc */
- MCFG_WD1770x_ADD("wd177x", XTAL_16MHz / 2)
+ MCFG_WD1770_ADD("wd177x", XTAL_16MHz / 2)
MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(bbc_state, bbc_wd177x_intrq_w))
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(bbc_state, bbc_wd177x_drq_w))
@@ -1089,8 +1089,8 @@ static MACHINE_CONFIG_DERIVED( bbcmc, bbcm )
/* fdc */
MCFG_DEVICE_REMOVE("wd177x")
-// MCFG_WD1772x_ADD("wd177x", XTAL_16MHz / 2)
- MCFG_WD1770x_ADD("wd177x", XTAL_16MHz / 2)
+// MCFG_WD1772_ADD("wd177x", XTAL_16MHz / 2)
+ MCFG_WD1770_ADD("wd177x", XTAL_16MHz / 2)
MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(bbc_state, bbc_wd177x_intrq_w))
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(bbc_state, bbc_wd177x_drq_w))
diff --git a/src/mess/drivers/bigbord2.c b/src/mess/drivers/bigbord2.c
index 7131483b3df..c12e0b7832c 100644
--- a/src/mess/drivers/bigbord2.c
+++ b/src/mess/drivers/bigbord2.c
@@ -584,7 +584,7 @@ static MACHINE_CONFIG_START( bigbord2, bigbord2_state )
// ZC0 = SIO channel B clock, ZC1 = SIO channel A clock
MCFG_Z80CTC_ZC2_CB(DEVWRITELINE(Z80CTCB_TAG, z80ctc_device, trg3))
- MCFG_MB8877x_ADD("fdc", XTAL_16MHz / 16)
+ MCFG_MB8877_ADD("fdc", XTAL_16MHz / 16)
MCFG_FLOPPY_DRIVE_ADD("fdc:0", bigbord2_floppies, "525dd", floppy_image_device::default_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("fdc:1", bigbord2_floppies, "525dd", floppy_image_device::default_floppy_formats)
diff --git a/src/mess/drivers/bullet.c b/src/mess/drivers/bullet.c
index 714b071b135..9b073983797 100644
--- a/src/mess/drivers/bullet.c
+++ b/src/mess/drivers/bullet.c
@@ -1137,7 +1137,7 @@ static MACHINE_CONFIG_START( bullet, bullet_state )
MCFG_Z80PIO_OUT_PA_CB(DEVWRITE8("cent_data_out", output_latch_device, write))
MCFG_Z80PIO_IN_PB_CB(READ8(bullet_state, pio_pb_r))
- MCFG_MB8877x_ADD(MB8877_TAG, XTAL_16MHz/16)
+ MCFG_MB8877_ADD(MB8877_TAG, XTAL_16MHz/16)
MCFG_WD_FDC_INTRQ_CALLBACK(DEVWRITELINE(Z80DART_TAG, z80dart_device, dcda_w))
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(bullet_state, fdc_drq_w))
MCFG_FLOPPY_DRIVE_ADD(MB8877_TAG":0", bullet_525_floppies, "525qd", floppy_image_device::default_floppy_formats)
@@ -1219,7 +1219,7 @@ static MACHINE_CONFIG_START( bulletf, bulletf_state )
MCFG_Z80PIO_OUT_ARDY_CB(DEVWRITE8("cent_data_out", output_latch_device, write))
MCFG_Z80PIO_OUT_BRDY_CB(WRITELINE(bulletf_state, cstrb_w))
- MCFG_MB8877x_ADD(MB8877_TAG, XTAL_16MHz/16)
+ MCFG_MB8877_ADD(MB8877_TAG, XTAL_16MHz/16)
MCFG_WD_FDC_INTRQ_CALLBACK(DEVWRITELINE(Z80DART_TAG, z80dart_device, rib_w))
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(bullet_state, fdc_drq_w))
MCFG_FLOPPY_DRIVE_ADD(MB8877_TAG":0", bullet_525_floppies, "525qd", floppy_image_device::default_floppy_formats)
diff --git a/src/mess/drivers/bw2.c b/src/mess/drivers/bw2.c
index 21565d88333..dc7765e4e6c 100644
--- a/src/mess/drivers/bw2.c
+++ b/src/mess/drivers/bw2.c
@@ -632,7 +632,7 @@ static MACHINE_CONFIG_START( bw2, bw2_state )
MCFG_RS232_RXD_HANDLER(DEVWRITELINE(I8251_TAG, i8251_device, write_rxd))
MCFG_RS232_DSR_HANDLER(DEVWRITELINE(I8251_TAG, i8251_device, write_dsr))
- MCFG_WD2797x_ADD(WD2797_TAG, XTAL_16MHz/16)
+ MCFG_WD2797_ADD(WD2797_TAG, XTAL_16MHz/16)
MCFG_WD_FDC_INTRQ_CALLBACK(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0))
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(bw2_state, fdc_drq_w))
diff --git a/src/mess/drivers/casloopy.c b/src/mess/drivers/casloopy.c
index 0c6919de688..d2a957c5a96 100644
--- a/src/mess/drivers/casloopy.c
+++ b/src/mess/drivers/casloopy.c
@@ -420,7 +420,7 @@ static ADDRESS_MAP_START( casloopy_map, AS_PROGRAM, 32, casloopy_state )
AM_RANGE(0x04051000, 0x040511ff) AM_READWRITE16(pal_r, pal_w, 0xffffffff)
AM_RANGE(0x04058000, 0x04058007) AM_READWRITE16(vregs_r, vregs_w, 0xffffffff)
AM_RANGE(0x0405b000, 0x0405b00f) AM_RAM AM_SHARE("vregs") // RGB555 brightness control plus scrolling
- AM_RANGE(0x05ffff00, 0x05ffffff) AM_READWRITE16(sh7021_r, sh7021_w, 0xffffffff)
+// AM_RANGE(0x05ffff00, 0x05ffffff) AM_READWRITE16(sh7021_r, sh7021_w, 0xffffffff)
// AM_RANGE(0x05ffff00, 0x05ffffff) - SH7021 internal i/o
AM_RANGE(0x06000000, 0x061fffff) AM_READ(cart_r)
AM_RANGE(0x07000000, 0x070003ff) AM_RAM AM_SHARE("oram")// on-chip RAM, actually at 0xf000000 (1 kb)
@@ -504,7 +504,7 @@ DEVICE_IMAGE_LOAD_MEMBER( casloopy_state, loopy_cart )
static MACHINE_CONFIG_START( casloopy, casloopy_state )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu",SH2,8000000)
+ MCFG_CPU_ADD("maincpu",SH2A,8000000)
MCFG_CPU_PROGRAM_MAP(casloopy_map)
// MCFG_CPU_ADD("subcpu",V60,8000000)
diff --git a/src/mess/drivers/ccs2810.c b/src/mess/drivers/ccs2810.c
index fda1decef49..1121a6f2991 100644
--- a/src/mess/drivers/ccs2810.c
+++ b/src/mess/drivers/ccs2810.c
@@ -354,7 +354,7 @@ static MACHINE_CONFIG_START( ccs2422, ccs_state )
MCFG_GENERIC_TERMINAL_KEYBOARD_CB(WRITE8(ccs_state, kbd_put))
/* Devices */
- MCFG_MB8877x_ADD("fdc", XTAL_16MHz / 8) // UB1793 or MB8877
+ MCFG_MB8877_ADD("fdc", XTAL_16MHz / 8) // UB1793 or MB8877
MCFG_FLOPPY_DRIVE_ADD("fdc:0", ccs_floppies, "8sssd", floppy_image_device::default_floppy_formats)
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/cgenie.c b/src/mess/drivers/cgenie.c
index 2c5ecb78546..3a5776814da 100644
--- a/src/mess/drivers/cgenie.c
+++ b/src/mess/drivers/cgenie.c
@@ -210,7 +210,7 @@ static INPUT_PORTS_START( cgenie )
PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L.P.") // marked as "L.P." in the manual, lightpen?
PORT_START("RST")
- PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_CODE(KEYCODE_TAB) PORT_NAME("Rst") PORT_CHAR(9) PORT_CHANGED_MEMBER(DEVICE_SELF, cgenie_state, rst_callback, NULL)
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_CODE(KEYCODE_F5) PORT_NAME("Rst") PORT_CHAR(UCHAR_MAMEKEY(F5)) PORT_CHANGED_MEMBER(DEVICE_SELF, cgenie_state, rst_callback, NULL)
INPUT_PORTS_END
diff --git a/src/mess/drivers/chessmst.c b/src/mess/drivers/chessmst.c
index b4b7f8fe041..4e0e3a00574 100644
--- a/src/mess/drivers/chessmst.c
+++ b/src/mess/drivers/chessmst.c
@@ -200,7 +200,7 @@ WRITE8_MEMBER( chessmst_state::pio1_port_b_w )
m_led_sel = (m_led_sel & 0xff) | ((data & 0x03)<<8);
m_speaker->level_w(BIT(data, 6));
-};
+}
READ8_MEMBER( chessmst_state::pio2_port_a_r )
{
diff --git a/src/mess/drivers/coleco.c b/src/mess/drivers/coleco.c
index f6db761295a..435b20060c3 100644
--- a/src/mess/drivers/coleco.c
+++ b/src/mess/drivers/coleco.c
@@ -350,6 +350,18 @@ ROM_START (coleco)
ROMX_LOAD( "colecoa.rom", 0x0000, 0x2000, CRC(39bb16fc) SHA1(99ba9be24ada3e86e5c17aeecb7a2d68c5edfe59), ROM_BIOS(2) )
ROM_END
+/* ONYX (Prototype)
+ Unreleased Brazilian Colecovision clone by Microdigital.
+
+ It was never released and the only known prototypes were uncovered by an ex-employee of Microdigital
+ called Cláudio Cassens who donated it to collectors (Eduardo Luccas) in June 2015.
+ -- Felipe Sanches
+*/
+ROM_START (onyx)
+ ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD( "onyx.rom", 0x0000, 0x2000, CRC(011c32e7) SHA1(f44263221e330b2590dffc1a6f43ed2591fe19be) )
+ROM_END
+
/* PAL Colecovision BIOS
Country: Italy
@@ -388,6 +400,7 @@ ROM_END
// YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS
CONS( 1982, coleco, 0, 0, coleco, coleco, driver_device, 0, "Coleco", "ColecoVision (NTSC)", 0 )
+CONS( 1982, onyx, coleco, 0, coleco, coleco, driver_device, 0, "Microdigital", "Onyx (Brazil/Prototype)", 0 )
CONS( 1983, colecop, coleco, 0, colecop, coleco, driver_device, 0, "Coleco", "ColecoVision (PAL)", 0 )
CONS( 1983, svi603, coleco, 0, coleco, coleco, driver_device, 0, "Spectravideo", "SVI-603 Coleco Game Adapter", 0 )
CONS( 1986, czz50, 0, coleco, czz50, czz50, driver_device, 0, "Bit Corporation", "Chuang Zao Zhe 50", 0 )
diff --git a/src/mess/drivers/concept.c b/src/mess/drivers/concept.c
index 4d15dd5e213..947d4bfcfa7 100644
--- a/src/mess/drivers/concept.c
+++ b/src/mess/drivers/concept.c
@@ -1,4 +1,4 @@
-// license:???
+// license:GPL-2.0+
// copyright-holders:Raphael Nabet, Brett Wyer
/*
Corvus Concept driver
diff --git a/src/mess/drivers/crvision.c b/src/mess/drivers/crvision.c
index 27be2f8a65b..08250767a2e 100644
--- a/src/mess/drivers/crvision.c
+++ b/src/mess/drivers/crvision.c
@@ -190,39 +190,39 @@ INPUT_CHANGED_MEMBER( crvision_state::trigger_nmi )
static INPUT_PORTS_START( crvision )
// Player 1 Joystick
- PORT_START("PA0-0")
+ PORT_START("PA0.0")
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("PA0-1")
+ PORT_START("PA0.1")
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )
PORT_BIT( 0xfd, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("PA0-2")
+ PORT_START("PA0.2")
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CHAR('1')
PORT_BIT( 0xf3, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("PA0-3")
+ PORT_START("PA0.3")
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )
PORT_BIT( 0xf7, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("PA0-4")
+ PORT_START("PA0.4")
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("PA0-5")
+ PORT_START("PA0.5")
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
PORT_BIT( 0xdf, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("PA0-6")
+ PORT_START("PA0.6")
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("PA0-7")
+ PORT_START("PA0.7")
PORT_BIT( 0x7f, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P1 Button 2 / CNT'L") PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(KEYCODE_RCONTROL)
// Player 1 Keyboard
- PORT_START("PA1-0")
+ PORT_START("PA1.0")
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F) PORT_CHAR('F')
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G) PORT_CHAR('G')
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(UTF8_LEFT) PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8)
@@ -231,7 +231,7 @@ static INPUT_PORTS_START( crvision )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D) PORT_CHAR('D')
PORT_BIT( 0x81, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("PA1-1")
+ PORT_START("PA1.1")
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B) PORT_CHAR('B')
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Z) PORT_CHAR('Z')
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_CHAR('X')
@@ -239,70 +239,70 @@ static INPUT_PORTS_START( crvision )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_V) PORT_CHAR('V')
PORT_BIT( 0x83, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("PA1-2")
+ PORT_START("PA1.2")
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_W) PORT_CHAR('W')
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_CHAR('E')
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R) PORT_CHAR('R')
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_T) PORT_CHAR('T')
PORT_BIT( 0x87, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("PA1-3")
+ PORT_START("PA1.3")
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) PORT_CHAR('Q')
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$')
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%')
PORT_BIT( 0x8f, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("PA1-4")
+ PORT_START("PA1.4")
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('"')
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('&')
PORT_BIT( 0x9f, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("PA1-5")
+ PORT_START("PA1.5")
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#')
PORT_BIT( 0xbf, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("PA1-6")
+ PORT_START("PA1.6")
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("PA1-7")
+ PORT_START("PA1.7")
PORT_BIT( 0x7f, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P1 Button 1 / SHIFT") PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT)
// Player 2 Joystick
- PORT_START("PA2-0")
+ PORT_START("PA2.0")
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("PA2-1")
+ PORT_START("PA2.1")
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) PORT_CODE(KEYCODE_2_PAD)
PORT_BIT( 0xfd, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("PA2-2")
+ PORT_START("PA2.2")
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_CODE(KEYCODE_6_PAD)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("SPACE") PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ')
PORT_BIT( 0xf3, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("PA2-3")
+ PORT_START("PA2.3")
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2) PORT_CODE(KEYCODE_8_PAD)
PORT_BIT( 0xf7, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("PA2-4")
+ PORT_START("PA2.4")
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("PA2-5")
+ PORT_START("PA2.5")
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) PORT_CODE(KEYCODE_4_PAD)
PORT_BIT( 0xdf, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("PA2-6")
+ PORT_START("PA2.6")
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("PA2-7")
+ PORT_START("PA2.7")
PORT_BIT( 0x7f, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P2 Button 2 / \xE2\x86\x92") PORT_CODE(KEYCODE_TAB) PORT_CHAR(9) PORT_PLAYER(2)
// Player 2 Keyboard
- PORT_START("PA3-0")
+ PORT_START("PA3.0")
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_U) PORT_CHAR('U')
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Y) PORT_CHAR('Y')
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("RET'N") PORT_CODE(KEYCODE_ENTER) PORT_CHAR('\r')
@@ -311,7 +311,7 @@ static INPUT_PORTS_START( crvision )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I) PORT_CHAR('I')
PORT_BIT( 0x81, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("PA3-1")
+ PORT_START("PA3.1")
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('\'')
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR(':') PORT_CHAR('*')
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR('@')
@@ -319,32 +319,32 @@ static INPUT_PORTS_START( crvision )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('(')
PORT_BIT( 0x83, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("PA3-2")
+ PORT_START("PA3.2")
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_L) PORT_CHAR('L')
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_K) PORT_CHAR('K')
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J) PORT_CHAR('J')
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H) PORT_CHAR('H')
PORT_BIT( 0x87, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("PA3-3")
+ PORT_START("PA3.3")
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(';') PORT_CHAR('+')
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<')
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M) PORT_CHAR('M')
PORT_BIT( 0x8f, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("PA3-4")
+ PORT_START("PA3.4")
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?')
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N) PORT_CHAR('N')
PORT_BIT( 0x9f, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("PA3-5")
+ PORT_START("PA3.5")
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>')
PORT_BIT( 0xbf, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("PA3-6")
+ PORT_START("PA3.6")
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("PA3-7")
+ PORT_START("PA3.7")
PORT_BIT( 0x7f, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P2 Button 1 / - =") PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('=') PORT_PLAYER(2)
@@ -357,7 +357,7 @@ INPUT_PORTS_END
-------------------------------------------------*/
static INPUT_PORTS_START( manager )
- PORT_START("Y0")
+ PORT_START("Y.0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>')
@@ -367,7 +367,7 @@ static INPUT_PORTS_START( manager )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S) PORT_CHAR('S') PORT_CHAR('s')
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_CHAR('X') PORT_CHAR('x')
- PORT_START("Y1")
+ PORT_START("Y.1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("\xC3\x84 \xC3\xA4") PORT_CODE(KEYCODE_QUOTE) PORT_CHAR(0x00C4) PORT_CHAR(0x00E4)
@@ -377,7 +377,7 @@ static INPUT_PORTS_START( manager )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A) PORT_CHAR('A') PORT_CHAR('a')
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Z) PORT_CHAR('Z') PORT_CHAR('z')
- PORT_START("Y2")
+ PORT_START("Y.2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I) PORT_CHAR('I') PORT_CHAR('i')
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?')
@@ -387,7 +387,7 @@ static INPUT_PORTS_START( manager )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("CTRL") PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_MAMEKEY(LCONTROL))
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("SHIFT") PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1)
- PORT_START("Y3")
+ PORT_START("Y.3")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N) PORT_CHAR('N') PORT_CHAR('n')
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_CHAR('X') PORT_CHAR('x')
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("\xC3\x96 \xC3\xB6") PORT_CODE(KEYCODE_COLON) PORT_CHAR(0x00D6) PORT_CHAR(0x00F6)
@@ -397,7 +397,7 @@ static INPUT_PORTS_START( manager )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D) PORT_CHAR('D') PORT_CHAR('d')
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C) PORT_CHAR('C') PORT_CHAR('c')
- PORT_START("Y4")
+ PORT_START("Y.4")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<')
@@ -407,7 +407,7 @@ static INPUT_PORTS_START( manager )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F) PORT_CHAR('F') PORT_CHAR('f')
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_V) PORT_CHAR('V') PORT_CHAR('v')
- PORT_START("Y5")
+ PORT_START("Y.5")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J) PORT_CHAR('J') PORT_CHAR('j')
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_L) PORT_CHAR('L') PORT_CHAR('l')
@@ -417,7 +417,7 @@ static INPUT_PORTS_START( manager )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G) PORT_CHAR('G') PORT_CHAR('g')
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B) PORT_CHAR('B') PORT_CHAR('b')
- PORT_START("Y6")
+ PORT_START("Y.6")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S) PORT_CHAR('S') PORT_CHAR('s')
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_K) PORT_CHAR('K') PORT_CHAR('k')
@@ -427,7 +427,7 @@ static INPUT_PORTS_START( manager )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H) PORT_CHAR('H') PORT_CHAR('h')
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N) PORT_CHAR('N') PORT_CHAR('n')
- PORT_START("Y7")
+ PORT_START("Y.7")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_CHAR('X') PORT_CHAR('x')
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N) PORT_CHAR('N') PORT_CHAR('n')
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ')
@@ -437,7 +437,7 @@ static INPUT_PORTS_START( manager )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J) PORT_CHAR('J') PORT_CHAR('j')
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M) PORT_CHAR('M') PORT_CHAR('m')
- PORT_START("JOY0")
+ PORT_START("JOY.0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
@@ -447,11 +447,11 @@ static INPUT_PORTS_START( manager )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 )
- PORT_START("JOY1")
+ PORT_START("JOY.1")
PORT_BIT( 0x7f, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 )
- PORT_START("JOY2")
+ PORT_START("JOY.2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
@@ -461,7 +461,7 @@ static INPUT_PORTS_START( manager )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
- PORT_START("JOY3")
+ PORT_START("JOY.3")
PORT_BIT( 0x7f, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
INPUT_PORTS_END
@@ -497,19 +497,17 @@ WRITE8_MEMBER( crvision_state::pia_pa_w )
UINT8 crvision_state::read_keyboard(int pa)
{
- int i;
- UINT8 value;
- static const char *const keynames[4][8] =
- {
- { "PA0-0", "PA0-1", "PA0-2", "PA0-3", "PA0-4", "PA0-5", "PA0-6", "PA0-7" },
- { "PA1-0", "PA1-1", "PA1-2", "PA1-3", "PA1-4", "PA1-5", "PA1-6", "PA1-7" },
- { "PA2-0", "PA2-1", "PA2-2", "PA2-3", "PA2-4", "PA2-5", "PA2-6", "PA2-7" },
- { "PA3-0", "PA3-1", "PA3-2", "PA3-3", "PA3-4", "PA3-5", "PA3-6", "PA3-7" }
- };
-
- for (i = 0; i < 8; i++)
+ UINT8 value = 0;
+
+ for (int i = 0; i < 8; i++)
{
- value = ioport(keynames[pa][i])->read();
+ switch (pa & 3)
+ {
+ case 0: value = m_inp_pa0[i]->read(); break;
+ case 1: value = m_inp_pa1[i]->read(); break;
+ case 2: value = m_inp_pa2[i]->read(); break;
+ case 3: value = m_inp_pa3[i]->read(); break;
+ }
if (value != 0xff)
{
@@ -560,10 +558,9 @@ READ8_MEMBER( crvision_state::pia_pb_r )
UINT8 data = 0xff;
- if (BIT(m_keylatch, 0)) data &= read_keyboard(0);
- if (BIT(m_keylatch, 1)) data &= read_keyboard(1);
- if (BIT(m_keylatch, 2)) data &= read_keyboard(2);
- if (BIT(m_keylatch, 3)) data &= read_keyboard(3);
+ for (int i = 0; i < 4; i++)
+ if (m_keylatch >> i & 1)
+ data &= read_keyboard(i);
return data;
}
@@ -585,14 +582,9 @@ READ8_MEMBER( laser2001_state::pia_pa_r )
UINT8 data = 0xff;
- if (!BIT(m_keylatch, 0)) data &= m_y0->read();
- if (!BIT(m_keylatch, 1)) data &= m_y1->read();
- if (!BIT(m_keylatch, 2)) data &= m_y2->read();
- if (!BIT(m_keylatch, 3)) data &= m_y3->read();
- if (!BIT(m_keylatch, 4)) data &= m_y4->read();
- if (!BIT(m_keylatch, 5)) data &= m_y5->read();
- if (!BIT(m_keylatch, 6)) data &= m_y6->read();
- if (!BIT(m_keylatch, 7)) data &= m_y7->read();
+ for (int i = 0; i < 8; i++)
+ if (~m_keylatch >> i & 1)
+ data &= m_inp_y[i]->read();
return data;
}
@@ -617,10 +609,9 @@ READ8_MEMBER( laser2001_state::pia_pb_r )
{
UINT8 data = 0xff;
- if (!BIT(m_joylatch, 0)) data &= m_joy0->read();
- if (!BIT(m_joylatch, 1)) data &= m_joy1->read();
- if (!BIT(m_joylatch, 2)) data &= m_joy2->read();
- if (!BIT(m_joylatch, 3)) data &= m_joy3->read();
+ for (int i = 0; i < 4; i++)
+ if (~m_joylatch >> i & 1)
+ data &= m_inp_joy[i]->read();
return data;
}
@@ -692,15 +683,11 @@ WRITE_LINE_MEMBER( laser2001_state::pia_cb2_w )
MACHINE INITIALIZATION
***************************************************************************/
-/*-------------------------------------------------
- MACHINE_START( creativision )
--------------------------------------------------*/
-
void crvision_state::machine_start()
{
- // state saving
+ // zerofill/state saving
+ m_keylatch = 0;
save_item(NAME(m_keylatch));
- save_item(NAME(m_joylatch));
if (m_cart->exists())
{
@@ -709,34 +696,18 @@ void crvision_state::machine_start()
}
}
-void crvision_pal_state::machine_start()
+void laser2001_state::machine_start()
{
- // state saving
- save_item(NAME(m_keylatch));
- save_item(NAME(m_joylatch));
-
- if (m_cart->exists())
- {
- m_maincpu->space(AS_PROGRAM).install_read_handler(0x4000, 0x7fff, read8_delegate(FUNC(crvision_cart_slot_device::read_rom40),(crvision_cart_slot_device*)m_cart));
- m_maincpu->space(AS_PROGRAM).install_read_handler(0x8000, 0xbfff, read8_delegate(FUNC(crvision_cart_slot_device::read_rom80),(crvision_cart_slot_device*)m_cart));
- }
-}
+ crvision_state::machine_start();
-/*-------------------------------------------------
- MACHINE_START( lasr2001 )
--------------------------------------------------*/
+ // zerofill/state saving
+ m_joylatch = 0;
+ m_centronics_busy = 0;
+ m_psg_ready = 0;
-void laser2001_state::machine_start()
-{
- // state saving
- save_item(NAME(m_keylatch));
save_item(NAME(m_joylatch));
-
- if (m_cart->exists())
- {
- m_maincpu->space(AS_PROGRAM).install_read_handler(0x4000, 0x7fff, read8_delegate(FUNC(crvision_cart_slot_device::read_rom40),(crvision_cart_slot_device*)m_cart));
- m_maincpu->space(AS_PROGRAM).install_read_handler(0x8000, 0xbfff, read8_delegate(FUNC(crvision_cart_slot_device::read_rom80),(crvision_cart_slot_device*)m_cart));
- }
+ save_item(NAME(m_centronics_busy));
+ save_item(NAME(m_psg_ready));
}
diff --git a/src/mess/drivers/d6800.c b/src/mess/drivers/d6800.c
index f1ee98aecdb..29f9a074051 100644
--- a/src/mess/drivers/d6800.c
+++ b/src/mess/drivers/d6800.c
@@ -1,9 +1,9 @@
// license:BSD-3-Clause
// copyright-holders:Robbbert
-/*
+/********************************************************************************
The Dream 6800 is a CHIP-8 computer roughly modelled on the Cosmac VIP.
- It was decribed in Electronics Australia magazine in 4 articles starting
+ It was described in Electronics Australia magazine in 4 articles starting
in May 1979. It has 1k of ROM and 1k of RAM. The video consists of 64x32
pixels. The keyboard is a hexcode 4x4 matrix, plus a Function key.
@@ -35,7 +35,7 @@
Information and programs can be found at http://chip8.com/?page=78
-*/
+**********************************************************************************/
#include "emu.h"
diff --git a/src/mess/drivers/daruma.c b/src/mess/drivers/daruma.c
new file mode 100644
index 00000000000..03e19e82a76
--- /dev/null
+++ b/src/mess/drivers/daruma.c
@@ -0,0 +1,169 @@
+// license:GPL-2.0+
+// copyright-holders: Felipe Sanches
+/***************************************************************************
+
+ Sigtron Daruma DS348 dot-matrix printer
+ https://www.hardstand.com.br/daruma/ds348
+
+ Driver by Felipe Correa da Silva Sanches <juca@members.fsf.org>
+
+ Model: Print Plus - DS348
+ Manufacturer: Sigtron Daruma
+ Firmware version 1.1
+ Release Date: May 8th/1998
+ PCB: SIGTRON DS348 REV.B
+
+***************************************************************************/
+
+#include "emu.h"
+#include "cpu/mcs51/mcs51.h"
+#include "sound/speaker.h"
+//TODO: #include "ds348.lh"
+
+class daruma_state : public driver_device
+{
+public:
+ daruma_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_speaker(*this, "speaker") { }
+
+ DECLARE_WRITE8_MEMBER(port_w);
+ DECLARE_READ8_MEMBER(port_r);
+
+ DECLARE_READ8_MEMBER(dev0_r);
+ DECLARE_WRITE8_MEMBER(dev1_w);
+ DECLARE_WRITE8_MEMBER(dev2_w);
+ DECLARE_READ8_MEMBER(dev4_r);
+ required_device<cpu_device> m_maincpu;
+ required_device<speaker_sound_device> m_speaker;
+ char port0, port1, port2, port3;
+};
+
+WRITE8_MEMBER(daruma_state::port_w)
+{
+// printf("port_w: write %02X to PORT (offset=%02X)\n", data, offset);
+ switch(offset)
+ {
+ case MCS51_PORT_P0: port0=data;
+ case MCS51_PORT_P1: port1=data;
+ case MCS51_PORT_P2: port2=data;
+ case MCS51_PORT_P3: port3=data;
+ }
+}
+
+READ8_MEMBER(daruma_state::port_r)
+{
+ switch(offset)
+ {
+ case MCS51_PORT_P0: printf("port_r: read %02X from PORT0\n", port0); return port0;
+ case MCS51_PORT_P1: printf("port_r: read %02X from PORT1\n", port1); return port1;
+ case MCS51_PORT_P2: printf("port_r: read %02X from PORT2\n", port2); return port2;
+ case MCS51_PORT_P3: printf("port_r: read %02X from PORT3\n", port3); return port3;
+ }
+ return 0;
+}
+
+READ8_MEMBER(daruma_state::dev0_r)
+{
+ return 0xFF;
+}
+
+READ8_MEMBER(daruma_state::dev4_r)
+{
+ return ioport("switches")->read();
+}
+
+WRITE8_MEMBER(daruma_state::dev1_w)
+{
+ //while attempting to identify which bit is used for
+ //controlling the buzzer, here's what I heard from each of
+ //the signals on this address:
+
+ //0x80 serial comm.? (noise)
+ //0x20 LED? (3 clicks)
+ //0x10 LED? (1 click)
+ //0x08 serial comm.? click & noise
+ //0x04 LED? (2 clicks)
+ //0x02 motor control or printer heads? (I hear a series of rhythmic pulses)
+ //0x01 LED? (2 clicks)
+ m_speaker->level_w(data & 0x02);
+}
+
+WRITE8_MEMBER(daruma_state::dev2_w)
+{
+ //while attempting to identify which bit is used for
+ //controlling the buzzer, here's what I heard from each of
+ //the signals on this address:
+
+ //0x80: LED? (3 clicks)
+ //0x40: unused?
+ //0x20: unused?
+ //0x10: low freq brief beep followed by a click
+ //0x08: low freq brief noise followed by a click
+ //0x04: low freq brief beep followed by a click
+ //0x02: low freq brief beep followed by a click
+ //0x01: low freq brief noise
+ //m_speaker->level_w(data & 0x01);
+}
+
+static ADDRESS_MAP_START( mem_prg, AS_PROGRAM, 8, daruma_state )
+ AM_RANGE(0x0000, 0xffff) AM_ROM
+ADDRESS_MAP_END
+
+static ADDRESS_MAP_START( mem_io, AS_IO, 8, daruma_state )
+ AM_RANGE(0x0000, 0x0000) AM_READ(dev0_r)
+ AM_RANGE(0x1000, 0x1000) AM_WRITE(dev1_w)
+// AM_RANGE(0x2000, 0x2000) AM_WRITE(dev2_w)
+// AM_RANGE(0x3000, 0x3000) AM_WRITE(dev3_w)
+ AM_RANGE(0x4000, 0x4000) AM_READ(dev4_r)
+ AM_RANGE(0x8000, 0xffff) AM_RAM /* 32K CMOS SRAM (HYUNDAY hy62256a) */
+ AM_RANGE(MCS51_PORT_P0, MCS51_PORT_P3) AM_READWRITE(port_r, port_w)
+ADDRESS_MAP_END
+
+//TODO: These buttons and switches are all guesses. We'll need to further investigate this.
+static INPUT_PORTS_START( daruma )
+ PORT_START("buttons")
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Paper A") PORT_CODE(KEYCODE_A)
+ PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Paper B") PORT_CODE(KEYCODE_B)
+
+ PORT_START("switches")
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN)
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN)
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN)
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN)
+ PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN)
+ PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN)
+ PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN)
+ PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Limit Switch") PORT_CODE(KEYCODE_S)
+
+INPUT_PORTS_END
+
+static MACHINE_CONFIG_START( daruma, daruma_state )
+ /* basic machine hardware */
+ MCFG_CPU_ADD("maincpu", I80C32,11059200) //verified on pcb
+ MCFG_CPU_PROGRAM_MAP(mem_prg)
+ MCFG_CPU_IO_MAP(mem_io)
+
+ /* sound hardware */
+ MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
+ MCFG_SOUND_ROUTE(0, "mono", 1.00)
+
+/* TODO:
+ MCFG_DEFAULT_LAYOUT(layout_daruma)
+
+ Motors: MTA011
+ http://pdf.datasheetcatalog.com/datasheet/Shindengen/mXstzvq.pdf
+
+ The motor controller suposedly is used to cut the paper strip out after finishing printing something.
+*/
+MACHINE_CONFIG_END
+
+ROM_START( ds348 )
+ ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD( "daruma_ds348_v1_1.rom", 0x0000, 0x10000, CRC(10bf9036) SHA1(d654a13bc582f5384e759ec6fe5309a642bd8e18) )
+ROM_END
+
+/* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */
+COMP( 1998, ds348, 0, 0, daruma, daruma, driver_device, 0, "Sigtron Daruma", "Print Plus DS348 - Dot matrix printer", GAME_NOT_WORKING | GAME_NO_SOUND)
diff --git a/src/mess/drivers/dectalk.c b/src/mess/drivers/dectalk.c
index 6aa4ace713c..1935e4133e4 100644
--- a/src/mess/drivers/dectalk.c
+++ b/src/mess/drivers/dectalk.c
@@ -20,7 +20,7 @@
*
* Staff behind DECtalk itself: (mostly from http://amhistory.si.edu/archives/speechsynthesis/ss_dec.htm ):
* John C. Broihier
-* Edward A. Bruckert (who followed the DECtalk IP from DEC->Compaq->HP->Force Computers->Fonix inc and still works on DECtalk as of 2012)
+* Edward A. Bruckert (who followed the DECtalk IP from DEC->Compaq->HP->Force Computers->Fonix inc from where he retired in 2014)
* Dave Conroy (dtc-03 letter to sound rules; logic design, worked on dtc-01 and dtc-03, see correspondence below)
* Michael J. Crowley
* Dennis H. Klatt [1938 - Dec 30, 1988] (worked on klsyn and other parts of MITalk, wrote KLATTtalk which was exclusively licensed to DEC in 1982, worked on dtc-01 and dtc-03)
@@ -35,7 +35,6 @@
*
* TODO:
* * DUART:
-* * Get the duart self test to pass again; this used to work with the old non-devcb duart implementation but regressed with the newer one
* * The duart self tests are EXTENSIVE and make an excellent check of many of the duart internal bits.
* To enable the self tests rather than bypassing them, under dipswitches, set 'Skip Self Test(IP4)' to 'Open (VCC)'
* and under system configuration set 'Hack to prevent hang when skip self test is shorted' to 'Off'
@@ -56,7 +55,15 @@
* * <DONE> Figure out why the older -165/-166 and newer -409/-410 tms32010 dsp firmwares don't produce any sound, while the middle -204/-205 one does (fifo implementations were busted)
* * <DONE> Actually store the X2212 nvram's eeprom data to disk rather than throwing it out on exit
* * Get setup mode with the serial BREAK int working enough to actually properly save the default nvram back to the chip in emulation, and get rid of the (currently unused) nvram default image in the rom definitions
-* * emulate/simulate the MT8060 dtmf decoder as a 16-key input device? or hook it to some simple fft code? Francois Javier's fftmorse code ran full speed on a 6mhz 80286, maybe use that?
+* * emulate/simulate the MT8860 DTMF decoder and MT8865 DTMF filter as a 16-key input device? or hook it to some simple fft code? Francois Jalbert's fftmorse code ran full speed on a 12mhz 80286, maybe use that?
+* Sarayan suggested this can be done in one of two ways:
+* 1. Standalone 'canned' DTMF detector and discriminator code (francois' and peter jennings' 286 code, or modern fft code)
+* 2. Emulate the MT8865 as a set of two 7th order bandpass filters with 2
+* outputs for the low and high band (as in real life as documented on the
+* datasheet) and emulate the MT8860 exactly as in real life as well, as a
+* dual-input pulse-width measurement device to distinguish the 4 low and
+* high band DTMF tones as well as their combined presence.
+* The latter is clearly more accurate but likely slower.
* * figure out how to plumb diserial/rs232 to have an external application send data to the two serial ports to be spoken; this shouldn't be too hard at this point.
*
* LED error code list (found by experimentation and help from leeeeee):
@@ -342,7 +349,7 @@ WRITE_LINE_MEMBER(dectalk_state::dectalk_duart_irq_handler)
m_maincpu->set_input_line_and_vector(M68K_IRQ_6, state, M68K_INT_ACK_AUTOVECTOR);
//drvstate->m_maincpu->set_input_line_and_vector(M68K_IRQ_6, CLEAR_LINE, M68K_INT_ACK_AUTOVECTOR);
//drvstate->m_maincpu->set_input_line_and_vector(M68K_IRQ_6, HOLD_LINE, vector);
-};
+}
READ8_MEMBER(dectalk_state::dectalk_duart_input)
{
diff --git a/src/mess/drivers/dgn_beta.c b/src/mess/drivers/dgn_beta.c
index f71d0c98ae9..3566313dade 100644
--- a/src/mess/drivers/dgn_beta.c
+++ b/src/mess/drivers/dgn_beta.c
@@ -45,7 +45,8 @@ documentation still exists.
#include "machine/6821pia.h"
#include "includes/dgn_beta.h"
#include "machine/mos6551.h"
-#include "formats/coco_dsk.h"
+#include "formats/vdk_dsk.h"
+#include "formats/dmk_dsk.h"
#include "imagedev/flopdrv.h"
#include "machine/ram.h"
#include "video/mc6845.h"
@@ -288,13 +289,6 @@ PALETTE_INIT_MEMBER(dgn_beta_state, dgn)
}
}
-static const floppy_interface dgnbeta_floppy_interface =
-{
- FLOPPY_STANDARD_5_25_DSHD,
- LEGACY_FLOPPY_OPTIONS_NAME(coco),
- NULL
-};
-
/* F4 Character Displayer */
static const gfx_layout dgnbeta_charlayout =
{
@@ -313,6 +307,14 @@ static GFXDECODE_START( dgnbeta )
GFXDECODE_ENTRY( "gfx1", 0x0000, dgnbeta_charlayout, 0, 8 )
GFXDECODE_END
+FLOPPY_FORMATS_MEMBER( dgn_beta_state::floppy_formats )
+ FLOPPY_VDK_FORMAT,
+ FLOPPY_DMK_FORMAT
+FLOPPY_FORMATS_END
+
+static SLOT_INTERFACE_START( dgn_beta_floppies )
+ SLOT_INTERFACE("qd", FLOPPY_525_QD)
+SLOT_INTERFACE_END
static MACHINE_CONFIG_START( dgnbeta, dgn_beta_state )
/* basic machine hardware */
@@ -366,12 +368,14 @@ static MACHINE_CONFIG_START( dgnbeta, dgn_beta_state )
MCFG_PIA_IRQA_HANDLER(WRITELINE(dgn_beta_state,d_pia2_irq_a))
MCFG_PIA_IRQB_HANDLER(WRITELINE(dgn_beta_state,d_pia2_irq_b))
- MCFG_DEVICE_ADD(FDC_TAG, WD2797, 0)
- MCFG_WD17XX_DEFAULT_DRIVE4_TAGS
- MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(dgn_beta_state,dgnbeta_fdc_intrq_w))
- MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(dgn_beta_state,dgnbeta_fdc_drq_w))
+ MCFG_WD2797_ADD(FDC_TAG, XTAL_1MHz)
+ MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(dgn_beta_state, dgnbeta_fdc_intrq_w))
+ MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(dgn_beta_state, dgnbeta_fdc_drq_w))
- MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(dgnbeta_floppy_interface)
+ MCFG_FLOPPY_DRIVE_ADD(FDC_TAG ":0", dgn_beta_floppies, "qd", dgn_beta_state::floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD(FDC_TAG ":1", dgn_beta_floppies, "qd", dgn_beta_state::floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD(FDC_TAG ":2", dgn_beta_floppies, "qd", dgn_beta_state::floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD(FDC_TAG ":3", dgn_beta_floppies, "qd", dgn_beta_state::floppy_formats)
MCFG_MC6845_ADD("crtc", HD6845, "screen", XTAL_12_288MHz / 16) //XTAL is guessed
MCFG_MC6845_SHOW_BORDER_AREA(false)
diff --git a/src/mess/drivers/dragon.c b/src/mess/drivers/dragon.c
index 3a95025fd49..61375867d28 100644
--- a/src/mess/drivers/dragon.c
+++ b/src/mess/drivers/dragon.c
@@ -18,7 +18,8 @@
#include "bus/coco/coco_pak.h"
#include "bus/coco/coco_fdc.h"
#include "bus/coco/coco_multi.h"
-#include "formats/coco_dsk.h"
+#include "formats/vdk_dsk.h"
+#include "formats/dmk_dsk.h"
#include "imagedev/flopdrv.h"
@@ -125,12 +126,19 @@ static SLOT_INTERFACE_START(dragon_cart)
SLOT_INTERFACE("pak", COCO_PAK)
SLOT_INTERFACE_END
-static const floppy_interface coco_floppy_interface =
-{
- FLOPPY_STANDARD_5_25_DSHD,
- LEGACY_FLOPPY_OPTIONS_NAME(coco),
- NULL
-};
+FLOPPY_FORMATS_MEMBER( dragon_alpha_state::dragon_formats )
+ FLOPPY_VDK_FORMAT,
+ FLOPPY_DMK_FORMAT
+FLOPPY_FORMATS_END
+
+static SLOT_INTERFACE_START( dragon_floppies )
+ SLOT_INTERFACE("sssd", FLOPPY_525_SSSD)
+ SLOT_INTERFACE("sd", FLOPPY_525_SD)
+ SLOT_INTERFACE("ssdd", FLOPPY_525_SSDD)
+ SLOT_INTERFACE("dd", FLOPPY_525_DD)
+ SLOT_INTERFACE("ssqd", FLOPPY_525_SSQD)
+ SLOT_INTERFACE("qd", FLOPPY_525_QD)
+SLOT_INTERFACE_END
static MACHINE_CONFIG_START( dragon_base, dragon_state )
// basic machine hardware
@@ -237,12 +245,14 @@ static MACHINE_CONFIG_DERIVED_CLASS( dgnalpha, dragon_base, dragon_alpha_state )
MCFG_MOS6551_XTAL(XTAL_1_8432MHz)
// floppy
- MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(coco_floppy_interface)
-
- MCFG_DEVICE_ADD(WD2797_TAG, WD2797, 0)
- MCFG_WD17XX_DEFAULT_DRIVE4_TAGS
- MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(dragon_alpha_state, fdc_intrq_w))
- MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(dragon_alpha_state, fdc_drq_w))
+ MCFG_WD2797_ADD(WD2797_TAG, XTAL_1MHz)
+ MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(dragon_alpha_state, fdc_intrq_w))
+ MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(dragon_alpha_state, fdc_drq_w))
+
+ MCFG_FLOPPY_DRIVE_ADD(WD2797_TAG ":0", dragon_floppies, "qd", dragon_alpha_state::dragon_formats)
+ MCFG_FLOPPY_DRIVE_ADD(WD2797_TAG ":1", dragon_floppies, "qd", dragon_alpha_state::dragon_formats)
+ MCFG_FLOPPY_DRIVE_ADD(WD2797_TAG ":2", dragon_floppies, "qd", dragon_alpha_state::dragon_formats)
+ MCFG_FLOPPY_DRIVE_ADD(WD2797_TAG ":3", dragon_floppies, "qd", dragon_alpha_state::dragon_formats)
// sound hardware
MCFG_SOUND_ADD(AY8912_TAG, AY8912, 1000000)
diff --git a/src/mess/drivers/dvk_ksm.c b/src/mess/drivers/dvk_ksm.c
index 2a4532956d8..118fdef57e7 100644
--- a/src/mess/drivers/dvk_ksm.c
+++ b/src/mess/drivers/dvk_ksm.c
@@ -288,8 +288,8 @@ TIMER_DEVICE_CALLBACK_MEMBER(ksm_state::scanline_callback)
UINT16 offset;
DBG_LOG(2,"scanline_cb",
- ("addr %02x frame %" I64FMT "d x %.4d y %.3d row %.2d\n",
- m_video.line, m_screen->frame_number(), m_screen->hpos(), y, y%11));
+ ("addr %02x frame %d x %.4d y %.3d row %.2d\n",
+ m_video.line, (int)m_screen->frame_number(), m_screen->hpos(), y, y%11));
if (y < KSM_VERT_START) return;
y -= KSM_VERT_START;
diff --git a/src/mess/drivers/einstein.c b/src/mess/drivers/einstein.c
index b0ce919519f..3be299ab83c 100644
--- a/src/mess/drivers/einstein.c
+++ b/src/mess/drivers/einstein.c
@@ -734,7 +734,7 @@ static MACHINE_CONFIG_START( einstein, einstein_state )
/* uart */
MCFG_DEVICE_ADD(IC_I060, I8251, 0)
- MCFG_WD1770x_ADD(IC_I042, XTAL_X002)
+ MCFG_WD1770_ADD(IC_I042, XTAL_X002)
MCFG_FLOPPY_DRIVE_ADD(IC_I042 ":0", einstein_floppies, "525dd", floppy_image_device::default_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD(IC_I042 ":1", einstein_floppies, "525dd", floppy_image_device::default_floppy_formats)
diff --git a/src/mess/drivers/esq1.c b/src/mess/drivers/esq1.c
index 8f960de0d07..3dcf511f95a 100644
--- a/src/mess/drivers/esq1.c
+++ b/src/mess/drivers/esq1.c
@@ -537,7 +537,7 @@ ADDRESS_MAP_END
WRITE_LINE_MEMBER(esq1_state::duart_irq_handler)
{
m_maincpu->set_input_line(M6809_IRQ_LINE, state);
-};
+}
WRITE8_MEMBER(esq1_state::duart_output)
{
@@ -625,7 +625,7 @@ static MACHINE_CONFIG_DERIVED(sq80, esq1)
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(sq80_map)
- MCFG_WD1772x_ADD(WD1772_TAG, 4000000)
+ MCFG_WD1772_ADD(WD1772_TAG, 4000000)
MACHINE_CONFIG_END
static INPUT_PORTS_START( esq1 )
diff --git a/src/mess/drivers/esq5505.c b/src/mess/drivers/esq5505.c
index af644777eec..69f3c380971 100644
--- a/src/mess/drivers/esq5505.c
+++ b/src/mess/drivers/esq5505.c
@@ -448,7 +448,7 @@ WRITE_LINE_MEMBER(esq5505_state::duart_irq_handler)
duart_irq_state = 0;
}
update_irq_to_maincpu();
-};
+}
WRITE8_MEMBER(esq5505_state::duart_output)
{
@@ -657,7 +657,7 @@ static MACHINE_CONFIG_DERIVED(eps, vfx)
MCFG_ESQPANEL_TX_CALLBACK(DEVWRITELINE("duart", mc68681_device, rx_b_w))
MCFG_ESQPANEL_ANALOG_CALLBACK(WRITE16(esq5505_state, analog_w))
- MCFG_WD1772x_ADD("wd1772", 8000000)
+ MCFG_WD1772_ADD("wd1772", 8000000)
MCFG_FLOPPY_DRIVE_ADD("wd1772:0", ensoniq_floppies, "35dd", esq5505_state::floppy_formats)
MCFG_DEVICE_ADD("mc68450", HD63450, 0) // MC68450 compatible
@@ -674,7 +674,7 @@ static MACHINE_CONFIG_DERIVED(vfxsd, vfx)
MCFG_CPU_MODIFY( "maincpu" )
MCFG_CPU_PROGRAM_MAP(vfxsd_map)
- MCFG_WD1772x_ADD("wd1772", 8000000)
+ MCFG_WD1772_ADD("wd1772", 8000000)
MCFG_FLOPPY_DRIVE_ADD("wd1772:0", ensoniq_floppies, "35dd", esq5505_state::floppy_formats)
MACHINE_CONFIG_END
@@ -724,7 +724,7 @@ static MACHINE_CONFIG_START(vfx32, esq5505_state)
MCFG_SOUND_ROUTE_EX(6, "pump", 1.0, 6)
MCFG_SOUND_ROUTE_EX(7, "pump", 1.0, 7)
- MCFG_WD1772x_ADD("wd1772", 8000000)
+ MCFG_WD1772_ADD("wd1772", 8000000)
MCFG_FLOPPY_DRIVE_ADD("wd1772:0", ensoniq_floppies, "35dd", esq5505_state::floppy_formats)
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/esqkt.c b/src/mess/drivers/esqkt.c
index 086909c8783..ff97daaf644 100644
--- a/src/mess/drivers/esqkt.c
+++ b/src/mess/drivers/esqkt.c
@@ -181,7 +181,7 @@ READ16_MEMBER(esqkt_state::esq5506_read_adc)
WRITE_LINE_MEMBER(esqkt_state::duart_irq_handler)
{
m_maincpu->set_input_line(M68K_IRQ_3, state);
-};
+}
WRITE8_MEMBER(esqkt_state::duart_output)
{
diff --git a/src/mess/drivers/excali64.c b/src/mess/drivers/excali64.c
index e34b55b01c5..b68d0e1f67e 100644
--- a/src/mess/drivers/excali64.c
+++ b/src/mess/drivers/excali64.c
@@ -28,8 +28,6 @@ ToDo:
****************************************************************************/
-#define NEWFDC 1
-
#include "emu.h"
#include "cpu/z80/z80.h"
@@ -46,14 +44,8 @@ ToDo:
#include "machine/z80dma.h"
#include "machine/rescap.h"
#include "machine/74123.h"
-#if NEWFDC
#include "machine/wd_fdc.h"
#include "formats/excali64_dsk.h"
-#else
-#include "machine/wd17xx.h"
-#include "imagedev/flopdrv.h"
-#include "formats/basicdsk.h"
-#endif
class excali64_state : public driver_device
{
@@ -69,10 +61,8 @@ public:
, m_u12(*this, "u12")
, m_centronics(*this, "centronics")
, m_fdc(*this, "fdc")
-#if NEWFDC
, m_floppy0(*this, "fdc:0")
, m_floppy1(*this, "fdc:1")
-#endif
{ }
DECLARE_PALETTE_INIT(excali64);
@@ -85,9 +75,7 @@ public:
DECLARE_WRITE8_MEMBER(porte4_w);
DECLARE_READ8_MEMBER(porte8_r);
DECLARE_WRITE8_MEMBER(portec_w);
-#if NEWFDC
DECLARE_FLOPPY_FORMATS(floppy_formats);
-#endif
DECLARE_WRITE_LINE_MEMBER(cent_busy_w);
DECLARE_WRITE_LINE_MEMBER(busreq_w);
DECLARE_READ8_MEMBER(memory_read_byte);
@@ -118,13 +106,9 @@ private:
required_device<z80dma_device> m_dma;
required_device<ttl74123_device> m_u12;
required_device<centronics_device> m_centronics;
-#if NEWFDC
required_device<wd2793_t> m_fdc;
required_device<floppy_connector> m_floppy0;
required_device<floppy_connector> m_floppy1;
-#else
- required_device<wd2793_device> m_fdc;
-#endif
};
static ADDRESS_MAP_START(excali64_mem, AS_PROGRAM, 8, excali64_state)
@@ -150,11 +134,7 @@ static ADDRESS_MAP_START(excali64_io, AS_IO, 8, excali64_state)
AM_RANGE(0xe4, 0xe7) AM_WRITE(porte4_w)
AM_RANGE(0xe8, 0xeb) AM_READ(porte8_r)
AM_RANGE(0xec, 0xef) AM_WRITE(portec_w)
-#if NEWFDC
AM_RANGE(0xf0, 0xf3) AM_DEVREADWRITE("fdc", wd2793_t, read, write)
-#else
- AM_RANGE(0xf0, 0xf3) AM_DEVREADWRITE("fdc", wd2793_device, read, write)
-#endif
ADDRESS_MAP_END
@@ -245,7 +225,6 @@ WRITE_LINE_MEMBER( excali64_state::cent_busy_w )
m_centronics_busy = state;
}
-#if NEWFDC
FLOPPY_FORMATS_MEMBER( excali64_state::floppy_formats )
FLOPPY_EXCALI64_FORMAT
FLOPPY_FORMATS_END
@@ -254,37 +233,13 @@ static SLOT_INTERFACE_START( excali64_floppies )
SLOT_INTERFACE( "drive0", FLOPPY_525_QD )
SLOT_INTERFACE( "drive1", FLOPPY_525_QD )
SLOT_INTERFACE_END
-#else
-static LEGACY_FLOPPY_OPTIONS_START(excali64)
- LEGACY_FLOPPY_OPTION(excali64_ds, "raw", "Excalibur 64 DS disk image", basicdsk_identify_default, basicdsk_construct_default, NULL,
- HEADS([2])
- TRACKS([80])
- SECTORS([5])
- SECTOR_LENGTH([1024])
- FIRST_SECTOR_ID([1]))
-LEGACY_FLOPPY_OPTIONS_END
-
-static const floppy_interface excali64_floppy_interface =
-{
- FLOPPY_STANDARD_5_25_DSDD,
- LEGACY_FLOPPY_OPTIONS_NAME(excali64),
- NULL
-};
-#endif
// pulses from port E4 bit 5 restart the 74123. After 3.6 secs without a pulse, the motor gets turned off.
WRITE8_MEMBER( excali64_state::motor_w )
{
m_motor = BIT(data, 0);
-#if NEWFDC
m_floppy1->get_device()->mon_w(!m_motor);
m_floppy0->get_device()->mon_w(!m_motor);
-#else
- legacy_floppy_image_device *flop = subdevice<legacy_floppy_image_device>(FLOPPY_0);
- flop->floppy_mon_w(!m_motor); // motor on
- flop = subdevice<legacy_floppy_image_device>(FLOPPY_1);
- flop->floppy_mon_w(!m_motor); // motor on
-#endif
}
READ8_MEMBER( excali64_state::porte8_r )
@@ -294,7 +249,6 @@ READ8_MEMBER( excali64_state::porte8_r )
WRITE8_MEMBER( excali64_state::porte4_w )
{
-#if NEWFDC
floppy_image_device *floppy = NULL;
if (BIT(data, 0))
floppy = m_floppy0->get_device();
@@ -306,16 +260,6 @@ WRITE8_MEMBER( excali64_state::porte4_w )
if (floppy)
floppy->ss_w(BIT(data, 4));
-#else
- if BIT(data, 0)
- m_fdc->set_drive(0);
-
- if BIT(data, 1)
- m_fdc->set_drive(1);
-
- m_fdc->set_side(BIT(data, 4));
-#endif
-
m_u12->b_w(space,offset, BIT(data, 5)); // motor pulse
}
@@ -326,11 +270,7 @@ d2 = density select (0 = double)
*/
WRITE8_MEMBER( excali64_state::portec_w )
{
-#if NEWFDC
m_fdc->dden_w(BIT(data, 2));
-#else
- m_fdc->dden_w(!BIT(data, 2));
-#endif
}
WRITE_LINE_MEMBER( excali64_state::busreq_w )
@@ -651,17 +591,12 @@ static MACHINE_CONFIG_START( excali64, excali64_state )
/* Devices */
MCFG_CASSETTE_ADD( "cassette" )
-#if NEWFDC
- MCFG_WD2793x_ADD("fdc", XTAL_16MHz / 16)
+
+ MCFG_WD2793_ADD("fdc", XTAL_16MHz / 16)
MCFG_WD_FDC_DRQ_CALLBACK(DEVWRITELINE("dma", z80dma_device, rdy_w))
MCFG_FLOPPY_DRIVE_ADD("fdc:0", excali64_floppies, "drive0", excali64_state::floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("fdc:1", excali64_floppies, "drive1", excali64_state::floppy_formats)
-#else
- MCFG_DEVICE_ADD("fdc", WD2793, 0)
- MCFG_WD17XX_DEFAULT_DRIVE2_TAGS
- MCFG_WD17XX_DRQ_CALLBACK(DEVWRITELINE("dma", z80dma_device, rdy_w))
- MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(excali64_floppy_interface)
-#endif
+
MCFG_DEVICE_ADD("dma", Z80DMA, XTAL_16MHz/4)
MCFG_Z80DMA_OUT_BUSREQ_CB(WRITELINE(excali64_state, busreq_w))
MCFG_Z80DMA_IN_MREQ_CB(READ8(excali64_state, memory_read_byte))
diff --git a/src/mess/drivers/exelv.c b/src/mess/drivers/exelv.c
index f66216e03d9..c48bd0234dc 100644
--- a/src/mess/drivers/exelv.c
+++ b/src/mess/drivers/exelv.c
@@ -1,4 +1,4 @@
-// license:???
+// license:GPL-2.0+
// copyright-holders:Raphael Nabet
/*
Experimental exelvision driver
diff --git a/src/mess/drivers/fidelz80.c b/src/mess/drivers/fidelz80.c
index 32acdd01919..2d64b061189 100644
--- a/src/mess/drivers/fidelz80.c
+++ b/src/mess/drivers/fidelz80.c
@@ -665,12 +665,12 @@ WRITE8_MEMBER( fidelz80_state::fidelz80_portb_w )
}
// ignoring the language switch enable for now, is bit 0x40
-};
+}
WRITE8_MEMBER( fidelz80_state::fidelz80_portc_w )
{
m_kp_matrix = data;
-};
+}
WRITE8_MEMBER( fidelz80_state::cc10_porta_w )
{
diff --git a/src/mess/drivers/fm7.c b/src/mess/drivers/fm7.c
index 2f088103da9..2247deec612 100644
--- a/src/mess/drivers/fm7.c
+++ b/src/mess/drivers/fm7.c
@@ -469,7 +469,7 @@ WRITE8_MEMBER(fm7_state::fm7_fdc_w)
switch(offset)
{
case 0:
- m_fdc->command_w(space, offset,data);
+ m_fdc->cmd_w(space, offset,data);
break;
case 1:
m_fdc->track_w(space, offset,data);
@@ -482,7 +482,8 @@ WRITE8_MEMBER(fm7_state::fm7_fdc_w)
break;
case 4:
m_fdc_side = data & 0x01;
- m_fdc->set_side(data & 0x01);
+ if (m_floppy)
+ m_floppy->ss_w(data & 0x01);
logerror("FDC: wrote %02x to 0x%04x (side)\n",data,offset+0xfd18);
break;
case 5:
@@ -493,9 +494,17 @@ WRITE8_MEMBER(fm7_state::fm7_fdc_w)
}
else
{
- m_fdc->set_drive(data & 0x03);
- floppy_get_device(machine(), data & 0x03)->floppy_mon_w(!BIT(data, 7));
- floppy_get_device(machine(), data & 0x03)->floppy_drive_set_ready_state(data & 0x80,0);
+ switch (data & 0x01)
+ {
+ case 0: m_floppy = m_floppy0->get_device(); break;
+ case 1: m_floppy = m_floppy1->get_device(); break;
+ }
+
+ m_fdc->set_floppy(m_floppy);
+
+ if (m_floppy)
+ m_floppy->mon_w(!BIT(data, 7));
+
logerror("FDC: wrote %02x to 0x%04x (drive)\n",data,offset+0xfd18);
}
break;
@@ -2031,12 +2040,11 @@ void fm7_state::machine_reset()
memset(m_video_ram, 0, sizeof(UINT8) * 0x18000);
}
-static const floppy_interface fm7_floppy_interface =
-{
- FLOPPY_STANDARD_5_25_DSHD,
- LEGACY_FLOPPY_OPTIONS_NAME(default),
- "floppy_5_25"
-};
+
+static SLOT_INTERFACE_START( fm7_floppies )
+ SLOT_INTERFACE("qd", FLOPPY_525_QD)
+SLOT_INTERFACE_END
+
#define MCFG_ADDRESS_BANK(tag) \
MCFG_DEVICE_ADD(tag, ADDRESS_MAP_BANK, 0) \
@@ -2085,10 +2093,16 @@ static MACHINE_CONFIG_START( fm7, fm7_state )
MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_ENABLED)
MCFG_CASSETTE_INTERFACE("fm7_cass")
- MCFG_DEVICE_ADD("fdc", MB8877, 0)
- MCFG_WD17XX_DEFAULT_DRIVE2_TAGS
- MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(fm7_state, fm7_fdc_intrq_w))
- MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(fm7_state, fm7_fdc_drq_w))
+ MCFG_SOFTWARE_LIST_ADD("cass_list","fm7_cass")
+
+ MCFG_MB8877_ADD("fdc", XTAL_8MHz / 8)
+ MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(fm7_state, fm7_fdc_intrq_w))
+ MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(fm7_state, fm7_fdc_drq_w))
+
+ MCFG_FLOPPY_DRIVE_ADD("fdc:0", fm7_floppies, "qd", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("fdc:1", fm7_floppies, "qd", floppy_image_device::default_floppy_formats)
+
+ MCFG_SOFTWARE_LIST_ADD("flop_list","fm7_disk")
MCFG_CENTRONICS_ADD("centronics", centronics_devices, "printer")
MCFG_SLOT_OPTION_ADD( "dsjoy", DEMPA_SHINBUNSHA_JOYSTICK )
@@ -2098,11 +2112,6 @@ static MACHINE_CONFIG_START( fm7, fm7_state )
MCFG_CENTRONICS_PERROR_HANDLER(WRITELINE(fm7_state, write_centronics_perror))
MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics")
-
- MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(fm7_floppy_interface)
-
- MCFG_SOFTWARE_LIST_ADD("cass_list","fm7_cass")
- MCFG_SOFTWARE_LIST_ADD("flop_list","fm7_disk")
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( fm8, fm7_state )
@@ -2142,10 +2151,12 @@ static MACHINE_CONFIG_START( fm8, fm7_state )
MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_ENABLED)
MCFG_CASSETTE_INTERFACE("fm7_cass")
- MCFG_DEVICE_ADD("fdc", MB8877, 0)
- MCFG_WD17XX_DEFAULT_DRIVE2_TAGS
- MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(fm7_state, fm7_fdc_intrq_w))
- MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(fm7_state, fm7_fdc_drq_w))
+ MCFG_MB8877_ADD("fdc", XTAL_8MHz / 8)
+ MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(fm7_state, fm7_fdc_intrq_w))
+ MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(fm7_state, fm7_fdc_drq_w))
+
+ MCFG_FLOPPY_DRIVE_ADD("fdc:0", fm7_floppies, "qd", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("fdc:1", fm7_floppies, "qd", floppy_image_device::default_floppy_formats)
MCFG_CENTRONICS_ADD("centronics", centronics_devices, "printer")
MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(fm7_state, write_centronics_busy))
@@ -2154,9 +2165,6 @@ static MACHINE_CONFIG_START( fm8, fm7_state )
MCFG_CENTRONICS_PERROR_HANDLER(WRITELINE(fm7_state, write_centronics_perror))
MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics")
-
- MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(fm7_floppy_interface)
-
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( fm77av, fm7_state )
@@ -2218,10 +2226,17 @@ static MACHINE_CONFIG_START( fm77av, fm7_state )
MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_ENABLED)
MCFG_CASSETTE_INTERFACE("fm7_cass")
- MCFG_DEVICE_ADD("fdc", MB8877, 0)
- MCFG_WD17XX_DEFAULT_DRIVE2_TAGS
- MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(fm7_state, fm7_fdc_intrq_w))
- MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(fm7_state, fm7_fdc_drq_w))
+ MCFG_SOFTWARE_LIST_COMPATIBLE_ADD("cass_list", "fm7_cass")
+
+ MCFG_MB8877_ADD("fdc", XTAL_8MHz / 8)
+ MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(fm7_state, fm7_fdc_intrq_w))
+ MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(fm7_state, fm7_fdc_drq_w))
+
+ MCFG_FLOPPY_DRIVE_ADD("fdc:0", fm7_floppies, "qd", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("fdc:1", fm7_floppies, "qd", floppy_image_device::default_floppy_formats)
+
+ MCFG_SOFTWARE_LIST_ADD("av_flop_list", "fm77av")
+ MCFG_SOFTWARE_LIST_COMPATIBLE_ADD("flop_list", "fm7_disk")
MCFG_CENTRONICS_ADD("centronics", centronics_devices, "printer")
MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(fm7_state, write_centronics_busy))
@@ -2230,12 +2245,6 @@ static MACHINE_CONFIG_START( fm77av, fm7_state )
MCFG_CENTRONICS_PERROR_HANDLER(WRITELINE(fm7_state, write_centronics_perror))
MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics")
-
- MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(fm7_floppy_interface)
-
- MCFG_SOFTWARE_LIST_ADD("av_flop_list","fm77av")
- MCFG_SOFTWARE_LIST_COMPATIBLE_ADD("cass_list","fm7_cass")
- MCFG_SOFTWARE_LIST_COMPATIBLE_ADD("flop_list","fm7_disk")
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( fm11, fm7_state )
@@ -2296,10 +2305,12 @@ static MACHINE_CONFIG_START( fm11, fm7_state )
MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_ENABLED)
MCFG_CASSETTE_INTERFACE("fm7_cass")
- MCFG_DEVICE_ADD("fdc", MB8877, 0)
- MCFG_WD17XX_DEFAULT_DRIVE2_TAGS
- MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(fm7_state, fm7_fdc_intrq_w))
- MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(fm7_state, fm7_fdc_drq_w))
+ MCFG_MB8877_ADD("fdc", XTAL_8MHz / 8)
+ MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(fm7_state, fm7_fdc_intrq_w))
+ MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(fm7_state, fm7_fdc_drq_w))
+
+ MCFG_FLOPPY_DRIVE_ADD("fdc:0", fm7_floppies, "qd", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("fdc:1", fm7_floppies, "qd", floppy_image_device::default_floppy_formats)
MCFG_CENTRONICS_ADD("centronics", centronics_devices, "printer")
MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(fm7_state, write_centronics_busy))
@@ -2308,9 +2319,6 @@ static MACHINE_CONFIG_START( fm11, fm7_state )
MCFG_CENTRONICS_PERROR_HANDLER(WRITELINE(fm7_state, write_centronics_perror))
MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics")
-
- MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(fm7_floppy_interface)
-
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( fm16beta, fm7_state )
@@ -2350,10 +2358,12 @@ static MACHINE_CONFIG_START( fm16beta, fm7_state )
MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_ENABLED)
MCFG_CASSETTE_INTERFACE("fm7_cass")
- MCFG_DEVICE_ADD("fdc", MB8877, 0)
- MCFG_WD17XX_DEFAULT_DRIVE2_TAGS
- MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(fm7_state, fm7_fdc_intrq_w))
- MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(fm7_state, fm7_fdc_drq_w))
+ MCFG_MB8877_ADD("fdc", XTAL_8MHz / 8)
+ MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(fm7_state, fm7_fdc_intrq_w))
+ MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(fm7_state, fm7_fdc_drq_w))
+
+ MCFG_FLOPPY_DRIVE_ADD("fdc:0", fm7_floppies, "qd", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("fdc:1", fm7_floppies, "qd", floppy_image_device::default_floppy_formats)
MCFG_CENTRONICS_ADD("centronics", centronics_devices, "printer")
MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(fm7_state, write_centronics_busy))
@@ -2362,9 +2372,6 @@ static MACHINE_CONFIG_START( fm16beta, fm7_state )
MCFG_CENTRONICS_PERROR_HANDLER(WRITELINE(fm7_state, write_centronics_perror))
MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics")
-
- MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(fm7_floppy_interface)
-
MACHINE_CONFIG_END
/* ROM definition */
diff --git a/src/mess/drivers/fmtowns.c b/src/mess/drivers/fmtowns.c
index 1b002428d48..fa6235e04d2 100644
--- a/src/mess/drivers/fmtowns.c
+++ b/src/mess/drivers/fmtowns.c
@@ -2725,7 +2725,7 @@ static MACHINE_CONFIG_FRAGMENT( towns_base )
MCFG_PIC8259_ADD( "pic8259_slave", DEVWRITELINE("pic8259_master", pic8259_device, ir7_w), GND, NULL)
- MCFG_MB8877x_ADD("fdc",XTAL_8MHz/4) // clock unknown
+ MCFG_MB8877_ADD("fdc",XTAL_8MHz/4) // clock unknown
MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(towns_state,mb8877a_irq_w))
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(towns_state,mb8877a_drq_w))
MCFG_FLOPPY_DRIVE_ADD("fdc:0", towns_floppies, "35hd", towns_state::floppy_formats)
diff --git a/src/mess/drivers/gimix.c b/src/mess/drivers/gimix.c
index 1e6e1a00372..4588f8006a4 100644
--- a/src/mess/drivers/gimix.c
+++ b/src/mess/drivers/gimix.c
@@ -586,7 +586,7 @@ static MACHINE_CONFIG_START( gimix, gimix_state )
MCFG_PTM6840_IRQ_CB(WRITELINE(gimix_state,irq_w)) // PCB pictures show both the RTC and timer set to generate IRQs (are jumper configurable)
/* floppy disks */
- MCFG_FD1797x_ADD("fdc",XTAL_8MHz / 4)
+ MCFG_FD1797_ADD("fdc",XTAL_8MHz / 4)
MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(gimix_state,fdc_irq_w))
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(gimix_state,fdc_drq_w))
MCFG_WD_FDC_FORCE_READY
diff --git a/src/mess/drivers/hec2hrp.c b/src/mess/drivers/hec2hrp.c
index 0dc0547ad13..0553958fcfa 100644
--- a/src/mess/drivers/hec2hrp.c
+++ b/src/mess/drivers/hec2hrp.c
@@ -81,6 +81,7 @@
#include "machine/upd765.h" /* for floppy disc controller */
#include "cpu/z80/z80.h"
#include "formats/hect_dsk.h"
+#include "formats/hector_minidisc.h"
#include "includes/hec2hrp.h"
/*****************************************************************************/
@@ -176,7 +177,8 @@ static ADDRESS_MAP_START( hec2mdhrx_io , AS_IO, 8, hec2hrp_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
// Minidisc commands and changing the rom page !*/
- AM_RANGE(0x000,0x0EF) AM_READWRITE(hector_179x_register_r,hector_179x_register_w)/* 179x registers*/
+ AM_RANGE(0x04, 0x07) AM_DEVREADWRITE("wd179x", fd1793_t, read, write)
+ AM_RANGE(0x08, 0x08) AM_WRITE(minidisc_control_w)
AM_RANGE(0x0f0,0x0ff) AM_READWRITE(hector_io_8255_r, hector_io_8255_w )
ADDRESS_MAP_END
@@ -356,7 +358,6 @@ MACHINE_START_MEMBER(hec2hrp_state,hec2mdhrx)
m_hector_videoram.set_target(m_hector_videoram_hrx,m_hector_videoram.bytes());
hector_init();
- hector_minidisc_init();
}
MACHINE_RESET_MEMBER(hec2hrp_state,hec2hrx)
{
@@ -385,12 +386,14 @@ MACHINE_RESET_MEMBER(hec2hrp_state,hec2mdhrx)
/********* mini disque interface ***************************/
/***********************************************************/
-const floppy_interface minidisc_floppy_interface =
-{
- FLOPPY_STANDARD_3_5_DSDD,
- LEGACY_FLOPPY_OPTIONS_NAME(hector_minidisc),
- NULL
-};
+FLOPPY_FORMATS_MEMBER( hec2hrp_state::minidisc_formats )
+ FLOPPY_HMD_FORMAT
+FLOPPY_FORMATS_END
+
+static SLOT_INTERFACE_START( minidisc_floppies )
+ SLOT_INTERFACE("dd", FLOPPY_35_DD)
+SLOT_INTERFACE_END
+
/******************************************************************************/
static MACHINE_CONFIG_START( hec2hr, hec2hrp_state )
@@ -567,10 +570,9 @@ static MACHINE_CONFIG_START( hec2mdhrx, hec2hrp_state )
MCFG_MACHINE_START_OVERRIDE(hec2hrp_state,hec2mdhrx)
/* Mini Disc */
- MCFG_DEVICE_ADD("wd179x", FD1793, 0)
- MCFG_WD17XX_DEFAULT_DRIVE1_TAGS
+ MCFG_FD1793_ADD("wd179x", XTAL_1MHz)
- MCFG_LEGACY_FLOPPY_DRIVE_ADD(FLOPPY_0, minidisc_floppy_interface)
+ MCFG_FLOPPY_DRIVE_ADD("wd179x:0", minidisc_floppies, "dd", hec2hrp_state::minidisc_formats)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mess/drivers/hh_hmcs40.c b/src/mess/drivers/hh_hmcs40.c
index fce417525f0..b66ebdd2a11 100644
--- a/src/mess/drivers/hh_hmcs40.c
+++ b/src/mess/drivers/hh_hmcs40.c
@@ -55,6 +55,11 @@
*88 HD38820A 1984, Bandai Pair Match (1/2)
*89 HD38820A 1984, Bandai Pair Match (2/2)
+ *75 HD44801A 1982, Alpha 8201 protection MCU (have dump)
+
+ *35 HD44801B 1983, Alpha 8302 protection MCU (have dump)
+ *42 HD44801B 1984, Alpha 8303 protection MCU (have dump)
+
(* denotes not yet emulated by MESS, @ denotes it's in this driver)
@@ -1575,6 +1580,7 @@ INPUT_CHANGED_MEMBER(cgalaxn_state::player_switch)
{
// 2-player switch directly enables plate 14
m_plate = (m_plate & 0x3fff) | (newval ? 0 : 0x4000);
+ prepare_display();
}
diff --git a/src/mess/drivers/hh_melps4.c b/src/mess/drivers/hh_melps4.c
index 737f937b4f8..2fc3291e383 100644
--- a/src/mess/drivers/hh_melps4.c
+++ b/src/mess/drivers/hh_melps4.c
@@ -29,7 +29,7 @@ public:
// devices
required_device<cpu_device> m_maincpu;
- optional_ioport_array<2> m_inp_matrix; // max 2
+ optional_ioport_array<4> m_inp_matrix; // max 4
optional_device<speaker_sound_device> m_speaker;
// misc common
@@ -226,20 +226,95 @@ public:
: hh_melps4_state(mconfig, type, tag)
{ }
+ void prepare_display();
+ DECLARE_WRITE8_MEMBER(plate_w);
+ DECLARE_WRITE16_MEMBER(grid_w);
+ DECLARE_WRITE_LINE_MEMBER(speaker_w);
+ DECLARE_READ16_MEMBER(input_r);
+
+ DECLARE_INPUT_CHANGED_MEMBER(reset_button);
};
// handlers
+void cfrogger_state::prepare_display()
+{
+ UINT16 grid = BITSWAP16(m_grid,15,14,13,12,0,1,2,3,4,5,6,7,8,9,10,11);
+ UINT16 plate = BITSWAP16(m_plate,12,4,13,5,14,6,15,7,3,11,2,10,1,9,0,8);
+ display_matrix(16, 12, plate, grid);
+}
+
+WRITE8_MEMBER(cfrogger_state::plate_w)
+{
+ // Sx,Fx,Gx: vfd matrix plate
+ int mask = (offset == MELPS4_PORTS) ? 0xff : 0xf; // port S is 8-bit
+ int shift = (offset == MELPS4_PORTS) ? 0 : (offset + 1) * 4;
+ m_plate = (m_plate & ~(mask << shift)) | (data << shift);
+ prepare_display();
+
+ // F0,F1: input mux
+ m_inp_mux = m_plate >> 8 & 3;
+}
+
+WRITE16_MEMBER(cfrogger_state::grid_w)
+{
+ // D0-D11: vfd matrix grid
+ m_grid = data;
+ prepare_display();
+}
+
+WRITE_LINE_MEMBER(cfrogger_state::speaker_w)
+{
+ // T: speaker out
+ m_speaker->level_w(state);
+}
+
+READ16_MEMBER(cfrogger_state::input_r)
+{
+ // K0,K1: multiplexed inputs
+ // K2: N/C
+ // K3: fixed input
+ return (m_inp_matrix[2]->read() & 8) | (read_inputs(2) & 3);
+}
+
// config
static INPUT_PORTS_START( cfrogger )
+ PORT_START("IN.0") // F0 port K
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )
+
+ PORT_START("IN.1") // F1 port K
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )
+
+ PORT_START("IN.2") // K3
+ PORT_CONFNAME( 0x08, 0x00, "Skill Level" )
+ PORT_CONFSETTING( 0x00, "1" )
+ PORT_CONFSETTING( 0x08, "2" )
+
+ PORT_START("IN.3") // fake
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START ) PORT_CHANGED_MEMBER(DEVICE_SELF, cfrogger_state, reset_button, NULL)
INPUT_PORTS_END
+INPUT_CHANGED_MEMBER(cfrogger_state::reset_button)
+{
+ // reset button is directly tied to MCU reset pin
+ m_maincpu->set_input_line(INPUT_LINE_RESET, newval ? ASSERT_LINE : CLEAR_LINE);
+}
+
+
static MACHINE_CONFIG_START( cfrogger, cfrogger_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M58846, XTAL_600kHz)
+ MCFG_MELPS4_READ_K_CB(READ16(cfrogger_state, input_r))
+ MCFG_MELPS4_WRITE_S_CB(WRITE8(cfrogger_state, plate_w))
+ MCFG_MELPS4_WRITE_F_CB(WRITE8(cfrogger_state, plate_w))
+ MCFG_MELPS4_WRITE_G_CB(WRITE8(cfrogger_state, plate_w))
+ MCFG_MELPS4_WRITE_D_CB(WRITE16(cfrogger_state, grid_w))
+ MCFG_MELPS4_WRITE_T_CB(WRITELINE(cfrogger_state, speaker_w))
MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_melps4_state, display_decay_tick, attotime::from_msec(1))
MCFG_DEFAULT_LAYOUT(layout_hh_melps4_test)
@@ -270,4 +345,4 @@ ROM_END
/* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY, FULLNAME, FLAGS */
-CONS( 1981, cfrogger, 0, 0, cfrogger, cfrogger, driver_device, 0, "Coleco", "Frogger (Coleco)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK | GAME_NOT_WORKING )
+CONS( 1981, cfrogger, 0, 0, cfrogger, cfrogger, driver_device, 0, "Coleco", "Frogger (Coleco)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK )
diff --git a/src/mess/drivers/hh_sm510.c b/src/mess/drivers/hh_sm510.c
new file mode 100644
index 00000000000..ff7e4b7b9cc
--- /dev/null
+++ b/src/mess/drivers/hh_sm510.c
@@ -0,0 +1,402 @@
+// license:BSD-3-Clause
+// copyright-holders:hap, Sean Riddle
+/***************************************************************************
+
+ Sharp SM510 MCU x..
+
+ TODO:
+ - barnacles
+
+***************************************************************************/
+
+#include "emu.h"
+#include "cpu/sm510/sm510.h"
+#include "sound/speaker.h"
+
+#include "hh_sm510_test.lh" // common test-layout - use external artwork
+
+
+class hh_sm510_state : public driver_device
+{
+public:
+ hh_sm510_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_inp_matrix(*this, "IN"),
+ m_speaker(*this, "speaker"),
+ m_inp_lines(0)
+ { }
+
+ // devices
+ required_device<cpu_device> m_maincpu;
+ optional_ioport_array<5> m_inp_matrix; // max 5
+ optional_device<speaker_sound_device> m_speaker;
+
+ // misc common
+ UINT16 m_inp_mux; // multiplexed inputs mask
+ int m_inp_lines; // number of input mux columns
+ UINT8 m_lcd_output_cache[0x100];
+
+ UINT8 read_inputs(int columns);
+
+ virtual void update_k_line();
+ virtual DECLARE_INPUT_CHANGED_MEMBER(input_changed);
+ virtual DECLARE_READ8_MEMBER(input_r);
+ virtual DECLARE_WRITE8_MEMBER(input_w);
+ virtual DECLARE_WRITE16_MEMBER(lcd_segment_w);
+
+protected:
+ virtual void machine_start();
+ virtual void machine_reset();
+};
+
+
+// machine start/reset
+
+void hh_sm510_state::machine_start()
+{
+ // zerofill
+ m_inp_mux = 0;
+// m_inp_lines = 0;
+ memset(m_lcd_output_cache, ~0, sizeof(m_lcd_output_cache));
+
+ // register for savestates
+ save_item(NAME(m_inp_mux));
+ save_item(NAME(m_inp_lines));
+ /* save_item(NAME(m_lcd_output_cache)); */ // don't save!
+}
+
+void hh_sm510_state::machine_reset()
+{
+}
+
+
+
+/***************************************************************************
+
+ Helper Functions
+
+***************************************************************************/
+
+// lcd panel - on lcd handhelds, usually not a generic x/y screen device
+
+WRITE16_MEMBER(hh_sm510_state::lcd_segment_w)
+{
+ for (int seg = 0; seg < 0x10; seg++)
+ {
+ int state = data >> seg & 1;
+ int index = offset << 4 | seg;
+
+ if (state != m_lcd_output_cache[index])
+ {
+ // output to x.y, where x = row a/b/bs/c*4 + H1-4, y = seg1-16
+ char buf[0x10];
+ sprintf(buf, "%d.%d", offset, seg);
+ output_set_value(buf, state);
+
+ m_lcd_output_cache[index] = state;
+ }
+ }
+}
+
+
+// generic input handlers - usually S output is input mux, and K input for buttons
+
+UINT8 hh_sm510_state::read_inputs(int columns)
+{
+ UINT8 ret = 0;
+
+ // read selected input rows
+ for (int i = 0; i < columns; i++)
+ if (m_inp_mux >> i & 1)
+ ret |= m_inp_matrix[i]->read();
+
+ return ret;
+}
+
+void hh_sm510_state::update_k_line()
+{
+ // this is necessary because the MCU can wake up on K input activity
+ m_maincpu->set_input_line(SM510_INPUT_LINE_K, read_inputs(m_inp_lines) ? ASSERT_LINE : CLEAR_LINE);
+}
+
+INPUT_CHANGED_MEMBER(hh_sm510_state::input_changed)
+{
+ update_k_line();
+}
+
+WRITE8_MEMBER(hh_sm510_state::input_w)
+{
+ m_inp_mux = data;
+ update_k_line();
+}
+
+READ8_MEMBER(hh_sm510_state::input_r)
+{
+ return read_inputs(m_inp_lines);
+}
+
+
+
+/***************************************************************************
+
+ Minidrivers (subclass, I/O, Inputs, Machine Config)
+
+***************************************************************************/
+
+/***************************************************************************
+
+ Konami Top Gun
+ * PCB label BH003
+ * Sharp SM510 under epoxy (die label CMS54C, KMS598)
+
+ The ROM listing "BH003 Top Gun" from patent US5137277 is identical to the
+ released version, except for 2 probable bit errors and filler bytes. Unused
+ pages list data too, of what looks like assembler leftover garbage.
+
+***************************************************************************/
+
+class ktopgun_state : public hh_sm510_state
+{
+public:
+ ktopgun_state(const machine_config &mconfig, device_type type, const char *tag)
+ : hh_sm510_state(mconfig, type, tag)
+ {
+ m_inp_lines = 3;
+ }
+
+ DECLARE_WRITE8_MEMBER(speaker_w);
+};
+
+// handlers
+
+WRITE8_MEMBER(ktopgun_state::speaker_w)
+{
+ m_speaker->level_w(data >> 0 & 1);
+}
+
+
+// config
+
+static INPUT_PORTS_START( ktopgun )
+ PORT_START("IN.0")
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_sm510_state, input_changed, NULL)
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_sm510_state, input_changed, NULL)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_sm510_state, input_changed, NULL)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_sm510_state, input_changed, NULL)
+
+ PORT_START("IN.1")
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_sm510_state, input_changed, NULL) // sel
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_sm510_state, input_changed, NULL) // sound on/off
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_sm510_state, input_changed, NULL) // off
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_sm510_state, input_changed, NULL) // fire
+
+ PORT_START("IN.2")
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_sm510_state, input_changed, NULL) // on
+ PORT_BIT( 0x0e, IP_ACTIVE_HIGH, IPT_UNUSED )
+INPUT_PORTS_END
+
+static MACHINE_CONFIG_START( ktopgun, ktopgun_state )
+
+ /* basic machine hardware */
+ MCFG_CPU_ADD("maincpu", SM510, XTAL_32_768kHz)
+ MCFG_SM510_WRITE_SEGA_CB(WRITE16(hh_sm510_state, lcd_segment_w))
+ MCFG_SM510_WRITE_SEGB_CB(WRITE16(hh_sm510_state, lcd_segment_w))
+ MCFG_SM510_WRITE_SEGBS_CB(WRITE16(hh_sm510_state, lcd_segment_w))
+ MCFG_SM510_READ_K_CB(READ8(hh_sm510_state, input_r))
+ MCFG_SM510_WRITE_S_CB(WRITE8(hh_sm510_state, input_w))
+ MCFG_SM510_WRITE_R_CB(WRITE8(ktopgun_state, speaker_w))
+
+ MCFG_DEFAULT_LAYOUT(layout_hh_sm510_test)
+
+ /* no video! */
+
+ /* sound hardware */
+ MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+MACHINE_CONFIG_END
+
+
+
+
+
+/***************************************************************************
+
+ Konami Teenage Mutant Ninja Turtles
+ * Sharp SM511 under epoxy (die label KMS 73B, KMS 774)
+
+ The ROM listing "BH005 TMNT" from patent US5150899 is identical to the
+ released version, excluding filler bytes.
+
+***************************************************************************/
+
+class ktmnt_state : public hh_sm510_state
+{
+public:
+ ktmnt_state(const machine_config &mconfig, device_type type, const char *tag)
+ : hh_sm510_state(mconfig, type, tag)
+ {
+ m_inp_lines = 3;
+ }
+
+ DECLARE_WRITE8_MEMBER(speaker_w);
+};
+
+// handlers
+
+WRITE8_MEMBER(ktmnt_state::speaker_w)
+{
+ m_speaker->level_w(data >> 0 & 1);
+}
+
+
+// config
+
+static INPUT_PORTS_START( ktmnt )
+ PORT_START("IN.0")
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_sm510_state, input_changed, NULL)
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_sm510_state, input_changed, NULL)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_sm510_state, input_changed, NULL)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_sm510_state, input_changed, NULL)
+
+ PORT_START("IN.1")
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_sm510_state, input_changed, NULL) // game select
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_sm510_state, input_changed, NULL) // sound on/off
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_sm510_state, input_changed, NULL) // off
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_sm510_state, input_changed, NULL) // on/start
+
+ PORT_START("IN.2")
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_sm510_state, input_changed, NULL)
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_sm510_state, input_changed, NULL)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_sm510_state, input_changed, NULL)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON8 ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_sm510_state, input_changed, NULL)
+INPUT_PORTS_END
+
+static MACHINE_CONFIG_START( ktmnt, ktmnt_state )
+
+ /* basic machine hardware */
+ MCFG_CPU_ADD("maincpu", SM511, XTAL_32_768kHz)
+ MCFG_SM510_WRITE_SEGA_CB(WRITE16(hh_sm510_state, lcd_segment_w))
+ MCFG_SM510_WRITE_SEGB_CB(WRITE16(hh_sm510_state, lcd_segment_w))
+ MCFG_SM510_WRITE_SEGBS_CB(WRITE16(hh_sm510_state, lcd_segment_w))
+ MCFG_SM510_READ_K_CB(READ8(hh_sm510_state, input_r))
+ MCFG_SM510_WRITE_S_CB(WRITE8(hh_sm510_state, input_w))
+ MCFG_SM510_WRITE_R_CB(WRITE8(ktmnt_state, speaker_w))
+
+ MCFG_DEFAULT_LAYOUT(layout_hh_sm510_test)
+
+ /* no video! */
+
+ /* sound hardware */
+ MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+MACHINE_CONFIG_END
+
+
+
+
+
+/***************************************************************************
+
+ Nintendo Game & Watch: Mickey & Donald (model DM-53)
+ * PCB label DM-53
+ * Sharp SM510 label DM-53 (die label CMS54C, CMS565)
+
+***************************************************************************/
+
+class gnwmndon_state : public hh_sm510_state
+{
+public:
+ gnwmndon_state(const machine_config &mconfig, device_type type, const char *tag)
+ : hh_sm510_state(mconfig, type, tag)
+ {
+ m_inp_lines = 2;
+ }
+
+ DECLARE_WRITE8_MEMBER(speaker_w);
+};
+
+// handlers
+
+WRITE8_MEMBER(gnwmndon_state::speaker_w)
+{
+ m_speaker->level_w(data >> 1 & 1);
+}
+
+
+// config
+
+static INPUT_PORTS_START( gnwmndon )
+ PORT_START("IN.0")
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_CHANGED_MEMBER(DEVICE_SELF, hh_sm510_state, input_changed, NULL)
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY PORT_CHANGED_MEMBER(DEVICE_SELF, hh_sm510_state, input_changed, NULL)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_CHANGED_MEMBER(DEVICE_SELF, hh_sm510_state, input_changed, NULL)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_CHANGED_MEMBER(DEVICE_SELF, hh_sm510_state, input_changed, NULL)
+
+ PORT_START("IN.1")
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_sm510_state, input_changed, NULL) // time
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_sm510_state, input_changed, NULL) // b
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_sm510_state, input_changed, NULL) // a
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_sm510_state, input_changed, NULL) // alarm
+INPUT_PORTS_END
+
+static MACHINE_CONFIG_START( gnwmndon, gnwmndon_state )
+
+ /* basic machine hardware */
+ MCFG_CPU_ADD("maincpu", SM510, XTAL_32_768kHz)
+ MCFG_SM510_WRITE_SEGA_CB(WRITE16(hh_sm510_state, lcd_segment_w))
+ MCFG_SM510_WRITE_SEGB_CB(WRITE16(hh_sm510_state, lcd_segment_w))
+ MCFG_SM510_WRITE_SEGBS_CB(WRITE16(hh_sm510_state, lcd_segment_w))
+ MCFG_SM510_READ_K_CB(READ8(hh_sm510_state, input_r))
+ MCFG_SM510_WRITE_S_CB(WRITE8(hh_sm510_state, input_w))
+ MCFG_SM510_WRITE_R_CB(WRITE8(gnwmndon_state, speaker_w))
+
+ MCFG_DEFAULT_LAYOUT(layout_hh_sm510_test)
+
+ /* no video! */
+
+ /* sound hardware */
+ MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
+MACHINE_CONFIG_END
+
+
+
+
+
+/***************************************************************************
+
+ Game driver(s)
+
+***************************************************************************/
+
+ROM_START( ktopgun )
+ ROM_REGION( 0x1000, "maincpu", 0 )
+ ROM_LOAD( "cms54c_kms598", 0x0000, 0x1000, CRC(50870b35) SHA1(cda1260c2e1c180995eced04b7d7ff51616dcef5) )
+ROM_END
+
+
+ROM_START( ktmnt )
+ ROM_REGION( 0x1000, "maincpu", 0 )
+ ROM_LOAD( "kms_73b_774.prog", 0x0000, 0x1000, CRC(a1064f87) SHA1(92156c35fbbb414007ee6804fe635128a741d5f1) )
+
+ ROM_REGION( 0x100, "maincpu:music", 0 )
+ ROM_LOAD( "kms_73b_774.music", 0x000, 0x100, CRC(8270d626) SHA1(bd91ca1d5cd7e2a62eef05c0033b19dcdbe441ca) )
+ROM_END
+
+
+ROM_START( gnwmndon )
+ ROM_REGION( 0x1000, "maincpu", 0 )
+ ROM_LOAD( "dm53_cms54c_565", 0x0000, 0x1000, CRC(e21fc0f5) SHA1(3b65ccf9f98813319410414e11a3231b787cdee6) )
+ROM_END
+
+
+
+/* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY, FULLNAME, FLAGS */
+CONS( 1989, ktopgun, 0, 0, ktopgun, ktopgun, driver_device, 0, "Konami", "Top Gun (Konami)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK | GAME_NOT_WORKING )
+CONS( 1989, ktmnt, 0, 0, ktmnt, ktmnt, driver_device, 0, "Konami", "Teenage Mutant Ninja Turtles (Konami)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK | GAME_NOT_WORKING )
+
+CONS( 1982, gnwmndon, 0, 0, gnwmndon, gnwmndon, driver_device, 0, "Nintendo", "Game & Watch: Mickey & Donald", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK | GAME_NOT_WORKING )
diff --git a/src/mess/drivers/hh_tms1k.c b/src/mess/drivers/hh_tms1k.c
index d0eaa7b6ced..7474cff3ebe 100644
--- a/src/mess/drivers/hh_tms1k.c
+++ b/src/mess/drivers/hh_tms1k.c
@@ -24,6 +24,7 @@
@MP1221 TMS1100 1980, Entex Raise The Devil
*MP1296 TMS1100? 1982, Entex Black Knight
*MP1312 TMS1100 198?, Tandy/RadioShack Science Fair Microcomputer Trainer
+ *MP1359 TMS1100? 1985, Capsela CRC2000
@MP1525 TMS1170 1980, Coleco Head to Head Baseball
*MP1604 ? 1981, Hanzawa Twinvader III/Tandy Cosmic Fire Away 3000 (? note: VFD-capable)
@MP2105 TMS1370 1979, Gakken Poker
@@ -87,6 +88,7 @@
brighter: tc4/h2hfootb(offense), bankshot(cue ball), ...
- add softwarelist for tc4 cartridges?
- stopthiep: unable to start a game (may be intentional?)
+ - tbreakup: some of the leds flicker (rom and PLAs doublechecked)
***************************************************************************/
@@ -104,6 +106,9 @@
#include "ebball.lh"
#include "ebball2.lh"
#include "ebball3.lh"
+#include "ebaskb2.lh"
+#include "efootb4.lh"
+#include "einvader.lh" // test-layout(but still playable)
#include "elecdet.lh"
#include "gjackpot.lh"
#include "gpoker.lh"
@@ -118,11 +123,9 @@
#include "starwbc.lh"
#include "stopthie.lh"
#include "tandy12.lh" // clickable
-//#include "tbreakup.lh"
+#include "tbreakup.lh"
#include "tc4.lh"
-#include "einvader.lh" // test-layout(but still playable)
-
#include "hh_tms1k_test.lh" // common test-layout - use external artwork
@@ -1622,7 +1625,7 @@ MACHINE_CONFIG_END
Entex Color Football 4
* TMS1670 6009 MP7551 (die also labeled MP7551)
- * * 9-digit cyan VFD display, 60 red and green LEDs behind bezel, 1bit sound
+ * 9-digit cyan VFD display, 60 red and green LEDs behind bezel, 1bit sound
***************************************************************************/
@@ -1680,16 +1683,16 @@ READ8_MEMBER(efootb4_state::read_k)
static INPUT_PORTS_START( efootb4 )
PORT_START("IN.0") // R0
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_16WAY
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_16WAY
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_16WAY
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_16WAY
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_16WAY // 1
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_16WAY // 2
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_16WAY // 3
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_16WAY // 4
PORT_START("IN.1") // R1
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL PORT_16WAY
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_COCKTAIL PORT_16WAY
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL PORT_16WAY
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_COCKTAIL PORT_16WAY
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL PORT_16WAY // 1
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_COCKTAIL PORT_16WAY // 2
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL PORT_16WAY // 3
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_COCKTAIL PORT_16WAY // 4
PORT_START("IN.2") // R2
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P1 Run")
@@ -1723,8 +1726,7 @@ static MACHINE_CONFIG_START( efootb4, efootb4_state )
MCFG_TMS1XXX_WRITE_O_CB(WRITE16(efootb4_state, write_o))
MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_tms1k_state, display_decay_tick, attotime::from_msec(1))
-// MCFG_DEFAULT_LAYOUT(layout_efootb4)
- MCFG_DEFAULT_LAYOUT(layout_hh_tms1k_test)
+ MCFG_DEFAULT_LAYOUT(layout_efootb4)
/* no video! */
@@ -1744,6 +1746,18 @@ MACHINE_CONFIG_END
* TMS1100 6010 MP1218 (die also labeled MP1218)
* 4 7seg LEDs, and other LEDs behind bezel, 1bit sound
+ lamp translation table: led zz from game PCB = MESS lampyx:
+
+ 11 = lamp90 21 = lamp91 31 = lamp92 41 = lamp93 51 = lamp95
+ 12 = lamp80 22 = lamp81 32 = lamp82 42 = lamp83 52 = lamp85
+ 13 = lamp70 23 = lamp71 33 = lamp72 43 = lamp73 53 = lamp84
+ 14 = lamp60 24 = lamp61 34 = lamp62 44 = lamp63 54 = lamp75
+ 15 = lamp50 25 = lamp51 35 = lamp52 45 = lamp53 55 = lamp74
+ 16 = lamp40 26 = lamp41 36 = lamp42 46 = lamp43 56 = lamp65
+
+ A = lamp94
+ B = lamp64
+
***************************************************************************/
class ebaskb2_state : public hh_tms1k_state
@@ -1837,8 +1851,7 @@ static MACHINE_CONFIG_START( ebaskb2, ebaskb2_state )
MCFG_TMS1XXX_WRITE_O_CB(WRITE16(ebaskb2_state, write_o))
MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_tms1k_state, display_decay_tick, attotime::from_msec(1))
-// MCFG_DEFAULT_LAYOUT(layout_ebaskb2)
- MCFG_DEFAULT_LAYOUT(layout_hh_tms1k_test)
+ MCFG_DEFAULT_LAYOUT(layout_ebaskb2)
/* no video! */
@@ -4006,23 +4019,23 @@ MACHINE_CONFIG_END
lamp translation table: led zz from game PCB = MESS lampyx:
- 00 = - 10 = lamp25 20 = lamp44
- 01 = lamp27 11 = lamp35 21 = lamp53
- 02 = lamp37 12 = lamp45 22 = lamp42
- 03 = lamp47 13 = lamp55
- 04 = lamp57 14 = lamp54
- 05 = lamp26 15 = lamp33
- 06 = lamp36 16 = lamp43
- 07 = lamp46 17 = lamp23
- 08 = lamp56 18 = lamp34
- 09 = lamp24 19 = lamp32
+ 00 = - 10 = lamp50 20 = lamp42
+ 01 = lamp70 11 = lamp51 21 = lamp33
+ 02 = lamp71 12 = lamp52 22 = lamp22
+ 03 = lamp72 13 = lamp53
+ 04 = lamp73 14 = lamp43
+ 05 = lamp60 15 = lamp31
+ 06 = lamp61 16 = lamp32
+ 07 = lamp62 17 = lamp30
+ 08 = lamp63 18 = lamp41
+ 09 = lamp40 19 = lamp21
the 7seg panel is lamp0x and lamp1x(aka digit0/1), and the
8(2*4) * 3 rectangular leds panel, where x=0,1,2,3:
- lamp7x lamp6x
- lamp9x lamp8x
- lamp11x lamp10x
+ lamp9x lamp11x
+ lamp8x lamp13x
+ lamp10x lamp12x
***************************************************************************/
@@ -4061,16 +4074,16 @@ void tbreakup_state::prepare_display()
m_display_segmask[y] = 0x7f;
m_display_state[y] = (m_r >> y & 1) ? (m_o & 0x7f) : 0;
}
-
- // 22 round leds from expander port 7 and O2-O7
- for (int y = 0; y < 4; y++)
- m_display_state[y+2] = (m_exp_port[6] >> y & 1) ? (m_o & 0xfc) : 0;
+
+ // 22 round leds from O2-O7 and expander port 7
+ for (int y = 2; y < 8; y++)
+ m_display_state[y] = (m_o >> y & 1) ? m_exp_port[6] : 0;
// 24 rectangular leds from expander ports 1-6 (not strobed)
for (int y = 0; y < 6; y++)
- m_display_state[y+6] = m_exp_port[y];
-
- set_display_size(8, 12);
+ m_display_state[y+8] = m_exp_port[y];
+
+ set_display_size(8, 14);
display_update();
}
@@ -4078,7 +4091,6 @@ WRITE8_MEMBER(tbreakup_state::expander_w)
{
// TMS1025 port 1-7 data
m_exp_port[offset] = data;
- prepare_display();
}
WRITE16_MEMBER(tbreakup_state::write_r)
@@ -4088,7 +4100,7 @@ WRITE16_MEMBER(tbreakup_state::write_r)
// R7,R8: input mux
m_inp_mux = data >> 7 & 3;
-
+
// R3-R5: TMS1025 port S
// R2: TMS1025 STD pin
m_expander->write_s(space, 0, data >> 3 & 7);
@@ -4103,7 +4115,7 @@ WRITE16_MEMBER(tbreakup_state::write_o)
{
// O0-O3: TMS1025 port H
m_expander->write_h(space, 0, data & 0xf);
-
+
// O0-O7: led state
m_o = data;
prepare_display();
@@ -4146,7 +4158,7 @@ INPUT_CHANGED_MEMBER(tbreakup_state::skill_switch)
void tbreakup_state::set_clock()
{
// MCU clock is from an analog circuit with resistor of 73K, PRO2 adds 100K
- m_maincpu->set_unscaled_clock((m_inp_matrix[3]->read() & 1) ? 400000 : 350000);
+ m_maincpu->set_unscaled_clock((m_inp_matrix[3]->read() & 1) ? 500000 : 325000);
}
void tbreakup_state::machine_reset()
@@ -4167,11 +4179,11 @@ void tbreakup_state::machine_start()
static MACHINE_CONFIG_START( tbreakup, tbreakup_state )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", TMS1040, 400000) // see set_clock
+ MCFG_CPU_ADD("maincpu", TMS1040, 325000) // see set_clock
MCFG_TMS1XXX_READ_K_CB(READ8(tbreakup_state, read_k))
MCFG_TMS1XXX_WRITE_R_CB(WRITE16(tbreakup_state, write_r))
MCFG_TMS1XXX_WRITE_O_CB(WRITE16(tbreakup_state, write_o))
-
+
MCFG_DEVICE_ADD("expander", TMS1025, 0)
MCFG_TMS1024_WRITE_PORT_CB(1, WRITE8(tbreakup_state, expander_w))
MCFG_TMS1024_WRITE_PORT_CB(2, WRITE8(tbreakup_state, expander_w))
@@ -4182,8 +4194,7 @@ static MACHINE_CONFIG_START( tbreakup, tbreakup_state )
MCFG_TMS1024_WRITE_PORT_CB(7, WRITE8(tbreakup_state, expander_w))
MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_tms1k_state, display_decay_tick, attotime::from_msec(1))
-// MCFG_DEFAULT_LAYOUT(layout_tbreakup)
- MCFG_DEFAULT_LAYOUT(layout_hh_tms1k_test)
+ MCFG_DEFAULT_LAYOUT(layout_tbreakup)
/* no video! */
@@ -4307,7 +4318,7 @@ ROM_START( efootb4 )
ROM_LOAD( "6009_mp7551", 0x0000, 0x1000, CRC(54fa7244) SHA1(4d16bd825c4a2db76ca8a263c373ade15c20e270) )
ROM_REGION( 867, "maincpu:mpla", 0 )
- ROM_LOAD( "tms1400_common2_micro.pla", 0, 867, CRC(7cc90264) SHA1(c6e1cf1ffb178061da9e31858514f7cd94e86990) )
+ ROM_LOAD( "tms1100_common2_micro.pla", 0, 867, CRC(7cc90264) SHA1(c6e1cf1ffb178061da9e31858514f7cd94e86990) )
ROM_REGION( 557, "maincpu:opla", 0 )
ROM_LOAD( "tms1400_efootb4_output.pla", 0, 557, CRC(5c87c753) SHA1(bde9d4aa1e57a718affd969475c0a1edcf60f444) )
ROM_END
@@ -4351,7 +4362,7 @@ ROM_START( gjackpot )
ROM_LOAD( "mpf553", 0x0000, 0x1000, CRC(f45fd008) SHA1(8d5d6407a8a031a833ceedfb931f5c9d2725ecd0) )
ROM_REGION( 867, "maincpu:mpla", 0 )
- ROM_LOAD( "tms1400_common2_micro.pla", 0, 867, CRC(7cc90264) SHA1(c6e1cf1ffb178061da9e31858514f7cd94e86990) )
+ ROM_LOAD( "tms1100_common2_micro.pla", 0, 867, CRC(7cc90264) SHA1(c6e1cf1ffb178061da9e31858514f7cd94e86990) )
ROM_REGION( 557, "maincpu:opla", 0 )
ROM_LOAD( "tms1400_gjackpot_output.pla", 0, 557, CRC(50e471a7) SHA1(9d862cb9f51a563882b62662c5bfe61b52e3df00) )
ROM_END
@@ -4398,7 +4409,7 @@ ROM_START( astro )
ROM_LOAD( "mp1133", 0x0000, 0x1000, CRC(bc21109c) SHA1(05a433cce587d5c0c2d28b5fda5f0853ea6726bf) )
ROM_REGION( 867, "maincpu:mpla", 0 )
- ROM_LOAD( "tms1400_common2_micro.pla", 0, 867, CRC(7cc90264) SHA1(c6e1cf1ffb178061da9e31858514f7cd94e86990) )
+ ROM_LOAD( "tms1100_common2_micro.pla", 0, 867, CRC(7cc90264) SHA1(c6e1cf1ffb178061da9e31858514f7cd94e86990) )
ROM_REGION( 557, "maincpu:opla", 0 )
ROM_LOAD( "tms1400_astro_output.pla", 0, 557, CRC(eb08957e) SHA1(62ae0d13a1eaafb34f1b27d7df51441b400ccd56) )
ROM_END
@@ -4575,8 +4586,8 @@ CONS( 1979, ebball, 0, 0, ebball, ebball, driver_device, 0, "Ent
CONS( 1979, ebball2, 0, 0, ebball2, ebball2, driver_device, 0, "Entex", "Electronic Baseball 2 (Entex)", GAME_SUPPORTS_SAVE )
CONS( 1980, ebball3, 0, 0, ebball3, ebball3, driver_device, 0, "Entex", "Electronic Baseball 3 (Entex)", GAME_SUPPORTS_SAVE )
CONS( 1980, einvader, 0, 0, einvader, einvader, driver_device, 0, "Entex", "Space Invader (Entex, TMS1100)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK )
-CONS( 1980, efootb4 , 0, 0, efootb4, efootb4, driver_device, 0, "Entex", "Color Football 4 (Entex)", GAME_SUPPORTS_SAVE | GAME_NOT_WORKING )
-CONS( 1980, ebaskb2 , 0, 0, ebaskb2, ebaskb2, driver_device, 0, "Entex", "Electronic Basketball 2 (Entex)", GAME_SUPPORTS_SAVE | GAME_NOT_WORKING )
+CONS( 1980, efootb4 , 0, 0, efootb4, efootb4, driver_device, 0, "Entex", "Color Football 4 (Entex)", GAME_SUPPORTS_SAVE )
+CONS( 1980, ebaskb2 , 0, 0, ebaskb2, ebaskb2, driver_device, 0, "Entex", "Electronic Basketball 2 (Entex)", GAME_SUPPORTS_SAVE )
CONS( 1980, raisedvl, 0, 0, raisedvl, raisedvl, driver_device, 0, "Entex", "Raise The Devil", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK )
CONS( 1979, gpoker, 0, 0, gpoker, gpoker, driver_device, 0, "Gakken", "Poker (Gakken, 1979 version)", GAME_SUPPORTS_SAVE )
@@ -4585,7 +4596,7 @@ CONS( 1980, gjackpot, 0, 0, gjackpot, gjackpot, driver_device, 0, "Gak
CONS( 1979, elecdet, 0, 0, elecdet, elecdet, driver_device, 0, "Ideal", "Electronic Detective", GAME_SUPPORTS_SAVE ) // ***
CONS( 1979, starwbc, 0, 0, starwbc, starwbc, driver_device, 0, "Kenner", "Star Wars - Electronic Battle Command", GAME_SUPPORTS_SAVE )
-CONS( 1979, starwbcp, starwbc, 0, starwbc, starwbc, driver_device, 0, "Kenner", "Star Wars - Electronic Battle Command (prototype)", GAME_SUPPORTS_SAVE )
+CONS( 1979, starwbcp, starwbc, 0, starwbc, starwbc, driver_device, 0, "Kenner", "Star Wars - Electronic Battle Command (patent)", GAME_SUPPORTS_SAVE )
COMP( 1979, astro, 0, 0, astro, astro, driver_device, 0, "Kosmos", "Astro", GAME_SUPPORTS_SAVE | GAME_NO_SOUND_HW )
@@ -4597,14 +4608,14 @@ CONS( 1979, bigtrak, 0, 0, bigtrak, bigtrak, driver_device, 0, "Mil
CONS( 1977, cnsector, 0, 0, cnsector, cnsector, driver_device, 0, "Parker Brothers", "Code Name: Sector", GAME_SUPPORTS_SAVE | GAME_NO_SOUND_HW ) // ***
CONS( 1978, merlin, 0, 0, merlin, merlin, driver_device, 0, "Parker Brothers", "Merlin - The Electronic Wizard", GAME_SUPPORTS_SAVE )
CONS( 1979, stopthie, 0, 0, stopthief, stopthief, driver_device, 0, "Parker Brothers", "Stop Thief (Electronic Crime Scanner)", GAME_SUPPORTS_SAVE ) // ***
-CONS( 1979, stopthiep, stopthie, 0, stopthief, stopthief, driver_device, 0, "Parker Brothers", "Stop Thief (Electronic Crime Scanner) (prototype)", GAME_SUPPORTS_SAVE | GAME_NOT_WORKING )
+CONS( 1979, stopthiep, stopthie, 0, stopthief, stopthief, driver_device, 0, "Parker Brothers", "Stop Thief (Electronic Crime Scanner) (patent)", GAME_SUPPORTS_SAVE | GAME_NOT_WORKING )
CONS( 1980, bankshot, 0, 0, bankshot, bankshot, driver_device, 0, "Parker Brothers", "Bank Shot - Electronic Pool", GAME_SUPPORTS_SAVE )
CONS( 1980, splitsec, 0, 0, splitsec, splitsec, driver_device, 0, "Parker Brothers", "Split Second", GAME_SUPPORTS_SAVE )
CONS( 1982, mmerlin, 0, 0, mmerlin, mmerlin, driver_device, 0, "Parker Brothers", "Master Merlin", GAME_SUPPORTS_SAVE )
CONS( 1981, tandy12, 0, 0, tandy12, tandy12, driver_device, 0, "Tandy Radio Shack", "Tandy-12: Computerized Arcade", GAME_SUPPORTS_SAVE ) // some of the minigames: ***
-CONS( 1979, tbreakup, 0, 0, tbreakup, tbreakup, driver_device, 0, "Tomy", "Break Up (Tomy)", GAME_SUPPORTS_SAVE | GAME_NOT_WORKING )
+CONS( 1979, tbreakup, 0, 0, tbreakup, tbreakup, driver_device, 0, "Tomy", "Break Up (Tomy)", GAME_SUPPORTS_SAVE )
// ***: As far as MESS is concerned, the game is emulated fine. But for it to be playable, it requires interaction
// with other, unemulatable, things eg. game board/pieces, playing cards, pen & paper, etc.
diff --git a/src/mess/drivers/hh_ucom4.c b/src/mess/drivers/hh_ucom4.c
index d0ef6b1e105..f2bbe1685f3 100644
--- a/src/mess/drivers/hh_ucom4.c
+++ b/src/mess/drivers/hh_ucom4.c
@@ -47,16 +47,14 @@
*060 uPD650C 1979, Mattel Computer Gin
*085 uPD650C 1980, Roland TR-808
*127 uPD650C 198?, Sony OA-S1100 Typecorder (subcpu, have dump)
- *128 uPD650C 1982, Roland TR-606
+ *128 uPD650C 1981, Roland TR-606
133 uPD650C 1982, Roland TB-303 -> tb303.c
(* denotes not yet emulated by MESS, @ denotes it's in this driver)
***************************************************************************/
-#include "emu.h"
-#include "cpu/ucom4/ucom4.h"
-#include "sound/speaker.h"
+#include "includes/hh_ucom4.h"
// internal artwork
#include "efball.lh"
@@ -65,54 +63,6 @@
#include "hh_ucom4_test.lh" // common test-layout - use external artwork
-class hh_ucom4_state : public driver_device
-{
-public:
- hh_ucom4_state(const machine_config &mconfig, device_type type, const char *tag)
- : driver_device(mconfig, type, tag),
- m_maincpu(*this, "maincpu"),
- m_inp_matrix(*this, "IN"),
- m_speaker(*this, "speaker"),
- m_display_wait(33),
- m_display_maxy(1),
- m_display_maxx(0)
- { }
-
- // devices
- required_device<cpu_device> m_maincpu;
- optional_ioport_array<5> m_inp_matrix; // max 5
- optional_device<speaker_sound_device> m_speaker;
-
- // misc common
- UINT8 m_port[9]; // MCU port A-I write data (optional)
- UINT16 m_inp_mux; // multiplexed inputs mask
-
- UINT8 read_inputs(int columns);
-
- // display common
- int m_display_wait; // led/lamp off-delay in microseconds (default 33ms)
- int m_display_maxy; // display matrix number of rows
- int m_display_maxx; // display matrix number of columns (max 31 for now)
-
- UINT32 m_grid; // VFD current row data
- UINT32 m_plate; // VFD current column data
-
- UINT32 m_display_state[0x20]; // display matrix rows data (last bit is used for always-on)
- UINT16 m_display_segmask[0x20]; // if not 0, display matrix row is a digit, mask indicates connected segments
- UINT32 m_display_cache[0x20]; // (internal use)
- UINT8 m_display_decay[0x20][0x20]; // (internal use)
-
- TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick);
- void display_update();
- void set_display_size(int maxx, int maxy);
- void display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety);
-
-protected:
- virtual void machine_start();
- virtual void machine_reset();
-};
-
-
// machine start/reset
void hh_ucom4_state::machine_start()
diff --git a/src/mess/drivers/hp64k.c b/src/mess/drivers/hp64k.c
new file mode 100644
index 00000000000..7bf0107a597
--- /dev/null
+++ b/src/mess/drivers/hp64k.c
@@ -0,0 +1,1212 @@
+// license:BSD-3-Clause
+// copyright-holders:F. Ulivi
+//
+// ***************************************
+// Driver for HP 64000 development system
+// ***************************************
+//
+// Documentation used for this driver:
+// [1] HP, manual 64100-90910, dec 83 rev. - Model 64100A mainframe service manual
+// [2] HP, manual 64941-90902, apr 83 rev. - Model 64941A Flexible disc (Floppy) drive
+// controller service manual
+//
+// A 64100A system ("mainframe" in HP docs) is built around a 13 slot card cage.
+// The first 4 slots are reserved for specific card types:
+// J1 I/O card
+// J2 Display and RAM card
+// J3 CPU card
+// J4 Floppy interface card
+//
+// The rest of the slots are for CPU emulators, logic analyzers and so on (i.e. those
+// cards doing the main functions of a development system).
+// This driver emulates the first 4 cards only.
+//
+// All cards are interconnected by 2 separate buses originating from the CPU:
+// memory (16-bit data & 16-bit addresses) and I/O (16-bit data and 6-bit addresses) buses.
+// The addresses on I/O bus are split in a 4-bit PA (peripheral address) and a 2-bit IC
+// (register address). See also HP_MAKE_IOADDR.
+// For the address mapping on the memory bus see [1] pg 229.
+// Reading the schematics is complicated by the fact that all data & address
+// lines of the buses are inverted.
+//
+// A brief description of each emulated card follows.
+//
+// **********
+// CPU card (64100-66521 or 64100-66532)
+//
+// This board holds the HP custom CPU with its massive heatsink, the BIOS roms and little else.
+// U30 5061-3011 HP "hybrid" CPU @ 6.25 MHz
+// U8
+// U9
+// U10
+// U11
+// U18
+// U19
+// U20
+// U21 2732 16kw of BIOS EPROMs
+//
+// **********
+// I/O card (64100-66520)
+//
+// This board has most of the I/O circuits of the system.
+// It interfaces:
+// - Keyboard
+// - RS232 line
+// - IEEE-488/HP-IB bus
+// - Miscellaneous peripherals (watchdog, beeper, interrupt registers, option DIP switches)
+//
+// Emulation of beeper sound is far from correct: it should be a 2500 Hz tone inside an
+// exponentially decaying envelope (a bell sound) whereas in the emulation it's inside a
+// simple rectangular envelope.
+//
+//*U20 HP "PHI" Custom HP-IB interface microcontroller
+//*U28 i8251 RS232 UART
+//
+// **********
+// Display card (64100-66530)
+//
+// This card has the main DRAM of the system (64 kw) and the CRT controller that generates
+// the video image.
+// The framebuffer is stored in the main DRAM starting at a fixed location (0xf9f0) and it is
+// fed into the CRTC by a lot of discrete TTL ICs. The transfer of framebuffer from DRAM to
+// CRTC is designed to refresh the whole DRAM in parallel. For some mysterious reason the first
+// display row is always blanked (its 40 words of RAM are even used for the stack!).
+//
+// U33 i8275 CRT controller
+// U60 2716 Character generator ROM
+// U23-U30
+// U38-U45 HM4864 64 kw of DRAM
+//
+// **********
+// Floppy I/F card (64941-66501)
+//
+// This card is optional. It interfaces 2 5.25" double-side double-density floppy drives.
+// The interfacing between the 16-bit CPU and the 8-bit FDC (WD1791) is quite complex. It is
+// based around a FSM that sequences the access of DMA or CPU to FDC. This FSM is implemented
+// by 2 small PROMs for which no dump (AFAIK) is available.
+// I tried to reverse engineer the FSM by looking at the schematics and applying some sensible
+// assumptions. Then I did a sort of "clean room" re-implementation. It appears to work correctly.
+//
+// U4 FD1791A Floppy disk controller
+//
+// A brief summary of the reverse-engineered interface of this card follows.
+//
+// IC Content
+// ==========
+// 0 DMA transfers, all words in a block but the last one
+// 1 Floppy I/F register, detailed below
+// 2 DMA transfers, last word in a block
+// 3 Diagnostic registers (not emulated)
+//
+// Floppy I/F register has 2 formats, one for writing and one for reading.
+// Reading this register should always be preceded by a write that starts
+// the read operation (bit 11 = 0: see below).
+//
+// Floppy I/F register format when writing:
+// Bit Content
+// ===========
+// 15 Clear interrupts (1)
+// 14 Direction of DMA transfers (1 = write to FDC, 0 = read from FDC)
+// 13 DMA enable (1)
+// 12 Reset FDC (1)
+// 11 Direction of access to FDC/drive control (1 = write, 0 = read)
+// 10 Access to either FDC (1) or drive control (0): this selects the
+// content of lower byte (both when writing and reading)
+// 9 ~A1 signal of FDC
+// 8 ~A0 signal of FDC
+//
+// 7-0 FDC data (when bit 10 = 1)
+// 7-0 Drive control (when bit 10 = 0)
+//
+// Floppy I/F register format when reading:
+// Bit Content
+// ===========
+// 15 Interrupt from FDC pending (1)
+// 14 Interrupt from DMA pending (1)
+// 13 Drive 1 media changed (1)
+// 12 Drive 1 write protected (1)
+// 11 Drive 1 ready (0)
+// 10 Drive 0 media changed (1)
+// 9 Drive 0 write protected (1)
+// 8 Drive 0 ready (0)
+//
+// 7-0 FDC data (when bit 10 = 1)
+// 7-0 Drive control (when bit 10 = 0)
+//
+// Drive control register
+// Bit Content
+// ===========
+// 7 Floppy side selection
+// 6 N/U
+// 5 Reset drive 1 media change (1)
+// 4 Enable drive 1 motor (0)
+// 3 Enable drive 1 (0)
+// 2 Reset drive 0 media change (1)
+// 1 Enable drive 0 motor (0)
+// 0 Enable drive 0 (0)
+//
+//
+// ICs that are not emulated yet are marked with "*"
+//
+// TODO:
+// - RS232 I/F
+
+#include "emu.h"
+#include "cpu/hphybrid/hphybrid.h"
+#include "video/i8275.h"
+#include "machine/wd_fdc.h"
+#include "machine/74123.h"
+#include "machine/rescap.h"
+#include "sound/beep.h"
+
+#define BIT_MASK(n) (1U << (n))
+
+// Macros to clear/set single bits
+#define BIT_CLR(w , n) ((w) &= ~BIT_MASK(n))
+#define BIT_SET(w , n) ((w) |= BIT_MASK(n))
+
+class hp64k_state : public driver_device
+{
+public:
+ hp64k_state(const machine_config &mconfig, device_type type, const char *tag);
+
+ virtual void driver_start();
+ //virtual void machine_start();
+ virtual void video_start();
+ virtual void machine_reset();
+
+ UINT8 hp64k_crtc_filter(UINT8 data);
+ DECLARE_WRITE16_MEMBER(hp64k_crtc_w);
+ DECLARE_WRITE_LINE_MEMBER(hp64k_crtc_drq_w);
+ DECLARE_WRITE_LINE_MEMBER(hp64k_crtc_vrtc_w);
+
+ I8275_DRAW_CHARACTER_MEMBER(crtc_display_pixels);
+
+ DECLARE_READ16_MEMBER(hp64k_rear_sw_r);
+
+ IRQ_CALLBACK_MEMBER(hp64k_irq_callback);
+ void hp64k_update_irl(void);
+ DECLARE_WRITE16_MEMBER(hp64k_irl_mask_w);
+
+ TIMER_DEVICE_CALLBACK_MEMBER(hp64k_kb_scan);
+ DECLARE_READ16_MEMBER(hp64k_kb_r);
+
+ TIMER_DEVICE_CALLBACK_MEMBER(hp64k_line_sync);
+ DECLARE_READ16_MEMBER(hp64k_deltat_r);
+ DECLARE_WRITE16_MEMBER(hp64k_deltat_w);
+
+ DECLARE_READ16_MEMBER(hp64k_slot_r);
+ DECLARE_WRITE16_MEMBER(hp64k_slot_w);
+ DECLARE_WRITE16_MEMBER(hp64k_slot_sel_w);
+
+ DECLARE_READ16_MEMBER(hp64k_flp_r);
+ DECLARE_WRITE16_MEMBER(hp64k_flp_w);
+ DECLARE_WRITE_LINE_MEMBER(hp64k_flp_drq_w);
+ DECLARE_WRITE_LINE_MEMBER(hp64k_flp_intrq_w);
+ void hp64k_update_floppy_dma(void);
+ void hp64k_update_floppy_irq(void);
+ void hp64k_update_drv_ctrl(void);
+ DECLARE_WRITE8_MEMBER(hp64k_floppy0_rdy);
+ DECLARE_WRITE8_MEMBER(hp64k_floppy1_rdy);
+ void hp64k_floppy_idx_cb(floppy_image_device *floppy , int state);
+ void hp64k_floppy_wpt_cb(floppy_image_device *floppy , int state);
+
+ DECLARE_READ16_MEMBER(hp64k_usart_r);
+
+ DECLARE_WRITE16_MEMBER(hp64k_beep_w);
+ TIMER_DEVICE_CALLBACK_MEMBER(hp64k_beeper_off);
+private:
+ required_device<hp_5061_3011_cpu_device> m_cpu;
+ required_device<i8275_device> m_crtc;
+ required_device<palette_device> m_palette;
+ required_ioport m_io_key0;
+ required_ioport m_io_key1;
+ required_ioport m_io_key2;
+ required_ioport m_io_key3;
+ required_device<fd1791_t> m_fdc;
+ required_device<floppy_connector> m_floppy0;
+ required_device<floppy_connector> m_floppy1;
+ required_device<ttl74123_device> m_ss0;
+ required_device<ttl74123_device> m_ss1;
+ required_ioport m_rear_panel_sw;
+ required_ioport m_rs232_sw;
+ required_device<beep_device> m_beeper;
+ required_device<timer_device> m_beep_timer;
+
+ // Character generator
+ const UINT8 *m_chargen;
+
+ UINT32 m_crtc_ptr;
+ bool m_crtc_drq;
+ bool m_vrtc;
+
+ // Interrupt handling
+ UINT8 m_irl_mask;
+ UINT8 m_irl_pending;
+
+ // State of keyboard
+ ioport_value m_kb_state[ 4 ];
+ UINT8 m_kb_row_col;
+ bool m_kb_scan_on;
+ bool m_kb_pressed;
+
+ // Slot selection
+ std::vector<UINT16> m_low32k_ram;
+ UINT8 m_slot_select;
+ UINT8 m_slot_map;
+
+ // Floppy I/F
+ UINT8 m_floppy_in_latch_msb; // U23
+ UINT8 m_floppy_in_latch_lsb; // U38
+ UINT8 m_floppy_out_latch_msb; // U22
+ UINT8 m_floppy_out_latch_lsb; // U37
+ UINT8 m_floppy_if_ctrl; // U24
+ bool m_floppy_dmaen;
+ bool m_floppy_dmai;
+ bool m_floppy_mdci;
+ bool m_floppy_intrq;
+ bool m_floppy_drq;
+ bool m_floppy0_wpt;
+ bool m_floppy1_wpt;
+ UINT8 m_floppy_drv_ctrl; // U39
+ UINT8 m_floppy_status; // U25
+
+ typedef enum {
+ HP64K_FLPST_IDLE,
+ HP64K_FLPST_DMAWR1,
+ HP64K_FLPST_DMAWR2,
+ HP64K_FLPST_DMARD1,
+ HP64K_FLPST_DMARD2
+ } floppy_state_t;
+
+ floppy_state_t m_floppy_if_state;
+ floppy_image_device *m_current_floppy;
+};
+
+static ADDRESS_MAP_START(cpu_mem_map , AS_PROGRAM , 16 , hp64k_state)
+ AM_RANGE(0x0000 , 0x3fff) AM_ROM
+ AM_RANGE(0x4000 , 0x7fff) AM_READWRITE(hp64k_slot_r , hp64k_slot_w)
+ AM_RANGE(0x8000 , 0x8001) AM_WRITE(hp64k_crtc_w)
+ AM_RANGE(0x8002 , 0xffff) AM_RAM
+ADDRESS_MAP_END
+
+static ADDRESS_MAP_START(cpu_io_map , AS_IO , 16 , hp64k_state)
+ // PA = 0, IC = [0..3]
+ // Keyboard input
+ AM_RANGE(HP_MAKE_IOADDR(0 , 0) , HP_MAKE_IOADDR(0 , 3)) AM_READ(hp64k_kb_r)
+ // PA = 2, IC = [0..3]
+ // Line sync interrupt clear/watchdog reset
+ AM_RANGE(HP_MAKE_IOADDR(2 , 0) , HP_MAKE_IOADDR(2 , 3)) AM_READWRITE(hp64k_deltat_r , hp64k_deltat_w)
+ // PA = 4, IC = [0..3]
+ // Floppy I/F
+ AM_RANGE(HP_MAKE_IOADDR(4 , 0) , HP_MAKE_IOADDR(4 , 3)) AM_READWRITE(hp64k_flp_r , hp64k_flp_w)
+ // PA = 6, IC = [0..3]
+ // Read from USART
+ AM_RANGE(HP_MAKE_IOADDR(6 , 0) , HP_MAKE_IOADDR(6 , 3)) AM_READ(hp64k_usart_r)
+ // PA = 7, IC = 2
+ // Rear-panel switches
+ AM_RANGE(HP_MAKE_IOADDR(7 , 2) , HP_MAKE_IOADDR(7 , 2)) AM_READ(hp64k_rear_sw_r)
+ // PA = 9, IC = [0..3]
+ // Beeper control & interrupt status read
+ AM_RANGE(HP_MAKE_IOADDR(9 , 0) , HP_MAKE_IOADDR(9 , 3)) AM_WRITE(hp64k_beep_w)
+ // PA = 10, IC = [0..3]
+ // Slot selection
+ AM_RANGE(HP_MAKE_IOADDR(10 , 0) , HP_MAKE_IOADDR(10 , 3)) AM_WRITE(hp64k_slot_sel_w)
+ // PA = 12, IC = [0..3]
+ // Interrupt mask
+ AM_RANGE(HP_MAKE_IOADDR(12 , 0) , HP_MAKE_IOADDR(12 , 3)) AM_WRITE(hp64k_irl_mask_w)
+ADDRESS_MAP_END
+
+hp64k_state::hp64k_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig , type , tag),
+ m_cpu(*this , "cpu"),
+ m_crtc(*this , "crtc"),
+ m_palette(*this , "palette"),
+ m_io_key0(*this , "KEY0"),
+ m_io_key1(*this , "KEY1"),
+ m_io_key2(*this , "KEY2"),
+ m_io_key3(*this , "KEY3"),
+ m_fdc(*this , "fdc"),
+ m_floppy0(*this , "fdc:0"),
+ m_floppy1(*this , "fdc:1"),
+ m_ss0(*this , "fdc_rdy0"),
+ m_ss1(*this , "fdc_rdy1"),
+ m_rear_panel_sw(*this , "rear_sw"),
+ m_rs232_sw(*this , "rs232_sw"),
+ m_beeper(*this , "beeper"),
+ m_beep_timer(*this , "beep_timer")
+{
+}
+
+void hp64k_state::driver_start()
+{
+ // 32kW for lower RAM
+ m_low32k_ram.resize(0x8000);
+}
+
+void hp64k_state::video_start()
+{
+ m_chargen = memregion("chargen")->base();
+}
+
+void hp64k_state::machine_reset()
+{
+ m_crtc_drq = false;
+ m_vrtc = false;
+ m_crtc_ptr = 0;
+ m_irl_mask = 0;
+ m_irl_pending = 0;
+ memset(&m_kb_state[ 0 ] , 0 , sizeof(m_kb_state));
+ m_kb_row_col = 0;
+ m_kb_scan_on = true;
+ m_slot_select = 0;
+ m_slot_map = 3;
+ m_floppy_if_ctrl = ~0;
+ m_floppy_dmaen = false;
+ m_floppy_dmai = false;
+ m_floppy_mdci = false;
+ m_floppy_intrq = false;
+ m_floppy_drv_ctrl = ~0;
+ m_floppy_if_state = HP64K_FLPST_IDLE;
+ m_current_floppy = NULL;
+ m_floppy0_wpt = false;
+ m_floppy1_wpt = false;
+ m_beeper->set_state(0);
+}
+
+UINT8 hp64k_state::hp64k_crtc_filter(UINT8 data)
+{
+ bool inv = (data & 0xe0) == 0xe0;
+
+ return inv ? (data & 0xf2) : data;
+}
+
+WRITE16_MEMBER(hp64k_state::hp64k_crtc_w)
+{
+ m_crtc->write(space , offset == 0 , hp64k_crtc_filter((UINT8)data));
+}
+
+WRITE_LINE_MEMBER(hp64k_state::hp64k_crtc_drq_w)
+{
+ bool crtc_drq = state != 0;
+ bool prev_crtc = m_crtc_drq;
+ m_crtc_drq = crtc_drq;
+
+ if (!prev_crtc && crtc_drq) {
+ address_space& prog_space = m_cpu->space(AS_PROGRAM);
+
+ UINT8 data = prog_space.read_byte(m_crtc_ptr);
+ m_crtc_ptr++;
+
+ m_crtc->dack_w(prog_space , 0 , hp64k_crtc_filter(data));
+ }
+}
+
+WRITE_LINE_MEMBER(hp64k_state::hp64k_crtc_vrtc_w)
+{
+ bool vrtc = state != 0;
+
+ if (!m_vrtc && vrtc) {
+ m_crtc_ptr = 0xf9f0 << 1;
+ }
+ m_vrtc = vrtc;
+}
+
+I8275_DRAW_CHARACTER_MEMBER(hp64k_state::crtc_display_pixels)
+{
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
+ UINT8 chargen_byte = m_chargen[ linecount | ((unsigned)charcode << 4) ];
+ bool lvid , livid;
+ UINT16 pixels_lvid , pixels_livid;
+ unsigned i;
+
+ if (vsp) {
+ pixels_lvid = pixels_livid = ~0;
+ } else if (lten) {
+ pixels_livid = ~0;
+ if (rvv) {
+ pixels_lvid = ~0;
+ } else {
+ pixels_lvid = 0;
+ }
+ } else if (rvv) {
+ pixels_lvid = ~0;
+ pixels_livid = (UINT16)chargen_byte << 1;
+ } else {
+ pixels_lvid = ~((UINT16)chargen_byte << 1);
+ pixels_livid = ~0;
+ }
+
+ for (i = 0; i < 9; i++) {
+ lvid = (pixels_lvid & (1U << (8 - i))) != 0;
+ livid = (pixels_livid & (1U << (8 - i))) != 0;
+
+ if (!lvid) {
+ // Normal brightness
+ bitmap.pix32(y , x + i) = palette[ 2 ];
+ } else if (livid) {
+ // Black
+ bitmap.pix32(y , x + i) = palette[ 0 ];
+ } else {
+ // Half brightness
+ bitmap.pix32(y , x + i) = palette[ 1 ];
+ }
+ }
+
+}
+
+READ16_MEMBER(hp64k_state::hp64k_rear_sw_r)
+{
+ return m_rear_panel_sw->read() | 0x0020;
+}
+
+IRQ_CALLBACK_MEMBER(hp64k_state::hp64k_irq_callback)
+{
+ if (irqline == HPHYBRID_IRL) {
+ return 0xff00 | (m_irl_mask & m_irl_pending);
+ } else {
+ return ~0;
+ }
+}
+
+void hp64k_state::hp64k_update_irl(void)
+{
+ m_cpu->set_input_line(HPHYBRID_IRL , (m_irl_mask & m_irl_pending) != 0);
+}
+
+WRITE16_MEMBER(hp64k_state::hp64k_irl_mask_w)
+{
+ m_irl_mask = (UINT8)data;
+ hp64k_update_irl();
+}
+
+TIMER_DEVICE_CALLBACK_MEMBER(hp64k_state::hp64k_kb_scan)
+{
+ if (m_kb_scan_on) {
+ unsigned i;
+
+ ioport_value input[ 4 ];
+ input[ 0 ] = m_io_key0->read();
+ input[ 1 ] = m_io_key1->read();
+ input[ 2 ] = m_io_key2->read();
+ input[ 3 ] = m_io_key3->read();
+
+ for (i = 0; i < 128; i++) {
+ if (++m_kb_row_col >= 128) {
+ m_kb_row_col = 0;
+ }
+
+ ioport_value mask = BIT_MASK(m_kb_row_col & 0x1f);
+ unsigned idx = m_kb_row_col >> 5;
+
+ if ((input[ idx ] ^ m_kb_state[ idx ]) & mask) {
+ // key changed state
+ m_kb_state[ idx ] ^= mask;
+ m_kb_pressed = (m_kb_state[ idx ] & mask) != 0;
+ m_kb_scan_on = false;
+ BIT_SET(m_irl_pending , 0);
+ hp64k_update_irl();
+ break;
+ }
+ }
+ }
+}
+
+READ16_MEMBER(hp64k_state::hp64k_kb_r)
+{
+ UINT16 ret = 0xff00 | m_kb_row_col;
+
+ if (m_kb_pressed) {
+ BIT_SET(ret , 7);
+ }
+
+ m_kb_scan_on = true;
+ BIT_CLR(m_irl_pending , 0);
+ hp64k_update_irl();
+
+ return ret;
+}
+
+TIMER_DEVICE_CALLBACK_MEMBER(hp64k_state::hp64k_line_sync)
+{
+ BIT_SET(m_irl_pending , 2);
+ hp64k_update_irl();
+}
+
+READ16_MEMBER(hp64k_state::hp64k_deltat_r)
+{
+ BIT_CLR(m_irl_pending , 2);
+ hp64k_update_irl();
+ return 0;
+}
+
+WRITE16_MEMBER(hp64k_state::hp64k_deltat_w)
+{
+ BIT_CLR(m_irl_pending , 2);
+ hp64k_update_irl();
+}
+
+READ16_MEMBER(hp64k_state::hp64k_slot_r)
+{
+ if (m_slot_select == 0x0a) {
+ // Slot 10 selected
+ // On this (fictional) slot is allocated the lower 32KW of RAM
+
+ switch (m_slot_map) {
+ case 0:
+ // IDEN
+ // ID of 32KW RAM expansion
+ return 0x402;
+
+ case 1:
+ // MAP1
+ // Lower half of RAM
+ return m_low32k_ram[ offset ];
+
+ default:
+ // MAP2&3
+ // Upper half of RAM
+ return m_low32k_ram[ offset + 0x4000 ];
+ }
+ } else {
+ return 0;
+ }
+}
+
+WRITE16_MEMBER(hp64k_state::hp64k_slot_w)
+{
+ if (m_slot_select == 0x0a && m_slot_map != 0) {
+ if (m_slot_map != 1) {
+ // MAP2&3
+ offset += 0x4000;
+ }
+ m_low32k_ram[ offset ] &= ~mem_mask;
+ m_low32k_ram[ offset ] |= (data & mem_mask);
+ }
+}
+
+WRITE16_MEMBER(hp64k_state::hp64k_slot_sel_w)
+{
+ m_slot_map = (UINT8)offset;
+ m_slot_select = (UINT8)((data >> 8) & 0x3f);
+}
+
+READ16_MEMBER(hp64k_state::hp64k_flp_r)
+{
+ m_cpu->dmar_w(0);
+
+ switch (offset) {
+ case 0:
+ // DMA transfer, not at TC
+ if (m_floppy_if_state == HP64K_FLPST_DMARD2) {
+ m_floppy_if_state = HP64K_FLPST_IDLE;
+ } else {
+ logerror("Read from IC=0 with floppy state %d\n" , m_floppy_if_state);
+ }
+ break;
+
+ case 1:
+ if (m_floppy_if_state != HP64K_FLPST_IDLE) {
+ logerror("read from IC=1 with floppy state %d\n" , m_floppy_if_state);
+ }
+ break;
+
+ case 2:
+ // DMA transfer, at TC
+ if (m_floppy_if_state == HP64K_FLPST_DMARD2) {
+ m_floppy_if_state = HP64K_FLPST_IDLE;
+ m_floppy_dmaen = false;
+ m_floppy_dmai = true;
+ } else {
+ logerror("Read from IC=2 with floppy state %d\n" , m_floppy_if_state);
+ }
+ break;
+
+ default:
+ logerror("read from IC=%d\n" , offset);
+ }
+
+ hp64k_update_floppy_irq();
+
+ return ((UINT16)m_floppy_out_latch_msb << 8) | (UINT16)m_floppy_out_latch_lsb;
+}
+
+WRITE16_MEMBER(hp64k_state::hp64k_flp_w)
+{
+ m_cpu->dmar_w(0);
+
+ if (offset == 3) {
+ return;
+ }
+
+ m_floppy_in_latch_msb = (UINT8)(data >> 8);
+ m_floppy_in_latch_lsb = (UINT8)data;
+
+ switch (offset) {
+ case 0:
+ // DMA transfer, not at TC
+ if (m_floppy_if_state == HP64K_FLPST_DMAWR1) {
+ m_fdc->data_w(~m_floppy_in_latch_msb);
+ m_floppy_if_state = HP64K_FLPST_DMAWR2;
+ } else {
+ logerror("write to IC=0 with floppy state %d\n" , m_floppy_if_state);
+ }
+ break;
+
+ case 1:
+ if (m_floppy_if_state != HP64K_FLPST_IDLE) {
+ logerror("write to IC=1 with floppy state %d\n" , m_floppy_if_state);
+ }
+ // I/F control register
+ m_floppy_if_ctrl = m_floppy_in_latch_msb;
+ if (BIT(m_floppy_if_ctrl , 4)) {
+ // FDC reset
+ m_fdc->soft_reset();
+ }
+ if (BIT(m_floppy_if_ctrl , 7)) {
+ // Interrupt reset
+ m_floppy_dmai = false;
+ m_floppy_mdci = false;
+ }
+ if (BIT(m_floppy_if_ctrl , 3)) {
+ // Write (to either FDC or drive control)
+ if (BIT(m_floppy_if_ctrl , 2)) {
+ // FDC
+ m_fdc->gen_w(~m_floppy_if_ctrl & 3 , ~m_floppy_in_latch_lsb);
+ } else {
+ // Drive control
+ m_floppy_drv_ctrl = m_floppy_in_latch_lsb;
+ hp64k_update_drv_ctrl();
+ }
+ } else {
+ // Read
+ if (BIT(m_floppy_if_ctrl , 2)) {
+ // FDC
+ m_floppy_out_latch_lsb = ~m_fdc->gen_r(~m_floppy_if_ctrl & 3);
+ } else {
+ // Drive control
+ m_floppy_out_latch_lsb = m_floppy_drv_ctrl;
+ }
+ }
+ // MSB of output latch is always filled with status register
+ m_floppy_out_latch_msb = m_floppy_status;
+ m_floppy_dmaen = BIT(m_floppy_if_ctrl , 5) != 0;
+ hp64k_update_floppy_dma();
+ break;
+
+ case 2:
+ // DMA transfer, at TC
+ if (m_floppy_if_state == HP64K_FLPST_DMAWR1) {
+ m_fdc->data_w(~m_floppy_in_latch_msb);
+ m_floppy_if_state = HP64K_FLPST_DMAWR2;
+ m_floppy_dmaen = false;
+ m_floppy_dmai = true;
+ } else {
+ logerror("write to IC=2 with floppy state %d\n" , m_floppy_if_state);
+ }
+ break;
+ }
+
+ hp64k_update_floppy_irq();
+}
+
+WRITE_LINE_MEMBER(hp64k_state::hp64k_flp_drq_w)
+{
+ m_floppy_drq = state;
+ hp64k_update_floppy_dma();
+}
+
+WRITE_LINE_MEMBER(hp64k_state::hp64k_flp_intrq_w)
+{
+ if (state && !m_floppy_intrq && !BIT(m_floppy_if_ctrl , 7)) {
+ m_floppy_mdci = true;
+ hp64k_update_floppy_irq();
+ }
+ m_floppy_intrq = state;
+}
+
+void hp64k_state::hp64k_update_floppy_dma(void)
+{
+ if (m_floppy_drq && (m_floppy_dmaen || m_floppy_if_state != HP64K_FLPST_IDLE)) {
+ switch (m_floppy_if_state) {
+ case HP64K_FLPST_IDLE:
+ if (BIT(m_floppy_if_ctrl , 6)) {
+ // DMA writes
+ m_cpu->dmar_w(1);
+ m_floppy_if_state = HP64K_FLPST_DMAWR1;
+ } else {
+ // DMA reads
+ m_floppy_out_latch_msb = ~m_fdc->data_r();
+ m_floppy_if_state = HP64K_FLPST_DMARD1;
+ }
+ break;
+
+ case HP64K_FLPST_DMAWR2:
+ m_fdc->data_w(~m_floppy_in_latch_lsb);
+ m_floppy_if_state = HP64K_FLPST_IDLE;
+ break;
+
+ case HP64K_FLPST_DMARD1:
+ m_floppy_out_latch_lsb = ~m_fdc->data_r();
+ m_cpu->dmar_w(1);
+ m_floppy_if_state = HP64K_FLPST_DMARD2;
+ break;
+
+ default:
+ logerror("DRQ with floppy state %d\n" , m_floppy_if_state);
+ }
+ }
+}
+
+void hp64k_state::hp64k_update_floppy_irq(void)
+{
+ if (m_floppy_dmai) {
+ BIT_SET(m_floppy_status , 6);
+ } else {
+ BIT_CLR(m_floppy_status , 6);
+ }
+ if (m_floppy_mdci) {
+ BIT_SET(m_floppy_status , 7);
+ } else {
+ BIT_CLR(m_floppy_status , 7);
+ }
+
+ bool ir4 = m_floppy_dmai || m_floppy_mdci ||
+ (BIT(m_floppy_status , 2) && !BIT(m_floppy_drv_ctrl , 0)) ||
+ (BIT(m_floppy_status , 5) && !BIT(m_floppy_drv_ctrl , 3));
+
+ if (ir4) {
+ BIT_SET(m_irl_pending , 4);
+ } else {
+ BIT_CLR(m_irl_pending , 4);
+ }
+
+ hp64k_update_irl();
+}
+
+void hp64k_state::hp64k_update_drv_ctrl(void)
+{
+ floppy_image_device *floppy0 = m_floppy0->get_device();
+ floppy_image_device *floppy1 = m_floppy1->get_device();
+
+ floppy0->mon_w(BIT(m_floppy_drv_ctrl , 1));
+ floppy1->mon_w(BIT(m_floppy_drv_ctrl , 4));
+ floppy0->ss_w(!BIT(m_floppy_drv_ctrl , 7));
+ floppy1->ss_w(!BIT(m_floppy_drv_ctrl , 7));
+
+ if (BIT(m_floppy_drv_ctrl , 2)) {
+ BIT_CLR(m_floppy_status , 2);
+ }
+ if (BIT(m_floppy_drv_ctrl , 5)) {
+ BIT_CLR(m_floppy_status , 5);
+ }
+ hp64k_update_floppy_irq();
+
+ // Drive selection logic:
+ // m_floppy_drv_ctrl
+ // Bit 3 0 - Drive selected
+ // ========================
+ // 0 0 - Invalid:both drives selected. Signals to/from drive 1 are routed to FDC anyway.
+ // 0 1 - Drive 1
+ // 1 0 - Drive 0
+ // 1 1 - None
+ floppy_image_device *new_drive;
+
+ if (!BIT(m_floppy_drv_ctrl , 3)) {
+ new_drive = m_floppy1->get_device();
+ } else if (!BIT(m_floppy_drv_ctrl , 0)) {
+ new_drive = m_floppy0->get_device();
+ } else {
+ new_drive = NULL;
+ }
+
+ if (new_drive != m_current_floppy) {
+ m_fdc->set_floppy(new_drive);
+
+ floppy0->setup_index_pulse_cb(floppy_image_device::index_pulse_cb(FUNC(hp64k_state::hp64k_floppy_idx_cb) , this));
+ floppy1->setup_index_pulse_cb(floppy_image_device::index_pulse_cb(FUNC(hp64k_state::hp64k_floppy_idx_cb) , this));
+
+ floppy0->setup_wpt_cb(floppy_image_device::wpt_cb(FUNC(hp64k_state::hp64k_floppy_wpt_cb) , this));
+ floppy1->setup_wpt_cb(floppy_image_device::wpt_cb(FUNC(hp64k_state::hp64k_floppy_wpt_cb) , this));
+
+ m_current_floppy = new_drive;
+ }
+}
+
+WRITE8_MEMBER(hp64k_state::hp64k_floppy0_rdy)
+{
+ if (data) {
+ BIT_CLR(m_floppy_status , 0);
+ } else {
+ BIT_SET(m_floppy_status , 0);
+ }
+}
+
+WRITE8_MEMBER(hp64k_state::hp64k_floppy1_rdy)
+{
+ if (data) {
+ BIT_CLR(m_floppy_status , 3);
+ } else {
+ BIT_SET(m_floppy_status , 3);
+ }
+}
+
+void hp64k_state::hp64k_floppy_idx_cb(floppy_image_device *floppy , int state)
+{
+ if (floppy == m_floppy0->get_device()) {
+ m_ss0->a_w(machine().driver_data()->generic_space() , 0 , !state);
+ } else if (floppy == m_floppy1->get_device()) {
+ m_ss1->a_w(machine().driver_data()->generic_space() , 0 , !state);
+ }
+
+ if (floppy == m_current_floppy) {
+ m_fdc->index_callback(floppy , state);
+ }
+}
+
+void hp64k_state::hp64k_floppy_wpt_cb(floppy_image_device *floppy , int state)
+{
+ if (floppy == m_floppy0->get_device()) {
+ logerror("floppy0_wpt %d\n" , state);
+ if (m_floppy0_wpt && !state) {
+ BIT_SET(m_floppy_status , 2);
+ hp64k_update_floppy_irq();
+ }
+ if (state) {
+ BIT_SET(m_floppy_status, 1);
+ } else {
+ BIT_CLR(m_floppy_status, 1);
+ }
+ m_floppy0_wpt = state;
+ } else if (floppy == m_floppy1->get_device()) {
+ logerror("floppy1_wpt %d\n" , state);
+ if (m_floppy1_wpt && !state) {
+ BIT_SET(m_floppy_status , 5);
+ hp64k_update_floppy_irq();
+ }
+ if (state) {
+ BIT_SET(m_floppy_status, 4);
+ } else {
+ BIT_CLR(m_floppy_status, 4);
+ }
+ m_floppy1_wpt = state;
+ }
+}
+
+READ16_MEMBER(hp64k_state::hp64k_usart_r)
+{
+ // todo
+ // bit 8 == bit 7 rear panel switches (modem/terminal) ???
+ return m_rs232_sw->read() << 8;
+}
+
+WRITE16_MEMBER(hp64k_state::hp64k_beep_w)
+{
+ if (!BIT(offset , 0)) {
+ m_beeper->set_state(1);
+ // Duration is bogus: in the real hw envelope decays exponentially with RC=~136 ms
+ m_beep_timer->adjust(attotime::from_msec(130));
+ }
+}
+
+TIMER_DEVICE_CALLBACK_MEMBER(hp64k_state::hp64k_beeper_off)
+{
+ m_beeper->set_state(0);
+}
+
+static INPUT_PORTS_START(hp64k)
+ // Keyboard is arranged in a 8 x 16 matrix. Of the 128 possible positions, only 77 are used.
+ // For key arrangement on the matrix, see [1] pg 334
+ // Keys are mapped on bit b of KEYn
+ // where b = (row & 1) << 4 + column, n = row >> 1
+ // column = [0..15]
+ // row = [0..7]
+ PORT_START("KEY0")
+ PORT_BIT(BIT_MASK(0) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_SHIFT_2)
+ PORT_BIT(BIT_MASK(1) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_A) PORT_CHAR('a') PORT_CHAR('A')
+ PORT_BIT(BIT_MASK(2) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_W) PORT_CHAR('w') PORT_CHAR('W')
+ PORT_BIT(BIT_MASK(3) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_E) PORT_CHAR('e') PORT_CHAR('E')
+ PORT_BIT(BIT_MASK(4) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_R) PORT_CHAR('r') PORT_CHAR('R')
+ PORT_BIT(BIT_MASK(5) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_T) PORT_CHAR('t') PORT_CHAR('T')
+ PORT_BIT(BIT_MASK(6) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_Y) PORT_CHAR('y') PORT_CHAR('Y')
+ PORT_BIT(BIT_MASK(7) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_U) PORT_CHAR('u') PORT_CHAR('U')
+ PORT_BIT(BIT_MASK(8) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_I) PORT_CHAR('i') PORT_CHAR('I')
+ PORT_BIT(BIT_MASK(9) , IP_ACTIVE_HIGH , IPT_UNUSED)
+ PORT_BIT(BIT_MASK(10) , IP_ACTIVE_HIGH , IPT_UNUSED)
+ PORT_BIT(BIT_MASK(11) , IP_ACTIVE_HIGH , IPT_UNUSED)
+ PORT_BIT(BIT_MASK(12) , IP_ACTIVE_HIGH , IPT_UNUSED)
+ PORT_BIT(BIT_MASK(13) , IP_ACTIVE_HIGH , IPT_UNUSED)
+ PORT_BIT(BIT_MASK(14) , IP_ACTIVE_HIGH , IPT_UNUSED)
+ PORT_BIT(BIT_MASK(15) , IP_ACTIVE_HIGH , IPT_UNUSED)
+ PORT_BIT(BIT_MASK(16) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_TAB) PORT_CHAR('\t')
+ PORT_BIT(BIT_MASK(17) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q')
+ PORT_BIT(BIT_MASK(18) , IP_ACTIVE_HIGH , IPT_UNUSED)
+ PORT_BIT(BIT_MASK(19) , IP_ACTIVE_HIGH , IPT_UNUSED)
+ PORT_BIT(BIT_MASK(20) , IP_ACTIVE_HIGH , IPT_UNUSED)
+ PORT_BIT(BIT_MASK(21) , IP_ACTIVE_HIGH , IPT_UNUSED)
+ PORT_BIT(BIT_MASK(22) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('\'')
+ PORT_BIT(BIT_MASK(23) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('(')
+ PORT_BIT(BIT_MASK(24) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR(')')
+ PORT_BIT(BIT_MASK(25) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_0) PORT_CHAR('0')
+ PORT_BIT(BIT_MASK(26) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('=')
+ PORT_BIT(BIT_MASK(27) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('^') PORT_CHAR('~')
+ PORT_BIT(BIT_MASK(28) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_TILDE) PORT_CHAR('\\') PORT_CHAR('|')
+ PORT_BIT(BIT_MASK(29) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8)
+ PORT_BIT(BIT_MASK(30) , IP_ACTIVE_HIGH , IPT_UNUSED)
+ PORT_BIT(BIT_MASK(31) , IP_ACTIVE_HIGH , IPT_UNUSED)
+
+ PORT_START("KEY1")
+ PORT_BIT(BIT_MASK(0) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!')
+ PORT_BIT(BIT_MASK(1) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('"')
+ PORT_BIT(BIT_MASK(2) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#')
+ PORT_BIT(BIT_MASK(3) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$')
+ PORT_BIT(BIT_MASK(4) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%')
+ PORT_BIT(BIT_MASK(5) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('&')
+ PORT_BIT(BIT_MASK(6) , IP_ACTIVE_HIGH , IPT_UNUSED)
+ PORT_BIT(BIT_MASK(7) , IP_ACTIVE_HIGH , IPT_UNUSED)
+ PORT_BIT(BIT_MASK(8) , IP_ACTIVE_HIGH , IPT_UNUSED)
+ PORT_BIT(BIT_MASK(9) , IP_ACTIVE_HIGH , IPT_UNUSED)
+ PORT_BIT(BIT_MASK(10) , IP_ACTIVE_HIGH , IPT_UNUSED)
+ PORT_BIT(BIT_MASK(11) , IP_ACTIVE_HIGH , IPT_UNUSED)
+ PORT_BIT(BIT_MASK(12) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_F9) PORT_NAME("RECALL")
+ PORT_BIT(BIT_MASK(13) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_F10) PORT_NAME("CLRLINE")
+ PORT_BIT(BIT_MASK(14) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_F11) PORT_NAME("CAPS")
+ PORT_BIT(BIT_MASK(15) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_F12) PORT_NAME("RESET")
+ PORT_BIT(BIT_MASK(16) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_F1) PORT_NAME("SK1")
+ PORT_BIT(BIT_MASK(17) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_F2) PORT_NAME("SK2")
+ PORT_BIT(BIT_MASK(18) , IP_ACTIVE_HIGH , IPT_UNUSED)
+ PORT_BIT(BIT_MASK(19) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_F3) PORT_NAME("SK3")
+ PORT_BIT(BIT_MASK(20) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_F4) PORT_NAME("SK4")
+ PORT_BIT(BIT_MASK(21) , IP_ACTIVE_HIGH , IPT_UNUSED)
+ PORT_BIT(BIT_MASK(22) , IP_ACTIVE_HIGH , IPT_UNUSED)
+ PORT_BIT(BIT_MASK(23) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_F5) PORT_NAME("SK5")
+ PORT_BIT(BIT_MASK(24) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_F6) PORT_NAME("SK6")
+ PORT_BIT(BIT_MASK(25) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_F7) PORT_NAME("SK7")
+ PORT_BIT(BIT_MASK(26) , IP_ACTIVE_HIGH , IPT_UNUSED)
+ PORT_BIT(BIT_MASK(27) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_F8) PORT_NAME("SK8")
+ PORT_BIT(BIT_MASK(28) , IP_ACTIVE_HIGH , IPT_UNUSED)
+ PORT_BIT(BIT_MASK(29) , IP_ACTIVE_HIGH , IPT_UNUSED)
+ PORT_BIT(BIT_MASK(30) , IP_ACTIVE_HIGH , IPT_UNUSED)
+ PORT_BIT(BIT_MASK(31) , IP_ACTIVE_HIGH , IPT_UNUSED)
+
+ PORT_START("KEY2")
+ PORT_BIT(BIT_MASK(0) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1)
+ PORT_BIT(BIT_MASK(1) , IP_ACTIVE_HIGH , IPT_UNUSED)
+ PORT_BIT(BIT_MASK(2) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_S) PORT_CHAR('s') PORT_CHAR('S')
+ PORT_BIT(BIT_MASK(3) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_D) PORT_CHAR('d') PORT_CHAR('D')
+ PORT_BIT(BIT_MASK(4) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_F) PORT_CHAR('f') PORT_CHAR('F')
+ PORT_BIT(BIT_MASK(5) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_G) PORT_CHAR('g') PORT_CHAR('G')
+ PORT_BIT(BIT_MASK(6) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_H) PORT_CHAR('h') PORT_CHAR('H')
+ PORT_BIT(BIT_MASK(7) , IP_ACTIVE_HIGH , IPT_UNUSED)
+ PORT_BIT(BIT_MASK(8) , IP_ACTIVE_HIGH , IPT_UNUSED)
+ PORT_BIT(BIT_MASK(9) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O')
+ PORT_BIT(BIT_MASK(10) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_P) PORT_CHAR('p') PORT_CHAR('P')
+ PORT_BIT(BIT_MASK(11) , IP_ACTIVE_HIGH , IPT_UNUSED)
+ PORT_BIT(BIT_MASK(12) , IP_ACTIVE_HIGH , IPT_UNUSED)
+ PORT_BIT(BIT_MASK(13) , IP_ACTIVE_HIGH , IPT_UNUSED)
+ PORT_BIT(BIT_MASK(14) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_INSERT) PORT_NAME("INSCHAR")
+ PORT_BIT(BIT_MASK(15) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_DEL) PORT_NAME("DELCHAR")
+ PORT_BIT(BIT_MASK(16) , IP_ACTIVE_HIGH , IPT_UNUSED)
+ PORT_BIT(BIT_MASK(17) , IP_ACTIVE_HIGH , IPT_UNUSED)
+ PORT_BIT(BIT_MASK(18) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_Z) PORT_CHAR('z') PORT_CHAR('Z')
+ PORT_BIT(BIT_MASK(19) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_X) PORT_CHAR('x') PORT_CHAR('X')
+ PORT_BIT(BIT_MASK(20) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_C) PORT_CHAR('c') PORT_CHAR('C')
+ PORT_BIT(BIT_MASK(21) , IP_ACTIVE_HIGH , IPT_UNUSED)
+ PORT_BIT(BIT_MASK(22) , IP_ACTIVE_HIGH , IPT_UNUSED)
+ PORT_BIT(BIT_MASK(23) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_J) PORT_CHAR('j') PORT_CHAR('J')
+ PORT_BIT(BIT_MASK(24) , IP_ACTIVE_HIGH , IPT_UNUSED)
+ PORT_BIT(BIT_MASK(25) , IP_ACTIVE_HIGH , IPT_UNUSED)
+ PORT_BIT(BIT_MASK(26) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('@') PORT_CHAR('`')
+ PORT_BIT(BIT_MASK(27) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR('[') PORT_CHAR('{')
+ PORT_BIT(BIT_MASK(28) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSLASH2) PORT_CHAR('_') PORT_CHAR(UCHAR_MAMEKEY(DEL))
+ PORT_BIT(BIT_MASK(29) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_HOME) PORT_NAME("ROLLUP")
+ PORT_BIT(BIT_MASK(30) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP))
+ PORT_BIT(BIT_MASK(31) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_PGDN) PORT_NAME("NEXTPG")
+
+ PORT_START("KEY3")
+ PORT_BIT(BIT_MASK(0) , IP_ACTIVE_HIGH , IPT_UNUSED)
+ PORT_BIT(BIT_MASK(1) , IP_ACTIVE_HIGH , IPT_UNUSED)
+ PORT_BIT(BIT_MASK(2) , IP_ACTIVE_HIGH , IPT_UNUSED)
+ PORT_BIT(BIT_MASK(3) , IP_ACTIVE_HIGH , IPT_UNUSED)
+ PORT_BIT(BIT_MASK(4) , IP_ACTIVE_HIGH , IPT_UNUSED)
+ PORT_BIT(BIT_MASK(5) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_V) PORT_CHAR('v') PORT_CHAR('V')
+ PORT_BIT(BIT_MASK(6) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_B) PORT_CHAR('b') PORT_CHAR('B')
+ PORT_BIT(BIT_MASK(7) , IP_ACTIVE_HIGH , IPT_UNUSED)
+ PORT_BIT(BIT_MASK(8) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_K) PORT_CHAR('k') PORT_CHAR('K')
+ PORT_BIT(BIT_MASK(9) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_L) PORT_CHAR('l') PORT_CHAR('L')
+ PORT_BIT(BIT_MASK(10) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR('+')
+ PORT_BIT(BIT_MASK(11) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR(':') PORT_CHAR('*')
+ PORT_BIT(BIT_MASK(12) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR(']') PORT_CHAR('}')
+ PORT_BIT(BIT_MASK(13) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13)
+ PORT_BIT(BIT_MASK(14) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_LEFT) PORT_CHAR(UCHAR_MAMEKEY(LEFT))
+ PORT_BIT(BIT_MASK(15) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT))
+ PORT_BIT(BIT_MASK(16) , IP_ACTIVE_HIGH , IPT_UNUSED)
+ PORT_BIT(BIT_MASK(17) , IP_ACTIVE_HIGH , IPT_UNUSED)
+ PORT_BIT(BIT_MASK(18) , IP_ACTIVE_HIGH , IPT_UNUSED)
+ PORT_BIT(BIT_MASK(19) , IP_ACTIVE_HIGH , IPT_UNUSED)
+ PORT_BIT(BIT_MASK(20) , IP_ACTIVE_HIGH , IPT_UNUSED)
+ PORT_BIT(BIT_MASK(21) , IP_ACTIVE_HIGH , IPT_UNUSED)
+ PORT_BIT(BIT_MASK(22) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ')
+ PORT_BIT(BIT_MASK(23) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_N) PORT_CHAR('n') PORT_CHAR('N')
+ PORT_BIT(BIT_MASK(24) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_M) PORT_CHAR('m') PORT_CHAR('M')
+ PORT_BIT(BIT_MASK(25) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<')
+ PORT_BIT(BIT_MASK(26) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>')
+ PORT_BIT(BIT_MASK(27) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?')
+ PORT_BIT(BIT_MASK(28) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1)
+ PORT_BIT(BIT_MASK(29) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_END) PORT_NAME("ROLLDN")
+ PORT_BIT(BIT_MASK(30) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN))
+ PORT_BIT(BIT_MASK(31) , IP_ACTIVE_HIGH , IPT_KEYBOARD) PORT_CODE(KEYCODE_PGUP) PORT_NAME("PREVPG")
+
+ PORT_START("rear_sw")
+ PORT_DIPNAME(0x8000 , 0x8000 , "E9-6 jumper")
+ PORT_DIPSETTING(0x0000 , DEF_STR(Yes))
+ PORT_DIPSETTING(0x8000 , DEF_STR(No))
+ PORT_DIPNAME(0x4000 , 0x4000 , "E9-5 jumper")
+ PORT_DIPSETTING(0x0000 , DEF_STR(Yes))
+ PORT_DIPSETTING(0x4000 , DEF_STR(No))
+ PORT_DIPNAME(0x2000 , 0x2000 , "E9-4 jumper")
+ PORT_DIPSETTING(0x0000 , DEF_STR(Yes))
+ PORT_DIPSETTING(0x2000 , DEF_STR(No))
+ PORT_DIPNAME(0x1000 , 0x1000 , "E9-3 jumper")
+ PORT_DIPSETTING(0x0000 , DEF_STR(Yes))
+ PORT_DIPSETTING(0x1000 , DEF_STR(No))
+ PORT_DIPNAME(0x0800 , 0x0800 , "E9-2 jumper")
+ PORT_DIPSETTING(0x0000 , DEF_STR(Yes))
+ PORT_DIPSETTING(0x0800 , DEF_STR(No))
+ PORT_DIPNAME(0x0400 , 0x0400 , "E9-1 jumper")
+ PORT_DIPSETTING(0x0000 , DEF_STR(Yes))
+ PORT_DIPSETTING(0x0400 , DEF_STR(No))
+ PORT_DIPNAME(0x0018 , 0x0000 , "System source")
+ PORT_DIPLOCATION("S1:!7,!6")
+ PORT_DIPSETTING(0x0000 , "Sys bus")
+ PORT_DIPSETTING(0x0008 , "Local storage-talk only")
+ PORT_DIPSETTING(0x0010 , "Local storage-addressable")
+ PORT_DIPSETTING(0x0018 , "Performance verification")
+ PORT_DIPNAME(0x0300 , 0x0000 , "Upper bus address (N/U)")
+ PORT_DIPLOCATION("S1:!2,!1")
+ PORT_DIPSETTING(0x0000 , "0")
+ PORT_DIPSETTING(0x0100 , "1")
+ PORT_DIPSETTING(0x0200 , "2")
+ PORT_DIPSETTING(0x0300 , "3")
+ PORT_DIPNAME(0x0007 , 0x0000 , "System bus address")
+ PORT_DIPLOCATION("S1:!5,!4,!3")
+ PORT_DIPSETTING(0x0000 , "0")
+ PORT_DIPSETTING(0x0001 , "1")
+ PORT_DIPSETTING(0x0002 , "2")
+ PORT_DIPSETTING(0x0003 , "3")
+ PORT_DIPSETTING(0x0004 , "4")
+ PORT_DIPSETTING(0x0005 , "5")
+ PORT_DIPSETTING(0x0006 , "6")
+ PORT_DIPSETTING(0x0007 , "7")
+ PORT_DIPNAME(0x0080 , 0x0000 , "RS232 mode")
+ PORT_DIPLOCATION("S4 IO:!8")
+ PORT_DIPSETTING(0x0000 , "Terminal")
+ PORT_DIPSETTING(0x0080 , "Modem")
+
+ PORT_START("rs232_sw")
+ PORT_DIPNAME(0xc0 , 0x00 , "Stop bits")
+ PORT_DIPLOCATION("S4 IO:!2,!1")
+ PORT_DIPSETTING(0x00 , "Invalid")
+ PORT_DIPSETTING(0x40 , "1")
+ PORT_DIPSETTING(0x80 , "1.5")
+ PORT_DIPSETTING(0xc0 , "2")
+ PORT_DIPNAME(0x20 , 0x00 , "Parity")
+ PORT_DIPLOCATION("S4 IO:!3")
+ PORT_DIPSETTING(0x00 , "Odd")
+ PORT_DIPSETTING(0x20 , "Even")
+ PORT_DIPNAME(0x10 , 0x00 , "Parity enable")
+ PORT_DIPLOCATION("S4 IO:!4")
+ PORT_DIPSETTING(0x00 , DEF_STR(No))
+ PORT_DIPSETTING(0x10 , DEF_STR(Yes))
+ PORT_DIPNAME(0x0c , 0x00 , "Char length")
+ PORT_DIPLOCATION("S4 IO:!6,!5")
+ PORT_DIPSETTING(0x00 , "5")
+ PORT_DIPSETTING(0x04 , "6")
+ PORT_DIPSETTING(0x08 , "7")
+ PORT_DIPSETTING(0x0c , "8")
+ PORT_DIPNAME(0x02 , 0x00 , "Baud rate factor")
+ PORT_DIPLOCATION("S4 IO:!7")
+ PORT_DIPSETTING(0x00 , "1x")
+ PORT_DIPSETTING(0x02 , "16x")
+
+INPUT_PORTS_END
+
+static SLOT_INTERFACE_START(hp64k_floppies)
+ SLOT_INTERFACE("525dd" , FLOPPY_525_DD)
+SLOT_INTERFACE_END
+
+static MACHINE_CONFIG_START(hp64k , hp64k_state)
+ MCFG_CPU_ADD("cpu" , HP_5061_3011 , 6250000)
+ MCFG_CPU_PROGRAM_MAP(cpu_mem_map)
+ MCFG_CPU_IO_MAP(cpu_io_map)
+ MCFG_CPU_IRQ_ACKNOWLEDGE_DRIVER(hp64k_state , hp64k_irq_callback)
+ MCFG_QUANTUM_TIME(attotime::from_hz(100))
+
+ // Actual keyboard refresh rate should be between 1 and 2 kHz
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("kb_timer" , hp64k_state , hp64k_kb_scan , attotime::from_hz(100))
+
+ // Line sync timer. A line frequency of 50 Hz is assumed.
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("linesync_timer" , hp64k_state , hp64k_line_sync , attotime::from_hz(50))
+
+ // Clock = 25 MHz / 9 * (112/114)
+ MCFG_DEVICE_ADD("crtc" , I8275 , 2729045)
+ MCFG_I8275_CHARACTER_WIDTH(9)
+ MCFG_I8275_DRAW_CHARACTER_CALLBACK_OWNER(hp64k_state , crtc_display_pixels)
+ MCFG_I8275_DRQ_CALLBACK(WRITELINE(hp64k_state , hp64k_crtc_drq_w))
+ MCFG_I8275_VRTC_CALLBACK(WRITELINE(hp64k_state , hp64k_crtc_vrtc_w))
+
+ MCFG_SCREEN_ADD("screen" , RASTER)
+ MCFG_SCREEN_UPDATE_DEVICE("crtc" , i8275_device , screen_update)
+ MCFG_SCREEN_REFRESH_RATE(60)
+ MCFG_PALETTE_ADD_MONOCHROME_GREEN_HIGHLIGHT("palette")
+
+ MCFG_FD1791_ADD("fdc" , XTAL_4MHz / 4)
+ MCFG_WD_FDC_FORCE_READY
+ MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(hp64k_state , hp64k_flp_intrq_w))
+ MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(hp64k_state , hp64k_flp_drq_w))
+ MCFG_FLOPPY_DRIVE_ADD("fdc:0" , hp64k_floppies , "525dd" , floppy_image_device::default_floppy_formats)
+ MCFG_SLOT_FIXED(true)
+ MCFG_FLOPPY_DRIVE_ADD("fdc:1" , hp64k_floppies , "525dd" , floppy_image_device::default_floppy_formats)
+ MCFG_SLOT_FIXED(true)
+
+ MCFG_DEVICE_ADD("fdc_rdy0" , TTL74123 , 0)
+ MCFG_TTL74123_CONNECTION_TYPE(TTL74123_NOT_GROUNDED_NO_DIODE)
+ MCFG_TTL74123_RESISTOR_VALUE(RES_K(68.1))
+ // Warning! Duration formula is not correct for LS123, actual capacitor is 10 uF
+ MCFG_TTL74123_CAPACITOR_VALUE(CAP_U(16))
+ MCFG_TTL74123_B_PIN_VALUE(1)
+ MCFG_TTL74123_CLEAR_PIN_VALUE(1)
+ MCFG_TTL74123_OUTPUT_CHANGED_CB(WRITE8(hp64k_state , hp64k_floppy0_rdy));
+
+ MCFG_DEVICE_ADD("fdc_rdy1" , TTL74123 , 0)
+ MCFG_TTL74123_CONNECTION_TYPE(TTL74123_NOT_GROUNDED_NO_DIODE)
+ MCFG_TTL74123_RESISTOR_VALUE(RES_K(68.1))
+ MCFG_TTL74123_CAPACITOR_VALUE(CAP_U(16))
+ MCFG_TTL74123_B_PIN_VALUE(1)
+ MCFG_TTL74123_CLEAR_PIN_VALUE(1)
+ MCFG_TTL74123_OUTPUT_CHANGED_CB(WRITE8(hp64k_state , hp64k_floppy1_rdy));
+
+ MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SOUND_ADD("beeper" , BEEP , 2500)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS , "mono" , 1.00)
+
+ MCFG_TIMER_DRIVER_ADD("beep_timer" , hp64k_state , hp64k_beeper_off);
+MACHINE_CONFIG_END
+
+ROM_START(hp64k)
+ ROM_REGION(0x8000 , "cpu" , ROMREGION_16BIT | ROMREGION_BE | ROMREGION_INVERT)
+ ROM_LOAD16_BYTE("64100_80022.bin" , 0x0000 , 0x1000 , CRC(38b2aae5) SHA1(bfd0f126bfaf3724dc501979ad2d46afc41913aa))
+ ROM_LOAD16_BYTE("64100_80020.bin" , 0x0001 , 0x1000 , CRC(ac01b436) SHA1(be1e827ea1393a95abb02a52ab5cc35dc2cd96e4))
+ ROM_LOAD16_BYTE("64100_80023.bin" , 0x2000 , 0x1000 , CRC(6b4bc2ce) SHA1(00e6c58ccae9640dc81cb3e92db90a8c69b02a93))
+ ROM_LOAD16_BYTE("64100_80021.bin" , 0x2001 , 0x1000 , CRC(74f9d33c) SHA1(543a845a992b0ceac3e0491acdfb178df0adeb1f))
+ ROM_LOAD16_BYTE("64100_80026.bin" , 0x4000 , 0x1000 , CRC(a74e834b) SHA1(a2ff9765628985d9bab4cb44ba23257a9b8d0965))
+ ROM_LOAD16_BYTE("64100_80024.bin" , 0x4001 , 0x1000 , CRC(2e15a1d2) SHA1(ce4330f8f8015a26c02f0965b95baf7dfd615512))
+ ROM_LOAD16_BYTE("64100_80027.bin" , 0x6000 , 0x1000 , CRC(b93c0e7a) SHA1(b239446d3d6e9d3dba6c0278b2771abe1623e1ad))
+ ROM_LOAD16_BYTE("64100_80025.bin" , 0x6001 , 0x1000 , CRC(e6353085) SHA1(48d78835c798f2caf6ee539057676d4f3c8a4df9))
+
+ ROM_REGION(0x800 , "chargen" , 0)
+ ROM_LOAD("1816_1496_82S191.bin" , 0 , 0x800 , CRC(32a52664) SHA1(8b2a49a32510103ff424e8481d5ed9887f609f2f))
+ROM_END
+
+/* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME */
+COMP( 1979, hp64k, 0, 0, hp64k, hp64k, driver_device, 0, "HP", "HP 64000" , 0)
diff --git a/src/mess/drivers/ht68k.c b/src/mess/drivers/ht68k.c
index 3a6f0328b17..5d4bbafb67a 100644
--- a/src/mess/drivers/ht68k.c
+++ b/src/mess/drivers/ht68k.c
@@ -1,5 +1,5 @@
// license:BSD-3-Clause
-// copyright-holders:Robbbert
+// copyright-holders:Miodrag Milanovic
/***************************************************************************
Hawthorne Technology TinyGiant HT68k
@@ -137,7 +137,7 @@ static MACHINE_CONFIG_START( ht68k, ht68k_state )
MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, "terminal")
MCFG_RS232_RXD_HANDLER(DEVWRITELINE("duart68681", mc68681_device, rx_a_w))
- MCFG_WD1770x_ADD("wd1770", XTAL_8MHz )
+ MCFG_WD1770_ADD("wd1770", XTAL_8MHz )
MCFG_FLOPPY_DRIVE_ADD("wd1770:0", ht68k_floppies, "525dd", floppy_image_device::default_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("wd1770:1", ht68k_floppies, "525dd", floppy_image_device::default_floppy_formats)
diff --git a/src/mess/drivers/i7000.c b/src/mess/drivers/i7000.c
new file mode 100644
index 00000000000..7d1ef57211a
--- /dev/null
+++ b/src/mess/drivers/i7000.c
@@ -0,0 +1,401 @@
+// license:GPL-2.0+
+// copyright-holders: Felipe Sanches
+/***************************************************************************
+
+ Itautec I7000
+
+ driver by Felipe C. da S. Sanches <juca@members.fsf.org>
+ with tech info provided by Alexandre Souza (a.k.a. Tabajara).
+
+ The portuguese Wikipedia article available at
+ http://pt.wikipedia.org/wiki/Itautec_I-7000
+ also provides a technical overview of this machine:
+
+ The I-7000 was the first computer manufactured by Itautec
+ (http://www.itautec.com.br/pt-br/produtos). It was originally an 8 bit CP/M
+ computer that became an IBM PC-XT clone in later hardware revisions which
+ took the "I-7000 PC-XT" name.
+
+ * Released in 1982
+ * Operating System: SIM/M / BASIC
+ * CPU: National NSC800 D-4 at 4,00 MHz
+ * Memory: 64KB to 128KB
+ * keyboards: 80 keys (with a reduced numerical keypad and function keys)
+ * display:
+ - 40 X 25 text
+ - 80 X 25 text
+ - 160 X 100 (8 colors)
+ - 640 X 200 (monochrome, with an expansion board)
+ - 320 X 200 (16 colors, with an expansion board)
+ * Expansion slots:
+ - 1 frontal cart slot
+ - 4 internal expansion slots
+ * Ports:
+ - 1 composite video output for a color monitor
+ - 2 cassete interfaces
+ - 1 RS-232C serial port
+ - 1 parallel interface
+ * Storage:
+ - Cassetes recorder
+ - Up to 4 external floppy drives: 8" (FD/DD, 1,1MB) or 5" 1/4
+ - Up to 1 external 10 MB hard-drive
+
+****************************************************************************/
+
+#include "emu.h"
+#include "cpu/z80/z80.h" //CPU was actually a NSC800 (Z80 compatible)
+#include "bus/generic/carts.h"
+#include "machine/pit8253.h"
+#include "machine/i8279.h"
+#include "sound/speaker.h"
+#include "video/mc6845.h"
+
+class i7000_state : public driver_device
+{
+public:
+ i7000_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_card(*this, "cardslot"),
+ m_gfxdecode(*this, "gfxdecode"),
+ m_videoram(*this, "videoram")
+ { }
+
+ void video_start();
+ void machine_start();
+
+ required_device<cpu_device> m_maincpu;
+ required_device<generic_slot_device> m_card;
+ required_device<gfxdecode_device> m_gfxdecode;
+ required_shared_ptr<UINT8> m_videoram;
+ UINT32 screen_update_i7000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ UINT8 *m_char_rom;
+ UINT8 m_row;
+ tilemap_t *m_bg_tilemap;
+
+ TILE_GET_INFO_MEMBER(get_bg_tile_info);
+ MC6845_ON_UPDATE_ADDR_CHANGED(crtc_addr);
+ DECLARE_DRIVER_INIT(i7000);
+ DECLARE_PALETTE_INIT(i7000);
+ DECLARE_DEVICE_IMAGE_LOAD_MEMBER( i7000_card );
+
+ DECLARE_READ8_MEMBER(i7000_kbd_r);
+ DECLARE_WRITE8_MEMBER(i7000_scanlines_w);
+};
+
+WRITE8_MEMBER( i7000_state::i7000_scanlines_w )
+{
+ m_row = data;
+}
+
+READ8_MEMBER( i7000_state::i7000_kbd_r )
+{
+ UINT8 data = 0xff;
+
+ for (int i=0; i<40*25; i++){
+ m_bg_tilemap->mark_tile_dirty(i);
+ }
+
+ if (m_row < 8)
+ {
+ char kbdrow[6];
+ sprintf(kbdrow,"X%X",m_row);
+ data = ioport(kbdrow)->read();
+ }
+ return data;
+}
+
+/* Input ports */
+static INPUT_PORTS_START( i7000 )
+ PORT_START("X0")
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("1") PORT_CODE(KEYCODE_1)
+ PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("9") PORT_CODE(KEYCODE_9)
+ PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("U") PORT_CODE(KEYCODE_U)
+ PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("ESC") PORT_CODE(KEYCODE_ESC)
+ PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("K") PORT_CODE(KEYCODE_K)
+ PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("N") PORT_CODE(KEYCODE_N)
+ PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("!") PORT_CHAR('!')
+ PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("ENTER") PORT_CODE(KEYCODE_ENTER)
+
+ PORT_START("X1")
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("2") PORT_CODE(KEYCODE_2)
+ PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("0") PORT_CODE(KEYCODE_0)
+ PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("T") PORT_CODE(KEYCODE_T)
+ PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("0x9D")
+ PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("L") PORT_CODE(KEYCODE_L)
+ PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("X") PORT_CODE(KEYCODE_X)
+ PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("0x8F")
+ PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("^R DC2") //0x12
+
+ PORT_START("X2")
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("3") PORT_CODE(KEYCODE_3)
+ PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("$ ^") PORT_CHAR('$') PORT_CHAR('^')
+ PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("R") PORT_CODE(KEYCODE_R)
+ PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("S") PORT_CODE(KEYCODE_S)
+ PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("0xA0")
+ PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C") PORT_CODE(KEYCODE_C)
+ PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("- _") PORT_CODE(KEYCODE_MINUS)
+ PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("BACKSPACE") PORT_CODE(KEYCODE_BACKSPACE)
+
+ PORT_START("X3")
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("4") PORT_CODE(KEYCODE_4)
+ PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("% +") PORT_CHAR('%') PORT_CHAR('+')
+ PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("I") PORT_CODE(KEYCODE_I)
+ PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("D") PORT_CODE(KEYCODE_D)
+ PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("0x9C")
+ PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("M") PORT_CODE(KEYCODE_M)
+ PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("]") PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(']')
+ PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("@") PORT_CHAR('@')
+
+ PORT_START("X4")
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("5 *") PORT_CODE(KEYCODE_5)
+ PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("^U NAK") //0x15
+ PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("O") PORT_CODE(KEYCODE_O)
+ PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F") PORT_CODE(KEYCODE_F)
+ PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("| <") PORT_CHAR('<')
+ PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(", ;") PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR(';')
+ PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("[") PORT_CODE(KEYCODE_OPENBRACE)
+ PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("^E ENQ") //0x05
+
+ PORT_START("X5")
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("6") PORT_CODE(KEYCODE_6)
+ PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("^O SI") //0x0F
+ PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("P") PORT_CODE(KEYCODE_P)
+ PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G") PORT_CODE(KEYCODE_G)
+ PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("J") PORT_CODE(KEYCODE_J)
+ PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(".") PORT_CODE(KEYCODE_STOP) PORT_CHAR('.')
+ PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("#") PORT_CHAR('#')
+ PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("{") PORT_CHAR('{')
+
+ PORT_START("X6")
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("7") PORT_CODE(KEYCODE_7)
+ PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Q") PORT_CODE(KEYCODE_Q)
+ PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("E") PORT_CODE(KEYCODE_E)
+ PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A") PORT_CODE(KEYCODE_A)
+ PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("H") PORT_CODE(KEYCODE_H)
+ PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("V") PORT_CODE(KEYCODE_V)
+ PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("^L FF") //0x0C
+ PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("^T DC4") //0x14
+
+ PORT_START("X7")
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("8") PORT_CODE(KEYCODE_8)
+ PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("W") PORT_CODE(KEYCODE_W)
+ PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Y") PORT_CODE(KEYCODE_Y)
+ PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(">") PORT_CHAR('>')
+ PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Z") PORT_CODE(KEYCODE_Z)
+ PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("B") PORT_CODE(KEYCODE_B)
+ PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("SPACEBAR") PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ')
+ PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("}") PORT_CHAR('}')
+
+ PORT_START("DSW") /* DP01 */
+ PORT_DIPNAME( 0x80, 0x80, "1")
+ PORT_DIPSETTING( 0x00, DEF_STR( No ) )
+ PORT_DIPSETTING( 0x80, DEF_STR( Yes ) )
+ PORT_DIPNAME( 0x40, 0x40, "2")
+ PORT_DIPSETTING( 0x00, DEF_STR( No ) )
+ PORT_DIPSETTING( 0x40, DEF_STR( Yes ) )
+ PORT_DIPNAME( 0x20, 0x00, "3")
+ PORT_DIPSETTING( 0x00, DEF_STR( No ) )
+ PORT_DIPSETTING( 0x20, DEF_STR( Yes ) )
+ PORT_DIPNAME( 0x10, 0x10, "4")
+ PORT_DIPSETTING( 0x00, DEF_STR( No ) )
+ PORT_DIPSETTING( 0x10, DEF_STR( Yes ) )
+ PORT_DIPNAME( 0x08, 0x08, "5")
+ PORT_DIPSETTING( 0x00, DEF_STR( No ) )
+ PORT_DIPSETTING( 0x08, DEF_STR( Yes ) )
+ PORT_DIPNAME( 0x04, 0x04, "6")
+ PORT_DIPSETTING( 0x00, DEF_STR( No ) )
+ PORT_DIPSETTING( 0x04, DEF_STR( Yes ) )
+ PORT_DIPNAME( 0x02, 0x00, "7")
+ PORT_DIPSETTING( 0x00, DEF_STR( No ) )
+ PORT_DIPSETTING( 0x02, DEF_STR( Yes ) )
+ PORT_DIPNAME( 0x01, 0x01, "8")
+ PORT_DIPSETTING( 0x00, DEF_STR( No ) )
+ PORT_DIPSETTING( 0x01, DEF_STR( Yes ) )
+INPUT_PORTS_END
+
+DRIVER_INIT_MEMBER(i7000_state, i7000)
+{
+}
+
+void i7000_state::machine_start()
+{
+ address_space &program = m_maincpu->space(AS_PROGRAM);
+
+ if (m_card->exists())
+ {
+ // 0x4000 - 0xbfff 32KB ROM
+ program.install_read_handler(0x4000, 0xbfff, read8_delegate(FUNC(generic_slot_device::read_rom),(generic_slot_device*)m_card));
+ }
+}
+
+PALETTE_INIT_MEMBER(i7000_state, i7000)
+{
+ palette.set_pen_color(0, rgb_t(0x33, 0x33, 0x33));
+ palette.set_pen_color(1, rgb_t(0xBB, 0xBB, 0xBB));
+}
+
+/*FIXME: we still need to figure out the proper memory map
+ for the maincpu and where the cartridge slot maps to. */
+static ADDRESS_MAP_START(i7000_mem, AS_PROGRAM, 8, i7000_state)
+ AM_RANGE(0x0000, 0x0fff) AM_ROM AM_REGION("boot", 0)
+ AM_RANGE(0x2000, 0x2fff) AM_RAM AM_SHARE("videoram")
+ AM_RANGE(0x4000, 0xffff) AM_RAM
+// AM_RANGE(0x4000, 0xbfff) AM_ROM AM_REGION("cardslot", 0)
+ADDRESS_MAP_END
+
+static ADDRESS_MAP_START( i7000_io , AS_IO, 8, i7000_state)
+ ADDRESS_MAP_UNMAP_HIGH
+ ADDRESS_MAP_GLOBAL_MASK (0xff)
+// AM_RANGE(0x06, 0x06) AM_WRITE(i7000_io_?_w)
+// AM_RANGE(0x08, 0x09) AM_WRITE(i7000_io_?_w) //printer perhaps?
+// AM_RANGE(0x0c, 0x0c) AM_WRITE(i7000_io_?_w) //0x0C and 0x10 may be related to mem page swapping. (self-test "4. PAG")
+// AM_RANGE(0x10, 0x10) AM_WRITE(i7000_io_?_w)
+// AM_RANGE(0x14, 0x15) AM_WRITE(i7000_io_?_w)
+
+ AM_RANGE(0x18, 0x1b) AM_DEVREADWRITE("pit8253", pit8253_device, read, write)
+
+// AM_RANGE(0x1c, 0x1c) AM_WRITE(i7000_io_printer_data_w) //ASCII data
+ AM_RANGE(0x1d, 0x1d) AM_READ_PORT("DSW")
+// AM_RANGE(0x1e, 0x1e) AM_READWRITE(i7000_io_printer_status_r, i7000_io_?_w)
+// AM_RANGE(0x1f, 0x1f) AM_WRITE(i7000_io_printer_strobe_w) //self-test routine writes 0x08 and 0x09 (it seems that bit 0 is the strobe and bit 3 is an enable signal)
+// AM_RANGE(0x20, 0x21) AM_READWRITE(i7000_io_keyboard_r, i7000_io_keyboard_w)
+
+ AM_RANGE( 0x20, 0x20 ) AM_DEVREADWRITE("i8279", i8279_device, data_r, data_w)
+ AM_RANGE( 0x21, 0x21 ) AM_DEVREADWRITE("i8279", i8279_device, status_r, cmd_w)
+
+// AM_RANGE(0x24, 0x24) AM_READ(i7000_io_?_r)
+// AM_RANGE(0x25, 0x25) AM_WRITE(i7000_io_?_w)
+
+// AM_RANGE(0x28, 0x2d) AM_READWRITE(i7000_io_joystick_r, i7000_io_joystick_w)
+
+// AM_RANGE(0x3b, 0x3b) AM_WRITE(i7000_io_?_w)
+// AM_RANGE(0x66, 0x67) AM_WRITE(i7000_io_?_w)
+// AM_RANGE(0xbb, 0xbb) AM_WRITE(i7000_io_?_w) //may be related to page-swapping...
+ADDRESS_MAP_END
+
+DEVICE_IMAGE_LOAD_MEMBER( i7000_state, i7000_card )
+{
+ UINT32 size = m_card->common_get_size("rom");
+
+ m_card->rom_alloc(size, GENERIC_ROM8_WIDTH, ENDIANNESS_BIG);
+ m_card->common_load_rom(m_card->get_rom_base(), size, "rom");
+
+ return IMAGE_INIT_PASS;
+}
+
+static const gfx_layout i7000_charlayout =
+{
+ 8, 8, /* 8 x 8 characters */
+ 256, /* 256 characters */
+ 1, /* 1 bits per pixel */
+ { 0 }, /* no bitplanes */
+ /* x offsets */
+ { 0, 1, 2, 3, 4, 5, 6, 7 },
+ /* y offsets */
+ { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
+ 8*8 /* every char takes 8 bytes */
+};
+
+static GFXDECODE_START( i7000 )
+ GFXDECODE_ENTRY( "gfx1", 0x0000, i7000_charlayout, 0, 8 )
+GFXDECODE_END
+
+/****************************
+* Video/Character functions *
+****************************/
+
+TILE_GET_INFO_MEMBER(i7000_state::get_bg_tile_info)
+{
+ SET_TILE_INFO_MEMBER(0, /*code:*/ m_videoram[tile_index], /*color:*/ 0, 0);
+}
+
+void i7000_state::video_start()
+{
+ m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(i7000_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 40, 25);
+}
+
+UINT32 i7000_state::screen_update_i7000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+{
+ m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
+ return 0;
+}
+
+/* ROCKWELL 6545 - Transparent Memory Addressing */
+MC6845_ON_UPDATE_ADDR_CHANGED(i7000_state::crtc_addr)
+{
+ /* What is this mandatory function meant to do ? */
+}
+
+
+static MACHINE_CONFIG_START( i7000, i7000_state )
+
+ /* basic machine hardware */
+ MCFG_CPU_ADD("maincpu", NSC800, XTAL_4MHz)
+ MCFG_CPU_PROGRAM_MAP(i7000_mem)
+ MCFG_CPU_IO_MAP(i7000_io)
+
+ /* video hardware */
+ MCFG_SCREEN_ADD("screen", RASTER)
+ MCFG_SCREEN_REFRESH_RATE(60)
+ MCFG_SCREEN_SIZE(320, 200) /* 40x25 8x8 chars */
+ MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 200-1)
+
+ MCFG_SCREEN_UPDATE_DRIVER(i7000_state, screen_update_i7000)
+ MCFG_SCREEN_PALETTE("palette")
+
+ MCFG_GFXDECODE_ADD("gfxdecode", "palette", i7000)
+ MCFG_PALETTE_ADD("palette", 2)
+ MCFG_PALETTE_INIT_OWNER(i7000_state, i7000)
+
+ MCFG_MC6845_ADD("crtc", R6545_1, "screen", XTAL_20MHz) /* (?) */
+ MCFG_MC6845_SHOW_BORDER_AREA(true)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_ADDR_CHANGED_CB(i7000_state, crtc_addr)
+
+ /* sound hardware */
+ MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+
+ /* Programmable timer */
+ MCFG_DEVICE_ADD("pit8253", PIT8253, 0)
+// MCFG_PIT8253_CLK0(XTAL_4MHz / 2) /* TODO: verify on PCB */
+// MCFG_PIT8253_OUT0_HANDLER(WRITELINE(i7000_state,i7000_pit_out0))
+// MCFG_PIT8253_CLK1(XTAL_4MHz / 2) /* TODO: verify on PCB */
+// MCFG_PIT8253_OUT1_HANDLER(WRITELINE(i7000_state,i7000_pit_out1))
+ MCFG_PIT8253_CLK2(XTAL_4MHz / 2) /* TODO: verify on PCB */
+ MCFG_PIT8253_OUT2_HANDLER(DEVWRITELINE("speaker", speaker_sound_device, level_w))
+
+ /* Keyboard interface */
+ MCFG_DEVICE_ADD("i8279", I8279, 4000000) /* guessed value. TODO: verify on PCB */
+ MCFG_I8279_OUT_SL_CB(WRITE8(i7000_state, i7000_scanlines_w)) // scan SL lines
+ MCFG_I8279_IN_RL_CB(READ8(i7000_state, i7000_kbd_r)) // kbd RL lines
+ MCFG_I8279_IN_SHIFT_CB(VCC) // TODO: Shift key
+ MCFG_I8279_IN_CTRL_CB(VCC) // TODO: Ctrl key
+
+ /* Cartridge slot */
+ MCFG_GENERIC_CARTSLOT_ADD("cardslot", generic_romram_plain_slot, "i7000_card")
+ MCFG_GENERIC_EXTENSIONS("rom")
+ MCFG_GENERIC_LOAD(i7000_state, i7000_card)
+
+ /* Software lists */
+ MCFG_SOFTWARE_LIST_ADD("card_list", "i7000_card")
+MACHINE_CONFIG_END
+
+ROM_START( i7000 )
+ ROM_REGION( 0x1000, "boot", 0 )
+ ROM_LOAD( "i7000_boot_v1_4r02_15_10_85_d52d.rom", 0x0000, 0x1000, CRC(622412e5) SHA1(bf187a095600fd46a739c35132a85b5f39b2f867) )
+
+ ROM_REGION( 0x0800, "gfx1", 0 )
+ ROM_LOAD( "i7000_chargen.rom", 0x0000, 0x0800, CRC(7ba75183) SHA1(4af799f4a8bd385e1e4e5ece378df93e1133dc12) )
+
+ ROM_REGION( 0x1000, "drive", 0 )
+ ROM_LOAD( "i7000_drive_ci01.rom", 0x0000, 0x1000, CRC(d8d6e5c1) SHA1(93e7db42fbfaa8243973321c7fc8c51ed80780be) )
+
+ ROM_REGION( 0x1000, "telex", 0 )
+ ROM_LOAD( "i7000_telex_ci09.rom", 0x0000, 0x1000, CRC(c1c8fcc8) SHA1(cbf5fb600e587b998f190a9e3fb398a51d8a5e87) )
+ROM_END
+
+/* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */
+COMP( 1982, i7000, 0, 0, i7000, i7000, i7000_state, i7000, "Itautec", "I-7000", GAME_NOT_WORKING)
diff --git a/src/mess/drivers/icatel.c b/src/mess/drivers/icatel.c
new file mode 100644
index 00000000000..400fe02633e
--- /dev/null
+++ b/src/mess/drivers/icatel.c
@@ -0,0 +1,269 @@
+// license:GPL-2.0+
+// copyright-holders: Felipe Sanches
+/***************************************************************************
+
+ icatel - Brazilian public payphone
+ manufactured by icatel http://www.icatel.com.br/
+
+ Partial schematics (drawn based on PCB inspection) available at:
+ https://github.com/garoa/Icatel/blob/master/doc/icatel.pdf
+
+ Driver by Felipe Sanches <juca@members.fsf.org>
+
+ Changelog:
+
+ 2014 DEC 14 [Felipe Sanches]:
+ * Initial driver skeleton
+
+***************************************************************************/
+
+#include "emu.h"
+#include "cpu/mcs51/mcs51.h"
+#include "video/hd44780.h"
+//#include "sound/speaker.h"
+#include "rendlay.h"
+#include "debugger.h"
+
+class icatel_state : public driver_device
+{
+public:
+ icatel_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag)
+ , m_maincpu(*this, "maincpu")
+ , m_lcdc(*this, "hd44780")
+ { }
+
+ DECLARE_READ8_MEMBER(magic_string);
+
+ DECLARE_READ8_MEMBER(ioport_r);
+ DECLARE_WRITE8_MEMBER(ioport_w);
+
+ DECLARE_READ8_MEMBER(cn8_extension_r);
+ DECLARE_WRITE8_MEMBER(cn8_extension_w);
+
+ DECLARE_READ8_MEMBER(modem_r);
+ DECLARE_WRITE8_MEMBER(modem_w);
+
+ DECLARE_READ8_MEMBER(ci8_r);
+ DECLARE_WRITE8_MEMBER(ci8_w);
+
+ DECLARE_READ8_MEMBER(ci15_r);
+ DECLARE_WRITE8_MEMBER(ci15_w);
+
+ DECLARE_READ8_MEMBER(ci16_r);
+ DECLARE_WRITE8_MEMBER(ci16_w);
+
+ DECLARE_DRIVER_INIT(icatel);
+ DECLARE_PALETTE_INIT(icatel);
+
+private:
+ virtual void machine_start();
+ virtual void machine_reset();
+ required_device<cpu_device> m_maincpu;
+ required_device<hd44780_device> m_lcdc;
+};
+
+static ADDRESS_MAP_START(i80c31_prg, AS_PROGRAM, 8, icatel_state)
+ AM_RANGE(0x0000, 0x7FFF) AM_MIRROR(0x8000) AM_ROM
+ADDRESS_MAP_END
+
+static ADDRESS_MAP_START(i80c31_io, AS_IO, 8, icatel_state)
+ AM_RANGE(0x0000,0x3FFF) AM_RAM
+ AM_RANGE(0x8000,0x8002) AM_RAM /* HACK! */
+ AM_RANGE(0x8040,0x8040) AM_MIRROR(0x3F1E) AM_DEVWRITE("hd44780", hd44780_device, control_write) // not sure yet. CI12 (73LS273)
+ AM_RANGE(0x8041,0x8041) AM_MIRROR(0x3F1E) AM_DEVWRITE("hd44780", hd44780_device, data_write) // not sure yet. CI12
+ AM_RANGE(0x8060,0x8060) AM_MIRROR(0x3F1F) AM_READWRITE(ci8_r, ci8_w)
+ AM_RANGE(0x8080,0x8080) AM_MIRROR(0x3F1F) AM_READWRITE(ci16_r, ci16_w) // card reader (?)
+ AM_RANGE(0x80C0,0x80C0) AM_MIRROR(0x3F1F) AM_READWRITE(ci15_r, ci15_w) // 74LS244 (tristate buffer)
+ AM_RANGE(0xC000,0xCFFF) AM_READWRITE(cn8_extension_r, cn8_extension_w)
+ AM_RANGE(0xE000,0xEFFF) AM_READWRITE(modem_r, modem_w)
+ AM_RANGE(MCS51_PORT_P0, MCS51_PORT_P3) AM_READWRITE(ioport_r, ioport_w)
+ADDRESS_MAP_END
+
+static ADDRESS_MAP_START(i80c31_data, AS_DATA, 8, icatel_state)
+// AM_RANGE(0x0056,0x005A) AM_READ(magic_string) /* This is a hack! */
+ADDRESS_MAP_END
+
+DRIVER_INIT_MEMBER( icatel_state, icatel )
+{
+}
+
+void icatel_state::machine_start()
+{
+}
+
+void icatel_state::machine_reset()
+{
+}
+
+READ8_MEMBER(icatel_state::magic_string)
+{
+// logerror("read: magic_string, offset=%04X\n", offset);
+ char mstr[] = "TP-OK";
+ return mstr[offset%5];
+}
+
+READ8_MEMBER(icatel_state::ioport_r)
+{
+ switch (offset%4)
+ {
+ case 0: return 0xff;
+ case 1: return 0x7f;
+ case 2: return 0xff;
+ case 3: return 0xff;
+ }
+ return 0;
+}
+
+WRITE8_MEMBER(icatel_state::ioport_w)
+{
+}
+
+//----------------------------------------
+
+READ8_MEMBER(icatel_state::cn8_extension_r)
+{
+ /* TODO: Implement-me! */
+ logerror("read: cn8_extension\n");
+ return 0;
+}
+
+WRITE8_MEMBER(icatel_state::cn8_extension_w)
+{
+ /* TODO: Implement-me! */
+ logerror("write: cn8_extension [%02x]\n", data);
+}
+
+//----------------------------------------
+
+READ8_MEMBER(icatel_state::modem_r)
+{
+ /* TODO: Implement-me! */
+ logerror("read: modem\n");
+ return 0;
+}
+
+WRITE8_MEMBER(icatel_state::modem_w)
+{
+ /* TODO: Implement-me! */
+ logerror("write: modem [%02x]\n", data);
+}
+
+//----------------------------------------
+
+READ8_MEMBER(icatel_state::ci8_r)
+{
+ /* TODO: Implement-me! */
+ logerror("read: ci8\n");
+ return 0;
+}
+
+WRITE8_MEMBER(icatel_state::ci8_w)
+{
+ /* TODO: Implement-me! */
+ logerror("write: ci8 [%02x]\n", data);
+}
+
+//----------------------------------------
+
+READ8_MEMBER(icatel_state::ci15_r)
+{
+ /* TODO: Implement-me! */
+// debugger_break(machine());
+// logerror("read: ci15\n");
+ return (1 << 3) | (1 << 0);
+}
+
+WRITE8_MEMBER(icatel_state::ci15_w)
+{
+ /* TODO: Implement-me! */
+ logerror("write: ci15 [%02x]\n", data);
+}
+
+//----------------------------------------
+
+READ8_MEMBER(icatel_state::ci16_r)
+{
+ /* TODO: Implement-me! */
+ // seems to be the card reader.
+ logerror("read: ci16\n");
+ return 0;
+}
+
+WRITE8_MEMBER(icatel_state::ci16_w)
+{
+ /* TODO: Implement-me! */
+ // seems to be the card reader.
+ logerror("write: ci16 [%02x]\n", data);
+}
+
+//----------------------------------------
+
+PALETTE_INIT_MEMBER(icatel_state, icatel)
+{
+ palette.set_pen_color(0, rgb_t(138, 146, 148));
+ palette.set_pen_color(1, rgb_t(92, 83, 88));
+}
+
+static const gfx_layout prot_charlayout =
+{
+ 5, 8, /* 5 x 8 characters */
+ 256, /* 256 characters */
+ 1, /* 1 bits per pixel */
+ { 0 }, /* no bitplanes */
+ { 3, 4, 5, 6, 7},
+ { 0, 8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8},
+ 8*8 /* 8 bytes */
+};
+
+static GFXDECODE_START( icatel )
+ GFXDECODE_ENTRY( "hd44780:cgrom", 0x0000, prot_charlayout, 0, 1 )
+GFXDECODE_END
+
+static HD44780_PIXEL_UPDATE(icatel_pixel_update)
+{
+ if ( pos < 16 && line==0 )
+ {
+ bitmap.pix16(y, pos*6 + x) = state;
+ }
+
+ if ( pos >= 64 && pos < 80 && line==0 )
+ {
+ bitmap.pix16(y+9,(pos-64)*6 + x) = state;
+ }
+}
+
+static MACHINE_CONFIG_START( icatel, icatel_state )
+ /* basic machine hardware */
+ MCFG_CPU_ADD("maincpu", I80C31, XTAL_2_097152MHz)
+ MCFG_CPU_PROGRAM_MAP(i80c31_prg)
+ MCFG_CPU_DATA_MAP(i80c31_data)
+ MCFG_CPU_IO_MAP(i80c31_io)
+
+ /* video hardware */
+ MCFG_SCREEN_ADD("screen", LCD)
+ MCFG_SCREEN_REFRESH_RATE(50)
+ MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
+ MCFG_SCREEN_UPDATE_DEVICE("hd44780", hd44780_device, screen_update)
+ MCFG_SCREEN_SIZE(6*16, 9*2)
+ MCFG_SCREEN_VISIBLE_AREA(0, 6*16-1, 0, 9*2-1)
+ MCFG_SCREEN_PALETTE("palette")
+
+ MCFG_DEFAULT_LAYOUT(layout_lcd)
+ MCFG_PALETTE_ADD("palette", 2)
+ MCFG_PALETTE_INIT_OWNER(icatel_state, icatel)
+ MCFG_GFXDECODE_ADD("gfxdecode", "palette", icatel)
+
+ MCFG_HD44780_ADD("hd44780")
+ MCFG_HD44780_LCD_SIZE(2, 16)
+ MCFG_HD44780_PIXEL_UPDATE_CB(icatel_pixel_update)
+MACHINE_CONFIG_END
+
+ROM_START( icatel )
+ ROM_REGION( 0x8000, "maincpu", 0 )
+ ROM_LOAD( "icatel_tpci_em._4_v16.05.ci14", 0x00000, 0x8000, CRC(d310586e) SHA1(21736ad5a06cf9695f8cc5ff2dc2d19b101504f5) )
+ROM_END
+
+/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */
+COMP( 1995, icatel, 0, 0, icatel, 0, icatel_state, icatel, "Icatel", "TPCI (Brazilian public payphone)", GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND)
+/*The hardware was clearly manufactured in 1995. There's no evindence of the actual date of the firmware.*/
diff --git a/src/mess/drivers/ie15.c b/src/mess/drivers/ie15.c
index 4533388c8de..80eec85421e 100644
--- a/src/mess/drivers/ie15.c
+++ b/src/mess/drivers/ie15.c
@@ -561,8 +561,8 @@ TIMER_DEVICE_CALLBACK_MEMBER(ie15_state::scanline_callback)
UINT16 y = m_screen->vpos();
DBG_LOG(3,"scanline_cb",
- ("addr %03x frame %" I64FMT "d x %.4d y %.3d row %.2d e:c:s %d:%d:%d\n",
- m_video.ptr2, m_screen->frame_number(), m_screen->hpos(), y,
+ ("addr %03x frame %d x %.4d y %.3d row %.2d e:c:s %d:%d:%d\n",
+ m_video.ptr2, (int)m_screen->frame_number(), m_screen->hpos(), y,
y%11, m_video.enable, m_video.cursor, m_video.line25));
if (y < IE15_VERT_START) return;
diff --git a/src/mess/drivers/itt3030.c b/src/mess/drivers/itt3030.c
index 498a215cc58..9df2e81432b 100644
--- a/src/mess/drivers/itt3030.c
+++ b/src/mess/drivers/itt3030.c
@@ -777,7 +777,7 @@ static MACHINE_CONFIG_START( itt3030, itt3030_state )
MCFG_DEVICE_ADD("crt5027", CRT5027, XTAL_6MHz)
MCFG_TMS9927_CHAR_WIDTH(16)
- MCFG_FD1791x_ADD("fdc", XTAL_20MHz / 20)
+ MCFG_FD1791_ADD("fdc", XTAL_20MHz / 20)
MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(itt3030_state, fdcirq_w))
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(itt3030_state, fdcdrq_w))
MCFG_WD_FDC_HLD_CALLBACK(WRITELINE(itt3030_state, fdchld_w))
diff --git a/src/mess/drivers/jupiter.c b/src/mess/drivers/jupiter.c
index fc5df6a5636..1bce61303a6 100644
--- a/src/mess/drivers/jupiter.c
+++ b/src/mess/drivers/jupiter.c
@@ -225,7 +225,7 @@ static MACHINE_CONFIG_START( jupiter, jupiter2_state )
MCFG_CPU_IO_MAP(jupiter_m6800_io)
// devices
- MCFG_DEVICE_ADD(INS1771N1_TAG, FD1771x, 1000000)
+ MCFG_DEVICE_ADD(INS1771N1_TAG, FD1771, 1000000)
MCFG_FLOPPY_DRIVE_ADD(INS1771N1_TAG":0", jupiter_floppies, "525ssdd", floppy_image_device::default_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD(INS1771N1_TAG":1", jupiter_floppies, NULL, floppy_image_device::default_floppy_formats)
@@ -259,7 +259,7 @@ static MACHINE_CONFIG_START( jupiter3, jupiter3_state )
MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
// devices
- MCFG_DEVICE_ADD(INS1771N1_TAG, FD1771x, 1000000)
+ MCFG_DEVICE_ADD(INS1771N1_TAG, FD1771, 1000000)
MCFG_FLOPPY_DRIVE_ADD(INS1771N1_TAG":0", jupiter_floppies, "525ssdd", floppy_image_device::default_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD(INS1771N1_TAG":1", jupiter_floppies, NULL, floppy_image_device::default_floppy_formats)
diff --git a/src/mess/drivers/kaypro.c b/src/mess/drivers/kaypro.c
index 923fb65c0a7..a6a82c0f166 100644
--- a/src/mess/drivers/kaypro.c
+++ b/src/mess/drivers/kaypro.c
@@ -241,7 +241,7 @@ static MACHINE_CONFIG_START( kayproii, kaypro_state )
MCFG_Z80SIO0_ADD("z80sio", XTAL_20MHz / 8, 0, 0, 0, 0)
MCFG_Z80DART_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
- MCFG_FD1793x_ADD("fdc", XTAL_20MHz / 20)
+ MCFG_FD1793_ADD("fdc", XTAL_20MHz / 20)
MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(kaypro_state, fdc_intrq_w))
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(kaypro_state, fdc_drq_w))
MCFG_WD_FDC_FORCE_READY
@@ -304,7 +304,7 @@ static MACHINE_CONFIG_START( kaypro2x, kaypro_state )
MCFG_Z80SIO0_ADD("z80sio_2x", XTAL_16MHz / 4, 0, 0, 0, 0) /* extra sio for modem and printer */
MCFG_Z80DART_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
MCFG_DEVICE_ADD("brg", COM8116, XTAL_5_0688MHz) // WD1943, SMC8116
- MCFG_FD1793x_ADD("fdc", XTAL_16MHz / 16)
+ MCFG_FD1793_ADD("fdc", XTAL_16MHz / 16)
MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(kaypro_state, fdc_intrq_w))
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(kaypro_state, fdc_drq_w))
MCFG_WD_FDC_FORCE_READY
diff --git a/src/mess/drivers/lisa.c b/src/mess/drivers/lisa.c
index e851ae42eaa..3bba439d0bc 100644
--- a/src/mess/drivers/lisa.c
+++ b/src/mess/drivers/lisa.c
@@ -1,4 +1,4 @@
-// license:???
+// license:GPL-2.0+
// copyright-holders:Raphael Nabet
/*********************************************************************
diff --git a/src/mess/drivers/m20.c b/src/mess/drivers/m20.c
index 12b2a212a56..e60bb918de4 100644
--- a/src/mess/drivers/m20.c
+++ b/src/mess/drivers/m20.c
@@ -47,10 +47,10 @@ E I1 Vectored interrupt error
#include "machine/pit8253.h"
#include "machine/pic8259.h"
#include "formats/m20_dsk.h"
-
-#include "machine/keyboard.h"
-
-#define KEYBOARD_TAG "keyboard"
+#include "formats/pc_dsk.h"
+#include "machine/m20_kbd.h"
+#include "bus/rs232/rs232.h"
+#include "machine/m20_8086.h"
class m20_state : public driver_device
{
@@ -66,6 +66,7 @@ public:
m_fd1797(*this, "fd1797"),
m_floppy0(*this, "fd1797:0:5dd"),
m_floppy1(*this, "fd1797:1:5dd"),
+ m_apb(*this, "apb"),
m_p_videoram(*this, "p_videoram"),
m_palette(*this, "palette")
{
@@ -80,6 +81,7 @@ public:
required_device<fd1797_t> m_fd1797;
required_device<floppy_image_device> m_floppy0;
required_device<floppy_image_device> m_floppy1;
+ optional_device<m20_8086_device> m_apb;
required_shared_ptr<UINT16> m_p_videoram;
required_device<palette_device> m_palette;
@@ -91,29 +93,20 @@ public:
DECLARE_WRITE16_MEMBER(m20_i8259_w);
DECLARE_READ16_MEMBER(port21_r);
DECLARE_WRITE16_MEMBER(port21_w);
- DECLARE_WRITE_LINE_MEMBER(pic_irq_line_w);
DECLARE_WRITE_LINE_MEMBER(tty_clock_tick_w);
DECLARE_WRITE_LINE_MEMBER(kbd_clock_tick_w);
DECLARE_WRITE_LINE_MEMBER(timer_tick_w);
- DECLARE_WRITE_LINE_MEMBER(kbd_tx);
- DECLARE_WRITE8_MEMBER(kbd_put);
+ DECLARE_WRITE_LINE_MEMBER(halt_apb_w);
+ DECLARE_WRITE_LINE_MEMBER(int_w);
+ MC6845_UPDATE_ROW(update_row);
private:
- bool m_kbrecv_in_progress;
- int m_kbrecv_bitcount;
offs_t m_memsize;
- UINT16 m_kbrecv_data;
UINT8 m_port21;
void install_memory();
public:
- DECLARE_DRIVER_INIT(m20);
- virtual void video_start();
- UINT32 screen_update_m20(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
- DECLARE_WRITE_LINE_MEMBER(kbd_rxrdy_int);
-
DECLARE_FLOPPY_FORMATS( floppy_formats );
-
IRQ_CALLBACK_MEMBER(m20_irq_callback);
};
@@ -122,71 +115,25 @@ public:
#define PIXEL_CLOCK XTAL_4_433619MHz
-void m20_state::video_start()
+MC6845_UPDATE_ROW( m20_state::update_row )
{
-}
-
-UINT32 m20_state::screen_update_m20(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
-{
- int x,y,i;
- UINT8 pen;
- UINT32 count;
-
- bitmap.fill(m_palette->black_pen(), cliprect);
+ UINT32 *p = &bitmap.pix32(y);
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
+ int i, j;
- count = (0);
-
- for(y=0; y<256; y++)
+ for ( i = 0; i < x_count; i++ )
{
- for(x=0; x<512; x+=16)
- {
- for (i = 0; i < 16; i++)
- {
- pen = (m_p_videoram[count]) >> (15 - i) & 1;
-
- if (screen.visible_area().contains(x + i, y))
- bitmap.pix32(y, x + i) = m_palette->pen(pen);
- }
-
- count++;
- }
- }
- return 0;
-}
+ UINT16 offset = ((ma | (ra << 1)) << 4) + i;
+ UINT16 data = m_p_videoram[ offset ];
-/* TODO: correct hookup for keyboard, keyboard uses 8048 */
-
-WRITE_LINE_MEMBER(m20_state::kbd_tx)
-{
- UINT8 data;
-
- if (m_kbrecv_in_progress) {
- m_kbrecv_bitcount++;
- m_kbrecv_data = (m_kbrecv_data >> 1) | (state ? (1<<10) : 0);
- if (m_kbrecv_bitcount == 11) {
- data = (m_kbrecv_data >> 1) & 0xff;
-// printf ("0x%02X received by keyboard\n", data);
- switch (data) {
- case 0x03: m_kbdi8251->receive_character(2); printf ("sending 2 back from kb...\n"); break;
- case 0x0a: break;
- case 0x80: m_kbdi8251->receive_character(0x80); printf ("sending 0x80 back from kb...\n");break;
- default: logerror("m20: keyboard hack got unexpected %02x\n", data); break;
- }
- m_kbrecv_in_progress = 0;
- }
- }
- else
- {
- if (state == 0)
+ for ( j = 15; j >= 0; j-- )
{
- m_kbrecv_in_progress = 1;
- m_kbrecv_bitcount = 1;
- m_kbrecv_data = state ? (1<<10) : 0;
+ *p = palette[( data & 1 << j ) ? 1 : 0];
+ p++;
}
}
}
-
/*
port21 = 0x21 !TTL latch
! (see hw1 document, fig 2-33, pg 2-47)
@@ -253,20 +200,6 @@ WRITE16_MEMBER(m20_state::m20_i8259_w)
m_i8259->write(space, offset, (data>>1));
}
-WRITE_LINE_MEMBER( m20_state::pic_irq_line_w )
-{
- if (state)
- {
- //printf ("PIC raised VI\n");
- m_maincpu->set_input_line(1, ASSERT_LINE);
- }
- else
- {
- //printf ("PIC lowered VI\n");
- m_maincpu->set_input_line(1, CLEAR_LINE);
- }
-}
-
WRITE_LINE_MEMBER( m20_state::tty_clock_tick_w )
{
m_ttyi8251->write_txc(state);
@@ -289,7 +222,9 @@ WRITE_LINE_MEMBER( m20_state::timer_tick_w )
* 8253 is programmed in square wave mode, not rate
* generator mode.
*/
- m_maincpu->set_input_line(0, state ? HOLD_LINE /*ASSERT_LINE*/ : CLEAR_LINE);
+ if(m_apb)
+ m_apb->nvi_w(state);
+ m_maincpu->set_input_line(INPUT_LINE_IRQ0, state ? HOLD_LINE /*ASSERT_LINE*/ : CLEAR_LINE);
}
@@ -763,7 +698,9 @@ static ADDRESS_MAP_START(m20_io, AS_IO, 16, m20_state)
AM_RANGE(0x20, 0x21) AM_READWRITE(port21_r, port21_w);
AM_RANGE(0x60, 0x61) AM_DEVWRITE8("crtc", mc6845_device, address_w, 0x00ff)
+ AM_RANGE(0x62, 0x63) AM_DEVWRITE8("crtc", mc6845_device, address_w, 0xff00) // FIXME
AM_RANGE(0x62, 0x63) AM_DEVREADWRITE8("crtc", mc6845_device, register_r, register_w, 0x00ff)
+ AM_RANGE(0x64, 0x65) AM_DEVREADWRITE8("crtc", mc6845_device, register_r, register_w, 0xff00)
AM_RANGE(0x80, 0x87) AM_DEVREADWRITE8("ppi8255", i8255_device, read, write, 0x00ff)
@@ -777,31 +714,9 @@ static ADDRESS_MAP_START(m20_io, AS_IO, 16, m20_state)
AM_RANGE(0x140, 0x143) AM_READWRITE(m20_i8259_r, m20_i8259_w)
+ AM_RANGE(0x3ffa, 0x3ffd) AM_DEVWRITE("apb", m20_8086_device, handshake_w)
ADDRESS_MAP_END
-#if 0
-static ADDRESS_MAP_START(m20_apb_mem, AS_PROGRAM, 16, m20_state)
- ADDRESS_MAP_UNMAP_HIGH
- AM_RANGE( 0x00000, 0x007ff ) AM_RAM
- AM_RANGE( 0xf0000, 0xf7fff ) AM_RAM //mirrored?
- AM_RANGE( 0xfc000, 0xfffff ) AM_ROM AM_REGION("apb_bios",0)
-ADDRESS_MAP_END
-
-static ADDRESS_MAP_START(m20_apb_io, AS_IO, 16, m20_state)
- ADDRESS_MAP_UNMAP_HIGH
- ADDRESS_MAP_GLOBAL_MASK(0xff) // may not be needed
- //0x4060 crtc address
- //0x4062 crtc data
-ADDRESS_MAP_END
-#endif
-
-static INPUT_PORTS_START( m20 )
-INPUT_PORTS_END
-
-DRIVER_INIT_MEMBER(m20_state,m20)
-{
-}
-
IRQ_CALLBACK_MEMBER(m20_state::m20_irq_callback)
{
if (! irqline)
@@ -810,6 +725,13 @@ IRQ_CALLBACK_MEMBER(m20_state::m20_irq_callback)
return m_i8259->acknowledge();
}
+WRITE_LINE_MEMBER(m20_state::int_w)
+{
+ if(m_apb && !m_apb->halted())
+ m_apb->vi_w(state);
+ m_maincpu->set_input_line(INPUT_LINE_IRQ1, state ? ASSERT_LINE : CLEAR_LINE);
+}
+
void m20_state::machine_start()
{
install_memory();
@@ -825,56 +747,31 @@ void m20_state::machine_reset()
else
m_port21 = 0xff;
+ if(system_bios() > 0) // bits have different meanings?
+ m_port21 &= ~8;
+
m_fd1797->reset();
memcpy(RAM, ROM, 8); // we need only the reset vector
m_maincpu->reset(); // reset the CPU to ensure it picks up the new vector
+ if(m_apb)
+ m_apb->m_8086->set_input_line(INPUT_LINE_HALT, ASSERT_LINE);
}
-WRITE_LINE_MEMBER(m20_state::kbd_rxrdy_int)
-{
- m_i8259->ir4_w(state);
-}
-
-static unsigned char kbxlat[] =
-{
- 0x00, '\\', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
- 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3',
- '4', '5', '6', '7', '8', '9', '-', '^', '@', '[', ';', ':', ']', ',', '.', '/',
- 0x00, '<', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N',
- 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '_', '!', '"', '#',
- '$', '%', '&', '\'','(', ')', '=', 'x', 'x', '{', '+', '*', '}'
-};
-
-WRITE8_MEMBER( m20_state::kbd_put )
-{
- if (data) {
- if (data == 0xd) data = 0xc1;
- else if (data == 0x20) data = 0xc0;
- else if (data == 8) data = 0x69; /* ^H */
- else if (data == 3) data = 0x64; /* ^C */
- else {
- int i;
- for (i = 0; i < sizeof(kbxlat); i++)
- if (data == kbxlat[i]) {
- data = i;
- break;
- }
- }
- printf("kbd_put called with 0x%02X\n", data);
- m_kbdi8251->receive_character(data);
- }
-}
-
static SLOT_INTERFACE_START( m20_floppies )
SLOT_INTERFACE( "5dd", FLOPPY_525_DD )
SLOT_INTERFACE_END
FLOPPY_FORMATS_MEMBER( m20_state::floppy_formats )
- FLOPPY_M20_FORMAT
+ FLOPPY_M20_FORMAT,
+ FLOPPY_PC_FORMAT
FLOPPY_FORMATS_END
+static SLOT_INTERFACE_START(keyboard)
+ SLOT_INTERFACE("m20", M20_KEYBOARD)
+SLOT_INTERFACE_END
+
static MACHINE_CONFIG_START( m20, m20_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z8001, MAIN_CLOCK)
@@ -888,24 +785,17 @@ static MACHINE_CONFIG_START( m20, m20_state )
MCFG_RAM_DEFAULT_VALUE(0)
MCFG_RAM_EXTRA_OPTIONS("128K,192K,224K,256K,384K,512K")
-#if 0
- MCFG_CPU_ADD("apb", I8086, MAIN_CLOCK)
- MCFG_CPU_PROGRAM_MAP(m20_apb_mem)
- MCFG_CPU_IO_MAP(m20_apb_io)
- MCFG_DEVICE_DISABLE()
-#endif
-
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
MCFG_SCREEN_SIZE(512, 256)
MCFG_SCREEN_VISIBLE_AREA(0, 512-1, 0, 256-1)
- MCFG_SCREEN_UPDATE_DRIVER(m20_state, screen_update_m20)
+ MCFG_SCREEN_UPDATE_DEVICE("crtc", mc6845_device, screen_update)
MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
/* Devices */
- MCFG_FD1797x_ADD("fd1797", 1000000)
+ MCFG_FD1797_ADD("fd1797", 1000000)
MCFG_WD_FDC_INTRQ_CALLBACK(DEVWRITELINE("i8259", pic8259_device, ir0_w))
MCFG_FLOPPY_DRIVE_ADD("fd1797:0", m20_floppies, "5dd", m20_state::floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("fd1797:1", m20_floppies, "5dd", m20_state::floppy_formats)
@@ -913,12 +803,13 @@ static MACHINE_CONFIG_START( m20, m20_state )
MCFG_MC6845_ADD("crtc", MC6845, "screen", PIXEL_CLOCK/8) /* hand tuned to get ~50 fps */
MCFG_MC6845_SHOW_BORDER_AREA(false)
MCFG_MC6845_CHAR_WIDTH(16)
+ MCFG_MC6845_UPDATE_ROW_CB(m20_state, update_row)
MCFG_DEVICE_ADD("ppi8255", I8255A, 0)
MCFG_DEVICE_ADD("i8251_1", I8251, 0)
- MCFG_I8251_TXD_HANDLER(WRITELINE(m20_state, kbd_tx))
- MCFG_I8251_RXRDY_HANDLER(WRITELINE(m20_state, kbd_rxrdy_int))
+ MCFG_I8251_TXD_HANDLER(DEVWRITELINE("kbd", rs232_port_device, write_txd))
+ MCFG_I8251_RXRDY_HANDLER(DEVWRITELINE("i8259", pic8259_device, ir4_w))
MCFG_DEVICE_ADD("i8251_2", I8251, 0)
@@ -930,10 +821,12 @@ static MACHINE_CONFIG_START( m20, m20_state )
MCFG_PIT8253_CLK2(1230782)
MCFG_PIT8253_OUT2_HANDLER(WRITELINE(m20_state, timer_tick_w))
- MCFG_PIC8259_ADD("i8259", WRITELINE(m20_state, pic_irq_line_w), VCC, NULL)
+ MCFG_PIC8259_ADD("i8259", WRITELINE(m20_state, int_w), VCC, NULL)
+
+ MCFG_RS232_PORT_ADD("kbd", keyboard, "m20")
+ MCFG_RS232_RXD_HANDLER(DEVWRITELINE("i8251_1", i8251_device, write_rxd))
- MCFG_DEVICE_ADD(KEYBOARD_TAG, GENERIC_KEYBOARD, 0)
- MCFG_GENERIC_KEYBOARD_CB(WRITE8(m20_state, kbd_put))
+ MCFG_DEVICE_ADD("apb", M20_8086, 0)
MCFG_SOFTWARE_LIST_ADD("flop_list","m20")
MACHINE_CONFIG_END
@@ -963,5 +856,5 @@ ROM_START(m40)
ROM_END
/* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */
-COMP( 1981, m20, 0, 0, m20, m20, m20_state, m20, "Olivetti", "Olivetti L1 M20", GAME_NOT_WORKING | GAME_NO_SOUND)
-COMP( 1981, m40, m20, 0, m20, m20, m20_state, m20, "Olivetti", "Olivetti L1 M40", GAME_NOT_WORKING | GAME_NO_SOUND)
+COMP( 1981, m20, 0, 0, m20, 0, driver_device, 0, "Olivetti", "Olivetti L1 M20", GAME_NOT_WORKING | GAME_NO_SOUND)
+COMP( 1981, m40, m20, 0, m20, 0, driver_device, 0, "Olivetti", "Olivetti L1 M40", GAME_NOT_WORKING | GAME_NO_SOUND)
diff --git a/src/mess/drivers/mac.c b/src/mess/drivers/mac.c
index 65cdb2711ca..bc670603bdc 100644
--- a/src/mess/drivers/mac.c
+++ b/src/mess/drivers/mac.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Nathan Woods, Raphael Nabet, R. Belmont
/****************************************************************************
diff --git a/src/mess/drivers/mbc200.c b/src/mess/drivers/mbc200.c
index fc15fd4c9ca..5c9ee51937a 100644
--- a/src/mess/drivers/mbc200.c
+++ b/src/mess/drivers/mbc200.c
@@ -41,8 +41,7 @@
#include "machine/i8255.h"
#include "machine/i8251.h"
#include "video/mc6845.h"
-//#include "machine/wd_fdc.h"
-#include "machine/wd17xx.h"
+#include "machine/wd_fdc.h"
class mbc200_state : public driver_device
@@ -56,14 +55,13 @@ public:
, m_vram(*this, "vram")
, m_maincpu(*this, "maincpu")
, m_fdc(*this, "fdc")
- //, m_floppy0(*this, "fdc:0")
- //, m_floppy1(*this, "fdc:1")
- , m_floppy0(*this, FLOPPY_0)
- , m_floppy1(*this, FLOPPY_1)
+ , m_floppy0(*this, "fdc:0")
+ , m_floppy1(*this, "fdc:1")
{ }
DECLARE_READ8_MEMBER(p2_porta_r);
DECLARE_WRITE8_MEMBER(pm_porta_w);
+ DECLARE_WRITE8_MEMBER(pm_portb_w);
MC6845_UPDATE_ROW(update_row);
required_device<palette_device> m_palette;
@@ -75,12 +73,9 @@ private:
required_device<i8255_device> m_ppi_m;
required_shared_ptr<UINT8> m_vram;
required_device<cpu_device> m_maincpu;
- //required_device<mb8876_t> m_fdc;
- //required_device<floppy_connector> m_floppy0;
- //required_device<floppy_connector> m_floppy1;
- required_device<mb8876_device> m_fdc;
- required_device<legacy_floppy_image_device> m_floppy0;
- required_device<legacy_floppy_image_device> m_floppy1;
+ required_device<mb8876_t> m_fdc;
+ required_device<floppy_connector> m_floppy0;
+ required_device<floppy_connector> m_floppy1;
};
@@ -97,13 +92,32 @@ WRITE8_MEMBER( mbc200_state::pm_porta_w )
m_comm_latch = data; // to slave CPU
}
+WRITE8_MEMBER( mbc200_state::pm_portb_w )
+{
+ floppy_image_device *floppy = NULL;
+
+ // to be verified
+ switch (data & 0x01)
+ {
+ case 0: floppy = m_floppy0->get_device(); break;
+ case 1: floppy = m_floppy1->get_device(); break;
+ }
+
+ m_fdc->set_floppy(floppy);
+
+ if (floppy)
+ {
+ floppy->mon_w(0);
+ floppy->ss_w(BIT(data, 7));
+ }
+}
+
static ADDRESS_MAP_START( mbc200_io , AS_IO, 8, mbc200_state)
ADDRESS_MAP_UNMAP_HIGH
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0xe0, 0xe0) AM_DEVREADWRITE("i8251_1", i8251_device, data_r, data_w)
AM_RANGE(0xe1, 0xe1) AM_DEVREADWRITE("i8251_1", i8251_device, status_r, control_w)
- //AM_RANGE(0xe4, 0xe7) AM_DEVREADWRITE("fdc", mb8876_t, read, write)
- AM_RANGE(0xe4, 0xe7) AM_DEVREADWRITE("fdc", mb8876_device, read, write)
+ AM_RANGE(0xe4, 0xe7) AM_DEVREADWRITE("fdc", mb8876_t, read, write)
AM_RANGE(0xe8, 0xeb) AM_DEVREADWRITE("ppi_m", i8255_device, read, write)
AM_RANGE(0xec, 0xec) AM_DEVREADWRITE("i8251_2", i8251_device, data_r, data_w)
AM_RANGE(0xed, 0xed) AM_DEVREADWRITE("i8251_2", i8251_device, status_r, control_w)
@@ -142,18 +156,6 @@ INPUT_PORTS_END
void mbc200_state::machine_start()
{
-// floppy_image_device *floppy = NULL;
-// floppy = m_floppy0->get_device();
-// floppy1 not supported currently
-// m_fdc->set_floppy(floppy);
-
-// if (floppy)
-// floppy->mon_w(0);
-
- m_floppy0->floppy_mon_w(0);
- m_floppy1->floppy_mon_w(0);
- m_floppy0->floppy_drive_set_ready_state(1, 1);
- m_floppy1->floppy_drive_set_ready_state(1, 1);
}
void mbc200_state::machine_reset()
@@ -163,16 +165,9 @@ void mbc200_state::machine_reset()
memcpy(main, roms, 0x1000);
}
-static const floppy_interface mbc200_floppy_interface =
-{
- FLOPPY_STANDARD_5_25_SSDD_40,
- LEGACY_FLOPPY_OPTIONS_NAME(default),
- "floppy_5_25"
-};
-
-//static SLOT_INTERFACE_START( mbc200_floppies )
-// SLOT_INTERFACE( "525dd", FLOPPY_525_SSDD )
-//SLOT_INTERFACE_END
+static SLOT_INTERFACE_START( mbc200_floppies )
+ SLOT_INTERFACE("qd", FLOPPY_525_QD )
+SLOT_INTERFACE_END
MC6845_UPDATE_ROW( mbc200_state::update_row )
{
@@ -244,16 +239,14 @@ static MACHINE_CONFIG_START( mbc200, mbc200_state )
MCFG_DEVICE_ADD("ppi_m", I8255, 0)
MCFG_I8255_OUT_PORTA_CB(WRITE8(mbc200_state, pm_porta_w))
+ MCFG_I8255_OUT_PORTB_CB(WRITE8(mbc200_state, pm_portb_w))
MCFG_DEVICE_ADD("i8251_1", I8251, 0) // INS8251N
MCFG_DEVICE_ADD("i8251_2", I8251, 0) // INS8251A
- //MCFG_MB8876x_ADD("fdc", 1000000) // guess
- //MCFG_FLOPPY_DRIVE_ADD("fdc:0", mbc200_floppies, "525dd", floppy_image_device::default_floppy_formats)
- //MCFG_FLOPPY_DRIVE_ADD("fdc:1", mbc200_floppies, "525dd", floppy_image_device::default_floppy_formats)
- MCFG_DEVICE_ADD("fdc", MB8876, 0) // MB8876A
- MCFG_WD17XX_DEFAULT_DRIVE2_TAGS
- MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(mbc200_floppy_interface)
+ MCFG_MB8876_ADD("fdc", XTAL_8MHz / 8) // guess
+ MCFG_FLOPPY_DRIVE_ADD("fdc:0", mbc200_floppies, "qd", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("fdc:1", mbc200_floppies, "qd", floppy_image_device::default_floppy_formats)
/* software lists */
MCFG_SOFTWARE_LIST_ADD("flop_list", "mbc200")
diff --git a/src/mess/drivers/mbc55x.c b/src/mess/drivers/mbc55x.c
index 7c3017d0544..d5b1c2b7a06 100644
--- a/src/mess/drivers/mbc55x.c
+++ b/src/mess/drivers/mbc55x.c
@@ -32,12 +32,6 @@ const unsigned char mbc55x_palette[SCREEN_NO_COLOURS][3] =
{ 0x80,0x80,0x80 }, /* light grey */
};
-static const floppy_interface mbc55x_floppy_interface =
-{
- FLOPPY_STANDARD_5_25_DSSD_35,
- LEGACY_FLOPPY_OPTIONS_NAME(pc),
- "floppy_5_25"
-};
static ADDRESS_MAP_START(mbc55x_mem, AS_PROGRAM, 8, mbc55x_state)
AM_RANGE( 0x00000, 0x0FFFF ) AM_RAMBANK(RAM_BANK00_TAG)
@@ -224,6 +218,23 @@ PALETTE_INIT_MEMBER(mbc55x_state, mbc55x)
}
+FLOPPY_FORMATS_MEMBER( mbc55x_state::floppy_formats )
+ FLOPPY_PC_FORMAT
+FLOPPY_FORMATS_END
+
+
+// MBC-550 : 1 x 5.25" disk-drive (160 KB)
+// MBC-555 : 2 x 5.25" disk-drive (160 KB)
+// MBC-555-2 : 2 x 5.25" disk-drive (360 KB)
+// MBC-555-3 : 2 x 5.25" disk-drive (720 KB)
+
+static SLOT_INTERFACE_START( mbc55x_floppies )
+ SLOT_INTERFACE("ssdd", FLOPPY_525_SSDD)
+ SLOT_INTERFACE("dd", FLOPPY_525_DD)
+ SLOT_INTERFACE("qd", FLOPPY_525_QD)
+SLOT_INTERFACE_END
+
+
static MACHINE_CONFIG_START( mbc55x, mbc55x_state )
/* basic machine hardware */
MCFG_CPU_ADD(MAINCPU_TAG, I8088, 3600000)
@@ -281,13 +292,12 @@ static MACHINE_CONFIG_START( mbc55x, mbc55x_state )
MCFG_MC6845_OUT_HSYNC_CB(WRITELINE(mbc55x_state, vid_vsync_changed))
/* Backing storage */
- MCFG_DEVICE_ADD(FDC_TAG, FD1793, 0)
- MCFG_WD17XX_DEFAULT_DRIVE4_TAGS
- MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(mbc55x_state, mbc55x_fdc_intrq_w))
- MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(mbc55x_state, mbc55x_fdc_drq_w))
- MCFG_WD17XX_DDEN_CALLBACK(GND)
+ MCFG_FD1793_ADD(FDC_TAG, XTAL_1MHz)
- MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(mbc55x_floppy_interface)
+ MCFG_FLOPPY_DRIVE_ADD(FDC_TAG ":0", mbc55x_floppies, "qd", mbc55x_state::floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD(FDC_TAG ":1", mbc55x_floppies, "qd", mbc55x_state::floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD(FDC_TAG ":2", mbc55x_floppies, "", mbc55x_state::floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD(FDC_TAG ":3", mbc55x_floppies, "", mbc55x_state::floppy_formats)
/* Software list */
MCFG_SOFTWARE_LIST_ADD("disk_list","mbc55x")
diff --git a/src/mess/drivers/mbee.c b/src/mess/drivers/mbee.c
index 2408b59c4de..7d40de85c95 100644
--- a/src/mess/drivers/mbee.c
+++ b/src/mess/drivers/mbee.c
@@ -1,15 +1,15 @@
-// license:GPL-2.0+
-// copyright-holders:Juergen Buchmueller, Robbbert
+// license:BSD-3-Clause
+// copyright-holders:Robbbert
/***************************************************************************
- microbee.c
- system driver
- Juergen Buchmueller, Jan 2000
- Robbbert 2008-2015
+Driver completely rewritten by Robbbert, in a process begun on 2009-02-24.
+Assistance/advice was gratefully received from:
+ E.J.Wordsworth (owner of Microbee Systems), nama, ChickenMan,
+ and the author of the "ubee512" emulator.
+
+Previous driver was written by Juergen Buchmueller, Jan 2000 with assistance
+from Brett Selwood and Andrew Davies.
- Assistance from:
- Brett Selwood, Andrew Davies; E.J.Wordsworth (owner of Microbee Systems),
- nama, ChickenMan, and the author of the "ubee512" emulator.
Keyboard notes are in video/microbee.c
@@ -762,7 +762,7 @@ static MACHINE_CONFIG_DERIVED( mbee56, mbeeic )
MCFG_CPU_PROGRAM_MAP(mbee56_mem)
MCFG_CPU_IO_MAP(mbee56_io)
MCFG_MACHINE_RESET_OVERRIDE(mbee_state, mbee56)
- MCFG_WD2793x_ADD("fdc", XTAL_4MHz / 2)
+ MCFG_WD2793_ADD("fdc", XTAL_4MHz / 2)
MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(mbee_state, fdc_intrq_w))
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(mbee_state, fdc_drq_w))
MCFG_WD_FDC_ENMF_CALLBACK(GND)
@@ -784,7 +784,7 @@ static MACHINE_CONFIG_DERIVED( mbee128p, mbeeppc )
MCFG_CPU_PROGRAM_MAP(mbee256_mem)
MCFG_CPU_IO_MAP(mbee128_io)
MCFG_MACHINE_RESET_OVERRIDE(mbee_state, mbee128)
- MCFG_WD2793x_ADD("fdc", XTAL_4MHz / 2)
+ MCFG_WD2793_ADD("fdc", XTAL_4MHz / 2)
MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(mbee_state, fdc_intrq_w))
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(mbee_state, fdc_drq_w))
MCFG_WD_FDC_ENMF_CALLBACK(GND)
diff --git a/src/mess/drivers/mirage.c b/src/mess/drivers/mirage.c
index 14b6868c637..dc39d620897 100644
--- a/src/mess/drivers/mirage.c
+++ b/src/mess/drivers/mirage.c
@@ -229,7 +229,7 @@ static MACHINE_CONFIG_START( mirage, mirage_state )
MCFG_DEVICE_ADD("acia6850", ACIA6850, 0)
MCFG_ACIA6850_IRQ_HANDLER(DEVWRITELINE("maincpu", m6809e_device, firq_line))
- MCFG_WD1772x_ADD("wd1772", 8000000)
+ MCFG_WD1772_ADD("wd1772", 8000000)
MCFG_WD_FDC_INTRQ_CALLBACK(INPUTLINE("maincpu", INPUT_LINE_NMI))
MCFG_WD_FDC_DRQ_CALLBACK(INPUTLINE("maincpu", M6809_IRQ_LINE))
diff --git a/src/mess/drivers/monty.c b/src/mess/drivers/monty.c
index 256e01de83e..42172a6c357 100644
--- a/src/mess/drivers/monty.c
+++ b/src/mess/drivers/monty.c
@@ -19,14 +19,19 @@
by adding chips and wires to the inside of the game.
TODO:
- - Input from the keyboard
+ - Need instructions
- Proper SED1503F emulation (it's simulated in-driver for now)
+ - After each keypress it hits a HALT instruction. I guess the controller's
+ sync pin is involved somehow.
+ - When it wants tiles, put 64 into FD1B (monty), 7D1B (mmonty) and press
+ Enter.
****************************************************************************/
#include "emu.h"
#include "cpu/z80/z80.h"
#include "video/sed1520.h"
+#include "sound/speaker.h"
class monty_state : public driver_device
@@ -35,6 +40,7 @@ public:
monty_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag)
, m_maincpu(*this, "maincpu")
+ , m_speaker(*this, "speaker")
, m_sed0(*this, "sed1520_0")
, m_writeUpper(false)
{
@@ -42,78 +48,130 @@ public:
m_pixels[i] = 0xff000000;
}
- DECLARE_READ8_MEMBER(ioInputRead);
-
- DECLARE_WRITE8_MEMBER(ioDisplayWrite);
- DECLARE_WRITE8_MEMBER(ioCommandWrite0);
- DECLARE_WRITE8_MEMBER(ioCommandWrite1);
+ DECLARE_WRITE8_MEMBER(sound_w);
+ DECLARE_WRITE8_MEMBER(ioDisplayWrite_w);
+ DECLARE_WRITE8_MEMBER(ioCommandWrite0_w);
+ DECLARE_WRITE8_MEMBER(ioCommandWrite1_w);
// screen updates
UINT32 lcd_update(screen_device& screen, bitmap_rgb32& bitmap, const rectangle& cliprect);
private:
required_device<cpu_device> m_maincpu;
+ required_device<speaker_sound_device> m_speaker;
required_device<sed1520_device> m_sed0; // TODO: This isn't actually a SED1520, it's a SED1503F
//required_device<sed1520_device> m_sed1; // TODO: Also, there are 2 SED1503Fs on the board - one is flipped upside down
// Test
UINT8 m_writeUpper;
UINT32 m_pixels[42*32];
+ bool m_sound_sw;
+ bool m_dirty;
};
-static ADDRESS_MAP_START(monty_mem, AS_PROGRAM, 8, monty_state)
- AM_RANGE(0x0000, 0x3fff) AM_ROM
+static ADDRESS_MAP_START( monty_mem, AS_PROGRAM, 8, monty_state )
+ AM_RANGE(0x0000, 0xbfff) AM_ROM
//AM_RANGE(0x4000, 0x4000) // The main rom checks to see if another program is here on startup
AM_RANGE(0xf800, 0xffff) AM_RAM
ADDRESS_MAP_END
+static ADDRESS_MAP_START( mmonty_mem, AS_PROGRAM, 8, monty_state )
+ AM_RANGE(0x0000, 0x3fff) AM_ROM
+ //AM_RANGE(0xc000, 0xc000) // The main rom checks to see if another program is here on startup
+ AM_RANGE(0x8000, 0xffff) AM_ROM
+ AM_RANGE(0x7800, 0x7fff) AM_RAM
+ADDRESS_MAP_END
+
-static ADDRESS_MAP_START(monty_io, AS_IO, 8, monty_state)
+static ADDRESS_MAP_START( monty_io, AS_IO, 8, monty_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x00, 0x00) AM_WRITE(ioCommandWrite0)
- AM_RANGE(0x02, 0x02) AM_WRITE(ioCommandWrite1)
- AM_RANGE(0x80, 0xff) AM_WRITE(ioDisplayWrite)
+ AM_RANGE(0x00, 0x00) AM_WRITE(ioCommandWrite0_w)
+ AM_RANGE(0x01, 0x01) AM_WRITE(sound_w)
+ AM_RANGE(0x02, 0x02) AM_WRITE(ioCommandWrite1_w)
+ AM_RANGE(0x80, 0xff) AM_WRITE(ioDisplayWrite_w)
// 7 reads from a bit shifted IO port
- AM_RANGE(0x01, 0x01) AM_READ(ioInputRead)
- AM_RANGE(0x02, 0x02) AM_READ(ioInputRead)
- AM_RANGE(0x04, 0x04) AM_READ(ioInputRead)
- AM_RANGE(0x08, 0x08) AM_READ(ioInputRead)
- AM_RANGE(0x10, 0x10) AM_READ(ioInputRead)
- AM_RANGE(0x20, 0x20) AM_READ(ioInputRead)
- AM_RANGE(0x40, 0x40) AM_READ(ioInputRead)
+ AM_RANGE(0x01, 0x01) AM_READ_PORT("X1")
+ AM_RANGE(0x02, 0x02) AM_READ_PORT("X2")
+ AM_RANGE(0x04, 0x04) AM_READ_PORT("X3")
+ AM_RANGE(0x08, 0x08) AM_READ_PORT("X4")
+ AM_RANGE(0x10, 0x10) AM_READ_PORT("X5")
+ AM_RANGE(0x20, 0x20) AM_READ_PORT("X6")
+ AM_RANGE(0x40, 0x40) AM_READ_PORT("X7")
ADDRESS_MAP_END
// Input ports
static INPUT_PORTS_START( monty )
+ PORT_START("X1")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Return") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13)
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Left") PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8)
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Space") PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ')
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("-") PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-')
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Z") PORT_CODE(KEYCODE_Z) PORT_CHAR('Z')
+ PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
+
+ PORT_START("X2")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Y") PORT_CODE(KEYCODE_Y) PORT_CHAR('Y')
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("X") PORT_CODE(KEYCODE_X) PORT_CHAR('X')
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("W") PORT_CODE(KEYCODE_W) PORT_CHAR('W')
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("V") PORT_CODE(KEYCODE_V) PORT_CHAR('V')
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("U") PORT_CODE(KEYCODE_U) PORT_CHAR('U')
+ PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
+
+ PORT_START("X3")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("T") PORT_CODE(KEYCODE_T) PORT_CHAR('T')
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("S") PORT_CODE(KEYCODE_S) PORT_CHAR('S')
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("R") PORT_CODE(KEYCODE_R) PORT_CHAR('R')
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Q") PORT_CODE(KEYCODE_Q) PORT_CHAR('Q')
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("P") PORT_CODE(KEYCODE_P) PORT_CHAR('P')
+ PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
+
+ PORT_START("X4")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("O") PORT_CODE(KEYCODE_O) PORT_CHAR('O')
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("N") PORT_CODE(KEYCODE_N) PORT_CHAR('N')
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("M") PORT_CODE(KEYCODE_M) PORT_CHAR('M')
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("L") PORT_CODE(KEYCODE_L) PORT_CHAR('L')
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("K") PORT_CODE(KEYCODE_K) PORT_CHAR('K')
+ PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
+
+ PORT_START("X5")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("J") PORT_CODE(KEYCODE_J) PORT_CHAR('J')
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("I") PORT_CODE(KEYCODE_I) PORT_CHAR('I')
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("H") PORT_CODE(KEYCODE_H) PORT_CHAR('H')
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("G") PORT_CODE(KEYCODE_G) PORT_CHAR('G')
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F") PORT_CODE(KEYCODE_F) PORT_CHAR('F')
+ PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
+
+ PORT_START("X6")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("E") PORT_CODE(KEYCODE_E) PORT_CHAR('E')
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("D") PORT_CODE(KEYCODE_D) PORT_CHAR('D')
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("C") PORT_CODE(KEYCODE_C) PORT_CHAR('C')
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("B") PORT_CODE(KEYCODE_B) PORT_CHAR('B')
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("A") PORT_CODE(KEYCODE_A) PORT_CHAR('A')
+ PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
+
+ PORT_START("X7")
+ PORT_BIT( 0xFF, IP_ACTIVE_LOW, IPT_UNUSED )
INPUT_PORTS_END
-READ8_MEMBER( monty_state::ioInputRead )
+WRITE8_MEMBER( monty_state::sound_w )
{
- //UINT8 foo; // = machine().rand() & 0xff;
- //if (m_maincpu->pc() == 0x135f)
- // foo = 0x14;
- //if (m_maincpu->pc() == 0x1371)
- // foo = 0x1f;
-
- UINT8 foo = (machine().rand() & 0xff) | 0x14;
-
- //printf("(%04x) %02x %02x\n", m_maincpu->pc(), foo, (foo & 0x14));
- return foo;
+ m_sound_sw ^= 1;
+ m_speaker->level_w(m_sound_sw);
}
-WRITE8_MEMBER( monty_state::ioCommandWrite0 )
+WRITE8_MEMBER( monty_state::ioCommandWrite0_w )
{
//printf("(%04x) Command Port 0 write : %02x\n", m_maincpu->pc(), data);
m_writeUpper = false;
}
-WRITE8_MEMBER( monty_state::ioCommandWrite1 )
+WRITE8_MEMBER( monty_state::ioCommandWrite1_w )
{
//if (data == 0xfe)
// printf("---\n");
@@ -123,42 +181,49 @@ WRITE8_MEMBER( monty_state::ioCommandWrite1 )
}
-WRITE8_MEMBER( monty_state::ioDisplayWrite )
+WRITE8_MEMBER( monty_state::ioDisplayWrite_w )
{
+ m_dirty = true;
// Offset directly corresponds to sed1503, DD RAM address (offset 0x7f may be special?)
//printf("(%04x) %02x %02x\n", m_maincpu->pc(), offset, data);
- const UINT8 localUpper = (offset & 0x40) >> 6;
- const UINT8 seg = offset & 0x3f;
- const UINT8 com = data;
+ UINT8 x = offset & 0x3f;
+ UINT8 y = (BIT(offset, 6) + (m_writeUpper ? 2 : 0)) << 3;
// Skip the controller and write straight to the LCD (pc=134f)
for (int i = 0; i < 8; i++)
{
- // Pixel location
- const int upperSedOffset = m_writeUpper ? 8*2 : 0;
-
- const size_t x = seg;
- const size_t y = i + (localUpper*8) + upperSedOffset;
-
// Pixel color
- const bool on = (com >> i) & 0x01;
- m_pixels[(y*42) + x] = on ? 0xffffffff : 0xff000000;
+ if (x < 42)
+ m_pixels[(y*42) + x] = BIT(data, i) ? 0xffffffff : 0xff000000;
+
+ y++;
}
}
UINT32 monty_state::lcd_update(screen_device& screen, bitmap_rgb32& bitmap, const rectangle& cliprect)
{
- for (int y = 0; y < 32; y++)
+ if (!m_dirty)
+ return 1;
+
+ UINT8 x,y,z;
+ m_dirty = false;
+ for (y = 0; y < 32; y++)
{
- for (int x = 0; x < 42; x++)
+ for (z = 0; z < 8; z++)
{
- bitmap.pix32(y, x) = m_pixels[(y*42) + x];
+ for (x = 0; x < 5; x++)
+ {
+ bitmap.pix32(y, x+z*6) = m_pixels[y*42 + z*5 + x];
+ }
+ bitmap.pix32(y, 5+z*6) = 0; // space between letters
}
+ bitmap.pix32(y, 48) = m_pixels[y*42 + 40];
+ bitmap.pix32(y, 49) = m_pixels[y*42 + 41];
}
- return 0x00;
+ return 0;
}
@@ -180,14 +245,24 @@ static MACHINE_CONFIG_START( monty, monty_state )
MCFG_SCREEN_ADD("screen", LCD)
MCFG_SCREEN_REFRESH_RATE(50)
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) // Not accurate
- MCFG_SCREEN_SIZE(42, 32) // Two SED1503s (42x16 pixels) control the top and bottom halves
- MCFG_SCREEN_VISIBLE_AREA(0, 42-1, 0, 32-1)
+ MCFG_SCREEN_SIZE(50, 32) // Two SED1503s (42x16 pixels) control the top and bottom halves
+ MCFG_SCREEN_VISIBLE_AREA(0, 50-1, 0, 32-1)
MCFG_SCREEN_UPDATE_DRIVER(monty_state, lcd_update)
+ /* sound hardware */
+ MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+
// LCD controller interfaces
MCFG_SED1520_ADD("sed1520_0", monty_screen_update)
MACHINE_CONFIG_END
+static MACHINE_CONFIG_DERIVED( mmonty, monty )
+ MCFG_CPU_MODIFY( "maincpu" )
+ MCFG_CPU_PROGRAM_MAP(mmonty_mem)
+MACHINE_CONFIG_END
+
// ROM definitions
ROM_START( monty )
@@ -195,6 +270,7 @@ ROM_START( monty )
ROM_LOAD( "monty_main.bin", 0x0000, 0x4000, CRC(720b4f55) SHA1(0106eb88d3fbbf25a745b9b6ee785ba13689d095) ) // 27128
ROM_LOAD( "monty_module1.bin", 0x4000, 0x4000, CRC(2725d8c3) SHA1(8273b9779c0915f9c7c43ea4fb460f43ce036358) ) // 27128
ROM_LOAD( "monty_module2.bin", 0x8000, 0x4000, CRC(db672e47) SHA1(bb14fe86df06cfa4b19625ba417d1a5bc8eae155) ) // 27128
+ ROM_FILL(0x1193,1,0) // patch out HALT so we can type in our names
ROM_END
ROM_START( mmonty )
@@ -202,10 +278,11 @@ ROM_START( mmonty )
ROM_LOAD( "master_monty_main.bin", 0x0000, 0x8000, CRC(bb5ef4d4) SHA1(ba2c759e429f8740df419f9abb60832eddfba8ab) ) // 27C256
ROM_LOAD( "monty_module1.bin", 0x8000, 0x4000, CRC(2725d8c3) SHA1(8273b9779c0915f9c7c43ea4fb460f43ce036358) ) // 27128
ROM_LOAD( "monty_module2.bin", 0xc000, 0x4000, CRC(db672e47) SHA1(bb14fe86df06cfa4b19625ba417d1a5bc8eae155) ) // 27128
+ ROM_FILL(0x1487,1,0) // patch out HALT so we can type in our names
ROM_END
// Drivers
// YEAR NAME PARENT COMPAT MACHINE INPUT STATE INIT COMPANY FULLNAME FLAGS
-COMP( 1980, monty, 0, 0, monty, monty, driver_device, 0, "Ritam", "Monty Plays Scrabble", GAME_IS_SKELETON )
-COMP( 1980, mmonty, 0, 0, monty, monty, driver_device, 0, "Ritam", "Master Monty", GAME_IS_SKELETON )
+COMP( 1980, monty, 0, 0, monty, monty, driver_device, 0, "Ritam", "Monty Plays Scrabble", GAME_NOT_WORKING )
+COMP( 1982, mmonty, 0, 0, mmonty, monty, driver_device, 0, "Ritam", "Master Monty", GAME_NOT_WORKING )
diff --git a/src/mess/drivers/ms0515.c b/src/mess/drivers/ms0515.c
index c677c1656db..54086c019db 100644
--- a/src/mess/drivers/ms0515.c
+++ b/src/mess/drivers/ms0515.c
@@ -134,16 +134,8 @@ void ms0515_state::machine_reset()
/* Input ports */
static INPUT_PORTS_START( ms0515 )
INPUT_PORTS_END
-/*
-static LEGACY_FLOPPY_OPTIONS_START(ms0515)
- LEGACY_FLOPPY_OPTION(ms0515, "dsk", "MS0515 disk image", basicdsk_identify_default, basicdsk_construct_default, NULL,
- HEADS([1])
- TRACKS([80])
- SECTORS([10])
- SECTOR_LENGTH([512])
- FIRST_SECTOR_ID([0]))
-LEGACY_FLOPPY_OPTIONS_END
-*/
+
+// disk format: 80 tracks, 1 head, 10 sectors, 512 bytes sector length, first sector id 0
static SLOT_INTERFACE_START( ms0515_floppies )
SLOT_INTERFACE( "525qd", FLOPPY_525_QD ) // 720 KB
@@ -228,7 +220,7 @@ static MACHINE_CONFIG_START( ms0515, ms0515_state )
MCFG_T11_INITIAL_MODE(0xf2ff)
MCFG_CPU_PROGRAM_MAP(ms0515_mem)
- MCFG_DEVICE_ADD("vg93", FD1793x, 1000000)
+ MCFG_DEVICE_ADD("vg93", FD1793, 1000000)
MCFG_FLOPPY_DRIVE_ADD("vg93:0", ms0515_floppies, "525qd", floppy_image_device::default_floppy_formats)
/* video hardware */
diff --git a/src/mess/drivers/msx.c b/src/mess/drivers/msx.c
index 063b022b835..56c10c6c865 100644
--- a/src/mess/drivers/msx.c
+++ b/src/mess/drivers/msx.c
@@ -23,6 +23,7 @@
**
** Todo/known issues:
** - piopx7/piopx7uk/piopxv60: Laserdisc integration doesn't exist
+** - piopx7: Is this a pal or an ntsc machine?
** - spc800: Haven't been able to test operation of the han rom yet
** - svi728: Expansion slot not emulated
** - svi738: v9938 not emulated
@@ -79,6 +80,13 @@
** - cpg120: Remove ports
** - cpg120: Add V9958
**
+** TODO:
+** - Add T6950 support. T6950 is selectable between pal and ntsc by a pin.
+**
+** Possibly missing machines:
+** - Sanyo MPC-1 (T6950)
+** - Toshibo HX-51i (T7937)
+** - Sony HB-101 (TMS9118)
************************************************************************
This following list is probably incomplete. Corrections are welcome.
@@ -627,10 +635,6 @@ static INPUT_PORTS_START( msx_dips )
PORT_DIPNAME( 0x40, 0, "Swap game port 1 and 2")
PORT_DIPSETTING( 0, DEF_STR( No ) )
PORT_DIPSETTING( 0x40, DEF_STR( Yes ) )
- PORT_DIPNAME ( 0x03, 0, "Render resolution")
- PORT_DIPSETTING( 0, DEF_STR( High ))
- PORT_DIPSETTING( 1, DEF_STR( Low ))
- PORT_DIPSETTING( 2, "Auto" )
PORT_START("MOUSE0")
PORT_BIT( 0xff00, 0x00, IPT_TRACKBALL_X) PORT_SENSITIVITY(100) PORT_KEYDELTA(0) PORT_PLAYER(1)
@@ -1281,7 +1285,7 @@ static SLOT_INTERFACE_START( msx_floppies )
SLOT_INTERFACE_END
static MACHINE_CONFIG_FRAGMENT( msx_fd1793 )
- MCFG_FD1793x_ADD("fdc", XTAL_4MHz / 4)
+ MCFG_FD1793_ADD("fdc", XTAL_4MHz / 4)
MCFG_WD_FDC_FORCE_READY
MACHINE_CONFIG_END
@@ -1289,19 +1293,19 @@ static MACHINE_CONFIG_FRAGMENT( msx_wd2793_force_ready )
// From NMS8245 schematics:
// READY + HLT - pulled high
// SSO/-ENMF + -DDEN + ENP + -5/8 - pulled low
- MCFG_WD2793x_ADD("fdc", XTAL_4MHz / 4)
+ MCFG_WD2793_ADD("fdc", XTAL_4MHz / 4)
MCFG_WD_FDC_FORCE_READY
MACHINE_CONFIG_END
static MACHINE_CONFIG_FRAGMENT( msx_wd2793 )
- MCFG_WD2793x_ADD("fdc", XTAL_4MHz / 4)
+ MCFG_WD2793_ADD("fdc", XTAL_4MHz / 4)
MACHINE_CONFIG_END
static MACHINE_CONFIG_FRAGMENT( msx_mb8877a )
// From CF-3300 FDC schematic:
// READY + HLT - pulled high
// -DDEN - pulled low
- MCFG_MB8877x_ADD("fdc", XTAL_4MHz / 4)
+ MCFG_MB8877_ADD("fdc", XTAL_4MHz / 4)
MCFG_WD_FDC_FORCE_READY
MACHINE_CONFIG_END
@@ -1310,7 +1314,7 @@ static MACHINE_CONFIG_FRAGMENT( msx_tc8566af )
MACHINE_CONFIG_END
static MACHINE_CONFIG_FRAGMENT( msx_microsol )
- MCFG_WD2793x_ADD("fdc", XTAL_4MHz / 4)
+ MCFG_WD2793_ADD("fdc", XTAL_4MHz / 4)
MCFG_WD_FDC_FORCE_READY
MACHINE_CONFIG_END
@@ -1395,6 +1399,56 @@ static MACHINE_CONFIG_DERIVED( msx_ntsc, msx )
MACHINE_CONFIG_END
+static MACHINE_CONFIG_DERIVED( msx_tms9118, msx )
+ /* Video hardware */
+ MCFG_DEVICE_ADD( "tms9928a", TMS9118, XTAL_10_738635MHz / 2 )
+ MCFG_TMS9928A_VRAM_SIZE(0x4000)
+ MCFG_TMS9928A_OUT_INT_LINE_CB(WRITELINE(msx_state,msx_irq_source0))
+ MCFG_TMS9928A_SCREEN_ADD_NTSC( "screen" )
+ MCFG_SCREEN_UPDATE_DEVICE("tms9928a", tms9928a_device, screen_update)
+MACHINE_CONFIG_END
+
+
+static MACHINE_CONFIG_DERIVED( msx_tms9128, msx )
+ /* Video hardware */
+ MCFG_DEVICE_ADD( "tms9928a", TMS9128, XTAL_10_738635MHz / 2 )
+ MCFG_TMS9928A_VRAM_SIZE(0x4000)
+ MCFG_TMS9928A_OUT_INT_LINE_CB(WRITELINE(msx_state,msx_irq_source0))
+ MCFG_TMS9928A_SCREEN_ADD_NTSC( "screen" )
+ MCFG_SCREEN_UPDATE_DEVICE("tms9928a", tms9928a_device, screen_update)
+MACHINE_CONFIG_END
+
+
+static MACHINE_CONFIG_DERIVED( msx_tms9918, msx )
+ /* Video hardware */
+ MCFG_DEVICE_ADD( "tms9928a", TMS9918, XTAL_10_738635MHz / 2 )
+ MCFG_TMS9928A_VRAM_SIZE(0x4000)
+ MCFG_TMS9928A_OUT_INT_LINE_CB(WRITELINE(msx_state,msx_irq_source0))
+ MCFG_TMS9928A_SCREEN_ADD_NTSC( "screen" )
+ MCFG_SCREEN_UPDATE_DEVICE("tms9928a", tms9928a_device, screen_update)
+MACHINE_CONFIG_END
+
+
+static MACHINE_CONFIG_DERIVED( msx_tms9918a, msx )
+ /* Video hardware */
+ MCFG_DEVICE_ADD( "tms9928a", TMS9918A, XTAL_10_738635MHz / 2 )
+ MCFG_TMS9928A_VRAM_SIZE(0x4000)
+ MCFG_TMS9928A_OUT_INT_LINE_CB(WRITELINE(msx_state,msx_irq_source0))
+ MCFG_TMS9928A_SCREEN_ADD_NTSC( "screen" )
+ MCFG_SCREEN_UPDATE_DEVICE("tms9928a", tms9928a_device, screen_update)
+MACHINE_CONFIG_END
+
+
+static MACHINE_CONFIG_DERIVED( msx_tms9928, msx )
+ /* Video hardware */
+ MCFG_DEVICE_ADD( "tms9928a", TMS9928A, XTAL_10_738635MHz / 2 )
+ MCFG_TMS9928A_VRAM_SIZE(0x4000)
+ MCFG_TMS9928A_OUT_INT_LINE_CB(WRITELINE(msx_state,msx_irq_source0))
+ MCFG_TMS9928A_SCREEN_ADD_NTSC( "screen" )
+ MCFG_SCREEN_UPDATE_DEVICE("tms9928a", tms9928a_device, screen_update)
+MACHINE_CONFIG_END
+
+
static MACHINE_CONFIG_DERIVED( msx_pal, msx )
/* Video hardware */
MCFG_DEVICE_ADD( "tms9928a", TMS9929A, XTAL_10_738635MHz / 2 )
@@ -1405,6 +1459,26 @@ static MACHINE_CONFIG_DERIVED( msx_pal, msx )
MACHINE_CONFIG_END
+static MACHINE_CONFIG_DERIVED( msx_tms9129, msx )
+ /* Video hardware */
+ MCFG_DEVICE_ADD( "tms9928a", TMS9129, XTAL_10_738635MHz / 2 )
+ MCFG_TMS9928A_VRAM_SIZE(0x4000)
+ MCFG_TMS9928A_OUT_INT_LINE_CB(WRITELINE(msx_state,msx_irq_source0))
+ MCFG_TMS9928A_SCREEN_ADD_PAL( "screen" )
+ MCFG_SCREEN_UPDATE_DEVICE("tms9928a", tms9928a_device, screen_update)
+MACHINE_CONFIG_END
+
+
+static MACHINE_CONFIG_DERIVED( msx_tms9929, msx )
+ /* Video hardware */
+ MCFG_DEVICE_ADD( "tms9928a", TMS9929A, XTAL_10_738635MHz / 2 )
+ MCFG_TMS9928A_VRAM_SIZE(0x4000)
+ MCFG_TMS9928A_OUT_INT_LINE_CB(WRITELINE(msx_state,msx_irq_source0))
+ MCFG_TMS9928A_SCREEN_ADD_PAL( "screen" )
+ MCFG_SCREEN_UPDATE_DEVICE("tms9928a", tms9928a_device, screen_update)
+MACHINE_CONFIG_END
+
+
#define MSX2_XBORDER_PIXELS 16
#define MSX2_YBORDER_PIXELS 28
#define MSX2_TOTAL_XRES_PIXELS 256 * 2 + (MSX2_XBORDER_PIXELS * 2)
@@ -1592,6 +1666,7 @@ static MACHINE_CONFIG_DERIVED( ax170, msx_pal )
// AY8910/YM2149?
// FDC: None, 0 drives
// 2 Cartridge slots
+ // T7937 (in ax170mk2)
MCFG_MSX_LAYOUT_ROM("bios", 0, 0, 0, 2, "maincpu", 0x0000)
MCFG_MSX_LAYOUT_ROM("arab", 1, 0, 1, 2, "maincpu", 0x8000)
@@ -1650,7 +1725,7 @@ ROM_START (canonv20)
ROM_LOAD ("v20bios.rom", 0x0000, 0x8000, CRC(e9ccd789) SHA1(8963fc041975f31dc2ab1019cfdd4967999de53e))
ROM_END
-static MACHINE_CONFIG_DERIVED( canonv20, msx_pal )
+static MACHINE_CONFIG_DERIVED( canonv20, msx_tms9929 )
// YM2149
// FDC: None, 0 drives
// 2 Cartridge slots
@@ -1698,9 +1773,10 @@ ROM_START (mx10)
ROM_LOAD( "mx10bios.rom", 0x0000, 0x8000, CRC(ee229390) SHA1(302afb5d8be26c758309ca3df611ae69cced2821))
ROM_END
-static MACHINE_CONFIG_DERIVED( mx10, msx_ntsc )
+static MACHINE_CONFIG_DERIVED( mx10, msx_tms9118 )
// FDC: None, 0 drives
// 2? Cartridge slots
+ // Z80: uPD780C-1
MCFG_MSX_LAYOUT_ROM("bios", 0, 0, 0, 2, "maincpu", 0x0000)
MCFG_MSX_LAYOUT_RAM("ram", 0, 0, 3, 1) // 16KB RAM
@@ -1720,6 +1796,7 @@ ROM_END
static MACHINE_CONFIG_DERIVED( mx15, msx_ntsc )
// FDC: None, 0 drives
// 3 Cartridge slots
+ // T6950
MCFG_MSX_LAYOUT_ROM("bios", 0, 0, 0, 2, "maincpu", 0x0000)
MCFG_MSX_LAYOUT_RAM("ram", 0, 0, 3, 1) // 16KB RAM
@@ -1756,13 +1833,14 @@ ROM_START (pv7)
ROM_LOAD("pv7bios.rom", 0x0000, 0x8000, CRC(ee229390) SHA1(302afb5d8be26c758309ca3df611ae69cced2821))
ROM_END
-static MACHINE_CONFIG_DERIVED( pv7, msx_ntsc )
+static MACHINE_CONFIG_DERIVED( pv7, msx_tms9118 )
// AY8910?
// FDC: None, 0 drives
// 1 Cartridge slot + expansion slot, or 2 cartridge slots?
// By adding a Casio KB-7 2 additional cartridge slots become available and 8KB extra RAM?
// No cassette port
// No printer port
+ // Z80: uPD780C-1
MCFG_MSX_LAYOUT_ROM("bios", 0, 0, 0, 2, "maincpu", 0x0000)
MCFG_MSX_LAYOUT_RAM("ram", 0, 0, 3, 1) /* 8KB RAM */
@@ -1780,7 +1858,7 @@ ROM_START (pv16)
ROM_LOAD("pv16.rom", 0x0000, 0x8000, CRC(ee229390) SHA1(302afb5d8be26c758309ca3df611ae69cced2821))
ROM_END
-static MACHINE_CONFIG_DERIVED( pv16, msx_ntsc )
+static MACHINE_CONFIG_DERIVED( pv16, msx_tms9118 )
// AY8910
// FDC: None, 0 drives
// 1 Cartridge slot
@@ -1868,7 +1946,7 @@ ROM_START (dpc200)
ROM_LOAD ("200han.rom", 0x8000, 0x4000, CRC(97478efb) SHA1(4421fa2504cbce18f7c84b5ea97f04e017007f07))
ROM_END
-static MACHINE_CONFIG_DERIVED( dpc200, msx_ntsc )
+static MACHINE_CONFIG_DERIVED( dpc200, msx_tms9918 )
// AY8910/YM2149?
// FDC: None, 0 drives
// 2 Cartridge slots
@@ -1909,7 +1987,7 @@ ROM_START (cpc50a)
ROM_LOAD ("50abios.rom", 0x0000, 0x8000, CRC(c3a868ef) SHA1(a08a940aa87313509e00bc5ac7494d53d8e03492))
ROM_END
-static MACHINE_CONFIG_DERIVED( cpc50a, msx_ntsc )
+static MACHINE_CONFIG_DERIVED( cpc50a, msx_tms9918 )
// AY8910/YM2149?
// FDC: None, 0 drives
// 1? Cartridge slot
@@ -1932,7 +2010,7 @@ ROM_START (cpc50b)
ROM_LOAD ("50bbios.rom", 0x0000, 0x8000, CRC(c3a868ef) SHA1(a08a940aa87313509e00bc5ac7494d53d8e03492))
ROM_END
-static MACHINE_CONFIG_DERIVED( cpc50b, msx_ntsc )
+static MACHINE_CONFIG_DERIVED( cpc50b, msx_tms9118 )
// AY8910/YM2149?
// FDC: None, 0 drives
// 1? Cartridge slot
@@ -1954,7 +2032,7 @@ ROM_START (cpc51)
ROM_LOAD ("51bios.rom", 0x0000, 0x8000, CRC(c3a868ef) SHA1(a08a940aa87313509e00bc5ac7494d53d8e03492))
ROM_END
-static MACHINE_CONFIG_DERIVED( cpc51, msx_ntsc )
+static MACHINE_CONFIG_DERIVED( cpc51, msx_tms9118 )
// AY8910/YM2149?
// FDC: None, 0 drives
// 1 Cartridge slot
@@ -2016,10 +2094,11 @@ ROM_START (fspc800)
ROM_LOAD ("spc800bios.rom", 0x0000, 0x8000, CRC(8205795e) SHA1(829c00c3114f25b3dae5157c0a238b52a3ac37db))
ROM_END
-static MACHINE_CONFIG_DERIVED( fspc800, msx_pal )
+static MACHINE_CONFIG_DERIVED( fspc800, msx_tms9929 )
// AY8910?
// FDC: None, 0 drives
// 2 Cartridge slots
+ // Z80: GSS Z8400APS
MCFG_MSX_LAYOUT_ROM("bios", 0, 0, 0, 2, "maincpu", 0x0000)
MCFG_MSX_LAYOUT_RAM("ram", 1, 0, 0, 4) /* 64KB RAM */
@@ -2101,7 +2180,7 @@ ROM_START (gsfc200)
ROM_LOAD ("fc200bios.rom.u5b", 0x4000, 0x4000, CRC(1a99b1a1) SHA1(e18f72271b64693a2a2bc226e1b9ebd0448e07c0))
ROM_END
-static MACHINE_CONFIG_DERIVED( gsfc200, msx_pal )
+static MACHINE_CONFIG_DERIVED( gsfc200, msx_tms9129 )
// AY8910/YM2149?
// FDC: None, 0 drives
// 2 Cartridge slots
@@ -2165,7 +2244,7 @@ ROM_START (expert10)
ROM_LOAD ("expbios.rom", 0x0000, 0x8000, CRC(07610d77) SHA1(ef3e010eb57e4476700a3bbff9d2119ab3acdf62))
ROM_END
-static MACHINE_CONFIG_DERIVED( expert10, msx_ntsc )
+static MACHINE_CONFIG_DERIVED( expert10, msx_tms9128 )
// AY8910/YM2149?
// FDC: None, 0 drives
// 2 Cartridge slots
@@ -2184,7 +2263,7 @@ ROM_START (expert11)
ROM_LOAD ("expbios11.rom", 0x0000, 0x8000, CRC(efb4b972) SHA1(d6720845928ee848cfa88a86accb067397685f02))
ROM_END
-static MACHINE_CONFIG_DERIVED( expert11, msx_ntsc )
+static MACHINE_CONFIG_DERIVED( expert11, msx_tms9128 )
// AY8910/YM2149?
// FDC: None, 0 drives
// 2 Cartridge slots
@@ -2227,7 +2306,7 @@ static MACHINE_CONFIG_DERIVED( expertdp, msx_ntsc )
// AY8910/YM2149?
// FDC: mb8877a, 1 3.5" DSDD drive
// 2 Cartridge slots
- // MSX Engine T7937A
+ // MSX Engine T7937A (also VDP)
MCFG_MSX_LAYOUT_ROM("bios", 0, 0, 0, 2, "maincpu", 0x0000)
MCFG_MSX_LAYOUT_CARTRIDGE("cartslot1", 1, 0)
@@ -2319,6 +2398,7 @@ static MACHINE_CONFIG_DERIVED( mbh50, msx_ntsc )
// AY8910/YM2149?
// FDC: None, 0 drives
// 2 Cartridge slots
+ // T6950
MCFG_MSX_LAYOUT_ROM("rom", 0, 0, 0, 2, "maincpu", 0x0000)
MCFG_MSX_LAYOUT_CARTRIDGE("cartslot1", 1, 0)
@@ -2457,7 +2537,7 @@ ROM_START (cf1200)
ROM_LOAD ("1200bios.rom", 0x0000, 0x8000, CRC(5ad03407) SHA1(c7a2c5baee6a9f0e1c6ee7d76944c0ab1886796c))
ROM_END
-static MACHINE_CONFIG_DERIVED( cf1200, msx_ntsc )
+static MACHINE_CONFIG_DERIVED( cf1200, msx_tms9918a )
// AY8910
// FDC: None, 0 drives
// 2 Cartridge slots
@@ -2586,7 +2666,7 @@ ROM_START (fs4000)
ROM_LOAD ("4000kfn.rom", 0, 0x20000, CRC(956dc96d) SHA1(9ed3ab6d893632b9246e91b412cd5db519e7586b))
ROM_END
-static MACHINE_CONFIG_DERIVED( fs4000, msx_ntsc )
+static MACHINE_CONFIG_DERIVED( fs4000, msx_tms9128 )
// AY8910/YM2149?
// FDC: None, 0 drives
// 2 Cartridge slots
@@ -2613,7 +2693,7 @@ ROM_START (fs4000a)
ROM_LOAD ("4000kfn.rom", 0, 0x20000, CRC(956dc96d) SHA1(9ed3ab6d893632b9246e91b412cd5db519e7586b))
ROM_END
-static MACHINE_CONFIG_DERIVED( fs4000a, msx_ntsc )
+static MACHINE_CONFIG_DERIVED( fs4000a, msx_tms9128 )
// AY8910/YM2149?
// FDC: None, 0 drives
// 2 Cartridge slots
@@ -2675,7 +2755,7 @@ ROM_START (cf2700g)
ROM_LOAD ("cf2700g.rom", 0x0000, 0x8000, CRC(4aa194f4) SHA1(69bf27b610e11437dad1f7a1c37a63179a293d12))
ROM_END
-static MACHINE_CONFIG_DERIVED( cf2700g, msx_pal )
+static MACHINE_CONFIG_DERIVED( cf2700g, msx_tms9929 )
// AY8910
// FDC: None, 0 drives
// 2 Cartridge slots
@@ -2734,7 +2814,7 @@ ROM_START (vg8000)
ROM_LOAD ("8000bios.rom", 0x0000, 0x8000, CRC(efd970b0) SHA1(42252cf87deeb58181a7bfec7c874190a1351779))
ROM_END
-static MACHINE_CONFIG_DERIVED( vg8000, msx_pal )
+static MACHINE_CONFIG_DERIVED( vg8000, msx_tms9129 )
// AY8910
// FDC: None, 0 drives
// 2 Cartridge slots
@@ -2755,7 +2835,7 @@ ROM_START (vg8010)
ROM_LOAD ("8010bios.rom", 0x0000, 0x8000, CRC(efd970b0) SHA1(42252cf87deeb58181a7bfec7c874190a1351779))
ROM_END
-static MACHINE_CONFIG_DERIVED( vg8010, msx_pal )
+static MACHINE_CONFIG_DERIVED( vg8010, msx_tms9129 )
// AY8910
// FDC: None, 0 drives
// 2 Cartridge slots
@@ -2776,7 +2856,7 @@ ROM_START (vg8010f)
ROM_LOAD ("8010fbios.rom", 0x0000, 0x8000, CRC(df57c9ca) SHA1(898630ad1497dc9a329580c682ee55c4bcb9c30c))
ROM_END
-static MACHINE_CONFIG_DERIVED( vg8010f, msx_pal )
+static MACHINE_CONFIG_DERIVED( vg8010f, msx_tms9129 )
// AY8910/YM2149?
// FDC: None, 0 drives
// 2 Cartridge slots
@@ -2797,7 +2877,7 @@ ROM_START (vg802000)
ROM_LOAD ("8020-00bios.rom", 0x0000, 0x8000, CRC(8205795e) SHA1(829c00c3114f25b3dae5157c0a238b52a3ac37db))
ROM_END
-static MACHINE_CONFIG_DERIVED( vg802000, msx_pal )
+static MACHINE_CONFIG_DERIVED( vg802000, msx_tms9929 )
// YM2149
// FDC: None, 0 drives
// 2 Cartridge slots
@@ -2817,7 +2897,7 @@ ROM_START (vg802020)
ROM_LOAD ("8020-20bios.rom", 0x0000, 0x8000, CRC(a317e6b4) SHA1(e998f0c441f4f1800ef44e42cd1659150206cf79))
ROM_END
-static MACHINE_CONFIG_DERIVED( vg802020, msx_pal )
+static MACHINE_CONFIG_DERIVED( vg802020, msx_tms9129 )
// YM2149 (in S-3527 MSX Engine)
// FDC: None, 0 drives
// 2 Cartridge slots
@@ -2865,6 +2945,7 @@ static MACHINE_CONFIG_DERIVED( piopx7, msx_pal )
// AY8910/YM2149?
// FDC: None, 0 drives
// 2 Cartridge slots
+ // TMS9928 is this were an ntsc machine
MCFG_MSX_LAYOUT_ROM("bios", 0, 0, 0, 2, "maincpu", 0x0000)
MCFG_MSX_LAYOUT_RAM("ram", 0, 0, 2, 2) /* 32KB RAM */
@@ -2885,7 +2966,7 @@ ROM_START (piopx7uk)
ROM_LOAD ("videoart.rom", 0xc000, 0x8000, CRC(0ba148dc) SHA1(b7b4e4cd40a856bb071976e6cf0f5e546fc86a78))
ROM_END
-static MACHINE_CONFIG_DERIVED( piopx7uk, msx_pal )
+static MACHINE_CONFIG_DERIVED( piopx7uk, msx_tms9129 )
// AY8910/YM2149?
// FDC: None, 0 drives
// 2 Cartridge slots
@@ -2908,7 +2989,7 @@ ROM_START (piopxv60)
ROM_FILL( 0xa000, 0x2000, 0x6E )
ROM_END
-static MACHINE_CONFIG_DERIVED( piopxv60, msx_ntsc )
+static MACHINE_CONFIG_DERIVED( piopxv60, msx_tms9128 )
// AY8910/YM2149?
// FDC: None, 0 drives
// 2 Cartridge slots
@@ -2995,6 +3076,8 @@ static MACHINE_CONFIG_DERIVED( mpc200, msx_pal )
// AY8910/YM2149?
// FDC: None, 0 drives
// 2? Cartridge slots
+ // T6950
+ // T7775 MSX Engine
MCFG_MSX_LAYOUT_ROM("bios", 0, 0, 0, 2, "maincpu", 0x0000)
MCFG_MSX_LAYOUT_CARTRIDGE("cartslot1", 1, 0)
@@ -3031,7 +3114,7 @@ ROM_START (phc28l)
ROM_LOAD ("28lbios.rom", 0x0000, 0x8000, CRC(d2110d66) SHA1(d3af963e2529662eae63f04a2530454685a1989f))
ROM_END
-static MACHINE_CONFIG_DERIVED( phc28l, msx_pal )
+static MACHINE_CONFIG_DERIVED( phc28l, msx_tms9929 )
// YM2149
// FDC: None, 0 drives
// 2 Cartridge slots
@@ -3051,7 +3134,7 @@ ROM_START (phc28s)
ROM_LOAD ("28sbios.rom", 0x0000, 0x8000, CRC(e5cf6b3c) SHA1(b1cce60ef61c058f5e42ef7ac635018d1a431168))
ROM_END
-static MACHINE_CONFIG_DERIVED( phc28s, msx_pal )
+static MACHINE_CONFIG_DERIVED( phc28s, msx_tms9929 )
// AY8910/YM2149?
// FDC: None, 0 drives
// 2 Cartridge slots?
@@ -3091,7 +3174,7 @@ ROM_START (hotbit11)
ROM_LOAD ("hotbit11.rom", 0x0000, 0x8000, CRC(b6942694) SHA1(663f8c512d04d213fa616b0db5eefe3774012a4b))
ROM_END
-static MACHINE_CONFIG_DERIVED( hotbit11, msx_ntsc )
+static MACHINE_CONFIG_DERIVED( hotbit11, msx_tms9128 )
// AY8910/YM2149?
// FDC: None, 0 drives
// 2 Cartridge slots
@@ -3111,7 +3194,7 @@ ROM_START (hotbit12)
ROM_LOAD ("hotbit12.rom", 0x0000, 0x8000, CRC(f59a4a0c) SHA1(9425815446d468058705bae545ffa13646744a87))
ROM_END
-static MACHINE_CONFIG_DERIVED( hotbit12, msx_ntsc )
+static MACHINE_CONFIG_DERIVED( hotbit12, msx_tms9128 )
// AY8910/YM2149?
// FDC: None, 0 drives
// 2 Cartridge slots
@@ -3198,6 +3281,7 @@ static MACHINE_CONFIG_DERIVED( hb10p, msx_pal )
// AY8910/YM2149?
// FDC: None, 0 drives
// 2 Cartridge slots
+ // T6950
MCFG_MSX_LAYOUT_ROM("bios", 0, 0, 0, 2, "maincpu", 0x0000)
MCFG_MSX_LAYOUT_CARTRIDGE("cartslot1", 1, 0)
@@ -3218,6 +3302,7 @@ static MACHINE_CONFIG_DERIVED( hb20p, msx_pal )
// AY8910/YM2149?
// FDC: None, 0 drives
// 2 Cartridge slots
+ // T6950
MCFG_MSX_LAYOUT_ROM("bios", 0, 0, 0, 2, "maincpu", 0x0000)
MCFG_MSX_LAYOUT_CARTRIDGE("cartslot1", 1, 0)
@@ -3390,7 +3475,7 @@ ROM_START (hb75p)
ROM_LOAD ("75pnote.ic44", 0x8000, 0x4000, CRC(492b12f8) SHA1(b262aedc71b445303f84efe5e865cbb71fd7d952))
ROM_END
-static MACHINE_CONFIG_DERIVED( hb75p, msx_pal )
+static MACHINE_CONFIG_DERIVED( hb75p, msx_tms9929 )
// AY8910
// FDC: None, 0 drives
// 2 Cartridge slots?
@@ -3434,7 +3519,7 @@ ROM_START (hb701fd)
ROM_LOAD ("hb701fddisk.rom", 0x8000, 0x4000, CRC(71961d9d) SHA1(2144036d6573d666143e890e5413956bfe8f66c5))
ROM_END
-static MACHINE_CONFIG_DERIVED( hb701fd, msx_ntsc )
+static MACHINE_CONFIG_DERIVED( hb701fd, msx_tms9928 )
// YM2149 (in S-1985)
// FDC: WD2793?, 1 3.5" SSDD drive
// 2 Cartridge slots
@@ -3461,7 +3546,7 @@ ROM_START (svi728)
// ROM_LOAD ("707disk.rom", 0x8000, 0x4000, CRC(f9978853) SHA1(6aa856cc56eb98863c9da7a566571605682b5c6b))
ROM_END
-static MACHINE_CONFIG_DERIVED( svi728, msx_pal )
+static MACHINE_CONFIG_DERIVED( svi728, msx_tms9129 )
// AY8910
// FDC: None, 0 drives
// 1 Cartridge slots, 1 Expansion slot (eg for SVI-707)
@@ -3670,7 +3755,7 @@ ROM_START (tadpc200)
ROM_LOAD ("dpc200bios.rom", 0x0000, 0x8000, CRC(8205795e) SHA1(829c00c3114f25b3dae5157c0a238b52a3ac37db))
ROM_END
-static MACHINE_CONFIG_DERIVED( tadpc200, msx_pal )
+static MACHINE_CONFIG_DERIVED( tadpc200, msx_tms9129 )
// AY8910
// FDC: None, 0 drives
// 2 Cartridge slots
@@ -3852,11 +3937,11 @@ ROM_START (hx20)
ROM_LOAD ("hx20word.rom", 0x8000, 0x8000, CRC(39b3e1c0) SHA1(9f7cfa932bd7dfd0d9ecaadc51655fb557c2e125))
ROM_END
-static MACHINE_CONFIG_DERIVED( hx20, msx_pal )
+static MACHINE_CONFIG_DERIVED( hx20, msx_tms9129 )
// AY8910/YM2149?
// FDC: None, 0 drives
// 2 Cartridge slots
- // T6950 VDP instead of TMS9928A
+ // T6950
MCFG_MSX_LAYOUT_ROM("bios", 0, 0, 0, 2, "maincpu", 0x0000)
MCFG_MSX_LAYOUT_RAM("ram1", 0, 0, 2, 2) /* 32KB RAM */
@@ -3876,7 +3961,7 @@ ROM_START (hx20i)
ROM_LOAD ("hx20iword.rom", 0x8000, 0x8000, CRC(39b3e1c0) SHA1(9f7cfa932bd7dfd0d9ecaadc51655fb557c2e125))
ROM_END
-static MACHINE_CONFIG_DERIVED( hx20i, msx_pal )
+static MACHINE_CONFIG_DERIVED( hx20i, msx_tms9129 )
// AY8910/YM2149?
// FDC: None, 0 drives
// 2 Cartridge slots
@@ -3903,7 +3988,7 @@ ROM_START (hx21)
ROM_LOAD ("hx21kfn.rom", 0x0000, 0x20000, CRC(d23d4d2d) SHA1(db03211b7db46899df41db2b1dfbec972109a967))
ROM_END
-static MACHINE_CONFIG_DERIVED( hx21, msx_ntsc )
+static MACHINE_CONFIG_DERIVED( hx21, msx_tms9928 )
// AY8910/YM2149?
// FDC: None, 0 drives
// 2 Cartridge slots
@@ -3974,11 +4059,12 @@ ROM_START (hx22i)
ROM_LOAD ("hx22iword.rom", 0x8000, 0x8000, CRC(f9e29c66) SHA1(3289336b2c12161fd926a7e5ce865770ae7038af))
ROM_END
-static MACHINE_CONFIG_DERIVED( hx22i, msx_pal )
+static MACHINE_CONFIG_DERIVED( hx22i, msx_tms9929 )
// AY8910/YM2149?
// FDC: None, 0 drives
// 2 Cartridge slots
// RS232C builtin?
+ // Z80: LH0080A
MCFG_MSX_LAYOUT_ROM("bios", 0, 0, 0, 2, "maincpu", 0x0000)
MCFG_MSX_LAYOUT_RAM("ram1", 0, 0, 2, 2) /* 32KB RAM */
@@ -4101,7 +4187,7 @@ ROM_START (cx5m)
ROM_LOAD ("cx5mbios.rom", 0x0000, 0x8000, CRC(e2242b53) SHA1(706dd67036baeec7127e4ccd8c8db8f6ce7d0e4c))
ROM_END
-static MACHINE_CONFIG_DERIVED( cx5m, msx_pal )
+static MACHINE_CONFIG_DERIVED( cx5m, msx_tms9929 )
// YM2149
// FDC: None, 0 drives
// 2 Cartridge slots
diff --git a/src/mess/drivers/mtx.c b/src/mess/drivers/mtx.c
index df1a4ee859f..f6839299480 100644
--- a/src/mess/drivers/mtx.c
+++ b/src/mess/drivers/mtx.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Lee Ward, Dirk Best, Curt Coder
/*************************************************************************
diff --git a/src/mess/drivers/myb3k.c b/src/mess/drivers/myb3k.c
index 8c98133d67b..0d467cbdfe1 100644
--- a/src/mess/drivers/myb3k.c
+++ b/src/mess/drivers/myb3k.c
@@ -269,7 +269,7 @@ static MACHINE_CONFIG_START( myb3k, myb3k_state )
MCFG_MC6845_SHOW_BORDER_AREA(false)
MCFG_MC6845_CHAR_WIDTH(8)
- MCFG_DEVICE_ADD("fdc", MB8877x, 2000000) // unknown type
+ MCFG_DEVICE_ADD("fdc", MB8877, 2000000) // unknown type
MCFG_FLOPPY_DRIVE_ADD("fdc:0", myb3k_floppies, "8dsdd", floppy_image_device::default_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("fdc:1", myb3k_floppies, "8dsdd", floppy_image_device::default_floppy_formats)
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/mycom.c b/src/mess/drivers/mycom.c
index be5e44bff65..c90bc44c2a6 100644
--- a/src/mess/drivers/mycom.c
+++ b/src/mess/drivers/mycom.c
@@ -550,7 +550,7 @@ static MACHINE_CONFIG_START( mycom, mycom_state )
/* Devices */
MCFG_MSM5832_ADD("rtc", XTAL_32_768kHz)
MCFG_CASSETTE_ADD( "cassette" )
- MCFG_FD1771x_ADD("fdc", XTAL_16MHz / 16)
+ MCFG_FD1771_ADD("fdc", XTAL_16MHz / 16)
MCFG_FLOPPY_DRIVE_ADD("fdc:0", mycom_floppies, "525sd", floppy_image_device::default_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("fdc:1", mycom_floppies, "525sd", floppy_image_device::default_floppy_formats)
diff --git a/src/mess/drivers/mz2000.c b/src/mess/drivers/mz2000.c
index 63c04d3b04b..f12c3e309b1 100644
--- a/src/mess/drivers/mz2000.c
+++ b/src/mess/drivers/mz2000.c
@@ -21,15 +21,14 @@
#include "cpu/z80/z80.h"
#include "machine/z80pio.h"
#include "machine/i8255.h"
-#include "machine/wd17xx.h"
+#include "machine/wd_fdc.h"
#include "machine/pit8253.h"
#include "sound/beep.h"
#include "sound/wave.h"
#include "machine/rp5c15.h"
-
#include "imagedev/cassette.h"
#include "imagedev/flopdrv.h"
-#include "formats/basicdsk.h"
+#include "formats/2d_dsk.h"
#include "formats/mz_cas.h"
#define MASTER_CLOCK XTAL_17_73447MHz/5 /* TODO: was 4 MHz, but otherwise cassette won't work due of a bug with MZF support ... */
@@ -41,8 +40,13 @@ public:
mz2000_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_cass(*this, "cassette"),
+ m_floppy(NULL),
m_maincpu(*this, "maincpu"),
m_mb8877a(*this, "mb8877a"),
+ m_floppy0(*this, "mb8877a:0"),
+ m_floppy1(*this, "mb8877a:1"),
+ m_floppy2(*this, "mb8877a:2"),
+ m_floppy3(*this, "mb8877a:3"),
m_pit8253(*this, "pit"),
m_beeper(*this, "beeper"),
m_region_tvram(*this, "tvram"),
@@ -68,8 +72,12 @@ public:
m_io_config(*this, "CONFIG"),
m_palette(*this, "palette") { }
+ DECLARE_FLOPPY_FORMATS(floppy_formats);
+
required_device<cassette_image_device> m_cass;
+ floppy_image_device *m_floppy;
+
UINT8 m_ipl_enable;
UINT8 m_tvram_enable;
UINT8 m_gvram_enable;
@@ -98,15 +106,16 @@ public:
DECLARE_READ8_MEMBER(mz2000_mem_r);
DECLARE_WRITE8_MEMBER(mz2000_mem_w);
DECLARE_WRITE8_MEMBER(mz2000_gvram_bank_w);
- DECLARE_WRITE8_MEMBER(mz2000_fdc_w);
+ DECLARE_WRITE8_MEMBER(floppy_select_w);
+ DECLARE_WRITE8_MEMBER(floppy_side_w);
DECLARE_WRITE8_MEMBER(timer_w);
DECLARE_WRITE8_MEMBER(mz2000_tvram_attr_w);
DECLARE_WRITE8_MEMBER(mz2000_gvram_mask_w);
virtual void machine_reset();
virtual void video_start();
UINT32 screen_update_mz2000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- DECLARE_READ8_MEMBER(mz2000_wd17xx_r);
- DECLARE_WRITE8_MEMBER(mz2000_wd17xx_w);
+ DECLARE_READ8_MEMBER(fdc_r);
+ DECLARE_WRITE8_MEMBER(fdc_w);
DECLARE_READ8_MEMBER(mz2000_porta_r);
DECLARE_READ8_MEMBER(mz2000_portb_r);
DECLARE_READ8_MEMBER(mz2000_portc_r);
@@ -119,7 +128,11 @@ public:
protected:
required_device<cpu_device> m_maincpu;
- required_device<mb8877_device> m_mb8877a;
+ required_device<mb8877_t> m_mb8877a;
+ required_device<floppy_connector> m_floppy0;
+ required_device<floppy_connector> m_floppy1;
+ required_device<floppy_connector> m_floppy2;
+ required_device<floppy_connector> m_floppy3;
required_device<pit8253_device> m_pit8253;
required_device<beep_device> m_beeper;
required_memory_region m_region_tvram;
@@ -339,7 +352,7 @@ WRITE8_MEMBER(mz2000_state::mz2000_gvram_bank_w)
m_gvram_bank = data & 3;
}
-READ8_MEMBER(mz2000_state::mz2000_wd17xx_r)
+READ8_MEMBER(mz2000_state::fdc_r)
{
if(m_has_fdc)
return m_mb8877a->read(space, offset) ^ 0xff;
@@ -347,25 +360,34 @@ READ8_MEMBER(mz2000_state::mz2000_wd17xx_r)
return 0xff;
}
-WRITE8_MEMBER(mz2000_state::mz2000_wd17xx_w)
+WRITE8_MEMBER(mz2000_state::fdc_w)
{
if(m_has_fdc)
m_mb8877a->write(space, offset, data ^ 0xff);
}
-WRITE8_MEMBER(mz2000_state::mz2000_fdc_w)
+WRITE8_MEMBER(mz2000_state::floppy_select_w)
{
- switch(offset+0xdc)
+ switch (data & 0x03)
{
- case 0xdc:
- m_mb8877a->set_drive(data & 3);
- floppy_get_device(machine(), data & 3)->floppy_mon_w((data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
- floppy_get_device(machine(), data & 3)->floppy_drive_set_ready_state(1,0);
- break;
- case 0xdd:
- m_mb8877a->set_side((data & 1));
- break;
+ case 0: m_floppy = m_floppy0->get_device(); break;
+ case 1: m_floppy = m_floppy1->get_device(); break;
+ case 2: m_floppy = m_floppy2->get_device(); break;
+ case 3: m_floppy = m_floppy3->get_device(); break;
}
+
+ m_mb8877a->set_floppy(m_floppy);
+
+ // todo: bit 2 is connected to something too...
+
+ if (m_floppy)
+ m_floppy->mon_w(!BIT(data, 7));
+}
+
+WRITE8_MEMBER(mz2000_state::floppy_side_w)
+{
+ if (m_floppy)
+ m_floppy->ss_w(BIT(data, 0));
}
WRITE8_MEMBER(mz2000_state::timer_w)
@@ -396,8 +418,9 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START(mz2000_io, AS_IO, 8, mz2000_state )
ADDRESS_MAP_UNMAP_HIGH
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0xd8, 0xdb) AM_READWRITE(mz2000_wd17xx_r, mz2000_wd17xx_w)
- AM_RANGE(0xdc, 0xdd) AM_WRITE(mz2000_fdc_w)
+ AM_RANGE(0xd8, 0xdb) AM_READWRITE(fdc_r, fdc_w)
+ AM_RANGE(0xdc, 0xdc) AM_WRITE(floppy_select_w)
+ AM_RANGE(0xdd, 0xdd) AM_WRITE(floppy_side_w)
AM_RANGE(0xe0, 0xe3) AM_DEVREADWRITE("i8255_0", i8255_device, read, write)
AM_RANGE(0xe4, 0xe7) AM_DEVREADWRITE("pit", pit8253_device, read, write)
AM_RANGE(0xe8, 0xeb) AM_DEVREADWRITE("z80pio_1", z80pio_device, read_alt, write_alt)
@@ -775,23 +798,15 @@ READ8_MEMBER(mz2000_state::mz2000_pio1_porta_r)
return m_porta_latch;
}
-#if 0
-static LEGACY_FLOPPY_OPTIONS_START( mz2000 )
- LEGACY_FLOPPY_OPTION( img2d, "2d", "2D disk image", basicdsk_identify_default, basicdsk_construct_default, NULL,
- HEADS([2])
- TRACKS([80])
- SECTORS([16])
- SECTOR_LENGTH([256])
- FIRST_SECTOR_ID([1]))
-LEGACY_FLOPPY_OPTIONS_END
-#endif
-
-static const floppy_interface mz2000_floppy_interface =
-{
- FLOPPY_STANDARD_3_5_DSHD,
- LEGACY_FLOPPY_OPTIONS_NAME(default),
- NULL
-};
+
+FLOPPY_FORMATS_MEMBER( mz2000_state::floppy_formats )
+ FLOPPY_2D_FORMAT
+FLOPPY_FORMATS_END
+
+static SLOT_INTERFACE_START( mz2000_floppies )
+ SLOT_INTERFACE("dd", FLOPPY_525_DD)
+SLOT_INTERFACE_END
+
static MACHINE_CONFIG_START( mz2000, mz2000_state )
/* basic machine hardware */
@@ -818,12 +833,14 @@ static MACHINE_CONFIG_START( mz2000, mz2000_state )
MCFG_PIT8253_CLK1(31250) /* needed by "Art Magic" to boot */
MCFG_PIT8253_CLK2(31250)
- MCFG_DEVICE_ADD("mb8877a", MB8877, 0)
- MCFG_WD17XX_DEFAULT_DRIVE4_TAGS
+ MCFG_MB8877_ADD("mb8877a", XTAL_1MHz)
- MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(mz2000_floppy_interface)
+ MCFG_FLOPPY_DRIVE_ADD("mb8877a:0", mz2000_floppies, "dd", mz2000_state::floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("mb8877a:1", mz2000_floppies, "dd", mz2000_state::floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("mb8877a:2", mz2000_floppies, "dd", mz2000_state::floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("mb8877a:3", mz2000_floppies, "dd", mz2000_state::floppy_formats)
- MCFG_SOFTWARE_LIST_ADD("flop_list","mz2000_flop")
+ MCFG_SOFTWARE_LIST_ADD("flop_list", "mz2000_flop")
MCFG_CASSETTE_ADD( "cassette" )
MCFG_CASSETTE_FORMATS(mz700_cassette_formats)
@@ -844,7 +861,6 @@ static MACHINE_CONFIG_START( mz2000, mz2000_state )
MCFG_GFXDECODE_ADD("gfxdecode", "palette", mz2000)
MCFG_PALETTE_ADD("palette", 8)
-
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette")
diff --git a/src/mess/drivers/mz2500.c b/src/mess/drivers/mz2500.c
index d0f7c46a286..6d904bd5bbd 100644
--- a/src/mess/drivers/mz2500.c
+++ b/src/mess/drivers/mz2500.c
@@ -49,7 +49,7 @@
#include "machine/z80pio.h"
#include "machine/z80dart.h"
#include "machine/i8255.h"
-#include "machine/wd17xx.h"
+#include "machine/wd_fdc.h"
#include "machine/pit8253.h"
#include "sound/2203intf.h"
#include "sound/beep.h"
@@ -57,7 +57,6 @@
//#include "imagedev/cassette.h"
#include "imagedev/flopdrv.h"
-#include "formats/basicdsk.h"
#define RP5C15_TAG "rp5c15"
@@ -71,6 +70,12 @@ public:
m_pit(*this, "pit"),
m_beeper(*this, "beeper"),
m_gfxdecode(*this, "gfxdecode"),
+ m_fdc(*this, "mb8877a"),
+ m_floppy0(*this, "mb8877a:0"),
+ m_floppy1(*this, "mb8877a:1"),
+ m_floppy2(*this, "mb8877a:2"),
+ m_floppy3(*this, "mb8877a:3"),
+ m_floppy(NULL),
m_palette(*this, "palette")
{ }
@@ -79,6 +84,13 @@ public:
required_device<pit8253_device> m_pit;
required_device<beep_device> m_beeper;
required_device<gfxdecode_device> m_gfxdecode;
+ required_device<mb8877_t> m_fdc;
+ required_device<floppy_connector> m_floppy0;
+ required_device<floppy_connector> m_floppy1;
+ required_device<floppy_connector> m_floppy2;
+ required_device<floppy_connector> m_floppy3;
+
+ floppy_image_device *m_floppy;
UINT8 *m_main_ram;
UINT8 *m_ipl_rom;
@@ -161,7 +173,6 @@ public:
DECLARE_WRITE8_MEMBER(mz2500_tv_crtc_w);
DECLARE_WRITE8_MEMBER(mz2500_irq_sel_w);
DECLARE_WRITE8_MEMBER(mz2500_irq_data_w);
- DECLARE_WRITE8_MEMBER(mz2500_fdc_w);
DECLARE_READ8_MEMBER(mz2500_rom_r);
DECLARE_WRITE8_MEMBER(mz2500_rom_w);
DECLARE_WRITE8_MEMBER(palette4096_io_w);
@@ -190,8 +201,12 @@ public:
DECLARE_PALETTE_INIT(mz2500);
UINT32 screen_update_mz2500(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(mz2500_vbl);
- DECLARE_READ8_MEMBER(mz2500_wd17xx_r);
- DECLARE_WRITE8_MEMBER(mz2500_wd17xx_w);
+
+ DECLARE_READ8_MEMBER(fdc_r);
+ DECLARE_WRITE8_MEMBER(fdc_w);
+ DECLARE_WRITE8_MEMBER(floppy_select_w);
+ DECLARE_WRITE8_MEMBER(floppy_side_w);
+
DECLARE_READ8_MEMBER(mz2500_porta_r);
DECLARE_READ8_MEMBER(mz2500_portb_r);
DECLARE_READ8_MEMBER(mz2500_portc_r);
@@ -1182,41 +1197,28 @@ WRITE8_MEMBER(mz2500_state::mz2500_irq_data_w)
// popmessage("%02x %02x %02x %02x",m_irq_vector[0],m_irq_vector[1],m_irq_vector[2],m_irq_vector[3]);
}
-WRITE8_MEMBER(mz2500_state::mz2500_fdc_w)
+WRITE8_MEMBER(mz2500_state::floppy_select_w)
{
- mb8877_device *fdc = machine().device<mb8877_device>("mb8877a");
- UINT8 drivenum;
- switch(offset+0xdc)
+ switch ((data & 0x03) ^ m_fdc_reverse)
{
- case 0xdc:
- drivenum = (data & 3) ^ m_fdc_reverse;
- fdc->set_drive(drivenum);
- floppy_get_device(machine(), drivenum)->floppy_mon_w((data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
- floppy_get_device(machine(), drivenum)->floppy_drive_set_ready_state(1,0);
- break;
- case 0xdd:
- fdc->set_side((data & 1));
- break;
+ case 0: m_floppy = m_floppy0->get_device(); break;
+ case 1: m_floppy = m_floppy1->get_device(); break;
+ case 2: m_floppy = m_floppy2->get_device(); break;
+ case 3: m_floppy = m_floppy3->get_device(); break;
}
-}
-#if 0
-static LEGACY_FLOPPY_OPTIONS_START( mz2500 )
- LEGACY_FLOPPY_OPTION( img2d, "2d", "2D disk image", basicdsk_identify_default, basicdsk_construct_default, NULL,
- HEADS([2])
- TRACKS([80])
- SECTORS([16])
- SECTOR_LENGTH([256])
- FIRST_SECTOR_ID([1]))
-LEGACY_FLOPPY_OPTIONS_END
-#endif
+ m_fdc->set_floppy(m_floppy);
-static const floppy_interface mz2500_floppy_interface =
+ if (m_floppy)
+ m_floppy->mon_w(!BIT(data, 7));
+}
+
+WRITE8_MEMBER(mz2500_state::floppy_side_w)
{
- FLOPPY_STANDARD_3_5_DSHD,
- LEGACY_FLOPPY_OPTIONS_NAME(default),
- "floppy_3_5"
-};
+ if (m_floppy)
+ m_floppy->ss_w(BIT(data, 0));
+}
+
static ADDRESS_MAP_START(mz2500_map, AS_PROGRAM, 8, mz2500_state )
AM_RANGE(0x0000, 0x1fff) AM_READWRITE(bank0_r,bank0_w)
@@ -1267,16 +1269,14 @@ WRITE8_MEMBER(mz2500_state::palette4096_io_w)
m_palette->set_pen_color(pal_entry+0x10, pal4bit(m_pal[pal_entry].r), pal4bit(m_pal[pal_entry].g), pal4bit(m_pal[pal_entry].b));
}
-READ8_MEMBER(mz2500_state::mz2500_wd17xx_r)
+READ8_MEMBER(mz2500_state::fdc_r)
{
- mb8877_device *fdc = machine().device<mb8877_device>("mb8877a");
- return fdc->read(space, offset) ^ 0xff;
+ return m_fdc->read(space, offset) ^ 0xff;
}
-WRITE8_MEMBER(mz2500_state::mz2500_wd17xx_w)
+WRITE8_MEMBER(mz2500_state::fdc_w)
{
- mb8877_device *fdc = machine().device<mb8877_device>("mb8877a");
- fdc->write(space, offset, data ^ 0xff);
+ m_fdc->write(space, offset, data ^ 0xff);
}
READ8_MEMBER(mz2500_state::mz2500_bplane_latch_r)
@@ -1532,8 +1532,9 @@ static ADDRESS_MAP_START(mz2500_io, AS_IO, 8, mz2500_state )
AM_RANGE(0xcc, 0xcc) AM_READWRITE(rp5c15_8_r, rp5c15_8_w)
AM_RANGE(0xce, 0xce) AM_WRITE(mz2500_dictionary_bank_w)
AM_RANGE(0xcf, 0xcf) AM_WRITE(mz2500_kanji_bank_w)
- AM_RANGE(0xd8, 0xdb) AM_READWRITE(mz2500_wd17xx_r, mz2500_wd17xx_w)
- AM_RANGE(0xdc, 0xdd) AM_WRITE(mz2500_fdc_w)
+ AM_RANGE(0xd8, 0xdb) AM_READWRITE(fdc_r, fdc_w)
+ AM_RANGE(0xdc, 0xdc) AM_WRITE(floppy_select_w)
+ AM_RANGE(0xdd, 0xdd) AM_WRITE(floppy_side_w)
AM_RANGE(0xde, 0xde) AM_WRITENOP
AM_RANGE(0xe0, 0xe3) AM_DEVREADWRITE("i8255_0", i8255_device, read, write)
AM_RANGE(0xe4, 0xe7) AM_DEVREADWRITE("pit", pit8253_device, read, write)
@@ -2067,6 +2068,12 @@ WRITE_LINE_MEMBER(mz2500_state::mz2500_rtc_alarm_irq)
// m_maincpu->set_input_line_and_vector(0, HOLD_LINE,drvm_irq_vector[3]);
}
+
+static SLOT_INTERFACE_START( mz2500_floppies )
+ SLOT_INTERFACE("dd", FLOPPY_35_DD)
+SLOT_INTERFACE_END
+
+
static MACHINE_CONFIG_START( mz2500, mz2500_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z80, 6000000)
@@ -2101,12 +2108,14 @@ static MACHINE_CONFIG_START( mz2500, mz2500_state )
MCFG_PIT8253_CLK2(16) //CH2, used by Super MZ demo / The Black Onyx and a few others (TODO: timing of this)
MCFG_PIT8253_OUT2_HANDLER(DEVWRITELINE("pit", pit8253_device, write_clk1))
- MCFG_DEVICE_ADD("mb8877a", MB8877, 0)
- MCFG_WD17XX_DEFAULT_DRIVE4_TAGS
+ MCFG_MB8877_ADD("mb8877a", XTAL_1MHz)
- MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(mz2500_floppy_interface)
+ MCFG_FLOPPY_DRIVE_ADD("mb8877a:0", mz2500_floppies, "dd", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("mb8877a:1", mz2500_floppies, "dd", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("mb8877a:2", mz2500_floppies, "dd", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("mb8877a:3", mz2500_floppies, "dd", floppy_image_device::default_floppy_formats)
- MCFG_SOFTWARE_LIST_ADD("flop_list","mz2500")
+ MCFG_SOFTWARE_LIST_ADD("flop_list", "mz2500")
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mess/drivers/n64.c b/src/mess/drivers/n64.c
index add05b32cf3..503d80e839f 100644
--- a/src/mess/drivers/n64.c
+++ b/src/mess/drivers/n64.c
@@ -389,6 +389,7 @@ static MACHINE_CONFIG_START( n64, n64_mess_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", VR4300BE, 93750000)
+ MCFG_FORCE_NO_DRC()
MCFG_CPU_CONFIG(config)
MCFG_CPU_PROGRAM_MAP(n64_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", n64_mess_state, n64_reset_poll)
@@ -414,7 +415,6 @@ static MACHINE_CONFIG_START( n64, n64_mess_state )
MCFG_PALETTE_ADD("palette", 0x1000)
-
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
MCFG_SOUND_ADD("dac2", DMADAC, 0)
@@ -432,6 +432,8 @@ static MACHINE_CONFIG_START( n64, n64_mess_state )
/* software lists */
MCFG_SOFTWARE_LIST_ADD("cart_list", "n64")
+
+ MCFG_FORCE_NO_DRC()
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( n64dd, n64 )
diff --git a/src/mess/drivers/nascom1.c b/src/mess/drivers/nascom1.c
index 948919fdab6..135a5d6b083 100644
--- a/src/mess/drivers/nascom1.c
+++ b/src/mess/drivers/nascom1.c
@@ -234,7 +234,7 @@ SNAPSHOT_LOAD_MEMBER( nascom_state, nascom1 )
while (image.fread( &line, sizeof(line)) == sizeof(line))
{
- int addr, b0, b1, b2, b3, b4, b5, b6, b7, dummy;
+ unsigned int addr, b0, b1, b2, b3, b4, b5, b6, b7, dummy;
if (sscanf((char *)line, "%x %x %x %x %x %x %x %x %x %x\010\010\n",
&addr, &b0, &b1, &b2, &b3, &b4, &b5, &b6, &b7, &dummy) == 10)
diff --git a/src/mess/drivers/nes.c b/src/mess/drivers/nes.c
index 44a4db083d8..50e99f6dd4c 100644
--- a/src/mess/drivers/nes.c
+++ b/src/mess/drivers/nes.c
@@ -215,6 +215,7 @@ void nes_state::setup_disk(nes_disksys_device *slot)
MACHINE_START_MEMBER( nes_state, fds )
{
m_ciram = auto_alloc_array(machine(), UINT8, 0x800);
+ m_io_disksel = ioport("FLIPDISK");
setup_disk(m_disk);
// register saves
diff --git a/src/mess/drivers/ngen.c b/src/mess/drivers/ngen.c
index 487b9e0c4ae..9050da436a8 100644
--- a/src/mess/drivers/ngen.c
+++ b/src/mess/drivers/ngen.c
@@ -916,7 +916,7 @@ static MACHINE_CONFIG_START( ngen, ngen_state )
MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(ngen_state,timer_clk_out))
// floppy disk / hard disk module (WD2797 FDC, WD1010 HDC, plus an 8253 timer for each)
- MCFG_WD2797x_ADD("fdc", XTAL_20MHz / 20)
+ MCFG_WD2797_ADD("fdc", XTAL_20MHz / 20)
MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(ngen_state,fdc_irq_w))
MCFG_WD_FDC_DRQ_CALLBACK(DEVWRITELINE("maincpu",i80186_cpu_device,drq1_w))
MCFG_WD_FDC_FORCE_READY
@@ -1026,7 +1026,7 @@ static MACHINE_CONFIG_START( ngen386, ngen386_state )
MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(ngen_state,timer_clk_out))
// floppy disk / hard disk module (WD2797 FDC, WD1010 HDC, plus an 8253 timer for each)
- MCFG_WD2797x_ADD("fdc", XTAL_20MHz / 20)
+ MCFG_WD2797_ADD("fdc", XTAL_20MHz / 20)
MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(ngen_state,fdc_irq_w))
// MCFG_WD_FDC_DRQ_CALLBACK(DEVWRITELINE("i386cpu",i80186_cpu_device,drq1_w))
MCFG_WD_FDC_FORCE_READY
diff --git a/src/mess/drivers/ngp.c b/src/mess/drivers/ngp.c
index 21b8d1d7812..4110dcd2c6c 100644
--- a/src/mess/drivers/ngp.c
+++ b/src/mess/drivers/ngp.c
@@ -118,7 +118,7 @@ enum flash_state
F_AUTO_PROGRAM, /* 5555 AA 2AAA 55 5555 A0 address data */
F_AUTO_CHIP_ERASE, /* 5555 AA 2AAA 55 5555 80 5555 AA 2AAA 55 5555 10 */
F_AUTO_BLOCK_ERASE, /* 5555 AA 2AAA 55 5555 80 5555 AA 2AAA 55 block_address 30 */
- F_BLOCK_PROTECT, /* 5555 AA 2AAA 55 5555 9A 5555 AA 2AAA 55 5555 9A */
+ F_BLOCK_PROTECT /* 5555 AA 2AAA 55 5555 9A 5555 AA 2AAA 55 5555 9A */
};
diff --git a/src/mess/drivers/oric.c b/src/mess/drivers/oric.c
index deda51ee0c5..5ef4b1a19de 100644
--- a/src/mess/drivers/oric.c
+++ b/src/mess/drivers/oric.c
@@ -847,7 +847,7 @@ static MACHINE_CONFIG_DERIVED_CLASS( telstrat, oric, telestrat_state )
MCFG_VIA6522_IRQ_HANDLER(WRITELINE(telestrat_state, via2_irq_w))
/* microdisc */
- MCFG_FD1793x_ADD("fdc", XTAL_8MHz/8)
+ MCFG_FD1793_ADD("fdc", XTAL_8MHz/8)
MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(telestrat_state, fdc_irq_w))
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(telestrat_state, fdc_drq_w))
MCFG_WD_FDC_HLD_CALLBACK(WRITELINE(telestrat_state, fdc_hld_w))
diff --git a/src/mess/drivers/orion.c b/src/mess/drivers/orion.c
index 40752d62d3d..ac3d9ab8430 100644
--- a/src/mess/drivers/orion.c
+++ b/src/mess/drivers/orion.c
@@ -123,7 +123,7 @@ static MACHINE_CONFIG_START( orion128, orion_state )
MCFG_SOFTWARE_LIST_ADD("cass_list", "orion_cass")
- MCFG_FD1793x_ADD("fd1793", XTAL_8MHz / 8)
+ MCFG_FD1793_ADD("fd1793", XTAL_8MHz / 8)
MCFG_FLOPPY_DRIVE_ADD("fd0", orion_floppies, "525qd", orion_state::orion_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("fd1", orion_floppies, "525qd", orion_state::orion_floppy_formats)
@@ -202,7 +202,7 @@ static MACHINE_CONFIG_START( orionz80, orion_state )
MCFG_SOFTWARE_LIST_ADD("cass_list", "orion_cass")
- MCFG_FD1793x_ADD("fd1793", XTAL_8MHz / 8)
+ MCFG_FD1793_ADD("fd1793", XTAL_8MHz / 8)
MCFG_FLOPPY_DRIVE_ADD("fd0", orion_floppies, "525qd", orion_state::orion_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("fd1", orion_floppies, "525qd", orion_state::orion_floppy_formats)
@@ -277,7 +277,7 @@ static MACHINE_CONFIG_START( orionpro, orion_state )
MCFG_SOFTWARE_LIST_ADD("cass_list", "orion_cass")
- MCFG_FD1793x_ADD("fd1793", XTAL_8MHz / 8)
+ MCFG_FD1793_ADD("fd1793", XTAL_8MHz / 8)
MCFG_FLOPPY_DRIVE_ADD("fd0", orion_floppies, "525qd", orion_state::orion_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("fd1", orion_floppies, "525qd", orion_state::orion_floppy_formats)
diff --git a/src/mess/drivers/osbexec.c b/src/mess/drivers/osbexec.c
index 80323e29a0c..e5889c40fe2 100644
--- a/src/mess/drivers/osbexec.c
+++ b/src/mess/drivers/osbexec.c
@@ -113,7 +113,6 @@ public:
DECLARE_READ8_MEMBER(osbexec_rtc_r);
DECLARE_DRIVER_INIT(osbexec);
virtual void machine_reset();
- DECLARE_PALETTE_INIT(osbexec);
TIMER_CALLBACK_MEMBER(osbexec_video_callback);
DECLARE_READ8_MEMBER(osbexec_pia0_a_r);
DECLARE_WRITE8_MEMBER(osbexec_pia0_a_w);
@@ -311,13 +310,6 @@ static INPUT_PORTS_START( osbexec )
INPUT_PORTS_END
-PALETTE_INIT_MEMBER(osbexec_state, osbexec)
-{
- palette.set_pen_color( 0, 0, 0, 0 ); /* Black */
- palette.set_pen_color( 1, 0, 255, 0 ); /* Full */
- palette.set_pen_color( 2, 0, 128, 0 ); /* Dimmed */
-}
-
void osbexec_state::video_start()
{
machine().first_screen()->register_screen_bitmap(m_bitmap);
@@ -439,45 +431,12 @@ WRITE_LINE_MEMBER(osbexec_state::osbexec_pia1_irq)
* - DEC 1820 double density: 40 tracks, 9 sectors per track, 512-byte sectors (180 KByte)
*
*/
- /*
-static LEGACY_FLOPPY_OPTIONS_START(osbexec )
- LEGACY_FLOPPY_OPTION( osd, "img", "Osborne single density", basicdsk_identify_default, basicdsk_construct_default, NULL,
- HEADS([1])
- TRACKS([40])
- SECTORS([10])
- SECTOR_LENGTH([256])
- FIRST_SECTOR_ID([1]))
- LEGACY_FLOPPY_OPTION( odd, "img", "Osborne double density", basicdsk_identify_default, basicdsk_construct_default, NULL,
- HEADS([1])
- TRACKS([40])
- SECTORS([5])
- SECTOR_LENGTH([1024])
- FIRST_SECTOR_ID([1]))
- LEGACY_FLOPPY_OPTION( ibm, "img", "IBM Personal Computer", basicdsk_identify_default, basicdsk_construct_default, NULL,
- HEADS([1])
- TRACKS([40])
- SECTORS([8])
- SECTOR_LENGTH([512])
- FIRST_SECTOR_ID([1]))
- LEGACY_FLOPPY_OPTION( xerox, "img", "Xerox 820 Computer", basicdsk_identify_default, basicdsk_construct_default, NULL,
- HEADS([1])
- TRACKS([40])
- SECTORS([18])
- SECTOR_LENGTH([128])
- FIRST_SECTOR_ID([1]))
- LEGACY_FLOPPY_OPTION( dec, "img", "DEC 1820 double density", basicdsk_identify_default, basicdsk_construct_default, NULL,
- HEADS([1])
- TRACKS([40])
- SECTORS([9])
- SECTOR_LENGTH([512])
- FIRST_SECTOR_ID([1]))
-LEGACY_FLOPPY_OPTIONS_END
-*/
static SLOT_INTERFACE_START( osborne2_floppies )
SLOT_INTERFACE( "525ssdd", FLOPPY_525_SSDD )
SLOT_INTERFACE_END
+
TIMER_CALLBACK_MEMBER(osbexec_state::osbexec_video_callback)
{
int y = machine().first_screen()->vpos();
@@ -504,7 +463,7 @@ TIMER_CALLBACK_MEMBER(osbexec_state::osbexec_video_callback)
{
UINT8 ch = m_vram[ row_addr + x ];
UINT8 attr = m_vram[ 0x1000 + row_addr + x ];
- UINT8 fg_col = ( attr & 0x80 ) ? 1 : 2;
+ UINT8 fg_col = ( attr & 0x80 ) ? 2 : 1;
UINT8 font_bits = m_fontram[ ( ( attr & 0x10 ) ? 0x800 : 0 ) + ( ch & 0x7f ) * 16 + char_line ];
/* Check for underline */
@@ -575,9 +534,7 @@ static MACHINE_CONFIG_START( osbexec, osbexec_state )
MCFG_SCREEN_UPDATE_DRIVER(osbexec_state, screen_update)
MCFG_SCREEN_RAW_PARAMS( MAIN_CLOCK/2, 768, 0, 640, 260, 0, 240 ) /* May not be correct */
MCFG_SCREEN_PALETTE("palette")
-
- MCFG_PALETTE_ADD( "palette", 3 )
- MCFG_PALETTE_INIT_OWNER(osbexec_state, osbexec)
+ MCFG_PALETTE_ADD_MONOCHROME_GREEN_HIGHLIGHT("palette")
MCFG_SPEAKER_STANDARD_MONO( "mono" )
MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
@@ -601,7 +558,7 @@ static MACHINE_CONFIG_START( osbexec, osbexec_state )
MCFG_Z80SIO2_ADD("sio", MAIN_CLOCK/6, 0, 0, 0, 0)
- MCFG_DEVICE_ADD("mb8877", MB8877x, MAIN_CLOCK/24)
+ MCFG_DEVICE_ADD("mb8877", MB8877, MAIN_CLOCK/24)
MCFG_WD_FDC_INTRQ_CALLBACK(DEVWRITELINE("pia_1", pia6821_device, cb1_w))
MCFG_FLOPPY_DRIVE_ADD("mb8877:0", osborne2_floppies, "525ssdd", floppy_image_device::default_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("mb8877:1", osborne2_floppies, "525ssdd", floppy_image_device::default_floppy_formats)
diff --git a/src/mess/drivers/osborne1.c b/src/mess/drivers/osborne1.c
index 076fd3d4a7e..4910ee5e0cc 100644
--- a/src/mess/drivers/osborne1.c
+++ b/src/mess/drivers/osborne1.c
@@ -144,14 +144,6 @@ static INPUT_PORTS_START( osborne1 )
INPUT_PORTS_END
-PALETTE_INIT_MEMBER(osborne1_state, osborne1)
-{
- palette.set_pen_color( 0, 0, 0, 0 ); /* Black */
- palette.set_pen_color( 1, 0, 255, 0 ); /* Full */
- palette.set_pen_color( 2, 0, 128, 0 ); /* Dimmed */
-}
-
-
static const z80_daisy_config osborne1_daisy_chain[] =
{
/* { osborne1_z80_reset, osborne1_z80_irq_state, osborne1_z80_irq_ack, osborne1_z80_irq_reti, 0 }, */
@@ -159,6 +151,7 @@ static const z80_daisy_config osborne1_daisy_chain[] =
{ NULL }
};
+
/*
* The Osborne-1 supports the following disc formats:
* - Osborne single density: 40 tracks, 10 sectors per track, 256-byte sectors (100 KByte)
@@ -168,46 +161,13 @@ static const z80_daisy_config osborne1_daisy_chain[] =
* - DEC 1820 double density: 40 tracks, 9 sectors per track, 512-byte sectors (180 KByte)
*
*/
- /*
-static LEGACY_FLOPPY_OPTIONS_START(osborne1 )
- LEGACY_FLOPPY_OPTION( osd, "img", "Osborne single density", basicdsk_identify_default, basicdsk_construct_default, NULL,
- HEADS([1])
- TRACKS([40])
- SECTORS([10])
- SECTOR_LENGTH([256])
- FIRST_SECTOR_ID([1]))
- LEGACY_FLOPPY_OPTION( odd, "img", "Osborne double density", basicdsk_identify_default, basicdsk_construct_default, NULL,
- HEADS([1])
- TRACKS([40])
- SECTORS([5])
- SECTOR_LENGTH([1024])
- FIRST_SECTOR_ID([1]))
- LEGACY_FLOPPY_OPTION( ibm, "img", "IBM Personal Computer", basicdsk_identify_default, basicdsk_construct_default, NULL,
- HEADS([1])
- TRACKS([40])
- SECTORS([8])
- SECTOR_LENGTH([512])
- FIRST_SECTOR_ID([1]))
- LEGACY_FLOPPY_OPTION( xerox, "img", "Xerox 820 Computer", basicdsk_identify_default, basicdsk_construct_default, NULL,
- HEADS([1])
- TRACKS([40])
- SECTORS([18])
- SECTOR_LENGTH([128])
- FIRST_SECTOR_ID([1]))
- LEGACY_FLOPPY_OPTION( dec, "img", "DEC 1820 double density", basicdsk_identify_default, basicdsk_construct_default, NULL,
- HEADS([1])
- TRACKS([40])
- SECTORS([9])
- SECTOR_LENGTH([512])
- FIRST_SECTOR_ID([1]))
-LEGACY_FLOPPY_OPTIONS_END
-*/
static SLOT_INTERFACE_START( osborne1_floppies )
SLOT_INTERFACE( "525sssd", FLOPPY_525_SSSD ) // Siemens FDD 100-5, custom Osborne electronics
SLOT_INTERFACE( "525ssdd", FLOPPY_525_SSDD ) // MPI 52(?), custom Osborne electronics
SLOT_INTERFACE_END
+
/* F4 Character Displayer */
static const gfx_layout osborne1_charlayout =
{
@@ -226,6 +186,7 @@ static GFXDECODE_START( osborne1 )
GFXDECODE_ENTRY( "chargen", 0x0000, osborne1_charlayout, 0, 1 )
GFXDECODE_END
+
static MACHINE_CONFIG_START( osborne1, osborne1_state )
MCFG_CPU_ADD( "maincpu", Z80, MAIN_CLOCK/4 )
MCFG_CPU_PROGRAM_MAP( osborne1_mem)
@@ -239,8 +200,7 @@ static MACHINE_CONFIG_START( osborne1, osborne1_state )
MCFG_SCREEN_RAW_PARAMS( MAIN_CLOCK/2, 512, 0, 416, 260, 0, 240 )
MCFG_SCREEN_PALETTE("palette")
MCFG_GFXDECODE_ADD("gfxdecode", "palette", osborne1)
- MCFG_PALETTE_ADD( "palette", 3 )
- MCFG_PALETTE_INIT_OWNER(osborne1_state, osborne1)
+ MCFG_PALETTE_ADD_MONOCHROME_GREEN_HIGHLIGHT("palette")
MCFG_SPEAKER_STANDARD_MONO( "mono" )
MCFG_SOUND_ADD( "beeper", BEEP, 0 )
@@ -261,7 +221,7 @@ static MACHINE_CONFIG_START( osborne1, osborne1_state )
MCFG_PIA_CB2_HANDLER(WRITELINE(osborne1_state, video_pia_out_cb2_dummy))
MCFG_PIA_IRQA_HANDLER(WRITELINE(osborne1_state, video_pia_irq_a_func))
- MCFG_DEVICE_ADD("mb8877", MB8877x, MAIN_CLOCK/16)
+ MCFG_DEVICE_ADD("mb8877", MB8877, MAIN_CLOCK/16)
MCFG_WD_FDC_FORCE_READY
MCFG_FLOPPY_DRIVE_ADD("mb8877:0", osborne1_floppies, "525ssdd", floppy_image_device::default_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("mb8877:1", osborne1_floppies, "525ssdd", floppy_image_device::default_floppy_formats)
diff --git a/src/mess/drivers/osi.c b/src/mess/drivers/osi.c
index 1cdd3d6f14c..48359d9ccf9 100644
--- a/src/mess/drivers/osi.c
+++ b/src/mess/drivers/osi.c
@@ -388,7 +388,7 @@ WRITE8_MEMBER( c1p_state::osi630_sound_w )
C011 ACIAIO DISK CONTROLLER ACIA I/O PORT
*/
-WRITE_LINE_MEMBER(sb2m600_state::osi470_index_callback)
+void sb2m600_state::floppy_index_callback(floppy_image_device *floppy, int state)
{
m_fdc_index = state;
}
@@ -686,23 +686,17 @@ void c1p_state::machine_start()
void c1pmf_state::machine_start()
{
c1p_state::machine_start();
-}
-static LEGACY_FLOPPY_OPTIONS_START(osi)
- LEGACY_FLOPPY_OPTION(osi, "img", "OSI disk image", basicdsk_identify_default, basicdsk_construct_default, NULL,
- HEADS([1])
- TRACKS([36])
- SECTORS([10])
- SECTOR_LENGTH([256])
- FIRST_SECTOR_ID([0]))
-LEGACY_FLOPPY_OPTIONS_END
+ // drive select logic missing
+ if (m_floppy0->get_device())
+ m_floppy0->get_device()->setup_index_pulse_cb(floppy_image_device::index_pulse_cb(FUNC(sb2m600_state::floppy_index_callback), this));
+}
-static const floppy_interface osi_floppy_interface =
-{
- FLOPPY_STANDARD_5_25_SSDD_40,
- LEGACY_FLOPPY_OPTIONS_NAME(osi),
- NULL
-};
+// disk format: 1 head, 36 tracks (? - manual displays a directory listing with 40 tracks),
+// 10 sectors, 256 byte sector length, first sector id 0
+static SLOT_INTERFACE_START( osi_floppies )
+ SLOT_INTERFACE("ssdd", FLOPPY_525_SSDD)
+SLOT_INTERFACE_END
/* F4 Character Displayer */
static const gfx_layout osi_charlayout =
@@ -833,8 +827,8 @@ static MACHINE_CONFIG_DERIVED_CLASS( c1pmf, c1p, c1pmf_state )
MCFG_DEVICE_ADD("floppy_clock", CLOCK, XTAL_4MHz/8) // 250 kHz
MCFG_CLOCK_SIGNAL_HANDLER(DEVWRITELINE("acia_1", acia6850_device, write_txc))
- MCFG_LEGACY_FLOPPY_DRIVE_ADD(FLOPPY_0, osi_floppy_interface)
- MCFG_LEGACY_FLOPPY_IDX_CB(WRITELINE(sb2m600_state, osi470_index_callback))
+ MCFG_FLOPPY_DRIVE_ADD("floppy0", osi_floppies, "ssdd", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("floppy1", osi_floppies, NULL, floppy_image_device::default_floppy_formats)
/* internal ram */
MCFG_RAM_MODIFY(RAM_TAG)
diff --git a/src/mess/drivers/partner.c b/src/mess/drivers/partner.c
index 27ed71a4c43..224f17fc2a3 100644
--- a/src/mess/drivers/partner.c
+++ b/src/mess/drivers/partner.c
@@ -212,7 +212,7 @@ static MACHINE_CONFIG_START( partner, partner_state )
MCFG_SOFTWARE_LIST_ADD("cass_list","partner_cass")
- MCFG_FD1793x_ADD("wd1793", XTAL_16MHz / 16)
+ MCFG_FD1793_ADD("wd1793", XTAL_16MHz / 16)
MCFG_WD_FDC_DRQ_CALLBACK(DEVWRITELINE("dma8257", i8257_device, dreq0_w))
MCFG_FLOPPY_DRIVE_ADD("wd1793:0", partner_floppies, "525qd", partner_state::floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("wd1793:1", partner_floppies, "525qd", partner_state::floppy_formats)
diff --git a/src/mess/drivers/pc.c b/src/mess/drivers/pc.c
index 5f2dd41c751..90d74109e2c 100644
--- a/src/mess/drivers/pc.c
+++ b/src/mess/drivers/pc.c
@@ -389,12 +389,6 @@ ROM_START( olivm15 )
ROM_LOAD( "oliv_m15.bin",0xfc000, 0x04000, CRC(bf2ef795) SHA1(02d497131f5ca2c78f2accd38ab0eab6813e3ebf))
ROM_END
-ROM_START( olypeopl )
- ROM_REGION(0x100000,"maincpu", 0)
- ROM_LOAD16_BYTE( "uo1271c0.bin", 0xfe000, 0x1000, CRC(c9187bce) SHA1(464e1f96046657b49afa4223ede1040650643d58))
- ROM_LOAD16_BYTE( "uo1271d0.bin", 0xfe001, 0x1000, CRC(10e6437b) SHA1(0b77bb7a62f0a8240602f4cdcc3d6765e62894f4))
-ROM_END
-
ROM_START( sx16 )
ROM_REGION(0x100000,"maincpu", 0)
ROM_LOAD( "tmm27128ad.bin",0xfc000, 0x4000, CRC(f8543362) SHA1(fef625e260ca89ba02174584bdc12db609f0780e))
@@ -474,7 +468,6 @@ COMP( 1983, ibm5550, ibm5150, 0, ibm5550, pccga, driver_device
COMP( 1985, pc7000, ibm5150, 0, pccga, pccga, driver_device, 0, "Sharp", "PC-7000", GAME_NOT_WORKING)
-COMP( 198?, olypeopl, ibm5150, 0, pccga, pccga, driver_device, 0, "Olympia", "People PC", GAME_NOT_WORKING)
COMP( 1988, sx16, ibm5150, 0, pccga, pccga, driver_device, 0, "Sanyo", "SX-16", GAME_NOT_WORKING)
COMP( 198?, mbc16, ibm5150, 0, pccga, pccga, driver_device, 0, "Sanyo", "MBC-16" , GAME_NOT_WORKING)
diff --git a/src/mess/drivers/pcd.c b/src/mess/drivers/pcd.c
index fd1bdd664ed..06f3565e543 100644
--- a/src/mess/drivers/pcd.c
+++ b/src/mess/drivers/pcd.c
@@ -1,5 +1,5 @@
// license:GPL-2.0+
-// copyright-holders:Dirk Best
+// copyright-holders:Dirk Best, Carl
/***************************************************************************
Siemens PC-D
@@ -436,9 +436,8 @@ ADDRESS_MAP_END
//**************************************************************************
static SLOT_INTERFACE_START( pcd_floppies )
- SLOT_INTERFACE("55f", TEAC_FD_55F)
- SLOT_INTERFACE("55g", TEAC_FD_55G)
- SLOT_INTERFACE("525dsqd", FLOPPY_525_QD) // the devices above cause a crash in floppy_image_format_t::generate_track_from_levels
+ SLOT_INTERFACE("55f", TEAC_FD_55F) // 80 tracks
+ SLOT_INTERFACE("55g", TEAC_FD_55G) // 77 tracks
SLOT_INTERFACE_END
FLOPPY_FORMATS_MEMBER( pcd_state::floppy_formats )
@@ -470,14 +469,14 @@ static MACHINE_CONFIG_START( pcd, pcd_state )
MCFG_NVRAM_ADD_1FILL("nvram")
// floppy disk controller
- MCFG_WD2793x_ADD("fdc", XTAL_16MHz / 8)
+ MCFG_WD2793_ADD("fdc", XTAL_16MHz / 8)
MCFG_WD_FDC_INTRQ_CALLBACK(DEVWRITELINE("pic1", pic8259_device, ir6_w))
MCFG_WD_FDC_DRQ_CALLBACK(DEVWRITELINE("maincpu", i80186_cpu_device, drq1_w))
MCFG_WD_FDC_ENMF_CALLBACK(GND)
// floppy drives
- MCFG_FLOPPY_DRIVE_ADD("fdc:0", pcd_floppies, "525dsqd", pcd_state::floppy_formats)
- MCFG_FLOPPY_DRIVE_ADD("fdc:1", pcd_floppies, "525dsqd", pcd_state::floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("fdc:0", pcd_floppies, "55f", pcd_state::floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("fdc:1", pcd_floppies, "55f", pcd_state::floppy_formats)
// usart
MCFG_DEVICE_ADD("usart1", MC2661, XTAL_4_9152MHz)
@@ -538,8 +537,12 @@ MACHINE_CONFIG_END
ROM_START( pcd )
ROM_REGION(0x4000, "bios", 0)
- ROM_LOAD16_BYTE("s26361-d359.d42", 0x0001, 0x2000, CRC(e20244dd) SHA1(0ebc5ddb93baacd9106f1917380de58aac64fe73))
- ROM_LOAD16_BYTE("s26361-d359.d43", 0x0000, 0x2000, CRC(e03db2ec) SHA1(fcae8b0c9e7543706817b0a53872826633361fda))
+ ROM_SYSTEM_BIOS(0, "v2", "V2 GS") // from mainboard SYBAC S26361-D359 V2 GS
+ ROMX_LOAD("s26361-d359.d42", 0x0001, 0x2000, CRC(e20244dd) SHA1(0ebc5ddb93baacd9106f1917380de58aac64fe73), ROM_SKIP(1) | ROM_BIOS(1))
+ ROMX_LOAD("s26361-d359.d43", 0x0000, 0x2000, CRC(e03db2ec) SHA1(fcae8b0c9e7543706817b0a53872826633361fda), ROM_SKIP(1) | ROM_BIOS(1))
+ ROM_SYSTEM_BIOS(1, "v3", "V3 GS4") // from mainboard SYBAC S26361-D359 V3 GS4
+ ROMX_LOAD("361d0359.d42", 0x0001, 0x2000, CRC(5b4461e4) SHA1(db6756aeabb2e6d3921dc7571a5bed3497b964bf), ROM_SKIP(1) | ROM_BIOS(2))
+ ROMX_LOAD("361d0359.d43", 0x0000, 0x2000, CRC(71c3189d) SHA1(e8dd6c632bfc833074d3a833ea7f59bb5460f313), ROM_SKIP(1) | ROM_BIOS(2))
// gfx card (scn2674 with 8741), to be moved
ROM_REGION(0x400, "graphics", 0)
diff --git a/src/mess/drivers/pdp1.c b/src/mess/drivers/pdp1.c
index 4dc3645143c..66ec3979cfb 100644
--- a/src/mess/drivers/pdp1.c
+++ b/src/mess/drivers/pdp1.c
@@ -1,4 +1,4 @@
-// license:???
+// license:GPL-2.0+
// copyright-holders:Raphael Nabet
/*
diff --git a/src/mess/drivers/pentagon.c b/src/mess/drivers/pentagon.c
index 874335ccd49..61265e75ab4 100644
--- a/src/mess/drivers/pentagon.c
+++ b/src/mess/drivers/pentagon.c
@@ -29,6 +29,8 @@ public:
DECLARE_DIRECT_UPDATE_MEMBER(pentagon_direct);
DECLARE_WRITE8_MEMBER(pentagon_port_7ffd_w);
+ DECLARE_WRITE8_MEMBER(pentagon_scr_w);
+ DECLARE_WRITE8_MEMBER(pentagon_scr2_w);
DECLARE_MACHINE_RESET(pentagon);
INTERRUPT_GEN_MEMBER(pentagon_interrupt);
TIMER_CALLBACK_MEMBER(irq_on);
@@ -132,6 +134,21 @@ WRITE8_MEMBER(pentagon_state::pentagon_port_7ffd_w)
pentagon_update_memory();
}
+WRITE8_MEMBER(pentagon_state::pentagon_scr_w)
+{
+ spectrum_UpdateScreenBitmap();
+
+ *((UINT8*)m_bank2->base() + offset) = data;
+}
+
+WRITE8_MEMBER(pentagon_state::pentagon_scr2_w)
+{
+ if ((m_port_7ffd_data & 0x0f) == 0x0f || (m_port_7ffd_data & 0x0f) == 5)
+ spectrum_UpdateScreenBitmap();
+
+ *((UINT8*)m_bank4->base() + offset) = data;
+}
+
void pentagon_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
switch (id)
@@ -184,6 +201,9 @@ MACHINE_RESET_MEMBER(pentagon_state,pentagon)
space.install_read_bank(0x0000, 0x3fff, "bank1");
space.unmap_write(0x0000, 0x3fff);
+ space.install_write_handler(0x4000, 0x5aff, write8_delegate(FUNC(pentagon_state::pentagon_scr_w), this));
+ space.install_write_handler(0xc000, 0xdaff, write8_delegate(FUNC(pentagon_state::pentagon_scr2_w), this));
+
if (m_beta->started())
{
if (strcmp(machine().system().name, "pent1024")==0)
diff --git a/src/mess/drivers/peoplepc.c b/src/mess/drivers/peoplepc.c
new file mode 100644
index 00000000000..26216fd9d85
--- /dev/null
+++ b/src/mess/drivers/peoplepc.c
@@ -0,0 +1,302 @@
+// license:BSD-3-Clause
+// copyright-holders:Carl
+
+#include "emu.h"
+#include "cpu/i86/i86.h"
+#include "machine/pic8259.h"
+#include "machine/pit8253.h"
+#include "machine/i8255.h"
+#include "machine/i8251.h"
+#include "machine/i8257.h"
+#include "machine/upd765.h"
+#include "video/mc6845.h"
+#include "bus/rs232/rs232.h"
+#include "bus/rs232/keyboard.h"
+
+class peoplepc_state : public driver_device
+{
+public:
+ peoplepc_state(const machine_config &mconfig, device_type type, const char *tag) :
+ driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_palette(*this, "palette"),
+ m_pic_1(*this, "pic8259_1"),
+ m_8251key(*this, "i8251_0"),
+ m_8251ser(*this, "i8251_1"),
+ m_fdc(*this, "upd765"),
+ m_flop0(*this, "upd765:0"),
+ m_flop1(*this, "upd765:1"),
+ m_dmac(*this, "i8257"),
+ m_gfxdecode(*this, "gfxdecode"),
+ m_gvram(*this, "gvram"),
+ m_cvram(*this, "cvram"),
+ m_charram(4*1024)
+ { }
+ required_device<cpu_device> m_maincpu;
+ required_device<palette_device> m_palette;
+ required_device<pic8259_device> m_pic_1;
+ required_device<i8251_device> m_8251key;
+ required_device<i8251_device> m_8251ser;
+ required_device<upd765a_device> m_fdc;
+ required_device<floppy_connector> m_flop0;
+ required_device<floppy_connector> m_flop1;
+ required_device<i8257_device> m_dmac;
+ required_device<gfxdecode_device> m_gfxdecode;
+ required_shared_ptr<UINT16> m_gvram;
+ required_shared_ptr<UINT16> m_cvram;
+ dynamic_buffer m_charram;
+
+ MC6845_UPDATE_ROW(update_row);
+ DECLARE_READ8_MEMBER(get_slave_ack);
+ DECLARE_WRITE16_MEMBER(charram_w);
+ DECLARE_WRITE_LINE_MEMBER(tty_clock_tick_w);
+ DECLARE_WRITE_LINE_MEMBER(kbd_clock_tick_w);
+ DECLARE_WRITE8_MEMBER(dmapg_w);
+ DECLARE_WRITE_LINE_MEMBER(tc_w);
+ DECLARE_WRITE_LINE_MEMBER(hrq_w);
+ DECLARE_READ8_MEMBER(memory_read_byte);
+ DECLARE_WRITE8_MEMBER(memory_write_byte);
+ DECLARE_FLOPPY_FORMATS( floppy_formats );
+ int floppy_load(floppy_image_device *dev);
+ void floppy_unload(floppy_image_device *dev);
+
+ UINT8 m_dma0pg;
+protected:
+ virtual void machine_start();
+ virtual void machine_reset();
+};
+
+static const gfx_layout peoplepc_charlayout =
+{
+ 8, 19, /* 8 x 19 characters */
+ 128, /* 128 characters */
+ 1, /* 1 bits per pixel */
+ { 0 }, /* no bitplanes */
+ /* x offsets */
+ { 7, 6, 5, 4, 3, 2, 1, 0},
+ /* y offsets */
+ { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8, 16*8, 17*8, 18*8 },
+ 8*32
+};
+
+MC6845_UPDATE_ROW(peoplepc_state::update_row)
+{
+ const rgb_t *palette = m_palette->palette()->entry_list_raw();
+ int i, j;
+
+ for(i = 0; i < x_count; i++)
+ {
+ if(0)
+ {
+ UINT16 offset = ((ma | (ra << 1)) << 4) + i;
+ UINT8 data = m_gvram[offset] >> (offset & 1 ? 8 : 0);
+
+ for(j = 8; j >= 0; j--)
+ bitmap.pix32(y, (i * 8) + j) = palette[( data & 1 << j ) ? 1 : 0];
+ }
+ else
+ {
+ UINT8 data = m_charram[(m_cvram[(ma + i) & 0x3fff] & 0x7f) * 32 + ra];
+ for(j = 0; j < 8; j++)
+ bitmap.pix32(y, (i * 8) + j) = palette[(data & (1 << j)) ? 1 : 0];
+ }
+ }
+}
+
+READ8_MEMBER(peoplepc_state::get_slave_ack)
+{
+ if (offset == 7)
+ return m_pic_1->acknowledge();
+
+ return 0x00;
+}
+
+WRITE16_MEMBER(peoplepc_state::charram_w)
+{
+ m_charram[offset] = data;
+ m_gfxdecode->gfx(0)->mark_dirty(offset/16);
+}
+
+WRITE_LINE_MEMBER(peoplepc_state::tty_clock_tick_w)
+{
+ m_8251ser->write_txc(state);
+ m_8251ser->write_rxc(state);
+}
+
+WRITE_LINE_MEMBER(peoplepc_state::kbd_clock_tick_w)
+{
+ m_8251key->write_txc(state);
+ m_8251key->write_rxc(state);
+}
+
+WRITE8_MEMBER(peoplepc_state::dmapg_w)
+{
+ m_dma0pg = data;
+}
+
+WRITE_LINE_MEMBER(peoplepc_state::tc_w)
+{
+ m_fdc->tc_w(state);
+}
+
+WRITE_LINE_MEMBER(peoplepc_state::hrq_w)
+{
+ m_maincpu->set_input_line(INPUT_LINE_HALT, state);
+ m_dmac->hlda_w(state);
+}
+
+READ8_MEMBER(peoplepc_state::memory_read_byte)
+{
+ address_space& prog_space = m_maincpu->space(AS_PROGRAM);
+ return prog_space.read_byte(offset | (m_dma0pg << 16));
+}
+
+WRITE8_MEMBER(peoplepc_state::memory_write_byte)
+{
+ address_space& prog_space = m_maincpu->space(AS_PROGRAM);
+ prog_space.write_byte(offset | (m_dma0pg << 16), data);
+}
+
+int peoplepc_state::floppy_load(floppy_image_device *dev)
+{
+ dev->mon_w(0);
+ return IMAGE_INIT_PASS;
+}
+
+void peoplepc_state::floppy_unload(floppy_image_device *dev)
+{
+ dev->mon_w(1);
+}
+
+void peoplepc_state::machine_reset()
+{
+ m_flop0->get_device()->mon_w(!m_flop0->get_device()->exists());
+ m_flop1->get_device()->mon_w(!m_flop1->get_device()->exists());
+}
+
+void peoplepc_state::machine_start()
+{
+ m_gfxdecode->set_gfx(0, global_alloc(gfx_element(machine().device<palette_device>("palette"), peoplepc_charlayout, &m_charram[0], 0, 1, 0)));
+ m_dma0pg = 0;
+
+ // FIXME: cheat as there no docs about how or obvious ports that set to control the motor
+ m_flop0->get_device()->setup_load_cb(floppy_image_device::load_cb(FUNC(peoplepc_state::floppy_load), this));
+ m_flop0->get_device()->setup_unload_cb(floppy_image_device::unload_cb(FUNC(peoplepc_state::floppy_unload), this));
+ m_flop1->get_device()->setup_load_cb(floppy_image_device::load_cb(FUNC(peoplepc_state::floppy_load), this));
+ m_flop1->get_device()->setup_unload_cb(floppy_image_device::unload_cb(FUNC(peoplepc_state::floppy_unload), this));
+}
+
+static ADDRESS_MAP_START( peoplepc_map, AS_PROGRAM, 16, peoplepc_state )
+ ADDRESS_MAP_UNMAP_HIGH
+ AM_RANGE(0x00000, 0x7ffff) AM_RAM
+ AM_RANGE(0xc0000, 0xdffff) AM_RAM AM_SHARE("gvram")
+ AM_RANGE(0xe0000, 0xe3fff) AM_RAM AM_SHARE("cvram")
+ AM_RANGE(0xe4000, 0xe5fff) AM_WRITE(charram_w)
+ AM_RANGE(0xfe000, 0xfffff) AM_ROM AM_REGION("maincpu", 0)
+ADDRESS_MAP_END
+
+static ADDRESS_MAP_START(peoplepc_io, AS_IO, 16, peoplepc_state )
+ ADDRESS_MAP_UNMAP_HIGH
+ AM_RANGE(0x0014, 0x0017) AM_DEVREADWRITE8("pic8259_1", pic8259_device, read, write, 0x00ff)
+ AM_RANGE(0x0018, 0x001b) AM_DEVREADWRITE8("pic8259_0", pic8259_device, read, write, 0x00ff)
+ AM_RANGE(0x0020, 0x0031) AM_DEVREADWRITE8("i8257", i8257_device, read, write, 0x00ff)
+ AM_RANGE(0x0040, 0x0047) AM_DEVREADWRITE8("ppi8255", i8255_device, read, write, 0x00ff)
+ AM_RANGE(0x0048, 0x004f) AM_DEVREADWRITE8("pit8253", pit8253_device, read, write, 0x00ff)
+ AM_RANGE(0x0054, 0x0055) AM_DEVREADWRITE8("i8251_0", i8251_device, data_r, data_w, 0x00ff)
+ AM_RANGE(0x0056, 0x0057) AM_DEVREADWRITE8("i8251_0", i8251_device, status_r, control_w, 0x00ff)
+ AM_RANGE(0x005c, 0x005d) AM_DEVREADWRITE8("i8251_1", i8251_device, data_r, data_w, 0x00ff)
+ AM_RANGE(0x005e, 0x005f) AM_DEVREADWRITE8("i8251_1", i8251_device, status_r, control_w, 0x00ff)
+ AM_RANGE(0x0064, 0x0067) AM_DEVICE8("upd765", upd765a_device, map, 0x00ff)
+ AM_RANGE(0x006c, 0x006d) AM_DEVWRITE8("h46505", mc6845_device, address_w, 0x00ff)
+ AM_RANGE(0x006e, 0x006f) AM_DEVREADWRITE8("h46505", mc6845_device, register_r, register_w, 0x00ff)
+ AM_RANGE(0x0070, 0x0071) AM_WRITE8(dmapg_w, 0x00ff)
+ADDRESS_MAP_END
+
+static SLOT_INTERFACE_START( peoplepc_floppies )
+ SLOT_INTERFACE( "525qd", FLOPPY_525_QD )
+SLOT_INTERFACE_END
+
+FLOPPY_FORMATS_MEMBER( peoplepc_state::floppy_formats )
+ FLOPPY_IMD_FORMAT
+FLOPPY_FORMATS_END
+
+SLOT_INTERFACE_START( peoplepc_keyboard_devices )
+ SLOT_INTERFACE("keyboard", SERIAL_KEYBOARD)
+SLOT_INTERFACE_END
+
+static DEVICE_INPUT_DEFAULTS_START(keyboard)
+ DEVICE_INPUT_DEFAULTS( "RS232_TXBAUD", 0xff, RS232_BAUD_1200 )
+ 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_EVEN )
+ DEVICE_INPUT_DEFAULTS( "RS232_STOPBITS", 0xff, RS232_STOPBITS_1 )
+DEVICE_INPUT_DEFAULTS_END
+
+static MACHINE_CONFIG_START( olypeopl, peoplepc_state)
+ /* basic machine hardware */
+ MCFG_CPU_ADD("maincpu", I8086, XTAL_14_7456MHz/3)
+ MCFG_CPU_PROGRAM_MAP(peoplepc_map)
+ MCFG_CPU_IO_MAP(peoplepc_io)
+ MCFG_CPU_IRQ_ACKNOWLEDGE_DEVICE("pic8259_0", pic8259_device, inta_cb)
+
+ MCFG_DEVICE_ADD("pit8253", PIT8253, 0)
+ MCFG_PIT8253_CLK0(XTAL_14_7456MHz/6)
+ MCFG_PIT8253_OUT0_HANDLER(WRITELINE(peoplepc_state, kbd_clock_tick_w))
+ MCFG_PIT8253_CLK1(XTAL_14_7456MHz/6)
+ MCFG_PIT8253_OUT1_HANDLER(WRITELINE(peoplepc_state, tty_clock_tick_w))
+ MCFG_PIT8253_CLK2(XTAL_14_7456MHz/6)
+ MCFG_PIT8253_OUT2_HANDLER(DEVWRITELINE("pic8259_0", pic8259_device, ir0_w))
+
+ MCFG_PIC8259_ADD("pic8259_0", INPUTLINE("maincpu", 0), VCC, READ8(peoplepc_state, get_slave_ack))
+ MCFG_PIC8259_ADD("pic8259_1", DEVWRITELINE("pic8259_0", pic8259_device, ir7_w), GND, NULL)
+
+ MCFG_DEVICE_ADD("ppi8255", I8255, 0)
+
+ MCFG_SCREEN_ADD("screen", RASTER)
+ MCFG_SCREEN_RAW_PARAMS(XTAL_22MHz,640,0,640,475,0,475)
+ MCFG_SCREEN_UPDATE_DEVICE( "h46505", mc6845_device, screen_update )
+
+ MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty)
+ MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette")
+
+ MCFG_MC6845_ADD("h46505", H46505, "screen", XTAL_22MHz/8)
+ MCFG_MC6845_SHOW_BORDER_AREA(false)
+ MCFG_MC6845_CHAR_WIDTH(8)
+ MCFG_MC6845_UPDATE_ROW_CB(peoplepc_state, update_row)
+
+ MCFG_DEVICE_ADD("i8257", I8257, XTAL_14_7456MHz/3)
+ MCFG_I8257_OUT_HRQ_CB(WRITELINE(peoplepc_state, hrq_w))
+ MCFG_I8257_OUT_TC_CB(WRITELINE(peoplepc_state, tc_w))
+ MCFG_I8257_IN_MEMR_CB(READ8(peoplepc_state, memory_read_byte))
+ MCFG_I8257_OUT_MEMW_CB(WRITE8(peoplepc_state, memory_write_byte))
+ MCFG_I8257_IN_IOR_0_CB(DEVREAD8("upd765", upd765a_device, mdma_r))
+ MCFG_I8257_OUT_IOW_0_CB(DEVWRITE8("upd765", upd765a_device, mdma_w))
+
+ MCFG_UPD765A_ADD("upd765", true, true)
+ MCFG_UPD765_INTRQ_CALLBACK(DEVWRITELINE("pic8259_0", pic8259_device, ir2_w))
+ MCFG_UPD765_DRQ_CALLBACK(DEVWRITELINE("i8257", i8257_device, dreq0_w))
+ MCFG_FLOPPY_DRIVE_ADD("upd765:0", peoplepc_floppies, "525qd", peoplepc_state::floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("upd765:1", peoplepc_floppies, "525qd", peoplepc_state::floppy_formats)
+
+ MCFG_DEVICE_ADD("i8251_0", I8251, 0)
+ MCFG_I8251_RXRDY_HANDLER(DEVWRITELINE("pic8259_1", pic8259_device, ir1_w))
+ MCFG_I8251_TXD_HANDLER(DEVWRITELINE("kbd", rs232_port_device, write_txd))
+
+ MCFG_RS232_PORT_ADD("kbd", peoplepc_keyboard_devices, "keyboard")
+ MCFG_RS232_RXD_HANDLER(DEVWRITELINE("i8251_0", i8251_device, write_rxd))
+ MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("keyboard", keyboard)
+
+ MCFG_DEVICE_ADD("i8251_1", I8251, 0)
+MACHINE_CONFIG_END
+
+ROM_START( olypeopl )
+ ROM_REGION(0x2000,"maincpu", 0)
+ ROM_SYSTEM_BIOS(0, "hd", "HD ROM")
+ ROMX_LOAD( "u01271c0.bin", 0x00000, 0x1000, CRC(8e0ef114) SHA1(774bab0a3e29853e9f6b951cf73082063ea61e6d), ROM_SKIP(1)|ROM_BIOS(1))
+ ROMX_LOAD( "u01271d0.bin", 0x00001, 0x1000, CRC(e2419bf9) SHA1(d88381f8709c91e2adba08f378e29bd0d19ee5ae), ROM_SKIP(1)|ROM_BIOS(1))
+ ROM_SYSTEM_BIOS(1, "2fd", "2 FD ROM")
+ ROMX_LOAD( "u01277f3.bin", 0x00000, 0x1000, CRC(428ff135) SHA1(ec11f0e43455570c40f5dc4b84f8420da5939368), ROM_SKIP(1)|ROM_BIOS(2))
+ ROMX_LOAD( "u01277g3.bin", 0x00001, 0x1000, CRC(3295691c) SHA1(7d7ade62117d11656b8dd86cf0703127616d55bc), ROM_SKIP(1)|ROM_BIOS(2))
+ROM_END
+
+COMP( 198?, olypeopl, 0, 0, olypeopl, 0, driver_device, 0, "Olympia", "People PC", GAME_NOT_WORKING|GAME_NO_SOUND)
diff --git a/src/mess/drivers/pk8020.c b/src/mess/drivers/pk8020.c
index e238baf7b3c..1b8e83ef527 100644
--- a/src/mess/drivers/pk8020.c
+++ b/src/mess/drivers/pk8020.c
@@ -14,7 +14,7 @@
#include "cpu/i8085/i8085.h"
#include "machine/i8255.h"
#include "imagedev/flopdrv.h"
-#include "formats/basicdsk.h"
+#include "formats/pk8020_dsk.h"
#include "includes/pk8020.h"
#include "machine/ram.h"
@@ -141,21 +141,6 @@ static INPUT_PORTS_START( pk8020 )
PORT_BIT(0xFF, IP_ACTIVE_HIGH, IPT_UNUSED)
INPUT_PORTS_END
-static LEGACY_FLOPPY_OPTIONS_START(pk8020)
- LEGACY_FLOPPY_OPTION(pk8020, "kdi", "PK8020 disk image", basicdsk_identify_default, basicdsk_construct_default, NULL,
- HEADS([2])
- TRACKS([80])
- SECTORS([5])
- SECTOR_LENGTH([1024])
- FIRST_SECTOR_ID([1]))
-LEGACY_FLOPPY_OPTIONS_END
-
-static const floppy_interface pk8020_floppy_interface =
-{
- FLOPPY_STANDARD_5_25_DSHD,
- LEGACY_FLOPPY_OPTIONS_NAME(pk8020),
- "floppy_5_25"
-};
/* F4 Character Displayer */
static const gfx_layout pk8020_charlayout =
@@ -176,6 +161,15 @@ static GFXDECODE_START( pk8020 )
GFXDECODE_END
+FLOPPY_FORMATS_MEMBER( pk8020_state::floppy_formats )
+ FLOPPY_PK8020_FORMAT
+FLOPPY_FORMATS_END
+
+static SLOT_INTERFACE_START( pk8020_floppies )
+ SLOT_INTERFACE("qd", FLOPPY_525_QD)
+SLOT_INTERFACE_END
+
+
/* Machine driver */
static MACHINE_CONFIG_START( pk8020, pk8020_state )
/* basic machine hardware */
@@ -221,9 +215,14 @@ static MACHINE_CONFIG_START( pk8020, pk8020_state )
MCFG_DEVICE_ADD("rs232", I8251, 0)
MCFG_DEVICE_ADD("lan", I8251, 0)
- MCFG_DEVICE_ADD("wd1793", FD1793, 0)
- MCFG_WD17XX_DEFAULT_DRIVE4_TAGS
- MCFG_WD17XX_DDEN_CALLBACK(VCC)
+ MCFG_FD1793_ADD("wd1793", XTAL_20MHz / 20)
+
+ MCFG_FLOPPY_DRIVE_ADD("wd1793:0", pk8020_floppies, "qd", pk8020_state::floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("wd1793:1", pk8020_floppies, "qd", pk8020_state::floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("wd1793:2", pk8020_floppies, "qd", pk8020_state::floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("wd1793:3", pk8020_floppies, "qd", pk8020_state::floppy_formats)
+
+ MCFG_SOFTWARE_LIST_ADD("flop_list", "korvet_flop")
/* audio hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
@@ -235,9 +234,6 @@ static MACHINE_CONFIG_START( pk8020, pk8020_state )
MCFG_CASSETTE_ADD( "cassette" )
MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_PLAY)
- MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(pk8020_floppy_interface)
- MCFG_SOFTWARE_LIST_ADD("flop_list","korvet_flop")
-
/* internal ram */
MCFG_RAM_ADD(RAM_TAG)
MCFG_RAM_DEFAULT_SIZE("258K") //64 + 4*48 + 2
diff --git a/src/mess/drivers/psx.c b/src/mess/drivers/psx.c
index 5d57d1c74e1..0cf0318d43f 100644
--- a/src/mess/drivers/psx.c
+++ b/src/mess/drivers/psx.c
@@ -44,18 +44,10 @@ public:
UINT8 m_cd_io_status;
UINT8 m_cd_param[8];
UINT8 m_cd_result[8];
- DECLARE_DIRECT_UPDATE_MEMBER(psx_default);
- DECLARE_DIRECT_UPDATE_MEMBER(psx_setopbase);
DECLARE_MACHINE_RESET(psx);
inline void ATTR_PRINTF(3,4) verboselog( int n_level, const char *s_fmt, ... );
- void psxexe_conv32( UINT32 *p_uint32 );
- int load_psxexe( cpu_device *cpu, unsigned char *p_n_file, int n_len );
- void cpe_set_register( cpu_device *cpu, int n_reg, int n_value );
- int load_cpe( cpu_device *cpu, unsigned char *p_n_file, int n_len );
- int load_psf( cpu_device *cpu, unsigned char *p_n_file, int n_len );
void cd_dma_read( UINT32 *p_n_psxram, UINT32 n_address, INT32 n_size );
void cd_dma_write( UINT32 *p_n_psxram, UINT32 n_address, INT32 n_size );
- DECLARE_QUICKLOAD_LOAD_MEMBER( psx_exe_load );
required_device<psxcpu_device> m_maincpu;
required_device<ram_device> m_ram;
};
@@ -77,397 +69,6 @@ inline void ATTR_PRINTF(3,4) psx1_state::verboselog( int n_level, const char *s
}
-void psx1_state::psxexe_conv32( UINT32 *p_uint32 )
-{
- UINT8 *p_uint8;
-
- p_uint8 = (UINT8 *)p_uint32;
-
- *( p_uint32 ) = p_uint8[ 0 ] |
- ( p_uint8[ 1 ] << 8 ) |
- ( p_uint8[ 2 ] << 16 ) |
- ( p_uint8[ 3 ] << 24 );
-}
-
-int psx1_state::load_psxexe( cpu_device *cpu, unsigned char *p_n_file, int n_len )
-{
- struct PSXEXE_HEADER
- {
- UINT8 id[ 8 ];
- UINT32 text; /* SCE only */
- UINT32 data; /* SCE only */
- UINT32 pc0;
- UINT32 gp0; /* SCE only */
- UINT32 t_addr;
- UINT32 t_size;
- UINT32 d_addr; /* SCE only */
- UINT32 d_size; /* SCE only */
- UINT32 b_addr; /* SCE only */
- UINT32 b_size; /* SCE only */
- UINT32 s_addr;
- UINT32 s_size;
- UINT32 SavedSP;
- UINT32 SavedFP;
- UINT32 SavedGP;
- UINT32 SavedRA;
- UINT32 SavedS0;
- UINT8 dummy[ 0x800 - 76 ];
- };
-
- struct PSXEXE_HEADER *psxexe_header = (struct PSXEXE_HEADER *)p_n_file;
-
- if( n_len >= sizeof( struct PSXEXE_HEADER ) &&
- memcmp( psxexe_header->id, "PS-X EXE", 8 ) == 0 )
- {
- psxexe_conv32( &psxexe_header->text );
- psxexe_conv32( &psxexe_header->data );
- psxexe_conv32( &psxexe_header->pc0 );
- psxexe_conv32( &psxexe_header->gp0 );
- psxexe_conv32( &psxexe_header->t_addr );
- psxexe_conv32( &psxexe_header->t_size );
- psxexe_conv32( &psxexe_header->d_addr );
- psxexe_conv32( &psxexe_header->d_size );
- psxexe_conv32( &psxexe_header->b_addr );
- psxexe_conv32( &psxexe_header->b_size );
- psxexe_conv32( &psxexe_header->s_addr );
- psxexe_conv32( &psxexe_header->s_size );
- psxexe_conv32( &psxexe_header->SavedSP );
- psxexe_conv32( &psxexe_header->SavedFP );
- psxexe_conv32( &psxexe_header->SavedGP );
- psxexe_conv32( &psxexe_header->SavedRA );
- psxexe_conv32( &psxexe_header->SavedS0 );
-
- /* todo: check size.. */
-
- logerror( "psx_exe_load: pc %08x\n", psxexe_header->pc0 );
- logerror( "psx_exe_load: org %08x\n", psxexe_header->t_addr );
- logerror( "psx_exe_load: len %08x\n", psxexe_header->t_size );
- logerror( "psx_exe_load: sp %08x\n", psxexe_header->s_addr );
- logerror( "psx_exe_load: len %08x\n", psxexe_header->s_size );
-
- UINT8 *p_ram = m_ram->pointer();
- UINT32 n_ram = m_ram->size();
-
- UINT8 *p_psxexe = p_n_file + sizeof( struct PSXEXE_HEADER );
-
- UINT32 n_address = psxexe_header->t_addr;
- UINT32 n_size = psxexe_header->t_size;
- while( n_size != 0 )
- {
- p_ram[ BYTE4_XOR_LE( n_address ) % n_ram ] = *( p_psxexe );
- n_address++;
- p_psxexe++;
- n_size--;
- }
-
- cpu->set_state_int( PSXCPU_PC, psxexe_header->pc0 );
- cpu->set_state_int( PSXCPU_R28, psxexe_header->gp0 );
- UINT32 n_stack = psxexe_header->s_addr + psxexe_header->s_size;
- if( n_stack != 0 )
- {
- cpu->set_state_int( PSXCPU_R29, n_stack );
- cpu->set_state_int( PSXCPU_R30, n_stack );
- }
-
- return 1;
- }
- return 0;
-}
-
-void psx1_state::cpe_set_register( cpu_device *cpu, int n_reg, int n_value )
-{
- if( n_reg < 0x80 && ( n_reg % 4 ) == 0 )
- {
- logerror( "psx_exe_load: r%-2d %08x\n", n_reg / 4, n_value );
- cpu->set_state_int( PSXCPU_R0 + ( n_reg / 4 ), n_value );
- }
- else if( n_reg == 0x80 )
- {
- logerror( "psx_exe_load: lo %08x\n", n_value );
- cpu->set_state_int( PSXCPU_LO, n_value );
- }
- else if( n_reg == 0x84 )
- {
- logerror( "psx_exe_load: hi %08x\n", n_value );
- cpu->set_state_int( PSXCPU_HI, n_value );
- }
- else if( n_reg == 0x88 )
- {
- logerror( "psx_exe_load: sr %08x\n", n_value );
- cpu->set_state_int( PSXCPU_CP0R12, n_value );
- }
- else if( n_reg == 0x8c )
- {
- logerror( "psx_exe_load: cause %08x\n", n_value );
- cpu->set_state_int( PSXCPU_CP0R13, n_value );
- }
- else if( n_reg == 0x90 )
- {
- logerror( "psx_exe_load: pc %08x\n", n_value );
- cpu->set_state_int( PSXCPU_PC, n_value );
- }
- else if( n_reg == 0x94 )
- {
- logerror( "psx_exe_load: prid %08x\n", n_value );
- cpu->set_state_int( PSXCPU_CP0R15, n_value );
- }
- else
- {
- logerror( "psx_exe_load: invalid register %04x/%08x\n", n_reg, n_value );
- }
-}
-
-int psx1_state::load_cpe( cpu_device *cpu, unsigned char *p_n_file, int n_len )
-{
- if( n_len >= 4 &&
- memcmp( p_n_file, "CPE\001", 4 ) == 0 )
- {
- int n_offset = 4;
-
- for( ;; )
- {
- if( n_offset >= n_len || p_n_file[ n_offset ] > 8 )
- {
- break;
- }
-
- switch( p_n_file[ n_offset++ ] )
- {
- case 0:
- /* end of file */
- return 1;
- case 1:
- /* read bytes */
- {
- int n_address = ( (int)p_n_file[ n_offset + 0 ] << 0 ) |
- ( (int)p_n_file[ n_offset + 1 ] << 8 ) |
- ( (int)p_n_file[ n_offset + 2 ] << 16 ) |
- ( (int)p_n_file[ n_offset + 3 ] << 24 );
- int n_size = ( (int)p_n_file[ n_offset + 4 ] << 0 ) |
- ( (int)p_n_file[ n_offset + 5 ] << 8 ) |
- ( (int)p_n_file[ n_offset + 6 ] << 16 ) |
- ( (int)p_n_file[ n_offset + 7 ] << 24 );
-
- UINT8 *p_ram = m_ram->pointer();
- UINT32 n_ram = m_ram->size();
-
- n_offset += 8;
-
- logerror( "psx_exe_load: org %08x\n", n_address );
- logerror( "psx_exe_load: len %08x\n", n_size );
-
- while( n_size > 0 )
- {
- p_ram[ BYTE4_XOR_LE( n_address ) % n_ram ] = p_n_file[ n_offset++ ];
- n_address++;
- n_size--;
- }
- break;
- }
- case 2:
- /* run address: not tested */
- {
- int n_value = ( (int)p_n_file[ n_offset + 2 ] << 0 ) |
- ( (int)p_n_file[ n_offset + 3 ] << 8 ) |
- ( (int)p_n_file[ n_offset + 4 ] << 16 ) |
- ( (int)p_n_file[ n_offset + 5 ] << 24 );
-
- n_offset += 4;
-
- cpe_set_register( cpu, 0x90, n_value );
- break;
- }
- case 3:
- /* set reg to longword */
- {
- int n_reg = ( (int)p_n_file[ n_offset + 0 ] << 0 ) |
- ( (int)p_n_file[ n_offset + 1 ] << 8 );
- int n_value = ( (int)p_n_file[ n_offset + 2 ] << 0 ) |
- ( (int)p_n_file[ n_offset + 3 ] << 8 ) |
- ( (int)p_n_file[ n_offset + 4 ] << 16 ) |
- ( (int)p_n_file[ n_offset + 5 ] << 24 );
-
- n_offset += 6;
-
- cpe_set_register( cpu, n_reg, n_value );
- break;
- }
- case 4:
- /* set reg to word: not tested */
- {
- int n_reg = ( (int)p_n_file[ n_offset + 0 ] << 0 ) |
- ( (int)p_n_file[ n_offset + 1 ] << 8 );
- int n_value = ( (int)p_n_file[ n_offset + 2 ] << 0 ) |
- ( (int)p_n_file[ n_offset + 3 ] << 8 );
-
- n_offset += 4;
-
- cpe_set_register( cpu, n_reg, n_value );
- break;
- }
- case 5:
- /* set reg to byte: not tested */
- {
- int n_reg = ( (int)p_n_file[ n_offset + 0 ] << 0 ) |
- ( (int)p_n_file[ n_offset + 1 ] << 8 );
- int n_value = ( (int)p_n_file[ n_offset + 2 ] << 0 );
-
- n_offset += 3;
-
- cpe_set_register( cpu, n_reg, n_value );
- break;
- }
- case 6:
- /* set reg to 3-byte: not tested */
- {
- int n_reg = ( (int)p_n_file[ n_offset + 0 ] << 0 ) |
- ( (int)p_n_file[ n_offset + 1 ] << 8 );
- int n_value = ( (int)p_n_file[ n_offset + 2 ] << 0 ) |
- ( (int)p_n_file[ n_offset + 3 ] << 8 ) |
- ( (int)p_n_file[ n_offset + 4 ] << 16 );
-
- n_offset += 5;
-
- cpe_set_register( cpu, n_reg, n_value );
- break;
- }
- case 7:
- /* workspace: not tested */
- n_offset += 4;
- break;
- case 8:
- /* unit */
- {
- int n_unit = p_n_file[ n_offset + 0 ];
-
- n_offset++;
-
- logerror( "psx_exe_load: unit %08x\n", n_unit );
- }
- break;
- }
- }
- }
- return 0;
-}
-
-int psx1_state::load_psf( cpu_device *cpu, unsigned char *p_n_file, int n_len )
-{
- int n_return;
- unsigned long n_crc;
- unsigned long n_compressed;
- unsigned char *p_n_compressed;
- unsigned long n_uncompressed;
- dynamic_buffer p_n_uncompressed;
-
- struct PSF_HEADER
- {
- unsigned char id[ 4 ];
- UINT32 reserved_size;
- UINT32 exe_size;
- UINT32 exe_crc;
- };
-
- struct PSF_HEADER *psf_header = (struct PSF_HEADER *)p_n_file;
-
- n_return = 0;
-
- if( n_len >= sizeof( struct PSF_HEADER ) &&
- memcmp( p_n_file, "PSF", 3 ) == 0 )
- {
- psxexe_conv32( &psf_header->reserved_size );
- psxexe_conv32( &psf_header->exe_size );
- psxexe_conv32( &psf_header->exe_crc );
-
- logerror( "psx_exe_load: reserved_size %08x\n", psf_header->reserved_size );
- logerror( "psx_exe_load: exe_size %08x\n", psf_header->exe_size );
- logerror( "psx_exe_load: exe_crc %08x\n", psf_header->exe_crc );
-
- n_compressed = psf_header->exe_size;
- p_n_compressed = p_n_file + sizeof( struct PSF_HEADER ) + psf_header->reserved_size;
-
- n_crc = crc32( crc32( 0L, Z_NULL, 0 ), p_n_compressed, n_compressed );
- if( n_crc != psf_header->exe_crc )
- {
- logerror( "psx_exe_load: psf invalid crc\n" );
- return 0;
- }
-
- n_uncompressed = 0x200000;
- p_n_uncompressed.resize( n_uncompressed );
-
- if( uncompress( &p_n_uncompressed[0], &n_uncompressed, p_n_compressed, n_compressed ) != Z_OK )
- {
- logerror( "psx_exe_load: psf uncompress failed\n" );
- }
- else if( !load_psxexe( cpu, &p_n_uncompressed[0], n_uncompressed ) )
- {
- logerror( "psx_exe_load: psf load failed\n" );
- }
- else
- {
- n_return = 1;
- }
- }
- return n_return;
-}
-
-DIRECT_UPDATE_MEMBER(psx1_state::psx_default)
-{
- return address;
-}
-
-DIRECT_UPDATE_MEMBER(psx1_state::psx_setopbase)
-{
- if( address == 0x80030000 )
- {
- m_maincpu->space(AS_PROGRAM).set_direct_update_handler(direct_update_delegate(FUNC(psx1_state::psx_default), this));
-
- if( load_psxexe( m_maincpu, m_exe_buffer, m_exe_size ) ||
- load_cpe( m_maincpu, m_exe_buffer, m_exe_size ) ||
- load_psf( m_maincpu, m_exe_buffer, m_exe_size ) )
- {
-/* DEBUGGER_BREAK; */
-
- address = m_maincpu->state_int( PSXCPU_PC );
- m_maincpu->set_state_int( PSXCPU_DELAYR, PSXCPU_DELAYR_PC );
- m_maincpu->set_state_int( PSXCPU_DELAYV, address );
- }
- else
- {
- logerror( "psx_exe_load: invalid exe\n" );
- }
-
- m_exe_size = 0;
- global_free_array( m_exe_buffer );
- }
- return address;
-}
-
-QUICKLOAD_LOAD_MEMBER( psx1_state, psx_exe_load )
-{
- address_space &space = m_maincpu->space( AS_PROGRAM );
-
- m_exe_size = 0;
- m_exe_buffer = global_alloc_array( UINT8, quickload_size );
- if( m_exe_buffer == NULL )
- {
- logerror( "psx_exe_load: out of memory\n" );
- return IMAGE_INIT_FAIL;
- }
- if( image.fread( m_exe_buffer, quickload_size ) != quickload_size )
- {
- global_free_array( m_exe_buffer );
- return IMAGE_INIT_FAIL;
- }
- m_exe_size = quickload_size;
- space.set_direct_update_handler(direct_update_delegate(FUNC(psx1_state::psx_setopbase), this));
-
- return IMAGE_INIT_PASS;
-}
-
-/* ----------------------------------------------------------------------- */
-
void psx1_state::cd_dma_read( UINT32 *p_n_psxram, UINT32 n_address, INT32 n_size )
{
UINT8 *psxram = (UINT8 *) p_n_psxram;
@@ -515,9 +116,6 @@ static MACHINE_CONFIG_START( psj, psx1_state )
MCFG_SOUND_ROUTE( 0, "lspeaker", 1.00 )
MCFG_SOUND_ROUTE( 1, "rspeaker", 1.00 )
- /* quickload */
- MCFG_QUICKLOAD_ADD("quickload", psx1_state, psx_exe_load, "cpe,exe,psf,psx", 0)
-
MCFG_SOFTWARE_LIST_ADD("cd_list","psx")
MCFG_DEVICE_MODIFY( "maincpu" )
@@ -564,9 +162,6 @@ static MACHINE_CONFIG_START( pse, psx1_state )
MCFG_SOUND_ROUTE( 0, "lspeaker", 1.00 )
MCFG_SOUND_ROUTE( 1, "rspeaker", 1.00 )
- /* quickload */
- MCFG_QUICKLOAD_ADD("quickload", psx1_state, psx_exe_load, "cpe,exe,psf,psx", 0)
-
MCFG_SOFTWARE_LIST_ADD("cd_list","psx")
MCFG_DEVICE_MODIFY( "maincpu" )
diff --git a/src/mess/drivers/pt68k4.c b/src/mess/drivers/pt68k4.c
index 34dcd687d47..0546a94c4fa 100644
--- a/src/mess/drivers/pt68k4.c
+++ b/src/mess/drivers/pt68k4.c
@@ -397,7 +397,7 @@ static MACHINE_CONFIG_START( pt68k2, pt68k4_state )
MCFG_M48T02_ADD(TIMEKEEPER_TAG)
- MCFG_WD1772x_ADD(WDFDC_TAG, XTAL_16MHz / 2)
+ MCFG_WD1772_ADD(WDFDC_TAG, XTAL_16MHz / 2)
MCFG_FLOPPY_DRIVE_ADD(WDFDC_TAG":0", pt68k_floppies, "525dd", pt68k4_state::floppy_formats)
MCFG_FLOPPY_DRIVE_ADD(WDFDC_TAG":1", pt68k_floppies, "525dd", pt68k4_state::floppy_formats)
diff --git a/src/mess/drivers/pulsar.c b/src/mess/drivers/pulsar.c
index a8f5f17c9a8..609e17013e8 100644
--- a/src/mess/drivers/pulsar.c
+++ b/src/mess/drivers/pulsar.c
@@ -247,7 +247,7 @@ static MACHINE_CONFIG_START( pulsar, pulsar_state )
MCFG_COM8116_FR_HANDLER(WRITELINE(pulsar_state, fr_w))
MCFG_COM8116_FT_HANDLER(WRITELINE(pulsar_state, ft_w))
- MCFG_FD1797x_ADD("fdc", XTAL_4MHz / 2)
+ MCFG_FD1797_ADD("fdc", XTAL_4MHz / 2)
MCFG_FLOPPY_DRIVE_ADD("fdc:0", pulsar_floppies, "525dd", floppy_image_device::default_floppy_formats)
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/px8.c b/src/mess/drivers/px8.c
index c9b1bff8c65..2e797174b5b 100644
--- a/src/mess/drivers/px8.c
+++ b/src/mess/drivers/px8.c
@@ -52,7 +52,7 @@ enum
GAH40M_CTLR1 = 0,
GAH40M_CMDR,
GAH40M_CTLR2,
- GAH40M_IER = 4,
+ GAH40M_IER = 4
};
enum
diff --git a/src/mess/drivers/qx10.c b/src/mess/drivers/qx10.c
index 86d14dd1030..58050c4055f 100644
--- a/src/mess/drivers/qx10.c
+++ b/src/mess/drivers/qx10.c
@@ -466,74 +466,6 @@ READ8_MEMBER( qx10_state::get_slave_ack )
*/
-#if 0
-READ8_MEMBER( qx10_state::upd7201_r )
-{
- if((offset & 2) == 0)
- {
- return m_keyb.rx;
- }
- //printf("R [%02x]\n",offset);
-
- return m_rs232c.rx;
-}
-
-WRITE8_MEMBER( qx10_state::upd7201_w )
-{
- if((offset & 2) == 0) //keyb TX
- {
- switch(data & 0xe0)
- {
- case 0x00:
- m_keyb.repeat_start_time = 300+(data & 0x1f)*25;
- printf("keyb Set repeat start time, %d ms\n",m_keyb.repeat_start_time);
- break;
- case 0x20:
- m_keyb.repeat_interval = 30+(data & 0x1f)*5;
- printf("keyb Set repeat interval, %d ms\n",m_keyb.repeat_interval);
- break;
- case 0x40:
- m_keyb.led[(data & 0xe) >> 1] = data & 1;
- printf("keyb Set led %02x %s\n",((data & 0xe) >> 1),data & 1 ? "on" : "off");
- m_keyb.rx = (data & 0xf) | 0xc0;
- m_pic_m->ir4_w(1);
- break;
- case 0x60:
- printf("keyb Read LED status\n");
- // 0x80 + data
- break;
- case 0x80:
- printf("keyb Read SW status\n");
- // 0xc0 + data
- break;
- case 0xa0:
- m_keyb.repeat = data & 1;
- //printf("keyb repeat flag issued %s\n",data & 1 ? "on" : "off");
- break;
- case 0xc0:
- m_keyb.enable = data & 1;
- printf("keyb Enable flag issued %s\n",data & 1 ? "on" : "off");
- break;
- case 0xe0:
- printf("keyb Reset Issued, diagnostic is %s\n",data & 1 ? "on" : "off");
- m_keyb.rx = 0;
- break;
- }
- }
- else //RS-232c TX
- {
- //printf("RS-232c W %02x\n",data);
- if(data == 0x01) //cheap, but needed for working inputs in "The QX-10 Diagnostic"
- m_rs232c.rx = 0x04;
- else if(data == 0x00)
- m_rs232c.rx = 0xfe;
- else
- m_rs232c.rx = 0xff;
- }
-
-}
-#endif
-
READ8_MEMBER( qx10_state::vram_bank_r )
{
return m_vram_bank;
diff --git a/src/mess/drivers/rainbow.c b/src/mess/drivers/rainbow.c
index 9930b42ff22..d8704fdd71b 100644
--- a/src/mess/drivers/rainbow.c
+++ b/src/mess/drivers/rainbow.c
@@ -1021,10 +1021,12 @@ WRITE8_MEMBER(rainbow_state::share_z80_w)
if (offset < 0x8000)
{
m_shared[offset + 0x8000] = data;
+ return; // [!]
}
else if (offset < 0x8800)
{
m_z80_private[offset & 0x7ff] = data; // SRAM
+ return; // [!]
}
m_shared[offset ^ 0x8000] = data;
@@ -1032,14 +1034,11 @@ WRITE8_MEMBER(rainbow_state::share_z80_w)
else
{
if (offset < 0x800)
- {
m_z80_private[offset] = data; // SRAM
- }
else
- {
m_shared[offset] = data;
- }
}
+ return;
}
@@ -1123,7 +1122,7 @@ static const int SECTOR_SIZES[4] = { 256, 512, 1024, 128 };
void rainbow_state::hdc_reset()
{
- printf(">> HARD DISC CONTROLLER RESET <<\n");
+// printf(">> HARD DISC CONTROLLER RESET <<\n");
logerror(">> HARD DISC CONTROLLER RESET <<\n");
m_hdc->reset(); // NEW HDC
@@ -2016,8 +2015,9 @@ WRITE8_MEMBER(rainbow_state::z80_diskcontrol_w)
{
printf("\n**** INVALID DRIVE ****");
data = (data & (255 - 3)) | m_unit;
- data = data | 8; // MOTOR 0 OFF
- data = data | 16; // MOTOR 1 OFF
+
+ data = data & (255 - 8); // MOTOR 0 OFF
+ data = data & (255 - 16); // MOTOR 1 OFF
}
else
{
@@ -2025,11 +2025,11 @@ WRITE8_MEMBER(rainbow_state::z80_diskcontrol_w)
if (m_unit < 2)
{
- data = data & (255 - 8); // MOTOR 0 (for A or B)
+ data = data | 8; // MOTOR 0 (for A or B)
}
else
{
- data = data & (255 - 16); // MOTOR 1 (for C or D)
+ data = data | 16; // MOTOR 1 (for C or D)
enable_start = 2;
disable_start = 4;
}
@@ -2312,7 +2312,7 @@ MCFG_VT_CHARGEN("chargen")
MCFG_VT_VIDEO_RAM_CALLBACK(READ8(rainbow_state, read_video_ram_r))
MCFG_VT_VIDEO_CLEAR_VIDEO_INTERRUPT_CALLBACK(WRITELINE(rainbow_state, clear_video_interrupt))
-MCFG_FD1793x_ADD(FD1793_TAG, XTAL_24_0734MHz / 24) // no separate 1 Mhz quartz
+MCFG_FD1793_ADD(FD1793_TAG, XTAL_24_0734MHz / 24) // no separate 1 Mhz quartz
//MCFG_WD_FDC_FORCE_READY
MCFG_FLOPPY_DRIVE_ADD(FD1793_TAG ":0", rainbow_floppies, "525qd0", rainbow_state::floppy_formats)
MCFG_FLOPPY_DRIVE_ADD(FD1793_TAG ":1", rainbow_floppies, "525qd1", rainbow_state::floppy_formats)
@@ -2365,87 +2365,97 @@ MCFG_TIMER_DRIVER_ADD_PERIODIC("motor", rainbow_state, motor_tick, attotime::fro
MCFG_NVRAM_ADD_0FILL("nvram")
MACHINE_CONFIG_END
+//----------------------------------------------------------------------------------------
// 'Rainbow 100-A' (system module 70-19974-00, PSU H7842-A)
// - first generation hardware (introduced May '82) with ROM 04.03.11
// - inability to boot from hard disc (mind the inadequate PSU)
-
-// AVAILABLE RAM: 64 K on board (instead of 128 K on model 'B').
+//----------------------------------------------------------------------------------------
+// AVAILABLE RAM: 64 K on board (versus 128 K on model 'B').
// Two compatible memory expansions were sold by DEC:
-// (PCIXX-AA) : 64 K (usable on either Rainbow 100-A or 100-B)
-// (PCIXX-AB) : 192 K ( " )
+// (PCIXX-AA) : 64 K (usable on either Rainbow 100-A or 100-B) *
+// (PCIXX-AB) : 192 K ( " ) *
// Totals to 256 K on a 100-A, while the RAM limit appears to be 832 K.
+// * DEC changed the way signals are handled on J6 (memory connector) later:
+// "Whether a PC100-A or PC100-B memory module is installed on the PC100-B system module
+// affects the functions the signals on 5 pins (29, 30, 32, 43, and 47) of the J6 connector
+// will perform." (from 'EK-RB100_TM_001 Addendum for PC100-A_PC100-B Dec.84' page 120).
+//----------------------------------------------------------------------------------------
// KNOWN DIFFERENCES TO 100-B:
// - cannot control bit 7 of IRQ vector (prevents DOS > 2.01 from booting on unmodified hardware)
// - 4 color palette with graphics option (instead of 16 colors on later models)
-// - differences in arbitration logic (compare schematics of -B and -A; part E11 <- vs. -> E13)?
// - smaller ROMs (3 x 2764) with fewer routines (no documented way to beep...)
+// - socketed NVRAM chip: X2212D 8238AES
ROM_START(rainbow100a)
ROM_REGION(0x100000, "maincpu", 0)
-// FIXME: 12-19606-02a.bin and 12-19606-02b.bin are just PART NUMBERS from the 100-A field manual.
-// Someone who knows the DEC naming conventions should correct them -
-ROM_LOAD("12-19606-02a.bin", 0xFA000, 0x2000, NO_DUMP) // ROM (FA000-FBFFF) (E89) 8 K
-ROM_LOAD("12-19606-02b.bin", 0xFC000, 0x2000, NO_DUMP) // ROM (FC000-FDFFF) (E90) 8 K
+ROM_LOAD("23-176e4-00.bin", 0xFA000, 0x2000, NO_DUMP) // ROM (FA000-FBFFF) (E89) 8 K
+ROM_LOAD("23-177e4-00.bin", 0xFC000, 0x2000, NO_DUMP) // ROM (FC000-FDFFF) (E90) 8 K
// SOCKETED LANGUAGE ROM (E91) with 1 single localization per ROM -
-ROM_LOAD("70-20274-15", 0xFE000, 0x2000, NO_DUMP) // ROM (FE000-FFFFF) (E91) 8 K - USA
-// ROM_LOAD("bg-r873a-bv", 0xFE000, 0x2000, NO_DUMP) // ROM (FE000-FFFFF) (E91) 8 K - Canadian (French)
-// ROM_LOAD("bg-r876a-bv", 0xFE000, 0x2000, NO_DUMP) // ROM (FE000-FFFFF) (E91) 8 K - British (UK)
-// ROM_LOAD("bg-r878a-bv", 0xFE000, 0x2000, NO_DUMP) // ROM (FE000-FFFFF) (E91) 8 K - German / Austrian
-// ROM_LOAD("bg-r874a-bv", 0xFE000, 0x2000, NO_DUMP) // ROM (FE000-FFFFF) (E91) 8 K - Italian
-// ROM_LOAD("bg-r377a-bv", 0xFE000, 0x2000, NO_DUMP) // ROM (FE000-FFFFF) (E91) 8 K - Spanish
-// (...)
-// Appendix A / EK-RB100 Rainbow Technical Manual Addendum for 100A and 100B (Dec.84) lists all 15.
-
-ROM_REGION(0x1000, "chargen", 0)
-ROM_LOAD("chargen.bin", 0x0000, 0x1000, CRC(1685e452) SHA1(bc299ff1cb74afcededf1a7beb9001188fdcf02f))
+ROM_LOAD("23-092e4-00.bin", 0xFE000, 0x2000, NO_DUMP) // ROM (FE000-FFFFF) (E91) 8 K - English (?)
+// See also MP-01491-00 - PC100A FIELD MAINTENANCE SET. Appendix A of EK-RB100 Rainbow
+// Technical Manual Addendum f.100A and 100B (Dec.84) lists 15 localizations / part numbers
+
+ROM_REGION(0x1000, "chargen", 0) // [E98] 2732 (4 K) EPROM
+ROM_LOAD("23-020e3-00.bin", 0x0000, 0x1000, CRC(1685e452) SHA1(bc299ff1cb74afcededf1a7beb9001188fdcf02f))
ROM_END
+//----------------------------------------------------------------------------------------
// ROM definition for 100-B (system module 70-19974-02, PSU H7842-D)
-// Built until ~ May 1986 (see MP-01491-00)
+// Built until ~ May 1986 (from MP-01491-00)
// - 32 K ROM (version 5.03)
// - 128 K base and 896 K max. mem.
ROM_START(rainbow)
ROM_REGION(0x100000, "maincpu", 0)
-ROM_LOAD("23-022e5-00.bin", 0xf0000, 0x4000, CRC(9d1332b4) SHA1(736306d2a36bd44f95a39b36ebbab211cc8fea6e))
+
+// Note that the 'Field Maintenance Print Set 1984' also lists alternate revision 'A1' with
+// 23-063e3-00 (for chargen) and '23-074e5-00' / '23-073e5-00' for E5-01 / E5-02.
+
+// Part numbers 22E5, 20E5 and 37E3 verified to match revision "B" (FCC ID : A0994Q - PC100 - B).
+
+// BOOT ROM
+ROM_LOAD("23-022e5-00.bin", 0xf0000, 0x4000, CRC(9d1332b4) SHA1(736306d2a36bd44f95a39b36ebbab211cc8fea6e))
ROM_RELOAD(0xf4000, 0x4000)
+
+// LANGUAGE ROM
ROM_LOAD("23-020e5-00.bin", 0xf8000, 0x4000, CRC(8638712f) SHA1(8269b0d95dc6efbe67d500dac3999df4838625d8)) // German, French, English
//ROM_LOAD( "23-015e5-00.bin", 0xf8000, 0x4000, NO_DUMP) // Dutch, French, English
//ROM_LOAD( "23-016e5-00.bin", 0xf8000, 0x4000, NO_DUMP) // Finish, Swedish, English
-//ROM_LOAD( "23-017e5-00.bin", 0xf8000, 0x4000, NO_DUMP) // Danish, Norwegian, English
-//ROM_LOAD( "23-018e5-00.bin", 0xf8000, 0x4000, NO_DUMP) // Spanish, Italian, English
+//ROM_LOAD( "23-017e5-00.bin", 0xf8000, 0x4000, NO_DUMP) // Danish, Norwegian, English
+//ROM_LOAD( "23-018e5-00.bin", 0xf8000, 0x4000, NO_DUMP) // Spanish, Italian, English
ROM_RELOAD(0xfc000, 0x4000)
-ROM_REGION(0x1000, "chargen", 0)
-ROM_LOAD("chargen.bin", 0x0000, 0x1000, CRC(1685e452) SHA1(bc299ff1cb74afcededf1a7beb9001188fdcf02f))
-// ROM_REGION(0x800, BUFFER, 0) // HDC RAM buffer 2 K -- NEW HDC
-// // ROM_FILL(0x000, 0x800, 0x00)
+// CHARACTER GENERATOR (E3-03)
+ROM_REGION(0x1000, "chargen", 0)
+ROM_LOAD("23-037e3.bin", 0x0000, 0x1000, CRC(1685e452) SHA1(bc299ff1cb74afcededf1a7beb9001188fdcf02f))
ROM_END
+//----------------------------------------------------------------------------------------
// 'Rainbow 190 B' (announced March 1985) is identical to 100-B, with alternate ROM v5.05.
// According to an article in Wall Street Journal it came with a 10 MB HD and 640 K RAM.
+// All programs not dependent on specific ROM addresses should work. A first glance:
+// - jump tables (F4000-F40083 and FC000-FC004D) were not extended
+// - absolute addresses of some internal routines have changed (affects BOOT 2.x / 3.x dual boot)
+
// A Readme from January 1985 mentions 'recent ROM changes for MASS 11' (a VAX word processor).
// It is *likely* that the sole differences between 5.05 and 5.03 affect terminal emulation.
-// * jump tables (F4000-F40083 and FC000-FC004D) were not extended.
-// * absolute addresses of some internal routines have changed.
-// All programs not dependent on specific ROM addresses should just work...
-
-// FIXME: ROM names are made up.
+// FIXME: ROM names are * made up *.
// Someone who knows the DEC naming conventions should correct them -
ROM_START(rainbow190)
ROM_REGION(0x100000, "maincpu", 0)
-ROM_LOAD("dec190rom0.bin", 0xf0000, 0x4000, CRC(FAC191D2) SHA1(4aff5b1e031d3b5eafc568b23e68235270bb34de))
+ROM_LOAD("dec190rom0.bin", 0xf0000, 0x4000, CRC(fac191d2) SHA1(4aff5b1e031d3b5eafc568b23e68235270bb34de))
ROM_RELOAD(0xf4000, 0x4000)
-ROM_LOAD("dec190rom1.bin", 0xf8000, 0x4000, CRC(5CE59632) SHA1(d29793f7014c57a4e7cb77bbf6e84f9113635ed2))
+ROM_LOAD("dec190rom1.bin", 0xf8000, 0x4000, CRC(5ce59632) SHA1(d29793f7014c57a4e7cb77bbf6e84f9113635ed2))
ROM_RELOAD(0xfc000, 0x4000)
-ROM_REGION(0x1000, "chargen", 0)
+ROM_REGION(0x1000, "chargen", 0)
ROM_LOAD("chargen.bin", 0x0000, 0x1000, CRC(1685e452) SHA1(bc299ff1cb74afcededf1a7beb9001188fdcf02f))
ROM_END
+//----------------------------------------------------------------------------------------
/* Driver */
diff --git a/src/mess/drivers/rambo.c b/src/mess/drivers/rambo.c
new file mode 100644
index 00000000000..8dd28468990
--- /dev/null
+++ b/src/mess/drivers/rambo.c
@@ -0,0 +1,227 @@
+// license:GPL-2.0+
+// copyright-holders:Felipe Sanches
+/*
+ RAMBo (RepRap Arduino-compatible Mother Board) by UltiMachine
+ for controlling desktop 3d printers
+ http://reprap.org/wiki/Rambo
+
+ driver by Felipe Correa da Silva Sanches <fsanches@metamaquina.com.br>
+
+ This driver is based on the schematics of the version 1.1b:
+ http://reprap.org/mediawiki/images/7/75/Rambo1-1-schematic.png
+
+ 3d printers currently supported by this driver:
+ * Metamáquina 2
+
+ 3d printers known to use this board:
+ * TODO: list them all here
+*/
+
+#include "emu.h"
+#include "cpu/avr8/avr8.h"
+
+#define MASTER_CLOCK 16000000
+
+#define LOG_PORTS 0
+
+/****************************************************\
+* I/O devices *
+\****************************************************/
+
+class rambo_state : public driver_device
+{
+public:
+ rambo_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu")
+ {
+ }
+
+ UINT8 m_port_a;
+ UINT8 m_port_b;
+ UINT8 m_port_c;
+ UINT8 m_port_d;
+ UINT8 m_port_e;
+ UINT8 m_port_f;
+ UINT8 m_port_g;
+ UINT8 m_port_h;
+ UINT8 m_port_j;
+ UINT8 m_port_k;
+ UINT8 m_port_l;
+ required_device<avr8_device> m_maincpu;
+
+ DECLARE_READ8_MEMBER(port_r);
+ DECLARE_WRITE8_MEMBER(port_w);
+
+ DECLARE_DRIVER_INIT(rambo);
+ virtual void machine_start();
+ virtual void machine_reset();
+};
+
+void rambo_state::machine_start()
+{
+}
+
+READ8_MEMBER(rambo_state::port_r)
+{
+ switch( offset )
+ {
+ case AVR8_IO_PORTA:
+ {
+#if LOG_PORTS
+ printf("[%08X] Port A READ \n", m_maincpu->m_shifted_pc);
+#endif
+ return m_port_a;
+ }
+ default:
+ break;
+ }
+ return 0;
+}
+
+WRITE8_MEMBER(rambo_state::port_w)
+{
+ switch( offset )
+ {
+ case AVR8_IO_PORTA:
+ {
+ if (data == m_port_a) break;
+
+#if LOG_PORTS
+ UINT8 old_port_a = m_port_a;
+ UINT8 changed = data ^ old_port_a;
+#endif
+ m_port_a = data;
+ break;
+ }
+ default:
+ break;
+ }
+}
+
+/****************************************************\
+* Address maps *
+\****************************************************/
+
+static ADDRESS_MAP_START( rambo_prg_map, AS_PROGRAM, 8, rambo_state )
+ AM_RANGE(0x0000, 0x1FFFF) AM_ROM
+ADDRESS_MAP_END
+
+static ADDRESS_MAP_START( rambo_data_map, AS_DATA, 8, rambo_state )
+ AM_RANGE(0x0200, 0x21FF) AM_RAM /* ATMEGA2560 Internal SRAM */
+ADDRESS_MAP_END
+
+static ADDRESS_MAP_START( rambo_io_map, AS_IO, 8, rambo_state )
+ AM_RANGE(AVR8_IO_PORTA, AVR8_IO_PORTL) AM_READWRITE( port_r, port_w )
+ADDRESS_MAP_END
+
+/****************************************************\
+* Machine definition *
+\****************************************************/
+
+DRIVER_INIT_MEMBER(rambo_state, rambo)
+{
+}
+
+void rambo_state::machine_reset()
+{
+ m_port_a = 0;
+ m_port_b = 0;
+ m_port_c = 0;
+ m_port_d = 0;
+ m_port_e = 0;
+ m_port_f = 0;
+ m_port_g = 0;
+ m_port_h = 0;
+ m_port_j = 0;
+ m_port_k = 0;
+ m_port_l = 0;
+}
+
+static MACHINE_CONFIG_START( rambo, rambo_state )
+
+ MCFG_CPU_ADD("maincpu", ATMEGA2560, MASTER_CLOCK)
+ MCFG_CPU_PROGRAM_MAP(rambo_prg_map)
+ MCFG_CPU_DATA_MAP(rambo_data_map)
+ MCFG_CPU_IO_MAP(rambo_io_map)
+
+ MCFG_CPU_AVR8_EEPROM("eeprom")
+ MCFG_CPU_AVR8_LFUSE(0xFF)
+ MCFG_CPU_AVR8_HFUSE(0xDA)
+ MCFG_CPU_AVR8_EFUSE(0xF4)
+ MCFG_CPU_AVR8_LOCK(0x0F)
+
+ /*TODO: Add an ATMEGA32U2 for USB-Serial communications */
+ /*TODO: Emulate the AD5206 digipot */
+ /*TODO: Emulate the A4982 stepper motor drivers and instantiate 5 of these here
+ for controlling the X, Y, Z, E1 (and optionally E2) motors */
+ /*TODO: Simulate the heating elements */
+ /*TODO: Implement the thermistor measurements */
+MACHINE_CONFIG_END
+
+ROM_START( metamaq2 )
+ ROM_REGION( 0x20000, "maincpu", 0 )
+ ROM_DEFAULT_BIOS("20131015")
+
+ ROM_SYSTEM_BIOS( 0, "20130619", "June 19th, 2013" )
+ /* SOURCE(https://github.com/Metamaquina/Repetier-Firmware/tree/MM2_2013_06_19) */
+ ROMX_LOAD("repetier-fw-metamaquina2-2013-06-19.bin", 0x0000, 0x1000e, CRC(4279b178) SHA1(e4d3c9d6421287c980639c2df32d07b754adc8fc), ROM_BIOS(1))
+
+ ROM_SYSTEM_BIOS( 1, "20130624", "June 24th, 2013" )
+ /* SOURCE(https://github.com/Metamaquina/Repetier-Firmware/tree/MM2_RC2_RAMBo_rev10e_2013_06_24) */
+ ROMX_LOAD("repetier-fw-metamaquina2-2013-06-24_mm2rc2_rambo_rev10e.bin", 0x0000, 0xcebc, CRC(82400a3c) SHA1(0781ce29406ce69b63edb93d776b9c081bed841e), ROM_BIOS(2))
+
+ ROM_SYSTEM_BIOS( 2, "20130625", "June 25th, 2013" )
+ /* SOURCE(https://github.com/Metamaquina/Repetier-Firmware/tree/MM2_2013_06_25) */
+ ROMX_LOAD("repetier-fw-metamaquina2-2013-06-25.bin", 0x0000, 0x10076, CRC(e7e4db38) SHA1(0c307bb0a0ee4e9d38253936e7030d0efb3c1845), ROM_BIOS(3))
+
+ ROM_SYSTEM_BIOS( 3, "20130709", "July 9th, 2013" )
+ /* SOURCE(https://github.com/Metamaquina/Repetier-Firmware/tree/MM2_2013_07_09) */
+ ROMX_LOAD("repetier-fw-metamaquina2-2013-07-09.bin", 0x0000, 0x10078, CRC(9a45509f) SHA1(3a2e6516b45cc0ea1aef039335b02208847aaebf), ROM_BIOS(4))
+
+ ROM_SYSTEM_BIOS( 4, "20130712", "July 12th, 2013" )
+ /* SOURCE(https://github.com/Metamaquina/Repetier-Firmware/tree/MM2_2013_07_12) */
+ ROMX_LOAD("repetier-fw-metamaquina2-2013-07-12.bin", 0x0000, 0x10184, CRC(9aeac87c) SHA1(c1441096553c214c12a34da87fa42cc3f0eaf74d), ROM_BIOS(5))
+
+ ROM_SYSTEM_BIOS( 5, "20130717", "July 17th, 2013" )
+ /* SOURCE(https://github.com/Metamaquina/Repetier-Firmware/tree/MM2_2013_07_17) */
+ ROMX_LOAD("repetier-fw-metamaquina2-2013-07-17.bin", 0x0000, 0x10180, CRC(7c053ed0) SHA1(7abeabcbfdb411b6e681e2d0c9398c40b142f76b), ROM_BIOS(6))
+
+ ROM_SYSTEM_BIOS( 6, "20130806", "August 6th, 2013" )
+ /* SOURCE(https://github.com/Metamaquina/Repetier-Firmware/tree/MM2_2013_08_06) */
+ ROMX_LOAD("repetier-fw-metamaquina2-2013-08-06.bin", 0x0000, 0x1017e, CRC(6aaf5a14) SHA1(93cebee8ab9eda9d81e70504b407268a198577f0), ROM_BIOS(7))
+
+ ROM_SYSTEM_BIOS( 7, "20130809", "August 9th, 2013" )
+ /* SOURCE(https://github.com/Metamaquina/Repetier-Firmware/tree/MM2_2013_08_09) */
+ ROMX_LOAD("repetier-fw-metamaquina2-2013-08-09.bin", 0x0000, 0x1018a, CRC(ee53a011) SHA1(666d09fe69220a172528fe8d1c358e3ddaaa743a), ROM_BIOS(8))
+
+ ROM_SYSTEM_BIOS( 8, "20130822", "August 22nd, 2013" )
+ /* SOURCE(https://github.com/Metamaquina/Repetier-Firmware/tree/MM2_2013_08_22) */
+ ROMX_LOAD("repetier-fw-metamaquina2-2013-08-22.bin", 0x0000, 0x1018a, CRC(70a5a3c9) SHA1(20e52ea7bf40e71020b815b9fb6385d880677927), ROM_BIOS(9))
+
+ ROM_SYSTEM_BIOS( 9, "20130913", "September 13th, 2013" )
+ /* source code for this one is unavailable as it was an unreleased internal development build */
+ ROMX_LOAD("repetier-fw-metamaquina2-2013-09-13-devel.bin", 0x0000, 0x101bc, CRC(5e7c7933) SHA1(5b9bfe919daf705ad7a9a2de3cf4c51e3338ec47), ROM_BIOS(10))
+
+ ROM_SYSTEM_BIOS( 10, "20130920", "September 20th, 2013" )
+ /* SOURCE(https://github.com/Metamaquina/Repetier-Firmware/tree/MM2_2013_09_20) */
+ ROMX_LOAD("repetier-fw-metamaquina2-2013-09-20.bin", 0x0000, 0x10384, CRC(48378e58) SHA1(513f0a0c65219875cc467420cc091e3489b58919), ROM_BIOS(11))
+
+ ROM_SYSTEM_BIOS( 11, "20131015", "October 15th, 2013" )
+ /* SOURCE(https://github.com/Metamaquina/Repetier-Firmware/tree/MM2_2013_10_15) */
+ ROMX_LOAD("repetier-fw-metamaquina2-2013-10-15.bin", 0x0000, 0x102c8, CRC(520134bd) SHA1(dfe2251aad06972f237eb4920ce14ccb32da5af0), ROM_BIOS(12))
+
+ /*Arduino MEGA bootloader */
+ /* This is marked as a BAD_DUMP because we're not sure this is the bootloader we're actually using.
+ This is inherited from the Replicator 1 driver.
+ A proper dump would be good.
+ Also, it is not clear whether there's any difference in the bootloader
+ between the ATMEGA1280 and the ATMEGA2560 MCUs */
+ ROM_LOAD( "atmegaboot_168_atmega1280.bin", 0x1f000, 0x0f16, BAD_DUMP CRC(c041f8db) SHA1(d995ebf360a264cccacec65f6dc0c2257a3a9224) )
+
+ /* on-die 4kbyte eeprom */
+ ROM_REGION( 0x1000, "eeprom", ROMREGION_ERASEFF )
+ROM_END
+
+/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME */
+COMP(2012, metamaq2, 0, 0, rambo, 0, rambo_state, rambo, "Metamaquina", "Metamaquina 2 desktop 3d printer", GAME_NOT_WORKING | GAME_NO_SOUND)
diff --git a/src/mess/drivers/rc759.c b/src/mess/drivers/rc759.c
new file mode 100644
index 00000000000..175ea21037c
--- /dev/null
+++ b/src/mess/drivers/rc759.c
@@ -0,0 +1,617 @@
+// license:GPL-2.0+
+// copyright-holders:Dirk Best
+/***************************************************************************
+
+ Regnecentralen RC759 Piccoline
+
+ Status: Error 32 (cassette data error)
+
+***************************************************************************/
+
+#include "emu.h"
+#include "cpu/i86/i186.h"
+#include "machine/ram.h"
+#include "machine/nvram.h"
+#include "machine/mm58167.h"
+#include "machine/pic8259.h"
+#include "machine/i8255.h"
+#include "video/i82730.h"
+#include "sound/speaker.h"
+#include "sound/sn76496.h"
+#include "machine/keyboard.h"
+#include "bus/centronics/ctronics.h"
+#include "machine/wd_fdc.h"
+#include "imagedev/cassette.h"
+#include "bus/isbx/isbx.h"
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class rc759_state : public driver_device
+{
+public:
+ rc759_state(const machine_config &mconfig, device_type type, const char *tag) :
+ driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_pic(*this, "pic"),
+ m_nvram(*this, "nvram"),
+ m_ppi(*this, "ppi"),
+ m_txt(*this, "txt"),
+ m_cas(*this, "cas"),
+ m_isbx(*this, "isbx"),
+ m_speaker(*this, "speaker"),
+ m_snd(*this, "snd"),
+ m_rtc(*this, "rtc"),
+ m_centronics(*this, "centronics"),
+ m_fdc(*this, "fdc"),
+ m_floppy0(*this, "fdc:0"),
+ m_floppy1(*this, "fdc:1"),
+ m_vram(*this, "vram"),
+ m_config(*this, "config"),
+ m_cas_enabled(0), m_cas_data(0),
+ m_drq_source(0),
+ m_nvram_bank(0),
+ m_gfx_mode(0),
+ m_keyboard_enable(0), m_keyboard_key(0x00),
+ m_centronics_strobe(0), m_centronics_init(0), m_centronics_select_in(0), m_centronics_busy(0),
+ m_centronics_ack(0), m_centronics_fault(0), m_centronics_perror(0), m_centronics_select(0),
+ m_centronics_data(0xff)
+ { }
+
+ DECLARE_WRITE8_MEMBER(keyb_put);
+ DECLARE_READ8_MEMBER(keyboard_r);
+
+ DECLARE_WRITE8_MEMBER(floppy_control_w);
+ DECLARE_READ8_MEMBER(floppy_ack_r);
+ DECLARE_WRITE8_MEMBER(floppy_reserve_w);
+ DECLARE_WRITE8_MEMBER(floppy_release_w);
+
+ DECLARE_READ8_MEMBER(ppi_porta_r);
+ DECLARE_READ8_MEMBER(ppi_portb_r);
+ DECLARE_WRITE8_MEMBER(ppi_portc_w);
+
+ DECLARE_WRITE_LINE_MEMBER(centronics_busy_w);
+ DECLARE_WRITE_LINE_MEMBER(centronics_ack_w);
+ DECLARE_WRITE_LINE_MEMBER(centronics_fault_w);
+ DECLARE_WRITE_LINE_MEMBER(centronics_perror_w);
+ DECLARE_WRITE_LINE_MEMBER(centronics_select_w);
+
+ DECLARE_READ8_MEMBER(centronics_data_r);
+ DECLARE_WRITE8_MEMBER(centronics_data_w);
+ DECLARE_READ8_MEMBER(centronics_control_r);
+ DECLARE_WRITE8_MEMBER(centronics_control_w);
+
+ I82730_UPDATE_ROW(txt_update_row);
+ DECLARE_WRITE16_MEMBER(txt_ca_w);
+ DECLARE_WRITE16_MEMBER(txt_irst_w);
+ DECLARE_READ8_MEMBER(palette_r);
+ DECLARE_WRITE8_MEMBER(palette_w);
+
+ DECLARE_WRITE_LINE_MEMBER(i186_timer0_w);
+ DECLARE_WRITE_LINE_MEMBER(i186_timer1_w);
+
+ void nvram_init(nvram_device &nvram, void *data, size_t size);
+ DECLARE_READ8_MEMBER(nvram_r);
+ DECLARE_WRITE8_MEMBER(nvram_w);
+ DECLARE_READ8_MEMBER(rtc_r);
+ DECLARE_WRITE8_MEMBER(rtc_w);
+ DECLARE_READ8_MEMBER(irq_callback);
+
+protected:
+ // driver_device overrides
+ virtual void machine_start();
+ virtual void machine_reset();
+
+private:
+ required_device<i80186_cpu_device> m_maincpu;
+ required_device<pic8259_device> m_pic;
+ required_device<nvram_device> m_nvram;
+ required_device<i8255_device> m_ppi;
+ required_device<i82730_device> m_txt;
+ required_device<cassette_image_device> m_cas;
+ required_device<isbx_slot_device> m_isbx;
+ required_device<speaker_sound_device> m_speaker;
+ required_device<sn76489a_device> m_snd;
+ required_device<mm58167_device> m_rtc;
+ required_device<centronics_device> m_centronics;
+ required_device<wd2797_t> m_fdc;
+ required_device<floppy_connector> m_floppy0;
+ required_device<floppy_connector> m_floppy1;
+ required_shared_ptr<UINT16> m_vram;
+ required_ioport m_config;
+
+ std::vector<UINT8> m_nvram_mem;
+
+ int m_cas_enabled;
+ int m_cas_data;
+ int m_drq_source;
+ int m_nvram_bank;
+ int m_gfx_mode;
+ int m_keyboard_enable;
+ UINT8 m_keyboard_key;
+
+ int m_centronics_strobe;
+ int m_centronics_init;
+ int m_centronics_select_in;
+ int m_centronics_busy;
+ int m_centronics_ack;
+ int m_centronics_fault;
+ int m_centronics_perror;
+ int m_centronics_select;
+ UINT8 m_centronics_data;
+};
+
+
+//**************************************************************************
+// I/O
+//**************************************************************************
+
+WRITE8_MEMBER( rc759_state::keyb_put )
+{
+ m_keyboard_key = data;
+ m_pic->ir1_w(1);
+}
+
+READ8_MEMBER( rc759_state::keyboard_r )
+{
+ logerror("keyboard_r\n");
+
+ m_pic->ir1_w(0);
+
+ if (m_keyboard_enable)
+ return m_keyboard_key;
+ else
+ return 0x00;
+}
+
+READ8_MEMBER( rc759_state::ppi_porta_r )
+{
+ UINT8 data = 0;
+
+ data |= m_cas_enabled ? m_cas_data : (m_cas->input() > 0 ? 1 : 0);
+ data |= m_isbx->mpst_r() << 1;
+ data |= m_isbx->opt0_r() << 2;
+ data |= m_isbx->opt1_r() << 3;
+ data |= 1 << 4; // mem ident0
+ data |= 1 << 5; // mem ident1 (both 1 = 256k installed)
+ data |= 1 << 6; // dpc connect (0 = external floppy/printer installed)
+ data |= 1 << 7; // not used
+
+ return data;
+}
+
+READ8_MEMBER( rc759_state::ppi_portb_r )
+{
+ UINT8 data = 0;
+
+ data |= 1 << 0; // 0 = micronet controller installed
+ data |= 1 << 1; // rtc type, mm58167/cdp1879
+ data |= m_snd->ready_r() << 2;
+ data |= 1 << 3; // not used
+ data |= 1 << 4; // not used
+ data |= m_config->read(); // monitor type and frequency
+ data |= 1 << 7; // 0 = enable remote hardware debug (using an isbx351 module)
+
+ return data;
+}
+
+WRITE8_MEMBER( rc759_state::ppi_portc_w )
+{
+ m_cas_enabled = BIT(data, 0);
+ m_cas->change_state(BIT(data, 1) ? CASSETTE_MOTOR_DISABLED : CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR);
+ m_drq_source = (data >> 2) & 0x03;
+ m_nvram_bank = (data >> 4) & 0x03;
+ m_gfx_mode = BIT(data, 6);
+ m_keyboard_enable = BIT(data, 7);
+
+ logerror("ppi_portc_w: cas_enabled: %d, cas_motor: %d, drq_source: %d, nvram_bank: %d, gfx_mode: %d, keyb_enable: %d\n",
+ m_cas_enabled, BIT(data, 1), m_drq_source, m_nvram_bank, m_gfx_mode, m_keyboard_enable);
+}
+
+WRITE_LINE_MEMBER( rc759_state::centronics_busy_w )
+{
+ m_centronics_busy = state;
+ m_pic->ir6_w(state);
+}
+
+WRITE_LINE_MEMBER( rc759_state::centronics_ack_w )
+{
+ m_centronics_ack = state;
+}
+
+WRITE_LINE_MEMBER( rc759_state::centronics_fault_w )
+{
+ m_centronics_fault = state;
+}
+
+WRITE_LINE_MEMBER( rc759_state::centronics_perror_w )
+{
+ m_centronics_perror = state;
+}
+
+WRITE_LINE_MEMBER( rc759_state::centronics_select_w )
+{
+ m_centronics_select = state;
+}
+
+READ8_MEMBER( rc759_state::centronics_data_r )
+{
+ return m_centronics_data;
+}
+
+WRITE8_MEMBER( rc759_state::centronics_data_w )
+{
+ m_centronics_data = data;
+
+ m_centronics->write_data0(BIT(data, 0));
+ m_centronics->write_data1(BIT(data, 1));
+ m_centronics->write_data2(BIT(data, 2));
+ m_centronics->write_data3(BIT(data, 3));
+ m_centronics->write_data4(BIT(data, 4));
+ m_centronics->write_data5(BIT(data, 5));
+ m_centronics->write_data6(BIT(data, 6));
+ m_centronics->write_data7(BIT(data, 7));
+}
+
+READ8_MEMBER( rc759_state::centronics_control_r )
+{
+ UINT8 data = 0;
+
+ data |= m_centronics_busy << 0;
+ data |= m_centronics_ack << 1;
+ data |= m_centronics_fault << 2;
+ data |= m_centronics_perror << 3;
+ data |= m_centronics_select << 4;
+ data |= !m_centronics_strobe << 5;
+ data |= !m_centronics_init << 6;
+ data |= !m_centronics_select_in << 7;
+
+ return data;
+}
+
+WRITE8_MEMBER( rc759_state::centronics_control_w )
+{
+ logerror("centronics_control_w: %02x\n", data);
+
+ m_centronics_strobe = BIT(data, 0);
+ m_centronics_init = BIT(data, 2);
+ m_centronics_select_in = BIT(data, 4);
+
+ m_centronics->write_strobe(m_centronics_strobe);
+ m_centronics->write_autofd(BIT(data, 1));
+ m_centronics->write_init(m_centronics_init);
+ m_centronics->write_select_in(m_centronics_select_in);
+}
+
+WRITE8_MEMBER( rc759_state::floppy_control_w )
+{
+ logerror("floppy_control_w: %02x\n", data);
+
+ switch (BIT(data, 0))
+ {
+ case 0: m_fdc->set_floppy(m_floppy0->get_device()); break;
+ case 1: m_fdc->set_floppy(m_floppy1->get_device()); break;
+ }
+
+ if (m_floppy0->get_device()) m_floppy0->get_device()->mon_w(!BIT(data, 1));
+ if (m_floppy1->get_device()) m_floppy1->get_device()->mon_w(!BIT(data, 2));
+
+ // bit 3, enable precomp
+ // bit 4, precomp 125/250 nsec
+
+ m_fdc->dden_w(BIT(data, 5));
+ m_fdc->set_unscaled_clock(BIT(data, 6) ? 2000000 : 1000000);
+ m_fdc->set_force_ready(BIT(data, 7));
+}
+
+READ8_MEMBER( rc759_state::floppy_ack_r )
+{
+ logerror("floppy_ack_r\n");
+ return 0xff;
+}
+
+WRITE8_MEMBER( rc759_state::floppy_reserve_w )
+{
+ logerror("floppy_reserve_w: %02x\n", data);
+}
+
+WRITE8_MEMBER( rc759_state::floppy_release_w )
+{
+ logerror("floppy_release_w: %02x\n", data);
+}
+
+
+//**************************************************************************
+// VIDEO EMULATION
+//**************************************************************************
+
+I82730_UPDATE_ROW( rc759_state::txt_update_row )
+{
+ for (int i = 0; i < x_count; i++)
+ {
+ UINT16 gfx = m_vram[(data[i] & 0x3ff) << 4 | lc];
+
+ // pretty crude detection if char sizes have been initialized, need something better
+ if ((gfx & 0xff) == 0)
+ continue;
+
+ // figure out char width
+ int width;
+ for (width = 0; width < 16; width++)
+ if (BIT(gfx, width) == 0)
+ break;
+
+ width = 15 - width;
+
+ for (int p = 0; p < width; p++)
+ bitmap.pix32(y, i * width + p) = BIT(gfx, 15 - p) ? rgb_t::white : rgb_t::black;
+ }
+}
+
+WRITE16_MEMBER( rc759_state::txt_ca_w )
+{
+ m_txt->ca_w(1);
+ m_txt->ca_w(0);
+}
+
+WRITE16_MEMBER( rc759_state::txt_irst_w )
+{
+ m_txt->irst_w(1);
+ m_txt->irst_w(0);
+}
+
+READ8_MEMBER( rc759_state::palette_r )
+{
+ logerror("palette_r(%02x)\n", offset);
+ return 0xff;
+}
+
+WRITE8_MEMBER( rc759_state::palette_w )
+{
+ logerror("palette_w(%02x): %02x\n", offset, data);
+}
+
+
+//**************************************************************************
+// SOUND/RTC
+//**************************************************************************
+
+READ8_MEMBER( rc759_state::rtc_r )
+{
+ logerror("rtc_r(%02x)\n", offset);
+ return 0xff;
+}
+
+WRITE8_MEMBER( rc759_state::rtc_w )
+{
+ logerror("rtc_w(%02x): %02x\n", offset, data);
+}
+
+
+//**************************************************************************
+// MACHINE EMULATION
+//**************************************************************************
+
+WRITE_LINE_MEMBER( rc759_state::i186_timer0_w )
+{
+ if (m_cas_enabled)
+ {
+ m_cas_data = state;
+ m_cas->output(state ? -1.0 : 1.0);
+ }
+}
+
+WRITE_LINE_MEMBER( rc759_state::i186_timer1_w )
+{
+ m_speaker->level_w(state);
+}
+
+// 256x4 nvram is bank-switched using ppi port c, bit 4 and 5
+void rc759_state::nvram_init(nvram_device &nvram, void *data, size_t size)
+{
+ memset(data, 0x00, size);
+ memset(data, 0xaa, 1);
+}
+
+READ8_MEMBER( rc759_state::nvram_r )
+{
+ offs_t addr = (m_nvram_bank << 6) | offset;
+
+ logerror("nvram_r(%02x)\n", addr);
+
+ if (addr & 1)
+ return (m_nvram_mem[addr >> 1] & 0xf0) >> 4;
+ else
+ return (m_nvram_mem[addr >> 1] & 0x0f) >> 0;
+}
+
+WRITE8_MEMBER( rc759_state::nvram_w )
+{
+ offs_t addr = (m_nvram_bank << 6) | offset;
+
+ logerror("nvram_w(%02x): %02x\n", addr, data);
+
+ if (addr & 1)
+ m_nvram_mem[addr >> 1] = ((data << 4) & 0xf0) | (m_nvram_mem[addr >> 1] & 0x0f);
+ else
+ m_nvram_mem[addr >> 1] = (m_nvram_mem[addr >> 1] & 0xf0) | (data & 0x0f);
+}
+
+READ8_MEMBER( rc759_state::irq_callback )
+{
+ return m_pic->acknowledge();
+}
+
+void rc759_state::machine_start()
+{
+ m_nvram_mem.resize(256 / 2);
+ m_nvram->set_base(&m_nvram_mem[0], 256 / 2);
+}
+
+void rc759_state::machine_reset()
+{
+}
+
+
+//**************************************************************************
+// ADDRESS MAPS
+//**************************************************************************
+
+static ADDRESS_MAP_START( rc759_map, AS_PROGRAM, 16, rc759_state )
+ AM_RANGE(0x00000, 0x3ffff) AM_RAM
+ AM_RANGE(0xd8000, 0xdffff) AM_MIRROR(0x08000) AM_RAM AM_SHARE("vram")
+ AM_RANGE(0xf8000, 0xfffff) AM_MIRROR(0x10000) AM_ROM AM_REGION("bios", 0)
+ADDRESS_MAP_END
+
+static ADDRESS_MAP_START( rc759_io, AS_IO, 16, rc759_state )
+ ADDRESS_MAP_UNMAP_HIGH
+ AM_RANGE(0x000, 0x003) AM_MIRROR(0x0c) AM_DEVREADWRITE8("pic", pic8259_device, read, write, 0x00ff)
+ AM_RANGE(0x020, 0x021) AM_READ8(keyboard_r, 0x00ff)
+ AM_RANGE(0x056, 0x057) AM_NOP // in reality, access to sound and rtc is a bit more involved
+ AM_RANGE(0x05a, 0x05b) AM_DEVWRITE8("snd", sn76489a_device, write, 0x00ff)
+ AM_RANGE(0x05c, 0x05d) AM_READWRITE8(rtc_r, rtc_w, 0x00ff)
+// AM_RANGE(0x060, 0x06f) AM_WRITE8(crt_control_w, 0x00ff)
+ AM_RANGE(0x070, 0x077) AM_MIRROR(0x08) AM_DEVREADWRITE8("ppi", i8255_device, read, write, 0x00ff)
+ AM_RANGE(0x080, 0x0ff) AM_READWRITE8(nvram_r, nvram_w, 0x00ff)
+// AM_RANGE(0x100, 0x101) net
+ AM_RANGE(0x180, 0x1bf) AM_READWRITE8(palette_r, palette_w, 0x00ff)
+ AM_RANGE(0x230, 0x231) AM_WRITE(txt_irst_w)
+ AM_RANGE(0x240, 0x241) AM_WRITE(txt_ca_w)
+ AM_RANGE(0x250, 0x251) AM_READWRITE8(centronics_data_r, centronics_data_w, 0x00ff)
+ AM_RANGE(0x260, 0x261) AM_READWRITE8(centronics_control_r, centronics_control_w, 0x00ff)
+ AM_RANGE(0x280, 0x287) AM_DEVREADWRITE8("fdc", wd2797_t, read, write, 0x00ff)
+ AM_RANGE(0x288, 0x289) AM_WRITE8(floppy_control_w, 0x00ff)
+// AM_RANGE(0x28a, 0x28b) external printer data
+// AM_RANGE(0x28d, 0x28d) external printer control
+ AM_RANGE(0x28e, 0x28f) AM_READWRITE8(floppy_ack_r, floppy_reserve_w, 0x00ff)
+ AM_RANGE(0x290, 0x291) AM_WRITE8(floppy_release_w, 0x00ff)
+// AM_RANGE(0x292, 0x293) AM_READWRITE8(printer_ack_r, printer_reserve_w, 0x00ff)
+// AM_RANGE(0x294, 0x295) AM_WRITE8(printer_release_w, 0x00ff)
+ AM_RANGE(0x300, 0x30f) AM_DEVREADWRITE8("isbx", isbx_slot_device, mcs0_r, mcs0_w, 0x00ff)
+ AM_RANGE(0x310, 0x31f) AM_DEVREADWRITE8("isbx", isbx_slot_device, mcs1_r, mcs1_w, 0x00ff)
+// AM_RANGE(0x320, 0x321) isbx dma ack
+// AM_RANGE(0x330, 0x331) isbx tc
+ADDRESS_MAP_END
+
+
+//**************************************************************************
+// INPUTS
+//**************************************************************************
+
+static INPUT_PORTS_START( rc759 )
+ PORT_START("config")
+ PORT_CONFNAME(0x20, 0x00, "Monitor Type")
+ PORT_CONFSETTING(0x00, "Color")
+ PORT_CONFSETTING(0x20, "Monochrome")
+ PORT_CONFNAME(0x40, 0x00, "Monitor Frequency")
+ PORT_CONFSETTING(0x00, "15 kHz")
+ PORT_CONFSETTING(0x40, "22 kHz")
+INPUT_PORTS_END
+
+
+//**************************************************************************
+// MACHINE DRIVERS
+//**************************************************************************
+
+static SLOT_INTERFACE_START( rc759_floppies )
+ SLOT_INTERFACE("hd", FLOPPY_525_HD)
+SLOT_INTERFACE_END
+
+static MACHINE_CONFIG_START( rc759, rc759_state )
+ MCFG_CPU_ADD("maincpu", I80186, 6000000)
+ MCFG_CPU_PROGRAM_MAP(rc759_map)
+ MCFG_CPU_IO_MAP(rc759_io)
+ MCFG_80186_IRQ_SLAVE_ACK(READ8(rc759_state, irq_callback))
+ MCFG_80186_TMROUT0_HANDLER(WRITELINE(rc759_state, i186_timer0_w))
+ MCFG_80186_TMROUT1_HANDLER(WRITELINE(rc759_state, i186_timer1_w))
+
+ // interrupt controller
+ MCFG_PIC8259_ADD("pic", DEVWRITELINE("maincpu", i80186_cpu_device, int0_w), VCC, NULL)
+
+ // nvram
+ MCFG_NVRAM_ADD_CUSTOM_DRIVER("nvram", rc759_state, nvram_init)
+
+ // ppi
+ MCFG_DEVICE_ADD("ppi", I8255, 0)
+ MCFG_I8255_IN_PORTA_CB(READ8(rc759_state, ppi_porta_r))
+ MCFG_I8255_IN_PORTB_CB(READ8(rc759_state, ppi_portb_r))
+ MCFG_I8255_OUT_PORTC_CB(WRITE8(rc759_state, ppi_portc_w))
+
+ // rtc
+ MCFG_DEVICE_ADD("rtc", MM58167, XTAL_32_768kHz)
+ MCFG_MM58167_IRQ_CALLBACK(DEVWRITELINE("pic", pic8259_device, ir3_w))
+
+ // video
+ MCFG_SCREEN_ADD("screen", RASTER)
+ MCFG_SCREEN_RAW_PARAMS(1250000 * 16, 896, 96, 816, 377, 4, 364) // 22 kHz setting
+ MCFG_SCREEN_UPDATE_DEVICE("txt", i82730_device, screen_update)
+
+ MCFG_I82730_ADD("txt", "maincpu", 1250000)
+ MCFG_VIDEO_SET_SCREEN("screen")
+ MCFG_I82730_UPDATE_ROW_CB(rc759_state, txt_update_row)
+ MCFG_I82730_SINT_HANDLER(DEVWRITELINE("pic", pic8259_device, ir4_w))
+
+ // keyboard
+ MCFG_DEVICE_ADD("keyb", GENERIC_KEYBOARD, 0)
+ MCFG_GENERIC_KEYBOARD_CB(WRITE8(rc759_state, keyb_put))
+
+ // cassette
+ MCFG_CASSETTE_ADD("cas")
+ MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_PLAY | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_MUTED)
+
+ // sound
+ MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+ MCFG_SOUND_ADD("snd", SN76489A, XTAL_20MHz / 10)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+
+ // internal centronics
+ MCFG_CENTRONICS_ADD("centronics", centronics_devices, "printer")
+ MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(rc759_state, centronics_busy_w))
+ MCFG_CENTRONICS_ACK_HANDLER(WRITELINE(rc759_state, centronics_ack_w))
+ MCFG_CENTRONICS_FAULT_HANDLER(WRITELINE(rc759_state, centronics_fault_w))
+ MCFG_CENTRONICS_PERROR_HANDLER(WRITELINE(rc759_state, centronics_perror_w))
+ MCFG_CENTRONICS_SELECT_HANDLER(WRITELINE(rc759_state, centronics_select_w))
+
+ // isbx slot
+ MCFG_ISBX_SLOT_ADD("isbx", 0, isbx_cards, NULL)
+ MCFG_ISBX_SLOT_MINTR0_CALLBACK(DEVWRITELINE("maincpu", i80186_cpu_device, int1_w))
+ MCFG_ISBX_SLOT_MINTR1_CALLBACK(DEVWRITELINE("maincpu", i80186_cpu_device, int3_w))
+ MCFG_ISBX_SLOT_MDRQT_CALLBACK(DEVWRITELINE("maincpu", i80186_cpu_device, drq0_w))
+
+ // floppy disk controller
+ MCFG_WD2797_ADD("fdc", 1000000)
+// MCFG_WD_FDC_INTRQ_CALLBACK(DEVWRITELINE("pic", pic8259_device, ir0_w))
+// MCFG_WD_FDC_DRQ_CALLBACK(DEVWRITELINE("maincpu", i80186_cpu_device, drq1_w))
+
+ // floppy drives
+ MCFG_FLOPPY_DRIVE_ADD("fdc:0", rc759_floppies, "hd", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("fdc:1", rc759_floppies, "hd", floppy_image_device::default_floppy_formats)
+MACHINE_CONFIG_END
+
+
+//**************************************************************************
+// ROM DEFINITIONS
+//**************************************************************************
+
+ROM_START( rc759 )
+ ROM_REGION(0x8000, "bios", 0)
+ ROM_SYSTEM_BIOS(0, "1-21", "1? Version 2.1")
+ ROMX_LOAD("rc759-1-2.1.rom", 0x0000, 0x8000, CRC(3a777d56) SHA1(a8592d61d5e1f92651a6f5e41c4ba14c9b6cc39b), ROM_BIOS(1))
+ ROM_SYSTEM_BIOS(1, "1-51", "1? Version 5.1")
+ ROMX_LOAD("rc759-1-5.1.rom", 0x0000, 0x8000, CRC(e1d53845) SHA1(902dc5ce28efd26b4f9c631933e197c2c187a7f1), ROM_BIOS(2))
+ ROM_SYSTEM_BIOS(2, "2-40", "2? Version 4.0")
+ ROMX_LOAD("rc759-2-4.0.rom", 0x0000, 0x8000, CRC(d3cb752a) SHA1(f50afe5dfa1b33a36a665d32d57c8c41d6685005), ROM_BIOS(3))
+ ROM_SYSTEM_BIOS(3, "2-51", "2? Version 5.1")
+ ROMX_LOAD("rc759-2-5.1.rom", 0x0000, 0x8000, CRC(00a31948) SHA1(23c4473c641606a56473791773270411d1019248), ROM_BIOS(4))
+ROM_END
+
+
+//**************************************************************************
+// SYSTEM DRIVERS
+//**************************************************************************
+
+COMP( 1984, rc759, 0, 0, rc759, rc759, driver_device, 0, "Regnecentralen", "RC759 Piccoline", GAME_NOT_WORKING | GAME_NO_SOUND )
diff --git a/src/mess/drivers/rm380z.c b/src/mess/drivers/rm380z.c
index 2765039f172..5c9ee061081 100644
--- a/src/mess/drivers/rm380z.c
+++ b/src/mess/drivers/rm380z.c
@@ -103,10 +103,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( rm380z_io , AS_IO, 8, rm380z_state)
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0xbf) AM_READWRITE(rm380z_portlow_r, rm380z_portlow_w)
- AM_RANGE(0xc0, 0xc0) AM_DEVREADWRITE("wd1771", fd1771_device, status_r, command_w)
- AM_RANGE(0xc1, 0xc1) AM_DEVREADWRITE("wd1771", fd1771_device, track_r, track_w)
- AM_RANGE(0xc2, 0xc2) AM_DEVREADWRITE("wd1771", fd1771_device, sector_r, sector_w)
- AM_RANGE(0xc3, 0xc3) AM_DEVREADWRITE("wd1771", fd1771_device, data_r, data_w)
+ AM_RANGE(0xc0, 0xc3) AM_DEVREADWRITE("wd1771", fd1771_t, read, write)
AM_RANGE(0xc4, 0xc4) AM_WRITE(disk_0_control)
AM_RANGE(0xc5, 0xff) AM_READWRITE(rm380z_porthi_r, rm380z_porthi_w)
ADDRESS_MAP_END
@@ -120,12 +117,9 @@ INPUT_PORTS_END
//
//
-static const floppy_interface rm380z_floppy_interface =
-{
- FLOPPY_STANDARD_5_25_SSSD,
- LEGACY_FLOPPY_OPTIONS_NAME(default),
- NULL
-};
+static SLOT_INTERFACE_START( rm380z_floppies )
+ SLOT_INTERFACE("sssd", FLOPPY_525_SSSD)
+SLOT_INTERFACE_END
UINT32 rm380z_state::screen_update_rm380z(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
@@ -157,10 +151,10 @@ static MACHINE_CONFIG_START( rm380z, rm380z_state )
MCFG_RAM_DEFAULT_SIZE("56K")
/* floppy disk */
- MCFG_DEVICE_ADD("wd1771", FD1771, 0)
- MCFG_WD17XX_DEFAULT_DRIVE2_TAGS
+ MCFG_FD1771_ADD("wd1771", XTAL_1MHz)
- MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(rm380z_floppy_interface)
+ MCFG_FLOPPY_DRIVE_ADD("wd1771:0", rm380z_floppies, "sssd", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("wd1771:1", rm380z_floppies, "sssd", floppy_image_device::default_floppy_formats)
/* keyboard */
MCFG_DEVICE_ADD(KEYBOARD_TAG, GENERIC_KEYBOARD, 0)
diff --git a/src/mess/drivers/rmnimbus.c b/src/mess/drivers/rmnimbus.c
index 4236521a9cc..94a34ff7b6f 100644
--- a/src/mess/drivers/rmnimbus.c
+++ b/src/mess/drivers/rmnimbus.c
@@ -123,7 +123,7 @@ static MACHINE_CONFIG_START( nimbus, rmnimbus_state )
MCFG_PALETTE_ADD("palette", 16)
/* Backing storage */
- MCFG_WD2793x_ADD(FDC_TAG, 1000000)
+ MCFG_WD2793_ADD(FDC_TAG, 1000000)
MCFG_WD_FDC_FORCE_READY
MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(rmnimbus_state,nimbus_fdc_intrq_w))
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(rmnimbus_state,nimbus_fdc_drq_w))
diff --git a/src/mess/drivers/samcoupe.c b/src/mess/drivers/samcoupe.c
index 5e417004795..7c96130e3a7 100644
--- a/src/mess/drivers/samcoupe.c
+++ b/src/mess/drivers/samcoupe.c
@@ -560,7 +560,7 @@ static MACHINE_CONFIG_START( samcoupe, samcoupe_state )
MCFG_SOFTWARE_LIST_ADD("cass_list","samcoupe_cass")
- MCFG_WD1772x_ADD("wd1772", SAMCOUPE_XTAL_X1/3)
+ MCFG_WD1772_ADD("wd1772", SAMCOUPE_XTAL_X1/3)
MCFG_FLOPPY_DRIVE_ADD("wd1772:0", samcoupe_floppies, "35dd", samcoupe_state::floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("wd1772:1", samcoupe_floppies, "35dd", samcoupe_state::floppy_formats)
MCFG_SOFTWARE_LIST_ADD("flop_list","samcoupe_flop")
diff --git a/src/mess/drivers/sbrain.c b/src/mess/drivers/sbrain.c
index 4de6abe4f83..8c2660f3d88 100644
--- a/src/mess/drivers/sbrain.c
+++ b/src/mess/drivers/sbrain.c
@@ -357,7 +357,7 @@ static MACHINE_CONFIG_START( sbrain, sbrain_state )
MCFG_COM8116_FR_HANDLER(WRITELINE(sbrain_state, fr_w))
MCFG_COM8116_FT_HANDLER(WRITELINE(sbrain_state, ft_w))
- MCFG_FD1791x_ADD("fdc", XTAL_16MHz / 16)
+ MCFG_FD1791_ADD("fdc", XTAL_16MHz / 16)
MCFG_FLOPPY_DRIVE_ADD("fdc:0", sbrain_floppies, "525dd", floppy_image_device::default_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("fdc:1", sbrain_floppies, "525dd", floppy_image_device::default_floppy_formats)
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/sc2.c b/src/mess/drivers/sc2.c
index 74d610ebea5..88b538f6a17 100644
--- a/src/mess/drivers/sc2.c
+++ b/src/mess/drivers/sc2.c
@@ -193,7 +193,7 @@ WRITE8_MEMBER( sc2_state::pio_port_b_w )
}
else
m_kp_matrix = data;
-};
+}
static MACHINE_CONFIG_START( sc2, sc2_state )
/* basic machine hardware */
diff --git a/src/mess/drivers/scorpion.c b/src/mess/drivers/scorpion.c
index 80385da7774..de840193ade 100644
--- a/src/mess/drivers/scorpion.c
+++ b/src/mess/drivers/scorpion.c
@@ -322,8 +322,6 @@ ROM_START(scorpio)
ROMX_LOAD("scorp2.rom", 0x018000, 0x4000, CRC(fd0d3ce1) SHA1(07783ee295274d8ff15d935bfd787c8ac1d54900), ROM_BIOS(7))
ROMX_LOAD("scorp3.rom", 0x01c000, 0x4000, CRC(1fe1d003) SHA1(33703e97cc93b7edfcc0334b64233cf81b7930db), ROM_BIOS(7))
- ROM_FILL( 0x1fe47, 1, 0x3e) // patch TR-DOS bug
-
ROM_REGION(0x01000, "keyboard", 0)
ROM_LOAD( "scrpkey.rom", 0x0000, 0x1000, CRC(e938a510) SHA1(2753993c97ff0fc6cff26ed792929abc1288dc6f))
diff --git a/src/mess/drivers/sdk80.c b/src/mess/drivers/sdk80.c
new file mode 100644
index 00000000000..240bb0cfc49
--- /dev/null
+++ b/src/mess/drivers/sdk80.c
@@ -0,0 +1,201 @@
+// license:BSD-3-Clause
+// copyright-holders:Nigel Barnes,Ryan Holtz
+/***************************************************************************
+
+ Intel SDK-80
+
+This is an evaluation kit for the 8080 cpu.
+
+There is no speaker or storage facility in the standard kit.
+
+Download the User Manual to get the operating procedures.
+
+Monitor Commands:
+D Display memory contents
+G Go to address (execute program at address)
+I Insert hex code
+M Move blocks of memory
+S Substitute memory locations
+X Examine registers
+
+Please note this rom set boots into BASIC, not monitor.
+
+****************************************************************************/
+
+#include "emu.h"
+#include "cpu/i8085/i8085.h"
+#include "machine/i8251.h"
+#include "machine/clock.h"
+#include "bus/rs232/rs232.h"
+//#include "machine/ay31015.h"
+
+#define I8251A_TAG "usart"
+#define I8251A_BAUD_TAG "usart_baud"
+#define RS232_TAG "rs232"
+
+class sdk80_state : public driver_device
+{
+public:
+ sdk80_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag)
+ , m_maincpu(*this, "maincpu")
+ , m_usart(*this, I8251A_TAG)
+ , m_rs232(*this, RS232_TAG)
+ , m_usart_baud_rate(*this, I8251A_BAUD_TAG)
+ , m_usart_divide_counter(0)
+ , m_usart_clock_state(0)
+ { }
+
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ DECLARE_WRITE_LINE_MEMBER( usart_clock_tick );
+
+private:
+ required_device<cpu_device> m_maincpu;
+ required_device<i8251_device> m_usart;
+ required_device<rs232_port_device> m_rs232;
+ required_ioport m_usart_baud_rate;
+
+ UINT8 m_usart_divide_counter;
+ UINT8 m_usart_clock_state;
+};
+
+static ADDRESS_MAP_START(sdk80_mem, AS_PROGRAM, 8, sdk80_state)
+ ADDRESS_MAP_UNMAP_HIGH
+ AM_RANGE(0x0000, 0x0fff) AM_ROM
+ AM_RANGE(0x3c00, 0x3fff) AM_RAM
+ADDRESS_MAP_END
+
+static ADDRESS_MAP_START(sdk80_io, AS_IO, 8, sdk80_state)
+ ADDRESS_MAP_UNMAP_HIGH
+ ADDRESS_MAP_GLOBAL_MASK(0xff)
+ AM_RANGE(0xec, 0xec) AM_DEVREADWRITE(I8251A_TAG, i8251_device, data_r, data_w)
+ AM_RANGE(0xed, 0xed) AM_DEVREADWRITE(I8251A_TAG, i8251_device, status_r, control_w)
+ADDRESS_MAP_END
+
+static INPUT_PORTS_START( sdk80 )
+ PORT_START(I8251A_BAUD_TAG)
+ PORT_DIPNAME( 0x3f, 0x01, "i8251 Baud Rate" )
+ PORT_DIPSETTING( 0x01, "4800")
+ PORT_DIPSETTING( 0x02, "2400")
+ PORT_DIPSETTING( 0x04, "1200")
+ PORT_DIPSETTING( 0x08, "600")
+ PORT_DIPSETTING( 0x10, "300")
+ PORT_DIPSETTING( 0x20, "150")
+ PORT_DIPSETTING( 0x40, "75")
+INPUT_PORTS_END
+
+#if 0
+/* Graphics Output */
+const gfx_layout sdk80_charlayout =
+{
+ 7, 8, /* character cell is 7 pixels wide by 8 pixels high */
+ 64, /* 64 characters in 2513 character generator ROM */
+ 1, /* 1 bitplane */
+ { 0 },
+ /* 5 visible pixels per row, starting at bit 3, with MSB being 0: */
+ { 3, 4, 5, 6, 7 },
+ /* pixel rows stored from top to bottom: */
+ { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
+ 8 * 8 /* 8 8-bit pixel rows per character */
+};
+
+static GFXDECODE_START( sdk80 )
+ GFXDECODE_ENTRY( "gfx1", 0x0000, sdk80_charlayout, 0, 1 )
+GFXDECODE_END
+#endif
+
+UINT32 sdk80_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+{
+ return 0;
+}
+
+WRITE_LINE_MEMBER( sdk80_state::usart_clock_tick )
+{
+ UINT8 old_counter = m_usart_divide_counter;
+ m_usart_divide_counter++;
+
+ UINT8 transition = (old_counter ^ m_usart_divide_counter) & m_usart_baud_rate->read();
+ if (transition)
+ {
+ m_usart->write_txc(m_usart_clock_state);
+ m_usart->write_rxc(m_usart_clock_state);
+ m_usart_clock_state ^= 1;
+ }
+}
+
+static MACHINE_CONFIG_START( sdk80, sdk80_state )
+ /* basic machine hardware */
+ MCFG_CPU_ADD("maincpu", I8080A, XTAL_18_432MHz/9)
+ MCFG_CPU_PROGRAM_MAP(sdk80_mem)
+ MCFG_CPU_IO_MAP(sdk80_io)
+
+ MCFG_DEVICE_ADD(I8251A_TAG, I8251, 0)
+ MCFG_I8251_TXD_HANDLER(DEVWRITELINE(RS232_TAG, rs232_port_device, write_txd))
+ MCFG_I8251_DTR_HANDLER(DEVWRITELINE(RS232_TAG, rs232_port_device, write_dtr))
+ MCFG_I8251_RTS_HANDLER(DEVWRITELINE(RS232_TAG, rs232_port_device, write_rts))
+
+ MCFG_RS232_PORT_ADD(RS232_TAG, default_rs232_devices, "null_modem")
+ MCFG_RS232_RXD_HANDLER(DEVWRITELINE(I8251A_TAG, i8251_device, write_rxd))
+ MCFG_RS232_DSR_HANDLER(DEVWRITELINE(I8251A_TAG, i8251_device, write_dsr))
+
+ MCFG_DEVICE_ADD("usart_clock", CLOCK, XTAL_18_432MHz/60)
+ MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(sdk80_state, usart_clock_tick))
+
+ /* video hardware */
+ // 96364 crt controller
+
+// MCFG_SCREEN_ADD("screen", RASTER)
+// MCFG_SCREEN_REFRESH_RATE(60)
+ /* Video is blanked for 70 out of 262 scanlines per refresh cycle.
+ Each scanline is composed of 65 character times, 40 of which
+ are visible, and each character time is 7 dot times; a dot time
+ is 2 cycles of the fundamental 14.31818 MHz oscillator. The
+ total blanking time is about 4450 microseconds. */
+// MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC((int) (70 * 65 * 7 * 2 / 14.31818)))
+ /* It would be nice if we could implement some sort of display
+ overscan here. */
+// MCFG_SCREEN_SIZE(40 * 7, 24 * 8)
+// MCFG_SCREEN_VISIBLE_AREA(0, 40 * 7 - 1, 0, 24 * 8 - 1)
+// MCFG_SCREEN_UPDATE_DRIVER(sdk80_state, screen_update)
+// MCFG_SCREEN_PALETTE("palette")
+
+// MCFG_GFXDECODE_ADD("gfxdecode", "palette", sdk80)
+
+// MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
+
+ // Video board UART
+// MCFG_DEVICE_ADD( "hd6402", AY31015, 0 )
+// MCFG_AY31015_TX_CLOCK(( XTAL_16MHz / 16 ) / 256)
+// MCFG_AY31015_RX_CLOCK(( XTAL_16MHz / 16 ) / 256)
+// MCFG_AY51013_READ_SI_CB(READ8(sdk80_state, nascom1_hd6402_si))
+// MCFG_AY51013_WRITE_SO_CB(WRITE8(sdk80_state, nascom1_hd6402_so))
+
+ /* Devices */
+// MCFG_DEVICE_ADD("i8279", I8279, 3100000) // based on divider
+// MCFG_I8279_OUT_IRQ_CB(INPUTLINE("maincpu", I8085_RST55_LINE)) // irq
+// MCFG_I8279_OUT_SL_CB(WRITE8(sdk80_state, scanlines_w)) // scan SL lines
+// MCFG_I8279_OUT_DISP_CB(WRITE8(sdk80_state, digit_w)) // display A&B
+// MCFG_I8279_IN_RL_CB(READ8(sdk80_state, kbd_r)) // kbd RL lines
+// MCFG_I8279_IN_SHIFT_CB(VCC) // Shift key
+// MCFG_I8279_IN_CTRL_CB(VCC)
+
+ //MCFG_DEVICE_ADD("terminal", GENERIC_TERMINAL, 0)
+ //MCFG_GENERIC_TERMINAL_KEYBOARD_CB(WRITE8(sdk80_state, kbd_put))
+MACHINE_CONFIG_END
+
+/* ROM definition */
+ROM_START( sdk80 )
+ ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF )
+ ROM_LOAD( "basic_blc_1.a14", 0x0000, 0x0400, CRC(b5e75aee) SHA1(6bd1eb9586d72544e8afb4ae43ecedcefa14da33))
+ ROM_LOAD( "basic_blc_2.a15", 0x0400, 0x0400, CRC(0a9ad1ed) SHA1(92c47eadcf8b18eeedcccaa3deb9f1518aaceeae))
+ ROM_LOAD( "basic_blc_3.a16", 0x0800, 0x0400, CRC(bc898e4b) SHA1(adc000534db0f736a75fbceed360dc220e02c30d))
+ ROM_LOAD( "basic_blc_4.a17", 0x0c00, 0x0400, CRC(568e8b6d) SHA1(22960193d3b0ae1b5d876d8c3b3f3b40db01358c))
+
+ /* 512-byte Signetics 2513 character generator ROM at location D2-D3 */
+ ROM_REGION(0x0200, "gfx1",0)
+ ROM_LOAD("s2513.d2", 0x0000, 0x0200, CRC(a7e567fc) SHA1(b18aae0a2d4f92f5a7e22640719bbc4652f3f4ee))
+ROM_END
+
+/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */
+COMP( 1975, sdk80, 0, 0, sdk80, sdk80, driver_device, 0, "Intel", "SDK-80", GAME_NO_SOUND_HW | GAME_NOT_WORKING )
diff --git a/src/mess/drivers/sgi_ip2.c b/src/mess/drivers/sgi_ip2.c
index 7e44e712b9f..ac6ade7de97 100644
--- a/src/mess/drivers/sgi_ip2.c
+++ b/src/mess/drivers/sgi_ip2.c
@@ -403,12 +403,12 @@ ADDRESS_MAP_END
WRITE_LINE_MEMBER(sgi_ip2_state::duarta_irq_handler)
{
m_maincpu->set_input_line_and_vector(M68K_IRQ_6, state, M68K_INT_ACK_AUTOVECTOR);
-};
+}
WRITE_LINE_MEMBER(sgi_ip2_state::duartb_irq_handler)
{
m_maincpu->set_input_line_and_vector(M68K_IRQ_6, state, M68K_INT_ACK_AUTOVECTOR);
-};
+}
static DEVICE_INPUT_DEFAULTS_START( ip2_terminal )
DEVICE_INPUT_DEFAULTS( "RS232_TXBAUD", 0xff, RS232_BAUD_19200 )
diff --git a/src/mess/drivers/slicer.c b/src/mess/drivers/slicer.c
index 8af9b1a609b..ee5327ff006 100644
--- a/src/mess/drivers/slicer.c
+++ b/src/mess/drivers/slicer.c
@@ -113,7 +113,7 @@ static MACHINE_CONFIG_START( slicer, slicer_state )
MCFG_RS232_PORT_ADD("rs232_2", default_rs232_devices, NULL)
MCFG_RS232_RXD_HANDLER(DEVWRITELINE("sc2681", mc68681_device, rx_b_w))
- MCFG_FD1797x_ADD("fdc", XTAL_16MHz/2/8)
+ MCFG_FD1797_ADD("fdc", XTAL_16MHz/2/8)
MCFG_WD_FDC_INTRQ_CALLBACK(DEVWRITELINE("maincpu", i80186_cpu_device, int1_w))
MCFG_WD_FDC_DRQ_CALLBACK(DEVWRITELINE("maincpu", i80186_cpu_device, drq0_w))
MCFG_FLOPPY_DRIVE_ADD("fdc:0", slicer_floppies, "525dd", floppy_image_device::default_floppy_formats)
diff --git a/src/mess/drivers/smc777.c b/src/mess/drivers/smc777.c
index 05089f3b07d..730ab4da19c 100644
--- a/src/mess/drivers/smc777.c
+++ b/src/mess/drivers/smc777.c
@@ -24,11 +24,11 @@
#include "sound/sn76496.h"
#include "sound/beep.h"
#include "video/mc6845.h"
-
-#include "machine/wd17xx.h"
-#include "formats/basicdsk.h"
+#include "machine/wd_fdc.h"
#include "imagedev/flopdrv.h"
+#define MASTER_CLOCK XTAL_4_028MHz
+
#define mc6845_h_char_total (m_crtc_vreg[0]+1)
#define mc6845_h_display (m_crtc_vreg[1])
#define mc6845_h_sync_pos (m_crtc_vreg[2])
@@ -54,17 +54,61 @@ public:
m_maincpu(*this, "maincpu"),
m_crtc(*this, "crtc"),
m_fdc(*this, "fdc"),
- m_sn(*this, "sn1"),
+ m_floppy0(*this, "fdc:0"),
+ m_floppy1(*this, "fdc:1"),
m_beeper(*this, "beeper"),
m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette")
+ m_palette(*this, "palette")
{ }
+ DECLARE_WRITE8_MEMBER(mc6845_w);
+ DECLARE_READ8_MEMBER(vram_r);
+ DECLARE_READ8_MEMBER(attr_r);
+ DECLARE_READ8_MEMBER(pcg_r);
+ DECLARE_WRITE8_MEMBER(vram_w);
+ DECLARE_WRITE8_MEMBER(attr_w);
+ DECLARE_WRITE8_MEMBER(pcg_w);
+ DECLARE_READ8_MEMBER(fbuf_r);
+ DECLARE_WRITE8_MEMBER(fbuf_w);
+ DECLARE_READ8_MEMBER(key_r);
+ DECLARE_WRITE8_MEMBER(key_w);
+ DECLARE_WRITE8_MEMBER(border_col_w);
+ DECLARE_READ8_MEMBER(system_input_r);
+ DECLARE_WRITE8_MEMBER(system_output_w);
+ DECLARE_WRITE8_MEMBER(color_mode_w);
+ DECLARE_WRITE8_MEMBER(ramdac_w);
+ DECLARE_READ8_MEMBER(display_reg_r);
+ DECLARE_WRITE8_MEMBER(display_reg_w);
+ DECLARE_READ8_MEMBER(smc777_mem_r);
+ DECLARE_WRITE8_MEMBER(smc777_mem_w);
+ DECLARE_READ8_MEMBER(irq_mask_r);
+ DECLARE_WRITE8_MEMBER(irq_mask_w);
+ DECLARE_PALETTE_INIT(smc777);
+ UINT32 screen_update_smc777(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ INTERRUPT_GEN_MEMBER(vblank_irq);
+ TIMER_DEVICE_CALLBACK_MEMBER(keyboard_callback);
+
+ DECLARE_READ8_MEMBER(fdc_r);
+ DECLARE_WRITE8_MEMBER(fdc_w);
+ DECLARE_READ8_MEMBER(fdc_request_r);
+ DECLARE_WRITE8_MEMBER(floppy_select_w);
+ DECLARE_WRITE_LINE_MEMBER(fdc_intrq_w);
+ DECLARE_WRITE_LINE_MEMBER(fdc_drq_w);
+
+protected:
+ virtual void machine_start();
+ virtual void machine_reset();
+ virtual void video_start();
+
+private:
required_device<cpu_device> m_maincpu;
required_device<mc6845_device> m_crtc;
- required_device<mb8876_device> m_fdc;
- optional_device<sn76489a_device> m_sn;
+ required_device<mb8876_t> m_fdc;
+ required_device<floppy_connector> m_floppy0;
+ required_device<floppy_connector> m_floppy1;
required_device<beep_device> m_beeper;
+ required_device<gfxdecode_device> m_gfxdecode;
+ required_device<palette_device> m_palette;
UINT8 *m_ipl_rom;
UINT8 *m_work_ram;
@@ -85,50 +129,10 @@ public:
UINT8 m_raminh,m_raminh_pending_change; //bankswitch
UINT8 m_raminh_prefetch;
UINT8 m_irq_mask;
- UINT8 m_keyb_direct;
UINT8 m_pal_mode;
UINT8 m_keyb_cmd;
UINT8 m_crtc_vreg[0x20];
UINT8 m_crtc_addr;
- DECLARE_WRITE8_MEMBER(smc777_6845_w);
- DECLARE_READ8_MEMBER(smc777_vram_r);
- DECLARE_READ8_MEMBER(smc777_attr_r);
- DECLARE_READ8_MEMBER(smc777_pcg_r);
- DECLARE_WRITE8_MEMBER(smc777_vram_w);
- DECLARE_WRITE8_MEMBER(smc777_attr_w);
- DECLARE_WRITE8_MEMBER(smc777_pcg_w);
- DECLARE_READ8_MEMBER(smc777_fbuf_r);
- DECLARE_WRITE8_MEMBER(smc777_fbuf_w);
- DECLARE_READ8_MEMBER(smc777_fdc1_r);
- DECLARE_WRITE8_MEMBER(smc777_fdc1_w);
- DECLARE_READ8_MEMBER(key_r);
- DECLARE_WRITE8_MEMBER(key_w);
- DECLARE_WRITE8_MEMBER(border_col_w);
- DECLARE_READ8_MEMBER(system_input_r);
- DECLARE_WRITE8_MEMBER(system_output_w);
- DECLARE_READ8_MEMBER(smc777_joystick_r);
- DECLARE_WRITE8_MEMBER(smc777_color_mode_w);
- DECLARE_WRITE8_MEMBER(smc777_ramdac_w);
- DECLARE_READ8_MEMBER(display_reg_r);
- DECLARE_WRITE8_MEMBER(display_reg_w);
- DECLARE_READ8_MEMBER(smc777_mem_r);
- DECLARE_WRITE8_MEMBER(smc777_mem_w);
- DECLARE_READ8_MEMBER(smc777_irq_mask_r);
- DECLARE_WRITE8_MEMBER(smc777_irq_mask_w);
- DECLARE_READ8_MEMBER(smc777_io_r);
- DECLARE_WRITE8_MEMBER(smc777_io_w);
- virtual void machine_start();
- virtual void machine_reset();
- virtual void video_start();
- DECLARE_PALETTE_INIT(smc777);
- UINT32 screen_update_smc777(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- INTERRUPT_GEN_MEMBER(smc777_vblank_irq);
- TIMER_DEVICE_CALLBACK_MEMBER(keyboard_callback);
- DECLARE_WRITE_LINE_MEMBER(smc777_fdc_intrq_w);
- DECLARE_WRITE_LINE_MEMBER(smc777_fdc_drq_w);
- void check_floppy_inserted();
- required_device<gfxdecode_device> m_gfxdecode;
- required_device<palette_device> m_palette;
};
@@ -283,7 +287,7 @@ UINT32 smc777_state::screen_update_smc777(screen_device &screen, bitmap_ind16 &b
return 0;
}
-WRITE8_MEMBER(smc777_state::smc777_6845_w)
+WRITE8_MEMBER(smc777_state::mc6845_w)
{
if(offset == 0)
{
@@ -297,7 +301,7 @@ WRITE8_MEMBER(smc777_state::smc777_6845_w)
}
}
-READ8_MEMBER(smc777_state::smc777_vram_r)
+READ8_MEMBER(smc777_state::vram_r)
{
UINT16 vram_index;
@@ -307,7 +311,7 @@ READ8_MEMBER(smc777_state::smc777_vram_r)
return m_vram[vram_index];
}
-READ8_MEMBER(smc777_state::smc777_attr_r)
+READ8_MEMBER(smc777_state::attr_r)
{
UINT16 vram_index;
@@ -317,7 +321,7 @@ READ8_MEMBER(smc777_state::smc777_attr_r)
return m_attr[vram_index];
}
-READ8_MEMBER(smc777_state::smc777_pcg_r)
+READ8_MEMBER(smc777_state::pcg_r)
{
UINT16 vram_index;
@@ -327,7 +331,7 @@ READ8_MEMBER(smc777_state::smc777_pcg_r)
return m_pcg[vram_index];
}
-WRITE8_MEMBER(smc777_state::smc777_vram_w)
+WRITE8_MEMBER(smc777_state::vram_w)
{
UINT16 vram_index;
@@ -337,7 +341,7 @@ WRITE8_MEMBER(smc777_state::smc777_vram_w)
m_vram[vram_index] = data;
}
-WRITE8_MEMBER(smc777_state::smc777_attr_w)
+WRITE8_MEMBER(smc777_state::attr_w)
{
UINT16 vram_index;
@@ -347,7 +351,7 @@ WRITE8_MEMBER(smc777_state::smc777_attr_w)
m_attr[vram_index] = data;
}
-WRITE8_MEMBER(smc777_state::smc777_pcg_w)
+WRITE8_MEMBER(smc777_state::pcg_w)
{
UINT16 vram_index;
@@ -359,7 +363,7 @@ WRITE8_MEMBER(smc777_state::smc777_pcg_w)
m_gfxdecode->gfx(0)->mark_dirty(vram_index >> 3);
}
-READ8_MEMBER(smc777_state::smc777_fbuf_r)
+READ8_MEMBER(smc777_state::fbuf_r)
{
UINT16 vram_index;
@@ -369,7 +373,7 @@ READ8_MEMBER(smc777_state::smc777_fbuf_r)
return m_gvram[vram_index];
}
-WRITE8_MEMBER(smc777_state::smc777_fbuf_w)
+WRITE8_MEMBER(smc777_state::fbuf_w)
{
UINT16 vram_index;
@@ -379,79 +383,53 @@ WRITE8_MEMBER(smc777_state::smc777_fbuf_w)
m_gvram[vram_index] = data;
}
-
-void smc777_state::check_floppy_inserted()
+READ8_MEMBER( smc777_state::fdc_r )
{
- int f_num;
- floppy_image_legacy *floppy;
+ return m_fdc->read(space, offset) ^ 0xff;
+}
- /* check if a floppy is there, automatically disconnect the ready line if so (HW doesn't control the ready line) */
- /* FIXME: floppy drive 1 doesn't work? */
- for(f_num=0;f_num<2;f_num++)
- {
- floppy = floppy_get_device(machine(), f_num)->flopimg_get_image();
- floppy_get_device(machine(), f_num)->floppy_mon_w((floppy != NULL) ? 0 : 1);
- floppy_get_device(machine(), f_num)->floppy_drive_set_ready_state((floppy != NULL) ? 1 : 0,0);
- }
+WRITE8_MEMBER( smc777_state::fdc_w )
+{
+ m_fdc->write(space, offset, data ^ 0xff);
}
-READ8_MEMBER(smc777_state::smc777_fdc1_r)
+READ8_MEMBER( smc777_state::fdc_request_r )
{
- check_floppy_inserted();
+ UINT8 data = 0;
- switch(offset)
- {
- case 0x00:
- return m_fdc->status_r(space, offset) ^ 0xff;
- case 0x01:
- return m_fdc->track_r(space, offset) ^ 0xff;
- case 0x02:
- return m_fdc->sector_r(space, offset) ^ 0xff;
- case 0x03:
- return m_fdc->data_r(space, offset) ^ 0xff;
- case 0x04: //irq / drq status
- //popmessage("%02x %02x\n",m_fdc_irq_flag,m_fdc_drq_flag);
-
- return (m_fdc_irq_flag ? 0x80 : 0x00) | (m_fdc_drq_flag ? 0x00 : 0x40);
- }
+ data |= !m_fdc_drq_flag << 6;
+ data |= m_fdc_irq_flag << 7;
- return 0x00;
+ return data;
}
-WRITE8_MEMBER(smc777_state::smc777_fdc1_w)
+WRITE8_MEMBER( smc777_state::floppy_select_w )
{
- check_floppy_inserted();
+ floppy_image_device *floppy = NULL;
- switch(offset)
+ // ---- xxxx select floppy drive (yes, 15 of them, A to P)
+ switch (data & 0x01)
{
- case 0x00:
- m_fdc->command_w(space, offset,data ^ 0xff);
- break;
- case 0x01:
- m_fdc->track_w(space, offset,data ^ 0xff);
- break;
- case 0x02:
- m_fdc->sector_w(space, offset,data ^ 0xff);
- break;
- case 0x03:
- m_fdc->data_w(space, offset,data ^ 0xff);
- break;
- case 0x04:
- // ---- xxxx select floppy drive (yes, 15 of them, A to P)
- m_fdc->set_drive(data & 0x01);
- // m_fdc->set_side((data & 0x10)>>4);
- if(data & 0xf0)
- printf("floppy access %02x\n",data);
- break;
+ case 0: floppy = m_floppy0->get_device(); break;
+ case 1: floppy = m_floppy1->get_device(); break;
}
+
+ m_fdc->set_floppy(floppy);
+
+ // no idea where the motor on signal is
+ if (floppy)
+ floppy->mon_w(0);
+
+ if(data & 0xf0)
+ printf("floppy access %02x\n", data);
}
-WRITE_LINE_MEMBER(smc777_state::smc777_fdc_intrq_w)
+WRITE_LINE_MEMBER( smc777_state::fdc_intrq_w )
{
m_fdc_irq_flag = state;
}
-WRITE_LINE_MEMBER(smc777_state::smc777_fdc_drq_w)
+WRITE_LINE_MEMBER( smc777_state::fdc_drq_w )
{
m_fdc_drq_flag = state;
}
@@ -541,13 +519,7 @@ WRITE8_MEMBER(smc777_state::system_output_w)
}
}
-/* presumably SMC-777 specific */
-READ8_MEMBER(smc777_state::smc777_joystick_r)
-{
- return ioport("JOY_1P")->read();
-}
-
-WRITE8_MEMBER(smc777_state::smc777_color_mode_w)
+WRITE8_MEMBER(smc777_state::color_mode_w)
{
switch(data & 0x0f)
{
@@ -556,7 +528,7 @@ WRITE8_MEMBER(smc777_state::smc777_color_mode_w)
}
}
-WRITE8_MEMBER(smc777_state::smc777_ramdac_w)
+WRITE8_MEMBER(smc777_state::ramdac_w)
{
UINT8 pal_index;
pal_index = (offset & 0xf00) >> 8;
@@ -615,12 +587,12 @@ WRITE8_MEMBER(smc777_state::smc777_mem_w)
m_work_ram[offset] = data;
}
-READ8_MEMBER(smc777_state::smc777_irq_mask_r)
+READ8_MEMBER(smc777_state::irq_mask_r)
{
return m_irq_mask;
}
-WRITE8_MEMBER(smc777_state::smc777_irq_mask_w)
+WRITE8_MEMBER(smc777_state::irq_mask_w)
{
if(data & 0xfe)
printf("Irq mask = %02x\n",data & 0xfe);
@@ -628,93 +600,47 @@ WRITE8_MEMBER(smc777_state::smc777_irq_mask_w)
m_irq_mask = data & 1;
}
-static ADDRESS_MAP_START(smc777_mem, AS_PROGRAM, 8, smc777_state )
+static ADDRESS_MAP_START( smc777_mem, AS_PROGRAM, 8, smc777_state )
ADDRESS_MAP_UNMAP_HIGH
- AM_RANGE(0x0000, 0xffff) AM_READWRITE(smc777_mem_r,smc777_mem_w)
+ AM_RANGE(0x0000, 0xffff) AM_READWRITE(smc777_mem_r, smc777_mem_w)
ADDRESS_MAP_END
-READ8_MEMBER(smc777_state::smc777_io_r)
-{
- UINT8 low_offs;
-
- low_offs = offset & 0xff;
-
- if(low_offs <= 0x07) { return smc777_vram_r(space,offset & 0xff07); }
- else if(low_offs >= 0x08 && low_offs <= 0x0f) { return smc777_attr_r(space,offset & 0xff07); }
- else if(low_offs >= 0x10 && low_offs <= 0x17) { return smc777_pcg_r(space,offset & 0xff07); }
- else if(low_offs >= 0x18 && low_offs <= 0x19) { logerror("6845 read %02x",low_offs & 1); }
- else if(low_offs >= 0x1a && low_offs <= 0x1b) { return key_r(space,low_offs & 1); }
- else if(low_offs == 0x1c) { return system_input_r(space,0); }
- else if(low_offs == 0x1d) { logerror("System and control data R PC=%04x\n",space.device().safe_pc()); return 0xff; }
- else if(low_offs == 0x20) { return display_reg_r(space,0); }
- else if(low_offs == 0x21) { return smc777_irq_mask_r(space,0); }
- else if(low_offs == 0x25) { logerror("RTC read PC=%04x\n",space.device().safe_pc()); return 0xff; }
- else if(low_offs == 0x26) { logerror("RS-232c RX %04x\n",space.device().safe_pc()); return 0xff; }
- else if(low_offs >= 0x28 && low_offs <= 0x2c) { logerror("FDC 2 read %02x\n",low_offs & 7); return 0xff; }
- else if(low_offs >= 0x2d && low_offs <= 0x2f) { logerror("RS-232c no. 2 read %02x\n",low_offs & 3); return 0xff; }
- else if(low_offs >= 0x30 && low_offs <= 0x34) { return smc777_fdc1_r(space,low_offs & 7); }
- else if(low_offs >= 0x35 && low_offs <= 0x37) { logerror("RS-232c no. 3 read %02x\n",low_offs & 3); return 0xff; }
- else if(low_offs >= 0x38 && low_offs <= 0x3b) { logerror("Cache disk unit read %02x\n",low_offs & 7); return 0xff; }
- else if(low_offs >= 0x3c && low_offs <= 0x3d) { logerror("RGB superimposer read %02x\n",low_offs & 1); return 0xff; }
- else if(low_offs >= 0x40 && low_offs <= 0x47) { logerror("IEEE-488 interface unit read %02x\n",low_offs & 7); return 0xff; }
- else if(low_offs >= 0x48 && low_offs <= 0x4f) { logerror("HDD (Winchester) read %02x\n",low_offs & 1); return 0xff; } //might be 0x48 - 0x50
- else if(low_offs == 0x51) { return smc777_joystick_r(space,0); }
- else if(low_offs >= 0x54 && low_offs <= 0x59) { logerror("VTR Controller read %02x\n",low_offs & 7); return 0xff; }
- else if(low_offs == 0x5a || low_offs == 0x5b) { logerror("RAM Banking %02x\n",low_offs & 1); }
- else if(low_offs == 0x70) { logerror("Auto-start ROM read\n"); }
- else if(low_offs == 0x74) { logerror("IEEE-488 ROM read\n"); }
- else if(low_offs == 0x75) { logerror("VTR Controller ROM read\n"); }
- else if(low_offs == 0x7e || low_offs == 0x7f) { logerror("Kanji ROM read %02x\n",low_offs & 1); }
- else if(low_offs >= 0x80) { return smc777_fbuf_r(space,offset & 0xff7f); }
-
- logerror("Undefined read at %04x offset = %02x\n",space.device().safe_pc(),low_offs);
- return 0xff;
-}
-
-WRITE8_MEMBER(smc777_state::smc777_io_w)
-{
- UINT8 low_offs;
-
- low_offs = offset & 0xff;
-
- if(low_offs <= 0x07) { smc777_vram_w(space,offset & 0xff07,data); }
- else if(low_offs >= 0x08 && low_offs <= 0x0f) { smc777_attr_w(space,offset & 0xff07,data); }
- else if(low_offs >= 0x10 && low_offs <= 0x17) { smc777_pcg_w(space,offset & 0xff07,data); }
- else if(low_offs >= 0x18 && low_offs <= 0x19) { smc777_6845_w(space,low_offs & 1,data); }
- else if(low_offs == 0x1a || low_offs == 0x1b) { key_w(space,low_offs & 1,data); }
- else if(low_offs == 0x1c) { system_output_w(space,0,data); }
- else if(low_offs == 0x1d) { logerror("Printer status / strobe write %02x\n",data); }
- else if(low_offs == 0x1e || low_offs == 0x1f) { logerror("RS-232C irq control [%02x] %02x\n",low_offs & 1,data); }
- else if(low_offs == 0x20) { display_reg_w(space,0,data); }
- else if(low_offs == 0x21) { smc777_irq_mask_w(space,0,data); }
- else if(low_offs == 0x22) { logerror("Printer output data %02x\n",data); }
- else if(low_offs == 0x23) { border_col_w(space,0,data); }
- else if(low_offs == 0x24) { logerror("RTC write / specify address %02x\n",data); }
- else if(low_offs == 0x26) { logerror("RS-232c TX %02x\n",data); }
- else if(low_offs >= 0x28 && low_offs <= 0x2c) { logerror("FDC 2 write %02x %02x\n",low_offs & 7,data); }
- else if(low_offs >= 0x2d && low_offs <= 0x2f) { logerror("RS-232c no. 2 write %02x %02x\n",low_offs & 3,data); }
- else if(low_offs >= 0x30 && low_offs <= 0x34) { smc777_fdc1_w(space,low_offs & 7,data); }
- else if(low_offs >= 0x35 && low_offs <= 0x37) { logerror("RS-232c no. 3 write %02x %02x\n",low_offs & 3,data); }
- else if(low_offs >= 0x38 && low_offs <= 0x3b) { logerror("Cache disk unit write %02x %02x\n",low_offs & 7,data); }
- else if(low_offs >= 0x3c && low_offs <= 0x3d) { logerror("RGB superimposer write %02x %02x\n",low_offs & 1,data); }
- else if(low_offs >= 0x40 && low_offs <= 0x47) { logerror("IEEE-488 interface unit write %02x %02x\n",low_offs & 7,data); }
- else if(low_offs >= 0x48 && low_offs <= 0x4f) { logerror("HDD (Winchester) write %02x %02x\n",low_offs & 1,data); } //might be 0x48 - 0x50
- else if(low_offs == 0x51) { smc777_color_mode_w(space,0,data); }
- else if(low_offs == 0x52) { smc777_ramdac_w(space,offset & 0xff00,data); }
- else if(low_offs == 0x53) { m_sn->write(space,0,data); }
- else if(low_offs >= 0x54 && low_offs <= 0x59) { logerror("VTR Controller write [%02x] %02x\n",low_offs & 7,data); }
- else if(low_offs == 0x5a || low_offs == 0x5b) { logerror("RAM Banking write [%02x] %02x\n",low_offs & 1,data); }
- else if(low_offs == 0x70) { logerror("Auto-start ROM write %02x\n",data); }
- else if(low_offs == 0x74) { logerror("IEEE-488 ROM write %02x\n",data); }
- else if(low_offs == 0x75) { logerror("VTR Controller ROM write %02x\n",data); }
- else if(low_offs == 0x7e || low_offs == 0x7f) { logerror("Kanji ROM write [%02x] %02x\n",low_offs & 1,data); }
- else if(low_offs >= 0x80) { smc777_fbuf_w(space,offset & 0xff7f,data); }
- else { logerror("Undefined write at %04x offset = %02x data = %02x\n",space.device().safe_pc(),low_offs,data); }
-}
-
-static ADDRESS_MAP_START( smc777_io , AS_IO, 8, smc777_state )
+static ADDRESS_MAP_START( smc777_io, AS_IO, 8, smc777_state )
ADDRESS_MAP_UNMAP_HIGH
- AM_RANGE(0x0000, 0xffff) AM_READWRITE(smc777_io_r,smc777_io_w)
+ AM_RANGE(0x00, 0x07) AM_MIRROR(0xff00) AM_MASK(0xffff) AM_READWRITE(vram_r, vram_w)
+ AM_RANGE(0x08, 0x0f) AM_MIRROR(0xff00) AM_MASK(0xffff) AM_READWRITE(attr_r, attr_w)
+ AM_RANGE(0x10, 0x17) AM_MIRROR(0xff00) AM_MASK(0xffff) AM_READWRITE(pcg_r, pcg_w)
+ AM_RANGE(0x18, 0x19) AM_MIRROR(0xff00) AM_WRITE(mc6845_w)
+ AM_RANGE(0x1a, 0x1b) AM_MIRROR(0xff00) AM_READWRITE(key_r, key_w)
+ AM_RANGE(0x1c, 0x1c) AM_MIRROR(0xff00) AM_READWRITE(system_input_r, system_output_w)
+// AM_RANGE(0x1d, 0x1d) system and control read, printer strobe write
+// AM_RANGE(0x1e, 0x1f) rs232 irq control
+ AM_RANGE(0x20, 0x20) AM_MIRROR(0xff00) AM_READWRITE(display_reg_r, display_reg_w)
+ AM_RANGE(0x21, 0x21) AM_MIRROR(0xff00) AM_READWRITE(irq_mask_r, irq_mask_w)
+// AM_RANGE(0x22, 0x22) printer output data
+ AM_RANGE(0x23, 0x23) AM_MIRROR(0xff00) AM_WRITE(border_col_w)
+// AM_RANGE(0x24, 0x24) rtc write address
+// AM_RANGE(0x25, 0x25) rtc read
+// AM_RANGE(0x26, 0x26) rs232 #1
+// AM_RANGE(0x28, 0x2c) fdc #2
+// AM_RANGE(0x2d, 0x2f) rs232 #2
+ AM_RANGE(0x30, 0x33) AM_MIRROR(0xff00) AM_READWRITE(fdc_r, fdc_w)
+ AM_RANGE(0x34, 0x34) AM_MIRROR(0xff00) AM_READWRITE(fdc_request_r, floppy_select_w)
+// AM_RANGE(0x35, 0x37) rs232 #3
+// AM_RANGE(0x38, 0x3b) cache disk unit
+// AM_RANGE(0x3c, 0x3d) rgb superimposer
+// AM_RANGE(0x40, 0x47) ieee-488
+// AM_RANGE(0x48, 0x4f) hdd (winchester)
+ AM_RANGE(0x51, 0x51) AM_MIRROR(0xff00) AM_READ_PORT("JOY_1P") AM_WRITE(color_mode_w)
+ AM_RANGE(0x52, 0x52) AM_MIRROR(0xff00) AM_MASK(0xffff) AM_WRITE(ramdac_w)
+ AM_RANGE(0x53, 0x53) AM_MIRROR(0xff00) AM_DEVWRITE("sn1", sn76489a_device, write)
+// AM_RANGE(0x54, 0x59) vrt controller
+// AM_RANGE(0x5a, 0x5b) ram banking
+// AM_RANGE(0x70, 0x70) auto-start rom
+// AM_RANGE(0x74, 0x74) ieee-488 rom
+// AM_RANGE(0x75, 0x75) vrt controller rom
+// AM_RANGE(0x7e, 0x7f) kanji rom
+ AM_RANGE(0x80, 0xff) AM_MIRROR(0xff00) AM_MASK(0xffff) AM_READWRITE(fbuf_r, fbuf_w)
ADDRESS_MAP_END
/* Input ports */
@@ -1021,37 +947,25 @@ PALETTE_INIT_MEMBER(smc777_state, smc777)
}
}
-static LEGACY_FLOPPY_OPTIONS_START( smc777 )
- LEGACY_FLOPPY_OPTION( img, "img", "SMC70 disk image", basicdsk_identify_default, basicdsk_construct_default, NULL,
- HEADS([1])
- TRACKS([70])
- SECTORS([16])
- SECTOR_LENGTH([256])
- FIRST_SECTOR_ID([1]))
-LEGACY_FLOPPY_OPTIONS_END
-static const floppy_interface smc777_floppy_interface =
-{
- FLOPPY_STANDARD_5_25_SSDD,
- LEGACY_FLOPPY_OPTIONS_NAME(smc777),
- "floppy_5_25"
-};
-
-INTERRUPT_GEN_MEMBER(smc777_state::smc777_vblank_irq)
+INTERRUPT_GEN_MEMBER(smc777_state::vblank_irq)
{
if(m_irq_mask)
device.execute().set_input_line(0,HOLD_LINE);
}
-#define MASTER_CLOCK XTAL_4_028MHz
+static SLOT_INTERFACE_START( smc777_floppies )
+ SLOT_INTERFACE("ssdd", FLOPPY_35_SSDD)
+SLOT_INTERFACE_END
+
static MACHINE_CONFIG_START( smc777, smc777_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu",Z80, MASTER_CLOCK)
MCFG_CPU_PROGRAM_MAP(smc777_mem)
MCFG_CPU_IO_MAP(smc777_io)
- MCFG_CPU_VBLANK_INT_DRIVER("screen", smc777_state, smc777_vblank_irq)
+ MCFG_CPU_VBLANK_INT_DRIVER("screen", smc777_state, vblank_irq)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -1071,15 +985,16 @@ static MACHINE_CONFIG_START( smc777, smc777_state )
MCFG_MC6845_SHOW_BORDER_AREA(true)
MCFG_MC6845_CHAR_WIDTH(8)
- /* devices */
- MCFG_DEVICE_ADD("fdc", MB8876, 0)
- MCFG_WD17XX_DEFAULT_DRIVE2_TAGS
- MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(smc777_state, smc777_fdc_intrq_w))
- MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(smc777_state, smc777_fdc_drq_w))
+ // floppy controller
+ MCFG_MB8876_ADD("fdc", XTAL_1MHz)
+ MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(smc777_state, fdc_intrq_w))
+ MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(smc777_state, fdc_drq_w))
- MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(smc777_floppy_interface)
+ // does it really support 16 of them?
+ MCFG_FLOPPY_DRIVE_ADD("fdc:0", smc777_floppies, "ssdd", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("fdc:1", smc777_floppies, "ssdd", floppy_image_device::default_floppy_formats)
- MCFG_SOFTWARE_LIST_ADD("flop_list","smc777")
+ MCFG_SOFTWARE_LIST_ADD("flop_list", "smc777")
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mess/drivers/sms.c b/src/mess/drivers/sms.c
index 1a4d225a94a..bd7c6f37c8d 100644
--- a/src/mess/drivers/sms.c
+++ b/src/mess/drivers/sms.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Wilbert Pol, Charles MacDonald,Mathis Rosenhauer,Brad Oliver,Michael Luong,Fabio Priuli,Enik Land
/******************************************************************************
Contributors:
diff --git a/src/mess/drivers/spc1000.c b/src/mess/drivers/spc1000.c
index 959e6e4e4a7..d8f49a029e6 100644
--- a/src/mess/drivers/spc1000.c
+++ b/src/mess/drivers/spc1000.c
@@ -24,6 +24,7 @@ NOTE: 2014-09-13: added code from someone's modified MESS driver for floppy
2014-10-11: Replaced above code with MESS-compliant code [Meeso Kim]
+2015-06-19: Added code for the centronics printer port
IMPORTANT NOTE for tape usage: you *FIRST* press PLAY on the tape drive
(e.g. by pressing F2 in partial emulated keyboard mode) and *THEN* you
@@ -140,6 +141,7 @@ IMPORTANT NOTE for tape usage: you *FIRST* press PLAY on the tape drive
#include "video/mc6847.h"
#include "imagedev/cassette.h"
#include "formats/spc1000_cas.h"
+#include "bus/centronics/ctronics.h"
#include "bus/spc1000/exp.h"
#include "bus/spc1000/fdd.h"
@@ -159,6 +161,7 @@ public:
, m_p_videoram(*this, "videoram")
, m_io_kb(*this, "LINE")
, m_io_joy(*this, "JOY")
+ , m_centronics(*this, "centronics")
{}
DECLARE_WRITE8_MEMBER(iplk_w);
@@ -167,6 +170,7 @@ public:
DECLARE_WRITE8_MEMBER(gmode_w);
DECLARE_READ8_MEMBER(gmode_r);
DECLARE_READ8_MEMBER(porta_r);
+ DECLARE_WRITE_LINE_MEMBER( centronics_busy_w ) { m_centronics_busy = state; }
DECLARE_READ8_MEMBER(mc6847_videoram_r);
DECLARE_WRITE8_MEMBER(cass_w);
DECLARE_READ8_MEMBER(keyboard_r);
@@ -181,6 +185,7 @@ private:
UINT16 m_page;
UINT8 *m_work_ram;
bool m_motor;
+ bool m_centronics_busy;
virtual void machine_start();
virtual void machine_reset();
required_device<z80_device> m_maincpu;
@@ -190,6 +195,7 @@ private:
required_shared_ptr<UINT8> m_p_videoram;
required_ioport_array<10> m_io_kb;
required_ioport m_io_joy;
+ required_device<centronics_device> m_centronics;
};
static ADDRESS_MAP_START(spc1000_mem, AS_PROGRAM, 8, spc1000_state )
@@ -221,6 +227,7 @@ WRITE8_MEMBER( spc1000_state::cass_w )
if (m && !m_motor)
m_cass->change_state(m_cass->get_state() & CASSETTE_MASK_MOTOR ? CASSETTE_MOTOR_ENABLED : CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR);
m_motor = m;
+ m_centronics->write_strobe(BIT(data, 2) ? true : false);
}
WRITE8_MEMBER(spc1000_state::gmode_w)
@@ -431,7 +438,7 @@ READ8_MEMBER( spc1000_state::porta_r )
data |= (m_cass->input() > 0.0038) ? 0x80 : 0;
data |= ((m_cass->get_state() & CASSETTE_MASK_UISTATE) != CASSETTE_STOPPED) && ((m_cass->get_state() & CASSETTE_MASK_MOTOR) == CASSETTE_MOTOR_ENABLED) ? 0x00 : 0x40;
data &= ~(m_io_joy->read() & 0x3f);
-
+ data &= ~((m_centronics_busy == 0)<< 5);
return data;
}
@@ -470,6 +477,7 @@ static MACHINE_CONFIG_START( spc1000, spc1000_state )
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("ay8910", AY8910, XTAL_4MHz / 1)
MCFG_AY8910_PORT_A_READ_CB(READ8(spc1000_state, porta_r))
+ MCFG_AY8910_PORT_B_WRITE_CB(DEVWRITE8("cent_data_out", output_latch_device, write))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette")
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
@@ -477,6 +485,11 @@ static MACHINE_CONFIG_START( spc1000, spc1000_state )
MCFG_DEVICE_ADD("ext1", SPC1000_EXP_SLOT, 0)
MCFG_DEVICE_SLOT_INTERFACE(spc1000_exp, NULL, false)
+ MCFG_CENTRONICS_ADD("centronics", centronics_devices, "printer")
+ MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(spc1000_state, centronics_busy_w))
+ MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics")
+ MCFG_DEVICE_ADD("cent_status_in", INPUT_BUFFER, 0)
+
MCFG_CASSETTE_ADD("cassette")
MCFG_CASSETTE_FORMATS(spc1000_cassette_formats)
MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_SPEAKER_ENABLED | CASSETTE_MOTOR_DISABLED)
diff --git a/src/mess/drivers/special.c b/src/mess/drivers/special.c
index 72263f3d18e..e424042e466 100644
--- a/src/mess/drivers/special.c
+++ b/src/mess/drivers/special.c
@@ -456,7 +456,7 @@ static MACHINE_CONFIG_DERIVED( specimx, special )
MCFG_I8255_IN_PORTC_CB(READ8(special_state, specialist_8255_portc_r))
MCFG_I8255_OUT_PORTC_CB(WRITE8(special_state, specialist_8255_portc_w))
- MCFG_FD1793x_ADD("fd1793", XTAL_8MHz / 8)
+ MCFG_FD1793_ADD("fd1793", XTAL_8MHz / 8)
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(special_state, fdc_drq))
MCFG_FLOPPY_DRIVE_ADD("fd0", specimx_floppies, "525qd", special_state::specimx_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("fd1", specimx_floppies, "525qd", special_state::specimx_floppy_formats)
@@ -509,7 +509,7 @@ static MACHINE_CONFIG_START( erik, special_state )
MCFG_I8255_IN_PORTC_CB(READ8(special_state, specialist_8255_portc_r))
MCFG_I8255_OUT_PORTC_CB(WRITE8(special_state, specialist_8255_portc_w))
- MCFG_FD1793x_ADD("fd1793", XTAL_8MHz / 8)
+ MCFG_FD1793_ADD("fd1793", XTAL_8MHz / 8)
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(special_state, fdc_drq))
MCFG_FLOPPY_DRIVE_ADD("fd0", specimx_floppies, "525qd", special_state::specimx_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("fd1", specimx_floppies, "525qd", special_state::specimx_floppy_formats)
diff --git a/src/mess/drivers/ssem.c b/src/mess/drivers/ssem.c
index 813ca712658..7e28ffc5b99 100644
--- a/src/mess/drivers/ssem.c
+++ b/src/mess/drivers/ssem.c
@@ -89,7 +89,7 @@ enum
PANEL_LNUP, PANEL_LNDN,
// Halt
- PANEL_HALT,
+ PANEL_HALT
};
INPUT_CHANGED_MEMBER(ssem_state::panel_check)
@@ -540,7 +540,7 @@ QUICKLOAD_LOAD_MEMBER(ssem_state, ssem_store)
// Isolate and convert 4-digit decimal address
memcpy(token_buf, image_line, 4);
token_buf[4] = '\0';
- sscanf(token_buf, "%04d", &line);
+ sscanf(token_buf, "%04u", &line);
if (!core_stricmp(image.filetype(), "snp"))
{
diff --git a/src/mess/drivers/super6.c b/src/mess/drivers/super6.c
index 43e4fd3063d..0a6e9b90b67 100644
--- a/src/mess/drivers/super6.c
+++ b/src/mess/drivers/super6.c
@@ -505,7 +505,7 @@ static MACHINE_CONFIG_START( super6, super6_state )
MCFG_DEVICE_ADD(Z80PIO_TAG, Z80PIO, XTAL_24MHz/4)
MCFG_Z80PIO_OUT_INT_CB(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0))
- MCFG_WD2793x_ADD(WD2793_TAG, 1000000)
+ MCFG_WD2793_ADD(WD2793_TAG, 1000000)
MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(super6_state, fdc_intrq_w))
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(super6_state, fdc_drq_w))
diff --git a/src/mess/drivers/super80.c b/src/mess/drivers/super80.c
index 74943211ce5..2cf1e75c8e8 100644
--- a/src/mess/drivers/super80.c
+++ b/src/mess/drivers/super80.c
@@ -837,7 +837,7 @@ static MACHINE_CONFIG_DERIVED( super80r, super80v )
MCFG_Z80DMA_IN_IORQ_CB(READ8(super80_state, io_read_byte))
MCFG_Z80DMA_OUT_IORQ_CB(WRITE8(super80_state, io_write_byte))
- MCFG_WD2793x_ADD("fdc", XTAL_2MHz)
+ MCFG_WD2793_ADD("fdc", XTAL_2MHz)
MCFG_WD_FDC_DRQ_CALLBACK(DEVWRITELINE("dma", z80dma_device, rdy_w))
MCFG_FLOPPY_DRIVE_ADD("fdc:0", super80_floppies, "525dd", floppy_image_device::default_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("fdc:1", super80_floppies, "525dd", floppy_image_device::default_floppy_formats)
diff --git a/src/mess/drivers/svi318.c b/src/mess/drivers/svi318.c
index 7db4cc0d366..e09a8bf7daf 100644
--- a/src/mess/drivers/svi318.c
+++ b/src/mess/drivers/svi318.c
@@ -245,12 +245,13 @@ WRITE_LINE_MEMBER(svi318_state::vdp_interrupt)
m_maincpu->set_input_line(0, (state ? HOLD_LINE : CLEAR_LINE));
}
-static const floppy_interface svi318_floppy_interface =
-{
- FLOPPY_STANDARD_5_25_DSHD,
- LEGACY_FLOPPY_OPTIONS_NAME(svi318),
- "floppy_5_25"
-};
+FLOPPY_FORMATS_MEMBER( svi318_state::floppy_formats )
+ FLOPPY_SVI_FORMAT
+FLOPPY_FORMATS_END
+
+static SLOT_INTERFACE_START( svi_floppies )
+ SLOT_INTERFACE("dd", FLOPPY_525_DD)
+SLOT_INTERFACE_END
static MACHINE_CONFIG_FRAGMENT( svi318_cartslot )
MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "svi318_cart")
@@ -307,16 +308,16 @@ static MACHINE_CONFIG_START( svi318, svi318_state )
MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_PLAY)
MCFG_CASSETTE_INTERFACE("svi318_cass")
- MCFG_DEVICE_ADD("wd179x", FD1793, 0)
- MCFG_WD17XX_DEFAULT_DRIVE2_TAGS
- MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(svi318_state, fdc_intrq_w))
- MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(svi318_state, fdc_drq_w))
+ MCFG_SOFTWARE_LIST_ADD("cass_list", "svi318_cass")
- MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(svi318_floppy_interface)
+ MCFG_FD1793_ADD("wd179x", XTAL_1MHz)
+ MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(svi318_state, fdc_intrq_w))
+ MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(svi318_state, fdc_drq_w))
- /* Software lists */
- MCFG_SOFTWARE_LIST_ADD("cass_list", "svi318_flop")
- MCFG_SOFTWARE_LIST_ADD("disk_list", "svi318_cass")
+ MCFG_FLOPPY_DRIVE_ADD("wd179x:0", svi_floppies, "dd", svi318_state::floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("wd179x:1", svi_floppies, "dd", svi318_state::floppy_formats)
+
+ MCFG_SOFTWARE_LIST_ADD("disk_list", "svi318_flop")
MCFG_FRAGMENT_ADD(svi318_cartslot)
@@ -436,16 +437,16 @@ static MACHINE_CONFIG_START( svi328_806, svi318_state )
MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_PLAY)
MCFG_CASSETTE_INTERFACE("svi318_cass")
- MCFG_DEVICE_ADD("wd179x", FD1793, 0)
- MCFG_WD17XX_DEFAULT_DRIVE2_TAGS
- MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(svi318_state, fdc_intrq_w))
- MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(svi318_state, fdc_drq_w))
+ MCFG_SOFTWARE_LIST_ADD("cass_list", "svi318_cass")
- MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(svi318_floppy_interface)
+ MCFG_FD1793_ADD("wd179x", XTAL_1MHz)
+ MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(svi318_state, fdc_intrq_w))
+ MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(svi318_state, fdc_drq_w))
- /* Software lists */
- MCFG_SOFTWARE_LIST_ADD("cass_list", "svi318_flop")
- MCFG_SOFTWARE_LIST_ADD("disk_list", "svi318_cass")
+ MCFG_FLOPPY_DRIVE_ADD("wd179x:0", svi_floppies, "dd", svi318_state::floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("wd179x:1", svi_floppies, "dd", svi318_state::floppy_formats)
+
+ MCFG_SOFTWARE_LIST_ADD("disk_list", "svi318_flop")
MCFG_FRAGMENT_ADD(svi318_cartslot)
diff --git a/src/mess/drivers/swtpc09.c b/src/mess/drivers/swtpc09.c
index c5f0c9868aa..c45666f860c 100644
--- a/src/mess/drivers/swtpc09.c
+++ b/src/mess/drivers/swtpc09.c
@@ -25,7 +25,7 @@
#include "emu.h"
#include "includes/swtpc09.h"
-
+#include "formats/flex_dsk.h"
/**************************************************************************
@@ -70,64 +70,20 @@ ADDRESS_MAP_END
static INPUT_PORTS_START( swtpc09 )
INPUT_PORTS_END
-static LEGACY_FLOPPY_OPTIONS_START(swtpc09)
- LEGACY_FLOPPY_OPTION(dsdd40, "dsk", "flex 40 trks ds dd 5.25", basicdsk_identify_default, basicdsk_construct_default, NULL,
- HEADS([1])
- TRACKS([40])
- SECTORS([36])
- SECTOR_LENGTH([256])
- FIRST_SECTOR_ID([1]))
- LEGACY_FLOPPY_OPTION(ssdd40, "dsk", "flex 40 trks ss dd 5.25 ", basicdsk_identify_default, basicdsk_construct_default, NULL,
- HEADS([1])
- TRACKS([40])
- SECTORS([25])
- SECTOR_LENGTH([256])
- FIRST_SECTOR_ID([1]))
- LEGACY_FLOPPY_OPTION(sssd40, "dsk", "flex 40 trks ss sd 5.25", basicdsk_identify_default, basicdsk_construct_default, NULL,
- HEADS([1])
- TRACKS([40])
- SECTORS([10])
- SECTOR_LENGTH([256])
- FIRST_SECTOR_ID([1]))
- LEGACY_FLOPPY_OPTION(sssd35, "dsk", "flex 35 trks ss sd 5.25", basicdsk_identify_default, basicdsk_construct_default, NULL,
- HEADS([1])
- TRACKS([35])
- SECTORS([10])
- SECTOR_LENGTH([256])
- FIRST_SECTOR_ID([1]))
- LEGACY_FLOPPY_OPTION(flex144M, "dsk", "flex 1.44mb disk from swtpc emu", basicdsk_identify_default, basicdsk_construct_default, NULL,
- HEADS([1])
- TRACKS([80])
- SECTORS([72])
- SECTOR_LENGTH([256])
- FIRST_SECTOR_ID([1]))
- LEGACY_FLOPPY_OPTION(flexdssd8inch, "dsk", "Flex 8 inch ds sd floppy image", basicdsk_identify_default, basicdsk_construct_default, NULL,
- HEADS([1])
- TRACKS([77])
- SECTORS([30])
- SECTOR_LENGTH([256])
- FIRST_SECTOR_ID([1]))
- LEGACY_FLOPPY_OPTION(uniflexdssd8inch, "dsk", "UNIFlex 8 inch ds sd floppy image", basicdsk_identify_default, basicdsk_construct_default, NULL,
- HEADS([1])
- TRACKS([77])
- SECTORS([16])
- SECTOR_LENGTH([512])
- FIRST_SECTOR_ID([1]))
- LEGACY_FLOPPY_OPTION(uniflexdsdd8inch, "dsk", "UNIFlex 8 inch ds dd floppy image", basicdsk_identify_default, basicdsk_construct_default, NULL,
- HEADS([1])
- TRACKS([77])
- SECTORS([32])
- SECTOR_LENGTH([512])
- FIRST_SECTOR_ID([1]))
-LEGACY_FLOPPY_OPTIONS_END
-
-
-static const floppy_interface swtpc09_floppy_interface =
-{
- FLOPPY_STANDARD_5_25_DSHD,
- LEGACY_FLOPPY_OPTIONS_NAME(swtpc09),
- NULL
-};
+FLOPPY_FORMATS_MEMBER( swtpc09_state::floppy_formats )
+ FLOPPY_FLEX_FORMAT
+FLOPPY_FORMATS_END
+
+// todo: implement floppy controller cards as slot devices and do this properly
+static SLOT_INTERFACE_START( swtpc09_floppies )
+ SLOT_INTERFACE("sssd", FLOPPY_525_SSSD) // flex 40 trks ss sd 5.25
+ SLOT_INTERFACE("sssd35", FLOPPY_525_SSSD_35T) // flex 35 trks ss sd 5.25
+ SLOT_INTERFACE("ssdd", FLOPPY_525_SSDD) // flex 40 trks ss dd 5.25
+ SLOT_INTERFACE("dd", FLOPPY_525_DD) // flex 40 trks ds dd 5.25
+ SLOT_INTERFACE("8dssd", FLOPPY_8_DSSD) // UNIFlex 8 inch ds sd
+ SLOT_INTERFACE("8dsdd", FLOPPY_8_DSDD) // UNIFlex 8 inch ds dd
+ SLOT_INTERFACE("35hd", FLOPPY_35_HD) // flex 1.44mb disk from swtpc emu (emulator only?)
+SLOT_INTERFACE_END
WRITE_LINE_MEMBER(swtpc09_state::write_acia_clock)
{
@@ -171,12 +127,14 @@ static MACHINE_CONFIG_START( swtpc09, swtpc09_state )
MCFG_DEVICE_ADD("acia_clock", CLOCK, 153600)
MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(swtpc09_state, write_acia_clock))
- MCFG_DEVICE_ADD("fdc", FD1793, 0)
- MCFG_WD17XX_DEFAULT_DRIVE4_TAGS
- MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(swtpc09_state, fdc_intrq_w))
- MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(swtpc09_state, fdc_drq_w))
+ MCFG_FD1793_ADD("fdc", XTAL_1MHz)
+ MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(swtpc09_state, fdc_intrq_w))
+ MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(swtpc09_state, fdc_drq_w))
- MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(swtpc09_floppy_interface)
+ MCFG_FLOPPY_DRIVE_ADD("fdc:0", swtpc09_floppies, "dd", swtpc09_state::floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("fdc:1", swtpc09_floppies, "dd", swtpc09_state::floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("fdc:2", swtpc09_floppies, "dd", swtpc09_state::floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("fdc:3", swtpc09_floppies, "dd", swtpc09_state::floppy_formats)
MACHINE_CONFIG_END
/* MPU09, MPID, MPS2 DC4 PIAIDE*/
@@ -210,10 +168,12 @@ static MACHINE_CONFIG_START( swtpc09i, swtpc09_state )
MCFG_DEVICE_ADD("acia_clock", CLOCK, 153600)
MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(swtpc09_state, write_acia_clock))
- MCFG_DEVICE_ADD("fdc", FD1793, 0)
- MCFG_WD17XX_DEFAULT_DRIVE4_TAGS
+ MCFG_FD1793_ADD("fdc", XTAL_1MHz)
- MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(swtpc09_floppy_interface)
+ MCFG_FLOPPY_DRIVE_ADD("fdc:0", swtpc09_floppies, "dd", swtpc09_state::floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("fdc:1", swtpc09_floppies, "dd", swtpc09_state::floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("fdc:2", swtpc09_floppies, "dd", swtpc09_state::floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("fdc:3", swtpc09_floppies, "dd", swtpc09_state::floppy_formats)
MCFG_DEVICE_ADD("piaide", PIA6821, 0)
@@ -258,10 +218,12 @@ static MACHINE_CONFIG_START( swtpc09d3, swtpc09_state )
MCFG_DEVICE_ADD("acia_clock", CLOCK, 153600)
MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(swtpc09_state, write_acia_clock))
- MCFG_DEVICE_ADD("fdc", FD1793, 0)
- MCFG_WD17XX_DEFAULT_DRIVE4_TAGS
+ MCFG_FD1793_ADD("fdc", XTAL_1MHz)
- MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(swtpc09_floppy_interface)
+ MCFG_FLOPPY_DRIVE_ADD("fdc:0", swtpc09_floppies, "dd", swtpc09_state::floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("fdc:1", swtpc09_floppies, "dd", swtpc09_state::floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("fdc:2", swtpc09_floppies, "dd", swtpc09_state::floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("fdc:3", swtpc09_floppies, "dd", swtpc09_state::floppy_formats)
MCFG_DEVICE_ADD("via", VIA6522, XTAL_4MHz / 4)
MCFG_VIA6522_READPA_HANDLER(READ8(swtpc09_state, dmf3_via_read_porta))
diff --git a/src/mess/drivers/tavernie.c b/src/mess/drivers/tavernie.c
index beba6c63099..06a4efcbfc8 100644
--- a/src/mess/drivers/tavernie.c
+++ b/src/mess/drivers/tavernie.c
@@ -371,7 +371,7 @@ static MACHINE_CONFIG_DERIVED( ivg09, cpu09 )
MCFG_PIA_WRITEPA_HANDLER(WRITE8(tavernie_state, pa_ivg_w))
MCFG_PIA_CB2_HANDLER(DEVWRITELINE("beeper", beep_device, set_state))
- MCFG_FD1795x_ADD("fdc", XTAL_8MHz / 8)
+ MCFG_FD1795_ADD("fdc", XTAL_8MHz / 8)
MCFG_FLOPPY_DRIVE_ADD("fdc:0", ifd09_floppies, "525dd", floppy_image_device::default_floppy_formats)
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/tb303.c b/src/mess/drivers/tb303.c
index 1631ce2b0a6..6f8536a636b 100644
--- a/src/mess/drivers/tb303.c
+++ b/src/mess/drivers/tb303.c
@@ -2,6 +2,8 @@
// copyright-holders:hap
/***************************************************************************
+ ** subclass of hh_ucom4_state (includes/hh_ucom4.h, drivers/hh_ucom4.c) **
+
Roland TB-303 Bass Line, 1982, designed by Tadao Kikumoto
* NEC uCOM-43 MCU, labeled D650C 133
* 3*uPD444C 1024x4 Static CMOS SRAM
@@ -11,23 +13,34 @@
***************************************************************************/
-#include "emu.h"
-#include "cpu/ucom4/ucom4.h"
+#include "includes/hh_ucom4.h"
#include "tb303.lh"
-class tb303_state : public driver_device
+class tb303_state : public hh_ucom4_state
{
public:
tb303_state(const machine_config &mconfig, device_type type, const char *tag)
- : driver_device(mconfig, type, tag),
- m_maincpu(*this, "maincpu"),
+ : hh_ucom4_state(mconfig, type, tag),
m_t3_off_timer(*this, "t3_off")
{ }
- required_device<cpu_device> m_maincpu;
required_device<timer_device> m_t3_off_timer;
+
+ UINT8 m_ram[0xc00];
+ UINT16 m_ram_address;
+ bool m_ram_ce;
+ bool m_ram_we;
+
+ DECLARE_WRITE8_MEMBER(ram_w);
+ DECLARE_READ8_MEMBER(ram_r);
+ void refresh_ram();
+
+ DECLARE_WRITE8_MEMBER(led_w);
+ DECLARE_WRITE8_MEMBER(switch_w);
+ DECLARE_WRITE8_MEMBER(strobe_w);
+ DECLARE_READ8_MEMBER(input_r);
TIMER_DEVICE_CALLBACK_MEMBER(t3_clock);
TIMER_DEVICE_CALLBACK_MEMBER(t3_off);
@@ -36,6 +49,12 @@ public:
};
+/***************************************************************************
+
+ Timer/Interrupt
+
+***************************************************************************/
+
// T2 to MCU CLK: LC circuit, stable sine wave, 2.2us interval
#define TB303_T2_CLOCK_HZ 454545 /* in hz */
@@ -56,8 +75,152 @@ TIMER_DEVICE_CALLBACK_MEMBER(tb303_state::t3_clock)
+/***************************************************************************
+
+ I/O
+
+***************************************************************************/
+
+void tb303_state::refresh_ram()
+{
+ // MCU E2,E3 goes through a 4556 IC(pin 14,13) to one of uPD444 _CE:
+ // _Q0: N/C, _Q1: IC-5, _Q2: IC-3, _Q3: IC-4
+ m_ram_ce = true;
+ UINT8 hi = 0;
+ switch (m_port[NEC_UCOM4_PORTE] >> 2 & 3)
+ {
+ case 0: m_ram_ce = false; break;
+ case 1: hi = 0; break;
+ case 2: hi = 1; break;
+ case 3: hi = 2; break;
+ }
+
+ if (m_ram_ce)
+ {
+ // _WE must be high(read mode) for address transitions
+ if (!m_ram_we)
+ m_ram_address = hi << 10 | (m_port[NEC_UCOM4_PORTE] << 8 & 0x300) | m_port[NEC_UCOM4_PORTF] << 4 | m_port[NEC_UCOM4_PORTD];
+ else
+ m_ram[m_ram_address] = m_port[NEC_UCOM4_PORTC];
+ }
+
+ // to switchboard pin 19-22
+ //..
+}
+
+WRITE8_MEMBER(tb303_state::ram_w)
+{
+ // MCU C: RAM data
+ // MCU D,F,E: RAM address
+ m_port[offset] = data;
+ refresh_ram();
+
+ // MCU D,F01: pitch data
+ //..
+}
+
+READ8_MEMBER(tb303_state::ram_r)
+{
+ // MCU C: RAM data
+ if (m_ram_ce && !m_ram_we)
+ return m_ram[m_ram_address];
+ else
+ return 0;
+}
+
+WRITE8_MEMBER(tb303_state::led_w)
+{
+ // MCU G: leds state
+ display_matrix(4, 4, data, m_inp_mux);
+}
+
+WRITE8_MEMBER(tb303_state::switch_w)
+{
+ // MCU H: input/led mux
+ m_inp_mux = data;
+}
+
+WRITE8_MEMBER(tb303_state::strobe_w)
+{
+ // MCU I0: RAM _WE
+ m_ram_we = (data & 1) ? false : true;
+ refresh_ram();
+
+ // MCU I1: pitch data latch strobe
+ // MCU I2: gate signal
+}
+
+READ8_MEMBER(tb303_state::input_r)
+{
+ // MCU A,B: multiplexed inputs
+ // if input mux(port H) is 0, port A status buffer & gate is selected (via Q5 NAND)
+ if (offset == NEC_UCOM4_PORTA && m_inp_mux == 0)
+ {
+ // todo..
+ return m_inp_matrix[4]->read();
+ }
+ else
+ return read_inputs(4) >> (offset*4) & 0xf;
+}
+
+
+
+/***************************************************************************
+
+ Inputs
+
+***************************************************************************/
static INPUT_PORTS_START( tb303 )
+ PORT_START("IN.0") // H0 port A/B
+ PORT_CONFNAME( 0x03, 0x03, "Mode" )
+ PORT_CONFSETTING( 0x03, "Track Write" )
+ PORT_CONFSETTING( 0x02, "Track Play" )
+ PORT_CONFSETTING( 0x00, "Pattern Play" )
+ PORT_CONFSETTING( 0x01, "Pattern Write" )
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_Q) PORT_NAME("DEL C#")
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_W) PORT_NAME("INS D#")
+ PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_1) PORT_NAME("1 C")
+ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_2) PORT_NAME("2 D")
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_3) PORT_NAME("3 E")
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_4) PORT_NAME("4 F")
+
+ PORT_START("IN.1") // H1 port A/B
+ PORT_CONFNAME( 0x07, 0x00, "Track / Patt.Group" )
+ PORT_CONFSETTING( 0x00, "1 / I" )
+ PORT_CONFSETTING( 0x01, "2 / I" )
+ PORT_CONFSETTING( 0x02, "3 / II" )
+ PORT_CONFSETTING( 0x03, "4 / II" )
+ PORT_CONFSETTING( 0x04, "5 / III" )
+ PORT_CONFSETTING( 0x05, "6 / III" )
+ PORT_CONFSETTING( 0x06, "7 / IV" )
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
+ PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_5) PORT_NAME("5 G")
+ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_6) PORT_NAME("6 A")
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_7) PORT_NAME("7 B")
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_8) PORT_NAME("8 C")
+
+ PORT_START("IN.2") // H2 port A/B
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_D) PORT_NAME("Pattern Clear")
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_F) PORT_NAME("Function")
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_A) PORT_NAME("Pitch Mode")
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_S) PORT_NAME("Time Mode")
+ PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_9) PORT_NAME("9 Step")
+ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_0) PORT_NAME("0 3n")
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_MINUS) PORT_NAME("100 A")
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_EQUALS) PORT_NAME("200 B")
+
+ PORT_START("IN.3") // H3 port B
+ PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_UNUSED )
+ PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_R) PORT_NAME("F#")
+ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_T) PORT_NAME("G#")
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_Y) PORT_NAME("A#")
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_BACKSPACE) PORT_NAME("Back")
+
+ PORT_START("IN.4") // H=0 port A
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_ENTER) PORT_NAME("Run/Stop")
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_SPACE) PORT_NAME("Tap")
+ PORT_BIT( 0xfc, IP_ACTIVE_HIGH, IPT_UNUSED )
INPUT_PORTS_END
@@ -70,18 +233,41 @@ INPUT_PORTS_END
void tb303_state::machine_start()
{
+ hh_ucom4_state::machine_start();
+
+ // zerofill
+ memset(m_ram, 0, sizeof(m_ram));
+ m_ram_address = 0;
+ m_ram_ce = false;
+ m_ram_we = false;
+
+ // register for savestates
+ save_item(NAME(m_ram));
+ save_item(NAME(m_ram_address));
+ save_item(NAME(m_ram_ce));
+ save_item(NAME(m_ram_we));
}
-
static MACHINE_CONFIG_START( tb303, tb303_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", NEC_D650, TB303_T2_CLOCK_HZ)
+ MCFG_UCOM4_READ_A_CB(READ8(tb303_state, input_r))
+ MCFG_UCOM4_READ_B_CB(READ8(tb303_state, input_r))
+ MCFG_UCOM4_READ_C_CB(READ8(tb303_state, ram_r))
+ MCFG_UCOM4_WRITE_C_CB(WRITE8(tb303_state, ram_w))
+ MCFG_UCOM4_WRITE_D_CB(WRITE8(tb303_state, ram_w))
+ MCFG_UCOM4_WRITE_E_CB(WRITE8(tb303_state, ram_w))
+ MCFG_UCOM4_WRITE_F_CB(WRITE8(tb303_state, ram_w))
+ MCFG_UCOM4_WRITE_G_CB(WRITE8(tb303_state, led_w))
+ MCFG_UCOM4_WRITE_H_CB(WRITE8(tb303_state, switch_w))
+ MCFG_UCOM4_WRITE_I_CB(WRITE8(tb303_state, strobe_w))
MCFG_TIMER_DRIVER_ADD_PERIODIC("t3_clock", tb303_state, t3_clock, TB303_T3_CLOCK)
MCFG_TIMER_START_DELAY(TB303_T3_CLOCK)
MCFG_TIMER_DRIVER_ADD("t3_off", tb303_state, t3_off)
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_ucom4_state, display_decay_tick, attotime::from_msec(1))
MCFG_DEFAULT_LAYOUT(layout_tb303)
/* no video! */
@@ -100,7 +286,7 @@ MACHINE_CONFIG_END
ROM_START( tb303 )
ROM_REGION( 0x0800, "maincpu", 0 )
- ROM_LOAD( "d650c-133.ic8", 0x0000, 0x0800, CRC(dd2f26ae) SHA1(7f5e37f38d970219dc9e5d49a20dc5335a5c0b30) )
+ ROM_LOAD( "d650c-133.ic8", 0x0000, 0x0800, CRC(0805b37a) SHA1(9a0c1891b56446535cef66a11b8366e1b22cc23f) )
ROM_END
diff --git a/src/mess/drivers/tdv2324.c b/src/mess/drivers/tdv2324.c
index 09a69054036..2597c11dd85 100644
--- a/src/mess/drivers/tdv2324.c
+++ b/src/mess/drivers/tdv2324.c
@@ -287,7 +287,7 @@ static MACHINE_CONFIG_START( tdv2324, tdv2324_state )
MCFG_Z80SIO2_ADD(MK3887N4_TAG, 8000000/2, 0, 0, 0, 0)
- MCFG_FD1797x_ADD(FD1797PL02_TAG, 8000000/4)
+ MCFG_FD1797_ADD(FD1797PL02_TAG, 8000000/4)
MCFG_FLOPPY_DRIVE_ADD(FD1797PL02_TAG":0", tdv2324_floppies, "8dsdd", floppy_image_device::default_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD(FD1797PL02_TAG":1", tdv2324_floppies, "8dsdd", floppy_image_device::default_floppy_formats)
diff --git a/src/mess/drivers/thomson.c b/src/mess/drivers/thomson.c
index 93730444be8..663dbaf3140 100644
--- a/src/mess/drivers/thomson.c
+++ b/src/mess/drivers/thomson.c
@@ -73,10 +73,11 @@
#include "includes/thomson.h"
#include "bus/rs232/rs232.h"
#include "machine/6821pia.h"
-#include "machine/wd17xx.h"
+#include "machine/wd_fdc.h"
#include "machine/clock.h"
#include "bus/centronics/ctronics.h"
#include "imagedev/flopdrv.h"
+#include "formats/cd90_640_dsk.h"
#include "formats/basicdsk.h"
#include "machine/ram.h"
@@ -593,6 +594,17 @@ static const floppy_interface thomson_floppy_interface =
NULL
};
+FLOPPY_FORMATS_MEMBER( thomson_state::cd90_640_formats )
+ FLOPPY_CD90_640_FORMAT
+FLOPPY_FORMATS_END
+
+static SLOT_INTERFACE_START( cd90_640_floppies )
+ SLOT_INTERFACE("sssd", FLOPPY_525_SSSD)
+ SLOT_INTERFACE("sd", FLOPPY_525_SD)
+ SLOT_INTERFACE("ssdd", FLOPPY_525_SSDD)
+ SLOT_INTERFACE("dd", FLOPPY_525_DD)
+SLOT_INTERFACE_END
+
/* ------------ driver ------------ */
@@ -649,8 +661,10 @@ static MACHINE_CONFIG_START( to7, thomson_state )
/* floppy */
MCFG_DEVICE_ADD("mc6843", MC6843, 0)
- MCFG_DEVICE_ADD("wd2793", WD2793, 0)
- MCFG_WD17XX_DEFAULT_DRIVE4_TAGS
+ MCFG_WD2793_ADD("wd2793", XTAL_1MHz)
+
+ MCFG_FLOPPY_DRIVE_ADD("wd2793:0", cd90_640_floppies, "dd", thomson_state::cd90_640_formats)
+ MCFG_FLOPPY_DRIVE_ADD("wd2793:1", cd90_640_floppies, "dd", thomson_state::cd90_640_formats)
MCFG_DEVICE_ADD(FLOPPY_0, LEGACY_FLOPPY, 0)
MCFG_DEVICE_CONFIG(thomson_floppy_interface)
diff --git a/src/mess/drivers/ti990_10.c b/src/mess/drivers/ti990_10.c
index 8150b5437a4..f7f3f9ff219 100644
--- a/src/mess/drivers/ti990_10.c
+++ b/src/mess/drivers/ti990_10.c
@@ -1,4 +1,4 @@
-// license:???
+// license:GPL-2.0+
// copyright-holders:Raphael Nabet
/*
TI990/10 driver
diff --git a/src/mess/drivers/ti990_4.c b/src/mess/drivers/ti990_4.c
index 156bcdfce06..382d345e4d7 100644
--- a/src/mess/drivers/ti990_4.c
+++ b/src/mess/drivers/ti990_4.c
@@ -44,7 +44,6 @@ TODO:
#include "sound/beep.h"
#include "video/733_asr.h"
-#include "imagedev/flopdrv.h"
#include "machine/ti99/990_dk.h"
@@ -262,12 +261,12 @@ static ADDRESS_MAP_START(cru_map_v, AS_IO, 8, ti990_4_state )
ADDRESS_MAP_END
-static const floppy_interface ti990_4_floppy_interface =
+/* static const floppy_interface ti990_4_floppy_interface =
{
- FLOPPY_STANDARD_8_DSSD,
- LEGACY_FLOPPY_OPTIONS_NAME(fd800),
- NULL
-};
+ FLOPPY_STANDARD_8_DSSD,
+ LEGACY_FLOPPY_OPTIONS_NAME(fd800),
+ NULL
+}; */
MACHINE_RESET_MEMBER(ti990_4_state,ti990_4)
{
@@ -300,7 +299,7 @@ static MACHINE_CONFIG_START( ti990_4, ti990_4_state )
MCFG_DEVICE_ADD("fd800", FD800, 0)
MCFG_FD800_INT_HANDLER(WRITELINE(ti990_4_state, fd_interrupt))
- MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(ti990_4_floppy_interface)
+// MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(ti990_4_floppy_interface)
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( ti990_4v, ti990_4_state )
@@ -320,7 +319,7 @@ static MACHINE_CONFIG_START( ti990_4v, ti990_4_state )
MCFG_DEVICE_ADD("fd800", FD800, 0)
MCFG_FD800_INT_HANDLER(WRITELINE(ti990_4_state, fd_interrupt))
- MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(ti990_4_floppy_interface)
+// MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(ti990_4_floppy_interface)
MACHINE_CONFIG_END
/*
diff --git a/src/mess/drivers/ti99_2.c b/src/mess/drivers/ti99_2.c
index b5cc6681e35..41ed9ac2a7b 100644
--- a/src/mess/drivers/ti99_2.c
+++ b/src/mess/drivers/ti99_2.c
@@ -1,4 +1,4 @@
-// license:???
+// license:GPL-2.0+
// copyright-holders:Raphael Nabet
/*
Experimental ti99/2 driver
diff --git a/src/mess/drivers/tiki100.c b/src/mess/drivers/tiki100.c
index ccc25745e70..b10d277eab5 100644
--- a/src/mess/drivers/tiki100.c
+++ b/src/mess/drivers/tiki100.c
@@ -676,7 +676,7 @@ static MACHINE_CONFIG_START( tiki100, tiki100_state )
MCFG_TIMER_DRIVER_ADD_PERIODIC("ctc", tiki100_state, ctc_tick, attotime::from_hz(XTAL_8MHz/4))
- MCFG_FD1797x_ADD(FD1797_TAG, XTAL_8MHz/8) // FD1767PL-02 or FD1797-PL
+ MCFG_FD1797_ADD(FD1797_TAG, XTAL_8MHz/8) // FD1767PL-02 or FD1797-PL
MCFG_FLOPPY_DRIVE_ADD(FD1797_TAG":0", tiki100_floppies, "525qd", tiki100_state::floppy_formats)
MCFG_FLOPPY_DRIVE_ADD(FD1797_TAG":1", tiki100_floppies, "525qd", tiki100_state::floppy_formats)
diff --git a/src/mess/drivers/tispeak.c b/src/mess/drivers/tispeak.c
index bfac5fb156a..78eb11da72d 100644
--- a/src/mess/drivers/tispeak.c
+++ b/src/mess/drivers/tispeak.c
@@ -873,7 +873,7 @@ ROM_END
ROM_START( snmathp )
ROM_REGION( 0x1000, "maincpu", 0 )
// typed in from patent 4946391, verified with source code
- // BTANB note: Mix It does not work at all, this is an original bug in the prototype. There are probably other minor bugs too.
+ // BTANB note: Mix It does not work at all, this is an original bug in the patent listing. There are probably other minor bugs too.
ROM_LOAD( "us4946391_t2074", 0x0000, 0x1000, CRC(011f0c2d) SHA1(d2e14d72e03ca864abd51da78ffb71a9da82f624) )
ROM_REGION( 1246, "maincpu:ipla", 0 )
@@ -923,17 +923,17 @@ ROM_END
/* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY, FULLNAME, FLAGS */
-COMP( 1978, snspell, 0, 0, snspell, snspell, tispeak_state, snspell, "Texas Instruments", "Speak & Spell (US, 1978 version/prototype)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND )
-COMP( 1979, snspella, snspell, 0, snspell, snspell, tispeak_state, snspell, "Texas Instruments", "Speak & Spell (US, 1979 version)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) // incomplete dump, uses prototype MCU ROM
-COMP( 1980, snspellb, snspell, 0, snspell, snspell, tispeak_state, snspell, "Texas Instruments", "Speak & Spell (US, 1980 version)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) // incomplete dump, uses prototype MCU ROM
-COMP( 1978, snspelluk, snspell, 0, snspell, snspell, tispeak_state, snspell, "Texas Instruments", "Speak & Spell (UK, 1978 version)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) // incomplete dump, uses prototype MCU ROM
-COMP( 1981, snspelluka, snspell, 0, snspell, snspell, tispeak_state, snspell, "Texas Instruments", "Speak & Spell (UK, 1981 version)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) // incomplete dump, uses prototype MCU ROM
-COMP( 1979, snspelljp, snspell, 0, snspell, snspell, tispeak_state, snspell, "Texas Instruments", "Speak & Spell (Japan)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) // incomplete dump, uses prototype MCU ROM
+COMP( 1978, snspell, 0, 0, snspell, snspell, tispeak_state, snspell, "Texas Instruments", "Speak & Spell (US, 1978 version/patent)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND )
+COMP( 1979, snspella, snspell, 0, snspell, snspell, tispeak_state, snspell, "Texas Instruments", "Speak & Spell (US, 1979 version)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) // incomplete dump, uses patent MCU ROM
+COMP( 1980, snspellb, snspell, 0, snspell, snspell, tispeak_state, snspell, "Texas Instruments", "Speak & Spell (US, 1980 version)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) // incomplete dump, uses patent MCU ROM
+COMP( 1978, snspelluk, snspell, 0, snspell, snspell, tispeak_state, snspell, "Texas Instruments", "Speak & Spell (UK, 1978 version)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) // incomplete dump, uses patent MCU ROM
+COMP( 1981, snspelluka, snspell, 0, snspell, snspell, tispeak_state, snspell, "Texas Instruments", "Speak & Spell (UK, 1981 version)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) // incomplete dump, uses patent MCU ROM
+COMP( 1979, snspelljp, snspell, 0, snspell, snspell, tispeak_state, snspell, "Texas Instruments", "Speak & Spell (Japan)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) // incomplete dump, uses patent MCU ROM
COMP( 1980, ladictee, snspell, 0, snspell, snspell, tispeak_state, snspell, "Texas Instruments", "La Dictee Magique (France)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) // doesn't work due to missing CD2702 MCU dump, German/Italian version has CD2702 too
COMP( 1986, snmath, 0, 0, snmath, snmath, driver_device, 0, "Texas Instruments", "Speak & Math (US, 1986 version)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND )
-COMP( 1980, snmathp, snmath, 0, snmath, snmath, driver_device, 0, "Texas Instruments", "Speak & Math (US, 1980 version/prototype)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
+COMP( 1980, snmathp, snmath, 0, snmath, snmath, driver_device, 0, "Texas Instruments", "Speak & Math (US, 1980 version/patent)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
COMP( 1980, snread, 0, 0, snread, snread, tispeak_state, snspell, "Texas Instruments", "Speak & Read (US)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND )
-COMP( 1979, lantutor, 0, 0, lantutor, lantutor, tispeak_state, lantutor, "Texas Instruments", "Language Tutor (prototype)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
+COMP( 1979, lantutor, 0, 0, lantutor, lantutor, tispeak_state, lantutor, "Texas Instruments", "Language Tutor (patent)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
diff --git a/src/mess/drivers/tm990189.c b/src/mess/drivers/tm990189.c
index b883c01ffcc..f6c778dd305 100644
--- a/src/mess/drivers/tm990189.c
+++ b/src/mess/drivers/tm990189.c
@@ -1,4 +1,4 @@
-// license:???
+// license:GPL-2.0+
// copyright-holders:Raphael Nabet, Robbbert
/*
Experimental tm990/189 ("University Module") driver.
diff --git a/src/mess/drivers/trs80.c b/src/mess/drivers/trs80.c
index c57784bedc1..629b13e1467 100644
--- a/src/mess/drivers/trs80.c
+++ b/src/mess/drivers/trs80.c
@@ -136,6 +136,8 @@ There don't seem to be any JV1 boot disks for Model III/4.
***************************************************************************/
#include "includes/trs80.h"
+#include "formats/trs80_dsk.h"
+#include "formats/dmk_dsk.h"
static ADDRESS_MAP_START( trs80_map, AS_PROGRAM, 8, trs80_state )
@@ -158,10 +160,10 @@ static ADDRESS_MAP_START( model1_map, AS_PROGRAM, 8, trs80_state )
AM_RANGE(0x37e4, 0x37e7) AM_WRITE(trs80_cassunit_w)
AM_RANGE(0x37e8, 0x37eb) AM_READWRITE(trs80_printer_r, trs80_printer_w)
AM_RANGE(0x37ec, 0x37ec) AM_READ(trs80_wd179x_r)
- AM_RANGE(0x37ec, 0x37ec) AM_DEVWRITE("wd179x", fd1793_device, command_w)
- AM_RANGE(0x37ed, 0x37ed) AM_DEVREADWRITE("wd179x", fd1793_device, track_r, track_w)
- AM_RANGE(0x37ee, 0x37ee) AM_DEVREADWRITE("wd179x", fd1793_device, sector_r, sector_w)
- AM_RANGE(0x37ef, 0x37ef) AM_DEVREADWRITE("wd179x", fd1793_device, data_r, data_w)
+ AM_RANGE(0x37ec, 0x37ec) AM_DEVWRITE("fdc", fd1793_t, cmd_w)
+ AM_RANGE(0x37ed, 0x37ed) AM_DEVREADWRITE("fdc", fd1793_t, track_r, track_w)
+ AM_RANGE(0x37ee, 0x37ee) AM_DEVREADWRITE("fdc", fd1793_t, sector_r, sector_w)
+ AM_RANGE(0x37ef, 0x37ef) AM_DEVREADWRITE("fdc", fd1793_t, data_r, data_w)
AM_RANGE(0x3800, 0x38ff) AM_MIRROR(0x300) AM_READ(trs80_keyboard_r)
AM_RANGE(0x3c00, 0x3fff) AM_READWRITE(trs80_videoram_r, trs80_videoram_w) AM_SHARE("p_videoram")
AM_RANGE(0x4000, 0xffff) AM_RAM
@@ -208,10 +210,10 @@ static ADDRESS_MAP_START( model3_io, AS_IO, 8, trs80_state )
AM_RANGE(0xeb, 0xeb) AM_READWRITE(trs80m4_eb_r, trs80m4_eb_w)
AM_RANGE(0xec, 0xef) AM_READWRITE(trs80m4_ec_r, trs80m4_ec_w)
AM_RANGE(0xf0, 0xf0) AM_READ(trs80_wd179x_r)
- AM_RANGE(0xf0, 0xf0) AM_DEVWRITE("wd179x", fd1793_device, command_w)
- AM_RANGE(0xf1, 0xf1) AM_DEVREADWRITE("wd179x", fd1793_device, track_r, track_w)
- AM_RANGE(0xf2, 0xf2) AM_DEVREADWRITE("wd179x", fd1793_device, sector_r, sector_w)
- AM_RANGE(0xf3, 0xf3) AM_DEVREADWRITE("wd179x", fd1793_device, data_r, data_w)
+ AM_RANGE(0xf0, 0xf0) AM_DEVWRITE("fdc", fd1793_t, cmd_w)
+ AM_RANGE(0xf1, 0xf1) AM_DEVREADWRITE("fdc", fd1793_t, track_r, track_w)
+ AM_RANGE(0xf2, 0xf2) AM_DEVREADWRITE("fdc", fd1793_t, sector_r, sector_w)
+ AM_RANGE(0xf3, 0xf3) AM_DEVREADWRITE("fdc", fd1793_t, data_r, data_w)
AM_RANGE(0xf4, 0xf4) AM_WRITE(trs80m4_f4_w)
AM_RANGE(0xf8, 0xfb) AM_READWRITE(trs80_printer_r, trs80_printer_w)
AM_RANGE(0xfc, 0xff) AM_READWRITE(trs80m4_ff_r, trs80m4_ff_w)
@@ -230,10 +232,10 @@ static ADDRESS_MAP_START( model4_io, AS_IO, 8, trs80_state )
AM_RANGE(0xeb, 0xeb) AM_READWRITE(trs80m4_eb_r, trs80m4_eb_w)
AM_RANGE(0xec, 0xef) AM_READWRITE(trs80m4_ec_r, trs80m4_ec_w)
AM_RANGE(0xf0, 0xf0) AM_READ(trs80_wd179x_r)
- AM_RANGE(0xf0, 0xf0) AM_DEVWRITE("wd179x", fd1793_device, command_w)
- AM_RANGE(0xf1, 0xf1) AM_DEVREADWRITE("wd179x", fd1793_device, track_r, track_w)
- AM_RANGE(0xf2, 0xf2) AM_DEVREADWRITE("wd179x", fd1793_device, sector_r, sector_w)
- AM_RANGE(0xf3, 0xf3) AM_DEVREADWRITE("wd179x", fd1793_device, data_r, data_w)
+ AM_RANGE(0xf0, 0xf0) AM_DEVWRITE("fdc", fd1793_t, cmd_w)
+ AM_RANGE(0xf1, 0xf1) AM_DEVREADWRITE("fdc", fd1793_t, track_r, track_w)
+ AM_RANGE(0xf2, 0xf2) AM_DEVREADWRITE("fdc", fd1793_t, sector_r, sector_w)
+ AM_RANGE(0xf3, 0xf3) AM_DEVREADWRITE("fdc", fd1793_t, data_r, data_w)
AM_RANGE(0xf4, 0xf4) AM_WRITE(trs80m4_f4_w)
AM_RANGE(0xf8, 0xfb) AM_READWRITE(trs80_printer_r, trs80_printer_w)
AM_RANGE(0xfc, 0xff) AM_READWRITE(trs80m4_ff_r, trs80m4_ff_w)
@@ -253,10 +255,10 @@ static ADDRESS_MAP_START( model4p_io, AS_IO, 8, trs80_state )
AM_RANGE(0xeb, 0xeb) AM_READWRITE(trs80m4_eb_r, trs80m4_eb_w)
AM_RANGE(0xec, 0xef) AM_READWRITE(trs80m4_ec_r, trs80m4_ec_w)
AM_RANGE(0xf0, 0xf0) AM_READ(trs80_wd179x_r)
- AM_RANGE(0xf0, 0xf0) AM_DEVWRITE("wd179x", fd1793_device, command_w)
- AM_RANGE(0xf1, 0xf1) AM_DEVREADWRITE("wd179x", fd1793_device, track_r, track_w)
- AM_RANGE(0xf2, 0xf2) AM_DEVREADWRITE("wd179x", fd1793_device, sector_r, sector_w)
- AM_RANGE(0xf3, 0xf3) AM_DEVREADWRITE("wd179x", fd1793_device, data_r, data_w)
+ AM_RANGE(0xf0, 0xf0) AM_DEVWRITE("fdc", fd1793_t, cmd_w)
+ AM_RANGE(0xf1, 0xf1) AM_DEVREADWRITE("fdc", fd1793_t, track_r, track_w)
+ AM_RANGE(0xf2, 0xf2) AM_DEVREADWRITE("fdc", fd1793_t, sector_r, sector_w)
+ AM_RANGE(0xf3, 0xf3) AM_DEVREADWRITE("fdc", fd1793_t, data_r, data_w)
AM_RANGE(0xf4, 0xf4) AM_WRITE(trs80m4_f4_w)
AM_RANGE(0xf8, 0xfb) AM_READWRITE(trs80_printer_r, trs80_printer_w)
AM_RANGE(0xfc, 0xff) AM_READWRITE(trs80m4_ff_r, trs80m4_ff_w)
@@ -277,10 +279,10 @@ static ADDRESS_MAP_START( meritum_io, AS_IO, 8, trs80_state )
// eg. port F0 should be 5, port F2 should have bit 3 set.
//AM_RANGE(0x03, 0x03) unknown
AM_RANGE(0xf0, 0xf0) AM_READ(trs80_wd179x_r)
- AM_RANGE(0xf0, 0xf0) AM_DEVWRITE("wd179x", fd1793_device, command_w)
- AM_RANGE(0xf1, 0xf1) AM_DEVREADWRITE("wd179x", fd1793_device, track_r, track_w)
- AM_RANGE(0xf2, 0xf2) AM_DEVREADWRITE("wd179x", fd1793_device, sector_r, sector_w)
- AM_RANGE(0xf3, 0xf3) AM_DEVREADWRITE("wd179x", fd1793_device, data_r, data_w)
+ AM_RANGE(0xf0, 0xf0) AM_DEVWRITE("fdc", fd1793_t, cmd_w)
+ AM_RANGE(0xf1, 0xf1) AM_DEVREADWRITE("fdc", fd1793_t, track_r, track_w)
+ AM_RANGE(0xf2, 0xf2) AM_DEVREADWRITE("fdc", fd1793_t, sector_r, sector_w)
+ AM_RANGE(0xf3, 0xf3) AM_DEVREADWRITE("fdc", fd1793_t, data_r, data_w)
AM_RANGE(0xf4, 0xf4) AM_WRITE(trs80m4_f4_w)
AM_RANGE(0xf8, 0xfb) AM_READWRITE(trs80_printer_r, trs80_printer_w)
//AM_RANGE(0xfc, 0xfd) unknown
@@ -545,12 +547,15 @@ static GFXDECODE_START(meritum)
GFXDECODE_END
-static const floppy_interface trs80_floppy_interface =
-{
- FLOPPY_STANDARD_5_25_DSHD,
- LEGACY_FLOPPY_OPTIONS_NAME(trs80),
- NULL
-};
+FLOPPY_FORMATS_MEMBER( trs80_state::floppy_formats )
+ FLOPPY_TRS80_FORMAT,
+ FLOPPY_DMK_FORMAT
+FLOPPY_FORMATS_END
+
+static SLOT_INTERFACE_START( trs80_floppies )
+ SLOT_INTERFACE("sssd", FLOPPY_525_SSSD)
+SLOT_INTERFACE_END
+
static MACHINE_CONFIG_START( trs80, trs80_state ) // the original model I, level I, with no extras
/* basic machine hardware */
@@ -595,11 +600,13 @@ static MACHINE_CONFIG_DERIVED( model1, trs80 ) // model I, level II
MCFG_QUICKLOAD_ADD("quickload", trs80_state, trs80_cmd, "cmd", 0.5)
- MCFG_DEVICE_ADD("wd179x", FD1793, 0) // should be FD1771 or FD1791 but inverted data lines are too tricky to fix now
- MCFG_WD17XX_DEFAULT_DRIVE4_TAGS
- MCFG_WD17XX_INTRQ_CALLBACK(WRITELINE(trs80_state,trs80_fdc_intrq_w))
+ MCFG_FD1793_ADD("fdc", XTAL_1MHz) // todo: should be fd1771
+ MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(trs80_state,trs80_fdc_intrq_w))
- MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(trs80_floppy_interface)
+ MCFG_FLOPPY_DRIVE_ADD("fdc:0", trs80_floppies, "sssd", trs80_state::floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("fdc:1", trs80_floppies, "sssd", trs80_state::floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("fdc:2", trs80_floppies, "", trs80_state::floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("fdc:3", trs80_floppies, "", trs80_state::floppy_formats)
MCFG_CENTRONICS_ADD("centronics", centronics_devices, "printer")
MCFG_CENTRONICS_BUSY_HANDLER(DEVWRITELINE("cent_status_in", input_buffer_device, write_bit7))
diff --git a/src/mess/drivers/trs80m2.c b/src/mess/drivers/trs80m2.c
index 4d18448d9c3..3698a937458 100644
--- a/src/mess/drivers/trs80m2.c
+++ b/src/mess/drivers/trs80m2.c
@@ -722,7 +722,7 @@ static MACHINE_CONFIG_START( trs80m2, trs80m2_state )
MCFG_MC6845_OUT_VSYNC_CB(WRITELINE(trs80m2_state, vsync_w))
// devices
- MCFG_FD1791x_ADD(FD1791_TAG, XTAL_8MHz/4)
+ MCFG_FD1791_ADD(FD1791_TAG, XTAL_8MHz/4)
MCFG_WD_FDC_INTRQ_CALLBACK(DEVWRITE8(Z80PIO_TAG, z80pio_device, pa_w))
MCFG_WD_FDC_DRQ_CALLBACK(DEVWRITELINE(Z80DMA_TAG, z80dma_device, rdy_w))
MCFG_FLOPPY_DRIVE_ADD(FD1791_TAG":0", trs80m2_floppies, "8dsdd", floppy_image_device::default_floppy_formats)
@@ -812,7 +812,7 @@ static MACHINE_CONFIG_START( trs80m16, trs80m16_state )
MCFG_MC6845_OUT_VSYNC_CB(WRITELINE(trs80m2_state, vsync_w))
// devices
- MCFG_FD1791x_ADD(FD1791_TAG, XTAL_8MHz/4)
+ MCFG_FD1791_ADD(FD1791_TAG, XTAL_8MHz/4)
MCFG_WD_FDC_INTRQ_CALLBACK(DEVWRITE8(Z80PIO_TAG, z80pio_device, pa_w))
MCFG_WD_FDC_DRQ_CALLBACK(DEVWRITELINE(Z80DMA_TAG, z80dma_device, rdy_w))
MCFG_FLOPPY_DRIVE_ADD(FD1791_TAG":0", trs80m2_floppies, "8dsdd", floppy_image_device::default_floppy_formats)
diff --git a/src/mess/drivers/ts802.c b/src/mess/drivers/ts802.c
index 89e1bb79679..0c8dea9a3ca 100644
--- a/src/mess/drivers/ts802.c
+++ b/src/mess/drivers/ts802.c
@@ -211,7 +211,7 @@ static MACHINE_CONFIG_START( ts802, ts802_state )
MCFG_DEVICE_ADD("z80ctc", Z80CTC, XTAL_16MHz / 4)
MCFG_Z80CTC_INTR_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
- MCFG_FD1793x_ADD("fdc", XTAL_4MHz / 2) // unknown clock
+ MCFG_FD1793_ADD("fdc", XTAL_4MHz / 2) // unknown clock
MCFG_FLOPPY_DRIVE_ADD("fdc:0", ts802_floppies, "525dd", floppy_image_device::default_floppy_formats)
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/tutor.c b/src/mess/drivers/tutor.c
index c675256be72..1978e64fdb0 100644
--- a/src/mess/drivers/tutor.c
+++ b/src/mess/drivers/tutor.c
@@ -1,4 +1,4 @@
-// license:???
+// license:GPL-2.0+
// copyright-holders:Raphael Nabet
/*
Experimental Tomy Tutor driver
diff --git a/src/mess/drivers/tvgame.c b/src/mess/drivers/tvgame.c
new file mode 100644
index 00000000000..44ede341caf
--- /dev/null
+++ b/src/mess/drivers/tvgame.c
@@ -0,0 +1,133 @@
+// license:BSD-3-Clause
+// copyright-holders: Robbbert
+/***************************************************************************
+
+ Homebrew Z80-based TV Game computer by Mr. Isizu
+
+ http://w01.tp1.jp/~a571632211/z80tvgame/index.html
+
+ 2015-06-12 Driver by Robbbert
+
+****************************************************************************/
+
+#include "emu.h"
+#include "cpu/z80/z80.h"
+#include "machine/i8255.h"
+#include "sound/speaker.h"
+
+
+class tvgame_state : public driver_device
+{
+public:
+ tvgame_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag)
+ , m_maincpu(*this, "maincpu")
+ , m_speaker(*this, "speaker")
+ , m_p_videoram(*this, "videoram")
+ { }
+
+ DECLARE_WRITE8_MEMBER(speaker_w);
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+private:
+ required_device<cpu_device> m_maincpu;
+ required_device<speaker_sound_device> m_speaker;
+ required_shared_ptr<UINT8> m_p_videoram;
+};
+
+static ADDRESS_MAP_START( tvgame_mem, AS_PROGRAM, 8, tvgame_state )
+ ADDRESS_MAP_UNMAP_HIGH
+ AM_RANGE( 0x0000, 0x7fff ) AM_ROM
+ AM_RANGE( 0x8000, 0xbfff ) AM_RAM
+ AM_RANGE( 0xc000, 0xdfff ) AM_RAM AM_SHARE("videoram")
+ADDRESS_MAP_END
+
+static ADDRESS_MAP_START( tvgame_io, AS_IO, 8, tvgame_state )
+ ADDRESS_MAP_GLOBAL_MASK(3)
+ ADDRESS_MAP_UNMAP_HIGH
+ AM_RANGE( 0x0000, 0x0003) AM_DEVREADWRITE("ppi", i8255_device, read, write)
+ADDRESS_MAP_END
+
+/* Input ports */
+INPUT_PORTS_START( tvgame )
+ PORT_START("LINE0")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
+ PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
+INPUT_PORTS_END
+
+WRITE8_MEMBER( tvgame_state::speaker_w )
+{
+ m_speaker->level_w(BIT(data, 0));
+}
+
+UINT32 tvgame_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+{
+ UINT8 y,gfx;
+ UINT16 sy=0,ma=241,x;
+
+ for (y = 0; y < 213; y++)
+ {
+ UINT16 *p = &bitmap.pix16(sy++);
+ for (x = ma; x < ma+27; x++)
+ {
+ gfx = m_p_videoram[x];
+
+ /* Display a scanline of a character (8 pixels) */
+ *p++ = BIT(gfx, 0);
+ *p++ = BIT(gfx, 1);
+ *p++ = BIT(gfx, 2);
+ *p++ = BIT(gfx, 3);
+ *p++ = BIT(gfx, 4);
+ *p++ = BIT(gfx, 5);
+ *p++ = BIT(gfx, 6);
+ *p++ = BIT(gfx, 7);
+ }
+ ma+=30;
+ }
+ return 0;
+}
+
+static MACHINE_CONFIG_START( tvgame, tvgame_state )
+ /* basic machine hardware */
+ MCFG_CPU_ADD("maincpu", Z80, XTAL_4MHz)
+ MCFG_CPU_PROGRAM_MAP(tvgame_mem)
+ MCFG_CPU_IO_MAP(tvgame_io)
+
+ /* video hardware */
+ MCFG_SCREEN_ADD("screen", RASTER)
+ MCFG_SCREEN_REFRESH_RATE(50)
+ MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
+ MCFG_SCREEN_UPDATE_DRIVER(tvgame_state, screen_update)
+ MCFG_SCREEN_SIZE(216, 213)
+ MCFG_SCREEN_VISIBLE_AREA(0, 215, 0, 212)
+ MCFG_SCREEN_PALETTE("palette")
+ MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette")
+
+ /* sound hardware */
+ MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+
+ // Devices
+ MCFG_DEVICE_ADD("ppi", I8255, 0)
+ MCFG_I8255_IN_PORTA_CB(IOPORT("LINE0"))
+ MCFG_I8255_OUT_PORTC_CB(WRITE8(tvgame_state, speaker_w))
+MACHINE_CONFIG_END
+
+/* ROM definition */
+ROM_START( tvgame )
+ ROM_REGION( 0x8000, "maincpu", 0 )
+ ROM_LOAD( "tvgame_all.ppi", 0x0000, 0x8000, CRC(b61d17bd) SHA1(bb92d6679370fc31d67cc334807d88d7288c7cfa) )
+
+ ROM_REGION(0x1000, "proms", 0)
+ ROM_LOAD( "video32.bin", 0x0000, 0x1000, CRC(516006e3) SHA1(942b31acccf833cd722cbcb739eb87673dc633d7) )
+ROM_END
+
+/* Driver */
+
+/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */
+CONS( 2011, tvgame, 0, 0, tvgame, tvgame, driver_device, 0, "Mr. Isizu", "Z80 TV Game System", 0 )
diff --git a/src/mess/drivers/tx0.c b/src/mess/drivers/tx0.c
index c06cb542064..b00fcc1c714 100644
--- a/src/mess/drivers/tx0.c
+++ b/src/mess/drivers/tx0.c
@@ -1,4 +1,4 @@
-// license:???
+// license:GPL-2.0+
// copyright-holders:Raphael Nabet
/*
TX-0
diff --git a/src/mess/drivers/unixpc.c b/src/mess/drivers/unixpc.c
index 3b8be7c72e6..87899d29dcf 100644
--- a/src/mess/drivers/unixpc.c
+++ b/src/mess/drivers/unixpc.c
@@ -208,7 +208,7 @@ static MACHINE_CONFIG_START( unixpc, unixpc_state )
MCFG_RAM_EXTRA_OPTIONS("2M")
// floppy
- MCFG_DEVICE_ADD("wd2797", WD2797x, 1000000)
+ MCFG_DEVICE_ADD("wd2797", WD2797, 1000000)
MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(unixpc_state, wd2797_intrq_w))
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(unixpc_state, wd2797_drq_w))
MCFG_FLOPPY_DRIVE_ADD("wd2797:0", unixpc_floppies, "525dd", floppy_image_device::default_floppy_formats)
diff --git a/src/mess/drivers/uzebox.c b/src/mess/drivers/uzebox.c
index a3b09b7621e..2193f129146 100644
--- a/src/mess/drivers/uzebox.c
+++ b/src/mess/drivers/uzebox.c
@@ -14,7 +14,7 @@
#include "emu.h"
#include "cpu/avr8/avr8.h"
-#include "sound/dac.h"
+#include "sound/speaker.h"
#include "bus/generic/slot.h"
#include "bus/generic/carts.h"
#include "bus/snes_ctrl/ctrl.h"
@@ -32,13 +32,15 @@ public:
m_maincpu(*this, "maincpu"),
m_cart(*this, "cartslot"),
m_ctrl1(*this, "ctrl1"),
- m_ctrl2(*this, "ctrl2")
+ m_ctrl2(*this, "ctrl2"),
+ m_speaker(*this, "speaker")
{ }
required_device<avr8_device> m_maincpu;
required_device<generic_slot_device> m_cart;
required_device<snes_control_port_device> m_ctrl1;
required_device<snes_control_port_device> m_ctrl2;
+ required_device<speaker_sound_device> m_speaker;
DECLARE_READ8_MEMBER(port_a_r);
DECLARE_WRITE8_MEMBER(port_a_w);
@@ -168,7 +170,10 @@ WRITE8_MEMBER(uzebox_state::port_d_w)
// --x- x--- NC
// ---- -x-- power
// ---- --xx UART MIDI
-
+ if ((m_port_d ^ data) & 0x80)
+ {
+ m_speaker->level_w(data & 0x80);
+ }
m_port_d = data;
}
@@ -280,9 +285,9 @@ static MACHINE_CONFIG_START( uzebox, uzebox_state )
MCFG_SCREEN_UPDATE_DRIVER(uzebox_state, screen_update_uzebox)
/* sound hardware */
- MCFG_SPEAKER_STANDARD_MONO("avr8")
- MCFG_SOUND_ADD("dac", DAC, 0)
- MCFG_SOUND_ROUTE(0, "avr8", 1.00)
+ MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
+ MCFG_SOUND_ROUTE(0, "mono", 1.00)
MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "uzebox")
MCFG_GENERIC_EXTENSIONS("bin,uze")
@@ -302,4 +307,4 @@ ROM_START( uzebox )
ROM_END
/* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME */
-CONS(2010, uzebox, 0, 0, uzebox, uzebox, driver_device, 0, "Belogic", "Uzebox", GAME_NO_SOUND | GAME_NOT_WORKING)
+CONS(2010, uzebox, 0, 0, uzebox, uzebox, driver_device, 0, "Belogic", "Uzebox", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING)
diff --git a/src/mess/drivers/v1050.c b/src/mess/drivers/v1050.c
index 06cb8b6a240..09cd375fc23 100644
--- a/src/mess/drivers/v1050.c
+++ b/src/mess/drivers/v1050.c
@@ -918,6 +918,8 @@ void v1050_state::update_fdc()
}
}
+// disk format: 80 tracks, 1 head, 10 sectors, 512 bytes sector length, first sector id 1
+
static SLOT_INTERFACE_START( v1050_floppies )
SLOT_INTERFACE( "525ssqd", FLOPPY_525_SSQD ) // Teac FD 55E-02-U
SLOT_INTERFACE( "525qd", FLOPPY_525_QD ) // Teac FD 55-FV-35-U
@@ -937,16 +939,6 @@ WRITE_LINE_MEMBER( v1050_state::fdc_drq_w )
update_fdc();
}
-/*
-static LEGACY_FLOPPY_OPTIONS_START( v1050 )
- LEGACY_FLOPPY_OPTION( v1050, "dsk", "Visual 1050 disk image", basicdsk_identify_default, basicdsk_construct_default, NULL,
- HEADS([1])
- TRACKS([80])
- SECTORS([10])
- SECTOR_LENGTH([512])
- FIRST_SECTOR_ID([1]))
-LEGACY_FLOPPY_OPTIONS_END
-*/
// Machine Initialization
@@ -1099,7 +1091,7 @@ static MACHINE_CONFIG_START( v1050, v1050_state )
MCFG_DEVICE_ADD(CLOCK_SIO_TAG, CLOCK, XTAL_16MHz/4)
MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(v1050_state, write_sio_clock))
- MCFG_MB8877x_ADD(MB8877_TAG, XTAL_16MHz/16)
+ MCFG_MB8877_ADD(MB8877_TAG, XTAL_16MHz/16)
MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(v1050_state, fdc_intrq_w))
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(v1050_state, fdc_drq_w))
MCFG_FLOPPY_DRIVE_ADD(MB8877_TAG":0", v1050_floppies, "525qd", floppy_image_device::default_floppy_formats)
diff --git a/src/mess/drivers/v6809.c b/src/mess/drivers/v6809.c
index 36ef0a7663e..be3572e17b7 100644
--- a/src/mess/drivers/v6809.c
+++ b/src/mess/drivers/v6809.c
@@ -358,7 +358,7 @@ static MACHINE_CONFIG_START( v6809, v6809_state )
MCFG_MM58274C_MODE24(0) // 12 hour
MCFG_MM58274C_DAY1(1) // monday
- MCFG_MB8876x_ADD("fdc", XTAL_16MHz / 16)
+ MCFG_MB8876_ADD("fdc", XTAL_16MHz / 16)
MCFG_FLOPPY_DRIVE_ADD("fdc:0", v6809_floppies, "525dd", floppy_image_device::default_floppy_formats)
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/vector06.c b/src/mess/drivers/vector06.c
index 208a5feb15c..b283c590f51 100644
--- a/src/mess/drivers/vector06.c
+++ b/src/mess/drivers/vector06.c
@@ -9,6 +9,7 @@
****************************************************************************/
#include "includes/vector06.h"
+#include "formats/vector06_dsk.h"
/* Address maps */
@@ -23,10 +24,10 @@ static ADDRESS_MAP_START(vector06_io, AS_IO, 8, vector06_state)
AM_RANGE( 0x00, 0x03) AM_READWRITE(vector06_8255_1_r, vector06_8255_1_w )
AM_RANGE( 0x04, 0x07) AM_READWRITE(vector06_8255_2_r, vector06_8255_2_w )
AM_RANGE( 0x0C, 0x0C) AM_WRITE(vector06_color_set)
- AM_RANGE( 0x18, 0x18) AM_DEVREADWRITE("wd1793", fd1793_device, data_r, data_w)
- AM_RANGE( 0x19, 0x19) AM_DEVREADWRITE("wd1793", fd1793_device, sector_r, sector_w)
- AM_RANGE( 0x1A, 0x1A) AM_DEVREADWRITE("wd1793", fd1793_device, track_r, track_w)
- AM_RANGE( 0x1B, 0x1B) AM_DEVREADWRITE("wd1793", fd1793_device, status_r, command_w)
+ AM_RANGE( 0x18, 0x18) AM_DEVREADWRITE("wd1793", fd1793_t, data_r, data_w)
+ AM_RANGE( 0x19, 0x19) AM_DEVREADWRITE("wd1793", fd1793_t, sector_r, sector_w)
+ AM_RANGE( 0x1a, 0x1a) AM_DEVREADWRITE("wd1793", fd1793_t, track_r, track_w)
+ AM_RANGE( 0x1b, 0x1b) AM_DEVREADWRITE("wd1793", fd1793_t, status_r, cmd_w)
AM_RANGE( 0x1C, 0x1C) AM_WRITE(vector06_disc_w)
ADDRESS_MAP_END
@@ -119,21 +120,15 @@ static INPUT_PORTS_START( vector06 )
INPUT_PORTS_END
-static LEGACY_FLOPPY_OPTIONS_START(vector)
- LEGACY_FLOPPY_OPTION(vector, "fdd", "Vector disk image", basicdsk_identify_default, basicdsk_construct_default, NULL,
- HEADS([2])
- TRACKS([82])
- SECTORS([5])
- SECTOR_LENGTH([1024])
- FIRST_SECTOR_ID([1]))
-LEGACY_FLOPPY_OPTIONS_END
-
-static const floppy_interface vector_floppy_interface =
-{
- FLOPPY_STANDARD_5_25_DSHD,
- LEGACY_FLOPPY_OPTIONS_NAME(vector),
- NULL
-};
+
+FLOPPY_FORMATS_MEMBER( vector06_state::floppy_formats )
+ FLOPPY_VECTOR06_FORMAT
+FLOPPY_FORMATS_END
+
+static SLOT_INTERFACE_START( vector06_floppies )
+ SLOT_INTERFACE("qd", FLOPPY_525_QD)
+SLOT_INTERFACE_END
+
/* Machine driver */
static MACHINE_CONFIG_START( vector06, vector06_state )
@@ -176,11 +171,10 @@ static MACHINE_CONFIG_START( vector06, vector06_state )
MCFG_CASSETTE_ADD("cassette")
MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED)
- MCFG_DEVICE_ADD("wd1793", FD1793, 0)
- MCFG_WD17XX_DEFAULT_DRIVE2_TAGS
- MCFG_WD17XX_DDEN_CALLBACK(VCC)
+ MCFG_FD1793_ADD("wd1793", XTAL_1MHz)
- MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(vector_floppy_interface)
+ MCFG_FLOPPY_DRIVE_ADD("wd1793:0", vector06_floppies, "qd", vector06_state::floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("wd1793:1", vector06_floppies, "qd", vector06_state::floppy_formats)
/* cartridge */
MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "vector06_cart")
diff --git a/src/mess/drivers/victor9k.c b/src/mess/drivers/victor9k.c
index 677f5667741..a50c15802f9 100644
--- a/src/mess/drivers/victor9k.c
+++ b/src/mess/drivers/victor9k.c
@@ -10,7 +10,6 @@
TODO:
- - keyboard
- expansion bus
- Z80 card
- Winchester DMA card (Xebec S1410 + Tandon TM502/TM603SE)
@@ -29,6 +28,14 @@
//**************************************************************************
+// MACROS / CONSTANTS
+//**************************************************************************
+
+#define LOG 0
+
+
+
+//**************************************************************************
// ADDRESS MAPS
//**************************************************************************
@@ -218,14 +225,14 @@ WRITE8_MEMBER( victor9k_state::via1_pb_w )
bit description
- PB0 DAV / DATA STROBE
- PB1 EOI / VFU?
+ PB0 STROBE/DAV
+ PB1 PI/EOI
PB2 REN
PB3 ATN
PB4 IFC
- PB5 SRQ
- PB6 NRFD
- PB7 NDAC
+ PB5 SRQ/BUSY SRQ
+ PB6 NRFD/ACK RFD
+ PB7 SEL/DAC
*/
@@ -272,6 +279,13 @@ WRITE8_MEMBER( victor9k_state::via2_pa_w )
*/
}
+void victor9k_state::update_kback()
+{
+ int kback = !(!(m_kbrdy && !m_via2_irq) && !(m_kbackctl && m_via2_irq));
+
+ m_kb->kback_w(kback);
+}
+
WRITE8_MEMBER( victor9k_state::via2_pb_w )
{
/*
@@ -290,7 +304,8 @@ WRITE8_MEMBER( victor9k_state::via2_pb_w )
*/
// keyboard acknowledge
- m_kb->kback_w(BIT(data, 1));
+ m_kbackctl = BIT(data, 1);
+ update_kback();
// brightness
m_brt = (data >> 2) & 0x07;
@@ -299,6 +314,14 @@ WRITE8_MEMBER( victor9k_state::via2_pb_w )
m_cont = data >> 5;
}
+WRITE_LINE_MEMBER( victor9k_state::via2_irq_w )
+{
+ m_via2_irq = state;
+
+ m_pic->ir6_w(m_via2_irq);
+ update_kback();
+}
+
WRITE_LINE_MEMBER( victor9k_state::write_ria )
{
@@ -360,14 +383,17 @@ WRITE_LINE_MEMBER( victor9k_state::via3_irq_w )
WRITE_LINE_MEMBER( victor9k_state::kbrdy_w )
{
- //logerror("KBRDY %u\n", state);
+ if (LOG) logerror("KBRDY %u\n", state);
m_via2->write_cb1(state);
+
+ m_kbrdy = state;
+ update_kback();
}
WRITE_LINE_MEMBER( victor9k_state::kbdata_w )
{
- //logerror("KBDATA %u\n", state);
+ if (LOG) logerror("KBDATA %u\n", state);
m_via2->write_cb2(state);
m_via2->write_pa6(state);
@@ -392,9 +418,12 @@ void victor9k_state::machine_start()
save_item(NAME(m_brt));
save_item(NAME(m_cont));
save_item(NAME(m_via1_irq));
+ save_item(NAME(m_via2_irq));
save_item(NAME(m_via3_irq));
save_item(NAME(m_fdc_irq));
save_item(NAME(m_ssda_irq));
+ save_item(NAME(m_kbrdy));
+ save_item(NAME(m_kbackctl));
// patch out SCP self test
m_rom->base()[0x11ab] = 0xc3;
@@ -499,7 +528,7 @@ static MACHINE_CONFIG_START( victor9k, victor9k_state )
MCFG_DEVICE_ADD(M6522_2_TAG, VIA6522, XTAL_30MHz/30)
MCFG_VIA6522_WRITEPA_HANDLER(WRITE8(victor9k_state, via2_pa_w))
MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(victor9k_state, via2_pb_w))
- MCFG_VIA6522_IRQ_HANDLER(DEVWRITELINE(I8259A_TAG, pic8259_device, ir6_w))
+ MCFG_VIA6522_IRQ_HANDLER(WRITELINE(victor9k_state, via2_irq_w))
MCFG_DEVICE_ADD(M6522_3_TAG, VIA6522, XTAL_30MHz/30)
MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(victor9k_state, via3_pb_w))
diff --git a/src/mess/drivers/vii.c b/src/mess/drivers/vii.c
index 5958e8c24b4..127e4a7a72b 100644
--- a/src/mess/drivers/vii.c
+++ b/src/mess/drivers/vii.c
@@ -181,7 +181,7 @@ enum
SPG243_BATMAN,
SPG243_VSMILE,
- SPG243_MODEL_COUNT,
+ SPG243_MODEL_COUNT
};
diff --git a/src/mess/drivers/vixen.c b/src/mess/drivers/vixen.c
index 9e7eabdb57c..bc6f0230bf4 100644
--- a/src/mess/drivers/vixen.c
+++ b/src/mess/drivers/vixen.c
@@ -790,7 +790,7 @@ static MACHINE_CONFIG_START( vixen, vixen_state )
MCFG_RS232_RXD_HANDLER(DEVWRITELINE(P8251A_TAG, i8251_device, write_rxd))
MCFG_RS232_DSR_HANDLER(DEVWRITELINE(P8251A_TAG, i8251_device, write_dsr))
- MCFG_FD1797x_ADD(FDC1797_TAG, XTAL_23_9616MHz/24)
+ MCFG_FD1797_ADD(FDC1797_TAG, XTAL_23_9616MHz/24)
MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(vixen_state, fdc_intrq_w))
MCFG_FLOPPY_DRIVE_ADD(FDC1797_TAG":0", vixen_floppies, "525dd", floppy_image_device::default_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD(FDC1797_TAG":1", vixen_floppies, "525dd", floppy_image_device::default_floppy_formats)
diff --git a/src/mess/drivers/vk100.c b/src/mess/drivers/vk100.c
index f169bfe0141..a549d9904a2 100644
--- a/src/mess/drivers/vk100.c
+++ b/src/mess/drivers/vk100.c
@@ -1073,7 +1073,7 @@ ROM_START( vk100 )
* Complement: M=A^(P^N)
* Erase: M=N
*/
- ROM_LOAD( "wb8201_656f1.m1-7643-5.pr4.ic17", 0x0000, 0x0400, CRC(e8ecf59f) SHA1(49e9d109dad3d203d45471a3f4ca4985d556161f)) // label verified from nigwil's board
+ ROM_LOAD( "wb8201_656f1.m1-7643-5.pr4.ic14", 0x0000, 0x0400, CRC(e8ecf59f) SHA1(49e9d109dad3d203d45471a3f4ca4985d556161f)) // label verified from nigwil's board
ROM_REGION(0x100, "trans", ROMREGION_ERASEFF )
/* this is the "TRANSLATOR ROM" described in figure 5-17 on page 5-27 (256*8, 82s135)
@@ -1087,7 +1087,7 @@ ROM_START( vk100 )
* \\\\\\\\- X'9 thru X'2
* The VT125 prom @ E60 is literally identical to this, the same exact part: 23-060B1
*/
- ROM_LOAD( "wb---0_060b1.mmi6309.pr2.ic77", 0x0000, 0x0100, CRC(198317fc) SHA1(00e97104952b3fbe03a4f18d800d608b837d10ae)) // label verified from nigwil's board
+ ROM_LOAD( "wb---0_060b1.mmi6309.pr2.ic82", 0x0000, 0x0100, CRC(198317fc) SHA1(00e97104952b3fbe03a4f18d800d608b837d10ae)) // label verified from nigwil's board
ROM_REGION(0x100, "dir", ROMREGION_ERASEFF )
/* this is the "DIRECTION ROM" == mb6309 (256x8, 82s135)
@@ -1114,7 +1114,7 @@ ROM_START( vk100 )
* \--------- UNUSED, always 0
* The VT125 prom @ E41 is literally identical to this, the same exact part: 23-059B1
*/
- ROM_LOAD( "wb8141_059b1.tbp18s22.pr5.ic108", 0x0000, 0x0100, CRC(4b63857a) SHA1(3217247d983521f0b0499b5c4ef6b5de9844c465)) // label verified from andy's board
+ ROM_LOAD( "wb8141_059b1.tbp18s22.pr5.ic111", 0x0000, 0x0100, CRC(4b63857a) SHA1(3217247d983521f0b0499b5c4ef6b5de9844c465)) // label verified from andy's board
ROM_REGION( 0x100, "ras_erase", ROMREGION_ERASEFF )
/* this is the "RAS/ERASE ROM" involved with driving the RAS lines and erasing VRAM dram (256*4, 82s129)
@@ -1155,10 +1155,11 @@ ROM_START( vk100 )
X'2 inputs lend credence to this.
*
*/
- ROM_LOAD( "wb8151_573a2.mmi6301.pr3.ic44", 0x0000, 0x0100, CRC(75885a9f) SHA1(c721dad6a69c291dd86dad102ed3a8ddd620ecc4)) // label verified from nigwil's and andy's board
+ ROM_LOAD( "wb8151_573a2.mmi6301.pr3.ic41", 0x0000, 0x0100, CRC(75885a9f) SHA1(c721dad6a69c291dd86dad102ed3a8ddd620ecc4)) // label verified from nigwil's and andy's board
ROM_REGION( 0x100, "vector", ROMREGION_ERASEFF )
// WARNING: it is possible that the first two bytes of this prom are bad!
+ // The PROM on andy's board appears to be damaged, this will need to be redumped from another board.
/* this is the "VECTOR ROM" (256*8, 82s135) which runs the vector generator state machine
* the vector rom bits are complex and are unfortunately poorly documented
* in the tech manual. see figure 5-23.
@@ -1194,7 +1195,7 @@ ROM_START( vk100 )
*
* The VT125 prom E71 and its latch E70 is mostly equivalent to the vector prom, but the address order is different
*/
- ROM_LOAD( "wb8146_058b1.mmi6309.pr1.ic99", 0x0000, 0x0100, CRC(71b01864) SHA1(e552f5b0bc3f443299282b1da7e9dbfec60e12bf)) // label verified from nigwil's and andy's board
+ ROM_LOAD( "wb8146_058b1.mmi6309.pr1.ic99", 0x0000, 0x0100, BAD_DUMP CRC(71b01864) SHA1(e552f5b0bc3f443299282b1da7e9dbfec60e12bf)) // label verified from nigwil's and andy's board
ROM_REGION( 0x20, "sync", ROMREGION_ERASEFF )
/* this is the "SYNC ROM" == mb6331 (32x8, 82s123)
diff --git a/src/mess/drivers/vt240.c b/src/mess/drivers/vt240.c
index 0d6589e272e..0c41d298d86 100644
--- a/src/mess/drivers/vt240.c
+++ b/src/mess/drivers/vt240.c
@@ -286,15 +286,15 @@ ROM_START( vt240 )
// but according to the Field Change Order below, the initial release is V2.1, so the above must be a prototype.
// DOL for v2.1 to v2.2 change: http://web.archive.org/web/20060905145200/http://cmcnabb.cc.vt.edu/dec94mds/vt240dol.txt
ROM_SYSTEM_BIOS( 0, "vt240v21", "VT240 V2.1" ) // initial factory release, FCO says this was 8 Feburary 1985
- ROMX_LOAD( "23-006e6-00.e20", 0x00000, 0x8000, CRC(79C11D82) SHA1(5A6FE5B75B6504A161F2C9B148C0FE9F19770837), ROM_SKIP(1) | ROM_BIOS(1))
- ROMX_LOAD( "23-004e6-00.e22", 0x00001, 0x8000, CRC(EBA10FEF) SHA1(C0EE4D8E4EEB70066F03F3D17A7E2F2BD0B5F8AD), ROM_SKIP(1) | ROM_BIOS(1))
- ROMX_LOAD( "23-007e6-00.e19", 0x10000, 0x8000, CRC(D18A2AB8) SHA1(37F448A332FC50298007ED39C8BF1AB1EB6D4CAE), ROM_SKIP(1) | ROM_BIOS(1))
- ROMX_LOAD( "23-005e6-00.e21", 0x10001, 0x8000, CRC(558D0285) SHA1(E96A49BF9D55D8AB879D9B39AA380368C5C9ADE0), ROM_SKIP(1) | ROM_BIOS(1))
+ ROMX_LOAD( "23-006e6-00.e20", 0x00000, 0x8000, CRC(79c11d82) SHA1(5a6fe5b75b6504a161f2c9b148c0fe9f19770837), ROM_SKIP(1) | ROM_BIOS(1))
+ ROMX_LOAD( "23-004e6-00.e22", 0x00001, 0x8000, CRC(eba10fef) SHA1(c0ee4d8e4eeb70066f03f3d17a7e2f2bd0b5f8ad), ROM_SKIP(1) | ROM_BIOS(1))
+ ROMX_LOAD( "23-007e6-00.e19", 0x10000, 0x8000, CRC(d18a2ab8) SHA1(37f448a332fc50298007ed39c8bf1ab1eb6d4cae), ROM_SKIP(1) | ROM_BIOS(1))
+ ROMX_LOAD( "23-005e6-00.e21", 0x10001, 0x8000, CRC(558d0285) SHA1(e96a49bf9d55d8ab879d9b39aa380368c5c9ade0), ROM_SKIP(1) | ROM_BIOS(1))
ROM_SYSTEM_BIOS( 1, "vt240", "VT240 V2.2" ) // Revised version, December 1985
- ROMX_LOAD( "23-058e6.e20", 0x00000, 0x8000, CRC(D2A56B90) SHA1(39CBB26134D7D8BA308DF3A93228918A5945B45F), ROM_SKIP(1) | ROM_BIOS(2))
- ROMX_LOAD( "23-056e6.e22", 0x00001, 0x8000, CRC(C46E13C3) SHA1(0F2801FA7483D1F97708143CD81AE0816BF9A435), ROM_SKIP(1) | ROM_BIOS(2))
- ROMX_LOAD( "23-059e6.e19", 0x10000, 0x8000, CRC(F8393346) SHA1(1E28DAF1B7F2BDABC47CE2F6FA99EF038B275A29), ROM_SKIP(1) | ROM_BIOS(2))
- ROMX_LOAD( "23-057e6.e21", 0x10001, 0x8000, CRC(7CE9DCE9) SHA1(5A105E5BDCA13910B3B79CC23567CE2DC36B844D), ROM_SKIP(1) | ROM_BIOS(2))
+ ROMX_LOAD( "23-058e6.e20", 0x00000, 0x8000, CRC(d2a56b90) SHA1(39cbb26134d7d8ba308df3a93228918a5945b45f), ROM_SKIP(1) | ROM_BIOS(2))
+ ROMX_LOAD( "23-056e6.e22", 0x00001, 0x8000, CRC(c46e13c3) SHA1(0f2801fa7483d1f97708143cd81ae0816bf9a435), ROM_SKIP(1) | ROM_BIOS(2))
+ ROMX_LOAD( "23-059e6.e19", 0x10000, 0x8000, CRC(f8393346) SHA1(1e28daf1b7f2bdabc47ce2f6fa99ef038b275a29), ROM_SKIP(1) | ROM_BIOS(2))
+ ROMX_LOAD( "23-057e6.e21", 0x10001, 0x8000, CRC(7ce9dce9) SHA1(5a105e5bdca13910b3b79cc23567ce2dc36b844d), ROM_SKIP(1) | ROM_BIOS(2))
// E39, E85, E131 are empty.
ROM_REGION( 0x1000, "proms", ROMREGION_ERASEFF )
diff --git a/src/mess/drivers/wicat.c b/src/mess/drivers/wicat.c
index b556c83cda9..534bc3b5de5 100644
--- a/src/mess/drivers/wicat.c
+++ b/src/mess/drivers/wicat.c
@@ -895,7 +895,7 @@ static MACHINE_CONFIG_START( wicat, wicat_state )
MCFG_CPU_ADD("wd1kcpu",N8X300,XTAL_8MHz)
MCFG_CPU_PROGRAM_MAP(wicat_wd1000_mem)
MCFG_CPU_IO_MAP(wicat_wd1000_io)
- MCFG_FD1795x_ADD("fdc",XTAL_8MHz)
+ MCFG_FD1795_ADD("fdc",XTAL_8MHz)
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/wildfire.c b/src/mess/drivers/wildfire.c
index 1caa630a253..03dc325fd18 100644
--- a/src/mess/drivers/wildfire.c
+++ b/src/mess/drivers/wildfire.c
@@ -340,4 +340,4 @@ ROM_START( wildfire )
ROM_END
-CONS( 1979, wildfire, 0, 0, wildfire, wildfire, driver_device, 0, "Parker Brothers", "Wildfire (prototype)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK ) // note: pretty sure that it matches the commercial release
+CONS( 1979, wildfire, 0, 0, wildfire, wildfire, driver_device, 0, "Parker Brothers", "Wildfire (patent)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK ) // note: pretty sure that it matches the commercial release
diff --git a/src/mess/drivers/x1.c b/src/mess/drivers/x1.c
index 577e8780f2d..41e11b4e876 100644
--- a/src/mess/drivers/x1.c
+++ b/src/mess/drivers/x1.c
@@ -206,6 +206,7 @@
************************************************************************************************/
#include "includes/x1.h"
+#include "formats/2d_dsk.h"
#define MAIN_CLOCK XTAL_16MHz
#define VDP_CLOCK XTAL_42_9545MHz
@@ -1021,10 +1022,12 @@ READ8_MEMBER( x1_state::x1_fdc_r )
WRITE8_MEMBER( x1_state::x1_fdc_w )
{
+ floppy_image_device *floppy = NULL;
+
switch(offset+0xff8)
{
case 0x0ff8:
- m_fdc->command_w(space, offset,data);
+ m_fdc->cmd_w(space, offset,data);
break;
case 0x0ff9:
m_fdc->track_w(space, offset,data);
@@ -1035,12 +1038,25 @@ WRITE8_MEMBER( x1_state::x1_fdc_w )
case 0x0ffb:
m_fdc->data_w(space, offset,data);
break;
+
case 0x0ffc:
- m_fdc->set_drive(data & 3);
- floppy_get_device(machine(), data & 3)->floppy_mon_w(!BIT(data, 7));
- floppy_get_device(machine(), data & 3)->floppy_drive_set_ready_state(data & 0x80,0);
- m_fdc->set_side(BIT(data, 4));
+ switch (data & 0x03)
+ {
+ case 0: floppy = m_floppy0->get_device(); break;
+ case 1: floppy = m_floppy1->get_device(); break;
+ case 2: floppy = m_floppy2->get_device(); break;
+ case 3: floppy = m_floppy3->get_device(); break;
+ }
+
+ m_fdc->set_floppy(floppy);
+
+ if (floppy)
+ {
+ floppy->ss_w(BIT(data, 4));
+ floppy->mon_w(!BIT(data, 7));
+ }
break;
+
case 0x0ffd:
case 0x0ffe:
case 0x0fff:
@@ -2414,21 +2430,13 @@ PALETTE_INIT_MEMBER(x1_state,x1)
palette.set_pen_color(i,rgb_t(0x00,0x00,0x00));
}
-static LEGACY_FLOPPY_OPTIONS_START( x1 )
- LEGACY_FLOPPY_OPTION( img2d, "2d", "2D disk image", basicdsk_identify_default, basicdsk_construct_default, NULL,
- HEADS([2])
- TRACKS([40])
- SECTORS([16])
- SECTOR_LENGTH([256])
- FIRST_SECTOR_ID([1]))
-LEGACY_FLOPPY_OPTIONS_END
+FLOPPY_FORMATS_MEMBER( x1_state::floppy_formats )
+ FLOPPY_2D_FORMAT
+FLOPPY_FORMATS_END
-static const floppy_interface x1_floppy_interface =
-{
- FLOPPY_STANDARD_5_25_DSDD_40,
- LEGACY_FLOPPY_OPTIONS_NAME(x1),
- "floppy_5_25"
-};
+static SLOT_INTERFACE_START( x1_floppies )
+ SLOT_INTERFACE("dd", FLOPPY_525_DD)
+SLOT_INTERFACE_END
static MACHINE_CONFIG_START( x1, x1_state )
/* basic machine hardware */
@@ -2475,8 +2483,14 @@ static MACHINE_CONFIG_START( x1, x1_state )
MCFG_VIDEO_START_OVERRIDE(x1_state,x1)
- MCFG_DEVICE_ADD("fdc", MB8877, 0)
- MCFG_WD17XX_DEFAULT_DRIVE4_TAGS
+ MCFG_MB8877_ADD("fdc", MAIN_CLOCK / 16)
+
+ MCFG_FLOPPY_DRIVE_ADD("fdc:0", x1_floppies, "dd", x1_state::floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("fdc:1", x1_floppies, "dd", x1_state::floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("fdc:2", x1_floppies, "dd", x1_state::floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("fdc:3", x1_floppies, "dd", x1_state::floppy_formats)
+
+ MCFG_SOFTWARE_LIST_ADD("flop_list","x1_flop")
MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "x1_cart")
MCFG_GENERIC_EXTENSIONS("bin,rom")
@@ -2502,9 +2516,6 @@ static MACHINE_CONFIG_START( x1, x1_state )
MCFG_SOFTWARE_LIST_ADD("cass_list","x1_cass")
- MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(x1_floppy_interface)
- MCFG_SOFTWARE_LIST_ADD("flop_list","x1_flop")
-
MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard_timer", x1_state, x1_keyboard_callback, attotime::from_hz(250))
MCFG_TIMER_DRIVER_ADD_PERIODIC("cmt_wind_timer", x1_state, x1_cmt_wind_timer, attotime::from_hz(16))
MACHINE_CONFIG_END
@@ -2527,10 +2538,8 @@ static MACHINE_CONFIG_DERIVED( x1turbo, x1 )
MCFG_Z80DMA_IN_IORQ_CB(READ8(x1_state, io_read_byte))
MCFG_Z80DMA_OUT_IORQ_CB(WRITE8(x1_state, io_write_byte))
- MCFG_DEVICE_REMOVE("fdc")
- MCFG_DEVICE_ADD("fdc", MB8877, 0)
- MCFG_WD17XX_DEFAULT_DRIVE4_TAGS
- MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(x1_state,fdc_drq_w))
+ MCFG_DEVICE_MODIFY("fdc")
+ MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(x1_state, fdc_drq_w))
MCFG_YM2151_ADD("ym", MAIN_CLOCK/8) //option board
MCFG_SOUND_ROUTE(0, "lspeaker", 0.50)
diff --git a/src/mess/drivers/x1twin.c b/src/mess/drivers/x1twin.c
index a0bfb2ad5b4..ee9841d1ae4 100644
--- a/src/mess/drivers/x1twin.c
+++ b/src/mess/drivers/x1twin.c
@@ -394,23 +394,9 @@ static const z80_daisy_config x1_daisy[] =
{ NULL }
};
-static LEGACY_FLOPPY_OPTIONS_START( x1 )
- LEGACY_FLOPPY_OPTION( img2d, "2d", "2D disk image", basicdsk_identify_default, basicdsk_construct_default, NULL,
- HEADS([2])
- TRACKS([40])
- SECTORS([16])
- SECTOR_LENGTH([256])
- FIRST_SECTOR_ID([1]))
-LEGACY_FLOPPY_OPTIONS_END
-
-static const floppy_interface x1_floppy_interface =
-{
- FLOPPY_STANDARD_5_25_DSDD_40,
- LEGACY_FLOPPY_OPTIONS_NAME(x1),
- "floppy_5_25"
-};
-
-
+static SLOT_INTERFACE_START( x1_floppies )
+ SLOT_INTERFACE("dd", FLOPPY_525_DD)
+SLOT_INTERFACE_END
static MACHINE_CONFIG_START( x1twin, x1twin_state )
/* basic machine hardware */
@@ -471,8 +457,14 @@ static MACHINE_CONFIG_START( x1twin, x1twin_state )
MCFG_VIDEO_START_OVERRIDE(x1twin_state,x1)
- MCFG_DEVICE_ADD("fdc", MB8877, 0)
- MCFG_WD17XX_DEFAULT_DRIVE4_TAGS
+ MCFG_MB8877_ADD("fdc", MAIN_CLOCK / 16)
+
+ MCFG_FLOPPY_DRIVE_ADD("fdc:0", x1_floppies, "dd", x1_state::floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("fdc:1", x1_floppies, "dd", x1_state::floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("fdc:2", x1_floppies, "dd", x1_state::floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("fdc:3", x1_floppies, "dd", x1_state::floppy_formats)
+
+ MCFG_SOFTWARE_LIST_ADD("flop_list","x1_flop")
MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "x1_cart")
MCFG_GENERIC_EXTENSIONS("bin,rom")
@@ -503,9 +495,6 @@ static MACHINE_CONFIG_START( x1twin, x1twin_state )
MCFG_SOFTWARE_LIST_ADD("cass_list","x1_cass")
- MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(x1_floppy_interface)
- MCFG_SOFTWARE_LIST_ADD("flop_list","x1_flop")
-
#if 0
MCFG_SOUND_ADD("c6280", C6280, PCE_MAIN_CLOCK/6)
MCFG_C6280_CPU("pce_cpu")
diff --git a/src/mess/drivers/xbox.c b/src/mess/drivers/xbox.c
new file mode 100644
index 00000000000..8b2ada377e8
--- /dev/null
+++ b/src/mess/drivers/xbox.c
@@ -0,0 +1,224 @@
+// license:BSD-3-Clause
+// copyright-holders:?
+/***************************************************************************
+
+ XBOX (c) 2001 Microsoft
+
+ Skeleton driver
+
+***************************************************************************/
+
+
+#include "emu.h"
+#include "cpu/i386/i386.h"
+//#include "machine/lpci.h"
+//#include "machine/pic8259.h"
+//#include "machine/pit8253.h"
+//#include "machine/idectrl.h"
+//#include "machine/idehd.h"
+//#include "machine/naomigd.h"
+//#include "video/poly.h"
+//#include "bitmap.h"
+//#include "debug/debugcon.h"
+//#include "debug/debugcmd.h"
+//#include "debug/debugcpu.h"
+//#include "includes/chihiro.h"
+
+
+#define CPU_DIV 64
+
+/*!
+ @todo - Inheritance with chihiro_state
+ */
+class xbox_state : public driver_device
+{
+public:
+ xbox_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu")
+ { }
+
+ // devices
+ required_device<cpu_device> m_maincpu;
+
+ // screen updates
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ DECLARE_PALETTE_INIT(xbox);
+protected:
+ // driver_device overrides
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ virtual void video_start();
+};
+
+void xbox_state::video_start()
+{
+}
+
+UINT32 xbox_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect )
+{
+ return 0;
+}
+
+static ADDRESS_MAP_START(xbox_map, AS_PROGRAM, 32, xbox_state)
+ AM_RANGE(0x00000000, 0x07ffffff) AM_RAM // 128 megabytes
+ AM_RANGE(0xf0000000, 0xf0ffffff) AM_RAM
+// AM_RANGE(0xfd000000, 0xfdffffff) AM_RAM AM_READWRITE(geforce_r, geforce_w)
+// AM_RANGE(0xfed00000, 0xfed003ff) AM_READWRITE(usbctrl_r, usbctrl_w)
+// AM_RANGE(0xfe800000, 0xfe85ffff) AM_READWRITE(audio_apu_r, audio_apu_w)
+// AM_RANGE(0xfec00000, 0xfec001ff) AM_READWRITE(audio_ac93_r, audio_ac93_w)
+ AM_RANGE(0xff000000, 0xff07ffff) AM_ROM AM_REGION("bios", 0) AM_MIRROR(0x00f80000)
+ADDRESS_MAP_END
+
+static ADDRESS_MAP_START(xbox_map_io, AS_IO, 32, xbox_state)
+// AM_RANGE(0x0020, 0x0023) AM_DEVREADWRITE8("pic8259_1", pic8259_device, read, write, 0xffffffff)
+// AM_RANGE(0x0040, 0x0043) AM_DEVREADWRITE8("pit8254", pit8254_device, read, write, 0xffffffff)
+// AM_RANGE(0x00a0, 0x00a3) AM_DEVREADWRITE8("pic8259_2", pic8259_device, read, write, 0xffffffff)
+// AM_RANGE(0x01f0, 0x01f7) AM_DEVREADWRITE("ide", bus_master_ide_controller_device, read_cs0, write_cs0)
+// AM_RANGE(0x0cf8, 0x0cff) AM_DEVREADWRITE("pcibus", pci_bus_legacy_device, read, write)
+// AM_RANGE(0x4000, 0x40ff) AM_READWRITE(mediaboard_r, mediaboard_w)
+// AM_RANGE(0x8000, 0x80ff) AM_READWRITE(dummy_r, dummy_w)
+// AM_RANGE(0xc000, 0xc0ff) AM_READWRITE(smbus_r, smbus_w)
+// AM_RANGE(0xff60, 0xff67) AM_DEVREADWRITE("ide", bus_master_ide_controller_device, bmdma_r, bmdma_w)
+ADDRESS_MAP_END
+
+static INPUT_PORTS_START( xbox )
+ /* dummy active high structure */
+ PORT_START("SYSA")
+ PORT_DIPNAME( 0x01, 0x00, "SYSA" )
+ PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x01, DEF_STR( On ) )
+ PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x02, DEF_STR( On ) )
+ PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x04, DEF_STR( On ) )
+ PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x08, DEF_STR( On ) )
+ PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x10, DEF_STR( On ) )
+ PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x20, DEF_STR( On ) )
+ PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x40, DEF_STR( On ) )
+ PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x80, DEF_STR( On ) )
+
+ /* dummy active low structure */
+ PORT_START("DSWA")
+ PORT_DIPNAME( 0x01, 0x01, "DSWA" )
+ PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( On ) )
+ PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( On ) )
+ PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( On ) )
+ PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( On ) )
+ PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( On ) )
+ PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( On ) )
+ PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( On ) )
+ PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
+ PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( On ) )
+INPUT_PORTS_END
+
+
+
+
+void xbox_state::machine_start()
+{
+}
+
+void xbox_state::machine_reset()
+{
+}
+
+
+PALETTE_INIT_MEMBER(xbox_state, xbox)
+{
+}
+
+static MACHINE_CONFIG_START( xbox, xbox_state )
+
+ /* basic machine hardware */
+ MCFG_CPU_ADD("maincpu", PENTIUM3, 733333333/CPU_DIV) /* Wrong! family 6 model 8 stepping 10 */
+ MCFG_CPU_PROGRAM_MAP(xbox_map)
+ MCFG_CPU_IO_MAP(xbox_map_io)
+// MCFG_CPU_IRQ_ACKNOWLEDGE_DRIVER(chihiro_state, irq_callback)
+
+ /* video hardware */
+ MCFG_SCREEN_ADD("screen", RASTER)
+// MCFG_SCREEN_REFRESH_RATE(60)
+// MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500))
+ MCFG_SCREEN_UPDATE_DRIVER(xbox_state, screen_update)
+// MCFG_SCREEN_SIZE(32*8, 32*8)
+// MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1)
+ MCFG_SCREEN_RAW_PARAMS(8000000/2, 442, 0, 320, 264, 0, 240) /* generic NTSC video timing, change accordingly */
+ MCFG_SCREEN_PALETTE("palette")
+
+ MCFG_PALETTE_ADD("palette", 8)
+ MCFG_PALETTE_INIT_OWNER(xbox_state, xbox)
+
+ /* sound hardware */
+ MCFG_SPEAKER_STANDARD_MONO("mono")
+// MCFG_SOUND_ADD("aysnd", AY8910, MAIN_CLOCK/4)
+// MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
+MACHINE_CONFIG_END
+
+
+/***************************************************************************
+
+ Machine driver(s)
+
+***************************************************************************/
+
+ROM_START( xbox )
+ ROM_REGION( 0x200, "mcpx", 0 )
+ ROM_LOAD( "mcpx_1_0.bin", 0, 0x200, CRC(f31429fc) SHA1(a9ecbf8896d10db81594923e485862aa3aac7b58) )
+ ROM_LOAD( "mcpx_1_1.bin", 0, 0x200, CRC(94ce376b) SHA1(6c875f17f773aaec51eb434068bb6c657c4343c0) )
+
+ ROM_REGION( 0x80000, "bios", 0)
+ ROM_LOAD( "xbox-5530.bin", 0x000000, 0x040000, CRC(9569c4d3) SHA1(40fa73277013be3168135e1768b09623a987ff63) )
+ ROM_LOAD( "xbox-5713.bin", 0x040000, 0x040000, CRC(58fd8173) SHA1(8b7ccc4648ccd78cdb7b65cfca09621eaf2d4238) )
+ ROM_COPY( "mcpx", 0, 0x7fe00, 0x200 )
+
+
+ ROM_REGION( 0x1000000, "tbp", 0 ) // To Be Processed, of course
+ ROM_LOAD( "3944_1024k.bin", 0x000000, 0x100000, CRC(32a9ecb6) SHA1(67054fc88bda94e33e86f1b19be60efec0724fb6) )
+ ROM_LOAD( "4034_1024k.bin", 0x000000, 0x100000, CRC(0d6fc88f) SHA1(ab676b712204fb1728bf89f9cd541a8f5a64ab97) )
+ ROM_LOAD( "4134_1024k.bin", 0x000000, 0x100000, CRC(49d8055a) SHA1(d46cef771a63dc8024fe36d7ab5b959087ac999f) )
+ ROM_LOAD( "4817_1024k.bin", 0x000000, 0x100000, CRC(3f30863a) SHA1(dc955bd4d3ca71e01214a49e5d0aba615270c03c) )
+ ROM_LOAD( "5101_256k.bin", 0x000000, 0x040000, CRC(e8a9224e) SHA1(5108e1025f48071c07a6823661d708c66dee97a9) )
+ ROM_LOAD( "5838_256k.bin", 0x000000, 0x040000, CRC(5be2413d) SHA1(b9489e883c650b5e5fe2f83a32237dbf74f0e9f1) )
+ROM_END
+// See src/emu/gamedrv.h for details
+// For a game:
+// GAME(YEAR,NAME,PARENT,MACHINE,INPUT,CLASS,INIT,MONITOR,COMPANY,FULLNAME,FLAGS)
+
+// For a console:
+// CONS(YEAR,NAME,PARENT,COMPAT,MACHINE,INPUT,CLASS,INIT,COMPANY,FULLNAME,FLAGS)
+
+// For a computer:
+// COMP(YEAR,NAME,PARENT,COMPAT,MACHINE,INPUT,CLASS,INIT,COMPANY,FULLNAME,FLAGS)
+
+// For a generic system:
+// SYST(YEAR,NAME,PARENT,COMPAT,MACHINE,INPUT,CLASS,INIT,COMPANY,FULLNAME,FLAGS)
+
+CONS( 2001, xbox, 0, 0, xbox, xbox, driver_device, 0, "Microsoft", "XBOX", GAME_IS_SKELETON )
diff --git a/src/mess/drivers/xerox820.c b/src/mess/drivers/xerox820.c
index 114bee250ca..6e9d4307fe3 100644
--- a/src/mess/drivers/xerox820.c
+++ b/src/mess/drivers/xerox820.c
@@ -35,6 +35,15 @@
Note:
- MK-82 have same roms as original Big Board
- MK-83 have 256K of RAM
+
+ 8-inch formats
+ 77 tracks, 1 head, 26 sectors, 128 bytes sector length, first sector id 1
+ 77 tracks, 1 head, 26 sectors, 256 bytes sector length, first sector id 1
+
+ 5.25-inch formats
+ 40 tracks, 1 head, 18 sectors, 128 bytes sector length, first sector id 1
+ 40 tracks, 2 heads, 18 sectors, 128 bytes sector length, first sector id 1
+
*/
@@ -235,7 +244,7 @@ READ8_MEMBER( xerox820_state::kbpio_pa_r )
data |= m_400_460 << 5;
return data;
-};
+}
WRITE8_MEMBER( xerox820_state::kbpio_pa_w )
{
@@ -318,7 +327,7 @@ READ8_MEMBER( xerox820_state::kbpio_pb_r )
*/
return m_kb->read() ^ 0xff;
-};
+}
WRITE8_MEMBER( xerox820ii_state::rdpio_pb_w )
{
@@ -491,34 +500,7 @@ void xerox820ii_state::machine_reset()
m_fdc->reset();
}
-/*
-static LEGACY_FLOPPY_OPTIONS_START( xerox820 )
- LEGACY_FLOPPY_OPTION( sssd8, "dsk", "8\" SSSD", basicdsk_identify_default, basicdsk_construct_default, NULL,
- HEADS([1])
- TRACKS([77])
- SECTORS([26])
- SECTOR_LENGTH([128])
- FIRST_SECTOR_ID([1]))
- LEGACY_FLOPPY_OPTION( ssdd8, "dsk", "8\" SSDD", basicdsk_identify_default, basicdsk_construct_default, NULL,
- HEADS([1])
- TRACKS([77])
- SECTORS([26])
- SECTOR_LENGTH([256])
- FIRST_SECTOR_ID([1]))
- LEGACY_FLOPPY_OPTION( sssd5, "dsk", "5.25\" SSSD", basicdsk_identify_default, basicdsk_construct_default, NULL,
- HEADS([1])
- TRACKS([40])
- SECTORS([18])
- SECTOR_LENGTH([128])
- FIRST_SECTOR_ID([1]))
- LEGACY_FLOPPY_OPTION( ssdd5, "dsk", "5.25\" SSDD", basicdsk_identify_default, basicdsk_construct_default, NULL,
- HEADS([2])
- TRACKS([40])
- SECTORS([18])
- SECTOR_LENGTH([128])
- FIRST_SECTOR_ID([1]))
-LEGACY_FLOPPY_OPTIONS_END
-*/
+
/* F4 Character Displayer */
static const gfx_layout xerox820_charlayout =
@@ -589,7 +571,7 @@ static MACHINE_CONFIG_START( xerox820, xerox820_state )
MCFG_Z80CTC_ZC2_CB(DEVWRITELINE(Z80CTC_TAG, z80ctc_device, trg3))
//MCFG_TIMER_DRIVER_ADD_PERIODIC("ctc", xerox820_state, ctc_tick, attotime::from_hz(XTAL_20MHz/8))
- MCFG_FD1771x_ADD(FD1771_TAG, XTAL_20MHz/20)
+ MCFG_FD1771_ADD(FD1771_TAG, XTAL_20MHz/20)
MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(xerox820_state, fdc_intrq_w))
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(xerox820_state, fdc_drq_w))
MCFG_FLOPPY_DRIVE_ADD(FD1771_TAG":0", xerox820_floppies, "sa400", floppy_image_device::default_floppy_formats)
@@ -676,7 +658,7 @@ static MACHINE_CONFIG_START( xerox820ii, xerox820ii_state )
MCFG_Z80CTC_ZC2_CB(DEVWRITELINE(Z80CTC_TAG, z80ctc_device, trg3))
//MCFG_TIMER_DRIVER_ADD_PERIODIC("ctc", xerox820_state, ctc_tick, attotime::from_hz(XTAL_16MHz/4))
- MCFG_FD1797x_ADD(FD1797_TAG, XTAL_16MHz/8)
+ MCFG_FD1797_ADD(FD1797_TAG, XTAL_16MHz/8)
MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(xerox820_state, fdc_intrq_w))
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(xerox820_state, fdc_drq_w))
MCFG_FLOPPY_DRIVE_ADD(FD1797_TAG":0", xerox820_floppies, "sa450", floppy_image_device::default_floppy_formats)
diff --git a/src/mess/drivers/xor100.c b/src/mess/drivers/xor100.c
index b45d095d94c..e3c596d61a9 100644
--- a/src/mess/drivers/xor100.c
+++ b/src/mess/drivers/xor100.c
@@ -552,7 +552,7 @@ static MACHINE_CONFIG_START( xor100, xor100_state )
MCFG_Z80CTC_ZC1_CB(WRITELINE(xor100_state, ctc_z1_w))
MCFG_Z80CTC_ZC2_CB(WRITELINE(xor100_state, ctc_z2_w))
- MCFG_FD1795x_ADD(WD1795_TAG, XTAL_8MHz/4)
+ MCFG_FD1795_ADD(WD1795_TAG, XTAL_8MHz/4)
MCFG_FLOPPY_DRIVE_ADD(WD1795_TAG":0", xor100_floppies, "8ssdd", floppy_image_device::default_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD(WD1795_TAG":1", xor100_floppies, "8ssdd", floppy_image_device::default_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD(WD1795_TAG":2", xor100_floppies, NULL, floppy_image_device::default_floppy_formats)
diff --git a/src/mess/drivers/z100.c b/src/mess/drivers/z100.c
index f4ba50f7cac..cf60317f96c 100644
--- a/src/mess/drivers/z100.c
+++ b/src/mess/drivers/z100.c
@@ -148,10 +148,8 @@ ZDIPSW EQU 0FFH ; Configuration dip switches
#include "video/mc6845.h"
#include "machine/pic8259.h"
#include "machine/6821pia.h"
-#include "machine/wd17xx.h"
-
+#include "machine/wd_fdc.h"
#include "imagedev/flopdrv.h"
-#include "formats/basicdsk.h"
class z100_state : public driver_device
{
@@ -164,8 +162,13 @@ public:
m_picm(*this, "pic8259_master"),
m_pics(*this, "pic8259_slave"),
m_fdc(*this, "z207_fdc"),
+ m_floppy0(*this, "z207_fdc:0"),
+ m_floppy1(*this, "z207_fdc:1"),
+ m_floppy2(*this, "z207_fdc:2"),
+ m_floppy3(*this, "z207_fdc:3"),
m_crtc(*this, "crtc"),
- m_palette(*this, "palette")
+ m_palette(*this, "palette"),
+ m_floppy(NULL)
{ }
required_device<cpu_device> m_maincpu;
@@ -173,7 +176,11 @@ public:
required_device<pia6821_device> m_pia1;
required_device<pic8259_device> m_picm;
required_device<pic8259_device> m_pics;
- required_device<fd1797_device> m_fdc;
+ required_device<fd1797_t> m_fdc;
+ required_device<floppy_connector> m_floppy0;
+ required_device<floppy_connector> m_floppy1;
+ required_device<floppy_connector> m_floppy2;
+ required_device<floppy_connector> m_floppy3;
required_device<mc6845_device> m_crtc;
required_device<palette_device> m_palette;
@@ -184,8 +191,8 @@ public:
DECLARE_WRITE8_MEMBER(keyb_command_w);
DECLARE_WRITE8_MEMBER(z100_6845_address_w);
DECLARE_WRITE8_MEMBER(z100_6845_data_w);
- DECLARE_READ8_MEMBER(z207_fdc_r);
- DECLARE_WRITE8_MEMBER(z207_fdc_w);
+ DECLARE_WRITE8_MEMBER(floppy_select_w);
+ DECLARE_WRITE8_MEMBER(floppy_motor_w);
DECLARE_READ8_MEMBER(get_slave_ack);
DECLARE_WRITE8_MEMBER(video_pia_A_w);
DECLARE_WRITE8_MEMBER(video_pia_B_w);
@@ -200,7 +207,8 @@ public:
UINT8 m_clr_val;
UINT8 m_crtc_vreg[0x100],m_crtc_index;
UINT16 m_start_addr;
- UINT8 m_z207_cur_drive;
+
+ floppy_image_device *m_floppy;
mc6845_device *m_mc6845;
DECLARE_DRIVER_INIT(z100);
@@ -350,41 +358,25 @@ WRITE8_MEMBER( z100_state::z100_6845_data_w )
m_crtc->register_w(space, offset, data);
}
-READ8_MEMBER( z100_state::z207_fdc_r )
-{
- UINT8 res;
-
- res = 0;
+// todo: side select?
- switch(offset)
+WRITE8_MEMBER( z100_state::floppy_select_w )
+{
+ switch (data & 0x03)
{
- case 0: res = m_fdc->status_r(space, offset); break;
- case 1: res = m_fdc->track_r(space, offset); break;
- case 2: res = m_fdc->sector_r(space, offset); break;
- case 3: res = m_fdc->data_r(space, offset); break;
+ case 0: m_floppy = m_floppy0->get_device(); break;
+ case 1: m_floppy = m_floppy1->get_device(); break;
+ case 2: m_floppy = m_floppy2->get_device(); break;
+ case 3: m_floppy = m_floppy3->get_device(); break;
}
- return res;
+ m_fdc->set_floppy(m_floppy);
}
-WRITE8_MEMBER( z100_state::z207_fdc_w )
+WRITE8_MEMBER( z100_state::floppy_motor_w )
{
- switch(offset)
- {
- case 0: m_fdc->command_w(space, offset,data); break;
- case 1: m_fdc->track_w(space, offset,data); break;
- case 2: m_fdc->sector_w(space, offset,data); break;
- case 3: m_fdc->data_w(space, offset,data); break;
- case 4: // disk control
- m_fdc->set_drive(data & 3);
- m_z207_cur_drive = data & 3;
- break;
- case 5: // aux control
- floppy_get_device(machine(), m_z207_cur_drive)->floppy_mon_w(!BIT(data, 1));
- floppy_get_device(machine(), m_z207_cur_drive)->floppy_drive_set_ready_state(data & 2,0);
- break;
-
- }
+ if (m_floppy)
+ m_floppy->mon_w(!BIT(data, 1));
}
static ADDRESS_MAP_START(z100_io, AS_IO, 8, z100_state)
@@ -399,7 +391,9 @@ static ADDRESS_MAP_START(z100_io, AS_IO, 8, z100_state)
// AM_RANGE (0xa4, 0xa7) gateway (reserved)
// AM_RANGE (0xac, 0xad) Z-217 secondary disk controller (winchester)
// AM_RANGE (0xae, 0xaf) Z-217 primary disk controller (winchester)
- AM_RANGE (0xb0, 0xb7) AM_READWRITE(z207_fdc_r,z207_fdc_w) // primary (wd1797)
+ AM_RANGE (0xb0, 0xb3) AM_DEVREADWRITE("z207_fdc", fd1797_t, read, write)
+ AM_RANGE (0xb4, 0xb4) AM_WRITE(floppy_select_w)
+ AM_RANGE (0xb5, 0xb5) AM_WRITE(floppy_motor_w)
// z-207 secondary disk controller (wd1797)
// AM_RANGE (0xcd, 0xce) ET-100 CRT Controller
// AM_RANGE (0xd4, 0xd7) ET-100 Trainer Parallel I/O
@@ -644,22 +638,6 @@ WRITE_LINE_MEMBER( z100_state::video_pia_CB2_w )
m_clr_val = (state & 1) ? 0x00 : 0xff;
}
-static LEGACY_FLOPPY_OPTIONS_START( z100 )
- LEGACY_FLOPPY_OPTION( img2d, "2d", "2D disk image", basicdsk_identify_default, basicdsk_construct_default, NULL,
- HEADS([2])
- TRACKS([40])
- SECTORS([16])
- SECTOR_LENGTH([256]) //up to 1024
- FIRST_SECTOR_ID([1]))
-LEGACY_FLOPPY_OPTIONS_END
-
-static const floppy_interface z100_floppy_interface =
-{
- FLOPPY_STANDARD_5_25_DSDD_40,
- LEGACY_FLOPPY_OPTIONS_NAME(z100),
- "floppy_5_25"
-};
-
void z100_state::machine_start()
{
m_mc6845 = machine().device<mc6845_device>("crtc");
@@ -681,6 +659,10 @@ void z100_state::machine_reset()
}
}
+static SLOT_INTERFACE_START( z100_floppies )
+ SLOT_INTERFACE("dd", FLOPPY_525_DD)
+SLOT_INTERFACE_END
+
static MACHINE_CONFIG_START( z100, z100_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu",I8088, XTAL_14_31818MHz/3)
@@ -715,10 +697,12 @@ static MACHINE_CONFIG_START( z100, z100_state )
MCFG_DEVICE_ADD("pia1", PIA6821, 0)
- MCFG_DEVICE_ADD("z207_fdc", FD1797, 0)
- MCFG_WD17XX_DEFAULT_DRIVE2_TAGS
+ MCFG_FD1797_ADD("z207_fdc", XTAL_1MHz)
- MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(z100_floppy_interface)
+ MCFG_FLOPPY_DRIVE_ADD("z207_fdc:0", z100_floppies, "dd", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("z207_fdc:1", z100_floppies, "dd", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("z207_fdc:2", z100_floppies, "", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("z207_fdc:3", z100_floppies, "", floppy_image_device::default_floppy_formats)
MACHINE_CONFIG_END
/* ROM definition */
diff --git a/src/mess/drivers/z80ne.c b/src/mess/drivers/z80ne.c
index c7e52a248f3..e135a03197e 100644
--- a/src/mess/drivers/z80ne.c
+++ b/src/mess/drivers/z80ne.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Roberto Lavarone
/******************************************************************************
Nuova Elettronica Z80NE system driver
@@ -377,7 +377,7 @@ INPUT_PORTS_END
/******************************************************************************
Machine Drivers
******************************************************************************/
-
+#if 0
static const UINT32 lx388palette[] =
{
rgb_t(0x00, 0xff, 0x00), /* GREEN */
@@ -399,6 +399,7 @@ static const UINT32 lx388palette[] =
rgb_t(0x40, 0x10, 0x00), /* ALPHANUMERIC DARK ORANGE */
rgb_t(0xff, 0xc4, 0x18) /* ALPHANUMERIC BRIGHT ORANGE */
};
+#endif
FLOPPY_FORMATS_MEMBER( z80ne_state::floppy_formats )
FLOPPY_DMK_FORMAT
@@ -527,7 +528,7 @@ static MACHINE_CONFIG_START( z80netf, z80ne_state )
// AG = GND, GM2 = GND, GM1 = GND, GM0 = GND, CSS = GND
// other lines not connected
- MCFG_FD1771x_ADD("wd1771", XTAL_2MHz / 2)
+ MCFG_FD1771_ADD("wd1771", XTAL_2MHz / 2)
MCFG_FLOPPY_DRIVE_ADD("wd1771:0", z80ne_floppies, "sssd", z80ne_state::floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("wd1771:1", z80ne_floppies, "sssd", z80ne_state::floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("wd1771:2", z80ne_floppies, NULL, z80ne_state::floppy_formats)
diff --git a/src/mess/drivers/zorba.c b/src/mess/drivers/zorba.c
index 149fa10004a..be61e42f06e 100644
--- a/src/mess/drivers/zorba.c
+++ b/src/mess/drivers/zorba.c
@@ -400,7 +400,7 @@ static MACHINE_CONFIG_START( zorba, zorba_state )
MCFG_I8275_DRAW_CHARACTER_CALLBACK_OWNER(zorba_state, zorba_update_chr)
MCFG_I8275_DRQ_CALLBACK(DEVWRITELINE("dma", z80dma_device, rdy_w))
MCFG_I8275_IRQ_CALLBACK(WRITELINE(zorba_state, irq0_w))
- MCFG_FD1793x_ADD("fdc", XTAL_24MHz / 24)
+ MCFG_FD1793_ADD("fdc", XTAL_24MHz / 24)
MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(zorba_state, fdc_intrq_w))
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(zorba_state, fdc_drq_w))
//MCFG_WD_FDC_FORCE_READY
diff --git a/src/mess/includes/abc80.h b/src/mess/includes/abc80.h
index 4e169b4903e..253ed7e757d 100644
--- a/src/mess/includes/abc80.h
+++ b/src/mess/includes/abc80.h
@@ -84,6 +84,7 @@ public:
m_line_prom(*this, "line"),
m_attr_prom(*this, "attr"),
m_video_ram(*this, "video_ram"),
+ m_motor(false),
m_tape_in(1),
m_tape_in_latch(1)
{ }
@@ -164,6 +165,7 @@ public:
int m_blink;
// cassette state
+ bool m_motor;
int m_tape_in;
int m_tape_in_latch;
diff --git a/src/mess/includes/amstrad.h b/src/mess/includes/amstrad.h
index 61ded7b08a5..9f60119ea16 100644
--- a/src/mess/includes/amstrad.h
+++ b/src/mess/includes/amstrad.h
@@ -17,6 +17,7 @@
#include "machine/mc146818.h"
#include "imagedev/snapquik.h"
#include "bus/cpc/cpcexp.h"
+#include "bus/cpc/ddi1.h"
#include "bus/cpc/cpc_ssa1.h"
#include "bus/cpc/cpc_rom.h"
#include "bus/cpc/mface2.h"
@@ -27,6 +28,7 @@
#include "bus/cpc/playcity.h"
#include "bus/cpc/smartwatch.h"
#include "bus/cpc/brunword4.h"
+#include "bus/cpc/hd20.h"
#include "machine/ram.h"
#include "imagedev/cassette.h"
#include "bus/centronics/ctronics.h"
diff --git a/src/mess/includes/apple2gs.h b/src/mess/includes/apple2gs.h
index dbda83919df..eddd8445cd5 100644
--- a/src/mess/includes/apple2gs.h
+++ b/src/mess/includes/apple2gs.h
@@ -167,8 +167,6 @@ public:
UINT32 m_a2_palette[16];
UINT32 m_shr_palette[256];
- DECLARE_DIRECT_UPDATE_MEMBER(apple2gs_opbase);
-
READ8_MEMBER( apple2gs_c0xx_r );
WRITE8_MEMBER( apple2gs_c0xx_w );
WRITE8_MEMBER( apple2gs_main0400_w );
diff --git a/src/mess/includes/apricotf.h b/src/mess/includes/apricotf.h
deleted file mode 100644
index a010fbd8944..00000000000
--- a/src/mess/includes/apricotf.h
+++ /dev/null
@@ -1,95 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Angelo Salese, Robbbert
-#pragma once
-
-#ifndef __APRICOTF__
-#define __APRICOTF__
-
-
-#include "emu.h"
-#include "cpu/i86/i86.h"
-#include "cpu/z80/z80daisy.h"
-#include "formats/basicdsk.h"
-#include "imagedev/flopdrv.h"
-#include "machine/apricotkb.h"
-#include "machine/buffer.h"
-#include "bus/centronics/ctronics.h"
-#include "machine/wd_fdc.h"
-#include "machine/z80ctc.h"
-#include "machine/z80dart.h"
-#include "rendlay.h"
-
-
-
-//**************************************************************************
-// MACROS / CONSTANTS
-//**************************************************************************
-
-#define SCREEN_TAG "screen"
-#define I8086_TAG "10d"
-#define Z80CTC_TAG "13d"
-#define Z80SIO2_TAG "15d"
-#define WD2797_TAG "5f"
-#define CENTRONICS_TAG "centronics"
-
-
-
-//**************************************************************************
-// TYPE DEFINITIONS
-//**************************************************************************
-
-// ======================> f1_state
-
-class f1_state : public driver_device
-{
-public:
- f1_state(const machine_config &mconfig, device_type type, const char *tag)
- : driver_device(mconfig, type, tag),
- m_maincpu(*this, I8086_TAG),
- m_ctc(*this, Z80CTC_TAG),
- m_sio(*this, Z80SIO2_TAG),
- m_fdc(*this, WD2797_TAG),
- m_floppy0(*this, WD2797_TAG ":0"),
- m_floppy1(*this, WD2797_TAG ":1"),
- m_centronics(*this, CENTRONICS_TAG),
- m_cent_data_out(*this, "cent_data_out"),
- m_ctc_int(CLEAR_LINE),
- m_sio_int(CLEAR_LINE),
- m_p_scrollram(*this, "p_scrollram"),
- m_p_paletteram(*this, "p_paletteram"),
- m_palette(*this, "palette")
- { }
-
- virtual void machine_start();
-
- required_device<cpu_device> m_maincpu;
- required_device<z80ctc_device> m_ctc;
- required_device<z80sio2_device> m_sio;
- required_device<wd2797_t> m_fdc;
- required_device<floppy_connector> m_floppy0;
- required_device<floppy_connector> m_floppy1;
- required_device<centronics_device> m_centronics;
- required_device<output_latch_device> m_cent_data_out;
- int m_ctc_int;
- int m_sio_int;
- required_shared_ptr<UINT16> m_p_scrollram;
- required_shared_ptr<UINT16> m_p_paletteram;
- required_device<palette_device> m_palette;
-
- UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
-
- DECLARE_READ16_MEMBER( palette_r );
- DECLARE_WRITE16_MEMBER( palette_w );
- DECLARE_WRITE8_MEMBER( system_w );
- DECLARE_WRITE_LINE_MEMBER( sio_int_w );
- DECLARE_WRITE_LINE_MEMBER( ctc_int_w );
- DECLARE_WRITE_LINE_MEMBER( ctc_z1_w );
- DECLARE_WRITE_LINE_MEMBER( ctc_z2_w );
-
- int m_40_80;
- int m_200_256;
-};
-
-
-
-#endif
diff --git a/src/mess/includes/apricotp.h b/src/mess/includes/apricotp.h
deleted file mode 100644
index 9014954305d..00000000000
--- a/src/mess/includes/apricotp.h
+++ /dev/null
@@ -1,129 +0,0 @@
-// license:LGPL-2.1+
-// copyright-holders:Angelo Salese, Dirk Best
-#pragma once
-
-#ifndef __APRICOTP__
-#define __APRICOTP__
-
-
-#include "emu.h"
-#include "cpu/i86/i86.h"
-#include "cpu/m6800/m6800.h"
-#include "machine/am9517a.h"
-#include "machine/apricotkb.h"
-#include "bus/centronics/ctronics.h"
-#include "machine/pic8259.h"
-#include "machine/pit8253.h"
-#include "machine/ram.h"
-#include "machine/wd_fdc.h"
-#include "machine/z80dart.h"
-#include "sound/sn76496.h"
-#include "video/mc6845.h"
-#include "rendlay.h"
-
-
-
-//**************************************************************************
-// MACROS / CONSTANTS
-//**************************************************************************
-
-#define I8086_TAG "ic7"
-#define I8284_TAG "ic30"
-#define I8237_TAG "ic17"
-#define I8259A_TAG "ic51"
-#define I8253A5_TAG "ic20"
-#define TMS4500_TAG "ic42"
-#define MC6845_TAG "ic69"
-#define HD63B01V1_TAG "ic29"
-#define AD7574_TAG "ic34"
-#define AD1408_TAG "ic37"
-#define Z80SIO0_TAG "ic6"
-#define WD2797_TAG "ic5"
-#define SN76489AN_TAG "ic13"
-#define CENTRONICS_TAG "centronics"
-#define SCREEN_LCD_TAG "screen0"
-#define SCREEN_CRT_TAG "screen1"
-
-
-
-//**************************************************************************
-// TYPE DEFINITIONS
-//**************************************************************************
-
-// ======================> fp_state
-
-class fp_state : public driver_device
-{
-public:
- fp_state(const machine_config &mconfig, device_type type, const char *tag)
- : driver_device(mconfig, type, tag),
- m_maincpu(*this, I8086_TAG),
- m_soundcpu(*this, HD63B01V1_TAG),
- m_dmac(*this, I8237_TAG),
- m_pic(*this, I8259A_TAG),
- m_pit(*this, I8253A5_TAG),
- m_sio(*this, Z80SIO0_TAG),
- m_fdc(*this, WD2797_TAG),
- m_crtc(*this, MC6845_TAG),
- m_ram(*this, RAM_TAG),
- m_floppy0(*this, WD2797_TAG":0"),
- m_floppy1(*this, WD2797_TAG":1"),
- m_floppy(NULL),
- m_centronics(*this, CENTRONICS_TAG),
- m_work_ram(*this, "work_ram"),
- m_video_ram(*this, "video_ram")
- { }
-
- required_device<cpu_device> m_maincpu;
- required_device<cpu_device> m_soundcpu;
- required_device<am9517a_device> m_dmac;
- required_device<pic8259_device> m_pic;
- required_device<pit8253_device> m_pit;
- required_device<z80dart_device> m_sio;
- required_device<wd2797_t> m_fdc;
- required_device<mc6845_device> m_crtc;
- required_device<ram_device> m_ram;
- required_device<floppy_connector> m_floppy0;
- required_device<floppy_connector> m_floppy1;
- floppy_image_device *m_floppy;
- required_device<centronics_device> m_centronics;
-
- virtual void machine_start();
- virtual void machine_reset();
-
- virtual void video_start();
- UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
-
- MC6845_UPDATE_ROW(update_row);
- DECLARE_READ16_MEMBER( mem_r );
- DECLARE_WRITE16_MEMBER( mem_w );
- DECLARE_READ8_MEMBER( prtr_snd_r );
- DECLARE_WRITE8_MEMBER( pint_clr_w );
- DECLARE_WRITE8_MEMBER( ls_w );
- DECLARE_WRITE8_MEMBER( contrast_w );
- DECLARE_WRITE8_MEMBER( palette_w );
- DECLARE_WRITE16_MEMBER( video_w );
- DECLARE_WRITE8_MEMBER( lat_w );
-
- void lat_ls259_w(offs_t offset, int state);
-
- optional_shared_ptr<UINT16> m_work_ram;
-
- // video state
- optional_shared_ptr<UINT16> m_video_ram;
- UINT8 m_video;
-
- int m_centronics_busy;
- int m_centronics_select;
- int m_centronics_fault;
- int m_centronics_perror;
-
- DECLARE_WRITE_LINE_MEMBER( write_centronics_busy );
- DECLARE_WRITE_LINE_MEMBER( write_centronics_select );
- DECLARE_WRITE_LINE_MEMBER( write_centronics_fault );
- DECLARE_WRITE_LINE_MEMBER( write_centronics_perror );
-};
-
-
-
-#endif
diff --git a/src/mess/includes/bbc.h b/src/mess/includes/bbc.h
index 499283e8ec3..11bd1c13eb1 100644
--- a/src/mess/includes/bbc.h
+++ b/src/mess/includes/bbc.h
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Gordon Jefferyes, Nigel Barnes
/*****************************************************************************
*
diff --git a/src/mess/includes/cgc7900.h b/src/mess/includes/cgc7900.h
index c55566b735e..d5b6dc86548 100644
--- a/src/mess/includes/cgc7900.h
+++ b/src/mess/includes/cgc7900.h
@@ -9,7 +9,6 @@
#include "emu.h"
#include "cpu/m68000/m68000.h"
#include "cpu/mcs48/mcs48.h"
-#include "formats/basicdsk.h"
#include "machine/ram.h"
#include "machine/i8251.h"
#include "sound/ay8910.h"
diff --git a/src/mess/includes/coco.h b/src/mess/includes/coco.h
index b9d90b3dad5..a43af0d40f0 100644
--- a/src/mess/includes/coco.h
+++ b/src/mess/includes/coco.h
@@ -188,7 +188,7 @@ private:
HIRES_RIGHT = 0x01,
HIRES_RIGHT_COCOMAX3 = 0x02,
HIRES_LEFT = 0x03,
- HIRES_LEFT_COCOMAX3 = 0x04,
+ HIRES_LEFT_COCOMAX3 = 0x04
};
struct analog_input_t
diff --git a/src/mess/includes/concept.h b/src/mess/includes/concept.h
index 73dcb5f7e4e..c9759c893a8 100644
--- a/src/mess/includes/concept.h
+++ b/src/mess/includes/concept.h
@@ -1,4 +1,4 @@
-// license:???
+// license:GPL-2.0+
// copyright-holders:Raphael Nabet, Brett Wyer
/*****************************************************************************
*
diff --git a/src/mess/includes/crvision.h b/src/mess/includes/crvision.h
index 05a042562dc..0956119c4c7 100644
--- a/src/mess/includes/crvision.h
+++ b/src/mess/includes/crvision.h
@@ -1,6 +1,5 @@
// license:BSD-3-Clause
// copyright-holders:Wilbert Pol, Curt Coder
-#pragma once
#ifndef __CRVISION__
#define __CRVISION__
@@ -40,9 +39,12 @@ public:
m_cassette(*this, "cassette"),
m_cart(*this, "cartslot"),
m_cent_data_out(*this, "cent_data_out"),
- m_ram(*this, RAM_TAG)
- {
- }
+ m_ram(*this, RAM_TAG),
+ m_inp_pa0(*this, "PA0"),
+ m_inp_pa1(*this, "PA1"),
+ m_inp_pa2(*this, "PA2"),
+ m_inp_pa3(*this, "PA3")
+ { }
required_device<cpu_device> m_maincpu;
required_device<pia6821_device> m_pia;
@@ -51,21 +53,21 @@ public:
required_device<crvision_cart_slot_device> m_cart;
required_device<output_latch_device> m_cent_data_out;
required_device<ram_device> m_ram;
+ optional_ioport_array<8> m_inp_pa0;
+ optional_ioport_array<8> m_inp_pa1;
+ optional_ioport_array<8> m_inp_pa2;
+ optional_ioport_array<8> m_inp_pa3;
- virtual void machine_start();
+ UINT8 m_keylatch;
+ UINT8 read_keyboard(int pa);
DECLARE_WRITE8_MEMBER( pia_pa_w );
DECLARE_READ8_MEMBER( pia_pa_r );
DECLARE_READ8_MEMBER( pia_pb_r );
DECLARE_INPUT_CHANGED_MEMBER( trigger_nmi );
- UINT8 read_keyboard(int pa);
-
- /* keyboard state */
- UINT8 m_keylatch;
-
- /* joystick state */
- UINT8 m_joylatch;
+protected:
+ virtual void machine_start();
};
class crvision_pal_state : public crvision_state
@@ -74,8 +76,6 @@ public:
crvision_pal_state(const machine_config &mconfig, device_type type, const char *tag)
: crvision_state(mconfig, type, tag)
{ }
-
- virtual void machine_start();
};
class laser2001_state : public crvision_state
@@ -83,22 +83,18 @@ class laser2001_state : public crvision_state
public:
laser2001_state(const machine_config &mconfig, device_type type, const char *tag)
: crvision_state(mconfig, type, tag),
- m_centronics(*this, CENTRONICS_TAG),
- m_y0(*this, "Y0"),
- m_y1(*this, "Y1"),
- m_y2(*this, "Y2"),
- m_y3(*this, "Y3"),
- m_y4(*this, "Y4"),
- m_y5(*this, "Y5"),
- m_y6(*this, "Y6"),
- m_y7(*this, "Y7"),
- m_joy0(*this, "JOY0"),
- m_joy1(*this, "JOY1"),
- m_joy2(*this, "JOY2"),
- m_joy3(*this, "JOY3")
+ m_centronics(*this, CENTRONICS_TAG),
+ m_inp_y(*this, "Y"),
+ m_inp_joy(*this, "JOY")
{ }
- virtual void machine_start();
+ required_device<centronics_device> m_centronics;
+ required_ioport_array<8> m_inp_y;
+ required_ioport_array<4> m_inp_joy;
+
+ UINT8 m_joylatch;
+ int m_centronics_busy;
+ int m_psg_ready;
DECLARE_WRITE_LINE_MEMBER( write_centronics_busy );
DECLARE_WRITE_LINE_MEMBER( write_psg_ready );
@@ -111,21 +107,8 @@ public:
DECLARE_READ_LINE_MEMBER( pia_cb1_r );
DECLARE_WRITE_LINE_MEMBER( pia_cb2_w );
- required_device<centronics_device> m_centronics;
- required_ioport m_y0;
- required_ioport m_y1;
- required_ioport m_y2;
- required_ioport m_y3;
- required_ioport m_y4;
- required_ioport m_y5;
- required_ioport m_y6;
- required_ioport m_y7;
- required_ioport m_joy0;
- required_ioport m_joy1;
- required_ioport m_joy2;
- required_ioport m_joy3;
- int m_centronics_busy;
- int m_psg_ready;
+protected:
+ virtual void machine_start();
};
-#endif
+#endif // __CRVISION__
diff --git a/src/mess/includes/dgn_beta.h b/src/mess/includes/dgn_beta.h
index e19ca60d71b..3869f71fffc 100644
--- a/src/mess/includes/dgn_beta.h
+++ b/src/mess/includes/dgn_beta.h
@@ -10,7 +10,7 @@
#define DGN_BETA_H_
#include "video/mc6845.h"
-#include "machine/wd17xx.h"
+#include "machine/wd_fdc.h"
#include "machine/6821pia.h"
#include "machine/ram.h"
@@ -58,12 +58,6 @@
#define KOutDat KInClk /* Also used for data into output shifter */
#define KInDat 0x20 /* Keyboard data in from keyboard (serial stream) */
-/***** WD2797 pins *****/
-
-#define DSMask 0x03 /* PA0 & PA1 are binary encoded drive */
-#define ENPCtrl 0x20 /* PA5 on PIA */
-#define DDenCtrl 0x40 /* PA6 on PIA */
-
/***** Video Modes *****/
enum BETA_VID_MODES
@@ -93,8 +87,15 @@ public:
m_videoram(*this, "videoram"),
m_maincpu(*this, "maincpu"),
m_ram(*this, RAM_TAG),
+ m_fdc(*this, FDC_TAG),
+ m_floppy0(*this, FDC_TAG ":0"),
+ m_floppy1(*this, FDC_TAG ":1"),
+ m_floppy2(*this, FDC_TAG ":2"),
+ m_floppy3(*this, FDC_TAG ":3"),
m_palette(*this, "palette") { }
+ DECLARE_FLOPPY_FORMATS(floppy_formats);
+
required_device<mc6845_device> m_mc6845;
required_shared_ptr<UINT8> m_videoram;
@@ -214,6 +215,11 @@ public:
void dgn_beta_frame_interrupt (int data);
void dgn_beta_line_interrupt (int data);
required_device<ram_device> m_ram;
+ required_device<wd2797_t> m_fdc;
+ required_device<floppy_connector> m_floppy0;
+ required_device<floppy_connector> m_floppy1;
+ required_device<floppy_connector> m_floppy2;
+ required_device<floppy_connector> m_floppy3;
required_device<palette_device> m_palette;
};
diff --git a/src/mess/includes/dgnalpha.h b/src/mess/includes/dgnalpha.h
index 50ed8a19885..402de4f846f 100644
--- a/src/mess/includes/dgnalpha.h
+++ b/src/mess/includes/dgnalpha.h
@@ -16,7 +16,7 @@
#include "includes/dragon.h"
#include "sound/ay8910.h"
-#include "machine/wd17xx.h"
+#include "machine/wd_fdc.h"
@@ -42,13 +42,24 @@ public:
: dragon64_state(mconfig, type, tag),
m_pia_2(*this, PIA2_TAG),
m_ay8912(*this, AY8912_TAG),
- m_fdc(*this, WD2797_TAG)
+ m_fdc(*this, WD2797_TAG),
+ m_floppy0(*this, WD2797_TAG ":0"),
+ m_floppy1(*this, WD2797_TAG ":1"),
+ m_floppy2(*this, WD2797_TAG ":2"),
+ m_floppy3(*this, WD2797_TAG ":3")
{
}
+ DECLARE_FLOPPY_FORMATS(dragon_formats);
+
required_device<pia6821_device> m_pia_2;
required_device<ay8912_device> m_ay8912;
- required_device<wd2797_device> m_fdc;
+ required_device<wd2797_t> m_fdc;
+ required_device<floppy_connector> m_floppy0;
+ required_device<floppy_connector> m_floppy1;
+ required_device<floppy_connector> m_floppy2;
+ required_device<floppy_connector> m_floppy3;
+
/* pia2 */
DECLARE_WRITE8_MEMBER( pia2_pa_w );
diff --git a/src/mess/includes/fm7.h b/src/mess/includes/fm7.h
index 9e789c5fff8..6c24829cba5 100644
--- a/src/mess/includes/fm7.h
+++ b/src/mess/includes/fm7.h
@@ -5,7 +5,7 @@
#include "imagedev/cassette.h"
#include "sound/beep.h"
#include "sound/2203intf.h"
-#include "machine/wd17xx.h"
+#include "machine/wd_fdc.h"
#include "machine/bankdev.h"
/*
@@ -136,6 +136,9 @@ public:
m_centronics(*this, "centronics"),
m_cent_data_out(*this, "cent_data_out"),
m_fdc(*this, "fdc"),
+ m_floppy0(*this, "fdc:0"),
+ m_floppy1(*this, "fdc:1"),
+ m_floppy(NULL),
m_kanji(*this, "kanji1"),
m_key1(*this, "key1"),
m_key2(*this, "key2"),
@@ -319,7 +322,11 @@ public:
optional_device<ay8910_device> m_psg;
required_device<centronics_device> m_centronics;
required_device<output_latch_device> m_cent_data_out;
- required_device<mb8877_device> m_fdc;
+ required_device<mb8877_t> m_fdc;
+ required_device<floppy_connector> m_floppy0;
+ required_device<floppy_connector> m_floppy1;
+
+ floppy_image_device *m_floppy;
void fm7_alu_mask_write(UINT32 offset, int bank, UINT8 dat);
void fm7_alu_function_compare(UINT32 offset);
diff --git a/src/mess/includes/hec2hrp.h b/src/mess/includes/hec2hrp.h
index 36b3d93530e..c30b7bfccd3 100644
--- a/src/mess/includes/hec2hrp.h
+++ b/src/mess/includes/hec2hrp.h
@@ -40,7 +40,7 @@
*/
#include "machine/upd765.h"
-#include "machine/wd17xx.h"
+#include "machine/wd_fdc.h"
#include "imagedev/flopdrv.h"
#include "imagedev/cassette.h"
#include "sound/sn76477.h" /* for sn sound*/
@@ -83,7 +83,12 @@ public:
m_palette(*this, "palette"),
m_videoram(*this,"videoram"),
m_hector_videoram(*this,"hector_videoram") ,
- m_keyboard(*this, "KEY") { }
+ m_keyboard(*this, "KEY"),
+ m_minidisc_fdc(*this, "wd179x"),
+ m_floppy0(*this, "wd179x:0")
+ {}
+
+ DECLARE_FLOPPY_FORMATS(minidisc_formats);
required_device<cpu_device> m_maincpu;
optional_device<cpu_device> m_disc2cpu;
@@ -94,6 +99,9 @@ public:
optional_shared_ptr<UINT8> m_hector_videoram;
required_ioport_array<9> m_keyboard;
+ optional_device<fd1793_t> m_minidisc_fdc;
+ optional_device<floppy_connector> m_floppy0;
+
UINT8 m_hector_flag_hr;
UINT8 m_hector_flag_80c;
UINT8 m_hector_color[4];
@@ -131,8 +139,9 @@ public:
int m_hector_flag_result;
int m_print;
UINT8 m_hector_videoram_hrx[0x04000];
- DECLARE_READ8_MEMBER(hector_179x_register_r);
- DECLARE_WRITE8_MEMBER(hector_179x_register_w);
+
+ DECLARE_WRITE8_MEMBER(minidisc_control_w);
+
DECLARE_WRITE8_MEMBER(hector_switch_bank_w);
DECLARE_WRITE8_MEMBER(hector_keyboard_w);
DECLARE_READ8_MEMBER(hector_keyboard_r);
@@ -162,7 +171,6 @@ public:
int isHectorWithMiniDisc();
int isHectorHR();
int isHectoreXtend();
- void hector_minidisc_init();
void Mise_A_Jour_Etat(int Adresse, int Value );
void Init_Value_SN76477_Hector();
void Update_Sound(address_space &space, UINT8 data);
@@ -188,6 +196,4 @@ public:
void hector_disc2_reset();
};
-extern const floppy_interface minidisc_floppy_interface;
-
MACHINE_CONFIG_EXTERN( hector_audio );
diff --git a/src/mess/includes/hh_ucom4.h b/src/mess/includes/hh_ucom4.h
new file mode 100644
index 00000000000..79d51afccb9
--- /dev/null
+++ b/src/mess/includes/hh_ucom4.h
@@ -0,0 +1,66 @@
+// license:BSD-3-Clause
+// copyright-holders:hap, Kevin Horton
+/*
+
+ NEC uCOM4 MCU tabletops/handhelds or other simple devices,
+
+*/
+
+#ifndef _HH_UCOM4_H_
+#define _HH_UCOM4_H_
+
+
+#include "emu.h"
+#include "cpu/ucom4/ucom4.h"
+#include "sound/speaker.h"
+
+
+class hh_ucom4_state : public driver_device
+{
+public:
+ hh_ucom4_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_inp_matrix(*this, "IN"),
+ m_speaker(*this, "speaker"),
+ m_display_wait(33),
+ m_display_maxy(1),
+ m_display_maxx(0)
+ { }
+
+ // devices
+ required_device<cpu_device> m_maincpu;
+ optional_ioport_array<5> m_inp_matrix; // max 5
+ optional_device<speaker_sound_device> m_speaker;
+
+ // misc common
+ UINT8 m_port[9]; // MCU port A-I write data (optional)
+ UINT16 m_inp_mux; // multiplexed inputs mask
+
+ UINT8 read_inputs(int columns);
+
+ // display common
+ int m_display_wait; // led/lamp off-delay in microseconds (default 33ms)
+ int m_display_maxy; // display matrix number of rows
+ int m_display_maxx; // display matrix number of columns (max 31 for now)
+
+ UINT32 m_grid; // VFD current row data
+ UINT32 m_plate; // VFD current column data
+
+ UINT32 m_display_state[0x20]; // display matrix rows data (last bit is used for always-on)
+ UINT16 m_display_segmask[0x20]; // if not 0, display matrix row is a digit, mask indicates connected segments
+ UINT32 m_display_cache[0x20]; // (internal use)
+ UINT8 m_display_decay[0x20][0x20]; // (internal use)
+
+ TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick);
+ void display_update();
+ void set_display_size(int maxx, int maxy);
+ void display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety);
+
+protected:
+ virtual void machine_start();
+ virtual void machine_reset();
+};
+
+
+#endif /* _HH_UCOM4_H_ */
diff --git a/src/mess/includes/hp48.h b/src/mess/includes/hp48.h
index 3577d404d26..70780f2817d 100644
--- a/src/mess/includes/hp48.h
+++ b/src/mess/includes/hp48.h
@@ -16,7 +16,7 @@ typedef enum {
HP48_G,
HP48_GX,
HP48_GP,
- HP49_G,
+ HP49_G
} hp48_models;
/* memory module configuration */
diff --git a/src/mess/includes/lisa.h b/src/mess/includes/lisa.h
index fc034a1059f..c52c53fb833 100644
--- a/src/mess/includes/lisa.h
+++ b/src/mess/includes/lisa.h
@@ -1,4 +1,4 @@
-// license:???
+// license:GPL-2.0+
// copyright-holders:Raphael Nabet
/*****************************************************************************
*
diff --git a/src/mess/includes/mac.h b/src/mess/includes/mac.h
index 36b9bf6e5f9..6b0092501fd 100644
--- a/src/mess/includes/mac.h
+++ b/src/mess/includes/mac.h
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Nathan Woods, Raphael Nabet, R. Belmont
/*****************************************************************************
*
diff --git a/src/mess/includes/macpci.h b/src/mess/includes/macpci.h
index 5468b2ad428..56f7d066431 100644
--- a/src/mess/includes/macpci.h
+++ b/src/mess/includes/macpci.h
@@ -66,7 +66,7 @@ enum model_t
PCIMODEL_MAC_PBG3WALLST1,
PCIMODEL_MAC_PBG3WALLST2,
- PCIMODEL_MAC_PIPPIN, // Apple/Bandai Pippin
+ PCIMODEL_MAC_PIPPIN // Apple/Bandai Pippin
};
diff --git a/src/mess/includes/mbc55x.h b/src/mess/includes/mbc55x.h
index fc308aeaf3e..d0578708939 100644
--- a/src/mess/includes/mbc55x.h
+++ b/src/mess/includes/mbc55x.h
@@ -15,7 +15,7 @@
#include "machine/i8255.h"
#include "machine/pit8253.h"
#include "machine/pic8259.h"
-#include "machine/wd17xx.h"
+#include "machine/wd_fdc.h"
#include "machine/i8251.h"
#include "sound/speaker.h"
#include "video/mc6845.h"
@@ -98,19 +98,29 @@ public:
m_ppi(*this, PPI8255_TAG),
m_pic(*this, PIC8259_TAG),
m_fdc(*this, FDC_TAG),
+ m_floppy0(*this, FDC_TAG ":0"),
+ m_floppy1(*this, FDC_TAG ":1"),
+ m_floppy2(*this, FDC_TAG ":2"),
+ m_floppy3(*this, FDC_TAG ":3"),
m_speaker(*this, "speaker"),
m_ram(*this, RAM_TAG),
m_palette(*this, "palette")
{
}
+ DECLARE_FLOPPY_FORMATS(floppy_formats);
+
required_device<cpu_device> m_maincpu;
required_device<mc6845_device> m_crtc;
required_device<i8251_device> m_kb_uart;
required_device<pit8253_device> m_pit;
required_device<i8255_device> m_ppi;
required_device<pic8259_device> m_pic;
- required_device<fd1793_device> m_fdc;
+ required_device<fd1793_t> m_fdc;
+ required_device<floppy_connector> m_floppy0;
+ required_device<floppy_connector> m_floppy1;
+ required_device<floppy_connector> m_floppy2;
+ required_device<floppy_connector> m_floppy3;
required_device<speaker_sound_device> m_speaker;
required_device<ram_device> m_ram;
required_device<palette_device> m_palette;
@@ -139,8 +149,7 @@ public:
DECLARE_WRITE_LINE_MEMBER(vid_hsync_changed);
DECLARE_WRITE_LINE_MEMBER(vid_vsync_changed);
DECLARE_WRITE_LINE_MEMBER(pit8253_t2);
- DECLARE_WRITE_LINE_MEMBER(mbc55x_fdc_intrq_w);
- DECLARE_WRITE_LINE_MEMBER(mbc55x_fdc_drq_w);
+
UINT32 m_debug_machine;
UINT32 m_debug_video;
UINT8 m_video_mem[VIDEO_MEM_SIZE];
diff --git a/src/mess/includes/mbee.h b/src/mess/includes/mbee.h
index 1aace11cffb..53ea3282d37 100644
--- a/src/mess/includes/mbee.h
+++ b/src/mess/includes/mbee.h
@@ -1,5 +1,5 @@
-// license:GPL-2.0+
-// copyright-holders:Juergen Buchmueller, Robbbert
+// license:BSD-3-Clause
+// copyright-holders:Robbbert
/*****************************************************************************
*
* includes/mbee.h
diff --git a/src/mess/includes/msx.h b/src/mess/includes/msx.h
index 866503cb164..0d7b3930508 100644
--- a/src/mess/includes/msx.h
+++ b/src/mess/includes/msx.h
@@ -23,7 +23,6 @@
#include "video/tms9928a.h"
#include "imagedev/flopdrv.h"
#include "imagedev/cassette.h"
-#include "formats/basicdsk.h"
#include "formats/fmsx_cas.h"
#include "formats/msx_dsk.h"
#include "hashfile.h"
diff --git a/src/mess/includes/mtx.h b/src/mess/includes/mtx.h
index 9e852ed6e2d..5558e1fcd15 100644
--- a/src/mess/includes/mtx.h
+++ b/src/mess/includes/mtx.h
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Lee Ward, Dirk Best, Curt Coder
/*************************************************************************
diff --git a/src/mess/includes/next.h b/src/mess/includes/next.h
index 44b2f2e1de0..25bc09cdaa5 100644
--- a/src/mess/includes/next.h
+++ b/src/mess/includes/next.h
@@ -141,7 +141,7 @@ protected:
DMA_SUPDATE = 0x02,
DMA_READ = 0x04,
DMA_COMPLETE = 0x08,
- DMA_BUSEXC = 0x10,
+ DMA_BUSEXC = 0x10
};
static const char *dma_targets[0x20];
diff --git a/src/mess/includes/osborne1.h b/src/mess/includes/osborne1.h
index 130f80006e1..52d39a09461 100644
--- a/src/mess/includes/osborne1.h
+++ b/src/mess/includes/osborne1.h
@@ -103,7 +103,6 @@ public:
bool m_beep_state;
DECLARE_DRIVER_INIT(osborne1);
virtual void machine_reset();
- DECLARE_PALETTE_INIT(osborne1);
TIMER_CALLBACK_MEMBER(osborne1_video_callback);
TIMER_CALLBACK_MEMBER(setup_osborne1);
diff --git a/src/mess/includes/osi.h b/src/mess/includes/osi.h
index 1285d0d8516..735b511fc37 100644
--- a/src/mess/includes/osi.h
+++ b/src/mess/includes/osi.h
@@ -10,7 +10,7 @@
#include "cpu/m6502/m6502.h"
#include "formats/basicdsk.h"
#include "imagedev/cassette.h"
-#include "imagedev/flopdrv.h"
+#include "imagedev/floppy.h"
#include "machine/6850acia.h"
#include "machine/6821pia.h"
#include "machine/ram.h"
@@ -60,7 +60,7 @@ public:
DECLARE_WRITE_LINE_MEMBER( cassette_tx );
DECLARE_WRITE_LINE_MEMBER( write_cassette_clock );
- DECLARE_WRITE_LINE_MEMBER(osi470_index_callback);
+ void floppy_index_callback(floppy_image_device *floppy, int state);
DECLARE_PALETTE_INIT(osi630);
@@ -126,19 +126,23 @@ public:
class c1pmf_state : public c1p_state
{
public:
- c1pmf_state(const machine_config &mconfig, device_type type, const char *tag)
- : c1p_state(mconfig, type, tag),
- m_floppy(*this, FLOPPY_0)
+ c1pmf_state(const machine_config &mconfig, device_type type, const char *tag) :
+ c1p_state(mconfig, type, tag),
+ m_floppy0(*this, "floppy0"),
+ m_floppy1(*this, "floppy1")
{ }
- required_device<legacy_floppy_image_device> m_floppy;
-
- virtual void machine_start();
-
DECLARE_READ8_MEMBER( osi470_pia_pa_r );
DECLARE_WRITE8_MEMBER( osi470_pia_pa_w );
DECLARE_WRITE8_MEMBER( osi470_pia_pb_w );
DECLARE_WRITE_LINE_MEMBER( osi470_pia_cb2_w );
+
+protected:
+ virtual void machine_start();
+
+private:
+ required_device<floppy_connector> m_floppy0;
+ required_device<floppy_connector> m_floppy1;
};
class uk101_state : public sb2m600_state
diff --git a/src/mess/includes/pdp1.h b/src/mess/includes/pdp1.h
index 80a7d297beb..ee2c5f7f703 100644
--- a/src/mess/includes/pdp1.h
+++ b/src/mess/includes/pdp1.h
@@ -1,4 +1,4 @@
-// license:???
+// license:GPL-2.0+
// copyright-holders:Raphael Nabet
/*****************************************************************************
*
diff --git a/src/mess/includes/pk8020.h b/src/mess/includes/pk8020.h
index 63994d4a536..e73fa870187 100644
--- a/src/mess/includes/pk8020.h
+++ b/src/mess/includes/pk8020.h
@@ -13,7 +13,7 @@
#include "machine/pit8253.h"
#include "machine/pic8259.h"
#include "machine/i8251.h"
-#include "machine/wd17xx.h"
+#include "machine/wd_fdc.h"
#include "imagedev/cassette.h"
#include "sound/speaker.h"
#include "sound/wave.h"
@@ -33,6 +33,10 @@ public:
m_lan(*this, "lan"),
m_ram(*this, RAM_TAG),
m_wd1793(*this, "wd1793"),
+ m_floppy0(*this, "wd1793:0"),
+ m_floppy1(*this, "wd1793:1"),
+ m_floppy2(*this, "wd1793:2"),
+ m_floppy3(*this, "wd1793:3"),
m_pit8253(*this, "pit8253"),
m_pic8259(*this, "pic8259"),
m_speaker(*this, "speaker"),
@@ -40,6 +44,8 @@ public:
m_region_gfx1(*this, "gfx1"),
m_palette(*this, "palette") { }
+ DECLARE_FLOPPY_FORMATS(floppy_formats);
+
UINT8 m_color;
UINT8 m_video_page;
UINT8 m_wide;
@@ -84,7 +90,11 @@ protected:
required_device<i8251_device> m_rs232;
required_device<i8251_device> m_lan;
required_device<ram_device> m_ram;
- required_device<fd1793_device> m_wd1793;
+ required_device<fd1793_t> m_wd1793;
+ required_device<floppy_connector> m_floppy0;
+ required_device<floppy_connector> m_floppy1;
+ required_device<floppy_connector> m_floppy2;
+ required_device<floppy_connector> m_floppy3;
required_device<pit8253_device> m_pit8253;
required_device<pic8259_device> m_pic8259;
required_device<speaker_sound_device> m_speaker;
diff --git a/src/mess/includes/rm380z.h b/src/mess/includes/rm380z.h
index 394446daeca..b3b47a23bfd 100644
--- a/src/mess/includes/rm380z.h
+++ b/src/mess/includes/rm380z.h
@@ -14,7 +14,7 @@ Research Machines RM 380Z
#include "cpu/z80/z80.h"
#include "machine/ram.h"
#include "imagedev/flopdrv.h"
-#include "machine/wd17xx.h"
+#include "machine/wd_fdc.h"
#include "machine/keyboard.h"
//
@@ -89,13 +89,17 @@ public:
required_device<cpu_device> m_maincpu;
required_device<ram_device> m_messram;
- optional_device<fd1771_device> m_fdc;
+ required_device<fd1771_t> m_fdc;
+ required_device<floppy_connector> m_floppy0;
+ required_device<floppy_connector> m_floppy1;
rm380z_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this, RM380Z_MAINCPU_TAG),
m_messram(*this, RAM_TAG),
- m_fdc(*this, "wd1771")
+ m_fdc(*this, "wd1771"),
+ m_floppy0(*this, "wd1771:0"),
+ m_floppy1(*this, "wd1771:1")
{
}
diff --git a/src/mess/includes/sms.h b/src/mess/includes/sms.h
index 556b663d41a..4f2efcdbbd3 100644
--- a/src/mess/includes/sms.h
+++ b/src/mess/includes/sms.h
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Wilbert Pol, Charles MacDonald,Mathis Rosenhauer,Brad Oliver,Michael Luong,Fabio Priuli,Enik Land
/*****************************************************************************
*
diff --git a/src/mess/includes/spectrum.h b/src/mess/includes/spectrum.h
index d5dbae057b8..5795c1e3cc0 100644
--- a/src/mess/includes/spectrum.h
+++ b/src/mess/includes/spectrum.h
@@ -238,7 +238,7 @@ protected:
optional_ioport m_io_plus4;
void spectrum_UpdateBorderBitmap();
- void spectrum_UpdateScreenBitmap();
+ void spectrum_UpdateScreenBitmap(bool eof = false);
inline unsigned char get_display_color(unsigned char color, int invert);
inline void spectrum_plot_pixel(bitmap_ind16 &bitmap, int x, int y, UINT32 color);
void ts2068_hires_scanline(bitmap_ind16 &bitmap, int y, int borderlines);
diff --git a/src/mess/includes/svi318.h b/src/mess/includes/svi318.h
index 411f2f3a8a4..a699f6e9bfb 100644
--- a/src/mess/includes/svi318.h
+++ b/src/mess/includes/svi318.h
@@ -14,7 +14,7 @@
#include "cpu/z80/z80.h"
#include "machine/i8255.h"
#include "machine/ins8250.h"
-#include "machine/wd17xx.h"
+#include "machine/wd_fdc.h"
#include "machine/ram.h"
#include "machine/buffer.h"
#include "imagedev/cassette.h"
@@ -44,22 +44,25 @@ public:
m_ins8250_1(*this, "ins8250_1"),
m_cart(*this, "cartslot"),
m_fd1793(*this, "wd179x"),
+ m_floppy0(*this, "wd179x:0"),
+ m_floppy1(*this, "wd179x:1"),
m_crtc(*this, "crtc"),
m_line(*this, "LINE"),
m_joysticks(*this, "JOYSTICKS"),
m_buttons(*this, "BUTTONS"),
m_palette(*this, "palette"),
+ m_floppy(NULL),
m_bank1(*this, "bank1"),
m_bank2(*this, "bank2"),
m_bank3(*this, "bank3"),
m_bank4(*this, "bank4")
{ }
+ DECLARE_FLOPPY_FORMATS(floppy_formats);
+
// FDC
- UINT8 m_driveselect;
int m_drq;
int m_irq;
- UINT8 m_heads[2];
DECLARE_WRITE8_MEMBER(ppi_w);
DECLARE_READ8_MEMBER(psg_port_a_r);
@@ -105,7 +108,9 @@ protected:
required_device<ins8250_device> m_ins8250_0;
required_device<ins8250_device> m_ins8250_1;
required_device<generic_slot_device> m_cart;
- required_device<fd1793_device> m_fd1793;
+ required_device<fd1793_t> m_fd1793;
+ required_device<floppy_connector> m_floppy0;
+ required_device<floppy_connector> m_floppy1;
optional_device<mc6845_device> m_crtc;
required_ioport_array<11> m_line;
required_ioport m_joysticks;
@@ -134,6 +139,8 @@ private:
// keyboard
UINT8 m_keyboard_row;
+ floppy_image_device *m_floppy;
+
// centronics
int m_centronics_busy;
diff --git a/src/mess/includes/swtpc09.h b/src/mess/includes/swtpc09.h
index f1c8a0895d4..222ffe5c11a 100644
--- a/src/mess/includes/swtpc09.h
+++ b/src/mess/includes/swtpc09.h
@@ -12,10 +12,8 @@
#include "emu.h"
#include "cpu/m6809/m6809.h"
#include "video/generic.h"
-#include "machine/wd17xx.h"
-#include "formats/basicdsk.h"
+#include "machine/wd_fdc.h"
#include "imagedev/flopdrv.h"
-#include "machine/wd17xx.h"
#include "machine/6840ptm.h"
#include "machine/6821pia.h"
#include "machine/6850acia.h"
@@ -38,17 +36,27 @@ public:
m_ptm(*this, "ptm"),
m_acia(*this, "acia"),
m_fdc(*this, "fdc"),
+ m_floppy0(*this, "fdc:0"),
+ m_floppy1(*this, "fdc:1"),
+ m_floppy2(*this, "fdc:2"),
+ m_floppy3(*this, "fdc:3"),
m_via(*this, "via"),
m_piaide(*this, "piaide"),
m_harddisk(*this, "harddisk"),
m_ide(*this, "ide")
{ }
+ DECLARE_FLOPPY_FORMATS(floppy_formats);
+
required_device<cpu_device> m_maincpu;
required_device<pia6821_device> m_pia;
required_device<ptm6840_device> m_ptm;
required_device<acia6850_device> m_acia;
- required_device<fd1793_device> m_fdc;
+ required_device<fd1793_t> m_fdc;
+ required_device<floppy_connector> m_floppy0;
+ required_device<floppy_connector> m_floppy1;
+ required_device<floppy_connector> m_floppy2;
+ required_device<floppy_connector> m_floppy3;
optional_device<via6522_device> m_via;
optional_device<pia6821_device> m_piaide;
optional_device<device_t> m_harddisk;
diff --git a/src/mess/includes/thomson.h b/src/mess/includes/thomson.h
index ec24c79ea22..7aac073fa2a 100644
--- a/src/mess/includes/thomson.h
+++ b/src/mess/includes/thomson.h
@@ -28,6 +28,7 @@
#include "formats/thom_cas.h"
#include "formats/thom_dsk.h"
#include "machine/thomflop.h"
+#include "imagedev/floppy.h"
#include "machine/ram.h"
#include "bus/generic/slot.h"
@@ -116,6 +117,8 @@ public:
{
}
+ DECLARE_FLOPPY_FORMATS(cd90_640_formats);
+
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( to7_cartridge );
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( mo5_cartridge );
diff --git a/src/mess/includes/trs80.h b/src/mess/includes/trs80.h
index 62925ff3a7c..e4ced5999ab 100644
--- a/src/mess/includes/trs80.h
+++ b/src/mess/includes/trs80.h
@@ -16,12 +16,11 @@
#include "machine/ay31015.h"
#include "machine/buffer.h"
#include "bus/centronics/ctronics.h"
-#include "machine/wd17xx.h"
+#include "machine/wd_fdc.h"
#include "imagedev/cassette.h"
#include "imagedev/flopdrv.h"
#include "imagedev/snapquik.h"
#include "formats/trs_cas.h"
-#include "formats/trs_dsk.h"
class trs80_state : public driver_device
@@ -34,7 +33,11 @@ public:
m_cent_data_out(*this, "cent_data_out"),
m_cent_status_in(*this, "cent_status_in"),
m_ay31015(*this, "tr1602"),
- m_fdc(*this, "wd179x"),
+ m_fdc(*this, "fdc"),
+ m_floppy0(*this, "fdc:0"),
+ m_floppy1(*this, "fdc:1"),
+ m_floppy2(*this, "fdc:2"),
+ m_floppy3(*this, "fdc:3"),
m_speaker(*this, "speaker"),
m_cassette(*this, "cassette"),
m_p_videoram(*this, "p_videoram"),
@@ -67,12 +70,18 @@ public:
m_bank18(NULL),
m_bank19(NULL) { }
+ DECLARE_FLOPPY_FORMATS(floppy_formats);
+
required_device<cpu_device> m_maincpu;
optional_device<centronics_device> m_centronics;
optional_device<output_latch_device> m_cent_data_out;
optional_device<input_buffer_device> m_cent_status_in;
optional_device<ay31015_device> m_ay31015;
- optional_device<fd1793_device> m_fdc;
+ optional_device<fd1793_t> m_fdc;
+ optional_device<floppy_connector> m_floppy0;
+ optional_device<floppy_connector> m_floppy1;
+ optional_device<floppy_connector> m_floppy2;
+ optional_device<floppy_connector> m_floppy3;
required_device<speaker_sound_device> m_speaker;
required_device<cassette_image_device> m_cassette;
DECLARE_WRITE8_MEMBER ( trs80_ff_w );
diff --git a/src/mess/includes/tx0.h b/src/mess/includes/tx0.h
index 83fc093a4b8..b961a415224 100644
--- a/src/mess/includes/tx0.h
+++ b/src/mess/includes/tx0.h
@@ -1,4 +1,4 @@
-// license:???
+// license:GPL-2.0+
// copyright-holders:Raphael Nabet
/*****************************************************************************
*
diff --git a/src/mess/includes/vector06.h b/src/mess/includes/vector06.h
index a35e1467509..970965465ef 100644
--- a/src/mess/includes/vector06.h
+++ b/src/mess/includes/vector06.h
@@ -15,10 +15,9 @@
#include "sound/wave.h"
#include "machine/i8255.h"
#include "machine/ram.h"
-#include "machine/wd17xx.h"
+#include "machine/wd_fdc.h"
#include "imagedev/cassette.h"
#include "imagedev/flopdrv.h"
-#include "formats/basicdsk.h"
#include "bus/generic/slot.h"
#include "bus/generic/carts.h"
@@ -32,16 +31,22 @@ public:
m_cassette(*this, "cassette"),
m_cart(*this, "cartslot"),
m_fdc(*this, "wd1793"),
+ m_floppy0(*this, "wd1793:0"),
+ m_floppy1(*this, "wd1793:1"),
m_ppi(*this, "ppi8255"),
m_ppi2(*this, "ppi8255_2"),
m_ram(*this, RAM_TAG),
m_palette(*this, "palette")
{ }
+ DECLARE_FLOPPY_FORMATS(floppy_formats);
+
required_device<cpu_device> m_maincpu;
required_device<cassette_image_device> m_cassette;
required_device<generic_slot_device> m_cart;
- required_device<fd1793_device> m_fdc;
+ required_device<fd1793_t> m_fdc;
+ required_device<floppy_connector> m_floppy0;
+ required_device<floppy_connector> m_floppy1;
required_device<i8255_device> m_ppi;
required_device<i8255_device> m_ppi2;
required_device<ram_device> m_ram;
diff --git a/src/mess/includes/victor9k.h b/src/mess/includes/victor9k.h
index dcc921b6729..89c5c0b1c4b 100644
--- a/src/mess/includes/victor9k.h
+++ b/src/mess/includes/victor9k.h
@@ -75,9 +75,12 @@ public:
m_brt(0),
m_cont(0),
m_via1_irq(CLEAR_LINE),
+ m_via2_irq(CLEAR_LINE),
m_via3_irq(CLEAR_LINE),
m_fdc_irq(CLEAR_LINE),
- m_ssda_irq(CLEAR_LINE)
+ m_ssda_irq(CLEAR_LINE),
+ m_kbrdy(1),
+ m_kbackctl(0)
{ }
required_device<cpu_device> m_maincpu;
@@ -114,6 +117,7 @@ public:
DECLARE_WRITE8_MEMBER( via2_pb_w );
DECLARE_WRITE_LINE_MEMBER( write_ria );
DECLARE_WRITE_LINE_MEMBER( write_rib );
+ DECLARE_WRITE_LINE_MEMBER( via2_irq_w );
DECLARE_WRITE8_MEMBER( via3_pb_w );
DECLARE_WRITE_LINE_MEMBER( via3_irq_w );
@@ -128,18 +132,25 @@ public:
MC6845_UPDATE_ROW( crtc_update_row );
- /* video state */
+ DECLARE_WRITE_LINE_MEMBER( mux_serial_b_w );
+ DECLARE_WRITE_LINE_MEMBER( mux_serial_a_w );
+
+ // video state
int m_brt;
int m_cont;
- /* interrupts */
+ // interrupts
int m_via1_irq;
+ int m_via2_irq;
int m_via3_irq;
int m_fdc_irq;
int m_ssda_irq;
- DECLARE_WRITE_LINE_MEMBER(mux_serial_b_w);
- DECLARE_WRITE_LINE_MEMBER(mux_serial_a_w);
+ // keyboard
+ int m_kbrdy;
+ int m_kbackctl;
+
+ void update_kback();
};
#endif
diff --git a/src/mess/includes/x1.h b/src/mess/includes/x1.h
index ba48f6ff043..13ab9b6ce2e 100644
--- a/src/mess/includes/x1.h
+++ b/src/mess/includes/x1.h
@@ -15,7 +15,7 @@
#include "machine/z80ctc.h"
#include "machine/z80dart.h"
#include "machine/i8255.h"
-#include "machine/wd17xx.h"
+#include "machine/wd_fdc.h"
#include "machine/z80dma.h"
#include "video/mc6845.h"
#include "sound/2151intf.h"
@@ -23,7 +23,6 @@
#include "sound/wave.h"
#include "imagedev/cassette.h"
#include "imagedev/flopdrv.h"
-#include "formats/basicdsk.h"
#include "formats/x1_tap.h"
#include "bus/generic/slot.h"
#include "bus/generic/carts.h"
@@ -81,6 +80,10 @@ public:
m_cassette(*this, "cassette"),
m_cart(*this, "cartslot"),
m_fdc(*this, "fdc"),
+ m_floppy0(*this, "fdc:0"),
+ m_floppy1(*this, "fdc:1"),
+ m_floppy2(*this, "fdc:2"),
+ m_floppy3(*this, "fdc:3"),
m_crtc(*this, "crtc"),
m_ctc(*this, "ctc"),
m_gfxdecode(*this, "gfxdecode"),
@@ -88,10 +91,16 @@ public:
m_dma(*this, "dma")
{ }
+ DECLARE_FLOPPY_FORMATS(floppy_formats);
+
required_device<cpu_device> m_maincpu;
required_device<cassette_image_device> m_cassette;
required_device<generic_slot_device> m_cart;
- required_device<mb8877_device> m_fdc;
+ required_device<mb8877_t> m_fdc;
+ required_device<floppy_connector> m_floppy0;
+ required_device<floppy_connector> m_floppy1;
+ required_device<floppy_connector> m_floppy2;
+ required_device<floppy_connector> m_floppy3;
required_device<mc6845_device> m_crtc;
required_device<z80ctc_device> m_ctc;
diff --git a/src/mess/includes/z80ne.h b/src/mess/includes/z80ne.h
index 6ba7c12831e..b6d77971981 100644
--- a/src/mess/includes/z80ne.h
+++ b/src/mess/includes/z80ne.h
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Roberto Lavarone
/*****************************************************************************
*
@@ -103,7 +103,7 @@ public:
m_io_modifiers(*this, "MODIFIERS"),
m_io_config(*this, "CONFIG") { }
- DECLARE_FLOPPY_FORMATS(floppy_formats)
+ DECLARE_FLOPPY_FORMATS(floppy_formats);
optional_device<mc6847_base_device> m_vdg;
optional_shared_ptr<UINT8> m_videoram;
diff --git a/src/mess/layout/ebaskb2.lay b/src/mess/layout/ebaskb2.lay
new file mode 100644
index 00000000000..5a0a3d376f7
--- /dev/null
+++ b/src/mess/layout/ebaskb2.lay
@@ -0,0 +1,145 @@
+<?xml version="1.0"?>
+<mamelayout version="2">
+
+<!-- define elements -->
+
+ <element name="static_black"><rect><color red="0.0" green="0.0" blue="0.0" /></rect></element>
+ <element name="static_black2"><rect><color red="0.07" green="0.0" blue="0.01" /></rect></element>
+ <element name="static_black2c"><disk><color red="0.07" green="0.0" blue="0.01" /></disk></element>
+ <element name="static_white0"><rect><color red="0.66" green="0.66" blue="0.66" /></rect></element>
+ <element name="static_white"><rect><color red="0.7" green="0.7" blue="0.7" /></rect></element>
+ <element name="static_whitec"><disk><color red="0.7" green="0.7" blue="0.7" /></disk></element>
+
+ <element name="text_score">
+ <text string="SCORE >"><color red="0.8" green="0.8" blue="0.8" /></text>
+ </element>
+
+ <element name="digit" defstate="0">
+ <led7seg><color red="1.0" green="0.2" blue="0.25" /></led7seg>
+ </element>
+
+ <element name="led" defstate="0">
+ <disk state="0"><color red="0.12" green="0.022" blue="0.025" /></disk>
+ <disk state="1"><color red="1.0" green="0.2" blue="0.25" /></disk>
+ </element>
+
+
+<!-- build screen -->
+
+ <view name="Internal Layout">
+ <bounds left="13.3" right="40.7" top="18" bottom="48" />
+ <bezel element="static_black">
+ <bounds left="13.3" right="40.7" top="18" bottom="48" />
+ </bezel>
+
+ <!-- score panels -->
+
+ <bezel element="static_white0"><bounds x="13.8" y="30.5" width="4" height="5" /></bezel>
+ <bezel element="static_black"><bounds x="13.9" y="30.6" width="3.8" height="4.8" /></bezel>
+
+ <bezel name="digit1" element="digit">
+ <bounds x="14.3" y="33" width="3" height="2" />
+ <orientation rotate="270" />
+ </bezel>
+ <bezel name="digit0" element="digit">
+ <bounds x="14.3" y="31" width="3" height="2" />
+ <orientation rotate="270" />
+ </bezel>
+
+ <bezel element="text_score">
+ <bounds x="17.9" y="30" width="1" height="6" />
+ <orientation rotate="270" />
+ </bezel>
+
+ <bezel element="static_white0"><bounds x="36.2" y="30.5" width="4" height="5" /></bezel>
+ <bezel element="static_black"><bounds x="36.3" y="30.6" width="3.8" height="4.8" /></bezel>
+
+ <bezel name="digit3" element="digit">
+ <bounds x="36.7" y="31" width="3" height="2" />
+ <orientation rotate="90" />
+ </bezel>
+ <bezel name="digit2" element="digit">
+ <bounds x="36.7" y="33" width="3" height="2" />
+ <orientation rotate="90" />
+ </bezel>
+
+ <bezel element="text_score">
+ <bounds x="35.1" y="30" width="1" height="6" />
+ <orientation rotate="90" />
+ </bezel>
+
+
+ <!-- main bezel -->
+
+ <bezel element="static_white"><bounds x="19.3" y="19.3" width="15.4" height="27.4" /></bezel>
+ <bezel element="static_black2"><bounds x="19.5" y="19.5" width="15.0" height="27.0" /></bezel>
+
+ <bezel element="static_white"><bounds x="25.3" y="18.0" width="3.4" height="30.0" /></bezel>
+ <bezel element="static_black2"><bounds x="25.5" y="19.5" width="3" height="27.0" /></bezel>
+ <bezel element="static_black2"><bounds x="25" y="26.05" width="4" height="13.8" /></bezel>
+
+ <bezel element="static_whitec"><bounds x="25.3" y="31.3" width="3.4" height="3.4" /></bezel>
+ <bezel element="static_black2c"><bounds x="25.5" y="31.5" width="3" height="3" /></bezel>
+ <bezel element="static_white"><bounds x="18.9" y="32.9" width="16.2" height="0.2" /></bezel>
+
+ <bezel element="static_whitec"><bounds x="25.3" y="24.3" width="3.4" height="3.4" /></bezel>
+ <bezel element="static_black2c"><bounds x="25.5" y="24.5" width="3" height="3" /></bezel>
+ <bezel element="static_black2"><bounds x="25.5" y="23.9" width="3" height="2" /></bezel>
+ <bezel element="static_white"><bounds x="25.4" y="25.8" width="3.2" height="0.2" /></bezel>
+
+ <bezel element="static_whitec"><bounds x="25.3" y="38.3" width="3.4" height="3.4" /></bezel>
+ <bezel element="static_black2c"><bounds x="25.5" y="38.5" width="3" height="3" /></bezel>
+ <bezel element="static_black2"><bounds x="25.5" y="40.1" width="3" height="2" /></bezel>
+ <bezel element="static_white"><bounds x="25.4" y="40" width="3.2" height="0.2" /></bezel>
+
+ <bezel element="static_white"><bounds x="26.1" y="18.5" width="1.8" height="1.8" /></bezel>
+ <bezel element="static_black2"><bounds x="26.3" y="18.7" width="1.4" height="1.4" /></bezel>
+
+ <bezel element="static_white"><bounds x="26.1" y="45.7" width="1.8" height="1.8" /></bezel>
+ <bezel element="static_black2"><bounds x="26.3" y="45.9" width="1.4" height="1.4" /></bezel>
+
+
+ <!-- round leds -->
+
+ <bezel name="lamp40" element="led"><bounds x="20" y="20" width="1" height="1" /></bezel>
+ <bezel name="lamp41" element="led"><bounds x="23.3" y="21.5" width="1" height="1" /></bezel>
+ <bezel name="lamp42" element="led"><bounds x="26.5" y="21" width="1" height="1" /></bezel>
+ <bezel name="lamp43" element="led"><bounds x="29.7" y="21.5" width="1" height="1" /></bezel>
+ <bezel name="lamp65" element="led"><bounds x="33" y="20" width="1" height="1" /></bezel>
+
+ <bezel name="lamp50" element="led"><bounds x="20" y="25" width="1" height="1" /></bezel>
+ <bezel name="lamp51" element="led"><bounds x="23.8" y="24.5" width="1" height="1" /></bezel>
+ <bezel name="lamp52" element="led"><bounds x="26.5" y="26.2" width="1" height="1" /></bezel>
+ <bezel name="lamp53" element="led"><bounds x="29.2" y="24.5" width="1" height="1" /></bezel>
+ <bezel name="lamp74" element="led"><bounds x="33" y="25" width="1" height="1" /></bezel>
+
+ <bezel name="lamp60" element="led"><bounds x="20" y="30" width="1" height="1" /></bezel>
+ <bezel name="lamp61" element="led"><bounds x="23.3" y="29" width="1" height="1" /></bezel>
+ <bezel name="lamp62" element="led"><bounds x="26.5" y="30" width="1" height="1" /></bezel>
+ <bezel name="lamp63" element="led"><bounds x="29.7" y="29" width="1" height="1" /></bezel>
+ <bezel name="lamp75" element="led"><bounds x="33" y="30" width="1" height="1" /></bezel>
+
+ <bezel name="lamp70" element="led"><bounds x="20" y="35" width="1" height="1" /></bezel>
+ <bezel name="lamp71" element="led"><bounds x="23.3" y="36" width="1" height="1" /></bezel>
+ <bezel name="lamp72" element="led"><bounds x="26.5" y="35" width="1" height="1" /></bezel>
+ <bezel name="lamp73" element="led"><bounds x="29.7" y="36" width="1" height="1" /></bezel>
+ <bezel name="lamp84" element="led"><bounds x="33" y="35" width="1" height="1" /></bezel>
+
+ <bezel name="lamp80" element="led"><bounds x="20" y="40" width="1" height="1" /></bezel>
+ <bezel name="lamp81" element="led"><bounds x="23.8" y="40.5" width="1" height="1" /></bezel>
+ <bezel name="lamp82" element="led"><bounds x="26.5" y="38.8" width="1" height="1" /></bezel>
+ <bezel name="lamp83" element="led"><bounds x="29.2" y="40.5" width="1" height="1" /></bezel>
+ <bezel name="lamp85" element="led"><bounds x="33" y="40" width="1" height="1" /></bezel>
+
+ <bezel name="lamp90" element="led"><bounds x="20" y="45" width="1" height="1" /></bezel>
+ <bezel name="lamp91" element="led"><bounds x="23.3" y="43.5" width="1" height="1" /></bezel>
+ <bezel name="lamp92" element="led"><bounds x="26.5" y="44" width="1" height="1" /></bezel>
+ <bezel name="lamp93" element="led"><bounds x="29.7" y="43.5" width="1" height="1" /></bezel>
+ <bezel name="lamp95" element="led"><bounds x="33" y="45" width="1" height="1" /></bezel>
+
+ <bezel name="lamp64" element="led"><bounds x="26.5" y="18.9" width="1" height="1" /></bezel>
+ <bezel name="lamp94" element="led"><bounds x="26.5" y="46.1" width="1" height="1" /></bezel>
+
+
+ </view>
+</mamelayout>
diff --git a/src/mess/layout/efootb4.lay b/src/mess/layout/efootb4.lay
new file mode 100644
index 00000000000..71266b11448
--- /dev/null
+++ b/src/mess/layout/efootb4.lay
@@ -0,0 +1,166 @@
+<?xml version="1.0"?>
+<mamelayout version="2">
+
+<!-- define elements -->
+
+ <element name="static_black"><rect><color red="0.0" green="0.0" blue="0.0" /></rect></element>
+ <element name="static_white0"><rect><color red="0.6" green="0.6" blue="0.6" /></rect></element>
+ <element name="static_white"><rect><color red="0.7" green="0.7" blue="0.7" /></rect></element>
+ <element name="static_green"><rect><color red="0.07" green="0.45" blue="0.27" /></rect></element>
+
+ <element name="text_pos"><text string="POS./DOWN"><color red="0.8" green="0.8" blue="0.8" /></text></element>
+ <element name="text_togo"><text string="YARDS TO GO"><color red="0.8" green="0.8" blue="0.8" /></text></element>
+ <element name="text_line"><text string="YARD LINE"><color red="0.8" green="0.8" blue="0.8" /></text></element>
+ <element name="text_vis"><text string="VISITOR"><color red="0.8" green="0.8" blue="0.8" /></text></element>
+ <element name="text_home"><text string="HOME"><color red="0.8" green="0.8" blue="0.8" /></text></element>
+ <element name="text_qtr"><text string="QUARTER"><color red="0.8" green="0.8" blue="0.8" /></text></element>
+ <element name="text_time"><text string="TIME REMAINING"><color red="0.8" green="0.8" blue="0.8" /></text></element>
+
+ <element name="digit" defstate="0">
+ <led7seg><color red="0.2" green="1.0" blue="0.9" /></led7seg>
+ </element>
+
+ <element name="ledr" defstate="0">
+ <disk state="0"><color red="0.1" green="0.018" blue="0.022" /></disk>
+ <disk state="1"><color red="1.0" green="0.18" blue="0.22" /></disk>
+ </element>
+ <element name="ledg" defstate="0">
+ <disk state="0"><color red="0.02" green="0.1" blue="0.017" /></disk>
+ <disk state="1"><color red="0.2" green="1.0" blue="0.17" /></disk>
+ </element>
+
+
+<!-- build screen -->
+
+ <view name="Internal Layout">
+ <bounds left="13" right="69" top="17.5" bottom="78.3" />
+ <bezel element="static_black">
+ <bounds left="13" right="69" top="17.5" bottom="78.3" />
+ </bezel>
+
+ <!-- status/score panel -->
+
+ <bezel element="static_white0"><bounds x="13" y="23" width="56" height="13" /></bezel>
+ <bezel element="static_black"><bounds x="12" y="23.3" width="58" height="12.4" /></bezel>
+
+ <bezel element="static_white0"><bounds x="34.2" y="23.1" width="0.3" height="12.8" /></bezel>
+ <bezel element="static_white0"><bounds x="35.6" y="23.1" width="0.3" height="12.8" /></bezel>
+ <bezel element="static_white0"><bounds x="52.2" y="23.1" width="0.3" height="12.8" /></bezel>
+ <bezel element="static_white0"><bounds x="53.6" y="23.1" width="0.3" height="12.8" /></bezel>
+
+ <bezel element="static_black"><bounds x="12" y="24.5" width="58" height="10" /></bezel>
+
+ <bezel element="digit"><bounds x="14" y="25" width="6" height="9" /></bezel> <!-- N/C -->
+ <bezel name="digit15" element="digit"><bounds x="20" y="25" width="6" height="9" /></bezel>
+ <bezel name="digit14" element="digit"><bounds x="26" y="25" width="6" height="9" /></bezel>
+ <bezel element="digit"><bounds x="32" y="25" width="6" height="9" /></bezel> <!-- N/C -->
+ <bezel name="digit13" element="digit"><bounds x="38" y="25" width="6" height="9" /></bezel>
+ <bezel name="digit12" element="digit"><bounds x="44" y="25" width="6" height="9" /></bezel>
+ <bezel element="digit"><bounds x="50" y="25" width="6" height="9" /></bezel> <!-- N/C -->
+ <bezel name="digit11" element="digit"><bounds x="56" y="25" width="6" height="9" /></bezel>
+ <bezel name="digit10" element="digit"><bounds x="62" y="25" width="6" height="9" /></bezel>
+
+ <bezel element="text_pos"><bounds x="17" y="20.5" width="18" height="2" /></bezel>
+ <bezel element="text_togo"><bounds x="35" y="20.5" width="18" height="2" /></bezel>
+ <bezel element="text_line"><bounds x="52" y="20.5" width="18" height="2" /></bezel>
+
+ <bezel element="text_vis"><bounds x="17" y="36.3" width="18" height="2" /></bezel>
+ <bezel element="text_qtr"><bounds x="17" y="38.35" width="18" height="2" /></bezel>
+ <bezel element="text_home"><bounds x="52" y="36.3" width="18" height="2" /></bezel>
+ <bezel element="text_time"><bounds x="52" y="38.35" width="18" height="2" /></bezel>
+
+
+ <!-- main bezel -->
+
+ <bezel element="static_green"><bounds x="13" y="42.9" width="56" height="35.4" /></bezel>
+ <bezel element="static_white"><bounds x="15.7" y="47.9" width="50.6" height="25.4" /></bezel>
+ <bezel element="static_black"><bounds x="16.1" y="48.3" width="49.8" height="24.6" /></bezel>
+
+ <bezel element="static_white"><bounds x="20.9" y="48.1" width="0.2" height="25" /></bezel>
+ <bezel element="static_white"><bounds x="25.9" y="48.1" width="0.2" height="25" /></bezel>
+ <bezel element="static_white"><bounds x="30.9" y="48.1" width="0.2" height="25" /></bezel>
+ <bezel element="static_white"><bounds x="35.9" y="48.1" width="0.2" height="25" /></bezel>
+ <bezel element="static_white"><bounds x="40.9" y="48.1" width="0.2" height="25" /></bezel>
+ <bezel element="static_white"><bounds x="45.9" y="48.1" width="0.2" height="25" /></bezel>
+ <bezel element="static_white"><bounds x="50.9" y="48.1" width="0.2" height="25" /></bezel>
+ <bezel element="static_white"><bounds x="55.9" y="48.1" width="0.2" height="25" /></bezel>
+ <bezel element="static_white"><bounds x="60.9" y="48.1" width="0.2" height="25" /></bezel>
+
+ <bezel element="static_black"><bounds x="16.2" y="48.9" width="49.6" height="23.4" /></bezel>
+
+
+ <!-- leds (note: original game has an overlay on top of this to represent field players) -->
+
+ <bezel name="9.5" element="ledg"><bounds x="20" y="50.0" width="2" height="2" /></bezel>
+ <bezel name="9.4" element="ledg"><bounds x="28" y="50.0" width="2" height="2" /></bezel>
+ <bezel name="9.3" element="ledg"><bounds x="36" y="50.0" width="2" height="2" /></bezel>
+ <bezel name="9.2" element="ledg"><bounds x="44" y="50.0" width="2" height="2" /></bezel>
+ <bezel name="9.1" element="ledg"><bounds x="52" y="50.0" width="2" height="2" /></bezel>
+ <bezel name="9.0" element="ledg"><bounds x="60" y="50.0" width="2" height="2" /></bezel>
+
+ <bezel name="8.5" element="ledg"><bounds x="20" y="54.8" width="2" height="2" /></bezel>
+ <bezel name="8.4" element="ledg"><bounds x="28" y="54.8" width="2" height="2" /></bezel>
+ <bezel name="8.3" element="ledg"><bounds x="36" y="54.8" width="2" height="2" /></bezel>
+ <bezel name="8.2" element="ledg"><bounds x="44" y="54.8" width="2" height="2" /></bezel>
+ <bezel name="8.1" element="ledg"><bounds x="52" y="54.8" width="2" height="2" /></bezel>
+ <bezel name="8.0" element="ledg"><bounds x="60" y="54.8" width="2" height="2" /></bezel>
+
+ <bezel name="7.5" element="ledg"><bounds x="20" y="59.6" width="2" height="2" /></bezel>
+ <bezel name="7.4" element="ledg"><bounds x="28" y="59.6" width="2" height="2" /></bezel>
+ <bezel name="7.3" element="ledg"><bounds x="36" y="59.6" width="2" height="2" /></bezel>
+ <bezel name="7.2" element="ledg"><bounds x="44" y="59.6" width="2" height="2" /></bezel>
+ <bezel name="7.1" element="ledg"><bounds x="52" y="59.6" width="2" height="2" /></bezel>
+ <bezel name="7.0" element="ledg"><bounds x="60" y="59.6" width="2" height="2" /></bezel>
+
+ <bezel name="6.5" element="ledg"><bounds x="20" y="64.4" width="2" height="2" /></bezel>
+ <bezel name="6.4" element="ledg"><bounds x="28" y="64.4" width="2" height="2" /></bezel>
+ <bezel name="6.3" element="ledg"><bounds x="36" y="64.4" width="2" height="2" /></bezel>
+ <bezel name="6.2" element="ledg"><bounds x="44" y="64.4" width="2" height="2" /></bezel>
+ <bezel name="6.1" element="ledg"><bounds x="52" y="64.4" width="2" height="2" /></bezel>
+ <bezel name="6.0" element="ledg"><bounds x="60" y="64.4" width="2" height="2" /></bezel>
+
+ <bezel name="5.5" element="ledg"><bounds x="20" y="69.2" width="2" height="2" /></bezel>
+ <bezel name="5.4" element="ledg"><bounds x="28" y="69.2" width="2" height="2" /></bezel>
+ <bezel name="5.3" element="ledg"><bounds x="36" y="69.2" width="2" height="2" /></bezel>
+ <bezel name="5.2" element="ledg"><bounds x="44" y="69.2" width="2" height="2" /></bezel>
+ <bezel name="5.1" element="ledg"><bounds x="52" y="69.2" width="2" height="2" /></bezel>
+ <bezel name="5.0" element="ledg"><bounds x="60" y="69.2" width="2" height="2" /></bezel>
+
+ <bezel name="4.5" element="ledr"><bounds x="20.4" y="50.4" width="1.2" height="1.2" /></bezel>
+ <bezel name="4.4" element="ledr"><bounds x="28.4" y="50.4" width="1.2" height="1.2" /></bezel>
+ <bezel name="4.3" element="ledr"><bounds x="36.4" y="50.4" width="1.2" height="1.2" /></bezel>
+ <bezel name="4.2" element="ledr"><bounds x="44.4" y="50.4" width="1.2" height="1.2" /></bezel>
+ <bezel name="4.1" element="ledr"><bounds x="52.4" y="50.4" width="1.2" height="1.2" /></bezel>
+ <bezel name="4.0" element="ledr"><bounds x="60.4" y="50.4" width="1.2" height="1.2" /></bezel>
+
+ <bezel name="3.5" element="ledr"><bounds x="20.4" y="55.2" width="1.2" height="1.2" /></bezel>
+ <bezel name="3.4" element="ledr"><bounds x="28.4" y="55.2" width="1.2" height="1.2" /></bezel>
+ <bezel name="3.3" element="ledr"><bounds x="36.4" y="55.2" width="1.2" height="1.2" /></bezel>
+ <bezel name="3.2" element="ledr"><bounds x="44.4" y="55.2" width="1.2" height="1.2" /></bezel>
+ <bezel name="3.1" element="ledr"><bounds x="52.4" y="55.2" width="1.2" height="1.2" /></bezel>
+ <bezel name="3.0" element="ledr"><bounds x="60.4" y="55.2" width="1.2" height="1.2" /></bezel>
+
+ <bezel name="2.5" element="ledr"><bounds x="20.4" y="60.0" width="1.2" height="1.2" /></bezel>
+ <bezel name="2.4" element="ledr"><bounds x="28.4" y="60.0" width="1.2" height="1.2" /></bezel>
+ <bezel name="2.3" element="ledr"><bounds x="36.4" y="60.0" width="1.2" height="1.2" /></bezel>
+ <bezel name="2.2" element="ledr"><bounds x="44.4" y="60.0" width="1.2" height="1.2" /></bezel>
+ <bezel name="2.1" element="ledr"><bounds x="52.4" y="60.0" width="1.2" height="1.2" /></bezel>
+ <bezel name="2.0" element="ledr"><bounds x="60.4" y="60.0" width="1.2" height="1.2" /></bezel>
+
+ <bezel name="1.5" element="ledr"><bounds x="20.4" y="64.8" width="1.2" height="1.2" /></bezel>
+ <bezel name="1.4" element="ledr"><bounds x="28.4" y="64.8" width="1.2" height="1.2" /></bezel>
+ <bezel name="1.3" element="ledr"><bounds x="36.4" y="64.8" width="1.2" height="1.2" /></bezel>
+ <bezel name="1.2" element="ledr"><bounds x="44.4" y="64.8" width="1.2" height="1.2" /></bezel>
+ <bezel name="1.1" element="ledr"><bounds x="52.4" y="64.8" width="1.2" height="1.2" /></bezel>
+ <bezel name="1.0" element="ledr"><bounds x="60.4" y="64.8" width="1.2" height="1.2" /></bezel>
+
+ <bezel name="0.5" element="ledr"><bounds x="20.4" y="69.6" width="1.2" height="1.2" /></bezel>
+ <bezel name="0.4" element="ledr"><bounds x="28.4" y="69.6" width="1.2" height="1.2" /></bezel>
+ <bezel name="0.3" element="ledr"><bounds x="36.4" y="69.6" width="1.2" height="1.2" /></bezel>
+ <bezel name="0.2" element="ledr"><bounds x="44.4" y="69.6" width="1.2" height="1.2" /></bezel>
+ <bezel name="0.1" element="ledr"><bounds x="52.4" y="69.6" width="1.2" height="1.2" /></bezel>
+ <bezel name="0.0" element="ledr"><bounds x="60.4" y="69.6" width="1.2" height="1.2" /></bezel>
+
+
+ </view>
+</mamelayout>
diff --git a/src/mess/layout/h2hbaseb.lay b/src/mess/layout/h2hbaseb.lay
index 860ee6c23b6..ed35017c1b9 100644
--- a/src/mess/layout/h2hbaseb.lay
+++ b/src/mess/layout/h2hbaseb.lay
@@ -4,45 +4,198 @@
<!-- define elements -->
<element name="static_black"><rect><color red="0.0" green="0.0" blue="0.0" /></rect></element>
+ <element name="static_blackc"><disk><color red="0.0" green="0.0" blue="0.0" /></disk></element>
+ <element name="static_white"><rect><color red="0.82" green="0.82" blue="0.82" /></rect></element>
+ <element name="static_whitec"><disk><color red="0.82" green="0.82" blue="0.82" /></disk></element>
+ <element name="static_whitec0"><disk><color red="0.79" green="0.79" blue="0.79" /></disk></element>
+ <element name="static_green"><rect><color red="0.11" green="0.6" blue="0.31" /></rect></element>
+ <element name="static_greenc"><disk><color red="0.11" green="0.6" blue="0.31" /></disk></element>
+ <element name="static_yellow"><rect><color red="0.77" green="0.7" blue="0.2" /></rect></element>
+ <element name="static_yellowc"><disk><color red="0.77" green="0.7" blue="0.2" /></disk></element>
+ <element name="static_blue"><rect><color red="0.2" green="0.3" blue="1.0" /></rect></element>
+
+ <element name="text_balls">
+ <rect><color red="0.11" green="0.6" blue="0.31" /></rect>
+ <text string="BALLS"><color red="0.9" green="0.9" blue="0.9" /></text>
+ </element>
+ <element name="text_strikes">
+ <rect><color red="0.11" green="0.6" blue="0.31" /></rect>
+ <text string="STRIKES"><color red="0.9" green="0.9" blue="0.9" /></text>
+ </element>
+ <element name="text_outs">
+ <rect><color red="0.11" green="0.6" blue="0.31" /></rect>
+ <text string="OUTS"><color red="0.9" green="0.9" blue="0.9" /></text>
+ </element>
+ <element name="text_inning">
+ <rect><color red="0.11" green="0.6" blue="0.31" /></rect>
+ <text string="INNING"><color red="0.9" green="0.9" blue="0.9" /></text>
+ </element>
+ <element name="text_score">
+ <rect><color red="0.11" green="0.6" blue="0.31" /></rect>
+ <text string="SCOREBOARD"><color red="0.9" green="0.9" blue="0.9" /></text>
+ </element>
+ <element name="text_away">
+ <rect><color red="0.11" green="0.6" blue="0.31" /></rect>
+ <text string="AWAY"><color red="0.9" green="0.9" blue="0.9" /></text>
+ </element>
+ <element name="text_home">
+ <rect><color red="0.11" green="0.6" blue="0.31" /></rect>
+ <text string="HOME"><color red="0.9" green="0.9" blue="0.9" /></text>
+ </element>
+
+ <element name="text_pitcher">
+ <rect><color red="0.11" green="0.6" blue="0.31" /></rect>
+ <text string="PITCHER"><color red="0.91" green="0.91" blue="0.91" /></text>
+ </element>
+ <element name="text_b1">
+ <rect><color red="0.11" green="0.6" blue="0.31" /></rect>
+ <text string="1st"><color red="0.92" green="0.92" blue="0.92" /></text>
+ </element>
+ <element name="text_b2">
+ <rect><color red="0.11" green="0.6" blue="0.31" /></rect>
+ <text string="2nd"><color red="0.92" green="0.92" blue="0.92" /></text>
+ </element>
+ <element name="text_b3">
+ <rect><color red="0.11" green="0.6" blue="0.31" /></rect>
+ <text string="3rd"><color red="0.92" green="0.92" blue="0.92" /></text>
+ </element>
+
+ <element name="text_home2">
+ <text string="HOME"><color red="0.87" green="0.87" blue="0.87" /></text>
+ </element>
<element name="digit" defstate="0">
- <led7seg><color red="0.2" green="1.0" blue="0.97" /></led7seg>
+ <led7seg><color red="0.2" green="1.0" blue="1.0" /></led7seg>
</element>
<element name="led" defstate="0">
- <disk state="0"><color red="0.2" green="0.05" blue="0.05" /></disk>
- <disk state="1"><color red="1.0" green="0.25" blue="0.25" /></disk>
+ <disk state="0"><color red="0.15" green="0.04" blue="0.05" /></disk>
+ <disk state="1"><color red="1.0" green="0.25" blue="0.29" /></disk>
</element>
<!-- build screen -->
<view name="Internal Layout">
- <bounds left="0" right="100" top="0" bottom="50" />
- <bezel element="static_black">
- <bounds left="0" right="100" top="0" bottom="50" />
+ <bounds left="-5" right="85" top="0" bottom="135.5" />
+ <bezel element="static_green">
+ <bounds left="-50" right="150" top="-50" bottom="150" />
+ </bezel>
+
+ <!-- status/score panel -->
+
+ <bezel element="static_white"><bounds x="12.3" y="6.7" width="54.4" height="35.6" /></bezel>
+ <bezel element="static_green"><bounds x="12.7" y="7.1" width="53.6" height="13.5" /></bezel>
+ <bezel element="static_black"><bounds x="12.7" y="21" width="53.6" height="13.5" /></bezel>
+ <bezel element="static_green"><bounds x="12.7" y="34.9" width="53.6" height="7" /></bezel>
+
+ <bezel element="text_balls">
+ <bounds x="14" y="7.1" width="3" height="13.5" />
+ <orientation rotate="270" />
+ </bezel>
+ <bezel element="text_strikes">
+ <bounds x="20" y="7.1" width="3" height="13.5" />
+ <orientation rotate="270" />
+ </bezel>
+ <bezel element="text_outs">
+ <bounds x="26" y="7.1" width="3" height="13.5" />
+ <orientation rotate="270" />
+ </bezel>
+ <bezel element="text_inning">
+ <bounds x="32" y="7.1" width="3" height="13.5" />
+ <orientation rotate="270" />
</bezel>
- <bezel name="digit0" element="digit"><bounds x="0" y="0" width="10" height="15" /></bezel>
- <bezel name="digit1" element="digit"><bounds x="10" y="0" width="10" height="15" /></bezel>
- <bezel name="digit2" element="digit"><bounds x="20" y="0" width="10" height="15" /></bezel>
- <bezel name="digit3" element="digit"><bounds x="30" y="0" width="10" height="15" /></bezel>
- <bezel element="digit"><bounds x="40" y="0" width="10" height="15" /></bezel>
- <bezel name="digit4" element="digit"><bounds x="50" y="0" width="10" height="15" /></bezel>
- <bezel name="digit5" element="digit"><bounds x="60" y="0" width="10" height="15" /></bezel>
- <bezel name="digit6" element="digit"><bounds x="70" y="0" width="10" height="15" /></bezel>
- <bezel name="digit7" element="digit"><bounds x="80" y="0" width="10" height="15" /></bezel>
-
- <bezel name="0.8" element="led"><bounds x="0" y="20" width="4" height="4" /></bezel>
- <bezel name="1.8" element="led"><bounds x="5" y="20" width="4" height="4" /></bezel>
- <bezel name="2.8" element="led"><bounds x="10" y="20" width="4" height="4" /></bezel>
- <bezel name="3.8" element="led"><bounds x="15" y="20" width="4" height="4" /></bezel>
- <bezel name="4.8" element="led"><bounds x="20" y="20" width="4" height="4" /></bezel>
-
- <bezel name="5.8" element="led"><bounds x="30" y="20" width="4" height="4" /></bezel>
- <bezel name="6.8" element="led"><bounds x="35" y="20" width="4" height="4" /></bezel>
- <bezel name="7.8" element="led"><bounds x="40" y="20" width="4" height="4" /></bezel>
- <bezel name="8.8" element="led"><bounds x="45" y="20" width="4" height="4" /></bezel>
+ <bezel element="text_score">
+ <bounds x="38" y="11.7" width="28" height="4.3" />
+ </bezel>
+
+ <bezel element="text_score"><bounds x="38" y="11.7" width="28" height="4.3" /></bezel>
+ <bezel element="text_away"><bounds x="13" y="36.8" width="11" height="3" /></bezel>
+ <bezel element="text_home"><bounds x="25" y="36.8" width="11" height="3" /></bezel>
+
+ <bezel name="digit0" element="digit"><bounds x="13" y="24" width="5" height="7.5" /></bezel>
+ <bezel name="digit1" element="digit"><bounds x="19" y="24" width="5" height="7.5" /></bezel>
+ <bezel name="digit2" element="digit"><bounds x="25" y="24" width="5" height="7.5" /></bezel>
+ <bezel name="digit3" element="digit"><bounds x="31" y="24" width="5" height="7.5" /></bezel>
+ <bezel element="digit"><bounds x="37" y="24" width="5" height="7.5" /></bezel> <!-- N/C -->
+ <bezel name="digit4" element="digit"><bounds x="43" y="24" width="5" height="7.5" /></bezel>
+ <bezel name="digit5" element="digit"><bounds x="49" y="24" width="5" height="7.5" /></bezel>
+ <bezel name="digit6" element="digit"><bounds x="55" y="24" width="5" height="7.5" /></bezel>
+ <bezel name="digit7" element="digit"><bounds x="61" y="24" width="5" height="7.5" /></bezel>
+
+ <bezel element="static_blue">
+ <bounds x="12.7" y="21" width="53.6" height="13.5" />
+ <color alpha="0.5" />
+ </bezel>
+
+ <bezel element="static_white"><bounds x="18.3" y="6.8" width="0.4" height="28" /></bezel>
+ <bezel element="static_white"><bounds x="24.3" y="6.8" width="0.4" height="35.4" /></bezel>
+ <bezel element="static_white"><bounds x="30.3" y="6.8" width="0.4" height="28" /></bezel>
+ <bezel element="static_white"><bounds x="36.3" y="6.8" width="0.4" height="35.4" /></bezel>
+
+
+ <!-- main bezel -->
+
+ <bezel element="static_whitec"><bounds x="0" y="50" width="80" height="80" /></bezel>
+ <bezel element="static_yellowc"><bounds x="1" y="51" width="78" height="78" /></bezel>
+ <bezel element="static_whitec"><bounds x="10.5" y="60.5" width="59" height="59" /></bezel>
+ <bezel element="static_yellowc"><bounds x="11.5" y="61.5" width="57" height="57" /></bezel>
+ <bezel element="static_whitec"><bounds x="15" y="65" width="50" height="50" /></bezel>
+ <bezel element="static_greenc"><bounds x="16" y="66" width="48" height="48" /></bezel>
+
+ <bezel element="static_whitec"><bounds x="33" y="76" width="14" height="14" /></bezel>
+ <bezel element="static_blackc"><bounds x="34" y="77" width="12" height="12" /></bezel>
+ <bezel element="static_white"><bounds x="34" y="85" width="12" height="30" /></bezel>
+ <bezel element="static_blackc"><bounds x="34" y="77.5" width="12" height="12" /></bezel>
+
+ <bezel element="static_whitec"><bounds x="15" y="100" width="50" height="50" /></bezel>
+ <bezel element="static_blackc"><bounds x="16" y="101" width="48" height="48" /></bezel>
+ <bezel element="static_black"><bounds x="35" y="84" width="10" height="30" /></bezel>
+ <bezel element="static_white"><bounds x="15" y="125" width="50" height="30" /></bezel>
+ <bezel element="static_black"><bounds x="16" y="124.9" width="48" height="31" /></bezel>
+
+ <bezel element="static_white"><bounds x="35" y="53" width="10" height="10" /></bezel>
+ <bezel element="static_black"><bounds x="36" y="54" width="8" height="8" /></bezel>
+ <bezel element="static_white"><bounds x="3" y="85" width="10" height="10" /></bezel>
+ <bezel element="static_black"><bounds x="4" y="86" width="8" height="8" /></bezel>
+ <bezel element="static_white"><bounds x="67" y="85" width="10" height="10" /></bezel>
+ <bezel element="static_black"><bounds x="68" y="86" width="8" height="8" /></bezel>
+
+ <bezel element="static_whitec0"><bounds x="36.5" y="79.5" width="7" height="7" /></bezel>
+ <bezel element="static_blackc"><bounds x="37.1" y="80.1" width="5.8" height="5.8" /></bezel>
+
+ <bezel element="static_whitec"><bounds x="36.5" y="116" width="7" height="7" /></bezel>
+ <bezel element="static_blackc"><bounds x="37.5" y="117" width="5" height="5" /></bezel>
+ <bezel element="static_white"><bounds x="36.5" y="116" width="7" height="3.5" /></bezel>
+ <bezel element="static_black"><bounds x="37.5" y="117" width="5" height="3.51" /></bezel>
+
+ <bezel element="static_white"><bounds x="47" y="116" width="7" height="7" /></bezel>
+ <bezel element="static_black"><bounds x="48" y="117" width="5" height="5" /></bezel>
+ <bezel element="static_white"><bounds x="26" y="116" width="7" height="7" /></bezel>
+ <bezel element="static_black"><bounds x="27" y="117" width="5" height="5" /></bezel>
+
+ <bezel element="text_pitcher"><bounds x="30" y="71.7" width="20" height="3.6" /></bezel>
+ <bezel element="text_b1"><bounds x="60" y="88.85" width="3.5" height="2.3" /></bezel>
+ <bezel element="text_b2"><bounds x="37" y="66.5" width="6" height="2.3" /></bezel>
+ <bezel element="text_b3"><bounds x="16.5" y="88.85" width="4" height="2.3" /></bezel>
+
+ <bezel element="text_home2"><bounds x="30" y="124" width="20" height="3.6" /></bezel>
+
+
+ <!-- leds -->
+
+ <bezel name="0.8" element="led"><bounds x="38.3" y="81.3" width="3.4" height="3.4" /></bezel>
+ <bezel name="1.8" element="led"><bounds x="38.3" y="93.3" width="3.4" height="3.4" /></bezel>
+ <bezel name="2.8" element="led"><bounds x="38.3" y="105.3" width="3.4" height="3.4" /></bezel>
+ <bezel name="3.8" element="led"><bounds x="38.3" y="117.8" width="3.4" height="3.4" /></bezel>
+ <bezel name="4.8" element="led"><bounds x="38.3" y="129.8" width="3.4" height="3.4" /></bezel>
+
+ <bezel name="5.8" element="led"><bounds x="48.8" y="117.8" width="3.4" height="3.4" /></bezel>
+ <bezel name="6.8" element="led"><bounds x="70.3" y="88.3" width="3.4" height="3.4" /></bezel>
+ <bezel name="7.8" element="led"><bounds x="38.3" y="56.3" width="3.4" height="3.4" /></bezel>
+ <bezel name="8.8" element="led"><bounds x="6.3" y="88.3" width="3.4" height="3.4" /></bezel>
+
</view>
</mamelayout>
diff --git a/src/mess/layout/hh_sm510_test.lay b/src/mess/layout/hh_sm510_test.lay
new file mode 100644
index 00000000000..f960f795acc
--- /dev/null
+++ b/src/mess/layout/hh_sm510_test.lay
@@ -0,0 +1,301 @@
+<?xml version="1.0"?>
+<mamelayout version="2">
+
+<!-- define elements -->
+
+ <!-- not really black, and not really leds either, but let's just keep the same naming as the other hh test layouts -->
+ <element name="static_black"><rect><color red="0.5412" green="0.57255" blue="0.5804" /></rect></element>
+
+ <element name="led" defstate="2">
+ <disk state="0"><color red="0.515" green="0.537" blue="0.548" /></disk>
+ <disk state="1"><color red="0.361" green="0.326" blue="0.346" /></disk>
+
+ <disk state="2"><color red="0.5412" green="0.57255" blue="0.5804" /></disk>
+ </element>
+
+
+<!-- build screen -->
+
+ <view name="Test Layout">
+ <bounds left="0" right="64" top="0" bottom="64" />
+ <bezel element="static_black">
+ <bounds left="0" right="64" top="0" bottom="64" />
+ </bezel>
+
+ <!-- max 16*16 matrix -->
+
+ <bezel name="0.0" element="led"><bounds x="0" y="0" width="1" height="1" /></bezel>
+ <bezel name="0.1" element="led"><bounds x="0" y="2" width="1" height="1" /></bezel>
+ <bezel name="0.2" element="led"><bounds x="0" y="4" width="1" height="1" /></bezel>
+ <bezel name="0.3" element="led"><bounds x="0" y="6" width="1" height="1" /></bezel>
+ <bezel name="0.4" element="led"><bounds x="0" y="8" width="1" height="1" /></bezel>
+ <bezel name="0.5" element="led"><bounds x="0" y="10" width="1" height="1" /></bezel>
+ <bezel name="0.6" element="led"><bounds x="0" y="12" width="1" height="1" /></bezel>
+ <bezel name="0.7" element="led"><bounds x="0" y="14" width="1" height="1" /></bezel>
+ <bezel name="0.8" element="led"><bounds x="0" y="16" width="1" height="1" /></bezel>
+ <bezel name="0.9" element="led"><bounds x="0" y="18" width="1" height="1" /></bezel>
+ <bezel name="0.10" element="led"><bounds x="0" y="20" width="1" height="1" /></bezel>
+ <bezel name="0.11" element="led"><bounds x="0" y="22" width="1" height="1" /></bezel>
+ <bezel name="0.12" element="led"><bounds x="0" y="24" width="1" height="1" /></bezel>
+ <bezel name="0.13" element="led"><bounds x="0" y="26" width="1" height="1" /></bezel>
+ <bezel name="0.14" element="led"><bounds x="0" y="28" width="1" height="1" /></bezel>
+ <bezel name="0.15" element="led"><bounds x="0" y="30" width="1" height="1" /></bezel>
+
+ <bezel name="1.0" element="led"><bounds x="2" y="0" width="1" height="1" /></bezel>
+ <bezel name="1.1" element="led"><bounds x="2" y="2" width="1" height="1" /></bezel>
+ <bezel name="1.2" element="led"><bounds x="2" y="4" width="1" height="1" /></bezel>
+ <bezel name="1.3" element="led"><bounds x="2" y="6" width="1" height="1" /></bezel>
+ <bezel name="1.4" element="led"><bounds x="2" y="8" width="1" height="1" /></bezel>
+ <bezel name="1.5" element="led"><bounds x="2" y="10" width="1" height="1" /></bezel>
+ <bezel name="1.6" element="led"><bounds x="2" y="12" width="1" height="1" /></bezel>
+ <bezel name="1.7" element="led"><bounds x="2" y="14" width="1" height="1" /></bezel>
+ <bezel name="1.8" element="led"><bounds x="2" y="16" width="1" height="1" /></bezel>
+ <bezel name="1.9" element="led"><bounds x="2" y="18" width="1" height="1" /></bezel>
+ <bezel name="1.10" element="led"><bounds x="2" y="20" width="1" height="1" /></bezel>
+ <bezel name="1.11" element="led"><bounds x="2" y="22" width="1" height="1" /></bezel>
+ <bezel name="1.12" element="led"><bounds x="2" y="24" width="1" height="1" /></bezel>
+ <bezel name="1.13" element="led"><bounds x="2" y="26" width="1" height="1" /></bezel>
+ <bezel name="1.14" element="led"><bounds x="2" y="28" width="1" height="1" /></bezel>
+ <bezel name="1.15" element="led"><bounds x="2" y="30" width="1" height="1" /></bezel>
+
+ <bezel name="2.0" element="led"><bounds x="4" y="0" width="1" height="1" /></bezel>
+ <bezel name="2.1" element="led"><bounds x="4" y="2" width="1" height="1" /></bezel>
+ <bezel name="2.2" element="led"><bounds x="4" y="4" width="1" height="1" /></bezel>
+ <bezel name="2.3" element="led"><bounds x="4" y="6" width="1" height="1" /></bezel>
+ <bezel name="2.4" element="led"><bounds x="4" y="8" width="1" height="1" /></bezel>
+ <bezel name="2.5" element="led"><bounds x="4" y="10" width="1" height="1" /></bezel>
+ <bezel name="2.6" element="led"><bounds x="4" y="12" width="1" height="1" /></bezel>
+ <bezel name="2.7" element="led"><bounds x="4" y="14" width="1" height="1" /></bezel>
+ <bezel name="2.8" element="led"><bounds x="4" y="16" width="1" height="1" /></bezel>
+ <bezel name="2.9" element="led"><bounds x="4" y="18" width="1" height="1" /></bezel>
+ <bezel name="2.10" element="led"><bounds x="4" y="20" width="1" height="1" /></bezel>
+ <bezel name="2.11" element="led"><bounds x="4" y="22" width="1" height="1" /></bezel>
+ <bezel name="2.12" element="led"><bounds x="4" y="24" width="1" height="1" /></bezel>
+ <bezel name="2.13" element="led"><bounds x="4" y="26" width="1" height="1" /></bezel>
+ <bezel name="2.14" element="led"><bounds x="4" y="28" width="1" height="1" /></bezel>
+ <bezel name="2.15" element="led"><bounds x="4" y="30" width="1" height="1" /></bezel>
+
+ <bezel name="3.0" element="led"><bounds x="6" y="0" width="1" height="1" /></bezel>
+ <bezel name="3.1" element="led"><bounds x="6" y="2" width="1" height="1" /></bezel>
+ <bezel name="3.2" element="led"><bounds x="6" y="4" width="1" height="1" /></bezel>
+ <bezel name="3.3" element="led"><bounds x="6" y="6" width="1" height="1" /></bezel>
+ <bezel name="3.4" element="led"><bounds x="6" y="8" width="1" height="1" /></bezel>
+ <bezel name="3.5" element="led"><bounds x="6" y="10" width="1" height="1" /></bezel>
+ <bezel name="3.6" element="led"><bounds x="6" y="12" width="1" height="1" /></bezel>
+ <bezel name="3.7" element="led"><bounds x="6" y="14" width="1" height="1" /></bezel>
+ <bezel name="3.8" element="led"><bounds x="6" y="16" width="1" height="1" /></bezel>
+ <bezel name="3.9" element="led"><bounds x="6" y="18" width="1" height="1" /></bezel>
+ <bezel name="3.10" element="led"><bounds x="6" y="20" width="1" height="1" /></bezel>
+ <bezel name="3.11" element="led"><bounds x="6" y="22" width="1" height="1" /></bezel>
+ <bezel name="3.12" element="led"><bounds x="6" y="24" width="1" height="1" /></bezel>
+ <bezel name="3.13" element="led"><bounds x="6" y="26" width="1" height="1" /></bezel>
+ <bezel name="3.14" element="led"><bounds x="6" y="28" width="1" height="1" /></bezel>
+ <bezel name="3.15" element="led"><bounds x="6" y="30" width="1" height="1" /></bezel>
+
+ <bezel name="4.0" element="led"><bounds x="8" y="0" width="1" height="1" /></bezel>
+ <bezel name="4.1" element="led"><bounds x="8" y="2" width="1" height="1" /></bezel>
+ <bezel name="4.2" element="led"><bounds x="8" y="4" width="1" height="1" /></bezel>
+ <bezel name="4.3" element="led"><bounds x="8" y="6" width="1" height="1" /></bezel>
+ <bezel name="4.4" element="led"><bounds x="8" y="8" width="1" height="1" /></bezel>
+ <bezel name="4.5" element="led"><bounds x="8" y="10" width="1" height="1" /></bezel>
+ <bezel name="4.6" element="led"><bounds x="8" y="12" width="1" height="1" /></bezel>
+ <bezel name="4.7" element="led"><bounds x="8" y="14" width="1" height="1" /></bezel>
+ <bezel name="4.8" element="led"><bounds x="8" y="16" width="1" height="1" /></bezel>
+ <bezel name="4.9" element="led"><bounds x="8" y="18" width="1" height="1" /></bezel>
+ <bezel name="4.10" element="led"><bounds x="8" y="20" width="1" height="1" /></bezel>
+ <bezel name="4.11" element="led"><bounds x="8" y="22" width="1" height="1" /></bezel>
+ <bezel name="4.12" element="led"><bounds x="8" y="24" width="1" height="1" /></bezel>
+ <bezel name="4.13" element="led"><bounds x="8" y="26" width="1" height="1" /></bezel>
+ <bezel name="4.14" element="led"><bounds x="8" y="28" width="1" height="1" /></bezel>
+ <bezel name="4.15" element="led"><bounds x="8" y="30" width="1" height="1" /></bezel>
+
+ <bezel name="5.0" element="led"><bounds x="10" y="0" width="1" height="1" /></bezel>
+ <bezel name="5.1" element="led"><bounds x="10" y="2" width="1" height="1" /></bezel>
+ <bezel name="5.2" element="led"><bounds x="10" y="4" width="1" height="1" /></bezel>
+ <bezel name="5.3" element="led"><bounds x="10" y="6" width="1" height="1" /></bezel>
+ <bezel name="5.4" element="led"><bounds x="10" y="8" width="1" height="1" /></bezel>
+ <bezel name="5.5" element="led"><bounds x="10" y="10" width="1" height="1" /></bezel>
+ <bezel name="5.6" element="led"><bounds x="10" y="12" width="1" height="1" /></bezel>
+ <bezel name="5.7" element="led"><bounds x="10" y="14" width="1" height="1" /></bezel>
+ <bezel name="5.8" element="led"><bounds x="10" y="16" width="1" height="1" /></bezel>
+ <bezel name="5.9" element="led"><bounds x="10" y="18" width="1" height="1" /></bezel>
+ <bezel name="5.10" element="led"><bounds x="10" y="20" width="1" height="1" /></bezel>
+ <bezel name="5.11" element="led"><bounds x="10" y="22" width="1" height="1" /></bezel>
+ <bezel name="5.12" element="led"><bounds x="10" y="24" width="1" height="1" /></bezel>
+ <bezel name="5.13" element="led"><bounds x="10" y="26" width="1" height="1" /></bezel>
+ <bezel name="5.14" element="led"><bounds x="10" y="28" width="1" height="1" /></bezel>
+ <bezel name="5.15" element="led"><bounds x="10" y="30" width="1" height="1" /></bezel>
+
+ <bezel name="6.0" element="led"><bounds x="12" y="0" width="1" height="1" /></bezel>
+ <bezel name="6.1" element="led"><bounds x="12" y="2" width="1" height="1" /></bezel>
+ <bezel name="6.2" element="led"><bounds x="12" y="4" width="1" height="1" /></bezel>
+ <bezel name="6.3" element="led"><bounds x="12" y="6" width="1" height="1" /></bezel>
+ <bezel name="6.4" element="led"><bounds x="12" y="8" width="1" height="1" /></bezel>
+ <bezel name="6.5" element="led"><bounds x="12" y="10" width="1" height="1" /></bezel>
+ <bezel name="6.6" element="led"><bounds x="12" y="12" width="1" height="1" /></bezel>
+ <bezel name="6.7" element="led"><bounds x="12" y="14" width="1" height="1" /></bezel>
+ <bezel name="6.8" element="led"><bounds x="12" y="16" width="1" height="1" /></bezel>
+ <bezel name="6.9" element="led"><bounds x="12" y="18" width="1" height="1" /></bezel>
+ <bezel name="6.10" element="led"><bounds x="12" y="20" width="1" height="1" /></bezel>
+ <bezel name="6.11" element="led"><bounds x="12" y="22" width="1" height="1" /></bezel>
+ <bezel name="6.12" element="led"><bounds x="12" y="24" width="1" height="1" /></bezel>
+ <bezel name="6.13" element="led"><bounds x="12" y="26" width="1" height="1" /></bezel>
+ <bezel name="6.14" element="led"><bounds x="12" y="28" width="1" height="1" /></bezel>
+ <bezel name="6.15" element="led"><bounds x="12" y="30" width="1" height="1" /></bezel>
+
+ <bezel name="7.0" element="led"><bounds x="14" y="0" width="1" height="1" /></bezel>
+ <bezel name="7.1" element="led"><bounds x="14" y="2" width="1" height="1" /></bezel>
+ <bezel name="7.2" element="led"><bounds x="14" y="4" width="1" height="1" /></bezel>
+ <bezel name="7.3" element="led"><bounds x="14" y="6" width="1" height="1" /></bezel>
+ <bezel name="7.4" element="led"><bounds x="14" y="8" width="1" height="1" /></bezel>
+ <bezel name="7.5" element="led"><bounds x="14" y="10" width="1" height="1" /></bezel>
+ <bezel name="7.6" element="led"><bounds x="14" y="12" width="1" height="1" /></bezel>
+ <bezel name="7.7" element="led"><bounds x="14" y="14" width="1" height="1" /></bezel>
+ <bezel name="7.8" element="led"><bounds x="14" y="16" width="1" height="1" /></bezel>
+ <bezel name="7.9" element="led"><bounds x="14" y="18" width="1" height="1" /></bezel>
+ <bezel name="7.10" element="led"><bounds x="14" y="20" width="1" height="1" /></bezel>
+ <bezel name="7.11" element="led"><bounds x="14" y="22" width="1" height="1" /></bezel>
+ <bezel name="7.12" element="led"><bounds x="14" y="24" width="1" height="1" /></bezel>
+ <bezel name="7.13" element="led"><bounds x="14" y="26" width="1" height="1" /></bezel>
+ <bezel name="7.14" element="led"><bounds x="14" y="28" width="1" height="1" /></bezel>
+ <bezel name="7.15" element="led"><bounds x="14" y="30" width="1" height="1" /></bezel>
+
+ <bezel name="8.0" element="led"><bounds x="16" y="0" width="1" height="1" /></bezel>
+ <bezel name="8.1" element="led"><bounds x="16" y="2" width="1" height="1" /></bezel>
+ <bezel name="8.2" element="led"><bounds x="16" y="4" width="1" height="1" /></bezel>
+ <bezel name="8.3" element="led"><bounds x="16" y="6" width="1" height="1" /></bezel>
+ <bezel name="8.4" element="led"><bounds x="16" y="8" width="1" height="1" /></bezel>
+ <bezel name="8.5" element="led"><bounds x="16" y="10" width="1" height="1" /></bezel>
+ <bezel name="8.6" element="led"><bounds x="16" y="12" width="1" height="1" /></bezel>
+ <bezel name="8.7" element="led"><bounds x="16" y="14" width="1" height="1" /></bezel>
+ <bezel name="8.8" element="led"><bounds x="16" y="16" width="1" height="1" /></bezel>
+ <bezel name="8.9" element="led"><bounds x="16" y="18" width="1" height="1" /></bezel>
+ <bezel name="8.10" element="led"><bounds x="16" y="20" width="1" height="1" /></bezel>
+ <bezel name="8.11" element="led"><bounds x="16" y="22" width="1" height="1" /></bezel>
+ <bezel name="8.12" element="led"><bounds x="16" y="24" width="1" height="1" /></bezel>
+ <bezel name="8.13" element="led"><bounds x="16" y="26" width="1" height="1" /></bezel>
+ <bezel name="8.14" element="led"><bounds x="16" y="28" width="1" height="1" /></bezel>
+ <bezel name="8.15" element="led"><bounds x="16" y="30" width="1" height="1" /></bezel>
+
+ <bezel name="9.0" element="led"><bounds x="18" y="0" width="1" height="1" /></bezel>
+ <bezel name="9.1" element="led"><bounds x="18" y="2" width="1" height="1" /></bezel>
+ <bezel name="9.2" element="led"><bounds x="18" y="4" width="1" height="1" /></bezel>
+ <bezel name="9.3" element="led"><bounds x="18" y="6" width="1" height="1" /></bezel>
+ <bezel name="9.4" element="led"><bounds x="18" y="8" width="1" height="1" /></bezel>
+ <bezel name="9.5" element="led"><bounds x="18" y="10" width="1" height="1" /></bezel>
+ <bezel name="9.6" element="led"><bounds x="18" y="12" width="1" height="1" /></bezel>
+ <bezel name="9.7" element="led"><bounds x="18" y="14" width="1" height="1" /></bezel>
+ <bezel name="9.8" element="led"><bounds x="18" y="16" width="1" height="1" /></bezel>
+ <bezel name="9.9" element="led"><bounds x="18" y="18" width="1" height="1" /></bezel>
+ <bezel name="9.10" element="led"><bounds x="18" y="20" width="1" height="1" /></bezel>
+ <bezel name="9.11" element="led"><bounds x="18" y="22" width="1" height="1" /></bezel>
+ <bezel name="9.12" element="led"><bounds x="18" y="24" width="1" height="1" /></bezel>
+ <bezel name="9.13" element="led"><bounds x="18" y="26" width="1" height="1" /></bezel>
+ <bezel name="9.14" element="led"><bounds x="18" y="28" width="1" height="1" /></bezel>
+ <bezel name="9.15" element="led"><bounds x="18" y="30" width="1" height="1" /></bezel>
+
+ <bezel name="10.0" element="led"><bounds x="20" y="0" width="1" height="1" /></bezel>
+ <bezel name="10.1" element="led"><bounds x="20" y="2" width="1" height="1" /></bezel>
+ <bezel name="10.2" element="led"><bounds x="20" y="4" width="1" height="1" /></bezel>
+ <bezel name="10.3" element="led"><bounds x="20" y="6" width="1" height="1" /></bezel>
+ <bezel name="10.4" element="led"><bounds x="20" y="8" width="1" height="1" /></bezel>
+ <bezel name="10.5" element="led"><bounds x="20" y="10" width="1" height="1" /></bezel>
+ <bezel name="10.6" element="led"><bounds x="20" y="12" width="1" height="1" /></bezel>
+ <bezel name="10.7" element="led"><bounds x="20" y="14" width="1" height="1" /></bezel>
+ <bezel name="10.8" element="led"><bounds x="20" y="16" width="1" height="1" /></bezel>
+ <bezel name="10.9" element="led"><bounds x="20" y="18" width="1" height="1" /></bezel>
+ <bezel name="10.10" element="led"><bounds x="20" y="20" width="1" height="1" /></bezel>
+ <bezel name="10.11" element="led"><bounds x="20" y="22" width="1" height="1" /></bezel>
+ <bezel name="10.12" element="led"><bounds x="20" y="24" width="1" height="1" /></bezel>
+ <bezel name="10.13" element="led"><bounds x="20" y="26" width="1" height="1" /></bezel>
+ <bezel name="10.14" element="led"><bounds x="20" y="28" width="1" height="1" /></bezel>
+ <bezel name="10.15" element="led"><bounds x="20" y="30" width="1" height="1" /></bezel>
+
+ <bezel name="11.0" element="led"><bounds x="22" y="0" width="1" height="1" /></bezel>
+ <bezel name="11.1" element="led"><bounds x="22" y="2" width="1" height="1" /></bezel>
+ <bezel name="11.2" element="led"><bounds x="22" y="4" width="1" height="1" /></bezel>
+ <bezel name="11.3" element="led"><bounds x="22" y="6" width="1" height="1" /></bezel>
+ <bezel name="11.4" element="led"><bounds x="22" y="8" width="1" height="1" /></bezel>
+ <bezel name="11.5" element="led"><bounds x="22" y="10" width="1" height="1" /></bezel>
+ <bezel name="11.6" element="led"><bounds x="22" y="12" width="1" height="1" /></bezel>
+ <bezel name="11.7" element="led"><bounds x="22" y="14" width="1" height="1" /></bezel>
+ <bezel name="11.8" element="led"><bounds x="22" y="16" width="1" height="1" /></bezel>
+ <bezel name="11.9" element="led"><bounds x="22" y="18" width="1" height="1" /></bezel>
+ <bezel name="11.10" element="led"><bounds x="22" y="20" width="1" height="1" /></bezel>
+ <bezel name="11.11" element="led"><bounds x="22" y="22" width="1" height="1" /></bezel>
+ <bezel name="11.12" element="led"><bounds x="22" y="24" width="1" height="1" /></bezel>
+ <bezel name="11.13" element="led"><bounds x="22" y="26" width="1" height="1" /></bezel>
+ <bezel name="11.14" element="led"><bounds x="22" y="28" width="1" height="1" /></bezel>
+ <bezel name="11.15" element="led"><bounds x="22" y="30" width="1" height="1" /></bezel>
+
+ <bezel name="12.0" element="led"><bounds x="24" y="0" width="1" height="1" /></bezel>
+ <bezel name="12.1" element="led"><bounds x="24" y="2" width="1" height="1" /></bezel>
+ <bezel name="12.2" element="led"><bounds x="24" y="4" width="1" height="1" /></bezel>
+ <bezel name="12.3" element="led"><bounds x="24" y="6" width="1" height="1" /></bezel>
+ <bezel name="12.4" element="led"><bounds x="24" y="8" width="1" height="1" /></bezel>
+ <bezel name="12.5" element="led"><bounds x="24" y="10" width="1" height="1" /></bezel>
+ <bezel name="12.6" element="led"><bounds x="24" y="12" width="1" height="1" /></bezel>
+ <bezel name="12.7" element="led"><bounds x="24" y="14" width="1" height="1" /></bezel>
+ <bezel name="12.8" element="led"><bounds x="24" y="16" width="1" height="1" /></bezel>
+ <bezel name="12.9" element="led"><bounds x="24" y="18" width="1" height="1" /></bezel>
+ <bezel name="12.10" element="led"><bounds x="24" y="20" width="1" height="1" /></bezel>
+ <bezel name="12.11" element="led"><bounds x="24" y="22" width="1" height="1" /></bezel>
+ <bezel name="12.12" element="led"><bounds x="24" y="24" width="1" height="1" /></bezel>
+ <bezel name="12.13" element="led"><bounds x="24" y="26" width="1" height="1" /></bezel>
+ <bezel name="12.14" element="led"><bounds x="24" y="28" width="1" height="1" /></bezel>
+ <bezel name="12.15" element="led"><bounds x="24" y="30" width="1" height="1" /></bezel>
+
+ <bezel name="13.0" element="led"><bounds x="26" y="0" width="1" height="1" /></bezel>
+ <bezel name="13.1" element="led"><bounds x="26" y="2" width="1" height="1" /></bezel>
+ <bezel name="13.2" element="led"><bounds x="26" y="4" width="1" height="1" /></bezel>
+ <bezel name="13.3" element="led"><bounds x="26" y="6" width="1" height="1" /></bezel>
+ <bezel name="13.4" element="led"><bounds x="26" y="8" width="1" height="1" /></bezel>
+ <bezel name="13.5" element="led"><bounds x="26" y="10" width="1" height="1" /></bezel>
+ <bezel name="13.6" element="led"><bounds x="26" y="12" width="1" height="1" /></bezel>
+ <bezel name="13.7" element="led"><bounds x="26" y="14" width="1" height="1" /></bezel>
+ <bezel name="13.8" element="led"><bounds x="26" y="16" width="1" height="1" /></bezel>
+ <bezel name="13.9" element="led"><bounds x="26" y="18" width="1" height="1" /></bezel>
+ <bezel name="13.10" element="led"><bounds x="26" y="20" width="1" height="1" /></bezel>
+ <bezel name="13.11" element="led"><bounds x="26" y="22" width="1" height="1" /></bezel>
+ <bezel name="13.12" element="led"><bounds x="26" y="24" width="1" height="1" /></bezel>
+ <bezel name="13.13" element="led"><bounds x="26" y="26" width="1" height="1" /></bezel>
+ <bezel name="13.14" element="led"><bounds x="26" y="28" width="1" height="1" /></bezel>
+ <bezel name="13.15" element="led"><bounds x="26" y="30" width="1" height="1" /></bezel>
+
+ <bezel name="14.0" element="led"><bounds x="28" y="0" width="1" height="1" /></bezel>
+ <bezel name="14.1" element="led"><bounds x="28" y="2" width="1" height="1" /></bezel>
+ <bezel name="14.2" element="led"><bounds x="28" y="4" width="1" height="1" /></bezel>
+ <bezel name="14.3" element="led"><bounds x="28" y="6" width="1" height="1" /></bezel>
+ <bezel name="14.4" element="led"><bounds x="28" y="8" width="1" height="1" /></bezel>
+ <bezel name="14.5" element="led"><bounds x="28" y="10" width="1" height="1" /></bezel>
+ <bezel name="14.6" element="led"><bounds x="28" y="12" width="1" height="1" /></bezel>
+ <bezel name="14.7" element="led"><bounds x="28" y="14" width="1" height="1" /></bezel>
+ <bezel name="14.8" element="led"><bounds x="28" y="16" width="1" height="1" /></bezel>
+ <bezel name="14.9" element="led"><bounds x="28" y="18" width="1" height="1" /></bezel>
+ <bezel name="14.10" element="led"><bounds x="28" y="20" width="1" height="1" /></bezel>
+ <bezel name="14.11" element="led"><bounds x="28" y="22" width="1" height="1" /></bezel>
+ <bezel name="14.12" element="led"><bounds x="28" y="24" width="1" height="1" /></bezel>
+ <bezel name="14.13" element="led"><bounds x="28" y="26" width="1" height="1" /></bezel>
+ <bezel name="14.14" element="led"><bounds x="28" y="28" width="1" height="1" /></bezel>
+ <bezel name="14.15" element="led"><bounds x="28" y="30" width="1" height="1" /></bezel>
+
+ <bezel name="15.0" element="led"><bounds x="30" y="0" width="1" height="1" /></bezel>
+ <bezel name="15.1" element="led"><bounds x="30" y="2" width="1" height="1" /></bezel>
+ <bezel name="15.2" element="led"><bounds x="30" y="4" width="1" height="1" /></bezel>
+ <bezel name="15.3" element="led"><bounds x="30" y="6" width="1" height="1" /></bezel>
+ <bezel name="15.4" element="led"><bounds x="30" y="8" width="1" height="1" /></bezel>
+ <bezel name="15.5" element="led"><bounds x="30" y="10" width="1" height="1" /></bezel>
+ <bezel name="15.6" element="led"><bounds x="30" y="12" width="1" height="1" /></bezel>
+ <bezel name="15.7" element="led"><bounds x="30" y="14" width="1" height="1" /></bezel>
+ <bezel name="15.8" element="led"><bounds x="30" y="16" width="1" height="1" /></bezel>
+ <bezel name="15.9" element="led"><bounds x="30" y="18" width="1" height="1" /></bezel>
+ <bezel name="15.10" element="led"><bounds x="30" y="20" width="1" height="1" /></bezel>
+ <bezel name="15.11" element="led"><bounds x="30" y="22" width="1" height="1" /></bezel>
+ <bezel name="15.12" element="led"><bounds x="30" y="24" width="1" height="1" /></bezel>
+ <bezel name="15.13" element="led"><bounds x="30" y="26" width="1" height="1" /></bezel>
+ <bezel name="15.14" element="led"><bounds x="30" y="28" width="1" height="1" /></bezel>
+ <bezel name="15.15" element="led"><bounds x="30" y="30" width="1" height="1" /></bezel>
+
+
+ </view>
+</mamelayout>
diff --git a/src/mess/layout/tbreakup.lay b/src/mess/layout/tbreakup.lay
new file mode 100644
index 00000000000..f203a23fee9
--- /dev/null
+++ b/src/mess/layout/tbreakup.lay
@@ -0,0 +1,131 @@
+<?xml version="1.0"?>
+<mamelayout version="2">
+
+<!-- define elements -->
+
+ <element name="static_black"><rect><color red="0.0" green="0.0" blue="0.0" /></rect></element>
+ <element name="static_black2"><rect><color red="0.05" green="0.01" blue="0.012" /></rect></element>
+ <element name="static_white"><rect><color red="0.7" green="0.7" blue="0.7" /></rect></element>
+ <element name="static_red"><rect><color red="0.75" green="0.17" blue="0.17" /></rect></element>
+
+ <element name="text_score">
+ <rect><color red="0.0" green="0.0" blue="0.0" /></rect>
+ <text string="SCORE"><color red="0.75" green="0.75" blue="0.75" /></text>
+ </element>
+ <element name="text_hit">
+ <rect><color red="0.0" green="0.0" blue="0.0" /></rect>
+ <text string="HIT"><color red="0.75" green="0.75" blue="0.75" /></text>
+ </element>
+ <element name="text_out">
+ <rect><color red="0.0" green="0.0" blue="0.0" /></rect>
+ <text string="OUT"><color red="0.75" green="0.75" blue="0.75" /></text>
+ </element>
+
+ <element name="digit" defstate="0">
+ <led7seg><color red="1.0" green="0.27" blue="0.28" /></led7seg>
+ </element>
+
+ <element name="led" defstate="0">
+ <disk state="0"><color red="0.1" green="0.02" blue="0.023" /></disk>
+ <disk state="1"><color red="1.0" green="0.2" blue="0.23" /></disk>
+ </element>
+ <element name="brick" defstate="0">
+ <rect state="0"><color red="0.25" green="0.075" blue="0.0775" /></rect>
+ <rect state="1"><color red="1.0" green="0.3" blue="0.31" /></rect>
+ </element>
+
+
+<!-- build screen -->
+
+ <view name="Internal Layout">
+ <bounds left="6.5" right="37.1" top="35" bottom="82" />
+ <bezel element="static_black">
+ <bounds left="6.5" right="37.1" top="35" bottom="82" />
+ </bezel>
+
+ <!-- score panel -->
+
+ <bezel element="static_white"><bounds x="27.8" y="36.2" width="7.8" height="6.9" /></bezel>
+ <bezel element="static_black"><bounds x="28" y="36.4" width="7.4" height="6.5" /></bezel>
+ <bezel element="text_score"><bounds x="29.6" y="35.7" width="4.2" height="1.1" /></bezel>
+
+ <bezel name="digit0" element="digit"><bounds x="28.7" y="37.4" width="3" height="4.5" /></bezel>
+ <bezel name="digit1" element="digit"><bounds x="31.7" y="37.4" width="3" height="4.5" /></bezel>
+
+
+ <!-- main bezel -->
+
+ <bezel element="static_white"><bounds x="18.8" y="80.8" width="6" height="0.45" /></bezel>
+ <bezel element="text_out"><bounds x="20.3" y="80.5" width="3" height="1.1" /></bezel>
+ <bezel element="text_hit"><bounds x="20.3" y="77.2" width="3" height="1.1" /></bezel>
+
+ <bezel element="static_white"><bounds x="10.1" y="50" width="23.4" height="27" /></bezel>
+ <bezel element="static_black2"><bounds x="10.3" y="50.2" width="23" height="26.6" /></bezel>
+ <bezel element="static_red"><bounds x="20.3" y="76.675" width="3" height="0.45" /></bezel>
+
+ <bezel element="static_white"><bounds x="8" y="47.5" width="27.6" height="8" /></bezel>
+ <bezel element="static_black2"><bounds x="8.2" y="47.7" width="27.2" height="7.6" /></bezel>
+
+
+ <!-- rect leds panel -->
+
+ <bezel name="lamp90" element="brick"><bounds x="10" y="50" width="2.6" height="1.2" /></bezel>
+ <bezel name="lamp91" element="brick"><bounds x="13" y="50" width="2.6" height="1.2" /></bezel>
+ <bezel name="lamp92" element="brick"><bounds x="16" y="50" width="2.6" height="1.2" /></bezel>
+ <bezel name="lamp93" element="brick"><bounds x="19" y="50" width="2.6" height="1.2" /></bezel>
+ <bezel name="lamp110" element="brick"><bounds x="22" y="50" width="2.6" height="1.2" /></bezel>
+ <bezel name="lamp111" element="brick"><bounds x="25" y="50" width="2.6" height="1.2" /></bezel>
+ <bezel name="lamp112" element="brick"><bounds x="28" y="50" width="2.6" height="1.2" /></bezel>
+ <bezel name="lamp113" element="brick"><bounds x="31" y="50" width="2.6" height="1.2" /></bezel>
+
+ <bezel name="lamp80" element="brick"><bounds x="10" y="51.5" width="2.6" height="1.2" /></bezel>
+ <bezel name="lamp81" element="brick"><bounds x="13" y="51.5" width="2.6" height="1.2" /></bezel>
+ <bezel name="lamp82" element="brick"><bounds x="16" y="51.5" width="2.6" height="1.2" /></bezel>
+ <bezel name="lamp83" element="brick"><bounds x="19" y="51.5" width="2.6" height="1.2" /></bezel>
+ <bezel name="lamp130" element="brick"><bounds x="22" y="51.5" width="2.6" height="1.2" /></bezel>
+ <bezel name="lamp131" element="brick"><bounds x="25" y="51.5" width="2.6" height="1.2" /></bezel>
+ <bezel name="lamp132" element="brick"><bounds x="28" y="51.5" width="2.6" height="1.2" /></bezel>
+ <bezel name="lamp133" element="brick"><bounds x="31" y="51.5" width="2.6" height="1.2" /></bezel>
+
+ <bezel name="lamp100" element="brick"><bounds x="10" y="53" width="2.6" height="1.2" /></bezel>
+ <bezel name="lamp101" element="brick"><bounds x="13" y="53" width="2.6" height="1.2" /></bezel>
+ <bezel name="lamp102" element="brick"><bounds x="16" y="53" width="2.6" height="1.2" /></bezel>
+ <bezel name="lamp103" element="brick"><bounds x="19" y="53" width="2.6" height="1.2" /></bezel>
+ <bezel name="lamp120" element="brick"><bounds x="22" y="53" width="2.6" height="1.2" /></bezel>
+ <bezel name="lamp121" element="brick"><bounds x="25" y="53" width="2.6" height="1.2" /></bezel>
+ <bezel name="lamp122" element="brick"><bounds x="28" y="53" width="2.6" height="1.2" /></bezel>
+ <bezel name="lamp123" element="brick"><bounds x="31" y="53" width="2.6" height="1.2" /></bezel>
+
+
+ <!-- round leds -->
+
+ <bezel name="lamp70" element="led"><bounds x="12.3" y="48" width="1" height="1" /></bezel>
+ <bezel name="lamp71" element="led"><bounds x="18.3" y="48" width="1" height="1" /></bezel>
+ <bezel name="lamp72" element="led"><bounds x="24.3" y="48" width="1" height="1" /></bezel>
+ <bezel name="lamp73" element="led"><bounds x="30.3" y="48" width="1" height="1" /></bezel>
+
+ <bezel name="lamp40" element="led"><bounds x="10.6" y="61" width="1" height="1" /></bezel>
+ <bezel name="lamp60" element="led"><bounds x="14.6" y="58" width="1" height="1" /></bezel>
+ <bezel name="lamp61" element="led"><bounds x="18.3" y="56.5" width="1" height="1" /></bezel>
+ <bezel name="lamp62" element="led"><bounds x="24.3" y="56.5" width="1" height="1" /></bezel>
+ <bezel name="lamp63" element="led"><bounds x="28" y="58" width="1" height="1" /></bezel>
+ <bezel name="lamp43" element="led"><bounds x="32" y="61" width="1" height="1" /></bezel>
+
+ <bezel name="lamp30" element="led"><bounds x="10.6" y="68" width="1" height="1" /></bezel>
+ <bezel name="lamp50" element="led"><bounds x="16.5" y="63.5" width="1" height="1" /></bezel>
+ <bezel name="lamp51" element="led"><bounds x="18.7" y="61.8" width="1" height="1" /></bezel>
+ <bezel name="lamp52" element="led"><bounds x="23.9" y="61.8" width="1" height="1" /></bezel>
+ <bezel name="lamp53" element="led"><bounds x="26.1" y="63.5" width="1" height="1" /></bezel>
+ <bezel name="lamp33" element="led"><bounds x="32" y="68" width="1" height="1" /></bezel>
+
+ <bezel name="lamp41" element="led"><bounds x="15.1" y="70.7" width="1" height="1" /></bezel>
+ <bezel name="lamp31" element="led"><bounds x="19.2" y="68.8" width="1" height="1" /></bezel>
+ <bezel name="lamp32" element="led"><bounds x="23.4" y="68.8" width="1" height="1" /></bezel>
+ <bezel name="lamp42" element="led"><bounds x="27.5" y="70.7" width="1" height="1" /></bezel>
+
+ <bezel name="lamp21" element="led"><bounds x="21.3" y="75.5" width="1" height="1" /></bezel>
+ <bezel name="lamp22" element="led"><bounds x="21.3" y="79.3" width="1" height="1" /></bezel>
+
+
+ </view>
+</mamelayout>
diff --git a/src/mess/machine/amstrad.c b/src/mess/machine/amstrad.c
index 9f490d13b43..b673b2040d1 100644
--- a/src/mess/machine/amstrad.c
+++ b/src/mess/machine/amstrad.c
@@ -1901,22 +1901,25 @@ The exception is the case where none of b7-b0 are reset (i.e. port &FBFF), which
*/
if ( m_system_type != SYSTEM_GX4000 )
{
- if ( ( offset & (1<<10) ) == 0 )
+ if(m_fdc) // if FDC is present (it isn't on a 464)
{
if ( ( offset & (1<<10) ) == 0 )
{
- int b8b0 = ( ( offset & (1<<8) ) >> (8 - 1) ) | ( offset & 0x01 );
-
- switch (b8b0)
+ if ( ( offset & (1<<10) ) == 0 )
{
- case 0x02:
- data = m_fdc->msr_r(space, 0);
- break;
- case 0x03:
- data = m_fdc->fifo_r(space, 0);
- break;
- default:
- break;
+ int b8b0 = ( ( offset & (1<<8) ) >> (8 - 1) ) | ( offset & 0x01 );
+
+ switch (b8b0)
+ {
+ case 0x02:
+ data = m_fdc->msr_r(space, 0);
+ break;
+ case 0x03:
+ data = m_fdc->fifo_r(space, 0);
+ break;
+ default:
+ break;
+ }
}
}
}
@@ -2094,34 +2097,37 @@ The exception is the case where none of b7-b0 are reset (i.e. port &FBFF), which
*/
if(m_system_type != SYSTEM_GX4000)
{
- if ((offset & (1<<7)) == 0)
- {
- unsigned int b8b0 = ((offset & 0x0100) >> (8 - 1)) | (offset & 0x01);
-
- switch (b8b0)
+ if(m_fdc) // if FDC is present (it isn't on a 464)
+ {
+ if ((offset & (1<<7)) == 0)
{
- case 0x00:
- case 0x01:
+ unsigned int b8b0 = ((offset & 0x0100) >> (8 - 1)) | (offset & 0x01);
+
+ switch (b8b0)
{
- /* FDC Motor Control - Bit 0 defines the state of the FDD motor:
- * "1" the FDD motor will be active.
- * "0" the FDD motor will be in-active.*/
- floppy_image_device *floppy;
- floppy = machine().device<floppy_connector>(":upd765:0")->get_device();
- if(floppy)
- floppy->mon_w(!BIT(data, 0));
- floppy = machine().device<floppy_connector>(":upd765:1")->get_device();
- if(floppy)
- floppy->mon_w(!BIT(data, 0));
- break;
- }
+ case 0x00:
+ case 0x01:
+ {
+ /* FDC Motor Control - Bit 0 defines the state of the FDD motor:
+ * "1" the FDD motor will be active.
+ * "0" the FDD motor will be in-active.*/
+ floppy_image_device *floppy;
+ floppy = machine().device<floppy_connector>(":upd765:0")->get_device();
+ if(floppy)
+ floppy->mon_w(!BIT(data, 0));
+ floppy = machine().device<floppy_connector>(":upd765:1")->get_device();
+ if(floppy)
+ floppy->mon_w(!BIT(data, 0));
+ break;
+ }
- case 0x03: /* Write Data register of FDC */
- m_fdc->fifo_w(space, 0,data);
- break;
+ case 0x03: /* Write Data register of FDC */
+ m_fdc->fifo_w(space, 0,data);
+ break;
- default:
- break;
+ default:
+ break;
+ }
}
}
}
diff --git a/src/mess/machine/apollo_kbd.c b/src/mess/machine/apollo_kbd.c
index 5dc6d468f7b..79fc99c1ad3 100644
--- a/src/mess/machine/apollo_kbd.c
+++ b/src/mess/machine/apollo_kbd.c
@@ -251,10 +251,10 @@ void apollo_kbd_device::mouse::read_mouse()
int y = m_device->m_io_mouse3->read();
/* sign extend values < 0 */
- if (x & 0x800)
- x |= 0xfffff000;
- if (y & 0x800)
- y |= 0xfffff000;
+ if (x & 0x80)
+ x |= 0xffffff00;
+ if (y & 0x80)
+ y |= 0xffffff00;
y = -y;
if (m_last_b < 0)
@@ -271,10 +271,6 @@ void apollo_kbd_device::mouse::read_mouse()
int dx = x - m_last_x;
int dy = y - m_last_y;
- // slow down huge mouse movements
- dx = dx > 50 ? 50 : dx < -50 ? -50 : dx;
- dy = dy > 50 ? 50 : dy < -50 ? -50 : dy;
-
LOG2(("read_mouse: b=%02x x=%d y=%d dx=%d dy=%d", b, x, y, dx, dy));
if (m_device->m_mode == KBD_MODE_0_COMPATIBILITY)
@@ -982,9 +978,9 @@ INPUT_PORTS_START( apollo_kbd )
PORT_BIT( 0x00000040, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Center mouse button") PORT_CODE(MOUSECODE_BUTTON2)
PORT_START("mouse2") // X-axis
- PORT_BIT( 0xfff, 0x00, IPT_MOUSE_X) PORT_SENSITIVITY(200) PORT_KEYDELTA(1) PORT_PLAYER(1) PORT_CODE_DEC(INPUT_CODE_INVALID) PORT_CODE_INC(INPUT_CODE_INVALID)
+ PORT_BIT( 0xff, 0x00, IPT_MOUSE_X) PORT_SENSITIVITY(200) PORT_KEYDELTA(0) PORT_PLAYER(1)
PORT_START("mouse3") // Y-axis
- PORT_BIT( 0xfff, 0x00, IPT_MOUSE_Y) PORT_SENSITIVITY(200) PORT_KEYDELTA(1) PORT_PLAYER(1) PORT_CODE_DEC(INPUT_CODE_INVALID) PORT_CODE_INC(INPUT_CODE_INVALID)
+ PORT_BIT( 0xff, 0x00, IPT_MOUSE_Y) PORT_SENSITIVITY(200) PORT_KEYDELTA(0) PORT_PLAYER(1)
INPUT_PORTS_END
diff --git a/src/mess/machine/apple2gs.c b/src/mess/machine/apple2gs.c
index b432920450d..537375b17cc 100644
--- a/src/mess/machine/apple2gs.c
+++ b/src/mess/machine/apple2gs.c
@@ -1772,42 +1772,6 @@ void apple2gs_state::apple2gs_xxCxxx_w(address_space &space, offs_t address, UIN
-DIRECT_UPDATE_MEMBER(apple2gs_state::apple2gs_opbase)
-{
- UINT8 *opptr = NULL;
- int slot;
-
- if (((address & 0xFEF000) == 0x00C000) || ((address & 0xFEF000) == 0xE0C000))
- {
- if ((m_shadow & 0x40) && ((address & 0xF00000) == 0x000000))
- {
- opptr = &m_ram->pointer()[address];
- }
- else if ((address & 0x000F00) == 0x000000)
- {
- if (((address & 0xFF) >= 0x71) && ((address & 0xFF) <= 0x7F))
- opptr = apple2gs_getslotmem(address);
- }
- else
- {
- slot = (address & 0x000F00) / 0x100;
-
- if ((slot > 7) || ((m_sltromsel & (1 << slot)) == 0))
- opptr = apple2gs_getslotmem(address);
- }
-
- if (opptr != NULL)
- {
- direct.explicit_configure(address, address, ~0, opptr - address);
-
- address = ~0;
- }
- }
- return address;
-}
-
-
-
READ8_MEMBER( apple2gs_state::apple2gs_00Cxxx_r ) { return apple2gs_xxCxxx_r(space, offset | 0x00C000); }
READ8_MEMBER( apple2gs_state::apple2gs_01Cxxx_r ) { return apple2gs_xxCxxx_r(space, offset | 0x01C000); }
READ8_MEMBER( apple2gs_state::apple2gs_E0Cxxx_r ) { return apple2gs_xxCxxx_r(space, offset | 0xE0C000); }
@@ -1910,7 +1874,6 @@ void apple2gs_state::apple2gs_setup_memory()
space.install_write_handler(0xe0c000, 0xe0cfff, write8_delegate(FUNC(apple2gs_state::apple2gs_E0Cxxx_w),this));
space.install_read_handler(0xe1c000, 0xe1cfff, read8_delegate(FUNC(apple2gs_state::apple2gs_E1Cxxx_r),this));
space.install_write_handler(0xe1c000, 0xe1cfff, write8_delegate(FUNC(apple2gs_state::apple2gs_E1Cxxx_w),this));
- space.set_direct_update_handler(direct_update_delegate(FUNC(apple2gs_state::apple2gs_opbase), this));
/* install aux memory writes (for shadowing) */
diff --git a/src/mess/machine/applefdc.c b/src/mess/machine/applefdc.c
index cf9b08b206b..dac524308ba 100644
--- a/src/mess/machine/applefdc.c
+++ b/src/mess/machine/applefdc.c
@@ -1,5 +1,5 @@
// license:BSD-3-Clause
-// copyright-holders:R. Belmont
+// copyright-holders:Nathan Woods, Raphael Nabet, R. Belmont
/*********************************************************************
applefdc.c
diff --git a/src/mess/machine/applefdc.h b/src/mess/machine/applefdc.h
index cd132a8e00a..38efb9036d2 100644
--- a/src/mess/machine/applefdc.h
+++ b/src/mess/machine/applefdc.h
@@ -1,5 +1,5 @@
// license:BSD-3-Clause
-// copyright-holders:R. Belmont
+// copyright-holders:Nathan Woods, Raphael Nabet, R. Belmont
/*********************************************************************
applefdc.h
diff --git a/src/mess/machine/apricotkb.c b/src/mess/machine/apricotkb.c
index a2520442d3e..6ceb0d6ba4d 100644
--- a/src/mess/machine/apricotkb.c
+++ b/src/mess/machine/apricotkb.c
@@ -1,5 +1,5 @@
-// license:GPL-2.0+
-// copyright-holders:Dirk Best
+// license:BSD-3-Clause
+// copyright-holders:Curt Coder
/**********************************************************************
Apricot keyboard emulation
diff --git a/src/mess/machine/apricotkb.h b/src/mess/machine/apricotkb.h
index b85dab77dcf..7b3d20a7a48 100644
--- a/src/mess/machine/apricotkb.h
+++ b/src/mess/machine/apricotkb.h
@@ -1,5 +1,5 @@
-// license:GPL-2.0+
-// copyright-holders:Dirk Best
+// license:BSD-3-Clause
+// copyright-holders:Curt Coder
/**********************************************************************
Apricot keyboard emulation
diff --git a/src/mess/machine/apricotkb_hle.c b/src/mess/machine/apricotkb_hle.c
new file mode 100644
index 00000000000..6950033c79f
--- /dev/null
+++ b/src/mess/machine/apricotkb_hle.c
@@ -0,0 +1,286 @@
+// license:GPL-2.0+
+// copyright-holders:Dirk Best
+/***************************************************************************
+
+ ACT Apricot Keyboard (HLE)
+
+ Keyboard to System:
+ - 01-60: Key make codes
+ - 70-7f: Mouse codes
+ - 80: RAM test failed
+ - 81-e0: Key break codes
+ - e9: ROM test failed
+ - ea: X-on (keyboard ready to receive)
+ - eb: X-off (keyboard buffer full)
+ - ec: Reset request
+ - ed: Time prefix
+ - ee: Date prefix
+ - ef: Mouse header
+ - f0-f9: BCD data
+ - fa: Invalid clock data
+ - fb: Acknowledge firmware version/reset
+
+ System to keyboard:
+ - 01-7f: Character codes for MicroScreen
+ - 80-cf: Cursor address
+ - d0: Clear screen
+ - d1: Cursor left
+ - d2: Cursor right
+ - d3: Cursor on
+ - d4: Cursor off
+ - d5: Display on
+ - d6: Display off
+ - e0: Query
+ - e1: Time and date request
+ - e2: Display time/data on MicroScreen
+ - e3: Set LED prefix
+ - e4: Set time and date
+ - e5: Mouse enable
+ - e6: Mouse disable
+ - e7: Execute processor diagnostics
+ - e8: Keyboard reset
+ - f0-f9: BCD data
+ - fa: Invalid clock data
+
+***************************************************************************/
+
+#include "apricotkb_hle.h"
+
+
+//**************************************************************************
+// CONSTANTS / MACROS
+//**************************************************************************
+
+#define APRICOT_KEY(_key, _index) \
+ PORT_BIT(1 << _key, IP_ACTIVE_HIGH, IPT_KEYBOARD) \
+ PORT_CHANGED_MEMBER(DEVICE_SELF, apricot_keyboard_hle_device, key_callback, (void *) _index)
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+const device_type APRICOT_KEYBOARD_HLE = &device_creator<apricot_keyboard_hle_device>;
+
+
+//-------------------------------------------------
+// input_ports - device-specific input ports
+//-------------------------------------------------
+
+static INPUT_PORTS_START( keyboard )
+ PORT_START("keyboard_0")
+ PORT_BIT(1 << 0, IP_ACTIVE_HIGH, IPT_UNUSED)
+ APRICOT_KEY( 1, 0) PORT_CODE(KEYCODE_F7) PORT_CHAR(UCHAR_MAMEKEY(F7)) PORT_NAME("Help")
+ APRICOT_KEY( 2, 0) PORT_CODE(KEYCODE_F8) PORT_CHAR(UCHAR_MAMEKEY(F8)) PORT_NAME("Undo")
+ APRICOT_KEY( 3, 0) PORT_CODE(KEYCODE_F9) PORT_CHAR(UCHAR_MAMEKEY(F9)) PORT_NAME("Repeat")
+ APRICOT_KEY( 4, 0) PORT_CODE(KEYCODE_F10) PORT_CHAR(UCHAR_MAMEKEY(F10)) PORT_NAME("Calc")
+ APRICOT_KEY( 5, 0) PORT_CODE(KEYCODE_PRTSCR) PORT_CHAR(UCHAR_MAMEKEY(PRTSCR)) PORT_NAME("Print")
+ APRICOT_KEY( 6, 0) PORT_CODE(KEYCODE_CANCEL) PORT_CHAR(UCHAR_MAMEKEY(CANCEL)) PORT_NAME("Intr")
+ APRICOT_KEY( 7, 0) PORT_CODE(KEYCODE_F11) PORT_CHAR(UCHAR_MAMEKEY(F11)) PORT_NAME("Menu")
+ APRICOT_KEY( 8, 0) PORT_CODE(KEYCODE_F12) PORT_CHAR(UCHAR_MAMEKEY(F12)) PORT_NAME("Finish")
+ APRICOT_KEY( 9, 0) PORT_CODE(KEYCODE_F1) PORT_CHAR(UCHAR_MAMEKEY(F1)) PORT_NAME("Function 1")
+ APRICOT_KEY(10, 0) PORT_CODE(KEYCODE_F2) PORT_CHAR(UCHAR_MAMEKEY(F2)) PORT_NAME("Function 2")
+ APRICOT_KEY(11, 0) PORT_CODE(KEYCODE_F3) PORT_CHAR(UCHAR_MAMEKEY(F3)) PORT_NAME("Function 3")
+ APRICOT_KEY(12, 0) PORT_CODE(KEYCODE_F4) PORT_CHAR(UCHAR_MAMEKEY(F4)) PORT_NAME("Function 4")
+ APRICOT_KEY(13, 0) PORT_CODE(KEYCODE_F5) PORT_CHAR(UCHAR_MAMEKEY(F5)) PORT_NAME("Function 5")
+ APRICOT_KEY(14, 0) PORT_CODE(KEYCODE_F6) PORT_CHAR(UCHAR_MAMEKEY(F6)) PORT_NAME("Function 6")
+ APRICOT_KEY(15, 0) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('\\') PORT_CHAR('^')
+ APRICOT_KEY(16, 0) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!')
+ APRICOT_KEY(17, 0) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('@')
+ APRICOT_KEY(18, 0) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#')
+ APRICOT_KEY(19, 0) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR(0xa3) // pound
+ APRICOT_KEY(20, 0) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%')
+ APRICOT_KEY(21, 0) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('$')
+ APRICOT_KEY(22, 0) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('&')
+ APRICOT_KEY(23, 0) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('*')
+ APRICOT_KEY(24, 0) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR('(')
+ APRICOT_KEY(25, 0) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR(')')
+ APRICOT_KEY(26, 0) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('_')
+ APRICOT_KEY(27, 0) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('=') PORT_CHAR('+')
+ APRICOT_KEY(28, 0) PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(9)
+ PORT_BIT(1 << 29, IP_ACTIVE_HIGH, IPT_UNUSED) // actually a dedicated % key
+ APRICOT_KEY(30, 0) PORT_CODE(KEYCODE_ASTERISK) PORT_CHAR(UCHAR_MAMEKEY(ASTERISK))
+ APRICOT_KEY(31, 0) PORT_CODE(KEYCODE_SLASH_PAD) PORT_CHAR(UCHAR_MAMEKEY(SLASH_PAD))
+
+ PORT_START("keyboard_1")
+ APRICOT_KEY( 0, 1) PORT_CODE(KEYCODE_MINUS_PAD) PORT_CHAR(UCHAR_MAMEKEY(MINUS_PAD))
+ APRICOT_KEY( 1, 1) PORT_CODE(KEYCODE_PLUS_PAD) PORT_CHAR(UCHAR_MAMEKEY(PLUS_PAD))
+ APRICOT_KEY( 2, 1) PORT_CODE(KEYCODE_TAB) PORT_CHAR(9)
+ APRICOT_KEY( 3, 1) PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q')
+ APRICOT_KEY( 4, 1) PORT_CODE(KEYCODE_W) PORT_CHAR('w') PORT_CHAR('W')
+ APRICOT_KEY( 5, 1) PORT_CODE(KEYCODE_E) PORT_CHAR('e') PORT_CHAR('E')
+ APRICOT_KEY( 6, 1) PORT_CODE(KEYCODE_R) PORT_CHAR('r') PORT_CHAR('R')
+ APRICOT_KEY( 7, 1) PORT_CODE(KEYCODE_T) PORT_CHAR('t') PORT_CHAR('T')
+ APRICOT_KEY( 8, 1) PORT_CODE(KEYCODE_Y) PORT_CHAR('y') PORT_CHAR('Y')
+ APRICOT_KEY( 9, 1) PORT_CODE(KEYCODE_U) PORT_CHAR('u') PORT_CHAR('U')
+ APRICOT_KEY(10, 1) PORT_CODE(KEYCODE_I) PORT_CHAR('i') PORT_CHAR('I')
+ APRICOT_KEY(11, 1) PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O')
+ APRICOT_KEY(12, 1) PORT_CODE(KEYCODE_P) PORT_CHAR('p') PORT_CHAR('P')
+ APRICOT_KEY(13, 1) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[') PORT_CHAR('{')
+ APRICOT_KEY(14, 1) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(']') PORT_CHAR('}')
+ APRICOT_KEY(15, 1) PORT_CODE(KEYCODE_HOME) PORT_CHAR(UCHAR_MAMEKEY(HOME))
+ APRICOT_KEY(16, 1) PORT_CODE(KEYCODE_END) PORT_CHAR(UCHAR_MAMEKEY(END)) PORT_NAME("Clear")
+ APRICOT_KEY(17, 1) PORT_CODE(KEYCODE_7_PAD) PORT_CHAR(UCHAR_MAMEKEY(7_PAD))
+ APRICOT_KEY(18, 1) PORT_CODE(KEYCODE_8_PAD) PORT_CHAR(UCHAR_MAMEKEY(8_PAD))
+ APRICOT_KEY(19, 1) PORT_CODE(KEYCODE_9_PAD) PORT_CHAR(UCHAR_MAMEKEY(9_PAD))
+ APRICOT_KEY(20, 1) PORT_CODE(KEYCODE_CAPSLOCK) PORT_CHAR(UCHAR_MAMEKEY(CAPSLOCK))
+ APRICOT_KEY(21, 1) PORT_CODE(KEYCODE_A) PORT_CHAR('a') PORT_CHAR('A')
+ APRICOT_KEY(22, 1) PORT_CODE(KEYCODE_S) PORT_CHAR('s') PORT_CHAR('S')
+ APRICOT_KEY(23, 1) PORT_CODE(KEYCODE_D) PORT_CHAR('d') PORT_CHAR('D')
+ APRICOT_KEY(24, 1) PORT_CODE(KEYCODE_F) PORT_CHAR('f') PORT_CHAR('F')
+ APRICOT_KEY(25, 1) PORT_CODE(KEYCODE_G) PORT_CHAR('g') PORT_CHAR('G')
+ APRICOT_KEY(26, 1) PORT_CODE(KEYCODE_H) PORT_CHAR('h') PORT_CHAR('H')
+ APRICOT_KEY(27, 1) PORT_CODE(KEYCODE_J) PORT_CHAR('j') PORT_CHAR('J')
+ APRICOT_KEY(28, 1) PORT_CODE(KEYCODE_K) PORT_CHAR('k') PORT_CHAR('K')
+ APRICOT_KEY(29, 1) PORT_CODE(KEYCODE_L) PORT_CHAR('l') PORT_CHAR('L')
+ APRICOT_KEY(30, 1) PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR(':')
+ APRICOT_KEY(31, 1) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('\'') PORT_CHAR('"')
+
+ PORT_START("keyboard_2")
+ APRICOT_KEY( 0, 2) PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13)
+ APRICOT_KEY( 1, 2) PORT_CODE(KEYCODE_INSERT) PORT_CHAR(UCHAR_MAMEKEY(INSERT))
+ APRICOT_KEY( 2, 2) PORT_CODE(KEYCODE_DEL) PORT_CHAR(UCHAR_MAMEKEY(DEL))
+ APRICOT_KEY( 3, 2) PORT_CODE(KEYCODE_4_PAD) PORT_CHAR(UCHAR_MAMEKEY(4_PAD))
+ APRICOT_KEY( 4, 2) PORT_CODE(KEYCODE_5_PAD) PORT_CHAR(UCHAR_MAMEKEY(5_PAD))
+ APRICOT_KEY( 5, 2) PORT_CODE(KEYCODE_6_PAD) PORT_CHAR(UCHAR_MAMEKEY(6_PAD))
+ APRICOT_KEY( 6, 2) PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1)
+ APRICOT_KEY( 7, 2) PORT_CODE(KEYCODE_Z) PORT_CHAR('z') PORT_CHAR('Z')
+ APRICOT_KEY( 8, 2) PORT_CODE(KEYCODE_X) PORT_CHAR('x') PORT_CHAR('X')
+ APRICOT_KEY( 9, 2) PORT_CODE(KEYCODE_C) PORT_CHAR('c') PORT_CHAR('C')
+ APRICOT_KEY(10, 2) PORT_CODE(KEYCODE_V) PORT_CHAR('v') PORT_CHAR('V')
+ APRICOT_KEY(11, 2) PORT_CODE(KEYCODE_B) PORT_CHAR('b') PORT_CHAR('B')
+ APRICOT_KEY(12, 2) PORT_CODE(KEYCODE_N) PORT_CHAR('n') PORT_CHAR('N')
+ APRICOT_KEY(13, 2) PORT_CODE(KEYCODE_M) PORT_CHAR('m') PORT_CHAR('M')
+ APRICOT_KEY(14, 2) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<')
+ APRICOT_KEY(15, 2) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>')
+ APRICOT_KEY(16, 2) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?')
+ APRICOT_KEY(17, 2) PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1)
+ APRICOT_KEY(18, 2) PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP))
+ APRICOT_KEY(19, 2) PORT_CODE(KEYCODE_SCRLOCK) PORT_CHAR(UCHAR_MAMEKEY(SCRLOCK))
+ APRICOT_KEY(20, 2) PORT_CODE(KEYCODE_1_PAD) PORT_CHAR(UCHAR_MAMEKEY(1_PAD))
+ APRICOT_KEY(21, 2) PORT_CODE(KEYCODE_2_PAD) PORT_CHAR(UCHAR_MAMEKEY(2_PAD))
+ APRICOT_KEY(22, 2) PORT_CODE(KEYCODE_3_PAD) PORT_CHAR(UCHAR_MAMEKEY(3_PAD))
+ APRICOT_KEY(23, 2) PORT_CODE(KEYCODE_ESC) PORT_CHAR(UCHAR_MAMEKEY(ESC))
+ APRICOT_KEY(24, 2) PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_SHIFT_2)
+ APRICOT_KEY(25, 2) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ')
+ APRICOT_KEY(26, 2) PORT_CODE(KEYCODE_RCONTROL) PORT_CHAR(UCHAR_MAMEKEY(PAUSE)) PORT_NAME("Stop")
+ APRICOT_KEY(27, 2) PORT_CODE(KEYCODE_LEFT) PORT_CHAR(UCHAR_MAMEKEY(LEFT))
+ APRICOT_KEY(28, 2) PORT_CODE(KEYCODE_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN))
+ APRICOT_KEY(29, 2) PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT))
+ APRICOT_KEY(30, 2) PORT_CODE(KEYCODE_0_PAD) PORT_CHAR(UCHAR_MAMEKEY(0_PAD))
+ APRICOT_KEY(31, 2) PORT_CODE(KEYCODE_DEL_PAD) PORT_CHAR(UCHAR_MAMEKEY(DEL_PAD))
+
+ PORT_START("keyboard_3")
+ APRICOT_KEY( 0, 3) PORT_CODE(KEYCODE_ENTER_PAD) PORT_CHAR(UCHAR_MAMEKEY(ENTER_PAD))
+INPUT_PORTS_END
+
+ioport_constructor apricot_keyboard_hle_device::device_input_ports() const
+{
+ return INPUT_PORTS_NAME( keyboard );
+}
+
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// apricot_keyboard_hle_device - constructor
+//-------------------------------------------------
+
+apricot_keyboard_hle_device::apricot_keyboard_hle_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ device_t(mconfig, APRICOT_KEYBOARD_HLE, "Apricot Keyboard (HLE)", tag, owner, clock, "apricotkb_hle", __FILE__),
+ device_serial_interface(mconfig, *this),
+ m_txd_handler(*this),
+ m_rxd(1),
+ m_data_in(0),
+ m_data_out(0)
+{
+}
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void apricot_keyboard_hle_device::device_start()
+{
+ // resolve callbacks
+ m_txd_handler.resolve_safe();
+}
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void apricot_keyboard_hle_device::device_reset()
+{
+ receive_register_reset();
+ transmit_register_reset();
+
+ set_data_frame(1, 8, PARITY_NONE, STOP_BITS_1);
+ set_rcv_rate(7800);
+ set_tra_rate(7800);
+}
+
+//-------------------------------------------------
+// device_timer - device-specific timer
+//-------------------------------------------------
+
+void apricot_keyboard_hle_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
+{
+ device_serial_interface::device_timer(timer, id, param, ptr);
+}
+
+void apricot_keyboard_hle_device::tra_callback()
+{
+ m_txd_handler(transmit_register_get_data_bit());
+}
+
+void apricot_keyboard_hle_device::tra_complete()
+{
+ if (m_data_out != 0)
+ {
+ transmit_register_setup(m_data_out);
+ m_data_out = 0;
+ }
+}
+
+void apricot_keyboard_hle_device::rcv_callback()
+{
+ receive_register_update_bit(m_rxd);
+}
+
+void apricot_keyboard_hle_device::rcv_complete()
+{
+ receive_register_extract();
+ m_data_in = get_received_char();
+
+ // reset command? send keyboard ready (likely needs a delay, just disable for now)
+// if (m_data_in == 0xe8)
+// transmit_register_setup(0xfb);
+}
+
+WRITE_LINE_MEMBER( apricot_keyboard_hle_device::rxd_w )
+{
+ m_rxd = state;
+ device_serial_interface::rx_w(m_rxd);
+}
+
+INPUT_CHANGED_MEMBER( apricot_keyboard_hle_device::key_callback )
+{
+ UINT32 oldvalue = oldval * field.mask(), newvalue = newval * field.mask();
+ UINT32 delta = oldvalue ^ newvalue;
+
+ for (int i = 0; i < 32; i++)
+ {
+ if (delta & (1 << i))
+ {
+ UINT8 down = (newvalue & (1 << i)) ? 0x00 : 0x80;
+ UINT8 scancode = (FPTR) param * 32 + i;
+ scancode |= down;
+ transmit_register_setup(scancode);
+ break;
+ }
+ }
+
+}
diff --git a/src/mess/machine/apricotkb_hle.h b/src/mess/machine/apricotkb_hle.h
new file mode 100644
index 00000000000..e8cea1a516d
--- /dev/null
+++ b/src/mess/machine/apricotkb_hle.h
@@ -0,0 +1,73 @@
+// license:GPL-2.0+
+// copyright-holders:Dirk Best
+/***************************************************************************
+
+ ACT Apricot Keyboard (HLE)
+
+***************************************************************************/
+
+#pragma once
+
+#ifndef __APRICOTKB_HLE__
+#define __APRICOTKB_HLE__
+
+#include "emu.h"
+
+//**************************************************************************
+// INTERFACE CONFIGURATION MACROS
+//**************************************************************************
+
+#define MCFG_APRICOT_KEYBOARD_ADD(_tag) \
+ MCFG_DEVICE_ADD(_tag, APRICOT_KEYBOARD_HLE, 0)
+
+#define MCFG_APRICOT_KEYBOARD_TXD_HANDLER(_write) \
+ devcb = &apricot_keyboard_hle_device::set_txd_handler(*device, DEVCB_##_write);
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> apricot_keyboard_hle_device
+
+class apricot_keyboard_hle_device : public device_t, public device_serial_interface
+{
+public:
+ // construction/destruction
+ apricot_keyboard_hle_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ template<class _Object> static devcb_base &set_txd_handler(device_t &device, _Object object)
+ { return downcast<apricot_keyboard_hle_device &>(device).m_txd_handler.set_callback(object); }
+
+ DECLARE_WRITE_LINE_MEMBER(rxd_w);
+ DECLARE_INPUT_CHANGED_MEMBER(key_callback);
+
+protected:
+ // device_t overrides
+ virtual ioport_constructor device_input_ports() const;
+ virtual void device_start();
+ virtual void device_reset();
+
+ // device_serial_interface overrides
+ virtual void tra_callback();
+ virtual void tra_complete();
+ virtual void rcv_callback();
+ virtual void rcv_complete();
+
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
+
+private:
+ devcb_write_line m_txd_handler;
+
+ int m_rxd;
+
+ UINT8 m_data_in;
+ UINT8 m_data_out;
+};
+
+
+// device type definition
+extern const device_type APRICOT_KEYBOARD_HLE;
+
+
+#endif // __APRICOTKB_HLE__
diff --git a/src/mess/machine/bbc.c b/src/mess/machine/bbc.c
index 1fc4d5c22da..d0a5572540e 100644
--- a/src/mess/machine/bbc.c
+++ b/src/mess/machine/bbc.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Gordon Jefferyes, Nigel Barnes
/******************************************************************************
BBC Model B
diff --git a/src/mess/machine/beta.c b/src/mess/machine/beta.c
index ff7187ba3e3..ef9ec771805 100644
--- a/src/mess/machine/beta.c
+++ b/src/mess/machine/beta.c
@@ -1,5 +1,5 @@
// license:BSD-3-Clause
-// copyright-holders:Curt Coder, MetalliC
+// copyright-holders:Miodrag Milanovic, MetalliC
/*********************************************************************
beta.h
@@ -11,7 +11,7 @@
*********************************************************************/
/*
BUGS:
-- due to original firmware bug random commands can be sent to FDC instead of SEEK, current WD FDC emulation cant handle this correctly, use patch fix for now
+- due to original firmware bug random commands can be sent to FDC instead of SEEK
*/
#include "emu.h"
@@ -182,7 +182,7 @@ static SLOT_INTERFACE_START( beta_disk_floppies )
SLOT_INTERFACE_END
static MACHINE_CONFIG_FRAGMENT( beta_disk )
- MCFG_WD2793x_ADD("wd179x", XTAL_8MHz / 8) // KR1818VG93 clone of WD1793
+ MCFG_KR1818VG93_ADD("wd179x", XTAL_8MHz / 8)
MCFG_FLOPPY_DRIVE_ADD("wd179x:0", beta_disk_floppies, "drive0", beta_disk_device::floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("wd179x:1", beta_disk_floppies, "drive1", beta_disk_device::floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("wd179x:2", beta_disk_floppies, "drive2", beta_disk_device::floppy_formats)
@@ -268,11 +268,6 @@ ROM_START( beta_disk )
//Default for now
ROM_LOAD( "trd503.rom", 0x00000, 0x4000, CRC(10751aba) SHA1(21695e3f2a8f796386ce66eea8a246b0ac44810c))
-
- // TR-DOS rom have a bug - semi-random commands sent to FDC instead of SEEK command sometimes
- // however it works OK on real hardware but does not using our WD FDC emulation, both legacy and modern
- // this patch fixes original bug
- ROM_FILL( 0x3e47, 1, 0x3e)
ROM_END
diff --git a/src/mess/machine/beta.h b/src/mess/machine/beta.h
index c082819149e..4afe62c771c 100644
--- a/src/mess/machine/beta.h
+++ b/src/mess/machine/beta.h
@@ -50,7 +50,7 @@ protected:
virtual machine_config_constructor device_mconfig_additions() const;
private:
- required_device<wd2793_t> m_wd179x;
+ required_device<kr1818vg93_t> m_wd179x;
required_device<floppy_connector> m_floppy0;
required_device<floppy_connector> m_floppy1;
required_device<floppy_connector> m_floppy2;
diff --git a/src/mess/machine/concept.c b/src/mess/machine/concept.c
index 8c547c51903..7beeb8fe1d7 100644
--- a/src/mess/machine/concept.c
+++ b/src/mess/machine/concept.c
@@ -1,4 +1,4 @@
-// license:???
+// license:GPL-2.0+
// copyright-holders:Raphael Nabet, Brett Wyer
/*
Corvus Concept driver
diff --git a/src/mess/machine/cx4data.inc b/src/mess/machine/cx4data.inc
index b3184a452fb..b7d1610a304 100644
--- a/src/mess/machine/cx4data.inc
+++ b/src/mess/machine/cx4data.inc
@@ -1,5 +1,5 @@
// license:GPL-2.0+
-// copyright-holders:byuu
+// copyright-holders:byuu, Nach
/***************************************************************************
cx4data.c
diff --git a/src/mess/machine/cx4fn.inc b/src/mess/machine/cx4fn.inc
index 811a9794e62..2b5a302a227 100644
--- a/src/mess/machine/cx4fn.inc
+++ b/src/mess/machine/cx4fn.inc
@@ -1,5 +1,5 @@
// license:GPL-2.0+
-// copyright-holders:byuu
+// copyright-holders:byuu, Nach
/***************************************************************************
cx4fn.c
diff --git a/src/mess/machine/cx4oam.inc b/src/mess/machine/cx4oam.inc
index bcb7d29e922..abf74defea2 100644
--- a/src/mess/machine/cx4oam.inc
+++ b/src/mess/machine/cx4oam.inc
@@ -1,5 +1,5 @@
// license:GPL-2.0+
-// copyright-holders:byuu
+// copyright-holders:byuu, Nach
/***************************************************************************
cx4oam.c
diff --git a/src/mess/machine/cx4ops.inc b/src/mess/machine/cx4ops.inc
index 9147bb43869..02b97bc944d 100644
--- a/src/mess/machine/cx4ops.inc
+++ b/src/mess/machine/cx4ops.inc
@@ -1,5 +1,5 @@
// license:GPL-2.0+
-// copyright-holders:byuu
+// copyright-holders:byuu, Nach
/***************************************************************************
cx4ops.c
diff --git a/src/mess/machine/dgn_beta.c b/src/mess/machine/dgn_beta.c
index 46f027974fa..57de97d32f5 100644
--- a/src/mess/machine/dgn_beta.c
+++ b/src/mess/machine/dgn_beta.c
@@ -64,7 +64,6 @@
#include "machine/6821pia.h"
#include "includes/dgn_beta.h"
#include "machine/mos6551.h"
-#include "machine/wd17xx.h"
#include "imagedev/flopdrv.h"
#include "debug/debugcpu.h"
@@ -567,7 +566,6 @@ READ8_MEMBER(dgn_beta_state::d_pia1_pa_r)
WRITE8_MEMBER(dgn_beta_state::d_pia1_pa_w)
{
int HALT_DMA;
- wd2797_device *fdc = machine().device<wd2797_device>(FDC_TAG);
/* Only play with halt line if halt bit changed since last write */
if((data & 0x80) != m_d_pia1_pa_last)
@@ -589,10 +587,20 @@ WRITE8_MEMBER(dgn_beta_state::d_pia1_pa_w)
}
/* Drive selects are binary encoded on PA0 & PA1 */
- fdc->set_drive(~data & DSMask);
+ floppy_image_device *floppy = NULL;
- /* Set density of WD2797 */
- fdc->dden_w(BIT(data, 6));
+ switch (~data & 0x03)
+ {
+ case 0: floppy = m_floppy0->get_device(); break;
+ case 1: floppy = m_floppy1->get_device(); break;
+ case 2: floppy = m_floppy2->get_device(); break;
+ case 3: floppy = m_floppy3->get_device(); break;
+ }
+
+ m_fdc->set_floppy(floppy);
+
+ // not connected: bit 5 = ENP
+ m_fdc->dden_w(BIT(data, 6));
LOG_DISK(("Set density %s\n", BIT(data, 6) ? "low" : "high"));
}
@@ -787,7 +795,7 @@ void dgn_beta_state::cpu1_recalc_firq(int state)
/********************************************************************************************/
/* The INTRQ line goes through pia2 ca1, in exactly the same way as DRQ from DragonDos does */
-WRITE_LINE_MEMBER(dgn_beta_state::dgnbeta_fdc_intrq_w)
+WRITE_LINE_MEMBER( dgn_beta_state::dgnbeta_fdc_intrq_w )
{
device_t *device = machine().device(PIA_2_TAG);
LOG_DISK(("dgnbeta_fdc_intrq_w(%d)\n", state));
@@ -796,64 +804,21 @@ WRITE_LINE_MEMBER(dgn_beta_state::dgnbeta_fdc_intrq_w)
}
/* DRQ is routed through various logic to the FIRQ inturrupt line on *BOTH* CPUs */
-WRITE_LINE_MEMBER(dgn_beta_state::dgnbeta_fdc_drq_w)
+WRITE_LINE_MEMBER( dgn_beta_state::dgnbeta_fdc_drq_w )
{
LOG_DISK(("dgnbeta_fdc_drq_w(%d)\n", state));
cpu1_recalc_firq(state);
}
-READ8_MEMBER(dgn_beta_state::dgnbeta_wd2797_r)
+READ8_MEMBER( dgn_beta_state::dgnbeta_wd2797_r )
{
- int result = 0;
- wd2797_device *fdc = machine().device<wd2797_device>(FDC_TAG);
-
- switch(offset & 0x03)
- {
- case 0:
- result = fdc->status_r(space, 0);
- LOG_DISK(("Disk status=%2.2X\n",result));
- break;
- case 1:
- result = fdc->track_r(space, 0);
- break;
- case 2:
- result = fdc->sector_r(space, 0);
- break;
- case 3:
- result = fdc->data_r(space, 0);
- break;
- default:
- break;
- }
-
- return result;
+ return m_fdc->read(space, offset & 0x03);
}
-WRITE8_MEMBER(dgn_beta_state::dgnbeta_wd2797_w)
+WRITE8_MEMBER( dgn_beta_state::dgnbeta_wd2797_w )
{
- wd2797_device *fdc = machine().device<wd2797_device>(FDC_TAG);
-
- m_wd2797_written=1;
-
- switch(offset & 0x3)
- {
- case 0:
- /* disk head is encoded in the command byte */
- /* But only for Type 3/4 commands */
- if(data & 0x80)
- fdc->set_side((data & 0x02) ? 1 : 0);
- fdc->command_w(space, 0, data);
- break;
- case 1:
- fdc->track_w(space, 0, data);
- break;
- case 2:
- fdc->sector_w(space, 0, data);
- break;
- case 3:
- fdc->data_w(space, 0, data);
- break;
- };
+ m_wd2797_written = 1;
+ m_fdc->write(space, offset & 0x03, data);
}
/* Scan physical keyboard into Keyboard array */
@@ -924,7 +889,6 @@ void dgn_beta_state::dgn_beta_line_interrupt (int data)
/********************************* Machine/Driver Initialization ****************************************/
void dgn_beta_state::machine_reset()
{
- wd2797_device *fdc = machine().device<wd2797_device>(FDC_TAG);
pia6821_device *pia_0 = machine().device<pia6821_device>( PIA_0_TAG );
pia6821_device *pia_1 = machine().device<pia6821_device>( PIA_1_TAG );
pia6821_device *pia_2 = machine().device<pia6821_device>( PIA_2_TAG );
@@ -963,12 +927,8 @@ void dgn_beta_state::machine_reset()
m_DMA_NMI_LAST = 0x80; /* start with DMA NMI inactive, as pulled up */
// DMA_NMI = CLEAR_LINE; /* start with DMA NMI inactive */
- fdc->dden_w(CLEAR_LINE);
- fdc->set_drive(0);
-
m_videoram.set_target(m_ram->pointer(),m_videoram.bytes()); /* Point video ram at the start of physical ram */
- fdc->reset();
m_wd2797_written=0;
m_maincpu->reset();
diff --git a/src/mess/machine/dgnalpha.c b/src/mess/machine/dgnalpha.c
index 4fe71930528..a146e1e3aae 100644
--- a/src/mess/machine/dgnalpha.c
+++ b/src/mess/machine/dgnalpha.c
@@ -161,6 +161,7 @@ READ8_MEMBER( dragon_alpha_state::ff20_read )
result = m_fdc->status_r(space, 0);
break;
}
+
return result;
}
@@ -196,10 +197,7 @@ WRITE8_MEMBER( dragon_alpha_state::ff20_write )
m_fdc->track_w(space, 0, data);
break;
case 15:
- m_fdc->command_w(space, 0, data);
-
- /* disk head is encoded in the command byte */
- m_fdc->set_side((data & 0x02) ? 1 : 0);
+ m_fdc->cmd_w(space, 0, data);
break;
}
}
@@ -316,21 +314,24 @@ WRITE8_MEMBER( dragon_alpha_state::psg_porta_write )
/* Bits 0..3 are the drive select lines for the internal floppy interface */
/* Bit 4 is the motor on, in the real hardware these are inverted on their way to the drive */
/* Bits 5,6,7 are connected to /DDEN, ENP and 5/8 on the WD2797 */
- switch (data & 0xF)
- {
- case(0x01) :
- m_fdc->set_drive(0);
- break;
- case(0x02) :
- m_fdc->set_drive(1);
- break;
- case(0x04) :
- m_fdc->set_drive(2);
- break;
- case(0x08) :
- m_fdc->set_drive(3);
- break;
- }
+
+ floppy_image_device *floppy = NULL;
+
+ if (BIT(data, 0)) floppy = m_floppy0->get_device();
+ if (BIT(data, 1)) floppy = m_floppy1->get_device();
+ if (BIT(data, 2)) floppy = m_floppy2->get_device();
+ if (BIT(data, 3)) floppy = m_floppy3->get_device();
+
+ m_fdc->set_floppy(floppy);
+
+ // todo: turning the motor on with bit 4 isn't giving the drive enough
+ // time to spin up, how does it work in hardware?
+ if (m_floppy0->get_device()) m_floppy0->get_device()->mon_w(0);
+ if (m_floppy1->get_device()) m_floppy1->get_device()->mon_w(0);
+ if (m_floppy2->get_device()) m_floppy2->get_device()->mon_w(0);
+ if (m_floppy3->get_device()) m_floppy3->get_device()->mon_w(0);
+
+ m_fdc->dden_w(BIT(data, 5));
}
/***************************************************************************
diff --git a/src/mess/machine/hec2hrp.c b/src/mess/machine/hec2hrp.c
index a6ebb75c64c..55db5bdfe5f 100644
--- a/src/mess/machine/hec2hrp.c
+++ b/src/mess/machine/hec2hrp.c
@@ -102,85 +102,25 @@ TIMER_CALLBACK_MEMBER(hec2hrp_state::Callback_CK)
m_CK_signal++;
}
-void hec2hrp_state::hector_minidisc_init()
+WRITE8_MEMBER( hec2hrp_state::minidisc_control_w )
{
- fd1793_device *fdc = machine().device<fd1793_device>("wd179x");
- //set density
- fdc->dden_w(1);// density select => always 1 (0 ?a plante !)
+ floppy_image_device *floppy = NULL;
- /* FDC Motor Control - Bit 0/1 defines the state of the FDD 0/1 motor */
- floppy_get_device(machine(), 0)->floppy_mon_w( 0); // Moteur floppy A:
- //floppy_get_device(machine(), 1)->floppy_mon_w(BIT(data, 7)); // Moteur floppy B:, not implanted on the real machine
+ if (BIT(data, 6)) floppy = m_floppy0->get_device();
+ // bit 7 = drive 2?
- //Set the drive ready !
- floppy_get_device(machine(), 0)->floppy_drive_set_ready_state(FLOPPY_DRIVE_READY, 0);// Disc 0 ready !
+ m_minidisc_fdc->set_floppy(floppy);
-}
-
-READ8_MEMBER(hec2hrp_state::hector_179x_register_r)
-{
-int data=0;
-fd1793_device *fdc = machine().device<fd1793_device>("wd179x");
-
- switch (offset & 0x0ff)
+ if (floppy)
{
- /* minidisc floppy disc interface */
- case 0x04:
- data = fdc->status_r(space, 0);
- break;
- case 0x05:
- data = fdc->track_r(space, 0);
- break;
- case 0x06:
- data = fdc->sector_r(space, 0);
- break;
- case 0x07:
- data = fdc->data_r(space, 0);
- break;
- default:
- break;
+ // don't know where the motor on signal is
+ floppy->mon_w(0);
+ floppy->ss_w(BIT(data, 4));
}
- return data;
+ membank("bank2")->set_entry(BIT(data, 5) ? HECTOR_BANK_BASE : HECTOR_BANK_DISC);
}
-WRITE8_MEMBER(hec2hrp_state::hector_179x_register_w)
-{
-fd1793_device *fdc = machine().device<fd1793_device>("wd179x");
-switch (offset)
- {
- /* minidisc floppy disc interface */
- case 0x04:
- fdc->command_w(space, 0, data);
- break;
- case 0x05:
- fdc->track_w(space, 0, data);
- break;
- case 0x06:
- fdc->sector_w(space, 0, data);
- break;
- case 0x07:
- /*write into command register*/
- fdc->data_w(space, 0, data);
- break;
- case 0x08:
- /*General purpose port (0x08) for the minidisk I/O */
- {
- // Rom page bank switching
- membank("bank2")->set_entry(BIT(data, 5) ? HECTOR_BANK_BASE : HECTOR_BANK_DISC );
-
- // Set drive number
- if (BIT(data, 6)) fdc->set_drive(0); // Set the correct drive number 0
- //if (BIT(data, 7)) fdc->set_drive(1);// Set the correct drive number 1,never here
- // Set side
- fdc->set_side(BIT(data, 4) ? 1 : 0);// side select
- }
- break;
-
- default:
- break;
- }
-}
WRITE8_MEMBER(hec2hrp_state::hector_switch_bank_w)
{
if (offset==0x00) { /* 0x800 et 0x000=> video page, HR*/
@@ -255,7 +195,7 @@ READ8_MEMBER(hec2hrp_state::hector_keyboard_r)
/* floppy md master reset */
if (isHectorWithMiniDisc())
- machine().device<fd1793_device>("wd179x")->mr_w(1);
+ m_minidisc_fdc->reset();
}
else /* aviable for BR machines */
diff --git a/src/mess/machine/lisa.c b/src/mess/machine/lisa.c
index aee6ef4ba70..2e2b2bb6bc6 100644
--- a/src/mess/machine/lisa.c
+++ b/src/mess/machine/lisa.c
@@ -1,4 +1,4 @@
-// license:???
+// license:GPL-2.0+
// copyright-holders:Raphael Nabet
/*
experimental LISA driver
diff --git a/src/mess/machine/m20_8086.c b/src/mess/machine/m20_8086.c
new file mode 100644
index 00000000000..5c817b17edf
--- /dev/null
+++ b/src/mess/machine/m20_8086.c
@@ -0,0 +1,119 @@
+// license:BSD-3-Clause
+// copyright-holders:Carl
+#include "m20_8086.h"
+#include "machine/ram.h"
+
+const device_type M20_8086 = &device_creator<m20_8086_device>;
+
+m20_8086_device::m20_8086_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ device_t(mconfig, M20_8086, "Olivetti M20 8086 Adapter", tag, owner, clock, "m20_8086", __FILE__),
+ m_8086(*this, "8086"),
+ m_maincpu(*this, ":maincpu"),
+ m_pic(*this, ":i8259"),
+ m_8086_halt(true)
+{
+}
+
+void m20_8086_device::device_start()
+{
+ UINT8* ram = machine().device<ram_device>("ram")->pointer();
+ m_8086->space(AS_PROGRAM).install_readwrite_bank(0x00000, machine().device<ram_device>("ram")->size() - 0x4001, "mainram");
+ membank("highram")->set_base(ram);
+ membank("mainram")->set_base(&ram[0x4000]);
+ membank("vram")->set_base(memshare(":p_videoram")->ptr());
+ membank("vram2")->set_base(memshare(":p_videoram")->ptr());
+}
+
+void m20_8086_device::device_reset()
+{
+ m_8086_halt = true;
+ m_nvi = m_vi = 0;
+ m_8086->set_input_line(INPUT_LINE_HALT, ASSERT_LINE);
+}
+
+ROM_START( m20_8086 )
+ ROM_REGION(0x4000, "8086", 0)
+ ROM_LOAD("apb-1086-2.0.bin", 0x0000, 0x4000, CRC(8c05be93) SHA1(2bb424afd874cc6562e9642780eaac2391308053))
+ROM_END
+
+
+const rom_entry *m20_8086_device::device_rom_region() const
+{
+ return ROM_NAME( m20_8086 );
+}
+
+static ADDRESS_MAP_START(i86_prog, AS_PROGRAM, 16, m20_8086_device)
+ AM_RANGE(0xe0000, 0xe3fff) AM_RAMBANK("vram2")
+ AM_RANGE(0xf0000, 0xf3fff) AM_RAMBANK("highram")
+ AM_RANGE(0xf4000, 0xf7fff) AM_RAMBANK("vram")
+ AM_RANGE(0xfc000, 0xfffff) AM_ROM AM_REGION("8086",0)
+ADDRESS_MAP_END
+
+static ADDRESS_MAP_START(i86_io, AS_IO, 16, m20_8086_device)
+ AM_RANGE(0x4000, 0x4fff) AM_READWRITE(z8000_io_r, z8000_io_w)
+ AM_RANGE(0x7ffa, 0x7ffd) AM_WRITE(handshake_w)
+ADDRESS_MAP_END
+
+static MACHINE_CONFIG_FRAGMENT( m20_8086 )
+ MCFG_CPU_ADD("8086", I8086, XTAL_24MHz/3)
+ MCFG_CPU_PROGRAM_MAP(i86_prog)
+ MCFG_CPU_IO_MAP(i86_io)
+ MCFG_CPU_IRQ_ACKNOWLEDGE_DRIVER(m20_8086_device, int_cb)
+MACHINE_CONFIG_END
+
+machine_config_constructor m20_8086_device::device_mconfig_additions() const
+{
+ return MACHINE_CONFIG_NAME( m20_8086 );
+}
+
+READ16_MEMBER(m20_8086_device::z8000_io_r)
+{
+ return m_maincpu->space(AS_IO).read_word(offset << 1, mem_mask);
+}
+
+WRITE16_MEMBER(m20_8086_device::z8000_io_w)
+{
+ m_maincpu->space(AS_IO).write_word(offset << 1, data, mem_mask);
+}
+
+IRQ_CALLBACK_MEMBER(m20_8086_device::int_cb)
+{
+ if(m_nvi)
+ {
+ m_nvi = false;
+ m_8086->set_input_line(INPUT_LINE_IRQ0, m_vi ? ASSERT_LINE : CLEAR_LINE);
+ return 0xff;
+ }
+ else
+ return m_pic->acknowledge() << 1;
+}
+
+WRITE_LINE_MEMBER(m20_8086_device::nvi_w)
+{
+ m_nvi = state;
+ m_8086->set_input_line(INPUT_LINE_IRQ0, (state || m_vi) ? ASSERT_LINE : CLEAR_LINE);
+}
+
+WRITE_LINE_MEMBER(m20_8086_device::vi_w)
+{
+ m_vi = state;
+ m_8086->set_input_line(INPUT_LINE_IRQ0, (state || m_nvi) ? ASSERT_LINE : CLEAR_LINE);
+}
+
+WRITE16_MEMBER(m20_8086_device::handshake_w)
+{
+ if(!offset)
+ {
+ m_8086->set_input_line(INPUT_LINE_HALT, ASSERT_LINE);
+ m_maincpu->set_input_line(INPUT_LINE_HALT, CLEAR_LINE);
+ m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
+ m_8086_halt = true;
+ }
+ else
+ {
+ m_8086->set_input_line(INPUT_LINE_HALT, CLEAR_LINE);
+ m_8086->set_input_line(INPUT_LINE_RESET, PULSE_LINE);
+ m_maincpu->set_input_line(INPUT_LINE_HALT, ASSERT_LINE);
+ m_8086_halt = false;
+ }
+}
diff --git a/src/mess/machine/m20_8086.h b/src/mess/machine/m20_8086.h
new file mode 100644
index 00000000000..148ba808c0a
--- /dev/null
+++ b/src/mess/machine/m20_8086.h
@@ -0,0 +1,40 @@
+// license:BSD-3-Clause
+// copyright-holders:Carl
+#ifndef M20_8086_H_
+#define M20_8086_H_
+
+#include "emu.h"
+#include "cpu/i86/i86.h"
+#include "machine/pic8259.h"
+
+class m20_8086_device : public device_t
+{
+public:
+ m20_8086_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ virtual const rom_entry *device_rom_region() const;
+ virtual machine_config_constructor device_mconfig_additions() const;
+
+ DECLARE_READ16_MEMBER(z8000_io_r);
+ DECLARE_WRITE16_MEMBER(z8000_io_w);
+ DECLARE_WRITE_LINE_MEMBER(vi_w);
+ DECLARE_WRITE_LINE_MEMBER(nvi_w);
+ DECLARE_WRITE16_MEMBER(handshake_w);
+ IRQ_CALLBACK_MEMBER(int_cb);
+ bool halted() { return m_8086_halt; }
+ required_device<cpu_device> m_8086;
+
+protected:
+ void device_start();
+ void device_reset();
+
+private:
+ required_device<cpu_device> m_maincpu;
+ required_device<pic8259_device> m_pic;
+ bool m_8086_halt;
+ int m_nvi, m_vi;
+};
+
+extern const device_type M20_8086;
+
+#endif /* M20_8086_H_ */
diff --git a/src/mess/machine/m20_kbd.c b/src/mess/machine/m20_kbd.c
new file mode 100644
index 00000000000..ecccffae775
--- /dev/null
+++ b/src/mess/machine/m20_kbd.c
@@ -0,0 +1,225 @@
+// license:BSD-3-Clause
+// copyright-holders:Carl
+// TODO: dump 8048 mcu
+
+#include "machine/m20_kbd.h"
+
+m20_keyboard_device::m20_keyboard_device(const machine_config& mconfig, const char* tag, device_t* owner, UINT32 clock) :
+ serial_keyboard_device(mconfig, M20_KEYBOARD, "M20 Keyboard", tag, owner, 0, "m20_keyboard", __FILE__)
+{
+}
+
+void m20_keyboard_device::write(UINT8 data)
+{
+ switch(data)
+ {
+ case 0x03:
+ send_key(2);
+ break;
+ case 0x80:
+ send_key(0x80);
+ break;
+ }
+ return;
+}
+
+UINT8 m20_keyboard_device::keyboard_handler(UINT8 last_code, UINT8 *scan_line)
+{
+ int i = *scan_line, j;
+ UINT8 code = 0, state = m_state[i];
+
+ if (i == 0) code = m_io_kbd0->read();
+ else
+ if (i == 1) code = m_io_kbd1->read();
+ else
+ if (i == 2) code = m_io_kbd2->read();
+ else
+ if (i == 3) code = m_io_kbd3->read();
+ else
+ if (i == 4) code = m_io_kbd4->read();
+ else
+ if (i == 5) code = m_io_kbd5->read();
+ else
+ if (i == 6) code = m_io_kbd6->read();
+ else
+ if (i == 7) code = m_io_kbd7->read();
+ else
+ if (i == 8) code = m_io_kbd8->read();
+
+ *scan_line = (*scan_line + 1) % 9;
+
+ if(m_state[i] == code)
+ return 0;
+
+ m_state[i] = code;
+ code = (state ^ code) & code;
+
+ if(!code)
+ return 0;
+
+ for(j = 0; j < 8; j++)
+ if((code >> j) == 1)
+ break;
+
+ if(i >= 6)
+ code = 0xc0 + ((i - 6) << 3) + j;
+ else
+ code = (i << 3) + j;
+
+ state = m_io_kbd9->read();
+ if(state && (i <= 8))
+ {
+ switch(state)
+ {
+ case 1:
+ code += 0x90;
+ break;
+ case 2:
+ code += 0x60;
+ break;
+ case 4:
+ case 8:
+ code += 0x30;
+ break;
+ }
+ }
+
+ return code;
+}
+
+// Italian layout
+static INPUT_PORTS_START( m20_keyboard )
+ PORT_START("TERM_LINE0")
+ PORT_BIT(0x01,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("RESET") PORT_CODE(KEYCODE_ESC)
+ PORT_BIT(0x02,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("<") PORT_CODE(KEYCODE_LALT) PORT_CHAR('<') PORT_CHAR('>')
+ PORT_BIT(0x04,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_A) PORT_CHAR('a') PORT_CHAR('A')
+ PORT_BIT(0x08,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_B) PORT_CHAR('b') PORT_CHAR('B')
+ PORT_BIT(0x10,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_C) PORT_CHAR('c') PORT_CHAR('C')
+ PORT_BIT(0x20,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_D) PORT_CHAR('d') PORT_CHAR('D')
+ PORT_BIT(0x40,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_E) PORT_CHAR('e') PORT_CHAR('E')
+ PORT_BIT(0x80,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_F) PORT_CHAR('f') PORT_CHAR('F')
+
+ PORT_START("TERM_LINE1")
+ PORT_BIT(0x01,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_G) PORT_CHAR('g') PORT_CHAR('G')
+ PORT_BIT(0x02,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_H) PORT_CHAR('h') PORT_CHAR('H')
+ PORT_BIT(0x04,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_I) PORT_CHAR('i') PORT_CHAR('I')
+ PORT_BIT(0x08,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_J) PORT_CHAR('j') PORT_CHAR('J')
+ PORT_BIT(0x10,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_K) PORT_CHAR('k') PORT_CHAR('K')
+ PORT_BIT(0x20,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_L) PORT_CHAR('l') PORT_CHAR('L')
+ PORT_BIT(0x40,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('?')
+ PORT_BIT(0x80,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_N) PORT_CHAR('n') PORT_CHAR('N')
+
+ PORT_START("TERM_LINE2")
+ PORT_BIT(0x01,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O')
+ PORT_BIT(0x02,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_P) PORT_CHAR('p') PORT_CHAR('P')
+ PORT_BIT(0x04,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q')
+ PORT_BIT(0x08,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_R) PORT_CHAR('r') PORT_CHAR('R')
+ PORT_BIT(0x10,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_S) PORT_CHAR('s') PORT_CHAR('S')
+ PORT_BIT(0x20,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_T) PORT_CHAR('t') PORT_CHAR('T')
+ PORT_BIT(0x40,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_U) PORT_CHAR('u') PORT_CHAR('U')
+ PORT_BIT(0x80,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_V) PORT_CHAR('v') PORT_CHAR('V')
+
+ PORT_START("TERM_LINE3")
+ PORT_BIT(0x01,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_Z) PORT_CHAR('z') PORT_CHAR('Z')
+ PORT_BIT(0x02,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_X) PORT_CHAR('x') PORT_CHAR('X')
+ PORT_BIT(0x04,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_Y) PORT_CHAR('y') PORT_CHAR('Y')
+ PORT_BIT(0x08,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_W) PORT_CHAR('w') PORT_CHAR('W')
+ PORT_BIT(0x10,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("\xc3\xa0 0") PORT_CODE(KEYCODE_0) PORT_CHAR(0x85) PORT_CHAR('0') // a_GRAVE
+ PORT_BIT(0x20,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("\xc2\xa3 1") PORT_CODE(KEYCODE_1) PORT_CHAR(0x9c) PORT_CHAR('1') // POUND
+ PORT_BIT(0x40,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME(e_ACUTE " 2") PORT_CODE(KEYCODE_2) PORT_CHAR(0x82) PORT_CHAR('2')
+ PORT_BIT(0x80,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("\" 3") PORT_CODE(KEYCODE_3) PORT_CHAR('"') PORT_CHAR('3')
+
+ PORT_START("TERM_LINE4")
+ PORT_BIT(0x01,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("' 4") PORT_CODE(KEYCODE_4) PORT_CHAR('\'') PORT_CHAR('4')
+ PORT_BIT(0x02,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("( 5") PORT_CODE(KEYCODE_5) PORT_CHAR('(') PORT_CHAR('5')
+ PORT_BIT(0x04,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("_ 6") PORT_CODE(KEYCODE_6) PORT_CHAR('_') PORT_CHAR('6')
+ PORT_BIT(0x08,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("\xc3\xa8 7") PORT_CODE(KEYCODE_7) PORT_CHAR(0x8a) PORT_CHAR('7') // e_GRAVE
+ PORT_BIT(0x10,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("^ 8") PORT_CODE(KEYCODE_8) PORT_CHAR('^') PORT_CHAR('8')
+ PORT_BIT(0x20,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("\xc3\xa7 9") PORT_CODE(KEYCODE_9) PORT_CHAR(0x87) PORT_CHAR('9') // c_CEDILLA
+ PORT_BIT(0x40,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME(") \xc2\xb0") PORT_CODE(KEYCODE_MINUS) PORT_CHAR(')') PORT_CHAR(0xa7) // DEGREE
+ PORT_BIT(0x80,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("- +") PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('-') PORT_CHAR('+')
+
+ PORT_START("TERM_LINE5")
+ PORT_BIT(0x01,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("\xc3\xac =") PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR(0x8d) PORT_CHAR('=') // i_GRAVE
+ PORT_BIT(0x02,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("$ &") PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR('$') PORT_CHAR('&')
+ PORT_BIT(0x04,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_M) PORT_CHAR('m') PORT_CHAR('M')
+ PORT_BIT(0x08,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("\xc3\xb9 %") PORT_CODE(KEYCODE_COLON) PORT_CHAR(0x8a) PORT_CHAR('%') // u_GRAVE
+ PORT_BIT(0x10,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("* \xc2\xa7") PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('*') PORT_CHAR(0xf5) // SECTION
+ PORT_BIT(0x20,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("; .") PORT_CODE(KEYCODE_STOP) PORT_CHAR(';') PORT_CHAR('.')
+ PORT_BIT(0x40,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME(": /") PORT_CODE(KEYCODE_SLASH) PORT_CHAR(':') PORT_CHAR('/')
+ PORT_BIT(0x80,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("\xc3\xb2") PORT_CODE(KEYCODE_RALT) PORT_CHAR(0x95)
+
+ PORT_START("TERM_LINE6")
+ PORT_BIT(0x01,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ')
+ PORT_BIT(0x02,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13)
+ PORT_BIT(0x04,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("S1") PORT_CODE(KEYCODE_BACKSPACE)
+ PORT_BIT(0x08,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("S2") PORT_CODE(KEYCODE_BACKSLASH)
+ PORT_BIT(0x10,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Keypad .") PORT_CODE(KEYCODE_DEL_PAD) PORT_CHAR(UCHAR_MAMEKEY(DEL_PAD))
+ PORT_BIT(0x20,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_0_PAD) PORT_CHAR(UCHAR_MAMEKEY(0_PAD))
+ PORT_BIT(0x40,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Keypad 00") PORT_CODE(KEYCODE_ENTER_PAD)
+ PORT_BIT(0x80,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_1_PAD) PORT_CHAR(UCHAR_MAMEKEY(1_PAD))
+
+ PORT_START("TERM_LINE7")
+ PORT_BIT(0x01,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_2_PAD) PORT_CHAR(UCHAR_MAMEKEY(2_PAD))
+ PORT_BIT(0x02,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_3_PAD) PORT_CHAR(UCHAR_MAMEKEY(3_PAD))
+ PORT_BIT(0x04,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_4_PAD) PORT_CHAR(UCHAR_MAMEKEY(4_PAD))
+ PORT_BIT(0x08,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_5_PAD) PORT_CHAR(UCHAR_MAMEKEY(5_PAD))
+ PORT_BIT(0x10,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_6_PAD) PORT_CHAR(UCHAR_MAMEKEY(6_PAD))
+ PORT_BIT(0x20,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_7_PAD) PORT_CHAR(UCHAR_MAMEKEY(7_PAD))
+ PORT_BIT(0x40,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_8_PAD) PORT_CHAR(UCHAR_MAMEKEY(8_PAD))
+ PORT_BIT(0x80,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_9_PAD) PORT_CHAR(UCHAR_MAMEKEY(9_PAD))
+
+ PORT_START("TERM_LINE8")
+ PORT_BIT(0x01,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_PLUS_PAD) PORT_CHAR(UCHAR_MAMEKEY(PLUS_PAD))
+ PORT_BIT(0x02,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_MINUS_PAD) PORT_CHAR(UCHAR_MAMEKEY(PLUS_PAD))
+ PORT_BIT(0x04,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_ASTERISK) PORT_CHAR(UCHAR_MAMEKEY(ASTERISK))
+ PORT_BIT(0x08,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_SLASH_PAD) PORT_CHAR(UCHAR_MAMEKEY(SLASH_PAD))
+
+ PORT_START("TERM_LINE9")
+ PORT_BIT(0x01,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("COMMAND") PORT_CODE(KEYCODE_TAB)
+ PORT_BIT(0x02,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("CTRL") PORT_CODE(KEYCODE_LCONTROL)
+ PORT_BIT(0x04,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1)
+ PORT_BIT(0x08,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_CODE(KEYCODE_LSHIFT)
+
+ PORT_START("TERM_LINEC")
+
+ PORT_START("RS232_TXBAUD")
+ PORT_CONFNAME(0xff, RS232_BAUD_1200, "TX Baud") PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, serial_keyboard_device, update_serial)
+ PORT_CONFSETTING( RS232_BAUD_1200, "1200")
+
+ PORT_START("RS232_STARTBITS")
+ PORT_CONFNAME(0xff, RS232_STARTBITS_1, "Start Bits") PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, serial_keyboard_device, update_serial)
+ PORT_CONFSETTING( RS232_STARTBITS_1, "1")
+
+ PORT_START("RS232_DATABITS")
+ PORT_CONFNAME(0xff, RS232_DATABITS_8, "Data Bits") PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, serial_keyboard_device, update_serial)
+ PORT_CONFSETTING( RS232_DATABITS_8, "8")
+
+ PORT_START("RS232_PARITY")
+ PORT_CONFNAME(0xff, RS232_PARITY_NONE, "Parity") PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, serial_keyboard_device, update_serial)
+ PORT_CONFSETTING( RS232_PARITY_NONE, "None")
+
+ PORT_START("RS232_STOPBITS")
+ PORT_CONFNAME(0xff, RS232_STOPBITS_2, "Stop Bits") PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, serial_keyboard_device, update_serial)
+ PORT_CONFSETTING( RS232_STOPBITS_2, "2")
+INPUT_PORTS_END
+
+ioport_constructor m20_keyboard_device::device_input_ports() const
+{
+ return INPUT_PORTS_NAME(m20_keyboard);
+}
+
+void m20_keyboard_device::device_start()
+{
+ serial_keyboard_device::device_start();
+ memset(m_state, '\0', sizeof(m_state));
+ set_rcv_rate(1200);
+}
+
+void m20_keyboard_device::rcv_complete()
+{
+ receive_register_extract();
+ write(get_received_char());
+}
+
+const device_type M20_KEYBOARD = &device_creator<m20_keyboard_device>;
diff --git a/src/mess/machine/m20_kbd.h b/src/mess/machine/m20_kbd.h
new file mode 100644
index 00000000000..a3b9e770e77
--- /dev/null
+++ b/src/mess/machine/m20_kbd.h
@@ -0,0 +1,26 @@
+// license:BSD-3-Clause
+// copyright-holders:Carl
+#ifndef M20KBD_H_
+#define M20KBD_H_
+
+#include "bus/rs232/keyboard.h"
+
+class m20_keyboard_device : public serial_keyboard_device
+{
+public:
+ m20_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ virtual ioport_constructor device_input_ports() const;
+
+protected:
+ virtual void device_start();
+ virtual void rcv_complete();
+
+private:
+ void write(UINT8 data);
+ virtual UINT8 keyboard_handler(UINT8 last_code, UINT8 *scan_line);
+ UINT8 m_state[16];
+};
+
+extern const device_type M20_KEYBOARD;
+
+#endif /* M20KBD_H_ */
diff --git a/src/mess/machine/mac.c b/src/mess/machine/mac.c
index 74bbaae1a00..098bcede238 100644
--- a/src/mess/machine/mac.c
+++ b/src/mess/machine/mac.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Nathan Woods, Raphael Nabet, R. Belmont
/****************************************************************************
@@ -2162,7 +2162,7 @@ MAC_DRIVER_INIT(macpd210, MODEL_MAC_PBDUO_210)
MAC_DRIVER_INIT(macquadra700, MODEL_MAC_QUADRA_700)
MAC_DRIVER_INIT(maciicx, MODEL_MAC_IICX)
MAC_DRIVER_INIT(maciifdhd, MODEL_MAC_II_FDHD)
-MAC_DRIVER_INIT(maciix, MODEL_MAC_IIX);
+MAC_DRIVER_INIT(maciix, MODEL_MAC_IIX)
MAC_DRIVER_INIT(maclc520, MODEL_MAC_LC_520)
void mac_state::nubus_slot_interrupt(UINT8 slot, UINT32 state)
diff --git a/src/mess/machine/mbc55x.c b/src/mess/machine/mbc55x.c
index f2e341d5f9c..18704e33f0a 100644
--- a/src/mess/machine/mbc55x.c
+++ b/src/mess/machine/mbc55x.c
@@ -72,8 +72,23 @@ WRITE8_MEMBER( mbc55x_state::mbc55x_ppi_portb_w )
WRITE8_MEMBER( mbc55x_state::mbc55x_ppi_portc_w )
{
- m_fdc->set_drive((data & 0x03));
- m_fdc->set_side(BIT(data, 2));
+ floppy_image_device *floppy = NULL;
+
+ switch (data & 0x03)
+ {
+ case 0: floppy = m_floppy0->get_device(); break;
+ case 1: floppy = m_floppy1->get_device(); break;
+ case 2: floppy = m_floppy2->get_device(); break;
+ case 3: floppy = m_floppy3->get_device(); break;
+ }
+
+ m_fdc->set_floppy(floppy);
+
+ if (floppy)
+ {
+ floppy->mon_w(0);
+ floppy->ss_w(BIT(data, 2));
+ }
}
/* Serial port USART, unimplemented as yet */
@@ -139,13 +154,6 @@ WRITE8_MEMBER(mbc55x_state::mbc55x_disk_w)
m_fdc->write(space, offset>>1, data);
}
-WRITE_LINE_MEMBER( mbc55x_state::mbc55x_fdc_intrq_w )
-{
-}
-
-WRITE_LINE_MEMBER( mbc55x_state::mbc55x_fdc_drq_w )
-{
-}
/*
Keyboard emulation
@@ -344,7 +352,8 @@ static void mbc55x_debug(running_machine &machine, int ref, int params, const ch
mbc55x_state *state = machine.driver_data<mbc55x_state>();
if(params>0)
{
- sscanf(param[0],"%d",&state->m_debug_machine);
+ int temp;
+ sscanf(param[0],"%d",&temp); state->m_debug_machine = temp;
}
else
{
diff --git a/src/mess/machine/mbee.c b/src/mess/machine/mbee.c
index 84c8ff44a07..904849a1c78 100644
--- a/src/mess/machine/mbee.c
+++ b/src/mess/machine/mbee.c
@@ -1,13 +1,13 @@
-// license:GPL-2.0+
-// copyright-holders:Juergen Buchmueller, Robbbert
+// license:BSD-3-Clause
+// copyright-holders:Robbbert
/***************************************************************************
microbee.c
machine driver
- Juergen Buchmueller <pullmoll@t-online.de>, Jan 2000
+ Originally written by Juergen Buchmueller, Jan 2000
- Rewritten by Robbbert
+ Rewritten by Robbbert (see notes in driver file).
****************************************************************************/
@@ -53,7 +53,7 @@ WRITE8_MEMBER( mbee_state::pio_port_b_w )
m_cassette->output(BIT(data, 1) ? -1.0 : +1.0);
m_speaker->level_w(BIT(data, 6));
-};
+}
READ8_MEMBER( mbee_state::pio_port_b_r )
{
diff --git a/src/mess/machine/msx.c b/src/mess/machine/msx.c
index b5c9589f102..75488dad92a 100644
--- a/src/mess/machine/msx.c
+++ b/src/mess/machine/msx.c
@@ -214,13 +214,11 @@ void msx_state::post_load()
TIMER_DEVICE_CALLBACK_MEMBER(msx_state::msx2_interrupt)
{
- m_v9938->set_resolution(m_io_dsw->read() & 0x03);
m_v9938->interrupt();
}
TIMER_DEVICE_CALLBACK_MEMBER(msx_state::msx2p_interrupt)
{
- m_v9958->set_resolution(m_io_dsw->read() & 0x03);
m_v9958->interrupt();
}
diff --git a/src/mess/machine/mtx.c b/src/mess/machine/mtx.c
index 46f3ec32e3f..0594ec6c086 100644
--- a/src/mess/machine/mtx.c
+++ b/src/mess/machine/mtx.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Lee Ward, Dirk Best, Curt Coder
/*************************************************************************
diff --git a/src/mess/machine/osborne1.c b/src/mess/machine/osborne1.c
index fbc1e370a7f..84cf5f2db46 100644
--- a/src/mess/machine/osborne1.c
+++ b/src/mess/machine/osborne1.c
@@ -369,14 +369,14 @@ TIMER_CALLBACK_MEMBER(osborne1_state::osborne1_video_callback)
gfx = m_p_chargen[ (ra << 7) | ( chr & 0x7F ) ];
/* Display a scanline of a character */
- *p++ = BIT(gfx, 7) ? ( dim ? 1 : 2 ) : 0;
- *p++ = BIT(gfx, 6) ? ( dim ? 1 : 2 ) : 0;
- *p++ = BIT(gfx, 5) ? ( dim ? 1 : 2 ) : 0;
- *p++ = BIT(gfx, 4) ? ( dim ? 1 : 2 ) : 0;
- *p++ = BIT(gfx, 3) ? ( dim ? 1 : 2 ) : 0;
- *p++ = BIT(gfx, 2) ? ( dim ? 1 : 2 ) : 0;
- *p++ = BIT(gfx, 1) ? ( dim ? 1 : 2 ) : 0;
- *p++ = BIT(gfx, 0) ? ( dim ? 1 : 2 ) : 0;
+ *p++ = BIT(gfx, 7) ? ( dim ? 2 : 1 ) : 0;
+ *p++ = BIT(gfx, 6) ? ( dim ? 2 : 1 ) : 0;
+ *p++ = BIT(gfx, 5) ? ( dim ? 2 : 1 ) : 0;
+ *p++ = BIT(gfx, 4) ? ( dim ? 2 : 1 ) : 0;
+ *p++ = BIT(gfx, 3) ? ( dim ? 2 : 1 ) : 0;
+ *p++ = BIT(gfx, 2) ? ( dim ? 2 : 1 ) : 0;
+ *p++ = BIT(gfx, 1) ? ( dim ? 2 : 1 ) : 0;
+ *p++ = BIT(gfx, 0) ? ( dim ? 2 : 1 ) : 0;
}
}
diff --git a/src/mess/machine/pk8020.c b/src/mess/machine/pk8020.c
index 21816e14f7f..e065aac7fd7 100644
--- a/src/mess/machine/pk8020.c
+++ b/src/mess/machine/pk8020.c
@@ -13,7 +13,6 @@
#include "emu.h"
#include "includes/pk8020.h"
#include "cpu/i8085/i8085.h"
-#include "machine/wd17xx.h"
#include "imagedev/flopdrv.h"
@@ -157,13 +156,7 @@ READ8_MEMBER(pk8020_state::devices_r)
case 1 : return m_rs232->status_r(space,0);
}
break;
- case 0x18: switch(offset & 3) {
- case 0 : return m_wd1793->status_r(space, 0);
- case 1 : return m_wd1793->track_r(space, 0);
- case 2 : return m_wd1793->sector_r(space, 0);
- case 3 : return m_wd1793->data_r(space, 0);
- }
- break;
+ case 0x18: return m_wd1793->read(space, offset & 0x03);
case 0x20: switch(offset & 1) {
case 0 : return m_lan->data_r(space,0);
case 1 : return m_lan->status_r(space,0);
@@ -187,13 +180,9 @@ WRITE8_MEMBER(pk8020_state::devices_w)
case 1 : m_rs232->control_w(space,0,data); break;
}
break;
- case 0x18: switch(offset & 3) {
- case 0 : m_wd1793->command_w(space, 0,data);break;
- case 1 : m_wd1793->track_w(space, 0,data);break;
- case 2 : m_wd1793->sector_w(space, 0,data);break;
- case 3 : m_wd1793->data_w(space, 0,data);break;
- }
- break;
+ case 0x18:
+ m_wd1793->write(space, offset & 0x03, data);
+ break;
case 0x20: switch(offset & 1) {
case 0 : m_lan->data_w(space,0,data); break;
case 1 : m_lan->control_w(space,0,data); break;
@@ -841,29 +830,28 @@ WRITE8_MEMBER(pk8020_state::pk8020_portc_w)
WRITE8_MEMBER(pk8020_state::pk8020_portb_w)
{
+ floppy_image_device *floppy = NULL;
+
// Turn all motors off
- floppy_get_device(machine(), 0)->floppy_mon_w(1);
- floppy_get_device(machine(), 1)->floppy_mon_w(1);
- floppy_get_device(machine(), 2)->floppy_mon_w(1);
- floppy_get_device(machine(), 3)->floppy_mon_w(1);
- m_wd1793->set_side(BIT(data,4));
- if (BIT(data,0)) {
- m_wd1793->set_drive(0);
- floppy_get_device(machine(), 0)->floppy_mon_w(0);
- floppy_get_device(machine(), 0)->floppy_drive_set_ready_state(1, 1);
- } else if (BIT(data,1)) {
- m_wd1793->set_drive(1);
- floppy_get_device(machine(), 1)->floppy_mon_w(0);
- floppy_get_device(machine(), 1)->floppy_drive_set_ready_state(1, 1);
- } else if (BIT(data,2)) {
- m_wd1793->set_drive(2);
- floppy_get_device(machine(), 2)->floppy_mon_w(0);
- floppy_get_device(machine(), 2)->floppy_drive_set_ready_state(1, 1);
- } else if (BIT(data,3)) {
- m_wd1793->set_drive(3);
- floppy_get_device(machine(), 3)->floppy_mon_w(0);
- floppy_get_device(machine(), 3)->floppy_drive_set_ready_state(1, 1);
+ if (m_floppy0->get_device()) m_floppy0->get_device()->mon_w(1);
+ if (m_floppy1->get_device()) m_floppy1->get_device()->mon_w(1);
+ if (m_floppy2->get_device()) m_floppy2->get_device()->mon_w(1);
+ if (m_floppy3->get_device()) m_floppy3->get_device()->mon_w(1);
+
+ if (BIT(data, 0)) floppy = m_floppy0->get_device();
+ if (BIT(data, 1)) floppy = m_floppy1->get_device();
+ if (BIT(data, 2)) floppy = m_floppy2->get_device();
+ if (BIT(data, 3)) floppy = m_floppy3->get_device();
+
+ m_wd1793->set_floppy(floppy);
+
+ if (floppy)
+ {
+ floppy->mon_w(0);
+ floppy->ss_w(BIT(data, 4));
}
+
+ // todo: at least bit 5 and bit 7 is connected to something too...
}
READ8_MEMBER(pk8020_state::pk8020_portc_r)
diff --git a/src/mess/machine/rm380z.c b/src/mess/machine/rm380z.c
index 4fb941b82b9..082dbf6ff75 100644
--- a/src/mess/machine/rm380z.c
+++ b/src/mess/machine/rm380z.c
@@ -210,41 +210,18 @@ WRITE8_MEMBER( rm380z_state::keyboard_put )
WRITE8_MEMBER( rm380z_state::disk_0_control )
{
- fd1771_device *fdc = machine().device<fd1771_device>("wd1771");
+ floppy_image_device *floppy = NULL;
- //printf("disk drive port0 write [%x]\n",data);
+ if (BIT(data, 0)) floppy = m_floppy0->get_device();
+ if (BIT(data, 1)) floppy = m_floppy1->get_device();
- // drive port0
- if (data&0x01)
- {
- // drive select bit 0
- fdc->set_drive(0);
- }
-
- if (data&0x02)
- {
- // drive select bit 1
- fdc->set_drive(1);
- }
-
- if (data&0x08)
- {
- // motor on
- }
-
- // "MSEL (dir/side select bit)"
- if (data&0x20)
- {
- fdc->set_side(1);
- }
- else
- {
- fdc->set_side(0);
- }
+ m_fdc->set_floppy(floppy);
- // set drive en- (?)
- if (data&0x40)
+ if (floppy)
{
+ // don't know how motor on is connected
+ floppy->mon_w(0);
+ floppy->ss_w(BIT(data, 5));
}
}
diff --git a/src/mess/machine/rmnimbus.c b/src/mess/machine/rmnimbus.c
index a256bcea123..2670e1968c9 100644
--- a/src/mess/machine/rmnimbus.c
+++ b/src/mess/machine/rmnimbus.c
@@ -244,7 +244,8 @@ static void nimbus_debug(running_machine &machine, int ref, int params, const ch
rmnimbus_state *state = machine.driver_data<rmnimbus_state>();
if(params>0)
{
- sscanf(param[0],"%d",&state->m_debug_machine);
+ int temp;
+ sscanf(param[0],"%d",&temp); state->m_debug_machine = temp;
}
else
{
diff --git a/src/mess/machine/smartmed.c b/src/mess/machine/smartmed.c
index fcbb3966dad..32e9c53bcaa 100644
--- a/src/mess/machine/smartmed.c
+++ b/src/mess/machine/smartmed.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Raphael Nabet
/*
smartmed.c: SmartMedia Flash ROM emulation
diff --git a/src/mess/machine/smartmed.h b/src/mess/machine/smartmed.h
index 1e6c1d0b50c..4f15cf35a0f 100644
--- a/src/mess/machine/smartmed.h
+++ b/src/mess/machine/smartmed.h
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Raphael Nabet
/*
smartmed.h: header file for smartmed.c
diff --git a/src/mess/machine/sms.c b/src/mess/machine/sms.c
index 5c4d15f2155..89e478c9ba2 100644
--- a/src/mess/machine/sms.c
+++ b/src/mess/machine/sms.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Wilbert Pol, Charles MacDonald,Mathis Rosenhauer,Brad Oliver,Michael Luong,Fabio Priuli,Enik Land
#include "emu.h"
#include "crsshair.h"
diff --git a/src/mess/machine/snescx4.c b/src/mess/machine/snescx4.c
index 26271e9a751..a4a200452a2 100644
--- a/src/mess/machine/snescx4.c
+++ b/src/mess/machine/snescx4.c
@@ -1,5 +1,5 @@
// license:GPL-2.0+
-// copyright-holders:Fabio Priuli, byuu
+// copyright-holders:Fabio Priuli, byuu, Nach
/***************************************************************************
snescx4.c
diff --git a/src/mess/machine/snescx4.h b/src/mess/machine/snescx4.h
index 3a553bfe745..1adca638a39 100644
--- a/src/mess/machine/snescx4.h
+++ b/src/mess/machine/snescx4.h
@@ -1,5 +1,5 @@
// license:GPL-2.0+
-// copyright-holders:Fabio Priuli, byuu
+// copyright-holders:Fabio Priuli, byuu, Nach
/***************************************************************************
snescx4.h
diff --git a/src/mess/machine/sonydriv.c b/src/mess/machine/sonydriv.c
index da47caaf37a..31c88e4f988 100644
--- a/src/mess/machine/sonydriv.c
+++ b/src/mess/machine/sonydriv.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Nathan Woods, Raphael Nabet, R. Belmont
/*********************************************************************
diff --git a/src/mess/machine/sonydriv.h b/src/mess/machine/sonydriv.h
index 3ebd46cb601..52ecca6697a 100644
--- a/src/mess/machine/sonydriv.h
+++ b/src/mess/machine/sonydriv.h
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Nathan Woods, Raphael Nabet, R. Belmont
/*********************************************************************
diff --git a/src/mess/machine/svi318.c b/src/mess/machine/svi318.c
index aa2525d365b..89ea87ce0e8 100644
--- a/src/mess/machine/svi318.c
+++ b/src/mess/machine/svi318.c
@@ -12,7 +12,6 @@
#include "includes/svi318.h"
#include "cpu/z80/z80.h"
#include "video/tms9928a.h"
-#include "machine/wd17xx.h"
#include "imagedev/flopdrv.h"
#include "formats/svi_cas.h"
#include "sound/ay8910.h"
@@ -223,23 +222,26 @@ WRITE_LINE_MEMBER(svi318_state::fdc_drq_w)
WRITE8_MEMBER(svi318_state::fdc_drive_motor_w)
{
- switch (data & 3)
- {
- case 1:
- m_fd1793->set_drive(0);
- m_driveselect = 0;
- break;
- case 2:
- m_fd1793->set_drive(1);
- m_driveselect = 1;
- break;
- }
+ m_floppy = NULL;
+
+ if (BIT(data, 0)) m_floppy = m_floppy0->get_device();
+ if (BIT(data, 1)) m_floppy = m_floppy1->get_device();
+
+ m_fd1793->set_floppy(m_floppy);
+
+ if (m_floppy0->get_device())
+ m_floppy0->get_device()->mon_w(!BIT(data, 2));
+
+ if (m_floppy1->get_device())
+ m_floppy1->get_device()->mon_w(!BIT(data, 3));
}
WRITE8_MEMBER(svi318_state::fdc_density_side_w)
{
m_fd1793->dden_w(BIT(data, 0));
- m_fd1793->set_side(BIT(data, 1));
+
+ if (m_floppy)
+ m_floppy->ss_w(BIT(data, 1));
}
READ8_MEMBER(svi318_state::fdc_irqdrq_r)
@@ -445,10 +447,8 @@ void svi318_state::machine_start()
}
// register for savestates
- save_item(NAME(m_driveselect));
save_item(NAME(m_drq));
save_item(NAME(m_irq));
- save_item(NAME(m_heads));
save_item(NAME(m_bank_switch));
save_item(NAME(m_bank_low));
@@ -465,34 +465,12 @@ void svi318_state::machine_start()
machine().save().register_postload(save_prepost_delegate(FUNC(svi318_state::postload), this));
}
-
-static void svi318_load_proc(device_image_interface &image)
-{
- svi318_state *state = image.device().machine().driver_data<svi318_state>();
- int size = image.length();
- int id = floppy_get_drive(&image.device());
-
- switch (size)
- {
- case 172032: /* SVI-328 SSDD */
- state->m_heads[id] = 1;
- break;
- case 346112: /* SVI-328 DSDD */
- state->m_heads[id] = 2;
- break;
- case 348160: /* SVI-728 DSDD CP/M */
- state->m_heads[id] = 2;
- break;
- }
-}
-
void svi318_state::machine_reset()
{
m_keyboard_row = 0;
m_centronics_busy = 0;
m_svi806_present = 0;
m_svi806_ram_enabled = 0;
- m_driveselect = 0;
m_drq = 0;
m_irq = 0;
@@ -504,9 +482,6 @@ void svi318_state::machine_reset()
m_bank_switch = 0xff;
set_banks();
-
- for (int drive = 0; drive < 2; drive++)
- floppy_get_device(machine(), drive)->floppy_install_load_proc(svi318_load_proc);
}
/* Memory */
@@ -760,7 +735,7 @@ WRITE8_MEMBER(svi318_state::io_ext_w)
break;
case 0x30:
- m_fd1793->command_w(space, 0, data);
+ m_fd1793->cmd_w(space, 0, data);
break;
case 0x31:
m_fd1793->track_w(space, 0, data);
diff --git a/src/mess/machine/swtpc09.c b/src/mess/machine/swtpc09.c
index 719eb29ce0c..29bae501462 100644
--- a/src/mess/machine/swtpc09.c
+++ b/src/mess/machine/swtpc09.c
@@ -126,52 +126,22 @@ WRITE8_MEMBER ( swtpc09_state::dmf2_control_reg_w )
{
LOG(("swtpc09_dmf2_control_reg_w $%02X\n", data));
- switch (data & 0x0F)
- {
- case 0x0e:
- m_fdc->set_drive(0);
- // need to set drive ready as sw checks before doing anything
- machine().device<legacy_floppy_image_device>("floppy0")->floppy_drive_set_ready_state(1,0);
- break;
- case 0x0d:
- m_fdc->set_drive(1);
- machine().device<legacy_floppy_image_device>("floppy1")->floppy_drive_set_ready_state(1,0);
- break;
-
- case 0x0b:
- m_fdc->set_drive(2);
- machine().device<legacy_floppy_image_device>("floppy2")->floppy_drive_set_ready_state(1,0);
- break;
-
- case 0x07:
- m_fdc->set_drive(3);
- machine().device<legacy_floppy_image_device>("floppy3")->floppy_drive_set_ready_state(1,0);
- break;
+ floppy_image_device *floppy = NULL;
- default:
- break;
- }
+ if (!BIT(data, 0)) floppy = m_floppy0->get_device();
+ if (!BIT(data, 1)) floppy = m_floppy1->get_device();
+ if (!BIT(data, 2)) floppy = m_floppy2->get_device();
+ if (!BIT(data, 3)) floppy = m_floppy3->get_device();
- // ignore side select in emulation due to sector numbering
- ////side select
- //if (!(data & 0x10)) {
- // wd17xx_set_side(fdc, 1);
- //}
- //if (data & 0x10) {
- // wd17xx_set_side(fdc, 0);
- //}
+ m_fdc->set_floppy(floppy);
-
- /* bit 5 dden select */
-
- if (!(data & 0x20)) {
- m_fdc->dden_w(0);
- LOG(("Density single\n"));
- }
- if (data & 0x20) {
- m_fdc->dden_w(1);
- LOG(("Density double\n"));
+ if (floppy)
+ {
+ floppy->mon_w(0);
+ floppy->ss_w(!BIT(data, 4));
}
+
+ m_fdc->dden_w(!BIT(data, 5));
}
/* FDC controller dma transfer */
@@ -384,52 +354,22 @@ WRITE8_MEMBER ( swtpc09_state::dmf3_control_reg_w )
{
LOG(("swtpc09_dmf3_control_reg_w $%02X\n", data));
- switch (data & 0x0F)
- {
- case 0x01:
- m_fdc->set_drive(0);
- // need to set drive ready as sw checks before doing anything
- machine().device<legacy_floppy_image_device>("floppy0")->floppy_drive_set_ready_state(1,0);
- break;
- case 0x02:
- m_fdc->set_drive(1);
- machine().device<legacy_floppy_image_device>("floppy1")->floppy_drive_set_ready_state(1,0);
- break;
-
- case 0x04:
- m_fdc->set_drive(2);
- machine().device<legacy_floppy_image_device>("floppy2")->floppy_drive_set_ready_state(1,0);
- break;
-
- case 0x08:
- m_fdc->set_drive(3);
- machine().device<legacy_floppy_image_device>("floppy3")->floppy_drive_set_ready_state(1,0);
- break;
-
- default:
- break;
- }
-
- // ignore side select in emulation due to sector numbering
- ////side select
- //if (!(data & 0x10)) {
- // wd17xx_set_side(fdc, 1);
- //}
- //if (data & 0x10) {
- // wd17xx_set_side(fdc, 0);
- //}
+ floppy_image_device *floppy = NULL;
+ if (BIT(data, 0)) floppy = m_floppy0->get_device();
+ if (BIT(data, 1)) floppy = m_floppy1->get_device();
+ if (BIT(data, 2)) floppy = m_floppy2->get_device();
+ if (BIT(data, 3)) floppy = m_floppy3->get_device();
- /* bit 5 dden select */
+ m_fdc->set_floppy(floppy);
- if (data & 0x20) {
- m_fdc->dden_w(0);
- LOG(("Density single\n"));
- }
- if (!(data & 0x20)) {
- m_fdc->dden_w(1);
- LOG(("Density double\n"));
+ if (floppy)
+ {
+ floppy->mon_w(0);
+ floppy->ss_w(BIT(data, 4));
}
+
+ m_fdc->dden_w(BIT(data, 5));
}
// DC4 drive select
@@ -438,33 +378,14 @@ WRITE8_MEMBER ( swtpc09_state::dc4_control_reg_w )
{
LOG(("swtpc09_dc4_control_reg_w $%02X\n", data));
- switch (data & 0x03)
- {
- case 0x00:
- m_fdc->set_drive(0);
- // need to set drive ready as sw checks before doing anything
- machine().device<legacy_floppy_image_device>("floppy0")->floppy_drive_set_ready_state(1,0);
- break;
- case 0x01:
- m_fdc->set_drive(1);
- machine().device<legacy_floppy_image_device>("floppy1")->floppy_drive_set_ready_state(1,0);
- break;
+ floppy_image_device *floppy = NULL;
- case 0x02:
- m_fdc->set_drive(2);
- machine().device<legacy_floppy_image_device>("floppy2")->floppy_drive_set_ready_state(1,0);
- break;
-
- case 0x03:
- m_fdc->set_drive(3);
- machine().device<legacy_floppy_image_device>("floppy3")->floppy_drive_set_ready_state(1,0);
- break;
-
- default:
- break;
- }
+ if (BIT(data, 0)) floppy = m_floppy0->get_device();
+ if (BIT(data, 1)) floppy = m_floppy1->get_device();
+ if (BIT(data, 2)) floppy = m_floppy2->get_device();
+ if (BIT(data, 3)) floppy = m_floppy3->get_device();
- // ignore side select in emulation due to sector numbering
+ m_fdc->set_floppy(floppy);
}
@@ -537,7 +458,7 @@ WRITE8_MEMBER(swtpc09_state::dat_w)
address_space &mem = m_maincpu->space(AS_PROGRAM);
- fd1793_device *fdc = machine().device<fd1793_device>("fdc");
+ fd1793_t *fdc = machine().device<fd1793_t>("fdc");
pia6821_device *pia = machine().device<pia6821_device>("pia");
ptm6840_device *ptm = machine().device<ptm6840_device>("ptm");
acia6850_device *acia = machine().device<acia6850_device>("acia");
@@ -574,7 +495,7 @@ WRITE8_MEMBER(swtpc09_state::dat_w)
mem.install_readwrite_handler(logical_address+0x004, logical_address+0x004, read8_delegate(FUNC(acia6850_device::status_r), acia), write8_delegate(FUNC(acia6850_device::control_w),acia));
mem.install_readwrite_handler(logical_address+0x005, logical_address+0x005, read8_delegate(FUNC(acia6850_device::data_r), acia), write8_delegate(FUNC(acia6850_device::data_w),acia));
mem.install_write_handler(logical_address+0x014, logical_address+0x014, write8_delegate(FUNC(swtpc09_state::dc4_control_reg_w),this));
- mem.install_readwrite_handler(logical_address+0x018, logical_address+0x01b, read8_delegate(FUNC(fd1793_device::read), fdc), write8_delegate(FUNC(fd1793_device::write),fdc));
+ mem.install_readwrite_handler(logical_address+0x018, logical_address+0x01b, read8_delegate(FUNC(fd1793_t::read), fdc), write8_delegate(FUNC(fd1793_t::write),fdc));
//mem.nop_readwrite(logical_address+0x01c, logical_address+0x05f);
mem.install_readwrite_handler(logical_address+0x060, logical_address+0x06f, read8_delegate(FUNC(pia6821_device::read), piaide), write8_delegate(FUNC(pia6821_device::write), piaide));
//mem.nop_readwrite(logical_address+0x070, logical_address+0x07f);
@@ -598,7 +519,7 @@ WRITE8_MEMBER(swtpc09_state::dat_w)
if (m_system_type == UNIFLEX_DMF2 || m_system_type == FLEX_DMF2) // if DMF2 conroller this is the map
{
mem.install_readwrite_handler(logical_address+0x000, logical_address+0x01f, read8_delegate(FUNC(swtpc09_state::m6844_r),this), write8_delegate(FUNC(swtpc09_state::m6844_w),this));
- mem.install_readwrite_handler(logical_address+0x020, logical_address+0x023, read8_delegate(FUNC(fd1793_device::read), fdc), write8_delegate(FUNC(fd1793_device::write),fdc));
+ mem.install_readwrite_handler(logical_address+0x020, logical_address+0x023, read8_delegate(FUNC(fd1793_t::read), fdc), write8_delegate(FUNC(fd1793_t::write),fdc));
mem.install_readwrite_handler(logical_address+0x024, logical_address+0x03f, read8_delegate(FUNC(swtpc09_state::dmf2_control_reg_r),this), write8_delegate(FUNC(swtpc09_state::dmf2_control_reg_w),this));
mem.install_readwrite_handler(logical_address+0x040, logical_address+0x041, read8_delegate(FUNC(swtpc09_state::dmf2_dma_address_reg_r),this), write8_delegate(FUNC(swtpc09_state::dmf2_dma_address_reg_w),this));
//mem.nop_readwrite(logical_address+0x042, logical_address+0x7ff);
@@ -608,7 +529,7 @@ WRITE8_MEMBER(swtpc09_state::dat_w)
else if (m_system_type == FLEX_DC4_PIAIDE) // 2k ram for piaide on s09 board
{
//mem.install_readwrite_handler(logical_address+0x000, logical_address+0x01f, read8_delegate(FUNC(swtpc09_state::m6844_r),this), write8_delegate(FUNC(swtpc09_state::m6844_w),this));
- //mem.install_readwrite_handler(logical_address+0x020, logical_address+0x023, read8_delegate(FUNC(fd1793_device::read), fdc), write8_delegate(FUNC(fd1793_device::write),fdc));
+ //mem.install_readwrite_handler(logical_address+0x020, logical_address+0x023, read8_delegate(FUNC(fd1793_t::read), fdc), write8_delegate(FUNC(fd1793_t::write),fdc));
//mem.install_readwrite_handler(logical_address+0x024, logical_address+0x03f, read8_delegate(FUNC(swtpc09_state::dmf2_control_reg_r),this), write8_delegate(FUNC(swtpc09_state::dmf2_control_reg_w),this));
//mem.install_readwrite_handler(logical_address+0x040, logical_address+0x041, read8_delegate(FUNC(swtpc09_state::dmf2_dma_address_reg_r),this), write8_delegate(FUNC(swtpc09_state::dmf2_dma_address_reg_w),this));
mem.install_ram(logical_address+0x000, logical_address+0x7ff, &RAM[0xf000]);
@@ -618,7 +539,7 @@ WRITE8_MEMBER(swtpc09_state::dat_w)
else // assume DMF3 controller
{
mem.install_readwrite_handler(logical_address+0x000, logical_address+0x01f, read8_delegate(FUNC(swtpc09_state::m6844_r),this), write8_delegate(FUNC(swtpc09_state::m6844_w),this));
- mem.install_readwrite_handler(logical_address+0x020, logical_address+0x023, read8_delegate(FUNC(fd1793_device::read), fdc), write8_delegate(FUNC(fd1793_device::write),fdc));
+ mem.install_readwrite_handler(logical_address+0x020, logical_address+0x023, read8_delegate(FUNC(fd1793_t::read), fdc), write8_delegate(FUNC(fd1793_t::write),fdc));
mem.install_readwrite_handler(logical_address+0x024, logical_address+0x024, read8_delegate(FUNC(swtpc09_state::dmf3_control_reg_r),this), write8_delegate(FUNC(swtpc09_state::dmf3_control_reg_w),this));
mem.install_readwrite_handler(logical_address+0x025, logical_address+0x025, read8_delegate(FUNC(swtpc09_state::dmf3_dma_address_reg_r),this), write8_delegate(FUNC(swtpc09_state::dmf3_dma_address_reg_w),this));
//mem.nop_readwrite(logical_address+0x030, logical_address+0x03f);
diff --git a/src/mess/machine/thomflop.c b/src/mess/machine/thomflop.c
index e418ed04e6b..bc84715d253 100644
--- a/src/mess/machine/thomflop.c
+++ b/src/mess/machine/thomflop.c
@@ -9,7 +9,7 @@
**********************************************************************/
#include "includes/thomson.h"
-#include "machine/wd17xx.h"
+#include "machine/wd_fdc.h"
#define VERBOSE 0 /* 0, 1 or 2 */
@@ -275,7 +275,7 @@ static UINT8 to7_5p14_select;
READ8_MEMBER( thomson_state::to7_5p14_r )
{
- wd2793_device *fdc = machine().device<wd2793_device>("wd2793");
+ wd2793_t *fdc = machine().device<wd2793_t>("wd2793");
if ( offset < 4 )
return fdc->read(space, offset );
@@ -290,37 +290,24 @@ READ8_MEMBER( thomson_state::to7_5p14_r )
WRITE8_MEMBER( thomson_state::to7_5p14_w )
{
- wd2793_device *fdc = machine().device<wd2793_device>("wd2793");
+ wd2793_t *fdc = machine().device<wd2793_t>("wd2793");
if ( offset < 4 )
fdc->write(space, offset, data );
else if ( offset == 8 )
{
/* drive select */
- int drive = -1, side = 0;
+ floppy_image_device *floppy = NULL;
- switch ( data & 7 )
- {
- case 0: break;
- case 2: drive = 0; side = 0; break;
- case 3: drive = 1; side = 1; break;
- case 4: drive = 2; side = 0; break;
- case 5: drive = 3; side = 1; break;
- default:
- logerror( "%f $%04x to7_5p14_w: invalid drive select pattern $%02X\n", machine().time().as_double(), m_maincpu->pc(), data );
- }
+ if (BIT(data, 1)) floppy = fdc->subdevice<floppy_connector>("0")->get_device();
+ if (BIT(data, 2)) floppy = fdc->subdevice<floppy_connector>("1")->get_device();
- fdc->dden_w(BIT(data, 7));
+ fdc->set_floppy(floppy);
- to7_5p14_select = data;
-
- if ( drive != -1 )
+ if (floppy)
{
thom_floppy_active( 0 );
- fdc->set_drive( drive );
- fdc->set_side( side );
- LOG(( "%f $%04x to7_5p14_w: $%02X set drive=%i side=%i density=%s\n",
- machine().time().as_double(), m_maincpu->pc(),
- data, drive, side, (BIT(data, 7) ? "FM" : "MFM")));
+ floppy->mon_w(0);
+ floppy->ss_w(BIT(data, 0));
}
}
else
@@ -332,7 +319,7 @@ WRITE8_MEMBER( thomson_state::to7_5p14_w )
void thomson_state::to7_5p14_reset()
{
- wd2793_device *fdc = machine().device<wd2793_device>("wd2793");
+ wd2793_t *fdc = machine().device<wd2793_t>("wd2793");
LOG(( "to7_5p14_reset: CD 90-640 controller\n" ));
fdc->reset();
}
@@ -1911,7 +1898,6 @@ void thomson_state::thomson_index_callback(legacy_floppy_image_device *device, i
break;
case 2:
- machine().device<wd2793_device>("wd2793")->index_pulse_callback(device, state);
break;
case 3:
diff --git a/src/mess/machine/thomson.c b/src/mess/machine/thomson.c
index afa4f473cda..471a29c2139 100644
--- a/src/mess/machine/thomson.c
+++ b/src/mess/machine/thomson.c
@@ -1519,7 +1519,7 @@ DEVICE_IMAGE_LOAD_MEMBER( thomson_state, mo5_cartridge )
else
{
std::string errmsg;
- strprintf(errmsg,"Invalid cartridge size %" I64FMT "d", size);
+ strprintf(errmsg,"Invalid cartridge size %d", (int)size);
image.seterror(IMAGE_ERROR_UNSUPPORTED, errmsg.c_str());
return IMAGE_INIT_FAIL;
}
diff --git a/src/mess/machine/ti99/990_dk.c b/src/mess/machine/ti99/990_dk.c
index 31732b1a35d..5eb8ea58892 100644
--- a/src/mess/machine/ti99/990_dk.c
+++ b/src/mess/machine/ti99/990_dk.c
@@ -1,4 +1,4 @@
-// license:???
+// license:GPL-2.0+
// copyright-holders:Raphael Nabet
/*
990_dk.c: emulation of a TI FD800 'Diablo' floppy disk controller
@@ -17,7 +17,6 @@
#include "emu.h"
-#include "formats/basicdsk.h"
#include "990_dk.h"
/* status bits */
@@ -104,22 +103,22 @@ void fd800_machine_init(void (*interrupt_callback)(running_machine &machine, int
*/
int fd800_legacy_device::read_id(int unit, int head, int *cylinder_id, int *sector_id)
{
- /*UINT8 revolution_count;*/
- chrn_id id;
+ //UINT8 revolution_count;*/
+ // chrn_id id;
- /*revolution_count = 0;*/
+ //revolution_count = 0;*/
/*while (revolution_count < 2)*/
/*{*/
- if (m_drv[unit].img->floppy_drive_get_next_id(head, &id))
- {
- if (cylinder_id)
- *cylinder_id = id.C;
- if (sector_id)
- *sector_id = id.R;
- return TRUE;
- }
- /*}*/
+ /* if (m_drv[unit].img->floppy_drive_get_next_id(head, &id))
+ {
+ if (cylinder_id)
+ *cylinder_id = id.C;
+ if (sector_id)
+ *sector_id = id.R;
+ return TRUE;
+ }
+ }*/
return FALSE;
}
@@ -136,26 +135,26 @@ int fd800_legacy_device::read_id(int unit, int head, int *cylinder_id, int *sect
*/
int fd800_legacy_device::find_sector(int unit, int head, int sector, int *data_id)
{
- UINT8 revolution_count;
- chrn_id id;
+/* UINT8 revolution_count;
+ chrn_id id;
- revolution_count = 0;
-
- while (revolution_count < 2)
- {
- if (m_drv[unit].img->floppy_drive_get_next_id(head, &id))
- {
- /* compare id */
- if ((id.R == sector) && (id.N == 0))
- {
- *data_id = id.data_id;
- /* get ddam status */
- /*w->ddam = id.flags & ID_FLAG_DELETED_DATA;*/
- return TRUE;
- }
- }
- }
+ revolution_count = 0;
+ while (revolution_count < 2)
+ {
+ if (m_drv[unit].img->floppy_drive_get_next_id(head, &id))
+ {
+ // compare id
+ if ((id.R == sector) && (id.N == 0))
+ {
+ *data_id = id.data_id;
+ // get ddam status
+ // w->ddam = id.flags & ID_FLAG_DELETED_DATA;
+ return TRUE;
+ }
+ }
+ }
+*/
return FALSE;
}
@@ -170,56 +169,57 @@ int fd800_legacy_device::find_sector(int unit, int head, int sector, int *data_i
*/
int fd800_legacy_device::do_seek(int unit, int cylinder, int head)
{
- int retries;
+/* int retries;
- if (cylinder > 76)
- {
- m_stat_reg |= status_invalid_cmd;
- return TRUE;
- }
+ if (cylinder > 76)
+ {
+ m_stat_reg |= status_invalid_cmd;
+ return TRUE;
+ }
- if (m_drv[unit].img == NULL || !m_drv[unit].img->exists())
- {
- m_stat_reg |= status_drv_not_ready; /* right??? */
- return TRUE;
- }
+ if (m_drv[unit].img == NULL || !m_drv[unit].img->exists())
+ {
+ m_stat_reg |= status_drv_not_ready;
+ return TRUE;
+ }
- if (m_drv[unit].log_cylinder[head] == -1)
- { /* current track ID is unknown: read it */
- if (!read_id(unit, head, &m_drv[unit].log_cylinder[head], NULL))
- {
- m_stat_reg |= status_ID_not_found;
- return TRUE;
- }
- }
- /* exit if we are already at the requested track */
- if (m_drv[unit].log_cylinder[head] == cylinder)
- {
- /*m_stat_reg |= status_OP_complete;*/
- return FALSE;
- }
- for (retries=0; retries<10; retries++)
- { /* seek to requested track */
- m_drv[unit].img->floppy_drive_seek(cylinder-m_drv[unit].log_cylinder[head]);
- /* update physical track position */
- if (m_drv[unit].phys_cylinder != -1)
- m_drv[unit].phys_cylinder += cylinder-m_drv[unit].log_cylinder[head];
- /* read new track ID */
- if (!read_id(unit, head, &m_drv[unit].log_cylinder[head], NULL))
- {
- m_drv[unit].log_cylinder[head] = -1;
- m_stat_reg |= status_ID_not_found;
- return TRUE;
- }
- /* exit if we have reached the requested track */
- if (m_drv[unit].log_cylinder[head] == cylinder)
- {
- /*m_stat_reg |= status_OP_complete;*/
- return FALSE;
- }
- }
- /* track not found */
- m_stat_reg |= status_seek_err;
+ if (m_drv[unit].log_cylinder[head] == -1)
+ {
+ if (!read_id(unit, head, &m_drv[unit].log_cylinder[head], NULL))
+ {
+ m_stat_reg |= status_ID_not_found;
+ return TRUE;
+ }
+ }
+
+ if (m_drv[unit].log_cylinder[head] == cylinder)
+ {
+
+ return FALSE;
+ }
+ for (retries=0; retries<10; retries++)
+ {
+ m_drv[unit].img->floppy_drive_seek(cylinder-m_drv[unit].log_cylinder[head]);
+
+ if (m_drv[unit].phys_cylinder != -1)
+ m_drv[unit].phys_cylinder += cylinder-m_drv[unit].log_cylinder[head];
+
+ if (!read_id(unit, head, &m_drv[unit].log_cylinder[head], NULL))
+ {
+ m_drv[unit].log_cylinder[head] = -1;
+ m_stat_reg |= status_ID_not_found;
+ return TRUE;
+ }
+
+ if (m_drv[unit].log_cylinder[head] == cylinder)
+ {
+
+ return FALSE;
+ }
+ }
+
+ m_stat_reg |= status_seek_err;
+ */
return TRUE;
}
@@ -232,32 +232,32 @@ int fd800_legacy_device::do_seek(int unit, int cylinder, int head)
*/
int fd800_legacy_device::do_restore(int unit)
{
- int seek_count = 0;
- int seek_complete;
+ int seek_complete = 0;
+/* int seek_count = 0;
- if (!m_drv[unit].img->exists())
- {
- m_stat_reg |= status_drv_not_ready; /* right??? */
- return TRUE;
- }
+ if (!m_drv[unit].img->exists())
+ {
+ m_stat_reg |= status_drv_not_ready;
+ return TRUE;
+ }
- /* limit iterations to 76 to prevent an endless loop if the disc is locked */
- while (!(seek_complete = !m_drv[unit].img->floppy_tk00_r()) && (seek_count < 76))
- {
- m_drv[unit].img->floppy_drive_seek(-1);
- seek_count++;
- }
- if (! seek_complete)
- {
- m_drv[unit].phys_cylinder = -1;
- m_stat_reg |= status_seek_err;
- }
- else
- {
- m_drv[unit].phys_cylinder = 0;
- /*m_stat_reg |= status_OP_complete;*/
- }
+ while (!(seek_complete = !m_drv[unit].img->floppy_tk00_r()) && (seek_count < 76))
+ {
+ m_drv[unit].img->floppy_drive_seek(-1);
+ seek_count++;
+ }
+ if (! seek_complete)
+ {
+ m_drv[unit].phys_cylinder = -1;
+ m_stat_reg |= status_seek_err;
+ }
+ else
+ {
+ m_drv[unit].phys_cylinder = 0;
+
+ }
+*/
return ! seek_complete;
}
@@ -266,27 +266,28 @@ int fd800_legacy_device::do_restore(int unit)
*/
void fd800_legacy_device::do_read(void)
{
- int data_id;
+/* int data_id;
- if ((m_sector == 0) || (m_sector > 26))
- {
- m_stat_reg |= status_invalid_cmd;
- return;
- }
+ if ((m_sector == 0) || (m_sector > 26))
+ {
+ m_stat_reg |= status_invalid_cmd;
+ return;
+ }
- if (!find_sector(m_unit, m_head, m_sector, &data_id))
- {
- m_stat_reg |= status_ID_not_found;
- return;
- }
+ if (!find_sector(m_unit, m_head, m_sector, &data_id))
+ {
+ m_stat_reg |= status_ID_not_found;
+ return;
+ }
- m_drv[m_unit].img->floppy_drive_read_sector_data(m_head, data_id, m_buf, 128);
- m_buf_pos = 0;
- m_buf_mode = bm_read;
- m_recv_buf = (m_buf[m_buf_pos<<1] << 8) | m_buf[(m_buf_pos<<1)+1];
+ m_drv[m_unit].img->floppy_drive_read_sector_data(m_head, data_id, m_buf, 128);
+ m_buf_pos = 0;
+ m_buf_mode = bm_read;
+ m_recv_buf = (m_buf[m_buf_pos<<1] << 8) | m_buf[(m_buf_pos<<1)+1];
- m_stat_reg |= status_XFER_ready;
- m_stat_reg |= status_OP_complete; /* right??? */
+ m_stat_reg |= status_XFER_ready;
+ m_stat_reg |= status_OP_complete;
+*/
}
/*
@@ -294,24 +295,24 @@ void fd800_legacy_device::do_read(void)
*/
void fd800_legacy_device::do_write(void)
{
- int data_id;
+/* int data_id;
- if (m_drv[m_unit].seclen < 64)
- /* fill with 0s */
- memset(m_buf+(m_drv[m_unit].seclen<<1), 0, (64-m_drv[m_unit].seclen)<<1);
+ if (m_drv[m_unit].seclen < 64)
+ memset(m_buf+(m_drv[m_unit].seclen<<1), 0, (64-m_drv[m_unit].seclen)<<1);
- if (!find_sector(m_unit, m_head, m_sector, &data_id))
- {
- m_stat_reg |= status_ID_not_found;
- return;
- }
+ if (!find_sector(m_unit, m_head, m_sector, &data_id))
+ {
+ m_stat_reg |= status_ID_not_found;
+ return;
+ }
- m_drv[m_unit].img->floppy_drive_write_sector_data(m_head, data_id, m_buf, 128, m_ddam);
- m_buf_pos = 0;
- m_buf_mode = bm_write;
+ m_drv[m_unit].img->floppy_drive_write_sector_data(m_head, data_id, m_buf, 128, m_ddam);
+ m_buf_pos = 0;
+ m_buf_mode = bm_write;
- m_stat_reg |= status_XFER_ready;
- m_stat_reg |= status_OP_complete; /* right??? */
+ m_stat_reg |= status_XFER_ready;
+ m_stat_reg |= status_OP_complete;
+*/
}
/*
@@ -319,363 +320,365 @@ void fd800_legacy_device::do_write(void)
*/
void fd800_legacy_device::do_cmd(void)
{
- int unit;
- int cylinder;
- int head;
- int seclen;
- int sector;
-
-
- if (m_buf_mode != bm_off)
- { /* All commands in the midst of read or write are interpreted as Stop */
- unit = (m_cmd_reg >> 10) & 3;
-
- /* reset status */
- m_stat_reg = unit << status_unit_shift;
-
- m_buf_pos = 0;
- m_buf_mode = bm_off;
+/*
+ int unit;
+ int cylinder;
+ int head;
+ int seclen;
+ int sector;
- m_stat_reg |= status_OP_complete;
- m_stat_reg |= status_interrupt;
- set_interrupt_line();
+ if (m_buf_mode != bm_off)
+ { // All commands in the midst of read or write are interpreted as Stop
+ unit = (m_cmd_reg >> 10) & 3;
- return;
- }
+ // reset status
+ m_stat_reg = unit << status_unit_shift;
- switch (m_cmd_reg >> 12)
- {
- case 0: /* select
- bits 16-25: 0s
- bits 26-27: unit number (0-3) */
- unit = (m_cmd_reg >> 10) & 3;
+ m_buf_pos = 0;
+ m_buf_mode = bm_off;
- /* reset status */
- m_stat_reg = unit << status_unit_shift;
+ m_stat_reg |= status_OP_complete;
- if (!m_drv[unit].img->exists())
- m_stat_reg |= status_drv_not_ready; /* right??? */
- else if (m_drv[unit].img->is_readonly())
- m_stat_reg |= status_write_prot;
- else
- m_stat_reg |= status_OP_complete;
+ m_stat_reg |= status_interrupt;
+ set_interrupt_line();
- m_stat_reg |= status_interrupt;
- set_interrupt_line();
- break;
+ return;
+ }
- case 1: /* seek
+ switch (m_cmd_reg >> 12)
+ {
+ case 0: // select
+ // bits 16-25: 0s
+ // bits 26-27: unit number (0-3)
+ unit = (m_cmd_reg >> 10) & 3;
+
+ // reset status
+ m_stat_reg = unit << status_unit_shift;
+
+ if (!m_drv[unit].img->exists())
+ m_stat_reg |= status_drv_not_ready; // right???
+ else if (m_drv[unit].img->is_readonly())
+ m_stat_reg |= status_write_prot;
+ else
+ m_stat_reg |= status_OP_complete;
+
+ m_stat_reg |= status_interrupt;
+ set_interrupt_line();
+ break;
+
+ case 1: // seek
bits 16-22: cylinder number (0-76)
bits 23-24: 0s
bits 25: head number (1=upper)
- bits 26-27: unit number (0-3) */
- unit = (m_cmd_reg >> 10) & 3;
- head = (m_cmd_reg >> 9) & 1;
- cylinder = m_cmd_reg & 0x7f;
+ bits 26-27: unit number (0-3)
+ unit = (m_cmd_reg >> 10) & 3;
+ head = (m_cmd_reg >> 9) & 1;
+ cylinder = m_cmd_reg & 0x7f;
- /* reset status */
- m_stat_reg = unit << status_unit_shift;
+ // reset status
+ m_stat_reg = unit << status_unit_shift;
- if (!do_seek(unit, cylinder, head))
- m_stat_reg |= status_OP_complete;
+ if (!do_seek(unit, cylinder, head))
+ m_stat_reg |= status_OP_complete;
- m_stat_reg |= status_interrupt;
- set_interrupt_line();
- break;
+ m_stat_reg |= status_interrupt;
+ set_interrupt_line();
+ break;
- case 2: /* restore
+ case 2: // restore
bits 16-25: 0s
- bits 26-27: unit number (0-3) */
- unit = (m_cmd_reg >> 10) & 3;
+ bits 26-27: unit number (0-3)
+ unit = (m_cmd_reg >> 10) & 3;
- /* reset status */
- m_stat_reg = unit << status_unit_shift;
+ // reset status
+ m_stat_reg = unit << status_unit_shift;
- if (!do_restore(unit))
- m_stat_reg |= status_OP_complete;
+ if (!do_restore(unit))
+ m_stat_reg |= status_OP_complete;
- m_stat_reg |= status_interrupt;
- set_interrupt_line();
- break;
+ m_stat_reg |= status_interrupt;
+ set_interrupt_line();
+ break;
- case 3: /* sector length
+ case 3: // sector length
bits 16-22: sector word count (0-64)
bits 23-25: 0s
- bits 26-27: unit number (0-3) */
- unit = (m_cmd_reg >> 10) & 3;
- seclen = m_cmd_reg & 0x7f;
-
- /* reset status */
- m_stat_reg = unit << status_unit_shift;
-
- if ((seclen > 64) || (seclen == 0))
- {
- m_stat_reg |= status_invalid_cmd;
- }
- else
- {
- m_drv[unit].seclen = seclen;
- m_stat_reg |= status_OP_complete;
- }
-
- m_stat_reg |= status_interrupt;
- set_interrupt_line();
- break;
-
- case 4: /* read
+ bits 26-27: unit number (0-3)
+ unit = (m_cmd_reg >> 10) & 3;
+ seclen = m_cmd_reg & 0x7f;
+
+ // reset status
+ m_stat_reg = unit << status_unit_shift;
+
+ if ((seclen > 64) || (seclen == 0))
+ {
+ m_stat_reg |= status_invalid_cmd;
+ }
+ else
+ {
+ m_drv[unit].seclen = seclen;
+ m_stat_reg |= status_OP_complete;
+ }
+
+ m_stat_reg |= status_interrupt;
+ set_interrupt_line();
+ break;
+
+ case 4: // read
bits 16-20: sector number (1-26)
bits 21-23: 0s
bit 24: no sequential sectoring (1=active)
bit 25: head number (1=upper)
- bits 26-27: unit number (0-3) */
- unit = (m_cmd_reg >> 10) & 3;
- head = (m_cmd_reg >> 9) & 1;
- /*non_seq_mode = (m_cmd_reg >> 8) & 1;*/
- sector = m_cmd_reg & 0x1f;
+ bits 26-27: unit number (0-3)
+ unit = (m_cmd_reg >> 10) & 3;
+ head = (m_cmd_reg >> 9) & 1;
+ //non_seq_mode = (m_cmd_reg >> 8) & 1;
+ sector = m_cmd_reg & 0x1f;
- m_unit = unit;
- m_head = head;
- m_sector = sector;
- /*m_non_seq_mode = non_seq_mode;*/
+ m_unit = unit;
+ m_head = head;
+ m_sector = sector;
+ //m_non_seq_mode = non_seq_mode;
- /* reset status */
- m_stat_reg = unit << status_unit_shift;
+ // reset status
+ m_stat_reg = unit << status_unit_shift;
- do_read();
+ do_read();
- m_stat_reg |= status_interrupt;
- set_interrupt_line();
- break;
+ m_stat_reg |= status_interrupt;
+ set_interrupt_line();
+ break;
- case 5: /* read ID
+ case 5: // read ID
bits 16-24: 0s
bit 25: head number (1=upper)
- bits 26-27: unit number (0-3) */
- unit = (m_cmd_reg >> 10) & 3;
- head = (m_cmd_reg >> 9) & 1;
-
- /* reset status */
- m_stat_reg = unit << status_unit_shift;
-
- if (!read_id(unit, head, &cylinder, &sector))
- {
- m_stat_reg |= status_ID_not_found;
- }
- else
- {
- m_recv_buf = (cylinder << 8) | sector;
- m_stat_reg |= status_OP_complete;
- }
-
- m_stat_reg |= status_interrupt;
- set_interrupt_line();
- break;
-
- case 6: /* read unformatted
+ bits 26-27: unit number (0-3)
+ unit = (m_cmd_reg >> 10) & 3;
+ head = (m_cmd_reg >> 9) & 1;
+
+ // reset status
+ m_stat_reg = unit << status_unit_shift;
+
+ if (!read_id(unit, head, &cylinder, &sector))
+ {
+ m_stat_reg |= status_ID_not_found;
+ }
+ else
+ {
+ m_recv_buf = (cylinder << 8) | sector;
+ m_stat_reg |= status_OP_complete;
+ }
+
+ m_stat_reg |= status_interrupt;
+ set_interrupt_line();
+ break;
+
+ case 6: // read unformatted
bits 16-20: sector number (1-26)
bits 21-24: 0s
bit 25: head number (1=upper)
- bits 26-27: unit number (0-3) */
- /* ... */
- break;
+ bits 26-27: unit number (0-3)
+ // ...
+ break;
- case 7: /* write
+ case 7: // write
bits 16-20: sector number (1-26)
bits 21-24: 0s
bit 25: head number (1=upper)
- bits 26-27: unit number (0-3) */
- unit = (m_cmd_reg >> 10) & 3;
- head = (m_cmd_reg >> 9) & 1;
- sector = m_cmd_reg & 0x1f;
-
- /* reset status */
- m_stat_reg = unit << status_unit_shift;
-
- if ((m_sector == 0) || (m_sector > 26))
- {
- m_stat_reg |= status_invalid_cmd;
- }
- else
- {
- m_unit = unit;
- m_head = head;
- m_sector = sector;
- m_ddam = 0;
-
- m_buf_pos = 0;
- m_buf_mode = bm_write;
- m_stat_reg |= status_XFER_ready;
- m_stat_reg |= status_OP_complete; /* right??? */
- }
-
- m_stat_reg |= status_interrupt;
- set_interrupt_line();
- break;
-
- case 8: /* write delete
+ bits 26-27: unit number (0-3)
+ unit = (m_cmd_reg >> 10) & 3;
+ head = (m_cmd_reg >> 9) & 1;
+ sector = m_cmd_reg & 0x1f;
+
+ // reset status
+ m_stat_reg = unit << status_unit_shift;
+
+ if ((m_sector == 0) || (m_sector > 26))
+ {
+ m_stat_reg |= status_invalid_cmd;
+ }
+ else
+ {
+ m_unit = unit;
+ m_head = head;
+ m_sector = sector;
+ m_ddam = 0;
+
+ m_buf_pos = 0;
+ m_buf_mode = bm_write;
+ m_stat_reg |= status_XFER_ready;
+ m_stat_reg |= status_OP_complete; // right???
+ }
+
+ m_stat_reg |= status_interrupt;
+ set_interrupt_line();
+ break;
+
+ case 8: // write delete
bits 16-20: sector number (1-26)
bits 21-24: 0s
bit 25: head number (1=upper)
- bits 26-27: unit number (0-3) */
- unit = (m_cmd_reg >> 10) & 3;
- head = (m_cmd_reg >> 9) & 1;
- sector = m_cmd_reg & 0x1f;
-
- /* reset status */
- m_stat_reg = unit << status_unit_shift;
-
- if ((m_sector == 0) || (m_sector > 26))
- {
- m_stat_reg |= status_invalid_cmd;
- }
- else
- {
- m_unit = unit;
- m_head = head;
- m_sector = sector;
- m_ddam = 1;
-
- m_buf_pos = 0;
- m_buf_mode = bm_write;
- m_stat_reg |= status_XFER_ready;
- m_stat_reg |= status_OP_complete; /* right??? */
- }
-
- m_stat_reg |= status_interrupt;
- set_interrupt_line();
- break;
-
- case 9: /* format track
+ bits 26-27: unit number (0-3)
+ unit = (m_cmd_reg >> 10) & 3;
+ head = (m_cmd_reg >> 9) & 1;
+ sector = m_cmd_reg & 0x1f;
+
+ // reset status
+ m_stat_reg = unit << status_unit_shift;
+
+ if ((m_sector == 0) || (m_sector > 26))
+ {
+ m_stat_reg |= status_invalid_cmd;
+ }
+ else
+ {
+ m_unit = unit;
+ m_head = head;
+ m_sector = sector;
+ m_ddam = 1;
+
+ m_buf_pos = 0;
+ m_buf_mode = bm_write;
+ m_stat_reg |= status_XFER_ready;
+ m_stat_reg |= status_OP_complete; // right???
+ }
+
+ m_stat_reg |= status_interrupt;
+ set_interrupt_line();
+ break;
+
+ case 9: // format track
bits 16-23: track ID (0-255, normally current cylinder index, or 255 for bad track)
bit 24: verify only (1 - verify, 0 - format & verify)
bit 25: head number (1=upper)
- bits 26-27: unit number (0-3) */
- /* ... */
- break;
+ bits 26-27: unit number (0-3)
+ // ...
+ break;
- case 10: /* load int mask
+ case 10: // load int mask
bit 16: bad mask for interrupt (0 = unmask or enable interrupt)
- bits 17-27: 0s */
- m_interrupt_f_f = m_cmd_reg & 1;
- set_interrupt_line();
- break;
+ bits 17-27: 0s
+ m_interrupt_f_f = m_cmd_reg & 1;
+ set_interrupt_line();
+ break;
- case 11: /* stop
+ case 11: // stop
bits 16-25: 0s
- bits 26-27: unit number (0-3) */
- unit = (m_cmd_reg >> 10) & 3;
+ bits 26-27: unit number (0-3)
+ unit = (m_cmd_reg >> 10) & 3;
- /* reset status */
- m_stat_reg = unit << status_unit_shift;
+ // reset status
+ m_stat_reg = unit << status_unit_shift;
- m_stat_reg |= status_OP_complete;
+ m_stat_reg |= status_OP_complete;
- m_stat_reg |= status_interrupt;
- set_interrupt_line();
- break;
+ m_stat_reg |= status_interrupt;
+ set_interrupt_line();
+ break;
- case 12: /* step head
+ case 12: // step head
bits 16-22: track number (0-76)
bits 23-25: 0s
- bits 26-27: unit number (0-3) */
- unit = (m_cmd_reg >> 10) & 3;
- cylinder = m_cmd_reg & 0x7f;
-
- if (cylinder > 76)
- {
- m_stat_reg |= status_invalid_cmd;
- }
- else if ((m_drv[unit].phys_cylinder != -1) || (!do_restore(unit)))
- {
- m_drv[unit].img->floppy_drive_seek(cylinder-m_drv[unit].phys_cylinder);
- m_stat_reg |= status_OP_complete;
- }
-
- m_stat_reg |= status_interrupt;
- set_interrupt_line();
- break;
-
- case 13: /* maintenance commands
+ bits 26-27: unit number (0-3)
+ unit = (m_cmd_reg >> 10) & 3;
+ cylinder = m_cmd_reg & 0x7f;
+
+ if (cylinder > 76)
+ {
+ m_stat_reg |= status_invalid_cmd;
+ }
+ else if ((m_drv[unit].phys_cylinder != -1) || (!do_restore(unit)))
+ {
+ m_drv[unit].img->floppy_drive_seek(cylinder-m_drv[unit].phys_cylinder);
+ m_stat_reg |= status_OP_complete;
+ }
+
+ m_stat_reg |= status_interrupt;
+ set_interrupt_line();
+ break;
+
+ case 13: // maintenance commands
bits 16-23: according to extended command code
- bits 24-27: extended command code (0-7) */
- switch ((m_cmd_reg >> 8) & 15)
- {
- case 0: /* reset
- bits 16-23: 0s */
- /* ... */
- break;
- case 1: /* retry inhibit
- bits 16-23: 0s */
- /* ... */
- break;
- case 2: /* LED test
+ bits 24-27: extended command code (0-7)
+ switch ((m_cmd_reg >> 8) & 15)
+ {
+ case 0: // reset
+ bits 16-23: 0s
+ // ...
+ break;
+ case 1: // retry inhibit
+ bits 16-23: 0s
+ // ...
+ break;
+ case 2: // LED test
bit 16: 1
bits 17-19: 0s
bit 20: LED #2 enable
bit 21: LED #3 enable
bit 22: LED #4 enable
- bit 23: enable LEDs */
- /* ... */
- break;
- case 3: /* program error (a.k.a. invalid command)
- bits 16-23: 0s */
- /* ... */
- break;
- case 4: /* memory read
+ bit 23: enable LEDs
+ // ...
+ break;
+ case 3: // program error (a.k.a. invalid command)
+ bits 16-23: 0s
+ // ...
+ break;
+ case 4: // memory read
bits 16-20: controller memory address (shifted left by 8 to generate 9900 address)
- bits 21-23: 0s */
- /* ... */
- break;
- case 5: /* RAM load
+ bits 21-23: 0s
+ // ...
+ break;
+ case 5: // RAM load
bit 16: 0
- bits 17-23: RAM offset (shifted left by 1 and offset by >1800 to generate 9900 address) */
- /* ... */
- break;
- case 6: /* RAM run
+ bits 17-23: RAM offset (shifted left by 1 and offset by >1800 to generate 9900 address)
+ // ...
+ break;
+ case 6: // RAM run
bit 16: 0
- bits 17-23: RAM offset (shifted left by 1 and offset by >1800 to generate 9900 address) */
- /* ... */
- break;
- case 7: /* power up simulation
- bits 16-23: 0s */
- /* ... */
- break;
- }
- /* ... */
- break;
-
- case 14: /* IPL
+ bits 17-23: RAM offset (shifted left by 1 and offset by >1800 to generate 9900 address)
+ // ...
+ break;
+ case 7: // power up simulation
+ bits 16-23: 0s
+ // ...
+ break;
+ }
+ // ...
+ break;
+
+ case 14: // IPL
bits 16-22: track number (0-76)
bit 23: 0
bit 24: no sequential sectoring (1=active)
bit 25: head number (1=upper)
- bits 26-27: unit number (0-3) */
- unit = (m_cmd_reg >> 10) & 3;
- head = (m_cmd_reg >> 9) & 1;
- /*non_seq_mode = (m_cmd_reg >> 8) & 1;*/
- cylinder = m_cmd_reg & 0x7f;
-
- if (!do_seek(unit, cylinder, head))
- {
- m_unit = unit;
- m_head = head;
- m_sector = 1;
- /*m_non_seq_mode = non_seq_mode;*/
-
- do_read();
- }
-
- m_stat_reg |= status_interrupt;
- set_interrupt_line();
- break;
-
- case 15: /* Clear Status port
- bits 16-27: 0s */
- m_stat_reg = 0;
- set_interrupt_line();
- break;
- }
+ bits 26-27: unit number (0-3)
+ unit = (m_cmd_reg >> 10) & 3;
+ head = (m_cmd_reg >> 9) & 1;
+ //non_seq_mode = (m_cmd_reg >> 8) & 1;
+ cylinder = m_cmd_reg & 0x7f;
+
+ if (!do_seek(unit, cylinder, head))
+ {
+ m_unit = unit;
+ m_head = head;
+ m_sector = 1;
+ //m_non_seq_mode = non_seq_mode;
+
+ do_read();
+ }
+
+ m_stat_reg |= status_interrupt;
+ set_interrupt_line();
+ break;
+
+ case 15: // Clear Status port
+ bits 16-27: 0s
+ m_stat_reg = 0;
+ set_interrupt_line();
+ break;
+ }
+ */
}
/*
@@ -708,13 +711,13 @@ READ8_MEMBER( fd800_legacy_device::cru_r )
{
case 0:
case 1:
- /* receive buffer */
+ // receive buffer
reply = m_recv_buf >> (offset*8);
break;
case 2:
case 3:
- /* status register */
+ // status register
reply = m_stat_reg >> ((offset-2)*8);
break;
}
@@ -754,7 +757,7 @@ WRITE8_MEMBER( fd800_legacy_device::cru_w )
case 13:
case 14:
case 15:
- /* transmit buffer */
+ // transmit buffer
if (data)
m_xmit_buf |= 1 << offset;
else
@@ -768,9 +771,9 @@ WRITE8_MEMBER( fd800_legacy_device::cru_w )
case bm_read:
m_buf_pos++;
if (m_buf_pos == m_drv[m_unit].seclen)
- { /* end of sector */
+ { // end of sector
if (m_sector == 26)
- { /* end of track -> end command (right???) */
+ { // end of track -> end command (right???)
m_stat_reg &= ~status_XFER_ready;
m_stat_reg |= status_OP_complete;
m_stat_reg |= status_interrupt;
@@ -778,7 +781,7 @@ WRITE8_MEMBER( fd800_legacy_device::cru_w )
set_interrupt_line();
}
else
- { /* read next sector */
+ { // read next sector
m_sector++;
m_stat_reg &= ~status_XFER_ready | status_OP_complete | status_interrupt;
do_read();
@@ -795,11 +798,11 @@ WRITE8_MEMBER( fd800_legacy_device::cru_w )
m_buf[(m_buf_pos<<1)+1] = m_xmit_buf & 0xff;
m_buf_pos++;
if (m_buf_pos == m_drv[m_unit].seclen)
- { /* end of sector */
+ { // end of sector
do_write();
if (m_sector == 26)
{
- /* end of track -> end command (right???) */
+ // end of track -> end command (right???)
m_stat_reg &= ~status_XFER_ready;
m_stat_reg |= status_OP_complete;
m_stat_reg |= status_interrupt;
@@ -807,7 +810,7 @@ WRITE8_MEMBER( fd800_legacy_device::cru_w )
set_interrupt_line();
}
else
- { /* increment to next sector */
+ { // increment to next sector
m_sector++;
m_stat_reg |= status_interrupt;
set_interrupt_line();
@@ -834,7 +837,7 @@ WRITE8_MEMBER( fd800_legacy_device::cru_w )
case 29:
case 30:
case 31:
- /* command register */
+ // command register
if (data)
m_cmd_reg |= 1 << (offset-16);
else
@@ -845,25 +848,25 @@ WRITE8_MEMBER( fd800_legacy_device::cru_w )
}
}
+#if 0
LEGACY_FLOPPY_OPTIONS_START(fd800)
-#if 1
- /* SSSD 8" */
+ // SSSD 8"
LEGACY_FLOPPY_OPTION(fd800, "dsk", "TI990 8\" SSSD disk image", basicdsk_identify_default, basicdsk_construct_default, NULL,
HEADS([1])
TRACKS([77])
SECTORS([26])
SECTOR_LENGTH([128])
FIRST_SECTOR_ID([1]))
-#elif 0
- /* DSSD 8" */
+
+ // DSSD 8"
LEGACY_FLOPPY_OPTION(fd800, "dsk", "TI990 8\" DSSD disk image", basicdsk_identify_default, basicdsk_construct_default, NULL,
HEADS([2])
TRACKS([77])
SECTORS([26])
SECTOR_LENGTH([128])
FIRST_SECTOR_ID([1]))
-#endif
LEGACY_FLOPPY_OPTIONS_END
+#endif
void fd800_legacy_device::device_start(void)
{
@@ -872,7 +875,7 @@ void fd800_legacy_device::device_start(void)
for (int i=0; i<MAX_FLOPPIES; i++)
{
- m_drv[i].img = floppy_get_device(machine(), i);
+ // m_drv[i].img = floppy_get_device(machine(), i);
m_drv[i].phys_cylinder = -1;
m_drv[i].log_cylinder[0] = m_drv[i].log_cylinder[1] = -1;
m_drv[i].seclen = 64;
diff --git a/src/mess/machine/ti99/990_dk.h b/src/mess/machine/ti99/990_dk.h
index 23c7ae54226..2f83660ae75 100644
--- a/src/mess/machine/ti99/990_dk.h
+++ b/src/mess/machine/ti99/990_dk.h
@@ -1,4 +1,4 @@
-// license:???
+// license:GPL-2.0+
// copyright-holders:Raphael Nabet
/*
990_dk.h: include file for 990_dk.c
@@ -7,8 +7,6 @@
#ifndef __990_DK__
#define __990_DK__
-#include "imagedev/flopdrv.h"
-
extern const device_type FD800;
#define MAX_FLOPPIES 4
@@ -54,21 +52,21 @@ private:
int m_buf_pos;
buf_mode_t m_buf_mode;
int m_unit;
- int m_head;
+// int m_head;
int m_sector;
/*int m_non_seq_mode;*/
- int m_ddam;
+// int m_ddam;
struct
{
- legacy_floppy_image_device *img;
+ // legacy_floppy_image_device *img;
int phys_cylinder;
int log_cylinder[2];
int seclen;
} m_drv[MAX_FLOPPIES];
};
-LEGACY_FLOPPY_OPTIONS_EXTERN(fd800);
+// LEGACY_FLOPPY_OPTIONS_EXTERN(fd800);
#define MCFG_FD800_INT_HANDLER( _intcallb ) \
devcb = &fd800_legacy_device::static_set_int_callback( *device, DEVCB_##_intcallb );
diff --git a/src/mess/machine/ti99/990_hd.c b/src/mess/machine/ti99/990_hd.c
index 31c5b73d1e5..fa0cd00646b 100644
--- a/src/mess/machine/ti99/990_hd.c
+++ b/src/mess/machine/ti99/990_hd.c
@@ -1,4 +1,4 @@
-// license:???
+// license:GPL-2.0+
// copyright-holders:Raphael Nabet
/*
990_hd.c: emulation of a generic ti990 hard disk controller, for use with
diff --git a/src/mess/machine/ti99/990_hd.h b/src/mess/machine/ti99/990_hd.h
index aad7cec651c..4c5e85f928d 100644
--- a/src/mess/machine/ti99/990_hd.h
+++ b/src/mess/machine/ti99/990_hd.h
@@ -1,4 +1,4 @@
-// license:???
+// license:GPL-2.0+
// copyright-holders:Raphael Nabet
/*
990_hd.h: include file for 990_hd.c
diff --git a/src/mess/machine/ti99/990_tap.c b/src/mess/machine/ti99/990_tap.c
index 65a77b9dd9d..20ca2333f7b 100644
--- a/src/mess/machine/ti99/990_tap.c
+++ b/src/mess/machine/ti99/990_tap.c
@@ -1,4 +1,4 @@
-// license:???
+// license:GPL-2.0+
// copyright-holders:Raphael Nabet
/*
990_tap.c: emulation of a generic ti990 tape controller, for use with
diff --git a/src/mess/machine/ti99/990_tap.h b/src/mess/machine/ti99/990_tap.h
index aed56f24ee2..09e2e30da0a 100644
--- a/src/mess/machine/ti99/990_tap.h
+++ b/src/mess/machine/ti99/990_tap.h
@@ -1,4 +1,4 @@
-// license:???
+// license:GPL-2.0+
// copyright-holders:Raphael Nabet
/*
990_tap.h: include file for 990_tap.c
diff --git a/src/mess/machine/ti99/gromport.c b/src/mess/machine/ti99/gromport.c
index 9747deadff7..427dc929b8a 100644
--- a/src/mess/machine/ti99/gromport.c
+++ b/src/mess/machine/ti99/gromport.c
@@ -2066,7 +2066,7 @@ rpk::rpk(emu_options& options, const char* sysname)
//,m_system_name(sysname)
{
m_sockets.reset();
-};
+}
rpk::~rpk()
{
@@ -2126,12 +2126,12 @@ void rpk::close()
rpk_socket::rpk_socket(const char* id, int length, UINT8* contents, const char *pathname)
: m_id(id), m_length(length), m_next(NULL), m_contents(contents), m_pathname(pathname)
{
-};
+}
rpk_socket::rpk_socket(const char* id, int length, UINT8* contents)
: m_id(id), m_length(length), m_next(NULL), m_contents(contents), m_pathname(NULL)
{
-};
+}
/*
Locate a file in the ZIP container
@@ -2234,7 +2234,7 @@ rpk_socket* rpk_reader::load_ram_resource(emu_options &options, xml_data_node* r
const char* ram_type;
const char* ram_filename;
const char* ram_pname;
- int length;
+ unsigned int length;
UINT8* contents;
// find the length attribute
diff --git a/src/mess/machine/trs80.c b/src/mess/machine/trs80.c
index e87ece1c1d1..980176e109e 100644
--- a/src/mess/machine/trs80.c
+++ b/src/mess/machine/trs80.c
@@ -490,8 +490,6 @@ WRITE8_MEMBER( trs80_state::trs80m4_ec_w )
m_port_ec = data & 0x7e;
}
-WRITE8_MEMBER( trs80_state::trs80m4_f4_w )
-{
/* Selection of drive and parameters - d6..d5 not emulated.
A write also causes the selected drive motor to turn on for about 3 seconds.
When the motor turns off, the drive is deselected.
@@ -503,36 +501,24 @@ WRITE8_MEMBER( trs80_state::trs80m4_f4_w )
d2 1=select drive 2
d1 1=select drive 1
d0 1=select drive 0 */
+WRITE8_MEMBER( trs80_state::trs80m4_f4_w )
+{
+ floppy_image_device *floppy = NULL;
- UINT8 drive = 255;
+ if (BIT(data, 0)) floppy = m_floppy0->get_device();
+ if (BIT(data, 1)) floppy = m_floppy1->get_device();
+ if (BIT(data, 2)) floppy = m_floppy2->get_device();
+ if (BIT(data, 3)) floppy = m_floppy3->get_device();
- if (data & 1)
- drive = 0;
- else
- if (data & 2)
- drive = 1;
- else
- if (data & 4)
- drive = 2;
- else
- if (data & 8)
- drive = 3;
+ m_fdc->set_floppy(floppy);
- m_head = (data & 16) ? 1 : 0;
-
- if (drive < 4)
+ if (floppy)
{
- m_fdc->set_drive(drive);
- m_fdc->set_side(m_head);
+ floppy->mon_w(0);
+ floppy->ss_w(BIT(data, 4));
}
m_fdc->dden_w(!BIT(data, 7));
-
- /* CLEAR_LINE means to turn motors on */
- floppy_get_device(machine(), 0)->floppy_mon_w((data & 0x0f) ? CLEAR_LINE : ASSERT_LINE);
- floppy_get_device(machine(), 1)->floppy_mon_w((data & 0x0f) ? CLEAR_LINE : ASSERT_LINE);
- floppy_get_device(machine(), 2)->floppy_mon_w((data & 0x0f) ? CLEAR_LINE : ASSERT_LINE);
- floppy_get_device(machine(), 3)->floppy_mon_w((data & 0x0f) ? CLEAR_LINE : ASSERT_LINE);
}
WRITE8_MEMBER( trs80_state::sys80_f8_w )
@@ -578,10 +564,10 @@ WRITE8_MEMBER( trs80_state::lnw80_fe_w )
mem.install_readwrite_handler (0x37e0, 0x37e3, read8_delegate(FUNC(trs80_state::trs80_irq_status_r), this), write8_delegate(FUNC(trs80_state::trs80_motor_w), this));
mem.install_readwrite_handler (0x37e8, 0x37eb, read8_delegate(FUNC(trs80_state::trs80_printer_r), this), write8_delegate(FUNC(trs80_state::trs80_printer_w), this));
mem.install_read_handler (0x37ec, 0x37ec, read8_delegate(FUNC(trs80_state::trs80_wd179x_r), this));
- mem.install_write_handler (0x37ec, 0x37ec, write8_delegate(FUNC(fd1793_device::command_w),(fd1793_device*)m_fdc));
- mem.install_readwrite_handler (0x37ed, 0x37ed, read8_delegate(FUNC(fd1793_device::track_r),(fd1793_device*)m_fdc), write8_delegate(FUNC(fd1793_device::track_w),(fd1793_device*)m_fdc));
- mem.install_readwrite_handler (0x37ee, 0x37ee, read8_delegate(FUNC(fd1793_device::sector_r),(fd1793_device*)m_fdc), write8_delegate(FUNC(fd1793_device::sector_w),(fd1793_device*)m_fdc));
- mem.install_readwrite_handler (0x37ef, 0x37ef, read8_delegate(FUNC(fd1793_device::data_r),(fd1793_device*)m_fdc),write8_delegate( FUNC(fd1793_device::data_w),(fd1793_device*)m_fdc));
+ mem.install_write_handler (0x37ec, 0x37ec, write8_delegate(FUNC(fd1793_t::cmd_w),(fd1793_t*)m_fdc));
+ mem.install_readwrite_handler (0x37ed, 0x37ed, read8_delegate(FUNC(fd1793_t::track_r),(fd1793_t*)m_fdc), write8_delegate(FUNC(fd1793_t::track_w),(fd1793_t*)m_fdc));
+ mem.install_readwrite_handler (0x37ee, 0x37ee, read8_delegate(FUNC(fd1793_t::sector_r),(fd1793_t*)m_fdc), write8_delegate(FUNC(fd1793_t::sector_w),(fd1793_t*)m_fdc));
+ mem.install_readwrite_handler (0x37ef, 0x37ef, read8_delegate(FUNC(fd1793_t::data_r),(fd1793_t*)m_fdc),write8_delegate( FUNC(fd1793_t::data_w),(fd1793_t*)m_fdc));
mem.install_read_handler (0x3800, 0x38ff, 0, 0x0300, read8_delegate(FUNC(trs80_state::trs80_keyboard_r), this));
mem.install_readwrite_handler (0x3c00, 0x3fff, read8_delegate(FUNC(trs80_state::trs80_videoram_r), this), write8_delegate(FUNC(trs80_state::trs80_videoram_w), this));
}
@@ -745,59 +731,23 @@ READ8_MEMBER( trs80_state::trs80_irq_status_r )
WRITE8_MEMBER( trs80_state::trs80_motor_w )
{
- UINT8 drive = 255;
+ floppy_image_device *floppy = NULL;
- switch (data)
- {
- case 1:
- drive = 0;
- m_head = 0;
- break;
- case 2:
- drive = 1;
- m_head = 0;
- break;
- case 4:
- drive = 2;
- m_head = 0;
- break;
- case 8:
- drive = 3;
- m_head = 0;
- break;
- /* These 3 combinations aren't official. Some manufacturers of double-sided disks
- used drive select 4 to indicate the other side. */
- case 9:
- drive = 0;
- m_head = 1;
- break;
- case 10:
- drive = 1;
- m_head = 1;
- break;
- case 12:
- drive = 2;
- m_head = 1;
- break;
- }
+ if (BIT(data, 0)) floppy = m_floppy0->get_device();
+ if (BIT(data, 1)) floppy = m_floppy1->get_device();
+ if (BIT(data, 2)) floppy = m_floppy2->get_device();
+ if (BIT(data, 3)) floppy = m_floppy3->get_device();
- if (drive > 3)
- { /* Turn motors off */
- floppy_get_device(machine(), 0)->floppy_mon_w(ASSERT_LINE);
- floppy_get_device(machine(), 1)->floppy_mon_w(ASSERT_LINE);
- floppy_get_device(machine(), 2)->floppy_mon_w(ASSERT_LINE);
- floppy_get_device(machine(), 3)->floppy_mon_w(ASSERT_LINE);
- return;
- }
+ m_fdc->set_floppy(floppy);
- m_fdc->set_drive(drive);
- m_fdc->set_side(m_head);
+ if (floppy)
+ {
+ floppy->mon_w(0);
+ floppy->ss_w(BIT(data, 4));
+ }
- /* Turn motors on */
- floppy_get_device(machine(), 0)->floppy_mon_w(CLEAR_LINE);
- floppy_get_device(machine(), 1)->floppy_mon_w(CLEAR_LINE);
- floppy_get_device(machine(), 2)->floppy_mon_w(CLEAR_LINE);
- floppy_get_device(machine(), 3)->floppy_mon_w(CLEAR_LINE);
+ // switch to fm
+ m_fdc->dden_w(1);
}
/*************************************
diff --git a/src/mess/machine/upd65031.c b/src/mess/machine/upd65031.c
index e0377d7d20d..86d9ff5e093 100644
--- a/src/mess/machine/upd65031.c
+++ b/src/mess/machine/upd65031.c
@@ -79,7 +79,7 @@ enum
REG_RXD = 0xe0, // UART receive data register
REG_RXE = 0xe1, // UART extended receiver data
- REG_UIT = 0xe5, // UART interrupt status
+ REG_UIT = 0xe5 // UART interrupt status
};
//mode
diff --git a/src/mess/machine/vector06.c b/src/mess/machine/vector06.c
index e0c436a6239..b6f4e353fed 100644
--- a/src/mess/machine/vector06.c
+++ b/src/mess/machine/vector06.c
@@ -138,10 +138,22 @@ TIMER_CALLBACK_MEMBER(vector06_state::reset_check_callback)
WRITE8_MEMBER( vector06_state::vector06_disc_w )
{
-// something here needs to turn the motor on
+ floppy_image_device *floppy = NULL;
- m_fdc->set_side (BIT(data, 2) ^ 1);
- m_fdc->set_drive(BIT(data, 0));
+ switch (data & 0x01)
+ {
+ case 0: floppy = m_floppy0->get_device(); break;
+ case 1: floppy = m_floppy1->get_device(); break;
+ }
+
+ m_fdc->set_floppy(floppy);
+
+ if (floppy)
+ {
+ // something here needs to turn the motor on
+ floppy->mon_w(0);
+ floppy->ss_w(!BIT(data, 2));
+ }
}
void vector06_state::machine_start()
diff --git a/src/mess/machine/victor9k_fdc.c b/src/mess/machine/victor9k_fdc.c
index 9fdf6f7c083..ae04084757b 100644
--- a/src/mess/machine/victor9k_fdc.c
+++ b/src/mess/machine/victor9k_fdc.c
@@ -253,7 +253,7 @@ victor_9000_fdc_t::victor_9000_fdc_t(const machine_config &mconfig, const char *
m_via4_irq(CLEAR_LINE),
m_via5_irq(CLEAR_LINE),
m_via6_irq(CLEAR_LINE),
- m_period(attotime::from_nsec(2130))
+ m_period(attotime::from_hz(XTAL_15MHz/32))
{
cur_live.tm = attotime::never;
cur_live.state = IDLE;
diff --git a/src/mess/machine/z80ne.c b/src/mess/machine/z80ne.c
index 4245165c902..3e5bce4522e 100644
--- a/src/mess/machine/z80ne.c
+++ b/src/mess/machine/z80ne.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Roberto Lavarone
/***********************************************************************
diff --git a/src/mess/machine/zx8302.h b/src/mess/machine/zx8302.h
index f05ebe2b702..2cfb4efbe49 100644
--- a/src/mess/machine/zx8302.h
+++ b/src/mess/machine/zx8302.h
@@ -183,7 +183,7 @@ private:
MODE_SER2 = 0x08,
MODE_MDV = 0x10,
MODE_NET = 0x18,
- MODE_MASK = 0x18,
+ MODE_MASK = 0x18
};
enum
@@ -192,7 +192,7 @@ private:
INT_INTERFACE = 0x02,
INT_TRANSMIT = 0x04,
INT_FRAME = 0x08,
- INT_EXTERNAL = 0x10,
+ INT_EXTERNAL = 0x10
};
enum
@@ -200,7 +200,7 @@ private:
STATUS_NETWORK_PORT = 0x01,
STATUS_TX_BUFFER_FULL = 0x02,
STATUS_RX_BUFFER_FULL = 0x04,
- STATUS_MICRODRIVE_GAP = 0x08,
+ STATUS_MICRODRIVE_GAP = 0x08
};
int m_rtc_clock; // the RTC clock (pin 30) of the chip
diff --git a/src/lib/formats/coco_dsk.c b/src/mess/tools/imgtool/formats/coco_dsk.c
index 1fa8c09ac22..9674ed9de11 100644
--- a/src/lib/formats/coco_dsk.c
+++ b/src/mess/tools/imgtool/formats/coco_dsk.c
@@ -14,7 +14,7 @@
#include "formats/coco_dsk.h"
#include "formats/basicdsk.h"
-#include "imageutl.h"
+#include "formats/imageutl.h"
#include "coretmpl.h"
/* -----------------------------------------------------------------------
diff --git a/src/lib/formats/coco_dsk.h b/src/mess/tools/imgtool/formats/coco_dsk.h
index b190390d0cc..797911d40a1 100644
--- a/src/lib/formats/coco_dsk.h
+++ b/src/mess/tools/imgtool/formats/coco_dsk.h
@@ -11,7 +11,7 @@
#ifndef COCO_DSK_H
#define COCO_DSK_H
-#include "flopimg.h"
+#include "formats/flopimg.h"
/**************************************************************************/
diff --git a/src/lib/formats/vt_dsk.c b/src/mess/tools/imgtool/formats/vt_dsk.c
index 4e75e843d28..4e75e843d28 100644
--- a/src/lib/formats/vt_dsk.c
+++ b/src/mess/tools/imgtool/formats/vt_dsk.c
diff --git a/src/lib/formats/vt_dsk.h b/src/mess/tools/imgtool/formats/vt_dsk.h
index 7b5f1fe4098..a3f9a86b44e 100644
--- a/src/lib/formats/vt_dsk.h
+++ b/src/mess/tools/imgtool/formats/vt_dsk.h
@@ -11,7 +11,7 @@
#ifndef VT_DSK_H
#define VT_DSK_H
-#include "flopimg.h"
+#include "formats/flopimg.h"
LEGACY_FLOPPY_OPTIONS_EXTERN(vz);
diff --git a/src/mess/tools/imgtool/imghd.c b/src/mess/tools/imgtool/imghd.c
index d48e8a0f0b2..8ac129751f9 100644
--- a/src/mess/tools/imgtool/imghd.c
+++ b/src/mess/tools/imgtool/imghd.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Nathan Woods, Raphael Nabet
/*
Code to interface the MESS image code with MAME's harddisk core.
diff --git a/src/mess/tools/imgtool/modules/amiga.c b/src/mess/tools/imgtool/modules/amiga.c
index d0a970fae66..7723748cbd2 100644
--- a/src/mess/tools/imgtool/modules/amiga.c
+++ b/src/mess/tools/imgtool/modules/amiga.c
@@ -21,7 +21,6 @@
#include "imgtool.h"
#include "iflopimg.h"
#include "formats/imageutl.h"
-#include "formats/ami_dsk.h"
diff --git a/src/mess/tools/imgtool/modules/concept.c b/src/mess/tools/imgtool/modules/concept.c
index 8cf115a9d4b..a5c5a37b1ad 100644
--- a/src/mess/tools/imgtool/modules/concept.c
+++ b/src/mess/tools/imgtool/modules/concept.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Raphael Nabet
/*
Handlers for concept floppy images
diff --git a/src/mess/tools/imgtool/modules/fat.c b/src/mess/tools/imgtool/modules/fat.c
index ce4bbff8c6d..4f2fca17c25 100644
--- a/src/mess/tools/imgtool/modules/fat.c
+++ b/src/mess/tools/imgtool/modules/fat.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Raphael Nabet
/****************************************************************************
diff --git a/src/mess/tools/imgtool/modules/fat.h b/src/mess/tools/imgtool/modules/fat.h
index b46ad77a357..46f741999c3 100644
--- a/src/mess/tools/imgtool/modules/fat.h
+++ b/src/mess/tools/imgtool/modules/fat.h
@@ -1,3 +1,3 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Raphael Nabet
void fat_get_info(const imgtool_class *imgclass, UINT32 state, union imgtoolinfo *info);
diff --git a/src/mess/tools/imgtool/modules/mac.c b/src/mess/tools/imgtool/modules/mac.c
index 8e2465bab4e..53ae4be3ec0 100644
--- a/src/mess/tools/imgtool/modules/mac.c
+++ b/src/mess/tools/imgtool/modules/mac.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Raphael Nabet
/****************************************************************************
diff --git a/src/mess/tools/imgtool/modules/macbin.c b/src/mess/tools/imgtool/modules/macbin.c
index 5ecd20119ba..3ef85a039d1 100644
--- a/src/mess/tools/imgtool/modules/macbin.c
+++ b/src/mess/tools/imgtool/modules/macbin.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Raphael Nabet
/****************************************************************************
diff --git a/src/mess/tools/imgtool/modules/macutil.c b/src/mess/tools/imgtool/modules/macutil.c
index 3f8b0b90c96..fe2e1ade51a 100644
--- a/src/mess/tools/imgtool/modules/macutil.c
+++ b/src/mess/tools/imgtool/modules/macutil.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Raphael Nabet
/****************************************************************************
diff --git a/src/mess/tools/imgtool/modules/macutil.h b/src/mess/tools/imgtool/modules/macutil.h
index 1bb793467d9..71121dade31 100644
--- a/src/mess/tools/imgtool/modules/macutil.h
+++ b/src/mess/tools/imgtool/modules/macutil.h
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Raphael Nabet
/****************************************************************************
diff --git a/src/mess/tools/imgtool/modules/pc_flop.c b/src/mess/tools/imgtool/modules/pc_flop.c
index d7d498ef829..916cf873c46 100644
--- a/src/mess/tools/imgtool/modules/pc_flop.c
+++ b/src/mess/tools/imgtool/modules/pc_flop.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Raphael Nabet
/****************************************************************************
diff --git a/src/mess/tools/imgtool/modules/pc_hard.c b/src/mess/tools/imgtool/modules/pc_hard.c
index 9d3cfb79107..915032932c7 100644
--- a/src/mess/tools/imgtool/modules/pc_hard.c
+++ b/src/mess/tools/imgtool/modules/pc_hard.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Raphael Nabet
/****************************************************************************
diff --git a/src/mess/tools/imgtool/modules/prodos.c b/src/mess/tools/imgtool/modules/prodos.c
index 1e781759a86..5800e2bf9f3 100644
--- a/src/mess/tools/imgtool/modules/prodos.c
+++ b/src/mess/tools/imgtool/modules/prodos.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Raphael Nabet
/****************************************************************************
diff --git a/src/mess/tools/imgtool/modules/thomson.c b/src/mess/tools/imgtool/modules/thomson.c
index bea02ef80f7..43684bc0aea 100644
--- a/src/mess/tools/imgtool/modules/thomson.c
+++ b/src/mess/tools/imgtool/modules/thomson.c
@@ -113,7 +113,6 @@
#include "imgtool.h"
#include "iflopimg.h"
-#include "formats/basicdsk.h"
#include <time.h>
diff --git a/src/mess/tools/imgtool/modules/ti99.c b/src/mess/tools/imgtool/modules/ti99.c
index f8d25e5a72f..220cbebdb27 100644
--- a/src/mess/tools/imgtool/modules/ti99.c
+++ b/src/mess/tools/imgtool/modules/ti99.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Raphael Nabet
/*
Handlers for ti99 disk images
diff --git a/src/mess/tools/imgtool/modules/ti990hd.c b/src/mess/tools/imgtool/modules/ti990hd.c
index 37bcc6dd928..2c2a6c3a13c 100644
--- a/src/mess/tools/imgtool/modules/ti990hd.c
+++ b/src/mess/tools/imgtool/modules/ti990hd.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Raphael Nabet
/*
Handlers for ti990 disk images
diff --git a/src/mess/tools/imgtool/modules/vzdos.c b/src/mess/tools/imgtool/modules/vzdos.c
index 25e8dad5d38..bacaa448ef8 100644
--- a/src/mess/tools/imgtool/modules/vzdos.c
+++ b/src/mess/tools/imgtool/modules/vzdos.c
@@ -1,5 +1,5 @@
-// license:???
-// copyright-holders:Raphael Nabet
+// license:GPL-2.0+
+// copyright-holders:Dirk Best
/****************************************************************************
vzdos.c
diff --git a/src/mess/video/733_asr.c b/src/mess/video/733_asr.c
index 5aabc4788be..da1286d69f5 100644
--- a/src/mess/video/733_asr.c
+++ b/src/mess/video/733_asr.c
@@ -1,4 +1,4 @@
-// license:???
+// license:GPL-2.0+
// copyright-holders:Raphael Nabet
/*
733 ASR emulation
diff --git a/src/mess/video/733_asr.h b/src/mess/video/733_asr.h
index 323e3f688fe..6182a21eb52 100644
--- a/src/mess/video/733_asr.h
+++ b/src/mess/video/733_asr.h
@@ -1,4 +1,4 @@
-// license:???
+// license:GPL-2.0+
// copyright-holders:Raphael Nabet
#define asr733_chr_region ":gfx1"
diff --git a/src/mess/video/911_chr.h b/src/mess/video/911_chr.h
index de41d265a06..6d24b5d0415 100644
--- a/src/mess/video/911_chr.h
+++ b/src/mess/video/911_chr.h
@@ -1,4 +1,4 @@
-// license:???
+// license:GPL-2.0+
// copyright-holders:Raphael Nabet
/*
911_chr.h: character definitions for 911_vdt.c
diff --git a/src/mess/video/911_key.h b/src/mess/video/911_key.h
index cf0e77d2148..108bf85fd7d 100644
--- a/src/mess/video/911_key.h
+++ b/src/mess/video/911_key.h
@@ -1,4 +1,4 @@
-// license:???
+// license:GPL-2.0+
// copyright-holders:Raphael Nabet
/*
key translation table for both US and UK terminals
diff --git a/src/mess/video/911_vdt.c b/src/mess/video/911_vdt.c
index 3c323cd10fe..c0d30600681 100644
--- a/src/mess/video/911_vdt.c
+++ b/src/mess/video/911_vdt.c
@@ -1,4 +1,4 @@
-// license:???
+// license:GPL-2.0+
// copyright-holders:Raphael Nabet
/*
TI 911 VDT core. To be operated with the TI 990 line of computers (can be connected to
diff --git a/src/mess/video/911_vdt.h b/src/mess/video/911_vdt.h
index 3c8bbe02521..7eb0f55dbc1 100644
--- a/src/mess/video/911_vdt.h
+++ b/src/mess/video/911_vdt.h
@@ -1,4 +1,4 @@
-// license:???
+// license:GPL-2.0+
// copyright-holders:Raphael Nabet
#include "sound/beep.h"
diff --git a/src/mess/video/abc80.c b/src/mess/video/abc80.c
index 66212688466..30272f3b0ea 100644
--- a/src/mess/video/abc80.c
+++ b/src/mess/video/abc80.c
@@ -179,10 +179,6 @@ void abc80_state::video_start()
// allocate memory
m_video_ram.allocate(0x400);
-
- // register for state saving
- save_item(NAME(m_blink));
- save_item(NAME(m_latch));
}
diff --git a/src/mess/video/apollo.c b/src/mess/video/apollo.c
index b35e6550d4e..c79464355c3 100644
--- a/src/mess/video/apollo.c
+++ b/src/mess/video/apollo.c
@@ -1875,7 +1875,7 @@ void apollo_graphics_15i::device_reset()
= auto_alloc_array(machine(), UINT16, m_image_memory_size);
assert(m_image_memory != NULL);
- MLOG1(("device reset apollo graphics: buffer=%p size=%0x", m_image_memory, m_image_memory_size));
+ MLOG1(("device reset apollo graphics: buffer=%p size=%0x", (void *) m_image_memory, m_image_memory_size));
}
memset(m_color_lookup_table, 0, sizeof(m_color_lookup_table));
diff --git a/src/mess/video/bbc.c b/src/mess/video/bbc.c
index 06400a45ed8..8297f4cacaf 100644
--- a/src/mess/video/bbc.c
+++ b/src/mess/video/bbc.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Gordon Jefferyes, Nigel Barnes
/******************************************************************************
BBC Model B
diff --git a/src/mess/video/cgc7900.c b/src/mess/video/cgc7900.c
index d9ad9e40692..0eb1cda1dd6 100644
--- a/src/mess/video/cgc7900.c
+++ b/src/mess/video/cgc7900.c
@@ -34,7 +34,7 @@ PALETTE_INIT_MEMBER(cgc7900_state, cgc7900)
palette.set_pen_color(5, rgb_t(0xff, 0x00, 0xff));
palette.set_pen_color(6, rgb_t(0xff, 0xff, 0x00));
palette.set_pen_color(7, rgb_t::white);
-};
+}
/***************************************************************************
READ/WRITE HANDLERS
diff --git a/src/mess/video/crt.c b/src/mess/video/crt.c
index 214b88c0078..d075600baf7 100644
--- a/src/mess/video/crt.c
+++ b/src/mess/video/crt.c
@@ -1,4 +1,4 @@
-// license:???
+// license:GPL-2.0+
// copyright-holders:Raphael Nabet
/*
video/crt.c
diff --git a/src/mess/video/crt.h b/src/mess/video/crt.h
index ccca938ad3b..cb0767ad0d9 100644
--- a/src/mess/video/crt.h
+++ b/src/mess/video/crt.h
@@ -1,4 +1,4 @@
-// license:???
+// license:GPL-2.0+
// copyright-holders:Raphael Nabet
/*************************************************************************
diff --git a/src/mess/video/gime.c b/src/mess/video/gime.c
index 93e06b149eb..83b78e92b25 100644
--- a/src/mess/video/gime.c
+++ b/src/mess/video/gime.c
@@ -201,7 +201,7 @@ void gime_base_device::device_start(void)
// get_composite_color
//-------------------------------------------------
-ATTR_FORCE_INLINE gime_base_device::pixel_t gime_base_device::get_composite_color(int color)
+inline gime_base_device::pixel_t gime_base_device::get_composite_color(int color)
{
/* CMP colors
*
@@ -313,7 +313,7 @@ ATTR_FORCE_INLINE gime_base_device::pixel_t gime_base_device::get_composite_colo
// get_rgb_color
//-------------------------------------------------
-ATTR_FORCE_INLINE gime_base_device::pixel_t gime_base_device::get_rgb_color(int color)
+inline gime_base_device::pixel_t gime_base_device::get_rgb_color(int color)
{
return (((color >> 4) & 2) | ((color >> 2) & 1)) * 0x550000
| (((color >> 3) & 2) | ((color >> 1) & 1)) * 0x005500
@@ -543,7 +543,7 @@ void gime_base_device::reset_timer(void)
// update_memory
//-------------------------------------------------
-ATTR_FORCE_INLINE void gime_base_device::update_memory(void)
+inline void gime_base_device::update_memory(void)
{
for (int bank = 0; bank <= 8; bank++)
{
@@ -701,7 +701,7 @@ UINT8 gime_base_device::read(offs_t offset)
// read_gime_register
//-------------------------------------------------
-ATTR_FORCE_INLINE UINT8 gime_base_device::read_gime_register(offs_t offset)
+inline UINT8 gime_base_device::read_gime_register(offs_t offset)
{
offset &= 0x0F;
@@ -746,7 +746,7 @@ ATTR_FORCE_INLINE UINT8 gime_base_device::read_gime_register(offs_t offset)
// read_mmu_register
//-------------------------------------------------
-ATTR_FORCE_INLINE UINT8 gime_base_device::read_mmu_register(offs_t offset)
+inline UINT8 gime_base_device::read_mmu_register(offs_t offset)
{
return (m_mmu[offset & 0x0F] & 0x3F) | (read_floating_bus() & 0xC0);
}
@@ -757,7 +757,7 @@ ATTR_FORCE_INLINE UINT8 gime_base_device::read_mmu_register(offs_t offset)
// read_palette_register
//-------------------------------------------------
-ATTR_FORCE_INLINE UINT8 gime_base_device::read_palette_register(offs_t offset)
+inline UINT8 gime_base_device::read_palette_register(offs_t offset)
{
// Bits 7/6 are floating, and behave oddly. On a real CoCo 3
//
@@ -775,7 +775,7 @@ ATTR_FORCE_INLINE UINT8 gime_base_device::read_palette_register(offs_t offset)
// read_floating_bus
//-------------------------------------------------
-ATTR_FORCE_INLINE UINT8 gime_base_device::read_floating_bus(void)
+inline UINT8 gime_base_device::read_floating_bus(void)
{
return m_read_floating_bus(0);
}
@@ -815,7 +815,7 @@ void gime_base_device::write(offs_t offset, UINT8 data)
// write_gime_register
//-------------------------------------------------
-ATTR_FORCE_INLINE void gime_base_device::write_gime_register(offs_t offset, UINT8 data)
+inline void gime_base_device::write_gime_register(offs_t offset, UINT8 data)
{
// this is needed for writes to FF95
bool timer_was_off = (m_gime_registers[0x04] == 0x00) && (m_gime_registers[0x05] == 0x00);
@@ -1018,7 +1018,7 @@ ATTR_FORCE_INLINE void gime_base_device::write_gime_register(offs_t offset, UINT
// write_mmu_register
//-------------------------------------------------
-ATTR_FORCE_INLINE void gime_base_device::write_mmu_register(offs_t offset, UINT8 data)
+inline void gime_base_device::write_mmu_register(offs_t offset, UINT8 data)
{
offset &= 0x0F;
@@ -1038,7 +1038,7 @@ ATTR_FORCE_INLINE void gime_base_device::write_mmu_register(offs_t offset, UINT8
// write_palette_register
//-------------------------------------------------
-ATTR_FORCE_INLINE void gime_base_device::write_palette_register(offs_t offset, UINT8 data)
+inline void gime_base_device::write_palette_register(offs_t offset, UINT8 data)
{
offset &= 0x0F;
@@ -1071,7 +1071,7 @@ ATTR_FORCE_INLINE void gime_base_device::write_palette_register(offs_t offset, U
// write_sam_register
//-------------------------------------------------
-ATTR_FORCE_INLINE void gime_base_device::write_sam_register(offs_t offset)
+inline void gime_base_device::write_sam_register(offs_t offset)
{
/* change the SAM state */
UINT16 xorval = alter_sam_state(offset);
@@ -1145,7 +1145,7 @@ void gime_base_device::recalculate_firq(void)
// John Kowalski confirms this behavior
//-------------------------------------------------
-ATTR_FORCE_INLINE offs_t gime_base_device::get_video_base(void)
+inline offs_t gime_base_device::get_video_base(void)
{
offs_t result;
UINT8 ff9d_mask, ff9e_mask;
@@ -1282,7 +1282,7 @@ void gime_base_device::record_border_scanline(UINT16 physical_scanline)
// get_lines_per_row
//-------------------------------------------------
-ATTR_FORCE_INLINE UINT16 gime_base_device::get_lines_per_row(void)
+inline UINT16 gime_base_device::get_lines_per_row(void)
{
UINT16 lines_per_row;
if (m_legacy_video)
@@ -1361,7 +1361,7 @@ ATTR_FORCE_INLINE UINT16 gime_base_device::get_lines_per_row(void)
//-------------------------------------------------
template<UINT8 xres, gime_base_device::get_data_func get_data, bool record_mode>
-ATTR_FORCE_INLINE UINT32 gime_base_device::record_scanline_res(int scanline)
+inline UINT32 gime_base_device::record_scanline_res(int scanline)
{
int column;
UINT32 base_offset = m_legacy_video ? 0 : (m_gime_registers[0x0F] & 0x7F) * 2;
@@ -1639,7 +1639,7 @@ UINT32 gime_base_device::emit_dummy_samples(const scanline_record *scanline, int
// emit_mc6847_samples
//-------------------------------------------------
-ATTR_FORCE_INLINE UINT32 gime_base_device::emit_mc6847_samples(const scanline_record *scanline, int sample_start, int sample_count, pixel_t *pixels, const pixel_t *palette)
+inline UINT32 gime_base_device::emit_mc6847_samples(const scanline_record *scanline, int sample_start, int sample_count, pixel_t *pixels, const pixel_t *palette)
{
return super::emit_mc6847_samples<2>(
scanline->m_mode[sample_start],
@@ -1659,7 +1659,7 @@ ATTR_FORCE_INLINE UINT32 gime_base_device::emit_mc6847_samples(const scanline_re
//-------------------------------------------------
template<int xscale, int bits_per_pixel>
-ATTR_FORCE_INLINE UINT32 gime_base_device::emit_gime_graphics_samples(const scanline_record *scanline, int sample_start, int sample_count, pixel_t *pixels, const pixel_t *palette)
+inline UINT32 gime_base_device::emit_gime_graphics_samples(const scanline_record *scanline, int sample_start, int sample_count, pixel_t *pixels, const pixel_t *palette)
{
const UINT8 *data = &scanline->m_data[sample_start];
mc6847_friend_device::emit_graphics<bits_per_pixel, xscale>(data, sample_count, pixels, 0, palette);
@@ -1673,7 +1673,7 @@ ATTR_FORCE_INLINE UINT32 gime_base_device::emit_gime_graphics_samples(const scan
//-------------------------------------------------
template<int xscale>
-ATTR_FORCE_INLINE UINT32 gime_base_device::emit_gime_text_samples(const scanline_record *scanline, int sample_start, int sample_count, pixel_t *pixels, const pixel_t *palette)
+inline UINT32 gime_base_device::emit_gime_text_samples(const scanline_record *scanline, int sample_start, int sample_count, pixel_t *pixels, const pixel_t *palette)
{
UINT8 attribute = scanline->m_mode[sample_start];
const UINT8 *data = &scanline->m_data[sample_start];
@@ -1733,7 +1733,7 @@ ATTR_FORCE_INLINE UINT32 gime_base_device::emit_gime_text_samples(const scanline
//-------------------------------------------------
template<int sample_count, gime_base_device::emit_samples_proc emit_samples>
-ATTR_FORCE_INLINE void gime_base_device::render_scanline(const scanline_record *scanline, pixel_t *pixels, int min_x, int max_x, palette_resolver *resolver)
+inline void gime_base_device::render_scanline(const scanline_record *scanline, pixel_t *pixels, int min_x, int max_x, palette_resolver *resolver)
{
int left_border, right_border;
int x, x2, pixel_position;
@@ -1934,7 +1934,7 @@ bool gime_base_device::update_rgb(bitmap_rgb32 &bitmap, const rectangle &cliprec
// palette_resolver::palette_resolver
//-------------------------------------------------
-ATTR_FORCE_INLINE gime_base_device::palette_resolver::palette_resolver(gime_base_device *gime, const pixel_t *palette)
+inline gime_base_device::palette_resolver::palette_resolver(gime_base_device *gime, const pixel_t *palette)
{
m_gime = gime;
m_palette = palette;
@@ -1948,7 +1948,7 @@ ATTR_FORCE_INLINE gime_base_device::palette_resolver::palette_resolver(gime_base
// palette_resolver::get_palette
//-------------------------------------------------
-ATTR_FORCE_INLINE const gime_base_device::pixel_t *gime_base_device::palette_resolver::get_palette(UINT16 palette_rotation)
+inline const gime_base_device::pixel_t *gime_base_device::palette_resolver::get_palette(UINT16 palette_rotation)
{
if (UNEXPECTED(m_current_resolved_palette != palette_rotation))
{
@@ -1965,7 +1965,7 @@ ATTR_FORCE_INLINE const gime_base_device::pixel_t *gime_base_device::palette_res
// palette_resolver::lookup
//-------------------------------------------------
-ATTR_FORCE_INLINE gime_base_device::pixel_t gime_base_device::palette_resolver::lookup(UINT8 color)
+inline gime_base_device::pixel_t gime_base_device::palette_resolver::lookup(UINT8 color)
{
assert(color <= 63);
return m_palette[color];
diff --git a/src/mess/video/mac.c b/src/mess/video/mac.c
index 1856aa4427e..baffedf186d 100644
--- a/src/mess/video/mac.c
+++ b/src/mess/video/mac.c
@@ -1,4 +1,4 @@
-// license:???
+// license:BSD-3-Clause
// copyright-holders:Nathan Woods, Raphael Nabet, R. Belmont
/***************************************************************************
diff --git a/src/mess/video/mbc55x.c b/src/mess/video/mbc55x.c
index 165c0979903..d7fdc80d41c 100644
--- a/src/mess/video/mbc55x.c
+++ b/src/mess/video/mbc55x.c
@@ -80,7 +80,8 @@ static void video_debug(running_machine &machine, int ref, int params, const cha
mbc55x_state *mstate = machine.driver_data<mbc55x_state>();
if(params>0)
{
- sscanf(param[0],"%d",&mstate->m_debug_video);
+ int temp;
+ sscanf(param[0],"%d",&temp); mstate->m_debug_video = temp;;
}
else
{
diff --git a/src/mess/video/mbee.c b/src/mess/video/mbee.c
index 0216858344d..ce55969f6a3 100644
--- a/src/mess/video/mbee.c
+++ b/src/mess/video/mbee.c
@@ -1,12 +1,12 @@
-// license:GPL-2.0+
-// copyright-holders:Juergen Buchmueller, Robbbert
+// license:BSD-3-Clause
+// copyright-holders:Robbbert
/***************************************************************************
microbee.c
video hardware
- Juergen Buchmueller <pullmoll@t-online.de>, Dec 1999
+ Originally written by Juergen Buchmueller, Dec 1999
- Rewritten by Robbbert
+ Rewritten by Robbbert (see notes in driver file).
Operation of old keyboard:
The design is taken from the SY6545 Application Note AN3. As the CRTC
diff --git a/src/mess/video/pc1512.c b/src/mess/video/pc1512.c
index fe13b003d63..cecfe291d96 100644
--- a/src/mess/video/pc1512.c
+++ b/src/mess/video/pc1512.c
@@ -461,7 +461,7 @@ int pc1512_state::get_color(UINT8 data)
}
return color;
-};
+}
MC6845_UPDATE_ROW( pc1512_state::draw_graphics_1 )
{
diff --git a/src/mess/video/pdp1.c b/src/mess/video/pdp1.c
index e2735bb18b9..eea7b521679 100644
--- a/src/mess/video/pdp1.c
+++ b/src/mess/video/pdp1.c
@@ -1,4 +1,4 @@
-// license:???
+// license:GPL-2.0+
// copyright-holders:Raphael Nabet
/*
video/pdp1.c
diff --git a/src/mess/video/rmnimbus.c b/src/mess/video/rmnimbus.c
index 91bcc364c60..4ef72cac7c0 100644
--- a/src/mess/video/rmnimbus.c
+++ b/src/mess/video/rmnimbus.c
@@ -475,7 +475,8 @@ static void video_debug(running_machine &machine, int ref, int params, const cha
rmnimbus_state *state = machine.driver_data<rmnimbus_state>();
if(params>0)
{
- sscanf(param[0],"%d",&state->m_debug_video);
+ int temp;
+ sscanf(param[0],"%d",&temp); state->m_debug_video = temp;
}
else
{
diff --git a/src/mess/video/spectrum.c b/src/mess/video/spectrum.c
index 9eaed423e6f..c663aa5b865 100644
--- a/src/mess/video/spectrum.c
+++ b/src/mess/video/spectrum.c
@@ -71,7 +71,7 @@ void spectrum_state::screen_eof_spectrum(screen_device &screen, bool state)
if (state)
{
spectrum_UpdateBorderBitmap();
- spectrum_UpdateScreenBitmap();
+ spectrum_UpdateScreenBitmap(true);
m_frame_number++;
@@ -198,7 +198,7 @@ PALETTE_INIT_MEMBER(spectrum_state,spectrum)
palette.set_pen_colors(0, spectrum_palette, ARRAY_LENGTH(spectrum_palette));
}
-void spectrum_state::spectrum_UpdateScreenBitmap()
+void spectrum_state::spectrum_UpdateScreenBitmap(bool eof)
{
unsigned int x = machine().first_screen()->hpos();
unsigned int y = machine().first_screen()->vpos();
@@ -206,6 +206,9 @@ void spectrum_state::spectrum_UpdateScreenBitmap()
int height = m_screen_bitmap.height();
+ if ((m_previous_screen_x == x) && (m_previous_screen_y == y) && !eof)
+ return;
+
if (m_screen_bitmap.valid())
{
//printf("update screen from %d,%d to %d,%d\n", m_previous_screen_x, m_previous_screen_y, x, y);
diff --git a/src/mess/video/tx0.c b/src/mess/video/tx0.c
index c74fb8df1ad..4da8462a4af 100644
--- a/src/mess/video/tx0.c
+++ b/src/mess/video/tx0.c
@@ -1,4 +1,4 @@
-// license:???
+// license:GPL-2.0+
// copyright-holders:Raphael Nabet
/*
TX-0
diff --git a/src/osd/modules/debugger/debugint.c b/src/osd/modules/debugger/debugint.c
index 41620def623..093c3b9cf85 100644
--- a/src/osd/modules/debugger/debugint.c
+++ b/src/osd/modules/debugger/debugint.c
@@ -64,7 +64,7 @@ enum
RECT_DVIEW_TITLE,
RECT_DVIEW_HSB,
RECT_DVIEW_VSB,
- RECT_DVIEW_SIZE,
+ RECT_DVIEW_SIZE
};
enum
@@ -73,7 +73,7 @@ enum
VIEW_STATE_MOVING = 0x02,
VIEW_STATE_SIZING = 0x04,
VIEW_STATE_NEEDS_UPDATE = 0x08,
- VIEW_STATE_FOLLOW_CPU = 0x10,
+ VIEW_STATE_FOLLOW_CPU = 0x10
};
/***************************************************************************
diff --git a/src/osd/modules/debugger/debugqt.c b/src/osd/modules/debugger/debugqt.c
index 0cb6dd27e09..692e58d6551 100644
--- a/src/osd/modules/debugger/debugqt.c
+++ b/src/osd/modules/debugger/debugqt.c
@@ -8,7 +8,9 @@
//
//============================================================
+#if (!defined(NO_MEM_TRACKING))
#define NO_MEM_TRACKING
+#endif
#include "debug_module.h"
#include "modules/osdmodule.h"
diff --git a/src/osd/modules/lib/osdlib_win32.c b/src/osd/modules/lib/osdlib_win32.c
index 846d7e859cd..85334fd8ddc 100644
--- a/src/osd/modules/lib/osdlib_win32.c
+++ b/src/osd/modules/lib/osdlib_win32.c
@@ -36,6 +36,16 @@
// align allocations to start or end of the page?
#define GUARD_ALIGN_START 0
+#if defined(__BIGGEST_ALIGNMENT__)
+#define MAX_ALIGNMENT __BIGGEST_ALIGNMENT__
+#elif defined(__AVX__)
+#define MAX_ALIGNMENT 32
+#elif defined(__SSE__) || defined(__x86_64__) || defined(_M_X64)
+#define MAX_ALIGNMENT 16
+#else
+#define MAX_ALIGNMENT sizeof(INT64)
+#endif
+
//============================================================
// GLOBAL VARIABLES
@@ -112,17 +122,22 @@ int osd_get_num_processors(void)
void *osd_malloc(size_t size)
{
#ifndef MALLOC_DEBUG
- return HeapAlloc(GetProcessHeap(), 0, size);
+ return malloc(size);
#else
- // add in space for the size
- size += sizeof(size_t);
+ // add in space for the size and offset
+ size += MAX_ALIGNMENT + sizeof(size_t) + 2;
+ size &= ~size_t(1);
// basic objects just come from the heap
- void *result = HeapAlloc(GetProcessHeap(), 0, size);
+ UINT8 *const block = reinterpret_cast<UINT8 *>(HeapAlloc(GetProcessHeap(), 0, size));
+ if (block == NULL)
+ return NULL;
+ UINT8 *const result = reinterpret_cast<UINT8 *>(reinterpret_cast<FPTR>(block + sizeof(size_t) + MAX_ALIGNMENT) & ~(FPTR(MAX_ALIGNMENT) - 1));
// store the size and return and pointer to the data afterward
- *reinterpret_cast<size_t *>(result) = size;
- return reinterpret_cast<UINT8 *>(result) + sizeof(size_t);
+ *reinterpret_cast<size_t *>(block) = size;
+ *(result - 1) = result - block;
+ return result;
#endif
}
@@ -134,13 +149,14 @@ void *osd_malloc(size_t size)
void *osd_malloc_array(size_t size)
{
#ifndef MALLOC_DEBUG
- return HeapAlloc(GetProcessHeap(), 0, size);
+ return malloc(size);
#else
- // add in space for the size
- size += sizeof(size_t);
+ // add in space for the size and offset
+ size += MAX_ALIGNMENT + sizeof(size_t) + 2;
+ size &= ~size_t(1);
// round the size up to a page boundary
- size_t rounded_size = ((size + sizeof(void *) + PAGE_SIZE - 1) / PAGE_SIZE) * PAGE_SIZE;
+ size_t const rounded_size = ((size + sizeof(void *) + PAGE_SIZE - 1) / PAGE_SIZE) * PAGE_SIZE;
// reserve that much memory, plus two guard pages
void *page_base = VirtualAlloc(NULL, rounded_size + 2 * PAGE_SIZE, MEM_RESERVE, PAGE_NOACCESS);
@@ -153,11 +169,13 @@ void *osd_malloc_array(size_t size)
return NULL;
// work backwards from the page base to get to the block base
- void *result = GUARD_ALIGN_START ? page_base : (reinterpret_cast<UINT8 *>(page_base) + rounded_size - size);
+ UINT8 *const block = GUARD_ALIGN_START ? reinterpret_cast<UINT8 *>(page_base) : (reinterpret_cast<UINT8 *>(page_base) + rounded_size - size);
+ UINT8 *const result = reinterpret_cast<UINT8 *>(reinterpret_cast<FPTR>(block + sizeof(size_t) + MAX_ALIGNMENT) & ~(FPTR(MAX_ALIGNMENT) - 1));
// store the size at the start with a flag indicating it has a guard page
- *reinterpret_cast<size_t *>(result) = size | 0x80000000;
- return reinterpret_cast<UINT8 *>(result) + sizeof(size_t);
+ *reinterpret_cast<size_t *>(block) = size | 1;
+ *(result - 1) = result - block;
+ return result;
#endif
}
@@ -169,18 +187,21 @@ void *osd_malloc_array(size_t size)
void osd_free(void *ptr)
{
#ifndef MALLOC_DEBUG
- HeapFree(GetProcessHeap(), 0, ptr);
+ free(ptr);
#else
- size_t size = reinterpret_cast<size_t *>(ptr)[-1];
-
- // if no guard page, just free the pointer
- if ((size & 0x80000000) == 0)
- HeapFree(GetProcessHeap(), 0, reinterpret_cast<UINT8 *>(ptr) - sizeof(size_t));
+ UINT8 const offset = *(reinterpret_cast<UINT8 *>(ptr) - 1);
+ UINT8 *const block = reinterpret_cast<UINT8 *>(ptr) - offset;
+ size_t const size = *reinterpret_cast<size_t *>(block);
- // large items need more care
+ if ((size & 0x1) == 0)
+ {
+ // if no guard page, just free the pointer
+ HeapFree(GetProcessHeap(), 0, block);
+ }
else
{
- ULONG_PTR page_base = (reinterpret_cast<ULONG_PTR>(ptr) - sizeof(size_t)) & ~(PAGE_SIZE - 1);
+ // large items need more care
+ ULONG_PTR const page_base = reinterpret_cast<ULONG_PTR>(block) & ~(PAGE_SIZE - 1);
VirtualFree(reinterpret_cast<void *>(page_base - PAGE_SIZE), 0, MEM_RELEASE);
}
#endif
diff --git a/src/osd/modules/lib/osdobj_common.c b/src/osd/modules/lib/osdobj_common.c
index 903ee072d36..39767eb6210 100644
--- a/src/osd/modules/lib/osdobj_common.c
+++ b/src/osd/modules/lib/osdobj_common.c
@@ -17,6 +17,13 @@ extern bool g_print_verbose;
const options_entry osd_options::s_option_entries[] =
{
+ { NULL, NULL, OPTION_HEADER, "OSD KEYBOARD MAPPING OPTIONS" },
+#ifdef SDLMAME_MACOSX
+ { OSDOPTION_UIMODEKEY, "DEL", OPTION_STRING, "Key to toggle keyboard mode" },
+#else
+ { OSDOPTION_UIMODEKEY, "SCRLOCK", OPTION_STRING, "Key to toggle keyboard mode" },
+#endif // SDLMAME_MACOSX
+
{ NULL, NULL, OPTION_HEADER, "OSD FONT OPTIONS" },
{ OSD_FONT_PROVIDER, OSDOPTVAL_AUTO, OPTION_STRING, "provider for ui font: " },
@@ -24,20 +31,17 @@ const options_entry osd_options::s_option_entries[] =
{ OSDCOMMAND_LIST_MIDI_DEVICES ";mlist", "0", OPTION_COMMAND, "list available MIDI I/O devices" },
{ OSDCOMMAND_LIST_NETWORK_ADAPTERS ";nlist", "0", OPTION_COMMAND, "list available network adapters" },
- // debugging options
{ NULL, NULL, OPTION_HEADER, "OSD DEBUGGING OPTIONS" },
{ OSDOPTION_DEBUGGER, OSDOPTVAL_AUTO, OPTION_STRING, "debugger used: " },
{ OSDOPTION_DEBUGGER_FONT ";dfont", OSDOPTVAL_AUTO, OPTION_STRING, "specifies the font to use for debugging" },
{ OSDOPTION_DEBUGGER_FONT_SIZE ";dfontsize", "0", OPTION_FLOAT, "specifies the font size to use for debugging" },
-
{ OSDOPTION_WATCHDOG ";wdog", "0", OPTION_INTEGER, "force the program to terminate if no updates within specified number of seconds" },
- // performance options
{ NULL, NULL, OPTION_HEADER, "OSD PERFORMANCE OPTIONS" },
{ OSDOPTION_MULTITHREADING ";mt", "0", OPTION_BOOLEAN, "enable multithreading; this enables rendering and blitting on a separate thread" },
{ OSDOPTION_NUMPROCESSORS ";np", OSDOPTVAL_AUTO, OPTION_STRING, "number of processors; this overrides the number the system reports" },
{ OSDOPTION_BENCH, "0", OPTION_INTEGER, "benchmark for the given number of emulated seconds; implies -video none -sound none -nothrottle" },
- // video options
+
{ NULL, NULL, OPTION_HEADER, "OSD VIDEO OPTIONS" },
// OS X can be trusted to have working hardware OpenGL, so default to it on for the best user experience
{ OSDOPTION_VIDEO, OSDOPTVAL_AUTO, OPTION_STRING, "video output method: " },
@@ -85,7 +89,6 @@ const options_entry osd_options::s_option_entries[] =
{ OSDOPTION_PRESCALE, "1", OPTION_INTEGER, "scale screen rendering by this amount in software" },
#if USE_OPENGL
- // OpenGL specific options
{ NULL, NULL, OPTION_HEADER, "OpenGL-SPECIFIC OPTIONS" },
{ OSDOPTION_GL_FORCEPOW2TEXTURE, "0", OPTION_BOOLEAN, "force power of two textures (default no)" },
{ OSDOPTION_GL_NOTEXTURERECT, "0", OPTION_BOOLEAN, "don't use OpenGL GL_ARB_texture_rectangle (default on)" },
@@ -115,7 +118,6 @@ const options_entry osd_options::s_option_entries[] =
{ OSDOPTION_SHADER_SCREEN "9", OSDOPTVAL_NONE, OPTION_STRING, "custom OpenGL GLSL shader screen bitmap 9" },
#endif
- // sound options
{ NULL, NULL, OPTION_HEADER, "OSD SOUND OPTIONS" },
{ OSDOPTION_SOUND, OSDOPTVAL_AUTO, OPTION_STRING, "sound output method: " },
{ OSDOPTION_AUDIO_LATENCY "(1-5)", "2", OPTION_INTEGER, "set audio latency (increase to reduce glitches, decrease for responsiveness)" },
@@ -143,7 +145,7 @@ osd_options::osd_options()
: cli_options()
{
add_entries(osd_options::s_option_entries);
-};
+}
//-------------------------------------------------
diff --git a/src/osd/modules/lib/osdobj_common.h b/src/osd/modules/lib/osdobj_common.h
index d46463b414d..ddbc8c974d4 100644
--- a/src/osd/modules/lib/osdobj_common.h
+++ b/src/osd/modules/lib/osdobj_common.h
@@ -26,6 +26,8 @@
// Defines
//============================================================
+#define OSDOPTION_UIMODEKEY "uimodekey"
+
#define OSDCOMMAND_LIST_MIDI_DEVICES "listmidi"
#define OSDCOMMAND_LIST_NETWORK_ADAPTERS "listnetwork"
@@ -54,9 +56,6 @@
#define OSDOPTION_SWITCHRES "switchres"
-#define OSDOPTION_SOUND "sound"
-#define OSDOPTION_AUDIO_LATENCY "audio_latency"
-
#define OSDOPTION_FILTER "filter"
#define OSDOPTION_PRESCALE "prescale"
@@ -69,6 +68,9 @@
#define OSDOPTION_GL_NOTEXTURERECT "gl_notexturerect"
#define OSDOPTION_GL_FORCEPOW2TEXTURE "gl_forcepow2texture"
+#define OSDOPTION_SOUND "sound"
+#define OSDOPTION_AUDIO_LATENCY "audio_latency"
+
#define OSDOPTION_AUDIO_OUTPUT "audio_output"
#define OSDOPTION_AUDIO_EFFECT "audio_effect"
@@ -87,6 +89,9 @@ public:
// construction/destruction
osd_options();
+ // keyboard mapping
+ const char *ui_mode_key() const { return value(OSDOPTION_UIMODEKEY); }
+
// debugging options
const char *debugger() const { return value(OSDOPTION_DEBUGGER); }
const char *debugger_font() const { return value(OSDOPTION_DEBUGGER_FONT); }
@@ -121,11 +126,7 @@ public:
// full screen options
bool switch_res() const { return bool_value(OSDOPTION_SWITCHRES); }
- // sound options
- const char *sound() const { return value(OSDOPTION_SOUND); }
- int audio_latency() const { return int_value(OSDOPTION_AUDIO_LATENCY); }
-
- // video options
+ // accelerated video options
bool filter() const { return bool_value(OSDOPTION_FILTER); }
int prescale() const { return int_value(OSDOPTION_PRESCALE); }
@@ -139,6 +140,10 @@ public:
const char *shader_mame(int index) const { std::string temp; strprintf(temp, "%s%d", OSDOPTION_SHADER_MAME, index); return value(temp.c_str()); }
const char *shader_screen(int index) const { std::string temp; strprintf(temp, "%s%d", OSDOPTION_SHADER_SCREEN, index); return value(temp.c_str()); }
+ // sound options
+ const char *sound() const { return value(OSDOPTION_SOUND); }
+ int audio_latency() const { return int_value(OSDOPTION_AUDIO_LATENCY); }
+
// CoreAudio specific options
const char *audio_output() const { return value(OSDOPTION_AUDIO_OUTPUT); }
const char *audio_effect(int index) const { std::string temp; strprintf(temp, "%s%d", OSDOPTION_AUDIO_EFFECT, index); return value(temp.c_str()); }
diff --git a/src/osd/modules/midi/portmidi.c b/src/osd/modules/midi/portmidi.c
index 78ac990d2b0..02dad28ffc1 100644
--- a/src/osd/modules/midi/portmidi.c
+++ b/src/osd/modules/midi/portmidi.c
@@ -10,7 +10,11 @@
#ifndef NO_USE_MIDI
+#ifndef USE_SYSTEM_PORTMIDI
#include "portmidi/pm_common/portmidi.h"
+#else
+#include <portmidi.h>
+#endif
#include "osdcore.h"
#include "corealloc.h"
#include "modules/osdmodule.h"
diff --git a/src/osd/modules/opengl/SDL1211_opengl.h b/src/osd/modules/opengl/SDL1211_opengl.h
index b068ebe6452..2a5db6f3199 100644
--- a/src/osd/modules/opengl/SDL1211_opengl.h
+++ b/src/osd/modules/opengl/SDL1211_opengl.h
@@ -1,4 +1,4 @@
-// license:GPL-2.0+
+// license:LGPL-2.1+
// copyright-holders:Sam Lantinga
/*
SDL - Simple DirectMedia Layer
diff --git a/src/osd/modules/opengl/gl_shader_mgr.h b/src/osd/modules/opengl/gl_shader_mgr.h
index ebb45e2ba7a..69400d90dc2 100644
--- a/src/osd/modules/opengl/gl_shader_mgr.h
+++ b/src/osd/modules/opengl/gl_shader_mgr.h
@@ -11,7 +11,7 @@ enum GLSL_SHADER_FEATURE {
GLSL_SHADER_FEAT_BILINEAR,
GLSL_SHADER_FEAT_INT_NUMBER,
GLSL_SHADER_FEAT_CUSTOM = GLSL_SHADER_FEAT_INT_NUMBER,
- GLSL_SHADER_FEAT_MAX_NUMBER,
+ GLSL_SHADER_FEAT_MAX_NUMBER
};
// old code passed sdl_info * to functions here
diff --git a/src/osd/modules/opengl/gl_shader_tool.c b/src/osd/modules/opengl/gl_shader_tool.c
index abf1420f77a..203869e308e 100644
--- a/src/osd/modules/opengl/gl_shader_tool.c
+++ b/src/osd/modules/opengl/gl_shader_tool.c
@@ -374,11 +374,6 @@ errout:
int gl_compile_shader_file( GLhandleARB *shader, GLenum type, const char * shader_file, int verbose )
{
- int err = 0, i, c;
- FILE * file = NULL;
- const int buffer_len=8192;
- GLcharARB *buffer=NULL;
-
if(shader==NULL || shader_file==NULL)
{
if(shader==NULL)
@@ -388,27 +383,29 @@ int gl_compile_shader_file( GLhandleARB *shader, GLenum type, const char * shade
return -1;
}
- file = fopen(shader_file, "r");
+ FILE *const file = fopen(shader_file, "r");
if(!file)
{
osd_printf_warning("cannot open shader_file: %s\n", shader_file);
return -1;
}
- buffer = (GLcharARB *) malloc(buffer_len);
- memset(buffer, 0, buffer_len);
+ // get the real file size
+ fseek(file, 0, SEEK_END);
+ int const buffer_len = (int)ftell(file);
+ fseek(file, 0, SEEK_SET);
- /* Load Shader Sources */
- i=0;
- while( i<buffer_len-1 && EOF!=(c=fgetc(file)) )
- buffer[i++]=(char)c;
- fclose(file);
- buffer[i]='\0';
+ GLcharARB *const buffer = (GLcharARB *)malloc(buffer_len + 1);
+ memset(buffer, 0, buffer_len + 1);
- err=gl_compile_shader_source(shader, type, buffer, verbose);
- if(err) goto errout;
+ /* Load Shader Sources */
+ for( int i = 0, c = 0; i<buffer_len && EOF!=(c=fgetc(file)); i++ )
+ buffer[i]=(char)c;
+ fclose(file);
+ int const err=gl_compile_shader_source(shader, type, buffer, verbose);
free(buffer);
+ if(err) goto errout;
if(verbose)
osd_printf_warning("shader file: %s\n", shader_file);
@@ -416,9 +413,8 @@ int gl_compile_shader_file( GLhandleARB *shader, GLenum type, const char * shade
return 0;
errout:
- free(buffer);
osd_printf_warning("failed to process shader_file: %s\n", shader_file);
- return err;
+ return err;
}
diff --git a/src/osd/modules/render/d3d/d3d9intf.c b/src/osd/modules/render/d3d/d3d9intf.c
index 7a35d0ad577..f6ed962e5f6 100644
--- a/src/osd/modules/render/d3d/d3d9intf.c
+++ b/src/osd/modules/render/d3d/d3d9intf.c
@@ -623,4 +623,4 @@ static void set_interfaces(base *d3dptr)
d3dptr->vertexbuf = d3d9_vertex_buffer_interface;
}
-};
+}
diff --git a/src/osd/modules/render/d3d/d3dcomm.h b/src/osd/modules/render/d3d/d3dcomm.h
index 8b53d18d0f1..daaa4bde9ac 100644
--- a/src/osd/modules/render/d3d/d3dcomm.h
+++ b/src/osd/modules/render/d3d/d3dcomm.h
@@ -220,7 +220,7 @@ private:
float m_prim_height; // used by quads
};
-}; // d3d
+} // d3d
/* vertex describes a single vertex */
struct vertex
diff --git a/src/osd/modules/render/d3d/d3dhlsl.c b/src/osd/modules/render/d3d/d3dhlsl.c
index 529968c234e..db1448c6552 100644
--- a/src/osd/modules/render/d3d/d3dhlsl.c
+++ b/src/osd/modules/render/d3d/d3dhlsl.c
@@ -3217,7 +3217,7 @@ ULONG effect::release()
return m_effect->Release();
}
-};
+}
//============================================================
diff --git a/src/osd/modules/render/d3d/d3dhlsl.h b/src/osd/modules/render/d3d/d3dhlsl.h
index a31f0ae601a..5862fb26e5f 100644
--- a/src/osd/modules/render/d3d/d3dhlsl.h
+++ b/src/osd/modules/render/d3d/d3dhlsl.h
@@ -36,7 +36,7 @@ public:
UT_FLOAT,
UT_INT,
UT_MATRIX,
- UT_SAMPLER,
+ UT_SAMPLER
} uniform_type;
enum
@@ -96,7 +96,7 @@ public:
CU_BLOOM_LVL4567_WEIGHTS,
CU_BLOOM_LVL89A_WEIGHTS,
- CU_COUNT,
+ CU_COUNT
};
uniform(effect *shader, const char *name, uniform_type type, int id);
@@ -421,6 +421,6 @@ public:
static hlsl_options s_hlsl_presets[4];
};
-};
+}
#endif
diff --git a/src/osd/modules/render/d3d/d3dintf.h b/src/osd/modules/render/d3d/d3dintf.h
index 063eb5ff158..9155f620545 100644
--- a/src/osd/modules/render/d3d/d3dintf.h
+++ b/src/osd/modules/render/d3d/d3dintf.h
@@ -229,6 +229,6 @@ struct base
base *drawd3d9_init(void);
-};
+}
#endif
diff --git a/src/osd/modules/render/drawd3d.c b/src/osd/modules/render/drawd3d.c
index 39fbac323eb..bcd823be909 100644
--- a/src/osd/modules/render/drawd3d.c
+++ b/src/osd/modules/render/drawd3d.c
@@ -2879,4 +2879,4 @@ bool render_target::init(renderer *d3d, base *d3dintf, int width, int height, in
return true;
}
-};
+}
diff --git a/src/osd/modules/render/drawd3d.h b/src/osd/modules/render/drawd3d.h
index ae7db3a3304..dace1ce342d 100644
--- a/src/osd/modules/render/drawd3d.h
+++ b/src/osd/modules/render/drawd3d.h
@@ -226,6 +226,6 @@ private:
int m_line_count;
};
-};
+}
#endif
diff --git a/src/osd/modules/render/drawogl.c b/src/osd/modules/render/drawogl.c
index c8a535d0e94..f071428972f 100644
--- a/src/osd/modules/render/drawogl.c
+++ b/src/osd/modules/render/drawogl.c
@@ -447,11 +447,11 @@ private:
// Textures
//============================================================
-/* texture_info holds information about a texture */
-class texture_info
+/* ogl_texture_info holds information about a texture */
+class ogl_texture_info
{
public:
- texture_info()
+ ogl_texture_info()
: hash(0), flags(0), rawwidth(0), rawheight(0),
rawwidth_create(0), rawheight_create(0),
type(0), format(0), borderpix(0), xprescale(0), yprescale(0), nocopy(0),
@@ -567,19 +567,19 @@ private:
void loadGLExtensions();
void initialize_gl();
void set_blendmode(int blendmode);
- void texture_compute_type_subroutine(const render_texinfo *texsource, texture_info *texture, UINT32 flags);
- void texture_compute_size_subroutine(texture_info *texture, UINT32 flags,
+ void texture_compute_type_subroutine(const render_texinfo *texsource, ogl_texture_info *texture, UINT32 flags);
+ void texture_compute_size_subroutine(ogl_texture_info *texture, UINT32 flags,
UINT32 width, UINT32 height,
int* p_width, int* p_height, int* p_width_create, int* p_height_create);
- void texture_compute_size_type(const render_texinfo *texsource, texture_info *texture, UINT32 flags);
- texture_info *texture_create(const render_texinfo *texsource, UINT32 flags);
- int texture_shader_create(const render_texinfo *texsource, texture_info *texture, UINT32 flags);
- texture_info *texture_find(const render_primitive *prim);
- void texture_coord_update(texture_info *texture, const render_primitive *prim, int shaderIdx);
- void texture_mpass_flip(texture_info *texture, int shaderIdx);
- void texture_shader_update(texture_info *texture, render_container *container, int shaderIdx);
- texture_info * texture_update(const render_primitive *prim, int shaderIdx);
- void texture_disable(texture_info * texture);
+ void texture_compute_size_type(const render_texinfo *texsource, ogl_texture_info *texture, UINT32 flags);
+ ogl_texture_info *texture_create(const render_texinfo *texsource, UINT32 flags);
+ int texture_shader_create(const render_texinfo *texsource, ogl_texture_info *texture, UINT32 flags);
+ ogl_texture_info *texture_find(const render_primitive *prim);
+ void texture_coord_update(ogl_texture_info *texture, const render_primitive *prim, int shaderIdx);
+ void texture_mpass_flip(ogl_texture_info *texture, int shaderIdx);
+ void texture_shader_update(ogl_texture_info *texture, render_container *container, int shaderIdx);
+ ogl_texture_info * texture_update(const render_primitive *prim, int shaderIdx);
+ void texture_disable(ogl_texture_info * texture);
void texture_all_disable();
INT32 m_blittimer;
@@ -591,7 +591,7 @@ private:
int m_initialized; // is everything well initialized, i.e. all GL stuff etc.
// 3D info (GL mode only)
- texture_info * m_texhash[HASH_SIZE + OVERFLOW_SIZE];
+ ogl_texture_info * m_texhash[HASH_SIZE + OVERFLOW_SIZE];
int m_last_blendmode; // previous blendmode
INT32 m_texture_max_width; // texture maximum width
INT32 m_texture_max_height; // texture maximum height
@@ -734,7 +734,7 @@ static int glsl_shader_feature = GLSL_SHADER_FEAT_PLAIN;
// Textures
//============================================================
-static void texture_set_data(texture_info *texture, const render_texinfo *texsource, UINT32 flags);
+static void texture_set_data(ogl_texture_info *texture, const render_texinfo *texsource, UINT32 flags);
//============================================================
// Static Variables
@@ -1106,7 +1106,7 @@ int sdl_info_ogl::xy_to_render_target(int x, int y, int *xt, int *yt)
void sdl_info_ogl::destroy_all_textures()
{
- texture_info *texture = NULL;
+ ogl_texture_info *texture = NULL;
int lock=FALSE;
int i;
@@ -1499,7 +1499,7 @@ void sdl_info_ogl::loadGLExtensions()
int sdl_info_ogl::draw(const int update)
{
render_primitive *prim;
- texture_info *texture=NULL;
+ ogl_texture_info *texture=NULL;
float vofs, hofs;
int pendingPrimitive=GL_NO_PRIMITIVE, curPrimitive=GL_NO_PRIMITIVE;
@@ -1946,7 +1946,7 @@ static void drawogl_exit(void)
// we also don't want to use PBO's in the case of nocopy==TRUE,
// since we now might have GLSL shaders - this decision simplifies out life ;-)
//
-void sdl_info_ogl::texture_compute_type_subroutine(const render_texinfo *texsource, texture_info *texture, UINT32 flags)
+void sdl_info_ogl::texture_compute_type_subroutine(const render_texinfo *texsource, ogl_texture_info *texture, UINT32 flags)
{
texture->type = TEXTURE_TYPE_NONE;
texture->nocopy = FALSE;
@@ -2000,7 +2000,7 @@ INLINE int get_valid_pow2_value(int v, int needPow2)
return (needPow2)?gl_round_to_pow2(v):v;
}
-void sdl_info_ogl::texture_compute_size_subroutine(texture_info *texture, UINT32 flags,
+void sdl_info_ogl::texture_compute_size_subroutine(ogl_texture_info *texture, UINT32 flags,
UINT32 width, UINT32 height,
int* p_width, int* p_height, int* p_width_create, int* p_height_create)
{
@@ -2051,7 +2051,7 @@ void sdl_info_ogl::texture_compute_size_subroutine(texture_info *texture, UINT32
*p_height_create=height_create;
}
-void sdl_info_ogl::texture_compute_size_type(const render_texinfo *texsource, texture_info *texture, UINT32 flags)
+void sdl_info_ogl::texture_compute_size_type(const render_texinfo *texsource, ogl_texture_info *texture, UINT32 flags)
{
int finalheight, finalwidth;
int finalheight_create, finalwidth_create;
@@ -2204,7 +2204,7 @@ static int texture_fbo_create(UINT32 text_unit, UINT32 text_name, UINT32 fbo_nam
return 0;
}
-int sdl_info_ogl::texture_shader_create(const render_texinfo *texsource, texture_info *texture, UINT32 flags)
+int sdl_info_ogl::texture_shader_create(const render_texinfo *texsource, ogl_texture_info *texture, UINT32 flags)
{
int uniform_location;
int i;
@@ -2377,12 +2377,12 @@ int sdl_info_ogl::texture_shader_create(const render_texinfo *texsource, texture
return 0;
}
-texture_info *sdl_info_ogl::texture_create(const render_texinfo *texsource, UINT32 flags)
+ogl_texture_info *sdl_info_ogl::texture_create(const render_texinfo *texsource, UINT32 flags)
{
- texture_info *texture;
+ ogl_texture_info *texture;
// allocate a new texture
- texture = global_alloc(texture_info);
+ texture = global_alloc(ogl_texture_info);
// fill in the core data
texture->hash = texture_compute_hash(texsource, flags);
@@ -2832,7 +2832,7 @@ INLINE void copyline_yuy16_to_argb(UINT32 *dst, const UINT16 *src, int width, co
// texture_set_data
//============================================================
-static void texture_set_data(texture_info *texture, const render_texinfo *texsource, UINT32 flags)
+static void texture_set_data(ogl_texture_info *texture, const render_texinfo *texsource, UINT32 flags)
{
if ( texture->type == TEXTURE_TYPE_DYNAMIC )
{
@@ -2955,7 +2955,7 @@ static void texture_set_data(texture_info *texture, const render_texinfo *texsou
// texture_find
//============================================================
-static int compare_texture_primitive(const texture_info *texture, const render_primitive *prim)
+static int compare_texture_primitive(const ogl_texture_info *texture, const render_primitive *prim)
{
if (texture->texinfo.base == prim->texture.base &&
texture->texinfo.width == prim->texture.width &&
@@ -2968,10 +2968,10 @@ static int compare_texture_primitive(const texture_info *texture, const render_p
return 0;
}
-texture_info *sdl_info_ogl::texture_find(const render_primitive *prim)
+ogl_texture_info *sdl_info_ogl::texture_find(const render_primitive *prim)
{
HashT texhash = texture_compute_hash(&prim->texture, prim->flags);
- texture_info *texture;
+ ogl_texture_info *texture;
texture = m_texhash[texhash];
if (texture != NULL)
@@ -2993,7 +2993,7 @@ texture_info *sdl_info_ogl::texture_find(const render_primitive *prim)
// texture_update
//============================================================
-void sdl_info_ogl::texture_coord_update(texture_info *texture, const render_primitive *prim, int shaderIdx)
+void sdl_info_ogl::texture_coord_update(ogl_texture_info *texture, const render_primitive *prim, int shaderIdx)
{
float ustart = 0.0f, ustop = 0.0f; // beginning/ending U coordinates
float vstart = 0.0f, vstop = 0.0f; // beginning/ending V coordinates
@@ -3070,7 +3070,7 @@ void sdl_info_ogl::texture_coord_update(texture_info *texture, const render_prim
}
}
-void sdl_info_ogl::texture_mpass_flip(texture_info *texture, int shaderIdx)
+void sdl_info_ogl::texture_mpass_flip(ogl_texture_info *texture, int shaderIdx)
{
UINT32 mpass_src_idx = texture->mpass_dest_idx;
@@ -3141,7 +3141,7 @@ void sdl_info_ogl::texture_mpass_flip(texture_info *texture, int shaderIdx)
}
}
-void sdl_info_ogl::texture_shader_update(texture_info *texture, render_container *container, int shaderIdx)
+void sdl_info_ogl::texture_shader_update(ogl_texture_info *texture, render_container *container, int shaderIdx)
{
int uniform_location;
GLfloat vid_attributes[4];
@@ -3166,9 +3166,9 @@ void sdl_info_ogl::texture_shader_update(texture_info *texture, render_container
}
}
-texture_info * sdl_info_ogl::texture_update(const render_primitive *prim, int shaderIdx)
+ogl_texture_info * sdl_info_ogl::texture_update(const render_primitive *prim, int shaderIdx)
{
- texture_info *texture = texture_find(prim);
+ ogl_texture_info *texture = texture_find(prim);
int texBound = 0;
// if we didn't find one, create a new texture
@@ -3239,7 +3239,7 @@ texture_info * sdl_info_ogl::texture_update(const render_primitive *prim, int sh
return texture;
}
-void sdl_info_ogl::texture_disable(texture_info * texture)
+void sdl_info_ogl::texture_disable(ogl_texture_info * texture)
{
if ( texture->type == TEXTURE_TYPE_SHADER )
{
diff --git a/src/osd/sdl/input.c b/src/osd/sdl/input.c
index 7d4e9adb375..8f70ba1e0ee 100644
--- a/src/osd/sdl/input.c
+++ b/src/osd/sdl/input.c
@@ -2067,7 +2067,7 @@ void sdl_osd_interface::customize_input_type_list(simple_list<input_type_entry>
input_item_id mameid_code;
input_code ui_code;
input_type_entry *entry;
- const char* uimode;
+ const char* uimode;
char fullmode[64];
// loop over the defaults
diff --git a/src/osd/sdl/osdsdl.h b/src/osd/sdl/osdsdl.h
index 8b8ebeb4444..22a3aad60b9 100644
--- a/src/osd/sdl/osdsdl.h
+++ b/src/osd/sdl/osdsdl.h
@@ -48,7 +48,6 @@
#define SDLOPTION_SYNCREFRESH "syncrefresh"
#define SDLOPTION_KEYMAP "keymap"
#define SDLOPTION_KEYMAP_FILE "keymap_file"
-#define SDLOPTION_UIMODEKEY "uimodekey"
#define SDLOPTION_SIXAXIS "sixaxis"
#define SDLOPTION_JOYINDEX "joy_idx"
@@ -118,7 +117,6 @@ public:
// keyboard mapping
bool keymap() const { return bool_value(SDLOPTION_KEYMAP); }
const char *keymap_file() const { return value(SDLOPTION_KEYMAP_FILE); }
- const char *ui_mode_key() const { return value(SDLOPTION_UIMODEKEY); }
// joystick mapping
const char *joy_index(int index) const { std::string temp; return value(strformat(temp, "%s%d", SDLOPTION_JOYINDEX, index).c_str()); }
diff --git a/src/osd/sdl/sdlfile.c b/src/osd/sdl/sdlfile.c
index 24fe05ac027..74779252641 100644
--- a/src/osd/sdl/sdlfile.c
+++ b/src/osd/sdl/sdlfile.c
@@ -375,7 +375,7 @@ file_error osd_truncate(osd_file *file, UINT64 offset)
{
case SDLFILE_FILE:
result = ftruncate(file->handle, offset);
- if (!result)
+ if (result)
return error_to_file_error(errno);
return FILERR_NONE;
diff --git a/src/osd/sdl/sdlmain.c b/src/osd/sdl/sdlmain.c
index e022c9d59b4..14ff93ecaf5 100644
--- a/src/osd/sdl/sdlmain.c
+++ b/src/osd/sdl/sdlmain.c
@@ -117,11 +117,6 @@ const options_entry sdl_options::s_option_entries[] =
{ NULL, NULL, OPTION_HEADER, "SDL KEYBOARD MAPPING" },
{ SDLOPTION_KEYMAP, "0", OPTION_BOOLEAN, "enable keymap" },
{ SDLOPTION_KEYMAP_FILE, "keymap.dat", OPTION_STRING, "keymap filename" },
-#ifdef SDLMAME_MACOSX
- { SDLOPTION_UIMODEKEY, "DEL", OPTION_STRING, "Key to toggle keyboard mode" },
-#else
- { SDLOPTION_UIMODEKEY, "SCRLOCK", OPTION_STRING, "Key to toggle keyboard mode" },
-#endif // SDLMAME_MACOSX
// joystick mapping
{ NULL, NULL, OPTION_HEADER, "SDL JOYSTICK MAPPING" },
diff --git a/src/osd/sdl/video.c b/src/osd/sdl/video.c
index fa0c8e28bb4..f9b18c9041f 100644
--- a/src/osd/sdl/video.c
+++ b/src/osd/sdl/video.c
@@ -756,6 +756,11 @@ static void get_resolution(const char *defdata, const char *data, osd_window_con
data = defdata;
}
- if (sscanf(data, "%dx%dx%d@%d", &config->width, &config->height, &config->depth, &config->refresh) < 2 && report_error)
+ if (sscanf(data, "%dx%dx%d", &config->width, &config->height, &config->depth) < 2 && report_error)
osd_printf_error("Illegal resolution value = %s\n", data);
+
+ const char * at_pos = strchr(data, '@');
+ if (at_pos)
+ if (sscanf(at_pos + 1, "%d", &config->refresh) < 1 && report_error)
+ osd_printf_error("Illegal refresh rate in resolution value = %s\n", data);
}
diff --git a/src/osd/sdl/window.c b/src/osd/sdl/window.c
index 0c262cc14c6..683f3369f68 100644
--- a/src/osd/sdl/window.c
+++ b/src/osd/sdl/window.c
@@ -1561,6 +1561,10 @@ osd_dim sdl_window_info::get_min_bounds(int constrain)
}
}
+ // remove extra window stuff
+ minwidth -= wnd_extra_width();
+ minheight -= wnd_extra_height();
+
return osd_dim(minwidth, minheight);
}
diff --git a/src/osd/windows/input.c b/src/osd/windows/input.c
index f6c46d87f15..ec08277bcf4 100644
--- a/src/osd/windows/input.c
+++ b/src/osd/windows/input.c
@@ -52,11 +52,6 @@ enum
#define MAX_KEYS 256
-#define MAME_KEY 0
-#define DI_KEY 1
-#define VIRTUAL_KEY 2
-#define ASCII_KEY 3
-
//============================================================
@@ -270,118 +265,126 @@ static const TCHAR *default_pov_name(int which);
//============================================================
// master keyboard translation table
-static const int win_key_trans_table[][4] =
+struct key_trans_entry {
+ input_item_id mame_key;
+ INT32 di_key;
+ unsigned char virtual_key;
+ char ascii_key;
+ char const * mame_key_name;
+};
+#define KEY_TRANS_ENTRY(mame, di, virtual, ascii) { ITEM_ID_##mame, DIK_##di, virtual, ascii, "ITEM_ID_"#mame }
+static const key_trans_entry win_key_trans_table[] =
{
- // MAME key dinput key virtual key ascii
- { ITEM_ID_ESC, DIK_ESCAPE, VK_ESCAPE, 27 },
- { ITEM_ID_1, DIK_1, '1', '1' },
- { ITEM_ID_2, DIK_2, '2', '2' },
- { ITEM_ID_3, DIK_3, '3', '3' },
- { ITEM_ID_4, DIK_4, '4', '4' },
- { ITEM_ID_5, DIK_5, '5', '5' },
- { ITEM_ID_6, DIK_6, '6', '6' },
- { ITEM_ID_7, DIK_7, '7', '7' },
- { ITEM_ID_8, DIK_8, '8', '8' },
- { ITEM_ID_9, DIK_9, '9', '9' },
- { ITEM_ID_0, DIK_0, '0', '0' },
- { ITEM_ID_MINUS, DIK_MINUS, VK_OEM_MINUS, '-' },
- { ITEM_ID_EQUALS, DIK_EQUALS, VK_OEM_PLUS, '=' },
- { ITEM_ID_BACKSPACE, DIK_BACK, VK_BACK, 8 },
- { ITEM_ID_TAB, DIK_TAB, VK_TAB, 9 },
- { ITEM_ID_Q, DIK_Q, 'Q', 'Q' },
- { ITEM_ID_W, DIK_W, 'W', 'W' },
- { ITEM_ID_E, DIK_E, 'E', 'E' },
- { ITEM_ID_R, DIK_R, 'R', 'R' },
- { ITEM_ID_T, DIK_T, 'T', 'T' },
- { ITEM_ID_Y, DIK_Y, 'Y', 'Y' },
- { ITEM_ID_U, DIK_U, 'U', 'U' },
- { ITEM_ID_I, DIK_I, 'I', 'I' },
- { ITEM_ID_O, DIK_O, 'O', 'O' },
- { ITEM_ID_P, DIK_P, 'P', 'P' },
- { ITEM_ID_OPENBRACE, DIK_LBRACKET, VK_OEM_4, '[' },
- { ITEM_ID_CLOSEBRACE, DIK_RBRACKET, VK_OEM_6, ']' },
- { ITEM_ID_ENTER, DIK_RETURN, VK_RETURN, 13 },
- { ITEM_ID_LCONTROL, DIK_LCONTROL, VK_LCONTROL, 0 },
- { ITEM_ID_A, DIK_A, 'A', 'A' },
- { ITEM_ID_S, DIK_S, 'S', 'S' },
- { ITEM_ID_D, DIK_D, 'D', 'D' },
- { ITEM_ID_F, DIK_F, 'F', 'F' },
- { ITEM_ID_G, DIK_G, 'G', 'G' },
- { ITEM_ID_H, DIK_H, 'H', 'H' },
- { ITEM_ID_J, DIK_J, 'J', 'J' },
- { ITEM_ID_K, DIK_K, 'K', 'K' },
- { ITEM_ID_L, DIK_L, 'L', 'L' },
- { ITEM_ID_COLON, DIK_SEMICOLON, VK_OEM_1, ';' },
- { ITEM_ID_QUOTE, DIK_APOSTROPHE, VK_OEM_7, '\'' },
- { ITEM_ID_TILDE, DIK_GRAVE, VK_OEM_3, '`' },
- { ITEM_ID_LSHIFT, DIK_LSHIFT, VK_LSHIFT, 0 },
- { ITEM_ID_BACKSLASH, DIK_BACKSLASH, VK_OEM_5, '\\' },
- { ITEM_ID_BACKSLASH2, DIK_OEM_102, VK_OEM_102, '<' },
- { ITEM_ID_Z, DIK_Z, 'Z', 'Z' },
- { ITEM_ID_X, DIK_X, 'X', 'X' },
- { ITEM_ID_C, DIK_C, 'C', 'C' },
- { ITEM_ID_V, DIK_V, 'V', 'V' },
- { ITEM_ID_B, DIK_B, 'B', 'B' },
- { ITEM_ID_N, DIK_N, 'N', 'N' },
- { ITEM_ID_M, DIK_M, 'M', 'M' },
- { ITEM_ID_COMMA, DIK_COMMA, VK_OEM_COMMA, ',' },
- { ITEM_ID_STOP, DIK_PERIOD, VK_OEM_PERIOD, '.' },
- { ITEM_ID_SLASH, DIK_SLASH, VK_OEM_2, '/' },
- { ITEM_ID_RSHIFT, DIK_RSHIFT, VK_RSHIFT, 0 },
- { ITEM_ID_ASTERISK, DIK_MULTIPLY, VK_MULTIPLY, '*' },
- { ITEM_ID_LALT, DIK_LMENU, VK_LMENU, 0 },
- { ITEM_ID_SPACE, DIK_SPACE, VK_SPACE, ' ' },
- { ITEM_ID_CAPSLOCK, DIK_CAPITAL, VK_CAPITAL, 0 },
- { ITEM_ID_F1, DIK_F1, VK_F1, 0 },
- { ITEM_ID_F2, DIK_F2, VK_F2, 0 },
- { ITEM_ID_F3, DIK_F3, VK_F3, 0 },
- { ITEM_ID_F4, DIK_F4, VK_F4, 0 },
- { ITEM_ID_F5, DIK_F5, VK_F5, 0 },
- { ITEM_ID_F6, DIK_F6, VK_F6, 0 },
- { ITEM_ID_F7, DIK_F7, VK_F7, 0 },
- { ITEM_ID_F8, DIK_F8, VK_F8, 0 },
- { ITEM_ID_F9, DIK_F9, VK_F9, 0 },
- { ITEM_ID_F10, DIK_F10, VK_F10, 0 },
- { ITEM_ID_NUMLOCK, DIK_NUMLOCK, VK_NUMLOCK, 0 },
- { ITEM_ID_SCRLOCK, DIK_SCROLL, VK_SCROLL, 0 },
- { ITEM_ID_7_PAD, DIK_NUMPAD7, VK_NUMPAD7, 0 },
- { ITEM_ID_8_PAD, DIK_NUMPAD8, VK_NUMPAD8, 0 },
- { ITEM_ID_9_PAD, DIK_NUMPAD9, VK_NUMPAD9, 0 },
- { ITEM_ID_MINUS_PAD, DIK_SUBTRACT, VK_SUBTRACT, 0 },
- { ITEM_ID_4_PAD, DIK_NUMPAD4, VK_NUMPAD4, 0 },
- { ITEM_ID_5_PAD, DIK_NUMPAD5, VK_NUMPAD5, 0 },
- { ITEM_ID_6_PAD, DIK_NUMPAD6, VK_NUMPAD6, 0 },
- { ITEM_ID_PLUS_PAD, DIK_ADD, VK_ADD, 0 },
- { ITEM_ID_1_PAD, DIK_NUMPAD1, VK_NUMPAD1, 0 },
- { ITEM_ID_2_PAD, DIK_NUMPAD2, VK_NUMPAD2, 0 },
- { ITEM_ID_3_PAD, DIK_NUMPAD3, VK_NUMPAD3, 0 },
- { ITEM_ID_0_PAD, DIK_NUMPAD0, VK_NUMPAD0, 0 },
- { ITEM_ID_DEL_PAD, DIK_DECIMAL, VK_DECIMAL, 0 },
- { ITEM_ID_F11, DIK_F11, VK_F11, 0 },
- { ITEM_ID_F12, DIK_F12, VK_F12, 0 },
- { ITEM_ID_F13, DIK_F13, VK_F13, 0 },
- { ITEM_ID_F14, DIK_F14, VK_F14, 0 },
- { ITEM_ID_F15, DIK_F15, VK_F15, 0 },
- { ITEM_ID_ENTER_PAD, DIK_NUMPADENTER, VK_RETURN, 0 },
- { ITEM_ID_RCONTROL, DIK_RCONTROL, VK_RCONTROL, 0 },
- { ITEM_ID_SLASH_PAD, DIK_DIVIDE, VK_DIVIDE, 0 },
- { ITEM_ID_PRTSCR, DIK_SYSRQ, 0, 0 },
- { ITEM_ID_RALT, DIK_RMENU, VK_RMENU, 0 },
- { ITEM_ID_HOME, DIK_HOME, VK_HOME, 0 },
- { ITEM_ID_UP, DIK_UP, VK_UP, 0 },
- { ITEM_ID_PGUP, DIK_PRIOR, VK_PRIOR, 0 },
- { ITEM_ID_LEFT, DIK_LEFT, VK_LEFT, 0 },
- { ITEM_ID_RIGHT, DIK_RIGHT, VK_RIGHT, 0 },
- { ITEM_ID_END, DIK_END, VK_END, 0 },
- { ITEM_ID_DOWN, DIK_DOWN, VK_DOWN, 0 },
- { ITEM_ID_PGDN, DIK_NEXT, VK_NEXT, 0 },
- { ITEM_ID_INSERT, DIK_INSERT, VK_INSERT, 0 },
- { ITEM_ID_DEL, DIK_DELETE, VK_DELETE, 0 },
- { ITEM_ID_LWIN, DIK_LWIN, VK_LWIN, 0 },
- { ITEM_ID_RWIN, DIK_RWIN, VK_RWIN, 0 },
- { ITEM_ID_MENU, DIK_APPS, VK_APPS, 0 },
- { ITEM_ID_PAUSE, DIK_PAUSE, VK_PAUSE, 0 },
- { ITEM_ID_CANCEL, 0, VK_CANCEL, 0 },
+ // MAME key dinput key virtual key ascii
+ KEY_TRANS_ENTRY(ESC, ESCAPE, VK_ESCAPE, 27),
+ KEY_TRANS_ENTRY(1, 1, '1', '1'),
+ KEY_TRANS_ENTRY(2, 2, '2', '2'),
+ KEY_TRANS_ENTRY(3, 3, '3', '3'),
+ KEY_TRANS_ENTRY(4, 4, '4', '4'),
+ KEY_TRANS_ENTRY(5, 5, '5', '5'),
+ KEY_TRANS_ENTRY(6, 6, '6', '6'),
+ KEY_TRANS_ENTRY(7, 7, '7', '7'),
+ KEY_TRANS_ENTRY(8, 8, '8', '8'),
+ KEY_TRANS_ENTRY(9, 9, '9', '9'),
+ KEY_TRANS_ENTRY(0, 0, '0', '0'),
+ KEY_TRANS_ENTRY(MINUS, MINUS, VK_OEM_MINUS, '-'),
+ KEY_TRANS_ENTRY(EQUALS, EQUALS, VK_OEM_PLUS, '='),
+ KEY_TRANS_ENTRY(BACKSPACE, BACK, VK_BACK, 8),
+ KEY_TRANS_ENTRY(TAB, TAB, VK_TAB, 9),
+ KEY_TRANS_ENTRY(Q, Q, 'Q', 'Q'),
+ KEY_TRANS_ENTRY(W, W, 'W', 'W'),
+ KEY_TRANS_ENTRY(E, E, 'E', 'E'),
+ KEY_TRANS_ENTRY(R, R, 'R', 'R'),
+ KEY_TRANS_ENTRY(T, T, 'T', 'T'),
+ KEY_TRANS_ENTRY(Y, Y, 'Y', 'Y'),
+ KEY_TRANS_ENTRY(U, U, 'U', 'U'),
+ KEY_TRANS_ENTRY(I, I, 'I', 'I'),
+ KEY_TRANS_ENTRY(O, O, 'O', 'O'),
+ KEY_TRANS_ENTRY(P, P, 'P', 'P'),
+ KEY_TRANS_ENTRY(OPENBRACE, LBRACKET, VK_OEM_4, '['),
+ KEY_TRANS_ENTRY(CLOSEBRACE, RBRACKET, VK_OEM_6, ']'),
+ KEY_TRANS_ENTRY(ENTER, RETURN, VK_RETURN, 13),
+ KEY_TRANS_ENTRY(LCONTROL, LCONTROL, VK_LCONTROL, 0),
+ KEY_TRANS_ENTRY(A, A, 'A', 'A'),
+ KEY_TRANS_ENTRY(S, S, 'S', 'S'),
+ KEY_TRANS_ENTRY(D, D, 'D', 'D'),
+ KEY_TRANS_ENTRY(F, F, 'F', 'F'),
+ KEY_TRANS_ENTRY(G, G, 'G', 'G'),
+ KEY_TRANS_ENTRY(H, H, 'H', 'H'),
+ KEY_TRANS_ENTRY(J, J, 'J', 'J'),
+ KEY_TRANS_ENTRY(K, K, 'K', 'K'),
+ KEY_TRANS_ENTRY(L, L, 'L', 'L'),
+ KEY_TRANS_ENTRY(COLON, SEMICOLON, VK_OEM_1, ';'),
+ KEY_TRANS_ENTRY(QUOTE, APOSTROPHE, VK_OEM_7, '\''),
+ KEY_TRANS_ENTRY(TILDE, GRAVE, VK_OEM_3, '`'),
+ KEY_TRANS_ENTRY(LSHIFT, LSHIFT, VK_LSHIFT, 0),
+ KEY_TRANS_ENTRY(BACKSLASH, BACKSLASH, VK_OEM_5, '\\'),
+ KEY_TRANS_ENTRY(BACKSLASH2, OEM_102, VK_OEM_102, '<'),
+ KEY_TRANS_ENTRY(Z, Z, 'Z', 'Z'),
+ KEY_TRANS_ENTRY(X, X, 'X', 'X'),
+ KEY_TRANS_ENTRY(C, C, 'C', 'C'),
+ KEY_TRANS_ENTRY(V, V, 'V', 'V'),
+ KEY_TRANS_ENTRY(B, B, 'B', 'B'),
+ KEY_TRANS_ENTRY(N, N, 'N', 'N'),
+ KEY_TRANS_ENTRY(M, M, 'M', 'M'),
+ KEY_TRANS_ENTRY(COMMA, COMMA, VK_OEM_COMMA, ','),
+ KEY_TRANS_ENTRY(STOP, PERIOD, VK_OEM_PERIOD, '.'),
+ KEY_TRANS_ENTRY(SLASH, SLASH, VK_OEM_2, '/'),
+ KEY_TRANS_ENTRY(RSHIFT, RSHIFT, VK_RSHIFT, 0),
+ KEY_TRANS_ENTRY(ASTERISK, MULTIPLY, VK_MULTIPLY, '*'),
+ KEY_TRANS_ENTRY(LALT, LMENU, VK_LMENU, 0),
+ KEY_TRANS_ENTRY(SPACE, SPACE, VK_SPACE, ' '),
+ KEY_TRANS_ENTRY(CAPSLOCK, CAPITAL, VK_CAPITAL, 0),
+ KEY_TRANS_ENTRY(F1, F1, VK_F1, 0),
+ KEY_TRANS_ENTRY(F2, F2, VK_F2, 0),
+ KEY_TRANS_ENTRY(F3, F3, VK_F3, 0),
+ KEY_TRANS_ENTRY(F4, F4, VK_F4, 0),
+ KEY_TRANS_ENTRY(F5, F5, VK_F5, 0),
+ KEY_TRANS_ENTRY(F6, F6, VK_F6, 0),
+ KEY_TRANS_ENTRY(F7, F7, VK_F7, 0),
+ KEY_TRANS_ENTRY(F8, F8, VK_F8, 0),
+ KEY_TRANS_ENTRY(F9, F9, VK_F9, 0),
+ KEY_TRANS_ENTRY(F10, F10, VK_F10, 0),
+ KEY_TRANS_ENTRY(NUMLOCK, NUMLOCK, VK_NUMLOCK, 0),
+ KEY_TRANS_ENTRY(SCRLOCK, SCROLL, VK_SCROLL, 0),
+ KEY_TRANS_ENTRY(7_PAD, NUMPAD7, VK_NUMPAD7, 0),
+ KEY_TRANS_ENTRY(8_PAD, NUMPAD8, VK_NUMPAD8, 0),
+ KEY_TRANS_ENTRY(9_PAD, NUMPAD9, VK_NUMPAD9, 0),
+ KEY_TRANS_ENTRY(MINUS_PAD, SUBTRACT, VK_SUBTRACT, 0),
+ KEY_TRANS_ENTRY(4_PAD, NUMPAD4, VK_NUMPAD4, 0),
+ KEY_TRANS_ENTRY(5_PAD, NUMPAD5, VK_NUMPAD5, 0),
+ KEY_TRANS_ENTRY(6_PAD, NUMPAD6, VK_NUMPAD6, 0),
+ KEY_TRANS_ENTRY(PLUS_PAD, ADD, VK_ADD, 0),
+ KEY_TRANS_ENTRY(1_PAD, NUMPAD1, VK_NUMPAD1, 0),
+ KEY_TRANS_ENTRY(2_PAD, NUMPAD2, VK_NUMPAD2, 0),
+ KEY_TRANS_ENTRY(3_PAD, NUMPAD3, VK_NUMPAD3, 0),
+ KEY_TRANS_ENTRY(0_PAD, NUMPAD0, VK_NUMPAD0, 0),
+ KEY_TRANS_ENTRY(DEL_PAD, DECIMAL, VK_DECIMAL, 0),
+ KEY_TRANS_ENTRY(F11, F11, VK_F11, 0),
+ KEY_TRANS_ENTRY(F12, F12, VK_F12, 0),
+ KEY_TRANS_ENTRY(F13, F13, VK_F13, 0),
+ KEY_TRANS_ENTRY(F14, F14, VK_F14, 0),
+ KEY_TRANS_ENTRY(F15, F15, VK_F15, 0),
+ KEY_TRANS_ENTRY(ENTER_PAD, NUMPADENTER, VK_RETURN, 0),
+ KEY_TRANS_ENTRY(RCONTROL, RCONTROL, VK_RCONTROL, 0),
+ KEY_TRANS_ENTRY(SLASH_PAD, DIVIDE, VK_DIVIDE, 0),
+ KEY_TRANS_ENTRY(PRTSCR, SYSRQ, 0, 0),
+ KEY_TRANS_ENTRY(RALT, RMENU, VK_RMENU, 0),
+ KEY_TRANS_ENTRY(HOME, HOME, VK_HOME, 0),
+ KEY_TRANS_ENTRY(UP, UP, VK_UP, 0),
+ KEY_TRANS_ENTRY(PGUP, PRIOR, VK_PRIOR, 0),
+ KEY_TRANS_ENTRY(LEFT, LEFT, VK_LEFT, 0),
+ KEY_TRANS_ENTRY(RIGHT, RIGHT, VK_RIGHT, 0),
+ KEY_TRANS_ENTRY(END, END, VK_END, 0),
+ KEY_TRANS_ENTRY(DOWN, DOWN, VK_DOWN, 0),
+ KEY_TRANS_ENTRY(PGDN, NEXT, VK_NEXT, 0),
+ KEY_TRANS_ENTRY(INSERT, INSERT, VK_INSERT, 0),
+ KEY_TRANS_ENTRY(DEL, DELETE, VK_DELETE, 0),
+ KEY_TRANS_ENTRY(LWIN, LWIN, VK_LWIN, 0),
+ KEY_TRANS_ENTRY(RWIN, RWIN, VK_RWIN, 0),
+ KEY_TRANS_ENTRY(MENU, APPS, VK_APPS, 0),
+ KEY_TRANS_ENTRY(PAUSE, PAUSE, VK_PAUSE, 0),
+ { ITEM_ID_CANCEL, 0, VK_CANCEL, 0, "ITEM_ID_CANCEL" },
// New keys introduced in Windows 2000. These have no MAME codes to
// preserve compatibility with old config files that may refer to them
@@ -391,18 +394,18 @@ static const int win_key_trans_table[][4] =
// paused). Some codes are missing because the mapping to vkey codes
// isn't clear, and MapVirtualKey is no help.
- { ITEM_ID_OTHER_SWITCH, DIK_MUTE, VK_VOLUME_MUTE, 0 },
- { ITEM_ID_OTHER_SWITCH, DIK_VOLUMEDOWN, VK_VOLUME_DOWN, 0 },
- { ITEM_ID_OTHER_SWITCH, DIK_VOLUMEUP, VK_VOLUME_UP, 0 },
- { ITEM_ID_OTHER_SWITCH, DIK_WEBHOME, VK_BROWSER_HOME, 0 },
- { ITEM_ID_OTHER_SWITCH, DIK_WEBSEARCH, VK_BROWSER_SEARCH, 0 },
- { ITEM_ID_OTHER_SWITCH, DIK_WEBFAVORITES, VK_BROWSER_FAVORITES, 0 },
- { ITEM_ID_OTHER_SWITCH, DIK_WEBREFRESH, VK_BROWSER_REFRESH, 0 },
- { ITEM_ID_OTHER_SWITCH, DIK_WEBSTOP, VK_BROWSER_STOP, 0 },
- { ITEM_ID_OTHER_SWITCH, DIK_WEBFORWARD, VK_BROWSER_FORWARD, 0 },
- { ITEM_ID_OTHER_SWITCH, DIK_WEBBACK, VK_BROWSER_BACK, 0 },
- { ITEM_ID_OTHER_SWITCH, DIK_MAIL, VK_LAUNCH_MAIL, 0 },
- { ITEM_ID_OTHER_SWITCH, DIK_MEDIASELECT, VK_LAUNCH_MEDIA_SELECT, 0 },
+ KEY_TRANS_ENTRY(OTHER_SWITCH, MUTE, VK_VOLUME_MUTE, 0),
+ KEY_TRANS_ENTRY(OTHER_SWITCH, VOLUMEDOWN, VK_VOLUME_DOWN, 0),
+ KEY_TRANS_ENTRY(OTHER_SWITCH, VOLUMEUP, VK_VOLUME_UP, 0),
+ KEY_TRANS_ENTRY(OTHER_SWITCH, WEBHOME, VK_BROWSER_HOME, 0),
+ KEY_TRANS_ENTRY(OTHER_SWITCH, WEBSEARCH, VK_BROWSER_SEARCH, 0),
+ KEY_TRANS_ENTRY(OTHER_SWITCH, WEBFAVORITES, VK_BROWSER_FAVORITES, 0),
+ KEY_TRANS_ENTRY(OTHER_SWITCH, WEBREFRESH, VK_BROWSER_REFRESH, 0),
+ KEY_TRANS_ENTRY(OTHER_SWITCH, WEBSTOP, VK_BROWSER_STOP, 0),
+ KEY_TRANS_ENTRY(OTHER_SWITCH, WEBFORWARD, VK_BROWSER_FORWARD, 0),
+ KEY_TRANS_ENTRY(OTHER_SWITCH, WEBBACK, VK_BROWSER_BACK, 0),
+ KEY_TRANS_ENTRY(OTHER_SWITCH, MAIL, VK_LAUNCH_MAIL, 0),
+ KEY_TRANS_ENTRY(OTHER_SWITCH, MEDIASELECT, VK_LAUNCH_MEDIA_SELECT, 0),
};
@@ -424,8 +427,8 @@ INLINE input_item_id keyboard_map_scancode_to_itemid(int scancode)
// scan the table for a match
for (tablenum = 0; tablenum < ARRAY_LENGTH(win_key_trans_table); tablenum++)
- if (win_key_trans_table[tablenum][DI_KEY] == scancode)
- return (input_item_id)win_key_trans_table[tablenum][MAME_KEY];
+ if (win_key_trans_table[tablenum].di_key == scancode)
+ return (input_item_id)win_key_trans_table[tablenum].mame_key;
// default to an "other" switch
return ITEM_ID_OTHER_SWITCH;
@@ -706,20 +709,45 @@ int wininput_vkey_for_mame_code(input_code code)
// scan the table for a match
for (tablenum = 0; tablenum < ARRAY_LENGTH(win_key_trans_table); tablenum++)
- if (win_key_trans_table[tablenum][MAME_KEY] == id)
- return win_key_trans_table[tablenum][VIRTUAL_KEY];
+ if (win_key_trans_table[tablenum].mame_key == id)
+ return win_key_trans_table[tablenum].virtual_key;
}
return 0;
}
//============================================================
+// lookup_mame_code
+//============================================================
+
+static int lookup_mame_index(const char *scode)
+{
+ for (int i = 0; i < ARRAY_LENGTH(win_key_trans_table); i++)
+ {
+ if (!strcmp(scode, win_key_trans_table[i].mame_key_name))
+ return i;
+ }
+ return -1;
+}
+
+static input_item_id lookup_mame_code(const char *scode)
+{
+ int const index = lookup_mame_index(scode);
+ if (index >= 0)
+ return win_key_trans_table[index].mame_key;
+ else
+ return ITEM_ID_INVALID;
+}
+
+
+//============================================================
// customize_input_type_list
//============================================================
void windows_osd_interface::customize_input_type_list(simple_list<input_type_entry> &typelist)
{
input_type_entry *entry;
+ const char* uimode;
// loop over the defaults
for (entry = typelist.first(); entry != NULL; entry = entry->next())
@@ -731,6 +759,22 @@ void windows_osd_interface::customize_input_type_list(simple_list<input_type_ent
entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_TAB, input_seq::not_code, KEYCODE_LALT, input_seq::not_code, KEYCODE_RALT);
break;
+ // configurable UI mode switch
+ case IPT_UI_TOGGLE_UI:
+ uimode = options().ui_mode_key();
+ if (strcmp(uimode,"auto"))
+ {
+ std::string fullmode = "ITEM_ID_";
+ fullmode += uimode;
+ input_item_id const mameid_code = lookup_mame_code(fullmode.c_str());
+ if (ITEM_ID_INVALID != mameid_code)
+ {
+ input_code const ui_code = input_code(DEVICE_CLASS_KEYBOARD, 0, ITEM_CLASS_SWITCH, ITEM_MODIFIER_NONE, input_item_id(mameid_code));
+ entry->defseq(SEQ_TYPE_STANDARD).set(ui_code);
+ }
+ }
+ break;
+
// alt-enter for fullscreen
case IPT_OSD_1:
entry->configure_osd("TOGGLE_FULLSCREEN", "Toggle Fullscreen");
@@ -1010,10 +1054,10 @@ static void win32_keyboard_poll(device_info *devinfo)
// iterate over keys
for (keynum = 0; keynum < ARRAY_LENGTH(win_key_trans_table); keynum++)
{
- int vk = win_key_trans_table[keynum][VIRTUAL_KEY];
+ int vk = win_key_trans_table[keynum].virtual_key;
if (vk != 0 && (GetAsyncKeyState(vk) & 0x8000) != 0)
{
- int dik = win_key_trans_table[keynum][DI_KEY];
+ int dik = win_key_trans_table[keynum].di_key;
// conver the VK code to a scancode (DIK code)
if (dik != 0)
diff --git a/src/osd/windows/video.c b/src/osd/windows/video.c
index d135d7a2bc9..23854c18554 100644
--- a/src/osd/windows/video.c
+++ b/src/osd/windows/video.c
@@ -382,8 +382,10 @@ void windows_osd_interface::extract_video_config()
video_config.mode = VIDEO_MODE_DDRAW;
else if (strcmp(stemp, "gdi") == 0)
video_config.mode = VIDEO_MODE_GDI;
+#if defined (USE_BGFX)
else if (strcmp(stemp, "bgfx") == 0)
video_config.mode = VIDEO_MODE_BGFX;
+#endif
else if (strcmp(stemp, "none") == 0)
{
video_config.mode = VIDEO_MODE_NONE;
@@ -508,6 +510,12 @@ static void get_resolution(const char *defdata, const char *data, osd_window_con
return;
data = defdata;
}
- if (sscanf(data, "%dx%d@%d", &config->width, &config->height, &config->refresh) < 2 && report_error)
+
+ if (sscanf(data, "%dx%dx%d", &config->width, &config->height, &config->depth) < 2 && report_error)
osd_printf_error("Illegal resolution value = %s\n", data);
+
+ const char * at_pos = strchr(data, '@');
+ if (at_pos)
+ if (sscanf(at_pos + 1, "%d", &config->refresh) < 1 && report_error)
+ osd_printf_error("Illegal refresh rate in resolution value = %s\n", data);
}
diff --git a/src/osd/windows/video.h b/src/osd/windows/video.h
index 23ff05a7371..875aebe81b5 100644
--- a/src/osd/windows/video.h
+++ b/src/osd/windows/video.h
@@ -22,11 +22,13 @@ enum {
VIDEO_MODE_NONE,
VIDEO_MODE_GDI,
VIDEO_MODE_DDRAW,
- VIDEO_MODE_D3D,
+#if defined (USE_BGFX)
VIDEO_MODE_BGFX,
+#endif
#if (USE_OPENGL)
VIDEO_MODE_OPENGL,
#endif
+ VIDEO_MODE_D3D
};
#define GLSL_SHADER_MAX 10
diff --git a/src/osd/windows/winfile.c b/src/osd/windows/winfile.c
index 795840231b1..3663a4a7c3e 100644
--- a/src/osd/windows/winfile.c
+++ b/src/osd/windows/winfile.c
@@ -242,6 +242,9 @@ file_error osd_write(osd_file *file, const void *buffer, UINT64 offset, UINT32 l
file_error osd_truncate(osd_file *file, UINT64 offset)
{
+ if (!file || !file->handle)
+ return FILERR_FAILURE;
+
DWORD result;
LONG upper = offset >> 32;
diff --git a/src/tools/nltool.c b/src/tools/nltool.c
index cd0cc5e62ad..9d346746fad 100644
--- a/src/tools/nltool.c
+++ b/src/tools/nltool.c
@@ -166,12 +166,12 @@ pstring filetobuf(pstring fname)
}
}
-class netlist_tool_t : public netlist_base_t
+class netlist_tool_t : public netlist::netlist_t
{
public:
netlist_tool_t()
- : netlist_base_t(), m_logs(""), m_verbose(false), m_setup(NULL)
+ : netlist::netlist_t(), m_logs(""), m_verbose(false), m_setup(NULL)
{
}
@@ -183,7 +183,7 @@ public:
void init()
{
- m_setup = palloc(netlist_setup_t, *this);
+ m_setup = palloc(netlist::setup_t(this));
this->init_object(*this, "netlist");
m_setup->init();
}
@@ -192,11 +192,8 @@ public:
{
// read the netlist ...
- netlist_sources_t sources;
-
- sources.add(netlist_source_t(buffer));
- sources.parse(*m_setup, name);
- //m_setup->parse(buffer);
+ m_setup->register_source(palloc(netlist::netlist_source_mem_t(buffer)));
+ m_setup->include(name);
log_setup();
// start devices
@@ -213,7 +210,7 @@ public:
for (int i=0; i < ll.size(); i++)
{
pstring name = "log_" + ll[i];
- /*netlist_device_t *nc = */ m_setup->register_dev("nld_log", name);
+ /*netlist_device_t *nc = */ m_setup->register_dev("LOG", name);
m_setup->register_link(name + ".I", ll[i]);
}
}
@@ -247,7 +244,7 @@ protected:
}
private:
- netlist_setup_t *m_setup;
+ netlist::setup_t *m_setup;
};
@@ -278,7 +275,7 @@ static void run(tool_options_t &opts)
printf("runnning ...\n");
t = osd_ticks();
- nt.process_queue(netlist_time::from_double(ttr));
+ nt.process_queue(netlist::netlist_time::from_double(ttr));
nt.stop();
double emutime = (double) (osd_ticks() - t) / (double) osd_ticks_per_second();
@@ -293,12 +290,10 @@ static void listdevices()
{
netlist_tool_t nt;
nt.init();
- const netlist_factory_list_t::list_t &list = nt.setup().factory().list();
-
- netlist_sources_t sources;
+ const netlist::factory_list_t::list_t &list = nt.setup().factory().list();
- sources.add(netlist_source_t("dummy", &netlist_dummy));
- sources.parse(nt.setup(),"dummy");
+ nt.setup().register_source(palloc(netlist::source_proc_t("dummy", &netlist_dummy)));
+ nt.setup().include("dummy");
nt.setup().start_devices();
nt.setup().resolve_inputs();
@@ -309,8 +304,8 @@ static void listdevices()
list[i]->name().cstr() );
pstring terms("");
- netlist_base_factory_t *f = list[i];
- netlist_device_t *d = f->Create();
+ netlist::base_factory_t *f = list[i];
+ netlist::device_t *d = f->Create();
d->init(nt, pstring::sprintf("dummy%d", i));
d->start_dev();
@@ -349,16 +344,29 @@ static void listdevices()
main - primary entry point
-------------------------------------------------*/
+#if (!PSTANDALONE)
#include "corealloc.h"
+#endif
+
+static const char *pmf_verbose[] =
+{
+ "NL_PMF_TYPE_VIRTUAL",
+ "NL_PMF_TYPE_GNUC_PMF",
+ "NL_PMF_TYPE_GNUC_PMF_CONV",
+ "NL_PMF_TYPE_INTERNAL"
+};
int main(int argc, char *argv[])
{
+#if (!PSTANDALONE)
track_memory(true);
{
+#endif
tool_options_t opts;
int ret;
fprintf(stderr, "%s", "WARNING: This is Work In Progress! - It may fail anytime\n");
+ fprintf(stderr, "Update dispatching using method %s\n", pmf_verbose[NL_PMF_TYPE]);
if ((ret = opts.parse(argc, argv)) != argc)
{
fprintf(stderr, "Error parsing %s\n", argv[ret]);
@@ -396,7 +404,9 @@ int main(int argc, char *argv[])
usage(opts);
return 1;
}
+#if (!PSTANDALONE)
}
dump_unfreed_mem();
+#endif
return 0;
}
diff --git a/src/tools/unidasm.c b/src/tools/unidasm.c
index 55d27130631..dfd185b1cb3 100644
--- a/src/tools/unidasm.c
+++ b/src/tools/unidasm.c
@@ -158,6 +158,7 @@ CPU_DISASSEMBLE( sh2 );
CPU_DISASSEMBLE( sh4 );
CPU_DISASSEMBLE( sh4be );
CPU_DISASSEMBLE( sharc );
+CPU_DISASSEMBLE( sm510 );
CPU_DISASSEMBLE( sm8500 );
CPU_DISASSEMBLE( spc700 );
CPU_DISASSEMBLE( ssem );
@@ -309,6 +310,7 @@ static const dasm_table_entry dasm_table[] =
{ "sh4", _16le, 0, CPU_DISASSEMBLE_NAME(sh4) },
{ "sh4be", _16be, 0, CPU_DISASSEMBLE_NAME(sh4be) },
{ "sharc", _48le, -2, CPU_DISASSEMBLE_NAME(sharc) },
+ { "sm510", _8bit, 0, CPU_DISASSEMBLE_NAME(sm510) },
{ "sm8500", _8bit, 0, CPU_DISASSEMBLE_NAME(sm8500) },
{ "spc700", _8bit, 0, CPU_DISASSEMBLE_NAME(spc700) },
{ "ssem", _32le, 0, CPU_DISASSEMBLE_NAME(ssem) },
diff --git a/src/version.c b/src/version.c
index ac911975594..5343ee091de 100644
--- a/src/version.c
+++ b/src/version.c
@@ -8,7 +8,7 @@
***************************************************************************/
-#define BARE_BUILD_VERSION "0.162"
+#define BARE_BUILD_VERSION "0.163"
extern const char bare_build_version[];
extern const char build_version[];