| Previous | 199869 Revisions | Next |
| r34681 Thursday 22nd January, 2015 at 22:45:53 UTC by Angelo Salese |
|---|
| New personal branch, for WIP rewrites and other goodies. |
| [/trunk] | makefile |
| [hash] | gamegear.xml lantutor.xml pasogo.xml |
| [src] | version.c |
| [src/build] | file2str.py flags_clang.mak png.py png2bdc.py |
| [src/emu] | clifront.c cliopts.c devfind.c devfind.h device.c device.h distate.c distate.h emu.h emu.mak emucore.c emuopts.c emuopts.h image.c image.h luaengine.c luaengine.h machine.c machine.h mame.c memory.c |
| [src/emu/bus] | bus.mak |
| [src/emu/bus/a8sio] | a8sio.c cassette.c |
| [src/emu/bus/gamegear] | gear2gear.c* gear2gear.h* |
| [src/emu/bus/nes_ctrl] | |
| [src/emu/bus/sms_ctrl] | graphic.c joypad.c lphaser.c multitap.c paddle.c rfu.c sports.c sportsjp.c |
| [src/emu/bus/vcs] | dpc.c |
| [src/emu/bus/vcs_ctrl] | joybooster.c joystick.c keypad.c lightpen.c paddles.c wheel.c |
| [src/emu/cpu/arcompact] | arcompact.c arcompact.h arcompact_execute.c arcompact_make.py |
| [src/emu/cpu/h8] | h8make.py |
| [src/emu/cpu/i386] | i386dasm.c i386op16.inc pentops.inc |
| [src/emu/cpu/m68000] | m68k_in.c m68kcpu.c m68kcpu.h m68kfpu.inc |
| [src/emu/cpu/m6809] | m6809make.py |
| [src/emu/cpu/mcs96] | mcs96make.py |
| [src/emu/cpu/mips] | mips3drc.c |
| [src/emu/cpu/powerpc] | ppccom.c ppcdrc.c |
| [src/emu/cpu/rsp] | rspdrc.c |
| [src/emu/cpu/sh2] | sh2drc.c |
| [src/emu/cpu/tms0980] | tms0980.c tms0980.h |
| [src/emu/cpu/tms57002] | tmsmake.py |
| [src/emu/machine] | 6522via.c bcreader.c bcreader.h intelfsh.c intelfsh.h jvshost.c netlist.c |
| [src/emu/netlist] | netlist.mak nl_base.c nl_base.h nl_config.h nl_dice_compat.h |
| [src/emu/netlist/analog] | nld_bjt.c nld_bjt.h nld_fourterm.c nld_fourterm.h nld_ms_direct.h nld_ms_direct1.h nld_ms_direct2.h nld_ms_gauss_seidel.h nld_opamps.c nld_solver.c nld_solver.h nld_twoterm.c nld_twoterm.h |
| [src/emu/netlist/devices] | net_lib.c net_lib.h nld_4020.c nld_4066.c nld_74123.c nld_74ls629.c nld_cmos.h nld_ne555.c nld_ne555.h nld_r2r_dac.c nld_system.c nld_system.h |
| [src/emu/sound] | qs1000.c rf5c400.c rf5c400.h tiasound.c |
| [src/emu/ui] | barcode.c |
| [src/emu/video] | 315_5124.c h63484.c h63484.h |
| [src/lib/util] | astring.h coretmpl.h palette.h |
| [src/mame] | mame.lst mame.mak |
| [src/mame/audio] | mario.c |
| [src/mame/drivers] | 20pacgal.c actfancr.c aerofgt.c aleck64.c aliens.c alpha68k.c bogeyman.c btime.c calomega.c circus.c cps1.c crospang.c ddenlovr.c dec0.c dec8.c deniam.c dgpix.c dkong.c dynax.c eolith.c eolith16.c eolithsp.c exidy.c exidyttl.c funkball.c fuukifg2.c fuukifg3.c galaxian.c galspnbl.c gticlub.c gts80a.c gumbo.c hcastle.c hikaru.c itech32.c itech8.c lordgun.c m58.c mappy.c metro.c midtunit.c model2.c model3.c namcos21.c naomi.c nemesis.c nl_pongd.c nmg5.c oneshot.c onetwo.c overdriv.c pacman.c paradise.c peplus.c prehisle.c psikyo.c psikyo4.c psikyosh.c psychic5.c punchout.c segae.c segajw.c seta2.c silvmil.c snk68.c snowbros.c spbactn.c spdodgeb.c spy.c st_mp200.c stadhero.c stv.c suna8.c taitottl.c tbowl.c tecmo.c toaplan1.c toaplan2.c tourtabl.c twincobr.c twinkle.c tx1.c vegaeo.c vicdual.c wardner.c yunsun16.c zn.c |
| [src/mame/includes] | actfancr.h aerofgt.h alpha68k.h bogeyman.h calomega.h crospang.h dec0.h dec8.h deniam.h dynax.h eolith.h exidy.h fuukifg2.h fuukifg3.h galspnbl.h hcastle.h hyhoo.h itech8.h lordgun.h m58.h mario.h metro.h midtunit.h model2.h model3.h namcos21.h naomi.h nb1413m3.h nemesis.h oneshot.h pacman.h paradise.h pastelg.h prehisle.h psikyo.h psikyo4.h psikyosh.h senjyo.h snk68.h snowbros.h spbactn.h spdodgeb.h spy.h stadhero.h stfight.h stlforce.h strnskil.h stv.h suna8.h tbowl.h tecmo.h toaplan1.h toaplan2.h twincobr.h tx1.h vaportra.h xyonix.h yunsun16.h |
| [src/mame/layout] | gts80a_caveman.lay |
| [src/mame/machine] | |
| [src/mame/video] | actfancr.c bogeyman.c cps1.c eolith.c gp9001.c m58.c paradise.c pastelg.c pc080sn.c taitoair.c tc0080vco.c tc0480scp.c tia.c tia.h tx1.c wgp.c |
| [src/mess] | mess.lst mess.mak |
| [src/mess/drivers] | a2600.c amaztron.c applix.c apricotp.c |
| [src/mess/includes] | apricotp.h |
| [src/mess/layout] | splitsec.lay |
| [src/mess/machine] | amstrad.c macadb.c nes.c sms.c |
| [src/osd] | osdcore.c osdcore.h osdepend.h |
| [src/osd/modules] | |
| [src/osd/modules/debugger] | |
| [src/osd/modules/font] | |
| [src/osd/modules/lib] | osdlib.h osdlib_macosx.c osdlib_os2.c osdlib_unix.c osdlib_win32.c osdobj_common.c osdobj_common.h |
| [src/osd/modules/midi] | none.c portmidi.c |
| [src/osd/modules/sound] | direct_sound.c direct_sound.h* js_sound.c js_sound.h* none.c none.h* sdl_sound.c sdl_sound.h* |
| [src/osd/modules/sync] | sync_mini.c sync_ntc.c sync_os2.c sync_sdl.c sync_tc.c sync_windows.c work_osd.c |
| [src/osd/osdmini] | minimisc.c |
| [src/osd/sdl] | blit13.h draw13.c drawogl.c input.c main.c netdev_pcap.c netdev_pcap_osx.c osdsdl.h sdl.mak sdldir.c sdlfile.c sdlmain.c sdlmisc_os2.c* sdlmisc_unix.c* sdlmisc_win32.c* sdlos_macosx.c sdlos_os2.c sdlos_unix.c sdlos_win32.c sdlprefix.h sdlptty_unix.c strconv.c strconv.h video.c window.c window.h |
| [src/osd/sdl/man] | castool.1 chdman.1 floptool.1 imgtool.1 jedutil.1 ldresample.1 ldverify.1 mame.6 mess.6 romcmp.1 testkeys.1 |
| [src/osd/windows] | main.c netdev_pcap.h strconv.c strconv.h vconv.c windows.mak winfile.c winmain.c winmain.h winmisc.c* |
| [src/tools] | chdman.c nltool.c |
| r243192 | r243193 | |
|---|---|---|
| 650 | 650 | |
| 651 | 651 | <software name="barbie"> |
| 652 | 652 | <description>Barbie Super Model (Prototype)</description> |
| 653 | <year>1993</year> | |
| 654 | <publisher>Hi Tech Expressions</publisher> | |
| 653 | <year>199?</year> | |
| 654 | <publisher><unknown></publisher> | |
| 655 | 655 | <part name="cart" interface="gamegear_cart"> |
| 656 | 656 | <dataarea name="rom" size="262144"> |
| 657 | 657 | <rom name="barbie super model (unknown) (proto).bin" size="262144" crc="03a0ce9e" sha1="4fabaf794081074ac1a76eb0efc4262efb627610" offset="000000" /> |
| r243192 | r243193 | |
| 1296 | 1296 | |
| 1297 | 1297 | <software name="carlicen"> |
| 1298 | 1298 | <description>Car Licence (Jpn)</description> |
| 1299 | <year>1995</year> | |
| 1300 | <publisher>Mitsubishi Chemical</publisher> | |
| 1299 | <year>199?</year> | |
| 1300 | <publisher><unknown></publisher> | |
| 1301 | 1301 | <part name="cart" interface="gamegear_cart"> |
| 1302 | 1302 | <dataarea name="rom" size="524288"> |
| 1303 | 1303 | <rom name="car licence (japan).bin" size="524288" crc="f6a697f8" sha1="0cf691dba7080a1f8d4a181563948b188115ec89" offset="000000" /> |
| r243192 | r243193 | |
| 2358 | 2358 | </part> |
| 2359 | 2359 | </software> |
| 2360 | 2360 | |
| 2361 | <software name="ecco"> | |
| 2361 | <software name="ecco" supported="no"> | |
| 2362 | 2362 | <description>Ecco the Dolphin (Euro, USA)</description> |
| 2363 | 2363 | <year>1994</year> |
| 2364 | 2364 | <publisher>Sega</publisher> |
| r243192 | r243193 | |
| 2705 | 2705 | |
| 2706 | 2706 | <software name="frogger"> |
| 2707 | 2707 | <description>Frogger (USA, Prototype)</description> |
| 2708 | <year>1991</year> | |
| 2709 | <publisher>Sega</publisher> | |
| 2708 | <year>199?</year> | |
| 2709 | <publisher><unknown></publisher> | |
| 2710 | 2710 | <part name="cart" interface="gamegear_cart"> |
| 2711 | 2711 | <dataarea name="rom" size="131072"> |
| 2712 | 2712 | <rom name="frogger (usa) (proto).bin" size="131072" crc="02bbf994" sha1="b917ac6fbd3e5d18c07246f1309d81943ee1dd47" offset="000000" /> |
| r243192 | r243193 | |
| 3449 | 3449 | <software name="jangpun2"> |
| 3450 | 3450 | <description>Jang Pung II (Kor, SMS Mode)</description> |
| 3451 | 3451 | <year>1993</year> |
| 3452 | <publisher> | |
| 3452 | <publisher><unknown></publisher> | |
| 3453 | 3453 | <part name="cart" interface="gamegear_cart"> |
| 3454 | 3454 | <feature name="slot" value="codemasters" /> |
| 3455 | 3455 | <feature name="pin_42" value="sms_mode" /> |
| r243192 | r243193 | |
| 4671 | 4671 | |
| 4672 | 4672 | <software name="mspacman"> |
| 4673 | 4673 | <description>Ms. Pac-Man (USA)</description> |
| 4674 | <year>1993</year> <!-- re-released in 2000 my Majesco --> | |
| 4675 | <publisher>Namco</publisher> | |
| 4674 | <year>199?</year> | |
| 4675 | <publisher><unknown></publisher> | |
| 4676 | 4676 | <info name="serial" value="T-14048"/> |
| 4677 | 4677 | <part name="cart" interface="gamegear_cart"> |
| 4678 | 4678 | <dataarea name="rom" size="131072"> |
| r243192 | r243193 | |
| 5777 | 5777 | |
| 5778 | 5778 | <software name="pacintim"> |
| 5779 | 5779 | <description>Pac-In-Time (Prototype)</description> |
| 5780 | <year>1994</year> | |
| 5781 | <publisher>Namco</publisher> | |
| 5780 | <year>199?</year> | |
| 5781 | <publisher><unknown></publisher> | |
| 5782 | 5782 | <part name="cart" interface="gamegear_cart"> |
| 5783 | 5783 | <dataarea name="rom" size="262144"> |
| 5784 | 5784 | <rom name="pac-in-time (unknown) (proto).bin" size="262144" crc="64c28e20" sha1="bc956615da23f13bddc491377b29631f9c0a4d5a" offset="000000" /> |
| r243192 | r243193 | |
| 7722 | 7722 | |
| 7723 | 7723 | <software name="spirou"> |
| 7724 | 7724 | <description>Spirou (Euro, Prototype)</description> |
| 7725 | <year>1996</year> | |
| 7726 | <publisher>Infogrames</publisher> | |
| 7725 | <year>199?</year> | |
| 7726 | <publisher><unknown></publisher> | |
| 7727 | 7727 | <part name="cart" interface="gamegear_cart"> |
| 7728 | 7728 | <dataarea name="rom" size="524288"> |
| 7729 | 7729 | <rom name="spirou (europe) (proto).bin" size="524288" crc="ab622adc" sha1="40359adbe9950b8e5e46158f519ad782757f0884" offset="000000" /> |
| r243192 | r243193 | |
| 9855 | 9855 | |
| 9856 | 9856 | <software name="yogibear"> |
| 9857 | 9857 | <description>Yogi Bear in Yogi Bear's Goldrush (Prototype)</description> |
| 9858 | <year>1994</year> | |
| 9859 | <publisher>GameTek</publisher> | |
| 9858 | <year>199?</year> | |
| 9859 | <publisher><unknown></publisher> | |
| 9860 | 9860 | <part name="cart" interface="gamegear_cart"> |
| 9861 | 9861 | <dataarea name="rom" size="262144"> |
| 9862 | 9862 | <rom name="yogi bear in yogi bear's goldrush (unknown) (proto).bin" size="262144" crc="e678f264" sha1="ea5f9ce4b3618565ea24a858f7efe3988b82eb8a" offset="000000" /> |
| r243192 | r243193 | |
| 9972 | 9972 | |
| 9973 | 9973 | <software name="mgear"> |
| 9974 | 9974 | <description>Master Gear Adapter</description> |
| 9975 | <year>1991</year> | |
| 9976 | <publisher>Sega</publisher> | |
| 9975 | <year>198?</year> | |
| 9976 | <publisher><unknown></publisher> | |
| 9977 | 9977 | <part name="cart" interface="gamegear_cart"> |
| 9978 | 9978 | <feature name="slot" value="mgear" /> |
| 9979 | 9979 | <feature name="pin_42" value="sms_mode" /> |
| r243192 | r243193 | |
|---|---|---|
| 38 | 38 | <publisher>Texas Instruments</publisher> |
| 39 | 39 | <part name="cart" interface="lantutor"> |
| 40 | 40 | <dataarea name="rom" size="0x10000"> |
| 41 | <!-- <rom name="cd2315.vsm" size="0x4000" crc="" sha1="" offset="0x0000" /> --> | |
| 42 | <!-- <rom name="cd2316.vsm" size="0x4000" crc="" sha1="" offset="0x4000" /> --> | |
| 41 | <!-- <rom name="cd2315.vsm" size="0x4000" crc="" sha1="" offset="0x0000" /> --> | |
| 42 | <!-- <rom name="cd2316.vsm" size="0x4000" crc="" sha1="" offset="0x4000" /> --> | |
| 43 | 43 | <rom name="cd2317.vsm" size="0x4000" crc="53231c0b" sha1="472117c3d0e28437fa8faa054f98088e06efc2a1" offset="0x8000" /> |
| 44 | 44 | <rom name="cd2318.vsm" size="0x4000" crc="6c0727bc" sha1="132e39755b122f2cbec6f3e767f5d256a9c1e7ae" offset="0xc000" /> |
| 45 | 45 | </dataarea> |
| r243192 | r243193 | |
|---|---|---|
| 1 | 1 | <?xml version="1.0"?> |
| 2 | 2 | <!DOCTYPE softwarelist SYSTEM "softwarelist.dtd"> |
| 3 | 3 | <softwarelist name="pasogo" description="Koei PasoGo cartridges"> |
| 4 | ||
| 5 | <!-- | |
| 6 | Koei PasoGo (パソ碁) undumped games | |
| 7 | ||
| 8 | Taikyoku-kun I ~ 対局くん I [KS-1001] | |
| 9 | Tanoshii Tsumego Dai-1-kan ~ 楽しい詰碁・第1巻 [KS-1002] | |
| 10 | Tanoshii Tsumego Dai-2-kan ~ 楽しい詰碁・第2巻 [KS-1003] | |
| 11 | ||
| 12 | --> | |
| 13 | ||
| 14 | <!-- Contians 8M SOP44 ROM, 62256 SOP32 RAM, Microchip 1081N (reset IC?watchdog?battery-power-switcher?) and 3V battery. --> | |
| 4 | <!-- KS-1010. Contians 8M SOP44 ROM, 62256 SOP32 RAM, Microchip 1081N (reset IC?watchdog?battery-power-switcher?) and 3V battery. --> | |
| 15 | 5 | <software name="dgoban"> |
| 16 | 6 | <description>Denshi Goban</description> |
| 17 | 7 | <year>1996</year> |
| 18 | 8 | <publisher>Koei</publisher> |
| 19 | <info name="serial" value="KS-1009"/> | |
| 20 | <info name="alt_title" value="電子碁盤"/> | |
| 21 | 9 | <part name="cart" interface="pasogo_cart"> |
| 22 | 10 | <dataarea name="rom" width="16" endianness="little" size="1048576"> |
| 23 | 11 | <rom name="ks-1010.ic4" size="1048576" crc="b6a3f97c" sha1="2de63b05ec93a4ba3ea55ba131c0706927a5bf39" offset="00000000" /> |
| r243192 | r243193 | |
| 25 | 13 | </part> |
| 26 | 14 | </software> |
| 27 | 15 | |
| 28 | ||
| 29 | <!-- Contains 4M SOP40 ROM only. --> | |
| 16 | <!-- KS-1004. Contains 4M SOP40 ROM only. --> | |
| 30 | 17 | <software name="igmks1"> |
| 31 | <description>Igo Meikyokushuu - Dai | |
| 18 | <description>Igo Meikyokushuu - Dai Ikkan</description> | |
| 32 | 19 | <year>1996</year> |
| 33 | 20 | <publisher>Koei</publisher> |
| 34 | <info name="serial" value="KS-1004"/> | |
| 35 | <info name="alt_title" value="囲碁名局集 第1巻"/> | |
| 36 | 21 | <part name="cart" interface="pasogo_cart"> |
| 37 | 22 | <dataarea name="rom" width="16" endianness="little" size="524288"> |
| 38 | 23 | <rom name="yrm0442m-184s" size="524288" crc="32f9c38a" sha1="1be82afcdf5e2d1a0e873fda4161e663d7a53a85" offset="00000000" /> |
| r243192 | r243193 | |
| 40 | 25 | </part> |
| 41 | 26 | </software> |
| 42 | 27 | |
| 43 | <!-- Contains 4M SOP40 ROM only. --> | |
| 28 | <!-- KS-1009. Contains 4M SOP40 ROM only. --> | |
| 44 | 29 | <software name="tnt1"> |
| 45 | <description>Tsuyoku Naru Tesuji - Dai | |
| 30 | <description>Tsuyoku Naru Tesuji - Dai Ikkan</description> | |
| 46 | 31 | <year>1996</year> |
| 47 | 32 | <publisher>Koei</publisher> |
| 48 | <info name="serial" value="KS-1010"/> | |
| 49 | <info name="alt_title" value="強くなる手筋・第1巻"/> | |
| 50 | 33 | <part name="cart" interface="pasogo_cart"> |
| 51 | 34 | <dataarea name="rom" width="16" endianness="little" size="524288"> |
| 52 | 35 | <rom name="ks-1009.ic4" size="524288" crc="3e70fca6" sha1="c46cdc9e01f2f5c66b2523e1d30355e51c839f27" offset="00000000" /> |
| r243192 | r243193 | |
|---|---|---|
| 98 | 98 | ifeq ($(firstword $(filter Haiku,$(UNAME))),Haiku) |
| 99 | 99 | TARGETOS = haiku |
| 100 | 100 | endif |
| 101 | ifeq ($(firstword $(filter SunOS,$(UNAME))),SunOS) | |
| 102 | TARGETOS = solaris | |
| 103 | SDL_LIBVER = sdl | |
| 104 | endif | |
| 105 | 101 | |
| 106 | 102 | ifndef TARGETOS |
| 107 | 103 | $(error Unable to detect TARGETOS from uname -a: $(UNAME)) |
| r243192 | r243193 | |
| 118 | 114 | ifeq ($(firstword $(filter ppc64,$(UNAME))),ppc64) |
| 119 | 115 | PTR64 = 1 |
| 120 | 116 | endif |
| 121 | ifeq ($(TARGETOS), solaris) | |
| 122 | ifeq ($(firstword $(filter amd64,$(shell /usr/bin/isainfo -k))),amd64) | |
| 123 | PTR64 = 1 | |
| 124 | 117 | endif |
| 125 | endif | |
| 126 | endif | |
| 127 | 118 | |
| 128 | 119 | # Autodetect BIGENDIAN |
| 129 | 120 | # MacOSX |
| r243192 | r243193 | |
| 607 | 598 | # warnings only applicable to C++ compiles |
| 608 | 599 | CPPONLYFLAGS += \ |
| 609 | 600 | -Woverloaded-virtual |
| 601 | ||
| 602 | include $(SRC)/build/cc_detection.mak | |
| 610 | 603 | |
| 611 | 604 | ifdef SANITIZE |
| 612 | 605 | CCOMFLAGS += -fsanitize=$(SANITIZE) |
| 613 | ||
| 614 | 606 | ifneq (,$(findstring thread,$(SANITIZE))) |
| 615 | 607 | CCOMFLAGS += -fPIE |
| 616 | 608 | endif |
| 609 | ifneq (,$(findstring memory,$(SANITIZE))) | |
| 610 | ifneq (,$(findstring clang,$(CC))) | |
| 611 | CCOMFLAGS += -fsanitize-memory-track-origins -fPIE | |
| 617 | 612 | endif |
| 613 | endif | |
| 614 | ifneq (,$(findstring undefined,$(SANITIZE))) | |
| 615 | ifneq (,$(findstring clang,$(CC))) | |
| 616 | # TODO: check if linker is clang++ | |
| 617 | # produces a lot of messages - disable it for now | |
| 618 | CCOMFLAGS += -fno-sanitize=alignment | |
| 619 | # these are false positives because of the way our delegates work | |
| 620 | CCOMFLAGS += -fno-sanitize=function | |
| 621 | # clang takes forever to compile src/emu/cpu/tms57002/tms57002.c when this isn't disabled | |
| 622 | CCOMFLAGS += -fno-sanitize=shift | |
| 623 | # clang takes forever to compile src/emu/cpu/tms57002/tms57002.c, src/emu/cpu/m6809/hd6309.c when this isn't disabled | |
| 624 | CCOMFLAGS += -fno-sanitize=object-size | |
| 625 | # clang takes forever to compile src/emu/cpu/tms57002/tms57002.c, src/emu/cpu/m6809/konami.c, src/emu/cpu/m6809/hd6309.c, src/emu/video/psx.c when this isn't disabled | |
| 626 | CCOMFLAGS += -fno-sanitize=vptr | |
| 627 | # clang takes forever to compile src/emu/video/psx.c when this isn't disabled | |
| 628 | CCOMFLAGS += -fno-sanitize=null | |
| 629 | # clang takes forever to compile src/emu/cpu/tms57002/tms57002.c when this isn't disabled | |
| 630 | CCOMFLAGS += -fno-sanitize=signed-integer-overflow | |
| 631 | endif | |
| 632 | endif | |
| 633 | endif | |
| 618 | 634 | |
| 619 | include $(SRC)/build/cc_detection.mak | |
| 620 | ||
| 621 | 635 | #------------------------------------------------- |
| 622 | 636 | # include paths |
| 623 | 637 | #------------------------------------------------- |
| r243192 | r243193 | |
|---|---|---|
| 2 | 2 | |
| 3 | 3 | from __future__ import with_statement |
| 4 | 4 | |
| 5 | import string | |
| 5 | 6 | import sys |
| 6 | 7 | import os |
| 7 | 8 |
| r243192 | r243193 | |
|---|---|---|
| 9 | 9 | # caused by src/mame/video/jagblit.inc on older clang versions |
| 10 | 10 | CCOMFLAGS += -Wno-constant-logical-operand |
| 11 | 11 | |
| 12 | ifneq (,$(findstring undefined,$(SANITIZE))) | |
| 13 | # TODO: check if linker is clang++ | |
| 14 | # produces a lot of messages - disable it for now | |
| 15 | CCOMFLAGS += -fno-sanitize=alignment | |
| 16 | # these are false positives because of the way our delegates work | |
| 17 | CCOMFLAGS += -fno-sanitize=function | |
| 18 | endif | |
| 19 | ||
| 20 | ifneq (,$(findstring memory,$(SANITIZE))) | |
| 21 | CCOMFLAGS += -fsanitize-memory-track-origins -fPIE | |
| 22 | endif | |
| 23 | ||
| 24 | 12 | # TODO: needs to use $(CC) |
| 25 | 13 | TEST_CLANG := $(shell clang --version) |
| 26 | 14 | |
| r243192 | r243193 | |
| 41 | 29 | CCOMFLAGS += -Wno-unknown-warning-option |
| 42 | 30 | # XCode 6.0.1 gives this when using SDL2 in /Library/Frameworks/SDL2.framework/Headers/SDL_syswm.h:150 included from src/osd/sdl/sdlinc.h |
| 43 | 31 | CCOMFLAGS += -Wno-extern-c-compat |
| 44 | ||
| 45 | ifneq (,$(findstring undefined,$(SANITIZE))) | |
| 46 | # clang takes forever to compile src/emu/cpu/tms57002/tms57002.c when this isn't disabled | |
| 47 | CCOMFLAGS += -fno-sanitize=shift | |
| 48 | # clang takes forever to compile src/emu/cpu/tms57002/tms57002.c, src/emu/cpu/m6809/hd6309.c when this isn't disabled | |
| 49 | CCOMFLAGS += -fno-sanitize=object-size | |
| 50 | # clang takes forever to compile src/emu/cpu/tms57002/tms57002.c, src/emu/cpu/m6809/konami.c, src/emu/cpu/m6809/hd6309.c, src/emu/video/psx.c when this isn't disabled | |
| 51 | CCOMFLAGS += -fno-sanitize=vptr | |
| 52 | # clang takes forever to compile src/emu/video/psx.c when this isn't disabled | |
| 53 | CCOMFLAGS += -fno-sanitize=null | |
| 54 | # clang takes forever to compile src/emu/cpu/tms57002/tms57002.c when this isn't disabled | |
| 55 | CCOMFLAGS += -fno-sanitize=signed-integer-overflow | |
| 56 | 32 | endif |
| 57 | endif | |
| 58 | 33 | |
| 59 | 34 | ifeq ($(TARGETOS),emscripten) |
| 60 | 35 | CCOMFLAGS += -Qunused-arguments |
| r243192 | r243193 | |
|---|---|---|
| 2660 | 2660 | |
| 2661 | 2661 | # Parse command line arguments |
| 2662 | 2662 | from optparse import OptionParser |
| 2663 | import re | |
| 2663 | 2664 | version = '%prog ' + __version__ |
| 2664 | 2665 | parser = OptionParser(version=version) |
| 2665 | 2666 | parser.set_usage("%prog [options] [imagefile]") |
| r243192 | r243193 | |
|---|---|---|
| 121 | 121 | fp.write('o') |
| 122 | 122 | fp.write('n') |
| 123 | 123 | fp.write('t') |
| 124 | fp.write(chr(hash32 >> 24 & 0xff)) | |
| 125 | fp.write(chr(hash32 >> 16 & 0xff)) | |
| 126 | fp.write(chr(hash32 >> 8 & 0xff)) | |
| 127 | fp.write(chr(hash32 >> 0 & 0xff)) | |
| 128 | fp.write(chr(font.height >> 8 & 0xff)) | |
| 129 | fp.write(chr(font.height >> 0 & 0xff)) | |
| 130 | fp.write(chr(font.yOffs >> 8 & 0xff)) | |
| 131 | fp.write(chr(font.yOffs >> 0 & 0xff)) | |
| 132 | fp.write(chr(numChars >> 24 & 0xff)) | |
| 133 | fp.write(chr(numChars >> 16 & 0xff)) | |
| 134 | fp.write(chr(numChars >> 8 & 0xff)) | |
| 135 | fp.write(chr(numChars >> 0 & 0xff)) | |
| 124 | fp.write(bytearray([hash32 >> 24 & 0xff])) | |
| 125 | fp.write(bytearray([hash32 >> 16 & 0xff])) | |
| 126 | fp.write(bytearray([hash32 >> 8 & 0xff])) | |
| 127 | fp.write(bytearray([hash32 >> 0 & 0xff])) | |
| 128 | fp.write(bytearray([font.height >> 8 & 0xff])) | |
| 129 | fp.write(bytearray([font.height >> 0 & 0xff])) | |
| 130 | fp.write(bytearray([font.yOffs >> 8 & 0xff])) | |
| 131 | fp.write(bytearray([font.yOffs >> 0 & 0xff])) | |
| 132 | fp.write(bytearray([numChars >> 24 & 0xff])) | |
| 133 | fp.write(bytearray([numChars >> 16 & 0xff])) | |
| 134 | fp.write(bytearray([numChars >> 8 & 0xff])) | |
| 135 | fp.write(bytearray([numChars >> 0 & 0xff])) | |
| 136 | 136 | |
| 137 | 137 | # Write a blank table at first (?) |
| 138 | 138 | charTable = [0]*(numChars * CACHED_CHAR_SIZE) |
| 139 | for i in range(numChars * CACHED_CHAR_SIZE): | |
| 140 | fp.write(chr(charTable[i])) | |
| 139 | fp.write(bytearray(charTable)) | |
| 141 | 140 | |
| 142 | 141 | # Loop over all characters |
| 143 | 142 | tableIndex = 0 |
| r243192 | r243193 | |
| 172 | 171 | dBuffer.append(accum) |
| 173 | 172 | |
| 174 | 173 | # Write the data |
| 175 | for j in range(len(dBuffer)): | |
| 176 | fp.write(chr(dBuffer[j])) | |
| 174 | fp.write(bytearray(dBuffer)) | |
| 177 | 175 | |
| 178 | 176 | destIndex = tableIndex * CACHED_CHAR_SIZE |
| 179 | 177 | charTable[destIndex + 0] = i >> 8 & 0xff |
| r243192 | r243193 | |
| 192 | 190 | |
| 193 | 191 | # Seek back to the beginning and rewrite the table |
| 194 | 192 | fp.seek(CACHED_HEADER_SIZE, 0) |
| 195 | for i in range(numChars * CACHED_CHAR_SIZE): | |
| 196 | fp.write(chr(charTable[i])) | |
| 193 | fp.write(bytearray(charTable)) | |
| 197 | 194 | |
| 198 | 195 | fp.close() |
| 199 | 196 | return 0 |
| r243192 | r243193 | |
|---|---|---|
| 217 | 217 | SLOT_INTERFACE_START(a8sio_cards) |
| 218 | 218 | SLOT_INTERFACE("cassette", A8SIO_CASSETTE) |
| 219 | 219 | SLOT_INTERFACE_END |
| 220 |
| r243192 | r243193 | |
|---|---|---|
| 115 | 115 | break; |
| 116 | 116 | } |
| 117 | 117 | } |
| 118 |
| r243192 | r243193 | |
|---|---|---|
| 1087 | 1087 | |
| 1088 | 1088 | #------------------------------------------------- |
| 1089 | 1089 | # |
| 1090 | #@src/emu/bus/nes_ctrl/ctrl.h,BUSES += NES_CTRL | |
| 1091 | #------------------------------------------------- | |
| 1092 | ||
| 1093 | ifneq ($(filter NES_CTRL,$(BUSES)),) | |
| 1094 | OBJDIRS += $(BUSOBJ)/nes_ctrl | |
| 1095 | BUSOBJS += $(BUSOBJ)/nes_ctrl/ctrl.o | |
| 1096 | BUSOBJS += $(BUSOBJ)/nes_ctrl/joypad.o | |
| 1097 | BUSOBJS += $(BUSOBJ)/nes_ctrl/4score.o | |
| 1098 | BUSOBJS += $(BUSOBJ)/nes_ctrl/arkpaddle.o | |
| 1099 | BUSOBJS += $(BUSOBJ)/nes_ctrl/bcbattle.o | |
| 1100 | BUSOBJS += $(BUSOBJ)/nes_ctrl/ftrainer.o | |
| 1101 | BUSOBJS += $(BUSOBJ)/nes_ctrl/fckeybrd.o | |
| 1102 | BUSOBJS += $(BUSOBJ)/nes_ctrl/hori.o | |
| 1103 | BUSOBJS += $(BUSOBJ)/nes_ctrl/konamihs.o | |
| 1104 | BUSOBJS += $(BUSOBJ)/nes_ctrl/miracle.o | |
| 1105 | BUSOBJS += $(BUSOBJ)/nes_ctrl/mjpanel.o | |
| 1106 | BUSOBJS += $(BUSOBJ)/nes_ctrl/pachinko.o | |
| 1107 | BUSOBJS += $(BUSOBJ)/nes_ctrl/partytap.o | |
| 1108 | BUSOBJS += $(BUSOBJ)/nes_ctrl/powerpad.o | |
| 1109 | BUSOBJS += $(BUSOBJ)/nes_ctrl/suborkey.o | |
| 1110 | BUSOBJS += $(BUSOBJ)/nes_ctrl/zapper.o | |
| 1111 | endif | |
| 1112 | ||
| 1113 | #------------------------------------------------- | |
| 1114 | # | |
| 1115 | 1090 | #@src/emu/bus/snes/snes_slot.h,BUSES += SNES |
| 1116 | 1091 | #------------------------------------------------- |
| 1117 | 1092 | |
| r243192 | r243193 | |
| 1291 | 1266 | |
| 1292 | 1267 | #------------------------------------------------- |
| 1293 | 1268 | # |
| 1294 | #@src/emu/bus/gamegear/gge | |
| 1269 | #@src/emu/bus/gamegear/gear2gear.h,BUSES += GAMEGEAR | |
| 1295 | 1270 | #------------------------------------------------- |
| 1296 | 1271 | |
| 1297 | 1272 | ifneq ($(filter GAMEGEAR,$(BUSES)),) |
| 1298 | 1273 | OBJDIRS += $(BUSOBJ)/gamegear |
| 1299 | BUSOBJS += $(BUSOBJ)/gamegear/gge | |
| 1274 | BUSOBJS += $(BUSOBJ)/gamegear/gear2gear.o | |
| 1300 | 1275 | BUSOBJS += $(BUSOBJ)/gamegear/smsctrladp.o |
| 1301 | 1276 | endif |
| 1302 | 1277 |
| r0 | r243193 | |
|---|---|---|
| 1 | /********************************************************************** | |
| 2 | ||
| 3 | Sega Game Gear "Gear to Gear Port" emulation | |
| 4 | ||
| 5 | Copyright MESS Team. | |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 7 | ||
| 8 | **********************************************************************/ | |
| 9 | ||
| 10 | #include "gear2gear.h" | |
| 11 | // slot devices | |
| 12 | #include "smsctrladp.h" | |
| 13 | ||
| 14 | ||
| 15 | ||
| 16 | //************************************************************************** | |
| 17 | // GLOBAL VARIABLES | |
| 18 | //************************************************************************** | |
| 19 | ||
| 20 | const device_type GG_GEAR2GEAR_PORT = &device_creator<gg_gear2gear_port_device>; | |
| 21 | ||
| 22 | ||
| 23 | ||
| 24 | //************************************************************************** | |
| 25 | // CARD INTERFACE | |
| 26 | //************************************************************************** | |
| 27 | ||
| 28 | //------------------------------------------------- | |
| 29 | // device_gg_gear2gear_port_interface - constructor | |
| 30 | //------------------------------------------------- | |
| 31 | ||
| 32 | device_gg_gear2gear_port_interface::device_gg_gear2gear_port_interface(const machine_config &mconfig, device_t &device) | |
| 33 | : device_slot_card_interface(mconfig,device) | |
| 34 | { | |
| 35 | m_port = dynamic_cast<gg_gear2gear_port_device *>(device.owner()); | |
| 36 | } | |
| 37 | ||
| 38 | ||
| 39 | //------------------------------------------------- | |
| 40 | // ~device_gg_gear2gear_port_interface - destructor | |
| 41 | //------------------------------------------------- | |
| 42 | ||
| 43 | device_gg_gear2gear_port_interface::~device_gg_gear2gear_port_interface() | |
| 44 | { | |
| 45 | } | |
| 46 | ||
| 47 | ||
| 48 | ||
| 49 | //************************************************************************** | |
| 50 | // LIVE DEVICE | |
| 51 | //************************************************************************** | |
| 52 | ||
| 53 | //------------------------------------------------- | |
| 54 | // gg_gear2gear_port_device - constructor | |
| 55 | //------------------------------------------------- | |
| 56 | ||
| 57 | gg_gear2gear_port_device::gg_gear2gear_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : | |
| 58 | device_t(mconfig, GG_GEAR2GEAR_PORT, "Gear to Gear Port", tag, owner, clock, "gg_gear2gear_port", __FILE__), | |
| 59 | device_slot_interface(mconfig, *this), | |
| 60 | m_th_pin_handler(*this), | |
| 61 | m_pixel_handler(*this) | |
| 62 | { | |
| 63 | } | |
| 64 | ||
| 65 | ||
| 66 | //------------------------------------------------- | |
| 67 | // gg_gear2gear_port_device - destructor | |
| 68 | //------------------------------------------------- | |
| 69 | ||
| 70 | gg_gear2gear_port_device::~gg_gear2gear_port_device() | |
| 71 | { | |
| 72 | } | |
| 73 | ||
| 74 | ||
| 75 | //------------------------------------------------- | |
| 76 | // device_start - device-specific startup | |
| 77 | //------------------------------------------------- | |
| 78 | ||
| 79 | void gg_gear2gear_port_device::device_start() | |
| 80 | { | |
| 81 | m_device = dynamic_cast<device_gg_gear2gear_port_interface *>(get_card_device()); | |
| 82 | ||
| 83 | m_th_pin_handler.resolve_safe(); | |
| 84 | m_pixel_handler.resolve_safe(0); | |
| 85 | } | |
| 86 | ||
| 87 | ||
| 88 | UINT8 gg_gear2gear_port_device::port_r() | |
| 89 | { | |
| 90 | UINT8 data = 0xff; | |
| 91 | if (m_device) | |
| 92 | data = m_device->peripheral_r(); | |
| 93 | return data; | |
| 94 | } | |
| 95 | ||
| 96 | void gg_gear2gear_port_device::port_w( UINT8 data ) | |
| 97 | { | |
| 98 | if (m_device) | |
| 99 | m_device->peripheral_w(data); | |
| 100 | } | |
| 101 | ||
| 102 | ||
| 103 | void gg_gear2gear_port_device::th_pin_w(int state) | |
| 104 | { | |
| 105 | m_th_pin_handler(state); | |
| 106 | } | |
| 107 | ||
| 108 | UINT32 gg_gear2gear_port_device::pixel_r() | |
| 109 | { | |
| 110 | return m_pixel_handler(); | |
| 111 | } | |
| 112 | ||
| 113 | ||
| 114 | //------------------------------------------------- | |
| 115 | // SLOT_INTERFACE( gg_gear2gear_port_devices ) | |
| 116 | //------------------------------------------------- | |
| 117 | ||
| 118 | SLOT_INTERFACE_START( gg_gear2gear_port_devices ) | |
| 119 | SLOT_INTERFACE("smsctrladp", SMS_CTRL_ADAPTOR) | |
| 120 | SLOT_INTERFACE_END |
| r0 | r243193 | |
|---|---|---|
| 1 | /********************************************************************** | |
| 2 | ||
| 3 | Sega Game Gear "Gear to Gear Port" emulation | |
| 4 | ||
| 5 | Copyright MESS Team. | |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 7 | ||
| 8 | ********************************************************************** | |
| 9 | ||
| 10 | ||
| 11 | **********************************************************************/ | |
| 12 | ||
| 13 | #pragma once | |
| 14 | ||
| 15 | #ifndef __GG_GEAR2GEAR_PORT__ | |
| 16 | #define __GG_GEAR2GEAR_PORT__ | |
| 17 | ||
| 18 | #include "emu.h" | |
| 19 | ||
| 20 | ||
| 21 | ||
| 22 | //************************************************************************** | |
| 23 | // INTERFACE CONFIGURATION MACROS | |
| 24 | //************************************************************************** | |
| 25 | ||
| 26 | #define MCFG_GG_GEAR2GEAR_PORT_ADD(_tag, _slot_intf, _def_slot) \ | |
| 27 | MCFG_DEVICE_ADD(_tag, GG_GEAR2GEAR_PORT, 0) \ | |
| 28 | MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) | |
| 29 | #define MCFG_GG_GEAR2GEAR_PORT_MODIFY(_tag) \ | |
| 30 | MCFG_DEVICE_MODIFY(_tag) | |
| 31 | ||
| 32 | ||
| 33 | #define MCFG_GG_GEAR2GEAR_PORT_TH_INPUT_HANDLER(_devcb) \ | |
| 34 | devcb = &gg_gear2gear_port_device::set_th_input_handler(*device, DEVCB_##_devcb); | |
| 35 | ||
| 36 | ||
| 37 | #define MCFG_GG_GEAR2GEAR_PORT_PIXEL_HANDLER(_devcb) \ | |
| 38 | devcb = &gg_gear2gear_port_device::set_pixel_handler(*device, DEVCB_##_devcb); | |
| 39 | ||
| 40 | ||
| 41 | ||
| 42 | //************************************************************************** | |
| 43 | // TYPE DEFINITIONS | |
| 44 | //************************************************************************** | |
| 45 | ||
| 46 | // ======================> gg_gear2gear_port_device | |
| 47 | ||
| 48 | class device_gg_gear2gear_port_interface; | |
| 49 | ||
| 50 | class gg_gear2gear_port_device : public device_t, | |
| 51 | public device_slot_interface | |
| 52 | { | |
| 53 | public: | |
| 54 | // construction/destruction | |
| 55 | gg_gear2gear_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 56 | virtual ~gg_gear2gear_port_device(); | |
| 57 | ||
| 58 | // static configuration helpers | |
| 59 | template<class _Object> static devcb_base &set_th_input_handler(device_t &device, _Object object) { return downcast<gg_gear2gear_port_device &>(device).m_th_pin_handler.set_callback(object); } | |
| 60 | ||
| 61 | template<class _Object> static devcb_base &set_pixel_handler(device_t &device, _Object object) { return downcast<gg_gear2gear_port_device &>(device).m_pixel_handler.set_callback(object); } | |
| 62 | ||
| 63 | // Currently, only the support for SMS Controller Adaptor is emulated, | |
| 64 | // for when SMS Compatibility mode is enabled. In that mode, the 10 | |
| 65 | // pins of the Gear to Gear Port follows the same numbering of a SMS | |
| 66 | // Control port. | |
| 67 | ||
| 68 | // Data returned by the port_r methods: | |
| 69 | // bit 0 - pin 1 - Up | |
| 70 | // bit 1 - pin 2 - Down | |
| 71 | // bit 2 - pin 3 - Left | |
| 72 | // bit 3 - pin 4 - Right | |
| 73 | // bit 4 - pin 5 - Vcc (no data) | |
| 74 | // bit 5 - pin 6 - TL (Button 1/Light Phaser Trigger) | |
| 75 | // bit 6 - pin 7 - TH (Light Phaser sensor) | |
| 76 | // pin 8 - GND | |
| 77 | // bit 7 - pin 9 - TR (Button 2) | |
| 78 | // pin 10 - Not connected | |
| 79 | // | |
| 80 | UINT8 port_r(); | |
| 81 | void port_w( UINT8 data ); | |
| 82 | ||
| 83 | void th_pin_w(int state); | |
| 84 | UINT32 pixel_r(); | |
| 85 | ||
| 86 | //protected: | |
| 87 | // device-level overrides | |
| 88 | virtual void device_start(); | |
| 89 | ||
| 90 | device_gg_gear2gear_port_interface *m_device; | |
| 91 | ||
| 92 | private: | |
| 93 | devcb_write_line m_th_pin_handler; | |
| 94 | devcb_read32 m_pixel_handler; | |
| 95 | }; | |
| 96 | ||
| 97 | ||
| 98 | // ======================> device_gg_gear2gear_port_interface | |
| 99 | ||
| 100 | // class representing interface-specific live sms_expansion card | |
| 101 | class device_gg_gear2gear_port_interface : public device_slot_card_interface | |
| 102 | { | |
| 103 | public: | |
| 104 | // construction/destruction | |
| 105 | device_gg_gear2gear_port_interface(const machine_config &mconfig, device_t &device); | |
| 106 | virtual ~device_gg_gear2gear_port_interface(); | |
| 107 | ||
| 108 | virtual UINT8 peripheral_r() { return 0xff; }; | |
| 109 | virtual void peripheral_w(UINT8 data) { }; | |
| 110 | ||
| 111 | protected: | |
| 112 | gg_gear2gear_port_device *m_port; | |
| 113 | }; | |
| 114 | ||
| 115 | ||
| 116 | // device type definition | |
| 117 | extern const device_type GG_GEAR2GEAR_PORT; | |
| 118 | ||
| 119 | ||
| 120 | SLOT_INTERFACE_EXTERN( gg_gear2gear_port_devices ); | |
| 121 | ||
| 122 | ||
| 123 | #endif |
| r243192 | r243193 | |
|---|---|---|
| 1 | /********************************************************************** | |
| 2 | ||
| 3 | Sega Game Gear EXT port emulation | |
| 4 | ||
| 5 | Copyright MESS Team. | |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 7 | ||
| 8 | **********************************************************************/ | |
| 9 | ||
| 10 | #include "ggext.h" | |
| 11 | // slot devices | |
| 12 | #include "smsctrladp.h" | |
| 13 | ||
| 14 | ||
| 15 | ||
| 16 | //************************************************************************** | |
| 17 | // GLOBAL VARIABLES | |
| 18 | //************************************************************************** | |
| 19 | ||
| 20 | const device_type GG_EXT_PORT = &device_creator<gg_ext_port_device>; | |
| 21 | ||
| 22 | ||
| 23 | ||
| 24 | //************************************************************************** | |
| 25 | // CARD INTERFACE | |
| 26 | //************************************************************************** | |
| 27 | ||
| 28 | //------------------------------------------------- | |
| 29 | // device_gg_ext_port_interface - constructor | |
| 30 | //------------------------------------------------- | |
| 31 | ||
| 32 | device_gg_ext_port_interface::device_gg_ext_port_interface(const machine_config &mconfig, device_t &device) | |
| 33 | : device_slot_card_interface(mconfig,device) | |
| 34 | { | |
| 35 | m_port = dynamic_cast<gg_ext_port_device *>(device.owner()); | |
| 36 | } | |
| 37 | ||
| 38 | ||
| 39 | //------------------------------------------------- | |
| 40 | // ~device_gg_ext_port_interface - destructor | |
| 41 | //------------------------------------------------- | |
| 42 | ||
| 43 | device_gg_ext_port_interface::~device_gg_ext_port_interface() | |
| 44 | { | |
| 45 | } | |
| 46 | ||
| 47 | ||
| 48 | ||
| 49 | //************************************************************************** | |
| 50 | // LIVE DEVICE | |
| 51 | //************************************************************************** | |
| 52 | ||
| 53 | //------------------------------------------------- | |
| 54 | // gg_ext_port_device - constructor | |
| 55 | //------------------------------------------------- | |
| 56 | ||
| 57 | gg_ext_port_device::gg_ext_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : | |
| 58 | device_t(mconfig, GG_EXT_PORT, "EXT Port", tag, owner, clock, "gg_ext_port", __FILE__), | |
| 59 | device_slot_interface(mconfig, *this), | |
| 60 | m_th_pin_handler(*this), | |
| 61 | m_pixel_handler(*this) | |
| 62 | { | |
| 63 | } | |
| 64 | ||
| 65 | ||
| 66 | //------------------------------------------------- | |
| 67 | // gg_ext_port_device - destructor | |
| 68 | //------------------------------------------------- | |
| 69 | ||
| 70 | gg_ext_port_device::~gg_ext_port_device() | |
| 71 | { | |
| 72 | } | |
| 73 | ||
| 74 | ||
| 75 | //------------------------------------------------- | |
| 76 | // device_start - device-specific startup | |
| 77 | //------------------------------------------------- | |
| 78 | ||
| 79 | void gg_ext_port_device::device_start() | |
| 80 | { | |
| 81 | m_device = dynamic_cast<device_gg_ext_port_interface *>(get_card_device()); | |
| 82 | ||
| 83 | m_th_pin_handler.resolve_safe(); | |
| 84 | m_pixel_handler.resolve_safe(0); | |
| 85 | } | |
| 86 | ||
| 87 | ||
| 88 | UINT8 gg_ext_port_device::port_r() | |
| 89 | { | |
| 90 | UINT8 data = 0xff; | |
| 91 | if (m_device) | |
| 92 | data = m_device->peripheral_r(); | |
| 93 | return data; | |
| 94 | } | |
| 95 | ||
| 96 | void gg_ext_port_device::port_w( UINT8 data ) | |
| 97 | { | |
| 98 | if (m_device) | |
| 99 | m_device->peripheral_w(data); | |
| 100 | } | |
| 101 | ||
| 102 | ||
| 103 | void gg_ext_port_device::th_pin_w(int state) | |
| 104 | { | |
| 105 | m_th_pin_handler(state); | |
| 106 | } | |
| 107 | ||
| 108 | UINT32 gg_ext_port_device::pixel_r() | |
| 109 | { | |
| 110 | return m_pixel_handler(); | |
| 111 | } | |
| 112 | ||
| 113 | ||
| 114 | //------------------------------------------------- | |
| 115 | // SLOT_INTERFACE( gg_ext_port_devices ) | |
| 116 | //------------------------------------------------- | |
| 117 | ||
| 118 | SLOT_INTERFACE_START( gg_ext_port_devices ) | |
| 119 | SLOT_INTERFACE("smsctrladp", SMS_CTRL_ADAPTOR) | |
| 120 | SLOT_INTERFACE_END |
| r243192 | r243193 | |
|---|---|---|
| 1 | /********************************************************************** | |
| 2 | ||
| 3 | Sega Game Gear EXT port emulation | |
| 4 | ||
| 5 | Copyright MESS Team. | |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 7 | ||
| 8 | ********************************************************************** | |
| 9 | ||
| 10 | ||
| 11 | **********************************************************************/ | |
| 12 | ||
| 13 | #pragma once | |
| 14 | ||
| 15 | #ifndef __GG_EXT_PORT__ | |
| 16 | #define __GG_EXT_PORT__ | |
| 17 | ||
| 18 | #include "emu.h" | |
| 19 | ||
| 20 | ||
| 21 | ||
| 22 | //************************************************************************** | |
| 23 | // INTERFACE CONFIGURATION MACROS | |
| 24 | //************************************************************************** | |
| 25 | ||
| 26 | #define MCFG_GG_EXT_PORT_ADD(_tag, _slot_intf, _def_slot) \ | |
| 27 | MCFG_DEVICE_ADD(_tag, GG_EXT_PORT, 0) \ | |
| 28 | MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) | |
| 29 | #define MCFG_GG_EXT_PORT_MODIFY(_tag) \ | |
| 30 | MCFG_DEVICE_MODIFY(_tag) | |
| 31 | ||
| 32 | ||
| 33 | #define MCFG_GG_EXT_PORT_TH_INPUT_HANDLER(_devcb) \ | |
| 34 | devcb = &gg_ext_port_device::set_th_input_handler(*device, DEVCB_##_devcb); | |
| 35 | ||
| 36 | ||
| 37 | #define MCFG_GG_EXT_PORT_PIXEL_HANDLER(_devcb) \ | |
| 38 | devcb = &gg_ext_port_device::set_pixel_handler(*device, DEVCB_##_devcb); | |
| 39 | ||
| 40 | ||
| 41 | ||
| 42 | //************************************************************************** | |
| 43 | // TYPE DEFINITIONS | |
| 44 | //************************************************************************** | |
| 45 | ||
| 46 | // ======================> gg_ext_port_device | |
| 47 | ||
| 48 | class device_gg_ext_port_interface; | |
| 49 | ||
| 50 | class gg_ext_port_device : public device_t, | |
| 51 | public device_slot_interface | |
| 52 | { | |
| 53 | public: | |
| 54 | // construction/destruction | |
| 55 | gg_ext_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 56 | virtual ~gg_ext_port_device(); | |
| 57 | ||
| 58 | // static configuration helpers | |
| 59 | template<class _Object> static devcb_base &set_th_input_handler(device_t &device, _Object object) { return downcast<gg_ext_port_device &>(device).m_th_pin_handler.set_callback(object); } | |
| 60 | ||
| 61 | template<class _Object> static devcb_base &set_pixel_handler(device_t &device, _Object object) { return downcast<gg_ext_port_device &>(device).m_pixel_handler.set_callback(object); } | |
| 62 | ||
| 63 | // Currently, only the support for SMS Controller Adaptor is emulated, | |
| 64 | // for when SMS Compatibility mode is enabled. In that mode, the 10 pins | |
| 65 | // of the EXT port follows the same numbering of a SMS Control port. | |
| 66 | ||
| 67 | // Data returned by the port_r methods: | |
| 68 | // bit 0 - pin 1 - Up | |
| 69 | // bit 1 - pin 2 - Down | |
| 70 | // bit 2 - pin 3 - Left | |
| 71 | // bit 3 - pin 4 - Right | |
| 72 | // bit 4 - pin 5 - Vcc (no data) | |
| 73 | // bit 5 - pin 6 - TL (Button 1/Light Phaser Trigger) | |
| 74 | // bit 6 - pin 7 - TH (Light Phaser sensor) | |
| 75 | // pin 8 - GND | |
| 76 | // bit 7 - pin 9 - TR (Button 2) | |
| 77 | // pin 10 - Not connected | |
| 78 | // | |
| 79 | UINT8 port_r(); | |
| 80 | void port_w( UINT8 data ); | |
| 81 | ||
| 82 | void th_pin_w(int state); | |
| 83 | UINT32 pixel_r(); | |
| 84 | ||
| 85 | //protected: | |
| 86 | // device-level overrides | |
| 87 | virtual void device_start(); | |
| 88 | ||
| 89 | device_gg_ext_port_interface *m_device; | |
| 90 | ||
| 91 | private: | |
| 92 | devcb_write_line m_th_pin_handler; | |
| 93 | devcb_read32 m_pixel_handler; | |
| 94 | }; | |
| 95 | ||
| 96 | ||
| 97 | // ======================> device_gg_ext_port_interface | |
| 98 | ||
| 99 | // class representing interface-specific live sms_expansion card | |
| 100 | class device_gg_ext_port_interface : public device_slot_card_interface | |
| 101 | { | |
| 102 | public: | |
| 103 | // construction/destruction | |
| 104 | device_gg_ext_port_interface(const machine_config &mconfig, device_t &device); | |
| 105 | virtual ~device_gg_ext_port_interface(); | |
| 106 | ||
| 107 | virtual UINT8 peripheral_r() { return 0xff; }; | |
| 108 | virtual void peripheral_w(UINT8 data) { }; | |
| 109 | ||
| 110 | protected: | |
| 111 | gg_ext_port_device *m_port; | |
| 112 | }; | |
| 113 | ||
| 114 | ||
| 115 | // device type definition | |
| 116 | extern const device_type GG_EXT_PORT; | |
| 117 | ||
| 118 | ||
| 119 | SLOT_INTERFACE_EXTERN( gg_ext_port_devices ); | |
| 120 | ||
| 121 | ||
| 122 | #endif |
| r243192 | r243193 | |
|---|---|---|
| 1 | 1 | /********************************************************************** |
| 2 | 2 | |
| 3 | Sega Game Gear "SMS Controller Adaptor" emulation | |
| 3 | Sega Game Gear "Gear to Gear Port SMS Controller Adaptor" emulation | |
| 4 | 4 | Also known as "Master Link" cable. |
| 5 | 5 | |
| 6 | 6 | Copyright MESS Team. |
| r243192 | r243193 | |
| 29 | 29 | |
| 30 | 30 | sms_ctrl_adaptor_device::sms_ctrl_adaptor_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 31 | 31 | device_t(mconfig, SMS_CTRL_ADAPTOR, "SMS Controller Adaptor", tag, owner, clock, "sms_ctrl_adaptor", __FILE__), |
| 32 | device_gg_e | |
| 32 | device_gg_gear2gear_port_interface(mconfig, *this), | |
| 33 | 33 | m_subctrl_port(*this, "ctrl") |
| 34 | 34 | { |
| 35 | 35 | } |
| r243192 | r243193 | |
|---|---|---|
| 1 | 1 | /********************************************************************** |
| 2 | 2 | |
| 3 | Sega Game Gear "SMS Controller Adaptor" emulation | |
| 3 | Sega Game Gear "Gear to Gear Port SMS Controller Adaptor" emulation | |
| 4 | 4 | Also known as "Master Link" cable. |
| 5 | 5 | |
| 6 | 6 | Copyright MESS Team. |
| r243192 | r243193 | |
| 15 | 15 | |
| 16 | 16 | |
| 17 | 17 | #include "emu.h" |
| 18 | #include "gge | |
| 18 | #include "gear2gear.h" | |
| 19 | 19 | #include "../sms_ctrl/smsctrl.h" |
| 20 | 20 | |
| 21 | 21 | |
| r243192 | r243193 | |
| 27 | 27 | // ======================> sms_ctrl_adaptor_device |
| 28 | 28 | |
| 29 | 29 | class sms_ctrl_adaptor_device : public device_t, |
| 30 | public device_gg_e | |
| 30 | public device_gg_gear2gear_port_interface | |
| 31 | 31 | { |
| 32 | 32 | public: |
| 33 | 33 | // construction/destruction |
| r243192 | r243193 | |
| 41 | 41 | virtual void device_start(); |
| 42 | 42 | virtual machine_config_constructor device_mconfig_additions() const; |
| 43 | 43 | |
| 44 | // device_gg_e | |
| 44 | // device_gg_gear2gear_port_interface overrides | |
| 45 | 45 | virtual UINT8 peripheral_r(); |
| 46 | 46 | virtual void peripheral_w(UINT8 data); |
| 47 | 47 |
| r243192 | r243193 | |
|---|---|---|
| 77 | 77 | //------------------------------------------------- |
| 78 | 78 | |
| 79 | 79 | sms_graphic_device::sms_graphic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 80 | : device_t(mconfig, SMS_GRAPHIC, " | |
| 80 | : device_t(mconfig, SMS_GRAPHIC, "Graphic Board", tag, owner, clock, "sms_graphic", __FILE__) | |
| 81 | 81 | , device_sms_control_port_interface(mconfig, *this) |
| 82 | 82 | , m_buttons(*this, "BUTTONS") |
| 83 | 83 | , m_x(*this, "X") |
| r243192 | r243193 | |
|---|---|---|
| 20 | 20 | |
| 21 | 21 | static INPUT_PORTS_START( sms_joypad ) |
| 22 | 22 | PORT_START("JOYPAD") |
| 23 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY | |
| 24 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY | |
| 25 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY | |
| 26 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY | |
| 23 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY | |
| 24 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY | |
| 25 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY | |
| 26 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY | |
| 27 | 27 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) // Vcc |
| 28 | 28 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) // TL |
| 29 | 29 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) // TH |
| r243192 | r243193 | |
| 51 | 51 | //------------------------------------------------- |
| 52 | 52 | |
| 53 | 53 | sms_joypad_device::sms_joypad_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 54 | device_t(mconfig, SMS_JOYPAD, " | |
| 54 | device_t(mconfig, SMS_JOYPAD, "Control Pad", tag, owner, clock, "sms_joypad", __FILE__), | |
| 55 | 55 | device_sms_control_port_interface(mconfig, *this), |
| 56 | 56 | m_joypad(*this, "JOYPAD") |
| 57 | 57 | { |
| r243192 | r243193 | |
|---|---|---|
| 70 | 70 | //------------------------------------------------- |
| 71 | 71 | |
| 72 | 72 | sms_light_phaser_device::sms_light_phaser_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 73 | device_t(mconfig, SMS_LIGHT_PHASER, " | |
| 73 | device_t(mconfig, SMS_LIGHT_PHASER, "Light Phaser", tag, owner, clock, "sms_light_phaser", __FILE__), | |
| 74 | 74 | device_video_interface(mconfig, *this), |
| 75 | 75 | device_sms_control_port_interface(mconfig, *this), |
| 76 | 76 | m_lphaser_pins(*this, "CTRL_PORT"), |
| r243192 | r243193 | |
|---|---|---|
| 29 | 29 | //------------------------------------------------- |
| 30 | 30 | |
| 31 | 31 | sms_multitap_device::sms_multitap_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 32 | device_t(mconfig, SMS_MULTITAP, " | |
| 32 | device_t(mconfig, SMS_MULTITAP, "Multitap", tag, owner, clock, "sms_multitap", __FILE__), | |
| 33 | 33 | device_sms_control_port_interface(mconfig, *this), |
| 34 | 34 | m_subctrl1_port(*this, "ctrl1"), |
| 35 | 35 | m_subctrl2_port(*this, "ctrl2"), |
| r243192 | r243193 | |
|---|---|---|
| 73 | 73 | //------------------------------------------------- |
| 74 | 74 | |
| 75 | 75 | sms_paddle_device::sms_paddle_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 76 | device_t(mconfig, SMS_PADDLE, " | |
| 76 | device_t(mconfig, SMS_PADDLE, "Paddle", tag, owner, clock, "sms_paddle", __FILE__), | |
| 77 | 77 | device_sms_control_port_interface(mconfig, *this), |
| 78 | 78 | m_paddle_pins(*this, "CTRL_PORT"), |
| 79 | 79 | m_paddle_x(*this, "PADDLE_X"), |
| r243192 | r243193 | |
|---|---|---|
| 51 | 51 | //------------------------------------------------- |
| 52 | 52 | |
| 53 | 53 | sms_rapid_fire_device::sms_rapid_fire_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 54 | device_t(mconfig, SMS_RAPID_FIRE, " | |
| 54 | device_t(mconfig, SMS_RAPID_FIRE, "Rapid Fire", tag, owner, clock, "sms_rapid_fire", __FILE__), | |
| 55 | 55 | device_sms_control_port_interface(mconfig, *this), |
| 56 | 56 | m_rfire_sw(*this, "rfu_sw"), |
| 57 | 57 | m_subctrl_port(*this, "ctrl"), |
| r243192 | r243193 | |
|---|---|---|
| 112 | 112 | //------------------------------------------------- |
| 113 | 113 | |
| 114 | 114 | sms_sports_pad_device::sms_sports_pad_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 115 | device_t(mconfig, SMS_SPORTS_PAD, "S | |
| 115 | device_t(mconfig, SMS_SPORTS_PAD, "Sports Pad US", tag, owner, clock, "sms_sports_pad", __FILE__), | |
| 116 | 116 | device_sms_control_port_interface(mconfig, *this), |
| 117 | 117 | m_sports_in(*this, "SPORTS_IN"), |
| 118 | 118 | m_sports_out(*this, "SPORTS_OUT"), |
| r243192 | r243193 | |
|---|---|---|
| 87 | 87 | //------------------------------------------------- |
| 88 | 88 | |
| 89 | 89 | sms_sports_pad_jp_device::sms_sports_pad_jp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 90 | device_t(mconfig, SMS_SPORTS_PAD_JP, "S | |
| 90 | device_t(mconfig, SMS_SPORTS_PAD_JP, "Sports Pad JP", tag, owner, clock, "sms_sports_pad_jp", __FILE__), | |
| 91 | 91 | device_sms_control_port_interface(mconfig, *this), |
| 92 | 92 | m_sports_jp_in(*this, "SPORTS_JP_IN"), |
| 93 | 93 | m_sports_jp_x(*this, "SPORTS_JP_X"), |
| r243192 | r243193 | |
|---|---|---|
| 37 | 37 | save_item(NAME(m_df[i].music_mode), i); |
| 38 | 38 | save_item(NAME(m_df[i].osc_clk), i); |
| 39 | 39 | } |
| 40 | ||
| 40 | ||
| 41 | 41 | save_item(NAME(m_movamt)); |
| 42 | 42 | save_item(NAME(m_latch_62)); |
| 43 | 43 | save_item(NAME(m_latch_64)); |
| r243192 | r243193 | |
|---|---|---|
| 58 | 58 | //------------------------------------------------- |
| 59 | 59 | |
| 60 | 60 | vcs_joystick_booster_device::vcs_joystick_booster_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 61 | device_t(mconfig, VCS_JOYSTICK_BOOSTER, " | |
| 61 | device_t(mconfig, VCS_JOYSTICK_BOOSTER, "Digital joystick with Boostergrip", tag, owner, clock, "vcs_joystick_booster", __FILE__), | |
| 62 | 62 | device_vcs_control_port_interface(mconfig, *this), |
| 63 | 63 | m_joy(*this, "JOY"), |
| 64 | 64 | m_potx(*this, "POTX"), |
| r243192 | r243193 | |
|---|---|---|
| 51 | 51 | //------------------------------------------------- |
| 52 | 52 | |
| 53 | 53 | vcs_joystick_device::vcs_joystick_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 54 | device_t(mconfig, VCS_JOYSTICK, " | |
| 54 | device_t(mconfig, VCS_JOYSTICK, "Digital joystick", tag, owner, clock, "vcs_joystick", __FILE__), | |
| 55 | 55 | device_vcs_control_port_interface(mconfig, *this), |
| 56 | 56 | m_joy(*this, "JOY") |
| 57 | 57 | { |
| r243192 | r243193 | |
|---|---|---|
| 55 | 55 | //------------------------------------------------- |
| 56 | 56 | |
| 57 | 57 | vcs_keypad_device::vcs_keypad_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 58 | device_t(mconfig, VCS_KEYPAD, " | |
| 58 | device_t(mconfig, VCS_KEYPAD, "Keypad", tag, owner, clock, "vcs_keypad", __FILE__), | |
| 59 | 59 | device_vcs_control_port_interface(mconfig, *this), |
| 60 | 60 | m_keypad(*this, "KEYPAD") |
| 61 | 61 | { |
| r243192 | r243193 | |
|---|---|---|
| 60 | 60 | //------------------------------------------------- |
| 61 | 61 | |
| 62 | 62 | vcs_lightpen_device::vcs_lightpen_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 63 | device_t(mconfig, VCS_LIGHTPEN, " | |
| 63 | device_t(mconfig, VCS_LIGHTPEN, "Light Pen", tag, owner, clock, "vcs_lightpen", __FILE__), | |
| 64 | 64 | device_vcs_control_port_interface(mconfig, *this), |
| 65 | 65 | m_joy(*this, "JOY"), |
| 66 | 66 | m_lightx(*this, "LIGHTX"), |
| r243192 | r243193 | |
|---|---|---|
| 54 | 54 | //------------------------------------------------- |
| 55 | 55 | |
| 56 | 56 | vcs_paddles_device::vcs_paddles_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 57 | device_t(mconfig, VCS_PADDLES, " | |
| 57 | device_t(mconfig, VCS_PADDLES, "Digital paddles", tag, owner, clock, "vcs_paddles", __FILE__), | |
| 58 | 58 | device_vcs_control_port_interface(mconfig, *this), |
| 59 | 59 | m_joy(*this, "JOY"), |
| 60 | 60 | m_potx(*this, "POTX"), |
| r243192 | r243193 | |
|---|---|---|
| 48 | 48 | //------------------------------------------------- |
| 49 | 49 | |
| 50 | 50 | vcs_wheel_device::vcs_wheel_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 51 | device_t(mconfig, VCS_WHEEL, " | |
| 51 | device_t(mconfig, VCS_WHEEL, "Driving Wheel", tag, owner, clock, "vcs_wheel", __FILE__), | |
| 52 | 52 | device_vcs_control_port_interface(mconfig, *this), |
| 53 | 53 | m_joy(*this, "JOY"), |
| 54 | 54 | m_wheel(*this, "WHEEL") |
| r243192 | r243193 | |
|---|---|---|
| 36 | 36 | class media_identifier |
| 37 | 37 | { |
| 38 | 38 | public: |
| 39 | // construction/destruction | |
| 40 | media_identifier(cli_options &options); | |
| 39 | // construction/destruction | |
| 40 | media_identifier(cli_options &options); | |
| 41 | 41 | |
| 42 | // getters | |
| 43 | int total() const { return m_total; } | |
| 44 | int matches() const { return m_matches; } | |
| 45 | int nonroms() const { return m_nonroms; } | |
| 42 | // getters | |
| 43 | int total() const { return m_total; } | |
| 44 | int matches() const { return m_matches; } | |
| 45 | int nonroms() const { return m_nonroms; } | |
| 46 | 46 | |
| 47 | // operations | |
| 48 | void reset() { m_total = m_matches = m_nonroms = 0; } | |
| 49 | void identify(const char *name); | |
| 50 | void identify_file(const char *name); | |
| 51 | void identify_data(const char *name, const UINT8 *data, int length); | |
| 52 | int find_by_hash(const hash_collection &hashes, int length); | |
| 47 | // operations | |
| 48 | void reset() { m_total = m_matches = m_nonroms = 0; } | |
| 49 | void identify(const char *name); | |
| 50 | void identify_file(const char *name); | |
| 51 | void identify_data(const char *name, const UINT8 *data, int length); | |
| 52 | int find_by_hash(const hash_collection &hashes, int length); | |
| 53 | 53 | |
| 54 | 54 | private: |
| 55 | // internal state | |
| 56 | driver_enumerator m_drivlist; | |
| 57 | int m_total; | |
| 58 | int m_matches; | |
| 59 | int m_nonroms; | |
| 55 | // internal state | |
| 56 | driver_enumerator m_drivlist; | |
| 57 | int m_total; | |
| 58 | int m_matches; | |
| 59 | int m_nonroms; | |
| 60 | 60 | }; |
| 61 | 61 | |
| 62 | 62 | |
| r243192 | r243193 | |
| 1619 | 1619 | } |
| 1620 | 1620 | |
| 1621 | 1621 | if (!m_osd.execute_command(m_options.command())) |
| 1622 | // if we get here, we don't know what has been requested | |
| 1623 | throw emu_fatalerror(MAMERR_INVALID_CONFIG, "Unknown command '%s' specified", m_options.command()); | |
| 1622 | // if we get here, we don't know what has been requested | |
| 1623 | throw emu_fatalerror(MAMERR_INVALID_CONFIG, "Unknown command '%s' specified", m_options.command()); | |
| 1624 | 1624 | } |
| 1625 | 1625 | |
| 1626 | 1626 |
| r243192 | r243193 | |
|---|---|---|
| 60 | 60 | cli_options::cli_options() |
| 61 | 61 | : emu_options() |
| 62 | 62 | { |
| 63 | ||
| 63 | add_entries(cli_options::s_option_entries); | |
| 64 | 64 | } |
| 65 |
| r243192 | r243193 | |
|---|---|---|
| 51 | 51 | arcompact_device::arcompact_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 52 | 52 | : cpu_device(mconfig, ARCA5, "ARCtangent-A5", tag, owner, clock, "arca5", __FILE__) |
| 53 | 53 | , m_program_config("program", ENDIANNESS_LITTLE, 32, 32, 0) // some docs describe these as 'middle endian'?! |
| 54 | , m_io_config( "io", ENDIANNESS_LITTLE, 32, AUX_SPACE_ADDRESS_WIDTH, 0, ADDRESS_MAP_NAME( arcompact_auxreg_map ) ) | |
| 54 | , m_io_config( "io", ENDIANNESS_LITTLE, 32, AUX_SPACE_ADDRESS_WIDTH, 0, ADDRESS_MAP_NAME( arcompact_auxreg_map ) ) | |
| 55 | 55 | { |
| 56 | 56 | } |
| 57 | 57 |
| r243192 | r243193 | |
|---|---|---|
| 60 | 60 | public: |
| 61 | 61 | // construction/destruction |
| 62 | 62 | arcompact_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 63 | ||
| 63 | ||
| 64 | 64 | DECLARE_READ32_MEMBER( arcompact_auxreg002_LPSTART_r); |
| 65 | 65 | DECLARE_WRITE32_MEMBER(arcompact_auxreg002_LPSTART_w); |
| 66 | 66 | DECLARE_READ32_MEMBER( arcompact_auxreg003_LPEND_r); |
| 67 | 67 | DECLARE_WRITE32_MEMBER(arcompact_auxreg003_LPEND_w); |
| 68 | ||
| 68 | ||
| 69 | 69 | DECLARE_READ32_MEMBER( arcompact_auxreg00a_STATUS32_r); |
| 70 | 70 | DECLARE_READ32_MEMBER( arcompact_auxreg025_INTVECTORBASE_r); |
| 71 | 71 | DECLARE_WRITE32_MEMBER( arcompact_auxreg025_INTVECTORBASE_w); |
| 72 | 72 | |
| 73 | ||
| 73 | ||
| 74 | 74 | protected: |
| 75 | 75 | // device-level overrides |
| 76 | 76 | virtual void device_start(); |
| r243192 | r243193 | |
| 184 | 184 | ARCOMPACT_RETTYPE arcompact_handle04_1c(OPS_32); |
| 185 | 185 | ARCOMPACT_RETTYPE arcompact_handle04_1d(OPS_32); |
| 186 | 186 | // ARCOMPACT_RETTYPE arcompact_handle04_20(OPS_32); |
| 187 | // | |
| 187 | // ARCOMPACT_RETTYPE arcompact_handle04_21(OPS_32); | |
| 188 | 188 | ARCOMPACT_RETTYPE arcompact_handle04_22(OPS_32); |
| 189 | 189 | ARCOMPACT_RETTYPE arcompact_handle04_23(OPS_32); |
| 190 | 190 | ARCOMPACT_RETTYPE arcompact_handle04_28(OPS_32); |
| 191 | 191 | ARCOMPACT_RETTYPE arcompact_handle04_29(OPS_32); |
| 192 | // | |
| 192 | // ARCOMPACT_RETTYPE arcompact_handle04_2a(OPS_32); | |
| 193 | 193 | // ARCOMPACT_RETTYPE arcompact_handle04_2b(OPS_32); |
| 194 | 194 | ARCOMPACT_RETTYPE arcompact_handle04_2f_00(OPS_32); |
| 195 | 195 | ARCOMPACT_RETTYPE arcompact_handle04_2f_01(OPS_32); |
| 196 | 196 | // ARCOMPACT_RETTYPE arcompact_handle04_2f_02(OPS_32); |
| 197 | // | |
| 197 | // ARCOMPACT_RETTYPE arcompact_handle04_2f_03(OPS_32); | |
| 198 | 198 | ARCOMPACT_RETTYPE arcompact_handle04_2f_04(OPS_32); |
| 199 | 199 | ARCOMPACT_RETTYPE arcompact_handle04_2f_05(OPS_32); |
| 200 | 200 | ARCOMPACT_RETTYPE arcompact_handle04_2f_06(OPS_32); |
| r243192 | r243193 | |
| 770 | 770 | ARCOMPACT_RETTYPE arcompact_handle19_0x_helper(OPS_16, const char* optext, int shift, int format); |
| 771 | 771 | ARCOMPACT_RETTYPE arcompact_handle1e_0x_helper(OPS_16, const char* optext); |
| 772 | 772 | ARCOMPACT_RETTYPE arcompact_handle1e_03_0x_helper(OPS_16, const char* optext); |
| 773 | ||
| 773 | 774 | |
| 774 | ||
| 775 | 775 | UINT32 handle_jump_to_addr(int delay, int link, UINT32 address, UINT32 next_addr); |
| 776 | 776 | UINT32 handle_jump_to_register(int delay, int link, UINT32 reg, UINT32 next_addr, int flag); |
| 777 | 777 |
| r243192 | r243193 | |
|---|---|---|
| 2142 | 2142 | size = 8; |
| 2143 | 2143 | } |
| 2144 | 2144 | |
| 2145 | // | |
| 2145 | // c = limm; | |
| 2146 | 2146 | |
| 2147 | 2147 | } |
| 2148 | 2148 | else |
| r243192 | r243193 | |
| 2151 | 2151 | // Jcc [c] 0010 0RRR 1110 0000 0RRR CCCC CC0Q QQQQ |
| 2152 | 2152 | // no conditional links to ILINK1, ILINK2? |
| 2153 | 2153 | |
| 2154 | // | |
| 2154 | // c = m_regs[creg]; | |
| 2155 | 2155 | } |
| 2156 | 2156 | |
| 2157 | 2157 | if (!check_condition(condition)) |
| r243192 | r243193 | |
|---|---|---|
| 1 | 1 | #!/usr/bin/python |
| 2 | 2 | |
| 3 | 3 | import sys |
| 4 | import re | |
| 4 | 5 | |
| 5 | 6 | def EmitGroup04_Handle_NZ_Flags(f, funcname, opname): |
| 6 | 7 | print >>f, " if (result & 0x80000000) { STATUS32_SET_N; }" |
| r243192 | r243193 | |
| 352 | 353 | try: |
| 353 | 354 | f = open(sys.argv[1], "w") |
| 354 | 355 | except Exception, err: |
| 355 | | |
| 356 | logging.error("cannot write file %s [%s]", fname, err) | |
| 356 | 357 | sys.exit(1) |
| 357 | 358 | |
| 358 | 359 |
| r243192 | r243193 | |
|---|---|---|
| 139 | 139 | for i in range(0, extra_words): |
| 140 | 140 | self.source.append("\tfetch(%d);\n" % (i+base_offset)); |
| 141 | 141 | |
| 142 | def description( | |
| 142 | def description(): | |
| 143 | 143 | return "%s %s %s" % (self.name, self.am1, self.am2) |
| 144 | 144 | |
| 145 | 145 | def add_source_line(self, line): |
| r243192 | r243193 | |
| 451 | 451 | try: |
| 452 | 452 | f = open(argv[3], "w") |
| 453 | 453 | except Exception, err: |
| 454 | | |
| 454 | logging.error("cannot write file %s [%s]", fname, err) | |
| 455 | 455 | sys.exit(1) |
| 456 | 456 | |
| 457 | 457 | opcodes.build_dispatch() |
| r243192 | r243193 | |
|---|---|---|
| 98 | 98 | #define ALWAYS64 0x400 |
| 99 | 99 | #define SPECIAL64 0x800 |
| 100 | 100 | #define SPECIAL64_ENT(x) (SPECIAL64 | ((x) << 24)) |
| 101 | #define GROUP_MOD 0x1000 | |
| 102 | 101 | |
| 103 | 102 | struct I386_OPCODE { |
| 104 | 103 | const char *mnemonic; |
| r243192 | r243193 | |
| 426 | 425 | "movupd\0" |
| 427 | 426 | "movsd\0" |
| 428 | 427 | "movss", MODRM|VAR_NAME4,PARAM_XMMM, PARAM_XMM, 0 }, |
| 429 | {"group0F12", GROUP|GROUP_MOD, 0, 0, 0 }, | |
| 430 | 428 | {"movlps\0" |
| 431 | 429 | "movlpd\0" |
| 430 | "movddup\0" | |
| 431 | "movsldup", MODRM|VAR_NAME4,PARAM_XMM, PARAM_XMMM, 0 }, | |
| 432 | {"movlps\0" | |
| 433 | "movlpd\0" | |
| 432 | 434 | "???\0" |
| 433 | 435 | "???", MODRM|VAR_NAME4,PARAM_XMMM, PARAM_XMM, 0 }, |
| 434 | 436 | {"unpcklps\0" |
| r243192 | r243193 | |
| 439 | 441 | "unpckhpd\0" |
| 440 | 442 | "???\0" |
| 441 | 443 | "???", MODRM|VAR_NAME4,PARAM_XMM, PARAM_XMMM, 0 }, |
| 442 | { "group0F16", GROUP|GROUP_MOD, 0, 0, 0 }, | |
| 443 | 444 | {"movhps\0" |
| 444 | 445 | "movhpd\0" |
| 445 | 446 | "???\0" |
| 446 | "???", MODRM|VAR_NAME4,PARAM_XMMM, PARAM_XMM, 0 }, | |
| 447 | "movshdup", MODRM|VAR_NAME4,PARAM_XMMM, PARAM_XMM, 0 }, | |
| 448 | {"movhps\0" | |
| 449 | "movhpd\0" | |
| 450 | "???\0" | |
| 451 | "???", MODRM|VAR_NAME4,PARAM_XMM, PARAM_XMMM, 0 }, | |
| 447 | 452 | {"group0F18", GROUP, 0, 0, 0 }, |
| 448 | 453 | {"nop_hint", 0, PARAM_RMPTR8, 0, 0 }, |
| 449 | 454 | {"nop_hint", 0, PARAM_RMPTR8, 0, 0 }, |
| r243192 | r243193 | |
| 1805 | 1810 | {"???", 0, 0, 0, 0 } |
| 1806 | 1811 | }; |
| 1807 | 1812 | |
| 1808 | static const I386_OPCODE group0F12_table[4] = | |
| 1809 | { | |
| 1810 | { "movlps\0" | |
| 1811 | "movlpd\0" | |
| 1812 | "movddup\0" | |
| 1813 | "movsldup", VAR_NAME4,PARAM_XMM, PARAM_XMMM, 0 }, | |
| 1814 | { "movlps\0" | |
| 1815 | "movlpd\0" | |
| 1816 | "movddup\0" | |
| 1817 | "movsldup", VAR_NAME4,PARAM_XMM, PARAM_XMMM, 0 }, | |
| 1818 | { "movlps\0" | |
| 1819 | "movlpd\0" | |
| 1820 | "movddup\0" | |
| 1821 | "movsldup", VAR_NAME4,PARAM_XMM, PARAM_XMMM, 0 }, | |
| 1822 | { "movhlps\0" | |
| 1823 | "???\0" | |
| 1824 | "movddup\0" | |
| 1825 | "movsldup", VAR_NAME4,PARAM_XMM, PARAM_XMMM, 0 } | |
| 1826 | }; | |
| 1827 | ||
| 1828 | static const I386_OPCODE group0F16_table[4] = | |
| 1829 | { | |
| 1830 | { "movhps\0" | |
| 1831 | "movhpd\0" | |
| 1832 | "???\0" | |
| 1833 | "movshdup", VAR_NAME4,PARAM_XMM, PARAM_XMMM, 0 }, | |
| 1834 | { "movhps\0" | |
| 1835 | "movhpd\0" | |
| 1836 | "???\0" | |
| 1837 | "movshdup", VAR_NAME4,PARAM_XMM, PARAM_XMMM, 0 }, | |
| 1838 | { "movhps\0" | |
| 1839 | "movhpd\0" | |
| 1840 | "???\0" | |
| 1841 | "movshdup", VAR_NAME4,PARAM_XMM, PARAM_XMMM, 0 }, | |
| 1842 | { "movlhps\0" | |
| 1843 | "movhpd\0" | |
| 1844 | "???\0" | |
| 1845 | "movshdup", VAR_NAME4,PARAM_XMM, PARAM_XMMM, 0 } | |
| 1846 | }; | |
| 1847 | ||
| 1848 | 1813 | static const I386_OPCODE group0F18_table[8] = |
| 1849 | 1814 | { |
| 1850 | 1815 | {"prefetchnta", 0, PARAM_RM8, 0, 0 }, |
| r243192 | r243193 | |
| 1951 | 1916 | { "group0F00", group0F00_table }, |
| 1952 | 1917 | { "group0F01", group0F01_table }, |
| 1953 | 1918 | { "group0F0D", group0F0D_table }, |
| 1954 | { "group0F12", group0F12_table }, | |
| 1955 | { "group0F16", group0F16_table }, | |
| 1956 | 1919 | { "group0F18", group0F18_table }, |
| 1957 | 1920 | { "group0F71", group0F71_table }, |
| 1958 | 1921 | { "group0F72", group0F72_table }, |
| r243192 | r243193 | |
| 1991 | 1954 | |
| 1992 | 1955 | #define MODRM_REG1 ((modrm >> 3) & 0x7) |
| 1993 | 1956 | #define MODRM_REG2 (modrm & 0x7) |
| 1994 | #define MODRM_MOD ((modrm >> 6) & 0x3) | |
| 1995 | 1957 | |
| 1996 | 1958 | INLINE UINT8 FETCH(void) |
| 1997 | 1959 | { |
| r243192 | r243193 | |
| 2997 | 2959 | handle_modrm( modrm_string ); |
| 2998 | 2960 | for( i=0; i < ARRAY_LENGTH(group_op_table); i++ ) { |
| 2999 | 2961 | if( strcmp(op->mnemonic, group_op_table[i].mnemonic) == 0 ) { |
| 3000 | if (op->flags & GROUP_MOD) | |
| 3001 | decode_opcode( s, &group_op_table[i].opcode[MODRM_MOD], op1 ); | |
| 3002 | else | |
| 3003 | decode_opcode( s, &group_op_table[i].opcode[MODRM_REG1], op1 ); | |
| 2962 | decode_opcode( s, &group_op_table[i].opcode[MODRM_REG1], op1 ); | |
| 3004 | 2963 | return; |
| 3005 | 2964 | } |
| 3006 | 2965 | } |
| r243192 | r243193 | |
|---|---|---|
| 3330 | 3330 | ea = GetEA(modrm,1); |
| 3331 | 3331 | } |
| 3332 | 3332 | WRITE16(ea, m_gdtr.limit); |
| 3333 | WRITE32(ea + 2, m_gdtr.base); | |
| 3333 | WRITE32(ea + 2, m_gdtr.base & 0xffffff); | |
| 3334 | 3334 | CYCLES(CYCLES_SGDT); |
| 3335 | 3335 | break; |
| 3336 | 3336 | } |
| r243192 | r243193 | |
| 3346 | 3346 | ea = GetEA(modrm,1); |
| 3347 | 3347 | } |
| 3348 | 3348 | WRITE16(ea, m_idtr.limit); |
| 3349 | WRITE32(ea + 2, m_idtr.base); | |
| 3349 | WRITE32(ea + 2, m_idtr.base & 0xffffff); | |
| 3350 | 3350 | CYCLES(CYCLES_SIDT); |
| 3351 | 3351 | break; |
| 3352 | 3352 | } |
| r243192 | r243193 | |
|---|---|---|
| 2249 | 2249 | MMXPROLOG(); |
| 2250 | 2250 | UINT8 modrm = FETCH(); |
| 2251 | 2251 | if( modrm >= 0xc0 ) { |
| 2252 | MMX_REG ds, sd; | |
| 2253 | 2252 | int s,d; |
| 2254 | 2253 | s=modrm & 0x7; |
| 2255 | 2254 | d=(modrm >> 3) & 0x7; |
| 2256 | ds.q = MMX(d).q; | |
| 2257 | sd.q = MMX(s).q; | |
| 2258 | MMX(d).b[0]=SaturatedSignedWordToUnsignedByte(ds.s[0]); | |
| 2259 | MMX(d).b[1]=SaturatedSignedWordToUnsignedByte(ds.s[1]); | |
| 2260 | MMX(d).b[2]=SaturatedSignedWordToUnsignedByte(ds.s[2]); | |
| 2261 | MMX(d).b[3]=SaturatedSignedWordToUnsignedByte(ds.s[3]); | |
| 2262 | MMX(d).b[4]=SaturatedSignedWordToUnsignedByte(sd.s[0]); | |
| 2263 | MMX(d).b[5]=SaturatedSignedWordToUnsignedByte(sd.s[1]); | |
| 2264 | MMX(d).b[6]=SaturatedSignedWordToUnsignedByte(sd.s[2]); | |
| 2265 | MMX(d).b[7]=SaturatedSignedWordToUnsignedByte(sd.s[3]); | |
| 2255 | MMX(d).b[0]=SaturatedSignedWordToUnsignedByte(MMX(d).s[0]); | |
| 2256 | MMX(d).b[1]=SaturatedSignedWordToUnsignedByte(MMX(d).s[1]); | |
| 2257 | MMX(d).b[2]=SaturatedSignedWordToUnsignedByte(MMX(d).s[2]); | |
| 2258 | MMX(d).b[3]=SaturatedSignedWordToUnsignedByte(MMX(d).s[3]); | |
| 2259 | MMX(d).b[4]=SaturatedSignedWordToUnsignedByte(MMX(s).s[0]); | |
| 2260 | MMX(d).b[5]=SaturatedSignedWordToUnsignedByte(MMX(s).s[1]); | |
| 2261 | MMX(d).b[6]=SaturatedSignedWordToUnsignedByte(MMX(s).s[2]); | |
| 2262 | MMX(d).b[7]=SaturatedSignedWordToUnsignedByte(MMX(s).s[3]); | |
| 2266 | 2263 | } else { |
| 2267 | MMX_REG s | |
| 2264 | MMX_REG s; | |
| 2268 | 2265 | int d=(modrm >> 3) & 0x7; |
| 2269 | 2266 | UINT32 ea = GetEA(modrm, 0); |
| 2270 | 2267 | READMMX(ea, s); |
| 2271 | t.q = MMX(d).q; | |
| 2272 | MMX(d).b[0]=SaturatedSignedWordToUnsignedByte(t.s[0]); | |
| 2273 | MMX(d).b[1]=SaturatedSignedWordToUnsignedByte(t.s[1]); | |
| 2274 | MMX(d).b[2]=SaturatedSignedWordToUnsignedByte(t.s[2]); | |
| 2275 | MMX(d).b[3]=SaturatedSignedWordToUnsignedByte(t.s[3]); | |
| 2268 | MMX(d).b[0]=SaturatedSignedWordToUnsignedByte(MMX(d).s[0]); | |
| 2269 | MMX(d).b[1]=SaturatedSignedWordToUnsignedByte(MMX(d).s[1]); | |
| 2270 | MMX(d).b[2]=SaturatedSignedWordToUnsignedByte(MMX(d).s[2]); | |
| 2271 | MMX(d).b[3]=SaturatedSignedWordToUnsignedByte(MMX(d).s[3]); | |
| 2276 | 2272 | MMX(d).b[4]=SaturatedSignedWordToUnsignedByte(s.s[0]); |
| 2277 | 2273 | MMX(d).b[5]=SaturatedSignedWordToUnsignedByte(s.s[1]); |
| 2278 | 2274 | MMX(d).b[6]=SaturatedSignedWordToUnsignedByte(s.s[2]); |
| r243192 | r243193 | |
| 2366 | 2362 | UINT8 modrm = FETCH(); |
| 2367 | 2363 | if( modrm >= 0xc0 ) { |
| 2368 | 2364 | int s,d; |
| 2369 | INT32 t1, t2, t3, t4; | |
| 2370 | 2365 | s=modrm & 0x7; |
| 2371 | 2366 | d=(modrm >> 3) & 0x7; |
| 2372 | t1 = MMX(d).i[0]; | |
| 2373 | t2 = MMX(d).i[1]; | |
| 2374 | t3 = MMX(s).i[0]; | |
| 2375 | t4 = MMX(s).i[1]; | |
| 2376 | MMX(d).s[0] = SaturatedSignedDwordToSignedWord(t1); | |
| 2377 | MMX(d).s[1] = SaturatedSignedDwordToSignedWord(t2); | |
| 2378 | MMX(d).s[2] = SaturatedSignedDwordToSignedWord(t3); | |
| 2379 | MMX(d).s[3] = SaturatedSignedDwordToSignedWord(t4); | |
| 2380 | } | |
| 2381 | else { | |
| 2367 | MMX(d).s[0]=SaturatedSignedDwordToSignedWord(MMX(d).i[0]); | |
| 2368 | MMX(d).s[1]=SaturatedSignedDwordToSignedWord(MMX(d).i[1]); | |
| 2369 | MMX(d).s[2]=SaturatedSignedDwordToSignedWord(MMX(s).i[0]); | |
| 2370 | MMX(d).s[3]=SaturatedSignedDwordToSignedWord(MMX(s).i[1]); | |
| 2371 | } else { | |
| 2382 | 2372 | MMX_REG s; |
| 2383 | INT32 t1, t2; | |
| 2384 | 2373 | int d=(modrm >> 3) & 0x7; |
| 2385 | 2374 | UINT32 ea = GetEA(modrm, 0); |
| 2386 | 2375 | READMMX(ea, s); |
| 2387 | t1 = MMX(d).i[0]; | |
| 2388 | t2 = MMX(d).i[1]; | |
| 2389 | MMX(d).s[0] = SaturatedSignedDwordToSignedWord(t1); | |
| 2390 | MMX(d).s[1] = SaturatedSignedDwordToSignedWord(t2); | |
| 2391 | MMX(d).s[2] = SaturatedSignedDwordToSignedWord(s.i[0]); | |
| 2392 | MMX(d).s[3] = SaturatedSignedDwordToSignedWord(s.i[1]); | |
| 2376 | MMX(d).s[0]=SaturatedSignedDwordToSignedWord(MMX(d).i[0]); | |
| 2377 | MMX(d).s[1]=SaturatedSignedDwordToSignedWord(MMX(d).i[1]); | |
| 2378 | MMX(d).s[2]=SaturatedSignedDwordToSignedWord(s.i[0]); | |
| 2379 | MMX(d).s[3]=SaturatedSignedDwordToSignedWord(s.i[1]); | |
| 2393 | 2380 | } |
| 2394 | 2381 | CYCLES(1); // TODO: correct cycle count |
| 2395 | 2382 | } |
| r243192 | r243193 | |
| 2724 | 2711 | { |
| 2725 | 2712 | UINT8 modrm = FETCH(); |
| 2726 | 2713 | if( modrm >= 0xc0 ) { |
| 2727 | // MOVHLPS opcode | |
| 2728 | XMM((modrm >> 3) & 0x7).q[0] = XMM(modrm & 0x7).q[1]; | |
| 2714 | // unsupported by cpu | |
| 2729 | 2715 | CYCLES(1); // TODO: correct cycle count |
| 2730 | 2716 | } else { |
| 2731 | // MOVLPS opcode | |
| 2732 | 2717 | UINT32 ea = GetEA(modrm, 0); |
| 2733 | 2718 | READXMM_LO64(ea, XMM((modrm >> 3) & 0x7)); |
| 2734 | 2719 | CYCLES(1); // TODO: correct cycle count |
| r243192 | r243193 | |
| 2752 | 2737 | { |
| 2753 | 2738 | UINT8 modrm = FETCH(); |
| 2754 | 2739 | if( modrm >= 0xc0 ) { |
| 2755 | // MOVLHPS opcode | |
| 2756 | XMM((modrm >> 3) & 0x7).q[1] = XMM(modrm & 0x7).q[0]; | |
| 2740 | // unsupported by cpu | |
| 2757 | 2741 | CYCLES(1); // TODO: correct cycle count |
| 2758 | 2742 | } else { |
| 2759 | // MOVHPS opcode | |
| 2760 | 2743 | UINT32 ea = GetEA(modrm, 0); |
| 2761 | 2744 | READXMM_HI64(ea, XMM((modrm >> 3) & 0x7)); |
| 2762 | 2745 | CYCLES(1); // TODO: correct cycle count |
| r243192 | r243193 | |
| 3384 | 3367 | CYCLES(1); // TODO: correct cycle count |
| 3385 | 3368 | } |
| 3386 | 3369 | |
| 3387 | void i386_device::sse_shufps() // Opcode 0f | |
| 3370 | void i386_device::sse_shufps() // Opcode 0f 67 | |
| 3388 | 3371 | { |
| 3389 | 3372 | UINT8 modrm = FETCH(); |
| 3390 | 3373 | UINT8 sel = FETCH(); |
| r243192 | r243193 | |
| 3397 | 3380 | s=modrm & 0x7; |
| 3398 | 3381 | d=(modrm >> 3) & 0x7; |
| 3399 | 3382 | if( modrm >= 0xc0 ) { |
| 3400 | UINT32 t1,t2,t3,t4; | |
| 3401 | t1=XMM(d).d[m1]; | |
| 3402 | t2=XMM(d).d[m2]; | |
| 3403 | t3=XMM(s).d[m3]; | |
| 3404 | t4=XMM(s).d[m4]; | |
| 3405 | XMM(d).d[0]=t1; | |
| 3406 | XMM(d).d[1]=t2; | |
| 3407 | XMM(d).d[2]=t3; | |
| 3408 | XMM(d).d[3]=t4; | |
| 3383 | UINT32 t; | |
| 3384 | t=XMM(d).d[m1]; | |
| 3385 | XMM(d).d[1]=XMM(d).d[m2]; | |
| 3386 | XMM(d).d[0]=t; | |
| 3387 | XMM(d).d[2]=XMM(s).d[m3]; | |
| 3388 | XMM(d).d[3]=XMM(s).d[m4]; | |
| 3409 | 3389 | } else { |
| 3410 | UINT32 t | |
| 3390 | UINT32 t; | |
| 3411 | 3391 | XMM_REG src; |
| 3412 | 3392 | UINT32 ea = GetEA(modrm, 0); |
| 3413 | 3393 | READXMM(ea, src); |
| 3414 | t1=XMM(d).d[m1]; | |
| 3415 | t2=XMM(d).d[m2]; | |
| 3416 | XMM(d).d[0]=t1; | |
| 3417 | XMM(d).d[1]=t2; | |
| 3394 | t=XMM(d).d[m1]; | |
| 3395 | XMM(d).d[1]=XMM(d).d[m2]; | |
| 3396 | XMM(d).d[0]=t; | |
| 3418 | 3397 | XMM(d).d[2]=src.d[m3]; |
| 3419 | 3398 | XMM(d).d[3]=src.d[m4]; |
| 3420 | 3399 | } |
| r243192 | r243193 | |
| 3425 | 3404 | { |
| 3426 | 3405 | UINT8 modrm = FETCH(); |
| 3427 | 3406 | int s,d; |
| 3428 | UINT32 t1, t2, t3, t4; | |
| 3429 | 3407 | s=modrm & 0x7; |
| 3430 | 3408 | d=(modrm >> 3) & 0x7; |
| 3431 | 3409 | if( modrm >= 0xc0 ) { |
| 3432 | t1 = XMM(s).d[1]; | |
| 3433 | t2 = XMM(d).d[1]; | |
| 3434 | t3 = XMM(s).d[0]; | |
| 3435 | t4 = XMM(d).d[0]; | |
| 3436 | XMM(d).d[3]=t1; | |
| 3437 | XMM(d).d[2]=t2; | |
| 3438 | XMM(d).d[1]=t3; | |
| 3439 | XMM(d).d[0]=t4; | |
| 3410 | XMM(d).d[3]=XMM(s).d[1]; | |
| 3411 | XMM(d).d[2]=XMM(d).d[1]; | |
| 3412 | XMM(d).d[1]=XMM(s).d[0]; | |
| 3413 | //XMM(d).d[0]=XMM(d).d[0]; | |
| 3440 | 3414 | } else { |
| 3441 | 3415 | XMM_REG src; |
| 3442 | 3416 | UINT32 ea = GetEA(modrm, 0); |
| 3443 | 3417 | READXMM(ea, src); |
| 3444 | t2 = XMM(d).d[1]; | |
| 3445 | 3418 | XMM(d).d[3]=src.d[1]; |
| 3446 | XMM(d).d[2]= | |
| 3419 | XMM(d).d[2]=XMM(d).d[1]; | |
| 3447 | 3420 | XMM(d).d[1]=src.d[0]; |
| 3448 | 3421 | } |
| 3449 | 3422 | CYCLES(1); // TODO: correct cycle count |
| r243192 | r243193 | |
| 3453 | 3426 | { |
| 3454 | 3427 | UINT8 modrm = FETCH(); |
| 3455 | 3428 | int s,d; |
| 3456 | UINT32 t1, t2, t3, t4; | |
| 3457 | 3429 | s=modrm & 0x7; |
| 3458 | 3430 | d=(modrm >> 3) & 0x7; |
| 3459 | 3431 | if( modrm >= 0xc0 ) { |
| 3460 | t1 = XMM(d).d[2]; | |
| 3461 | t2 = XMM(s).d[2]; | |
| 3462 | t3 = XMM(d).d[3]; | |
| 3463 | t4 = XMM(s).d[3]; | |
| 3464 | XMM(d).d[0]=t1; | |
| 3465 | XMM(d).d[1]=t2; | |
| 3466 | XMM(d).d[2]=t3; | |
| 3467 | XMM(d).d[3]=t4; | |
| 3432 | XMM(d).d[0]=XMM(d).d[2]; | |
| 3433 | XMM(d).d[1]=XMM(s).d[2]; | |
| 3434 | XMM(d).d[2]=XMM(d).d[3]; | |
| 3435 | XMM(d).d[3]=XMM(s).d[3]; | |
| 3468 | 3436 | } else { |
| 3469 | 3437 | XMM_REG src; |
| 3470 | 3438 | UINT32 ea = GetEA(modrm, 0); |
| 3471 | 3439 | READXMM(ea, src); |
| 3472 | t1 = XMM(d).d[2]; | |
| 3473 | t3 = XMM(d).d[3]; | |
| 3474 | XMM(d).d[0]=t1; | |
| 3440 | XMM(d).d[0]=XMM(d).d[2]; | |
| 3475 | 3441 | XMM(d).d[1]=src.d[2]; |
| 3476 | XMM(d).d[2]= | |
| 3442 | XMM(d).d[2]=XMM(d).d[3]; | |
| 3477 | 3443 | XMM(d).d[3]=src.d[3]; |
| 3478 | 3444 | } |
| 3479 | 3445 | CYCLES(1); // TODO: correct cycle count |
| r243192 | r243193 | |
|---|---|---|
| 272 | 272 | extern void m68040_fpu_op0(m68000_base_device *m68k); |
| 273 | 273 | extern void m68040_fpu_op1(m68000_base_device *m68k); |
| 274 | 274 | extern void m68881_mmu_ops(m68000_base_device *m68k); |
| 275 | extern void m68881_ftrap(m68000_base_device *m68k); | |
| 275 | extern void m68881_ftrap(m68000_base_device *m68k); | |
| 276 | 276 | |
| 277 | 277 | /* ======================================================================== */ |
| 278 | 278 | /* ========================= INSTRUCTION HANDLERS ========================= */ |
| r243192 | r243193 | |
|---|---|---|
| 699 | 699 | { |
| 700 | 700 | /* only the 68010 throws this unique type-1000 frame */ |
| 701 | 701 | m68ki_stack_frame_1000(m68k, REG_PPC(m68k), sr, EXCEPTION_BUS_ERROR); |
| 702 | } | |
| 702 | } | |
| 703 | 703 | else if (m68k->mmu_tmp_buserror_address == REG_PPC(m68k)) |
| 704 | 704 | { |
| 705 | 705 | m68ki_stack_frame_1010(m68k, sr, EXCEPTION_BUS_ERROR, REG_PPC(m68k), m68k->mmu_tmp_buserror_address); |
| r243192 | r243193 | |
|---|---|---|
| 32 | 32 | |
| 33 | 33 | #include <limits.h> |
| 34 | 34 | |
| 35 | #ifdef SDLMAME_SOLARIS | |
| 36 | #undef REG_SP | |
| 37 | #undef REG_PC | |
| 38 | #undef REG_FP | |
| 39 | #endif | |
| 40 | 35 | |
| 41 | 36 | /* ======================================================================== */ |
| 42 | 37 | /* ==================== ARCHITECTURE-DEPENDANT DEFINES ==================== */ |
| r243192 | r243193 | |
|---|---|---|
| 2177 | 2177 | // trap here |
| 2178 | 2178 | m68ki_exception_trap(m68k, EXCEPTION_TRAPV); |
| 2179 | 2179 | } |
| 2180 | else | |
| 2180 | else // fall through, requires eating the operand | |
| 2181 | 2181 | { |
| 2182 | 2182 | switch (m68k->ir & 0x7) |
| 2183 | 2183 | { |
| 2184 | case 2: | |
| 2184 | case 2: // word operand | |
| 2185 | 2185 | OPER_I_16(m68k); |
| 2186 | 2186 | break; |
| 2187 | 2187 | |
| r243192 | r243193 | |
| 2189 | 2189 | OPER_I_32(m68k); |
| 2190 | 2190 | break; |
| 2191 | 2191 | |
| 2192 | case 4: | |
| 2192 | case 4: // no operand | |
| 2193 | 2193 | break; |
| 2194 | 2194 | } |
| 2195 | 2195 | } |
| 2196 | 2196 | } |
| 2197 |
| r243192 | r243193 | |
|---|---|---|
| 1 | 1 | #!/usr/bin/python |
| 2 | 2 | |
| 3 | 3 | import sys |
| 4 | import logging | |
| 5 | import fileinput | |
| 4 | 6 | import re |
| 5 | 7 | |
| 6 | 8 | # Initial state |
| r243192 | r243193 | |
|---|---|---|
| 175 | 175 | try: |
| 176 | 176 | f = open(argv[3], "w") |
| 177 | 177 | except Exception, err: |
| 178 | | |
| 178 | logging.error("cannot write file %s [%s]", fname, err) | |
| 179 | 179 | sys.exit(1) |
| 180 | 180 | |
| 181 | 181 | if t != "mcs96": |
| r243192 | r243193 | |
|---|---|---|
| 1013 | 1013 | an exception if out |
| 1014 | 1014 | -------------------------------------------------*/ |
| 1015 | 1015 | |
| 1016 | void mips3_device::generate_update_cycles(drcuml_block *block, compiler_state *compiler, | |
| 1016 | void mips3_device::generate_update_cycles(drcuml_block *block, compiler_state *compiler, parameter param, int allow_exception) | |
| 1017 | 1017 | { |
| 1018 | 1018 | /* check software interrupts if pending */ |
| 1019 | 1019 | if (compiler->checksoftints) |
| r243192 | r243193 | |
|---|---|---|
| 693 | 693 | m_hotspot_select = 0; |
| 694 | 694 | memset(m_hotspot, 0, sizeof(m_hotspot)); |
| 695 | 695 | |
| 696 | m_debugger_temp = 0; | |
| 697 | ||
| 698 | 696 | m_cache_line_size = 32; |
| 699 | 697 | m_cpu_clock = clock(); |
| 700 | 698 | m_program = &space(AS_PROGRAM); |
| r243192 | r243193 | |
|---|---|---|
| 57 | 57 | ***************************************************************************/ |
| 58 | 58 | |
| 59 | 59 | #define R32(reg) m_regmap[reg] |
| 60 | #define R32Z(reg) (((reg) == 0) ? | |
| 60 | #define R32Z(reg) (((reg) == 0) ? parameter(0) : m_regmap[reg]) | |
| 61 | 61 | #define F64(reg) m_fdregmap[reg] |
| 62 | 62 | #define CR32(reg) mem(&m_core->cr[reg]) |
| 63 | 63 | #define FPSCR32 mem(&m_core->fpscr) |
| r243192 | r243193 | |
| 1549 | 1549 | an exception if out |
| 1550 | 1550 | -------------------------------------------------*/ |
| 1551 | 1551 | |
| 1552 | void ppc_device::generate_update_cycles(drcuml_block *block, compiler_state *compiler, | |
| 1552 | void ppc_device::generate_update_cycles(drcuml_block *block, compiler_state *compiler, parameter param, int allow_exception) | |
| 1553 | 1553 | { |
| 1554 | 1554 | /* check full interrupts if pending */ |
| 1555 | 1555 | if (compiler->checkints) |
| r243192 | r243193 | |
|---|---|---|
| 641 | 641 | subtract cycles from the icount and generate |
| 642 | 642 | an exception if out |
| 643 | 643 | -------------------------------------------------*/ |
| 644 | void rsp_device::generate_update_cycles(drcuml_block *block, compiler_state *compiler, | |
| 644 | void rsp_device::generate_update_cycles(drcuml_block *block, compiler_state *compiler, parameter param, int allow_exception) | |
| 645 | 645 | { |
| 646 | 646 | /* account for cycles */ |
| 647 | 647 | if (compiler->cycles > 0) |
| r243192 | r243193 | |
|---|---|---|
| 91 | 91 | { |
| 92 | 92 | if (m_regmap[regnum].is_int_register()) |
| 93 | 93 | { |
| 94 | UML_MOV(block, | |
| 94 | UML_MOV(block, parameter::make_ireg(m_regmap[regnum].ireg()), mem(&m_sh2_state->r[regnum])); | |
| 95 | 95 | } |
| 96 | 96 | } |
| 97 | 97 | } |
| r243192 | r243193 | |
| 110 | 110 | { |
| 111 | 111 | if (m_regmap[regnum].is_int_register()) |
| 112 | 112 | { |
| 113 | UML_MOV(block, mem(&m_sh2_state->r[regnum]), | |
| 113 | UML_MOV(block, mem(&m_sh2_state->r[regnum]), parameter::make_ireg(m_regmap[regnum].ireg())); | |
| 114 | 114 | } |
| 115 | 115 | } |
| 116 | 116 | } |
| r243192 | r243193 | |
| 1220 | 1220 | subtract cycles from the icount and generate |
| 1221 | 1221 | an exception if out |
| 1222 | 1222 | -------------------------------------------------*/ |
| 1223 | void sh2_device::generate_update_cycles(drcuml_block *block, compiler_state *compiler, | |
| 1223 | void sh2_device::generate_update_cycles(drcuml_block *block, compiler_state *compiler, parameter param, int allow_exception) | |
| 1224 | 1224 | { |
| 1225 | 1225 | /* check full interrupts if pending */ |
| 1226 | 1226 | if (compiler->checkints) |
| r243192 | r243193 | |
|---|---|---|
| 429 | 429 | m_sr = 0; |
| 430 | 430 | m_pa = 0; |
| 431 | 431 | m_pb = 0; |
| 432 | m_ps = 0; | |
| 433 | 432 | m_a = 0; |
| 434 | 433 | m_x = 0; |
| 435 | 434 | m_y = 0; |
| r243192 | r243193 | |
| 467 | 466 | save_item(NAME(m_sr)); |
| 468 | 467 | save_item(NAME(m_pa)); |
| 469 | 468 | save_item(NAME(m_pb)); |
| 470 | save_item(NAME(m_ps)); | |
| 471 | 469 | save_item(NAME(m_a)); |
| 472 | 470 | save_item(NAME(m_x)); |
| 473 | 471 | save_item(NAME(m_y)); |
| r243192 | r243193 | |
| 638 | 636 | tms1100_cpu_device::device_reset(); |
| 639 | 637 | |
| 640 | 638 | // small differences in 00-3f area |
| 639 | m_fixed_decode[0x09] = F_COMX; // ! | |
| 641 | 640 | m_fixed_decode[0x0b] = F_TPC; |
| 642 | 641 | } |
| 643 | 642 | |
| r243192 | r243193 | |
| 959 | 958 | //------------------------------------------------- |
| 960 | 959 | |
| 961 | 960 | // handle branches: |
| 962 | ||
| 963 | // TMS1000/common | |
| 964 | 961 | // note: add(latch) and bl(branch latch) are specific to 0980 series, |
| 965 | 962 | // c(chapter) bits are specific to 1100(and 1400) series |
| 966 | 963 | |
| 964 | // TMS1000/common: | |
| 965 | ||
| 967 | 966 | void tms1xxx_cpu_device::op_br() |
| 968 | 967 | { |
| 969 | 968 | // BR/BL: conditional branch |
| 970 | if (m_status) | |
| 971 | { | |
| 972 | if (m_clatch == 0) | |
| 973 | m_pa = m_pb; | |
| 974 | m_ca = m_cb; | |
| 975 | m_pc = m_opcode & m_pc_mask; | |
| 976 | } | |
| 969 | if (!m_status) | |
| 970 | return; | |
| 971 | ||
| 972 | if (!m_clatch) | |
| 973 | m_pa = m_pb; | |
| 974 | m_ca = m_cb; | |
| 975 | m_pc = m_opcode & m_pc_mask; | |
| 977 | 976 | } |
| 978 | 977 | |
| 979 | 978 | void tms1xxx_cpu_device::op_call() |
| 980 | 979 | { |
| 981 | 980 | // CALL/CALLL: conditional call |
| 982 | if (m_status) | |
| 983 | { | |
| 984 | UINT8 prev_pa = m_pa; | |
| 981 | if (!m_status) | |
| 982 | return; | |
| 985 | 983 | |
| 986 | if (m_clatch == 0) | |
| 987 | { | |
| 988 | m_clatch = 1; | |
| 989 | m_sr = m_pc; | |
| 990 | m_pa = m_pb; | |
| 991 | m_cs = m_ca; | |
| 992 | } | |
| 993 | m_ca = m_cb; | |
| 994 | m_pb = prev_pa; | |
| 995 | m_pc = m_opcode & m_pc_mask; | |
| 984 | UINT8 prev_pa = m_pa; | |
| 985 | if (!m_clatch) | |
| 986 | { | |
| 987 | m_sr = m_pc; | |
| 988 | m_clatch = 1; | |
| 989 | m_pa = m_pb; | |
| 990 | m_cs = m_ca; | |
| 996 | 991 | } |
| 992 | m_ca = m_cb; | |
| 993 | m_pb = prev_pa; | |
| 994 | m_pc = m_opcode & m_pc_mask; | |
| 997 | 995 | } |
| 998 | 996 | |
| 999 | 997 | void tms1xxx_cpu_device::op_retn() |
| 1000 | 998 | { |
| 1001 | 999 | // RETN: return from subroutine |
| 1002 | if (m_clatch | |
| 1000 | if (m_clatch) | |
| 1003 | 1001 | { |
| 1004 | m_clatch = 0; | |
| 1005 | 1002 | m_pc = m_sr; |
| 1003 | m_clatch = 0; | |
| 1006 | 1004 | m_ca = m_cs; |
| 1007 | 1005 | } |
| 1008 | 1006 | m_add = 0; |
| r243192 | r243193 | |
| 1016 | 1014 | void tms1400_cpu_device::op_br() |
| 1017 | 1015 | { |
| 1018 | 1016 | // BR/BL: conditional branch |
| 1019 | if (m_status) | |
| 1020 | { | |
| 1021 | m_pa = m_pb; // don't care about clatch | |
| 1022 | m_ca = m_cb; | |
| 1023 | m_pc = m_opcode & m_pc_mask; | |
| 1024 | } | |
| 1017 | if (!m_status) | |
| 1018 | return; | |
| 1019 | ||
| 1020 | //.. | |
| 1025 | 1021 | } |
| 1026 | 1022 | |
| 1027 | 1023 | void tms1400_cpu_device::op_call() |
| 1028 | 1024 | { |
| 1029 | 1025 | // CALL/CALLL: conditional call |
| 1030 | if (m_status) | |
| 1031 | { | |
| 1032 | // 3-level stack, mask clatch 3 bits (no need to mask others) | |
| 1033 | m_clatch = (m_clatch << 1 | 1) & 7; | |
| 1026 | if (!m_status) | |
| 1027 | return; | |
| 1034 | 1028 | |
| 1035 | m_sr = m_sr << m_pc_bits | m_pc; | |
| 1036 | m_pc = m_opcode & m_pc_mask; | |
| 1037 | ||
| 1038 | m_ps = m_ps << 4 | m_pa; | |
| 1039 | m_pa = m_pb; | |
| 1040 | ||
| 1041 | m_cs = m_cs << 2 | m_ca; | |
| 1042 | m_ca = m_cb; | |
| 1043 | } | |
| 1044 | else | |
| 1045 | { | |
| 1046 | m_pb = m_pa; | |
| 1047 | m_cb = m_ca; | |
| 1048 | } | |
| 1029 | //.. | |
| 1049 | 1030 | } |
| 1050 | 1031 | |
| 1051 | 1032 | void tms1400_cpu_device::op_retn() |
| 1052 | 1033 | { |
| 1053 | 1034 | // RETN: return from subroutine |
| 1054 | if (m_clatch & 1) | |
| 1055 | { | |
| 1056 | m_clatch >>= 1; | |
| 1057 | ||
| 1058 | m_pc = m_sr & m_pc_mask; | |
| 1059 | m_sr >>= m_pc_bits; | |
| 1060 | ||
| 1061 | m_pa = m_pb = m_ps & 0xf; | |
| 1062 | m_ps >>= 4; | |
| 1063 | ||
| 1064 | m_ca = m_cb = m_cs & 3; | |
| 1065 | m_cs >>= 2; | |
| 1066 | } | |
| 1035 | //.. | |
| 1067 | 1036 | } |
| 1068 | 1037 | |
| 1069 | 1038 | |
| 1070 | 1039 | // handle other: |
| 1071 | 1040 | |
| 1072 | // TMS1000/common | |
| 1041 | // TMS1000/common: | |
| 1073 | 1042 | |
| 1074 | 1043 | void tms1xxx_cpu_device::op_sbit() |
| 1075 | 1044 | { |
| r243192 | r243193 | |
| 1189 | 1158 | |
| 1190 | 1159 | |
| 1191 | 1160 | // TMS0980-specific (and possibly child classes) |
| 1192 | ||
| 1193 | 1161 | void tms0980_cpu_device::op_comx() |
| 1194 | 1162 | { |
| 1195 | 1163 | // COMX: complement X register, but not the MSB |
| r243192 | r243193 | |
| 1235 | 1203 | |
| 1236 | 1204 | |
| 1237 | 1205 | // TMS0270-specific |
| 1238 | ||
| 1239 | 1206 | void tms0270_cpu_device::op_setr() |
| 1240 | 1207 | { |
| 1241 | 1208 | // same as default, but handle write to output in dynamic_output |
| r243192 | r243193 | |
|---|---|---|
| 139 | 139 | optional_device<pla_device> m_spla; |
| 140 | 140 | |
| 141 | 141 | UINT8 m_pc; // 6 or 7-bit program counter |
| 142 | UINT | |
| 142 | UINT8 m_sr; // 6 or 7-bit subroutine return register | |
| 143 | 143 | UINT8 m_pa; // 4-bit page address register |
| 144 | 144 | UINT8 m_pb; // 4-bit page buffer register |
| 145 | UINT16 m_ps; // 4-bit page subroutine register(s) | |
| 146 | 145 | UINT8 m_a; // 4-bit accumulator |
| 147 | 146 | UINT8 m_x; // 2,3,or 4-bit RAM X register |
| 148 | 147 | UINT8 m_y; // 4-bit RAM Y register |
| 149 | UINT8 m_ca; // chapter address register | |
| 150 | UINT8 m_cb; // chapter buffer register | |
| 151 | UINT16 m_cs; // chapter subroutine register(s) | |
| 148 | UINT8 m_ca; // chapter address bit | |
| 149 | UINT8 m_cb; // chapter buffer bit | |
| 150 | UINT8 m_cs; // chapter subroutine bit | |
| 152 | 151 | UINT16 m_r; |
| 153 | 152 | UINT16 m_o; |
| 154 | 153 | UINT8 m_cki_bus; |
| r243192 | r243193 | |
| 161 | 160 | UINT8 m_status; |
| 162 | 161 | UINT8 m_status_latch; |
| 163 | 162 | UINT8 m_eac; // end around carry bit |
| 164 | UINT8 m_clatch; // call latch bit | |
| 163 | UINT8 m_clatch; // call latch bit | |
| 165 | 164 | UINT8 m_add; // add latch bit |
| 166 | 165 | UINT8 m_bl; // branch latch bit |
| 167 | 166 |
| r243192 | r243193 | |
|---|---|---|
| 417 | 417 | try: |
| 418 | 418 | f = open(sys.argv[2], "w") |
| 419 | 419 | except Exception, err: |
| 420 | | |
| 420 | logging.error("cannot write file %s [%s]", fname, err) | |
| 421 | 421 | sys.exit(1) |
| 422 | 422 | |
| 423 | 423 | EmitDasm(f, ins_list) |
| r243192 | r243193 | |
|---|---|---|
| 114 | 114 | |
| 115 | 115 | void finder_base::printf_warning(const char *format, ...) |
| 116 | 116 | { |
| 117 | va_list argptr; | |
| 118 | char buffer[1024]; | |
| 117 | va_list argptr; | |
| 118 | char buffer[1024]; | |
| 119 | 119 | |
| 120 | /* do the output */ | |
| 121 | va_start(argptr, format); | |
| 122 | vsnprintf(buffer, 1024, format, argptr); | |
| 123 | osd_printf_warning("%s", buffer); | |
| 124 | va_end(argptr); | |
| 120 | /* do the output */ | |
| 121 | va_start(argptr, format); | |
| 122 | vsnprintf(buffer, 1024, format, argptr); | |
| 123 | osd_printf_warning("%s", buffer); | |
| 124 | va_end(argptr); | |
| 125 | 125 | } |
| r243192 | r243193 | |
|---|---|---|
| 57 | 57 | void *find_memshare(UINT8 width, size_t &bytes, bool required); |
| 58 | 58 | bool report_missing(bool found, const char *objname, bool required); |
| 59 | 59 | |
| 60 | ||
| 60 | void printf_warning(const char *format, ...) ATTR_PRINTF(2,3); | |
| 61 | 61 | |
| 62 | 62 | // internal state |
| 63 | 63 | finder_base *m_next; |
| r243192 | r243193 | |
|---|---|---|
| 186 | 186 | |
| 187 | 187 | |
| 188 | 188 | //------------------------------------------------- |
| 189 | // ioport - return a pointer to the I/O port | |
| 190 | // object for a given port name | |
| 191 | //------------------------------------------------- | |
| 192 | ||
| 193 | astring device_t::parameter(const char *tag) const | |
| 194 | { | |
| 195 | // safety first | |
| 196 | if (this == NULL) | |
| 197 | return NULL; | |
| 198 | ||
| 199 | // build a fully-qualified name and look it up | |
| 200 | astring fullpath; | |
| 201 | return machine().parameters().lookup(subtag(fullpath, tag)); | |
| 202 | } | |
| 203 | ||
| 204 | ||
| 205 | //------------------------------------------------- | |
| 206 | 189 | // static_set_clock - set/change the clock on |
| 207 | 190 | // a device |
| 208 | 191 | //------------------------------------------------- |
| r243192 | r243193 | |
|---|---|---|
| 130 | 130 | UINT8 default_bios() const { return m_default_bios; } |
| 131 | 131 | UINT8 system_bios() const { return m_system_bios; } |
| 132 | 132 | astring default_bios_tag() const { return m_default_bios_tag; } |
| 133 | astring parameter(const char *tag) const; | |
| 134 | 133 | |
| 135 | 134 | // interface helpers |
| 136 | 135 | device_interface *first_interface() const { return m_interface_list; } |
| r243192 | r243193 | |
|---|---|---|
| 49 | 49 | // device_state_entry - constructor |
| 50 | 50 | //------------------------------------------------- |
| 51 | 51 | |
| 52 | device_state_entry::device_state_entry(int index, const char *symbol, void *dataptr, UINT8 size, device_state_interface *dev) | |
| 53 | : m_device_state(dev), | |
| 54 | m_next(NULL), | |
| 52 | device_state_entry::device_state_entry(int index, const char *symbol, void *dataptr, UINT8 size) | |
| 53 | : m_next(NULL), | |
| 55 | 54 | m_index(index), |
| 56 | 55 | m_dataptr(dataptr), |
| 57 | 56 | m_datamask(0), |
| r243192 | r243193 | |
| 87 | 86 | m_symbol.cpy("CURFLAGS"); |
| 88 | 87 | } |
| 89 | 88 | |
| 90 | device_state_entry::device_state_entry(int index, device_state_interface *dev) | |
| 91 | : m_device_state(dev), | |
| 92 | m_next(NULL), | |
| 89 | device_state_entry::device_state_entry(int index) | |
| 90 | : m_next(NULL), | |
| 93 | 91 | m_index(index), |
| 94 | 92 | m_dataptr(NULL), |
| 95 | 93 | m_datamask(0), |
| r243192 | r243193 | |
| 525 | 523 | assert(symbol != NULL); |
| 526 | 524 | |
| 527 | 525 | // allocate new entry |
| 528 | device_state_entry *entry = global_alloc(device_state_entry(index, symbol, data, size | |
| 526 | device_state_entry *entry = global_alloc(device_state_entry(index, symbol, data, size)); | |
| 529 | 527 | |
| 530 | 528 | // append to the end of the list |
| 531 | 529 | m_state_list.append(*entry); |
| r243192 | r243193 | |
| 545 | 543 | device_state_entry &device_state_interface::state_add_divider(int index) |
| 546 | 544 | { |
| 547 | 545 | // allocate new entry |
| 548 | device_state_entry *entry = global_alloc(device_state_entry(index | |
| 546 | device_state_entry *entry = global_alloc(device_state_entry(index)); | |
| 549 | 547 | |
| 550 | 548 | // append to the end of the list |
| 551 | 549 | m_state_list.append(*entry); |
| r243192 | r243193 | |
|---|---|---|
| 45 | 45 | { |
| 46 | 46 | friend class device_state_interface; |
| 47 | 47 | friend class simple_list<device_state_entry>; |
| 48 | friend class lua_engine; | |
| 48 | 49 | |
| 49 | 50 | private: |
| 50 | 51 | // construction/destruction |
| 51 | device_state_entry(int index, const char *symbol, void *dataptr, UINT8 size, device_state_interface *dev); | |
| 52 | device_state_entry(int index, device_state_interface *dev); | |
| 52 | device_state_entry(int index, const char *symbol, void *dataptr, UINT8 size); | |
| 53 | device_state_entry(int index); | |
| 53 | 54 | |
| 54 | 55 | public: |
| 55 | 56 | // post-construction modifiers |
| r243192 | r243193 | |
| 69 | 70 | const char *symbol() const { return m_symbol; } |
| 70 | 71 | bool visible() const { return ((m_flags & DSF_NOSHOW) == 0); } |
| 71 | 72 | bool divider() const { return m_flags & DSF_DIVIDER; } |
| 72 | device_state_interface *parent_state() const {return m_device_state;} | |
| 73 | 73 | |
| 74 | 74 | protected: |
| 75 | 75 | // device state flags |
| r243192 | r243193 | |
| 98 | 98 | static const UINT64 k_decimal_divisor[20]; // divisors for outputting decimal values |
| 99 | 99 | |
| 100 | 100 | // public state description |
| 101 | device_state_interface *m_device_state; // link to parent device state | |
| 102 | 101 | device_state_entry * m_next; // link to next item |
| 103 | 102 | UINT32 m_index; // index by which this item is referred |
| 104 | 103 | generic_ptr m_dataptr; // pointer to where the data lives |
| r243192 | r243193 | |
|---|---|---|
| 82 | 82 | // machine and driver configuration |
| 83 | 83 | #include "mconfig.h" |
| 84 | 84 | #include "gamedrv.h" |
| 85 | #include "parameters.h" | |
| 86 | 85 | |
| 87 | 86 | // timers, CPU and scheduling |
| 88 | 87 | #include "devcpu.h" |
| r243192 | r243193 | |
|---|---|---|
| 99 | 99 | $(EMUOBJ)/memarray.o \ |
| 100 | 100 | $(EMUOBJ)/memory.o \ |
| 101 | 101 | $(EMUOBJ)/network.o \ |
| 102 | $(EMUOBJ)/parameters.o \ | |
| 103 | 102 | $(EMUOBJ)/output.o \ |
| 104 | 103 | $(EMUOBJ)/render.o \ |
| 105 | 104 | $(EMUOBJ)/rendfont.o \ |
| r243192 | r243193 | |
| 121 | 120 | $(EMUOBJ)/ui/mainmenu.o \ |
| 122 | 121 | $(EMUOBJ)/ui/miscmenu.o \ |
| 123 | 122 | $(EMUOBJ)/ui/barcode.o \ |
| 124 | $(EMUOBJ)/ui/cheatopt.o \ | |
| 125 | 123 | $(EMUOBJ)/ui/devopt.o \ |
| 126 | 124 | $(EMUOBJ)/ui/filemngr.o \ |
| 127 | 125 | $(EMUOBJ)/ui/filesel.o \ |
| 128 | 126 | $(EMUOBJ)/ui/imgcntrl.o \ |
| 129 | $(EMUOBJ)/ui/info.o \ | |
| 127 | $(EMUOBJ)/ui/imginfo.o \ | |
| 130 | 128 | $(EMUOBJ)/ui/inputmap.o \ |
| 131 | 129 | $(EMUOBJ)/ui/selgame.o \ |
| 132 | $(EMUOBJ)/ui/sliders.o \ | |
| 133 | 130 | $(EMUOBJ)/ui/slotopt.o \ |
| 134 | 131 | $(EMUOBJ)/ui/swlist.o \ |
| 135 | 132 | $(EMUOBJ)/ui/tapectrl.o \ |
| 136 | $(EMUOBJ)/ui/videoopt.o \ | |
| 137 | 133 | $(EMUOBJ)/ui/viewgfx.o \ |
| 138 | 134 | $(EMUOBJ)/validity.o \ |
| 139 | 135 | $(EMUOBJ)/video.o \ |
| r243192 | r243193 | |
| 153 | 149 | $(EMUOBJ)/profiler.o \ |
| 154 | 150 | $(EMUOBJ)/webengine.o \ |
| 155 | 151 | $(OSDOBJ)/osdnet.o \ |
| 152 | $(OSDOBJ)/modules/sound/none.o \ | |
| 153 | $(OSDOBJ)/modules/debugger/none.o \ | |
| 154 | $(OSDOBJ)/modules/debugger/debugint.o \ | |
| 156 | 155 | |
| 157 | 156 | EMUSOUNDOBJS = \ |
| 158 | 157 | $(EMUOBJ)/sound/filter.o \ |
| r243192 | r243193 | |
|---|---|---|
| 17 | 17 | emu_fatalerror::emu_fatalerror(const char *format, ...) |
| 18 | 18 | : code(0) |
| 19 | 19 | { |
| 20 | if (format == NULL) | |
| 21 | { | |
| 22 | text[0] = '\0'; | |
| 23 | } | |
| 24 | else | |
| 25 | { | |
| 26 | va_list ap; | |
| 27 | va_start(ap, format); | |
| 28 | vsprintf(text, format, ap); | |
| 29 | va_end(ap); | |
| 30 | } | |
| 31 | osd_break_into_debugger(text); | |
| 20 | if (format == NULL) | |
| 21 | { | |
| 22 | text[0] = '\0'; | |
| 23 | } | |
| 24 | else | |
| 25 | { | |
| 26 | va_list ap; | |
| 27 | va_start(ap, format); | |
| 28 | vsprintf(text, format, ap); | |
| 29 | va_end(ap); | |
| 30 | } | |
| 31 | osd_break_into_debugger(text); | |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | emu_fatalerror::emu_fatalerror(const char *format, va_list ap) |
| 35 | 35 | : code(0) |
| 36 | 36 | { |
| 37 | if (format == NULL) | |
| 38 | { | |
| 39 | text[0] = '\0'; | |
| 40 | } | |
| 41 | else | |
| 42 | { | |
| 43 | vsprintf(text, format, ap); | |
| 44 | } | |
| 45 | osd_break_into_debugger(text); | |
| 37 | if (format == NULL) | |
| 38 | { | |
| 39 | text[0] = '\0'; | |
| 40 | } | |
| 41 | else | |
| 42 | { | |
| 43 | vsprintf(text, format, ap); | |
| 44 | } | |
| 45 | osd_break_into_debugger(text); | |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | emu_fatalerror::emu_fatalerror(int _exitcode, const char *format, ...) |
| 49 | 49 | : code(_exitcode) |
| 50 | 50 | { |
| 51 | if (format == NULL) | |
| 52 | { | |
| 53 | text[0] = '\0'; | |
| 54 | } | |
| 55 | else | |
| 56 | { | |
| 57 | va_list ap; | |
| 58 | va_start(ap, format); | |
| 59 | vsprintf(text, format, ap); | |
| 60 | va_end(ap); | |
| 61 | } | |
| 51 | if (format == NULL) | |
| 52 | { | |
| 53 | text[0] = '\0'; | |
| 54 | } | |
| 55 | else | |
| 56 | { | |
| 57 | va_list ap; | |
| 58 | va_start(ap, format); | |
| 59 | vsprintf(text, format, ap); | |
| 60 | va_end(ap); | |
| 61 | } | |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | emu_fatalerror::emu_fatalerror(int _exitcode, const char *format, va_list ap) |
| 65 | 65 | : code(_exitcode) |
| 66 | 66 | { |
| 67 | if (format == NULL) | |
| 68 | { | |
| 69 | text[0] = '\0'; | |
| 70 | } | |
| 71 | else | |
| 72 | { | |
| 73 | vsprintf(text, format, ap); | |
| 74 | } | |
| 67 | if (format == NULL) | |
| 68 | { | |
| 69 | text[0] = '\0'; | |
| 70 | } | |
| 71 | else | |
| 72 | { | |
| 73 | vsprintf(text, format, ap); | |
| 74 | } | |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | |
| r243192 | r243193 | |
| 89 | 89 | |
| 90 | 90 | void fatalerror(const char *format, ...) |
| 91 | 91 | { |
| 92 | va_list ap; | |
| 93 | va_start(ap, format); | |
| 94 | emu_fatalerror error(format, ap); | |
| 95 | va_end(ap); | |
| 96 | throw error; | |
| 92 | va_list ap; | |
| 93 | va_start(ap, format); | |
| 94 | emu_fatalerror error(format, ap); | |
| 95 | va_end(ap); | |
| 96 | throw error; | |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | void fatalerror_exitcode(running_machine &machine, int exitcode, const char *format, ...) |
| 100 | 100 | { |
| 101 | va_list ap; | |
| 102 | va_start(ap, format); | |
| 103 | emu_fatalerror error(exitcode, format, ap); | |
| 104 | va_end(ap); | |
| 105 | throw error; | |
| 101 | va_list ap; | |
| 102 | va_start(ap, format); | |
| 103 | emu_fatalerror error(exitcode, format, ap); | |
| 104 | va_end(ap); | |
| 105 | throw error; | |
| 106 | 106 | } |
| r243192 | r243193 | |
|---|---|---|
| 150 | 150 | |
| 151 | 151 | // debugging options |
| 152 | 152 | { NULL, NULL, OPTION_HEADER, "CORE DEBUGGING OPTIONS" }, |
| 153 | { OPTION_VERBOSE ";v", "0", OPTION_BOOLEAN, "display additional diagnostic information" }, | |
| 154 | { OPTION_LOG, "0", OPTION_BOOLEAN, "generate an error.log file" }, | |
| 155 | { OPTION_OSLOG, "0", OPTION_BOOLEAN, "output error.log data to the system debugger" }, | |
| 156 | { OPTION_DEBUG ";d", "0", OPTION_BOOLEAN, "enable/disable debugger" }, | |
| 153 | { OPTION_VERBOSE ";v", "0", OPTION_BOOLEAN, "display additional diagnostic information" }, | |
| 154 | { OPTION_LOG, "0", OPTION_BOOLEAN, "generate an error.log file" }, | |
| 155 | { OPTION_OSLOG, "0", OPTION_BOOLEAN, "output error.log data to the system debugger" }, | |
| 156 | { OPTION_DEBUG ";d", "0", OPTION_BOOLEAN, "enable/disable debugger" }, | |
| 157 | 157 | { OPTION_UPDATEINPAUSE, "0", OPTION_BOOLEAN, "keep calling video updates while in pause" }, |
| 158 | 158 | { OPTION_DEBUGSCRIPT, NULL, OPTION_STRING, "script for debugger" }, |
| 159 | 159 | |
| r243192 | r243193 | |
| 278 | 278 | } |
| 279 | 279 | } |
| 280 | 280 | } |
| 281 | while (add_slot_options(false)); | |
| 282 | add_device_options(false); | |
| 283 | 281 | } |
| 284 | 282 | |
| 285 | 283 | |
| r243192 | r243193 | |
| 367 | 365 | do { |
| 368 | 366 | num = options_count(); |
| 369 | 367 | update_slot_options(); |
| 368 | while (add_slot_options(false)); | |
| 369 | add_device_options(false); | |
| 370 | 370 | result = core_options::parse_command_line(argc, argv, OPTION_PRIORITY_CMDLINE, error_string); |
| 371 | 371 | } while (num != options_count()); |
| 372 | 372 | |
| r243192 | r243193 | |
| 502 | 502 | do { |
| 503 | 503 | num = options_count(); |
| 504 | 504 | update_slot_options(); |
| 505 | while (add_slot_options(false)); | |
| 506 | add_device_options(false); | |
| 505 | 507 | } while(num != options_count()); |
| 506 | 508 | } |
| 507 | 509 | } |
| r243192 | r243193 | |
|---|---|---|
| 318 | 318 | bool joystick_contradictory() const { return bool_value(OPTION_JOYSTICK_CONTRADICTORY); } |
| 319 | 319 | int coin_impulse() const { return int_value(OPTION_COIN_IMPULSE); } |
| 320 | 320 | |
| 321 | // core debugging options | |
| 322 | bool log() const { return bool_value(OPTION_LOG); } | |
| 323 | bool debug() const { return bool_value(OPTION_DEBUG); } | |
| 324 | bool verbose() const { return bool_value(OPTION_VERBOSE); } | |
| 325 | bool oslog() const { return bool_value(OPTION_OSLOG); } | |
| 321 | // core debugging options | |
| 322 | bool log() const { return bool_value(OPTION_LOG); } | |
| 323 | bool debug() const { return bool_value(OPTION_DEBUG); } | |
| 324 | bool verbose() const { return bool_value(OPTION_VERBOSE); } | |
| 325 | bool oslog() const { return bool_value(OPTION_OSLOG); } | |
| 326 | 326 | const char *debug_script() const { return value(OPTION_DEBUGSCRIPT); } |
| 327 | 327 | bool update_in_pause() const { return bool_value(OPTION_UPDATEINPAUSE); } |
| 328 | 328 |
| r243192 | r243193 | |
|---|---|---|
| 237 | 237 | } |
| 238 | 238 | } |
| 239 | 239 | } |
| 240 | } | |
| 241 | 240 | |
| 242 | /*------------------------------------------------- | |
| 243 | image_mandatory_scan - search for devices which | |
| 244 | need an image to be loaded | |
| 245 | -------------------------------------------------*/ | |
| 246 | ||
| 247 | astring &image_mandatory_scan(running_machine &machine, astring &mandatory) | |
| 248 | { | |
| 249 | mandatory.reset(); | |
| 250 | // make sure that any required image has a mounted file | |
| 251 | image_interface_iterator iter(machine.root_device()); | |
| 252 | 241 | for (device_image_interface *image = iter.first(); image != NULL; image = iter.next()) |
| 253 | 242 | { |
| 254 | if (image->filename() == NULL && image->must_be_loaded()) | |
| 255 | mandatory.cat("\"").cat(image->instance_name()).cat("\", "); | |
| 243 | /* is an image specified for this image */ | |
| 244 | image_name = image->filename(); | |
| 245 | ||
| 246 | if (!((image_name != NULL) && (image_name[0] != '\0'))) | |
| 247 | { | |
| 248 | /* no image... must this device be loaded? */ | |
| 249 | if (image->must_be_loaded()) | |
| 250 | { | |
| 251 | fatalerror_exitcode(machine, MAMERR_DEVICE, "Driver requires that device \"%s\" must have an image to load", image->instance_name()); | |
| 252 | } | |
| 253 | } | |
| 256 | 254 | } |
| 257 | return mandatory; | |
| 258 | 255 | } |
| 259 | 256 | |
| 260 | 257 | /*------------------------------------------------- |
| r243192 | r243193 | |
|---|---|---|
| 20 | 20 | |
| 21 | 21 | void image_init(running_machine &machine); |
| 22 | 22 | void image_postdevice_init(running_machine &machine); |
| 23 | astring &image_mandatory_scan(running_machine &machine, astring &mandatory); | |
| 24 | 23 | |
| 25 | 24 | extern struct io_procs image_ioprocs; |
| 26 | 25 |
| r243192 | r243193 | |
|---|---|---|
| 1 | 1 | // license:BSD-3-Clause |
| 2 | // copyright-holders:Miodrag Milanovic | |
| 2 | // copyright-holders:Miodrag Milanovic | |
| 3 | 3 | /*************************************************************************** |
| 4 | 4 | |
| 5 | 5 | luaengine.c |
| r243192 | r243193 | |
| 130 | 130 | cb = -1; |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | #ifdef SDLMAME_SOLARIS | |
| 134 | #undef _L | |
| 135 | #endif | |
| 136 | ||
| 137 | 133 | void lua_engine::hook::set(lua_State *_L, int idx) |
| 138 | 134 | { |
| 139 | 135 | if (L) |
| r243192 | r243193 | |
| 460 | 456 | } |
| 461 | 457 | |
| 462 | 458 | //------------------------------------------------- |
| 463 | // state_get_value - return value of a device state | |
| 459 | // state_get_value - return value of a devices state | |
| 464 | 460 | // -> manager:machine().devices[":maincpu"].state["PC"].value |
| 465 | 461 | //------------------------------------------------- |
| 466 | 462 | |
| 467 | 463 | UINT64 lua_engine::l_state_get_value(const device_state_entry *d) |
| 468 | 464 | { |
| 469 | device_state_interface *state = d->parent_state(); | |
| 470 | if(state) { | |
| 471 | luaThis->machine().save().dispatch_presave(); | |
| 472 | return state->state_int(d->index()); | |
| 473 | } else { | |
| 474 | return 0; | |
| 475 | } | |
| 465 | return d->value(); | |
| 476 | 466 | } |
| 477 | 467 | |
| 478 | 468 | //------------------------------------------------- |
| 479 | // state_set_value - set value of a device state | |
| 469 | // state_set_value - set value of a devices state | |
| 480 | 470 | // -> manager:machine().devices[":maincpu"].state["D0"].value = 0x0c00 |
| 481 | 471 | //------------------------------------------------- |
| 482 | 472 | |
| 483 | 473 | void lua_engine::l_state_set_value(device_state_entry *d, UINT64 val) |
| 484 | 474 | { |
| 485 | device_state_interface *state = d->parent_state(); | |
| 486 | if(state) { | |
| 487 | state->set_state_int(d->index(), val); | |
| 488 | luaThis->machine().save().dispatch_presave(); | |
| 489 | } | |
| 475 | d->set_value(val); | |
| 490 | 476 | } |
| 491 | 477 | |
| 492 | 478 | //------------------------------------------------- |
| r243192 | r243193 | |
| 541 | 527 | } |
| 542 | 528 | |
| 543 | 529 | //------------------------------------------------- |
| 544 | // mem_write - templated memory writer for <sign>,<size> | |
| 545 | // -> manager:machine().devices[":maincpu"].spaces["program"]:write_u16(0xC000, 0xF00D) | |
| 546 | //------------------------------------------------- | |
| 547 | ||
| 548 | template <typename T> | |
| 549 | int lua_engine::lua_addr_space::l_mem_write(lua_State *L) | |
| 550 | { | |
| 551 | address_space &sp = luabridge::Stack<address_space &>::get(L, 1); | |
| 552 | luaL_argcheck(L, lua_isnumber(L, 2), 2, "address (integer) expected"); | |
| 553 | luaL_argcheck(L, lua_isnumber(L, 3), 3, "value (integer) expected"); | |
| 554 | offs_t address = lua_tounsigned(L, 2); | |
| 555 | T val = lua_tounsigned(L, 3); | |
| 556 | ||
| 557 | switch(sizeof(val) * 8) { | |
| 558 | case 8: | |
| 559 | sp.write_byte(address, val); | |
| 560 | break; | |
| 561 | case 16: | |
| 562 | if ((address & 1) == 0) { | |
| 563 | sp.write_word(address, val); | |
| 564 | } else { | |
| 565 | sp.read_word_unaligned(address, val); | |
| 566 | } | |
| 567 | break; | |
| 568 | case 32: | |
| 569 | if ((address & 3) == 0) { | |
| 570 | sp.write_dword(address, val); | |
| 571 | } else { | |
| 572 | sp.write_dword_unaligned(address, val); | |
| 573 | } | |
| 574 | break; | |
| 575 | case 64: | |
| 576 | if ((address & 7) == 0) { | |
| 577 | sp.write_qword(address, val); | |
| 578 | } else { | |
| 579 | sp.write_qword_unaligned(address, val); | |
| 580 | } | |
| 581 | break; | |
| 582 | default: | |
| 583 | break; | |
| 584 | } | |
| 585 | ||
| 586 | return 0; | |
| 587 | } | |
| 588 | ||
| 589 | //------------------------------------------------- | |
| 590 | // screen_height - return screen visible height | |
| 591 | // -> manager:machine().screens[":screen"]:height() | |
| 592 | //------------------------------------------------- | |
| 593 | ||
| 594 | int lua_engine::lua_screen::l_height(lua_State *L) | |
| 595 | { | |
| 596 | screen_device *sc = luabridge::Stack<screen_device *>::get(L, 1); | |
| 597 | if(!sc) { | |
| 598 | return 0; | |
| 599 | } | |
| 600 | ||
| 601 | lua_pushunsigned(L, sc->visible_area().height()); | |
| 602 | return 1; | |
| 603 | } | |
| 604 | ||
| 605 | //------------------------------------------------- | |
| 606 | // screen_width - return screen visible width | |
| 607 | // -> manager:machine().screens[":screen"]:width() | |
| 608 | //------------------------------------------------- | |
| 609 | ||
| 610 | int lua_engine::lua_screen::l_width(lua_State *L) | |
| 611 | { | |
| 612 | screen_device *sc = luabridge::Stack<screen_device *>::get(L, 1); | |
| 613 | if(!sc) { | |
| 614 | return 0; | |
| 615 | } | |
| 616 | ||
| 617 | lua_pushunsigned(L, sc->visible_area().width()); | |
| 618 | return 1; | |
| 619 | } | |
| 620 | ||
| 621 | //------------------------------------------------- | |
| 622 | 530 | // draw_box - draw a box on a screen container |
| 623 | 531 | // -> manager:machine().screens[":screen"]:draw_box(x1, y1, x2, y2, bgcolor, linecolor) |
| 624 | 532 | //------------------------------------------------- |
| r243192 | r243193 | |
| 640 | 548 | |
| 641 | 549 | // retrieve all parameters |
| 642 | 550 | float x1, y1, x2, y2; |
| 643 | x1 = MIN(lua_tounsigned(L, 2) / static_cast<float>(sc->visible_area().width()) , 1.0f); | |
| 644 | y1 = MIN(lua_tounsigned(L, 3) / static_cast<float>(sc->visible_area().height()), 1.0f); | |
| 645 | x2 = MIN(lua_tounsigned(L, 4) / static_cast<float>(sc->visible_area().width()) , 1.0f); | |
| 646 | y2 = MIN(lua_tounsigned(L, 5) / static_cast<float>(sc->visible_area().height()), 1.0f); | |
| 551 | x1 = MIN(lua_tounsigned(L, 2) / static_cast<float>(sc->width()) , 1.0f); | |
| 552 | y1 = MIN(lua_tounsigned(L, 3) / static_cast<float>(sc->height()), 1.0f); | |
| 553 | x2 = MIN(lua_tounsigned(L, 4) / static_cast<float>(sc->width()) , 1.0f); | |
| 554 | y2 = MIN(lua_tounsigned(L, 5) / static_cast<float>(sc->height()), 1.0f); | |
| 647 | 555 | UINT32 bgcolor = lua_tounsigned(L, 6); |
| 648 | 556 | UINT32 fgcolor = lua_tounsigned(L, 7); |
| 649 | 557 | |
| r243192 | r243193 | |
| 676 | 584 | |
| 677 | 585 | // retrieve all parameters |
| 678 | 586 | float x1, y1, x2, y2; |
| 679 | x1 = MIN(lua_tounsigned(L, 2) / static_cast<float>(sc->visible_area().width()) , 1.0f); | |
| 680 | y1 = MIN(lua_tounsigned(L, 3) / static_cast<float>(sc->visible_area().height()), 1.0f); | |
| 681 | x2 = MIN(lua_tounsigned(L, 4) / static_cast<float>(sc->visible_area().width()) , 1.0f); | |
| 682 | y2 = MIN(lua_tounsigned(L, 5) / static_cast<float>(sc->visible_area().height()), 1.0f); | |
| 587 | x1 = MIN(lua_tounsigned(L, 2) / static_cast<float>(sc->width()) , 1.0f); | |
| 588 | y1 = MIN(lua_tounsigned(L, 3) / static_cast<float>(sc->height()), 1.0f); | |
| 589 | x2 = MIN(lua_tounsigned(L, 4) / static_cast<float>(sc->width()) , 1.0f); | |
| 590 | y2 = MIN(lua_tounsigned(L, 5) / static_cast<float>(sc->height()), 1.0f); | |
| 683 | 591 | UINT32 color = lua_tounsigned(L, 6); |
| 684 | 592 | |
| 685 | 593 | // draw the line |
| r243192 | r243193 | |
| 705 | 613 | luaL_argcheck(L, lua_isstring(L, 4), 4, "message (string) expected"); |
| 706 | 614 | |
| 707 | 615 | // retrieve all parameters |
| 708 | float x = MIN(lua_tounsigned(L, 2) / static_cast<float>(sc->visible_area().width()) , 1.0f); | |
| 709 | float y = MIN(lua_tounsigned(L, 3) / static_cast<float>(sc->visible_area().height()), 1.0f); | |
| 616 | float x = MIN(lua_tounsigned(L, 2) / static_cast<float>(sc->width()) , 1.0f); | |
| 617 | float y = MIN(lua_tounsigned(L, 3) / static_cast<float>(sc->height()), 1.0f); | |
| 710 | 618 | const char *msg = luaL_checkstring(L,4); |
| 711 | 619 | // TODO: add optional parameters (colors, etc.) |
| 712 | 620 | |
| r243192 | r243193 | |
| 714 | 622 | render_container &rc = sc->container(); |
| 715 | 623 | ui_manager &ui = sc->machine().ui(); |
| 716 | 624 | ui.draw_text_full(&rc, msg, x, y , (1.0f - x), |
| 717 | JUSTIFY_LEFT, WRAP_WORD, DRAW_NORMAL, UI_TEXT_COLOR, | |
| 718 | UI_TEXT_BG_COLOR, NULL, NULL); | |
| 625 | JUSTIFY_LEFT, WRAP_WORD, DRAW_NORMAL, UI_TEXT_COLOR, | |
| 626 | UI_TEXT_BG_COLOR, NULL, NULL); | |
| 719 | 627 | |
| 720 | 628 | return 0; |
| 721 | 629 | } |
| r243192 | r243193 | |
| 974 | 882 | .addCFunction ("read_u32", &lua_addr_space::l_mem_read<UINT32>) |
| 975 | 883 | .addCFunction ("read_i64", &lua_addr_space::l_mem_read<INT64>) |
| 976 | 884 | .addCFunction ("read_u64", &lua_addr_space::l_mem_read<UINT64>) |
| 977 | .addCFunction ("write_i8", &lua_addr_space::l_mem_write<INT8>) | |
| 978 | .addCFunction ("write_u8", &lua_addr_space::l_mem_write<UINT8>) | |
| 979 | .addCFunction ("write_i16", &lua_addr_space::l_mem_write<INT16>) | |
| 980 | .addCFunction ("write_u16", &lua_addr_space::l_mem_write<UINT16>) | |
| 981 | .addCFunction ("write_i32", &lua_addr_space::l_mem_write<INT32>) | |
| 982 | .addCFunction ("write_u32", &lua_addr_space::l_mem_write<UINT32>) | |
| 983 | .addCFunction ("write_i64", &lua_addr_space::l_mem_write<INT64>) | |
| 984 | .addCFunction ("write_u64", &lua_addr_space::l_mem_write<UINT64>) | |
| 985 | 885 | .endClass() |
| 986 | 886 | .deriveClass <address_space, lua_addr_space> ("addr_space") |
| 987 | 887 | .addFunction("name", &address_space::name) |
| r243192 | r243193 | |
| 990 | 890 | .addCFunction ("draw_box", &lua_screen::l_draw_box) |
| 991 | 891 | .addCFunction ("draw_line", &lua_screen::l_draw_line) |
| 992 | 892 | .addCFunction ("draw_text", &lua_screen::l_draw_text) |
| 993 | .addCFunction ("height", &lua_screen::l_height) | |
| 994 | .addCFunction ("width", &lua_screen::l_width) | |
| 995 | 893 | .endClass() |
| 996 | 894 | .deriveClass <screen_device, lua_screen> ("screen_dev") |
| 997 | .addFunction ("frame_number", &screen_device::frame_number) | |
| 998 | 895 | .addFunction ("name", &screen_device::name) |
| 999 | 896 | .addFunction ("shortname", &screen_device::shortname) |
| 1000 | 897 | .addFunction ("tag", &screen_device::tag) |
| 898 | .addFunction ("height", &screen_device::height) | |
| 899 | .addFunction ("width", &screen_device::width) | |
| 1001 | 900 | .endClass() |
| 1002 | 901 | .beginClass <device_state_entry> ("dev_space") |
| 1003 | 902 | .addFunction ("name", &device_state_entry::symbol) |
| r243192 | r243193 | |
|---|---|---|
| 112 | 112 | static luabridge::LuaRef l_dev_get_memspaces(const device_t *d); |
| 113 | 113 | struct lua_addr_space { |
| 114 | 114 | template<typename T> int l_mem_read(lua_State *L); |
| 115 | template<typename T> int l_mem_write(lua_State *L); | |
| 116 | 115 | }; |
| 117 | 116 | static luabridge::LuaRef l_machine_get_screens(const running_machine *r); |
| 118 | 117 | struct lua_screen { |
| 119 | int l_height(lua_State *L); | |
| 120 | int l_width(lua_State *L); | |
| 121 | 118 | int l_draw_box(lua_State *L); |
| 122 | 119 | int l_draw_line(lua_State *L); |
| 123 | 120 | int l_draw_text(lua_State *L); |
| r243192 | r243193 | |
|---|---|---|
| 108 | 108 | |
| 109 | 109 | osd_interface &running_machine::osd() const |
| 110 | 110 | { |
| 111 | ||
| 111 | return m_manager.osd(); | |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | //------------------------------------------------- |
| r243192 | r243193 | |
| 142 | 142 | m_save(*this), |
| 143 | 143 | m_memory(*this), |
| 144 | 144 | m_ioport(*this), |
| 145 | m_parameters(*this), | |
| 146 | 145 | m_scheduler(*this) |
| 147 | 146 | { |
| 148 | 147 | memset(&m_base_time, 0, sizeof(m_base_time)); |
| r243192 | r243193 | |
|---|---|---|
| 165 | 165 | save_manager &save() { return m_save; } |
| 166 | 166 | memory_manager &memory() { return m_memory; } |
| 167 | 167 | ioport_manager &ioport() { return m_ioport; } |
| 168 | parameters_manager ¶meters() { return m_parameters; } | |
| 169 | 168 | cheat_manager &cheat() const { assert(m_cheat != NULL); return *m_cheat; } |
| 170 | 169 | render_manager &render() const { assert(m_render != NULL); return *m_render; } |
| 171 | 170 | input_manager &input() const { assert(m_input != NULL); return *m_input; } |
| r243192 | r243193 | |
| 358 | 357 | save_manager m_save; // save manager |
| 359 | 358 | memory_manager m_memory; // memory manager |
| 360 | 359 | ioport_manager m_ioport; // I/O port manager |
| 361 | parameters_manager m_parameters; // parameters manager | |
| 362 | 360 | device_scheduler m_scheduler; // scheduler object |
| 363 | 361 | emu_timer *m_autoboot_timer; // autoboot timer |
| 364 | 362 | }; |
| r243192 | r243193 | |
|---|---|---|
| 223 | 223 | save_item(NAME(m_acr)); |
| 224 | 224 | save_item(NAME(m_ier)); |
| 225 | 225 | save_item(NAME(m_ifr)); |
| 226 | save_item(NAME(m_time1)); | |
| 227 | 226 | save_item(NAME(m_t1_active)); |
| 228 | 227 | save_item(NAME(m_t1_pb7)); |
| 229 | save_item(NAME(m_time2)); | |
| 230 | 228 | save_item(NAME(m_t2_active)); |
| 231 | 229 | save_item(NAME(m_shift_counter)); |
| 232 | 230 | } |
| r243192 | r243193 | |
|---|---|---|
| 269 | 269 | { |
| 270 | 270 | if (m_byte_count < m_byte_length) |
| 271 | 271 | { |
| 272 | UINT8 val = m_ | |
| 272 | UINT8 val = m_pixel_data[m_byte_count]; | |
| 273 | 273 | m_byte_count++; |
| 274 | 274 | return val; |
| 275 | 275 | } |
| r243192 | r243193 | |
|---|---|---|
| 25 | 25 | barcode_reader_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 26 | 26 | |
| 27 | 27 | void write_code(const char *barcode, int len); |
| 28 | int get_pending_code() { return m_new_code; } | |
| 29 | int get_byte_length() { return m_byte_length; } | |
| 30 | 28 | UINT8 read_code(); |
| 31 | 29 | int read_pixel(); |
| 32 | 30 |
| r243192 | r243193 | |
|---|---|---|
| 102 | 102 | const device_type INTEL_TE28F160 = &device_creator<intel_te28f160_device>; |
| 103 | 103 | const device_type SHARP_UNK128MBIT = &device_creator<sharp_unk128mbit_device>; |
| 104 | 104 | const device_type INTEL_28F320J3D = &device_creator<intel_28f320j3d_device>; |
| 105 | const device_type INTEL_28F320J5 = &device_creator<intel_28f320j5_device>; | |
| 106 | ||
| 107 | 105 | const device_type SST_39VF400A = &device_creator<sst_39vf400a_device>; |
| 108 | 106 | |
| 109 | 107 | static ADDRESS_MAP_START( memory_map8_512Kb, AS_PROGRAM, 8, intelfsh_device ) |
| r243192 | r243193 | |
| 248 | 246 | m_sector_is_4k = true; |
| 249 | 247 | map = ADDRESS_MAP_NAME( memory_map16_32Mb ); |
| 250 | 248 | break; |
| 251 | case FLASH_INTEL_28F320J5: // funkball | |
| 252 | m_bits = 16; | |
| 253 | m_size = 0x400000; | |
| 254 | m_maker_id = MFG_INTEL; | |
| 255 | m_device_id = 0x14; | |
| 256 | // m_sector_is_4k = true; 128kb? | |
| 257 | map = ADDRESS_MAP_NAME( memory_map16_32Mb ); | |
| 258 | break; | |
| 259 | 249 | case FLASH_SST_39VF020: |
| 260 | 250 | m_bits = 8; |
| 261 | 251 | m_size = 0x40000; |
| r243192 | r243193 | |
| 456 | 446 | intel_28f320j3d_device::intel_28f320j3d_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 457 | 447 | : intelfsh16_device(mconfig, INTEL_28F320J3D, "Intel 28F320J3D Flash", tag, owner, clock, FLASH_INTEL_28F320J3D, "intel_28f320j3d", __FILE__) { } |
| 458 | 448 | |
| 459 | intel_28f320j5_device::intel_28f320j5_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 460 | : intelfsh16_device(mconfig, INTEL_28F320J5, "Intel 28F320J3D_a Flash", tag, owner, clock, FLASH_INTEL_28F320J5, "intel_28f320j5", __FILE__) { } | |
| 461 | ||
| 462 | ||
| 463 | 449 | sst_39vf400a_device::sst_39vf400a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 464 | 450 | : intelfsh16_device(mconfig, SST_39VF400A, "SST 39VF400A Flash", tag, owner, clock, FLASH_SST_39VF400A, "sst_39vf400a", __FILE__) { } |
| 465 | 451 |
| r243192 | r243193 | |
|---|---|---|
| 82 | 82 | #define MCFG_INTEL_28F320J3D_ADD(_tag) \ |
| 83 | 83 | MCFG_DEVICE_ADD(_tag, INTEL_28F320J3D, 0) |
| 84 | 84 | |
| 85 | #define MCFG_INTEL_28F320J5_ADD(_tag) \ | |
| 86 | MCFG_DEVICE_ADD(_tag, INTEL_28F320J5, 0) | |
| 87 | ||
| 88 | 85 | #define MCFG_SST_39VF400A_ADD(_tag) \ |
| 89 | 86 | MCFG_DEVICE_ADD(_tag, SST_39VF400A, 0) |
| 90 | 87 | |
| r243192 | r243193 | |
| 131 | 128 | FLASH_INTEL_TE28F160, |
| 132 | 129 | FLASH_SHARP_UNK128MBIT, |
| 133 | 130 | FLASH_INTEL_28F320J3D, |
| 134 | FLASH_INTEL_28F320J5, | |
| 135 | 131 | FLASH_SST_39VF400A |
| 136 | 132 | }; |
| 137 | 133 | |
| r243192 | r243193 | |
| 367 | 363 | intel_28f320j3d_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 368 | 364 | }; |
| 369 | 365 | |
| 370 | class intel_28f320j5_device : public intelfsh16_device | |
| 371 | { | |
| 372 | public: | |
| 373 | intel_28f320j5_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 374 | }; | |
| 375 | ||
| 376 | 366 | class sst_39vf400a_device : public intelfsh16_device |
| 377 | 367 | { |
| 378 | 368 | public: |
| r243192 | r243193 | |
| 407 | 397 | extern const device_type INTEL_TE28F160; |
| 408 | 398 | extern const device_type SHARP_UNK128MBIT; |
| 409 | 399 | extern const device_type INTEL_28F320J3D; |
| 410 | extern const device_type INTEL_28F320J5; | |
| 411 | 400 | extern const device_type SST_39VF400A; |
| 412 | 401 | |
| 413 | 402 | #endif |
| r243192 | r243193 | |
|---|---|---|
| 49 | 49 | // - have at least one command byte |
| 50 | 50 | if(send_size < 3 || send_buffer[0] == 0x00 || send_buffer[1] != send_size-1) { |
| 51 | 51 | logerror("JVS checksum error\n"); |
| 52 | } /* | |
| 53 | Naomi suchie3 have bad working controls with this | |
| 52 | // "This message is crap" doesn't exist so call it checksum error | |
| 53 | recv_buffer[0] = 0x00; | |
| 54 | recv_buffer[1] = 0x02; | |
| 55 | recv_buffer[2] = 0x03; | |
| 56 | recv_size = 3; | |
| 54 | 57 | |
| 55 | // "This message is crap" doesn't exist so call it checksum error | |
| 56 | recv_buffer[0] = 0x00; | |
| 57 | recv_buffer[1] = 0x02; | |
| 58 | recv_buffer[2] = 0x03; | |
| 59 | recv_size = 3; | |
| 60 | ||
| 61 | } else */ { | |
| 58 | } else { | |
| 62 | 59 | if(first_device) { |
| 63 | 60 | first_device->message(send_buffer[0], send_buffer+2, send_size-2, recv_buffer+2, recv_size); |
| 64 | 61 | recv_is_encoded = false; |
| r243192 | r243193 | |
|---|---|---|
| 48 | 48 | #include "netlist.h" |
| 49 | 49 | #include "netlist/nl_base.h" |
| 50 | 50 | #include "netlist/nl_setup.h" |
| 51 | #include "netlist/nl_factory.h" | |
| 52 | 51 | #include "netlist/devices/net_lib.h" |
| 53 | 52 | #include "debugger.h" |
| 54 | 53 | |
| r243192 | r243193 | |
| 135 | 134 | pstring dname = "OUT_" + m_in; |
| 136 | 135 | m_delegate.bind_relative_to(owner()->machine().root_device()); |
| 137 | 136 | NETLIB_NAME(analog_callback) *dev = downcast<NETLIB_NAME(analog_callback) *>( |
| 138 | setup. | |
| 137 | setup.factory().new_device_by_classname("nld_analog_callback", setup)); | |
| 139 | 138 | |
| 139 | setup.register_dev(dev, dname); | |
| 140 | 140 | dev->register_callback(m_delegate); |
| 141 | 141 | setup.register_link(dname + ".IN", m_in); |
| 142 | 142 | } |
| r243192 | r243193 | |
| 208 | 208 | { |
| 209 | 209 | NETLIB_NAME(sound_in) *snd_in = setup.netlist().get_first_device<NETLIB_NAME(sound_in)>(); |
| 210 | 210 | if (snd_in == NULL) |
| 211 | snd_in = dynamic_cast<NETLIB_NAME(sound_in) *>(setup.register_dev("nld_sound_in", "STREAM_INPUT")); | |
| 211 | { | |
| 212 | snd_in = dynamic_cast<NETLIB_NAME(sound_in) *>(setup.factory().new_device_by_classname("nld_sound_in", setup)); | |
| 213 | setup.register_dev(snd_in, "STREAM_INPUT"); | |
| 214 | } | |
| 212 | 215 | |
| 213 | 216 | pstring sparam = pstring::sprintf("STREAM_INPUT.CHAN%d", m_channel); |
| 214 | 217 | setup.register_param(sparam, m_param_name); |
| r243192 | r243193 | |
| 244 | 247 | |
| 245 | 248 | void netlist_mame_stream_output_t::custom_netlist_additions(netlist_setup_t &setup) |
| 246 | 249 | { |
| 247 | | |
| 250 | NETLIB_NAME(sound_out) *snd_out; | |
| 248 | 251 | pstring sname = pstring::sprintf("STREAM_OUT_%d", m_channel); |
| 249 | 252 | |
| 250 | //snd_out = dynamic_cast<NETLIB_NAME(sound_out) *>(setup.register_dev("nld_sound_out", sname)); | |
| 251 | setup.register_dev("nld_sound_out", sname); | |
| 253 | snd_out = dynamic_cast<NETLIB_NAME(sound_out) *>(setup.factory().new_device_by_classname("nld_sound_out", setup)); | |
| 254 | setup.register_dev(snd_out, sname); | |
| 252 | 255 | |
| 253 | 256 | setup.register_param(sname + ".CHAN" , m_channel); |
| 254 | 257 | setup.register_param(sname + ".MULT", m_mult); |
| r243192 | r243193 | |
| 440 | 443 | if (td != NULL) save_pointer(td, s->m_name, s->m_count); |
| 441 | 444 | } |
| 442 | 445 | break; |
| 443 | case DT_FLOAT: | |
| 444 | { | |
| 445 | float *td = s->resolved<float>(); | |
| 446 | if (td != NULL) save_pointer(td, s->m_name, s->m_count); | |
| 447 | } | |
| 448 | break; | |
| 449 | 446 | case DT_INT64: |
| 450 | 447 | save_pointer((INT64 *) s->m_ptr, s->m_name, s->m_count); |
| 451 | 448 | break; |
| r243192 | r243193 | |
|---|---|---|
| 94 | 94 | |
| 95 | 95 | osd_interface &machine_manager::osd() const |
| 96 | 96 | { |
| 97 | ||
| 97 | return m_osd; | |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 |
| r243192 | r243193 | |
|---|---|---|
| 1811 | 1811 | m_map.reset(global_alloc(address_map(m_device, m_spacenum))); |
| 1812 | 1812 | |
| 1813 | 1813 | // merge in the submaps |
| 1814 | m_map->uplift_submaps(machine(), m_device, | |
| 1814 | m_map->uplift_submaps(machine(), m_device, *m_device.owner(), endianness()); | |
| 1815 | 1815 | |
| 1816 | 1816 | // extract global parameters specified by the map |
| 1817 | 1817 | m_unmap = (m_map->m_unmapval == 0) ? 0 : ~0; |
| r243192 | r243193 | |
|---|---|---|
| 11 | 11 | { |
| 12 | 12 | public: |
| 13 | 13 | diode() : m_Is(1e-15), m_VT(0.0258), m_VT_inv(1.0 / m_VT) {} |
| 14 | diode(const | |
| 14 | diode(const double Is, const double n) | |
| 15 | 15 | { |
| 16 | 16 | m_Is = Is; |
| 17 | 17 | m_VT = 0.0258 * n; |
| 18 | 18 | m_VT_inv = 1.0 / m_VT; |
| 19 | 19 | } |
| 20 | void set(const | |
| 20 | void set(const double Is, const double n) | |
| 21 | 21 | { |
| 22 | 22 | m_Is = Is; |
| 23 | 23 | m_VT = 0.0258 * n; |
| 24 | 24 | m_VT_inv = 1.0 / m_VT; |
| 25 | 25 | } |
| 26 | nl_double I(const nl_double V) const { return m_Is * exp(V * m_VT_inv) - m_Is; } | |
| 27 | nl_double g(const nl_double V) const { return m_Is * m_VT_inv * exp(V * m_VT_inv); } | |
| 28 | nl_double V(const nl_double I) const { return log(1.0 + I / m_Is) * m_VT; } | |
| 29 | nl_double gI(const nl_double I) const { return m_VT_inv * (I + m_Is); } | |
| 26 | double I(const double V) const { return m_Is * exp(V * m_VT_inv) - m_Is; } | |
| 27 | double g(const double V) const { return m_Is * m_VT_inv * exp(V * m_VT_inv); } | |
| 28 | double V(const double I) const { return log(1.0 + I / m_Is) * m_VT; } | |
| 29 | double gI(const double I) const { return m_VT_inv * (I + m_Is); } | |
| 30 | 30 | |
| 31 | 31 | private: |
| 32 | nl_double m_Is; | |
| 33 | nl_double m_VT; | |
| 34 | nl_double m_VT_inv; | |
| 32 | double m_Is; | |
| 33 | double m_VT; | |
| 34 | double m_VT_inv; | |
| 35 | 35 | }; |
| 36 | 36 | |
| 37 | 37 | |
| r243192 | r243193 | |
| 85 | 85 | m_state_on = 0; |
| 86 | 86 | |
| 87 | 87 | { |
| 88 | nl_double IS = m_model.model_value("IS", 1e-15); | |
| 89 | nl_double BF = m_model.model_value("BF", 100); | |
| 90 | nl_double NF = m_model.model_value("NF", 1); | |
| 91 | //nl_double VJE = m_model.dValue("VJE", 0.75); | |
| 88 | double IS = m_model.model_value("IS", 1e-15); | |
| 89 | double BF = m_model.model_value("BF", 100); | |
| 90 | double NF = m_model.model_value("NF", 1); | |
| 91 | //double VJE = m_model.dValue("VJE", 0.75); | |
| 92 | 92 | |
| 93 | 93 | set_qtype((m_model.model_type() == "NPN") ? BJT_NPN : BJT_PNP); |
| 94 | 94 | |
| 95 | | |
| 95 | double alpha = BF / (1.0 + BF); | |
| 96 | 96 | |
| 97 | 97 | diode d(IS, NF); |
| 98 | 98 | |
| r243192 | r243193 | |
| 155 | 155 | m_gD_BC.save("m_D_BC", *this); |
| 156 | 156 | |
| 157 | 157 | { |
| 158 | nl_double IS = m_model.model_value("IS", 1e-15); | |
| 159 | nl_double BF = m_model.model_value("BF", 100); | |
| 160 | nl_double NF = m_model.model_value("NF", 1); | |
| 161 | nl_double BR = m_model.model_value("BR", 1); | |
| 162 | nl_double NR = m_model.model_value("NR", 1); | |
| 163 | //nl_double VJE = m_model.dValue("VJE", 0.75); | |
| 158 | double IS = m_model.model_value("IS", 1e-15); | |
| 159 | double BF = m_model.model_value("BF", 100); | |
| 160 | double NF = m_model.model_value("NF", 1); | |
| 161 | double BR = m_model.model_value("BR", 1); | |
| 162 | double NR = m_model.model_value("NR", 1); | |
| 163 | //double VJE = m_model.dValue("VJE", 0.75); | |
| 164 | 164 | |
| 165 | 165 | set_qtype((m_model.model_type() == "NPN") ? BJT_NPN : BJT_PNP); |
| 166 | 166 | //printf("type %s\n", m_model.model_type().cstr()); |
| r243192 | r243193 | |
|---|---|---|
| 98 | 98 | |
| 99 | 99 | NETLIB_UPDATE_TERMINALS() |
| 100 | 100 | { |
| 101 | const | |
| 101 | const double m = (is_qtype( BJT_NPN) ? 1 : -1); | |
| 102 | 102 | |
| 103 | 103 | const int new_state = (m_RB.deltaV() * m > m_V ) ? 1 : 0; |
| 104 | 104 | if (m_state_on ^ new_state) |
| 105 | 105 | { |
| 106 | 106 | #if 0 |
| 107 | nl_double gb = m_gB; | |
| 108 | nl_double gc = m_gC; | |
| 109 | nl_double v = m_V * m; | |
| 107 | double gb = m_gB; | |
| 108 | double gc = m_gC; | |
| 109 | double v = m_V * m; | |
| 110 | 110 | if (!new_state ) |
| 111 | 111 | { |
| 112 | 112 | // not conducting |
| r243192 | r243193 | |
| 115 | 115 | gc = netlist().gmin(); |
| 116 | 116 | } |
| 117 | 117 | #else |
| 118 | const nl_double gb = new_state ? m_gB : netlist().gmin(); | |
| 119 | const nl_double gc = new_state ? m_gC : netlist().gmin(); | |
| 120 | const nl_double v = new_state ? m_V * m : 0; | |
| 118 | const double gb = new_state ? m_gB : netlist().gmin(); | |
| 119 | const double gc = new_state ? m_gC : netlist().gmin(); | |
| 120 | const double v = new_state ? m_V * m : 0; | |
| 121 | 121 | #endif |
| 122 | 122 | m_RB.set(gb, v, 0.0); |
| 123 | 123 | m_RC.set(gc, 0.0, 0.0); |
| r243192 | r243193 | |
| 142 | 142 | ATTR_COLD virtual void start(); |
| 143 | 143 | ATTR_HOT void update_param(); |
| 144 | 144 | |
| 145 | nl_double m_gB; // base conductance / switch on | |
| 146 | nl_double m_gC; // collector conductance / switch on | |
| 147 | nl_double m_V; // internal voltage source | |
| 145 | double m_gB; // base conductance / switch on | |
| 146 | double m_gC; // collector conductance / switch on | |
| 147 | double m_V; // internal voltage source | |
| 148 | 148 | UINT8 m_state_on; |
| 149 | 149 | |
| 150 | 150 | private: |
| r243192 | r243193 | |
| 169 | 169 | |
| 170 | 170 | NETLIB_UPDATE_TERMINALS() |
| 171 | 171 | { |
| 172 | const | |
| 172 | const double polarity = (qtype() == BJT_NPN ? 1.0 : -1.0); | |
| 173 | 173 | |
| 174 | 174 | m_gD_BE.update_diode(-m_D_EB.deltaV() * polarity); |
| 175 | 175 | m_gD_BC.update_diode(-m_D_CB.deltaV() * polarity); |
| 176 | 176 | |
| 177 | const nl_double gee = m_gD_BE.G(); | |
| 178 | const nl_double gcc = m_gD_BC.G(); | |
| 179 | const nl_double gec = m_alpha_r * gcc; | |
| 180 | const nl_double gce = m_alpha_f * gee; | |
| 181 | const nl_double sIe = -m_gD_BE.I() + m_alpha_r * m_gD_BC.I(); | |
| 182 | const nl_double sIc = m_alpha_f * m_gD_BE.I() - m_gD_BC.I(); | |
| 183 | const nl_double Ie = (sIe + gee * m_gD_BE.Vd() - gec * m_gD_BC.Vd()) * polarity; | |
| 184 | const nl_double Ic = (sIc - gce * m_gD_BE.Vd() + gcc * m_gD_BC.Vd()) * polarity; | |
| 177 | const double gee = m_gD_BE.G(); | |
| 178 | const double gcc = m_gD_BC.G(); | |
| 179 | const double gec = m_alpha_r * gcc; | |
| 180 | const double gce = m_alpha_f * gee; | |
| 181 | const double sIe = -m_gD_BE.I() + m_alpha_r * m_gD_BC.I(); | |
| 182 | const double sIc = m_alpha_f * m_gD_BE.I() - m_gD_BC.I(); | |
| 183 | const double Ie = (sIe + gee * m_gD_BE.Vd() - gec * m_gD_BC.Vd()) * polarity; | |
| 184 | const double Ic = (sIc - gce * m_gD_BE.Vd() + gcc * m_gD_BC.Vd()) * polarity; | |
| 185 | 185 | |
| 186 | 186 | m_D_EB.set_mat(gee, gec - gee, gce - gee, gee - gec, Ie, -Ie); |
| 187 | 187 | m_D_CB.set_mat(gcc, gce - gcc, gec - gcc, gcc - gce, Ic, -Ic); |
| r243192 | r243193 | |
| 202 | 202 | nld_twoterm m_D_EB; // gee, gec - gee, gce - gee, gee - gec | Ie |
| 203 | 203 | nld_twoterm m_D_EC; // 0, -gec, -gcc, 0 | 0 |
| 204 | 204 | |
| 205 | nl_double m_alpha_f; | |
| 206 | nl_double m_alpha_r; | |
| 205 | double m_alpha_f; | |
| 206 | double m_alpha_r; | |
| 207 | 207 | |
| 208 | 208 | private: |
| 209 | 209 | }; |
| r243192 | r243193 | |
|---|---|---|
| 17 | 17 | m_gfac = 1.0; |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | void NETLIB_NAME(VCCS)::start_internal(const | |
| 20 | void NETLIB_NAME(VCCS)::start_internal(const double def_RI) | |
| 21 | 21 | { |
| 22 | 22 | register_param("G", m_G, 1.0); |
| 23 | 23 | register_param("RI", m_RI, def_RI); |
| r243192 | r243193 | |
| 45 | 45 | |
| 46 | 46 | NETLIB_RESET(VCCS) |
| 47 | 47 | { |
| 48 | const nl_double m_mult = m_G.Value() * m_gfac; // 1.0 ==> 1V ==> 1A | |
| 49 | const nl_double GI = 1.0 / m_RI.Value(); | |
| 48 | const double m_mult = m_G.Value() * m_gfac; // 1.0 ==> 1V ==> 1A | |
| 49 | const double GI = 1.0 / m_RI.Value(); | |
| 50 | 50 | |
| 51 | 51 | m_IP.set(GI); |
| 52 | 52 | m_IN.set(GI); |
| r243192 | r243193 | |
|---|---|---|
| 59 | 59 | ATTR_COLD virtual void update_param(); |
| 60 | 60 | ATTR_HOT ATTR_ALIGN void update(); |
| 61 | 61 | |
| 62 | ATTR_COLD void start_internal(const | |
| 62 | ATTR_COLD void start_internal(const double def_RI); | |
| 63 | 63 | |
| 64 | 64 | netlist_terminal_t m_OP; |
| 65 | 65 | netlist_terminal_t m_ON; |
| r243192 | r243193 | |
| 73 | 73 | netlist_param_double_t m_G; |
| 74 | 74 | netlist_param_double_t m_RI; |
| 75 | 75 | |
| 76 | | |
| 76 | double m_gfac; | |
| 77 | 77 | }; |
| 78 | 78 | |
| 79 | 79 | // ---------------------------------------------------------------------------------------- |
| r243192 | r243193 | |
| 115 | 115 | ATTR_COLD virtual void update_param(); |
| 116 | 116 | ATTR_HOT ATTR_ALIGN void update(); |
| 117 | 117 | |
| 118 | | |
| 118 | double m_gfac; | |
| 119 | 119 | }; |
| 120 | 120 | |
| 121 | 121 |
| r243192 | r243193 | |
|---|---|---|
| 14 | 14 | public: |
| 15 | 15 | |
| 16 | 16 | netlist_matrix_solver_direct_t(const netlist_solver_parameters_t ¶ms, int size); |
| 17 | ||
| 17 | netlist_matrix_solver_direct_t(const eSolverType type, const netlist_solver_parameters_t ¶ms, int size); | |
| 18 | 18 | |
| 19 | 19 | virtual ~netlist_matrix_solver_direct_t(); |
| 20 | 20 | |
| r243192 | r243193 | |
| 28 | 28 | protected: |
| 29 | 29 | ATTR_COLD virtual void add_term(int net_idx, netlist_terminal_t *term); |
| 30 | 30 | |
| 31 | ATTR_HOT virtual | |
| 31 | ATTR_HOT virtual double vsolve(); | |
| 32 | 32 | |
| 33 | 33 | ATTR_HOT int solve_non_dynamic(); |
| 34 | 34 | ATTR_HOT void build_LE(); |
| 35 | ATTR_HOT void gauss_LE(nl_double (* RESTRICT x)); | |
| 36 | ATTR_HOT nl_double delta(const nl_double (* RESTRICT V)); | |
| 37 | ATTR_HOT void store(const nl_double (* RESTRICT V), const bool store_RHS); | |
| 35 | ATTR_HOT void gauss_LE(double (* RESTRICT x)); | |
| 36 | ATTR_HOT double delta(const double (* RESTRICT V)); | |
| 37 | ATTR_HOT void store(const double (* RESTRICT V), const bool store_RHS); | |
| 38 | 38 | |
| 39 | 39 | /* bring the whole system to the current time |
| 40 | 40 | * Don't schedule a new calculation time. The recalculation has to be |
| 41 | 41 | * triggered by the caller after the netlist element was changed. |
| 42 | 42 | */ |
| 43 | ATTR_HOT | |
| 43 | ATTR_HOT double compute_next_timestep(); | |
| 44 | 44 | |
| 45 | nl_double m_A[_storage_N][((_storage_N + 7) / 8) * 8]; | |
| 46 | nl_double m_RHS[_storage_N]; | |
| 47 | nl_double m_last_RHS[_storage_N]; // right hand side - contains currents | |
| 48 | nl_double m_Vdelta[_storage_N]; | |
| 49 | nl_double m_last_V[_storage_N]; | |
| 45 | double m_A[_storage_N][((_storage_N + 7) / 8) * 8]; | |
| 46 | double m_RHS[_storage_N]; | |
| 47 | double m_last_RHS[_storage_N]; // right hand side - contains currents | |
| 48 | double m_Vdelta[_storage_N]; | |
| 49 | double m_last_V[_storage_N]; | |
| 50 | 50 | |
| 51 | 51 | terms_t **m_terms; |
| 52 | 52 | terms_t *m_rails_temp; |
| r243192 | r243193 | |
| 55 | 55 | vector_ops_t *m_row_ops[_storage_N + 1]; |
| 56 | 56 | |
| 57 | 57 | int m_dim; |
| 58 | | |
| 58 | double m_lp_fact; | |
| 59 | 59 | }; |
| 60 | 60 | |
| 61 | 61 | // ---------------------------------------------------------------------------------------- |
| r243192 | r243193 | |
| 69 | 69 | { |
| 70 | 70 | //delete[] m_A[k]; |
| 71 | 71 | } |
| 72 | for (int k = 0; k < N(); k++) | |
| 73 | { | |
| 74 | nl_free(m_terms[k]); | |
| 75 | nl_free(m_row_ops[k]); | |
| 76 | } | |
| 77 | nl_free(m_row_ops[N()]); | |
| 78 | 72 | //delete[] m_last_RHS; |
| 79 | 73 | //delete[] m_RHS; |
| 80 | nl_free_array(m_terms); | |
| 81 | nl_free_array(m_rails_temp); | |
| 74 | delete[] m_terms; | |
| 75 | delete[] m_rails_temp; | |
| 82 | 76 | //delete[] m_row_ops; |
| 83 | 77 | |
| 84 | 78 | } |
| 85 | 79 | |
| 86 | 80 | template <int m_N, int _storage_N> |
| 87 | ATTR_HOT | |
| 81 | ATTR_HOT double netlist_matrix_solver_direct_t<m_N, _storage_N>::compute_next_timestep() | |
| 88 | 82 | { |
| 89 | | |
| 83 | double new_solver_timestep = m_params.m_max_timestep; | |
| 90 | 84 | |
| 91 | 85 | if (m_params.m_dynamic) |
| 92 | 86 | { |
| r243192 | r243193 | |
| 103 | 97 | { |
| 104 | 98 | netlist_analog_net_t *n = m_nets[k]; |
| 105 | 99 | #endif |
| 106 | const nl_double DD_n = (n->m_cur_Analog - m_last_V[k]); | |
| 107 | const nl_double hn = current_timestep(); | |
| 100 | const double DD_n = (n->m_cur_Analog - m_last_V[k]); | |
| 101 | const double hn = current_timestep(); | |
| 108 | 102 | |
| 109 | nl_double DD2 = (DD_n / hn - n->m_DD_n_m_1 / n->m_h_n_m_1) / (hn + n->m_h_n_m_1); | |
| 110 | nl_double new_net_timestep; | |
| 103 | double DD2 = (DD_n / hn - n->m_DD_n_m_1 / n->m_h_n_m_1) / (hn + n->m_h_n_m_1); | |
| 104 | double new_net_timestep; | |
| 111 | 105 | |
| 112 | 106 | n->m_h_n_m_1 = hn; |
| 113 | 107 | n->m_DD_n_m_1 = DD_n; |
| r243192 | r243193 | |
| 193 | 187 | * Sorting as a general matrix pre-conditioning is mentioned in |
| 194 | 188 | * literature but I have found no articles about Gauss Seidel. |
| 195 | 189 | * |
| 196 | * For Gaussian Elimination however increasing order is better suited. | |
| 197 | * FIXME: Even better would be to sort on elements right of the matrix diagonal. | |
| 198 | * | |
| 190 | * For Gaussian Elimination however increasing order is better suited. | |
| 191 | * FIXME: Even better would be to sort on elements right of the matrix diagonal. | |
| 192 | * | |
| 199 | 193 | */ |
| 200 | 194 | |
| 201 | ||
| 195 | int sort_order = (type() == GAUSS_SEIDEL ? 1 : -1); | |
| 202 | 196 | |
| 203 | 197 | for (int k = 0; k < N() / 2; k++) |
| 204 | 198 | for (int i = 0; i < N() - 1; i++) |
| 205 | 199 | { |
| 206 | ||
| 200 | if ((m_terms[i]->m_railstart - m_terms[i+1]->m_railstart) * sort_order < 0) | |
| 207 | 201 | { |
| 208 | 202 | std::swap(m_terms[i],m_terms[i+1]); |
| 209 | 203 | m_nets.swap(i, i+1); |
| r243192 | r243193 | |
| 236 | 230 | for (int i=0; i < N(); i++) |
| 237 | 231 | m_A[k][i] = 0.0; |
| 238 | 232 | |
| 239 | nl_double rhsk = 0.0; | |
| 240 | nl_double akk = 0.0; | |
| 233 | double rhsk = 0.0; | |
| 234 | double akk = 0.0; | |
| 241 | 235 | { |
| 242 | 236 | const int terms_count = m_terms[k]->count(); |
| 243 | const nl_double * RESTRICT gt = m_terms[k]->gt(); | |
| 244 | const nl_double * RESTRICT go = m_terms[k]->go(); | |
| 245 | const nl_double * RESTRICT Idr = m_terms[k]->Idr(); | |
| 237 | const double * RESTRICT gt = m_terms[k]->gt(); | |
| 238 | const double * RESTRICT go = m_terms[k]->go(); | |
| 239 | const double * RESTRICT Idr = m_terms[k]->Idr(); | |
| 246 | 240 | #if VECTALT |
| 247 | 241 | |
| 248 | 242 | for (int i = 0; i < terms_count; i++) |
| r243192 | r243193 | |
| 253 | 247 | #else |
| 254 | 248 | m_terms[k]->ops()->sum2(Idr, gt, rhsk, akk); |
| 255 | 249 | #endif |
| 256 | | |
| 250 | double * const * RESTRICT other_cur_analog = m_terms[k]->other_curanalog(); | |
| 257 | 251 | for (int i = m_terms[k]->m_railstart; i < terms_count; i++) |
| 258 | 252 | { |
| 259 | 253 | //rhsk = rhsk + go[i] * terms[i]->m_otherterm->net().as_analog().Q_Analog(); |
| r243192 | r243193 | |
| 272 | 266 | m_A[k][k] += 1.0; |
| 273 | 267 | { |
| 274 | 268 | const int *net_other = m_terms[k]->net_other(); |
| 275 | const | |
| 269 | const double *go = m_terms[k]->go(); | |
| 276 | 270 | const int railstart = m_terms[k]->m_railstart; |
| 277 | 271 | |
| 278 | 272 | for (int i = 0; i < railstart; i++) |
| r243192 | r243193 | |
| 285 | 279 | m_A[k][k] += akk; |
| 286 | 280 | { |
| 287 | 281 | const int * RESTRICT net_other = m_terms[k]->net_other(); |
| 288 | const | |
| 282 | const double * RESTRICT go = m_terms[k]->go(); | |
| 289 | 283 | const int railstart = m_terms[k]->m_railstart; |
| 290 | 284 | |
| 291 | 285 | for (int i = 0; i < railstart; i++) |
| r243192 | r243193 | |
| 299 | 293 | |
| 300 | 294 | template <int m_N, int _storage_N> |
| 301 | 295 | ATTR_HOT void netlist_matrix_solver_direct_t<m_N, _storage_N>::gauss_LE( |
| 302 | | |
| 296 | double (* RESTRICT x)) | |
| 303 | 297 | { |
| 304 | 298 | #if 0 |
| 305 | 299 | for (int i = 0; i < N(); i++) |
| r243192 | r243193 | |
| 336 | 330 | } |
| 337 | 331 | |
| 338 | 332 | /* FIXME: Singular matrix? */ |
| 339 | const | |
| 333 | const double f = 1.0 / m_A[i][i]; | |
| 340 | 334 | |
| 341 | 335 | /* Eliminate column i from row j */ |
| 342 | 336 | |
| 343 | 337 | for (int j = i + 1; j < kN; j++) |
| 344 | 338 | { |
| 345 | const | |
| 339 | const double f1 = - m_A[j][i] * f; | |
| 346 | 340 | if (f1 != 0.0) |
| 347 | 341 | { |
| 348 | 342 | #if 0 && VECTALT |
| r243192 | r243193 | |
| 359 | 353 | /* back substitution */ |
| 360 | 354 | for (int j = kN - 1; j >= 0; j--) |
| 361 | 355 | { |
| 362 | | |
| 356 | double tmp = 0; | |
| 363 | 357 | |
| 364 | 358 | for (int k = j + 1; k < kN; k++) |
| 365 | 359 | tmp += m_A[j][k] * x[k]; |
| r243192 | r243193 | |
| 380 | 374 | } |
| 381 | 375 | |
| 382 | 376 | template <int m_N, int _storage_N> |
| 383 | ATTR_HOT nl_double netlist_matrix_solver_direct_t<m_N, _storage_N>::delta( | |
| 384 | const nl_double (* RESTRICT V)) | |
| 377 | ATTR_HOT double netlist_matrix_solver_direct_t<m_N, _storage_N>::delta( | |
| 378 | const double (* RESTRICT V)) | |
| 385 | 379 | { |
| 386 | nl_double cerr = 0; | |
| 387 | nl_double cerr2 = 0; | |
| 380 | double cerr = 0; | |
| 381 | double cerr2 = 0; | |
| 388 | 382 | for (int i = 0; i < this->N(); i++) |
| 389 | 383 | { |
| 390 | const nl_double e = (V[i] - this->m_nets[i]->m_cur_Analog); | |
| 391 | const nl_double e2 = (m_RHS[i] - this->m_last_RHS[i]); | |
| 384 | const double e = (V[i] - this->m_nets[i]->m_cur_Analog); | |
| 385 | const double e2 = (m_RHS[i] - this->m_last_RHS[i]); | |
| 392 | 386 | cerr = (fabs(e) > cerr ? fabs(e) : cerr); |
| 393 | 387 | cerr2 = (fabs(e2) > cerr2 ? fabs(e2) : cerr2); |
| 394 | 388 | } |
| r243192 | r243193 | |
| 398 | 392 | |
| 399 | 393 | template <int m_N, int _storage_N> |
| 400 | 394 | ATTR_HOT void netlist_matrix_solver_direct_t<m_N, _storage_N>::store( |
| 401 | const | |
| 395 | const double (* RESTRICT V), const bool store_RHS) | |
| 402 | 396 | { |
| 403 | 397 | for (int i = 0; i < this->N(); i++) |
| 404 | 398 | { |
| r243192 | r243193 | |
| 414 | 408 | } |
| 415 | 409 | |
| 416 | 410 | template <int m_N, int _storage_N> |
| 417 | ATTR_HOT | |
| 411 | ATTR_HOT double netlist_matrix_solver_direct_t<m_N, _storage_N>::vsolve() | |
| 418 | 412 | { |
| 419 | 413 | solve_base<netlist_matrix_solver_direct_t>(this); |
| 420 | 414 | return this->compute_next_timestep(); |
| r243192 | r243193 | |
| 424 | 418 | template <int m_N, int _storage_N> |
| 425 | 419 | ATTR_HOT int netlist_matrix_solver_direct_t<m_N, _storage_N>::solve_non_dynamic() |
| 426 | 420 | { |
| 427 | | |
| 421 | double new_v[_storage_N] = { 0.0 }; | |
| 428 | 422 | |
| 429 | 423 | this->gauss_LE(new_v); |
| 430 | 424 | |
| 431 | 425 | if (this->is_dynamic()) |
| 432 | 426 | { |
| 433 | | |
| 427 | double err = delta(new_v); | |
| 434 | 428 | |
| 435 | 429 | store(new_v, true); |
| 436 | 430 | |
| r243192 | r243193 | |
| 458 | 452 | , m_dim(size) |
| 459 | 453 | , m_lp_fact(0) |
| 460 | 454 | { |
| 461 | m_terms = nl_alloc_array(terms_t *, N()); | |
| 462 | m_rails_temp = nl_alloc_array(terms_t, N()); | |
| 455 | m_terms = new terms_t *[N()]; | |
| 456 | m_rails_temp = new terms_t[N()]; | |
| 463 | 457 | |
| 464 | 458 | for (int k = 0; k < N(); k++) |
| 465 | 459 | { |
| 466 | m_terms[k] = n | |
| 460 | m_terms[k] = new terms_t; | |
| 467 | 461 | m_row_ops[k] = vector_ops_t::create_ops(k); |
| 468 | 462 | } |
| 469 | 463 | m_row_ops[N()] = vector_ops_t::create_ops(N()); |
| r243192 | r243193 | |
| 475 | 469 | , m_dim(size) |
| 476 | 470 | , m_lp_fact(0) |
| 477 | 471 | { |
| 478 | m_terms = nl_alloc_array(terms_t *, N()); | |
| 479 | m_rails_temp = nl_alloc_array(terms_t, N()); | |
| 472 | m_terms = new terms_t *[N()]; | |
| 473 | m_rails_temp = new terms_t[N()]; | |
| 480 | 474 | |
| 481 | for (int k = 0; k < N(); k++) | |
| 482 | { | |
| 483 | m_terms[k] = nl_alloc(terms_t); | |
| 484 | m_row_ops[k] = vector_ops_t::create_ops(k); | |
| 485 | } | |
| 486 | m_row_ops[N()] = vector_ops_t::create_ops(N()); | |
| 475 | for (int k = 0; k < N(); k++) | |
| 476 | { | |
| 477 | m_terms[k] = new terms_t; | |
| 478 | m_row_ops[k] = vector_ops_t::create_ops(k); | |
| 479 | } | |
| 480 | m_row_ops[N()] = vector_ops_t::create_ops(N()); | |
| 487 | 481 | } |
| 488 | 482 | |
| 489 | 483 |
| r243192 | r243193 | |
|---|---|---|
| 18 | 18 | {} |
| 19 | 19 | ATTR_HOT inline int vsolve_non_dynamic(); |
| 20 | 20 | protected: |
| 21 | ATTR_HOT virtual | |
| 21 | ATTR_HOT virtual double vsolve(); | |
| 22 | 22 | private: |
| 23 | 23 | }; |
| 24 | 24 | |
| r243192 | r243193 | |
| 26 | 26 | // netlist_matrix_solver - Direct1 |
| 27 | 27 | // ---------------------------------------------------------------------------------------- |
| 28 | 28 | |
| 29 | ATTR_HOT | |
| 29 | ATTR_HOT double netlist_matrix_solver_direct1_t::vsolve() | |
| 30 | 30 | { |
| 31 | 31 | solve_base<netlist_matrix_solver_direct1_t>(this); |
| 32 | 32 | return this->compute_next_timestep(); |
| r243192 | r243193 | |
| 38 | 38 | this->build_LE(); |
| 39 | 39 | //NL_VERBOSE_OUT(("%f %f\n", new_val, m_RHS[0] / m_A[0][0]); |
| 40 | 40 | |
| 41 | | |
| 41 | double new_val = m_RHS[0] / m_A[0][0]; | |
| 42 | 42 | |
| 43 | nl_double e = (new_val - net->m_cur_Analog); | |
| 44 | nl_double cerr = fabs(e); | |
| 43 | double e = (new_val - net->m_cur_Analog); | |
| 44 | double cerr = fabs(e); | |
| 45 | 45 | |
| 46 | 46 | net->m_cur_Analog = new_val; |
| 47 | 47 |
| r243192 | r243193 | |
|---|---|---|
| 20 | 20 | {} |
| 21 | 21 | ATTR_HOT inline int vsolve_non_dynamic(); |
| 22 | 22 | protected: |
| 23 | ATTR_HOT virtual | |
| 23 | ATTR_HOT virtual double vsolve(); | |
| 24 | 24 | private: |
| 25 | 25 | }; |
| 26 | 26 | |
| r243192 | r243193 | |
| 28 | 28 | // netlist_matrix_solver - Direct2 |
| 29 | 29 | // ---------------------------------------------------------------------------------------- |
| 30 | 30 | |
| 31 | ATTR_HOT | |
| 31 | ATTR_HOT double netlist_matrix_solver_direct2_t::vsolve() | |
| 32 | 32 | { |
| 33 | 33 | solve_base<netlist_matrix_solver_direct2_t>(this); |
| 34 | 34 | return this->compute_next_timestep(); |
| r243192 | r243193 | |
| 38 | 38 | { |
| 39 | 39 | build_LE(); |
| 40 | 40 | |
| 41 | const nl_double a = m_A[0][0]; | |
| 42 | const nl_double b = m_A[0][1]; | |
| 43 | const nl_double c = m_A[1][0]; | |
| 44 | const nl_double d = m_A[1][1]; | |
| 41 | const double a = m_A[0][0]; | |
| 42 | const double b = m_A[0][1]; | |
| 43 | const double c = m_A[1][0]; | |
| 44 | const double d = m_A[1][1]; | |
| 45 | 45 | |
| 46 | | |
| 46 | double new_val[2]; | |
| 47 | 47 | new_val[1] = (a * m_RHS[1] - c * m_RHS[0]) / (a * d - b * c); |
| 48 | 48 | new_val[0] = (m_RHS[0] - b * new_val[1]) / a; |
| 49 | 49 | |
| 50 | 50 | if (is_dynamic()) |
| 51 | 51 | { |
| 52 | | |
| 52 | double err = this->delta(new_val); | |
| 53 | 53 | store(new_val, true); |
| 54 | 54 | if (err > m_params.m_accuracy ) |
| 55 | 55 | return 2; |
| r243192 | r243193 | |
|---|---|---|
| 17 | 17 | public: |
| 18 | 18 | |
| 19 | 19 | netlist_matrix_solver_gauss_seidel_t(const netlist_solver_parameters_t ¶ms, int size) |
| 20 | ||
| 20 | : netlist_matrix_solver_direct_t<m_N, _storage_N>(netlist_matrix_solver_t::GAUSS_SEIDEL, params, size) | |
| 21 | 21 | , m_lp_fact(0) |
| 22 | 22 | , m_gs_fail(0) |
| 23 | 23 | , m_gs_total(0) |
| 24 | { | |
| 25 | const char *p = osd_getenv("NETLIST_STATS"); | |
| 26 | if (p != NULL) | |
| 27 | m_log_stats = (bool) atoi(p); | |
| 28 | else | |
| 29 | m_log_stats = false; | |
| 30 | } | |
| 24 | {} | |
| 31 | 25 | |
| 32 | 26 | virtual ~netlist_matrix_solver_gauss_seidel_t() {} |
| 33 | 27 | |
| r243192 | r243193 | |
| 35 | 29 | |
| 36 | 30 | ATTR_HOT inline int vsolve_non_dynamic(); |
| 37 | 31 | protected: |
| 38 | ATTR_HOT virtual | |
| 32 | ATTR_HOT virtual double vsolve(); | |
| 39 | 33 | |
| 40 | 34 | private: |
| 41 | | |
| 35 | double m_lp_fact; | |
| 42 | 36 | int m_gs_fail; |
| 43 | 37 | int m_gs_total; |
| 44 | bool m_log_stats; | |
| 45 | 38 | |
| 46 | 39 | }; |
| 47 | 40 | |
| r243192 | r243193 | |
| 52 | 45 | template <int m_N, int _storage_N> |
| 53 | 46 | void netlist_matrix_solver_gauss_seidel_t<m_N, _storage_N>::log_stats() |
| 54 | 47 | { |
| 55 | if (this->m_stat_calculations != 0 && m_log_stats) | |
| 56 | { | |
| 57 | printf("==============================================\n"); | |
| 58 | printf("Solver %s\n", this->name().cstr()); | |
| 59 | printf(" ==> %d nets\n", this->N()); //, (*(*groups[i].first())->m_core_terms.first())->name().cstr()); | |
| 60 | printf(" has %s elements\n", this->is_dynamic() ? "dynamic" : "no dynamic"); | |
| 61 | printf(" has %s elements\n", this->is_timestep() ? "timestep" : "no timestep"); | |
| 62 | printf(" %6.3f average newton raphson loops\n", (double) this->m_stat_newton_raphson / (double) this->m_stat_vsolver_calls); | |
| 63 | printf(" %10d invocations (%6d Hz) %10d gs fails (%6.2f%%) %6.3f average\n", | |
| 64 | this->m_stat_calculations, | |
| 65 | this->m_stat_calculations * 10 / (int) (this->netlist().time().as_double() * 10.0), | |
| 66 | this->m_gs_fail, | |
| 67 | 100.0 * (double) this->m_gs_fail / (double) this->m_stat_calculations, | |
| 68 | (double) this->m_gs_total / (double) this->m_stat_calculations); | |
| 69 | } | |
| 48 | #if 1 | |
| 49 | if (this->m_stat_calculations == 0) | |
| 50 | return; | |
| 51 | printf("==============================================\n"); | |
| 52 | printf("Solver %s\n", this->name().cstr()); | |
| 53 | printf(" ==> %d nets\n", this->N()); //, (*(*groups[i].first())->m_core_terms.first())->name().cstr()); | |
| 54 | printf(" has %s elements\n", this->is_dynamic() ? "dynamic" : "no dynamic"); | |
| 55 | printf(" has %s elements\n", this->is_timestep() ? "timestep" : "no timestep"); | |
| 56 | printf(" %6.3f average newton raphson loops\n", (double) this->m_stat_newton_raphson / (double) this->m_stat_vsolver_calls); | |
| 57 | printf(" %10d invocations (%6d Hz) %10d gs fails (%6.2f%%) %6.3f average\n", | |
| 58 | this->m_stat_calculations, | |
| 59 | this->m_stat_calculations * 10 / (int) (this->netlist().time().as_double() * 10.0), | |
| 60 | this->m_gs_fail, | |
| 61 | 100.0 * (double) this->m_gs_fail / (double) this->m_stat_calculations, | |
| 62 | (double) this->m_gs_total / (double) this->m_stat_calculations); | |
| 63 | #endif | |
| 70 | 64 | } |
| 71 | 65 | |
| 72 | 66 | template <int m_N, int _storage_N> |
| 73 | ATTR_HOT | |
| 67 | ATTR_HOT double netlist_matrix_solver_gauss_seidel_t<m_N, _storage_N>::vsolve() | |
| 74 | 68 | { |
| 75 | 69 | /* |
| 76 | 70 | * enable linear prediction on first newton pass |
| r243192 | r243193 | |
| 92 | 86 | |
| 93 | 87 | if (USE_LINEAR_PREDICTION) |
| 94 | 88 | { |
| 95 | nl_double sq = 0; | |
| 96 | nl_double sqo = 0; | |
| 97 | const nl_double rez_cts = 1.0 / this->current_timestep(); | |
| 89 | double sq = 0; | |
| 90 | double sqo = 0; | |
| 91 | const double rez_cts = 1.0 / this->current_timestep(); | |
| 98 | 92 | for (int k = 0; k < this->N(); k++) |
| 99 | 93 | { |
| 100 | 94 | const netlist_analog_net_t *n = this->m_nets[k]; |
| 101 | const | |
| 95 | const double nv = (n->m_cur_Analog - this->m_last_V[k]) * rez_cts ; | |
| 102 | 96 | sq += nv * nv; |
| 103 | 97 | sqo += this->m_Vdelta[k] * this->m_Vdelta[k]; |
| 104 | 98 | this->m_Vdelta[k] = nv; |
| r243192 | r243193 | |
| 122 | 116 | */ |
| 123 | 117 | |
| 124 | 118 | #if 0 || USE_MATRIX_GS |
| 125 | static nl_double ws = 1.0; | |
| 126 | ATTR_ALIGN nl_double new_v[_storage_N] = { 0.0 }; | |
| 119 | static double ws = 1.0; | |
| 120 | ATTR_ALIGN double new_v[_storage_N] = { 0.0 }; | |
| 127 | 121 | const int iN = this->N(); |
| 128 | 122 | |
| 129 | 123 | bool resched = false; |
| r243192 | r243193 | |
| 133 | 127 | this->build_LE(); |
| 134 | 128 | |
| 135 | 129 | { |
| 136 | | |
| 130 | double frob; | |
| 137 | 131 | frob = 0; |
| 138 | | |
| 132 | double rmin = 1e99, rmax = -1e99; | |
| 139 | 133 | for (int k = 0; k < iN; k++) |
| 140 | 134 | { |
| 141 | 135 | new_v[k] = this->m_nets[k]->m_cur_Analog; |
| 142 | | |
| 136 | double s=0.0; | |
| 143 | 137 | for (int i = 0; i < iN; i++) |
| 144 | 138 | { |
| 145 | 139 | frob += this->m_A[k][i] * this->m_A[k][i]; |
| r243192 | r243193 | |
| 152 | 146 | rmax = s; |
| 153 | 147 | } |
| 154 | 148 | #if 0 |
| 155 | | |
| 149 | double frobA = sqrt(frob /(iN)); | |
| 156 | 150 | if (1 &&frobA < 1.0) |
| 157 | 151 | //ws = 2.0 / (1.0 + sqrt(1.0-frobA)); |
| 158 | 152 | ws = 2.0 / (2.0 - frobA); |
| r243192 | r243193 | |
| 167 | 161 | // overhead is bigger than the gain. Consequently the fast GS below |
| 168 | 162 | // uses a fixed GS. One can however use this here to determine a |
| 169 | 163 | // suitable parameter. |
| 170 | | |
| 164 | double rm = (rmax + rmin) * 0.5; | |
| 171 | 165 | if (rm < 1.0) |
| 172 | 166 | ws = 2.0 / (1.0 + sqrt(1.0-rm)); |
| 173 | 167 | else |
| r243192 | r243193 | |
| 178 | 172 | } |
| 179 | 173 | |
| 180 | 174 | // Frobenius norm for (D-L)^(-1)U |
| 181 | //nl_double frobU; | |
| 182 | //nl_double frobL; | |
| 183 | //nl_double norm; | |
| 175 | //double frobU; | |
| 176 | //double frobL; | |
| 177 | //double norm; | |
| 184 | 178 | do { |
| 185 | 179 | resched = false; |
| 186 | | |
| 180 | double cerr = 0.0; | |
| 187 | 181 | //frobU = 0; |
| 188 | 182 | //frobL = 0; |
| 189 | 183 | //norm = 0; |
| 190 | 184 | |
| 191 | 185 | for (int k = 0; k < iN; k++) |
| 192 | 186 | { |
| 193 | nl_double Idrive = 0; | |
| 194 | //nl_double norm_t = 0; | |
| 187 | double Idrive = 0; | |
| 188 | //double norm_t = 0; | |
| 195 | 189 | // Reduction loops need -ffast-math |
| 196 | 190 | for (int i = 0; i < iN; i++) |
| 197 | 191 | Idrive += this->m_A[k][i] * new_v[i]; |
| r243192 | r243193 | |
| 204 | 198 | } |
| 205 | 199 | |
| 206 | 200 | //if (norm_t > norm) norm = norm_t; |
| 207 | const | |
| 201 | const 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]; | |
| 208 | 202 | |
| 209 | const | |
| 203 | const double e = fabs(new_val - new_v[k]); | |
| 210 | 204 | cerr = (e > cerr ? e : cerr); |
| 211 | 205 | new_v[k] = new_val; |
| 212 | 206 | } |
| r243192 | r243193 | |
| 216 | 210 | resched = true; |
| 217 | 211 | } |
| 218 | 212 | resched_cnt++; |
| 219 | //ATTR_UNUSED | |
| 213 | //ATTR_UNUSED double frobUL = sqrt((frobU + frobL) / (double) (iN) / (double) (iN)); | |
| 220 | 214 | } while (resched && (resched_cnt < this->m_params.m_gs_loops)); |
| 221 | 215 | //printf("Frobenius %f %f %f %f %f\n", sqrt(frobU), sqrt(frobL), frobUL, frobA, norm); |
| 222 | 216 | //printf("Omega Estimate1 %f %f\n", 2.0 / (1.0 + sqrt(1-frobUL)), 2.0 / (1.0 + sqrt(1-frobA)) ); // printf("Frobenius %f\n", sqrt(frob / (double) (iN * iN) )); |
| r243192 | r243193 | |
| 253 | 247 | * omega = 2.0 / (1.0 + sqrt(1-rho)) |
| 254 | 248 | */ |
| 255 | 249 | |
| 256 | 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))); | |
| 257 | //const nl_double ws = 2.0 / (1.0 + sin(3.14159 * 4 / (double) (this->N()))); | |
| 250 | const double ws = this->m_params.m_sor; //1.045; //2.0 / (1.0 + /*sin*/(3.14159 * 5.5 / (double) (m_nets.count()+1))); | |
| 251 | //const double ws = 2.0 / (1.0 + sin(3.14159 * 4 / (double) (this->N()))); | |
| 258 | 252 | |
| 259 | ATTR_ALIGN nl_double w[_storage_N]; | |
| 260 | ATTR_ALIGN nl_double one_m_w[_storage_N]; | |
| 261 | ATTR_ALIGN nl_double RHS[_storage_N]; | |
| 262 | ATTR_ALIGN nl_double new_V[_storage_N]; | |
| 253 | ATTR_ALIGN double w[_storage_N]; | |
| 254 | ATTR_ALIGN double one_m_w[_storage_N]; | |
| 255 | ATTR_ALIGN double RHS[_storage_N]; | |
| 256 | ATTR_ALIGN double new_V[_storage_N]; | |
| 263 | 257 | |
| 264 | 258 | for (int k = 0; k < iN; k++) |
| 265 | 259 | { |
| 266 | nl_double gtot_t = 0.0; | |
| 267 | nl_double gabs_t = 0.0; | |
| 268 | nl_double RHS_t = 0.0; | |
| 260 | double gtot_t = 0.0; | |
| 261 | double gabs_t = 0.0; | |
| 262 | double RHS_t = 0.0; | |
| 269 | 263 | |
| 270 | 264 | new_V[k] = this->m_nets[k]->m_cur_Analog; |
| 271 | 265 | |
| 272 | 266 | { |
| 273 | 267 | const int term_count = this->m_terms[k]->count(); |
| 274 | const nl_double * const RESTRICT gt = this->m_terms[k]->gt(); | |
| 275 | const nl_double * const RESTRICT go = this->m_terms[k]->go(); | |
| 276 | const nl_double * const RESTRICT Idr = this->m_terms[k]->Idr(); | |
| 277 | const nl_double * const *other_cur_analog = this->m_terms[k]->other_curanalog(); | |
| 268 | const double * const RESTRICT gt = this->m_terms[k]->gt(); | |
| 269 | const double * const RESTRICT go = this->m_terms[k]->go(); | |
| 270 | const double * const RESTRICT Idr = this->m_terms[k]->Idr(); | |
| 271 | const double * const *other_cur_analog = this->m_terms[k]->other_curanalog(); | |
| 278 | 272 | #if VECTALT |
| 279 | 273 | for (int i = 0; i < term_count; i++) |
| 280 | 274 | { |
| r243192 | r243193 | |
| 299 | 293 | //if (fabs(gabs_t - fabs(gtot_t)) > 1e-20) |
| 300 | 294 | // printf("%d %e abs: %f tot: %f\n",k, gabs_t / gtot_t -1.0, gabs_t, gtot_t); |
| 301 | 295 | |
| 302 | ||
| 296 | gabs_t *= 0.95; // avoid rounding issues | |
| 303 | 297 | if (!USE_GABS || gabs_t <= gtot_t) |
| 304 | 298 | { |
| 305 | 299 | w[k] = ws / gtot_t; |
| r243192 | r243193 | |
| 314 | 308 | |
| 315 | 309 | } |
| 316 | 310 | |
| 317 | const | |
| 311 | const double accuracy = this->m_params.m_accuracy; | |
| 318 | 312 | |
| 319 | 313 | do { |
| 320 | 314 | resched = false; |
| r243192 | r243193 | |
| 323 | 317 | { |
| 324 | 318 | const int * RESTRICT net_other = this->m_terms[k]->net_other(); |
| 325 | 319 | const int railstart = this->m_terms[k]->m_railstart; |
| 326 | const | |
| 320 | const double * RESTRICT go = this->m_terms[k]->go(); | |
| 327 | 321 | |
| 328 | | |
| 322 | double Idrive = 0.0; | |
| 329 | 323 | for (int i = 0; i < railstart; i++) |
| 330 | 324 | Idrive = Idrive + go[i] * new_V[net_other[i]]; |
| 331 | 325 | |
| 332 | //nl_double new_val = (net->m_cur_Analog * gabs[k] + iIdr) / (gtot[k]); | |
| 333 | const nl_double new_val = new_V[k] * one_m_w[k] + (Idrive + RHS[k]) * w[k]; | |
| 326 | //double new_val = (net->m_cur_Analog * gabs[k] + iIdr) / (gtot[k]); | |
| 327 | const double new_val = new_V[k] * one_m_w[k] + (Idrive + RHS[k]) * w[k]; | |
| 334 | 328 | |
| 335 | 329 | resched = resched || (std::abs(new_val - new_V[k]) > accuracy); |
| 336 | 330 | new_V[k] = new_val; |
| r243192 | r243193 | |
| 343 | 337 | this->m_nets[k]->m_cur_Analog = new_V[k]; |
| 344 | 338 | |
| 345 | 339 | this->m_gs_total += resched_cnt; |
| 346 | ||
| 340 | this->m_stat_calculations++; | |
| 347 | 341 | |
| 348 | 342 | if (resched) |
| 349 | 343 | { |
| r243192 | r243193 | |
|---|---|---|
| 31 | 31 | NET_C(R1.2, R2.2, G1.ON) |
| 32 | 32 | VCVS(G1) |
| 33 | 33 | PARAM(G1.G, 10000000) |
| 34 | ||
| 34 | //PARAM(G1.RI, 1) | |
| 35 | 35 | PARAM(G1.RO, RES_K(8)) |
| 36 | 36 | |
| 37 | 37 | NETLIST_END() |
| r243192 | r243193 | |
|---|---|---|
| 44 | 44 | switch (size) |
| 45 | 45 | { |
| 46 | 46 | case 1: |
| 47 | return n | |
| 47 | return new vector_ops_impl_t<1>(); | |
| 48 | 48 | case 2: |
| 49 | return n | |
| 49 | return new vector_ops_impl_t<2>(); | |
| 50 | 50 | case 3: |
| 51 | return n | |
| 51 | return new vector_ops_impl_t<3>(); | |
| 52 | 52 | case 4: |
| 53 | return n | |
| 53 | return new vector_ops_impl_t<4>(); | |
| 54 | 54 | case 5: |
| 55 | return n | |
| 55 | return new vector_ops_impl_t<5>(); | |
| 56 | 56 | case 6: |
| 57 | return n | |
| 57 | return new vector_ops_impl_t<6>(); | |
| 58 | 58 | case 7: |
| 59 | return n | |
| 59 | return new vector_ops_impl_t<7>(); | |
| 60 | 60 | case 8: |
| 61 | return n | |
| 61 | return new vector_ops_impl_t<8>(); | |
| 62 | 62 | case 9: |
| 63 | return n | |
| 63 | return new vector_ops_impl_t<9>(); | |
| 64 | 64 | case 10: |
| 65 | return n | |
| 65 | return new vector_ops_impl_t<10>(); | |
| 66 | 66 | case 11: |
| 67 | return n | |
| 67 | return new vector_ops_impl_t<11>(); | |
| 68 | 68 | case 12: |
| 69 | return n | |
| 69 | return new vector_ops_impl_t<12>(); | |
| 70 | 70 | default: |
| 71 | return n | |
| 71 | return new vector_ops_impl_t<0>(size); | |
| 72 | 72 | } |
| 73 | 73 | } |
| 74 | 74 | |
| r243192 | r243193 | |
| 91 | 91 | m_term[i]->m_Idr1 = &m_Idr[i]; |
| 92 | 92 | m_other_curanalog[i] = &m_term[i]->m_otherterm->net().as_analog().m_cur_Analog; |
| 93 | 93 | } |
| 94 | ||
| 95 | m_ops = vector_ops_t::create_ops(m_gt.count()); | |
| 94 | 96 | } |
| 95 | 97 | |
| 96 | 98 | // ---------------------------------------------------------------------------------------- |
| r243192 | r243193 | |
| 99 | 101 | |
| 100 | 102 | ATTR_COLD netlist_matrix_solver_t::netlist_matrix_solver_t(const eSolverType type, const netlist_solver_parameters_t ¶ms) |
| 101 | 103 | : m_stat_calculations(0), |
| 102 | m_stat_newton_raphson(0), | |
| 103 | m_stat_vsolver_calls(0), | |
| 104 | m_params(params), | |
| 105 | m_cur_ts(0), | |
| 106 | m_type(type) | |
| 104 | m_stat_newton_raphson(0), | |
| 105 | m_stat_vsolver_calls(0), | |
| 106 | m_params(params), | |
| 107 | m_cur_ts(0), | |
| 108 | m_type(type) | |
| 107 | 109 | { |
| 108 | 110 | } |
| 109 | 111 | |
| 110 | 112 | ATTR_COLD netlist_matrix_solver_t::~netlist_matrix_solver_t() |
| 111 | 113 | { |
| 112 | 114 | for (int i = 0; i < m_inps.count(); i++) |
| 113 | | |
| 115 | delete m_inps[i]; | |
| 114 | 116 | } |
| 115 | 117 | |
| 116 | 118 | ATTR_COLD void netlist_matrix_solver_t::setup(netlist_analog_net_t::list_t &nets) |
| r243192 | r243193 | |
| 174 | 176 | |
| 175 | 177 | if (net_proxy_output == NULL) |
| 176 | 178 | { |
| 177 | net_proxy_output = n | |
| 179 | net_proxy_output = new netlist_analog_output_t(); | |
| 178 | 180 | net_proxy_output->init_object(*this, this->name() + "." + pstring::sprintf("m%d", m_inps.count())); |
| 179 | 181 | m_inps.add(net_proxy_output); |
| 180 | 182 | net_proxy_output->m_proxied_net = &p->net().as_analog(); |
| r243192 | r243193 | |
| 233 | 235 | |
| 234 | 236 | ATTR_COLD void netlist_matrix_solver_t::update() |
| 235 | 237 | { |
| 236 | const | |
| 238 | const double new_timestep = solve(); | |
| 237 | 239 | |
| 238 | 240 | if (m_params.m_dynamic && is_timestep() && new_timestep > 0) |
| 239 | 241 | m_Q_sync.net().reschedule_in_queue(netlist_time::from_double(new_timestep)); |
| r243192 | r243193 | |
| 241 | 243 | |
| 242 | 244 | ATTR_COLD void netlist_matrix_solver_t::update_forced() |
| 243 | 245 | { |
| 244 | ATTR_UNUSED const | |
| 246 | ATTR_UNUSED const double new_timestep = solve(); | |
| 245 | 247 | |
| 246 | 248 | if (m_params.m_dynamic && is_timestep()) |
| 247 | 249 | m_Q_sync.net().reschedule_in_queue(netlist_time::from_double(m_params.m_min_timestep)); |
| r243192 | r243193 | |
| 249 | 251 | |
| 250 | 252 | ATTR_HOT void netlist_matrix_solver_t::step(const netlist_time delta) |
| 251 | 253 | { |
| 252 | const | |
| 254 | const double dd = delta.as_double(); | |
| 253 | 255 | for (int k=0; k < m_step_devices.count(); k++) |
| 254 | 256 | m_step_devices[k]->step_time(dd); |
| 255 | 257 | } |
| r243192 | r243193 | |
| 257 | 259 | template<class C > |
| 258 | 260 | void netlist_matrix_solver_t::solve_base(C *p) |
| 259 | 261 | { |
| 260 | ||
| 262 | m_stat_vsolver_calls++; | |
| 261 | 263 | if (is_dynamic()) |
| 262 | 264 | { |
| 263 | 265 | int this_resched; |
| r243192 | r243193 | |
| 270 | 272 | newton_loops++; |
| 271 | 273 | } while (this_resched > 1 && newton_loops < m_params.m_nr_loops); |
| 272 | 274 | |
| 273 | ||
| 275 | m_stat_newton_raphson += newton_loops; | |
| 274 | 276 | // reschedule .... |
| 275 | 277 | if (this_resched > 1 && !m_Q_sync.net().is_queued()) |
| 276 | 278 | { |
| r243192 | r243193 | |
| 284 | 286 | } |
| 285 | 287 | } |
| 286 | 288 | |
| 287 | ATTR_HOT | |
| 289 | ATTR_HOT double netlist_matrix_solver_t::solve() | |
| 288 | 290 | { |
| 289 | 291 | netlist_time now = netlist().time(); |
| 290 | 292 | netlist_time delta = now - m_last_step; |
| r243192 | r243193 | |
| 300 | 302 | |
| 301 | 303 | step(delta); |
| 302 | 304 | |
| 303 | const | |
| 305 | const double next_time_step = vsolve(); | |
| 304 | 306 | |
| 305 | 307 | update_inputs(); |
| 306 | 308 | return next_time_step; |
| r243192 | r243193 | |
| 348 | 350 | register_param("GMIN", m_gmin, NETLIST_GMIN_DEFAULT); |
| 349 | 351 | register_param("DYNAMIC_TS", m_dynamic, 0); |
| 350 | 352 | register_param("LTE", m_lte, 5e-5); // diff/timestep |
| 351 | register_param("MIN_TIMESTEP", m_min_timestep, 1e-6); // | |
| 353 | register_param("MIN_TIMESTEP", m_min_timestep, 1e-6); // double timestep resolution | |
| 352 | 354 | |
| 353 | 355 | // internal staff |
| 354 | 356 | |
| r243192 | r243193 | |
| 378 | 380 | while (e != NULL) |
| 379 | 381 | { |
| 380 | 382 | netlist_matrix_solver_t * const *en = m_mat_solvers.next(e); |
| 381 | | |
| 383 | delete *e; | |
| 382 | 384 | e = en; |
| 383 | 385 | } |
| 384 | 386 | |
| r243192 | r243193 | |
| 417 | 419 | if (m_mat_solvers[i]->is_timestep()) |
| 418 | 420 | { |
| 419 | 421 | // Ignore return value |
| 420 | ATTR_UNUSED const | |
| 422 | ATTR_UNUSED const double ts = m_mat_solvers[i]->solve(); | |
| 421 | 423 | } |
| 422 | 424 | } |
| 423 | 425 | #endif |
| r243192 | r243193 | |
| 433 | 435 | netlist_matrix_solver_t * NETLIB_NAME(solver)::create_solver(int size, const int gs_threshold, const bool use_specific) |
| 434 | 436 | { |
| 435 | 437 | if (use_specific && m_N == 1) |
| 436 | return n | |
| 438 | return new netlist_matrix_solver_direct1_t(m_params); | |
| 437 | 439 | else if (use_specific && m_N == 2) |
| 438 | return n | |
| 440 | return new netlist_matrix_solver_direct2_t(m_params); | |
| 439 | 441 | else |
| 440 | 442 | { |
| 441 | typedef netlist_matrix_solver_gauss_seidel_t<m_N,_storage_N> solver_N; | |
| 442 | 443 | if (size >= gs_threshold) |
| 443 | return nl_a | |
| 444 | return new netlist_matrix_solver_gauss_seidel_t<m_N,_storage_N>(m_params, size); | |
| 444 | 445 | else |
| 445 | return nl_a | |
| 446 | return new netlist_matrix_solver_direct_t<m_N, _storage_N>(m_params, size); | |
| 446 | 447 | } |
| 447 | 448 | } |
| 448 | 449 |
| r243192 | r243193 | |
|---|---|---|
| 37 | 37 | |
| 38 | 38 | struct netlist_solver_parameters_t |
| 39 | 39 | { |
| 40 | nl_double m_accuracy; | |
| 41 | nl_double m_lte; | |
| 42 | nl_double m_min_timestep; | |
| 43 | nl_double m_max_timestep; | |
| 44 | nl_double m_sor; | |
| 40 | double m_accuracy; | |
| 41 | double m_lte; | |
| 42 | double m_min_timestep; | |
| 43 | double m_max_timestep; | |
| 44 | double m_sor; | |
| 45 | 45 | bool m_dynamic; |
| 46 | 46 | int m_gs_loops; |
| 47 | 47 | int m_nr_loops; |
| r243192 | r243193 | |
| 59 | 59 | |
| 60 | 60 | virtual ~vector_ops_t() {} |
| 61 | 61 | |
| 62 | virtual const nl_double sum(const nl_double * v) = 0; | |
| 63 | virtual void sum2(const nl_double * RESTRICT v1, const nl_double * RESTRICT v2, nl_double & RESTRICT s1, nl_double & RESTRICT s2) = 0; | |
| 64 | virtual void addmult(nl_double * RESTRICT v1, const nl_double * RESTRICT v2, const nl_double &mult) = 0; | |
| 65 | virtual void sum2a(const nl_double * RESTRICT v1, const nl_double * RESTRICT v2, const nl_double * RESTRICT v3abs, nl_double & RESTRICT s1, nl_double & RESTRICT s2, nl_double & RESTRICT s3abs) = 0; | |
| 62 | virtual const double sum(const double * v) = 0; | |
| 63 | virtual void sum2(const double * RESTRICT v1, const double * RESTRICT v2, double & RESTRICT s1, double & RESTRICT s2) = 0; | |
| 64 | virtual void addmult(double * RESTRICT v1, const double * RESTRICT v2, const double &mult) = 0; | |
| 65 | virtual void sum2a(const double * RESTRICT v1, const double * RESTRICT v2, const double * RESTRICT v3abs, double & RESTRICT s1, double & RESTRICT s2, double & RESTRICT s3abs) = 0; | |
| 66 | 66 | |
| 67 | virtual const | |
| 67 | virtual const double sumabs(const double * v) = 0; | |
| 68 | 68 | |
| 69 | 69 | static vector_ops_t *create_ops(const int size); |
| 70 | 70 | |
| r243192 | r243193 | |
| 95 | 95 | |
| 96 | 96 | ATTR_HOT inline const int N() const { if (m_N == 0) return m_dim; else return m_N; } |
| 97 | 97 | |
| 98 | const | |
| 98 | const double sum(const double * v) | |
| 99 | 99 | { |
| 100 | const nl_double * RESTRICT vl = v; | |
| 101 | nl_double tmp = 0.0; | |
| 100 | const double * RESTRICT vl = v; | |
| 101 | double tmp = 0.0; | |
| 102 | 102 | for (int i=0; i < N(); i++) |
| 103 | 103 | tmp += vl[i]; |
| 104 | 104 | return tmp; |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | void sum2(const | |
| 107 | void sum2(const double * RESTRICT v1, const double * RESTRICT v2, double & RESTRICT s1, double & RESTRICT s2) | |
| 108 | 108 | { |
| 109 | const nl_double * RESTRICT v1l = v1; | |
| 110 | const nl_double * RESTRICT v2l = v2; | |
| 109 | const double * RESTRICT v1l = v1; | |
| 110 | const double * RESTRICT v2l = v2; | |
| 111 | 111 | for (int i=0; i < N(); i++) |
| 112 | 112 | { |
| 113 | 113 | s1 += v1l[i]; |
| r243192 | r243193 | |
| 115 | 115 | } |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | void addmult( | |
| 118 | void addmult(double * RESTRICT v1, const double * RESTRICT v2, const double &mult) | |
| 119 | 119 | { |
| 120 | nl_double * RESTRICT v1l = v1; | |
| 121 | const nl_double * RESTRICT v2l = v2; | |
| 120 | double * RESTRICT v1l = v1; | |
| 121 | const double * RESTRICT v2l = v2; | |
| 122 | 122 | for (int i=0; i < N(); i++) |
| 123 | 123 | { |
| 124 | 124 | v1l[i] += v2l[i] * mult; |
| 125 | 125 | } |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | void sum2a(const | |
| 128 | void sum2a(const double * RESTRICT v1, const double * RESTRICT v2, const double * RESTRICT v3abs, double & RESTRICT s1, double & RESTRICT s2, double & RESTRICT s3abs) | |
| 129 | 129 | { |
| 130 | const nl_double * RESTRICT v1l = v1; | |
| 131 | const nl_double * RESTRICT v2l = v2; | |
| 132 | const nl_double * RESTRICT v3l = v3abs; | |
| 130 | const double * RESTRICT v1l = v1; | |
| 131 | const double * RESTRICT v2l = v2; | |
| 132 | const double * RESTRICT v3l = v3abs; | |
| 133 | 133 | for (int i=0; i < N(); i++) |
| 134 | 134 | { |
| 135 | 135 | s1 += v1l[i]; |
| r243192 | r243193 | |
| 138 | 138 | } |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | const | |
| 141 | const double sumabs(const double * v) | |
| 142 | 142 | { |
| 143 | const nl_double * RESTRICT vl = v; | |
| 144 | nl_double tmp = 0.0; | |
| 143 | const double * RESTRICT vl = v; | |
| 144 | double tmp = 0.0; | |
| 145 | 145 | for (int i=0; i < N(); i++) |
| 146 | 146 | tmp += fabs(vl[i]); |
| 147 | 147 | return tmp; |
| r243192 | r243193 | |
| 155 | 155 | NETLIST_PREVENT_COPYING(terms_t) |
| 156 | 156 | |
| 157 | 157 | public: |
| 158 | ATTR_COLD terms_t() : m_railstart(0) | |
| 158 | ATTR_COLD terms_t() : m_railstart(0), m_ops(NULL) | |
| 159 | 159 | {} |
| 160 | 160 | |
| 161 | 161 | ATTR_COLD void clear() |
| r243192 | r243193 | |
| 171 | 171 | |
| 172 | 172 | ATTR_HOT inline netlist_terminal_t **terms() { return m_term; } |
| 173 | 173 | ATTR_HOT inline int *net_other() { return m_net_other; } |
| 174 | ATTR_HOT inline nl_double *gt() { return m_gt; } | |
| 175 | ATTR_HOT inline nl_double *go() { return m_go; } | |
| 176 | ATTR_HOT inline nl_double *Idr() { return m_Idr; } | |
| 177 | ATTR_HOT inline nl_double **other_curanalog() { return m_other_curanalog; } | |
| 174 | ATTR_HOT inline double *gt() { return m_gt; } | |
| 175 | ATTR_HOT inline double *go() { return m_go; } | |
| 176 | ATTR_HOT inline double *Idr() { return m_Idr; } | |
| 177 | ATTR_HOT inline double **other_curanalog() { return m_other_curanalog; } | |
| 178 | ATTR_HOT vector_ops_t *ops() { return m_ops; } | |
| 178 | 179 | |
| 179 | 180 | ATTR_COLD void set_pointers(); |
| 180 | 181 | |
| r243192 | r243193 | |
| 183 | 184 | private: |
| 184 | 185 | plinearlist_t<netlist_terminal_t *> m_term; |
| 185 | 186 | plinearlist_t<int> m_net_other; |
| 186 | plinearlist_t<nl_double> m_go; | |
| 187 | plinearlist_t<nl_double> m_gt; | |
| 188 | plinearlist_t<nl_double> m_Idr; | |
| 189 | plinearlist_t<nl_double *> m_other_curanalog; | |
| 187 | plinearlist_t<double> m_go; | |
| 188 | plinearlist_t<double> m_gt; | |
| 189 | plinearlist_t<double> m_Idr; | |
| 190 | plinearlist_t<double *> m_other_curanalog; | |
| 191 | vector_ops_t * m_ops; | |
| 190 | 192 | }; |
| 191 | 193 | |
| 192 | 194 | class netlist_matrix_solver_t : public netlist_device_t |
| r243192 | r243193 | |
| 197 | 199 | |
| 198 | 200 | enum eSolverType |
| 199 | 201 | { |
| 200 | GAUSSIAN_ELIMINATION, | |
| 201 | GAUSS_SEIDEL | |
| 202 | GAUSSIAN_ELIMINATION, | |
| 203 | GAUSS_SEIDEL | |
| 202 | 204 | }; |
| 203 | 205 | |
| 204 | 206 | ATTR_COLD netlist_matrix_solver_t(const eSolverType type, const netlist_solver_parameters_t ¶ms); |
| r243192 | r243193 | |
| 209 | 211 | template<class C> |
| 210 | 212 | void solve_base(C *p); |
| 211 | 213 | |
| 212 | ATTR_HOT | |
| 214 | ATTR_HOT double solve(); | |
| 213 | 215 | |
| 214 | 216 | ATTR_HOT inline bool is_dynamic() { return m_dynamic_devices.count() > 0; } |
| 215 | 217 | ATTR_HOT inline bool is_timestep() { return m_step_devices.count() > 0; } |
| r243192 | r243193 | |
| 236 | 238 | ATTR_HOT void update_dynamic(); |
| 237 | 239 | |
| 238 | 240 | // should return next time step |
| 239 | ATTR_HOT virtual | |
| 241 | ATTR_HOT virtual double vsolve() = 0; | |
| 240 | 242 | |
| 241 | 243 | ATTR_COLD virtual void add_term(int net_idx, netlist_terminal_t *term) = 0; |
| 242 | 244 | |
| 243 | 245 | plinearlist_t<netlist_analog_net_t *> m_nets; |
| 244 | 246 | plinearlist_t<netlist_analog_output_t *> m_inps; |
| 245 | 247 | |
| 246 | int m_stat_calculations; | |
| 247 | int m_stat_newton_raphson; | |
| 248 | int m_stat_vsolver_calls; | |
| 248 | int m_stat_calculations; | |
| 249 | int m_stat_newton_raphson; | |
| 250 | int m_stat_vsolver_calls; | |
| 249 | 251 | |
| 250 | 252 | const netlist_solver_parameters_t &m_params; |
| 251 | 253 | |
| 252 | ATTR_HOT inline const | |
| 254 | ATTR_HOT inline const double current_timestep() { return m_cur_ts; } | |
| 253 | 255 | private: |
| 254 | 256 | |
| 255 | 257 | netlist_time m_last_step; |
| 256 | | |
| 258 | double m_cur_ts; | |
| 257 | 259 | dev_list_t m_step_devices; |
| 258 | 260 | dev_list_t m_dynamic_devices; |
| 259 | 261 | |
| r243192 | r243193 | |
| 264 | 266 | |
| 265 | 267 | ATTR_HOT void update_inputs(); |
| 266 | 268 | |
| 267 | ||
| 269 | const eSolverType m_type; | |
| 268 | 270 | }; |
| 269 | 271 | |
| 270 | 272 | |
| r243192 | r243193 | |
| 279 | 281 | |
| 280 | 282 | ATTR_COLD void post_start(); |
| 281 | 283 | |
| 282 | ATTR_HOT inline | |
| 284 | ATTR_HOT inline double gmin() { return m_gmin.Value(); } | |
| 283 | 285 | |
| 284 | 286 | protected: |
| 285 | 287 | ATTR_HOT void update(); |
| r243192 | r243193 | |
|---|---|---|
| 16 | 16 | set_param(1e-15, 1, 1e-15); |
| 17 | 17 | } |
| 18 | 18 | |
| 19 | ATTR_COLD void netlist_generic_diode::set_param(const | |
| 19 | ATTR_COLD void netlist_generic_diode::set_param(const double Is, const double n, double gmin) | |
| 20 | 20 | { |
| 21 | 21 | m_Is = Is; |
| 22 | 22 | m_n = n; |
| r243192 | r243193 | |
| 157 | 157 | |
| 158 | 158 | NETLIB_UPDATE_PARAM(POT) |
| 159 | 159 | { |
| 160 | | |
| 160 | double v = m_Dial.Value(); | |
| 161 | 161 | if (m_DialIsLog.Value()) |
| 162 | 162 | v = (exp(v) - 1.0) / (exp(1.0) - 1.0); |
| 163 | 163 | |
| r243192 | r243193 | |
| 221 | 221 | |
| 222 | 222 | NETLIB_UPDATE_PARAM(D) |
| 223 | 223 | { |
| 224 | nl_double Is = m_model.model_value("Is", 1e-15); | |
| 225 | nl_double n = m_model.model_value("N", 1); | |
| 224 | double Is = m_model.model_value("Is", 1e-15); | |
| 225 | double n = m_model.model_value("N", 1); | |
| 226 | 226 | |
| 227 | 227 | m_D.set_param(Is, n, netlist().gmin()); |
| 228 | 228 | } |
| r243192 | r243193 | |
|---|---|---|
| 97 | 97 | { |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | ATTR_HOT inline void set(const | |
| 100 | ATTR_HOT inline void set(const double G, const double V, const double I) | |
| 101 | 101 | { |
| 102 | 102 | /* GO, GT, I */ |
| 103 | 103 | m_P.set( G, G, ( V) * G - I); |
| 104 | 104 | m_N.set( G, G, ( -V) * G + I); |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | ATTR_HOT inline | |
| 107 | ATTR_HOT inline double deltaV() const | |
| 108 | 108 | { |
| 109 | 109 | return m_P.net().as_analog().Q_Analog() - m_N.net().as_analog().Q_Analog(); |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | ATTR_HOT void set_mat( | |
| 112 | ATTR_HOT void set_mat(double a11, double a12, double a21, double a22, double r1, double r2) | |
| 113 | 113 | { |
| 114 | 114 | /* GO, GT, I */ |
| 115 | 115 | m_P.set(-a12, a11, -r1); |
| r243192 | r243193 | |
| 133 | 133 | public: |
| 134 | 134 | ATTR_COLD NETLIB_NAME(R_base)() : NETLIB_NAME(twoterm)(RESISTOR) { } |
| 135 | 135 | |
| 136 | inline void set_R(const | |
| 136 | inline void set_R(const double R) | |
| 137 | 137 | { |
| 138 | 138 | set(1.0 / R, 0.0, 0.0); |
| 139 | 139 | } |
| r243192 | r243193 | |
| 171 | 171 | public: |
| 172 | 172 | ATTR_COLD NETLIB_NAME(C)() : NETLIB_NAME(twoterm)(CAPACITOR) { } |
| 173 | 173 | |
| 174 | ATTR_HOT void step_time(const | |
| 174 | ATTR_HOT void step_time(const double st) | |
| 175 | 175 | { |
| 176 | const nl_double G = m_C.Value() / st; | |
| 177 | const nl_double I = -G * deltaV(); | |
| 176 | const double G = m_C.Value() / st; | |
| 177 | const double I = -G * deltaV(); | |
| 178 | 178 | set(G, 0.0, I); |
| 179 | 179 | } |
| 180 | 180 | |
| r243192 | r243193 | |
| 198 | 198 | public: |
| 199 | 199 | ATTR_COLD netlist_generic_diode(); |
| 200 | 200 | |
| 201 | ATTR_HOT inline void update_diode(const | |
| 201 | ATTR_HOT inline void update_diode(const double nVd) | |
| 202 | 202 | { |
| 203 | 203 | //FIXME: Optimize cutoff case |
| 204 | 204 | |
| r243192 | r243193 | |
| 212 | 212 | { |
| 213 | 213 | m_Vd = nVd; |
| 214 | 214 | |
| 215 | const | |
| 215 | const double eVDVt = exp(m_Vd * m_VtInv); | |
| 216 | 216 | m_Id = m_Is * (eVDVt - 1.0); |
| 217 | 217 | m_G = m_Is * m_VtInv * eVDVt + m_gmin; |
| 218 | 218 | } |
| r243192 | r243193 | |
| 221 | 221 | #if defined(_MSC_VER) && _MSC_VER < 1800 |
| 222 | 222 | m_Vd = m_Vd + log((nVd - m_Vd) * m_VtInv + 1.0) * m_Vt; |
| 223 | 223 | #else |
| 224 | | |
| 224 | double a = (nVd - m_Vd) * m_VtInv; | |
| 225 | 225 | if (a<1e-12 - 1.0) a = 1e-12 - 1.0; |
| 226 | 226 | m_Vd = m_Vd + log1p(a) * m_Vt; |
| 227 | 227 | #endif |
| 228 | const | |
| 228 | const double eVDVt = exp(m_Vd * m_VtInv); | |
| 229 | 229 | m_Id = m_Is * (eVDVt - 1.0); |
| 230 | 230 | |
| 231 | 231 | m_G = m_Is * m_VtInv * eVDVt + m_gmin; |
| r243192 | r243193 | |
| 234 | 234 | //printf("nVd %f m_Vd %f Vcrit %f\n", nVd, m_Vd, m_Vcrit); |
| 235 | 235 | } |
| 236 | 236 | |
| 237 | ATTR_COLD void set_param(const | |
| 237 | ATTR_COLD void set_param(const double Is, const double n, double gmin); | |
| 238 | 238 | |
| 239 | ATTR_HOT inline nl_double I() const { return m_Id; } | |
| 240 | ATTR_HOT inline nl_double G() const { return m_G; } | |
| 241 | ATTR_HOT inline nl_double Ieq() const { return (m_Id - m_Vd * m_G); } | |
| 242 | ATTR_HOT inline nl_double Vd() const { return m_Vd; } | |
| 239 | ATTR_HOT inline double I() const { return m_Id; } | |
| 240 | ATTR_HOT inline double G() const { return m_G; } | |
| 241 | ATTR_HOT inline double Ieq() const { return (m_Id - m_Vd * m_G); } | |
| 242 | ATTR_HOT inline double Vd() const { return m_Vd; } | |
| 243 | 243 | |
| 244 | 244 | /* owning object must save those ... */ |
| 245 | 245 | |
| 246 | 246 | ATTR_COLD void save(pstring name, netlist_object_t &parent); |
| 247 | 247 | |
| 248 | 248 | private: |
| 249 | nl_double m_Vd; | |
| 250 | nl_double m_Id; | |
| 251 | nl_double m_G; | |
| 249 | double m_Vd; | |
| 250 | double m_Id; | |
| 251 | double m_G; | |
| 252 | 252 | |
| 253 | nl_double m_Vt; | |
| 254 | nl_double m_Is; | |
| 255 | nl_double m_n; | |
| 256 | nl_double m_gmin; | |
| 253 | double m_Vt; | |
| 254 | double m_Is; | |
| 255 | double m_n; | |
| 256 | double m_gmin; | |
| 257 | 257 | |
| 258 | nl_double m_VtInv; | |
| 259 | nl_double m_Vcrit; | |
| 258 | double m_VtInv; | |
| 259 | double m_Vcrit; | |
| 260 | 260 | }; |
| 261 | 261 | |
| 262 | 262 | // ---------------------------------------------------------------------------------------- |
| r243192 | r243193 | |
| 268 | 268 | // add c3 and it'll be better than 1% |
| 269 | 269 | |
| 270 | 270 | #if 0 |
| 271 | inline | |
| 271 | inline double fastexp_h(const double x) | |
| 272 | 272 | { |
| 273 | static const nl_double ln2r = 1.442695040888963387; | |
| 274 | static const nl_double ln2 = 0.693147180559945286; | |
| 275 | //static const nl_double c3 = 0.166666666666666667; | |
| 273 | static const double ln2r = 1.442695040888963387; | |
| 274 | static const double ln2 = 0.693147180559945286; | |
| 275 | //static const double c3 = 0.166666666666666667; | |
| 276 | 276 | |
| 277 | const | |
| 277 | const double y = x * ln2r; | |
| 278 | 278 | const unsigned int t = y; |
| 279 | const nl_double z = (x - ln2 * (double) t); | |
| 280 | const nl_double zz = z * z; | |
| 281 | //const nl_double zzz = zz * z; | |
| 279 | const double z = (x - ln2 * (double) t); | |
| 280 | const double zz = z * z; | |
| 281 | //const double zzz = zz * z; | |
| 282 | 282 | |
| 283 | 283 | return (double)(1 << t)*(1.0 + z + 0.5 * zz); // + c3*zzz; |
| 284 | 284 | } |
| 285 | 285 | |
| 286 | inline | |
| 286 | inline double fastexp(const double x) | |
| 287 | 287 | { |
| 288 | 288 | if (x<0) |
| 289 | 289 | return 1.0 / fastexp_h(-x); |
| r243192 | r243193 | |
|---|---|---|
| 49 | 49 | |
| 50 | 50 | #include "net_lib.h" |
| 51 | 51 | #include "nld_system.h" |
| 52 | #include "../nl_factory.h" | |
| 53 | 52 | |
| 54 | 53 | NETLIST_START(diode_models) |
| 55 | 54 | NET_MODEL(".model 1N914 D(Is=2.52n Rs=.568 N=1.752 Cjo=4p M=.4 tt=20n Iave=200m Vpk=75 mfg=OnSemi type=silicon)") |
| r243192 | r243193 | |
| 65 | 64 | |
| 66 | 65 | |
| 67 | 66 | #define xstr(s) # s |
| 68 | #define ENTRY1(_nic, _name, _defparam) | |
| 67 | #define ENTRY1(_nic, _name, _defparam) register_device<_nic>( # _name, xstr(_nic), _defparam ); | |
| 69 | 68 | #define ENTRY(_nic, _name, _defparam) ENTRY1(NETLIB_NAME(_nic), _name, _defparam) |
| 70 | 69 | |
| 71 | ||
| 70 | netlist_factory_t::netlist_factory_t() | |
| 72 | 71 | { |
| 72 | } | |
| 73 | ||
| 74 | netlist_factory_t::~netlist_factory_t() | |
| 75 | { | |
| 76 | for (net_device_t_base_factory * const *e = m_list.first(); e != NULL; e = m_list.next(e)) | |
| 77 | { | |
| 78 | net_device_t_base_factory *p = *e; | |
| 79 | delete p; | |
| 80 | } | |
| 81 | m_list.clear(); | |
| 82 | } | |
| 83 | ||
| 84 | void netlist_factory_t::initialize() | |
| 85 | { | |
| 73 | 86 | ENTRY(R, RES, "R") |
| 74 | 87 | ENTRY(POT, POT, "R") |
| 75 | 88 | ENTRY(C, CAP, "C") |
| r243192 | r243193 | |
| 78 | 91 | ENTRY(VCCS, VCCS, "-") |
| 79 | 92 | ENTRY(CCCS, CCCS, "-") |
| 80 | 93 | ENTRY(dummy_input, DUMMY_INPUT, "-") |
| 81 | ||
| 94 | ENTRY(frontier, FRONTIER, "+I,Q") | |
| 82 | 95 | ENTRY(QBJT_EB, QBJT_EB, "model") |
| 83 | 96 | ENTRY(QBJT_switch, QBJT_SW, "model") |
| 84 | 97 | ENTRY(ttl_input, TTL_INPUT, "IN") |
| r243192 | r243193 | |
| 148 | 161 | ENTRY(SN74LS629_dip, SN74LS629_DIP, "1.CAP1,2.CAP2") |
| 149 | 162 | ENTRY(NE555_dip, NE555_DIP, "-") |
| 150 | 163 | } |
| 164 | ||
| 165 | netlist_device_t *netlist_factory_t::new_device_by_classname(const pstring &classname, netlist_setup_t &setup) const | |
| 166 | { | |
| 167 | for (net_device_t_base_factory * const *e = m_list.first(); e != NULL; e = m_list.next(e)) | |
| 168 | { | |
| 169 | net_device_t_base_factory *p = *e; | |
| 170 | if (strcmp(p->classname(), classname) == 0) | |
| 171 | { | |
| 172 | netlist_device_t *ret = p->Create(); | |
| 173 | return ret; | |
| 174 | } | |
| 175 | p++; | |
| 176 | } | |
| 177 | setup.netlist().error("Class %s not found!\n", classname.cstr()); | |
| 178 | return NULL; // appease code analysis | |
| 179 | } | |
| 180 | ||
| 181 | netlist_device_t *netlist_factory_t::new_device_by_name(const pstring &name, netlist_setup_t &setup) const | |
| 182 | { | |
| 183 | net_device_t_base_factory *f = factory_by_name(name, setup); | |
| 184 | return f->Create(); | |
| 185 | } | |
| 186 | ||
| 187 | net_device_t_base_factory * netlist_factory_t::factory_by_name(const pstring &name, netlist_setup_t &setup) const | |
| 188 | { | |
| 189 | for (net_device_t_base_factory * const *e = m_list.first(); e != NULL; e = m_list.next(e)) | |
| 190 | { | |
| 191 | net_device_t_base_factory *p = *e; | |
| 192 | if (strcmp(p->name(), name) == 0) | |
| 193 | { | |
| 194 | return p; | |
| 195 | } | |
| 196 | p++; | |
| 197 | } | |
| 198 | setup.netlist().error("Class %s not found!\n", name.cstr()); | |
| 199 | return NULL; // appease code analysis | |
| 200 | } |
| r243192 | r243193 | |
|---|---|---|
| 99 | 99 | NETLIST_EXTERNAL(diode_models); |
| 100 | 100 | NETLIST_EXTERNAL(bjt_models); |
| 101 | 101 | |
| 102 | void nl_initialize_factory(netlist_factory_t &factory); | |
| 103 | ||
| 104 | 102 | #endif |
| r243192 | r243193 | |
|---|---|---|
| 43 | 43 | register_output("Q5", m_Q[4]); |
| 44 | 44 | register_output("Q6", m_Q[5]); |
| 45 | 45 | register_output("Q7", m_Q[6]); |
| 46 | ||
| 46 | register_output("Q8", m_Q[7]); | |
| 47 | 47 | register_output("Q9", m_Q[8]); |
| 48 | 48 | register_output("Q10", m_Q[9]); |
| 49 | 49 | register_output("Q11", m_Q[10]); |
| r243192 | r243193 | |
| 125 | 125 | register_subalias("7", sub.m_Q[3]); |
| 126 | 126 | register_subalias("8", m_supply.m_vss); |
| 127 | 127 | |
| 128 | register_subalias("9", sub.m_Q[ | |
| 128 | register_subalias("9", sub.m_Q[1]); | |
| 129 | 129 | register_subalias("10", sub.m_IP); |
| 130 | 130 | register_subalias("11", m_RESET); |
| 131 | 131 | register_subalias("12", sub.m_Q[8]); |
| r243192 | r243193 | |
|---|---|---|
| 19 | 19 | |
| 20 | 20 | NETLIB_UPDATE(4066) |
| 21 | 21 | { |
| 22 | nl_double sup = (m_supply.get()->vdd() - m_supply.get()->vss()); | |
| 23 | nl_double low = 0.45 * sup; | |
| 24 | nl_double high = 0.55 * sup; | |
| 25 | nl_double in = INPANALOG(m_control) - m_supply.get()->vss(); | |
| 26 | nl_double rON = 270.0 * 5.0 / sup; | |
| 22 | double sup = (m_supply.get()->vdd() - m_supply.get()->vss()); | |
| 23 | double low = 0.45 * sup; | |
| 24 | double high = 0.55 * sup; | |
| 25 | double in = INPANALOG(m_control) - m_supply.get()->vss(); | |
| 26 | double rON = 270.0 * 5.0 / sup; | |
| 27 | 27 | |
| 28 | 28 | if (in < low) |
| 29 | 29 | { |
| r243192 | r243193 | |
| 53 | 53 | register_subalias("4", m_B.m_R.m_N); |
| 54 | 54 | register_subalias("5", m_B.m_control); |
| 55 | 55 | register_subalias("6", m_C.m_control); |
| 56 | register_ | |
| 56 | register_input("7", m_supply.m_vss); | |
| 57 | 57 | |
| 58 | 58 | register_subalias("8", m_C.m_R.m_P); |
| 59 | 59 | register_subalias("9", m_C.m_R.m_N); |
| r243192 | r243193 | |
| 61 | 61 | register_subalias("11", m_D.m_R.m_N); |
| 62 | 62 | register_subalias("12", m_D.m_control); |
| 63 | 63 | register_subalias("13", m_A.m_control); |
| 64 | register_ | |
| 64 | register_input("14", m_supply.m_vdd); | |
| 65 | 65 | |
| 66 | 66 | } |
| 67 | 67 |
| r243192 | r243193 | |
|---|---|---|
| 69 | 69 | |
| 70 | 70 | if (m_state == 1) |
| 71 | 71 | { |
| 72 | const | |
| 72 | const double vLow = m_KP * TERMANALOG(m_RP.m_P); | |
| 73 | 73 | if (INPANALOG(m_CV) < vLow) |
| 74 | 74 | { |
| 75 | 75 | m_RN.set_R(R_OFF); |
| r243192 | r243193 | |
| 78 | 78 | } |
| 79 | 79 | else if (m_state == 2) |
| 80 | 80 | { |
| 81 | const | |
| 81 | const double vHigh = TERMANALOG(m_RP.m_P) * (1.0 - m_KP); | |
| 82 | 82 | if (INPANALOG(m_CV) > vHigh) |
| 83 | 83 | { |
| 84 | 84 | m_RP.set_R(R_OFF); |
| r243192 | r243193 | |
|---|---|---|
| 104 | 104 | { |
| 105 | 105 | { |
| 106 | 106 | // recompute |
| 107 | nl_double freq; | |
| 108 | nl_double v_freq_2, v_freq_3, v_freq_4; | |
| 109 | nl_double v_freq = INPANALOG(m_FC); | |
| 110 | nl_double v_rng = INPANALOG(m_RNG); | |
| 107 | double freq; | |
| 108 | double v_freq_2, v_freq_3, v_freq_4; | |
| 109 | double v_freq = INPANALOG(m_FC); | |
| 110 | double v_rng = INPANALOG(m_RNG); | |
| 111 | 111 | |
| 112 | 112 | /* coefficients */ |
| 113 | const nl_double k1 = 1.9904769024796283E+03; | |
| 114 | const nl_double k2 = 1.2070059213983407E+03; | |
| 115 | const nl_double k3 = 1.3266985579561108E+03; | |
| 116 | const nl_double k4 = -1.5500979825922698E+02; | |
| 117 | const nl_double k5 = 2.8184536266938172E+00; | |
| 118 | const nl_double k6 = -2.3503421582744556E+02; | |
| 119 | const nl_double k7 = -3.3836786704527788E+02; | |
| 120 | const nl_double k8 = -1.3569136703258670E+02; | |
| 121 | const nl_double k9 = 2.9914575453819188E+00; | |
| 122 | const nl_double k10 = 1.6855569086173170E+00; | |
| 113 | const double k1 = 1.9904769024796283E+03; | |
| 114 | const double k2 = 1.2070059213983407E+03; | |
| 115 | const double k3 = 1.3266985579561108E+03; | |
| 116 | const double k4 = -1.5500979825922698E+02; | |
| 117 | const double k5 = 2.8184536266938172E+00; | |
| 118 | const double k6 = -2.3503421582744556E+02; | |
| 119 | const double k7 = -3.3836786704527788E+02; | |
| 120 | const double k8 = -1.3569136703258670E+02; | |
| 121 | const double k9 = 2.9914575453819188E+00; | |
| 122 | const double k10 = 1.6855569086173170E+00; | |
| 123 | 123 | |
| 124 | 124 | /* scale due to input resistance */ |
| 125 | 125 |
| r243192 | r243193 | |
|---|---|---|
| 21 | 21 | |
| 22 | 22 | protected: |
| 23 | 23 | ATTR_HOT void update() {}; |
| 24 | ATTR_HOT void start() | |
| 25 | { | |
| 26 | register_input("VDD,", m_vdd); | |
| 27 | register_input("VSS,", m_vss); | |
| 28 | }; | |
| 24 | ATTR_HOT void start() | |
| 25 | { | |
| 26 | register_input("VDD,", m_vdd); | |
| 27 | register_input("VSS,", m_vss); | |
| 28 | }; | |
| 29 | 29 | ATTR_HOT void reset() {}; |
| 30 | 30 | |
| 31 | 31 | public: |
| 32 | ATTR_HOT inline nl_double vdd() { return INPANALOG(m_vdd); } | |
| 33 | ATTR_HOT inline nl_double vss() { return INPANALOG(m_vss); } | |
| 32 | ATTR_HOT inline double vdd() { return INPANALOG(m_vdd); } | |
| 33 | ATTR_HOT inline double vss() { return INPANALOG(m_vss); } | |
| 34 | 34 | }; |
| 35 | 35 | |
| 36 | 36 | #endif /* NLD_CMOS_H_ */ |
| r243192 | r243193 | |
|---|---|---|
| 10 | 10 | #define R_OFF (1E20) |
| 11 | 11 | #define R_ON (25) // Datasheet states a maximum discharge of 200mA, R = 5V / 0.2 |
| 12 | 12 | |
| 13 | inline | |
| 13 | inline double NETLIB_NAME(NE555)::clamp(const double v, const double a, const double b) | |
| 14 | 14 | { |
| 15 | nl_double ret = v; | |
| 16 | nl_double vcc = TERMANALOG(m_R1.m_P); | |
| 15 | double ret = v; | |
| 16 | double vcc = TERMANALOG(m_R1.m_P); | |
| 17 | 17 | |
| 18 | 18 | if (ret > vcc - a) |
| 19 | 19 | ret = vcc - a; |
| r243192 | r243193 | |
| 64 | 64 | { |
| 65 | 65 | // FIXME: assumes GND is connected to 0V. |
| 66 | 66 | |
| 67 | | |
| 67 | double vt = clamp(TERMANALOG(m_R2.m_P), 0.7, 1.4); | |
| 68 | 68 | bool bthresh = (INPANALOG(m_THRES) > vt); |
| 69 | 69 | bool btrig = (INPANALOG(m_TRIG) > clamp(TERMANALOG(m_R2.m_N), 0.7, 1.4)); |
| 70 | 70 | bool out = m_last_out; |
| r243192 | r243193 | |
|---|---|---|
| 39 | 39 | |
| 40 | 40 | netlist_state_t<bool> m_last_out; |
| 41 | 41 | |
| 42 | inline | |
| 42 | inline double clamp(const double v, const double a, const double b); | |
| 43 | 43 | |
| 44 | 44 | ); |
| 45 | 45 |
| r243192 | r243193 | |
|---|---|---|
| 32 | 32 | |
| 33 | 33 | update_dev(); |
| 34 | 34 | |
| 35 | | |
| 35 | double V = m_VIN.Value() / (double) (1 << m_num.Value()) * (double) m_val.Value(); | |
| 36 | 36 | |
| 37 | 37 | this->set(1.0 / m_R.Value(), V, 0.0); |
| 38 | 38 | } |
| r243192 | r243193 | |
|---|---|---|
| 118 | 118 | if (state != m_last_state) |
| 119 | 119 | { |
| 120 | 120 | m_last_state = state; |
| 121 | const nl_double R = state ? m_logic_family->m_R_high : m_logic_family->m_R_low; | |
| 122 | const nl_double V = state ? m_logic_family->m_high_V : m_logic_family->m_low_V; | |
| 121 | const double R = state ? m_logic_family->m_R_high : m_logic_family->m_R_low; | |
| 122 | const double V = state ? m_logic_family->m_high_V : m_logic_family->m_low_V; | |
| 123 | 123 | |
| 124 | 124 | // We only need to update the net first if this is a time stepping net |
| 125 | 125 | if (m_RV.m_P.net().as_analog().solver()->is_timestep()) |
| r243192 | r243193 | |
|---|---|---|
| 40 | 40 | NET_REGISTER_DEV(dummy_input, _name) |
| 41 | 41 | |
| 42 | 42 | #define FRONTIER(_name, _IN, _OUT) \ |
| 43 | NET_REGISTER_DEV(frontier, _name) \ | |
| 44 | NET_C(_IN, _name.I) \ | |
| 45 | NET_C(_OUT, _name.Q) | |
| 43 | NET_REGISTER_DEV(frontier, _name) \ | |
| 44 | NET_C(_IN, _name.I) \ | |
| 45 | NET_C(_OUT, _name.Q) \ | |
| 46 | ||
| 46 | 47 | // ----------------------------------------------------------------------------- |
| 47 | 48 | // mainclock |
| 48 | 49 | // ----------------------------------------------------------------------------- |
| r243192 | r243193 | |
| 158 | 159 | class NETLIB_NAME(frontier) : public netlist_device_t |
| 159 | 160 | { |
| 160 | 161 | public: |
| 161 | ATTR_COLD NETLIB_NAME(frontier)() | |
| 162 | : netlist_device_t(DUMMY) { } | |
| 162 | ATTR_COLD NETLIB_NAME(frontier)() | |
| 163 | : netlist_device_t(DUMMY) { } | |
| 163 | 164 | |
| 164 | ||
| 165 | ATTR_COLD virtual ~NETLIB_NAME(frontier)() {} | |
| 165 | 166 | |
| 166 | 167 | protected: |
| 167 | 168 | |
| 168 | ATTR_COLD void start() | |
| 169 | { | |
| 170 | register_input("I", m_I); | |
| 171 | register_output("Q", m_Q); | |
| 172 | } | |
| 169 | ATTR_COLD void start() | |
| 170 | { | |
| 171 | register_input("I", m_I); | |
| 172 | register_output("Q", m_Q); | |
| 173 | } | |
| 173 | 174 | |
| 174 | ATTR_COLD void reset() | |
| 175 | { | |
| 176 | } | |
| 175 | ATTR_COLD void reset() | |
| 176 | { | |
| 177 | } | |
| 177 | 178 | |
| 178 | ATTR_HOT ATTR_ALIGN void update() | |
| 179 | { | |
| 180 | OUTANALOG(m_Q, INPANALOG(m_I)); | |
| 181 | } | |
| 179 | ATTR_HOT ATTR_ALIGN void update() | |
| 180 | { | |
| 181 | OUTANALOG(m_Q, INPANALOG(m_I)); | |
| 182 | } | |
| 182 | 183 | |
| 183 | 184 | private: |
| 184 | netlist_analog_input_t m_I; | |
| 185 | netlist_analog_output_t m_Q; | |
| 185 | netlist_analog_input_t m_I; | |
| 186 | netlist_analog_output_t m_Q; | |
| 186 | 187 | |
| 187 | 188 | }; |
| 188 | 189 |
| r243192 | r243193 | |
|---|---|---|
| 26 | 26 | $(NETLISTOBJ)/nl_base.o \ |
| 27 | 27 | $(NETLISTOBJ)/nl_parser.o \ |
| 28 | 28 | $(NETLISTOBJ)/nl_setup.o \ |
| 29 | $(NETLISTOBJ)/nl_factory.o \ | |
| 30 | 29 | $(NETLISTOBJ)/pstring.o \ |
| 31 | 30 | $(NETLISTOBJ)/pstate.o \ |
| 32 | 31 | $(NETLISTOBJ)/analog/nld_bjt.o \ |
| r243192 | r243193 | |
|---|---|---|
| 152 | 152 | { |
| 153 | 153 | if (!m_nets[i]->isRailNet()) |
| 154 | 154 | { |
| 155 | | |
| 155 | delete m_nets[i]; | |
| 156 | 156 | } |
| 157 | 157 | } |
| 158 | 158 | |
| r243192 | r243193 | |
| 170 | 170 | netlist_object_t::save_register(); |
| 171 | 171 | } |
| 172 | 172 | |
| 173 | ATTR_HOT const | |
| 173 | ATTR_HOT const double netlist_base_t::gmin() const | |
| 174 | 174 | { |
| 175 | 175 | return solver()->gmin(); |
| 176 | 176 | } |
| r243192 | r243193 | |
| 452 | 452 | } |
| 453 | 453 | |
| 454 | 454 | template ATTR_COLD void netlist_device_t::register_param(const pstring &sname, netlist_param_double_t ¶m, const double initialVal); |
| 455 | template ATTR_COLD void netlist_device_t::register_param(const pstring &sname, netlist_param_double_t ¶m, const float initialVal); | |
| 456 | 455 | template ATTR_COLD void netlist_device_t::register_param(const pstring &sname, netlist_param_int_t ¶m, const int initialVal); |
| 457 | 456 | template ATTR_COLD void netlist_device_t::register_param(const pstring &sname, netlist_param_logic_t ¶m, const int initialVal); |
| 458 | 457 | template ATTR_COLD void netlist_device_t::register_param(const pstring &sname, netlist_param_str_t ¶m, const char * const initialVal); |
| r243192 | r243193 | |
| 875 | 874 | net().as_analog().m_cur_Analog = 0.98; |
| 876 | 875 | } |
| 877 | 876 | |
| 878 | ATTR_COLD void netlist_analog_output_t::initial(const | |
| 877 | ATTR_COLD void netlist_analog_output_t::initial(const double val) | |
| 879 | 878 | { |
| 880 | 879 | net().as_analog().m_cur_Analog = val * 0.99; |
| 881 | 880 | } |
| r243192 | r243193 | |
| 932 | 931 | } |
| 933 | 932 | |
| 934 | 933 | |
| 935 | ATTR_COLD | |
| 934 | ATTR_COLD double netlist_param_model_t::model_value(const pstring &entity, const double defval) const | |
| 936 | 935 | { |
| 937 | 936 | pstring tmp = this->Value(); |
| 938 | 937 | // .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) |
| r243192 | r243193 | |
| 946 | 945 | if (pequal < 0) |
| 947 | 946 | netlist().error("parameter %s misformat in model %s temp %s\n", entity.cstr(), Value().cstr(), tmp.cstr()); |
| 948 | 947 | tmp = tmp.substr(pequal+1); |
| 949 | | |
| 948 | double factor = 1.0; | |
| 950 | 949 | switch (*(tmp.right(1).cstr())) |
| 951 | 950 | { |
| 952 | 951 | case 'm': factor = 1e-3; break; |
| r243192 | r243193 | |
| 1001 | 1000 | net.toggle_new_Q(); |
| 1002 | 1001 | net.set_time(netlist().time() + m_inc); |
| 1003 | 1002 | } |
| 1003 | ||
| 1004 | // ---------------------------------------------------------------------------------------- | |
| 1005 | // net_device_t_base_factory | |
| 1006 | // ---------------------------------------------------------------------------------------- | |
| 1007 | ||
| 1008 | ATTR_COLD const nl_util::pstring_list net_device_t_base_factory::term_param_list() | |
| 1009 | { | |
| 1010 | if (m_def_param.startsWith("+")) | |
| 1011 | return nl_util::split(m_def_param.substr(1), ","); | |
| 1012 | else | |
| 1013 | return nl_util::pstring_list(); | |
| 1014 | } | |
| 1015 | ||
| 1016 | ATTR_COLD const nl_util::pstring_list net_device_t_base_factory::def_params() | |
| 1017 | { | |
| 1018 | if (m_def_param.startsWith("+") || m_def_param.equals("-")) | |
| 1019 | return nl_util::pstring_list(); | |
| 1020 | else | |
| 1021 | return nl_util::split(m_def_param, ","); | |
| 1022 | } |
| r243192 | r243193 | |
|---|---|---|
| 272 | 272 | |
| 273 | 273 | struct netlist_logic_family_desc_t |
| 274 | 274 | { |
| 275 | nl_double m_low_thresh_V; | |
| 276 | nl_double m_high_thresh_V; | |
| 277 | nl_double m_low_V; | |
| 278 | nl_double m_high_V; | |
| 279 | nl_double m_R_low; | |
| 280 | nl_double m_R_high; | |
| 275 | double m_low_thresh_V; | |
| 276 | double m_high_thresh_V; | |
| 277 | double m_low_V; | |
| 278 | double m_high_V; | |
| 279 | double m_R_low; | |
| 280 | double m_R_high; | |
| 281 | 281 | }; |
| 282 | 282 | |
| 283 | 283 | /* Terminals inherit the family description from the netlist_device |
| r243192 | r243193 | |
| 337 | 337 | CAPACITOR, // Capacitor |
| 338 | 338 | DIODE, // Diode |
| 339 | 339 | DUMMY, // DUMMY device without function |
| 340 | ||
| 340 | FRONTIER, // Net frontier | |
| 341 | 341 | BJT_EB, // BJT(Ebers-Moll) |
| 342 | 342 | BJT_SWITCH, // BJT(Switch) |
| 343 | 343 | VCVS, // Voltage controlled voltage source |
| r243192 | r243193 | |
| 474 | 474 | |
| 475 | 475 | ATTR_COLD netlist_terminal_t(); |
| 476 | 476 | |
| 477 | nl_double *m_Idr1; // drive current | |
| 478 | nl_double *m_go1; // conductance for Voltage from other term | |
| 479 | nl_double *m_gt1; // conductance for total conductance | |
| 477 | double *m_Idr1; // drive current | |
| 478 | double *m_go1; // conductance for Voltage from other term | |
| 479 | double *m_gt1; // conductance for total conductance | |
| 480 | 480 | |
| 481 | ATTR_HOT inline void set(const | |
| 481 | ATTR_HOT inline void set(const double G) | |
| 482 | 482 | { |
| 483 | 483 | set_ptr(m_Idr1, 0); |
| 484 | 484 | set_ptr(m_go1, G); |
| 485 | 485 | set_ptr(m_gt1, G); |
| 486 | 486 | } |
| 487 | 487 | |
| 488 | ATTR_HOT inline void set(const | |
| 488 | ATTR_HOT inline void set(const double GO, const double GT) | |
| 489 | 489 | { |
| 490 | 490 | set_ptr(m_Idr1, 0); |
| 491 | 491 | set_ptr(m_go1, GO); |
| 492 | 492 | set_ptr(m_gt1, GT); |
| 493 | 493 | } |
| 494 | 494 | |
| 495 | ATTR_HOT inline void set(const | |
| 495 | ATTR_HOT inline void set(const double GO, const double GT, const double I) | |
| 496 | 496 | { |
| 497 | 497 | set_ptr(m_Idr1, I); |
| 498 | 498 | set_ptr(m_go1, GO); |
| r243192 | r243193 | |
| 509 | 509 | |
| 510 | 510 | ATTR_COLD virtual void reset(); |
| 511 | 511 | private: |
| 512 | inline void set_ptr( | |
| 512 | inline void set_ptr(double *ptr, const double val) | |
| 513 | 513 | { |
| 514 | 514 | if (ptr != NULL) |
| 515 | 515 | *ptr = val; |
| r243192 | r243193 | |
| 586 | 586 | ATTR_COLD netlist_analog_input_t() |
| 587 | 587 | : netlist_input_t(INPUT, ANALOG) { } |
| 588 | 588 | |
| 589 | ATTR_HOT inline const | |
| 589 | ATTR_HOT inline const double Q_Analog() const; | |
| 590 | 590 | }; |
| 591 | 591 | |
| 592 | 592 | //#define INPVAL(_x) (_x).Q() |
| r243192 | r243193 | |
| 661 | 661 | // We have to have those on one object. Dividing those does lead |
| 662 | 662 | // to a significant performance hit |
| 663 | 663 | // FIXME: Have to fix the public at some time |
| 664 | | |
| 664 | double m_cur_Analog; | |
| 665 | 665 | |
| 666 | 666 | }; |
| 667 | 667 | |
| r243192 | r243193 | |
| 736 | 736 | ATTR_COLD netlist_analog_net_t(); |
| 737 | 737 | ATTR_COLD virtual ~netlist_analog_net_t() { }; |
| 738 | 738 | |
| 739 | ATTR_HOT inline const | |
| 739 | ATTR_HOT inline const double Q_Analog() const | |
| 740 | 740 | { |
| 741 | 741 | //nl_assert(object_type(SIGNAL_MASK) == SIGNAL_ANALOG); |
| 742 | 742 | nl_assert(family() == ANALOG); |
| 743 | 743 | return m_cur_Analog; |
| 744 | 744 | } |
| 745 | 745 | |
| 746 | ATTR_COLD inline | |
| 746 | ATTR_COLD inline double &Q_Analog_state_ptr() | |
| 747 | 747 | { |
| 748 | 748 | //nl_assert(object_type(SIGNAL_MASK) == SIGNAL_ANALOG); |
| 749 | 749 | nl_assert(family() == ANALOG); |
| r243192 | r243193 | |
| 764 | 764 | private: |
| 765 | 765 | |
| 766 | 766 | public: |
| 767 | nl_double m_DD_n_m_1; | |
| 768 | nl_double m_h_n_m_1; | |
| 767 | double m_DD_n_m_1; | |
| 768 | double m_h_n_m_1; | |
| 769 | 769 | |
| 770 | 770 | //FIXME: needed by current solver code |
| 771 | 771 | netlist_matrix_solver_t *m_solver; |
| r243192 | r243193 | |
| 831 | 831 | |
| 832 | 832 | ATTR_COLD netlist_analog_output_t(); |
| 833 | 833 | |
| 834 | ATTR_COLD void initial(const | |
| 834 | ATTR_COLD void initial(const double val); | |
| 835 | 835 | |
| 836 | ATTR_HOT inline void set_Q(const | |
| 836 | ATTR_HOT inline void set_Q(const double newQ); | |
| 837 | 837 | |
| 838 | 838 | netlist_analog_net_t *m_proxied_net; // only for proxy nets in analog input logic |
| 839 | 839 | |
| r243192 | r243193 | |
| 876 | 876 | public: |
| 877 | 877 | ATTR_COLD netlist_param_double_t(); |
| 878 | 878 | |
| 879 | ATTR_HOT inline void setTo(const nl_double param); | |
| 880 | ATTR_COLD inline void initial(const nl_double val) { m_param = val; } | |
| 881 | ATTR_HOT inline const nl_double Value() const { return m_param; } | |
| 879 | ATTR_HOT inline void setTo(const double param); | |
| 880 | ATTR_COLD inline void initial(const double val) { m_param = val; } | |
| 881 | ATTR_HOT inline const double Value() const { return m_param; } | |
| 882 | 882 | |
| 883 | 883 | protected: |
| 884 | 884 | ATTR_COLD virtual void save_register() |
| r243192 | r243193 | |
| 888 | 888 | } |
| 889 | 889 | |
| 890 | 890 | private: |
| 891 | | |
| 891 | double m_param; | |
| 892 | 892 | }; |
| 893 | 893 | |
| 894 | 894 | class netlist_param_int_t : public netlist_param_t |
| r243192 | r243193 | |
| 946 | 946 | ATTR_HOT inline const pstring &Value() const { return m_param; } |
| 947 | 947 | |
| 948 | 948 | /* these should be cached! */ |
| 949 | ATTR_COLD | |
| 949 | ATTR_COLD double model_value(const pstring &entity, const double defval = 0.0) const; | |
| 950 | 950 | ATTR_COLD const pstring model_type() const; |
| 951 | 951 | |
| 952 | 952 | private: |
| r243192 | r243193 | |
| 997 | 997 | out.set_Q(val, delay); |
| 998 | 998 | } |
| 999 | 999 | |
| 1000 | ATTR_HOT inline const | |
| 1000 | ATTR_HOT inline const double INPANALOG(const netlist_analog_input_t &inp) const { return inp.Q_Analog(); } | |
| 1001 | 1001 | |
| 1002 | ATTR_HOT inline const | |
| 1002 | ATTR_HOT inline const double TERMANALOG(const netlist_terminal_t &term) const { return term.net().as_analog().Q_Analog(); } | |
| 1003 | 1003 | |
| 1004 | ATTR_HOT inline void OUTANALOG(netlist_analog_output_t &out, const | |
| 1004 | ATTR_HOT inline void OUTANALOG(netlist_analog_output_t &out, const double val) | |
| 1005 | 1005 | { |
| 1006 | 1006 | out.set_Q(val); |
| 1007 | 1007 | } |
| r243192 | r243193 | |
| 1010 | 1010 | |
| 1011 | 1011 | ATTR_HOT virtual void dec_active() { } |
| 1012 | 1012 | |
| 1013 | ATTR_HOT virtual void step_time(const | |
| 1013 | ATTR_HOT virtual void step_time(const double st) { } | |
| 1014 | 1014 | ATTR_HOT virtual void update_terminals() { } |
| 1015 | 1015 | |
| 1016 | 1016 | |
| r243192 | r243193 | |
| 1120 | 1120 | ATTR_HOT inline const netlist_time time() const { return m_time; } |
| 1121 | 1121 | ATTR_HOT inline NETLIB_NAME(solver) *solver() const { return m_solver; } |
| 1122 | 1122 | ATTR_HOT inline NETLIB_NAME(gnd) *gnd() const { return m_gnd; } |
| 1123 | ATTR_HOT const | |
| 1123 | ATTR_HOT const double gmin() const; | |
| 1124 | 1124 | |
| 1125 | 1125 | ATTR_HOT inline void push_to_queue(netlist_net_t *out, const netlist_time attime) |
| 1126 | 1126 | { |
| r243192 | r243193 | |
| 1251 | 1251 | } |
| 1252 | 1252 | } |
| 1253 | 1253 | |
| 1254 | ATTR_HOT inline void netlist_param_double_t::setTo(const | |
| 1254 | ATTR_HOT inline void netlist_param_double_t::setTo(const double param) | |
| 1255 | 1255 | { |
| 1256 | 1256 | if (m_param != param) |
| 1257 | 1257 | { |
| r243192 | r243193 | |
| 1268 | 1268 | |
| 1269 | 1269 | ATTR_HOT inline const netlist_logic_net_t & RESTRICT netlist_net_t::as_logic() const |
| 1270 | 1270 | { |
| 1271 | ||
| 1271 | nl_assert(family() == LOGIC); | |
| 1272 | 1272 | return static_cast<const netlist_logic_net_t &>(*this); |
| 1273 | 1273 | } |
| 1274 | 1274 | |
| 1275 | 1275 | ATTR_HOT inline netlist_analog_net_t & RESTRICT netlist_net_t::as_analog() |
| 1276 | 1276 | { |
| 1277 | ||
| 1277 | nl_assert(family() == ANALOG); | |
| 1278 | 1278 | return static_cast<netlist_analog_net_t &>(*this); |
| 1279 | 1279 | } |
| 1280 | 1280 | |
| r243192 | r243193 | |
| 1356 | 1356 | return net().as_logic().Q(); |
| 1357 | 1357 | } |
| 1358 | 1358 | |
| 1359 | ATTR_HOT inline const | |
| 1359 | ATTR_HOT inline const double netlist_analog_input_t::Q_Analog() const | |
| 1360 | 1360 | { |
| 1361 | 1361 | return net().as_analog().Q_Analog(); |
| 1362 | 1362 | } |
| 1363 | 1363 | |
| 1364 | ATTR_HOT inline void netlist_analog_output_t::set_Q(const | |
| 1364 | ATTR_HOT inline void netlist_analog_output_t::set_Q(const double newQ) | |
| 1365 | 1365 | { |
| 1366 | 1366 | if (newQ != net().as_analog().m_cur_Analog) |
| 1367 | 1367 | { |
| r243192 | r243193 | |
| 1370 | 1370 | } |
| 1371 | 1371 | } |
| 1372 | 1372 | |
| 1373 | ||
| 1374 | // ----------------------------------------------------------------------------- | |
| 1375 | // net_dev class factory | |
| 1376 | // ----------------------------------------------------------------------------- | |
| 1377 | ||
| 1378 | class net_device_t_base_factory | |
| 1379 | { | |
| 1380 | NETLIST_PREVENT_COPYING(net_device_t_base_factory) | |
| 1381 | public: | |
| 1382 | ATTR_COLD net_device_t_base_factory(const pstring &name, const pstring &classname, | |
| 1383 | const pstring &def_param) | |
| 1384 | : m_name(name), m_classname(classname), m_def_param(def_param) | |
| 1385 | {} | |
| 1386 | ||
| 1387 | ATTR_COLD virtual ~net_device_t_base_factory() {} | |
| 1388 | ||
| 1389 | ATTR_COLD virtual netlist_device_t *Create() const = 0; | |
| 1390 | ||
| 1391 | ATTR_COLD const pstring &name() const { return m_name; } | |
| 1392 | ATTR_COLD const pstring &classname() const { return m_classname; } | |
| 1393 | ATTR_COLD const pstring ¶m_desc() const { return m_def_param; } | |
| 1394 | ATTR_COLD const nl_util::pstring_list term_param_list(); | |
| 1395 | ATTR_COLD const nl_util::pstring_list def_params(); | |
| 1396 | ||
| 1397 | protected: | |
| 1398 | pstring m_name; /* device name */ | |
| 1399 | pstring m_classname; /* device class name */ | |
| 1400 | pstring m_def_param; /* default parameter */ | |
| 1401 | }; | |
| 1402 | ||
| 1403 | template <class C> | |
| 1404 | class net_device_t_factory : public net_device_t_base_factory | |
| 1405 | { | |
| 1406 | NETLIST_PREVENT_COPYING(net_device_t_factory) | |
| 1407 | public: | |
| 1408 | ATTR_COLD net_device_t_factory(const pstring &name, const pstring &classname, | |
| 1409 | const pstring &def_param) | |
| 1410 | : net_device_t_base_factory(name, classname, def_param) { } | |
| 1411 | ||
| 1412 | ATTR_COLD netlist_device_t *Create() const | |
| 1413 | { | |
| 1414 | netlist_device_t *r = new C(); | |
| 1415 | //r->init(setup, name); | |
| 1416 | return r; | |
| 1417 | } | |
| 1418 | }; | |
| 1419 | ||
| 1420 | class netlist_factory_t | |
| 1421 | { | |
| 1422 | public: | |
| 1423 | typedef plinearlist_t<net_device_t_base_factory *> list_t; | |
| 1424 | ||
| 1425 | ATTR_COLD netlist_factory_t(); | |
| 1426 | ATTR_COLD ~netlist_factory_t(); | |
| 1427 | ||
| 1428 | ATTR_COLD void initialize(); | |
| 1429 | ||
| 1430 | template<class _C> | |
| 1431 | ATTR_COLD void register_device(const pstring &name, const pstring &classname, | |
| 1432 | const pstring &def_param) | |
| 1433 | { | |
| 1434 | m_list.add(new net_device_t_factory< _C >(name, classname, def_param) ); | |
| 1435 | } | |
| 1436 | ||
| 1437 | ATTR_COLD netlist_device_t *new_device_by_classname(const pstring &classname, netlist_setup_t &setup) const; | |
| 1438 | ATTR_COLD netlist_device_t *new_device_by_name(const pstring &name, netlist_setup_t &setup) const; | |
| 1439 | ATTR_COLD net_device_t_base_factory * factory_by_name(const pstring &name, netlist_setup_t &setup) const; | |
| 1440 | ||
| 1441 | const list_t &list() { return m_list; } | |
| 1442 | ||
| 1443 | private: | |
| 1444 | list_t m_list; | |
| 1445 | ||
| 1446 | }; | |
| 1447 | ||
| 1448 | ||
| 1373 | 1449 | #endif /* NLBASE_H_ */ |
| r243192 | r243193 | |
|---|---|---|
| 49 | 49 | |
| 50 | 50 | #define NETLIST_GMIN_DEFAULT (1e-9) |
| 51 | 51 | |
| 52 | //typedef double nl_double; | |
| 53 | ||
| 54 | #define nl_double double | |
| 55 | ||
| 56 | 52 | //============================================================ |
| 57 | 53 | // DEBUGGING |
| 58 | 54 | //============================================================ |
| r243192 | r243193 | |
| 113 | 109 | // this macro passes an item followed by a string version of itself as two consecutive parameters |
| 114 | 110 | #define NLNAME(x) x, #x |
| 115 | 111 | |
| 116 | //============================================================ | |
| 117 | // Exceptions | |
| 118 | //============================================================ | |
| 119 | ||
| 120 | 112 | // emu_fatalerror is a generic fatal exception that provides an error string |
| 121 | 113 | class nl_fatalerror : public std::exception |
| 122 | 114 | { |
| 123 | 115 | public: |
| 124 | nl_fatalerror(const char *format, ...) ATTR_PRINTF(2,3) | |
| 125 | { | |
| 126 | char text[1024]; | |
| 127 | va_list ap; | |
| 128 | va_start(ap, format); | |
| 129 | vsprintf(text, format, ap); | |
| 130 | va_end(ap); | |
| 131 | osd_printf_error("%s\n", text); | |
| 132 | } | |
| 133 | nl_fatalerror(const char *format, va_list ap) | |
| 134 | { | |
| 135 | char text[1024]; | |
| 136 | vsprintf(text, format, ap); | |
| 137 | osd_printf_error("%s\n", text); | |
| 138 | } | |
| 116 | nl_fatalerror(const char *format, ...) ATTR_PRINTF(2,3) | |
| 117 | { | |
| 118 | char text[1024]; | |
| 119 | va_list ap; | |
| 120 | va_start(ap, format); | |
| 121 | vsprintf(text, format, ap); | |
| 122 | va_end(ap); | |
| 123 | osd_printf_error("%s\n", text); | |
| 124 | } | |
| 125 | nl_fatalerror(const char *format, va_list ap) | |
| 126 | { | |
| 127 | char text[1024]; | |
| 128 | vsprintf(text, format, ap); | |
| 129 | osd_printf_error("%s\n", text); | |
| 130 | } | |
| 139 | 131 | }; |
| 140 | 132 | |
| 141 | //============================================================ | |
| 142 | // Memory allocation | |
| 143 | //============================================================ | |
| 144 | ||
| 145 | #define nl_alloc(T, ...) global_alloc(T(__VA_ARGS__)) | |
| 146 | #define nl_alloc_array(T, N) global_alloc_array(T, N) | |
| 147 | ||
| 148 | #define nl_free(_ptr) global_free(_ptr) | |
| 149 | #define nl_free_array(_ptr) global_free_array(_ptr) | |
| 150 | ||
| 151 | ||
| 152 | //============================================================ | |
| 153 | // Asserts | |
| 154 | //============================================================ | |
| 155 | ||
| 156 | 133 | #ifdef MAME_DEBUG |
| 157 | 134 | #define nl_assert(x) do { if (!(x)) throw nl_fatalerror("assert: %s:%d: %s", __FILE__, __LINE__, #x); } while (0) |
| 158 | 135 | #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) |
| 159 | 136 | #else |
| 160 | 137 | #define nl_assert(x) do { } while (0) |
| 161 | 138 | //#define assert_always(x, msg) do { if (!(x)) throw emu_fatalerror("Fatal error: %s (%s:%d)", msg, __FILE__, __LINE__); } while (0) |
| 162 | #define nl_assert_always(x, msg) | |
| 139 | #define nl_assert_always(x, msg) do { } while (0) | |
| 163 | 140 | #endif |
| 164 | 141 | |
| 165 | 142 | //============================================================ |
| r243192 | r243193 | |
|---|---|---|
| 8 | 8 | #ifndef NL_DICE_COMPAT_H_ |
| 9 | 9 | #define NL_DICE_COMPAT_H_ |
| 10 | 10 | |
| 11 | #include "netlist/devices/net_lib.h" | |
| 12 | ||
| 13 | 11 | /* -------------------------------------------------------------------- |
| 14 | 12 | * Compatibility macros for DICE netlists ... |
| 15 | 13 | * -------------------------------------------------------------------- */ |
| 16 | 14 | |
| 17 | /* | |
| 18 | * define NETLIST_DEVELOPMENT in IDEs before including this header file | |
| 19 | * to get compile time errors on unknown devices. This should only be | |
| 20 | * a temporary support and not be used in commits. | |
| 21 | */ | |
| 15 | //#define CHIP(_n, _t) netlist.register_dev(NET_NEW(_t ## _dip), _n); | |
| 16 | #define CHIP(_n, _t) setup.register_dev( new nld_ ## _t ## _dip(), _n); | |
| 22 | 17 | |
| 23 | #ifdef NETLIST_DEVELOPMENT | |
| 24 | #define CHIP(_n, _t) setup.register_dev( nl_alloc(nld_ ## _t ## _dip), _n); | |
| 25 | #else | |
| 26 | #define CHIP(_n, _t) setup.register_dev(NETLIB_NAME_STR(_t ## _dip), _n); | |
| 27 | #endif | |
| 28 | ||
| 29 | 18 | #define CONNECTION( ... ) CONNECTIONY( CONNECTIONX( __VA_ARGS__ ) ) |
| 30 | 19 | #define CONNECTIONY(_a) _a |
| 31 | 20 | #define CONNECTIONX(_a, _b, _c, _d) setup.register_link(_a "." # _b, _c "." # _d); |
| r243192 | r243193 | |
| 41 | 30 | struct Mono555Desc |
| 42 | 31 | { |
| 43 | 32 | public: |
| 44 | | |
| 33 | double r, c; | |
| 45 | 34 | |
| 46 | Mono555Desc( | |
| 35 | Mono555Desc(double res, double cap) : r(res), c(cap) { } | |
| 47 | 36 | }; |
| 48 | 37 | |
| 49 | 38 | struct SeriesRCDesc |
| 50 | 39 | { |
| 51 | 40 | public: |
| 52 | | |
| 41 | double r, c; | |
| 53 | 42 | |
| 54 | SeriesRCDesc( | |
| 43 | SeriesRCDesc(double res, double cap) : r(res), c(cap) { } | |
| 55 | 44 | }; |
| 56 | 45 | |
| 57 | 46 | #define CHIP_555_Mono(_name, _pdesc) \ |
| r243192 | r243193 | |
|---|---|---|
| 1 | // license:GPL-2.0+ | |
| 2 | // copyright-holders:Couriersud | |
| 3 | /*************************************************************************** | |
| 4 | ||
| 5 | nl_factory.c | |
| 6 | ||
| 7 | Discrete netlist implementation. | |
| 8 | ||
| 9 | **************************************************************************** | |
| 10 | ||
| 11 | Couriersud reserves the right to license the code under a less restrictive | |
| 12 | license going forward. | |
| 13 | ||
| 14 | Copyright Nicola Salmoria and the MAME team | |
| 15 | All rights reserved. | |
| 16 | ||
| 17 | Redistribution and use of this code or any derivative works are permitted | |
| 18 | provided that the following conditions are met: | |
| 19 | ||
| 20 | * Redistributions may not be sold, nor may they be used in a commercial | |
| 21 | product or activity. | |
| 22 | ||
| 23 | * Redistributions that are modified from the original source must include the | |
| 24 | complete source code, including the source code for all components used by a | |
| 25 | binary built from the modified sources. However, as a special exception, the | |
| 26 | source code distributed need not include anything that is normally distributed | |
| 27 | (in either source or binary form) with the major components (compiler, kernel, | |
| 28 | and so on) of the operating system on which the executable runs, unless that | |
| 29 | component itself accompanies the executable. | |
| 30 | ||
| 31 | * Redistributions must reproduce the above copyright notice, this list of | |
| 32 | conditions and the following disclaimer in the documentation and/or other | |
| 33 | materials provided with the distribution. | |
| 34 | ||
| 35 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |
| 36 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
| 37 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
| 38 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | |
| 39 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
| 40 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
| 41 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
| 42 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
| 43 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
| 44 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
| 45 | POSSIBILITY OF SUCH DAMAGE. | |
| 46 | ||
| 47 | ||
| 48 | ****************************************************************************/ | |
| 49 | ||
| 50 | #include "nl_factory.h" | |
| 51 | #include "nl_setup.h" | |
| 52 | ||
| 53 | // ---------------------------------------------------------------------------------------- | |
| 54 | // net_device_t_base_factory | |
| 55 | // ---------------------------------------------------------------------------------------- | |
| 56 | ||
| 57 | ATTR_COLD const nl_util::pstring_list net_device_t_base_factory::term_param_list() | |
| 58 | { | |
| 59 | if (m_def_param.startsWith("+")) | |
| 60 | return nl_util::split(m_def_param.substr(1), ","); | |
| 61 | else | |
| 62 | return nl_util::pstring_list(); | |
| 63 | } | |
| 64 | ||
| 65 | ATTR_COLD const nl_util::pstring_list net_device_t_base_factory::def_params() | |
| 66 | { | |
| 67 | if (m_def_param.startsWith("+") || m_def_param.equals("-")) | |
| 68 | return nl_util::pstring_list(); | |
| 69 | else | |
| 70 | return nl_util::split(m_def_param, ","); | |
| 71 | } | |
| 72 | ||
| 73 | ||
| 74 | netlist_factory_t::netlist_factory_t() | |
| 75 | { | |
| 76 | } | |
| 77 | ||
| 78 | netlist_factory_t::~netlist_factory_t() | |
| 79 | { | |
| 80 | for (net_device_t_base_factory * const *e = m_list.first(); e != NULL; e = m_list.next(e)) | |
| 81 | { | |
| 82 | net_device_t_base_factory *p = *e; | |
| 83 | global_free(p); | |
| 84 | } | |
| 85 | m_list.clear(); | |
| 86 | } | |
| 87 | ||
| 88 | netlist_device_t *netlist_factory_t::new_device_by_classname(const pstring &classname) const | |
| 89 | { | |
| 90 | for (net_device_t_base_factory * const *e = m_list.first(); e != NULL; e = m_list.next(e)) | |
| 91 | { | |
| 92 | net_device_t_base_factory *p = *e; | |
| 93 | if (strcmp(p->classname(), classname) == 0) | |
| 94 | { | |
| 95 | netlist_device_t *ret = p->Create(); | |
| 96 | return ret; | |
| 97 | } | |
| 98 | p++; | |
| 99 | } | |
| 100 | return NULL; // appease code analysis | |
| 101 | } | |
| 102 | ||
| 103 | netlist_device_t *netlist_factory_t::new_device_by_name(const pstring &name, netlist_setup_t &setup) const | |
| 104 | { | |
| 105 | net_device_t_base_factory *f = factory_by_name(name, setup); | |
| 106 | return f->Create(); | |
| 107 | } | |
| 108 | ||
| 109 | net_device_t_base_factory * netlist_factory_t::factory_by_name(const pstring &name, netlist_setup_t &setup) const | |
| 110 | { | |
| 111 | for (net_device_t_base_factory * const *e = m_list.first(); e != NULL; e = m_list.next(e)) | |
| 112 | { | |
| 113 | net_device_t_base_factory *p = *e; | |
| 114 | if (strcmp(p->name(), name) == 0) | |
| 115 | { | |
| 116 | return p; | |
| 117 | } | |
| 118 | p++; | |
| 119 | } | |
| 120 | setup.netlist().error("Class %s not found!\n", name.cstr()); | |
| 121 | return NULL; // appease code analysis | |
| 122 | } |
| r243192 | r243193 | |
|---|---|---|
| 1 | // license:GPL-2.0+ | |
| 2 | // copyright-holders:Couriersud | |
| 3 | /* | |
| 4 | * nl_factory.h | |
| 5 | * | |
| 6 | * | |
| 7 | */ | |
| 8 | ||
| 9 | #ifndef NLFACTORY_H_ | |
| 10 | #define NLFACTORY_H_ | |
| 11 | ||
| 12 | #include "nl_config.h" | |
| 13 | #include "plists.h" | |
| 14 | #include "nl_base.h" | |
| 15 | #if 0 | |
| 16 | #include "nl_time.h" | |
| 17 | #include "nl_util.h" | |
| 18 | #include "pstate.h" | |
| 19 | #endif | |
| 20 | #include "pstring.h" | |
| 21 | ||
| 22 | // ----------------------------------------------------------------------------- | |
| 23 | // net_dev class factory | |
| 24 | // ----------------------------------------------------------------------------- | |
| 25 | ||
| 26 | class net_device_t_base_factory | |
| 27 | { | |
| 28 | NETLIST_PREVENT_COPYING(net_device_t_base_factory) | |
| 29 | public: | |
| 30 | ATTR_COLD net_device_t_base_factory(const pstring &name, const pstring &classname, | |
| 31 | const pstring &def_param) | |
| 32 | : m_name(name), m_classname(classname), m_def_param(def_param) | |
| 33 | {} | |
| 34 | ||
| 35 | ATTR_COLD virtual ~net_device_t_base_factory() {} | |
| 36 | ||
| 37 | ATTR_COLD virtual netlist_device_t *Create() const = 0; | |
| 38 | ||
| 39 | ATTR_COLD const pstring &name() const { return m_name; } | |
| 40 | ATTR_COLD const pstring &classname() const { return m_classname; } | |
| 41 | ATTR_COLD const pstring ¶m_desc() const { return m_def_param; } | |
| 42 | ATTR_COLD const nl_util::pstring_list term_param_list(); | |
| 43 | ATTR_COLD const nl_util::pstring_list def_params(); | |
| 44 | ||
| 45 | protected: | |
| 46 | pstring m_name; /* device name */ | |
| 47 | pstring m_classname; /* device class name */ | |
| 48 | pstring m_def_param; /* default parameter */ | |
| 49 | }; | |
| 50 | ||
| 51 | template <class C> | |
| 52 | class net_device_t_factory : public net_device_t_base_factory | |
| 53 | { | |
| 54 | NETLIST_PREVENT_COPYING(net_device_t_factory) | |
| 55 | public: | |
| 56 | ATTR_COLD net_device_t_factory(const pstring &name, const pstring &classname, | |
| 57 | const pstring &def_param) | |
| 58 | : net_device_t_base_factory(name, classname, def_param) { } | |
| 59 | ||
| 60 | ATTR_COLD netlist_device_t *Create() const | |
| 61 | { | |
| 62 | netlist_device_t *r = nl_alloc(C); | |
| 63 | //r->init(setup, name); | |
| 64 | return r; | |
| 65 | } | |
| 66 | }; | |
| 67 | ||
| 68 | class netlist_factory_t | |
| 69 | { | |
| 70 | public: | |
| 71 | typedef plinearlist_t<net_device_t_base_factory *> list_t; | |
| 72 | ||
| 73 | ATTR_COLD netlist_factory_t(); | |
| 74 | ATTR_COLD ~netlist_factory_t(); | |
| 75 | ||
| 76 | template<class _C> | |
| 77 | ATTR_COLD void register_device(const pstring &name, const pstring &classname, | |
| 78 | const pstring &def_param) | |
| 79 | { | |
| 80 | m_list.add(nl_alloc(net_device_t_factory< _C >, name, classname, def_param)); | |
| 81 | } | |
| 82 | ||
| 83 | ATTR_COLD netlist_device_t *new_device_by_classname(const pstring &classname) const; | |
| 84 | ATTR_COLD netlist_device_t *new_device_by_name(const pstring &name, netlist_setup_t &setup) const; | |
| 85 | ATTR_COLD net_device_t_base_factory * factory_by_name(const pstring &name, netlist_setup_t &setup) const; | |
| 86 | ||
| 87 | const list_t &list() { return m_list; } | |
| 88 | ||
| 89 | private: | |
| 90 | list_t m_list; | |
| 91 | ||
| 92 | }; | |
| 93 | ||
| 94 | ||
| 95 | #endif /* NLFACTORY_H_ */ |
| r243192 | r243193 | |
|---|---|---|
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | 8 | #include "nl_parser.h" |
| 9 | #include "nl_factory.h" | |
| 10 | 9 | |
| 11 | 10 | //#undef NL_VERBOSE_OUT |
| 12 | 11 | //#define NL_VERBOSE_OUT(x) printf x |
| r243192 | r243193 | |
| 400 | 399 | void netlist_parser::netdev_param() |
| 401 | 400 | { |
| 402 | 401 | pstring param; |
| 403 | | |
| 402 | double val; | |
| 404 | 403 | param = get_identifier(); |
| 405 | 404 | require_token(m_tok_comma); |
| 406 | 405 | val = eval_param(get_token()); |
| r243192 | r243193 | |
| 440 | 439 | } |
| 441 | 440 | else |
| 442 | 441 | { |
| 443 | | |
| 442 | double val = eval_param(tok); | |
| 444 | 443 | m_setup.register_param(paramfq, val); |
| 445 | 444 | } |
| 446 | 445 | cnt++; |
| r243192 | r243193 | |
| 468 | 467 | // ---------------------------------------------------------------------------------------- |
| 469 | 468 | |
| 470 | 469 | |
| 471 | ||
| 470 | double netlist_parser::eval_param(const token_t tok) | |
| 472 | 471 | { |
| 473 | 472 | static const char *macs[6] = {"", "RES_K", "RES_M", "CAP_U", "CAP_N", "CAP_P"}; |
| 474 | static | |
| 473 | static double facs[6] = {1, 1e3, 1e6, 1e-6, 1e-9, 1e-12}; | |
| 475 | 474 | int i; |
| 476 | 475 | int f=0; |
| 477 | 476 | bool e; |
| 478 | | |
| 477 | double ret; | |
| 479 | 478 | pstring val; |
| 480 | 479 | |
| 481 | 480 | //printf("param %s\n", tok.m_token.cstr()); |
| r243192 | r243193 | |
|---|---|---|
| 160 | 160 | virtual void verror(pstring msg, int line_num, pstring line); |
| 161 | 161 | private: |
| 162 | 162 | |
| 163 | | |
| 163 | double eval_param(const token_t tok); | |
| 164 | 164 | |
| 165 | 165 | token_id_t m_tok_param_left; |
| 166 | 166 | token_id_t m_tok_param_right; |
| r243192 | r243193 | |
|---|---|---|
| 9 | 9 | #include "nl_setup.h" |
| 10 | 10 | #include "nl_parser.h" |
| 11 | 11 | #include "nl_util.h" |
| 12 | #include "nl_factory.h" | |
| 13 | 12 | #include "devices/net_lib.h" |
| 14 | 13 | #include "devices/nld_system.h" |
| 15 | 14 | #include "analog/nld_solver.h" |
| r243192 | r243193 | |
| 38 | 37 | , m_proxy_cnt(0) |
| 39 | 38 | { |
| 40 | 39 | netlist.set_setup(this); |
| 41 | m_factory = nl_alloc(netlist_factory_t); | |
| 42 | 40 | } |
| 43 | 41 | |
| 44 | 42 | void netlist_setup_t::init() |
| 45 | 43 | { |
| 46 | | |
| 44 | m_factory.initialize(); | |
| 47 | 45 | NETLIST_NAME(base)(*this); |
| 48 | 46 | } |
| 49 | 47 | |
| r243192 | r243193 | |
| 57 | 55 | m_params_temp.clear(); |
| 58 | 56 | |
| 59 | 57 | netlist().set_setup(NULL); |
| 60 | nl_free(m_factory); | |
| 61 | 58 | |
| 62 | 59 | pstring::resetmem(); |
| 63 | 60 | } |
| r243192 | r243193 | |
| 95 | 92 | return dev; |
| 96 | 93 | } |
| 97 | 94 | |
| 98 | netlist_device_t *netlist_setup_t::register_dev(const pstring &classname, const pstring &name) | |
| 99 | { | |
| 100 | netlist_device_t *dev = factory().new_device_by_classname(classname); | |
| 101 | if (dev == NULL) | |
| 102 | netlist().error("Class %s not found!\n", classname.cstr()); | |
| 103 | return register_dev(dev, name); | |
| 104 | } | |
| 105 | ||
| 106 | 95 | template <class T> |
| 107 | 96 | static void remove_start_with(T &hm, pstring &sw) |
| 108 | 97 | { |
| r243192 | r243193 | |
| 401 | 390 | if (proxy == NULL) |
| 402 | 391 | { |
| 403 | 392 | // create a new one ... |
| 404 | proxy = n | |
| 393 | proxy = new nld_d_to_a_proxy(out); | |
| 405 | 394 | pstring x = pstring::sprintf("proxy_da_%s_%d", out.name().cstr(), m_proxy_cnt); |
| 406 | 395 | m_proxy_cnt++; |
| 407 | 396 | |
| r243192 | r243193 | |
| 430 | 419 | { |
| 431 | 420 | if (out.isFamily(netlist_terminal_t::ANALOG) && in.isFamily(netlist_terminal_t::LOGIC)) |
| 432 | 421 | { |
| 433 | nld_a_to_d_proxy *proxy = n | |
| 422 | nld_a_to_d_proxy *proxy = new nld_a_to_d_proxy(in); | |
| 434 | 423 | pstring x = pstring::sprintf("proxy_ad_%s_%d", in.name().cstr(), m_proxy_cnt); |
| 435 | 424 | m_proxy_cnt++; |
| 436 | 425 | |
| r243192 | r243193 | |
| 466 | 455 | else if (inp.isFamily(netlist_terminal_t::LOGIC)) |
| 467 | 456 | { |
| 468 | 457 | NL_VERBOSE_OUT(("connect_terminal_input: connecting proxy\n")); |
| 469 | nld_a_to_d_proxy *proxy = n | |
| 458 | nld_a_to_d_proxy *proxy = new nld_a_to_d_proxy(inp); | |
| 470 | 459 | pstring x = pstring::sprintf("proxy_ad_%s_%d", inp.name().cstr(), m_proxy_cnt); |
| 471 | 460 | m_proxy_cnt++; |
| 472 | 461 | |
| r243192 | r243193 | |
| 534 | 523 | else |
| 535 | 524 | { |
| 536 | 525 | NL_VERBOSE_OUT(("adding net ...\n")); |
| 537 | netlist_analog_net_t *anet = n | |
| 526 | netlist_analog_net_t *anet = new netlist_analog_net_t(); | |
| 538 | 527 | t1.set_net(*anet); |
| 539 | 528 | //m_netlist.solver()->m_nets.add(anet); |
| 540 | 529 | // FIXME: Nets should have a unique name |
| r243192 | r243193 | |
| 697 | 686 | |
| 698 | 687 | void netlist_setup_t::start_devices() |
| 699 | 688 | { |
| 700 | ||
| 689 | //FIXME: we need a nl_getenv | |
| 701 | 690 | if (getenv("NL_LOGS")) |
| 702 | 691 | { |
| 703 | 692 | NL_VERBOSE_OUT(("Creating dynamic logs ...\n")); |
| r243192 | r243193 | |
| 706 | 695 | { |
| 707 | 696 | NL_VERBOSE_OUT(("%d: <%s>\n",i, ll[i].cstr())); |
| 708 | 697 | NL_VERBOSE_OUT(("%d: <%s>\n",i, ll[i].cstr())); |
| 709 | netlist_device_t *nc = factory().new_device_by_classname("nld_log"); | |
| 698 | netlist_device_t *nc = factory().new_device_by_classname("nld_log", *this); | |
| 710 | 699 | pstring name = "log_" + ll[i]; |
| 711 | 700 | register_dev(nc, name); |
| 712 | 701 | register_link(name + ".I", ll[i]); |
| r243192 | r243193 | |
|---|---|---|
| 3 | 3 | /* |
| 4 | 4 | * nlsetup.h |
| 5 | 5 | * |
| 6 | * Created on: 3 Nov 2013 | |
| 7 | * Author: andre | |
| 6 | 8 | */ |
| 7 | 9 | |
| 8 | 10 | #ifndef NLSETUP_H_ |
| 9 | 11 | #define NLSETUP_H_ |
| 10 | 12 | |
| 11 | 13 | #include "nl_base.h" |
| 12 | //#include "nl_factory.h" | |
| 13 | 14 | |
| 14 | 15 | //============================================================ |
| 15 | 16 | // MACROS / inline netlist definitions |
| r243192 | r243193 | |
| 23 | 24 | #define ALIAS(_alias, _name) \ |
| 24 | 25 | setup.register_alias(# _alias, # _name); |
| 25 | 26 | |
| 26 | ||
| 27 | #define NET_NEW(_type) setup.factory().new_device_by_classname(NETLIB_NAME_STR(_type), setup) | |
| 27 | 28 | |
| 28 | 29 | #define NET_REGISTER_DEV(_type, _name) \ |
| 29 | setup.register_dev(NET | |
| 30 | setup.register_dev(NET_NEW(_type), # _name); | |
| 30 | 31 | |
| 31 | 32 | #define NET_REMOVE_DEV(_name) \ |
| 32 | 33 | setup.remove_dev(# _name); |
| r243192 | r243193 | |
| 65 | 66 | setup.namespace_pop(); |
| 66 | 67 | |
| 67 | 68 | // ---------------------------------------------------------------------------------------- |
| 69 | // FIXME: Clean this up | |
| 70 | // ---------------------------------------------------------------------------------------- | |
| 71 | ||
| 72 | //class NETLIB_NAME(analog_callback); | |
| 73 | ||
| 74 | // ---------------------------------------------------------------------------------------- | |
| 68 | 75 | // netlist_setup_t |
| 69 | 76 | // ---------------------------------------------------------------------------------------- |
| 70 | 77 | |
| 71 | // Forward definition so we keep nl_factory.h out of the public | |
| 72 | class netlist_factory_t; | |
| 73 | ||
| 74 | 78 | class netlist_setup_t |
| 75 | 79 | { |
| 76 | 80 | NETLIST_PREVENT_COPYING(netlist_setup_t) |
| r243192 | r243193 | |
| 113 | 117 | |
| 114 | 118 | netlist_base_t &netlist() { return m_netlist; } |
| 115 | 119 | const netlist_base_t &netlist() const { return m_netlist; } |
| 120 | netlist_factory_t &factory() { return m_factory; } | |
| 121 | const netlist_factory_t &factory() const { return m_factory; } | |
| 116 | 122 | |
| 117 | 123 | pstring build_fqn(const pstring &obj_name) const; |
| 118 | 124 | |
| 119 | 125 | netlist_device_t *register_dev(netlist_device_t *dev, const pstring &name); |
| 120 | netlist_device_t *register_dev(const pstring &classname, const pstring &name); | |
| 121 | 126 | void remove_dev(const pstring &name); |
| 122 | 127 | |
| 123 | 128 | void register_model(const pstring &model); |
| r243192 | r243193 | |
| 146 | 151 | void namespace_push(const pstring &aname); |
| 147 | 152 | void namespace_pop(); |
| 148 | 153 | |
| 149 | netlist_factory_t &factory() { return *m_factory; } | |
| 150 | const netlist_factory_t &factory() const { return *m_factory; } | |
| 151 | ||
| 152 | 154 | /* not ideal, but needed for save_state */ |
| 153 | 155 | tagmap_terminal_t m_terminals; |
| 154 | 156 | |
| r243192 | r243193 | |
| 165 | 167 | tagmap_link_t m_links; |
| 166 | 168 | tagmap_nstring_t m_params_temp; |
| 167 | 169 | |
| 168 | netlist_factory_t | |
| 170 | netlist_factory_t m_factory; | |
| 169 | 171 | |
| 170 | 172 | plinearlist_t<pstring> m_models; |
| 171 | 173 |
| r243192 | r243193 | |
|---|---|---|
| 28 | 28 | if (m_num_elements == 0) |
| 29 | 29 | m_list = NULL; |
| 30 | 30 | else |
| 31 | m_list = n | |
| 31 | m_list = new _ListClass[m_num_elements]; | |
| 32 | 32 | m_count = 0; |
| 33 | 33 | } |
| 34 | 34 | |
| r243192 | r243193 | |
| 38 | 38 | if (m_num_elements == 0) |
| 39 | 39 | m_list = NULL; |
| 40 | 40 | else |
| 41 | m_list = n | |
| 41 | m_list = new _ListClass[m_num_elements]; | |
| 42 | 42 | m_count = 0; |
| 43 | 43 | for (int i=0; i<rhs.count(); i++) |
| 44 | 44 | { |
| r243192 | r243193 | |
| 60 | 60 | ATTR_COLD ~plinearlist_t() |
| 61 | 61 | { |
| 62 | 62 | if (m_list != NULL) |
| 63 | | |
| 63 | delete[] m_list; | |
| 64 | 64 | m_list = NULL; |
| 65 | 65 | } |
| 66 | 66 | |
| r243192 | r243193 | |
| 157 | 157 | { |
| 158 | 158 | for (_ListClass *i = m_list; i < m_list + m_count; i++) |
| 159 | 159 | { |
| 160 | | |
| 160 | delete *i; | |
| 161 | 161 | } |
| 162 | 162 | clear(); |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | private: |
| 166 | ATTR_ | |
| 166 | ATTR_HOT inline void resize(const int new_size) | |
| 167 | 167 | { |
| 168 | 168 | int cnt = count(); |
| 169 | 169 | if (new_size > 0) |
| 170 | 170 | { |
| 171 | _ListClass *m_new = n | |
| 171 | _ListClass *m_new = new _ListClass[new_size]; | |
| 172 | 172 | _ListClass *pd = m_new; |
| 173 | 173 | |
| 174 | 174 | if (cnt > new_size) |
| r243192 | r243193 | |
| 176 | 176 | for (_ListClass *ps = m_list; ps < m_list + cnt; ps++, pd++) |
| 177 | 177 | *pd = *ps; |
| 178 | 178 | if (m_list != NULL) |
| 179 | | |
| 179 | delete[] m_list; | |
| 180 | 180 | m_list = m_new; |
| 181 | 181 | m_count = cnt; |
| 182 | 182 | } |
| 183 | 183 | else |
| 184 | 184 | { |
| 185 | 185 | if (m_list != NULL) |
| 186 | | |
| 186 | delete[] m_list; | |
| 187 | 187 | m_list = NULL; |
| 188 | 188 | m_count = 0; |
| 189 | 189 | } |
| r243192 | r243193 | |
| 199 | 199 | // pnamedlist_t: a simple list |
| 200 | 200 | // ---------------------------------------------------------------------------------------- |
| 201 | 201 | |
| 202 | #ifdef SDLMAME_SOLARIS | |
| 203 | #undef _C | |
| 204 | #endif | |
| 205 | ||
| 206 | 202 | template <class _C> |
| 207 | 203 | class pnamedlist_t : public plinearlist_t<_C> |
| 208 | 204 | { |
| r243192 | r243193 | |
|---|---|---|
| 23 | 23 | "DT_INT16", |
| 24 | 24 | "DT_INT8", |
| 25 | 25 | "DT_INT", |
| 26 | "DT_BOOLEAN", | |
| 27 | "DT_FLOAT" | |
| 26 | "DT_BOOLEAN" | |
| 28 | 27 | }; |
| 29 | 28 | |
| 30 | 29 | NL_VERBOSE_OUT(("SAVE: <%s> %s(%d) %p\n", fullname.cstr(), ts[dt].cstr(), size, ptr)); |
| 31 | pstate_entry_t *p = n | |
| 30 | pstate_entry_t *p = new pstate_entry_t(stname, dt, owner, size, count, ptr, is_ptr); | |
| 32 | 31 | m_save.add(p); |
| 33 | 32 | } |
| 34 | 33 | |
| r243192 | r243193 | |
| 61 | 60 | if (m_save[i]->m_dt == DT_CUSTOM) |
| 62 | 61 | m_save[i]->m_callback->on_post_load(); |
| 63 | 62 | } |
| 64 | ||
| 65 | template<> ATTR_COLD void pstate_manager_t::save_item(pstate_callback_t &state, const void *owner, const pstring &stname) | |
| 66 | { | |
| 67 | //save_state_ptr(stname, DT_CUSTOM, 0, 1, &state); | |
| 68 | pstate_entry_t *p = nl_alloc(pstate_entry_t, stname, owner, &state); | |
| 69 | m_save.add(p); | |
| 70 | state.register_state(*this, stname); | |
| 71 | } |
| r243192 | r243193 | |
|---|---|---|
| 32 | 32 | DT_INT16, |
| 33 | 33 | DT_INT8, |
| 34 | 34 | DT_INT, |
| 35 | DT_BOOLEAN, | |
| 36 | DT_FLOAT | |
| 35 | DT_BOOLEAN | |
| 37 | 36 | }; |
| 38 | 37 | |
| 39 | 38 | template<typename _ItemType> struct nl_datatype |
| r243192 | r243193 | |
| 56 | 55 | |
| 57 | 56 | NETLIST_SAVE_TYPE(char, DT_INT8); |
| 58 | 57 | NETLIST_SAVE_TYPE(double, DT_DOUBLE); |
| 59 | NETLIST_SAVE_TYPE(float, DT_FLOAT); | |
| 60 | 58 | NETLIST_SAVE_TYPE(INT8, DT_INT8); |
| 61 | 59 | NETLIST_SAVE_TYPE(UINT8, DT_INT8); |
| 62 | 60 | NETLIST_SAVE_TYPE(INT64, DT_INT64); |
| r243192 | r243193 | |
| 147 | 145 | pstate_entry_t::list_t m_save; |
| 148 | 146 | }; |
| 149 | 147 | |
| 150 | template<> ATTR_COLD void pstate_manager_t::save_item(pstate_callback_t &state, const void *owner, const pstring &stname); | |
| 148 | template<> ATTR_COLD inline void pstate_manager_t::save_item(pstate_callback_t &state, const void *owner, const pstring &stname) | |
| 149 | { | |
| 150 | //save_state_ptr(stname, DT_CUSTOM, 0, 1, &state); | |
| 151 | pstate_entry_t *p = new pstate_entry_t(stname, owner, &state); | |
| 152 | m_save.add(p); | |
| 153 | state.register_state(*this, stname); | |
| 154 | } | |
| 151 | 155 | |
| 152 | 156 | template<> ATTR_COLD inline void pstate_manager_t::save_item(netlist_time &nlt, const void *owner, const pstring &stname) |
| 153 | 157 | { |
| r243192 | r243193 | |
|---|---|---|
| 14 | 14 | //pstring::str_t *pstring::m_zero = new(pstring::m_pool, 0) pstring::str_t(0); |
| 15 | 15 | |
| 16 | 16 | pblockpool pstring::m_pool; |
| 17 | ||
| 17 | 18 | pstring::str_t pstring::m_zero; |
| 18 | 19 | |
| 19 | 20 | /* |
| r243192 | r243193 | |
| 108 | 109 | return 1; |
| 109 | 110 | } |
| 110 | 111 | |
| 111 | ||
| 112 | double pstring::as_double(bool *error) const | |
| 112 | 113 | { |
| 113 | | |
| 114 | double ret; | |
| 114 | 115 | char *e = NULL; |
| 115 | 116 | |
| 116 | 117 | if (error != NULL) |
| r243192 | r243193 | |
| 124 | 125 | |
| 125 | 126 | long pstring::as_long(bool *error) const |
| 126 | 127 | { |
| 127 | | |
| 128 | double ret; | |
| 128 | 129 | char *e = NULL; |
| 129 | 130 | |
| 130 | 131 | if (error != NULL) |
| r243192 | r243193 | |
|---|---|---|
| 159 | 159 | |
| 160 | 160 | // conversions |
| 161 | 161 | |
| 162 | | |
| 162 | double as_double(bool *error = NULL) const; | |
| 163 | 163 | |
| 164 | 164 | long as_long(bool *error = NULL) const; |
| 165 | 165 |
| r243192 | r243193 | |
|---|---|---|
| 1 | // license:BSD-3-Clause | |
| 2 | // copyright-holders:Olivier Galibert, Aaron Giles | |
| 3 | /*************************************************************************** | |
| 4 | ||
| 5 | parameters.c | |
| 6 | ||
| 7 | Per-game parameters handling. | |
| 8 | ||
| 9 | ***************************************************************************/ | |
| 10 | ||
| 11 | #include "emu.h" | |
| 12 | ||
| 13 | parameters_manager::parameters_manager(running_machine &machine) | |
| 14 | : m_machine(machine) | |
| 15 | { | |
| 16 | } | |
| 17 | ||
| 18 | astring parameters_manager::lookup(astring tag) const | |
| 19 | { | |
| 20 | return m_parameters.find(tag); | |
| 21 | } | |
| 22 | ||
| 23 | void parameters_manager::add(astring tag, astring value) | |
| 24 | { | |
| 25 | m_parameters.add(tag, value); | |
| 26 | } |
| r243192 | r243193 | |
|---|---|---|
| 1 | // license:BSD-3-Clause | |
| 2 | // copyright-holders:Olivier Galibert,Aaron Giles | |
| 3 | /*************************************************************************** | |
| 4 | ||
| 5 | parameters.h | |
| 6 | ||
| 7 | Per-game parameters handling. | |
| 8 | ||
| 9 | ***************************************************************************/ | |
| 10 | ||
| 11 | #pragma once | |
| 12 | ||
| 13 | #ifndef __EMU_H__ | |
| 14 | #error Dont include this file directly; include emu.h instead. | |
| 15 | #endif | |
| 16 | ||
| 17 | #ifndef __PARAMETERS_H__ | |
| 18 | #define __PARAMETERS_H__ | |
| 19 | ||
| 20 | ||
| 21 | //************************************************************************** | |
| 22 | // TYPE DEFINITIONS | |
| 23 | //************************************************************************** | |
| 24 | ||
| 25 | // ======================> parameters_manager | |
| 26 | ||
| 27 | class parameters_manager | |
| 28 | { | |
| 29 | DISABLE_COPYING(parameters_manager); | |
| 30 | ||
| 31 | public: | |
| 32 | // construction/destruction | |
| 33 | parameters_manager(running_machine &machine); | |
| 34 | ||
| 35 | // getters | |
| 36 | running_machine &machine() const { return m_machine; } | |
| 37 | astring lookup(astring tag) const; | |
| 38 | ||
| 39 | // setters | |
| 40 | void add(astring tag, astring value); | |
| 41 | ||
| 42 | private: | |
| 43 | // internal state | |
| 44 | running_machine & m_machine; // reference to owning machine | |
| 45 | tagmap_t<astring> m_parameters; | |
| 46 | }; | |
| 47 | ||
| 48 | #endif // __INPTPORT_H__ */ |
| r243192 | r243193 | |
|---|---|---|
| 207 | 207 | |
| 208 | 208 | render_texinfo &render_texinfo::operator=(const render_texinfo &src) |
| 209 | 209 | { |
| 210 | free_palette(); | |
| 211 | base = src.base; | |
| 212 | rowpixels = src.rowpixels; | |
| 213 | width = src.width; | |
| 214 | height = src.height; | |
| 215 | seqid = src.seqid; | |
| 216 | osddata = src.osddata; | |
| 217 | m_palette = src.m_palette; | |
| 218 | if (m_palette != NULL) | |
| 219 | { | |
| 220 | m_palette->ref_count++; | |
| 221 | } | |
| 222 | return *this; | |
| 210 | free_palette(); | |
| 211 | base = src.base; | |
| 212 | rowpixels = src.rowpixels; | |
| 213 | width = src.width; | |
| 214 | height = src.height; | |
| 215 | seqid = src.seqid; | |
| 216 | osddata = src.osddata; | |
| 217 | m_palette = src.m_palette; | |
| 218 | if (m_palette != NULL) | |
| 219 | { | |
| 220 | m_palette->ref_count++; | |
| 221 | } | |
| 222 | return *this; | |
| 223 | 223 | } |
| 224 | 224 | |
| 225 | 225 | render_texinfo::render_texinfo(const render_texinfo &src) |
| 226 | 226 | { |
| 227 | base = src.base; | |
| 228 | rowpixels = src.rowpixels; | |
| 229 | width = src.width; | |
| 230 | height = src.height; | |
| 231 | seqid = src.seqid; | |
| 232 | osddata = src.osddata; | |
| 233 | m_palette = src.m_palette; | |
| 234 | if (m_palette != NULL) | |
| 235 | { | |
| 236 | m_palette->ref_count++; | |
| 237 | } | |
| 227 | base = src.base; | |
| 228 | rowpixels = src.rowpixels; | |
| 229 | width = src.width; | |
| 230 | height = src.height; | |
| 231 | seqid = src.seqid; | |
| 232 | osddata = src.osddata; | |
| 233 | m_palette = src.m_palette; | |
| 234 | if (m_palette != NULL) | |
| 235 | { | |
| 236 | m_palette->ref_count++; | |
| 237 | } | |
| 238 | 238 | } |
| 239 | 239 | |
| 240 | 240 | void render_texinfo::set_palette(const dynamic_array<rgb_t> *source) |
| 241 | 241 | { |
| 242 | free_palette(); | |
| 243 | if (source != NULL) | |
| 244 | { | |
| 245 | m_palette = global_alloc(render_palette_copy); | |
| 246 | m_palette->palette.copyfrom(*source); | |
| 247 | m_palette->ref_count = 1; | |
| 248 | } | |
| 249 | else | |
| 250 | { | |
| 251 | m_palette = NULL; | |
| 252 | } | |
| 242 | free_palette(); | |
| 243 | if (source != NULL) | |
| 244 | { | |
| 245 | m_palette = global_alloc(render_palette_copy); | |
| 246 | m_palette->palette.copyfrom(*source); | |
| 247 | m_palette->ref_count = 1; | |
| 248 | } | |
| 249 | else | |
| 250 | { | |
| 251 | m_palette = NULL; | |
| 252 | } | |
| 253 | 253 | } |
| 254 | 254 | |
| 255 | 255 | void render_texinfo::free_palette() |
| 256 | 256 | { |
| 257 | if (m_palette != NULL) | |
| 258 | { | |
| 259 | m_palette->ref_count--; | |
| 260 | if (m_palette->ref_count == 0) | |
| 261 | { | |
| 262 | global_free(m_palette); | |
| 263 | } | |
| 264 | } | |
| 265 | m_palette = NULL; | |
| 257 | if (m_palette != NULL) | |
| 258 | { | |
| 259 | m_palette->ref_count--; | |
| 260 | if (m_palette->ref_count == 0) | |
| 261 | { | |
| 262 | global_free(m_palette); | |
| 263 | } | |
| 264 | } | |
| 265 | m_palette = NULL; | |
| 266 | 266 | } |
| 267 | 267 | |
| 268 | 268 | |
| r243192 | r243193 | |
| 277 | 277 | |
| 278 | 278 | void render_primitive::reset() |
| 279 | 279 | { |
| 280 | // public state | |
| 281 | type = INVALID; | |
| 282 | bounds.x0 = 0; | |
| 283 | bounds.y0 = 0; | |
| 284 | bounds.x1 = 0; | |
| 285 | bounds.y1 = 0; | |
| 286 | color.a = 0; | |
| 287 | color.r = 0; | |
| 288 | color.g = 0; | |
| 289 | color.b = 0; | |
| 290 | flags = 0; | |
| 291 | width = 0.0f; | |
| 292 | texture.set_palette(NULL); | |
| 293 | texture = render_texinfo(); | |
| 294 | texcoords.bl.u = 0.0f; | |
| 295 | texcoords.bl.v = 0.0f; | |
| 296 | texcoords.br.u = 0.0f; | |
| 297 | texcoords.br.v = 0.0f; | |
| 298 | texcoords.tl.u = 0.0f; | |
| 299 | texcoords.tl.v = 0.0f; | |
| 300 | texcoords.tr.u = 0.0f; | |
| 301 | texcoords.tr.v = 0.0f; | |
| 280 | // public state | |
| 281 | type = INVALID; | |
| 282 | bounds.x0 = 0; | |
| 283 | bounds.y0 = 0; | |
| 284 | bounds.x1 = 0; | |
| 285 | bounds.y1 = 0; | |
| 286 | color.a = 0; | |
| 287 | color.r = 0; | |
| 288 | color.g = 0; | |
| 289 | color.b = 0; | |
| 290 | flags = 0; | |
| 291 | width = 0.0f; | |
| 292 | texture.set_palette(NULL); | |
| 293 | texture = render_texinfo(); | |
| 294 | texcoords.bl.u = 0.0f; | |
| 295 | texcoords.bl.v = 0.0f; | |
| 296 | texcoords.br.u = 0.0f; | |
| 297 | texcoords.br.v = 0.0f; | |
| 298 | texcoords.tl.u = 0.0f; | |
| 299 | texcoords.tl.v = 0.0f; | |
| 300 | texcoords.tr.u = 0.0f; | |
| 301 | texcoords.tr.v = 0.0f; | |
| 302 | 302 | |
| 303 | // do not clear m_next! | |
| 304 | // memset(&type, 0, FPTR(&texcoords + 1) - FPTR(&type)); | |
| 303 | // do not clear m_next! | |
| 304 | // memset(&type, 0, FPTR(&texcoords + 1) - FPTR(&type)); | |
| 305 | 305 | } |
| 306 | 306 | |
| 307 | 307 | |
| r243192 | r243193 | |
| 556 | 556 | texinfo.width = swidth; |
| 557 | 557 | texinfo.height = sheight; |
| 558 | 558 | // will be set later |
| 559 | ||
| 559 | texinfo.set_palette(NULL); | |
| 560 | 560 | texinfo.seqid = ++m_curseq; |
| 561 | 561 | } |
| 562 | 562 | else |
| 563 | 563 | { |
| 564 | // make sure we can recover the original argb32 bitmap | |
| 565 | bitmap_argb32 dummy; | |
| 566 | bitmap_argb32 &srcbitmap = (m_bitmap != NULL) ? downcast<bitmap_argb32 &>(*m_bitmap) : dummy; | |
| 564 | // make sure we can recover the original argb32 bitmap | |
| 565 | bitmap_argb32 dummy; | |
| 566 | bitmap_argb32 &srcbitmap = (m_bitmap != NULL) ? downcast<bitmap_argb32 &>(*m_bitmap) : dummy; | |
| 567 | 567 | |
| 568 | // is it a size we already have? | |
| 569 | scaled_texture *scaled = NULL; | |
| 570 | int scalenum; | |
| 571 | for (scalenum = 0; scalenum < ARRAY_LENGTH(m_scaled); scalenum++) | |
| 572 | { | |
| 573 | scaled = &m_scaled[scalenum]; | |
| 568 | // is it a size we already have? | |
| 569 | scaled_texture *scaled = NULL; | |
| 570 | int scalenum; | |
| 571 | for (scalenum = 0; scalenum < ARRAY_LENGTH(m_scaled); scalenum++) | |
| 572 | { | |
| 573 | scaled = &m_scaled[scalenum]; | |
| 574 | 574 | |
| 575 | // we need a non-NULL bitmap with matching dest size | |
| 576 | if (scaled->bitmap != NULL && dwidth == scaled->bitmap->width() && dheight == scaled->bitmap->height()) | |
| 577 | break; | |
| 578 | } | |
| 575 | // we need a non-NULL bitmap with matching dest size | |
| 576 | if (scaled->bitmap != NULL && dwidth == scaled->bitmap->width() && dheight == scaled->bitmap->height()) | |
| 577 | break; | |
| 578 | } | |
| 579 | 579 | |
| 580 | // did we get one? | |
| 581 | if (scalenum == ARRAY_LENGTH(m_scaled)) | |
| 582 | { | |
| 583 | int lowest = -1; | |
| 580 | // did we get one? | |
| 581 | if (scalenum == ARRAY_LENGTH(m_scaled)) | |
| 582 | { | |
| 583 | int lowest = -1; | |
| 584 | 584 | |
| 585 | // didn't find one -- take the entry with the lowest seqnum | |
| 586 | for (scalenum = 0; scalenum < ARRAY_LENGTH(m_scaled); scalenum++) | |
| 587 | if ((lowest == -1 || m_scaled[scalenum].seqid < m_scaled[lowest].seqid) && !primlist.has_reference(m_scaled[scalenum].bitmap)) | |
| 588 | lowest = scalenum; | |
| 589 | assert_always(lowest != -1, "Too many live texture instances!"); | |
| 585 | // didn't find one -- take the entry with the lowest seqnum | |
| 586 | for (scalenum = 0; scalenum < ARRAY_LENGTH(m_scaled); scalenum++) | |
| 587 | if ((lowest == -1 || m_scaled[scalenum].seqid < m_scaled[lowest].seqid) && !primlist.has_reference(m_scaled[scalenum].bitmap)) | |
| 588 | lowest = scalenum; | |
| 589 | assert_always(lowest != -1, "Too many live texture instances!"); | |
| 590 | 590 | |
| 591 | // throw out any existing entries | |
| 592 | scaled = &m_scaled[lowest]; | |
| 593 | if (scaled->bitmap != NULL) | |
| 594 | { | |
| 595 | m_manager->invalidate_all(scaled->bitmap); | |
| 596 | global_free(scaled->bitmap); | |
| 597 | } | |
| 591 | // throw out any existing entries | |
| 592 | scaled = &m_scaled[lowest]; | |
| 593 | if (scaled->bitmap != NULL) | |
| 594 | { | |
| 595 | m_manager->invalidate_all(scaled->bitmap); | |
| 596 | global_free(scaled->bitmap); | |
| 597 | } | |
| 598 | 598 | |
| 599 | // allocate a new bitmap | |
| 600 | scaled->bitmap = global_alloc(bitmap_argb32(dwidth, dheight)); | |
| 601 | scaled->seqid = ++m_curseq; | |
| 599 | // allocate a new bitmap | |
| 600 | scaled->bitmap = global_alloc(bitmap_argb32(dwidth, dheight)); | |
| 601 | scaled->seqid = ++m_curseq; | |
| 602 | 602 | |
| 603 | // let the scaler do the work | |
| 604 | (*m_scaler)(*scaled->bitmap, srcbitmap, m_sbounds, m_param); | |
| 605 | } | |
| 603 | // let the scaler do the work | |
| 604 | (*m_scaler)(*scaled->bitmap, srcbitmap, m_sbounds, m_param); | |
| 605 | } | |
| 606 | 606 | |
| 607 | // finally fill out the new info | |
| 608 | primlist.add_reference(scaled->bitmap); | |
| 609 | texinfo.base = &scaled->bitmap->pix32(0); | |
| 610 | texinfo.rowpixels = scaled->bitmap->rowpixels(); | |
| 611 | texinfo.width = dwidth; | |
| 612 | texinfo.height = dheight; | |
| 613 | // will be set later | |
| 614 | texinfo.set_palette(NULL); | |
| 615 | texinfo.seqid = scaled->seqid; | |
| 607 | // finally fill out the new info | |
| 608 | primlist.add_reference(scaled->bitmap); | |
| 609 | texinfo.base = &scaled->bitmap->pix32(0); | |
| 610 | texinfo.rowpixels = scaled->bitmap->rowpixels(); | |
| 611 | texinfo.width = dwidth; | |
| 612 | texinfo.height = dheight; | |
| 613 | // will be set later | |
| 614 | texinfo.set_palette(NULL); | |
| 615 | texinfo.seqid = scaled->seqid; | |
| 616 | 616 | } |
| 617 | 617 | } |
| 618 | 618 | |
| r243192 | r243193 | |
| 1817 | 1817 | height = MIN(height, m_maxtexheight); |
| 1818 | 1818 | |
| 1819 | 1819 | curitem->texture()->get_scaled(width, height, prim->texture, list); |
| 1820 | ||
| 1820 | // set the palette | |
| 1821 | 1821 | #if 1 |
| 1822 | 1822 | const dynamic_array<rgb_t> *adjusted_pal = curitem->texture()->get_adjusted_palette(container); |
| 1823 | ||
| 1823 | prim->texture.set_palette(adjusted_pal); | |
| 1824 | 1824 | #else |
| 1825 | ||
| 1825 | prim->texture.palette = curitem->texture()->get_adjusted_palette(container); | |
| 1826 | 1826 | #endif |
| 1827 | 1827 | |
| 1828 | // determine UV coordinates and apply clipping | |
| 1829 | prim->texcoords = oriented_texcoords[finalorient]; | |
| 1830 | clipped = render_clip_quad(&prim->bounds, &cliprect, &prim->texcoords); | |
| 1828 | // determine UV coordinates and apply clipping | |
| 1829 | prim->texcoords = oriented_texcoords[finalorient]; | |
| 1830 | clipped = render_clip_quad(&prim->bounds, &cliprect, &prim->texcoords); | |
| 1831 | 1831 | |
| 1832 | // apply the final orientation from the quad flags and then build up the final flags | |
| 1833 | prim->flags = (curitem->flags() & ~(PRIMFLAG_TEXORIENT_MASK | PRIMFLAG_BLENDMODE_MASK | PRIMFLAG_TEXFORMAT_MASK)) | | |
| 1834 | PRIMFLAG_TEXORIENT(finalorient) | | |
| 1835 | PRIMFLAG_TEXFORMAT(curitem->texture()->format()); | |
| 1836 | if (blendmode != -1) | |
| 1837 | prim->flags |= PRIMFLAG_BLENDMODE(blendmode); | |
| 1838 | else | |
| 1839 | prim->flags |= PRIMFLAG_BLENDMODE(PRIMFLAG_GET_BLENDMODE(curitem->flags())); | |
| 1832 | // apply the final orientation from the quad flags and then build up the final flags | |
| 1833 | prim->flags = (curitem->flags() & ~(PRIMFLAG_TEXORIENT_MASK | PRIMFLAG_BLENDMODE_MASK | PRIMFLAG_TEXFORMAT_MASK)) | | |
| 1834 | PRIMFLAG_TEXORIENT(finalorient) | | |
| 1835 | PRIMFLAG_TEXFORMAT(curitem->texture()->format()); | |
| 1836 | if (blendmode != -1) | |
| 1837 | prim->flags |= PRIMFLAG_BLENDMODE(blendmode); | |
| 1838 | else | |
| 1839 | prim->flags |= PRIMFLAG_BLENDMODE(PRIMFLAG_GET_BLENDMODE(curitem->flags())); | |
| 1840 | 1840 | } |
| 1841 | 1841 | else |
| 1842 | 1842 | { |
| r243192 | r243193 | |
| 1876 | 1876 | (container_xform.orientation & ORIENTATION_SWAP_XY) ? width : height, prim->texture, list); |
| 1877 | 1877 | |
| 1878 | 1878 | // determine UV coordinates |
| 1879 | ||
| 1879 | prim->texcoords = oriented_texcoords[container_xform.orientation]; | |
| 1880 | 1880 | |
| 1881 | // set the flags and add it to the list | |
| 1882 | prim->flags = PRIMFLAG_TEXORIENT(container_xform.orientation) | | |
| 1883 | PRIMFLAG_BLENDMODE(BLENDMODE_RGB_MULTIPLY) | | |
| 1884 | PRIMFLAG_TEXFORMAT(container.overlay()->format()) | | |
| 1885 | PRIMFLAG_TEXSHADE(1); | |
| 1881 | // set the flags and add it to the list | |
| 1882 | prim->flags = PRIMFLAG_TEXORIENT(container_xform.orientation) | | |
| 1883 | PRIMFLAG_BLENDMODE(BLENDMODE_RGB_MULTIPLY) | | |
| 1884 | PRIMFLAG_TEXFORMAT(container.overlay()->format()) | | |
| 1885 | PRIMFLAG_TEXSHADE(1); | |
| 1886 | 1886 | |
| 1887 | ||
| 1887 | list.append_or_return(*prim, false); | |
| 1888 | 1888 | } |
| 1889 | 1889 | } |
| 1890 | 1890 | |
| r243192 | r243193 | |
| 1925 | 1925 | |
| 1926 | 1926 | texture->get_scaled(width, height, prim->texture, list); |
| 1927 | 1927 | |
| 1928 | // compute the clip rect | |
| 1929 | render_bounds cliprect; | |
| 1930 | cliprect.x0 = render_round_nearest(xform.xoffs); | |
| 1931 | cliprect.y0 = render_round_nearest(xform.yoffs); | |
| 1932 | cliprect.x1 = render_round_nearest(xform.xoffs + xform.xscale); | |
| 1933 | cliprect.y1 = render_round_nearest(xform.yoffs + xform.yscale); | |
| 1934 | sect_render_bounds(&cliprect, &m_bounds); | |
| 1928 | // compute the clip rect | |
| 1929 | render_bounds cliprect; | |
| 1930 | cliprect.x0 = render_round_nearest(xform.xoffs); | |
| 1931 | cliprect.y0 = render_round_nearest(xform.yoffs); | |
| 1932 | cliprect.x1 = render_round_nearest(xform.xoffs + xform.xscale); | |
| 1933 | cliprect.y1 = render_round_nearest(xform.yoffs + xform.yscale); | |
| 1934 | sect_render_bounds(&cliprect, &m_bounds); | |
| 1935 | 1935 | |
| 1936 | // determine UV coordinates and apply clipping | |
| 1937 | prim->texcoords = oriented_texcoords[xform.orientation]; | |
| 1938 | bool clipped = render_clip_quad(&prim->bounds, &cliprect, &prim->texcoords); | |
| 1936 | // determine UV coordinates and apply clipping | |
| 1937 | prim->texcoords = oriented_texcoords[xform.orientation]; | |
| 1938 | bool clipped = render_clip_quad(&prim->bounds, &cliprect, &prim->texcoords); | |
| 1939 | 1939 | |
| 1940 | 1940 | // add to the list or free if we're clipped out |
| 1941 | 1941 | list.append_or_return(*prim, clipped); |
| r243192 | r243193 | |
|---|---|---|
| 213 | 213 | |
| 214 | 214 | struct render_palette_copy |
| 215 | 215 | { |
| 216 | int ref_count; | |
| 217 | dynamic_array<rgb_t> palette; | |
| 216 | int ref_count; | |
| 217 | dynamic_array<rgb_t> palette; | |
| 218 | 218 | }; |
| 219 | 219 | |
| 220 | 220 | class render_texinfo |
| 221 | 221 | { |
| 222 | 222 | public: |
| 223 | render_texinfo() | |
| 224 | : base(NULL), rowpixels(0), width(0), height(0), | |
| 225 | seqid(0), osddata(0), m_palette(NULL) | |
| 226 | {} | |
| 223 | render_texinfo() | |
| 224 | : base(NULL), rowpixels(0), width(0), height(0), | |
| 225 | seqid(0), osddata(0), m_palette(NULL) | |
| 226 | {} | |
| 227 | 227 | |
| 228 | ||
| 228 | render_texinfo(const render_texinfo &src); | |
| 229 | 229 | |
| 230 | ~render_texinfo() | |
| 231 | { | |
| 232 | free_palette(); | |
| 233 | } | |
| 230 | ~render_texinfo() | |
| 231 | { | |
| 232 | free_palette(); | |
| 233 | } | |
| 234 | 234 | |
| 235 | ||
| 235 | render_texinfo &operator=(const render_texinfo &src); | |
| 236 | 236 | |
| 237 | 237 | void * base; // base of the data |
| 238 | 238 | UINT32 rowpixels; // pixels per row |
| r243192 | r243193 | |
| 241 | 241 | UINT32 seqid; // sequence ID |
| 242 | 242 | UINT64 osddata; // aux data to pass to osd |
| 243 | 243 | |
| 244 | ||
| 244 | const rgb_t * palette() const { return ((m_palette == NULL) ? NULL : &m_palette->palette[0]); } | |
| 245 | 245 | |
| 246 | ||
| 246 | void set_palette(const dynamic_array<rgb_t> *source); | |
| 247 | 247 | |
| 248 | 248 | private: |
| 249 | ||
| 249 | void free_palette(); | |
| 250 | 250 | |
| 251 | ||
| 251 | render_palette_copy *m_palette; // palette for PALETTE16 textures, LUTs for RGB15/RGB32 | |
| 252 | 252 | }; |
| 253 | 253 | |
| 254 | 254 |
| r243192 | r243193 | |
|---|---|---|
| 89 | 89 | // if this is an OSD font, we're done |
| 90 | 90 | if (filename != NULL) |
| 91 | 91 | { |
| 92 | m_osdfont = manager.machine().osd().font_ | |
| 92 | m_osdfont = manager.machine().osd().font_open(filename, m_height); | |
| 93 | 93 | if (m_osdfont != NULL) |
| 94 | 94 | { |
| 95 | if (m_osdfont->open(manager.machine().options().font_path(), filename, m_height)) | |
| 96 | { | |
| 97 | m_scale = 1.0f / (float)m_height; | |
| 98 | m_format = FF_OSD; | |
| 99 | return; | |
| 100 | } | |
| 101 | global_free(m_osdfont); | |
| 102 | m_osdfont = NULL; | |
| 95 | m_scale = 1.0f / (float)m_height; | |
| 96 | m_format = FF_OSD; | |
| 97 | return; | |
| 103 | 98 | } |
| 104 | 99 | } |
| 105 | 100 | |
| r243192 | r243193 | |
| 135 | 130 | |
| 136 | 131 | // release the OSD font |
| 137 | 132 | if (m_osdfont != NULL) |
| 138 | { | |
| 139 | m_osdfont->close(); | |
| 140 | global_free(m_osdfont); | |
| 141 | } | |
| 133 | m_manager.machine().osd().font_close(m_osdfont); | |
| 142 | 134 | } |
| 143 | 135 | |
| 144 | 136 | |
| r243192 | r243193 | |
| 157 | 149 | return; |
| 158 | 150 | |
| 159 | 151 | // attempt to get the font bitmap; if we fail, set bmwidth to -1 |
| 160 | if (!m_osdfont | |
| 152 | if (!m_manager.machine().osd().font_get_bitmap(m_osdfont, chnum, gl.bitmap, gl.width, gl.xoffs, gl.yoffs)) | |
| 161 | 153 | { |
| 162 | 154 | gl.bitmap.reset(); |
| 163 | 155 | gl.bmwidth = -1; |
| r243192 | r243193 | |
|---|---|---|
| 171 | 171 | const rom_entry *rom_first_region(const device_t &device) |
| 172 | 172 | { |
| 173 | 173 | const rom_entry *romp = device.rom_region(); |
| 174 | while (romp && ROMENTRY_ISPARAMETER(romp)) | |
| 175 | romp++; | |
| 176 | 174 | return (romp != NULL && !ROMENTRY_ISEND(romp)) ? romp : NULL; |
| 177 | 175 | } |
| 178 | 176 | |
| r243192 | r243193 | |
| 187 | 185 | romp++; |
| 188 | 186 | while (!ROMENTRY_ISREGIONEND(romp)) |
| 189 | 187 | romp++; |
| 190 | while (ROMENTRY_ISPARAMETER(romp)) | |
| 191 | romp++; | |
| 192 | 188 | return ROMENTRY_ISEND(romp) ? NULL : romp; |
| 193 | 189 | } |
| 194 | 190 | |
| r243192 | r243193 | |
| 222 | 218 | |
| 223 | 219 | |
| 224 | 220 | /*------------------------------------------------- |
| 225 | rom_first_parameter - return pointer to the first | |
| 226 | per-game parameter | |
| 227 | -------------------------------------------------*/ | |
| 228 | ||
| 229 | const rom_entry *rom_first_parameter(const device_t &device) | |
| 230 | { | |
| 231 | const rom_entry *romp = device.rom_region(); | |
| 232 | while (romp && !ROMENTRY_ISEND(romp) && !ROMENTRY_ISPARAMETER(romp)) | |
| 233 | romp++; | |
| 234 | return (romp != NULL && !ROMENTRY_ISEND(romp)) ? romp : NULL; | |
| 235 | } | |
| 236 | ||
| 237 | ||
| 238 | /*------------------------------------------------- | |
| 239 | rom_next_parameter - return pointer to the next | |
| 240 | per-game parameter | |
| 241 | -------------------------------------------------*/ | |
| 242 | ||
| 243 | const rom_entry *rom_next_parameter(const rom_entry *romp) | |
| 244 | { | |
| 245 | romp++; | |
| 246 | while (!ROMENTRY_ISREGIONEND(romp) && !ROMENTRY_ISPARAMETER(romp)) | |
| 247 | romp++; | |
| 248 | return ROMENTRY_ISEND(romp) ? NULL : romp; | |
| 249 | } | |
| 250 | ||
| 251 | ||
| 252 | /*------------------------------------------------- | |
| 253 | 221 | rom_region_name - return the appropriate name |
| 254 | 222 | for a rom region |
| 255 | 223 | -------------------------------------------------*/ |
| r243192 | r243193 | |
| 261 | 229 | |
| 262 | 230 | |
| 263 | 231 | /*------------------------------------------------- |
| 264 | rom_parameter_name - return the appropriate name | |
| 265 | for a per-game parameter | |
| 266 | -------------------------------------------------*/ | |
| 267 | ||
| 268 | astring &rom_parameter_name(astring &result, const device_t &device, const rom_entry *romp) | |
| 269 | { | |
| 270 | return device.subtag(result, romp->_name); | |
| 271 | } | |
| 272 | ||
| 273 | ||
| 274 | /*------------------------------------------------- | |
| 275 | rom_parameter_name - return the value for a | |
| 276 | per-game parameter | |
| 277 | -------------------------------------------------*/ | |
| 278 | ||
| 279 | astring rom_parameter_value(const rom_entry *romp) | |
| 280 | { | |
| 281 | return romp->_hashdata; | |
| 282 | } | |
| 283 | ||
| 284 | ||
| 285 | /*------------------------------------------------- | |
| 286 | 232 | rom_file_size - return the expected size of a |
| 287 | 233 | file given the ROM description |
| 288 | 234 | -------------------------------------------------*/ |
| r243192 | r243193 | |
| 1508 | 1454 | rom_region_name(regiontag, *device, region); |
| 1509 | 1455 | region_post_process(romdata, regiontag, ROMREGION_ISINVERTED(region)); |
| 1510 | 1456 | } |
| 1511 | ||
| 1512 | /* and finally register all per-game parameters */ | |
| 1513 | for (device_t *device = deviter.first(); device != NULL; device = deviter.next()) | |
| 1514 | for (const rom_entry *param = rom_first_parameter(*device); param != NULL; param = rom_next_parameter(param)) | |
| 1515 | { | |
| 1516 | rom_parameter_name(regiontag, *device, param); | |
| 1517 | romdata->machine().parameters().add(regiontag, rom_parameter_value(param)); | |
| 1518 | } | |
| 1519 | 1457 | } |
| 1520 | 1458 | |
| 1521 | 1459 |
| r243192 | r243193 | |
|---|---|---|
| 39 | 39 | ROMENTRYTYPE_IGNORE, /* this entry continues loading the previous ROM but throws the data away */ |
| 40 | 40 | ROMENTRYTYPE_SYSTEM_BIOS, /* this entry specifies a bios */ |
| 41 | 41 | ROMENTRYTYPE_DEFAULT_BIOS, /* this entry specifies a default bios */ |
| 42 | ROMENTRYTYPE_PARAMETER, /* this entry specifies a per-game parameter */ | |
| 43 | 42 | ROMENTRYTYPE_COUNT |
| 44 | 43 | }; |
| 45 | 44 | |
| r243192 | r243193 | |
| 153 | 152 | #define ROMENTRY_ISIGNORE(r) (ROMENTRY_GETTYPE(r) == ROMENTRYTYPE_IGNORE) |
| 154 | 153 | #define ROMENTRY_ISSYSTEM_BIOS(r) (ROMENTRY_GETTYPE(r) == ROMENTRYTYPE_SYSTEM_BIOS) |
| 155 | 154 | #define ROMENTRY_ISDEFAULT_BIOS(r) (ROMENTRY_GETTYPE(r) == ROMENTRYTYPE_DEFAULT_BIOS) |
| 156 | #define ROMENTRY_ISPARAMETER(r) (ROMENTRY_GETTYPE(r) == ROMENTRYTYPE_PARAMETER) | |
| 157 | #define ROMENTRY_ISREGIONEND(r) (ROMENTRY_ISREGION(r) || ROMENTRY_ISPARAMETER(r) || ROMENTRY_ISEND(r)) | |
| 155 | #define ROMENTRY_ISREGIONEND(r) (ROMENTRY_ISREGION(r) || ROMENTRY_ISEND(r)) | |
| 158 | 156 | |
| 159 | 157 | /* ----- per-region macros ----- */ |
| 160 | 158 | #define ROMREGION_GETTAG(r) ((r)->_name) |
| r243192 | r243193 | |
| 245 | 243 | #define ROM_DEFAULT_BIOS(name) { name, NULL, 0, 0, ROMENTRYTYPE_DEFAULT_BIOS }, |
| 246 | 244 | |
| 247 | 245 | |
| 248 | /* ----- game parameter macro ----- */ | |
| 249 | #define ROM_PARAMETER(tag, value) { tag, value, 0, 0, ROMENTRYTYPE_PARAMETER }, | |
| 250 | ||
| 251 | 246 | /* ----- disk loading macros ----- */ |
| 252 | 247 | #define DISK_REGION(tag) ROM_REGION(1, tag, ROMREGION_DATATYPEDISK) |
| 253 | 248 | #define DISK_IMAGE(name,idx,hash) ROMX_LOAD(name, idx, 0, hash, DISK_READWRITE) |
| r243192 | r243193 | |
| 282 | 277 | /* ----- ROM iteration ----- */ |
| 283 | 278 | |
| 284 | 279 | /* return pointer to the first ROM region within a source */ |
| 285 | const rom_entry *rom_first_region(const device_t & | |
| 280 | const rom_entry *rom_first_region(const device_t &romp); | |
| 286 | 281 | |
| 287 | 282 | /* return pointer to the next ROM region within a source */ |
| 288 | 283 | const rom_entry *rom_next_region(const rom_entry *romp); |
| r243192 | r243193 | |
| 299 | 294 | /* return the appropriate name for a rom region */ |
| 300 | 295 | astring &rom_region_name(astring &result, const device_t &device, const rom_entry *romp); |
| 301 | 296 | |
| 302 | /* return pointer to the first per-game parameter */ | |
| 303 | const rom_entry *rom_first_parameter(const device_t &device); | |
| 304 | 297 | |
| 305 | /* return pointer to the next per-game parameter */ | |
| 306 | const rom_entry *rom_next_parameter(const rom_entry *romp); | |
| 307 | 298 | |
| 308 | /* return the appropriate name for a per-game parameter */ | |
| 309 | astring &rom_parameter_name(astring &result, const device_t &device, const rom_entry *romp); | |
| 310 | ||
| 311 | /* return the value for a per-game parameter */ | |
| 312 | astring rom_parameter_value(const rom_entry *romp); | |
| 313 | ||
| 314 | ||
| 315 | 299 | /* ----- disk handling ----- */ |
| 316 | 300 | |
| 317 | 301 | /* open a disk image, searching up the parent and loading by checksum */ |
| r243192 | r243193 | |
|---|---|---|
| 213 | 213 | return validate_header(header, gamename, sig, errormsg, ""); |
| 214 | 214 | } |
| 215 | 215 | |
| 216 | //------------------------------------------------- | |
| 217 | // dispatch_postload - invoke all registered | |
| 218 | // postload callbacks for updates | |
| 219 | //------------------------------------------------- | |
| 220 | 216 | |
| 221 | ||
| 222 | void save_manager::dispatch_postload() | |
| 223 | { | |
| 224 | for (state_callback *func = m_postload_list.first(); func != NULL; func = func->next()) | |
| 225 | func->m_func(); | |
| 226 | } | |
| 227 | ||
| 228 | 217 | //------------------------------------------------- |
| 229 | 218 | // read_file - read the data from a file |
| 230 | 219 | //------------------------------------------------- |
| r243192 | r243193 | |
| 264 | 253 | } |
| 265 | 254 | |
| 266 | 255 | // call the post-load functions |
| 267 | dispatch_postload(); | |
| 256 | for (state_callback *func = m_postload_list.first(); func != NULL; func = func->next()) | |
| 257 | func->m_func(); | |
| 268 | 258 | |
| 269 | 259 | return STATERR_NONE; |
| 270 | 260 | } |
| 271 | 261 | |
| 272 | //------------------------------------------------- | |
| 273 | // dispatch_presave - invoke all registered | |
| 274 | // presave callbacks for updates | |
| 275 | //------------------------------------------------- | |
| 276 | 262 | |
| 277 | ||
| 278 | void save_manager::dispatch_presave() | |
| 279 | { | |
| 280 | for (state_callback *func = m_presave_list.first(); func != NULL; func = func->next()) | |
| 281 | func->m_func(); | |
| 282 | } | |
| 283 | ||
| 284 | 263 | //------------------------------------------------- |
| 285 | 264 | // write_file - writes the data to a file |
| 286 | 265 | //------------------------------------------------- |
| r243192 | r243193 | |
| 308 | 287 | file.compress(FCOMPRESS_MEDIUM); |
| 309 | 288 | |
| 310 | 289 | // call the pre-save functions |
| 311 | dispatch_presave(); | |
| 290 | for (state_callback *func = m_presave_list.first(); func != NULL; func = func->next()) | |
| 291 | func->m_func(); | |
| 312 | 292 | |
| 313 | 293 | // then write all the data |
| 314 | 294 | for (state_entry *entry = m_entry_list.first(); entry != NULL; entry = entry->next()) |
| r243192 | r243193 | |
|---|---|---|
| 99 | 99 | void register_presave(save_prepost_delegate func); |
| 100 | 100 | void register_postload(save_prepost_delegate func); |
| 101 | 101 | |
| 102 | // callback dispatching | |
| 103 | void dispatch_presave(); | |
| 104 | void dispatch_postload(); | |
| 105 | ||
| 106 | 102 | // generic memory registration |
| 107 | 103 | void save_memory(const char *module, const char *tag, UINT32 index, const char *name, void *val, UINT32 valsize, UINT32 valcount = 1); |
| 108 | 104 |
| r243192 | r243193 | |
|---|---|---|
| 246 | 246 | |
| 247 | 247 | save_item(NAME(m_serial_data_in)); |
| 248 | 248 | save_item(NAME(m_wave_regs)); |
| 249 | ||
| 249 | ||
| 250 | 250 | for (int i = 0; i < QS1000_CHANNELS; i++) |
| 251 | 251 | { |
| 252 | 252 | save_item(NAME(m_channels[i].m_acc), i); |
| r243192 | r243193 | |
|---|---|---|
| 129 | 129 | |
| 130 | 130 | if (env_phase == PHASE_NONE) break; |
| 131 | 131 | |
| 132 | tmp = rom[ | |
| 132 | tmp = rom[pos>>16]; | |
| 133 | 133 | switch ( type ) |
| 134 | 134 | { |
| 135 | 135 | case TYPE_16: |
| r243192 | r243193 | |
| 331 | 331 | } |
| 332 | 332 | |
| 333 | 333 | m_stream = stream_alloc(0, 2, clock()/384); |
| 334 | ||
| 335 | m_rommask = m_rom.length() - 1; | |
| 336 | 334 | } |
| 337 | 335 | |
| 338 | 336 |
| r243192 | r243193 | |
|---|---|---|
| 98 | 98 | private: |
| 99 | 99 | required_region_ptr<INT16> m_rom; |
| 100 | 100 | |
| 101 | UINT32 m_rommask; | |
| 102 | ||
| 103 | 101 | sound_stream *m_stream; |
| 104 | 102 | |
| 105 | 103 | double m_env_ar_table[0x9f]; |
| r243192 | r243193 | |
|---|---|---|
| 597 | 597 | chip->P5[chan] = 0; |
| 598 | 598 | chip->P9[chan] = 0; |
| 599 | 599 | } |
| 600 | ||
| 600 | ||
| 601 | 601 | tia_save_state(device, chip); |
| 602 | 602 | |
| 603 | 603 | return chip; |
| r243192 | r243193 | |
|---|---|---|
| 20 | 20 | |
| 21 | 21 | |
| 22 | 22 | /************************************************** |
| 23 | ||
| 23 | ||
| 24 | 24 | BARCODE READER MENU |
| 25 | ||
| 25 | ||
| 26 | 26 | **************************************************/ |
| 27 | 27 | |
| 28 | 28 | |
| r243192 | r243193 | |
| 51 | 51 | void ui_menu_barcode_reader::populate() |
| 52 | 52 | { |
| 53 | 53 | if (current_device()) |
| 54 | { | |
| 54 | { | |
| 55 | 55 | astring buffer; |
| 56 | 56 | const char *new_barcode; |
| 57 | 57 | |
| r243192 | r243193 | |
| 68 | 68 | { |
| 69 | 69 | new_barcode = m_barcode_buffer; |
| 70 | 70 | } |
| 71 | ||
| 71 | ||
| 72 | 72 | item_append("New Barcode:", new_barcode, 0, ITEMREF_NEW_BARCODE); |
| 73 | ||
| 73 | ||
| 74 | 74 | // finish up the menu |
| 75 | 75 | item_append(MENU_SEPARATOR_ITEM, NULL, 0, NULL); |
| 76 | 76 | item_append("Enter Code", NULL, 0, ITEMREF_ENTER_BARCODE); |
| 77 | ||
| 77 | ||
| 78 | 78 | customtop = machine().ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER; |
| 79 | 79 | } |
| 80 | 80 | } |
| r243192 | r243193 | |
| 103 | 103 | if (event->itemref == ITEMREF_SELECT_READER) |
| 104 | 104 | previous(); |
| 105 | 105 | break; |
| 106 | ||
| 106 | ||
| 107 | 107 | case IPT_UI_RIGHT: |
| 108 | 108 | if (event->itemref == ITEMREF_SELECT_READER) |
| 109 | 109 | next(); |
| r243192 | r243193 | |
|---|---|---|
| 1 | /********************************************************************* | |
| 2 | ||
| 3 | ui/cheatopt.c | |
| 4 | ||
| 5 | Internal menu for the cheat interface. | |
| 6 | ||
| 7 | Copyright Nicola Salmoria and the MAME Team. | |
| 8 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 9 | ||
| 10 | *********************************************************************/ | |
| 11 | ||
| 12 | #include "emu.h" | |
| 13 | #include "cheat.h" | |
| 14 | ||
| 15 | #include "uiinput.h" | |
| 16 | #include "ui/ui.h" | |
| 17 | #include "ui/cheatopt.h" | |
| 18 | ||
| 19 | /*------------------------------------------------- | |
| 20 | menu_cheat - handle the cheat menu | |
| 21 | -------------------------------------------------*/ | |
| 22 | ||
| 23 | void ui_menu_cheat::handle() | |
| 24 | { | |
| 25 | /* process the menu */ | |
| 26 | const ui_menu_event *menu_event = process(UI_MENU_PROCESS_LR_REPEAT); | |
| 27 | ||
| 28 | /* handle events */ | |
| 29 | if (menu_event != NULL && menu_event->itemref != NULL) | |
| 30 | { | |
| 31 | bool changed = false; | |
| 32 | ||
| 33 | /* clear cheat comment on any movement or keypress */ | |
| 34 | popmessage(NULL); | |
| 35 | ||
| 36 | /* handle reset all + reset all cheats for reload all option */ | |
| 37 | if ((FPTR)menu_event->itemref < 3 && menu_event->iptkey == IPT_UI_SELECT) | |
| 38 | { | |
| 39 | for (cheat_entry *curcheat = machine().cheat().first(); curcheat != NULL; curcheat = curcheat->next()) | |
| 40 | if (curcheat->select_default_state()) | |
| 41 | changed = true; | |
| 42 | } | |
| 43 | ||
| 44 | ||
| 45 | /* handle individual cheats */ | |
| 46 | else if ((FPTR)menu_event->itemref > 2) | |
| 47 | { | |
| 48 | cheat_entry *curcheat = reinterpret_cast<cheat_entry *>(menu_event->itemref); | |
| 49 | const char *string; | |
| 50 | switch (menu_event->iptkey) | |
| 51 | { | |
| 52 | /* if selected, activate a oneshot */ | |
| 53 | case IPT_UI_SELECT: | |
| 54 | changed = curcheat->activate(); | |
| 55 | break; | |
| 56 | ||
| 57 | /* if cleared, reset to default value */ | |
| 58 | case IPT_UI_CLEAR: | |
| 59 | changed = curcheat->select_default_state(); | |
| 60 | break; | |
| 61 | ||
| 62 | /* left decrements */ | |
| 63 | case IPT_UI_LEFT: | |
| 64 | changed = curcheat->select_previous_state(); | |
| 65 | break; | |
| 66 | ||
| 67 | /* right increments */ | |
| 68 | case IPT_UI_RIGHT: | |
| 69 | changed = curcheat->select_next_state(); | |
| 70 | break; | |
| 71 | ||
| 72 | /* bring up display comment if one exists */ | |
| 73 | case IPT_UI_DISPLAY_COMMENT: | |
| 74 | case IPT_UI_UP: | |
| 75 | case IPT_UI_DOWN: | |
| 76 | string = curcheat->comment(); | |
| 77 | if (string != NULL && string[0] != 0) | |
| 78 | popmessage("Cheat Comment:\n%s", string); | |
| 79 | break; | |
| 80 | } | |
| 81 | } | |
| 82 | ||
| 83 | /* handle reload all */ | |
| 84 | if ((FPTR)menu_event->itemref == 2 && menu_event->iptkey == IPT_UI_SELECT) | |
| 85 | { | |
| 86 | /* re-init cheat engine and thus reload cheats/cheats have already been turned off by here */ | |
| 87 | machine().cheat().reload(); | |
| 88 | ||
| 89 | /* display the reloaded cheats */ | |
| 90 | reset(UI_MENU_RESET_REMEMBER_REF); | |
| 91 | popmessage("All cheats reloaded"); | |
| 92 | } | |
| 93 | ||
| 94 | /* if things changed, update */ | |
| 95 | if (changed) | |
| 96 | reset(UI_MENU_RESET_REMEMBER_REF); | |
| 97 | } | |
| 98 | } | |
| 99 | ||
| 100 | ||
| 101 | /*------------------------------------------------- | |
| 102 | menu_cheat_populate - populate the cheat menu | |
| 103 | -------------------------------------------------*/ | |
| 104 | ||
| 105 | ui_menu_cheat::ui_menu_cheat(running_machine &machine, render_container *container) : ui_menu(machine, container) | |
| 106 | { | |
| 107 | } | |
| 108 | ||
| 109 | void ui_menu_cheat::populate() | |
| 110 | { | |
| 111 | /* iterate over cheats */ | |
| 112 | astring text; | |
| 113 | astring subtext; | |
| 114 | for (cheat_entry *curcheat = machine().cheat().first(); curcheat != NULL; curcheat = curcheat->next()) | |
| 115 | { | |
| 116 | UINT32 flags; | |
| 117 | curcheat->menu_text(text, subtext, flags); | |
| 118 | item_append(text, subtext, flags, curcheat); | |
| 119 | } | |
| 120 | ||
| 121 | /* add a separator */ | |
| 122 | item_append(MENU_SEPARATOR_ITEM, NULL, 0, NULL); | |
| 123 | ||
| 124 | /* add a reset all option */ | |
| 125 | item_append("Reset All", NULL, 0, (void *)1); | |
| 126 | ||
| 127 | /* add a reload all cheats option */ | |
| 128 | item_append("Reload All", NULL, 0, (void *)2); | |
| 129 | } | |
| 130 | ||
| 131 | ui_menu_cheat::~ui_menu_cheat() | |
| 132 | { | |
| 133 | } |
| r243192 | r243193 | |
|---|---|---|
| 1 | /*************************************************************************** | |
| 2 | ||
| 3 | ui/cheatopt.h | |
| 4 | ||
| 5 | Internal menu for the cheat interface. | |
| 6 | ||
| 7 | Copyright Nicola Salmoria and the MAME Team. | |
| 8 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 9 | ||
| 10 | ***************************************************************************/ | |
| 11 | ||
| 12 | #pragma once | |
| 13 | ||
| 14 | #ifndef __UI_CHEATOPT_H__ | |
| 15 | #define __UI_CHEATOPT_H__ | |
| 16 | ||
| 17 | class ui_menu_cheat : public ui_menu { | |
| 18 | public: | |
| 19 | ui_menu_cheat(running_machine &machine, render_container *container); | |
| 20 | virtual ~ui_menu_cheat(); | |
| 21 | virtual void populate(); | |
| 22 | virtual void handle(); | |
| 23 | }; | |
| 24 | ||
| 25 | #endif /* __UI_CHEATOPT_H__ */ |
| r243192 | r243193 | |
|---|---|---|
| 9 | 9 | printers) |
| 10 | 10 | The base class contains calls to get the total number of devices of |
| 11 | 11 | the same kind connected to the driver, and shortcuts to switch current |
| 12 | device to next one or previous one attached. This allows, for instance, | |
| 13 | users to pass from a device to another one by simply pressing left/right | |
| 14 | and the menu is rebuilt accordingly, without the need of a preliminary | |
| 12 | device to next one or previous one attached. This allows, for instance, | |
| 13 | users to pass from a device to another one by simply pressing left/right | |
| 14 | and the menu is rebuilt accordingly, without the need of a preliminary | |
| 15 | 15 | submenu listing available devices of the same kind. |
| 16 | 16 | |
| 17 | 17 | Copyright Nicola Salmoria and the MAME Team. |
| r243192 | r243193 | |
|---|---|---|
| 46 | 46 | string.catprintf("Option: %s\n", m_option->name()); |
| 47 | 47 | |
| 48 | 48 | dev = const_cast<machine_config &>(machine().config()).device_add(&machine().config().root_device(), m_option->name(), m_option->devtype(), 0); |
| 49 | ||
| 49 | ||
| 50 | 50 | string.catprintf("Device: %s\n", dev->name()); |
| 51 | 51 | if (!m_mounted) |
| 52 | 52 | string.cat("\nIf you select this option, the following items will be enabled:\n"); |
| r243192 | r243193 | |
| 66 | 66 | |
| 67 | 67 | // get cpu specific clock that takes internal multiplier/dividers into account |
| 68 | 68 | int clock = exec->device().clock(); |
| 69 | ||
| 69 | ||
| 70 | 70 | // count how many identical CPUs we have |
| 71 | 71 | int count = 1; |
| 72 | 72 | const char *name = exec->device().name(); |
| r243192 | r243193 | |
| 77 | 77 | if (exectags.add(scan->device().tag(), 1, FALSE) != TMERR_DUPLICATE) |
| 78 | 78 | count++; |
| 79 | 79 | } |
| 80 | ||
| 80 | ||
| 81 | 81 | // if more than one, prepend a #x in front of the CPU name |
| 82 | 82 | if (count > 1) |
| 83 | 83 | string.catprintf(" %d" UTF8_MULTIPLY, count); |
| 84 | 84 | else |
| 85 | 85 | string.cat(" "); |
| 86 | 86 | string.cat(name); |
| 87 | ||
| 87 | ||
| 88 | 88 | // display clock in kHz or MHz |
| 89 | 89 | if (clock >= 1000000) |
| 90 | 90 | string.catprintf(" %d.%06d" UTF8_NBSP "MHz\n", clock / 1000000, clock % 1000000); |
| r243192 | r243193 | |
| 92 | 92 | string.catprintf(" %d.%03d" UTF8_NBSP "kHz\n", clock / 1000, clock % 1000); |
| 93 | 93 | } |
| 94 | 94 | } |
| 95 | ||
| 95 | ||
| 96 | 96 | // display screen information |
| 97 | 97 | screen_device_iterator scriter(*dev); |
| 98 | 98 | if (scriter.count() > 0) |
| r243192 | r243193 | |
| 101 | 101 | for (screen_device *screen = scriter.first(); screen != NULL; screen = scriter.next()) |
| 102 | 102 | { |
| 103 | 103 | string.catprintf(" Screen '%s': ", screen->tag()); |
| 104 | ||
| 104 | ||
| 105 | 105 | if (screen->screen_type() == SCREEN_TYPE_VECTOR) |
| 106 | 106 | string.cat("Vector\n"); |
| 107 | 107 | else |
| 108 | 108 | { |
| 109 | 109 | const rectangle &visarea = screen->visible_area(); |
| 110 | ||
| 110 | ||
| 111 | 111 | string.catprintf("%d " UTF8_MULTIPLY " %d (%s) %f" UTF8_NBSP "Hz\n", |
| 112 | visarea.width(), visarea.height(), | |
| 113 | (machine().system().flags & ORIENTATION_SWAP_XY) ? "V" : "H", | |
| 114 | ATTOSECONDS_TO_HZ(screen->frame_period().attoseconds)); | |
| 112 | visarea.width(), visarea.height(), | |
| 113 | (machine().system().flags & ORIENTATION_SWAP_XY) ? "V" : "H", | |
| 114 | ATTOSECONDS_TO_HZ(screen->frame_period().attoseconds)); | |
| 115 | 115 | } |
| 116 | 116 | } |
| 117 | 117 | } |
| 118 | ||
| 118 | ||
| 119 | 119 | // loop over all sound chips |
| 120 | 120 | sound_interface_iterator snditer(*dev); |
| 121 | 121 | if (snditer.count() > 0) |
| r243192 | r243193 | |
| 126 | 126 | { |
| 127 | 127 | if (soundtags.add(sound->device().tag(), 1, FALSE) == TMERR_DUPLICATE) |
| 128 | 128 | continue; |
| 129 | ||
| 129 | ||
| 130 | 130 | // count how many identical sound chips we have |
| 131 | 131 | int count = 1; |
| 132 | 132 | sound_interface_iterator sndinneriter(*dev); |
| r243192 | r243193 | |
| 142 | 142 | else |
| 143 | 143 | string.cat(" "); |
| 144 | 144 | string.cat(sound->device().name()); |
| 145 | ||
| 145 | ||
| 146 | 146 | // display clock in kHz or MHz |
| 147 | 147 | int clock = sound->device().clock(); |
| 148 | 148 | if (clock >= 1000000) |
| r243192 | r243193 | |
| 153 | 153 | string.cat("\n"); |
| 154 | 154 | } |
| 155 | 155 | } |
| 156 | ||
| 157 | // scan for BIOS settings | |
| 158 | int bios = 0; | |
| 159 | if (dev->rom_region()) | |
| 160 | { | |
| 161 | astring bios_str; | |
| 162 | // first loop through roms in search of default bios (shortname) | |
| 163 | for (const rom_entry *rom = dev->rom_region(); !ROMENTRY_ISEND(rom); rom++) | |
| 164 | if (ROMENTRY_ISDEFAULT_BIOS(rom)) | |
| 165 | bios_str.cpy(ROM_GETNAME(rom)); | |
| 166 | ||
| 167 | // then loop again to count bios options and to get the default bios complete name | |
| 168 | for (const rom_entry *rom = dev->rom_region(); !ROMENTRY_ISEND(rom); rom++) | |
| 169 | { | |
| 170 | if (ROMENTRY_ISSYSTEM_BIOS(rom)) | |
| 171 | { | |
| 172 | bios++; | |
| 173 | if (bios_str == ROM_GETNAME(rom)) | |
| 174 | bios_str.cpy(ROM_GETHASHDATA(rom)); | |
| 175 | } | |
| 176 | } | |
| 177 | ||
| 178 | if (bios) | |
| 179 | string.catprintf("* BIOS settings:\n %d options [default: %s]\n", bios, bios_str.cstr()); | |
| 180 | } | |
| 181 | ||
| 156 | ||
| 182 | 157 | int input = 0, input_mj = 0, input_hana = 0, input_gamble = 0, input_analog = 0, input_adjust = 0; |
| 183 | int | |
| 158 | int dips = 0, confs = 0; | |
| 184 | 159 | astring errors, dips_opt, confs_opt; |
| 185 | 160 | ioport_list portlist; |
| 186 | 161 | device_iterator iptiter(*dev); |
| r243192 | r243193 | |
| 201 | 176 | input_analog++; |
| 202 | 177 | else if (field->type() == IPT_ADJUSTER) |
| 203 | 178 | input_adjust++; |
| 204 | else if (field->type() == IPT_KEYPAD) | |
| 205 | input_keypad++; | |
| 206 | else if (field->type() == IPT_KEYBOARD) | |
| 207 | input_keyboard++; | |
| 208 | 179 | else if (field->type() >= IPT_START1 && field->type() < IPT_UI_FIRST) |
| 209 | 180 | input++; |
| 210 | 181 | else if (field->type() == IPT_DIPSWITCH) |
| r243192 | r243193 | |
| 239 | 210 | string.cat("* Dispwitch settings:\n").cat(dips_opt); |
| 240 | 211 | if (confs) |
| 241 | 212 | string.cat("* Configuration settings:\n").cat(confs_opt); |
| 242 | if (input + input_mj + input_hana + input_gamble + input_analog + input_adjust | |
| 213 | if (input + input_mj + input_hana + input_gamble + input_analog + input_adjust) | |
| 243 | 214 | string.cat("* Input device(s):\n"); |
| 244 | 215 | if (input) |
| 245 | string.catprintf(" | |
| 216 | string.catprintf(" Player inputs [%d inputs]\n", input); | |
| 246 | 217 | if (input_mj) |
| 247 | 218 | string.catprintf(" Mahjong inputs [%d inputs]\n", input_mj); |
| 248 | 219 | if (input_hana) |
| r243192 | r243193 | |
| 253 | 224 | string.catprintf(" Analog inputs [%d inputs]\n", input_analog); |
| 254 | 225 | if (input_adjust) |
| 255 | 226 | string.catprintf(" Adjuster inputs [%d inputs]\n", input_adjust); |
| 256 | if (input_keypad) | |
| 257 | string.catprintf(" Keypad inputs [%d inputs]\n", input_keypad); | |
| 258 | if (input_keyboard) | |
| 259 | string.catprintf(" Keyboard inputs [%d inputs]\n", input_keyboard); | |
| 260 | 227 | |
| 261 | 228 | image_interface_iterator imgiter(*dev); |
| 262 | 229 | if (imgiter.count() > 0) |
| r243192 | r243193 | |
| 265 | 232 | for (const device_image_interface *imagedev = imgiter.first(); imagedev != NULL; imagedev = imgiter.next()) |
| 266 | 233 | string.catprintf(" %s [tag: %s]\n", imagedev->image_type_name(), imagedev->device().tag()); |
| 267 | 234 | } |
| 268 | ||
| 235 | ||
| 269 | 236 | slot_interface_iterator slotiter(*dev); |
| 270 | 237 | if (slotiter.count() > 0) |
| 271 | 238 | { |
| r243192 | r243193 | |
| 274 | 241 | string.catprintf(" %s [default: %s]\n", slot->device().tag(), slot->default_option() ? slot->default_option() : "----"); |
| 275 | 242 | } |
| 276 | 243 | |
| 277 | if ((execiter.count() + scriter.count() + snditer.count() + imgiter.count() + slotiter.count() + bios + dips + confs | |
| 278 | + input + input_mj + input_hana + input_gamble + input_analog + input_adjust + input_keypad + input_keyboard) == 0) | |
| 244 | if ((execiter.count() + scriter.count() + snditer.count() + imgiter.count() + slotiter.count() + input + input_mj + input_hana + input_gamble + input_analog + input_adjust) == 0) | |
| 279 | 245 | string.cat("[None]\n"); |
| 280 | 246 | |
| 281 | 247 | const_cast<machine_config &>(machine().config()).device_remove(&machine().config().root_device(), m_option->name()); |
| r243192 | r243193 | |
|---|---|---|
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | |
| 3 | 3 | ui/devopt.h |
| 4 | ||
| 4 | ||
| 5 | 5 | Internal menu for the device configuration. |
| 6 | ||
| 6 | ||
| 7 | 7 | Copyright Nicola Salmoria and the MAME Team. |
| 8 | 8 | Visit http://mamedev.org for licensing and usage restrictions. |
| 9 | 9 |
| r243192 | r243193 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | TODO |
| 8 | 8 | - Restrict directory listing by file extension |
| 9 | - Support file manager invocation from the main menu for | |
| 10 | required images | |
| 9 | 11 | |
| 10 | 12 | *********************************************************************/ |
| 11 | 13 | |
| 14 | #include <stdio.h> | |
| 15 | #include <ctype.h> | |
| 16 | #include <stdlib.h> | |
| 17 | ||
| 12 | 18 | #include "emu.h" |
| 13 | 19 | #include "ui/ui.h" |
| 14 | 20 | #include "ui/swlist.h" |
| 15 | 21 | #include "ui/filemngr.h" |
| 16 | 22 | #include "ui/filesel.h" |
| 17 | #include "ui/miscmenu.h" | |
| 18 | 23 | |
| 19 | 24 | |
| 20 | 25 | /*************************************************************************** |
| r243192 | r243193 | |
| 25 | 30 | // ctor |
| 26 | 31 | //------------------------------------------------- |
| 27 | 32 | |
| 28 | ui_menu_file_manager::ui_menu_file_manager(running_machine &machine, render_container *container | |
| 33 | ui_menu_file_manager::ui_menu_file_manager(running_machine &machine, render_container *container) : ui_menu(machine, container) | |
| 29 | 34 | { |
| 30 | // This warning string is used when accessing from the force_file_manager call, i.e. | |
| 31 | // when the file manager is loaded top front in the case of mandatory image devices | |
| 32 | if (warnings) | |
| 33 | m_warnings.cpy(warnings); | |
| 34 | else | |
| 35 | m_warnings.reset(); | |
| 36 | 35 | } |
| 37 | 36 | |
| 38 | 37 | |
| r243192 | r243193 | |
| 64 | 63 | { |
| 65 | 64 | // get the image type/id |
| 66 | 65 | instance.printf("%s (%s)", img->instance_name(), img->brief_instance_name()); |
| 67 | ||
| 66 | ||
| 68 | 67 | // get the base name |
| 69 | 68 | if (img->basename() != NULL) |
| 70 | 69 | { |
| 71 | 70 | filename.cpy(img->basename()); |
| 72 | ||
| 71 | ||
| 73 | 72 | // if the image has been loaded through softlist, also show the loaded part |
| 74 | 73 | if (img->part_entry() != NULL) |
| 75 | 74 | { |
| r243192 | r243193 | |
| 102 | 101 | bool first_entry = true; |
| 103 | 102 | astring prev_owner; |
| 104 | 103 | |
| 105 | if (m_warnings) | |
| 106 | { | |
| 107 | item_append(m_warnings, NULL, MENU_FLAG_DISABLE, NULL); | |
| 108 | item_append("", NULL, MENU_FLAG_DISABLE, NULL); | |
| 109 | } | |
| 110 | ||
| 111 | 104 | // cycle through all devices for this system |
| 112 | 105 | device_iterator iter(machine().root_device()); |
| 113 | 106 | tagmap_t<UINT8> devtags; |
| r243192 | r243193 | |
| 120 | 113 | // check whether it owns an image interface |
| 121 | 114 | image_interface_iterator subiter(*dev); |
| 122 | 115 | if (subiter.count() > 0) |
| 123 | { | |
| 116 | { | |
| 124 | 117 | // if so, cycle through all its image interfaces |
| 125 | 118 | image_interface_iterator subiter(*dev); |
| 126 | 119 | for (device_image_interface *scan = subiter.first(); scan != NULL; scan = subiter.next()) |
| r243192 | r243193 | |
| 172 | 165 | if (selected_device != NULL) |
| 173 | 166 | { |
| 174 | 167 | ui_menu::stack_push(selected_device->get_selection_menu(machine(), container)); |
| 175 | ||
| 168 | ||
| 176 | 169 | // reset the existing menu |
| 177 | 170 | reset(UI_MENU_RESET_REMEMBER_POSITION); |
| 178 | 171 | } |
| 179 | 172 | } |
| 180 | 173 | } |
| 181 | 174 | } |
| 182 | ||
| 183 | // force file manager menu | |
| 184 | void ui_menu_file_manager::force_file_manager(running_machine &machine, render_container *container, const char *warnings) | |
| 185 | { | |
| 186 | // reset the menu stack | |
| 187 | ui_menu::stack_reset(machine); | |
| 188 | ||
| 189 | // add the quit entry followed by the game select entry | |
| 190 | ui_menu *quit = auto_alloc_clear(machine, ui_menu_quit_game(machine, container)); | |
| 191 | quit->set_special_main_menu(true); | |
| 192 | ui_menu::stack_push(quit); | |
| 193 | ui_menu::stack_push(auto_alloc_clear(machine, ui_menu_file_manager(machine, container, warnings))); | |
| 194 | ||
| 195 | // force the menus on | |
| 196 | machine.ui().show_menu(); | |
| 197 | ||
| 198 | // make sure MAME is paused | |
| 199 | machine.pause(); | |
| 200 | } |
| r243192 | r243193 | |
|---|---|---|
| 20 | 20 | astring current_file; |
| 21 | 21 | device_image_interface *selected_device; |
| 22 | 22 | |
| 23 | static void force_file_manager(running_machine &machine, render_container *container, const char *warnings); | |
| 24 | ||
| 25 | ui_menu_file_manager(running_machine &machine, render_container *container, const char *warnings); | |
| 23 | ui_menu_file_manager(running_machine &machine, render_container *container); | |
| 26 | 24 | virtual ~ui_menu_file_manager(); |
| 27 | 25 | virtual void populate(); |
| 28 | 26 | virtual void handle(); |
| 29 | 27 | virtual void custom_render(void *selectedref, float top, float bottom, float x, float y, float x2, float y2); |
| 30 | 28 | |
| 31 | 29 | void fill_image_line(device_image_interface *img, astring &instance, astring &filename); |
| 32 | ||
| 33 | private: | |
| 34 | astring m_warnings; | |
| 35 | 30 | }; |
| 36 | 31 | |
| 37 | 32 | #endif /* __UI_FILEMNGR_H__ */ |
| r243192 | r243193 | |
|---|---|---|
| 16 | 16 | #include "ui/filesel.h" |
| 17 | 17 | #include "ui/swlist.h" |
| 18 | 18 | #include "zippath.h" |
| 19 | #include "audit.h" | |
| 20 | 19 | |
| 21 | 20 | |
| 22 | 21 | /*************************************************************************** |
| r243192 | r243193 | |
| 133 | 132 | void ui_menu_control_device_image::load_software_part() |
| 134 | 133 | { |
| 135 | 134 | astring temp_name(sld->list_name(), ":", swi->shortname(), ":", swp->name()); |
| 136 | ||
| 137 | driver_enumerator drivlist(machine().options(), machine().options().system_name()); | |
| 138 | media_auditor auditor(drivlist); | |
| 139 | media_auditor::summary summary = auditor.audit_software(sld->list_name(), (software_info *)swi, AUDIT_VALIDATE_FAST); | |
| 140 | // if everything looks good, load software | |
| 141 | if (summary == media_auditor::CORRECT || summary == media_auditor::BEST_AVAILABLE || summary == media_auditor::NONE_NEEDED) | |
| 142 | hook_load(temp_name, true); | |
| 143 | else | |
| 144 | { | |
| 145 | popmessage("The selected game is missing one or more required ROM or CHD images. Please select a different game."); | |
| 146 | state = SELECT_SOFTLIST; | |
| 147 | } | |
| 135 | hook_load(temp_name, true); | |
| 148 | 136 | } |
| 149 | 137 | |
| 150 | 138 | |
| r243192 | r243193 | |
| 229 | 217 | { |
| 230 | 218 | swp = swi->first_part(); |
| 231 | 219 | load_software_part(); |
| 220 | ui_menu::stack_pop(machine()); | |
| 232 | 221 | } |
| 233 | 222 | break; |
| 234 | 223 | |
| r243192 | r243193 | |
| 236 | 225 | switch(submenu_result) { |
| 237 | 226 | case ui_menu_software_parts::T_ENTRY: { |
| 238 | 227 | load_software_part(); |
| 228 | ui_menu::stack_pop(machine()); | |
| 239 | 229 | break; |
| 240 | 230 | } |
| 241 | 231 | |
| r243192 | r243193 | |
| 328 | 318 | state = create_ok ? CREATE_FILE : START_FILE; |
| 329 | 319 | handle(); |
| 330 | 320 | break; |
| 331 | ||
| 321 | ||
| 332 | 322 | case DO_CREATE: { |
| 333 | 323 | astring path; |
| 334 | 324 | zippath_combine(path, current_directory, current_file); |
| r243192 | r243193 | |
|---|---|---|
| 14 | 14 | #ifndef __UI_IMGCNTRL_H__ |
| 15 | 15 | #define __UI_IMGCNTRL_H__ |
| 16 | 16 | |
| 17 | #include "drivenum.h" | |
| 18 | ||
| 19 | 17 | // ======================> ui_menu_control_device_image |
| 20 | 18 | |
| 21 | 19 | class ui_menu_control_device_image : public ui_menu { |
| r243192 | r243193 | |
| 27 | 25 | |
| 28 | 26 | protected: |
| 29 | 27 | enum { |
| 30 | START_FILE, START_OTHER_PART, START_SOFTLIST, | |
| 31 | SELECT_PARTLIST, SELECT_ONE_PART, SELECT_OTHER_PART, | |
| 28 | START_FILE, START_OTHER_PART, START_SOFTLIST, | |
| 29 | SELECT_PARTLIST, SELECT_ONE_PART, SELECT_OTHER_PART, | |
| 32 | 30 | SELECT_FILE, CREATE_FILE, CREATE_CONFIRM, CHECK_CREATE, DO_CREATE, SELECT_SOFTLIST, |
| 33 | 31 | LAST_ID |
| 34 | 32 | }; |
| r0 | r243193 | |
|---|---|---|
| 1 | /*************************************************************************** | |
| 2 | ||
| 3 | ui/imginfo.c | |
| 4 | ||
| 5 | Image info screen | |
| 6 | ||
| 7 | Copyright Nicola Salmoria and the MAME Team. | |
| 8 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 9 | ||
| 10 | ***************************************************************************/ | |
| 11 | ||
| 12 | #include "emu.h" | |
| 13 | #include "ui/menu.h" | |
| 14 | #include "ui/imginfo.h" | |
| 15 | ||
| 16 | ||
| 17 | /*************************************************************************** | |
| 18 | IMPLEMENTATION | |
| 19 | ***************************************************************************/ | |
| 20 | ||
| 21 | //------------------------------------------------- | |
| 22 | // ctor | |
| 23 | //------------------------------------------------- | |
| 24 | ||
| 25 | ui_menu_image_info::ui_menu_image_info(running_machine &machine, render_container *container) : ui_menu(machine, container) | |
| 26 | { | |
| 27 | } | |
| 28 | ||
| 29 | ||
| 30 | //------------------------------------------------- | |
| 31 | // dtor | |
| 32 | //------------------------------------------------- | |
| 33 | ||
| 34 | ui_menu_image_info::~ui_menu_image_info() | |
| 35 | { | |
| 36 | } | |
| 37 | ||
| 38 | ||
| 39 | //------------------------------------------------- | |
| 40 | // populate | |
| 41 | //------------------------------------------------- | |
| 42 | ||
| 43 | void ui_menu_image_info::populate() | |
| 44 | { | |
| 45 | item_append(machine().system().description, NULL, MENU_FLAG_DISABLE, NULL); | |
| 46 | item_append("", NULL, MENU_FLAG_DISABLE, NULL); | |
| 47 | ||
| 48 | image_interface_iterator iter(machine().root_device()); | |
| 49 | for (device_image_interface *image = iter.first(); image != NULL; image = iter.next()) | |
| 50 | image_info(image); | |
| 51 | } | |
| 52 | ||
| 53 | ||
| 54 | //------------------------------------------------- | |
| 55 | // handle | |
| 56 | //------------------------------------------------- | |
| 57 | ||
| 58 | void ui_menu_image_info::handle() | |
| 59 | { | |
| 60 | // process the menu | |
| 61 | process(0); | |
| 62 | } | |
| 63 | ||
| 64 | ||
| 65 | //------------------------------------------------- | |
| 66 | // image_info - display image info for a specific | |
| 67 | // image interface device | |
| 68 | //------------------------------------------------- | |
| 69 | ||
| 70 | void ui_menu_image_info::image_info(device_image_interface *image) | |
| 71 | { | |
| 72 | if (image->exists()) | |
| 73 | { | |
| 74 | // display device type and filename | |
| 75 | item_append(image->brief_instance_name(), image->basename(), 0, NULL); | |
| 76 | ||
| 77 | // if image has been loaded through softlist, let's add some more info | |
| 78 | if (image->software_entry()) | |
| 79 | { | |
| 80 | astring string; | |
| 81 | ||
| 82 | // display long filename | |
| 83 | item_append(image->longname(), "", MENU_FLAG_DISABLE, NULL); | |
| 84 | ||
| 85 | // display manufacturer and year | |
| 86 | string.catprintf("%s, %s", image->manufacturer(), image->year()); | |
| 87 | item_append(string, "", MENU_FLAG_DISABLE, NULL); | |
| 88 | ||
| 89 | // display supported information, if available | |
| 90 | switch (image->supported()) | |
| 91 | { | |
| 92 | case SOFTWARE_SUPPORTED_NO: | |
| 93 | item_append("Not supported", "", MENU_FLAG_DISABLE, NULL); | |
| 94 | break; | |
| 95 | case SOFTWARE_SUPPORTED_PARTIAL: | |
| 96 | item_append("Partially supported", "", MENU_FLAG_DISABLE, NULL); | |
| 97 | break; | |
| 98 | default: | |
| 99 | break; | |
| 100 | } | |
| 101 | } | |
| 102 | } | |
| 103 | else | |
| 104 | item_append(image->brief_instance_name(), "[empty]", 0, NULL); | |
| 105 | item_append("", NULL, MENU_FLAG_DISABLE, NULL); | |
| 106 | } |
| r0 | r243193 | |
|---|---|---|
| 1 | /*************************************************************************** | |
| 2 | ||
| 3 | ui/imginfo.h | |
| 4 | ||
| 5 | Image info screen | |
| 6 | ||
| 7 | Copyright Nicola Salmoria and the MAME Team. | |
| 8 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 9 | ||
| 10 | ***************************************************************************/ | |
| 11 | ||
| 12 | #pragma once | |
| 13 | ||
| 14 | #ifndef __UI_IMGINFO_H__ | |
| 15 | #define __UI_IMGINFO_H__ | |
| 16 | ||
| 17 | class ui_menu_image_info : public ui_menu | |
| 18 | { | |
| 19 | public: | |
| 20 | ui_menu_image_info(running_machine &machine, render_container *container); | |
| 21 | virtual ~ui_menu_image_info(); | |
| 22 | virtual void populate(); | |
| 23 | virtual void handle(); | |
| 24 | ||
| 25 | private: | |
| 26 | void image_info(device_image_interface *image); | |
| 27 | }; | |
| 28 | ||
| 29 | #endif // __UI_IMGINFO_H__ |
| r243192 | r243193 | |
|---|---|---|
| 1 | /*************************************************************************** | |
| 2 | ||
| 3 | ui/info.c | |
| 4 | ||
| 5 | System and image info screens | |
| 6 | ||
| 7 | Copyright Nicola Salmoria and the MAME Team. | |
| 8 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 9 | ||
| 10 | ***************************************************************************/ | |
| 11 | ||
| 12 | #include "emu.h" | |
| 13 | #include "ui/menu.h" | |
| 14 | #include "ui/info.h" | |
| 15 | #include "ui/ui.h" | |
| 16 | ||
| 17 | /*------------------------------------------------- | |
| 18 | menu_game_info - handle the game information | |
| 19 | menu | |
| 20 | -------------------------------------------------*/ | |
| 21 | ||
| 22 | ui_menu_game_info::ui_menu_game_info(running_machine &machine, render_container *container) : ui_menu(machine, container) | |
| 23 | { | |
| 24 | } | |
| 25 | ||
| 26 | ui_menu_game_info::~ui_menu_game_info() | |
| 27 | { | |
| 28 | } | |
| 29 | ||
| 30 | void ui_menu_game_info::populate() | |
| 31 | { | |
| 32 | astring tempstring; | |
| 33 | item_append(machine().ui().game_info_astring(tempstring), NULL, MENU_FLAG_MULTILINE, NULL); | |
| 34 | } | |
| 35 | ||
| 36 | void ui_menu_game_info::handle() | |
| 37 | { | |
| 38 | // process the menu | |
| 39 | process(0); | |
| 40 | } | |
| 41 | ||
| 42 | ||
| 43 | /*------------------------------------------------- | |
| 44 | ui_menu_image_info - handle the image information | |
| 45 | menu | |
| 46 | -------------------------------------------------*/ | |
| 47 | ||
| 48 | ui_menu_image_info::ui_menu_image_info(running_machine &machine, render_container *container) : ui_menu(machine, container) | |
| 49 | { | |
| 50 | } | |
| 51 | ||
| 52 | ui_menu_image_info::~ui_menu_image_info() | |
| 53 | { | |
| 54 | } | |
| 55 | ||
| 56 | void ui_menu_image_info::populate() | |
| 57 | { | |
| 58 | item_append(machine().system().description, NULL, MENU_FLAG_DISABLE, NULL); | |
| 59 | item_append("", NULL, MENU_FLAG_DISABLE, NULL); | |
| 60 | ||
| 61 | image_interface_iterator iter(machine().root_device()); | |
| 62 | for (device_image_interface *image = iter.first(); image != NULL; image = iter.next()) | |
| 63 | image_info(image); | |
| 64 | } | |
| 65 | ||
| 66 | void ui_menu_image_info::handle() | |
| 67 | { | |
| 68 | // process the menu | |
| 69 | process(0); | |
| 70 | } | |
| 71 | ||
| 72 | ||
| 73 | /*------------------------------------------------- | |
| 74 | image_info - display image info for a specific | |
| 75 | image interface device | |
| 76 | -------------------------------------------------*/ | |
| 77 | ||
| 78 | void ui_menu_image_info::image_info(device_image_interface *image) | |
| 79 | { | |
| 80 | if (image->exists()) | |
| 81 | { | |
| 82 | // display device type and filename | |
| 83 | item_append(image->brief_instance_name(), image->basename(), 0, NULL); | |
| 84 | ||
| 85 | // if image has been loaded through softlist, let's add some more info | |
| 86 | if (image->software_entry()) | |
| 87 | { | |
| 88 | astring string; | |
| 89 | ||
| 90 | // display long filename | |
| 91 | item_append(image->longname(), "", MENU_FLAG_DISABLE, NULL); | |
| 92 | ||
| 93 | // display manufacturer and year | |
| 94 | string.catprintf("%s, %s", image->manufacturer(), image->year()); | |
| 95 | item_append(string, "", MENU_FLAG_DISABLE, NULL); | |
| 96 | ||
| 97 | // display supported information, if available | |
| 98 | switch (image->supported()) | |
| 99 | { | |
| 100 | case SOFTWARE_SUPPORTED_NO: | |
| 101 | item_append("Not supported", "", MENU_FLAG_DISABLE, NULL); | |
| 102 | break; | |
| 103 | case SOFTWARE_SUPPORTED_PARTIAL: | |
| 104 | item_append("Partially supported", "", MENU_FLAG_DISABLE, NULL); | |
| 105 | break; | |
| 106 | default: | |
| 107 | break; | |
| 108 | } | |
| 109 | } | |
| 110 | } | |
| 111 | else | |
| 112 | item_append(image->brief_instance_name(), "[empty]", 0, NULL); | |
| 113 | item_append("", NULL, MENU_FLAG_DISABLE, NULL); | |
| 114 | } |
| r243192 | r243193 | |
|---|---|---|
| 1 | /*************************************************************************** | |
| 2 | ||
| 3 | ui/info.h | |
| 4 | ||
| 5 | System and image info screens | |
| 6 | ||
| 7 | Copyright Nicola Salmoria and the MAME Team. | |
| 8 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 9 | ||
| 10 | ***************************************************************************/ | |
| 11 | ||
| 12 | #pragma once | |
| 13 | ||
| 14 | #ifndef __UI_INFO_H__ | |
| 15 | #define __UI_INFO_H__ | |
| 16 | ||
| 17 | class ui_menu_game_info : public ui_menu { | |
| 18 | public: | |
| 19 | ui_menu_game_info(running_machine &machine, render_container *container); | |
| 20 | virtual ~ui_menu_game_info(); | |
| 21 | virtual void populate(); | |
| 22 | virtual void handle(); | |
| 23 | }; | |
| 24 | ||
| 25 | ||
| 26 | class ui_menu_image_info : public ui_menu | |
| 27 | { | |
| 28 | public: | |
| 29 | ui_menu_image_info(running_machine &machine, render_container *container); | |
| 30 | virtual ~ui_menu_image_info(); | |
| 31 | virtual void populate(); | |
| 32 | virtual void handle(); | |
| 33 | ||
| 34 | private: | |
| 35 | void image_info(device_image_interface *image); | |
| 36 | }; | |
| 37 | ||
| 38 | #endif // __UI_INFO_H__ |
| r243192 | r243193 | |
|---|---|---|
| 154 | 154 | void ui_menu_input_specific::populate() |
| 155 | 155 | { |
| 156 | 156 | input_item_data *itemlist = NULL; |
| 157 | ioport_field *field; | |
| 158 | ioport_port *port; | |
| 157 | 159 | int suborder[SEQ_TYPE_TOTAL]; |
| 158 | 160 | astring tempstring; |
| 159 | int port_count = 0; | |
| 160 | 161 | |
| 161 | 162 | /* create a mini lookup table for sort order based on sequence type */ |
| 162 | 163 | suborder[SEQ_TYPE_STANDARD] = 0; |
| r243192 | r243193 | |
| 164 | 165 | suborder[SEQ_TYPE_INCREMENT] = 2; |
| 165 | 166 | |
| 166 | 167 | /* iterate over the input ports and add menu items */ |
| 167 | for (ioport_port *port = machine().ioport().first_port(); port != NULL; port = port->next()) | |
| 168 | { | |
| 169 | port_count++; | |
| 170 | for (ioport_field *field = port->first_field(); field != NULL; field = field->next()) | |
| 168 | for (port = machine().ioport().first_port(); port != NULL; port = port->next()) | |
| 169 | for (field = port->first_field(); field != NULL; field = field->next()) | |
| 171 | 170 | { |
| 172 | 171 | const char *name = field->name(); |
| 173 | 172 | |
| r243192 | r243193 | |
| 183 | 182 | { |
| 184 | 183 | sortorder = (field->type() << 2) | (field->player() << 12); |
| 185 | 184 | if (strcmp(field->device().tag(), ":")) |
| 186 | sortorder |= | |
| 185 | sortorder |= 0x10000; | |
| 187 | 186 | } |
| 188 | 187 | else |
| 189 | 188 | sortorder = field->type() | 0xf000; |
| r243192 | r243193 | |
| 213 | 212 | } |
| 214 | 213 | } |
| 215 | 214 | } |
| 216 | } | |
| 217 | 215 | |
| 218 | 216 | /* sort and populate the menu in a standard fashion */ |
| 219 | 217 | populate_and_sort(itemlist); |
| r243192 | r243193 | |
| 487 | 485 | if (menu_event != NULL && menu_event->itemref != NULL) |
| 488 | 486 | { |
| 489 | 487 | // reset |
| 490 | if ((FPTR)menu_event->itemref == 1) | |
| 488 | if ((FPTR)menu_event->itemref == 1) | |
| 491 | 489 | { |
| 492 | 490 | if (menu_event->iptkey == IPT_UI_SELECT) |
| 493 | 491 | machine().schedule_hard_reset(); |
| r243192 | r243193 | |
| 498 | 496 | ioport_field *field = (ioport_field *)menu_event->itemref; |
| 499 | 497 | ioport_field::user_settings settings; |
| 500 | 498 | int changed = false; |
| 501 | ||
| 499 | ||
| 502 | 500 | switch (menu_event->iptkey) |
| 503 | 501 | { |
| 504 | 502 | /* if selected, reset to default value */ |
| r243192 | r243193 | |
| 508 | 506 | field->set_user_settings(settings); |
| 509 | 507 | changed = true; |
| 510 | 508 | break; |
| 511 | ||
| 509 | ||
| 512 | 510 | /* left goes to previous setting */ |
| 513 | 511 | case IPT_UI_LEFT: |
| 514 | 512 | field->select_previous_setting(); |
| 515 | 513 | changed = true; |
| 516 | 514 | break; |
| 517 | ||
| 515 | ||
| 518 | 516 | /* right goes to next setting */ |
| 519 | 517 | case IPT_UI_RIGHT: |
| 520 | 518 | field->select_next_setting(); |
| 521 | 519 | changed = true; |
| 522 | 520 | break; |
| 523 | 521 | } |
| 524 | ||
| 522 | ||
| 525 | 523 | /* if anything changed, rebuild the menu, trying to stay on the same field */ |
| 526 | 524 | if (changed) |
| 527 | 525 | reset(UI_MENU_RESET_REMEMBER_REF); |
| r243192 | r243193 | |
| 628 | 626 | } |
| 629 | 627 | if (type == IPT_DIPSWITCH) |
| 630 | 628 | custombottom = dipcount ? dipcount * (DIP_SWITCH_HEIGHT + DIP_SWITCH_SPACING) + DIP_SWITCH_SPACING : 0; |
| 631 | ||
| 629 | ||
| 632 | 630 | item_append(MENU_SEPARATOR_ITEM, NULL, 0, NULL); |
| 633 | 631 | item_append("Reset", NULL, 0, (void *)1); |
| 634 | 632 | } |
| r243192 | r243193 | |
| 661 | 659 | { |
| 662 | 660 | const ioport_diplocation *diploc; |
| 663 | 661 | UINT32 selectedmask = 0; |
| 664 | ||
| 662 | ||
| 665 | 663 | // determine the mask of selected bits |
| 666 | 664 | if ((FPTR)selectedref != 1) |
| 667 | 665 | { |
| 668 | 666 | ioport_field *field = (ioport_field *)selectedref; |
| 669 | ||
| 667 | ||
| 670 | 668 | if (field != NULL && field->first_diplocation() != NULL) |
| 671 | 669 | for (diploc = field->first_diplocation(); diploc != NULL; diploc = diploc->next()) |
| 672 | 670 | if (strcmp(dip->name, diploc->name()) == 0) |
| 673 | 671 | selectedmask |= 1 << (diploc->number() - 1); |
| 674 | 672 | } |
| 675 | ||
| 673 | ||
| 676 | 674 | // draw one switch |
| 677 | 675 | custom_render_one(x1, y1, x2, y1 + DIP_SWITCH_HEIGHT, dip, selectedmask); |
| 678 | 676 | y1 += (float)(DIP_SWITCH_SPACING + DIP_SWITCH_HEIGHT); |
| r243192 | r243193 | |
| 884 | 882 | } |
| 885 | 883 | |
| 886 | 884 | name.cpy(field->name()); |
| 887 | ||
| 885 | ||
| 888 | 886 | /* allocate a data item for tracking what this menu item refers to */ |
| 889 | 887 | data = (analog_item_data *)m_pool_alloc(sizeof(*data)); |
| 890 | 888 | data->field = field; |
| r243192 | r243193 | |
|---|---|---|
| 10 | 10 | *********************************************************************/ |
| 11 | 11 | |
| 12 | 12 | #include "emu.h" |
| 13 | #include "audit.h" | |
| 14 | #include "crsshair.h" | |
| 15 | 13 | #include "osdnet.h" |
| 16 | 14 | #include "emuopts.h" |
| 15 | #include "ui/ui.h" | |
| 17 | 16 | #include "rendutil.h" |
| 18 | 17 | #include "cheat.h" |
| 19 | 18 | #include "uiinput.h" |
| 20 | #include "ui/ui.h" | |
| 21 | 19 | #include "ui/filemngr.h" |
| 22 | 20 | #include "ui/filesel.h" |
| 23 | 21 | #include "ui/barcode.h" |
| 24 | #include "ui/cheatopt.h" | |
| 25 | #include "ui/info.h" | |
| 22 | #include "ui/imginfo.h" | |
| 26 | 23 | #include "ui/inputmap.h" |
| 27 | 24 | #include "ui/mainmenu.h" |
| 28 | 25 | #include "ui/miscmenu.h" |
| 29 | 26 | #include "ui/selgame.h" |
| 30 | #include "ui/sliders.h" | |
| 31 | 27 | #include "ui/slotopt.h" |
| 32 | 28 | #include "ui/tapectrl.h" |
| 33 | #include "ui/videoopt.h" | |
| 29 | #include "audit.h" | |
| 30 | #include "crsshair.h" | |
| 31 | #include <ctype.h> | |
| 34 | 32 | #include "imagedev/cassette.h" |
| 35 | 33 | #include "imagedev/bitbngr.h" |
| 36 | 34 | #include "machine/bcreader.h" |
| r243192 | r243193 | |
| 185 | 183 | break; |
| 186 | 184 | |
| 187 | 185 | case IMAGE_MENU_FILE_MANAGER: |
| 188 | ui_menu::stack_push(auto_alloc_clear(machine(), ui_menu_file_manager(machine(), container | |
| 186 | ui_menu::stack_push(auto_alloc_clear(machine(), ui_menu_file_manager(machine(), container))); | |
| 189 | 187 | break; |
| 190 | 188 | |
| 191 | 189 | case TAPE_CONTROL: |
| r243192 | r243193 | |
|---|---|---|
| 14 | 14 | #ifndef __UI_MAINMENU_H__ |
| 15 | 15 | #define __UI_MAINMENU_H__ |
| 16 | 16 | |
| 17 | #include "crsshair.h" | |
| 17 | 18 | #include "drivenum.h" |
| 18 | 19 | |
| 19 | 20 | class ui_menu_main : public ui_menu { |
| r243192 | r243193 | |
|---|---|---|
| 11 | 11 | |
| 12 | 12 | #include "emu.h" |
| 13 | 13 | #include "emuopts.h" |
| 14 | #include "ui/ui.h" | |
| 14 | 15 | #include "rendutil.h" |
| 16 | #include "uiinput.h" | |
| 15 | 17 | #include "cheat.h" |
| 16 | #include "uiinput.h" | |
| 17 | #include "ui/ui.h" | |
| 18 | 18 | #include "ui/mainmenu.h" |
| 19 | #include "ui/cheatopt.h" | |
| 19 | #include "ui/miscmenu.h" | |
| 20 | #include <ctype.h> | |
| 20 | 21 | |
| 21 | 22 | |
| 22 | 23 |
| r243192 | r243193 | |
|---|---|---|
| 9 | 9 | |
| 10 | 10 | *********************************************************************/ |
| 11 | 11 | |
| 12 | #include <ctype.h> | |
| 13 | ||
| 12 | 14 | #include "emu.h" |
| 15 | #include "emuopts.h" | |
| 16 | ||
| 17 | #include "cheat.h" | |
| 13 | 18 | #include "osdnet.h" |
| 19 | #include "rendutil.h" | |
| 14 | 20 | |
| 15 | 21 | #include "uiinput.h" |
| 16 | 22 | #include "ui/ui.h" |
| 17 | 23 | #include "ui/miscmenu.h" |
| 18 | 24 | #include "ui/filemngr.h" |
| 19 | 25 | |
| 26 | #include "osdepend.h" | |
| 20 | 27 | |
| 28 | /*------------------------------------------------- | |
| 29 | ui_slider_ui_handler - pushes the slider | |
| 30 | menu on the stack and hands off to the | |
| 31 | standard menu handler | |
| 32 | -------------------------------------------------*/ | |
| 33 | ||
| 34 | UINT32 ui_menu_sliders::ui_handler(running_machine &machine, render_container *container, UINT32 state) | |
| 35 | { | |
| 36 | UINT32 result; | |
| 37 | ||
| 38 | /* if this is the first call, push the sliders menu */ | |
| 39 | if (state) | |
| 40 | ui_menu::stack_push(auto_alloc_clear(machine, ui_menu_sliders(machine, container, true))); | |
| 41 | ||
| 42 | /* handle standard menus */ | |
| 43 | result = ui_menu::ui_handler(machine, container, state); | |
| 44 | ||
| 45 | /* if we are cancelled, pop the sliders menu */ | |
| 46 | if (result == UI_HANDLER_CANCEL) | |
| 47 | ui_menu::stack_pop(machine); | |
| 48 | ||
| 49 | ui_menu_sliders *uim = dynamic_cast<ui_menu_sliders *>(menu_stack); | |
| 50 | return uim && uim->menuless_mode ? 0 : UI_HANDLER_CANCEL; | |
| 51 | } | |
| 52 | ||
| 53 | ||
| 21 | 54 | /*************************************************************************** |
| 22 | 55 | MENU HANDLERS |
| 23 | 56 | ***************************************************************************/ |
| r243192 | r243193 | |
| 270 | 303 | item_append(tempstring, NULL, MENU_FLAG_MULTILINE, NULL); |
| 271 | 304 | } |
| 272 | 305 | |
| 306 | ||
| 273 | 307 | /*------------------------------------------------- |
| 308 | menu_game_info - handle the game information | |
| 309 | menu | |
| 310 | -------------------------------------------------*/ | |
| 311 | ||
| 312 | ui_menu_game_info::ui_menu_game_info(running_machine &machine, render_container *container) : ui_menu(machine, container) | |
| 313 | { | |
| 314 | } | |
| 315 | ||
| 316 | void ui_menu_game_info::populate() | |
| 317 | { | |
| 318 | astring tempstring; | |
| 319 | item_append(machine().ui().game_info_astring(tempstring), NULL, MENU_FLAG_MULTILINE, NULL); | |
| 320 | } | |
| 321 | ||
| 322 | void ui_menu_game_info::handle() | |
| 323 | { | |
| 324 | /* process the menu */ | |
| 325 | process(0); | |
| 326 | } | |
| 327 | ||
| 328 | ui_menu_game_info::~ui_menu_game_info() | |
| 329 | { | |
| 330 | } | |
| 331 | ||
| 332 | /*------------------------------------------------- | |
| 333 | menu_cheat - handle the cheat menu | |
| 334 | -------------------------------------------------*/ | |
| 335 | ||
| 336 | void ui_menu_cheat::handle() | |
| 337 | { | |
| 338 | /* process the menu */ | |
| 339 | const ui_menu_event *menu_event = process(UI_MENU_PROCESS_LR_REPEAT); | |
| 340 | ||
| 341 | /* handle events */ | |
| 342 | if (menu_event != NULL && menu_event->itemref != NULL) | |
| 343 | { | |
| 344 | bool changed = false; | |
| 345 | ||
| 346 | /* clear cheat comment on any movement or keypress */ | |
| 347 | popmessage(NULL); | |
| 348 | ||
| 349 | /* handle reset all + reset all cheats for reload all option */ | |
| 350 | if ((FPTR)menu_event->itemref < 3 && menu_event->iptkey == IPT_UI_SELECT) | |
| 351 | { | |
| 352 | for (cheat_entry *curcheat = machine().cheat().first(); curcheat != NULL; curcheat = curcheat->next()) | |
| 353 | if (curcheat->select_default_state()) | |
| 354 | changed = true; | |
| 355 | } | |
| 356 | ||
| 357 | ||
| 358 | /* handle individual cheats */ | |
| 359 | else if ((FPTR)menu_event->itemref > 2) | |
| 360 | { | |
| 361 | cheat_entry *curcheat = reinterpret_cast<cheat_entry *>(menu_event->itemref); | |
| 362 | const char *string; | |
| 363 | switch (menu_event->iptkey) | |
| 364 | { | |
| 365 | /* if selected, activate a oneshot */ | |
| 366 | case IPT_UI_SELECT: | |
| 367 | changed = curcheat->activate(); | |
| 368 | break; | |
| 369 | ||
| 370 | /* if cleared, reset to default value */ | |
| 371 | case IPT_UI_CLEAR: | |
| 372 | changed = curcheat->select_default_state(); | |
| 373 | break; | |
| 374 | ||
| 375 | /* left decrements */ | |
| 376 | case IPT_UI_LEFT: | |
| 377 | changed = curcheat->select_previous_state(); | |
| 378 | break; | |
| 379 | ||
| 380 | /* right increments */ | |
| 381 | case IPT_UI_RIGHT: | |
| 382 | changed = curcheat->select_next_state(); | |
| 383 | break; | |
| 384 | ||
| 385 | /* bring up display comment if one exists */ | |
| 386 | case IPT_UI_DISPLAY_COMMENT: | |
| 387 | case IPT_UI_UP: | |
| 388 | case IPT_UI_DOWN: | |
| 389 | string = curcheat->comment(); | |
| 390 | if (string != NULL && string[0] != 0) | |
| 391 | popmessage("Cheat Comment:\n%s", string); | |
| 392 | break; | |
| 393 | } | |
| 394 | } | |
| 395 | ||
| 396 | /* handle reload all */ | |
| 397 | if ((FPTR)menu_event->itemref == 2 && menu_event->iptkey == IPT_UI_SELECT) | |
| 398 | { | |
| 399 | /* re-init cheat engine and thus reload cheats/cheats have already been turned off by here */ | |
| 400 | machine().cheat().reload(); | |
| 401 | ||
| 402 | /* display the reloaded cheats */ | |
| 403 | reset(UI_MENU_RESET_REMEMBER_REF); | |
| 404 | popmessage("All cheats reloaded"); | |
| 405 | } | |
| 406 | ||
| 407 | /* if things changed, update */ | |
| 408 | if (changed) | |
| 409 | reset(UI_MENU_RESET_REMEMBER_REF); | |
| 410 | } | |
| 411 | } | |
| 412 | ||
| 413 | ||
| 414 | /*------------------------------------------------- | |
| 415 | menu_cheat_populate - populate the cheat menu | |
| 416 | -------------------------------------------------*/ | |
| 417 | ||
| 418 | ui_menu_cheat::ui_menu_cheat(running_machine &machine, render_container *container) : ui_menu(machine, container) | |
| 419 | { | |
| 420 | } | |
| 421 | ||
| 422 | void ui_menu_cheat::populate() | |
| 423 | { | |
| 424 | /* iterate over cheats */ | |
| 425 | astring text; | |
| 426 | astring subtext; | |
| 427 | for (cheat_entry *curcheat = machine().cheat().first(); curcheat != NULL; curcheat = curcheat->next()) | |
| 428 | { | |
| 429 | UINT32 flags; | |
| 430 | curcheat->menu_text(text, subtext, flags); | |
| 431 | item_append(text, subtext, flags, curcheat); | |
| 432 | } | |
| 433 | ||
| 434 | /* add a separator */ | |
| 435 | item_append(MENU_SEPARATOR_ITEM, NULL, 0, NULL); | |
| 436 | ||
| 437 | /* add a reset all option */ | |
| 438 | item_append("Reset All", NULL, 0, (void *)1); | |
| 439 | ||
| 440 | /* add a reload all cheats option */ | |
| 441 | item_append("Reload All", NULL, 0, (void *)2); | |
| 442 | } | |
| 443 | ||
| 444 | ui_menu_cheat::~ui_menu_cheat() | |
| 445 | { | |
| 446 | } | |
| 447 | ||
| 448 | /*------------------------------------------------- | |
| 449 | menu_sliders - handle the sliders menu | |
| 450 | -------------------------------------------------*/ | |
| 451 | ||
| 452 | void ui_menu_sliders::handle() | |
| 453 | { | |
| 454 | const ui_menu_event *menu_event; | |
| 455 | ||
| 456 | /* process the menu */ | |
| 457 | menu_event = process(UI_MENU_PROCESS_LR_REPEAT | (hidden ? UI_MENU_PROCESS_CUSTOM_ONLY : 0)); | |
| 458 | if (menu_event != NULL) | |
| 459 | { | |
| 460 | /* handle keys if there is a valid item selected */ | |
| 461 | if (menu_event->itemref != NULL) | |
| 462 | { | |
| 463 | const slider_state *slider = (const slider_state *)menu_event->itemref; | |
| 464 | INT32 curvalue = (*slider->update)(machine(), slider->arg, NULL, SLIDER_NOCHANGE); | |
| 465 | INT32 increment = 0; | |
| 466 | ||
| 467 | switch (menu_event->iptkey) | |
| 468 | { | |
| 469 | /* toggle visibility */ | |
| 470 | case IPT_UI_ON_SCREEN_DISPLAY: | |
| 471 | if (menuless_mode) | |
| 472 | ui_menu::stack_pop(machine()); | |
| 473 | else | |
| 474 | hidden = !hidden; | |
| 475 | break; | |
| 476 | ||
| 477 | /* decrease value */ | |
| 478 | case IPT_UI_LEFT: | |
| 479 | if (machine().input().code_pressed(KEYCODE_LALT) || machine().input().code_pressed(KEYCODE_RALT)) | |
| 480 | increment = -1; | |
| 481 | else if (machine().input().code_pressed(KEYCODE_LSHIFT) || machine().input().code_pressed(KEYCODE_RSHIFT)) | |
| 482 | increment = (slider->incval > 10) ? -(slider->incval / 10) : -1; | |
| 483 | else if (machine().input().code_pressed(KEYCODE_LCONTROL) || machine().input().code_pressed(KEYCODE_RCONTROL)) | |
| 484 | increment = -slider->incval * 10; | |
| 485 | else | |
| 486 | increment = -slider->incval; | |
| 487 | break; | |
| 488 | ||
| 489 | /* increase value */ | |
| 490 | case IPT_UI_RIGHT: | |
| 491 | if (machine().input().code_pressed(KEYCODE_LALT) || machine().input().code_pressed(KEYCODE_RALT)) | |
| 492 | increment = 1; | |
| 493 | else if (machine().input().code_pressed(KEYCODE_LSHIFT) || machine().input().code_pressed(KEYCODE_RSHIFT)) | |
| 494 | increment = (slider->incval > 10) ? (slider->incval / 10) : 1; | |
| 495 | else if (machine().input().code_pressed(KEYCODE_LCONTROL) || machine().input().code_pressed(KEYCODE_RCONTROL)) | |
| 496 | increment = slider->incval * 10; | |
| 497 | else | |
| 498 | increment = slider->incval; | |
| 499 | break; | |
| 500 | ||
| 501 | /* restore default */ | |
| 502 | case IPT_UI_SELECT: | |
| 503 | increment = slider->defval - curvalue; | |
| 504 | break; | |
| 505 | } | |
| 506 | ||
| 507 | /* handle any changes */ | |
| 508 | if (increment != 0) | |
| 509 | { | |
| 510 | INT32 newvalue = curvalue + increment; | |
| 511 | ||
| 512 | /* clamp within bounds */ | |
| 513 | if (newvalue < slider->minval) | |
| 514 | newvalue = slider->minval; | |
| 515 | if (newvalue > slider->maxval) | |
| 516 | newvalue = slider->maxval; | |
| 517 | ||
| 518 | /* update the slider and recompute the menu */ | |
| 519 | (*slider->update)(machine(), slider->arg, NULL, newvalue); | |
| 520 | reset(UI_MENU_RESET_REMEMBER_REF); | |
| 521 | } | |
| 522 | } | |
| 523 | ||
| 524 | /* if we are selecting an invalid item and we are hidden, skip to the next one */ | |
| 525 | else if (hidden) | |
| 526 | { | |
| 527 | /* if we got here via up or page up, select the previous item */ | |
| 528 | if (menu_event->iptkey == IPT_UI_UP || menu_event->iptkey == IPT_UI_PAGE_UP) | |
| 529 | { | |
| 530 | selected = (selected + numitems - 1) % numitems; | |
| 531 | validate_selection(-1); | |
| 532 | } | |
| 533 | ||
| 534 | /* otherwise select the next item */ | |
| 535 | else if (menu_event->iptkey == IPT_UI_DOWN || menu_event->iptkey == IPT_UI_PAGE_DOWN) | |
| 536 | { | |
| 537 | selected = (selected + 1) % numitems; | |
| 538 | validate_selection(1); | |
| 539 | } | |
| 540 | } | |
| 541 | } | |
| 542 | } | |
| 543 | ||
| 544 | ||
| 545 | /*------------------------------------------------- | |
| 546 | menu_sliders_populate - populate the sliders | |
| 547 | menu | |
| 548 | -------------------------------------------------*/ | |
| 549 | ||
| 550 | ui_menu_sliders::ui_menu_sliders(running_machine &machine, render_container *container, bool _menuless_mode) : ui_menu(machine, container) | |
| 551 | { | |
| 552 | menuless_mode = hidden = _menuless_mode; | |
| 553 | } | |
| 554 | ||
| 555 | void ui_menu_sliders::populate() | |
| 556 | { | |
| 557 | const slider_state *curslider; | |
| 558 | astring tempstring; | |
| 559 | ||
| 560 | /* add all sliders */ | |
| 561 | for (curslider = machine().ui().get_slider_list(); curslider != NULL; curslider = curslider->next) | |
| 562 | { | |
| 563 | INT32 curval = (*curslider->update)(machine(), curslider->arg, &tempstring, SLIDER_NOCHANGE); | |
| 564 | UINT32 flags = 0; | |
| 565 | if (curval > curslider->minval) | |
| 566 | flags |= MENU_FLAG_LEFT_ARROW; | |
| 567 | if (curval < curslider->maxval) | |
| 568 | flags |= MENU_FLAG_RIGHT_ARROW; | |
| 569 | item_append(curslider->description, tempstring, flags, (void *)curslider); | |
| 570 | ||
| 571 | if (menuless_mode) | |
| 572 | break; | |
| 573 | } | |
| 574 | ||
| 575 | /* add all sliders */ | |
| 576 | for (curslider = (slider_state*)machine().osd().get_slider_list(); curslider != NULL; curslider = curslider->next) | |
| 577 | { | |
| 578 | INT32 curval = (*curslider->update)(machine(), curslider->arg, &tempstring, SLIDER_NOCHANGE); | |
| 579 | UINT32 flags = 0; | |
| 580 | if (curval > curslider->minval) | |
| 581 | flags |= MENU_FLAG_LEFT_ARROW; | |
| 582 | if (curval < curslider->maxval) | |
| 583 | flags |= MENU_FLAG_RIGHT_ARROW; | |
| 584 | item_append(curslider->description, tempstring, flags, (void *)curslider); | |
| 585 | } | |
| 586 | ||
| 587 | custombottom = 2.0f * machine().ui().get_line_height() + 2.0f * UI_BOX_TB_BORDER; | |
| 588 | } | |
| 589 | ||
| 590 | ui_menu_sliders::~ui_menu_sliders() | |
| 591 | { | |
| 592 | } | |
| 593 | ||
| 594 | /*------------------------------------------------- | |
| 595 | menu_sliders_custom_render - perform our special | |
| 596 | rendering | |
| 597 | -------------------------------------------------*/ | |
| 598 | ||
| 599 | void ui_menu_sliders::custom_render(void *selectedref, float top, float bottom, float x1, float y1, float x2, float y2) | |
| 600 | { | |
| 601 | const slider_state *curslider = (const slider_state *)selectedref; | |
| 602 | if (curslider != NULL) | |
| 603 | { | |
| 604 | float bar_left, bar_area_top, bar_width, bar_area_height, bar_top, bar_bottom, default_x, current_x; | |
| 605 | float line_height = machine().ui().get_line_height(); | |
| 606 | float percentage, default_percentage; | |
| 607 | astring tempstring; | |
| 608 | float text_height; | |
| 609 | INT32 curval; | |
| 610 | ||
| 611 | /* determine the current value and text */ | |
| 612 | curval = (*curslider->update)(machine(), curslider->arg, &tempstring, SLIDER_NOCHANGE); | |
| 613 | ||
| 614 | /* compute the current and default percentages */ | |
| 615 | percentage = (float)(curval - curslider->minval) / (float)(curslider->maxval - curslider->minval); | |
| 616 | default_percentage = (float)(curslider->defval - curslider->minval) / (float)(curslider->maxval - curslider->minval); | |
| 617 | ||
| 618 | /* assemble the text */ | |
| 619 | tempstring.ins(0, " ").ins(0, curslider->description); | |
| 620 | ||
| 621 | /* move us to the bottom of the screen, and expand to full width */ | |
| 622 | y2 = 1.0f - UI_BOX_TB_BORDER; | |
| 623 | y1 = y2 - bottom; | |
| 624 | x1 = UI_BOX_LR_BORDER; | |
| 625 | x2 = 1.0f - UI_BOX_LR_BORDER; | |
| 626 | ||
| 627 | /* draw extra menu area */ | |
| 628 | machine().ui().draw_outlined_box(container, x1, y1, x2, y2, UI_BACKGROUND_COLOR); | |
| 629 | y1 += UI_BOX_TB_BORDER; | |
| 630 | ||
| 631 | /* determine the text height */ | |
| 632 | machine().ui().draw_text_full(container, tempstring, 0, 0, x2 - x1 - 2.0f * UI_BOX_LR_BORDER, | |
| 633 | JUSTIFY_CENTER, WRAP_TRUNCATE, DRAW_NONE, ARGB_WHITE, ARGB_BLACK, NULL, &text_height); | |
| 634 | ||
| 635 | /* draw the thermometer */ | |
| 636 | bar_left = x1 + UI_BOX_LR_BORDER; | |
| 637 | bar_area_top = y1; | |
| 638 | bar_width = x2 - x1 - 2.0f * UI_BOX_LR_BORDER; | |
| 639 | bar_area_height = line_height; | |
| 640 | ||
| 641 | /* compute positions */ | |
| 642 | bar_top = bar_area_top + 0.125f * bar_area_height; | |
| 643 | bar_bottom = bar_area_top + 0.875f * bar_area_height; | |
| 644 | default_x = bar_left + bar_width * default_percentage; | |
| 645 | current_x = bar_left + bar_width * percentage; | |
| 646 | ||
| 647 | /* fill in the percentage */ | |
| 648 | container->add_rect(bar_left, bar_top, current_x, bar_bottom, UI_SLIDER_COLOR, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA)); | |
| 649 | ||
| 650 | /* draw the top and bottom lines */ | |
| 651 | container->add_line(bar_left, bar_top, bar_left + bar_width, bar_top, UI_LINE_WIDTH, UI_BORDER_COLOR, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA)); | |
| 652 | container->add_line(bar_left, bar_bottom, bar_left + bar_width, bar_bottom, UI_LINE_WIDTH, UI_BORDER_COLOR, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA)); | |
| 653 | ||
| 654 | /* draw default marker */ | |
| 655 | container->add_line(default_x, bar_area_top, default_x, bar_top, UI_LINE_WIDTH, UI_BORDER_COLOR, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA)); | |
| 656 | container->add_line(default_x, bar_bottom, default_x, bar_area_top + bar_area_height, UI_LINE_WIDTH, UI_BORDER_COLOR, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA)); | |
| 657 | ||
| 658 | /* draw the actual text */ | |
| 659 | machine().ui().draw_text_full(container, tempstring, x1 + UI_BOX_LR_BORDER, y1 + line_height, x2 - x1 - 2.0f * UI_BOX_LR_BORDER, | |
| 660 | JUSTIFY_CENTER, WRAP_WORD, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, NULL, &text_height); | |
| 661 | } | |
| 662 | } | |
| 663 | ||
| 664 | ||
| 665 | /*------------------------------------------------- | |
| 666 | menu_video_targets - handle the video targets | |
| 667 | menu | |
| 668 | -------------------------------------------------*/ | |
| 669 | ||
| 670 | void ui_menu_video_targets::handle() | |
| 671 | { | |
| 672 | /* process the menu */ | |
| 673 | const ui_menu_event *menu_event = process(0); | |
| 674 | if (menu_event != NULL && menu_event->iptkey == IPT_UI_SELECT) | |
| 675 | ui_menu::stack_push(auto_alloc_clear(machine(), ui_menu_video_options(machine(), container, static_cast<render_target *>(menu_event->itemref)))); | |
| 676 | } | |
| 677 | ||
| 678 | ||
| 679 | /*------------------------------------------------- | |
| 680 | menu_video_targets_populate - populate the | |
| 681 | video targets menu | |
| 682 | -------------------------------------------------*/ | |
| 683 | ||
| 684 | ui_menu_video_targets::ui_menu_video_targets(running_machine &machine, render_container *container) : ui_menu(machine, container) | |
| 685 | { | |
| 686 | } | |
| 687 | ||
| 688 | void ui_menu_video_targets::populate() | |
| 689 | { | |
| 690 | int targetnum; | |
| 691 | ||
| 692 | /* find the targets */ | |
| 693 | for (targetnum = 0; ; targetnum++) | |
| 694 | { | |
| 695 | render_target *target = machine().render().target_by_index(targetnum); | |
| 696 | char buffer[40]; | |
| 697 | ||
| 698 | /* stop when we run out */ | |
| 699 | if (target == NULL) | |
| 700 | break; | |
| 701 | ||
| 702 | /* add a menu item */ | |
| 703 | sprintf(buffer, "Screen #%d", targetnum); | |
| 704 | item_append(buffer, NULL, 0, target); | |
| 705 | } | |
| 706 | } | |
| 707 | ||
| 708 | ui_menu_video_targets::~ui_menu_video_targets() | |
| 709 | { | |
| 710 | } | |
| 711 | ||
| 712 | /*------------------------------------------------- | |
| 713 | menu_video_options - handle the video options | |
| 714 | menu | |
| 715 | -------------------------------------------------*/ | |
| 716 | ||
| 717 | void ui_menu_video_options::handle() | |
| 718 | { | |
| 719 | bool changed = false; | |
| 720 | ||
| 721 | /* process the menu */ | |
| 722 | const ui_menu_event *menu_event = process(0); | |
| 723 | if (menu_event != NULL && menu_event->itemref != NULL) | |
| 724 | { | |
| 725 | switch ((FPTR)menu_event->itemref) | |
| 726 | { | |
| 727 | /* rotate adds rotation depending on the direction */ | |
| 728 | case VIDEO_ITEM_ROTATE: | |
| 729 | if (menu_event->iptkey == IPT_UI_LEFT || menu_event->iptkey == IPT_UI_RIGHT) | |
| 730 | { | |
| 731 | int delta = (menu_event->iptkey == IPT_UI_LEFT) ? ROT270 : ROT90; | |
| 732 | target->set_orientation(orientation_add(delta, target->orientation())); | |
| 733 | if (target->is_ui_target()) | |
| 734 | { | |
| 735 | render_container::user_settings settings; | |
| 736 | container->get_user_settings(settings); | |
| 737 | settings.m_orientation = orientation_add(delta ^ ROT180, settings.m_orientation); | |
| 738 | container->set_user_settings(settings); | |
| 739 | } | |
| 740 | changed = true; | |
| 741 | } | |
| 742 | break; | |
| 743 | ||
| 744 | /* layer config bitmasks handle left/right keys the same (toggle) */ | |
| 745 | case VIDEO_ITEM_BACKDROPS: | |
| 746 | if (menu_event->iptkey == IPT_UI_LEFT || menu_event->iptkey == IPT_UI_RIGHT) | |
| 747 | { | |
| 748 | target->set_backdrops_enabled(!target->backdrops_enabled()); | |
| 749 | changed = true; | |
| 750 | } | |
| 751 | break; | |
| 752 | ||
| 753 | case VIDEO_ITEM_OVERLAYS: | |
| 754 | if (menu_event->iptkey == IPT_UI_LEFT || menu_event->iptkey == IPT_UI_RIGHT) | |
| 755 | { | |
| 756 | target->set_overlays_enabled(!target->overlays_enabled()); | |
| 757 | changed = true; | |
| 758 | } | |
| 759 | break; | |
| 760 | ||
| 761 | case VIDEO_ITEM_BEZELS: | |
| 762 | if (menu_event->iptkey == IPT_UI_LEFT || menu_event->iptkey == IPT_UI_RIGHT) | |
| 763 | { | |
| 764 | target->set_bezels_enabled(!target->bezels_enabled()); | |
| 765 | changed = true; | |
| 766 | } | |
| 767 | break; | |
| 768 | ||
| 769 | case VIDEO_ITEM_CPANELS: | |
| 770 | if (menu_event->iptkey == IPT_UI_LEFT || menu_event->iptkey == IPT_UI_RIGHT) | |
| 771 | { | |
| 772 | target->set_cpanels_enabled(!target->cpanels_enabled()); | |
| 773 | changed = true; | |
| 774 | } | |
| 775 | break; | |
| 776 | ||
| 777 | case VIDEO_ITEM_MARQUEES: | |
| 778 | if (menu_event->iptkey == IPT_UI_LEFT || menu_event->iptkey == IPT_UI_RIGHT) | |
| 779 | { | |
| 780 | target->set_marquees_enabled(!target->marquees_enabled()); | |
| 781 | changed = true; | |
| 782 | } | |
| 783 | break; | |
| 784 | ||
| 785 | case VIDEO_ITEM_ZOOM: | |
| 786 | if (menu_event->iptkey == IPT_UI_LEFT || menu_event->iptkey == IPT_UI_RIGHT) | |
| 787 | { | |
| 788 | target->set_zoom_to_screen(!target->zoom_to_screen()); | |
| 789 | changed = true; | |
| 790 | } | |
| 791 | break; | |
| 792 | ||
| 793 | /* anything else is a view item */ | |
| 794 | default: | |
| 795 | if (menu_event->iptkey == IPT_UI_SELECT && (int)(FPTR)menu_event->itemref >= VIDEO_ITEM_VIEW) | |
| 796 | { | |
| 797 | target->set_view((FPTR)menu_event->itemref - VIDEO_ITEM_VIEW); | |
| 798 | changed = true; | |
| 799 | } | |
| 800 | break; | |
| 801 | } | |
| 802 | } | |
| 803 | ||
| 804 | /* if something changed, rebuild the menu */ | |
| 805 | if (changed) | |
| 806 | reset(UI_MENU_RESET_REMEMBER_REF); | |
| 807 | } | |
| 808 | ||
| 809 | ||
| 810 | /*------------------------------------------------- | |
| 811 | menu_video_options_populate - populate the | |
| 812 | video options menu | |
| 813 | -------------------------------------------------*/ | |
| 814 | ||
| 815 | ui_menu_video_options::ui_menu_video_options(running_machine &machine, render_container *container, render_target *_target) : ui_menu(machine, container) | |
| 816 | { | |
| 817 | target = _target; | |
| 818 | } | |
| 819 | ||
| 820 | void ui_menu_video_options::populate() | |
| 821 | { | |
| 822 | const char *subtext = ""; | |
| 823 | astring tempstring; | |
| 824 | int viewnum; | |
| 825 | int enabled; | |
| 826 | ||
| 827 | /* add items for each view */ | |
| 828 | for (viewnum = 0; ; viewnum++) | |
| 829 | { | |
| 830 | const char *name = target->view_name(viewnum); | |
| 831 | if (name == NULL) | |
| 832 | break; | |
| 833 | ||
| 834 | /* create a string for the item, replacing underscores with spaces */ | |
| 835 | tempstring.cpy(name).replace(0, "_", " "); | |
| 836 | item_append(tempstring, NULL, 0, (void *)(FPTR)(VIDEO_ITEM_VIEW + viewnum)); | |
| 837 | } | |
| 838 | ||
| 839 | /* add a separator */ | |
| 840 | item_append(MENU_SEPARATOR_ITEM, NULL, 0, NULL); | |
| 841 | ||
| 842 | /* add a rotate item */ | |
| 843 | switch (target->orientation()) | |
| 844 | { | |
| 845 | case ROT0: subtext = "None"; break; | |
| 846 | case ROT90: subtext = "CW 90" UTF8_DEGREES; break; | |
| 847 | case ROT180: subtext = "180" UTF8_DEGREES; break; | |
| 848 | case ROT270: subtext = "CCW 90" UTF8_DEGREES; break; | |
| 849 | } | |
| 850 | item_append("Rotate", subtext, MENU_FLAG_LEFT_ARROW | MENU_FLAG_RIGHT_ARROW, (void *)VIDEO_ITEM_ROTATE); | |
| 851 | ||
| 852 | /* backdrop item */ | |
| 853 | enabled = target->backdrops_enabled(); | |
| 854 | item_append("Backdrops", enabled ? "Enabled" : "Disabled", enabled ? MENU_FLAG_LEFT_ARROW : MENU_FLAG_RIGHT_ARROW, (void *)VIDEO_ITEM_BACKDROPS); | |
| 855 | ||
| 856 | /* overlay item */ | |
| 857 | enabled = target->overlays_enabled(); | |
| 858 | item_append("Overlays", enabled ? "Enabled" : "Disabled", enabled ? MENU_FLAG_LEFT_ARROW : MENU_FLAG_RIGHT_ARROW, (void *)VIDEO_ITEM_OVERLAYS); | |
| 859 | ||
| 860 | /* bezel item */ | |
| 861 | enabled = target->bezels_enabled(); | |
| 862 | item_append("Bezels", enabled ? "Enabled" : "Disabled", enabled ? MENU_FLAG_LEFT_ARROW : MENU_FLAG_RIGHT_ARROW, (void *)VIDEO_ITEM_BEZELS); | |
| 863 | ||
| 864 | /* cpanel item */ | |
| 865 | enabled = target->cpanels_enabled(); | |
| 866 | item_append("CPanels", enabled ? "Enabled" : "Disabled", enabled ? MENU_FLAG_LEFT_ARROW : MENU_FLAG_RIGHT_ARROW, (void *)VIDEO_ITEM_CPANELS); | |
| 867 | ||
| 868 | /* marquee item */ | |
| 869 | enabled = target->marquees_enabled(); | |
| 870 | item_append("Marquees", enabled ? "Enabled" : "Disabled", enabled ? MENU_FLAG_LEFT_ARROW : MENU_FLAG_RIGHT_ARROW, (void *)VIDEO_ITEM_MARQUEES); | |
| 871 | ||
| 872 | /* cropping */ | |
| 873 | enabled = target->zoom_to_screen(); | |
| 874 | item_append("View", enabled ? "Cropped" : "Full", enabled ? MENU_FLAG_RIGHT_ARROW : MENU_FLAG_LEFT_ARROW, (void *)VIDEO_ITEM_ZOOM); | |
| 875 | } | |
| 876 | ||
| 877 | ui_menu_video_options::~ui_menu_video_options() | |
| 878 | { | |
| 879 | } | |
| 880 | ||
| 881 | /*------------------------------------------------- | |
| 274 | 882 | menu_crosshair - handle the crosshair settings |
| 275 | 883 | menu |
| 276 | 884 | -------------------------------------------------*/ |
| r243192 | r243193 | |
|---|---|---|
| 14 | 14 | #ifndef __UI_MISCMENU_H__ |
| 15 | 15 | #define __UI_MISCMENU_H__ |
| 16 | 16 | |
| 17 | #include "crsshair.h" | |
| 17 | 18 | #include "drivenum.h" |
| 18 | #include "crsshair.h" | |
| 19 | 19 | |
| 20 | 20 | class ui_menu_keyboard_mode : public ui_menu { |
| 21 | 21 | public: |
| r243192 | r243193 | |
| 44 | 44 | attotime prevtime; |
| 45 | 45 | }; |
| 46 | 46 | |
| 47 | class ui_menu_game_info : public ui_menu { | |
| 48 | public: | |
| 49 | ui_menu_game_info(running_machine &machine, render_container *container); | |
| 50 | virtual ~ui_menu_game_info(); | |
| 51 | virtual void populate(); | |
| 52 | virtual void handle(); | |
| 53 | }; | |
| 54 | ||
| 55 | class ui_menu_cheat : public ui_menu { | |
| 56 | public: | |
| 57 | ui_menu_cheat(running_machine &machine, render_container *container); | |
| 58 | virtual ~ui_menu_cheat(); | |
| 59 | virtual void populate(); | |
| 60 | virtual void handle(); | |
| 61 | }; | |
| 62 | ||
| 63 | class ui_menu_sliders : public ui_menu { | |
| 64 | public: | |
| 65 | ui_menu_sliders(running_machine &machine, render_container *container, bool menuless_mode = false); | |
| 66 | virtual ~ui_menu_sliders(); | |
| 67 | virtual void populate(); | |
| 68 | virtual void handle(); | |
| 69 | ||
| 70 | virtual void custom_render(void *selectedref, float top, float bottom, float x, float y, float x2, float y2); | |
| 71 | ||
| 72 | static UINT32 ui_handler(running_machine &machine, render_container *container, UINT32 state); | |
| 73 | ||
| 74 | private: | |
| 75 | bool menuless_mode, hidden; | |
| 76 | }; | |
| 77 | ||
| 78 | class ui_menu_video_targets : public ui_menu { | |
| 79 | public: | |
| 80 | ui_menu_video_targets(running_machine &machine, render_container *container); | |
| 81 | virtual ~ui_menu_video_targets(); | |
| 82 | virtual void populate(); | |
| 83 | virtual void handle(); | |
| 84 | }; | |
| 85 | ||
| 86 | class ui_menu_video_options : public ui_menu { | |
| 87 | public: | |
| 88 | ui_menu_video_options(running_machine &machine, render_container *container, render_target *target); | |
| 89 | virtual ~ui_menu_video_options(); | |
| 90 | virtual void populate(); | |
| 91 | virtual void handle(); | |
| 92 | ||
| 93 | private: | |
| 94 | enum { | |
| 95 | VIDEO_ITEM_ROTATE = 0x80000000, | |
| 96 | VIDEO_ITEM_BACKDROPS, | |
| 97 | VIDEO_ITEM_OVERLAYS, | |
| 98 | VIDEO_ITEM_BEZELS, | |
| 99 | VIDEO_ITEM_CPANELS, | |
| 100 | VIDEO_ITEM_MARQUEES, | |
| 101 | VIDEO_ITEM_ZOOM, | |
| 102 | VIDEO_ITEM_VIEW | |
| 103 | }; | |
| 104 | ||
| 105 | render_target *target; | |
| 106 | }; | |
| 107 | ||
| 47 | 108 | class ui_menu_crosshair : public ui_menu { |
| 48 | 109 | public: |
| 49 | 110 | ui_menu_crosshair(running_machine &machine, render_container *container); |
| r243192 | r243193 | |
|---|---|---|
| 157 | 157 | media_auditor::summary summary = auditor.audit_media(AUDIT_VALIDATE_FAST); |
| 158 | 158 | |
| 159 | 159 | // if everything looks good, schedule the new driver |
| 160 | if (summary == media_auditor::CORRECT || summary == media_auditor::BEST_AVAILABLE | |
| 160 | if (summary == media_auditor::CORRECT || summary == media_auditor::BEST_AVAILABLE) | |
| 161 | 161 | { |
| 162 | 162 | machine().manager().schedule_new_driver(*driver); |
| 163 | 163 | machine().schedule_hard_reset(); |
| r243192 | r243193 | |
|---|---|---|
| 1 | /********************************************************************* | |
| 2 | ||
| 3 | miscmenu.c | |
| 4 | ||
| 5 | Internal MAME menus for the user interface. | |
| 6 | ||
| 7 | Copyright Nicola Salmoria and the MAME Team. | |
| 8 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 9 | ||
| 10 | *********************************************************************/ | |
| 11 | ||
| 12 | #include "emu.h" | |
| 13 | ||
| 14 | #include "osdepend.h" | |
| 15 | #include "uiinput.h" | |
| 16 | #include "ui/ui.h" | |
| 17 | #include "ui/sliders.h" | |
| 18 | ||
| 19 | ||
| 20 | ui_menu_sliders::ui_menu_sliders(running_machine &machine, render_container *container, bool _menuless_mode) : ui_menu(machine, container) | |
| 21 | { | |
| 22 | menuless_mode = hidden = _menuless_mode; | |
| 23 | } | |
| 24 | ||
| 25 | ui_menu_sliders::~ui_menu_sliders() | |
| 26 | { | |
| 27 | } | |
| 28 | ||
| 29 | /*------------------------------------------------- | |
| 30 | menu_sliders - handle the sliders menu | |
| 31 | -------------------------------------------------*/ | |
| 32 | ||
| 33 | void ui_menu_sliders::handle() | |
| 34 | { | |
| 35 | const ui_menu_event *menu_event; | |
| 36 | ||
| 37 | /* process the menu */ | |
| 38 | menu_event = process(UI_MENU_PROCESS_LR_REPEAT | (hidden ? UI_MENU_PROCESS_CUSTOM_ONLY : 0)); | |
| 39 | if (menu_event != NULL) | |
| 40 | { | |
| 41 | /* handle keys if there is a valid item selected */ | |
| 42 | if (menu_event->itemref != NULL) | |
| 43 | { | |
| 44 | const slider_state *slider = (const slider_state *)menu_event->itemref; | |
| 45 | INT32 curvalue = (*slider->update)(machine(), slider->arg, NULL, SLIDER_NOCHANGE); | |
| 46 | INT32 increment = 0; | |
| 47 | ||
| 48 | switch (menu_event->iptkey) | |
| 49 | { | |
| 50 | /* toggle visibility */ | |
| 51 | case IPT_UI_ON_SCREEN_DISPLAY: | |
| 52 | if (menuless_mode) | |
| 53 | ui_menu::stack_pop(machine()); | |
| 54 | else | |
| 55 | hidden = !hidden; | |
| 56 | break; | |
| 57 | ||
| 58 | /* decrease value */ | |
| 59 | case IPT_UI_LEFT: | |
| 60 | if (machine().input().code_pressed(KEYCODE_LALT) || machine().input().code_pressed(KEYCODE_RALT)) | |
| 61 | increment = -1; | |
| 62 | else if (machine().input().code_pressed(KEYCODE_LSHIFT) || machine().input().code_pressed(KEYCODE_RSHIFT)) | |
| 63 | increment = (slider->incval > 10) ? -(slider->incval / 10) : -1; | |
| 64 | else if (machine().input().code_pressed(KEYCODE_LCONTROL) || machine().input().code_pressed(KEYCODE_RCONTROL)) | |
| 65 | increment = -slider->incval * 10; | |
| 66 | else | |
| 67 | increment = -slider->incval; | |
| 68 | break; | |
| 69 | ||
| 70 | /* increase value */ | |
| 71 | case IPT_UI_RIGHT: | |
| 72 | if (machine().input().code_pressed(KEYCODE_LALT) || machine().input().code_pressed(KEYCODE_RALT)) | |
| 73 | increment = 1; | |
| 74 | else if (machine().input().code_pressed(KEYCODE_LSHIFT) || machine().input().code_pressed(KEYCODE_RSHIFT)) | |
| 75 | increment = (slider->incval > 10) ? (slider->incval / 10) : 1; | |
| 76 | else if (machine().input().code_pressed(KEYCODE_LCONTROL) || machine().input().code_pressed(KEYCODE_RCONTROL)) | |
| 77 | increment = slider->incval * 10; | |
| 78 | else | |
| 79 | increment = slider->incval; | |
| 80 | break; | |
| 81 | ||
| 82 | /* restore default */ | |
| 83 | case IPT_UI_SELECT: | |
| 84 | increment = slider->defval - curvalue; | |
| 85 | break; | |
| 86 | } | |
| 87 | ||
| 88 | /* handle any changes */ | |
| 89 | if (increment != 0) | |
| 90 | { | |
| 91 | INT32 newvalue = curvalue + increment; | |
| 92 | ||
| 93 | /* clamp within bounds */ | |
| 94 | if (newvalue < slider->minval) | |
| 95 | newvalue = slider->minval; | |
| 96 | if (newvalue > slider->maxval) | |
| 97 | newvalue = slider->maxval; | |
| 98 | ||
| 99 | /* update the slider and recompute the menu */ | |
| 100 | (*slider->update)(machine(), slider->arg, NULL, newvalue); | |
| 101 | reset(UI_MENU_RESET_REMEMBER_REF); | |
| 102 | } | |
| 103 | } | |
| 104 | ||
| 105 | /* if we are selecting an invalid item and we are hidden, skip to the next one */ | |
| 106 | else if (hidden) | |
| 107 | { | |
| 108 | /* if we got here via up or page up, select the previous item */ | |
| 109 | if (menu_event->iptkey == IPT_UI_UP || menu_event->iptkey == IPT_UI_PAGE_UP) | |
| 110 | { | |
| 111 | selected = (selected + numitems - 1) % numitems; | |
| 112 | validate_selection(-1); | |
| 113 | } | |
| 114 | ||
| 115 | /* otherwise select the next item */ | |
| 116 | else if (menu_event->iptkey == IPT_UI_DOWN || menu_event->iptkey == IPT_UI_PAGE_DOWN) | |
| 117 | { | |
| 118 | selected = (selected + 1) % numitems; | |
| 119 | validate_selection(1); | |
| 120 | } | |
| 121 | } | |
| 122 | } | |
| 123 | } | |
| 124 | ||
| 125 | ||
| 126 | /*------------------------------------------------- | |
| 127 | menu_sliders_populate - populate the sliders | |
| 128 | menu | |
| 129 | -------------------------------------------------*/ | |
| 130 | ||
| 131 | void ui_menu_sliders::populate() | |
| 132 | { | |
| 133 | astring tempstring; | |
| 134 | ||
| 135 | /* add UI sliders */ | |
| 136 | for (const slider_state *curslider = machine().ui().get_slider_list(); curslider != NULL; curslider = curslider->next) | |
| 137 | { | |
| 138 | INT32 curval = (*curslider->update)(machine(), curslider->arg, &tempstring, SLIDER_NOCHANGE); | |
| 139 | UINT32 flags = 0; | |
| 140 | if (curval > curslider->minval) | |
| 141 | flags |= MENU_FLAG_LEFT_ARROW; | |
| 142 | if (curval < curslider->maxval) | |
| 143 | flags |= MENU_FLAG_RIGHT_ARROW; | |
| 144 | item_append(curslider->description, tempstring, flags, (void *)curslider); | |
| 145 | ||
| 146 | if (menuless_mode) | |
| 147 | break; | |
| 148 | } | |
| 149 | ||
| 150 | /* add OSD sliders */ | |
| 151 | for (const slider_state *curslider = (slider_state*)machine().osd().get_slider_list(); curslider != NULL; curslider = curslider->next) | |
| 152 | { | |
| 153 | INT32 curval = (*curslider->update)(machine(), curslider->arg, &tempstring, SLIDER_NOCHANGE); | |
| 154 | UINT32 flags = 0; | |
| 155 | if (curval > curslider->minval) | |
| 156 | flags |= MENU_FLAG_LEFT_ARROW; | |
| 157 | if (curval < curslider->maxval) | |
| 158 | flags |= MENU_FLAG_RIGHT_ARROW; | |
| 159 | item_append(curslider->description, tempstring, flags, (void *)curslider); | |
| 160 | } | |
| 161 | ||
| 162 | custombottom = 2.0f * machine().ui().get_line_height() + 2.0f * UI_BOX_TB_BORDER; | |
| 163 | } | |
| 164 | ||
| 165 | /*------------------------------------------------- | |
| 166 | menu_sliders_custom_render - perform our special | |
| 167 | rendering | |
| 168 | -------------------------------------------------*/ | |
| 169 | ||
| 170 | void ui_menu_sliders::custom_render(void *selectedref, float top, float bottom, float x1, float y1, float x2, float y2) | |
| 171 | { | |
| 172 | const slider_state *curslider = (const slider_state *)selectedref; | |
| 173 | if (curslider != NULL) | |
| 174 | { | |
| 175 | float bar_left, bar_area_top, bar_width, bar_area_height, bar_top, bar_bottom, default_x, current_x; | |
| 176 | float line_height = machine().ui().get_line_height(); | |
| 177 | float percentage, default_percentage; | |
| 178 | astring tempstring; | |
| 179 | float text_height; | |
| 180 | INT32 curval; | |
| 181 | ||
| 182 | /* determine the current value and text */ | |
| 183 | curval = (*curslider->update)(machine(), curslider->arg, &tempstring, SLIDER_NOCHANGE); | |
| 184 | ||
| 185 | /* compute the current and default percentages */ | |
| 186 | percentage = (float)(curval - curslider->minval) / (float)(curslider->maxval - curslider->minval); | |
| 187 | default_percentage = (float)(curslider->defval - curslider->minval) / (float)(curslider->maxval - curslider->minval); | |
| 188 | ||
| 189 | /* assemble the text */ | |
| 190 | tempstring.ins(0, " ").ins(0, curslider->description); | |
| 191 | ||
| 192 | /* move us to the bottom of the screen, and expand to full width */ | |
| 193 | y2 = 1.0f - UI_BOX_TB_BORDER; | |
| 194 | y1 = y2 - bottom; | |
| 195 | x1 = UI_BOX_LR_BORDER; | |
| 196 | x2 = 1.0f - UI_BOX_LR_BORDER; | |
| 197 | ||
| 198 | /* draw extra menu area */ | |
| 199 | machine().ui().draw_outlined_box(container, x1, y1, x2, y2, UI_BACKGROUND_COLOR); | |
| 200 | y1 += UI_BOX_TB_BORDER; | |
| 201 | ||
| 202 | /* determine the text height */ | |
| 203 | machine().ui().draw_text_full(container, tempstring, 0, 0, x2 - x1 - 2.0f * UI_BOX_LR_BORDER, | |
| 204 | JUSTIFY_CENTER, WRAP_TRUNCATE, DRAW_NONE, ARGB_WHITE, ARGB_BLACK, NULL, &text_height); | |
| 205 | ||
| 206 | /* draw the thermometer */ | |
| 207 | bar_left = x1 + UI_BOX_LR_BORDER; | |
| 208 | bar_area_top = y1; | |
| 209 | bar_width = x2 - x1 - 2.0f * UI_BOX_LR_BORDER; | |
| 210 | bar_area_height = line_height; | |
| 211 | ||
| 212 | /* compute positions */ | |
| 213 | bar_top = bar_area_top + 0.125f * bar_area_height; | |
| 214 | bar_bottom = bar_area_top + 0.875f * bar_area_height; | |
| 215 | default_x = bar_left + bar_width * default_percentage; | |
| 216 | current_x = bar_left + bar_width * percentage; | |
| 217 | ||
| 218 | /* fill in the percentage */ | |
| 219 | container->add_rect(bar_left, bar_top, current_x, bar_bottom, UI_SLIDER_COLOR, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA)); | |
| 220 | ||
| 221 | /* draw the top and bottom lines */ | |
| 222 | container->add_line(bar_left, bar_top, bar_left + bar_width, bar_top, UI_LINE_WIDTH, UI_BORDER_COLOR, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA)); | |
| 223 | container->add_line(bar_left, bar_bottom, bar_left + bar_width, bar_bottom, UI_LINE_WIDTH, UI_BORDER_COLOR, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA)); | |
| 224 | ||
| 225 | /* draw default marker */ | |
| 226 | container->add_line(default_x, bar_area_top, default_x, bar_top, UI_LINE_WIDTH, UI_BORDER_COLOR, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA)); | |
| 227 | container->add_line(default_x, bar_bottom, default_x, bar_area_top + bar_area_height, UI_LINE_WIDTH, UI_BORDER_COLOR, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA)); | |
| 228 | ||
| 229 | /* draw the actual text */ | |
| 230 | machine().ui().draw_text_full(container, tempstring, x1 + UI_BOX_LR_BORDER, y1 + line_height, x2 - x1 - 2.0f * UI_BOX_LR_BORDER, | |
| 231 | JUSTIFY_CENTER, WRAP_WORD, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, NULL, &text_height); | |
| 232 | } | |
| 233 | } | |
| 234 | ||
| 235 | ||
| 236 | /*------------------------------------------------- | |
| 237 | ui_slider_ui_handler - pushes the slider | |
| 238 | menu on the stack and hands off to the | |
| 239 | standard menu handler | |
| 240 | -------------------------------------------------*/ | |
| 241 | ||
| 242 | UINT32 ui_menu_sliders::ui_handler(running_machine &machine, render_container *container, UINT32 state) | |
| 243 | { | |
| 244 | UINT32 result; | |
| 245 | ||
| 246 | /* if this is the first call, push the sliders menu */ | |
| 247 | if (state) | |
| 248 | ui_menu::stack_push(auto_alloc_clear(machine, ui_menu_sliders(machine, container, true))); | |
| 249 | ||
| 250 | /* handle standard menus */ | |
| 251 | result = ui_menu::ui_handler(machine, container, state); | |
| 252 | ||
| 253 | /* if we are cancelled, pop the sliders menu */ | |
| 254 | if (result == UI_HANDLER_CANCEL) | |
| 255 | ui_menu::stack_pop(machine); | |
| 256 | ||
| 257 | ui_menu_sliders *uim = dynamic_cast<ui_menu_sliders *>(menu_stack); | |
| 258 | return uim && uim->menuless_mode ? 0 : UI_HANDLER_CANCEL; | |
| 259 | } |
| r243192 | r243193 | |
|---|---|---|
| 1 | /*************************************************************************** | |
| 2 | ||
| 3 | ui/miscmenu.h | |
| 4 | ||
| 5 | Internal MAME menus for the user interface. | |
| 6 | ||
| 7 | Copyright Nicola Salmoria and the MAME Team. | |
| 8 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 9 | ||
| 10 | ***************************************************************************/ | |
| 11 | ||
| 12 | #pragma once | |
| 13 | ||
| 14 | #ifndef __UI_SLIDERS_H__ | |
| 15 | #define __UI_SLIDERS_H__ | |
| 16 | ||
| 17 | class ui_menu_sliders : public ui_menu { | |
| 18 | public: | |
| 19 | ui_menu_sliders(running_machine &machine, render_container *container, bool menuless_mode = false); | |
| 20 | virtual ~ui_menu_sliders(); | |
| 21 | virtual void populate(); | |
| 22 | virtual void handle(); | |
| 23 | ||
| 24 | virtual void custom_render(void *selectedref, float top, float bottom, float x, float y, float x2, float y2); | |
| 25 | ||
| 26 | static UINT32 ui_handler(running_machine &machine, render_container *container, UINT32 state); | |
| 27 | ||
| 28 | private: | |
| 29 | bool menuless_mode, hidden; | |
| 30 | }; | |
| 31 | ||
| 32 | ||
| 33 | #endif /* __UI_SLIDERS_H__ */ |
| r243192 | r243193 | |
|---|---|---|
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | |
| 3 | 3 | ui/slotopt.h |
| 4 | ||
| 4 | ||
| 5 | 5 | Internal menu for the slot options. |
| 6 | ||
| 6 | ||
| 7 | 7 | Copyright Nicola Salmoria and the MAME Team. |
| 8 | 8 | Visit http://mamedev.org for licensing and usage restrictions. |
| 9 | 9 |
| r243192 | r243193 | |
|---|---|---|
| 56 | 56 | void ui_menu_tape_control::populate() |
| 57 | 57 | { |
| 58 | 58 | if (current_device()) |
| 59 | { | |
| 59 | { | |
| 60 | 60 | // name of tape |
| 61 | 61 | item_append(current_display_name(), current_device()->exists() ? current_device()->filename() : "No Tape Image loaded", current_display_flags(), TAPECMD_SELECT); |
| 62 | 62 | |
| r243192 | r243193 | |
| 67 | 67 | double t0 = current_device()->get_position(); |
| 68 | 68 | double t1 = current_device()->get_length(); |
| 69 | 69 | UINT32 tapeflags = 0; |
| 70 | ||
| 70 | ||
| 71 | 71 | // state |
| 72 | 72 | if (t1 > 0) |
| 73 | 73 | { |
| r243192 | r243193 | |
| 76 | 76 | if (t0 < t1) |
| 77 | 77 | tapeflags |= MENU_FLAG_RIGHT_ARROW; |
| 78 | 78 | } |
| 79 | ||
| 79 | ||
| 80 | 80 | get_time_string(timepos, current_device(), NULL, NULL); |
| 81 | 81 | state = current_device()->get_state(); |
| 82 | 82 | item_append( |
| 83 | 83 | (state & CASSETTE_MASK_UISTATE) == CASSETTE_STOPPED |
| 84 | 84 | ? "stopped" |
| 85 | 85 | : ((state & CASSETTE_MASK_UISTATE) == CASSETTE_PLAY |
| 86 | ? ((state & CASSETTE_MASK_MOTOR) == CASSETTE_MOTOR_ENABLED ? "playing" : "(playing)") | |
| 87 | : ((state & CASSETTE_MASK_MOTOR) == CASSETTE_MOTOR_ENABLED ? "recording" : "(recording)") | |
| 88 | ), | |
| 86 | ? ((state & CASSETTE_MASK_MOTOR) == CASSETTE_MOTOR_ENABLED ? "playing" : "(playing)") | |
| 87 | : ((state & CASSETTE_MASK_MOTOR) == CASSETTE_MOTOR_ENABLED ? "recording" : "(recording)") | |
| 88 | ), | |
| 89 | 89 | timepos, |
| 90 | 90 | tapeflags, |
| 91 | 91 | TAPECMD_SLIDER); |
| 92 | ||
| 92 | ||
| 93 | 93 | // pause or stop |
| 94 | 94 | item_append("Pause/Stop", NULL, 0, TAPECMD_STOP); |
| 95 | ||
| 95 | ||
| 96 | 96 | // play |
| 97 | 97 | item_append("Play", NULL, 0, TAPECMD_PLAY); |
| 98 | ||
| 98 | ||
| 99 | 99 | // record |
| 100 | 100 | item_append("Record", NULL, 0, TAPECMD_RECORD); |
| 101 | ||
| 101 | ||
| 102 | 102 | // rewind |
| 103 | 103 | item_append("Rewind", NULL, 0, TAPECMD_REWIND); |
| 104 | ||
| 104 | ||
| 105 | 105 | // fast forward |
| 106 | 106 | item_append("Fast Forward", NULL, 0, TAPECMD_FAST_FORWARD); |
| 107 | 107 | } |
| r243192 | r243193 | |
|---|---|---|
| 16 | 16 | #include "render.h" |
| 17 | 17 | #include "cheat.h" |
| 18 | 18 | #include "rendfont.h" |
| 19 | #include "uiinput.h" | |
| 20 | 19 | #include "ui/ui.h" |
| 21 | #include "ui | |
| 20 | #include "uiinput.h" | |
| 22 | 21 | #include "ui/mainmenu.h" |
| 23 | 22 | #include "ui/miscmenu.h" |
| 24 | #include "ui/filemngr.h" | |
| 25 | #include "ui/sliders.h" | |
| 26 | 23 | #include "ui/viewgfx.h" |
| 27 | 24 | #include "imagedev/cassette.h" |
| 25 | #include <ctype.h> | |
| 28 | 26 | |
| 29 | 27 | |
| 30 | 28 | /*************************************************************************** |
| r243192 | r243193 | |
| 308 | 306 | |
| 309 | 307 | void ui_manager::display_startup_screens(bool first_time, bool show_disclaimer) |
| 310 | 308 | { |
| 311 | const int maxstate = | |
| 309 | const int maxstate = 3; | |
| 312 | 310 | int str = machine().options().seconds_to_run(); |
| 313 | 311 | bool show_gameinfo = !machine().options().skip_gameinfo(); |
| 314 | bool show_warnings = true | |
| 312 | bool show_warnings = true; | |
| 315 | 313 | int state; |
| 316 | 314 | |
| 317 | 315 | // disable everything if we are using -str for 300 or fewer seconds, or if we're the empty driver, |
| 318 | 316 | // or if we are debugging |
| 319 | 317 | if (!first_time || (str > 0 && str < 60*5) || &machine().system() == &GAME_NAME(___empty) || (machine().debug_flags & DEBUG_FLAG_ENABLED) != 0) |
| 320 | show_gameinfo = show_warnings = show_disclaimer = | |
| 318 | show_gameinfo = show_warnings = show_disclaimer = FALSE; | |
| 321 | 319 | |
| 322 | 320 | #ifdef SDLMAME_EMSCRIPTEN |
| 323 | 321 | // also disable for the JavaScript port since the startup screens do not run asynchronously |
| r243192 | r243193 | |
| 354 | 352 | if (show_gameinfo && game_info_astring(messagebox_text).len() > 0) |
| 355 | 353 | set_handler(handler_messagebox_anykey, 0); |
| 356 | 354 | break; |
| 357 | ||
| 358 | case 3: | |
| 359 | if (show_mandatory_fileman && image_mandatory_scan(machine(), messagebox_text).len() > 0) | |
| 360 | { | |
| 361 | astring warning; | |
| 362 | warning.cpy("This driver requires images to be loaded in the following device(s): ").cat(messagebox_text.substr(0, messagebox_text.len() - 2)); | |
| 363 | ui_menu_file_manager::force_file_manager(machine(), &machine().render().ui_container(), warning.cstr()); | |
| 364 | } | |
| 365 | break; | |
| 366 | 355 | } |
| 367 | 356 | |
| 368 | 357 | // clear the input memory |
| r243192 | r243193 | |
|---|---|---|
| 1 | /********************************************************************* | |
| 2 | ||
| 3 | ui/videoopt.c | |
| 4 | ||
| 5 | Internal menus for video options | |
| 6 | ||
| 7 | Copyright Nicola Salmoria and the MAME Team. | |
| 8 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 9 | ||
| 10 | *********************************************************************/ | |
| 11 | ||
| 12 | #include "emu.h" | |
| 13 | #include "rendutil.h" | |
| 14 | ||
| 15 | #include "uiinput.h" | |
| 16 | #include "ui/ui.h" | |
| 17 | #include "ui/videoopt.h" | |
| 18 | ||
| 19 | /*------------------------------------------------- | |
| 20 | menu_video_targets - handle the video targets | |
| 21 | menu | |
| 22 | -------------------------------------------------*/ | |
| 23 | ||
| 24 | void ui_menu_video_targets::handle() | |
| 25 | { | |
| 26 | /* process the menu */ | |
| 27 | const ui_menu_event *menu_event = process(0); | |
| 28 | if (menu_event != NULL && menu_event->iptkey == IPT_UI_SELECT) | |
| 29 | ui_menu::stack_push(auto_alloc_clear(machine(), ui_menu_video_options(machine(), container, static_cast<render_target *>(menu_event->itemref)))); | |
| 30 | } | |
| 31 | ||
| 32 | ||
| 33 | /*------------------------------------------------- | |
| 34 | menu_video_targets_populate - populate the | |
| 35 | video targets menu | |
| 36 | -------------------------------------------------*/ | |
| 37 | ||
| 38 | ui_menu_video_targets::ui_menu_video_targets(running_machine &machine, render_container *container) : ui_menu(machine, container) | |
| 39 | { | |
| 40 | } | |
| 41 | ||
| 42 | void ui_menu_video_targets::populate() | |
| 43 | { | |
| 44 | int targetnum; | |
| 45 | ||
| 46 | /* find the targets */ | |
| 47 | for (targetnum = 0; ; targetnum++) | |
| 48 | { | |
| 49 | render_target *target = machine().render().target_by_index(targetnum); | |
| 50 | char buffer[40]; | |
| 51 | ||
| 52 | /* stop when we run out */ | |
| 53 | if (target == NULL) | |
| 54 | break; | |
| 55 | ||
| 56 | /* add a menu item */ | |
| 57 | sprintf(buffer, "Screen #%d", targetnum); | |
| 58 | item_append(buffer, NULL, 0, target); | |
| 59 | } | |
| 60 | } | |
| 61 | ||
| 62 | ui_menu_video_targets::~ui_menu_video_targets() | |
| 63 | { | |
| 64 | } | |
| 65 | ||
| 66 | /*------------------------------------------------- | |
| 67 | menu_video_options - handle the video options | |
| 68 | menu | |
| 69 | -------------------------------------------------*/ | |
| 70 | ||
| 71 | void ui_menu_video_options::handle() | |
| 72 | { | |
| 73 | bool changed = false; | |
| 74 | ||
| 75 | /* process the menu */ | |
| 76 | const ui_menu_event *menu_event = process(0); | |
| 77 | if (menu_event != NULL && menu_event->itemref != NULL) | |
| 78 | { | |
| 79 | switch ((FPTR)menu_event->itemref) | |
| 80 | { | |
| 81 | /* rotate adds rotation depending on the direction */ | |
| 82 | case VIDEO_ITEM_ROTATE: | |
| 83 | if (menu_event->iptkey == IPT_UI_LEFT || menu_event->iptkey == IPT_UI_RIGHT) | |
| 84 | { | |
| 85 | int delta = (menu_event->iptkey == IPT_UI_LEFT) ? ROT270 : ROT90; | |
| 86 | target->set_orientation(orientation_add(delta, target->orientation())); | |
| 87 | if (target->is_ui_target()) | |
| 88 | { | |
| 89 | render_container::user_settings settings; | |
| 90 | container->get_user_settings(settings); | |
| 91 | settings.m_orientation = orientation_add(delta ^ ROT180, settings.m_orientation); | |
| 92 | container->set_user_settings(settings); | |
| 93 | } | |
| 94 | changed = true; | |
| 95 | } | |
| 96 | break; | |
| 97 | ||
| 98 | /* layer config bitmasks handle left/right keys the same (toggle) */ | |
| 99 | case VIDEO_ITEM_BACKDROPS: | |
| 100 | if (menu_event->iptkey == IPT_UI_LEFT || menu_event->iptkey == IPT_UI_RIGHT) | |
| 101 | { | |
| 102 | target->set_backdrops_enabled(!target->backdrops_enabled()); | |
| 103 | changed = true; | |
| 104 | } | |
| 105 | break; | |
| 106 | ||
| 107 | case VIDEO_ITEM_OVERLAYS: | |
| 108 | if (menu_event->iptkey == IPT_UI_LEFT || menu_event->iptkey == IPT_UI_RIGHT) | |
| 109 | { | |
| 110 | target->set_overlays_enabled(!target->overlays_enabled()); | |
| 111 | changed = true; | |
| 112 | } | |
| 113 | break; | |
| 114 | ||
| 115 | case VIDEO_ITEM_BEZELS: | |
| 116 | if (menu_event->iptkey == IPT_UI_LEFT || menu_event->iptkey == IPT_UI_RIGHT) | |
| 117 | { | |
| 118 | target->set_bezels_enabled(!target->bezels_enabled()); | |
| 119 | changed = true; | |
| 120 | } | |
| 121 | break; | |
| 122 | ||
| 123 | case VIDEO_ITEM_CPANELS: | |
| 124 | if (menu_event->iptkey == IPT_UI_LEFT || menu_event->iptkey == IPT_UI_RIGHT) | |
| 125 | { | |
| 126 | target->set_cpanels_enabled(!target->cpanels_enabled()); | |
| 127 | changed = true; | |
| 128 | } | |
| 129 | break; | |
| 130 | ||
| 131 | case VIDEO_ITEM_MARQUEES: | |
| 132 | if (menu_event->iptkey == IPT_UI_LEFT || menu_event->iptkey == IPT_UI_RIGHT) | |
| 133 | { | |
| 134 | target->set_marquees_enabled(!target->marquees_enabled()); | |
| 135 | changed = true; | |
| 136 | } | |
| 137 | break; | |
| 138 | ||
| 139 | case VIDEO_ITEM_ZOOM: | |
| 140 | if (menu_event->iptkey == IPT_UI_LEFT || menu_event->iptkey == IPT_UI_RIGHT) | |
| 141 | { | |
| 142 | target->set_zoom_to_screen(!target->zoom_to_screen()); | |
| 143 | changed = true; | |
| 144 | } | |
| 145 | break; | |
| 146 | ||
| 147 | /* anything else is a view item */ | |
| 148 | default: | |
| 149 | if (menu_event->iptkey == IPT_UI_SELECT && (int)(FPTR)menu_event->itemref >= VIDEO_ITEM_VIEW) | |
| 150 | { | |
| 151 | target->set_view((FPTR)menu_event->itemref - VIDEO_ITEM_VIEW); | |
| 152 | changed = true; | |
| 153 | } | |
| 154 | break; | |
| 155 | } | |
| 156 | } | |
| 157 | ||
| 158 | /* if something changed, rebuild the menu */ | |
| 159 | if (changed) | |
| 160 | reset(UI_MENU_RESET_REMEMBER_REF); | |
| 161 | } | |
| 162 | ||
| 163 | ||
| 164 | /*------------------------------------------------- | |
| 165 | menu_video_options_populate - populate the | |
| 166 | video options menu | |
| 167 | -------------------------------------------------*/ | |
| 168 | ||
| 169 | ui_menu_video_options::ui_menu_video_options(running_machine &machine, render_container *container, render_target *_target) : ui_menu(machine, container) | |
| 170 | { | |
| 171 | target = _target; | |
| 172 | } | |
| 173 | ||
| 174 | void ui_menu_video_options::populate() | |
| 175 | { | |
| 176 | const char *subtext = ""; | |
| 177 | astring tempstring; | |
| 178 | int viewnum; | |
| 179 | int enabled; | |
| 180 | ||
| 181 | /* add items for each view */ | |
| 182 | for (viewnum = 0; ; viewnum++) | |
| 183 | { | |
| 184 | const char *name = target->view_name(viewnum); | |
| 185 | if (name == NULL) | |
| 186 | break; | |
| 187 | ||
| 188 | /* create a string for the item, replacing underscores with spaces */ | |
| 189 | tempstring.cpy(name).replace(0, "_", " "); | |
| 190 | item_append(tempstring, NULL, 0, (void *)(FPTR)(VIDEO_ITEM_VIEW + viewnum)); | |
| 191 | } | |
| 192 | ||
| 193 | /* add a separator */ | |
| 194 | item_append(MENU_SEPARATOR_ITEM, NULL, 0, NULL); | |
| 195 | ||
| 196 | /* add a rotate item */ | |
| 197 | switch (target->orientation()) | |
| 198 | { | |
| 199 | case ROT0: subtext = "None"; break; | |
| 200 | case ROT90: subtext = "CW 90" UTF8_DEGREES; break; | |
| 201 | case ROT180: subtext = "180" UTF8_DEGREES; break; | |
| 202 | case ROT270: subtext = "CCW 90" UTF8_DEGREES; break; | |
| 203 | } | |
| 204 | item_append("Rotate", subtext, MENU_FLAG_LEFT_ARROW | MENU_FLAG_RIGHT_ARROW, (void *)VIDEO_ITEM_ROTATE); | |
| 205 | ||
| 206 | /* backdrop item */ | |
| 207 | enabled = target->backdrops_enabled(); | |
| 208 | item_append("Backdrops", enabled ? "Enabled" : "Disabled", enabled ? MENU_FLAG_LEFT_ARROW : MENU_FLAG_RIGHT_ARROW, (void *)VIDEO_ITEM_BACKDROPS); | |
| 209 | ||
| 210 | /* overlay item */ | |
| 211 | enabled = target->overlays_enabled(); | |
| 212 | item_append("Overlays", enabled ? "Enabled" : "Disabled", enabled ? MENU_FLAG_LEFT_ARROW : MENU_FLAG_RIGHT_ARROW, (void *)VIDEO_ITEM_OVERLAYS); | |
| 213 | ||
| 214 | /* bezel item */ | |
| 215 | enabled = target->bezels_enabled(); | |
| 216 | item_append("Bezels", enabled ? "Enabled" : "Disabled", enabled ? MENU_FLAG_LEFT_ARROW : MENU_FLAG_RIGHT_ARROW, (void *)VIDEO_ITEM_BEZELS); | |
| 217 | ||
| 218 | /* cpanel item */ | |
| 219 | enabled = target->cpanels_enabled(); | |
| 220 | item_append("CPanels", enabled ? "Enabled" : "Disabled", enabled ? MENU_FLAG_LEFT_ARROW : MENU_FLAG_RIGHT_ARROW, (void *)VIDEO_ITEM_CPANELS); | |
| 221 | ||
| 222 | /* marquee item */ | |
| 223 | enabled = target->marquees_enabled(); | |
| 224 | item_append("Marquees", enabled ? "Enabled" : "Disabled", enabled ? MENU_FLAG_LEFT_ARROW : MENU_FLAG_RIGHT_ARROW, (void *)VIDEO_ITEM_MARQUEES); | |
| 225 | ||
| 226 | /* cropping */ | |
| 227 | enabled = target->zoom_to_screen(); | |
| 228 | item_append("View", enabled ? "Cropped" : "Full", enabled ? MENU_FLAG_RIGHT_ARROW : MENU_FLAG_LEFT_ARROW, (void *)VIDEO_ITEM_ZOOM); | |
| 229 | } | |
| 230 | ||
| 231 | ui_menu_video_options::~ui_menu_video_options() | |
| 232 | { | |
| 233 | } |
| r243192 | r243193 | |
|---|---|---|
| 1 | /*************************************************************************** | |
| 2 | ||
| 3 | ui/videoopt.h | |
| 4 | ||
| 5 | Internal menus for video options | |
| 6 | ||
| 7 | Copyright Nicola Salmoria and the MAME Team. | |
| 8 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 9 | ||
| 10 | ***************************************************************************/ | |
| 11 | ||
| 12 | #pragma once | |
| 13 | ||
| 14 | #ifndef __UI_VIDEOOPT_H__ | |
| 15 | #define __UI_VIDEOOPT_H__ | |
| 16 | ||
| 17 | ||
| 18 | class ui_menu_video_targets : public ui_menu { | |
| 19 | public: | |
| 20 | ui_menu_video_targets(running_machine &machine, render_container *container); | |
| 21 | virtual ~ui_menu_video_targets(); | |
| 22 | virtual void populate(); | |
| 23 | virtual void handle(); | |
| 24 | }; | |
| 25 | ||
| 26 | class ui_menu_video_options : public ui_menu { | |
| 27 | public: | |
| 28 | ui_menu_video_options(running_machine &machine, render_container *container, render_target *target); | |
| 29 | virtual ~ui_menu_video_options(); | |
| 30 | virtual void populate(); | |
| 31 | virtual void handle(); | |
| 32 | ||
| 33 | private: | |
| 34 | enum { | |
| 35 | VIDEO_ITEM_ROTATE = 0x80000000, | |
| 36 | VIDEO_ITEM_BACKDROPS, | |
| 37 | VIDEO_ITEM_OVERLAYS, | |
| 38 | VIDEO_ITEM_BEZELS, | |
| 39 | VIDEO_ITEM_CPANELS, | |
| 40 | VIDEO_ITEM_MARQUEES, | |
| 41 | VIDEO_ITEM_ZOOM, | |
| 42 | VIDEO_ITEM_VIEW | |
| 43 | }; | |
| 44 | ||
| 45 | render_target *target; | |
| 46 | }; | |
| 47 | ||
| 48 | ||
| 49 | #endif /* __UI_VIDEOOPT_H__ */ |
| r243192 | r243193 | |
|---|---|---|
| 14 | 14 | - Display mode 1 (text) |
| 15 | 15 | - Display mode 3 (multicolor) |
| 16 | 16 | - Sprite doubling bug of the 315-5124 chip |
| 17 | - Verify timing on the Game Gear (315-5378 chip) | |
| 18 | 17 | |
| 19 | 18 | |
| 20 | 19 | SMS Display Timing |
| r243192 | r243193 | |
| 344 | 343 | rec.min_x = SEGA315_5124_LBORDER_START; |
| 345 | 344 | rec.max_x = SEGA315_5124_LBORDER_START + SEGA315_5124_LBORDER_WIDTH - 1; |
| 346 | 345 | m_tmpbitmap.fill(m_palette->pen(m_current_palette[BACKDROP_COLOR]), rec); |
| 347 | m_y1_bitmap.fill( | |
| 346 | m_y1_bitmap.fill(1, rec); | |
| 348 | 347 | } |
| 349 | 348 | break; |
| 350 | 349 | |
| r243192 | r243193 | |
| 359 | 358 | rec.min_x = SEGA315_5124_LBORDER_START + SEGA315_5124_LBORDER_WIDTH + 256; |
| 360 | 359 | rec.max_x = rec.min_x + SEGA315_5124_RBORDER_WIDTH - 1; |
| 361 | 360 | m_tmpbitmap.fill(m_palette->pen(m_current_palette[BACKDROP_COLOR]), rec); |
| 362 | m_y1_bitmap.fill( | |
| 361 | m_y1_bitmap.fill(1, rec); | |
| 363 | 362 | } |
| 364 | 363 | break; |
| 365 | 364 | |
| r243192 | r243193 | |
| 848 | 847 | //logerror("%x %x\n", pixel_plot_x, line); |
| 849 | 848 | if (tile_column == 0 && (x_scroll & 0x07)) |
| 850 | 849 | { |
| 851 | /* when the first column hasn't completely entered in the screen, its | |
| 852 | background is filled only with color #0 of the selected palette */ | |
| 853 | line_buffer[pixel_plot_x] = m_current_palette[palette_selected ? 0x10 : 0x00]; | |
| 854 | priority_selected[pixel_plot_x] = priority_select; | |
| 850 | /* the VDP only draws the first column when it has completely entered | |
| 851 | in the screen, else it is filled with the sprite pattern #0 */ | |
| 852 | line_buffer[pixel_plot_x] = m_current_palette[0x10]; | |
| 855 | 853 | } |
| 856 | 854 | else |
| 857 | 855 | { |
| 858 | 856 | line_buffer[pixel_plot_x] = m_current_palette[pen_selected]; |
| 859 | priority_selected[pixel_plot_x] = priority_select | (pen_selected & 0x0f); | |
| 860 | 857 | } |
| 858 | priority_selected[pixel_plot_x] = priority_select | (pen_selected & 0x0f); | |
| 861 | 859 | } |
| 862 | 860 | } |
| 863 | 861 | } |
| r243192 | r243193 | |
| 1014 | 1012 | |
| 1015 | 1013 | m_sprite_count = max_sprites; |
| 1016 | 1014 | |
| 1017 | /* Overflow is flagged only on active display and when VINT isn't active */ | |
| 1018 | if (!(m_status & STATUS_VINT) && line >= 0 && line < m_frame_timing[ACTIVE_DISPLAY_V]) | |
| 1015 | if (line >= 0 && line < m_frame_timing[ACTIVE_DISPLAY_V]) | |
| 1019 | 1016 | { |
| 1020 | 1017 | m_pending_status |= STATUS_SPROVR; |
| 1021 | 1018 | } |
| r243192 | r243193 | |
| 1033 | 1030 | if (m_display_disabled || m_sprite_count == 0) |
| 1034 | 1031 | return; |
| 1035 | 1032 | |
| 1036 | /* Sprites aren't drawn and collisions don't occur on column 0 if it is disabled. | |
| 1037 | Note: On Megadrive/Genesis VDP, collisions occur on the disabled column 0. */ | |
| 1033 | /* Sprites aren't drawn and collisions don't occur on column 0 if it is disabled */ | |
| 1038 | 1034 | if (m_reg[0x00] & 0x20) |
| 1039 | 1035 | plot_min_x = 8; |
| 1040 | 1036 | |
| r243192 | r243193 | |
| 1088 | 1084 | continue; |
| 1089 | 1085 | } |
| 1090 | 1086 | |
| 1091 | /* Draw sprite pixel */ | |
| 1092 | /* Check if the background has lower priority */ | |
| 1093 | 1087 | if (!(priority_selected[pixel_plot_x] & PRIORITY_BIT)) |
| 1094 | 1088 | { |
| 1095 | 1089 | line_buffer[pixel_plot_x] = m_current_palette[pen_selected]; |
| r243192 | r243193 | |
| 1302 | 1296 | |
| 1303 | 1297 | if ( line < m_frame_timing[ACTIVE_DISPLAY_V] ) |
| 1304 | 1298 | { |
| 1305 | memset(priority_selected, 1, sizeof(priority_selected)); | |
| 1306 | ||
| 1307 | 1299 | switch( m_vdp_mode ) |
| 1308 | 1300 | { |
| 1309 | 1301 | case 0: |
| 1302 | memset(priority_selected, 1, sizeof(priority_selected)); | |
| 1310 | 1303 | if ( line >= 0 ) |
| 1311 | 1304 | { |
| 1312 | 1305 | draw_scanline_mode0( blitline_buffer, line ); |
| r243192 | r243193 | |
| 1318 | 1311 | break; |
| 1319 | 1312 | |
| 1320 | 1313 | case 2: |
| 1314 | memset(priority_selected, 1, sizeof(priority_selected)); | |
| 1321 | 1315 | if ( line >= 0 ) |
| 1322 | 1316 | { |
| 1323 | 1317 | draw_scanline_mode2( blitline_buffer, line ); |
| r243192 | r243193 | |
| 1330 | 1324 | |
| 1331 | 1325 | case 4: |
| 1332 | 1326 | default: |
| 1327 | memset(priority_selected, 0, sizeof(priority_selected)); | |
| 1333 | 1328 | if ( line >= 0 ) |
| 1334 | 1329 | { |
| 1335 | 1330 | draw_scanline_mode4( blitline_buffer, priority_selected, line ); |
| r243192 | r243193 | |
| 1351 | 1346 | rec.min_x = pixel_offset_x; |
| 1352 | 1347 | rec.max_x = pixel_offset_x + 255; |
| 1353 | 1348 | m_tmpbitmap.fill(m_palette->pen(m_current_palette[BACKDROP_COLOR]), rec); |
| 1354 | m_y1_bitmap.fill( | |
| 1349 | m_y1_bitmap.fill(1, rec); | |
| 1355 | 1350 | } |
| 1356 | 1351 | else |
| 1357 | 1352 | { |
| r243192 | r243193 | |
| 1366 | 1361 | UINT8 *p_y1 = &m_y1_bitmap.pix8(pixel_plot_y + line, pixel_offset_x); |
| 1367 | 1362 | int x = 0; |
| 1368 | 1363 | |
| 1369 | if (m_vdp_mode == 4 && | |
| 1364 | if (m_vdp_mode == 4 && m_reg[0x00] & 0x20) | |
| 1370 | 1365 | { |
| 1371 | 1366 | /* Fill column 0 with overscan color from m_reg[0x07] */ |
| 1372 | 1367 | do |
| 1373 | 1368 | { |
| 1374 | 1369 | p_bitmap[x] = m_palette->pen(m_current_palette[BACKDROP_COLOR]); |
| 1375 | p_y1[x] = | |
| 1370 | p_y1[x] = 1; | |
| 1376 | 1371 | } |
| 1377 | 1372 | while(++x < 8); |
| 1378 | 1373 | } |
| r243192 | r243193 | |
| 1380 | 1375 | do |
| 1381 | 1376 | { |
| 1382 | 1377 | p_bitmap[x] = m_palette->pen(line_buffer[x]); |
| 1383 | p_y1[x] = ( priority_selected[x] & 0x0f ) ? | |
| 1378 | p_y1[x] = ( priority_selected[x] & 0x0f ) ? 0 : 1; | |
| 1384 | 1379 | } |
| 1385 | 1380 | while(++x < 256); |
| 1386 | 1381 | } |
| r243192 | r243193 | |
| 1402 | 1397 | do |
| 1403 | 1398 | { |
| 1404 | 1399 | p_bitmap[x] = m_palette->pen(m_current_palette[BACKDROP_COLOR]); |
| 1405 | p_y1[x] = | |
| 1400 | p_y1[x] = 1; // not verified | |
| 1406 | 1401 | } |
| 1407 | 1402 | while (++x < 48); |
| 1408 | 1403 | |
| r243192 | r243193 | |
| 1411 | 1406 | do |
| 1412 | 1407 | { |
| 1413 | 1408 | p_bitmap[x] = m_palette->pen(line_buffer[x]); |
| 1414 | p_y1[x] = ( priority_selected[x] & 0x0f ) ? | |
| 1409 | p_y1[x] = ( priority_selected[x] & 0x0f ) ? 0 : 1; | |
| 1415 | 1410 | } |
| 1416 | 1411 | while (++x < 208); |
| 1417 | 1412 | } |
| r243192 | r243193 | |
| 1421 | 1416 | do |
| 1422 | 1417 | { |
| 1423 | 1418 | p_bitmap[x] = m_palette->pen(m_current_palette[BACKDROP_COLOR]); |
| 1424 | p_y1[x] = | |
| 1419 | p_y1[x] = 1; // not verified | |
| 1425 | 1420 | } |
| 1426 | 1421 | while (++x < 208); |
| 1427 | 1422 | } |
| r243192 | r243193 | |
| 1430 | 1425 | do |
| 1431 | 1426 | { |
| 1432 | 1427 | p_bitmap[x] = m_palette->pen(m_current_palette[BACKDROP_COLOR]); |
| 1433 | p_y1[x] = | |
| 1428 | p_y1[x] = 1; // not verified | |
| 1434 | 1429 | } |
| 1435 | 1430 | while (++x < 256); |
| 1436 | 1431 | } |
| r243192 | r243193 | |
|---|---|---|
| 2001 | 2001 | void h63484_device::device_start() |
| 2002 | 2002 | { |
| 2003 | 2003 | m_display_cb.bind_relative_to(*owner()); |
| 2004 | ||
| 2005 | register_save_state(); | |
| 2006 | 2004 | } |
| 2007 | 2005 | |
| 2008 | 2006 | //------------------------------------------------- |
| r243192 | r243193 | |
| 2127 | 2125 | } |
| 2128 | 2126 | return 0; |
| 2129 | 2127 | } |
| 2130 | ||
| 2131 | void h63484_device::register_save_state() | |
| 2132 | { | |
| 2133 | save_item(NAME(m_ar)); | |
| 2134 | save_item(NAME(m_vreg)); | |
| 2135 | save_item(NAME(m_sr)); | |
| 2136 | save_item(NAME(m_fifo)); | |
| 2137 | save_item(NAME(m_fifo_ptr)); | |
| 2138 | save_item(NAME(m_fifo_r)); | |
| 2139 | save_item(NAME(m_fifo_r_ptr)); | |
| 2140 | save_item(NAME(m_cr)); | |
| 2141 | save_item(NAME(m_pr)); | |
| 2142 | save_item(NAME(m_param_ptr)); | |
| 2143 | save_item(NAME(m_rwp)); | |
| 2144 | save_item(NAME(m_rwp_dn)); | |
| 2145 | save_item(NAME(m_org_dpa)); | |
| 2146 | save_item(NAME(m_org_dn)); | |
| 2147 | save_item(NAME(m_org_dpd)); | |
| 2148 | save_item(NAME(m_cl0)); | |
| 2149 | save_item(NAME(m_cl1)); | |
| 2150 | save_item(NAME(m_ccmp)); | |
| 2151 | save_item(NAME(m_mask)); | |
| 2152 | save_item(NAME(m_cpx)); | |
| 2153 | save_item(NAME(m_cpy)); | |
| 2154 | save_item(NAME(m_mwr)); | |
| 2155 | save_item(NAME(m_mwr_chr)); | |
| 2156 | save_item(NAME(m_sar)); | |
| 2157 | save_item(NAME(m_sda)); | |
| 2158 | save_item(NAME(m_pram)); | |
| 2159 | save_item(NAME(m_dn)); | |
| 2160 | save_item(NAME(m_ccr)); | |
| 2161 | save_item(NAME(m_omr)); | |
| 2162 | save_item(NAME(m_edg)); | |
| 2163 | save_item(NAME(m_dcr)); | |
| 2164 | save_item(NAME(m_hc)); | |
| 2165 | save_item(NAME(m_hds)); | |
| 2166 | save_item(NAME(m_hdw)); | |
| 2167 | save_item(NAME(m_hws)); | |
| 2168 | save_item(NAME(m_hww)); | |
| 2169 | save_item(NAME(m_sp)); | |
| 2170 | save_item(NAME(m_hsw)); | |
| 2171 | save_item(NAME(m_vc)); | |
| 2172 | save_item(NAME(m_vws)); | |
| 2173 | save_item(NAME(m_vww)); | |
| 2174 | save_item(NAME(m_vds)); | |
| 2175 | save_item(NAME(m_vsw)); | |
| 2176 | save_item(NAME(m_ppy)); | |
| 2177 | save_item(NAME(m_pzcy)); | |
| 2178 | save_item(NAME(m_ppx)); | |
| 2179 | save_item(NAME(m_pzcx)); | |
| 2180 | save_item(NAME(m_psx)); | |
| 2181 | save_item(NAME(m_pex)); | |
| 2182 | save_item(NAME(m_pzx)); | |
| 2183 | save_item(NAME(m_psy)); | |
| 2184 | save_item(NAME(m_pzy)); | |
| 2185 | save_item(NAME(m_pey)); | |
| 2186 | save_item(NAME(m_xmin)); | |
| 2187 | save_item(NAME(m_ymin)); | |
| 2188 | save_item(NAME(m_xmax)); | |
| 2189 | save_item(NAME(m_ymax)); | |
| 2190 | } |
| r243192 | r243193 | |
|---|---|---|
| 108 | 108 | int translate_command(UINT16 data); |
| 109 | 109 | void draw_graphics_line(bitmap_ind16 &bitmap, const rectangle &cliprect, int vs, int y, int layer_n, bool active, bool ins_window); |
| 110 | 110 | |
| 111 | void register_save_state(); | |
| 112 | ||
| 113 | 111 | h63484_display_delegate m_display_cb; |
| 114 | 112 | |
| 115 | 113 | UINT8 m_ar; |
| r243192 | r243193 | |
|---|---|---|
| 32 | 32 | ~astring(); |
| 33 | 33 | |
| 34 | 34 | // construction with copy |
| 35 | astring(const char *string) { init() | |
| 35 | astring(const char *string) { init().cpy(string); } | |
| 36 | 36 | astring(const char *string, int length) { init().cpy(string, length); } |
| 37 | 37 | astring(const char *str1, const char *str2) { init().cpy(str1).cat(str2); } |
| 38 | 38 | astring(const char *str1, const char *str2, const char *str3) { init().cpy(str1).cat(str2).cat(str3); } |
| r243192 | r243193 | |
|---|---|---|
| 100 | 100 | void resize_keep_and_clear_new(int count, UINT8 data = 0) { int oldcount = m_count; resize_keep(count); if (oldcount < m_count) clear_internal(oldcount, m_count - oldcount, data); } |
| 101 | 101 | |
| 102 | 102 | // batch operations |
| 103 | void copyfrom(const dynamic_array<_ElementType> &source) | |
| 104 | { | |
| 105 | resize(source.count()); | |
| 106 | for (int i=0; i < source.count(); i++) | |
| 107 | m_array[i] = source[i]; | |
| 108 | } | |
| 103 | void copyfrom(const dynamic_array<_ElementType> &source) | |
| 104 | { | |
| 105 | resize(source.count()); | |
| 106 | for (int i=0; i < source.count(); i++) | |
| 107 | m_array[i] = source[i]; | |
| 108 | } | |
| 109 | 109 | |
| 110 | 110 | private: |
| 111 | 111 | // internal helpers |
| r243192 | r243193 | |
|---|---|---|
| 171 | 171 | // entry list getters |
| 172 | 172 | const rgb_t *entry_list_raw() const { return m_entry_color; } |
| 173 | 173 | const dynamic_array<rgb_t> *entry_list_adjusted_darray() const { return &m_adjusted_color; } |
| 174 | ||
| 174 | const rgb_t *entry_list_adjusted() const { return m_adjusted_color; } | |
| 175 | 175 | const rgb_t *entry_list_adjusted_rgb15() const { return m_adjusted_rgb15; } |
| 176 | 176 | |
| 177 | 177 | // group adjustments |
| r243192 | r243193 | |
|---|---|---|
| 46 | 46 | /* ---------------------------------------------------------------------- */ |
| 47 | 47 | static NETLIST_START(nl_mario_snd0) |
| 48 | 48 | |
| 49 | RES(R17, RES_K(27)) /* 20 according to parts list */ | |
| 50 | /* 27 verified, 30K in schematics */ | |
| 51 | CAP(C14, CAP_U(4.7)) /* verified */ | |
| 49 | RES(R17, RES_K(27)) /* 20 according to parts list */ | |
| 50 | /* 27 verified, 30K in schematics */ | |
| 51 | CAP(C14, CAP_U(4.7)) /* verified */ | |
| 52 | 52 | |
| 53 | TTL_74123(2H_A) | |
| 54 | NET_C(2H_A.VCC, V5) | |
| 55 | NET_C(2H_A.GND, GND) | |
| 56 | NET_C(SOUND0.Q, 2H_A.B) | |
| 57 | NET_C(GND, 2H_A.A) | |
| 58 | NET_C(2H_A.CLRQ, ttlhigh) /* NOT IN SCHEMATICS */ | |
| 59 | DIODE(D1, "1N4148") /* FIXME: try to identify */ | |
| 60 | TTL_7404_INVERT(1H_A, 2H_A.QQ) | |
| 61 | NET_C(R17.1, V5) | |
| 62 | NET_C(R17.2, D1.A, C14.1) | |
| 63 | NET_C(D1.K, 2H_A.RC) | |
| 64 | NET_C(C14.2, 2H_A.C) | |
| 53 | TTL_74123(2H_A) | |
| 54 | NET_C(2H_A.VCC, V5) | |
| 55 | NET_C(2H_A.GND, GND) | |
| 56 | NET_C(SOUND0.Q, 2H_A.B) | |
| 57 | NET_C(GND, 2H_A.A) | |
| 58 | NET_C(2H_A.CLRQ, ttlhigh) /* NOT IN SCHEMATICS */ | |
| 59 | DIODE(D1, "1N4148") /* FIXME: try to identify */ | |
| 60 | TTL_7404_INVERT(1H_A, 2H_A.QQ) | |
| 61 | NET_C(R17.1, V5) | |
| 62 | NET_C(R17.2, D1.A, C14.1) | |
| 63 | NET_C(D1.K, 2H_A.RC) | |
| 64 | NET_C(C14.2, 2H_A.C) | |
| 65 | 65 | |
| 66 | RES(R6, RES_K(4.7)) /* verified */ | |
| 67 | CAP(C3, CAP_U(10)) /* verified */ | |
| 66 | RES(R6, RES_K(4.7)) /* verified */ | |
| 67 | CAP(C3, CAP_U(10)) /* verified */ | |
| 68 | 68 | |
| 69 | NET_C(1H_A.Q, R6.1) | |
| 70 | NET_C(R6.2, C3.1, 1J_A.FC) | |
| 71 | NET_C(R6.2, 2J_A.FC) | |
| 72 | NET_C(C3.2, GND) | |
| 69 | NET_C(1H_A.Q, R6.1) | |
| 70 | NET_C(R6.2, C3.1, 1J_A.FC) | |
| 71 | NET_C(R6.2, 2J_A.FC) | |
| 72 | NET_C(C3.2, GND) | |
| 73 | 73 | |
| 74 | ||
| 74 | //#define MR_C6 CAP_N(3.9) /* verified */ | |
| 75 | 75 | |
| 76 | SN74LS629(1J_A, CAP_N(3.9)) | |
| 77 | NET_C(1J_A.RNG, V5) | |
| 78 | NET_C(1J_A.ENQ, ttllow) | |
| 79 | NET_C(GND, 1J_A.GND) | |
| 76 | SN74LS629(1J_A, CAP_N(3.9)) | |
| 77 | NET_C(1J_A.RNG, V5) | |
| 78 | NET_C(1J_A.ENQ, ttllow) | |
| 79 | NET_C(GND, 1J_A.GND) | |
| 80 | 80 | |
| 81 | ||
| 81 | //#define MR_C17 CAP_N(22) /* verified */ | |
| 82 | 82 | |
| 83 | SN74LS629(2J_A, CAP_N(22)) | |
| 84 | NET_C(2J_A.RNG, V5) | |
| 85 | NET_C(2J_A.ENQ, ttllow) | |
| 86 | NET_C(GND, 2J_A.GND) | |
| 83 | SN74LS629(2J_A, CAP_N(22)) | |
| 84 | NET_C(2J_A.RNG, V5) | |
| 85 | NET_C(2J_A.ENQ, ttllow) | |
| 86 | NET_C(GND, 2J_A.GND) | |
| 87 | 87 | |
| 88 | TTL_7486_XOR(1K_A, 1J_A.Y, 2J_A.Y) | |
| 89 | TTL_7408_AND(2K_A, 2H_A.Q, 1K_A) | |
| 88 | TTL_7486_XOR(1K_A, 1J_A.Y, 2J_A.Y) | |
| 89 | TTL_7408_AND(2K_A, 2H_A.Q, 1K_A) | |
| 90 | 90 | NETLIST_END() |
| 91 | 91 | |
| 92 | 92 | /* ---------------------------------------------------------------------- */ |
| r243192 | r243193 | |
| 96 | 96 | // FIXME: Diodes are 1S953 |
| 97 | 97 | static NETLIST_START(nl_mario_snd7) |
| 98 | 98 | |
| 99 | RES(R61, RES_K(47)) | |
| 100 | CAP(C41, CAP_U(4.7)) /* verified */ | |
| 99 | RES(R61, RES_K(47)) | |
| 100 | CAP(C41, CAP_U(4.7)) /* verified */ | |
| 101 | 101 | |
| 102 | TTL_74123(4L_A) | |
| 103 | NET_C(4L_A.VCC, V5) | |
| 104 | NET_C(4L_A.GND, GND) | |
| 105 | NET_C(SOUND7.Q, 4L_A.B) | |
| 106 | NET_C(GND, 4L_A.A) | |
| 107 | NET_C(4L_A.CLRQ, ttlhigh) /* NOT IN SCHEMATICS */ | |
| 108 | DIODE(D10, "1N4148") /* FIXME: try to identify */ | |
| 109 | TTL_7404_INVERT(4J_A, 4L_A.Q) | |
| 110 | NET_C(R61.1, V5) | |
| 111 | NET_C(R61.2, D10.A, C41.1) | |
| 112 | NET_C(D10.K, 4L_A.RC) | |
| 113 | NET_C(C41.2, 4L_A.C) | |
| 102 | TTL_74123(4L_A) | |
| 103 | NET_C(4L_A.VCC, V5) | |
| 104 | NET_C(4L_A.GND, GND) | |
| 105 | NET_C(SOUND7.Q, 4L_A.B) | |
| 106 | NET_C(GND, 4L_A.A) | |
| 107 | NET_C(4L_A.CLRQ, ttlhigh) /* NOT IN SCHEMATICS */ | |
| 108 | DIODE(D10, "1N4148") /* FIXME: try to identify */ | |
| 109 | TTL_7404_INVERT(4J_A, 4L_A.Q) | |
| 110 | NET_C(R61.1, V5) | |
| 111 | NET_C(R61.2, D10.A, C41.1) | |
| 112 | NET_C(D10.K, 4L_A.RC) | |
| 113 | NET_C(C41.2, 4L_A.C) | |
| 114 | 114 | |
| 115 | RES(R65, RES_K(10)) | |
| 116 | CAP(C44, CAP_U(3.3)) /* verified */ | |
| 115 | RES(R65, RES_K(10)) | |
| 116 | CAP(C44, CAP_U(3.3)) /* verified */ | |
| 117 | 117 | |
| 118 | SN74LS629(4K_A, CAP_U(0.022)) | |
| 119 | NET_C(4K_A.RNG, V5) | |
| 120 | NET_C(4K_A.ENQ, ttllow) | |
| 121 | NET_C(GND, 4K_A.GND) | |
| 122 | NET_C(R65.1, 4J_A.Q) | |
| 123 | NET_C(R65.2, 4K_A.FC, C44.1) | |
| 124 | NET_C(C44.2, GND) | |
| 118 | SN74LS629(4K_A, CAP_U(0.022)) | |
| 119 | NET_C(4K_A.RNG, V5) | |
| 120 | NET_C(4K_A.ENQ, ttllow) | |
| 121 | NET_C(GND, 4K_A.GND) | |
| 122 | NET_C(R65.1, 4J_A.Q) | |
| 123 | NET_C(R65.2, 4K_A.FC, C44.1) | |
| 124 | NET_C(C44.2, GND) | |
| 125 | 125 | |
| 126 | CD_4020(3H, 4K_B.Y, ttllow, V5, GND) | |
| 127 | TTL_7404_INVERT(4J_B, 3H.Q12) | |
| 126 | CD_4020(3H, 4K_B.Y, ttllow, V5, GND) | |
| 127 | TTL_7404_INVERT(4J_B, 3H.Q12) | |
| 128 | 128 | |
| 129 | RES(R64, RES_K(20)) | |
| 130 | CAP(C43, CAP_U(3.3)) /* verified */ | |
| 129 | RES(R64, RES_K(20)) | |
| 130 | CAP(C43, CAP_U(3.3)) /* verified */ | |
| 131 | 131 | |
| 132 | SN74LS629(4K_B, CAP_U(0.0047)) | |
| 133 | NET_C(4K_B.RNG, V5) | |
| 134 | NET_C(4K_B.ENQ, ttllow) | |
| 135 | NET_C(GND, 4K_B.GND) | |
| 136 | NET_C(R64.1, 4J_B.Q) | |
| 137 | NET_C(R64.2, 4K_B.FC, C43.1) | |
| 138 | NET_C(C43.2, GND) | |
| 132 | SN74LS629(4K_B, CAP_U(0.0047)) | |
| 133 | NET_C(4K_B.RNG, V5) | |
| 134 | NET_C(4K_B.ENQ, ttllow) | |
| 135 | NET_C(GND, 4K_B.GND) | |
| 136 | NET_C(R64.1, 4J_B.Q) | |
| 137 | NET_C(R64.2, 4K_B.FC, C43.1) | |
| 138 | NET_C(C43.2, GND) | |
| 139 | 139 | |
| 140 | TTL_7486_XOR(1K_C, 3H.Q4, 4K_A.Y) | |
| 141 | TTL_7408_AND(2K_C, 4L_A.Q, 1K_C) | |
| 140 | TTL_7486_XOR(1K_C, 3H.Q4, 4K_A.Y) | |
| 141 | TTL_7408_AND(2K_C, 4L_A.Q, 1K_C) | |
| 142 | 142 | |
| 143 | 143 | NETLIST_END() |
| 144 | 144 | |
| r243192 | r243193 | |
| 146 | 146 | /* DAC sound */ |
| 147 | 147 | /* ---------------------------------------------------------------------- */ |
| 148 | 148 | static NETLIST_START(nl_mario_dac) |
| 149 | RES(R34, RES_M(2)) | |
| 150 | RES(R35, RES_M(1)) | |
| 151 | RES(R36, RES_M(1.8)) | |
| 152 | LM3900(3M_1) | |
| 153 | NET_C(3M_1.VM, GND) | |
| 154 | NET_C(3M_1.VP, V5) | |
| 149 | RES(R34, RES_M(2)) | |
| 150 | RES(R35, RES_M(1)) | |
| 151 | RES(R36, RES_M(1.8)) | |
| 152 | LM3900(3M_1) | |
| 153 | NET_C(3M_1.VM, GND) | |
| 154 | NET_C(3M_1.VP, V5) | |
| 155 | 155 | |
| 156 | NET_C(DAC.VOUT, R34.1) | |
| 157 | NET_C(3M_1.MINUS, R34.2, R35.2) | |
| 158 | NET_C(3M_1.OUT, R35.1) | |
| 159 | NET_C(3M_1.PLUS, R36.1) | |
| 160 | NET_C(R36.2, GND) | |
| 156 | NET_C(DAC.VOUT, R34.1) | |
| 157 | NET_C(3M_1.MINUS, R34.2, R35.2) | |
| 158 | NET_C(3M_1.OUT, R35.1) | |
| 159 | NET_C(3M_1.PLUS, R36.1) | |
| 160 | NET_C(R36.2, GND) | |
| 161 | 161 | |
| 162 | RES(R21, RES_M(1.8)) | |
| 163 | RES(R23, RES_K(10)) | |
| 164 | RES(R25, RES_K(10)) | |
| 165 | RES(R37, RES_K(750)) | |
| 166 | RES(R38, RES_K(360)) | |
| 167 | RES(R39, RES_K(750)) | |
| 162 | RES(R21, RES_M(1.8)) | |
| 163 | RES(R23, RES_K(10)) | |
| 164 | RES(R25, RES_K(10)) | |
| 165 | RES(R37, RES_K(750)) | |
| 166 | RES(R38, RES_K(360)) | |
| 167 | RES(R39, RES_K(750)) | |
| 168 | 168 | |
| 169 | CAP(C18, CAP_P(100)) | |
| 170 | CAP(C19, CAP_U(10)) | |
| 171 | CAP(C20, CAP_U(1)) | |
| 172 | CAP(C30, CAP_P(100)) | |
| 169 | CAP(C18, CAP_P(100)) | |
| 170 | CAP(C19, CAP_U(10)) | |
| 171 | CAP(C20, CAP_U(1)) | |
| 172 | CAP(C30, CAP_P(100)) | |
| 173 | 173 | |
| 174 | LM3900(3M_2) | |
| 175 | NET_C(3M_2.VM, GND) | |
| 176 | NET_C(3M_2.VP, V5) | |
| 174 | LM3900(3M_2) | |
| 175 | NET_C(3M_2.VM, GND) | |
| 176 | NET_C(3M_2.VP, V5) | |
| 177 | 177 | |
| 178 | NET_C(R35.1, C20.1) | |
| 179 | NET_C(C20.2, R37.1) | |
| 180 | NET_C(R37.2, R38.2, C18.1, R39.2) | |
| 178 | NET_C(R35.1, C20.1) | |
| 179 | NET_C(C20.2, R37.1) | |
| 180 | NET_C(R37.2, R38.2, C18.1, R39.2) | |
| 181 | 181 | |
| 182 | NET_C(C18.2, GND) | |
| 183 | NET_C(R38.1, C30.2, 3M_2.MINUS) | |
| 184 | NET_C(3M_2.OUT, R39.1, C30.1) | |
| 182 | NET_C(C18.2, GND) | |
| 183 | NET_C(R38.1, C30.2, 3M_2.MINUS) | |
| 184 | NET_C(3M_2.OUT, R39.1, C30.1) | |
| 185 | 185 | |
| 186 | NET_C(R21.1, 3M_2.PLUS) | |
| 187 | NET_C(R21.2, C19.1, R25.2, R23.1) | |
| 188 | NET_C(C19.2, R23.2, GND) | |
| 189 | NET_C(R25.1, V5) | |
| 186 | NET_C(R21.1, 3M_2.PLUS) | |
| 187 | NET_C(R21.2, C19.1, R25.2, R23.1) | |
| 188 | NET_C(C19.2, R23.2, GND) | |
| 189 | NET_C(R25.1, V5) | |
| 190 | 190 | NETLIST_END() |
| 191 | 191 | |
| 192 | 192 | static NETLIST_START(nl_mario) |
| 193 | 193 | |
| 194 | ||
| 194 | /* Standard stuff */ | |
| 195 | 195 | |
| 196 | SOLVER(Solver, 48000) | |
| 197 | PARAM(Solver.ACCURACY, 1e-8) | |
| 198 | PARAM(Solver.SOR_FACTOR, 1.0) | |
| 199 | PARAM(Solver.GS_THRESHOLD, 5) | |
| 200 | PARAM(Solver.GS_LOOPS, 4) | |
| 201 | //PARAM(Solver.LTE, 5e-2) // Default is not enough for paddle control | |
| 202 | PARAM(Solver.DYNAMIC_TS, 0) | |
| 203 | ANALOG_INPUT(V5, 5) | |
| 196 | SOLVER(Solver, 48000) | |
| 197 | PARAM(Solver.ACCURACY, 1e-8) | |
| 198 | PARAM(Solver.SOR_FACTOR, 1.0) | |
| 199 | PARAM(Solver.GS_THRESHOLD, 5) | |
| 200 | PARAM(Solver.GS_LOOPS, 4) | |
| 201 | //PARAM(Solver.LTE, 5e-2) // Default is not enough for paddle control | |
| 202 | PARAM(Solver.DYNAMIC_TS, 0) | |
| 203 | ANALOG_INPUT(V5, 5) | |
| 204 | 204 | |
| 205 | TTL_INPUT(SOUND0, 1) | |
| 206 | INCLUDE(nl_mario_snd0) | |
| 205 | TTL_INPUT(SOUND0, 1) | |
| 206 | INCLUDE(nl_mario_snd0) | |
| 207 | 207 | |
| 208 | TTL_INPUT(SOUND7, 1) | |
| 209 | INCLUDE(nl_mario_snd7) | |
| 208 | TTL_INPUT(SOUND7, 1) | |
| 209 | INCLUDE(nl_mario_snd7) | |
| 210 | 210 | |
| 211 | R2R_DAC(DAC, 3.4, 10000.0, 8) | |
| 212 | NET_C(DAC.VGND, GND) | |
| 211 | R2R_DAC(DAC, 3.4, 10000.0, 8) | |
| 212 | NET_C(DAC.VGND, GND) | |
| 213 | 213 | |
| 214 | ||
| 214 | INCLUDE(nl_mario_dac) | |
| 215 | 215 | |
| 216 | /* ---------------------------------------------------------------------- */ | |
| 217 | /* mixing */ | |
| 218 | /* ---------------------------------------------------------------------- */ | |
| 216 | /* ---------------------------------------------------------------------- */ | |
| 217 | /* mixing */ | |
| 218 | /* ---------------------------------------------------------------------- */ | |
| 219 | 219 | |
| 220 | RES(R20, RES_K(22)) /* verified */ | |
| 221 | RES(R19, RES_K(22)) /* verified */ | |
| 222 | RES(R40, RES_K(22)) /* verified */ | |
| 223 | RES(R41, RES_K(100)) /* verified */ | |
| 224 | CAP(C31, CAP_U(0.022)) /* */ | |
| 220 | RES(R20, RES_K(22)) /* verified */ | |
| 221 | RES(R19, RES_K(22)) /* verified */ | |
| 222 | RES(R40, RES_K(22)) /* verified */ | |
| 223 | RES(R41, RES_K(100)) /* verified */ | |
| 224 | CAP(C31, CAP_U(0.022)) /* */ | |
| 225 | 225 | |
| 226 | NET_C(2K_A.Q, R20.1) | |
| 227 | NET_C(GND, R19.1) //FIXME | |
| 228 | NET_C(2K_C.Q, R41.1) | |
| 226 | NET_C(2K_A.Q, R20.1) | |
| 227 | NET_C(GND, R19.1) //FIXME | |
| 228 | NET_C(2K_C.Q, R41.1) | |
| 229 | 229 | |
| 230 | 230 | #if 1 |
| 231 | RES(DUM, RES_K(22)) | |
| 232 | NET_C(R39.1, DUM.1) | |
| 233 | NET_C(DUM.2, GND) | |
| 234 | FRONTIER(front1, R39.1, R40.1) | |
| 231 | RES(DUM, RES_K(22)) | |
| 232 | NET_C(R39.1, DUM.1) | |
| 233 | NET_C(DUM.2, GND) | |
| 234 | FRONTIER(front1, R39.1, R40.1) | |
| 235 | 235 | #else |
| 236 | ||
| 236 | NET_C(R39.1, R40.1) | |
| 237 | 237 | #endif |
| 238 | 238 | |
| 239 | NET_C(R20.2, R19.2, R40.2, R41.2, C31.1) | |
| 240 | NET_C(C31.2, GND) | |
| 239 | NET_C(R20.2, R19.2, R40.2, R41.2, C31.1) | |
| 240 | NET_C(C31.2, GND) | |
| 241 | 241 | |
| 242 | CAP(C32, CAP_U(1)) /* verified */ | |
| 243 | RES(R42, RES_K(43)) /* verified */ | |
| 244 | RES(R43, RES_K(100)) /* verified */ | |
| 242 | CAP(C32, CAP_U(1)) /* verified */ | |
| 243 | RES(R42, RES_K(43)) /* verified */ | |
| 244 | RES(R43, RES_K(100)) /* verified */ | |
| 245 | 245 | |
| 246 | NET_C(C31.1, C32.1) | |
| 247 | NET_C(C32.2, R42.1, R43.2, Q10.B) | |
| 248 | //NET_C(C32.2, R42.1, R43.2) | |
| 249 | NET_C(R43.1, V5) | |
| 250 | NET_C(R42.2, GND) | |
| 246 | NET_C(C31.1, C32.1) | |
| 247 | NET_C(C32.2, R42.1, R43.2, Q10.B) | |
| 248 | //NET_C(C32.2, R42.1, R43.2) | |
| 249 | NET_C(R43.1, V5) | |
| 250 | NET_C(R42.2, GND) | |
| 251 | 251 | #if 1 |
| 252 | RES(R63, RES_K(1)) /* */ | |
| 253 | RES(R62, 150) /* */ | |
| 252 | RES(R63, RES_K(1)) /* */ | |
| 253 | RES(R62, 150) /* */ | |
| 254 | 254 | |
| 255 | ||
| 255 | QBJT_EB(Q10, "2SC1815") | |
| 256 | 256 | |
| 257 | NET_C(R62.2, GND) | |
| 258 | NET_C(R62.1, Q10.E) | |
| 257 | NET_C(R62.2, GND) | |
| 258 | NET_C(R62.1, Q10.E) | |
| 259 | 259 | |
| 260 | NET_C(R63.1, V5) | |
| 261 | NET_C(R63.2, Q10.C) | |
| 260 | NET_C(R63.1, V5) | |
| 261 | NET_C(R63.2, Q10.C) | |
| 262 | 262 | |
| 263 | CAP(C42, CAP_U(0.1)) | |
| 264 | CAP(C47, CAP_U(4.7)) | |
| 265 | RES(VR1, RES_K(10)) | |
| 263 | CAP(C42, CAP_U(0.1)) | |
| 264 | CAP(C47, CAP_U(4.7)) | |
| 265 | RES(VR1, RES_K(10)) | |
| 266 | 266 | |
| 267 | NET_C(C42.1, C47.1, R62.1) | |
| 268 | NET_C(C42.2, GND) | |
| 269 | NET_C(C47.2, VR1.1) | |
| 270 | NET_C(VR1.2, GND) | |
| 267 | NET_C(C42.1, C47.1, R62.1) | |
| 268 | NET_C(C42.2, GND) | |
| 269 | NET_C(C47.2, VR1.1) | |
| 270 | NET_C(VR1.2, GND) | |
| 271 | 271 | #endif |
| 272 | /* ---------------------------------------------------------------------- */ | |
| 273 | /* Output */ | |
| 274 | /* ---------------------------------------------------------------------- */ | |
| 272 | /* ---------------------------------------------------------------------- */ | |
| 273 | /* Output */ | |
| 274 | /* ---------------------------------------------------------------------- */ | |
| 275 | 275 | |
| 276 | ||
| 276 | RES(ROUT, 1000000) | |
| 277 | 277 | |
| 278 | //NET_C(Q10.C, ROUT.1) | |
| 279 | //NET_C(R43.2, ROUT.1) | |
| 280 | NET_C(VR1.1, ROUT.1) | |
| 278 | //NET_C(Q10.C, ROUT.1) | |
| 279 | //NET_C(R43.2, ROUT.1) | |
| 280 | NET_C(VR1.1, ROUT.1) | |
| 281 | 281 | |
| 282 | ||
| 282 | NET_C(GND, ROUT.2) | |
| 283 | 283 | |
| 284 | 284 | NETLIST_END() |
| 285 | 285 | |
| r243192 | r243193 | |
| 790 | 790 | #if OLD_SOUND |
| 791 | 791 | m_discrete->write(space, DS_SOUND0_INP, 0); |
| 792 | 792 | #else |
| 793 | ||
| 793 | m_audio_snd0->write(data); | |
| 794 | 794 | #endif |
| 795 | 795 | } |
| 796 | 796 | |
| r243192 | r243193 | |
| 835 | 835 | #if OLD_SOUND |
| 836 | 836 | machine().device<discrete_device>("discrete")->write(space, DS_SOUND7_INP, data & 1); |
| 837 | 837 | #else |
| 838 | | |
| 838 | m_audio_snd7->write((data & 1) ^ 1); | |
| 839 | 839 | #endif |
| 840 | 840 | break; |
| 841 | 841 | } |
| r243192 | r243193 | |
| 891 | 891 | MCFG_DISCRETE_INTF(mario) |
| 892 | 892 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1) |
| 893 | 893 | #else |
| 894 | MCFG_SOUND_ADD("snd_nl", NETLIST_SOUND, 48000) | |
| 895 | MCFG_NETLIST_SETUP(nl_mario) | |
| 896 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) | |
| 894 | MCFG_SOUND_ADD("snd_nl", NETLIST_SOUND, 48000) | |
| 895 | MCFG_NETLIST_SETUP(nl_mario) | |
| 896 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) | |
| 897 | 897 | |
| 898 | MCFG_NETLIST_LOGIC_INPUT("snd_nl", "snd0", "SOUND0.IN", 0, 1) | |
| 899 | MCFG_NETLIST_LOGIC_INPUT("snd_nl", "snd7", "SOUND7.IN", 0, 1) | |
| 900 | MCFG_NETLIST_LOGIC_INPUT("snd_nl", "dac", "DAC.VAL", 0, 255) | |
| 898 | MCFG_NETLIST_LOGIC_INPUT("snd_nl", "snd0", "SOUND0.IN", 0, 1) | |
| 899 | MCFG_NETLIST_LOGIC_INPUT("snd_nl", "snd7", "SOUND7.IN", 0, 1) | |
| 900 | MCFG_NETLIST_LOGIC_INPUT("snd_nl", "dac", "DAC.VAL", 0, 255) | |
| 901 | 901 | |
| 902 | MCFG_NETLIST_STREAM_OUTPUT("snd_nl", 0, "ROUT.1") | |
| 903 | MCFG_NETLIST_ANALOG_MULT_OFFSET(150000.0, 0.0) | |
| 902 | MCFG_NETLIST_STREAM_OUTPUT("snd_nl", 0, "ROUT.1") | |
| 903 | MCFG_NETLIST_ANALOG_MULT_OFFSET(150000.0, 0.0) | |
| 904 | 904 | #endif |
| 905 | 905 | |
| 906 | 906 | MACHINE_CONFIG_END |
| r243192 | r243193 | |
|---|---|---|
| 341 | 341 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 342 | 342 | INPUT_PORTS_END |
| 343 | 343 | |
| 344 | static INPUT_PORTS_START( 25pacmano ) | |
| 345 | PORT_INCLUDE(20pacgal) | |
| 346 | 344 | |
| 347 | PORT_MODIFY("SERVICE") | |
| 348 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 349 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 350 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 351 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 352 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 353 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN ) | |
| 354 | INPUT_PORTS_END | |
| 355 | 345 | |
| 356 | 346 | /************************************* |
| 357 | 347 | * |
| r243192 | r243193 | |
| 534 | 524 | *************************************/ |
| 535 | 525 | |
| 536 | 526 | GAME( 2006, 25pacman, 0, 25pacman, 25pacman, _20pacgal_state, 25pacman, ROT90, "Namco / Cosmodog", "Pac-Man - 25th Anniversary Edition (Rev 3.00)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE | GAME_NOT_WORKING ) |
| 537 | GAME( 2005, 25pacmano, 25pacman, 20pacgal, 25pacman | |
| 527 | GAME( 2005, 25pacmano, 25pacman, 20pacgal, 25pacman, _20pacgal_state, 25pacman, ROT90, "Namco / Cosmodog", "Pac-Man - 25th Anniversary Edition (Rev 2.00)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE) | |
| 538 | 528 | |
| 539 | 529 | GAME( 2000, 20pacgal, 0, 20pacgal, 20pacgal, _20pacgal_state, 20pacgal, ROT90, "Namco / Cosmodog", "Ms. Pac-Man/Galaga - 20th Anniversary Class of 1981 Reunion (V1.08)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE) |
| 540 | 530 | GAME( 2000, 20pacgalr4, 20pacgal, 20pacgal, 20pacgal, _20pacgal_state, 20pacgal, ROT90, "Namco / Cosmodog", "Ms. Pac-Man/Galaga - 20th Anniversary Class of 1981 Reunion (V1.04)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE) |
| r243192 | r243193 | |
|---|---|---|
| 273 | 273 | |
| 274 | 274 | /******************************************************************************/ |
| 275 | 275 | |
| 276 | WRITE_LINE_MEMBER(actfancr_state::sound_irq) | |
| 277 | { | |
| 278 | m_audiocpu->set_input_line(0, state); /* IRQ */ | |
| 279 | } | |
| 280 | ||
| 281 | /******************************************************************************/ | |
| 282 | ||
| 283 | MACHINE_START_MEMBER(actfancr_state,actfancr) | |
| 284 | { | |
| 285 | } | |
| 286 | ||
| 276 | 287 | MACHINE_START_MEMBER(actfancr_state,triothep) |
| 277 | 288 | { |
| 289 | MACHINE_START_CALL_MEMBER(actfancr); | |
| 290 | ||
| 278 | 291 | save_item(NAME(m_trio_control_select)); |
| 279 | 292 | } |
| 280 | 293 | |
| 294 | MACHINE_RESET_MEMBER(actfancr_state,actfancr) | |
| 295 | { | |
| 296 | m_flipscreen = 0; | |
| 297 | } | |
| 298 | ||
| 281 | 299 | MACHINE_RESET_MEMBER(actfancr_state,triothep) |
| 282 | 300 | { |
| 301 | MACHINE_RESET_CALL_MEMBER(actfancr); | |
| 283 | 302 | m_trio_control_select = 0; |
| 284 | 303 | } |
| 285 | 304 | |
| r243192 | r243193 | |
| 295 | 314 | MCFG_CPU_ADD("audiocpu",M6502, 1500000) /* Should be accurate */ |
| 296 | 315 | MCFG_CPU_PROGRAM_MAP(dec0_s_map) |
| 297 | 316 | |
| 317 | MCFG_MACHINE_START_OVERRIDE(actfancr_state,actfancr) | |
| 318 | MCFG_MACHINE_RESET_OVERRIDE(actfancr_state,actfancr) | |
| 319 | ||
| 298 | 320 | /* video hardware */ |
| 299 | 321 | MCFG_SCREEN_ADD("screen", RASTER) |
| 300 | 322 | MCFG_SCREEN_REFRESH_RATE(60) |
| r243192 | r243193 | |
| 331 | 353 | MCFG_SOUND_ROUTE(3, "mono", 0.50) |
| 332 | 354 | |
| 333 | 355 | MCFG_SOUND_ADD("ym2", YM3812, 3000000) |
| 334 | MCFG_YM3812_IRQ_HANDLER(I | |
| 356 | MCFG_YM3812_IRQ_HANDLER(WRITELINE(actfancr_state, sound_irq)) | |
| 335 | 357 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90) |
| 336 | 358 | |
| 337 | 359 | MCFG_OKIM6295_ADD("oki", 1024188, OKIM6295_PIN7_HIGH) // clock frequency & pin 7 not verified |
| r243192 | r243193 | |
| 387 | 409 | MCFG_SOUND_ROUTE(3, "mono", 0.50) |
| 388 | 410 | |
| 389 | 411 | MCFG_SOUND_ADD("ym2", YM3812, XTAL_12MHz/4) /* verified on pcb */ |
| 390 | MCFG_YM3812_IRQ_HANDLER(I | |
| 412 | MCFG_YM3812_IRQ_HANDLER(WRITELINE(actfancr_state, sound_irq)) | |
| 391 | 413 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90) |
| 392 | 414 | |
| 393 | 415 | MCFG_OKIM6295_ADD("oki", XTAL_1_056MHz, OKIM6295_PIN7_HIGH) /* verified on pcb */ |
| r243192 | r243193 | |
|---|---|---|
| 1271 | 1271 | GFXDECODE_ENTRY( "gfx2", 0, wbbc97_spritelayout, 1024, 64 ) /* colors 1024-2047 in 4 banks */ |
| 1272 | 1272 | GFXDECODE_END |
| 1273 | 1273 | |
| 1274 | WRITE_LINE_MEMBER(aerofgt_state::irqhandler) | |
| 1275 | { | |
| 1276 | m_audiocpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE); | |
| 1277 | } | |
| 1274 | 1278 | |
| 1279 | ||
| 1275 | 1280 | MACHINE_START_MEMBER(aerofgt_state,common) |
| 1276 | 1281 | { |
| 1277 | 1282 | save_item(NAME(m_pending_command)); |
| r243192 | r243193 | |
| 1338 | 1343 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 1339 | 1344 | |
| 1340 | 1345 | MCFG_SOUND_ADD("ymsnd", YM2610, 8000000) |
| 1341 | MCFG_YM2610_IRQ_HANDLER(I | |
| 1346 | MCFG_YM2610_IRQ_HANDLER(WRITELINE(aerofgt_state, irqhandler)) | |
| 1342 | 1347 | MCFG_SOUND_ROUTE(0, "lspeaker", 0.25) |
| 1343 | 1348 | MCFG_SOUND_ROUTE(0, "rspeaker", 0.25) |
| 1344 | 1349 | MCFG_SOUND_ROUTE(1, "lspeaker", 1.0) |
| r243192 | r243193 | |
| 1497 | 1502 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 1498 | 1503 | |
| 1499 | 1504 | MCFG_SOUND_ADD("ymsnd", YM2610, XTAL_8MHz ) /* verified on pcb */ |
| 1500 | MCFG_YM2610_IRQ_HANDLER(I | |
| 1505 | MCFG_YM2610_IRQ_HANDLER(WRITELINE(aerofgt_state, irqhandler)) | |
| 1501 | 1506 | MCFG_SOUND_ROUTE(0, "lspeaker", 0.25) |
| 1502 | 1507 | MCFG_SOUND_ROUTE(0, "rspeaker", 0.25) |
| 1503 | 1508 | MCFG_SOUND_ROUTE(1, "lspeaker", 1.0) |
| r243192 | r243193 | |
| 1551 | 1556 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 1552 | 1557 | |
| 1553 | 1558 | MCFG_SOUND_ADD("ymsnd", YM2610, XTAL_8MHz) /* verified on pcb */ |
| 1554 | MCFG_YM2610_IRQ_HANDLER(I | |
| 1559 | MCFG_YM2610_IRQ_HANDLER(WRITELINE(aerofgt_state, irqhandler)) | |
| 1555 | 1560 | MCFG_SOUND_ROUTE(0, "lspeaker", 0.25) |
| 1556 | 1561 | MCFG_SOUND_ROUTE(0, "rspeaker", 0.25) |
| 1557 | 1562 | MCFG_SOUND_ROUTE(1, "lspeaker", 1.0) |
| r243192 | r243193 | |
| 1604 | 1609 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 1605 | 1610 | |
| 1606 | 1611 | MCFG_SOUND_ADD("ymsnd", YM2610, XTAL_8MHz) /* verified on pcb */ |
| 1607 | MCFG_YM2610_IRQ_HANDLER(I | |
| 1612 | MCFG_YM2610_IRQ_HANDLER(WRITELINE(aerofgt_state, irqhandler)) | |
| 1608 | 1613 | MCFG_SOUND_ROUTE(0, "lspeaker", 0.25) |
| 1609 | 1614 | MCFG_SOUND_ROUTE(0, "rspeaker", 0.25) |
| 1610 | 1615 | MCFG_SOUND_ROUTE(1, "lspeaker", 1.0) |
| r243192 | r243193 | |
| 1658 | 1663 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 1659 | 1664 | |
| 1660 | 1665 | MCFG_SOUND_ADD("ymsnd", YM2610, 8000000) |
| 1661 | MCFG_YM2610_IRQ_HANDLER(I | |
| 1666 | MCFG_YM2610_IRQ_HANDLER(WRITELINE(aerofgt_state, irqhandler)) | |
| 1662 | 1667 | MCFG_SOUND_ROUTE(0, "lspeaker", 0.25) |
| 1663 | 1668 | MCFG_SOUND_ROUTE(0, "rspeaker", 0.25) |
| 1664 | 1669 | MCFG_SOUND_ROUTE(1, "lspeaker", 1.0) |
| r243192 | r243193 | |
| 1706 | 1711 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 1707 | 1712 | |
| 1708 | 1713 | MCFG_SOUND_ADD("ymsnd", YM2610, XTAL_8MHz) /* verified on pcb */ |
| 1709 | MCFG_YM2610_IRQ_HANDLER(I | |
| 1714 | MCFG_YM2610_IRQ_HANDLER(WRITELINE(aerofgt_state, irqhandler)) | |
| 1710 | 1715 | MCFG_SOUND_ROUTE(0, "lspeaker", 0.25) |
| 1711 | 1716 | MCFG_SOUND_ROUTE(0, "rspeaker", 0.25) |
| 1712 | 1717 | MCFG_SOUND_ROUTE(1, "lspeaker", 1.0) |
| r243192 | r243193 | |
| 1819 | 1824 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 1820 | 1825 | |
| 1821 | 1826 | MCFG_SOUND_ADD("ymsnd", YM3812, 3579545) |
| 1822 | MCFG_YM3812_IRQ_HANDLER(I | |
| 1827 | MCFG_YM3812_IRQ_HANDLER(WRITELINE(aerofgt_state, irqhandler)) | |
| 1823 | 1828 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 1824 | 1829 | |
| 1825 | 1830 | MCFG_OKIM6295_ADD("oki", 1056000, OKIM6295_PIN7_HIGH) // clock frequency & pin 7 not verified |
| r243192 | r243193 | |
|---|---|---|
| 30 | 30 | Seta E92 Mother PCB |
| 31 | 31 | |---------------------------------------------| |
| 32 | 32 | --| VOL_POT | |
| 33 | |R|TA8139S | | |
| 33 | |R|TA8139S | | |
| 34 | 34 | RCA --| TA8201 BU9480 | |
| 35 | 35 | AUDIO | | |
| 36 | 36 | PLUGS --| AMP-NUS | |
| r243192 | r243193 | |
| 178 | 178 | public: |
| 179 | 179 | aleck64_state(const machine_config &mconfig, device_type type, const char *tag) |
| 180 | 180 | : n64_state(mconfig, type, tag), |
| 181 | m_e90_vram(*this,"e90vram"), | |
| 182 | m_e90_pal(*this,"e90pal"), | |
| 183 | 181 | m_dip_read_offset(0) { } |
| 184 | 182 | |
| 185 | optional_shared_ptr<UINT32> m_e90_vram; | |
| 186 | optional_shared_ptr<UINT32> m_e90_pal; | |
| 187 | 183 | DECLARE_DRIVER_INIT(aleck64); |
| 188 | 184 | DECLARE_WRITE32_MEMBER(aleck_dips_w); |
| 189 | 185 | DECLARE_READ32_MEMBER(aleck_dips_r); |
| 190 | 186 | DECLARE_READ16_MEMBER(e90_prot_r); |
| 191 | 187 | DECLARE_WRITE16_MEMBER(e90_prot_w); |
| 192 | UINT32 screen_update_e90(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); | |
| 193 | 188 | private: |
| 194 | 189 | UINT32 m_dip_read_offset; |
| 195 | 190 | }; |
| r243192 | r243193 | |
| 322 | 317 | ADDRESS_MAP_END |
| 323 | 318 | |
| 324 | 319 | /* |
| 325 | E90 protection handlers | |
| 320 | E90 protection handlers | |
| 326 | 321 | */ |
| 327 | 322 | |
| 328 | 323 | READ16_MEMBER(aleck64_state::e90_prot_r) |
| r243192 | r243193 | |
| 332 | 327 | } |
| 333 | 328 | |
| 334 | 329 | WRITE16_MEMBER(aleck64_state::e90_prot_w) |
| 335 | { | |
| 330 | { | |
| 336 | 331 | switch(offset*2) |
| 337 | 332 | { |
| 338 | 333 | case 0x16: |
| r243192 | r243193 | |
| 342 | 337 | if(data & 1) // 0 -> 1 transition |
| 343 | 338 | { |
| 344 | 339 | //for(int i=0;i<0x1000;i+=4) |
| 345 | // | |
| 340 | // space.write_dword(0x007502f4+i,space.read_dword(0xd0000000+i)); | |
| 346 | 341 | } |
| 347 | 342 | break; |
| 348 | 343 | //0x1e bit 0 probably enables the chip |
| r243192 | r243193 | |
| 354 | 349 | |
| 355 | 350 | static ADDRESS_MAP_START( e90_map, AS_PROGRAM, 32, aleck64_state ) |
| 356 | 351 | AM_IMPORT_FROM( n64_map ) |
| 357 | AM_RANGE(0xd0000000, 0xd0000fff) AM_RAM AM_SHARE("e90vram")// x/y offsets | |
| 358 | AM_RANGE(0xd0010000, 0xd0010fff) AM_RAM AM_SHARE("e90pal")// RGB555 palette | |
| 352 | AM_RANGE(0xd0000000, 0xd0000fff) AM_RAM // x/y offsets | |
| 353 | AM_RANGE(0xd0010000, 0xd0010fff) AM_RAM // RGB555 palette | |
| 359 | 354 | AM_RANGE(0xd0030000, 0xd003001f) AM_READWRITE16(e90_prot_r, e90_prot_w,0xffffffff) |
| 360 | 355 | ADDRESS_MAP_END |
| 361 | 356 | |
| r243192 | r243193 | |
| 878 | 873 | MCFG_N64_PERIPHS_ADD("rcp"); |
| 879 | 874 | MACHINE_CONFIG_END |
| 880 | 875 | |
| 881 | UINT32 aleck64_state::screen_update_e90(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) | |
| 882 | { | |
| 883 | bitmap.fill(0, cliprect); | |
| 884 | screen_update_n64(screen,bitmap,cliprect); | |
| 885 | ||
| 886 | for(int offs=0;offs<0x1000/4;offs+=2) | |
| 887 | { | |
| 888 | int xi,yi; | |
| 889 | int r,g,b; | |
| 890 | int pal_offs; | |
| 891 | int pal_shift; | |
| 892 | //UINT16 tile = m_e90_vram[offs] >> 16; | |
| 893 | UINT16 pal = m_e90_vram[offs] & 0xff; // guess: 0x1000 entries / word / 4bpp = 0x7f, divided by two below (TODO: why?) | |
| 894 | INT16 x = m_e90_vram[offs+1] >> 16; | |
| 895 | INT16 y = m_e90_vram[offs+1] & 0xffff; | |
| 896 | pal>>=1; | |
| 897 | x>>=1; | |
| 898 | pal_offs = (pal*0x20); | |
| 899 | pal_offs+= 1; // edit this to get the other colors in the range | |
| 900 | pal_shift = pal_offs & 1 ? 0 : 16; | |
| 901 | r = m_e90_pal[pal_offs>>1] >> pal_shift; | |
| 902 | g = (m_e90_pal[pal_offs>>1] >> (5+pal_shift)); | |
| 903 | b = (m_e90_pal[pal_offs>>1] >> (10+pal_shift)); | |
| 904 | r&=0x1f; | |
| 905 | g&=0x1f; | |
| 906 | b&=0x1f; | |
| 907 | r = (r << 3) | (r >> 2); | |
| 908 | g = (g << 3) | (g >> 2); | |
| 909 | b = (b << 3) | (b >> 2); | |
| 910 | for(yi=0;yi<8;yi++) | |
| 911 | for(xi=0;xi<8;xi++) | |
| 912 | { | |
| 913 | int res_x,res_y; | |
| 914 | res_x = x+xi + 4; | |
| 915 | res_y = y+yi + 7; | |
| 916 | ||
| 917 | if(cliprect.contains(res_x, res_y)) | |
| 918 | bitmap.pix32(res_y, res_x) = r << 16 | g << 8 | b; | |
| 919 | } | |
| 920 | } | |
| 921 | return 0; | |
| 922 | } | |
| 923 | ||
| 924 | 876 | static MACHINE_CONFIG_DERIVED( a64_e90, aleck64 ) |
| 925 | 877 | MCFG_CPU_MODIFY("maincpu") |
| 926 | 878 | MCFG_CPU_PROGRAM_MAP(e90_map) |
| 927 | ||
| 928 | MCFG_SCREEN_MODIFY("screen") | |
| 929 | MCFG_SCREEN_UPDATE_DRIVER(aleck64_state, screen_update_e90) | |
| 930 | 879 | MACHINE_CONFIG_END |
| 931 | 880 | |
| 932 | 881 | DRIVER_INIT_MEMBER(aleck64_state,aleck64) |
| r243192 | r243193 | |
|---|---|---|
| 455 | 455 | /* second half empty */ |
| 456 | 456 | |
| 457 | 457 | ROM_REGION( 0x200000, "k051960", 0 ) /* sprites */ |
| 458 | ROM_LOAD32_WORD( "875b10.k08", 0x000000, 0x80000, CRC(0b1035b1) SHA1(db04020761386e79249762cd1540208375c38c7f) ) | |
| 459 | ROM_LOAD32_WORD( "875b09.k02", 0x000002, 0x80000, CRC(e76b3c19) SHA1(6838e07460b3eaaeb129208ad0696c8019bd63d9) ) | |
| 460 | ROM_LOAD32_WORD( "875b06.j08", 0x100000, 0x40000, CRC(081a0566) SHA1(3a4aa14178fe76a030224743c9e9cd974e08bd79) ) | |
| 458 | ROM_LOAD( "875b10.k08", 0x000000, 0x80000, CRC(0b1035b1) SHA1(db04020761386e79249762cd1540208375c38c7f) ) | |
| 459 | ROM_LOAD( "875b09.k02", 0x000002, 0x80000, CRC(e76b3c19) SHA1(6838e07460b3eaaeb129208ad0696c8019bd63d9) ) | |
| 460 | ROM_LOAD( "875b06.j08", 0x100000, 0x40000, CRC(081a0566) SHA1(3a4aa14178fe76a030224743c9e9cd974e08bd79) ) | |
| 461 | 461 | /* second half empty */ |
| 462 | ROM_LOAD | |
| 462 | ROM_LOAD( "875b05.j02", 0x100002, 0x40000, CRC(19a261f2) SHA1(b0518fad833b3e613e0201d5d9cab73dc5e78e1d) ) | |
| 463 | 463 | /* second half empty */ |
| 464 | 464 | |
| 465 | 465 | ROM_REGION( 0x0100, "proms", 0 ) |
| r243192 | r243193 | |
|---|---|---|
| 1787 | 1787 | m_sound_pa_latch = data & 1; |
| 1788 | 1788 | } |
| 1789 | 1789 | |
| 1790 | WRITE_LINE_MEMBER(alpha68k_state::ym3812_irq) | |
| 1791 | { | |
| 1792 | m_audiocpu->set_input_line(0, (state) ? HOLD_LINE : CLEAR_LINE); | |
| 1793 | } | |
| 1790 | 1794 | |
| 1795 | ||
| 1791 | 1796 | /******************************************************************************/ |
| 1792 | 1797 | |
| 1793 | 1798 | |
| r243192 | r243193 | |
| 2056 | 2061 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 2057 | 2062 | |
| 2058 | 2063 | MCFG_SOUND_ADD("ymsnd", YM3812, 4000000) |
| 2059 | MCFG_YM3812_IRQ_HANDLER(I | |
| 2064 | MCFG_YM3812_IRQ_HANDLER(WRITELINE(alpha68k_state, ym3812_irq)) | |
| 2060 | 2065 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 2061 | 2066 | MACHINE_CONFIG_END |
| 2062 | 2067 | |
| r243192 | r243193 | |
| 2291 | 2296 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 2292 | 2297 | |
| 2293 | 2298 | MCFG_SOUND_ADD("ymsnd", YM3812, 4000000) |
| 2294 | MCFG_YM3812_IRQ_HANDLER(I | |
| 2299 | MCFG_YM3812_IRQ_HANDLER(WRITELINE(alpha68k_state, ym3812_irq)) | |
| 2295 | 2300 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 2296 | 2301 | MACHINE_CONFIG_END |
| 2297 | 2302 |
| r243192 | r243193 | |
|---|---|---|
| 13 | 13 | |
| 14 | 14 | #include "emu.h" |
| 15 | 15 | #include "cpu/m6502/m6502.h" |
| 16 | #include "sound/ay8910.h" | |
| 16 | 17 | #include "includes/bogeyman.h" |
| 17 | 18 | |
| 18 | 19 | |
| r243192 | r243193 | |
| 20 | 21 | |
| 21 | 22 | // Sound section is copied from Mysterious Stones driver by Nicola, Mike, Brad |
| 22 | 23 | |
| 23 | WRITE8_MEMBER(bogeyman_state:: | |
| 24 | WRITE8_MEMBER(bogeyman_state::bogeyman_8910_latch_w) | |
| 24 | 25 | { |
| 25 | 26 | m_psg_latch = data; |
| 26 | 27 | } |
| 27 | 28 | |
| 28 | WRITE8_MEMBER(bogeyman_state:: | |
| 29 | WRITE8_MEMBER(bogeyman_state::bogeyman_8910_control_w) | |
| 29 | 30 | { |
| 30 | 31 | // bit 0 is flipscreen |
| 31 | 32 | flip_screen_set(data & 0x01); |
| 32 | 33 | |
| 33 | 34 | // bit 5 goes to 8910 #0 BDIR pin |
| 34 | 35 | if ((m_last_write & 0x20) == 0x20 && (data & 0x20) == 0x00) |
| 35 | m_ay1->data_address_w(space, m_last_write >> 4, m_psg_latch); | |
| 36 | machine().device<ay8910_device>("ay1")->data_address_w(space, m_last_write >> 4, m_psg_latch); | |
| 36 | 37 | |
| 37 | 38 | // bit 7 goes to 8910 #1 BDIR pin |
| 38 | 39 | if ((m_last_write & 0x80) == 0x80 && (data & 0x80) == 0x00) |
| 39 | m_ay2->data_address_w(space, m_last_write >> 6, m_psg_latch); | |
| 40 | machine().device<ay8910_device>("ay2")->data_address_w(space, m_last_write >> 6, m_psg_latch); | |
| 40 | 41 | |
| 41 | 42 | m_last_write = data; |
| 42 | 43 | } |
| r243192 | r243193 | |
| 45 | 46 | |
| 46 | 47 | static ADDRESS_MAP_START( bogeyman_map, AS_PROGRAM, 8, bogeyman_state ) |
| 47 | 48 | AM_RANGE(0x0000, 0x17ff) AM_RAM |
| 48 | AM_RANGE(0x1800, 0x1bff) AM_RAM_WRITE(videoram2_w) AM_SHARE("videoram2") | |
| 49 | AM_RANGE(0x1c00, 0x1fff) AM_RAM_WRITE(colorram2_w) AM_SHARE("colorram2") | |
| 50 | AM_RANGE(0x2000, 0x20ff) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram") | |
| 51 | AM_RANGE(0x2100, 0x21ff) AM_RAM_WRITE(colorram_w) AM_SHARE("colorram") | |
| 49 | AM_RANGE(0x1800, 0x1bff) AM_RAM_WRITE(bogeyman_videoram2_w) AM_SHARE("videoram2") | |
| 50 | AM_RANGE(0x1c00, 0x1fff) AM_RAM_WRITE(bogeyman_colorram2_w) AM_SHARE("colorram2") | |
| 51 | AM_RANGE(0x2000, 0x20ff) AM_RAM_WRITE(bogeyman_videoram_w) AM_SHARE("videoram") | |
| 52 | AM_RANGE(0x2100, 0x21ff) AM_RAM_WRITE(bogeyman_colorram_w) AM_SHARE("colorram") | |
| 52 | 53 | AM_RANGE(0x2800, 0x2bff) AM_RAM AM_SHARE("spriteram") |
| 53 | AM_RANGE(0x3000, 0x300f) AM_RAM_WRITE(paletteram_w) AM_SHARE("palette") | |
| 54 | AM_RANGE(0x3800, 0x3800) AM_READ_PORT("P1") AM_WRITE(ay8910_control_w) | |
| 55 | AM_RANGE(0x3801, 0x3801) AM_READ_PORT("P2") AM_WRITE(ay8910_latch_w) | |
| 54 | AM_RANGE(0x3000, 0x300f) AM_RAM_WRITE(bogeyman_paletteram_w) AM_SHARE("palette") | |
| 55 | AM_RANGE(0x3800, 0x3800) AM_READ_PORT("P1") AM_WRITE(bogeyman_8910_control_w) | |
| 56 | AM_RANGE(0x3801, 0x3801) AM_READ_PORT("P2") AM_WRITE(bogeyman_8910_latch_w) | |
| 56 | 57 | AM_RANGE(0x3802, 0x3802) AM_READ_PORT("DSW1") |
| 57 | 58 | AM_RANGE(0x3803, 0x3803) AM_READ_PORT("DSW2") AM_WRITENOP // ??? sound |
| 58 | 59 | AM_RANGE(0x4000, 0xffff) AM_ROM |
| r243192 | r243193 | |
| 204 | 205 | { |
| 205 | 206 | save_item(NAME(m_psg_latch)); |
| 206 | 207 | save_item(NAME(m_last_write)); |
| 207 | save_item(NAME(m_colbank)); | |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | 210 | void bogeyman_state::machine_reset() |
| 211 | 211 | { |
| 212 | 212 | m_psg_latch = 0; |
| 213 | 213 | m_last_write = 0; |
| 214 | m_colbank = 0; | |
| 215 | 214 | } |
| 216 | 215 | |
| 217 | WRITE8_MEMBER(bogeyman_state::colbank_w) | |
| 216 | WRITE8_MEMBER(bogeyman_state::bogeyman_colbank_w) | |
| 218 | 217 | { |
| 219 | 218 | if((data & 1) != (m_colbank & 1)) |
| 220 | 219 | { |
| r243192 | r243193 | |
| 238 | 237 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) |
| 239 | 238 | MCFG_SCREEN_SIZE(32*8, 32*8) |
| 240 | 239 | MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1) |
| 241 | MCFG_SCREEN_UPDATE_DRIVER(bogeyman_state, screen_update) | |
| 240 | MCFG_SCREEN_UPDATE_DRIVER(bogeyman_state, screen_update_bogeyman) | |
| 242 | 241 | MCFG_SCREEN_PALETTE("palette") |
| 243 | 242 | |
| 244 | 243 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", bogeyman) |
| r243192 | r243193 | |
| 250 | 249 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 251 | 250 | |
| 252 | 251 | MCFG_SOUND_ADD("ay1", AY8910, 1500000) /* Verified */ |
| 253 | MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(bogeyman_state, colbank_w)) | |
| 252 | MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(bogeyman_state, bogeyman_colbank_w)) | |
| 254 | 253 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30) |
| 255 | 254 | |
| 256 | 255 | MCFG_SOUND_ADD("ay2", AY8910, 1500000) /* Verified */ |
| r243192 | r243193 | |
|---|---|---|
| 1935 | 1935 | |
| 1936 | 1936 | ROM_START( discof ) |
| 1937 | 1937 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 1938 | ROM_LOAD( "w5-f.1a", 0xa000, 0x1000, CRC(9d53c71c) SHA1(53c410cfa4fbbfd08e1c3cf7aeba1c9627171a71) ) | |
| 1939 | ROM_LOAD( "w4-f.2a", 0xb000, 0x1000, CRC(c1f8d747) SHA1(33f5fe73d1851ef4da670075d1aec1550e0417ce) ) | |
| 1940 | ROM_LOAD( "w3-f.4a", 0xc000, 0x1000, CRC(9aadd252) SHA1(c6da7ef46333d525e676c59f03ccc908108b41ba) ) | |
| 1941 | ROM_LOAD( "w2-f.6a", 0xd000, 0x1000, CRC(f131a5bb) SHA1(84b7dea112dce12e5cb235a13f6dc4edcfb18c06) ) | |
| 1942 | ROM_LOAD( "w1-f.9a", 0xe000, 0x1000, CRC(a6ce9a19) SHA1(e8f380e17a21fb33504d6efe9d01d0f903fa25e1) ) | |
| 1943 | // ROM_LOAD( "w1-f", 0xe000, 0x1000, CRC(c8ec57c5) SHA1(904a9ed0a7f1230c611bf473b9bc52e63eb56dbe) ) // 0x7d3 is 0x10 instead of 0x00, 1 bit different, looks out of place, bad? | |
| 1944 | ROM_LOAD( "w0-f.9a", 0xf000, 0x1000, CRC(b3787a92) SHA1(7f40621dc739c1108a5df43142ab04709a380219) ) | |
| 1938 | ROM_LOAD( "w5-f", 0xa000, 0x1000, CRC(9d53c71c) SHA1(53c410cfa4fbbfd08e1c3cf7aeba1c9627171a71) ) | |
| 1939 | ROM_LOAD( "w4-f", 0xb000, 0x1000, CRC(c1f8d747) SHA1(33f5fe73d1851ef4da670075d1aec1550e0417ce) ) | |
| 1940 | ROM_LOAD( "w3-f", 0xc000, 0x1000, CRC(9aadd252) SHA1(c6da7ef46333d525e676c59f03ccc908108b41ba) ) | |
| 1941 | ROM_LOAD( "w2-f", 0xd000, 0x1000, CRC(f131a5bb) SHA1(84b7dea112dce12e5cb235a13f6dc4edcfb18c06) ) | |
| 1942 | ROM_LOAD( "w1-f", 0xe000, 0x1000, CRC(c8ec57c5) SHA1(904a9ed0a7f1230c611bf473b9bc52e63eb56dbe) ) | |
| 1943 | ROM_LOAD( "w0-f", 0xf000, 0x1000, CRC(b3787a92) SHA1(7f40621dc739c1108a5df43142ab04709a380219) ) | |
| 1945 | 1944 | |
| 1946 | 1945 | ROM_REGION( 0x10000, "audiocpu", 0 ) |
| 1947 | ROM_LOAD( "w6 | |
| 1946 | ROM_LOAD( "disco.w6", 0xf000, 0x1000, CRC(d81e781e) SHA1(bde510bfed06a13bd56bf7ddbf220e7cf82f79b6) ) | |
| 1948 | 1947 | |
| 1949 | ROM_REGION( 0x0020, "proms", 0 ) | |
| 1948 | ROM_REGION( 0x0020, "proms", 0 ) | |
| 1950 | 1949 | ROM_LOAD( "disco.clr", 0x0000, 0x0020, CRC(a393f913) SHA1(42dce159283427064b3f5ce3a6e2189744ecd943) ) |
| 1951 | 1950 | ROM_END |
| 1952 | 1951 |
| r243192 | r243193 | |
|---|---|---|
| 3658 | 3658 | DRIVER_INIT_MEMBER(calomega_state,comg080) |
| 3659 | 3659 | { |
| 3660 | 3660 | DRIVER_INIT_CALL(sys903); |
| 3661 | ||
| 3661 | ||
| 3662 | 3662 | /* Injecting missing Start and NMI vectors... |
| 3663 | 3663 | Start = $2042; NMI = $26f8; |
| 3664 | 3664 | Also a fake vector at $3ff8-$3ff9. The code checks these values to continue. |
| r243192 | r243193 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | Robot Bowl 1977 6502 4020-4027, 4010-4013 |
| 8 | 8 | Circus 1977 6502 9000-9003, 9004-9011 |
| 9 | Football Aug,1978 6502 unknown | |
| 10 | 9 | Rip Cord May,1979 6502 RC30-0014 (cpu) 0015 (snd) |
| 11 | 10 | 9023-9026, 9027-9034, 9035 |
| 12 | 11 | Crash July,1979 6502 CR30-3162 (cpu) 3161 (snd) 9036 (?) |
| r243192 | r243193 | |
|---|---|---|
| 9262 | 9262 | ROM_LOAD( "s92_19.12c", 0x20000, 0x20000, CRC(beade53f) SHA1(277c397dc12752719ec6b47d2224750bd1c07f79) ) |
| 9263 | 9263 | ROM_END |
| 9264 | 9264 | |
| 9265 | ||
| 9266 | 9265 | /* B-Board 89625B-1 */ |
| 9267 | 9266 | ROM_START( cworld2j ) |
| 9268 | 9267 | ROM_REGION( CODE_SIZE, "maincpu", 0 ) /* 68000 code */ |
| r243192 | r243193 | |
| 9317 | 9316 | ROM_LOAD( "ioc1.ic1", 0x0000, 0x0117, CRC(0d182081) SHA1(475b3d417785da4bc512cce2b274bb00d4cc6792) ) |
| 9318 | 9317 | ROM_END |
| 9319 | 9318 | |
| 9320 | /* B-Board 90629B-3 - all roms have 90629B on the labels, no battery, possibly unofficial / desuicided with reproduction stickers */ | |
| 9321 | ROM_START( cworld2ja ) | |
| 9322 | ROM_REGION( CODE_SIZE, "maincpu", 0 ) /* 68000 code */ | |
| 9323 | ROM_LOAD16_WORD_SWAP("q5 - 34_90629b.8f", 0x00000, 0x80000, CRC(de54487f) SHA1(75b228a6c702c82d4d9a2a992933b5c3c420f6c2) ) | |
| 9324 | ROM_LOAD16_WORD_SWAP("q5 - 33_90629b.6f", 0x80000, 0x80000, CRC(93248458) SHA1(9dcdc6838f52efc9a0a6333fd0d734946db12dbd) ) | |
| 9325 | ||
| 9326 | ROM_REGION( 0x200000, "gfx", 0 ) | |
| 9327 | ROMX_LOAD( "q5 - 06_90629b.8a", 0x000000, 0x80000, CRC(09d0e7ce) SHA1(ea502b975986222acce82ce8396348af72e1df72) , ROM_GROUPWORD | ROM_SKIP(6) ) | |
| 9328 | ROMX_LOAD( "q5 - 08_90629b.10a", 0x000002, 0x80000, CRC(22e4ce9a) SHA1(9e49aec8e1d6d15a68da63e69765b82fd53a9562) , ROM_GROUPWORD | ROM_SKIP(6) ) | |
| 9329 | ROMX_LOAD( "q5 - 05_90629b.7a", 0x000004, 0x80000, CRC(f7b3aed6) SHA1(bdfb4d5988307b07ad878ac9129954d14da8769b) , ROM_GROUPWORD | ROM_SKIP(6) ) | |
| 9330 | ROMX_LOAD( "q5 - 07_90629b.9a", 0x000006, 0x80000, CRC(520c6c88) SHA1(19ba8ca3d75aae71cdf471e6307e86a5df8a2851) , ROM_GROUPWORD | ROM_SKIP(6) ) | |
| 9331 | ||
| 9332 | ROM_REGION( 0x18000, "audiocpu", 0 ) /* 64k for the audio CPU (+banks) */ | |
| 9333 | ROM_LOAD( "q5 - 09_90629b.12a", 0x00000, 0x08000, CRC(e14dc524) SHA1(0020a9002572002458fbfe45e8a959cb90de3f03) ) | |
| 9334 | ROM_CONTINUE( 0x10000, 0x08000 ) | |
| 9335 | ||
| 9336 | ROM_REGION( 0x40000, "oki", 0 ) /* Samples */ | |
| 9337 | ROM_LOAD( "q5 - 18_90629b.11c", 0x00000, 0x20000, CRC(d10c1b68) SHA1(2423241f3340d8ab1b6bf9514ca8c3bba1273873) ) | |
| 9338 | ROM_LOAD( "q5 - 19_90629b.12c", 0x20000, 0x20000, CRC(7d17e496) SHA1(a274b94ec4f042dddc239ecb9ac2e1e2375f5eb2) ) | |
| 9339 | ||
| 9340 | ROM_REGION( 0x0200, "aboardplds", 0 ) | |
| 9341 | ROM_LOAD( "buf1", 0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) ) | |
| 9342 | ROM_LOAD( "ioa1", 0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) ) | |
| 9343 | ROM_LOAD( "prg1", 0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) ) | |
| 9344 | ROM_LOAD( "rom1", 0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) ) | |
| 9345 | ROM_LOAD( "sou1", 0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) ) | |
| 9346 | ||
| 9347 | ROM_REGION( 0x0200, "bboardplds", 0 ) | |
| 9348 | ROM_LOAD( "q529b.1a", 0x0000, 0x0117, NO_DUMP ) | |
| 9349 | ROM_LOAD( "iob1.11d", 0x0000, 0x0117, CRC(3abc0700) SHA1(973043aa46ec6d5d1db20dc9d5937005a0f9f6ae) ) | |
| 9350 | ||
| 9351 | ROM_REGION( 0x0200, "cboardplds", 0 ) | |
| 9352 | ROM_LOAD( "ioc1.ic1", 0x0000, 0x0117, CRC(0d182081) SHA1(475b3d417785da4bc512cce2b274bb00d4cc6792) ) | |
| 9353 | ROM_END | |
| 9354 | ||
| 9355 | 9319 | /* B-Board 89624B-3 */ |
| 9356 | 9320 | ROM_START( varth ) |
| 9357 | 9321 | ROM_REGION( CODE_SIZE, "maincpu", 0 ) /* 68000 code */ |
| r243192 | r243193 | |
| 11717 | 11681 | GAME( 1992, sf2koryu, sf2ce, cps1_12MHz, sf2hack, cps_state, sf2hack, ROT0, "bootleg", "Street Fighter II': Champion Edition (Xiang Long, Chinese bootleg)", GAME_SUPPORTS_SAVE ) // 811102 !!! - based on World version |
| 11718 | 11682 | GAME( 1992, sf2dongb, sf2ce, cps1_12MHz, sf2, cps_state, sf2dongb, ROT0, "bootleg", "Street Fighter II': Champion Edition (Dongfang Bubai protection, bootleg)", GAME_SUPPORTS_SAVE ) // 920313 - based on World version |
| 11719 | 11683 | GAME( 1992, cworld2j, 0, cps1_12MHz, cworld2j, cps_state, cps1, ROT0, "Capcom", "Adventure Quiz Capcom World 2 (Japan 920611)", GAME_SUPPORTS_SAVE ) |
| 11720 | GAME( 1992, cworld2ja, cworld2j, cps1_12MHz, cworld2j, cps_state, cps1, ROT0, "Capcom", "Adventure Quiz Capcom World 2 (Japan 920611, B-Board 90629B-3, no battery)", GAME_SUPPORTS_SAVE ) | |
| 11721 | 11684 | GAME( 1992, varth, 0, cps1_12MHz, varth, cps_state, cps1, ROT270, "Capcom", "Varth: Operation Thunderstorm (World 920714)", GAME_SUPPORTS_SAVE ) // "ETC" // 12MHz verified |
| 11722 | 11685 | GAME( 1992, varthr1, varth, cps1_12MHz, varth, cps_state, cps1, ROT270, "Capcom", "Varth: Operation Thunderstorm (World 920612)", GAME_SUPPORTS_SAVE ) // "ETC" |
| 11723 | 11686 | GAME( 1992, varthu, varth, cps1_12MHz, varth, cps_state, cps1, ROT270, "Capcom (Romstar license)", "Varth: Operation Thunderstorm (USA 920612)", GAME_SUPPORTS_SAVE ) |
| r243192 | r243193 | |
|---|---|---|
| 314 | 314 | GFXDECODE_ENTRY( "gfx1", 0, tlayout, 0, 64 ) /* Sprites 16x16 */ |
| 315 | 315 | GFXDECODE_END |
| 316 | 316 | |
| 317 | ||
| 318 | WRITE_LINE_MEMBER(crospang_state::irqhandler) | |
| 319 | { | |
| 320 | m_audiocpu->set_input_line(0, state); | |
| 321 | } | |
| 322 | ||
| 323 | ||
| 317 | 324 | void crospang_state::machine_start() |
| 318 | 325 | { |
| 319 | 326 | save_item(NAME(m_bestri_tilebank)); |
| r243192 | r243193 | |
| 365 | 372 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 366 | 373 | |
| 367 | 374 | MCFG_SOUND_ADD("ymsnd", YM3812, 14318180/4) |
| 368 | MCFG_YM3812_IRQ_HANDLER(I | |
| 375 | MCFG_YM3812_IRQ_HANDLER(WRITELINE(crospang_state, irqhandler)) | |
| 369 | 376 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 370 | 377 | |
| 371 | 378 | MCFG_OKIM6295_ADD("oki", 1056000, OKIM6295_PIN7_HIGH) // clock frequency & pin 7 not verified |
| r243192 | r243193 | |
|---|---|---|
| 110 | 110 | #include "cpu/m68000/m68000.h" |
| 111 | 111 | #include "cpu/z80/z80.h" |
| 112 | 112 | #include "sound/ay8910.h" |
| 113 | #include "sound/okim6295.h" | |
| 114 | #include "sound/2413intf.h" | |
| 113 | 115 | #include "machine/msm6242.h" |
| 114 | 116 | #include "machine/nvram.h" |
| 115 | 117 | #include "includes/dynax.h" |
| r243192 | r243193 | |
| 151 | 153 | { |
| 152 | 154 | public: |
| 153 | 155 | ddenlovr_state(const machine_config &mconfig, device_type type, const char *tag) |
| 154 | : dynax_state(mconfig, type, tag), | |
| 155 | m_dsw_sel16(*this, "dsw_sel16"), | |
| 156 | m_protection1(*this, "protection1"), | |
| 157 | m_protection2(*this, "protection2") { } | |
| 156 | : dynax_state(mconfig, type, tag) | |
| 157 | { } | |
| 158 | 158 | |
| 159 | ||
| 160 | optional_shared_ptr<UINT16> m_dsw_sel16; | |
| 161 | optional_shared_ptr<UINT16> m_protection1; | |
| 162 | optional_shared_ptr<UINT16> m_protection2; | |
| 163 | ||
| 164 | ||
| 165 | UINT8 * m_ddenlovr_pixmap[8]; | |
| 166 | ||
| 167 | /* blitter (TODO: merge with the dynax.h, where possible) */ | |
| 168 | int m_extra_layers; | |
| 169 | int m_ddenlovr_dest_layer; | |
| 170 | int m_ddenlovr_blit_flip; | |
| 171 | int m_ddenlovr_blit_x; | |
| 172 | int m_ddenlovr_blit_y; | |
| 173 | int m_ddenlovr_blit_address; | |
| 174 | int m_ddenlovr_blit_pen; | |
| 175 | int m_ddenlovr_blit_pen_mode; | |
| 176 | int m_ddenlovr_blitter_irq_flag; | |
| 177 | int m_ddenlovr_blitter_irq_enable; | |
| 178 | int m_ddenlovr_rect_width; | |
| 179 | int m_ddenlovr_rect_height; | |
| 180 | int m_ddenlovr_clip_width; | |
| 181 | int m_ddenlovr_clip_height; | |
| 182 | int m_ddenlovr_line_length; | |
| 183 | int m_ddenlovr_clip_ctrl; | |
| 184 | int m_ddenlovr_clip_x; | |
| 185 | int m_ddenlovr_clip_y; | |
| 186 | int m_ddenlovr_scroll[8*2]; | |
| 187 | int m_ddenlovr_priority; | |
| 188 | int m_ddenlovr_priority2; | |
| 189 | int m_ddenlovr_bgcolor; | |
| 190 | int m_ddenlovr_bgcolor2; | |
| 191 | int m_ddenlovr_layer_enable; | |
| 192 | int m_ddenlovr_layer_enable2; | |
| 193 | int m_ddenlovr_palette_base[8]; | |
| 194 | int m_ddenlovr_palette_mask[8]; | |
| 195 | int m_ddenlovr_transparency_pen[8]; | |
| 196 | int m_ddenlovr_transparency_mask[8]; | |
| 197 | int m_ddenlovr_blit_latch; | |
| 198 | int m_ddenlovr_blit_pen_mask; // not implemented | |
| 199 | int m_ddenlovr_blit_rom_bits; // usually 8, 16 in hanakanz | |
| 200 | const int *m_ddenlovr_blit_commands; | |
| 201 | int m_ddenlovr_blit_regs[2]; | |
| 202 | ||
| 203 | /* ddenlovr misc (TODO: merge with dynax.h, where possible) */ | |
| 204 | UINT8 m_palram[0x200]; | |
| 205 | int m_okibank; | |
| 206 | UINT8 m_rongrong_blitter_busy_select; | |
| 207 | UINT8 m_prot_val; | |
| 208 | UINT16 m_prot_16; | |
| 209 | UINT16 m_quiz365_protection[2]; | |
| 210 | ||
| 211 | UINT16 m_mmpanic_leds; /* A led for each of the 9 buttons */ | |
| 212 | UINT8 m_funkyfig_lockout; | |
| 213 | UINT8 m_romdata[2]; | |
| 214 | int m_palette_index; | |
| 215 | UINT8 m_hginga_rombank; | |
| 216 | UINT8 m_mjflove_irq_cause; | |
| 217 | UINT8 m_daimyojn_palette_sel; | |
| 218 | ||
| 219 | 159 | DECLARE_MACHINE_START(ddenlovr); |
| 220 | 160 | DECLARE_MACHINE_RESET(ddenlovr); |
| 221 | 161 | DECLARE_VIDEO_START(ddenlovr); |
| r243192 | r243193 | |
| 410 | 350 | DECLARE_VIDEO_START(htengoku); |
| 411 | 351 | DECLARE_WRITE8_MEMBER(htengoku_dsw_w); |
| 412 | 352 | DECLARE_READ8_MEMBER(htengoku_dsw_r); |
| 413 | DECLARE_WRITE8_MEMBER( quizchq_oki_bank_w ); | |
| 414 | DECLARE_WRITE16_MEMBER( ddenlovr_oki_bank_w ); | |
| 415 | DECLARE_WRITE16_MEMBER( quiz365_oki_bank1_w ); | |
| 416 | DECLARE_WRITE16_MEMBER( quiz365_oki_bank2_w ); | |
| 417 | DECLARE_WRITE8_MEMBER( ddenlovr_select_w ); | |
| 418 | DECLARE_READ8_MEMBER( quiz365_input_r ); | |
| 419 | DECLARE_WRITE16_MEMBER( nettoqc_oki_bank_w ); | |
| 420 | DECLARE_WRITE8_MEMBER( hanakanz_oki_bank_w ); | |
| 421 | DECLARE_WRITE8_MEMBER( mjchuuka_oki_bank_w ); | |
| 422 | DECLARE_READ8_MEMBER( hginga_dsw_r ); | |
| 423 | DECLARE_WRITE8_MEMBER( mjflove_okibank_w ); | |
| 424 | DECLARE_WRITE8_MEMBER( jongtei_okibank_w ); | |
| 425 | DECLARE_READ8_MEMBER( seljan2_dsw_r ); | |
| 426 | DECLARE_WRITE8_MEMBER( daimyojn_okibank_w ); | |
| 427 | 353 | |
| 428 | 354 | void ddenlovr_flipscreen_w( UINT8 data ); |
| 429 | 355 | void ddenlovr_blit_flip_w( UINT8 data ); |
| r243192 | r243193 | |
| 442 | 368 | void mmpanic_update_leds(); |
| 443 | 369 | void mjchuuka_get_romdata(); |
| 444 | 370 | UINT8 hgokou_player_r( int player ); |
| 371 | DECLARE_WRITE8_MEMBER( quizchq_oki_bank_w ); | |
| 372 | DECLARE_WRITE16_MEMBER( ddenlovr_oki_bank_w ); | |
| 373 | DECLARE_WRITE16_MEMBER( quiz365_oki_bank1_w ); | |
| 374 | DECLARE_WRITE16_MEMBER( quiz365_oki_bank2_w ); | |
| 375 | DECLARE_WRITE8_MEMBER( ddenlovr_select_w ); | |
| 376 | DECLARE_READ8_MEMBER( quiz365_input_r ); | |
| 377 | DECLARE_WRITE16_MEMBER( nettoqc_oki_bank_w ); | |
| 378 | DECLARE_WRITE8_MEMBER( hanakanz_oki_bank_w ); | |
| 379 | DECLARE_WRITE8_MEMBER( mjchuuka_oki_bank_w ); | |
| 380 | DECLARE_READ8_MEMBER( hginga_dsw_r ); | |
| 381 | DECLARE_WRITE8_MEMBER( mjflove_okibank_w ); | |
| 382 | DECLARE_WRITE8_MEMBER( jongtei_okibank_w ); | |
| 383 | DECLARE_READ8_MEMBER( seljan2_dsw_r ); | |
| 384 | DECLARE_WRITE8_MEMBER( daimyojn_okibank_w ); | |
| 445 | 385 | }; |
| 446 | 386 | |
| 447 | 387 | VIDEO_START_MEMBER(ddenlovr_state,ddenlovr) |
| r243192 | r243193 | |
| 1976 | 1916 | AM_RANGE(0x300286, 0x300287) AM_READ(ddenlovr_gfxrom_r) // Video Chip |
| 1977 | 1917 | |
| 1978 | 1918 | AM_RANGE(0x3002c0, 0x3002c1) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff)// Sound |
| 1979 | AM_RANGE(0x300300, 0x300303) AM_DEVWRITE8("ym | |
| 1919 | AM_RANGE(0x300300, 0x300303) AM_DEVWRITE8("ymsnd", ym2413_device, write, 0x00ff) | |
| 1980 | 1920 | AM_RANGE(0x300340, 0x30035f) AM_DEVREADWRITE8("rtc", msm6242_device, read, write,0x00ff) |
| 1981 | 1921 | AM_RANGE(0x300380, 0x300383) AM_DEVWRITE8("aysnd", ay8910_device, address_data_w, 0x00ff) |
| 1982 | 1922 | AM_RANGE(0x300384, 0x300385) AM_DEVREAD8("aysnd", ay8910_device, data_r, 0x00ff) |
| r243192 | r243193 | |
| 2028 | 1968 | AM_RANGE(0x300070, 0x300071) AM_READ(unk16_r) // ? must be 78 on startup (not necessary in ddlover) |
| 2029 | 1969 | AM_RANGE(0x300080, 0x300083) AM_WRITE(ddenlovr_blitter_w) |
| 2030 | 1970 | AM_RANGE(0x300086, 0x300087) AM_READ(ddenlovr_gfxrom_r) // Video Chip |
| 2031 | AM_RANGE(0x3000c0, 0x3000c3) AM_DEVWRITE8("ym | |
| 1971 | AM_RANGE(0x3000c0, 0x3000c3) AM_DEVWRITE8("ymsnd", ym2413_device, write, 0x00ff) | |
| 2032 | 1972 | AM_RANGE(0x300100, 0x30011f) AM_DEVREADWRITE8("rtc", msm6242_device, read, write,0x00ff) |
| 2033 | 1973 | AM_RANGE(0x300140, 0x300143) AM_DEVWRITE8("aysnd", ay8910_device, address_data_w, 0x00ff) |
| 2034 | 1974 | AM_RANGE(0x300180, 0x300181) AM_READ_PORT("P1") |
| r243192 | r243193 | |
| 2095 | 2035 | AM_RANGE(0xe00308, 0xe00309) AM_WRITE(ddenlovr_coincounter_0_w) // Coin Counters |
| 2096 | 2036 | AM_RANGE(0xe0030c, 0xe0030d) AM_WRITE(ddenlovr_coincounter_1_w) // |
| 2097 | 2037 | |
| 2098 | AM_RANGE(0xe00400, 0xe00403) AM_DEVWRITE8("ym | |
| 2038 | AM_RANGE(0xe00400, 0xe00403) AM_DEVWRITE8("ymsnd", ym2413_device, write, 0x00ff) | |
| 2099 | 2039 | AM_RANGE(0xe00500, 0xe0051f) AM_DEVREADWRITE8("rtc", msm6242_device, read, write,0x00ff) |
| 2100 | 2040 | AM_RANGE(0xe00600, 0xe00603) AM_DEVWRITE8("aysnd", ay8910_device, address_data_w, 0x00ff) |
| 2101 | 2041 | AM_RANGE(0xe00604, 0xe00605) AM_DEVREAD8("aysnd", ay8910_device, data_r, 0x00ff) |
| r243192 | r243193 | |
| 2133 | 2073 | AM_RANGE(0xe00308, 0xe00309) AM_WRITE(ddenlovr_coincounter_0_w) // Coin Counters |
| 2134 | 2074 | AM_RANGE(0xe0030c, 0xe0030d) AM_WRITE(ddenlovr_coincounter_1_w) // |
| 2135 | 2075 | |
| 2136 | AM_RANGE(0xe00400, 0xe00403) AM_DEVWRITE8("ym | |
| 2076 | AM_RANGE(0xe00400, 0xe00403) AM_DEVWRITE8("ymsnd", ym2413_device, write, 0x00ff) | |
| 2137 | 2077 | AM_RANGE(0xe00500, 0xe0051f) AM_DEVREADWRITE8("rtc", msm6242_device, read, write,0x00ff) |
| 2138 | 2078 | AM_RANGE(0xe00600, 0xe00603) AM_DEVWRITE8("aysnd", ay8910_device, address_data_w, 0x00ff) |
| 2139 | 2079 | AM_RANGE(0xe00604, 0xe00605) AM_DEVREAD8("aysnd", ay8910_device, data_r, 0x00ff) |
| r243192 | r243193 | |
| 2207 | 2147 | AM_RANGE(0x300070, 0x300071) AM_READ(unk16_r) // ? must be 78 on startup (not necessary in ddlover) |
| 2208 | 2148 | AM_RANGE(0x300080, 0x300083) AM_WRITE(ddenlovr_blitter_w) |
| 2209 | 2149 | AM_RANGE(0x300086, 0x300087) AM_READ(ddenlovr_gfxrom_r) // Video Chip |
| 2210 | AM_RANGE(0x3000c0, 0x3000c3) AM_DEVWRITE8("ym | |
| 2150 | AM_RANGE(0x3000c0, 0x3000c3) AM_DEVWRITE8("ymsnd", ym2413_device, write, 0x00ff) | |
| 2211 | 2151 | AM_RANGE(0x300100, 0x30011f) AM_DEVREADWRITE8("rtc", msm6242_device, read, write,0x00ff) |
| 2212 | 2152 | AM_RANGE(0x300140, 0x300143) AM_DEVWRITE8("aysnd", ay8910_device, address_data_w, 0x00ff) |
| 2213 | 2153 | AM_RANGE(0x300180, 0x300181) AM_READ_PORT("P1") |
| r243192 | r243193 | |
| 2270 | 2210 | AM_RANGE(0xe00308, 0xe00309) AM_WRITE(ddenlovr_coincounter_0_w) // Coin Counters |
| 2271 | 2211 | AM_RANGE(0xe0030c, 0xe0030d) AM_WRITE(ddenlovr_coincounter_1_w) // |
| 2272 | 2212 | |
| 2273 | AM_RANGE(0xe00400, 0xe00403) AM_DEVWRITE8("ym | |
| 2213 | AM_RANGE(0xe00400, 0xe00403) AM_DEVWRITE8("ymsnd", ym2413_device, write, 0x00ff) | |
| 2274 | 2214 | AM_RANGE(0xe00500, 0xe0051f) AM_DEVREADWRITE8("rtc", msm6242_device, read, write,0x00ff) |
| 2275 | 2215 | AM_RANGE(0xe00600, 0xe00603) AM_DEVWRITE8("aysnd", ay8910_device, address_data_w, 0x00ff) |
| 2276 | 2216 | AM_RANGE(0xe00604, 0xe00605) AM_DEVREAD8("aysnd", ay8910_device, data_r, 0x00ff) |
| r243192 | r243193 | |
| 2326 | 2266 | AM_RANGE(0x22, 0x23) AM_READ(rongrong_input2_r) |
| 2327 | 2267 | |
| 2328 | 2268 | AM_RANGE(0x40, 0x40) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 2329 | AM_RANGE(0x60, 0x61) AM_DEVWRITE("ym | |
| 2269 | AM_RANGE(0x60, 0x61) AM_DEVWRITE("ymsnd", ym2413_device, write) | |
| 2330 | 2270 | |
| 2331 | 2271 | AM_RANGE(0x80, 0x83) AM_WRITE(ddenlovr_palette_base_w) |
| 2332 | 2272 | AM_RANGE(0x84, 0x87) AM_WRITE(ddenlovr_palette_mask_w) |
| r243192 | r243193 | |
| 2363 | 2303 | |
| 2364 | 2304 | AM_RANGE(0x20, 0x2f) AM_DEVREADWRITE("rtc", msm6242_device, read, write) |
| 2365 | 2305 | AM_RANGE(0x40, 0x40) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 2366 | AM_RANGE(0x60, 0x61) AM_DEVWRITE("ym | |
| 2306 | AM_RANGE(0x60, 0x61) AM_DEVWRITE("ymsnd", ym2413_device, write) | |
| 2367 | 2307 | |
| 2368 | 2308 | AM_RANGE(0x80, 0x83) AM_WRITE(ddenlovr_palette_base_w) |
| 2369 | 2309 | AM_RANGE(0x84, 0x87) AM_WRITE(ddenlovr_palette_mask_w) |
| r243192 | r243193 | |
| 2517 | 2457 | AM_RANGE(0x02, 0x02) AM_READNOP // read just before port 00 |
| 2518 | 2458 | AM_RANGE(0x04, 0x04) AM_NOP // read only once at the start |
| 2519 | 2459 | AM_RANGE(0x06, 0x06) AM_WRITENOP // almost always 1, sometimes 0 |
| 2520 | AM_RANGE(0x08, 0x09) AM_DEVWRITE("ym | |
| 2460 | AM_RANGE(0x08, 0x09) AM_DEVWRITE("ymsnd", ym2413_device, write) | |
| 2521 | 2461 | AM_RANGE(0x0c, 0x0c) AM_DEVWRITE("aysnd", ay8910_device, data_w) |
| 2522 | 2462 | AM_RANGE(0x0e, 0x0e) AM_DEVWRITE("aysnd", ay8910_device, address_w) |
| 2523 | 2463 | ADDRESS_MAP_END |
| r243192 | r243193 | |
| 2800 | 2740 | AM_RANGE(0x93, 0x93) AM_WRITE(hanakanz_coincounter_w) |
| 2801 | 2741 | AM_RANGE(0x94, 0x94) AM_WRITE(hanakanz_keyb_w) |
| 2802 | 2742 | AM_RANGE(0x96, 0x96) AM_READ(hanakanz_rand_r) |
| 2803 | AM_RANGE(0xa0, 0xa1) AM_DEVWRITE("ym | |
| 2743 | AM_RANGE(0xa0, 0xa1) AM_DEVWRITE("ymsnd", ym2413_device, write) | |
| 2804 | 2744 | AM_RANGE(0xc0, 0xc0) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 2805 | 2745 | AM_RANGE(0xe0, 0xef) AM_DEVREADWRITE("rtc", msm6242_device, read, write) |
| 2806 | 2746 | ADDRESS_MAP_END |
| r243192 | r243193 | |
| 2816 | 2756 | AM_RANGE(0x80, 0x80) AM_WRITE(hanakanz_blitter_data_w) |
| 2817 | 2757 | AM_RANGE(0x81, 0x81) AM_WRITE(hanakanz_palette_w) |
| 2818 | 2758 | AM_RANGE(0x83, 0x84) AM_READ(hanakanz_gfxrom_r) |
| 2819 | AM_RANGE(0xa0, 0xa1) AM_DEVWRITE("ym | |
| 2759 | AM_RANGE(0xa0, 0xa1) AM_DEVWRITE("ymsnd", ym2413_device, write) | |
| 2820 | 2760 | AM_RANGE(0xb0, 0xb0) AM_READ_PORT("SYSTEM") |
| 2821 | 2761 | AM_RANGE(0xb1, 0xb2) AM_READ(hanakanz_keyb_r) |
| 2822 | 2762 | AM_RANGE(0xb3, 0xb3) AM_WRITE(hanakanz_coincounter_w) |
| r243192 | r243193 | |
| 2838 | 2778 | AM_RANGE(0x80, 0x80) AM_WRITE(hanakanz_blitter_data_w) |
| 2839 | 2779 | AM_RANGE(0x81, 0x81) AM_WRITE(hanakanz_palette_w) |
| 2840 | 2780 | AM_RANGE(0x83, 0x84) AM_READ(hanakanz_gfxrom_r) |
| 2841 | AM_RANGE(0xa0, 0xa1) AM_DEVWRITE("ym | |
| 2781 | AM_RANGE(0xa0, 0xa1) AM_DEVWRITE("ymsnd", ym2413_device, write) | |
| 2842 | 2782 | AM_RANGE(0xb0, 0xb0) AM_READ_PORT("SYSTEM") |
| 2843 | 2783 | // AM_RANGE(0xb1, 0xb2) AM_READ(hanakanz_keyb_r) |
| 2844 | 2784 | AM_RANGE(0xb1, 0xb1) AM_READ_PORT("KEYB0") |
| r243192 | r243193 | |
| 2862 | 2802 | AM_RANGE(0x80, 0x80) AM_WRITE(hanakanz_blitter_data_w) |
| 2863 | 2803 | AM_RANGE(0x81, 0x81) AM_WRITE(hanakanz_palette_w) |
| 2864 | 2804 | AM_RANGE(0x83, 0x84) AM_READ(hanakanz_gfxrom_r) |
| 2865 | AM_RANGE(0xa0, 0xa1) AM_DEVWRITE("ym | |
| 2805 | AM_RANGE(0xa0, 0xa1) AM_DEVWRITE("ymsnd", ym2413_device, write) | |
| 2866 | 2806 | AM_RANGE(0x90, 0x90) AM_READ_PORT("SYSTEM") |
| 2867 | 2807 | // AM_RANGE(0x91, 0x91) AM_READ(hanakanz_keyb_r) |
| 2868 | 2808 | AM_RANGE(0x91, 0x91) AM_READ_PORT("KEYB0") |
| r243192 | r243193 | |
| 2901 | 2841 | AM_RANGE(0x94, 0x94) AM_READ_PORT("SYSTEM") |
| 2902 | 2842 | AM_RANGE(0x95, 0x96) AM_READ(hanakanz_keyb_r) |
| 2903 | 2843 | AM_RANGE(0x97, 0x97) AM_WRITE(hanakanz_coincounter_w) |
| 2904 | AM_RANGE(0xa0, 0xa1) AM_DEVWRITE("ym | |
| 2844 | AM_RANGE(0xa0, 0xa1) AM_DEVWRITE("ymsnd", ym2413_device, write) | |
| 2905 | 2845 | AM_RANGE(0xc0, 0xc0) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 2906 | 2846 | AM_RANGE(0xe0, 0xef) AM_DEVREADWRITE("rtc", msm6242_device, read, write) |
| 2907 | 2847 | ADDRESS_MAP_END |
| r243192 | r243193 | |
| 3029 | 2969 | AM_RANGE(0x63, 0x63) AM_MIRROR(0xff00) AM_READ_PORT("DSW4") |
| 3030 | 2970 | AM_RANGE(0x64, 0x64) AM_MIRROR(0xff00) AM_READ_PORT("DSW5") // DSW 1-4 high bits |
| 3031 | 2971 | AM_RANGE(0x80, 0x80) AM_MIRROR(0xff00) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 3032 | AM_RANGE(0xa0, 0xa1) AM_MIRROR(0xff00) AM_DEVWRITE("ym | |
| 2972 | AM_RANGE(0xa0, 0xa1) AM_MIRROR(0xff00) AM_DEVWRITE("ymsnd", ym2413_device, write) | |
| 3033 | 2973 | AM_RANGE(0xc0, 0xcf) AM_MIRROR(0xff00) AM_DEVREADWRITE("rtc", msm6242_device, read, write) |
| 3034 | 2974 | AM_RANGE(0xe0, 0xe1) AM_MIRROR(0xff00) AM_DEVWRITE("aysnd", ay8910_device, address_data_w) |
| 3035 | 2975 | ADDRESS_MAP_END |
| r243192 | r243193 | |
| 3138 | 3078 | AM_RANGE(0x22, 0x22) AM_READ(mjmyster_coins_r) |
| 3139 | 3079 | AM_RANGE(0x23, 0x23) AM_READ(mjmyster_keyb_r) |
| 3140 | 3080 | AM_RANGE(0x40, 0x40) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 3141 | AM_RANGE(0x42, 0x43) AM_DEVWRITE("ym | |
| 3081 | AM_RANGE(0x42, 0x43) AM_DEVWRITE("ymsnd", ym2413_device, write) | |
| 3142 | 3082 | AM_RANGE(0x44, 0x44) AM_DEVREAD("aysnd", ay8910_device, data_r) |
| 3143 | 3083 | AM_RANGE(0x46, 0x46) AM_DEVWRITE("aysnd", ay8910_device, data_w) |
| 3144 | 3084 | AM_RANGE(0x48, 0x48) AM_DEVWRITE("aysnd", ay8910_device, address_w) |
| r243192 | r243193 | |
| 3303 | 3243 | AM_RANGE(0x03, 0x03) AM_READ(rongrong_gfxrom_r) |
| 3304 | 3244 | AM_RANGE(0x1c, 0x1c) AM_READNOP AM_WRITE(mjmyster_rambank_w) |
| 3305 | 3245 | AM_RANGE(0x1e, 0x1e) AM_WRITE(hginga_rombank_w) |
| 3306 | AM_RANGE(0x22, 0x23) AM_DEVWRITE("ym | |
| 3246 | AM_RANGE(0x22, 0x23) AM_DEVWRITE("ymsnd", ym2413_device, write) | |
| 3307 | 3247 | AM_RANGE(0x24, 0x24) AM_DEVREAD("aysnd", ay8910_device, data_r) |
| 3308 | 3248 | AM_RANGE(0x26, 0x26) AM_DEVWRITE("aysnd", ay8910_device, data_w) |
| 3309 | 3249 | AM_RANGE(0x28, 0x28) AM_DEVWRITE("aysnd", ay8910_device, address_w) |
| r243192 | r243193 | |
| 3426 | 3366 | AM_RANGE(0x61, 0x61) AM_WRITE(hgokou_input_w) |
| 3427 | 3367 | AM_RANGE(0x62, 0x62) AM_READ(hgokou_input_r) |
| 3428 | 3368 | AM_RANGE(0x80, 0x80) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 3429 | AM_RANGE(0x82, 0x83) AM_DEVWRITE("ym | |
| 3369 | AM_RANGE(0x82, 0x83) AM_DEVWRITE("ymsnd", ym2413_device, write) | |
| 3430 | 3370 | AM_RANGE(0x84, 0x84) AM_DEVREAD("aysnd", ay8910_device, data_r) |
| 3431 | 3371 | AM_RANGE(0x86, 0x86) AM_DEVWRITE("aysnd", ay8910_device, data_w) |
| 3432 | 3372 | AM_RANGE(0x88, 0x88) AM_DEVWRITE("aysnd", ay8910_device, address_w) |
| r243192 | r243193 | |
| 3469 | 3409 | AM_RANGE(0x1c, 0x1c) AM_READNOP AM_WRITE(mjmyster_rambank_w) // ? ack on RTC int |
| 3470 | 3410 | AM_RANGE(0x1e, 0x1e) AM_WRITE(hginga_rombank_w) |
| 3471 | 3411 | AM_RANGE(0x20, 0x20) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 3472 | AM_RANGE(0x22, 0x23) AM_DEVWRITE("ym | |
| 3412 | AM_RANGE(0x22, 0x23) AM_DEVWRITE("ymsnd", ym2413_device, write) | |
| 3473 | 3413 | AM_RANGE(0x24, 0x24) AM_DEVREAD("aysnd", ay8910_device, data_r) |
| 3474 | 3414 | AM_RANGE(0x26, 0x26) AM_DEVWRITE("aysnd", ay8910_device, data_w) |
| 3475 | 3415 | AM_RANGE(0x28, 0x28) AM_DEVWRITE("aysnd", ay8910_device, address_w) |
| r243192 | r243193 | |
| 3560 | 3500 | AM_RANGE(0x1c, 0x1c) AM_READ(hparadis_dsw_r) |
| 3561 | 3501 | AM_RANGE(0x1e, 0x1e) AM_WRITE(hparadis_select_w) |
| 3562 | 3502 | AM_RANGE(0x40, 0x40) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 3563 | AM_RANGE(0x60, 0x61) AM_DEVWRITE("ym | |
| 3503 | AM_RANGE(0x60, 0x61) AM_DEVWRITE("ymsnd", ym2413_device, write) | |
| 3564 | 3504 | AM_RANGE(0x80, 0x83) AM_WRITE(ddenlovr_palette_base_w) |
| 3565 | 3505 | AM_RANGE(0x84, 0x87) AM_WRITE(ddenlovr_palette_mask_w) |
| 3566 | 3506 | AM_RANGE(0x88, 0x8b) AM_WRITE(ddenlovr_transparency_pen_w) |
| r243192 | r243193 | |
| 3606 | 3546 | AM_RANGE(0x22, 0x22) AM_READ(mjmywrld_coins_r) |
| 3607 | 3547 | AM_RANGE(0x23, 0x23) AM_READ(mjmyster_keyb_r) |
| 3608 | 3548 | AM_RANGE(0x40, 0x40) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 3609 | AM_RANGE(0x42, 0x43) AM_DEVWRITE("ym | |
| 3549 | AM_RANGE(0x42, 0x43) AM_DEVWRITE("ymsnd", ym2413_device, write) | |
| 3610 | 3550 | AM_RANGE(0x44, 0x44) AM_DEVREAD("aysnd", ay8910_device, data_r) |
| 3611 | 3551 | AM_RANGE(0x46, 0x46) AM_DEVWRITE("aysnd", ay8910_device, data_w) |
| 3612 | 3552 | AM_RANGE(0x48, 0x48) AM_DEVWRITE("aysnd", ay8910_device, address_w) |
| r243192 | r243193 | |
| 3706 | 3646 | AM_RANGE(0xe00308, 0xe00309) AM_WRITE(ddenlovr_coincounter_0_w) // Coin Counters |
| 3707 | 3647 | AM_RANGE(0xe0030c, 0xe0030d) AM_WRITE(ddenlovr_coincounter_1_w) // |
| 3708 | 3648 | |
| 3709 | AM_RANGE(0xe00400, 0xe00403) AM_DEVWRITE8("ym | |
| 3649 | AM_RANGE(0xe00400, 0xe00403) AM_DEVWRITE8("ymsnd", ym2413_device, write, 0x00ff) | |
| 3710 | 3650 | AM_RANGE(0xe00500, 0xe0051f) AM_DEVREADWRITE8("rtc", msm6242_device, read, write, 0x00ff) |
| 3711 | 3651 | AM_RANGE(0xe00600, 0xe00603) AM_DEVWRITE8("aysnd", ay8910_device, address_data_w, 0x00ff) |
| 3712 | 3652 | AM_RANGE(0xe00604, 0xe00605) AM_DEVREAD8("aysnd", ay8910_device, data_r, 0x00ff) |
| r243192 | r243193 | |
| 3797 | 3737 | AM_RANGE(0x0100, 0x0100) AM_READ_PORT("DSW1") |
| 3798 | 3738 | AM_RANGE(0x0181, 0x0181) AM_WRITENOP // ? int. enable |
| 3799 | 3739 | AM_RANGE(0x0184, 0x0184) AM_WRITE(mjflove_coincounter_w) |
| 3800 | AM_RANGE(0x0200, 0x0201) AM_DEVWRITE("ym | |
| 3740 | AM_RANGE(0x0200, 0x0201) AM_DEVWRITE("ymsnd", ym2413_device, write) | |
| 3801 | 3741 | AM_RANGE(0x0280, 0x028f) AM_DEVREADWRITE("rtc", msm6242_device, read, write) |
| 3802 | 3742 | AM_RANGE(0x0300, 0x0301) AM_DEVWRITE("aysnd", ay8910_device, address_data_w) |
| 3803 | 3743 | AM_RANGE(0x0380, 0x0380) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| r243192 | r243193 | |
| 3838 | 3778 | AM_RANGE(0x60, 0x60) AM_WRITE(hanakanz_blitter_data_w) |
| 3839 | 3779 | AM_RANGE(0x61, 0x61) AM_WRITE(hanakanz_palette_w) |
| 3840 | 3780 | AM_RANGE(0x63, 0x64) AM_READ(hanakanz_gfxrom_r) |
| 3841 | AM_RANGE(0x80, 0x81) AM_DEVWRITE("ym | |
| 3781 | AM_RANGE(0x80, 0x81) AM_DEVWRITE("ymsnd", ym2413_device, write) | |
| 3842 | 3782 | AM_RANGE(0xa0, 0xa0) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 3843 | 3783 | AM_RANGE(0xc0, 0xcf) AM_DEVREADWRITE("rtc", msm6242_device, read, write) |
| 3844 | 3784 | ADDRESS_MAP_END |
| r243192 | r243193 | |
| 3901 | 3841 | static ADDRESS_MAP_START( sryudens_portmap, AS_IO, 8, ddenlovr_state ) |
| 3902 | 3842 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 3903 | 3843 | AM_RANGE(0x00, 0x00) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 3904 | AM_RANGE(0x02, 0x03) AM_DEVWRITE("ym | |
| 3844 | AM_RANGE(0x02, 0x03) AM_DEVWRITE("ymsnd", ym2413_device, write) | |
| 3905 | 3845 | AM_RANGE(0x04, 0x05) AM_DEVWRITE("aysnd", ay8910_device, address_data_w) |
| 3906 | 3846 | AM_RANGE(0x1c, 0x1c) AM_READNOP AM_WRITE(sryudens_rambank_w) // ? ack on RTC int |
| 3907 | 3847 | AM_RANGE(0x1e, 0x1e) AM_WRITE(mjflove_rombank_w) |
| r243192 | r243193 | |
| 3988 | 3928 | AM_RANGE(0x70, 0x70) AM_WRITE(quizchq_oki_bank_w) |
| 3989 | 3929 | AM_RANGE(0x80, 0x80) AM_RAM |
| 3990 | 3930 | AM_RANGE(0x90, 0x90) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 3991 | AM_RANGE(0x92, 0x93) AM_DEVWRITE("ym | |
| 3931 | AM_RANGE(0x92, 0x93) AM_DEVWRITE("ymsnd", ym2413_device, write) | |
| 3992 | 3932 | AM_RANGE(0x94, 0x95) AM_DEVWRITE("aysnd", ay8910_device, address_data_w) |
| 3993 | 3933 | ADDRESS_MAP_END |
| 3994 | 3934 | |
| r243192 | r243193 | |
| 4060 | 4000 | AM_RANGE(0x38, 0x38) AM_READNOP // ? ack or watchdog |
| 4061 | 4001 | AM_RANGE(0x40, 0x41) AM_WRITE(mjflove_blitter_w) |
| 4062 | 4002 | AM_RANGE(0x43, 0x43) AM_READ(rongrong_gfxrom_r) |
| 4063 | AM_RANGE(0x50, 0x51) AM_DEVWRITE("ym | |
| 4003 | AM_RANGE(0x50, 0x51) AM_DEVWRITE("ymsnd", ym2413_device, write) | |
| 4064 | 4004 | AM_RANGE(0x54, 0x54) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 4065 | 4005 | AM_RANGE(0x58, 0x58) AM_DEVWRITE("aysnd", ay8910_device, address_w) |
| 4066 | 4006 | AM_RANGE(0x5c, 0x5c) AM_DEVREADWRITE("aysnd", ay8910_device, data_r, data_w) // dsw |
| r243192 | r243193 | |
| 4214 | 4154 | AM_RANGE( 0x40, 0x40 ) AM_DEVWRITE("aysnd", ay8910_device, address_w) // AY8910 |
| 4215 | 4155 | AM_RANGE( 0x42, 0x42 ) AM_DEVREAD("aysnd", ay8910_device, data_r) // |
| 4216 | 4156 | AM_RANGE( 0x44, 0x44 ) AM_DEVWRITE("aysnd", ay8910_device, data_w) // |
| 4217 | AM_RANGE( 0x46, 0x47 ) AM_DEVWRITE("ym | |
| 4157 | AM_RANGE( 0x46, 0x47 ) AM_DEVWRITE("ymsnd", ym2413_device, write) // | |
| 4218 | 4158 | AM_RANGE( 0x80, 0x8f ) AM_DEVREADWRITE("rtc", msm6242_device, read, write) |
| 4219 | 4159 | AM_RANGE( 0xa0, 0xa3 ) AM_WRITE(ddenlovr_palette_base_w) // ddenlovr mixer chip |
| 4220 | 4160 | AM_RANGE( 0xa4, 0xa7 ) AM_WRITE(ddenlovr_palette_mask_w) |
| r243192 | r243193 | |
| 4286 | 4226 | MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(ddenlovr_state, htengoku_dsw_w)) |
| 4287 | 4227 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20) |
| 4288 | 4228 | |
| 4289 | MCFG_SOUND_ADD("ym | |
| 4229 | MCFG_SOUND_ADD("ymsnd", YM2413, 3579545) | |
| 4290 | 4230 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 4291 | 4231 | |
| 4292 | 4232 | /* devices */ |
| r243192 | r243193 | |
| 4401 | 4341 | AM_RANGE(0x42, 0x44) AM_READ(hanakanz_gfxrom_r) |
| 4402 | 4342 | AM_RANGE(0x8a, 0x8b) AM_READ(daimyojn_year_hack_r) // ? |
| 4403 | 4343 | AM_RANGE(0x80, 0x8f) AM_DEVREADWRITE("rtc", msm6242_device, read, write) |
| 4404 | AM_RANGE(0xa0, 0xa1) AM_DEVWRITE("ym | |
| 4344 | AM_RANGE(0xa0, 0xa1) AM_DEVWRITE("ymsnd", ym2413_device, write) | |
| 4405 | 4345 | AM_RANGE(0xa2, 0xa2) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 4406 | 4346 | AM_RANGE(0xa8, 0xa8) AM_READ_PORT("SYSTEM") |
| 4407 | 4347 | AM_RANGE(0xaa, 0xaa) AM_READ(daimyojn_keyb1_r) |
| r243192 | r243193 | |
| 9361 | 9301 | save_item(NAME(m_mjflove_irq_cause)); |
| 9362 | 9302 | save_item(NAME(m_daimyojn_palette_sel)); |
| 9363 | 9303 | save_item(NAME(m_palram)); |
| 9304 | ||
| 9305 | save_item(NAME(m_irq_count)); | |
| 9364 | 9306 | } |
| 9365 | 9307 | |
| 9366 | 9308 | MACHINE_RESET_MEMBER(ddenlovr_state,ddenlovr) |
| r243192 | r243193 | |
| 9381 | 9323 | m_hginga_rombank = 0; |
| 9382 | 9324 | m_mjflove_irq_cause = 0; |
| 9383 | 9325 | m_daimyojn_palette_sel = 0; |
| 9326 | m_irq_count = 0; | |
| 9384 | 9327 | |
| 9385 | 9328 | m_quiz365_protection[0] = 0; |
| 9386 | 9329 | m_quiz365_protection[1] = 0; |
| r243192 | r243193 | |
| 9492 | 9435 | /* sound hardware */ |
| 9493 | 9436 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 9494 | 9437 | |
| 9495 | MCFG_SOUND_ADD("ym | |
| 9438 | MCFG_SOUND_ADD("ymsnd", YM2413, XTAL_28_63636MHz / 8) | |
| 9496 | 9439 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) |
| 9497 | 9440 | |
| 9498 | 9441 | MCFG_SOUND_ADD("aysnd", AY8910, XTAL_28_63636MHz / 16) // or /8 ? |
| r243192 | r243193 | |
| 9610 | 9553 | /* sound hardware */ |
| 9611 | 9554 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 9612 | 9555 | |
| 9613 | MCFG_SOUND_ADD("ym | |
| 9556 | MCFG_SOUND_ADD("ymsnd", YM2413, XTAL_28_63636MHz/8) // 3.579545Mhz, verified | |
| 9614 | 9557 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.50) |
| 9615 | 9558 | |
| 9616 | 9559 | MCFG_OKIM6295_ADD("oki", XTAL_28_63636MHz/28, OKIM6295_PIN7_HIGH) // clock frequency verified 1.022MHz, pin 7 verified high |
| r243192 | r243193 | |
| 9694 | 9637 | /* sound hardware */ |
| 9695 | 9638 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 9696 | 9639 | |
| 9697 | MCFG_SOUND_ADD("ym | |
| 9640 | MCFG_SOUND_ADD("ymsnd", YM2413, 3579545) | |
| 9698 | 9641 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) |
| 9699 | 9642 | |
| 9700 | 9643 | MCFG_SOUND_ADD("aysnd", AY8910, 3579545) |
| r243192 | r243193 | |
| 9771 | 9714 | /* sound hardware */ |
| 9772 | 9715 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 9773 | 9716 | |
| 9774 | MCFG_SOUND_ADD("ym | |
| 9717 | MCFG_SOUND_ADD("ymsnd", YM2413, 3579545) | |
| 9775 | 9718 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) |
| 9776 | 9719 | |
| 9777 | 9720 | MCFG_OKIM6295_ADD("oki", 1022720, OKIM6295_PIN7_HIGH) // clock frequency & pin 7 not verified |
| r243192 | r243193 | |
| 9817 | 9760 | /* sound hardware */ |
| 9818 | 9761 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 9819 | 9762 | |
| 9820 | MCFG_SOUND_ADD("ym | |
| 9763 | MCFG_SOUND_ADD("ymsnd", YM2413, XTAL_28_37516MHz / 8) | |
| 9821 | 9764 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) |
| 9822 | 9765 | |
| 9823 | 9766 | MCFG_OKIM6295_ADD("oki", XTAL_28_37516MHz / 28, OKIM6295_PIN7_HIGH) |
| r243192 | r243193 | |
| 10186 | 10129 | /* sound hardware */ |
| 10187 | 10130 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 10188 | 10131 | |
| 10189 | MCFG_SOUND_ADD("ym | |
| 10132 | MCFG_SOUND_ADD("ymsnd", YM2413, XTAL_28_63636MHz / 8) | |
| 10190 | 10133 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) |
| 10191 | 10134 | |
| 10192 | 10135 | MCFG_OKIM6295_ADD("oki", XTAL_28_63636MHz / 28, OKIM6295_PIN7_HIGH) |
| r243192 | r243193 | |
| 10229 | 10172 | /* sound hardware */ |
| 10230 | 10173 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 10231 | 10174 | |
| 10232 | MCFG_SOUND_ADD("ym | |
| 10175 | MCFG_SOUND_ADD("ymsnd", YM2413, XTAL_28_63636MHz / 8) | |
| 10233 | 10176 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) |
| 10234 | 10177 | |
| 10235 | 10178 | MCFG_SOUND_ADD("aysnd", AY8910, XTAL_28_63636MHz / 8) |
| r243192 | r243193 | |
| 10276 | 10219 | /* sound hardware */ |
| 10277 | 10220 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 10278 | 10221 | |
| 10279 | MCFG_SOUND_ADD("ym | |
| 10222 | MCFG_SOUND_ADD("ymsnd", YM2413, XTAL_28_63636MHz / 8) | |
| 10280 | 10223 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) |
| 10281 | 10224 | |
| 10282 | 10225 | MCFG_SOUND_ADD("aysnd", AY8910, XTAL_28_63636MHz / 8) |
| r243192 | r243193 | |
| 10343 | 10286 | /* sound hardware */ |
| 10344 | 10287 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 10345 | 10288 | |
| 10346 | MCFG_SOUND_ADD("ym | |
| 10289 | MCFG_SOUND_ADD("ymsnd", YM2413, XTAL_28_63636MHz / 8) | |
| 10347 | 10290 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) |
| 10348 | 10291 | |
| 10349 | 10292 | MCFG_SOUND_ADD("aysnd", AY8910, XTAL_28_63636MHz / 8) |
| r243192 | r243193 | |
| 10393 | 10336 | /* sound hardware */ |
| 10394 | 10337 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 10395 | 10338 | |
| 10396 | MCFG_SOUND_ADD("ym | |
| 10339 | MCFG_SOUND_ADD("ymsnd", YM2413, XTAL_28_63636MHz / 8) | |
| 10397 | 10340 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) |
| 10398 | 10341 | |
| 10399 | 10342 | MCFG_OKIM6295_ADD("oki", XTAL_28_63636MHz / 28, OKIM6295_PIN7_HIGH) |
| r243192 | r243193 | |
|---|---|---|
| 530 | 530 | { |
| 531 | 531 | save_item(NAME(m_automat_adpcm_byte)); |
| 532 | 532 | save_item(NAME(m_automat_msm5205_vclk_toggle)); |
| 533 | save_item(NAME(m_automat_scroll_regs)); | |
| 533 | save_item(NAME(m_automat_scroll_regs)); | |
| 534 | 534 | } |
| 535 | 535 | |
| 536 | 536 |
| r243192 | r243193 | |
|---|---|---|
| 1906 | 1906 | |
| 1907 | 1907 | /******************************************************************************/ |
| 1908 | 1908 | |
| 1909 | /* handler called by the 3812 emulator when the internal timers cause an IRQ */ | |
| 1910 | WRITE_LINE_MEMBER(dec8_state::irqhandler) | |
| 1911 | { | |
| 1912 | m_audiocpu->set_input_line(0, state); /* M6502_IRQ_LINE */ | |
| 1913 | } | |
| 1914 | ||
| 1915 | /******************************************************************************/ | |
| 1916 | ||
| 1909 | 1917 | INTERRUPT_GEN_MEMBER(dec8_state::gondo_interrupt) |
| 1910 | 1918 | { |
| 1911 | 1919 | if (m_nmi_enable) |
| r243192 | r243193 | |
| 2246 | 2254 | MCFG_SOUND_ROUTE(3, "mono", 0.20) |
| 2247 | 2255 | |
| 2248 | 2256 | MCFG_SOUND_ADD("ym2", YM3812, 3000000) |
| 2249 | MCFG_YM3812_IRQ_HANDLER(I | |
| 2257 | MCFG_YM3812_IRQ_HANDLER(WRITELINE(dec8_state, irqhandler)) | |
| 2250 | 2258 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.70) |
| 2251 | 2259 | MACHINE_CONFIG_END |
| 2252 | 2260 | |
| r243192 | r243193 | |
| 2410 | 2418 | MCFG_SOUND_ROUTE(3, "mono", 0.20) |
| 2411 | 2419 | |
| 2412 | 2420 | MCFG_SOUND_ADD("ym2", YM3812, 3000000) |
| 2413 | MCFG_YM3812_IRQ_HANDLER(I | |
| 2421 | MCFG_YM3812_IRQ_HANDLER(WRITELINE(dec8_state, irqhandler)) | |
| 2414 | 2422 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.70) |
| 2415 | 2423 | MACHINE_CONFIG_END |
| 2416 | 2424 | |
| r243192 | r243193 | |
| 2467 | 2475 | MCFG_SOUND_ROUTE(3, "mono", 0.50) |
| 2468 | 2476 | |
| 2469 | 2477 | MCFG_SOUND_ADD("ym2", YM3812, 3000000) |
| 2470 | MCFG_YM3812_IRQ_HANDLER(I | |
| 2478 | MCFG_YM3812_IRQ_HANDLER(WRITELINE(dec8_state, irqhandler)) | |
| 2471 | 2479 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.70) |
| 2472 | 2480 | MACHINE_CONFIG_END |
| 2473 | 2481 |
| r243192 | r243193 | |
|---|---|---|
| 221 | 221 | GFXDECODE_END |
| 222 | 222 | |
| 223 | 223 | |
| 224 | WRITE_LINE_MEMBER(deniam_state::irqhandler) | |
| 225 | { | |
| 226 | /* system 16c doesn't have the sound CPU */ | |
| 227 | if (m_audiocpu != NULL) | |
| 228 | m_audiocpu->set_input_line(0, state); | |
| 229 | } | |
| 230 | ||
| 231 | ||
| 232 | ||
| 224 | 233 | void deniam_state::machine_start() |
| 225 | 234 | { |
| 226 | 235 | save_item(NAME(m_display_enable)); |
| r243192 | r243193 | |
| 280 | 289 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 281 | 290 | |
| 282 | 291 | MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_25MHz/6) /* "SM64" ym3812 clone; 4.166470 measured, = 4.166666Mhz verified */ |
| 283 | MCFG_YM3812_IRQ_HANDLER(I | |
| 292 | MCFG_YM3812_IRQ_HANDLER(WRITELINE(deniam_state, irqhandler)) | |
| 284 | 293 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.60) |
| 285 | 294 | |
| 286 | 295 | MCFG_OKIM6295_ADD("oki", XTAL_25MHz/24, OKIM6295_PIN7_HIGH) /* 1.041620 measured, = 1.0416666Mhz verified */ |
| r243192 | r243193 | |
| 313 | 322 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 314 | 323 | |
| 315 | 324 | MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_25MHz/6) /* "SM64" ym3812 clone; 4.166470 measured, = 4.166666Mhz verified) */ |
| 325 | MCFG_YM3812_IRQ_HANDLER(WRITELINE(deniam_state, irqhandler)) | |
| 316 | 326 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.60) |
| 317 | 327 | |
| 318 | 328 | MCFG_OKIM6295_ADD("oki", XTAL_25MHz/24, OKIM6295_PIN7_HIGH) /* 1.041620 measured, = 1.0416666Mhz verified */ |
| r243192 | r243193 | |
|---|---|---|
| 164 | 164 | |
| 165 | 165 | required_device<cpu_device> m_maincpu; |
| 166 | 166 | required_ioport m_vblank; |
| 167 | ||
| 167 | ||
| 168 | 168 | UINT32 *m_vram; |
| 169 | 169 | int m_vbuffer; |
| 170 | 170 | int m_flash_roms; |
| 171 | 171 | int m_old_vbuf; |
| 172 | 172 | UINT32 m_flash_cmd; |
| 173 | 173 | INT32 m_first_offset; |
| 174 | ||
| 174 | ||
| 175 | 175 | DECLARE_READ32_MEMBER(flash_r); |
| 176 | 176 | DECLARE_WRITE32_MEMBER(flash_w); |
| 177 | 177 | DECLARE_WRITE32_MEMBER(vram_w); |
| r243192 | r243193 | |
| 179 | 179 | DECLARE_WRITE32_MEMBER(vbuffer_w); |
| 180 | 180 | DECLARE_WRITE32_MEMBER(coin_w); |
| 181 | 181 | DECLARE_READ32_MEMBER(vblank_r); |
| 182 | ||
| 182 | ||
| 183 | 183 | DECLARE_DRIVER_INIT(elfin); |
| 184 | 184 | DECLARE_DRIVER_INIT(jumpjump); |
| 185 | 185 | DECLARE_DRIVER_INIT(xfiles); |
| 186 | 186 | DECLARE_DRIVER_INIT(xfilesk); |
| 187 | 187 | DECLARE_DRIVER_INIT(kdynastg); |
| 188 | 188 | DECLARE_DRIVER_INIT(fmaniac3); |
| 189 | ||
| 189 | ||
| 190 | 190 | virtual void machine_start(); |
| 191 | 191 | virtual void machine_reset(); |
| 192 | 192 | virtual void video_start(); |
| 193 | ||
| 193 | ||
| 194 | 194 | UINT32 screen_update_dgpix(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 195 | 195 | }; |
| 196 | 196 |
| r243192 | r243193 | |
|---|---|---|
| 302 | 302 | ------------------------------------------------ |
| 303 | 303 | |
| 304 | 304 | |
| 305 | Donkey Kong Notes | |
| 306 | ================= | |
| 307 | ||
| 308 | Nintendo Service Department Bulletin # TKG-02 12-11-81 | |
| 309 | GAME: Donkey Kong | |
| 310 | SUBJECT: Speed-up Kit #1 | |
| 311 | ||
| 312 | TO prevent extremely long play times, we are making available | |
| 313 | a speed-up kit. This kit prevents players from waiting on top | |
| 314 | of ladders, on screen #1, while the barrels roll across | |
| 315 | instead of coming donw on top of him. Whit this kit, barrels | |
| 316 | will roll on top of the player on a ladder 70 to 80 percent of | |
| 317 | the time. | |
| 318 | ||
| 319 | Machines above serial #30,000 will have this kit installed at | |
| 320 | the factory, and all TKG4 board sets will come with this kit. | |
| 321 | ||
| 322 | To install this kit in a four-board set, follow these | |
| 323 | instructions: | |
| 324 | ||
| 325 | 1) Remove P.C. Boards from game, leaving them | |
| 326 | attached to P.C. Board bracket. | |
| 327 | ||
| 328 | 2) Using a pair of needle-nose pliers, separate the | |
| 329 | sound P.C. Board fromt he CPU P.C. Board, exposing | |
| 330 | the entire surface of the CPU Board. | |
| 331 | ||
| 332 | 3) Remove the EPROMS's at location 5F, 5A, 5H and 5K | |
| 333 | from the CPU Board. (Note 5A should read 5G - MSH) | |
| 334 | ||
| 335 | 4) Install the speed-up kit EPROM's in the corres- | |
| 336 | ponding locations. | |
| 337 | ||
| 338 | 5) Reconnect the sound P.C. Board to the CPU P.C. | |
| 339 | Board and mount the P.C. Boards in the game. | |
| 340 | -------------------------------------------------------------- | |
| 341 | ||
| 342 | That kit included the following 4 EPROM's | |
| 343 | ||
| 344 | USA (c) 1981 Nintendo of America set | |
| 345 | ------------------------------------ | |
| 346 | ||
| 347 | Filename Label Type Loc/PCB *Label *Loc/PCB CSum | |
| 348 | --------- ---------- ------ ------- ---------- -------- ---- | |
| 349 | 2532.5K TKG4-C-5At 2532 5A(CPU) TKG3-C-5K 5K(CPU) A0F0 | |
| 350 | 2532.5H TKG4-C-5Bt 2532 5B(CPU) TKG3-C-5H 5H(CPU) B2BC | |
| 351 | 2532.5G TKG4-C-5Ct 2532 5C(CPU) TKG3-C-5G 5G(CPU) 73BA | |
| 352 | 2532.5F TKG4-C-5Et 2532 5E(CPU) TKG3-C-5F 5F(CPU) AA97 | |
| 353 | ||
| 354 | Not only did the eprom fix the ladder bug, but it also changed | |
| 355 | the copyright screen to read "(C)1981 Nintendo of America". | |
| 356 | ||
| 357 | ||
| 358 | 305 | D2K Jumpman returns Notes |
| 359 | 306 | ========================= |
| 360 | 307 | |
| r243192 | r243193 | |
| 366 | 313 | 6800 and E800. |
| 367 | 314 | |
| 368 | 315 | |
| 369 | Donkey Kong "Hard" Kit | |
| 370 | ====================== | |
| 316 | Donkey Kong "Hard" Kit | |
| 317 | ====================== | |
| 371 | 318 | |
| 372 | A yet "unconfirmed original" rom replacement kit which is a replacement for | |
| 373 | TKG-03 and -04 boards and greatly increases the speed and amount of fireballs | |
| 374 | showing on all levels. Such behavior can be seen easily on the Rivet Board, | |
| 375 | where most of the fireballs have appeared even before removing the first rivet. | |
| 319 | A yet "unconfirmed original" rom replacement kit which is a replacement for | |
| 320 | TKG-03 and -04 boards and greatly increases the speed and amount of fireballs | |
| 321 | showing on all levels. Such behavior can be seen easily on the Rivet Board, | |
| 322 | where most of the fireballs have appeared even before removing the first rivet. | |
| 376 | 323 | |
| 377 | Hopefully confirmation and information will come along later which confirms | |
| 378 | this is a legitimate Nintendo Kit. | |
| 324 | Hopefully confirmation and information will come along later which confirms | |
| 325 | this is a legitimate Nintendo Kit. | |
| 379 | 326 | |
| 380 | 327 | ***************************************************************************/ |
| 381 | 328 | |
| r243192 | r243193 | |
| 1947 | 1894 | ROM_LOAD( "trs01v1d.bin", 0x0300, 0x0100, BAD_DUMP CRC(1b828315) SHA1(00c9f8c5ae86b68d38c66f9071b5f1ef421c1005) ) /* character color codes on a per-column basis */ |
| 1948 | 1895 | ROM_END |
| 1949 | 1896 | |
| 1950 | ROM_START( dkong ) | |
| 1897 | ROM_START( dkong ) | |
| 1951 | 1898 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 1952 | 1899 | ROM_LOAD( "c_5et_g.bin", 0x0000, 0x1000, CRC(ba70b88b) SHA1(d76ebecfea1af098d843ee7e578e480cd658ac1a) ) |
| 1953 | 1900 | ROM_LOAD( "c_5ct_g.bin", 0x1000, 0x1000, CRC(5ec461ec) SHA1(acb11a8fbdbb3ab46068385fe465f681e3c824bd) ) |
| r243192 | r243193 | |
| 2307 | 2254 | ROM_LOAD( "v-2n.bpr", 0x0200, 0x0100, CRC(dbf185bf) SHA1(2697a991a4afdf079dd0b7e732f71c7618f43b70) ) /* character color codes on a per-column basis */ |
| 2308 | 2255 | ROM_END |
| 2309 | 2256 | |
| 2310 | ROM_START( dkongjre ) | |
| 2257 | ROM_START( dkongjre ) | |
| 2311 | 2258 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 2312 | 2259 | ROM_LOAD( "djr1-c.5b", 0x0000, 0x1000, CRC(ffe9e1a5) SHA1(715dc79d85169b4c1faf43458592e69b434afefd) ) |
| 2313 | 2260 | ROM_CONTINUE( 0x3000, 0x1000 ) |
| r243192 | r243193 | |
| 2344 | 2291 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 2345 | 2292 | ROM_LOAD( "dkjr1-c.5b-p", 0x0000, 0x1000, CRC(8d99b3e0) SHA1(311a9f353e62d9d07c678e45baa2efec575a8f3b) ) // does not match SUM16 of bulletin (see notes), definitely not from Nintendo |
| 2346 | 2293 | ROM_CONTINUE( 0x3000, 0x1000 ) |
| 2347 | ROM_LOAD( "dkjr1-c.5c-p", 0x2000, 0x0800, CRC(b92d258c) SHA1(793483e249d08cbbbefe06d3ddc4c2eda5428ee8) ) | |
| 2294 | ROM_LOAD( "dkjr1-c.5c-p", 0x2000, 0x0800, CRC(b92d258c) SHA1(793483e249d08cbbbefe06d3ddc4c2eda5428ee8) ) // " | |
| 2348 | 2295 | ROM_CONTINUE( 0x4800, 0x0800 ) |
| 2349 | 2296 | ROM_CONTINUE( 0x1000, 0x0800 ) |
| 2350 | 2297 | ROM_CONTINUE( 0x5800, 0x0800 ) |
| r243192 | r243193 | |
|---|---|---|
| 79 | 79 | #include "sound/ay8910.h" |
| 80 | 80 | #include "sound/2203intf.h" |
| 81 | 81 | #include "sound/3812intf.h" |
| 82 | #include "sound/msm5205.h" | |
| 83 | #include "sound/2413intf.h" | |
| 82 | 84 | #include "machine/nvram.h" |
| 83 | 85 | #include "rendlay.h" |
| 84 | 86 | |
| r243192 | r243193 | |
| 532 | 534 | AM_RANGE( 0x74, 0x74 ) AM_WRITE(dynax_blitter_ack_w) // Blitter IRQ Ack |
| 533 | 535 | AM_RANGE( 0x76, 0x76 ) AM_WRITE(dynax_blit_palbank_w) // Layers Palettes (High Bit) |
| 534 | 536 | AM_RANGE( 0x77, 0x77 ) AM_WRITE(hanamai_layer_half_w) // half of the interleaved layer to write to |
| 535 | AM_RANGE( 0x78, 0x79 ) AM_DEVREADWRITE("ym | |
| 537 | AM_RANGE( 0x78, 0x79 ) AM_DEVREADWRITE("ymsnd", ym2203_device, read, write) // 2 x DSW | |
| 536 | 538 | AM_RANGE( 0x7a, 0x7b ) AM_DEVWRITE("aysnd", ay8910_device, address_data_w) // AY8910 |
| 537 | 539 | // AM_RANGE( 0x7c, 0x7c ) AM_WRITENOP // CRT Controller |
| 538 | 540 | // AM_RANGE( 0x7d, 0x7d ) AM_WRITENOP // |
| r243192 | r243193 | |
| 554 | 556 | AM_RANGE( 0x26, 0x26 ) AM_READ_PORT("DSW2") // DSW3 |
| 555 | 557 | AM_RANGE( 0x30, 0x30 ) AM_WRITE(adpcm_reset_w) // MSM5205 reset |
| 556 | 558 | AM_RANGE( 0x32, 0x32 ) AM_WRITE(adpcm_data_w) // MSM5205 data |
| 557 | AM_RANGE( 0x34, 0x35 ) AM_DEVWRITE("ym | |
| 559 | AM_RANGE( 0x34, 0x35 ) AM_DEVWRITE("ymsnd", ym2413_device, write) // | |
| 558 | 560 | AM_RANGE( 0x36, 0x36 ) AM_DEVREAD("aysnd", ay8910_device, data_r) // AY8910, DSW1 |
| 559 | 561 | AM_RANGE( 0x38, 0x38 ) AM_DEVWRITE("aysnd", ay8910_device, data_w) // AY8910 |
| 560 | 562 | AM_RANGE( 0x3a, 0x3a ) AM_DEVWRITE("aysnd", ay8910_device, address_w) // |
| r243192 | r243193 | |
| 638 | 640 | |
| 639 | 641 | AM_RANGE( 0x30, 0x30 ) AM_WRITE(adpcm_reset_w) // MSM5205 reset |
| 640 | 642 | AM_RANGE( 0x32, 0x32 ) AM_WRITE(adpcm_data_w) // MSM5205 data |
| 641 | AM_RANGE( 0x34, 0x35 ) AM_DEVWRITE("ym | |
| 643 | AM_RANGE( 0x34, 0x35 ) AM_DEVWRITE("ymsnd", ym2413_device, write) // | |
| 642 | 644 | |
| 643 | 645 | AM_RANGE( 0x36, 0x36 ) AM_DEVREAD("aysnd", ay8910_device, data_r) // AY8910, DSW1 |
| 644 | 646 | AM_RANGE( 0x38, 0x38 ) AM_DEVWRITE("aysnd", ay8910_device, data_w) // AY8910 |
| r243192 | r243193 | |
| 778 | 780 | AM_RANGE( 0x11, 0x17 ) AM_WRITE(dynax_blitter_rev2_w) // Blitter |
| 779 | 781 | AM_RANGE( 0x20, 0x20 ) AM_WRITE(adpcm_reset_w) // MSM5205 reset |
| 780 | 782 | AM_RANGE( 0x22, 0x22 ) AM_WRITE(adpcm_data_w) // MSM5205 data |
| 781 | AM_RANGE( 0x24, 0x25 ) AM_DEVWRITE("ym | |
| 783 | AM_RANGE( 0x24, 0x25 ) AM_DEVWRITE("ymsnd", ym2413_device, write) // | |
| 782 | 784 | AM_RANGE( 0x28, 0x28 ) AM_DEVWRITE("aysnd", ay8910_device, data_w) // AY8910 |
| 783 | 785 | AM_RANGE( 0x2a, 0x2a ) AM_DEVWRITE("aysnd", ay8910_device, address_w) // |
| 784 | 786 | AM_RANGE( 0x48, 0x48 ) AM_WRITE(dynax_extra_scrollx_w) // screen scroll X |
| r243192 | r243193 | |
| 817 | 819 | AM_RANGE( 0x26, 0x26 ) AM_READ_PORT("DSW1") // DSW3 |
| 818 | 820 | AM_RANGE( 0x30, 0x30 ) AM_WRITE(adpcm_reset_w) // MSM5205 reset |
| 819 | 821 | AM_RANGE( 0x32, 0x32 ) AM_WRITE(adpcm_data_w) // MSM5205 data |
| 820 | AM_RANGE( 0x34, 0x35 ) AM_DEVWRITE("ym | |
| 822 | AM_RANGE( 0x34, 0x35 ) AM_DEVWRITE("ymsnd", ym2413_device, write) // | |
| 821 | 823 | AM_RANGE( 0x38, 0x38 ) AM_DEVWRITE("aysnd", ay8910_device, data_w) // AY8910 |
| 822 | 824 | AM_RANGE( 0x3a, 0x3a ) AM_DEVWRITE("aysnd", ay8910_device, address_w) // |
| 823 | 825 | AM_RANGE( 0x40, 0x40 ) AM_WRITE(dynax_blit_pen_w) // Destination Pen |
| r243192 | r243193 | |
| 845 | 847 | static ADDRESS_MAP_START( sprtmtch_io_map, AS_IO, 8, dynax_state ) |
| 846 | 848 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 847 | 849 | AM_RANGE( 0x01, 0x07 ) AM_WRITE(dynax_blitter_rev2_w) // Blitter |
| 848 | AM_RANGE( 0x10, 0x11 ) AM_DEVREADWRITE("ym | |
| 850 | AM_RANGE( 0x10, 0x11 ) AM_DEVREADWRITE("ymsnd", ym2203_device, read, write) // 2 x DSW | |
| 849 | 851 | // AM_RANGE( 0x12, 0x12 ) AM_WRITENOP // CRT Controller |
| 850 | 852 | // AM_RANGE( 0x13, 0x13 ) AM_WRITENOP // CRT Controller |
| 851 | 853 | AM_RANGE( 0x20, 0x20 ) AM_READ_PORT("P1") // P1 |
| r243192 | r243193 | |
| 891 | 893 | AM_RANGE( 0x63, 0x63 ) AM_READ(hanamai_keyboard_0_r) // P1 |
| 892 | 894 | AM_RANGE( 0x64, 0x64 ) AM_READ_PORT("DSW0") // DSW |
| 893 | 895 | AM_RANGE( 0x67, 0x67 ) AM_READ_PORT("DSW1") // DSW |
| 894 | AM_RANGE( 0x70, 0x71 ) AM_DEVWRITE("ym | |
| 896 | AM_RANGE( 0x70, 0x71 ) AM_DEVWRITE("ymsnd", ym2413_device, write) // | |
| 895 | 897 | // AM_RANGE( 0x80, 0x80 ) AM_WRITENOP // IRQ ack? |
| 896 | 898 | ADDRESS_MAP_END |
| 897 | 899 | |
| r243192 | r243193 | |
| 900 | 902 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 901 | 903 | AM_RANGE( 0x00, 0x00 ) AM_WRITE(adpcm_reset_w) // MSM5205 reset |
| 902 | 904 | AM_RANGE( 0x02, 0x02 ) AM_WRITE(adpcm_data_w) // MSM5205 data |
| 903 | AM_RANGE( 0x04, 0x05 ) AM_DEVWRITE("ym | |
| 905 | AM_RANGE( 0x04, 0x05 ) AM_DEVWRITE("ymsnd", ym2413_device, write) // | |
| 904 | 906 | AM_RANGE( 0x08, 0x08 ) AM_DEVWRITE("aysnd", ay8910_device, data_w) // AY8910 |
| 905 | 907 | AM_RANGE( 0x0a, 0x0a ) AM_DEVWRITE("aysnd", ay8910_device, address_w) // |
| 906 | 908 | AM_RANGE( 0x10, 0x10 ) AM_WRITE(hanamai_keyboard_w) // keyboard row select |
| r243192 | r243193 | |
| 1022 | 1024 | AM_RANGE( 0x10, 0x10 ) AM_WRITE(jantouki_sound_vblank_ack_w) // VBlank IRQ Ack |
| 1023 | 1025 | AM_RANGE( 0x21, 0x21 ) AM_DEVREAD("aysnd", ay8910_device, data_r) // AY8910 |
| 1024 | 1026 | AM_RANGE( 0x22, 0x23 ) AM_DEVWRITE("aysnd", ay8910_device, data_address_w) // |
| 1025 | AM_RANGE( 0x28, 0x29 ) AM_DEVREADWRITE("ym | |
| 1027 | AM_RANGE( 0x28, 0x29 ) AM_DEVREADWRITE("ymsnd", ym2203_device, read, write) // | |
| 1026 | 1028 | AM_RANGE( 0x30, 0x30 ) AM_WRITE(adpcm_reset_w) // MSM5205 reset |
| 1027 | 1029 | AM_RANGE( 0x40, 0x40 ) AM_WRITE(adpcm_data_w) // MSM5205 data |
| 1028 | 1030 | AM_RANGE( 0x50, 0x50 ) AM_READ(jantouki_soundlatch_status_r) // Soundlatch status |
| r243192 | r243193 | |
| 1058 | 1060 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 1059 | 1061 | AM_RANGE( 0x00, 0x00 ) AM_WRITE(adpcm_reset_w) // MSM5205 reset |
| 1060 | 1062 | AM_RANGE( 0x02, 0x02 ) AM_WRITE(adpcm_data_w) // MSM5205 data |
| 1061 | AM_RANGE( 0x04, 0x05 ) AM_DEVWRITE("ym | |
| 1063 | AM_RANGE( 0x04, 0x05 ) AM_DEVWRITE("ymsnd", ym2413_device, write) // | |
| 1062 | 1064 | AM_RANGE( 0x08, 0x08 ) AM_DEVWRITE("aysnd", ay8910_device, data_w) // AY8910 |
| 1063 | 1065 | AM_RANGE( 0x0a, 0x0a ) AM_DEVWRITE("aysnd", ay8910_device, address_w) // |
| 1064 | 1066 | AM_RANGE( 0x11, 0x12 ) AM_WRITE(mjelctrn_blitter_ack_w) //? |
| r243192 | r243193 | |
| 1337 | 1339 | AM_RANGE( 0x10000, 0x10000 ) AM_DEVREAD("aysnd", ay8910_device, data_r) // AY8910 |
| 1338 | 1340 | AM_RANGE( 0x10008, 0x10008 ) AM_DEVWRITE("aysnd", ay8910_device, data_w) // |
| 1339 | 1341 | AM_RANGE( 0x10010, 0x10010 ) AM_DEVWRITE("aysnd", ay8910_device, address_w) // |
| 1340 | AM_RANGE( 0x10020, 0x10021 ) AM_DEVWRITE("ym | |
| 1342 | AM_RANGE( 0x10020, 0x10021 ) AM_DEVWRITE("ymsnd", ym2413_device, write) // | |
| 1341 | 1343 | AM_RANGE( 0x10040, 0x10040 ) AM_WRITE(dynax_blit_pen_w) // Destination Pen |
| 1342 | 1344 | AM_RANGE( 0x10044, 0x10044 ) AM_WRITE(tenkai_blit_dest_w) // Destination Layer |
| 1343 | 1345 | AM_RANGE( 0x10048, 0x10048 ) AM_WRITE(tenkai_blit_palette23_w) // Layers Palettes |
| r243192 | r243193 | |
| 1479 | 1481 | case 0x8050: // CRT controller |
| 1480 | 1482 | case 0x8051: return; |
| 1481 | 1483 | |
| 1482 | case 0x8070: m_ym2413->register_port_w(space, 0, data); return; | |
| 1483 | case 0x8071: m_ym2413->data_port_w(space, 0, data); return; | |
| 1484 | case 0x8070: downcast<ym2413_device *>(m_ymsnd)->register_port_w(space, 0, data); return; | |
| 1485 | case 0x8071: downcast<ym2413_device *>(m_ymsnd)->data_port_w(space, 0, data); return; | |
| 1484 | 1486 | |
| 1485 | 1487 | case 0x8060: m_keyb = data; return; |
| 1486 | 1488 | |
| r243192 | r243193 | |
| 3965 | 3967 | |
| 3966 | 3968 | MACHINE_START_MEMBER(dynax_state,dynax) |
| 3967 | 3969 | { |
| 3970 | m_ymsnd = machine().device("ymsnd"); | |
| 3971 | ||
| 3968 | 3972 | save_item(NAME(m_sound_irq)); |
| 3969 | 3973 | save_item(NAME(m_vblank_irq)); |
| 3970 | 3974 | save_item(NAME(m_blitter_irq)); |
| r243192 | r243193 | |
| 4089 | 4093 | MCFG_SOUND_ADD("aysnd", AY8910, 22000000 / 8) |
| 4090 | 4094 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20) |
| 4091 | 4095 | |
| 4092 | MCFG_SOUND_ADD("ym | |
| 4096 | MCFG_SOUND_ADD("ymsnd", YM2203, 22000000 / 8) | |
| 4093 | 4097 | MCFG_YM2203_IRQ_HANDLER(WRITELINE(dynax_state, sprtmtch_sound_callback)) |
| 4094 | 4098 | MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW1")) |
| 4095 | 4099 | MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSW0")) |
| r243192 | r243193 | |
| 4143 | 4147 | MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW0")) |
| 4144 | 4148 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20) |
| 4145 | 4149 | |
| 4146 | MCFG_SOUND_ADD("ym | |
| 4150 | MCFG_SOUND_ADD("ymsnd", YM2413, 3579545) | |
| 4147 | 4151 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 4148 | 4152 | |
| 4149 | 4153 | MCFG_SOUND_ADD("msm", MSM5205, 384000) |
| r243192 | r243193 | |
| 4190 | 4194 | MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW0")) |
| 4191 | 4195 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20) |
| 4192 | 4196 | |
| 4193 | MCFG_SOUND_ADD("ym | |
| 4197 | MCFG_SOUND_ADD("ymsnd", YM2413, XTAL_3_579545MHz ) | |
| 4194 | 4198 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 4195 | 4199 | |
| 4196 | 4200 | MCFG_SOUND_ADD("msm", MSM5205, XTAL_384kHz ) |
| r243192 | r243193 | |
| 4234 | 4238 | /* sound hardware */ |
| 4235 | 4239 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 4236 | 4240 | |
| 4237 | MCFG_SOUND_ADD("ym | |
| 4241 | MCFG_SOUND_ADD("ymsnd", YM2203, 22000000 / 8) | |
| 4238 | 4242 | MCFG_YM2203_IRQ_HANDLER(WRITELINE(dynax_state, sprtmtch_sound_callback)) |
| 4239 | 4243 | MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW0")) |
| 4240 | 4244 | MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSW1")) |
| r243192 | r243193 | |
| 4279 | 4283 | /* sound hardware */ |
| 4280 | 4284 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 4281 | 4285 | |
| 4282 | MCFG_SOUND_ADD("ym | |
| 4286 | MCFG_SOUND_ADD("ymsnd", YM2413, 24000000/6) | |
| 4283 | 4287 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 4284 | 4288 | MACHINE_CONFIG_END |
| 4285 | 4289 | |
| r243192 | r243193 | |
| 4379 | 4383 | membank("bank1")->configure_entries(0, 0x10, &MAIN[0x8000], 0x8000); |
| 4380 | 4384 | membank("bank2")->configure_entries(0, 12, &SOUND[0x8000], 0x8000); |
| 4381 | 4385 | |
| 4386 | m_top_scr = machine().device("top"); | |
| 4387 | m_bot_scr = machine().device("bottom"); | |
| 4388 | ||
| 4382 | 4389 | MACHINE_START_CALL_MEMBER(dynax); |
| 4383 | 4390 | } |
| 4384 | 4391 | |
| r243192 | r243193 | |
| 4430 | 4437 | MCFG_SOUND_ADD("aysnd", AY8910, 22000000 / 8) |
| 4431 | 4438 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20) |
| 4432 | 4439 | |
| 4433 | MCFG_SOUND_ADD("ym | |
| 4440 | MCFG_SOUND_ADD("ymsnd", YM2203, 22000000 / 8) | |
| 4434 | 4441 | MCFG_YM2203_IRQ_HANDLER(WRITELINE(dynax_state, jantouki_sound_callback)) |
| 4435 | 4442 | MCFG_SOUND_ROUTE(0, "mono", 0.20) |
| 4436 | 4443 | MCFG_SOUND_ROUTE(1, "mono", 0.20) |
| r243192 | r243193 | |
| 4609 | 4616 | MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(dynax_state, tenkai_dswsel_w)) |
| 4610 | 4617 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20) |
| 4611 | 4618 | |
| 4612 | MCFG_SOUND_ADD("ym | |
| 4619 | MCFG_SOUND_ADD("ymsnd", YM2413, 3579545) | |
| 4613 | 4620 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 4614 | 4621 | |
| 4615 | 4622 | /* devices */ |
| r243192 | r243193 | |
| 4680 | 4687 | MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(dynax_state, tenkai_dswsel_w)) |
| 4681 | 4688 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20) |
| 4682 | 4689 | |
| 4683 | MCFG_SOUND_ADD("ym | |
| 4690 | MCFG_SOUND_ADD("ymsnd", YM2413, XTAL_24MHz / 8) // ? | |
| 4684 | 4691 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 4685 | 4692 | MACHINE_CONFIG_END |
| 4686 | 4693 |
| r243192 | r243193 | |
|---|---|---|
| 1494 | 1494 | |
| 1495 | 1495 | // Configure the sound ROM banking |
| 1496 | 1496 | membank("sound_bank")->configure_entries(0, 16, memregion("sounddata")->base(), 0x8000); |
| 1497 | ||
| 1497 | ||
| 1498 | 1498 | save_item(NAME(m_sound_data)); |
| 1499 | 1499 | } |
| 1500 | 1500 |
| r243192 | r243193 | |
|---|---|---|
| 25 | 25 | |
| 26 | 26 | UINT16 *m_vram; |
| 27 | 27 | int m_vbuffer; |
| 28 | ||
| 28 | ||
| 29 | 29 | DECLARE_WRITE16_MEMBER(eeprom_w); |
| 30 | 30 | DECLARE_READ16_MEMBER(eolith16_custom_r); |
| 31 | 31 | DECLARE_WRITE16_MEMBER(vram_w); |
| 32 | 32 | DECLARE_READ16_MEMBER(vram_r); |
| 33 | ||
| 33 | ||
| 34 | 34 | DECLARE_DRIVER_INIT(eolith16); |
| 35 | 35 | DECLARE_VIDEO_START(eolith16); |
| 36 | 36 | DECLARE_PALETTE_INIT(eolith16); |
| 37 | ||
| 37 | ||
| 38 | 38 | UINT32 screen_update_eolith16(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 39 | 39 | }; |
| 40 | 40 |
| r243192 | r243193 | |
|---|---|---|
| 84 | 84 | } |
| 85 | 85 | n_game++; |
| 86 | 86 | } |
| 87 | ||
| 87 | ||
| 88 | 88 | save_item(NAME(m_speedup_vblank)); |
| 89 | 89 | save_item(NAME(m_speedup_scanline)); |
| 90 | 90 | } |
| r243192 | r243193 | |
|---|---|---|
| 186 | 186 | |
| 187 | 187 | WRITE8_MEMBER(exidy_state::fax_bank_select_w) |
| 188 | 188 | { |
| 189 | mem | |
| 189 | UINT8 *RAM = memregion("maincpu")->base(); | |
| 190 | 190 | |
| 191 | membank("bank1")->set_base(&RAM[0x10000 + (0x2000 * (data & 0x1f))]); | |
| 191 | 192 | if ((data & 0x1f) > 0x17) |
| 192 | logerror("Banking to unpopulated ROM bank %02X!\n", data & 0x1f); | |
| 193 | ||
| 193 | logerror("Banking to unpopulated ROM bank %02X!\n",data & 0x1f); | |
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | |
| 197 | ||
| 197 | 198 | /************************************* |
| 198 | 199 | * |
| 199 | 200 | * Main CPU memory handlers |
| r243192 | r243193 | |
| 1536 | 1537 | |
| 1537 | 1538 | DRIVER_INIT_MEMBER(exidy_state,fax) |
| 1538 | 1539 | { |
| 1539 | | |
| 1540 | address_space &space = m_maincpu->space(AS_PROGRAM); | |
| 1540 | 1541 | |
| 1541 | 1542 | exidy_video_config(0x04, 0x04, TRUE); |
| 1542 | 1543 | |
| 1543 | membank("bank1")->configure_entries(0, 32, memregion("maincpu")->base() + 0x10000, 0x2000); | |
| 1544 | /* reset the ROM bank */ | |
| 1545 | fax_bank_select_w(space,0,0); | |
| 1544 | 1546 | } |
| 1545 | 1547 | |
| 1546 | 1548 |
| r243192 | r243193 | |
|---|---|---|
| 6 | 6 | Attack (1977) |
| 7 | 7 | Death Race (1976) |
| 8 | 8 | Destruction Derby (1975) |
| 9 | Football (1978) | |
| 9 | 10 | Old Time Basketball (1976) |
| 10 | 11 | Spiders From Space (1976) |
| 11 | 12 | Score (1977) |
| r243192 | r243193 | |
|---|---|---|
| 53 | 53 | Cyrix GXm233 - Main CPU; Cyrix GX Media running at 233MHz. Clock is generated by the Cyrix CX5520 |
| 54 | 54 | and a 14.31818MHz xtal. That gives a 66.6MHz bus clock with a 3.5X multiplier for 233MHz |
| 55 | 55 | Cyrix CX5520 - CPU-support chipset (BGA IC) |
| 56 | FLASH.U29/30 - Intel Strata-Flash DA28F320J5 SSOP56 contained on a plug-in daughterboard; main program / gfx | |
| 57 | FLASH.U3 - Intel Strata-Flash DA28F320J5 SSOP56 contained on a plug-in daughterboard; sound program | |
| 56 | FLASH.U29/30 - Intel Strata-Flash DA28F320J5 SSOP56 contained on a plug-in daughterboard; graphics ROMs | |
| 57 | FLASH.U3 - Intel Strata-Flash DA28F320J5 SSOP56 contained on a plug-in daughterboard; main program | |
| 58 | 58 | KS0164 - Samsung Electronics KS0164 General Midi compliant 32-voice Wavetable Synthesizer chip |
| 59 | 59 | with built-in 16bit CPU and MPU-401 compatibility (QFP100) |
| 60 | 60 | 512K-EPR - 512k EPROM, boot-loader program. EPROM is tied to the KS0164 and the XCS05 |
| r243192 | r243193 | |
| 76 | 76 | #include "machine/idectrl.h" |
| 77 | 77 | #include "video/voodoo.h" |
| 78 | 78 | #include "machine/pcshare.h" |
| 79 | #include "machine/bankdev.h" | |
| 80 | #include "machine/intelfsh.h" | |
| 81 | 79 | |
| 82 | 80 | |
| 83 | 81 | class funkball_state : public pcat_base_state |
| r243192 | r243193 | |
| 86 | 84 | funkball_state(const machine_config &mconfig, device_type type, const char *tag) |
| 87 | 85 | : pcat_base_state(mconfig, type, tag), |
| 88 | 86 | m_voodoo(*this, "voodoo_0"), |
| 89 | m_unk_ram(*this, "unk_ram"), | |
| 90 | m_flashbank(*this, "flashbank") | |
| 91 | { } | |
| 87 | m_unk_ram(*this, "unk_ram"){ } | |
| 92 | 88 | |
| 93 | 89 | UINT8 m_funkball_config_reg_sel; |
| 94 | 90 | UINT8 m_funkball_config_regs[256]; |
| 95 | 91 | UINT32 m_cx5510_regs[256/4]; |
| 92 | UINT16 m_flash_addr; | |
| 96 | 93 | UINT8 *m_bios_ram; |
| 94 | UINT8 m_flash_cmd; | |
| 95 | UINT8 m_flash_data_cmd; | |
| 97 | 96 | |
| 98 | 97 | UINT32 m_biu_ctrl_reg[256/4]; |
| 99 | 98 | |
| 100 | UINT32 flashbank_addr; | |
| 101 | ||
| 102 | 99 | // devices |
| 103 | 100 | required_device<voodoo_1_device> m_voodoo; |
| 104 | 101 | |
| 105 | 102 | required_shared_ptr<UINT32> m_unk_ram; |
| 106 | required_device<address_map_bank_device> m_flashbank; | |
| 107 | 103 | |
| 108 | 104 | DECLARE_READ8_MEMBER( get_slave_ack ); |
| 109 | DECLARE_WRITE32_MEMBER( flash_w ); | |
| 105 | DECLARE_WRITE8_MEMBER( flash_w ); | |
| 106 | DECLARE_READ8_MEMBER( flash_data_r ); | |
| 107 | DECLARE_WRITE8_MEMBER( flash_data_w ); | |
| 110 | 108 | // DECLARE_WRITE8_MEMBER( bios_ram_w ); |
| 111 | 109 | DECLARE_READ8_MEMBER( test_r ); |
| 112 | 110 | DECLARE_READ8_MEMBER( serial_r ); |
| r243192 | r243193 | |
| 274 | 272 | } |
| 275 | 273 | } |
| 276 | 274 | |
| 277 | WRITE | |
| 275 | WRITE8_MEMBER( funkball_state::flash_w ) | |
| 278 | 276 | { |
| 279 | COMBINE_DATA(&flashbank_addr); | |
| 280 | int tempbank = (flashbank_addr & 0x7fff) | ((flashbank_addr & 0x00800000) >> 8); | |
| 281 | m_flashbank->set_bank(tempbank); | |
| 277 | if(!(offset & 0x2)) | |
| 278 | { | |
| 279 | m_flash_addr = (offset & 1) ? ((m_flash_addr & 0xff) | (data << 8)) : ((m_flash_addr & 0xff00) | (data)); | |
| 280 | //printf("%08x ADDR\n",m_flash_addr << 16); | |
| 281 | } | |
| 282 | else if(offset == 2) | |
| 283 | { | |
| 284 | /* 0x83: read from u29/u30 | |
| 285 | 0x03: read from u3 | |
| 286 | 0x81: init device | |
| 287 | */ | |
| 288 | m_flash_cmd = data; | |
| 289 | printf("%02x CMD\n",data); | |
| 290 | } | |
| 291 | else | |
| 292 | printf("%02x %02x\n",offset,data); | |
| 293 | } | |
| 282 | 294 | |
| 283 | // note, other bits get used, but ignoring to keep the virtual bank space size sane. | |
| 295 | READ8_MEMBER( funkball_state::flash_data_r ) | |
| 296 | { | |
| 297 | if(m_flash_data_cmd == 0x90) | |
| 298 | { | |
| 299 | if(offset == 0 && (m_flash_addr == 0)) | |
| 300 | return 0x89; // manufacturer code | |
| 284 | 301 | |
| 302 | if(offset == 2 && (m_flash_addr == 0)) | |
| 303 | return (m_flash_cmd & 0x80) ? 0x15 : 0x14; // device code, 32 MBit in both cases | |
| 304 | ||
| 305 | if(offset > 3) | |
| 306 | printf("%02x FLASH DATA 0x90\n",offset); | |
| 307 | ||
| 308 | return 0; | |
| 309 | } | |
| 310 | ||
| 311 | if(m_flash_data_cmd == 0xff) | |
| 312 | { | |
| 313 | UINT8 *ROM = memregion(m_flash_cmd & 0x80 ? "data_flash" : "prg_flash")->base(); | |
| 314 | ||
| 315 | return ROM[offset + (m_flash_addr << 16)]; | |
| 316 | } | |
| 317 | ||
| 318 | printf("%02x %08x %02x %02x\n",offset,m_flash_addr << 16,m_flash_cmd,m_flash_data_cmd); | |
| 319 | ||
| 320 | return 0; | |
| 285 | 321 | } |
| 286 | 322 | |
| 323 | WRITE8_MEMBER( funkball_state::flash_data_w ) | |
| 324 | { | |
| 325 | if(offset == 0) | |
| 326 | { | |
| 327 | m_flash_data_cmd = data; | |
| 328 | } | |
| 329 | else | |
| 330 | printf("%08x %02x FLASH DATA W %08x\n",offset,data,m_flash_addr << 16); | |
| 331 | } | |
| 287 | 332 | |
| 288 | 333 | READ32_MEMBER(funkball_state::biu_ctrl_r) |
| 289 | 334 | { |
| r243192 | r243193 | |
| 333 | 378 | static ADDRESS_MAP_START(funkball_map, AS_PROGRAM, 32, funkball_state) |
| 334 | 379 | AM_RANGE(0x00000000, 0x0009ffff) AM_RAM |
| 335 | 380 | AM_RANGE(0x000a0000, 0x000affff) AM_RAM |
| 336 | AM_RANGE(0x000b0000, 0x000bffff) AM_ | |
| 381 | AM_RANGE(0x000b0000, 0x000bffff) AM_READWRITE8(flash_data_r,flash_data_w,0xffffffff) | |
| 337 | 382 | AM_RANGE(0x000c0000, 0x000cffff) AM_RAM |
| 338 | 383 | AM_RANGE(0x000d0000, 0x000dffff) AM_RAM |
| 339 | 384 | AM_RANGE(0x000e0000, 0x000e3fff) AM_ROMBANK("bios_ext1") |
| r243192 | r243193 | |
| 353 | 398 | AM_RANGE(0xfffe0000, 0xffffffff) AM_ROM AM_REGION("bios", 0) /* System BIOS */ |
| 354 | 399 | ADDRESS_MAP_END |
| 355 | 400 | |
| 356 | static ADDRESS_MAP_START( flashbank_map, AS_PROGRAM, 32, funkball_state ) | |
| 357 | AM_RANGE(0x00000000, 0x003fffff) AM_DEVREADWRITE16("u29", intel_28f320j5_device, read, write, 0xffffffff ) // needed to boot | |
| 358 | AM_RANGE(0x00400000, 0x007fffff) AM_DEVREADWRITE16("u30", intel_28f320j5_device, read, write, 0xffffffff ) // i assume it maps directly after | |
| 359 | // AM_RANGE(0x02000000, 0x023fffff) AM_DEVREADWRITE16("u3", intel_28f320j5_device, read, write, 0xffffffff ) // sound program, don't think it matters where we map it, might not even be visible in this space | |
| 360 | /* it checks for 64MBit chips at 0x80000000 the way things are set up, they must return an intel Flash ID of 0x15 */ | |
| 361 | ADDRESS_MAP_END | |
| 362 | ||
| 363 | 401 | static ADDRESS_MAP_START(funkball_io, AS_IO, 32, funkball_state) |
| 364 | 402 | AM_RANGE(0x0020, 0x0023) AM_READWRITE8(io20_r, io20_w, 0xffff0000) |
| 365 | 403 | AM_IMPORT_FROM(pcat32_io_common) |
| r243192 | r243193 | |
| 371 | 409 | |
| 372 | 410 | AM_RANGE(0x0cf8, 0x0cff) AM_DEVREADWRITE("pcibus", pci_bus_legacy_device, read, write) |
| 373 | 411 | |
| 374 | AM_RANGE(0x0360, 0x0363) AM_WRITE(flash_w) | |
| 412 | AM_RANGE(0x0360, 0x0363) AM_WRITE8(flash_w,0xffffffff) | |
| 375 | 413 | |
| 376 | 414 | // AM_RANGE(0x0320, 0x0323) AM_READ(test_r) |
| 377 | 415 | AM_RANGE(0x0360, 0x036f) AM_READ8(test_r,0xffffffff) // inputs |
| r243192 | r243193 | |
| 824 | 862 | MCFG_IDE_CONTROLLER_ADD("ide", ata_devices, "hdd", NULL, true) |
| 825 | 863 | MCFG_ATA_INTERFACE_IRQ_HANDLER(DEVWRITELINE("pic8259_2", pic8259_device, ir6_w)) |
| 826 | 864 | |
| 827 | MCFG_DEVICE_ADD("flashbank", ADDRESS_MAP_BANK, 0) | |
| 828 | MCFG_DEVICE_PROGRAM_MAP(flashbank_map) | |
| 829 | MCFG_ADDRESS_MAP_BANK_ENDIANNESS(ENDIANNESS_LITTLE) | |
| 830 | MCFG_ADDRESS_MAP_BANK_DATABUS_WIDTH(32) | |
| 831 | MCFG_ADDRESS_MAP_BANK_ADDRBUS_WIDTH(64) | |
| 832 | MCFG_ADDRESS_MAP_BANK_STRIDE(0x10000) | |
| 833 | ||
| 834 | 865 | /* video hardware */ |
| 835 | 866 | MCFG_DEVICE_ADD("voodoo_0", VOODOO_1, STD_VOODOO_1_CLOCK) |
| 836 | 867 | MCFG_VOODOO_FBMEM(2) |
| r243192 | r243193 | |
| 844 | 875 | MCFG_SCREEN_UPDATE_DRIVER(funkball_state, screen_update) |
| 845 | 876 | MCFG_SCREEN_SIZE(1024, 1024) |
| 846 | 877 | MCFG_SCREEN_VISIBLE_AREA(0, 511, 16, 447) |
| 847 | ||
| 848 | MCFG_INTEL_28F320J5_ADD("u29") | |
| 849 | MCFG_INTEL_28F320J5_ADD("u30") | |
| 850 | MCFG_INTEL_28F320J5_ADD("u3") | |
| 851 | 878 | MACHINE_CONFIG_END |
| 852 | 879 | |
| 853 | 880 | ROM_START( funkball ) |
| 854 | 881 | ROM_REGION32_LE(0x20000, "bios", ROMREGION_ERASEFF) |
| 855 | 882 | ROM_LOAD( "512k-epr.u62", 0x010000, 0x010000, CRC(cced894a) SHA1(298c81716e375da4b7215f3e588a45ca3ea7e35c) ) |
| 856 | 883 | |
| 857 | ROM_REGION(0x400000, "u3", ROMREGION_ERASE00) // Sound Program / Samples | |
| 858 | ROM_LOAD16_WORD_SWAP( "flash.u3", 0x000000, 0x400000, CRC(fb376abc) SHA1(ea4c48bb6cd2055431a33f5c426e52c7af6997eb) ) | |
| 884 | ROM_REGION(0x8000000, "prg_flash", ROMREGION_ERASE00) | |
| 885 | ROM_LOAD16_WORD_SWAP( "flash.u3", 0x0000000, 0x400000, CRC(fb376abc) SHA1(ea4c48bb6cd2055431a33f5c426e52c7af6997eb) ) | |
| 859 | 886 | |
| 860 | ROM_REGION(0x400000, "u29", ROMREGION_ERASE00) // Main Program | |
| 861 | ROM_LOAD16_WORD_SWAP( "flash.u29",0x000000, 0x400000, CRC(7cf6ff4b) SHA1(4ccdd4864ad92cc218998f3923997119a1a9dd1d) ) | |
| 862 | ||
| 863 | ROM_REGION(0x400000, "u30", ROMREGION_ERASE00) | |
| 864 | ROM_LOAD16_WORD_SWAP( "flash.u30",0x000000, 0x400000, CRC(1d46717a) SHA1(acfbd0a2ccf4d717779733c4a9c639296c3bbe0e) ) | |
| 887 | ROM_REGION(0x8000000, "data_flash", ROMREGION_ERASE00) | |
| 888 | ROM_LOAD( "flash.u29",0x0000000, 0x400000, CRC(7cf6ff4b) SHA1(4ccdd4864ad92cc218998f3923997119a1a9dd1d) ) | |
| 889 | ROM_LOAD( "flash.u30",0x0400000, 0x400000, CRC(1d46717a) SHA1(acfbd0a2ccf4d717779733c4a9c639296c3bbe0e) ) | |
| 865 | 890 | ROM_END |
| 866 | 891 | |
| 867 | 892 |
| r243192 | r243193 | |
|---|---|---|
| 381 | 381 | |
| 382 | 382 | ***************************************************************************/ |
| 383 | 383 | |
| 384 | WRITE_LINE_MEMBER(fuuki16_state::soundirq) | |
| 385 | { | |
| 386 | m_audiocpu->set_input_line(0, state); | |
| 387 | } | |
| 388 | ||
| 384 | 389 | /* |
| 385 | 390 | - Interrupts (pbancho) - |
| 386 | 391 | |
| r243192 | r243193 | |
| 470 | 475 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.15) |
| 471 | 476 | |
| 472 | 477 | MCFG_SOUND_ADD("ym2", YM3812, XTAL_28_64MHz / 8) /* 3.58 MHz */ |
| 473 | MCFG_YM3812_IRQ_HANDLER(I | |
| 478 | MCFG_YM3812_IRQ_HANDLER(WRITELINE(fuuki16_state, soundirq)) | |
| 474 | 479 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.30) |
| 475 | 480 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.30) |
| 476 | 481 |
| r243192 | r243193 | |
|---|---|---|
| 540 | 540 | } |
| 541 | 541 | |
| 542 | 542 | |
| 543 | WRITE_LINE_MEMBER(fuuki32_state::irqhandler) | |
| 544 | { | |
| 545 | m_soundcpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE); | |
| 546 | } | |
| 547 | ||
| 543 | 548 | static MACHINE_CONFIG_START(fuuki32, fuuki32_state) |
| 544 | 549 | |
| 545 | 550 | /* basic machine hardware */ |
| r243192 | r243193 | |
| 570 | 575 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 571 | 576 | |
| 572 | 577 | MCFG_SOUND_ADD("ymf1", YMF278B, YMF278B_STD_CLOCK) // 33.8688MHz |
| 573 | MCFG_YMF278B_IRQ_HANDLER(I | |
| 578 | MCFG_YMF278B_IRQ_HANDLER(WRITELINE(fuuki32_state, irqhandler)) | |
| 574 | 579 | MCFG_SOUND_ROUTE(0, "lspeaker", 0.50) |
| 575 | 580 | MCFG_SOUND_ROUTE(1, "rspeaker", 0.50) |
| 576 | 581 |
| r243192 | r243193 | |
|---|---|---|
| 1483 | 1483 | AM_RANGE(0xc100, 0xc103) AM_MIRROR(0x3efc) AM_DEVREADWRITE("ppi8255_0", i8255_device, read, write) |
| 1484 | 1484 | ADDRESS_MAP_END |
| 1485 | 1485 | |
| 1486 | // this is WRONG (a copy of the above) but set does appear to have a similar odd memory map with RAM aronud 0x400 and scrambled ROMs | |
| 1487 | static ADDRESS_MAP_START( spactrai_map, AS_PROGRAM, 8, galaxian_state ) | |
| 1488 | ADDRESS_MAP_UNMAP_HIGH | |
| 1489 | AM_RANGE(0x0000, 0x03ff) AM_ROM | |
| 1490 | AM_RANGE(0x0400, 0x0bff) AM_RAM | |
| 1491 | AM_RANGE(0x0c00, 0x0fff) AM_RAM_WRITE(galaxian_videoram_w) AM_SHARE("videoram") | |
| 1492 | AM_RANGE(0x1001, 0x1001) AM_MIRROR(0x01f8) AM_WRITE(irq_enable_w) | |
| 1493 | AM_RANGE(0x1002, 0x1002) AM_MIRROR(0x01f8) AM_WRITE(coin_count_0_w) | |
| 1494 | AM_RANGE(0x1003, 0x1003) AM_MIRROR(0x01f8) AM_WRITE(scramble_background_enable_w) | |
| 1495 | AM_RANGE(0x1004, 0x1004) AM_MIRROR(0x01f8) AM_WRITE(galaxian_stars_enable_w) | |
| 1496 | AM_RANGE(0x1005, 0x1005) AM_MIRROR(0x01f8) //POUT2 | |
| 1497 | AM_RANGE(0x1006, 0x1006) AM_MIRROR(0x01f8) AM_WRITE(galaxian_flip_screen_x_w) | |
| 1498 | AM_RANGE(0x1007, 0x1007) AM_MIRROR(0x01f8) AM_WRITE(galaxian_flip_screen_y_w) | |
| 1499 | AM_RANGE(0x1200, 0x12ff) AM_MIRROR(0x0100) AM_RAM_WRITE(galaxian_objram_w) AM_SHARE("spriteram") | |
| 1500 | AM_RANGE(0x1400, 0x1400) AM_MIRROR(0x03ff) AM_READ(watchdog_reset_r) | |
| 1501 | AM_RANGE(0x4000, 0xbfff) AM_ROM | |
| 1502 | // AM_RANGE(0xc000, 0xc003) AM_MIRROR(0x3efc) AM_DEVREADWRITE("ppi8255_1", i8255_device, read, write) | |
| 1503 | // AM_RANGE(0xc100, 0xc103) AM_MIRROR(0x3efc) AM_DEVREADWRITE("ppi8255_0", i8255_device, read, write) | |
| 1504 | ADDRESS_MAP_END | |
| 1505 | 1486 | |
| 1506 | 1487 | static ADDRESS_MAP_START( anteaterg_map, AS_PROGRAM, 8, galaxian_state ) |
| 1507 | 1488 | ADDRESS_MAP_UNMAP_HIGH |
| r243192 | r243193 | |
| 5130 | 5111 | MCFG_FRAGMENT_ADD(galaxian_audio) |
| 5131 | 5112 | MACHINE_CONFIG_END |
| 5132 | 5113 | |
| 5133 | static MACHINE_CONFIG_DERIVED( spactrai, galaxian ) | |
| 5134 | 5114 | |
| 5135 | /* strange memory map, maybe a kind of protection */ | |
| 5136 | MCFG_CPU_MODIFY("maincpu") | |
| 5137 | MCFG_CPU_PROGRAM_MAP(spactrai_map) | |
| 5138 | MACHINE_CONFIG_END | |
| 5139 | ||
| 5140 | ||
| 5141 | 5115 | static MACHINE_CONFIG_DERIVED( pacmanbl, galaxian ) |
| 5142 | 5116 | |
| 5143 | 5117 | /* separate tile/sprite ROMs */ |
| r243192 | r243193 | |
| 7282 | 7256 | ROM_LOAD( "warofbug.clr", 0x0000, 0x0020, CRC(8688e64b) SHA1(ed13414257f580b98b50c9892a14159c55e7838d) ) |
| 7283 | 7257 | ROM_END |
| 7284 | 7258 | |
| 7285 | // has a large custom block on the ROM board | |
| 7286 | ROM_START( spactrai ) | |
| 7287 | ROM_REGION( 0x10000, "maincpu", 0 ) | |
| 7288 | ROM_LOAD( "1cen.bin", 0x0000, 0x1000, CRC(fabc7fd8) SHA1(88c42dda38cc79ab4f180c4818cfb928c1cc0661) ) | |
| 7289 | ROM_LOAD( "2cen.bin", 0x1000, 0x1000, CRC(44ddacfa) SHA1(50a9f5f3e4ec12fd3742dcf7cf141e52300a10db) ) | |
| 7290 | ROM_LOAD( "3cen.bin", 0x2000, 0x1000, CRC(822749cb) SHA1(92e617088d462911118842f3f68b7ff8ac77fcf5) ) | |
| 7291 | ROM_LOAD( "4cen.bin", 0x3000, 0x1000, CRC(f9dda0ed) SHA1(a77f6d8ec7b3df7f308354489954c3d9b4f61b0d) ) | |
| 7292 | ROM_LOAD( "5cen.bin", 0x4000, 0x1000, CRC(b8c76675) SHA1(acdda20adf62d1e2eadcc097ecde6a3126231415) ) | |
| 7293 | 7259 | |
| 7294 | ROM_REGION( 0x1000, "gfx1", 0 ) | |
| 7295 | ROM_LOAD( "6cen.bin", 0x0000, 0x0800, CRC(a59a9f3f) SHA1(9564f1d013d566dc0b19762aec66119e2ece0b49) ) // MK2716J | |
| 7296 | ROM_LOAD( "7cen.bin", 0x0800, 0x0400, CRC(16cf5a5b) SHA1(0369786902544d31e506fe1ba6a69aa6e8ba9b5c) ) // MM2758A | |
| 7297 | ||
| 7298 | ROM_REGION( 0x0020, "proms", 0 ) | |
| 7299 | ROM_LOAD( "stk.bin", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) ) | |
| 7300 | ROM_END | |
| 7301 | ||
| 7302 | ||
| 7303 | 7260 | /* Galaxian hardware mods for War of the Bugs warofbug/warofbugg |
| 7304 | 7261 | |
| 7305 | 7262 | (WotB using daughterboard that plugs into Z80 socket - has a socketed PAL, two other 20-pin ICs, |
| r243192 | r243193 | |
| 10739 | 10696 | GAME( 1981, warofbug, 0, galaxian, warofbug, galaxian_state, nolock, ROT90, "Armenia / Food and Fun Corp", "War of the Bugs or Monsterous Manouvers in a Mushroom Maze", GAME_SUPPORTS_SAVE ) |
| 10740 | 10697 | GAME( 1981, warofbugu, warofbug, galaxian, warofbug, galaxian_state, nolock, ROT90, "Armenia / Super Video Games", "War of the Bugs or Monsterous Manouvers in a Mushroom Maze (US)", GAME_SUPPORTS_SAVE ) |
| 10741 | 10698 | GAME( 1981, warofbugg, warofbug, galaxian, warofbug, galaxian_state, nolock, ROT90, "Armenia", "War of the Bugs or Monsterous Manouvers in a Mushroom Maze (German)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) |
| 10742 | GAME( 1981, spactrai, warofbug, spactrai, warofbug, galaxian_state, nolock, ROT90, "Armenia / Adar", "Space Train", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) | |
| 10743 | 10699 | GAME( 1981, redufo, 0, galaxian, redufo, galaxian_state, nolock, ROT270, "Artic", "Defend the Terra Attack on the Red UFO", GAME_SUPPORTS_SAVE ) // is this the original? |
| 10744 | 10700 | GAME( 1981, redufob, redufo, galaxian, redufob, galaxian_state, nolock, ROT90, "bootleg", "Defend the Terra Attack on the Red UFO (bootleg)", GAME_SUPPORTS_SAVE ) // rev A? |
| 10745 | 10701 | GAME( 19??, exodus, redufo, galaxian, redufo, galaxian_state, nolock, ROT90, "bootleg? (Subelectro)", "Exodus (bootleg?)", GAME_SUPPORTS_SAVE ) |
| r243192 | r243193 | |
|---|---|---|
| 204 | 204 | GFXDECODE_END |
| 205 | 205 | |
| 206 | 206 | |
| 207 | ||
| 208 | WRITE_LINE_MEMBER(galspnbl_state::irqhandler) | |
| 209 | { | |
| 210 | m_audiocpu->set_input_line(0, state); | |
| 211 | } | |
| 212 | ||
| 213 | ||
| 207 | 214 | void galspnbl_state::machine_start() |
| 208 | 215 | { |
| 209 | 216 | } |
| r243192 | r243193 | |
| 245 | 252 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 246 | 253 | |
| 247 | 254 | MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_4MHz) /* Use value from Super Pinball Action - NEEDS VERIFICATION!! */ |
| 248 | MCFG_YM3812_IRQ_HANDLER(I | |
| 255 | MCFG_YM3812_IRQ_HANDLER(WRITELINE(galspnbl_state, irqhandler)) | |
| 249 | 256 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 250 | 257 | |
| 251 | 258 | MCFG_OKIM6295_ADD("oki", XTAL_4MHz/4, OKIM6295_PIN7_HIGH) /* Use value from Super Pinball Action - clock frequency & pin 7 not verified */ |
| r243192 | r243193 | |
|---|---|---|
| 281 | 281 | optional_device<k001006_device> m_k001006_2; |
| 282 | 282 | optional_device<k001604_device> m_k001604_1; |
| 283 | 283 | optional_device<k001604_device> m_k001604_2; |
| 284 | ||
| 284 | ||
| 285 | 285 | required_shared_ptr<UINT32> m_work_ram; |
| 286 | 286 | required_shared_ptr<UINT32> m_generic_paletteram_32; |
| 287 | ||
| 287 | ||
| 288 | 288 | optional_ioport m_analog0, m_analog1, m_analog2, m_analog3; |
| 289 | ||
| 289 | ||
| 290 | 290 | required_ioport_array<4> m_ports; |
| 291 | ||
| 291 | ||
| 292 | 292 | DECLARE_IOPORT_ARRAY(ports); |
| 293 | 293 | |
| 294 | 294 | DECLARE_WRITE32_MEMBER(paletteram32_w); |
| r243192 | r243193 | |
|---|---|---|
| 427 | 427 | ADDRESS_MAP_END |
| 428 | 428 | |
| 429 | 429 | static ADDRESS_MAP_START( video_io_map, AS_IO, 8, caveman_state ) |
| 430 | // AM_RANGE(0x000, 0x002) AM_READWRITE() // 8259 irq controller | |
| 431 | // AM_RANGE(0x100, 0x102) AM_READWRITE() // HD46505 | |
| 432 | // AM_RANGE(0x200, 0x200) AM_READWRITE() // 8212 in, ?? out | |
| 433 | // AM_RANGE(0x300, 0x300) AM_READWRITE() // soundlatch (command?) in, ?? out | |
| 430 | // AM_RANGE(0x000, 0x002) AM_READWRITE() // 8259 irq controller | |
| 431 | // AM_RANGE(0x100, 0x102) AM_READWRITE() // HD46505 | |
| 432 | // AM_RANGE(0x200, 0x200) AM_READWRITE() // 8212 in, ?? out | |
| 433 | // AM_RANGE(0x300, 0x300) AM_READWRITE() // soundlatch (command?) in, ?? out | |
| 434 | 434 | |
| 435 | // AM_RANGE(0x400, 0x400) AM_READ() // joystick inputs | |
| 436 | // AM_RANGE(0x500, 0x506) AM_WRITE() // palette | |
| 435 | // AM_RANGE(0x400, 0x400) AM_READ() // joystick inputs | |
| 436 | // AM_RANGE(0x500, 0x506) AM_WRITE() // palette | |
| 437 | 437 | |
| 438 | 438 | ADDRESS_MAP_END |
| 439 | 439 |
| r243192 | r243193 | |
|---|---|---|
| 229 | 229 | |
| 230 | 230 | static MACHINE_CONFIG_START( gumbo, gumbo_state ) |
| 231 | 231 | |
| 232 | MCFG_CPU_ADD("maincpu", M68000, | |
| 232 | MCFG_CPU_ADD("maincpu", M68000, 14318180 /2) // or 10mhz? ? | |
| 233 | 233 | MCFG_CPU_PROGRAM_MAP(gumbo_map) |
| 234 | 234 | MCFG_CPU_VBLANK_INT_DRIVER("screen", gumbo_state, irq1_line_hold) // all the same |
| 235 | 235 | |
| r243192 | r243193 | |
| 248 | 248 | |
| 249 | 249 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 250 | 250 | |
| 251 | MCFG_OKIM6295_ADD("oki", | |
| 251 | MCFG_OKIM6295_ADD("oki", 1122000, OKIM6295_PIN7_HIGH) // clock frequency & pin 7 not verified | |
| 252 | 252 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.47) |
| 253 | 253 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.47) |
| 254 | 254 | MACHINE_CONFIG_END |
| r243192 | r243193 | |
|---|---|---|
| 152 | 152 | |
| 153 | 153 | /*****************************************************************************/ |
| 154 | 154 | |
| 155 | WRITE_LINE_MEMBER(hcastle_state::irqhandler) | |
| 156 | { | |
| 157 | // m_audiocpu->set_input_line(state); | |
| 158 | } | |
| 159 | ||
| 155 | 160 | WRITE8_MEMBER(hcastle_state::volume_callback) |
| 156 | 161 | { |
| 157 | 162 | m_k007232->set_volume(0, (data >> 4) * 0x11, 0); |
| r243192 | r243193 | |
| 224 | 229 | MCFG_SOUND_ROUTE(1, "mono", 0.50) |
| 225 | 230 | |
| 226 | 231 | MCFG_SOUND_ADD("ymsnd", YM3812, 3579545) |
| 227 | MCFG_YM3812_IRQ_HANDLER(I | |
| 232 | MCFG_YM3812_IRQ_HANDLER(WRITELINE(hcastle_state, irqhandler)) | |
| 228 | 233 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.70) |
| 229 | 234 | |
| 230 | 235 | MCFG_K051649_ADD("k051649", 3579545/2) |
| r243192 | r243193 | |
|---|---|---|
| 570 | 570 | /* ic65 unpopulated */ |
| 571 | 571 | /* ic66 unpopulated */ |
| 572 | 572 | |
| 573 | // 834-14149 2000 317-0294-COM Hikaru | |
| 574 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "091b02c7" ) | |
| 573 | // 315-5881 security IC key | |
| 574 | ROM_REGION( 4, "rom_key", 0 ) | |
| 575 | ROM_LOAD( "airtrix-key.bin", 0, 4, CRC(bebdc179) SHA1(327ea299934ef78f3c88329fc624dc3771877453) ) | |
| 575 | 576 | ROM_END |
| 576 | 577 | |
| 577 | 578 | |
| r243192 | r243193 | |
| 608 | 609 | ROM_LOAD32_WORD( "mpr-23560.ic65", 0xe000000, 0x1000000, CRC(24bb7072) SHA1(dad5135c89d292e4a1f96bd0ad28be6a17154be0) ) |
| 609 | 610 | ROM_LOAD32_WORD( "mpr-23564.ic66", 0xe000002, 0x1000000, CRC(255724b6) SHA1(1b382fad165831de3f2e39352c031146759dfc69) ) |
| 610 | 611 | |
| 611 | // 834-14144 2001 317-0297-COM Hikaru | |
| 612 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "0912c68a" ) | |
| 612 | // 315-5881 security IC key | |
| 613 | ROM_REGION( 4, "rom_key", 0 ) | |
| 614 | ROM_LOAD( "pharrier-key.bin", 0, 4, CRC(1697d591) SHA1(8ad4c93f63e2e379795e820d3edbdd990f8ca7e1) ) | |
| 613 | 615 | ROM_END |
| 614 | 616 | |
| 615 | 617 | ROM_START( podrace ) |
| r243192 | r243193 | |
| 662 | 664 | ROM_LOAD32_WORD("mpr-23117.ic68s" , 0xf000002, 0x0800000, CRC(9d4d3529) SHA1(66008445629681ebf2f26b3f181d8524a8576d2f)) |
| 663 | 665 | |
| 664 | 666 | // current 315-5881 decryption simulation code can't produce valid output data with any of keys |
| 665 | // 834-14002 2001 317-0277-COM Hikaru | |
| 666 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "0903dad5" ) | |
| 667 | ROM_REGION( 4, "rom_key", ROMREGION_ERASE00 ) | |
| 667 | 668 | ROM_END |
| 668 | 669 | |
| 669 | 670 | ROM_START( braveff ) |
| r243192 | r243193 | |
| 707 | 708 | ROM_LOAD32_WORD( "mpr-22022.ic59s", 0xb000000, 0x800000, CRC(abd3d888) SHA1(9654c3a38feab46b4983a602831fb29cccdd0526) ) |
| 708 | 709 | ROM_LOAD32_WORD( "mpr-22023.ic60s", 0xb000002, 0x800000, CRC(07f00869) SHA1(92282d09d72d3e65a91128e06bb0d4426bb90be5) ) |
| 709 | 710 | |
| 710 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "0" ) // 315-5881 not populated | |
| 711 | // 315-5881 not populated | |
| 712 | ROM_REGION( 4, "rom_key", ROMREGION_ERASE00 ) | |
| 711 | 713 | ROM_END |
| 712 | 714 | |
| 713 | 715 | ROM_START( sgnascar ) |
| r243192 | r243193 | |
| 736 | 738 | ROM_LOAD32_WORD( "mpr-23483.ic32", 0xc000002, 0x1000000, CRC(c37adebe) SHA1(e84f6d2cc364c743f7f3b73d8c8d0271952bb093) ) |
| 737 | 739 | ROM_LOAD32_WORD( "mpr-23480.ic33", 0xe000000, 0x1000000, CRC(f517b8b3) SHA1(c04740adb612473c4c9f8186e7e93d2f73d1bb1a) ) |
| 738 | 740 | ROM_LOAD32_WORD( "mpr-23484.ic34", 0xe000002, 0x1000000, CRC(2ebe1aa1) SHA1(16b39f7422da1a334dde27169c2949e1d95bddb3) ) |
| 739 | ||
| 740 | // 317-0283-COM Actel A54SX32 | |
| 741 | // ID 0x4252 | |
| 742 | ROM_PARAMETER( ":rom_board:key", "56dedf33" ) | |
| 743 | 741 | ROM_END |
| 744 | 742 | |
| 745 | 743 | GAME( 2000, hikaru, 0, hikaru, hikaru, driver_device, 0, ROT0, "Sega", "Hikaru Bios", GAME_NO_SOUND|GAME_NOT_WORKING|GAME_IS_BIOS_ROOT ) |
| r243192 | r243193 | |
|---|---|---|
| 76 | 76 | Starting with GT Fore!, I.T. moved to a redesigned hardware platform known as the Eagle platform. |
| 77 | 77 | It has a main board with a 3Dfx video card and is hard drive based. This series started with |
| 78 | 78 | GT Fore! in 2000 and continued through 2006 ending with Golden Tee Complete. This final |
| 79 | version inc | |
| 79 | version incuded all the courses from all the previous years in the Fore! series. | |
| 80 | 80 | The Eagle platform also supports I.T.'s hunting series "Big Buck Hunter", the light game gun |
| 81 | 81 | called Carnival King as well as the limited release game Virtual Pool. |
| 82 | 82 | |
| r243192 | r243193 | |
| 1615 | 1615 | |
| 1616 | 1616 | PORT_MODIFY("DIPS") |
| 1617 | 1617 | PORT_DIPNAME( 0x00100000, 0x00000000, "Trackball Orientation" ) PORT_DIPLOCATION("SW1:4") /* Determined by actual use / trial & error */ |
| 1618 | PORT_DIPSETTING( 0x00000000, "Normal Mount" ) /* The manual says "Always on (def | |
| 1618 | PORT_DIPSETTING( 0x00000000, "Normal Mount" ) /* The manual says "Always on (defualt)" and "Off -- UNUSED --" */ | |
| 1619 | 1619 | PORT_DIPSETTING( 0x00100000, "45 Degree Angle" ) |
| 1620 | 1620 | PORT_DIPNAME( 0x00200000, 0x00000000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:3") /* Single controller version - has no effect */ |
| 1621 | 1621 | PORT_DIPSETTING( 0x00000000, DEF_STR( Off ) ) |
| r243192 | r243193 | |
| 1631 | 1631 | |
| 1632 | 1632 | PORT_MODIFY("DIPS") |
| 1633 | 1633 | PORT_DIPNAME( 0x00100000, 0x00000000, "Trackball Orientation" ) PORT_DIPLOCATION("SW1:4") /* Determined by actual use / trial & error */ |
| 1634 | PORT_DIPSETTING( 0x00000000, "Normal Mount" ) /* The manual says "Always on (def | |
| 1634 | PORT_DIPSETTING( 0x00000000, "Normal Mount" ) /* The manual says "Always on (defualt)" and "Off -- UNUSED --" */ | |
| 1635 | 1635 | PORT_DIPSETTING( 0x00100000, "45 Degree Angle" ) |
| 1636 | 1636 | PORT_DIPNAME( 0x00200000, 0x00000000, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:3") |
| 1637 | 1637 | PORT_DIPSETTING( 0x00000000, DEF_STR( Upright ) ) |
| r243192 | r243193 | |
| 2450 | 2450 | ROM_CONTINUE( 0x08000, 0x08000 ) |
| 2451 | 2451 | |
| 2452 | 2452 | ROM_REGION( 0x880000, "gfx1", 0 ) |
| 2453 | /* No known set specific | |
| 2453 | /* No known set specificly checks for this, however the GROM data may be in the form of four 8 Meg roms: | |
| 2454 | 2454 | ROM_LOAD32_BYTE( "wcb_grom0_0_+.grm0_0", 0x000000, 0x100000, CRC(40837737) SHA1(f073943ec6f84285a8559553fb292ec1f8a629d0) ) Labeled as "WCB GROM0_0 *" ect |
| 2455 | 2455 | ROM_LOAD32_BYTE( "wcb_grom0_1_+.grm0_1", 0x000001, 0x100000, CRC(1615aee8) SHA1(6184919371a894b1d6f2e06a2b328cb55abed4a9) ) |
| 2456 | 2456 | ROM_LOAD32_BYTE( "wcb_grom0_2_+.grm0_2", 0x000002, 0x100000, CRC(d8e0b06e) SHA1(4981c0cf16df68a1b4da7ebf65ca587c21292478) ) |
| r243192 | r243193 | |
| 2485 | 2485 | ROM_CONTINUE( 0x08000, 0x08000 ) |
| 2486 | 2486 | |
| 2487 | 2487 | ROM_REGION( 0x880000, "gfx1", 0 ) |
| 2488 | /* No known set specific | |
| 2488 | /* No known set specificly checks for this, however the GROM data may be in the form of four 8 Meg roms: | |
| 2489 | 2489 | ROM_LOAD32_BYTE( "wcb_grom0_0_+.grm0_0", 0x000000, 0x100000, CRC(40837737) SHA1(f073943ec6f84285a8559553fb292ec1f8a629d0) ) Labeled as "WCB GROM0_0 *" ect |
| 2490 | 2490 | ROM_LOAD32_BYTE( "wcb_grom0_1_+.grm0_1", 0x000001, 0x100000, CRC(1615aee8) SHA1(6184919371a894b1d6f2e06a2b328cb55abed4a9) ) |
| 2491 | 2491 | ROM_LOAD32_BYTE( "wcb_grom0_2_+.grm0_2", 0x000002, 0x100000, CRC(d8e0b06e) SHA1(4981c0cf16df68a1b4da7ebf65ca587c21292478) ) |
| r243192 | r243193 | |
| 2520 | 2520 | ROM_CONTINUE( 0x08000, 0x08000 ) |
| 2521 | 2521 | |
| 2522 | 2522 | ROM_REGION( 0x880000, "gfx1", 0 ) |
| 2523 | /* No known set specific | |
| 2523 | /* No known set specificly checks for this, however the GROM data may be in the form of four 8 Meg roms: | |
| 2524 | 2524 | ROM_LOAD32_BYTE( "wcb_grom0_0_+.grm0_0", 0x000000, 0x100000, CRC(40837737) SHA1(f073943ec6f84285a8559553fb292ec1f8a629d0) ) Labeled as "WCB GROM0_0 *" ect |
| 2525 | 2525 | ROM_LOAD32_BYTE( "wcb_grom0_1_+.grm0_1", 0x000001, 0x100000, CRC(1615aee8) SHA1(6184919371a894b1d6f2e06a2b328cb55abed4a9) ) |
| 2526 | 2526 | ROM_LOAD32_BYTE( "wcb_grom0_2_+.grm0_2", 0x000002, 0x100000, CRC(d8e0b06e) SHA1(4981c0cf16df68a1b4da7ebf65ca587c21292478) ) |
| r243192 | r243193 | |
| 2555 | 2555 | ROM_CONTINUE( 0x08000, 0x08000 ) |
| 2556 | 2556 | |
| 2557 | 2557 | ROM_REGION( 0x880000, "gfx1", 0 ) |
| 2558 | /* No known set specific | |
| 2558 | /* No known set specificly checks for this, however the GROM data may be in the form of four 8 Meg roms: | |
| 2559 | 2559 | ROM_LOAD32_BYTE( "wcb_grom0_0_+.grm0_0", 0x000000, 0x100000, CRC(40837737) SHA1(f073943ec6f84285a8559553fb292ec1f8a629d0) ) Labeled as "WCB GROM0_0 *" ect |
| 2560 | 2560 | ROM_LOAD32_BYTE( "wcb_grom0_1_+.grm0_1", 0x000001, 0x100000, CRC(1615aee8) SHA1(6184919371a894b1d6f2e06a2b328cb55abed4a9) ) |
| 2561 | 2561 | ROM_LOAD32_BYTE( "wcb_grom0_2_+.grm0_2", 0x000002, 0x100000, CRC(d8e0b06e) SHA1(4981c0cf16df68a1b4da7ebf65ca587c21292478) ) |
| r243192 | r243193 | |
| 2590 | 2590 | ROM_CONTINUE( 0x08000, 0x08000 ) |
| 2591 | 2591 | |
| 2592 | 2592 | ROM_REGION( 0x880000, "gfx1", 0 ) |
| 2593 | /* No known set specific | |
| 2593 | /* No known set specificly checks for this, however the GROM data may be in the form of four 8 Meg roms: | |
| 2594 | 2594 | ROM_LOAD32_BYTE( "wcb_grom0_0_+.grm0_0", 0x000000, 0x100000, CRC(40837737) SHA1(f073943ec6f84285a8559553fb292ec1f8a629d0) ) Labeled as "WCB GROM0_0 *" ect |
| 2595 | 2595 | ROM_LOAD32_BYTE( "wcb_grom0_1_+.grm0_1", 0x000001, 0x100000, CRC(1615aee8) SHA1(6184919371a894b1d6f2e06a2b328cb55abed4a9) ) |
| 2596 | 2596 | ROM_LOAD32_BYTE( "wcb_grom0_2_+.grm0_2", 0x000002, 0x100000, CRC(d8e0b06e) SHA1(4981c0cf16df68a1b4da7ebf65ca587c21292478) ) |
| r243192 | r243193 | |
| 2625 | 2625 | ROM_CONTINUE( 0x08000, 0x08000 ) |
| 2626 | 2626 | |
| 2627 | 2627 | ROM_REGION( 0x880000, "gfx1", 0 ) |
| 2628 | /* No known set specific | |
| 2628 | /* No known set specificly checks for this, however the GROM data may be in the form of four 8 Meg roms: | |
| 2629 | 2629 | ROM_LOAD32_BYTE( "wcb_grom0_0_+.grm0_0", 0x000000, 0x100000, CRC(40837737) SHA1(f073943ec6f84285a8559553fb292ec1f8a629d0) ) Labeled as "WCB GROM0_0 *" ect |
| 2630 | 2630 | ROM_LOAD32_BYTE( "wcb_grom0_1_+.grm0_1", 0x000001, 0x100000, CRC(1615aee8) SHA1(6184919371a894b1d6f2e06a2b328cb55abed4a9) ) |
| 2631 | 2631 | ROM_LOAD32_BYTE( "wcb_grom0_2_+.grm0_2", 0x000002, 0x100000, CRC(d8e0b06e) SHA1(4981c0cf16df68a1b4da7ebf65ca587c21292478) ) |
| r243192 | r243193 | |
| 3354 | 3354 | ROM_LOAD32_BYTE( "gtg3_grom0_3++.grm0_3", 0x000003, 0x100000, CRC(1173a710) SHA1(1f612c1efbf38796707f5b5fecf9d4044691f031) ) |
| 3355 | 3355 | /* |
| 3356 | 3356 | The above 4 roms have the same exact data as the other sets, but in 8 meg roms instead of 4 meg roms. |
| 3357 | This is the only set that specifical | |
| 3357 | This is the only set that specificaly checks for these roms in this format | |
| 3358 | 3358 | */ |
| 3359 | 3359 | ROM_LOAD32_BYTE( "gtg3_grom1_0+.grm1_0", 0x400000, 0x080000, CRC(80ae7148) SHA1(e19d3390a2a0dad260d770fdbbb64d1f8e43d53f) ) /* actually labeled "GTG3 GROM1_0*" ect */ |
| 3360 | 3360 | ROM_LOAD32_BYTE( "gtg3_grom1_1+.grm1_1", 0x400001, 0x080000, CRC(0f85a618) SHA1(d9ced21c20f9ed6b7f19e7645d75b239ea709b79) ) |
| r243192 | r243193 | |
| 4036 | 4036 | ROM_LOAD32_BYTE( "gt2k_grom1_3.grm1_3", 0x200003, 0x80000, CRC(59f48688) SHA1(37b2c84e487f4f3a9145bef34c573a3716b4a6a7) ) |
| 4037 | 4037 | |
| 4038 | 4038 | /* GT99, GT2K & GT Classic all share the above listed 8 graphics roms and may be labeled GT99, GT2K or GTClassic */ |
| 4039 | /* The Euro version has different GROM2_x compared to the standard US versions. GT Sup | |
| 4039 | /* The Euro version has different GROM2_x compared to the standard US versions. GT Superme PCBs have been seen */ | |
| 4040 | 4040 | /* with GT 2K mask roms as well as all GROMs labeled "GT SUPREME" */ |
| 4041 | 4041 | |
| 4042 | 4042 | ROM_LOAD32_BYTE( "gt_supreme_grom2_0.grm2_0", 0x400000, 0x80000, CRC(33998a3e) SHA1(53832e37c42155eb9c774eb33b8b36fe387fa162) ) |
| r243192 | r243193 | |
| 4505 | 4505 | NOTE: Due to various different upgrade packages from IT, the 3 tier boards can end up with any combination |
| 4506 | 4506 | of rom boards and sound boards. For historical reasons, GTG3 3 tier S versions will use the oldest |
| 4507 | 4507 | sound file set up. Version L will use the newer Ensoniq sample rom and v2.X sound code, while gt97 |
| 4508 | through gtclassic will use the latest "NR" versions. | |
| 4508 | through gtclassic will use the lastest "NR" versions. | |
| 4509 | 4509 | |
| 4510 | 4510 | GT Diamond Edition Tournament is a Euro GT98 with different GROM2_0 through GROM2_3 |
| 4511 | 4511 | GT Royal Edition Tournament is a Euro GT99 |
| 4512 | 4512 | GT Supreme Edition Tournament is a Euro GT2K with different GROM2_0 through GROM2_3 |
| 4513 | 4513 | GT Supreme (on a real PCB with actual tournament data) comes up with a different title screen and is (c) 2002 |
| 4514 | showing the title as GT Supreme Plus! and the Hole-In-One board shows an ad | |
| 4514 | showing the title as GT Supreme Plus! and the Hole-In-One board shows an aditional course, Coconut Cove from GT99 | |
| 4515 | 4515 | Current emulation does not reproduce this extra title screen due to missing tournament data. |
| 4516 | 4516 | There doesn't seem to be a Euro version of GT Classic (at least none have been found). |
| 4517 | 4517 | |
| 4518 | 4518 | NOTE: There is an "8 Meg board" version of the P/N 1083 Rev 2 PCB, so GROM0_0 through GROM0_3 are 8 meg roms and labeled "GTxx GROM0_0 **" ect |
| 4519 | 4519 | while GROM1_0 through GROM1_3 are 4 meg roms matching "4 Meg board" GROM2_0 through GROM2_3 and are labeled "GTxx GROM1_0 *" ect |
| 4520 | It is possible to find these rom combinations on any given GT board set. There is only 1 known GT set which specific | |
| 4520 | It is possible to find these rom combinations on any given GT board set. There is only 1 known GT set which specificly checks for 8 meg | |
| 4521 | 4521 | roms under the GROM Checksum test. |
| 4522 | 4522 | |
| 4523 | 4523 | Parent set will always be gt(year) with the most recent version. IE: gt97 is Golden Tee '97 v1.30 |
| r243192 | r243193 | |
|---|---|---|
| 583 | 583 | } |
| 584 | 584 | |
| 585 | 585 | |
| 586 | WRITE_LINE_MEMBER(itech8_state::generate_sound_irq) | |
| 587 | { | |
| 588 | m_soundcpu->set_input_line(M6809_FIRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE); | |
| 589 | } | |
| 586 | 590 | |
| 591 | ||
| 592 | ||
| 587 | 593 | /************************************* |
| 588 | 594 | * |
| 589 | 595 | * Machine initialization |
| r243192 | r243193 | |
| 1649 | 1655 | |
| 1650 | 1656 | /* sound hardware */ |
| 1651 | 1657 | MCFG_SOUND_ADD("ymsnd", YM2203, CLOCK_8MHz/2) |
| 1652 | MCFG_YM2203_IRQ_HANDLER(I | |
| 1658 | MCFG_YM2203_IRQ_HANDLER(WRITELINE(itech8_state, generate_sound_irq)) | |
| 1653 | 1659 | MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(itech8_state, ym2203_portb_out)) |
| 1654 | 1660 | MCFG_SOUND_ROUTE(0, "mono", 0.07) |
| 1655 | 1661 | MCFG_SOUND_ROUTE(1, "mono", 0.07) |
| r243192 | r243193 | |
| 1669 | 1675 | |
| 1670 | 1676 | /* sound hardware */ |
| 1671 | 1677 | MCFG_SOUND_ADD("ymsnd", YM2608, CLOCK_8MHz) |
| 1672 | MCFG_YM2608_IRQ_HANDLER(I | |
| 1678 | MCFG_YM2608_IRQ_HANDLER(WRITELINE(itech8_state, generate_sound_irq)) | |
| 1673 | 1679 | MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(itech8_state, ym2203_portb_out)) |
| 1674 | 1680 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75) |
| 1675 | 1681 | MACHINE_CONFIG_END |
| r243192 | r243193 | |
| 1688 | 1694 | |
| 1689 | 1695 | /* sound hardware */ |
| 1690 | 1696 | MCFG_SOUND_ADD("ymsnd", YM3812, CLOCK_8MHz/2) |
| 1691 | MCFG_YM3812_IRQ_HANDLER(I | |
| 1697 | MCFG_YM3812_IRQ_HANDLER(WRITELINE(itech8_state, generate_sound_irq)) | |
| 1692 | 1698 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75) |
| 1693 | 1699 | |
| 1694 | 1700 | MCFG_OKIM6295_ADD("oki", CLOCK_8MHz/8, OKIM6295_PIN7_HIGH) // was /128, not /132, so unsure so pin 7 not verified |
| r243192 | r243193 | |
| 1704 | 1710 | |
| 1705 | 1711 | /* sound hardware */ |
| 1706 | 1712 | MCFG_SOUND_ADD("ymsnd", YM3812, CLOCK_8MHz/2) |
| 1707 | MCFG_YM3812_IRQ_HANDLER(I | |
| 1713 | MCFG_YM3812_IRQ_HANDLER(WRITELINE(itech8_state, generate_sound_irq)) | |
| 1708 | 1714 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75) |
| 1709 | 1715 | |
| 1710 | 1716 | MCFG_OKIM6295_ADD("oki", CLOCK_8MHz/8, OKIM6295_PIN7_HIGH) // was /128, not /132, so unsure so pin 7 not verified |
| r243192 | r243193 | |
|---|---|---|
| 622 | 622 | |
| 623 | 623 | ***************************************************************************/ |
| 624 | 624 | |
| 625 | WRITE_LINE_MEMBER(lordgun_state::soundirq) | |
| 626 | { | |
| 627 | m_soundcpu->set_input_line(INPUT_LINE_IRQ0, state ? ASSERT_LINE : CLEAR_LINE); | |
| 628 | } | |
| 629 | ||
| 625 | 630 | static MACHINE_CONFIG_START( lordgun, lordgun_state ) |
| 626 | 631 | MCFG_CPU_ADD("maincpu", M68000, XTAL_20MHz / 2) |
| 627 | 632 | MCFG_CPU_PROGRAM_MAP(lordgun_map) |
| r243192 | r243193 | |
| 663 | 668 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 664 | 669 | |
| 665 | 670 | MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_3_579545MHz) |
| 666 | MCFG_YM3812_IRQ_HANDLER(I | |
| 671 | MCFG_YM3812_IRQ_HANDLER(WRITELINE(lordgun_state, soundirq)) | |
| 667 | 672 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 668 | 673 | |
| 669 | 674 | MCFG_OKIM6295_ADD("oki", XTAL_20MHz / 20, OKIM6295_PIN7_HIGH) // ? 5MHz can't be right! |
| r243192 | r243193 | |
| 713 | 718 | |
| 714 | 719 | MCFG_SOUND_ADD("ymf", YMF278B, 26000000) // ? 26MHz matches video (decrease for faster music tempo) |
| 715 | 720 | MCFG_DEVICE_ADDRESS_MAP(AS_0, ymf278_map) |
| 716 | MCFG_YMF278B_IRQ_HANDLER(I | |
| 721 | MCFG_YMF278B_IRQ_HANDLER(WRITELINE(lordgun_state, soundirq)) | |
| 717 | 722 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5) |
| 718 | 723 | |
| 719 | 724 | MCFG_OKIM6295_ADD("oki", XTAL_20MHz / 20, OKIM6295_PIN7_HIGH) // ? 5MHz can't be right |
| r243192 | r243193 | |
|---|---|---|
| 26 | 26 | |
| 27 | 27 | static ADDRESS_MAP_START( yard_map, AS_PROGRAM, 8, m58_state ) |
| 28 | 28 | AM_RANGE(0x0000, 0x5fff) AM_ROM |
| 29 | AM_RANGE(0x8000, 0x8fff) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram") | |
| 30 | AM_RANGE(0x9000, 0x9fff) AM_WRITE(scroll_panel_w) | |
| 29 | AM_RANGE(0x8000, 0x8fff) AM_RAM_WRITE(yard_videoram_w) AM_SHARE("videoram") | |
| 30 | AM_RANGE(0x9000, 0x9fff) AM_WRITE(yard_scroll_panel_w) | |
| 31 | 31 | AM_RANGE(0xc820, 0xc87f) AM_RAM AM_SHARE("spriteram") |
| 32 | 32 | AM_RANGE(0xa000, 0xa000) AM_RAM AM_SHARE("scroll_x_low") |
| 33 | 33 | AM_RANGE(0xa200, 0xa200) AM_RAM AM_SHARE("scroll_x_high") |
| 34 | 34 | AM_RANGE(0xa400, 0xa400) AM_RAM AM_SHARE("scroll_y_low") |
| 35 | 35 | AM_RANGE(0xa800, 0xa800) AM_RAM AM_SHARE("score_disable") |
| 36 | 36 | AM_RANGE(0xd000, 0xd000) AM_DEVWRITE("irem_audio", irem_audio_device, cmd_w) |
| 37 | AM_RANGE(0xd001, 0xd001) AM_WRITE(flipscreen_w) /* + coin counters */ | |
| 37 | AM_RANGE(0xd001, 0xd001) AM_WRITE(yard_flipscreen_w) /* + coin counters */ | |
| 38 | 38 | AM_RANGE(0xd000, 0xd000) AM_READ_PORT("IN0") |
| 39 | 39 | AM_RANGE(0xd001, 0xd001) AM_READ_PORT("IN1") |
| 40 | 40 | AM_RANGE(0xd002, 0xd002) AM_READ_PORT("IN2") |
| r243192 | r243193 | |
| 203 | 203 | |
| 204 | 204 | MCFG_SCREEN_ADD("screen", RASTER) |
| 205 | 205 | MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK/3, 384, 0, 256, 282, 42, 266) |
| 206 | MCFG_SCREEN_UPDATE_DRIVER(m58_state, screen_update) | |
| 206 | MCFG_SCREEN_UPDATE_DRIVER(m58_state, screen_update_yard) | |
| 207 | 207 | MCFG_SCREEN_PALETTE("palette") |
| 208 | 208 | |
| 209 | 209 | /* sound hardware */ |
| r243192 | r243193 | |
|---|---|---|
| 2462 | 2462 | |
| 2463 | 2463 | /* 3x6809, static tilemap, 2bpp sprites (Gaplus type) */ |
| 2464 | 2464 | GAME( 1983, phozon, 0, phozon, phozon, mappy_state, phozon, ROT90, "Namco", "Phozon (Japan)", GAME_SUPPORTS_SAVE ) |
| 2465 | GAME( 1983, phozons, phozon, phozon, phozon, mappy_state, phozon, ROT90, " | |
| 2465 | GAME( 1983, phozons, phozon, phozon, phozon, mappy_state, phozon, ROT90, "bootleg? (Sidam)", "Phozon (Sidam)", GAME_SUPPORTS_SAVE ) | |
| 2466 | 2466 | |
| 2467 | 2467 | /* 2x6809, scroling tilemap, 4bpp sprites (Super Pacman type) */ |
| 2468 | 2468 | GAME( 1983, mappy, 0, mappy, mappy, mappy_state, mappy, ROT90, "Namco", "Mappy (US)", GAME_SUPPORTS_SAVE ) |
| r243192 | r243193 | |
|---|---|---|
| 255 | 255 | update_irq_state(); |
| 256 | 256 | } |
| 257 | 257 | |
| 258 | WRITE_LINE_MEMBER(metro_state::ymf278b_interrupt) | |
| 259 | { | |
| 260 | m_maincpu->set_input_line(2, state ? ASSERT_LINE : CLEAR_LINE); | |
| 261 | } | |
| 262 | ||
| 263 | ||
| 258 | 264 | /*************************************************************************** |
| 259 | 265 | |
| 260 | 266 | |
| r243192 | r243193 | |
| 1602 | 1608 | membank("bank1")->set_base(&RAM[bankaddress]); |
| 1603 | 1609 | } |
| 1604 | 1610 | |
| 1611 | WRITE_LINE_MEMBER(metro_state::blzntrnd_irqhandler) | |
| 1612 | { | |
| 1613 | m_audiocpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE); | |
| 1614 | } | |
| 1615 | ||
| 1605 | 1616 | static ADDRESS_MAP_START( blzntrnd_sound_map, AS_PROGRAM, 8, metro_state ) |
| 1606 | 1617 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 1607 | 1618 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") |
| r243192 | r243193 | |
| 3649 | 3660 | |
| 3650 | 3661 | MCFG_SOUND_ADD("ymf", YMF278B, YMF278B_STD_CLOCK) |
| 3651 | 3662 | MCFG_DEVICE_ADDRESS_MAP(AS_0, ymf278_map) |
| 3652 | MCFG_YMF278B_IRQ_HANDLER(I | |
| 3663 | MCFG_YMF278B_IRQ_HANDLER(WRITELINE(metro_state, ymf278b_interrupt)) | |
| 3653 | 3664 | MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) |
| 3654 | 3665 | MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) |
| 3655 | 3666 | MACHINE_CONFIG_END |
| r243192 | r243193 | |
| 4373 | 4384 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 4374 | 4385 | |
| 4375 | 4386 | MCFG_SOUND_ADD("ymsnd", YM2610, XTAL_16MHz/2) |
| 4376 | MCFG_YM2610_IRQ_HANDLER(I | |
| 4387 | MCFG_YM2610_IRQ_HANDLER(WRITELINE(metro_state, blzntrnd_irqhandler)) | |
| 4377 | 4388 | MCFG_SOUND_ROUTE(0, "lspeaker", 0.25) |
| 4378 | 4389 | MCFG_SOUND_ROUTE(0, "rspeaker", 0.25) |
| 4379 | 4390 | MCFG_SOUND_ROUTE(1, "lspeaker", 1.0) |
| r243192 | r243193 | |
|---|---|---|
| 43 | 43 | AM_RANGE(0x01000000, 0x013fffff) AM_RAM |
| 44 | 44 | AM_RANGE(0x01400000, 0x0141ffff) AM_READWRITE(midtunit_cmos_r, midtunit_cmos_w) AM_SHARE("nvram") |
| 45 | 45 | AM_RANGE(0x01480000, 0x014fffff) AM_WRITE(midtunit_cmos_enable_w) |
| 46 | AM_RANGE(0x01600000, 0x0160000f) AM_READ_PORT("IN0") | |
| 47 | AM_RANGE(0x01600010, 0x0160001f) AM_READ_PORT("IN1") | |
| 48 | AM_RANGE(0x01600020, 0x0160002f) AM_READ_PORT("IN2") | |
| 49 | AM_RANGE(0x01600030, 0x0160003f) AM_READ_PORT("DSW") | |
| 46 | AM_RANGE(0x01600000, 0x0160003f) AM_READ(midtunit_input_r) | |
| 50 | 47 | AM_RANGE(0x01800000, 0x0187ffff) AM_RAM_WRITE(midtunit_paletteram_w) AM_SHARE("paletteram") |
| 51 | 48 | AM_RANGE(0x01a80000, 0x01a800ff) AM_READWRITE(midtunit_dma_r, midtunit_dma_w) |
| 52 | 49 | AM_RANGE(0x01b00000, 0x01b0001f) AM_WRITE(midtunit_control_w) |
| r243192 | r243193 | |
|---|---|---|
| 124 | 124 | #include "sound/2612intf.h" |
| 125 | 125 | #include "includes/model2.h" |
| 126 | 126 | |
| 127 | ||
| 127 | 128 | enum { |
| 128 | 129 | DSP_TYPE_TGP = 1, |
| 129 | 130 | DSP_TYPE_SHARC = 2, |
| r243192 | r243193 | |
| 1222 | 1223 | |
| 1223 | 1224 | /* Protection handling */ |
| 1224 | 1225 | |
| 1226 | static const UINT8 ZGUNProt[] = | |
| 1227 | { | |
| 1228 | 0x7F,0x4E,0x1B,0x1E,0xA8,0x48,0xF5,0x49,0x31,0x32,0x4A,0x09,0x89,0x29,0xC0,0x41, | |
| 1229 | 0x3A,0x49,0x85,0x24,0xA0,0x4D,0x21,0x31,0xEA,0xC3,0x3F,0xAF,0x0E,0x4B,0x25,0x02, | |
| 1230 | 0xFB,0x0F,0x44,0x55,0x2E,0x82,0x55,0xC3,0xCB,0x91,0x52,0x7E,0x72,0x53,0xF2,0xAA, | |
| 1231 | 0x39,0x19,0xB1,0x42,0x33,0x63,0x13,0xFA,0x39,0x9C,0xE0,0x53,0x93,0x8B,0x14,0x91, | |
| 1232 | 0x9D,0x1C,0xFE,0x52,0x59,0xD4,0x2A,0x6A,0xA3,0xC5,0xA0,0xCA,0x92,0x5A,0x58,0xAC, | |
| 1233 | 0x95,0x4A,0x19,0x89,0x65,0xD3,0xA8,0x4A,0xE3,0xCE,0x8D,0x89,0xC5,0x48,0x95,0xE4, | |
| 1234 | 0x94,0xD5,0x73,0x09,0xE4,0x3D,0x2D,0x92,0xC9,0xA7,0xA3,0x53,0x42,0x82,0x55,0x67, | |
| 1235 | 0xE4,0x66,0xD0,0x4A,0x7D,0x4A,0x13,0xDE,0xD7,0x9F,0x38,0xAA,0x00,0x56,0x85,0x0A | |
| 1236 | }; | |
| 1225 | 1237 | |
| 1226 | ||
| 1238 | static const UINT8 DCOPKey1326[]= | |
| 1227 | 1239 | { |
| 1240 | 0x43,0x66,0x54,0x11,0x99,0xfe,0xcc,0x8e,0xdd,0x87,0x11,0x89,0x22,0xdf,0x44,0x09 | |
| 1241 | }; | |
| 1242 | ||
| 1243 | READ32_MEMBER(model2_state::model2_prot_r) | |
| 1244 | { | |
| 1228 | 1245 | UINT32 retval = 0; |
| 1229 | 1246 | |
| 1230 | if (offset == 0x0000/4) | |
| 1247 | if (offset == 0x10000/4) | |
| 1231 | 1248 | { |
| 1232 | 1249 | // status: bit 0 = 1 for busy, 0 for ready |
| 1233 | ret | |
| 1250 | return 0; // we're always ready | |
| 1234 | 1251 | } |
| 1235 | else if (offset == 0x000e/4) | |
| 1252 | else if (offset == 0x1000e/4) | |
| 1236 | 1253 | { |
| 1237 | if (first_read == 1) | |
| 1238 | { | |
| 1239 | // the RAM based schemes expect a dummy value before the start of the stream | |
| 1240 | // to match the previous simulation (dynamite cop) I use 0x0000 here | |
| 1241 | first_read = 0; | |
| 1242 | retval = 0; | |
| 1243 | } | |
| 1254 | retval = m_protram[m_protstate+1] | m_protram[m_protstate]<<8; | |
| 1255 | retval <<= 16; | |
| 1256 | m_protstate+=2; | |
| 1257 | } | |
| 1258 | else if (offset == 0x7ff8/4) | |
| 1259 | { | |
| 1260 | retval = m_protram[m_protstate+1] | m_protram[m_protstate]<<8; | |
| 1261 | m_protstate+=2; | |
| 1262 | } | |
| 1263 | else if (offset == 0x400c/4) | |
| 1264 | { | |
| 1265 | m_prot_a = !m_prot_a; | |
| 1266 | if (m_prot_a) | |
| 1267 | return 0xffff; | |
| 1244 | 1268 | else |
| 1245 | { | |
| 1246 | UINT8* base; | |
| 1247 | retval = m_cryptdevice->do_decrypt(base); | |
| 1248 | retval = ((retval & 0xff00) >> 8) | ((retval & 0x00ff) << 8); | |
| 1249 | retval <<= 16; | |
| 1250 | } | |
| 1269 | return 0xfff0; | |
| 1251 | 1270 | } |
| 1252 | 1271 | else logerror("Unhandled Protection READ @ %x mask %x (PC=%x)\n", offset, mem_mask, space.device().safe_pc()); |
| 1253 | 1272 | |
| 1254 | logerror("model2_5881prot_r %08x: %08x (%08x)\n", offset*4, retval, mem_mask); | |
| 1255 | ||
| 1256 | 1273 | return retval; |
| 1257 | 1274 | } |
| 1258 | 1275 | |
| 1259 | WRITE32_MEMBER(model2_state::model2_ | |
| 1276 | WRITE32_MEMBER(model2_state::model2_prot_w) | |
| 1260 | 1277 | { |
| 1261 | logerror("model2_5881prot_w %08x: %08x (%08x)\n", offset*4, data, mem_mask); | |
| 1278 | if (mem_mask == 0xffff0000) | |
| 1279 | { | |
| 1280 | data >>= 16; | |
| 1281 | } | |
| 1262 | 1282 | |
| 1263 | ||
| 1264 | if (offset == 0x0008/4) | |
| 1283 | if (offset == 0x10008/4) | |
| 1265 | 1284 | { |
| 1266 | // Zero Gunner uses this, it's encrypted data in prot.RAM consists of several small chunks, selected using low address | |
| 1267 | // so far this is only known game with 315-5881 which uses not 0 offset in prot.RAM | |
| 1268 | if (mem_mask == 0x0000ffff) | |
| 1269 | m_cryptdevice->set_addr_low(data&0xffff); | |
| 1270 | else if (mem_mask == 0xffff0000) | |
| 1285 | m_protpos = data; | |
| 1286 | } | |
| 1287 | else if (offset == 0x1000c/4) | |
| 1288 | { | |
| 1289 | switch (data) | |
| 1271 | 1290 | { |
| 1272 | m_cryptdevice->set_addr_high(0); | |
| 1273 | if (data != 0) | |
| 1274 | printf("model2_5881prot_w not zero high address %08x (%08x)\n", data, mem_mask); | |
| 1291 | // dynamcop | |
| 1292 | case 0x7700: | |
| 1293 | strcpy((char *)m_protram+2, "UCHIDA MOMOKA "); | |
| 1294 | break; | |
| 1295 | ||
| 1296 | // dynamcop | |
| 1297 | case 0x1326: | |
| 1298 | m_protstate = 0; | |
| 1299 | memcpy(m_protram+2, DCOPKey1326, sizeof(DCOPKey1326)); | |
| 1300 | break; | |
| 1301 | ||
| 1302 | // zerogun | |
| 1303 | case 0xA1BC: | |
| 1304 | case 0xAD23: | |
| 1305 | case 0x13CD: | |
| 1306 | case 0x4D53: | |
| 1307 | case 0x234D: | |
| 1308 | case 0x113D: | |
| 1309 | case 0x1049: | |
| 1310 | case 0x993D: | |
| 1311 | case 0x983C: | |
| 1312 | case 0x935: | |
| 1313 | case 0x9845: | |
| 1314 | case 0x556D: | |
| 1315 | case 0x98CC: | |
| 1316 | case 0x3422: | |
| 1317 | case 0x10: | |
| 1318 | m_protstate = 0; | |
| 1319 | memcpy(m_protram+2, ZGUNProt+((2*m_protpos)/12)*8, sizeof(ZGUNProt)); | |
| 1320 | break; | |
| 1321 | ||
| 1322 | // pltkids | |
| 1323 | case 0x7140: | |
| 1324 | m_protstate = 0; | |
| 1325 | strcpy((char *)m_protram+2, "98-PILOT "); | |
| 1326 | break; | |
| 1327 | ||
| 1328 | default: | |
| 1329 | m_protstate = 0; | |
| 1330 | break; | |
| 1275 | 1331 | } |
| 1276 | first_read = 1; | |
| 1277 | 1332 | } |
| 1278 | else if (offset == 0x | |
| 1333 | else if (offset == 0x7ff2/4) | |
| 1279 | 1334 | { |
| 1280 | printf("subkey %08x (%08x)\n", data, mem_mask); | |
| 1281 | m_cryptdevice->set_subkey(data&0xffff); | |
| 1335 | if (data == 0) | |
| 1336 | { | |
| 1337 | m_protstate = 0; | |
| 1338 | strcpy((char *)m_protram, " TECMO LTD. DEAD OR ALIVE 1996.10.22 VER. 1.00"); | |
| 1339 | } | |
| 1282 | 1340 | } |
| 1283 | else | |
| 1341 | else logerror("Unhandled Protection WRITE %x @ %x mask %x (PC=%x)\n", data, offset, mem_mask, space.device().safe_pc()); | |
| 1284 | 1342 | |
| 1285 | 1343 | } |
| 1286 | 1344 | |
| 1287 | ||
| 1288 | ||
| 1289 | 1345 | /* Daytona "To The MAXX" PIC protection simulation */ |
| 1290 | 1346 | |
| 1291 | 1347 | |
| r243192 | r243193 | |
| 2478 | 2534 | MCFG_SEGAM1AUDIO_ADD("m1audio") |
| 2479 | 2535 | MACHINE_CONFIG_END |
| 2480 | 2536 | |
| 2481 | UINT16 model2_state::crypt_read_callback(UINT32 addr) | |
| 2482 | { | |
| 2483 | UINT16 dat= m_maincpu->space().read_word((0x1d80000+2*addr)); | |
| 2484 | return ((dat&0xff00)>>8)|((dat&0x00ff)<<8); | |
| 2485 | } | |
| 2486 | ||
| 2487 | static MACHINE_CONFIG_DERIVED( model2a_5881, model2a ) | |
| 2488 | MCFG_DEVICE_ADD("315_5881", SEGA315_5881_CRYPT, 0) | |
| 2489 | MCFG_SET_READ_CALLBACK(model2_state, crypt_read_callback) | |
| 2490 | MACHINE_CONFIG_END | |
| 2491 | ||
| 2492 | static MACHINE_CONFIG_DERIVED( model2a_0229, model2a ) | |
| 2493 | MCFG_DEVICE_ADD("317_0229", SEGA315_5838_COMP, 0) | |
| 2494 | // MCFG_SET_5838_READ_CALLBACK(model2_state, crypt_read_callback) | |
| 2495 | MACHINE_CONFIG_END | |
| 2496 | ||
| 2497 | 2537 | READ8_MEMBER(model2_state::driveio_port_r) |
| 2498 | 2538 | { |
| 2499 | 2539 | return m_driveio_comm_data; |
| r243192 | r243193 | |
| 2591 | 2631 | MCFG_SOUND_ROUTE(0, "rspeaker", 2.0) |
| 2592 | 2632 | MACHINE_CONFIG_END |
| 2593 | 2633 | |
| 2594 | ||
| 2595 | static MACHINE_CONFIG_DERIVED( model2b_5881, model2b ) | |
| 2596 | MCFG_DEVICE_ADD("315_5881", SEGA315_5881_CRYPT, 0) | |
| 2597 | MCFG_SET_READ_CALLBACK(model2_state, crypt_read_callback) | |
| 2598 | MACHINE_CONFIG_END | |
| 2599 | ||
| 2600 | static MACHINE_CONFIG_DERIVED( model2b_0229, model2b ) | |
| 2601 | MCFG_DEVICE_ADD("317_0229", SEGA315_5838_COMP, 0) | |
| 2602 | // MCFG_SET_5838_READ_CALLBACK(model2_state, crypt_read_callback) | |
| 2603 | MACHINE_CONFIG_END | |
| 2604 | ||
| 2605 | ||
| 2606 | 2634 | static ADDRESS_MAP_START( copro_tgpx4_map, AS_PROGRAM, 32, model2_state ) |
| 2607 | 2635 | AM_RANGE(0x00000000, 0x00007fff) AM_RAM AM_SHARE("tgpx4_program") |
| 2608 | 2636 | ADDRESS_MAP_END |
| r243192 | r243193 | |
| 2662 | 2690 | MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) |
| 2663 | 2691 | MACHINE_CONFIG_END |
| 2664 | 2692 | |
| 2665 | static MACHINE_CONFIG_DERIVED( model2c_5881, model2c ) | |
| 2666 | MCFG_DEVICE_ADD("315_5881", SEGA315_5881_CRYPT, 0) | |
| 2667 | MCFG_SET_READ_CALLBACK(model2_state, crypt_read_callback) | |
| 2668 | MACHINE_CONFIG_END | |
| 2669 | ||
| 2670 | ||
| 2671 | 2693 | /* ROM definitions */ |
| 2672 | 2694 | |
| 2673 | 2695 | /* |
| r243192 | r243193 | |
| 2731 | 2753 | ROM_LOAD("mpr-20303.32", 0x000000, 0x200000, CRC(c040973f) SHA1(57a496c5dcc1a3931b6e41bf8d41e45d6dac0c31) ) |
| 2732 | 2754 | ROM_LOAD("mpr-20304.33", 0x200000, 0x200000, CRC(6decfe83) SHA1(d73adafceff2f1776c93e53bd5677d67f1c2c08f) ) |
| 2733 | 2755 | |
| 2734 | // 1997 317-5038-COM Model 2 | |
| 2735 | ROM_PARAMETER( ":315_5881:key", "042c0d13" ) | |
| 2736 | ||
| 2737 | 2756 | MODEL2_CPU_BOARD |
| 2738 | 2757 | MODEL2A_VID_BOARD |
| 2739 | 2758 | ROM_END |
| r243192 | r243193 | |
| 2766 | 2785 | ROM_LOAD("mpr-20303.32", 0x000000, 0x200000, CRC(c040973f) SHA1(57a496c5dcc1a3931b6e41bf8d41e45d6dac0c31) ) |
| 2767 | 2786 | ROM_LOAD("mpr-20304.33", 0x200000, 0x200000, CRC(6decfe83) SHA1(d73adafceff2f1776c93e53bd5677d67f1c2c08f) ) |
| 2768 | 2787 | |
| 2769 | // 1997 317-5038-COM Model 2 | |
| 2770 | ROM_PARAMETER( ":315_5881:key", "042c0d13" ) | |
| 2771 | ||
| 2772 | 2788 | MODEL2_CPU_BOARD |
| 2773 | 2789 | MODEL2A_VID_BOARD |
| 2774 | 2790 | ROM_END |
| r243192 | r243193 | |
| 2800 | 2816 | ROM_REGION( 0x400000, "scsp", 0 ) // Samples |
| 2801 | 2817 | ROM_LOAD("mpr-20303.32", 0x000000, 0x200000, CRC(c040973f) SHA1(57a496c5dcc1a3931b6e41bf8d41e45d6dac0c31) ) |
| 2802 | 2818 | ROM_LOAD("mpr-20304.33", 0x200000, 0x200000, CRC(6decfe83) SHA1(d73adafceff2f1776c93e53bd5677d67f1c2c08f) ) |
| 2803 | ||
| 2804 | // 1997 317-5038-COM Model 2 | |
| 2805 | ROM_PARAMETER( ":315_5881:key", "042c0d13" ) | |
| 2806 | 2819 | ROM_END |
| 2807 | 2820 | |
| 2808 | 2821 | ROM_START( zerogunj ) /* Zero Gunner (Japan), Model 2B */ |
| r243192 | r243193 | |
| 2832 | 2845 | ROM_REGION( 0x400000, "scsp", 0 ) // Samples |
| 2833 | 2846 | ROM_LOAD("mpr-20303.32", 0x000000, 0x200000, CRC(c040973f) SHA1(57a496c5dcc1a3931b6e41bf8d41e45d6dac0c31) ) |
| 2834 | 2847 | ROM_LOAD("mpr-20304.33", 0x200000, 0x200000, CRC(6decfe83) SHA1(d73adafceff2f1776c93e53bd5677d67f1c2c08f) ) |
| 2835 | ||
| 2836 | // 1997 317-5038-COM Model 2 | |
| 2837 | ROM_PARAMETER( ":315_5881:key", "042c0d13" ) | |
| 2838 | 2848 | ROM_END |
| 2839 | 2849 | |
| 2840 | 2850 | ROM_START( gunblade ) /* Gunblade NY Revision A, Model 2B, Sega game ID# 833-12562 GUN BLADE, Sega ROM board ID# 834-12563 */ |
| r243192 | r243193 | |
| 3570 | 3580 | ROM_LOAD("mpr-20814.36", 0x400000, 0x200000, CRC(e8ebc74c) SHA1(731ce721bb9e148f3a9f7fbe569522567a681c4e) ) |
| 3571 | 3581 | ROM_LOAD("mpr-20815.37", 0x600000, 0x200000, CRC(1b5aaae4) SHA1(32b4bf6c096fdccdd5d8f1ddb6c27d3389a52234) ) |
| 3572 | 3582 | |
| 3573 | // 1998 317-0236-COM Model 2 | |
| 3574 | ROM_PARAMETER( ":315_5881:key", "0c2a4a93" ) | |
| 3575 | ||
| 3576 | 3583 | MODEL2_CPU_BOARD |
| 3577 | 3584 | MODEL2A_VID_BOARD |
| 3578 | 3585 | ROM_END |
| r243192 | r243193 | |
| 3621 | 3628 | ROM_LOAD("mpr-20814.36", 0x400000, 0x200000, CRC(e8ebc74c) SHA1(731ce721bb9e148f3a9f7fbe569522567a681c4e) ) |
| 3622 | 3629 | ROM_LOAD("mpr-20815.37", 0x600000, 0x200000, CRC(1b5aaae4) SHA1(32b4bf6c096fdccdd5d8f1ddb6c27d3389a52234) ) |
| 3623 | 3630 | |
| 3624 | // 1998 317-0236-COM Model 2 | |
| 3625 | ROM_PARAMETER( ":315_5881:key", "0c2a4a93" ) | |
| 3626 | ||
| 3627 | 3631 | MODEL2_CPU_BOARD |
| 3628 | 3632 | MODEL2A_VID_BOARD |
| 3629 | 3633 | ROM_END |
| r243192 | r243193 | |
| 3671 | 3675 | ROM_LOAD("mpr-20813.32", 0x200000, 0x200000, CRC(1908679c) SHA1(32913385f09da2e43af0c4a4612b955527bfe759) ) |
| 3672 | 3676 | ROM_LOAD("mpr-20814.36", 0x400000, 0x200000, CRC(e8ebc74c) SHA1(731ce721bb9e148f3a9f7fbe569522567a681c4e) ) |
| 3673 | 3677 | ROM_LOAD("mpr-20815.37", 0x600000, 0x200000, CRC(1b5aaae4) SHA1(32b4bf6c096fdccdd5d8f1ddb6c27d3389a52234) ) |
| 3674 | ||
| 3675 | // 1998 317-0236-COM Model 2 | |
| 3676 | ROM_PARAMETER( ":315_5881:key", "0c2a4a93" ) | |
| 3677 | 3678 | ROM_END |
| 3678 | 3679 | |
| 3679 | 3680 | ROM_START( dyndeka2b ) /* Dynamite Deka 2 (Japan), Model 2B */ |
| r243192 | r243193 | |
| 3719 | 3720 | ROM_LOAD("mpr-20813.32", 0x200000, 0x200000, CRC(1908679c) SHA1(32913385f09da2e43af0c4a4612b955527bfe759) ) |
| 3720 | 3721 | ROM_LOAD("mpr-20814.36", 0x400000, 0x200000, CRC(e8ebc74c) SHA1(731ce721bb9e148f3a9f7fbe569522567a681c4e) ) |
| 3721 | 3722 | ROM_LOAD("mpr-20815.37", 0x600000, 0x200000, CRC(1b5aaae4) SHA1(32b4bf6c096fdccdd5d8f1ddb6c27d3389a52234) ) |
| 3722 | ||
| 3723 | // 1998 317-0236-COM Model 2 | |
| 3724 | ROM_PARAMETER( ":315_5881:key", "0c2a4a93" ) | |
| 3725 | 3723 | ROM_END |
| 3726 | 3724 | |
| 3727 | 3725 | ROM_START( dynamcopc ) /* Dynamite Cop (USA), Model 2C */ |
| r243192 | r243193 | |
| 3767 | 3765 | ROM_LOAD("mpr-20813.32", 0x200000, 0x200000, CRC(1908679c) SHA1(32913385f09da2e43af0c4a4612b955527bfe759) ) /* Located at position 33 on 2C-CRX rom board */ |
| 3768 | 3766 | ROM_LOAD("mpr-20814.36", 0x400000, 0x200000, CRC(e8ebc74c) SHA1(731ce721bb9e148f3a9f7fbe569522567a681c4e) ) /* Located at position 34 on 2C-CRX rom board */ |
| 3769 | 3767 | ROM_LOAD("mpr-20815.37", 0x600000, 0x200000, CRC(1b5aaae4) SHA1(32b4bf6c096fdccdd5d8f1ddb6c27d3389a52234) ) /* Located at position 35 on 2C-CRX rom board */ |
| 3770 | ||
| 3771 | // 1998 317-0236-COM Model 2 | |
| 3772 | ROM_PARAMETER( ":315_5881:key", "0c2a4a93" ) | |
| 3773 | 3768 | ROM_END |
| 3774 | 3769 | |
| 3775 | 3770 | ROM_START( schamp ) /* Sonic Championship, Model 2B - Sega ROM board ID# 834-12786 */ |
| r243192 | r243193 | |
| 4312 | 4307 | ROM_LOAD("mpr-21279.sd3", 0x0400000, 0x200000, CRC(3a8dcf68) SHA1(312496b45b699051c8b4dd0e5d94e73fe5f3ad8d) ) |
| 4313 | 4308 | ROM_LOAD("mpr-21280.sd4", 0x0600000, 0x200000, CRC(aa548124) SHA1(a94adfe16b5c3236746451c181ccd3e1c27432f4) ) |
| 4314 | 4309 | |
| 4315 | // 1998 317-5044-COM Model 2 | |
| 4316 | ROM_PARAMETER( ":315_5881:key", "042e2dc1" ) | |
| 4317 | ||
| 4318 | 4310 | MODEL2_CPU_BOARD |
| 4319 | 4311 | MODEL2A_VID_BOARD |
| 4320 | 4312 | ROM_END |
| r243192 | r243193 | |
| 4354 | 4346 | ROM_LOAD("mpr-21278.sd2", 0x0200000, 0x200000, CRC(27e18e08) SHA1(254c0ad4d6bd572ff0efc3ea80489e73716a31a7) ) |
| 4355 | 4347 | ROM_LOAD("mpr-21279.sd3", 0x0400000, 0x200000, CRC(3a8dcf68) SHA1(312496b45b699051c8b4dd0e5d94e73fe5f3ad8d) ) |
| 4356 | 4348 | ROM_LOAD("mpr-21280.sd4", 0x0600000, 0x200000, CRC(aa548124) SHA1(a94adfe16b5c3236746451c181ccd3e1c27432f4) ) |
| 4357 | ||
| 4358 | // 1998 317-5044-COM Model 2 | |
| 4359 | ROM_PARAMETER( ":315_5881:key", "042e2dc1" ) | |
| 4360 | 4349 | ROM_END |
| 4361 | 4350 | |
| 4362 | 4351 | ROM_START( indy500 ) /* Defaults to Twin (Stand Alone) Cab version. 2 credits to start - Can be set to Deluxe setting in service mode, Sega Game ID# 833-12361, ROM board ID# 834-12362 */ |
| r243192 | r243193 | |
| 5891 | 5880 | |
| 5892 | 5881 | DRIVER_INIT_MEMBER(model2_state,genprot) |
| 5893 | 5882 | { |
| 5894 | //astring key = parameter(":315_5881:key"); | |
| 5895 | m_maincpu->space(AS_PROGRAM).install_ram(0x01d80000, 0x01d8ffff); | |
| 5896 | m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x01d90000, 0x01d9ffff, read32_delegate(FUNC(model2_state::model2_5881prot_r), this), write32_delegate(FUNC(model2_state::model2_5881prot_w), this)); | |
| 5883 | m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x01d80000, 0x01dfffff, read32_delegate(FUNC(model2_state::model2_prot_r),this), write32_delegate(FUNC(model2_state::model2_prot_w),this)); | |
| 5884 | m_protstate = m_protpos = 0; | |
| 5897 | 5885 | } |
| 5898 | 5886 | |
| 5899 | 5887 | DRIVER_INIT_MEMBER(model2_state,pltkids) |
| 5900 | 5888 | { |
| 5901 | | |
| 5889 | UINT32 *ROM = (UINT32 *)memregion("maincpu")->base(); | |
| 5902 | 5890 | |
| 5891 | m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x01d80000, 0x01dfffff, read32_delegate(FUNC(model2_state::model2_prot_r),this), write32_delegate(FUNC(model2_state::model2_prot_w),this)); | |
| 5892 | m_protstate = m_protpos = 0; | |
| 5893 | ||
| 5903 | 5894 | // fix bug in program: it destroys the interrupt table and never fixes it |
| 5904 | UINT32 *ROM = (UINT32 *)memregion("maincpu")->base(); | |
| 5905 | 5895 | ROM[0x730/4] = 0x08000004; |
| 5906 | 5896 | } |
| 5907 | 5897 | |
| 5908 | 5898 | DRIVER_INIT_MEMBER(model2_state,zerogun) |
| 5909 | 5899 | { |
| 5910 | | |
| 5900 | UINT32 *ROM = (UINT32 *)memregion("maincpu")->base(); | |
| 5911 | 5901 | |
| 5902 | m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x01d80000, 0x01dfffff, read32_delegate(FUNC(model2_state::model2_prot_r),this), write32_delegate(FUNC(model2_state::model2_prot_w),this)); | |
| 5903 | m_protstate = m_protpos = 0; | |
| 5904 | ||
| 5912 | 5905 | // fix bug in program: it destroys the interrupt table and never fixes it |
| 5913 | UINT32 *ROM = (UINT32 *)memregion("maincpu")->base(); | |
| 5914 | 5906 | ROM[0x700/4] = 0x08000004; |
| 5915 | 5907 | } |
| 5916 | 5908 | |
| r243192 | r243193 | |
| 5947 | 5939 | |
| 5948 | 5940 | DRIVER_INIT_MEMBER(model2_state,sgt24h) |
| 5949 | 5941 | { |
| 5950 | ||
| 5942 | UINT32 *ROM = (UINT32 *)memregion("maincpu")->base(); | |
| 5951 | 5943 | |
| 5944 | m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x01d80000, 0x01dfffff, read32_delegate(FUNC(model2_state::model2_prot_r),this), write32_delegate(FUNC(model2_state::model2_prot_w),this)); | |
| 5952 | 5945 | m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x01a10000, 0x01a1ffff, read32_delegate(FUNC(model2_state::jaleco_network_r),this), write32_delegate(FUNC(model2_state::jaleco_network_w),this)); |
| 5953 | 5946 | |
| 5954 | UINT32 *ROM = (UINT32 *)memregion("maincpu")->base(); | |
| 5947 | m_protstate = m_protpos = 0; | |
| 5948 | ||
| 5955 | 5949 | ROM[0x56578/4] = 0x08000004; |
| 5956 | 5950 | //ROM[0x5b3e8/4] = 0x08000004; |
| 5957 | 5951 | } |
| r243192 | r243193 | |
| 5964 | 5958 | |
| 5965 | 5959 | DRIVER_INIT_MEMBER(model2_state,doa) |
| 5966 | 5960 | { |
| 5967 | m_0229crypt->install_doa_protection(); | |
| 5968 | ||
| 5969 | 5961 | UINT32 *ROM = (UINT32 *)memregion("maincpu")->base(); |
| 5962 | ||
| 5963 | m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x01d80000, 0x01dfffff, read32_delegate(FUNC(model2_state::model2_prot_r),this), write32_delegate(FUNC(model2_state::model2_prot_w),this)); | |
| 5964 | m_protstate = m_protpos = 0; | |
| 5965 | ||
| 5970 | 5966 | ROM[0x630/4] = 0x08000004; |
| 5971 | 5967 | ROM[0x808/4] = 0x08000004; |
| 5972 | 5968 | } |
| r243192 | r243193 | |
| 5995 | 5991 | GAME( 1994, vcopa, vcop, model2o, vcop, driver_device, 0, ROT0, "Sega", "Virtua Cop (Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| 5996 | 5992 | |
| 5997 | 5993 | // Model 2A-CRX (TGPs, SCSP sound board) |
| 5998 | GAME( 1995, manxtt, 0, manxttdx ,manxtt, driver_device, 0, ROT0, "Sega", "Manx TT Superbike - DX (Revision D)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 5999 | GAME( 1995, manxttc, 0, model2a, manxtt, driver_device, 0, ROT0, "Sega", "Manx TT Superbike - Twin (Revision C)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6000 | GAME( 1995, srallyc, 0, srallyc, srallyc, model2_state, srallyc, ROT0, "Sega", "Sega Rally Championship - TWIN (Revision C)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6001 | GAME( 1995, srallycb, srallyc, srallyc, srallyc, model2_state, srallyc, ROT0, "Sega", "Sega Rally Championship - TWIN (Revision B)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6002 | GAME( 1995, srallyca, srallyc, srallyc, srallyc, model2_state, srallyc, ROT0, "Sega", "Sega Rally Championship - DX (Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6003 | GAME( 1995, vf2, 0, model2a, model2, driver_device, 0, ROT0, "Sega", "Virtua Fighter 2 (Version 2.1)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6004 | GAME( 1995, vf2b, vf2, model2a, model2, driver_device, 0, ROT0, "Sega", "Virtua Fighter 2 (Revision B)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6005 | GAME( 1995, vf2a, vf2, model2a, model2, driver_device, 0, ROT0, "Sega", "Virtua Fighter 2 (Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6006 | GAME( 1995, vf2o, vf2, model2a, model2, driver_device, 0, ROT0, "Sega", "Virtua Fighter 2", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6007 | GAME( 1995, vcop2, 0, model2a, vcop2, driver_device, 0, ROT0, "Sega", "Virtua Cop 2", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6008 | GAME( 1995, skytargt, 0, model2a, skytargt,driver_device, 0, ROT0, "Sega", "Sky Target", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6009 | GAME( 1996, doaa, doa, model2a_0229, model2, model2_state, doa, ROT0, "Sega", "Dead or Alive (Model 2A, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6010 | GAME( 1997, zeroguna, zerogun, model2a_5881, model2, model2_state, zerogun, ROT0, "Psikyo", "Zero Gunner (Export, Model 2A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6011 | GAME( 1997, zerogunaj, zerogun, model2a_5881, model2, model2_state, zerogun, ROT0, "Psikyo", "Zero Gunner (Japan, Model 2A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6012 | GAME( 1997, motoraid, 0, model2a, manxtt, driver_device, 0, ROT0, "Sega", "Motor Raid - Twin", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6013 | GAME( 1998, dynamcop, 0, model2a_5881, model2, model2_state, genprot, ROT0, "Sega", "Dynamite Cop (Export, Model 2A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6014 | GAME( 1998, dyndeka2, dynamcop, model2a_5881, model2, model2_state, genprot, ROT0, "Sega", "Dynamite Deka 2 (Japan, Model 2A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6015 | GAME( 1998, pltkidsa, pltkids, model2a_5881, model2, model2_state, pltkids, ROT0, "Psikyo", "Pilot Kids (Model 2A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 5994 | GAME( 1995, manxtt, 0, manxttdx,manxtt, driver_device, 0, ROT0, "Sega", "Manx TT Superbike - DX (Revision D)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 5995 | GAME( 1995, manxttc, 0, model2a, manxtt, driver_device, 0, ROT0, "Sega", "Manx TT Superbike - Twin (Revision C)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 5996 | GAME( 1995, srallyc, 0, srallyc, srallyc, model2_state, srallyc, ROT0, "Sega", "Sega Rally Championship - TWIN (Revision C)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 5997 | GAME( 1995, srallycb, srallyc, srallyc, srallyc, model2_state, srallyc, ROT0, "Sega", "Sega Rally Championship - TWIN (Revision B)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 5998 | GAME( 1995, srallyca, srallyc, srallyc, srallyc, model2_state, srallyc, ROT0, "Sega", "Sega Rally Championship - DX (Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 5999 | GAME( 1995, vf2, 0, model2a, model2, driver_device, 0, ROT0, "Sega", "Virtua Fighter 2 (Version 2.1)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6000 | GAME( 1995, vf2b, vf2, model2a, model2, driver_device, 0, ROT0, "Sega", "Virtua Fighter 2 (Revision B)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6001 | GAME( 1995, vf2a, vf2, model2a, model2, driver_device, 0, ROT0, "Sega", "Virtua Fighter 2 (Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6002 | GAME( 1995, vf2o, vf2, model2a, model2, driver_device, 0, ROT0, "Sega", "Virtua Fighter 2", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6003 | GAME( 1995, vcop2, 0, model2a, vcop2, driver_device, 0, ROT0, "Sega", "Virtua Cop 2", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6004 | GAME( 1995, skytargt, 0, model2a, skytargt,driver_device, 0, ROT0, "Sega", "Sky Target", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6005 | GAME( 1996, doaa, doa, model2a, model2, model2_state, doa, ROT0, "Sega", "Dead or Alive (Model 2A, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6006 | GAME( 1997, zeroguna, zerogun, model2a, model2, model2_state, zerogun, ROT0, "Psikyo", "Zero Gunner (Export, Model 2A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6007 | GAME( 1997, zerogunaj, zerogun, model2a, model2, model2_state, zerogun, ROT0, "Psikyo", "Zero Gunner (Japan, Model 2A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6008 | GAME( 1997, motoraid, 0, model2a, manxtt, driver_device, 0, ROT0, "Sega", "Motor Raid - Twin", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6009 | GAME( 1998, dynamcop, 0, model2a, model2, model2_state, genprot, ROT0, "Sega", "Dynamite Cop (Export, Model 2A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6010 | GAME( 1998, dyndeka2, dynamcop, model2a, model2, model2_state, genprot, ROT0, "Sega", "Dynamite Deka 2 (Japan, Model 2A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6011 | GAME( 1998, pltkidsa, pltkids, model2a, model2, model2_state, pltkids, ROT0, "Psikyo", "Pilot Kids (Model 2A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6016 | 6012 | |
| 6017 | 6013 | // Model 2B-CRX (SHARC, SCSP sound board) |
| 6018 | GAME( 1994, vstriker, 0, model2b, model2, driver_device, 0, ROT0, "Sega", "Virtua Striker (Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6019 | GAME( 1994, vstrikero,vstriker, model2b, model2, driver_device, 0, ROT0, "Sega", "Virtua Striker", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6020 | GAME( 1995, fvipers, 0, model2b, model2, driver_device, 0, ROT0, "Sega", "Fighting Vipers (Revision D)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6021 | GAME( 1995, gunblade, 0, model2b, model2, driver_device, 0, ROT0, "Sega", "Gunblade NY (Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6022 | GAME( 1995, indy500, 0, model2b, srallyc, driver_device, 0, ROT0, "Sega", "INDY 500 Twin (Revision A, Newer)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6023 | GAME( 1995, indy500d, indy500, model2b, srallyc, driver_device, 0, ROT0, "Sega", "INDY 500 Deluxe (Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6024 | GAME( 1995, indy500to, indy500, model2b, srallyc, driver_device, 0, ROT0, "Sega", "INDY 500 Twin (Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6025 | GAME( 1996, schamp, 0, model2b, model2, driver_device, 0, ROT0, "Sega", "Sonic Championship (USA)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6026 | GAME( 1996, sfight, schamp, model2b, model2, driver_device, 0, ROT0, "Sega", "Sonic the Fighters (Japan)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6027 | GAME( 1996, lastbrnx, 0, model2b, model2, driver_device, 0, ROT0, "Sega", "Last Bronx (Export, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6028 | GAME( 1996, lastbrnxu,lastbrnx, model2b, model2, driver_device, 0, ROT0, "Sega", "Last Bronx (USA, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6029 | GAME( 1996, lastbrnxj,lastbrnx, model2b, model2, driver_device, 0, ROT0, "Sega", "Last Bronx (Japan, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6030 | GAME( 1996, doa, 0, model2b_0229, model2, model2_state, doa, ROT0, "Sega", "Dead or Alive (Model 2B, Revision B)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6031 | GAME( 1996, sgt24h, 0, model2b, srallyc, model2_state, sgt24h, ROT0, "Jaleco", "Super GT 24h", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6032 | GAME( 1996, von, 0, model2b, model2, driver_device, 0, ROT0, "Sega", "Cyber Troopers Virtual-On (USA, Revision B)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6033 | GAME( 1996, vonj, von, model2b, model2, driver_device, 0, ROT0, "Sega", "Cyber Troopers Virtual-On (Japan, Revision B)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6034 | GAME( 1996, dynabb, 0, model2b, model2, driver_device, 0, ROT0, "Sega", "Dynamite Baseball", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6035 | GAME( 1997, dynabb97, 0, model2b, model2, driver_device, 0, ROT0, "Sega", "Dynamite Baseball 97 (Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6036 | GAME( 1997, overrevb, overrev, model2b, srallyc, model2_state, overrev, ROT0, "Jaleco", "Over Rev (Model 2B, Revision B)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6037 | GAME( 1997, zerogun, 0, model2b_5881, model2, model2_state, zerogun, ROT0, "Psikyo", "Zero Gunner (Export, Model 2B)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6038 | GAME( 1997, zerogunj, zerogun, model2b_5881, model2, model2_state, zerogun, ROT0, "Psikyo", "Zero Gunner (Japan, Model 2B)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6039 | GAME( 1998, dynamcopb,dynamcop, model2b_5881, model2, model2_state, genprot, ROT0, "Sega", "Dynamite Cop (Export, Model 2B)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6040 | GAME( 1998, dyndeka2b,dynamcop, model2b_5881, model2, model2_state, genprot, ROT0, "Sega", "Dynamite Deka 2 (Japan, Model 2B)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6041 | GAME( 1998, pltkids, 0, model2b_5881, model2, model2_state, pltkids, ROT0, "Psikyo", "Pilot Kids (Model 2B, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6042 | GAME( 1995, rchase2, 0, model2b, rchase2, model2_state, rchase2, ROT0, "Sega", "Rail Chase 2 (Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6014 | GAME( 1994, vstriker, 0, model2b, model2, driver_device, 0, ROT0, "Sega", "Virtua Striker (Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6015 | GAME( 1994, vstrikero,vstriker, model2b, model2, driver_device, 0, ROT0, "Sega", "Virtua Striker", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6016 | GAME( 1995, fvipers, 0, model2b, model2, driver_device, 0, ROT0, "Sega", "Fighting Vipers (Revision D)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6017 | GAME( 1995, gunblade, 0, model2b, model2, driver_device, 0, ROT0, "Sega", "Gunblade NY (Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6018 | GAME( 1995, indy500, 0, model2b, srallyc, driver_device, 0, ROT0, "Sega", "INDY 500 Twin (Revision A, Newer)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6019 | GAME( 1995, indy500d, indy500, model2b, srallyc, driver_device, 0, ROT0, "Sega", "INDY 500 Deluxe (Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6020 | GAME( 1995, indy500to, indy500, model2b, srallyc, driver_device, 0, ROT0, "Sega", "INDY 500 Twin (Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6021 | GAME( 1996, schamp, 0, model2b, model2, driver_device, 0, ROT0, "Sega", "Sonic Championship (USA)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6022 | GAME( 1996, sfight, schamp, model2b, model2, driver_device, 0, ROT0, "Sega", "Sonic the Fighters (Japan)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6023 | GAME( 1996, lastbrnx, 0, model2b, model2, driver_device, 0, ROT0, "Sega", "Last Bronx (Export, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6024 | GAME( 1996, lastbrnxu,lastbrnx, model2b, model2, driver_device, 0, ROT0, "Sega", "Last Bronx (USA, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6025 | GAME( 1996, lastbrnxj,lastbrnx, model2b, model2, driver_device, 0, ROT0, "Sega", "Last Bronx (Japan, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6026 | GAME( 1996, doa, 0, model2b, model2, model2_state, doa, ROT0, "Sega", "Dead or Alive (Model 2B, Revision B)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6027 | GAME( 1996, sgt24h, 0, model2b, srallyc, model2_state, sgt24h, ROT0, "Jaleco", "Super GT 24h", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6028 | GAME( 1996, von, 0, model2b, model2, driver_device, 0, ROT0, "Sega", "Cyber Troopers Virtual-On (USA, Revision B)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6029 | GAME( 1996, vonj, von, model2b, model2, driver_device, 0, ROT0, "Sega", "Cyber Troopers Virtual-On (Japan, Revision B)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6030 | GAME( 1996, dynabb, 0, model2b, model2, driver_device, 0, ROT0, "Sega", "Dynamite Baseball", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6031 | GAME( 1997, dynabb97, 0, model2b, model2, driver_device, 0, ROT0, "Sega", "Dynamite Baseball 97 (Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6032 | GAME( 1997, overrevb, overrev, model2b, srallyc, model2_state, overrev, ROT0, "Jaleco", "Over Rev (Model 2B, Revision B)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6033 | GAME( 1997, zerogun, 0, model2b, model2, model2_state, zerogun, ROT0, "Psikyo", "Zero Gunner (Export, Model 2B)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6034 | GAME( 1997, zerogunj, zerogun, model2b, model2, model2_state, zerogun, ROT0, "Psikyo", "Zero Gunner (Japan, Model 2B)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6035 | GAME( 1998, dynamcopb,dynamcop, model2b, model2, model2_state, genprot, ROT0, "Sega", "Dynamite Cop (Export, Model 2B)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6036 | GAME( 1998, dyndeka2b,dynamcop, model2b, model2, model2_state, genprot, ROT0, "Sega", "Dynamite Deka 2 (Japan, Model 2B)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6037 | GAME( 1998, pltkids, 0, model2b, model2, model2_state, pltkids, ROT0, "Psikyo", "Pilot Kids (Model 2B, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6038 | GAME( 1995, rchase2, 0, model2b, rchase2, model2_state, rchase2, ROT0, "Sega", "Rail Chase 2 (Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6043 | 6039 | |
| 6044 | 6040 | // Model 2C-CRX (TGPx4, SCSP sound board) |
| 6045 | GAME( 1996, skisuprg, 0, model2c, model2, driver_device, 0, ROT0, "Sega", "Sega Ski Super G", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS|GAME_UNEMULATED_PROTECTION ) | |
| 6046 | GAME( 1996, stcc, 0, stcc, model2, driver_device, 0, ROT0, "Sega", "Sega Touring Car Championship", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6047 | GAME( 1996, stccb, stcc, stcc, model2, driver_device, 0, ROT0, "Sega", "Sega Touring Car Championship (Revision B)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6048 | GAME( 1996, stcca, stcc, stcc, model2, driver_device, 0, ROT0, "Sega", "Sega Touring Car Championship (Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6049 | GAME( 1996, waverunr, 0, model2c, model2, driver_device, 0, ROT0, "Sega", "Wave Runner (Japan, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6050 | GAME( 1997, hotd, 0, model2c, model2, driver_device, 0, ROT0, "Sega", "House of the Dead", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6051 | GAME( 1997, overrev, 0, model2c, srallyc, model2_state, overrev, ROT0, "Jaleco", "Over Rev (Model 2C, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6052 | GAME( 1997, segawski, 0, model2c, model2, driver_device, 0, ROT0, "Sega", "Sega Water Ski (Japan, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6053 | GAME( 1997, topskatr, 0, model2c, model2, driver_device, 0, ROT0, "Sega", "Top Skater (Export, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6054 | GAME( 1997, topskatru,topskatr, model2c, model2, driver_device, 0, ROT0, "Sega", "Top Skater (USA, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6055 | GAME( 1997, topskatrj,topskatr, model2c, model2, driver_device, 0, ROT0, "Sega", "Top Skater (Japan)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6056 | GAME( 1998, bel, 0, model2c, bel, driver_device, 0, ROT0, "Sega / EPL Productions", "Behind Enemy Lines", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6057 | GAME( 1998, dynamcopc,dynamcop, model2c_5881, model2, model2_state, genprot, ROT0, "Sega", "Dynamite Cop (USA, Model 2C)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6041 | GAME( 1996, skisuprg, 0, model2c, model2, driver_device, 0, ROT0, "Sega", "Sega Ski Super G", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS|GAME_UNEMULATED_PROTECTION ) | |
| 6042 | GAME( 1996, stcc, 0, stcc, model2, driver_device, 0, ROT0, "Sega", "Sega Touring Car Championship", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6043 | GAME( 1996, stccb, stcc, stcc, model2, driver_device, 0, ROT0, "Sega", "Sega Touring Car Championship (Revision B)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6044 | GAME( 1996, stcca, stcc, stcc, model2, driver_device, 0, ROT0, "Sega", "Sega Touring Car Championship (Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6045 | GAME( 1996, waverunr, 0, model2c, model2, driver_device, 0, ROT0, "Sega", "Wave Runner (Japan, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6046 | GAME( 1997, hotd, 0, model2c, model2, driver_device, 0, ROT0, "Sega", "House of the Dead", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6047 | GAME( 1997, overrev, 0, model2c, srallyc, model2_state, overrev, ROT0, "Jaleco", "Over Rev (Model 2C, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6048 | GAME( 1997, segawski, 0, model2c, model2, driver_device, 0, ROT0, "Sega", "Sega Water Ski (Japan, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6049 | GAME( 1997, topskatr, 0, model2c, model2, driver_device, 0, ROT0, "Sega", "Top Skater (Export, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6050 | GAME( 1997, topskatru,topskatr, model2c, model2, driver_device, 0, ROT0, "Sega", "Top Skater (USA, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6051 | GAME( 1997, topskatrj,topskatr, model2c, model2, driver_device, 0, ROT0, "Sega", "Top Skater (Japan)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6052 | GAME( 1998, bel, 0, model2c, bel, driver_device, 0, ROT0, "Sega / EPL Productions", "Behind Enemy Lines", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) | |
| 6053 | GAME( 1998, dynamcopc,dynamcop, model2c, model2, driver_device, 0, ROT0, "Sega", "Dynamite Cop (USA, Model 2C)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS ) |
| r243192 | r243193 | |
|---|---|---|
| 665 | 665 | #include "includes/model3.h" |
| 666 | 666 | |
| 667 | 667 | |
| 668 | ||
| 669 | 668 | void model3_state::update_irq_state() |
| 670 | 669 | { |
| 671 | 670 | if ((m_irq_enable & m_irq_state) || m_scsi_irq_state) |
| r243192 | r243193 | |
| 1674 | 1673 | } |
| 1675 | 1674 | |
| 1676 | 1675 | |
| 1676 | static const UINT16 vs299_prot_data[] = | |
| 1677 | { | |
| 1678 | 0xc800, 0x4a20, 0x5041, 0x4e41, 0x4920, 0x4154, 0x594c, 0x4220, | |
| 1679 | 0x4152, 0x4953, 0x204c, 0x5241, 0x4547, 0x544e, 0x4e49, 0x2041, | |
| 1680 | 0x4547, 0x4d52, 0x4e41, 0x2059, 0x4e45, 0x4c47, 0x4e41, 0x2044, | |
| 1681 | 0x454e, 0x4854, 0x5245, 0x414c, 0x444e, 0x2053, 0x5246, 0x4e41, | |
| 1682 | 0x4543, 0x4320, 0x4c4f, 0x4d4f, 0x4942, 0x2041, 0x4150, 0x4152, | |
| 1683 | 0x5547, 0x5941, 0x4220, 0x4c55, 0x4147, 0x4952, 0x2041, 0x5053, | |
| 1684 | 0x4941, 0x204e, 0x5243, 0x414f, 0x4954, 0x2041, 0x4542, 0x474c, | |
| 1685 | 0x5549, 0x204d, 0x494e, 0x4547, 0x4952, 0x2041, 0x4153, 0x4455, | |
| 1686 | 0x2049, 0x4f4b, 0x4552, 0x2041, 0x4544, 0x4d4e, 0x5241, 0x204b, | |
| 1687 | 0x4f52, 0x414d, 0x494e, 0x2041, 0x4353, 0x544f, 0x414c, 0x444e, | |
| 1688 | 0x5520, 0x4153, 0x5320, 0x554f, 0x4854, 0x4641, 0x4952, 0x4143, | |
| 1689 | 0x4d20, 0x5845, 0x4349, 0x204f, 0x5559, 0x4f47, 0x4c53, 0x5641, | |
| 1690 | 0x4149, 0x4620, 0x5f43, 0x4553, 0x4147 | |
| 1691 | }; | |
| 1677 | 1692 | |
| 1678 | ||
| 1693 | static const UINT16 swt_prot_data[] = | |
| 1679 | 1694 | { |
| 1680 | UINT64 retvalue = U64(0xffffffffffffffff); | |
| 1695 | 0xffff, | |
| 1696 | 0x3d3d, 0x3d3d, 0x203d, 0x5453, 0x5241, 0x5720, 0x5241, 0x2053, | |
| 1697 | 0x3d3d, 0x3d3d, 0x0a3d, 0x6f43, 0x7970, 0x6952, 0x6867, 0x2074, | |
| 1698 | 0x4553, 0x4147, 0x4520, 0x746e, 0x7265, 0x7270, 0x7369, 0x7365, | |
| 1699 | 0x202c, 0x744c, 0x2e64, 0x410a, 0x756d, 0x6573, 0x656d, 0x746e, | |
| 1700 | 0x5220, 0x4426, 0x4420, 0x7065, 0x2e74, 0x2320, 0x3231, 0x4b0a, | |
| 1701 | 0x7461, 0x7573, 0x6179, 0x7573, 0x4120, 0x646e, 0x206f, 0x2026, | |
| 1702 | 0x614b, 0x6f79, 0x6f6b, 0x5920, 0x6d61, 0x6d61, 0x746f, 0x0a6f, | |
| 1703 | }; | |
| 1681 | 1704 | |
| 1682 | if (offset == 0x00 / 8) | |
| 1683 | { | |
| 1684 | retvalue = 0; | |
| 1685 | } | |
| 1686 | else if (offset == 0x18 / 8) | |
| 1687 | { | |
| 1688 | if (first_read == 1) | |
| 1689 | { | |
| 1690 | // the RAM based schemes expect a dummy value before the start of the stream | |
| 1691 | // to match the previous simulation I use 0xffff here | |
| 1692 | first_read = 0; | |
| 1693 | retvalue = 0xffff << 16; | |
| 1694 | } | |
| 1695 | else | |
| 1696 | { | |
| 1697 | UINT8* base; | |
| 1698 | retvalue = m_cryptdevice->do_decrypt(base); | |
| 1699 | // retvalue = ((retvalue & 0xff00) >> 8) | ((retvalue & 0x00ff) << 8); // don't endian swap the return value on this hardware | |
| 1700 | retvalue <<= 16; | |
| 1701 | } | |
| 1705 | static const UINT16 fvipers2_prot_data[] = | |
| 1706 | { | |
| 1707 | 0x2a2a, | |
| 1708 | 0x2a2a, 0x2a2a, 0x2a2a, 0x2a2a, 0x2a2a, 0x2a2a, 0x202a, 0x5b5b, | |
| 1709 | 0x4620, 0x6769, 0x7468, 0x6e69, 0x2067, 0x6956, 0x6570, 0x7372, | |
| 1710 | 0x3220, 0x5d20, 0x205d, 0x6e69, 0x3c20, 0x4d3c, 0x444f, 0x4c45, | |
| 1711 | 0x332d, 0x3e3e, 0x4320, 0x706f, 0x7279, 0x6769, 0x7468, 0x2820, | |
| 1712 | 0x2943, 0x3931, 0x3839, 0x5320, 0x4745, 0x2041, 0x6e45, 0x6574, | |
| 1713 | 0x7072, 0x6972, 0x6573, 0x2c73, 0x544c, 0x2e44, 0x2020, 0x4120, | |
| 1714 | 0x6c6c, 0x7220, 0x6769, 0x7468, 0x7220, 0x7365, 0x7265, 0x6576, | |
| 1715 | 0x2e64, 0x2a20, 0x2a2a, 0x2a2a, 0x2a2a, 0x2a2a, 0x2a2a, 0x2a2a, | |
| 1716 | }; | |
| 1702 | 1717 | |
| 1703 | // printf("model3_5881prot_r offset %08x : %08x%08x (%08x%08x)\n", offset * 8, (UINT32)(retvalue >> 32), (UINT32)(retvalue & 0xffffffff), (UINT32)(mem_mask >> 32), (UINT32)(mem_mask & 0xffffffff)); | |
| 1704 | } | |
| 1705 | else | |
| 1706 | { | |
| 1707 | printf("model3_5881prot_r offset %08x : %08x%08x (%08x%08x)\n", offset * 8, (UINT32)(retvalue >> 32), (UINT32)(retvalue & 0xffffffff), (UINT32)(mem_mask >> 32), (UINT32)(mem_mask & 0xffffffff)); | |
| 1708 | } | |
| 1718 | static const UINT16 spikeout_prot_data[] = | |
| 1719 | { | |
| 1720 | 0x0000, | |
| 1721 | 0x4f4d, 0x4544, 0x2d4c, 0x2033, 0x7953, 0x7473, 0x6d65, 0x5020, | |
| 1722 | 0x6f72, 0x7267, 0x6d61, 0x4320, 0x706f, 0x7279, 0x6769, 0x7468, | |
| 1723 | 0x2820, 0x2943, 0x3120, 0x3939, 0x2035, 0x4553, 0x4147, 0x4520, | |
| 1724 | 0x746e, 0x7265, 0x7270, 0x7369, 0x7365, 0x4c2c, 0x4454, 0x202e, | |
| 1725 | 0x6c41, 0x206c, 0x6972, 0x6867, 0x2074, 0x6572, 0x6573, 0x7672, | |
| 1726 | 0x6465, 0x202e, 0x2020, 0x0020 | |
| 1727 | }; | |
| 1709 | 1728 | |
| 1710 | return retvalue; | |
| 1729 | static const UINT16 eca_prot_data[] = | |
| 1730 | { | |
| 1731 | 0x0000, | |
| 1732 | 0x2d2f, 0x202d, 0x4d45, 0x5245, 0x4547, 0x434e, 0x2059, 0x4143, | |
| 1733 | 0x4c4c, 0x4120, 0x424d, 0x4c55, 0x4e41, 0x4543, 0x2d20, 0x0a2d, | |
| 1734 | 0x6f43, 0x7970, 0x6952, 0x6867, 0x2074, 0x4553, 0x4147, 0x4520, | |
| 1735 | 0x746e, 0x7265, 0x7270, 0x7369, 0x7365, 0x202c, 0x744c, 0x2e64, | |
| 1736 | 0x530a, 0x666f, 0x7774, 0x7261, 0x2065, 0x2652, 0x2044, 0x6544, | |
| 1737 | 0x7470, 0x202e, 0x3123, 0x660a, 0x726f, 0x7420, 0x7365, 0x0a74, | |
| 1738 | }; | |
| 1711 | 1739 | |
| 1740 | static const UINT16 oceanhun_prot_data[] = | |
| 1741 | { | |
| 1742 | 0x0000, // dummy read | |
| 1743 | 0x3d3d, 0x203d, 0x434f, 0x4145, 0x204e, 0x5548, 0x544e, 0x5245, | |
| 1744 | 0x3d20, 0x3d3d, 0x430a, 0x706f, 0x5279, 0x6769, 0x7468, 0x5320, | |
| 1745 | 0x4745, 0x2041, 0x6e45, 0x6574, 0x7072, 0x6972, 0x6573, 0x2c73, | |
| 1746 | 0x4c20, 0x6474, 0x0a2e, 0x6d41, 0x7375, 0x6d65, 0x6e65, 0x2074, | |
| 1747 | 0x2652, 0x2044, 0x6544, 0x7470, 0x202e, 0x3123, 0x4b0a, 0x7a61, | |
| 1748 | 0x6e75, 0x7261, 0x2069, 0x7354, 0x6b75, 0x6d61, 0x746f, 0x206f, | |
| 1749 | 0x6553, 0x7463, 0x6f69, 0x206e, 0x614d, 0x616e, 0x6567, 0x0a72 | |
| 1750 | }; | |
| 1751 | /* | |
| 1752 | dirtdvls: first 2 words read are discarded, then every other word | |
| 1753 | is written to char RAM starting at f1013400 (in between words are | |
| 1754 | discarded). | |
| 1755 | */ | |
| 1712 | 1756 | |
| 1713 | } | |
| 1714 | ||
| 1715 | WRITE64_MEMBER(model3_state::model3_5881prot_w) | |
| 1757 | READ64_MEMBER(model3_state::model3_security_r) | |
| 1716 | 1758 | { |
| 1717 | i | |
| 1759 | switch(offset) | |
| 1718 | 1760 | { |
| 1719 | // code is copied to RAM first, so base address is always 0 | |
| 1720 | m_cryptdevice->set_addr_low(0); | |
| 1721 | m_cryptdevice->set_addr_high(0); | |
| 1722 | ||
| 1723 | if (data != 0) | |
| 1724 | printf("model3_5881prot_w address isn't 0?\n"); | |
| 1725 | ||
| 1726 | first_read = 1; | |
| 1761 | case 0x00/8: return 0; /* status */ | |
| 1762 | case 0x1c/8: /* security board data read */ | |
| 1763 | { | |
| 1764 | if (core_stricmp(machine().system().name, "vs299") == 0 || | |
| 1765 | core_stricmp(machine().system().name, "vs2v991") == 0) | |
| 1766 | { | |
| 1767 | return (UINT64)vs299_prot_data[m_prot_data_ptr++] << 48; | |
| 1768 | } | |
| 1769 | else if (core_stricmp(machine().system().name, "swtrilgy") == 0 || | |
| 1770 | core_stricmp(machine().system().name, "swtrilgya") == 0) | |
| 1771 | { | |
| 1772 | UINT64 data = (UINT64)swt_prot_data[m_prot_data_ptr++] << 16; | |
| 1773 | if (m_prot_data_ptr > 0x38) | |
| 1774 | { | |
| 1775 | m_prot_data_ptr = 0; | |
| 1776 | } | |
| 1777 | return data; | |
| 1778 | } | |
| 1779 | else if (core_stricmp(machine().system().name, "fvipers2") == 0) | |
| 1780 | { | |
| 1781 | UINT64 data = (UINT64)fvipers2_prot_data[m_prot_data_ptr++] << 16; | |
| 1782 | if (m_prot_data_ptr >= 0x41) | |
| 1783 | { | |
| 1784 | m_prot_data_ptr = 0; | |
| 1785 | } | |
| 1786 | return data; | |
| 1787 | } | |
| 1788 | else if (core_stricmp(machine().system().name, "spikeout") == 0 || | |
| 1789 | core_stricmp(machine().system().name, "spikeofe") == 0) | |
| 1790 | { | |
| 1791 | UINT64 data = (UINT64)spikeout_prot_data[m_prot_data_ptr++] << 16; | |
| 1792 | if (m_prot_data_ptr >= 0x55) | |
| 1793 | { | |
| 1794 | m_prot_data_ptr = 0; | |
| 1795 | } | |
| 1796 | return data; | |
| 1797 | } | |
| 1798 | else if (core_stricmp(machine().system().name, "eca") == 0 || | |
| 1799 | core_stricmp(machine().system().name, "ecax") == 0) | |
| 1800 | { | |
| 1801 | UINT64 data = (UINT64)eca_prot_data[m_prot_data_ptr++] << 16; | |
| 1802 | if (m_prot_data_ptr >= 0x31) | |
| 1803 | { | |
| 1804 | m_prot_data_ptr = 0; | |
| 1805 | } | |
| 1806 | return data; | |
| 1807 | } | |
| 1808 | else if (core_stricmp(machine().system().name, "oceanhun") == 0) | |
| 1809 | { | |
| 1810 | UINT64 data = (UINT64)oceanhun_prot_data[m_prot_data_ptr++] << 16; | |
| 1811 | if (m_prot_data_ptr >= 58) | |
| 1812 | { | |
| 1813 | m_prot_data_ptr = 0; | |
| 1814 | } | |
| 1815 | return data; | |
| 1816 | } | |
| 1817 | else | |
| 1818 | { | |
| 1819 | return 0; | |
| 1820 | } | |
| 1821 | } | |
| 1727 | 1822 | } |
| 1728 | else if (offset == 0x18 / 8) | |
| 1729 | { | |
| 1730 | UINT16 subkey = data >> (32 + 16); | |
| 1731 | subkey = ((subkey & 0xff00) >> 8) | ((subkey & 0x00ff) << 8); // endian swap the sub-key for this hardware | |
| 1732 | printf("model3_5881prot_w setting subkey %04x\n", subkey); | |
| 1733 | m_cryptdevice->set_subkey(subkey); | |
| 1734 | } | |
| 1735 | else | |
| 1736 | { | |
| 1737 | printf("model3_5881prot_w offset %08x : %08x%08x (%08x%08x)\n", offset * 8, (UINT32)(data >> 32), (UINT32)(data & 0xffffffff), (UINT32)(mem_mask >> 32), (UINT32)(mem_mask & 0xffffffff)); | |
| 1738 | } | |
| 1823 | return U64(0xffffffffffffffff); | |
| 1739 | 1824 | } |
| 1740 | 1825 | |
| 1741 | 1826 | WRITE64_MEMBER(model3_state::daytona2_rombank_w) |
| r243192 | r243193 | |
| 1762 | 1847 | AM_RANGE(0xf00c0000, 0xf00dffff) AM_MIRROR(0x0e000000) AM_RAM AM_SHARE("backup") /* backup SRAM */ |
| 1763 | 1848 | AM_RANGE(0xf0100000, 0xf010003f) AM_MIRROR(0x0e000000) AM_READWRITE(model3_sys_r, model3_sys_w ) |
| 1764 | 1849 | AM_RANGE(0xf0140000, 0xf014003f) AM_MIRROR(0x0e000000) AM_READWRITE(model3_rtc_r, model3_rtc_w ) |
| 1850 | AM_RANGE(0xf0180000, 0xf019ffff) AM_MIRROR(0x0e000000) AM_RAM /* Security Board RAM */ | |
| 1851 | AM_RANGE(0xf01a0000, 0xf01a003f) AM_MIRROR(0x0e000000) AM_READ(model3_security_r ) /* Security board */ | |
| 1765 | 1852 | |
| 1766 | 1853 | AM_RANGE(0xf1000000, 0xf10f7fff) AM_READWRITE(model3_char_r, model3_char_w ) /* character RAM */ |
| 1767 | 1854 | AM_RANGE(0xf10f8000, 0xf10fffff) AM_READWRITE(model3_tile_r, model3_tile_w ) /* tilemaps */ |
| r243192 | r243193 | |
| 3334 | 3421 | |
| 3335 | 3422 | ROM_REGION( 0x80000, "scsp2", 0 ) /* second SCSP's RAM */ |
| 3336 | 3423 | ROM_FILL( 0x000000, 0x80000, 0 ) |
| 3337 | ||
| 3338 | // ???? 317-0237-COM Model 3 | |
| 3339 | ROM_PARAMETER( ":315_5881:key", "09234e96" ) | |
| 3340 | 3424 | ROM_END |
| 3341 | 3425 | |
| 3342 | 3426 | ROM_START( vs29815 ) /* Step 1.5, ROM board ID# 834-13495 VS2 VER98 STEP 1.5 */ |
| r243192 | r243193 | |
| 3487 | 3571 | |
| 3488 | 3572 | ROM_REGION( 0x80000, "scsp2", 0 ) /* second SCSP's RAM */ |
| 3489 | 3573 | ROM_FILL( 0x000000, 0x80000, 0 ) |
| 3490 | ||
| 3491 | // ???? 317-0245-COM Model 3 | |
| 3492 | ROM_PARAMETER( ":315_5881:key", "09222ac8" ) | |
| 3493 | 3574 | ROM_END |
| 3494 | 3575 | |
| 3495 | 3576 | ROM_START( vs299b ) /* Step 2.0 */ |
| r243192 | r243193 | |
| 3565 | 3646 | |
| 3566 | 3647 | ROM_REGION( 0x80000, "scsp2", 0 ) /* second SCSP's RAM */ |
| 3567 | 3648 | ROM_FILL( 0x000000, 0x80000, 0 ) |
| 3568 | ||
| 3569 | // ???? 317-0245-COM Model 3 | |
| 3570 | ROM_PARAMETER( ":315_5881:key", "09222ac8" ) | |
| 3571 | 3649 | ROM_END |
| 3572 | 3650 | |
| 3573 | 3651 | ROM_START( vs299a ) /* Step 2.0 */ |
| r243192 | r243193 | |
| 3643 | 3721 | |
| 3644 | 3722 | ROM_REGION( 0x80000, "scsp2", 0 ) /* second SCSP's RAM */ |
| 3645 | 3723 | ROM_FILL( 0x000000, 0x80000, 0 ) |
| 3646 | ||
| 3647 | // ???? 317-0245-COM Model 3 | |
| 3648 | ROM_PARAMETER( ":315_5881:key", "09222ac8" ) | |
| 3649 | 3724 | ROM_END |
| 3650 | 3725 | |
| 3651 | 3726 | ROM_START( vs299 ) /* Step 2.0 */ |
| r243192 | r243193 | |
| 3721 | 3796 | |
| 3722 | 3797 | ROM_REGION( 0x80000, "scsp2", 0 ) /* second SCSP's RAM */ |
| 3723 | 3798 | ROM_FILL( 0x000000, 0x80000, 0 ) |
| 3724 | ||
| 3725 | // ???? 317-0245-COM Model 3 | |
| 3726 | ROM_PARAMETER( ":315_5881:key", "09222ac8" ) | |
| 3727 | 3799 | ROM_END |
| 3728 | 3800 | |
| 3729 | 3801 | ROM_START( von2 ) /* Step 2.0 */ |
| r243192 | r243193 | |
| 3800 | 3872 | |
| 3801 | 3873 | ROM_REGION( 0x80000, "scsp2", 0 ) /* second SCSP's RAM */ |
| 3802 | 3874 | ROM_FILL( 0x000000, 0x80000, 0 ) |
| 3803 | ||
| 3804 | // ???? 317-0234-COM Model 3 | |
| 3805 | ROM_PARAMETER( ":315_5881:key", "092a0e97" ) | |
| 3806 | 3875 | ROM_END |
| 3807 | 3876 | |
| 3808 | 3877 | ROM_START( von254g ) /* Step 2.0, Sega game ID# is 833-13789 */ |
| r243192 | r243193 | |
| 3879 | 3948 | |
| 3880 | 3949 | ROM_REGION( 0x80000, "scsp2", 0 ) /* second SCSP's RAM */ |
| 3881 | 3950 | ROM_FILL( 0x000000, 0x80000, 0 ) |
| 3882 | ||
| 3883 | // ???? 317-0234-COM Model 3 | |
| 3884 | ROM_PARAMETER( ":315_5881:key", "092a0e97" ) | |
| 3885 | 3951 | ROM_END |
| 3886 | 3952 | |
| 3887 | 3953 | ROM_START( skichamp ) /* Step 2.0 */ |
| r243192 | r243193 | |
| 4026 | 4092 | |
| 4027 | 4093 | ROM_REGION( 0x10000, "ffcpu", 0 ) /* force feedback controller prg */ |
| 4028 | 4094 | ROM_LOAD( "epr21119.ic8", 0x00000, 0x10000, CRC(65082b14) SHA1(6c3c192dd6ef3780c6202dd63fc6086328928818) ) |
| 4029 | ||
| 4030 | // ???? 317-0241-COM Model 3 | |
| 4031 | ROM_PARAMETER( ":315_5881:key", "11272a01" ) | |
| 4032 | 4095 | ROM_END |
| 4033 | 4096 | |
| 4034 | 4097 | 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 */ |
| r243192 | r243193 | |
| 4098 | 4161 | |
| 4099 | 4162 | ROM_REGION( 0x80000, "scsp2", 0 ) /* second SCSP's RAM */ |
| 4100 | 4163 | ROM_FILL( 0x000000, 0x80000, 0 ) |
| 4101 | ||
| 4102 | // ???? 317-0241-COM Model 3 | |
| 4103 | ROM_PARAMETER( ":315_5881:key", "11272a01" ) | |
| 4104 | 4164 | ROM_END |
| 4105 | 4165 | |
| 4106 | 4166 | ROM_START( dirtdvls ) /* Step 2.1, Sega game ID# is 833-13427, ROM board ID# 834-13528 DRT */ |
| r243192 | r243193 | |
| 4162 | 4222 | |
| 4163 | 4223 | ROM_REGION( 0x80000, "scsp2", 0 ) /* second SCSP's RAM */ |
| 4164 | 4224 | ROM_FILL( 0x000000, 0x80000, 0 ) |
| 4165 | ||
| 4166 | // ???? 317-0238-COM Model 3 | |
| 4167 | ROM_PARAMETER( ":315_5881:key", "09290f17" ) | |
| 4168 | 4225 | ROM_END |
| 4169 | 4226 | |
| 4170 | 4227 | ROM_START( dirtdvlsa ) /* Step 2.1 */ |
| r243192 | r243193 | |
| 4226 | 4283 | |
| 4227 | 4284 | ROM_REGION( 0x80000, "scsp2", 0 ) /* second SCSP's RAM */ |
| 4228 | 4285 | ROM_FILL( 0x000000, 0x80000, 0 ) |
| 4229 | ||
| 4230 | // ???? 317-0238-COM Model 3 | |
| 4231 | ROM_PARAMETER( ":315_5881:key", "09290f17" ) | |
| 4232 | 4286 | ROM_END |
| 4233 | 4287 | |
| 4234 | 4288 | ROM_START( daytona2 ) /* Step 2.1, ROM board ID# 834-13428 DAYTONA USA2, Security board ID# 837-13507-COM */ |
| r243192 | r243193 | |
| 4309 | 4363 | |
| 4310 | 4364 | ROM_REGION( 0x10000, "drivebd", 0 ) /* drive board ROM */ |
| 4311 | 4365 | ROM_LOAD( "epr-20985.bin", 0x000000, 0x010000, CRC(b139481d) SHA1(05fca7db7c8b084c53bd157ba3e8296f1a961a99) ) |
| 4312 | ||
| 4313 | // ???? 317-0239-COM Model 3 | |
| 4314 | ROM_PARAMETER( ":315_5881:key", "09250e16" ) | |
| 4315 | 4366 | ROM_END |
| 4316 | 4367 | |
| 4317 | 4368 | ROM_START( dayto2pe ) /* Step 2.1, Sega game ID# is 833-13610 DAYTONA USA2 SP, ROM board ID# 834-13609 DAYTONA USA2 SP, Security board ID# 837-13645-COM */ |
| r243192 | r243193 | |
| 4392 | 4443 | |
| 4393 | 4444 | ROM_REGION( 0x10000, "drivebd", 0 ) /* drive board ROM */ |
| 4394 | 4445 | ROM_LOAD( "epr-20985.bin", 0x000000, 0x010000, CRC(b139481d) SHA1(05fca7db7c8b084c53bd157ba3e8296f1a961a99) ) |
| 4395 | ||
| 4396 | // ???? 317-5045-COM Model 3 | |
| 4397 | ROM_PARAMETER( ":315_5881:key", "0" ) // unknown | |
| 4398 | 4446 | ROM_END |
| 4399 | 4447 | |
| 4400 | 4448 | ROM_START( srally2 ) /* Step 2.0, Sega game ID# is 833-13373, ROM board ID# 834-13374 SRT TWIN */ |
| r243192 | r243193 | |
| 4747 | 4795 | |
| 4748 | 4796 | ROM_REGION( 0x80000, "scsp2", 0 ) /* second SCSP's RAM */ |
| 4749 | 4797 | ROM_FILL( 0x000000, 0x80000, 0 ) |
| 4750 | ||
| 4751 | // ???? 317-0235-COM Model 3 | |
| 4752 | ROM_PARAMETER( ":315_5881:key", "09260e96" ) | |
| 4753 | 4798 | ROM_END |
| 4754 | 4799 | |
| 4755 | 4800 | ROM_START( spikeout ) /* Step 2.1 */ |
| r243192 | r243193 | |
| 4827 | 4872 | |
| 4828 | 4873 | ROM_REGION( 0x80000, "scsp2", 0 ) /* second SCSP's RAM */ |
| 4829 | 4874 | ROM_FILL( 0x000000, 0x80000, 0 ) |
| 4830 | ||
| 4831 | // ???? 317-0240-COM Model 3 | |
| 4832 | ROM_PARAMETER( ":315_5881:key", "092f2b04" ) | |
| 4833 | 4875 | ROM_END |
| 4834 | 4876 | |
| 4835 | 4877 | ROM_START( spikeofe ) /* Step 2.1, Sega game ID# is 833-13746, ROM board ID# 834-13747 SPK F/E, Security board ID# 837-13726-COM */ |
| r243192 | r243193 | |
| 4907 | 4949 | |
| 4908 | 4950 | ROM_REGION( 0x80000, "scsp2", 0 ) /* second SCSP's RAM */ |
| 4909 | 4951 | ROM_FILL( 0x000000, 0x80000, 0 ) |
| 4910 | ||
| 4911 | // ???? 317-0247-COM Model 3 | |
| 4912 | ROM_PARAMETER( ":315_5881:key", "09236fc8" ) | |
| 4913 | 4952 | ROM_END |
| 4914 | 4953 | |
| 4915 | 4954 | ROM_START( eca ) /* Step 2.1, ROM board ID# 834-13946-01 ECA */ |
| r243192 | r243193 | |
| 4978 | 5017 | |
| 4979 | 5018 | ROM_REGION( 0x80000, "scsp2", 0 ) /* second SCSP's RAM */ |
| 4980 | 5019 | ROM_FILL( 0x000000, 0x80000, 0 ) |
| 4981 | ||
| 4982 | // ???? 317-0265-COM Model 3 | |
| 4983 | ROM_PARAMETER( ":315_5881:key", "0923aa91" ) | |
| 4984 | 5020 | ROM_END |
| 4985 | 5021 | |
| 4986 | 5022 | ROM_START( ecax ) /* Step 2.1 */ |
| r243192 | r243193 | |
| 5049 | 5085 | |
| 5050 | 5086 | ROM_REGION( 0x80000, "scsp2", 0 ) /* second SCSP's RAM */ |
| 5051 | 5087 | ROM_FILL( 0x000000, 0x80000, 0 ) |
| 5052 | ||
| 5053 | // ???? 317-0265-COM Model 3 | |
| 5054 | ROM_PARAMETER( ":315_5881:key", "0923aa91" ) | |
| 5055 | 5088 | ROM_END |
| 5056 | 5089 | |
| 5057 | 5090 | ROM_START( ecap ) /* Step 2.1 - Proto or Location test - No security dongle */ |
| r243192 | r243193 | |
| 5123 | 5156 | |
| 5124 | 5157 | ROM_REGION( 0x80000, "scsp2", 0 ) /* second SCSP's RAM */ |
| 5125 | 5158 | ROM_FILL( 0x000000, 0x80000, 0 ) |
| 5126 | ||
| 5127 | // ???? 317-0265-COM Model 3 | |
| 5128 | ROM_PARAMETER( ":315_5881:key", "0923aa91" ) | |
| 5129 | 5159 | ROM_END |
| 5130 | 5160 | |
| 5131 | 5161 | 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 */ |
| r243192 | r243193 | |
| 5182 | 5212 | |
| 5183 | 5213 | ROM_REGION( 0x80000, "scsp2", 0 ) /* second SCSP's RAM */ |
| 5184 | 5214 | ROM_FILL( 0x000000, 0x80000, 0 ) |
| 5185 | ||
| 5186 | // ???? 317-0243-COM Model 3 | |
| 5187 | ROM_PARAMETER( ":315_5881:key", "09266e45" ) | |
| 5188 | 5215 | ROM_END |
| 5189 | 5216 | |
| 5190 | 5217 | ROM_START( oceanhun ) /* Step 2.0, Sega game ID# is 833-13571, ROM board ID# 834-13572 THE OCEAN HUNTER, 317-0242-COM security chip (837-13576-COM security board) */ |
| r243192 | r243193 | |
| 5253 | 5280 | |
| 5254 | 5281 | ROM_REGION( 0x80000, "scsp2", 0 ) /* second SCSP's RAM */ |
| 5255 | 5282 | ROM_FILL( 0x000000, 0x80000, 0 ) |
| 5256 | ||
| 5257 | // ???? 317-0242-COM Model 3 | |
| 5258 | ROM_PARAMETER( ":315_5881:key", "092b6a01" ) | |
| 5259 | 5283 | ROM_END |
| 5260 | 5284 | |
| 5261 | 5285 | 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) */ |
| r243192 | r243193 | |
| 5325 | 5349 | |
| 5326 | 5350 | ROM_REGION( 0x80000, "scsp2", 0 ) /* second SCSP's RAM */ |
| 5327 | 5351 | ROM_FILL( 0x000000, 0x80000, 0 ) |
| 5328 | ||
| 5329 | // ???? 317-0244-COM Model 3 | |
| 5330 | ROM_PARAMETER( ":315_5881:key", "092a2bc5" ) | |
| 5331 | 5352 | ROM_END |
| 5332 | 5353 | |
| 5333 | 5354 | /* Model 3 sound board emulation */ |
| r243192 | r243193 | |
| 5496 | 5517 | MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) |
| 5497 | 5518 | MACHINE_CONFIG_END |
| 5498 | 5519 | |
| 5499 | static MACHINE_CONFIG_START(model3_20, model3_state) | |
| 5520 | static MACHINE_CONFIG_START( model3_20, model3_state ) | |
| 5500 | 5521 | MCFG_CPU_ADD("maincpu", PPC603R, 166000000) |
| 5501 | 5522 | MCFG_PPC_BUS_FREQUENCY(66000000) /* Multiplier 2.5, Bus = 66MHz, Core = 166MHz */ |
| 5502 | 5523 | MCFG_CPU_PROGRAM_MAP(model3_mem) |
| r243192 | r243193 | |
| 5505 | 5526 | MCFG_CPU_ADD("audiocpu", M68000, 12000000) |
| 5506 | 5527 | MCFG_CPU_PROGRAM_MAP(model3_snd) |
| 5507 | 5528 | |
| 5508 | MCFG_MACHINE_START_OVERRIDE(model3_state, model3_20) | |
| 5509 | MCFG_MACHINE_RESET_OVERRIDE(model3_state, model3_20) | |
| 5529 | MCFG_MACHINE_START_OVERRIDE(model3_state,model3_20) | |
| 5530 | MCFG_MACHINE_RESET_OVERRIDE(model3_state,model3_20) | |
| 5510 | 5531 | |
| 5511 | 5532 | MCFG_EEPROM_SERIAL_93C46_ADD("eeprom") |
| 5512 | 5533 | MCFG_NVRAM_ADD_1FILL("backup") |
| r243192 | r243193 | |
| 5533 | 5554 | MCFG_SOUND_ROUTE(0, "rspeaker", 2.0) |
| 5534 | 5555 | MACHINE_CONFIG_END |
| 5535 | 5556 | |
| 5536 | static MACHINE_CONFIG_DERIVED(model3_20_5881, model3_20) | |
| 5537 | MCFG_DEVICE_ADD("315_5881", SEGA315_5881_CRYPT, 0) | |
| 5538 | MCFG_SET_READ_CALLBACK(model3_state, crypt_read_callback) | |
| 5539 | MACHINE_CONFIG_END | |
| 5540 | ||
| 5541 | static MACHINE_CONFIG_START(model3_21, model3_state) | |
| 5557 | static MACHINE_CONFIG_START( model3_21, model3_state ) | |
| 5542 | 5558 | MCFG_CPU_ADD("maincpu", PPC603R, 166000000) |
| 5543 | 5559 | MCFG_PPC_BUS_FREQUENCY(66000000) /* Multiplier 2.5, Bus = 66MHz, Core = 166MHz */ |
| 5544 | 5560 | MCFG_CPU_PROGRAM_MAP(model3_mem) |
| r243192 | r243193 | |
| 5547 | 5563 | MCFG_CPU_ADD("audiocpu", M68000, 12000000) |
| 5548 | 5564 | MCFG_CPU_PROGRAM_MAP(model3_snd) |
| 5549 | 5565 | |
| 5550 | MCFG_MACHINE_START_OVERRIDE(model3_state, model3_21) | |
| 5551 | MCFG_MACHINE_RESET_OVERRIDE(model3_state, model3_21) | |
| 5566 | MCFG_MACHINE_START_OVERRIDE(model3_state,model3_21) | |
| 5567 | MCFG_MACHINE_RESET_OVERRIDE(model3_state,model3_21) | |
| 5552 | 5568 | |
| 5553 | 5569 | MCFG_EEPROM_SERIAL_93C46_ADD("eeprom") |
| 5554 | 5570 | MCFG_NVRAM_ADD_1FILL("backup") |
| r243192 | r243193 | |
| 5575 | 5591 | MCFG_SOUND_ROUTE(0, "rspeaker", 2.0) |
| 5576 | 5592 | MACHINE_CONFIG_END |
| 5577 | 5593 | |
| 5578 | ||
| 5579 | UINT16 model3_state::crypt_read_callback(UINT32 addr) | |
| 5580 | { | |
| 5581 | UINT16 dat = 0; | |
| 5582 | if (addr < 0x8000) | |
| 5583 | { | |
| 5584 | dat = m_maincpu->space().read_word((0xf0180000 + 4 * addr)); // every other word is unused in this RAM, probably 32-bit ram on 64-bit bus? | |
| 5585 | } | |
| 5586 | ||
| 5587 | // dat = ((dat & 0xff00) >> 8) | ((dat & 0x00ff) << 8); | |
| 5588 | // printf("reading %04x\n", dat); | |
| 5589 | ||
| 5590 | return dat; | |
| 5591 | } | |
| 5592 | ||
| 5593 | static MACHINE_CONFIG_DERIVED( model3_21_5881, model3_21 ) | |
| 5594 | MCFG_DEVICE_ADD("315_5881", SEGA315_5881_CRYPT, 0) | |
| 5595 | MCFG_SET_READ_CALLBACK(model3_state, crypt_read_callback) | |
| 5596 | MACHINE_CONFIG_END | |
| 5597 | ||
| 5598 | ||
| 5599 | 5594 | static void interleave_vroms(running_machine &machine) |
| 5600 | 5595 | { |
| 5601 | 5596 | model3_state *state = machine.driver_data<model3_state>(); |
| r243192 | r243193 | |
| 5627 | 5622 | } |
| 5628 | 5623 | } |
| 5629 | 5624 | |
| 5630 | DRIVER_INIT_MEMBER(model3_state, genprot) | |
| 5631 | { | |
| 5632 | // astring key = parameter(":315_5881:key"); | |
| 5633 | ||
| 5634 | m_maincpu->space(AS_PROGRAM).install_ram(0xf0180000, 0xf019ffff, 0, 0x0e000000); | |
| 5635 | ||
| 5636 | m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xf01a0000, 0xf01a003f, 0, 0x0e000000, read64_delegate(FUNC(model3_state::model3_5881prot_r), this), write64_delegate(FUNC(model3_state::model3_5881prot_w), this) ); | |
| 5637 | ||
| 5638 | } | |
| 5639 | ||
| 5640 | 5625 | DRIVER_INIT_MEMBER(model3_state,model3_10) |
| 5641 | 5626 | { |
| 5642 | 5627 | interleave_vroms(machine()); |
| r243192 | r243193 | |
| 5800 | 5785 | DRIVER_INIT_MEMBER(model3_state,vs298) |
| 5801 | 5786 | { |
| 5802 | 5787 | DRIVER_INIT_CALL(model3_20); |
| 5803 | DRIVER_INIT_CALL(genprot); | |
| 5804 | 5788 | } |
| 5805 | 5789 | |
| 5806 | 5790 | |
| 5791 | DRIVER_INIT_MEMBER(model3_state,vs2v991) | |
| 5792 | { | |
| 5793 | DRIVER_INIT_CALL(model3_20); | |
| 5794 | } | |
| 5807 | 5795 | |
| 5796 | DRIVER_INIT_MEMBER(model3_state,vs299b) | |
| 5797 | { | |
| 5798 | DRIVER_INIT_CALL(model3_20); | |
| 5799 | } | |
| 5808 | 5800 | |
| 5801 | DRIVER_INIT_MEMBER(model3_state,vs299a) | |
| 5802 | { | |
| 5803 | DRIVER_INIT_CALL(model3_20); | |
| 5804 | } | |
| 5805 | ||
| 5809 | 5806 | DRIVER_INIT_MEMBER(model3_state,vs299) |
| 5810 | 5807 | { |
| 5811 | 5808 | DRIVER_INIT_CALL(model3_20); |
| 5812 | DRIVER_INIT_CALL(genprot); | |
| 5813 | 5809 | } |
| 5814 | 5810 | |
| 5815 | 5811 | DRIVER_INIT_MEMBER(model3_state,harley) |
| r243192 | r243193 | |
| 5856 | 5852 | |
| 5857 | 5853 | rom[(0x043dc^4)/4] = 0x48000090; // skip force feedback setup |
| 5858 | 5854 | rom[(0xf6e44^4)/4] = 0x60000000; |
| 5859 | ||
| 5860 | ||
| 5861 | DRIVER_INIT_CALL(genprot); | |
| 5862 | ||
| 5863 | 5855 | } |
| 5864 | 5856 | |
| 5865 | 5857 | DRIVER_INIT_MEMBER(model3_state,swtrilga) |
| 5866 | 5858 | { |
| 5867 | 5859 | //UINT32 *rom = (UINT32*)memregion("user1")->base(); |
| 5868 | 5860 | DRIVER_INIT_CALL(model3_20); |
| 5869 | DRIVER_INIT_CALL(genprot); | |
| 5870 | 5861 | |
| 5871 | 5862 | //rom[(0xf6dd0^4)/4] = 0x60000000; |
| 5872 | 5863 | } |
| r243192 | r243193 | |
| 5876 | 5867 | m_step20_with_old_real3d = true; |
| 5877 | 5868 | |
| 5878 | 5869 | DRIVER_INIT_CALL(model3_20); |
| 5879 | DRIVER_INIT_CALL(genprot); | |
| 5880 | 5870 | } |
| 5881 | 5871 | |
| 5882 | 5872 | DRIVER_INIT_MEMBER(model3_state,dirtdvls) |
| r243192 | r243193 | |
| 5884 | 5874 | m_step20_with_old_real3d = true; |
| 5885 | 5875 | |
| 5886 | 5876 | DRIVER_INIT_CALL(model3_20); |
| 5887 | DRIVER_INIT_CALL(genprot); | |
| 5888 | 5877 | } |
| 5889 | 5878 | |
| 5890 | 5879 | DRIVER_INIT_MEMBER(model3_state,daytona2) |
| 5891 | 5880 | { |
| 5892 | ||
| 5881 | UINT32 *rom = (UINT32*)memregion("user1")->base(); | |
| 5893 | 5882 | DRIVER_INIT_CALL(model3_20); |
| 5894 | 5883 | |
| 5895 | 5884 | m_maincpu->space(AS_PROGRAM).install_write_handler(0xc3800000, 0xc3800007, write64_delegate(FUNC(model3_state::daytona2_rombank_w),this)); |
| 5896 | 5885 | m_maincpu->space(AS_PROGRAM).install_read_bank(0xc3000000, 0xc37fffff, "bank2" ); |
| 5897 | 5886 | |
| 5898 | 5887 | //rom[(0x68468c^4)/4] = 0x60000000; |
| 5899 | //rom[(0x6063c4^4)/4] = 0x60000000; | |
| 5900 | //rom[(0x616434^4)/4] = 0x60000000; | |
| 5901 | //rom[(0x69f4e4^4)/4] = 0x60000000; | |
| 5902 | ||
| 5903 | DRIVER_INIT_CALL(genprot); | |
| 5888 | rom[(0x6063c4^4)/4] = 0x60000000; | |
| 5889 | rom[(0x616434^4)/4] = 0x60000000; | |
| 5890 | rom[(0x69f4e4^4)/4] = 0x60000000; | |
| 5904 | 5891 | } |
| 5905 | 5892 | |
| 5906 | 5893 | DRIVER_INIT_MEMBER(model3_state,dayto2pe) |
| 5907 | 5894 | { |
| 5908 | ||
| 5895 | UINT32 *rom = (UINT32*)memregion("user1")->base(); | |
| 5909 | 5896 | DRIVER_INIT_CALL(model3_20); |
| 5910 | 5897 | |
| 5911 | 5898 | m_maincpu->space(AS_PROGRAM).install_write_handler(0xc3800000, 0xc3800007, write64_delegate(FUNC(model3_state::daytona2_rombank_w),this)); |
| 5912 | 5899 | m_maincpu->space(AS_PROGRAM).install_read_bank(0xc3000000, 0xc37fffff, "bank2" ); |
| 5913 | 5900 | |
| 5914 | // rom[(0x606784^4)/4] = 0x60000000; | |
| 5915 | // rom[(0x69a3fc^4)/4] = 0x60000000; // jump to encrypted code | |
| 5916 | // rom[(0x618b28^4)/4] = 0x60000000; // jump to encrypted code | |
| 5901 | rom[(0x606784^4)/4] = 0x60000000; | |
| 5902 | rom[(0x69a3fc^4)/4] = 0x60000000; // jump to encrypted code | |
| 5903 | rom[(0x618b28^4)/4] = 0x60000000; // jump to encrypted code | |
| 5917 | 5904 | |
| 5918 | // rom[(0x64ca34^4)/4] = 0x60000000; // dec | |
| 5919 | ||
| 5920 | DRIVER_INIT_CALL(genprot); | |
| 5905 | rom[(0x64ca34^4)/4] = 0x60000000; // dec | |
| 5921 | 5906 | } |
| 5922 | 5907 | |
| 5923 | 5908 | DRIVER_INIT_MEMBER(model3_state,spikeout) |
| r243192 | r243193 | |
| 5927 | 5912 | |
| 5928 | 5913 | rom[(0x6059cc^4)/4] = 0x60000000; |
| 5929 | 5914 | rom[(0x6059ec^4)/4] = 0x60000000; |
| 5930 | DRIVER_INIT_CALL(genprot); | |
| 5931 | 5915 | } |
| 5932 | 5916 | |
| 5933 | 5917 | DRIVER_INIT_MEMBER(model3_state,spikeofe) |
| r243192 | r243193 | |
| 5937 | 5921 | |
| 5938 | 5922 | rom[(0x6059cc^4)/4] = 0x60000000; |
| 5939 | 5923 | rom[(0x6059ec^4)/4] = 0x60000000; |
| 5940 | DRIVER_INIT_CALL(genprot); | |
| 5941 | 5924 | } |
| 5942 | 5925 | |
| 5943 | 5926 | DRIVER_INIT_MEMBER(model3_state,eca) |
| 5944 | 5927 | { |
| 5945 | 5928 | DRIVER_INIT_CALL(model3_20); |
| 5946 | DRIVER_INIT_CALL(genprot); | |
| 5947 | 5929 | } |
| 5948 | 5930 | |
| 5949 | 5931 | DRIVER_INIT_MEMBER(model3_state,skichamp) |
| r243192 | r243193 | |
| 5965 | 5947 | DRIVER_INIT_CALL(model3_20); |
| 5966 | 5948 | |
| 5967 | 5949 | rom[(0x57995c^4)/4] = 0x60000000; // decrementer |
| 5968 | ||
| 5969 | DRIVER_INIT_CALL(genprot); | |
| 5970 | 5950 | } |
| 5971 | 5951 | |
| 5972 | 5952 | DRIVER_INIT_MEMBER(model3_state,magtruck) |
| r243192 | r243193 | |
| 5974 | 5954 | m_step20_with_old_real3d = true; |
| 5975 | 5955 | |
| 5976 | 5956 | DRIVER_INIT_CALL(model3_20); |
| 5977 | DRIVER_INIT_CALL(genprot); | |
| 5978 | 5957 | } |
| 5979 | 5958 | |
| 5980 | 5959 | DRIVER_INIT_MEMBER(model3_state,lamachin) |
| r243192 | r243193 | |
| 5982 | 5961 | m_step20_with_old_real3d = true; |
| 5983 | 5962 | |
| 5984 | 5963 | DRIVER_INIT_CALL(model3_20); |
| 5985 | DRIVER_INIT_CALL(genprot); | |
| 5986 | 5964 | } |
| 5987 | 5965 | |
| 5988 | 5966 | |
| r243192 | r243193 | |
| 6007 | 5985 | GAME( 1998, vs29815, vs298, model3_15, model3, model3_state, vs29815, ROT0, "Sega", "Virtua Striker 2 '98 (Step 1.5)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) |
| 6008 | 5986 | |
| 6009 | 5987 | /* Model 3 Step 2.0 */ |
| 6010 | 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 ) | |
| 6011 | 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 ) | |
| 6012 | 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 ) | |
| 6013 | GAME( 1998, lamachin, 0, model3_20_5881, model3, model3_state, lamachin, ROT0, "Sega", "L.A. Machineguns", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 6014 | 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 ) | |
| 6015 | GAME( 1998, skichamp, 0, model3_20, skichamp, model3_state, skichamp, ROT0, "Sega", "Ski Champ", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 6016 | GAME( 1998, srally2, 0, model3_20, scud, model3_state, srally2, ROT0, "Sega", "Sega Rally 2", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 6017 | GAME( 1998, srally2x, 0, model3_20, scud, model3_state, srally2, ROT0, "Sega", "Sega Rally 2 DX", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 6018 | GAME( 1998, von2, 0, model3_20_5881, model3, model3_state, von2, ROT0, "Sega", "Virtual On 2: Oratorio Tangram (Revision B)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 6019 | GAME( 1998, von254g, von2, model3_20_5881, model3, model3_state, von2, ROT0, "Sega", "Virtual On 2: Oratorio Tangram (ver 5.4g)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 6020 | GAME( 1998, fvipers2, 0, model3_20_5881, model3, model3_state, vs299, ROT0, "Sega", "Fighting Vipers 2 (Revision A)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 6021 | GAME( 1998, vs298, 0, model3_20_5881, model3, model3_state, vs298, ROT0, "Sega", "Virtua Striker 2 '98 (Step 2.0)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 6022 | GAME( 1999, vs2v991, 0, model3_20_5881, model3, model3_state, vs299, ROT0, "Sega", "Virtua Striker 2 '99.1 (Revision B)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 6023 | GAME( 1999, vs299b, vs2v991, model3_20_5881, model3, model3_state, vs299, ROT0, "Sega", "Virtua Striker 2 '99 (Revision B)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 6024 | GAME( 1999, vs299a, vs2v991, model3_20_5881, model3, model3_state, vs299, ROT0, "Sega", "Virtua Striker 2 '99 (Revision A)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 6025 | GAME( 1999, vs299, vs2v991, model3_20_5881, model3, model3_state, vs299, ROT0, "Sega", "Virtua Striker 2 '99", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 5988 | 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 ) | |
| 5989 | 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 ) | |
| 5990 | 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 ) | |
| 5991 | GAME( 1998, lamachin, 0, model3_20, model3, model3_state, lamachin, ROT0, "Sega", "L.A. Machineguns", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 5992 | GAME( 1998, oceanhun, 0, model3_20, model3, model3_state, oceanhun, ROT0, "Sega", "The Ocean Hunter", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 5993 | GAME( 1998, skichamp, 0, model3_20, skichamp, model3_state, skichamp, ROT0, "Sega", "Ski Champ", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 5994 | GAME( 1998, srally2, 0, model3_20, scud, model3_state, srally2, ROT0, "Sega", "Sega Rally 2", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 5995 | GAME( 1998, srally2x, 0, model3_20, scud, model3_state, srally2, ROT0, "Sega", "Sega Rally 2 DX", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 5996 | GAME( 1998, von2, 0, model3_20, model3, model3_state, von2, ROT0, "Sega", "Virtual On 2: Oratorio Tangram (Revision B)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 5997 | GAME( 1998, von254g, von2, model3_20, model3, model3_state, von2, ROT0, "Sega", "Virtual On 2: Oratorio Tangram (ver 5.4g)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 5998 | GAME( 1998, fvipers2, 0, model3_20, model3, model3_state, model3_20, ROT0, "Sega", "Fighting Vipers 2 (Revision A)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 5999 | GAME( 1998, vs298, 0, model3_20, model3, model3_state, vs298, ROT0, "Sega", "Virtua Striker 2 '98 (Step 2.0)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 6000 | GAME( 1999, vs2v991, 0, model3_20, model3, model3_state, vs2v991, ROT0, "Sega", "Virtua Striker 2 '99.1 (Revision B)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 6001 | GAME( 1999, vs299b, vs2v991, model3_20, model3, model3_state, vs299b, ROT0, "Sega", "Virtua Striker 2 '99 (Revision B)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 6002 | GAME( 1999, vs299a, vs2v991, model3_20, model3, model3_state, vs299a, ROT0, "Sega", "Virtua Striker 2 '99 (Revision A)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 6003 | GAME( 1999, vs299, vs2v991, model3_20, model3, model3_state, vs299, ROT0, "Sega", "Virtua Striker 2 '99", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 6026 | 6004 | |
| 6027 | 6005 | /* Model 3 Step 2.1 */ |
| 6028 | GAME( 1998, daytona2, 0, model3_21_5881, daytona2, model3_state, daytona2, ROT0, "Sega", "Daytona USA 2 (Revision A)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 6029 | GAME( 1998, dayto2pe, 0, model3_21_5881, daytona2, model3_state, dayto2pe, ROT0, "Sega", "Daytona USA 2 Power Edition", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 6030 | GAME( 1998, dirtdvls, 0, model3_21_5881, scud, model3_state, dirtdvls, ROT0, "Sega", "Dirt Devils (set 1) (Revision A)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 6031 | GAME( 1998, dirtdvlsa, dirtdvls, model3_21_5881, scud, model3_state, dirtdvls, ROT0, "Sega", "Dirt Devils (set 2) (Revision A)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 6032 | GAME( 1998, swtrilgy, 0, model3_21_5881, swtrilgy, model3_state, swtrilgy, ROT0, "Sega / LucasArts", "Star Wars Trilogy (Revision A)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 6033 | GAME( 1998, swtrilgya, swtrilgy, model3_21_5881, swtrilgy, model3_state, swtrilga, ROT0, "Sega / LucasArts", "Star Wars Trilogy", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 6034 | GAME( 1998, spikeout, 0, model3_21_5881, model3, model3_state, spikeout, ROT0, "Sega", "Spikeout (Revision C)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 6035 | GAME( 1998, spikeofe, 0, model3_21_5881, model3, model3_state, spikeofe, ROT0, "Sega", "Spikeout Final Edition", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 6036 | GAME( 1998, magtruck, 0, model3_21_5881, eca, model3_state, magtruck, ROT0, "Sega", "Magical Truck Adventure", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 6037 | GAME( 1999, eca, 0, model3_21_5881, eca, model3_state, eca, ROT0, "Sega", "Emergency Call Ambulance", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 6038 | GAME( 1999, ecax, eca, model3_21_5881, eca, model3_state, eca, ROT0, "Sega", "Emergency Call Ambulance (Export)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 6039 | GAME( 1999, ecap, eca, model3_21_5881, eca, model3_state, eca, ROT0, "Sega", "Emergency Call Ambulance (US location test?)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 6006 | GAME( 1998, daytona2, 0, model3_21, daytona2, model3_state, daytona2, ROT0, "Sega", "Daytona USA 2 (Revision A)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 6007 | GAME( 1998, dayto2pe, 0, model3_21, daytona2, model3_state, dayto2pe, ROT0, "Sega", "Daytona USA 2 Power Edition", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 6008 | GAME( 1998, dirtdvls, 0, model3_21, scud, model3_state, dirtdvls, ROT0, "Sega", "Dirt Devils (set 1) (Revision A)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 6009 | GAME( 1998, dirtdvlsa, dirtdvls, model3_21, scud, model3_state, dirtdvls, ROT0, "Sega", "Dirt Devils (set 2) (Revision A)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 6010 | GAME( 1998, swtrilgy, 0, model3_21, swtrilgy, model3_state, swtrilgy, ROT0, "Sega / LucasArts", "Star Wars Trilogy (Revision A)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 6011 | GAME( 1998, swtrilgya, swtrilgy, model3_21, swtrilgy, model3_state, swtrilga, ROT0, "Sega / LucasArts", "Star Wars Trilogy", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 6012 | GAME( 1998, spikeout, 0, model3_21, model3, model3_state, spikeout, ROT0, "Sega", "Spikeout (Revision C)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 6013 | GAME( 1998, spikeofe, 0, model3_21, model3, model3_state, spikeofe, ROT0, "Sega", "Spikeout Final Edition", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 6014 | GAME( 1998, magtruck, 0, model3_21, eca, model3_state, magtruck, ROT0, "Sega", "Magical Truck Adventure", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 6015 | GAME( 1999, eca, 0, model3_21, eca, model3_state, eca, ROT0, "Sega", "Emergency Call Ambulance", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 6016 | GAME( 1999, ecax, eca, model3_21, eca, model3_state, eca, ROT0, "Sega", "Emergency Call Ambulance (Export)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 6017 | GAME( 1999, ecap, eca, model3_21, eca, model3_state, eca, ROT0, "Sega", "Emergency Call Ambulance (US location test?)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) |
| r243192 | r243193 | |
|---|---|---|
| 311 | 311 | |
| 312 | 312 | INT32 namcos21_state::read_pointrom_data(unsigned offset) |
| 313 | 313 | { |
| 314 | return m_ptrom24[offset]; | |
| 314 | const INT32 *pPointData = (INT32 *)memregion( "point" )->base(); | |
| 315 | INT32 result = pPointData[offset]; | |
| 316 | return result; | |
| 315 | 317 | } |
| 316 | 318 | |
| 317 | 319 | READ16_MEMBER(namcos21_state::namcos21_video_enable_r) |
| r243192 | r243193 | |
| 1166 | 1168 | |
| 1167 | 1169 | READ16_MEMBER(namcos21_state::winrun_dsp_pointrom_data_r) |
| 1168 | 1170 | { |
| 1169 | return m_ptrom16[m_winrun_pointrom_addr++]; | |
| 1171 | UINT16 *ptrom = (UINT16 *)memregion("point")->base(); | |
| 1172 | return ptrom[m_winrun_pointrom_addr++]; | |
| 1170 | 1173 | } |
| 1171 | 1174 | |
| 1172 | 1175 | WRITE16_MEMBER(namcos21_state::winrun_dsp_complete_w) |
| r243192 | r243193 | |
| 1642 | 1645 | ROM_LOAD16_BYTE( "ac1-edata1-u.3c", 0x000000, 0x80000, CRC(a9547509) SHA1(1bc663cec03b60ad968896bbc2546f02efda135e) ) |
| 1643 | 1646 | ROM_LOAD16_BYTE( "ac1-edata1-l.1c", 0x000001, 0x80000, CRC(a87087dd) SHA1(cd9b83a8f07886ab44e4ded68002b44338777e8c) ) |
| 1644 | 1647 | |
| 1645 | ROM_REGION32_BE( 0x400000, "point | |
| 1648 | ROM_REGION32_BE( 0x400000, "point", ROMREGION_ERASE00) /* 24bit signed point data */ | |
| 1646 | 1649 | ROM_LOAD32_BYTE( "ac1-poi-h.2f", 0x000001, 0x80000, CRC(573bbc3b) SHA1(371be12b915db6872049f18980c1b55544cfc445) ) /* most significant */ |
| 1647 | 1650 | ROM_LOAD32_BYTE( "ac1-poi-lu.2k", 0x000002, 0x80000, CRC(d99084b9) SHA1(c604d60a2162af7610e5ff7c1aa4195f7df82efe) ) |
| 1648 | 1651 | ROM_LOAD32_BYTE( "ac1-poi-ll.2n", 0x000003, 0x80000, CRC(abb32307) SHA1(8e936ba99479215dd33a951d81ec2b04020dfd62) ) /* least significant */ |
| r243192 | r243193 | |
| 1703 | 1706 | ROM_LOAD16_BYTE( "ac1-edata1-u.3c", 0x000000, 0x80000, CRC(a9547509) SHA1(1bc663cec03b60ad968896bbc2546f02efda135e) ) |
| 1704 | 1707 | ROM_LOAD16_BYTE( "ac1-edata1-l.1c", 0x000001, 0x80000, CRC(a87087dd) SHA1(cd9b83a8f07886ab44e4ded68002b44338777e8c) ) |
| 1705 | 1708 | |
| 1706 | ROM_REGION32_BE( 0x400000, "point | |
| 1709 | ROM_REGION32_BE( 0x400000, "point", ROMREGION_ERASE00) /* 24bit signed point data */ | |
| 1707 | 1710 | ROM_LOAD32_BYTE( "ac1-poi-h.2f", 0x000001, 0x80000, CRC(573bbc3b) SHA1(371be12b915db6872049f18980c1b55544cfc445) ) /* most significant */ |
| 1708 | 1711 | ROM_LOAD32_BYTE( "ac1-poi-lu.2k", 0x000002, 0x80000, CRC(d99084b9) SHA1(c604d60a2162af7610e5ff7c1aa4195f7df82efe) ) |
| 1709 | 1712 | ROM_LOAD32_BYTE( "ac1-poi-ll.2n", 0x000003, 0x80000, CRC(abb32307) SHA1(8e936ba99479215dd33a951d81ec2b04020dfd62) ) /* least significant */ |
| r243192 | r243193 | |
| 1764 | 1767 | ROM_LOAD16_BYTE( "cy1-edata0-u.3b", 0x000000, 0x80000, CRC(77452533) SHA1(48fc199bcc1beb23c714eebd9b09b153c980170b) ) |
| 1765 | 1768 | ROM_LOAD16_BYTE( "cy1-edata0-l.1b", 0x000001, 0x80000, CRC(e812e290) SHA1(719e0a026ae8ef63d0d0269b67669ea9b4d950dd) ) |
| 1766 | 1769 | |
| 1767 | ROM_REGION32_BE( 0x400000, "point | |
| 1770 | ROM_REGION32_BE( 0x400000, "point", ROMREGION_ERASE00) /* 24bit signed point data */ | |
| 1768 | 1771 | ROM_LOAD32_BYTE( "cy1-poi-h1.2f", 0x000001, 0x80000, CRC(eaf8bac3) SHA1(7a2caf6672af158b4a23ce4626342d1f17d1a4e4) ) /* most significant */ |
| 1769 | 1772 | ROM_LOAD32_BYTE( "cy1-poi-lu1.2k", 0x000002, 0x80000, CRC(c544a8dc) SHA1(4cce5f2ab3519b4aa7edbdd15b2d79a7fdcade3c) ) |
| 1770 | 1773 | ROM_LOAD32_BYTE( "cy1-poi-ll1.2n", 0x000003, 0x80000, CRC(30acb99b) SHA1(a28dcb3e5405f166644f6353a903c1143ee268f1) ) /* least significant */ |
| r243192 | r243193 | |
| 1823 | 1826 | ROM_LOAD16_BYTE( "cy1-edata0-u.3b", 0x000000, 0x80000, CRC(77452533) SHA1(48fc199bcc1beb23c714eebd9b09b153c980170b) ) |
| 1824 | 1827 | ROM_LOAD16_BYTE( "cy1-edata0-l.1b", 0x000001, 0x80000, CRC(e812e290) SHA1(719e0a026ae8ef63d0d0269b67669ea9b4d950dd) ) |
| 1825 | 1828 | |
| 1826 | ROM_REGION32_BE( 0x400000, "point | |
| 1829 | ROM_REGION32_BE( 0x400000, "point", ROMREGION_ERASE00) /* 24bit signed point data */ | |
| 1827 | 1830 | ROM_LOAD32_BYTE( "cy1-poi-h1.2f", 0x000001, 0x80000, CRC(eaf8bac3) SHA1(7a2caf6672af158b4a23ce4626342d1f17d1a4e4) ) /* most significant */ |
| 1828 | 1831 | ROM_LOAD32_BYTE( "cy1-poi-lu1.2k", 0x000002, 0x80000, CRC(c544a8dc) SHA1(4cce5f2ab3519b4aa7edbdd15b2d79a7fdcade3c) ) |
| 1829 | 1832 | ROM_LOAD32_BYTE( "cy1-poi-ll1.2n", 0x000003, 0x80000, CRC(30acb99b) SHA1(a28dcb3e5405f166644f6353a903c1143ee268f1) ) /* least significant */ |
| r243192 | r243193 | |
| 1884 | 1887 | ROM_LOAD16_BYTE( "de1-data-u.3a", 0x00000, 0x80000, CRC(fe65d2ab) SHA1(dbe962dda7efa60357fa3a684a265aaad49df5b5) ) |
| 1885 | 1888 | ROM_LOAD16_BYTE( "de1-data-l.1a", 0x00001, 0x80000, CRC(9bb37aca) SHA1(7f5dffc95cadcf12f53ff7944920afc25ed3cf68) ) |
| 1886 | 1889 | |
| 1887 | ROM_REGION16_BE( 0xc0000, "point | |
| 1890 | ROM_REGION16_BE( 0xc0000, "point", 0 ) /* 3d objects */ | |
| 1888 | 1891 | ROM_LOAD16_BYTE( "de1-pt0-ub.8j", 0x00000, 0x20000, CRC(3b6b746d) SHA1(40c992ef4cf5187b30aba42c5fe7ce0f8f02bee0) ) |
| 1889 | 1892 | ROM_LOAD16_BYTE( "de1-pt0-lb.8d", 0x00001, 0x20000, CRC(9c5c477e) SHA1(c8ae8a663227d636d35bd5f432d23f05d6695942) ) |
| 1890 | 1893 | ROM_LOAD16_BYTE( "de1-pt1-u.8l", 0x40000, 0x20000, CRC(23bc72a1) SHA1(083e2955ae2f88d1ad461517b47054d64375b46e) ) |
| r243192 | r243193 | |
| 1934 | 1937 | |
| 1935 | 1938 | ROM_REGION16_BE( 0x100000, "edata", ROMREGION_ERASEFF ) |
| 1936 | 1939 | |
| 1937 | ROM_REGION32_BE( 0x400000, "point | |
| 1940 | ROM_REGION32_BE( 0x400000, "point", ROMREGION_ERASE00) /* 24bit signed point data */ | |
| 1938 | 1941 | ROM_LOAD32_BYTE( "st1-pt0-h.bin", 0x000001, 0x80000, CRC(84eb355f) SHA1(89a248b8be2e0afcee29ba4c4c9cca65d5fb246a) ) |
| 1939 | 1942 | ROM_LOAD32_BYTE( "st1-pt0-u.bin", 0x000002, 0x80000, CRC(1956cd0a) SHA1(7d21b3a59f742694de472c545a1f30c3d92e3390) ) |
| 1940 | 1943 | ROM_LOAD32_BYTE( "st1-pt0-l.bin", 0x000003, 0x80000, CRC(ff577049) SHA1(1e1595174094e88d5788753d05ce296c1f7eca75) ) |
| r243192 | r243193 | |
| 1987 | 1990 | |
| 1988 | 1991 | ROM_REGION16_BE( 0x100000, "edata", ROMREGION_ERASEFF ) |
| 1989 | 1992 | |
| 1990 | ROM_REGION32_BE( 0x400000, "point | |
| 1993 | ROM_REGION32_BE( 0x400000, "point", ROMREGION_ERASE00) /* 24bit signed point data */ | |
| 1991 | 1994 | ROM_LOAD32_BYTE( "st1-pt0-h.bin", 0x000001, 0x80000, CRC(84eb355f) SHA1(89a248b8be2e0afcee29ba4c4c9cca65d5fb246a) ) |
| 1992 | 1995 | ROM_LOAD32_BYTE( "st1-pt0-u.bin", 0x000002, 0x80000, CRC(1956cd0a) SHA1(7d21b3a59f742694de472c545a1f30c3d92e3390) ) |
| 1993 | 1996 | ROM_LOAD32_BYTE( "st1-pt0-l.bin", 0x000003, 0x80000, CRC(ff577049) SHA1(1e1595174094e88d5788753d05ce296c1f7eca75) ) |
| r243192 | r243193 | |
| 2044 | 2047 | |
| 2045 | 2048 | ROM_REGION16_BE( 0x100000, "edata", ROMREGION_ERASEFF ) |
| 2046 | 2049 | |
| 2047 | ROM_REGION32_BE( 0x400000, "point | |
| 2050 | ROM_REGION32_BE( 0x400000, "point", ROMREGION_ERASE00) /* 24bit signed point data */ | |
| 2048 | 2051 | ROM_LOAD32_BYTE( "sv1-pt0-h.bin", 0x000001, 0x80000, CRC(3be21115) SHA1(c9f30353c1216f64199f87cd34e787efd728e739) ) /* most significant */ |
| 2049 | 2052 | ROM_LOAD32_BYTE( "sv1-pt0-u.bin", 0x000002, 0x80000, CRC(4aacfc42) SHA1(f0e179e057183b41744ca429764f44306f0ce9bf) ) |
| 2050 | 2053 | ROM_LOAD32_BYTE( "sv1-pt0-l.bin", 0x000003, 0x80000, CRC(6a4dddff) SHA1(9ed182d21d328c6a684ee6658a9dfcf3f3dd8646) ) /* least significant */ |
| r243192 | r243193 | |
| 2092 | 2095 | ROM_LOAD16_BYTE( "wr1-gd0u-2.1p", 0x00000, 0x40000, CRC(9752eef5) SHA1(d6df0faf9c2696247bdf463f53c1e474ec595dd0) ) |
| 2093 | 2096 | ROM_LOAD16_BYTE( "wr1-gd0l-2.3p", 0x00001, 0x40000, CRC(349c95cc) SHA1(8898eecf5918485ec683900520f123483077df28) ) |
| 2094 | 2097 | |
| 2095 | ROM_REGION16_BE( 0x80000, "point | |
| 2098 | ROM_REGION16_BE( 0x80000, "point", 0 ) /* 3d objects */ | |
| 2096 | 2099 | ROM_LOAD16_BYTE( "wr1-pt0u.8j", 0x00000, 0x20000, CRC(7ec4cf6b) SHA1(92ec92567b9f7321efb4a3724cbcdba216eb22f9) ) |
| 2097 | 2100 | ROM_LOAD16_BYTE( "wr1-pt0l.8d", 0x00001, 0x20000, CRC(58c14b73) SHA1(e34a26866cd870743e166669f7fa5915a82104e9) ) |
| 2098 | 2101 | |
| r243192 | r243193 | |
| 2160 | 2163 | ROM_LOAD16_BYTE( "sg1-gd1-u.1s", 0x80000, 0x40000, CRC(271db29b) SHA1(8b35fcf273b9aec28d4c606c41c0626dded697e1) ) |
| 2161 | 2164 | ROM_LOAD16_BYTE( "sg1-gd1-l.3s", 0x80001, 0x40000, CRC(a6c4da96) SHA1(377dbf21a1bede01de16708c96c112abab4417ce) ) |
| 2162 | 2165 | |
| 2163 | ROM_REGION16_BE( 0x80000, "point | |
| 2166 | ROM_REGION16_BE( 0x80000, "point", 0 ) /* 3d objects */ | |
| 2164 | 2167 | ROM_LOAD16_BYTE( "sg1-pt0-u.8j", 0x00000, 0x20000, CRC(160c3634) SHA1(485d20d6cc459f17d77682201dee07bdf76bf343) ) |
| 2165 | 2168 | ROM_LOAD16_BYTE( "sg1-pt0-l.8d", 0x00001, 0x20000, CRC(b5a665bf) SHA1(5af6ec492f31395c0492e14590b025b120067b8d) ) |
| 2166 | 2169 | ROM_LOAD16_BYTE( "sg1-pt1-u.8l", 0x40000, 0x20000, CRC(b63d3006) SHA1(78e78619766b0fd91b1e830cfb066495d6773981) ) |
| r243192 | r243193 | |
| 2209 | 2212 | ROM_LOAD16_BYTE( "r911-gd1u.1s", 0x80000, 0x40000, CRC(17e5a61c) SHA1(272ebd7daa56847f1887809535362331b5465dec) ) |
| 2210 | 2213 | ROM_LOAD16_BYTE( "r911-gd1l.3s", 0x80001, 0x40000, CRC(64df59a2) SHA1(1e9d0945b94780bb0be16803e767466d2cda07e8) ) |
| 2211 | 2214 | |
| 2212 | ROM_REGION16_BE( 0x80000, "point | |
| 2215 | ROM_REGION16_BE( 0x80000, "point", 0 ) /* winrun91 - 3d objects */ | |
| 2213 | 2216 | ROM_LOAD16_BYTE( "r911-pt0u.8j", 0x00000, 0x20000, CRC(abf512a6) SHA1(e86288039d6c4dedfa95b11cb7e4b87637f90c09) ) /* Version on SYSTEM21B CPU only has R911 PTU @ 8W */ |
| 2214 | 2217 | ROM_LOAD16_BYTE( "r911-pt0l.8d", 0x00001, 0x20000, CRC(ac8d468c) SHA1(d1b457a19a5d3259d0caf933f42b3a02b485867b) ) /* and R911 PTL @ 12W with rom type 27C020 */ |
| 2215 | 2218 | ROM_LOAD16_BYTE( "r911-pt1u.8l", 0x40000, 0x20000, CRC(7e5dab74) SHA1(5bde219d5b4305d38d17b494b2e759f05d05329f) ) |
| r243192 | r243193 | |
|---|---|---|
| 328 | 328 | House of the Dead 2 834-13636-01 21585 20 (64Mb) not present 315-6213 not present |
| 329 | 329 | Idol Janshi Suchie-Pai 3 841-0002C 21979 14 (64Mb) ? 315-6213 317-5047-JPN requires mahjong panel |
| 330 | 330 | Jambo! Safari (Rev A) 840-0013C 22826A 8 (64Mb) ? 315-6213 317-0264-COM |
| 331 | Mars TV 840-0025C 22993 15 (64Mb) present 315-6213 317-0 | |
| 331 | Mars TV 840-0025C 22993 15 (64Mb) present 315-6213 317-0074-JPN | |
| 332 | 332 | OutTrigger 840-0017C 22163 19 (64Mb) ? 315-6213 317-0266-COM requires regular 837-13551 and 837-13938 rotary JVS boards, and special panel |
| 333 | 333 | Power Stone 841-0001C 21597 8 (64Mb) present 315-6213 317-5046-COM joystick + 3 buttons |
| 334 | 334 | Power Stone 2 841-0008C 23127 9 (64Mb) present 315-6213 317-5054-COM joystick + 3 buttons |
| 335 | Puyo Puyo Da! 841-0006C 22206 20 (64Mb) ? 315-6213 | |
| 335 | Puyo Puyo Da! 841-0006C 22206 20 (64Mb) ? 315-6213 ? | |
| 336 | 336 | Ring Out 4x4 840-0004C 21779 10 (64Mb) present 315-6213 317-0250-COM requires 2 JVS boards |
| 337 | 337 | Samba de Amigo (Rev B) 840-0020C 22966B 16 (64Mb) present 315-6213 317-0270-COM will boot but requires special controller to play it |
| 338 | 338 | Sega Marine Fishing 840-0027C 22221 10 (64Mb) ? 315-6213 not present ROM 3&4 not present. Requires 837-13844 JVS IO with all DIPSW Off and fishing controller |
| r243192 | r243193 | |
| 341 | 341 | Sega Tetris 840-0018C 22909 6 (64Mb) present 315-6213 317-0268-COM |
| 342 | 342 | Slashout 840-0041C 23341 17 (64Mb) ? 315-6213 317-0286-COM joystick + 4 buttons |
| 343 | 343 | Spawn In the Demon's Hand (Rev B) 841-0005C 22977B 10 (64Mb) ? 315-6213 317-5051-COM joystick + 4 buttons |
| 344 | Super Major League '99 840-0012C 22059 21 (64Mb) ? 315-6213 | |
| 344 | Super Major League '99 840-0012C 22059 21 (64Mb) ? 315-6213 ? | |
| 345 | 345 | The Typing of the Dead (Rev A) 840-0026C 23021A 20 (64Mb) present 315-6213 not present |
| 346 | 346 | Touch de UNO! / Unou Nouryoku Check Machine 840-0008C 22073 4 (64Mb) present 315-6213 317-0255-JPN requires 837-13844 JVS IO with DIPSW 5 On, ELO AccuTouch-compatible touch screen controller and special printer. |
| 347 | 347 | Toy Fighter / Waffupu 840-0011C 22035 10 (64Mb) present 315-6212 317-0257-COM joystick + 3 buttons |
| r243192 | r243193 | |
| 349 | 349 | Virtua NBA (original) 840-0021C 22949 21 (64Mb) present 315-6213 317-0271-COM |
| 350 | 350 | Virtua Striker 2 Ver. 2000 (Rev C) 840-0010C 21929C 14 (64Mb)* present 315-6213 317-0258-COM joystick + 3 buttons *(+1x 32Mb) |
| 351 | 351 | Virtua Tennis / Power Smash 840-0015C 22927 11 (64Mb) present 315-6213 317-0263-COM |
| 352 | Virtual On Oratorio Tangram M.S.B.S. ver5.66 840-0028C 23198 13 (64Mb) ? 315-6213 317-0279-COM | |
| 353 | 352 | Zombie Revenge 840-0003C 21707 19 (64Mb) ? 315-6213 317-0249-COM joystick + 3 buttons |
| 354 | 353 | |
| 355 | 354 | |
| r243192 | r243193 | |
| 513 | 512 | Derby Owners Club World Edition (Rev C) 840-0088C 22336C 7 (128Mb) 315-6319A 315-6213 not present |
| 514 | 513 | Derby Owners Club World Edition (Rev D) 840-0088C 22336D 7 (128Mb) 315-6319A 315-6213 not present 2 MaskROM are different from Rev C |
| 515 | 514 | Giga Wing 2 841-0014C 22270 5 (128Mb) 315-6319A 315-6213 317-5064-COM |
| 516 | Mobile Suit Gundam: Federation Vs. Zeon 841-0017C 23638 10 (128Mb) 315-6319A 315-6213 | |
| 515 | Mobile Suit Gundam: Federation Vs. Zeon 841-0017C 23638 10 (128Mb) 315-6319A 315-6213 ? | |
| 517 | 516 | Moero Justice Gakuen / Project Justice (Rev A) 841-0015C 23548A 11 (128Mb) 315-6319A 315-6213 317-5065-COM |
| 518 | 517 | MushiKing - The King Of Beetle 2K5 1ST 840-0158C 24286 7 (128Mb) 315-6319A 315-6213 not present requires 610-0669 barcode reader |
| 519 | 518 | Oinori-daimyoujin Matsuri 840-0126B 24053 5 (128Mb) 315-6319A 315-6213 not present requires 837-14274 "G2 EXPANSION BD" (similar to hopper 837-14381 but with ARC NET chip) |
| r243192 | r243193 | |
| 522 | 521 | Star Horse (satellite) 840-0056C 23627 6 (128Mb)* 315-6319 315-6213 not present * +1 (64Mb), requires 837-13785 ARCNET&IO BD |
| 523 | 522 | Star Horse Progress (satellite) (Rev A) 840-0123C 24122A 7 (128Mb) 315-6319A 315-6213 not present requires 837-13785 ARCNET&IO BD |
| 524 | 523 | The King of Route 66 (Rev A) 840-0087C 23819A 10 (128Mb) 315-6319A 315-6213 not present |
| 525 | Virtua Fighter 4 840-0080C 23785 11 (128Mb) ? ? 317-0324-COM | |
| 526 | Virtua Striker 3 840-0061C 23663 11 (128Mb) 315-6319A 315-6213 317-0310-COM | |
| 527 | 524 | Virtua Striker 3 (Rev B) 840-0061C 23663B 11 (128Mb) 315-6319A 315-6213 317-0310-COM |
| 525 | Virtua Striker 3 (Rev C) 840-0061C 23663C 11 (128Mb) 315-6319A 315-6213 317-0310-COM | |
| 528 | 526 | Wave Runner GP 840-0064C 24059 6 (128Mb) 315-6319A 315-6213 not present |
| 529 | 527 | Wild Riders 840-0046C 23622 10 (128Mb) 315-6319A 315-6213 317-0301-COM |
| 530 | 528 | WWF Royal Rumble 840-0040C 22261 8 (128Mb) 315-6319 315-6213 317-0285-COM |
| r243192 | r243193 | |
| 2400 | 2398 | PORT_INCLUDE( naomi_mie ) |
| 2401 | 2399 | PORT_INCLUDE( naomi_debug ) |
| 2402 | 2400 | |
| 2403 | PORT_START("OUTPUT") | |
| 2404 | PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_OUTPUT) PORT_CHANGED_MEMBER(DEVICE_SELF, naomi_state,naomi_mp_w, NULL) | |
| 2401 | PORT_START("P1") /* inputs are all there, it needs a mux write mechanism of some sort ... */ | |
| 2402 | PORT_DIPNAME( 0x0100, 0x0000, "SYSA" ) | |
| 2403 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) | |
| 2404 | PORT_DIPSETTING( 0x0100, DEF_STR( On ) ) | |
| 2405 | PORT_DIPNAME( 0x0200, 0x0000, DEF_STR( Unknown ) ) | |
| 2406 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) | |
| 2407 | PORT_DIPSETTING( 0x0200, DEF_STR( On ) ) | |
| 2408 | PORT_DIPNAME( 0x0400, 0x0000, DEF_STR( Unknown ) ) | |
| 2409 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) | |
| 2410 | PORT_DIPSETTING( 0x0400, DEF_STR( On ) ) | |
| 2411 | PORT_DIPNAME( 0x0800, 0x0000, DEF_STR( Unknown ) ) | |
| 2412 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) | |
| 2413 | PORT_DIPSETTING( 0x0800, DEF_STR( On ) ) | |
| 2414 | PORT_DIPNAME( 0x1000, 0x0000, DEF_STR( Unknown ) ) | |
| 2415 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) | |
| 2416 | PORT_DIPSETTING( 0x1000, DEF_STR( On ) ) | |
| 2417 | PORT_DIPNAME( 0x2000, 0x0000, DEF_STR( Unknown ) ) | |
| 2418 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) | |
| 2419 | PORT_DIPSETTING( 0x2000, DEF_STR( On ) ) | |
| 2420 | PORT_DIPNAME( 0x4000, 0x0000, DEF_STR( Unknown ) ) | |
| 2421 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) | |
| 2422 | PORT_DIPSETTING( 0x4000, DEF_STR( On ) ) | |
| 2423 | PORT_DIPNAME( 0x8000, 0x0000, DEF_STR( Unknown ) ) | |
| 2424 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) | |
| 2425 | PORT_DIPSETTING( 0x8000, DEF_STR( On ) ) | |
| 2405 | 2426 | |
| 2406 | PORT_START("P1") | |
| 2407 | PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, naomi_state,naomi_mp_r, "KEY1\0KEY2\0KEY3\0KEY4\0KEY5") | |
| 2408 | PORT_BIT( 0x00ff, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 2427 | PORT_START("KEY1") | |
| 2428 | PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED ) //TODO: mahjong panel test & service buttons are presumably here | |
| 2409 | 2429 | |
| 2410 | PORT_START("KEY1") | |
| 2411 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 2412 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 2413 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 2414 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_MAHJONG_FLIP_FLOP ) | |
| 2415 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 2416 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 2417 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 2418 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_MAHJONG_LAST_CHANCE ) | |
| 2419 | 2430 | PORT_START("KEY2") |
| 2420 | 2431 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 2421 | 2432 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START1 ) |
| r243192 | r243193 | |
| 2427 | 2438 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_MAHJONG_A ) |
| 2428 | 2439 | PORT_START("KEY3") |
| 2429 | 2440 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 2430 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_ | |
| 2441 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 2431 | 2442 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_REACH ) |
| 2432 | 2443 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_MAHJONG_N ) |
| 2433 | 2444 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_MAHJONG_J ) |
| r243192 | r243193 | |
| 2454 | 2465 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_MAHJONG_D ) |
| 2455 | 2466 | INPUT_PORTS_END |
| 2456 | 2467 | |
| 2457 | static INPUT_PORTS_START( suchie3 ) | |
| 2458 | PORT_INCLUDE( naomi_mp ) | |
| 2459 | PORT_MODIFY("P1") | |
| 2460 | PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, naomi_state,naomi_mp_r, "KEY5\0KEY2\0KEY3\0KEY4\0KEY1") | |
| 2461 | INPUT_PORTS_END | |
| 2462 | ||
| 2463 | 2468 | // Atomiswave - inputs are read as standard Dreamcast controllers. |
| 2464 | 2469 | // Controller bit patterns: |
| 2465 | 2470 | // |
| r243192 | r243193 | |
| 2618 | 2623 | MACHINE_CONFIG_END |
| 2619 | 2624 | |
| 2620 | 2625 | static MACHINE_CONFIG_DERIVED( naomi_base, naomi_aw_base ) |
| 2621 | MCFG_MIE_ADD("mie", | |
| 2626 | MCFG_MIE_ADD("mie", 4000000, "maple_dc", 0, 0, 0, 0, ":MIE.3", 0, ":MIE.5", 0, 0) // Actual frequency unknown | |
| 2622 | 2627 | MCFG_SEGA_837_13551_DEVICE_ADD("837_13551", "mie", ":TILT", ":P1", ":P2", ":A0", ":A1", ":A2", ":A3", ":A4", ":A5", ":A6", ":A7", ":OUTPUT") |
| 2623 | 2628 | MCFG_EEPROM_SERIAL_93C46_8BIT_ADD("mie_eeprom") |
| 2624 | 2629 | |
| r243192 | r243193 | |
| 2646 | 2651 | */ |
| 2647 | 2652 | |
| 2648 | 2653 | static MACHINE_CONFIG_DERIVED( naomim1, naomi_base ) |
| 2649 | MCFG_NAOMI_M1_BOARD_ADD("rom_board", "naomibd_eeprom", ":boardid", WRITE8(dc_state, g1_irq)) | |
| 2654 | MCFG_NAOMI_M1_BOARD_ADD("rom_board", ":rom_key", "naomibd_eeprom", ":boardid", WRITE8(dc_state, g1_irq)) | |
| 2650 | 2655 | MACHINE_CONFIG_END |
| 2651 | 2656 | |
| 2652 | 2657 | /* |
| r243192 | r243193 | |
| 2654 | 2659 | */ |
| 2655 | 2660 | |
| 2656 | 2661 | static MACHINE_CONFIG_DERIVED( naomim2, naomi_base ) |
| 2657 | MCFG_NAOMI_M2_BOARD_ADD("rom_board", "naomibd_eeprom", ":boardid", WRITE8(dc_state, g1_irq)) | |
| 2662 | MCFG_NAOMI_M2_BOARD_ADD("rom_board", ":rom_key", "naomibd_eeprom", ":boardid", WRITE8(dc_state, g1_irq)) | |
| 2658 | 2663 | MACHINE_CONFIG_END |
| 2659 | 2664 | |
| 2660 | 2665 | /* |
| r243192 | r243193 | |
| 3097 | 3102 | ROM_LOAD("mpr-23208.ic11", 0x5800000, 0x0800000, CRC(b9494f4b) SHA1(2f35b25edf5210a82d4b67e639eeae11440d065a) ) |
| 3098 | 3103 | ROM_LOAD("mpr-23209.ic12s",0x6000000, 0x0800000, CRC(560188c0) SHA1(77f14c9a031c6e5414ffa854d20c40115361d715) ) |
| 3099 | 3104 | |
| 3100 | // 841-0012 2000 317-5060-COM Naomi | |
| 3101 | ROM_PARAMETER( "rom_board:segam2crypt:key", "000e2010" ) | |
| 3105 | ROM_REGION( 4, "rom_key", 0 ) | |
| 3106 | ROM_LOAD( "cspike-key.bin", 0, 4, CRC(a3e9c6d0) SHA1(c098eae7aee716fbdca39f0eb1f55bd54d398394) ) | |
| 3102 | 3107 | ROM_END |
| 3103 | 3108 | |
| 3104 | 3109 | /* |
| r243192 | r243193 | |
| 3141 | 3146 | ROM_LOAD( "mpr-23509.ic6", 0x5800000, 0x1000000, CRC(281d633d) SHA1(d773be8e95f7bf9212ee1061f3076220d4fce9e0) ) |
| 3142 | 3147 | ROM_LOAD( "mpr-23510.ic7", 0x6800000, 0x1000000, CRC(b856fef5) SHA1(0634f86740c438b40286256a0269570d24cb845a) ) |
| 3143 | 3148 | |
| 3144 | // 841-0011 2000 317-5059-COM Naomi | |
| 3145 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "00000000" ) | |
| 3149 | ROM_REGION( 4, "rom_key", 0 ) | |
| 3150 | ROM_LOAD( "capsnk-key.bin", 0, 4, CRC(2144df1c) SHA1(9069ca78e7450a285173431b3e52c5c25299e473) ) | |
| 3146 | 3151 | ROM_END |
| 3147 | 3152 | |
| 3148 | 3153 | // ver 000804 |
| r243192 | r243193 | |
| 3160 | 3165 | ROM_LOAD( "mpr-23509.ic6", 0x5800000, 0x1000000, CRC(281d633d) SHA1(d773be8e95f7bf9212ee1061f3076220d4fce9e0) ) |
| 3161 | 3166 | ROM_LOAD( "mpr-23510.ic7", 0x6800000, 0x1000000, CRC(b856fef5) SHA1(0634f86740c438b40286256a0269570d24cb845a) ) |
| 3162 | 3167 | |
| 3163 | // 841-0011 2000 317-5059-COM Naomi | |
| 3164 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "00000000" ) | |
| 3168 | ROM_REGION( 4, "rom_key", 0 ) | |
| 3169 | ROM_LOAD( "capsnk-key.bin", 0, 4, CRC(2144df1c) SHA1(9069ca78e7450a285173431b3e52c5c25299e473) ) | |
| 3165 | 3170 | ROM_END |
| 3166 | 3171 | |
| 3167 | 3172 | // ver 000802 |
| r243192 | r243193 | |
| 3179 | 3184 | ROM_LOAD( "mpr-23509.ic6", 0x5800000, 0x1000000, CRC(281d633d) SHA1(d773be8e95f7bf9212ee1061f3076220d4fce9e0) ) |
| 3180 | 3185 | ROM_LOAD( "mpr-23510.ic7", 0x6800000, 0x1000000, CRC(b856fef5) SHA1(0634f86740c438b40286256a0269570d24cb845a) ) |
| 3181 | 3186 | |
| 3182 | // 841-0011 2000 317-5059-COM Naomi | |
| 3183 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "00000000" ) | |
| 3187 | ROM_REGION( 4, "rom_key", 0 ) | |
| 3188 | ROM_LOAD( "capsnk-key.bin", 0, 4, CRC(2144df1c) SHA1(9069ca78e7450a285173431b3e52c5c25299e473) ) | |
| 3184 | 3189 | ROM_END |
| 3185 | 3190 | |
| 3186 | 3191 | /* |
| r243192 | r243193 | |
| 3220 | 3225 | ROM_LOAD("mpr-23426.ic7", 0x3800000, 0x0800000, CRC(7f91b13f) SHA1(2d534f77291ebfedc011bf0e803a1b9243fb477f) ) |
| 3221 | 3226 | ROM_LOAD("mpr-23427.ic8", 0x4000000, 0x0800000, CRC(5851d525) SHA1(1cb1073542d75a3bcc0d363ed31d49bcaf1fd494) ) |
| 3222 | 3227 | |
| 3223 | // 840-0044 2000 317-0289-COM Naomi | |
| 3224 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "08103347" ) | |
| 3228 | ROM_REGION( 4, "rom_key", 0 ) | |
| 3229 | ROM_LOAD( "csmash-key.bin", 0, 4, CRC(21b1cd6f) SHA1(a74eef5e3475cc6952f4ffe31579769a854b62a9) ) | |
| 3225 | 3230 | ROM_END |
| 3226 | 3231 | |
| 3227 | 3232 | ROM_START( csmasho ) |
| r243192 | r243193 | |
| 3239 | 3244 | ROM_LOAD("mpr-23426.ic7", 0x3800000, 0x0800000, CRC(7f91b13f) SHA1(2d534f77291ebfedc011bf0e803a1b9243fb477f) ) |
| 3240 | 3245 | ROM_LOAD("mpr-23427.ic8", 0x4000000, 0x0800000, CRC(5851d525) SHA1(1cb1073542d75a3bcc0d363ed31d49bcaf1fd494) ) |
| 3241 | 3246 | |
| 3242 | // 840-0044 2000 317-0289-COM Naomi | |
| 3243 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "08103347" ) | |
| 3247 | ROM_REGION( 4, "rom_key", 0 ) | |
| 3248 | ROM_LOAD( "csmasho-key.bin", 0, 4, CRC(21b1cd6f) SHA1(a74eef5e3475cc6952f4ffe31579769a854b62a9) ) | |
| 3244 | 3249 | ROM_END |
| 3245 | 3250 | |
| 3246 | 3251 | /* |
| r243192 | r243193 | |
| 3269 | 3274 | ROM_LOAD("mpr-23522.ic9", 0x4800000, 0x0800000, CRC(7ae6716e) SHA1(658b794ae6e3898885524582a207faa1076a65ca) ) |
| 3270 | 3275 | ROM_LOAD("mpr-23523.ic10",0x5000000, 0x0800000, CRC(c91efb67) SHA1(3d79870551310da7a641858ffec3840714e9cc22) ) |
| 3271 | 3276 | |
| 3272 | // 841-0016 2000 317-5066-COM Naomi | |
| 3273 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "000b64d0" ) | |
| 3277 | ROM_REGION( 4, "rom_key", 0 ) | |
| 3278 | ROM_LOAD( "deathcox-key.bin", 0, 4, CRC(aa534c8a) SHA1(fcc45e477c646b51afe7c4168d7246964a1f23b5) ) | |
| 3274 | 3279 | ROM_END |
| 3275 | 3280 | |
| 3276 | 3281 | /* |
| r243192 | r243193 | |
| 3335 | 3340 | ROM_LOAD("mpr-22119.ic20s",0xa000000, 0x0800000, CRC(d608fa86) SHA1(54c8107cccec8cbb536f13cda5b220b7972190b7) ) |
| 3336 | 3341 | ROM_LOAD("mpr-22120.ic21s",0xa800000, 0x0800000, CRC(a30facb4) SHA1(70415ca34095c795297486bce1f956f6a8d4817f) ) |
| 3337 | 3342 | |
| 3338 | // 841-0003 1999 317-5048-COM Naomi | |
| 3339 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "0008ad01" ) | |
| 3343 | ROM_REGION( 4, "rom_key", 0 ) | |
| 3344 | ROM_LOAD( "doa2-key.bin", 0, 4, CRC(43f97c96) SHA1(7d1e6fcca3ca936f33d59d57834c3e4ff74f587d) ) | |
| 3340 | 3345 | |
| 3341 | 3346 | // on-cart X76F100 eeprom contents |
| 3342 | 3347 | ROM_REGION( 0x84, "naomibd_eeprom", 0 ) |
| r243192 | r243193 | |
| 3407 | 3412 | ROM_LOAD("mpr-22119.ic20s",0xa000000, 0x0800000, CRC(d608fa86) SHA1(54c8107cccec8cbb536f13cda5b220b7972190b7) ) |
| 3408 | 3413 | ROM_LOAD("mpr-22120.ic21s",0xa800000, 0x0800000, CRC(a30facb4) SHA1(70415ca34095c795297486bce1f956f6a8d4817f) ) |
| 3409 | 3414 | |
| 3410 | // 841-0003 1999 317-5048-COM Naomi | |
| 3411 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "0008ad01" ) | |
| 3415 | ROM_REGION( 4, "rom_key", 0 ) | |
| 3416 | ROM_LOAD( "doa2m-key.bin", 0, 4, CRC(43f97c96) SHA1(7d1e6fcca3ca936f33d59d57834c3e4ff74f587d) ) | |
| 3412 | 3417 | |
| 3413 | 3418 | // on-cart X76F100 eeprom contents |
| 3414 | 3419 | ROM_REGION( 0x84, "naomibd_eeprom", 0 ) |
| r243192 | r243193 | |
| 3464 | 3469 | ROM_LOAD("mpr-22097.ic13s", 0x6800000, 0x0800000, CRC(f1dedac5) SHA1(9d4499cbafe80dd0b36be617de7994a96e1e9a01) ) |
| 3465 | 3470 | ROM_LOAD("mpr-22098.ic14s", 0x7000000, 0x0800000, CRC(f9824d2e) SHA1(f20f8cc2b1bef9077ede1cb874da8f2a335d39de) ) |
| 3466 | 3471 | |
| 3467 | // 840-0016 1999 317-0262-JPN Naomi | |
| 3468 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "080fee35" ) | |
| 3472 | ROM_REGION( 4, "rom_key", 0 ) | |
| 3473 | ROM_LOAD( "derbyoc-key.bin", 0, 4, CRC(bc568260) SHA1(6dc4923a730bc0380490519c82f1443226365c3a) ) | |
| 3469 | 3474 | ROM_END |
| 3470 | 3475 | |
| 3471 | 3476 | ROM_START( derbyocw ) |
| r243192 | r243193 | |
| 3482 | 3487 | ROM_LOAD( "mpr-22337.ic6", 0x5800000, 0x1000000, CRC(87ca3a2f) SHA1(2ffc01597107eb60dfa7aa49d51f203b51a44334) ) |
| 3483 | 3488 | ROM_LOAD( "mpr-22338.ic7", 0x6800000, 0x1000000, CRC(4bda7303) SHA1(db27d91ef811d741cfdb5c0196e61be722c2f5bd) ) |
| 3484 | 3489 | |
| 3485 | ROM_ | |
| 3490 | ROM_REGION( 4, "rom_key", ROMREGION_ERASE00 ) | |
| 3486 | 3491 | ROM_END |
| 3487 | 3492 | |
| 3488 | 3493 | ROM_START( drbyocwc ) |
| r243192 | r243193 | |
| 3499 | 3504 | ROM_LOAD( "mpr-22333.ic6", 0x5800000, 0x1000000, CRC(96f324aa) SHA1(bc41e2097c1841771d786ba9ad1a31df1494a856) ) |
| 3500 | 3505 | ROM_LOAD( "mpr-22334.ic7", 0x6800000, 0x1000000, CRC(5389b05a) SHA1(e206e4d82d7b1a59c33043ec0812eb69be08d9b3) ) |
| 3501 | 3506 | |
| 3502 | ROM_ | |
| 3507 | ROM_REGION( 4, "rom_key", ROMREGION_ERASE00 ) | |
| 3503 | 3508 | ROM_END |
| 3504 | 3509 | |
| 3505 | 3510 | /* |
| r243192 | r243193 | |
| 3527 | 3532 | ROM_LOAD( "mpr-22304.ic10", 0x9800000, 0x1000000, CRC(46c1fb1f) SHA1(6daca76a75df3501f77e473eb065d48804fcc64a) ) |
| 3528 | 3533 | ROM_LOAD( "mpr-22305.ic11", 0xa800000, 0x1000000, CRC(027d0e7b) SHA1(e3c874e60cabb6f9ce686696d9055a0c0d5289ae) ) |
| 3529 | 3534 | |
| 3530 | ROM_ | |
| 3535 | ROM_REGION( 4, "rom_key", ROMREGION_ERASE00 ) | |
| 3531 | 3536 | ROM_END |
| 3532 | 3537 | |
| 3533 | 3538 | /* |
| r243192 | r243193 | |
| 3606 | 3611 | ROM_LOAD("mpr-21573.ic20s", 0xa000000, 0x0800000, CRC(5d822e63) SHA1(8412980b288531c294d5cf9a6394aa0b9503d7df) ) |
| 3607 | 3612 | ROM_LOAD("mpr-21574.ic21s", 0xa800000, 0x0800000, CRC(d794a42c) SHA1(a79c7818c6ec993e718494b1d5407eb270a29abe) ) |
| 3608 | 3613 | |
| 3609 | // 840-0001 1998 317-0246-JPN Naomi | |
| 3610 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "080e6ae1" ) | |
| 3614 | ROM_REGION( 4, "rom_key", 0 ) | |
| 3615 | ROM_LOAD( "dybbnao-key.bin", 0, 4, CRC(63c5a3d5) SHA1(e813197f84dc6bb50b436f8e710d14d77a84e0ec) ) | |
| 3611 | 3616 | ROM_END |
| 3612 | 3617 | |
| 3613 | 3618 | /* |
| r243192 | r243193 | |
| 3670 | 3675 | ROM_LOAD("mpr-22139.ic18s", 0x9000000, 0x0800000, CRC(92faa2ca) SHA1(4953f0219c3ae62de0a89473cb7b9dd30b33fcfb) ) |
| 3671 | 3676 | ROM_LOAD("mpr-22140.ic19s", 0x9800000, 0x0800000, CRC(4cb54893) SHA1(a99b39cc3c82c3cf90f794bb8c8ba60638a6f921) ) |
| 3672 | 3677 | |
| 3673 | // 840-0019 1999 317-0269-JPN Naomi | |
| 3674 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "0804ae71" ) | |
| 3678 | ROM_REGION( 4, "rom_key", 0 ) | |
| 3679 | ROM_LOAD( "dybb99-key.bin", 0, 4, CRC(90263797) SHA1(83649c8b3e562bee1f08663e59c5ba8f404ed36c) ) | |
| 3675 | 3680 | ROM_END |
| 3676 | 3681 | |
| 3677 | 3682 | ROM_START( smlg99 ) |
| r243192 | r243193 | |
| 3703 | 3708 | ROM_LOAD( "mpr-22057.ic20s", 0xa000000, 0x800000, CRC(a056c109) SHA1(637e80c2d605851265430b0fa771a4ad5233be8a) ) |
| 3704 | 3709 | ROM_LOAD( "mpr-22058.ic21s", 0xa800000, 0x800000, CRC(f16edaa0) SHA1(e093f5594df43c592a9acd45002ecc65035c2435) ) |
| 3705 | 3710 | |
| 3706 | // 840-0012 1999 317-0259-COM Naomi | |
| 3707 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "08048a01" ) | |
| 3711 | ROM_REGION( 4, "rom_key", 0 ) | |
| 3712 | ROM_LOAD( "smlg99-key.bin", 0, 4, CRC(90263797) SHA1(83649c8b3e562bee1f08663e59c5ba8f404ed36c) ) | |
| 3708 | 3713 | ROM_END |
| 3709 | 3714 | |
| 3710 | 3715 | /* |
| r243192 | r243193 | |
| 3745 | 3750 | ROM_LOAD("mpr-21900.ic20s", 0xa000000, 0x0800000, CRC(81901130) SHA1(1573b5c4360e29ba1a4b4901af49d5399fa1e635) ) |
| 3746 | 3751 | ROM_LOAD("mpr-21901.ic21s", 0xa800000, 0x0800000, CRC(266a3eea) SHA1(795ecc5589a0152b9cf1e03e454ed1ea01501942) ) |
| 3747 | 3752 | |
| 3748 | // 834-13842 1999 317-0254-COM Naomi | |
| 3749 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "080e8f84" ) | |
| 3753 | ROM_REGION( 4, "rom_key", 0 ) | |
| 3754 | ROM_LOAD( "f355-key.bin", 0, 4, CRC(7d1431ab) SHA1(38958860241c600db941b47294bf3ca3273d0df5) ) | |
| 3750 | 3755 | |
| 3751 | 3756 | ROM_REGION( 0x10000, "drivebd", 0 ) /* drive board ROM */ |
| 3752 | 3757 | ROM_LOAD( "epr-21867.bin", 0x000000, 0x010000, CRC(4f93a2a0) SHA1(875907e7fcfc44850e2c60c12268ac61c742f217) ) |
| r243192 | r243193 | |
| 3780 | 3785 | ROM_LOAD( "mpr-22846.ic20s", 0xa000000, 0x800000, CRC(d4148f39) SHA1(b6598ce52bcaa42805c581de326c953d27c1b2b4) ) |
| 3781 | 3786 | ROM_LOAD( "mpr-22847.ic21s", 0xa800000, 0x800000, CRC(955ad42e) SHA1(e396ca02b5786557434632c4fac56af3a4a9f8ce) ) |
| 3782 | 3787 | |
| 3783 | // 834-13950 1999 317-0267-COM Naomi | |
| 3784 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "0806efd4" ) | |
| 3788 | ROM_REGION( 4, "rom_key", 0 ) | |
| 3789 | ROM_LOAD( "f355twin-key.bin", 0, 4, CRC(7d915a40) SHA1(ea441c10673b79237a4e7368948cfad31ed45a26) ) | |
| 3785 | 3790 | ROM_END |
| 3786 | 3791 | |
| 3787 | 3792 | // There is also a development cart (171-7885A). Content is the same. |
| r243192 | r243193 | |
| 3813 | 3818 | ROM_LOAD( "mpr-23397.ic20s", 0xa000000, 0x800000, CRC(28d2caf6) SHA1(67a3bc19abccf7f211c3aae67e751815857bd564) ) |
| 3814 | 3819 | ROM_LOAD( "mpr-23398.ic21s", 0xa800000, 0x800000, CRC(ea4d4d2a) SHA1(3dc9c7164516ae7f3b988c088ab819d8fd40d75e) ) |
| 3815 | 3820 | |
| 3816 | // 840-0042 2001 317-0287-COM Naomi | |
| 3817 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "081666c6" ) | |
| 3821 | ROM_REGION( 4, "rom_key", 0 ) | |
| 3822 | ROM_LOAD( "f355twn2-key.bin", 0, 4, CRC(784fab7a) SHA1(5d9687876b390d35309c0b1404f5717daa533286) ) | |
| 3818 | 3823 | ROM_END |
| 3819 | 3824 | |
| 3820 | 3825 | ROM_START( alpiltdx ) |
| r243192 | r243193 | |
| 3835 | 3840 | ROM_LOAD( "mpr-21737.ic10", 0x5000000, 0x800000, CRC(260aaa98) SHA1(d1082587afe9d79f286df8b107a553ee51c27643) ) |
| 3836 | 3841 | ROM_LOAD( "mpr-21738.ic11", 0x5800000, 0x800000, CRC(95a592e8) SHA1(862dce467e8805381bab001df68262f1baf3c498) ) |
| 3837 | 3842 | |
| 3838 | // 834-????? 1999 317-0251-COM Naomi | |
| 3839 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "08070e41" ) | |
| 3843 | ROM_REGION( 4, "rom_key", 0 ) | |
| 3844 | ROM_LOAD( "alpiltdx-key.bin", 0, 4, CRC(bb539511) SHA1(dea206e7db23fdabf7b957104ddd1499eff509ff) ) | |
| 3840 | 3845 | |
| 3841 | 3846 | // on-cart X76F100 eeprom contents |
| 3842 | 3847 | ROM_REGION( 0x84, "naomibd_eeprom", 0 ) |
| r243192 | r243193 | |
| 3861 | 3866 | ROM_LOAD( "mpr-21737.ic10", 0x5000000, 0x800000, CRC(260aaa98) SHA1(d1082587afe9d79f286df8b107a553ee51c27643) ) |
| 3862 | 3867 | ROM_LOAD( "mpr-21738.ic11", 0x5800000, 0x800000, CRC(95a592e8) SHA1(862dce467e8805381bab001df68262f1baf3c498) ) |
| 3863 | 3868 | |
| 3864 | // 840-0005 1999 317-0251-COM Naomi | |
| 3865 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "08070e41" ) | |
| 3869 | ROM_REGION( 4, "rom_key", 0 ) | |
| 3870 | ROM_LOAD( "alpilota-key.bin", 0, 4, CRC(bb539511) SHA1(dea206e7db23fdabf7b957104ddd1499eff509ff) ) | |
| 3866 | 3871 | ROM_END |
| 3867 | 3872 | |
| 3868 | 3873 | ROM_START( hotd2 ) |
| r243192 | r243193 | |
| 3896 | 3901 | ROM_LOAD( "mpr-21404.ic19s", 0x9800000, 0x800000, CRC(6cf6e705) SHA1(68d7e9becefe27b556e0c5d7ba00efd2d1fb71ca) ) |
| 3897 | 3902 | ROM_LOAD( "mpr-21405.ic20s", 0xa000000, 0x800000, CRC(495e6265) SHA1(57936367fec0000691641525682fb8aefc4e4f56) ) |
| 3898 | 3903 | |
| 3899 | ROM_ | |
| 3904 | ROM_REGION( 4, "rom_key", ROMREGION_ERASE00 ) | |
| 3900 | 3905 | ROM_END |
| 3901 | 3906 | |
| 3902 | 3907 | ROM_START( hotd2o ) |
| r243192 | r243193 | |
| 3930 | 3935 | ROM_LOAD( "mpr-21404.ic19s", 0x9800000, 0x800000, CRC(6cf6e705) SHA1(68d7e9becefe27b556e0c5d7ba00efd2d1fb71ca) ) |
| 3931 | 3936 | ROM_LOAD( "mpr-21405.ic20s", 0xa000000, 0x800000, CRC(495e6265) SHA1(57936367fec0000691641525682fb8aefc4e4f56) ) |
| 3932 | 3937 | |
| 3933 | ROM_ | |
| 3938 | ROM_REGION( 4, "rom_key", ROMREGION_ERASE00 ) | |
| 3934 | 3939 | ROM_END |
| 3935 | 3940 | |
| 3936 | 3941 | ROM_START( hotd2p ) |
| r243192 | r243193 | |
| 3964 | 3969 | ROM_LOAD( "mpr-21404.ic19s", 0x9800000, 0x800000, CRC(6cf6e705) SHA1(68d7e9becefe27b556e0c5d7ba00efd2d1fb71ca) ) |
| 3965 | 3970 | ROM_LOAD( "mpr-21405.ic20s", 0xa000000, 0x800000, CRC(495e6265) SHA1(57936367fec0000691641525682fb8aefc4e4f56) ) |
| 3966 | 3971 | |
| 3967 | ROM_ | |
| 3972 | ROM_REGION( 4, "rom_key", ROMREGION_ERASE00 ) | |
| 3968 | 3973 | ROM_END |
| 3969 | 3974 | |
| 3970 | 3975 | /* |
| r243192 | r243193 | |
| 3999 | 4004 | ROM_LOAD("mpr-21830.ic10", 0x5000000, 0x0800000, CRC(e01ceb86) SHA1(dd5703d7712cfc0053bddfff63e78dda372b6ff2) ) |
| 4000 | 4005 | ROM_LOAD("mpr-21831.ic11", 0x5800000, 0x0800000, CRC(751848d0) SHA1(9c2267fd3c6f9ea5f2679bb2ca20d511a49b2845) ) |
| 4001 | 4006 | |
| 4002 | // 840-0007 1999 317-0253-JPN Naomi | |
| 4003 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "08074a61" ) | |
| 4007 | ROM_REGION( 4, "rom_key", 0 ) | |
| 4008 | ROM_LOAD( "ggram2-key.bin", 0, 4, CRC(14283fd8) SHA1(c928382e512e9fb685436020f88b8245b7c60d41) ) | |
| 4004 | 4009 | ROM_END |
| 4005 | 4010 | |
| 4006 | 4011 | /* |
| r243192 | r243193 | |
| 4067 | 4072 | |
| 4068 | 4073 | ROM_COPY( "rom_board", 0x1000000, 0x400000, 0xc00000 ) |
| 4069 | 4074 | |
| 4070 | // 840-0039 2000 | |
| 4071 | ROM_PARAMETER( ":rom_board:key", "3f5c807f" ) | |
| 4075 | ROM_REGION( 4, "rom_key", 0 ) | |
| 4076 | ROM_LOAD( "gram2000-key.bin", 0, 4, CRC(179314d9) SHA1(3dbbc04e9ff62800d08c4a239af3a83252a28dc0) ) | |
| 4072 | 4077 | ROM_END |
| 4073 | 4078 | |
| 4074 | 4079 | ROM_START( tduno ) |
| r243192 | r243193 | |
| 4089 | 4094 | ROM_REGION( 0x84, "naomibd_eeprom", 0 ) |
| 4090 | 4095 | ROM_LOAD( "x76f100.ic37", 0x000000, 0x000084, CRC(c79251d5) SHA1(3e70bbbb6d28bade7eec7e27d716463045656f98) ) |
| 4091 | 4096 | |
| 4092 | // 840-0008 1999 317-0255-JPN Naomi | |
| 4093 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "08028ea5" ) | |
| 4097 | ROM_REGION( 4, "rom_key", 0 ) | |
| 4098 | ROM_LOAD( "tduno.key", 0x000000, 0x000004, CRC(217ce9d0) SHA1(39d71a84b2769cd0c1521ddf1c617c18f577020c) ) | |
| 4094 | 4099 | ROM_END |
| 4095 | 4100 | |
| 4096 | 4101 | ROM_START( tduno2 ) |
| r243192 | r243193 | |
| 4109 | 4114 | |
| 4110 | 4115 | ROM_COPY( "rom_board", 0x1000000, 0x400000, 0xc00000 ) |
| 4111 | 4116 | |
| 4112 | // 840-0022 2000 | |
| 4113 | ROM_PARAMETER( ":rom_board:key", "2f6f0f8d" ) | |
| 4117 | ROM_REGION( 4, "rom_key", 0 ) | |
| 4118 | ROM_LOAD( "tduno2.key", 0x000000, 0x000004, CRC(8e0f0f3b) SHA1(914d3db8746c806d559539cc0851169161d32c04) ) | |
| 4114 | 4119 | ROM_END |
| 4115 | 4120 | |
| 4116 | 4121 | ROM_START( mtkob2 ) |
| r243192 | r243193 | |
| 4128 | 4133 | |
| 4129 | 4134 | ROM_COPY( "rom_board", 0x1000000, 0x400000, 0xc00000 ) |
| 4130 | 4135 | |
| 4131 | // 840-0150 2003 | |
| 4132 | ROM_PARAMETER( ":rom_board:key", "3892fb3a" ) | |
| 4136 | ROM_REGION( 4, "rom_key", 0 ) | |
| 4137 | ROM_LOAD( "mtkob2-key.bin", 0x000000, 0x000004, CRC(db088208) SHA1(14d65ad2555183a445abcd93907c85df4032b41d) ) | |
| 4133 | 4138 | ROM_END |
| 4134 | 4139 | |
| 4135 | 4140 | ROM_START( mushi2k5 ) |
| r243192 | r243193 | |
| 4146 | 4151 | ROM_LOAD( "mpr-24281.ic6", 0x5800000, 0x1000000, CRC(39133c32) SHA1(09ea8c1a98ba0fac36e18ae14ed5302feaeb89ca) ) |
| 4147 | 4152 | ROM_LOAD( "mpr-24282.ic7", 0x6800000, 0x1000000, CRC(9aa4ad5a) SHA1(2d81f99a579477c5db725f71c51f18afc15abce7) ) |
| 4148 | 4153 | |
| 4149 | ROM_ | |
| 4154 | ROM_REGION( 4, "rom_key", ROMREGION_ERASE00 ) | |
| 4150 | 4155 | ROM_END |
| 4151 | 4156 | |
| 4152 | 4157 | ROM_START( crackndj ) |
| r243192 | r243193 | |
| 4166 | 4171 | ROM_LOAD( "mpr-23533.ic9", 0x8800000, 0x1000000, CRC(fc909c00) SHA1(9cf22a97ea272c4586f3942aefdb803bd0e6ede7) ) |
| 4167 | 4172 | ROM_LOAD( "mpr-23534.ic10", 0x9800000, 0x1000000, CRC(62ed85b6) SHA1(b88336bc6115c92a839981cb0c0d0a67b1f7eda5) ) |
| 4168 | 4173 | |
| 4169 | // 840-0043 2000 317-0288-COM Naomi | |
| 4170 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "081c2347" ) | |
| 4174 | ROM_REGION( 4, "rom_key", 0 ) | |
| 4175 | ROM_LOAD( "crackndj-key.bin", 0, 4, CRC(6269265a) SHA1(e2ab31b0058eb130d8f54d30e86d569687f9a068) ) | |
| 4171 | 4176 | ROM_END |
| 4172 | 4177 | |
| 4173 | 4178 | ROM_START( crakndj2 ) |
| r243192 | r243193 | |
| 4200 | 4205 | ROM_LOAD( "rom19.ic19s", 0x9800000, 0x800000, CRC(31f816ba) SHA1(354f8271eef20eb131f83fb9641002cfcd31c8cd) ) |
| 4201 | 4206 | ROM_LOAD( "rom20.ic20s", 0xa000000, 0x800000, CRC(aabcd580) SHA1(9455e218ab381c7ad5adb2884da39ca7948169d5) ) |
| 4202 | 4207 | |
| 4203 | // 840-0068 2001 317-0311-COM Naomi | |
| 4204 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "08428247" ) | |
| 4208 | ROM_REGION( 4, "rom_key", 0 ) // 317-0311-COM | |
| 4209 | ROM_LOAD( "crackndj2-key.bin", 0x000000, 0x000004, CRC(b357a848) SHA1(15b5f89583ec2bc65298387a2b8d8e60e71f1617) ) | |
| 4205 | 4210 | ROM_END |
| 4206 | 4211 | |
| 4207 | 4212 | ROM_START( samba2k ) |
| r243192 | r243193 | |
| 4222 | 4227 | ROM_LOAD( "mpr-23598.ic10", 0x09800000, 0x1000000, CRC(e06ee3dd) SHA1(21985e45e1ab5e3a79dd52492a582324a1a36d56) ) |
| 4223 | 4228 | ROM_LOAD( "mpr-23599.ic11", 0x0a800000, 0x1000000, CRC(1fd2e792) SHA1(6f299e527be529f85d0e8b4ce0e7a06ac0d25fe9) ) |
| 4224 | 4229 | |
| 4225 | // 840-0047 2000 317-0295-COM Naomi | |
| 4226 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "081702cf" ) | |
| 4230 | ROM_REGION( 4, "rom_key", 0 ) | |
| 4231 | ROM_LOAD( "samba2k-key.bin", 0, 4, CRC(01c0d74a) SHA1(4461cfd761919ba4bc6f1d1839a880f11eaf8d0f) ) | |
| 4227 | 4232 | ROM_END |
| 4228 | 4233 | |
| 4229 | 4234 | ROM_START( alienfnt ) |
| r243192 | r243193 | |
| 4238 | 4243 | ROM_LOAD( "mpr-23584.ic4", 0x3800000, 0x1000000, CRC(8d444756) SHA1(89c480f9ed1239c8ae565c85fa0fd50324264b20) ) |
| 4239 | 4244 | ROM_LOAD( "mpr-23585.ic5", 0x4800000, 0x1000000, CRC(883a6482) SHA1(e3145710df793b7fd67f02707904416210a71978) ) |
| 4240 | 4245 | |
| 4241 | // 840-0048 2001 317-0293-COM Naomi | |
| 4242 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "08174343" ) | |
| 4246 | ROM_REGION( 4, "rom_key", 0 ) | |
| 4247 | ROM_LOAD( "alienfnt-key.bin", 0x000000, 0x000004, CRC(0cac6605) SHA1(7a050f13e3b9a10d6cdb851a8c67006f6548c60a) ) | |
| 4243 | 4248 | ROM_END |
| 4244 | 4249 | |
| 4245 | 4250 | ROM_START( alienfnta ) |
| r243192 | r243193 | |
| 4254 | 4259 | ROM_LOAD( "mpr-23584.ic4", 0x3800000, 0x1000000, CRC(8d444756) SHA1(89c480f9ed1239c8ae565c85fa0fd50324264b20) ) |
| 4255 | 4260 | ROM_LOAD( "mpr-23585.ic5", 0x4800000, 0x1000000, CRC(883a6482) SHA1(e3145710df793b7fd67f02707904416210a71978) ) |
| 4256 | 4261 | |
| 4257 | // 840-0048 2001 317-0293-COM Naomi | |
| 4258 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "08174343" ) | |
| 4262 | ROM_REGION( 4, "rom_key", 0 ) | |
| 4263 | ROM_LOAD( "alienfnt-key.bin", 0x000000, 0x000004, CRC(0cac6605) SHA1(7a050f13e3b9a10d6cdb851a8c67006f6548c60a) ) | |
| 4259 | 4264 | ROM_END |
| 4260 | 4265 | |
| 4261 | 4266 | /* |
| r243192 | r243193 | |
| 4286 | 4291 | ROM_LOAD("mpr-23354.ic13s",0x6800000, 0x0800000, CRC(cea127f7) SHA1(11f12472ebfc93eb72b764c780e30afd4812dbe9) ) |
| 4287 | 4292 | ROM_LOAD("mpr-23355.ic14s",0x7000000, 0x0800000, CRC(e809685f) SHA1(dc052b4eb4fdcfdc22c4807316ce34ee7a0d58a6) ) |
| 4288 | 4293 | |
| 4289 | // 841-0013 2000 317-5063-COM Naomi | |
| 4290 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "00076110" ) | |
| 4294 | ROM_REGION( 4, "rom_key", 0 ) | |
| 4295 | ROM_LOAD( "ggx-key.bin", 0, 4, CRC(455a831b) SHA1(1834fc714224ac990a0677e8925493e92a4b5e5e) ) | |
| 4291 | 4296 | ROM_END |
| 4292 | 4297 | |
| 4293 | 4298 | /* |
| r243192 | r243193 | |
| 4332 | 4337 | ROM_LOAD("mpr-23714.ic10",0x5000000, 0x0800000, CRC(da462c44) SHA1(ca450b6c07f939f96eba7b44c45b4e38abd598aa) ) |
| 4333 | 4338 | ROM_LOAD("mpr-23715.ic11",0x5800000, 0x0800000, CRC(c750abbd) SHA1(2a5bedc2b21cd3f991c7145ccfd8c7a9e7f647ae) ) |
| 4334 | 4339 | |
| 4335 | // HMG016007 2001 317-5071-COM Naomi | |
| 4336 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "00038510" ) | |
| 4340 | ROM_REGION( 4, "rom_key", 0 ) | |
| 4341 | ROM_LOAD( "hmgeo-key.bin", 0, 4, CRC(78411d2f) SHA1(9809ef35406ea48639cf78d5d366069a06a411f0) ) | |
| 4337 | 4342 | ROM_END |
| 4338 | 4343 | |
| 4339 | 4344 | /* |
| r243192 | r243193 | |
| 4371 | 4376 | ROM_LOAD("mpr-22274.ic4", 0x3800000, 0x1000000, CRC(f8daaaf3) SHA1(8854d3f8e3d55715ede33ee918b641e251f752b4) ) |
| 4372 | 4377 | ROM_LOAD("mpr-22275.ic5", 0x4800000, 0x1000000, CRC(61aa1521) SHA1(7d9f5790e72a9151d128ac7887e236526fdf72a0) ) |
| 4373 | 4378 | |
| 4374 | // 841-0014 2000 317-5064-COM Naomi | |
| 4375 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "000b25d0" ) | |
| 4379 | ROM_REGION( 4, "rom_key", 0 ) | |
| 4380 | ROM_LOAD( "gwing2-key.bin", 0, 4, CRC(433132ce) SHA1(27f6e6ba2dd28c777317ff085432c2d43b93a603) ) | |
| 4376 | 4381 | ROM_END |
| 4377 | 4382 | |
| 4378 | 4383 | /* |
| r243192 | r243193 | |
| 4421 | 4426 | ROM_LOAD("mpr-21992.ic13s",0x6800000, 0x0800000, CRC(599a2fb8) SHA1(2a0007064ad2ee1e1a0fda1d5676df4ff19a9f2f) ) |
| 4422 | 4427 | ROM_LOAD("mpr-21993.ic14s",0x7000000, 0x0400000, CRC(fb28cf0a) SHA1(d51b1d4514a93074d1f77bd1bc5995739604cf56) ) |
| 4423 | 4428 | |
| 4424 | // 841-0002 1999 317-5047-JPN Naomi | |
| 4425 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "000368e1" ) | |
| 4429 | ROM_REGION( 4, "rom_key", 0 ) | |
| 4430 | ROM_LOAD( "suchie3-key.bin", 0, 4, CRC(592b5204) SHA1(ba18a5302ea271f58617a9793dfb85a0123080c8) ) | |
| 4426 | 4431 | ROM_END |
| 4427 | 4432 | |
| 4428 | 4433 | /* |
| r243192 | r243193 | |
| 4451 | 4456 | ROM_LOAD("mpr-22071.ic11", 0x5800000, 0x0800000, CRC(1ab1f1ab) SHA1(bb8fa8d5a681115a82e9598ebe599b106f7aae9d) ) |
| 4452 | 4457 | ROM_LOAD("mpr-22072.ic12s",0x6000000, 0x0800000, CRC(cb8d2634) SHA1(03ac8fb3a1acb1f8e32d9325c4da42417752f934) ) |
| 4453 | 4458 | |
| 4454 | // 841-0004 1999 317-5050-JPN Naomi seems not used by game | |
| 4455 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "0") | |
| 4459 | ROM_REGION( 4, "rom_key", ROMREGION_ERASE00 ) | |
| 4456 | 4460 | ROM_END |
| 4457 | 4461 | |
| 4458 | 4462 | /* |
| r243192 | r243193 | |
| 4493 | 4497 | |
| 4494 | 4498 | ROM_COPY( "rom_board", 0x1200000, 0x400000, 0x400000 ) |
| 4495 | 4499 | |
| 4496 | // 841-0007-02 2000 | |
| 4497 | ROM_PARAMETER( ":rom_board:key", "7c6e8bc1" ) | |
| 4500 | ROM_REGION( 4, "rom_key", 0 ) | |
| 4501 | ROM_LOAD( "mvsc2-key.bin", 0, 4, CRC(76f095b4) SHA1(773fd67e1eb471a989b3ee6e969a3d33bf61e779) ) | |
| 4498 | 4502 | ROM_END |
| 4499 | 4503 | |
| 4500 | 4504 | /* toy fighter - 1999 sega */ |
| r243192 | r243193 | |
| 4517 | 4521 | ROM_LOAD("mpr-22033.ic9", 0x4800000, 0x0800000, CRC(5fe5586e) SHA1(3ff41ae1f81469597684faadd88e62b5e0634352) ) |
| 4518 | 4522 | ROM_LOAD("mpr-22034.ic10",0x5000000, 0x0800000, CRC(3aa5ce5e) SHA1(f00a906235e4522d6fc2ac771324114346875314) ) |
| 4519 | 4523 | |
| 4520 | // 840-0011 1999 317-0257-COM Naomi | |
| 4521 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "0802ca85" ) | |
| 4524 | ROM_REGION( 4, "rom_key", 0 ) | |
| 4525 | ROM_LOAD( "toyfight-key.bin", 0, 4, CRC(8e074319) SHA1(b1b88bc57b81c08853d4aa77a5da48e293da4f42) ) | |
| 4522 | 4526 | ROM_END |
| 4523 | 4527 | |
| 4524 | 4528 | /* Crazy Taxi */ |
| r243192 | r243193 | |
| 4542 | 4546 | ROM_LOAD( "mpr-21682.ic14s", 0x7000000, 0x800000, CRC(54c0290e) SHA1(6e07ab6e95c29a2aabed0ba1a7af0d7d605e0309) ) |
| 4543 | 4547 | ROM_LOAD( "mpr-21683.ic15s", 0x7800000, 0x800000, CRC(ac8a27e0) SHA1(8e71d853a102dd6c164d5326e6d157ccfb8c7b36) ) |
| 4544 | 4548 | |
| 4545 | // 840-0002 1999 317-0248-COM Naomi | |
| 4546 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "080d2f45" ) | |
| 4549 | ROM_REGION( 4, "rom_key", 0 ) | |
| 4550 | ROM_LOAD( "crzytaxi-key.bin", 0, 4, CRC(3d36c13d) SHA1(746e82e7f1d6f4629dde00fb6b32943741b6ec70) ) | |
| 4547 | 4551 | ROM_END |
| 4548 | 4552 | |
| 4549 | 4553 | /* Jambo! Safari */ |
| r243192 | r243193 | |
| 4562 | 4566 | ROM_LOAD( "mpr-22824.ic7", 0x3800000, 0x800000, CRC(cc55304a) SHA1(e548d8de83469e5816c55dbbb00afbb894282fd6) ) |
| 4563 | 4567 | ROM_LOAD( "mpr-22825.ic8", 0x4000000, 0x800000, CRC(85bada10) SHA1(b6e15d8f1d6bca12ffa4816ed0393c04ca500fba) ) |
| 4564 | 4568 | |
| 4565 | // 840-0013 1999 317-0264-COM Naomi | |
| 4566 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "080fab95" ) | |
| 4569 | ROM_REGION( 4, "rom_key", 0 ) | |
| 4570 | ROM_LOAD( "jambo-key.bin", 0, 4, CRC(e78e9ac8) SHA1(677d7f21c238e12362ad65d6496f285d688fc3a9) ) | |
| 4567 | 4571 | ROM_END |
| 4568 | 4572 | |
| 4569 | 4573 | /* 18 Wheeler (deluxe) (Rev A) */ |
| r243192 | r243193 | |
| 4594 | 4598 | ROM_LOAD( "mpr-22182.ic19s", 0x9800000, 0x800000, CRC(c5606c42) SHA1(5871104ff1c7acde0493e13b9a4d0abdf8a40728) ) |
| 4595 | 4599 | ROM_LOAD( "mpr-22183.ic20s", 0xa000000, 0x800000, CRC(776af308) SHA1(7d29cb4dce75d34c622549fea7e102868d0da60a) ) |
| 4596 | 4600 | |
| 4597 | // 840-0023 2000 317-0273-COM Naomi | |
| 4598 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "0807cf54" ) | |
| 4601 | ROM_REGION( 4, "rom_key", 0 ) | |
| 4602 | ROM_LOAD( "18wheelr-key.bin", 0, 4, CRC(046f97f5) SHA1(11eb5cffdd67d460718b63ddee8ff4dfa7d72314) ) | |
| 4599 | 4603 | |
| 4600 | 4604 | // JVS I/O board 837-13844, code is for a Z80 of unknown type (it's inside the big Sega ASIC) |
| 4601 | 4605 | ROM_REGION( 0x20000, "jvsio", ROMREGION_ERASEFF) |
| r243192 | r243193 | |
| 4636 | 4640 | ROM_LOAD( "mpr-22182.ic19s", 0x9800000, 0x800000, CRC(c5606c42) SHA1(5871104ff1c7acde0493e13b9a4d0abdf8a40728) ) |
| 4637 | 4641 | ROM_LOAD( "mpr-22183.ic20s", 0xa000000, 0x800000, CRC(776af308) SHA1(7d29cb4dce75d34c622549fea7e102868d0da60a) ) |
| 4638 | 4642 | |
| 4639 | // 840-0023 2000 317-0273-COM Naomi | |
| 4640 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "0807cf54" ) | |
| 4643 | ROM_REGION( 4, "rom_key", 0 ) | |
| 4644 | ROM_LOAD( "18wheelr-key.bin", 0, 4, CRC(046f97f5) SHA1(11eb5cffdd67d460718b63ddee8ff4dfa7d72314) ) | |
| 4641 | 4645 | |
| 4642 | 4646 | // JVS I/O board 837-13844, code is for a Z80 of unknown type (it's inside the big Sega ASIC) |
| 4643 | 4647 | ROM_REGION( 0x20000, "jvsio", ROMREGION_ERASEFF) |
| r243192 | r243193 | |
| 4678 | 4682 | ROM_LOAD( "mpr-22182.ic19s", 0x9800000, 0x800000, CRC(c5606c42) SHA1(5871104ff1c7acde0493e13b9a4d0abdf8a40728) ) |
| 4679 | 4683 | ROM_LOAD( "mpr-22183.ic20s", 0xa000000, 0x800000, CRC(776af308) SHA1(7d29cb4dce75d34c622549fea7e102868d0da60a) ) |
| 4680 | 4684 | |
| 4681 | // 840-0023 2000 317-0273-COM Naomi | |
| 4682 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "0807cf54" ) | |
| 4685 | ROM_REGION( 4, "rom_key", 0 ) | |
| 4686 | ROM_LOAD( "18wheelr-key.bin", 0, 4, CRC(046f97f5) SHA1(11eb5cffdd67d460718b63ddee8ff4dfa7d72314) ) | |
| 4683 | 4687 | |
| 4684 | 4688 | // JVS I/O board 837-13844, code is for a Z80 of unknown type (it's inside the big Sega ASIC) |
| 4685 | 4689 | ROM_REGION( 0x20000, "jvsio", ROMREGION_ERASEFF) |
| r243192 | r243193 | |
| 4711 | 4715 | ROM_LOAD( "mpr-22991.ic14s", 0x7000000, 0x800000, CRC(0c20f313) SHA1(ac335d3015ef348c91319ae0e98b79a60e92f452) ) |
| 4712 | 4716 | ROM_LOAD( "mpr-22992.ic15s", 0x7800000, 0x800000, CRC(5eb6c4c6) SHA1(5dc1bced7ebd7d7e01f74d03706ec4a96585628d) ) |
| 4713 | 4717 | |
| 4714 | // 840-0025 1999 317-0274-JPN Naomi | |
| 4715 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "080b8ef5" ) | |
| 4718 | ROM_REGION( 4, "rom_key", 0 ) // 317-0274-JPN | |
| 4719 | ROM_LOAD( "marstv-key.bin", 0x000000, 0x000004, CRC(45c683ab) SHA1(1af2a582b54459eb1db56f5d3502917bb012d313) ) | |
| 4716 | 4720 | ROM_END |
| 4717 | 4721 | |
| 4718 | 4722 | /* Sega Strike Fighter */ |
| r243192 | r243193 | |
| 4743 | 4747 | ROM_LOAD( "mpr-23320.ic19s", 0x9800000, 0x800000, CRC(5ec75a45) SHA1(696e5d14678c794dec67246507bd580f7e5b5043) ) |
| 4744 | 4748 | ROM_LOAD( "mpr-23321.ic20s", 0xa000000, 0x800000, CRC(018627d4) SHA1(2519f39ad046d14f602648fed39bc3719185b55e) ) |
| 4745 | 4749 | |
| 4746 | // 840-0035 2000 317-0281-COM Naomi | |
| 4747 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "08132303" ) | |
| 4750 | ROM_REGION( 4, "rom_key", 0 ) | |
| 4751 | ROM_LOAD( "sstrkfgt-key.bin", 0, 4, CRC(1884e4ee) SHA1(14ec026ed32825252987fed350f19f6e2565aa4d) ) | |
| 4748 | 4752 | ROM_END |
| 4749 | 4753 | |
| 4750 | 4754 | // EPR ROM have different number, possible updated/bugfixed re-release or STD/DLX version, difference with original set is unknown, have "Rev.A" label too |
| r243192 | r243193 | |
| 4775 | 4779 | ROM_LOAD( "mpr-23320.ic19s", 0x9800000, 0x800000, CRC(5ec75a45) SHA1(696e5d14678c794dec67246507bd580f7e5b5043) ) |
| 4776 | 4780 | ROM_LOAD( "mpr-23321.ic20s", 0xa000000, 0x800000, CRC(018627d4) SHA1(2519f39ad046d14f602648fed39bc3719185b55e) ) |
| 4777 | 4781 | |
| 4778 | // 840-0035 2000 317-0281-COM Naomi | |
| 4779 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "08132303" ) | |
| 4782 | ROM_REGION( 4, "rom_key", 0 ) | |
| 4783 | ROM_LOAD( "sstrkfgt-key.bin", 0, 4, CRC(1884e4ee) SHA1(14ec026ed32825252987fed350f19f6e2565aa4d) ) | |
| 4780 | 4784 | ROM_END |
| 4781 | 4785 | |
| 4782 | 4786 | |
| r243192 | r243193 | |
| 4795 | 4799 | ROM_LOAD( "mpr-22914.ic5", 0x2800000, 0x800000, CRC(77844b60) SHA1(65d71febb8a160d00778ac7b53e082253cad9834) ) |
| 4796 | 4800 | ROM_LOAD( "mpr-22915.ic6", 0x3000000, 0x800000, CRC(e48148ac) SHA1(c1273353eeaf9bb6b185f133281d7d04271bc895) ) |
| 4797 | 4801 | |
| 4798 | // 840-0018 1999 317-0268-COM Naomi | |
| 4799 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "0808ae51" ) | |
| 4802 | ROM_REGION( 4, "rom_key", 0 ) | |
| 4803 | ROM_LOAD( "sgtetris-key.bin", 0, 4, CRC(03bf7ea1) SHA1(0229c1f9a6eca65b09e3571768a1fbf3c1dad6b1) ) | |
| 4800 | 4804 | ROM_END |
| 4801 | 4805 | |
| 4802 | 4806 | /* |
| r243192 | r243193 | |
| 4852 | 4856 | ROM_LOAD("mpr-23339.ic16s",0x8000000, 0x0800000, CRC(fd8c2736) SHA1(34ae1a4e35b4aac6666719fb4fc0959bd64ff3d6) ) |
| 4853 | 4857 | ROM_LOAD("mpr-23340.ic17s",0x8800000, 0x0800000, CRC(001604f8) SHA1(615ec027d383d44d4aadb1175be6320e4139d7d1) ) |
| 4854 | 4858 | |
| 4855 | // 840-0041 2000 317-0286-COM Naomi | |
| 4856 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "081a66ca" ) | |
| 4859 | ROM_REGION( 4, "rom_key", 0 ) | |
| 4860 | ROM_LOAD( "slasho-key.bin", 0, 4, CRC(78e31e35) SHA1(a0b06cb7fbb0b2f1734831fc3e6a8315c0e78edd) ) | |
| 4857 | 4861 | ROM_END |
| 4858 | 4862 | |
| 4859 | 4863 | |
| r243192 | r243193 | |
| 4910 | 4914 | ROM_LOAD( "mpr-23546.ic10", 0x9800000, 0x1000000, CRC(85db2248) SHA1(37845c269a2e65ee6181a8e7500c2e7dd9b2e343) ) |
| 4911 | 4915 | ROM_LOAD( "mpr-23547.ic11", 0xa800000, 0x1000000, CRC(18b369c7) SHA1(b61cb3fda8cc685865684f7afc7dad0b29d93ca5) ) |
| 4912 | 4916 | |
| 4913 | // 841-0015 2000 317-5065-COM Naomi | |
| 4914 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "000725d0" ) | |
| 4917 | ROM_REGION( 4, "rom_key", 0 ) | |
| 4918 | ROM_LOAD( "pjustic-key.bin", 0, 4, CRC(4a2bcbaa) SHA1(a9434482498f97605f76d08f749685452651a753) ) | |
| 4915 | 4919 | ROM_END |
| 4916 | 4920 | |
| 4917 | 4921 | /* |
| r243192 | r243193 | |
| 4952 | 4956 | ROM_LOAD("mpr-21595.ic7", 0x3800000, 0x0800000, CRC(7ab218f7) SHA1(c5c022e63f926cce09d49331647cde20e8e42ab3) ) |
| 4953 | 4957 | ROM_LOAD("mpr-21596.ic8", 0x4000000, 0x0800000, CRC(f27dbdc5) SHA1(d54717d62897546968de2f049239f68bee49bdd8) ) |
| 4954 | 4958 | |
| 4955 | // 841-0001 1999 317-5046-COM Naomi | |
| 4956 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "000e69c1" ) | |
| 4959 | ROM_REGION( 4, "rom_key", 0 ) | |
| 4960 | ROM_LOAD( "pstone-key.bin", 0, 4, CRC(7386d0de) SHA1(72f6b552440e470344f707e349d100d9ba21b69d) ) | |
| 4957 | 4961 | ROM_END |
| 4958 | 4962 | |
| 4959 | 4963 | /* |
| r243192 | r243193 | |
| 4995 | 4999 | ROM_LOAD("mpr-23125.ic8", 0x4000000, 0x0800000, CRC(b9938bbc) SHA1(d55d7adecb5a5a4a276a5a17c12808085d980fd9) ) |
| 4996 | 5000 | ROM_LOAD("mpr-23126.ic9", 0x4800000, 0x0800000, CRC(fbb0325b) SHA1(21b965519d7508d84344641d43e8af2c3ca29ba4) ) |
| 4997 | 5001 | |
| 4998 | // 841-0008 2000 317-5054-COM Naomi | |
| 4999 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "000b8dc0" ) | |
| 5002 | ROM_REGION( 4, "rom_key", 0 ) | |
| 5003 | ROM_LOAD( "pstone2-key.bin", 0, 4, CRC(3858144b) SHA1(f5fb9157b38969c986f8abbe8ed3f95e788e45c0) ) | |
| 5000 | 5004 | ROM_END |
| 5001 | 5005 | |
| 5002 | 5006 | |
| r243192 | r243193 | |
| 5060 | 5064 | ROM_LOAD("mpr-22159.ic18s",0x9000000, 0x0800000, CRC(f8b5e99d) SHA1(bb174a6a80967d0ff05c3a7512e4f0f9c921d130) ) |
| 5061 | 5065 | ROM_LOAD("mpr-22160.ic19s",0x9800000, 0x0800000, CRC(579eef4e) SHA1(bfcabd57f623647053afcedcabfbc74e5736819f) ) |
| 5062 | 5066 | |
| 5063 | // 840-0017 1999 317-0266-COM Naomi | |
| 5064 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "080fea94" ) | |
| 5067 | ROM_REGION( 4, "rom_key", 0 ) | |
| 5068 | ROM_LOAD( "otrigger-key.bin", 0, 4, CRC(79ebd41a) SHA1(3545dacdeac66b46e8706565f0eca784291040d1) ) | |
| 5065 | 5069 | ROM_END |
| 5066 | 5070 | |
| 5067 | 5071 | /* |
| r243192 | r243193 | |
| 5098 | 5102 | |
| 5099 | 5103 | ROM_COPY( "rom_board", 0x1000000, 0x400000, 0xc00000 ) |
| 5100 | 5104 | |
| 5101 | // 840-0030 2000 | |
| 5102 | ROM_PARAMETER( ":rom_board:key", "96489bcd" ) | |
| 5105 | ROM_REGION( 4, "rom_key", 0 ) | |
| 5106 | ROM_LOAD( "qmegamis-key.bin", 0, 4, CRC(b08650c0) SHA1(9e6b0fac6fb05209da9e01bb1a5437949d218078) ) | |
| 5103 | 5107 | ROM_END |
| 5104 | 5108 | |
| 5105 | 5109 | /* |
| r243192 | r243193 | |
| 5153 | 5157 | ROM_LOAD("mpr-22964.ic15s",0x7800000, 0x0800000, CRC(f581d5a3) SHA1(8cf769f5b0a48951246bb60e9cf58232bcee7bc8) ) |
| 5154 | 5158 | ROM_LOAD("mpr-22965.ic16s",0x8000000, 0x0800000, CRC(8f7bfa8a) SHA1(19f137b1552978d232785c4408805b71835585c6) ) |
| 5155 | 5159 | |
| 5156 | // 840-0020 1999 317-0270-COM Naomi | |
| 5157 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "080a8b5d" ) | |
| 5160 | ROM_REGION( 4, "rom_key", 0 ) | |
| 5161 | ROM_LOAD( "samba-key.bin", 0, 4, CRC(e17e3603) SHA1(5611615064a93cc9d957cc4edd12c716a72cd7f2) ) | |
| 5158 | 5162 | ROM_END |
| 5159 | 5163 | |
| 5160 | 5164 | // prototype - only works with US BIOS |
| r243192 | r243193 | |
| 5181 | 5185 | ROM_LOAD("mpr-22964.ic15s",0x7800000, 0x0800000, CRC(f581d5a3) SHA1(8cf769f5b0a48951246bb60e9cf58232bcee7bc8) ) |
| 5182 | 5186 | ROM_LOAD("mpr-22965.ic16s",0x8000000, 0x0800000, CRC(8f7bfa8a) SHA1(19f137b1552978d232785c4408805b71835585c6) ) |
| 5183 | 5187 | |
| 5184 | // 840-0020 1999 317-0270-COM Naomi | |
| 5185 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "080a8b5d" ) | |
| 5188 | ROM_REGION( 4, "rom_key", 0 ) | |
| 5189 | ROM_LOAD( "samba-key.bin", 0, 4, CRC(e17e3603) SHA1(5611615064a93cc9d957cc4edd12c716a72cd7f2) ) | |
| 5186 | 5190 | ROM_END |
| 5187 | 5191 | |
| 5188 | 5192 | /* |
| r243192 | r243193 | |
| 5213 | 5217 | ROM_LOAD("mpr-22218.ic11", 0x5800000, 0x0800000, CRC(f9ca31b8) SHA1(ea3d0f38ca1a46c896c06f038a6362ad3c9f90b2) ) |
| 5214 | 5218 | ROM_LOAD("mpr-22219.ic12s", 0x6000000, 0x0800000, CRC(b3b45811) SHA1(045e7236b814f848d4c9767618ddcd4344d880ec) ) |
| 5215 | 5219 | |
| 5216 | ROM_ | |
| 5220 | ROM_REGION( 4, "rom_key", ROMREGION_ERASE00 ) | |
| 5217 | 5221 | ROM_END |
| 5218 | 5222 | |
| 5219 | 5223 | // Shootout Pool |
| r243192 | r243193 | |
| 5230 | 5234 | |
| 5231 | 5235 | ROM_COPY( "rom_board", 0x1000000, 0x400000, 0xc00000 ) |
| 5232 | 5236 | |
| 5233 | // 840-0098 2002 | |
| 5234 | ROM_PARAMETER( ":rom_board:key", "a77cf3a0" ) | |
| 5237 | ROM_REGION( 4, "rom_key", 0 ) | |
| 5238 | ROM_LOAD( "shootopl-key.bin", 0, 4, CRC(45547e02) SHA1(4f79f478ff1eea14bc939a67ff570143cb56a4bf) ) | |
| 5235 | 5239 | ROM_END |
| 5236 | 5240 | |
| 5237 | 5241 | // Shootout Pool Prize |
| r243192 | r243193 | |
| 5248 | 5252 | |
| 5249 | 5253 | ROM_COPY( "rom_board", 0x1000000, 0x400000, 0xc00000 ) |
| 5250 | 5254 | |
| 5251 | // 840-0128 2002 | |
| 5252 | ROM_PARAMETER( ":rom_board:key", "cde98d9d" ) | |
| 5255 | ROM_REGION( 4, "rom_key", 0 ) | |
| 5256 | ROM_LOAD( "shootpl-key.bin", 0, 4, CRC(03c30b17) SHA1(e8e8659aa27b3d1cac2268850d3973d9afeaeba9) ) | |
| 5253 | 5257 | ROM_END |
| 5254 | 5258 | |
| 5255 | 5259 | // Shootout Pool Prize Ver. B |
| r243192 | r243193 | |
| 5266 | 5270 | |
| 5267 | 5271 | ROM_COPY( "rom_board", 0x1000000, 0x400000, 0xc00000 ) |
| 5268 | 5272 | |
| 5269 | // 840-0128 2002 | |
| 5270 | ROM_PARAMETER( ":rom_board:key", "cde98d9d" ) | |
| 5273 | ROM_REGION( 4, "rom_key", 0 ) | |
| 5274 | ROM_LOAD( "shootpl-key.bin", 0, 4, CRC(03c30b17) SHA1(e8e8659aa27b3d1cac2268850d3973d9afeaeba9) ) | |
| 5271 | 5275 | ROM_END |
| 5272 | 5276 | |
| 5273 | 5277 | /* Oinori-daimyoujin Matsuri (medal) */ |
| r243192 | r243193 | |
| 5283 | 5287 | ROM_LOAD( "mpr-24057.ic4", 0x3800000, 0x1000000, CRC(6dec3518) SHA1(3e65065df22680e2bbf2d3db22da413f347a1abe) ) |
| 5284 | 5288 | ROM_LOAD( "mpr-24058.ic5", 0x4800000, 0x1000000, CRC(0eba9049) SHA1(a71ca72aeaf17180cde59d7c7b42c97a1b4259ab) ) |
| 5285 | 5289 | |
| 5286 | ROM_ | |
| 5290 | ROM_REGION( 4, "rom_key", ROMREGION_ERASE00 ) | |
| 5287 | 5291 | ROM_END |
| 5288 | 5292 | |
| 5289 | 5293 | /* |
| r243192 | r243193 | |
| 5327 | 5331 | ROM_LOAD("mpr-22975.ic9", 0x4800000, 0x0800000, CRC(0d3c70d1) SHA1(22920bc5fd1dda760b5cb17482e9181be899bc08) ) |
| 5328 | 5332 | ROM_LOAD("mpr-22976.ic10", 0x5000000, 0x0800000, CRC(092d8063) SHA1(14fafd3f4c4f2b37172453d1c815fb9b8f4814f4) ) |
| 5329 | 5333 | |
| 5330 | // 841-0005 1999 317-5051-COM Naomi | |
| 5331 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "00078d01" ) | |
| 5334 | ROM_REGION( 4, "rom_key", 0 ) | |
| 5335 | ROM_LOAD( "spawn-key.bin", 0, 4, CRC(dd211f09) SHA1(d436cd5009744c4c69fb94c84837103b4ca1c9a7) ) | |
| 5332 | 5336 | ROM_END |
| 5333 | 5337 | |
| 5334 | 5338 | /* |
| r243192 | r243193 | |
| 5369 | 5373 | ROM_LOAD("mpr-23020.ic20s", 0xa000000, 0x0800000, CRC(b5943007) SHA1(d0e95084aec5e05027c21a6b4a3331408853781b) ) |
| 5370 | 5374 | //ic21 not populated |
| 5371 | 5375 | |
| 5372 | ROM_ | |
| 5376 | ROM_REGION( 4, "rom_key", ROMREGION_ERASE00 ) | |
| 5373 | 5377 | ROM_END |
| 5374 | 5378 | |
| 5375 | 5379 | /* |
| r243192 | r243193 | |
| 5433 | 5437 | ROM_LOAD("mpr-22947.ic20s", 0xa000000, 0x0800000, CRC(5e5eb595) SHA1(401d4a11d436988d716bb014b36233f171dc576d) ) |
| 5434 | 5438 | ROM_LOAD("mpr-22948.ic21s", 0xa800000, 0x0800000, CRC(1b0de917) SHA1(fd1742ea9bb2f1ce871ee3266171f26634e1c8e7) ) |
| 5435 | 5439 | |
| 5436 | ROM_ | |
| 5440 | ROM_REGION( 4, "rom_key", ROMREGION_ERASE00 ) | |
| 5437 | 5441 | ROM_END |
| 5438 | 5442 | |
| 5439 | 5443 | ROM_START( virnbao ) |
| r243192 | r243193 | |
| 5464 | 5468 | ROM_LOAD("mpr-22947.ic20s", 0xa000000, 0x0800000, CRC(5e5eb595) SHA1(401d4a11d436988d716bb014b36233f171dc576d) ) |
| 5465 | 5469 | ROM_LOAD("mpr-22948.ic21s", 0xa800000, 0x0800000, CRC(1b0de917) SHA1(fd1742ea9bb2f1ce871ee3266171f26634e1c8e7) ) |
| 5466 | 5470 | |
| 5467 | // 840-0021 2000 317-0271-COM Naomi | |
| 5468 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "08068b58" ) | |
| 5471 | ROM_REGION( 4, "rom_key", 0 ) | |
| 5472 | ROM_LOAD( "virnbao-key.bin", 0, 4, CRC(980e3be8) SHA1(234a2f8ee408144d2c51e8083d0a033eea6026e0) ) | |
| 5469 | 5473 | ROM_END |
| 5470 | 5474 | |
| 5471 | 5475 | ROM_START( virnbap ) |
| r243192 | r243193 | |
| 5496 | 5500 | ROM_LOAD("mpr-22947.ic20s", 0xa000000, 0x0800000, CRC(5e5eb595) SHA1(401d4a11d436988d716bb014b36233f171dc576d) ) |
| 5497 | 5501 | ROM_LOAD("mpr-22948.ic21s", 0xa800000, 0x0800000, CRC(1b0de917) SHA1(fd1742ea9bb2f1ce871ee3266171f26634e1c8e7) ) |
| 5498 | 5502 | |
| 5499 | // 840-0021 2000 317-0271-COM Naomi | |
| 5500 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "08068b58" ) | |
| 5503 | ROM_REGION( 4, "rom_key", 0 ) | |
| 5504 | ROM_LOAD( "virnbao-key.bin", 0, 4, CRC(980e3be8) SHA1(234a2f8ee408144d2c51e8083d0a033eea6026e0) ) | |
| 5501 | 5505 | ROM_END |
| 5502 | 5506 | |
| 5503 | 5507 | /* |
| r243192 | r243193 | |
| 5549 | 5553 | ROM_LOAD("mpr-21922.ic14s",0x7000000, 0x0800000, CRC(a1901e1e) SHA1(2281f91ac696cc14886bcdf4b0685ce2f5bb8117) ) |
| 5550 | 5554 | ROM_LOAD("mpr-21923.ic15s",0x7800000, 0x0400000, CRC(d127d9a5) SHA1(78c95357344ea15469b84fa8b1332e76521892cd) ) |
| 5551 | 5555 | |
| 5552 | // 840-0010 1999 317-0258-COM Naomi | |
| 5553 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "08088b08" ) | |
| 5556 | ROM_REGION( 4, "rom_key", 0 ) | |
| 5557 | ROM_LOAD( "vs2_2k-key.bin", 0, 4, CRC(f9fb4716) SHA1(83277f61e97fc6c4d8d27b903bde0acdfb0c7dbc) ) | |
| 5554 | 5558 | ROM_END |
| 5555 | 5559 | |
| 5556 | 5560 | /* |
| r243192 | r243193 | |
| 5594 | 5598 | ROM_LOAD("mpr-22925.ic10",0x5000000, 0x0800000, CRC(81057e42) SHA1(d41137ae28c64dbdb50150db8cf25851bc0709c4) ) |
| 5595 | 5599 | ROM_LOAD("mpr-22926.ic11",0x5800000, 0x0800000, CRC(57eec89d) SHA1(dd8f9a9155e51ee5260f559449fb0ea245077952) ) |
| 5596 | 5600 | |
| 5597 | // 840-0015 1999 317-0263-COM Naomi | |
| 5598 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "0803eb15" ) | |
| 5601 | ROM_REGION( 4, "rom_key", 0 ) | |
| 5602 | ROM_LOAD( "vtennis-key.bin", 0, 4, CRC(f355af89) SHA1(581a9b0f8c2f3606006e85e136f9cf0ea908c773) ) | |
| 5599 | 5603 | ROM_END |
| 5600 | 5604 | |
| 5601 | 5605 | /* |
| r243192 | r243193 | |
| 5620 | 5624 | ROM_LOAD( "mpr-22268.ic7", 0x6800000, 0x1000000, CRC(536f5eea) SHA1(f1de8624f82595adf75693b604fb026bf3f778ee) ) |
| 5621 | 5625 | ROM_LOAD( "mpr-22269.ic8", 0x7800000, 0x1000000, CRC(6c0cf740) SHA1(da10b33a6e54afbe1d7e52801216e7119b0b33b1) ) |
| 5622 | 5626 | |
| 5623 | // 840-0040 2000 317-0285-COM Naomi | |
| 5624 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "081627c3" ) | |
| 5627 | ROM_REGION( 4, "rom_key", 0 ) | |
| 5628 | ROM_LOAD( "wwfroyal-key.bin", 0, 4, CRC(e14721b1) SHA1(1f2f447bbc4b1e0b016c5ac545d1d805abc61ebd) ) | |
| 5625 | 5629 | ROM_END |
| 5626 | 5630 | |
| 5627 | 5631 | ROM_START( mushik2e ) |
| r243192 | r243193 | |
| 5937 | 5941 | ROM_LOAD("mpr-21725.ic18s",0x9000000, 0x0800000, CRC(2202077b) SHA1(0893a85379f994277083c0bc5b178dd34508f816) ) |
| 5938 | 5942 | ROM_LOAD("mpr-21726.ic19s",0x9800000, 0x0800000, CRC(429bf290) SHA1(6733e1bcf100e73ab43273f6feedc187fcaa55d4) ) |
| 5939 | 5943 | |
| 5940 | // 840-0003 1999 317-0249-COM Naomi | |
| 5941 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "08012b41" ) | |
| 5944 | ROM_REGION( 4, "rom_key", 0 ) | |
| 5945 | ROM_LOAD( "zombrvn-key.bin", 0, 4, CRC(572d3944) SHA1(16ae634d85169851b9deae3c03b5dd4d4bf2794a) ) | |
| 5942 | 5946 | ROM_END |
| 5943 | 5947 | |
| 5944 | 5948 | ROM_START( gunsur2 ) |
| r243192 | r243193 | |
| 5962 | 5966 | ROM_LOAD( "bhf1ma14.6m", 0xe000000, 0x1000000, CRC(d06c9bd7) SHA1(54668a2fd31059976890da92709c18f308634887) ) |
| 5963 | 5967 | ROM_LOAD( "bhf1ma15.6l", 0xf000000, 0x1000000, CRC(db3c396b) SHA1(da0e125d627ce890906ca100081ab0685e11c0ef) ) |
| 5964 | 5968 | |
| 5965 | // 25709801 2001 317-5075-COM Naomi | |
| 5966 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "000680d0" ) | |
| 5969 | ROM_REGION( 4, "rom_key", 0 ) | |
| 5970 | ROM_LOAD( "bhf1-key.bin", 0x0000000, 0x0000004, CRC(9899e931) SHA1(c0837262b9069b33d0e72b418e80b5f0da8b9251) ) | |
| 5967 | 5971 | ROM_END |
| 5968 | 5972 | |
| 5969 | 5973 | ROM_START( gunsur2e ) |
| r243192 | r243193 | |
| 5987 | 5991 | ROM_LOAD( "bhf1ma14.6m", 0xe000000, 0x1000000, CRC(d06c9bd7) SHA1(54668a2fd31059976890da92709c18f308634887) ) |
| 5988 | 5992 | ROM_LOAD( "bhf1ma15.6l", 0xf000000, 0x1000000, CRC(db3c396b) SHA1(da0e125d627ce890906ca100081ab0685e11c0ef) ) |
| 5989 | 5993 | |
| 5990 | // 25709801 2001 317-5075-COM Naomi | |
| 5991 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "000680d0" ) | |
| 5994 | ROM_REGION( 4, "rom_key", 0 ) | |
| 5995 | ROM_LOAD( "bhf1-key.bin", 0x0000000, 0x0000004, CRC(9899e931) SHA1(c0837262b9069b33d0e72b418e80b5f0da8b9251) ) | |
| 5992 | 5996 | ROM_END |
| 5993 | 5997 | |
| 5994 | 5998 | ROM_START( wldkicks ) |
| r243192 | r243193 | |
| 6009 | 6013 | ROM_LOAD( "wk1ma9.4d", 0x9000000, 0x1000000, CRC(29635a54) SHA1(a3109d0f8f271e2183316846df2a6a819f6a9b20) ) |
| 6010 | 6014 | ROM_LOAD( "wk1ma10.4c", 0xa000000, 0x1000000, CRC(e96f312c) SHA1(0a92640277111aef5c6e9dab4218a8ae2196ce61) ) |
| 6011 | 6015 | |
| 6012 | // 25209801 2000 317-5040-COM Naomi | |
| 6013 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "052e2901" ) | |
| 6016 | ROM_REGION( 4, "rom_key", 0 ) | |
| 6017 | ROM_LOAD( "wldkicks-key.bin", 0, 4, CRC(c1e3000b) SHA1(36c2546833effe9452e2b3f7d31335fc5e349f49) ) | |
| 6014 | 6018 | ROM_END |
| 6015 | 6019 | |
| 6016 | 6020 | ROM_START( wldkicksa ) |
| r243192 | r243193 | |
| 6031 | 6035 | ROM_LOAD( "wk1ma9.4d", 0x9000000, 0x1000000, CRC(29635a54) SHA1(a3109d0f8f271e2183316846df2a6a819f6a9b20) ) |
| 6032 | 6036 | ROM_LOAD( "wk1ma10.4c", 0xa000000, 0x1000000, CRC(e96f312c) SHA1(0a92640277111aef5c6e9dab4218a8ae2196ce61) ) |
| 6033 | 6037 | |
| 6034 | // 25209801 2000 317-5040-COM Naomi | |
| 6035 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "052e2901" ) | |
| 6038 | ROM_REGION( 4, "rom_key", 0 ) | |
| 6039 | ROM_LOAD( "wldkicks-key.bin", 0, 4, CRC(c1e3000b) SHA1(36c2546833effe9452e2b3f7d31335fc5e349f49) ) | |
| 6036 | 6040 | ROM_END |
| 6037 | 6041 | |
| 6038 | 6042 | ROM_START( wldkicksb ) |
| r243192 | r243193 | |
| 6053 | 6057 | ROM_LOAD( "wk1ma9.4d", 0x9000000, 0x1000000, CRC(29635a54) SHA1(a3109d0f8f271e2183316846df2a6a819f6a9b20) ) |
| 6054 | 6058 | ROM_LOAD( "wk1ma10.4c", 0xa000000, 0x1000000, CRC(e96f312c) SHA1(0a92640277111aef5c6e9dab4218a8ae2196ce61) ) |
| 6055 | 6059 | |
| 6056 | // 25209801 2000 317-5040-COM Naomi | |
| 6057 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "052e2901" ) | |
| 6060 | ROM_REGION( 4, "rom_key", 0 ) | |
| 6061 | ROM_LOAD( "wldkicks-key.bin", 0, 4, CRC(c1e3000b) SHA1(36c2546833effe9452e2b3f7d31335fc5e349f49) ) | |
| 6058 | 6062 | ROM_END |
| 6059 | 6063 | |
| 6060 | 6064 | ROM_START( toukon4 ) |
| r243192 | r243193 | |
| 6080 | 6084 | ROM_LOAD( "trf1ma14.6m", 0xe000000, 0x1000000, CRC(87cb31a0) SHA1(27aef9ac571a0b5e3a76e4ee22f5bc5d0ae962f2) ) |
| 6081 | 6085 | ROM_LOAD( "trf1ma15.6l", 0xf000000, 0x1000000, CRC(42d318c5) SHA1(f9fe82ffbfc51fcb52333f94c55a7092e7124fb4) ) |
| 6082 | 6086 | |
| 6083 | // 25349801 2000 317-5040-COM Naomi | |
| 6084 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "052e2901" ) | |
| 6087 | ROM_REGION( 4, "rom_key", 0 ) | |
| 6088 | ROM_LOAD( "tr4ae-key.bin", 0x000000, 0x000004, CRC(986a7cee) SHA1(70c3ff80f86de6a0655251658c66a156fb644995) ) | |
| 6085 | 6089 | ROM_END |
| 6086 | 6090 | |
| 6087 | 6091 | ROM_START( ninjaslt ) |
| r243192 | r243193 | |
| 6102 | 6106 | ROM_LOAD( "nja1ma9.4c", 0x9000000, 0x1000000, CRC(8abed815) SHA1(5e1b208d23a17ba743d0507d963be42e7828755f) ) |
| 6103 | 6107 | ROM_LOAD( "nja1ma10.4b", 0xa000000, 0x1000000, CRC(f14d2073) SHA1(b4a8cd585794be149b616119df3f75c0fb30e2f0) ) |
| 6104 | 6108 | |
| 6105 | // 25469801 2000 317-5068-COM Naomi | |
| 6106 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "000ca510" ) | |
| 6109 | ROM_REGION( 4, "rom_key", 0 ) | |
| 6110 | ROM_LOAD( "nja3-key.bin", 0x000000, 0x000004, CRC(e6997eb0) SHA1(c866a5069e28939be5a8fc867bc14791decac3c8) ) | |
| 6107 | 6111 | |
| 6108 | 6112 | ROM_REGION( 0x20000, "jyu_io", 0 ) // H8/3334-based I/O board ROM, eventually should be separated out |
| 6109 | 6113 | ROM_LOAD( "jyu1_prg0a.ic3", 0x000000, 0x020000, CRC(aec4dbc1) SHA1(bddd4f345baf7f594998a39c09da18b3834f0ac2) ) |
| r243192 | r243193 | |
| 6127 | 6131 | ROM_LOAD( "nja1ma9.4c", 0x9000000, 0x1000000, CRC(8abed815) SHA1(5e1b208d23a17ba743d0507d963be42e7828755f) ) |
| 6128 | 6132 | ROM_LOAD( "nja1ma10.4b", 0xa000000, 0x1000000, CRC(f14d2073) SHA1(b4a8cd585794be149b616119df3f75c0fb30e2f0) ) |
| 6129 | 6133 | |
| 6130 | // 25469801 2000 317-5068-COM Naomi | |
| 6131 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "000ca510" ) | |
| 6134 | ROM_REGION( 4, "rom_key", 0 ) | |
| 6135 | ROM_LOAD( "nja3-key.bin", 0x000000, 0x000004, CRC(e6997eb0) SHA1(c866a5069e28939be5a8fc867bc14791decac3c8) ) | |
| 6132 | 6136 | |
| 6133 | 6137 | ROM_REGION( 0x20000, "jyu_io", 0 ) // H8/3334-based I/O board ROM, eventually should be separated out |
| 6134 | 6138 | ROM_LOAD( "jyu1_prg0a.ic3", 0x000000, 0x020000, CRC(aec4dbc1) SHA1(bddd4f345baf7f594998a39c09da18b3834f0ac2) ) |
| r243192 | r243193 | |
| 6152 | 6156 | ROM_LOAD( "nja1ma9.4c", 0x9000000, 0x1000000, CRC(8abed815) SHA1(5e1b208d23a17ba743d0507d963be42e7828755f) ) |
| 6153 | 6157 | ROM_LOAD( "nja1ma10.4b", 0xa000000, 0x1000000, CRC(f14d2073) SHA1(b4a8cd585794be149b616119df3f75c0fb30e2f0) ) |
| 6154 | 6158 | |
| 6155 | // 25469801 2000 317-5068-COM Naomi | |
| 6156 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "000ca510" ) | |
| 6159 | ROM_REGION( 4, "rom_key", 0 ) | |
| 6160 | ROM_LOAD( "nja3-key.bin", 0x000000, 0x000004, CRC(e6997eb0) SHA1(c866a5069e28939be5a8fc867bc14791decac3c8) ) | |
| 6157 | 6161 | |
| 6158 | 6162 | ROM_REGION( 0x20000, "jyu_io", 0 ) // H8/3334-based I/O board ROM, eventually should be separated out |
| 6159 | 6163 | ROM_LOAD( "jyu1_prg0a.ic3", 0x000000, 0x020000, CRC(aec4dbc1) SHA1(bddd4f345baf7f594998a39c09da18b3834f0ac2) ) |
| r243192 | r243193 | |
| 6177 | 6181 | ROM_LOAD( "nja1ma9.4c", 0x9000000, 0x1000000, CRC(8abed815) SHA1(5e1b208d23a17ba743d0507d963be42e7828755f) ) |
| 6178 | 6182 | ROM_LOAD( "nja1ma10.4b", 0xa000000, 0x1000000, CRC(f14d2073) SHA1(b4a8cd585794be149b616119df3f75c0fb30e2f0) ) |
| 6179 | 6183 | |
| 6180 | // 25469801 2000 317-5068-COM Naomi | |
| 6181 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "000ca510" ) | |
| 6184 | ROM_REGION( 4, "rom_key", 0 ) | |
| 6185 | ROM_LOAD( "nja3-key.bin", 0x000000, 0x000004, CRC(e6997eb0) SHA1(c866a5069e28939be5a8fc867bc14791decac3c8) ) | |
| 6182 | 6186 | |
| 6183 | 6187 | ROM_REGION( 0x20000, "jyu_io", 0 ) // H8/3334-based I/O board ROM, eventually should be separated out |
| 6184 | 6188 | ROM_LOAD( "jyu1_prg0a.ic3", 0x000000, 0x020000, CRC(aec4dbc1) SHA1(bddd4f345baf7f594998a39c09da18b3834f0ac2) ) |
| r243192 | r243193 | |
| 6199 | 6203 | ROM_LOAD( "maz1ma7.4e", 0x7000000, 0x1000000, CRC(6103ad9c) SHA1(e4abbb5867cae6a9bf9067ab3a091ef7b18fa0cd) ) |
| 6200 | 6204 | ROM_LOAD( "maz1ma8.4d", 0x8000000, 0x1000000, CRC(d46c9f40) SHA1(45eec7fa3d4261f12438e841254fa75d572331b3) ) |
| 6201 | 6205 | |
| 6202 | // 25869812 2002 317-0266-COM Naomi | |
| 6203 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "080fea94" ) | |
| 6206 | ROM_REGION( 4, "rom_key", 0 ) | |
| 6207 | ROM_LOAD( "maz1-key.bin", 0x000000, 0x000004, CRC(79ebd41a) SHA1(3545dacdeac66b46e8706565f0eca784291040d1) ) | |
| 6204 | 6208 | ROM_END |
| 6205 | 6209 | |
| 6206 | 6210 | ROM_START( mazana ) |
| r243192 | r243193 | |
| 6218 | 6222 | ROM_LOAD( "maz1ma7.4e", 0x7000000, 0x1000000, CRC(6103ad9c) SHA1(e4abbb5867cae6a9bf9067ab3a091ef7b18fa0cd) ) |
| 6219 | 6223 | ROM_LOAD( "maz1ma8.4d", 0x8000000, 0x1000000, CRC(d46c9f40) SHA1(45eec7fa3d4261f12438e841254fa75d572331b3) ) |
| 6220 | 6224 | |
| 6221 | // 25869812 2002 317-0266-COM Naomi | |
| 6222 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "080fea94" ) | |
| 6225 | ROM_REGION( 4, "rom_key", 0 ) | |
| 6226 | ROM_LOAD( "maz1-key.bin", 0x000000, 0x000004, CRC(79ebd41a) SHA1(3545dacdeac66b46e8706565f0eca784291040d1) ) | |
| 6223 | 6227 | ROM_END |
| 6224 | 6228 | |
| 6225 | 6229 | ROM_START( vtenis2c ) |
| r243192 | r243193 | |
| 6249 | 6253 | |
| 6250 | 6254 | ROM_COPY( "rom_board", 0x1000000, 0x400000, 0xc00000 ) |
| 6251 | 6255 | |
| 6252 | // 840-0084 2001 | |
| 6253 | ROM_PARAMETER( ":rom_board:key", "43472d2d" ) | |
| 6256 | ROM_REGION( 4, "rom_key", 0 ) | |
| 6257 | ROM_LOAD( "vtenis2c-key.bin", 0, 4, CRC(b8c5b510) SHA1(f36d037a62a576e71211093e075f0ffa7e312c2d) ) | |
| 6254 | 6258 | ROM_END |
| 6255 | 6259 | |
| 6256 | 6260 | ROM_START( kick4csh ) |
| r243192 | r243193 | |
| 6279 | 6283 | |
| 6280 | 6284 | ROM_COPY( "rom_board", 0x1000000, 0x400000, 0xc00000 ) |
| 6281 | 6285 | |
| 6282 | // 840-0140 2004 | |
| 6283 | ROM_PARAMETER( ":rom_board:key", "c9570882" ) | |
| 6286 | ROM_REGION( 4, "rom_key", 0 ) | |
| 6287 | ROM_LOAD( "kick4csh-key.bin", 0, 4, CRC(889d2ea1) SHA1(daf7acf41b6bc607d443a93221a3e4554b99547f) ) | |
| 6284 | 6288 | ROM_END |
| 6285 | 6289 | |
| 6286 | 6290 | ROM_START( wrungp ) |
| r243192 | r243193 | |
| 6296 | 6300 | ROM_LOAD( "mpr-23723.ic5", 0x4800000, 0x1000000, CRC(651610eb) SHA1(4dfe4f876a5440bd1034f41a4d76e1d6bd3e0e32) ) |
| 6297 | 6301 | ROM_LOAD( "mpr-23724.ic6", 0x5800000, 0x1000000, CRC(c633c45a) SHA1(23b45140f965428d33e2424b0574715c0b952d05) ) |
| 6298 | 6302 | |
| 6299 | ROM_ | |
| 6303 | ROM_REGION( 4, "rom_key", ROMREGION_ERASE00 ) | |
| 6300 | 6304 | ROM_END |
| 6301 | 6305 | |
| 6302 | 6306 | ROM_START( gundmct ) |
| r243192 | r243193 | |
| 6316 | 6320 | ROM_LOAD( "mpr-23636.ic9", 0x8800000, 0x1000000, CRC(57199e9f) SHA1(73a6f20ee7b3133ed4c6286e477e2ff9757106bd) ) |
| 6317 | 6321 | ROM_LOAD( "mpr-23637.ic10", 0x9800000, 0x1000000, CRC(737b5dff) SHA1(0a405b711ffb096a3e6d52ececed73a5f93ebf02) ) |
| 6318 | 6322 | |
| 6319 | // 841-0017 2001 317-5070-COM Naomi | |
| 6320 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "000e8010" ) | |
| 6323 | ROM_REGION( 4, "rom_key", 0 ) | |
| 6324 | ROM_LOAD( "gundmct-key.bin", 0, 4, CRC(0dee7a39) SHA1(24eef111ad7d8ad984e38b63101d01463b36542e) ) | |
| 6321 | 6325 | ROM_END |
| 6322 | 6326 | |
| 6323 | 6327 | ROM_START( puyoda ) |
| r243192 | r243193 | |
| 6347 | 6351 | ROM_LOAD( "mpr-22204.ic19s", 0x9800000, 0x800000, CRC(2c5e5140) SHA1(7887fc19459dc85ca78256e0c50c762eea001e51) ) |
| 6348 | 6352 | ROM_LOAD( "mpr-22205.ic20s", 0xa000000, 0x800000, CRC(7d523ae5) SHA1(7495082b7e83b6ee8f47660baba4c604d8ba2ff1) ) |
| 6349 | 6353 | |
| 6350 | // 841-0006 1999 317-5052-COM Naomi | |
| 6351 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "000acd40" ) | |
| 6354 | ROM_REGION( 4, "rom_key", 0 ) | |
| 6355 | ROM_LOAD( "puyoda-key.bin", 0, 4, CRC(245bb259) SHA1(7ab675779ebf01ad3a78edd39cb287b71acd8bb5) ) | |
| 6352 | 6356 | ROM_END |
| 6353 | 6357 | |
| 6354 | 6358 | ROM_START( zerogu2 ) |
| r243192 | r243193 | |
| 6363 | 6367 | ROM_LOAD( "mpr-23687.ic4", 0x3800000, 0x1000000, CRC(e125439a) SHA1(07e7339f3f53aeb0ebddf7a8ac3eb6d8f3fe9de6) ) |
| 6364 | 6368 | ROM_LOAD( "mpr-23688.ic5", 0x4800000, 0x1000000, CRC(38412edf) SHA1(9cae06cf46e134531f47e64deedace449664f69a) ) |
| 6365 | 6369 | |
| 6366 | // 841-0020 2001 317-5073-COM Naomi | |
| 6367 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "0007c010" ) | |
| 6370 | ROM_REGION( 4, "rom_key", 0 ) | |
| 6371 | ROM_LOAD( "zerogu2-key.bin", 0, 4, CRC(f2460eb3) SHA1(69ec4e3933e60caa6a0ac44a855a40deed337d92) ) | |
| 6368 | 6372 | ROM_END |
| 6369 | 6373 | |
| 6370 | 6374 | ROM_START( inunoos ) |
| r243192 | r243193 | |
| 6391 | 6395 | ROM_LOAD( "ic15s.bin", 0x7800000, 0x800000, CRC(b85e13ef) SHA1(974f6b8f24efe79d72ea9d7a2cfccf479704243d) ) |
| 6392 | 6396 | ROM_LOAD( "ic16s.bin", 0x8000000, 0x800000, CRC(b8493dbe) SHA1(b641417e1bda49341e7ff86340072d74e3330665) ) |
| 6393 | 6397 | |
| 6394 | // 840-0073 2001 317-0316-JPN Naomi | |
| 6395 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "094bc3e3" ) | |
| 6398 | ROM_REGION( 4, "rom_key", 0 ) | |
| 6399 | ROM_LOAD( "inunoos-key.bin", 0, 4, CRC(3ce3ed17) SHA1(d5d6daac0cbcdf7dada2e01f3c458dea04805c05) ) | |
| 6396 | 6400 | ROM_END |
| 6397 | 6401 | |
| 6398 | 6402 | ROM_START( ringout ) |
| r243192 | r243193 | |
| 6412 | 6416 | ROM_LOAD( "mpr-21769.ic9", 0x4800000, 0x800000, CRC(6d22d29d) SHA1(382dcd62065437b34fe101144b1c047eb261f047) ) |
| 6413 | 6417 | ROM_LOAD( "mpr-21770.ic10", 0x5000000, 0x800000, CRC(c5308e61) SHA1(e51f8026351d5ffbda2a5bed39aeef543366febf) ) |
| 6414 | 6418 | |
| 6415 | // 840-0004 1999 317-0250-COM Naomi | |
| 6416 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "080b1e40" ) | |
| 6419 | ROM_REGION( 4, "rom_key", 0 ) | |
| 6420 | ROM_LOAD( "ringout-key.bin", 0, 4, CRC(8f8c4eb2) SHA1(9bc59c69d04d9ce876415af048f39095ed680a5e) ) | |
| 6417 | 6421 | ROM_END |
| 6418 | 6422 | |
| 6419 | 6423 | ROM_START( vonot ) |
| r243192 | r243193 | |
| 6436 | 6440 | ROM_LOAD( "mpr-23193.ic12s", 0x6000000, 0x800000, CRC(c86a5b9b) SHA1(4b8dda85003289e1464e12c3abf449bb8df20e3a) ) |
| 6437 | 6441 | ROM_LOAD( "mpr-23194.ic13s", 0x6800000, 0x800000, CRC(5adea0bd) SHA1(f8614ba83d5f61556c3db1a1796a02ed2c51ce2a) ) |
| 6438 | 6442 | |
| 6439 | // 840-0028 2000 317-0279-COM Naomi | |
| 6440 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "08010715" ) | |
| 6443 | ROM_REGION( 4, "rom_key", 0 ) | |
| 6444 | ROM_LOAD( "vonot-key.bin", 0, 4, CRC(021ac707) SHA1(af57844331226d3b1722aedca1a7aef024468b39) ) | |
| 6441 | 6445 | ROM_END |
| 6442 | 6446 | |
| 6443 | 6447 | ROM_START( derbyo2k ) |
| r243192 | r243193 | |
| 6463 | 6467 | ROM_LOAD( "mpr-22237.ic15s", 0x7800000, 0x800000, CRC(718dd6bf) SHA1(6b71bb6970b582865f53d26e9579587fce86439e) ) |
| 6464 | 6468 | ROM_LOAD( "mpr-22238.ic16s", 0x8000000, 0x800000, CRC(fb3e55da) SHA1(d547ee5b47e6e6fec9e447460300c828fbff8f2e) ) |
| 6465 | 6469 | |
| 6466 | ROM_ | |
| 6470 | ROM_REGION( 4, "rom_key", ROMREGION_ERASE00 ) | |
| 6467 | 6471 | ROM_END |
| 6468 | 6472 | |
| 6469 | 6473 | ROM_START( starhrse ) |
| r243192 | r243193 | |
| 6477 | 6481 | ROM_LOAD( "mpr-23233.ic3", 0x2800000, 0x1000000, CRC(d6451cab) SHA1(6508e27d0370b19df01150da7baf4875479c166a) ) |
| 6478 | 6482 | ROM_LOAD( "mpr-23234.ic4", 0x3800000, 0x1000000, CRC(44044c14) SHA1(4934cb8d5f9b4085ffb5ddc711343f488aae4c4d) ) |
| 6479 | 6483 | |
| 6480 | ROM_ | |
| 6484 | ROM_REGION( 4, "rom_key", ROMREGION_ERASE00 ) | |
| 6481 | 6485 | |
| 6482 | 6486 | // this dump can't be used as main_eeprom, because that's exactly 0x80 bytes |
| 6483 | 6487 | ROM_REGION(0x84, "some_eeprom", 0) |
| r243192 | r243193 | |
| 6510 | 6514 | ROM_LOAD( "ic17s.bin", 0x8800000, 0x800000, CRC(b4c40606) SHA1(4f187dfe44bd89c90b6fa4b90f16222bc0a74d22) ) |
| 6511 | 6515 | // .18s chip is not present but is tested for an FF fill (pull-up resistors on the PCB's data bus presumably accomplish this) |
| 6512 | 6516 | |
| 6513 | ROM_ | |
| 6517 | ROM_REGION( 4, "rom_key", ROMREGION_ERASE00 ) | |
| 6514 | 6518 | |
| 6515 | 6519 | // this dump can't be used as main_eeprom, because that's exactly 0x80 bytes |
| 6516 | 6520 | ROM_REGION(0x84, "some_eeprom", 0) |
| r243192 | r243193 | |
| 6531 | 6535 | ROM_LOAD( "mpr-23280.ic6", 0x5800000, 0x1000000, CRC(b1c8daa2) SHA1(a05fb374156ea013e35502abccc92f5117c39daa) ) |
| 6532 | 6536 | ROM_LOAD( "mpr-23281.ic7", 0x6800000, 0x0800000, CRC(c0378369) SHA1(c728a181eddb01b9f8574669d4550baed559a5a4) ) |
| 6533 | 6537 | |
| 6534 | ROM_ | |
| 6538 | ROM_REGION( 4, "rom_key", ROMREGION_ERASE00 ) | |
| 6535 | 6539 | |
| 6536 | 6540 | // this dump can't be used as main_eeprom, because that's exactly 0x80 bytes |
| 6537 | 6541 | ROM_REGION(0x84, "some_eeprom", 0) |
| r243192 | r243193 | |
| 6553 | 6557 | ROM_LOAD( "mpr-24128.ic6", 0x5800000, 0x1000000, CRC(bfdbb853) SHA1(bfbeb6ab634201af68d1427dea4f50163673fc2c) ) |
| 6554 | 6558 | ROM_LOAD( "mpr-24129.ic7", 0x6800000, 0x1000000, CRC(c3f0f06a) SHA1(152324f2dbbde5560ae3adb1f9394a273fedbe9c) ) |
| 6555 | 6559 | |
| 6556 | ROM_ | |
| 6560 | ROM_REGION( 4, "rom_key", ROMREGION_ERASE00 ) | |
| 6557 | 6561 | ROM_END |
| 6558 | 6562 | |
| 6559 | 6563 | /* prototype cartridges for games released on GD-ROM */ |
| r243192 | r243193 | |
| 6589 | 6593 | ROM_COPY( "rom_board", 0x01000000, 0x400000, 0xc00000 ) |
| 6590 | 6594 | |
| 6591 | 6595 | // M1 board, but it doesn't appear the protection is used |
| 6592 | ROM_ | |
| 6596 | ROM_REGION( 4, "rom_key", ROMREGION_ERASE00 ) | |
| 6593 | 6597 | |
| 6594 | 6598 | // this dump can't be used as main_eeprom, because that's exactly 0x80 bytes |
| 6595 | 6599 | ROM_REGION(0x84, "some_eeprom", 0) |
| r243192 | r243193 | |
| 7786 | 7790 | NAOMI_DEFAULT_EEPROM |
| 7787 | 7791 | |
| 7788 | 7792 | ROM_REGION( 0xb000000, "rom_board", ROMREGION_ERASEFF) |
| 7789 | // rom was handmade from 2 damaged dumps, needs to be verified | |
| 7790 | ROM_LOAD( "epr-23663.ic22", 0x0000000, 0x0400000, BAD_DUMP CRC(6910a008) SHA1(865affff1cf31321725ef727a17be384555e3aae) ) | |
| 7793 | ROM_LOAD( "epr-23663c.ic22",0x0000000, 0x0400000, CRC(7007fec7) SHA1(523168f0b218d0bd5c815d65bf0caba2c8468c9d) ) | |
| 7791 | 7794 | ROM_LOAD( "mpr-23652.ic1", 0x0800000, 0x1000000, CRC(992758a2) SHA1(5e2a25c520c1795128e5026fc00d355c24852ded) ) |
| 7792 | 7795 | ROM_LOAD( "mpr-23653.ic2", 0x1800000, 0x1000000, CRC(e210e932) SHA1(2f6f0a31c3e98b21f1ff3af1680e50b3535b130f) ) |
| 7793 | 7796 | ROM_LOAD( "mpr-23654.ic3", 0x2800000, 0x1000000, CRC(91335971) SHA1(fc7599b836fb7995dd7da940e64b08b3c09cb180) ) |
| r243192 | r243193 | |
| 7800 | 7803 | ROM_LOAD( "mpr-23661.ic10", 0x9800000, 0x1000000, CRC(7d44dc74) SHA1(cfd6253eab3c1a039629b4873946c9dbc7ed6872) ) |
| 7801 | 7804 | ROM_LOAD( "mpr-23662.ic11", 0xa800000, 0x0800000, CRC(d6ef7d68) SHA1(4ee396af6c5caf4c5af6e9ad0e03a7ac2c5039f4) ) |
| 7802 | 7805 | |
| 7803 | // 840-0061 2001 317-0310-COM Naomi 2 | |
| 7804 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "0cee834a" ) | |
| 7806 | ROM_REGION( 4, "rom_key", 0 ) | |
| 7807 | ROM_LOAD( "vstrik3c-key.bin", 0, 4, CRC(049f41b0) SHA1(4ea444878c8e9288ec95b1763d48bc92c634acdd) ) | |
| 7805 | 7808 | ROM_END |
| 7806 | 7809 | |
| 7807 | 7810 | ROM_START( vstrik3cb ) |
| r243192 | r243193 | |
| 7822 | 7825 | ROM_LOAD( "mpr-23661.ic10", 0x9800000, 0x1000000, CRC(7d44dc74) SHA1(cfd6253eab3c1a039629b4873946c9dbc7ed6872) ) |
| 7823 | 7826 | ROM_LOAD( "mpr-23662.ic11", 0xa800000, 0x0800000, CRC(d6ef7d68) SHA1(4ee396af6c5caf4c5af6e9ad0e03a7ac2c5039f4) ) |
| 7824 | 7827 | |
| 7825 | // 840-0061 2001 317-0310-COM Naomi 2 | |
| 7826 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "0cee834a" ) | |
| 7828 | ROM_REGION( 4, "rom_key", 0 ) | |
| 7829 | ROM_LOAD( "vstrik3c-key.bin", 0, 4, CRC(049f41b0) SHA1(4ea444878c8e9288ec95b1763d48bc92c634acdd) ) | |
| 7827 | 7830 | ROM_END |
| 7828 | 7831 | |
| 7829 | 7832 | ROM_START( wldrider ) |
| r243192 | r243193 | |
| 7843 | 7846 | ROM_LOAD( "mpr-23619.ic9", 0x8800000, 0x1000000, CRC(a5f4f6af) SHA1(bb89d3f0f5bbaf7c40fa43680c7e51ef93f7ed26) ) |
| 7844 | 7847 | ROM_LOAD( "mpr-23620.ic10", 0x9800000, 0x1000000, CRC(67aa15a9) SHA1(42c24cbf7069c27430a71509a872cd1c4224aaeb) ) |
| 7845 | 7848 | |
| 7846 | // 840-0046 2001 317-0301-COM Naomi 2 | |
| 7847 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "0ce7a703" ) | |
| 7849 | ROM_REGION( 4, "rom_key", 0 ) | |
| 7850 | ROM_LOAD( "wldrider-key.bin", 0, 4, CRC(f5a662ad) SHA1(a75b1e490d1f7d57cd8976115572266d1ca05202) ) | |
| 7848 | 7851 | ROM_END |
| 7849 | 7852 | |
| 7850 | 7853 | ROM_START( vf4cart ) |
| r243192 | r243193 | |
| 7865 | 7868 | ROM_LOAD( "mpr-23783.ic10", 0x9800000, 0x1000000, CRC(c8d4f6f9) SHA1(9e9df605c050b3780d7df34bd5041d30bc084d2d) ) |
| 7866 | 7869 | ROM_LOAD( "mpr-23784.ic11", 0xa800000, 0x1000000, CRC(f74f2fee) SHA1(84b07baa6d116727e66ef27e24ba6484c3393891) ) |
| 7867 | 7870 | |
| 7868 | // 840-0080 2002 317-0324-COM Naomi 2 | |
| 7869 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "0eef2f96" ) | |
| 7871 | ROM_REGION( 4, "rom_key", 0 ) | |
| 7872 | ROM_LOAD( "vf4cart-key.bin", 0, 4, CRC(22838e16) SHA1(afee674dce3cfdd20360c30da2da5ba69f8d4682) ) | |
| 7870 | 7873 | ROM_END |
| 7871 | 7874 | |
| 7872 | 7875 | // There is also a development cart (171-7885A) with 20x 64Mb FlashROMs instead of 10x 128Mb MaskROMs. Content is the same. |
| r243192 | r243193 | |
| 7887 | 7890 | ROM_LOAD("mpr-23816.ic9", 0x08800000, 0x01000000, CRC(bbaf0765) SHA1(3b79a4eff504b2156bea8b86c6cdd8e41e7bf268) ) |
| 7888 | 7891 | ROM_LOAD("mpr-23817.ic10", 0x09800000, 0x01000000, CRC(e179cfb6) SHA1(1120036238439f8ac1041150396e4b60e4a243bc) ) |
| 7889 | 7892 | |
| 7890 | ROM_ | |
| 7893 | ROM_REGION( 4, "rom_key", ROMREGION_ERASE00 ) | |
| 7891 | 7894 | ROM_END |
| 7892 | 7895 | |
| 7893 | 7896 | ROM_START( soulsurf ) |
| r243192 | r243193 | |
| 7919 | 7922 | ROM_LOAD( "ic20s.bin", 0xa000000, 0x800000, CRC(c90b960d) SHA1(66e9f09d1f7f6a991371574a2e095c0e22fb7031) ) |
| 7920 | 7923 | ROM_LOAD( "ic21s.bin", 0xa800000, 0x800000, CRC(1477c064) SHA1(87fb8d8a91d6bed70b246a8df88fa77fbf3db443) ) |
| 7921 | 7924 | |
| 7922 | ROM_ | |
| 7925 | ROM_REGION( 4, "rom_key", ROMREGION_ERASE00 ) | |
| 7923 | 7926 | ROM_END |
| 7924 | 7927 | |
| 7925 | 7928 | ROM_START( vf4evoct ) |
| r243192 | r243193 | |
| 7951 | 7954 | |
| 7952 | 7955 | ROM_COPY( "rom_board", 0x1000000, 0x400000, 0xc00000 ) |
| 7953 | 7956 | |
| 7954 | // 840-0106 2002 | |
| 7955 | ROM_PARAMETER( ":rom_board:key", "cdb05b1e" ) | |
| 7957 | ROM_REGION( 4, "rom_key", 0 ) | |
| 7958 | ROM_LOAD( "vf4evoct-key.bin", 0, 4, CRC(c37dae2b) SHA1(c42dc01b5918db36e7eb2aca523e2f4df567725a) ) | |
| 7956 | 7959 | ROM_END |
| 7957 | 7960 | |
| 7958 | 7961 | ROM_START( hopper ) |
| r243192 | r243193 | |
| 7988 | 7991 | ROM_LOAD( "mpr-23702.ic10", 0x9800000, 0x1000000, CRC(e302b582) SHA1(787192ed9f9a08541eecc3128855485cad802a42) ) |
| 7989 | 7992 | ROM_LOAD( "mpr-23703.ic11", 0xa800000, 0x1000000, CRC(702b8b4a) SHA1(3a8dfde458f341e7db20664382b9fce2b6e5d462) ) |
| 7990 | 7993 | |
| 7991 | // 840-0062 2001 317-0313-COM Naomi 2 | |
| 7992 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "0ce7d742" ) | |
| 7994 | ROM_REGION( 4, "rom_key", 0 ) | |
| 7995 | ROM_LOAD( "clubkrte-key.bin", 0, 4, CRC(db426a5d) SHA1(6a6a0b80ec0416605541159efea379dc19fe796d) ) | |
| 7993 | 7996 | ROM_END |
| 7994 | 7997 | |
| 7995 | 7998 | ROM_START( clubkrtd ) |
| r243192 | r243193 | |
| 8010 | 8013 | ROM_LOAD( "mpr-23702.ic10", 0x9800000, 0x1000000, CRC(e302b582) SHA1(787192ed9f9a08541eecc3128855485cad802a42) ) |
| 8011 | 8014 | ROM_LOAD( "mpr-23703.ic11", 0xa800000, 0x1000000, CRC(702b8b4a) SHA1(3a8dfde458f341e7db20664382b9fce2b6e5d462) ) |
| 8012 | 8015 | |
| 8013 | // 840-0062 2001 317-0313-COM Naomi 2 | |
| 8014 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "0ce7d742" ) | |
| 8016 | ROM_REGION( 4, "rom_key", 0 ) | |
| 8017 | ROM_LOAD( "clubkrte-key.bin", 0, 4, CRC(db426a5d) SHA1(6a6a0b80ec0416605541159efea379dc19fe796d) ) | |
| 8015 | 8018 | ROM_END |
| 8016 | 8019 | |
| 8017 | 8020 | ROM_START( clubkrtc ) |
| r243192 | r243193 | |
| 8032 | 8035 | ROM_LOAD( "mpr-23702.ic10", 0x9800000, 0x1000000, CRC(e302b582) SHA1(787192ed9f9a08541eecc3128855485cad802a42) ) |
| 8033 | 8036 | ROM_LOAD( "mpr-23703.ic11", 0xa800000, 0x1000000, CRC(702b8b4a) SHA1(3a8dfde458f341e7db20664382b9fce2b6e5d462) ) |
| 8034 | 8037 | |
| 8035 | // 840-0062 2001 317-0313-COM Naomi 2 | |
| 8036 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "0ce7d742" ) | |
| 8038 | ROM_REGION( 4, "rom_key", 0 ) | |
| 8039 | ROM_LOAD( "clubkrte-key.bin", 0, 4, CRC(db426a5d) SHA1(6a6a0b80ec0416605541159efea379dc19fe796d) ) | |
| 8037 | 8040 | ROM_END |
| 8038 | 8041 | |
| 8039 | 8042 | ROM_START( clubkprz ) |
| r243192 | r243193 | |
| 8065 | 8068 | ROM_REGION(0x84, "some_eeprom", 0) |
| 8066 | 8069 | ROM_LOAD( "at25010.ic3s", 0x000000, 0x000084, CRC(0142d8be) SHA1(5922b6c47b12b19e1fa7bbe9aae391905038a7ff) ) |
| 8067 | 8070 | |
| 8068 | // 840-0062 2001 317-0313-COM Naomi 2 | |
| 8069 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "0ce7d742" ) | |
| 8071 | ROM_REGION( 4, "rom_key", 0 ) // 317-0368-COM | |
| 8072 | ROM_LOAD( "clubkprz-key.bin", 0x000000, 0x000004, CRC(c9ed13c1) SHA1(2907985375cd5b04846e7214d200926be64d06fd) ) | |
| 8070 | 8073 | ROM_END |
| 8071 | 8074 | |
| 8072 | 8075 | ROM_START( clubkpzb ) |
| r243192 | r243193 | |
| 8094 | 8097 | |
| 8095 | 8098 | ROM_COPY( "rom_board", 0x1000000, 0x400000, 0xc00000 ) |
| 8096 | 8099 | |
| 8097 | // 840-0062 2001 317-0313-COM Naomi 2 | |
| 8098 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "0ce7d742" ) | |
| 8100 | ROM_REGION( 4, "rom_key", ROMREGION_ERASE00 ) | |
| 8101 | ROM_LOAD( "clubkprz-key.bin", 0x000000, 0x000004, CRC(c9ed13c1) SHA1(2907985375cd5b04846e7214d200926be64d06fd) ) | |
| 8099 | 8102 | |
| 8100 | 8103 | // this dump can't be used as main_eeprom, because that's exactly 0x80 bytes |
| 8101 | 8104 | ROM_REGION(0x84, "some_eeprom", 0) |
| r243192 | r243193 | |
| 8129 | 8132 | |
| 8130 | 8133 | ROM_COPY( "rom_board", 0x1000000, 0x400000, 0xc00000 ) |
| 8131 | 8134 | |
| 8132 | // 840-0062 2001 317-0313-COM Naomi 2 | |
| 8133 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "0ce7d742" ) | |
| 8135 | ROM_REGION( 4, "rom_key", 0 ) | |
| 8136 | ROM_LOAD( "clubk2k3-key.bin", 0x000000, 0x000004, CRC(96c3b4f6) SHA1(9b85a418153c70f56aaeeb1ed0bbbbd31a1bbad7) ) | |
| 8134 | 8137 | ROM_END |
| 8135 | 8138 | |
| 8136 | 8139 | // uses the same mask roms data as clubk2k3, but not in 32bit dissected form, EPR doesn't have checksumms for them, so rom test shows all roms as BAD |
| r243192 | r243193 | |
| 9031 | 9034 | |
| 9032 | 9035 | /* 840-xxxxx (Sega Naomi 2 cart games) */ |
| 9033 | 9036 | /* 0046 */ GAME( 2001, wldrider, naomi2, naomi2m2, naomi, naomi_state, naomi2, ROT0, "Sega", "Wild Riders (JPN, USA, EXP, KOR, AUS)", GAME_FLAGS ) |
| 9034 | /* 0061 */ GAME( 2001, vstrik3c, naomi2, naomi2m2, naomi, naomi_state, naomi2, ROT0, "Sega", "Virtua Striker 3 (USA, EXP, KOR, AUS) (Cart)", GAME_FLAGS ) | |
| 9037 | /* 0061 */ GAME( 2001, vstrik3c, naomi2, naomi2m2, naomi, naomi_state, naomi2, ROT0, "Sega", "Virtua Striker 3 (USA, EXP, KOR, AUS) (Cart, Rev C)", GAME_FLAGS ) | |
| 9035 | 9038 | /* 0061 */ GAME( 2001, vstrik3cb,vstrik3c,naomi2m2, naomi, naomi_state, naomi2, ROT0, "Sega", "Virtua Striker 3 (USA, EXP, KOR, AUS) (Cart, Rev B)", GAME_FLAGS ) |
| 9036 | 9039 | /* 0062 */ GAME( 2001, clubkrte, naomi2, naomi2m2, naomi, naomi_state, naomi2, ROT0, "Sega", "Club Kart: European Session", GAME_FLAGS ) |
| 9037 | 9040 | /* 0062 */ GAME( 2001, clubkrtd, clubkrte,naomi2m2, naomi, naomi_state, naomi2, ROT0, "Sega", "Club Kart: European Session (Rev D)", GAME_FLAGS ) |
| r243192 | r243193 | |
| 9048 | 9051 | |
| 9049 | 9052 | /* 841-xxxxx ("Licensed by Sega" Naomi cart games)*/ |
| 9050 | 9053 | /* 0001 */ GAME( 1999, pstone, naomi, naomim2, naomi, naomi_state, naomi, ROT0, "Capcom", "Power Stone (JPN, USA, EUR, ASI, AUS)", GAME_FLAGS ) |
| 9051 | /* 0002 */ GAME( 1999, suchie3, naomi, naomim2, | |
| 9054 | /* 0002 */ GAME( 1999, suchie3, naomi, naomim2, naomi_mp,naomi_state,naomi_mp,ROT0, "Jaleco", "Idol Janshi Suchie-Pai 3 (JPN)", GAME_FLAGS ) | |
| 9052 | 9055 | /* 0003 */ GAME( 1999, doa2, naomi, naomim2, naomi, naomi_state, naomi, ROT0, "Tecmo", "Dead or Alive 2 (JPN, USA, EXP, KOR, AUS)", GAME_FLAGS ) |
| 9053 | 9056 | /* 0003 */ GAME( 2000, doa2m, doa2, naomim2, naomi, naomi_state, naomi, ROT0, "Tecmo", "Dead or Alive 2 Millennium (JPN, USA, EXP, KOR, AUS)", GAME_FLAGS ) |
| 9054 | 9057 | /* 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 ) |
| r243192 | r243193 | |
|---|---|---|
| 1425 | 1425 | |
| 1426 | 1426 | /******************************************************************************/ |
| 1427 | 1427 | |
| 1428 | WRITE_LINE_MEMBER(nemesis_state::sound_irq) | |
| 1429 | { | |
| 1430 | /* Interrupts _are_ generated, I wonder where they go.. */ | |
| 1431 | // m_audiocpu->set_input_line(0, HOLD_LINE); | |
| 1432 | } | |
| 1433 | ||
| 1428 | 1434 | WRITE8_MEMBER(nemesis_state::volume_callback) |
| 1429 | 1435 | { |
| 1430 | 1436 | m_k007232->set_volume(0, (data >> 4) * 0x11, 0); |
| r243192 | r243193 | |
| 1815 | 1821 | MCFG_SOUND_ROUTE(1, "rspeaker", 0.30) |
| 1816 | 1822 | |
| 1817 | 1823 | MCFG_SOUND_ADD("ymsnd", YM3812, 3579545) |
| 1818 | ||
| 1824 | MCFG_YM3812_IRQ_HANDLER(WRITELINE(nemesis_state, sound_irq)) | |
| 1819 | 1825 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) |
| 1820 | 1826 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) |
| 1821 | 1827 | |
| r243192 | r243193 | |
| 1862 | 1868 | MCFG_SOUND_ROUTE(1, "rspeaker", 0.30) |
| 1863 | 1869 | |
| 1864 | 1870 | MCFG_SOUND_ADD("ymsnd", YM3812, 3579545) |
| 1865 | ||
| 1871 | MCFG_YM3812_IRQ_HANDLER(WRITELINE(nemesis_state, sound_irq)) | |
| 1866 | 1872 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) |
| 1867 | 1873 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) |
| 1868 | 1874 |
| r243192 | r243193 | |
|---|---|---|
| 65 | 65 | * |
| 66 | 66 | */ |
| 67 | 67 | |
| 68 | // identify unknown devices in IDE | |
| 69 | 68 | |
| 70 | //#define NETLIST_DEVELOPMENT 1 | |
| 71 | ||
| 72 | 69 | #include "netlist/nl_dice_compat.h" |
| 73 | 70 | #include "netlist/devices/net_lib.h" |
| 74 | 71 | #include "netlist/analog/nld_twoterm.h" |
| r243192 | r243193 | |
|---|---|---|
| 287 | 287 | virtual void video_start(); |
| 288 | 288 | UINT32 screen_update_nmg5(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 289 | 289 | void draw_bitmap( bitmap_ind16 &bitmap ); |
| 290 | DECLARE_WRITE_LINE_MEMBER(soundirq); | |
| 290 | 291 | }; |
| 291 | 292 | |
| 292 | 293 | |
| r243192 | r243193 | |
| 951 | 952 | GFXDECODE_END |
| 952 | 953 | |
| 953 | 954 | |
| 955 | WRITE_LINE_MEMBER(nmg5_state::soundirq) | |
| 956 | { | |
| 957 | m_soundcpu->set_input_line(0, state); | |
| 958 | } | |
| 959 | ||
| 954 | 960 | void nmg5_state::machine_start() |
| 955 | 961 | { |
| 956 | 962 | save_item(NAME(m_gfx_bank)); |
| r243192 | r243193 | |
| 1005 | 1011 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 1006 | 1012 | |
| 1007 | 1013 | MCFG_SOUND_ADD("ymsnd", YM3812, 4000000) /* 4MHz */ |
| 1008 | MCFG_YM3812_IRQ_HANDLER(I | |
| 1014 | MCFG_YM3812_IRQ_HANDLER(WRITELINE(nmg5_state, soundirq)) | |
| 1009 | 1015 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 1010 | 1016 | |
| 1011 | 1017 | MCFG_OKIM6295_ADD("oki", 1000000 , OKIM6295_PIN7_HIGH) |
| r243192 | r243193 | |
|---|---|---|
| 327 | 327 | GFXDECODE_ENTRY( "gfx1", 0, oneshot8x8_layout, 0x00, 4 ) /* sprites */ |
| 328 | 328 | GFXDECODE_END |
| 329 | 329 | |
| 330 | WRITE_LINE_MEMBER(oneshot_state::irqhandler) | |
| 331 | { | |
| 332 | m_audiocpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE); | |
| 333 | } | |
| 334 | ||
| 330 | 335 | void oneshot_state::machine_start() |
| 331 | 336 | { |
| 332 | 337 | save_item(NAME(m_gun_x_p1)); |
| r243192 | r243193 | |
| 376 | 381 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 377 | 382 | |
| 378 | 383 | MCFG_SOUND_ADD("ymsnd", YM3812, 3500000) |
| 379 | MCFG_YM3812_IRQ_HANDLER(I | |
| 384 | MCFG_YM3812_IRQ_HANDLER(WRITELINE(oneshot_state, irqhandler)) | |
| 380 | 385 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 381 | 386 | |
| 382 | 387 | MCFG_OKIM6295_ADD("oki", 1056000, OKIM6295_PIN7_HIGH) // clock frequency & pin 7 not verified |
| r243192 | r243193 | |
|---|---|---|
| 84 | 84 | virtual void video_start(); |
| 85 | 85 | UINT32 screen_update_onetwo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 86 | 86 | void set_color(int offset); |
| 87 | DECLARE_WRITE_LINE_MEMBER(irqhandler); | |
| 87 | 88 | }; |
| 88 | 89 | |
| 89 | 90 | |
| r243192 | r243193 | |
| 330 | 331 | GFXDECODE_ENTRY( "gfx1", 0, tiles8x8x6_layout, 0, 2 ) |
| 331 | 332 | GFXDECODE_END |
| 332 | 333 | |
| 334 | /************************************* | |
| 335 | * | |
| 336 | * Sound interface | |
| 337 | * | |
| 338 | *************************************/ | |
| 333 | 339 | |
| 340 | WRITE_LINE_MEMBER(onetwo_state::irqhandler) | |
| 341 | { | |
| 342 | m_audiocpu->set_input_line(0, state); | |
| 343 | } | |
| 344 | ||
| 334 | 345 | /************************************* |
| 335 | 346 | * |
| 336 | 347 | * Machine driver |
| r243192 | r243193 | |
| 375 | 386 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 376 | 387 | |
| 377 | 388 | MCFG_SOUND_ADD("ymsnd", YM3812, MASTER_CLOCK) |
| 378 | MCFG_YM3812_IRQ_HANDLER(I | |
| 389 | MCFG_YM3812_IRQ_HANDLER(WRITELINE(onetwo_state, irqhandler)) | |
| 379 | 390 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 380 | 391 | |
| 381 | 392 | MCFG_OKIM6295_ADD("oki", 1056000*2, OKIM6295_PIN7_LOW) // clock frequency & pin 7 not verified |
| r243192 | r243193 | |
|---|---|---|
| 475 | 475 | |
| 476 | 476 | GAMEL( 1990, overdriv, 0, overdriv, overdriv, driver_device, 0, ROT90, "Konami", "Over Drive (set 1)", GAME_IMPERFECT_GRAPHICS | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE, layout_overdriv ) |
| 477 | 477 | GAMEL( 1990, overdriva, overdriv, overdriv, overdriv, driver_device, 0, ROT90, "Konami", "Over Drive (set 2)", GAME_IMPERFECT_GRAPHICS | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE, layout_overdriv ) |
| 478 | GAMEL( 1990, overdrivb, overdriv, overdriv, overdriv, driver_device, 0, ROT90, "Konami", "Over Drive (set 3)", GAME_IMPERFECT_GRAPHICS | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE, layout_overdriv ) | |
| 478 | GAMEL( 1990, overdrivb, overdriv, overdriv, overdriv, driver_device, 0, ROT90, "Konami", "Over Drive (set 3)", GAME_IMPERFECT_GRAPHICS | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE, layout_overdriv ) | |
| No newline at end of file |
| r243192 | r243193 | |
|---|---|---|
| 6616 | 6616 | membank("bank1")->set_entry(1); |
| 6617 | 6617 | } |
| 6618 | 6618 | |
| 6619 | DRIVER_INIT_MEMBER(pacman_state, mschamp) | |
| 6620 | { | |
| 6621 | save_item(NAME(m_counter)); | |
| 6622 | } | |
| 6623 | ||
| 6624 | 6619 | DRIVER_INIT_MEMBER(pacman_state,woodpek) |
| 6625 | 6620 | { |
| 6626 | 6621 | int i, len; |
| r243192 | r243193 | |
| 6849 | 6844 | GAME( 1981, mspacii2, mspacman, woodpek, mspacman, pacman_state, mspacii, ROT90, "bootleg (Orca)", "Ms. Pac-Man II (Orca bootleg set 2)", GAME_SUPPORTS_SAVE ) |
| 6850 | 6845 | GAME( 1981, pacgal, mspacman, woodpek, mspacman, driver_device, 0, ROT90, "hack", "Pac-Gal", GAME_SUPPORTS_SAVE ) |
| 6851 | 6846 | GAME( 1981, mspacpls, mspacman, woodpek, mspacpls, driver_device, 0, ROT90, "hack", "Ms. Pac-Man Plus", GAME_SUPPORTS_SAVE ) |
| 6852 | GAME( 1992, mschamp, mspacman, mschamp, mschamp, pacman_state, mschamp, ROT90, "hack", "Ms. Pacman Champion Edition / Zola-Puc Gal", GAME_SUPPORTS_SAVE ) /* Rayglo version */ | |
| 6853 | GAME( 1995, mschamps, mspacman, mschamp, mschamp, pacman_state, mschamp, ROT90, "hack", "Ms. Pacman Champion Edition / Super Zola-Puc Gal", GAME_SUPPORTS_SAVE ) | |
| 6847 | GAME( 1992, mschamp, mspacman, mschamp, mschamp, driver_device, 0, ROT90, "hack", "Ms. Pacman Champion Edition / Zola-Puc Gal", GAME_SUPPORTS_SAVE ) /* Rayglo version */ | |
| 6848 | GAME( 1995, mschamps, mspacman, mschamp, mschamp, driver_device, 0, ROT90, "hack", "Ms. Pacman Champion Edition / Super Zola-Puc Gal", GAME_SUPPORTS_SAVE ) | |
| 6854 | 6849 | |
| 6855 | 6850 | // These bootlegs have MADE IN GREECE clearly visible and etched into the PCBs. They were very common in Spain with several operators having their own versions. |
| 6856 | 6851 | // Based on the PCBs and copyright dates shown they were produced late 80s / early 90s. Usually they run a version of Ms. Pacman, but were sometimes converted back to regular Pac-Man |
| r243192 | r243193 | |
|---|---|---|
| 678 | 678 | |
| 679 | 679 | save_item(NAME(m_palbank)); |
| 680 | 680 | save_item(NAME(m_priority)); |
| 681 | save_item(NAME( | |
| 681 | save_item(NAME(irq_count)); | |
| 682 | 682 | } |
| 683 | 683 | |
| 684 | 684 | void paradise_state::machine_reset() |
| r243192 | r243193 | |
| 686 | 686 | m_palbank = 0; |
| 687 | 687 | m_priority = 0; |
| 688 | 688 | |
| 689 | | |
| 689 | irq_count = 0; | |
| 690 | 690 | |
| 691 | 691 | } |
| 692 | 692 | |
| 693 | 693 | INTERRUPT_GEN_MEMBER(paradise_state::paradise_irq) |
| 694 | 694 | { |
| 695 | if (m_irq_count<300) | |
| 696 | m_irq_count++; | |
| 695 | if (irq_count<300) | |
| 696 | irq_count++; | |
| 697 | 697 | else |
| 698 | 698 | m_maincpu->set_input_line(INPUT_LINE_IRQ0, HOLD_LINE); |
| 699 | 699 | } |
| r243192 | r243193 | |
|---|---|---|
| 3687 | 3687 | ROM_REGION( 0x020000, "gfx1", 0 ) |
| 3688 | 3688 | ROM_LOAD( "mro-cg2153.u72", 0x00000, 0x8000, CRC(004c9c8e) SHA1(ec3fa9d2c658de59e722d9979513d6b0c71d5742) ) /* 05/01/95 @ IGT L95-1123 */ |
| 3689 | 3689 | ROM_LOAD( "mgo-cg2153.u73", 0x08000, 0x8000, CRC(e6843b35) SHA1(2d5219a3cb054ce8b470797c0496c7e24e94ed81) ) |
| 3690 | ROM_LOAD( "mbo-cg2153.u74", 0x10000, 0x8000, CRC(e3e28611) SHA1(d040f1df6203dc0bd6a79a391fb90fb930f8dd1a) ) /* Custom Arizona Charlie's Casino | |
| 3690 | ROM_LOAD( "mbo-cg2153.u74", 0x10000, 0x8000, CRC(e3e28611) SHA1(d040f1df6203dc0bd6a79a391fb90fb930f8dd1a) ) /* Custom Arizona Charlie's Casino graphics */ | |
| 3691 | 3691 | ROM_LOAD( "mxo-cg2153.u75", 0x18000, 0x8000, CRC(3ae44f7e) SHA1(00d625b60bffef6ce622cb50a3aa93b92131f578) ) |
| 3692 | 3692 | |
| 3693 | 3693 | ROM_REGION( 0x100, "proms", 0 ) |
| r243192 | r243193 | |
| 5112 | 5112 | ROM_LOAD( "cap960.u50", 0x0000, 0x0100, CRC(00dd8d0a) SHA1(542763b12aeb0aec2b410f7c075c52907f45d171) ) |
| 5113 | 5113 | ROM_END |
| 5114 | 5114 | |
| 5115 | ROM_START( peps0366 ) /* Normal board : Double Diamonds Deluxe Slots (PS0366) - Payout 94.99% */ | |
| 5116 | ROM_REGION( 0x10000, "maincpu", 0 ) | |
| 5117 | ROM_LOAD( "ps0366_569-a2c.u68", 0x00000, 0x10000, CRC(32fd35c5) SHA1(8562608bc45328559b7c04ef4026384862bf2d51) ) /* 2 Coins Max / 1 Line */ | |
| 5118 | ||
| 5119 | ROM_REGION( 0x020000, "gfx1", 0 ) | |
| 5120 | ROM_LOAD( "mro-cg1303.u72", 0x00000, 0x8000, CRC(f5bcc47f) SHA1(b132960a095996d1790df4dcedf14a29169fe667) ) | |
| 5121 | ROM_LOAD( "mgo-cg1303.u73", 0x08000, 0x8000, CRC(e16cc01b) SHA1(086f2ac533d868dbaa3852516b6fef344dddff13) ) | |
| 5122 | ROM_LOAD( "mbo-cg1303.u74", 0x10000, 0x8000, CRC(2c1ffea2) SHA1(efc16869f994415a03663205ca2396e4c26e25a3) ) | |
| 5123 | ROM_LOAD( "mxo-cg1303.u75", 0x18000, 0x8000, CRC(7c4578e0) SHA1(70b6cf02225a4804592f44c90365f370fb83281a) ) | |
| 5124 | ||
| 5125 | ROM_REGION( 0x100, "proms", 0 ) | |
| 5126 | ROM_LOAD( "cap1303.u50", 0x0000, 0x0100, CRC(5341ea30) SHA1(63c8f7fa94dcb772c308b307f755a188b9b5e7eb) ) | |
| 5127 | ROM_END | |
| 5128 | ||
| 5129 | ROM_START( peps0372 ) /* Normal board : Double Diamonds Deluxe Slots (PS0372) - Payout 90.10% */ | |
| 5130 | ROM_REGION( 0x10000, "maincpu", 0 ) | |
| 5131 | ROM_LOAD( "ps0372_569-a2c.u68", 0x00000, 0x10000, CRC(45573591) SHA1(0a15313af506817528eb7319a0994b6993412965) ) /* 3 Coins Max / 1 Line */ | |
| 5132 | ||
| 5133 | ROM_REGION( 0x020000, "gfx1", 0 ) | |
| 5134 | ROM_LOAD( "mro-cg1303.u72", 0x00000, 0x8000, CRC(f5bcc47f) SHA1(b132960a095996d1790df4dcedf14a29169fe667) ) | |
| 5135 | ROM_LOAD( "mgo-cg1303.u73", 0x08000, 0x8000, CRC(e16cc01b) SHA1(086f2ac533d868dbaa3852516b6fef344dddff13) ) | |
| 5136 | ROM_LOAD( "mbo-cg1303.u74", 0x10000, 0x8000, CRC(2c1ffea2) SHA1(efc16869f994415a03663205ca2396e4c26e25a3) ) | |
| 5137 | ROM_LOAD( "mxo-cg1303.u75", 0x18000, 0x8000, CRC(7c4578e0) SHA1(70b6cf02225a4804592f44c90365f370fb83281a) ) | |
| 5138 | ||
| 5139 | ROM_REGION( 0x100, "proms", 0 ) | |
| 5140 | ROM_LOAD( "cap1303.u50", 0x0000, 0x0100, CRC(5341ea30) SHA1(63c8f7fa94dcb772c308b307f755a188b9b5e7eb) ) | |
| 5141 | ROM_END | |
| 5142 | ||
| 5143 | ROM_START( peps0373 ) /* Normal board : Double Diamonds Deluxe Slots (PS0373) - Payout 87.56% */ | |
| 5144 | ROM_REGION( 0x10000, "maincpu", 0 ) | |
| 5145 | ROM_LOAD( "ps0373_583-a6c.u68", 0x00000, 0x10000, CRC(085bed76) SHA1(8775f7c9654f92eab616cdda4505cbde30154889) ) /* 3 Coins Max / 1 Line */ | |
| 5146 | ||
| 5147 | ROM_REGION( 0x020000, "gfx1", 0 ) | |
| 5148 | ROM_LOAD( "mro-cg1303.u72", 0x00000, 0x8000, CRC(f5bcc47f) SHA1(b132960a095996d1790df4dcedf14a29169fe667) ) | |
| 5149 | ROM_LOAD( "mgo-cg1303.u73", 0x08000, 0x8000, CRC(e16cc01b) SHA1(086f2ac533d868dbaa3852516b6fef344dddff13) ) | |
| 5150 | ROM_LOAD( "mbo-cg1303.u74", 0x10000, 0x8000, CRC(2c1ffea2) SHA1(efc16869f994415a03663205ca2396e4c26e25a3) ) | |
| 5151 | ROM_LOAD( "mxo-cg1303.u75", 0x18000, 0x8000, CRC(7c4578e0) SHA1(70b6cf02225a4804592f44c90365f370fb83281a) ) | |
| 5152 | ||
| 5153 | ROM_REGION( 0x100, "proms", 0 ) | |
| 5154 | ROM_LOAD( "cap1303.u50", 0x0000, 0x0100, CRC(5341ea30) SHA1(63c8f7fa94dcb772c308b307f755a188b9b5e7eb) ) | |
| 5155 | ROM_END | |
| 5156 | ||
| 5157 | 5115 | ROM_START( peps0426 ) /* Normal board : Sizzling Sevens Slots (PS0268) - Payout 90.35% */ |
| 5158 | 5116 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 5159 | 5117 | ROM_LOAD( "ps0426_571-a3h.u68", 0x00000, 0x10000, CRC(b53771c1) SHA1(23fccd5facb98fc83b8903946435be4f15199ff8) ) /* 3 Coins Max / 1 Lines */ |
| r243192 | r243193 | |
| 5435 | 5393 | ROM_LOAD( "x000055p.u66", 0x00000, 0x10000, CRC(e06819df) SHA1(36590c4588b8036908e63714fbb3e77d23e60eae) ) /* Deuces Wild Poker */ |
| 5436 | 5394 | |
| 5437 | 5395 | ROM_REGION( 0x020000, "gfx1", 0 ) |
| 5438 | ROM_LOAD( "mro-cg2291.u77", 0x00000, 0x8000, CRC(db4e491c) SHA1(e371e7b236962a0f30640c683d3a0a302c51aee9) ) /* Custom The Orleans | |
| 5396 | ROM_LOAD( "mro-cg2291.u77", 0x00000, 0x8000, CRC(db4e491c) SHA1(e371e7b236962a0f30640c683d3a0a302c51aee9) ) /* Custom The Orleans graphics */ | |
| 5439 | 5397 | ROM_LOAD( "mgo-cg2291.u78", 0x08000, 0x8000, CRC(17bb35f8) SHA1(ba9e8aa3ff42b17c7be6ee46c70db22d8e60e52c) ) /* Compatible with most "standard" game sets */ |
| 5440 | 5398 | ROM_LOAD( "mbo-cg2291.u79", 0x10000, 0x8000, CRC(de1036e4) SHA1(774bbcda301754dc4a606974248847a2264c3827) ) |
| 5441 | 5399 | ROM_LOAD( "mxo-cg2291.u80", 0x18000, 0x8000, CRC(7049403c) SHA1(3a29a00fb8dfdb30dba757c1536151827ea09068) ) |
| r243192 | r243193 | |
| 5460 | 5418 | ROM_LOAD( "x000055p.u66", 0x00000, 0x10000, CRC(e06819df) SHA1(36590c4588b8036908e63714fbb3e77d23e60eae) ) /* Deuces Wild Poker */ |
| 5461 | 5419 | |
| 5462 | 5420 | ROM_REGION( 0x020000, "gfx1", 0 ) |
| 5463 | ROM_LOAD( "mro-cg2399.u72", 0x00000, 0x8000, CRC(0424f4ba) SHA1(c8b192a6f63c8c9937cb3923d27b9ba2c39823cd) ) /* Custom The Fun Ships | |
| 5421 | ROM_LOAD( "mro-cg2399.u72", 0x00000, 0x8000, CRC(0424f4ba) SHA1(c8b192a6f63c8c9937cb3923d27b9ba2c39823cd) ) /* Custom The Fun Ships graphics */ | |
| 5464 | 5422 | ROM_LOAD( "mgo-cg2399.u73", 0x08000, 0x8000, CRC(5848a2fa) SHA1(4173a473016b7a776d2b59bf3ded0be35bd43721) ) |
| 5465 | 5423 | ROM_LOAD( "mbo-cg2399.u74", 0x10000, 0x8000, CRC(5c3e16f6) SHA1(a4aa457f239527bffa6472e0d6f9d836f796b326) ) |
| 5466 | 5424 | ROM_LOAD( "mxo-cg2399.u75", 0x18000, 0x8000, CRC(bd7669d5) SHA1(4343a9764fd563e2e1cdd8558f2f53f77006b159) ) |
| r243192 | r243193 | |
| 5485 | 5443 | ROM_LOAD( "x000055p.u66", 0x00000, 0x10000, CRC(e06819df) SHA1(36590c4588b8036908e63714fbb3e77d23e60eae) ) /* Deuces Wild Poker */ |
| 5486 | 5444 | |
| 5487 | 5445 | ROM_REGION( 0x020000, "gfx1", 0 ) |
| 5488 | ROM_LOAD( "mro-cg2374.u72", 0x00000, 0x8000, CRC(ceeb714d) SHA1(6de908d04bcaa243195943affa9ad0d725de5c81) ) /* Custom Horseshoe Casino card backs */ | |
| 5489 | ROM_LOAD( "mgo-cg2374.u73", 0x08000, 0x8000, CRC(d0fabad5) SHA1(438ebe074fa3eaa3073ef042f481449f416d0665) ) | |
| 5490 | ROM_LOAD( "mbo-cg2374.u74", 0x10000, 0x8000, CRC(9a0fbc8d) SHA1(aa39f47cbeaf8218fd2d753c9a350e9eab5df5d3) ) | |
| 5491 | ROM_LOAD( "mxo-cg2374.u75", 0x18000, 0x8000, CRC(99814562) SHA1(2d8e132f4cc4edd06332c0327927219513b22832) ) | |
| 5446 | ROM_LOAD( "mro-cg2185.u77", 0x00000, 0x8000, CRC(7e64bd1a) SHA1(e988a380ee58078bf5bdc7747e83aed1393cfad8) ) /* 07/10/95 @ IGT L95-1506 */ | |
| 5447 | ROM_LOAD( "mgo-cg2185.u78", 0x08000, 0x8000, CRC(d4127893) SHA1(75039c45ba6fd171a66876c91abc3191c7feddfc) ) | |
| 5448 | ROM_LOAD( "mbo-cg2185.u79", 0x10000, 0x8000, CRC(17dba955) SHA1(5f77379c88839b3a04e235e4fb0120c77e17b60e) ) | |
| 5449 | ROM_LOAD( "mxo-cg2185.u80", 0x18000, 0x8000, CRC(583eb3b1) SHA1(4a2952424969917fb1594698a779fe5a1e99bff5) ) | |
| 5492 | 5450 | |
| 5493 | 5451 | ROM_REGION( 0x200, "proms", 0 ) |
| 5494 | ROM_LOAD( "capx | |
| 5452 | ROM_LOAD( "capx1321.u43", 0x0000, 0x0200, CRC(4b57569f) SHA1(fa29c0f627e7ce79951ec6dadec114864144f37d) ) | |
| 5495 | 5453 | ROM_END |
| 5496 | 5454 | |
| 5497 | 5455 | ROM_START( pex0055pd ) /* Superboard : Deuces Wild Poker (X000055P+XP000035) */ |
| r243192 | r243193 | |
| 7982 | 7940 | ROM_LOAD( "x002374p.u66", 0x00000, 0x10000, CRC(fc4b6c8d) SHA1(b101f9042bd54dbfdeed4c7a3acf3798096f6857) ) /* Super Aces Poker */ |
| 7983 | 7941 | |
| 7984 | 7942 | ROM_REGION( 0x020000, "gfx1", 0 ) |
| 7985 | ROM_LOAD( "mro-cg2324.u77", 0x00000, 0x8000, CRC(6eceef42) SHA1(a2ddd2a3290c41e510f483c6b633fe0002694d0b) ) | |
| 7986 | ROM_LOAD( "mgo-cg2324.u78", 0x08000, 0x8000, CRC(26d0acbe) SHA1(09a9127deb88185cd5b748bac657461eadb2f48f) ) | |
| 7987 | ROM_LOAD( "mbo-cg2324.u79", 0x10000, 0x8000, CRC(47baee32) SHA1(d8af09022ccb5fc06aa3aa4c200a734b66cbee00) ) | |
| 7988 | ROM_LOAD( "mxo-cg2324.u80", 0x18000, 0x8000, CRC(60449fc0) SHA1(251d1e04786b70c1d2bc7b02f3b69cd58ac76398) ) | |
| 7943 | ROM_LOAD( "mro-cg2374.u72", 0x00000, 0x8000, CRC(ceeb714d) SHA1(6de908d04bcaa243195943affa9ad0d725de5c81) ) /* Custom Horseshoe Casino card backs */ | |
| 7944 | ROM_LOAD( "mgo-cg2374.u73", 0x08000, 0x8000, CRC(d0fabad5) SHA1(438ebe074fa3eaa3073ef042f481449f416d0665) ) | |
| 7945 | ROM_LOAD( "mbo-cg2374.u74", 0x10000, 0x8000, CRC(9a0fbc8d) SHA1(aa39f47cbeaf8218fd2d753c9a350e9eab5df5d3) ) | |
| 7946 | ROM_LOAD( "mxo-cg2374.u75", 0x18000, 0x8000, CRC(99814562) SHA1(2d8e132f4cc4edd06332c0327927219513b22832) ) | |
| 7989 | 7947 | |
| 7990 | 7948 | ROM_REGION( 0x200, "proms", 0 ) |
| 7991 | ROM_LOAD( "capx | |
| 7949 | ROM_LOAD( "capx2374.u43", 0x0000, 0x0200, CRC(f922e1b8) SHA1(4aa5291c59431c022dc0561a6e3b38209f60286a) ) | |
| 7992 | 7950 | ROM_END |
| 7993 | 7951 | |
| 7994 | 7952 | ROM_START( pex2377p ) /* Superboard : Super Double Bonus Poker (X002377P+XP000112) */ |
| r243192 | r243193 | |
| 9290 | 9248 | GAMEL(1996, peps0298, peps0042, peplus, peplus_slots, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PS0298) Double Diamond Slots", 0, layout_pe_slots ) |
| 9291 | 9249 | GAMEL(1996, peps0308, 0, peplus, peplus_slots, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PS0308) Double Jackpot Slots", 0, layout_pe_slots ) |
| 9292 | 9250 | GAMEL(1996, peps0364, peps0021, peplus, peplus_slots, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PS0364) Red White & Blue Slots", 0, layout_pe_slots ) |
| 9293 | GAMEL(1996, peps0366, 0, peplus, peplus_slots, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PS0366) Double Diamond Deluxe Slots", 0, layout_pe_slots ) | |
| 9294 | GAMEL(1996, peps0372, peps0366, peplus, peplus_slots, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PS0372) Double Diamond Deluxe Slots", 0, layout_pe_slots ) | |
| 9295 | GAMEL(1996, peps0373, peps0366, peplus, peplus_slots, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PS0373) Double Diamond Deluxe Slots", 0, layout_pe_slots ) | |
| 9296 | 9251 | GAMEL(1996, peps0426, 0, peplus, peplus_slots, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PS0426) Sizzling Sevens Slots", 0, layout_pe_slots ) |
| 9297 | 9252 | GAMEL(1996, peps0581, peps0021, peplus, peplus_slots, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PS0581) Red White & Blue Slots", 0, layout_pe_slots ) |
| 9298 | 9253 | GAMEL(1996, peps0615, 0, peplus, peplus_slots, peplus_state, peplus, ROT0, "IGT - International Game Technology", "Player's Edge Plus (PS0615) Chaos Slots", 0, layout_pe_slots ) |
| r243192 | r243193 | |
| 9310 | 9265 | GAMEL(1995, pex0055p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000055P+XP000019) Deuces Wild Poker", 0, layout_pe_poker ) |
| 9311 | 9266 | GAMEL(1995, pex0055pa, pex0055p, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000055P+XP000022) Deuces Wild Poker (The Orleans)", 0, layout_pe_poker ) |
| 9312 | 9267 | GAMEL(1995, pex0055pb, pex0055p, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000055P+XP000023) Deuces Wild Poker (The Fun Ships)", 0, layout_pe_poker ) |
| 9313 | GAMEL(1995, pex0055pc, pex0055p, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000055P+XP000028) Deuces Wild Poker | |
| 9268 | GAMEL(1995, pex0055pc, pex0055p, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000055P+XP000028) Deuces Wild Poker", 0, layout_pe_poker ) | |
| 9314 | 9269 | GAMEL(1995, pex0055pd, pex0055p, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000055P+XP000035) Deuces Wild Poker", 0, layout_pe_poker ) |
| 9315 | 9270 | GAMEL(1995, pex0055pe, pex0055p, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000055P+XP000038) Deuces Wild Poker", 0, layout_pe_poker ) |
| 9316 | 9271 | GAMEL(1995, pex0055pf, pex0055p, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X000055P+XP000040) Deuces Wild Poker", 0, layout_pe_poker ) |
| r243192 | r243193 | |
| 9408 | 9363 | 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 ) |
| 9409 | 9364 | 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 ) |
| 9410 | 9365 | 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 ) |
| 9411 | GAMEL(1995, pex2374p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002374P+XP000112) Super Aces Poker", | |
| 9366 | GAMEL(1995, pex2374p, 0, peplus, peplus_poker, peplus_state, peplussb, ROT0, "IGT - International Game Technology", "Player's Edge Plus (X002374P+XP000112) Super Aces Poker (Horseshoe)", 0, layout_pe_poker ) | |
| 9412 | 9367 | 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 ) |
| 9413 | 9368 | 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 ) |
| 9414 | 9369 | 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 ) |
| r243192 | r243193 | |
|---|---|---|
| 190 | 190 | |
| 191 | 191 | /******************************************************************************/ |
| 192 | 192 | |
| 193 | WRITE_LINE_MEMBER(prehisle_state::irqhandler) | |
| 194 | { | |
| 195 | m_audiocpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE); | |
| 196 | } | |
| 197 | ||
| 198 | /******************************************************************************/ | |
| 199 | ||
| 193 | 200 | static MACHINE_CONFIG_START( prehisle, prehisle_state ) |
| 194 | 201 | |
| 195 | 202 | /* basic machine hardware */ |
| r243192 | r243193 | |
| 219 | 226 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 220 | 227 | |
| 221 | 228 | MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_4MHz) /* verified on pcb */ |
| 222 | MCFG_YM3812_IRQ_HANDLER(I | |
| 229 | MCFG_YM3812_IRQ_HANDLER(WRITELINE(prehisle_state, irqhandler)) | |
| 223 | 230 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 224 | 231 | |
| 225 | 232 | MCFG_SOUND_ADD("upd", UPD7759, UPD7759_STANDARD_CLOCK) |
| r243192 | r243193 | |
|---|---|---|
| 378 | 378 | |
| 379 | 379 | ***************************************************************************/ |
| 380 | 380 | |
| 381 | WRITE_LINE_MEMBER(psikyo_state::sound_irq) | |
| 382 | { | |
| 383 | m_audiocpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE); | |
| 384 | } | |
| 385 | ||
| 381 | 386 | READ8_MEMBER(psikyo_state::psikyo_soundlatch_r) |
| 382 | 387 | { |
| 383 | 388 | return m_soundlatch; |
| r243192 | r243193 | |
| 1056 | 1061 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 1057 | 1062 | |
| 1058 | 1063 | MCFG_SOUND_ADD("ymsnd", YM2610, XTAL_32MHz/4) /* verified on pcb */ |
| 1059 | MCFG_YM2610_IRQ_HANDLER(I | |
| 1064 | MCFG_YM2610_IRQ_HANDLER(WRITELINE(psikyo_state, sound_irq)) | |
| 1060 | 1065 | MCFG_SOUND_ROUTE(0, "lspeaker", 1.2) |
| 1061 | 1066 | MCFG_SOUND_ROUTE(0, "rspeaker", 1.2) |
| 1062 | 1067 | MCFG_SOUND_ROUTE(1, "lspeaker", 1.0) |
| r243192 | r243193 | |
| 1102 | 1107 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 1103 | 1108 | |
| 1104 | 1109 | MCFG_SOUND_ADD("ymsnd", YM2610, 8000000) |
| 1105 | MCFG_YM2610_IRQ_HANDLER(I | |
| 1110 | MCFG_YM2610_IRQ_HANDLER(WRITELINE(psikyo_state, sound_irq)) | |
| 1106 | 1111 | MCFG_SOUND_ROUTE(0, "lspeaker", 1.2) |
| 1107 | 1112 | MCFG_SOUND_ROUTE(0, "rspeaker", 1.2) |
| 1108 | 1113 | MCFG_SOUND_ROUTE(1, "lspeaker", 1.0) |
| r243192 | r243193 | |
| 1148 | 1153 | ***************************************************************************/ |
| 1149 | 1154 | |
| 1150 | 1155 | |
| 1156 | WRITE_LINE_MEMBER(psikyo_state::irqhandler) | |
| 1157 | { | |
| 1158 | m_audiocpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE); | |
| 1159 | } | |
| 1160 | ||
| 1151 | 1161 | static MACHINE_CONFIG_START( s1945, psikyo_state ) |
| 1152 | 1162 | |
| 1153 | 1163 | /* basic machine hardware */ |
| r243192 | r243193 | |
| 1182 | 1192 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 1183 | 1193 | |
| 1184 | 1194 | MCFG_SOUND_ADD("ymf", YMF278B, YMF278B_STD_CLOCK) |
| 1185 | MCFG_YMF278B_IRQ_HANDLER(I | |
| 1195 | MCFG_YMF278B_IRQ_HANDLER(WRITELINE(psikyo_state, irqhandler)) | |
| 1186 | 1196 | MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) |
| 1187 | 1197 | MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) |
| 1188 | 1198 | MACHINE_CONFIG_END |
| r243192 | r243193 | |
| 1221 | 1231 | ROM_LOAD32_WORD_SWAP( "4-u127.bin", 0x000000, 0x040000, CRC(8c9911ca) SHA1(821ba648b9a1d495c600cbf4606f2dbddc6f9e6f) ) // 1&0 |
| 1222 | 1232 | ROM_LOAD32_WORD_SWAP( "5-u126.bin", 0x000002, 0x040000, CRC(d20c3ef0) SHA1(264e5a7e45e130a9e7152468733337668dc5b65f) ) // 3&2 |
| 1223 | 1233 | |
| 1224 | ROM_REGION( 0x0 | |
| 1234 | ROM_REGION( 0x030000, "audiocpu", 0 ) /* Sound CPU Code */ | |
| 1225 | 1235 | ROM_LOAD( "3-u58.bin", 0x00000, 0x20000, CRC(310f5c76) SHA1(dbfd1c5a7a514bccd89fc4f7191744cf76bb745d) ) |
| 1236 | ROM_RELOAD( 0x10000, 0x20000 ) | |
| 1226 | 1237 | |
| 1227 | 1238 | ROM_REGION( 0x200000, "gfx1", 0 ) /* Sprites */ |
| 1228 | 1239 | ROM_LOAD( "u14.bin", 0x000000, 0x200000, CRC(00a546cb) SHA1(30a8679b49928d5fcbe58b5eecc2ebd08173adf8) ) |
| r243192 | r243193 | |
| 1245 | 1256 | ROM_LOAD32_WORD_SWAP( "1-u127.bin", 0x000000, 0x040000, CRC(6c45b2f8) SHA1(08473297e174f3a6d67043f3b16f4e6b9c68b826) ) // 1&0 |
| 1246 | 1257 | ROM_LOAD32_WORD_SWAP( "2-u126.bin", 0x000002, 0x040000, CRC(845a6760) SHA1(3b8fed294e28d9d8ef5cb5ec88b9ade396146a48) ) // 3&2 |
| 1247 | 1258 | |
| 1248 | ROM_REGION( 0x0 | |
| 1259 | ROM_REGION( 0x030000, "audiocpu", 0 ) /* Sound CPU Code */ | |
| 1249 | 1260 | ROM_LOAD( "3-u58.bin", 0x00000, 0x20000, CRC(310f5c76) SHA1(dbfd1c5a7a514bccd89fc4f7191744cf76bb745d) ) |
| 1261 | ROM_RELOAD( 0x10000, 0x20000 ) | |
| 1250 | 1262 | |
| 1251 | 1263 | ROM_REGION( 0x200000, "gfx1", 0 ) /* Sprites */ |
| 1252 | 1264 | ROM_LOAD( "u14.bin", 0x000000, 0x200000, CRC(00a546cb) SHA1(30a8679b49928d5fcbe58b5eecc2ebd08173adf8) ) |
| r243192 | r243193 | |
| 1288 | 1300 | ROM_LOAD32_WORD_SWAP( "4.u46", 0x000000, 0x040000, CRC(b78ec99d) SHA1(399b79931652d9df1632cd4d7ec3d214e473a5c3) ) // 1&0 |
| 1289 | 1301 | ROM_LOAD32_WORD_SWAP( "5.u39", 0x000002, 0x040000, CRC(925f095d) SHA1(301a536119a0320a756e9c6e51fb10e36b90ef16) ) // 3&2 |
| 1290 | 1302 | |
| 1291 | ROM_REGION( 0x0 | |
| 1303 | ROM_REGION( 0x030000, "audiocpu", 0 ) /* Sound CPU Code */ | |
| 1292 | 1304 | ROM_LOAD( "3.u71", 0x00000, 0x20000, CRC(2168e4ba) SHA1(ca7ad6acb5f806ce2528e7b52c19e8cceecb8543) ) |
| 1305 | ROM_RELOAD( 0x10000, 0x20000 ) | |
| 1293 | 1306 | |
| 1294 | 1307 | ROM_REGION( 0x700000, "gfx1", 0 ) /* Sprites */ |
| 1295 | 1308 | ROM_LOAD( "u14.bin", 0x000000, 0x200000, CRC(7d7e8a00) SHA1(9f35f5b54ae928e9bf2aa6ad4604f669857955ec) ) |
| r243192 | r243193 | |
| 1320 | 1333 | ROM_LOAD32_WORD_SWAP( "1k.u46", 0x000000, 0x080000, CRC(745cee52) SHA1(6c5bb92c92c55f882484417bc1aa580684019610) ) // 1&0 |
| 1321 | 1334 | ROM_LOAD32_WORD_SWAP( "2k.u39", 0x000002, 0x080000, CRC(669632fb) SHA1(885dea42e6da35e9166a208b18dbd930642c26cd) ) // 3&2 |
| 1322 | 1335 | |
| 1323 | ROM_REGION( 0x0 | |
| 1336 | ROM_REGION( 0x030000, "audiocpu", 0 ) /* Sound CPU Code */ | |
| 1324 | 1337 | ROM_LOAD( "k3.u71", 0x00000, 0x20000, CRC(11994055) SHA1(619776c178361f23de37ff14e87284ec0f1f4f10) ) |
| 1338 | ROM_RELOAD( 0x10000, 0x20000 ) | |
| 1325 | 1339 | |
| 1326 | 1340 | ROM_REGION( 0x700000, "gfx1", 0 ) /* Sprites */ |
| 1327 | 1341 | ROM_LOAD( "u14.bin", 0x000000, 0x200000, CRC(7d7e8a00) SHA1(9f35f5b54ae928e9bf2aa6ad4604f669857955ec) ) |
| r243192 | r243193 | |
| 1349 | 1363 | ROM_LOAD32_WORD_SWAP( "1.u46", 0x000000, 0x040000, CRC(474abd69) SHA1(27f37333075f9c92849101aad4875e69004d747b) ) // 1&0 |
| 1350 | 1364 | ROM_LOAD32_WORD_SWAP( "2.u39", 0x000002, 0x040000, CRC(3e3e661f) SHA1(b5648546f390539b0f727a9a62d1b9516254ae21) ) // 3&2 |
| 1351 | 1365 | |
| 1352 | ROM_REGION( 0x0 | |
| 1366 | ROM_REGION( 0x030000, "audiocpu", 0 ) /* Sound CPU Code */ | |
| 1353 | 1367 | ROM_LOAD( "3.u71", 0x00000, 0x20000, CRC(2168e4ba) SHA1(ca7ad6acb5f806ce2528e7b52c19e8cceecb8543) ) |
| 1368 | ROM_RELOAD( 0x10000, 0x20000 ) | |
| 1354 | 1369 | |
| 1355 | 1370 | ROM_REGION( 0x700000, "gfx1", 0 ) /* Sprites */ |
| 1356 | 1371 | ROM_LOAD( "u14.bin", 0x000000, 0x200000, CRC(7d7e8a00) SHA1(9f35f5b54ae928e9bf2aa6ad4604f669857955ec) ) |
| r243192 | r243193 | |
| 1379 | 1394 | ROM_LOAD32_WORD_SWAP( "4-u46.bin", 0x000000, 0x040000, CRC(8a7a28b4) SHA1(f7197be673dfd0ddf46998af81792b81d8fe9fbf) ) // 1&0 |
| 1380 | 1395 | ROM_LOAD32_WORD_SWAP( "5-u39.bin", 0x000002, 0x040000, CRC(933561fa) SHA1(f6f3b1e14b1cfeca26ef8260ac4771dc1531c357) ) // 3&2 |
| 1381 | 1396 | |
| 1382 | ROM_REGION( 0x0 | |
| 1397 | ROM_REGION( 0x030000, "audiocpu", 0 ) /* Sound CPU Code */ | |
| 1383 | 1398 | ROM_LOAD( "3-u71.bin", 0x00000, 0x20000, CRC(22411fab) SHA1(1094cb51712e40ae65d0082b408572bdec06ae8b) ) |
| 1399 | ROM_RELOAD( 0x10000, 0x20000 ) | |
| 1384 | 1400 | |
| 1385 | 1401 | ROM_REGION( 0x700000, "gfx1", 0 ) /* Sprites */ |
| 1386 | 1402 | ROM_LOAD( "u14.bin", 0x000000, 0x200000, CRC(282d89c3) SHA1(3b4b17f4a37efa2f7e232488aaba7c77d10c84d2) ) |
| r243192 | r243193 | |
| 1427 | 1443 | ROM_LOAD32_WORD_SWAP( "1-u46.bin", 0x000000, 0x080000, CRC(45fa8086) SHA1(f1753b9420596f4b828c77e877a044ba5fb01b28) ) // 1&0 |
| 1428 | 1444 | ROM_LOAD32_WORD_SWAP( "2-u39.bin", 0x000002, 0x080000, CRC(0152ab8c) SHA1(2aef4cb88341b35f20bb551716f1e5ac2731e9ba) ) // 3&2 |
| 1429 | 1445 | |
| 1430 | ROM_REGION( 0x0 | |
| 1446 | ROM_REGION( 0x030000, "audiocpu", 0 ) /* Sound CPU Code */ | |
| 1431 | 1447 | ROM_LOAD( "3-u71.bin", 0x00000, 0x20000, CRC(e3e366bd) SHA1(1f5b5909745802e263a896265ea365df76d3eaa5) ) |
| 1448 | ROM_RELOAD( 0x10000, 0x20000 ) | |
| 1432 | 1449 | |
| 1433 | 1450 | ROM_REGION( 0x800000, "gfx1", 0 ) /* Sprites */ |
| 1434 | 1451 | ROM_LOAD( "u20.bin", 0x000000, 0x200000, CRC(28a27fee) SHA1(913f3bc4d0c6fb6b776a020c8099bf96f16fd06f) ) |
| r243192 | r243193 | |
| 1557 | 1574 | ROM_LOAD32_WORD_SWAP( "2s.u40", 0x000000, 0x040000, CRC(9b10062a) SHA1(cf963bba157422b659d8d64b4493eb7d69cd07b7) ) // 1&0 |
| 1558 | 1575 | ROM_LOAD32_WORD_SWAP( "3s.u41", 0x000002, 0x040000, CRC(f87e871a) SHA1(567167c7fcfb622f78e211d74b04060c3d29d6b7) ) // 3&2 |
| 1559 | 1576 | |
| 1560 | ROM_REGION( 0x0 | |
| 1577 | ROM_REGION( 0x030000, "audiocpu", 0 ) /* Sound CPU Code */ | |
| 1561 | 1578 | ROM_LOAD( "3-u63.bin", 0x00000, 0x20000, CRC(42d40ae1) SHA1(530a5a3f78ac489b84a631ea6ce21010a4f4d31b) ) |
| 1579 | ROM_RELOAD( 0x10000, 0x20000 ) | |
| 1562 | 1580 | |
| 1563 | 1581 | ROM_REGION( 0x000100, "cpu2", 0 ) /* MCU? */ |
| 1564 | 1582 | ROM_LOAD( "4-u59.bin", 0x00000, 0x00100, NO_DUMP ) |
| r243192 | r243193 | |
| 1586 | 1604 | ROM_LOAD32_WORD_SWAP( "4-u40.bin", 0x000000, 0x040000, CRC(29ffc217) SHA1(12dc3cb32253c3908f4c440c627a0e1b32ee7cac) ) // 1&0 |
| 1587 | 1605 | ROM_LOAD32_WORD_SWAP( "5-u41.bin", 0x000002, 0x040000, CRC(c3d3fb64) SHA1(4388586bc0a6f3d62366b3c38b8b23f8a03dbf15) ) // 3&2 |
| 1588 | 1606 | |
| 1589 | ROM_REGION( 0x0 | |
| 1607 | ROM_REGION( 0x030000, "audiocpu", 0 ) /* Sound CPU Code */ | |
| 1590 | 1608 | ROM_LOAD( "3-u63.bin", 0x00000, 0x20000, CRC(42d40ae1) SHA1(530a5a3f78ac489b84a631ea6ce21010a4f4d31b) ) |
| 1609 | ROM_RELOAD( 0x10000, 0x20000 ) | |
| 1591 | 1610 | |
| 1592 | 1611 | ROM_REGION( 0x000100, "cpu2", 0 ) /* MCU? */ |
| 1593 | 1612 | ROM_LOAD( "4-u59.bin", 0x00000, 0x00100, NO_DUMP ) |
| r243192 | r243193 | |
| 1615 | 1634 | ROM_LOAD32_WORD_SWAP( "1-u40.bin", 0x000000, 0x040000, CRC(c00eb012) SHA1(080dae010ca83548ebdb3324585d15e48baf0541) ) // 1&0 |
| 1616 | 1635 | ROM_LOAD32_WORD_SWAP( "2-u41.bin", 0x000002, 0x040000, CRC(3f5a134b) SHA1(18bb3bb1e1adadcf522795f5cf7d4dc5a5dd1f30) ) // 3&2 |
| 1617 | 1636 | |
| 1618 | ROM_REGION( 0x0 | |
| 1637 | ROM_REGION( 0x030000, "audiocpu", 0 ) /* Sound CPU Code */ | |
| 1619 | 1638 | ROM_LOAD( "3-u63.bin", 0x00000, 0x20000, CRC(42d40ae1) SHA1(530a5a3f78ac489b84a631ea6ce21010a4f4d31b) ) |
| 1639 | ROM_RELOAD( 0x10000, 0x20000 ) | |
| 1620 | 1640 | |
| 1621 | 1641 | ROM_REGION( 0x000100, "cpu2", 0 ) /* MCU */ |
| 1622 | 1642 | ROM_LOAD( "4-u59.bin", 0x00000, 0x00100, NO_DUMP ) |
| r243192 | r243193 | |
| 1644 | 1664 | ROM_LOAD32_WORD_SWAP( "10.u40", 0x000000, 0x040000, CRC(5a32af36) SHA1(2eada37fd043c097a11bcf4e3e0bebb473bbc0df) ) // 1&0 |
| 1645 | 1665 | ROM_LOAD32_WORD_SWAP( "9.u41", 0x000002, 0x040000, CRC(29cc6d7d) SHA1(aeee9e88922c25c75885483d115e064c6b71540b) ) // 3&2 |
| 1646 | 1666 | |
| 1647 | ROM_REGION( 0x0 | |
| 1667 | ROM_REGION( 0x030000, "audiocpu", 0 ) /* Sound CPU Code */ | |
| 1648 | 1668 | ROM_LOAD( "3-u63.bin", 0x00000, 0x20000, CRC(42d40ae1) SHA1(530a5a3f78ac489b84a631ea6ce21010a4f4d31b) ) |
| 1669 | ROM_RELOAD( 0x10000, 0x20000 ) | |
| 1649 | 1670 | |
| 1650 | 1671 | ROM_REGION( 0x000100, "cpu2", 0 ) /* MCU */ |
| 1651 | 1672 | ROM_LOAD( "4-u59.bin", 0x00000, 0x00100, NO_DUMP ) |
| r243192 | r243193 | |
| 1695 | 1716 | ROM_LOAD32_WORD_SWAP( "5-u40.bin", 0x000000, 0x080000, CRC(90088195) SHA1(8ec48d581ecd14b3dad36edc65d5a273324cf3c1) ) // 1&0 |
| 1696 | 1717 | ROM_LOAD32_WORD_SWAP( "4-u41.bin", 0x000002, 0x080000, CRC(0d53196c) SHA1(454bb4695b13ce44ca5dac7c6d4142a8b9afa798) ) // 3&2 |
| 1697 | 1718 | |
| 1698 | ROM_REGION( 0x0 | |
| 1719 | ROM_REGION( 0x030000, "audiocpu", 0 ) /* Sound CPU Code */ | |
| 1699 | 1720 | ROM_LOAD( "1-u63.bin", 0x00000, 0x20000, CRC(2025e387) SHA1(334b0eb3b416d46ccaadff3eee6f1abba63285fb) ) |
| 1721 | ROM_RELOAD( 0x10000, 0x20000 ) | |
| 1700 | 1722 | |
| 1701 | 1723 | ROM_REGION( 0x000100, "cpu2", 0 ) /* MCU */ |
| 1702 | 1724 | ROM_LOAD( "4-u59.bin", 0x00000, 0x00100, NO_DUMP ) |
| r243192 | r243193 | |
| 1724 | 1746 | ROM_LOAD32_WORD_SWAP( "2-u40.bin", 0x000000, 0x080000, CRC(ab6fe58a) SHA1(6687a3af192b3eab60d75ca286ebb8e0636297b5) ) // 1&0 |
| 1725 | 1747 | ROM_LOAD32_WORD_SWAP( "3-u41.bin", 0x000002, 0x080000, CRC(02e42e39) SHA1(6cdb7b1cebab50c0a44cd60cd437f0e878ccac5c) ) // 3&2 |
| 1726 | 1748 | |
| 1727 | ROM_REGION( 0x0 | |
| 1749 | ROM_REGION( 0x030000, "audiocpu", 0 ) /* Sound CPU Code */ | |
| 1728 | 1750 | ROM_LOAD( "1-u63.bin", 0x00000, 0x20000, CRC(2025e387) SHA1(334b0eb3b416d46ccaadff3eee6f1abba63285fb) ) |
| 1751 | ROM_RELOAD( 0x10000, 0x20000 ) | |
| 1729 | 1752 | |
| 1730 | 1753 | ROM_REGION( 0x000100, "cpu2", 0 ) /* MCU */ |
| 1731 | 1754 | ROM_LOAD( "4-u59.bin", 0x00000, 0x00100, NO_DUMP ) |
| r243192 | r243193 | |
| 1779 | 1802 | m_ka302c_banking = 0; // SH201B doesn't have any gfx banking |
| 1780 | 1803 | |
| 1781 | 1804 | /* setup audiocpu banks */ |
| 1782 | membank("bank1")->configure_entries(0, 4, memregion("audiocpu")->base(), 0x8000); | |
| 1805 | membank("bank1")->configure_entries(0, 4, memregion("audiocpu")->base() + 0x10000, 0x8000); | |
| 1783 | 1806 | |
| 1784 | 1807 | /* Enable other regions */ |
| 1785 | 1808 | #if 0 |
| r243192 | r243193 | |
| 1836 | 1859 | |
| 1837 | 1860 | /* setup audiocpu banks */ |
| 1838 | 1861 | /* The banked rom is seen at 8200-ffff, so the last 0x200 bytes of the rom not reachable. */ |
| 1839 | membank("bank1")->configure_entries(0, 4, memregion("audiocpu")->base() + 0x200, 0x8000); | |
| 1862 | membank("bank1")->configure_entries(0, 4, memregion("audiocpu")->base() + 0x10000 + 0x200, 0x8000); | |
| 1840 | 1863 | } |
| 1841 | 1864 | |
| 1842 | 1865 | DRIVER_INIT_MEMBER(psikyo_state,gunbird) |
| r243192 | r243193 | |
| 1851 | 1874 | |
| 1852 | 1875 | /* setup audiocpu banks */ |
| 1853 | 1876 | /* The banked rom is seen at 8200-ffff, so the last 0x200 bytes of the rom not reachable. */ |
| 1854 | membank("bank1")->configure_entries(0, 4, memregion("audiocpu")->base() + 0x200, 0x8000); | |
| 1877 | membank("bank1")->configure_entries(0, 4, memregion("audiocpu")->base() + 0x10000 + 0x200, 0x8000); | |
| 1855 | 1878 | } |
| 1856 | 1879 | |
| 1857 | 1880 | |
| r243192 | r243193 | |
| 1873 | 1896 | |
| 1874 | 1897 | /* setup audiocpu banks */ |
| 1875 | 1898 | /* The banked rom is seen at 8200-ffff, so the last 0x200 bytes of the rom not reachable. */ |
| 1876 | membank("bank1")->configure_entries(0, 4, memregion("audiocpu")->base() + 0x200, 0x8000); | |
| 1899 | membank("bank1")->configure_entries(0, 4, memregion("audiocpu")->base() + 0x10000 + 0x200, 0x8000); | |
| 1877 | 1900 | } |
| 1878 | 1901 | |
| 1879 | 1902 | DRIVER_INIT_MEMBER(psikyo_state,s1945a) |
| r243192 | r243193 | |
| 1894 | 1917 | |
| 1895 | 1918 | /* setup audiocpu banks */ |
| 1896 | 1919 | /* The banked rom is seen at 8200-ffff, so the last 0x200 bytes of the rom not reachable. */ |
| 1897 | membank("bank1")->configure_entries(0, 4, memregion("audiocpu")->base() + 0x200, 0x8000); | |
| 1920 | membank("bank1")->configure_entries(0, 4, memregion("audiocpu")->base() + 0x10000 + 0x200, 0x8000); | |
| 1898 | 1921 | } |
| 1899 | 1922 | |
| 1900 | 1923 | DRIVER_INIT_MEMBER(psikyo_state,s1945j) |
| r243192 | r243193 | |
| 1915 | 1938 | |
| 1916 | 1939 | /* setup audiocpu banks */ |
| 1917 | 1940 | /* The banked rom is seen at 8200-ffff, so the last 0x200 bytes of the rom not reachable. */ |
| 1918 | membank("bank1")->configure_entries(0, 4, memregion("audiocpu")->base() + 0x200, 0x8000); | |
| 1941 | membank("bank1")->configure_entries(0, 4, memregion("audiocpu")->base() + 0x10000 + 0x200, 0x8000); | |
| 1919 | 1942 | } |
| 1920 | 1943 | |
| 1921 | 1944 | DRIVER_INIT_MEMBER(psikyo_state,s1945jn) |
| r243192 | r243193 | |
| 1930 | 1953 | |
| 1931 | 1954 | /* setup audiocpu banks */ |
| 1932 | 1955 | /* The banked rom is seen at 8200-ffff, so the last 0x200 bytes of the rom not reachable. */ |
| 1933 | membank("bank1")->configure_entries(0, 4, memregion("audiocpu")->base() + 0x200, 0x8000); | |
| 1956 | membank("bank1")->configure_entries(0, 4, memregion("audiocpu")->base() + 0x10000 + 0x200, 0x8000); | |
| 1934 | 1957 | } |
| 1935 | 1958 | |
| 1936 | 1959 | DRIVER_INIT_MEMBER(psikyo_state,s1945bl) |
| r243192 | r243193 | |
|---|---|---|
| 616 | 616 | INPUT_PORTS_END |
| 617 | 617 | |
| 618 | 618 | |
| 619 | WRITE_LINE_MEMBER(psikyo4_state::irqhandler) | |
| 620 | { | |
| 621 | m_maincpu->set_input_line(12, state ? ASSERT_LINE : CLEAR_LINE); | |
| 622 | } | |
| 623 | ||
| 624 | ||
| 619 | 625 | void psikyo4_state::machine_start() |
| 620 | 626 | { |
| 621 | 627 | // configure YMF ROM banks |
| r243192 | r243193 | |
| 687 | 693 | |
| 688 | 694 | MCFG_SOUND_ADD("ymf", YMF278B, MASTER_CLOCK/2) |
| 689 | 695 | MCFG_DEVICE_ADDRESS_MAP(AS_0, ps4_ymf_map) |
| 690 | MCFG_YMF278B_IRQ_HANDLER(I | |
| 696 | MCFG_YMF278B_IRQ_HANDLER(WRITELINE(psikyo4_state, irqhandler)) | |
| 691 | 697 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) |
| 692 | 698 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) |
| 693 | 699 | MACHINE_CONFIG_END |
| r243192 | r243193 | |
|---|---|---|
| 756 | 756 | INPUT_PORTS_END |
| 757 | 757 | |
| 758 | 758 | |
| 759 | WRITE_LINE_MEMBER(psikyosh_state::irqhandler) | |
| 760 | { | |
| 761 | m_maincpu->set_input_line(12, state ? ASSERT_LINE : CLEAR_LINE); | |
| 762 | } | |
| 763 | ||
| 764 | ||
| 759 | 765 | void psikyosh_state::machine_start() |
| 760 | 766 | { |
| 761 | 767 | membank("gfxbank")->configure_entries(0, 0x1000, memregion("gfx1")->base(), 0x20000); |
| r243192 | r243193 | |
| 778 | 784 | |
| 779 | 785 | MCFG_SCREEN_ADD("screen", RASTER) |
| 780 | 786 | MCFG_SCREEN_REFRESH_RATE(60) |
| 787 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) | |
| 781 | 788 | MCFG_SCREEN_SIZE(64*8, 32*8) |
| 782 | 789 | MCFG_SCREEN_VISIBLE_AREA(0, 40*8-1, 0, 28*8-1) |
| 783 | 790 | MCFG_SCREEN_UPDATE_DRIVER(psikyosh_state, screen_update_psikyosh) |
| r243192 | r243193 | |
| 792 | 799 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 793 | 800 | |
| 794 | 801 | MCFG_SOUND_ADD("ymf", YMF278B, MASTER_CLOCK/2) |
| 795 | MCFG_YMF278B_IRQ_HANDLER(I | |
| 802 | MCFG_YMF278B_IRQ_HANDLER(WRITELINE(psikyosh_state, irqhandler)) | |
| 796 | 803 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) |
| 797 | 804 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) |
| 798 | 805 | MACHINE_CONFIG_END |
| r243192 | r243193 | |
| 812 | 819 | MCFG_CPU_MODIFY("maincpu") |
| 813 | 820 | MCFG_CPU_PROGRAM_MAP(ps5_map) |
| 814 | 821 | |
| 815 | /* Measured Hsync 16.165 KHz, Vsync 61.68 Hz */ | |
| 816 | 822 | /* Ideally this would be driven off the video register. However, it doesn't changeat runtime and MAME will pick a better screen resolution if it knows upfront */ |
| 817 | 823 | MCFG_SCREEN_MODIFY("screen") |
| 818 | MCFG_SCREEN_ | |
| 824 | MCFG_SCREEN_VISIBLE_AREA(0, 40*8-1, 0, 30*8-1) | |
| 819 | 825 | MACHINE_CONFIG_END |
| 820 | 826 | |
| 821 | 827 |
| r243192 | r243193 | |
|---|---|---|
| 947 | 947 | GAME( 1987, psychic5, 0, psychic5, psychic5, driver_device, 0, ROT270, "Jaleco / NMK", "Psychic 5 (World)", 0 ) // "Oversea's version V2.00 CHANGED BY TAMIO NAKASATO" text present in ROM, various modifications (English names, more complete attract demo etc.) |
| 948 | 948 | GAME( 1987, psychic5j, psychic5, psychic5, psychic5, driver_device, 0, ROT270, "Jaleco / NMK", "Psychic 5 (Japan)", 0 ) |
| 949 | 949 | GAME( 1988, bombsa, 0, bombsa, bombsa, driver_device, 0, ROT270, "Jaleco", "Bombs Away", GAME_NOT_WORKING ) |
| 950 |
| r243192 | r243193 | |
|---|---|---|
| 10 | 10 | driver by Nicola Salmoria |
| 11 | 11 | |
| 12 | 12 | TODO: |
| 13 | - finish spunchout protection, currently using a hacky workaround | |
| 14 | 13 | - add useless driver config to choose between pink and white color proms |
| 15 | 14 | - video raw params - pixel clock is derived from 20.16mhz xtal |
| 16 | 15 | - money bag placement might not be 100% correct in Arm Wrestling |
| r243192 | r243193 | |
| 228 | 227 | ret |= m_rp5h01->counter_r() ? 0x00 : 0x40; |
| 229 | 228 | ret |= m_rp5h01->data_r() ? 0x00 : 0x80; |
| 230 | 229 | |
| 231 | // FIXME - hack d6/d7 state until we figure out why the game resets | |
| 232 | /* PC = 0x0313 */ | |
| 233 | /* (ret or 0x10) -> (D7DF),(D7A0) - (D7DF),(D7A0) = 0d0h(ret nc) */ | |
| 234 | ret &= 0x3f; | |
| 235 | if (space.device().safe_pcbase() == 0x0313) | |
| 236 | { | |
| 237 | ret |= 0xc0; | |
| 238 | } | |
| 239 | ||
| 240 | 230 | return ret; |
| 241 | 231 | } |
| 242 | 232 |
| r243192 | r243193 | |
|---|---|---|
| 956 | 956 | |
| 957 | 957 | for ( int x = cliprect.min_x; x <= cliprect.max_x; x++ ) |
| 958 | 958 | { |
| 959 | dest_ptr[x] = ( y1_ptr[x] ) ? vdp2_ptr[x] : vdp1_ptr[x]; | |
| 960 | //dest_ptr[x] = y1_ptr[x] ? 0x00FF00 : 0xFF0000; | |
| 959 | dest_ptr[x] = ( y1_ptr[x] ) ? vdp1_ptr[x] : vdp2_ptr[x]; | |
| 960 | //dest_ptr[x] = y1_ptr[x] ? 0xFF0000 : 0x00FF00; | |
| 961 | 961 | } |
| 962 | 962 | } |
| 963 | 963 |
| r243192 | r243193 | |
|---|---|---|
| 368 | 368 | |
| 369 | 369 | void segajw_state::machine_start() |
| 370 | 370 | { |
| 371 | save_item(NAME(m_coin_start_cycles)); | |
| 372 | save_item(NAME(m_hopper_start_cycles)); | |
| 373 | save_item(NAME(m_coin_counter)); | |
| 374 | save_item(NAME(m_coin_lockout)); | |
| 375 | save_item(NAME(m_hopper_ctrl)); | |
| 376 | save_item(NAME(m_lamps)); | |
| 377 | 371 | } |
| 378 | 372 | |
| 379 | 373 | |
| r243192 | r243193 | |
| 444 | 438 | ROM_END |
| 445 | 439 | |
| 446 | 440 | |
| 447 | GAMEL( 1991, segajw, 0, segajw, segajw, driver_device, 0, ROT0, "Sega", "Golden Poker Series \"Joker's Wild\" (Rev. B)", GAME_NOT_WORKING | GAME_ | |
| 441 | GAMEL( 1991, segajw, 0, segajw, segajw, driver_device, 0, ROT0, "Sega", "Golden Poker Series \"Joker's Wild\" (Rev. B)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS, layout_segajw ) // TODO: correct title |
| r243192 | r243193 | |
|---|---|---|
| 1584 | 1584 | PORT_DIPSETTING( 0x0040, DEF_STR( 1C_5C ) ) |
| 1585 | 1585 | PORT_DIPSETTING( 0x0000, "1 Coin/10 Credits" ) |
| 1586 | 1586 | |
| 1587 | PORT_START("DSW2") // $400302.w | |
| 1587 | PORT_START("DSW2") // $400302.w PORT_START("DSW2") // $400302.w | |
| 1588 | 1588 | PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:1") // used |
| 1589 | 1589 | PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) |
| 1590 | 1590 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| r243192 | r243193 | |
| 1648 | 1648 | |
| 1649 | 1649 | static INPUT_PORTS_START( endrichs ) |
| 1650 | 1650 | PORT_INCLUDE(reelquak) |
| 1651 | ||
| 1651 | ||
| 1652 | 1652 | PORT_MODIFY("DSW1") // $400300.w |
| 1653 | 1653 | PORT_DIPNAME( 0x0001, 0x0001, "Payout Style" ) PORT_DIPLOCATION("SW1:1") |
| 1654 | 1654 | PORT_DIPSETTING( 0x0001, "Normal Payout" ) |
| r243192 | r243193 | |
|---|---|---|
| 28 | 28 | public: |
| 29 | 29 | silvmil_state(const machine_config &mconfig, device_type type, const char *tag) |
| 30 | 30 | : driver_device(mconfig, type, tag), |
| 31 | m_maincpu(*this, "maincpu"), | |
| 32 | m_gfxdecode(*this, "gfxdecode"), | |
| 33 | m_sprgen(*this, "spritegen"), | |
| 34 | 31 | m_bg_videoram(*this, "bg_videoram"), |
| 35 | 32 | m_fg_videoram(*this, "fg_videoram"), |
| 36 | m_spriteram(*this, "spriteram") { } | |
| 33 | m_spriteram(*this, "spriteram"), | |
| 34 | m_sprgen(*this, "spritegen"), | |
| 35 | m_maincpu(*this, "maincpu"), | |
| 36 | m_gfxdecode(*this, "gfxdecode") { } | |
| 37 | 37 | |
| 38 | ||
| 39 | /* devices */ | |
| 40 | required_device<cpu_device> m_maincpu; | |
| 41 | required_device<gfxdecode_device> m_gfxdecode; | |
| 42 | required_device<decospr_device> m_sprgen; | |
| 43 | ||
| 44 | 38 | /* memory pointers */ |
| 45 | 39 | required_shared_ptr<UINT16> m_bg_videoram; |
| 46 | 40 | required_shared_ptr<UINT16> m_fg_videoram; |
| 47 | 41 | required_shared_ptr<UINT16> m_spriteram; |
| 42 | optional_device<decospr_device> m_sprgen; | |
| 48 | 43 | |
| 49 | 44 | /* video-related */ |
| 50 | 45 | tilemap_t *m_bg_layer; |
| r243192 | r243193 | |
| 119 | 114 | virtual void video_start(); |
| 120 | 115 | UINT32 screen_update_silvmil(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 121 | 116 | void tumblepb_gfx1_rearrange(); |
| 117 | required_device<cpu_device> m_maincpu; | |
| 118 | required_device<gfxdecode_device> m_gfxdecode; | |
| 122 | 119 | }; |
| 123 | 120 | |
| 124 | 121 | |
| r243192 | r243193 | |
| 283 | 280 | |
| 284 | 281 | void silvmil_state::machine_start() |
| 285 | 282 | { |
| 286 | save_item(NAME(m_silvmil_tilebank)); | |
| 287 | save_item(NAME(m_whichbank)); | |
| 288 | 283 | } |
| 289 | 284 | |
| 290 | 285 | void silvmil_state::machine_reset() |
| r243192 | r243193 | |
| 432 | 427 | tumblepb_gfx1_rearrange(); |
| 433 | 428 | } |
| 434 | 429 | |
| 435 | GAME( 1995, silvmil, 0, silvmil, silvmil, silvmil_state, silvmil, ROT270, "Para", "Silver Millennium", | |
| 430 | GAME( 1995, silvmil, 0, silvmil, silvmil, silvmil_state, silvmil, ROT270, "Para", "Silver Millennium", 0 ) |
| r243192 | r243193 | |
|---|---|---|
| 569 | 569 | |
| 570 | 570 | /******************************************************************************/ |
| 571 | 571 | |
| 572 | WRITE_LINE_MEMBER(snk68_state::irqhandler) | |
| 573 | { | |
| 574 | m_soundcpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE); | |
| 575 | } | |
| 576 | ||
| 577 | /******************************************************************************/ | |
| 578 | ||
| 572 | 579 | static MACHINE_CONFIG_START( pow, snk68_state ) |
| 573 | 580 | |
| 574 | 581 | /* basic machine hardware */ |
| r243192 | r243193 | |
| 597 | 604 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 598 | 605 | |
| 599 | 606 | MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_8MHz/2) /* verified on pcb */ |
| 600 | MCFG_YM3812_IRQ_HANDLER(I | |
| 607 | MCFG_YM3812_IRQ_HANDLER(WRITELINE(snk68_state, irqhandler)) | |
| 601 | 608 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 602 | 609 | |
| 603 | 610 | MCFG_SOUND_ADD("upd", UPD7759, UPD7759_STANDARD_CLOCK) |
| r243192 | r243193 | |
|---|---|---|
| 185 | 185 | if (ACCESSING_BITS_0_7) soundlatch_byte_w(space,0,data & 0xff); |
| 186 | 186 | } |
| 187 | 187 | |
| 188 | READ16_MEMBER(snowbros_state::toto_read) | |
| 189 | { | |
| 190 | int pc = space.device().safe_pc(); | |
| 191 | if ((pc!= 0x3f010) && (pc!= 0x38008)) printf("toto prot %08x %04x\n", pc, mem_mask); | |
| 192 | return 0x0700; | |
| 193 | } | |
| 194 | ||
| 195 | 188 | /* Snow Bros Memory Map */ |
| 196 | 189 | |
| 197 | 190 | static ADDRESS_MAP_START( snowbros_map, AS_PROGRAM, 16, snowbros_state ) |
| r243192 | r243193 | |
| 1542 | 1535 | GFXDECODE_ENTRY( "gfx1", 0, hyperpac_tilelayout, 0, 16 ) |
| 1543 | 1536 | GFXDECODE_END |
| 1544 | 1537 | |
| 1538 | /* handler called by the 3812/2151 emulator when the internal timers cause an IRQ */ | |
| 1539 | WRITE_LINE_MEMBER(snowbros_state::irqhandler) | |
| 1540 | { | |
| 1541 | m_soundcpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE); | |
| 1542 | } | |
| 1543 | ||
| 1545 | 1544 | MACHINE_RESET_MEMBER(snowbros_state,semiprot) |
| 1546 | 1545 | { |
| 1547 | 1546 | UINT16 *PROTDATA = (UINT16*)memregion("user1")->base(); |
| r243192 | r243193 | |
| 1593 | 1592 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 1594 | 1593 | |
| 1595 | 1594 | MCFG_SOUND_ADD("ymsnd", YM3812, 3000000) |
| 1596 | MCFG_YM3812_IRQ_HANDLER(I | |
| 1595 | MCFG_YM3812_IRQ_HANDLER(WRITELINE(snowbros_state, irqhandler)) | |
| 1597 | 1596 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 1598 | 1597 | MACHINE_CONFIG_END |
| 1599 | 1598 | |
| r243192 | r243193 | |
| 1705 | 1704 | /* sound hardware */ |
| 1706 | 1705 | |
| 1707 | 1706 | MCFG_SOUND_ADD("ymsnd", YM3812, 3000000) |
| 1708 | MCFG_YM3812_IRQ_HANDLER(I | |
| 1707 | MCFG_YM3812_IRQ_HANDLER(WRITELINE(snowbros_state, irqhandler)) | |
| 1709 | 1708 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 1710 | 1709 | |
| 1711 | 1710 | |
| r243192 | r243193 | |
| 1956 | 1955 | ROM_LOAD16_BYTE( "wb09.bin", 0x60001, 0x10000, CRC(9be718ca) SHA1(5c195e4f13efbdb229201d2408d018861bf389cc) ) |
| 1957 | 1956 | ROM_END |
| 1958 | 1957 | |
| 1959 | ROM_START( toto ) | |
| 1960 | ROM_REGION( 0x40000, "maincpu", 0 ) | |
| 1961 | ROM_LOAD16_BYTE( "u60.5j", 0x00000, 0x20000, CRC(39203792) SHA1(4c8d560be02a514cbf91774c7a0b4a95cf573356) ) | |
| 1962 | ROM_LOAD16_BYTE( "u51.4j", 0x00001, 0x20000, CRC(7b846cd4) SHA1(04aa0bbaab4303fb08dff52d5515f7e764f1be6d)) | |
| 1963 | ||
| 1964 | ROM_REGION( 0x10000, "soundcpu", 0 ) /* 64k for z80 sound code */ | |
| 1965 | ROM_LOAD( "u46.4c", 0x0000, 0x8000, CRC(77b1ef42) SHA1(75e3c8c2b687669cc56f972dd7375dab5185859c) ) | |
| 1966 | ||
| 1967 | ROM_REGION( 0x80000, "gfx1", 0 ) | |
| 1968 | ROM_LOAD( "u107.8k", 0x00000, 0x20000, CRC(4486153b) SHA1(a6dc0c17bf2328ab725bce4aaa0a413a42129fb0) ) | |
| 1969 | ROM_LOAD( "u108.8l", 0x20000, 0x20000, CRC(3286cf5f) SHA1(133366b0e10ab86111247cbedf329e8e3a7f2148) ) | |
| 1970 | ROM_LOAD( "u109.8m", 0x40000, 0x20000, CRC(464d7251) SHA1(f03ee54e9301ea87de4171cecdbad4a5e17929c4) ) | |
| 1971 | ROM_LOAD( "u110.8n", 0x60000, 0x20000, CRC(7dea56df) SHA1(7e7b9238837c6f4221cff416a2de21723d2c9272) ) | |
| 1972 | ROM_END | |
| 1973 | ||
| 1974 | 1958 | /* Barko */ |
| 1975 | 1959 | |
| 1976 | 1960 | ROM_START( honeydol ) |
| r243192 | r243193 | |
| 2882 | 2866 | |
| 2883 | 2867 | |
| 2884 | 2868 | |
| 2885 | DRIVER_INIT_MEMBER(snowbros_state,toto) | |
| 2886 | { | |
| 2887 | // every single rom has bits 0x10 and 0x08 swapped | |
| 2888 | UINT8 *src = memregion("maincpu")->base(); | |
| 2889 | int len = memregion("maincpu")->bytes(); | |
| 2890 | ||
| 2891 | for (int i = 0; i < len; i++) | |
| 2892 | { | |
| 2893 | src[i] = BITSWAP8(src[i], 7, 6, 5, 3, 4, 2, 1, 0); | |
| 2894 | } | |
| 2895 | ||
| 2896 | src = memregion("gfx1")->base(); | |
| 2897 | len = memregion("gfx1")->bytes(); | |
| 2898 | ||
| 2899 | for (int i = 0; i < len; i++) | |
| 2900 | { | |
| 2901 | src[i] = BITSWAP8(src[i], 7, 6, 5, 3, 4, 2, 1, 0); | |
| 2902 | } | |
| 2903 | ||
| 2904 | src = memregion("soundcpu")->base(); | |
| 2905 | len = memregion("soundcpu")->bytes(); | |
| 2906 | ||
| 2907 | for (int i = 0; i < len; i++) | |
| 2908 | { | |
| 2909 | src[i] = BITSWAP8(src[i], 7, 6, 5, 3, 4, 2, 1, 0); | |
| 2910 | } | |
| 2911 | ||
| 2912 | // protection? (just return 0x07) | |
| 2913 | m_maincpu->space(AS_PROGRAM).install_read_handler(0x500006, 0x500007, read16_delegate(FUNC(snowbros_state::toto_read),this)); | |
| 2914 | } | |
| 2915 | ||
| 2916 | ||
| 2917 | ||
| 2918 | 2869 | GAME( 1990, snowbros, 0, snowbros, snowbros, driver_device, 0, ROT0, "Toaplan", "Snow Bros. - Nick & Tom (set 1)", 0 ) |
| 2919 | 2870 | GAME( 1990, snowbrosa, snowbros, snowbros, snowbros, driver_device, 0, ROT0, "Toaplan", "Snow Bros. - Nick & Tom (set 2)", 0 ) |
| 2920 | 2871 | GAME( 1990, snowbrosb, snowbros, snowbros, snowbros, driver_device, 0, ROT0, "Toaplan", "Snow Bros. - Nick & Tom (set 3)", 0 ) |
| r243192 | r243193 | |
| 2924 | 2875 | GAME( 1990, wintbob, snowbros, wintbob, snowbros, driver_device, 0, ROT0, "bootleg (Sakowa Project Korea)", "The Winter Bobble (bootleg of Snow Bros.)", 0 ) |
| 2925 | 2876 | GAME( 1990, snowbroswb,snowbros, wintbob, snowbros, driver_device, 0, ROT0, "bootleg", "Snow Bros. - Nick & Tom (The Winter Bobble hardware bootleg)", 0 ) // this was probably unhacked back from the more common Winter Bobble to make it look more original |
| 2926 | 2877 | |
| 2927 | GAME( 1996, toto, 0, snowbros, snowbros, snowbros_state, toto, ROT0, "SoftClub", "Come Back Toto", 0 ) // modified from 'snowbros' code | |
| 2928 | ||
| 2929 | 2878 | // none of the games below are on genuine SnowBros hardware, but they clone the functionality of it. |
| 2930 | 2879 | |
| 2931 | 2880 | // SemiCom / Jeil titles are protected, a dumb MCU copies code into RAM at startup, some also check for a specific return value from an address on startup. |
| r243192 | r243193 | |
|---|---|---|
| 402 | 402 | GFXDECODE_END |
| 403 | 403 | |
| 404 | 404 | |
| 405 | WRITE_LINE_MEMBER(spbactn_state::irqhandler) | |
| 406 | { | |
| 407 | m_audiocpu->set_input_line(0, state); | |
| 408 | } | |
| 409 | ||
| 405 | 410 | static MACHINE_CONFIG_START( spbactn, spbactn_state ) |
| 406 | 411 | |
| 407 | 412 | /* basic machine hardware */ |
| r243192 | r243193 | |
| 438 | 443 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 439 | 444 | |
| 440 | 445 | MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_4MHz) /* Was 3.579545MHz, a common clock, but no way to generate via on PCB OSCs */ |
| 441 | MCFG_YM3812_IRQ_HANDLER(I | |
| 446 | MCFG_YM3812_IRQ_HANDLER(WRITELINE(spbactn_state, irqhandler)) | |
| 442 | 447 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 443 | 448 | |
| 444 | 449 | MCFG_OKIM6295_ADD("oki", XTAL_4MHz/4, OKIM6295_PIN7_HIGH) /* Was 1.056MHz, a common clock, but no way to generate via on PCB OSCs. clock frequency & pin 7 not verified */ |
| r243192 | r243193 | |
| 489 | 494 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 490 | 495 | |
| 491 | 496 | MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_4MHz) |
| 492 | MCFG_YM3812_IRQ_HANDLER(I | |
| 497 | MCFG_YM3812_IRQ_HANDLER(WRITELINE(spbactn_state, irqhandler)) | |
| 493 | 498 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 494 | 499 | |
| 495 | 500 | MCFG_OKIM6295_ADD("oki", XTAL_4MHz/4, OKIM6295_PIN7_HIGH) |
| r243192 | r243193 | |
|---|---|---|
| 378 | 378 | GFXDECODE_END |
| 379 | 379 | |
| 380 | 380 | |
| 381 | WRITE_LINE_MEMBER(spdodgeb_state::irqhandler) | |
| 382 | { | |
| 383 | m_audiocpu->set_input_line(M6809_FIRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE); | |
| 384 | } | |
| 385 | ||
| 381 | 386 | void spdodgeb_state::machine_reset() |
| 382 | 387 | { |
| 383 | 388 | m_toggle = 0; |
| r243192 | r243193 | |
| 416 | 421 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 417 | 422 | |
| 418 | 423 | MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_12MHz/4) |
| 419 | MCFG_YM3812_IRQ_HANDLER(I | |
| 424 | MCFG_YM3812_IRQ_HANDLER(WRITELINE(spdodgeb_state, irqhandler)) | |
| 420 | 425 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) |
| 421 | 426 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) |
| 422 | 427 |
| r243192 | r243193 | |
|---|---|---|
| 458 | 458 | m_k007232_2->set_volume(1, 0, (data & 0x0f) * 0x11); |
| 459 | 459 | } |
| 460 | 460 | |
| 461 | WRITE_LINE_MEMBER(spy_state::irqhandler) | |
| 462 | { | |
| 463 | m_audiocpu->set_input_line(INPUT_LINE_NMI, state); | |
| 464 | } | |
| 461 | 465 | |
| 466 | ||
| 462 | 467 | void spy_state::machine_start() |
| 463 | 468 | { |
| 464 | 469 | UINT8 *ROM = memregion("maincpu")->base(); |
| r243192 | r243193 | |
| 523 | 528 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 524 | 529 | |
| 525 | 530 | MCFG_SOUND_ADD("ymsnd", YM3812, 3579545) |
| 526 | MCFG_YM3812_IRQ_HANDLER(I | |
| 531 | MCFG_YM3812_IRQ_HANDLER(WRITELINE(spy_state, irqhandler)) | |
| 527 | 532 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 528 | 533 | |
| 529 | 534 | MCFG_SOUND_ADD("k007232_1", K007232, 3579545) |
| r243192 | r243193 | |
|---|---|---|
| 769 | 769 | /*-------------------------------- |
| 770 | 770 | / Split Second #144 |
| 771 | 771 | /-------------------------------*/ |
| 772 | ROM_START(spltsec | |
| 772 | ROM_START(splitsec) | |
| 773 | 773 | ROM_REGION(0x10000, "maincpu", 0) |
| 774 | 774 | ROM_LOAD( "cpu_u1.716", 0x1000, 0x0800, CRC(c6ff9aa9) SHA1(39f80faca16c869ac14df7c5fc3dfa80b47dad95)) |
| 775 | 775 | ROM_LOAD( "cpu_u5.716", 0x1800, 0x0800, CRC(fda74efc) SHA1(31becc243ada23e2f4d17927985772c9fcf8a3c3)) |
| r243192 | r243193 | |
| 929 | 929 | GAME(1980, nineball, 0, st_mp200, mp200, st_mp200_state, st_mp200, ROT0, "Stern", "Nine Ball", GAME_IS_SKELETON_MECHANICAL) |
| 930 | 930 | GAME(1981, lightnin, 0, st_mp201, mp200, st_mp200_state, st_mp201, ROT0, "Stern", "Lightning", GAME_IS_SKELETON_MECHANICAL) |
| 931 | 931 | GAME(1980, stargzr, 0, st_mp200, mp200, st_mp200_state, st_mp200, ROT0, "Stern", "Stargazer", GAME_IS_SKELETON_MECHANICAL) |
| 932 | GAME(1981, spltsec | |
| 932 | GAME(1981, splitsec, 0, st_mp201, mp200, st_mp200_state, st_mp201, ROT0, "Stern", "Split Second", GAME_IS_SKELETON_MECHANICAL) | |
| 933 | 933 | GAME(1981, catacomp, 0, st_mp201, mp200, st_mp200_state, st_mp201, ROT0, "Stern", "Catacomb (Pinball)", GAME_IS_SKELETON_MECHANICAL) |
| 934 | 934 | GAME(1982, dragfist, 0, st_mp200, mp200, st_mp200_state, st_mp200, ROT0, "Stern", "Dragonfist", GAME_IS_SKELETON_MECHANICAL) |
| 935 | 935 | GAME(1984, lazrlord, 0, st_mp200, mp200, st_mp200_state, st_mp200, ROT0, "Stern", "Lazer Lord", GAME_IS_SKELETON_MECHANICAL) |
| r243192 | r243193 | |
|---|---|---|
| 30 | 30 | |
| 31 | 31 | /******************************************************************************/ |
| 32 | 32 | |
| 33 | READ16_MEMBER(stadhero_state::stadhero_control_r) | |
| 34 | { | |
| 35 | switch (offset<<1) | |
| 36 | { | |
| 37 | case 0: | |
| 38 | return m_inputs->read(); | |
| 39 | ||
| 40 | case 2: | |
| 41 | return m_coin->read(); | |
| 42 | ||
| 43 | case 4: | |
| 44 | return m_dsw->read(); | |
| 45 | } | |
| 46 | ||
| 47 | logerror("CPU #0 PC %06x: warning - read unmapped memory address %06x\n",space.device().safe_pc(),0x30c000+offset); | |
| 48 | return ~0; | |
| 49 | } | |
| 50 | ||
| 33 | 51 | WRITE16_MEMBER(stadhero_state::stadhero_control_w) |
| 34 | 52 | { |
| 35 | 53 | switch (offset<<1) |
| r243192 | r243193 | |
| 55 | 73 | AM_RANGE(0x240000, 0x240007) AM_DEVWRITE("tilegen1", deco_bac06_device, pf_control_0_w) /* text layer */ |
| 56 | 74 | AM_RANGE(0x240010, 0x240017) AM_DEVWRITE("tilegen1", deco_bac06_device, pf_control_1_w) |
| 57 | 75 | AM_RANGE(0x260000, 0x261fff) AM_DEVREADWRITE("tilegen1", deco_bac06_device, pf_data_r, pf_data_w) |
| 58 | AM_RANGE(0x30c000, 0x30c001) AM_READ_PORT("INPUTS") | |
| 59 | AM_RANGE(0x30c002, 0x30c003) AM_READ_PORT("COIN") | |
| 60 | AM_RANGE(0x30c004, 0x30c005) AM_READ_PORT("DSW") | |
| 61 | AM_RANGE(0x30c000, 0x30c00b) AM_WRITE(stadhero_control_w) | |
| 76 | AM_RANGE(0x30c000, 0x30c00b) AM_READWRITE(stadhero_control_r, stadhero_control_w) | |
| 62 | 77 | AM_RANGE(0x310000, 0x3107ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") |
| 63 | 78 | AM_RANGE(0xff8000, 0xffbfff) AM_RAM /* Main ram */ |
| 64 | 79 | AM_RANGE(0xffc000, 0xffc7ff) AM_MIRROR(0x000800) AM_RAM AM_SHARE("spriteram") |
| r243192 | r243193 | |
| 195 | 210 | |
| 196 | 211 | /******************************************************************************/ |
| 197 | 212 | |
| 213 | WRITE_LINE_MEMBER(stadhero_state::irqhandler) | |
| 214 | { | |
| 215 | m_audiocpu->set_input_line(0, state); | |
| 216 | } | |
| 217 | ||
| 218 | /******************************************************************************/ | |
| 219 | ||
| 198 | 220 | static MACHINE_CONFIG_START( stadhero, stadhero_state ) |
| 199 | 221 | |
| 200 | 222 | /* basic machine hardware */ |
| r243192 | r243193 | |
| 238 | 260 | MCFG_SOUND_ROUTE(3, "mono", 0.40) |
| 239 | 261 | |
| 240 | 262 | MCFG_SOUND_ADD("ym2", YM3812, XTAL_24MHz/8) |
| 241 | MCFG_YM3812_IRQ_HANDLER(I | |
| 263 | MCFG_YM3812_IRQ_HANDLER(WRITELINE(stadhero_state, irqhandler)) | |
| 242 | 264 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) |
| 243 | 265 | |
| 244 | 266 | MCFG_OKIM6295_ADD("oki", XTAL_1_056MHz, OKIM6295_PIN7_HIGH) |
| r243192 | r243193 | |
|---|---|---|
| 672 | 672 | m_maincpu->sh2drc_add_pcflush(0x60011ba); |
| 673 | 673 | m_maincpu->sh2drc_add_pcflush(0x605b9da); |
| 674 | 674 | |
| 675 | install_ | |
| 675 | install_astrass_protection(); | |
| 676 | 676 | |
| 677 | 677 | DRIVER_INIT_CALL(stv); |
| 678 | 678 | } |
| r243192 | r243193 | |
| 766 | 766 | m_maincpu->sh2drc_add_pcflush(0x6026398); |
| 767 | 767 | m_slave->sh2drc_add_pcflush(0x6028cd6); |
| 768 | 768 | |
| 769 | install_ | |
| 769 | install_sss_protection(); | |
| 770 | 770 | |
| 771 | 771 | DRIVER_INIT_CALL(stv); |
| 772 | 772 | |
| r243192 | r243193 | |
| 829 | 829 | m_slave->sh2drc_add_pcflush(0x6062bca); |
| 830 | 830 | |
| 831 | 831 | DRIVER_INIT_CALL(stv); |
| 832 | install_c | |
| 832 | install_twcup98_protection(); | |
| 833 | 833 | |
| 834 | 834 | m_minit_boost_timeslice = m_sinit_boost_timeslice = attotime::from_usec(5); |
| 835 | 835 | } |
| r243192 | r243193 | |
| 886 | 886 | m_maincpu->sh2drc_add_pcflush(0x604eac0); |
| 887 | 887 | m_slave->sh2drc_add_pcflush(0x605340a); |
| 888 | 888 | |
| 889 | install_ | |
| 889 | install_elandore_protection(); | |
| 890 | 890 | |
| 891 | 891 | DRIVER_INIT_CALL(stv); |
| 892 | 892 | m_minit_boost_timeslice = m_sinit_boost_timeslice = attotime::from_usec(0); |
| r243192 | r243193 | |
| 897 | 897 | m_maincpu->sh2drc_add_pcflush(0x6034d04); |
| 898 | 898 | m_slave->sh2drc_add_pcflush(0x6036152); |
| 899 | 899 | |
| 900 | install_ | |
| 900 | install_rsgun_protection(); | |
| 901 | 901 | |
| 902 | 902 | DRIVER_INIT_CALL(stv); |
| 903 | 903 | |
| r243192 | r243193 | |
| 906 | 906 | |
| 907 | 907 | DRIVER_INIT_MEMBER(stv_state,ffreveng) |
| 908 | 908 | { |
| 909 | install_ | |
| 909 | install_ffreveng_protection(); | |
| 910 | 910 | DRIVER_INIT_CALL(stv); |
| 911 | 911 | } |
| 912 | 912 | |
| 913 | 913 | DRIVER_INIT_MEMBER(stv_state,decathlt) |
| 914 | 914 | { |
| 915 | m_5838crypt->install_decathlt_protection(); | |
| 915 | m_decathlt_lastcount = 0; | |
| 916 | m_decathlt_prot_uploadmode = 0; | |
| 917 | m_decathlt_prot_uploadoffset = 0; | |
| 918 | install_decathlt_protection(); | |
| 916 | 919 | DRIVER_INIT_CALL(stv); |
| 917 | 920 | } |
| 918 | 921 | |
| r243192 | r243193 | |
| 1019 | 1022 | MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) |
| 1020 | 1023 | MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) |
| 1021 | 1024 | |
| 1022 | MACHINE_CONFIG_END | |
| 1023 | ||
| 1024 | static MACHINE_CONFIG_DERIVED( stv_5881, stv ) | |
| 1025 | 1025 | MCFG_DEVICE_ADD("315_5881", SEGA315_5881_CRYPT, 0) |
| 1026 | 1026 | MCFG_SET_READ_CALLBACK(stv_state, crypt_read_callback) |
| 1027 | 1027 | MACHINE_CONFIG_END |
| 1028 | 1028 | |
| 1029 | ||
| 1030 | UINT16 stv_state::crypt_read_callback_ch1(UINT32 addr) | |
| 1031 | { | |
| 1032 | return m_maincpu->space().read_word(0x02000000 + 0x1000000 + (addr * 2)); | |
| 1033 | } | |
| 1034 | ||
| 1035 | UINT16 stv_state::crypt_read_callback_ch2(UINT32 addr) | |
| 1036 | { | |
| 1037 | return m_maincpu->space().read_word(0x02000000 + 0x0000000 + (addr * 2)); | |
| 1038 | } | |
| 1039 | ||
| 1040 | static MACHINE_CONFIG_DERIVED( stv_5838, stv ) | |
| 1041 | MCFG_DEVICE_ADD("315_5838", SEGA315_5838_COMP, 0) | |
| 1042 | MCFG_SET_5838_READ_CALLBACK_CH1(stv_state, crypt_read_callback_ch1) | |
| 1043 | MCFG_SET_5838_READ_CALLBACK_CH2(stv_state, crypt_read_callback_ch2) | |
| 1044 | MACHINE_CONFIG_END | |
| 1045 | ||
| 1046 | ||
| 1047 | 1029 | /* |
| 1048 | 1030 | Batman Forever has an extra ADSP, used for sound. |
| 1049 | 1031 | Similar if not the same as Magic the Gathering, probably needs merging. |
| r243192 | r243193 | |
| 1843 | 1825 | ROM_LOAD16_WORD_SWAP( "mpr20832.8", 0x1c00000, 0x0400000, CRC(af1b0985) SHA1(d7a0e4e0a8b0556915f924bdde8c3d14e5b3423e) ) // good (was .18s) |
| 1844 | 1826 | ROM_LOAD16_WORD_SWAP( "mpr20833.9", 0x2000000, 0x0400000, CRC(cb6af231) SHA1(4a2e5d7c2fd6179c19cdefa84a03f9a34fbb9e70) ) // good (was .19s) |
| 1845 | 1827 | |
| 1846 | // 25349801 1998 317-5040-COM ST-V (yes, the 317-5040-COM chip was reused for 3 different games and on both Naomi and ST-V!) | |
| 1847 | ROM_PARAMETER( ":315_5881:key", "052e2901" ) | |
| 1828 | ROM_REGION32_BE( 0x11ea0, "user2", 0 ) | |
| 1829 | // protection data (text layer tiles) extracted from Saturn version | |
| 1830 | // stat_t.bin is name of the file from Saturn version CD | |
| 1831 | ROM_LOAD( "stat_t.bin", 0x0000000, 0x11ea0, BAD_DUMP CRC(52a0b542) SHA1(2b352dee919d7e7a5d338ece1691577d0b288eca) ) | |
| 1848 | 1832 | ROM_END |
| 1849 | 1833 | |
| 1850 | 1834 | ROM_START( bakubaku ) |
| r243192 | r243193 | |
| 1989 | 1973 | ROM_LOAD16_WORD_SWAP( "mpr21305.6", 0x1400000, 0x0400000, CRC(46cfc2a2) SHA1(8ca26bf8fa5ced040e815c125c13dd06d599e189) ) // good (was .16) |
| 1990 | 1974 | ROM_LOAD16_WORD_SWAP( "mpr21306.1", 0x1800000, 0x0400000, CRC(87a5929c) SHA1(b259341d7b0e1fa98959bf52d23db5c308a8efdd) ) // good (was .17) |
| 1991 | 1975 | ROM_LOAD16_WORD_SWAP( "mpr21308.8", 0x1c00000, 0x0400000, CRC(336ec1a4) SHA1(20d1fce050cf6132d284b91853a4dd5626372ef0) ) // good (was .18s) |
| 1992 | ||
| 1993 | // 1998 317-5043-COM ST-V | |
| 1994 | ROM_PARAMETER( ":315_5881:key", "05226d41" ) | |
| 1995 | 1976 | ROM_END |
| 1996 | 1977 | |
| 1997 | 1978 | ROM_START( ffreveng ) |
| r243192 | r243193 | |
| 2005 | 1986 | ROM_LOAD16_WORD_SWAP( "mpr21876.5", 0x1000000, 0x0400000, CRC(bb92a7fc) SHA1(d9e0fab1104a46adeb0a0cfc0d070d4c63a28d55) ) // good (was .15) |
| 2006 | 1987 | ROM_LOAD16_WORD_SWAP( "mpr21877.6", 0x1400000, 0x0400000, CRC(c22a4a75) SHA1(3276bc0628e71b432f21ba9a4f5ff7ccc8769cd9) ) // good (was .16) |
| 2007 | 1988 | ROM_LOAD16_WORD_SWAP( "opr21878.1", 0x1800000, 0x0200000, CRC(2ea4a64d) SHA1(928a973dce5eba0a1628d61ba56a530de990a946) ) // good (was .17) |
| 2008 | ||
| 2009 | // 1998 317-5049-COM ST-V | |
| 2010 | ROM_PARAMETER( ":315_5881:key", "0524ac01" ) | |
| 2011 | 1989 | ROM_END |
| 2012 | 1990 | |
| 2013 | 1991 | /* set system to 1 player to test rom */ |
| r243192 | r243193 | |
| 2264 | 2242 | ROM_LOAD16_WORD_SWAP( "mpr20960.3", 0x0800000, 0x0400000, CRC(b5ab9053) SHA1(87c5d077eb1219c35fa65b4e11d5b62e826f5236) ) // good (was .13) |
| 2265 | 2243 | ROM_LOAD16_WORD_SWAP( "mpr20961.4", 0x0c00000, 0x0400000, CRC(0e06295c) SHA1(0ec2842622f3e9dc5689abd58aeddc7e5603b97a) ) // good (was .14) |
| 2266 | 2244 | ROM_LOAD16_WORD_SWAP( "mpr20962.5", 0x1000000, 0x0400000, CRC(f1e6c7fc) SHA1(0ba0972f1bc7c56f4e0589d3e363523cea988bb0) ) // good (was .15) |
| 2267 | ||
| 2268 | // 1998 317-5041-COM ST-V | |
| 2269 | ROM_PARAMETER( ":315_5881:key", "05272d01" ) | |
| 2270 | 2245 | ROM_END |
| 2271 | 2246 | |
| 2272 | 2247 | ROM_START( sandor ) |
| r243192 | r243193 | |
| 2455 | 2430 | |
| 2456 | 2431 | ROM_REGION16_BE( 0x80, "eeprom", 0 ) // preconfigured to 1 player |
| 2457 | 2432 | ROM_LOAD( "sss.nv", 0x0000, 0x0080, CRC(3473b2f3) SHA1(6480b4b321af8ee6e967710e74f2556c17bfca97) ) |
| 2458 | ||
| 2459 | // 1998 317-5042-COM ST-V | |
| 2460 | ROM_PARAMETER( ":315_5881:key", "052b6901" ) | |
| 2461 | 2433 | ROM_END |
| 2462 | 2434 | |
| 2463 | 2435 | ROM_START( suikoenb ) |
| r243192 | r243193 | |
| 2488 | 2460 | ROM_LOAD16_WORD_SWAP( "mpr20822.3", 0x0800000, 0x0400000, CRC(8b33a5e2) SHA1(d5689ac8aad63509febe9aa4077351be09b2d8d4) ) // ic3 good (was .13) |
| 2489 | 2461 | ROM_LOAD16_WORD_SWAP( "mpr20823.4", 0x0c00000, 0x0400000, CRC(6e6d4e95) SHA1(c387d03ba27580c62ac0bf780915fdf41552df6f) ) // ic4 good (was .14) |
| 2490 | 2462 | ROM_LOAD16_WORD_SWAP( "mpr20824.5", 0x1000000, 0x0400000, CRC(4cf18a25) SHA1(310961a5f114fea8938a3f514dffd5231e910a5a) ) // ic5 good (was .15) |
| 2491 | ||
| 2492 | // 25209801 1998 317-5039-COM ST-V | |
| 2493 | ROM_PARAMETER( ":315_5881:key", "05200913" ) | |
| 2494 | 2463 | ROM_END |
| 2495 | 2464 | |
| 2496 | 2465 | ROM_START( vfkids ) |
| r243192 | r243193 | |
| 3043 | 3012 | |
| 3044 | 3013 | //GAME YEAR, NAME, PARENT, MACH, INP, INIT, MONITOR |
| 3045 | 3014 | /* Playable */ |
| 3046 | GAME( 1998, astrass, stvbios, stv | |
| 3015 | GAME( 1998, astrass, stvbios, stv, stv6b, stv_state, astrass, ROT0, "Sunsoft", "Astra SuperStars (J 980514 V1.002)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 3047 | 3016 | GAME( 1995, bakubaku, stvbios, stv, stv, stv_state, stv, ROT0, "Sega", "Baku Baku Animal (J 950407 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| 3048 | 3017 | GAME( 1996, batmanfr, stvbios, batmanfr, stv, stv_state, batmanfr, ROT0, "Acclaim", "Batman Forever (JUE 960507 V1.000)", GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| 3049 | 3018 | GAME( 1996, colmns97, stvbios, stv, stv, stv_state, colmns97, ROT0, "Sega", "Columns '97 (JET 961209 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| 3050 | 3019 | GAME( 1997, cotton2, stvbios, stv, stv, stv_state, cotton2, ROT0, "Success", "Cotton 2 (JUET 970902 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| 3051 | 3020 | GAME( 1998, cottonbm, stvbios, stv, stv, stv_state, cottonbm, ROT0, "Success", "Cotton Boomerang (JUET 980709 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| 3052 | 3021 | GAME( 1995, critcrsh, stvbios, stv, critcrsh, stv_state, critcrsh, ROT0, "Sega", "Critter Crusher (EA 951204 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| 3053 | GAME( 1999, danchih, stvbios, stv, stvmp, stv_state, | |
| 3022 | GAME( 1999, danchih, stvbios, stv, stvmp, stv_state, danchih, ROT0, "Altron (Tecmo license)", "Danchi de Hanafuda (J 990607 V1.400)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) | |
| 3054 | 3023 | GAME( 2000, danchiq, stvbios, stv, stv, stv_state, danchiq, ROT0, "Altron", "Danchi de Quiz Okusan Yontaku Desuyo! (J 001128 V1.200)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| 3055 | 3024 | GAME( 1996, diehard, stvbios, stv, stv, stv_state, diehard, ROT0, "Sega", "Die Hard Arcade (UET 960515 V1.000)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) |
| 3056 | 3025 | GAME( 1996, dnmtdeka, diehard, stv, stv, stv_state, dnmtdeka, ROT0, "Sega", "Dynamite Deka (J 960515 V1.000)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) |
| 3057 | 3026 | GAME( 1995, ejihon, stvbios, stv, stv, stv_state, stv, ROT0, "Sega", "Ejihon Tantei Jimusyo (J 950613 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| 3058 | GAME( 1998, elandore, stvbios, stv_5881, stv6b, stv_state, elandore, ROT0, "Sai-Mate", "Touryuu Densetsu Elan-Doree / Elan Doree - Legend of Dragoon (JUET 980922 V1.006)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) | |
| 3059 | GAME( 1999, ffreveng, stvbios, stv_5881, stv, stv_state, ffreveng, ROT0, "Capcom", "Final Fight Revenge (JUET 990714 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) | |
| 3060 | 3027 | GAME( 1995, fhboxers, stvbios, stv, stv, stv_state, fhboxers, ROT0, "Sega", "Funky Head Boxers (JUETBKAL 951218 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| 3061 | 3028 | GAME( 1997, findlove, stvbios, stv, stv, stv_state, stv, ROT0, "Daiki / FCF", "Zenkoku Seifuku Bishoujo Grand Prix Find Love (J 971212 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| 3062 | GAME( 1994, gaxeduel, stvbios, stv, stv6b, stv_state, | |
| 3029 | GAME( 1994, gaxeduel, stvbios, stv, stv6b, stv_state, gaxeduel, ROT0, "Sega", "Golden Axe - The Duel (JUETL 950117 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS) | |
| 3063 | 3030 | GAME( 1998, grdforce, stvbios, stv, stv, stv_state, grdforce, ROT0, "Success", "Guardian Force (JUET 980318 V0.105)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| 3064 | GAME( 1998, groovef, stvbios, stv, stv6b, stv_state, | |
| 3031 | GAME( 1998, groovef, stvbios, stv, stv6b, stv_state, groovef, ROT0, "Atlus", "Groove on Fight - Gouketsuji Ichizoku 3 (J 970416 V1.001)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) | |
| 3065 | 3032 | GAME( 1997, hanagumi, stvbios, stv, stv, stv_state, hanagumi, ROT0, "Sega", "Sakura Taisen - Hanagumi Taisen Columns (J 971007 V1.010)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) |
| 3066 | 3033 | GAME( 1996, introdon, stvbios, stv, stv, stv_state, stv, ROT0, "Sunsoft / Success", "Karaoke Quiz Intro Don Don! (J 960213 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| 3067 | GAME( 1995, kiwames, stvbios, stv, stvmp, stv_state, | |
| 3034 | GAME( 1995, kiwames, stvbios, stv, stvmp, stv_state, stvmp, ROT0, "Athena", "Pro Mahjong Kiwame S (J 951020 V1.208)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) | |
| 3068 | 3035 | GAME( 1997, maruchan, stvbios, stv, stv, stv_state, maruchan, ROT0, "Sega / Toyosuisan", "Maru-Chan de Goo! (J 971216 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| 3069 | 3036 | GAME( 1996, mausuke, stvbios, stv, stv, stv_state, mausuke, ROT0, "Data East", "Mausuke no Ojama the World (J 960314 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| 3070 | 3037 | GAME( 1998, myfairld, stvbios, stv, myfairld, stv_state, stvmp, ROT0, "Micronet", "Virtual Mahjong 2 - My Fair Lady (J 980608 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| r243192 | r243193 | |
| 3072 | 3039 | GAME( 1995, pblbeach, stvbios, stv, stv, stv_state, pblbeach, ROT0, "T&E Soft", "Pebble Beach - The Great Shot (JUE 950913 V0.990)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| 3073 | 3040 | GAME( 1996, prikura, stvbios, stv, stv, stv_state, prikura, ROT0, "Atlus", "Princess Clara Daisakusen (J 960910 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| 3074 | 3041 | GAME( 1996, puyosun, stvbios, stv, stv, stv_state, puyosun, ROT0, "Compile", "Puyo Puyo Sun (J 961115 V0.001)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| 3075 | GAME( 1998, rsgun, stvbios, stv | |
| 3042 | GAME( 1998, rsgun, stvbios, stv, stv, stv_state, rsgun, ROT0, "Treasure", "Radiant Silvergun (JUET 980523 V1.000)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 3076 | 3043 | GAME( 1998, sasissu, stvbios, stv, stv, stv_state, sasissu, ROT0, "Sega", "Taisen Tanto-R Sashissu!! (J 980216 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| 3077 | 3044 | GAME( 1999, sanjeon, sasissu, stv, stv, stv_state, sanjeon, ROT0, "Sega / Deniam", "DaeJeon! SanJeon SuJeon (AJTUE 990412 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| 3078 | 3045 | GAME( 1997, seabass, stvbios, stv, stv, stv_state, seabass, ROT0, "A wave inc. (Able license)", "Sea Bass Fishing (JUET 971110 V0.001)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| 3079 | 3046 | GAME( 1995, shanhigw, stvbios, stv, stv, stv_state, shanhigw, ROT0, "Sunsoft / Activision", "Shanghai - The Great Wall / Shanghai Triple Threat (JUE 950623 V1.005)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| 3080 | 3047 | GAME( 1997, shienryu, stvbios, stv, stv, stv_state, shienryu, ROT270, "Warashi", "Shienryu (JUET 961226 V1.000)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) |
| 3081 | GAME( 1998, sss, stvbios, stv | |
| 3048 | GAME( 1998, sss, stvbios, stv, stv, stv_state, sss, ROT0, "Capcom / Cave / Victor", "Steep Slope Sliders (JUET 981110 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) | |
| 3082 | 3049 | GAME( 1995, sandor, stvbios, stv, stv, stv_state, sandor, ROT0, "Sega", "Puzzle & Action: Sando-R (J 951114 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| 3083 | 3050 | GAME( 1997, thunt, sandor, stv, stv, stv_state, thunt, ROT0, "Sega", "Puzzle & Action: Treasure Hunt (JUET 970901 V2.00E)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| 3084 | 3051 | GAME( 1997, thuntk, sandor, stv, stv, stv_state, sandor, ROT0, "Sega / Deniam", "Puzzle & Action: BoMulEul Chajara (JUET 970125 V2.00K)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| 3085 | GAME( 1998, twcup98, stvbios, stv_5881, stv, stv_state, twcup98, ROT0, "Tecmo", "Tecmo World Cup '98 (JUET 980410 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) | |
| 3086 | 3052 | GAME( 1995, smleague, stvbios, stv, stv, stv_state, smleague, ROT0, "Sega", "Super Major League (U 960108 V1.000)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| 3087 | 3053 | GAME( 1995, finlarch, smleague,stv, stv, stv_state, finlarch, ROT0, "Sega", "Final Arch (J 950714 V1.001)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| 3088 | 3054 | GAME( 1996, sokyugrt, stvbios, stv, stv, stv_state, sokyugrt, ROT0, "Raizing / Eighting", "Soukyugurentai / Terra Diver (JUET 960821 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| r243192 | r243193 | |
| 3092 | 3058 | GAME( 1997, winterht, stvbios, stv, stv, stv_state, winterht, ROT0, "Sega", "Winter Heat (JUET 971012 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| 3093 | 3059 | GAME( 1997, znpwfv, stvbios, stv, stv, stv_state, znpwfv, ROT0, "Sega", "Zen Nippon Pro-Wrestling Featuring Virtua (J 971123 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) |
| 3094 | 3060 | |
| 3061 | /* Almost */ | |
| 3062 | GAME( 1998, twcup98, stvbios, stv, stv, stv_state, twcup98, ROT0, "Tecmo", "Tecmo World Cup '98 (JUET 980410 V1.000)", GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) | |
| 3063 | GAME( 1998, elandore, stvbios, stv, stv6b, stv_state, elandore, ROT0, "Sai-Mate", "Touryuu Densetsu Elan-Doree / Elan Doree - Legend of Dragoon (JUET 980922 V1.006)", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) | |
| 3064 | ||
| 3095 | 3065 | /* Unemulated printer / camera devices */ |
| 3096 | 3066 | GAME( 1998, stress, stvbios, stv, stv, stv_state, stv, ROT0, "Sega", "Stress Busters (J 981020 V1.000)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) |
| 3097 | 3067 | GAME( 1997, nclubv3, stvbios, stv, stv, stv_state, nameclv3, ROT0, "Sega", "Name Club Ver.3 (J 970723 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_NOT_WORKING ) |
| r243192 | r243193 | |
| 3110 | 3080 | |
| 3111 | 3081 | /* Doing something.. but not enough yet */ |
| 3112 | 3082 | GAME( 1995, vfremix, stvbios, stv, stv, stv_state, vfremix, ROT0, "Sega", "Virtua Fighter Remix (JUETBKAL 950428 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_NOT_WORKING ) |
| 3113 | GAME( 1996, decathlt, stvbios, stv_5838, stv, stv_state, decathlt, ROT0, "Sega", "Decathlete (JUET 960709 V1.001)", GAME_NO_SOUND | GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION ) | |
| 3114 | GAME( 1996, decathlto, decathlt,stv_5838, stv, stv_state, decathlt, ROT0, "Sega", "Decathlete (JUET 960424 V1.000)", GAME_NO_SOUND | GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION ) | |
| 3083 | GAME( 1996, decathlt, stvbios, stv, stv, stv_state, decathlt, ROT0, "Sega", "Decathlete (JUET 960709 V1.001)", GAME_NO_SOUND | GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION ) | |
| 3084 | GAME( 1996, decathlto, decathlt,stv, stv, stv_state, decathlt, ROT0, "Sega", "Decathlete (JUET 960424 V1.000)", GAME_NO_SOUND | GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION ) | |
| 3115 | 3085 | |
| 3116 | 3086 | /* Gives I/O errors */ |
| 3117 | 3087 | GAME( 1996, magzun, stvbios, stv, stv, stv_state, magzun, ROT0, "Sega", "Magical Zunou Power (J 961031 V1.000)", GAME_NOT_WORKING ) |
| 3118 | 3088 | GAME( 1997, techbowl, stvbios, stv, stv, stv_state, stv, ROT0, "Sega", "Technical Bowling (J 971212 V1.000)", GAME_NOT_WORKING ) |
| 3119 | 3089 | GAME( 1999, micrombc, stvbios, stv, stv, stv_state, stv, ROT0, "Sega", "Microman Battle Charge (J 990326 V1.000)", GAME_NOT_WORKING ) |
| 3120 | 3090 | |
| 3091 | /* Black screen */ | |
| 3092 | GAME( 1999, ffreveng, stvbios, stv, stv, stv_state, ffreveng, ROT0, "Capcom", "Final Fight Revenge (JUET 990714 V1.000)", GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS | GAME_NOT_WORKING ) | |
| 3093 | ||
| 3121 | 3094 | /* CD games */ |
| 3122 | 3095 | GAME( 1995, sfish2, 0, stv, stv, stv_state, stv, ROT0, "Sega", "Sport Fishing 2 (UET 951106 V1.10e)", GAME_NO_SOUND | GAME_NOT_WORKING ) |
| 3123 | 3096 | GAME( 1995, sfish2j, sfish2, stv, stv, stv_state, stv, ROT0, "Sega", "Sport Fishing 2 (J 951201 V1.100)", GAME_NO_SOUND | GAME_NOT_WORKING ) |
| r243192 | r243193 | |
|---|---|---|
| 1779 | 1779 | |
| 1780 | 1780 | ***************************************************************************/ |
| 1781 | 1781 | |
| 1782 | WRITE_LINE_MEMBER(suna8_state::soundirq) | |
| 1783 | { | |
| 1784 | m_audiocpu->set_input_line(0, state); | |
| 1785 | } | |
| 1786 | ||
| 1782 | 1787 | /* In games with only 2 CPUs, port A&B of the AY8910 are used |
| 1783 | 1788 | for sample playing. */ |
| 1784 | 1789 | |
| r243192 | r243193 | |
| 1945 | 1950 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 1946 | 1951 | |
| 1947 | 1952 | MCFG_SOUND_ADD("ymsnd", YM3812, SUNA8_MASTER_CLOCK / 6) |
| 1948 | MCFG_YM3812_IRQ_HANDLER(I | |
| 1953 | MCFG_YM3812_IRQ_HANDLER(WRITELINE(suna8_state, soundirq)) | |
| 1949 | 1954 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) |
| 1950 | 1955 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) |
| 1951 | 1956 |
| r243192 | r243193 | |
|---|---|---|
| 3 | 3 | Taito Discrete Hardware Games |
| 4 | 4 | |
| 5 | 5 | |
| 6 | Game Name(s) Part #'s Data PROM/ROM Chip Numbers | |
| 7 | ---------------------------------------------------------+--------------+---------+--------------------------------------- | |
| 8 | Astro Race (11/1973) UNKNOWN | |
| 9 | Attack (09/1976) UNKNOWN | |
| 10 | Attack UFO (08/1974) UNKNOWN | |
| 11 | Avenger (??/1976) (clone of Electra's Avenger) UNKNOWN | |
| 12 | Ball Park/TT Ball Park (??/1974) UNKNOWN | |
| 13 | Basketball (04/1974) UNKNOWN | |
| 14 | Bombs Away (??/1977) UNKNOWN | |
| 15 | Cisco/Fisco 400 (04/1977) UNKNOWN | |
| 16 | Clean Sweep (??/1976) (clone of Ramtek's Clean Sweep) UNKNOWN | |
| 17 | Clean Sweep II (??/1976) (clone of Ramtek's Clean Sweep) UNKNOWN | |
| 18 | Crashing Race (06/1976) UNKNOWN | |
| 19 | Cross Fire (08/1977) (aka Bazooka) UNKNOWN | |
| 20 | Davis Cup (12/1973) UNKNOWN | |
| 21 | Dead Heat (??/1975) UNKNOWN | |
| 22 | Elepong (07/1973) UNKNOWN | |
| 23 | Flying Fortress (??/1977) UNKNOWN | |
| 24 | Flying Fortress II (06/1977) UNKNOWN | |
| 25 | Gunman (10/1977) YES 8 x 32bytes (or 11? ) | |
| 26 | Interceptor (03/1976) UNKNOWN | |
| 27 | Missile-X (??/1977) YES 10 - (5 x 512bytes, 5x32bytes) | |
| 28 | Pro Hockey (11/1973) UNKNOWN | |
| 29 | Road Champion (04/1977) UNKNOWN | |
| 30 | Road Champion S (06/1977) UNKNOWN | |
| 31 | Soccer (11/1973) UNKNOWN | |
| 32 | Soccer DX (??/1977) UNKNOWN | |
| 33 | Speed Race (11/1974) UNKNOWN | |
| 34 | Speed Race CL-5 (10/1978) UNKNOWN | |
| 35 | Speed Race Color (10/1978) UNKNOWN | |
| 36 | Speed Race DX (08/1975) UNKNOWN | |
| 37 | Speed Race Twin (04/1976) UNKNOWN | |
| 38 | Speed Race GP-5 (??/1980) UNKNOWN | |
| 39 | Super Block (02/1978) UNKNOWN | |
| 40 | Super Speed Race (12/1977) UNKNOWN | |
| 41 | Super Speed Race V (07/1978) UNKNOWN | |
| 42 | Super Speed Race GP-V (??/1980) UNKNOWN | |
| 43 | Table Football (??/1977) UNKNOWN | |
| 44 | Tahitian (??/1975) UNKNOWN | |
| 45 | Tennis (??/1977) UNKNOWN | |
| 46 | T. T. Block (08/1977) YES 1 x 2048bytes | |
| 47 | T. T. Block C (05/1978) UNKNOWN | |
| 48 | T. T. Block CU (08/1978) UNKNOWN | |
| 49 | T. T. Speed Race (??/1978) UNKNOWN | |
| 50 | Wall Block (08/1978) UNKNOWN | |
| 51 | Wall Break (01/1977) UNKNOWN | |
| 52 | Western Gun (09/1975) UNKNOWN | |
| 53 | Zun Zun Block (04/1979) YES 3 - (2 x 512bytes, 1 x 32bytes) | |
| 6 | Game Name(s) Part #'s Data PROM/ROM Chip Numbers | |
| 7 | ------------------------------------------+-----------+---------+--------------------------------------- | |
| 8 | Acrobat (1978) UNKNOWN | |
| 9 | Astro Race (1973) UNKNOWN | |
| 10 | Avenger (1976) - Vertical EG-1020 UNKNOWN | |
| 11 | Attack (1976) UNKNOWN | |
| 12 | Attack UFO (1974) UNKNOWN | |
| 13 | Barricade II (1977) UNKNOWN | |
| 14 | Basketball (1974) UNKNOWN | |
| 15 | Cisco/Fisco 400 (1977) UNKNOWN | |
| 16 | Crashing Race (1976) UNKNOWN | |
| 17 | Cross Fire (1977) UNKNOWN - AKA Bazooka | |
| 18 | Davis Cup (1973) UNKNOWN | |
| 19 | Elepong (1973) UNKNOWN | |
| 20 | Flying Fortress/Flying Fortress II (1977) UNKNOWN | |
| 21 | Gunman (1977) YES 8 x 32bytes (or 11? ) | |
| 22 | Interceptor (1976) UNKNOWN | |
| 23 | Missile-X (1977) YES 10 - (5 x 512bytes, 5x32bytes) | |
| 24 | Pro Hockey (1973) UNKNOWN | |
| 25 | Road Champion (1978) UNKNOWN | |
| 26 | Sky Fighter 2 (1970) UNKNOWN | |
| 27 | Soccer (1973) UNKNOWN | |
| 28 | Speed Race (1974) UNKNOWN | |
| 29 | Speed Race Twin (1976) UNKNOWN | |
| 30 | Speed Race GP-5 (1980) UNKNOWN | |
| 31 | Sub Hunter (1977) UNKNOWN | |
| 32 | Super Block (1978) - Vertical UNKNOWN | |
| 33 | Super Speed Race 5 (1978) UNKNOWN | |
| 34 | Super Speed Race GP-V (1980) UNKNOWN | |
| 35 | Top Bowler (1978) UNKNOWN | |
| 36 | T. T. Block (1977) YES 1 x 2048bytes | |
| 37 | Trampoline (1978) UNKNOWN | |
| 38 | Wall Block (1978) UNKNOWN | |
| 39 | Western Gun (1975) UNKNOWN | |
| 40 | Zun Zun Block (1979) YES 3 - (2 x 512bytes, 1 x 32bytes) | |
| 54 | 41 | |
| 55 | 42 | ***************************************************************************/ |
| 56 | 43 | |
| r243192 | r243193 | |
| 226 | 213 | MS06 M8 74s287 missile animated graphics |
| 227 | 214 | MS05 11F IM5610 200pt tank R->L graphic |
| 228 | 215 | MS05 11E IM5610 200pt tank L->R graphic |
| 229 | MS04 N7 IM5610 | |
| 216 | MS04 N7 IM5610 player missile trajectory pattern | |
| 230 | 217 | MS03 F3 IM5610 anti-missile ack-ack graphics |
| 231 | 218 | MS02 L12 IM5610 missile left/right position |
| 232 | 219 | MS01 D8 IM5610 100pt tanks graphics |
| 233 | ||
| 220 | ||
| 234 | 221 | */ |
| 235 | 222 | |
| 236 | 223 | ROM_START( missilex ) |
| 237 | 224 | ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 ) |
| 238 | 225 | |
| 239 | 226 | ROM_REGION( 0x0800, "roms", ROMREGION_ERASE00 ) |
| 240 | ROM_LOAD( "cr11.4l", 0x0000, 0x0200, CRC(3d10a407) SHA1(1a85581c34d7e6766eaebbcc9895ed0ab2f94387) ) | |
| 227 | ROM_LOAD( "cr11.4l", 0x0000, 0x0200, CRC(3d10a407) SHA1(1a85581c34d7e6766eaebbcc9895ed0ab2f94387) ) | |
| 241 | 228 | ROM_LOAD( "ms09.6f", 0x0000, 0x0200, CRC(80787642) SHA1(9de2419f0ba16f9c2b06e417c1ebba441fdae053) ) |
| 242 | ROM_LOAD( "ms08.2c", 0x0000, 0x0200, CRC(dd785590) SHA1(7ba6b6f6091595852d6feaef5a029b2aca684440) ) | |
| 243 | ROM_LOAD( "ms07.8n", 0x0000, 0x0200, CRC(e278d03a) SHA1(c40975e5807936fed40cda4a6881f6aef0e7f350) ) | |
| 244 | ROM_LOAD( "ms06.8m", 0x0000, 0x0200, CRC(fe6c9192) SHA1(d110e010cf685ee18479ca7f890fa9da2fa71603) ) | |
| 245 | ROM_LOAD( "ms05.11f", 0x0000, 0x0020, CRC(845fe0cc) SHA1(ce8db615c1f7be242fc2ee25c1ef75e8608a771a) ) | |
| 246 | ROM_LOAD( "ms05.11e", 0x0000, 0x0020, CRC(845fe0cc) SHA1(ce8db615c1f7be242fc2ee25c1ef75e8608a771a) ) | |
| 247 | ROM_LOAD( "ms04.7n", 0x0000, 0x0020, CRC(34d0bee4) SHA1(41848def6aeb128ec985c158f3ed01c5b20bdcf6) ) | |
| 248 | ROM_LOAD( "ms03.3f", 0x0000, 0x0020, CRC(d139f5fa) SHA1(29c05143d05553c2cb2831f9624f307f59436850) ) | |
| 249 | ROM_LOAD( "ms02.12l", 0x0000, 0x0020, CRC(157b7e68) SHA1(d1a98267af1562e6126faaf0850906224f8a608d) ) | |
| 250 | ROM_LOAD( "ms01.8d", 0x0000, 0x0020, CRC(e89e76c3) SHA1(1149b5d1f93baa8aecd54a618083cc13b63a894d) ) | |
| 229 | ROM_LOAD( "ms08.2c", 0x0000, 0x0200, CRC(dd785590) SHA1(7ba6b6f6091595852d6feaef5a029b2aca684440) ) | |
| 230 | ROM_LOAD( "ms07.8n", 0x0000, 0x0200, CRC(e278d03a) SHA1(c40975e5807936fed40cda4a6881f6aef0e7f350) ) | |
| 231 | ROM_LOAD( "ms06.8m", 0x0000, 0x0200, CRC(fe6c9192) SHA1(d110e010cf685ee18479ca7f890fa9da2fa71603) ) | |
| 232 | ROM_LOAD( "ms05.11f", 0x0000, 0x0020, CRC(845fe0cc) SHA1(ce8db615c1f7be242fc2ee25c1ef75e8608a771a) ) | |
| 233 | ROM_LOAD( "ms05.11e", 0x0000, 0x0020, CRC(845fe0cc) SHA1(ce8db615c1f7be242fc2ee25c1ef75e8608a771a) ) | |
| 234 | ROM_LOAD( "ms04.7n", 0x0000, 0x0020, CRC(34d0bee4) SHA1(41848def6aeb128ec985c158f3ed01c5b20bdcf6) ) | |
| 235 | ROM_LOAD( "ms03.3f", 0x0000, 0x0020, CRC(d139f5fa) SHA1(29c05143d05553c2cb2831f9624f307f59436850) ) | |
| 236 | ROM_LOAD( "ms02.12l", 0x0000, 0x0020, CRC(157b7e68) SHA1(d1a98267af1562e6126faaf0850906224f8a608d) ) | |
| 237 | ROM_LOAD( "ms01.8d", 0x0000, 0x0020, CRC(e89e76c3) SHA1(1149b5d1f93baa8aecd54a618083cc13b63a894d) ) | |
| 251 | 238 | ROM_END |
| 252 | 239 | |
| 253 | 240 |
| r243192 | r243193 | |
|---|---|---|
| 423 | 423 | |
| 424 | 424 | GFXDECODE_END |
| 425 | 425 | |
| 426 | /*** Sound Bits | |
| 426 | 427 | |
| 428 | */ | |
| 429 | ||
| 430 | WRITE_LINE_MEMBER(tbowl_state::irqhandler) | |
| 431 | { | |
| 432 | m_audiocpu->set_input_line(0, state); | |
| 433 | } | |
| 434 | ||
| 435 | ||
| 427 | 436 | /*** Machine Driver |
| 428 | 437 | |
| 429 | 438 | there are 3 boards, each with a cpu, boards b and c contain |
| r243192 | r243193 | |
| 491 | 500 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 492 | 501 | |
| 493 | 502 | MCFG_SOUND_ADD("ym1", YM3812, 4000000) |
| 494 | MCFG_YM3812_IRQ_HANDLER(I | |
| 503 | MCFG_YM3812_IRQ_HANDLER(WRITELINE(tbowl_state, irqhandler)) | |
| 495 | 504 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) |
| 496 | 505 | |
| 497 | 506 | MCFG_SOUND_ADD("ym2", YM3812, 4000000) |
| r243192 | r243193 | |
|---|---|---|
| 600 | 600 | GFXDECODE_END |
| 601 | 601 | |
| 602 | 602 | |
| 603 | ||
| 604 | WRITE_LINE_MEMBER(tecmo_state::irqhandler) | |
| 605 | { | |
| 606 | m_soundcpu->set_input_line(0, state); | |
| 607 | } | |
| 608 | ||
| 603 | 609 | MACHINE_RESET_MEMBER(tecmo_state,rygar) |
| 604 | 610 | { |
| 605 | 611 | m_adpcm_pos = 0; |
| r243192 | r243193 | |
| 641 | 647 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 642 | 648 | |
| 643 | 649 | MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_4MHz) /* verified on pcb */ |
| 644 | MCFG_YM3812_IRQ_HANDLER(I | |
| 650 | MCFG_YM3812_IRQ_HANDLER(WRITELINE(tecmo_state, irqhandler)) | |
| 645 | 651 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 646 | 652 | |
| 647 | 653 | MCFG_SOUND_ADD("msm", MSM5205, XTAL_400kHz) /* verified on pcb, even if schematics shows a 384khz resonator */ |
| r243192 | r243193 | |
| 704 | 710 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 705 | 711 | |
| 706 | 712 | MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_4MHz) /* verified on pcb */ |
| 707 | MCFG_YM3812_IRQ_HANDLER(I | |
| 713 | MCFG_YM3812_IRQ_HANDLER(WRITELINE(tecmo_state, irqhandler)) | |
| 708 | 714 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 709 | 715 | |
| 710 | 716 | /* no MSM on this PCB */ |
| r243192 | r243193 | |
|---|---|---|
| 1760 | 1760 | GFXDECODE_END |
| 1761 | 1761 | |
| 1762 | 1762 | |
| 1763 | WRITE_LINE_MEMBER(toaplan1_state::irqhandler) | |
| 1764 | { | |
| 1765 | m_audiocpu->set_input_line(0, state); | |
| 1766 | } | |
| 1767 | ||
| 1763 | 1768 | #define PIXEL_CLOCK (XTAL_28MHz/4) |
| 1764 | 1769 | |
| 1765 | 1770 | // HTOTAL and VTOTAL taken from CRTC registers (toaplan1_bcu_control_w) |
| r243192 | r243193 | |
| 1811 | 1816 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 1812 | 1817 | |
| 1813 | 1818 | MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_28MHz/8) |
| 1814 | MCFG_YM3812_IRQ_HANDLER(I | |
| 1819 | MCFG_YM3812_IRQ_HANDLER(WRITELINE(toaplan1_state, irqhandler)) | |
| 1815 | 1820 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 1816 | 1821 | MACHINE_CONFIG_END |
| 1817 | 1822 | |
| r243192 | r243193 | |
| 1849 | 1854 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 1850 | 1855 | |
| 1851 | 1856 | MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_28MHz/8) |
| 1852 | MCFG_YM3812_IRQ_HANDLER(I | |
| 1857 | MCFG_YM3812_IRQ_HANDLER(WRITELINE(toaplan1_state, irqhandler)) | |
| 1853 | 1858 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 1854 | 1859 | MACHINE_CONFIG_END |
| 1855 | 1860 | |
| r243192 | r243193 | |
| 1887 | 1892 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 1888 | 1893 | |
| 1889 | 1894 | MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_28MHz/8) |
| 1890 | MCFG_YM3812_IRQ_HANDLER(I | |
| 1895 | MCFG_YM3812_IRQ_HANDLER(WRITELINE(toaplan1_state, irqhandler)) | |
| 1891 | 1896 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 1892 | 1897 | MACHINE_CONFIG_END |
| 1893 | 1898 | |
| r243192 | r243193 | |
| 1925 | 1930 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 1926 | 1931 | |
| 1927 | 1932 | MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_28MHz/8) |
| 1928 | MCFG_YM3812_IRQ_HANDLER(I | |
| 1933 | MCFG_YM3812_IRQ_HANDLER(WRITELINE(toaplan1_state, irqhandler)) | |
| 1929 | 1934 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 1930 | 1935 | MACHINE_CONFIG_END |
| 1931 | 1936 | |
| r243192 | r243193 | |
| 1967 | 1972 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 1968 | 1973 | |
| 1969 | 1974 | MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_28MHz/8) |
| 1970 | MCFG_YM3812_IRQ_HANDLER(I | |
| 1975 | MCFG_YM3812_IRQ_HANDLER(WRITELINE(toaplan1_state, irqhandler)) | |
| 1971 | 1976 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 1972 | 1977 | MACHINE_CONFIG_END |
| 1973 | 1978 | |
| r243192 | r243193 | |
| 2003 | 2008 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 2004 | 2009 | |
| 2005 | 2010 | MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_28MHz/8) |
| 2006 | MCFG_YM3812_IRQ_HANDLER(I | |
| 2011 | MCFG_YM3812_IRQ_HANDLER(WRITELINE(toaplan1_state, irqhandler)) | |
| 2007 | 2012 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 2008 | 2013 | MACHINE_CONFIG_END |
| 2009 | 2014 | |
| r243192 | r243193 | |
| 2041 | 2046 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 2042 | 2047 | |
| 2043 | 2048 | MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_28MHz/8) |
| 2044 | MCFG_YM3812_IRQ_HANDLER(I | |
| 2049 | MCFG_YM3812_IRQ_HANDLER(WRITELINE(toaplan1_state, irqhandler)) | |
| 2045 | 2050 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 2046 | 2051 | MACHINE_CONFIG_END |
| 2047 | 2052 | |
| r243192 | r243193 | |
| 2077 | 2082 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 2078 | 2083 | |
| 2079 | 2084 | MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_28MHz/8) /* verified on pcb */ |
| 2080 | MCFG_YM3812_IRQ_HANDLER(I | |
| 2085 | MCFG_YM3812_IRQ_HANDLER(WRITELINE(toaplan1_state, irqhandler)) | |
| 2081 | 2086 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 2082 | 2087 | MACHINE_CONFIG_END |
| 2083 | 2088 |
| r243192 | r243193 | |
|---|---|---|
| 3049 | 3049 | GFXDECODE_END |
| 3050 | 3050 | |
| 3051 | 3051 | |
| 3052 | WRITE_LINE_MEMBER(toaplan2_state::irqhandler) | |
| 3053 | { | |
| 3054 | if (m_audiocpu != NULL) // wouldn't tekipaki have problem without this? "mcu" is not generally added | |
| 3055 | m_audiocpu->set_input_line(0, state); | |
| 3056 | } | |
| 3057 | ||
| 3052 | 3058 | WRITE_LINE_MEMBER(toaplan2_state::bbakraid_irqhandler) |
| 3053 | 3059 | { |
| 3054 | 3060 | // Not used ??? Connected to a test pin (TP082) |
| r243192 | r243193 | |
| 3094 | 3100 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 3095 | 3101 | |
| 3096 | 3102 | MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_27MHz/8) |
| 3097 | #ifdef USE_HD64x180 | |
| 3098 | MCFG_YM3812_IRQ_HANDLER(INPUTLINE("audiocpu", 0)) | |
| 3099 | #endif | |
| 3103 | MCFG_YM3812_IRQ_HANDLER(WRITELINE(toaplan2_state, irqhandler)) | |
| 3100 | 3104 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 3101 | 3105 | MACHINE_CONFIG_END |
| 3102 | 3106 | |
| r243192 | r243193 | |
| 3407 | 3411 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 3408 | 3412 | |
| 3409 | 3413 | MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_27MHz/8) /* verified on pcb */ |
| 3410 | MCFG_YM3812_IRQ_HANDLER(I | |
| 3414 | MCFG_YM3812_IRQ_HANDLER(WRITELINE(toaplan2_state, irqhandler)) | |
| 3411 | 3415 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 3412 | 3416 | MACHINE_CONFIG_END |
| 3413 | 3417 | |
| r243192 | r243193 | |
| 3450 | 3454 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 3451 | 3455 | |
| 3452 | 3456 | MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_27MHz/8) |
| 3453 | MCFG_YM3812_IRQ_HANDLER(I | |
| 3457 | MCFG_YM3812_IRQ_HANDLER(WRITELINE(toaplan2_state, irqhandler)) | |
| 3454 | 3458 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 3455 | 3459 | MACHINE_CONFIG_END |
| 3456 | 3460 |
| r243192 | r243193 | |
|---|---|---|
| 21 | 21 | m_maincpu(*this, "maincpu") { } |
| 22 | 22 | |
| 23 | 23 | required_device<cpu_device> m_maincpu; |
| 24 | ||
| 24 | ||
| 25 | 25 | DECLARE_WRITE8_MEMBER(tourtabl_led_w); |
| 26 | 26 | DECLARE_READ16_MEMBER(tourtabl_read_input_port); |
| 27 | 27 | DECLARE_READ8_MEMBER(tourtabl_get_databus_contents); |
| r243192 | r243193 | |
|---|---|---|
| 646 | 646 | GFXDECODE_END |
| 647 | 647 | |
| 648 | 648 | |
| 649 | ||
| 650 | ||
| 651 | /* handler called by the 3812 emulator when the internal timers cause an IRQ */ | |
| 652 | WRITE_LINE_MEMBER(twincobr_state::irqhandler) | |
| 653 | { | |
| 654 | m_audiocpu->set_input_line(0, state); | |
| 655 | } | |
| 656 | ||
| 657 | ||
| 658 | ||
| 649 | 659 | static MACHINE_CONFIG_START( twincobr, twincobr_state ) |
| 650 | 660 | |
| 651 | 661 | /* basic machine hardware */ |
| r243192 | r243193 | |
| 692 | 702 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 693 | 703 | |
| 694 | 704 | MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_28MHz/8) |
| 695 | MCFG_YM3812_IRQ_HANDLER(I | |
| 705 | MCFG_YM3812_IRQ_HANDLER(WRITELINE(twincobr_state, irqhandler)) | |
| 696 | 706 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 697 | 707 | MACHINE_CONFIG_END |
| 698 | 708 |
| r243192 | r243193 | |
|---|---|---|
| 254 | 254 | m_maincpu(*this, "maincpu"), |
| 255 | 255 | m_audiocpu(*this, "audiocpu") |
| 256 | 256 | { |
| 257 | m_spu_hle[0x200] = 0; | |
| 258 | m_spu_hle[0x202] = 0; | |
| 257 | 259 | } |
| 258 | 260 | |
| 259 | 261 | required_device<am53cf96_device> m_am53cf96; |
| r243192 | r243193 | |
| 262 | 264 | |
| 263 | 265 | UINT16 m_spu_ctrl; // SPU board control register |
| 264 | 266 | UINT8 m_spu_shared[0x400]; // SPU/PSX shared dual-ported RAM |
| 267 | UINT8 m_spu_hle[0x400]; | |
| 265 | 268 | UINT32 m_spu_ata_dma; |
| 266 | 269 | int m_spu_ata_dmarq; |
| 267 | 270 | |
| r243192 | r243193 | |
| 282 | 285 | DECLARE_WRITE16_MEMBER(twinkle_waveram_w); |
| 283 | 286 | DECLARE_READ16_MEMBER(shared_68k_r); |
| 284 | 287 | DECLARE_WRITE16_MEMBER(shared_68k_w); |
| 285 | DECLARE_READ16_MEMBER(unk_68k_r); | |
| 286 | 288 | DECLARE_WRITE_LINE_MEMBER(spu_ata_irq); |
| 287 | 289 | DECLARE_WRITE_LINE_MEMBER(spu_ata_dmarq); |
| 288 | 290 | required_device<cpu_device> m_maincpu; |
| r243192 | r243193 | |
| 669 | 671 | |
| 670 | 672 | WRITE8_MEMBER(twinkle_state::shared_psx_w) |
| 671 | 673 | { |
| 672 | // | |
| 674 | //printf("shared_psx_w: %04x, %04x, %04x\n", offset, data, mem_mask); | |
| 673 | 675 | |
| 674 | 676 | m_spu_shared[offset] = data; |
| 675 | 677 | |
| 678 | // HLE sound board | |
| 679 | m_spu_hle[offset] = data; | |
| 680 | ||
| 676 | 681 | if (offset == 0x03fe && data == 0xff) |
| 677 | 682 | { |
| 678 | // | |
| 683 | //printf("spu command %02x %02x\n", m_spu_hle[1], m_spu_hle[3]); | |
| 679 | 684 | |
| 680 | m_audiocpu->set_input_line(M68K_IRQ_4, HOLD_LINE); | |
| 685 | for (int i = 0x200; i < 0x300; i++) m_spu_hle[i] = 0xea; | |
| 686 | ||
| 687 | switch (m_spu_hle[1]) | |
| 688 | { | |
| 689 | case 0x91: // hdd sum 1 | |
| 690 | m_spu_hle[0x200] = 0; // ? | |
| 691 | m_spu_hle[0x202] = 0; // ? | |
| 692 | break; | |
| 693 | ||
| 694 | case 0x9a: // hdd sum 2 | |
| 695 | m_spu_hle[0x200] = 0; // ? | |
| 696 | m_spu_hle[0x202] = 0; // ? | |
| 697 | m_spu_hle[0x203] = 1; // Must be 1 to pass test | |
| 698 | break; | |
| 699 | ||
| 700 | case 0xa1: // version | |
| 701 | m_spu_hle[0x200] = 0; // ? | |
| 702 | m_spu_hle[0x202] = 0; // ? | |
| 703 | ||
| 704 | if (strcmp(machine().system().name, "bmiidx") == 0 || | |
| 705 | strcmp(machine().system().name, "bmiidxa") == 0 || | |
| 706 | strcmp(machine().system().name, "bmiidxc") == 0 || | |
| 707 | strcmp(machine().system().name, "bmiidxca") == 0) | |
| 708 | { | |
| 709 | strcpy((char *)&m_spu_hle[0x204], "GQ863JA_A"); | |
| 710 | } | |
| 711 | else if (strcmp(machine().system().name, "bmiidxs") == 0 || | |
| 712 | strcmp(machine().system().name, "bmiidxc2") == 0) | |
| 713 | { | |
| 714 | strcpy((char *)&m_spu_hle[0x204], "GC983JA_R"); | |
| 715 | } | |
| 716 | else if (strcmp(machine().system().name, "bmiidx2") == 0) | |
| 717 | { | |
| 718 | strcpy((char *)&m_spu_hle[0x204], "GC985JA_A"); | |
| 719 | } | |
| 720 | else if (strcmp(machine().system().name, "bmiidx3") == 0 || | |
| 721 | strcmp(machine().system().name, "bmiidx3a") == 0) | |
| 722 | { | |
| 723 | strcpy((char *)&m_spu_hle[0x204], "GC992JA_A"); | |
| 724 | } | |
| 725 | else if (strcmp(machine().system().name, "bmiidx4") == 0) | |
| 726 | { | |
| 727 | strcpy((char *)&m_spu_hle[0x204], "GCA03JA_A"); | |
| 728 | } | |
| 729 | else if (strcmp(machine().system().name, "bmiidx5") == 0) | |
| 730 | { | |
| 731 | strcpy((char *)&m_spu_hle[0x204], "GCA17JA_A"); | |
| 732 | } | |
| 733 | else if (strcmp(machine().system().name, "bmiidx6") == 0 || | |
| 734 | strcmp(machine().system().name, "bmiidx6a") == 0) | |
| 735 | { | |
| 736 | strcpy((char *)&m_spu_hle[0x204], "GCB4UJA_A"); | |
| 737 | } | |
| 738 | else if (strcmp(machine().system().name, "bmiidx7") == 0) | |
| 739 | { | |
| 740 | strcpy((char *)&m_spu_hle[0x204], "GCB44JA_A"); | |
| 741 | } | |
| 742 | else if (strcmp(machine().system().name, "bmiidx8") == 0) | |
| 743 | { | |
| 744 | strcpy((char *)&m_spu_hle[0x204], "GCC44JA_A"); | |
| 745 | } | |
| 746 | break; | |
| 747 | ||
| 748 | case 0x30: // play sound [3]=sound code | |
| 749 | case 0x51: // sound off | |
| 750 | case 0x25: // spu rom error ([3]==0x0f) | |
| 751 | case 0x26: // spu rom error ([3]==0x0f) | |
| 752 | case 0x08: // spu rom error | |
| 753 | case 0x40: // spu rom error ([3]==0x01 coin sound?) | |
| 754 | case 0x2f: // spu rom error | |
| 755 | case 0x52: // spu rom error | |
| 756 | case 0x04: // spu rom error ([3]==?) | |
| 757 | m_spu_hle[0x200] = 0; | |
| 758 | m_spu_hle[0x202] = 0; | |
| 759 | break; | |
| 760 | } | |
| 681 | 761 | } |
| 682 | 762 | } |
| 683 | 763 | |
| 684 | 764 | READ8_MEMBER(twinkle_state::shared_psx_r) |
| 685 | 765 | { |
| 686 | UINT32 result = m_spu_shared[offset]; | |
| 766 | //UINT32 result = m_spu_shared[offset]; | |
| 767 | UINT32 result = m_spu_hle[offset]; | |
| 687 | 768 | |
| 688 | 769 | //printf("shared_psx_r: %04x, %04x, %04x\n", offset, result, mem_mask); |
| 689 | 770 | |
| r243192 | r243193 | |
| 722 | 803 | /* |
| 723 | 804 | System control register (Konami always has one) |
| 724 | 805 | |
| 725 | bit 7 = write 0 to ack IRQ 1, write 1 to enable (IRQ 1 appears to be | |
| 806 | bit 7 = write 0 to ack IRQ 1, write 1 to enable (IRQ 1 appears to be vblank) | |
| 726 | 807 | bit 8 = write 0 to ack IRQ 2, write 1 to enable (IRQ 2 appears to be DMA completion) |
| 727 | bit 9 = write 0 to ack IRQ 4, write 1 to enable (IRQ 4 is "command available") | |
| 728 | bit 10 = write 0 to ack IRQ 6, write 1 to enable (IRQ 6 is the ATA IRQ) | |
| 729 | bit 11 = watchdog toggle | |
| 808 | bit 9 = write 0 to ack IRQ 4, write 1 to enable (IRQ 4 appears to be "command sent", unsure how the MIPS causes it yet however) | |
| 809 | bit 10 = write 0 to ack IRQ 6, write 1 to enable (IRQ 6 is IDE) | |
| 810 | bit 11 = watchdog toggle? | |
| 730 | 811 | |
| 731 | 812 | Other bits unknown. |
| 732 | 813 | */ |
| r243192 | r243193 | |
| 755 | 836 | WRITE16_MEMBER(twinkle_state::spu_ata_dma_low_w) |
| 756 | 837 | { |
| 757 | 838 | m_spu_ata_dma = (m_spu_ata_dma & ~0xffff) | data; |
| 839 | ||
| 840 | //printf("dma_low %08x\n", m_spu_ata_dma * 2); | |
| 758 | 841 | } |
| 759 | 842 | |
| 760 | 843 | WRITE16_MEMBER(twinkle_state::spu_ata_dma_high_w) |
| 761 | 844 | { |
| 762 | 845 | m_spu_ata_dma = (m_spu_ata_dma & 0xffff) | (data << 16); |
| 846 | ||
| 847 | //printf("dma_high %08x\n", m_spu_ata_dma * 2); | |
| 763 | 848 | } |
| 764 | 849 | |
| 765 | 850 | WRITE_LINE_MEMBER(twinkle_state::spu_ata_dmarq) |
| r243192 | r243193 | |
| 779 | 864 | //waveram[m_spu_ata_dma++] = (data >> 8) | (data << 8); |
| 780 | 865 | // bp 4a0e ;bmiidx4 checksum |
| 781 | 866 | // bp 4d62 ;bmiidx4 dma |
| 782 | ||
| 783 | // $$$HACK - game DMAs nothing useful to 0x400000 but all sound plays are 0x400000 or above | |
| 784 | // so limit sound RAM to 4MB (there's 6 MB on the board) and let the 5c400's address masking | |
| 785 | // work for us until we figure out what's actually going on. | |
| 786 | if (m_spu_ata_dma < 0x200000) | |
| 787 | { | |
| 788 | m_waveram[m_spu_ata_dma++] = data; | |
| 789 | } | |
| 867 | m_waveram[m_spu_ata_dma++] = data; | |
| 790 | 868 | } |
| 791 | 869 | |
| 792 | 870 | m_ata->write_dmack(CLEAR_LINE); |
| r243192 | r243193 | |
| 808 | 886 | { |
| 809 | 887 | UINT16 result = m_spu_shared[offset]; |
| 810 | 888 | |
| 811 | // | |
| 889 | //printf("shared_68k_r: %04x, %04x, %04x\n", offset, result, mem_mask); | |
| 812 | 890 | |
| 813 | 891 | return result; |
| 814 | 892 | } |
| 815 | 893 | |
| 816 | 894 | WRITE16_MEMBER(twinkle_state::shared_68k_w) |
| 817 | 895 | { |
| 818 | // | |
| 896 | //printf("shared_68k_w: %04x, %04x, %04x\n", offset, data, mem_mask); | |
| 819 | 897 | |
| 820 | 898 | m_spu_shared[offset] = data & 0xff; |
| 821 | 899 | } |
| 822 | 900 | |
| 823 | READ16_MEMBER(twinkle_state::unk_68k_r) | |
| 824 | { | |
| 825 | return 0xffff; // must return 0xff for 68000 POST to complete properly | |
| 826 | } | |
| 827 | ||
| 828 | 901 | static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 16, twinkle_state ) |
| 829 | 902 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 830 | 903 | AM_RANGE(0x100000, 0x13ffff) AM_RAM |
| 831 | AM_RANGE(0x200000, 0x200001) AM_READ(unk_68k_r) | |
| 832 | 904 | // 220000 = LEDs? |
| 833 | 905 | AM_RANGE(0x230000, 0x230003) AM_WRITE(twinkle_spu_ctrl_w) |
| 834 | 906 | AM_RANGE(0x240000, 0x240003) AM_WRITE(spu_ata_dma_low_w) |
| r243192 | r243193 | |
| 837 | 909 | AM_RANGE(0x280000, 0x280fff) AM_READWRITE(shared_68k_r, shared_68k_w) |
| 838 | 910 | AM_RANGE(0x300000, 0x30000f) AM_DEVREADWRITE("ata", ata_interface_device, read_cs0, write_cs0) |
| 839 | 911 | // 34000E = ??? |
| 840 | AM_RANGE(0x34000e, 0x34000f) AM_WRITENOP | |
| 841 | 912 | AM_RANGE(0x400000, 0x400fff) AM_DEVREADWRITE("rfsnd", rf5c400_device, rf5c400_r, rf5c400_w) |
| 842 | AM_RANGE(0x800000, 0xbfffff) AM_READWRITE(twinkle_waveram_r, twinkle_waveram_w ) | |
| 843 | AM_RANGE(0xfe0000, 0xffffff) AM_RAM // ...and the RAM test checks this last 128k (mirror of the work RAM at 0x100000?) | |
| 913 | AM_RANGE(0x800000, 0xffffff) AM_READWRITE(twinkle_waveram_r, twinkle_waveram_w ) // 8 MB window wave RAM | |
| 844 | 914 | ADDRESS_MAP_END |
| 845 | 915 | |
| 846 | 916 | /* SCSI */ |
| r243192 | r243193 | |
| 941 | 1011 | |
| 942 | 1012 | MCFG_CPU_ADD("audiocpu", M68000, 32000000/2) /* 16.000 MHz */ |
| 943 | 1013 | MCFG_CPU_PROGRAM_MAP( sound_map ) |
| 944 | MCFG_CPU_PERIODIC_INT_DRIVER(twinkle_state, irq1_line_assert, 60) | |
| 945 | MCFG_CPU_PERIODIC_INT_DRIVER(twinkle_state, irq2_line_assert, 60) | |
| 946 | 1014 | |
| 947 | 1015 | MCFG_WATCHDOG_TIME_INIT(attotime::from_msec(1200)) /* check TD pin on LTC1232 */ |
| 948 | 1016 | |
| r243192 | r243193 | |
| 1081 | 1149 | ROM_REGION32_LE( 0x080000, "audiocpu", 0 )\ |
| 1082 | 1150 | ROM_LOAD16_WORD_SWAP( "863a05.2x", 0x000000, 0x080000, CRC(6f42a09e) SHA1(cab5209f90f47b9ee6e721479913ad74e3ba84b1) )\ |
| 1083 | 1151 | \ |
| 1084 | ROM_REGION16_LE(0x | |
| 1152 | ROM_REGION16_LE(0x1800000, "rfsnd", ROMREGION_ERASE00) | |
| 1085 | 1153 | |
| 1086 | 1154 | ROM_START( gq863 ) |
| 1087 | 1155 | TWINKLE_BIOS |
| r243192 | r243193 | |
|---|---|---|
| 795 | 795 | ROM_REGION( 0x10000, "audio_cpu", 0 ) |
| 796 | 796 | ROM_LOAD( "8411-136027-157.11", 0x00000, 0x2000, CRC(10ae3075) SHA1(69c5f62f2473aba848383eed3cecf15e273d86ca) ) |
| 797 | 797 | |
| 798 | ROM_REGION( 0x | |
| 798 | ROM_REGION( 0x20000, "char_tiles", 0 ) | |
| 799 | 799 | ROM_LOAD( "8411-136027-156.204", 0x0000, 0x4000, CRC(60f3c616) SHA1(59c4361891e4274e27e6279c919e8fd6803af7cf) ) |
| 800 | 800 | ROM_LOAD( "8411-136027-155.174", 0x4000, 0x4000, CRC(e59a6b72) SHA1(c10efa77ab421ac60b97227a8d547f50f8415670) ) |
| 801 | 801 | |
| 802 | ROM_REGION( 0x | |
| 802 | ROM_REGION( 0x40000, "obj_tiles", 0 ) | |
| 803 | 803 | ROM_LOAD( "8411-136027-114.203", 0x0000, 0x4000, CRC(fc91328b) SHA1(e57fd2056b65d37cf2e1f0af56616c6555df3006) ) |
| 804 | 804 | ROM_LOAD( "8411-136027-116.258", 0x4000, 0x4000, CRC(5745f671) SHA1(6e471633cd6de9926b3361a84430c088e1f6a097) ) |
| 805 | 805 | ROM_LOAD( "8411-136027-115.173", 0x8000, 0x4000, CRC(720e5873) SHA1(151d9063c35b26f5876cf94bdf0c2665ec701bbd) ) |
| 806 | 806 | ROM_LOAD( "8411-136027-117.232", 0xc000, 0x4000, CRC(3c68d0bc) SHA1(2dbaf2a268b90214fd61c016ac945d4371057826) ) |
| 807 | 807 | |
| 808 | ROM_REGION( 0x | |
| 808 | ROM_REGION( 0x40000, "gfx3", 0 ) | |
| 809 | 809 | ROM_LOAD( "8411-136027-146.56", 0x0000, 0x2000, CRC(5635b8c1) SHA1(5cc9437a2ff0843f1917f2451852d4561c240b24) ) |
| 810 | 810 | ROM_LOAD( "8411-136027-147.66", 0x2000, 0x2000, CRC(03d83cf8) SHA1(5c0cfc6bf02ad2b3f37e1ceb493f69eb9829ab1e) ) |
| 811 | 811 | ROM_LOAD( "8411-136027-148.76", 0x4000, 0x2000, CRC(ad56013a) SHA1(ae3a91f58f30daff334754476db33ad1d12569fc) ) |
| r243192 | r243193 | |
| 816 | 816 | ROM_LOAD16_BYTE( "136027-143.ic223", 0x8000, 0x0200, CRC(22c77af6) SHA1(1be8585b95316b4fc5712cdaef699e676320cd4d) ) |
| 817 | 817 | ROM_LOAD16_BYTE( "136027-142.ic213", 0x8001, 0x0200, CRC(f6b8b70b) SHA1(b79374acf11d71db1e4ad3c494ac5f500a52677b) ) |
| 818 | 818 | |
| 819 | ROM_REGION( 0x | |
| 819 | ROM_REGION( 0x50000, "obj_map", 0 ) | |
| 820 | 820 | ROM_LOAD( "8411-136027-119.106", 0x0000, 0x4000, CRC(88eec0fb) SHA1(81d7a69dc1a4b3b81d7f28d97a3f80697cdcc6eb) ) |
| 821 | 821 | ROM_LOAD( "8411-136027-120.73", 0x4000, 0x4000, CRC(407cbe65) SHA1(e1c11b65f3c6abde6d55afeaffdb39cdd6d66377) ) |
| 822 | 822 | |
| 823 | ROM_REGION( 0x | |
| 823 | ROM_REGION( 0x50000, "user3", 0 ) | |
| 824 | 824 | ROM_LOAD( "8411-136027-113.48", 0x0000, 0x2000, CRC(4b3d7956) SHA1(fc2432dd69f3be7007d4fd6f7c86c7c19453b1ba) ) |
| 825 | 825 | ROM_LOAD( "8411-136027-118.281", 0x2000, 0x4000, CRC(de418dc7) SHA1(1233e2f7499ec5a73a40ee336d3fe26c06187784) ) |
| 826 | 826 | |
| r243192 | r243193 | |
| 882 | 882 | ROM_REGION( 0x10000, "audio_cpu", 0 ) |
| 883 | 883 | ROM_LOAD( "tx1_22h.ic9", 0x00000, 0x2000, CRC(66376232) SHA1(b8a026dae47173e7760eea4f52e67e525ad1b70b) ) |
| 884 | 884 | |
| 885 | ROM_REGION( 0x | |
| 885 | ROM_REGION( 0x20000, "char_tiles", 0 ) | |
| 886 | 886 | ROM_LOAD( "tx1_21a.ic204", 0x0000, 0x4000, CRC(cd3441ad) SHA1(8e6597b3177b8aaa34ed3373d85fc4b6231e1333) ) |
| 887 | 887 | ROM_LOAD( "tx1_20a.ic174", 0x4000, 0x4000, CRC(dbe595fc) SHA1(1ed2f775f0a1b46a2ffbc056eb4ef732ed546d3c) ) |
| 888 | 888 | |
| 889 | ROM_REGION( 0x | |
| 889 | ROM_REGION( 0x40000, "obj_tiles", 0 ) | |
| 890 | 890 | ROM_LOAD( "tx1_16b.ic203", 0x0000, 0x4000, CRC(1141c965) SHA1(4b90c1428bcbd72d0449c064856a5596269b3fc6) ) |
| 891 | 891 | ROM_LOAD( "tx1_18b.ic258", 0x4000, 0x4000, CRC(0ad36d68) SHA1(fd5a65c56557c1bc9c0f3916f15f62500b52bfe0) ) |
| 892 | 892 | ROM_LOAD( "tx1_15b.ic173", 0x8000, 0x4000, CRC(30d1a8d5) SHA1(b4c585b7b8a8920bb3949d643e9e10c17d4009a0) ) |
| 893 | 893 | ROM_LOAD( "tx1_17b.ic232", 0xc000, 0x4000, CRC(364bb354) SHA1(a26581ca1088b979285471e2c6595048df84d75e) ) |
| 894 | 894 | |
| 895 | ROM_REGION( 0x | |
| 895 | ROM_REGION( 0x40000, "gfx3", 0 ) | |
| 896 | 896 | ROM_LOAD( "tx1_5a.ic56", 0x0000, 0x2000, CRC(5635b8c1) SHA1(5cc9437a2ff0843f1917f2451852d4561c240b24) ) |
| 897 | 897 | ROM_LOAD( "tx1_6a.ic66", 0x2000, 0x2000, CRC(03d83cf8) SHA1(5c0cfc6bf02ad2b3f37e1ceb493f69eb9829ab1e) ) |
| 898 | 898 | ROM_LOAD( "tx1_7a.ic76", 0x4000, 0x2000, CRC(ad56013a) SHA1(ae3a91f58f30daff334754476db33ad1d12569fc) ) |
| r243192 | r243193 | |
| 903 | 903 | ROM_LOAD16_BYTE( "xb02b.ic223", 0x8000, 0x0200, CRC(22c77af6) SHA1(1be8585b95316b4fc5712cdaef699e676320cd4d) ) |
| 904 | 904 | ROM_LOAD16_BYTE( "xb01b.ic213", 0x8001, 0x0200, CRC(f6b8b70b) SHA1(b79374acf11d71db1e4ad3c494ac5f500a52677b) ) |
| 905 | 905 | |
| 906 | ROM_REGION( 0x | |
| 906 | ROM_REGION( 0x50000, "obj_map", 0 ) | |
| 907 | 907 | ROM_LOAD( "tx1_14b.ic106", 0x0000, 0x4000, CRC(68c63d6e) SHA1(110e02b99c44d31041be588bd14642e26890ecbd) ) |
| 908 | 908 | ROM_LOAD( "tx1_13b.ic73", 0x4000, 0x4000, CRC(b0c581b2) SHA1(20926bc15e7c97045b219b828acfcdd99b8712a6) ) |
| 909 | 909 | |
| 910 | ROM_REGION( 0x | |
| 910 | ROM_REGION( 0x50000, "user3", 0 ) | |
| 911 | 911 | ROM_LOAD( "tx1_12b.ic48", 0x0000, 0x2000, CRC(4b3d7956) SHA1(fc2432dd69f3be7007d4fd6f7c86c7c19453b1ba) ) |
| 912 | 912 | ROM_LOAD( "tx1_19b.ic281", 0x2000, 0x4000, CRC(cb250de6) SHA1(4bf3006986fb8cbb3dd4fa988e6471633614e4bb) ) |
| 913 | 913 | |
| r243192 | r243193 | |
| 963 | 963 | ROM_REGION( 0x10000, "audio_cpu", 0 ) /* Label was missing */ |
| 964 | 964 | ROM_LOAD( "8411-136027-157.11", 0x00000, 0x2000, CRC(10ae3075) SHA1(69c5f62f2473aba848383eed3cecf15e273d86ca) ) /* Unconfirmed TC013A or the later TC013B */ |
| 965 | 965 | |
| 966 | ROM_REGION( 0x | |
| 966 | ROM_REGION( 0x20000, "char_tiles", 0 ) | |
| 967 | 967 | ROM_LOAD( "tx1_21a.ic204", 0x0000, 0x4000, CRC(cd3441ad) SHA1(8e6597b3177b8aaa34ed3373d85fc4b6231e1333) ) |
| 968 | 968 | ROM_LOAD( "tx1_20a.ic174", 0x4000, 0x4000, CRC(dbe595fc) SHA1(1ed2f775f0a1b46a2ffbc056eb4ef732ed546d3c) ) |
| 969 | 969 | |
| 970 | ROM_REGION( 0x | |
| 970 | ROM_REGION( 0x40000, "obj_tiles", 0 ) | |
| 971 | 971 | ROM_LOAD( "tx1_16b.ic203", 0x0000, 0x4000, CRC(1141c965) SHA1(4b90c1428bcbd72d0449c064856a5596269b3fc6) ) |
| 972 | 972 | ROM_LOAD( "tx1_18b.ic258", 0x4000, 0x4000, CRC(0ad36d68) SHA1(fd5a65c56557c1bc9c0f3916f15f62500b52bfe0) ) |
| 973 | 973 | ROM_LOAD( "tx1_15b.ic173", 0x8000, 0x4000, CRC(30d1a8d5) SHA1(b4c585b7b8a8920bb3949d643e9e10c17d4009a0) ) |
| 974 | 974 | ROM_LOAD( "tx1_17b.ic232", 0xc000, 0x4000, CRC(364bb354) SHA1(a26581ca1088b979285471e2c6595048df84d75e) ) |
| 975 | 975 | |
| 976 | ROM_REGION( 0x | |
| 976 | ROM_REGION( 0x40000, "gfx3", 0 ) | |
| 977 | 977 | ROM_LOAD( "tx1_5a.ic56", 0x0000, 0x2000, CRC(5635b8c1) SHA1(5cc9437a2ff0843f1917f2451852d4561c240b24) ) |
| 978 | 978 | ROM_LOAD( "tx1_6a.ic66", 0x2000, 0x2000, CRC(03d83cf8) SHA1(5c0cfc6bf02ad2b3f37e1ceb493f69eb9829ab1e) ) |
| 979 | 979 | ROM_LOAD( "tx1_7a.ic76", 0x4000, 0x2000, CRC(ad56013a) SHA1(ae3a91f58f30daff334754476db33ad1d12569fc) ) |
| r243192 | r243193 | |
| 984 | 984 | ROM_LOAD16_BYTE( "xb02b.ic223", 0x8000, 0x0200, CRC(22c77af6) SHA1(1be8585b95316b4fc5712cdaef699e676320cd4d) ) |
| 985 | 985 | ROM_LOAD16_BYTE( "xb01b.ic213", 0x8001, 0x0200, CRC(f6b8b70b) SHA1(b79374acf11d71db1e4ad3c494ac5f500a52677b) ) |
| 986 | 986 | |
| 987 | ROM_REGION( 0x | |
| 987 | ROM_REGION( 0x50000, "obj_map", 0 ) | |
| 988 | 988 | ROM_LOAD( "tx1_14b.ic106", 0x0000, 0x4000, CRC(68c63d6e) SHA1(110e02b99c44d31041be588bd14642e26890ecbd) ) |
| 989 | 989 | ROM_LOAD( "tx1_13b.ic73", 0x4000, 0x4000, CRC(b0c581b2) SHA1(20926bc15e7c97045b219b828acfcdd99b8712a6) ) |
| 990 | 990 | |
| 991 | ROM_REGION( 0x | |
| 991 | ROM_REGION( 0x50000, "user3", 0 ) | |
| 992 | 992 | ROM_LOAD( "tx1_12b.ic48", 0x0000, 0x2000, CRC(4b3d7956) SHA1(fc2432dd69f3be7007d4fd6f7c86c7c19453b1ba) ) |
| 993 | 993 | ROM_LOAD( "tx1_19b.ic281", 0x2000, 0x4000, CRC(cb250de6) SHA1(4bf3006986fb8cbb3dd4fa988e6471633614e4bb) ) |
| 994 | 994 | |
| r243192 | r243193 | |
| 1072 | 1072 | ROM_LOAD( "bug25.157", 0x2c000, 0x4000, CRC(80c4e045) SHA1(be3b537d3ed3ee74fc51059aa744dca4d63431f6) ) |
| 1073 | 1073 | ROM_RELOAD( 0x38000, 0x4000 ) |
| 1074 | 1074 | |
| 1075 | ROM_REGION( 0x | |
| 1075 | ROM_REGION( 0x40000, "road", 0 ) | |
| 1076 | 1076 | ROM_LOAD( "bug12.58", 0x0000, 0x2000, CRC(bd34d55c) SHA1(05a719a6eff5af3aaaa1e0ee783b18597582ed64) ) |
| 1077 | 1077 | ROM_LOAD( "bug11.57", 0x2000, 0x2000, CRC(a44d43eb) SHA1(c4d68c7e123506acaa6adc353579cac19ecb3a9d) ) |
| 1078 | 1078 | ROM_LOAD( "bb3.137", 0x4000, 0x0200, CRC(ad76f3fb) SHA1(bf96f903b32e009a2592df0f28cc3e20b039f4d4) ) |
| r243192 | r243193 | |
| 1086 | 1086 | ROM_LOAD16_BYTE( "bb1.245", 0x8000, 0x0200, CRC(0ddbd36d) SHA1(7a08901a350c315d46ab8d0aa881db384b9f37d2) ) |
| 1087 | 1087 | ROM_LOAD16_BYTE( "bb2.220", 0x8001, 0x0200, CRC(71d47de1) SHA1(2da9aeb3f2ebb1114631c8042a37c4f4c18e741b) ) |
| 1088 | 1088 | |
| 1089 | ROM_REGION( 0x10000, "obj_map", 0 ) | |
| 1089 | ROM_REGION( 0x100000, "obj_map", 0 ) | |
| 1090 | 1090 | ROM_LOAD( "bug16.210", 0x0000, 0x4000, CRC(8b64409e) SHA1(1fb4c6923e6a9e1f2a63a2c335b63e2bdc44b61f) ) |
| 1091 | 1091 | ROM_LOAD( "bug14.209", 0x4000, 0x4000, CRC(4e765282) SHA1(f7d69d39823a8b33bd0e5b1bd78a5d68a293e221) ) |
| 1092 | 1092 | ROM_LOAD( "bug17.182", 0x8000, 0x4000, CRC(a5d84df6) SHA1(4e33ef0bee383e0d47b0c679cd2a54edb7ca0e3e) ) |
| 1093 | 1093 | ROM_LOAD( "bug15.181", 0xc000, 0x4000, CRC(d519de10) SHA1(535d05e11af65be65f3d9924b0c48faf8dcfd1bf) ) |
| 1094 | 1094 | |
| 1095 | ROM_REGION( 0x | |
| 1095 | ROM_REGION( 0x10000, "obj_luts", 0 ) | |
| 1096 | 1096 | ROM_LOAD( "bug13.124", 0x0000, 0x2000, CRC(53604d7a) SHA1(bfa304cd885162ece7a5f54988d9880fc541eb3a) ) |
| 1097 | 1097 | ROM_LOAD( "bug18.156", 0x2000, 0x4000, CRC(e58321a6) SHA1(81be87d3c6046bb375c74362dc940f0269b39d1d) ) |
| 1098 | 1098 | |
| r243192 | r243193 | |
| 1161 | 1161 | ROM_LOAD( "bug30s.145", 0x20000, 0x8000, CRC(11d8e2a8) SHA1(9bf198229a12d331e8e7352b7ee3f39f6891f517) ) |
| 1162 | 1162 | ROM_LOAD( "bug23s.142", 0x28000, 0x8000, CRC(015db5d8) SHA1(39ef8b44f2eb9399fb1555cffa6763e06d59c181) ) |
| 1163 | 1163 | |
| 1164 | ROM_REGION( 0x | |
| 1164 | ROM_REGION( 0x40000, "road", 0 ) | |
| 1165 | 1165 | ROM_LOAD( "bug11s.225",0x0000, 0x4000, CRC(771af4e1) SHA1(a42b164dd0567c78c0d308ee48d63e5a284897bb) ) |
| 1166 | 1166 | ROM_LOAD( "bb3s.195", 0x4000, 0x0200, CRC(2ab3d5ff) SHA1(9f8359cb4ba2e7d15dbb9dc21cd71c0902cd2153) ) |
| 1167 | 1167 | ROM_LOAD( "bb4s.193", 0x4200, 0x0200, CRC(630f68a4) SHA1(d730f050353c688f81d090e33e00cd35e7b7b6fa) ) |
| r243192 | r243193 | |
| 1174 | 1174 | ROM_LOAD16_BYTE( "bb1.163", 0x8000, 0x0200, CRC(0ddbd36d) SHA1(7a08901a350c315d46ab8d0aa881db384b9f37d2) ) |
| 1175 | 1175 | ROM_LOAD16_BYTE( "bb2.162", 0x8001, 0x0200, CRC(71d47de1) SHA1(2da9aeb3f2ebb1114631c8042a37c4f4c18e741b) ) |
| 1176 | 1176 | |
| 1177 | ROM_REGION( 0x10000, "obj_map", 0 ) | |
| 1177 | ROM_REGION( 0x100000, "obj_map", 0 ) | |
| 1178 | 1178 | ROM_LOAD( "bug16s.139", 0x0000, 0x8000, CRC(1903a9ad) SHA1(526c404c15e3f04b4afb27dee66e9deb0a6b9704) ) |
| 1179 | 1179 | ROM_LOAD( "bug17s.140", 0x8000, 0x8000, CRC(82cabdd4) SHA1(94324fcf83c373621fc40553473ae3cb552ab704) ) |
| 1180 | 1180 | |
| 1181 | ROM_REGION( 0x | |
| 1181 | ROM_REGION( 0x10000, "obj_luts", 0 ) | |
| 1182 | 1182 | ROM_LOAD( "bug13.32", 0x0000, 0x2000, CRC(53604d7a) SHA1(bfa304cd885162ece7a5f54988d9880fc541eb3a) ) |
| 1183 | 1183 | ROM_LOAD( "bug18s.141", 0x2000, 0x4000, CRC(67786327) SHA1(32cc1f5bc654497c968ddcd4af29720c6d659482) ) |
| 1184 | 1184 |
| r243192 | r243193 | |
|---|---|---|
| 26 | 26 | |
| 27 | 27 | UINT32 *m_vega_vram; |
| 28 | 28 | UINT8 m_vega_vbuffer; |
| 29 | ||
| 29 | ||
| 30 | 30 | DECLARE_WRITE32_MEMBER(vega_vram_w); |
| 31 | 31 | DECLARE_READ32_MEMBER(vega_vram_r); |
| 32 | 32 | DECLARE_WRITE32_MEMBER(vega_misc_w); |
| r243192 | r243193 | |
|---|---|---|
| 3535 | 3535 | GAME( 1981, pulsar, 0, pulsar, pulsar, driver_device, 0, ROT270, "Sega", "Pulsar", GAME_IMPERFECT_SOUND ) |
| 3536 | 3536 | GAME( 1979, heiankyo, 0, heiankyo, heiankyo, driver_device, 0, ROT270, "Denki Onkyo", "Heiankyo Alien", GAME_NO_SOUND ) |
| 3537 | 3537 | GAME( 19??, alphaho, 0, alphaho, alphaho, driver_device, 0, ROT270, "Data East Corporation", "Alpha Fighter / Head On", GAME_WRONG_COLORS | GAME_NO_SOUND ) |
| 3538 |
| r243192 | r243193 | |
|---|---|---|
| 146 | 146 | |
| 147 | 147 | DECLARE_WRITE8_MEMBER(wardner_bank_w); |
| 148 | 148 | DECLARE_DRIVER_INIT(wardner); |
| 149 | DECLARE_WRITE_LINE_MEMBER(irqhandler); | |
| 149 | 150 | |
| 150 | 151 | protected: |
| 151 | 152 | virtual void driver_start(); |
| r243192 | r243193 | |
| 336 | 337 | }; |
| 337 | 338 | |
| 338 | 339 | |
| 340 | /* handler called by the 3812 emulator when the internal timers cause an IRQ */ | |
| 341 | WRITE_LINE_MEMBER(wardner_state::irqhandler) | |
| 342 | { | |
| 343 | m_audiocpu->set_input_line(0, state); | |
| 344 | } | |
| 345 | ||
| 346 | ||
| 339 | 347 | static GFXDECODE_START( wardner ) |
| 340 | 348 | GFXDECODE_ENTRY( "gfx1", 0x00000, charlayout, 1536, 32 ) /* colors 1536-1791 */ |
| 341 | 349 | GFXDECODE_ENTRY( "gfx2", 0x00000, tilelayout, 1280, 16 ) /* colors 1280-1535 */ |
| r243192 | r243193 | |
| 411 | 419 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 412 | 420 | |
| 413 | 421 | MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_14MHz/4) |
| 414 | MCFG_YM3812_IRQ_HANDLER(I | |
| 422 | MCFG_YM3812_IRQ_HANDLER(WRITELINE(wardner_state, irqhandler)) | |
| 415 | 423 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 416 | 424 | MACHINE_CONFIG_END |
| 417 | 425 |
| r243192 | r243193 | |
|---|---|---|
| 582 | 582 | Magic Bubble |
| 583 | 583 | ***************************************************************************/ |
| 584 | 584 | |
| 585 | WRITE_LINE_MEMBER(yunsun16_state::soundirq) | |
| 586 | { | |
| 587 | m_audiocpu->set_input_line(0, state); | |
| 588 | } | |
| 589 | ||
| 585 | 590 | static MACHINE_CONFIG_START( magicbub, yunsun16_state ) |
| 586 | 591 | |
| 587 | 592 | /* basic machine hardware */ |
| r243192 | r243193 | |
| 609 | 614 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 610 | 615 | |
| 611 | 616 | MCFG_SOUND_ADD("ymsnd", YM3812, XTAL_16MHz/4) |
| 612 | MCFG_YM3812_IRQ_HANDLER(I | |
| 617 | MCFG_YM3812_IRQ_HANDLER(WRITELINE(yunsun16_state, soundirq)) | |
| 613 | 618 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.80) |
| 614 | 619 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.80) |
| 615 | 620 |
| r243192 | r243193 | |
|---|---|---|
| 83 | 83 | DECLARE_READ16_MEMBER(bam2_unk_r); |
| 84 | 84 | DECLARE_WRITE16_MEMBER(acpsx_00_w); |
| 85 | 85 | DECLARE_WRITE16_MEMBER(acpsx_10_w); |
| 86 | DECLARE_WRITE16_MEMBER(nbajamex_bank_w); | |
| 87 | 86 | DECLARE_WRITE16_MEMBER(nbajamex_80_w); |
| 88 | 87 | DECLARE_READ16_MEMBER(nbajamex_08_r); |
| 89 | 88 | DECLARE_READ16_MEMBER(nbajamex_80_r); |
| r243192 | r243193 | |
| 2035 | 2034 | verboselog(0, "acpsx_00_w( %08x, %08x, %08x )\n", offset, data, mem_mask ); |
| 2036 | 2035 | } |
| 2037 | 2036 | |
| 2038 | WRITE16_MEMBER(zn_state::nbajamex_bank_w) | |
| 2039 | { | |
| 2040 | UINT32 newbank = 0; | |
| 2041 | ||
| 2042 | verboselog(0, "nbajamex_bank_w( %08x, %08x, %08x )\n", offset, data, mem_mask ); | |
| 2043 | ||
| 2044 | if (offset > 1) | |
| 2045 | { | |
| 2046 | logerror("Unknown banking offset %x!\n", offset); | |
| 2047 | } | |
| 2048 | ||
| 2049 | if (offset == 1) | |
| 2050 | { | |
| 2051 | data -= 1; | |
| 2052 | } | |
| 2053 | ||
| 2054 | if (data <= 1) | |
| 2055 | { | |
| 2056 | newbank = (data * 0x400000); | |
| 2057 | } | |
| 2058 | else if (data >= 0x10) | |
| 2059 | { | |
| 2060 | data -= 0x10; | |
| 2061 | newbank = (data * 0x400000); | |
| 2062 | newbank += 0x200000; | |
| 2063 | } | |
| 2064 | ||
| 2065 | if (offset == 0) | |
| 2066 | { | |
| 2067 | membank( "bankedroms" )->set_base( memregion( "bankedroms" )->base() + newbank); | |
| 2068 | } | |
| 2069 | else if (offset == 1) | |
| 2070 | { | |
| 2071 | newbank += 0x200000; | |
| 2072 | membank( "bankedroms2" )->set_base( memregion( "bankedroms" )->base() + newbank); | |
| 2073 | } | |
| 2074 | } | |
| 2075 | ||
| 2076 | 2037 | WRITE16_MEMBER(zn_state::acpsx_10_w) |
| 2077 | 2038 | { |
| 2078 | 2039 | verboselog(0, "acpsx_10_w( %08x, %08x, %08x )\n", offset, data, mem_mask ); |
| 2079 | 2040 | } |
| 2080 | 2041 | |
| 2081 | // all 16 bits goes to the external soundboard's latch (see sound test menu) | |
| 2082 | 2042 | WRITE16_MEMBER(zn_state::nbajamex_80_w) |
| 2083 | 2043 | { |
| 2084 | 2044 | verboselog(0, "nbajamex_80_w( %08x, %08x, %08x )\n", offset, data, mem_mask ); |
| 2085 | 2045 | psxirq_device *psxirq = (psxirq_device *) machine().device("maincpu:irq"); |
| 2086 | 2046 | psxirq->intin10(1); |
| 2047 | membank( "bankedroms" )->set_base( memregion( "bankedroms" )->base() + (data ? 0xe00000 : 0)); | |
| 2087 | 2048 | } |
| 2088 | 2049 | |
| 2089 | 2050 | READ16_MEMBER(zn_state::nbajamex_08_r) |
| r243192 | r243193 | |
| 2093 | 2054 | return data; |
| 2094 | 2055 | } |
| 2095 | 2056 | |
| 2096 | // possibly a readback from the external soundboard? | |
| 2097 | 2057 | READ16_MEMBER(zn_state::nbajamex_80_r) |
| 2098 | 2058 | { |
| 2099 | 2059 | UINT32 data = 0xffffffff; |
| r243192 | r243193 | |
| 2110 | 2070 | |
| 2111 | 2071 | static ADDRESS_MAP_START(nbajamex_map, AS_PROGRAM, 32, zn_state) |
| 2112 | 2072 | AM_RANGE(0x1f000000, 0x1f1fffff) AM_ROMBANK("bankedroms") |
| 2113 | AM_RANGE(0x1f200000, 0x1f7fffff) AM_ROMBANK("bankedroms2") | |
| 2114 | AM_RANGE(0x1fbfff00, 0x1fbfff07) AM_WRITE16(nbajamex_bank_w, 0xffffffff) | |
| 2073 | AM_RANGE(0x1f200000, 0x1f207fff) AM_RAM AM_SHARE("eeprom") | |
| 2115 | 2074 | AM_RANGE(0x1fbfff08, 0x1fbfff0b) AM_READ16(nbajamex_08_r, 0xffff) |
| 2116 | 2075 | AM_RANGE(0x1fbfff80, 0x1fbfff83) AM_READWRITE16(nbajamex_80_r, nbajamex_80_w, 0xffff) |
| 2117 | 2076 | |
| r243192 | r243193 | |
| 2121 | 2080 | MACHINE_RESET_MEMBER(zn_state,nbajamex) |
| 2122 | 2081 | { |
| 2123 | 2082 | membank( "bankedroms" )->set_base( memregion( "bankedroms" )->base() ); |
| 2124 | membank( "bankedroms2" )->set_base( memregion( "bankedroms" )->base() + 0x200000 ); | |
| 2125 | 2083 | } |
| 2126 | 2084 | |
| 2127 | 2085 | static ADDRESS_MAP_START(jdredd_map, AS_PROGRAM, 32, zn_state) |
| r243192 | r243193 | |
| 4867 | 4825 | /* it in every zip file */ |
| 4868 | 4826 | GAME( 1995, acpsx, 0, coh1000a, zn, driver_device, 0, ROT0, "Acclaim", "Acclaim PSX", GAME_IS_BIOS_ROOT ) |
| 4869 | 4827 | |
| 4870 | GAME( 1996, nbajamex, acpsx, nbajamex, zn, driver_device, 0, ROT0, "Acclaim", "NBA Jam Extreme", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) | |
| 4828 | GAME( 1996, nbajamex, acpsx, nbajamex, zn, driver_device, 0, ROT0, "Acclaim", "NBA Jam Extreme", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) | |
| 4871 | 4829 | GAME( 1996, jdredd, acpsx, jdredd, jdredd, driver_device, 0, ROT0, "Acclaim", "Judge Dredd (Rev C Dec. 17 1997)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) |
| 4872 | 4830 | GAME( 1996, jdreddb, jdredd, jdredd, jdredd, driver_device, 0, ROT0, "Acclaim", "Judge Dredd (Rev B Nov. 26 1997)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) |
| 4873 | 4831 |
| r243192 | r243193 | |
|---|---|---|
| 23 | 23 | required_shared_ptr<UINT8> m_main_ram; |
| 24 | 24 | UINT16 m_spriteram16[0x800/2]; // a 16-bit copy of spriteram for use with the MXC06 code |
| 25 | 25 | |
| 26 | /* video-related */ | |
| 27 | int m_flipscreen; | |
| 28 | ||
| 26 | 29 | /* misc */ |
| 27 | 30 | int m_trio_control_select; |
| 28 | 31 | |
| r243192 | r243193 | |
| 36 | 39 | DECLARE_READ8_MEMBER(triothep_control_r); |
| 37 | 40 | DECLARE_WRITE8_MEMBER(actfancr_sound_w); |
| 38 | 41 | DECLARE_WRITE8_MEMBER(actfancr_buffer_spriteram_w); |
| 42 | virtual void video_start(); | |
| 43 | DECLARE_MACHINE_START(actfancr); | |
| 44 | DECLARE_MACHINE_RESET(actfancr); | |
| 39 | 45 | DECLARE_MACHINE_START(triothep); |
| 40 | 46 | DECLARE_MACHINE_RESET(triothep); |
| 41 | 47 | UINT32 screen_update_actfancr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 48 | void register_savestate( ); | |
| 49 | DECLARE_WRITE_LINE_MEMBER(sound_irq); | |
| 42 | 50 | }; |
| r243192 | r243193 | |
|---|---|---|
| 123 | 123 | void spikes91_draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ); |
| 124 | 124 | void aerfboot_draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ); |
| 125 | 125 | void wbbc97_draw_bitmap( bitmap_rgb32 &bitmap ); |
| 126 | DECLARE_WRITE_LINE_MEMBER(irqhandler); | |
| 126 | 127 | required_device<cpu_device> m_maincpu; |
| 127 | 128 | optional_device<okim6295_device> m_oki; |
| 128 | 129 | required_device<gfxdecode_device> m_gfxdecode; |
| r243192 | r243193 | |
|---|---|---|
| 115 | 115 | void jongbou_video_banking(int *bank, int data); |
| 116 | 116 | void kyros_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int c, int d ); |
| 117 | 117 | void sstingry_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int c, int d ); |
| 118 | DECLARE_WRITE_LINE_MEMBER(ym3812_irq); | |
| 118 | 119 | required_device<cpu_device> m_maincpu; |
| 119 | 120 | required_device<gfxdecode_device> m_gfxdecode; |
| 120 | 121 | required_device<palette_device> m_palette; |
| r243192 | r243193 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | #include "sound/ay8910.h" | |
| 8 | ||
| 9 | 7 | class bogeyman_state : public driver_device |
| 10 | 8 | { |
| 11 | 9 | public: |
| 12 | 10 | bogeyman_state(const machine_config &mconfig, device_type type, const char *tag) |
| 13 | 11 | : driver_device(mconfig, type, tag), |
| 14 | m_maincpu(*this, "maincpu"), | |
| 15 | m_gfxdecode(*this, "gfxdecode"), | |
| 16 | m_palette(*this, "palette"), | |
| 17 | m_ay1(*this, "ay1"), | |
| 18 | m_ay2(*this, "ay2"), | |
| 19 | 12 | m_videoram(*this, "videoram"), |
| 20 | 13 | m_videoram2(*this, "videoram2"), |
| 21 | 14 | m_colorram(*this, "colorram"), |
| 22 | 15 | m_colorram2(*this, "colorram2"), |
| 23 | m_spriteram(*this, "spriteram") { } | |
| 16 | m_spriteram(*this, "spriteram"), | |
| 17 | m_maincpu(*this, "maincpu"), | |
| 18 | m_gfxdecode(*this, "gfxdecode"), | |
| 19 | m_palette(*this, "palette") { } | |
| 24 | 20 | |
| 25 | /* devices */ | |
| 26 | required_device<cpu_device> m_maincpu; | |
| 27 | required_device<gfxdecode_device> m_gfxdecode; | |
| 28 | required_device<palette_device> m_palette; | |
| 29 | required_device<ay8910_device> m_ay1; | |
| 30 | required_device<ay8910_device> m_ay2; | |
| 31 | ||
| 32 | 21 | /* memory pointers */ |
| 33 | 22 | required_shared_ptr<UINT8> m_videoram; |
| 34 | 23 | required_shared_ptr<UINT8> m_videoram2; |
| r243192 | r243193 | |
| 45 | 34 | int m_psg_latch; |
| 46 | 35 | int m_last_write; |
| 47 | 36 | int m_colbank; |
| 48 | ||
| 49 | DECLARE_WRITE8_MEMBER(ay8910_latch_w); | |
| 50 | DECLARE_WRITE8_MEMBER(ay8910_control_w); | |
| 51 | DECLARE_WRITE8_MEMBER(videoram_w); | |
| 52 | DECLARE_WRITE8_MEMBER(colorram_w); | |
| 53 | DECLARE_WRITE8_MEMBER(videoram2_w); | |
| 54 | DECLARE_WRITE8_MEMBER(colorram2_w); | |
| 55 | DECLARE_WRITE8_MEMBER(paletteram_w); | |
| 56 | DECLARE_WRITE8_MEMBER(colbank_w); | |
| 57 | ||
| 37 | DECLARE_WRITE8_MEMBER(bogeyman_8910_latch_w); | |
| 38 | DECLARE_WRITE8_MEMBER(bogeyman_8910_control_w); | |
| 39 | DECLARE_WRITE8_MEMBER(bogeyman_videoram_w); | |
| 40 | DECLARE_WRITE8_MEMBER(bogeyman_colorram_w); | |
| 41 | DECLARE_WRITE8_MEMBER(bogeyman_videoram2_w); | |
| 42 | DECLARE_WRITE8_MEMBER(bogeyman_colorram2_w); | |
| 43 | DECLARE_WRITE8_MEMBER(bogeyman_paletteram_w); | |
| 44 | DECLARE_WRITE8_MEMBER(bogeyman_colbank_w); | |
| 58 | 45 | TILE_GET_INFO_MEMBER(get_bg_tile_info); |
| 59 | 46 | TILE_GET_INFO_MEMBER(get_fg_tile_info); |
| 60 | ||
| 61 | 47 | virtual void machine_start(); |
| 62 | 48 | virtual void machine_reset(); |
| 63 | 49 | virtual void video_start(); |
| 64 | ||
| 65 | 50 | DECLARE_PALETTE_INIT(bogeyman); |
| 66 | UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); | |
| 67 | void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); | |
| 51 | UINT32 screen_update_bogeyman(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); | |
| 52 | void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); | |
| 53 | required_device<cpu_device> m_maincpu; | |
| 54 | required_device<gfxdecode_device> m_gfxdecode; | |
| 55 | required_device<palette_device> m_palette; | |
| 68 | 56 | }; |
| r243192 | r243193 | |
|---|---|---|
| 51 | 51 | TILE_GET_INFO_MEMBER(get_bg_tile_info); |
| 52 | 52 | UINT32 screen_update_calomega(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 53 | 53 | DECLARE_PALETTE_INIT(calomega); |
| 54 | ||
| 54 | ||
| 55 | 55 | protected: |
| 56 | 56 | virtual void video_start(); |
| 57 | 57 | |
| r243192 | r243193 | |
| 64 | 64 | |
| 65 | 65 | required_shared_ptr<UINT8> m_videoram; |
| 66 | 66 | required_shared_ptr<UINT8> m_colorram; |
| 67 | ||
| 67 | ||
| 68 | 68 | optional_ioport m_in0; |
| 69 | 69 | optional_ioport m_in0_0; |
| 70 | 70 | optional_ioport m_in0_1; |
| r243192 | r243193 | |
| 72 | 72 | optional_ioport m_in0_3; |
| 73 | 73 | optional_ioport m_frq; |
| 74 | 74 | optional_ioport m_sw2; |
| 75 | ||
| 75 | ||
| 76 | 76 | UINT8 m_tx_line; |
| 77 | 77 | int m_s903_mux_data; |
| 78 | 78 | int m_s905_mux_data; |
| r243192 | r243193 | |
|---|---|---|
| 15 | 15 | m_bg_videoram(*this, "bg_videoram"), |
| 16 | 16 | m_spriteram(*this, "spriteram"), |
| 17 | 17 | m_sprgen(*this, "spritegen"), |
| 18 | m_audiocpu(*this, "audiocpu"), | |
| 18 | 19 | m_maincpu(*this, "maincpu"), |
| 19 | 20 | m_gfxdecode(*this, "gfxdecode") { } |
| 20 | 21 | |
| r243192 | r243193 | |
| 31 | 32 | int m_bestri_tilebank; |
| 32 | 33 | |
| 33 | 34 | /* devices */ |
| 35 | required_device<cpu_device> m_audiocpu; | |
| 34 | 36 | DECLARE_WRITE16_MEMBER(crospang_soundlatch_w); |
| 35 | 37 | DECLARE_WRITE16_MEMBER(bestri_tilebank_w); |
| 36 | 38 | DECLARE_WRITE16_MEMBER(bestri_bg_scrolly_w); |
| r243192 | r243193 | |
| 51 | 53 | virtual void video_start(); |
| 52 | 54 | UINT32 screen_update_crospang(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 53 | 55 | void tumblepb_gfx1_rearrange(); |
| 56 | DECLARE_WRITE_LINE_MEMBER(irqhandler); | |
| 54 | 57 | required_device<cpu_device> m_maincpu; |
| 55 | 58 | required_device<gfxdecode_device> m_gfxdecode; |
| 56 | 59 | }; |
| r243192 | r243193 | |
|---|---|---|
| 24 | 24 | m_paletteram(*this, "palette"), |
| 25 | 25 | m_robocop_shared_ram(*this, "robocop_shared"), |
| 26 | 26 | m_hippodrm_shared_ram(*this, "hippodrm_shared") { } |
| 27 | ||
| 27 | ||
| 28 | 28 | required_device<cpu_device> m_maincpu; |
| 29 | 29 | required_device<cpu_device> m_audiocpu; |
| 30 | 30 | optional_device<cpu_device> m_subcpu; |
| r243192 | r243193 | |
| 77 | 77 | DECLARE_READ16_MEMBER(ffantasybl_242024_r); |
| 78 | 78 | DECLARE_WRITE_LINE_MEMBER(sound_irq); |
| 79 | 79 | DECLARE_WRITE_LINE_MEMBER(sound_irq2); |
| 80 | ||
| 80 | ||
| 81 | 81 | DECLARE_DRIVER_INIT(robocop); |
| 82 | 82 | DECLARE_DRIVER_INIT(hippodrm); |
| 83 | 83 | DECLARE_DRIVER_INIT(hbarrel); |
| r243192 | r243193 | |
| 86 | 86 | DECLARE_DRIVER_INIT(baddudes); |
| 87 | 87 | DECLARE_DRIVER_INIT(midresb); |
| 88 | 88 | DECLARE_DRIVER_INIT(ffantasybl); |
| 89 | ||
| 89 | ||
| 90 | 90 | virtual void machine_start(); |
| 91 | 91 | DECLARE_MACHINE_RESET(slyspy); |
| 92 | 92 | DECLARE_VIDEO_START(dec0); |
| 93 | 93 | DECLARE_VIDEO_START(dec0_nodma); |
| 94 | ||
| 94 | ||
| 95 | 95 | UINT32 screen_update_hbarrel(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 96 | 96 | UINT32 screen_update_baddudes(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 97 | 97 | UINT32 screen_update_birdtry(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| r243192 | r243193 | |
| 99 | 99 | UINT32 screen_update_hippodrm(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 100 | 100 | UINT32 screen_update_slyspy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 101 | 101 | UINT32 screen_update_midres(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 102 | ||
| 102 | ||
| 103 | 103 | void baddudes_i8751_write(int data); |
| 104 | 104 | void birdtry_i8751_write(int data); |
| 105 | 105 | void dec0_i8751_write(int data); |
| r243192 | r243193 | |
| 118 | 118 | UINT8 m_automat_adpcm_byte; |
| 119 | 119 | int m_automat_msm5205_vclk_toggle; |
| 120 | 120 | UINT16 m_automat_scroll_regs[4]; |
| 121 | ||
| 121 | ||
| 122 | 122 | DECLARE_WRITE16_MEMBER(automat_control_w); |
| 123 | 123 | DECLARE_WRITE8_MEMBER(automat_adpcm_w); |
| 124 | 124 | DECLARE_READ16_MEMBER( automat_palette_r ); |
| r243192 | r243193 | |
| 128 | 128 | COMBINE_DATA(&m_automat_scroll_regs[offset]); |
| 129 | 129 | } |
| 130 | 130 | DECLARE_WRITE_LINE_MEMBER(automat_vclk_cb); |
| 131 | ||
| 131 | ||
| 132 | 132 | virtual void machine_start(); |
| 133 | ||
| 133 | ||
| 134 | 134 | UINT32 screen_update_automat(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 135 | 135 | UINT32 screen_update_secretab(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 136 | 136 | }; |
| r243192 | r243193 | |
|---|---|---|
| 162 | 162 | INTERRUPT_GEN_MEMBER(gondo_interrupt); |
| 163 | 163 | INTERRUPT_GEN_MEMBER(oscar_interrupt); |
| 164 | 164 | void srdarwin_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int pri ); |
| 165 | DECLARE_WRITE_LINE_MEMBER(irqhandler); | |
| 165 | 166 | DECLARE_WRITE_LINE_MEMBER(csilver_adpcm_int); |
| 166 | 167 | |
| 167 | 168 | protected: |
| r243192 | r243193 | |
|---|---|---|
| 69 | 69 | void draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ); |
| 70 | 70 | void set_bg_page( int page, int value ); |
| 71 | 71 | void set_fg_page( int page, int value ); |
| 72 | DECLARE_WRITE_LINE_MEMBER(irqhandler); | |
| 72 | 73 | required_device<cpu_device> m_maincpu; |
| 73 | 74 | optional_device<cpu_device> m_audiocpu; // system 16c does not have sound CPU |
| 74 | 75 | required_device<okim6295_device> m_oki; |
| r243192 | r243193 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | #include "machine/msm6242.h" |
| 7 | #include "sound/2413intf.h" | |
| 8 | 7 | #include "sound/msm5205.h" |
| 9 | 8 | #include "sound/okim6295.h" |
| 10 | 9 | |
| r243192 | r243193 | |
| 13 | 12 | public: |
| 14 | 13 | dynax_state(const machine_config &mconfig, device_type type, const char *tag) |
| 15 | 14 | : driver_device(mconfig, type, tag), |
| 15 | m_dsw_sel16(*this, "dsw_sel16"), | |
| 16 | m_protection1(*this, "protection1"), | |
| 17 | m_protection2(*this, "protection2"), | |
| 16 | 18 | m_maincpu(*this, "maincpu"), |
| 17 | 19 | m_soundcpu(*this, "soundcpu"), |
| 18 | m_ym2413(*this, "ym2413"), | |
| 19 | 20 | m_oki(*this, "oki"), |
| 20 | 21 | m_msm(*this, "msm"), |
| 21 | 22 | m_screen(*this, "screen"), |
| r243192 | r243193 | |
| 23 | 24 | m_rtc(*this, "rtc") |
| 24 | 25 | { } |
| 25 | 26 | |
| 26 | /* devices */ | |
| 27 | required_device<cpu_device> m_maincpu; | |
| 28 | optional_device<cpu_device> m_soundcpu; | |
| 29 | optional_device<ym2413_device> m_ym2413; | |
| 30 | optional_device<okim6295_device> m_oki; | |
| 31 | optional_device<msm5205_device> m_msm; | |
| 32 | optional_device<screen_device> m_screen; | |
| 33 | required_device<palette_device> m_palette; | |
| 34 | optional_device<msm6242_device> m_rtc; | |
| 35 | ||
| 36 | 27 | // up to 8 layers, 2 images per layer (interleaved on screen) |
| 37 | 28 | UINT8 * m_pixmap[8][2]; |
| 29 | UINT8 * m_ddenlovr_pixmap[8]; | |
| 38 | 30 | |
| 39 | 31 | /* irq */ |
| 40 | 32 | typedef void (dynax_state::*irq_func)(); // some games trigger IRQ at blitter end, some don't |
| r243192 | r243193 | |
| 84 | 76 | const int *m_priority_table; |
| 85 | 77 | int m_hanamai_priority; |
| 86 | 78 | |
| 79 | /* ddenlovr blitter (TODO: merge with the above, where possible) */ | |
| 80 | int m_extra_layers; | |
| 81 | int m_ddenlovr_dest_layer; | |
| 82 | int m_ddenlovr_blit_flip; | |
| 83 | int m_ddenlovr_blit_x; | |
| 84 | int m_ddenlovr_blit_y; | |
| 85 | int m_ddenlovr_blit_address; | |
| 86 | int m_ddenlovr_blit_pen; | |
| 87 | int m_ddenlovr_blit_pen_mode; | |
| 88 | int m_ddenlovr_blitter_irq_flag; | |
| 89 | int m_ddenlovr_blitter_irq_enable; | |
| 90 | int m_ddenlovr_rect_width; | |
| 91 | int m_ddenlovr_rect_height; | |
| 92 | int m_ddenlovr_clip_width; | |
| 93 | int m_ddenlovr_clip_height; | |
| 94 | int m_ddenlovr_line_length; | |
| 95 | int m_ddenlovr_clip_ctrl; | |
| 96 | int m_ddenlovr_clip_x; | |
| 97 | int m_ddenlovr_clip_y; | |
| 98 | int m_ddenlovr_scroll[8*2]; | |
| 99 | int m_ddenlovr_priority; | |
| 100 | int m_ddenlovr_priority2; | |
| 101 | int m_ddenlovr_bgcolor; | |
| 102 | int m_ddenlovr_bgcolor2; | |
| 103 | int m_ddenlovr_layer_enable; | |
| 104 | int m_ddenlovr_layer_enable2; | |
| 105 | int m_ddenlovr_palette_base[8]; | |
| 106 | int m_ddenlovr_palette_mask[8]; | |
| 107 | int m_ddenlovr_transparency_pen[8]; | |
| 108 | int m_ddenlovr_transparency_mask[8]; | |
| 109 | int m_ddenlovr_blit_latch; | |
| 110 | int m_ddenlovr_blit_pen_mask; // not implemented | |
| 111 | int m_ddenlovr_blit_rom_bits; // usually 8, 16 in hanakanz | |
| 112 | const int *m_ddenlovr_blit_commands; | |
| 113 | int m_ddenlovr_blit_regs[2]; | |
| 114 | ||
| 87 | 115 | /* input */ |
| 88 | 116 | UINT8 m_input_sel; |
| 89 | 117 | UINT8 m_dsw_sel; |
| r243192 | r243193 | |
| 111 | 139 | UINT8 m_gekisha_rom_enable; |
| 112 | 140 | UINT8 *m_romptr; |
| 113 | 141 | |
| 142 | /* ddenlovr misc (TODO: merge with the above, where possible) */ | |
| 143 | UINT8 m_palram[0x200]; | |
| 144 | int m_okibank; | |
| 145 | UINT8 m_rongrong_blitter_busy_select; | |
| 146 | ||
| 147 | optional_shared_ptr<UINT16> m_dsw_sel16; | |
| 148 | optional_shared_ptr<UINT16> m_protection1; | |
| 149 | optional_shared_ptr<UINT16> m_protection2; | |
| 150 | UINT8 m_prot_val; | |
| 151 | UINT16 m_prot_16; | |
| 152 | UINT16 m_quiz365_protection[2]; | |
| 153 | ||
| 154 | UINT16 m_mmpanic_leds; /* A led for each of the 9 buttons */ | |
| 155 | UINT8 m_funkyfig_lockout; | |
| 156 | UINT8 m_romdata[2]; | |
| 157 | int m_palette_index; | |
| 158 | UINT8 m_hginga_rombank; | |
| 159 | UINT8 m_mjflove_irq_cause; | |
| 160 | UINT8 m_daimyojn_palette_sel; | |
| 161 | ||
| 162 | int m_irq_count; | |
| 163 | ||
| 164 | ||
| 165 | /* devices */ | |
| 166 | required_device<cpu_device> m_maincpu; | |
| 167 | optional_device<cpu_device> m_soundcpu; | |
| 168 | device_t *m_ymsnd; | |
| 169 | optional_device<okim6295_device> m_oki; | |
| 170 | optional_device<msm5205_device> m_msm; | |
| 171 | optional_device<screen_device> m_screen; | |
| 172 | required_device<palette_device> m_palette; | |
| 173 | optional_device<msm6242_device> m_rtc; | |
| 174 | device_t *m_top_scr; | |
| 175 | device_t *m_bot_scr; | |
| 114 | 176 | DECLARE_WRITE8_MEMBER(dynax_vblank_ack_w); |
| 115 | 177 | DECLARE_WRITE8_MEMBER(dynax_blitter_ack_w); |
| 116 | 178 | DECLARE_WRITE8_MEMBER(jantouki_vblank_ack_w); |
| r243192 | r243193 | |
| 213 | 275 | DECLARE_WRITE8_MEMBER(jantouki_blitter2_rev2_w); |
| 214 | 276 | DECLARE_WRITE8_MEMBER(hanamai_priority_w); |
| 215 | 277 | DECLARE_WRITE8_MEMBER(tenkai_priority_w); |
| 216 | ||
| 217 | 278 | DECLARE_DRIVER_INIT(mjelct3); |
| 218 | 279 | DECLARE_DRIVER_INIT(blktouch); |
| 219 | 280 | DECLARE_DRIVER_INIT(mjelct3a); |
| 220 | 281 | DECLARE_DRIVER_INIT(mjreach); |
| 221 | 282 | DECLARE_DRIVER_INIT(maya); |
| 222 | ||
| 223 | 283 | UINT32 screen_update_hanamai(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 224 | 284 | UINT32 screen_update_hnoridur(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 225 | 285 | UINT32 screen_update_sprtmtch(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 226 | 286 | UINT32 screen_update_mjdialq2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 227 | 287 | UINT32 screen_update_jantouki_top(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 228 | 288 | UINT32 screen_update_jantouki_bottom(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 229 | ||
| 230 | 289 | INTERRUPT_GEN_MEMBER(sprtmtch_vblank_interrupt); |
| 231 | 290 | INTERRUPT_GEN_MEMBER(jantouki_vblank_interrupt); |
| 232 | 291 | INTERRUPT_GEN_MEMBER(jantouki_sound_vblank_interrupt); |
| 233 | 292 | INTERRUPT_GEN_MEMBER(yarunara_clock_interrupt); |
| 234 | 293 | INTERRUPT_GEN_MEMBER(mjelctrn_vblank_interrupt); |
| 235 | ||
| 236 | 294 | TIMER_DEVICE_CALLBACK_MEMBER(neruton_irq_scanline); |
| 237 | 295 | TIMER_DEVICE_CALLBACK_MEMBER(majxtal7_vblank_interrupt); |
| 238 | 296 | TIMER_DEVICE_CALLBACK_MEMBER(tenkai_interrupt); |
| 239 | ||
| 240 | 297 | void tenkai_update_rombank(); |
| 241 | 298 | void gekisha_bank_postload(); |
| 242 | ||
| 243 | 299 | DECLARE_WRITE_LINE_MEMBER(sprtmtch_sound_callback); |
| 244 | 300 | DECLARE_WRITE_LINE_MEMBER(jantouki_sound_callback); |
| 245 | 301 | DECLARE_WRITE_LINE_MEMBER(adpcm_int); |
| r243192 | r243193 | |
| 268 | 324 | DECLARE_VIDEO_START(mcnpshnt); |
| 269 | 325 | DECLARE_PALETTE_INIT(janyuki); |
| 270 | 326 | DECLARE_VIDEO_START(neruton); |
| 271 | ||
| 272 | 327 | inline void blitter_plot_pixel( int layer, int mask, int x, int y, int pen, int wrap, int flags ); |
| 273 | 328 | int blitter_drawgfx( int layer, int mask, const char *gfx, int src, int pen, int x, int y, int wrap, int flags ); |
| 274 | 329 | void dynax_blitter_start( int flags ); |
| r243192 | r243193 | |
|---|---|---|
| 27 | 27 | optional_device<qs1000_device> m_qs1000; |
| 28 | 28 | required_device<screen_device> m_screen; |
| 29 | 29 | required_device<palette_device> m_palette; |
| 30 | ||
| 30 | ||
| 31 | 31 | optional_ioport m_in0; // klondkp doesn't have it |
| 32 | 32 | optional_ioport m_eepromoutport; |
| 33 | 33 | optional_ioport m_penx1port; |
| 34 | 34 | optional_ioport m_peny1port; |
| 35 | 35 | optional_ioport m_penx2port; |
| 36 | 36 | optional_ioport m_peny2port; |
| 37 | ||
| 37 | ||
| 38 | 38 | optional_memory_bank m_sndbank; |
| 39 | ||
| 39 | ||
| 40 | 40 | int m_coin_counter_bit; |
| 41 | 41 | int m_buffer; |
| 42 | 42 | UINT32 *m_vram; |
| 43 | 43 | |
| 44 | 44 | UINT8 m_sound_data; |
| 45 | ||
| 45 | ||
| 46 | 46 | // speedups - see machine/eolithsp.c |
| 47 | 47 | int m_speedup_address; |
| 48 | 48 | int m_speedup_address2; |
| r243192 | r243193 | |
| 66 | 66 | DECLARE_READ8_MEMBER(qs1000_p1_r); |
| 67 | 67 | DECLARE_WRITE8_MEMBER(qs1000_p1_w); |
| 68 | 68 | DECLARE_WRITE8_MEMBER(soundcpu_to_qs1000); |
| 69 | ||
| 69 | ||
| 70 | 70 | DECLARE_DRIVER_INIT(eolith); |
| 71 | 71 | DECLARE_DRIVER_INIT(landbrk); |
| 72 | 72 | DECLARE_DRIVER_INIT(hidctch3); |
| 73 | 73 | DECLARE_DRIVER_INIT(hidctch2); |
| 74 | 74 | DECLARE_DRIVER_INIT(hidnc2k); |
| 75 | 75 | DECLARE_DRIVER_INIT(landbrka); |
| 76 | ||
| 76 | ||
| 77 | 77 | DECLARE_MACHINE_RESET(eolith); |
| 78 | 78 | DECLARE_VIDEO_START(eolith); |
| 79 | ||
| 79 | ||
| 80 | 80 | UINT32 screen_update_eolith(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 81 | ||
| 81 | ||
| 82 | 82 | TIMER_DEVICE_CALLBACK_MEMBER(eolith_speedup); |
| 83 | 83 | }; |
| r243192 | r243193 | |
|---|---|---|
| 34 | 34 | |
| 35 | 35 | exidy_state(const machine_config &mconfig, device_type type, const char *tag) |
| 36 | 36 | : driver_device(mconfig, type, tag), |
| 37 | m_maincpu(*this, "maincpu"), | |
| 38 | m_dac(*this, "dac"), | |
| 39 | m_samples(*this, "samples"), | |
| 40 | m_gfxdecode(*this, "gfxdecode"), | |
| 41 | m_screen(*this, "screen"), | |
| 42 | m_palette(*this, "palette"), | |
| 43 | 37 | m_videoram(*this, "videoram"), |
| 44 | 38 | m_sprite1_xpos(*this, "sprite1_xpos"), |
| 45 | 39 | m_sprite1_ypos(*this, "sprite1_ypos"), |
| r243192 | r243193 | |
| 48 | 42 | m_spriteno(*this, "spriteno"), |
| 49 | 43 | m_sprite_enable(*this, "sprite_enable"), |
| 50 | 44 | m_color_latch(*this, "color_latch"), |
| 51 | m_characterram(*this, "characterram") { } | |
| 45 | m_characterram(*this, "characterram"), | |
| 46 | m_maincpu(*this, "maincpu"), | |
| 47 | m_dac(*this, "dac"), | |
| 48 | m_samples(*this, "samples"), | |
| 49 | m_gfxdecode(*this, "gfxdecode"), | |
| 50 | m_screen(*this, "screen"), | |
| 51 | m_palette(*this, "palette") { } | |
| 52 | 52 | |
| 53 | 53 | |
| 54 | required_device<cpu_device> m_maincpu; | |
| 55 | optional_device<dac_device> m_dac; | |
| 56 | optional_device<samples_device> m_samples; | |
| 57 | required_device<gfxdecode_device> m_gfxdecode; | |
| 58 | required_device<screen_device> m_screen; | |
| 59 | required_device<palette_device> m_palette; | |
| 60 | ||
| 61 | 54 | required_shared_ptr<UINT8> m_videoram; |
| 62 | 55 | required_shared_ptr<UINT8> m_sprite1_xpos; |
| 63 | 56 | required_shared_ptr<UINT8> m_sprite1_ypos; |
| r243192 | r243193 | |
| 68 | 61 | required_shared_ptr<UINT8> m_color_latch; |
| 69 | 62 | required_shared_ptr<UINT8> m_characterram; |
| 70 | 63 | |
| 64 | required_device<cpu_device> m_maincpu; | |
| 65 | optional_device<dac_device> m_dac; | |
| 66 | optional_device<samples_device> m_samples; | |
| 67 | required_device<gfxdecode_device> m_gfxdecode; | |
| 68 | required_device<screen_device> m_screen; | |
| 69 | required_device<palette_device> m_palette; | |
| 70 | ||
| 71 | 71 | UINT8 m_last_dial; |
| 72 | 72 | UINT8 m_collision_mask; |
| 73 | 73 | UINT8 m_collision_invert; |
| r243192 | r243193 | |
| 77 | 77 | bitmap_ind16 m_motion_object_1_vid; |
| 78 | 78 | bitmap_ind16 m_motion_object_2_vid; |
| 79 | 79 | bitmap_ind16 m_motion_object_2_clip; |
| 80 | ||
| 81 | 80 | DECLARE_WRITE8_MEMBER(fax_bank_select_w); |
| 82 | 81 | DECLARE_READ8_MEMBER(exidy_interrupt_r); |
| 83 | ||
| 84 | 82 | DECLARE_CUSTOM_INPUT_MEMBER(teetert_input_r); |
| 85 | ||
| 86 | 83 | DECLARE_DRIVER_INIT(fax); |
| 87 | 84 | DECLARE_DRIVER_INIT(sidetrac); |
| 88 | 85 | DECLARE_DRIVER_INIT(pepper2); |
| r243192 | r243193 | |
| 93 | 90 | DECLARE_DRIVER_INIT(venture); |
| 94 | 91 | DECLARE_DRIVER_INIT(spectar); |
| 95 | 92 | DECLARE_DRIVER_INIT(phantoma); |
| 96 | ||
| 97 | 93 | virtual void video_start(); |
| 98 | 94 | DECLARE_MACHINE_START(teetert); |
| 99 | ||
| 100 | 95 | UINT32 screen_update_exidy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 101 | ||
| 102 | 96 | INTERRUPT_GEN_MEMBER(exidy_vblank_interrupt); |
| 103 | ||
| 104 | 97 | void exidy_video_config(UINT8 _collision_mask, UINT8 _collision_invert, int _is_2bpp); |
| 105 | 98 | inline void latch_condition(int collision); |
| 106 | 99 | inline void set_1_color(int index, int which); |
| r243192 | r243193 | |
|---|---|---|
| 61 | 61 | inline void get_tile_info(tile_data &tileinfo, tilemap_memory_index tile_index, int _N_); |
| 62 | 62 | inline void fuuki16_vram_w(offs_t offset, UINT16 data, UINT16 mem_mask, int _N_); |
| 63 | 63 | void fuuki16_draw_layer( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int i, int flag, int pri ); |
| 64 | DECLARE_WRITE_LINE_MEMBER(soundirq); | |
| 64 | 65 | required_device<okim6295_device> m_oki; |
| 65 | 66 | required_device<gfxdecode_device> m_gfxdecode; |
| 66 | 67 | required_device<screen_device> m_screen; |
| r243192 | r243193 | |
|---|---|---|
| 26 | 26 | m_priority(*this, "priority"), |
| 27 | 27 | m_tilebank(*this, "tilebank"), |
| 28 | 28 | m_maincpu(*this, "maincpu"), |
| 29 | m_soundcpu(*this, "soundcpu"), | |
| 29 | 30 | m_gfxdecode(*this, "gfxdecode"), |
| 30 | 31 | m_screen(*this, "screen"), |
| 31 | 32 | m_palette(*this, "palette"), |
| r243192 | r243193 | |
| 50 | 51 | |
| 51 | 52 | /* devices */ |
| 52 | 53 | required_device<cpu_device> m_maincpu; |
| 54 | required_device<cpu_device> m_soundcpu; | |
| 53 | 55 | required_device<gfxdecode_device> m_gfxdecode; |
| 54 | 56 | required_device<screen_device> m_screen; |
| 55 | 57 | required_device<palette_device> m_palette; |
| r243192 | r243193 | |
| 83 | 85 | inline void fuuki32_vram_w(offs_t offset, UINT32 data, UINT32 mem_mask, int _N_); |
| 84 | 86 | void draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ); |
| 85 | 87 | void fuuki32_draw_layer( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int i, int flag, int pri ); |
| 88 | DECLARE_WRITE_LINE_MEMBER(irqhandler); | |
| 86 | 89 | |
| 87 | 90 | protected: |
| 88 | 91 | virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); |
| r243192 | r243193 | |
|---|---|---|
| 39 | 39 | DECLARE_PALETTE_INIT(galspnbl); |
| 40 | 40 | UINT32 screen_update_galspnbl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 41 | 41 | void draw_background( bitmap_ind16 &bitmap, const rectangle &cliprect ); |
| 42 | DECLARE_WRITE_LINE_MEMBER(irqhandler); | |
| 42 | 43 | required_device<cpu_device> m_maincpu; |
| 43 | 44 | required_device<gfxdecode_device> m_gfxdecode; |
| 44 | 45 | required_device<palette_device> m_palette; |
| r243192 | r243193 | |
|---|---|---|
| 65 | 65 | DECLARE_PALETTE_INIT(hcastle); |
| 66 | 66 | UINT32 screen_update_hcastle(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 67 | 67 | void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, UINT8 *sbank, int bank ); |
| 68 | DECLARE_WRITE_LINE_MEMBER(irqhandler); | |
| 68 | 69 | DECLARE_WRITE8_MEMBER(volume_callback); |
| 69 | 70 | required_device<cpu_device> m_maincpu; |
| 70 | 71 | required_device<gfxdecode_device> m_gfxdecode; |
| r243192 | r243193 | |
|---|---|---|
| 32 | 32 | int m_highcolorflag; |
| 33 | 33 | int m_flipscreen; |
| 34 | 34 | bitmap_rgb32 m_tmpbitmap; |
| 35 | ||
| 35 | ||
| 36 | 36 | DECLARE_WRITE8_MEMBER(hyhoo_blitter_w); |
| 37 | 37 | DECLARE_WRITE8_MEMBER(hyhoo_romsel_w); |
| 38 | ||
| 38 | ||
| 39 | 39 | DECLARE_CUSTOM_INPUT_MEMBER(nb1413m3_busyflag_r); |
| 40 | ||
| 40 | ||
| 41 | 41 | virtual void video_start(); |
| 42 | ||
| 42 | ||
| 43 | 43 | UINT32 screen_update_hyhoo(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
| 44 | 44 | void hyhoo_gfxdraw(); |
| 45 | 45 |
| r243192 | r243193 | |
|---|---|---|
| 122 | 122 | inline void consume_rle(int count); |
| 123 | 123 | void perform_blit(address_space &space); |
| 124 | 124 | void itech8_update_interrupts(int periodic, int tms34061, int blitter); |
| 125 | DECLARE_WRITE_LINE_MEMBER(generate_sound_irq); | |
| 125 | 126 | |
| 126 | 127 | /*----------- defined in machine/slikshot.c -----------*/ |
| 127 | 128 |
| r243192 | r243193 | |
|---|---|---|
| 83 | 83 | void lorddgun_calc_gun_scr(int i); |
| 84 | 84 | void lordgun_update_gun(int i); |
| 85 | 85 | void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 86 | DECLARE_WRITE_LINE_MEMBER(soundirq); | |
| 86 | 87 | required_device<cpu_device> m_maincpu; |
| 87 | 88 | required_device<cpu_device> m_soundcpu; |
| 88 | 89 | required_device<okim6295_device> m_oki; |
| r243192 | r243193 | |
|---|---|---|
| 3 | 3 | public: |
| 4 | 4 | m58_state(const machine_config &mconfig, device_type type, const char *tag) |
| 5 | 5 | : driver_device(mconfig, type, tag), |
| 6 | m_videoram(*this, "videoram"), | |
| 7 | m_spriteram(*this, "spriteram"), | |
| 8 | m_yard_scroll_x_low(*this, "scroll_x_low"), | |
| 9 | m_yard_scroll_x_high(*this, "scroll_x_high"), | |
| 10 | m_yard_scroll_y_low(*this, "scroll_y_low"), | |
| 11 | m_yard_score_panel_disabled(*this, "score_disable"), | |
| 6 | 12 | m_maincpu(*this, "maincpu"), |
| 7 | 13 | m_gfxdecode(*this, "gfxdecode"), |
| 8 | 14 | m_screen(*this, "screen"), |
| 9 | m_palette(*this, "palette"), | |
| 10 | m_videoram(*this, "videoram"), | |
| 11 | m_spriteram(*this, "spriteram"), | |
| 12 | m_scroll_x_low(*this, "scroll_x_low"), | |
| 13 | m_scroll_x_high(*this, "scroll_x_high"), | |
| 14 | m_scroll_y_low(*this, "scroll_y_low"), | |
| 15 | m_score_panel_disabled(*this, "score_disable") { } | |
| 15 | m_palette(*this, "palette") { } | |
| 16 | 16 | |
| 17 | /* devices */ | |
| 18 | required_device<cpu_device> m_maincpu; | |
| 19 | required_device<gfxdecode_device> m_gfxdecode; | |
| 20 | required_device<screen_device> m_screen; | |
| 21 | required_device<palette_device> m_palette; | |
| 22 | ||
| 23 | 17 | /* memory pointers */ |
| 24 | 18 | required_shared_ptr<UINT8> m_videoram; |
| 25 | 19 | required_shared_ptr<UINT8> m_spriteram; |
| 26 | required_shared_ptr<UINT8> m_scroll_x_low; | |
| 27 | required_shared_ptr<UINT8> m_scroll_x_high; | |
| 28 | required_shared_ptr<UINT8> m_scroll_y_low; | |
| 29 | required_shared_ptr<UINT8> m_score_panel_disabled; | |
| 30 | 20 | |
| 31 | 21 | /* video-related */ |
| 32 | 22 | tilemap_t* m_bg_tilemap; |
| 33 | bitmap_ind16 m_scroll_panel_bitmap; | |
| 34 | 23 | |
| 35 | DECLARE_WRITE8_MEMBER(videoram_w); | |
| 36 | DECLARE_WRITE8_MEMBER(scroll_panel_w); | |
| 37 | DECLARE_WRITE8_MEMBER(flipscreen_w); | |
| 38 | ||
| 24 | required_shared_ptr<UINT8> m_yard_scroll_x_low; | |
| 25 | required_shared_ptr<UINT8> m_yard_scroll_x_high; | |
| 26 | required_shared_ptr<UINT8> m_yard_scroll_y_low; | |
| 27 | required_shared_ptr<UINT8> m_yard_score_panel_disabled; | |
| 28 | bitmap_ind16 *m_scroll_panel_bitmap; | |
| 29 | DECLARE_WRITE8_MEMBER(yard_videoram_w); | |
| 30 | DECLARE_WRITE8_MEMBER(yard_scroll_panel_w); | |
| 31 | DECLARE_WRITE8_MEMBER(yard_flipscreen_w); | |
| 39 | 32 | DECLARE_DRIVER_INIT(yard85); |
| 33 | TILE_GET_INFO_MEMBER(yard_get_bg_tile_info); | |
| 34 | TILEMAP_MAPPER_MEMBER(yard_tilemap_scan_rows); | |
| 40 | 35 | virtual void video_start(); |
| 41 | 36 | DECLARE_PALETTE_INIT(m58); |
| 42 | ||
| 43 | TILE_GET_INFO_MEMBER(get_bg_tile_info); | |
| 44 | TILEMAP_MAPPER_MEMBER(tilemap_scan_rows); | |
| 45 | ||
| 46 | UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); | |
| 37 | UINT32 screen_update_yard(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); | |
| 47 | 38 | void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect ); |
| 48 | 39 | void draw_panel( bitmap_ind16 &bitmap, const rectangle &cliprect ); |
| 40 | required_device<cpu_device> m_maincpu; | |
| 41 | required_device<gfxdecode_device> m_gfxdecode; | |
| 42 | required_device<screen_device> m_screen; | |
| 43 | required_device<palette_device> m_palette; | |
| 49 | 44 | }; |
| r243192 | r243193 | |
|---|---|---|
| 54 | 54 | m_discrete(*this, "discrete"), |
| 55 | 55 | #else |
| 56 | 56 | m_audio_snd0(*this, "snd_nl:snd0"), |
| 57 | m_audio_snd7(*this, "snd_nl:snd7"), | |
| 58 | m_audio_dac(*this, "snd_nl:dac"), | |
| 57 | m_audio_snd7(*this, "snd_nl:snd7"), | |
| 58 | m_audio_dac(*this, "snd_nl:dac"), | |
| 59 | 59 | #endif |
| 60 | 60 | m_spriteram(*this, "spriteram"), |
| 61 | 61 | m_videoram(*this, "videoram"), |
| r243192 | r243193 | |
| 71 | 71 | optional_device<discrete_device> m_discrete; |
| 72 | 72 | #else |
| 73 | 73 | optional_device<netlist_mame_logic_input_t> m_audio_snd0; |
| 74 | optional_device<netlist_mame_logic_input_t> m_audio_snd7; | |
| 75 | optional_device<netlist_mame_logic_input_t> m_audio_dac; | |
| 74 | optional_device<netlist_mame_logic_input_t> m_audio_snd7; | |
| 75 | optional_device<netlist_mame_logic_input_t> m_audio_dac; | |
| 76 | 76 | #endif |
| 77 | 77 | |
| 78 | 78 | /* memory pointers */ |
| r243192 | r243193 | |
|---|---|---|
| 203 | 203 | void metro_common( ); |
| 204 | 204 | void draw_tilemap( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, UINT32 flags, UINT32 pcode, |
| 205 | 205 | int sx, int sy, int wx, int wy, int big, UINT16 *tilemapram, int layer ); |
| 206 | DECLARE_WRITE_LINE_MEMBER(blzntrnd_irqhandler); | |
| 207 | DECLARE_WRITE_LINE_MEMBER(ymf278b_interrupt); | |
| 206 | 208 | DECLARE_READ_LINE_MEMBER(metro_rxd_r); |
| 207 | 209 | |
| 208 | 210 | protected: |
| r243192 | r243193 | |
|---|---|---|
| 24 | 24 | m_adpcm_sound(*this, "adpcm") , |
| 25 | 25 | m_generic_paletteram_16(*this, "paletteram"), |
| 26 | 26 | m_nvram(*this, "nvram"), |
| 27 | m_gfxrom(*this, "gfxrom") { } | |
| 27 | m_gfxrom(*this, "gfxrom"), | |
| 28 | m_ports(*this, tunit_ports) { } | |
| 28 | 29 | |
| 29 | 30 | required_device<cpu_device> m_maincpu; |
| 30 | 31 | required_device<palette_device> m_palette; |
| r243192 | r243193 | |
| 37 | 38 | |
| 38 | 39 | required_memory_region m_gfxrom; |
| 39 | 40 | |
| 41 | required_ioport_array<4> m_ports; | |
| 42 | DECLARE_IOPORT_ARRAY(tunit_ports); | |
| 43 | ||
| 40 | 44 | DECLARE_WRITE16_MEMBER(midtunit_cmos_enable_w); |
| 41 | 45 | DECLARE_WRITE16_MEMBER(midtunit_cmos_w); |
| 42 | 46 | DECLARE_READ16_MEMBER(midtunit_cmos_r); |
| r243192 | r243193 | |
|---|---|---|
| 4 | 4 | #include "machine/eepromser.h" |
| 5 | 5 | #include "cpu/i960/i960.h" |
| 6 | 6 | #include "sound/scsp.h" |
| 7 | #include "machine/315-5881_crypt.h" | |
| 8 | #include "machine/315-5838_317-0229_comp.h" | |
| 9 | 7 | |
| 10 | 8 | struct raster_state; |
| 11 | 9 | struct geo_state; |
| r243192 | r243193 | |
| 36 | 34 | m_eeprom(*this, "eeprom"), |
| 37 | 35 | m_screen(*this, "screen"), |
| 38 | 36 | m_palette(*this, "palette"), |
| 39 | m_scsp(*this, "scsp"), | |
| 40 | m_cryptdevice(*this, "315_5881"), | |
| 41 | m_0229crypt(*this, "317_0229") | |
| 37 | m_scsp(*this, "scsp") { } | |
| 42 | 38 | |
| 43 | { } | |
| 44 | ||
| 45 | 39 | required_shared_ptr<UINT32> m_workram; |
| 46 | 40 | required_shared_ptr<UINT32> m_bufferram; |
| 47 | 41 | UINT16 *m_palram; |
| r243192 | r243193 | |
| 65 | 59 | required_device<screen_device> m_screen; |
| 66 | 60 | required_device<palette_device> m_palette; |
| 67 | 61 | optional_device<scsp_device> m_scsp; |
| 68 | optional_device<sega_315_5881_crypt_device> m_cryptdevice; | |
| 69 | optional_device<sega_315_5838_comp_device> m_0229crypt; | |
| 70 | 62 | |
| 71 | 63 | UINT32 m_intreq; |
| 72 | 64 | UINT32 m_intena; |
| r243192 | r243193 | |
| 96 | 88 | int m_geo_iop_write_num; |
| 97 | 89 | UINT32 m_geo_iop_data; |
| 98 | 90 | int m_to_68k; |
| 99 | ||
| 91 | int m_protstate; | |
| 92 | int m_protpos; | |
| 93 | UINT8 m_protram[256]; | |
| 94 | int m_prot_a; | |
| 100 | 95 | int m_maxxstate; |
| 101 | 96 | UINT32 m_netram[0x8000/4]; |
| 102 | 97 | int m_zflagi; |
| r243192 | r243193 | |
| 159 | 154 | DECLARE_READ32_MEMBER(model2_serial_r); |
| 160 | 155 | DECLARE_WRITE32_MEMBER(model2o_serial_w); |
| 161 | 156 | DECLARE_WRITE32_MEMBER(model2_serial_w); |
| 162 | DECLARE_READ32_MEMBER(model2_5881prot_r); | |
| 163 | DECLARE_WRITE32_MEMBER(model2_5881prot_w); | |
| 164 | int first_read; | |
| 165 | ||
| 157 | DECLARE_READ32_MEMBER(model2_prot_r); | |
| 158 | DECLARE_WRITE32_MEMBER(model2_prot_w); | |
| 166 | 159 | DECLARE_READ32_MEMBER(maxx_r); |
| 167 | 160 | DECLARE_READ32_MEMBER(network_r); |
| 168 | 161 | DECLARE_WRITE32_MEMBER(network_w); |
| r243192 | r243193 | |
| 225 | 218 | DECLARE_READ8_MEMBER(virtuacop_lightgun_r); |
| 226 | 219 | DECLARE_READ8_MEMBER(virtuacop_lightgun_offscreen_r); |
| 227 | 220 | |
| 228 | UINT16 crypt_read_callback(UINT32 addr); | |
| 229 | ||
| 230 | 221 | bool copro_fifoin_pop(device_t *device, UINT32 *result,UINT32 offset, UINT32 mem_mask); |
| 231 | 222 | void copro_fifoin_push(device_t *device, UINT32 data, UINT32 offset, UINT32 mem_mask); |
| 232 | 223 | UINT32 copro_fifoout_pop(address_space &space, UINT32 offset, UINT32 mem_mask); |
| r243192 | r243193 | |
|---|---|---|
| 4 | 4 | #include "audio/dsbz80.h" |
| 5 | 5 | #include "machine/eepromser.h" |
| 6 | 6 | #include "sound/scsp.h" |
| 7 | #include "machine/315-5881_crypt.h" | |
| 8 | 7 | |
| 9 | 8 | typedef float MATRIX[4][4]; |
| 10 | 9 | typedef float VECTOR[4]; |
| r243192 | r243193 | |
| 78 | 77 | m_dsbz80(*this, DSBZ80_TAG), |
| 79 | 78 | m_soundram(*this, "soundram"), |
| 80 | 79 | m_gfxdecode(*this, "gfxdecode"), |
| 81 | m_palette(*this, "palette"), | |
| 82 | m_cryptdevice(*this, "315_5881") | |
| 80 | m_palette(*this, "palette") | |
| 83 | 81 | { |
| 84 | 82 | m_step15_with_mpc106 = false; |
| 85 | 83 | m_step20_with_old_real3d = false; |
| r243192 | r243193 | |
| 99 | 97 | |
| 100 | 98 | required_device<gfxdecode_device> m_gfxdecode; |
| 101 | 99 | required_device<palette_device> m_palette; |
| 102 | optional_device<sega_315_5881_crypt_device> m_cryptdevice; | |
| 103 | 100 | |
| 104 | 101 | tilemap_t *m_layer4[4]; |
| 105 | 102 | tilemap_t *m_layer8[4]; |
| r243192 | r243193 | |
| 230 | 227 | DECLARE_WRITE8_MEMBER(model3_sound_w); |
| 231 | 228 | DECLARE_READ64_MEMBER(network_r); |
| 232 | 229 | DECLARE_WRITE64_MEMBER(network_w); |
| 233 | ||
| 230 | DECLARE_READ64_MEMBER(model3_security_r); | |
| 234 | 231 | DECLARE_WRITE64_MEMBER(daytona2_rombank_w); |
| 235 | 232 | DECLARE_WRITE16_MEMBER(model3snd_ctrl); |
| 236 | 233 | UINT32 pci_device_get_reg(); |
| 237 | 234 | void pci_device_set_reg(UINT32 value); |
| 238 | DECLARE_DRIVER_INIT(genprot); | |
| 239 | 235 | DECLARE_DRIVER_INIT(lemans24); |
| 240 | 236 | DECLARE_DRIVER_INIT(vs298); |
| 241 | 237 | DECLARE_DRIVER_INIT(vs299); |
| r243192 | r243193 | |
| 243 | 239 | DECLARE_DRIVER_INIT(scudplus); |
| 244 | 240 | DECLARE_DRIVER_INIT(model3_20); |
| 245 | 241 | DECLARE_DRIVER_INIT(bass); |
| 242 | DECLARE_DRIVER_INIT(vs2v991); | |
| 246 | 243 | DECLARE_DRIVER_INIT(vs2); |
| 247 | 244 | DECLARE_DRIVER_INIT(daytona2); |
| 248 | 245 | DECLARE_DRIVER_INIT(eca); |
| r243192 | r243193 | |
| 259 | 256 | DECLARE_DRIVER_INIT(getbass); |
| 260 | 257 | DECLARE_DRIVER_INIT(scudplusa); |
| 261 | 258 | DECLARE_DRIVER_INIT(dirtdvls); |
| 259 | DECLARE_DRIVER_INIT(vs299b); | |
| 262 | 260 | DECLARE_DRIVER_INIT(vf3); |
| 263 | 261 | DECLARE_DRIVER_INIT(von2); |
| 262 | DECLARE_DRIVER_INIT(vs299a); | |
| 264 | 263 | DECLARE_DRIVER_INIT(lostwsga); |
| 265 | 264 | DECLARE_DRIVER_INIT(oceanhun); |
| 266 | 265 | DECLARE_DRIVER_INIT(dayto2pe); |
| r243192 | r243193 | |
| 334 | 333 | void tap_write(int tck, int tms, int tdi, int trst); |
| 335 | 334 | void tap_reset(); |
| 336 | 335 | void tap_set_asic_ids(); |
| 337 | ||
| 338 | DECLARE_READ64_MEMBER(model3_5881prot_r); | |
| 339 | DECLARE_WRITE64_MEMBER(model3_5881prot_w); | |
| 340 | int first_read; | |
| 341 | UINT16 crypt_read_callback(UINT32 addr); | |
| 342 | ||
| 343 | 336 | }; |
| r243192 | r243193 | |
|---|---|---|
| 49 | 49 | m_dspram16(*this,"dspram16"), |
| 50 | 50 | m_mpDualPortRAM(*this,"mpdualportram"), |
| 51 | 51 | m_master_dsp_code(*this,"master_dsp_code"), |
| 52 | m_ptrom24(*this,"point24"), | |
| 53 | m_ptrom16(*this,"point16"), | |
| 54 | 52 | m_dsp(*this, "dsp") { } |
| 55 | 53 | |
| 56 | 54 | optional_shared_ptr<UINT16> m_winrun_dspbios; |
| r243192 | r243193 | |
| 60 | 58 | required_shared_ptr<UINT8> m_mpDualPortRAM; |
| 61 | 59 | optional_shared_ptr<UINT16> m_master_dsp_code; |
| 62 | 60 | |
| 63 | optional_region_ptr<INT32> m_ptrom24; | |
| 64 | optional_region_ptr<UINT16> m_ptrom16; | |
| 65 | ||
| 66 | 61 | optional_device<cpu_device> m_dsp; |
| 67 | 62 | |
| 68 | 63 | UINT8 *m_videoram; |
| r243192 | r243193 | |
|---|---|---|
| 62 | 62 | DECLARE_READ64_MEMBER( aw_modem_r ); |
| 63 | 63 | DECLARE_WRITE64_MEMBER( aw_modem_w ); |
| 64 | 64 | |
| 65 | UINT8 m_mp_mux; | |
| 66 | DECLARE_CUSTOM_INPUT_MEMBER(naomi_mp_r); | |
| 67 | DECLARE_INPUT_CHANGED_MEMBER(naomi_mp_w); | |
| 68 | ||
| 69 | 65 | inline int decode_reg32_64(UINT32 offset, UINT64 mem_mask, UINT64 *shift); |
| 70 | 66 | |
| 67 | int jvsboard_type; | |
| 71 | 68 | UINT16 actel_id; |
| 72 | 69 | |
| 73 | 70 | UINT8 aw_ctrl_type; |
| r243192 | r243193 | |
|---|---|---|
| 129 | 129 | |
| 130 | 130 | // (static) configuration helpers |
| 131 | 131 | static void set_type(device_t &device, int type) { downcast<nb1413m3_device &>(device).m_nb1413m3_type = type; } |
| 132 | ||
| 132 | ||
| 133 | 133 | enum |
| 134 | 134 | { |
| 135 | 135 | TIMER_CB |
| r243192 | r243193 | |
| 169 | 169 | virtual void device_start(); |
| 170 | 170 | virtual void device_reset(); |
| 171 | 171 | virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); |
| 172 | ||
| 172 | ||
| 173 | 173 | private: |
| 174 | 174 | |
| 175 | 175 | int m_74ls193_counter; |
| r243192 | r243193 | |
|---|---|---|
| 121 | 121 | void create_palette_lookups(); |
| 122 | 122 | void nemesis_postload(); |
| 123 | 123 | void draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ); |
| 124 | DECLARE_WRITE_LINE_MEMBER(sound_irq); | |
| 124 | 125 | DECLARE_WRITE8_MEMBER(volume_callback); |
| 125 | 126 | }; |
| r243192 | r243193 | |
|---|---|---|
| 11 | 11 | m_fg_videoram(*this, "fg_videoram"), |
| 12 | 12 | m_scroll(*this, "scroll"), |
| 13 | 13 | m_maincpu(*this, "maincpu"), |
| 14 | m_audiocpu(*this, "audiocpu"), | |
| 14 | 15 | m_oki(*this, "oki"), |
| 15 | 16 | m_gfxdecode(*this, "gfxdecode"), |
| 16 | 17 | m_palette(*this, "palette") { } |
| r243192 | r243193 | |
| 38 | 39 | |
| 39 | 40 | /* devices */ |
| 40 | 41 | required_device<cpu_device> m_maincpu; |
| 42 | required_device<cpu_device> m_audiocpu; | |
| 41 | 43 | DECLARE_READ16_MEMBER(oneshot_in0_word_r); |
| 42 | 44 | DECLARE_READ16_MEMBER(oneshot_gun_x_p1_r); |
| 43 | 45 | DECLARE_READ16_MEMBER(oneshot_gun_y_p1_r); |
| r243192 | r243193 | |
| 57 | 59 | UINT32 screen_update_maddonna(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 58 | 60 | void draw_crosshairs( bitmap_ind16 &bitmap, const rectangle &cliprect ); |
| 59 | 61 | void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); |
| 62 | DECLARE_WRITE_LINE_MEMBER(irqhandler); | |
| 60 | 63 | required_device<okim6295_device> m_oki; |
| 61 | 64 | required_device<gfxdecode_device> m_gfxdecode; |
| 62 | 65 | required_device<palette_device> m_palette; |
| r243192 | r243193 | |
|---|---|---|
| 125 | 125 | DECLARE_DRIVER_INIT(8bpm); |
| 126 | 126 | DECLARE_DRIVER_INIT(porky); |
| 127 | 127 | DECLARE_DRIVER_INIT(mspacman); |
| 128 | DECLARE_DRIVER_INIT(mschamp); | |
| 129 | 128 | TILEMAP_MAPPER_MEMBER(pacman_scan_rows); |
| 130 | 129 | TILE_GET_INFO_MEMBER(pacman_get_tile_info); |
| 131 | 130 | TILE_GET_INFO_MEMBER(s2650_get_tile_info); |
| r243192 | r243193 | |
|---|---|---|
| 5 | 5 | public: |
| 6 | 6 | paradise_state(const machine_config &mconfig, device_type type, const char *tag) |
| 7 | 7 | : driver_device(mconfig, type, tag), |
| 8 | m_maincpu(*this, "maincpu"), | |
| 9 | m_oki2(*this, "oki2"), | |
| 10 | m_gfxdecode(*this, "gfxdecode"), | |
| 11 | m_screen(*this, "screen"), | |
| 12 | m_palette(*this, "palette"), | |
| 13 | 8 | m_vram_0(*this, "vram_0"), |
| 14 | 9 | m_vram_1(*this, "vram_1"), |
| 15 | 10 | m_vram_2(*this, "vram_2"), |
| 16 | 11 | m_videoram(*this, "videoram"), |
| 17 | 12 | m_paletteram(*this, "paletteram"), |
| 18 | m_spriteram(*this, "spriteram") { } | |
| 13 | m_spriteram(*this, "spriteram"), | |
| 14 | m_maincpu(*this, "maincpu"), | |
| 15 | m_oki2(*this, "oki2"), | |
| 16 | m_gfxdecode(*this, "gfxdecode"), | |
| 17 | m_screen(*this, "screen"), | |
| 18 | m_palette(*this, "palette") { } | |
| 19 | 19 | |
| 20 | /* devices */ | |
| 21 | required_device<cpu_device> m_maincpu; | |
| 22 | optional_device<okim6295_device> m_oki2; | |
| 23 | required_device<gfxdecode_device> m_gfxdecode; | |
| 24 | required_device<screen_device> m_screen; | |
| 25 | required_device<palette_device> m_palette; | |
| 26 | ||
| 27 | 20 | /* memory pointers */ |
| 28 | 21 | required_shared_ptr<UINT8> m_vram_0; |
| 29 | 22 | required_shared_ptr<UINT8> m_vram_1; |
| r243192 | r243193 | |
| 36 | 29 | tilemap_t *m_tilemap_0; |
| 37 | 30 | tilemap_t *m_tilemap_1; |
| 38 | 31 | tilemap_t *m_tilemap_2; |
| 39 | ||
| 40 | 32 | bitmap_ind16 m_tmpbitmap; |
| 41 | 33 | UINT8 m_palbank; |
| 42 | 34 | UINT8 m_priority; |
| 43 | 35 | UINT8 m_pixbank; |
| 44 | 36 | int m_sprite_inc; |
| 45 | int m_irq_count; | |
| 46 | 37 | |
| 38 | int irq_count; | |
| 47 | 39 | DECLARE_WRITE8_MEMBER(paradise_rombank_w); |
| 48 | 40 | DECLARE_WRITE8_MEMBER(torus_coin_counter_w); |
| 49 | 41 | DECLARE_WRITE8_MEMBER(paradise_flipscreen_w); |
| r243192 | r243193 | |
| 56 | 48 | DECLARE_WRITE8_MEMBER(paradise_pixmap_w); |
| 57 | 49 | DECLARE_WRITE8_MEMBER(paradise_priority_w); |
| 58 | 50 | DECLARE_WRITE8_MEMBER(paradise_okibank_w); |
| 59 | ||
| 60 | 51 | DECLARE_DRIVER_INIT(torus); |
| 61 | 52 | DECLARE_DRIVER_INIT(paradise); |
| 62 | 53 | DECLARE_DRIVER_INIT(tgtball); |
| 63 | ||
| 64 | 54 | TILE_GET_INFO_MEMBER(get_tile_info_0); |
| 65 | 55 | TILE_GET_INFO_MEMBER(get_tile_info_1); |
| 66 | 56 | TILE_GET_INFO_MEMBER(get_tile_info_2); |
| 67 | ||
| 68 | 57 | virtual void machine_start(); |
| 69 | 58 | virtual void machine_reset(); |
| 70 | 59 | virtual void video_start(); |
| 71 | ||
| 72 | 60 | UINT32 screen_update_paradise(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 73 | 61 | UINT32 screen_update_torus(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 74 | 62 | UINT32 screen_update_madball(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 75 | ||
| 76 | 63 | INTERRUPT_GEN_MEMBER(paradise_irq); |
| 77 | ||
| 78 | 64 | void update_pix_palbank(); |
| 79 | void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); | |
| 65 | void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); | |
| 66 | required_device<cpu_device> m_maincpu; | |
| 67 | optional_device<okim6295_device> m_oki2; | |
| 68 | required_device<gfxdecode_device> m_gfxdecode; | |
| 69 | required_device<screen_device> m_screen; | |
| 70 | required_device<palette_device> m_palette; | |
| 80 | 71 | }; |
| r243192 | r243193 | |
|---|---|---|
| 34 | 34 | int m_palbank; |
| 35 | 35 | UINT8 *m_videoram; |
| 36 | 36 | int m_flipscreen_old; |
| 37 | ||
| 37 | ||
| 38 | 38 | DECLARE_READ8_MEMBER(pastelg_sndrom_r); |
| 39 | 39 | DECLARE_READ8_MEMBER(pastelg_irq_ack_r); |
| 40 | 40 | DECLARE_READ8_MEMBER(threeds_inputport1_r); |
| r243192 | r243193 | |
| 45 | 45 | DECLARE_WRITE8_MEMBER(threeds_output_w); |
| 46 | 46 | DECLARE_READ8_MEMBER(threeds_rom_readback_r); |
| 47 | 47 | DECLARE_WRITE8_MEMBER(pastelg_romsel_w); |
| 48 | ||
| 48 | ||
| 49 | 49 | DECLARE_CUSTOM_INPUT_MEMBER(nb1413m3_busyflag_r); |
| 50 | 50 | DECLARE_CUSTOM_INPUT_MEMBER(nb1413m3_hackbusyflag_r); |
| 51 | ||
| 51 | ||
| 52 | 52 | virtual void machine_start(); |
| 53 | 53 | virtual void video_start(); |
| 54 | ||
| 54 | ||
| 55 | 55 | DECLARE_PALETTE_INIT(pastelg); |
| 56 | 56 | UINT32 screen_update_pastelg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 57 | 57 | int pastelg_blitter_src_addr_r(); |
| r243192 | r243193 | |
| 61 | 61 | protected: |
| 62 | 62 | virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); |
| 63 | 63 | }; |
| 64 |
| r243192 | r243193 | |
|---|---|---|
| 39 | 39 | virtual void video_start(); |
| 40 | 40 | UINT32 screen_update_prehisle(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 41 | 41 | void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 42 | DECLARE_WRITE_LINE_MEMBER(irqhandler); | |
| 42 | 43 | |
| 43 | 44 | required_device<cpu_device> m_maincpu; |
| 44 | 45 | required_device<cpu_device> m_audiocpu; |
| r243192 | r243193 | |
|---|---|---|
| 105 | 105 | void draw_sprites_bootleg( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int trans_pen ); |
| 106 | 106 | int tilemap_width( int size ); |
| 107 | 107 | void s1945_mcu_init( ); |
| 108 | DECLARE_WRITE_LINE_MEMBER(irqhandler); | |
| 109 | DECLARE_WRITE_LINE_MEMBER(sound_irq); | |
| 108 | 110 | required_device<cpu_device> m_maincpu; |
| 109 | 111 | optional_device<okim6295_device> m_oki; |
| 110 | 112 | required_device<gfxdecode_device> m_gfxdecode; |
| r243192 | r243193 | |
|---|---|---|
| 73 | 73 | UINT32 screen_update_psikyo4_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 74 | 74 | INTERRUPT_GEN_MEMBER(psikyosh_interrupt); |
| 75 | 75 | void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT32 scr); |
| 76 | DECLARE_WRITE_LINE_MEMBER(irqhandler); | |
| 76 | 77 | }; |
| r243192 | r243193 | |
|---|---|---|
| 84 | 84 | void psikyosh_drawgfxzoom( bitmap_rgb32 &dest_bmp,const rectangle &clip,gfx_element *gfx, |
| 85 | 85 | UINT32 code,UINT32 color,int flipx,int flipy,int offsx,int offsy, |
| 86 | 86 | int alpha, int zoomx, int zoomy, int wide, int high, UINT32 z); |
| 87 | DECLARE_WRITE_LINE_MEMBER(irqhandler); | |
| 87 | 88 | }; |
| r243192 | r243193 | |
|---|---|---|
| 36 | 36 | required_device<dac_device> m_dac; |
| 37 | 37 | required_device<gfxdecode_device> m_gfxdecode; |
| 38 | 38 | required_device<palette_device> m_palette; |
| 39 | ||
| 39 | ||
| 40 | 40 | /* memory pointers */ |
| 41 | 41 | required_shared_ptr<UINT8> m_spriteram; |
| 42 | 42 | required_shared_ptr<UINT8> m_fgscroll; |
| r243192 | r243193 | |
| 58 | 58 | // game specific initialization |
| 59 | 59 | int m_is_senjyo; |
| 60 | 60 | int m_scrollhack; |
| 61 | ||
| 61 | ||
| 62 | 62 | UINT8 m_sound_cmd; |
| 63 | 63 | int m_single_volume; |
| 64 | 64 | int m_sound_state; |
| r243192 | r243193 | |
| 67 | 67 | tilemap_t *m_bg1_tilemap; |
| 68 | 68 | tilemap_t *m_bg2_tilemap; |
| 69 | 69 | tilemap_t *m_bg3_tilemap; |
| 70 | ||
| 70 | ||
| 71 | 71 | DECLARE_WRITE8_MEMBER(flip_screen_w); |
| 72 | 72 | DECLARE_WRITE8_MEMBER(paletteram_w); |
| 73 | 73 | DECLARE_WRITE8_MEMBER(starforb_scrolly2); |
| r243192 | r243193 | |
| 82 | 82 | DECLARE_WRITE8_MEMBER(sound_cmd_w); |
| 83 | 83 | DECLARE_WRITE8_MEMBER(irq_ctrl_w); |
| 84 | 84 | DECLARE_READ8_MEMBER(pio_pa_r); |
| 85 | ||
| 85 | ||
| 86 | 86 | DECLARE_DRIVER_INIT(starfora); |
| 87 | 87 | DECLARE_DRIVER_INIT(senjyo); |
| 88 | 88 | DECLARE_DRIVER_INIT(starfore); |
| 89 | 89 | DECLARE_DRIVER_INIT(starforc); |
| 90 | ||
| 90 | ||
| 91 | 91 | TILE_GET_INFO_MEMBER(get_fg_tile_info); |
| 92 | 92 | TILE_GET_INFO_MEMBER(senjyo_bg1_tile_info); |
| 93 | 93 | TILE_GET_INFO_MEMBER(starforc_bg1_tile_info); |
| 94 | 94 | TILE_GET_INFO_MEMBER(get_bg2_tile_info); |
| 95 | 95 | TILE_GET_INFO_MEMBER(get_bg3_tile_info); |
| 96 | ||
| 96 | ||
| 97 | 97 | virtual void machine_start(); |
| 98 | 98 | virtual void machine_reset(); |
| 99 | 99 | virtual void video_start(); |
| r243192 | r243193 | |
|---|---|---|
| 54 | 54 | UINT32 screen_update_pow(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 55 | 55 | void common_video_start(); |
| 56 | 56 | void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int group); |
| 57 | DECLARE_WRITE_LINE_MEMBER(irqhandler); | |
| 57 | 58 | required_device<cpu_device> m_maincpu; |
| 58 | 59 | required_device<cpu_device> m_soundcpu; |
| 59 | 60 | required_device<upd7759_device> m_upd7759; |
| r243192 | r243193 | |
|---|---|---|
| 55 | 55 | DECLARE_DRIVER_INIT(4in1boot); |
| 56 | 56 | DECLARE_DRIVER_INIT(3in1semi); |
| 57 | 57 | DECLARE_DRIVER_INIT(cookbib2); |
| 58 | DECLARE_DRIVER_INIT(toto); | |
| 59 | DECLARE_READ16_MEMBER(toto_read); | |
| 60 | 58 | DECLARE_MACHINE_RESET(semiprot); |
| 61 | 59 | DECLARE_MACHINE_RESET(finalttr); |
| 62 | 60 | UINT32 screen_update_snowbros(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| r243192 | r243193 | |
| 69 | 67 | TIMER_DEVICE_CALLBACK_MEMBER(snowbros3_irq); |
| 70 | 68 | void sb3_play_music(int data); |
| 71 | 69 | void sb3_play_sound (okim6295_device *oki, int data); |
| 70 | DECLARE_WRITE_LINE_MEMBER(irqhandler); | |
| 72 | 71 | }; |
| r243192 | r243193 | |
|---|---|---|
| 72 | 72 | { |
| 73 | 73 | return 0xffff; |
| 74 | 74 | } |
| 75 | DECLARE_WRITE_LINE_MEMBER(irqhandler); | |
| 75 | 76 | required_device<cpu_device> m_maincpu; |
| 76 | 77 | required_device<cpu_device> m_audiocpu; |
| 77 | 78 | required_device<gfxdecode_device> m_gfxdecode; |
| r243192 | r243193 | |
|---|---|---|
| 64 | 64 | void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect ); |
| 65 | 65 | void mcu63705_update_inputs(); |
| 66 | 66 | DECLARE_CUSTOM_INPUT_MEMBER(mcu63705_busy_r); |
| 67 | DECLARE_WRITE_LINE_MEMBER(irqhandler); | |
| 67 | 68 | void spd_adpcm_int(msm5205_device *device, int chip); |
| 68 | 69 | DECLARE_WRITE_LINE_MEMBER(spd_adpcm_int_1); |
| 69 | 70 | DECLARE_WRITE_LINE_MEMBER(spd_adpcm_int_2); |
| r243192 | r243193 | |
|---|---|---|
| 59 | 59 | UINT32 screen_update_spy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 60 | 60 | INTERRUPT_GEN_MEMBER(spy_interrupt); |
| 61 | 61 | void spy_collision( ); |
| 62 | DECLARE_WRITE_LINE_MEMBER(irqhandler); | |
| 62 | 63 | DECLARE_WRITE8_MEMBER(volume_callback0); |
| 63 | 64 | DECLARE_WRITE8_MEMBER(volume_callback1); |
| 64 | 65 | K052109_CB_MEMBER(tile_callback); |
| r243192 | r243193 | |
|---|---|---|
| 12 | 12 | m_spritegen(*this, "spritegen"), |
| 13 | 13 | m_gfxdecode(*this, "gfxdecode"), |
| 14 | 14 | m_spriteram(*this, "spriteram"), |
| 15 | m_pf1_data(*this, "pf1_data") { } | |
| 15 | m_pf1_data(*this, "pf1_data"), | |
| 16 | m_inputs(*this, "INPUTS"), | |
| 17 | m_coin(*this, "COIN"), | |
| 18 | m_dsw(*this, "DSW") { } | |
| 16 | 19 | |
| 17 | 20 | required_device<cpu_device> m_maincpu; |
| 18 | 21 | required_device<cpu_device> m_audiocpu; |
| 19 | 22 | required_device<deco_bac06_device> m_tilegen1; |
| 20 | 23 | required_device<deco_mxc06_device> m_spritegen; |
| 21 | 24 | required_device<gfxdecode_device> m_gfxdecode; |
| 22 | ||
| 25 | ||
| 23 | 26 | required_shared_ptr<UINT16> m_spriteram; |
| 24 | 27 | required_shared_ptr<UINT16> m_pf1_data; |
| 28 | ||
| 29 | required_ioport m_inputs; | |
| 30 | required_ioport m_coin; | |
| 31 | required_ioport m_dsw; | |
| 25 | 32 | |
| 26 | 33 | tilemap_t *m_pf1_tilemap; |
| 27 | ||
| 34 | ||
| 35 | DECLARE_READ16_MEMBER(stadhero_control_r); | |
| 28 | 36 | DECLARE_WRITE16_MEMBER(stadhero_control_w); |
| 29 | 37 | DECLARE_WRITE16_MEMBER(stadhero_pf1_data_w); |
| 30 | ||
| 38 | DECLARE_WRITE_LINE_MEMBER(irqhandler); | |
| 39 | ||
| 31 | 40 | virtual void video_start(); |
| 32 | ||
| 41 | ||
| 33 | 42 | TILE_GET_INFO_MEMBER(get_pf1_tile_info); |
| 34 | 43 | UINT32 screen_update_stadhero(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 35 | 44 | }; |
| r243192 | r243193 | |
|---|---|---|
| 28 | 28 | required_device<msm5205_device> m_msm; |
| 29 | 29 | required_device<gfxdecode_device> m_gfxdecode; |
| 30 | 30 | required_device<palette_device> m_palette; |
| 31 | ||
| 31 | ||
| 32 | 32 | optional_shared_ptr<UINT8> m_text_char_ram; |
| 33 | 33 | optional_shared_ptr<UINT8> m_text_attr_ram; |
| 34 | 34 | optional_shared_ptr<UINT8> m_tx_vram; |
| r243192 | r243193 | |
|---|---|---|
| 36 | 36 | required_shared_ptr<UINT16> m_mhigh_scrollram; |
| 37 | 37 | required_shared_ptr<UINT16> m_vidattrram; |
| 38 | 38 | required_shared_ptr<UINT16> m_spriteram; |
| 39 | ||
| 39 | ||
| 40 | 40 | tilemap_t *m_bg_tilemap; |
| 41 | 41 | tilemap_t *m_mlow_tilemap; |
| 42 | 42 | tilemap_t *m_mhigh_tilemap; |
| 43 | 43 | tilemap_t *m_tx_tilemap; |
| 44 | 44 | |
| 45 | 45 | int m_sprxoffs; |
| 46 | ||
| 46 | ||
| 47 | 47 | DECLARE_WRITE16_MEMBER(stlforce_bg_videoram_w); |
| 48 | 48 | DECLARE_WRITE16_MEMBER(stlforce_mlow_videoram_w); |
| 49 | 49 | DECLARE_WRITE16_MEMBER(stlforce_mhigh_videoram_w); |
| 50 | 50 | DECLARE_WRITE16_MEMBER(stlforce_tx_videoram_w); |
| 51 | 51 | DECLARE_WRITE16_MEMBER(eeprom_w); |
| 52 | 52 | DECLARE_WRITE16_MEMBER(oki_bank_w); |
| 53 | ||
| 53 | ||
| 54 | 54 | DECLARE_DRIVER_INIT(twinbrat); |
| 55 | 55 | DECLARE_DRIVER_INIT(stlforce); |
| 56 | ||
| 56 | ||
| 57 | 57 | TILE_GET_INFO_MEMBER(get_stlforce_bg_tile_info); |
| 58 | 58 | TILE_GET_INFO_MEMBER(get_stlforce_mlow_tile_info); |
| 59 | 59 | TILE_GET_INFO_MEMBER(get_stlforce_mhigh_tile_info); |
| 60 | 60 | TILE_GET_INFO_MEMBER(get_stlforce_tx_tile_info); |
| 61 | ||
| 61 | ||
| 62 | 62 | virtual void video_start(); |
| 63 | 63 | UINT32 screen_update_stlforce(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 64 | 64 | void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect ); |
| r243192 | r243193 | |
|---|---|---|
| 15 | 15 | required_device<cpu_device> m_subcpu; |
| 16 | 16 | required_device<gfxdecode_device> m_gfxdecode; |
| 17 | 17 | required_device<palette_device> m_palette; |
| 18 | ||
| 18 | ||
| 19 | 19 | required_shared_ptr<UINT8> m_videoram; |
| 20 | 20 | required_shared_ptr<UINT8> m_xscroll; |
| 21 | 21 | required_shared_ptr<UINT8> m_spriteram; |
| r243192 | r243193 | |
| 23 | 23 | UINT8 m_scrl_ctrl; |
| 24 | 24 | tilemap_t *m_bg_tilemap; |
| 25 | 25 | UINT8 m_irq_source; |
| 26 | ||
| 26 | ||
| 27 | 27 | TIMER_DEVICE_CALLBACK_MEMBER(strnskil_irq); |
| 28 | 28 | |
| 29 | 29 | DECLARE_READ8_MEMBER(strnskil_d800_r); |
| r243192 | r243193 | |
| 32 | 32 | DECLARE_WRITE8_MEMBER(protection_w); |
| 33 | 33 | DECLARE_WRITE8_MEMBER(strnskil_videoram_w); |
| 34 | 34 | DECLARE_WRITE8_MEMBER(strnskil_scrl_ctrl_w); |
| 35 | ||
| 35 | ||
| 36 | 36 | DECLARE_DRIVER_INIT(banbam); |
| 37 | 37 | DECLARE_DRIVER_INIT(pettanp); |
| 38 | ||
| 38 | ||
| 39 | 39 | TILE_GET_INFO_MEMBER(get_bg_tile_info); |
| 40 | ||
| 41 | virtual void machine_start(); | |
| 40 | ||
| 41 | virtual void machine_start(); | |
| 42 | 42 | virtual void video_start(); |
| 43 | 43 | DECLARE_PALETTE_INIT(strnskil); |
| 44 | 44 | UINT32 screen_update_strnskil(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| r243192 | r243193 | |
|---|---|---|
| 10 | 10 | #include "bus/generic/carts.h" |
| 11 | 11 | |
| 12 | 12 | #include "machine/315-5881_crypt.h" |
| 13 | #include "machine/315-5838_317-0229_comp.h" | |
| 14 | 13 | |
| 15 | 14 | #define MAX_FILTERS (24) |
| 16 | 15 | #define MAX_BLOCKS (200) |
| r243192 | r243193 | |
| 702 | 701 | : saturn_state(mconfig, type, tag), |
| 703 | 702 | m_adsp(*this, "adsp"), |
| 704 | 703 | m_adsp_pram(*this, "adsp_pram"), |
| 705 | m_cryptdevice(*this, "315_5881"), | |
| 706 | m_5838crypt(*this, "315_5838") | |
| 704 | m_cryptdevice(*this, "315_5881") | |
| 707 | 705 | { |
| 708 | 706 | } |
| 709 | 707 | |
| r243192 | r243193 | |
| 800 | 798 | |
| 801 | 799 | // protection specific variables and functions (see machine/stvprot.c) |
| 802 | 800 | UINT32 m_abus_protenable; |
| 801 | UINT32 m_abus_prot_addr; | |
| 803 | 802 | UINT32 m_abus_protkey; |
| 804 | 803 | |
| 805 | 804 | UINT32 m_a_bus[4]; |
| 805 | UINT32 m_ctrl_index; | |
| 806 | UINT32 m_internal_counter; | |
| 807 | UINT8 m_char_offset; //helper to jump the decoding of the NULL chars. | |
| 806 | 808 | |
| 809 | UINT32 (*m_prot_readback)(address_space&,int,UINT32); | |
| 810 | ||
| 807 | 811 | DECLARE_READ32_MEMBER( common_prot_r ); |
| 808 | 812 | DECLARE_WRITE32_MEMBER( common_prot_w ); |
| 809 | 813 | |
| 810 | 814 | void install_common_protection(); |
| 815 | ||
| 816 | void install_twcup98_protection(); | |
| 817 | void install_sss_protection(); | |
| 818 | void install_astrass_protection(); | |
| 819 | void install_rsgun_protection(); | |
| 820 | void install_elandore_protection(); | |
| 821 | void install_ffreveng_protection(); | |
| 822 | ||
| 811 | 823 | void stv_register_protection_savestates(); |
| 812 | 824 | |
| 825 | // Decathlete specific variables and functions (see machine/decathlt.c) | |
| 826 | UINT32 m_decathlt_protregs[4]; | |
| 827 | UINT32 m_decathlt_lastcount; | |
| 828 | UINT32 m_decathlt_part; | |
| 829 | UINT32 m_decathlt_prot_uploadmode; | |
| 830 | UINT32 m_decathlt_prot_uploadoffset; | |
| 831 | UINT16 m_decathlt_prottable1[24]; | |
| 832 | UINT16 m_decathlt_prottable2[128]; | |
| 813 | 833 | |
| 834 | DECLARE_READ32_MEMBER( decathlt_prot_r ); | |
| 835 | DECLARE_WRITE32_MEMBER( decathlt_prot1_w ); | |
| 836 | DECLARE_WRITE32_MEMBER( decathlt_prot2_w ); | |
| 837 | void write_prot_data(UINT32 data, UINT32 mem_mask, int offset, int which); | |
| 838 | void install_decathlt_protection(); | |
| 814 | 839 | |
| 815 | 840 | optional_device<sega_315_5881_crypt_device> m_cryptdevice; |
| 816 | optional_device<sega_315_5838_comp_device> m_5838crypt; | |
| 817 | 841 | UINT16 crypt_read_callback(UINT32 addr); |
| 818 | UINT16 crypt_read_callback_ch1(UINT32 addr); | |
| 819 | UINT16 crypt_read_callback_ch2(UINT32 addr); | |
| 820 | 842 | }; |
| 821 | 843 | |
| 822 | 844 |
| r243192 | r243193 | |
|---|---|---|
| 157 | 157 | void draw_normal_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect, int which); |
| 158 | 158 | void draw_text_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect); |
| 159 | 159 | UINT8 *brickzn_decrypt(); |
| 160 | DECLARE_WRITE_LINE_MEMBER(soundirq); | |
| 160 | 161 | }; |
| r243192 | r243193 | |
|---|---|---|
| 64 | 64 | UINT32 screen_update_tbowl_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 65 | 65 | UINT32 screen_update_tbowl_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 66 | 66 | void tbowl_draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect, int xscroll, UINT8* spriteram); |
| 67 | DECLARE_WRITE_LINE_MEMBER(irqhandler); | |
| 67 | 68 | void tbowl_adpcm_int(msm5205_device *device, int chip); |
| 68 | 69 | DECLARE_WRITE_LINE_MEMBER(tbowl_adpcm_int_1); |
| 69 | 70 | DECLARE_WRITE_LINE_MEMBER(tbowl_adpcm_int_2); |
| r243192 | r243193 | |
|---|---|---|
| 60 | 60 | DECLARE_VIDEO_START(tecmo); |
| 61 | 61 | UINT32 screen_update_tecmo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 62 | 62 | void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap,const rectangle &cliprect); |
| 63 | DECLARE_WRITE_LINE_MEMBER(irqhandler); | |
| 63 | 64 | DECLARE_WRITE_LINE_MEMBER(tecmo_adpcm_int); |
| 64 | 65 | required_device<cpu_device> m_maincpu; |
| 65 | 66 | required_device<cpu_device> m_soundcpu; |
| r243192 | r243193 | |
|---|---|---|
| 150 | 150 | void toaplan1_driver_savestate(); |
| 151 | 151 | void demonwld_driver_savestate(); |
| 152 | 152 | void vimana_driver_savestate(); |
| 153 | DECLARE_WRITE_LINE_MEMBER(irqhandler); | |
| 153 | 154 | DECLARE_WRITE_LINE_MEMBER(toaplan1_reset_callback); |
| 154 | 155 | required_device<m68000_device> m_maincpu; |
| 155 | 156 | required_device<cpu_device> m_audiocpu; |
| r243192 | r243193 | |
|---|---|---|
| 153 | 153 | void truxton2_postload(); |
| 154 | 154 | void create_tx_tilemap(int dx = 0, int dx_flipped = 0); |
| 155 | 155 | void toaplan2_vblank_irq(int irq_line); |
| 156 | DECLARE_WRITE_LINE_MEMBER(irqhandler); | |
| 156 | 157 | DECLARE_WRITE_LINE_MEMBER(bbakraid_irqhandler); |
| 157 | 158 | |
| 158 | 159 | UINT8 m_pwrkick_hopper; |
| r243192 | r243193 | |
|---|---|---|
| 16 | 16 | m_spriteram8(*this, "spriteram8"), |
| 17 | 17 | m_spriteram16(*this, "spriteram16"), |
| 18 | 18 | m_maincpu(*this, "maincpu"), |
| 19 | m_audiocpu(*this, "audiocpu"), | |
| 19 | 20 | m_dsp(*this, "dsp"), |
| 20 | 21 | m_spritegen(*this, "scu"), |
| 21 | 22 | m_gfxdecode(*this, "gfxdecode"), |
| r243192 | r243193 | |
| 118 | 119 | void toaplan0_control_w(int offset, int data); |
| 119 | 120 | void toaplan0_coin_dsp_w(address_space &space, int offset, int data); |
| 120 | 121 | void twincobr_driver_savestate(); |
| 122 | DECLARE_WRITE_LINE_MEMBER(irqhandler); | |
| 121 | 123 | required_device<cpu_device> m_maincpu; |
| 124 | required_device<cpu_device> m_audiocpu; | |
| 122 | 125 | required_device<cpu_device> m_dsp; |
| 123 | 126 | required_device<toaplan_scu_device> m_spritegen; |
| 124 | 127 | required_device<gfxdecode_device> m_gfxdecode; |
| r243192 | r243193 | |
|---|---|---|
| 107 | 107 | m_objram(*this, "objram"), |
| 108 | 108 | m_rcram(*this, "rcram"), |
| 109 | 109 | m_z80_ram(*this, "z80_ram"), |
| 110 | m_char_tiles(*this, "char_tiles"), | |
| 111 | m_obj_tiles(*this, "obj_tiles"), | |
| 112 | m_road_rom(*this, "road"), | |
| 113 | m_obj_map(*this, "obj_map"), | |
| 114 | m_obj_luts(*this, "obj_luts"), | |
| 115 | m_proms(*this, "proms"), | |
| 116 | 110 | m_screen(*this, "screen") { } |
| 117 | 111 | |
| 118 | 112 | required_device<cpu_device> m_maincpu; |
| r243192 | r243193 | |
| 123 | 117 | required_shared_ptr<UINT16> m_objram; |
| 124 | 118 | required_shared_ptr<UINT16> m_rcram; |
| 125 | 119 | required_shared_ptr<UINT8> m_z80_ram; |
| 126 | ||
| 127 | required_region_ptr<UINT8> m_char_tiles; | |
| 128 | required_region_ptr<UINT8> m_obj_tiles; | |
| 129 | required_region_ptr<UINT8> m_road_rom; | |
| 130 | required_region_ptr<UINT8> m_obj_map; | |
| 131 | required_region_ptr<UINT8> m_obj_luts; | |
| 132 | required_region_ptr<UINT8> m_proms; | |
| 133 | ||
| 134 | 120 | required_device<screen_device> m_screen; |
| 135 | 121 | |
| 136 | 122 | emu_timer *m_interrupt_timer; |
| r243192 | r243193 | |
|---|---|---|
| 44 | 44 | DECLARE_WRITE16_MEMBER(vaportra_priority_w); |
| 45 | 45 | DECLARE_WRITE16_MEMBER(vaportra_palette_24bit_rg_w); |
| 46 | 46 | DECLARE_WRITE16_MEMBER(vaportra_palette_24bit_b_w); |
| 47 | ||
| 47 | ||
| 48 | 48 | DECLARE_DRIVER_INIT(vaportra); |
| 49 | 49 | virtual void machine_start(); |
| 50 | 50 | virtual void machine_reset(); |
| 51 | ||
| 51 | ||
| 52 | 52 | UINT32 screen_update_vaportra(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 53 | 53 | void update_24bitcol( int offset ); |
| 54 | ||
| 54 | ||
| 55 | 55 | DECO16IC_BANK_CB_MEMBER(bank_callback); |
| 56 | 56 | }; |
| r243192 | r243193 | |
|---|---|---|
| 9 | 9 | |
| 10 | 10 | required_device<cpu_device> m_maincpu; |
| 11 | 11 | required_device<gfxdecode_device> m_gfxdecode; |
| 12 | ||
| 12 | ||
| 13 | 13 | required_shared_ptr<UINT8> m_vidram; |
| 14 | ||
| 14 | ||
| 15 | 15 | tilemap_t *m_tilemap; |
| 16 | 16 | |
| 17 | 17 | int m_e0_data; |
| 18 | 18 | int m_credits; |
| 19 | 19 | int m_coins; |
| 20 | 20 | int m_prev_coin; |
| 21 | ||
| 21 | ||
| 22 | 22 | DECLARE_WRITE8_MEMBER(irqack_w); |
| 23 | 23 | DECLARE_READ8_MEMBER(io_r); |
| 24 | 24 | DECLARE_WRITE8_MEMBER(io_w); |
| 25 | 25 | DECLARE_WRITE8_MEMBER(vidram_w); |
| 26 | ||
| 26 | ||
| 27 | 27 | virtual void machine_start(); |
| 28 | 28 | virtual void video_start(); |
| 29 | 29 | TILE_GET_INFO_MEMBER(get_tile_info); |
| 30 | 30 | DECLARE_PALETTE_INIT(xyonix); |
| 31 | 31 | UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 32 | ||
| 32 | ||
| 33 | 33 | void handle_coins(int coin); |
| 34 | 34 | }; |
| r243192 | r243193 | |
|---|---|---|
| 34 | 34 | required_shared_ptr<UINT16> m_scrollram_0; |
| 35 | 35 | required_shared_ptr<UINT16> m_scrollram_1; |
| 36 | 36 | required_shared_ptr<UINT16> m_priorityram; |
| 37 | // UINT16 * m_paletteram; // currently this uses generic palette handling | |
| 37 | 38 | required_shared_ptr<UINT16> m_spriteram; |
| 38 | 39 | |
| 39 | 40 | /* other video-related elements */ |
| r243192 | r243193 | |
| 57 | 58 | virtual void video_start(); |
| 58 | 59 | UINT32 screen_update_yunsun16(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 59 | 60 | void draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ); |
| 61 | DECLARE_WRITE_LINE_MEMBER(soundirq); | |
| 60 | 62 | }; |
| r243192 | r243193 | |
|---|---|---|
| 151 | 151 | <bezel name="text2" element="P4"><bounds left="100" right="180" top="90" bottom="102" /></bezel> |
| 152 | 152 | <bezel name="text1" element="P5"><bounds left="100" right="180" top="150" bottom="162" /></bezel> |
| 153 | 153 | <bezel name="text0" element="P6"><bounds left="100" right="180" top="210" bottom="222" /></bezel> |
| 154 | ||
| 154 | ||
| 155 | 155 | <screen index="0"> |
| 156 | 156 | <bounds x="320" y="0" width="320" height="240" /> |
| 157 | 157 | </screen> |
| 158 | ||
| 158 | </view> | |
| 159 | 159 | </mamelayout> |
| r243192 | r243193 | |
|---|---|---|
| 1 | /* Sega Compression (and possibly encryption) device | |
| 2 | ||
| 3 | 315-5838 - Decathlete (ST-V) | |
| 4 | 317-0229 - Dead or Alive (Model 2A) | |
| 5 | ||
| 6 | Package Type: TQFP100 | |
| 7 | ||
| 8 | This appears to be a dual channel compression chip, used in 1996, predating the 5881. | |
| 9 | Decathlete uses it to compress ALL the game graphics, Dead or Alive uses it for a | |
| 10 | dumb security check, decompressing a single string. | |
| 11 | ||
| 12 | Each channel appears to be connected to a different set of ROMs, however there is | |
| 13 | defintiely only a single 315-5838 chip. (could the different channels actually just | |
| 14 | be mirror addresses, with part of the address determining the ROMs to use?) | |
| 15 | ||
| 16 | Dead of Alive only uses a single channel, and has the source data in RAM, not ROM. | |
| 17 | This is similar to how some 5881 games were set up, with the ST-V versions decrypting | |
| 18 | data directly from ROM and the Model 2 ones using a RAM source buffer. | |
| 19 | ||
| 20 | Looking at the values read I don't think there is any address based encryption, for | |
| 21 | example many blocks where you'd expect a zero fill start with repeating patterns | |
| 22 | of 8f708f70 (different lengths) channel would appear to relate to compressed 0x00 data | |
| 23 | ||
| 24 | read addr 0071253c, blah_r 8f708f70 - read count count 00000004 | |
| 25 | read addr 00712540, blah_r 8f708f70 - read count count 00000008 | |
| 26 | read addr 00712544, blah_r 8f708f70 - read count count 0000000c | |
| 27 | read addr 00712548, blah_r 8f708f70 - read count count 00000010 | |
| 28 | read addr 0071254c, blah_r 8f708f70 - read count count 00000014 | |
| 29 | read addr 00712550, blah_r 8f708f70 - read count count 00000018 | |
| 30 | read addr 00712554, blah_r 8f708f70 - read count count 0000001c | |
| 31 | ||
| 32 | */ | |
| 33 | ||
| 34 | #include "emu.h" | |
| 35 | #include "machine/315-5838_317-0229_comp.h" | |
| 36 | ||
| 37 | extern const device_type SEGA315_5838_COMP = &device_creator<sega_315_5838_comp_device>; | |
| 38 | ||
| 39 | //#define DEBUG_DATA_DUMP | |
| 40 | ||
| 41 | sega_315_5838_comp_device::sega_315_5838_comp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 42 | : device_t(mconfig, SEGA315_5838_COMP, "Sega 315-5838 / 317-0029 Compression (Encryption?)", tag, owner, clock, "SEGA315_5838", __FILE__) | |
| 43 | { | |
| 44 | } | |
| 45 | ||
| 46 | ||
| 47 | ||
| 48 | void sega_315_5838_comp_device::device_start() | |
| 49 | { | |
| 50 | for (int i = 0; i < 2; i++) | |
| 51 | { | |
| 52 | m_channel[i].m_decathlt_lastcount = 0; | |
| 53 | m_channel[i].m_decathlt_prot_uploadmode = 0; | |
| 54 | m_channel[i].m_decathlt_prot_uploadoffset = 0; | |
| 55 | m_channel[i].m_read_ch.bind_relative_to(*owner()); | |
| 56 | ||
| 57 | } | |
| 58 | } | |
| 59 | ||
| 60 | void sega_315_5838_comp_device::device_reset() | |
| 61 | { | |
| 62 | for (int i = 0; i < 2; i++) | |
| 63 | { | |
| 64 | m_channel[i].m_srcoffset = 0; | |
| 65 | m_channel[i].m_decathlt_lastcount = 0; | |
| 66 | m_channel[i].m_decathlt_prot_uploadmode = 0; | |
| 67 | m_channel[i].m_decathlt_prot_uploadoffset = 0; | |
| 68 | } | |
| 69 | ||
| 70 | m_protstate = 0; | |
| 71 | } | |
| 72 | ||
| 73 | ||
| 74 | /************************** | |
| 75 | * | |
| 76 | * Decathlete | |
| 77 | * | |
| 78 | **************************/ | |
| 79 | ||
| 80 | #ifdef DEBUG_DATA_DUMP | |
| 81 | FILE* tempfile; | |
| 82 | #endif | |
| 83 | ||
| 84 | ||
| 85 | READ32_MEMBER(sega_315_5838_comp_device::decathlt_prot1_r) | |
| 86 | { | |
| 87 | return genericdecathlt_prot_r(mem_mask, 0); | |
| 88 | } | |
| 89 | ||
| 90 | READ32_MEMBER(sega_315_5838_comp_device::decathlt_prot2_r) | |
| 91 | { | |
| 92 | return genericdecathlt_prot_r(mem_mask, 1); | |
| 93 | } | |
| 94 | ||
| 95 | ||
| 96 | UINT32 sega_315_5838_comp_device::genericdecathlt_prot_r(UINT32 mem_mask, int channel) | |
| 97 | { | |
| 98 | // UINT32 *fake0 = (UINT32*)memregion( ":fake0" )->base(); | |
| 99 | // UINT32 retvalue = 0xffff; | |
| 100 | ||
| 101 | switch (m_channel[channel].m_srcoffset) | |
| 102 | { | |
| 103 | default: | |
| 104 | ||
| 105 | m_channel[channel].m_decathlt_lastcount++; | |
| 106 | ||
| 107 | UINT32 tempdata = 0; | |
| 108 | tempdata |= m_channel[channel].m_read_ch(m_channel[channel].m_srcoffset) << 0; | |
| 109 | m_channel[channel].m_srcoffset++; | |
| 110 | tempdata |= m_channel[channel].m_read_ch(m_channel[channel].m_srcoffset) << 16; | |
| 111 | m_channel[channel].m_srcoffset++; | |
| 112 | ||
| 113 | ||
| 114 | #ifdef DEBUG_DATA_DUMP | |
| 115 | //printf("read addr %08x, blah_r %08x - read count count %08x\n", m_channel[channel].m_srcoffset*2, tempdata, m_channel[channel].m_decathlt_lastcount*4); | |
| 116 | fwrite(&tempdata, 1, 4, tempfile); | |
| 117 | #else | |
| 118 | logerror("read addr %08x, blah_r %08x - read count count %08x\n", m_channel[channel].m_srcoffset*2, tempdata, m_channel[channel].m_decathlt_lastcount*4); | |
| 119 | #endif | |
| 120 | ||
| 121 | return tempdata; | |
| 122 | #if 0 | |
| 123 | case 0x03228e4: | |
| 124 | if (fake0) retvalue = fake0[(((0x20080/4)+m_channel[channel].m_decathlt_lastcount))]; | |
| 125 | m_channel[channel].m_decathlt_lastcount++; | |
| 126 | return retvalue; | |
| 127 | ||
| 128 | case 0x00a9f3a: | |
| 129 | if (fake0) retvalue = fake0[(((0x00000/4)+m_channel[channel].m_decathlt_lastcount))]; | |
| 130 | m_channel[channel].m_decathlt_lastcount++; | |
| 131 | return retvalue; | |
| 132 | ||
| 133 | case 0x0213ab4: | |
| 134 | if (fake0) retvalue = fake0[(((0x40000/4)+m_channel[channel].m_decathlt_lastcount))]; | |
| 135 | m_channel[channel].m_decathlt_lastcount++; | |
| 136 | return retvalue; | |
| 137 | ||
| 138 | case 0x01efaf0: | |
| 139 | if (fake0) retvalue = fake0[(((0x60000/4)+m_channel[channel].m_decathlt_lastcount))]; | |
| 140 | m_channel[channel].m_decathlt_lastcount++; | |
| 141 | return retvalue; | |
| 142 | ||
| 143 | case 0x033f16c: | |
| 144 | case 0x038929c: | |
| 145 | ||
| 146 | ||
| 147 | ||
| 148 | case 0x00de05a: | |
| 149 | case 0x0334258: | |
| 150 | case 0x019fb82: | |
| 151 | case 0x033dbf6: | |
| 152 | case 0x0011ac6: | |
| 153 | case 0x00060dc: | |
| 154 | case 0x0000002: | |
| 155 | case 0x0008c90: | |
| 156 | case 0x035cdc8: | |
| 157 | case 0x0327960: | |
| 158 | case 0x0329b8c: | |
| 159 | case 0x00d6e92: | |
| 160 | case 0x000081e: | |
| 161 | case 0x00035d6: | |
| 162 | case 0x00089a6: | |
| 163 | case 0x03315f4: | |
| 164 | case 0x0023fe0: | |
| 165 | case 0x001e290: | |
| 166 | case 0x0026e86: | |
| 167 | case 0x0012494: | |
| 168 | case 0x001b35a: | |
| 169 | case 0x0018424: | |
| 170 | ||
| 171 | return retvalue; | |
| 172 | #endif | |
| 173 | } | |
| 174 | ||
| 175 | return 0xffffffff; | |
| 176 | } | |
| 177 | ||
| 178 | void sega_315_5838_comp_device::set_prot_addr(UINT32 data, UINT32 mem_mask, int channel) | |
| 179 | { | |
| 180 | // printf("set_prot_addr\n"); | |
| 181 | COMBINE_DATA(&m_channel[channel].m_srcoffset); | |
| 182 | ||
| 183 | //if (m_decathlt_part==0) logerror("%d, last read count was %06x\n",channel, m_channel[channel].m_decathlt_lastcount*4); | |
| 184 | m_channel[channel].m_decathlt_lastcount = 0; | |
| 185 | ||
| 186 | if (mem_mask == 0x0000ffff) | |
| 187 | { | |
| 188 | printf("set source address to %08x (channel %d)\n", m_channel[channel].m_srcoffset, channel); | |
| 189 | } | |
| 190 | ||
| 191 | ||
| 192 | #ifdef DEBUG_DATA_DUMP | |
| 193 | if (mem_mask == 0x0000ffff) | |
| 194 | { | |
| 195 | if (tempfile) | |
| 196 | fclose(tempfile); | |
| 197 | ||
| 198 | char filename[256]; | |
| 199 | sprintf(filename, "%d_compressed_%08x", channel, m_channel[channel].m_srcoffset * 2); | |
| 200 | tempfile = fopen(filename, "w+b"); | |
| 201 | ||
| 202 | // the table and dictionary are uploaded repeatedly, usually before groups of data transfers but | |
| 203 | // it's always the same tables (one pair for each channel) | |
| 204 | { | |
| 205 | FILE* fp; | |
| 206 | sprintf(filename, "%d_compressed_table1", channel); | |
| 207 | fp = fopen(filename, "w+b"); | |
| 208 | fwrite(&m_channel[channel].m_decathlt_prottable1, 24, 2, fp); | |
| 209 | fclose(fp); | |
| 210 | } | |
| 211 | ||
| 212 | { | |
| 213 | FILE* fp; | |
| 214 | sprintf(filename, "%d_compressed_dictionary", channel); | |
| 215 | fp = fopen(filename, "w+b"); | |
| 216 | fwrite(&m_channel[channel].m_decathlt_dictionary, 128, 2, fp); | |
| 217 | fclose(fp); | |
| 218 | } | |
| 219 | } | |
| 220 | #endif | |
| 221 | ||
| 222 | } | |
| 223 | ||
| 224 | void sega_315_5838_comp_device::set_upload_mode(UINT16 data, int channel) | |
| 225 | { | |
| 226 | if ((data == 0x8000) || (data == 0x0000)) | |
| 227 | { | |
| 228 | // logerror("changed to upload mode 1\n"); | |
| 229 | m_channel[channel].m_decathlt_prot_uploadmode = 1; | |
| 230 | m_channel[channel].m_decathlt_prot_uploadoffset = 0; | |
| 231 | } | |
| 232 | else if ((data == 0x8080) || (data == 0x0080)) | |
| 233 | { | |
| 234 | m_channel[channel].m_decathlt_prot_uploadmode = 2; | |
| 235 | m_channel[channel].m_decathlt_prot_uploadoffset = 0; | |
| 236 | } | |
| 237 | else | |
| 238 | { | |
| 239 | fatalerror("unknown upload mode\n"); | |
| 240 | } | |
| 241 | } | |
| 242 | ||
| 243 | void sega_315_5838_comp_device::upload_table_data(UINT16 data, int channel) | |
| 244 | { | |
| 245 | if (m_channel[channel].m_decathlt_prot_uploadmode == 1) | |
| 246 | { | |
| 247 | if (m_channel[channel].m_decathlt_prot_uploadoffset >= 24) | |
| 248 | { | |
| 249 | fatalerror("upload mode 1 error, too big\n"); | |
| 250 | return; | |
| 251 | } | |
| 252 | ||
| 253 | //logerror("uploading table 1 %04x %04x\n",m_channel[channel].m_decathlt_prot_uploadoffset, data&0xffff); | |
| 254 | m_channel[channel].m_decathlt_prottable1[m_channel[channel].m_decathlt_prot_uploadoffset] = data & 0xffff; | |
| 255 | m_channel[channel].m_decathlt_prot_uploadoffset++; | |
| 256 | printf("unk table 1 %04x (channel %d)\n", data & 0xffff, channel); | |
| 257 | } | |
| 258 | else if (m_channel[channel].m_decathlt_prot_uploadmode == 2) | |
| 259 | { | |
| 260 | if (m_channel[channel].m_decathlt_prot_uploadoffset >= 128) | |
| 261 | { | |
| 262 | fatalerror("upload mode 2 error, too big\n"); | |
| 263 | return; | |
| 264 | } | |
| 265 | ||
| 266 | //logerror("uploading table 2 %04x %04x\n",m_channel[channel].m_decathlt_prot_uploadoffset, data&0xffff); | |
| 267 | m_channel[channel].m_decathlt_dictionary[m_channel[channel].m_decathlt_prot_uploadoffset] = data & 0xffff; | |
| 268 | m_channel[channel].m_decathlt_prot_uploadoffset++; | |
| 269 | printf("dictionary %04x (channel %d)\n", data & 0xffff, channel); | |
| 270 | } | |
| 271 | } | |
| 272 | ||
| 273 | void sega_315_5838_comp_device::write_prot_data(UINT32 data, UINT32 mem_mask, int channel, int rev_words) | |
| 274 | { | |
| 275 | if (mem_mask==0xffff0000) | |
| 276 | { | |
| 277 | if (rev_words==0) set_upload_mode(data >> 16, channel); | |
| 278 | else upload_table_data(data >>16, channel); | |
| 279 | } | |
| 280 | else if (mem_mask == 0x0000ffff) | |
| 281 | { | |
| 282 | if (rev_words==0) upload_table_data(data & 0xffff, channel); | |
| 283 | else set_upload_mode(data & 0xffff, channel); | |
| 284 | } | |
| 285 | else | |
| 286 | { | |
| 287 | fatalerror("write_prot_data invalid mem_mask\b"); | |
| 288 | } | |
| 289 | } | |
| 290 | ||
| 291 | ||
| 292 | ||
| 293 | WRITE32_MEMBER( sega_315_5838_comp_device::decathlt_prot1_w_doa ) { write_prot_data(data, mem_mask, 0, 1); } | |
| 294 | WRITE32_MEMBER( sega_315_5838_comp_device::decathlt_prot1_w) { write_prot_data(data, mem_mask, 0, 0); } | |
| 295 | WRITE32_MEMBER( sega_315_5838_comp_device::decathlt_prot2_w) { write_prot_data(data, mem_mask, 1, 0); } | |
| 296 | ||
| 297 | WRITE32_MEMBER( sega_315_5838_comp_device::decathlt_prot1_srcaddr_w ) { set_prot_addr(data, mem_mask, 0); } | |
| 298 | WRITE32_MEMBER( sega_315_5838_comp_device::decathlt_prot2_srcaddr_w) { set_prot_addr(data, mem_mask, 1); } | |
| 299 | ||
| 300 | ||
| 301 | void sega_315_5838_comp_device::install_decathlt_protection() | |
| 302 | { | |
| 303 | //todo, install these in the driver, they differ between games | |
| 304 | cpu_device* cpu = (cpu_device*)machine().device(":maincpu"); | |
| 305 | ||
| 306 | cpu->space(AS_PROGRAM).install_write_handler(0x37FFFF0, 0x37FFFF3, write32_delegate(FUNC(sega_315_5838_comp_device::decathlt_prot1_srcaddr_w), this)); // set compressed data source address | |
| 307 | cpu->space(AS_PROGRAM).install_write_handler(0x37FFFF4, 0x37FFFF7, write32_delegate(FUNC(sega_315_5838_comp_device::decathlt_prot1_w), this)); // upload tables | |
| 308 | cpu->space(AS_PROGRAM).install_read_handler(0x37FFFF8, 0x37FFFFb, read32_delegate(FUNC(sega_315_5838_comp_device::decathlt_prot1_r), this)); // read decompressed data | |
| 309 | ||
| 310 | // the device is addressed here too, uploading a different set of tables and accessing a different part of ROM | |
| 311 | cpu->space(AS_PROGRAM).install_write_handler(0x27FFFF0, 0x27FFFF3, write32_delegate(FUNC(sega_315_5838_comp_device::decathlt_prot2_srcaddr_w), this)); // set compressed data source address | |
| 312 | cpu->space(AS_PROGRAM).install_write_handler(0x27FFFF4, 0x27FFFF7, write32_delegate(FUNC(sega_315_5838_comp_device::decathlt_prot2_w), this)); // upload tables | |
| 313 | cpu->space(AS_PROGRAM).install_read_handler(0x27FFFF8, 0x27FFFFb, read32_delegate(FUNC(sega_315_5838_comp_device::decathlt_prot2_r), this)); // read decompressed data | |
| 314 | } | |
| 315 | ||
| 316 | ||
| 317 | READ32_MEMBER(sega_315_5838_comp_device::doa_prot_r) | |
| 318 | { | |
| 319 | UINT32 retval = 0; | |
| 320 | ||
| 321 | if (offset == 0x7ff8/4) | |
| 322 | { | |
| 323 | retval = m_protram[m_protstate+1] | m_protram[m_protstate]<<8; | |
| 324 | m_protstate+=2; | |
| 325 | printf("doa_prot_read %08x %08x %08x\n", offset*4, retval, mem_mask); | |
| 326 | } | |
| 327 | else if (offset == 0x400c/4) // todo, is this actually part of the protection? it's in the address range, but decathlete doesn't have it afaik. | |
| 328 | { | |
| 329 | m_prot_a = !m_prot_a; | |
| 330 | if (m_prot_a) | |
| 331 | retval = 0xffff; | |
| 332 | else | |
| 333 | retval = 0xfff0; | |
| 334 | } | |
| 335 | else | |
| 336 | { | |
| 337 | printf("doa_prot_read %08x %08x %08x\n", offset*4, retval, mem_mask); | |
| 338 | logerror("Unhandled Protection READ @ %x mask %x (PC=%x)\n", offset, mem_mask, space.device().safe_pc()); | |
| 339 | } | |
| 340 | ||
| 341 | return retval; | |
| 342 | } | |
| 343 | ||
| 344 | ||
| 345 | WRITE32_MEMBER(sega_315_5838_comp_device::doa_prot_w) | |
| 346 | { | |
| 347 | printf("doa_prot_w %08x %08x %08x\n", offset*4, data, mem_mask); | |
| 348 | ||
| 349 | m_protstate = 0; | |
| 350 | } | |
| 351 | ||
| 352 | ||
| 353 | void sega_315_5838_comp_device::install_doa_protection() | |
| 354 | { | |
| 355 | //todo, install these in the driver, they differ between games | |
| 356 | cpu_device* cpu = (cpu_device*)machine().device(":maincpu"); | |
| 357 | ||
| 358 | m_protstate = 0; | |
| 359 | strcpy((char *)m_protram, " TECMO LTD. DEAD OR ALIVE 1996.10.22 VER. 1.00"); // this is the single decompressed string DOA needs, note, 2 spaces at start, might indicate a dummy read like with 5881 on Model 2 | |
| 360 | ||
| 361 | cpu->space(AS_PROGRAM).install_readwrite_handler(0x01d80000, 0x01dfffff, read32_delegate(FUNC(sega_315_5838_comp_device::doa_prot_r), this), write32_delegate(FUNC(sega_315_5838_comp_device::doa_prot_w), this)); | |
| 362 | cpu->space(AS_PROGRAM).install_write_handler(0x01d87ff0, 0x01d87ff3, write32_delegate(FUNC(sega_315_5838_comp_device::decathlt_prot1_srcaddr_w), this)); // set compressed data source address (always set 0, data is in RAM) | |
| 363 | cpu->space(AS_PROGRAM).install_write_handler(0x01d87ff4, 0x01d87ff7, write32_delegate(FUNC(sega_315_5838_comp_device::decathlt_prot1_w_doa), this)); // upload tab | |
| 364 | // cpu->space(AS_PROGRAM).install_read_handler(0x01d87ff8, 0x01d87ffb, read32_delegate(FUNC(sega_315_5838_comp_device::decathlt_prot1_r), this)); // read decompressed data | |
| 365 | ||
| 366 | } |
| r243192 | r243193 | |
|---|---|---|
| 1 | ||
| 2 | #pragma once | |
| 3 | ||
| 4 | #ifndef __SEGA315_5838_COMP__ | |
| 5 | #define __SEGA315_5838_COMP__ | |
| 6 | ||
| 7 | #define CHANNELS 2 | |
| 8 | ||
| 9 | typedef device_delegate<UINT16 (UINT32)> sega_dec_read_delegate; | |
| 10 | ||
| 11 | extern const device_type SEGA315_5838_COMP; | |
| 12 | ||
| 13 | #define MCFG_SET_5838_READ_CALLBACK_CH1( _class, _method) \ | |
| 14 | sega_315_5838_comp_device::set_read_cb_ch1(*device, sega_m2_read_delegate(&_class::_method, #_class "::" #_method, NULL, (_class *)0)); | |
| 15 | ||
| 16 | #define MCFG_SET_5838_READ_CALLBACK_CH2( _class, _method) \ | |
| 17 | sega_315_5838_comp_device::set_read_cb_ch2(*device, sega_m2_read_delegate(&_class::_method, #_class "::" #_method, NULL, (_class *)0)); | |
| 18 | ||
| 19 | class sega_315_5838_comp_device : public device_t | |
| 20 | { | |
| 21 | public: | |
| 22 | // construction/destruction | |
| 23 | sega_315_5838_comp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 24 | ||
| 25 | sega_dec_read_delegate m_read_ch2; | |
| 26 | ||
| 27 | static void set_read_cb_ch1(device_t &device,sega_dec_read_delegate readcb) | |
| 28 | { | |
| 29 | sega_315_5838_comp_device &dev = downcast<sega_315_5838_comp_device &>(device); | |
| 30 | dev.m_channel[0].m_read_ch = readcb; | |
| 31 | } | |
| 32 | ||
| 33 | static void set_read_cb_ch2(device_t &device,sega_dec_read_delegate readcb) | |
| 34 | { | |
| 35 | sega_315_5838_comp_device &dev = downcast<sega_315_5838_comp_device &>(device); | |
| 36 | dev.m_channel[1].m_read_ch = readcb; | |
| 37 | } | |
| 38 | ||
| 39 | DECLARE_READ32_MEMBER(decathlt_prot1_r); | |
| 40 | DECLARE_READ32_MEMBER(decathlt_prot2_r);; | |
| 41 | UINT32 genericdecathlt_prot_r(UINT32 mem_mask, int channel); | |
| 42 | ||
| 43 | void write_prot_data(UINT32 data, UINT32 mem_mask, int channel, int rev_words); | |
| 44 | ||
| 45 | void upload_table_data(UINT16 data, int channel); | |
| 46 | void set_upload_mode(UINT16 data, int channel); | |
| 47 | void set_prot_addr(UINT32 data, UINT32 mem_mask, int channel); | |
| 48 | ||
| 49 | DECLARE_WRITE32_MEMBER(decathlt_prot1_w_doa); | |
| 50 | DECLARE_WRITE32_MEMBER(decathlt_prot1_w); | |
| 51 | DECLARE_WRITE32_MEMBER(decathlt_prot2_w); | |
| 52 | DECLARE_WRITE32_MEMBER(decathlt_prot1_srcaddr_w); | |
| 53 | DECLARE_WRITE32_MEMBER(decathlt_prot2_srcaddr_w); | |
| 54 | ||
| 55 | void install_decathlt_protection(); | |
| 56 | void install_doa_protection(); | |
| 57 | ||
| 58 | DECLARE_READ32_MEMBER(doa_prot_r); | |
| 59 | DECLARE_WRITE32_MEMBER(doa_prot_w); | |
| 60 | ||
| 61 | protected: | |
| 62 | virtual void device_start(); | |
| 63 | virtual void device_reset(); | |
| 64 | ||
| 65 | private: | |
| 66 | ||
| 67 | // Decathlete specific variables and functions (see machine/decathlt.c) | |
| 68 | struct channel_type | |
| 69 | { | |
| 70 | UINT32 m_srcoffset; | |
| 71 | UINT16 m_decathlt_prottable1[24]; | |
| 72 | UINT16 m_decathlt_dictionary[128]; | |
| 73 | ||
| 74 | UINT32 m_decathlt_lastcount; | |
| 75 | UINT32 m_decathlt_prot_uploadmode; | |
| 76 | UINT32 m_decathlt_prot_uploadoffset; | |
| 77 | sega_dec_read_delegate m_read_ch; | |
| 78 | ||
| 79 | }; | |
| 80 | ||
| 81 | channel_type m_channel[2]; | |
| 82 | ||
| 83 | ||
| 84 | ||
| 85 | // Doa | |
| 86 | int m_protstate; | |
| 87 | int m_prot_a; | |
| 88 | UINT8 m_protram[256]; | |
| 89 | }; | |
| 90 | ||
| 91 | #endif |
| r243192 | r243193 | |
|---|---|---|
| 45 | 45 | save_item(NAME(line_buffer_pos)); |
| 46 | 46 | save_item(NAME(line_buffer_size)); |
| 47 | 47 | |
| 48 | astring skey = parameter("key"); | |
| 49 | if(skey) | |
| 50 | key = strtoll(skey.cstr(), 0, 16); | |
| 51 | else | |
| 52 | { | |
| 53 | logerror("%s: Warning: key not provided\n", tag()); | |
| 54 | key = 0; | |
| 55 | } | |
| 56 | 48 | } |
| 57 | 49 | |
| 58 | 50 | void sega_315_5881_crypt_device::device_reset() |
| r243192 | r243193 | |
| 78 | 70 | if(!enc_ready) |
| 79 | 71 | enc_start(); |
| 80 | 72 | if(dec_header & FLAG_COMPRESSED) { |
| 81 | if (line_buffer_pos == line_buffer_size) // if there's no data left to read.. | |
| 82 | { | |
| 83 | if (done_compression == 1) | |
| 84 | enc_start(); | |
| 85 | ||
| 86 | ||
| 87 | ||
| 73 | if(line_buffer_pos == line_buffer_size) | |
| 88 | 74 | line_fill(); |
| 89 | } | |
| 90 | 75 | base = line_buffer + line_buffer_pos; |
| 91 | 76 | line_buffer_pos += 2; |
| 92 | 77 | } else { |
| r243192 | r243193 | |
| 109 | 94 | { |
| 110 | 95 | prot_cur_address = (prot_cur_address & 0x0000ffff) | (data << 16); |
| 111 | 96 | enc_ready = false; |
| 112 | ||
| 113 | buffer_bit = 7; | |
| 114 | buffer_bit2 = 15; | |
| 115 | 97 | } |
| 116 | 98 | |
| 117 | 99 | void sega_315_5881_crypt_device::set_subkey(UINT16 data) |
| r243192 | r243193 | |
| 120 | 102 | enc_ready = false; |
| 121 | 103 | } |
| 122 | 104 | |
| 105 | void sega_315_5881_crypt_device::set_key(UINT32 data) | |
| 106 | { | |
| 107 | key = data; | |
| 108 | enc_ready = false; | |
| 109 | } | |
| 110 | ||
| 123 | 111 | /*************************************************************************** |
| 124 | 112 | DECRYPTION EMULATION |
| 125 | 113 | |
| r243192 | r243193 | |
| 132 | 120 | |
| 133 | 121 | The encryption is done by a stream cipher operating in counter mode, which use a 16-bits internal block cipher. |
| 134 | 122 | |
| 135 | Every stream can be composed by several substreams; there are 18 header bits at the start of every substream, with | |
| 136 | a 1+9+8 format; the highest bit control the mode of operation: set to 1 means that the substream needs to be decompressed | |
| 137 | after being decrypted. The other two blocks (A||B) encode the length of the substream, as (A+1)*(B+1). When a | |
| 138 | substream end, the header of the next one, if existing, follows inmediatly. | |
| 123 | There are 2 "control bits" at the start of the decrypted stream which control the mode of operation: bit #1 set to 1 means | |
| 124 | that the decrypted stream needs to be decompressed after being decrypted. More on this later. | |
| 139 | 125 | |
| 140 | 126 | The next 16-bits are part of the header (they don't belong to the plaintext), but his meaning is unclear. It has been |
| 141 | 127 | conjectured that it could stablish when to "reset" the process and start processing a new stream (based on some tests |
| r243192 | r243193 | |
| 148 | 134 | given plaintext word, and the remaining 2 to the next plaintext word. |
| 149 | 135 | |
| 150 | 136 | The underlying block cipher consists of two 4-round Feistel Networks (FN): the first one takes the counter (16 bits), |
| 151 | the game-key (>=29 bits; probably 64) and the sequence-key (16 bits) and output a middle result (16 bits) which will act | |
| 152 | as another key for the second one. The second FN will take the encrypted word (16 bits), the game-key, the sequence-key | |
| 153 | and the result from the first FN and will output the decrypted word (16 bits). | |
| 137 | the game-key (>=26 bits) and the sequence-key (16 bits) and output a middle result (16 bits) which will act as another key | |
| 138 | for the second one. The second FN will take the encrypted word (16 bits), the game-key, the sequence-key and the result | |
| 139 | from the first FN and will output the decrypted word (16 bits). | |
| 154 | 140 | |
| 155 | Each round of the Feistel Networks use four substitution sboxes, each having 6 inputs and 2 outputs. The input is the | |
| 156 | XOR of at most one bit from the previous round and at most one bit from the different keys. | |
| 141 | Each round of the Feistel Networks use four substitution sboxes, each having 6 inputs and 2 outputs. The input can be the | |
| 142 | XOR of at most two "sources bits", being source bits the bits from the previous round and the bits from the different keys. | |
| 157 | 143 | |
| 158 | 144 | The underlying block cipher has the same structure than the one used by the CPS-2 (Capcom Play System 2) and, |
| 159 | 145 | indeed, some of the used sboxes are exactly the same and appear in the same FN/round in both systems (this is not evident, |
| 160 | as you need to apply a bitswapping and some XORs to the input & output of the sboxes to get the same values due). | |
| 146 | as you need to apply a bitswapping and some XORs to the input & output of the sboxes to get the same values due). However, | |
| 147 | the key scheduling used by this implementation is much weaker than the CPS-2's one. Many s-boxes inputs aren't XORed with any | |
| 148 | key bit. | |
| 161 | 149 | |
| 150 | Due to the small key-length, no sophisticated attacks are needed to recover the keys; a brute-force attack knowing just | |
| 151 | some (encrypted word-decrypted word) pairs suffice. However, due to the weak key scheduling, it should be noted that some | |
| 152 | related keys can produce the same output bytes for some (short) input sequences. | |
| 153 | ||
| 154 | The only difference in the decryption process between M2 and M3 is the initialization of the counter. In M3, the counter is | |
| 155 | always set to 0 at the beginning of the decryption while, in M2, the bits #1-#16 of the ciphertext's address are used | |
| 156 | to initialize the counter. | |
| 157 | ||
| 162 | 158 | Note that this implementation considers that the counter initialization for ram decryption is 0 simply because the ram is |
| 163 | 159 | mapped to multiples of 128K. |
| 164 | 160 | |
| r243192 | r243193 | |
| 168 | 164 | chosen so as to make the key for CAPSNK equal to 0. |
| 169 | 165 | |
| 170 | 166 | It can be observed that a couple of sboxes have incomplete tables (a 255 value indicate an unknown value). The recovered keys |
| 171 | as of | |
| 167 | as of december/2010 show small randomness and big correlations, making possible that some unseen bits could make the | |
| 172 | 168 | decryption need those incomplete parts. |
| 173 | 169 | |
| 174 | SEGA apparently used his security part label (317-xxxx-yyy) as part of the key; the mapping of the current keys to the chip label | |
| 175 | is given by the following function: | |
| 176 | ||
| 177 | void key2label(uint32_t key) | |
| 178 | { | |
| 179 | int bcd0 = ((BIT(key,17)<<3)|(BIT(key,7)<<2)|(BIT(key,14)<<1)|BIT(key,19))^9; | |
| 180 | int bcd1 = ((BIT(key,20)<<3)|(BIT(key,1)<<2)|(BIT(key,4)<<1)|BIT(key,13))^5; | |
| 181 | int bcd2 = (BIT(key,9)<<1)|BIT(key,22); | |
| 182 | int bcd3 = ((BIT(key,9)<<2)|BIT(key,9))^5; | |
| 183 | ||
| 184 | char chiplabel[13]; | |
| 185 | sprintf(chiplabel, "317-%d%d%d%d-%s", bcd3, bcd2, bcd1, bcd0, (BIT(key,5)?"JPN":"COM")); | |
| 186 | ||
| 187 | printf("%s", chiplabel); | |
| 188 | } | |
| 189 | ||
| 190 | Given the use of the BCD-encoded security module labels, it's expected that at least other 6 additional bits be present in the | |
| 191 | real keys but undetected in the current implementation (due to them being set to fixed values on all the known 315-5881 chip labels). | |
| 192 | That would rise the bit count at least to 35. | |
| 193 | ||
| 194 | Other key bits not directly related to the 315-5881 label still show low entropies, making possible that | |
| 195 | they be derived from other non-random sources. | |
| 196 | ||
| 197 | In the second Feistel Network, every key bit seem to be used at most once (the various uses of current bit #9 are fictitious, as | |
| 198 | that bit really represent various bits in the real key; see comments on the use of the labels above). Given that, it seems probable | |
| 199 | that the real key is 64 bits long, exactly as in the related CPS-2 scheme, and the designers tried to cover all 96 input bits with | |
| 200 | the bits provening from the game key, the sequence key and the result from the first feistel network (64+16+16=96). In the first | |
| 201 | Feistel Network, as only 80 bits are available, some bits would be used twice (as can be partially seen in the current implementation). | |
| 202 | The fact that only 29 bits out of the expected 64 have been observed till now would be due to the generation of the key by composing | |
| 203 | low-entropy sources. | |
| 204 | ||
| 205 | 170 | ****************************************************************************************/ |
| 206 | 171 | |
| 207 | 172 | const sega_315_5881_crypt_device::sbox sega_315_5881_crypt_device::fn1_sboxes[4][4] = { |
| r243192 | r243193 | |
| 263 | 228 | |
| 264 | 229 | { |
| 265 | 230 | { |
| 266 | 2,2,2,3,1,1,0,1,3,3,1,1,2,2,2,0,0,3,2,3,3,0,2,1,2,2,3,0,1,3,0,0, | |
| 267 | 3,2,0,3,2,0,1,0,0,1,2,2,3,3,0,2,2,1,3,1,1,1,1,2,0,3,1,0,0,2,3,2, | |
| 231 | 2,2,2,3,1,1,0,1,0,1,2,2,3,3,0,2,0,3,2,3,3,0,2,1,0,3,1,0,0,2,3,2, | |
| 232 | 3,2,0,3,2,0,1,0,3,3,1,1,2,2,2,0,2,1,3,1,1,1,1,2,2,2,3,0,1,3,0,0, | |
| 268 | 233 | }, |
| 269 | {1,2,5,6,7, | |
| 234 | {1,2,5,6,7,-1}, | |
| 270 | 235 | {2,7} |
| 271 | 236 | }, |
| 272 | 237 | |
| r243192 | r243193 | |
| 370 | 335 | |
| 371 | 336 | { |
| 372 | 337 | { |
| 373 | 0,1,3,0,1,1,2,3,2,0,0,3,2,1,3,1,3,3,0,0,1,0,0,3,0,3,3,2,3,2,0,1, | |
| 374 | 3,2,3,2,2,1,3,1,1,1,0,3,3,2,2,1,1,2,0,2,0,1,1,0,1,0,1,1,2,0,3,0, | |
| 338 | 0,2,3,2,1,1,0,0,2,1,0,3,3,0,0,0,3,2,0,2,1,1,2,1,0,0,3,1,2,2,3,1, | |
| 339 | 3,1,3,0,0,0,1,3,1,0,0,3,2,2,3,1,1,3,0,0,2,1,3,3,1,3,1,2,3,1,2,1, | |
| 375 | 340 | }, |
| 376 | {0,3,5,6, | |
| 341 | {0,3,5,6,-1,-1}, | |
| 377 | 342 | {1,2} |
| 378 | 343 | }, |
| 379 | 344 | |
| r243192 | r243193 | |
| 416 | 381 | |
| 417 | 382 | { |
| 418 | 383 | { |
| 419 | 1,0,3,0,0,1,2,1,0,0,1,0,0,0,2,3,2,2,0,2,0,1,3,0,2,0,1,3,2,3,0,1, | |
| 420 | 1,2,2,2,1,3,0,3,0,1,1,0,3,2,3,3,2,0,0,3,1,2,1,3,3,2,1,0,2,1,2,3, | |
| 384 | 1,2,3,2,0,3,2,3,0,1,1,0,0,2,2,3,2,0,0,3,0,2,3,3,2,2,1,0,2,1,0,3, | |
| 385 | 1,0,2,0,1,1,0,1,0,0,1,0,3,0,3,3,2,2,0,2,1,1,1,0,3,0,1,3,2,3,2,1, | |
| 421 | 386 | }, |
| 422 | {2,3,4,6,7, | |
| 387 | {2,3,4,6,7,-1}, | |
| 423 | 388 | {2,3} |
| 424 | 389 | }, |
| 425 | 390 | |
| r243192 | r243193 | |
| 435 | 400 | { // 3rd round |
| 436 | 401 | { |
| 437 | 402 | { |
| 438 | 0,3,0,1,3,0,0,2,1,0,1,3,2,2,2,0,3,3,3,0,2,2,0,3,0,0,2,3,0,3,2,1, | |
| 439 | 3,3,0,3,0,2,3,3,1,1,1,0,2,2,1,1,3,0,3,1,2,0,2,0,0,0,3,2,1,1,0,0, | |
| 403 | 0,3,0,1,0,2,3,3,1,0,1,3,2,2,1,1,3,3,3,0,2,0,2,0,0,0,2,3,1,1,0,0, | |
| 404 | 3,3,0,3,3,0,0,2,1,1,1,0,2,2,2,0,3,0,3,1,2,2,0,3,0,0,3,2,0,3,2,1, | |
| 440 | 405 | }, |
| 441 | {1,4,5,6,7, | |
| 406 | {1,4,5,6,7,-1}, | |
| 442 | 407 | {0,5} |
| 443 | 408 | }, |
| 444 | 409 | |
| r243192 | r243193 | |
| 453 | 418 | |
| 454 | 419 | { |
| 455 | 420 | { |
| 456 | 2,2, | |
| 421 | 2,2,3,2,0,3,2,3,1,1,2,0,2,3,1,3,0,0,0,3,2,0,1,0,1,3,2,3,3,3,1,0, | |
| 457 | 422 | // unused? |
| 458 | 423 | 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, |
| 459 | 424 | }, |
| 460 | {1,2,4,7, | |
| 425 | {1,2,4,7,-1,-1}, | |
| 461 | 426 | {2,4} |
| 462 | 427 | }, |
| 463 | 428 | |
| r243192 | r243193 | |
| 509 | 474 | }, |
| 510 | 475 | }; |
| 511 | 476 | |
| 512 | const int sega_315_5881_crypt_device::fn1_game_key_scheduling[ | |
| 477 | const int sega_315_5881_crypt_device::fn1_game_key_scheduling[38][2] = { | |
| 513 | 478 | {1,29}, {1,71}, {2,4}, {2,54}, {3,8}, {4,56}, {4,73}, {5,11}, |
| 514 | {6,51}, {7,92}, {8,89}, {9,9}, {9,39}, {9,58}, {9,86}, {10,90}, | |
| 515 | {11,6}, {12,64}, {13,49}, {14,44}, {15,40}, {16,69}, {17,15}, {18,23}, | |
| 516 | {18,43}, {19,82}, {20,81}, {21,32}, {22,5}, {23,66}, {24,13}, {24,45}, | |
| 517 | {25,12}, {25,35}, {26,61}, {27,10}, {27,59}, {28,25} | |
| 479 | {6,51}, {7,92}, {8,89}, {9,9}, {9,10}, {9,39}, {9,41}, {9,58}, | |
| 480 | {9,59}, {9,86}, {10,90}, {11,6}, {12,64}, {13,49}, {14,44}, {15,40}, | |
| 481 | {16,69}, {17,15}, {18,23}, {18,43}, {19,82}, {20,81}, {21,32}, {21,61}, | |
| 482 | {22,5}, {23,66}, {24,13}, {24,45}, {25,12}, {25,35} | |
| 518 | 483 | }; |
| 519 | 484 | |
| 520 | const int sega_315_5881_crypt_device::fn2_game_key_scheduling[ | |
| 485 | const int sega_315_5881_crypt_device::fn2_game_key_scheduling[34][2] = { | |
| 521 | 486 | {0,0}, {1,3}, {2,11}, {3,20}, {4,22}, {5,23}, {6,29}, {7,38}, |
| 522 | {8,39}, {9,55}, {9,86}, {9,87}, {9,90}, {10,50}, {11,57}, {12,59}, | |
| 523 | {13,61}, {14,63}, {15,67}, {16,72}, {17,83}, {18,88}, {19,94}, {20,35}, | |
| 524 | {21,17}, {22,6}, {23,85}, {24,16}, {25,25}, {26,92}, {27,47}, {28,28} | |
| 487 | {8,39}, {9,47}, {9,55}, {9,86}, {9,87}, {9,90}, {10,50}, {10,53}, | |
| 488 | {11,57}, {12,59}, {13,61}, {13,64}, {14,63}, {15,67}, {16,72}, {17,83}, | |
| 489 | {18,88}, {19,94}, {20,35}, {21,17}, {21,92}, {22,6}, {22,11}, {23,85}, | |
| 490 | {24,16}, {25,25} | |
| 525 | 491 | }; |
| 526 | 492 | |
| 527 | 493 | const int sega_315_5881_crypt_device::fn1_sequence_key_scheduling[20][2] = { |
| r243192 | r243193 | |
| 567 | 533 | UINT16 sega_315_5881_crypt_device::block_decrypt(UINT32 game_key, UINT16 sequence_key, UINT16 counter, UINT16 data) |
| 568 | 534 | { |
| 569 | 535 | int j; |
| 570 | int aux, aux2; | |
| 571 | int A, B; | |
| 536 | int aux,aux2; | |
| 537 | int A,B; | |
| 572 | 538 | int middle_result; |
| 573 | 539 | UINT32 fn1_subkeys[4]; |
| 574 | 540 | UINT32 fn2_subkeys[4]; |
| 575 | 541 | |
| 576 | 542 | /* Game-key scheduling; this could be done just once per game at initialization time */ |
| 577 | memset(fn1_subkeys, 0, sizeof(UINT32) * 4); | |
| 578 | memset(fn2_subkeys, 0, sizeof(UINT32) * 4); | |
| 543 | memset(fn1_subkeys,0,sizeof(UINT32)*4); | |
| 544 | memset(fn2_subkeys,0,sizeof(UINT32)*4); | |
| 579 | 545 | |
| 580 | for (j = 0; j < FN1GK; ++j) { | |
| 581 | if (BIT(game_key, fn1_game_key_scheduling[j][0]) != 0) { | |
| 582 | aux = fn1_game_key_scheduling[j][1] % 24; | |
| 583 | aux2 = fn1_game_key_scheduling[j][1] / 24; | |
| 584 | fn1_subkeys[aux2] ^= (1 << aux); | |
| 546 | for (j=0; j<38; ++j) { | |
| 547 | if (BIT(game_key, fn1_game_key_scheduling[j][0])!=0) { | |
| 548 | aux = fn1_game_key_scheduling[j][1]%24; | |
| 549 | aux2 = fn1_game_key_scheduling[j][1]/24; | |
| 550 | fn1_subkeys[aux2] ^= (1<<aux); | |
| 585 | 551 | } |
| 586 | 552 | } |
| 587 | 553 | |
| 588 | for (j = 0; j < FN2GK; ++j) { | |
| 589 | if (BIT(game_key, fn2_game_key_scheduling[j][0]) != 0) { | |
| 590 | aux = fn2_game_key_scheduling[j][1] % 24; | |
| 591 | aux2 = fn2_game_key_scheduling[j][1] / 24; | |
| 592 | fn2_subkeys[aux2] ^= (1 << aux); | |
| 554 | for (j=0; j<34; ++j) { | |
| 555 | if (BIT(game_key, fn2_game_key_scheduling[j][0])!=0) { | |
| 556 | aux = fn2_game_key_scheduling[j][1]%24; | |
| 557 | aux2 = fn2_game_key_scheduling[j][1]/24; | |
| 558 | fn2_subkeys[aux2] ^= (1<<aux); | |
| 593 | 559 | } |
| 594 | 560 | } |
| 595 | 561 | /********************************************************/ |
| 596 | 562 | |
| 597 | 563 | /* Sequence-key scheduling; this could be done just once per decryption run */ |
| 598 | for (j = 0; j < 20; ++j) { | |
| 599 | if (BIT(sequence_key, fn1_sequence_key_scheduling[j][0]) != 0) { | |
| 600 | aux = fn1_sequence_key_scheduling[j][1] % 24; | |
| 601 | aux2 = fn1_sequence_key_scheduling[j][1] / 24; | |
| 602 | fn1_subkeys[aux2] ^= (1 << aux); | |
| 564 | for (j=0; j<20; ++j) { | |
| 565 | if (BIT(sequence_key,fn1_sequence_key_scheduling[j][0])!=0) { | |
| 566 | aux = fn1_sequence_key_scheduling[j][1]%24; | |
| 567 | aux2 = fn1_sequence_key_scheduling[j][1]/24; | |
| 568 | fn1_subkeys[aux2] ^= (1<<aux); | |
| 603 | 569 | } |
| 604 | 570 | } |
| 605 | 571 | |
| 606 | for (j = 0; j < 16; ++j) { | |
| 607 | if (BIT(sequence_key, j) != 0) { | |
| 608 | aux = fn2_sequence_key_scheduling[j] % 24; | |
| 609 | aux2 = fn2_sequence_key_scheduling[j] / 24; | |
| 610 | fn2_subkeys[aux2] ^= (1 << aux); | |
| 572 | for (j=0; j<16; ++j) { | |
| 573 | if (BIT(sequence_key,j)!=0) { | |
| 574 | aux = fn2_sequence_key_scheduling[j]%24; | |
| 575 | aux2 = fn2_sequence_key_scheduling[j]/24; | |
| 576 | fn2_subkeys[aux2] ^= (1<<aux); | |
| 611 | 577 | } |
| 612 | 578 | } |
| 613 | 579 | |
| 580 | // subkeys bits 10 & 41 | |
| 581 | fn2_subkeys[0] ^= (BIT(sequence_key,2)<<10); | |
| 582 | fn2_subkeys[1] ^= (BIT(sequence_key,4)<<17); | |
| 614 | 583 | /**************************************************************/ |
| 615 | 584 | |
| 616 | 585 | // First Feistel Network |
| 617 | 586 | |
| 618 | aux = BITSWAP16(counter, | |
| 587 | aux = BITSWAP16(counter,5,12,14,13,9,3,6,4, 8,1,15,11,0,7,10,2); | |
| 619 | 588 | |
| 620 | 589 | // 1st round |
| 621 | 590 | B = aux >> 8; |
| 622 | A = (aux & 0xff) ^ feistel_function(B, | |
| 591 | A = (aux & 0xff) ^ feistel_function(B,fn1_sboxes[0],fn1_subkeys[0]); | |
| 623 | 592 | |
| 624 | 593 | // 2nd round |
| 625 | B | |
| 594 | B = B ^ feistel_function(A,fn1_sboxes[1],fn1_subkeys[1]); | |
| 626 | 595 | |
| 627 | 596 | // 3rd round |
| 628 | A | |
| 597 | A = A ^ feistel_function(B,fn1_sboxes[2],fn1_subkeys[2]); | |
| 629 | 598 | |
| 630 | 599 | // 4th round |
| 631 | B | |
| 600 | B = B ^ feistel_function(A,fn1_sboxes[3],fn1_subkeys[3]); | |
| 632 | 601 | |
| 633 | middle_result = (B | |
| 602 | middle_result = (B<<8)|A; | |
| 634 | 603 | |
| 635 | 604 | |
| 636 | 605 | /* Middle-result-key sheduling */ |
| 637 | for (j = 0; j < 16; ++j) { | |
| 638 | if (BIT(middle_result, j) != 0) { | |
| 639 | aux = fn2_middle_result_scheduling[j] % 24; | |
| 640 | aux2 = fn2_middle_result_scheduling[j] / 24; | |
| 641 | fn2_subkeys[aux2] ^= (1 << aux); | |
| 606 | for (j=0; j<16; ++j) { | |
| 607 | if (BIT(middle_result,j)!=0) { | |
| 608 | aux = fn2_middle_result_scheduling[j]%24; | |
| 609 | aux2 = fn2_middle_result_scheduling[j]/24; | |
| 610 | fn2_subkeys[aux2] ^= (1<<aux); | |
| 642 | 611 | } |
| 643 | 612 | } |
| 644 | 613 | /*********************/ |
| 645 | 614 | |
| 646 | 615 | // Second Feistel Network |
| 647 | 616 | |
| 648 | aux = BITSWAP16(data, | |
| 617 | aux = BITSWAP16(data,14,3,8,12,13,7,15,4, 6,2,9,5,11,0,1,10); | |
| 649 | 618 | |
| 650 | 619 | // 1st round |
| 651 | 620 | B = aux >> 8; |
| 652 | A = (aux & 0xff) ^ feistel_function(B, | |
| 621 | A = (aux & 0xff) ^ feistel_function(B,fn2_sboxes[0],fn2_subkeys[0]); | |
| 653 | 622 | |
| 654 | 623 | // 2nd round |
| 655 | B | |
| 624 | B = B ^ feistel_function(A,fn2_sboxes[1],fn2_subkeys[1]); | |
| 656 | 625 | |
| 657 | 626 | // 3rd round |
| 658 | A | |
| 627 | A = A ^ feistel_function(B,fn2_sboxes[2],fn2_subkeys[2]); | |
| 659 | 628 | |
| 660 | 629 | // 4th round |
| 661 | B | |
| 630 | B = B ^ feistel_function(A,fn2_sboxes[3],fn2_subkeys[3]); | |
| 662 | 631 | |
| 663 | aux = (B | |
| 632 | aux = (B<<8)|A; | |
| 664 | 633 | |
| 665 | aux = BITSWAP16(aux, | |
| 634 | aux = BITSWAP16(aux,15,7,6,14,13,12,5,4, 3,2,11,10,9,1,0,8); | |
| 666 | 635 | |
| 667 | 636 | return aux; |
| 668 | 637 | } |
| 669 | 638 | |
| 670 | ||
| 671 | 639 | UINT16 sega_315_5881_crypt_device::get_decrypted_16() |
| 672 | 640 | { |
| 673 | 641 | UINT16 enc; |
| r243192 | r243193 | |
| 679 | 647 | dec_hist = dec; |
| 680 | 648 | |
| 681 | 649 | prot_cur_address ++; |
| 682 | ||
| 683 | // printf("get_decrypted_16 %04x\n", res); | |
| 684 | ||
| 685 | 650 | return res; |
| 686 | 651 | } |
| 687 | 652 | |
| 688 | ||
| 689 | 653 | void sega_315_5881_crypt_device::enc_start() |
| 690 | 654 | { |
| 691 | block_pos = 0; | |
| 692 | done_compression = 0; | |
| 693 | 655 | buffer_pos = BUFFER_SIZE; |
| 694 | ||
| 695 | if (buffer_bit2 != 15) // if we have remaining bits in the decompression buffer we shouldn't read the next word yet but should instead use the bits we have?? (twcup98) (might just be because we should be pulling bytes not words?) | |
| 696 | { | |
| 697 | // printf("buffer_bit2 is %d\n", buffer_bit2); | |
| 698 | dec_header = (buffer2a & 0x0003) << 16; | |
| 699 | } | |
| 700 | else | |
| 701 | { | |
| 702 | dec_hist = 0; // seems to be needed by astrass at least otherwise any call after the first one will be influenced by the one before it. | |
| 703 | dec_header = get_decrypted_16() << 16; | |
| 704 | } | |
| 705 | ||
| 656 | dec_header = get_decrypted_16() << 16; | |
| 706 | 657 | dec_header |= get_decrypted_16(); |
| 707 | 658 | |
| 708 | // the lower header bits are 2 values that multiply together to get the current stream length | |
| 709 | // in astrass the first block is 0xffff (for a 0x10000 block) followed by 0x3f3f (for a 0x1000 block) | |
| 710 | // etc. after each block a new header must be read, it looks like compressed and uncompressed blocks | |
| 711 | // can be mixed like this, I don't know if the length is src length of decompressed length. | |
| 712 | // deathcox and others confirm format as 0x20000 bit as compressed bit, 0x1ff00 bits as block size 1, 0x000ff bits as block size 2 | |
| 713 | // for compressed streams the 'line size' is block size 1. | |
| 714 | ||
| 715 | block_numlines = ((dec_header & 0x000000ff) >> 0) + 1; | |
| 716 | int blocky = ((dec_header & 0x0001ff00) >> 8) + 1; | |
| 717 | block_size = block_numlines * blocky; | |
| 718 | ||
| 719 | 659 | if(dec_header & FLAG_COMPRESSED) { |
| 720 | line_buffer_size = | |
| 660 | line_buffer_size = dec_header & FLAG_LINE_SIZE_512 ? 512 : 256; | |
| 721 | 661 | line_buffer_pos = line_buffer_size; |
| 722 | 662 | buffer_bit = 7; |
| 723 | buffer_bit2 = 15; | |
| 724 | 663 | } |
| 725 | ||
| 726 | printf("header %08x\n", dec_header); | |
| 727 | 664 | enc_ready = true; |
| 728 | 665 | } |
| 729 | 666 | |
| r243192 | r243193 | |
| 734 | 671 | UINT16 val = get_decrypted_16(); |
| 735 | 672 | buffer[i] = val; |
| 736 | 673 | buffer[i+1] = val >> 8; |
| 737 | block_pos+=2; | |
| 738 | ||
| 739 | if (!(dec_header & FLAG_COMPRESSED)) | |
| 740 | { | |
| 741 | if (block_pos == block_size) | |
| 742 | { | |
| 743 | // if we reach the size specified we need to read a new header | |
| 744 | // todo: for compressed blocks this depends on OUTPUT size, not input size, so things get messy | |
| 745 | ||
| 746 | enc_start(); | |
| 747 | } | |
| 748 | } | |
| 749 | 674 | } |
| 750 | 675 | buffer_pos = 0; |
| 751 | 676 | } |
| r243192 | r243193 | |
| 824 | 749 | |
| 825 | 750 | int sega_315_5881_crypt_device::get_compressed_bit() |
| 826 | 751 | { |
| 827 | // if(buffer_pos == BUFFER_SIZE) | |
| 828 | // enc_fill(); | |
| 829 | ||
| 830 | if (buffer_bit2 == 15) | |
| 831 | { | |
| 832 | buffer_bit2 = 0; | |
| 833 | buffer2a = get_decrypted_16(); | |
| 834 | buffer2[0] = buffer2a; | |
| 835 | buffer2[1] = buffer2a >> 8; | |
| 836 | // block_pos+=2; | |
| 837 | buffer_pos = 0; | |
| 838 | ||
| 839 | } | |
| 840 | else | |
| 841 | { | |
| 842 | buffer_bit2++; | |
| 843 | } | |
| 844 | ||
| 845 | // if (buffer_bit ==7) printf("using byte %02x\n", buffer2[(buffer_pos&1) ^ 1]); | |
| 846 | ||
| 847 | int res = (buffer2[(buffer_pos&1)^1] >> buffer_bit) & 1; | |
| 752 | if(buffer_pos == BUFFER_SIZE) | |
| 753 | enc_fill(); | |
| 754 | int res = (buffer[buffer_pos^1] >> buffer_bit) & 1; | |
| 848 | 755 | buffer_bit--; |
| 849 | 756 | if(buffer_bit == -1) { |
| 850 | 757 | buffer_bit = 7; |
| r243192 | r243193 | |
| 852 | 759 | } |
| 853 | 760 | return res; |
| 854 | 761 | } |
| 762 | ||
| 855 | 763 | void sega_315_5881_crypt_device::line_fill() |
| 856 | 764 | { |
| 857 | 765 | assert(line_buffer_pos == line_buffer_size); |
| r243192 | r243193 | |
| 861 | 769 | line_buffer_prev = lp; |
| 862 | 770 | line_buffer_pos = 0; |
| 863 | 771 | |
| 772 | UINT32 line_buffer_mask = line_buffer_size-1; | |
| 773 | ||
| 864 | 774 | for(int i=0; i != line_buffer_size;) { |
| 865 | 775 | // vlc 0: start of line |
| 866 | 776 | // vlc 1: interior of line |
| r243192 | r243193 | |
| 883 | 793 | static int offsets[4] = {0, 1, 0, -1}; |
| 884 | 794 | int offset = offsets[(tmp & 0x18) >> 3]; |
| 885 | 795 | for(int j=0; j != count; j++) { |
| 886 | lc[i^1] = lp[((i+offset) | |
| 796 | lc[i^1] = lp[((i+offset) & line_buffer_mask)^1]; | |
| 887 | 797 | i++; |
| 888 | 798 | } |
| 889 | 799 | |
| r243192 | r243193 | |
| 904 | 814 | } |
| 905 | 815 | } |
| 906 | 816 | } |
| 907 | ||
| 908 | block_pos++; | |
| 909 | if (block_numlines == block_pos) | |
| 910 | { | |
| 911 | done_compression = 1; | |
| 912 | } | |
| 913 | else | |
| 914 | { | |
| 915 | } | |
| 916 | 817 | } |
| r243192 | r243193 | |
|---|---|---|
| 23 | 23 | void set_addr_low(UINT16 data); |
| 24 | 24 | void set_addr_high(UINT16 data); |
| 25 | 25 | void set_subkey(UINT16 data); |
| 26 | void set_key(UINT32 data); | |
| 26 | 27 | |
| 27 | 28 | sega_m2_read_delegate m_read; |
| 28 | 29 | |
| r243192 | r243193 | |
| 39 | 40 | private: |
| 40 | 41 | |
| 41 | 42 | enum { |
| 42 | // BUFFER_SIZE = 32768, LINE_SIZE = 512, | |
| 43 | BUFFER_SIZE = 2, LINE_SIZE = 512, // this should be a stream, without any 'BUFFER_SIZE' ? I guess the SH4 DMA implementation isn't on a timer tho? | |
| 44 | FLAG_COMPRESSED = 0x20000 | |
| 43 | BUFFER_SIZE = 32768, LINE_SIZE = 512, | |
| 44 | FLAG_COMPRESSED = 0x10000, FLAG_LINE_SIZE_512 = 0x20000 | |
| 45 | 45 | }; |
| 46 | 46 | |
| 47 | 47 | UINT32 key; |
| r243192 | r243193 | |
| 53 | 53 | |
| 54 | 54 | bool enc_ready; |
| 55 | 55 | |
| 56 | int buffer_pos, line_buffer_pos, line_buffer_size, buffer_bit, buffer_bit2; | |
| 57 | UINT8 buffer2[2]; | |
| 58 | UINT16 buffer2a; | |
| 56 | int buffer_pos, line_buffer_pos, line_buffer_size, buffer_bit; | |
| 59 | 57 | |
| 60 | int block_size; | |
| 61 | int block_pos; | |
| 62 | int block_numlines; | |
| 63 | int done_compression; | |
| 64 | ||
| 65 | 58 | struct sbox { |
| 66 | 59 | UINT8 table[64]; |
| 67 | 60 | int inputs[6]; // positions of the inputs bits, -1 means no input except from key |
| r243192 | r243193 | |
| 71 | 64 | static const sbox fn1_sboxes[4][4]; |
| 72 | 65 | static const sbox fn2_sboxes[4][4]; |
| 73 | 66 | |
| 74 | static const int FN1GK = 38; | |
| 75 | static const int FN2GK = 32; | |
| 76 | static const int fn1_game_key_scheduling[FN1GK][2]; | |
| 77 | static const int fn2_game_key_scheduling[FN2GK][2]; | |
| 67 | static const int fn1_game_key_scheduling[38][2]; | |
| 68 | static const int fn2_game_key_scheduling[34][2]; | |
| 78 | 69 | static const int fn1_sequence_key_scheduling[20][2]; |
| 79 | 70 | static const int fn2_sequence_key_scheduling[16]; |
| 80 | 71 | static const int fn2_middle_result_scheduling[16]; |
| r243192 | r243193 | |
|---|---|---|
| 364 | 364 | RAM[0x1af] = 0x60; /* RTS prot area */ |
| 365 | 365 | RAM[0x1db] = 0x60; /* RTS prot area */ |
| 366 | 366 | RAM[0x21a] = 0x60; /* RTS prot area */ |
| 367 | ||
| 367 | ||
| 368 | 368 | save_item(NAME(m_hippodrm_msb)); |
| 369 | 369 | save_item(NAME(m_hippodrm_lsb)); |
| 370 | 370 | } |
| r243192 | r243193 | |
| 377 | 377 | /* Slyspy sound cpu has some protection */ |
| 378 | 378 | RAM[0xf2d] = 0xea; |
| 379 | 379 | RAM[0xf2e] = 0xea; |
| 380 | ||
| 380 | ||
| 381 | 381 | save_item(NAME(m_slyspy_state)); |
| 382 | 382 | } |
| 383 | 383 |
| r0 | r243193 | |
|---|---|---|
| 1 | /* The Decathlete 'protection' seems to be some kind of Huffman style compression on the graphics, | |
| 2 | the game uploads 2 dictionary tables (for different areas of the ROM) as well as an additional | |
| 3 | table with each one. The secondary table doesn't initially appear to be the data needed to | |
| 4 | build the trees required for decompression */ | |
| 5 | ||
| 6 | #include "emu.h" | |
| 7 | #include "includes/stv.h" | |
| 8 | ||
| 9 | /************************** | |
| 10 | * | |
| 11 | * Decathlete | |
| 12 | * | |
| 13 | **************************/ | |
| 14 | ||
| 15 | READ32_MEMBER( stv_state::decathlt_prot_r ) | |
| 16 | { | |
| 17 | // the offsets written to the protection device definitely only refer to 2 of the roms | |
| 18 | // it's a fair assumption to say that only those 2 are connected to the protection device | |
| 19 | UINT8 *ROM = (UINT8 *)memregion("abus")->base()+0x1000000; | |
| 20 | UINT32 *fake0 = (UINT32*)memregion( "fake0" )->base(); | |
| 21 | ||
| 22 | if (offset==2) | |
| 23 | { | |
| 24 | UINT32 retvalue = 0xffff; | |
| 25 | ||
| 26 | switch (m_decathlt_protregs[0]) | |
| 27 | { | |
| 28 | default: | |
| 29 | retvalue = ROM[(m_decathlt_protregs[0]*2)-2]; | |
| 30 | retvalue <<= 8; | |
| 31 | retvalue |= ROM[((m_decathlt_protregs[0]+1)*2)+1-2]; | |
| 32 | retvalue <<= 8; | |
| 33 | retvalue |= ROM[((m_decathlt_protregs[0]+1)*2)-2]; | |
| 34 | retvalue <<= 8; | |
| 35 | retvalue |= ROM[((m_decathlt_protregs[0]+2)*2)+1-2]; | |
| 36 | m_decathlt_lastcount++; | |
| 37 | logerror("read addr %08x, blah_r %08x - read count count %08x\n", m_decathlt_protregs[0], retvalue, m_decathlt_lastcount*4); | |
| 38 | m_decathlt_protregs[0]+=2; | |
| 39 | return retvalue; | |
| 40 | ||
| 41 | case 0x03228e4: | |
| 42 | if (fake0) retvalue = fake0[(((0x20080/4)+m_decathlt_lastcount))]; | |
| 43 | m_decathlt_lastcount++; | |
| 44 | return retvalue; | |
| 45 | ||
| 46 | case 0x00a9f3a: | |
| 47 | if (fake0) retvalue = fake0[(((0x00000/4)+m_decathlt_lastcount))]; | |
| 48 | m_decathlt_lastcount++; | |
| 49 | return retvalue; | |
| 50 | ||
| 51 | case 0x0213ab4: | |
| 52 | if (fake0) retvalue = fake0[(((0x40000/4)+m_decathlt_lastcount))]; | |
| 53 | m_decathlt_lastcount++; | |
| 54 | return retvalue; | |
| 55 | ||
| 56 | case 0x01efaf0: | |
| 57 | if (fake0) retvalue = fake0[(((0x60000/4)+m_decathlt_lastcount))]; | |
| 58 | m_decathlt_lastcount++; | |
| 59 | return retvalue; | |
| 60 | ||
| 61 | case 0x033f16c: | |
| 62 | case 0x038929c: | |
| 63 | ||
| 64 | ||
| 65 | ||
| 66 | case 0x00de05a: | |
| 67 | case 0x0334258: | |
| 68 | case 0x019fb82: | |
| 69 | case 0x033dbf6: | |
| 70 | case 0x0011ac6: | |
| 71 | case 0x00060dc: | |
| 72 | case 0x0000002: | |
| 73 | case 0x0008c90: | |
| 74 | case 0x035cdc8: | |
| 75 | case 0x0327960: | |
| 76 | case 0x0329b8c: | |
| 77 | case 0x00d6e92: | |
| 78 | case 0x000081e: | |
| 79 | case 0x00035d6: | |
| 80 | case 0x00089a6: | |
| 81 | case 0x03315f4: | |
| 82 | case 0x0023fe0: | |
| 83 | case 0x001e290: | |
| 84 | case 0x0026e86: | |
| 85 | case 0x0012494: | |
| 86 | case 0x001b35a: | |
| 87 | case 0x0018424: | |
| 88 | ||
| 89 | return retvalue; | |
| 90 | } | |
| 91 | ||
| 92 | ||
| 93 | } | |
| 94 | else | |
| 95 | { | |
| 96 | logerror("%06x Decathlete prot R offset %04x mask %08x regs %08x, %08x, %08x, %08x\n", safe_pc(), offset, mem_mask, m_decathlt_protregs[0], m_decathlt_protregs[1], m_decathlt_protregs[2], m_decathlt_protregs[3]); | |
| 97 | } | |
| 98 | ||
| 99 | return m_decathlt_protregs[offset]; | |
| 100 | } | |
| 101 | ||
| 102 | ||
| 103 | void stv_state::write_prot_data(UINT32 data, UINT32 mem_mask, int offset, int which) | |
| 104 | { | |
| 105 | m_decathlt_protregs[offset] = (data&mem_mask)|(m_decathlt_protregs[offset]&~mem_mask); | |
| 106 | // m_decathlt_protregs[0] = 0x0c00000/4; | |
| 107 | ||
| 108 | if (offset==0) // seems to set a (scrambled?) source address | |
| 109 | { | |
| 110 | m_decathlt_part ^=1; | |
| 111 | ||
| 112 | //if (m_decathlt_part==0) logerror("%d, last read count was %06x\n",which, m_decathlt_lastcount*4); | |
| 113 | m_decathlt_lastcount = 0; | |
| 114 | if (m_decathlt_part==1) logerror("%d Decathlete prot W offset %04x data %08x, %08x, >>> regs %08x <<<<, %08x, %08x, %08x\n",which, offset, data, m_decathlt_protregs[0], m_decathlt_protregs[0]*4, m_decathlt_protregs[1], m_decathlt_protregs[2], m_decathlt_protregs[3]); | |
| 115 | } | |
| 116 | ||
| 117 | if (offset==1) // uploads 2 tables... | |
| 118 | { | |
| 119 | if (mem_mask==0xffff0000) | |
| 120 | { | |
| 121 | if (data == 0x80000000) | |
| 122 | { | |
| 123 | // logerror("changed to upload mode 1\n"); | |
| 124 | m_decathlt_prot_uploadmode = 1; | |
| 125 | m_decathlt_prot_uploadoffset = 0; | |
| 126 | } | |
| 127 | else if (data == 0x80800000) | |
| 128 | { | |
| 129 | // logerror("changed to upload mode 2\n"); | |
| 130 | m_decathlt_prot_uploadmode = 2; | |
| 131 | m_decathlt_prot_uploadoffset = 0; | |
| 132 | } | |
| 133 | else | |
| 134 | { | |
| 135 | // logerror("unknown upload mode\n"); | |
| 136 | m_decathlt_prot_uploadmode = 2; | |
| 137 | m_decathlt_prot_uploadoffset = 0; | |
| 138 | } | |
| 139 | ||
| 140 | // logerror("ARGH! %08x %08x\n",mem_mask,data); | |
| 141 | } | |
| 142 | else if (mem_mask==0x0000ffff) | |
| 143 | { | |
| 144 | if (m_decathlt_prot_uploadmode==1) | |
| 145 | { | |
| 146 | if (m_decathlt_prot_uploadoffset>=24) | |
| 147 | { | |
| 148 | // logerror("upload mode 1 error, too big\n"); | |
| 149 | return; | |
| 150 | } | |
| 151 | ||
| 152 | //logerror("uploading table 1 %04x %04x\n",m_decathlt_prot_uploadoffset, data&0xffff); | |
| 153 | m_decathlt_prottable1[m_decathlt_prot_uploadoffset]=data&0xffff; | |
| 154 | m_decathlt_prot_uploadoffset++; | |
| 155 | ||
| 156 | { | |
| 157 | /* 0x18 (24) values in this table, rom data is 0x1800000 long, maybe it has | |
| 158 | something to do with that? or 24-address bits? | |
| 159 | ||
| 160 | uploaded values appear to be 12-bit, some are repeated | |
| 161 | */ | |
| 162 | ||
| 163 | { | |
| 164 | FILE* fp; | |
| 165 | if (which==1) fp = fopen("table1x","wb"); | |
| 166 | else fp = fopen("table1","wb"); | |
| 167 | ||
| 168 | { | |
| 169 | fwrite(&m_decathlt_prottable1,24,2,fp); | |
| 170 | } | |
| 171 | fclose(fp); | |
| 172 | } | |
| 173 | } | |
| 174 | ||
| 175 | } | |
| 176 | else if (m_decathlt_prot_uploadmode==2) | |
| 177 | { | |
| 178 | if (m_decathlt_prot_uploadoffset>=128) | |
| 179 | { | |
| 180 | //logerror("upload mode 2 error, too big\n"); | |
| 181 | return; | |
| 182 | } | |
| 183 | ||
| 184 | //logerror("uploading table 2 %04x %04x\n",m_decathlt_prot_uploadoffset, data&0xffff); | |
| 185 | m_decathlt_prottable2[m_decathlt_prot_uploadoffset]=data&0xffff; | |
| 186 | m_decathlt_prot_uploadoffset++; | |
| 187 | ||
| 188 | { | |
| 189 | /* the table uploaded here is a 256 byte table with 256 unique values, remaps something? */ | |
| 190 | ||
| 191 | { | |
| 192 | FILE* fp; | |
| 193 | if (which==1) fp = fopen("table2x","wb"); | |
| 194 | else fp = fopen("table2","wb"); | |
| 195 | ||
| 196 | { | |
| 197 | fwrite(&m_decathlt_prottable2,128,2,fp); | |
| 198 | } | |
| 199 | fclose(fp); | |
| 200 | } | |
| 201 | } | |
| 202 | } | |
| 203 | else | |
| 204 | { | |
| 205 | // logerror("unknown upload mode!\n"); | |
| 206 | } | |
| 207 | } | |
| 208 | } | |
| 209 | ||
| 210 | if (offset>1) | |
| 211 | { | |
| 212 | // logerror("higher offset write\n"); | |
| 213 | } | |
| 214 | ||
| 215 | } | |
| 216 | ||
| 217 | WRITE32_MEMBER( stv_state::decathlt_prot1_w ) | |
| 218 | { | |
| 219 | write_prot_data(data,mem_mask, offset, 0); | |
| 220 | ||
| 221 | } | |
| 222 | ||
| 223 | WRITE32_MEMBER( stv_state::decathlt_prot2_w ) | |
| 224 | { | |
| 225 | write_prot_data(data,mem_mask, offset, 1); | |
| 226 | ||
| 227 | ||
| 228 | } | |
| 229 | ||
| 230 | void stv_state::install_decathlt_protection() | |
| 231 | { | |
| 232 | /* It uploads 2 tables here, then performs what looks like a number of transfers, setting | |
| 233 | a source address of some kind (scrambled?) and then making many reads from a single address */ | |
| 234 | memset(m_decathlt_protregs, 0, sizeof(m_decathlt_protregs)); | |
| 235 | m_decathlt_lastcount = 0; | |
| 236 | m_decathlt_prot_uploadmode = 0; | |
| 237 | m_decathlt_prot_uploadoffset = 0; | |
| 238 | m_decathlt_part = 1; | |
| 239 | m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x37FFFF0, 0x37FFFFF, read32_delegate(FUNC(stv_state::decathlt_prot_r), this), write32_delegate(FUNC(stv_state::decathlt_prot1_w), this)); | |
| 240 | /* It accesses the device at this address too, with different tables, for the game textures, should it just act like a mirror, or a secondary device? */ | |
| 241 | m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x27FFFF0, 0x27FFFFF, read32_delegate(FUNC(stv_state::decathlt_prot_r), this), write32_delegate(FUNC(stv_state::decathlt_prot2_w), this)); | |
| 242 | } |
| r243192 | r243193 | |
|---|---|---|
| 144 | 144 | |
| 145 | 145 | bool sega_837_13551::swoutputs(UINT8 count, const UINT8 *vals) |
| 146 | 146 | { |
| 147 | // WARNING! JVS standard have reversed bits count order | |
| 148 | // so "board have 6 output bits" means 6 MSB bits is used, the same rules for input too | |
| 149 | 147 | if(count > 1) |
| 150 | 148 | return false; |
| 151 | jvs_outputs = vals[0] & 0xf | |
| 149 | jvs_outputs = vals[0] & 0x3f; | |
| 152 | 150 | logerror("837-13551: output %02x\n", jvs_outputs); |
| 153 | ioport(port_tag[11])->write_safe(jvs_outputs, 0xf | |
| 151 | ioport(port_tag[11])->write_safe(jvs_outputs, 0x3f); | |
| 154 | 152 | return true; |
| 155 | 153 | } |
| 156 | 154 |
| r243192 | r243193 | |
|---|---|---|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | |
| 76 | ||
| 76 | 77 | /************************************* |
| 77 | 78 | * |
| 79 | * Generic input ports | |
| 80 | * | |
| 81 | *************************************/ | |
| 82 | ||
| 83 | IOPORT_ARRAY_MEMBER(midtunit_state::tunit_ports) { "IN0", "IN1", "IN2", "DSW" }; | |
| 84 | ||
| 85 | READ16_MEMBER(midtunit_state::midtunit_input_r) | |
| 86 | { | |
| 87 | return m_ports[offset]->read(); | |
| 88 | } | |
| 89 | ||
| 90 | ||
| 91 | ||
| 92 | /************************************* | |
| 93 | * | |
| 78 | 94 | * Mortal Kombat (T-unit) protection |
| 79 | 95 | * |
| 80 | 96 | *************************************/ |
| r243192 | r243193 | |
|---|---|---|
| 103 | 103 | save_item(NAME(irq_enable)); |
| 104 | 104 | save_item(NAME(irq_pending)); |
| 105 | 105 | save_item(NAME(maple_irqlevel)); |
| 106 | ||
| 107 | // patch out MIE RAM test | |
| 108 | // TODO: figure out why SH4 code doesn't wait long enough for internal firmware's RAM test completed in the case of reset | |
| 109 | UINT32 *rom = (UINT32*)memregion("mie")->base(); | |
| 110 | rom[0x144/4] = 0x0001d8c3; | |
| 111 | 106 | } |
| 112 | 107 | |
| 113 | 108 | void mie_device::device_reset() |
| r243192 | r243193 | |
| 169 | 164 | control |= CTRL_TFB|CTRL_EMP; |
| 170 | 165 | } |
| 171 | 166 | } |
| 172 | if(control & CTRL_HRES) { | |
| 173 | raise_irq(maple_irqlevel); | |
| 174 | } | |
| 175 | 167 | } |
| 176 | 168 | |
| 177 | 169 | void mie_device::maple_w(const UINT32 *data, UINT32 in_size) |
| 178 | 170 | { |
| 179 | 171 | memcpy(tbuf, data, in_size*4); |
| 180 | 172 | lreg = in_size-1; |
| 181 | // currently not known how/then CTRL_HRES is cleared after reset, lets clear it at packet receive | |
| 182 | control &= ~(CTRL_HRES|CTRL_TXB|CTRL_TFB|CTRL_RFB|CTRL_BFOV); | |
| 173 | control &= ~(CTRL_TXB|CTRL_TFB|CTRL_RFB|CTRL_BFOV); | |
| 183 | 174 | control |= CTRL_RXB; |
| 184 | 175 | |
| 185 | 176 | timer->adjust(attotime::from_usec(20)); |
| r243192 | r243193 | |
| 366 | 357 | |
| 367 | 358 | void mie_device::maple_reset() |
| 368 | 359 | { |
| 369 | control &= ~(CTRL_RXB|CTRL_TXB|CTRL_TFB|CTRL_RFB|CTRL_BFOV); | |
| 370 | control |= CTRL_HRES; | |
| 371 | ||
| 372 | timer->adjust(attotime::from_usec(20)); | |
| 360 | // ignoring reset maple pattern is HUGE HACK | |
| 361 | // current implementation works only because of in such case procedure of firmware upload by games will be skipped at all | |
| 362 | // so in better case - inputs doesnt work if game uses very different firmware version than already uploaded by BIOS, in worst case - game hang/reboot | |
| 363 | // TODO: figure out why game code doesn't wait long enough for internal firmware's RAM test completed in the case of proper reset | |
| 373 | 364 | } |
| r243192 | r243193 | |
|---|---|---|
| 192 | 192 | { |
| 193 | 193 | //m_maincpu->space(AS_PROGRAM).install_read_handler(0xc2ad238, 0xc2ad23f, read64_delegate(FUNC(naomi_state::naomi_biose_idle_skip_r),this); // rev e bios |
| 194 | 194 | m_maincpu->space(AS_PROGRAM).install_read_handler(0xc2b0600, 0xc2b0607, read64_delegate(FUNC(naomi_state::naomi_biosh_idle_skip_r),this)); // rev h bios |
| 195 | jvsboard_type = JVSBD_DEFAULT; | |
| 195 | 196 | actel_id = 0xffff; |
| 196 | 197 | |
| 197 | 198 | create_pic_from_retdat(); |
| r243192 | r243193 | |
| 200 | 201 | DRIVER_INIT_MEMBER(naomi_state,naomi2) |
| 201 | 202 | { |
| 202 | 203 | m_maincpu->space(AS_PROGRAM).install_read_handler(0xc2b0600, 0xc2b0607, read64_delegate(FUNC(naomi_state::naomi2_biose_idle_skip_r),this)); // rev e bios |
| 204 | jvsboard_type = JVSBD_DEFAULT; | |
| 203 | 205 | actel_id = 0xffff; |
| 204 | 206 | |
| 205 | 207 | create_pic_from_retdat(); |
| 206 | 208 | } |
| 207 | 209 | |
| 208 | INPUT_CHANGED_MEMBER(naomi_state::naomi_mp_w) | |
| 209 | { | |
| 210 | m_mp_mux = newval; | |
| 211 | } | |
| 212 | CUSTOM_INPUT_MEMBER(naomi_state::naomi_mp_r) | |
| 213 | { | |
| 214 | const char *tagptr = (const char *)param; | |
| 215 | UINT8 retval = 0; | |
| 216 | ||
| 217 | for (int i = 0x80; i >= 0x08; i >>= 1) | |
| 218 | { | |
| 219 | if (m_mp_mux & i) | |
| 220 | retval |= ioport(tagptr)->read_safe(0); | |
| 221 | tagptr += strlen(tagptr) + 1; | |
| 222 | } | |
| 223 | return retval; | |
| 224 | } | |
| 225 | ||
| 226 | 210 | DRIVER_INIT_MEMBER(naomi_state,naomi_mp) |
| 227 | 211 | { |
| 228 | 212 | //m_maincpu->space(AS_PROGRAM).install_read_handler(0xc2ad238, 0xc2ad23f, read64_delegate(FUNC(naomi_state::naomi_biose_idle_skip_r),this); // rev e bios |
| 229 | 213 | m_maincpu->space(AS_PROGRAM).install_read_handler(0xc2b0600, 0xc2b0607, read64_delegate(FUNC(naomi_state::naomi_biosh_idle_skip_r),this)); // rev h bios |
| 214 | jvsboard_type = JVSBD_MAHJONG; | |
| 230 | 215 | actel_id = 0xffff; |
| 231 | m_mp_mux = 0; | |
| 232 | 216 | |
| 233 | 217 | create_pic_from_retdat(); |
| 234 | 218 | } |
| r243192 | r243193 | |
| 237 | 221 | { |
| 238 | 222 | m_maincpu->space(AS_PROGRAM).install_read_handler(0xc2ad238, 0xc2ad23f, read64_delegate(FUNC(naomi_state::naomi_biose_idle_skip_r),this)); // rev e bios |
| 239 | 223 | //m_maincpu->space(AS_PROGRAM).install_read_handler(0xc2b0600, 0xc2b0607, read64_delegate(FUNC(naomi_state::naomi_biosh_idle_skip_r),this)); // rev h bios |
| 224 | jvsboard_type = JVSBD_DEFAULT; | |
| 240 | 225 | actel_id = 0xffff; |
| 241 | 226 | |
| 242 | 227 | create_pic_from_retdat(); |
| r243192 | r243193 | |
| 246 | 231 | { |
| 247 | 232 | m_maincpu->space(AS_PROGRAM).install_read_handler(0xc2ad238, 0xc2ad23f, read64_delegate(FUNC(naomi_state::naomi_biose_idle_skip_r),this)); // rev e bios |
| 248 | 233 | //m_maincpu->space(AS_PROGRAM).install_read_handler(0xc2b0600, 0xc2b0607, read64_delegate(FUNC(naomi_state::naomi_biosh_idle_skip_r),this)); // rev h bios |
| 234 | jvsboard_type = JVSBD_MAHJONG; | |
| 249 | 235 | actel_id = 0xffff; |
| 250 | m_mp_mux = 0; | |
| 251 | 236 | |
| 252 | 237 | create_pic_from_retdat(); |
| 253 | 238 | } |
| r243192 | r243193 | |
|---|---|---|
| 2 | 2 | #define _NAOMIBD_H_ |
| 3 | 3 | |
| 4 | 4 | #include "machine/naomig1.h" |
| 5 | #include "machine/naomicrypt.h" | |
| 5 | 6 | |
| 6 | 7 | #define MCFG_NAOMI_BOARD_ADD(_tag, type, _eeprom_tag, _actel_tag, _irq_cb) \ |
| 7 | 8 | MCFG_NAOMI_G1_ADD(_tag, type, _irq_cb) \ |
| r0 | r243193 | |
|---|---|---|
| 1 | ||
| 2 | /* Naomi cartridge encryption | |
| 3 | ||
| 4 | see naomim1.c, naomim2.c and naomim4.c for implementation details | |
| 5 | ||
| 6 | The keys here are totally arbitrary and have nothing to do with the real keys. | |
| 7 | ||
| 8 | Atomiswave is significantly different and not listed here. | |
| 9 | Naomi GD-ROMs use DES encryption, and the keys are stored as part of the PIC dumps instead. | |
| 10 | ||
| 11 | the Naomi schemes are clearly related to CPS2 | |
| 12 | the ST-V scheme could also be related to this. | |
| 13 | ||
| 14 | */ | |
| 15 | ||
| 16 | ||
| 17 | #include "emu.h" | |
| 18 | #include "naomicrypt.h" | |
| 19 | ||
| 20 | struct game_keys | |
| 21 | { | |
| 22 | const char *name; /* game driver name */ | |
| 23 | const UINT32 key; | |
| 24 | ||
| 25 | }; | |
| 26 | ||
| 27 | static const struct game_keys keys_table[] = | |
| 28 | { | |
| 29 | // name key gameid # year | |
| 30 | // M2 | |
| 31 | { "wldkicks", 0x00ae2901 }, // 25209801 2000 | |
| 32 | { "toukon4", 0x012e2901 }, // 25349801 2000 | |
| 33 | { "ninjaslt", 0x000ca510 }, // 25469801 2000 | |
| 34 | { "ninjaslt4", 0x000ca510 }, // 25469801 2000 | |
| 35 | { "gunsur2e", 0x000680d0 }, // 25709801 2001 | |
| 36 | { "mazan", 0x000fea94 }, // 25869812 2002 | |
| 37 | { "f355twin", 0x0006efd4 }, // 834-13950 1999 | |
| 38 | { "alpiltdx", 0x00070e41 }, // 834-????? 1999 | |
| 39 | { "f355twn2", 0x001666c6 }, // 834-????? 2001 | |
| 40 | { "crzytaxi", 0x000d2f45 }, // 840-0002 1999 | |
| 41 | { "zombrvn", 0x00012b41 }, // 840-0003 1999 | |
| 42 | { "ringout", 0x000b1e40 }, // 840-0004 1999 | |
| 43 | { "alpilota", 0x00070e41 }, // 840-0005 1999 | |
| 44 | { "ggram2", 0x00074a61 }, // 840-0007 1999 | |
| 45 | { "vs2_2k", 0x00088b08 }, // 840-0010 1999 | |
| 46 | { "toyfight", 0x0002ca85 }, // 840-0011 1999 | |
| 47 | { "smlg99", 0x00048a01 }, // 840-0012 1999 | |
| 48 | { "jambo", 0x000fab95 }, // 840-0013 1999 | |
| 49 | { "vtennis", 0x0003eb15 }, // 840-0015 1999 | |
| 50 | { "derbyoc", 0x000fee35 }, // 840-0016 1999 | |
| 51 | { "otrigger", 0x000fea94 }, // 840-0017 1999 | |
| 52 | { "sgtetris", 0x0008ae51 }, // 840-0018 1999 | |
| 53 | { "dybb99", 0x00048a01 }, // 840-0019 1999 | |
| 54 | { "samba", 0x000a8b5d }, // 840-0020 1999 | |
| 55 | { "sambap", 0x000a8b5d }, // 840-0020 1999 | |
| 56 | { "virnbao", 0x00068b58 }, // 840-0021 2000 | |
| 57 | { "18wheelr", 0x0007cf54 }, // 840-0023 2000 | |
| 58 | { "marstv", 0x000b8ef5 }, // 840-0025 1999 | |
| 59 | { "vonot", 0x00010715 }, // 840-0028 2000 | |
| 60 | { "sstrkfgt", 0x00132303 }, // 840-0035 2000 | |
| 61 | { "18wheels", 0x0007cf54 }, // 840-0036 2000 | |
| 62 | { "wwfroyal", 0x001627c3 }, // 840-0040 2000 | |
| 63 | { "slasho", 0x001a66ca }, // 840-0041 2000 | |
| 64 | { "crackndj", 0x001c2347 }, // 840-0043 2000 | |
| 65 | { "csmash", 0x00103347 }, // 840-0044 2000 | |
| 66 | { "csmasho", 0x00103347 }, // 840-0044 2000 | |
| 67 | { "samba2k", 0x001702cf }, // 840-0047 2000 | |
| 68 | { "alienfnt", 0x00174343 }, // 840-0048 2001 | |
| 69 | { "alienfnta", 0x00174343 }, // 840-0048 2001 | |
| 70 | { "crackdj2", 0x00428247 }, // 840-0068 2001 | |
| 71 | { "vf4cart", 0x02ef2f96 }, // 840-0080 2002 | |
| 72 | { "pstone", 0x000e69c1 }, // 841-0001 1999 | |
| 73 | { "suchie3", 0x000368e1 }, // 841-0002 1999 | |
| 74 | { "doa2", 0x0008ad01 }, // 841-0003 1999 | |
| 75 | { "doa2m", 0x0008ad01 }, // 841-0003 1999 | |
| 76 | { "spawn", 0x00078d01 }, // 841-0005 1999 | |
| 77 | { "puyoda", 0x000acd40 }, // 841-0006 1999 | |
| 78 | { "pstone2", 0x000b8dc0 }, // 841-0008 2000 | |
| 79 | { "capsnk", 0x00000000 }, // 841-0011 2000 | |
| 80 | { "capsnka", 0x00000000 }, // 841-0011 2000 | |
| 81 | { "capsnkb", 0x00000000 }, // 841-0011 2000 | |
| 82 | { "cspike", 0x000e2010 }, // 841-0012 2000 | |
| 83 | { "ggx", 0x00076110 }, // 841-0013 2000 | |
| 84 | { "gwing2", 0x000b25d0 }, // 841-0014 2000 | |
| 85 | { "pjustic", 0x000725d0 }, // 841-0015 2000 | |
| 86 | { "deathcox", 0x000b64d0 }, // 841-0016 2000 | |
| 87 | { "gundmct", 0x000e8010 }, // 841-0017 2001 | |
| 88 | { "zerogu2", 0x0007c010 }, // 841-0020 2001 | |
| 89 | { "hmgeo", 0x00038510 }, // HMG016007 2001 | |
| 90 | // M1 | |
| 91 | { "tduno2", 0x2f6f0f8d }, // 840-0022 2000 | |
| 92 | { "qmegamis", 0x96489bcd }, // 840-0030 2000 | |
| 93 | { "gram2000", 0x3f5c807f }, // 840-0039 2000 | |
| 94 | { "vtenis2c", 0x43472d2d }, // 840-0084 2001 | |
| 95 | { "shootopl", 0xa77cf3a0 }, // 840-0098 2002 | |
| 96 | { "vf4evoct", 0xcdb05b1e }, // 840-0106 2002 | |
| 97 | { "shootpl", 0xcde98d9d }, // 840-0128 2002 | |
| 98 | { "shootplm", 0xcde98d9d }, // 840-0136 2002 | |
| 99 | { "kick4csh", 0xc9570882 }, // 840-0140 2004 | |
| 100 | { "mtkob2", 0x3892fb3a }, // 840-0150 2003 | |
| 101 | { "mvsc2", 0x7c6e8bc1 }, // 841-0007-02 2000 | |
| 102 | { NULL, 0 } // end of table | |
| 103 | }; | |
| 104 | ||
| 105 | ||
| 106 | UINT32 get_naomi_key(running_machine &machine) | |
| 107 | { | |
| 108 | const char *gamename = machine.system().name; | |
| 109 | const struct game_keys *k = &keys_table[0]; | |
| 110 | ||
| 111 | while (k->name) | |
| 112 | { | |
| 113 | if (strcmp(k->name, gamename) == 0) | |
| 114 | { | |
| 115 | // we have a proper key so return it | |
| 116 | return k->key; | |
| 117 | } | |
| 118 | ++k; | |
| 119 | } | |
| 120 | ||
| 121 | printf("get_naomi_key : KEY NOT FOUND\n"); | |
| 122 | ||
| 123 | return 0; | |
| 124 | } |
| r0 | r243193 | |
|---|---|---|
| 1 | /* naomicrypt.h */ | |
| 2 | #define USE_NAOMICRYPT 0 | |
| 3 | ||
| 4 | UINT32 get_naomi_key(running_machine &machine); |
| r243192 | r243193 | |
|---|---|---|
| 13 | 13 | naomi_m1_board::naomi_m1_board(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 14 | 14 | : naomi_board(mconfig, NAOMI_M1_BOARD, "Sega NAOMI M1 Board", tag, owner, clock, "naomi_m1_board", __FILE__) |
| 15 | 15 | { |
| 16 | key_tag = 0; | |
| 16 | 17 | } |
| 17 | 18 | |
| 19 | void naomi_m1_board::static_set_tags(device_t &device, const char *_key_tag) | |
| 20 | { | |
| 21 | naomi_m1_board &dev = downcast<naomi_m1_board &>(device); | |
| 22 | dev.key_tag = _key_tag; | |
| 23 | } | |
| 24 | ||
| 18 | 25 | READ16_MEMBER(naomi_m1_board::actel_id_r) |
| 19 | 26 | { |
| 20 | 27 | if (rombdid_tag && memregion(rombdid_tag) != NULL) |
| r243192 | r243193 | |
| 30 | 37 | { |
| 31 | 38 | naomi_board::device_start(); |
| 32 | 39 | |
| 33 | astring skey = parameter("key"); | |
| 34 | if(skey) | |
| 35 | key = strtoll(skey.cstr(), 0, 16); | |
| 36 | else | |
| 37 | { | |
| 38 | logerror("%s: Warning: key not provided\n", tag()); | |
| 39 | key = 0; | |
| 40 | } | |
| 41 | ||
| 40 | #if USE_NAOMICRYPT | |
| 41 | key = get_naomi_key(machine()); | |
| 42 | #else | |
| 43 | const UINT8 *key_data = memregion(key_tag)->base(); | |
| 44 | key = (key_data[0] << 24) | (key_data[1] << 16) | (key_data[2] << 8) | key_data[3]; | |
| 45 | #endif | |
| 42 | 46 | buffer = auto_alloc_array(machine(), UINT8, BUFFER_SIZE); |
| 43 | 47 | |
| 44 | 48 | save_pointer(NAME(buffer), BUFFER_SIZE); |
| r243192 | r243193 | |
|---|---|---|
| 3 | 3 | |
| 4 | 4 | #include "naomibd.h" |
| 5 | 5 | |
| 6 | #define MCFG_NAOMI_M1_BOARD_ADD(_tag, _eeprom_tag, _actel_tag, _irq_cb) \ | |
| 7 | MCFG_NAOMI_BOARD_ADD(_tag, NAOMI_M1_BOARD, _eeprom_tag, _actel_tag, _irq_cb) | |
| 6 | #define MCFG_NAOMI_M1_BOARD_ADD(_tag, _key_tag, _eeprom_tag, _actel_tag, _irq_cb) \ | |
| 7 | MCFG_NAOMI_BOARD_ADD(_tag, NAOMI_M1_BOARD, _eeprom_tag, _actel_tag, _irq_cb) \ | |
| 8 | naomi_m1_board::static_set_tags(*device, _key_tag); | |
| 8 | 9 | |
| 9 | 10 | class naomi_m1_board : public naomi_board |
| 10 | 11 | { |
| 11 | 12 | public: |
| 12 | 13 | naomi_m1_board(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 13 | 14 | |
| 15 | static void static_set_tags(device_t &device, const char *_key_tag); | |
| 16 | ||
| 14 | 17 | virtual DECLARE_ADDRESS_MAP(submap, 16); |
| 15 | 18 | |
| 16 | 19 | DECLARE_READ16_MEMBER(actel_id_r); |
| r243192 | r243193 | |
| 25 | 28 | |
| 26 | 29 | private: |
| 27 | 30 | enum { BUFFER_SIZE = 32768 }; |
| 31 | ||
| 32 | const char *key_tag; | |
| 28 | 33 | UINT32 key; |
| 29 | 34 | |
| 30 | 35 | UINT8 *buffer; |
| r243192 | r243193 | |
|---|---|---|
| 108 | 108 | : naomi_board(mconfig, NAOMI_M2_BOARD, "Sega NAOMI M2 Board", tag, owner, clock, "naomi_m2_board", __FILE__), |
| 109 | 109 | m_cryptdevice(*this, "segam2crypt") |
| 110 | 110 | { |
| 111 | key_tag = 0; | |
| 111 | 112 | } |
| 112 | 113 | |
| 114 | void naomi_m2_board::static_set_tags(device_t &device, const char *_key_tag) | |
| 115 | { | |
| 116 | naomi_m2_board &dev = downcast<naomi_m2_board &>(device); | |
| 117 | dev.key_tag = _key_tag; | |
| 118 | } | |
| 119 | ||
| 113 | 120 | void naomi_m2_board::device_start() |
| 114 | 121 | { |
| 115 | 122 | naomi_board::device_start(); |
| r243192 | r243193 | |
| 127 | 134 | memset(ram, 0, RAM_SIZE); |
| 128 | 135 | |
| 129 | 136 | rom_cur_address = 0; |
| 137 | ||
| 138 | #if USE_NAOMICRYPT | |
| 139 | m_cryptdevice->set_key(get_naomi_key(machine())); | |
| 140 | #else | |
| 141 | const UINT8 *key_data = memregion(key_tag)->base(); | |
| 142 | m_cryptdevice->set_key((key_data[0] << 24) | (key_data[1] << 16) | (key_data[2] << 8) | key_data[3]); | |
| 143 | #endif | |
| 130 | 144 | } |
| 131 | 145 | |
| 132 | 146 | void naomi_m2_board::board_setup_address(UINT32 address, bool is_dma) |
| r243192 | r243193 | |
|---|---|---|
| 4 | 4 | #include "naomibd.h" |
| 5 | 5 | #include "315-5881_crypt.h" |
| 6 | 6 | |
| 7 | #define MCFG_NAOMI_M2_BOARD_ADD(_tag, _key_tag, _eeprom_tag, _actel_tag, _irq_cb) \ | |
| 8 | MCFG_NAOMI_BOARD_ADD(_tag, NAOMI_M2_BOARD, _eeprom_tag, _actel_tag, _irq_cb) \ | |
| 9 | naomi_m2_board::static_set_tags(*device, _key_tag); | |
| 7 | 10 | |
| 8 | #define MCFG_NAOMI_M2_BOARD_ADD(_tag, _eeprom_tag, _actel_tag, _irq_cb) \ | |
| 9 | MCFG_NAOMI_BOARD_ADD(_tag, NAOMI_M2_BOARD, _eeprom_tag, _actel_tag, _irq_cb) | |
| 10 | ||
| 11 | 11 | class naomi_m2_board : public naomi_board |
| 12 | 12 | { |
| 13 | 13 | public: |
| r243192 | r243193 | |
| 16 | 16 | static const int RAM_SIZE = 65536; |
| 17 | 17 | UINT8* ram; |
| 18 | 18 | |
| 19 | static void static_set_tags(device_t &device, const char *_key_tag); | |
| 19 | 20 | UINT16 read_callback(UINT32 addr); |
| 20 | 21 | |
| 21 | 22 | protected: |
| r243192 | r243193 | |
| 29 | 30 | virtual void board_write(offs_t offset, UINT16 data); |
| 30 | 31 | |
| 31 | 32 | private: |
| 33 | ||
| 34 | ||
| 35 | const char *key_tag; | |
| 36 | ||
| 37 | ||
| 32 | 38 | required_device<sega_315_5881_crypt_device> m_cryptdevice; |
| 33 | 39 | }; |
| 34 | 40 |
| r243192 | r243193 | |
|---|---|---|
| 36 | 36 | |
| 37 | 37 | virtual iodevice_t image_type() const { return IO_MEMCARD; } |
| 38 | 38 | |
| 39 | virtual bool is_readable() const { return true; } | |
| 40 | virtual bool is_writeable() const { return true; } | |
| 41 | virtual bool is_creatable() const { return true; } | |
| 42 | virtual bool must_be_loaded() const { return false; } | |
| 43 | virtual bool is_reset_on_load() const { return false; } | |
| 39 | virtual bool is_readable() const { return 1; } | |
| 40 | virtual bool is_writeable() const { return 1; } | |
| 41 | virtual bool is_creatable() const { return 1; } | |
| 42 | virtual bool must_be_loaded() const { return 0; } | |
| 43 | virtual bool is_reset_on_load() const { return 0; } | |
| 44 | 44 | virtual const char *file_extensions() const { return "neo"; } |
| 45 | 45 | virtual const option_guide *create_option_guide() const { return NULL; } |
| 46 | 46 |
| r243192 | r243193 | |
|---|---|---|
| 63 | 63 | ( ( ( src ^ A ) >> 1 ) & 0x08 ) | |
| 64 | 64 | ( ~( ( src >> 6 ) ^ A ) & 0x01 ); |
| 65 | 65 | } |
| 66 | ||
| 66 | ||
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | DRIVER_INIT_MEMBER(stfight_state,stfight) |
| r243192 | r243193 | |
|---|---|---|
| 1 | /* ST-V | |
| 1 | /* ST-V protection stuff */ | |
| 2 | 2 | |
| 3 | 3 | /* |
| 4 | 4 | |
| r243192 | r243193 | |
| 11 | 11 | Steep Slope Sliders (gfx transfer of character portraits) |
| 12 | 12 | Tecmo World Cup '98 (tecmo logo, player movement) |
| 13 | 13 | |
| 14 | I think this is an encryption device. Decathlete is also protected, but uses a different device | |
| 15 | see machine/decathlt.c for details of that one, unlike this that appears to perform decompression | |
| 16 | operations. | |
| 17 | ||
| 18 | ||
| 19 | Astra Superstars data were extracted from Saturn version of the game. It is not known if | |
| 20 | protection device has data stored inside, or they are read from roms (using decryption/decompression) | |
| 21 | ||
| 14 | 22 | */ |
| 15 | 23 | |
| 24 | /**************************************************************************************** | |
| 25 | ||
| 26 | Protection & cartridge handling | |
| 27 | ||
| 28 | ***************************************************************************************** | |
| 29 | ||
| 30 | These are the known ST-V games that uses this area as a valid protection,I have written | |
| 31 | the data used by the games in the various circumstances for reference: | |
| 32 | -Astra Super Stars [astrass] | |
| 33 | [0] [1] [2] [3] | |
| 34 | 0x000y0000 0x00000000 0x06130027 0x01230000 test mode,char transfer (3) | |
| 35 | 0x???????? 0x???????? 0x???????? 0x???????? attract mode | |
| 36 | 0x000y0000 0x00000000 0x06130027 0x01230000 gameplay,char transfer (3) | |
| 37 | ||
| 38 | -Elan Doree : Legend of Dragon [elandore] | |
| 39 | [0] [1] [2] [3] | |
| 40 | No protection test mode | |
| 41 | No protection attract mode | |
| 42 | 0x000y0000 0x00000000 0x****00** 0xff7f0000 gameplay,VDP-1 write (textures on humans) | |
| 43 | 0x000y0000 0x00000000 0x****00** 0xffbf0000 gameplay,VDP-1 write (textures on humans) | |
| 44 | ||
| 45 | 0x000y0000 0x00000000 0x****00** 0xf9ff0000 gameplay,VDP-1 write (textures on dragons) | |
| 46 | 0x000y0000 0x00000000 0x****00** 0xfbff0000 gameplay,VDP-1 write (textures on dragons) | |
| 47 | 0x000y0000 0x00000000 0x****00** 0xfe7f0000 gameplay,VDP-1 write (textures on dragons) | |
| 48 | 0x000y0000 0x00000000 0x****00** 0xfd7f0000 gameplay,VDP-1 write (textures on dragons) | |
| 49 | 0x000y0000 0x00000000 0x****00** 0xfeff0000 gameplay,VDP-1 write (textures on dragons) | |
| 50 | 0x000y0000 0x00000000 0x****00** 0xf9bf0000 gameplay,VDP-1 write (textures on dragons) | |
| 51 | ||
| 52 | -Final Fight Revenge [ffreveng] | |
| 53 | [0] [1] [2] [3] | |
| 54 | 0x000y0000 0x00000000 0x4bcc0013 0x10da0000 test mode,boot vectors at $06080000 | |
| 55 | 0x000y0000 0x00000000 0x0b780013 0x10d70000 attract mode,boot vectors at $06080000 | |
| 56 | 0x???????? 0x???????? 0x???????? 0x???????? gameplay | |
| 57 | ||
| 58 | -Radiant Silvergun [rsgun] | |
| 59 | [0] [1] [2] [3] | |
| 60 | No protection test mode | |
| 61 | 0x000y0000 0x00000000 0x08000010 0x77770000 attract mode,work ram-h $60ff1ec and so on (1) | |
| 62 | 0x???????? 0x???????? 0x???????? 0x???????? gameplay | |
| 63 | ||
| 64 | -Steep Slope Sliders [sss] | |
| 65 | [0] [1] [2] [3] | |
| 66 | No protection test mode | |
| 67 | *0x000y0000 0x00000000 0x000000a6 0x2c5b0000 attract mode,VDP-1 write | |
| 68 | *0x000y0000 0x00000000 0x000000a6 0x2c5b0000 gameplay,VDP-1 write character 1 (2) | |
| 69 | *0x000y0000 0x00000000 0x0f9800a6 0x47f10000 gameplay,VDP-1 write character 2 | |
| 70 | *0x000y0000 0x00000000 0x1d4800a6 0xfcda0000 gameplay,VDP-1 write character 3 | |
| 71 | *0x000y0000 0x00000000 0x29e300a6 0xb5e60000 gameplay,VDP-1 write character 4 | |
| 72 | *0x000y0000 0x00000000 0x38e900a6 0x392c0000 gameplay,VDP-1 write character 5 | |
| 73 | *0x000y0000 0x00000000 0x462500a6 0x77c30000 gameplay,VDP-1 write character 6 | |
| 74 | *0x000y0000 0x00000000 0x555c00a6 0x8a620000 gameplay,VDP-1 write character 7 | |
| 75 | ||
| 76 | ========================================================================================= | |
| 77 | y = setted as a 0,then after the ctrl data is moved is toggled to 1 then again toggled | |
| 78 | to 0 after the reading,this bit is likely to be a "calculate protection values" | |
| 79 | if 1,use normal ram if 0. | |
| 80 | * = working checks | |
| 81 | [3,low word]AFAIK this is the cartridge area and it's read-only. | |
| 82 | (1)That area is usually (but not always) used as system registers. | |
| 83 | (2)Same as P.O.S.T. check,it was really simple to look-up because of that. | |
| 84 | (3)Wrong offset,or it requires something else like a bitswap? | |
| 85 | ========================================================================================= | |
| 86 | Protection works as a sort of data transfer,it could also be that it uses | |
| 87 | encryption on the data used... | |
| 88 | ||
| 89 | For now I'm writing this function with a command basis so I can work better with it. | |
| 90 | ****************************************************************************************/ | |
| 91 | ||
| 16 | 92 | #include "emu.h" |
| 17 | 93 | #include "includes/stv.h" |
| 18 | 94 | |
| 19 | 95 | |
| 20 | 96 | |
| 97 | /************************ | |
| 98 | * | |
| 99 | * Tecmo World Cup '98 | |
| 100 | * | |
| 101 | ************************/ | |
| 21 | 102 | |
| 103 | /* | |
| 104 | 0x200214 | |
| 105 | 0x20de94 | |
| 106 | wpset 0x200214,0x20de94-0x200214,r | |
| 107 | dump twcup98.dmp,0x200214,0x20de94-0x200214,4,0,0 | |
| 108 | protection tests the data 0x201220 at | |
| 109 | bp 0x6009a9e | |
| 110 | with 0x60651f8 | |
| 111 | */ | |
| 22 | 112 | |
| 113 | ||
| 114 | //MAIN : 12120000 DATA : 0ad20069 Tecmo logo | |
| 115 | //MAIN : 12120000 DATA : e332006b title screen | |
| 116 | // TODO: encrypted / compressed data. | |
| 117 | // Both points to a section that has a string ("TECMO" / "TITLE") | |
| 118 | ||
| 119 | ||
| 120 | /************************* | |
| 121 | * | |
| 122 | * Final Fight Revenge | |
| 123 | * | |
| 124 | *************************/ | |
| 125 | ||
| 126 | /* | |
| 127 | ffreveng protection notes | |
| 128 | Global: | |
| 129 | R2 is the vector read (where to jump to) | |
| 130 | R3 is the vector pointer | |
| 131 | ||
| 132 | Directory listing for Final Fight Revenge (Saturn Version): | |
| 133 | ||
| 134 | In the ST-V version, most of these file names could be found at relative address 0x346a0 (0x22346a0) | |
| 135 | Also, there's a table at 0x260000 (0x2260000), this points to offsets to the ROM (and are sent to the protection device), | |
| 136 | and the size of it | |
| 137 | ||
| 138 | fad size file name date | |
| 139 | 000000aa 00003000 2000/2/8 | |
| 140 | 000000aa 00003000 ? 2000/2/8 | |
| 141 | 000000b0 00076080 0;1 2000/2/8 | |
| 142 | 0001799e 014b2000 ALY.RED;1 1999/11/9 | |
| 143 | 00002350 00001900 ALYHRAM.BIN;1 2000/2/8 | |
| 144 | 0000040e 00005204 ANDEND.BIN;1 1999/11/9 | |
| 145 | 000001a0 0000c700 ANDORE.BIN;1 2000/2/8 | |
| 146 | 000003c8 00016938 ANDORE.CRT;1 1999/11/9 | |
| 147 | 000001b9 000f3528 ANDOREM.BIN;1 2000/2/8 | |
| 148 | 00003525 012db000 ATN.RED;1 1999/11/9 | |
| 149 | 000024e6 00001900 ATNHRAM.BIN;1 2000/2/8 | |
| 150 | 00013291 0120d000 ATO.RED;1 1999/11/9 | |
| 151 | 000024a0 00001100 ATOHRAM.BIN;1 2000/2/8 | |
| 152 | 00000419 0000f000 BELGER.BIN;1 2000/2/8 | |
| 153 | 000005f0 00013bdc BELGER.CRT;1 1999/11/9 | |
| 154 | 00000437 000ce990 BELGERM.BIN;1 2000/2/8 | |
| 155 | 00002611 00000894 BURGR.BIN;1 2000/2/8 | |
| 156 | 00002605 00000638 CAFFE.BIN;1 2000/2/8 | |
| 157 | 0000273b 000022e0 CAPCOM.BIN;1 1999/11/9 | |
| 158 | 00001d9a 00012100 CAPHRAM.BIN;1 2000/2/8 | |
| 159 | 00000834 00004cec CDYEND.BIN;1 1999/11/9 | |
| 160 | 0000218a 00005900 CHSHRAM.BIN;1 2000/2/8 | |
| 161 | 0000061a 0000b900 CODY.BIN;1 2000/2/8 | |
| 162 | 00000809 00014e00 CODY.CRT;1 1999/11/9 | |
| 163 | 00002857 000ff412 CODYANIM.BIN;1 1999/11/9 | |
| 164 | 00002a56 00011dbc CODYAPAL.BIN;1 1999/11/9 | |
| 165 | 00000632 000d31cc CODYM.BIN;1 2000/2/8 | |
| 166 | 00002619 0000046c CURRY.BIN;1 2000/2/8 | |
| 167 | 00000b36 00005110 DAMEND.BIN;1 1999/11/9 | |
| 168 | 0000083e 0000b300 DAMND.BIN;1 2000/2/8 | |
| 169 | 00000aa6 000181ae DAMND.CRT;1 1999/11/9 | |
| 170 | 00000855 0010c674 DAMNDM.BIN;1 2000/2/8 | |
| 171 | 00000ad9 000063c0 DDAD.BIN;1 1999/11/9 | |
| 172 | 00000b2c 00004a30 DDBL.BIN;1 1999/11/9 | |
| 173 | 00000b25 000034b4 DDCD.BIN;1 1999/11/9 | |
| 174 | 00000ae6 00004c6c DDDM.BIN;1 1999/11/9 | |
| 175 | 00000b1c 00004660 DDED.BIN;1 1999/11/9 | |
| 176 | 00000b15 00003770 DDEL.BIN;1 1999/11/9 | |
| 177 | 00000b0e 00003268 DDGY.BIN;1 1999/11/9 | |
| 178 | 00000b06 00003c74 DDHG.BIN;1 1999/11/9 | |
| 179 | 00000b00 000029a8 DDPS.BIN;1 1999/11/9 | |
| 180 | 00000af9 000035e4 DDRL.BIN;1 1999/11/9 | |
| 181 | 00000af0 000044a8 DDSD.BIN;1 1999/11/9 | |
| 182 | 0000217a 00007d00 DEMHRAM.BIN;1 2000/2/8 | |
| 183 | 0000278e 00064396 DLOOP.CRT;1 1999/11/9 | |
| 184 | 00000b41 0000e200 EDDIE.BIN;1 2000/2/8 | |
| 185 | 00000d25 00019a44 EDDIE.CRT;1 1999/11/9 | |
| 186 | 00000b5e 000c7758 EDDIEM.BIN;1 2000/2/8 | |
| 187 | 00000d5a 00005204 EDIEND.BIN;1 1999/11/9 | |
| 188 | 00000d65 0000d700 ELGADO.BIN;1 2000/2/8 | |
| 189 | 00001010 00018b2e ELGADO.CRT;1 1999/11/9 | |
| 190 | 00000d80 0012ec64 ELGADOM.BIN;1 2000/2/8 | |
| 191 | 00001043 00005204 ELGEND.BIN;1 1999/11/9 | |
| 192 | 00001d79 0000e5ec ENDING.BIN;1 1999/11/9 | |
| 193 | 00002bc3 0002e8f4 ENDING.CRT;1 1999/11/9 | |
| 194 | 0000019e 0000005d FFEXABS.TXT;1 1999/11/9 | |
| 195 | 0000019f 00000060 FFEXBIB.TXT;1 1999/11/9 | |
| 196 | 0000019d 00000032 FFEXCPY.TXT;1 1999/11/9 | |
| 197 | 00002615 0000062c FRIES.BIN;1 2000/2/8 | |
| 198 | 00001ce1 0004b8b4 GAMEL.BIN;1 1999/11/9 | |
| 199 | 000003f6 000011fc GANDRE.BIN;1 1999/11/9 | |
| 200 | 0000040b 00001246 GBEL.BIN;1 1999/11/9 | |
| 201 | 000003f9 00000af3 GCODY.BIN;1 1999/11/9 | |
| 202 | 000003fb 00000cc4 GDAM.BIN;1 1999/11/9 | |
| 203 | 000003fd 00000f6a GEDDIE.BIN;1 1999/11/9 | |
| 204 | 000003ff 00000c85 GGADO.BIN;1 1999/11/9 | |
| 205 | 00000401 00000d4c GGUY.BIN;1 1999/11/9 | |
| 206 | 00000403 00000f16 GHAG.BIN;1 1999/11/9 | |
| 207 | 00000405 00000a63 GPOISON.BIN;1 1999/11/9 | |
| 208 | 00000407 00000a85 GROL.BIN;1 1999/11/9 | |
| 209 | 00005b71 01156000 GRV.RED;1 1999/11/9 | |
| 210 | 0000243b 00001600 GRVHRAM.BIN;1 2000/2/8 | |
| 211 | 00000409 00000dad GSODOM.BIN;1 1999/11/9 | |
| 212 | 0000104e 0000c300 GUY.BIN;1 2000/2/8 | |
| 213 | 0000123a 00014844 GUY.CRT;1 1999/11/9 | |
| 214 | 00001266 00005204 GUYEND.BIN;1 1999/11/9 | |
| 215 | 00001067 000d14aa GUYM.BIN;1 2000/2/8 | |
| 216 | 00001271 0000c600 HAGGAR.BIN;1 2000/2/8 | |
| 217 | 00001489 00017ad8 HAGGAR.CRT;1 1999/11/9 | |
| 218 | 0000128a 000e46fc HAGGARM.BIN;1 2000/2/8 | |
| 219 | 000014bb 00005204 HGREND.BIN;1 1999/11/9 | |
| 220 | 00002740 0001b468 HISCORE.BIN;1 1999/11/9 | |
| 221 | 00002777 00000a00 HISCP.BIN;1 1999/11/9 | |
| 222 | 00002779 000086c0 HISCTEX.BIN;1 1999/11/9 | |
| 223 | 0000278b 00001680 HSFACE_T.BIN;1 1999/11/9 | |
| 224 | 00002607 00000618 HTDOG.BIN;1 2000/2/8 | |
| 225 | 00015741 010e3800 JNK.RED;1 1999/11/9 | |
| 226 | 000023cd 00001900 JNKHRAM.BIN;1 2000/2/8 | |
| 227 | 00002d0b 0003dfc0 KANJI.FON;1 1999/11/9 | |
| 228 | 00001d98 00000d44 LOAD.BIN;1 1999/11/9 | |
| 229 | 00001dbf 001dd5a8 LOGO.CPK;1 1999/11/9 | |
| 230 | 00002d0a 00000400 LVLHRAM.BIN;1 2000/2/8 | |
| 231 | 0000260a 000005e8 MEAT.BIN;1 2000/2/8 | |
| 232 | 00007eb3 01253800 MLK.RED;1 1999/11/9 | |
| 233 | 00002196 00000d00 MLKHRAM.BIN;1 2000/2/8 | |
| 234 | 0000278a 00000400 NAMEP.BIN;1 1999/11/9 | |
| 235 | 0000a3f0 011b8000 NPK.RED;1 1999/11/9 | |
| 236 | 000022d0 00002700 NPKHRAM.BIN;1 2000/2/8 | |
| 237 | 00010dc0 0121d800 NUK.RED;1 1999/11/9 | |
| 238 | 00002555 00001100 NUKHRAM.BIN;1 2000/2/8 | |
| 239 | 00002c21 00036f94 OVER.CRT;1 1999/11/9 | |
| 240 | 000014c6 0000ab00 POISON.BIN;1 2000/2/8 | |
| 241 | 000017f1 00018880 POISON.CRT;1 1999/11/9 | |
| 242 | 000014dc 0017617c POISONM.BIN;1 2000/2/8 | |
| 243 | 0000c7f6 01166000 PRK.RED;1 1999/11/9 | |
| 244 | 00002268 00001100 PRKHRAM.BIN;1 2000/2/8 | |
| 245 | 00002a82 00003940 PSCBCHR.BIN;1 1999/11/9 | |
| 246 | 00002a8a 00002000 PSCBMAP.BIN;1 1999/11/9 | |
| 247 | 00002a92 00000ac0 PSCRTEX.BIN;1 1999/11/9 | |
| 248 | 00002a7b 000033c0 PSFCCHR.BIN;1 1999/11/9 | |
| 249 | 00001824 000049d4 PSNEND.BIN;1 1999/11/9 | |
| 250 | 00002a8e 00001e54 PSNMCHR.BIN;1 1999/11/9 | |
| 251 | 00002a94 000037c0 PSSBCHR.BIN;1 1999/11/9 | |
| 252 | 00002a9b 00002000 PSSBMAP.BIN;1 1999/11/9 | |
| 253 | 00002a9f 00000200 PSSBPAL.BIN;1 1999/11/9 | |
| 254 | 00002a7a 00000600 PS_PAL.BIN;1 1999/11/9 | |
| 255 | 00002c8f 0003d4c0 RESIDENT.CRT;1 1999/11/9 | |
| 256 | 00001c68 0003ae40 RESTEXT.BIN;1 1999/11/9 | |
| 257 | 00001cde 00001220 RESTEXTB.BIN;1 1999/11/9 | |
| 258 | 00001d97 00000200 RETIMEPA.BIN;1 1999/11/9 | |
| 259 | 0000261b 000004e8 REVNG.BIN;1 1999/11/9 | |
| 260 | 00001a5b 00005204 ROLEND.BIN;1 1999/11/9 | |
| 261 | 0000182e 0000e700 ROLENTO.BIN;1 2000/2/8 | |
| 262 | 00001a2d 00016bfc ROLENTO.CRT;1 1999/11/9 | |
| 263 | 0000184b 000d6bf0 ROLENTOM.BIN;1 2000/2/8 | |
| 264 | 000025c5 000062e4 SDDRVS.TSK;1 1999/11/9 | |
| 265 | 00002eb3 002ee000 SEGA_WRN.DA;1 1998/4/30 | |
| 266 | 00002b82 00020492 SELECT.CRT;1 1999/11/9 | |
| 267 | 00002aa0 00070e04 SODBTEX.BIN;1 1999/11/9 | |
| 268 | 00001c5d 00005154 SODEND.BIN;1 1999/11/9 | |
| 269 | 00001a66 0000b100 SODOM.BIN;1 2000/2/8 | |
| 270 | 00001c29 0001943a SODOM.CRT;1 1999/11/9 | |
| 271 | 00001a7d 000b9e2f SODOMM.BIN;1 2000/2/8 | |
| 272 | 0000260d 000004cc SUSHI.BIN;1 2000/2/8 | |
| 273 | 0000261c 0008f204 TITLE.BIN;1 1999/11/9 | |
| 274 | 0000eb58 010e9000 WHS.RED;1 1999/11/9 | |
| 275 | 000021ff 00001100 WHSHRAM.BIN;1 2000/2/8 | |
| 276 | 000003a0 00009b90 _ADCL00.BIN;1 1999/11/9 | |
| 277 | 000003b4 00009b90 _ADCL01.BIN;1 1999/11/9 | |
| 278 | 000023cb 00000c54 _ALYBMAP.BIN;1 1999/11/9 | |
| 279 | 0000239b 00017ec0 _ALYFCHR.BIN;1 1999/11/9 | |
| 280 | 00002399 00000c1a _ALYFMAP.BIN;1 1999/11/9 | |
| 281 | 00002354 00000600 _ALYPAL.BIN;1 1999/11/9 | |
| 282 | 0000235a 0001f400 _ALYRCHR.BIN;1 1999/11/9 | |
| 283 | 00002355 0000205c _ALYRMAP.BIN;1 1999/11/9 | |
| 284 | 0000252a 00015800 _ATNBCHR.BIN;1 1999/11/9 | |
| 285 | 00002526 00001882 _ATNBMAP.BIN;1 1999/11/9 | |
| 286 | 00002525 00000416 _ATNFMAP.BIN;1 1999/11/9 | |
| 287 | 000024ea 00000600 _ATNPAL.BIN;1 1999/11/9 | |
| 288 | 000024ef 0001af00 _ATNRCHR.BIN;1 1999/11/9 | |
| 289 | 000024eb 00001d10 _ATNRMAP.BIN;1 1999/11/9 | |
| 290 | 000024e3 000017fa _ATOBMAP.BIN;1 1999/11/9 | |
| 291 | 000024e2 00000040 _ATOFCHR.BIN;1 1999/11/9 | |
| 292 | 000024e1 00000006 _ATOFMAP.BIN;1 1999/11/9 | |
| 293 | 000024a3 00000600 _ATOPAL.BIN;1 1999/11/9 | |
| 294 | 000024a9 0001bbc0 _ATORCHR.BIN;1 1999/11/9 | |
| 295 | 000024a4 00002004 _ATORMAP.BIN;1 1999/11/9 | |
| 296 | 00000618 00000a20 _BGUNTX.BIN;1 1999/11/9 | |
| 297 | 000005d5 0000d688 _BLTXURE.BIN;1 1999/11/9 | |
| 298 | 00002613 00000a80 _BURGRTX.BIN;1 1999/11/9 | |
| 299 | 00002606 000006c0 _CAFFETX.BIN;1 1999/11/9 | |
| 300 | 000007d9 0000bdb0 _CDCL00.BIN;1 1999/11/9 | |
| 301 | 000007f1 0000bdb0 _CDCL01.BIN;1 1999/11/9 | |
| 302 | 00000ad7 000008a0 _CHSAWTX.BIN;1 1999/11/9 | |
| 303 | 000025e3 00003500 _CRAT2TX.BIN;1 1999/11/9 | |
| 304 | 000025ea 00002200 _CRAT3TX.BIN;1 1999/11/9 | |
| 305 | 000025d5 00003300 _CRATDTX.BIN;1 1999/11/9 | |
| 306 | 000025dc 00003300 _CRATNTX.BIN;1 1999/11/9 | |
| 307 | 0000261a 00000500 _CURRYTX.BIN;1 1999/11/9 | |
| 308 | 00000a6e 0000d918 _DMCL00.BIN;1 1999/11/9 | |
| 309 | 00000a8a 0000d918 _DMCL01.BIN;1 1999/11/9 | |
| 310 | 000025ef 00001b60 _DRUMTX.BIN;1 1999/11/9 | |
| 311 | 00000ced 0000da3c _EDCL00.BIN;1 1999/11/9 | |
| 312 | 00000d09 0000da3c _EDCL01.BIN;1 1999/11/9 | |
| 313 | 00000fde 0000c404 _ELCL00.BIN;1 1999/11/9 | |
| 314 | 00000ff7 0000c404 _ELCL01.BIN;1 1999/11/9 | |
| 315 | 00002616 000011a0 _FRIESTX.BIN;1 1999/11/9 | |
| 316 | 00001d96 00000660 _GFNTCHR.BIN;1 1999/11/9 | |
| 317 | 00001264 00000880 _GKATATX.BIN;1 1999/11/9 | |
| 318 | 00002488 0000bcc0 _GRVBCHR.BIN;1 1999/11/9 | |
| 319 | 00002486 00000d76 _GRVBMAP.BIN;1 1999/11/9 | |
| 320 | 00002483 000010fc _GRVFMAP.BIN;1 1999/11/9 | |
| 321 | 0000243e 00000600 _GRVPAL.BIN;1 1999/11/9 | |
| 322 | 00002444 0001f4c0 _GRVRCHR.BIN;1 1999/11/9 | |
| 323 | 0000243f 00002004 _GRVRMAP.BIN;1 1999/11/9 | |
| 324 | 0000120a 0000bf44 _GYCL00.BIN;1 1999/11/9 | |
| 325 | 00001222 0000bf44 _GYCL01.BIN;1 1999/11/9 | |
| 326 | 00001453 0000d614 _HGCL00.BIN;1 1999/11/9 | |
| 327 | 0000146e 0000d614 _HGCL01.BIN;1 1999/11/9 | |
| 328 | 00002608 00000880 _HTDOGTX.BIN;1 1999/11/9 | |
| 329 | 000025f3 00002b60 _ICEBTX.BIN;1 1999/11/9 | |
| 330 | 00001042 00000560 _JKNFTX.BIN;1 1999/11/9 | |
| 331 | 00002419 00010940 _JNKBCHR.BIN;1 1999/11/9 | |
| 332 | 00002417 00000982 _JNKBMAP.BIN;1 1999/11/9 | |
| 333 | 00002414 0000113a _JNKFMAP.BIN;1 1999/11/9 | |
| 334 | 000023d1 00000600 _JNKPAL.BIN;1 1999/11/9 | |
| 335 | 000023d6 0001ee80 _JNKRCHR.BIN;1 1999/11/9 | |
| 336 | 000023d2 00001bde _JNKRMAP.BIN;1 1999/11/9 | |
| 337 | 000025d4 000006c0 _KATA2TX.BIN;1 1999/11/9 | |
| 338 | 00001c5c 00000780 _KATANTX.BIN;1 1999/11/9 | |
| 339 | 0000260b 00000cc0 _MEATTX.BIN;1 1999/11/9 | |
| 340 | 000021dd 00010e80 _MLKBCHR.BIN;1 1999/11/9 | |
| 341 | 000021db 00000be6 _MLKBMAP.BIN;1 1999/11/9 | |
| 342 | 000021d9 00000f70 _MLKFMAP.BIN;1 1999/11/9 | |
| 343 | 00002198 00000600 _MLKPAL.BIN;1 1999/11/9 | |
| 344 | 0000219c 0001e440 _MLKRCHR.BIN;1 1999/11/9 | |
| 345 | 00002199 000013de _MLKRMAP.BIN;1 1999/11/9 | |
| 346 | 0000234d 00001416 _NPKBMAP.BIN;1 1999/11/9 | |
| 347 | 0000231d 00017dc0 _NPKFCHR.BIN;1 1999/11/9 | |
| 348 | 0000231a 00001406 _NPKFMAP.BIN;1 1999/11/9 | |
| 349 | 000022d5 00000600 _NPKPAL.BIN;1 1999/11/9 | |
| 350 | 000022db 0001f640 _NPKRCHR.BIN;1 1999/11/9 | |
| 351 | 000022d6 00002202 _NPKRMAP.BIN;1 1999/11/9 | |
| 352 | 0000259a 000153c0 _NUKBCHR.BIN;1 1999/11/9 | |
| 353 | 00002596 00001924 _NUKBMAP.BIN;1 1999/11/9 | |
| 354 | 00002594 00000f6e _NUKFMAP.BIN;1 1999/11/9 | |
| 355 | 00002558 00000600 _NUKPAL.BIN;1 1999/11/9 | |
| 356 | 0000255e 0001adc0 _NUKRCHR.BIN;1 1999/11/9 | |
| 357 | 00002559 00002004 _NUKRMAP.BIN;1 1999/11/9 | |
| 358 | 000025d3 000005a0 _NYOIBTX.BIN;1 1999/11/9 | |
| 359 | 000025f9 000039e0 _OILCTX.BIN;1 1999/11/9 | |
| 360 | 000014b9 00000b40 _PIPETX.BIN;1 1999/11/9 | |
| 361 | 00001823 00000600 _POISNTX.BIN;1 1999/11/9 | |
| 362 | 000022cc 000018fc _PRKBMAP.BIN;1 1999/11/9 | |
| 363 | 000022ac 0000fd00 _PRKFCHR.BIN;1 1999/11/9 | |
| 364 | 000022a8 00001d4a _PRKFMAP.BIN;1 1999/11/9 | |
| 365 | 0000226b 00000600 _PRKPAL.BIN;1 1999/11/9 | |
| 366 | 00002271 0001b0c0 _PRKRCHR.BIN;1 1999/11/9 | |
| 367 | 0000226c 00002202 _PRKRMAP.BIN;1 1999/11/9 | |
| 368 | 000017c9 00009874 _PSCL00.BIN;1 1999/11/9 | |
| 369 | 000017dd 00009874 _PSCL01.BIN;1 1999/11/9 | |
| 370 | 00000d59 00000180 _PSTKTX.BIN;1 1999/11/9 | |
| 371 | 000019f9 0000cb2c _RLCL00.BIN;1 1999/11/9 | |
| 372 | 00001a13 0000cb2c _RLCL01.BIN;1 1999/11/9 | |
| 373 | 00001bf1 0000dd0c _SDCL00.BIN;1 1999/11/9 | |
| 374 | 00001c0d 0000dd0c _SDCL01.BIN;1 1999/11/9 | |
| 375 | 00000833 00000660 _SKNFTX.BIN;1 1999/11/9 | |
| 376 | 000025d2 00000240 _SPIKETX.BIN;1 1999/11/9 | |
| 377 | 0000260e 000011e0 _SUSHITX.BIN;1 1999/11/9 | |
| 378 | 00002601 00001ba0 _TOMBTX.BIN;1 1999/11/9 | |
| 379 | 0000224b 0000e2c0 _WHSBCHR.BIN;1 1999/11/9 | |
| 380 | 00002249 00000a36 _WHSBMAP.BIN;1 1999/11/9 | |
| 381 | 00002245 00001bb8 _WHSFMAP.BIN;1 1999/11/9 | |
| 382 | 00002202 00000600 _WHSPAL.BIN;1 1999/11/9 | |
| 383 | 00002207 0001efc0 _WHSRCHR.BIN;1 1999/11/9 | |
| 384 | 00002203 00001cf4 _WHSRMAP.BIN;1 1999/11/9 | |
| 385 | */ | |
| 386 | ||
| 387 | ||
| 388 | ||
| 389 | ||
| 390 | ||
| 391 | ||
| 392 | ||
| 393 | UINT32 rsgun_prot_read_callback( address_space &space, int protaddr, UINT32 key ) | |
| 394 | { | |
| 395 | int tempctrl = protaddr - 0x0201000; // technically it doesn't seem to care, but... | |
| 396 | ||
| 397 | switch(key) | |
| 398 | { | |
| 399 | case 0x77770000: | |
| 400 | { | |
| 401 | UINT32 val = | |
| 402 | ((tempctrl & 0xff)<<24) | | |
| 403 | (((tempctrl+1) & 0xff)<<16) | | |
| 404 | (((tempctrl+2) & 0xff)<<8) | | |
| 405 | ((tempctrl+3) & 0xff); | |
| 406 | if(tempctrl & 0x100) | |
| 407 | val &= 0x0f0f0f0f; | |
| 408 | else | |
| 409 | val &= 0xf0f0f0f0; | |
| 410 | ||
| 411 | return val; | |
| 412 | } | |
| 413 | } | |
| 414 | ||
| 415 | return 0; | |
| 416 | } | |
| 417 | ||
| 418 | UINT32 twcup98_prot_read_callback( address_space &space, int protaddr, UINT32 key ) | |
| 419 | { | |
| 420 | UINT32 *ROM = (UINT32 *)space.machine().root_device().memregion("abus")->base(); | |
| 421 | UINT32 res = 0; | |
| 422 | ||
| 423 | UINT32 twcup_prot_data[8] = | |
| 424 | { | |
| 425 | 0x23232323, 0x23232323, 0x4c4c4c4c, 0x4c156301 | |
| 426 | }; | |
| 427 | ||
| 428 | switch(key >> 16) | |
| 429 | { | |
| 430 | case 0x1212: | |
| 431 | if(protaddr & 2) | |
| 432 | { | |
| 433 | res = (ROM[protaddr / 4] & 0xffff) << 16; | |
| 434 | res |= (ROM[(protaddr+4) / 4] & 0xffff0000) >> 16; | |
| 435 | } | |
| 436 | else | |
| 437 | { | |
| 438 | res = ROM[protaddr / 4] & 0xffff0000; | |
| 439 | res |= ROM[protaddr / 4] & 0xffff; | |
| 440 | } | |
| 441 | ||
| 442 | if(protaddr >= 0xD215A4+0x100c && protaddr < 0xD215A4+0x100c+8*4) | |
| 443 | res = twcup_prot_data[(protaddr-(0xD215A4+0x100c))/4]; | |
| 444 | ||
| 445 | return res; | |
| 446 | } | |
| 447 | ||
| 448 | return 0; | |
| 449 | } | |
| 450 | ||
| 451 | UINT32 sss_prot_read_callback( address_space &space, int protaddr, UINT32 key ) | |
| 452 | { | |
| 453 | UINT32 *ROM = (UINT32 *)space.machine().root_device().memregion("abus")->base(); | |
| 454 | int read_offset_hack = 0; | |
| 455 | UINT32 res; | |
| 456 | ||
| 457 | /* | |
| 458 | MAIN : 2c5b0000 DATA : 000000a6 014c0000 | |
| 459 | MAIN : 47f10000 DATA : 0f9800a6 014c1f30 | |
| 460 | MAIN : fcda0000 DATA : 1d4800a6 014c3a90 | |
| 461 | MAIN : b5e60000 DATA : 29e300a6 014c53c6 | |
| 462 | MAIN : 392c0000 DATA : 38e900a6 014c71d2 | |
| 463 | MAIN : 77c30000 DATA : 462500a6 014c8c4a | |
| 464 | MAIN : 8a620000 DATA : 555c00a6 014caab8 | |
| 465 | */ | |
| 466 | ||
| 467 | // I have a feeling rather than the offsets being scrambled they were lazy | |
| 468 | // and left unencrypted copies in the ROM... but this still needs verification | |
| 469 | switch(key>>16) | |
| 470 | { | |
| 471 | case 0x2c5b: read_offset_hack = 0x60054; break; | |
| 472 | case 0x47f1: read_offset_hack = 0x56498; break; | |
| 473 | case 0xfcda: read_offset_hack = 0x50b0c; break; | |
| 474 | case 0xb5e6: read_offset_hack = 0x4af56; break; | |
| 475 | case 0x392c: read_offset_hack = 0x45876; break; | |
| 476 | case 0x77c3: read_offset_hack = 0x3fe02; break; | |
| 477 | case 0x8a62: read_offset_hack = 0x3a784; break; | |
| 478 | } | |
| 479 | ||
| 480 | switch(key>>16) | |
| 481 | { | |
| 482 | default: | |
| 483 | if(protaddr & 2) | |
| 484 | { | |
| 485 | res = (ROM[(protaddr-read_offset_hack) / 4] & 0xffff) << 16; | |
| 486 | res |= (ROM[((protaddr-read_offset_hack)+4) / 4] & 0xffff0000) >> 16; | |
| 487 | } | |
| 488 | else | |
| 489 | { | |
| 490 | res = ROM[(protaddr-read_offset_hack) / 4] & 0xffff0000; | |
| 491 | res |= ROM[(protaddr-read_offset_hack) / 4] & 0xffff; | |
| 492 | } | |
| 493 | return res; | |
| 494 | } | |
| 495 | } | |
| 496 | ||
| 497 | UINT32 astrass_prot_read_callback( address_space &space, int protaddr, UINT32 key ) | |
| 498 | { | |
| 499 | /* we're reading from a custom region where we've loaded the data from the Saturn version | |
| 500 | NOT the rom address, so we're based at 0. The real data likely exists at the given | |
| 501 | address in encrypted form */ | |
| 502 | int read_offset_hack = 0x4ec260; | |
| 503 | int useoffset = (protaddr-read_offset_hack); | |
| 504 | UINT32 data = 0; | |
| 505 | UINT32 *prot_data = (UINT32 *)space.machine().root_device().memregion("user2")->base(); | |
| 506 | int prot_size = space.machine().root_device().memregion("user2")->bytes(); | |
| 507 | ||
| 508 | if (useoffset<prot_size) | |
| 509 | { | |
| 510 | data = prot_data[useoffset/4]; | |
| 511 | return data; | |
| 512 | } | |
| 513 | return 0x00; | |
| 514 | } | |
| 515 | ||
| 516 | ||
| 517 | UINT32 elandore_prot_read_callback( address_space &space, int protaddr, UINT32 key ) | |
| 518 | { | |
| 519 | UINT32 *ROM = (UINT32 *)space.machine().root_device().memregion("abus")->base(); | |
| 520 | UINT32 res = 0; | |
| 521 | ||
| 522 | switch(key >> 16) | |
| 523 | { | |
| 524 | default: | |
| 525 | if(protaddr & 2) | |
| 526 | { | |
| 527 | res = (ROM[protaddr / 4] & 0xffff) << 16; | |
| 528 | res |= (ROM[(protaddr+4) / 4] & 0xffff0000) >> 16; | |
| 529 | } | |
| 530 | else | |
| 531 | { | |
| 532 | res = ROM[protaddr / 4] & 0xffff0000; | |
| 533 | res |= ROM[protaddr / 4] & 0xffff; | |
| 534 | } | |
| 535 | return res; | |
| 536 | } | |
| 537 | ||
| 538 | // never executed | |
| 539 | //return 0; | |
| 540 | } | |
| 541 | ||
| 542 | UINT32 ffreveng_prot_read_callback( address_space &space, int protaddr, UINT32 key ) | |
| 543 | { | |
| 544 | //UINT32 res = 0; | |
| 545 | ||
| 546 | switch(key >> 16) | |
| 547 | { | |
| 548 | case 0x10da://ffreveng, boot vectors at $6080000,test mode | |
| 549 | case 0x10d7://ffreveng, boot vectors at $6080000,attract mode | |
| 550 | #if 0 | |
| 551 | if(protaddr & 2) | |
| 552 | { | |
| 553 | res = (ROM[protaddr / 4] & 0xffff) << 16; | |
| 554 | res |= (ROM[(protaddr+4) / 4] & 0xffff0000) >> 16; | |
| 555 | } | |
| 556 | else | |
| 557 | { | |
| 558 | res = ROM[protaddr / 4] & 0xffff0000; | |
| 559 | res |= ROM[protaddr / 4] & 0xffff; | |
| 560 | } | |
| 561 | #endif | |
| 562 | return 0; | |
| 563 | } | |
| 564 | ||
| 565 | return 0; | |
| 566 | } | |
| 567 | ||
| 568 | ||
| 23 | 569 | /************************************* |
| 24 | 570 | * |
| 25 | 571 | * Common Handlers |
| 26 | 572 | * |
| 27 | 573 | *************************************/ |
| 28 | 574 | |
| 575 | // the naomi hookup of 315-5881 reads 16-bits at a time, here we seem to read 32? | |
| 576 | ||
| 29 | 577 | READ32_MEMBER( stv_state::common_prot_r ) |
| 30 | 578 | { |
| 31 | 579 | UINT32 *ROM = (UINT32 *)space.machine().root_device().memregion("abus")->base(); |
| r243192 | r243193 | |
| 34 | 582 | { |
| 35 | 583 | if(offset == 3) |
| 36 | 584 | { |
| 37 | UINT8* base; | |
| 38 | UINT16 res = m_cryptdevice->do_decrypt(base); | |
| 39 | UINT16 res2 = m_cryptdevice->do_decrypt(base); | |
| 40 | res = ((res & 0xff00) >> 8) | ((res & 0x00ff) << 8); | |
| 41 | res2 = ((res2 & 0xff00) >> 8) | ((res2 & 0x00ff) << 8); | |
| 585 | #ifdef MAME_DEBUG | |
| 586 | popmessage("Prot read at %06x with data = %08x",space.device().safe_pc(),m_abus_protkey); | |
| 587 | #endif | |
| 588 | UINT32 realret = space.read_dword(0x2000000+m_ctrl_index); | |
| 589 | UINT32 retdata = m_prot_readback(space, m_ctrl_index, m_abus_protkey); | |
| 42 | 590 | |
| 43 | return res2 | (res << 16); | |
| 591 | logerror("A-Bus control protection read at %06x with data = %08x Returning = %08x Would otherwise return = %08x\n",space.device().safe_pc(),m_abus_protkey, retdata, realret); | |
| 592 | ||
| 593 | //UINT16 res = m_cryptdevice->do_decrypt(base); | |
| 594 | ||
| 595 | m_ctrl_index += 4; | |
| 596 | return retdata; | |
| 597 | ||
| 44 | 598 | } |
| 45 | 599 | return m_a_bus[offset]; |
| 46 | 600 | } |
| r243192 | r243193 | |
| 54 | 608 | |
| 55 | 609 | UINT16 stv_state::crypt_read_callback(UINT32 addr) |
| 56 | 610 | { |
| 57 | UINT16 dat= m_maincpu->space().read_word((0x02000000+2*addr)); | |
| 58 | return ((dat&0xff00)>>8)|((dat&0x00ff)<<8); | |
| 611 | const UINT8 *base = m_cart_reg[0]->base() + 2*addr; | |
| 612 | return base[1] | (base[0] << 8); | |
| 59 | 613 | } |
| 60 | 614 | |
| 61 | 615 | WRITE32_MEMBER ( stv_state::common_prot_w ) |
| 62 | 616 | { |
| 63 | 617 | COMBINE_DATA(&m_a_bus[offset]); |
| 618 | //printf("A-Bus control protection write at %06x: [%02x] <- %08x\n",space.device().safe_pc(),offset,data); | |
| 64 | 619 | |
| 65 | 620 | if (offset == 0) |
| 66 | 621 | { |
| r243192 | r243193 | |
| 68 | 623 | } |
| 69 | 624 | else if(offset == 2) |
| 70 | 625 | { |
| 71 | if (mem_mask&0xffff0000) m_cryptdevice->set_addr_low(data >> 16); | |
| 72 | if (mem_mask&0x0000ffff) m_cryptdevice->set_addr_high(data&0xffff); | |
| 626 | COMBINE_DATA(&m_abus_prot_addr); | |
| 73 | 627 | |
| 628 | m_cryptdevice->set_addr_low(m_abus_prot_addr >> 16); | |
| 629 | m_cryptdevice->set_addr_high(m_abus_prot_addr&0xffff); | |
| 630 | ||
| 74 | 631 | } |
| 75 | 632 | else if(offset == 3) |
| 76 | 633 | { |
| 77 | 634 | COMBINE_DATA(&m_abus_protkey); |
| 78 | 635 | |
| 79 | 636 | m_cryptdevice->set_subkey(m_abus_protkey>>16); |
| 637 | ||
| 638 | ||
| 639 | int a_bus_vector; | |
| 640 | a_bus_vector = m_abus_prot_addr >> 16; | |
| 641 | a_bus_vector|= (m_abus_prot_addr & 0xffff) << 16; | |
| 642 | a_bus_vector<<= 1; | |
| 643 | //printf("MAIN : %08x DATA : %08x %08x\n",m_abus_protkey,m_abus_prot_addr,a_bus_vector); | |
| 644 | ||
| 645 | // if you look at the first transfer in ffreveng this is clearly a ROM address from a table | MAIN : 10d70000 DATA : 0b780013 002616f0 | |
| 646 | // (opr21872.7, offset 0x616f0, which happens to be 0x2616f0 in the ROM region "game0") | |
| 647 | // the values sent by the CPU are plucked from a table above where the data is, located at 0x60000 | |
| 648 | // Offset 0 1 2 3 4 5 6 7 8 9 A B C D E F | |
| 649 | // 00060000 00 00 16 F0 00 00 2F A0 00 00 46 90 00 00 4D 04 | |
| 650 | // this is the first entry in the table, 0x16f0 is the address, 0x2fa0 is the length. | |
| 651 | // the next entry is address 0x4690, length 0x4d04. 0x16f0 + 0x2fa0 == 0x4690 so that entry is located straight after the first one | |
| 652 | // the game reads the number of bytes specified in the length via the protection device, writing them to RAM. This suggests there | |
| 653 | // is no compression going on, only some form of encryption. | |
| 654 | ||
| 655 | m_ctrl_index = a_bus_vector; | |
| 80 | 656 | } |
| 81 | 657 | } |
| 82 | 658 | |
| r243192 | r243193 | |
| 85 | 661 | m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x4fffff0, 0x4ffffff, read32_delegate(FUNC(stv_state::common_prot_r), this), write32_delegate(FUNC(stv_state::common_prot_w), this)); |
| 86 | 662 | } |
| 87 | 663 | |
| 664 | void stv_state::install_sss_protection() | |
| 665 | { | |
| 666 | install_common_protection(); | |
| 667 | m_prot_readback = sss_prot_read_callback; | |
| 668 | } | |
| 669 | ||
| 670 | void stv_state::install_astrass_protection() | |
| 671 | { | |
| 672 | install_common_protection(); | |
| 673 | m_prot_readback = astrass_prot_read_callback; | |
| 674 | // m_cryptdevice->set_key(0x00000000); | |
| 675 | } | |
| 676 | ||
| 677 | void stv_state::install_ffreveng_protection() | |
| 678 | { | |
| 679 | install_common_protection(); | |
| 680 | m_prot_readback = ffreveng_prot_read_callback; | |
| 681 | } | |
| 682 | ||
| 683 | void stv_state::install_elandore_protection() | |
| 684 | { | |
| 685 | install_common_protection(); | |
| 686 | m_prot_readback = elandore_prot_read_callback; | |
| 687 | } | |
| 688 | ||
| 689 | void stv_state::install_rsgun_protection() | |
| 690 | { | |
| 691 | install_common_protection(); | |
| 692 | m_prot_readback = rsgun_prot_read_callback; | |
| 693 | } | |
| 694 | ||
| 695 | void stv_state::install_twcup98_protection() | |
| 696 | { | |
| 697 | install_common_protection(); | |
| 698 | m_prot_readback = twcup98_prot_read_callback; | |
| 699 | ||
| 700 | } | |
| 701 | ||
| 702 | ||
| 703 | ||
| 88 | 704 | void stv_state::stv_register_protection_savestates() |
| 89 | 705 | { |
| 90 | 706 | save_item(NAME(m_a_bus)); |
| 707 | save_item(NAME(m_ctrl_index)); | |
| 708 | save_item(NAME(m_internal_counter)); | |
| 709 | save_item(NAME(m_char_offset)); | |
| 91 | 710 | } |
| r243192 | r243193 | |
|---|---|---|
| 209 | 209 | warofbug // (c) 1981 Armenia |
| 210 | 210 | warofbugu // (c) 1981 Armenia |
| 211 | 211 | warofbugg // German Version |
| 212 | spactrai // | |
| 213 | 212 | redufo // (c) Artic |
| 214 | 213 | redufob // bootleg |
| 215 | 214 | exodus // Subelectro - bootleg? |
| r243192 | r243193 | |
| 2679 | 2678 | snowbrosd // MIN16-02 (c) 1990 Toaplan + Dooyong license |
| 2680 | 2679 | wintbob // bootleg |
| 2681 | 2680 | snowbroswb // |
| 2682 | toto // | |
| 2683 | 2681 | // modified snowbros 'clone' hardware |
| 2684 | 2682 | honeydol // (c) 1995 Barko Corp |
| 2685 | 2683 | twinadv // (c) 1995 Barko Corp |
| r243192 | r243193 | |
| 3231 | 3229 | sf2mdtb // bootleg |
| 3232 | 3230 | sf2b // bootleg |
| 3233 | 3231 | cworld2j // 11/06/1992 (c) 1992 (Japan) |
| 3234 | cworld2ja // 11/06/1992 (c) 1992 (Japan) | |
| 3235 | 3232 | varth // 14/07/1992 (c) 1992 (World) |
| 3236 | 3233 | varthr1 // 12/06/1992 (c) 1992 (World) |
| 3237 | 3234 | varthu // 12/06/1992 (c) 1992 (USA) |
| r243192 | r243193 | |
| 3414 | 3411 | ddsomjr1 // 06/02/1996 (c) 1996 (Japan) |
| 3415 | 3412 | ddsomj // 19/06/1996 (c) 1996 (Japan) |
| 3416 | 3413 | ddsoma // 19/06/1996 (c) 1996 (Asia) |
| 3417 | ddsomar1 | |
| 3414 | ddsomar1 // 08/02/1996 (c) 1996 (Asia) | |
| 3418 | 3415 | ddsomh // 23/02/1996 (c) 1996 (Hispanic) |
| 3419 | 3416 | ddsomb // 23/02/1996 (c) 1996 (Brazil) |
| 3420 | 3417 | sfa2 // 06/03/1996 (c) 1996 (Euro) |
| r243192 | r243193 | |
| 5381 | 5378 | sprtjam // 2000.11.13 Sports Jam |
| 5382 | 5379 | pjustic // 2000.12 Moero Justice Gakuen / Project Justice |
| 5383 | 5380 | samba2k // 2000.12 Samba de Amigo Ver.2000 |
| 5384 | shaktam | |
| 5381 | shaktam // 2000.12.28 Shakatto Tambourine (Rev B) | |
| 5385 | 5382 | // 2000.?? Boat Race Ocean Heats |
| 5386 | 5383 | csmash // 2000.?? Cosmic Smash |
| 5387 | 5384 | csmasho // 2000.?? Cosmic Smash (original) |
| r243192 | r243193 | |
| 5449 | 5446 | starhrsp // 2003.12.01 Star Horse Progress (satellite) (Rev A) |
| 5450 | 5447 | puyofevp // 2003.?? Puyo Puyo Fever (prototype) |
| 5451 | 5448 | // 2003.?? Dragon Treasure |
| 5449 | // 2003.?? Rabbit 2 | |
| 5452 | 5450 | cfield // 2004.06 Chaos Field |
| 5453 | 5451 | tetkiwam // 2004.06 Tetris Kiwamemichi (Arcade TV Game List - P.88, Right, 11 from bottom) |
| 5454 | 5452 | trizeal // 2004.09 Trizeal |
| r243192 | r243193 | |
| 5515 | 5513 | |
| 5516 | 5514 | // NAOMI 2 |
| 5517 | 5515 | naomi2 // 2001.?? Naomi 2 BIOS |
| 5518 | vstrik3c // 2001.04 Virtua Striker 3 (cartridge) | |
| 5519 | vstrik3cb // 2001.04 Virtua Striker 3 (Rev B) (cartridge) | |
| 5520 | 5516 | vstrik3 // 2001.04.06 Virtua Striker 3 Ver. 2002 |
| 5517 | vstrik3cb // 2001.04 Virtua Striker 3 (Rev B) (cartridge) | |
| 5518 | vstrik3c // 2001.04 Virtua Striker 3 (Rev C) (cartridge) | |
| 5521 | 5519 | wldrider // 2001.05 Wild Riders |
| 5522 | 5520 | clubkrte // 2001.06 Club Kart: European Session |
| 5523 | clubkrtc // 2001.?? Club Kart: European Session (Rev C) | |
| 5524 | 5521 | clubkrtd // 2001.06 Club Kart: European Session (Rev D) |
| 5522 | clubkrtc // 2001.?? Club Kart: European Session (Rev C) | |
| 5525 | 5523 | beachspi // 2001.07 Beach Spikers |
| 5526 | 5524 | vf4cart // 2001.08.02 Virtua Fighter 4 (cartridge) |
| 5527 | 5525 | vf4 // 2001.08.02 Virtua Fighter 4 (GD-ROM) |
| r243192 | r243193 | |
| 6710 | 6708 | popn1 // GX803 (c) 1998 (Asia) |
| 6711 | 6709 | //popn1j // GX803 (c) 1998 (Japan) |
| 6712 | 6710 | popn2 // GX831 (c) 1998 (Japan) |
| 6713 | popn3 | |
| 6711 | popn3 // GX980 (c) 1999 (Japan) | |
| 6714 | 6712 | //popnstex // GX970 (c) 1999 (Japan) |
| 6715 | 6713 | |
| 6716 | 6714 | // Firebeat games |
| r243192 | r243193 | |
| 6964 | 6962 | quantum1 // 136016 (c) 1982 // made by Gencomp |
| 6965 | 6963 | quantump // 136016 (c) 1982 // made by Gencomp |
| 6966 | 6964 | bwidow // 136017 (c) 1982 |
| 6967 | bwidowp | |
| 6965 | bwidowp // (proto) (c) 1982 | |
| 6968 | 6966 | starwars // 136021 (c) 1983 |
| 6969 | 6967 | starwars1 // 136021 (c) 1983 |
| 6970 | 6968 | starwarso // 136021 (c) 1983 |
| r243192 | r243193 | |
| 11217 | 11215 | peps0298 // (c) 1996 IGT - International Game Technology |
| 11218 | 11216 | peps0308 // (c) 1996 IGT - International Game Technology |
| 11219 | 11217 | peps0364 // (c) 1996 IGT - International Game Technology |
| 11220 | peps0366 // (c) 1996 IGT - International Game Technology | |
| 11221 | peps0372 // (c) 1996 IGT - International Game Technology | |
| 11222 | peps0373 // (c) 1996 IGT - International Game Technology | |
| 11223 | 11218 | peps0426 // (c) 1996 IGT - International Game Technology |
| 11224 | 11219 | peps0581 // (c) 1996 IGT - International Game Technology |
| 11225 | 11220 | peps0615 // (c) 1996 IGT - International Game Technology |
| r243192 | r243193 | |
| 31147 | 31142 | orbitor1 |
| 31148 | 31143 | quicksil |
| 31149 | 31144 | seawitch |
| 31150 | spltsec | |
| 31145 | splitsec | |
| 31151 | 31146 | stargzr |
| 31152 | 31147 | viperp |
| 31153 | 31148 | gamatron |
| r243192 | r243193 | |
|---|---|---|
| 1721 | 1721 | $(DRIVERS)/monacogp.o \ |
| 1722 | 1722 | $(DRIVERS)/naomi.o $(MACHINE)/dc.o $(VIDEO)/powervr2.o $(MACHINE)/naomi.o \ |
| 1723 | 1723 | $(MACHINE)/naomig1.o $(MACHINE)/naomibd.o $(MACHINE)/naomirom.o $(MACHINE)/naomigd.o \ |
| 1724 | $(MACHINE)/naomim1.o $(MACHINE)/naomim2.o $(MACHINE)/naomim4.o \ | |
| 1724 | $(MACHINE)/naomicrypt.o $(MACHINE)/naomim1.o $(MACHINE)/naomim2.o $(MACHINE)/naomim4.o \ | |
| 1725 | 1725 | $(MACHINE)/315-5881_crypt.o \ |
| 1726 | 1726 | $(MACHINE)/awboard.o \ |
| 1727 | 1727 | $(MACHINE)/mie.o $(MACHINE)/maple-dc.o $(MACHINE)/mapledev.o $(MACHINE)/dc-ctrl.o $(MACHINE)/jvs13551.o \ |
| r243192 | r243193 | |
| 1747 | 1747 | $(DRIVERS)/segaybd.o $(VIDEO)/segaybd.o \ |
| 1748 | 1748 | $(DRIVERS)/sg1000a.o \ |
| 1749 | 1749 | $(DRIVERS)/stactics.o $(VIDEO)/stactics.o \ |
| 1750 | $(DRIVERS)/stv.o $(MACHINE)/stvprot.o $(MACHINE)/ | |
| 1750 | $(DRIVERS)/stv.o $(MACHINE)/stvprot.o $(MACHINE)/decathlt.o \ | |
| 1751 | 1751 | $(DRIVERS)/suprloco.o $(VIDEO)/suprloco.o \ |
| 1752 | 1752 | $(DRIVERS)/system1.o $(VIDEO)/system1.o \ |
| 1753 | 1753 | $(DRIVERS)/system16.o $(VIDEO)/system16.o \ |
| r243192 | r243193 | |
|---|---|---|
| 9 | 9 | |
| 10 | 10 | /******************************************************************************/ |
| 11 | 11 | |
| 12 | void actfancr_state::register_savestate() | |
| 13 | { | |
| 14 | save_item(NAME(m_flipscreen)); | |
| 15 | } | |
| 16 | ||
| 17 | void actfancr_state::video_start() | |
| 18 | { | |
| 19 | register_savestate(); | |
| 20 | } | |
| 21 | ||
| 22 | /******************************************************************************/ | |
| 23 | ||
| 12 | 24 | UINT32 actfancr_state::screen_update_actfancr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 13 | 25 | { |
| 14 | 26 | /* Draw playfield */ |
| r243192 | r243193 | |
|---|---|---|
| 36 | 36 | } |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | WRITE8_MEMBER(bogeyman_state::videoram_w) | |
| 39 | WRITE8_MEMBER(bogeyman_state::bogeyman_videoram_w) | |
| 40 | 40 | { |
| 41 | 41 | m_videoram[offset] = data; |
| 42 | 42 | m_bg_tilemap->mark_tile_dirty(offset); |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | WRITE8_MEMBER(bogeyman_state::colorram_w) | |
| 45 | WRITE8_MEMBER(bogeyman_state::bogeyman_colorram_w) | |
| 46 | 46 | { |
| 47 | 47 | m_colorram[offset] = data; |
| 48 | 48 | m_bg_tilemap->mark_tile_dirty(offset); |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | WRITE8_MEMBER(bogeyman_state::videoram2_w) | |
| 51 | WRITE8_MEMBER(bogeyman_state::bogeyman_videoram2_w) | |
| 52 | 52 | { |
| 53 | 53 | m_videoram2[offset] = data; |
| 54 | 54 | m_fg_tilemap->mark_tile_dirty(offset); |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | WRITE8_MEMBER(bogeyman_state::colorram2_w) | |
| 57 | WRITE8_MEMBER(bogeyman_state::bogeyman_colorram2_w) | |
| 58 | 58 | { |
| 59 | 59 | m_colorram2[offset] = data; |
| 60 | 60 | m_fg_tilemap->mark_tile_dirty(offset); |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | WRITE8_MEMBER(bogeyman_state::paletteram_w) | |
| 63 | WRITE8_MEMBER(bogeyman_state::bogeyman_paletteram_w) | |
| 64 | 64 | { |
| 65 | 65 | /* RGB output is inverted */ |
| 66 | 66 | m_palette->write(space, offset, UINT8(~data)); |
| r243192 | r243193 | |
| 94 | 94 | m_fg_tilemap->set_transparent_pen(0); |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | void bogeyman_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) | |
| 97 | void bogeyman_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ) | |
| 98 | 98 | { |
| 99 | for (int offs = 0; offs < m_spriteram.bytes(); offs += 4) | |
| 99 | int offs; | |
| 100 | ||
| 101 | for (offs = 0; offs < m_spriteram.bytes(); offs += 4) | |
| 100 | 102 | { |
| 101 | 103 | int attr = m_spriteram[offs]; |
| 102 | 104 | |
| r243192 | r243193 | |
| 137 | 139 | } |
| 138 | 140 | } |
| 139 | 141 | |
| 140 | UINT32 bogeyman_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) | |
| 142 | UINT32 bogeyman_state::screen_update_bogeyman(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) | |
| 141 | 143 | { |
| 142 | 144 | m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); |
| 143 | 145 | draw_sprites(bitmap, cliprect); |
| r243192 | r243193 | |
|---|---|---|
| 1531 | 1531 | {"varthu", CPS_B_04, mapper_VA63B }, /* CPSB test has been patched out (60=0008) register is also written to, possibly leftover from development */ |
| 1532 | 1532 | {"varthj", CPS_B_21_BT5, mapper_VA22B }, /* CPSB test has been patched out (72=0001) register is also written to, possibly leftover from development */ |
| 1533 | 1533 | {"cworld2j", CPS_B_21_BT6, mapper_Q522B, 0x36, 0, 0x34 }, /* (ports 36, 34 probably leftover input code from another game) */ |
| 1534 | {"cworld2ja", CPS_B_21_DEF, mapper_Q522B }, // patched set, no battery, could be desuicided | |
| 1535 | 1534 | {"wof", CPS_B_21_QS1, mapper_TK263B }, |
| 1536 | 1535 | {"wofr1", CPS_B_21_DEF, mapper_TK263B }, // patched set coming from a desuicided board? |
| 1537 | 1536 | {"wofa", CPS_B_21_DEF, mapper_TK263B }, // patched set coming from a desuicided board? |
| r243192 | r243193 | |
|---|---|---|
| 33 | 33 | VIDEO_START_MEMBER(eolith_state,eolith) |
| 34 | 34 | { |
| 35 | 35 | m_vram = auto_alloc_array(machine(), UINT32, 0x40000*2/4); |
| 36 | save_pointer(NAME(m_vram), 0x40000*2/4); | |
| 36 | save_pointer(NAME(m_vram), 0x40000*2/4); | |
| 37 | 37 | save_item(NAME(m_buffer)); |
| 38 | 38 | } |
| 39 | 39 |
| r243192 | r243193 | |
|---|---|---|
| 141 | 141 | The alternative option of allowing sprites to render a priority level higher than tilemaps breaks at least the |
| 142 | 142 | 'Welcome to..' screen in Batrider after selecting your character. |
| 143 | 143 | |
| 144 | Batrider Gob-Robo boss however definitely requires SPRITES to still have 16 levels of priority against other | |
| 145 | sprites, see http://mametesters.org/view.php?id=5832 | |
| 146 | ||
| 147 | 144 | It is unknown if the current solution breaks anything. The majority of titles don't make extensive use of the |
| 148 | 145 | priority system. |
| 149 | 146 | |
| 150 | 147 | */ |
| 151 | #define GP9001_PRIMASK (0x000f) | |
| 152 | #define GP9001_PRIMASK_TMAPS (0x000e) | |
| 148 | #define GP9001_PRIMASK (0x000e) | |
| 153 | 149 | |
| 150 | ||
| 154 | 151 | WRITE16_MEMBER( gp9001vdp_device::gp9001_bg_tmap_w ) |
| 155 | 152 | { |
| 156 | 153 | COMBINE_DATA(&m_vram_bg[offset]); |
| r243192 | r243193 | |
| 174 | 171 | AM_RANGE(0x0000, 0x0fff) AM_RAM_WRITE(gp9001_bg_tmap_w) AM_SHARE("vram_bg") |
| 175 | 172 | AM_RANGE(0x1000, 0x1fff) AM_RAM_WRITE(gp9001_fg_tmap_w) AM_SHARE("vram_fg") |
| 176 | 173 | AM_RANGE(0x2000, 0x2fff) AM_RAM_WRITE(gp9001_top_tmap_w) AM_SHARE("vram_top") |
| 177 | AM_RANGE(0x3000, 0x37ff) AM_RAM AM_SHARE("spriteram") AM_MIRROR(0x0800) | |
| 178 | // AM_RANGE(0x3800, 0x3fff) AM_RAM // sprite mirror? | |
| 174 | AM_RANGE(0x3000, 0x37ff) AM_RAM AM_SHARE("spriteram") | |
| 175 | AM_RANGE(0x3800, 0x3fff) AM_RAM // sprite mirror? | |
| 179 | 176 | ADDRESS_MAP_END |
| 180 | 177 | |
| 181 | 178 | |
| r243192 | r243193 | |
| 888 | 885 | int realx = (x+scrollx)&0x1ff; |
| 889 | 886 | |
| 890 | 887 | UINT16 pixdat = srcptr[realx]; |
| 891 | UINT8 pixpri = ((pixdat & (GP9001_PRIMASK | |
| 888 | UINT8 pixpri = ((pixdat & (GP9001_PRIMASK<<12))>>12); | |
| 892 | 889 | |
| 893 | 890 | if (pri_enable[pixpri]) |
| 894 | 891 | { |
| r243192 | r243193 | |
|---|---|---|
| 102 | 102 | * |
| 103 | 103 | *************************************/ |
| 104 | 104 | |
| 105 | WRITE8_MEMBER(m58_state::videoram_w) | |
| 105 | WRITE8_MEMBER(m58_state::yard_videoram_w) | |
| 106 | 106 | { |
| 107 | 107 | m_videoram[offset] = data; |
| 108 | 108 | m_bg_tilemap->mark_tile_dirty(offset / 2); |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | |
| 112 | WRITE8_MEMBER(m58_state::scroll_panel_w) | |
| 112 | WRITE8_MEMBER(m58_state::yard_scroll_panel_w) | |
| 113 | 113 | { |
| 114 | 114 | int sx,sy,i; |
| 115 | 115 | |
| r243192 | r243193 | |
| 128 | 128 | col = (data >> i) & 0x11; |
| 129 | 129 | col = ((col >> 3) | col) & 3; |
| 130 | 130 | |
| 131 | m_scroll_panel_bitmap | |
| 131 | m_scroll_panel_bitmap->pix16(sy, sx + i) = RADAR_PALETTE_BASE + (sy & 0xfc) + col; | |
| 132 | 132 | } |
| 133 | 133 | } |
| 134 | 134 | |
| r243192 | r243193 | |
| 140 | 140 | * |
| 141 | 141 | *************************************/ |
| 142 | 142 | |
| 143 | TILE_GET_INFO_MEMBER(m58_state::get_bg_tile_info) | |
| 143 | TILE_GET_INFO_MEMBER(m58_state::yard_get_bg_tile_info) | |
| 144 | 144 | { |
| 145 | 145 | int offs = tile_index * 2; |
| 146 | 146 | int attr = m_videoram[offs + 1]; |
| r243192 | r243193 | |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | |
| 155 | TILEMAP_MAPPER_MEMBER(m58_state::tilemap_scan_rows) | |
| 155 | TILEMAP_MAPPER_MEMBER(m58_state::yard_tilemap_scan_rows) | |
| 156 | 156 | { |
| 157 | 157 | /* logical (col,row) -> memory offset */ |
| 158 | 158 | if (col >= 32) |
| r243192 | r243193 | |
| 175 | 175 | int height = m_screen->height(); |
| 176 | 176 | const rectangle &visarea = m_screen->visible_area(); |
| 177 | 177 | |
| 178 | m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(m58_state::get_bg_tile_info),this), tilemap_mapper_delegate(FUNC(m58_state::tilemap_scan_rows),this), 8, 8, 64, 32); | |
| 178 | m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(m58_state::yard_get_bg_tile_info),this), tilemap_mapper_delegate(FUNC(m58_state::yard_tilemap_scan_rows),this), 8, 8, 64, 32); | |
| 179 | 179 | m_bg_tilemap->set_scrolldx(visarea.min_x, width - (visarea.max_x + 1)); |
| 180 | 180 | m_bg_tilemap->set_scrolldy(visarea.min_y - 8, height + 16 - (visarea.max_y + 1)); |
| 181 | 181 | |
| 182 | //m_scroll_panel_bitmap = auto_bitmap_ind16_alloc(machine(), SCROLL_PANEL_WIDTH, height); | |
| 183 | m_screen->register_screen_bitmap(m_scroll_panel_bitmap); | |
| 184 | save_item(NAME(m_scroll_panel_bitmap)); | |
| 182 | m_scroll_panel_bitmap = auto_bitmap_ind16_alloc(machine(), SCROLL_PANEL_WIDTH, height); | |
| 185 | 183 | } |
| 186 | 184 | |
| 187 | 185 | |
| r243192 | r243193 | |
| 192 | 190 | * |
| 193 | 191 | *************************************/ |
| 194 | 192 | |
| 195 | WRITE8_MEMBER(m58_state::flipscreen_w) | |
| 193 | WRITE8_MEMBER(m58_state::yard_flipscreen_w) | |
| 196 | 194 | { |
| 197 | 195 | /* screen flip is handled both by software and hardware */ |
| 198 | 196 | flip_screen_set((data & 0x01) ^ (~ioport("DSW2")->read() & 0x01)); |
| r243192 | r243193 | |
| 267 | 265 | |
| 268 | 266 | void m58_state::draw_panel( bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 269 | 267 | { |
| 270 | if (!*m_score_panel_disabled) | |
| 268 | if (!*m_yard_score_panel_disabled) | |
| 271 | 269 | { |
| 272 | 270 | const rectangle clippanel(26*8, 32*8-1, 1*8, 31*8-1); |
| 273 | 271 | const rectangle clippanelflip(0*8, 6*8-1, 1*8, 31*8-1); |
| r243192 | r243193 | |
| 280 | 278 | clip.max_y += visarea.max_y + yoffs; |
| 281 | 279 | clip &= cliprect; |
| 282 | 280 | |
| 283 | copybitmap(bitmap, m_scroll_panel_bitmap, flip_screen(), flip_screen(), | |
| 281 | copybitmap(bitmap, *m_scroll_panel_bitmap, flip_screen(), flip_screen(), | |
| 284 | 282 | sx, visarea.min_y + yoffs, clip); |
| 285 | 283 | } |
| 286 | 284 | } |
| r243192 | r243193 | |
| 293 | 291 | * |
| 294 | 292 | *************************************/ |
| 295 | 293 | |
| 296 | UINT32 m58_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) | |
| 294 | UINT32 m58_state::screen_update_yard(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) | |
| 297 | 295 | { |
| 298 | m_bg_tilemap->set_scrollx(0, (*m_scroll_x_high * 0x100) + *m_scroll_x_low); | |
| 299 | m_bg_tilemap->set_scrolly(0, *m_scroll_y_low); | |
| 296 | m_bg_tilemap->set_scrollx(0, (*m_yard_scroll_x_high * 0x100) + *m_yard_scroll_x_low); | |
| 297 | m_bg_tilemap->set_scrolly(0, *m_yard_scroll_y_low); | |
| 300 | 298 | |
| 301 | 299 | m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); |
| 302 | 300 | draw_sprites(bitmap, cliprect); |
| r243192 | r243193 | |
|---|---|---|
| 164 | 164 | m_tilemap_2->set_transparent_pen(0xff); |
| 165 | 165 | |
| 166 | 166 | save_item(NAME(m_tmpbitmap)); |
| 167 | save_item(NAME(m_pixbank)); | |
| 168 | 167 | } |
| 169 | 168 | |
| 170 | 169 | |
| r243192 | r243193 | |
| 180 | 179 | m_priority = data; |
| 181 | 180 | } |
| 182 | 181 | |
| 183 | void paradise_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) | |
| 182 | void paradise_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ) | |
| 184 | 183 | { |
| 185 | for (int i = 0; i < m_spriteram.bytes() ; i += m_sprite_inc) | |
| 184 | UINT8 *spriteram = m_spriteram; | |
| 185 | int i; | |
| 186 | for (i = 0; i < m_spriteram.bytes() ; i += m_sprite_inc) | |
| 186 | 187 | { |
| 187 | int code = m_spriteram[i + 0]; | |
| 188 | int x = m_spriteram[i + 1]; | |
| 189 | int y = m_spriteram[i + 2] - 2; | |
| 190 | int attr = m_spriteram[i + 3]; | |
| 188 | int code = spriteram[i + 0]; | |
| 189 | int x = spriteram[i + 1]; | |
| 190 | int y = spriteram[i + 2] - 2; | |
| 191 | int attr = spriteram[i + 3]; | |
| 191 | 192 | |
| 192 | 193 | int flipx = 0; // ? |
| 193 | 194 | int flipy = 0; |
| r243192 | r243193 | |
|---|---|---|
| 283 | 283 | int height = m_screen->height(); |
| 284 | 284 | |
| 285 | 285 | m_videoram = auto_alloc_array_clear(machine(), UINT8, width * height); |
| 286 | ||
| 286 | ||
| 287 | 287 | save_item(NAME(m_blitter_desty)); |
| 288 | 288 | save_item(NAME(m_blitter_sizex)); |
| 289 | 289 | save_item(NAME(m_blitter_sizey)); |
| r243192 | r243193 | |
|---|---|---|
| 377 | 377 | |
| 378 | 378 | UINT16 a, color; |
| 379 | 379 | int sx, x_index; |
| 380 | int y_index, src_y_index, row_index; | |
| 380 | int i, y, y_index, src_y_index, row_index; | |
| 381 | 381 | |
| 382 | 382 | int flip = 0; |
| 383 | int machine_flip = 0; /* for ROT 180 ? */ | |
| 383 | 384 | |
| 384 | 385 | int min_x = cliprect.min_x; |
| 385 | 386 | int max_x = cliprect.max_x; |
| r243192 | r243193 | |
| 399 | 400 | y_index = 0; |
| 400 | 401 | } |
| 401 | 402 | |
| 402 | for (int y = min_y; y <= max_y; y++) | |
| 403 | if (!machine_flip) | |
| 404 | y = min_y; | |
| 405 | else | |
| 406 | y = max_y; | |
| 407 | ||
| 408 | do | |
| 403 | 409 | { |
| 404 | 410 | src_y_index = y_index & 0x1ff; /* tilemaps are 512 px up/down */ |
| 405 | 411 | row_index = (src_y_index - m_bgscrolly[layer]) & 0x1ff; |
| r243192 | r243193 | |
| 413 | 419 | |
| 414 | 420 | if (flags & TILEMAP_DRAW_OPAQUE) |
| 415 | 421 | { |
| 416 | for (i | |
| 422 | for (i = 0; i < screen_width; i++) | |
| 417 | 423 | { |
| 418 | 424 | a = src16[x_index & width_mask]; |
| 419 | 425 | #ifdef TOPSPEED_ROAD_COLORS |
| r243192 | r243193 | |
| 425 | 431 | } |
| 426 | 432 | else |
| 427 | 433 | { |
| 428 | for (i | |
| 434 | for (i = 0; i < screen_width; i++) | |
| 429 | 435 | { |
| 430 | 436 | if (tsrc[x_index & width_mask]) |
| 431 | 437 | { |
| r243192 | r243193 | |
| 443 | 449 | |
| 444 | 450 | taitoic_drawscanline(bitmap, cliprect, 0, y, scanline, (flags & TILEMAP_DRAW_OPAQUE) ? 0 : 1, ROT0, screen.priority(), priority); |
| 445 | 451 | y_index++; |
| 452 | ||
| 453 | if (!machine_flip) | |
| 454 | y++; | |
| 455 | else | |
| 456 | y--; | |
| 446 | 457 | } |
| 458 | while ((!machine_flip && y <= max_y) || (machine_flip && y >= min_y)); | |
| 447 | 459 | } |
| 448 | 460 | |
| 449 | 461 | void pc080sn_device::tilemap_draw( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, UINT32 priority ) |
| r243192 | r243193 | |
|---|---|---|
| 229 | 229 | int xx1 = x1 >> TAITOAIR_FRAC_SHIFT; |
| 230 | 230 | int xx2 = x2 >> TAITOAIR_FRAC_SHIFT; |
| 231 | 231 | int grad_col; |
| 232 | int base_color; | |
| 233 | 232 | |
| 234 | 233 | if (xx1 <= cliprect.max_x || xx2 >= cliprect.min_x) |
| 235 | 234 | { |
| r243192 | r243193 | |
| 238 | 237 | if (xx2 > cliprect.max_x) |
| 239 | 238 | xx2 = cliprect.max_x; |
| 240 | 239 | |
| 241 | if(color & 0x40) | |
| 242 | { | |
| 243 | /* Non-terrain elements are colored with this. */ | |
| 244 | base_color = (color & 0x3f) + 0x340; | |
| 245 | grad_col = 0; | |
| 246 | } | |
| 247 | else | |
| 248 | { | |
| 249 | /* Terrain elements, with a gradient applied. */ | |
| 250 | /* TODO: it's unknown if gradient color applies by global screen Y coordinate or there's a calculation to somewhere ... */ | |
| 251 | base_color = ((color & 0x3f) * 0x80) + 0x2040; | |
| 252 | grad_col = (y1 >> 3) & 0x3f; | |
| 253 | } | |
| 240 | /* TODO: it's unknown if gradient color applies by global screen Y coordinate or there's a calculation to somewhere ... */ | |
| 241 | grad_col = (y1 >> 3) & 0x3f; | |
| 254 | 242 | |
| 255 | 243 | while (xx1 <= xx2) |
| 256 | 244 | { |
| 257 | bitmap.pix16(y1, xx1) = | |
| 245 | bitmap.pix16(y1, xx1) = color + grad_col; | |
| 258 | 246 | xx1++; |
| 259 | 247 | } |
| 260 | 248 | } |
| r243192 | r243193 | |
| 405 | 393 | logerror("quad: unknown value %04x at %04x\n", m_line_ram[adr], adr); |
| 406 | 394 | break; |
| 407 | 395 | } |
| 408 | m_q.col = m_line_ram[adr] & 0x7f;//((m_line_ram[adr] & 0x007f) * 0x80) + 0x2040; | |
| 409 | ||
| 396 | m_q.col = ((m_line_ram[adr] & 0x007f) * 0x80) + 0x2040; | |
| 410 | 397 | adr--; |
| 411 | 398 | pcount = 0; |
| 412 | 399 | while (pcount < TAITOAIR_POLY_MAX_PT && adr >= 1 && !(m_line_ram[adr] & 0xc000)) |
| r243192 | r243193 | |
|---|---|---|
| 439 | 439 | |
| 440 | 440 | int sx, zoomx, zoomy; |
| 441 | 441 | int dx, ex, dy, ey; |
| 442 | int y_index, src_y_index, row_index; | |
| 442 | int i, y, y_index, src_y_index, row_index; | |
| 443 | 443 | int x_index, x_step; |
| 444 | 444 | |
| 445 | 445 | int flip = m_flipscreen; |
| 446 | int machine_flip = 0; /* for ROT 180 ? */ | |
| 446 | 447 | |
| 447 | 448 | int min_x = cliprect.min_x; |
| 448 | 449 | int max_x = cliprect.max_x; |
| r243192 | r243193 | |
| 500 | 501 | y_index = ((-m_scroll_ram[3] - 2) << 16) + min_y * zoomy - (max_y + min_y) * (zoomy - 0x10000); |
| 501 | 502 | } |
| 502 | 503 | |
| 503 | for (int y = min_y; y <= max_y; y++) | |
| 504 | if (!machine_flip) | |
| 505 | y = min_y; | |
| 506 | else | |
| 507 | y = max_y; | |
| 508 | ||
| 509 | do | |
| 504 | 510 | { |
| 505 | 511 | src_y_index = (y_index >> 16) & 0x3ff; /* tilemaps are 1024 px up/down */ |
| 506 | 512 | |
| r243192 | r243193 | |
| 519 | 525 | |
| 520 | 526 | if (flags & TILEMAP_DRAW_OPAQUE) |
| 521 | 527 | { |
| 522 | for (i | |
| 528 | for (i = 0; i < screen_width; i++) | |
| 523 | 529 | { |
| 524 | 530 | *dst16++ = src16[(x_index >> 16) & width_mask]; |
| 525 | 531 | x_index += x_step; |
| r243192 | r243193 | |
| 527 | 533 | } |
| 528 | 534 | else |
| 529 | 535 | { |
| 530 | for (i | |
| 536 | for (i = 0; i < screen_width; i++) | |
| 531 | 537 | { |
| 532 | 538 | if (tsrc[(x_index >> 16) & width_mask]) |
| 533 | 539 | *dst16++ = src16[(x_index >> 16) & width_mask]; |
| r243192 | r243193 | |
| 540 | 546 | taitoic_drawscanline(bitmap, cliprect, 0, y, scanline, (flags & TILEMAP_DRAW_OPAQUE) ? 0 : 1 , ROT0, screen.priority(), priority); |
| 541 | 547 | |
| 542 | 548 | y_index += zoomy; |
| 549 | ||
| 550 | if (!machine_flip) | |
| 551 | y++; | |
| 552 | else | |
| 553 | y--; | |
| 543 | 554 | } |
| 555 | while ((!machine_flip && y <= max_y) || (machine_flip && y >= min_y)); | |
| 544 | 556 | } |
| 545 | 557 | } |
| 546 | 558 |
| r243192 | r243193 | |
|---|---|---|
| 717 | 717 | bitmap_ind16 &srcbitmap = m_tilemap[layer][m_dblwidth]->pixmap(); |
| 718 | 718 | bitmap_ind8 &flagsbitmap = m_tilemap[layer][m_dblwidth]->flagsmap(); |
| 719 | 719 | int flip = m_pri_reg & 0x40; |
| 720 | int y_index, src_y_index, row_index; | |
| 720 | int i, y, y_index, src_y_index, row_index; | |
| 721 | 721 | int x_index, x_step; |
| 722 | 722 | |
| 723 | 723 | UINT16 screen_width = 512; //cliprect.width(); |
| r243192 | r243193 | |
| 745 | 745 | y_index -= (m_y_offset - min_y) * zoomy; |
| 746 | 746 | } |
| 747 | 747 | |
| 748 | for (int y = min_y; y <= max_y; y++) | |
| 748 | y = min_y; | |
| 749 | ||
| 750 | do | |
| 749 | 751 | { |
| 750 | 752 | src_y_index = (y_index >> 16) & 0x1ff; |
| 751 | 753 | |
| r243192 | r243193 | |
| 764 | 766 | |
| 765 | 767 | if (flags & TILEMAP_DRAW_OPAQUE) |
| 766 | 768 | { |
| 767 | for (i | |
| 769 | for (i = 0; i < screen_width; i++) | |
| 768 | 770 | { |
| 769 | 771 | *dst16++ = src16[(x_index >> 16) & width_mask]; |
| 770 | 772 | x_index += x_step; |
| r243192 | r243193 | |
| 772 | 774 | } |
| 773 | 775 | else |
| 774 | 776 | { |
| 775 | for (i | |
| 777 | for (i = 0; i < screen_width; i++) | |
| 776 | 778 | { |
| 777 | 779 | if (tsrc[(x_index >> 16) & width_mask]) |
| 778 | 780 | *dst16++ = src16[(x_index >> 16) & width_mask]; |
| r243192 | r243193 | |
| 785 | 787 | taitoic_drawscanline(bitmap, cliprect, 0, y, scanline, (flags & TILEMAP_DRAW_OPAQUE) ? 0 : 1, ROT0, screen.priority(), priority); |
| 786 | 788 | |
| 787 | 789 | y_index += zoomy; |
| 790 | y++; | |
| 788 | 791 | } |
| 792 | while (y <= max_y); | |
| 793 | ||
| 789 | 794 | } |
| 790 | 795 | } |
| 791 | 796 | |
| r243192 | r243193 | |
| 833 | 838 | |
| 834 | 839 | UINT16 *dst16, *src16; |
| 835 | 840 | UINT8 *tsrc; |
| 836 | int y_index, src_y_index, row_index, row_zoom; | |
| 841 | int i, y, y_index, src_y_index, row_index, row_zoom; | |
| 837 | 842 | int sx, x_index, x_step; |
| 838 | 843 | UINT32 zoomx, zoomy; |
| 839 | 844 | UINT16 scanline[512]; |
| r243192 | r243193 | |
| 871 | 876 | y_index -= (m_y_offset - min_y) * zoomy; |
| 872 | 877 | } |
| 873 | 878 | |
| 874 | for (int y = min_y; y <= max_y; y++) | |
| 879 | y = min_y; | |
| 880 | ||
| 881 | do | |
| 875 | 882 | { |
| 876 | 883 | if (!flipscreen) |
| 877 | 884 | src_y_index = ((y_index>>16) + m_bgcolumn_ram[layer][(y - m_y_offset) & 0x1ff]) & 0x1ff; |
| r243192 | r243193 | |
| 910 | 917 | |
| 911 | 918 | if (flags & TILEMAP_DRAW_OPAQUE) |
| 912 | 919 | { |
| 913 | for (i | |
| 920 | for (i = 0; i < screen_width; i++) | |
| 914 | 921 | { |
| 915 | 922 | *dst16++ = src16[(x_index >> 16) & width_mask]; |
| 916 | 923 | x_index += x_step; |
| r243192 | r243193 | |
| 918 | 925 | } |
| 919 | 926 | else |
| 920 | 927 | { |
| 921 | for (i | |
| 928 | for (i = 0; i < screen_width; i++) | |
| 922 | 929 | { |
| 923 | 930 | if (tsrc[(x_index >> 16) & width_mask]) |
| 924 | 931 | *dst16++ = src16[(x_index >> 16) & width_mask]; |
| r243192 | r243193 | |
| 931 | 938 | taitoic_drawscanline(bitmap, cliprect, 0, y, scanline, (flags & TILEMAP_DRAW_OPAQUE) ? 0 : 1, ROT0, screen.priority(), priority); |
| 932 | 939 | |
| 933 | 940 | y_index += zoomy; |
| 941 | y++; | |
| 934 | 942 | } |
| 943 | while (y<=max_y); | |
| 935 | 944 | } |
| 936 | 945 | |
| 937 | 946 |
| r243192 | r243193 | |
|---|---|---|
| 430 | 430 | helper[0] = auto_bitmap_ind16_alloc(machine(), cx, TIA_MAX_SCREEN_HEIGHT); |
| 431 | 431 | helper[1] = auto_bitmap_ind16_alloc(machine(), cx, TIA_MAX_SCREEN_HEIGHT); |
| 432 | 432 | helper[2] = auto_bitmap_ind16_alloc(machine(), cx, TIA_MAX_SCREEN_HEIGHT); |
| 433 | ||
| 433 | ||
| 434 | 434 | register_save_state(); |
| 435 | 435 | } |
| 436 | 436 |
| r243192 | r243193 | |
|---|---|---|
| 199 | 199 | bitmap_ind16 *helper[3]; |
| 200 | 200 | |
| 201 | 201 | UINT16 screen_height; |
| 202 | ||
| 202 | ||
| 203 | 203 | void register_save_state(); |
| 204 | 204 | }; |
| 205 | 205 |
| r243192 | r243193 | |
|---|---|---|
| 113 | 113 | |
| 114 | 114 | PALETTE_INIT_MEMBER(tx1_state,tx1) |
| 115 | 115 | { |
| 116 | const UINT8 *co | |
| 116 | const UINT8 *color_prom = memregion("proms")->base(); | |
| 117 | 117 | int i; |
| 118 | 118 | |
| 119 | 119 | static const res_net_info tx1_net_info = |
| r243192 | r243193 | |
| 233 | 233 | UINT16 *tx1_vram = m_vram; |
| 234 | 234 | INT32 x, y; |
| 235 | 235 | UINT32 scroll_x; |
| 236 | UINT8 *chars, *gfx2; | |
| 236 | 237 | |
| 237 | 238 | /* 2bpp characters */ |
| 238 | const UINT8 *const chars = &m_char_tiles[0]; | |
| 239 | const UINT8 *const gfx2 = &m_char_tiles[0x4000]; | |
| 239 | chars = memregion("char_tiles")->base(); | |
| 240 | gfx2 = chars + 0x4000; | |
| 240 | 241 | |
| 241 | 242 | /* X scroll value is the last word in char RAM */ |
| 242 | 243 | scroll_x = tx1_vram[0xfff] & 0x3ff; |
| r243192 | r243193 | |
| 413 | 414 | UINT8 pix[2][4][3]; |
| 414 | 415 | |
| 415 | 416 | /* Road slice map ROMs */ |
| 416 | const UINT8 *const rom_a = &m_road_rom[0]; | |
| 417 | const UINT8 *const rom_b = &m_road_rom[0x2000]; | |
| 418 | const UINT8 *const rom_c = &m_road_rom[0x4000]; | |
| 417 | const UINT8 *const gfx3 = memregion("gfx3")->base(); | |
| 418 | const UINT8 *const rom_a = gfx3; | |
| 419 | const UINT8 *const rom_b = gfx3 + 0x2000; | |
| 420 | const UINT8 *const rom_c = gfx3 + 0x4000; | |
| 419 | 421 | |
| 420 | 422 | /* Pixel data */ |
| 421 | const UINT8 *const prom_a = &m_proms[0x1100]; | |
| 422 | const UINT8 *const prom_b = &m_proms[0x1300]; | |
| 423 | const UINT8 *const prom_c = &m_proms[0x1500]; | |
| 424 | const UINT8 *const vprom = &m_proms[0x1700]; | |
| 423 | const UINT8 *const proms = memregion("proms")->base(); | |
| 424 | const UINT8 *const prom_a = proms + 0x1100; | |
| 425 | const UINT8 *const prom_b = proms + 0x1300; | |
| 426 | const UINT8 *const prom_c = proms + 0x1500; | |
| 427 | const UINT8 *const vprom = proms + 0x1700; | |
| 425 | 428 | |
| 426 | 429 | rva9_8 = (tx1_vregs.flags & 3) << 8; |
| 427 | 430 | rva7 = !BIT(tx1_vregs.flags, TX1_RDFLAG_RVA7) << 7; |
| r243192 | r243193 | |
| 852 | 855 | UINT32 offs; |
| 853 | 856 | |
| 854 | 857 | /* The many lookup table ROMs */ |
| 855 | const UINT8 *const ic48 = &m_obj_luts[0]; | |
| 856 | const UINT8 *const ic281 = &m_obj_luts[0x2000]; | |
| 858 | const UINT8 *const ic48 = memregion("user3")->base(); | |
| 859 | const UINT8 *const ic281 = ic48 + 0x2000; | |
| 857 | 860 | |
| 858 | const UINT8 *const ic190 = &m_proms[0xc00]; | |
| 859 | const UINT8 *const ic162 = &m_proms[0xe00]; | |
| 860 | const UINT8 *const ic25 = &m_proms[0x1000]; | |
| 861 | const UINT8 *const proms = memregion("proms")->base(); | |
| 862 | const UINT8 *const ic190 = proms + 0xc00; | |
| 863 | const UINT8 *const ic162 = proms + 0xe00; | |
| 864 | const UINT8 *const ic25 = proms + 0x1000; | |
| 861 | 865 | |
| 862 | const UINT8 *const ic106 = &m_obj_map[0]; | |
| 863 | const UINT8 *const ic73 = &m_obj_map[0x4000]; | |
| 866 | const UINT8 *const ic106 = memregion("obj_map")->base(); | |
| 867 | const UINT8 *const ic73 = ic106 + 0x4000; | |
| 864 | 868 | |
| 865 | const UINT8 *const pixdata_rgn = | |
| 869 | const UINT8 *const pixdata_rgn = memregion("obj_tiles")->base(); | |
| 866 | 870 | |
| 867 | 871 | for (offs = 0x0; offs <= 0x300; offs += 8) |
| 868 | 872 | { |
| r243192 | r243193 | |
| 991 | 995 | dataend |= ic106_data & 0x40; |
| 992 | 996 | |
| 993 | 997 | /* Retrieve data for an 8x8 tile */ |
| 994 | ic73_data = ic73[rom_addr2 | |
| 998 | ic73_data = ic73[rom_addr2]; | |
| 995 | 999 | |
| 996 | 1000 | /* This is the data from the LUT pair */ |
| 997 | 1001 | lut_data = (ic106_data << 8) | ic73_data; |
| r243192 | r243193 | |
| 1126 | 1130 | void tx1_state::tx1_combine_layers(bitmap_ind16 &bitmap, int screen) |
| 1127 | 1131 | { |
| 1128 | 1132 | int x, y; |
| 1129 | UINT8 *chr_pal = | |
| 1133 | UINT8 *chr_pal = memregion("proms")->base() + 0x900; | |
| 1130 | 1134 | |
| 1131 | 1135 | int x_offset = screen * 256; |
| 1132 | 1136 | |
| r243192 | r243193 | |
| 1252 | 1256 | |
| 1253 | 1257 | PALETTE_INIT_MEMBER(tx1_state,buggyboy) |
| 1254 | 1258 | { |
| 1255 | const UINT8 *co | |
| 1259 | const UINT8 *color_prom = memregion("proms")->base(); | |
| 1256 | 1260 | int i; |
| 1257 | 1261 | |
| 1258 | 1262 | for (i = 0; i < 0x100; i++) |
| r243192 | r243193 | |
| 1297 | 1301 | UINT16 *buggyboy_vram = m_vram; |
| 1298 | 1302 | INT32 x, y; |
| 1299 | 1303 | UINT32 scroll_x, scroll_y; |
| 1304 | UINT8 *chars, *gfx2; | |
| 1300 | 1305 | UINT32 total_width; |
| 1301 | 1306 | UINT32 x_mask; |
| 1302 | 1307 | |
| 1303 | 1308 | /* 2bpp characters */ |
| 1304 | const UINT8 *const chars = &m_char_tiles[0]; | |
| 1305 | const UINT8 *const gfx2 = &m_char_tiles[0x4000]; | |
| 1309 | chars = memregion("char_tiles")->base(); | |
| 1310 | gfx2 = memregion("char_tiles")->base() + 0x4000; | |
| 1306 | 1311 | |
| 1307 | 1312 | /* X/Y scroll values are the last word in char RAM */ |
| 1308 | 1313 | if (wide) |
| r243192 | r243193 | |
| 1444 | 1449 | UINT8 d1 = 0; |
| 1445 | 1450 | |
| 1446 | 1451 | /* ROM/PROM lookup tables */ |
| 1447 | const UINT8 *const rom = &m_road_rom[0]; | |
| 1448 | const UINT8 *const prom0 = &m_road_rom[0x4000]; | |
| 1449 | const UINT8 *const prom1 = &m_road_rom[0x4200]; | |
| 1450 | const UINT8 *const prom2 = &m_road_rom[0x4400]; | |
| 1452 | const UINT8 *rom = memregion("road")->base(); | |
| 1453 | const UINT8 *prom0 = rom + 0x4000; | |
| 1454 | const UINT8 *prom1 = rom + 0x4200; | |
| 1455 | const UINT8 *prom2 = rom + 0x4400; | |
| 1451 | 1456 | |
| 1452 | 1457 | /* Latch road reverse bit */ |
| 1453 | 1458 | *_rorev = !( (rom_en && rom_flip) || (!rom_en && (ls161 & 0x4000)) ); |
| r243192 | r243193 | |
| 1538 | 1543 | UINT32 rva20_6; |
| 1539 | 1544 | |
| 1540 | 1545 | /* ROM/PROM lookup tables */ |
| 1541 | const UINT8 *const rcols = &m_proms[0x1500]; | |
| 1542 | const UINT8 *const vprom = &m_road_rom[0x4600]; | |
| 1546 | const UINT8 *rcols = (UINT8*)(memregion("proms")->base() + 0x1500); | |
| 1547 | const UINT8 *vprom = memregion("road")->base() + 0x4600; | |
| 1543 | 1548 | |
| 1544 | 1549 | /* Extract constant values */ |
| 1545 | 1550 | tcmd = ((vregs.scol & 0xc000) >> 12) | ((vregs.scol & 0x00c0) >> 6); |
| r243192 | r243193 | |
| 2165 | 2170 | UINT32 rva20_6; |
| 2166 | 2171 | |
| 2167 | 2172 | /* ROM/PROM lookup tables */ |
| 2168 | const UINT8 *const rcols = &m_proms[0x1500]; | |
| 2169 | const UINT8 *const vprom = &m_road_rom[0x4600]; | |
| 2173 | const UINT8 *rcols = (UINT8*)(memregion("proms")->base() + 0x1500); | |
| 2174 | const UINT8 *vprom = memregion("road")->base() + 0x4600; | |
| 2170 | 2175 | |
| 2171 | 2176 | /* Extract constant values */ |
| 2172 | 2177 | tcmd = ((vregs.scol & 0xc000) >> 12) | ((vregs.scol & 0x00c0) >> 6); |
| r243192 | r243193 | |
| 2572 | 2577 | UINT32 x_stride; |
| 2573 | 2578 | |
| 2574 | 2579 | /* The many lookup table ROMs */ |
| 2575 | const UINT8 *const bug13 = &m_obj_luts[0]; | |
| 2576 | const UINT8 *const bug18s = &m_obj_luts[0x2000]; | |
| 2577 | const UINT8 *const bb8 = &m_proms[0x1600]; | |
| 2580 | const UINT8 *const bug13 = (UINT8*)memregion("obj_luts")->base(); | |
| 2581 | const UINT8 *const bug18s = bug13 + 0x2000; | |
| 2582 | const UINT8 *const bb8 = (UINT8*)memregion("proms")->base() + 0x1600; | |
| 2578 | 2583 | |
| 2579 | const UINT8 *const bug16s = &m_obj_map[0]; | |
| 2580 | const UINT8 *const bug17s = &m_obj_map[0x8000]; | |
| 2584 | const UINT8 *const bug16s = (UINT8*)memregion("obj_map")->base(); | |
| 2585 | const UINT8 *const bug17s = bug16s + 0x8000; | |
| 2581 | 2586 | |
| 2582 | const UINT8 *const bb9o = &m_proms[0x500]; | |
| 2583 | const UINT8 *const bb9e = &m_proms[0xd00]; | |
| 2587 | const UINT8 *const bb9o = (UINT8*)memregion("proms")->base() + 0x500; | |
| 2588 | const UINT8 *const bb9e = bb9o + 0x800; | |
| 2584 | 2589 | |
| 2585 | const UINT8 *const pixdata_rgn = | |
| 2590 | const UINT8 *const pixdata_rgn = (UINT8*)memregion("obj_tiles")->base(); | |
| 2586 | 2591 | |
| 2587 | 2592 | if (wide) |
| 2588 | 2593 | { |
| r243192 | r243193 | |
| 2922 | 2927 | |
| 2923 | 2928 | void tx1_state::bb_combine_layers(bitmap_ind16 &bitmap, int screen) |
| 2924 | 2929 | { |
| 2925 | UINT8 *chr_pal = | |
| 2930 | UINT8 *chr_pal = memregion("proms")->base() + 0x400; | |
| 2926 | 2931 | UINT32 bmp_stride; |
| 2927 | 2932 | UINT32 x_offset; |
| 2928 | 2933 | UINT32 y; |
| r243192 | r243193 | |
|---|---|---|
| 514 | 514 | |
| 515 | 515 | UINT16 *dst16,*src16; |
| 516 | 516 | UINT8 *tsrc; |
| 517 | int y_index, src_y_index, row_index, row_zoom; | |
| 517 | int i, y, y_index, src_y_index, row_index, row_zoom; | |
| 518 | 518 | |
| 519 | 519 | /* I have a fairly strong feeling these should be UINT32's, x_index is |
| 520 | 520 | falling through from max +ve to max -ve quite a lot in this routine */ |
| r243192 | r243193 | |
| 524 | 524 | UINT16 scanline[512]; |
| 525 | 525 | UINT16 row_colbank, row_scroll; |
| 526 | 526 | int flipscreen = 0; /* n/a */ |
| 527 | int machine_flip = 0; /* for ROT 180 ? */ | |
| 527 | 528 | |
| 528 | 529 | UINT16 screen_width = cliprect.width(); |
| 529 | 530 | UINT16 min_y = cliprect.min_y; |
| r243192 | r243193 | |
| 557 | 558 | y_index = 0; |
| 558 | 559 | } |
| 559 | 560 | |
| 560 | for (int y = min_y; y <= max_y; y++) | |
| 561 | if (!machine_flip) | |
| 562 | y = min_y; | |
| 563 | else | |
| 564 | y = max_y; | |
| 565 | ||
| 566 | do | |
| 561 | 567 | { |
| 562 | 568 | int a; |
| 563 | 569 | |
| r243192 | r243193 | |
| 592 | 598 | |
| 593 | 599 | if (flags & TILEMAP_DRAW_OPAQUE) |
| 594 | 600 | { |
| 595 | for (i | |
| 601 | for (i = 0; i < screen_width; i++) | |
| 596 | 602 | { |
| 597 | 603 | *dst16++ = src16[(x_index >> 16) & width_mask] + row_colbank; |
| 598 | 604 | x_index += x_step; |
| r243192 | r243193 | |
| 600 | 606 | } |
| 601 | 607 | else |
| 602 | 608 | { |
| 603 | for (i | |
| 609 | for (i = 0; i < screen_width; i++) | |
| 604 | 610 | { |
| 605 | 611 | if (tsrc[(x_index >> 16) & width_mask]) |
| 606 | 612 | *dst16++ = src16[(x_index >> 16) & width_mask] + row_colbank; |
| r243192 | r243193 | |
| 613 | 619 | bryan2_drawscanline(bitmap, 0, y, screen_width, scanline, (flags & TILEMAP_DRAW_OPAQUE) ? 0 : 1, ROT0, screen.priority(), priority); |
| 614 | 620 | |
| 615 | 621 | y_index += zoomy; |
| 622 | if (!machine_flip) y++; else y--; | |
| 616 | 623 | } |
| 624 | while ((!machine_flip && y <= max_y) || (machine_flip && y >= min_y)); | |
| 625 | ||
| 617 | 626 | } |
| 618 | 627 | |
| 619 | 628 |
| r243192 | r243193 | |
|---|---|---|
| 316 | 316 | |
| 317 | 317 | /* Banks may have changed, reset the cpu so it uses the correct reset vector */ |
| 318 | 318 | m_maincpu->reset(); |
| 319 | ||
| 319 | ||
| 320 | 320 | save_item(NAME(m_current_screen_height)); |
| 321 | 321 | } |
| 322 | 322 |
| r243192 | r243193 | |
|---|---|---|
| 112 | 112 | |
| 113 | 113 | static INPUT_PORTS_START( amaztron ) |
| 114 | 114 | PORT_START("IN.0") // R0 |
| 115 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_1) PORT_NAME("Button 1") | |
| 116 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_6) PORT_NAME("Button 6") | |
| 117 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Q) PORT_NAME("Button 11") | |
| 118 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_A) PORT_NAME("Button 16") | |
| 119 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Z) PORT_NAME("Button 21") | |
| 115 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_1) PORT_NAME("Button 1") | |
| 116 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_6) PORT_NAME("Button 6") | |
| 117 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Q) PORT_NAME("Button 11") | |
| 118 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_A) PORT_NAME("Button 16") | |
| 119 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Z) PORT_NAME("Button 21") | |
| 120 | 120 | |
| 121 | 121 | PORT_START("IN.1") // R1 |
| 122 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_2) PORT_NAME("Button 2") | |
| 123 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_7) PORT_NAME("Button 7") | |
| 124 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_W) PORT_NAME("Button 12") | |
| 125 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_S) PORT_NAME("Button 17") | |
| 126 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_X) PORT_NAME("Button 22") | |
| 122 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_2) PORT_NAME("Button 2") | |
| 123 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_7) PORT_NAME("Button 7") | |
| 124 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_W) PORT_NAME("Button 12") | |
| 125 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_S) PORT_NAME("Button 17") | |
| 126 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_X) PORT_NAME("Button 22") | |
| 127 | 127 | |
| 128 | 128 | PORT_START("IN.2") // R2 |
| 129 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_3) PORT_NAME("Button 3") | |
| 130 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_8) PORT_NAME("Button 8") | |
| 131 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_E) PORT_NAME("Button 13") | |
| 132 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_D) PORT_NAME("Button 18") | |
| 133 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_C) PORT_NAME("Button 23") | |
| 129 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_3) PORT_NAME("Button 3") | |
| 130 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_8) PORT_NAME("Button 8") | |
| 131 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_E) PORT_NAME("Button 13") | |
| 132 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_D) PORT_NAME("Button 18") | |
| 133 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_C) PORT_NAME("Button 23") | |
| 134 | 134 | |
| 135 | 135 | PORT_START("IN.3") // R3 |
| 136 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_4) PORT_NAME("Button 4") | |
| 137 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_9) PORT_NAME("Button 9") | |
| 138 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_R) PORT_NAME("Button 14") | |
| 139 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_F) PORT_NAME("Button 19") | |
| 140 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_V) PORT_NAME("Button 24") | |
| 136 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_4) PORT_NAME("Button 4") | |
| 137 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_9) PORT_NAME("Button 9") | |
| 138 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_R) PORT_NAME("Button 14") | |
| 139 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_F) PORT_NAME("Button 19") | |
| 140 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_V) PORT_NAME("Button 24") | |
| 141 | 141 | |
| 142 | 142 | PORT_START("IN.4") // R4 |
| 143 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_5) PORT_NAME("Button 5") | |
| 144 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_0) PORT_NAME("Button 10") | |
| 145 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_T) PORT_NAME("Button 15") | |
| 146 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_G) PORT_NAME("Button 20") | |
| 147 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_B) PORT_NAME("Button 25") | |
| 143 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_5) PORT_NAME("Button 5") | |
| 144 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_0) PORT_NAME("Button 10") | |
| 145 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_T) PORT_NAME("Button 15") | |
| 146 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_G) PORT_NAME("Button 20") | |
| 147 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_B) PORT_NAME("Button 25") | |
| 148 | 148 | |
| 149 | 149 | PORT_START("IN.5") // R5 |
| 150 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_M) PORT_NAME("Game Select") | |
| 151 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_N) PORT_NAME("Game Start") | |
| 150 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_M) PORT_NAME("Game Select") | |
| 151 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_N) PORT_NAME("Game Start") | |
| 152 | 152 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) |
| 153 | 153 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_UNUSED) |
| 154 | 154 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) |
| r243192 | r243193 | |
|---|---|---|
| 5 | 5 | Applix 1616 computer |
| 6 | 6 | |
| 7 | 7 | See for docs: http;//www.microbee-mspp.org.au |
| 8 | You need to sign up and make an introductory thread. | |
| 9 | Then you will be granted permission to visit the repository. | |
| 8 | 10 | |
| 9 | 11 | First revealed to the world in December 1986 issue of Electronics Today |
| 10 | 12 | International (ETI) an Australian electronics magazine which is now defunct. |
| r243192 | r243193 | |
| 934 | 936 | /* Driver */ |
| 935 | 937 | |
| 936 | 938 | /* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ |
| 937 | COMP( 1986, applix, 0, 0, applix, applix, applix_state, applix, "Applix Pty Ltd", "Applix 1616", | |
| 939 | COMP( 1986, applix, 0, 0, applix, applix, applix_state, applix, "Applix Pty Ltd", "Applix 1616", GAME_NOT_WORKING ) | |
| 938 | 940 | |
| 939 | 941 | |
| 940 | 942 |
| r243192 | r243193 | |
|---|---|---|
| 56 | 56 | m_video_ram.allocate(0x20000); |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | MC6845_UPDATE_ROW( fp_state::update_row ) | |
| 60 | { | |
| 61 | } | |
| 62 | 59 | |
| 63 | 60 | UINT32 fp_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 64 | 61 | { |
| r243192 | r243193 | |
| 507 | 504 | MCFG_MC6845_ADD(MC6845_TAG, MC6845, SCREEN_CRT_TAG, 4000000) |
| 508 | 505 | MCFG_MC6845_SHOW_BORDER_AREA(false) |
| 509 | 506 | MCFG_MC6845_CHAR_WIDTH(8) |
| 510 | MCFG_MC6845_UPDATE_ROW_CB(fp_state, update_row) | |
| 511 | 507 | |
| 512 | 508 | // sound hardware |
| 513 | 509 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| r243192 | r243193 | |
|---|---|---|
| 1 | // license:MAME|GPL2+ | |
| 2 | // copyright-holders:Felipe Sanches | |
| 3 | /*************************************************************************** | |
| 4 | This driver covers only the Operator Panel of the BancTec 91690 Document Processor equipment | |
| 5 | ||
| 6 | Author: Felipe Sanches <juca@members.fsf.org> | |
| 7 | ||
| 8 | Maintainence Manual: <https://garoa.net.br/w/images/PAINEL_BANCTEC_91690.PDF> | |
| 9 | */ | |
| 10 | ||
| 11 | #include "emu.h" | |
| 12 | #include "cpu/mcs51/mcs51.h" | |
| 13 | #include "cpu/m6805/m6805.h" | |
| 14 | #include "includes/banctec.h" | |
| 15 | #include "video/mc6845.h" | |
| 16 | ||
| 17 | static ADDRESS_MAP_START( banctec_mem , AS_PROGRAM, 8, banctec_state ) | |
| 18 | AM_RANGE(0x0000, 0x07ff) AM_ROM | |
| 19 | AM_RANGE(0x0800, 0xffff) AM_RAM /* Probably wrong. Must be verified on pcb! */ | |
| 20 | ADDRESS_MAP_END | |
| 21 | ||
| 22 | static ADDRESS_MAP_START( banctec_mcu_mem , AS_PROGRAM, 8, banctec_state ) | |
| 23 | AM_RANGE(0x0000, 0x1fff) AM_ROM | |
| 24 | AM_RANGE(0x2000, 0x7fff) AM_RAM /* Probably wrong. Must be verified on pcb! */ | |
| 25 | AM_RANGE(0x8000, 0xffff) AM_RAM AM_SHARE("videoram") /* Probably wrong. Must be verified on pcb! */ | |
| 26 | ADDRESS_MAP_END | |
| 27 | ||
| 28 | void banctec_state::machine_reset() | |
| 29 | { | |
| 30 | } | |
| 31 | ||
| 32 | ||
| 33 | /**************************** | |
| 34 | * Video/Character functions * | |
| 35 | ****************************/ | |
| 36 | ||
| 37 | TILE_GET_INFO_MEMBER(banctec_state::get_bg_tile_info) | |
| 38 | { | |
| 39 | UINT8 *videoram = m_videoram; | |
| 40 | int code = videoram[tile_index]; | |
| 41 | int color = 1; | |
| 42 | ||
| 43 | SET_TILE_INFO_MEMBER(0, code, color, 0); | |
| 44 | } | |
| 45 | ||
| 46 | void banctec_state::video_start() | |
| 47 | { | |
| 48 | m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(banctec_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 40, 25); | |
| 49 | } | |
| 50 | ||
| 51 | UINT32 banctec_state::screen_update_banctec(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) | |
| 52 | { | |
| 53 | m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); | |
| 54 | ||
| 55 | return 0; | |
| 56 | } | |
| 57 | ||
| 58 | /* ROCKWELL 6545 - Transparent Memory Addressing */ | |
| 59 | ||
| 60 | MC6845_ON_UPDATE_ADDR_CHANGED(banctec_state::crtc_addr) | |
| 61 | { | |
| 62 | /* What is this function meant to do ? */ | |
| 63 | } | |
| 64 | ||
| 65 | /****************************** | |
| 66 | * Graphics Decode Information * | |
| 67 | ******************************/ | |
| 68 | ||
| 69 | const gfx_layout banctec_gfx_layout = | |
| 70 | { | |
| 71 | 8, 8, /* 8x8 characters */ | |
| 72 | 256, /* 256 characters */ | |
| 73 | 1, /* 1 bits per pixel */ | |
| 74 | {0}, /* no bitplanes; 1 bit per pixel */ | |
| 75 | {0, 1, 2, 3, 4, 5, 6, 7}, | |
| 76 | {0 * 256*8, 1 * 256*8, 2 * 256*8, 3 * 256*8, 4 * 256*8, 5 * 256*8, 6 * 256*8, 7 * 256*8}, | |
| 77 | 8 /* size of one char */ | |
| 78 | }; | |
| 79 | ||
| 80 | static GFXDECODE_START( banctec ) | |
| 81 | GFXDECODE_ENTRY( "gfx", 0x00000, banctec_gfx_layout, 0, 2 ) | |
| 82 | GFXDECODE_END | |
| 83 | ||
| 84 | static MACHINE_CONFIG_START( banctec, banctec_state ) | |
| 85 | /* basic machine hardware */ | |
| 86 | ||
| 87 | MCFG_CPU_ADD("maincpu", I80C31, XTAL_11_0592MHz) | |
| 88 | MCFG_CPU_PROGRAM_MAP(banctec_mem) | |
| 89 | ||
| 90 | MCFG_CPU_ADD("mcu", M6805, 4000000) /* Actual MCU is a Motorola 6803 and the clock frequency is still unknown */ | |
| 91 | MCFG_CPU_PROGRAM_MAP(banctec_mcu_mem) | |
| 92 | ||
| 93 | // The video signal is generated by a R6545EAP character generator chip | |
| 94 | // The U20 EPROM holds the image data for the character set. | |
| 95 | ||
| 96 | // video hardware | |
| 97 | MCFG_SCREEN_ADD("screen", RASTER) | |
| 98 | MCFG_SCREEN_REFRESH_RATE(60) | |
| 99 | MCFG_SCREEN_SIZE((52+1)*8, (31+1)*8) | |
| 100 | MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 25*8-1) | |
| 101 | MCFG_SCREEN_UPDATE_DRIVER(banctec_state, screen_update_banctec) | |
| 102 | MCFG_SCREEN_PALETTE("palette") | |
| 103 | ||
| 104 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", banctec) | |
| 105 | MCFG_PALETTE_ADD("palette", 2) | |
| 106 | // MCFG_PALETTE_INIT_OWNER(banctec_state, banctec) | |
| 107 | ||
| 108 | MCFG_MC6845_ADD("crtc", R6545_1, "screen", XTAL_20MHz) /* (?) */ | |
| 109 | MCFG_MC6845_SHOW_BORDER_AREA(false) | |
| 110 | MCFG_MC6845_CHAR_WIDTH(8) | |
| 111 | MCFG_MC6845_ADDR_CHANGED_CB(banctec_state, crtc_addr) | |
| 112 | ||
| 113 | MACHINE_CONFIG_END | |
| 114 | ||
| 115 | ROM_START(banctec) | |
| 116 | ROM_REGION(0x800,"maincpu",0) | |
| 117 | ROM_LOAD("banctec_eseries_panel_opnl.u20", 0x000, 0x800, CRC(c2ab9c06) SHA1(a296589034f656790ad5ffbce028dd846a40cf03)) | |
| 118 | ||
| 119 | ROM_REGION(0x2000,"mcu",0) | |
| 120 | ROM_LOAD("banctec_eseries_panel.u8", 0x0000, 0x2000, CRC(f3335e0a) SHA1(5ca45fdcb7ef45a65c28c79abfa9ebb7a8a06619)) | |
| 121 | ||
| 122 | ROM_REGION(0x1000,"gfx",0) | |
| 123 | ROM_LOAD("banctec_eseries_panel.u20", 0x0000, 0x1000, CRC(5b6ecec9) SHA1(35aff8f965bce77205e3a43d71e39097585091a7)) | |
| 124 | ROM_END | |
| 125 | ||
| 126 | /*************************************************************************** | |
| 127 | ||
| 128 | Game driver(s) | |
| 129 | ||
| 130 | ***************************************************************************/ | |
| 131 | ||
| 132 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT MONITOR COMPANY FULLNAME */ | |
| 133 | CONS( 1989, banctec, 0, 0, banctec, 0, driver_device, 0, "DALE Electronics", "BancTec ESeries Panel", GAME_NOT_WORKING | GAME_NO_SOUND) |
| r243192 | r243193 | |
|---|---|---|
| 484 | 484 | save_item(NAME(m_motor_on)); |
| 485 | 485 | save_item(NAME(m_motor0)); |
| 486 | 486 | save_item(NAME(m_motor1)); |
| 487 | save_item(NAME(m_centronics_busy)); | |
| 488 | save_item(NAME(m_centronics_fault)); | |
| 489 | save_item(NAME(m_centronics_perror)); | |
| 490 | machine().save().register_postload(save_prepost_delegate(FUNC(bw12_state::bankswitch), this)); | |
| 491 | 487 | } |
| 492 | 488 | |
| 493 | 489 | void bw12_state::machine_reset() |
| r243192 | r243193 | |
|---|---|---|
| 76 | 76 | *************************************/ |
| 77 | 77 | |
| 78 | 78 | static ADDRESS_MAP_START( c65_mem , AS_PROGRAM, 8, c65_state ) |
| 79 | AM_RANGE(0x00000, 0x07fff) AM_RAMBANK("bank11") | |
| 80 | AM_RANGE(0x08000, 0x09fff) AM_READ_BANK("bank1") AM_WRITE_BANK("bank12") | |
| 81 | AM_RANGE(0x0a000, 0x0bfff) AM_READ_BANK("bank2") AM_WRITE_BANK("bank13") | |
| 82 | AM_RANGE(0x0c000, 0x0cfff) AM_READ_BANK("bank3") AM_WRITE_BANK("bank14") | |
| 83 | AM_RANGE(0x0d000, 0x0d7ff) AM_READ_BANK("bank4") AM_WRITE_BANK("bank5") | |
| 84 | AM_RANGE(0x0d800, 0x0dbff) AM_READ_BANK("bank6") AM_WRITE_BANK("bank7") | |
| 85 | AM_RANGE(0x0dc00, 0x0dfff) AM_READ_BANK("bank8") AM_WRITE_BANK("bank9") | |
| 86 | AM_RANGE(0x0e000, 0x0ffff) AM_READ_BANK("bank10") AM_WRITE_BANK("bank15") | |
| 87 | AM_RANGE(0x10000, 0x1f7ff) AM_RAM | |
| 88 | AM_RANGE(0x1f800, 0x1ffff) AM_RAM AM_SHARE("colorram") | |
| 79 | AM_RANGE(0xf0000, 0xf7fff) AM_RAMBANK("bank11") | |
| 80 | AM_RANGE(0xf8000, 0xf9fff) AM_READ_BANK("bank1") AM_WRITE_BANK("bank12") | |
| 81 | AM_RANGE(0xfa000, 0xfbfff) AM_READ_BANK("bank2") AM_WRITE_BANK("bank13") | |
| 82 | AM_RANGE(0xfc000, 0xfcfff) AM_READ_BANK("bank3") AM_WRITE_BANK("bank14") | |
| 83 | AM_RANGE(0xfd000, 0xfd7ff) AM_READ_BANK("bank4") AM_WRITE_BANK("bank5") | |
| 84 | AM_RANGE(0xfd800, 0xfdbff) AM_READ_BANK("bank6") AM_WRITE_BANK("bank7") | |
| 85 | AM_RANGE(0xfdc00, 0xfdfff) AM_READ_BANK("bank8") AM_WRITE_BANK("bank9") | |
| 86 | AM_RANGE(0xfe000, 0xfffff) AM_READ_BANK("bank10") AM_WRITE_BANK("bank15") | |
| 87 | // AM_RANGE(0x10000, 0x1f7ff) AM_RAM | |
| 88 | // AM_RANGE(0x1f800, 0x1ffff) AM_RAM AM_SHARE("colorram") | |
| 89 | AM_RANGE(0x00000, 0x1ffff) AM_ROM AM_REGION("maincpu",0x20000) | |
| 90 | ||
| 91 | AM_RANGE(0x20000, 0x207ff) AM_RAM AM_SHARE("colorram") | |
| 89 | 92 | |
| 90 | 93 | AM_RANGE(0x20000, 0x23fff) AM_ROM /* &c65_dos, maps to 0x8000 */ |
| 91 | 94 | AM_RANGE(0x24000, 0x28fff) AM_ROM /* reserved */ |
| r243192 | r243193 | |
|---|---|---|
| 219 | 219 | J3: Floppy Connector |
| 220 | 220 | (standard DIL 34 pin 2-row rectangular connector for mini-shugart/pc floppy cable; pin 2 IS connected somewhere and ?probably? is used for /DISKCHANGE like on an Amiga, with pin 34 being /TRUEREADY?) |
| 221 | 221 | (as opposed to normal ibm pc 3.5" drives where pin 2 is unconnected or is /DENSITY *input to drive*, and pin 34 is /DISKCHANGE) |
| 222 | J4: 18-pin sip header for keyboard ribbon cable; bottom edge of board is pin 1 | |
| 223 | Pins: | |
| 224 | 1: GND through 220k resistor r78 | |
| 225 | 2: ? phone hook related? anode of diode d7; one of the pins of relay k2; topmost (boardwise) pin of transistor Q10 | |
| 226 | 3: 74HCT34 pin | |
| 227 | ||
| 222 | J4: 18-pin sip header for keyboard ribbon cable | |
| 223 | (needs tracing to see the VIA hookup order) | |
| 228 | 224 | J5: locking-tab-type "CONN HEADER VERT 4POS .100 TIN" connector for supplying power |
| 229 | 225 | through a small cable with a berg connector at the other end, to the floppy drive |
| 230 | 226 | (5v gnd gnd 12v) |
| r243192 | r243193 | |
| 236 | 232 | J9: unpopulated DIL 40-pin straight connector for a ROM debug/expansion/RAM-shadow daughterboard |
| 237 | 233 | the pins after pin 12 connect to that of the ROM-LO 27256 pinout counting pins 1,28,2,27,3,26,etc |
| 238 | 234 | the ROM-HI rom has a different /HICE pin which is not connected to this connector |
| 239 | /LOCE is a15 | |
| 240 | /HICE is !a15 | |
| 241 | /ROM_OE comes from pin 14 of DECODE_E pal, and is shorted to /ROM_OE' by the cuttable jumper B1 which is not cut | |
| 242 | /ROM_OE' goes to the two EPROMS | |
| 243 | DECODE_18 is DECODE_E pal pin 18 | |
| 235 | /LOCE is most likely !(a19|a18)&a15 | |
| 236 | /HICE is most likely !(a19|a18)&!a15 | |
| 244 | 237 | pin 1 (GND) is in the lower left and the pins count low-high then to the right |
| 245 | (gnd N/C E_CLK R/W /ROM_OE a17 vcc a14 a13 a8 a9 a11 /ROM_OE' a10 a15 d7 d6 d5 d4 d3 ) | |
| 246 | (GND /IPL1 DECODE_18 /RESET gnd a16 vcc a12 a7 a6 a5 a4 a3 a2 a1 a0 d0 d1 d2 gnd) | |
| 238 | (gnd ? ? ? ? ? vcc a14 a13 a8 a9 a11 /OE a10 /LOCE d7 d6 d5 d4 d3 ) | |
| 239 | (GND ? ? ? gnd ? vcc a12 a7 a6 a5 a4 a3 a2 a1 a0 d0 d1 d2 gnd) | |
| 247 | 240 | Jx: 4 pin on top side, 6 pin on bottom side edge ?debug? connector (doesn't have a Jx number) |
| 248 | 241 | (trace me!) |
| 249 | 242 | B1: a cuttable trace on the pcb. Not cut, affects one of the pins on the unpopulated J9 connector only. |
| r243192 | r243193 | |
| 336 | 329 | - Forth button (on the port on the back; keep in mind shift-usefront-space ALWAYS enables forth on a swyft) |
| 337 | 330 | - Multple undumped firmware revisions exist (330 and 331 are dumped) |
| 338 | 331 | |
| 339 | // 74ls107 @ u18 pin 1 is 68008 /BERR pin | |
| 340 | ||
| 341 | // mc6850 @ u33 pin 2 (RX_DATA) is | |
| 342 | // mc6850 @ u33 pin 3 (RX_CLK) is 6522 @ u35 pin 17 (PB7) | |
| 343 | // mc6850 @ u33 pin 4 (TX_CLK) is 6522 @ u35 pin 17 (PB7) | |
| 344 | // mc6850 @ u33 pin 5 (/RTS) is | |
| 345 | // mc6850 @ u33 pin 6 (TX_DATA) is | |
| 346 | // mc6850 @ u33 pin 7 (/IRQ) is 68008 /IPL1 pin 41 | |
| 347 | // mc6850 @ u33 pin 8 (CS0) is 68008 A12 pin 10 | |
| 348 | // mc6850 @ u33 pin 9 (CS2) is DECODE E pin 18 | |
| 349 | // mc6850 @ u33 pin 10 (CS1) is 68008 /BERR pin 40 | |
| 350 | // mc6850 @ u33 pin 11 (RS) is 68008 A0 pin 46 | |
| 351 | // mc6850 @ u33 pin 13 (R/W) is 68008 R/W pin 30 | |
| 352 | // mc6850 @ u33 pin 14 (E) is 68008 E pin 38 | |
| 353 | // mc6850 @ u33 pin 15-22 (D7-D0) are 68008 D7 to D0 pins 20-27 | |
| 354 | // mc6850 @ u33 pin 23 (/DCD) is 74hc02 @ u35 pin 1 | |
| 355 | // mc6850 @ u33 pin 24 (/CTS) is N/C? | |
| 356 | ||
| 357 | // 6522 @ u34: | |
| 358 | // pin 2 (PA0) : | |
| 359 | // pin 3 (PA1) : | |
| 360 | // pin 4 (PA2) : | |
| 361 | // pin 5 (PA3) : | |
| 362 | // pin 6 (PA4) : | |
| 363 | // pin 7 (PA5) : | |
| 364 | // pin 8 (PA6) : | |
| 365 | // pin 9 (PA7) : | |
| 366 | // pin 10 (PB0) : | |
| 367 | // pin 11 (PB1) : | |
| 368 | // pin 12 (PB2) : | |
| 369 | // pin 13 (PB3) : | |
| 370 | // pin 14 (PB4) : | |
| 371 | // pin 15 (PB5) : | |
| 372 | // pin 16 (PB6) : | |
| 373 | // pin 17 (PB7) : | |
| 374 | // pin 18 (CB1) : ?from/to? Floppy connector j3 pin 8 | |
| 375 | // pin 19 (CB2) : ?from/to? 6522 @ u35 pin 16 (PB6) | |
| 376 | // pin 21 (/IRQ) : out to 68008 /IPL1 pin 41 | |
| 377 | // pin 22 (R/W) : in from 68008 R/W pin 30 | |
| 378 | // pin 23 (/CS2) : in from DECODE E pin 18 | |
| 379 | // pin 24 (CS1) : in from 68008 A13 pin 11 | |
| 380 | // pin 25 (Phi2) : in from 68008 E pin 38 | |
| 381 | // pins 26-33 : in/out from/to 68008 D7 to D0 pins 20-27 | |
| 382 | // pin 34 (/RES) : in from 68008 /RESET pin 37 AND 68008 /HALT pin 36 | |
| 383 | // pins 35-38 (RS3-RS0) are 68008 A9-A6 pins 7-4 | |
| 384 | // pin 39 (CA2) is through inductor L11 and resistor r128 to peripheral connector pin 35 <end minus 26> | |
| 385 | // pin 40 (CA1) is through inductor L30 and resistor r138 to peripheral connector pin 53 <end minus 8> | |
| 386 | ||
| 387 | // 6522 @ u35 | |
| 388 | // pin 2 (PA0) : | |
| 389 | // pin 3 (PA1) : | |
| 390 | // pin 4 (PA2) : | |
| 391 | // pin 5 (PA3) : | |
| 392 | // pin 6 (PA4) : | |
| 393 | // pin 7 (PA5) : | |
| 394 | // pin 8 (PA6) : | |
| 395 | // pin 9 (PA7) : | |
| 396 | // pin 10 (PB0) : | |
| 397 | // pin 11 (PB1) : in from 74hc02 @ u36 pin 4 | |
| 398 | // pin 12 (PB2) : | |
| 399 | // pin 13 (PB3) : | |
| 400 | // pin 14 (PB4) : | |
| 401 | // pin 15 (PB5) : | |
| 402 | // pin 16 (PB6) : 6522 @ u34 pin 19 (CB2) | |
| 403 | // pin 17 (PB7) : mc6850 @ u33 pins 3 and 4 (RX_CLK, TX_CLK) | |
| 404 | // pin 18 (CB1) : ds1489an @ u45 pin 11 | |
| 405 | // pin 19 (CB2) : mn4053b @ u40 pin 11 and mc14412 @ u41 pin 10 | |
| 406 | // pin 21 (/IRQ) : out to 68008 /IPL1 pin 41 | |
| 407 | // pin 22 (R/W) : in from 68008 R/W pin 30 | |
| 408 | // pin 23 (/CS2) : in from DECODE E pin 18 | |
| 409 | // pin 24 (CS1) : in from 68008 A14 pin 12 | |
| 410 | // pin 25 (Phi2) : in from 68008 E pin 38 | |
| 411 | // pins 26-33 : in/out from/to 68008 D7 to D0 pins 20-27 | |
| 412 | // pin 34 (/RES) : in from 68008 /RESET pin 37 AND 68008 /HALT pin 36 | |
| 413 | // pins 35-38 (RS3-RS0) : in from 68008 A9-A6 pins 7-4 | |
| 414 | // pin 39 (CA2) : out to 74HCT34 pin 11 (CLK) (keyboard column latch) | |
| 415 | // pin 40 (CA1) : out? to? ds1489an @ u45 pin 8 | |
| 416 | ||
| 417 | // 74hc02 @ u36: | |
| 418 | // pin 1 (Y1) : out to mc6850 @ u33 pin 23 /DCD | |
| 419 | // pin 2 (A1) : in from (2 places: resistor R58 to ua339 @ u38 pin 4 (In1-)) <where does this actually come from? modem offhook?> | |
| 420 | // pin 3 (B1) : in from mn4053b @ u40 pin 10 <probably from rs232> | |
| 421 | // pin 4 (Y2) : out to 6522 @u35 pin 11 | |
| 422 | // pin 5 (A2) : in from 4N37 @ u48 pin 5 (output side emitter pin) (tied via R189 to gnd) <ring indicator?> | |
| 423 | // pin 6 (B2) : in from 4N37 @ u48 pin 5 (output side emitter pin) (tied via R189 to gnd) <ring indicator?> | |
| 424 | // pin 8 (B3) : | |
| 425 | // pin 9 (A3) : | |
| 426 | // pin 10 (Y3) : | |
| 427 | // pin 11 (B4) : in from 68008 A15 | |
| 428 | // pin 12 (A4) : in from 68008 A15 | |
| 429 | // pin 13 (Y4) : out to EPROM @ U31 /CE | |
| 430 | ||
| 431 | 332 | ****************************************************************************/ |
| 432 | 333 | |
| 433 | 334 | // Defines |
| r243192 | r243193 | |
| 1364 | 1265 | x x x x 0 0 ? ? 1 * * * * * * * * * * * * * * * R ROM-HI (/LOCE is 1, /HICE is 0) |
| 1365 | 1266 | x x x x 0 1 * * * * * * * * * * * * * * * * * a RW RAM |
| 1366 | 1267 | x x x x 1 1 ?0? ?1? ? ? ? ? ? ? ? ? ? ? ? ? * * * * R ? status of something? floppy? |
| 1367 | x x x x 1 1 ?1? ?0? ? 0 0 1 x x x x x x x x x x x * RW 6850 acia @U33, gets 0x55 steadystate and 0x57 written to it to reset it | |
| 1368 | x x x x 1 1 ?1? ?0? ? 0 1 0 x x * * * * x x x x x x RW Parallel VIA 0 @ U34 | |
| 1369 | x x x x 1 1 ?1? ?0? ? 1 0 0 x x * * * * x x x x x x RW Keyboard VIA 1 @ U35 | |
| 1268 | x x x x 1 1 ?1? ?0? ? 0 0 1 ? ? ? ? ? ? ? ? ? ? ? ? ?R?W 6850 acia control reg lives here, gets 0x55 steadystate and 0x57 written to it to reset it | |
| 1269 | x x x x 1 1 ?1? ?0? ? 0 1 0 ? ? * * * * ?*? ? ? ? ? ? RW VIA 0 | |
| 1270 | x x x x 1 1 ?1? ?0? ? 1 0 0 ? ? * * * * ?*? ? ? ? ? ? RW VIA 1 | |
| 1370 | 1271 | ^ ^ ^ ^ ^ |
| 1371 | ||
| 1372 | 1272 | */ |
| 1373 | 1273 | |
| 1374 | 1274 | /* Swyft rom and ram notes: |
| r243192 | r243193 | |
| 1678 | 1578 | MCFG_VIDEO_START_OVERRIDE(cat_state,swyft) |
| 1679 | 1579 | |
| 1680 | 1580 | MCFG_DEVICE_ADD("acia6850", ACIA6850, 0) |
| 1681 | // acia rx and tx clocks come from one of the VIA pins and are tied together, fix this below? acia e clock comes from 68008 | |
| 1682 | MCFG_DEVICE_ADD("acia_clock", CLOCK, (XTAL_15_8976MHz/2)/5) // out e clock from 68008, ~ 10in clocks per out clock | |
| 1581 | ||
| 1582 | MCFG_DEVICE_ADD("acia_clock", CLOCK, 3579545) // guess | |
| 1683 | 1583 | MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(cat_state, write_acia_clock)) |
| 1684 | 1584 | |
| 1685 | MCFG_DEVICE_ADD("via6522_0", VIA6522, | |
| 1585 | MCFG_DEVICE_ADD("via6522_0", VIA6522, XTAL_15_8976MHz/16) // unknown clock, GUESSED | |
| 1686 | 1586 | MCFG_VIA6522_READPA_HANDLER(READ8(cat_state, via0_pa_r)) |
| 1687 | 1587 | MCFG_VIA6522_READPB_HANDLER(READ8(cat_state, via0_pb_r)) |
| 1688 | 1588 | MCFG_VIA6522_WRITEPA_HANDLER(WRITE8(cat_state, via0_pa_w)) |
| r243192 | r243193 | |
| 1692 | 1592 | MCFG_VIA6522_CB2_HANDLER(WRITELINE(cat_state, via0_cb2_w)) |
| 1693 | 1593 | MCFG_VIA6522_IRQ_HANDLER(WRITELINE(cat_state, via0_int_w)) |
| 1694 | 1594 | |
| 1695 | MCFG_DEVICE_ADD("via6522_1", VIA6522, | |
| 1595 | MCFG_DEVICE_ADD("via6522_1", VIA6522, XTAL_15_8976MHz/16) // unknown clock, GUESSED | |
| 1696 | 1596 | MCFG_VIA6522_READPA_HANDLER(READ8(cat_state, via1_pa_r)) |
| 1697 | 1597 | MCFG_VIA6522_READPB_HANDLER(READ8(cat_state, via1_pb_r)) |
| 1698 | 1598 | MCFG_VIA6522_WRITEPA_HANDLER(WRITE8(cat_state, via1_pa_w)) |
| r243192 | r243193 | |
| 1723 | 1623 | */ |
| 1724 | 1624 | /* U9: Timing AMPAL16R4 |
| 1725 | 1625 | * |
| 1726 | * pins: | |
| 1727 | * 111111111000000000 | |
| 1728 | * 987654321987654321 | |
| 1729 | * ??QQQQ??EIIIIIIIIC | |
| 1730 | * |||||||||||||||||\-< /CK input - 15.8976mhz crystal and transistor oscillator | |
| 1731 | * ||||||||||||||||\--< ? | |
| 1732 | * |||||||||||||||\---< ? | |
| 1733 | * ||||||||||||||\----< ? | |
| 1734 | * |||||||||||||\-----< ?<also input to decode pal pin 1, video pal pin 1, source is ?> | |
| 1735 | * ||||||||||||\------< ? | |
| 1736 | * |||||||||||\-------< ? | |
| 1737 | * ||||||||||\--------< ? | |
| 1738 | * |||||||||\---------< ? | |
| 1739 | * ||||||||\----------< /OE input - shorted to GND | |
| 1740 | * |||||||\-----------? ? | |
| 1741 | * ||||||\------------? ? | |
| 1742 | * |||||\------------Q> /ROM_OE (to both eproms through jumper b1 and optionally j9 connector) | |
| 1743 | * ||||\-------------Q? ? | |
| 1744 | * |||\--------------Q? ? | |
| 1745 | * ||\---------------Q> output to decode pal pin 2 | |
| 1746 | * |\----------------->? output? to ram multiplexer 'A' pins | |
| 1747 | * \------------------< ? | |
| 1748 | */ | |
| 1749 | ROM_LOAD( "timing_b.ampal16r4a.u9.jed", 0x0000, 0xb08, CRC(643e6e83) SHA1(7db167883f9d6cf385ce496d08976dc16fc3e2c3)) | |
| 1750 | /* U20: Decode AMPAL16L8 | |
| 1626 | * input | |
| 1627 | * 76543210 | |
| 1628 | * |||||||\-- ? | |
| 1629 | * ||||||\--- ? | |
| 1630 | * |||||\---- ? | |
| 1631 | * ||||\----- ? | |
| 1632 | * |||\------ ? | |
| 1633 | * ||\------- ? | |
| 1634 | * |\-------- ? | |
| 1635 | * \--------- ? | |
| 1636 | * /CK ------ 15.8976mhz crystal and transistor oscillator | |
| 1637 | * /OE ------ ? | |
| 1751 | 1638 | * |
| 1752 | * pins: | |
| 1753 | * 111111111000000000 | |
| 1754 | * 987654321987654321 | |
| 1755 | * O??????OIIIIIIIIII | |
| 1756 | * |||||||||||||||||\-< TIMING PAL pin 5 | |
| 1757 | * ||||||||||||||||\--< TIMING PAL pin 17 | |
| 1758 | * |||||||||||||||\---< 68008 R/W (pin 30) | |
| 1759 | * ||||||||||||||\----< 68008 /DS (pin 29) | |
| 1760 | * |||||||||||||\-----< 68008 E (pin 38) | |
| 1761 | * ||||||||||||\------< 68008 A19 | |
| 1762 | * |||||||||||\-------< 68008 A18 | |
| 1763 | * ||||||||||\--------< 68008 A17 | |
| 1764 | * |||||||||\---------< 68008 A16 | |
| 1765 | * ||||||||\----------< ? | |
| 1766 | * |||||||\-----------> ? | |
| 1767 | * ||||||\------------? 68008 /VPA (pin 39) | |
| 1768 | * |||||\-------------> /ROM_OE (to both eproms through jumper b1 and optionally j9 connector) | |
| 1769 | * ||||\--------------? ? | |
| 1770 | * |||\---------------? ? | |
| 1771 | * ||\----------------? ? | |
| 1772 | * |\-----------------? goes to j9 connector pin 5 | |
| 1773 | * \------------------< ? | |
| 1639 | * output | |
| 1640 | * 76543210 | |
| 1641 | * |||||||\-- ? | |
| 1642 | * ||||||\--- ? | |
| 1643 | * |||||\-R-- ? | |
| 1644 | * ||||\--R-- ? | |
| 1645 | * |||\---R-- ? | |
| 1646 | * ||\----R-- ? | |
| 1647 | * |\-------- ? | |
| 1648 | * \--------- ? | |
| 1774 | 1649 | */ |
| 1650 | ROM_LOAD( "timing_b.ampal16r4a.u9.jed", 0x0000, 0xb08, CRC(643e6e83) SHA1(7db167883f9d6cf385ce496d08976dc16fc3e2c3)) | |
| 1775 | 1651 | ROM_LOAD( "decode_e.ampal16l8.u20.jed", 0x1000, 0xb08, CRC(0b1dbd76) SHA1(08c144ad7a7bbdd53eefd271b2f6813f8b3b1594)) |
| 1776 | 1652 | ROM_LOAD( "video_2b.ampal16r4.u25.jed", 0x2000, 0xb08, CRC(caf91148) SHA1(3f8ddcb512a1c05395c74ad9a6ba7b87027ce4ec)) |
| 1777 | 1653 | ROM_LOAD( "disk_3.5c.ampal16r4.u28.jed", 0x3000, 0xb08, CRC(fd994d02) SHA1(f910ab16587dd248d63017da1e5b37855e4c1a0c)) |
| r243192 | r243193 | |
|---|---|---|
| 155 | 155 | |
| 156 | 156 | static INPUT_PORTS_START( cnsector ) |
| 157 | 157 | PORT_START("IN.0") // O0 |
| 158 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_Q) PORT_NAME("Next Ship") | |
| 159 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_A) PORT_NAME("Left") | |
| 158 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) PORT_NAME("Next Ship") | |
| 159 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A) PORT_NAME("Left") | |
| 160 | 160 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 161 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEY | |
| 161 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Z) PORT_NAME("Range") | |
| 162 | 162 | |
| 163 | 163 | PORT_START("IN.1") // O1 |
| 164 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_X) PORT_NAME("Aim") | |
| 165 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_S) PORT_NAME("Right") | |
| 164 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_NAME("Aim") | |
| 165 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S) PORT_NAME("Right") | |
| 166 | 166 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 167 | 167 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 168 | 168 | |
| 169 | 169 | PORT_START("IN.2") // O2 |
| 170 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_C) PORT_NAME("Fire") | |
| 171 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_J) PORT_NAME("Evasive Sub") // expert button | |
| 170 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C) PORT_NAME("Fire") | |
| 171 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J) PORT_NAME("Evasive Sub") // expert button | |
| 172 | 172 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 173 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEY | |
| 173 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_NAME("Recall") | |
| 174 | 174 | |
| 175 | 175 | PORT_START("IN.3") // O3 |
| 176 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_M) PORT_NAME("Sub Finder") // expert button | |
| 177 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_F) PORT_NAME("Slower") | |
| 176 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M) PORT_NAME("Sub Finder") // expert button | |
| 177 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F) PORT_NAME("Slower") | |
| 178 | 178 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 179 | 179 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 180 | 180 | |
| 181 | 181 | PORT_START("IN.4") // O4 |
| 182 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_B) PORT_NAME("Teach Mode") | |
| 183 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_G) PORT_NAME("Faster") | |
| 182 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B) PORT_NAME("Teach Mode") | |
| 183 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G) PORT_NAME("Faster") | |
| 184 | 184 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 185 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEY | |
| 185 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_T) PORT_NAME("Move Ship") | |
| 186 | 186 | INPUT_PORTS_END |
| 187 | 187 | |
| 188 | 188 |
| r243192 | r243193 | |
|---|---|---|
| 140 | 140 | |
| 141 | 141 | static INPUT_PORTS_START( comp4 ) |
| 142 | 142 | PORT_START("IN.0") // O1 |
| 143 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_R) PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_DEL_PAD) PORT_NAME("R") | |
| 144 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("1") | |
| 145 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("4") | |
| 146 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("7") | |
| 143 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R) PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_DEL_PAD) PORT_NAME("R") | |
| 144 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("1") | |
| 145 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("4") | |
| 146 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("7") | |
| 147 | 147 | |
| 148 | 148 | PORT_START("IN.1") // O2 |
| 149 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_NAME("0") | |
| 150 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("2") | |
| 151 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("5") | |
| 152 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("8") | |
| 149 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_NAME("0") | |
| 150 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("2") | |
| 151 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("5") | |
| 152 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("8") | |
| 153 | 153 | |
| 154 | 154 | PORT_START("IN.2") // O3 |
| 155 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_E) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("E") | |
| 156 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("3") | |
| 157 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("6") | |
| 158 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD) PORT_NAME("9") | |
| 155 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("E") | |
| 156 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("3") | |
| 157 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("6") | |
| 158 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD) PORT_NAME("9") | |
| 159 | 159 | INPUT_PORTS_END |
| 160 | 160 | |
| 161 | 161 |
| r243192 | r243193 | |
|---|---|---|
| 186 | 186 | |
| 187 | 187 | static INPUT_PORTS_START( elecdet ) |
| 188 | 188 | PORT_START("IN.0") // O0 pin18 |
| 189 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEY | |
| 189 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("4") | |
| 190 | 190 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 191 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("6") | |
| 192 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_Q) PORT_NAME("Private Question") | |
| 193 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("5") | |
| 191 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("6") | |
| 192 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) PORT_NAME("Private Question") | |
| 193 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("5") | |
| 194 | 194 | |
| 195 | 195 | PORT_START("IN.1") // O1 pin17 |
| 196 | 196 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 197 | 197 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 198 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_NAME("0") | |
| 199 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("Enter") | |
| 198 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_NAME("0") | |
| 199 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("Enter") | |
| 200 | 200 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 201 | 201 | |
| 202 | 202 | PORT_START("IN.2") // O4 pin14 |
| 203 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEY | |
| 203 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("7") | |
| 204 | 204 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 205 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD) PORT_NAME("9") | |
| 206 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_A) PORT_NAME("I Accuse") | |
| 207 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("8") | |
| 205 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD) PORT_NAME("9") | |
| 206 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A) PORT_NAME("I Accuse") | |
| 207 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("8") | |
| 208 | 208 | |
| 209 | 209 | PORT_START("IN.3") // O6 pin12 |
| 210 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEY | |
| 210 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("1") | |
| 211 | 211 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 212 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("3") | |
| 213 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_S) PORT_NAME("Suspect") | |
| 214 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("2") | |
| 212 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("3") | |
| 213 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S) PORT_NAME("Suspect") | |
| 214 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("2") | |
| 215 | 215 | |
| 216 | 216 | // note: even though power buttons are on the matrix, they are not CPU-controlled |
| 217 | 217 | PORT_START("IN.4") // Vss! |
| 218 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEY | |
| 218 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_PGUP) PORT_NAME("On") PORT_CHANGED_MEMBER(DEVICE_SELF, elecdet_state, power_button, (void *)true) | |
| 219 | 219 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 220 | 220 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 221 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_E) PORT_NAME("End Turn") | |
| 222 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_PGDN) PORT_NAME("Off") PORT_CHANGED_MEMBER(DEVICE_SELF, elecdet_state, power_button, (void *)false) | |
| 221 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_NAME("End Turn") | |
| 222 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_PGDN) PORT_NAME("Off") PORT_CHANGED_MEMBER(DEVICE_SELF, elecdet_state, power_button, (void *)false) | |
| 223 | 223 | INPUT_PORTS_END |
| 224 | 224 | |
| 225 | 225 | |
| r243192 | r243193 | |
| 297 | 297 | |
| 298 | 298 | ROM_START( elecdet ) |
| 299 | 299 | ROM_REGION( 0x1000, "maincpu", 0 ) |
| 300 | ROM_LOAD( "tms0980nll_mp6100a", 0x0000, 0x1000, CRC(6 | |
| 300 | ROM_LOAD( "tms0980nll_mp6100a", 0x0000, 0x1000, CRC(8160a081) SHA1(14cbfc0529ad83a58e0dc15fe8ba594947e49f08) ) | |
| 301 | 301 | |
| 302 | 302 | ROM_REGION( 1246, "maincpu:ipla", 0 ) |
| 303 | 303 | ROM_LOAD( "tms0980_default_ipla.pla", 0, 1246, CRC(42db9a38) SHA1(2d127d98028ec8ec6ea10c179c25e447b14ba4d0) ) |
| r243192 | r243193 | |
|---|---|---|
| 19 | 19 | |
| 20 | 20 | ToDo: |
| 21 | 21 | - Colours are approximate. |
| 22 | - Disk controller, works with old wd17xx but crashes on new wd. | |
| 22 | 23 | - Hardware supports 20cm and 13cm floppies, but we only support 13cm as this |
| 23 | 24 | is the only software that exists. |
| 24 | 25 | - The schematic shows the audio counter connected to 2MHz, but this produces |
| r243192 | r243193 | |
| 28 | 29 | |
| 29 | 30 | ****************************************************************************/ |
| 30 | 31 | |
| 31 | #define NEWFDC | |
| 32 | #define NEWFDC 0 | |
| 32 | 33 | |
| 33 | 34 | |
| 34 | 35 | #include "emu.h" |
| r243192 | r243193 | |
| 251 | 252 | FLOPPY_FORMATS_END |
| 252 | 253 | |
| 253 | 254 | static SLOT_INTERFACE_START( excali64_floppies ) |
| 254 | SLOT_INTERFACE( "drive0", FLOPPY_525_QD ) | |
| 255 | SLOT_INTERFACE( "drive1", FLOPPY_525_QD ) | |
| 255 | SLOT_INTERFACE( "525dd", FLOPPY_525_DD ) | |
| 256 | 256 | SLOT_INTERFACE_END |
| 257 | 257 | #else |
| 258 | 258 | static LEGACY_FLOPPY_OPTIONS_START(excali64) |
| r243192 | r243193 | |
| 654 | 654 | #if NEWFDC |
| 655 | 655 | MCFG_WD2793x_ADD("fdc", XTAL_16MHz / 16) |
| 656 | 656 | MCFG_WD_FDC_DRQ_CALLBACK(DEVWRITELINE("dma", z80dma_device, rdy_w)) |
| 657 | MCFG_FLOPPY_DRIVE_ADD("fdc:0", excali64_floppies, "drive0", excali64_state::floppy_formats) | |
| 658 | MCFG_FLOPPY_DRIVE_ADD("fdc:1", excali64_floppies, "drive1", excali64_state::floppy_formats) | |
| 657 | MCFG_FLOPPY_DRIVE_ADD("fdc:0", excali64_floppies, "525dd", excali64_state::floppy_formats) | |
| 658 | MCFG_FLOPPY_DRIVE_ADD("fdc:1", excali64_floppies, "525dd", excali64_state::floppy_formats) | |
| 659 | 659 | #else |
| 660 | 660 | MCFG_DEVICE_ADD("fdc", WD2793, 0) |
| 661 | 661 | MCFG_WD17XX_DEFAULT_DRIVE2_TAGS |
| r243192 | r243193 | |
| 693 | 693 | ROM_FILL(0x4ef, 1, 8) |
| 694 | 694 | ROM_FILL(0x4f6, 1, 0) |
| 695 | 695 | ROM_FILL(0x4f7, 1, 8) |
| 696 | // patch out the protection | |
| 697 | ROM_FILL(0x3ce7, 1, 0) | |
| 698 | 696 | |
| 699 | 697 | ROM_REGION(0x10000, "rambank", ROMREGION_ERASE00) |
| 700 | 698 | ROM_REGION(0xA000, "videoram", ROMREGION_ERASE00) |
| r243192 | r243193 | |
|---|---|---|
| 20 | 20 | : driver_device(mconfig, type, tag) |
| 21 | 21 | , m_maincpu(*this, "maincpu") |
| 22 | 22 | , m_cart(*this, "cartslot") |
| 23 | #ifdef USE_GFX | |
| 23 | #ifdef USE_GFX | |
| 24 | 24 | , m_gfxdecode(*this, "gfxdecode") |
| 25 | 25 | #endif |
| 26 | 26 | , m_io_joy(*this, "JOY") |
| r243192 | r243193 | |
| 53 | 53 | |
| 54 | 54 | struct |
| 55 | 55 | { |
| 56 | UINT8 reg[8]; | |
| 57 | struct { | |
| 58 | bool write; | |
| 59 | bool page2; // else page1 | |
| 56 | UINT8 reg[8]; | |
| 57 | struct { | |
| 58 | bool write; | |
| 59 | bool page2; // else page1 | |
| 60 | 60 | UINT8 ypos, xpos/*tennis*/; |
| 61 | UINT8 data[2][0x100][0x20]; | |
| 62 | } bitmap; | |
| 63 | UINT8 x, y; | |
| 61 | UINT8 data[2][0x100][0x20]; | |
| 62 | } bitmap; | |
| 63 | UINT8 x, y; | |
| 64 | 64 | bool y_increment; |
| 65 | 65 | } video; |
| 66 | 66 | |
| 67 | 67 | struct { |
| 68 | | |
| 68 | bool set; | |
| 69 | 69 | int bit_shifter; |
| 70 | 70 | UINT8 cartridge_byte; |
| 71 | 71 | UINT16 address; // in reality something more like short local cartridge address offset |
| 72 | 72 | bool unprotected; |
| 73 | 73 | bool failed; |
| 74 | ||
| 74 | ||
| 75 | 75 | } card_protection; |
| 76 | 76 | |
| 77 | 77 | required_device<cpu_device> m_maincpu; |
| r243192 | r243193 | |
| 84 | 84 | required_shared_ptr<UINT8> m_bios; |
| 85 | 85 | emu_timer *timer1; |
| 86 | 86 | emu_timer *timer2; |
| 87 | UINT8 bank_multi; | |
| 88 | UINT8 *m_cart_ptr; | |
| 87 | UINT8 bank_multi; | |
| 89 | 88 | }; |
| 90 | 89 | |
| 91 | 90 | WRITE8_MEMBER( gamate_state::gamate_cart_protection_w ) |
| 92 | 91 | { |
| 93 | logerror("%.6f protection write %x %x address:%x data:%x shift:%d\n",machine().time().as_double(), offset, data, card_protection.address, card_protection.cartridge_byte, card_protection.bit_shifter); | |
| 94 | ||
| 92 | logerror("%.6f protection write %x %x address:%x data:%x shift:%d\n",machine().time().as_double(), offset, data, card_protection.address, card_protection.cartridge_byte, card_protection.bit_shifter); | |
| 93 | ||
| 95 | 94 | switch (offset) { |
| 96 | 95 | case 0: |
| 97 | 96 | card_protection.failed= card_protection.failed || ((card_protection.cartridge_byte&0x80)!=0) != ((data&4)!=0); |
| 98 | 97 | card_protection.bit_shifter++; |
| 99 | 98 | if (card_protection.bit_shifter>=8) { |
| 100 | card_protection.cartridge_byte=m_cart | |
| 99 | card_protection.cartridge_byte=m_cart->get_rom_base()[card_protection.address++]; | |
| 101 | 100 | card_protection.bit_shifter=0; |
| 102 | 101 | } |
| 103 | 102 | break; |
| r243192 | r243193 | |
| 105 | 104 | } |
| 106 | 105 | READ8_MEMBER( gamate_state::gamate_cart_protection_r ) |
| 107 | 106 | { |
| 108 | UINT8 ret=1; | |
| 109 | if (card_protection.bit_shifter==7 && card_protection.unprotected) { | |
| 110 | ret=m_cart_ptr[bank_multi*0x4000]; | |
| 111 | } else { | |
| 107 | ||
| 108 | UINT8 ret=1; | |
| 109 | if (card_protection.bit_shifter==7 && card_protection.unprotected) { | |
| 110 | ret=m_cart->get_rom_base()[bank_multi*0x4000]; | |
| 111 | } else { | |
| 112 | 112 | card_protection.bit_shifter++; |
| 113 | 113 | if (card_protection.bit_shifter==8) { |
| 114 | 114 | card_protection.bit_shifter=0; |
| r243192 | r243193 | |
| 117 | 117 | } |
| 118 | 118 | ret=(card_protection.cartridge_byte&0x80)?2:0; |
| 119 | 119 | if (card_protection.bit_shifter==7 && !card_protection.failed) { // now protection chip on cartridge activates cartridge chip select on cpu accesses |
| 120 | // | |
| 120 | // m_maincpu->space(AS_PROGRAM).install_read_handler(0x6000, 0x6000, READ8_DELEGATE(gamate_state, gamate_cart_protection_r)); // next time I will try to get this working | |
| 121 | 121 | } |
| 122 | 122 | card_protection.cartridge_byte<<=1; |
| 123 | } | |
| 124 | logerror("%.6f protection read %x %x address:%x data:%x shift:%d\n",machine().time().as_double(), offset, ret, card_protection.address, card_protection.cartridge_byte, card_protection.bit_shifter); | |
| 125 | return ret; | |
| 123 | } | |
| 124 | logerror("%.6f protection read %x %x address:%x data:%x shift:%d\n",machine().time().as_double(), offset, ret, card_protection.address, card_protection.cartridge_byte, card_protection.bit_shifter); | |
| 125 | return ret; | |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | READ8_MEMBER( gamate_state::protection_r ) { return card_protection.set? 3: 1; } // bits 0 and 1 checked |
| 129 | 129 | |
| 130 | 130 | WRITE8_MEMBER( gamate_state::protection_reset ) |
| 131 | 131 | { |
| 132 | // writes 0x20 | |
| 133 | card_protection.address=0x6005-0x6001; | |
| 134 | card_protection.bit_shifter=0; | |
| 135 | card_protection.cartridge_byte=m_cart_ptr[card_protection.address++];//m_cart_rom[card_protection.address++]; | |
| 136 | card_protection.failed=false; | |
| 137 | card_protection.unprotected=false; | |
| 132 | // writes 0x20 | |
| 133 | card_protection.address=0x6005-0x6001; | |
| 134 | card_protection.bit_shifter=0; | |
| 135 | card_protection.cartridge_byte=m_cart->get_rom_base()[card_protection.address++];//m_cart_rom[card_protection.address++]; | |
| 136 | card_protection.failed=false; | |
| 137 | card_protection.unprotected=false; | |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | READ8_MEMBER( gamate_state::newer_protection_set ) |
| 141 | 141 | { |
| 142 | card_protection.set=true; | |
| 143 | return 0; | |
| 142 | card_protection.set=true; | |
| 143 | return 0; | |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | |
| 147 | 147 | WRITE8_MEMBER( gamate_state::gamate_video_w ) |
| 148 | 148 | { |
| 149 | video.reg[offset]=data; | |
| 150 | switch (offset) { | |
| 151 | case 1: video.bitmap.write=data&0xc0; // more addressing mode | |
| 149 | video.reg[offset]=data; | |
| 150 | switch (offset) { | |
| 151 | case 1: video.bitmap.write=data&0xc0; // more addressing mode | |
| 152 | 152 | video.y_increment=data&0x40; |
| 153 | 153 | break; |
| 154 | 154 | case 2: video.bitmap.xpos=data;break; // at least 7 bits |
| 155 | 155 | case 3: video.bitmap.ypos=data;break; // at least 7 bits |
| 156 | case 4: video.bitmap.page2=data&0x80;video.x=data&0x7f;break; | |
| 157 | case 5: video.y=data;break; | |
| 158 | case 7: | |
| 159 | if (video.bitmap.write) { | |
| 160 | if (video.x<ARRAY_LENGTH(video.bitmap.data[0][0]) /*&& video.y<ARRAY_LENGTH(video.bitmap.data[0])*/) | |
| 161 | video.bitmap.data[video.bitmap.page2][video.y][video.x]=data; | |
| 162 | else | |
| 163 | logerror("%.6f %04x video bitmap x %x invalid\n",machine().time().as_double(), m_maincpu->pc(), video.x); | |
| 164 | } else { | |
| 165 | video.bitmap.data[0][video.y][video.x&(ARRAY_LENGTH(video.bitmap.data[0][0])-1)]=data; | |
| 166 | } | |
| 167 | if (video.y_increment) video.y++; | |
| 156 | case 4: video.bitmap.page2=data&0x80;video.x=data&0x7f;break; | |
| 157 | case 5: video.y=data;break; | |
| 158 | case 7: | |
| 159 | if (video.bitmap.write) { | |
| 160 | if (video.x<ARRAY_LENGTH(video.bitmap.data[0][0]) /*&& video.y<ARRAY_LENGTH(video.bitmap.data[0])*/) | |
| 161 | video.bitmap.data[video.bitmap.page2][video.y][video.x]=data; | |
| 162 | else | |
| 163 | logerror("%.6f %04x video bitmap x %x invalid\n",machine().time().as_double(), m_maincpu->pc(), video.x); | |
| 164 | } else { | |
| 165 | video.bitmap.data[0][video.y][video.x&(ARRAY_LENGTH(video.bitmap.data[0][0])-1)]=data; | |
| 166 | } | |
| 167 | if (video.y_increment) video.y++; | |
| 168 | 168 | else video.x++; |
| 169 | ||
| 169 | } | |
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | WRITE8_MEMBER( gamate_state::cart_bankswitchmulti_w ) |
| 173 | 173 | { |
| 174 | bank_multi=data; | |
| 175 | membank("bankmulti")->set_base(m_cart_ptr+0x4000*data+1); | |
| 174 | bank_multi=data; | |
| 175 | membank("bankmulti")->set_base(m_cart->get_rom_base()+0x4000*data+1); | |
| 176 | 176 | } |
| 177 | 177 | |
| 178 | 178 | WRITE8_MEMBER( gamate_state::cart_bankswitch_w ) |
| 179 | 179 | { |
| 180 | membank("bank")->set_base(m_cart | |
| 180 | membank("bank")->set_base(m_cart->get_rom_base()+0x4000*data); | |
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | READ8_MEMBER( gamate_state::gamate_video_r ) |
| 184 | 184 | { |
| 185 | 185 | if (offset!=6) return 0; |
| 186 | UINT8 data=0; | |
| 187 | if (video.bitmap.write) { | |
| 188 | if (video.x<ARRAY_LENGTH(video.bitmap.data[0][0]) /*&& video.y<ARRAY_LENGTH(video.bitmap.data[0])*/) | |
| 189 | data=video.bitmap.data[video.bitmap.page2][video.y][video.x]; | |
| 190 | else | |
| 191 | logerror("%.6f video bitmap x %x invalid\n",machine().time().as_double(),video.x); | |
| 192 | } else { | |
| 193 | data=video.bitmap.data[0][video.y][video.x&(ARRAY_LENGTH(video.bitmap.data[0][0])-1)]; | |
| 194 | } | |
| 195 | if (m_maincpu->pc()<0xf000) | |
| 196 | logerror("%.6f video read %04x %02x\n",machine().time().as_double(),offset, data); | |
| 197 | return data; | |
| 186 | UINT8 data=0; | |
| 187 | if (video.bitmap.write) { | |
| 188 | if (video.x<ARRAY_LENGTH(video.bitmap.data[0][0]) /*&& video.y<ARRAY_LENGTH(video.bitmap.data[0])*/) | |
| 189 | data=video.bitmap.data[video.bitmap.page2][video.y][video.x]; | |
| 190 | else | |
| 191 | logerror("%.6f video bitmap x %x invalid\n",machine().time().as_double(),video.x); | |
| 192 | } else { | |
| 193 | data=video.bitmap.data[0][video.y][video.x&(ARRAY_LENGTH(video.bitmap.data[0][0])-1)]; | |
| 194 | } | |
| 195 | if (m_maincpu->pc()<0xf000) | |
| 196 | logerror("%.6f video read %04x %02x\n",machine().time().as_double(),offset, data); | |
| 197 | return data; | |
| 198 | 198 | } |
| 199 | 199 | |
| 200 | 200 | WRITE8_MEMBER( gamate_state::gamate_audio_w ) |
| 201 | 201 | { |
| 202 | ||
| 202 | logerror("%.6f %04x audio write %04x %02x\n",machine().time().as_double(),m_maincpu->pc(),offset,data); | |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | READ8_MEMBER( gamate_state::gamate_audio_r ) |
| 206 | 206 | { |
| 207 | ||
| 207 | logerror("%.6f %04x audio read %04x \n",machine().time().as_double(),m_maincpu->pc(),offset); | |
| 208 | 208 | return 0; |
| 209 | 209 | } |
| 210 | 210 | |
| 211 | 211 | |
| 212 | 212 | READ8_MEMBER( gamate_state::gamate_pad_r ) |
| 213 | 213 | { |
| 214 | UINT8 data=m_io_joy->read(); | |
| 215 | return data; | |
| 214 | UINT8 data=m_io_joy->read(); | |
| 215 | return data; | |
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | static ADDRESS_MAP_START( gamate_mem, AS_PROGRAM, 8, gamate_state ) |
| 219 | AM_RANGE(0x0000, 0x03ff) AM_RAM | |
| 220 | AM_RANGE(0x4000, 0x400d) AM_READWRITE(gamate_audio_r, gamate_audio_w) | |
| 221 | AM_RANGE(0x4400, 0x4400) AM_READ(gamate_pad_r) | |
| 222 | AM_RANGE(0x5000, 0x5007) AM_READWRITE(gamate_video_r, gamate_video_w) | |
| 223 | AM_RANGE(0x5800, 0x5800) AM_READ(newer_protection_set) | |
| 224 | AM_RANGE(0x5900, 0x5900) AM_WRITE(protection_reset) | |
| 225 | AM_RANGE(0x5a00, 0x5a00) AM_READ(protection_r) | |
| 219 | AM_RANGE(0x0000, 0x03ff) AM_RAM | |
| 220 | AM_RANGE(0x4000, 0x400d) AM_READWRITE(gamate_audio_r, gamate_audio_w) | |
| 221 | AM_RANGE(0x4400, 0x4400) AM_READ(gamate_pad_r) | |
| 222 | AM_RANGE(0x5000, 0x5007) AM_READWRITE(gamate_video_r, gamate_video_w) | |
| 223 | AM_RANGE(0x5800, 0x5800) AM_READ(newer_protection_set) | |
| 224 | AM_RANGE(0x5900, 0x5900) AM_WRITE(protection_reset) | |
| 225 | AM_RANGE(0x5a00, 0x5a00) AM_READ(protection_r) | |
| 226 | 226 | |
| 227 | AM_RANGE(0x6001, 0x9fff) AM_READ_BANK("bankmulti") | |
| 228 | AM_RANGE(0xa000, 0xdfff) AM_READ_BANK("bank") | |
| 227 | AM_RANGE(0x6001, 0x9fff) AM_READ_BANK("bankmulti") | |
| 228 | AM_RANGE(0xa000, 0xdfff) AM_READ_BANK("bank") | |
| 229 | 229 | |
| 230 | 230 | AM_RANGE(0x6000, 0x6000) AM_READWRITE(gamate_cart_protection_r, gamate_cart_protection_w) |
| 231 | 231 | AM_RANGE(0x8000, 0x8000) AM_WRITE(cart_bankswitchmulti_w) |
| 232 | 232 | AM_RANGE(0xc000, 0xc000) AM_WRITE(cart_bankswitch_w) |
| 233 | 233 | |
| 234 | ||
| 234 | AM_RANGE(0xf000, 0xffff) AM_ROM AM_SHARE("bios") | |
| 235 | 235 | ADDRESS_MAP_END |
| 236 | 236 | |
| 237 | 237 | |
| r243192 | r243193 | |
| 250 | 250 | #ifdef USE_GFX |
| 251 | 251 | static const struct gfx_layout gamate_charlayout = |
| 252 | 252 | { |
| 253 | 4, /* width of object */ | |
| 254 | 1, /* height of object */ | |
| 255 | 256,/* 256 characters */ | |
| 256 | 2, /* bits per pixel */ | |
| 257 | { 0,4 }, /* no bitplanes */ | |
| 258 | /* x offsets */ | |
| 259 | { 0,1,2,3 }, | |
| 260 | /* y offsets */ | |
| 261 | { 0 }, | |
| 262 | 8*1 /* size of 1 object in bits */ | |
| 253 | 4, /* width of object */ | |
| 254 | 1, /* height of object */ | |
| 255 | 256,/* 256 characters */ | |
| 256 | 2, /* bits per pixel */ | |
| 257 | { 0,4 }, /* no bitplanes */ | |
| 258 | /* x offsets */ | |
| 259 | { 0,1,2,3 }, | |
| 260 | /* y offsets */ | |
| 261 | { 0 }, | |
| 262 | 8*1 /* size of 1 object in bits */ | |
| 263 | 263 | }; |
| 264 | 264 | |
| 265 | 265 | static GFXDECODE_START( gamate ) |
| 266 | ||
| 266 | GFXDECODE_ENTRY( "gfx1", 0x0000, gamate_charlayout, 0, 0x100 ) | |
| 267 | 267 | GFXDECODE_END |
| 268 | 268 | #endif |
| 269 | 269 | |
| 270 | 270 | /* palette in red, green, blue tribles */ |
| 271 | 271 | static const unsigned char gamate_colors[4][3] = |
| 272 | 272 | { |
| 273 | { 255,255,255 }, | |
| 274 | { 0xa0, 0xa0, 0xa0 }, | |
| 275 | { 0x60, 0x60, 0x60 }, | |
| 276 | { 0, 0, 0 } | |
| 273 | { 255,255,255 }, | |
| 274 | { 0xa0, 0xa0, 0xa0 }, | |
| 275 | { 0x60, 0x60, 0x60 }, | |
| 276 | { 0, 0, 0 } | |
| 277 | 277 | }; |
| 278 | 278 | |
| 279 | 279 | PALETTE_INIT_MEMBER(gamate_state, gamate) |
| r243192 | r243193 | |
| 298 | 298 | |
| 299 | 299 | UINT32 gamate_state::screen_update_gamate(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 300 | 300 | { |
| 301 | int x, y, j; | |
| 302 | for (y=0;y<152;y++) { | |
| 303 | for (x=-(video.bitmap.xpos&7), j=0;x<160;x+=8, j++) { | |
| 304 | UINT8 d1=video.bitmap.data[0][(y+video.bitmap.ypos)&0xff][(j+video.bitmap.xpos/8)&0x1f]; | |
| 305 | UINT8 d2=video.bitmap.data[1][(y+video.bitmap.ypos)&0xff][(j+video.bitmap.xpos/8)&0x1f]; | |
| 301 | int x, y, j; | |
| 302 | for (y=0;y<152;y++) { | |
| 303 | for (x=-(video.bitmap.xpos&7), j=0;x<160;x+=8, j++) { | |
| 304 | UINT8 d1=video.bitmap.data[0][(y+video.bitmap.ypos)&0xff][(j+video.bitmap.xpos/8)&0x1f]; | |
| 305 | UINT8 d2=video.bitmap.data[1][(y+video.bitmap.ypos)&0xff][(j+video.bitmap.xpos/8)&0x1f]; | |
| 306 | 306 | #ifdef USE_GFX |
| 307 | ||
| 307 | m_gfxdecode->gfx(0)->opaque(bitmap,cliprect, (d1&0xf)|((d2&0xf)<<4), 0,0,0,x+4,y); | |
| 308 | 308 | m_gfxdecode->gfx(0)->opaque(bitmap,cliprect, (d1>>4)|(d2&0xf0),0,0,0,x,y); |
| 309 | 309 | #else |
| 310 | BlitPlane(&bitmap.pix16(y, x+4), d1, d2); | |
| 311 | BlitPlane(&bitmap.pix16(y, x), d1>>4, d2>>4); | |
| 312 | #endif | |
| 313 | } | |
| 314 | } | |
| 315 | return 0; | |
| 310 | BlitPlane(&bitmap.pix16(y, x+4), d1, d2); | |
| 311 | BlitPlane(&bitmap.pix16(y, x), d1>>4, d2>>4); | |
| 312 | #endif | |
| 313 | } | |
| 314 | } | |
| 315 | return 0; | |
| 316 | 316 | } |
| 317 | 317 | |
| 318 | 318 | DRIVER_INIT_MEMBER(gamate_state,gamate) |
| r243192 | r243193 | |
| 321 | 321 | #ifdef USE_GFX |
| 322 | 322 | UINT8 *gfx=memregion("gfx1")->base(); |
| 323 | 323 | for (int i=0; i<256; i++) gfx[i]=i; |
| 324 | #endif | |
| 324 | #endif | |
| 325 | 325 | timer1 = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gamate_state::gamate_timer),this)); |
| 326 | 326 | timer2 = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gamate_state::gamate_timer2),this)); |
| 327 | 327 | } |
| r243192 | r243193 | |
| 329 | 329 | |
| 330 | 330 | void gamate_state::machine_start() |
| 331 | 331 | { |
| 332 | m_cart_ptr = memregion("maincpu")->base() + 0x6000; | |
| 333 | 332 | if (m_cart->exists()) { |
| 334 | // m_maincpu->space(AS_PROGRAM).install_read_handler(0x6000, 0x6000, READ8_DELEGATE(gamate_state, gamate_cart_protection_r)); | |
| 335 | m_cart_ptr = m_cart->get_rom_base(); | |
| 333 | // m_maincpu->space(AS_PROGRAM).install_read_handler(0x6000, 0x6000, READ8_DELEGATE(gamate_state, gamate_cart_protection_r)); | |
| 336 | 334 | membank("bankmulti")->set_base(m_cart->get_rom_base()+1); |
| 337 | 335 | membank("bank")->set_base(m_cart->get_rom_base()+0x4000); // bankswitched games in reality no offset |
| 338 | 336 | } |
| 339 | // | |
| 337 | // m_bios[0xdf1]=0xea; m_bios[0xdf2]=0xea; // default bios: $47 protection readback | |
| 340 | 338 | card_protection.set=false; |
| 341 | 339 | bank_multi=0; |
| 342 | 340 | card_protection.unprotected=false; |
| r243192 | r243193 | |
| 389 | 387 | |
| 390 | 388 | #ifdef USE_GFX |
| 391 | 389 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", gamate ) |
| 392 | #endif | |
| 390 | #endif | |
| 393 | 391 | MCFG_PALETTE_ADD("palette", ARRAY_LENGTH(gamate_colors)) |
| 394 | 392 | MCFG_PALETTE_INIT_OWNER(gamate_state, gamate) |
| 395 | 393 | MCFG_DEFAULT_LAYOUT(layout_lcd) |
| r243192 | r243193 | |
| 407 | 405 | ROMX_LOAD("gamate_bios_umc.bin", 0xf000, 0x1000, CRC(07090415) SHA1(ea449dc607601f9a68d855ad6ab53800d2e99297), ROM_BIOS(1) ) |
| 408 | 406 | ROM_SYSTEM_BIOS(1, "newer", "NEWER") |
| 409 | 407 | ROMX_LOAD("gamate_bios_9130__unknown__bit_icasc00001_9130-bs_r32261.bin", 0xf000, 0x1000, CRC(03a5f3a7) SHA1(4e9dfbfe916ca485530ef4221593ab68738e2217), ROM_BIOS(2) ) |
| 410 | #ifdef USE_GFX | |
| 408 | #ifdef USE_GFX | |
| 411 | 409 | ROM_REGION(0x100,"gfx1", ROMREGION_ERASEFF) |
| 412 | #endif | |
| 410 | #endif | |
| 413 | 411 | ROM_END |
| 414 | 412 | |
| 415 | 413 | |
| 416 | 414 | /* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME */ |
| 417 | 415 | CONS( 19??, gamate, 0, 0, gamate, gamate, gamate_state, gamate, "Bit Corp", "Gamate", GAME_NO_SOUND) |
| 416 | ||
| 417 |
| r243192 | r243193 | |
|---|---|---|
| 19 | 19 | MC68000 @ 10 MHz |
| 20 | 20 | MC68A45 CRTC |
| 21 | 21 | Z0765A08PSC floppy controller (NEC765 type) |
| 22 | ||
| 22 | TMS9914A GPIB bus interface | |
| 23 | 23 | SCN2661 DUART/timer |
| 24 | 24 | |
| 25 | 25 | 16500b: |
| r243192 | r243193 | |
| 50 | 50 | #include "video/mc6845.h" |
| 51 | 51 | #include "machine/mc68681.h" |
| 52 | 52 | |
| 53 | #define MAINCPU_TAG "maincpu" | |
| 54 | #define CRTC_TAG "crtc" | |
| 55 | #define SCREEN_TAG "screen" | |
| 56 | #define DUART_TAG "duart" | |
| 53 | #define MAINCPU_TAG "maincpu" | |
| 54 | #define CRTC_TAG "crtc" | |
| 55 | #define SCREEN_TAG "screen" | |
| 56 | #define DUART_TAG "duart" | |
| 57 | 57 | |
| 58 | 58 | class hp16500_state : public driver_device |
| 59 | 59 | { |
| r243192 | r243193 | |
|---|---|---|
| 1 | 1 | // license:BSD-3-Clause |
| 2 | 2 | // copyright-holders:R. Belmont |
| 3 | 3 | /*************************************************************************** |
| 4 | ||
| 4 | ||
| 5 | 5 | hp9k3xx.c: preliminary driver for HP9000 300 Series (aka HP9000/3xx) |
| 6 | 6 | |
| 7 | 7 | Currently supporting: |
| r243192 | r243193 | |
| 16 | 16 | MC68881 FPU |
| 17 | 17 | |
| 18 | 18 | 330: |
| 19 | MC68020 CPU @ 16.67 MHz | |
| 20 | MC68851 MMU | |
| 21 | MC68881 FPU | |
| 19 | MC68020 CPU @ 16.67 MHz | |
| 20 | MC68851 MMU | |
| 21 | MC68881 FPU | |
| 22 | 22 | |
| 23 | 23 | 340: |
| 24 | 24 | MC68030 CPU @ 16.67 MHz w/built-in MMU |
| 25 | ||
| 25 | MC68881 FPU | |
| 26 | 26 | |
| 27 | 27 | 380: |
| 28 | 28 | MC68040 CPU @ 25 MHz w/built-in MMU and FPU |
| 29 | 29 | |
| 30 | 30 | 382: |
| 31 | 31 | MC68040 CPU @ 25? MHz w/built-in MMU and FPU |
| 32 | ||
| 32 | Built-in VGA compatible video | |
| 33 | 33 | |
| 34 | 34 | All models have an MC6840 PIT on IRQ6 clocked at 250 kHz. |
| 35 | 35 | |
| r243192 | r243193 | |
| 132 | 132 | |
| 133 | 133 | // shared mappings for all 9000/3xx systems |
| 134 | 134 | static ADDRESS_MAP_START(hp9k3xx_common, AS_PROGRAM, 32, hp9k3xx_state) |
| 135 | AM_RANGE(0x00000000, 0x0001ffff) AM_ROM AM_REGION("maincpu",0) AM_WRITENOP | |
| 135 | AM_RANGE(0x00000000, 0x0001ffff) AM_ROM AM_REGION("maincpu",0) AM_WRITENOP // writes to 1fffc are the LED | |
| 136 | 136 | |
| 137 | AM_RANGE(0x00500000, 0x0050000f) AM_RAM | |
| 137 | AM_RANGE(0x00500000, 0x0050000f) AM_RAM // this is sufficient to pass the DMA test for now | |
| 138 | 138 | |
| 139 | AM_RANGE(0x00510000, 0x00510003) AM_READWRITE(buserror_r, buserror_w) // no "Alpha display" | |
| 140 | AM_RANGE(0x00538000, 0x00538003) AM_READWRITE(buserror_r, buserror_w) // no "Graphics" | |
| 141 | AM_RANGE(0x005c0000, 0x005c0003) AM_READWRITE(buserror_r, buserror_w) // no add-on FP coprocessor | |
| 139 | AM_RANGE(0x00510000, 0x00510003) AM_READWRITE(buserror_r, buserror_w) // no "Alpha display" | |
| 140 | AM_RANGE(0x00538000, 0x00538003) AM_READWRITE(buserror_r, buserror_w) // no "Graphics" | |
| 141 | AM_RANGE(0x005c0000, 0x005c0003) AM_READWRITE(buserror_r, buserror_w) // no add-on FP coprocessor | |
| 142 | 142 | AM_RANGE(0x005f8000, 0x005f800f) AM_DEVREADWRITE8(PTM6840_TAG, ptm6840_device, read, write, 0x00ff00ff) |
| 143 | 143 | ADDRESS_MAP_END |
| 144 | 144 | |
| 145 | 145 | // 9000/310 - has onboard video that the graphics card used in other 3xxes conflicts with |
| 146 | 146 | static ADDRESS_MAP_START(hp9k310_map, AS_PROGRAM, 16, hp9k3xx_state) |
| 147 | AM_RANGE(0x000000, 0x01ffff) AM_ROM AM_REGION("maincpu",0) AM_WRITENOP | |
| 147 | AM_RANGE(0x000000, 0x01ffff) AM_ROM AM_REGION("maincpu",0) AM_WRITENOP // writes to 1fffc are the LED | |
| 148 | 148 | |
| 149 | AM_RANGE(0x510000, 0x510003) AM_READWRITE(buserror16_r, buserror16_w) // no "Alpha display" | |
| 150 | AM_RANGE(0x538000, 0x538003) AM_READWRITE(buserror16_r, buserror16_w) // no "Graphics" | |
| 151 | AM_RANGE(0x5c0000, 0x5c0003) AM_READWRITE(buserror16_r, buserror16_w) // no add-on FP coprocessor | |
| 149 | AM_RANGE(0x510000, 0x510003) AM_READWRITE(buserror16_r, buserror16_w) // no "Alpha display" | |
| 150 | AM_RANGE(0x538000, 0x538003) AM_READWRITE(buserror16_r, buserror16_w) // no "Graphics" | |
| 151 | AM_RANGE(0x5c0000, 0x5c0003) AM_READWRITE(buserror16_r, buserror16_w) // no add-on FP coprocessor | |
| 152 | 152 | |
| 153 | 153 | AM_RANGE(0x5f8000, 0x5f800f) AM_DEVREADWRITE8(PTM6840_TAG, ptm6840_device, read, write, 0x00ff) |
| 154 | 154 | |
| 155 | AM_RANGE(0x200000, 0x2fffff) AM_RAM AM_SHARE("vram16") // 98544 mono framebuffer | |
| 156 | AM_RANGE(0x560000, 0x563fff) AM_ROM AM_REGION("graphics", 0x0000) // 98544 mono ROM | |
| 155 | AM_RANGE(0x200000, 0x2fffff) AM_RAM AM_SHARE("vram16") // 98544 mono framebuffer | |
| 156 | AM_RANGE(0x560000, 0x563fff) AM_ROM AM_REGION("graphics", 0x0000) // 98544 mono ROM | |
| 157 | 157 | |
| 158 | 158 | AM_RANGE(0x700000, 0x7fffff) AM_READWRITE(buserror16_r, buserror16_w) |
| 159 | 159 | AM_RANGE(0x800000, 0xffffff) AM_RAM |
| r243192 | r243193 | |
| 161 | 161 | |
| 162 | 162 | // 9000/320 |
| 163 | 163 | static ADDRESS_MAP_START(hp9k320_map, AS_PROGRAM, 32, hp9k3xx_state) |
| 164 | AM_RANGE(0x00200000, 0x002fffff) AM_RAM AM_SHARE("vram") // 98544 mono framebuffer | |
| 165 | AM_RANGE(0x00560000, 0x00563fff) AM_ROM AM_REGION("graphics", 0x0000) // 98544 mono ROM | |
| 164 | AM_RANGE(0x00200000, 0x002fffff) AM_RAM AM_SHARE("vram") // 98544 mono framebuffer | |
| 165 | AM_RANGE(0x00560000, 0x00563fff) AM_ROM AM_REGION("graphics", 0x0000) // 98544 mono ROM | |
| 166 | 166 | |
| 167 | 167 | AM_RANGE(0xffe00000, 0xffefffff) AM_READWRITE(buserror_r, buserror_w) |
| 168 | 168 | AM_RANGE(0xfff00000, 0xffffffff) AM_RAM |
| r243192 | r243193 | |
| 172 | 172 | |
| 173 | 173 | // 9000/330 and 9000/340 |
| 174 | 174 | static ADDRESS_MAP_START(hp9k330_map, AS_PROGRAM, 32, hp9k3xx_state) |
| 175 | AM_RANGE(0x00200000, 0x002fffff) AM_RAM AM_SHARE("vram") // 98544 mono framebuffer | |
| 176 | AM_RANGE(0x00560000, 0x00563fff) AM_ROM AM_REGION("graphics", 0x0000) // 98544 mono ROM | |
| 175 | AM_RANGE(0x00200000, 0x002fffff) AM_RAM AM_SHARE("vram") // 98544 mono framebuffer | |
| 176 | AM_RANGE(0x00560000, 0x00563fff) AM_ROM AM_REGION("graphics", 0x0000) // 98544 mono ROM | |
| 177 | 177 | |
| 178 | 178 | AM_RANGE(0xffb00000, 0xffbfffff) AM_READWRITE(buserror_r, buserror_w) |
| 179 | 179 | AM_RANGE(0xffc00000, 0xffffffff) AM_RAM |
| r243192 | r243193 | |
| 183 | 183 | |
| 184 | 184 | // 9000/370 - 8 MB RAM standard |
| 185 | 185 | static ADDRESS_MAP_START(hp9k370_map, AS_PROGRAM, 32, hp9k3xx_state) |
| 186 | AM_RANGE(0x00200000, 0x002fffff) AM_RAM AM_SHARE("vram") // 98544 mono framebuffer | |
| 187 | AM_RANGE(0x00560000, 0x00563fff) AM_ROM AM_REGION("graphics", 0x0000) // 98544 mono ROM | |
| 186 | AM_RANGE(0x00200000, 0x002fffff) AM_RAM AM_SHARE("vram") // 98544 mono framebuffer | |
| 187 | AM_RANGE(0x00560000, 0x00563fff) AM_ROM AM_REGION("graphics", 0x0000) // 98544 mono ROM | |
| 188 | 188 | |
| 189 | 189 | AM_RANGE(0xff700000, 0xff7fffff) AM_READWRITE(buserror_r, buserror_w) |
| 190 | 190 | AM_RANGE(0xff800000, 0xffffffff) AM_RAM |
| r243192 | r243193 | |
| 292 | 292 | MCFG_CPU_PROGRAM_MAP(hp9k310_map) |
| 293 | 293 | |
| 294 | 294 | MCFG_DEVICE_ADD(PTM6840_TAG, PTM6840, 0) |
| 295 | MCFG_PTM6840_INTERNAL_CLOCK(250000.0f) | |
| 295 | MCFG_PTM6840_INTERNAL_CLOCK(250000.0f) // from oscillator module next to the 6840 | |
| 296 | 296 | MCFG_PTM6840_EXTERNAL_CLOCKS(250000.0f, 250000.0f, 250000.0f) |
| 297 | 297 | |
| 298 | 298 | MCFG_SCREEN_ADD( "screen", RASTER) |
| r243192 | r243193 | |
| 308 | 308 | MCFG_CPU_PROGRAM_MAP(hp9k320_map) |
| 309 | 309 | |
| 310 | 310 | MCFG_DEVICE_ADD(PTM6840_TAG, PTM6840, 0) |
| 311 | MCFG_PTM6840_INTERNAL_CLOCK(250000.0f) | |
| 311 | MCFG_PTM6840_INTERNAL_CLOCK(250000.0f) // from oscillator module next to the 6840 | |
| 312 | 312 | MCFG_PTM6840_EXTERNAL_CLOCKS(250000.0f, 250000.0f, 250000.0f) |
| 313 | 313 | |
| 314 | 314 | MCFG_SCREEN_ADD( "screen", RASTER) |
| r243192 | r243193 | |
| 324 | 324 | MCFG_CPU_PROGRAM_MAP(hp9k330_map) |
| 325 | 325 | |
| 326 | 326 | MCFG_DEVICE_ADD(PTM6840_TAG, PTM6840, 0) |
| 327 | MCFG_PTM6840_INTERNAL_CLOCK(250000.0f) | |
| 327 | MCFG_PTM6840_INTERNAL_CLOCK(250000.0f) // from oscillator module next to the 6840 | |
| 328 | 328 | MCFG_PTM6840_EXTERNAL_CLOCKS(250000.0f, 250000.0f, 250000.0f) |
| 329 | 329 | |
| 330 | 330 | MCFG_SCREEN_ADD( "screen", RASTER) |
| r243192 | r243193 | |
| 340 | 340 | MCFG_CPU_PROGRAM_MAP(hp9k330_map) |
| 341 | 341 | |
| 342 | 342 | MCFG_DEVICE_ADD(PTM6840_TAG, PTM6840, 0) |
| 343 | MCFG_PTM6840_INTERNAL_CLOCK(250000.0f) | |
| 343 | MCFG_PTM6840_INTERNAL_CLOCK(250000.0f) // from oscillator module next to the 6840 | |
| 344 | 344 | MCFG_PTM6840_EXTERNAL_CLOCKS(250000.0f, 250000.0f, 250000.0f) |
| 345 | 345 | |
| 346 | 346 | MCFG_SCREEN_ADD( "screen", RASTER) |
| r243192 | r243193 | |
| 356 | 356 | MCFG_CPU_PROGRAM_MAP(hp9k370_map) |
| 357 | 357 | |
| 358 | 358 | MCFG_DEVICE_ADD(PTM6840_TAG, PTM6840, 0) |
| 359 | MCFG_PTM6840_INTERNAL_CLOCK(250000.0f) | |
| 359 | MCFG_PTM6840_INTERNAL_CLOCK(250000.0f) // from oscillator module next to the 6840 | |
| 360 | 360 | MCFG_PTM6840_EXTERNAL_CLOCKS(250000.0f, 250000.0f, 250000.0f) |
| 361 | 361 | |
| 362 | 362 | MCFG_SCREEN_ADD( "screen", RASTER) |
| r243192 | r243193 | |
| 368 | 368 | |
| 369 | 369 | static MACHINE_CONFIG_START( hp9k380, hp9k3xx_state ) |
| 370 | 370 | /* basic machine hardware */ |
| 371 | MCFG_CPU_ADD(MAINCPU_TAG, M68040, 25000000) | |
| 371 | MCFG_CPU_ADD(MAINCPU_TAG, M68040, 25000000) // 25 MHz? 33? | |
| 372 | 372 | MCFG_CPU_PROGRAM_MAP(hp9k330_map) |
| 373 | 373 | |
| 374 | 374 | MCFG_DEVICE_ADD(PTM6840_TAG, PTM6840, 0) |
| 375 | MCFG_PTM6840_INTERNAL_CLOCK(250000.0f) | |
| 375 | MCFG_PTM6840_INTERNAL_CLOCK(250000.0f) // from oscillator module next to the 6840 | |
| 376 | 376 | MCFG_PTM6840_EXTERNAL_CLOCKS(250000.0f, 250000.0f, 250000.0f) |
| 377 | 377 | |
| 378 | 378 | MCFG_SCREEN_ADD( "screen", RASTER) |
| r243192 | r243193 | |
| 384 | 384 | |
| 385 | 385 | static MACHINE_CONFIG_START( hp9k382, hp9k3xx_state ) |
| 386 | 386 | /* basic machine hardware */ |
| 387 | MCFG_CPU_ADD(MAINCPU_TAG, M68040, 25000000) | |
| 387 | MCFG_CPU_ADD(MAINCPU_TAG, M68040, 25000000) // 25 MHz? 33? | |
| 388 | 388 | MCFG_CPU_PROGRAM_MAP(hp9k382_map) |
| 389 | 389 | |
| 390 | 390 | MCFG_DEVICE_ADD(PTM6840_TAG, PTM6840, 0) |
| 391 | MCFG_PTM6840_INTERNAL_CLOCK(250000.0f) | |
| 391 | MCFG_PTM6840_INTERNAL_CLOCK(250000.0f) // from oscillator module next to the 6840 | |
| 392 | 392 | MCFG_PTM6840_EXTERNAL_CLOCKS(250000.0f, 250000.0f, 250000.0f) |
| 393 | 393 | |
| 394 | 394 | MCFG_SCREEN_ADD( "screen", RASTER) |
| r243192 | r243193 | |
| 400 | 400 | |
| 401 | 401 | ROM_START( hp9k310 ) |
| 402 | 402 | ROM_REGION( 0x20000, MAINCPU_TAG, 0 ) |
| 403 | ROM_LOAD16_BYTE( "1818-3771.bin", 0x000001, 0x008000, CRC(b9e4e3ad) SHA1(ed6f1fad94a15d95362701dbe124b52877fc3ec4) ) | |
| 404 | ROM_LOAD16_BYTE( "1818-3772.bin", 0x000000, 0x008000, CRC(a3665919) SHA1(ec1bc7e5b7990a1b09af947a06401e8ed3cb0516) ) | |
| 403 | ROM_LOAD16_BYTE( "1818-3771.bin", 0x000001, 0x008000, CRC(b9e4e3ad) SHA1(ed6f1fad94a15d95362701dbe124b52877fc3ec4) ) | |
| 404 | ROM_LOAD16_BYTE( "1818-3772.bin", 0x000000, 0x008000, CRC(a3665919) SHA1(ec1bc7e5b7990a1b09af947a06401e8ed3cb0516) ) | |
| 405 | 405 | |
| 406 | 406 | ROM_REGION( 0x800, "mcu", 0 ) |
| 407 | ROM_LOAD( "1820-4784_1.bin", 0x000000, 0x000800, CRC(e929044a) SHA1(90849a10bdb8c6e38e73ce027c9c0ad8b3956b1b) ) | |
| 408 | ROM_LOAD( "1820-4784_2.bin", 0x000000, 0x000800, CRC(8defcf50) SHA1(d3abfea468a43db7c2369500a3e390e77a8e22e6) ) | |
| 407 | ROM_LOAD( "1820-4784_1.bin", 0x000000, 0x000800, CRC(e929044a) SHA1(90849a10bdb8c6e38e73ce027c9c0ad8b3956b1b) ) | |
| 408 | ROM_LOAD( "1820-4784_2.bin", 0x000000, 0x000800, CRC(8defcf50) SHA1(d3abfea468a43db7c2369500a3e390e77a8e22e6) ) | |
| 409 | 409 | |
| 410 | 410 | ROM_REGION( 0x4000, "graphics", ROMREGION_ERASEFF | ROMREGION_BE ) |
| 411 | 411 | ROM_LOAD16_BYTE( "98544_1818-1999.bin", 0x000000, 0x002000, CRC(8c7d6480) SHA1(d2bcfd39452c38bc652df39f84c7041cfdf6bd51) ) |
| r243192 | r243193 | |
| 413 | 413 | |
| 414 | 414 | ROM_START( hp9k320 ) |
| 415 | 415 | ROM_REGION( 0x20000, MAINCPU_TAG, 0 ) |
| 416 | ROM_LOAD16_BYTE( "5061-6538.bin", 0x000001, 0x004000, CRC(d6aafeb1) SHA1(88c6b0b2f504303cbbac0c496c26b85458ac5d63) ) | |
| 417 | ROM_LOAD16_BYTE( "5061-6539.bin", 0x000000, 0x004000, CRC(a7ff104c) SHA1(c640fe68314654716bd41b04c6a7f4e560036c7e) ) | |
| 418 | ROM_LOAD16_BYTE( "5061-6540.bin", 0x008001, 0x004000, CRC(4f6796d6) SHA1(fd254897ac1afb8628f40ea93213f60a082c8d36) ) | |
| 419 | ROM_LOAD16_BYTE( "5061-6541.bin", 0x008000, 0x004000, CRC(39d32998) SHA1(6de1bda75187b0878c03c074942b807cf2924f0e) ) | |
| 416 | ROM_LOAD16_BYTE( "5061-6538.bin", 0x000001, 0x004000, CRC(d6aafeb1) SHA1(88c6b0b2f504303cbbac0c496c26b85458ac5d63) ) | |
| 417 | ROM_LOAD16_BYTE( "5061-6539.bin", 0x000000, 0x004000, CRC(a7ff104c) SHA1(c640fe68314654716bd41b04c6a7f4e560036c7e) ) | |
| 418 | ROM_LOAD16_BYTE( "5061-6540.bin", 0x008001, 0x004000, CRC(4f6796d6) SHA1(fd254897ac1afb8628f40ea93213f60a082c8d36) ) | |
| 419 | ROM_LOAD16_BYTE( "5061-6541.bin", 0x008000, 0x004000, CRC(39d32998) SHA1(6de1bda75187b0878c03c074942b807cf2924f0e) ) | |
| 420 | 420 | |
| 421 | 421 | ROM_REGION( 0x4000, "graphics", ROMREGION_ERASEFF | ROMREGION_BE | ROMREGION_32BIT ) |
| 422 | 422 | ROM_LOAD16_BYTE( "98544_1818-1999.bin", 0x000001, 0x002000, CRC(8c7d6480) SHA1(d2bcfd39452c38bc652df39f84c7041cfdf6bd51) ) |
| r243192 | r243193 | |
| 424 | 424 | |
| 425 | 425 | ROM_START( hp9k330 ) |
| 426 | 426 | ROM_REGION( 0x20000, MAINCPU_TAG, 0 ) |
| 427 | ROM_LOAD16_BYTE( "1818-4416.bin", 0x000000, 0x010000, CRC(cd71e85e) SHA1(3e83a80682f733417fdc3720410e45a2cfdcf869) ) | |
| 428 | ROM_LOAD16_BYTE( "1818-4417.bin", 0x000001, 0x010000, CRC(374d49db) SHA1(a12cbf6c151e2f421da4571000b5dffa3ef403b3) ) | |
| 427 | ROM_LOAD16_BYTE( "1818-4416.bin", 0x000000, 0x010000, CRC(cd71e85e) SHA1(3e83a80682f733417fdc3720410e45a2cfdcf869) ) | |
| 428 | ROM_LOAD16_BYTE( "1818-4417.bin", 0x000001, 0x010000, CRC(374d49db) SHA1(a12cbf6c151e2f421da4571000b5dffa3ef403b3) ) | |
| 429 | 429 | |
| 430 | 430 | ROM_REGION( 0x4000, "graphics", ROMREGION_ERASEFF | ROMREGION_BE | ROMREGION_32BIT ) |
| 431 | 431 | ROM_LOAD16_BYTE( "98544_1818-1999.bin", 0x000001, 0x002000, CRC(8c7d6480) SHA1(d2bcfd39452c38bc652df39f84c7041cfdf6bd51) ) |
| r243192 | r243193 | |
| 433 | 433 | |
| 434 | 434 | ROM_START( hp9k340 ) |
| 435 | 435 | ROM_REGION( 0x20000, MAINCPU_TAG, 0 ) |
| 436 | ROM_LOAD16_BYTE( "1818-4416.bin", 0x000000, 0x010000, CRC(cd71e85e) SHA1(3e83a80682f733417fdc3720410e45a2cfdcf869) ) | |
| 437 | ROM_LOAD16_BYTE( "1818-4417.bin", 0x000001, 0x010000, CRC(374d49db) SHA1(a12cbf6c151e2f421da4571000b5dffa3ef403b3) ) | |
| 436 | ROM_LOAD16_BYTE( "1818-4416.bin", 0x000000, 0x010000, CRC(cd71e85e) SHA1(3e83a80682f733417fdc3720410e45a2cfdcf869) ) | |
| 437 | ROM_LOAD16_BYTE( "1818-4417.bin", 0x000001, 0x010000, CRC(374d49db) SHA1(a12cbf6c151e2f421da4571000b5dffa3ef403b3) ) | |
| 438 | 438 | |
| 439 | 439 | ROM_REGION( 0x4000, "graphics", ROMREGION_ERASEFF | ROMREGION_BE | ROMREGION_32BIT ) |
| 440 | 440 | ROM_LOAD16_BYTE( "98544_1818-1999.bin", 0x000001, 0x002000, CRC(8c7d6480) SHA1(d2bcfd39452c38bc652df39f84c7041cfdf6bd51) ) |
| r243192 | r243193 | |
|---|---|---|
| 131 | 131 | |
| 132 | 132 | static INPUT_PORTS_START( mathmagi ) |
| 133 | 133 | PORT_START("IN.0") // R3 |
| 134 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("1") | |
| 135 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("2") | |
| 136 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("3") | |
| 137 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_MINUS_PAD) PORT_NAME("-") | |
| 134 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("1") | |
| 135 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("2") | |
| 136 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("3") | |
| 137 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS_PAD) PORT_NAME("-") | |
| 138 | 138 | |
| 139 | 139 | PORT_START("IN.1") // R5 |
| 140 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_NAME("0") | |
| 141 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_SPACE) PORT_NAME("_") // blank | |
| 142 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_R) PORT_NAME("r") | |
| 143 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_PLUS_PAD) PORT_NAME("+") | |
| 140 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_NAME("0") | |
| 141 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SPACE) PORT_NAME("_") // blank | |
| 142 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R) PORT_NAME("r") | |
| 143 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_PLUS_PAD) PORT_NAME("+") | |
| 144 | 144 | |
| 145 | 145 | PORT_START("IN.2") // R6 |
| 146 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("4") | |
| 147 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("5") | |
| 148 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("6") | |
| 149 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_ASTERISK) PORT_NAME(UTF8_MULTIPLY) | |
| 146 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("4") | |
| 147 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("5") | |
| 148 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("6") | |
| 149 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ASTERISK) PORT_NAME(UTF8_MULTIPLY) | |
| 150 | 150 | |
| 151 | 151 | PORT_START("IN.3") // R7 |
| 152 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_S) PORT_NAME("SEL") | |
| 153 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_N) PORT_NAME("NXT") | |
| 154 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_C) PORT_NAME("?") // check | |
| 155 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("=") | |
| 152 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S) PORT_NAME("SEL") | |
| 153 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N) PORT_NAME("NXT") | |
| 154 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C) PORT_NAME("?") // check | |
| 155 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("=") | |
| 156 | 156 | |
| 157 | 157 | PORT_START("IN.4") // R9 |
| 158 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("7") | |
| 159 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("8") | |
| 160 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD) PORT_NAME("9") | |
| 161 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_SLASH_PAD) PORT_NAME(UTF8_DIVIDE) | |
| 158 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("7") | |
| 159 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("8") | |
| 160 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD) PORT_NAME("9") | |
| 161 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH_PAD) PORT_NAME(UTF8_DIVIDE) | |
| 162 | 162 | |
| 163 | 163 | PORT_START("IN.5") // R10 |
| 164 | 164 | PORT_CONFNAME( 0x01, 0x00, "Players") |
| r243192 | r243193 | |
|---|---|---|
| 123 | 123 | |
| 124 | 124 | static INPUT_PORTS_START( merlin ) |
| 125 | 125 | PORT_START("IN.0") // O0 |
| 126 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_SLASH_PAD) PORT_NAME("Button 0") | |
| 127 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("Button 1") | |
| 128 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_9_PAD) PORT_NAME("Button 3") | |
| 129 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("Button 2") | |
| 126 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_SLASH_PAD) PORT_NAME("Button 0") | |
| 127 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("Button 1") | |
| 128 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_BUTTON4) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_9_PAD) PORT_NAME("Button 3") | |
| 129 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_BUTTON3) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("Button 2") | |
| 130 | 130 | |
| 131 | 131 | PORT_START("IN.1") // O1 |
| 132 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("Button 4") | |
| 133 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("Button 5") | |
| 134 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("Button 7") | |
| 135 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("Button 6") | |
| 132 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_BUTTON5) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("Button 4") | |
| 133 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_BUTTON6) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("Button 5") | |
| 134 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_BUTTON8) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("Button 7") | |
| 135 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_BUTTON7) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("Button 6") | |
| 136 | 136 | |
| 137 | 137 | PORT_START("IN.2") // O2 |
| 138 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("Button 8") | |
| 139 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("Button 9") | |
| 140 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_S) PORT_NAME("Same Game") | |
| 141 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_MINUS) PORT_CODE(KEYCODE_0_PAD) PORT_NAME("Button 10") | |
| 138 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_BUTTON9) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("Button 8") | |
| 139 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_BUTTON10) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("Button 9") | |
| 140 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_BUTTON12) PORT_CODE(KEYCODE_S) PORT_NAME("Same Game") | |
| 141 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_BUTTON11) PORT_CODE(KEYCODE_MINUS) PORT_CODE(KEYCODE_0_PAD) PORT_NAME("Button 10") | |
| 142 | 142 | |
| 143 | 143 | PORT_START("IN.3") // O3 |
| 144 | 144 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_UNUSED) |
| 145 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_C) PORT_NAME("Comp Turn") | |
| 146 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_H) PORT_NAME("Hit Me") | |
| 147 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_N) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("New Game") | |
| 145 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_BUTTON13) PORT_CODE(KEYCODE_C) PORT_NAME("Comp Turn") | |
| 146 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_BUTTON15) PORT_CODE(KEYCODE_H) PORT_NAME("Hit Me") | |
| 147 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_BUTTON14) PORT_CODE(KEYCODE_N) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("New Game") | |
| 148 | 148 | INPUT_PORTS_END |
| 149 | 149 | |
| 150 | 150 |
| r243192 | r243193 | |
|---|---|---|
| 48 | 48 | // 0x8000-0xffff -> HIGH HANDLER defined on a pcb base |
| 49 | 49 | ADDRESS_MAP_END |
| 50 | 50 | |
| 51 | ||
| 52 | static INPUT_PORTS_START( nes_pads12 ) | |
| 53 | PORT_START("PAD1") | |
| 54 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P1 A") PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0001) | |
| 55 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P1 B") PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0001) | |
| 56 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0001) | |
| 57 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0001) | |
| 58 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0001) | |
| 59 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0001) | |
| 60 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0001) | |
| 61 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0001) | |
| 62 | ||
| 63 | PORT_START("PAD2") | |
| 64 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P2 A") PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0010) | |
| 65 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P2 B") PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0010) | |
| 66 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0010) | |
| 67 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0010) | |
| 68 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0010) | |
| 69 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0010) | |
| 70 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0010) | |
| 71 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0010) | |
| 72 | INPUT_PORTS_END | |
| 73 | ||
| 74 | static INPUT_PORTS_START( nes_pads34 ) | |
| 75 | PORT_START("PAD3") | |
| 76 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P3 A") PORT_PLAYER(3) PORT_CONDITION("CTRLSEL", 0x0f00, EQUALS, 0x0100) | |
| 77 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P3 B") PORT_PLAYER(3) PORT_CONDITION("CTRLSEL", 0x0f00, EQUALS, 0x0100) | |
| 78 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_PLAYER(3) PORT_CONDITION("CTRLSEL", 0x0f00, EQUALS, 0x0100) | |
| 79 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START ) PORT_PLAYER(3) PORT_CONDITION("CTRLSEL", 0x0f00, EQUALS, 0x0100) | |
| 80 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(3) PORT_CONDITION("CTRLSEL", 0x0f00, EQUALS, 0x0100) | |
| 81 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(3) PORT_CONDITION("CTRLSEL", 0x0f00, EQUALS, 0x0100) | |
| 82 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(3) PORT_CONDITION("CTRLSEL", 0x0f00, EQUALS, 0x0100) | |
| 83 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(3) PORT_CONDITION("CTRLSEL", 0x0f00, EQUALS, 0x0100) | |
| 84 | ||
| 85 | PORT_START("PAD4") | |
| 86 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P4 A") PORT_PLAYER(4) PORT_CONDITION("CTRLSEL", 0xf000, EQUALS, 0x1000) | |
| 87 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P4 B") PORT_PLAYER(4) PORT_CONDITION("CTRLSEL", 0xf000, EQUALS, 0x1000) | |
| 88 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_PLAYER(4) PORT_CONDITION("CTRLSEL", 0xf000, EQUALS, 0x1000) | |
| 89 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START ) PORT_PLAYER(4) PORT_CONDITION("CTRLSEL", 0xf000, EQUALS, 0x1000) | |
| 90 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(4) PORT_CONDITION("CTRLSEL", 0xf000, EQUALS, 0x1000) | |
| 91 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(4) PORT_CONDITION("CTRLSEL", 0xf000, EQUALS, 0x1000) | |
| 92 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(4) PORT_CONDITION("CTRLSEL", 0xf000, EQUALS, 0x1000) | |
| 93 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(4) PORT_CONDITION("CTRLSEL", 0xf000, EQUALS, 0x1000) | |
| 94 | INPUT_PORTS_END | |
| 95 | ||
| 96 | ||
| 97 | static INPUT_PORTS_START( nes_powerpad ) | |
| 98 | // difference between the two sides is that we mirror the key mapping to match the real pad layout! | |
| 99 | PORT_START("POWERPAD1") | |
| 100 | // side A layout | |
| 101 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad Top1") PORT_CODE(KEYCODE_Y) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0050) | |
| 102 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0050) | |
| 103 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad Mid1") PORT_CODE(KEYCODE_J) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0050) | |
| 104 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0050) | |
| 105 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad Mid2") PORT_CODE(KEYCODE_H) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0050) | |
| 106 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad Low1") PORT_CODE(KEYCODE_N) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0050) | |
| 107 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad Low2") PORT_CODE(KEYCODE_B) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0050) | |
| 108 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad Mid3") PORT_CODE(KEYCODE_G) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0050) | |
| 109 | // side B layout | |
| 110 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad 2") PORT_CODE(KEYCODE_T) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0060) | |
| 111 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad 1") PORT_CODE(KEYCODE_R) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0060) | |
| 112 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad 5") PORT_CODE(KEYCODE_F) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0060) | |
| 113 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad 9") PORT_CODE(KEYCODE_V) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0060) | |
| 114 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad 6") PORT_CODE(KEYCODE_G) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0060) | |
| 115 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad 10") PORT_CODE(KEYCODE_B) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0060) | |
| 116 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad 11") PORT_CODE(KEYCODE_N) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0060) | |
| 117 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad 7") PORT_CODE(KEYCODE_H) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0060) | |
| 118 | PORT_START("POWERPAD2") | |
| 119 | // side A layout | |
| 120 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0050) | |
| 121 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad Top2") PORT_CODE(KEYCODE_T) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0050) | |
| 122 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0050) | |
| 123 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad Mid4") PORT_CODE(KEYCODE_F) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0050) | |
| 124 | PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0050) | |
| 125 | // side B layout | |
| 126 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad 4") PORT_CODE(KEYCODE_U) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0060) | |
| 127 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad 3") PORT_CODE(KEYCODE_Y) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0060) | |
| 128 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad 12") PORT_CODE(KEYCODE_M) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0060) | |
| 129 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad 8") PORT_CODE(KEYCODE_J) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0060) | |
| 130 | PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0060) | |
| 131 | INPUT_PORTS_END | |
| 132 | ||
| 133 | static INPUT_PORTS_START( nes_zapper1 ) | |
| 134 | PORT_START("ZAPPER1_X") | |
| 135 | PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(70) PORT_KEYDELTA(30) PORT_MINMAX(0,255) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0002) | |
| 136 | PORT_START("ZAPPER1_Y") | |
| 137 | PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(50) PORT_KEYDELTA(30) PORT_MINMAX(0,255) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0002) | |
| 138 | PORT_START("ZAPPER1_T") | |
| 139 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("P1 Lightgun Trigger") PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0002) | |
| 140 | INPUT_PORTS_END | |
| 141 | ||
| 142 | static INPUT_PORTS_START( nes_zapper2 ) | |
| 143 | PORT_START("ZAPPER2_X") | |
| 144 | PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(70) PORT_KEYDELTA(30) PORT_MINMAX(0,255 ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0020) | |
| 145 | PORT_START("ZAPPER2_Y") | |
| 146 | PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(50) PORT_KEYDELTA(30) PORT_MINMAX(0,255 ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0020) | |
| 147 | PORT_START("ZAPPER2_T") | |
| 148 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("P2 Lightgun Trigger") PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0020) | |
| 149 | INPUT_PORTS_END | |
| 150 | ||
| 151 | static INPUT_PORTS_START( nes_paddle ) | |
| 152 | PORT_START("PADDLE") | |
| 153 | PORT_BIT( 0xff, 0x7f, IPT_PADDLE) PORT_SENSITIVITY(25) PORT_KEYDELTA(25) PORT_CENTERDELTA(0) PORT_MINMAX(0x62,0xf2) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0040) | |
| 154 | PORT_START("PADDLE_BUTTON") | |
| 155 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Paddle button") PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0040) | |
| 156 | INPUT_PORTS_END | |
| 157 | ||
| 51 | 158 | static INPUT_PORTS_START( nes ) |
| 52 | // input devices go through slot options | |
| 159 | PORT_INCLUDE( nes_pads12 ) | |
| 160 | PORT_INCLUDE( nes_pads34 ) | |
| 161 | PORT_INCLUDE( nes_powerpad ) | |
| 162 | PORT_INCLUDE( nes_zapper1 ) | |
| 163 | PORT_INCLUDE( nes_zapper2 ) | |
| 164 | PORT_INCLUDE( nes_paddle ) | |
| 165 | ||
| 166 | PORT_START("CTRLSEL") | |
| 167 | PORT_CONFNAME( 0x000f, 0x0001, "P1 Controller") | |
| 168 | PORT_CONFSETTING( 0x0000, "Unconnected" ) | |
| 169 | PORT_CONFSETTING( 0x0001, "Gamepad" ) | |
| 170 | PORT_CONFSETTING( 0x0002, "Zapper" ) | |
| 171 | PORT_CONFNAME( 0x00f0, 0x0010, "P2 Controller") | |
| 172 | PORT_CONFSETTING( 0x0000, "Unconnected" ) | |
| 173 | PORT_CONFSETTING( 0x0010, "Gamepad" ) | |
| 174 | PORT_CONFSETTING( 0x0020, "Zapper" ) | |
| 175 | PORT_CONFSETTING( 0x0040, "Arkanoid paddle" ) | |
| 176 | PORT_CONFSETTING( 0x0050, "Power Pad (Side A layout)" ) | |
| 177 | PORT_CONFSETTING( 0x0060, "Power Pad (Side B layout)" ) | |
| 178 | PORT_CONFNAME( 0x0f00, 0x0000, "P3 Controller") | |
| 179 | PORT_CONFSETTING( 0x0000, "Unconnected" ) | |
| 180 | PORT_CONFSETTING( 0x0100, "Gamepad" ) | |
| 181 | PORT_CONFNAME( 0xf000, 0x0000, "P4 Controller") | |
| 182 | PORT_CONFSETTING( 0x0000, "Unconnected" ) | |
| 183 | PORT_CONFSETTING( 0x1000, "Gamepad" ) | |
| 184 | ||
| 53 | 185 | PORT_START("CONFIG") |
| 54 | 186 | PORT_CONFNAME( 0x01, 0x00, "Draw Top/Bottom 8 Lines") |
| 55 | 187 | PORT_CONFSETTING( 0x01, DEF_STR(No) ) |
| r243192 | r243193 | |
| 59 | 191 | PORT_CONFSETTING( 0x00, DEF_STR(Yes) ) |
| 60 | 192 | INPUT_PORTS_END |
| 61 | 193 | |
| 194 | ||
| 195 | static INPUT_PORTS_START( fc_pads12 ) | |
| 196 | PORT_START("PAD1") | |
| 197 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P1 A") PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0001) | |
| 198 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P1 B") PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0001) | |
| 199 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0001) | |
| 200 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0001) | |
| 201 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0001) | |
| 202 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0001) | |
| 203 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0001) | |
| 204 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0001) | |
| 205 | ||
| 206 | PORT_START("PAD2") | |
| 207 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P2 A") PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0010) | |
| 208 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P2 B") PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0010) | |
| 209 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0010) | |
| 210 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0010) | |
| 211 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0010) | |
| 212 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0010) | |
| 213 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0010) | |
| 214 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0010) | |
| 215 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P2 A") PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x00f0) | |
| 216 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P2 B") PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x00f0) | |
| 217 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_NAME("Microphone") PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x00f0) | |
| 218 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x00f0) | |
| 219 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x00f0) | |
| 220 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x00f0) | |
| 221 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x00f0) | |
| 222 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x00f0) | |
| 223 | INPUT_PORTS_END | |
| 224 | ||
| 225 | static INPUT_PORTS_START( fc_pads34 ) | |
| 226 | PORT_START("PAD3") | |
| 227 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P3 A") PORT_PLAYER(3) PORT_CONDITION("CTRLSEL", 0x0f00, EQUALS, 0x0100) | |
| 228 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P3 B") PORT_PLAYER(3) PORT_CONDITION("CTRLSEL", 0x0f00, EQUALS, 0x0100) | |
| 229 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_PLAYER(3) PORT_CONDITION("CTRLSEL", 0x0f00, EQUALS, 0x0100) | |
| 230 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START ) PORT_PLAYER(3) PORT_CONDITION("CTRLSEL", 0x0f00, EQUALS, 0x0100) | |
| 231 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(3) PORT_CONDITION("CTRLSEL", 0x0f00, EQUALS, 0x0100) | |
| 232 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(3) PORT_CONDITION("CTRLSEL", 0x0f00, EQUALS, 0x0100) | |
| 233 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(3) PORT_CONDITION("CTRLSEL", 0x0f00, EQUALS, 0x0100) | |
| 234 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(3) PORT_CONDITION("CTRLSEL", 0x0f00, EQUALS, 0x0100) | |
| 235 | ||
| 236 | PORT_START("PAD4") | |
| 237 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P4 A") PORT_PLAYER(4) PORT_CONDITION("CTRLSEL", 0xf000, EQUALS, 0x1000) | |
| 238 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P4 B") PORT_PLAYER(4) PORT_CONDITION("CTRLSEL", 0xf000, EQUALS, 0x1000) | |
| 239 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_PLAYER(4) PORT_CONDITION("CTRLSEL", 0xf000, EQUALS, 0x1000) | |
| 240 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START ) PORT_PLAYER(4) PORT_CONDITION("CTRLSEL", 0xf000, EQUALS, 0x1000) | |
| 241 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(4) PORT_CONDITION("CTRLSEL", 0xf000, EQUALS, 0x1000) | |
| 242 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(4) PORT_CONDITION("CTRLSEL", 0xf000, EQUALS, 0x1000) | |
| 243 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(4) PORT_CONDITION("CTRLSEL", 0xf000, EQUALS, 0x1000) | |
| 244 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(4) PORT_CONDITION("CTRLSEL", 0xf000, EQUALS, 0x1000) | |
| 245 | INPUT_PORTS_END | |
| 246 | ||
| 247 | static INPUT_PORTS_START( fc_lightgun ) | |
| 248 | PORT_START("ZAPPER2_X") | |
| 249 | PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(70) PORT_KEYDELTA(30) PORT_MINMAX(0,255) PORT_PLAYER(2) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x01) | |
| 250 | PORT_START("ZAPPER2_Y") | |
| 251 | PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(50) PORT_KEYDELTA(30) PORT_MINMAX(0,255) PORT_PLAYER(2) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x01) | |
| 252 | PORT_START("ZAPPER2_T") | |
| 253 | PORT_BIT( 0x03, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Lightgun Trigger") PORT_PLAYER(2) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x01) | |
| 254 | INPUT_PORTS_END | |
| 255 | ||
| 256 | static INPUT_PORTS_START( fc_paddle ) | |
| 257 | PORT_START("PADDLE") | |
| 258 | PORT_BIT( 0xff, 0x7f, IPT_PADDLE) PORT_SENSITIVITY(25) PORT_KEYDELTA(25) PORT_CENTERDELTA(0) PORT_MINMAX(0x62,0xf2) PORT_PLAYER(2) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x04) | |
| 259 | PORT_START("PADDLE_BUTTON") | |
| 260 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Paddle button") PORT_PLAYER(2) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x04) | |
| 261 | INPUT_PORTS_END | |
| 262 | ||
| 263 | static INPUT_PORTS_START( fc_cclimb ) | |
| 264 | PORT_START("CC_LEFT") | |
| 265 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0002) | |
| 266 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0002) | |
| 267 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0002) | |
| 268 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0002) | |
| 269 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_UP ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0002) | |
| 270 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_DOWN ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0002) | |
| 271 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_LEFT ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0002) | |
| 272 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_RIGHT ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0002) | |
| 273 | ||
| 274 | PORT_START("CC_RIGHT") | |
| 275 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0020) | |
| 276 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0020) | |
| 277 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0020) | |
| 278 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0020) | |
| 279 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_UP ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0020) | |
| 280 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_DOWN ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0020) | |
| 281 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_LEFT ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0020) | |
| 282 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_RIGHT ) PORT_PLAYER(1)PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0020) | |
| 283 | INPUT_PORTS_END | |
| 284 | ||
| 285 | static INPUT_PORTS_START( fc_keyboard ) | |
| 286 | PORT_START("FCKEY0") | |
| 287 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F8) PORT_CHAR(UCHAR_MAMEKEY(F8)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 288 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 289 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR('[') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 290 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR(']') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 291 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Kana") PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 292 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_RSHIFT) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 293 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH2) PORT_CHAR('\\') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 294 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Stop") PORT_CODE(KEYCODE_BACKSPACE) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 295 | ||
| 296 | PORT_START("FCKEY1") | |
| 297 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F7) PORT_CHAR(UCHAR_MAMEKEY(F7)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 298 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('@') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 299 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COLON) PORT_CHAR(':') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 300 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR(';') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 301 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CHAR('_') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 302 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CHAR('/') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 303 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 304 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('^') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 305 | ||
| 306 | PORT_START("FCKEY2") | |
| 307 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F6) PORT_CHAR(UCHAR_MAMEKEY(F6)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 308 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O) PORT_CHAR('O') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 309 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_L) PORT_CHAR('L') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 310 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_K) PORT_CHAR('K') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 311 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 312 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 313 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P) PORT_CHAR('P') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 314 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 315 | ||
| 316 | PORT_START("FCKEY3") | |
| 317 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F5) PORT_CHAR(UCHAR_MAMEKEY(F5)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 318 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I) PORT_CHAR('I') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 319 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_U) PORT_CHAR('U') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 320 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J) PORT_CHAR('J') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 321 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M) PORT_CHAR('M') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 322 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N) PORT_CHAR('N') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 323 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 324 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 325 | ||
| 326 | PORT_START("FCKEY4") | |
| 327 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F4) PORT_CHAR(UCHAR_MAMEKEY(F4)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 328 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Y) PORT_CHAR('Y') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 329 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G) PORT_CHAR('G') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 330 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H) PORT_CHAR('H') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 331 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B) PORT_CHAR('B') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 332 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_V) PORT_CHAR('V') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 333 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 334 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 335 | ||
| 336 | PORT_START("FCKEY5") | |
| 337 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F3) PORT_CHAR(UCHAR_MAMEKEY(F3)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 338 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_T) PORT_CHAR('T') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 339 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R) PORT_CHAR('R') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 340 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D) PORT_CHAR('D') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 341 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F) PORT_CHAR('F') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 342 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C) PORT_CHAR('C') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 343 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 344 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 345 | ||
| 346 | PORT_START("FCKEY6") | |
| 347 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F2) PORT_CHAR(UCHAR_MAMEKEY(F2)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 348 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_W) PORT_CHAR('W') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 349 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S) PORT_CHAR('S') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 350 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A) PORT_CHAR('A') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 351 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_CHAR('X') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 352 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Z) PORT_CHAR('Z') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 353 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_CHAR('E') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 354 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 355 | ||
| 356 | PORT_START("FCKEY7") | |
| 357 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F1) PORT_CHAR(UCHAR_MAMEKEY(F1)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 358 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_TAB) PORT_CHAR(UCHAR_MAMEKEY(ESC)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 359 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) PORT_CHAR('Q') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 360 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_SHIFT_2) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 361 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 362 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Grph") PORT_CODE(KEYCODE_LALT) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 363 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 364 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 365 | ||
| 366 | PORT_START("FCKEY8") | |
| 367 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Clr") PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 368 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 369 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 370 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_LEFT) PORT_CHAR(UCHAR_MAMEKEY(LEFT)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 371 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 372 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 373 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Del") PORT_CODE(KEYCODE_DEL) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 374 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Ins") PORT_CODE(KEYCODE_INSERT) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 375 | ||
| 376 | INPUT_PORTS_END | |
| 377 | ||
| 378 | static INPUT_PORTS_START( subor_keyboard ) | |
| 379 | PORT_START("SUBKEY0") | |
| 380 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 381 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G) PORT_CHAR('G') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 382 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F) PORT_CHAR('F') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 383 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C) PORT_CHAR('C') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 384 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F2) PORT_CHAR(UCHAR_MAMEKEY(F2)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 385 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_CHAR('E') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 386 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 387 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_V) PORT_CHAR('V') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 388 | ||
| 389 | PORT_START("SUBKEY1") | |
| 390 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 391 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D) PORT_CHAR('D') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 392 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S) PORT_CHAR('S') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 393 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_END) PORT_CHAR(UCHAR_MAMEKEY(END)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 394 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F1) PORT_CHAR(UCHAR_MAMEKEY(F1)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 395 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_W) PORT_CHAR('W') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 396 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 397 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_CHAR('X') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 398 | ||
| 399 | PORT_START("SUBKEY2") | |
| 400 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_INSERT) PORT_CHAR(UCHAR_MAMEKEY(INSERT)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 401 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 402 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("NEXT") PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 403 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 404 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F8) PORT_CHAR(UCHAR_MAMEKEY(F8)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 405 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("PRIOR") PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 406 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_DEL) PORT_CHAR(UCHAR_MAMEKEY(DEL)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 407 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_HOME) PORT_CHAR(UCHAR_MAMEKEY(HOME)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 408 | ||
| 409 | PORT_START("SUBKEY3") | |
| 410 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 411 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I) PORT_CHAR('I') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 412 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_L) PORT_CHAR('L') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 413 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 414 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F5) PORT_CHAR(UCHAR_MAMEKEY(F5)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 415 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O) PORT_CHAR('O') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 416 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 417 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 418 | ||
| 419 | PORT_START("SUBKEY4") | |
| 420 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(']') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 421 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 422 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 423 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_LEFT) PORT_CHAR(UCHAR_MAMEKEY(LEFT)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 424 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F7) PORT_CHAR(UCHAR_MAMEKEY(F7)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 425 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 426 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('\\') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 427 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 428 | ||
| 429 | PORT_START("SUBKEY5") | |
| 430 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) PORT_CHAR('Q') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 431 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CAPSLOCK) PORT_CHAR(UCHAR_MAMEKEY(CAPSLOCK)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 432 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Z) PORT_CHAR('Z') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 433 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_TAB) PORT_CHAR('\t') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 434 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ESC) PORT_CHAR(UCHAR_MAMEKEY(ESC)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 435 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A) PORT_CHAR('A') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 436 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 437 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_SHIFT_2) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 438 | ||
| 439 | PORT_START("SUBKEY6") | |
| 440 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 441 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Y) PORT_CHAR('Y') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 442 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_K) PORT_CHAR('K') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 443 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M) PORT_CHAR('M') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 444 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F4) PORT_CHAR(UCHAR_MAMEKEY(F4)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 445 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_U) PORT_CHAR('U') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 446 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 447 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J) PORT_CHAR('J') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 448 | ||
| 449 | PORT_START("SUBKEY7") | |
| 450 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 451 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COLON) PORT_CHAR(':') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 452 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('\'') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 453 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 454 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F6) PORT_CHAR(UCHAR_MAMEKEY(F6)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 455 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P) PORT_CHAR('P') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 456 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('=') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 457 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 458 | ||
| 459 | PORT_START("SUBKEY8") | |
| 460 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_T) PORT_CHAR('T') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 461 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H) PORT_CHAR('H') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 462 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N) PORT_CHAR('N') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 463 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 464 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F3) PORT_CHAR(UCHAR_MAMEKEY(F3)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 465 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R) PORT_CHAR('R') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 466 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 467 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B) PORT_CHAR('B') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 468 | ||
| 469 | PORT_START("SUBKEY9") | |
| 470 | PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 471 | ||
| 472 | PORT_START("SUBKEY10") | |
| 473 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("LMENU") PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 474 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4_PAD) PORT_CHAR(UCHAR_MAMEKEY(4_PAD)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 475 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7_PAD) PORT_CHAR(UCHAR_MAMEKEY(7_PAD)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 476 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F11) PORT_CHAR(UCHAR_MAMEKEY(F11)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 477 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F12) PORT_CHAR(UCHAR_MAMEKEY(F12)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 478 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1_PAD) PORT_CHAR(UCHAR_MAMEKEY(1_PAD)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 479 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2_PAD) PORT_CHAR(UCHAR_MAMEKEY(2_PAD)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 480 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8_PAD) PORT_CHAR(UCHAR_MAMEKEY(8_PAD)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 481 | ||
| 482 | PORT_START("SUBKEY11") | |
| 483 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS_PAD)PORT_CHAR(UCHAR_MAMEKEY(MINUS_PAD)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 484 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_PLUS_PAD) PORT_CHAR(UCHAR_MAMEKEY(PLUS_PAD)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 485 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ASTERISK) PORT_CHAR(UCHAR_MAMEKEY(ASTERISK)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 486 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9_PAD) PORT_CHAR(UCHAR_MAMEKEY(9_PAD)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 487 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F10) PORT_CHAR(UCHAR_MAMEKEY(F10)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 488 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5_PAD) PORT_CHAR(UCHAR_MAMEKEY(5_PAD)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 489 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH_PAD)PORT_CHAR(UCHAR_MAMEKEY(SLASH_PAD)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 490 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_NUMLOCK) PORT_CHAR(UCHAR_MAMEKEY(NUMLOCK)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 491 | ||
| 492 | PORT_START("SUBKEY12") | |
| 493 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_TILDE) PORT_CHAR('`') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 494 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6_PAD) PORT_CHAR(UCHAR_MAMEKEY(6_PAD)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 495 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("PAUSE") PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 496 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("SPACE2") PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 497 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F9) PORT_CHAR(UCHAR_MAMEKEY(F9)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 498 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3_PAD) PORT_CHAR(UCHAR_MAMEKEY(3_PAD)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 499 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Keypad .") PORT_CODE(KEYCODE_DEL_PAD) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 500 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0_PAD) PORT_CHAR(UCHAR_MAMEKEY(0_PAD)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 501 | ||
| 502 | INPUT_PORTS_END | |
| 503 | ||
| 504 | static INPUT_PORTS_START( mahjong_panel ) | |
| 505 | PORT_START("MAH0") | |
| 506 | PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x07) | |
| 507 | ||
| 508 | PORT_START("MAH1") | |
| 509 | PORT_BIT( 0x03, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x07) | |
| 510 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_N ) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x07) | |
| 511 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_MAHJONG_M ) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x07) | |
| 512 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_MAHJONG_L ) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x07) | |
| 513 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_MAHJONG_K ) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x07) | |
| 514 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_MAHJONG_J ) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x07) | |
| 515 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_MAHJONG_I ) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x07) | |
| 516 | ||
| 517 | PORT_START("MAH2") | |
| 518 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_H ) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x07) | |
| 519 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_G ) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x07) | |
| 520 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_F ) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x07) | |
| 521 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_MAHJONG_E ) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x07) | |
| 522 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_MAHJONG_D ) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x07) | |
| 523 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_MAHJONG_C ) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x07) | |
| 524 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_MAHJONG_B ) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x07) | |
| 525 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_MAHJONG_A ) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x07) | |
| 526 | ||
| 527 | PORT_START("MAH3") | |
| 528 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x07) | |
| 529 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_RON ) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x07) | |
| 530 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_REACH ) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x07) | |
| 531 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_MAHJONG_CHI ) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x07) | |
| 532 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_MAHJONG_PON ) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x07) | |
| 533 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_MAHJONG_KAN ) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x07) | |
| 534 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_NAME("P1 Mahjong Select") PORT_CONDITION("EXP", 0x0f, EQUALS, 0x07) | |
| 535 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START ) PORT_NAME("P1 Mahjong Start") PORT_CONDITION("EXP", 0x0f, EQUALS, 0x07) | |
| 536 | INPUT_PORTS_END | |
| 537 | ||
| 538 | // these are read differently than the powerpad inputs, but we share the tags, to reduce | |
| 539 | static INPUT_PORTS_START( fc_ftrainer ) | |
| 540 | // difference between the two sides is that we mirror the key mapping to match the real pad layout! | |
| 541 | PORT_START("FT_COL0") | |
| 542 | // side A layout | |
| 543 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x05) | |
| 544 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer Mid1") PORT_CODE(KEYCODE_J) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x05) | |
| 545 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x05) | |
| 546 | // side B layout | |
| 547 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer 12") PORT_CODE(KEYCODE_M) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x06) | |
| 548 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer 8") PORT_CODE(KEYCODE_J) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x06) | |
| 549 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer 4") PORT_CODE(KEYCODE_U) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x06) | |
| 550 | ||
| 551 | PORT_START("FT_COL1") | |
| 552 | // side A layout | |
| 553 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer Low1") PORT_CODE(KEYCODE_N) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x05) | |
| 554 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer Mid2") PORT_CODE(KEYCODE_H) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x05) | |
| 555 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer Top1") PORT_CODE(KEYCODE_Y) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x05) | |
| 556 | // side B layout | |
| 557 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer 11") PORT_CODE(KEYCODE_N) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x06) | |
| 558 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer 7") PORT_CODE(KEYCODE_H) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x06) | |
| 559 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer 3") PORT_CODE(KEYCODE_Y) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x06) | |
| 560 | ||
| 561 | PORT_START("FT_COL2") | |
| 562 | // side A layout | |
| 563 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer Low2") PORT_CODE(KEYCODE_B) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x05) | |
| 564 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer Mid3") PORT_CODE(KEYCODE_G) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x05) | |
| 565 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer Top2") PORT_CODE(KEYCODE_T) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x05) | |
| 566 | // side B layout | |
| 567 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer 10") PORT_CODE(KEYCODE_B) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x06) | |
| 568 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer 6") PORT_CODE(KEYCODE_G) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x06) | |
| 569 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer 2") PORT_CODE(KEYCODE_T) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x06) | |
| 570 | ||
| 571 | PORT_START("FT_COL3") | |
| 572 | // side A layout | |
| 573 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x05) | |
| 574 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer Mid4") PORT_CODE(KEYCODE_F) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x05) | |
| 575 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x05) | |
| 576 | // side B layout | |
| 577 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer 9") PORT_CODE(KEYCODE_V) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x06) | |
| 578 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer 5") PORT_CODE(KEYCODE_F) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x06) | |
| 579 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer 1") PORT_CODE(KEYCODE_R) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x06) | |
| 580 | INPUT_PORTS_END | |
| 581 | ||
| 582 | ||
| 583 | ||
| 62 | 584 | static INPUT_PORTS_START( famicom ) |
| 63 | // input devices go through slot options | |
| 585 | PORT_INCLUDE( fc_pads12 ) | |
| 586 | PORT_INCLUDE( fc_pads34 ) | |
| 587 | PORT_INCLUDE( fc_lightgun ) | |
| 588 | // FIXME: was it possible to attache two paddles in a Famicom (as the Arkanoid 2 box suggests)?!? investigate... | |
| 589 | PORT_INCLUDE( fc_paddle ) | |
| 590 | // Crazy Climber is not really a separate controller, but a couple of small sticks to be | |
| 591 | // put on top of d-pads of the regular controllers. Users should then control the game | |
| 592 | // by using both controllers, turned 90 degrees, as a couple of dual sticks as in the arcade | |
| 593 | PORT_INCLUDE( fc_cclimb ) | |
| 594 | PORT_INCLUDE( fc_keyboard ) | |
| 595 | PORT_INCLUDE( subor_keyboard ) | |
| 596 | PORT_INCLUDE( mahjong_panel ) | |
| 597 | PORT_INCLUDE( fc_ftrainer ) | |
| 598 | ||
| 599 | PORT_START("CTRLSEL") | |
| 600 | PORT_CONFNAME( 0x000f, 0x0001, "P1 Controller") | |
| 601 | PORT_CONFSETTING( 0x0000, "Unconnected" ) | |
| 602 | PORT_CONFSETTING( 0x0001, "Gamepad" ) | |
| 603 | PORT_CONFSETTING( 0x0002, "Crazy Climber pad (Left)" ) | |
| 604 | PORT_CONFNAME( 0x00f0, 0x0010, "P2 Controller") | |
| 605 | PORT_CONFSETTING( 0x0000, "Unconnected" ) | |
| 606 | PORT_CONFSETTING( 0x0010, "Gamepad" ) | |
| 607 | PORT_CONFSETTING( 0x0020, "Crazy Climber pad (Right)" ) | |
| 608 | PORT_CONFSETTING( 0x00f0, "Gamepad (Older Version)" ) | |
| 609 | PORT_CONFNAME( 0x0f00, 0x0000, "P3 Controller") PORT_CONDITION("EXP", 0x0f, EQUALS, 0x08) | |
| 610 | PORT_CONFSETTING( 0x0000, "Unconnected" ) | |
| 611 | PORT_CONFSETTING( 0x0100, "Gamepad" ) | |
| 612 | PORT_CONFNAME( 0xf000, 0x0000, "P4 Controller") PORT_CONDITION("EXP", 0x0f, EQUALS, 0x08) | |
| 613 | PORT_CONFSETTING( 0x0000, "Unconnected" ) | |
| 614 | PORT_CONFSETTING( 0x1000, "Gamepad" ) | |
| 615 | ||
| 616 | PORT_START("EXP") | |
| 617 | PORT_CONFNAME( 0x0f, 0x00, "Expansion Port") | |
| 618 | PORT_CONFSETTING( 0x00, "(Empty)" ) | |
| 619 | PORT_CONFSETTING( 0x01, "Light Gun" ) | |
| 620 | PORT_CONFSETTING( 0x02, "FC Keyboard" ) | |
| 621 | PORT_CONFSETTING( 0x03, "Subor Keyboard" ) | |
| 622 | PORT_CONFSETTING( 0x04, "Arkanoid paddle" ) | |
| 623 | PORT_CONFSETTING( 0x05, "Family Trainer (Side A)" ) | |
| 624 | PORT_CONFSETTING( 0x06, "Family Trainer (Side B)" ) | |
| 625 | PORT_CONFSETTING( 0x07, "Mahjong Panel" ) | |
| 626 | PORT_CONFSETTING( 0x08, "Hori Twin Adapter" ) | |
| 627 | ||
| 64 | 628 | PORT_START("CONFIG") |
| 65 | 629 | PORT_CONFNAME( 0x01, 0x00, "Draw Top/Bottom 8 Lines") |
| 66 | 630 | PORT_CONFSETTING( 0x01, DEF_STR(No) ) |
| r243192 | r243193 | |
| 70 | 634 | PORT_CONFSETTING( 0x00, DEF_STR(Yes) ) |
| 71 | 635 | |
| 72 | 636 | PORT_START("FLIPDISK") /* fake key */ |
| 73 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_ | |
| 637 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON3) PORT_NAME("Change Disk Side") | |
| 74 | 638 | INPUT_PORTS_END |
| 75 | 639 | |
| 76 | 640 | |
| r243192 | r243193 | |
| 110 | 674 | MCFG_NES_APU_CPU("maincpu") |
| 111 | 675 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90) |
| 112 | 676 | |
| 113 | MCFG_NES_CONTROL_PORT_ADD("ctrl1", nes_control_port1_devices, "joypad") | |
| 114 | MCFG_NESCTRL_BRIGHTPIXEL_CB(nes_state, bright_pixel) | |
| 115 | MCFG_NES_CONTROL_PORT_ADD("ctrl2", nes_control_port2_devices, "joypad") | |
| 116 | MCFG_NESCTRL_BRIGHTPIXEL_CB(nes_state, bright_pixel) | |
| 117 | ||
| 118 | 677 | MCFG_NES_CARTRIDGE_ADD("nes_slot", nes_cart, NULL) |
| 119 | 678 | MCFG_SOFTWARE_LIST_ADD("cart_list", "nes") |
| 120 | 679 | MCFG_SOFTWARE_LIST_ADD("ade_list", "nes_ade") // Camerica/Codemasters Aladdin Deck Enhancer mini-carts |
| r243192 | r243193 | |
| 170 | 729 | MACHINE_CONFIG_END |
| 171 | 730 | |
| 172 | 731 | static MACHINE_CONFIG_DERIVED( famicom, nes ) |
| 173 | MCFG_DEVICE_REMOVE("ctrl1") | |
| 174 | MCFG_DEVICE_REMOVE("ctrl2") | |
| 175 | MCFG_NES_CONTROL_PORT_ADD("ctrl1", fc_control_port1_devices, "joypad") | |
| 176 | MCFG_NES_CONTROL_PORT_ADD("ctrl2", fc_control_port2_devices, "joypad") | |
| 177 | MCFG_FC_EXPANSION_PORT_ADD("exp", fc_expansion_devices, NULL) | |
| 178 | MCFG_NESCTRL_BRIGHTPIXEL_CB(nes_state, bright_pixel) | |
| 732 | MCFG_CASSETTE_ADD( "tape" ) | |
| 733 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED) | |
| 734 | MCFG_CASSETTE_INTERFACE("fc_cass") | |
| 179 | 735 | |
| 180 | 736 | MCFG_SOFTWARE_LIST_ADD("flop_list", "famicom_flop") |
| 181 | 737 | MCFG_SOFTWARE_LIST_ADD("cass_list", "famicom_cass") |
| r243192 | r243193 | |
| 213 | 769 | MACHINE_START_MEMBER( nes_state, fds ) |
| 214 | 770 | { |
| 215 | 771 | m_ciram = auto_alloc_array(machine(), UINT8, 0x800); |
| 772 | setup_ioports(); | |
| 216 | 773 | setup_disk(m_disk); |
| 217 | ||
| 218 | // register saves | |
| 219 | save_item(NAME(m_last_frame_flip)); | |
| 220 | save_pointer(NAME(m_ciram), 0x800); | |
| 774 | state_register(); | |
| 221 | 775 | } |
| 222 | 776 | |
| 223 | 777 | MACHINE_RESET_MEMBER( nes_state, fds ) |
| r243192 | r243193 | |
| 227 | 781 | |
| 228 | 782 | // the rest is the same as for nes/famicom/dendy |
| 229 | 783 | m_maincpu->reset(); |
| 784 | ||
| 785 | memset(m_pad_latch, 0, sizeof(m_pad_latch)); | |
| 786 | memset(m_zapper_latch, 0, sizeof(m_zapper_latch)); | |
| 787 | m_paddle_latch = 0; | |
| 788 | m_paddle_btn_latch = 0; | |
| 230 | 789 | } |
| 231 | 790 | |
| 232 | 791 | static MACHINE_CONFIG_DERIVED( fds, famicom ) |
| 233 | 792 | MCFG_MACHINE_START_OVERRIDE( nes_state, fds ) |
| 234 | 793 | MCFG_MACHINE_RESET_OVERRIDE( nes_state, fds ) |
| 794 | MCFG_DEVICE_REMOVE("tape") | |
| 235 | 795 | |
| 236 | 796 | MCFG_DEVICE_REMOVE("nes_slot") |
| 237 | 797 | MCFG_DEVICE_ADD("disk", NES_DISKSYS, 0) |
| r243192 | r243193 | |
| 267 | 827 | |
| 268 | 828 | // the rest is the same as for nes/famicom/dendy |
| 269 | 829 | m_maincpu->reset(); |
| 830 | ||
| 831 | memset(m_pad_latch, 0, sizeof(m_pad_latch)); | |
| 832 | memset(m_zapper_latch, 0, sizeof(m_zapper_latch)); | |
| 833 | m_paddle_latch = 0; | |
| 834 | m_paddle_btn_latch = 0; | |
| 270 | 835 | } |
| 271 | 836 | |
| 272 | 837 | static MACHINE_CONFIG_DERIVED( famitwin, famicom ) |
| r243192 | r243193 | |
|---|---|---|
| 67 | 67 | #include "machine/pit8253.h" |
| 68 | 68 | #include "machine/z80dart.h" |
| 69 | 69 | #include "machine/wd_fdc.h" |
| 70 | #include "machine/wd2010.h" | |
| 71 | 70 | #include "bus/rs232/rs232.h" |
| 72 | 71 | #include "machine/ngen_kb.h" |
| 73 | 72 | #include "machine/clock.h" |
| 74 | #include "imagedev/harddriv.h" | |
| 75 | 73 | |
| 76 | 74 | class ngen_state : public driver_device |
| 77 | 75 | { |
| r243192 | r243193 | |
| 91 | 89 | m_fdc(*this,"fdc"), |
| 92 | 90 | m_fd0(*this,"fdc:0"), |
| 93 | 91 | m_fdc_timer(*this,"fdc_timer"), |
| 94 | m_hdc(*this,"hdc"), | |
| 95 | m_hdc_timer(*this,"hdc_timer"), | |
| 96 | m_hd_buffer(*this,"hd_buffer_ram") | |
| 92 | m_hdc_timer(*this,"hdc_timer") | |
| 97 | 93 | {} |
| 98 | 94 | |
| 99 | 95 | DECLARE_WRITE_LINE_MEMBER(pit_out0_w); |
| r243192 | r243193 | |
| 133 | 129 | DECLARE_READ8_MEMBER(irq_cb); |
| 134 | 130 | DECLARE_WRITE8_MEMBER(hdc_control_w); |
| 135 | 131 | DECLARE_WRITE8_MEMBER(disk_addr_ext); |
| 136 | DECLARE_READ8_MEMBER(hd_buffer_r); | |
| 137 | DECLARE_WRITE8_MEMBER(hd_buffer_w); | |
| 138 | 132 | |
| 139 | 133 | protected: |
| 140 | 134 | virtual void machine_reset(); |
| 141 | virtual void machine_start(); | |
| 142 | 135 | |
| 143 | 136 | private: |
| 144 | 137 | required_device<i80186_cpu_device> m_maincpu; |
| r243192 | r243193 | |
| 154 | 147 | optional_device<wd2797_t> m_fdc; |
| 155 | 148 | optional_device<floppy_connector> m_fd0; |
| 156 | 149 | optional_device<pit8253_device> m_fdc_timer; |
| 157 | optional_device<wd2010_device> m_hdc; | |
| 158 | 150 | optional_device<pit8253_device> m_hdc_timer; |
| 159 | optional_shared_ptr<UINT8> m_hd_buffer; | |
| 160 | 151 | |
| 161 | 152 | void set_dma_channel(int channel, int state); |
| 162 | 153 | |
| r243192 | r243193 | |
| 406 | 397 | |
| 407 | 398 | // X-bus module select |
| 408 | 399 | // The bootstrap ROM creates a table at 0:FC9h, with a count, followed by the module IDs of each |
| 409 | // expansion module. The base I/O address for the currently selected module is set by writing to | |
| 400 | // expansion module. The base I/O address for the currently selected module is set by writing to | |
| 410 | 401 | // this register (bits 0-7 are ignored) |
| 411 | 402 | // TODO: make expansion modules slot devices |
| 412 | 403 | WRITE16_MEMBER(ngen_state::xbus_w) |
| r243192 | r243193 | |
| 435 | 426 | READ16_MEMBER(ngen_state::xbus_r) |
| 436 | 427 | { |
| 437 | 428 | UINT16 ret = 0xffff; |
| 438 | ||
| 429 | ||
| 439 | 430 | switch(m_xbus_current) |
| 440 | 431 | { |
| 441 | 432 | case 0x00: |
| r243192 | r243193 | |
| 479 | 470 | case 0x0a: |
| 480 | 471 | case 0x0b: |
| 481 | 472 | if(mem_mask & 0x00ff) |
| 482 | m_fdc_timer->write(space,offset | |
| 473 | m_fdc_timer->write(space,offset,data & 0xff); | |
| 483 | 474 | break; |
| 484 | 475 | case 0x10: |
| 485 | 476 | case 0x11: |
| r243192 | r243193 | |
| 489 | 480 | case 0x15: |
| 490 | 481 | case 0x16: |
| 491 | 482 | case 0x17: |
| 492 | if(mem_mask & 0x00ff) | |
| 493 | m_hdc->write(space,offset-0x10,data & 0xff); | |
| 494 | 483 | logerror("WD1010 register %i write %02x mask %04x\n",offset-0x10,data & 0xff,mem_mask); |
| 495 | 484 | break; |
| 496 | 485 | case 0x18: |
| r243192 | r243193 | |
| 498 | 487 | case 0x1a: |
| 499 | 488 | case 0x1b: |
| 500 | 489 | if(mem_mask & 0x00ff) |
| 501 | m_hdc_timer->write(space,offset | |
| 490 | m_hdc_timer->write(space,offset,data & 0xff); | |
| 502 | 491 | break; |
| 503 | 492 | } |
| 504 | 493 | } |
| r243192 | r243193 | |
| 521 | 510 | case 0x0a: |
| 522 | 511 | case 0x0b: |
| 523 | 512 | if(mem_mask & 0x00ff) |
| 524 | ret = m_fdc_timer->read(space,offset | |
| 513 | ret = m_fdc_timer->read(space,offset); | |
| 525 | 514 | break; |
| 526 | 515 | case 0x10: |
| 527 | 516 | case 0x11: |
| r243192 | r243193 | |
| 531 | 520 | case 0x15: |
| 532 | 521 | case 0x16: |
| 533 | 522 | case 0x17: |
| 534 | if(mem_mask & 0x00ff) | |
| 535 | ret = m_hdc->read(space,offset-0x10); | |
| 536 | 523 | logerror("WD1010 register %i read, mask %04x\n",offset-0x10,mem_mask); |
| 537 | 524 | break; |
| 538 | 525 | case 0x18: |
| r243192 | r243193 | |
| 540 | 527 | case 0x1a: |
| 541 | 528 | case 0x1b: |
| 542 | 529 | if(mem_mask & 0x00ff) |
| 543 | ret = m_hdc_timer->read(space,offset | |
| 530 | ret = m_hdc_timer->read(space,offset); | |
| 544 | 531 | break; |
| 545 | 532 | } |
| 546 | 533 | |
| r243192 | r243193 | |
| 598 | 585 | m_disk_page = data & 0x7f; |
| 599 | 586 | } |
| 600 | 587 | |
| 601 | READ8_MEMBER(ngen_state::hd_buffer_r) | |
| 602 | { | |
| 603 | return m_hd_buffer[offset]; | |
| 604 | } | |
| 605 | ||
| 606 | WRITE8_MEMBER(ngen_state::hd_buffer_w) | |
| 607 | { | |
| 608 | m_hd_buffer[offset] = data; | |
| 609 | } | |
| 610 | ||
| 611 | 588 | WRITE_LINE_MEMBER( ngen_state::dma_hrq_changed ) |
| 612 | 589 | { |
| 613 | 590 | m_maincpu->set_input_line(INPUT_LINE_HALT, state ? ASSERT_LINE : CLEAR_LINE); |
| r243192 | r243193 | |
| 626 | 603 | { |
| 627 | 604 | if(state) |
| 628 | 605 | { |
| 629 | if(m_hdc_control & 0x04) // ROM transfer | |
| 606 | if(m_hdc_control & 0x04) // ROM transfer? | |
| 630 | 607 | m_hdc_control &= ~0x04; // switch it off when done |
| 631 | 608 | } |
| 632 | 609 | } |
| r243192 | r243193 | |
| 647 | 624 | |
| 648 | 625 | READ8_MEMBER(ngen_state::dma_3_dack_r) |
| 649 | 626 | { |
| 650 | UINT16 ret = 0xffff; | |
| 651 | ||
| 627 | UINT16 ret = 0xffff; | |
| 628 | ||
| 652 | 629 | if((m_hdc_control & 0x04) && m_disk_rom) |
| 653 | 630 | { |
| 654 | 631 | ret = m_disk_rom->base()[m_disk_rom_ptr++] << 8; |
| r243192 | r243193 | |
| 659 | 636 | //m_dmac->dreq3_w(0); |
| 660 | 637 | } |
| 661 | 638 | } |
| 662 | m_dma_high_byte = ret & 0xff00; | |
| 639 | m_dma_high_byte = ret & 0xff00; | |
| 663 | 640 | return ret; |
| 664 | 641 | } |
| 665 | 642 | |
| r243192 | r243193 | |
| 712 | 689 | return m_pic->acknowledge(); |
| 713 | 690 | } |
| 714 | 691 | |
| 715 | void ngen_state::machine_start() | |
| 716 | { | |
| 717 | m_hd_buffer.allocate(1024*8); // 8kB buffer RAM for HD controller | |
| 718 | } | |
| 719 | ||
| 720 | 692 | void ngen_state::machine_reset() |
| 721 | 693 | { |
| 722 | 694 | m_port00 = 0; |
| r243192 | r243193 | |
| 737 | 709 | |
| 738 | 710 | static ADDRESS_MAP_START( ngen_io, AS_IO, 16, ngen_state ) |
| 739 | 711 | AM_RANGE(0x0000, 0x0001) AM_READWRITE(xbus_r,xbus_w) |
| 740 | ||
| 712 | ||
| 741 | 713 | // Floppy/Hard disk module |
| 742 | // AM_RANGE(0x0100, 0x0107) AM_DEVREADWRITE8("fdc",wd2797_t,read,write,0x00ff) // a guess for now | |
| 743 | // AM_RANGE(0x0108, 0x0109) AM_WRITE8(fdc_control_w,0x00ff) | |
| 744 | // AM_RANGE(0x010a, 0x010b) AM_WRITE8(hdc_control_w,0x00ff) | |
| 745 | // AM_RANGE(0x010e, 0x010f) AM_WRITE8(disk_addr_ext,0x00ff) // X-Bus extended address register | |
| 746 | // AM_RANGE(0x0110, 0x0117) AM_DEVREADWRITE8("fdc_timer",pit8253_device,read,write,0x00ff) | |
| 714 | // AM_RANGE(0x0100, 0x0107) AM_DEVREADWRITE8("fdc",wd2797_t,read,write,0x00ff) // a guess for now | |
| 715 | // AM_RANGE(0x0108, 0x0109) AM_WRITE8(fdc_control_w,0x00ff) | |
| 716 | // AM_RANGE(0x010a, 0x010b) AM_WRITE8(hdc_control_w,0x00ff) | |
| 717 | // AM_RANGE(0x010e, 0x010f) AM_WRITE8(disk_addr_ext,0x00ff) // X-Bus extended address register | |
| 718 | // AM_RANGE(0x0110, 0x0117) AM_DEVREADWRITE8("fdc_timer",pit8253_device,read,write,0x00ff) | |
| 747 | 719 | // 0x0120-0x012f - WD1010 Winchester disk controller (unemulated) |
| 748 | // AM_RANGE(0x0130, 0x0137) AM_DEVREADWRITE8("hdc_timer",pit8253_device,read,write,0x00ff) | |
| 749 | ||
| 720 | // AM_RANGE(0x0130, 0x0137) AM_DEVREADWRITE8("hdc_timer",pit8253_device,read,write,0x00ff) | |
| 721 | ||
| 750 | 722 | ADDRESS_MAP_END |
| 751 | 723 | |
| 752 | 724 | static ADDRESS_MAP_START( ngen386_mem, AS_PROGRAM, 32, ngen_state ) |
| r243192 | r243193 | |
| 851 | 823 | |
| 852 | 824 | // keyboard UART (patent says i8251 is used for keyboard communications, it is located on the video board) |
| 853 | 825 | MCFG_DEVICE_ADD("videouart", I8251, 0) // main clock unknown, Rx/Tx clocks are 19.53kHz |
| 854 | // | |
| 826 | // MCFG_I8251_TXEMPTY_HANDLER(DEVWRITELINE("pic",pic8259_device,ir4_w)) | |
| 855 | 827 | MCFG_I8251_TXD_HANDLER(DEVWRITELINE("keyboard", rs232_port_device, write_txd)) |
| 856 | 828 | MCFG_RS232_PORT_ADD("keyboard", keyboard, "ngen") |
| 857 | 829 | MCFG_RS232_RXD_HANDLER(DEVWRITELINE("videouart", i8251_device, write_rxd)) |
| r243192 | r243193 | |
| 866 | 838 | MCFG_WD_FDC_FORCE_READY |
| 867 | 839 | MCFG_DEVICE_ADD("fdc_timer", PIT8253, 0) |
| 868 | 840 | MCFG_PIT8253_CLK0(XTAL_20MHz / 20) |
| 869 | MCFG_PIT8253_OUT0_HANDLER(DEVWRITELINE("pic",pic8259_device,ir7_w)) | |
| 841 | MCFG_PIT8253_OUT0_HANDLER(DEVWRITELINE("pic",pic8259_device,ir7_w)) | |
| 870 | 842 | MCFG_PIT8253_CLK1(XTAL_20MHz / 20) |
| 871 | MCFG_PIT8253_OUT1_HANDLER(DEVWRITELINE("pic",pic8259_device,ir7_w)) // 1MHz | |
| 872 | MCFG_PIT8253_CLK2(XTAL_20MHz / 10) | |
| 843 | MCFG_PIT8253_OUT1_HANDLER(DEVWRITELINE("pic",pic8259_device,ir7_w)) | |
| 844 | MCFG_PIT8253_CLK2(XTAL_20MHz / 20) | |
| 873 | 845 | MCFG_PIT8253_OUT2_HANDLER(DEVWRITELINE("pic",pic8259_device,ir7_w)) |
| 874 | // TODO: WD1010 HDC (not implemented), use WD2010 for now | |
| 875 | MCFG_DEVICE_ADD("hdc", WD2010, XTAL_20MHz / 4) | |
| 876 | MCFG_WD2010_IN_BCS_CB(READ8(ngen_state,hd_buffer_r)) | |
| 877 | MCFG_WD2010_OUT_BCS_CB(WRITE8(ngen_state,hd_buffer_w)) | |
| 878 | MCFG_WD2010_IN_DRDY_CB(VCC) | |
| 879 | MCFG_WD2010_IN_INDEX_CB(VCC) | |
| 880 | MCFG_WD2010_IN_WF_CB(VCC) | |
| 881 | MCFG_WD2010_IN_TK000_CB(VCC) | |
| 882 | MCFG_WD2010_IN_SC_CB(VCC) | |
| 846 | // TODO: WD1010 HDC (not implemented) | |
| 883 | 847 | MCFG_DEVICE_ADD("hdc_timer", PIT8253, 0) |
| 884 | MCFG_PIT8253_CLK2(XTAL_20MHz / 10) // 2MHz | |
| 885 | 848 | MCFG_FLOPPY_DRIVE_ADD("fdc:0", ngen_floppies, "525qd", floppy_image_device::default_floppy_formats) |
| 886 | MCFG_HARDDISK_ADD("hard0") | |
| 887 | 849 | |
| 888 | 850 | MACHINE_CONFIG_END |
| 889 | 851 |
| r243192 | r243193 | |
|---|---|---|
| 679 | 679 | void pasogo_state::machine_reset() |
| 680 | 680 | { |
| 681 | 681 | astring region_tag; |
| 682 | m_maincpu_rom = memregion("maincpu"); | |
| 683 | 682 | m_cart_rom = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG)); |
| 684 | if (!m_cart_rom) // this should never happen, since we make carts mandatory! | |
| 685 | m_cart_rom = memregion("maincpu"); | |
| 683 | m_maincpu_rom = memregion("maincpu"); | |
| 686 | 684 | |
| 687 | 685 | membank("bank27")->set_base(m_cart_rom->base()); |
| 688 | 686 | membank("bank28")->set_base(m_maincpu_rom->base() + 0xb8000/*?*/); |
| r243192 | r243193 | |
|---|---|---|
| 3626 | 3626 | |
| 3627 | 3627 | ROM_START( pc9821ap2 ) |
| 3628 | 3628 | ROM_REGION( 0x80000, "biosrom", ROMREGION_ERASEFF ) |
| 3629 | ROM_DEFAULT_BIOS("phd0104") | |
| 3630 | ROM_SYSTEM_BIOS(0, "phd0104", "PHD0104") | |
| 3631 | ROMX_LOAD( "phd0104.rom", 0x000000, 0x80000, CRC(da73b372) SHA1(2c15b63a0869b81ef7f04972dbb0975f4e77d384), ROM_BIOS(1) ) | |
| 3632 | ROM_SYSTEM_BIOS(1, "phd0102", "PHD0102") | |
| 3633 | ROMX_LOAD( "phd0102.rom", 0x000000, 0x80000, CRC(3036774c) SHA1(59856a348f156adf5eca06326f967aca54ff871c), ROM_BIOS(2) ) | |
| 3629 | ROM_LOAD( "phd0102.rom", 0x000000, 0x80000, CRC(3036774c) SHA1(59856a348f156adf5eca06326f967aca54ff871c) ) | |
| 3634 | 3630 | |
| 3635 | 3631 | ROM_REGION( 0x60000, "ipl", ROMREGION_ERASEFF ) // TODO: identify ROM banks |
| 3636 | 3632 | ROM_COPY( "biosrom", 0x20000, 0x18000, 0x08000 ) |
| r243192 | r243193 | |
|---|---|---|
| 1 | // Slicer Computers Slicer 80186 SBC | |
| 2 | // The bios makefile refers to a "exe3bin" utility, this can be substituted with FreeDOS exe2bin and the /l=0xf800 option | |
| 3 | // which will fixup the relocations | |
| 4 | ||
| 5 | #include "emu.h" | |
| 6 | #include "cpu/i86/i186.h" | |
| 7 | #include "machine/wd_fdc.h" | |
| 8 | #include "machine/mc68681.h" | |
| 9 | #include "bus/rs232/rs232.h" | |
| 10 | #include "bus/isa/isa.h" | |
| 11 | #include "bus/scsi/scsi.h" | |
| 12 | ||
| 13 | class slicer_state : public driver_device | |
| 14 | { | |
| 15 | public: | |
| 16 | slicer_state(const machine_config &mconfig, device_type type, const char *tag) : | |
| 17 | driver_device(mconfig, type, tag), | |
| 18 | m_fdc(*this, "fdc"), | |
| 19 | m_sasi(*this, "sasi") | |
| 20 | {} | |
| 21 | ||
| 22 | required_device<fd1797_t> m_fdc; | |
| 23 | required_device<SCSI_PORT_DEVICE> m_sasi; | |
| 24 | ||
| 25 | DECLARE_WRITE8_MEMBER(sio_out_w); | |
| 26 | DECLARE_WRITE8_MEMBER(drive_sel_w); | |
| 27 | }; | |
| 28 | ||
| 29 | WRITE8_MEMBER(slicer_state::sio_out_w) | |
| 30 | { | |
| 31 | floppy_image_device *floppy; | |
| 32 | int state = (data & 0x80) ? 0 : 1; | |
| 33 | char devname[8]; | |
| 34 | ||
| 35 | for(int i = 0; i < 4; i++) | |
| 36 | { | |
| 37 | sprintf(devname, "%d", i); | |
| 38 | floppy = m_fdc->subdevice<floppy_connector>(devname)->get_device(); | |
| 39 | if(floppy) | |
| 40 | floppy->mon_w(state); | |
| 41 | } | |
| 42 | } | |
| 43 | ||
| 44 | WRITE8_MEMBER(slicer_state::drive_sel_w) | |
| 45 | { | |
| 46 | data &= 1; | |
| 47 | switch(offset) | |
| 48 | { | |
| 49 | case 0: | |
| 50 | m_sasi->write_sel(data); | |
| 51 | break; | |
| 52 | case 1: | |
| 53 | m_sasi->write_rst(data); | |
| 54 | break; | |
| 55 | case 7: | |
| 56 | m_fdc->dden_w(data); | |
| 57 | break; | |
| 58 | ||
| 59 | default: | |
| 60 | { | |
| 61 | floppy_image_device *floppy; | |
| 62 | char devname[8]; | |
| 63 | unsigned int drive = 3 - (offset - 2); | |
| 64 | if((drive > 3) || !data) | |
| 65 | break; | |
| 66 | ||
| 67 | sprintf(devname, "%d", drive); | |
| 68 | floppy = m_fdc->subdevice<floppy_connector>(devname)->get_device(); | |
| 69 | m_fdc->set_floppy(floppy); | |
| 70 | break; | |
| 71 | } | |
| 72 | } | |
| 73 | } | |
| 74 | ||
| 75 | static ADDRESS_MAP_START( slicer_map, AS_PROGRAM, 16, slicer_state ) | |
| 76 | AM_RANGE(0x00000, 0x3ffff) AM_RAM // fixed 256k for now | |
| 77 | AM_RANGE(0xf8000, 0xfffff) AM_ROM AM_REGION("bios", 0) | |
| 78 | ADDRESS_MAP_END | |
| 79 | ||
| 80 | static ADDRESS_MAP_START( slicer_io, AS_IO, 16, slicer_state ) | |
| 81 | ADDRESS_MAP_UNMAP_HIGH | |
| 82 | AM_RANGE(0x0000, 0x007f) AM_DEVREADWRITE8("fdc", fd1797_t, read, write, 0x00ff) //PCS0 | |
| 83 | AM_RANGE(0x0080, 0x00ff) AM_DEVREADWRITE8("sc2681", mc68681_device, read, write, 0x00ff) //PCS1 | |
| 84 | AM_RANGE(0x0100, 0x017f) AM_WRITE8(drive_sel_w, 0x00ff) //PCS2 | |
| 85 | // TODO: 0x180 sets ack | |
| 86 | AM_RANGE(0x0180, 0x0181) AM_DEVREAD8("sasi_data_in", input_buffer_device, read, 0x00ff) AM_DEVWRITE8("sasi_data_out", output_latch_device, write, 0x00ff) //PCS3 | |
| 87 | AM_RANGE(0x0180, 0x0181) AM_DEVREAD8("sasi_ctrl_in", input_buffer_device, read, 0xff00) | |
| 88 | AM_RANGE(0x0184, 0x0185) AM_DEVREAD8("sasi_data_in", input_buffer_device, read, 0x00ff) AM_DEVWRITE8("sasi_data_out", output_latch_device, write, 0x00ff) | |
| 89 | AM_RANGE(0x0184, 0x0185) AM_DEVREAD8("sasi_ctrl_in", input_buffer_device, read, 0xff00) | |
| 90 | ADDRESS_MAP_END | |
| 91 | ||
| 92 | static SLOT_INTERFACE_START( slicer_floppies ) | |
| 93 | SLOT_INTERFACE("525dd", FLOPPY_525_DD) | |
| 94 | SLOT_INTERFACE("8dsdd", FLOPPY_8_DSDD) | |
| 95 | SLOT_INTERFACE_END | |
| 96 | ||
| 97 | static MACHINE_CONFIG_START( slicer, slicer_state ) | |
| 98 | MCFG_CPU_ADD("maincpu", I80186, XTAL_16MHz / 2) | |
| 99 | MCFG_CPU_PROGRAM_MAP(slicer_map) | |
| 100 | MCFG_CPU_IO_MAP(slicer_io) | |
| 101 | ||
| 102 | MCFG_MC68681_ADD("sc2681", XTAL_3_6864MHz) | |
| 103 | MCFG_MC68681_IRQ_CALLBACK(DEVWRITELINE("maincpu", i80186_cpu_device, int0_w)) | |
| 104 | MCFG_MC68681_A_TX_CALLBACK(DEVWRITELINE("rs232_1", rs232_port_device, write_txd)) | |
| 105 | MCFG_MC68681_B_TX_CALLBACK(DEVWRITELINE("rs232_2", rs232_port_device, write_txd)) | |
| 106 | MCFG_MC68681_OUTPORT_CALLBACK(WRITE8(slicer_state, sio_out_w)) | |
| 107 | ||
| 108 | MCFG_RS232_PORT_ADD("rs232_1", default_rs232_devices, "terminal") | |
| 109 | MCFG_RS232_RXD_HANDLER(DEVWRITELINE("sc2681", mc68681_device, rx_a_w)) | |
| 110 | MCFG_RS232_PORT_ADD("rs232_2", default_rs232_devices, NULL) | |
| 111 | MCFG_RS232_RXD_HANDLER(DEVWRITELINE("sc2681", mc68681_device, rx_b_w)) | |
| 112 | ||
| 113 | MCFG_FD1797x_ADD("fdc", XTAL_16MHz/2/8) | |
| 114 | MCFG_WD_FDC_INTRQ_CALLBACK(DEVWRITELINE("maincpu", i80186_cpu_device, int1_w)) | |
| 115 | MCFG_WD_FDC_DRQ_CALLBACK(DEVWRITELINE("maincpu", i80186_cpu_device, drq0_w)) | |
| 116 | MCFG_FLOPPY_DRIVE_ADD("fdc:0", slicer_floppies, "525dd", floppy_image_device::default_floppy_formats) | |
| 117 | MCFG_FLOPPY_DRIVE_ADD("fdc:1", slicer_floppies, NULL, floppy_image_device::default_floppy_formats) | |
| 118 | MCFG_FLOPPY_DRIVE_ADD("fdc:2", slicer_floppies, NULL, floppy_image_device::default_floppy_formats) | |
| 119 | MCFG_FLOPPY_DRIVE_ADD("fdc:3", slicer_floppies, NULL, floppy_image_device::default_floppy_formats) | |
| 120 | ||
| 121 | MCFG_DEVICE_ADD("sasi", SCSI_PORT, 0) | |
| 122 | MCFG_SCSI_DATA_INPUT_BUFFER("sasi_data_in") | |
| 123 | MCFG_SCSI_BSY_HANDLER(DEVWRITELINE("sasi_ctrl_in", input_buffer_device, write_bit3)) | |
| 124 | MCFG_SCSI_MSG_HANDLER(DEVWRITELINE("sasi_ctrl_in", input_buffer_device, write_bit4)) | |
| 125 | MCFG_SCSI_CD_HANDLER(DEVWRITELINE("sasi_ctrl_in", input_buffer_device, write_bit5)) | |
| 126 | MCFG_SCSI_REQ_HANDLER(DEVWRITELINE("sasi_ctrl_in", input_buffer_device, write_bit6)) | |
| 127 | MCFG_SCSI_IO_HANDLER(DEVWRITELINE("sasi_ctrl_in", input_buffer_device, write_bit7)) | |
| 128 | ||
| 129 | MCFG_SCSI_OUTPUT_LATCH_ADD("sasi_data_out", "sasi") | |
| 130 | MCFG_DEVICE_ADD("sasi_data_in", INPUT_BUFFER, 0) | |
| 131 | MCFG_DEVICE_ADD("sasi_ctrl_in", INPUT_BUFFER, 0) | |
| 132 | MACHINE_CONFIG_END | |
| 133 | ||
| 134 | ROM_START( slicer ) | |
| 135 | ROM_REGION(0x8001, "bios", 0) | |
| 136 | // built from sources, reset.asm adds an extra byte | |
| 137 | ROM_LOAD("epbios.bin", 0x0000, 0x8001, CRC(96fe9dd4) SHA1(5fc43454fe7d51f2ae97aef822155dcd28eb7f23)) | |
| 138 | ROM_END | |
| 139 | ||
| 140 | COMP( 1983, slicer, 0, 0, slicer, 0, driver_device, 0, "Slicer Computers", "Slicer", GAME_NOT_WORKING | GAME_NO_SOUND) |
| r243192 | r243193 | |
|---|---|---|
| 14 | 14 | |
| 15 | 15 | - SIO interface for Game Gear (needs netplay, I guess) |
| 16 | 16 | - Sega Demo Unit II (kiosk expansion device) |
| 17 | - SMS 8 slot game changer (kiosk expansion device) | |
| 18 | 17 | - SMS Disk System (floppy disk drive expansion device) - unreleased |
| 19 | 18 | - Rapid button of Japanese Master System |
| 20 | 19 | - Keyboard support for Sega Mark III (sg1000m3 driver) |
| r243192 | r243193 | |
| 58 | 57 | - Few games of the ones with FM support need to detect the system region as |
| 59 | 58 | Japanese to play FM sound; |
| 60 | 59 | - The Light Phaser gun doesn't work with the Japanese SMS; |
| 61 | - There are reports about Light Phaser working on the second Korean | |
| 60 | - There are reports about Light Phaser working on the second Korean console | |
| 62 | 61 | version, and a Korean advert shows support on the first version (Gam*Boy I, |
| 63 | 62 | although based on Japanese SMS); |
| 64 | 63 | - The Korean SMS versions have Japanese-format cartridge slot, but only on the |
| 65 | 64 | first (Gam*Boy I) the region is detected as Japanese; |
| 66 | 65 | - Some SMS ROMs don't run when are plugged-in to SMS expansion slot, through |
| 67 | 66 | the gender adapter; |
| 68 | - Some SMS ROMs don't run or have issues when are plugged-in to a Game Gear, | |
| 69 | through the Master Gear adapter; | |
| 67 | - Some SMS ROMs don't run when are plugged-in to a Game Gear, through the | |
| 68 | Master Gear adapter; | |
| 70 | 69 | |
| 71 | 70 | -------------------------------------------------------------------------------- |
| 72 | 71 | |
| r243192 | r243193 | |
| 406 | 405 | INPUT_PORTS_END |
| 407 | 406 | |
| 408 | 407 | static INPUT_PORTS_START( smssdisp ) |
| 409 | // For each peripheral port (for controllers or 3-D glasses), there are sets | |
| 410 | // of two connectors wired in parallel on the real hardware. This allows to | |
| 411 | // have different controllers, like a pad and a Light Phaser, plugged together | |
| 412 | // for a player input, what avoids having to re-plug them every time a game is | |
| 413 | // changed to another that requires a different controller. Also, this allows | |
| 414 | // 3-D games to be properly watched by two persons at same time. | |
| 415 | // For now the driver just uses single input ports. | |
| 416 | 408 | PORT_INCLUDE( sms1 ) |
| 417 | 409 | |
| 418 | 410 | PORT_START("DSW") |
| r243192 | r243193 | |
| 813 | 805 | |
| 814 | 806 | MCFG_SOFTWARE_LIST_ADD("cart_list", "gamegear") |
| 815 | 807 | |
| 816 | MCFG_GG_EXT_PORT_ADD("ext", gg_ext_port_devices, NULL) | |
| 817 | MCFG_GG_EXT_PORT_TH_INPUT_HANDLER(WRITELINE(sms_state, sms_ctrl2_th_input)) // not verified | |
| 818 | //MCFG_GG_EXT_PORT_PIXEL_HANDLER(READ32(sms_state, sms_pixel_color)) // only for GG-TV mod | |
| 808 | MCFG_GG_GEAR2GEAR_PORT_ADD("gear2gear", gg_gear2gear_port_devices, NULL) | |
| 809 | MCFG_GG_GEAR2GEAR_PORT_TH_INPUT_HANDLER(WRITELINE(sms_state, sms_ctrl2_th_input)) // not verified | |
| 810 | //MCFG_GG_GEAR2GEAR_PORT_PIXEL_HANDLER(READ32(sms_state, sms_pixel_color)) // only for GG-TV mod | |
| 819 | 811 | MACHINE_CONFIG_END |
| 820 | 812 | |
| 821 | 813 |
| r243192 | r243193 | |
|---|---|---|
| 5 | 5 | Parker Brothers Split Second |
| 6 | 6 | * TMS1400NLL MP7314-N2 (die labeled MP7314) |
| 7 | 7 | |
| 8 | This is an electronic handheld reflex gaming device, it's straightforward | |
| 9 | to use. The included mini-games are: | |
| 10 | 1, 2, 3: Mad Maze* | |
| 11 | 4, 5: Space Attack* | |
| 12 | 6: Auto Cross | |
| 13 | 7: Stomp | |
| 14 | 8: Speedball | |
| 15 | 8 | |
| 16 | *: higher number indicates higher difficulty | |
| 17 | ||
| 18 | ||
| 19 | TODO: | |
| 20 | - MCU clock is unknown | |
| 21 | ||
| 22 | 9 | ***************************************************************************/ |
| 23 | 10 | |
| 24 | 11 | #include "emu.h" |
| r243192 | r243193 | |
| 27 | 14 | |
| 28 | 15 | #include "splitsec.lh" |
| 29 | 16 | |
| 30 | // The master clock is a single stage RC oscillator: R=24K, C=100pf, | |
| 31 | // according to the TMS 1000 series data manual this is around 375kHz. | |
| 32 | // However, this sounds too low-pitched and runs too slow when compared | |
| 33 | // to recordings, maybe the RC osc curve is different for TMS1400? | |
| 17 | // master clock is a single stage RC oscillator: R=24K, C=100pf, | |
| 18 | // according to the TMS 1000 series data manual this is around 375kHz | |
| 19 | #define MASTER_CLOCK (375000) | |
| 34 | 20 | |
| 35 | // so for now, the value below is an approximation | |
| 36 | #define MASTER_CLOCK (485000) | |
| 37 | 21 | |
| 38 | ||
| 39 | 22 | class splitsec_state : public driver_device |
| 40 | 23 | { |
| 41 | 24 | public: |
| 42 | 25 | splitsec_state(const machine_config &mconfig, device_type type, const char *tag) |
| 43 | 26 | : driver_device(mconfig, type, tag), |
| 44 | 27 | m_maincpu(*this, "maincpu"), |
| 45 | m_button_matrix(*this, "IN"), | |
| 28 | // m_button_matrix(*this, "IN"), | |
| 46 | 29 | m_speaker(*this, "speaker") |
| 47 | 30 | { } |
| 48 | 31 | |
| 49 | 32 | required_device<cpu_device> m_maincpu; |
| 50 | required_ioport_array< | |
| 33 | // required_ioport_array<4> m_button_matrix; | |
| 51 | 34 | required_device<speaker_sound_device> m_speaker; |
| 52 | 35 | |
| 53 | 36 | UINT16 m_r; |
| 54 | 37 | UINT16 m_o; |
| 55 | 38 | |
| 56 | UINT16 m_leds_state[0x10]; | |
| 57 | UINT16 m_leds_cache[0x10]; | |
| 58 | UINT8 m_leds_decay[0x100]; | |
| 59 | ||
| 60 | 39 | DECLARE_READ8_MEMBER(read_k); |
| 61 | 40 | DECLARE_WRITE16_MEMBER(write_o); |
| 62 | 41 | DECLARE_WRITE16_MEMBER(write_r); |
| 63 | 42 | |
| 64 | TIMER_DEVICE_CALLBACK_MEMBER(leds_decay_tick); | |
| 65 | void leds_update(); | |
| 66 | ||
| 67 | 43 | virtual void machine_start(); |
| 68 | 44 | }; |
| 69 | 45 | |
| r243192 | r243193 | |
| 71 | 47 | |
| 72 | 48 | /*************************************************************************** |
| 73 | 49 | |
| 74 | LEDs | |
| 75 | ||
| 76 | ***************************************************************************/ | |
| 77 | ||
| 78 | // The device strobes the outputs very fast, it is unnoticeable to the user. | |
| 79 | // To prevent flickering here, we need to simulate a decay. | |
| 80 | ||
| 81 | // decay time, in steps of 10ms | |
| 82 | #define LEDS_DECAY_TIME 4 | |
| 83 | ||
| 84 | /* display layout, where number xy is lamp R(x),O(y) | |
| 85 | ||
| 86 | 00 02 04 | |
| 87 | 10 01 12 03 14 05 16 | |
| 88 | 11 13 15 | |
| 89 | 20 21 22 23 24 25 26 | |
| 90 | 31 33 35 | |
| 91 | 30 41 32 43 34 45 36 | |
| 92 | 51 53 55 | |
| 93 | 40 61 42 63 44 65 46 | |
| 94 | 71 73 75 | |
| 95 | 50 60 52 62 54 64 56 | |
| 96 | 70 72 74 | |
| 97 | */ | |
| 98 | ||
| 99 | void splitsec_state::leds_update() | |
| 100 | { | |
| 101 | UINT16 active_state[0x10]; | |
| 102 | ||
| 103 | for (int i = 0; i < 0x10; i++) | |
| 104 | { | |
| 105 | // update current state | |
| 106 | if (m_r >> i & 1) | |
| 107 | m_leds_state[i] = m_o; | |
| 108 | ||
| 109 | active_state[i] = 0; | |
| 110 | ||
| 111 | for (int j = 0; j < 0x10; j++) | |
| 112 | { | |
| 113 | int di = j << 4 | i; | |
| 114 | ||
| 115 | // turn on powered leds | |
| 116 | if (m_leds_state[i] >> j & 1) | |
| 117 | m_leds_decay[di] = LEDS_DECAY_TIME; | |
| 118 | ||
| 119 | // determine active state | |
| 120 | int ds = (m_leds_decay[di] != 0) ? 1 : 0; | |
| 121 | active_state[i] |= (ds << j); | |
| 122 | } | |
| 123 | } | |
| 124 | ||
| 125 | // on difference, send to output | |
| 126 | for (int i = 0; i < 0x10; i++) | |
| 127 | if (m_leds_cache[i] != active_state[i]) | |
| 128 | { | |
| 129 | for (int j = 0; j < 8; j++) | |
| 130 | output_set_lamp_value(i*10 + j, active_state[i] >> j & 1); | |
| 131 | } | |
| 132 | ||
| 133 | memcpy(m_leds_cache, active_state, sizeof(m_leds_cache)); | |
| 134 | } | |
| 135 | ||
| 136 | TIMER_DEVICE_CALLBACK_MEMBER(splitsec_state::leds_decay_tick) | |
| 137 | { | |
| 138 | // slowly turn off unpowered leds | |
| 139 | for (int i = 0; i < 0x100; i++) | |
| 140 | if (!(m_leds_state[i & 0xf] >> (i>>4) & 1) && m_leds_decay[i]) | |
| 141 | m_leds_decay[i]--; | |
| 142 | ||
| 143 | leds_update(); | |
| 144 | } | |
| 145 | ||
| 146 | ||
| 147 | ||
| 148 | /*************************************************************************** | |
| 149 | ||
| 150 | 50 | I/O |
| 151 | 51 | |
| 152 | 52 | ***************************************************************************/ |
| 153 | 53 | |
| 154 | 54 | READ8_MEMBER(splitsec_state::read_k) |
| 155 | 55 | { |
| 156 | UINT8 k = 0; | |
| 157 | ||
| 158 | // read selected button rows | |
| 159 | for (int i = 0; i < 2; i++) | |
| 160 | if (m_r >> (i+9) & 1) | |
| 161 | k |= m_button_matrix[i]->read(); | |
| 162 | ||
| 163 | return k; | |
| 56 | return 0; | |
| 164 | 57 | } |
| 165 | 58 | |
| 166 | 59 | WRITE16_MEMBER(splitsec_state::write_r) |
| 167 | 60 | { |
| 168 | // R8: speaker out | |
| 169 | m_speaker->level_w(data >> 8 & 1); | |
| 170 | ||
| 171 | // R9,R10: input mux | |
| 172 | // R0-R7: led columns | |
| 173 | 61 | m_r = data; |
| 174 | leds_update(); | |
| 175 | 62 | } |
| 176 | 63 | |
| 177 | 64 | WRITE16_MEMBER(splitsec_state::write_o) |
| 178 | 65 | { |
| 179 | // O0-O6: led rows | |
| 180 | // O7: N/C | |
| 181 | 66 | m_o = data; |
| 182 | leds_update(); | |
| 183 | 67 | } |
| 184 | 68 | |
| 185 | 69 | |
| r243192 | r243193 | |
| 191 | 75 | ***************************************************************************/ |
| 192 | 76 | |
| 193 | 77 | static INPUT_PORTS_START( splitsec ) |
| 194 | PORT_START("IN.0") // R9 | |
| 195 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_16WAY // 4 separate directional buttons, hence 16way | |
| 196 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_16WAY | |
| 197 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_16WAY | |
| 198 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 199 | ||
| 200 | PORT_START("IN.1") // R10 | |
| 201 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_16WAY | |
| 202 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Select") | |
| 203 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Start") | |
| 204 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 205 | 78 | INPUT_PORTS_END |
| 206 | 79 | |
| 207 | 80 | |
| r243192 | r243193 | |
| 214 | 87 | |
| 215 | 88 | void splitsec_state::machine_start() |
| 216 | 89 | { |
| 217 | // zerofill | |
| 218 | memset(m_leds_state, 0, sizeof(m_leds_state)); | |
| 219 | memset(m_leds_cache, 0, sizeof(m_leds_cache)); | |
| 220 | memset(m_leds_decay, 0, sizeof(m_leds_decay)); | |
| 221 | ||
| 222 | 90 | m_r = 0; |
| 223 | 91 | m_o = 0; |
| 224 | 92 | |
| 225 | // register for savestates | |
| 226 | save_item(NAME(m_leds_state)); | |
| 227 | save_item(NAME(m_leds_cache)); | |
| 228 | save_item(NAME(m_leds_decay)); | |
| 229 | ||
| 230 | 93 | save_item(NAME(m_r)); |
| 231 | 94 | save_item(NAME(m_o)); |
| 232 | 95 | } |
| r243192 | r243193 | |
| 240 | 103 | MCFG_TMS1XXX_WRITE_O_CB(WRITE16(splitsec_state, write_o)) |
| 241 | 104 | MCFG_TMS1XXX_WRITE_R_CB(WRITE16(splitsec_state, write_r)) |
| 242 | 105 | |
| 243 | MCFG_TIMER_DRIVER_ADD_PERIODIC("leds_decay", splitsec_state, leds_decay_tick, attotime::from_msec(10)) | |
| 244 | ||
| 245 | 106 | MCFG_DEFAULT_LAYOUT(layout_splitsec) |
| 246 | 107 | |
| 247 | 108 | /* no video! */ |
| r243192 | r243193 | |
| 262 | 123 | |
| 263 | 124 | ROM_START( splitsec ) |
| 264 | 125 | ROM_REGION( 0x1000, "maincpu", 0 ) |
| 265 | ROM_LOAD( "tms1400nll_mp7314", 0x0000, 0x1000, CRC( | |
| 126 | ROM_LOAD( "tms1400nll_mp7314", 0x0000, 0x1000, CRC(0cccdf59) SHA1(06a533134a433aaf856b80f0ca239d0498b98d5f) ) | |
| 266 | 127 | |
| 267 | 128 | ROM_REGION( 867, "maincpu:mpla", 0 ) |
| 268 | 129 | ROM_LOAD( "tms1100_default_mpla.pla", 0, 867, CRC(62445fc9) SHA1(d6297f2a4bc7a870b76cc498d19dbb0ce7d69fec) ) |
| r243192 | r243193 | |
| 271 | 132 | ROM_END |
| 272 | 133 | |
| 273 | 134 | |
| 274 | CONS( 1980, splitsec, 0, 0, splitsec, splitsec, driver_device, 0, "Parker Brothers", "Split Second", GAME_SUPPORTS_SAVE ) | |
| 135 | CONS( 1980, splitsec, 0, 0, splitsec, splitsec, driver_device, 0, "Parker Brothers", "Split Second", GAME_SUPPORTS_SAVE | GAME_NOT_WORKING ) |
| r243192 | r243193 | |
|---|---|---|
| 186 | 186 | |
| 187 | 187 | static INPUT_PORTS_START( starwbc ) |
| 188 | 188 | PORT_START("IN.0") // R0 |
| 189 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_1) PORT_NAME("Basic Game") | |
| 190 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_2) PORT_NAME("Intermediate Game") | |
| 191 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_3) PORT_NAME("Advanced Game") | |
| 192 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_N) PORT_NAME("Player Number") | |
| 189 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_1) PORT_NAME("Basic Game") | |
| 190 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_2) PORT_NAME("Intermediate Game") | |
| 191 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_3) PORT_NAME("Advanced Game") | |
| 192 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_P) PORT_NAME("Player Number") | |
| 193 | 193 | |
| 194 | 194 | PORT_START("IN.1") // R1 |
| 195 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEY | |
| 195 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_ENTER) PORT_NAME("Start Turn") | |
| 196 | 196 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNUSED) |
| 197 | 197 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) |
| 198 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEY | |
| 198 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSPACE) PORT_CODE(KEYCODE_DEL) PORT_NAME("End Turn") | |
| 199 | 199 | |
| 200 | 200 | PORT_START("IN.2") // R3 |
| 201 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Q) PORT_NAME("Magna Scan") // only used in adv. game | |
| 202 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_W) PORT_NAME("Enemy Scan") // only used in adv. game | |
| 201 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Q) PORT_NAME("Magna Scan") // only used in adv. game | |
| 202 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_W) PORT_NAME("Enemy Scan") // only used in adv. game | |
| 203 | 203 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) |
| 204 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEY | |
| 204 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_S) PORT_NAME("Screen Up") | |
| 205 | 205 | |
| 206 | 206 | PORT_START("IN.3") // R5 |
| 207 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_E) PORT_NAME("Evasive Maneuvers") | |
| 208 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_M) PORT_NAME("Move") | |
| 209 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_F) PORT_NAME("Fire") | |
| 210 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_B) PORT_NAME("Battle Stations") | |
| 207 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_E) PORT_NAME("Evasive Maneuvers") | |
| 208 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_M) PORT_NAME("Move") | |
| 209 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_F) PORT_NAME("Fire") | |
| 210 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_B) PORT_NAME("Battle Stations") | |
| 211 | 211 | |
| 212 | 212 | PORT_START("IN.4") // R7 |
| 213 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_LEFT) PORT_NAME("Left") | |
| 214 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_UP) PORT_NAME("Up") | |
| 215 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_DOWN) PORT_NAME("Down") | |
| 216 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_RIGHT) PORT_NAME("Right") | |
| 213 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_LEFT) PORT_NAME("Left") | |
| 214 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_UP) PORT_NAME("Up") | |
| 215 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_DOWN) PORT_NAME("Down") | |
| 216 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_RIGHT) PORT_NAME("Right") | |
| 217 | 217 | INPUT_PORTS_END |
| 218 | 218 | |
| 219 | 219 |
| r243192 | r243193 | |
|---|---|---|
| 185 | 185 | |
| 186 | 186 | static INPUT_PORTS_START( stopthief ) |
| 187 | 187 | PORT_START("IN.0") // O0 |
| 188 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("4") | |
| 189 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("6") | |
| 190 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("8") | |
| 191 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_NAME("0") | |
| 192 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("2") | |
| 188 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("4") | |
| 189 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("6") | |
| 190 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("8") | |
| 191 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_NAME("0") | |
| 192 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("2") | |
| 193 | 193 | |
| 194 | 194 | PORT_START("IN.1") // O6 |
| 195 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("3") | |
| 196 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("5") | |
| 197 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("7") | |
| 198 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD) PORT_NAME("9") | |
| 199 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("1") | |
| 195 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("3") | |
| 196 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("5") | |
| 197 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("7") | |
| 198 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD) PORT_NAME("9") | |
| 199 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("1") | |
| 200 | 200 | |
| 201 | 201 | // note: even though power buttons are on the matrix, they are not CPU-controlled |
| 202 | 202 | PORT_START("IN.2") // Vss! |
| 203 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_PGUP) PORT_NAME("On") PORT_CHANGED_MEMBER(DEVICE_SELF, stopthief_state, power_button, (void *)true) | |
| 204 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_T) PORT_NAME("Tip") | |
| 205 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_A) PORT_NAME("Arrest") | |
| 206 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_C) PORT_NAME("Clue") | |
| 207 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_PGDN) PORT_NAME("Off") PORT_CHANGED_MEMBER(DEVICE_SELF, stopthief_state, power_button, (void *)false) | |
| 203 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_PGUP) PORT_NAME("On") PORT_CHANGED_MEMBER(DEVICE_SELF, stopthief_state, power_button, (void *)true) | |
| 204 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_T) PORT_NAME("Tip") | |
| 205 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A) PORT_NAME("Arrest") | |
| 206 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C) PORT_NAME("Clue") | |
| 207 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_PGDN) PORT_NAME("Off") PORT_CHANGED_MEMBER(DEVICE_SELF, stopthief_state, power_button, (void *)false) | |
| 208 | 208 | INPUT_PORTS_END |
| 209 | 209 | |
| 210 | 210 |
| r243192 | r243193 | |
|---|---|---|
| 130 | 130 | |
| 131 | 131 | static INPUT_PORTS_START( tandy12 ) |
| 132 | 132 | PORT_START("IN.0") // R5 |
| 133 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_EQUALS) PORT_CODE(KEYCODE_PLUS_PAD) PORT_NAME("12") | |
| 134 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_MINUS) PORT_CODE(KEYCODE_MINUS_PAD) PORT_NAME("11") | |
| 135 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_NAME("10") | |
| 136 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD) PORT_NAME("9") | |
| 133 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_EQUALS) PORT_CODE(KEYCODE_PLUS_PAD) PORT_NAME("12") | |
| 134 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS) PORT_CODE(KEYCODE_MINUS_PAD) PORT_NAME("11") | |
| 135 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_NAME("10") | |
| 136 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD) PORT_NAME("9") | |
| 137 | 137 | |
| 138 | 138 | PORT_START("IN.1") // R6 |
| 139 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_T) PORT_NAME("Space-2") | |
| 140 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_E) PORT_NAME("Play-2/Hit-7") | |
| 141 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_W) PORT_NAME("Select") | |
| 142 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_Q) PORT_NAME("Start") | |
| 139 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_T) PORT_NAME("Space-2") | |
| 140 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_NAME("Play-2/Hit-7") | |
| 141 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_W) PORT_NAME("Select") | |
| 142 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) PORT_NAME("Start") | |
| 143 | 143 | |
| 144 | 144 | PORT_START("IN.2") // R7 |
| 145 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEY | |
| 145 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R) PORT_NAME("Repeat-2") | |
| 146 | 146 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 147 | 147 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 148 | 148 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 149 | 149 | |
| 150 | 150 | PORT_START("IN.3") // R8 |
| 151 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("4") | |
| 152 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("3") | |
| 153 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("2") | |
| 154 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("1") | |
| 151 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("4") | |
| 152 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("3") | |
| 153 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("2") | |
| 154 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("1") | |
| 155 | 155 | |
| 156 | 156 | PORT_START("IN.4") // R9 |
| 157 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("8") | |
| 158 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("7") | |
| 159 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("6") | |
| 160 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("5") | |
| 157 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("8") | |
| 158 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("7") | |
| 159 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("6") | |
| 160 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("5") | |
| 161 | 161 | INPUT_PORTS_END |
| 162 | 162 | |
| 163 | 163 |
| r243192 | r243193 | |
|---|---|---|
| 693 | 693 | COMP( 1980, snspella, snspell, 0, snspell, snspell, tispeak_state, snspell, "Texas Instruments", "Speak & Spell (US set 2)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND ) |
| 694 | 694 | COMP( 1978, snspelluk, snspell, 0, snspell, snspell, tispeak_state, snspell, "Texas Instruments", "Speak & Spell (UK set 1)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND ) |
| 695 | 695 | COMP( 1981, snspelluka, snspell, 0, snspell, snspell, tispeak_state, snspell, "Texas Instruments", "Speak & Spell (UK set 2)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND ) // different voice actor |
| 696 | COMP( 1979, snspelljp, snspell, 0, snspell, snspell, tispeak_state, snspell, "Texas Instruments", "Speak & Spell (Japan)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND ) | |
| 696 | COMP( 1979, snspelljp, snspell, 0, snspell, snspell, tispeak_state, snspell, "Texas Instruments", "Speak & Spell (Japan)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND ) | |
| 697 | 697 | COMP( 1980, ladictee, snspell, 0, snspell, snspell, tispeak_state, snspell, "Texas Instruments", "La Dictee Magique (France)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND ) // doesn't work due to missing CD2702 MCU dump, German version has CD2702 too |
| 698 | 698 | |
| 699 | 699 | COMP( 1980, snmath, 0, 0, snmath, snmath, driver_device, 0, "Texas Instruments", "Speak & Math (US prototype)", GAME_IMPERFECT_SOUND ) // also US set 1 |
| r243192 | r243193 | |
|---|---|---|
| 758 | 758 | // does not have integrated STP or AVO populated |
| 759 | 759 | // 8085 based instead of I8080 |
| 760 | 760 | ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF ) |
| 761 | ROM_LOAD( "23- | |
| 761 | ROM_LOAD( "23-???e4-00.e71", 0x0000, 0x2000, NO_DUMP) // rom is unique to vt101 | |
| 762 | 762 | //e69 socket is empty/unpopulated on vt101? |
| 763 | 763 | //e67 socket is empty/unpopulated on vt101? |
| 764 | 764 |
| r243192 | r243193 | |
|---|---|---|
| 92 | 92 | virtual void video_start(); |
| 93 | 93 | UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 94 | 94 | |
| 95 | MC6845_UPDATE_ROW(update_row); | |
| 96 | 95 | DECLARE_READ16_MEMBER( mem_r ); |
| 97 | 96 | DECLARE_WRITE16_MEMBER( mem_w ); |
| 98 | 97 | DECLARE_READ8_MEMBER( prtr_snd_r ); |
| r243192 | r243193 | |
|---|---|---|
| 1 | /***************************************************************************** | |
| 2 | * | |
| 3 | * includes/banctec.h | |
| 4 | * | |
| 5 | ****************************************************************************/ | |
| 6 | ||
| 7 | #ifndef BANCTEC_H_ | |
| 8 | #define BANCTEC_H_ | |
| 9 | ||
| 10 | #include "video/mc6845.h" | |
| 11 | ||
| 12 | class banctec_state : public driver_device | |
| 13 | { | |
| 14 | public: | |
| 15 | banctec_state(const machine_config &mconfig, device_type type, const char *tag) | |
| 16 | : driver_device(mconfig, type, tag), | |
| 17 | m_maincpu(*this, "maincpu"), | |
| 18 | m_gfxdecode(*this, "gfxdecode"), | |
| 19 | m_videoram(*this, "videoram") { } | |
| 20 | ||
| 21 | DECLARE_READ8_MEMBER(banctec_read); | |
| 22 | DECLARE_WRITE8_MEMBER(banctec_write); | |
| 23 | TILE_GET_INFO_MEMBER(get_bg_tile_info); | |
| 24 | MC6845_ON_UPDATE_ADDR_CHANGED(crtc_addr); | |
| 25 | virtual void machine_reset(); | |
| 26 | virtual void video_start(); | |
| 27 | UINT32 screen_update_banctec(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); | |
| 28 | ||
| 29 | required_device<cpu_device> m_maincpu; | |
| 30 | required_device<gfxdecode_device> m_gfxdecode; | |
| 31 | required_shared_ptr<UINT8> m_videoram; | |
| 32 | ||
| 33 | tilemap_t *m_bg_tilemap; | |
| 34 | }; | |
| 35 | ||
| 36 | #endif /* BANCTEC_H_ */ |
| r243192 | r243193 | |
|---|---|---|
| 291 | 291 | INT32 m_adb_linestate; |
| 292 | 292 | bool m_adb_srqflag; |
| 293 | 293 | #define kADBKeyBufSize 32 |
| 294 | UINT8 m_adb_keybuf[kADBKeyBufSize]; | |
| 295 | UINT8 m_adb_keybuf_start; | |
| 296 | UINT8 m_adb_keybuf_end; | |
| 294 | UINT8 m_adb_keybuf[kADBKeyBufSize]; | |
| 295 | UINT8 m_adb_keybuf_start; | |
| 296 | UINT8 m_adb_keybuf_end; | |
| 297 | 297 | |
| 298 | 298 | // Portable/PB100 Power Manager IC comms (chapter 4, "Guide to the Macintosh Family Hardware", second edition) |
| 299 | 299 | UINT8 m_pm_data_send, m_pm_data_recv, m_pm_ack, m_pm_req, m_pm_cmd[32], m_pm_out[32], m_pm_dptr, m_pm_sptr, m_pm_slen, m_pm_state; |
| r243192 | r243193 | |
|---|---|---|
| 13 | 13 | #include "video/ppu2c0x.h" |
| 14 | 14 | #include "bus/nes/nes_slot.h" |
| 15 | 15 | #include "bus/nes/nes_carts.h" |
| 16 | #include "bus/nes_ctrl/ctrl.h" | |
| 17 | 16 | #include "sound/nes_apu.h" |
| 17 | #include "imagedev/cassette.h" | |
| 18 | 18 | |
| 19 | 19 | /*************************************************************************** |
| 20 | 20 | CONSTANTS |
| r243192 | r243193 | |
| 30 | 30 | TYPE DEFINITIONS |
| 31 | 31 | ***************************************************************************/ |
| 32 | 32 | |
| 33 | struct nes_input | |
| 34 | { | |
| 35 | UINT32 shift; | |
| 36 | UINT32 i0, i1, i2; | |
| 37 | }; | |
| 38 | ||
| 33 | 39 | /*PPU fast banking constants and structures */ |
| 34 | 40 | |
| 35 | 41 | #define CHRROM 0 |
| r243192 | r243193 | |
| 51 | 57 | class nes_state : public driver_device |
| 52 | 58 | { |
| 53 | 59 | public: |
| 60 | enum | |
| 61 | { | |
| 62 | TIMER_ZAPPER_TICK, | |
| 63 | TIMER_LIGHTGUN_TICK | |
| 64 | }; | |
| 65 | ||
| 54 | 66 | nes_state(const machine_config &mconfig, device_type type, const char *tag) |
| 55 | 67 | : driver_device(mconfig, type, tag), |
| 56 | 68 | m_maincpu(*this, "maincpu"), |
| 57 | 69 | m_ppu(*this, "ppu"), |
| 58 | 70 | m_sound(*this, "nessound"), |
| 59 | m_ctrl1(*this, "ctrl1"), | |
| 60 | m_ctrl2(*this, "ctrl2"), | |
| 61 | m_exp(*this, "exp"), | |
| 62 | 71 | m_cartslot(*this, "nes_slot"), |
| 63 | m_disk(*this, "disk") | |
| 72 | m_disk(*this, "disk"), | |
| 73 | m_cassette(*this, "tape") | |
| 64 | 74 | { } |
| 65 | 75 | |
| 66 | 76 | /* video-related */ |
| 67 | 77 | int m_last_frame_flip; |
| 68 | 78 | |
| 69 | 79 | /* misc */ |
| 80 | ioport_port *m_io_ctrlsel; | |
| 81 | ioport_port *m_io_fckey[9]; | |
| 82 | ioport_port *m_io_subkey[13]; | |
| 83 | ioport_port *m_io_pad[4]; | |
| 84 | ioport_port *m_io_powerpad[2]; | |
| 85 | ioport_port *m_io_mahjong[4]; | |
| 86 | ioport_port *m_io_ftrainer[4]; | |
| 87 | ioport_port *m_io_cc_left; | |
| 88 | ioport_port *m_io_cc_right; | |
| 89 | ioport_port *m_io_zapper1_t; | |
| 90 | ioport_port *m_io_zapper1_x; | |
| 91 | ioport_port *m_io_zapper1_y; | |
| 92 | ioport_port *m_io_zapper2_t; | |
| 93 | ioport_port *m_io_zapper2_x; | |
| 94 | ioport_port *m_io_zapper2_y; | |
| 95 | ioport_port *m_io_paddle; | |
| 96 | ioport_port *m_io_paddle_btn; | |
| 97 | ioport_port *m_io_exp; | |
| 70 | 98 | ioport_port *m_io_disksel; |
| 71 | 99 | |
| 72 | 100 | UINT8 *m_vram; |
| r243192 | r243193 | |
| 75 | 103 | required_device<cpu_device> m_maincpu; |
| 76 | 104 | required_device<ppu2c0x_device> m_ppu; |
| 77 | 105 | required_device<nesapu_device> m_sound; |
| 78 | required_device<nes_control_port_device> m_ctrl1; | |
| 79 | required_device<nes_control_port_device> m_ctrl2; | |
| 80 | optional_device<nes_control_port_device> m_exp; | |
| 81 | 106 | optional_device<nes_cart_slot_device> m_cartslot; |
| 82 | 107 | optional_device<nes_disksys_device> m_disk; |
| 108 | optional_device<cassette_image_device> m_cassette; | |
| 83 | 109 | |
| 84 | 110 | int nes_ppu_vidaccess(int address, int data); |
| 85 | 111 | void ppu_nmi(int *ppu_regs); |
| r243192 | r243193 | |
| 87 | 113 | DECLARE_READ8_MEMBER(nes_in0_r); |
| 88 | 114 | DECLARE_READ8_MEMBER(nes_in1_r); |
| 89 | 115 | DECLARE_WRITE8_MEMBER(nes_in0_w); |
| 116 | DECLARE_WRITE8_MEMBER(nes_in1_w); | |
| 90 | 117 | DECLARE_READ8_MEMBER(fc_in0_r); |
| 91 | 118 | DECLARE_READ8_MEMBER(fc_in1_r); |
| 92 | 119 | DECLARE_WRITE8_MEMBER(fc_in0_w); |
| r243192 | r243193 | |
| 100 | 127 | DECLARE_READ8_MEMBER(psg_4015_r); |
| 101 | 128 | DECLARE_WRITE8_MEMBER(psg_4015_w); |
| 102 | 129 | DECLARE_WRITE8_MEMBER(psg_4017_w); |
| 103 | NESCTRL_BRIGHTPIXEL_CB(bright_pixel); | |
| 130 | void state_register(); | |
| 131 | void setup_ioports(); | |
| 104 | 132 | |
| 105 | 133 | DECLARE_DRIVER_INIT(famicom); |
| 106 | 134 | |
| r243192 | r243193 | |
| 111 | 139 | DECLARE_MACHINE_RESET(famitwin); |
| 112 | 140 | void setup_disk(nes_disksys_device *slot); |
| 113 | 141 | |
| 142 | // input related | |
| 143 | UINT32 m_pad_latch[4]; | |
| 144 | UINT8 m_zapper_latch[2][3]; | |
| 145 | UINT8 m_paddle_latch, m_paddle_btn_latch; | |
| 146 | UINT8 m_mjpanel_latch; | |
| 147 | UINT8 m_fck_scan, m_fck_mode; | |
| 148 | UINT8 m_mic_obstruct; | |
| 149 | UINT8 m_powerpad_latch[2]; | |
| 150 | UINT8 m_ftrainer_scan; | |
| 151 | ||
| 152 | protected: | |
| 153 | virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); | |
| 154 | ||
| 114 | 155 | private: |
| 115 | 156 | memory_bank *m_prg_bank_mem[5]; |
| 116 | 157 | }; |
| r243192 | r243193 | |
|---|---|---|
| 19 | 19 | #define CONTROL1_TAG "ctrl1" |
| 20 | 20 | #define CONTROL2_TAG "ctrl2" |
| 21 | 21 | |
| 22 | #include "bus/gamegear/gge | |
| 22 | #include "bus/gamegear/gear2gear.h" | |
| 23 | 23 | #include "bus/sms_ctrl/smsctrl.h" |
| 24 | 24 | #include "bus/sms_exp/smsexp.h" |
| 25 | 25 | #include "bus/sega8/sega8_slot.h" |
| r243192 | r243193 | |
| 37 | 37 | m_region_maincpu(*this, "maincpu"), |
| 38 | 38 | m_port_ctrl1(*this, CONTROL1_TAG), |
| 39 | 39 | m_port_ctrl2(*this, CONTROL2_TAG), |
| 40 | m_port_gg | |
| 40 | m_port_gear2gear(*this, "gear2gear"), | |
| 41 | 41 | m_port_gg_dc(*this, "GG_PORT_DC"), |
| 42 | 42 | m_port_pause(*this, "PAUSE"), |
| 43 | 43 | m_port_reset(*this, "RESET"), |
| r243192 | r243193 | |
| 66 | 66 | required_memory_region m_region_maincpu; |
| 67 | 67 | optional_device<sms_control_port_device> m_port_ctrl1; |
| 68 | 68 | optional_device<sms_control_port_device> m_port_ctrl2; |
| 69 | optional_device<gg_e | |
| 69 | optional_device<gg_gear2gear_port_device> m_port_gear2gear; | |
| 70 | 70 | optional_ioport m_port_gg_dc; |
| 71 | 71 | optional_ioport m_port_pause; |
| 72 | 72 | optional_ioport m_port_reset; |
| r243192 | r243193 | |
| 75 | 75 | optional_ioport m_port_scope_binocular; |
| 76 | 76 | optional_ioport m_port_persist; |
| 77 | 77 | |
| 78 | device_t *m_left_lcd; | |
| 79 | device_t *m_right_lcd; | |
| 78 | 80 | address_space *m_space; |
| 81 | ||
| 82 | UINT8 m_bios_page_count; | |
| 83 | UINT8 m_fm_detect; | |
| 84 | UINT8 m_io_ctrl_reg; | |
| 85 | int m_paused; | |
| 86 | UINT8 m_mem_ctrl_reg; | |
| 87 | UINT8 m_mem_device_enabled; | |
| 79 | 88 | UINT8 *m_mainram; |
| 80 | 89 | UINT8 *m_BIOS; |
| 90 | UINT8 m_mapper[4]; | |
| 91 | UINT8 m_port_dc_reg; | |
| 92 | UINT8 m_port_dd_reg; | |
| 93 | UINT8 m_gg_sio[5]; | |
| 81 | 94 | |
| 82 | // for 3D glass binocular hack | |
| 83 | device_t *m_left_lcd; | |
| 84 | device_t *m_right_lcd; | |
| 85 | bitmap_rgb32 m_prevleft_bitmap; | |
| 86 | bitmap_rgb32 m_prevright_bitmap; | |
| 95 | // [0] for 0x400-0x3fff, [1] for 0x4000-0x7fff, [2] for 0x8000-0xffff, [3] for 0x0000-0x0400 | |
| 96 | UINT8 m_bios_page[4]; | |
| 87 | 97 | |
| 88 | 98 | // for gamegear LCD persistence hack |
| 89 | 99 | bitmap_rgb32 m_prev_bitmap; |
| r243192 | r243193 | |
| 95 | 105 | // vertical scaling in the gamegear sms compatibility mode. |
| 96 | 106 | int *m_line_buffer; |
| 97 | 107 | |
| 108 | // for 3D glass binocular hack | |
| 109 | bitmap_rgb32 m_prevleft_bitmap; | |
| 110 | bitmap_rgb32 m_prevright_bitmap; | |
| 111 | ||
| 98 | 112 | // model identifiers |
| 99 | 113 | UINT8 m_is_gamegear; |
| 100 | 114 | UINT8 m_is_gg_region_japan; |
| r243192 | r243193 | |
| 107 | 121 | UINT8 m_has_fm; |
| 108 | 122 | UINT8 m_has_jpn_sms_cart_slot; |
| 109 | 123 | |
| 110 | // [0] for 0x400-0x3fff, [1] for 0x4000-0x7fff, [2] for 0x8000-0xffff, [3] for 0x0000-0x0400 | |
| 111 | UINT8 m_bios_page[4]; | |
| 112 | ||
| 113 | UINT8 m_bios_page_count; | |
| 114 | UINT8 m_mapper[4]; | |
| 115 | UINT8 m_io_ctrl_reg; | |
| 116 | UINT8 m_mem_ctrl_reg; | |
| 117 | UINT8 m_mem_device_enabled; | |
| 118 | UINT8 m_fm_detect; | |
| 119 | UINT8 m_port_dc_reg; | |
| 120 | UINT8 m_port_dd_reg; | |
| 121 | UINT8 m_gg_sio[5]; | |
| 122 | int m_paused; | |
| 123 | ||
| 124 | 124 | // Data needed for Light Phaser |
| 125 | 125 | UINT8 m_ctrl1_th_state; |
| 126 | 126 | UINT8 m_ctrl2_th_state; |
| r243192 | r243193 | |
| 132 | 132 | UINT8 m_sscope_state; |
| 133 | 133 | UINT8 m_frame_sscope_state; |
| 134 | 134 | |
| 135 | // slot devices | |
| 136 | 135 | sega8_cart_slot_device *m_cartslot; |
| 137 | 136 | sega8_card_slot_device *m_cardslot; |
| 138 | 137 | sms_expansion_slot_device *m_expslot; |
| 139 | 138 | |
| 140 | 139 | // these are only used by the Store Display unit, but we keep them here temporarily to avoid the need of separate start/reset |
| 141 | sega8_cart_slot_device *m_slots[16]; | |
| 142 | sega8_card_slot_device *m_cards[16]; | |
| 143 | 140 | UINT8 m_store_control; |
| 144 | 141 | UINT8 m_store_cart_selection_data; |
| 142 | sega8_cart_slot_device *m_slots[16]; | |
| 143 | sega8_card_slot_device *m_cards[16]; | |
| 145 | 144 | void store_post_load(); |
| 146 | 145 | void store_select_cart(UINT8 data); |
| 147 | 146 | |
| 148 | DECLARE_READ8_MEMBER(read_0000); | |
| 149 | DECLARE_READ8_MEMBER(read_4000); | |
| 150 | DECLARE_READ8_MEMBER(read_8000); | |
| 151 | DECLARE_READ8_MEMBER(read_ram); | |
| 152 | DECLARE_WRITE8_MEMBER(write_ram); | |
| 153 | DECLARE_WRITE8_MEMBER(write_cart); | |
| 154 | ||
| 155 | DECLARE_READ8_MEMBER(sms_mapper_r); | |
| 156 | DECLARE_WRITE8_MEMBER(sms_mapper_w); | |
| 157 | DECLARE_WRITE8_MEMBER(sms_mem_control_w); | |
| 147 | /* Cartridge slot info */ | |
| 148 | DECLARE_WRITE8_MEMBER(sms_fm_detect_w); | |
| 149 | DECLARE_READ8_MEMBER(sms_fm_detect_r); | |
| 158 | 150 | DECLARE_WRITE8_MEMBER(sms_io_control_w); |
| 159 | 151 | DECLARE_READ8_MEMBER(sms_count_r); |
| 160 | 152 | DECLARE_READ8_MEMBER(sms_input_port_dc_r); |
| 161 | 153 | DECLARE_READ8_MEMBER(sms_input_port_dd_r); |
| 162 | 154 | DECLARE_READ8_MEMBER(gg_input_port_00_r); |
| 163 | DECLARE_WRITE8_MEMBER(gg_sio_w); | |
| 164 | DECLARE_READ8_MEMBER(gg_sio_r); | |
| 165 | DECLARE_WRITE8_MEMBER(sms_fm_detect_w); | |
| 166 | DECLARE_READ8_MEMBER(sms_fm_detect_r); | |
| 167 | 155 | DECLARE_WRITE8_MEMBER(sms_ym2413_register_port_w); |
| 168 | 156 | DECLARE_WRITE8_MEMBER(sms_ym2413_data_port_w); |
| 169 | 157 | DECLARE_READ8_MEMBER(sms_sscope_r); |
| 170 | 158 | DECLARE_WRITE8_MEMBER(sms_sscope_w); |
| 159 | DECLARE_READ8_MEMBER(sms_mapper_r); | |
| 171 | 160 | |
| 172 | DECLARE_WRITE_LINE_MEMBER(sms_int_callback); | |
| 173 | DECLARE_WRITE_LINE_MEMBER(sms_pause_callback); | |
| 174 | DECLARE_WRITE_LINE_MEMBER(sms_ctrl1_th_input); | |
| 175 | DECLARE_WRITE_LINE_MEMBER(sms_ctrl2_th_input); | |
| 176 | DECLARE_READ32_MEMBER(sms_pixel_color); | |
| 161 | DECLARE_READ8_MEMBER(read_0000); | |
| 162 | DECLARE_READ8_MEMBER(read_4000); | |
| 163 | DECLARE_READ8_MEMBER(read_8000); | |
| 164 | DECLARE_READ8_MEMBER(read_ram); | |
| 165 | DECLARE_WRITE8_MEMBER(write_ram); | |
| 166 | DECLARE_WRITE8_MEMBER(write_cart); | |
| 177 | 167 | |
| 168 | DECLARE_WRITE8_MEMBER(sms_mapper_w); | |
| 169 | DECLARE_WRITE8_MEMBER(sms_mem_control_w); | |
| 170 | DECLARE_WRITE8_MEMBER(gg_sio_w); | |
| 171 | DECLARE_READ8_MEMBER(gg_sio_r); | |
| 178 | 172 | DECLARE_DRIVER_INIT(sg1000m3); |
| 179 | 173 | DECLARE_DRIVER_INIT(gamegear); |
| 180 | 174 | DECLARE_DRIVER_INIT(gamegeaj); |
| r243192 | r243193 | |
| 189 | 183 | DECLARE_VIDEO_RESET(gamegear); |
| 190 | 184 | DECLARE_VIDEO_START(sms1); |
| 191 | 185 | DECLARE_VIDEO_RESET(sms1); |
| 192 | ||
| 186 | void screen_gg_sms_mode_scaling(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); | |
| 187 | UINT32 screen_update_gamegear(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); | |
| 193 | 188 | UINT32 screen_update_sms(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
| 194 | 189 | UINT32 screen_update_sms1(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
| 195 | UINT32 screen_update_gamegear(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); | |
| 196 | void screen_gg_sms_mode_scaling(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); | |
| 197 | 190 | void screen_vblank_sms1(screen_device &screen, bool state); |
| 191 | DECLARE_WRITE_LINE_MEMBER(sms_int_callback); | |
| 192 | DECLARE_WRITE_LINE_MEMBER(sms_pause_callback); | |
| 193 | DECLARE_READ32_MEMBER(sms_pixel_color); | |
| 194 | DECLARE_WRITE_LINE_MEMBER(sms_ctrl1_th_input); | |
| 195 | DECLARE_WRITE_LINE_MEMBER(sms_ctrl2_th_input); | |
| 198 | 196 | |
| 199 | 197 | protected: |
| 200 | 198 | UINT8 read_bus(address_space &space, unsigned int bank, UINT16 base_addr, UINT16 offset); |
| r243192 | r243193 | |
|---|---|---|
| 1 | 1 | <?xml version="1.0"?> |
| 2 | 2 | <mamelayout version="2"> |
| 3 | 3 | |
| 4 | <!-- define elements --> | |
| 5 | ||
| 6 | <element name="static_black"><rect><color red="0.0" green="0.0" blue="0.0" /></rect></element> | |
| 7 | ||
| 8 | <element name="lamp_disk" defstate="0"> | |
| 9 | <disk state="1"><color red="1.0" green="0.24" blue="0.26" /></disk> | |
| 10 | <disk state="0"><color red="0.15" green="0.043" blue="0.047" /></disk> | |
| 11 | </element> | |
| 12 | <element name="lamp_rect" defstate="0"> | |
| 13 | <rect state="1"><color red="1.0" green="0.24" blue="0.26" /></rect> | |
| 14 | <rect state="0"><color red="0.15" green="0.043" blue="0.047" /></rect> | |
| 15 | </element> | |
| 16 | ||
| 17 | ||
| 18 | <!-- build screen --> | |
| 19 | ||
| 20 | 4 | <view name="Internal Layout"> |
| 21 | <bounds left="0" right="18" top="0" bottom="28" /> | |
| 22 | <bezel element="static_black"> | |
| 23 | <bounds left="0" right="18" top="0" bottom="28" /> | |
| 24 | </bezel> | |
| 5 | <bounds left="0" right="100" top="0" bottom="100" /> | |
| 25 | 6 | |
| 26 | <!-- maze of lamps --> | |
| 27 | ||
| 28 | <bezel name="lamp0" element="lamp_rect"><bounds x="2" y="1" width="4" height="1" /></bezel> | |
| 29 | <bezel name="lamp2" element="lamp_rect"><bounds x="7" y="1" width="4" height="1" /></bezel> | |
| 30 | <bezel name="lamp4" element="lamp_rect"><bounds x="12" y="1" width="4" height="1" /></bezel> | |
| 31 | ||
| 32 | <bezel name="lamp10" element="lamp_rect"><bounds x="1" y="2" width="1" height="4" /></bezel> | |
| 33 | <bezel name="lamp1" element="lamp_disk"><bounds x="3" y="3" width="2" height="2" /></bezel> | |
| 34 | <bezel name="lamp12" element="lamp_rect"><bounds x="6" y="2" width="1" height="4" /></bezel> | |
| 35 | <bezel name="lamp3" element="lamp_disk"><bounds x="8" y="3" width="2" height="2" /></bezel> | |
| 36 | <bezel name="lamp14" element="lamp_rect"><bounds x="11" y="2" width="1" height="4" /></bezel> | |
| 37 | <bezel name="lamp5" element="lamp_disk"><bounds x="13" y="3" width="2" height="2" /></bezel> | |
| 38 | <bezel name="lamp16" element="lamp_rect"><bounds x="16" y="2" width="1" height="4" /></bezel> | |
| 39 | ||
| 40 | <bezel name="lamp11" element="lamp_rect"><bounds x="2" y="6" width="4" height="1" /></bezel> | |
| 41 | <bezel name="lamp13" element="lamp_rect"><bounds x="7" y="6" width="4" height="1" /></bezel> | |
| 42 | <bezel name="lamp15" element="lamp_rect"><bounds x="12" y="6" width="4" height="1" /></bezel> | |
| 43 | ||
| 44 | <bezel name="lamp20" element="lamp_rect"><bounds x="1" y="7" width="1" height="4" /></bezel> | |
| 45 | <bezel name="lamp21" element="lamp_disk"><bounds x="3" y="8" width="2" height="2" /></bezel> | |
| 46 | <bezel name="lamp22" element="lamp_rect"><bounds x="6" y="7" width="1" height="4" /></bezel> | |
| 47 | <bezel name="lamp23" element="lamp_disk"><bounds x="8" y="8" width="2" height="2" /></bezel> | |
| 48 | <bezel name="lamp24" element="lamp_rect"><bounds x="11" y="7" width="1" height="4" /></bezel> | |
| 49 | <bezel name="lamp25" element="lamp_disk"><bounds x="13" y="8" width="2" height="2" /></bezel> | |
| 50 | <bezel name="lamp26" element="lamp_rect"><bounds x="16" y="7" width="1" height="4" /></bezel> | |
| 51 | ||
| 52 | <bezel name="lamp31" element="lamp_rect"><bounds x="2" y="11" width="4" height="1" /></bezel> | |
| 53 | <bezel name="lamp33" element="lamp_rect"><bounds x="7" y="11" width="4" height="1" /></bezel> | |
| 54 | <bezel name="lamp35" element="lamp_rect"><bounds x="12" y="11" width="4" height="1" /></bezel> | |
| 55 | ||
| 56 | <bezel name="lamp30" element="lamp_rect"><bounds x="1" y="12" width="1" height="4" /></bezel> | |
| 57 | <bezel name="lamp41" element="lamp_disk"><bounds x="3" y="13" width="2" height="2" /></bezel> | |
| 58 | <bezel name="lamp32" element="lamp_rect"><bounds x="6" y="12" width="1" height="4" /></bezel> | |
| 59 | <bezel name="lamp43" element="lamp_disk"><bounds x="8" y="13" width="2" height="2" /></bezel> | |
| 60 | <bezel name="lamp34" element="lamp_rect"><bounds x="11" y="12" width="1" height="4" /></bezel> | |
| 61 | <bezel name="lamp45" element="lamp_disk"><bounds x="13" y="13" width="2" height="2" /></bezel> | |
| 62 | <bezel name="lamp36" element="lamp_rect"><bounds x="16" y="12" width="1" height="4" /></bezel> | |
| 63 | ||
| 64 | <bezel name="lamp51" element="lamp_rect"><bounds x="2" y="16" width="4" height="1" /></bezel> | |
| 65 | <bezel name="lamp53" element="lamp_rect"><bounds x="7" y="16" width="4" height="1" /></bezel> | |
| 66 | <bezel name="lamp55" element="lamp_rect"><bounds x="12" y="16" width="4" height="1" /></bezel> | |
| 67 | ||
| 68 | <bezel name="lamp40" element="lamp_rect"><bounds x="1" y="17" width="1" height="4" /></bezel> | |
| 69 | <bezel name="lamp61" element="lamp_disk"><bounds x="3" y="18" width="2" height="2" /></bezel> | |
| 70 | <bezel name="lamp42" element="lamp_rect"><bounds x="6" y="17" width="1" height="4" /></bezel> | |
| 71 | <bezel name="lamp63" element="lamp_disk"><bounds x="8" y="18" width="2" height="2" /></bezel> | |
| 72 | <bezel name="lamp44" element="lamp_rect"><bounds x="11" y="17" width="1" height="4" /></bezel> | |
| 73 | <bezel name="lamp65" element="lamp_disk"><bounds x="13" y="18" width="2" height="2" /></bezel> | |
| 74 | <bezel name="lamp46" element="lamp_rect"><bounds x="16" y="17" width="1" height="4" /></bezel> | |
| 75 | ||
| 76 | <bezel name="lamp71" element="lamp_rect"><bounds x="2" y="21" width="4" height="1" /></bezel> | |
| 77 | <bezel name="lamp73" element="lamp_rect"><bounds x="7" y="21" width="4" height="1" /></bezel> | |
| 78 | <bezel name="lamp75" element="lamp_rect"><bounds x="12" y="21" width="4" height="1" /></bezel> | |
| 79 | ||
| 80 | <bezel name="lamp50" element="lamp_rect"><bounds x="1" y="22" width="1" height="4" /></bezel> | |
| 81 | <bezel name="lamp60" element="lamp_disk"><bounds x="3" y="23" width="2" height="2" /></bezel> | |
| 82 | <bezel name="lamp52" element="lamp_rect"><bounds x="6" y="22" width="1" height="4" /></bezel> | |
| 83 | <bezel name="lamp62" element="lamp_disk"><bounds x="8" y="23" width="2" height="2" /></bezel> | |
| 84 | <bezel name="lamp54" element="lamp_rect"><bounds x="11" y="22" width="1" height="4" /></bezel> | |
| 85 | <bezel name="lamp64" element="lamp_disk"><bounds x="13" y="23" width="2" height="2" /></bezel> | |
| 86 | <bezel name="lamp56" element="lamp_rect"><bounds x="16" y="22" width="1" height="4" /></bezel> | |
| 87 | ||
| 88 | <bezel name="lamp70" element="lamp_rect"><bounds x="2" y="26" width="4" height="1" /></bezel> | |
| 89 | <bezel name="lamp72" element="lamp_rect"><bounds x="7" y="26" width="4" height="1" /></bezel> | |
| 90 | <bezel name="lamp74" element="lamp_rect"><bounds x="12" y="26" width="4" height="1" /></bezel> | |
| 91 | ||
| 92 | 7 | </view> |
| 93 | 8 | </mamelayout> |
| r243192 | r243193 | |
|---|---|---|
| 2842 | 2842 | int i; |
| 2843 | 2843 | bool slot3 = false,slot7 = false; |
| 2844 | 2844 | |
| 2845 | if | |
| 2845 | if(m_system_type == SYSTEM_PLUS || m_system_type == SYSTEM_GX4000) | |
| 2846 | 2846 | { |
| 2847 | 2847 | UINT8 *crt = m_region_cart->base(); |
| 2848 | 2848 | int bank_mask = (m_cart->get_rom_size() / 0x4000) - 1; |
| r243192 | r243193 | |
| 3034 | 3034 | |
| 3035 | 3035 | astring region_tag; |
| 3036 | 3036 | m_region_cart = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG)); |
| 3037 | if (!m_region_cart) // this should never happen, since we make carts mandatory! | |
| 3038 | m_region_cart = memregion("maincpu"); | |
| 3039 | 3037 | } |
| 3040 | 3038 | |
| 3041 | 3039 | |
| r243192 | r243193 | |
| 3078 | 3076 | |
| 3079 | 3077 | astring region_tag; |
| 3080 | 3078 | m_region_cart = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG)); |
| 3081 | if (!m_region_cart) // this should never happen, since we make carts mandatory! | |
| 3082 | m_region_cart = memregion("maincpu"); | |
| 3083 | 3079 | } |
| 3084 | 3080 | |
| 3085 | 3081 | MACHINE_RESET_MEMBER(amstrad_state,gx4000) |
| r243192 | r243193 | |
|---|---|---|
| 427 | 427 | { |
| 428 | 428 | if(m_adb_keybuf_start == m_adb_keybuf_end) |
| 429 | 429 | { |
| 430 | // | |
| 430 | // printf("%s: buffer empty\n", __func__); | |
| 431 | 431 | m_adb_buffer[0] = 0xff; |
| 432 | 432 | m_adb_buffer[1] = 0xff; |
| 433 | 433 | } |
| r243192 | r243193 | |
|---|---|---|
| 7 | 7 | ****************************************************************************/ |
| 8 | 8 | |
| 9 | 9 | #include "emu.h" |
| 10 | #include "crsshair.h" | |
| 10 | 11 | #include "cpu/m6502/m6502.h" |
| 11 | 12 | #include "includes/nes.h" |
| 13 | #include "imagedev/flopdrv.h" | |
| 12 | 14 | |
| 13 | 15 | /*************************************************************************** |
| 16 | CONSTANTS | |
| 17 | ***************************************************************************/ | |
| 18 | ||
| 19 | /* Set to dump info about the inputs to the errorlog */ | |
| 20 | #define LOG_JOY 0 | |
| 21 | ||
| 22 | /* Set to generate prg & chr files when the cart is loaded */ | |
| 23 | #define SPLIT_PRG 0 | |
| 24 | #define SPLIT_CHR 0 | |
| 25 | ||
| 26 | /*************************************************************************** | |
| 14 | 27 | FUNCTIONS |
| 15 | 28 | ***************************************************************************/ |
| 16 | 29 | |
| r243192 | r243193 | |
| 31 | 44 | m_cartslot->pcb_reset(); |
| 32 | 45 | |
| 33 | 46 | m_maincpu->reset(); |
| 47 | ||
| 48 | memset(m_pad_latch, 0, sizeof(m_pad_latch)); | |
| 49 | memset(m_zapper_latch, 0, sizeof(m_zapper_latch)); | |
| 50 | m_paddle_latch = 0; | |
| 51 | m_paddle_btn_latch = 0; | |
| 34 | 52 | } |
| 35 | 53 | |
| 36 | 54 | //------------------------------------------------- |
| 37 | 55 | // machine_start |
| 38 | 56 | //------------------------------------------------- |
| 39 | 57 | |
| 58 | void nes_state::state_register() | |
| 59 | { | |
| 60 | save_item(NAME(m_last_frame_flip)); | |
| 61 | ||
| 62 | save_pointer(NAME(m_ciram), 0x800); | |
| 63 | ||
| 64 | save_item(NAME(m_pad_latch)); | |
| 65 | save_item(NAME(m_zapper_latch)); | |
| 66 | save_item(NAME(m_paddle_latch)); | |
| 67 | save_item(NAME(m_paddle_btn_latch)); | |
| 68 | save_item(NAME(m_mjpanel_latch)); | |
| 69 | save_item(NAME(m_fck_scan)); | |
| 70 | save_item(NAME(m_fck_mode)); | |
| 71 | save_item(NAME(m_mic_obstruct)); | |
| 72 | save_item(NAME(m_powerpad_latch)); | |
| 73 | save_item(NAME(m_ftrainer_scan)); | |
| 74 | } | |
| 75 | ||
| 76 | void nes_state::setup_ioports() | |
| 77 | { | |
| 78 | for (int i = 0; i < 9; i++) | |
| 79 | { | |
| 80 | char str[7]; | |
| 81 | sprintf(str, "FCKEY%i", i); | |
| 82 | m_io_fckey[i] = ioport(str); | |
| 83 | } | |
| 84 | for (int i = 0; i < 13; i++) | |
| 85 | { | |
| 86 | char str[9]; | |
| 87 | sprintf(str, "SUBKEY%i", i); | |
| 88 | m_io_subkey[i] = ioport(str); | |
| 89 | } | |
| 90 | for (int i = 0; i < 4; i++) | |
| 91 | { | |
| 92 | char str[8]; | |
| 93 | sprintf(str, "PAD%i", i + 1); | |
| 94 | m_io_pad[i] = ioport(str); | |
| 95 | sprintf(str, "MAH%i", i); | |
| 96 | m_io_mahjong[i] = ioport(str); | |
| 97 | sprintf(str, "FT_COL%i", i); | |
| 98 | m_io_ftrainer[i] = ioport(str); | |
| 99 | } | |
| 100 | ||
| 101 | m_io_ctrlsel = ioport("CTRLSEL"); | |
| 102 | m_io_exp = ioport("EXP"); | |
| 103 | m_io_paddle = ioport("PADDLE"); | |
| 104 | m_io_paddle_btn = ioport("PADDLE_BUTTON"); | |
| 105 | m_io_cc_left = ioport("CC_LEFT"); | |
| 106 | m_io_cc_right = ioport("CC_RIGHT"); | |
| 107 | m_io_zapper1_t = ioport("ZAPPER1_T"); | |
| 108 | m_io_zapper1_x = ioport("ZAPPER1_X"); | |
| 109 | m_io_zapper1_y = ioport("ZAPPER1_Y"); | |
| 110 | m_io_zapper2_t = ioport("ZAPPER2_T"); | |
| 111 | m_io_zapper2_x = ioport("ZAPPER2_X"); | |
| 112 | m_io_zapper2_y = ioport("ZAPPER2_Y"); | |
| 113 | m_io_powerpad[0] = ioport("POWERPAD1"); | |
| 114 | m_io_powerpad[1] = ioport("POWERPAD2"); | |
| 115 | m_io_disksel = ioport("FLIPDISK"); | |
| 116 | } | |
| 117 | ||
| 40 | 118 | void nes_state::machine_start() |
| 41 | 119 | { |
| 42 | 120 | address_space &space = m_maincpu->space(AS_PROGRAM); |
| r243192 | r243193 | |
| 48 | 126 | m_ciram = auto_alloc_array(machine(), UINT8, 0x800); |
| 49 | 127 | // other pointers got set in the loading routine, because they 'belong' to the cart itself |
| 50 | 128 | |
| 51 | | |
| 129 | setup_ioports(); | |
| 52 | 130 | |
| 53 | 131 | if (m_cartslot && m_cartslot->m_cart) |
| 54 | 132 | { |
| r243192 | r243193 | |
| 100 | 178 | m_cartslot->m_cart->pcb_reg_postload(machine()); |
| 101 | 179 | } |
| 102 | 180 | |
| 103 | // register saves | |
| 104 | save_item(NAME(m_last_frame_flip)); | |
| 105 | save_pointer(NAME(m_ciram), 0x800); | |
| 181 | state_register(); | |
| 106 | 182 | } |
| 107 | 183 | |
| 108 | 184 | |
| r243192 | r243193 | |
| 112 | 188 | |
| 113 | 189 | READ8_MEMBER(nes_state::nes_in0_r) |
| 114 | 190 | { |
| 191 | int cfg = m_io_ctrlsel->read(); | |
| 192 | ||
| 193 | // Some games expect bit 6 to be set because the last entry on the data bus shows up | |
| 194 | // in the unused upper 3 bits, so typically a read from $4016 leaves 0x40 there. | |
| 115 | 195 | UINT8 ret = 0x40; |
| 116 | ret |= m_ctrl1->read_bit0(); | |
| 117 | ret |= m_ctrl1->read_bit34(); | |
| 196 | ret |= (m_pad_latch[0] & 0x01); | |
| 197 | ||
| 198 | // shift | |
| 199 | m_pad_latch[0] >>= 1; | |
| 200 | ||
| 201 | // zapper | |
| 202 | if ((cfg & 0x000f) == 0x0002) | |
| 203 | { | |
| 204 | int x = m_zapper_latch[0][1]; // x-position | |
| 205 | int y = m_zapper_latch[0][2]; // y-position | |
| 206 | UINT32 pix, color_base; | |
| 207 | ||
| 208 | // get the pixel at the gun position | |
| 209 | pix = m_ppu->get_pixel(x, y); | |
| 210 | ||
| 211 | // get the color base from the ppu | |
| 212 | color_base = m_ppu->get_colorbase(); | |
| 213 | ||
| 214 | // check if the cursor is over a bright pixel | |
| 215 | if ((pix == color_base + 0x20) || (pix == color_base + 0x30) || | |
| 216 | (pix == color_base + 0x33) || (pix == color_base + 0x34)) | |
| 217 | ret &= ~0x08; // sprite hit | |
| 218 | else | |
| 219 | ret |= 0x08; // no sprite hit | |
| 220 | ||
| 221 | // light gun trigger | |
| 222 | ret |= (m_zapper_latch[0][0] << 4); | |
| 223 | } | |
| 224 | ||
| 225 | if (LOG_JOY) | |
| 226 | logerror("joy 0 read, val: %02x, pc: %04x\n", ret, space.device().safe_pc()); | |
| 227 | ||
| 118 | 228 | return ret; |
| 119 | 229 | } |
| 120 | 230 | |
| 121 | 231 | READ8_MEMBER(nes_state::nes_in1_r) |
| 122 | 232 | { |
| 233 | int cfg = m_io_ctrlsel->read(); | |
| 234 | ||
| 235 | // Some games expect bit 6 to be set because the last entry on the data bus shows up | |
| 236 | // in the unused upper 3 bits, so typically a read from $4017 leaves 0x40 there. | |
| 123 | 237 | UINT8 ret = 0x40; |
| 124 | ret |= m_ctrl2->read_bit0(); | |
| 125 | ret |= m_ctrl2->read_bit34(); | |
| 238 | ret |= (m_pad_latch[1] & 0x01); | |
| 239 | ||
| 240 | // shift | |
| 241 | m_pad_latch[1] >>= 1; | |
| 242 | ||
| 243 | // zapper | |
| 244 | if ((cfg & 0x00f0) == 0x0020) | |
| 245 | { | |
| 246 | int x = m_zapper_latch[1][1]; // x-position | |
| 247 | int y = m_zapper_latch[1][2]; // y-position | |
| 248 | UINT32 pix, color_base; | |
| 249 | ||
| 250 | // get the pixel at the gun position | |
| 251 | pix = m_ppu->get_pixel(x, y); | |
| 252 | ||
| 253 | // get the color base from the ppu | |
| 254 | color_base = m_ppu->get_colorbase(); | |
| 255 | ||
| 256 | // check if the cursor is over a bright pixel | |
| 257 | if ((pix == color_base + 0x20) || (pix == color_base + 0x30) || | |
| 258 | (pix == color_base + 0x33) || (pix == color_base + 0x34)) | |
| 259 | ret &= ~0x08; // sprite hit | |
| 260 | else | |
| 261 | ret |= 0x08; // no sprite hit | |
| 262 | ||
| 263 | // light gun trigger | |
| 264 | ret |= (m_zapper_latch[1][0] << 4); | |
| 265 | } | |
| 266 | ||
| 267 | // arkanoid paddle | |
| 268 | if ((cfg & 0x00f0) == 0x0040) | |
| 269 | { | |
| 270 | ret |= (m_paddle_btn_latch << 3); // button | |
| 271 | ret |= ((m_paddle_latch & 0x80) >> 3); // paddle data | |
| 272 | m_paddle_latch <<= 1; | |
| 273 | m_paddle_latch &= 0xff; | |
| 274 | } | |
| 275 | ||
| 276 | // powerpad | |
| 277 | if ((cfg & 0x00f0) == 0x0050 || (cfg & 0x00f0) == 0x0060) | |
| 278 | { | |
| 279 | ret |= ((m_powerpad_latch[0] & 0x01) << 3); | |
| 280 | ret |= ((m_powerpad_latch[1] & 0x01) << 4); | |
| 281 | m_powerpad_latch[0] >>= 1; | |
| 282 | m_powerpad_latch[1] >>= 1; | |
| 283 | } | |
| 284 | ||
| 285 | if (LOG_JOY) | |
| 286 | logerror("joy 1 read, val: %02x, pc: %04x\n", ret, space.device().safe_pc()); | |
| 287 | ||
| 126 | 288 | return ret; |
| 127 | 289 | } |
| 128 | 290 | |
| 129 | 291 | WRITE8_MEMBER(nes_state::nes_in0_w) |
| 130 | 292 | { |
| 131 | m_ctrl1->write(data); | |
| 132 | m_ctrl2->write(data); | |
| 293 | int cfg = m_io_ctrlsel->read(); | |
| 294 | ||
| 295 | if (LOG_JOY) | |
| 296 | logerror("joy write, val: %02x, pc: %04x\n", data, space.device().safe_pc()); | |
| 297 | ||
| 298 | // Check if lightgun has been chosen as input: if so, enable crosshair | |
| 299 | timer_set(attotime::zero, TIMER_ZAPPER_TICK); | |
| 300 | ||
| 301 | if (data & 0x01) | |
| 302 | return; | |
| 303 | ||
| 304 | // Toggling bit 0 high then low resets controllers | |
| 305 | m_pad_latch[0] = 0; | |
| 306 | m_pad_latch[1] = 0; | |
| 307 | m_zapper_latch[0][0] = 0; | |
| 308 | m_zapper_latch[0][1] = 0; | |
| 309 | m_zapper_latch[0][2] = 0; | |
| 310 | m_zapper_latch[1][0] = 0; | |
| 311 | m_zapper_latch[1][1] = 0; | |
| 312 | m_zapper_latch[1][2] = 0; | |
| 313 | m_paddle_btn_latch = 0; | |
| 314 | m_paddle_latch = 0; | |
| 315 | m_powerpad_latch[0] = 0; | |
| 316 | m_powerpad_latch[1] = 0; | |
| 317 | ||
| 318 | // P1 inputs | |
| 319 | switch (cfg & 0x000f) | |
| 320 | { | |
| 321 | case 0x01: // pad 1 | |
| 322 | m_pad_latch[0] = m_io_pad[0]->read(); | |
| 323 | break; | |
| 324 | ||
| 325 | case 0x02: // zapper (secondary) | |
| 326 | m_zapper_latch[0][0] = m_io_zapper1_t->read(); | |
| 327 | m_zapper_latch[0][1] = m_io_zapper1_x->read(); | |
| 328 | m_zapper_latch[0][2] = m_io_zapper1_y->read(); | |
| 329 | break; | |
| 330 | } | |
| 331 | ||
| 332 | // P2 inputs | |
| 333 | switch ((cfg & 0x00f0) >> 4) | |
| 334 | { | |
| 335 | case 0x01: // pad 2 | |
| 336 | m_pad_latch[1] = m_io_pad[1]->read(); | |
| 337 | break; | |
| 338 | ||
| 339 | case 0x02: // zapper (primary) - most games expect pad in port1 & zapper in port2 | |
| 340 | m_zapper_latch[1][0] = m_io_zapper2_t->read(); | |
| 341 | m_zapper_latch[1][1] = m_io_zapper2_x->read(); | |
| 342 | m_zapper_latch[1][2] = m_io_zapper2_y->read(); | |
| 343 | break; | |
| 344 | ||
| 345 | case 0x04: // arkanoid paddle | |
| 346 | m_paddle_btn_latch = m_io_paddle_btn->read(); | |
| 347 | m_paddle_latch = (UINT8) (m_io_paddle->read() ^ 0xff); | |
| 348 | break; | |
| 349 | ||
| 350 | case 0x05: // power pad | |
| 351 | case 0x06: // power pad | |
| 352 | m_powerpad_latch[0] = m_io_powerpad[0]->read(); | |
| 353 | m_powerpad_latch[1] = m_io_powerpad[1]->read() | 0xf0; | |
| 354 | break; | |
| 355 | } | |
| 356 | ||
| 357 | // P3 & P4 inputs in NES Four Score are read serially with P1 & P2 | |
| 358 | // P3 inputs | |
| 359 | if ((cfg & 0x0f00)) | |
| 360 | m_pad_latch[0] |= ((m_io_pad[2]->read() << 8) | (0x08 << 16)); // pad 3 + signature | |
| 361 | ||
| 362 | // P4 inputs | |
| 363 | if ((cfg & 0xf000)) | |
| 364 | m_pad_latch[1] |= ((m_io_pad[3]->read() << 8) | (0x04 << 16)); // pad 4 + signature | |
| 133 | 365 | } |
| 134 | 366 | |
| 135 | 367 | |
| 368 | WRITE8_MEMBER(nes_state::nes_in1_w) | |
| 369 | { | |
| 370 | } | |
| 371 | ||
| 372 | ||
| 136 | 373 | READ8_MEMBER(nes_state::fc_in0_r) |
| 137 | 374 | { |
| 375 | int cfg = m_io_ctrlsel->read(); | |
| 376 | int exp = m_io_exp->read(); | |
| 377 | ||
| 378 | // Some games expect bit 6 to be set because the last entry on the data bus shows up | |
| 379 | // in the unused upper 3 bits, so typically a read from $4016 leaves 0x40 there. | |
| 138 | 380 | UINT8 ret = 0x40; |
| 139 | // bit 0 to controller port | |
| 140 | ret |= m_ctrl1->read_bit0(); | |
| 381 | ret |= (m_pad_latch[0] & 0x01); | |
| 141 | 382 | |
| 142 | // expansion port bits (in the original FC, P2 controller was hooked to these lines | |
| 143 | // too, so in principle some homebrew hardware modification could use the same | |
| 144 | // connection with P1 controller too) | |
| 145 | ret |= m_ctrl1->read_exp(0); | |
| 146 | ret |= m_ctrl2->read_exp(0); | |
| 383 | // shift | |
| 384 | m_pad_latch[0] >>= 1; | |
| 147 | 385 | |
| 148 | // at the same time, we might have a standard joypad connected to the expansion port which | |
| 149 | // shall be read as P3 (this is needed here to avoid implementing the expansion port as a | |
| 150 | // different device compared to the standard control port... it might be changed later) | |
| 151 | ret |= (m_exp->read_bit0() << 1); | |
| 152 | // finally, read the expansion port as expected | |
| 153 | ret |= m_exp->read_exp(0); | |
| 386 | // microphone bit | |
| 387 | if ((cfg & 0x00f0) == 0x00f0) | |
| 388 | ret |= m_mic_obstruct; //bit2! | |
| 389 | ||
| 390 | // EXP input | |
| 391 | switch (exp & 0x0f) | |
| 392 | { | |
| 393 | case 0x02: // FC Keyboard: tape input | |
| 394 | if ((m_cassette->get_state() & CASSETTE_MASK_UISTATE) == CASSETTE_PLAY) | |
| 395 | { | |
| 396 | double level = m_cassette->input(); | |
| 397 | if (level < 0) | |
| 398 | ret |= 0x00; | |
| 399 | else | |
| 400 | ret |= 0x02; | |
| 401 | } | |
| 402 | break; | |
| 403 | ||
| 404 | case 0x04: // Arkanoid paddle | |
| 405 | ret |= (m_paddle_btn_latch << 1); // button | |
| 406 | break; | |
| 407 | ||
| 408 | case 0x07: // Mahjong Panel | |
| 409 | ret |= ((m_mjpanel_latch & 0x01) << 1); | |
| 410 | m_mjpanel_latch >>= 1; | |
| 411 | break; | |
| 412 | ||
| 413 | case 0x08: // 'multitap' p3 | |
| 414 | ret |= ((m_pad_latch[2] & 0x01) << 1); | |
| 415 | m_pad_latch[2] >>= 1; | |
| 416 | break; | |
| 417 | } | |
| 418 | ||
| 419 | if (LOG_JOY) | |
| 420 | logerror("joy 0 read, val: %02x, pc: %04x\n", ret, space.device().safe_pc()); | |
| 421 | ||
| 154 | 422 | return ret; |
| 155 | 423 | } |
| 156 | 424 | |
| 157 | 425 | READ8_MEMBER(nes_state::fc_in1_r) |
| 158 | 426 | { |
| 427 | int exp = m_io_exp->read(); | |
| 428 | ||
| 429 | // Some games expect bit 6 to be set because the last entry on the data bus shows up | |
| 430 | // in the unused upper 3 bits, so typically a read from $4017 leaves 0x40 there. | |
| 159 | 431 | UINT8 ret = 0x40; |
| 160 | // bit 0 to controller port | |
| 161 | ret |= m_ctrl2->read_bit0(); | |
| 432 | ret |= (m_pad_latch[1] & 0x01); | |
| 162 | 433 | |
| 163 | // expansion port bits (in the original FC, P2 controller was hooked to these lines | |
| 164 | // too, so in principle some homebrew hardware modification could use the same | |
| 165 | // connection with P1 controller too) | |
| 166 | ret |= m_ctrl1->read_exp(1); | |
| 167 | ret |= m_ctrl2->read_exp(1); | |
| 434 | // shift | |
| 435 | m_pad_latch[1] >>= 1; | |
| 168 | 436 | |
| 169 | // finally, read the expansion port as expected (standard pad cannot be hooked as P4, so | |
| 170 | // no read_bit0 here) | |
| 171 | ret |= m_exp->read_exp(1); | |
| 437 | ||
| 438 | // EXP input | |
| 439 | switch (exp & 0x0f) | |
| 440 | { | |
| 441 | case 0x01: // Lightgun | |
| 442 | { | |
| 443 | int x = m_zapper_latch[0][1]; // x-position | |
| 444 | int y = m_zapper_latch[0][2]; // y-position | |
| 445 | UINT32 pix, color_base; | |
| 446 | ||
| 447 | // get the pixel at the gun position | |
| 448 | pix = m_ppu->get_pixel(x, y); | |
| 449 | ||
| 450 | // get the color base from the ppu | |
| 451 | color_base = m_ppu->get_colorbase(); | |
| 452 | ||
| 453 | // check if the cursor is over a bright pixel | |
| 454 | if ((pix == color_base + 0x20) || (pix == color_base + 0x30) || | |
| 455 | (pix == color_base + 0x33) || (pix == color_base + 0x34)) | |
| 456 | ret &= ~0x08; // sprite hit | |
| 457 | else | |
| 458 | ret |= 0x08; // no sprite hit | |
| 459 | ||
| 460 | // light gun trigger | |
| 461 | ret |= (m_zapper_latch[0][0] << 4); | |
| 462 | } | |
| 463 | break; | |
| 464 | ||
| 465 | case 0x02: // FC Keyboard: rows of the keyboard matrix are read 4-bits at time and returned as bit1->bit4 | |
| 466 | if (m_fck_scan < 9) | |
| 467 | ret |= ~(((m_io_fckey[m_fck_scan]->read() >> (m_fck_mode * 4)) & 0x0f) << 1) & 0x1e; | |
| 468 | else | |
| 469 | ret |= 0x1e; | |
| 470 | break; | |
| 471 | ||
| 472 | case 0x03: // Subor Keyboard: rows of the keyboard matrix are read 4-bits at time and returned as bit1->bit4 | |
| 473 | if (m_fck_scan < 12) | |
| 474 | ret |= ~(((m_io_subkey[m_fck_scan]->read() >> (m_fck_mode * 4)) & 0x0f) << 1) & 0x1e; | |
| 475 | else | |
| 476 | ret |= 0x1e; | |
| 477 | break; | |
| 478 | ||
| 479 | case 0x04: // Arkanoid paddle | |
| 480 | ret |= ((m_paddle_latch & 0x80) >> 6); // paddle data | |
| 481 | m_paddle_latch <<= 1; | |
| 482 | m_paddle_latch &= 0xff; | |
| 483 | break; | |
| 484 | ||
| 485 | case 0x05: // family trainer | |
| 486 | case 0x06: // family trainer | |
| 487 | if (!BIT(m_ftrainer_scan, 0)) | |
| 488 | { | |
| 489 | // read low line: buttons 9,10,11,12 | |
| 490 | for (int i = 0; i < 4; i++) | |
| 491 | ret |= ((m_io_ftrainer[i]->read() & 0x01) << (1 + i)); | |
| 492 | } | |
| 493 | else if (!BIT(m_ftrainer_scan, 1)) | |
| 494 | { | |
| 495 | // read mid line: buttons 5,6,7,8 | |
| 496 | for (int i = 0; i < 4; i++) | |
| 497 | ret |= ((m_io_ftrainer[i]->read() & 0x02) << (1 + i)); | |
| 498 | } | |
| 499 | else if (!BIT(m_ftrainer_scan, 2)) | |
| 500 | { | |
| 501 | // read high line: buttons 1,2,3,4 | |
| 502 | for (int i = 0; i < 4; i++) | |
| 503 | ret |= ((m_io_ftrainer[i]->read() & 0x04) << (1 + i)); | |
| 504 | } | |
| 505 | break; | |
| 506 | ||
| 507 | case 0x07: // Mahjong Panel | |
| 508 | ret |= ((m_mjpanel_latch & 0x01) << 1); | |
| 509 | m_mjpanel_latch >>= 1; | |
| 510 | break; | |
| 511 | ||
| 512 | case 0x08: // 'multitap' p4 | |
| 513 | ret |= ((m_pad_latch[3] & 0x01) << 1); | |
| 514 | m_pad_latch[3] >>= 1; | |
| 515 | break; | |
| 516 | } | |
| 517 | ||
| 518 | if (LOG_JOY) | |
| 519 | logerror("joy 1 read, val: %02x, pc: %04x\n", ret, space.device().safe_pc()); | |
| 520 | ||
| 172 | 521 | return ret; |
| 173 | 522 | } |
| 174 | 523 | |
| 175 | 524 | WRITE8_MEMBER(nes_state::fc_in0_w) |
| 176 | 525 | { |
| 177 | m_ctrl1->write(data); | |
| 178 | m_ctrl2->write(data); | |
| 179 | m_exp->write(data); | |
| 526 | int cfg = m_io_ctrlsel->read(); | |
| 527 | int exp = m_io_exp->read(); | |
| 528 | ||
| 529 | if (LOG_JOY) | |
| 530 | logerror("joy write, val: %02x, pc: %04x\n", data, space.device().safe_pc()); | |
| 531 | ||
| 532 | // Check if lightgun has been chosen as input: if so, enable crosshair | |
| 533 | timer_set(attotime::zero, TIMER_LIGHTGUN_TICK); | |
| 534 | ||
| 535 | // keyboards | |
| 536 | if ((exp & 0x0f) == 0x02 || (exp & 0x0f) == 0x03) | |
| 537 | { | |
| 538 | // tape output (not fully tested) | |
| 539 | if ((m_cassette->get_state() & CASSETTE_MASK_UISTATE) == CASSETTE_RECORD) | |
| 540 | m_cassette->output(((data & 0x07) == 0x07) ? +1.0 : -1.0); | |
| 541 | ||
| 542 | if (BIT(data, 2)) // keyboard active | |
| 543 | { | |
| 544 | int lines = ((exp & 0x0f) == 0x02) ? 9 : 12; | |
| 545 | UINT8 out = BIT(data, 1); // scan | |
| 546 | ||
| 547 | if (m_fck_mode && !out && ++m_fck_scan > lines) | |
| 548 | m_fck_scan = 0; | |
| 549 | ||
| 550 | m_fck_mode = out; // access lower or upper 4 bits | |
| 551 | ||
| 552 | if (BIT(data, 0)) // reset | |
| 553 | m_fck_scan = 0; | |
| 554 | } | |
| 555 | } | |
| 556 | ||
| 557 | // family trainer | |
| 558 | if ((exp & 0x0f) == 0x05 || (exp & 0x0f) == 0x06) | |
| 559 | { | |
| 560 | // select raw to scan | |
| 561 | m_ftrainer_scan = data & 0x07; | |
| 562 | } | |
| 563 | ||
| 564 | if (data & 0x01) | |
| 565 | return; | |
| 566 | ||
| 567 | // Toggling bit 0 high then low resets controllers | |
| 568 | m_pad_latch[0] = 0; | |
| 569 | m_pad_latch[1] = 0; | |
| 570 | m_pad_latch[2] = 0; | |
| 571 | m_pad_latch[3] = 0; | |
| 572 | m_zapper_latch[0][0] = 0; | |
| 573 | m_zapper_latch[0][1] = 0; | |
| 574 | m_zapper_latch[0][2] = 0; | |
| 575 | m_paddle_btn_latch = 0; | |
| 576 | m_paddle_latch = 0; | |
| 577 | m_mjpanel_latch = 0; | |
| 578 | m_mic_obstruct = 0; | |
| 579 | ||
| 580 | // P1 inputs | |
| 581 | switch (cfg & 0x000f) | |
| 582 | { | |
| 583 | case 0x01: // pad 1 | |
| 584 | m_pad_latch[0] = m_io_pad[0]->read(); | |
| 585 | break; | |
| 586 | ||
| 587 | case 0x02: // crazy climber (left stick) | |
| 588 | m_pad_latch[0] = m_io_cc_left->read(); | |
| 589 | break; | |
| 590 | } | |
| 591 | ||
| 592 | // P2 inputs | |
| 593 | switch ((cfg & 0x00f0) >> 4) | |
| 594 | { | |
| 595 | case 0x01: // pad 2 | |
| 596 | m_pad_latch[1] = m_io_pad[1]->read(); | |
| 597 | break; | |
| 598 | ||
| 599 | case 0x02: // crazy climber (right stick) | |
| 600 | m_pad_latch[1] = m_io_cc_right->read(); | |
| 601 | break; | |
| 602 | ||
| 603 | case 0x0f: // pad 2 old style with microphone instead of START/SELECT keys | |
| 604 | // we only emulate obstruction of mic (when you blow or talk into it) | |
| 605 | m_mic_obstruct = m_io_pad[1]->read() & 0x04; | |
| 606 | m_pad_latch[1] = (m_io_pad[1]->read() & ~0x04); | |
| 607 | break; | |
| 608 | } | |
| 609 | ||
| 610 | // P3 & P4 inputs in Famicom (e.g. through Hori Twin Adapter or Hori 4 Players Adapter) | |
| 611 | // are read in parallel with P1 & P2 (just using diff bits) | |
| 612 | // P3 inputs | |
| 613 | if ((exp & 0x0f) == 8 && (cfg & 0x0f00) == 0x0100) | |
| 614 | m_pad_latch[2] = m_io_pad[2]->read(); // pad 3 | |
| 615 | ||
| 616 | // P4 inputs | |
| 617 | if ((exp & 0x0f) == 8 && (cfg & 0xf000) == 0x1000) | |
| 618 | m_pad_latch[3] = m_io_pad[3]->read(); // pad 4 | |
| 619 | ||
| 620 | ||
| 621 | // EXP input | |
| 622 | switch (exp & 0x0f) | |
| 623 | { | |
| 624 | case 0x01: // Lightgun | |
| 625 | m_zapper_latch[0][0] = m_io_zapper2_t->read(); | |
| 626 | m_zapper_latch[0][1] = m_io_zapper2_x->read(); | |
| 627 | m_zapper_latch[0][2] = m_io_zapper2_y->read(); | |
| 628 | break; | |
| 629 | ||
| 630 | case 0x02: // FC Keyboard | |
| 631 | case 0x03: // Subor Keyboard | |
| 632 | // these are scanned differently than other devices: | |
| 633 | // writes to $4016 with bit2 set always update the | |
| 634 | // line counter and writing bit0 set resets the counter | |
| 635 | break; | |
| 636 | ||
| 637 | case 0x04: // Arkanoid paddle | |
| 638 | m_paddle_btn_latch = m_io_paddle_btn->read(); | |
| 639 | m_paddle_latch = (UINT8) (m_io_paddle->read() ^ 0xff); | |
| 640 | break; | |
| 641 | ||
| 642 | case 0x05: // family trainer | |
| 643 | case 0x06: // family trainer | |
| 644 | // these are scanned differently than other devices: | |
| 645 | // bit0-bit2 of writes to $4016 select the row to read | |
| 646 | // from from the mat input "columns" | |
| 647 | break; | |
| 648 | ||
| 649 | ||
| 650 | case 0x07: // Mahjong Panel | |
| 651 | if (data & 0xf8) | |
| 652 | logerror("Error: Mahjong panel read with mux data %02x\n", (data & 0xfe)); | |
| 653 | else | |
| 654 | m_mjpanel_latch = m_io_mahjong[(data & 0xfe) >> 1]->read(); | |
| 655 | break; | |
| 656 | } | |
| 657 | ||
| 180 | 658 | } |
| 181 | 659 | |
| 182 | 660 | |
| 661 | void nes_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) | |
| 662 | { | |
| 663 | switch (id) | |
| 664 | { | |
| 665 | case TIMER_ZAPPER_TICK: | |
| 666 | if ((m_io_ctrlsel->read() & 0x000f) == 0x0002) | |
| 667 | { | |
| 668 | /* enable lightpen crosshair */ | |
| 669 | crosshair_set_screen(machine(), 0, CROSSHAIR_SCREEN_ALL); | |
| 670 | } | |
| 671 | else | |
| 672 | { | |
| 673 | /* disable lightpen crosshair */ | |
| 674 | crosshair_set_screen(machine(), 0, CROSSHAIR_SCREEN_NONE); | |
| 675 | } | |
| 676 | ||
| 677 | if ((m_io_ctrlsel->read() & 0x00f0) == 0x0020) | |
| 678 | { | |
| 679 | /* enable lightpen crosshair */ | |
| 680 | crosshair_set_screen(machine(), 1, CROSSHAIR_SCREEN_ALL); | |
| 681 | } | |
| 682 | else | |
| 683 | { | |
| 684 | /* disable lightpen crosshair */ | |
| 685 | crosshair_set_screen(machine(), 1, CROSSHAIR_SCREEN_NONE); | |
| 686 | } | |
| 687 | break; | |
| 688 | case TIMER_LIGHTGUN_TICK: | |
| 689 | if ((m_io_exp->read() & 0x0f) == 0x01) | |
| 690 | { | |
| 691 | /* enable lightpen crosshair */ | |
| 692 | crosshair_set_screen(machine(), 0, CROSSHAIR_SCREEN_ALL); | |
| 693 | } | |
| 694 | else | |
| 695 | { | |
| 696 | /* disable lightpen crosshair */ | |
| 697 | crosshair_set_screen(machine(), 0, CROSSHAIR_SCREEN_NONE); | |
| 698 | } | |
| 699 | break; | |
| 700 | default: | |
| 701 | assert_always(FALSE, "Unknown id in nes_state::device_timer"); | |
| 702 | } | |
| 703 | } | |
| 704 | ||
| 705 | ||
| 183 | 706 | DRIVER_INIT_MEMBER(nes_state,famicom) |
| 184 | 707 | { |
| 185 | 708 | // setup alt input handlers for additional FC input devices |
| r243192 | r243193 | |
| 188 | 711 | space.install_write_handler(0x4016, 0x4016, write8_delegate(FUNC(nes_state::fc_in0_w), this)); |
| 189 | 712 | space.install_read_handler(0x4017, 0x4017, read8_delegate(FUNC(nes_state::fc_in1_r), this)); |
| 190 | 713 | } |
| 191 | ||
| 192 | NESCTRL_BRIGHTPIXEL_CB(nes_state::bright_pixel) | |
| 193 | { | |
| 194 | // get the pixel at the gun position | |
| 195 | UINT32 pix = m_ppu->get_pixel(x, y); | |
| 196 | ||
| 197 | // get the color base from the ppu | |
| 198 | UINT32 color_base = m_ppu->get_colorbase(); | |
| 199 | ||
| 200 | // check if the cursor is over a bright pixel | |
| 201 | if ((pix == color_base + 0x20) || (pix == color_base + 0x30) || | |
| 202 | (pix == color_base + 0x33) || (pix == color_base + 0x34)) | |
| 203 | return true; | |
| 204 | else | |
| 205 | return false; | |
| 206 | } |
| r243192 | r243193 | |
|---|---|---|
| 94 | 94 | data1 = m_port_gg_dc->read(); |
| 95 | 95 | m_port_dc_reg &= ~0x03f | data1; |
| 96 | 96 | |
| 97 | data2 = m_port_gg | |
| 97 | data2 = m_port_gear2gear->port_r(); | |
| 98 | 98 | } |
| 99 | 99 | else |
| 100 | 100 | { |
| r243192 | r243193 | |
| 207 | 207 | if (!m_is_gamegear) |
| 208 | 208 | m_port_ctrl2->port_w(ctrl2_port_data); |
| 209 | 209 | else |
| 210 | m_port_gg | |
| 210 | m_port_gear2gear->port_w(ctrl2_port_data); // not verified | |
| 211 | 211 | } |
| 212 | 212 | // check if TH is set to input (1). |
| 213 | 213 | if (data & 0x08) |
| r243192 | r243193 | |
| 215 | 215 | if (!m_is_gamegear) |
| 216 | 216 | ctrl2_port_data &= ~0x40 | m_port_ctrl2->port_r(); |
| 217 | 217 | else |
| 218 | ctrl2_port_data &= ~0x40 | m_port_gg | |
| 218 | ctrl2_port_data &= ~0x40 | m_port_gear2gear->port_r(); // not verified | |
| 219 | 219 | |
| 220 | 220 | // check if TH input level is high (1) and was output/low (0) |
| 221 | 221 | if ((ctrl2_port_data & 0x40) && !(m_io_ctrl_reg & 0x88)) |
| r243192 | r243193 | |
|---|---|---|
| 54 | 54 | jaguar // Atari Jaguar |
| 55 | 55 | jaguarcd // Atari Jaguar CD |
| 56 | 56 | |
| 57 | //BancTec | |
| 58 | banctec // BancTec ESeries panel | |
| 59 | ||
| 60 | 57 | // Nintendo |
| 61 | 58 | nes // Nintendo Entertainment System |
| 62 | 59 | nespal // Nintendo Entertainment System PAL |
| r243192 | r243193 | |
| 774 | 771 | compc1 // 1984 Commodore PC-1 |
| 775 | 772 | pc10iii // 1987 Commodore PC-10 III |
| 776 | 773 | pc7000 // 1985 Sharp PC-7000 |
| 774 | pcd // Siemens PC-D | |
| 777 | 775 | olypeopl // Olympia People PC |
| 778 | 776 | sx16 // Sanyo SX-16 |
| 779 | 777 | mbc16 // Sanyo MBC-16 |
| 780 | 778 | ataripc3 |
| 781 | 779 | ssam88s |
| 782 | 780 | |
| 783 | // Non-PC msdos | |
| 784 | pcd // Siemens PC-D | |
| 785 | slicer // 1983 Slicer Computers | |
| 786 | ||
| 787 | 781 | // PC Junior |
| 788 | 782 | ibmpcjr // 1984 IBM PC Jr |
| 789 | 783 | ibmpcjx // 1985 IBM PC JX |
| r243192 | r243193 | |
|---|---|---|
| 614 | 614 | BUSES += MSX_SLOT |
| 615 | 615 | BUSES += NEOGEO |
| 616 | 616 | BUSES += NES |
| 617 | BUSES += NES_CTRL | |
| 618 | 617 | BUSES += NUBUS |
| 619 | 618 | BUSES += O2 |
| 620 | 619 | BUSES += ORICEXT |
| r243192 | r243193 | |
| 679 | 678 | $(MESSOBJ)/att.a \ |
| 680 | 679 | $(MESSOBJ)/bally.a \ |
| 681 | 680 | $(MESSOBJ)/bandai.a \ |
| 682 | $(MESSOBJ)/banctec.a \ | |
| 683 | 681 | $(MESSOBJ)/be.a \ |
| 684 | 682 | $(MESSOBJ)/bnpo.a \ |
| 685 | 683 | $(MESSOBJ)/bondwell.a \ |
| r243192 | r243193 | |
| 798 | 796 | $(MESSOBJ)/siemens.a \ |
| 799 | 797 | $(MESSOBJ)/sinclair.a \ |
| 800 | 798 | $(MESSOBJ)/skeleton.a \ |
| 801 | $(MESSOBJ)/slicer.a \ | |
| 802 | 799 | $(MESSOBJ)/snk.a \ |
| 803 | 800 | $(MESSOBJ)/sony.a \ |
| 804 | 801 | $(MESSOBJ)/sord.a \ |
| r243192 | r243193 | |
| 1043 | 1040 | $(MESSOBJ)/bally.a: \ |
| 1044 | 1041 | $(MESS_DRIVERS)/astrocde.o \ |
| 1045 | 1042 | |
| 1046 | $(MESSOBJ)/banctec.a: \ | |
| 1047 | $(MESS_DRIVERS)/banctec.o \ | |
| 1048 | ||
| 1049 | 1043 | $(MESSOBJ)/bandai.a: \ |
| 1050 | 1044 | $(MESS_DRIVERS)/sv8000.o \ |
| 1051 | 1045 | $(MESS_DRIVERS)/rx78.o \ |
| r243192 | r243193 | |
| 1654 | 1648 | $(MESSOBJ)/siemens.a: \ |
| 1655 | 1649 | $(MESS_DRIVERS)/pcd.o \ |
| 1656 | 1650 | |
| 1657 | $(MESSOBJ)/slicer.a: \ | |
| 1658 | $(MESS_DRIVERS)/slicer.o \ | |
| 1659 | ||
| 1660 | 1651 | $(MESSOBJ)/snk.a: \ |
| 1661 | 1652 | $(MESS_DRIVERS)/ng_aes.o \ |
| 1662 | 1653 | $(MESS_DRIVERS)/ngp.o $(MESS_VIDEO)/k1ge.o \ |
| r243192 | r243193 | |
|---|---|---|
| 1 | /* | |
| 2 | * debug_module.h | |
| 3 | * | |
| 4 | */ | |
| 5 | ||
| 6 | #ifndef DEBUG_MODULE_H_ | |
| 7 | #define DEBUG_MODULE_H_ | |
| 8 | ||
| 9 | #include "osdepend.h" | |
| 10 | #include "modules/osdmodule.h" | |
| 11 | #include "emu.h" | |
| 12 | ||
| 13 | //============================================================ | |
| 14 | // CONSTANTS | |
| 15 | //============================================================ | |
| 16 | ||
| 17 | #define OSD_DEBUG_PROVIDER "debugger" | |
| 18 | ||
| 19 | class debug_module | |
| 20 | { | |
| 21 | public: | |
| 22 | ||
| 23 | virtual ~debug_module() { } | |
| 24 | ||
| 25 | virtual void init_debugger(running_machine &machine) = 0; | |
| 26 | virtual void wait_for_debugger(device_t &device, bool firststop) = 0; | |
| 27 | virtual void debugger_update() = 0; | |
| 28 | }; | |
| 29 | ||
| 30 | ||
| 31 | ||
| 32 | #endif /* DEBUG_MODULE_H_ */ |
| r243192 | r243193 | |
|---|---|---|
| 10 | 10 | *********************************************************************/ |
| 11 | 11 | |
| 12 | 12 | #include "emu.h" |
| 13 | #include "debugint.h" | |
| 13 | 14 | #include "ui/ui.h" |
| 14 | 15 | #include "rendfont.h" |
| 15 | 16 | #include "uiinput.h" |
| r243192 | r243193 | |
| 21 | 22 | #include "debug/debugcon.h" |
| 22 | 23 | #include "debug/debugcpu.h" |
| 23 | 24 | |
| 24 | #include "debug_module.h" | |
| 25 | #include "modules/osdmodule.h" | |
| 26 | 25 | |
| 27 | class debug_internal : public osd_module, public debug_module | |
| 28 | { | |
| 29 | public: | |
| 30 | debug_internal() | |
| 31 | : osd_module(OSD_DEBUG_PROVIDER, "internal"), debug_module(), | |
| 32 | m_machine(NULL) | |
| 33 | { | |
| 34 | } | |
| 35 | ||
| 36 | virtual ~debug_internal() { } | |
| 37 | ||
| 38 | virtual int init() { return 0;} | |
| 39 | virtual void exit(); | |
| 40 | ||
| 41 | virtual void init_debugger(running_machine &machine); | |
| 42 | virtual void wait_for_debugger(device_t &device, bool firststop); | |
| 43 | virtual void debugger_update(); | |
| 44 | ||
| 45 | private: | |
| 46 | running_machine *m_machine; | |
| 47 | }; | |
| 48 | ||
| 49 | ||
| 50 | ||
| 51 | 26 | /*************************************************************************** |
| 52 | 27 | CONSTANTS |
| 53 | 28 | ***************************************************************************/ |
| 54 | 29 | |
| 30 | const osd_debugger_type OSD_DEBUGGER_INTERNAL = &osd_debugger_creator<debugger_internal>; | |
| 31 | ||
| 55 | 32 | #define BORDER_YTHICKNESS 1 |
| 56 | 33 | #define BORDER_XTHICKNESS 1 |
| 57 | 34 | #define HSB_HEIGHT 20 |
| r243192 | r243193 | |
| 262 | 239 | LOCAL VARIABLES |
| 263 | 240 | ***************************************************************************/ |
| 264 | 241 | |
| 265 | static render_font * debug_font | |
| 242 | static render_font * debug_font; | |
| 266 | 243 | static int debug_font_width; |
| 267 | 244 | static int debug_font_height; |
| 268 | 245 | static float debug_font_aspect; |
| 269 | static DView * list | |
| 246 | static DView * list; | |
| 270 | 247 | static DView * focus_view; |
| 271 | 248 | |
| 272 | 249 | static ui_menu * menu; |
| r243192 | r243193 | |
| 864 | 841 | #endif |
| 865 | 842 | } |
| 866 | 843 | |
| 867 | void debug_internal::exit() | |
| 844 | void debugger_internal::debugger_exit() | |
| 868 | 845 | { |
| 869 | 846 | for (DView *ndv = list; ndv != NULL; ) |
| 870 | 847 | { |
| r243192 | r243193 | |
| 881 | 858 | global_free(menu); |
| 882 | 859 | } |
| 883 | 860 | |
| 884 | void debug_internal::init_debugger(running_machine &machine) | |
| 861 | void debugger_internal::init_debugger(running_machine &machine) | |
| 885 | 862 | { |
| 886 | 863 | unicode_char ch; |
| 887 | 864 | int chw; |
| r243192 | r243193 | |
| 1433 | 1410 | } |
| 1434 | 1411 | |
| 1435 | 1412 | |
| 1436 | void debug_internal::wait_for_debugger(device_t &device, bool firststop) | |
| 1413 | void debugger_internal::wait_for_debugger(device_t &device, bool firststop) | |
| 1437 | 1414 | { |
| 1438 | 1415 | if (firststop && list == NULL) |
| 1439 | 1416 | { |
| r243192 | r243193 | |
| 1466 | 1443 | |
| 1467 | 1444 | } |
| 1468 | 1445 | |
| 1469 | void debug_internal::debugger_update() | |
| 1446 | void debugger_internal::debugger_update() | |
| 1470 | 1447 | { |
| 1471 | if ( | |
| 1448 | if (!debug_cpu_is_stopped(*m_machine) && m_machine->phase() == MACHINE_PHASE_RUNNING) | |
| 1472 | 1449 | { |
| 1473 | 1450 | update_views(); |
| 1474 | 1451 | } |
| 1475 | 1452 | } |
| 1476 | 1453 | |
| 1477 | MODULE_DEFINITION(DEBUG_INTERNAL, debug_internal) | |
| 1454 | //------------------------------------------------- | |
| 1455 | // debugger_internal - constructor | |
| 1456 | //------------------------------------------------- | |
| 1457 | debugger_internal::debugger_internal(const osd_interface &osd) | |
| 1458 | : osd_debugger_interface(osd), m_machine(NULL) | |
| 1459 | { | |
| 1460 | } |
| r0 | r243193 | |
|---|---|---|
| 1 | /********************************************************************* | |
| 2 | ||
| 3 | debugint.c | |
| 4 | ||
| 5 | Internal debugger frontend using render interface. | |
| 6 | ||
| 7 | Copyright Nicola Salmoria and the MAME Team. | |
| 8 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 9 | ||
| 10 | *********************************************************************/ | |
| 11 | ||
| 12 | #pragma once | |
| 13 | ||
| 14 | #ifndef __DEBUGGER_INTERNAL_H__ | |
| 15 | #define __DEBUGGER_INTERNAL_H__ | |
| 16 | ||
| 17 | #include "osdepend.h" | |
| 18 | #include "modules/lib/osdobj_common.h" | |
| 19 | ||
| 20 | class debugger_internal : public osd_debugger_interface | |
| 21 | { | |
| 22 | public: | |
| 23 | // construction/destruction | |
| 24 | debugger_internal(const osd_interface &osd); | |
| 25 | virtual ~debugger_internal() { } | |
| 26 | ||
| 27 | virtual void init_debugger(running_machine &machine); | |
| 28 | virtual void wait_for_debugger(device_t &device, bool firststop); | |
| 29 | virtual void debugger_update(); | |
| 30 | virtual void debugger_exit(); | |
| 31 | private: | |
| 32 | running_machine *m_machine; | |
| 33 | }; | |
| 34 | ||
| 35 | extern const osd_debugger_type OSD_DEBUGGER_INTERNAL; | |
| 36 | ||
| 37 | #endif /* __DEBUGGER_INTERNAL_H__ */ |
| r243192 | r243193 | |
|---|---|---|
| 367 | 367 | |
| 368 | 368 | #endif // __OBJC__ |
| 369 | 369 | |
| 370 | class debugger_osx : public osd_debugger_interface | |
| 371 | { | |
| 372 | public: | |
| 373 | // construction/destruction | |
| 374 | debugger_osx(const osd_interface &osd); | |
| 375 | virtual ~debugger_osx() { } | |
| 376 | ||
| 377 | virtual void init_debugger(running_machine &machine); | |
| 378 | virtual void wait_for_debugger(device_t &device, bool firststop); | |
| 379 | virtual void debugger_update(); | |
| 380 | virtual void debugger_exit(); | |
| 381 | private: | |
| 382 | running_machine *m_machine; | |
| 383 | }; | |
| 384 | ||
| 385 | extern const osd_debugger_type OSD_DEBUGGER_OSX; | |
| 386 | ||
| 387 | ||
| 370 | 388 | #endif // __SDL_DEBUGOSX__ |
| r243192 | r243193 | |
|---|---|---|
| 42 | 42 | // MAMEOS headers |
| 43 | 43 | #include "debugosx.h" |
| 44 | 44 | #include "osdsdl.h" |
| 45 | #include "debug_module.h" | |
| 46 | 45 | |
| 47 | //============================================================ | |
| 48 | // MODULE SUPPORT | |
| 49 | //============================================================ | |
| 50 | 46 | |
| 51 | static MAMEDebugConsole *main_console = nil; | |
| 52 | 47 | |
| 53 | class debugger_osx : public osd_module, public debug_module | |
| 54 | { | |
| 55 | public: | |
| 56 | debugger_osx() | |
| 57 | : osd_module(OSD_DEBUG_PROVIDER, "osx"), debug_module(), | |
| 58 | m_machine(NULL) | |
| 59 | { | |
| 60 | } | |
| 61 | ||
| 62 | virtual ~debugger_osx() { } | |
| 63 | ||
| 64 | virtual int init() { return 0;} | |
| 65 | virtual void exit() | |
| 66 | { | |
| 67 | } | |
| 68 | ||
| 69 | virtual void init_debugger(running_machine &machine); | |
| 70 | virtual void wait_for_debugger(device_t &device, bool firststop); | |
| 71 | virtual void debugger_update(); | |
| 72 | ||
| 73 | private: | |
| 74 | running_machine *m_machine; | |
| 75 | }; | |
| 76 | ||
| 77 | MODULE_DEFINITION(DEBUG_OSX, debugger_osx) | |
| 78 | ||
| 79 | 48 | //============================================================ |
| 80 | 49 | // LOCAL VARIABLES |
| 81 | 50 | //============================================================ |
| 82 | 51 | |
| 52 | static MAMEDebugConsole *main_console = nil; | |
| 83 | 53 | |
| 84 | 54 | static BOOL waiting_for_debugger = NO; |
| 85 | 55 | |
| r243192 | r243193 | |
| 97 | 67 | |
| 98 | 68 | static void console_create_window(running_machine &machine); |
| 99 | 69 | |
| 70 | const osd_debugger_type OSD_DEBUGGER_OSX = &osd_debugger_creator<debugger_osx>; | |
| 71 | ||
| 72 | //------------------------------------------------- | |
| 73 | // debugger_osx - constructor | |
| 74 | //------------------------------------------------- | |
| 75 | debugger_osx::debugger_osx(const osd_interface &osd) | |
| 76 | : osd_debugger_interface(osd), m_machine(NULL) | |
| 77 | { | |
| 78 | } | |
| 79 | ||
| 100 | 80 | //============================================================ |
| 101 | 81 | // debugger_osx::init_debugger |
| 102 | 82 | //============================================================ |
| r243192 | r243193 | |
| 151 | 131 | } |
| 152 | 132 | |
| 153 | 133 | //============================================================ |
| 134 | // debugger_exit | |
| 135 | //============================================================ | |
| 136 | ||
| 137 | void debugger_osx::debugger_exit() | |
| 138 | { | |
| 139 | } | |
| 140 | ||
| 141 | //============================================================ | |
| 154 | 142 | // debugwin_view_update |
| 155 | 143 | //============================================================ |
| 156 | 144 |
| r243192 | r243193 | |
|---|---|---|
| 11 | 11 | |
| 12 | 12 | #define NO_MEM_TRACKING |
| 13 | 13 | |
| 14 | #include "debug_module.h" | |
| 15 | #include "modules/osdmodule.h" | |
| 16 | ||
| 17 | #if (USE_QTDEBUG) | |
| 18 | ||
| 19 | 14 | #include <vector> |
| 20 | 15 | |
| 21 | 16 | #include <QtGui/QtGui> |
| r243192 | r243193 | |
| 33 | 28 | #include "qt/debugqtbreakpointswindow.h" |
| 34 | 29 | #include "qt/debugqtdeviceswindow.h" |
| 35 | 30 | #include "qt/debugqtdeviceinformationwindow.h" |
| 31 | #include "debugqt.h" | |
| 36 | 32 | |
| 37 | class debug_qt : public osd_module, public debug_module | |
| 33 | ||
| 34 | osd_debugger_interface *qt_osd_debugger_creator(const osd_interface &osd) | |
| 38 | 35 | { |
| 39 | public: | |
| 40 | debug_qt() | |
| 41 | : osd_module(OSD_DEBUG_PROVIDER, "qt"), debug_module(), | |
| 42 | m_machine(NULL) | |
| 43 | { | |
| 44 | } | |
| 36 | return new debugger_qt(osd); | |
| 37 | } | |
| 38 | const osd_debugger_type OSD_DEBUGGER_QT = &qt_osd_debugger_creator; | |
| 45 | 39 | |
| 46 | virtual ~debug_qt() { } | |
| 47 | ||
| 48 | virtual int init() { return 0;} | |
| 49 | virtual void exit() { } | |
| 50 | ||
| 51 | virtual void init_debugger(running_machine &machine); | |
| 52 | virtual void wait_for_debugger(device_t &device, bool firststop); | |
| 53 | virtual void debugger_update(); | |
| 54 | ||
| 55 | private: | |
| 56 | running_machine *m_machine; | |
| 57 | }; | |
| 58 | ||
| 59 | 40 | //============================================================ |
| 60 | 41 | // "Global" variables to make QT happy |
| 61 | 42 | //============================================================ |
| r243192 | r243193 | |
| 66 | 47 | bool oneShot = true; |
| 67 | 48 | static MainWindow* mainQtWindow = NULL; |
| 68 | 49 | |
| 50 | //------------------------------------------------- | |
| 51 | // debugger_qt - constructor | |
| 52 | //------------------------------------------------- | |
| 53 | debugger_qt::debugger_qt(const osd_interface &osd) | |
| 54 | : osd_debugger_interface(osd), m_machine(NULL) | |
| 55 | { | |
| 56 | } | |
| 57 | ||
| 58 | debugger_qt::~debugger_qt() | |
| 59 | { | |
| 60 | } | |
| 61 | ||
| 69 | 62 | //============================================================ |
| 70 | 63 | // XML configuration save/load |
| 71 | 64 | //============================================================ |
| r243192 | r243193 | |
| 235 | 228 | bool winwindow_qt_filter(void *message); |
| 236 | 229 | #endif |
| 237 | 230 | |
| 238 | void debug_qt::init_debugger(running_machine &machine) | |
| 231 | void debugger_qt::init_debugger(running_machine &machine) | |
| 239 | 232 | { |
| 240 | 233 | if (qApp == NULL) |
| 241 | 234 | { |
| r243192 | r243193 | |
| 276 | 269 | void winwindow_update_cursor_state(running_machine &machine); |
| 277 | 270 | #endif |
| 278 | 271 | |
| 279 | void debug_qt::wait_for_debugger(device_t &device, bool firststop) | |
| 272 | void debugger_qt::wait_for_debugger(device_t &device, bool firststop) | |
| 280 | 273 | { |
| 281 | 274 | #if defined(SDLMAME_UNIX) || defined(SDLMAME_WIN32) |
| 282 | 275 | sdl_entered_debugger = 1; |
| r243192 | r243193 | |
| 351 | 344 | // Available for video.* |
| 352 | 345 | //============================================================ |
| 353 | 346 | |
| 354 | void debug_qt::debugger_update() | |
| 347 | void debugger_qt::debugger_update() | |
| 355 | 348 | { |
| 356 | 349 | qApp->processEvents(QEventLoop::AllEvents, 1); |
| 357 | 350 | } |
| 358 | 351 | |
| 359 | #else /* SDLMAME_UNIX */ | |
| 360 | MODULE_NOT_SUPPORTED(debug_qt, OSD_DEBUG_PROVIDER, "qt") | |
| 361 | #endif | |
| 362 | ||
| 363 | MODULE_DEFINITION(DEBUG_QT, debug_qt) | |
| 352 | void debugger_qt::debugger_exit() | |
| 353 | { | |
| 354 | } |
| r0 | r243193 | |
|---|---|---|
| 1 | //============================================================ | |
| 2 | // | |
| 3 | // debugqt.h - SDL/QT debug window handling | |
| 4 | // | |
| 5 | // Copyright (c) 1996-2010, Nicola Salmoria and the MAME Team. | |
| 6 | // Visit http://mamedev.org for licensing and usage restrictions. | |
| 7 | // | |
| 8 | // SDLMAME by Olivier Galibert and R. Belmont | |
| 9 | // | |
| 10 | //============================================================ | |
| 11 | ||
| 12 | #pragma once | |
| 13 | ||
| 14 | #ifndef __DEBUGGER_QT_H__ | |
| 15 | #define __DEBUGGER_QT_H__ | |
| 16 | ||
| 17 | #include "emu.h" | |
| 18 | ||
| 19 | class debugger_qt : public osd_debugger_interface | |
| 20 | { | |
| 21 | public: | |
| 22 | // construction/destruction | |
| 23 | debugger_qt(const osd_interface &osd); | |
| 24 | virtual ~debugger_qt(); | |
| 25 | ||
| 26 | virtual void init_debugger(running_machine &machine); | |
| 27 | virtual void wait_for_debugger(device_t &device, bool firststop); | |
| 28 | virtual void debugger_update(); | |
| 29 | virtual void debugger_exit(); | |
| 30 | ||
| 31 | private: | |
| 32 | running_machine *m_machine; | |
| 33 | }; | |
| 34 | ||
| 35 | extern const osd_debugger_type OSD_DEBUGGER_QT; | |
| 36 | ||
| 37 | #endif /* __DEBUGGER_QT_H__ */ |
| r243192 | r243193 | |
|---|---|---|
| 6 | 6 | // |
| 7 | 7 | //============================================================ |
| 8 | 8 | |
| 9 | #include "debug_module.h" | |
| 10 | #include "modules/osdmodule.h" | |
| 11 | ||
| 12 | #if defined(OSD_WINDOWS) /*|| defined(SDLMAME_WIN32)*/ | |
| 13 | ||
| 14 | 9 | // standard windows headers |
| 15 | 10 | #define WIN32_LEAN_AND_MEAN |
| 16 | 11 | #include <windows.h> |
| r243192 | r243193 | |
| 41 | 36 | #include "strconv.h" |
| 42 | 37 | #include "winutf8.h" |
| 43 | 38 | |
| 44 | class debugger_windows : public osd_module, public debug_module | |
| 45 | { | |
| 46 | public: | |
| 47 | debugger_windows() | |
| 48 | : osd_module(OSD_DEBUG_PROVIDER, "windows"), debug_module(), | |
| 49 | m_machine(NULL) | |
| 50 | { | |
| 51 | } | |
| 39 | #include "debugwin.h" | |
| 52 | 40 | |
| 53 | ||
| 41 | const osd_debugger_type OSD_DEBUGGER_WINDOWS = &osd_debugger_creator<debugger_windows>; | |
| 54 | 42 | |
| 55 | virtual int init() { return 0;} | |
| 56 | virtual void exit(); | |
| 57 | ||
| 58 | virtual void init_debugger(running_machine &machine); | |
| 59 | virtual void wait_for_debugger(device_t &device, bool firststop); | |
| 60 | virtual void debugger_update(); | |
| 61 | ||
| 62 | private: | |
| 63 | running_machine *m_machine; | |
| 64 | }; | |
| 65 | 43 | //============================================================ |
| 66 | 44 | // PARAMETERS |
| 67 | 45 | //============================================================ |
| r243192 | r243193 | |
| 196 | 174 | // LOCAL VARIABLES |
| 197 | 175 | //============================================================ |
| 198 | 176 | |
| 199 | static debugwin_info *window_list | |
| 177 | static debugwin_info *window_list; | |
| 200 | 178 | static debugwin_info *main_console; |
| 201 | 179 | static UINT32 main_console_regwidth; |
| 202 | 180 | |
| r243192 | r243193 | |
| 261 | 239 | static void image_update_menu(debugwin_info *info); |
| 262 | 240 | |
| 263 | 241 | |
| 242 | //------------------------------------------------- | |
| 243 | // debugger_windows - constructor | |
| 244 | //------------------------------------------------- | |
| 245 | debugger_windows::debugger_windows(const osd_interface &osd) | |
| 246 | : osd_debugger_interface(osd) | |
| 247 | { | |
| 248 | } | |
| 249 | ||
| 264 | 250 | //============================================================ |
| 265 | 251 | // wait_for_debugger |
| 266 | 252 | //============================================================ |
| r243192 | r243193 | |
| 467 | 453 | // debugwin_destroy_windows |
| 468 | 454 | //============================================================ |
| 469 | 455 | |
| 470 | void debugger_windows::exit() | |
| 456 | void debugger_windows::debugger_exit() | |
| 471 | 457 | { |
| 472 | 458 | // loop over windows and free them |
| 473 | 459 | while (window_list != NULL) |
| r243192 | r243193 | |
| 3093 | 3079 | for (info = window_list; info != NULL; info = info->next) |
| 3094 | 3080 | smart_show_window(info->wnd, show); |
| 3095 | 3081 | } |
| 3096 | #else /* not windows */ | |
| 3097 | MODULE_NOT_SUPPORTED(debugger_windows, OSD_DEBUG_PROVIDER, "windows") | |
| 3098 | #endif | |
| 3099 | ||
| 3100 | MODULE_DEFINITION(DEBUG_WINDOWS, debugger_windows) |
| r0 | r243193 | |
|---|---|---|
| 1 | // license:BSD-3-Clause | |
| 2 | // copyright-holders:Aaron Giles | |
| 3 | //============================================================ | |
| 4 | // | |
| 5 | // debugwin.h - Win32 debug window handling | |
| 6 | // | |
| 7 | //============================================================ | |
| 8 | ||
| 9 | ||
| 10 | #pragma once | |
| 11 | ||
| 12 | #ifndef __DEBUGGER_WINDOWS_H__ | |
| 13 | #define __DEBUGGER_WINDOWS_H__ | |
| 14 | ||
| 15 | #include "osdepend.h" | |
| 16 | #include "modules/lib/osdobj_common.h" | |
| 17 | ||
| 18 | class debugger_windows : public osd_debugger_interface | |
| 19 | { | |
| 20 | public: | |
| 21 | // construction/destruction | |
| 22 | debugger_windows(const osd_interface &osd); | |
| 23 | virtual ~debugger_windows() { } | |
| 24 | ||
| 25 | virtual void init_debugger(running_machine &machine); | |
| 26 | virtual void wait_for_debugger(device_t &device, bool firststop); | |
| 27 | virtual void debugger_update(); | |
| 28 | virtual void debugger_exit(); | |
| 29 | private: | |
| 30 | running_machine *m_machine; | |
| 31 | }; | |
| 32 | ||
| 33 | extern const osd_debugger_type OSD_DEBUGGER_WINDOWS; | |
| 34 | ||
| 35 | #endif /* __DEBUGGER_WINDOWS_H__ */ |
| r243192 | r243193 | |
|---|---|---|
| 4 | 4 | // |
| 5 | 5 | //============================================================ |
| 6 | 6 | |
| 7 | #include "debug_module.h" | |
| 8 | #include "modules/osdmodule.h" | |
| 9 | ||
| 7 | #include "none.h" | |
| 10 | 8 | #include "debug/debugcpu.h" |
| 11 | 9 | |
| 12 | class debug_none : public osd_module, public debug_module | |
| 10 | const osd_debugger_type OSD_DEBUGGER_NONE = &osd_debugger_creator<debugger_none>; | |
| 11 | ||
| 12 | //------------------------------------------------- | |
| 13 | // debugger_none - constructor | |
| 14 | //------------------------------------------------- | |
| 15 | debugger_none::debugger_none(const osd_interface &osd) | |
| 16 | : osd_debugger_interface(osd), m_machine(NULL) | |
| 13 | 17 | { |
| 14 | public: | |
| 15 | debug_none() | |
| 16 | : osd_module(OSD_DEBUG_PROVIDER, "none"), debug_module(), | |
| 17 | m_machine(NULL) | |
| 18 | { | |
| 19 | } | |
| 18 | } | |
| 20 | 19 | |
| 21 | virtual ~debug_none() { } | |
| 22 | ||
| 23 | virtual int init() { return 0;} | |
| 24 | virtual void exit() { } | |
| 25 | ||
| 26 | virtual void init_debugger(running_machine &machine); | |
| 27 | virtual void wait_for_debugger(device_t &device, bool firststop); | |
| 28 | virtual void debugger_update(); | |
| 29 | ||
| 30 | private: | |
| 31 | running_machine *m_machine; | |
| 32 | }; | |
| 33 | ||
| 34 | void debug_none::init_debugger(running_machine &machine) | |
| 20 | void debugger_none::init_debugger(running_machine &machine) | |
| 35 | 21 | { |
| 36 | ||
| 22 | m_machine = &machine; | |
| 37 | 23 | } |
| 38 | 24 | |
| 39 | void debug_none::wait_for_debugger(device_t &device, bool firststop) | |
| 25 | void debugger_none::wait_for_debugger(device_t &device, bool firststop) | |
| 40 | 26 | { |
| 41 | 27 | debug_cpu_get_visible_cpu(*m_machine)->debug()->go(); |
| 42 | 28 | } |
| 43 | 29 | |
| 44 | void debug_none::debugger_update() | |
| 30 | void debugger_none::debugger_update() | |
| 45 | 31 | { |
| 46 | 32 | } |
| 47 | 33 | |
| 48 | MODULE_DEFINITION(DEBUG_NONE, debug_none) | |
| 34 | void debugger_none::debugger_exit() | |
| 35 | { | |
| 36 | } |
| r0 | r243193 | |
|---|---|---|
| 1 | // license:BSD-3-Clause | |
| 2 | // copyright-holders:Miodrag Milanovic | |
| 3 | /*************************************************************************** | |
| 4 | ||
| 5 | none.h | |
| 6 | ||
| 7 | Dummy debugger interface. | |
| 8 | ||
| 9 | *******************************************************************c********/ | |
| 10 | ||
| 11 | #pragma once | |
| 12 | ||
| 13 | #ifndef __DEBUGGER_NONE_H__ | |
| 14 | #define __DEBUGGER_NONE_H__ | |
| 15 | ||
| 16 | #include "osdepend.h" | |
| 17 | #include "modules/lib/osdobj_common.h" | |
| 18 | ||
| 19 | class debugger_none : public osd_debugger_interface | |
| 20 | { | |
| 21 | public: | |
| 22 | // construction/destruction | |
| 23 | debugger_none(const osd_interface &osd); | |
| 24 | virtual ~debugger_none() { } | |
| 25 | ||
| 26 | virtual void init_debugger(running_machine &machine); | |
| 27 | virtual void wait_for_debugger(device_t &device, bool firststop); | |
| 28 | virtual void debugger_update(); | |
| 29 | virtual void debugger_exit(); | |
| 30 | private: | |
| 31 | running_machine *m_machine; | |
| 32 | }; | |
| 33 | ||
| 34 | extern const osd_debugger_type OSD_DEBUGGER_NONE; | |
| 35 | ||
| 36 | #endif /* __DEBUGGER_NONE_H__ */ |
| r243192 | r243193 | |
|---|---|---|
| 47 | 47 | void osd_process_kill(void); |
| 48 | 48 | |
| 49 | 49 | /*----------------------------------------------------------------------------- |
| 50 | osd_getenv: return pointer to environment variable | |
| 51 | ||
| 52 | Parameters: | |
| 53 | ||
| 54 | name - name of environment variable | |
| 55 | ||
| 56 | Return value: | |
| 57 | ||
| 58 | pointer to value | |
| 59 | -----------------------------------------------------------------------------*/ | |
| 60 | char *osd_getenv(const char *name); | |
| 61 | ||
| 62 | /*----------------------------------------------------------------------------- | |
| 50 | 63 | osd_setenv: set environment variable |
| 51 | 64 | |
| 52 | 65 | Parameters: |
| r243192 | r243193 | |
|---|---|---|
| 1 | //============================================================ | |
| 2 | // | |
| 3 | // sdlos_*.c - OS specific low level code | |
| 4 | // | |
| 5 | // Copyright (c) 1996-2010, Nicola Salmoria and the MAME Team. | |
| 6 | // Visit http://mamedev.org for licensing and usage restrictions. | |
| 7 | // | |
| 8 | // SDLMAME by Olivier Galibert and R. Belmont | |
| 9 | // | |
| 10 | //============================================================ | |
| 1 | // This file is a placeholder. | |
| 11 | 2 | |
| 12 | #include <stdlib.h> | |
| 13 | #include <unistd.h> | |
| 14 | #include <sys/mman.h> | |
| 15 | 3 | #include <sys/types.h> |
| 16 | 4 | #include <signal.h> |
| 5 | #include <unistd.h> | |
| 17 | 6 | |
| 18 | 7 | #include <mach/mach.h> |
| 19 | 8 | #include <mach/mach_time.h> |
| r243192 | r243193 | |
| 29 | 18 | #include "sdlinc.h" |
| 30 | 19 | |
| 31 | 20 | //============================================================ |
| 32 | // osd_getenv | |
| 33 | //============================================================ | |
| 34 | ||
| 35 | const char *osd_getenv(const char *name) | |
| 36 | { | |
| 37 | return getenv(name); | |
| 38 | } | |
| 39 | ||
| 40 | //============================================================ | |
| 41 | // osd_setenv | |
| 42 | //============================================================ | |
| 43 | ||
| 44 | int osd_setenv(const char *name, const char *value, int overwrite) | |
| 45 | { | |
| 46 | return setenv(name, value, overwrite); | |
| 47 | } | |
| 48 | ||
| 49 | //============================================================ | |
| 50 | 21 | // osd_process_kill |
| 51 | 22 | //============================================================ |
| 52 | 23 | |
| 53 | 24 | void osd_process_kill(void) |
| 54 | 25 | { |
| 55 | ||
| 26 | kill(getpid(), SIGKILL); | |
| 56 | 27 | } |
| 57 | 28 | |
| 58 | 29 | //============================================================ |
| r243192 | r243193 | |
| 61 | 32 | |
| 62 | 33 | int osd_get_num_processors(void) |
| 63 | 34 | { |
| 64 | ||
| 35 | int processors = 1; | |
| 65 | 36 | |
| 66 | struct host_basic_info host_basic_info; | |
| 67 | unsigned int count; | |
| 68 | kern_return_t r; | |
| 69 | mach_port_t my_mach_host_self; | |
| 37 | struct host_basic_info host_basic_info; | |
| 38 | unsigned int count; | |
| 39 | kern_return_t r; | |
| 40 | mach_port_t my_mach_host_self; | |
| 70 | 41 | |
| 71 | count = HOST_BASIC_INFO_COUNT; | |
| 72 | my_mach_host_self = mach_host_self(); | |
| 73 | if ( ( r = host_info(my_mach_host_self, HOST_BASIC_INFO, (host_info_t)(&host_basic_info), &count)) == KERN_SUCCESS ) | |
| 74 | { | |
| 75 | processors = host_basic_info.avail_cpus; | |
| 76 | } | |
| 77 | mach_port_deallocate(mach_task_self(), my_mach_host_self); | |
| 42 | count = HOST_BASIC_INFO_COUNT; | |
| 43 | my_mach_host_self = mach_host_self(); | |
| 44 | if ( ( r = host_info(my_mach_host_self, HOST_BASIC_INFO, (host_info_t)(&host_basic_info), &count)) == KERN_SUCCESS ) | |
| 45 | { | |
| 46 | processors = host_basic_info.avail_cpus; | |
| 47 | } | |
| 48 | mach_port_deallocate(mach_task_self(), my_mach_host_self); | |
| 78 | 49 | |
| 79 | ||
| 50 | return processors; | |
| 80 | 51 | } |
| 81 | 52 | |
| 82 | 53 | //============================================================ |
| r243192 | r243193 | |
| 86 | 57 | void *osd_malloc(size_t size) |
| 87 | 58 | { |
| 88 | 59 | #ifndef MALLOC_DEBUG |
| 89 | ||
| 60 | return malloc(size); | |
| 90 | 61 | #else |
| 91 | 62 | #error "MALLOC_DEBUG not yet supported" |
| 92 | 63 | #endif |
| r243192 | r243193 | |
| 100 | 71 | void *osd_malloc_array(size_t size) |
| 101 | 72 | { |
| 102 | 73 | #ifndef MALLOC_DEBUG |
| 103 | ||
| 74 | return malloc(size); | |
| 104 | 75 | #else |
| 105 | 76 | #error "MALLOC_DEBUG not yet supported" |
| 106 | 77 | #endif |
| r243192 | r243193 | |
| 114 | 85 | void osd_free(void *ptr) |
| 115 | 86 | { |
| 116 | 87 | #ifndef MALLOC_DEBUG |
| 117 | ||
| 88 | free(ptr); | |
| 118 | 89 | #else |
| 119 | 90 | #error "MALLOC_DEBUG not yet supported" |
| 120 | 91 | #endif |
| 121 | 92 | } |
| 122 | 93 | |
| 123 | ||
| 124 | 94 | //============================================================ |
| 125 | // osd_alloc_executable | |
| 126 | // | |
| 127 | // allocates "size" bytes of executable memory. this must take | |
| 128 | // things like NX support into account. | |
| 95 | // osd_getenv | |
| 129 | 96 | //============================================================ |
| 130 | 97 | |
| 131 | ||
| 98 | char *osd_getenv(const char *name) | |
| 132 | 99 | { |
| 133 | #if defined(SDLMAME_BSD) || defined(SDLMAME_MACOSX) | |
| 134 | return (void *)mmap(0, size, PROT_EXEC|PROT_READ|PROT_WRITE, MAP_ANON|MAP_SHARED, -1, 0); | |
| 135 | #elif defined(SDLMAME_UNIX) | |
| 136 | return (void *)mmap(0, size, PROT_EXEC|PROT_READ|PROT_WRITE, MAP_ANON|MAP_SHARED, 0, 0); | |
| 137 | #endif | |
| 100 | return getenv(name); | |
| 138 | 101 | } |
| 139 | 102 | |
| 140 | 103 | //============================================================ |
| 141 | // osd_free_executable | |
| 142 | // | |
| 143 | // frees memory allocated with osd_alloc_executable | |
| 104 | // osd_setenv | |
| 144 | 105 | //============================================================ |
| 145 | 106 | |
| 146 | ||
| 107 | int osd_setenv(const char *name, const char *value, int overwrite) | |
| 147 | 108 | { |
| 148 | #ifdef SDLMAME_SOLARIS | |
| 149 | munmap((char *)ptr, size); | |
| 150 | #else | |
| 151 | munmap(ptr, size); | |
| 152 | #endif | |
| 109 | return setenv(name, value, overwrite); | |
| 153 | 110 | } |
| 154 | 111 | |
| 155 | 112 | //============================================================ |
| 156 | // osd_break_into_debugger | |
| 157 | //============================================================ | |
| 158 | ||
| 159 | void osd_break_into_debugger(const char *message) | |
| 160 | { | |
| 161 | #ifdef MAME_DEBUG | |
| 162 | printf("MAME exception: %s\n", message); | |
| 163 | printf("Attempting to fall into debugger\n"); | |
| 164 | kill(getpid(), SIGTRAP); | |
| 165 | #else | |
| 166 | printf("Ignoring MAME exception: %s\n", message); | |
| 167 | #endif | |
| 168 | } | |
| 169 | ||
| 170 | ||
| 171 | //============================================================ | |
| 172 | 113 | // PROTOTYPES |
| 173 | 114 | //============================================================ |
| 174 | 115 | |
| r243192 | r243193 | |
| 191 | 132 | |
| 192 | 133 | static osd_ticks_t init_cycle_counter(void) |
| 193 | 134 | { |
| 194 | osd_ticks_t start, end; | |
| 195 | osd_ticks_t a, b; | |
| 135 | osd_ticks_t start, end; | |
| 136 | osd_ticks_t a, b; | |
| 196 | 137 | |
| 197 | cycle_counter = mach_cycle_counter; | |
| 198 | ticks_counter = mach_cycle_counter; | |
| 138 | cycle_counter = mach_cycle_counter; | |
| 139 | ticks_counter = mach_cycle_counter; | |
| 199 | 140 | |
| 200 | // wait for an edge on the timeGetTime call | |
| 201 | a = SDL_GetTicks(); | |
| 202 | do | |
| 203 | { | |
| 204 | b = SDL_GetTicks(); | |
| 205 | } while (a == b); | |
| 141 | // wait for an edge on the timeGetTime call | |
| 142 | a = SDL_GetTicks(); | |
| 143 | do | |
| 144 | { | |
| 145 | b = SDL_GetTicks(); | |
| 146 | } while (a == b); | |
| 206 | 147 | |
| 207 | // get the starting cycle count | |
| 208 | start = (*cycle_counter)(); | |
| 148 | // get the starting cycle count | |
| 149 | start = (*cycle_counter)(); | |
| 209 | 150 | |
| 210 | // now wait for 1/4 second total | |
| 211 | do | |
| 212 | { | |
| 213 | a = SDL_GetTicks(); | |
| 214 | } while (a - b < 250); | |
| 151 | // now wait for 1/4 second total | |
| 152 | do | |
| 153 | { | |
| 154 | a = SDL_GetTicks(); | |
| 155 | } while (a - b < 250); | |
| 215 | 156 | |
| 216 | // get the ending cycle count | |
| 217 | end = (*cycle_counter)(); | |
| 157 | // get the ending cycle count | |
| 158 | end = (*cycle_counter)(); | |
| 218 | 159 | |
| 219 | // compute ticks_per_sec | |
| 220 | ticks_per_second = (end - start) * 4; | |
| 160 | // compute ticks_per_sec | |
| 161 | ticks_per_second = (end - start) * 4; | |
| 221 | 162 | |
| 222 | // return the current cycle count | |
| 223 | return (*cycle_counter)(); | |
| 163 | // return the current cycle count | |
| 164 | return (*cycle_counter)(); | |
| 224 | 165 | } |
| 225 | 166 | |
| 226 | 167 | //============================================================ |
| r243192 | r243193 | |
| 232 | 173 | //============================================================ |
| 233 | 174 | static osd_ticks_t mach_cycle_counter(void) |
| 234 | 175 | { |
| 235 | ||
| 176 | return mach_absolute_time(); | |
| 236 | 177 | } |
| 237 | 178 | |
| 238 | 179 | //============================================================ |
| 239 | // osd_ | |
| 180 | // osd_cycles | |
| 240 | 181 | //============================================================ |
| 241 | 182 | |
| 242 | 183 | osd_ticks_t osd_ticks(void) |
| 243 | 184 | { |
| 244 | ||
| 185 | return (*cycle_counter)(); | |
| 245 | 186 | } |
| 246 | 187 | |
| 247 | 188 | |
| r243192 | r243193 | |
| 251 | 192 | |
| 252 | 193 | osd_ticks_t osd_ticks_per_second(void) |
| 253 | 194 | { |
| 254 | if (ticks_per_second == 0) | |
| 255 | { | |
| 256 | // if we haven't computed the value yet, there's no time like the present | |
| 257 | init_cycle_counter(); | |
| 258 | } | |
| 259 | return ticks_per_second; | |
| 195 | if (ticks_per_second == 0) | |
| 196 | { | |
| 197 | // if we haven't computed the value yet, there's no time like the present | |
| 198 | init_cycle_counter(); | |
| 199 | } | |
| 200 | return ticks_per_second; | |
| 260 | 201 | } |
| 261 | 202 | |
| 262 | 203 | |
| r243192 | r243193 | |
| 267 | 208 | |
| 268 | 209 | void osd_sleep(osd_ticks_t duration) |
| 269 | 210 | { |
| 270 | ||
| 211 | UINT32 msec; | |
| 271 | 212 | |
| 272 | // make sure we've computed ticks_per_second | |
| 273 | if (ticks_per_second == 0) | |
| 274 | (void)osd_ticks(); | |
| 213 | // make sure we've computed ticks_per_second | |
| 214 | if (ticks_per_second == 0) | |
| 215 | (void)osd_ticks(); | |
| 275 | 216 | |
| 276 | // convert to milliseconds, rounding down | |
| 277 | msec = (UINT32)(duration * 1000 / ticks_per_second); | |
| 217 | // convert to milliseconds, rounding down | |
| 218 | msec = (UINT32)(duration * 1000 / ticks_per_second); | |
| 278 | 219 | |
| 279 | // only sleep if at least 2 full milliseconds | |
| 280 | if (msec >= 2) | |
| 281 | { | |
| 282 | // take a couple of msecs off the top for good measure | |
| 283 | msec -= 2; | |
| 284 | usleep(msec*1000); | |
| 285 | } | |
| 220 | // only sleep if at least 2 full milliseconds | |
| 221 | if (msec >= 2) | |
| 222 | { | |
| 223 | // take a couple of msecs off the top for good measure | |
| 224 | msec -= 2; | |
| 225 | usleep(msec*1000); | |
| 226 | } | |
| 286 | 227 | } |
| 228 |
| r243192 | r243193 | |
|---|---|---|
| 1 | //============================================================ | |
| 2 | // | |
| 3 | // sdlos_*.c - OS specific low level code | |
| 4 | // | |
| 5 | // Copyright (c) 1996-2010, Nicola Salmoria and the MAME Team. | |
| 6 | // Visit http://mamedev.org for licensing and usage restrictions. | |
| 7 | // | |
| 8 | // SDLMAME by Olivier Galibert and R. Belmont | |
| 9 | // | |
| 10 | //============================================================ | |
| 1 | // This file is a placeholder. | |
| 11 | 2 | |
| 12 | // standard sdl header | |
| 13 | #include "sdlinc.h" | |
| 14 | #include <unistd.h> | |
| 15 | #include <stdio.h> | |
| 16 | #include <string.h> | |
| 17 | #include <ctype.h> | |
| 18 | #include <stdlib.h> | |
| 19 | #include <sys/stat.h> | |
| 20 | ||
| 21 | #define INCL_DOS | |
| 22 | #include <os2.h> | |
| 23 | ||
| 24 | 3 | // MAME headers |
| 25 | #include "osdcore.h" | |
| 26 | 4 | #include "osdlib.h" |
| 27 | ||
| 28 | //============================================================ | |
| 29 | // osd_getenv | |
| 30 | //============================================================ | |
| 31 | ||
| 32 | const char *osd_getenv(const char *name) | |
| 33 | { | |
| 34 | return getenv(name); | |
| 35 | } | |
| 36 | ||
| 37 | //============================================================ | |
| 38 | // osd_setenv | |
| 39 | //============================================================ | |
| 40 | ||
| 41 | int osd_setenv(const char *name, const char *value, int overwrite) | |
| 42 | { | |
| 43 | return setenv(name, value, overwrite); | |
| 44 | } | |
| 45 | ||
| 46 | //============================================================ | |
| 47 | // osd_process_kill | |
| 48 | //============================================================ | |
| 49 | ||
| 50 | void osd_process_kill(void) | |
| 51 | { | |
| 52 | fprintf(stderr,"osd_process_kill missing in OS/2 build\n"); | |
| 53 | } | |
| 54 | ||
| 55 | //============================================================ | |
| 56 | // osd_num_processors | |
| 57 | //============================================================ | |
| 58 | ||
| 59 | int osd_get_num_processors(void) | |
| 60 | { | |
| 61 | ULONG numprocs = 1; | |
| 62 | ||
| 63 | DosQuerySysInfo(QSV_NUMPROCESSORS, QSV_NUMPROCESSORS, &numprocs, sizeof(numprocs)); | |
| 64 | ||
| 65 | return numprocs; | |
| 66 | } | |
| 67 | ||
| 68 | //============================================================ | |
| 69 | // osd_malloc | |
| 70 | //============================================================ | |
| 71 | ||
| 72 | void *osd_malloc(size_t size) | |
| 73 | { | |
| 74 | #ifndef MALLOC_DEBUG | |
| 75 | return malloc(size); | |
| 76 | #else | |
| 77 | #error "MALLOC_DEBUG not yet supported" | |
| 78 | #endif | |
| 79 | } | |
| 80 | ||
| 81 | ||
| 82 | //============================================================ | |
| 83 | // osd_malloc_array | |
| 84 | //============================================================ | |
| 85 | ||
| 86 | void *osd_malloc_array(size_t size) | |
| 87 | { | |
| 88 | #ifndef MALLOC_DEBUG | |
| 89 | return malloc(size); | |
| 90 | #else | |
| 91 | #error "MALLOC_DEBUG not yet supported" | |
| 92 | #endif | |
| 93 | } | |
| 94 | ||
| 95 | ||
| 96 | //============================================================ | |
| 97 | // osd_free | |
| 98 | //============================================================ | |
| 99 | ||
| 100 | void osd_free(void *ptr) | |
| 101 | { | |
| 102 | #ifndef MALLOC_DEBUG | |
| 103 | free(ptr); | |
| 104 | #else | |
| 105 | #error "MALLOC_DEBUG not yet supported" | |
| 106 | #endif | |
| 107 | } | |
| 108 | ||
| 109 | ||
| 110 | //============================================================ | |
| 111 | // osd_alloc_executable | |
| 112 | // | |
| 113 | // allocates "size" bytes of executable memory. this must take | |
| 114 | // things like NX support into account. | |
| 115 | //============================================================ | |
| 116 | ||
| 117 | void *osd_alloc_executable(size_t size) | |
| 118 | { | |
| 119 | void *p; | |
| 120 | ||
| 121 | DosAllocMem( &p, size, fALLOC ); | |
| 122 | return p; | |
| 123 | } | |
| 124 | ||
| 125 | //============================================================ | |
| 126 | // osd_free_executable | |
| 127 | // | |
| 128 | // frees memory allocated with osd_alloc_executable | |
| 129 | //============================================================ | |
| 130 | ||
| 131 | void osd_free_executable(void *ptr, size_t size) | |
| 132 | { | |
| 133 | DosFreeMem( ptr ); | |
| 134 | } | |
| 135 | ||
| 136 | //============================================================ | |
| 137 | // osd_break_into_debugger | |
| 138 | //============================================================ | |
| 139 | ||
| 140 | void osd_break_into_debugger(const char *message) | |
| 141 | { | |
| 142 | printf("Ignoring MAME exception: %s\n", message); | |
| 143 | } | |
| 144 | ||
| 145 | //============================================================ | |
| 146 | // PROTOTYPES | |
| 147 | //============================================================ | |
| 148 | ||
| 149 | ||
| 150 | static osd_ticks_t init_cycle_counter(void); | |
| 151 | static osd_ticks_t performance_cycle_counter(void); | |
| 152 | ||
| 153 | //============================================================ | |
| 154 | // STATIC VARIABLES | |
| 155 | //============================================================ | |
| 156 | ||
| 157 | // global cycle_counter function and divider | |
| 158 | static osd_ticks_t (*cycle_counter)(void) = init_cycle_counter; | |
| 159 | static osd_ticks_t (*ticks_counter)(void) = init_cycle_counter; | |
| 160 | static osd_ticks_t ticks_per_second; | |
| 161 | ||
| 162 | //============================================================ | |
| 163 | // init_cycle_counter | |
| 164 | // | |
| 165 | // to avoid total grossness, this function is split by subarch | |
| 166 | //============================================================ | |
| 167 | ||
| 168 | static osd_ticks_t init_cycle_counter(void) | |
| 169 | { | |
| 170 | osd_ticks_t start, end; | |
| 171 | osd_ticks_t a, b; | |
| 172 | ||
| 173 | ULONG frequency; | |
| 174 | PTIB ptib; | |
| 175 | ULONG ulClass; | |
| 176 | ULONG ulDelta; | |
| 177 | ||
| 178 | DosGetInfoBlocks( &ptib, NULL ); | |
| 179 | ulClass = HIBYTE( ptib->tib_ptib2->tib2_ulpri ); | |
| 180 | ulDelta = LOBYTE( ptib->tib_ptib2->tib2_ulpri ); | |
| 181 | ||
| 182 | if ( DosTmrQueryFreq( &frequency ) == 0 ) | |
| 183 | { | |
| 184 | // use performance counter if available as it is constant | |
| 185 | cycle_counter = performance_cycle_counter; | |
| 186 | ticks_counter = performance_cycle_counter; | |
| 187 | ||
| 188 | ticks_per_second = frequency; | |
| 189 | ||
| 190 | // return the current cycle count | |
| 191 | return (*cycle_counter)(); | |
| 192 | } | |
| 193 | else | |
| 194 | { | |
| 195 | fprintf(stderr, "No Timer available!\n"); | |
| 196 | exit(-1); | |
| 197 | } | |
| 198 | ||
| 199 | // temporarily set our priority higher | |
| 200 | DosSetPriority( PRTYS_THREAD, PRTYC_TIMECRITICAL, PRTYD_MAXIMUM, 0 ); | |
| 201 | ||
| 202 | // wait for an edge on the timeGetTime call | |
| 203 | a = SDL_GetTicks(); | |
| 204 | do | |
| 205 | { | |
| 206 | b = SDL_GetTicks(); | |
| 207 | } while (a == b); | |
| 208 | ||
| 209 | // get the starting cycle count | |
| 210 | start = (*cycle_counter)(); | |
| 211 | ||
| 212 | // now wait for 1/4 second total | |
| 213 | do | |
| 214 | { | |
| 215 | a = SDL_GetTicks(); | |
| 216 | } while (a - b < 250); | |
| 217 | ||
| 218 | // get the ending cycle count | |
| 219 | end = (*cycle_counter)(); | |
| 220 | ||
| 221 | // compute ticks_per_sec | |
| 222 | ticks_per_second = (end - start) * 4; | |
| 223 | ||
| 224 | // restore our priority | |
| 225 | DosSetPriority( PRTYS_THREAD, ulClass, ulDelta, 0 ); | |
| 226 | ||
| 227 | // return the current cycle count | |
| 228 | return (*cycle_counter)(); | |
| 229 | } | |
| 230 | ||
| 231 | //============================================================ | |
| 232 | // performance_cycle_counter | |
| 233 | //============================================================ | |
| 234 | ||
| 235 | static osd_ticks_t performance_cycle_counter(void) | |
| 236 | { | |
| 237 | QWORD qwTime; | |
| 238 | ||
| 239 | DosTmrQueryTime( &qwTime ); | |
| 240 | return (osd_ticks_t)qwTime.ulLo; | |
| 241 | } | |
| 242 | ||
| 243 | //============================================================ | |
| 244 | // osd_ticks | |
| 245 | //============================================================ | |
| 246 | ||
| 247 | osd_ticks_t osd_ticks(void) | |
| 248 | { | |
| 249 | return (*cycle_counter)(); | |
| 250 | } | |
| 251 | ||
| 252 | ||
| 253 | //============================================================ | |
| 254 | // osd_ticks_per_second | |
| 255 | //============================================================ | |
| 256 | ||
| 257 | osd_ticks_t osd_ticks_per_second(void) | |
| 258 | { | |
| 259 | if (ticks_per_second == 0) | |
| 260 | { | |
| 261 | // if we haven't computed the value yet, there's no time like the present | |
| 262 | init_cycle_counter(); | |
| 263 | } | |
| 264 | return ticks_per_second; | |
| 265 | } | |
| 266 | ||
| 267 | ||
| 268 | //============================================================ | |
| 269 | // osd_sleep | |
| 270 | //============================================================ | |
| 271 | ||
| 272 | void osd_sleep(osd_ticks_t duration) | |
| 273 | { | |
| 274 | UINT32 msec; | |
| 275 | ||
| 276 | // make sure we've computed ticks_per_second | |
| 277 | if (ticks_per_second == 0) | |
| 278 | (void)osd_ticks(); | |
| 279 | ||
| 280 | // convert to milliseconds, rounding down | |
| 281 | msec = (UINT32)(duration * 1000 / ticks_per_second); | |
| 282 | ||
| 283 | // only sleep if at least 2 full milliseconds | |
| 284 | if (msec >= 2) | |
| 285 | { | |
| 286 | // take a couple of msecs off the top for good measure | |
| 287 | msec -= 2; | |
| 288 | usleep(msec*1000); | |
| 289 | } | |
| 290 | } |
| r243192 | r243193 | |
|---|---|---|
| 1 | //============================================================ | |
| 2 | // | |
| 3 | // sdlos_*.c - OS specific low level code | |
| 4 | // | |
| 5 | // Copyright (c) 1996-2010, Nicola Salmoria and the MAME Team. | |
| 6 | // Visit http://mamedev.org for licensing and usage restrictions. | |
| 7 | // | |
| 8 | // SDLMAME by Olivier Galibert and R. Belmont | |
| 9 | // | |
| 10 | //============================================================ | |
| 11 | 1 | |
| 12 | 2 | #include <stdlib.h> |
| 13 | 3 | #include <unistd.h> |
| r243192 | r243193 | |
| 28 | 18 | // osd_getenv |
| 29 | 19 | //============================================================ |
| 30 | 20 | |
| 31 | c | |
| 21 | char *osd_getenv(const char *name) | |
| 32 | 22 | { |
| 33 | ||
| 23 | return getenv(name); | |
| 34 | 24 | } |
| 35 | 25 | |
| 36 | 26 | //============================================================ |
| r243192 | r243193 | |
| 39 | 29 | |
| 40 | 30 | int osd_setenv(const char *name, const char *value, int overwrite) |
| 41 | 31 | { |
| 42 | ||
| 32 | return setenv(name, value, overwrite); | |
| 43 | 33 | } |
| 44 | 34 | |
| 45 | 35 | //============================================================ |
| 46 | // osd_process | |
| 36 | // osd_num_processors | |
| 47 | 37 | //============================================================ |
| 48 | 38 | |
| 49 | ||
| 39 | int osd_get_num_processors(void) | |
| 50 | 40 | { |
| 51 | kill(getpid(), SIGKILL); | |
| 41 | int processors = 1; | |
| 42 | ||
| 43 | #if defined(_SC_NPROCESSORS_ONLN) | |
| 44 | processors = sysconf(_SC_NPROCESSORS_ONLN); | |
| 45 | #endif | |
| 46 | return processors; | |
| 52 | 47 | } |
| 53 | 48 | |
| 54 | 49 | //============================================================ |
| 55 | // osd_ | |
| 50 | // osd_process_kill | |
| 56 | 51 | //============================================================ |
| 57 | 52 | |
| 58 | i | |
| 53 | void osd_process_kill(void) | |
| 59 | 54 | { |
| 60 | int processors = 1; | |
| 61 | ||
| 62 | #if defined(_SC_NPROCESSORS_ONLN) | |
| 63 | processors = sysconf(_SC_NPROCESSORS_ONLN); | |
| 64 | #endif | |
| 65 | return processors; | |
| 55 | kill(getpid(), SIGKILL); | |
| 66 | 56 | } |
| 67 | 57 | |
| 68 | 58 | //============================================================ |
| r243192 | r243193 | |
| 72 | 62 | void *osd_malloc(size_t size) |
| 73 | 63 | { |
| 74 | 64 | #ifndef MALLOC_DEBUG |
| 75 | ||
| 65 | return malloc(size); | |
| 76 | 66 | #else |
| 77 | 67 | #error "MALLOC_DEBUG not yet supported" |
| 78 | 68 | #endif |
| r243192 | r243193 | |
| 86 | 76 | void *osd_malloc_array(size_t size) |
| 87 | 77 | { |
| 88 | 78 | #ifndef MALLOC_DEBUG |
| 89 | ||
| 79 | return malloc(size); | |
| 90 | 80 | #else |
| 91 | 81 | #error "MALLOC_DEBUG not yet supported" |
| 92 | 82 | #endif |
| r243192 | r243193 | |
| 100 | 90 | void osd_free(void *ptr) |
| 101 | 91 | { |
| 102 | 92 | #ifndef MALLOC_DEBUG |
| 103 | ||
| 93 | free(ptr); | |
| 104 | 94 | #else |
| 105 | 95 | #error "MALLOC_DEBUG not yet supported" |
| 106 | 96 | #endif |
| 107 | 97 | } |
| 108 | 98 | |
| 109 | 99 | //============================================================ |
| 110 | // osd_alloc_executable | |
| 111 | // | |
| 112 | // allocates "size" bytes of executable memory. this must take | |
| 113 | // things like NX support into account. | |
| 100 | // osd_cycles | |
| 114 | 101 | //============================================================ |
| 115 | 102 | |
| 116 | void *osd_alloc_executable(size_t size) | |
| 117 | { | |
| 118 | #if defined(SDLMAME_BSD) || defined(SDLMAME_MACOSX) | |
| 119 | return (void *)mmap(0, size, PROT_EXEC|PROT_READ|PROT_WRITE, MAP_ANON|MAP_SHARED, -1, 0); | |
| 120 | #elif defined(SDLMAME_UNIX) | |
| 121 | return (void *)mmap(0, size, PROT_EXEC|PROT_READ|PROT_WRITE, MAP_ANON|MAP_SHARED, 0, 0); | |
| 122 | #endif | |
| 123 | } | |
| 124 | ||
| 125 | //============================================================ | |
| 126 | // osd_free_executable | |
| 127 | // | |
| 128 | // frees memory allocated with osd_alloc_executable | |
| 129 | //============================================================ | |
| 130 | ||
| 131 | void osd_free_executable(void *ptr, size_t size) | |
| 132 | { | |
| 133 | #ifdef SDLMAME_SOLARIS | |
| 134 | munmap((char *)ptr, size); | |
| 135 | #else | |
| 136 | munmap(ptr, size); | |
| 137 | #endif | |
| 138 | } | |
| 139 | ||
| 140 | //============================================================ | |
| 141 | // osd_break_into_debugger | |
| 142 | //============================================================ | |
| 143 | ||
| 144 | void osd_break_into_debugger(const char *message) | |
| 145 | { | |
| 146 | #ifdef MAME_DEBUG | |
| 147 | printf("MAME exception: %s\n", message); | |
| 148 | printf("Attempting to fall into debugger\n"); | |
| 149 | kill(getpid(), SIGTRAP); | |
| 150 | #else | |
| 151 | printf("Ignoring MAME exception: %s\n", message); | |
| 152 | #endif | |
| 153 | } | |
| 154 | ||
| 155 | ||
| 156 | //============================================================ | |
| 157 | // osd_ticks | |
| 158 | //============================================================ | |
| 159 | ||
| 160 | 103 | osd_ticks_t osd_ticks(void) |
| 161 | 104 | { |
| 162 | 105 | #ifdef SDLMAME_EMSCRIPTEN |
| 163 | ||
| 106 | return (osd_ticks_t)(emscripten_get_now() * 1000.0); | |
| 164 | 107 | #else |
| 165 | struct timeval tp; | |
| 166 | static osd_ticks_t start_sec = 0; | |
| 108 | struct timeval tp; | |
| 109 | static osd_ticks_t start_sec = 0; | |
| 167 | 110 | |
| 168 | gettimeofday(&tp, NULL); | |
| 169 | if (start_sec==0) | |
| 170 | start_sec = tp.tv_sec; | |
| 171 | return (tp.tv_sec - start_sec) * (osd_ticks_t) 1000000 + tp.tv_usec; | |
| 111 | gettimeofday(&tp, NULL); | |
| 112 | if (start_sec==0) | |
| 113 | start_sec = tp.tv_sec; | |
| 114 | return (tp.tv_sec - start_sec) * (osd_ticks_t) 1000000 + tp.tv_usec; | |
| 172 | 115 | #endif |
| 173 | 116 | } |
| 174 | 117 | |
| 175 | ||
| 176 | //============================================================ | |
| 177 | // osd_ticks_per_second | |
| 178 | //============================================================ | |
| 179 | ||
| 180 | 118 | osd_ticks_t osd_ticks_per_second(void) |
| 181 | 119 | { |
| 182 | ||
| 120 | return (osd_ticks_t) 1000000; | |
| 183 | 121 | } |
| 184 | 122 | |
| 185 | 123 | //============================================================ |
| r243192 | r243193 | |
| 188 | 126 | |
| 189 | 127 | void osd_sleep(osd_ticks_t duration) |
| 190 | 128 | { |
| 191 | ||
| 129 | UINT32 msec; | |
| 192 | 130 | |
| 193 | // convert to milliseconds, rounding down | |
| 194 | msec = (UINT32)(duration * 1000 / osd_ticks_per_second()); | |
| 131 | // convert to milliseconds, rounding down | |
| 132 | msec = (UINT32)(duration * 1000 / osd_ticks_per_second()); | |
| 195 | 133 | |
| 196 | // only sleep if at least 2 full milliseconds | |
| 197 | if (msec >= 2) | |
| 198 | { | |
| 199 | // take a couple of msecs off the top for good measure | |
| 200 | msec -= 2; | |
| 201 | usleep(msec*1000); | |
| 202 | } | |
| 134 | // only sleep if at least 2 full milliseconds | |
| 135 | if (msec >= 2) | |
| 136 | { | |
| 137 | // take a couple of msecs off the top for good measure | |
| 138 | msec -= 2; | |
| 139 | usleep(msec*1000); | |
| 140 | } | |
| 203 | 141 | } |
| r243192 | r243193 | |
|---|---|---|
| 1 | 1 | //============================================================ |
| 2 | 2 | // |
| 3 | // | |
| 3 | // winos.c - Win32 OS specific low level code | |
| 4 | 4 | // |
| 5 | // Copyright (c) 1996-2010, Nicola Salmoria and the MAME Team. | |
| 6 | // Visit http://mamedev.org for licensing and usage restrictions. | |
| 7 | // | |
| 8 | // SDLMAME by Olivier Galibert and R. Belmont | |
| 9 | // | |
| 10 | 5 | //============================================================ |
| 11 | 6 | |
| 12 | 7 | #define WIN32_LEAN_AND_MEAN |
| r243192 | r243193 | |
| 23 | 18 | #include "osdcomm.h" |
| 24 | 19 | #include "osdcore.h" |
| 25 | 20 | |
| 26 | #ifdef OSD_WINDOWS | |
| 27 | #include "winutf8.h" | |
| 28 | #endif | |
| 29 | ||
| 30 | 21 | //============================================================ |
| 31 | 22 | // MACROS |
| 32 | 23 | //============================================================ |
| r243192 | r243193 | |
| 37 | 28 | // align allocations to start or end of the page? |
| 38 | 29 | #define GUARD_ALIGN_START 0 |
| 39 | 30 | |
| 40 | ||
| 41 | 31 | //============================================================ |
| 42 | // | |
| 32 | // osd_num_processors | |
| 43 | 33 | //============================================================ |
| 44 | 34 | |
| 45 | #ifdef OSD_WINDOWS | |
| 46 | void (*s_debugger_stack_crawler)() = NULL; | |
| 47 | #endif | |
| 35 | int osd_get_num_processors(void) | |
| 36 | { | |
| 37 | SYSTEM_INFO info; | |
| 48 | 38 | |
| 39 | // otherwise, fetch the info from the system | |
| 40 | GetSystemInfo(&info); | |
| 49 | 41 | |
| 42 | // max out at 4 for now since scaling above that seems to do poorly | |
| 43 | return MIN(info.dwNumberOfProcessors, 4); | |
| 44 | } | |
| 45 | ||
| 50 | 46 | //============================================================ |
| 51 | 47 | // osd_getenv |
| 52 | 48 | //============================================================ |
| 53 | 49 | |
| 54 | c | |
| 50 | char *osd_getenv(const char *name) | |
| 55 | 51 | { |
| 56 | ||
| 52 | return getenv(name); | |
| 57 | 53 | } |
| 58 | 54 | |
| 59 | ||
| 60 | 55 | //============================================================ |
| 61 | 56 | // osd_setenv |
| 62 | 57 | //============================================================ |
| 63 | 58 | |
| 64 | 59 | int osd_setenv(const char *name, const char *value, int overwrite) |
| 65 | 60 | { |
| 66 | char *buf; | |
| 67 | int result; | |
| 61 | char *buf; | |
| 62 | int result; | |
| 68 | 63 | |
| 69 | if (!overwrite) | |
| 70 | { | |
| 71 | if (osd_getenv(name) != NULL) | |
| 72 | return 0; | |
| 73 | } | |
| 74 | buf = (char *) osd_malloc_array(strlen(name)+strlen(value)+2); | |
| 75 | sprintf(buf, "%s=%s", name, value); | |
| 76 | result = putenv(buf); | |
| 64 | if (!overwrite) | |
| 65 | { | |
| 66 | if (osd_getenv(name) != NULL) | |
| 67 | return 0; | |
| 68 | } | |
| 69 | buf = (char *) osd_malloc_array(strlen(name)+strlen(value)+2); | |
| 70 | sprintf(buf, "%s=%s", name, value); | |
| 71 | result = putenv(buf); | |
| 77 | 72 | |
| 78 | /* will be referenced by environment | |
| 79 | * Therefore it is not freed here | |
| 80 | */ | |
| 73 | /* will be referenced by environment | |
| 74 | * Therefore it is not freed here | |
| 75 | */ | |
| 81 | 76 | |
| 82 | ||
| 77 | return result; | |
| 83 | 78 | } |
| 84 | 79 | |
| 85 | 80 | //============================================================ |
| r243192 | r243193 | |
| 88 | 83 | |
| 89 | 84 | void osd_process_kill(void) |
| 90 | 85 | { |
| 91 | ||
| 86 | TerminateProcess(GetCurrentProcess(), -1); | |
| 92 | 87 | } |
| 93 | 88 | |
| 94 | 89 | //============================================================ |
| 95 | // osd_num_processors | |
| 96 | //============================================================ | |
| 97 | ||
| 98 | int osd_get_num_processors(void) | |
| 99 | { | |
| 100 | SYSTEM_INFO info; | |
| 101 | ||
| 102 | // otherwise, fetch the info from the system | |
| 103 | GetSystemInfo(&info); | |
| 104 | ||
| 105 | // max out at 4 for now since scaling above that seems to do poorly | |
| 106 | return MIN(info.dwNumberOfProcessors, 4); | |
| 107 | } | |
| 108 | ||
| 109 | //============================================================ | |
| 110 | 90 | // osd_malloc |
| 111 | 91 | //============================================================ |
| 112 | 92 | |
| 113 | 93 | void *osd_malloc(size_t size) |
| 114 | 94 | { |
| 115 | 95 | #ifndef MALLOC_DEBUG |
| 116 | ||
| 96 | return HeapAlloc(GetProcessHeap(), 0, size); | |
| 117 | 97 | #else |
| 118 | // add in space for the size | |
| 119 | size += sizeof(size_t); | |
| 98 | // add in space for the size | |
| 99 | size += sizeof(size_t); | |
| 120 | 100 | |
| 121 | // basic objects just come from the heap | |
| 122 | void *result = HeapAlloc(GetProcessHeap(), 0, size); | |
| 101 | // basic objects just come from the heap | |
| 102 | void *result = HeapAlloc(GetProcessHeap(), 0, size); | |
| 123 | 103 | |
| 124 | // store the size and return and pointer to the data afterward | |
| 125 | *reinterpret_cast<size_t *>(result) = size; | |
| 126 | return reinterpret_cast<UINT8 *>(result) + sizeof(size_t); | |
| 104 | // store the size and return and pointer to the data afterward | |
| 105 | *reinterpret_cast<size_t *>(result) = size; | |
| 106 | return reinterpret_cast<UINT8 *>(result) + sizeof(size_t); | |
| 127 | 107 | #endif |
| 128 | 108 | } |
| 129 | 109 | |
| r243192 | r243193 | |
| 135 | 115 | void *osd_malloc_array(size_t size) |
| 136 | 116 | { |
| 137 | 117 | #ifndef MALLOC_DEBUG |
| 138 | ||
| 118 | return HeapAlloc(GetProcessHeap(), 0, size); | |
| 139 | 119 | #else |
| 140 | // add in space for the size | |
| 141 | size += sizeof(size_t); | |
| 120 | // add in space for the size | |
| 121 | size += sizeof(size_t); | |
| 142 | 122 | |
| 143 | // round the size up to a page boundary | |
| 144 | size_t rounded_size = ((size + sizeof(void *) + PAGE_SIZE - 1) / PAGE_SIZE) * PAGE_SIZE; | |
| 123 | // round the size up to a page boundary | |
| 124 | size_t rounded_size = ((size + sizeof(void *) + PAGE_SIZE - 1) / PAGE_SIZE) * PAGE_SIZE; | |
| 145 | 125 | |
| 146 | // reserve that much memory, plus two guard pages | |
| 147 | void *page_base = VirtualAlloc(NULL, rounded_size + 2 * PAGE_SIZE, MEM_RESERVE, PAGE_NOACCESS); | |
| 148 | if (page_base == NULL) | |
| 149 | return NULL; | |
| 126 | // reserve that much memory, plus two guard pages | |
| 127 | void *page_base = VirtualAlloc(NULL, rounded_size + 2 * PAGE_SIZE, MEM_RESERVE, PAGE_NOACCESS); | |
| 128 | if (page_base == NULL) | |
| 129 | return NULL; | |
| 150 | 130 | |
| 151 | // now allow access to everything but the first and last pages | |
| 152 | page_base = VirtualAlloc(reinterpret_cast<UINT8 *>(page_base) + PAGE_SIZE, rounded_size, MEM_COMMIT, PAGE_READWRITE); | |
| 153 | if (page_base == NULL) | |
| 154 | return NULL; | |
| 131 | // now allow access to everything but the first and last pages | |
| 132 | page_base = VirtualAlloc(reinterpret_cast<UINT8 *>(page_base) + PAGE_SIZE, rounded_size, MEM_COMMIT, PAGE_READWRITE); | |
| 133 | if (page_base == NULL) | |
| 134 | return NULL; | |
| 155 | 135 | |
| 156 | // work backwards from the page base to get to the block base | |
| 157 | void *result = GUARD_ALIGN_START ? page_base : (reinterpret_cast<UINT8 *>(page_base) + rounded_size - size); | |
| 136 | // work backwards from the page base to get to the block base | |
| 137 | void *result = GUARD_ALIGN_START ? page_base : (reinterpret_cast<UINT8 *>(page_base) + rounded_size - size); | |
| 158 | 138 | |
| 159 | // store the size at the start with a flag indicating it has a guard page | |
| 160 | *reinterpret_cast<size_t *>(result) = size | 0x80000000; | |
| 161 | return reinterpret_cast<UINT8 *>(result) + sizeof(size_t); | |
| 139 | // store the size at the start with a flag indicating it has a guard page | |
| 140 | *reinterpret_cast<size_t *>(result) = size | 0x80000000; | |
| 141 | return reinterpret_cast<UINT8 *>(result) + sizeof(size_t); | |
| 162 | 142 | #endif |
| 163 | 143 | } |
| 164 | 144 | |
| r243192 | r243193 | |
| 170 | 150 | void osd_free(void *ptr) |
| 171 | 151 | { |
| 172 | 152 | #ifndef MALLOC_DEBUG |
| 173 | ||
| 153 | HeapFree(GetProcessHeap(), 0, ptr); | |
| 174 | 154 | #else |
| 175 | ||
| 155 | size_t size = reinterpret_cast<size_t *>(ptr)[-1]; | |
| 176 | 156 | |
| 177 | // if no guard page, just free the pointer | |
| 178 | if ((size & 0x80000000) == 0) | |
| 179 | HeapFree(GetProcessHeap(), 0, reinterpret_cast<UINT8 *>(ptr) - sizeof(size_t)); | |
| 157 | // if no guard page, just free the pointer | |
| 158 | if ((size & 0x80000000) == 0) | |
| 159 | HeapFree(GetProcessHeap(), 0, reinterpret_cast<UINT8 *>(ptr) - sizeof(size_t)); | |
| 180 | 160 | |
| 181 | // large items need more care | |
| 182 | else | |
| 183 | { | |
| 184 | ULONG_PTR page_base = (reinterpret_cast<ULONG_PTR>(ptr) - sizeof(size_t)) & ~(PAGE_SIZE - 1); | |
| 185 | VirtualFree(reinterpret_cast<void *>(page_base - PAGE_SIZE), 0, MEM_RELEASE); | |
| 186 | } | |
| 161 | // large items need more care | |
| 162 | else | |
| 163 | { | |
| 164 | ULONG_PTR page_base = (reinterpret_cast<ULONG_PTR>(ptr) - sizeof(size_t)) & ~(PAGE_SIZE - 1); | |
| 165 | VirtualFree(reinterpret_cast<void *>(page_base - PAGE_SIZE), 0, MEM_RELEASE); | |
| 166 | } | |
| 187 | 167 | #endif |
| 188 | 168 | } |
| 189 | 169 | |
| 190 | 170 | |
| 191 | 171 | //============================================================ |
| 192 | // osd_alloc_executable | |
| 193 | // | |
| 194 | // allocates "size" bytes of executable memory. this must take | |
| 195 | // things like NX support into account. | |
| 196 | //============================================================ | |
| 197 | ||
| 198 | void *osd_alloc_executable(size_t size) | |
| 199 | { | |
| 200 | return VirtualAlloc(NULL, size, MEM_COMMIT, PAGE_EXECUTE_READWRITE); | |
| 201 | } | |
| 202 | ||
| 203 | ||
| 204 | //============================================================ | |
| 205 | // osd_free_executable | |
| 206 | // | |
| 207 | // frees memory allocated with osd_alloc_executable | |
| 208 | //============================================================ | |
| 209 | ||
| 210 | void osd_free_executable(void *ptr, size_t size) | |
| 211 | { | |
| 212 | VirtualFree(ptr, 0, MEM_RELEASE); | |
| 213 | } | |
| 214 | ||
| 215 | ||
| 216 | //============================================================ | |
| 217 | // osd_break_into_debugger | |
| 218 | //============================================================ | |
| 219 | ||
| 220 | void osd_break_into_debugger(const char *message) | |
| 221 | { | |
| 222 | #ifdef OSD_WINDOWS | |
| 223 | if (IsDebuggerPresent()) | |
| 224 | { | |
| 225 | win_output_debug_string_utf8(message); | |
| 226 | DebugBreak(); | |
| 227 | } | |
| 228 | else if (s_debugger_stack_crawler != NULL) | |
| 229 | (*s_debugger_stack_crawler)(); | |
| 230 | #else | |
| 231 | if (IsDebuggerPresent()) | |
| 232 | { | |
| 233 | OutputDebugStringA(message); | |
| 234 | DebugBreak(); | |
| 235 | } | |
| 236 | #endif | |
| 237 | } | |
| 238 | ||
| 239 | //============================================================ | |
| 240 | 172 | // GLOBAL VARIABLES |
| 241 | 173 | //============================================================ |
| 242 | 174 | |
| r243192 | r243193 | |
| 252 | 184 | |
| 253 | 185 | osd_ticks_t osd_ticks(void) |
| 254 | 186 | { |
| 255 | ||
| 187 | LARGE_INTEGER performance_count; | |
| 256 | 188 | |
| 257 | // if we're suspended, just return that | |
| 258 | if (suspend_ticks != 0) | |
| 259 | return suspend_ticks; | |
| 189 | // if we're suspended, just return that | |
| 190 | if (suspend_ticks != 0) | |
| 191 | return suspend_ticks; | |
| 260 | 192 | |
| 261 | // if we have a per second count, just go for it | |
| 262 | if (ticks_per_second != 0) | |
| 263 | { | |
| 264 | // QueryPerformanceCounter if we can | |
| 265 | if (using_qpc) | |
| 266 | { | |
| 267 | QueryPerformanceCounter(&performance_count); | |
| 268 | return (osd_ticks_t)performance_count.QuadPart - suspend_ticks; | |
| 269 | } | |
| 193 | // if we have a per second count, just go for it | |
| 194 | if (ticks_per_second != 0) | |
| 195 | { | |
| 196 | // QueryPerformanceCounter if we can | |
| 197 | if (using_qpc) | |
| 198 | { | |
| 199 | QueryPerformanceCounter(&performance_count); | |
| 200 | return (osd_ticks_t)performance_count.QuadPart - suspend_ticks; | |
| 201 | } | |
| 270 | 202 | |
| 271 | // otherwise, fall back to timeGetTime | |
| 272 | else | |
| 273 | return (osd_ticks_t)timeGetTime() - suspend_ticks; | |
| 274 | } | |
| 203 | // otherwise, fall back to timeGetTime | |
| 204 | else | |
| 205 | return (osd_ticks_t)timeGetTime() - suspend_ticks; | |
| 206 | } | |
| 275 | 207 | |
| 276 | // if not, we have to determine it | |
| 277 | using_qpc = QueryPerformanceFrequency(&performance_count) && (performance_count.QuadPart != 0); | |
| 278 | if (using_qpc) | |
| 279 | ticks_per_second = (osd_ticks_t)performance_count.QuadPart; | |
| 280 | else | |
| 281 | ticks_per_second = 1000; | |
| 208 | // if not, we have to determine it | |
| 209 | using_qpc = QueryPerformanceFrequency(&performance_count) && (performance_count.QuadPart != 0); | |
| 210 | if (using_qpc) | |
| 211 | ticks_per_second = (osd_ticks_t)performance_count.QuadPart; | |
| 212 | else | |
| 213 | ticks_per_second = 1000; | |
| 282 | 214 | |
| 283 | // call ourselves to get the first value | |
| 284 | return osd_ticks(); | |
| 215 | // call ourselves to get the first value | |
| 216 | return osd_ticks(); | |
| 285 | 217 | } |
| 286 | 218 | |
| 287 | 219 | |
| r243192 | r243193 | |
| 291 | 223 | |
| 292 | 224 | osd_ticks_t osd_ticks_per_second(void) |
| 293 | 225 | { |
| 294 | if (ticks_per_second == 0) | |
| 295 | osd_ticks(); | |
| 296 | return ticks_per_second; | |
| 226 | if (ticks_per_second == 0) | |
| 227 | osd_ticks(); | |
| 228 | return ticks_per_second; | |
| 297 | 229 | } |
| 298 | 230 | |
| 231 | ||
| 299 | 232 | //============================================================ |
| 300 | 233 | // osd_sleep |
| 301 | 234 | //============================================================ |
| 302 | 235 | |
| 303 | 236 | void osd_sleep(osd_ticks_t duration) |
| 304 | 237 | { |
| 305 | ||
| 238 | DWORD msec; | |
| 306 | 239 | |
| 307 | // make sure we've computed ticks_per_second | |
| 308 | if (ticks_per_second == 0) | |
| 309 | (void)osd_ticks(); | |
| 240 | // make sure we've computed ticks_per_second | |
| 241 | if (ticks_per_second == 0) | |
| 242 | (void)osd_ticks(); | |
| 310 | 243 | |
| 311 | // convert to milliseconds, rounding down | |
| 312 | msec = (DWORD)(duration * 1000 / ticks_per_second); | |
| 244 | // convert to milliseconds, rounding down | |
| 245 | msec = (DWORD)(duration * 1000 / ticks_per_second); | |
| 313 | 246 | |
| 314 | // only sleep if at least 2 full milliseconds | |
| 315 | if (msec >= 2) | |
| 316 | { | |
| 317 | HANDLE current_thread = GetCurrentThread(); | |
| 318 | int old_priority = GetThreadPriority(current_thread); | |
| 247 | // only sleep if at least 2 full milliseconds | |
| 248 | if (msec >= 2) | |
| 249 | { | |
| 250 | HANDLE current_thread = GetCurrentThread(); | |
| 251 | int old_priority = GetThreadPriority(current_thread); | |
| 319 | 252 | |
| 320 | // take a couple of msecs off the top for good measure | |
| 321 | msec -= 2; | |
| 253 | // take a couple of msecs off the top for good measure | |
| 254 | msec -= 2; | |
| 322 | 255 | |
| 323 | // bump our thread priority super high so that we get | |
| 324 | // priority when we need it | |
| 325 | SetThreadPriority(current_thread, THREAD_PRIORITY_TIME_CRITICAL); | |
| 326 | Sleep(msec); | |
| 327 | SetThreadPriority(current_thread, old_priority); | |
| 328 | } | |
| 256 | // bump our thread priority super high so that we get | |
| 257 | // priority when we need it | |
| 258 | SetThreadPriority(current_thread, THREAD_PRIORITY_TIME_CRITICAL); | |
| 259 | Sleep(msec); | |
| 260 | SetThreadPriority(current_thread, old_priority); | |
| 261 | } | |
| 329 | 262 | } |
| r243192 | r243193 | |
|---|---|---|
| 11 | 11 | |
| 12 | 12 | #include "emu.h" |
| 13 | 13 | #include "osdepend.h" |
| 14 | #include "modules/sound/none.h" | |
| 15 | #include "modules/debugger/none.h" | |
| 16 | #include "modules/debugger/debugint.h" | |
| 14 | 17 | #include "modules/lib/osdobj_common.h" |
| 15 | 18 | |
| 16 | 19 | extern bool g_print_verbose; |
| 17 | 20 | |
| 18 | 21 | const options_entry osd_options::s_option_entries[] = |
| 19 | 22 | { |
| 20 | { NULL, NULL, OPTION_HEADER, "OSD FONT OPTIONS" }, | |
| 21 | { OSD_FONT_PROVIDER, "auto", OPTION_STRING, "provider for ui font: " }, | |
| 23 | { NULL, NULL, OPTION_HEADER, "OSD CLI OPTIONS" }, | |
| 24 | { OSDCOMMAND_LIST_MIDI_DEVICES ";mlist", "0", OPTION_COMMAND, "list available MIDI I/O devices" }, | |
| 25 | { OSDCOMMAND_LIST_NETWORK_ADAPTERS ";nlist", "0", OPTION_COMMAND, "list available network adapters" }, | |
| 22 | 26 | |
| 23 | { NULL, NULL, OPTION_HEADER, "OSD CLI OPTIONS" }, | |
| 24 | { OSDCOMMAND_LIST_MIDI_DEVICES ";mlist", "0", OPTION_COMMAND, "list available MIDI I/O devices" }, | |
| 25 | { OSDCOMMAND_LIST_NETWORK_ADAPTERS ";nlist", "0", OPTION_COMMAND, "list available network adapters" }, | |
| 27 | // debugging options | |
| 28 | { NULL, NULL, OPTION_HEADER, "OSD DEBUGGING OPTIONS" }, | |
| 29 | { OSDOPTION_DEBUGGER, OSDOPTVAL_AUTO, OPTION_STRING, "debugger used : " }, | |
| 30 | { OSDOPTION_WATCHDOG ";wdog", "0", OPTION_INTEGER, "force the program to terminate if no updates within specified number of seconds" }, | |
| 26 | 31 | |
| 27 | // debugging options | |
| 28 | { NULL, NULL, OPTION_HEADER, "OSD DEBUGGING OPTIONS" }, | |
| 29 | { OSDOPTION_DEBUGGER, OSDOPTVAL_AUTO, OPTION_STRING, "debugger used : " }, | |
| 30 | { OSDOPTION_WATCHDOG ";wdog", "0", OPTION_INTEGER, "force the program to terminate if no updates within specified number of seconds" }, | |
| 31 | ||
| 32 | // performance options | |
| 33 | { NULL, NULL, OPTION_HEADER, "OSD PERFORMANCE OPTIONS" }, | |
| 34 | { OSDOPTION_MULTITHREADING ";mt", "0", OPTION_BOOLEAN, "enable multithreading; this enables rendering and blitting on a separate thread" }, | |
| 35 | { OSDOPTION_NUMPROCESSORS ";np", OSDOPTVAL_AUTO, OPTION_STRING, "number of processors; this overrides the number the system reports" }, | |
| 36 | { OSDOPTION_BENCH, "0", OPTION_INTEGER, "benchmark for the given number of emulated seconds; implies -video none -sound none -nothrottle" }, | |
| 37 | // video options | |
| 38 | { NULL, NULL, OPTION_HEADER, "OSD VIDEO OPTIONS" }, | |
| 32 | // performance options | |
| 33 | { NULL, NULL, OPTION_HEADER, "OSD PERFORMANCE OPTIONS" }, | |
| 34 | { OSDOPTION_MULTITHREADING ";mt", "0", OPTION_BOOLEAN, "enable multithreading; this enables rendering and blitting on a separate thread" }, | |
| 35 | { OSDOPTION_NUMPROCESSORS ";np", OSDOPTVAL_AUTO, OPTION_STRING, "number of processors; this overrides the number the system reports" }, | |
| 36 | { OSDOPTION_BENCH, "0", OPTION_INTEGER, "benchmark for the given number of emulated seconds; implies -video none -sound none -nothrottle" }, | |
| 37 | // video options | |
| 38 | { NULL, NULL, OPTION_HEADER, "OSD VIDEO OPTIONS" }, | |
| 39 | 39 | // OS X can be trusted to have working hardware OpenGL, so default to it on for the best user experience |
| 40 | { OSDOPTION_VIDEO, OSDOPTVAL_AUTO, OPTION_STRING, "video output method: " }, | |
| 41 | { OSDOPTION_NUMSCREENS "(1-4)", "1", OPTION_INTEGER, "number of screens to create; usually, you want just one" }, | |
| 42 | { OSDOPTION_WINDOW ";w", "0", OPTION_BOOLEAN, "enable window mode; otherwise, full screen mode is assumed" }, | |
| 43 | { OSDOPTION_MAXIMIZE ";max", "1", OPTION_BOOLEAN, "default to maximized windows; otherwise, windows will be minimized" }, | |
| 44 | { OSDOPTION_KEEPASPECT ";ka", "1", OPTION_BOOLEAN, "constrain to the proper aspect ratio" }, | |
| 45 | { OSDOPTION_UNEVENSTRETCH ";ues", "1", OPTION_BOOLEAN, "allow non-integer stretch factors" }, | |
| 46 | { OSDOPTION_WAITVSYNC ";vs", "0", OPTION_BOOLEAN, "enable waiting for the start of VBLANK before flipping screens; reduces tearing effects" }, | |
| 47 | { OSDOPTION_SYNCREFRESH ";srf", "0", OPTION_BOOLEAN, "enable using the start of VBLANK for throttling instead of the game time" }, | |
| 40 | { OSDOPTION_VIDEO, OSDOPTVAL_AUTO, OPTION_STRING, "video output method: " }, | |
| 41 | { OSDOPTION_NUMSCREENS "(1-4)", "1", OPTION_INTEGER, "number of screens to create; usually, you want just one" }, | |
| 42 | { OSDOPTION_WINDOW ";w", "0", OPTION_BOOLEAN, "enable window mode; otherwise, full screen mode is assumed" }, | |
| 43 | { OSDOPTION_MAXIMIZE ";max", "1", OPTION_BOOLEAN, "default to maximized windows; otherwise, windows will be minimized" }, | |
| 44 | { OSDOPTION_KEEPASPECT ";ka", "1", OPTION_BOOLEAN, "constrain to the proper aspect ratio" }, | |
| 45 | { OSDOPTION_UNEVENSTRETCH ";ues", "1", OPTION_BOOLEAN, "allow non-integer stretch factors" }, | |
| 46 | { OSDOPTION_WAITVSYNC ";vs", "0", OPTION_BOOLEAN, "enable waiting for the start of VBLANK before flipping screens; reduces tearing effects" }, | |
| 47 | { OSDOPTION_SYNCREFRESH ";srf", "0", OPTION_BOOLEAN, "enable using the start of VBLANK for throttling instead of the game time" }, | |
| 48 | 48 | |
| 49 | // per-window options | |
| 50 | { NULL, NULL, OPTION_HEADER, "OSD PER-WINDOW VIDEO OPTIONS" }, | |
| 51 | { OSDOPTION_SCREEN, OSDOPTVAL_AUTO, OPTION_STRING, "explicit name of the first screen; 'auto' here will try to make a best guess" }, | |
| 52 | { OSDOPTION_ASPECT ";screen_aspect", OSDOPTVAL_AUTO, OPTION_STRING, "aspect ratio for all screens; 'auto' here will try to make a best guess" }, | |
| 53 | { OSDOPTION_RESOLUTION ";r", OSDOPTVAL_AUTO, OPTION_STRING, "preferred resolution for all screens; format is <width>x<height>[@<refreshrate>] or 'auto'" }, | |
| 54 | { OSDOPTION_VIEW, OSDOPTVAL_AUTO, OPTION_STRING, "preferred view for all screens" }, | |
| 49 | // per-window options | |
| 50 | { NULL, NULL, OPTION_HEADER, "OSD PER-WINDOW VIDEO OPTIONS" }, | |
| 51 | { OSDOPTION_SCREEN, OSDOPTVAL_AUTO, OPTION_STRING, "explicit name of the first screen; 'auto' here will try to make a best guess" }, | |
| 52 | { OSDOPTION_ASPECT ";screen_aspect", OSDOPTVAL_AUTO, OPTION_STRING, "aspect ratio for all screens; 'auto' here will try to make a best guess" }, | |
| 53 | { OSDOPTION_RESOLUTION ";r", OSDOPTVAL_AUTO, OPTION_STRING, "preferred resolution for all screens; format is <width>x<height>[@<refreshrate>] or 'auto'" }, | |
| 54 | { OSDOPTION_VIEW, OSDOPTVAL_AUTO, OPTION_STRING, "preferred view for all screens" }, | |
| 55 | 55 | |
| 56 | { OSDOPTION_SCREEN "0", OSDOPTVAL_AUTO, OPTION_STRING, "explicit name of the first screen; 'auto' here will try to make a best guess" }, | |
| 57 | { OSDOPTION_ASPECT "0", OSDOPTVAL_AUTO, OPTION_STRING, "aspect ratio of the first screen; 'auto' here will try to make a best guess" }, | |
| 58 | { OSDOPTION_RESOLUTION "0;r0", OSDOPTVAL_AUTO, OPTION_STRING, "preferred resolution of the first screen; format is <width>x<height>[@<refreshrate>] or 'auto'" }, | |
| 59 | { OSDOPTION_VIEW "0", OSDOPTVAL_AUTO, OPTION_STRING, "preferred view for the first screen" }, | |
| 56 | { OSDOPTION_SCREEN "0", OSDOPTVAL_AUTO, OPTION_STRING, "explicit name of the first screen; 'auto' here will try to make a best guess" }, | |
| 57 | { OSDOPTION_ASPECT "0", OSDOPTVAL_AUTO, OPTION_STRING, "aspect ratio of the first screen; 'auto' here will try to make a best guess" }, | |
| 58 | { OSDOPTION_RESOLUTION "0;r0", OSDOPTVAL_AUTO, OPTION_STRING, "preferred resolution of the first screen; format is <width>x<height>[@<refreshrate>] or 'auto'" }, | |
| 59 | { OSDOPTION_VIEW "0", OSDOPTVAL_AUTO, OPTION_STRING, "preferred view for the first screen" }, | |
| 60 | 60 | |
| 61 | { OSDOPTION_SCREEN "1", OSDOPTVAL_AUTO, OPTION_STRING, "explicit name of the second screen; 'auto' here will try to make a best guess" }, | |
| 62 | { OSDOPTION_ASPECT "1", OSDOPTVAL_AUTO, OPTION_STRING, "aspect ratio of the second screen; 'auto' here will try to make a best guess" }, | |
| 63 | { OSDOPTION_RESOLUTION "1;r1", OSDOPTVAL_AUTO, OPTION_STRING, "preferred resolution of the second screen; format is <width>x<height>[@<refreshrate>] or 'auto'" }, | |
| 64 | { OSDOPTION_VIEW "1", OSDOPTVAL_AUTO, OPTION_STRING, "preferred view for the second screen" }, | |
| 61 | { OSDOPTION_SCREEN "1", OSDOPTVAL_AUTO, OPTION_STRING, "explicit name of the second screen; 'auto' here will try to make a best guess" }, | |
| 62 | { OSDOPTION_ASPECT "1", OSDOPTVAL_AUTO, OPTION_STRING, "aspect ratio of the second screen; 'auto' here will try to make a best guess" }, | |
| 63 | { OSDOPTION_RESOLUTION "1;r1", OSDOPTVAL_AUTO, OPTION_STRING, "preferred resolution of the second screen; format is <width>x<height>[@<refreshrate>] or 'auto'" }, | |
| 64 | { OSDOPTION_VIEW "1", OSDOPTVAL_AUTO, OPTION_STRING, "preferred view for the second screen" }, | |
| 65 | 65 | |
| 66 | { OSDOPTION_SCREEN "2", OSDOPTVAL_AUTO, OPTION_STRING, "explicit name of the third screen; 'auto' here will try to make a best guess" }, | |
| 67 | { OSDOPTION_ASPECT "2", OSDOPTVAL_AUTO, OPTION_STRING, "aspect ratio of the third screen; 'auto' here will try to make a best guess" }, | |
| 68 | { OSDOPTION_RESOLUTION "2;r2", OSDOPTVAL_AUTO, OPTION_STRING, "preferred resolution of the third screen; format is <width>x<height>[@<refreshrate>] or 'auto'" }, | |
| 69 | { OSDOPTION_VIEW "2", OSDOPTVAL_AUTO, OPTION_STRING, "preferred view for the third screen" }, | |
| 66 | { OSDOPTION_SCREEN "2", OSDOPTVAL_AUTO, OPTION_STRING, "explicit name of the third screen; 'auto' here will try to make a best guess" }, | |
| 67 | { OSDOPTION_ASPECT "2", OSDOPTVAL_AUTO, OPTION_STRING, "aspect ratio of the third screen; 'auto' here will try to make a best guess" }, | |
| 68 | { OSDOPTION_RESOLUTION "2;r2", OSDOPTVAL_AUTO, OPTION_STRING, "preferred resolution of the third screen; format is <width>x<height>[@<refreshrate>] or 'auto'" }, | |
| 69 | { OSDOPTION_VIEW "2", OSDOPTVAL_AUTO, OPTION_STRING, "preferred view for the third screen" }, | |
| 70 | 70 | |
| 71 | { OSDOPTION_SCREEN "3", OSDOPTVAL_AUTO, OPTION_STRING, "explicit name of the fourth screen; 'auto' here will try to make a best guess" }, | |
| 72 | { OSDOPTION_ASPECT "3", OSDOPTVAL_AUTO, OPTION_STRING, "aspect ratio of the fourth screen; 'auto' here will try to make a best guess" }, | |
| 73 | { OSDOPTION_RESOLUTION "3;r3", OSDOPTVAL_AUTO, OPTION_STRING, "preferred resolution of the fourth screen; format is <width>x<height>[@<refreshrate>] or 'auto'" }, | |
| 74 | { OSDOPTION_VIEW "3", OSDOPTVAL_AUTO, OPTION_STRING, "preferred view for the fourth screen" }, | |
| 71 | { OSDOPTION_SCREEN "3", OSDOPTVAL_AUTO, OPTION_STRING, "explicit name of the fourth screen; 'auto' here will try to make a best guess" }, | |
| 72 | { OSDOPTION_ASPECT "3", OSDOPTVAL_AUTO, OPTION_STRING, "aspect ratio of the fourth screen; 'auto' here will try to make a best guess" }, | |
| 73 | { OSDOPTION_RESOLUTION "3;r3", OSDOPTVAL_AUTO, OPTION_STRING, "preferred resolution of the fourth screen; format is <width>x<height>[@<refreshrate>] or 'auto'" }, | |
| 74 | { OSDOPTION_VIEW "3", OSDOPTVAL_AUTO, OPTION_STRING, "preferred view for the fourth screen" }, | |
| 75 | 75 | |
| 76 | // full screen options | |
| 77 | { NULL, NULL, OPTION_HEADER, "OSD FULL SCREEN OPTIONS" }, | |
| 78 | { OSDOPTION_SWITCHRES, "0", OPTION_BOOLEAN, "enable resolution switching" }, | |
| 76 | // full screen options | |
| 77 | { NULL, NULL, OPTION_HEADER, "OSD FULL SCREEN OPTIONS" }, | |
| 78 | { OSDOPTION_SWITCHRES, "0", OPTION_BOOLEAN, "enable resolution switching" }, | |
| 79 | 79 | |
| 80 | // sound options | |
| 81 | { NULL, NULL, OPTION_HEADER, "OSD SOUND OPTIONS" }, | |
| 82 | { OSDOPTION_SOUND, OSDOPTVAL_AUTO, OPTION_STRING, "sound output method: " }, | |
| 83 | { OSDOPTION_AUDIO_LATENCY "(1-5)", "2", OPTION_INTEGER, "set audio latency (increase to reduce glitches, decrease for responsiveness)" }, | |
| 80 | // sound options | |
| 81 | { NULL, NULL, OPTION_HEADER, "OSD SOUND OPTIONS" }, | |
| 82 | { OSDOPTION_SOUND, OSDOPTVAL_AUTO, OPTION_STRING, "sound output method: " }, | |
| 83 | { OSDOPTION_AUDIO_LATENCY "(1-5)", "2", OPTION_INTEGER, "set audio latency (increase to reduce glitches, decrease for responsiveness)" }, | |
| 84 | 84 | |
| 85 | // End of list | |
| 86 | { NULL } | |
| 85 | // End of list | |
| 86 | { NULL } | |
| 87 | 87 | }; |
| 88 | 88 | |
| 89 | 89 | osd_options::osd_options() |
| 90 | 90 | : cli_options() |
| 91 | 91 | { |
| 92 | ||
| 92 | add_entries(osd_options::s_option_entries); | |
| 93 | 93 | }; |
| 94 | 94 | |
| 95 | 95 | |
| r243192 | r243193 | |
| 99 | 99 | |
| 100 | 100 | osd_common_t::osd_common_t(osd_options &options) |
| 101 | 101 | : m_machine(NULL), |
| 102 | m_options(options), | |
| 103 | m_sound(NULL), | |
| 104 | m_debugger(NULL) | |
| 102 | m_options(options), | |
| 103 | m_sound(NULL), | |
| 104 | m_debugger(NULL) | |
| 105 | 105 | |
| 106 | 106 | { |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | #define REGISTER_MODULE(_O, _X ) { extern const module_type _X; _O . register_module( _X ); } | |
| 110 | 109 | |
| 111 | 110 | void osd_common_t::register_options() |
| 112 | 111 | { |
| 113 | REGISTER_MODULE(m_mod_man, FONT_OSX); | |
| 114 | REGISTER_MODULE(m_mod_man, FONT_WINDOWS); | |
| 115 | REGISTER_MODULE(m_mod_man, FONT_SDL); | |
| 116 | REGISTER_MODULE(m_mod_man, FONT_NONE); | |
| 112 | // Register video options and update options | |
| 113 | video_options_add("none", NULL); | |
| 114 | video_register(); | |
| 115 | update_option(OSDOPTION_VIDEO, m_video_names); | |
| 117 | 116 | |
| 118 | REGISTER_MODULE(m_mod_man, SOUND_DSOUND); | |
| 119 | REGISTER_MODULE(m_mod_man, SOUND_JS); | |
| 120 | REGISTER_MODULE(m_mod_man, SOUND_SDL); | |
| 121 | REGISTER_MODULE(m_mod_man, SOUND_NONE); | |
| 117 | // Register sound options and update options | |
| 118 | sound_options_add("none", OSD_SOUND_NONE); | |
| 119 | sound_register(); | |
| 120 | update_option(OSDOPTION_SOUND, m_sound_names); | |
| 122 | 121 | |
| 123 | #ifdef SDLMAME_MACOSX | |
| 124 | REGISTER_MODULE(m_mod_man, DEBUG_OSX); | |
| 125 | #endif | |
| 126 | REGISTER_MODULE(m_mod_man, DEBUG_WINDOWS); | |
| 127 | REGISTER_MODULE(m_mod_man, DEBUG_QT); | |
| 128 | REGISTER_MODULE(m_mod_man, DEBUG_INTERNAL); | |
| 129 | REGISTER_MODULE(m_mod_man, DEBUG_NONE); | |
| 130 | ||
| 131 | // after initialization we know which modules are supported | |
| 132 | ||
| 133 | const char *names[20]; | |
| 134 | int num; | |
| 135 | m_mod_man.get_module_names(OSD_FONT_PROVIDER, 20, &num, names); | |
| 136 | dynamic_array<const char *> dnames; | |
| 137 | for (int i = 0; i < num; i++) | |
| 138 | dnames.append(names[i]); | |
| 139 | update_option(OSD_FONT_PROVIDER, dnames); | |
| 140 | ||
| 141 | m_mod_man.get_module_names(OSD_SOUND_PROVIDER, 20, &num, names); | |
| 142 | dnames.reset(); | |
| 143 | for (int i = 0; i < num; i++) | |
| 144 | dnames.append(names[i]); | |
| 145 | update_option(OSD_SOUND_PROVIDER, dnames); | |
| 146 | ||
| 147 | // Register debugger options and update options | |
| 148 | m_mod_man.get_module_names(OSD_DEBUG_PROVIDER, 20, &num, names); | |
| 149 | dnames.reset(); | |
| 150 | for (int i = 0; i < num; i++) | |
| 151 | dnames.append(names[i]); | |
| 152 | update_option(OSD_DEBUG_PROVIDER, dnames); | |
| 153 | ||
| 154 | // Register video options and update options | |
| 155 | video_options_add("none", NULL); | |
| 156 | video_register(); | |
| 157 | update_option(OSDOPTION_VIDEO, m_video_names); | |
| 122 | // Register debugger options and update options | |
| 123 | debugger_options_add("none", OSD_DEBUGGER_NONE); | |
| 124 | debugger_options_add("internal", OSD_DEBUGGER_INTERNAL); | |
| 125 | debugger_register(); | |
| 126 | update_option(OSDOPTION_DEBUGGER, m_debugger_names); | |
| 158 | 127 | } |
| 159 | 128 | |
| 160 | 129 | void osd_common_t::update_option(const char * key, dynamic_array<const char *> &values) |
| r243192 | r243193 | |
| 186 | 155 | for(int i= 0; i < m_video_names.count(); ++i) |
| 187 | 156 | osd_free(const_cast<char*>(m_video_names[i])); |
| 188 | 157 | //m_video_options,reset(); |
| 158 | ||
| 159 | for(int i= 0; i < m_sound_names.count(); ++i) | |
| 160 | osd_free(const_cast<char*>(m_sound_names[i])); | |
| 161 | m_sound_options.reset(); | |
| 162 | ||
| 163 | for(int i= 0; i < m_debugger_names.count(); ++i) | |
| 164 | osd_free(const_cast<char*>(m_debugger_names[i])); | |
| 165 | m_debugger_options.reset(); | |
| 189 | 166 | } |
| 190 | 167 | |
| 191 | 168 | |
| r243192 | r243193 | |
| 266 | 243 | // is active. This gives any OSD debugger interface a chance to |
| 267 | 244 | // create all of its structures. |
| 268 | 245 | // |
| 246 | osd_debugger_type debugger = m_debugger_options.find(options().debugger()); | |
| 247 | if (debugger==NULL) | |
| 248 | { | |
| 249 | osd_printf_warning("debugger_init: option %s not found switching to auto\n",options().debugger()); | |
| 250 | debugger = m_debugger_options.find("auto"); | |
| 251 | } | |
| 252 | m_debugger = (*debugger)(*this); | |
| 253 | ||
| 269 | 254 | m_debugger->init_debugger(machine()); |
| 270 | 255 | } |
| 271 | 256 | |
| r243192 | r243193 | |
| 291 | 276 | if (m_debugger) m_debugger->debugger_update(); |
| 292 | 277 | } |
| 293 | 278 | |
| 279 | void osd_common_t::debugger_exit() | |
| 280 | { | |
| 281 | if (m_debugger) | |
| 282 | { | |
| 283 | m_debugger->debugger_exit(); | |
| 284 | global_free(m_debugger); | |
| 285 | m_debugger = NULL; | |
| 286 | } | |
| 287 | } | |
| 294 | 288 | |
| 295 | 289 | //------------------------------------------------- |
| 296 | 290 | // update_audio_stream - update the stereo audio |
| r243192 | r243193 | |
| 304 | 298 | // It provides an array of stereo samples in L-R order which should be |
| 305 | 299 | // output at the configured sample_rate. |
| 306 | 300 | // |
| 307 | m_sound->update_audio_stream(m_machine->video().throttled(), buffer,samples_this_frame); | |
| 301 | if (m_sound != NULL) | |
| 302 | m_sound->update_audio_stream(buffer,samples_this_frame); | |
| 308 | 303 | } |
| 309 | 304 | |
| 310 | 305 | |
| r243192 | r243193 | |
| 321 | 316 | // while (attenuation++ < 0) |
| 322 | 317 | // volume /= 1.122018454; // = (10 ^ (1/20)) = 1dB |
| 323 | 318 | // |
| 324 | if (m_sound != NULL) | |
| 325 | m_sound->set_mastervolume(attenuation); | |
| 319 | if (m_sound != NULL) | |
| 320 | m_sound->set_mastervolume(attenuation); | |
| 326 | 321 | } |
| 327 | 322 | |
| 328 | 323 | |
| r243192 | r243193 | |
| 397 | 392 | |
| 398 | 393 | bool osd_common_t::execute_command(const char *command) |
| 399 | 394 | { |
| 400 | if (strcmp(command, OSDCOMMAND_LIST_NETWORK_ADAPTERS) == 0) | |
| 401 | { | |
| 402 | network_init(); | |
| 403 | osd_list_network_adapters(); | |
| 404 | network_exit(); | |
| 405 | return true; | |
| 406 | } | |
| 407 | else if (strcmp(command, OSDCOMMAND_LIST_MIDI_DEVICES) == 0) | |
| 408 | { | |
| 409 | osd_list_midi_devices(); | |
| 410 | return true; | |
| 411 | } | |
| 395 | if (strcmp(command, OSDCOMMAND_LIST_NETWORK_ADAPTERS) == 0) | |
| 396 | { | |
| 397 | network_init(); | |
| 398 | osd_list_network_adapters(); | |
| 399 | network_exit(); | |
| 400 | return true; | |
| 401 | } | |
| 402 | else if (strcmp(command, OSDCOMMAND_LIST_MIDI_DEVICES) == 0) | |
| 403 | { | |
| 404 | osd_list_midi_devices(); | |
| 405 | return true; | |
| 406 | } | |
| 412 | 407 | |
| 413 | ||
| 408 | return false; | |
| 414 | 409 | |
| 415 | 410 | } |
| 416 | 411 | |
| r243192 | r243193 | |
| 425 | 420 | exit(-1); |
| 426 | 421 | } |
| 427 | 422 | |
| 423 | sound_init(); | |
| 428 | 424 | input_init(); |
| 429 | 425 | // we need pause callbacks |
| 430 | 426 | machine().add_notifier(MACHINE_NOTIFY_PAUSE, machine_notify_delegate(FUNC(osd_common_t::input_pause), this)); |
| r243192 | r243193 | |
| 435 | 431 | network_init(); |
| 436 | 432 | #endif |
| 437 | 433 | midi_init(); |
| 438 | ||
| 439 | m_font_module = select_module_options<font_module *>(options(), OSD_FONT_PROVIDER); | |
| 440 | ||
| 441 | m_sound = select_module_options<sound_module *>(options(), OSD_SOUND_PROVIDER); | |
| 442 | m_sound->m_sample_rate = options().sample_rate(); | |
| 443 | m_sound->m_audio_latency = options().audio_latency(); | |
| 444 | ||
| 445 | m_debugger = select_module_options<debug_module *>(options(), OSD_DEBUG_PROVIDER); | |
| 446 | ||
| 447 | m_mod_man.init(); | |
| 448 | ||
| 449 | 434 | } |
| 450 | 435 | |
| 451 | 436 | bool osd_common_t::video_init() |
| r243192 | r243193 | |
| 458 | 443 | return true; |
| 459 | 444 | } |
| 460 | 445 | |
| 446 | bool osd_common_t::sound_init() | |
| 447 | { | |
| 448 | osd_sound_type sound = m_sound_options.find(options().sound()); | |
| 449 | if (sound==NULL) | |
| 450 | { | |
| 451 | osd_printf_warning("sound_init: option %s not found switching to auto\n",options().sound()); | |
| 452 | sound = m_sound_options.find("auto"); | |
| 453 | } | |
| 454 | if (sound != NULL) | |
| 455 | m_sound = (*sound)(*this, machine()); | |
| 456 | else | |
| 457 | m_sound = NULL; | |
| 458 | return true; | |
| 459 | } | |
| 460 | ||
| 461 | 461 | bool osd_common_t::no_sound() |
| 462 | 462 | { |
| 463 | 463 | return (strcmp(options().sound(),"none")==0) ? true : false; |
| r243192 | r243193 | |
| 467 | 467 | { |
| 468 | 468 | } |
| 469 | 469 | |
| 470 | void osd_common_t::sound_register() | |
| 471 | { | |
| 472 | } | |
| 473 | ||
| 474 | void osd_common_t::debugger_register() | |
| 475 | { | |
| 476 | } | |
| 477 | ||
| 470 | 478 | bool osd_common_t::input_init() |
| 471 | 479 | { |
| 472 | 480 | return true; |
| r243192 | r243193 | |
| 493 | 501 | void osd_common_t::exit_subsystems() |
| 494 | 502 | { |
| 495 | 503 | video_exit(); |
| 504 | sound_exit(); | |
| 496 | 505 | input_exit(); |
| 497 | 506 | output_exit(); |
| 498 | 507 | #ifdef USE_NETWORK |
| 499 | 508 | network_exit(); |
| 500 | 509 | #endif |
| 501 | 510 | midi_exit(); |
| 511 | debugger_exit(); | |
| 502 | 512 | } |
| 503 | 513 | |
| 504 | 514 | void osd_common_t::video_exit() |
| r243192 | r243193 | |
| 509 | 519 | { |
| 510 | 520 | } |
| 511 | 521 | |
| 522 | void osd_common_t::sound_exit() | |
| 523 | { | |
| 524 | if (m_sound != NULL) | |
| 525 | global_free(m_sound); | |
| 526 | } | |
| 527 | ||
| 512 | 528 | void osd_common_t::input_exit() |
| 513 | 529 | { |
| 514 | 530 | } |
| r243192 | r243193 | |
| 523 | 539 | |
| 524 | 540 | void osd_common_t::osd_exit() |
| 525 | 541 | { |
| 526 | m_mod_man.exit(); | |
| 527 | ||
| 528 | 542 | exit_subsystems(); |
| 529 | 543 | } |
| 530 | 544 | |
| r243192 | r243193 | |
| 534 | 548 | m_video_names.append(core_strdup(name)); |
| 535 | 549 | } |
| 536 | 550 | |
| 551 | void osd_common_t::sound_options_add(const char *name, osd_sound_type type) | |
| 552 | { | |
| 553 | m_sound_options.add(name, type, false); | |
| 554 | m_sound_names.append(core_strdup(name)); | |
| 555 | } | |
| 556 | ||
| 557 | void osd_common_t::debugger_options_add(const char *name, osd_debugger_type type) | |
| 558 | { | |
| 559 | m_debugger_options.add(name, type, false); | |
| 560 | m_debugger_names.append(core_strdup(name)); | |
| 561 | } | |
| 562 | ||
| 537 | 563 | bool osd_common_t::midi_init() |
| 538 | 564 | { |
| 539 | // this should be done on the OS_level | |
| 540 | return osd_midi_init(); | |
| 565 | // this should be done on the OS_level | |
| 566 | return osd_midi_init(); | |
| 541 | 567 | } |
| 542 | 568 | |
| 543 | 569 | void osd_common_t::midi_exit() |
| 544 | 570 | { |
| 545 | ||
| 571 | osd_midi_exit(); | |
| 546 | 572 | } |
| 573 | ||
| 574 | //------------------------------------------------- | |
| 575 | // osd_sound_interface - constructor | |
| 576 | //------------------------------------------------- | |
| 577 | ||
| 578 | osd_sound_interface::osd_sound_interface(const osd_interface &osd, running_machine &machine) | |
| 579 | : m_osd(osd), m_machine(machine) | |
| 580 | { | |
| 581 | } | |
| 582 | ||
| 583 | //------------------------------------------------- | |
| 584 | // osd_sound_interface - destructor | |
| 585 | //------------------------------------------------- | |
| 586 | ||
| 587 | osd_sound_interface::~osd_sound_interface() | |
| 588 | { | |
| 589 | } | |
| 590 | ||
| 591 | //------------------------------------------------- | |
| 592 | // osd_debugger_interface - constructor | |
| 593 | //------------------------------------------------- | |
| 594 | ||
| 595 | osd_debugger_interface::osd_debugger_interface(const osd_interface &osd) | |
| 596 | : m_osd(osd) | |
| 597 | { | |
| 598 | } | |
| 599 | ||
| 600 | //------------------------------------------------- | |
| 601 | // osd_debugger_interface - destructor | |
| 602 | //------------------------------------------------- | |
| 603 | ||
| 604 | osd_debugger_interface::~osd_debugger_interface() | |
| 605 | { | |
| 606 | } | |
| 607 |
| r243192 | r243193 | |
|---|---|---|
| 14 | 14 | #define __OSDOBJ_COMMON__ |
| 15 | 15 | |
| 16 | 16 | #include "osdepend.h" |
| 17 | #include "modules/osdmodule.h" | |
| 18 | #include "modules/font/font_module.h" | |
| 19 | #include "modules/sound/sound_module.h" | |
| 20 | #include "modules/debugger/debug_module.h" | |
| 21 | 17 | #include "cliopts.h" |
| 22 | 18 | |
| 23 | 19 | //============================================================ |
| r243192 | r243193 | |
| 59 | 55 | // TYPE DEFINITIONS |
| 60 | 56 | //============================================================ |
| 61 | 57 | |
| 58 | /* FIXME: core_options inherits from osd_options. This will force any | |
| 59 | * future osd implementation to use the options below. Actually, these | |
| 60 | * options are *private* to the osd_core. This object should actually be an | |
| 61 | * accessor object. Later ... | |
| 62 | */ | |
| 63 | ||
| 64 | /* FIXME: core_options inherits from osd_options. This will force any | |
| 65 | * future osd implementation to use the options below. Actually, these | |
| 66 | * options are *private* to the osd_core. This object should actually be an | |
| 67 | * accessor object. Later ... | |
| 68 | */ | |
| 69 | ||
| 62 | 70 | class osd_options : public cli_options |
| 63 | 71 | { |
| 64 | 72 | public: |
| 65 | // construction/destruction | |
| 66 | osd_options(); | |
| 73 | // construction/destruction | |
| 74 | osd_options(); | |
| 67 | 75 | |
| 68 | // debugging options | |
| 69 | const char *debugger() const { return value(OSDOPTION_DEBUGGER); } | |
| 70 | int watchdog() const { return int_value(OSDOPTION_WATCHDOG); } | |
| 76 | // debugging options | |
| 77 | const char *debugger() const { return value(OSDOPTION_DEBUGGER); } | |
| 78 | int watchdog() const { return int_value(OSDOPTION_WATCHDOG); } | |
| 71 | 79 | |
| 72 | // performance options | |
| 73 | bool multithreading() const { return bool_value(OSDOPTION_MULTITHREADING); } | |
| 74 | const char *numprocessors() const { return value(OSDOPTION_NUMPROCESSORS); } | |
| 75 | int bench() const { return int_value(OSDOPTION_BENCH); } | |
| 80 | // performance options | |
| 81 | bool multithreading() const { return bool_value(OSDOPTION_MULTITHREADING); } | |
| 82 | const char *numprocessors() const { return value(OSDOPTION_NUMPROCESSORS); } | |
| 83 | int bench() const { return int_value(OSDOPTION_BENCH); } | |
| 76 | 84 | |
| 77 | // video options | |
| 78 | const char *video() const { return value(OSDOPTION_VIDEO); } | |
| 79 | int numscreens() const { return int_value(OSDOPTION_NUMSCREENS); } | |
| 80 | bool window() const { return bool_value(OSDOPTION_WINDOW); } | |
| 81 | bool maximize() const { return bool_value(OSDOPTION_MAXIMIZE); } | |
| 82 | bool keep_aspect() const { return bool_value(OSDOPTION_KEEPASPECT); } | |
| 83 | bool uneven_stretch() const { return bool_value(OSDOPTION_UNEVENSTRETCH); } | |
| 84 | bool wait_vsync() const { return bool_value(OSDOPTION_WAITVSYNC); } | |
| 85 | bool sync_refresh() const { return bool_value(OSDOPTION_SYNCREFRESH); } | |
| 85 | // video options | |
| 86 | const char *video() const { return value(OSDOPTION_VIDEO); } | |
| 87 | int numscreens() const { return int_value(OSDOPTION_NUMSCREENS); } | |
| 88 | bool window() const { return bool_value(OSDOPTION_WINDOW); } | |
| 89 | bool maximize() const { return bool_value(OSDOPTION_MAXIMIZE); } | |
| 90 | bool keep_aspect() const { return bool_value(OSDOPTION_KEEPASPECT); } | |
| 91 | bool uneven_stretch() const { return bool_value(OSDOPTION_UNEVENSTRETCH); } | |
| 92 | bool wait_vsync() const { return bool_value(OSDOPTION_WAITVSYNC); } | |
| 93 | bool sync_refresh() const { return bool_value(OSDOPTION_SYNCREFRESH); } | |
| 86 | 94 | |
| 87 | // per-window options | |
| 88 | const char *screen() const { return value(OSDOPTION_SCREEN); } | |
| 89 | const char *aspect() const { return value(OSDOPTION_ASPECT); } | |
| 90 | const char *resolution() const { return value(OSDOPTION_RESOLUTION); } | |
| 91 | const char *view() const { return value(OSDOPTION_VIEW); } | |
| 92 | const char *screen(int index) const { astring temp; return value(temp.format("%s%d", OSDOPTION_SCREEN, index)); } | |
| 93 | const char *aspect(int index) const { astring temp; return value(temp.format("%s%d", OSDOPTION_ASPECT, index)); } | |
| 94 | const char *resolution(int index) const { astring temp; return value(temp.format("%s%d", OSDOPTION_RESOLUTION, index)); } | |
| 95 | const char *view(int index) const { astring temp; return value(temp.format("%s%d", OSDOPTION_VIEW, index)); } | |
| 95 | // per-window options | |
| 96 | const char *screen() const { return value(OSDOPTION_SCREEN); } | |
| 97 | const char *aspect() const { return value(OSDOPTION_ASPECT); } | |
| 98 | const char *resolution() const { return value(OSDOPTION_RESOLUTION); } | |
| 99 | const char *view() const { return value(OSDOPTION_VIEW); } | |
| 100 | const char *screen(int index) const { astring temp; return value(temp.format("%s%d", OSDOPTION_SCREEN, index)); } | |
| 101 | const char *aspect(int index) const { astring temp; return value(temp.format("%s%d", OSDOPTION_ASPECT, index)); } | |
| 102 | const char *resolution(int index) const { astring temp; return value(temp.format("%s%d", OSDOPTION_RESOLUTION, index)); } | |
| 103 | const char *view(int index) const { astring temp; return value(temp.format("%s%d", OSDOPTION_VIEW, index)); } | |
| 96 | 104 | |
| 97 | // full screen options | |
| 98 | bool switch_res() const { return bool_value(OSDOPTION_SWITCHRES); } | |
| 105 | // full screen options | |
| 106 | bool switch_res() const { return bool_value(OSDOPTION_SWITCHRES); } | |
| 99 | 107 | |
| 100 | // sound options | |
| 101 | const char *sound() const { return value(OSDOPTION_SOUND); } | |
| 102 | int audio_latency() const { return int_value(OSDOPTION_AUDIO_LATENCY); } | |
| 108 | // sound options | |
| 109 | const char *sound() const { return value(OSDOPTION_SOUND); } | |
| 110 | int audio_latency() const { return int_value(OSDOPTION_AUDIO_LATENCY); } | |
| 103 | 111 | |
| 104 | 112 | private: |
| 105 | ||
| 113 | static const options_entry s_option_entries[]; | |
| 106 | 114 | }; |
| 107 | 115 | |
| 116 | class osd_sound_interface; | |
| 117 | class osd_debugger_interface; | |
| 118 | ||
| 119 | // a osd_sound_type is simply a pointer to its alloc function | |
| 120 | typedef osd_sound_interface *(*osd_sound_type)(const osd_interface &osd, running_machine &machine); | |
| 121 | ||
| 122 | // a osd_sound_type is simply a pointer to its alloc function | |
| 123 | typedef osd_debugger_interface *(*osd_debugger_type)(const osd_interface &osd); | |
| 124 | ||
| 125 | ||
| 108 | 126 | // ======================> osd_interface |
| 109 | 127 | |
| 110 | 128 | // description of the currently-running machine |
| r243192 | r243193 | |
| 142 | 160 | // video overridables |
| 143 | 161 | virtual void *get_slider_list(); |
| 144 | 162 | |
| 145 | // command option overrides | |
| 146 | virtual bool execute_command(const char *command); | |
| 163 | // command option overrides | |
| 164 | virtual bool execute_command(const char *command); | |
| 147 | 165 | |
| 148 | osd_font *font_alloc() { return m_font_module->font_alloc(); } | |
| 149 | ||
| 150 | 166 | // FIXME: everything below seems to be osd specific and not part of |
| 151 | 167 | // this INTERFACE but part of the osd IMPLEMENTATION |
| 152 | 168 | |
| 153 | // getters | |
| 154 | running_machine &machine() { assert(m_machine != NULL); return *m_machine; } | |
| 169 | // getters | |
| 170 | running_machine &machine() { assert(m_machine != NULL); return *m_machine; } | |
| 155 | 171 | |
| 156 | 172 | |
| 157 | virtual void debugger_update(); | |
| 173 | virtual void debugger_update(); | |
| 174 | virtual void debugger_exit(); | |
| 175 | virtual void debugger_register(); | |
| 158 | 176 | |
| 159 | ||
| 177 | virtual void init_subsystems(); | |
| 160 | 178 | |
| 161 | virtual bool video_init(); | |
| 162 | virtual void video_register(); | |
| 163 | virtual bool window_init(); | |
| 179 | virtual bool video_init(); | |
| 180 | virtual void video_register(); | |
| 181 | virtual bool window_init(); | |
| 164 | 182 | |
| 165 | virtual void input_resume(); | |
| 166 | virtual bool output_init(); | |
| 167 | virtual bool network_init(); | |
| 168 | virtual bool midi_init(); | |
| 183 | virtual bool sound_init(); | |
| 184 | virtual void sound_register(); | |
| 169 | 185 | |
| 170 | virtual void exit_subsystems(); | |
| 171 | virtual void video_exit(); | |
| 172 | virtual void window_exit(); | |
| 173 | virtual void input_exit(); | |
| 174 | virtual void output_exit(); | |
| 175 | virtual void network_exit(); | |
| 176 | virtual void midi_exit(); | |
| 186 | virtual void input_resume(); | |
| 187 | virtual bool output_init(); | |
| 188 | virtual bool network_init(); | |
| 189 | virtual bool midi_init(); | |
| 177 | 190 | |
| 178 | virtual void osd_exit(); | |
| 191 | virtual void exit_subsystems(); | |
| 192 | virtual void video_exit(); | |
| 193 | virtual void window_exit(); | |
| 194 | virtual void sound_exit(); | |
| 195 | virtual void input_exit(); | |
| 196 | virtual void output_exit(); | |
| 197 | virtual void network_exit(); | |
| 198 | virtual void midi_exit(); | |
| 179 | 199 | |
| 180 | ||
| 200 | virtual void osd_exit(); | |
| 181 | 201 | |
| 182 | osd_options &options() { return m_options; } | |
| 202 | virtual void video_options_add(const char *name, void *type); | |
| 203 | virtual void sound_options_add(const char *name, osd_sound_type type); | |
| 204 | virtual void debugger_options_add(const char *name, osd_debugger_type type); | |
| 183 | 205 | |
| 206 | osd_options &options() { return m_options; } | |
| 207 | ||
| 184 | 208 | protected: |
| 185 | virtual bool input_init(); | |
| 186 | virtual void input_pause(); | |
| 209 | virtual bool input_init(); | |
| 210 | virtual void input_pause(); | |
| 187 | 211 | |
| 188 | 212 | private: |
| 189 | 213 | // internal state |
| 190 | 214 | running_machine * m_machine; |
| 191 | 215 | osd_options& m_options; |
| 192 | 216 | |
| 193 | osd_module_manager m_mod_man; | |
| 194 | font_module *m_font_module; | |
| 195 | ||
| 196 | 217 | void update_option(const char * key, dynamic_array<const char *> &values); |
| 197 | // FIXME: should be elsewhere | |
| 198 | osd_module *select_module_options(const core_options &opts, const astring &opt_name) | |
| 199 | { | |
| 200 | astring opt_val = opts.value(opt_name); | |
| 201 | if (opt_val == "auto") | |
| 202 | opt_val = ""; | |
| 203 | else if (!m_mod_man.type_has_name(opt_name, opt_val)) | |
| 204 | { | |
| 205 | osd_printf_warning("Value %s not supported for option %s - falling back to auto\n", opt_val.cstr(), opt_name.cstr()); | |
| 206 | opt_val = ""; | |
| 207 | } | |
| 208 | return m_mod_man.select_module(opt_name, opt_val); | |
| 209 | } | |
| 210 | 218 | |
| 211 | template<class C> | |
| 212 | C select_module_options(const core_options &opts, const astring &opt_name) | |
| 213 | { | |
| 214 | return dynamic_cast<C>(select_module_options(opts, opt_name)); | |
| 215 | } | |
| 216 | ||
| 217 | 219 | protected: |
| 218 | sound_module* m_sound; | |
| 219 | debug_module* m_debugger; | |
| 220 | osd_sound_interface* m_sound; | |
| 221 | osd_debugger_interface* m_debugger; | |
| 220 | 222 | private: |
| 221 | 223 | //tagmap_t<osd_video_type> m_video_options; |
| 222 | 224 | dynamic_array<const char *> m_video_names; |
| 225 | tagmap_t<osd_sound_type> m_sound_options; | |
| 226 | dynamic_array<const char *> m_sound_names; | |
| 227 | tagmap_t<osd_debugger_type> m_debugger_options; | |
| 228 | dynamic_array<const char *> m_debugger_names; | |
| 223 | 229 | }; |
| 224 | 230 | |
| 225 | 231 | |
| 232 | class osd_sound_interface | |
| 233 | { | |
| 234 | public: | |
| 235 | // construction/destruction | |
| 236 | osd_sound_interface(const osd_interface &osd, running_machine &machine); | |
| 237 | virtual ~osd_sound_interface(); | |
| 238 | ||
| 239 | virtual void update_audio_stream(const INT16 *buffer, int samples_this_frame) = 0; | |
| 240 | virtual void set_mastervolume(int attenuation) = 0; | |
| 241 | protected: | |
| 242 | const osd_interface& m_osd; | |
| 243 | running_machine& m_machine; | |
| 244 | }; | |
| 245 | ||
| 246 | // this template function creates a stub which constructs a sound subsystem | |
| 247 | template<class _DeviceClass> | |
| 248 | osd_sound_interface *osd_sound_creator(const osd_interface &osd, running_machine &machine) | |
| 249 | { | |
| 250 | return global_alloc(_DeviceClass(osd, machine)); | |
| 251 | } | |
| 252 | ||
| 253 | class osd_debugger_interface | |
| 254 | { | |
| 255 | public: | |
| 256 | // construction/destruction | |
| 257 | osd_debugger_interface(const osd_interface &osd); | |
| 258 | virtual ~osd_debugger_interface(); | |
| 259 | ||
| 260 | virtual void init_debugger(running_machine &machine) = 0; | |
| 261 | virtual void wait_for_debugger(device_t &device, bool firststop) = 0; | |
| 262 | virtual void debugger_update() = 0; | |
| 263 | virtual void debugger_exit() = 0; | |
| 264 | ||
| 265 | protected: | |
| 266 | const osd_interface& m_osd; | |
| 267 | }; | |
| 268 | ||
| 226 | 269 | // this template function creates a stub which constructs a debugger |
| 227 | 270 | template<class _DeviceClass> |
| 228 | debug_ | |
| 271 | osd_debugger_interface *osd_debugger_creator(const osd_interface &osd) | |
| 229 | 272 | { |
| 230 | return global_alloc(_DeviceClass()); | |
| 273 | return global_alloc(_DeviceClass(osd)); | |
| 231 | 274 | } |
| 232 | 275 | |
| 233 | 276 | #endif /* __OSDOBJ_COMMON_H__ */ |
| r243192 | r243193 | |
|---|---|---|
| 10 | 10 | |
| 11 | 11 | struct osd_midi_device |
| 12 | 12 | { |
| 13 | ||
| 13 | int dummy; | |
| 14 | 14 | }; |
| 15 | 15 | |
| 16 | 16 | bool osd_midi_init() |
| 17 | 17 | { |
| 18 | ||
| 18 | return true; | |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | void osd_midi_exit() |
| r243192 | r243193 | |
| 24 | 24 | |
| 25 | 25 | void osd_list_midi_devices(void) |
| 26 | 26 | { |
| 27 | ||
| 27 | osd_printf_warning("\nMIDI is not supported in this build\n"); | |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | osd_midi_device *osd_open_midi_input(const char *devname) |
| 31 | 31 | { |
| 32 | ||
| 32 | return NULL; | |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | osd_midi_device *osd_open_midi_output(const char *devname) |
| 36 | 36 | { |
| 37 | ||
| 37 | return NULL; | |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | void osd_close_midi_channel(osd_midi_device *dev) |
| r243192 | r243193 | |
| 43 | 43 | |
| 44 | 44 | bool osd_poll_midi_channel(osd_midi_device *dev) |
| 45 | 45 | { |
| 46 | ||
| 46 | return false; | |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | int osd_read_midi_channel(osd_midi_device *dev, UINT8 *pOut) |
| 50 | 50 | { |
| 51 | ||
| 51 | return 0; | |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | void osd_write_midi_channel(osd_midi_device *dev, UINT8 data) |
| r243192 | r243193 | |
|---|---|---|
| 16 | 16 | |
| 17 | 17 | struct osd_midi_device |
| 18 | 18 | { |
| 19 | PortMidiStream *pmStream; | |
| 20 | PmEvent rx_evBuf[RX_EVENT_BUF_SIZE]; | |
| 21 | UINT8 xmit_in[4]; // Pm_Messages mean we can at most have 3 residue bytes | |
| 22 | int xmit_cnt; | |
| 23 | UINT8 last_status; | |
| 24 | bool rx_sysex; | |
| 19 | PortMidiStream *pmStream; | |
| 20 | PmEvent rx_evBuf[RX_EVENT_BUF_SIZE]; | |
| 21 | UINT8 xmit_in[4]; // Pm_Messages mean we can at most have 3 residue bytes | |
| 22 | int xmit_cnt; | |
| 23 | UINT8 last_status; | |
| 24 | bool rx_sysex; | |
| 25 | 25 | }; |
| 26 | 26 | |
| 27 | 27 | bool osd_midi_init() |
| 28 | 28 | { |
| 29 | Pm_Initialize(); | |
| 30 | return true; | |
| 29 | Pm_Initialize(); | |
| 30 | return true; | |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | void osd_midi_exit() |
| 34 | 34 | { |
| 35 | ||
| 35 | Pm_Terminate(); | |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | void osd_list_midi_devices(void) |
| 39 | 39 | { |
| 40 | int num_devs = Pm_CountDevices(); | |
| 41 | const PmDeviceInfo *pmInfo; | |
| 40 | int num_devs = Pm_CountDevices(); | |
| 41 | const PmDeviceInfo *pmInfo; | |
| 42 | 42 | |
| 43 | ||
| 43 | printf("\n"); | |
| 44 | 44 | |
| 45 | if (num_devs == 0) | |
| 46 | { | |
| 47 | printf("No MIDI ports were found\n"); | |
| 48 | return; | |
| 49 | } | |
| 45 | if (num_devs == 0) | |
| 46 | { | |
| 47 | printf("No MIDI ports were found\n"); | |
| 48 | return; | |
| 49 | } | |
| 50 | 50 | |
| 51 | printf("MIDI input ports:\n"); | |
| 52 | for (int i = 0; i < num_devs; i++) | |
| 53 | { | |
| 54 | pmInfo = Pm_GetDeviceInfo(i); | |
| 51 | printf("MIDI input ports:\n"); | |
| 52 | for (int i = 0; i < num_devs; i++) | |
| 53 | { | |
| 54 | pmInfo = Pm_GetDeviceInfo(i); | |
| 55 | 55 | |
| 56 | if (pmInfo->input) | |
| 57 | { | |
| 58 | printf("%s %s\n", pmInfo->name, (i == Pm_GetDefaultInputDeviceID()) ? "(default)" : ""); | |
| 59 | } | |
| 60 | } | |
| 56 | if (pmInfo->input) | |
| 57 | { | |
| 58 | printf("%s %s\n", pmInfo->name, (i == Pm_GetDefaultInputDeviceID()) ? "(default)" : ""); | |
| 59 | } | |
| 60 | } | |
| 61 | 61 | |
| 62 | printf("\nMIDI output ports:\n"); | |
| 63 | for (int i = 0; i < num_devs; i++) | |
| 64 | { | |
| 65 | pmInfo = Pm_GetDeviceInfo(i); | |
| 62 | printf("\nMIDI output ports:\n"); | |
| 63 | for (int i = 0; i < num_devs; i++) | |
| 64 | { | |
| 65 | pmInfo = Pm_GetDeviceInfo(i); | |
| 66 | 66 | |
| 67 | if (pmInfo->output) | |
| 68 | { | |
| 69 | printf("%s %s\n", pmInfo->name, (i == Pm_GetDefaultOutputDeviceID()) ? "(default)" : ""); | |
| 70 | } | |
| 71 | } | |
| 67 | if (pmInfo->output) | |
| 68 | { | |
| 69 | printf("%s %s\n", pmInfo->name, (i == Pm_GetDefaultOutputDeviceID()) ? "(default)" : ""); | |
| 70 | } | |
| 71 | } | |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | osd_midi_device *osd_open_midi_input(const char *devname) |
| 75 | 75 | { |
| 76 | int num_devs = Pm_CountDevices(); | |
| 77 | int found_dev = -1; | |
| 78 | const PmDeviceInfo *pmInfo; | |
| 79 | PortMidiStream *stm; | |
| 80 | osd_midi_device *ret; | |
| 76 | int num_devs = Pm_CountDevices(); | |
| 77 | int found_dev = -1; | |
| 78 | const PmDeviceInfo *pmInfo; | |
| 79 | PortMidiStream *stm; | |
| 80 | osd_midi_device *ret; | |
| 81 | 81 | |
| 82 | if (!strcmp("default", devname)) | |
| 83 | { | |
| 84 | found_dev = Pm_GetDefaultInputDeviceID(); | |
| 85 | } | |
| 86 | else | |
| 87 | { | |
| 88 | for (int i = 0; i < num_devs; i++) | |
| 89 | { | |
| 90 | pmInfo = Pm_GetDeviceInfo(i); | |
| 82 | if (!strcmp("default", devname)) | |
| 83 | { | |
| 84 | found_dev = Pm_GetDefaultInputDeviceID(); | |
| 85 | } | |
| 86 | else | |
| 87 | { | |
| 88 | for (int i = 0; i < num_devs; i++) | |
| 89 | { | |
| 90 | pmInfo = Pm_GetDeviceInfo(i); | |
| 91 | 91 | |
| 92 | if (pmInfo->input) | |
| 93 | { | |
| 94 | if (!strcmp(devname, pmInfo->name)) | |
| 95 | { | |
| 96 | found_dev = i; | |
| 97 | break; | |
| 98 | } | |
| 99 | } | |
| 100 | } | |
| 101 | } | |
| 92 | if (pmInfo->input) | |
| 93 | { | |
| 94 | if (!strcmp(devname, pmInfo->name)) | |
| 95 | { | |
| 96 | found_dev = i; | |
| 97 | break; | |
| 98 | } | |
| 99 | } | |
| 100 | } | |
| 101 | } | |
| 102 | 102 | |
| 103 | if (found_dev >= 0) | |
| 104 | { | |
| 105 | if (Pm_OpenInput(&stm, found_dev, NULL, RX_EVENT_BUF_SIZE, NULL, NULL) == pmNoError) | |
| 106 | { | |
| 107 | ret = (osd_midi_device *)osd_malloc(sizeof(osd_midi_device)); | |
| 108 | memset(ret, 0, sizeof(osd_midi_device)); | |
| 109 | ret->pmStream = stm; | |
| 110 | return ret; | |
| 111 | } | |
| 112 | else | |
| 113 | { | |
| 114 | printf("Couldn't open PM device\n"); | |
| 115 | return NULL; | |
| 116 | } | |
| 117 | } | |
| 118 | else | |
| 119 | { | |
| 120 | return NULL; | |
| 121 | } | |
| 103 | if (found_dev >= 0) | |
| 104 | { | |
| 105 | if (Pm_OpenInput(&stm, found_dev, NULL, RX_EVENT_BUF_SIZE, NULL, NULL) == pmNoError) | |
| 106 | { | |
| 107 | ret = (osd_midi_device *)osd_malloc(sizeof(osd_midi_device)); | |
| 108 | memset(ret, 0, sizeof(osd_midi_device)); | |
| 109 | ret->pmStream = stm; | |
| 110 | return ret; | |
| 111 | } | |
| 112 | else | |
| 113 | { | |
| 114 | printf("Couldn't open PM device\n"); | |
| 115 | return NULL; | |
| 116 | } | |
| 117 | } | |
| 118 | else | |
| 119 | { | |
| 120 | return NULL; | |
| 121 | } | |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | osd_midi_device *osd_open_midi_output(const char *devname) |
| 125 | 125 | { |
| 126 | int num_devs = Pm_CountDevices(); | |
| 127 | int found_dev = -1; | |
| 128 | const PmDeviceInfo *pmInfo; | |
| 129 | PortMidiStream *stm; | |
| 130 | osd_midi_device *ret; | |
| 126 | int num_devs = Pm_CountDevices(); | |
| 127 | int found_dev = -1; | |
| 128 | const PmDeviceInfo *pmInfo; | |
| 129 | PortMidiStream *stm; | |
| 130 | osd_midi_device *ret; | |
| 131 | 131 | |
| 132 | if (!strcmp("default", devname)) | |
| 133 | { | |
| 134 | found_dev = Pm_GetDefaultOutputDeviceID(); | |
| 135 | } | |
| 136 | else | |
| 137 | { | |
| 138 | for (int i = 0; i < num_devs; i++) | |
| 139 | { | |
| 140 | pmInfo = Pm_GetDeviceInfo(i); | |
| 132 | if (!strcmp("default", devname)) | |
| 133 | { | |
| 134 | found_dev = Pm_GetDefaultOutputDeviceID(); | |
| 135 | } | |
| 136 | else | |
| 137 | { | |
| 138 | for (int i = 0; i < num_devs; i++) | |
| 139 | { | |
| 140 | pmInfo = Pm_GetDeviceInfo(i); | |
| 141 | 141 | |
| 142 | if (pmInfo->output) | |
| 143 | { | |
| 144 | if (!strcmp(devname, pmInfo->name)) | |
| 145 | { | |
| 146 | found_dev = i; | |
| 147 | break; | |
| 148 | } | |
| 149 | } | |
| 150 | } | |
| 151 | } | |
| 142 | if (pmInfo->output) | |
| 143 | { | |
| 144 | if (!strcmp(devname, pmInfo->name)) | |
| 145 | { | |
| 146 | found_dev = i; | |
| 147 | break; | |
| 148 | } | |
| 149 | } | |
| 150 | } | |
| 151 | } | |
| 152 | 152 | |
| 153 | if (found_dev >= 0) | |
| 154 | { | |
| 155 | if (Pm_OpenOutput(&stm, found_dev, NULL, 100, NULL, NULL, 0) == pmNoError) | |
| 156 | { | |
| 157 | ret = (osd_midi_device *)osd_malloc(sizeof(osd_midi_device)); | |
| 158 | memset(ret, 0, sizeof(osd_midi_device)); | |
| 159 | ret->pmStream = stm; | |
| 160 | return ret; | |
| 161 | } | |
| 162 | else | |
| 163 | { | |
| 164 | printf("Couldn't open PM device\n"); | |
| 165 | return NULL; | |
| 166 | } | |
| 167 | } | |
| 168 | else | |
| 169 | { | |
| 170 | return NULL; | |
| 171 | } | |
| 172 | return NULL; | |
| 153 | if (found_dev >= 0) | |
| 154 | { | |
| 155 | if (Pm_OpenOutput(&stm, found_dev, NULL, 100, NULL, NULL, 0) == pmNoError) | |
| 156 | { | |
| 157 | ret = (osd_midi_device *)osd_malloc(sizeof(osd_midi_device)); | |
| 158 | memset(ret, 0, sizeof(osd_midi_device)); | |
| 159 | ret->pmStream = stm; | |
| 160 | return ret; | |
| 161 | } | |
| 162 | else | |
| 163 | { | |
| 164 | printf("Couldn't open PM device\n"); | |
| 165 | return NULL; | |
| 166 | } | |
| 167 | } | |
| 168 | else | |
| 169 | { | |
| 170 | return NULL; | |
| 171 | } | |
| 172 | return NULL; | |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | void osd_close_midi_channel(osd_midi_device *dev) |
| 176 | 176 | { |
| 177 | Pm_Close(dev->pmStream); | |
| 178 | osd_free(dev); | |
| 177 | Pm_Close(dev->pmStream); | |
| 178 | osd_free(dev); | |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | bool osd_poll_midi_channel(osd_midi_device *dev) |
| 182 | 182 | { |
| 183 | ||
| 183 | PmError chk = Pm_Poll(dev->pmStream); | |
| 184 | 184 | |
| 185 | ||
| 185 | return (chk == pmGotData) ? true : false; | |
| 186 | 186 | } |
| 187 | 187 | |
| 188 | 188 | int osd_read_midi_channel(osd_midi_device *dev, UINT8 *pOut) |
| 189 | 189 | { |
| 190 | int msgsRead = Pm_Read(dev->pmStream, dev->rx_evBuf, RX_EVENT_BUF_SIZE); | |
| 191 | int bytesOut = 0; | |
| 190 | int msgsRead = Pm_Read(dev->pmStream, dev->rx_evBuf, RX_EVENT_BUF_SIZE); | |
| 191 | int bytesOut = 0; | |
| 192 | 192 | |
| 193 | if (msgsRead <= 0) | |
| 194 | { | |
| 195 | return 0; | |
| 196 | } | |
| 193 | if (msgsRead <= 0) | |
| 194 | { | |
| 195 | return 0; | |
| 196 | } | |
| 197 | 197 | |
| 198 | for (int msg = 0; msg < msgsRead; msg++) | |
| 199 | { | |
| 200 | UINT8 status = Pm_MessageStatus(dev->rx_evBuf[msg].message); | |
| 198 | for (int msg = 0; msg < msgsRead; msg++) | |
| 199 | { | |
| 200 | UINT8 status = Pm_MessageStatus(dev->rx_evBuf[msg].message); | |
| 201 | 201 | |
| 202 | if (dev->rx_sysex) | |
| 203 | { | |
| 204 | if (status & 0x80) // sys real-time imposing on us? | |
| 205 | { | |
| 206 | if ((status == 0xf2) || (status == 0xf3)) | |
| 207 | { | |
| 208 | *pOut++ = status; | |
| 209 | *pOut++ = Pm_MessageData1(dev->rx_evBuf[msg].message); | |
| 210 | *pOut++ = Pm_MessageData2(dev->rx_evBuf[msg].message); | |
| 211 | bytesOut += 3; | |
| 212 | } | |
| 213 | else | |
| 214 | { | |
| 215 | *pOut++ = status; | |
| 216 | bytesOut++; | |
| 217 | if (status == MIDI_EOX) | |
| 218 | { | |
| 219 | dev->rx_sysex = false; | |
| 220 | } | |
| 221 | } | |
| 222 | } | |
| 223 | else // shift out the sysex bytes | |
| 224 | { | |
| 225 | for (int i = 0; i < 4; i++) | |
| 226 | { | |
| 227 | UINT8 byte = dev->rx_evBuf[msg].message & 0xff; | |
| 228 | *pOut++ = byte; | |
| 229 | bytesOut++; | |
| 230 | if (byte == MIDI_EOX) | |
| 231 | { | |
| 232 | dev->rx_sysex = false; | |
| 233 | break; | |
| 234 | } | |
| 235 | dev->rx_evBuf[msg].message >>= 8; | |
| 236 | } | |
| 237 | } | |
| 238 | } | |
| 239 | else | |
| 240 | { | |
| 241 | switch ((status>>4) & 0xf) | |
| 242 | { | |
| 243 | case 0xc: // 2-byte messages | |
| 244 | case 0xd: | |
| 245 | *pOut++ = status; | |
| 246 | *pOut++ = Pm_MessageData1(dev->rx_evBuf[msg].message); | |
| 247 | bytesOut += 2; | |
| 248 | break; | |
| 202 | if (dev->rx_sysex) | |
| 203 | { | |
| 204 | if (status & 0x80) // sys real-time imposing on us? | |
| 205 | { | |
| 206 | if ((status == 0xf2) || (status == 0xf3)) | |
| 207 | { | |
| 208 | *pOut++ = status; | |
| 209 | *pOut++ = Pm_MessageData1(dev->rx_evBuf[msg].message); | |
| 210 | *pOut++ = Pm_MessageData2(dev->rx_evBuf[msg].message); | |
| 211 | bytesOut += 3; | |
| 212 | } | |
| 213 | else | |
| 214 | { | |
| 215 | *pOut++ = status; | |
| 216 | bytesOut++; | |
| 217 | if (status == MIDI_EOX) | |
| 218 | { | |
| 219 | dev->rx_sysex = false; | |
| 220 | } | |
| 221 | } | |
| 222 | } | |
| 223 | else // shift out the sysex bytes | |
| 224 | { | |
| 225 | for (int i = 0; i < 4; i++) | |
| 226 | { | |
| 227 | UINT8 byte = dev->rx_evBuf[msg].message & 0xff; | |
| 228 | *pOut++ = byte; | |
| 229 | bytesOut++; | |
| 230 | if (byte == MIDI_EOX) | |
| 231 | { | |
| 232 | dev->rx_sysex = false; | |
| 233 | break; | |
| 234 | } | |
| 235 | dev->rx_evBuf[msg].message >>= 8; | |
| 236 | } | |
| 237 | } | |
| 238 | } | |
| 239 | else | |
| 240 | { | |
| 241 | switch ((status>>4) & 0xf) | |
| 242 | { | |
| 243 | case 0xc: // 2-byte messages | |
| 244 | case 0xd: | |
| 245 | *pOut++ = status; | |
| 246 | *pOut++ = Pm_MessageData1(dev->rx_evBuf[msg].message); | |
| 247 | bytesOut += 2; | |
| 248 | break; | |
| 249 | 249 | |
| 250 | case 0xf: // system common | |
| 251 | switch (status & 0xf) | |
| 252 | { | |
| 253 | case 0: // System Exclusive | |
| 254 | { | |
| 255 | *pOut++ = status; // this should be OK: the shortest legal sysex is F0 tt dd F7, I believe | |
| 256 | *pOut++ = (dev->rx_evBuf[msg].message>>8) & 0xff; | |
| 257 | *pOut++ = (dev->rx_evBuf[msg].message>>16) & 0xff; | |
| 258 | UINT8 last = *pOut++ = (dev->rx_evBuf[msg].message>>24) & 0xff; | |
| 259 | bytesOut += 4; | |
| 260 | dev->rx_sysex = (last != MIDI_EOX); | |
| 261 | break; | |
| 262 | } | |
| 250 | case 0xf: // system common | |
| 251 | switch (status & 0xf) | |
| 252 | { | |
| 253 | case 0: // System Exclusive | |
| 254 | { | |
| 255 | *pOut++ = status; // this should be OK: the shortest legal sysex is F0 tt dd F7, I believe | |
| 256 | *pOut++ = (dev->rx_evBuf[msg].message>>8) & 0xff; | |
| 257 | *pOut++ = (dev->rx_evBuf[msg].message>>16) & 0xff; | |
| 258 | UINT8 last = *pOut++ = (dev->rx_evBuf[msg].message>>24) & 0xff; | |
| 259 | bytesOut += 4; | |
| 260 | dev->rx_sysex = (last != MIDI_EOX); | |
| 261 | break; | |
| 262 | } | |
| 263 | 263 | |
| 264 | case 7: // End of System Exclusive | |
| 265 | *pOut++ = status; | |
| 266 | bytesOut += 1; | |
| 267 | dev->rx_sysex = false; | |
| 268 | break; | |
| 264 | case 7: // End of System Exclusive | |
| 265 | *pOut++ = status; | |
| 266 | bytesOut += 1; | |
| 267 | dev->rx_sysex = false; | |
| 268 | break; | |
| 269 | 269 | |
| 270 | case 2: // song pos | |
| 271 | case 3: // song select | |
| 272 | *pOut++ = status; | |
| 273 | *pOut++ = Pm_MessageData1(dev->rx_evBuf[msg].message); | |
| 274 | *pOut++ = Pm_MessageData2(dev->rx_evBuf[msg].message); | |
| 275 | bytesOut += 3; | |
| 276 | break; | |
| 270 | case 2: // song pos | |
| 271 | case 3: // song select | |
| 272 | *pOut++ = status; | |
| 273 | *pOut++ = Pm_MessageData1(dev->rx_evBuf[msg].message); | |
| 274 | *pOut++ = Pm_MessageData2(dev->rx_evBuf[msg].message); | |
| 275 | bytesOut += 3; | |
| 276 | break; | |
| 277 | 277 | |
| 278 | default: // all other defined Fx messages are 1 byte | |
| 279 | break; | |
| 280 | } | |
| 281 | break; | |
| 278 | default: // all other defined Fx messages are 1 byte | |
| 279 | break; | |
| 280 | } | |
| 281 | break; | |
| 282 | 282 | |
| 283 | default: | |
| 284 | *pOut++ = status; | |
| 285 | *pOut++ = Pm_MessageData1(dev->rx_evBuf[msg].message); | |
| 286 | *pOut++ = Pm_MessageData2(dev->rx_evBuf[msg].message); | |
| 287 | bytesOut += 3; | |
| 288 | break; | |
| 289 | } | |
| 290 | } | |
| 291 | } | |
| 283 | default: | |
| 284 | *pOut++ = status; | |
| 285 | *pOut++ = Pm_MessageData1(dev->rx_evBuf[msg].message); | |
| 286 | *pOut++ = Pm_MessageData2(dev->rx_evBuf[msg].message); | |
| 287 | bytesOut += 3; | |
| 288 | break; | |
| 289 | } | |
| 290 | } | |
| 291 | } | |
| 292 | 292 | |
| 293 | ||
| 293 | return bytesOut; | |
| 294 | 294 | } |
| 295 | 295 | |
| 296 | 296 | void osd_write_midi_channel(osd_midi_device *dev, UINT8 data) |
| 297 | 297 | { |
| 298 | int bytes_needed = 0; | |
| 299 | PmEvent ev; | |
| 300 | ev.timestamp = 0; // use the current time | |
| 298 | int bytes_needed = 0; | |
| 299 | PmEvent ev; | |
| 300 | ev.timestamp = 0; // use the current time | |
| 301 | 301 | |
| 302 | 302 | // printf("write: %02x (%d)\n", data, dev->xmit_cnt); |
| 303 | 303 | |
| 304 | // reject data bytes when no valid status exists | |
| 305 | if ((dev->last_status == 0) && !(data & 0x80)) | |
| 306 | { | |
| 307 | dev->xmit_cnt = 0; | |
| 308 | return; | |
| 309 | } | |
| 304 | // reject data bytes when no valid status exists | |
| 305 | if ((dev->last_status == 0) && !(data & 0x80)) | |
| 306 | { | |
| 307 | dev->xmit_cnt = 0; | |
| 308 | return; | |
| 309 | } | |
| 310 | 310 | |
| 311 | if (dev->xmit_cnt >= 4) | |
| 312 | { | |
| 313 | printf("MIDI out: packet assembly overflow, contact MAMEdev!\n"); | |
| 314 | return; | |
| 315 | } | |
| 311 | if (dev->xmit_cnt >= 4) | |
| 312 | { | |
| 313 | printf("MIDI out: packet assembly overflow, contact MAMEdev!\n"); | |
| 314 | return; | |
| 315 | } | |
| 316 | 316 | |
| 317 | // handle sysex | |
| 318 | if (dev->last_status == MIDI_SYSEX) | |
| 319 | { | |
| 317 | // handle sysex | |
| 318 | if (dev->last_status == MIDI_SYSEX) | |
| 319 | { | |
| 320 | 320 | // printf("sysex: %02x (%d)\n", data, dev->xmit_cnt); |
| 321 | 321 | |
| 322 | // if we get a status that isn't sysex, assume it's system common | |
| 323 | if ((data & 0x80) && (data != MIDI_EOX)) | |
| 324 | { | |
| 322 | // if we get a status that isn't sysex, assume it's system common | |
| 323 | if ((data & 0x80) && (data != MIDI_EOX)) | |
| 324 | { | |
| 325 | 325 | // printf("common during sysex!\n"); |
| 326 | ev.message = Pm_Message(data, 0, 0); | |
| 327 | Pm_Write(dev->pmStream, &ev, 1); | |
| 328 | return; | |
| 329 | } | |
| 326 | ev.message = Pm_Message(data, 0, 0); | |
| 327 | Pm_Write(dev->pmStream, &ev, 1); | |
| 328 | return; | |
| 329 | } | |
| 330 | 330 | |
| 331 | ||
| 331 | dev->xmit_in[dev->xmit_cnt++] = data; | |
| 332 | 332 | |
| 333 | // if EOX or 4 bytes filled, transmit 4 bytes | |
| 334 | if ((dev->xmit_cnt == 4) || (data == MIDI_EOX)) | |
| 335 | { | |
| 336 | ev.message = dev->xmit_in[0] | (dev->xmit_in[1]<<8) | (dev->xmit_in[2]<<16) | (dev->xmit_in[3]<<24); | |
| 337 | Pm_Write(dev->pmStream, &ev, 1); | |
| 338 | dev->xmit_in[0] = dev->xmit_in[1] = dev->xmit_in[2] = dev->xmit_in[3] = 0; | |
| 339 | dev->xmit_cnt = 0; | |
| 333 | // if EOX or 4 bytes filled, transmit 4 bytes | |
| 334 | if ((dev->xmit_cnt == 4) || (data == MIDI_EOX)) | |
| 335 | { | |
| 336 | ev.message = dev->xmit_in[0] | (dev->xmit_in[1]<<8) | (dev->xmit_in[2]<<16) | (dev->xmit_in[3]<<24); | |
| 337 | Pm_Write(dev->pmStream, &ev, 1); | |
| 338 | dev->xmit_in[0] = dev->xmit_in[1] = dev->xmit_in[2] = dev->xmit_in[3] = 0; | |
| 339 | dev->xmit_cnt = 0; | |
| 340 | 340 | |
| 341 | 341 | // printf("SysEx packet: %08x\n", ev.message); |
| 342 | 342 | |
| 343 | // if this is EOX, kill the running status | |
| 344 | if (data == MIDI_EOX) | |
| 345 | { | |
| 346 | dev->last_status = 0; | |
| 347 | } | |
| 348 | } | |
| 343 | // if this is EOX, kill the running status | |
| 344 | if (data == MIDI_EOX) | |
| 345 | { | |
| 346 | dev->last_status = 0; | |
| 347 | } | |
| 348 | } | |
| 349 | 349 | |
| 350 | return; | |
| 351 | } | |
| 350 | return; | |
| 351 | } | |
| 352 | 352 | |
| 353 | // handle running status. don't allow system real-time messages to be considered as running status. | |
| 354 | if ((dev->xmit_cnt == 0) && (data & 0x80) && (data < 0xf8)) | |
| 355 | { | |
| 356 | dev->last_status = data; | |
| 357 | } | |
| 353 | // handle running status. don't allow system real-time messages to be considered as running status. | |
| 354 | if ((dev->xmit_cnt == 0) && (data & 0x80) && (data < 0xf8)) | |
| 355 | { | |
| 356 | dev->last_status = data; | |
| 357 | } | |
| 358 | 358 | |
| 359 | if ((dev->xmit_cnt == 0) && !(data & 0x80)) | |
| 360 | { | |
| 361 | dev->xmit_in[dev->xmit_cnt++] = dev->last_status; | |
| 362 | dev->xmit_in[dev->xmit_cnt++] = data; | |
| 359 | if ((dev->xmit_cnt == 0) && !(data & 0x80)) | |
| 360 | { | |
| 361 | dev->xmit_in[dev->xmit_cnt++] = dev->last_status; | |
| 362 | dev->xmit_in[dev->xmit_cnt++] = data; | |
| 363 | 363 | // printf("\trunning status: [%d] = %02x, [%d] = %02x, last_status = %02x\n", dev->xmit_cnt-2, dev->last_status, dev->xmit_cnt-1, data, dev->last_status); |
| 364 | } | |
| 365 | else | |
| 366 | { | |
| 367 | dev->xmit_in[dev->xmit_cnt++] = data; | |
| 364 | } | |
| 365 | else | |
| 366 | { | |
| 367 | dev->xmit_in[dev->xmit_cnt++] = data; | |
| 368 | 368 | // printf("\tNRS: [%d] = %02x\n", dev->xmit_cnt-1, data); |
| 369 | ||
| 369 | } | |
| 370 | 370 | |
| 371 | if ((dev->xmit_cnt == 1) && (dev->xmit_in[0] == MIDI_SYSEX)) | |
| 372 | { | |
| 371 | if ((dev->xmit_cnt == 1) && (dev->xmit_in[0] == MIDI_SYSEX)) | |
| 372 | { | |
| 373 | 373 | // printf("Start SysEx!\n"); |
| 374 | dev->last_status = MIDI_SYSEX; | |
| 375 | return; | |
| 376 | } | |
| 374 | dev->last_status = MIDI_SYSEX; | |
| 375 | return; | |
| 376 | } | |
| 377 | 377 | |
| 378 | ||
| 378 | // are we there yet? | |
| 379 | 379 | // printf("status check: %02x\n", dev->xmit_in[0]); |
| 380 | switch ((dev->xmit_in[0]>>4) & 0xf) | |
| 381 | { | |
| 382 | case 0xc: // 2-byte messages | |
| 383 | case 0xd: | |
| 384 | bytes_needed = 2; | |
| 385 | break; | |
| 380 | switch ((dev->xmit_in[0]>>4) & 0xf) | |
| 381 | { | |
| 382 | case 0xc: // 2-byte messages | |
| 383 | case 0xd: | |
| 384 | bytes_needed = 2; | |
| 385 | break; | |
| 386 | 386 | |
| 387 | case 0xf: // system common | |
| 388 | switch (dev->xmit_in[0] & 0xf) | |
| 389 | { | |
| 390 | case 0: // System Exclusive is handled above | |
| 391 | break; | |
| 387 | case 0xf: // system common | |
| 388 | switch (dev->xmit_in[0] & 0xf) | |
| 389 | { | |
| 390 | case 0: // System Exclusive is handled above | |
| 391 | break; | |
| 392 | 392 | |
| 393 | case 7: // End of System Exclusive | |
| 394 | bytes_needed = 1; | |
| 395 | break; | |
| 393 | case 7: // End of System Exclusive | |
| 394 | bytes_needed = 1; | |
| 395 | break; | |
| 396 | 396 | |
| 397 | case 2: // song pos | |
| 398 | case 3: // song select | |
| 399 | bytes_needed = 3; | |
| 400 | break; | |
| 397 | case 2: // song pos | |
| 398 | case 3: // song select | |
| 399 | bytes_needed = 3; | |
| 400 | break; | |
| 401 | 401 | |
| 402 | default: // all other defined Fx messages are 1 byte | |
| 403 | bytes_needed = 1; | |
| 404 | break; | |
| 405 | } | |
| 406 | break; | |
| 402 | default: // all other defined Fx messages are 1 byte | |
| 403 | bytes_needed = 1; | |
| 404 | break; | |
| 405 | } | |
| 406 | break; | |
| 407 | 407 | |
| 408 | default: | |
| 409 | bytes_needed = 3; | |
| 410 | break; | |
| 411 | } | |
| 408 | default: | |
| 409 | bytes_needed = 3; | |
| 410 | break; | |
| 411 | } | |
| 412 | 412 | |
| 413 | if (dev->xmit_cnt == bytes_needed) | |
| 414 | { | |
| 415 | ev.message = Pm_Message(dev->xmit_in[0], dev->xmit_in[1], dev->xmit_in[2]); | |
| 416 | Pm_Write(dev->pmStream, &ev, 1); | |
| 417 | dev->xmit_cnt = 0; | |
| 418 | } | |
| 413 | if (dev->xmit_cnt == bytes_needed) | |
| 414 | { | |
| 415 | ev.message = Pm_Message(dev->xmit_in[0], dev->xmit_in[1], dev->xmit_in[2]); | |
| 416 | Pm_Write(dev->pmStream, &ev, 1); | |
| 417 | dev->xmit_cnt = 0; | |
| 418 | } | |
| 419 | 419 | |
| 420 | 420 | } |
| r243192 | r243193 | |
|---|---|---|
| 1 | /* | |
| 2 | * osdmodule.c | |
| 3 | * | |
| 4 | */ | |
| 5 | ||
| 6 | #include "modules/osdmodule.h" | |
| 7 | ||
| 8 | osd_module_manager::osd_module_manager() | |
| 9 | { | |
| 10 | for (int i=0; i<MAX_MODULES; i++) | |
| 11 | { | |
| 12 | m_modules[i] = NULL; | |
| 13 | m_selected[i] = NULL; | |
| 14 | } | |
| 15 | } | |
| 16 | osd_module_manager::~osd_module_manager() | |
| 17 | { | |
| 18 | for (int i = 0; m_modules[i] != NULL; i++) | |
| 19 | { | |
| 20 | m_modules[i]->~osd_module(); | |
| 21 | osd_free(m_modules[i]); | |
| 22 | } | |
| 23 | } | |
| 24 | ||
| 25 | void osd_module_manager::register_module(const module_type &mod_type) | |
| 26 | { | |
| 27 | osd_module *module = mod_type(); | |
| 28 | if (module->probe()) | |
| 29 | { | |
| 30 | osd_printf_verbose("===> registered module %s %s\n", module->name(), module->type()); | |
| 31 | ||
| 32 | int i; | |
| 33 | for (i = 0; m_modules[i] != NULL; i++) | |
| 34 | ; | |
| 35 | m_modules[i] = module; | |
| 36 | } | |
| 37 | else | |
| 38 | { | |
| 39 | osd_printf_verbose("===> not supported %s %s\n", module->name(), module->type()); | |
| 40 | module->~osd_module(); | |
| 41 | osd_free(module); | |
| 42 | } | |
| 43 | } | |
| 44 | ||
| 45 | bool osd_module_manager::type_has_name(const char *type, const char *name) | |
| 46 | { | |
| 47 | return (get_module_index(type, name) >= 0); | |
| 48 | } | |
| 49 | ||
| 50 | osd_module *osd_module_manager::get_module_generic(const char *type, const char *name) | |
| 51 | { | |
| 52 | int i = get_module_index(type, name); | |
| 53 | if (i>=0) | |
| 54 | return m_modules[i]; | |
| 55 | else | |
| 56 | return NULL; | |
| 57 | } | |
| 58 | ||
| 59 | osd_module *osd_module_manager::select_module(const char *type, const char *name) | |
| 60 | { | |
| 61 | osd_module *m = get_module_generic(type, name); | |
| 62 | ||
| 63 | // FIXME: check if already exists! | |
| 64 | int i; | |
| 65 | for (i = 0; m_selected[i] != NULL; i++) | |
| 66 | ; | |
| 67 | m_selected[i] = m; | |
| 68 | return m; | |
| 69 | } | |
| 70 | ||
| 71 | void osd_module_manager::init() | |
| 72 | { | |
| 73 | for (int i = 0; m_selected[i] != NULL; i++) | |
| 74 | { | |
| 75 | m_selected[i]->init(); | |
| 76 | } | |
| 77 | } | |
| 78 | ||
| 79 | void osd_module_manager::exit() | |
| 80 | { | |
| 81 | // Find count | |
| 82 | int cnt; | |
| 83 | for (cnt = 0; m_selected[cnt] != NULL; cnt++) | |
| 84 | ; | |
| 85 | for (int i = cnt - 1; i >= 0; i--) | |
| 86 | { | |
| 87 | m_selected[i]->exit(); | |
| 88 | m_selected[i] = NULL; | |
| 89 | } | |
| 90 | } | |
| 91 | ||
| 92 | int osd_module_manager::get_module_index(const char *type, const char *name) | |
| 93 | { | |
| 94 | for (int i = 0; m_modules[i] != NULL; i++) | |
| 95 | { | |
| 96 | if (strcmp(m_modules[i]->type(), type) == 0 && ((name[0] == 0) || (strcmp(name, m_modules[i]->name())==0))) | |
| 97 | return i; | |
| 98 | } | |
| 99 | return -1; | |
| 100 | } | |
| 101 | ||
| 102 | void osd_module_manager::get_module_names(const char *type, const int max, int *num, const char *names[]) | |
| 103 | { | |
| 104 | *num = 0; | |
| 105 | for (int i = 0; m_modules[i] != NULL; i++) | |
| 106 | { | |
| 107 | if ((strcmp(m_modules[i]->type(), type) == 0) && (*num < max)) | |
| 108 | { | |
| 109 | names[*num] = m_modules[i]->name(); | |
| 110 | *num = *num + 1; | |
| 111 | } | |
| 112 | ||
| 113 | } | |
| 114 | } |
| r243192 | r243193 | |
|---|---|---|
| 1 | /*************************************************************************** | |
| 2 | ||
| 3 | osdmodule.h | |
| 4 | ||
| 5 | OSD module manangement | |
| 6 | ||
| 7 | *******************************************************************c********/ | |
| 8 | ||
| 9 | //#pragma once | |
| 10 | ||
| 11 | #ifndef __OSDMODULE_H__ | |
| 12 | #define __OSDMODULE_H__ | |
| 13 | ||
| 14 | #include "osdcore.h" | |
| 15 | #include "osdepend.h" | |
| 16 | ||
| 17 | //============================================================ | |
| 18 | // TYPE DEFINITIONS | |
| 19 | //============================================================ | |
| 20 | ||
| 21 | class osd_module; | |
| 22 | ||
| 23 | // ======================> osd_module | |
| 24 | ||
| 25 | class osd_module | |
| 26 | { | |
| 27 | public: | |
| 28 | ||
| 29 | osd_module(const char *type, const char *name) | |
| 30 | : m_name(name), m_type(type) | |
| 31 | {} | |
| 32 | virtual ~osd_module() { } | |
| 33 | ||
| 34 | const char * name() const { return m_name; } | |
| 35 | const char * type() const { return m_type; } | |
| 36 | ||
| 37 | virtual bool probe() const { return true; } | |
| 38 | ||
| 39 | virtual int init() { return 0; } | |
| 40 | virtual void exit() { } | |
| 41 | ||
| 42 | private: | |
| 43 | astring m_name; | |
| 44 | astring m_type; | |
| 45 | }; | |
| 46 | ||
| 47 | // a module_type is simply a pointer to its alloc function | |
| 48 | typedef osd_module *(*module_type)(); | |
| 49 | ||
| 50 | // this template function creates a stub which constructs a module | |
| 51 | template<class _ModuleClass> | |
| 52 | osd_module *module_creator() | |
| 53 | { | |
| 54 | void *p = osd_malloc(sizeof(_ModuleClass)); | |
| 55 | return new(p) _ModuleClass; | |
| 56 | } | |
| 57 | ||
| 58 | class osd_module_manager | |
| 59 | { | |
| 60 | public: | |
| 61 | ||
| 62 | static const int MAX_MODULES = 32; | |
| 63 | ||
| 64 | osd_module_manager(); | |
| 65 | ~osd_module_manager(); | |
| 66 | ||
| 67 | void register_module(const module_type &mod_type); | |
| 68 | bool type_has_name(const char *type, const char *name); | |
| 69 | ||
| 70 | osd_module *get_module_generic(const char *type, const char *name); | |
| 71 | ||
| 72 | template<class C> | |
| 73 | C select_module(const char *type, const char *name = "") | |
| 74 | { | |
| 75 | return dynamic_cast<C>(select_module(type, name)); | |
| 76 | } | |
| 77 | ||
| 78 | osd_module *select_module(const char *type, const char *name = ""); | |
| 79 | ||
| 80 | void get_module_names(const char *type, const int max, int *num, const char *names[]); | |
| 81 | ||
| 82 | void init(); | |
| 83 | ||
| 84 | void exit(); | |
| 85 | ||
| 86 | private: | |
| 87 | int get_module_index(const char *type, const char *name); | |
| 88 | ||
| 89 | osd_module *m_modules[MAX_MODULES]; | |
| 90 | osd_module *m_selected[MAX_MODULES]; | |
| 91 | }; | |
| 92 | ||
| 93 | #define MODULE_DEFINITION(_id, _class) \ | |
| 94 | extern const module_type _id ; \ | |
| 95 | const module_type _id = &module_creator< _class >; | |
| 96 | ||
| 97 | ||
| 98 | #define MODULE_NOT_SUPPORTED(_mod, _type, _name) \ | |
| 99 | class _mod : public osd_module { \ | |
| 100 | public: \ | |
| 101 | _mod () \ | |
| 102 | : osd_module(_type, _name) {} \ | |
| 103 | bool probe() const { return false; } \ | |
| 104 | }; | |
| 105 | ||
| 106 | #endif /* __OSDMODULE_H__ */ |
| r243192 | r243193 | |
|---|---|---|
| 6 | 6 | // |
| 7 | 7 | //============================================================ |
| 8 | 8 | |
| 9 | #include "sound_module.h" | |
| 10 | #include "modules/osdmodule.h" | |
| 11 | ||
| 12 | #if defined(OSD_WINDOWS) || defined(SDLMAME_WIN32) | |
| 13 | ||
| 14 | 9 | // standard windows headers |
| 15 | 10 | #define WIN32_LEAN_AND_MEAN |
| 16 | 11 | #include <windows.h> |
| r243192 | r243193 | |
| 26 | 21 | #include "osdepend.h" |
| 27 | 22 | #include "emuopts.h" |
| 28 | 23 | |
| 24 | // MAMEOS headers | |
| 25 | #include "direct_sound.h" | |
| 26 | ||
| 29 | 27 | #ifdef SDLMAME_WIN32 |
| 30 | 28 | #include "../../sdl/osdsdl.h" |
| 31 | 29 | #if (SDLMAME_SDL2) |
| r243192 | r243193 | |
| 47 | 45 | |
| 48 | 46 | #define LOG(x) do { if (LOG_SOUND) logerror x; } while(0) |
| 49 | 47 | |
| 50 | class sound_direct_sound : public osd_module, public sound_module | |
| 51 | { | |
| 52 | public: | |
| 53 | 48 | |
| 54 | sound_direct_sound() | |
| 55 | : osd_module(OSD_SOUND_PROVIDER, "dsound"), sound_module() | |
| 56 | { | |
| 57 | } | |
| 58 | virtual ~sound_direct_sound() { } | |
| 59 | ||
| 60 | virtual int init(); | |
| 61 | virtual void exit(); | |
| 62 | ||
| 63 | // sound_module | |
| 64 | ||
| 65 | virtual void update_audio_stream(bool is_throttled, const INT16 *buffer, int samples_this_frame); | |
| 66 | virtual void set_mastervolume(int attenuation); | |
| 67 | ||
| 68 | private: | |
| 69 | HRESULT dsound_init(); | |
| 70 | void dsound_kill(); | |
| 71 | HRESULT dsound_create_buffers(); | |
| 72 | void dsound_destroy_buffers(); | |
| 73 | void copy_sample_data(const INT16 *data, int bytes_to_copy); | |
| 74 | ||
| 75 | }; | |
| 76 | ||
| 77 | ||
| 78 | ||
| 79 | 49 | //============================================================ |
| 80 | 50 | // LOCAL VARIABLES |
| 81 | 51 | //============================================================ |
| r243192 | r243193 | |
| 99 | 69 | // buffer over/underflow counts |
| 100 | 70 | static int buffer_underflows; |
| 101 | 71 | static int buffer_overflows; |
| 102 | ||
| 103 | 72 | //============================================================ |
| 104 | 73 | // PROTOTYPES |
| 105 | 74 | //============================================================ |
| 106 | 75 | |
| 76 | const osd_sound_type OSD_SOUND_DIRECT_SOUND = &osd_sound_creator<sound_direct_sound>; | |
| 77 | ||
| 107 | 78 | //------------------------------------------------- |
| 108 | 79 | // sound_direct_sound - constructor |
| 109 | 80 | //------------------------------------------------- |
| 110 | ||
| 111 | int sound_direct_sound::init() | |
| 81 | sound_direct_sound::sound_direct_sound(const osd_interface &osd, running_machine &machine) | |
| 82 | : osd_sound_interface(osd, machine) | |
| 112 | 83 | { |
| 113 | 84 | // attempt to initialize directsound |
| 114 | 85 | // don't make it fatal if we can't -- we'll just run without sound |
| 115 | 86 | dsound_init(); |
| 116 | return 0; | |
| 117 | 87 | } |
| 118 | 88 | |
| 119 | 89 | |
| 120 | ||
| 90 | sound_direct_sound::~sound_direct_sound() | |
| 121 | 91 | { |
| 122 | 92 | // kill the buffers and dsound |
| 123 | 93 | dsound_destroy_buffers(); |
| r243192 | r243193 | |
| 179 | 149 | // update_audio_stream |
| 180 | 150 | //============================================================ |
| 181 | 151 | |
| 182 | void sound_direct_sound::update_audio_stream( | |
| 152 | void sound_direct_sound::update_audio_stream(const INT16 *buffer, int samples_this_frame) | |
| 183 | 153 | { |
| 184 | 154 | int bytes_this_frame = samples_this_frame * stream_format.nBlockAlign; |
| 185 | 155 | DWORD play_position, write_position; |
| r243192 | r243193 | |
| 298 | 268 | stream_format.wBitsPerSample = 16; |
| 299 | 269 | stream_format.wFormatTag = WAVE_FORMAT_PCM; |
| 300 | 270 | stream_format.nChannels = 2; |
| 301 | stream_format.nSamplesPerSec = sample_rate(); | |
| 271 | stream_format.nSamplesPerSec = m_machine.sample_rate(); | |
| 302 | 272 | stream_format.nBlockAlign = stream_format.wBitsPerSample * stream_format.nChannels / 8; |
| 303 | 273 | stream_format.nAvgBytesPerSec = stream_format.nSamplesPerSec * stream_format.nBlockAlign; |
| 304 | 274 | |
| 305 | 275 | |
| 306 | 276 | // compute the buffer size based on the output sample rate |
| 307 | 277 | int audio_latency; |
| 308 | audio_latency = m_audio_latency; | |
| 309 | ||
| 278 | #ifdef SDLMAME_WIN32 | |
| 279 | audio_latency = downcast<sdl_options &>(m_machine.options()).audio_latency(); | |
| 280 | #else | |
| 281 | audio_latency = downcast<windows_options &>(m_machine.options()).audio_latency(); | |
| 282 | #endif | |
| 310 | 283 | stream_buffer_size = stream_format.nSamplesPerSec * stream_format.nBlockAlign * audio_latency / 10; |
| 311 | 284 | stream_buffer_size = (stream_buffer_size / 1024) * 1024; |
| 312 | 285 | if (stream_buffer_size < 1024) |
| r243192 | r243193 | |
| 446 | 419 | IDirectSoundBuffer_Release(primary_buffer); |
| 447 | 420 | primary_buffer = NULL; |
| 448 | 421 | } |
| 449 | ||
| 450 | #else /* SDLMAME_UNIX */ | |
| 451 | MODULE_NOT_SUPPORTED(sound_direct_sound, OSD_SOUND_PROVIDER, "dsound") | |
| 452 | #endif | |
| 453 | ||
| 454 | MODULE_DEFINITION(SOUND_DSOUND, sound_direct_sound) |
| r0 | r243193 | |
|---|---|---|
| 1 | // license:BSD-3-Clause | |
| 2 | // copyright-holders:Aaron Giles | |
| 3 | //============================================================ | |
| 4 | // | |
| 5 | // sound.c - Win32 implementation of MAME sound routines | |
| 6 | // | |
| 7 | //============================================================ | |
| 8 | #pragma once | |
| 9 | ||
| 10 | #ifndef __SOUND_DSOUND_H__ | |
| 11 | #define __SOUND_DSOUND_H__ | |
| 12 | ||
| 13 | // standard windows headers | |
| 14 | #define WIN32_LEAN_AND_MEAN | |
| 15 | #include <windows.h> | |
| 16 | #include <mmsystem.h> | |
| 17 | ||
| 18 | // undef WINNT for dsound.h to prevent duplicate definition | |
| 19 | #undef WINNT | |
| 20 | #include <dsound.h> | |
| 21 | #undef interface | |
| 22 | ||
| 23 | #include "osdepend.h" | |
| 24 | #include "modules/lib/osdobj_common.h" | |
| 25 | ||
| 26 | class sound_direct_sound : public osd_sound_interface | |
| 27 | { | |
| 28 | public: | |
| 29 | // construction/destruction | |
| 30 | sound_direct_sound(const osd_interface &osd, running_machine &machine); | |
| 31 | virtual ~sound_direct_sound(); | |
| 32 | ||
| 33 | virtual void update_audio_stream(const INT16 *buffer, int samples_this_frame); | |
| 34 | virtual void set_mastervolume(int attenuation); | |
| 35 | ||
| 36 | HRESULT dsound_init(); | |
| 37 | void dsound_kill(); | |
| 38 | HRESULT dsound_create_buffers(); | |
| 39 | void dsound_destroy_buffers(); | |
| 40 | void copy_sample_data(const INT16 *data, int bytes_to_copy); | |
| 41 | private: | |
| 42 | }; | |
| 43 | ||
| 44 | extern const osd_sound_type OSD_SOUND_DIRECT_SOUND; | |
| 45 | ||
| 46 | #endif /* __SOUND_DSOUND_H__ */ |
| r243192 | r243193 | |
|---|---|---|
| 8 | 8 | |
| 9 | 9 | *******************************************************************c********/ |
| 10 | 10 | |
| 11 | #include "sound_module.h" | |
| 12 | #include "modules/osdmodule.h" | |
| 13 | 11 | |
| 14 | #if (defined(SDLMAME_EMSCRIPTEN)) | |
| 15 | ||
| 12 | #include "js_sound.h" | |
| 16 | 13 | #include "emscripten.h" |
| 17 | 14 | |
| 18 | class sound_js : public osd_module, public sound_module | |
| 15 | //------------------------------------------------- | |
| 16 | // sound_js - constructor | |
| 17 | //------------------------------------------------- | |
| 18 | sound_js::sound_js(const osd_interface &osd) | |
| 19 | : osd_sound_interface(osd) | |
| 19 | 20 | { |
| 20 | ||
| 21 | } | |
| 21 | 22 | |
| 22 | sound_js() | |
| 23 | : osd_module(OSD_SOUND_PROVIDER, "js"), sound_module() | |
| 24 | { | |
| 25 | } | |
| 26 | virtual ~sound_js() { } | |
| 23 | void sound_js::update_audio_stream(const INT16 *buffer, int samples_this_frame) | |
| 24 | { | |
| 25 | EM_ASM_ARGS({ | |
| 26 | // Forward audio stream update on to JS backend implementation. | |
| 27 | jsmess_update_audio_stream($0, $1); | |
| 28 | }, (unsigned int)buffer, samples_this_frame); | |
| 29 | } | |
| 27 | 30 | |
| 28 | virtual int init(); | |
| 29 | virtual void exit(); | |
| 31 | void sound_js::set_mastervolume(int attenuation) | |
| 32 | { | |
| 33 | EM_ASM_ARGS({ | |
| 34 | // Forward volume update on to JS backend implementation. | |
| 35 | jsmess_set_mastervolume($0); | |
| 36 | }, attenuation); | |
| 37 | } | |
| 30 | 38 | |
| 31 | // sound_module | |
| 32 | ||
| 33 | virtual void update_audio_stream(bool is_throttled, const INT16 *buffer, int samples_this_frame) | |
| 34 | { | |
| 35 | EM_ASM_ARGS({ | |
| 36 | // Forward audio stream update on to JS backend implementation. | |
| 37 | jsmess_update_audio_stream($1, $2); | |
| 38 | }, (unsigned int)buffer, samples_this_frame); | |
| 39 | } | |
| 40 | virtual void set_mastervolume(int attenuation) | |
| 41 | { | |
| 42 | EM_ASM_ARGS({ | |
| 43 | // Forward volume update on to JS backend implementation. | |
| 44 | jsmess_set_mastervolume($0); | |
| 45 | }, attenuation); | |
| 46 | } | |
| 47 | ||
| 48 | }; | |
| 49 | ||
| 50 | #else /* SDLMAME_UNIX */ | |
| 51 | MODULE_NOT_SUPPORTED(sound_js, OSD_SOUND_PROVIDER, "js") | |
| 52 | #endif | |
| 53 | ||
| 54 | MODULE_DEFINITION(SOUND_JS, sound_js) | |
| 39 | const osd_sound_type OSD_SOUND_JS = &osd_sound_creator<sound_js>; |
| r0 | r243193 | |
|---|---|---|
| 1 | // license:BSD-3-Clause | |
| 2 | // copyright-holders:Miodrag Milanovic, Katelyn Gadd | |
| 3 | /*************************************************************************** | |
| 4 | ||
| 5 | js_sound.h | |
| 6 | ||
| 7 | Shim for native JavaScript sound interface implementations (Emscripten only). | |
| 8 | ||
| 9 | *******************************************************************c********/ | |
| 10 | ||
| 11 | #pragma once | |
| 12 | ||
| 13 | #ifndef __SOUND_JS_H__ | |
| 14 | #define __SOUND_JS_H__ | |
| 15 | ||
| 16 | #include "osdepend.h" | |
| 17 | ||
| 18 | class sound_js : public osd_sound_interface | |
| 19 | { | |
| 20 | public: | |
| 21 | // construction/destruction | |
| 22 | sound_js(const osd_interface &osd); | |
| 23 | virtual ~sound_js() { } | |
| 24 | ||
| 25 | virtual void update_audio_stream(const INT16 *buffer, int samples_this_frame); | |
| 26 | virtual void set_mastervolume(int attenuation); | |
| 27 | }; | |
| 28 | ||
| 29 | extern const osd_sound_type OSD_SOUND_JS; | |
| 30 | ||
| 31 | #endif /* __SOUND_JS_H__ */ |
| r243192 | r243193 | |
|---|---|---|
| 8 | 8 | |
| 9 | 9 | *******************************************************************c********/ |
| 10 | 10 | |
| 11 | #include "sound_module.h" | |
| 12 | #include "modules/osdmodule.h" | |
| 13 | 11 | |
| 14 | class sound_none : public osd_module, public sound_module | |
| 12 | #include "none.h" | |
| 13 | ||
| 14 | //------------------------------------------------- | |
| 15 | // sound_none - constructor | |
| 16 | //------------------------------------------------- | |
| 17 | sound_none::sound_none(const osd_interface &osd, running_machine &machine) | |
| 18 | : osd_sound_interface(osd, machine) | |
| 15 | 19 | { |
| 16 | public: | |
| 17 | sound_none() | |
| 18 | : osd_module(OSD_SOUND_PROVIDER, "none"), sound_module() | |
| 19 | { | |
| 20 | } | |
| 21 | virtual ~sound_none() { } | |
| 20 | } | |
| 22 | 21 | |
| 23 | virtual int init() { return 0; } | |
| 24 | virtual void exit() { } | |
| 25 | 22 | |
| 26 | // sound_module | |
| 27 | ||
| 28 | virtual void update_audio_stream(bool is_throttled, const INT16 *buffer, int samples_this_frame) { } | |
| 29 | virtual void set_mastervolume(int attenuation) { } | |
| 30 | ||
| 31 | }; | |
| 32 | ||
| 33 | MODULE_DEFINITION(SOUND_NONE, sound_none) | |
| 23 | const osd_sound_type OSD_SOUND_NONE = &osd_sound_creator<sound_none>; |
| r0 | r243193 | |
|---|---|---|
| 1 | // license:BSD-3-Clause | |
| 2 | // copyright-holders:Miodrag Milanovic | |
| 3 | /*************************************************************************** | |
| 4 | ||
| 5 | none.h | |
| 6 | ||
| 7 | Dummy sound interface. | |
| 8 | ||
| 9 | *******************************************************************c********/ | |
| 10 | ||
| 11 | #pragma once | |
| 12 | ||
| 13 | #ifndef __SOUND_NONE_H__ | |
| 14 | #define __SOUND_NONE_H__ | |
| 15 | ||
| 16 | #include "osdepend.h" | |
| 17 | #include "modules/lib/osdobj_common.h" | |
| 18 | ||
| 19 | class sound_none : public osd_sound_interface | |
| 20 | { | |
| 21 | public: | |
| 22 | // construction/destruction | |
| 23 | sound_none(const osd_interface &osd, running_machine &machine); | |
| 24 | virtual ~sound_none() { } | |
| 25 | ||
| 26 | virtual void update_audio_stream(const INT16 *buffer, int samples_this_frame) { } | |
| 27 | virtual void set_mastervolume(int attenuation) { } | |
| 28 | }; | |
| 29 | ||
| 30 | extern const osd_sound_type OSD_SOUND_NONE; | |
| 31 | ||
| 32 | #endif /* __SOUND_NONE_H__ */ |
| r243192 | r243193 | |
|---|---|---|
| 9 | 9 | // |
| 10 | 10 | //============================================================ |
| 11 | 11 | |
| 12 | #include "sound_module.h" | |
| 13 | #include "modules/osdmodule.h" | |
| 14 | ||
| 15 | #if (!defined(SDLMAME_EMSCRIPTEN)) && (!defined(OSD_WINDOWS)) | |
| 16 | ||
| 17 | 12 | // standard sdl header |
| 18 | 13 | #include "../../sdl/sdlinc.h" |
| 19 | 14 | |
| r243192 | r243193 | |
| 21 | 16 | #include "emu.h" |
| 22 | 17 | #include "emuopts.h" |
| 23 | 18 | |
| 19 | #include "sdl_sound.h" | |
| 24 | 20 | #include "../../sdl/osdsdl.h" |
| 25 | 21 | |
| 26 | 22 | //============================================================ |
| r243192 | r243193 | |
| 30 | 26 | #define LOG_SOUND 0 |
| 31 | 27 | |
| 32 | 28 | //============================================================ |
| 33 | // PR | |
| 29 | // PARAMETERS | |
| 34 | 30 | //============================================================ |
| 35 | 31 | |
| 36 | static void sdl_callback(void *userdata, Uint8 *stream, int len); | |
| 32 | // number of samples per SDL callback | |
| 33 | #define SDL_XFER_SAMPLES (512) | |
| 37 | 34 | |
| 35 | static int sdl_xfer_samples = SDL_XFER_SAMPLES; | |
| 36 | static int stream_in_initialized = 0; | |
| 37 | static int stream_loop = 0; | |
| 38 | ||
| 39 | // maximum audio latency | |
| 40 | #define MAX_AUDIO_LATENCY 5 | |
| 41 | ||
| 38 | 42 | //============================================================ |
| 39 | // CLA | |
| 43 | // LOCAL VARIABLES | |
| 40 | 44 | //============================================================ |
| 41 | 45 | |
| 42 | class sound_sdl : public osd_module, public sound_module | |
| 43 | { | |
| 44 | public: | |
| 46 | static int attenuation = 0; | |
| 45 | 47 | |
| 46 | friend void sdl_callback(void *userdata, Uint8 *stream, int len); | |
| 48 | static int initialized_audio = 0; | |
| 49 | static int buf_locked; | |
| 47 | 50 | |
| 48 | // number of samples per SDL callback | |
| 49 | static const int SDL_XFER_SAMPLES = 512; | |
| 51 | static INT8 *stream_buffer; | |
| 52 | static volatile INT32 stream_playpos; | |
| 50 | 53 | |
| 51 | sound_sdl() | |
| 52 | : osd_module(OSD_SOUND_PROVIDER, "sdl"), sound_module(), | |
| 53 | stream_in_initialized(0), | |
| 54 | stream_loop(0), | |
| 55 | attenuation(0) | |
| 56 | { | |
| 57 | sdl_xfer_samples = SDL_XFER_SAMPLES; | |
| 58 | } | |
| 59 | virtual ~sound_sdl() { } | |
| 54 | static UINT32 stream_buffer_size; | |
| 55 | static UINT32 stream_buffer_in; | |
| 60 | 56 | |
| 61 | virtual int init(); | |
| 62 | virtual void exit(); | |
| 57 | // buffer over/underflow counts | |
| 58 | static int buffer_underflows; | |
| 59 | static int buffer_overflows; | |
| 63 | 60 | |
| 64 | // sound_module | |
| 61 | // debugging | |
| 62 | static FILE *sound_log; | |
| 65 | 63 | |
| 66 | virtual void update_audio_stream(bool is_throttled, const INT16 *buffer, int samples_this_frame); | |
| 67 | virtual void set_mastervolume(int attenuation); | |
| 68 | 64 | |
| 69 | private: | |
| 70 | int lock_buffer(bool is_throttled, long offset, long size, void **buffer1, long *length1, void **buffer2, long *length2); | |
| 71 | void unlock_buffer(void); | |
| 72 | void att_memcpy(void *dest, const INT16 *data, int bytes_to_copy); | |
| 73 | void copy_sample_data(bool is_throttled, const INT16 *data, int bytes_to_copy); | |
| 74 | int sdl_create_buffers(void); | |
| 75 | void sdl_destroy_buffers(void); | |
| 65 | // sound enable | |
| 66 | static int snd_enabled; | |
| 76 | 67 | |
| 77 | int sdl_xfer_samples; | |
| 78 | int stream_in_initialized; | |
| 79 | int stream_loop; | |
| 80 | int attenuation; | |
| 68 | //============================================================ | |
| 69 | // PROTOTYPES | |
| 70 | //============================================================ | |
| 81 | 71 | |
| 82 | int buf_locked; | |
| 72 | static int sdl_init(running_machine &machine); | |
| 73 | static void sdl_kill(running_machine &machine); | |
| 74 | static int sdl_create_buffers(void); | |
| 75 | static void sdl_destroy_buffers(void); | |
| 76 | static void SDLCALL sdl_callback(void *userdata, Uint8 *stream, int len); | |
| 83 | 77 | |
| 84 | INT8 *stream_buffer; | |
| 85 | volatile INT32 stream_playpos; | |
| 78 | const osd_sound_type OSD_SOUND_SDL = &osd_sound_creator<sound_sdl>; | |
| 86 | 79 | |
| 87 | UINT32 stream_buffer_size; | |
| 88 | UINT32 stream_buffer_in; | |
| 80 | //------------------------------------------------- | |
| 81 | // sound_sdl - constructor | |
| 82 | //------------------------------------------------- | |
| 83 | sound_sdl::sound_sdl(const osd_interface &osd, running_machine &machine) | |
| 84 | : osd_sound_interface(osd, machine) | |
| 85 | { | |
| 86 | if (LOG_SOUND) | |
| 87 | sound_log = fopen(SDLMAME_SOUND_LOG, "w"); | |
| 89 | 88 | |
| 90 | // buffer over/underflow counts | |
| 91 | int buffer_underflows; | |
| 92 | int buffer_overflows; | |
| 89 | // skip if sound disabled | |
| 90 | if (m_machine.sample_rate() != 0) | |
| 91 | { | |
| 92 | if (initialized_audio) | |
| 93 | { | |
| 94 | //sound_exit(); | |
| 95 | } | |
| 93 | 96 | |
| 97 | // attempt to initialize SDL | |
| 98 | if (sdl_init(m_machine)) | |
| 99 | return; | |
| 94 | 100 | |
| 95 | }; | |
| 101 | // set the startup volume | |
| 102 | set_mastervolume(attenuation); | |
| 103 | } | |
| 104 | } | |
| 96 | 105 | |
| 97 | 106 | |
| 107 | ||
| 98 | 108 | //============================================================ |
| 99 | // | |
| 109 | // sound_sdl - destructor | |
| 100 | 110 | //============================================================ |
| 101 | 111 | |
| 102 | // maximum audio latency | |
| 103 | #define MAX_AUDIO_LATENCY 5 | |
| 112 | sound_sdl::~sound_sdl() | |
| 113 | { | |
| 114 | // if nothing to do, don't do it | |
| 115 | if (m_machine.sample_rate() == 0) | |
| 116 | return; | |
| 104 | 117 | |
| 105 | //============================================================ | |
| 106 | // LOCAL VARIABLES | |
| 107 | //============================================================ | |
| 118 | // kill the buffers and dsound | |
| 119 | sdl_kill(m_machine); | |
| 120 | sdl_destroy_buffers(); | |
| 108 | 121 | |
| 109 | // debugging | |
| 110 | static FILE *sound_log; | |
| 122 | // print out over/underflow stats | |
| 123 | if (buffer_overflows || buffer_underflows) | |
| 124 | osd_printf_verbose("Sound buffer: overflows=%d underflows=%d\n", buffer_overflows, buffer_underflows); | |
| 111 | 125 | |
| 112 | //============================================================ | |
| 113 | // sound_sdl - destructor | |
| 114 | //============================================================ | |
| 126 | if (LOG_SOUND) | |
| 127 | { | |
| 128 | fprintf(sound_log, "Sound buffer: overflows=%d underflows=%d\n", buffer_overflows, buffer_underflows); | |
| 129 | fclose(sound_log); | |
| 130 | } | |
| 131 | } | |
| 115 | 132 | |
| 116 | 133 | //============================================================ |
| 117 | 134 | // lock_buffer |
| 118 | 135 | //============================================================ |
| 119 | int | |
| 136 | static int lock_buffer(running_machine &machine, long offset, long size, void **buffer1, long *length1, void **buffer2, long *length2) | |
| 120 | 137 | { |
| 121 | 138 | volatile long pstart, pend, lstart, lend; |
| 122 | 139 | |
| 123 | 140 | if (!buf_locked) |
| 124 | 141 | { |
| 125 | if (i | |
| 142 | if (machine.video().throttled()) | |
| 126 | 143 | { |
| 127 | 144 | pstart = stream_playpos; |
| 128 | 145 | pend = (pstart + sdl_xfer_samples); |
| r243192 | r243193 | |
| 168 | 185 | //============================================================ |
| 169 | 186 | // unlock_buffer |
| 170 | 187 | //============================================================ |
| 171 | void | |
| 188 | static void unlock_buffer(void) | |
| 172 | 189 | { |
| 173 | 190 | buf_locked--; |
| 174 | 191 | if (!buf_locked) |
| r243192 | r243193 | |
| 183 | 200 | // Apply attenuation |
| 184 | 201 | //============================================================ |
| 185 | 202 | |
| 186 | void | |
| 203 | static void att_memcpy(void *dest, const INT16 *data, int bytes_to_copy) | |
| 187 | 204 | { |
| 188 | 205 | int level= (int) (pow(10.0, (float) attenuation / 20.0) * 128.0); |
| 189 | 206 | INT16 *d = (INT16 *) dest; |
| r243192 | r243193 | |
| 199 | 216 | // copy_sample_data |
| 200 | 217 | //============================================================ |
| 201 | 218 | |
| 202 | void | |
| 219 | static void copy_sample_data(running_machine &machine, const INT16 *data, int bytes_to_copy) | |
| 203 | 220 | { |
| 204 | 221 | void *buffer1, *buffer2 = (void *)NULL; |
| 205 | 222 | long length1, length2; |
| 206 | 223 | int cur_bytes; |
| 207 | 224 | |
| 208 | 225 | // attempt to lock the stream buffer |
| 209 | if (lock_buffer( | |
| 226 | if (lock_buffer(machine, stream_buffer_in, bytes_to_copy, &buffer1, &length1, &buffer2, &length2) < 0) | |
| 210 | 227 | { |
| 211 | 228 | buffer_underflows++; |
| 212 | 229 | return; |
| r243192 | r243193 | |
| 247 | 264 | // update_audio_stream |
| 248 | 265 | //============================================================ |
| 249 | 266 | |
| 250 | void sound_sdl::update_audio_stream( | |
| 267 | void sound_sdl::update_audio_stream(const INT16 *buffer, int samples_this_frame) | |
| 251 | 268 | { |
| 252 | 269 | // if nothing to do, don't do it |
| 253 | if (sample_rate() != 0 && stream_buffer) | |
| 270 | if (m_machine.sample_rate() != 0 && stream_buffer) | |
| 254 | 271 | { |
| 255 | 272 | int bytes_this_frame = samples_this_frame * sizeof(INT16) * 2; |
| 256 | 273 | int play_position, write_position, stream_in; |
| r243192 | r243193 | |
| 258 | 275 | |
| 259 | 276 | play_position = stream_playpos; |
| 260 | 277 | |
| 261 | write_position = stream_playpos + ((sample_rate() / 50) * sizeof(INT16) * 2); | |
| 278 | write_position = stream_playpos + ((m_machine.sample_rate() / 50) * sizeof(INT16) * 2); | |
| 262 | 279 | orig_write = write_position; |
| 263 | 280 | |
| 264 | 281 | if (!stream_in_initialized) |
| r243192 | r243193 | |
| 319 | 336 | |
| 320 | 337 | // now we know where to copy; let's do it |
| 321 | 338 | stream_buffer_in = stream_in; |
| 322 | copy_sample_data( | |
| 339 | copy_sample_data(m_machine, buffer, bytes_this_frame); | |
| 323 | 340 | } |
| 324 | 341 | } |
| 325 | 342 | |
| r243192 | r243193 | |
| 354 | 371 | //============================================================ |
| 355 | 372 | static void sdl_callback(void *userdata, Uint8 *stream, int len) |
| 356 | 373 | { |
| 357 | sound_sdl *thiz = (sound_sdl *) userdata; | |
| 358 | 374 | int len1, len2, sb_in; |
| 359 | 375 | |
| 360 | sb_in = thiz->stream_buffer_in; | |
| 361 | if (thiz->stream_loop) | |
| 362 | sb_in += thiz->stream_buffer_size; | |
| 376 | sb_in = stream_buffer_in; | |
| 377 | if (stream_loop) | |
| 378 | sb_in += stream_buffer_size; | |
| 363 | 379 | |
| 364 | if (sb_in < ( | |
| 380 | if (sb_in < (stream_playpos+len)) | |
| 365 | 381 | { |
| 366 | 382 | if (LOG_SOUND) |
| 367 | fprintf(sound_log, "Underflow at sdl_callback: SPP=%d SBI=%d(%d) Len=%d\n", (int) | |
| 383 | fprintf(sound_log, "Underflow at sdl_callback: SPP=%d SBI=%d(%d) Len=%d\n", (int)stream_playpos, (int)sb_in, (int)stream_buffer_in, (int)len); | |
| 368 | 384 | |
| 369 | 385 | return; |
| 370 | 386 | } |
| 371 | else if (( | |
| 387 | else if ((stream_playpos+len) > stream_buffer_size) | |
| 372 | 388 | { |
| 373 | len1 = | |
| 389 | len1 = stream_buffer_size - stream_playpos; | |
| 374 | 390 | len2 = len - len1; |
| 375 | 391 | } |
| 376 | 392 | else |
| r243192 | r243193 | |
| 379 | 395 | len2 = 0; |
| 380 | 396 | } |
| 381 | 397 | |
| 382 | memcpy(stream, thiz->stream_buffer + thiz->stream_playpos, len1); | |
| 383 | memset(thiz->stream_buffer + thiz->stream_playpos, 0, len1); // no longer needed | |
| 384 | if (len2) | |
| 398 | if (snd_enabled) | |
| 385 | 399 | { |
| 386 | memcpy(stream+len1, thiz->stream_buffer, len2); | |
| 387 | memset(thiz->stream_buffer, 0, len2); // no longer needed | |
| 400 | memcpy(stream, stream_buffer + stream_playpos, len1); | |
| 401 | memset(stream_buffer + stream_playpos, 0, len1); // no longer needed | |
| 402 | if (len2) | |
| 403 | { | |
| 404 | memcpy(stream+len1, stream_buffer, len2); | |
| 405 | memset(stream_buffer, 0, len2); // no longer needed | |
| 406 | } | |
| 407 | ||
| 388 | 408 | } |
| 409 | else | |
| 410 | { | |
| 411 | memset(stream, 0, len); | |
| 412 | } | |
| 389 | 413 | |
| 390 | ||
| 391 | 414 | // move the play cursor |
| 392 | thiz->stream_playpos += len1 + len2; | |
| 393 | if (thiz->stream_playpos >= thiz->stream_buffer_size) | |
| 415 | stream_playpos += len1 + len2; | |
| 416 | if (stream_playpos >= stream_buffer_size) | |
| 394 | 417 | { |
| 395 | thiz->stream_playpos -= thiz->stream_buffer_size; | |
| 396 | thiz->stream_loop = 0; | |
| 418 | stream_playpos -= stream_buffer_size; | |
| 419 | stream_loop = 0; | |
| 397 | 420 | |
| 398 | 421 | if (LOG_SOUND) |
| 399 | 422 | fprintf(sound_log, "stream_loop set to 0 (stream_playpos looped)\n"); |
| r243192 | r243193 | |
| 401 | 424 | |
| 402 | 425 | if (LOG_SOUND) |
| 403 | 426 | fprintf(sound_log, "callback: xfer len1 %d len2 %d, playpos %d\n", |
| 404 | len1, len2, | |
| 427 | len1, len2, stream_playpos); | |
| 405 | 428 | } |
| 406 | 429 | |
| 407 | 430 | |
| 408 | 431 | //============================================================ |
| 409 | // s | |
| 432 | // sdl_init | |
| 410 | 433 | //============================================================ |
| 411 | ||
| 412 | int sound_sdl::init() | |
| 434 | static int sdl_init(running_machine &machine) | |
| 413 | 435 | { |
| 414 | 436 | int n_channels = 2; |
| 415 | 437 | int audio_latency; |
| 416 | 438 | SDL_AudioSpec aspec, obtained; |
| 417 | 439 | char audio_driver[16] = ""; |
| 418 | 440 | |
| 419 | if (LOG_SOUND) | |
| 420 | sound_log = fopen(SDLMAME_SOUND_LOG, "w"); | |
| 441 | if (SDL_InitSubSystem(SDL_INIT_AUDIO)) { | |
| 442 | osd_printf_error("Could not initialize SDL %s\n", SDL_GetError()); | |
| 443 | exit(-1); | |
| 444 | } | |
| 421 | 445 | |
| 422 | // skip if sound disabled | |
| 423 | if (sample_rate() != 0) | |
| 424 | { | |
| 425 | if (SDL_InitSubSystem(SDL_INIT_AUDIO)) { | |
| 426 | osd_printf_error("Could not initialize SDL %s\n", SDL_GetError()); | |
| 427 | return -1; | |
| 428 | } | |
| 446 | osd_printf_verbose("Audio: Start initialization\n"); | |
| 447 | #if (SDLMAME_SDL2) | |
| 448 | strncpy(audio_driver, SDL_GetCurrentAudioDriver(), sizeof(audio_driver)); | |
| 449 | #else | |
| 450 | SDL_AudioDriverName(audio_driver, sizeof(audio_driver)); | |
| 451 | #endif | |
| 452 | osd_printf_verbose("Audio: Driver is %s\n", audio_driver); | |
| 429 | 453 | |
| 430 | osd_printf_verbose("Audio: Start initialization\n"); | |
| 431 | #if (SDLMAME_SDL2) | |
| 432 | strncpy(audio_driver, SDL_GetCurrentAudioDriver(), sizeof(audio_driver)); | |
| 433 | #else | |
| 434 | SDL_AudioDriverName(audio_driver, sizeof(audio_driver)); | |
| 435 | #endif | |
| 436 | osd_printf_verbose("Audio: Driver is %s\n", audio_driver); | |
| 454 | initialized_audio = 0; | |
| 437 | 455 | |
| 438 | sdl_xfer_samples = SDL_XFER_SAMPLES; | |
| 439 | stream_in_initialized = 0; | |
| 440 | stream_loop = 0; | |
| 456 | sdl_xfer_samples = SDL_XFER_SAMPLES; | |
| 457 | stream_in_initialized = 0; | |
| 458 | stream_loop = 0; | |
| 441 | 459 | |
| 442 | // set up the audio specs | |
| 443 | aspec.freq = sample_rate(); | |
| 444 | aspec.format = AUDIO_S16SYS; // keep endian independent | |
| 445 | aspec.channels = n_channels; | |
| 446 | aspec.samples = sdl_xfer_samples; | |
| 447 | aspec.callback = sdl_callback; | |
| 448 | aspec.userdata = this; | |
| 460 | // set up the audio specs | |
| 461 | aspec.freq = machine.sample_rate(); | |
| 462 | aspec.format = AUDIO_S16SYS; // keep endian independent | |
| 463 | aspec.channels = n_channels; | |
| 464 | aspec.samples = sdl_xfer_samples; | |
| 465 | aspec.callback = sdl_callback; | |
| 466 | aspec.userdata = 0; | |
| 449 | 467 | |
| 450 | if (SDL_OpenAudio(&aspec, &obtained) < 0) | |
| 451 | goto cant_start_audio; | |
| 468 | if (SDL_OpenAudio(&aspec, &obtained) < 0) | |
| 469 | goto cant_start_audio; | |
| 452 | 470 | |
| 453 | osd_printf_verbose("Audio: frequency: %d, channels: %d, samples: %d\n", | |
| 454 | obtained.freq, obtained.channels, obtained.samples); | |
| 471 | initialized_audio = 1; | |
| 472 | snd_enabled = 1; | |
| 455 | 473 | |
| 456 | sdl_xfer_samples = obtained.samples; | |
| 474 | osd_printf_verbose("Audio: frequency: %d, channels: %d, samples: %d\n", | |
| 475 | obtained.freq, obtained.channels, obtained.samples); | |
| 457 | 476 | |
| 458 | | |
| 477 | sdl_xfer_samples = obtained.samples; | |
| 459 | 478 | |
| 460 | // pin audio latency | |
| 461 | if (audio_latency > MAX_AUDIO_LATENCY) | |
| 462 | { | |
| 463 | audio_latency = MAX_AUDIO_LATENCY; | |
| 464 | } | |
| 465 | else if (audio_latency < 1) | |
| 466 | { | |
| 467 | audio_latency = 1; | |
| 468 | } | |
| 479 | audio_latency = downcast<sdl_options &>(machine.options()).audio_latency(); | |
| 469 | 480 | |
| 470 | // compute the buffer sizes | |
| 471 | stream_buffer_size = (sample_rate() * 2 * sizeof(INT16) * (2 + audio_latency)) / 30; | |
| 472 | stream_buffer_size = (stream_buffer_size / 1024) * 1024; | |
| 473 | if (stream_buffer_size < 1024) | |
| 474 | stream_buffer_size = 1024; | |
| 481 | // pin audio latency | |
| 482 | if (audio_latency > MAX_AUDIO_LATENCY) | |
| 483 | { | |
| 484 | audio_latency = MAX_AUDIO_LATENCY; | |
| 485 | } | |
| 486 | else if (audio_latency < 1) | |
| 487 | { | |
| 488 | audio_latency = 1; | |
| 489 | } | |
| 475 | 490 | |
| 476 | // create the buffers | |
| 477 | if (sdl_create_buffers()) | |
| 478 | goto cant_create_buffers; | |
| 491 | // compute the buffer sizes | |
| 492 | stream_buffer_size = (machine.sample_rate() * 2 * sizeof(INT16) * (2 + audio_latency)) / 30; | |
| 493 | stream_buffer_size = (stream_buffer_size / 1024) * 1024; | |
| 494 | if (stream_buffer_size < 1024) | |
| 495 | stream_buffer_size = 1024; | |
| 479 | 496 | |
| 480 | // set the startup volume | |
| 481 | set_mastervolume(attenuation); | |
| 482 | osd_printf_verbose("Audio: End initialization\n"); | |
| 483 | return 0; | |
| 497 | // create the buffers | |
| 498 | if (sdl_create_buffers()) | |
| 499 | goto cant_create_buffers; | |
| 484 | 500 | |
| 485 | // error handling | |
| 486 | cant_create_buffers: | |
| 487 | cant_start_audio: | |
| 488 | osd_printf_verbose("Audio: Initialization failed. SDL error: %s\n", SDL_GetError()); | |
| 501 | osd_printf_verbose("Audio: End initialization\n"); | |
| 502 | return 0; | |
| 489 | 503 | |
| 490 | return -1; | |
| 491 | } | |
| 504 | // error handling | |
| 505 | cant_create_buffers: | |
| 506 | cant_start_audio: | |
| 507 | osd_printf_verbose("Audio: Initialization failed. SDL error: %s\n", SDL_GetError()); | |
| 492 | 508 | |
| 493 | 509 | return 0; |
| 494 | 510 | } |
| r243192 | r243193 | |
| 499 | 515 | // sdl_kill |
| 500 | 516 | //============================================================ |
| 501 | 517 | |
| 502 | void s | |
| 518 | static void sdl_kill(running_machine &machine) | |
| 503 | 519 | { |
| 504 | // if nothing to do, don't do it | |
| 505 | if (sample_rate() == 0) | |
| 506 | return; | |
| 507 | ||
| 508 | osd_printf_verbose("sdl_kill: closing audio\n"); | |
| 509 | SDL_CloseAudio(); | |
| 510 | ||
| 511 | SDL_QuitSubSystem(SDL_INIT_AUDIO); | |
| 512 | ||
| 513 | // kill the buffers | |
| 514 | sdl_destroy_buffers(); | |
| 515 | ||
| 516 | // print out over/underflow stats | |
| 517 | if (buffer_overflows || buffer_underflows) | |
| 518 | osd_printf_verbose("Sound buffer: overflows=%d underflows=%d\n", buffer_overflows, buffer_underflows); | |
| 519 | ||
| 520 | if (LOG_SOUND) | |
| 520 | if (initialized_audio) | |
| 521 | 521 | { |
| 522 | fprintf(sound_log, "Sound buffer: overflows=%d underflows=%d\n", buffer_overflows, buffer_underflows); | |
| 523 | fclose(sound_log); | |
| 522 | osd_printf_verbose("sdl_kill: closing audio\n"); | |
| 523 | ||
| 524 | SDL_CloseAudio(); | |
| 524 | 525 | } |
| 526 | SDL_QuitSubSystem(SDL_INIT_AUDIO); | |
| 525 | 527 | } |
| 526 | 528 | |
| 527 | 529 | |
| r243192 | r243193 | |
| 530 | 532 | // dsound_create_buffers |
| 531 | 533 | //============================================================ |
| 532 | 534 | |
| 533 | int | |
| 535 | static int sdl_create_buffers(void) | |
| 534 | 536 | { |
| 535 | 537 | osd_printf_verbose("sdl_create_buffers: creating stream buffer of %u bytes\n", stream_buffer_size); |
| 536 | 538 | |
| r243192 | r243193 | |
| 540 | 542 | return 0; |
| 541 | 543 | } |
| 542 | 544 | |
| 545 | ||
| 546 | ||
| 543 | 547 | //============================================================ |
| 544 | 548 | // sdl_destroy_buffers |
| 545 | 549 | //============================================================ |
| 546 | 550 | |
| 547 | void | |
| 551 | static void sdl_destroy_buffers(void) | |
| 548 | 552 | { |
| 549 | 553 | // release the buffer |
| 550 | 554 | if (stream_buffer) |
| 551 | 555 | global_free_array(stream_buffer); |
| 552 | 556 | stream_buffer = NULL; |
| 553 | 557 | } |
| 554 | ||
| 555 | ||
| 556 | ||
| 557 | #else /* SDLMAME_UNIX */ | |
| 558 | MODULE_NOT_SUPPORTED(sound_sdl, OSD_SOUND_PROVIDER, "sdl") | |
| 559 | #endif | |
| 560 | ||
| 561 | MODULE_DEFINITION(SOUND_SDL, sound_sdl) |
| r0 | r243193 | |
|---|---|---|
| 1 | //============================================================ | |
| 2 | // | |
| 3 | // sound.c - SDL implementation of MAME sound routines | |
| 4 | // | |
| 5 | // Copyright (c) 1996-2010, Nicola Salmoria and the MAME Team. | |
| 6 | // Visit http://mamedev.org for licensing and usage restrictions. | |
| 7 | // | |
| 8 | // SDLMAME by Olivier Galibert and R. Belmont | |
| 9 | // | |
| 10 | //============================================================ | |
| 11 | #pragma once | |
| 12 | ||
| 13 | #ifndef __SOUND_SDL_H__ | |
| 14 | #define __SOUND_SDL_H__ | |
| 15 | ||
| 16 | #include "osdepend.h" | |
| 17 | #include "modules/lib/osdobj_common.h" | |
| 18 | ||
| 19 | class sound_sdl : public osd_sound_interface | |
| 20 | { | |
| 21 | public: | |
| 22 | // construction/destruction | |
| 23 | sound_sdl(const osd_interface &osd, running_machine &machine); | |
| 24 | virtual ~sound_sdl(); | |
| 25 | ||
| 26 | virtual void update_audio_stream(const INT16 *buffer, int samples_this_frame); | |
| 27 | virtual void set_mastervolume(int attenuation); | |
| 28 | }; | |
| 29 | ||
| 30 | extern const osd_sound_type OSD_SOUND_SDL; | |
| 31 | ||
| 32 | #endif /* __SOUND_SDL_H__ */ |
| r243192 | r243193 | |
|---|---|---|
| 1 | /* | |
| 2 | * sound_module.h | |
| 3 | * | |
| 4 | */ | |
| 5 | ||
| 6 | #ifndef SOUND_MODULE_H_ | |
| 7 | #define SOUND_MODULE_H_ | |
| 8 | ||
| 9 | #include "osdepend.h" | |
| 10 | #include "modules/osdmodule.h" | |
| 11 | ||
| 12 | //============================================================ | |
| 13 | // CONSTANTS | |
| 14 | //============================================================ | |
| 15 | ||
| 16 | #define OSD_SOUND_PROVIDER "sound" | |
| 17 | ||
| 18 | class sound_module | |
| 19 | { | |
| 20 | public: | |
| 21 | sound_module() : m_sample_rate(0), m_audio_latency(1) { } | |
| 22 | ||
| 23 | virtual ~sound_module() { } | |
| 24 | ||
| 25 | virtual void update_audio_stream(bool is_throttled, const INT16 *buffer, int samples_this_frame) = 0; | |
| 26 | virtual void set_mastervolume(int attenuation) = 0; | |
| 27 | ||
| 28 | int sample_rate() { return m_sample_rate; } | |
| 29 | ||
| 30 | int m_sample_rate; | |
| 31 | int m_audio_latency; | |
| 32 | }; | |
| 33 | ||
| 34 | #endif /* FONT_MODULE_H_ */ |
| r243192 | r243193 | |
|---|---|---|
| 160 | 160 | void osd_thread_wait_free(osd_thread *thread) |
| 161 | 161 | { |
| 162 | 162 | } |
| 163 |
| r243192 | r243193 | |
|---|---|---|
| 411 | 411 | { |
| 412 | 412 | if (timeout == OSD_EVENT_WAIT_INFINITE) |
| 413 | 413 | timeout = osd_ticks_per_second() * (osd_ticks_t)10000; |
| 414 | ||
| 414 | ||
| 415 | 415 | pthread_mutex_lock(&event->mutex); |
| 416 | 416 | if (!timeout) |
| 417 | 417 | { |
| r243192 | r243193 | |
| 531 | 531 | pthread_join(thread->thread, NULL); |
| 532 | 532 | free(thread); |
| 533 | 533 | } |
| 534 |
| r243192 | r243193 | |
|---|---|---|
| 388 | 388 | { |
| 389 | 389 | ULONG rc; |
| 390 | 390 | ULONG timeout_param; |
| 391 | ||
| 391 | ||
| 392 | 392 | if (timeout == OSD_EVENT_WAIT_INFINITE) |
| 393 | 393 | timeout_param = SEM_INDEFINITE_WAIT; |
| 394 | 394 | else |
| r243192 | r243193 | |
|---|---|---|
| 326 | 326 | thread->callback = callback; |
| 327 | 327 | thread->param = cbparam; |
| 328 | 328 | #ifdef SDLMAME_SDL2 |
| 329 | ||
| 329 | thread->thread = SDL_CreateThread(worker_thread_entry, "Thread", thread); | |
| 330 | 330 | #else |
| 331 | ||
| 331 | thread->thread = SDL_CreateThread(worker_thread_entry, thread); | |
| 332 | 332 | #endif |
| 333 | 333 | if ( thread->thread == NULL ) |
| 334 | 334 | { |
| r243192 | r243193 | |
| 366 | 366 | SDL_WaitThread(thread->thread, &status); |
| 367 | 367 | free(thread); |
| 368 | 368 | } |
| 369 |
| r243192 | r243193 | |
|---|---|---|
| 246 | 246 | { |
| 247 | 247 | if (timeout == OSD_EVENT_WAIT_INFINITE) |
| 248 | 248 | timeout = osd_ticks_per_second() * (osd_ticks_t)10000; |
| 249 | ||
| 249 | ||
| 250 | 250 | pthread_mutex_lock(&event->mutex); |
| 251 | 251 | if (!timeout) |
| 252 | 252 | { |
| r243192 | r243193 | |
| 389 | 389 | pthread_join(thread->thread, NULL); |
| 390 | 390 | free(thread); |
| 391 | 391 | } |
| 392 |
| r243192 | r243193 | |
|---|---|---|
| 244 | 244 | timeout_param = INFINITE; |
| 245 | 245 | else |
| 246 | 246 | timeout_param = timeout * 1000 / osd_ticks_per_second(); |
| 247 | ||
| 247 | ||
| 248 | 248 | int ret = WaitForSingleObject((HANDLE) event, timeout_param); |
| 249 | 249 | return (ret == WAIT_OBJECT_0); |
| 250 | 250 | } |
| r243192 | r243193 | |
|---|---|---|
| 70 | 70 | template<typename _PtrType> |
| 71 | 71 | static void spin_while(const volatile _PtrType * volatile ptr, const _PtrType val, const osd_ticks_t timeout, const int invert = 0) |
| 72 | 72 | { |
| 73 | ||
| 73 | osd_ticks_t stopspin = osd_ticks() + timeout; | |
| 74 | 74 | |
| 75 | do { | |
| 76 | int spin = 10000; | |
| 77 | while (--spin) | |
| 78 | { | |
| 79 | if ((*ptr != val) ^ invert) | |
| 80 | return; | |
| 81 | } | |
| 82 | } while (((*ptr == val) ^ invert) && osd_ticks() < stopspin); | |
| 75 | do { | |
| 76 | int spin = 10000; | |
| 77 | while (--spin) | |
| 78 | { | |
| 79 | if ((*ptr != val) ^ invert) | |
| 80 | return; | |
| 81 | } | |
| 82 | } while (((*ptr == val) ^ invert) && osd_ticks() < stopspin); | |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | template<typename _PtrType> |
| 86 | 86 | static void spin_while_not(const volatile _PtrType * volatile ptr, const _PtrType val, const osd_ticks_t timeout) |
| 87 | 87 | { |
| 88 | ||
| 88 | spin_while(ptr, val, timeout, 1); | |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | |
| r243192 | r243193 | |
| 173 | 173 | osd_work_queue *queue; |
| 174 | 174 | int osdthreadnum = 0; |
| 175 | 175 | int allocthreadnum; |
| 176 | c | |
| 176 | char *osdworkqueuemaxthreads = osd_getenv(ENV_WORKQUEUEMAXTHREADS); | |
| 177 | 177 | |
| 178 | 178 | // allocate a new queue |
| 179 | 179 | queue = (osd_work_queue *)osd_malloc(sizeof(*queue)); |
| r243192 | r243193 | |
| 553 | 553 | if (item->event == NULL) |
| 554 | 554 | { |
| 555 | 555 | // TODO: do we need to measure the spin time here as well? and how can we do it? |
| 556 | ||
| 556 | spin_while(&item->done, 0, timeout); | |
| 557 | 557 | } |
| 558 | 558 | |
| 559 | 559 | // otherwise, block on the event until done |
| r243192 | r243193 | |
| 612 | 612 | } |
| 613 | 613 | else |
| 614 | 614 | { |
| 615 | char *procsoverride; | |
| 615 | 616 | int numprocs = 0; |
| 616 | 617 | |
| 617 | 618 | // if the OSDPROCESSORS environment variable is set, use that value if valid |
| 618 | 619 | // note that we permit more than the real number of processors for testing |
| 619 | | |
| 620 | procsoverride = osd_getenv(ENV_PROCESSORS); | |
| 620 | 621 | if (procsoverride != NULL && sscanf(procsoverride, "%d", &numprocs) == 1 && numprocs > 0) |
| 621 | 622 | return MIN(4 * physprocs, numprocs); |
| 622 | 623 |
| r243192 | r243193 | |
|---|---|---|
| 54 | 54 | output_delegate osd_set_output_channel(output_channel channel, output_delegate callback) |
| 55 | 55 | { |
| 56 | 56 | if (!(channel < OSD_OUTPUT_CHANNEL_COUNT) || callback.isnull()) |
| 57 | { | |
| 58 | throw std::exception(); | |
| 59 | } | |
| 57 | { | |
| 58 | throw std::exception(); | |
| 59 | } | |
| 60 | 60 | |
| 61 | 61 | /* return the originals if requested */ |
| 62 | 62 | output_delegate prevcb = output_cb[channel]; |
| r243192 | r243193 | |
| 166 | 166 | va_end(argptr); |
| 167 | 167 | } |
| 168 | 168 | #endif |
| 169 |
| r243192 | r243193 | |
|---|---|---|
| 196 | 196 | |
| 197 | 197 | |
| 198 | 198 | /*----------------------------------------------------------------------------- |
| 199 | osd_getenv: return pointer to environment variable | |
| 200 | ||
| 201 | Parameters: | |
| 202 | ||
| 203 | name - name of environment variable | |
| 204 | ||
| 205 | Return value: | |
| 206 | ||
| 207 | pointer to value | |
| 208 | -----------------------------------------------------------------------------*/ | |
| 209 | const char *osd_getenv(const char *name); | |
| 210 | ||
| 211 | ||
| 212 | /*----------------------------------------------------------------------------- | |
| 213 | 199 | osd_get_physical_drive_geometry: if the given path points to a physical |
| 214 | 200 | drive, return the geometry of that drive |
| 215 | 201 |
| r243192 | r243193 | |
|---|---|---|
| 18 | 18 | #include "unicode.h" |
| 19 | 19 | #include "cliopts.h" |
| 20 | 20 | |
| 21 | ||
| 22 | 21 | // forward references |
| 23 | 22 | class input_type_entry; // FIXME: including emu.h does not work because emu.h includes osdepend.h |
| 24 | 23 | |
| r243192 | r243193 | |
| 27 | 26 | // TYPE DEFINITIONS |
| 28 | 27 | //============================================================ |
| 29 | 28 | |
| 30 | // ======================> osd_font interface | |
| 29 | // FIXME: We can do better than this | |
| 30 | class osd_font; | |
| 31 | 31 | |
| 32 | class osd_font | |
| 33 | { | |
| 34 | public: | |
| 35 | virtual ~osd_font() {} | |
| 36 | ||
| 37 | virtual bool open(const char *font_path, const char *name, int &height) = 0; | |
| 38 | virtual void close() = 0; | |
| 39 | virtual bool get_bitmap(unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs) = 0; | |
| 40 | }; | |
| 41 | ||
| 42 | 32 | // ======================> osd_interface |
| 43 | 33 | |
| 44 | 34 | // description of the currently-running machine |
| r243192 | r243193 | |
| 62 | 52 | // input overridables |
| 63 | 53 | virtual void customize_input_type_list(simple_list<input_type_entry> &typelist) = 0; |
| 64 | 54 | |
| 55 | // font overridables | |
| 56 | virtual osd_font *font_open(const char *name, int &height) = 0; | |
| 57 | virtual void font_close(osd_font *font) = 0; | |
| 58 | virtual bool font_get_bitmap(osd_font *font, unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs) = 0; | |
| 59 | ||
| 65 | 60 | // video overridables |
| 66 | 61 | virtual void *get_slider_list() = 0; // FIXME: returns slider_state * |
| 67 | 62 | |
| 68 | // font interface | |
| 69 | virtual osd_font *font_alloc() = 0; | |
| 70 | ||
| 71 | 63 | // command option overrides |
| 72 | 64 | virtual bool execute_command(const char *command) = 0; |
| 73 | 65 |
| r243192 | r243193 | |
|---|---|---|
| 81 | 81 | // can't support clipboards generically |
| 82 | 82 | return NULL; |
| 83 | 83 | } |
| 84 |
| r243192 | r243193 | |
|---|---|---|
| 114 | 114 | |
| 115 | 115 | #define TEXCOPY_M( _name, _src_type, _dest_type, _op, _len_div) \ |
| 116 | 116 | INLINE void texcopy_##_name (const texture_info *texture, const render_texinfo *texsource) { \ |
| 117 | ||
| 117 | ATTR_UNUSED const rgb_t *palbase = texsource->palette(); \ | |
| 118 | 118 | int x, y; \ |
| 119 | 119 | /* loop over Y */ \ |
| 120 | 120 | for (y = 0; y < texsource->height; y++) { \ |
| r243192 | r243193 | |
| 134 | 134 | |
| 135 | 135 | #define TEXROT( _name, _src_type, _dest_type, _op) \ |
| 136 | 136 | INLINE void texcopy_rot_##_name (const texture_info *texture, const render_texinfo *texsource) { \ |
| 137 | ||
| 137 | ATTR_UNUSED const rgb_t *palbase = texsource->palette(); \ | |
| 138 | 138 | int x, y; \ |
| 139 | 139 | const quad_setup_data *setup = &texture->m_setup; \ |
| 140 | 140 | int dudx = setup->dudx; \ |
| r243192 | r243193 | |
|---|---|---|
| 48 | 48 | |
| 49 | 49 | static inline bool is_opaque(const float &a) |
| 50 | 50 | { |
| 51 | ||
| 51 | return (a >= 1.0f); | |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | static inline bool is_transparent(const float &a) |
| 55 | 55 | { |
| 56 | ||
| 56 | return (a < 0.0001f); | |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | //============================================================ |
| r243192 | r243193 | |
| 63 | 63 | |
| 64 | 64 | struct quad_setup_data |
| 65 | 65 | { |
| 66 | quad_setup_data() | |
| 67 | : dudx(0), dvdx(0), dudy(0), dvdy(0), startu(0), startv(0), | |
| 68 | rotwidth(0), rotheight(0) | |
| 69 | {} | |
| 70 | void compute(const render_primitive &prim); | |
| 66 | quad_setup_data() | |
| 67 | : dudx(0), dvdx(0), dudy(0), dvdy(0), startu(0), startv(0), | |
| 68 | rotwidth(0), rotheight(0) | |
| 69 | {} | |
| 70 | void compute(const render_primitive &prim); | |
| 71 | 71 | |
| 72 | 72 | INT32 dudx, dvdx, dudy, dvdy; |
| 73 | 73 | INT32 startu, startv; |
| r243192 | r243193 | |
| 105 | 105 | /* texture_info holds information about a texture */ |
| 106 | 106 | class texture_info |
| 107 | 107 | { |
| 108 | ||
| 108 | friend class simple_list<texture_info>; | |
| 109 | 109 | public: |
| 110 | texture_info(SDL_Renderer *renderer, const render_texinfo &texsource, const quad_setup_data &setup, const UINT32 flags); | |
| 111 | ~texture_info(); | |
| 110 | texture_info(SDL_Renderer *renderer, const render_texinfo &texsource, const quad_setup_data &setup, const UINT32 flags); | |
| 111 | ~texture_info(); | |
| 112 | 112 | |
| 113 | void set_data(const render_texinfo &texsource, const UINT32 flags); | |
| 114 | void render_quad(const render_primitive *prim, const int x, const int y); | |
| 115 | bool matches(const render_primitive &prim, const quad_setup_data &setup); | |
| 113 | void set_data(const render_texinfo &texsource, const UINT32 flags); | |
| 114 | void render_quad(const render_primitive *prim, const int x, const int y); | |
| 115 | bool matches(const render_primitive &prim, const quad_setup_data &setup); | |
| 116 | 116 | |
| 117 | ||
| 117 | copy_info_t *compute_size_type(); | |
| 118 | 118 | |
| 119 | 119 | void *m_pixels; // pixels for the texture |
| 120 | 120 | int m_pitch; |
| r243192 | r243193 | |
| 125 | 125 | osd_ticks_t m_last_access; |
| 126 | 126 | |
| 127 | 127 | int raw_width() const { return m_texinfo.width; } |
| 128 | ||
| 128 | int raw_height() const { return m_texinfo.height; } | |
| 129 | 129 | |
| 130 | texture_info *next() { return m_next; } | |
| 131 | const render_texinfo &texinfo() const { return m_texinfo; } | |
| 132 | render_texinfo &texinfo() { return m_texinfo; } | |
| 130 | texture_info *next() { return m_next; } | |
| 131 | const render_texinfo &texinfo() const { return m_texinfo; } | |
| 132 | render_texinfo &texinfo() { return m_texinfo; } | |
| 133 | 133 | |
| 134 | const HashT hash() const { return m_hash; } | |
| 135 | const UINT32 flags() const { return m_flags; } | |
| 136 | const bool is_pixels_owned() const { // do we own / allocated it ? | |
| 137 | return false && ((m_sdl_access == SDL_TEXTUREACCESS_STATIC) | |
| 138 | && (m_copyinfo->func != NULL)) ; | |
| 139 | } | |
| 134 | const HashT hash() const { return m_hash; } | |
| 135 | const UINT32 flags() const { return m_flags; } | |
| 136 | const bool is_pixels_owned() const { // do we own / allocated it ? | |
| 137 | return false && ((m_sdl_access == SDL_TEXTUREACCESS_STATIC) | |
| 138 | && (m_copyinfo->func != NULL)) ; | |
| 139 | } | |
| 140 | 140 | |
| 141 | 141 | private: |
| 142 | Uint32 m_sdl_access; | |
| 143 | SDL_Renderer * m_renderer; | |
| 144 | render_texinfo m_texinfo; // copy of the texture info | |
| 145 | HashT m_hash; // hash value for the texture (must be >= pointer size) | |
| 146 | UINT32 m_flags; // rendering flags | |
| 142 | Uint32 m_sdl_access; | |
| 143 | SDL_Renderer * m_renderer; | |
| 144 | render_texinfo m_texinfo; // copy of the texture info | |
| 145 | HashT m_hash; // hash value for the texture (must be >= pointer size) | |
| 146 | UINT32 m_flags; // rendering flags | |
| 147 | 147 | |
| 148 | SDL_Texture * m_texture_id; | |
| 149 | int m_is_rotated; | |
| 148 | SDL_Texture * m_texture_id; | |
| 149 | int m_is_rotated; | |
| 150 | 150 | |
| 151 | int m_format; // texture format | |
| 152 | SDL_BlendMode m_sdl_blendmode; | |
| 151 | int m_format; // texture format | |
| 152 | SDL_BlendMode m_sdl_blendmode; | |
| 153 | 153 | |
| 154 | ||
| 154 | texture_info * m_next; // next texture in the list | |
| 155 | 155 | }; |
| 156 | 156 | |
| 157 | 157 | /* sdl_info is the information about SDL for the current screen */ |
| 158 | 158 | struct sdl_info |
| 159 | 159 | { |
| 160 | sdl_info() | |
| 161 | : m_blittimer(0), m_renderer(NULL), | |
| 162 | m_hofs(0), m_vofs(0), | |
| 163 | m_resize_pending(0), m_resize_width(0), m_resize_height(0), | |
| 164 | m_last_blit_time(0), m_last_blit_pixels(0) | |
| 165 | {} | |
| 160 | sdl_info() | |
| 161 | : m_blittimer(0), m_renderer(NULL), | |
| 162 | m_hofs(0), m_vofs(0), | |
| 163 | m_resize_pending(0), m_resize_width(0), m_resize_height(0), | |
| 164 | m_last_blit_time(0), m_last_blit_pixels(0) | |
| 165 | {} | |
| 166 | 166 | |
| 167 | ||
| 167 | void render_quad(texture_info *texture, const render_primitive *prim, const int x, const int y); | |
| 168 | 168 | |
| 169 | texture_info *texture_find(const render_primitive &prim, const quad_setup_data &setup); | |
| 170 | texture_info *texture_update(const render_primitive &prim); | |
| 169 | texture_info *texture_find(const render_primitive &prim, const quad_setup_data &setup); | |
| 170 | texture_info *texture_update(const render_primitive &prim); | |
| 171 | 171 | |
| 172 | 172 | INT32 m_blittimer; |
| 173 | 173 | |
| r243192 | r243193 | |
| 389 | 389 | target_rect.w = round_nearest(prim->bounds.x1 - prim->bounds.x0); |
| 390 | 390 | target_rect.h = round_nearest(prim->bounds.y1 - prim->bounds.y0); |
| 391 | 391 | |
| 392 | SDL_SetTextureBlendMode(m_texture_id, m_sdl_blendmode); | |
| 393 | set_coloralphamode(m_texture_id, &prim->color); | |
| 394 | SDL_RenderCopy(m_renderer, m_texture_id, NULL, &target_rect); | |
| 392 | SDL_SetTextureBlendMode(m_texture_id, m_sdl_blendmode); | |
| 393 | set_coloralphamode(m_texture_id, &prim->color); | |
| 394 | SDL_RenderCopy(m_renderer, m_texture_id, NULL, &target_rect); | |
| 395 | 395 | } |
| 396 | 396 | |
| 397 | 397 | void sdl_info::render_quad(texture_info *texture, const render_primitive *prim, const int x, const int y) |
| 398 | 398 | { |
| 399 | ||
| 399 | SDL_Rect target_rect; | |
| 400 | 400 | |
| 401 | target_rect.x = x; | |
| 402 | target_rect.y = y; | |
| 403 | target_rect.w = round_nearest(prim->bounds.x1 - prim->bounds.x0); | |
| 404 | target_rect.h = round_nearest(prim->bounds.y1 - prim->bounds.y0); | |
| 401 | target_rect.x = x; | |
| 402 | target_rect.y = y; | |
| 403 | target_rect.w = round_nearest(prim->bounds.x1 - prim->bounds.x0); | |
| 404 | target_rect.h = round_nearest(prim->bounds.y1 - prim->bounds.y0); | |
| 405 | 405 | |
| 406 | if (texture) | |
| 407 | { | |
| 408 | copy_info_t *copyinfo = texture->m_copyinfo; | |
| 409 | copyinfo->time -= osd_ticks(); | |
| 410 | texture->render_quad(prim, x, y); | |
| 411 | copyinfo->time += osd_ticks(); | |
| 406 | if (texture) | |
| 407 | { | |
| 408 | copy_info_t *copyinfo = texture->m_copyinfo; | |
| 409 | copyinfo->time -= osd_ticks(); | |
| 410 | texture->render_quad(prim, x, y); | |
| 411 | copyinfo->time += osd_ticks(); | |
| 412 | 412 | |
| 413 | copyinfo->pixel_count += MAX(STAT_PIXEL_THRESHOLD , (texture->raw_width() * texture->raw_height())); | |
| 414 | if (m_last_blit_pixels) | |
| 415 | { | |
| 416 | copyinfo->time += (m_last_blit_time * (INT64) (texture->raw_width() * texture->raw_height())) / (INT64) m_last_blit_pixels; | |
| 417 | } | |
| 418 | copyinfo->samples++; | |
| 419 | copyinfo->perf = ( texture->m_copyinfo->pixel_count * (osd_ticks_per_second()/1000)) / texture->m_copyinfo->time; | |
| 420 | } | |
| 421 | else | |
| 422 | { | |
| 423 | UINT32 sr = (UINT32)(255.0f * prim->color.r); | |
| 424 | UINT32 sg = (UINT32)(255.0f * prim->color.g); | |
| 425 | UINT32 sb = (UINT32)(255.0f * prim->color.b); | |
| 426 | UINT32 sa = (UINT32)(255.0f * prim->color.a); | |
| 413 | copyinfo->pixel_count += MAX(STAT_PIXEL_THRESHOLD , (texture->raw_width() * texture->raw_height())); | |
| 414 | if (m_last_blit_pixels) | |
| 415 | { | |
| 416 | copyinfo->time += (m_last_blit_time * (INT64) (texture->raw_width() * texture->raw_height())) / (INT64) m_last_blit_pixels; | |
| 417 | } | |
| 418 | copyinfo->samples++; | |
| 419 | copyinfo->perf = ( texture->m_copyinfo->pixel_count * (osd_ticks_per_second()/1000)) / texture->m_copyinfo->time; | |
| 420 | } | |
| 421 | else | |
| 422 | { | |
| 423 | UINT32 sr = (UINT32)(255.0f * prim->color.r); | |
| 424 | UINT32 sg = (UINT32)(255.0f * prim->color.g); | |
| 425 | UINT32 sb = (UINT32)(255.0f * prim->color.b); | |
| 426 | UINT32 sa = (UINT32)(255.0f * prim->color.a); | |
| 427 | 427 | |
| 428 | SDL_SetRenderDrawBlendMode(m_renderer, map_blendmode(PRIMFLAG_GET_BLENDMODE(prim->flags))); | |
| 429 | SDL_SetRenderDrawColor(m_renderer, sr, sg, sb, sa); | |
| 430 | SDL_RenderFillRect(m_renderer, &target_rect); | |
| 431 | } | |
| 428 | SDL_SetRenderDrawBlendMode(m_renderer, map_blendmode(PRIMFLAG_GET_BLENDMODE(prim->flags))); | |
| 429 | SDL_SetRenderDrawColor(m_renderer, sr, sg, sb, sa); | |
| 430 | SDL_RenderFillRect(m_renderer, &target_rect); | |
| 431 | } | |
| 432 | 432 | } |
| 433 | 433 | |
| 434 | 434 | static int RendererSupportsFormat(SDL_Renderer *renderer, Uint32 format, Uint32 access, const char *sformat) |
| r243192 | r243193 | |
| 518 | 518 | else |
| 519 | 519 | osd_printf_verbose("Loaded opengl shared library: %s\n", stemp ? stemp : "<default>"); |
| 520 | 520 | |
| 521 | /* Enable bilinear filtering in case it is supported. | |
| 522 | * This applies to all texture operations. However, artwort is pre-scaled | |
| 523 | * and thus shouldn't be affected. | |
| 524 | */ | |
| 525 | if (video_config.filter) | |
| 526 | { | |
| 527 | SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "1"); | |
| 528 | } | |
| 529 | else | |
| 530 | { | |
| 531 | SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "0"); | |
| 532 | } | |
| 521 | /* Enable bilinear filtering in case it is supported. | |
| 522 | * This applies to all texture operations. However, artwort is pre-scaled | |
| 523 | * and thus shouldn't be affected. | |
| 524 | */ | |
| 525 | if (video_config.filter) | |
| 526 | { | |
| 527 | SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "1"); | |
| 528 | } | |
| 529 | else | |
| 530 | { | |
| 531 | SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "0"); | |
| 532 | } | |
| 533 | 533 | |
| 534 | 534 | return 0; |
| 535 | 535 | } |
| r243192 | r243193 | |
| 604 | 604 | { |
| 605 | 605 | SDL_DisplayMode mode; |
| 606 | 606 | //SDL_GetCurrentDisplayMode(window->monitor()->handle, &mode); |
| 607 | ||
| 607 | SDL_GetWindowDisplayMode(window->sdl_window, &mode); | |
| 608 | 608 | sdl->m_original_mode = mode; |
| 609 | 609 | mode.w = width; |
| 610 | 610 | mode.h = height; |
| r243192 | r243193 | |
| 630 | 630 | osd_printf_warning("Ignoring depth %d\n", window->depth); |
| 631 | 631 | } |
| 632 | 632 | } |
| 633 | ||
| 633 | SDL_SetWindowDisplayMode(window->sdl_window, &mode); // Try to set mode | |
| 634 | 634 | #ifndef SDLMAME_WIN32 |
| 635 | /* FIXME: Warp the mouse to 0,0 in case a virtual desktop resolution | |
| 636 | * is in place after the mode switch - which will most likely be the case | |
| 637 | * This is a hack to work around a deficiency in SDL2 | |
| 638 | */ | |
| 639 | SDL_WarpMouseInWindow(window->sdl_window, 1, 1); | |
| 635 | /* FIXME: Warp the mouse to 0,0 in case a virtual desktop resolution | |
| 636 | * is in place after the mode switch - which will most likely be the case | |
| 637 | * This is a hack to work around a deficiency in SDL2 | |
| 638 | */ | |
| 639 | SDL_WarpMouseInWindow(window->sdl_window, 1, 1); | |
| 640 | 640 | #endif |
| 641 | 641 | } |
| 642 | 642 | else |
| r243192 | r243193 | |
| 736 | 736 | SDL_GetWindowSize(window->sdl_window, &window->width, &window->height); |
| 737 | 737 | sdl->m_resize_pending = 0; |
| 738 | 738 | SDL_RenderSetViewport(sdl->m_renderer, NULL); |
| 739 | | |
| 739 | //sdlvideo_monitor_refresh(window->monitor()); | |
| 740 | 740 | |
| 741 | 741 | } |
| 742 | 742 | |
| r243192 | r243193 | |
| 855 | 855 | |
| 856 | 856 | drawsdl2_destroy_all_textures(window); |
| 857 | 857 | |
| 858 | if (window->fullscreen() && video_config.switchres) | |
| 859 | { | |
| 860 | SDL_SetWindowFullscreen(window->sdl_window, 0); // Try to set mode | |
| 861 | SDL_SetWindowDisplayMode(window->sdl_window, &sdl->m_original_mode); // Try to set mode | |
| 862 | SDL_SetWindowFullscreen(window->sdl_window, SDL_WINDOW_FULLSCREEN); // Try to set mode | |
| 863 | } | |
| 858 | if (window->fullscreen() && video_config.switchres) | |
| 859 | { | |
| 860 | SDL_SetWindowFullscreen(window->sdl_window, 0); // Try to set mode | |
| 861 | SDL_SetWindowDisplayMode(window->sdl_window, &sdl->m_original_mode); // Try to set mode | |
| 862 | SDL_SetWindowFullscreen(window->sdl_window, SDL_WINDOW_FULLSCREEN); // Try to set mode | |
| 863 | } | |
| 864 | 864 | |
| 865 | ||
| 865 | SDL_DestroyWindow(window->sdl_window); | |
| 866 | 866 | |
| 867 | 867 | global_free(sdl); |
| 868 | 868 | window->dxdata = NULL; |
| r243192 | r243193 | |
| 889 | 889 | { |
| 890 | 890 | if (RendererSupportsFormat(m_renderer, bi->dst_fmt, m_sdl_access, bi->dstname)) |
| 891 | 891 | { |
| 892 | | |
| 892 | int perf = bi->perf; | |
| 893 | 893 | if (perf == 0) |
| 894 | 894 | return bi; |
| 895 | 895 | else if (perf > (maxperf * 102) / 100) |
| r243192 | r243193 | |
| 920 | 920 | |
| 921 | 921 | bool texture_info::matches(const render_primitive &prim, const quad_setup_data &setup) |
| 922 | 922 | { |
| 923 | return texinfo().base == prim.texture.base && | |
| 924 | texinfo().width == prim.texture.width && | |
| 925 | texinfo().height == prim.texture.height && | |
| 926 | texinfo().rowpixels == prim.texture.rowpixels && | |
| 927 | m_setup.dudx == setup.dudx && | |
| 928 | m_setup.dvdx == setup.dvdx && | |
| 929 | m_setup.dudy == setup.dudy && | |
| 930 | m_setup.dvdy == setup.dvdy && | |
| 931 | ((flags() ^ prim.flags) & (PRIMFLAG_BLENDMODE_MASK | PRIMFLAG_TEXFORMAT_MASK)) == 0; | |
| 923 | return texinfo().base == prim.texture.base && | |
| 924 | texinfo().width == prim.texture.width && | |
| 925 | texinfo().height == prim.texture.height && | |
| 926 | texinfo().rowpixels == prim.texture.rowpixels && | |
| 927 | m_setup.dudx == setup.dudx && | |
| 928 | m_setup.dvdx == setup.dvdx && | |
| 929 | m_setup.dudy == setup.dudy && | |
| 930 | m_setup.dvdy == setup.dvdy && | |
| 931 | ((flags() ^ prim.flags) & (PRIMFLAG_BLENDMODE_MASK | PRIMFLAG_TEXFORMAT_MASK)) == 0; | |
| 932 | 932 | } |
| 933 | 933 | |
| 934 | 934 | //============================================================ |
| r243192 | r243193 | |
| 937 | 937 | |
| 938 | 938 | texture_info::texture_info(SDL_Renderer *renderer, const render_texinfo &texsource, const quad_setup_data &setup, UINT32 flags) |
| 939 | 939 | { |
| 940 | ||
| 940 | 941 | // fill in the core data |
| 941 | ||
| 942 | m_renderer = renderer; | |
| 942 | 943 | m_hash = texture_compute_hash(texsource, flags); |
| 943 | 944 | m_flags = flags; |
| 944 | 945 | m_texinfo = texsource; |
| r243192 | r243193 | |
| 996 | 997 | |
| 997 | 998 | if (m_sdl_access == SDL_TEXTUREACCESS_STATIC) |
| 998 | 999 | { |
| 999 | if (m_copyinfo->func != NULL) | |
| 1000 | m_pixels = malloc(m_setup.rotwidth * m_setup.rotheight * m_copyinfo->dst_bpp); | |
| 1001 | else | |
| 1002 | m_pixels = NULL; | |
| 1000 | if (m_copyinfo->func != NULL) | |
| 1001 | m_pixels = malloc(m_setup.rotwidth * m_setup.rotheight * m_copyinfo->dst_bpp); | |
| 1002 | else | |
| 1003 | m_pixels = NULL; | |
| 1003 | 1004 | } |
| 1004 | 1005 | m_last_access = osd_ticks(); |
| 1005 | 1006 | |
| r243192 | r243193 | |
| 1007 | 1008 | |
| 1008 | 1009 | texture_info::~texture_info() |
| 1009 | 1010 | { |
| 1010 | if ( is_pixels_owned() && (m_pixels != NULL) ) | |
| 1011 | free(m_pixels); | |
| 1012 | SDL_DestroyTexture(m_texture_id); | |
| 1011 | if ( is_pixels_owned() && (m_pixels != NULL) ) | |
| 1012 | free(m_pixels); | |
| 1013 | SDL_DestroyTexture(m_texture_id); | |
| 1013 | 1014 | } |
| 1014 | 1015 | |
| 1015 | 1016 | //============================================================ |
| r243192 | r243193 | |
| 1081 | 1082 | |
| 1082 | 1083 | #if 0 |
| 1083 | 1084 | printf("tl.u %f tl.v %f\n", texcoords->tl.u, texcoords->tl.v); |
| 1084 | printf("tr.u %f tr.v %f\n", texcoords->tr.u, texcoords->tr.v); | |
| 1085 | printf("bl.u %f bl.v %f\n", texcoords->bl.u, texcoords->bl.v); | |
| 1086 | printf("br.u %f br.v %f\n", texcoords->br.u, texcoords->br.v); | |
| 1085 | printf("tr.u %f tr.v %f\n", texcoords->tr.u, texcoords->tr.v); | |
| 1086 | printf("bl.u %f bl.v %f\n", texcoords->bl.u, texcoords->bl.v); | |
| 1087 | printf("br.u %f br.v %f\n", texcoords->br.u, texcoords->br.v); | |
| 1087 | 1088 | /* compute start and delta U,V coordinates now */ |
| 1088 | 1089 | #endif |
| 1089 | 1090 | |
| r243192 | r243193 | |
| 1161 | 1162 | if (texture == NULL && prim.texture.base != NULL) |
| 1162 | 1163 | { |
| 1163 | 1164 | texture = global_alloc(texture_info(m_renderer, prim.texture, setup, prim.flags)); |
| 1164 | | |
| 1165 | /* add us to the texture list */ | |
| 1165 | 1166 | m_texlist.prepend(*texture); |
| 1166 | 1167 | |
| 1167 | 1168 | } |
| r243192 | r243193 | |
| 1190 | 1191 | if(window->primlist) |
| 1191 | 1192 | { |
| 1192 | 1193 | window->primlist->acquire_lock(); |
| 1193 | sdl->m_texlist.reset(); | |
| 1194 | window->primlist->release_lock(); | |
| 1194 | sdl->m_texlist.reset(); | |
| 1195 | window->primlist->release_lock(); | |
| 1195 | 1196 | } |
| 1196 | 1197 | else |
| 1197 | ||
| 1198 | sdl->m_texlist.reset(); | |
| 1198 | 1199 | } |
| r243192 | r243193 | |
|---|---|---|
| 161 | 161 | /* texture_info holds information about a texture */ |
| 162 | 162 | struct texture_info |
| 163 | 163 | { |
| 164 | texture_info() | |
| 165 | : hash(0), flags(0), rawwidth(0), rawheight(0), | |
| 166 | rawwidth_create(0), rawheight_create(0), | |
| 167 | type(0), format(0), borderpix(0), xprescale(0), yprescale(0), nocopy(0), | |
| 168 | texture(0), texTarget(0), texpow2(0), mpass_dest_idx(0), pbo(0), data(NULL), | |
| 169 | data_own(0), texCoordBufferName(0) | |
| 170 | { | |
| 171 | for (int i=0; i<2; i++) | |
| 172 | { | |
| 173 | mpass_textureunit[i] = 0; | |
| 174 | mpass_texture_mamebm[i] = 0; | |
| 175 | mpass_fbo_mamebm[i] = 0; | |
| 176 | mpass_texture_scrn[i] = 0; | |
| 177 | mpass_fbo_scrn[i] = 0; | |
| 178 | } | |
| 179 | for (int i=0; i<8; i++) | |
| 180 | texCoord[i] = 0.0f; | |
| 181 | } | |
| 164 | texture_info() | |
| 165 | : hash(0), flags(0), rawwidth(0), rawheight(0), | |
| 166 | rawwidth_create(0), rawheight_create(0), | |
| 167 | type(0), format(0), borderpix(0), xprescale(0), yprescale(0), nocopy(0), | |
| 168 | texture(0), texTarget(0), texpow2(0), mpass_dest_idx(0), pbo(0), data(NULL), | |
| 169 | data_own(0), texCoordBufferName(0) | |
| 170 | { | |
| 171 | for (int i=0; i<2; i++) | |
| 172 | { | |
| 173 | mpass_textureunit[i] = 0; | |
| 174 | mpass_texture_mamebm[i] = 0; | |
| 175 | mpass_fbo_mamebm[i] = 0; | |
| 176 | mpass_texture_scrn[i] = 0; | |
| 177 | mpass_fbo_scrn[i] = 0; | |
| 178 | } | |
| 179 | for (int i=0; i<8; i++) | |
| 180 | texCoord[i] = 0.0f; | |
| 181 | } | |
| 182 | 182 | |
| 183 | 183 | HashT hash; // hash value for the texture (must be >= pointer size) |
| 184 | 184 | UINT32 flags; // rendering flags |
| r243192 | r243193 | |
| 217 | 217 | /* sdl_info is the information about SDL for the current screen */ |
| 218 | 218 | struct sdl_info |
| 219 | 219 | { |
| 220 | sdl_info() | |
| 221 | : blittimer(0), extra_flags(0), | |
| 220 | sdl_info() | |
| 221 | : blittimer(0), extra_flags(0), | |
| 222 | 222 | #if (SDLMAME_SDL2) |
| 223 | ||
| 223 | gl_context_id(0), | |
| 224 | 224 | #else |
| 225 | ||
| 225 | sdlsurf(NULL), | |
| 226 | 226 | #endif |
| 227 | initialized(0), | |
| 228 | last_blendmode(0), | |
| 229 | texture_max_width(0), | |
| 230 | texture_max_height(0), | |
| 231 | texpoweroftwo(0), | |
| 232 | usevbo(0), usepbo(0), usefbo(0), useglsl(0), glsl(NULL), | |
| 233 | glsl_program_num(0), | |
| 234 | glsl_program_mb2sc(0), | |
| 235 | usetexturerect(0), | |
| 236 | init_context(0), | |
| 237 | last_hofs(0.0f), | |
| 238 | last_vofs(0.0f), | |
| 239 | surf_w(0), | |
| 240 | surf_h(0) | |
| 241 | { | |
| 242 | for (int i=0; i < HASH_SIZE + OVERFLOW_SIZE; i++) | |
| 243 | texhash[i] = NULL; | |
| 244 | for (int i=0; i < 2*GLSL_SHADER_MAX; i++) | |
| 245 | glsl_program[i] = 0; | |
| 246 | for (int i=0; i < 8; i++) | |
| 247 | texVerticex[i] = 0.0f; | |
| 248 | } | |
| 227 | initialized(0), | |
| 228 | last_blendmode(0), | |
| 229 | texture_max_width(0), | |
| 230 | texture_max_height(0), | |
| 231 | texpoweroftwo(0), | |
| 232 | usevbo(0), usepbo(0), usefbo(0), useglsl(0), glsl(NULL), | |
| 233 | glsl_program_num(0), | |
| 234 | glsl_program_mb2sc(0), | |
| 235 | usetexturerect(0), | |
| 236 | init_context(0), | |
| 237 | last_hofs(0.0f), | |
| 238 | last_vofs(0.0f), | |
| 239 | surf_w(0), | |
| 240 | surf_h(0) | |
| 241 | { | |
| 242 | for (int i=0; i < HASH_SIZE + OVERFLOW_SIZE; i++) | |
| 243 | texhash[i] = NULL; | |
| 244 | for (int i=0; i < 2*GLSL_SHADER_MAX; i++) | |
| 245 | glsl_program[i] = 0; | |
| 246 | for (int i=0; i < 8; i++) | |
| 247 | texVerticex[i] = 0.0f; | |
| 248 | } | |
| 249 | 249 | |
| 250 | 250 | INT32 blittimer; |
| 251 | 251 | UINT32 extra_flags; |
| r243192 | r243193 | |
| 3079 | 3079 | sdl->texhash[i] = NULL; |
| 3080 | 3080 | if (texture != NULL) |
| 3081 | 3081 | { |
| 3082 | if(sdl->usevbo) | |
| 3083 | { | |
| 3084 | pfn_glDeleteBuffers( 1, &(texture->texCoordBufferName) ); | |
| 3085 | texture->texCoordBufferName=0; | |
| 3086 | } | |
| 3082 | if(sdl->usevbo) | |
| 3083 | { | |
| 3084 | pfn_glDeleteBuffers( 1, &(texture->texCoordBufferName) ); | |
| 3085 | texture->texCoordBufferName=0; | |
| 3086 | } | |
| 3087 | 3087 | |
| 3088 | if(sdl->usepbo && texture->pbo) | |
| 3089 | { | |
| 3090 | pfn_glDeleteBuffers( 1, (GLuint *)&(texture->pbo) ); | |
| 3091 | texture->pbo=0; | |
| 3092 | } | |
| 3088 | if(sdl->usepbo && texture->pbo) | |
| 3089 | { | |
| 3090 | pfn_glDeleteBuffers( 1, (GLuint *)&(texture->pbo) ); | |
| 3091 | texture->pbo=0; | |
| 3092 | } | |
| 3093 | 3093 | |
| 3094 | if( sdl->glsl_program_num > 1 ) | |
| 3095 | { | |
| 3096 | assert(sdl->usefbo); | |
| 3097 | pfn_glDeleteFramebuffers(2, (GLuint *)&texture->mpass_fbo_mamebm[0]); | |
| 3098 | glDeleteTextures(2, (GLuint *)&texture->mpass_texture_mamebm[0]); | |
| 3099 | } | |
| 3094 | if( sdl->glsl_program_num > 1 ) | |
| 3095 | { | |
| 3096 | assert(sdl->usefbo); | |
| 3097 | pfn_glDeleteFramebuffers(2, (GLuint *)&texture->mpass_fbo_mamebm[0]); | |
| 3098 | glDeleteTextures(2, (GLuint *)&texture->mpass_texture_mamebm[0]); | |
| 3099 | } | |
| 3100 | 3100 | |
| 3101 | if ( sdl->glsl_program_mb2sc < sdl->glsl_program_num - 1 ) | |
| 3102 | { | |
| 3103 | assert(sdl->usefbo); | |
| 3104 | pfn_glDeleteFramebuffers(2, (GLuint *)&texture->mpass_fbo_scrn[0]); | |
| 3105 | glDeleteTextures(2, (GLuint *)&texture->mpass_texture_scrn[0]); | |
| 3106 | } | |
| 3101 | if ( sdl->glsl_program_mb2sc < sdl->glsl_program_num - 1 ) | |
| 3102 | { | |
| 3103 | assert(sdl->usefbo); | |
| 3104 | pfn_glDeleteFramebuffers(2, (GLuint *)&texture->mpass_fbo_scrn[0]); | |
| 3105 | glDeleteTextures(2, (GLuint *)&texture->mpass_texture_scrn[0]); | |
| 3106 | } | |
| 3107 | 3107 | |
| 3108 | glDeleteTextures(1, (GLuint *)&texture->texture); | |
| 3109 | if ( texture->data_own ) | |
| 3110 | { | |
| 3111 | free(texture->data); | |
| 3112 | texture->data=NULL; | |
| 3113 | texture->data_own=FALSE; | |
| 3114 | } | |
| 3115 | global_free(texture); | |
| 3108 | glDeleteTextures(1, (GLuint *)&texture->texture); | |
| 3109 | if ( texture->data_own ) | |
| 3110 | { | |
| 3111 | free(texture->data); | |
| 3112 | texture->data=NULL; | |
| 3113 | texture->data_own=FALSE; | |
| 3114 | } | |
| 3115 | global_free(texture); | |
| 3116 | 3116 | } |
| 3117 | 3117 | i++; |
| 3118 | 3118 | } |
| r243192 | r243193 | |
|---|---|---|
| 1986 | 1986 | else |
| 1987 | 1987 | { |
| 1988 | 1988 | #ifndef SDLMAME_WIN32 |
| 1989 | /* FIXME: SDL2 sends some spurious resize events on Ubuntu | |
| 1990 | * while in fullscreen mode. Ignore them for now. | |
| 1991 | */ | |
| 1992 | if (!window->fullscreen()) | |
| 1989 | /* FIXME: SDL2 sends some spurious resize events on Ubuntu | |
| 1990 | * while in fullscreen mode. Ignore them for now. | |
| 1991 | */ | |
| 1992 | if (!window->fullscreen()) | |
| 1993 | 1993 | #endif |
| 1994 | { | |
| 1995 | //printf("event data1,data2 %d x %d %ld\n", event.window.data1, event.window.data2, sizeof(SDL_Event)); | |
| 1996 | if (event.window.data1 != window->width || event.window.data2 != window->height) | |
| 1997 | window->window_resize(event.window.data1, event.window.data2); | |
| 1998 | } | |
| 1994 | { | |
| 1995 | //printf("event data1,data2 %d x %d %ld\n", event.window.data1, event.window.data2, sizeof(SDL_Event)); | |
| 1996 | if (event.window.data1 != window->width || event.window.data2 != window->height) | |
| 1997 | window->window_resize(event.window.data1, event.window.data2); | |
| 1998 | } | |
| 1999 | 1999 | } |
| 2000 | 2000 | focus_window = window; |
| 2001 | 2001 | break; |
| r243192 | r243193 | |
|---|---|---|
| 1 | // license:BSD-3-Clause | |
| 2 | // copyright-holders:Aaron Giles | |
| 3 | 1 | //============================================================ |
| 4 | 2 | // |
| 5 | 3 | // main.c - Win32 main program |
| 6 | 4 | // |
| 5 | // Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team. | |
| 6 | // Visit http://mamedev.org for licensing and usage restrictions. | |
| 7 | // | |
| 8 | // SDLMAME by Olivier Galibert and R. Belmont | |
| 9 | // | |
| 7 | 10 | //============================================================ |
| 8 | 11 | |
| 9 | 12 | // standard windows headers |
| 10 | #ifdef OSD_SDL | |
| 11 | 13 | #define _WIN32_WINNT 0x0400 |
| 12 | #endif | |
| 13 | 14 | #define WIN32_LEAN_AND_MEAN |
| 14 | 15 | #include <windows.h> |
| 15 | 16 | #include <tchar.h> |
| r243192 | r243193 | |
| 37 | 38 | int i, rc; |
| 38 | 39 | char **utf8_argv; |
| 39 | 40 | |
| 40 | #ifdef OSD_SDL | |
| 41 | 41 | #ifdef MALLOC_DEBUG |
| 42 | 42 | { |
| 43 | 43 | extern int winalloc_in_main_code; |
| 44 | 44 | winalloc_in_main_code = TRUE; |
| 45 | 45 | #endif |
| 46 | #endif | |
| 47 | 46 | |
| 48 | 47 | /* convert arguments to UTF-8 */ |
| 49 | 48 | utf8_argv = (char **) malloc(argc * sizeof(*argv)); |
| r243192 | r243193 | |
| 64 | 63 | osd_free(utf8_argv[i]); |
| 65 | 64 | free(utf8_argv); |
| 66 | 65 | |
| 67 | #ifdef OSD_SDL | |
| 68 | 66 | #ifdef MALLOC_DEBUG |
| 69 | 67 | { |
| 70 | 68 | void check_unfreed_mem(void); |
| r243192 | r243193 | |
| 73 | 71 | winalloc_in_main_code = FALSE; |
| 74 | 72 | } |
| 75 | 73 | #endif |
| 76 | #endif | |
| 77 | 74 | |
| 78 | 75 | return rc; |
| 79 | 76 | } |
| r243192 | r243193 | |
|---|---|---|
| 6 | 6 | .\" Cesare Falco <c.falco@ubuntu.com>, February 2011 |
| 7 | 7 | .\" |
| 8 | 8 | .\" |
| 9 | .TH CASTOOL 1 201 | |
| 9 | .TH CASTOOL 1 2014-12-15 0.157 "MESS Generic cassette manipulation tool" | |
| 10 | 10 | .\" |
| 11 | 11 | .\" |
| 12 | 12 | .\" NAME chapter |
| r243192 | r243193 | |
|---|---|---|
| 6 | 6 | .\" Ashley T. Howes <debiandev@ashleyhowes.com>, February 2005 |
| 7 | 7 | .\" updated by Cesare Falco <c.falco@ubuntu.com>, February 2007 |
| 8 | 8 | .\" |
| 9 | .TH CHDMAN 1 201 | |
| 9 | .TH CHDMAN 1 2014-12-15 0.157 "MAME Compressed Hunks of Data (CHD) manager" | |
| 10 | 10 | .\" |
| 11 | 11 | .\" NAME chapter |
| 12 | 12 | .SH NAME |
| r243192 | r243193 | |
|---|---|---|
| 6 | 6 | .\" Cesare Falco <c.falco@ubuntu.com>, April 2014 |
| 7 | 7 | .\" |
| 8 | 8 | .\" |
| 9 | .TH FLOPTOOL 1 201 | |
| 9 | .TH FLOPTOOL 1 2014-12-15 0.157 "MESS Generic floppy manipulation tool" | |
| 10 | 10 | .\" |
| 11 | 11 | .\" |
| 12 | 12 | .\" NAME chapter |
| r243192 | r243193 | |
|---|---|---|
| 6 | 6 | .\" Cesare Falco <c.falco@ubuntu.com>, February 2011 |
| 7 | 7 | .\" |
| 8 | 8 | .\" |
| 9 | .TH IMGTOOL 1 201 | |
| 9 | .TH IMGTOOL 1 2014-12-15 0.157 "MESS media image manipulation tool" | |
| 10 | 10 | .\" |
| 11 | 11 | .\" |
| 12 | 12 | .\" NAME chapter |
| r243192 | r243193 | |
|---|---|---|
| 8 | 8 | .\" References |
| 9 | 9 | .\" http://aarongiles.com/?p=159 |
| 10 | 10 | .\" |
| 11 | .TH JEDUTIL 1 201 | |
| 11 | .TH JEDUTIL 1 2014-12-15 0.157 "MAME JEDEC file utilities" | |
| 12 | 12 | .\" |
| 13 | 13 | .\" NAME chapter |
| 14 | 14 | .SH NAME |
| r243192 | r243193 | |
|---|---|---|
| 3 | 3 | .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection |
| 4 | 4 | .\" other parameters are allowed: see man(7), man(1) |
| 5 | 5 | .\" |
| 6 | .TH LDRESAMPLE 1 201 | |
| 6 | .TH LDRESAMPLE 1 2014-12-15 0.157 "MAME laserdisc audio manipulation tool" | |
| 7 | 7 | .\" |
| 8 | 8 | .\" Please adjust this date whenever revising the manpage. |
| 9 | 9 | .\" |
| r243192 | r243193 | |
|---|---|---|
| 5 | 5 | .\" Man page created from source and usage information by |
| 6 | 6 | .\" Cesare Falco <c.falco@ubuntu.com>, August 2008 |
| 7 | 7 | .\" |
| 8 | .TH LDVERIFY 1 201 | |
| 8 | .TH LDVERIFY 1 2014-12-15 0.157 "MAME laserdisc data checker" | |
| 9 | 9 | .\" |
| 10 | 10 | .\" NAME chapter |
| 11 | 11 | .SH NAME |
| r243192 | r243193 | |
|---|---|---|
| 13 | 13 | .\" and updated by Andrew Burton <burtona@gol.com>, July 2003 |
| 14 | 14 | .\" |
| 15 | 15 | .\" |
| 16 | .TH MAME 6 201 | |
| 16 | .TH MAME 6 2014-12-15 0.157 "MAME \- The Multiple Arcade Machine Emulator" | |
| 17 | 17 | .\" |
| 18 | 18 | .\" |
| 19 | 19 | .\" NAME chapter |
| r243192 | r243193 | |
|---|---|---|
| 16 | 16 | .\" http://www.mess.org/ |
| 17 | 17 | .\" |
| 18 | 18 | .\" |
| 19 | .TH MESS 6 201 | |
| 19 | .TH MESS 6 2014-12-15 0.157 "The Multiple Emulator Super System (MESS)" | |
| 20 | 20 | .\" |
| 21 | 21 | .\" |
| 22 | 22 | .\" NAME chapter |
| r243192 | r243193 | |
|---|---|---|
| 9 | 9 | .\" References |
| 10 | 10 | .\" http://www.mame.net/mamefaq.html |
| 11 | 11 | .\" |
| 12 | .TH ROMCMP 1 201 | |
| 12 | .TH ROMCMP 1 2014-12-15 0.157 "MAME romset checking tool" | |
| 13 | 13 | .\" |
| 14 | 14 | .\" NAME chapter |
| 15 | 15 | .SH NAME |
| r243192 | r243193 | |
|---|---|---|
| 5 | 5 | .\" Man page created from source and usage information |
| 6 | 6 | .\" Cesare Falco <c.falco@ubuntu.com>, February 2007 |
| 7 | 7 | .\" |
| 8 | .TH TESTKEYS 1 201 | |
| 8 | .TH TESTKEYS 1 2014-12-15 0.157 "MAME SDL keycode scanner" | |
| 9 | 9 | .\" |
| 10 | 10 | .\" NAME chapter |
| 11 | 11 | .SH NAME |
| r243192 | r243193 | |
|---|---|---|
| 6 | 6 | #include "emu.h" |
| 7 | 7 | #include "osdnet.h" |
| 8 | 8 | |
| 9 | #define pcap_compile_dl pcap_compile | |
| 10 | #define pcap_findalldevs_dl pcap_findalldevs | |
| 11 | #define pcap_open_live_dl pcap_open_live | |
| 12 | #define pcap_next_ex_dl pcap_next_ex | |
| 13 | #define pcap_close_dl pcap_close | |
| 14 | #define pcap_setfilter_dl pcap_setfilter | |
| 15 | #define pcap_sendpacket_dl pcap_sendpacket | |
| 16 | #define pcap_set_datalink_dl pcap_set_datalink | |
| 17 | ||
| 18 | ||
| 19 | 9 | class netdev_pcap : public netdev |
| 20 | 10 | { |
| 21 | 11 | public: |
| r243192 | r243193 | |
| 34 | 24 | : netdev(ifdev, rate) |
| 35 | 25 | { |
| 36 | 26 | char errbuf[PCAP_ERRBUF_SIZE]; |
| 37 | m_p = pcap_open_live | |
| 27 | m_p = pcap_open_live(name, 65535, 1, 1, errbuf); | |
| 38 | 28 | if(!m_p) |
| 39 | 29 | { |
| 40 | 30 | osd_printf_verbose("Unable to open %s: %s\n", name, errbuf); |
| 41 | 31 | return; |
| 42 | 32 | } |
| 43 | if(pcap_set_datalink | |
| 33 | if(pcap_set_datalink(m_p, DLT_EN10MB) == -1) | |
| 44 | 34 | { |
| 45 | osd_printf_verbose("Unable to set %s to ethernet\n", name); | |
| 46 | pcap_close_dl(m_p); | |
| 35 | osd_printf_verbose("Unable to set %s to ethernet", name); | |
| 36 | pcap_close(m_p); | |
| 47 | 37 | m_p = NULL; |
| 48 | 38 | return; |
| 49 | 39 | } |
| r243192 | r243193 | |
| 56 | 46 | struct bpf_program fp; |
| 57 | 47 | if(!m_p) return; |
| 58 | 48 | sprintf(filter, "ether dst %.2X:%.2X:%.2X:%.2X:%.2X:%.2X or ether multicast or ether broadcast", (unsigned char)mac[0], (unsigned char)mac[1], (unsigned char)mac[2],(unsigned char)mac[3], (unsigned char)mac[4], (unsigned char)mac[5]); |
| 59 | if(pcap_compile_dl(m_p, &fp, filter, 1, 0) == -1) { | |
| 60 | osd_printf_verbose("Error with pcap_compile\n"); | |
| 61 | } | |
| 62 | if(pcap_setfilter_dl(m_p, &fp) == -1) { | |
| 63 | osd_printf_verbose("Error with pcap_setfilter\n"); | |
| 64 | } | |
| 49 | pcap_compile(m_p, &fp, filter, 1, 0); | |
| 50 | pcap_setfilter(m_p, &fp); | |
| 65 | 51 | } |
| 66 | 52 | |
| 67 | 53 | int netdev_pcap::send(UINT8 *buf, int len) |
| 68 | 54 | { |
| 69 | 55 | if(!m_p) return 0; |
| 70 | return (!pcap_sendpacket | |
| 56 | return (!pcap_sendpacket(m_p, buf, len))?len:0; | |
| 71 | 57 | } |
| 72 | 58 | |
| 73 | 59 | int netdev_pcap::recv_dev(UINT8 **buf) |
| 74 | 60 | { |
| 75 | 61 | struct pcap_pkthdr *header; |
| 76 | 62 | if(!m_p) return 0; |
| 77 | return (pcap_next_ex | |
| 63 | return (pcap_next_ex(m_p, &header, (const u_char **)buf) == 1)?header->len:0; | |
| 78 | 64 | } |
| 79 | 65 | |
| 80 | 66 | netdev_pcap::~netdev_pcap() |
| 81 | 67 | { |
| 82 | if(m_p) pcap_close | |
| 68 | if(m_p) pcap_close(m_p); | |
| 83 | 69 | } |
| 84 | 70 | |
| 85 | 71 | static CREATE_NETDEV(create_pcap) |
| r243192 | r243193 | |
| 92 | 78 | { |
| 93 | 79 | pcap_if_t *devs; |
| 94 | 80 | char errbuf[PCAP_ERRBUF_SIZE]; |
| 95 | if(pcap_findalldevs | |
| 81 | if(pcap_findalldevs(&devs, errbuf) == -1) | |
| 96 | 82 | { |
| 97 | 83 | osd_printf_verbose("Unable to get network devices: %s\n", errbuf); |
| 98 | 84 | return; |
| 99 | 85 | } |
| 100 | 86 | |
| 101 | | |
| 87 | if (devs) | |
| 102 | 88 | { |
| 103 | add_netdev(devs->name, devs->description, create_pcap); | |
| 104 | devs = devs->next; | |
| 89 | while(devs->next) | |
| 90 | { | |
| 91 | add_netdev(devs->name, devs->description, create_pcap); | |
| 92 | devs = devs->next; | |
| 93 | } | |
| 105 | 94 | } |
| 106 | 95 | } |
| 107 | 96 |
| r243192 | r243193 | |
|---|---|---|
| 8 | 8 | #include <pthread.h> |
| 9 | 9 | #include <libkern/OSAtomic.h> |
| 10 | 10 | |
| 11 | #define pcap_compile_dl pcap_compile | |
| 12 | #define pcap_findalldevs_dl pcap_findalldevs | |
| 13 | #define pcap_open_live_dl pcap_open_live | |
| 14 | #define pcap_next_ex_dl pcap_next_ex | |
| 15 | #define pcap_close_dl pcap_close | |
| 16 | #define pcap_setfilter_dl pcap_setfilter | |
| 17 | #define pcap_sendpacket_dl pcap_sendpacket | |
| 18 | #define pcap_set_datalink_dl pcap_set_datalink | |
| 19 | ||
| 20 | 11 | struct netdev_pcap_context { |
| 21 | 12 | UINT8 *pkt; |
| 22 | 13 | int len; |
| r243192 | r243193 | |
| 70 | 61 | : netdev(ifdev, rate) |
| 71 | 62 | { |
| 72 | 63 | char errbuf[PCAP_ERRBUF_SIZE]; |
| 73 | m_p = pcap_open_live | |
| 64 | m_p = pcap_open_live(name, 65535, 1, 1, errbuf); | |
| 74 | 65 | if(!m_p) |
| 75 | 66 | { |
| 76 | 67 | osd_printf_verbose("Unable to open %s: %s\n", name, errbuf); |
| 77 | 68 | return; |
| 78 | 69 | } |
| 79 | if(pcap_set_datalink | |
| 70 | if(pcap_set_datalink(m_p, DLT_EN10MB) == -1) | |
| 80 | 71 | { |
| 81 | 72 | osd_printf_verbose("Unable to set %s to ethernet\n", name); |
| 82 | pcap_close | |
| 73 | pcap_close(m_p); | |
| 83 | 74 | m_p = NULL; |
| 84 | 75 | return; |
| 85 | 76 | } |
| r243192 | r243193 | |
| 97 | 88 | struct bpf_program fp; |
| 98 | 89 | if(!m_p) return; |
| 99 | 90 | sprintf(filter, "not ether src %.2X:%.2X:%.2X:%.2X:%.2X:%.2X and (ether dst %.2X:%.2X:%.2X:%.2X:%.2X:%.2X or ether multicast or ether broadcast or ether dst 09:00:07:ff:ff:ff)", (unsigned char)mac[0], (unsigned char)mac[1], (unsigned char)mac[2],(unsigned char)mac[3], (unsigned char)mac[4], (unsigned char)mac[5], (unsigned char)mac[0], (unsigned char)mac[1], (unsigned char)mac[2],(unsigned char)mac[3], (unsigned char)mac[4], (unsigned char)mac[5]); |
| 100 | if(pcap_compile | |
| 91 | if(pcap_compile(m_p, &fp, filter, 1, 0) == -1) { | |
| 101 | 92 | osd_printf_verbose("Error with pcap_compile\n"); |
| 102 | 93 | } |
| 103 | if(pcap_setfilter | |
| 94 | if(pcap_setfilter(m_p, &fp) == -1) { | |
| 104 | 95 | osd_printf_verbose("Error with pcap_setfilter\n"); |
| 105 | 96 | } |
| 106 | 97 | } |
| r243192 | r243193 | |
| 108 | 99 | int netdev_pcap::send(UINT8 *buf, int len) |
| 109 | 100 | { |
| 110 | 101 | if(!m_p) return 0; |
| 111 | return (!pcap_sendpacket | |
| 102 | return (!pcap_sendpacket(m_p, buf, len))?len:0; | |
| 112 | 103 | } |
| 113 | 104 | |
| 114 | 105 | int netdev_pcap::recv_dev(UINT8 **buf) |
| r243192 | r243193 | |
| 130 | 121 | |
| 131 | 122 | netdev_pcap::~netdev_pcap() |
| 132 | 123 | { |
| 133 | if(m_p) pcap_close | |
| 124 | if(m_p) pcap_close(m_p); | |
| 134 | 125 | } |
| 135 | 126 | |
| 136 | 127 | static CREATE_NETDEV(create_pcap) |
| r243192 | r243193 | |
| 143 | 134 | { |
| 144 | 135 | pcap_if_t *devs; |
| 145 | 136 | char errbuf[PCAP_ERRBUF_SIZE]; |
| 146 | if(pcap_findalldevs | |
| 137 | if(pcap_findalldevs(&devs, errbuf) == -1) | |
| 147 | 138 | { |
| 148 | 139 | osd_printf_verbose("Unable to get network devices: %s\n", errbuf); |
| 149 | 140 | return; |
| 150 | 141 | } |
| 151 | 142 | |
| 152 | #if 1 | |
| 153 | while(devs) | |
| 154 | { | |
| 155 | add_netdev(devs->name, devs->description, create_pcap); | |
| 156 | devs = devs->next; | |
| 157 | } | |
| 158 | #else | |
| 159 | 143 | if (devs) |
| 160 | 144 | { |
| 161 | 145 | while(devs->next) |
| r243192 | r243193 | |
| 164 | 148 | devs = devs->next; |
| 165 | 149 | } |
| 166 | 150 | } |
| 167 | #endif | |
| 168 | 151 | } |
| 169 | 152 | |
| 170 | 153 | void deinit_pcap() |
| r243192 | r243193 | |
|---|---|---|
| 7 | 7 | #include "clifront.h" |
| 8 | 8 | #include "modules/lib/osdobj_common.h" |
| 9 | 9 | #include "video.h" |
| 10 | #include "modules/osdmodule.h" | |
| 11 | #include "modules/font/font_module.h" | |
| 12 | 10 | |
| 13 | 11 | //============================================================ |
| 14 | 12 | // System dependent defines |
| r243192 | r243193 | |
| 30 | 28 | #define SDL13_COMBINE_RESIZE (0) |
| 31 | 29 | #endif |
| 32 | 30 | #else |
| 33 | ||
| 31 | #define SDLMAME_INIT_IN_WORKER_THREAD (0) | |
| 34 | 32 | #define SDL13_COMBINE_RESIZE (0) |
| 35 | 33 | #endif |
| 36 | 34 | |
| r243192 | r243193 | |
| 188 | 186 | // input overridables |
| 189 | 187 | virtual void customize_input_type_list(simple_list<input_type_entry> &typelist); |
| 190 | 188 | |
| 189 | // font overridables | |
| 190 | virtual osd_font *font_open(const char *name, int &height); | |
| 191 | virtual void font_close(osd_font *font); | |
| 192 | virtual bool font_get_bitmap(osd_font *font, unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs); | |
| 193 | ||
| 191 | 194 | virtual void video_register(); |
| 195 | virtual void sound_register(); | |
| 196 | virtual void debugger_register(); | |
| 192 | 197 | |
| 193 | 198 | virtual bool video_init(); |
| 194 | 199 | virtual bool window_init(); |
| r243192 | r243193 | |
| 199 | 204 | #ifdef USE_NETWORK |
| 200 | 205 | virtual bool network_init(); |
| 201 | 206 | #endif |
| 202 | ||
| 207 | //virtual bool midi_init(); | |
| 203 | 208 | |
| 204 | 209 | virtual void video_exit(); |
| 205 | 210 | virtual void window_exit(); |
| r243192 | r243193 | |
| 208 | 213 | #ifdef USE_NETWORK |
| 209 | 214 | virtual void network_exit(); |
| 210 | 215 | #endif |
| 211 | ||
| 216 | //virtual void midi_exit(); | |
| 212 | 217 | |
| 213 | ||
| 218 | sdl_options &options() { return m_options; } | |
| 214 | 219 | |
| 215 | 220 | private: |
| 216 | 221 | virtual void osd_exit(); |
| r243192 | r243193 | |
| 220 | 225 | // FIXME: remove machine usage |
| 221 | 226 | void extract_video_config(running_machine &machine); |
| 222 | 227 | |
| 223 | sdl_options &m_options; | |
| 224 | 228 | |
| 229 | sdl_options &m_options; | |
| 230 | ||
| 225 | 231 | watchdog *m_watchdog; |
| 226 | 232 | |
| 227 | 233 | }; |
| r243192 | r243193 | |
|---|---|---|
| 210 | 210 | BASE_TARGETOS = unix |
| 211 | 211 | SYNC_IMPLEMENTATION = tc |
| 212 | 212 | SDL_NETWORK = taptun |
| 213 | #SDL_NETWORK = pcap | |
| 214 | 213 | |
| 215 | 214 | ifndef NO_USE_MIDI |
| 216 | 215 | INCPATH += `pkg-config --cflags alsa` |
| r243192 | r243193 | |
| 246 | 245 | |
| 247 | 246 | ifeq ($(TARGETOS),solaris) |
| 248 | 247 | BASE_TARGETOS = unix |
| 249 | #DEFS += -DNO_AFFINITY_NP -UHAVE_VSNPRINTF -DNO_vsnprintf | |
| 250 | DEFS += -DNO_AFFINITY_NP | |
| 248 | DEFS += -DNO_AFFINITY_NP -UHAVE_VSNPRINTF -DNO_vsnprintf | |
| 251 | 249 | SYNC_IMPLEMENTATION = tc |
| 252 | 250 | NO_USE_MIDI = 1 |
| 253 | NO_USE_QTDEBUG = 1 | |
| 254 | 251 | endif |
| 255 | 252 | |
| 256 | 253 | ifeq ($(TARGETOS),haiku) |
| r243192 | r243193 | |
| 401 | 398 | $(OSDOBJ)/modules/sync \ |
| 402 | 399 | $(OSDOBJ)/modules/lib \ |
| 403 | 400 | $(OSDOBJ)/modules/midi \ |
| 404 | $(OSDOBJ)/modules/font \ | |
| 405 | 401 | |
| 406 | 402 | #------------------------------------------------- |
| 407 | 403 | # OSD core library |
| r243192 | r243193 | |
| 413 | 409 | $(SDLOBJ)/sdlfile.o \ |
| 414 | 410 | $(SDLOBJ)/sdlptty_$(BASE_TARGETOS).o \ |
| 415 | 411 | $(SDLOBJ)/sdlsocket.o \ |
| 412 | $(SDLOBJ)/sdlmisc_$(BASE_TARGETOS).o \ | |
| 416 | 413 | $(SDLOBJ)/sdlos_$(SDLOS_TARGETOS).o \ |
| 417 | 414 | $(OSDOBJ)/modules/lib/osdlib_$(SDLOS_TARGETOS).o \ |
| 418 | $(OSDOBJ)/modules/sync/sync_$(SYNC_IMPLEMENTATION).o \ | |
| 419 | $(OSDOBJ)/modules/osdmodule.o \ | |
| 415 | $(OSDOBJ)/modules/sync/sync_$(SYNC_IMPLEMENTATION).o | |
| 420 | 416 | |
| 421 | 417 | ifdef NOASM |
| 422 | 418 | OSDCOREOBJS += $(OSDOBJ)/modules/sync/work_mini.o |
| r243192 | r243193 | |
| 430 | 426 | $(SDLMAIN) \ |
| 431 | 427 | $(SDLOBJ)/sdlmain.o \ |
| 432 | 428 | $(SDLOBJ)/input.o \ |
| 433 | $(OSDOBJ)/modules/sound/js_sound.o \ | |
| 434 | $(OSDOBJ)/modules/sound/direct_sound.o \ | |
| 435 | 429 | $(OSDOBJ)/modules/sound/sdl_sound.o \ |
| 436 | $(OSDOBJ)/modules/sound/none.o \ | |
| 437 | 430 | $(SDLOBJ)/video.o \ |
| 438 | 431 | $(SDLOBJ)/drawsdl.o \ |
| 439 | 432 | $(SDLOBJ)/window.o \ |
| 440 | 433 | $(SDLOBJ)/output.o \ |
| 441 | 434 | $(SDLOBJ)/watchdog.o \ |
| 442 | 435 | $(OSDOBJ)/modules/lib/osdobj_common.o \ |
| 443 | $(OSDOBJ)/modules/font/font_sdl.o \ | |
| 444 | $(OSDOBJ)/modules/font/font_windows.o \ | |
| 445 | $(OSDOBJ)/modules/font/font_osx.o \ | |
| 446 | $(OSDOBJ)/modules/font/font_none.o \ | |
| 447 | 436 | |
| 448 | 437 | ifdef NO_USE_MIDI |
| 449 | 438 | OSDOBJS += $(OSDOBJ)/modules/midi/none.o |
| r243192 | r243193 | |
| 608 | 597 | LIBS += -lSDL_ttf |
| 609 | 598 | endif |
| 610 | 599 | |
| 611 | # FIXME: should be dealt with elsewhere | |
| 612 | 600 | # libs that Haiku doesn't want but are mandatory on *IX |
| 613 | 601 | ifneq ($(TARGETOS),haiku) |
| 614 | BASELIBS += -lm -lpthread | |
| 615 | LIBS += -lm -lpthread | |
| 616 | ifneq ($(TARGETOS),solaris) | |
| 617 | BASELIBS += -lutil | |
| 618 | LIBS += -lutil | |
| 619 | else | |
| 620 | SUPPORTSM32M64 = 1 | |
| 621 | BASELIBS += -lsocket -lnsl | |
| 622 | LIBS += -lsocket -lnsl | |
| 602 | BASELIBS += -lm -lutil -lpthread | |
| 603 | LIBS += -lm -lutil -lpthread | |
| 623 | 604 | endif |
| 624 | endif | |
| 625 | 605 | |
| 626 | ||
| 627 | 606 | endif # not Mac OS X |
| 628 | 607 | |
| 629 | 608 | ifneq (,$(findstring ppc,$(UNAME))) |
| r243192 | r243193 | |
| 718 | 697 | $(MOC) $(MOCINCPATH) $(DEFS) $< -o $@ |
| 719 | 698 | |
| 720 | 699 | DEBUGOBJS = \ |
| 700 | $(OSDOBJ)/modules/debugger/debugqt.o \ | |
| 721 | 701 | $(OSDOBJ)/modules/debugger/qt/debugqtview.o \ |
| 722 | 702 | $(OSDOBJ)/modules/debugger/qt/debugqtwindow.o \ |
| 723 | 703 | $(OSDOBJ)/modules/debugger/qt/debugqtlogwindow.o \ |
| r243192 | r243193 | |
| 736 | 716 | $(OSDOBJ)/modules/debugger/qt/debugqtbreakpointswindow.moc.o \ |
| 737 | 717 | $(OSDOBJ)/modules/debugger/qt/debugqtdeviceswindow.moc.o \ |
| 738 | 718 | $(OSDOBJ)/modules/debugger/qt/debugqtdeviceinformationwindow.moc.o |
| 739 | ||
| 740 | DEFS += -DUSE_QTDEBUG=1 | |
| 741 | ||
| 742 | else | |
| 743 | DEFS += -DUSE_QTDEBUG=0 | |
| 744 | 719 | endif |
| 745 | 720 | |
| 746 | 721 | ifeq ($(NO_DEBUGGER),1) |
| r243192 | r243193 | |
| 749 | 724 | OSDOBJS += $(DEBUGOBJS) |
| 750 | 725 | endif # NO_DEBUGGER |
| 751 | 726 | |
| 752 | # Always add these | |
| 753 | OSDOBJS += \ | |
| 754 | $(OSDOBJ)/modules/debugger/none.o \ | |
| 755 | $(OSDOBJ)/modules/debugger/debugint.o \ | |
| 756 | $(OSDOBJ)/modules/debugger/debugwin.o \ | |
| 757 | $(OSDOBJ)/modules/debugger/debugqt.o \ | |
| 758 | ||
| 759 | ||
| 760 | 727 | #------------------------------------------------- |
| 761 | 728 | # OPENGL |
| 762 | 729 | #------------------------------------------------- |
| r243192 | r243193 | |
|---|---|---|
| 152 | 152 | |
| 153 | 153 | if (tmpstr[0] == '$') |
| 154 | 154 | { |
| 155 | char *envval; | |
| 155 | 156 | envstr = (char *) osd_malloc_array(strlen(tmpstr)+1); |
| 156 | 157 | |
| 157 | 158 | strcpy(envstr, tmpstr); |
| r243192 | r243193 | |
| 164 | 165 | |
| 165 | 166 | envstr[i] = '\0'; |
| 166 | 167 | |
| 167 | | |
| 168 | envval = osd_getenv(&envstr[1]); | |
| 168 | 169 | if (envval != NULL) |
| 169 | 170 | { |
| 170 | 171 | j = strlen(envval) + strlen(tmpstr) + 1; |
| r243192 | r243193 | |
|---|---|---|
| 176 | 176 | // does path start with an environment variable? |
| 177 | 177 | if (tmpstr[0] == '$') |
| 178 | 178 | { |
| 179 | char *envval; | |
| 179 | 180 | envstr = (char *) osd_malloc_array(strlen(tmpstr)+1); |
| 180 | 181 | |
| 181 | 182 | strcpy(envstr, tmpstr); |
| r243192 | r243193 | |
| 188 | 189 | |
| 189 | 190 | envstr[i] = '\0'; |
| 190 | 191 | |
| 191 | | |
| 192 | envval = osd_getenv(&envstr[1]); | |
| 192 | 193 | if (envval != NULL) |
| 193 | 194 | { |
| 194 | 195 | j = strlen(envval) + strlen(tmpstr) + 1; |
| r243192 | r243193 | |
| 505 | 506 | |
| 506 | 507 | osd_directory_entry *osd_stat(const char *path) |
| 507 | 508 | { |
| 508 | int err; | |
| 509 | osd_directory_entry *result = NULL; | |
| 510 | #if defined(SDLMAME_NO64BITIO) || defined(SDLMAME_BSD) || defined(SDLMAME_DARWIN) | |
| 511 | struct stat st; | |
| 512 | #else | |
| 513 | struct stat64 st; | |
| 514 | #endif | |
| 509 | int err; | |
| 510 | osd_directory_entry *result = NULL; | |
| 511 | #if defined(SDLMAME_NO64BITIO) || defined(SDLMAME_BSD) || defined(SDLMAME_DARWIN) | |
| 512 | struct stat st; | |
| 513 | #else | |
| 514 | struct stat64 st; | |
| 515 | #endif | |
| 515 | 516 | |
| 516 | #if defined(SDLMAME_NO64BITIO) || defined(SDLMAME_BSD) || defined(SDLMAME_DARWIN) | |
| 517 | err = stat(path, &st); | |
| 518 | #else | |
| 519 | err = stat64(path, &st); | |
| 520 | #endif | |
| 517 | #if defined(SDLMAME_NO64BITIO) || defined(SDLMAME_BSD) || defined(SDLMAME_DARWIN) | |
| 518 | err = stat(path, &st); | |
| 519 | #else | |
| 520 | err = stat64(path, &st); | |
| 521 | #endif | |
| 521 | 522 | |
| 522 | ||
| 523 | if( err == -1) return NULL; | |
| 523 | 524 | |
| 524 | // create an osd_directory_entry; be sure to make sure that the caller can | |
| 525 | // free all resources by just freeing the resulting osd_directory_entry | |
| 526 | result = (osd_directory_entry *) osd_malloc_array(sizeof(*result) + strlen(path) + 1); | |
| 527 | strcpy(((char *) result) + sizeof(*result), path); | |
| 528 | result->name = ((char *) result) + sizeof(*result); | |
| 529 | result->type = S_ISDIR(st.st_mode) ? ENTTYPE_DIR : ENTTYPE_FILE; | |
| 530 | result->size = (UINT64)st.st_size; | |
| 525 | // create an osd_directory_entry; be sure to make sure that the caller can | |
| 526 | // free all resources by just freeing the resulting osd_directory_entry | |
| 527 | result = (osd_directory_entry *) osd_malloc_array(sizeof(*result) + strlen(path) + 1); | |
| 528 | strcpy(((char *) result) + sizeof(*result), path); | |
| 529 | result->name = ((char *) result) + sizeof(*result); | |
| 530 | result->type = S_ISDIR(st.st_mode) ? ENTTYPE_DIR : ENTTYPE_FILE; | |
| 531 | result->size = (UINT64)st.st_size; | |
| 531 | 532 | |
| 532 | ||
| 533 | return result; | |
| 533 | 534 | } |
| 534 | 535 | |
| 535 | 536 | //============================================================ |
| r243192 | r243193 | |
| 538 | 539 | |
| 539 | 540 | file_error osd_get_full_path(char **dst, const char *path) |
| 540 | 541 | { |
| 541 | file_error err; | |
| 542 | char path_buffer[512]; | |
| 542 | file_error err; | |
| 543 | char path_buffer[512]; | |
| 543 | 544 | |
| 544 | ||
| 545 | err = FILERR_NONE; | |
| 545 | 546 | |
| 546 | if (getcwd(path_buffer, 511) == NULL) | |
| 547 | { | |
| 548 | printf("osd_get_full_path: failed!\n"); | |
| 549 | err = FILERR_FAILURE; | |
| 550 | } | |
| 551 | else | |
| 552 | { | |
| 553 | *dst = (char *)osd_malloc_array(strlen(path_buffer)+strlen(path)+3); | |
| 547 | if (getcwd(path_buffer, 511) == NULL) | |
| 548 | { | |
| 549 | printf("osd_get_full_path: failed!\n"); | |
| 550 | err = FILERR_FAILURE; | |
| 551 | } | |
| 552 | else | |
| 553 | { | |
| 554 | *dst = (char *)osd_malloc_array(strlen(path_buffer)+strlen(path)+3); | |
| 554 | 555 | |
| 555 | // if it's already a full path, just pass it through | |
| 556 | if (path[0] == '/') | |
| 557 | { | |
| 558 | strcpy(*dst, path); | |
| 559 | } | |
| 560 | else | |
| 561 | { | |
| 562 | sprintf(*dst, "%s%s%s", path_buffer, PATH_SEPARATOR, path); | |
| 563 | } | |
| 564 | } | |
| 556 | // if it's already a full path, just pass it through | |
| 557 | if (path[0] == '/') | |
| 558 | { | |
| 559 | strcpy(*dst, path); | |
| 560 | } | |
| 561 | else | |
| 562 | { | |
| 563 | sprintf(*dst, "%s%s%s", path_buffer, PATH_SEPARATOR, path); | |
| 564 | } | |
| 565 | } | |
| 565 | 566 | |
| 566 | ||
| 567 | return err; | |
| 567 | 568 | } |
| 568 | 569 | |
| 569 | 570 | //============================================================ |
| r243192 | r243193 | |
| 572 | 573 | |
| 573 | 574 | const char *osd_get_volume_name(int idx) |
| 574 | 575 | { |
| 575 | if (idx!=0) return NULL; | |
| 576 | return "/"; | |
| 576 | if (idx!=0) return NULL; | |
| 577 | return "/"; | |
| 577 | 578 | } |
| 578 | 579 | |
| 579 | 580 | #endif |
| r243192 | r243193 | |
|---|---|---|
| 12 | 12 | |
| 13 | 13 | #ifdef SDLMAME_UNIX |
| 14 | 14 | #if (!defined(SDLMAME_MACOSX)) && (!defined(SDLMAME_EMSCRIPTEN)) |
| 15 | #if (SDLMAME_SDL2) | |
| 16 | #include <SDL2/SDL_ttf.h> | |
| 17 | #else | |
| 18 | #include <SDL/SDL_ttf.h> | |
| 19 | #endif | |
| 15 | 20 | #ifndef SDLMAME_HAIKU |
| 16 | 21 | #include <fontconfig/fontconfig.h> |
| 17 | 22 | #endif |
| r243192 | r243193 | |
| 26 | 31 | #include <unistd.h> |
| 27 | 32 | #endif |
| 28 | 33 | |
| 29 | // only for strconv.h | |
| 30 | #if defined(SDLMAME_WIN32) | |
| 31 | #define WIN32_LEAN_AND_MEAN | |
| 32 | #include <windows.h> | |
| 33 | #endif | |
| 34 | ||
| 35 | ||
| 36 | 34 | #ifdef SDLMAME_OS2 |
| 37 | 35 | #define INCL_DOS |
| 38 | 36 | #include <os2.h> |
| r243192 | r243193 | |
| 49 | 47 | #include "emu.h" |
| 50 | 48 | #include "clifront.h" |
| 51 | 49 | #include "emuopts.h" |
| 52 | #include "strconv.h" | |
| 53 | 50 | |
| 54 | 51 | // OSD headers |
| 55 | 52 | #include "video.h" |
| 56 | 53 | #include "input.h" |
| 57 | 54 | #include "osdsdl.h" |
| 58 | 55 | #include "modules/lib/osdlib.h" |
| 59 | ||
| 56 | #include "modules/sound/sdl_sound.h" | |
| 57 | #if defined(SDLMAME_EMSCRIPTEN) | |
| 58 | #include "modules/sound/js_sound.h" | |
| 59 | #endif | |
| 60 | #if defined(SDLMAME_WIN32) | |
| 61 | #include "modules/sound/direct_sound.h" | |
| 62 | #endif | |
| 63 | #if !defined(NO_DEBUGGER) | |
| 64 | #include "modules/debugger/debugqt.h" | |
| 65 | #endif | |
| 66 | #include "modules/debugger/none.h" | |
| 67 | #if defined(SDLMAME_MACOSX) | |
| 68 | #include "modules/debugger/debugosx.h" | |
| 69 | #endif | |
| 60 | 70 | // we override SDL's normal startup on Win32 |
| 61 | 71 | // please see sdlprefix.h as well |
| 62 | 72 | |
| r243192 | r243193 | |
| 67 | 77 | |
| 68 | 78 | #include "watchdog.h" |
| 69 | 79 | |
| 80 | #define DEFAULT_FONT_HEIGHT (200) | |
| 81 | ||
| 70 | 82 | //============================================================ |
| 71 | 83 | // OPTIONS |
| 72 | 84 | //============================================================ |
| r243192 | r243193 | |
| 251 | 263 | set_default_value(SDLOPTION_INIPATH, ini_path.cstr()); |
| 252 | 264 | } |
| 253 | 265 | |
| 266 | ||
| 254 | 267 | //============================================================ |
| 255 | 268 | // main |
| 256 | 269 | //============================================================ |
| r243192 | r243193 | |
| 282 | 295 | setvbuf(stdout, (char *) NULL, _IONBF, 0); |
| 283 | 296 | setvbuf(stderr, (char *) NULL, _IONBF, 0); |
| 284 | 297 | |
| 285 | // FIXME: this should be done differently | |
| 286 | ||
| 287 | 298 | #ifdef SDLMAME_UNIX |
| 288 | 299 | sdl_entered_debugger = 0; |
| 289 | 300 | #if (!defined(SDLMAME_MACOSX)) && (!defined(SDLMAME_HAIKU)) && (!defined(SDLMAME_EMSCRIPTEN)) |
| 301 | if (TTF_Init() == -1) | |
| 302 | { | |
| 303 | printf("SDL_ttf failed: %s\n", TTF_GetError()); | |
| 304 | } | |
| 290 | 305 | FcInit(); |
| 291 | 306 | #endif |
| 292 | 307 | #endif |
| r243192 | r243193 | |
| 319 | 334 | #endif |
| 320 | 335 | |
| 321 | 336 | { |
| 322 | | |
| 337 | sdl_options options; | |
| 323 | 338 | sdl_osd_interface osd(options); |
| 324 | 339 | osd.register_options(); |
| 325 | 340 | cli_frontend frontend(options, osd); |
| r243192 | r243193 | |
| 333 | 348 | } |
| 334 | 349 | #endif |
| 335 | 350 | |
| 351 | // already called... | |
| 352 | //SDL_Quit(); | |
| 353 | ||
| 336 | 354 | #ifdef SDLMAME_UNIX |
| 337 | 355 | #if (!defined(SDLMAME_MACOSX)) && (!defined(SDLMAME_HAIKU)) && (!defined(SDLMAME_EMSCRIPTEN)) |
| 356 | TTF_Quit(); | |
| 338 | 357 | if (!sdl_entered_debugger) |
| 339 | 358 | { |
| 340 | 359 | FcFini(); |
| r243192 | r243193 | |
| 524 | 543 | } |
| 525 | 544 | |
| 526 | 545 | //============================================================ |
| 546 | // sound_register | |
| 547 | //============================================================ | |
| 548 | ||
| 549 | void sdl_osd_interface::sound_register() | |
| 550 | { | |
| 551 | sound_options_add("sdl", OSD_SOUND_SDL); | |
| 552 | #if defined(SDLMAME_WIN32) | |
| 553 | sound_options_add("dsound", OSD_SOUND_DIRECT_SOUND); | |
| 554 | #endif | |
| 555 | ||
| 556 | #if defined(SDLMAME_EMSCRIPTEN) | |
| 557 | sound_options_add("js", OSD_SOUND_JS); | |
| 558 | sound_options_add("auto", OSD_SOUND_JS); // making JS audio default one | |
| 559 | #else | |
| 560 | sound_options_add("auto", OSD_SOUND_SDL); // making SDL audio default one | |
| 561 | #endif | |
| 562 | } | |
| 563 | ||
| 564 | //============================================================ | |
| 565 | // debugger_register | |
| 566 | //============================================================ | |
| 567 | ||
| 568 | void sdl_osd_interface::debugger_register() | |
| 569 | { | |
| 570 | #if defined(NO_DEBUGGER) | |
| 571 | debugger_options_add("auto", OSD_DEBUGGER_NONE); | |
| 572 | #else | |
| 573 | #if defined(SDLMAME_MACOSX) | |
| 574 | debugger_options_add("osx", OSD_DEBUGGER_OSX); | |
| 575 | debugger_options_add("auto", OSD_DEBUGGER_OSX); // making OSX debugger default one | |
| 576 | #else | |
| 577 | debugger_options_add("qt", OSD_DEBUGGER_QT); | |
| 578 | debugger_options_add("auto", OSD_DEBUGGER_QT); // making QT debugger default one | |
| 579 | #endif // SDLMAME_MACOSX | |
| 580 | #endif // NO_DEBUGGER | |
| 581 | } | |
| 582 | ||
| 583 | //============================================================ | |
| 527 | 584 | // init |
| 528 | 585 | //============================================================ |
| 529 | 586 | |
| 530 | ||
| 531 | 587 | void sdl_osd_interface::init(running_machine &machine) |
| 532 | 588 | { |
| 533 | 589 | // call our parent |
| r243192 | r243193 | |
| 648 | 704 | #endif |
| 649 | 705 | } |
| 650 | 706 | |
| 707 | #if defined(SDLMAME_UNIX) && (!defined(SDLMAME_EMSCRIPTEN)) | |
| 708 | #define POINT_SIZE 144.0 | |
| 709 | ||
| 710 | #ifdef SDLMAME_MACOSX | |
| 711 | ||
| 712 | #define EXTRA_HEIGHT 1.0 | |
| 713 | #define EXTRA_WIDTH 1.15 | |
| 714 | ||
| 715 | //------------------------------------------------- | |
| 716 | // font_open - attempt to "open" a handle to the | |
| 717 | // font with the given name | |
| 718 | //------------------------------------------------- | |
| 719 | ||
| 720 | class osd_font | |
| 721 | { | |
| 722 | public: | |
| 723 | CTFontRef m_font; | |
| 724 | }; | |
| 725 | ||
| 726 | osd_font *sdl_osd_interface::font_open(const char *_name, int &height) | |
| 727 | { | |
| 728 | CFStringRef font_name = NULL; | |
| 729 | CTFontRef ct_font = NULL; | |
| 730 | CTFontDescriptorRef font_descriptor; | |
| 731 | CGAffineTransform affine_transform = CGAffineTransformIdentity; | |
| 732 | ||
| 733 | astring name(_name); | |
| 734 | ||
| 735 | if (name == "default") | |
| 736 | { | |
| 737 | name = "LucidaGrande"; | |
| 738 | } | |
| 739 | ||
| 740 | /* handle bdf fonts in the core */ | |
| 741 | if (name.len() > 4) | |
| 742 | if (name.makeupper().substr(name.len()-4,4) == ".BDF" ) | |
| 743 | return NULL; | |
| 744 | ||
| 745 | font_name = CFStringCreateWithCString( NULL, name.cstr(), kCFStringEncodingUTF8 ); | |
| 746 | ||
| 747 | if( font_name != NULL ) | |
| 748 | { | |
| 749 | font_descriptor = CTFontDescriptorCreateWithNameAndSize( font_name, POINT_SIZE ); | |
| 750 | ||
| 751 | if( font_descriptor != NULL ) | |
| 752 | { | |
| 753 | ct_font = CTFontCreateWithFontDescriptor( font_descriptor, POINT_SIZE, &affine_transform ); | |
| 754 | ||
| 755 | CFRelease( font_descriptor ); | |
| 756 | } | |
| 757 | } | |
| 758 | ||
| 759 | CFRelease( font_name ); | |
| 760 | ||
| 761 | if (!ct_font) | |
| 762 | { | |
| 763 | osd_printf_verbose("Couldn't find/open font %s, using MAME default\n", name.cstr()); | |
| 764 | return NULL; | |
| 765 | } | |
| 766 | ||
| 767 | CFStringRef real_name = CTFontCopyPostScriptName( ct_font ); | |
| 768 | char real_name_c_string[255]; | |
| 769 | CFStringGetCString ( real_name, real_name_c_string, 255, kCFStringEncodingUTF8 ); | |
| 770 | osd_printf_verbose("Matching font: %s\n", real_name_c_string); | |
| 771 | CFRelease( real_name ); | |
| 772 | ||
| 773 | CGFloat line_height = 0.0; | |
| 774 | line_height += CTFontGetAscent(ct_font); | |
| 775 | line_height += CTFontGetDescent(ct_font); | |
| 776 | line_height += CTFontGetLeading(ct_font); | |
| 777 | height = ceilf(line_height * EXTRA_HEIGHT); | |
| 778 | ||
| 779 | osd_font *ret = global_alloc(osd_font); | |
| 780 | ret->m_font = ct_font; | |
| 781 | return ret; | |
| 782 | } | |
| 783 | ||
| 784 | //------------------------------------------------- | |
| 785 | // font_close - release resources associated with | |
| 786 | // a given OSD font | |
| 787 | //------------------------------------------------- | |
| 788 | ||
| 789 | void sdl_osd_interface::font_close(osd_font *font) | |
| 790 | { | |
| 791 | CTFontRef ct_font = font->m_font; | |
| 792 | ||
| 793 | if( ct_font != NULL ) | |
| 794 | { | |
| 795 | CFRelease( ct_font ); | |
| 796 | } | |
| 797 | global_free(font); | |
| 798 | } | |
| 799 | ||
| 800 | //------------------------------------------------- | |
| 801 | // font_get_bitmap - allocate and populate a | |
| 802 | // BITMAP_FORMAT_ARGB32 bitmap containing the | |
| 803 | // pixel values rgb_t(0xff,0xff,0xff,0xff) | |
| 804 | // or rgb_t(0x00,0xff,0xff,0xff) for each | |
| 805 | // pixel of a black & white font | |
| 806 | //------------------------------------------------- | |
| 807 | ||
| 808 | bool sdl_osd_interface::font_get_bitmap(osd_font *font, unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs) | |
| 809 | { | |
| 810 | UniChar uni_char; | |
| 811 | CGGlyph glyph; | |
| 812 | CTFontRef ct_font = font->m_font; | |
| 813 | const CFIndex count = 1; | |
| 814 | CGRect bounding_rect, success_rect; | |
| 815 | CGContextRef context_ref; | |
| 816 | ||
| 817 | if( chnum == ' ' ) | |
| 818 | { | |
| 819 | uni_char = 'n'; | |
| 820 | CTFontGetGlyphsForCharacters( ct_font, &uni_char, &glyph, count ); | |
| 821 | success_rect = CTFontGetBoundingRectsForGlyphs( ct_font, kCTFontDefaultOrientation, &glyph, &bounding_rect, count ); | |
| 822 | uni_char = chnum; | |
| 823 | CTFontGetGlyphsForCharacters( ct_font, &uni_char, &glyph, count ); | |
| 824 | } | |
| 825 | else | |
| 826 | { | |
| 827 | uni_char = chnum; | |
| 828 | CTFontGetGlyphsForCharacters( ct_font, &uni_char, &glyph, count ); | |
| 829 | success_rect = CTFontGetBoundingRectsForGlyphs( ct_font, kCTFontDefaultOrientation, &glyph, &bounding_rect, count ); | |
| 830 | } | |
| 831 | ||
| 832 | if( CGRectEqualToRect( success_rect, CGRectNull ) == false ) | |
| 833 | { | |
| 834 | size_t bitmap_width; | |
| 835 | size_t bitmap_height; | |
| 836 | ||
| 837 | bitmap_width = ceilf(bounding_rect.size.width * EXTRA_WIDTH); | |
| 838 | bitmap_width = bitmap_width == 0 ? 1 : bitmap_width; | |
| 839 | ||
| 840 | bitmap_height = ceilf( (CTFontGetAscent(ct_font) + CTFontGetDescent(ct_font) + CTFontGetLeading(ct_font)) * EXTRA_HEIGHT); | |
| 841 | ||
| 842 | xoffs = yoffs = 0; | |
| 843 | width = bitmap_width; | |
| 844 | ||
| 845 | size_t bits_per_component; | |
| 846 | CGColorSpaceRef color_space; | |
| 847 | CGBitmapInfo bitmap_info = kCGBitmapByteOrder32Host | kCGImageAlphaPremultipliedFirst; | |
| 848 | ||
| 849 | color_space = CGColorSpaceCreateDeviceRGB(); | |
| 850 | bits_per_component = 8; | |
| 851 | ||
| 852 | bitmap.allocate(bitmap_width, bitmap_height); | |
| 853 | ||
| 854 | context_ref = CGBitmapContextCreate( bitmap.raw_pixptr(0), bitmap_width, bitmap_height, bits_per_component, bitmap.rowpixels()*4, color_space, bitmap_info ); | |
| 855 | ||
| 856 | if( context_ref != NULL ) | |
| 857 | { | |
| 858 | CGFontRef font_ref; | |
| 859 | font_ref = CTFontCopyGraphicsFont( ct_font, NULL ); | |
| 860 | CGContextSetTextPosition(context_ref, -bounding_rect.origin.x*EXTRA_WIDTH, CTFontGetDescent(ct_font)+CTFontGetLeading(ct_font) ); | |
| 861 | CGContextSetRGBFillColor(context_ref, 1.0, 1.0, 1.0, 1.0); | |
| 862 | CGContextSetFont( context_ref, font_ref ); | |
| 863 | CGContextSetFontSize( context_ref, POINT_SIZE ); | |
| 864 | CGContextShowGlyphs( context_ref, &glyph, count ); | |
| 865 | CGFontRelease( font_ref ); | |
| 866 | CGContextRelease( context_ref ); | |
| 867 | } | |
| 868 | ||
| 869 | CGColorSpaceRelease( color_space ); | |
| 870 | } | |
| 871 | ||
| 872 | return bitmap.valid(); | |
| 873 | } | |
| 874 | #else // UNIX but not OSX | |
| 875 | ||
| 876 | static TTF_Font * TTF_OpenFont_Magic(astring name, int fsize) | |
| 877 | { | |
| 878 | emu_file file(OPEN_FLAG_READ); | |
| 879 | if (file.open(name) == FILERR_NONE) | |
| 880 | { | |
| 881 | unsigned char buffer[5] = { 0xff, 0xff, 0xff, 0xff, 0xff }; | |
| 882 | unsigned char magic[5] = { 0x00, 0x01, 0x00, 0x00, 0x00 }; | |
| 883 | file.read(buffer,5); | |
| 884 | if (memcmp(buffer, magic, 5)) | |
| 885 | return NULL; | |
| 886 | } | |
| 887 | return TTF_OpenFont(name.cstr(), POINT_SIZE); | |
| 888 | } | |
| 889 | ||
| 890 | static bool BDF_Check_Magic(astring name) | |
| 891 | { | |
| 892 | emu_file file(OPEN_FLAG_READ); | |
| 893 | if (file.open(name) == FILERR_NONE) | |
| 894 | { | |
| 895 | unsigned char buffer[9]; | |
| 896 | unsigned char magic[9] = { 'S', 'T', 'A', 'R', 'T', 'F', 'O', 'N', 'T' }; | |
| 897 | file.read(buffer, 9); | |
| 898 | file.close(); | |
| 899 | if (!memcmp(buffer, magic, 9)) | |
| 900 | return true; | |
| 901 | } | |
| 902 | ||
| 903 | return false; | |
| 904 | } | |
| 905 | ||
| 906 | #ifndef SDLMAME_HAIKU | |
| 907 | static TTF_Font *search_font_config(astring name, bool bold, bool italic, bool underline, bool &bakedstyles) | |
| 908 | { | |
| 909 | TTF_Font *font = (TTF_Font *)NULL; | |
| 910 | FcConfig *config; | |
| 911 | FcPattern *pat; | |
| 912 | FcObjectSet *os; | |
| 913 | FcFontSet *fontset; | |
| 914 | FcValue val; | |
| 915 | ||
| 916 | config = FcConfigGetCurrent(); | |
| 917 | pat = FcPatternCreate(); | |
| 918 | os = FcObjectSetCreate(); | |
| 919 | FcPatternAddString(pat, FC_FAMILY, (const FcChar8 *)name.cstr()); | |
| 920 | ||
| 921 | // try and get a font with the requested styles baked-in | |
| 922 | if (bold) | |
| 923 | { | |
| 924 | if (italic) | |
| 925 | { | |
| 926 | FcPatternAddString(pat, FC_STYLE, (const FcChar8 *)"Bold Italic"); | |
| 927 | } | |
| 928 | else | |
| 929 | { | |
| 930 | FcPatternAddString(pat, FC_STYLE, (const FcChar8 *)"Bold"); | |
| 931 | } | |
| 932 | } | |
| 933 | else if (italic) | |
| 934 | { | |
| 935 | FcPatternAddString(pat, FC_STYLE, (const FcChar8 *)"Italic"); | |
| 936 | } | |
| 937 | else | |
| 938 | { | |
| 939 | FcPatternAddString(pat, FC_STYLE, (const FcChar8 *)"Regular"); | |
| 940 | } | |
| 941 | ||
| 942 | FcPatternAddString(pat, FC_FONTFORMAT, (const FcChar8 *)"TrueType"); | |
| 943 | ||
| 944 | FcObjectSetAdd(os, FC_FILE); | |
| 945 | fontset = FcFontList(config, pat, os); | |
| 946 | ||
| 947 | for (int i = 0; i < fontset->nfont; i++) | |
| 948 | { | |
| 949 | if (FcPatternGet(fontset->fonts[i], FC_FILE, 0, &val) != FcResultMatch) | |
| 950 | { | |
| 951 | continue; | |
| 952 | } | |
| 953 | ||
| 954 | if (val.type != FcTypeString) | |
| 955 | { | |
| 956 | continue; | |
| 957 | } | |
| 958 | ||
| 959 | osd_printf_verbose("Matching font: %s\n", val.u.s); | |
| 960 | { | |
| 961 | astring match_name((const char*)val.u.s); | |
| 962 | font = TTF_OpenFont_Magic(match_name, POINT_SIZE); | |
| 963 | } | |
| 964 | ||
| 965 | if (font) | |
| 966 | { | |
| 967 | bakedstyles = true; | |
| 968 | break; | |
| 969 | } | |
| 970 | } | |
| 971 | ||
| 972 | // didn't get a font above? try again with no baked-in styles | |
| 973 | if (!font) | |
| 974 | { | |
| 975 | FcPatternDestroy(pat); | |
| 976 | FcFontSetDestroy(fontset); | |
| 977 | ||
| 978 | pat = FcPatternCreate(); | |
| 979 | FcPatternAddString(pat, FC_FAMILY, (const FcChar8 *)name.cstr()); | |
| 980 | FcPatternAddString(pat, FC_STYLE, (const FcChar8 *)"Regular"); | |
| 981 | FcPatternAddString(pat, FC_FONTFORMAT, (const FcChar8 *)"TrueType"); | |
| 982 | fontset = FcFontList(config, pat, os); | |
| 983 | ||
| 984 | for (int i = 0; i < fontset->nfont; i++) | |
| 985 | { | |
| 986 | if (FcPatternGet(fontset->fonts[i], FC_FILE, 0, &val) != FcResultMatch) | |
| 987 | { | |
| 988 | continue; | |
| 989 | } | |
| 990 | ||
| 991 | if (val.type != FcTypeString) | |
| 992 | { | |
| 993 | continue; | |
| 994 | } | |
| 995 | ||
| 996 | osd_printf_verbose("Matching unstyled font: %s\n", val.u.s); | |
| 997 | { | |
| 998 | astring match_name((const char*)val.u.s); | |
| 999 | font = TTF_OpenFont_Magic(match_name, POINT_SIZE); | |
| 1000 | } | |
| 1001 | ||
| 1002 | if (font) | |
| 1003 | { | |
| 1004 | break; | |
| 1005 | } | |
| 1006 | } | |
| 1007 | } | |
| 1008 | ||
| 1009 | FcPatternDestroy(pat); | |
| 1010 | FcObjectSetDestroy(os); | |
| 1011 | FcFontSetDestroy(fontset); | |
| 1012 | return font; | |
| 1013 | } | |
| 1014 | #endif | |
| 1015 | ||
| 1016 | //------------------------------------------------- | |
| 1017 | // font_open - attempt to "open" a handle to the | |
| 1018 | // font with the given name | |
| 1019 | //------------------------------------------------- | |
| 1020 | ||
| 1021 | class osd_font | |
| 1022 | { | |
| 1023 | public: | |
| 1024 | TTF_Font *m_font; | |
| 1025 | }; | |
| 1026 | ||
| 1027 | osd_font *sdl_osd_interface::font_open(const char *_name, int &height) | |
| 1028 | { | |
| 1029 | TTF_Font *font = (TTF_Font *)NULL; | |
| 1030 | bool bakedstyles = false; | |
| 1031 | int style = 0; | |
| 1032 | ||
| 1033 | // accept qualifiers from the name | |
| 1034 | astring name(_name); | |
| 1035 | ||
| 1036 | if (name == "default") | |
| 1037 | { | |
| 1038 | name = "Liberation Sans"; | |
| 1039 | } | |
| 1040 | ||
| 1041 | bool bold = (name.replace(0, "[B]", "") + name.replace(0, "[b]", "") > 0); | |
| 1042 | bool italic = (name.replace(0, "[I]", "") + name.replace(0, "[i]", "") > 0); | |
| 1043 | bool underline = (name.replace(0, "[U]", "") + name.replace(0, "[u]", "") > 0); | |
| 1044 | bool strike = (name.replace(0, "[S]", "") + name.replace(0, "[s]", "") > 0); | |
| 1045 | ||
| 1046 | // first up, try it as a filename | |
| 1047 | font = TTF_OpenFont_Magic(name, POINT_SIZE); | |
| 1048 | ||
| 1049 | // if no success, try the font path | |
| 1050 | ||
| 1051 | if (!font) | |
| 1052 | { | |
| 1053 | osd_printf_verbose("Searching font %s in -%s\n", name.cstr(), OPTION_FONTPATH); | |
| 1054 | emu_file file(options().font_path(), OPEN_FLAG_READ); | |
| 1055 | if (file.open(name) == FILERR_NONE) | |
| 1056 | { | |
| 1057 | astring full_name = file.fullpath(); | |
| 1058 | font = TTF_OpenFont_Magic(full_name, POINT_SIZE); | |
| 1059 | if (font) | |
| 1060 | osd_printf_verbose("Found font %s\n", full_name.cstr()); | |
| 1061 | } | |
| 1062 | } | |
| 1063 | ||
| 1064 | // if that didn't work, crank up the FontConfig database | |
| 1065 | #ifndef SDLMAME_HAIKU | |
| 1066 | if (!font) | |
| 1067 | { | |
| 1068 | font = search_font_config(name, bold, italic, underline, bakedstyles); | |
| 1069 | } | |
| 1070 | #endif | |
| 1071 | ||
| 1072 | if (!font) | |
| 1073 | { | |
| 1074 | if (!BDF_Check_Magic(name)) | |
| 1075 | { | |
| 1076 | osd_printf_verbose("font %s is not TrueType or BDF, using MAME default\n", name.cstr()); | |
| 1077 | } | |
| 1078 | return NULL; | |
| 1079 | } | |
| 1080 | ||
| 1081 | // apply styles | |
| 1082 | if (!bakedstyles) | |
| 1083 | { | |
| 1084 | style |= bold ? TTF_STYLE_BOLD : 0; | |
| 1085 | style |= italic ? TTF_STYLE_ITALIC : 0; | |
| 1086 | } | |
| 1087 | style |= underline ? TTF_STYLE_UNDERLINE : 0; | |
| 1088 | // SDL_ttf 2.0.9 and earlier does not define TTF_STYLE_STRIKETHROUGH | |
| 1089 | #if SDL_VERSIONNUM(TTF_MAJOR_VERSION, TTF_MINOR_VERSION, TTF_PATCHLEVEL) > SDL_VERSIONNUM(2,0,9) | |
| 1090 | style |= strike ? TTF_STYLE_STRIKETHROUGH : 0; | |
| 1091 | #else | |
| 1092 | if (strike) | |
| 1093 | osd_printf_warning("Ignoring strikethrough for SDL_TTF older than 2.0.10\n"); | |
| 1094 | #endif // PATCHLEVEL | |
| 1095 | TTF_SetFontStyle(font, style); | |
| 1096 | ||
| 1097 | height = TTF_FontLineSkip(font); | |
| 1098 | ||
| 1099 | osd_font *ret = global_alloc(osd_font); | |
| 1100 | ret->m_font = font; | |
| 1101 | return ret; | |
| 1102 | } | |
| 1103 | ||
| 1104 | //------------------------------------------------- | |
| 1105 | // font_close - release resources associated with | |
| 1106 | // a given OSD font | |
| 1107 | //------------------------------------------------- | |
| 1108 | ||
| 1109 | void sdl_osd_interface::font_close(osd_font *font) | |
| 1110 | { | |
| 1111 | TTF_CloseFont(font->m_font); | |
| 1112 | global_free(font); | |
| 1113 | } | |
| 1114 | ||
| 1115 | //------------------------------------------------- | |
| 1116 | // font_get_bitmap - allocate and populate a | |
| 1117 | // BITMAP_FORMAT_ARGB32 bitmap containing the | |
| 1118 | // pixel values rgb_t(0xff,0xff,0xff,0xff) | |
| 1119 | // or rgb_t(0x00,0xff,0xff,0xff) for each | |
| 1120 | // pixel of a black & white font | |
| 1121 | //------------------------------------------------- | |
| 1122 | ||
| 1123 | bool sdl_osd_interface::font_get_bitmap(osd_font *font, unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs) | |
| 1124 | { | |
| 1125 | TTF_Font *ttffont; | |
| 1126 | SDL_Surface *drawsurf; | |
| 1127 | SDL_Color fcol = { 0xff, 0xff, 0xff }; | |
| 1128 | UINT16 ustr[16]; | |
| 1129 | ||
| 1130 | ttffont = font->m_font; | |
| 1131 | ||
| 1132 | memset(ustr,0,sizeof(ustr)); | |
| 1133 | ustr[0] = (UINT16)chnum; | |
| 1134 | drawsurf = TTF_RenderUNICODE_Solid(ttffont, ustr, fcol); | |
| 1135 | ||
| 1136 | // was nothing returned? | |
| 1137 | if (drawsurf) | |
| 1138 | { | |
| 1139 | // allocate a MAME destination bitmap | |
| 1140 | bitmap.allocate(drawsurf->w, drawsurf->h); | |
| 1141 | ||
| 1142 | // copy the rendered character image into it | |
| 1143 | for (int y = 0; y < bitmap.height(); y++) | |
| 1144 | { | |
| 1145 | UINT32 *dstrow = &bitmap.pix32(y); | |
| 1146 | UINT8 *srcrow = (UINT8 *)drawsurf->pixels; | |
| 1147 | ||
| 1148 | srcrow += (y * drawsurf->pitch); | |
| 1149 | ||
| 1150 | for (int x = 0; x < drawsurf->w; x++) | |
| 1151 | { | |
| 1152 | dstrow[x] = srcrow[x] ? rgb_t(0xff,0xff,0xff,0xff) : rgb_t(0x00,0xff,0xff,0xff); | |
| 1153 | } | |
| 1154 | } | |
| 1155 | ||
| 1156 | // what are these? | |
| 1157 | xoffs = yoffs = 0; | |
| 1158 | width = drawsurf->w; | |
| 1159 | ||
| 1160 | SDL_FreeSurface(drawsurf); | |
| 1161 | } | |
| 1162 | ||
| 1163 | return bitmap.valid(); | |
| 1164 | } | |
| 1165 | #endif // not OSX | |
| 1166 | #else // not UNIX | |
| 651 | 1167 | #ifdef SDLMAME_WIN32 |
| 652 | 1168 | |
| 653 | 1169 | //============================================================ |
| r243192 | r243193 | |
| 687 | 1203 | return result; |
| 688 | 1204 | } |
| 689 | 1205 | |
| 1206 | osd_font sdl_osd_interface::font_open(const char *_name, int &height) | |
| 1207 | { | |
| 1208 | // accept qualifiers from the name | |
| 1209 | astring name(_name); | |
| 1210 | if (name == "default") name = "Tahoma"; | |
| 1211 | bool bold = (name.replace(0, "[B]", "") + name.replace(0, "[b]", "") > 0); | |
| 1212 | bool italic = (name.replace(0, "[I]", "") + name.replace(0, "[i]", "") > 0); | |
| 1213 | ||
| 1214 | // build a basic LOGFONT description of what we want | |
| 1215 | LOGFONT logfont; | |
| 1216 | logfont.lfHeight = DEFAULT_FONT_HEIGHT; | |
| 1217 | logfont.lfWidth = 0; | |
| 1218 | logfont.lfEscapement = 0; | |
| 1219 | logfont.lfOrientation = 0; | |
| 1220 | logfont.lfWeight = bold ? FW_BOLD : FW_MEDIUM; | |
| 1221 | logfont.lfItalic = italic; | |
| 1222 | logfont.lfUnderline = FALSE; | |
| 1223 | logfont.lfStrikeOut = FALSE; | |
| 1224 | logfont.lfCharSet = ANSI_CHARSET; | |
| 1225 | logfont.lfOutPrecision = OUT_DEFAULT_PRECIS; | |
| 1226 | logfont.lfClipPrecision = CLIP_DEFAULT_PRECIS; | |
| 1227 | logfont.lfQuality = NONANTIALIASED_QUALITY; | |
| 1228 | logfont.lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE; | |
| 1229 | ||
| 1230 | // copy in the face name | |
| 1231 | TCHAR *face = wstring_from_utf8(name); | |
| 1232 | wcsncpy(logfont.lfFaceName, face, sizeof(logfont.lfFaceName) / sizeof(TCHAR)); | |
| 1233 | logfont.lfFaceName[sizeof(logfont.lfFaceName) / sizeof(TCHAR)-1] = 0; | |
| 1234 | osd_free(face); | |
| 1235 | ||
| 1236 | // create the font | |
| 1237 | height = logfont.lfHeight; | |
| 1238 | osd_font font = reinterpret_cast<osd_font>(CreateFontIndirect(&logfont)); | |
| 1239 | if (font == NULL) | |
| 1240 | return NULL; | |
| 1241 | ||
| 1242 | // select it into a temp DC and get the real font name | |
| 1243 | HDC dummyDC = CreateCompatibleDC(NULL); | |
| 1244 | HGDIOBJ oldfont = SelectObject(dummyDC, reinterpret_cast<HGDIOBJ>(font)); | |
| 1245 | TCHAR realname[100]; | |
| 1246 | GetTextFace(dummyDC, ARRAY_LENGTH(realname), realname); | |
| 1247 | SelectObject(dummyDC, oldfont); | |
| 1248 | DeleteDC(dummyDC); | |
| 1249 | ||
| 1250 | // if it doesn't match our request, fail | |
| 1251 | char *utf = utf8_from_wstring(realname); | |
| 1252 | int result = core_stricmp(utf, name); | |
| 1253 | osd_free(utf); | |
| 1254 | ||
| 1255 | // if we didn't match, nuke our font and fall back | |
| 1256 | if (result != 0) | |
| 1257 | { | |
| 1258 | DeleteObject(reinterpret_cast<HFONT>(font)); | |
| 1259 | font = NULL; | |
| 1260 | } | |
| 1261 | return font; | |
| 1262 | } | |
| 1263 | ||
| 1264 | ||
| 1265 | //------------------------------------------------- | |
| 1266 | // font_close - release resources associated with | |
| 1267 | // a given OSD font | |
| 1268 | //------------------------------------------------- | |
| 1269 | ||
| 1270 | void sdl_osd_interface::font_close(osd_font font) | |
| 1271 | { | |
| 1272 | // delete the font ojbect | |
| 1273 | if (font != NULL) | |
| 1274 | DeleteObject(reinterpret_cast<HFONT>(font)); | |
| 1275 | } | |
| 1276 | ||
| 1277 | ||
| 1278 | //------------------------------------------------- | |
| 1279 | // font_get_bitmap - allocate and populate a | |
| 1280 | // BITMAP_FORMAT_ARGB32 bitmap containing the | |
| 1281 | // pixel values rgb_t(0xff,0xff,0xff,0xff) | |
| 1282 | // or rgb_t(0x00,0xff,0xff,0xff) for each | |
| 1283 | // pixel of a black & white font | |
| 1284 | //------------------------------------------------- | |
| 1285 | ||
| 1286 | bool sdl_osd_interface::font_get_bitmap(osd_font font, unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs) | |
| 1287 | { | |
| 1288 | // create a dummy DC to work with | |
| 1289 | HDC dummyDC = CreateCompatibleDC(NULL); | |
| 1290 | HGDIOBJ oldfont = SelectObject(dummyDC, reinterpret_cast<HGDIOBJ>(font)); | |
| 1291 | ||
| 1292 | // get the text metrics | |
| 1293 | TEXTMETRIC metrics = { 0 }; | |
| 1294 | GetTextMetrics(dummyDC, &metrics); | |
| 1295 | ||
| 1296 | // get the width of this character | |
| 1297 | ABC abc; | |
| 1298 | if (!GetCharABCWidths(dummyDC, chnum, chnum, &abc)) | |
| 1299 | { | |
| 1300 | abc.abcA = 0; | |
| 1301 | abc.abcC = 0; | |
| 1302 | GetCharWidth32(dummyDC, chnum, chnum, reinterpret_cast<LPINT>(&abc.abcB)); | |
| 1303 | } | |
| 1304 | width = abc.abcA + abc.abcB + abc.abcC; | |
| 1305 | ||
| 1306 | // determine desired bitmap size | |
| 1307 | int bmwidth = (50 + abc.abcA + abc.abcB + abc.abcC + 50 + 31) & ~31; | |
| 1308 | int bmheight = 50 + metrics.tmHeight + 50; | |
| 1309 | ||
| 1310 | // describe the bitmap we want | |
| 1311 | BYTE bitmapinfodata[sizeof(BITMAPINFOHEADER)+2 * sizeof(RGBQUAD)] = { 0 }; | |
| 1312 | BITMAPINFO &info = *reinterpret_cast<BITMAPINFO *>(bitmapinfodata); | |
| 1313 | info.bmiHeader.biSize = sizeof(info.bmiHeader); | |
| 1314 | info.bmiHeader.biWidth = bmwidth; | |
| 1315 | info.bmiHeader.biHeight = -bmheight; | |
| 1316 | info.bmiHeader.biPlanes = 1; | |
| 1317 | info.bmiHeader.biBitCount = 1; | |
| 1318 | info.bmiHeader.biCompression = BI_RGB; | |
| 1319 | info.bmiHeader.biSizeImage = 0; | |
| 1320 | info.bmiHeader.biXPelsPerMeter = GetDeviceCaps(dummyDC, HORZRES) / GetDeviceCaps(dummyDC, HORZSIZE); | |
| 1321 | info.bmiHeader.biYPelsPerMeter = GetDeviceCaps(dummyDC, VERTRES) / GetDeviceCaps(dummyDC, VERTSIZE); | |
| 1322 | info.bmiHeader.biClrUsed = 0; | |
| 1323 | info.bmiHeader.biClrImportant = 0; | |
| 1324 | RGBQUAD col1 = info.bmiColors[0]; | |
| 1325 | RGBQUAD col2 = info.bmiColors[1]; | |
| 1326 | col1.rgbBlue = col1.rgbGreen = col1.rgbRed = 0x00; | |
| 1327 | col2.rgbBlue = col2.rgbGreen = col2.rgbRed = 0xff; | |
| 1328 | ||
| 1329 | // create a DIB to render to | |
| 1330 | BYTE *bits; | |
| 1331 | HBITMAP dib = CreateDIBSection(dummyDC, &info, DIB_RGB_COLORS, reinterpret_cast<VOID **>(&bits), NULL, 0); | |
| 1332 | HGDIOBJ oldbitmap = SelectObject(dummyDC, dib); | |
| 1333 | ||
| 1334 | // clear the bitmap | |
| 1335 | int rowbytes = bmwidth / 8; | |
| 1336 | memset(bits, 0, rowbytes * bmheight); | |
| 1337 | ||
| 1338 | // now draw the character | |
| 1339 | WCHAR tempchar = chnum; | |
| 1340 | SetTextColor(dummyDC, RGB(0xff, 0xff, 0xff)); | |
| 1341 | SetBkColor(dummyDC, RGB(0x00, 0x00, 0x00)); | |
| 1342 | ExtTextOutW(dummyDC, 50 + abc.abcA, 50, ETO_OPAQUE, NULL, &tempchar, 1, NULL); | |
| 1343 | ||
| 1344 | // characters are expected to be full-height | |
| 1345 | rectangle actbounds; | |
| 1346 | actbounds.min_y = 50; | |
| 1347 | actbounds.max_y = 50 + metrics.tmHeight - 1; | |
| 1348 | ||
| 1349 | // determine the actual left of the character | |
| 1350 | for (actbounds.min_x = 0; actbounds.min_x < rowbytes; actbounds.min_x++) | |
| 1351 | { | |
| 1352 | BYTE *offs = bits + actbounds.min_x; | |
| 1353 | UINT8 summary = 0; | |
| 1354 | for (int y = 0; y < bmheight; y++) | |
| 1355 | summary |= offs[y * rowbytes]; | |
| 1356 | if (summary != 0) | |
| 1357 | { | |
| 1358 | actbounds.min_x *= 8; | |
| 1359 | if (!(summary & 0x80)) actbounds.min_x++; | |
| 1360 | if (!(summary & 0xc0)) actbounds.min_x++; | |
| 1361 | if (!(summary & 0xe0)) actbounds.min_x++; | |
| 1362 | if (!(summary & 0xf0)) actbounds.min_x++; | |
| 1363 | if (!(summary & 0xf8)) actbounds.min_x++; | |
| 1364 | if (!(summary & 0xfc)) actbounds.min_x++; | |
| 1365 | if (!(summary & 0xfe)) actbounds.min_x++; | |
| 1366 | break; | |
| 1367 | } | |
| 1368 | } | |
| 1369 | ||
| 1370 | // determine the actual right of the character | |
| 1371 | for (actbounds.max_x = rowbytes - 1; actbounds.max_x >= 0; actbounds.max_x--) | |
| 1372 | { | |
| 1373 | BYTE *offs = bits + actbounds.max_x; | |
| 1374 | UINT8 summary = 0; | |
| 1375 | for (int y = 0; y < bmheight; y++) | |
| 1376 | summary |= offs[y * rowbytes]; | |
| 1377 | if (summary != 0) | |
| 1378 | { | |
| 1379 | actbounds.max_x *= 8; | |
| 1380 | if (summary & 0x7f) actbounds.max_x++; | |
| 1381 | if (summary & 0x3f) actbounds.max_x++; | |
| 1382 | if (summary & 0x1f) actbounds.max_x++; | |
| 1383 | if (summary & 0x0f) actbounds.max_x++; | |
| 1384 | if (summary & 0x07) actbounds.max_x++; | |
| 1385 | if (summary & 0x03) actbounds.max_x++; | |
| 1386 | if (summary & 0x01) actbounds.max_x++; | |
| 1387 | break; | |
| 1388 | } | |
| 1389 | } | |
| 1390 | ||
| 1391 | // allocate a new bitmap | |
| 1392 | if (actbounds.max_x >= actbounds.min_x && actbounds.max_y >= actbounds.min_y) | |
| 1393 | { | |
| 1394 | bitmap.allocate(actbounds.max_x + 1 - actbounds.min_x, actbounds.max_y + 1 - actbounds.min_y); | |
| 1395 | ||
| 1396 | // copy the bits into it | |
| 1397 | for (int y = 0; y < bitmap.height(); y++) | |
| 1398 | { | |
| 1399 | UINT32 *dstrow = &bitmap.pix32(y); | |
| 1400 | UINT8 *srcrow = &bits[(y + actbounds.min_y) * rowbytes]; | |
| 1401 | for (int x = 0; x < bitmap.width(); x++) | |
| 1402 | { | |
| 1403 | int effx = x + actbounds.min_x; | |
| 1404 | dstrow[x] = ((srcrow[effx / 8] << (effx % 8)) & 0x80) ? rgb_t(0xff, 0xff, 0xff, 0xff) : rgb_t(0x00, 0xff, 0xff, 0xff); | |
| 1405 | } | |
| 1406 | } | |
| 1407 | ||
| 1408 | // set the final offset values | |
| 1409 | xoffs = actbounds.min_x - (50 + abc.abcA); | |
| 1410 | yoffs = actbounds.max_y - (50 + metrics.tmAscent); | |
| 1411 | } | |
| 1412 | ||
| 1413 | // de-select the font and release the DC | |
| 1414 | SelectObject(dummyDC, oldbitmap); | |
| 1415 | DeleteObject(dib); | |
| 1416 | SelectObject(dummyDC, oldfont); | |
| 1417 | DeleteDC(dummyDC); | |
| 1418 | return bitmap.valid(); | |
| 1419 | } | |
| 1420 | ||
| 1421 | #else | |
| 1422 | ||
| 1423 | //------------------------------------------------- | |
| 1424 | // font_open - attempt to "open" a handle to the | |
| 1425 | // font with the given name | |
| 1426 | //------------------------------------------------- | |
| 1427 | ||
| 1428 | osd_font sdl_osd_interface::font_open(const char *_name, int &height) | |
| 1429 | { | |
| 1430 | return (osd_font)NULL; | |
| 1431 | } | |
| 1432 | ||
| 1433 | //------------------------------------------------- | |
| 1434 | // font_close - release resources associated with | |
| 1435 | // a given OSD font | |
| 1436 | //------------------------------------------------- | |
| 1437 | ||
| 1438 | void sdl_osd_interface::font_close(osd_font font) | |
| 1439 | { | |
| 1440 | } | |
| 1441 | ||
| 1442 | //------------------------------------------------- | |
| 1443 | // font_get_bitmap - allocate and populate a | |
| 1444 | // BITMAP_FORMAT_ARGB32 bitmap containing the | |
| 1445 | // pixel values rgb_t(0xff,0xff,0xff,0xff) | |
| 1446 | // or rgb_t(0x00,0xff,0xff,0xff) for each | |
| 1447 | // pixel of a black & white font | |
| 1448 | //------------------------------------------------- | |
| 1449 | ||
| 1450 | bool sdl_osd_interface::font_get_bitmap(osd_font font, unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs) | |
| 1451 | { | |
| 1452 | return false; | |
| 1453 | } | |
| 690 | 1454 | #endif |
| 1455 | #endif | |
| 1456 | ||
| 1457 |
| r0 | r243193 | |
|---|---|---|
| 1 | //============================================================ | |
| 2 | // | |
| 3 | // sdlos_*.c - OS specific low level code | |
| 4 | // | |
| 5 | // Copyright (c) 1996-2010, Nicola Salmoria and the MAME Team. | |
| 6 | // Visit http://mamedev.org for licensing and usage restrictions. | |
| 7 | // | |
| 8 | // SDLMAME by Olivier Galibert and R. Belmont | |
| 9 | // | |
| 10 | //============================================================ | |
| 11 | ||
| 12 | // standard sdl header | |
| 13 | #include "sdlinc.h" | |
| 14 | #include <unistd.h> | |
| 15 | #include <stdio.h> | |
| 16 | #include <string.h> | |
| 17 | #include <ctype.h> | |
| 18 | #include <stdlib.h> | |
| 19 | ||
| 20 | #define INCL_DOS | |
| 21 | #include <os2.h> | |
| 22 | ||
| 23 | // MAME headers | |
| 24 | #include "osdcore.h" | |
| 25 | ||
| 26 | //============================================================ | |
| 27 | // osd_alloc_executable | |
| 28 | // | |
| 29 | // allocates "size" bytes of executable memory. this must take | |
| 30 | // things like NX support into account. | |
| 31 | //============================================================ | |
| 32 | ||
| 33 | void *osd_alloc_executable(size_t size) | |
| 34 | { | |
| 35 | void *p; | |
| 36 | ||
| 37 | DosAllocMem( &p, size, fALLOC ); | |
| 38 | return p; | |
| 39 | } | |
| 40 | ||
| 41 | //============================================================ | |
| 42 | // osd_free_executable | |
| 43 | // | |
| 44 | // frees memory allocated with osd_alloc_executable | |
| 45 | //============================================================ | |
| 46 | ||
| 47 | void osd_free_executable(void *ptr, size_t size) | |
| 48 | { | |
| 49 | DosFreeMem( ptr ); | |
| 50 | } | |
| 51 | ||
| 52 | //============================================================ | |
| 53 | // osd_break_into_debugger | |
| 54 | //============================================================ | |
| 55 | ||
| 56 | void osd_break_into_debugger(const char *message) | |
| 57 | { | |
| 58 | printf("Ignoring MAME exception: %s\n", message); | |
| 59 | } |
| r0 | r243193 | |
|---|---|---|
| 1 | //============================================================ | |
| 2 | // | |
| 3 | // sdlos_*.c - OS specific low level code | |
| 4 | // | |
| 5 | // Copyright (c) 1996-2010, Nicola Salmoria and the MAME Team. | |
| 6 | // Visit http://mamedev.org for licensing and usage restrictions. | |
| 7 | // | |
| 8 | // SDLMAME by Olivier Galibert and R. Belmont | |
| 9 | // | |
| 10 | //============================================================ | |
| 11 | ||
| 12 | #include <sys/mman.h> | |
| 13 | #include <signal.h> | |
| 14 | #ifdef MAME_DEBUG | |
| 15 | #include <unistd.h> | |
| 16 | #endif | |
| 17 | ||
| 18 | // MAME headers | |
| 19 | #include "osdcore.h" | |
| 20 | ||
| 21 | ||
| 22 | //============================================================ | |
| 23 | // osd_alloc_executable | |
| 24 | // | |
| 25 | // allocates "size" bytes of executable memory. this must take | |
| 26 | // things like NX support into account. | |
| 27 | //============================================================ | |
| 28 | ||
| 29 | void *osd_alloc_executable(size_t size) | |
| 30 | { | |
| 31 | #if defined(SDLMAME_BSD) || defined(SDLMAME_MACOSX) | |
| 32 | return (void *)mmap(0, size, PROT_EXEC|PROT_READ|PROT_WRITE, MAP_ANON|MAP_SHARED, -1, 0); | |
| 33 | #elif defined(SDLMAME_UNIX) | |
| 34 | return (void *)mmap(0, size, PROT_EXEC|PROT_READ|PROT_WRITE, MAP_ANON|MAP_SHARED, 0, 0); | |
| 35 | #endif | |
| 36 | } | |
| 37 | ||
| 38 | //============================================================ | |
| 39 | // osd_free_executable | |
| 40 | // | |
| 41 | // frees memory allocated with osd_alloc_executable | |
| 42 | //============================================================ | |
| 43 | ||
| 44 | void osd_free_executable(void *ptr, size_t size) | |
| 45 | { | |
| 46 | #ifdef SDLMAME_SOLARIS | |
| 47 | munmap((char *)ptr, size); | |
| 48 | #else | |
| 49 | munmap(ptr, size); | |
| 50 | #endif | |
| 51 | } | |
| 52 | ||
| 53 | //============================================================ | |
| 54 | // osd_break_into_debugger | |
| 55 | //============================================================ | |
| 56 | ||
| 57 | void osd_break_into_debugger(const char *message) | |
| 58 | { | |
| 59 | #ifdef MAME_DEBUG | |
| 60 | printf("MAME exception: %s\n", message); | |
| 61 | printf("Attempting to fall into debugger\n"); | |
| 62 | kill(getpid(), SIGTRAP); | |
| 63 | #else | |
| 64 | printf("Ignoring MAME exception: %s\n", message); | |
| 65 | #endif | |
| 66 | } |
| r0 | r243193 | |
|---|---|---|
| 1 | //============================================================ | |
| 2 | // | |
| 3 | // sdlos_*.c - OS specific low level code | |
| 4 | // | |
| 5 | // Copyright (c) 1996-2010, Nicola Salmoria and the MAME Team. | |
| 6 | // Visit http://mamedev.org for licensing and usage restrictions. | |
| 7 | // | |
| 8 | // SDLMAME by Olivier Galibert and R. Belmont | |
| 9 | // | |
| 10 | //============================================================ | |
| 11 | ||
| 12 | // standard sdl header | |
| 13 | #include "sdlinc.h" | |
| 14 | ||
| 15 | ||
| 16 | #define WIN32_LEAN_AND_MEAN | |
| 17 | #include <windows.h> | |
| 18 | ||
| 19 | // MAME headers | |
| 20 | #include "osdcore.h" | |
| 21 | ||
| 22 | //============================================================ | |
| 23 | // osd_alloc_executable | |
| 24 | // | |
| 25 | // allocates "size" bytes of executable memory. this must take | |
| 26 | // things like NX support into account. | |
| 27 | //============================================================ | |
| 28 | ||
| 29 | void *osd_alloc_executable(size_t size) | |
| 30 | { | |
| 31 | return VirtualAlloc(NULL, size, MEM_COMMIT, PAGE_EXECUTE_READWRITE); | |
| 32 | } | |
| 33 | ||
| 34 | //============================================================ | |
| 35 | // osd_free_executable | |
| 36 | // | |
| 37 | // frees memory allocated with osd_alloc_executable | |
| 38 | //============================================================ | |
| 39 | ||
| 40 | void osd_free_executable(void *ptr, size_t size) | |
| 41 | { | |
| 42 | VirtualFree(ptr, 0, MEM_RELEASE); | |
| 43 | } | |
| 44 | ||
| 45 | //============================================================ | |
| 46 | // osd_break_into_debugger | |
| 47 | //============================================================ | |
| 48 | ||
| 49 | void osd_break_into_debugger(const char *message) | |
| 50 | { | |
| 51 | if (IsDebuggerPresent()) | |
| 52 | { | |
| 53 | OutputDebugStringA(message); | |
| 54 | DebugBreak(); | |
| 55 | } | |
| 56 | } |
| r243192 | r243193 | |
|---|---|---|
| 121 | 121 | |
| 122 | 122 | return result; |
| 123 | 123 | } |
| 124 |
| r243192 | r243193 | |
|---|---|---|
| 23 | 23 | |
| 24 | 24 | // MAME headers |
| 25 | 25 | #include "osdcore.h" |
| 26 | #include "osdlib.h" | |
| 27 | 26 | |
| 27 | ||
| 28 | 28 | //============================================================ |
| 29 | // PROTOTYPES | |
| 30 | //============================================================ | |
| 31 | ||
| 32 | ||
| 33 | static osd_ticks_t init_cycle_counter(void); | |
| 34 | static osd_ticks_t performance_cycle_counter(void); | |
| 35 | ||
| 36 | //============================================================ | |
| 37 | // STATIC VARIABLES | |
| 38 | //============================================================ | |
| 39 | ||
| 40 | // global cycle_counter function and divider | |
| 41 | static osd_ticks_t (*cycle_counter)(void) = init_cycle_counter; | |
| 42 | static osd_ticks_t (*ticks_counter)(void) = init_cycle_counter; | |
| 43 | static osd_ticks_t ticks_per_second; | |
| 44 | ||
| 45 | //============================================================ | |
| 46 | // init_cycle_counter | |
| 47 | // | |
| 48 | // to avoid total grossness, this function is split by subarch | |
| 49 | //============================================================ | |
| 50 | ||
| 51 | static osd_ticks_t init_cycle_counter(void) | |
| 52 | { | |
| 53 | osd_ticks_t start, end; | |
| 54 | osd_ticks_t a, b; | |
| 55 | ||
| 56 | ULONG frequency; | |
| 57 | PTIB ptib; | |
| 58 | ULONG ulClass; | |
| 59 | ULONG ulDelta; | |
| 60 | ||
| 61 | DosGetInfoBlocks( &ptib, NULL ); | |
| 62 | ulClass = HIBYTE( ptib->tib_ptib2->tib2_ulpri ); | |
| 63 | ulDelta = LOBYTE( ptib->tib_ptib2->tib2_ulpri ); | |
| 64 | ||
| 65 | if ( DosTmrQueryFreq( &frequency ) == 0 ) | |
| 66 | { | |
| 67 | // use performance counter if available as it is constant | |
| 68 | cycle_counter = performance_cycle_counter; | |
| 69 | ticks_counter = performance_cycle_counter; | |
| 70 | ||
| 71 | ticks_per_second = frequency; | |
| 72 | ||
| 73 | // return the current cycle count | |
| 74 | return (*cycle_counter)(); | |
| 75 | } | |
| 76 | else | |
| 77 | { | |
| 78 | fprintf(stderr, "No Timer available!\n"); | |
| 79 | exit(-1); | |
| 80 | } | |
| 81 | ||
| 82 | // temporarily set our priority higher | |
| 83 | DosSetPriority( PRTYS_THREAD, PRTYC_TIMECRITICAL, PRTYD_MAXIMUM, 0 ); | |
| 84 | ||
| 85 | // wait for an edge on the timeGetTime call | |
| 86 | a = SDL_GetTicks(); | |
| 87 | do | |
| 88 | { | |
| 89 | b = SDL_GetTicks(); | |
| 90 | } while (a == b); | |
| 91 | ||
| 92 | // get the starting cycle count | |
| 93 | start = (*cycle_counter)(); | |
| 94 | ||
| 95 | // now wait for 1/4 second total | |
| 96 | do | |
| 97 | { | |
| 98 | a = SDL_GetTicks(); | |
| 99 | } while (a - b < 250); | |
| 100 | ||
| 101 | // get the ending cycle count | |
| 102 | end = (*cycle_counter)(); | |
| 103 | ||
| 104 | // compute ticks_per_sec | |
| 105 | ticks_per_second = (end - start) * 4; | |
| 106 | ||
| 107 | // restore our priority | |
| 108 | DosSetPriority( PRTYS_THREAD, ulClass, ulDelta, 0 ); | |
| 109 | ||
| 110 | // return the current cycle count | |
| 111 | return (*cycle_counter)(); | |
| 112 | } | |
| 113 | ||
| 114 | //============================================================ | |
| 115 | // performance_cycle_counter | |
| 116 | //============================================================ | |
| 117 | ||
| 118 | static osd_ticks_t performance_cycle_counter(void) | |
| 119 | { | |
| 120 | QWORD qwTime; | |
| 121 | ||
| 122 | DosTmrQueryTime( &qwTime ); | |
| 123 | return (osd_ticks_t)qwTime.ulLo; | |
| 124 | } | |
| 125 | ||
| 126 | //============================================================ | |
| 127 | // osd_cycles | |
| 128 | //============================================================ | |
| 129 | ||
| 130 | osd_ticks_t osd_ticks(void) | |
| 131 | { | |
| 132 | return (*cycle_counter)(); | |
| 133 | } | |
| 134 | ||
| 135 | ||
| 136 | //============================================================ | |
| 137 | // osd_ticks_per_second | |
| 138 | //============================================================ | |
| 139 | ||
| 140 | osd_ticks_t osd_ticks_per_second(void) | |
| 141 | { | |
| 142 | if (ticks_per_second == 0) | |
| 143 | { | |
| 144 | // if we haven't computed the value yet, there's no time like the present | |
| 145 | init_cycle_counter(); | |
| 146 | } | |
| 147 | return ticks_per_second; | |
| 148 | } | |
| 149 | ||
| 150 | ||
| 151 | //============================================================ | |
| 152 | // osd_sleep | |
| 153 | //============================================================ | |
| 154 | ||
| 155 | void osd_sleep(osd_ticks_t duration) | |
| 156 | { | |
| 157 | UINT32 msec; | |
| 158 | ||
| 159 | // make sure we've computed ticks_per_second | |
| 160 | if (ticks_per_second == 0) | |
| 161 | (void)osd_ticks(); | |
| 162 | ||
| 163 | // convert to milliseconds, rounding down | |
| 164 | msec = (UINT32)(duration * 1000 / ticks_per_second); | |
| 165 | ||
| 166 | // only sleep if at least 2 full milliseconds | |
| 167 | if (msec >= 2) | |
| 168 | { | |
| 169 | // take a couple of msecs off the top for good measure | |
| 170 | msec -= 2; | |
| 171 | usleep(msec*1000); | |
| 172 | } | |
| 173 | } | |
| 174 | ||
| 175 | //============================================================ | |
| 176 | // osd_num_processors | |
| 177 | //============================================================ | |
| 178 | ||
| 179 | int osd_get_num_processors(void) | |
| 180 | { | |
| 181 | ULONG numprocs = 1; | |
| 182 | ||
| 183 | DosQuerySysInfo(QSV_NUMPROCESSORS, QSV_NUMPROCESSORS, &numprocs, sizeof(numprocs)); | |
| 184 | ||
| 185 | return numprocs; | |
| 186 | } | |
| 187 | ||
| 188 | //============================================================ | |
| 189 | // osd_malloc | |
| 190 | //============================================================ | |
| 191 | ||
| 192 | void *osd_malloc(size_t size) | |
| 193 | { | |
| 194 | #ifndef MALLOC_DEBUG | |
| 195 | return malloc(size); | |
| 196 | #else | |
| 197 | #error "MALLOC_DEBUG not yet supported" | |
| 198 | #endif | |
| 199 | } | |
| 200 | ||
| 201 | ||
| 202 | //============================================================ | |
| 203 | // osd_malloc_array | |
| 204 | //============================================================ | |
| 205 | ||
| 206 | void *osd_malloc_array(size_t size) | |
| 207 | { | |
| 208 | #ifndef MALLOC_DEBUG | |
| 209 | return malloc(size); | |
| 210 | #else | |
| 211 | #error "MALLOC_DEBUG not yet supported" | |
| 212 | #endif | |
| 213 | } | |
| 214 | ||
| 215 | ||
| 216 | //============================================================ | |
| 217 | // osd_free | |
| 218 | //============================================================ | |
| 219 | ||
| 220 | void osd_free(void *ptr) | |
| 221 | { | |
| 222 | #ifndef MALLOC_DEBUG | |
| 223 | free(ptr); | |
| 224 | #else | |
| 225 | #error "MALLOC_DEBUG not yet supported" | |
| 226 | #endif | |
| 227 | } | |
| 228 | ||
| 229 | //============================================================ | |
| 230 | // osd_getenv | |
| 231 | //============================================================ | |
| 232 | ||
| 233 | char *osd_getenv(const char *name) | |
| 234 | { | |
| 235 | return getenv(name); | |
| 236 | } | |
| 237 | ||
| 238 | //============================================================ | |
| 239 | // osd_setenv | |
| 240 | //============================================================ | |
| 241 | ||
| 242 | int osd_setenv(const char *name, const char *value, int overwrite) | |
| 243 | { | |
| 244 | return setenv(name, value, overwrite); | |
| 245 | } | |
| 246 | ||
| 247 | ||
| 248 | //============================================================ | |
| 29 | 249 | // osd_get_clipboard_text |
| 30 | 250 | // - used in MESS |
| 31 | 251 | //============================================================ |
| r243192 | r243193 | |
|---|---|---|
| 147 | 147 | return result; |
| 148 | 148 | } |
| 149 | 149 | #endif |
| 150 | ||
| 151 | ||
| 152 |
| r243192 | r243193 | |
|---|---|---|
| 101 | 101 | |
| 102 | 102 | return result; |
| 103 | 103 | } |
| 104 | ||
| 105 | //============================================================ | |
| 106 | // astring_from_utf8 | |
| 107 | //============================================================ | |
| 108 | ||
| 109 | CHAR *astring_from_utf8(const char *utf8string) | |
| 110 | { | |
| 111 | WCHAR *wstring; | |
| 112 | int char_count; | |
| 113 | CHAR *result; | |
| 114 | ||
| 115 | // convert MAME string (UTF-8) to UTF-16 | |
| 116 | char_count = MultiByteToWideChar(CP_UTF8, 0, utf8string, -1, NULL, 0); | |
| 117 | wstring = (WCHAR *)alloca(char_count * sizeof(*wstring)); | |
| 118 | MultiByteToWideChar(CP_UTF8, 0, utf8string, -1, wstring, char_count); | |
| 119 | ||
| 120 | // convert UTF-16 to "ANSI code page" string | |
| 121 | char_count = WideCharToMultiByte(CP_ACP, 0, wstring, -1, NULL, 0, NULL, NULL); | |
| 122 | result = (CHAR *)osd_malloc_array(char_count * sizeof(*result)); | |
| 123 | if (result != NULL) | |
| 124 | WideCharToMultiByte(CP_ACP, 0, wstring, -1, result, char_count, NULL, NULL); | |
| 125 | ||
| 126 | return result; | |
| 127 | } | |
| 128 | ||
| 129 | //============================================================ | |
| 130 | // wstring_from_utf8 | |
| 131 | //============================================================ | |
| 132 | ||
| 133 | WCHAR *wstring_from_utf8(const char *utf8string) | |
| 134 | { | |
| 135 | int char_count; | |
| 136 | WCHAR *result; | |
| 137 | ||
| 138 | // convert MAME string (UTF-8) to UTF-16 | |
| 139 | char_count = MultiByteToWideChar(CP_UTF8, 0, utf8string, -1, NULL, 0); | |
| 140 | result = (WCHAR *)osd_malloc_array(char_count * sizeof(*result)); | |
| 141 | if (result != NULL) | |
| 142 | MultiByteToWideChar(CP_UTF8, 0, utf8string, -1, result, char_count); | |
| 143 | ||
| 144 | return result; | |
| 145 | } | |
| 146 |
| r243192 | r243193 | |
|---|---|---|
| 27 | 27 | |
| 28 | 28 | #if defined(__sun__) && defined(__svr4__) |
| 29 | 29 | #define SDLMAME_SOLARIS 1 |
| 30 | //#undef _XOPEN_SOURCE | |
| 31 | //#undef _XOPEN_VERSION | |
| 32 | //#undef _XOPEN_SOURCE_EXTENDED | |
| 33 | //#undef _XPG6 | |
| 34 | //#undef _XPG5 | |
| 35 | //#undef _XPG4_2 | |
| 36 | //#define _XOPEN_SOURCE | |
| 37 | //#define _XOPEN_VERSION 4 | |
| 30 | #undef _XOPEN_SOURCE | |
| 31 | #undef _XOPEN_VERSION | |
| 32 | #undef _XOPEN_SOURCE_EXTENDED | |
| 33 | #undef _XPG6 | |
| 34 | #undef _XPG5 | |
| 35 | #undef _XPG4_2 | |
| 36 | ||
| 37 | #define _XOPEN_SOURCE | |
| 38 | #define _XOPEN_VERSION 4 | |
| 39 | ||
| 38 | 40 | #elif defined(__irix__) || defined(__sgi) |
| 39 | 41 | #define SDLMAME_IRIX 1 |
| 40 | 42 | /* Large file support on IRIX needs _SGI_SOURCE */ |
| r243192 | r243193 | |
|---|---|---|
| 9 | 9 | // |
| 10 | 10 | //============================================================ |
| 11 | 11 | |
| 12 | #if (!defined(SDLMAME_SOLARIS) && !(defined(SDLMAME_OS2))) | |
| 13 | ||
| 14 | 12 | #include <sys/types.h> |
| 15 | 13 | #include <sys/uio.h> |
| 16 | 14 | #include <unistd.h> |
| r243192 | r243193 | |
| 103 | 101 | |
| 104 | 102 | return FILERR_NONE; |
| 105 | 103 | } |
| 106 | ||
| 107 | #else | |
| 108 | #include "sdlfile.h" | |
| 109 | ||
| 110 | const char *sdlfile_ptty_identifier = ""; | |
| 111 | ||
| 112 | file_error sdl_open_ptty(const char *path, UINT32 openflags, osd_file **file, UINT64 *filesize) | |
| 113 | { | |
| 114 | return FILERR_ACCESS_DENIED; | |
| 115 | } | |
| 116 | ||
| 117 | file_error sdl_read_ptty(osd_file *file, void *buffer, UINT64 offset, UINT32 count, UINT32 *actual) | |
| 118 | { | |
| 119 | return FILERR_ACCESS_DENIED; | |
| 120 | } | |
| 121 | ||
| 122 | file_error sdl_write_ptty(osd_file *file, const void *buffer, UINT64 offset, UINT32 count, UINT32 *actual) | |
| 123 | { | |
| 124 | return FILERR_ACCESS_DENIED; | |
| 125 | } | |
| 126 | ||
| 127 | file_error sdl_close_ptty(osd_file *file) | |
| 128 | { | |
| 129 | return FILERR_ACCESS_DENIED; | |
| 130 | } | |
| 131 | #endif |
| r243192 | r243193 | |
|---|---|---|
| 1 | // license:BSD-3-Clause | |
| 2 | // copyright-holders:Aaron Giles | |
| 3 | 1 | //============================================================ |
| 4 | 2 | // |
| 5 | // strconv.c - | |
| 3 | // strconv.c - SDL (POSIX) string conversion | |
| 6 | 4 | // |
| 5 | // Copyright (c) 1996-2010, Nicola Salmoria and the MAME Team. | |
| 6 | // Visit http://mamedev.org for licensing and usage restrictions. | |
| 7 | // | |
| 8 | // SDLMAME by Olivier Galibert and R. Belmont | |
| 9 | // | |
| 7 | 10 | //============================================================ |
| 8 | 11 | |
| 9 | #if | |
| 12 | #ifdef SDLMAME_WIN32 | |
| 10 | 13 | #define WIN32_LEAN_AND_MEAN |
| 11 | 14 | #include <windows.h> |
| 12 | 15 | #endif |
| 13 | 16 | |
| 17 | #include <stdlib.h> | |
| 18 | ||
| 14 | 19 | // MAMEOS headers |
| 15 | 20 | #include "strconv.h" |
| 16 | 21 | #include "unicode.h" |
| 17 | 22 | |
| 18 | #if | |
| 23 | #ifdef SDLMAME_WIN32 | |
| 19 | 24 | //============================================================ |
| 20 | // astring_from_utf8 | |
| 21 | //============================================================ | |
| 22 | ||
| 23 | CHAR *astring_from_utf8(const char *utf8string) | |
| 24 | { | |
| 25 | WCHAR *wstring; | |
| 26 | int char_count; | |
| 27 | CHAR *result; | |
| 28 | ||
| 29 | // convert MAME string (UTF-8) to UTF-16 | |
| 30 | char_count = MultiByteToWideChar(CP_UTF8, 0, utf8string, -1, NULL, 0); | |
| 31 | wstring = (WCHAR *)alloca(char_count * sizeof(*wstring)); | |
| 32 | MultiByteToWideChar(CP_UTF8, 0, utf8string, -1, wstring, char_count); | |
| 33 | ||
| 34 | // convert UTF-16 to "ANSI code page" string | |
| 35 | char_count = WideCharToMultiByte(CP_ACP, 0, wstring, -1, NULL, 0, NULL, NULL); | |
| 36 | result = (CHAR *)osd_malloc_array(char_count * sizeof(*result)); | |
| 37 | if (result != NULL) | |
| 38 | WideCharToMultiByte(CP_ACP, 0, wstring, -1, result, char_count, NULL, NULL); | |
| 39 | ||
| 40 | return result; | |
| 41 | } | |
| 42 | ||
| 43 | ||
| 44 | //============================================================ | |
| 45 | 25 | // utf8_from_astring |
| 46 | 26 | //============================================================ |
| 47 | 27 | |
| r243192 | r243193 | |
| 65 | 45 | return result; |
| 66 | 46 | } |
| 67 | 47 | |
| 68 | ||
| 69 | 48 | //============================================================ |
| 70 | // wstring_from_utf8 | |
| 71 | //============================================================ | |
| 72 | ||
| 73 | WCHAR *wstring_from_utf8(const char *utf8string) | |
| 74 | { | |
| 75 | int char_count; | |
| 76 | WCHAR *result; | |
| 77 | ||
| 78 | // convert MAME string (UTF-8) to UTF-16 | |
| 79 | char_count = MultiByteToWideChar(CP_UTF8, 0, utf8string, -1, NULL, 0); | |
| 80 | result = (WCHAR *)osd_malloc_array(char_count * sizeof(*result)); | |
| 81 | if (result != NULL) | |
| 82 | MultiByteToWideChar(CP_UTF8, 0, utf8string, -1, result, char_count); | |
| 83 | ||
| 84 | return result; | |
| 85 | } | |
| 86 | ||
| 87 | ||
| 88 | //============================================================ | |
| 89 | 49 | // utf8_from_wstring |
| 90 | 50 | //============================================================ |
| 91 | 51 | |
| r243192 | r243193 | |
| 102 | 62 | |
| 103 | 63 | return result; |
| 104 | 64 | } |
| 65 | #endif | |
| 105 | 66 | |
| 106 | 67 | //============================================================ |
| 107 | 68 | // osd_uchar_from_osdchar |
| 108 | 69 | //============================================================ |
| 109 | 70 | |
| 110 | int osd_uchar_from_osdchar(UINT32 *uchar, const char *osdchar, size_t count) | |
| 111 | { | |
| 112 | WCHAR wch; | |
| 113 | ||
| 114 | count = MIN(count, IsDBCSLeadByte(*osdchar) ? 2 : 1); | |
| 115 | if (MultiByteToWideChar(CP_ACP, 0, osdchar, (DWORD)count, &wch, 1) != 0) | |
| 116 | *uchar = wch; | |
| 117 | else | |
| 118 | *uchar = 0; | |
| 119 | return (int) count; | |
| 120 | } | |
| 121 | ||
| 122 | #else | |
| 123 | ||
| 124 | //============================================================ | |
| 125 | // osd_uchar_from_osdchar | |
| 126 | //============================================================ | |
| 127 | ||
| 128 | 71 | int osd_uchar_from_osdchar(unicode_char *uchar, const char *osdchar, size_t count) |
| 129 | 72 | { |
| 130 | 73 | wchar_t wch; |
| r243192 | r243193 | |
| 137 | 80 | |
| 138 | 81 | return count; |
| 139 | 82 | } |
| 140 | ||
| 141 | #endif |
| r243192 | r243193 | |
|---|---|---|
| 1 | // license:BSD-3-Clause | |
| 2 | // copyright-holders:Aaron Giles | |
| 3 | 1 | //============================================================ |
| 4 | 2 | // |
| 5 | // strconv.h - String conversion | |
| 3 | // strconv.h - SDL string conversion | |
| 6 | 4 | // |
| 7 | 5 | // Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team. |
| 8 | 6 | // Visit http://mamedev.org for licensing and usage restrictions. |
| 9 | 7 | // |
| 10 | 8 | //============================================================ |
| 11 | 9 | |
| 12 | #ifndef __OSD_STRCONV__ | |
| 13 | #define __OSD_STRCONV__ | |
| 10 | #ifndef __SDLSTRCONV__ | |
| 11 | #define __SDLSTRCONV__ | |
| 14 | 12 | |
| 15 | 13 | #include "osdcore.h" |
| 16 | 14 | |
| r243192 | r243193 | |
| 20 | 18 | // FUNCTION PROTOTYPES |
| 21 | 19 | //============================================================ |
| 22 | 20 | |
| 23 | #if | |
| 21 | #ifdef SDLMAME_WIN32 | |
| 24 | 22 | |
| 25 | #if defined(SDLMAME_WIN32) | |
| 26 | #define WIN32_LEAN_AND_MEAN | |
| 27 | #include <windows.h> | |
| 28 | #endif | |
| 29 | 23 | // the result of these functions has to be released with osd_free() |
| 30 | 24 | |
| 31 | 25 | CHAR *astring_from_utf8(const char *s); |
| r243192 | r243193 | |
| 42 | 36 | #define utf8_from_tstring utf8_from_astring |
| 43 | 37 | #endif // UNICODE |
| 44 | 38 | |
| 45 | #if defined(SDLMAME_WIN32) | |
| 46 | #define _tcsncpy wcsncpy | |
| 47 | #endif | |
| 48 | ||
| 49 | 39 | #endif //SDLMAME_WIN32 |
| 50 | 40 | |
| 51 | ||
| 52 | #endif // __OSD_STRCONV__ | |
| 41 | #endif // __SDLSTRCONV__ |
| r243192 | r243193 | |
|---|---|---|
| 154 | 154 | |
| 155 | 155 | #if defined(SDLMAME_WIN32) |
| 156 | 156 | SDL_GetDesktopDisplayMode(monitor->handle, &dmode); |
| 157 | #else | |
| 158 | SDL_GetCurrentDisplayMode(monitor->handle, &dmode); | |
| 159 | #endif | |
| 157 | #else | |
| 158 | SDL_GetCurrentDisplayMode(monitor->handle, &dmode); | |
| 159 | #endif | |
| 160 | 160 | monitor->monitor_width = dmode.w; |
| 161 | 161 | monitor->monitor_height = dmode.h; |
| 162 | 162 | monitor->center_width = dmode.w; |
| r243192 | r243193 | |
| 227 | 227 | SDL_VideoDriverName(monitor->monitor_device, sizeof(monitor->monitor_device)-1); |
| 228 | 228 | if (first_call==0) |
| 229 | 229 | { |
| 230 | c | |
| 230 | char *dimstr = osd_getenv(SDLENV_DESKTOPDIM); | |
| 231 | 231 | const SDL_VideoInfo *sdl_vi; |
| 232 | 232 | |
| 233 | 233 | sdl_vi = SDL_GetVideoInfo(); |
| r243192 | r243193 | |
| 648 | 648 | stemp = options().video(); |
| 649 | 649 | if (strcmp(stemp, "auto") == 0) |
| 650 | 650 | { |
| 651 | #if | |
| 651 | #ifdef SDLMAME_MACOSX | |
| 652 | 652 | stemp = "opengl"; |
| 653 | 653 | #else |
| 654 | 654 | stemp = "soft"; |
| r243192 | r243193 | |
|---|---|---|
| 269 | 269 | /* We may want to set a number of the hints SDL2 provides. |
| 270 | 270 | * The code below will document which hints were set. |
| 271 | 271 | */ |
| 272 | const char * hints[] = { SDL_HINT_FRAMEBUFFER_ACCELERATION, | |
| 273 | SDL_HINT_RENDER_DRIVER, SDL_HINT_RENDER_OPENGL_SHADERS, | |
| 274 | SDL_HINT_RENDER_SCALE_QUALITY, | |
| 275 | SDL_HINT_RENDER_VSYNC, | |
| 276 | SDL_HINT_VIDEO_X11_XVIDMODE, SDL_HINT_VIDEO_X11_XINERAMA, | |
| 277 | SDL_HINT_VIDEO_X11_XRANDR, SDL_HINT_GRAB_KEYBOARD, | |
| 278 | SDL_HINT_MOUSE_RELATIVE_MODE_WARP, | |
| 279 | SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS, SDL_HINT_IDLE_TIMER_DISABLED, | |
| 280 | SDL_HINT_ORIENTATIONS, | |
| 281 | SDL_HINT_XINPUT_ENABLED, SDL_HINT_GAMECONTROLLERCONFIG, | |
| 282 | SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, SDL_HINT_ALLOW_TOPMOST, | |
| 283 | SDL_HINT_TIMER_RESOLUTION, | |
| 284 | #if SDL_VERSION_ATLEAST(2, 0, 2) | |
| 285 | SDL_HINT_RENDER_DIRECT3D_THREADSAFE, SDL_HINT_VIDEO_ALLOW_SCREENSAVER, | |
| 286 | SDL_HINT_ACCELEROMETER_AS_JOYSTICK, SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK, | |
| 287 | SDL_HINT_VIDEO_WIN_D3DCOMPILER, SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT, | |
| 288 | SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES, | |
| 289 | #endif | |
| 290 | #if SDL_VERSION_ATLEAST(2, 0, 3) | |
| 291 | SDL_HINT_RENDER_DIRECT3D11_DEBUG, SDL_HINT_VIDEO_HIGHDPI_DISABLED, | |
| 292 | SDL_HINT_WINRT_PRIVACY_POLICY_URL, SDL_HINT_WINRT_PRIVACY_POLICY_LABEL, | |
| 293 | SDL_HINT_WINRT_HANDLE_BACK_BUTTON, | |
| 294 | #endif | |
| 295 | NULL | |
| 296 | }; | |
| 272 | const char * hints[] = { SDL_HINT_RENDER_DRIVER, SDL_HINT_RENDER_OPENGL_SHADERS, | |
| 273 | SDL_HINT_RENDER_DIRECT3D_THREADSAFE, SDL_HINT_RENDER_SCALE_QUALITY, | |
| 274 | SDL_HINT_RENDER_VSYNC, SDL_HINT_VIDEO_ALLOW_SCREENSAVER, | |
| 275 | SDL_HINT_VIDEO_X11_XVIDMODE, SDL_HINT_VIDEO_X11_XINERAMA, | |
| 276 | SDL_HINT_VIDEO_X11_XRANDR, SDL_HINT_GRAB_KEYBOARD, | |
| 277 | SDL_HINT_MOUSE_RELATIVE_MODE_WARP, | |
| 278 | SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS, SDL_HINT_IDLE_TIMER_DISABLED, | |
| 279 | SDL_HINT_ORIENTATIONS, SDL_HINT_ACCELEROMETER_AS_JOYSTICK, | |
| 280 | SDL_HINT_XINPUT_ENABLED, SDL_HINT_GAMECONTROLLERCONFIG, | |
| 281 | SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, SDL_HINT_ALLOW_TOPMOST, | |
| 282 | SDL_HINT_TIMER_RESOLUTION, SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK, | |
| 283 | SDL_HINT_VIDEO_WIN_D3DCOMPILER, SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT, | |
| 284 | SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES, | |
| 285 | NULL | |
| 286 | }; | |
| 297 | 287 | |
| 298 | ||
| 299 | osd_printf_verbose("\nHints:\n"); | |
| 300 | for (int i = 0; hints[i] != NULL; i++) | |
| 301 | osd_printf_verbose("\t%-40s %s\n", hints[i], SDL_GetHint(hints[i])); | |
| 288 | osd_printf_verbose("\nHints:\n"); | |
| 289 | for (int i = 0; hints[i] != NULL; i++) | |
| 290 | osd_printf_verbose("\t%-40s %s\n", hints[i], SDL_GetHint(hints[i])); | |
| 302 | 291 | #endif |
| 303 | 292 | |
| 304 | 293 | // set up the window list |
| r243192 | r243193 | |
| 1018 | 1007 | |
| 1019 | 1008 | if (osd_event_wait(rendered_event, event_wait_ticks)) |
| 1020 | 1009 | { |
| 1021 | if ((!fullscreen()) || (video_config.switchres)) | |
| 1022 | { | |
| 1023 | blit_surface_size(width, height); | |
| 1024 | } | |
| 1025 | else | |
| 1026 | { | |
| 1027 | blit_surface_size(monitor()->center_width, monitor()->center_height); | |
| 1028 | } | |
| 1010 | if ((!fullscreen()) || (video_config.switchres)) | |
| 1011 | { | |
| 1012 | blit_surface_size(width, height); | |
| 1013 | } | |
| 1014 | else | |
| 1015 | { | |
| 1016 | blit_surface_size(monitor()->center_width, monitor()->center_height); | |
| 1017 | } | |
| 1029 | 1018 | |
| 1030 | 1019 | // ensure the target bounds are up-to-date, and then get the primitives |
| 1031 | | |
| 1020 | set_target_bounds(this); | |
| 1032 | 1021 | |
| 1033 | 1022 | render_primitive_list &primlist = target->get_primitives(); |
| 1034 | 1023 |
| r243192 | r243193 | |
|---|---|---|
| 61 | 61 | m_fullscreen = !video_config.windowed; |
| 62 | 62 | prescale = video_config.prescale; |
| 63 | 63 | |
| 64 | windowed_width = config->width; | |
| 65 | windowed_height = config->height; | |
| 64 | windowed_width = config->width; | |
| 65 | windowed_height = config->height; | |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | void video_window_update(running_machine &machine); |
| r243192 | r243193 | |
|---|---|---|
| 7 | 7 | //============================================================ |
| 8 | 8 | |
| 9 | 9 | // standard windows headers |
| 10 | #ifdef OSD_SDL | |
| 11 | #define _WIN32_WINNT 0x0400 | |
| 12 | #endif | |
| 13 | 10 | #define WIN32_LEAN_AND_MEAN |
| 14 | 11 | #include <windows.h> |
| 15 | 12 | #include <tchar.h> |
| r243192 | r243193 | |
| 37 | 34 | int i, rc; |
| 38 | 35 | char **utf8_argv; |
| 39 | 36 | |
| 40 | #ifdef OSD_SDL | |
| 41 | #ifdef MALLOC_DEBUG | |
| 42 | { | |
| 43 | extern int winalloc_in_main_code; | |
| 44 | winalloc_in_main_code = TRUE; | |
| 45 | #endif | |
| 46 | #endif | |
| 47 | ||
| 48 | 37 | /* convert arguments to UTF-8 */ |
| 49 | 38 | utf8_argv = (char **) malloc(argc * sizeof(*argv)); |
| 50 | 39 | if (utf8_argv == NULL) |
| r243192 | r243193 | |
| 64 | 53 | osd_free(utf8_argv[i]); |
| 65 | 54 | free(utf8_argv); |
| 66 | 55 | |
| 67 | #ifdef OSD_SDL | |
| 68 | #ifdef MALLOC_DEBUG | |
| 69 | { | |
| 70 | void check_unfreed_mem(void); | |
| 71 | check_unfreed_mem(); | |
| 72 | } | |
| 73 | winalloc_in_main_code = FALSE; | |
| 74 | } | |
| 75 | #endif | |
| 76 | #endif | |
| 77 | ||
| 78 | 56 | return rc; |
| 79 | 57 | } |
| r243192 | r243193 | |
|---|---|---|
| 1 | #ifndef __NETDEV_PCAP_H__ | |
| 2 | #define __NETDEV_PCAP_H__ | |
| 1 | #ifndef __NETDEV_H | |
| 2 | #define __NETDEV_H | |
| 3 | 3 | |
| 4 | 4 | void init_pcap(); |
| 5 | 5 | void deinit_pcap(); |
| r243192 | r243193 | |
|---|---|---|
| 6 | 6 | // |
| 7 | 7 | //============================================================ |
| 8 | 8 | |
| 9 | ||
| 9 | // standard windows headers | |
| 10 | 10 | #define WIN32_LEAN_AND_MEAN |
| 11 | 11 | #include <windows.h> |
| 12 | #endif | |
| 13 | 12 | |
| 14 | 13 | // MAMEOS headers |
| 15 | 14 | #include "strconv.h" |
| 16 | 15 | #include "unicode.h" |
| 17 | 16 | |
| 18 | ||
| 17 | ||
| 19 | 18 | //============================================================ |
| 20 | 19 | // astring_from_utf8 |
| 21 | 20 | //============================================================ |
| r243192 | r243193 | |
| 102 | 101 | |
| 103 | 102 | return result; |
| 104 | 103 | } |
| 105 | ||
| 106 | //============================================================ | |
| 107 | // osd_uchar_from_osdchar | |
| 108 | //============================================================ | |
| 109 | ||
| 110 | int osd_uchar_from_osdchar(UINT32 *uchar, const char *osdchar, size_t count) | |
| 111 | { | |
| 112 | WCHAR wch; | |
| 113 | ||
| 114 | count = MIN(count, IsDBCSLeadByte(*osdchar) ? 2 : 1); | |
| 115 | if (MultiByteToWideChar(CP_ACP, 0, osdchar, (DWORD)count, &wch, 1) != 0) | |
| 116 | *uchar = wch; | |
| 117 | else | |
| 118 | *uchar = 0; | |
| 119 | return (int) count; | |
| 120 | } | |
| 121 | ||
| 122 | #else | |
| 123 | ||
| 124 | //============================================================ | |
| 125 | // osd_uchar_from_osdchar | |
| 126 | //============================================================ | |
| 127 | ||
| 128 | int osd_uchar_from_osdchar(unicode_char *uchar, const char *osdchar, size_t count) | |
| 129 | { | |
| 130 | wchar_t wch; | |
| 131 | ||
| 132 | count = mbstowcs(&wch, (char *)osdchar, 1); | |
| 133 | if (count != -1) | |
| 134 | *uchar = wch; | |
| 135 | else | |
| 136 | *uchar = 0; | |
| 137 | ||
| 138 | return count; | |
| 139 | } | |
| 140 | ||
| 141 | #endif |
| r243192 | r243193 | |
|---|---|---|
| 2 | 2 | // copyright-holders:Aaron Giles |
| 3 | 3 | //============================================================ |
| 4 | 4 | // |
| 5 | // strconv.h - | |
| 5 | // strconv.h - Win32 string conversion | |
| 6 | 6 | // |
| 7 | // Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team. | |
| 8 | // Visit http://mamedev.org for licensing and usage restrictions. | |
| 9 | // | |
| 10 | 7 | //============================================================ |
| 11 | 8 | |
| 12 | #ifndef __OSD_STRCONV__ | |
| 13 | #define __OSD_STRCONV__ | |
| 9 | #ifndef __WIN_STRCONV__ | |
| 10 | #define __WIN_STRCONV__ | |
| 14 | 11 | |
| 15 | 12 | #include "osdcore.h" |
| 16 | 13 | |
| r243192 | r243193 | |
| 20 | 17 | // FUNCTION PROTOTYPES |
| 21 | 18 | //============================================================ |
| 22 | 19 | |
| 23 | #if defined(SDLMAME_WIN32) || defined(OSD_WINDOWS) | |
| 24 | ||
| 25 | #if defined(SDLMAME_WIN32) | |
| 26 | #define WIN32_LEAN_AND_MEAN | |
| 27 | #include <windows.h> | |
| 28 | #endif | |
| 29 | 20 | // the result of these functions has to be released with osd_free() |
| 30 | 21 | |
| 31 | 22 | CHAR *astring_from_utf8(const char *s); |
| r243192 | r243193 | |
| 42 | 33 | #define utf8_from_tstring utf8_from_astring |
| 43 | 34 | #endif // UNICODE |
| 44 | 35 | |
| 45 | #if defined(SDLMAME_WIN32) | |
| 46 | #define _tcsncpy wcsncpy | |
| 47 | #endif | |
| 48 | 36 | |
| 49 | #endif //SDLMAME_WIN32 | |
| 50 | 37 | |
| 51 | ||
| 52 | #endif // __OSD_STRCONV__ | |
| 38 | #endif // __WIN_STRCONV__ |
| r243192 | r243193 | |
|---|---|---|
| 25 | 25 | #define VS2008 0x00090000 |
| 26 | 26 | #define VS2010 0x00100000 |
| 27 | 27 | #define VS2012 0x00110000 |
| 28 | #define VS2013 0x00120000 | |
| 29 | 28 | |
| 30 | 29 | |
| 31 | 30 | |
| r243192 | r243193 | |
| 68 | 67 | { 0, "-fno-omit-frame-pointer", "" }, |
| 69 | 68 | { 0, "-fomit-frame-pointer", "" }, |
| 70 | 69 | { 0, "-Werror", "/WX" }, |
| 71 | // warning C4003: not enough actual parameters for macro 'xxx' | |
| 72 | // warning C4018: 'x' : signed/unsigned mismatch | |
| 73 | // warning C4061: enumerator 'xxx' in switch of enum 'xxx' is not explicitly handled by a case label | |
| 74 | // warning C4100: 'xxx' : unreferenced formal parameter | |
| 75 | // warning C4127: conditional expression is constant | |
| 76 | // warning C4131: 'xxx' : uses old-style declarator | |
| 77 | // warning C4141: 'xxx' : used more than once | |
| 78 | // warning C4146: unary minus operator applied to unsigned type, result still unsigned | |
| 79 | // warning C4150: deletion of pointer to incomplete type 'xxx'; no destructor called | |
| 80 | // warning C4189: 'xxx' : local variable is initialized but not referenced | |
| 81 | // warning C4201: nonstandard extension used : nameless struct/union | |
| 82 | // warning C4242: 'x' : conversion from 'xxx' to 'xxx', possible loss of data | |
| 83 | // warning C4244: 'argument' : conversion from 'xxx' to 'xxx', possible loss of data | |
| 84 | // warning C4250: 'xxx' : inherits 'xxx' via dominance | |
| 85 | // warning C4255: 'xxx' : no function prototype given: converting '()' to '(void)' | |
| 86 | // warning C4296: 'x' : expression is always false | |
| 87 | // warning C4310: cast truncates constant value | |
| 88 | // warning C4324: 'xxx' : structure was padded due to __declspec(align()) | |
| 89 | // warning C4347: behavior change: 'xxx' is called instead of 'xxx' // obsolete VS2005 - VS2010 only | |
| 90 | // warning C4435: 'xxx' : Object layout under /vd2 will change due to virtual base 'xxx' | |
| 91 | // warning C4510: 'xxx' : default constructor could not be generated | |
| 92 | // warning C4512: 'xxx' : assignment operator could not be generated | |
| 93 | // warning C4514: 'xxx' : unreferenced inline function has been removed | |
| 94 | // warning C4619: #pragma warning : there is no warning number 'xxx' | |
| 95 | // warning C4571: Informational: catch(...) semantics changed since Visual C++ 7.1; structured exceptions (SEH) are no longer caught | |
| 96 | // warning C4610: struct 'xxx' can never be instantiated - user defined constructor required | |
| 97 | // warning C4625: 'xxx' : copy constructor could not be generated because a base class copy constructor is inaccessible or deleted | |
| 98 | // warning C4626: 'xxx' : assignment operator could not be generated because a base class assignment operator is inaccessible or deleted | |
| 99 | // warning C4668: 'xxx' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif' | |
| 100 | // warning C4702: unreachable code | |
| 101 | // warning C4706: assignment within conditional expression | |
| 102 | // warning C4710: 'xxx' : function not inlined | |
| 103 | // warning C4711: function 'xxx' selected for automatic inline expansion // optimized only | |
| 104 | // warning C4805: 'x' : unsafe mix of type 'xxx' and type 'xxx' in operation | |
| 105 | // warning C4820: 'xxx' : 'x' bytes padding added after data member 'xxx' | |
| 106 | { VS7, "-Wall", "/Wall /W4 /wd4003 /wd4018 /wd4061 /wd4100 /wd4127 /wd4131 /wd4141 /wd4146 /wd4150 /wd4189 /wd4201 /wd4242 /wd4244 /wd4250 /wd4255 /wd4296 /wd4310 /wd4324 /wd4347 /wd4435 /wd4510 /wd4512 /wd4514 /wd4571 /wd4610 /wd4619 /wd4625 /wd4626 /wd4668 /wd4702 /wd4706 /wd4710 /wd4711 /wd4805 /wd4820" }, | |
| 70 | //{ VS7, "-Wall", "/Wall /W3 /wd4003 /wd4018 /wd4146 /wd4242 /wd4244 /wd4619 /wd4702 /wd4706 /wd4710 /wd4711 /wd4738 /wd4826" }, | |
| 71 | { VS7, "-Wall", "/Wall /W4 /wd4003 /wd4018 /wd4146 /wd4242 /wd4244 /wd4619 /wd4702 /wd4706 /wd4710 /wd4711 /wd4738 /wd4826 /wd4820 /wd4514 /wd4668 /wd4127 /wd4625 /wd4626 /wd4512 /wd4100 /wd4310 /wd4571 /wd4061 /wd4131 /wd4255 /wd4510 /wd4610 /wd4505 /wd4324 /wd4611 /wd4201 /wd4189 /wd4296 /wd4986 /wd4347 /wd4987 /wd4250 /wd4435 /wd4150 /wd4805 /wd4141" }, | |
| 107 | 72 | { 0, "-Wall", "/W0" }, |
| 108 | 73 | { VS7, "-Wno-unused", "/wd4100 /wd4101 /wd4102 /wd4505" }, |
| 109 | 74 | { 0, "-Wno-sign-compare", "/wd4365 /wd4389 /wd4245 /wd4388" }, |
| r243192 | r243193 | |
|---|---|---|
| 91 | 91 | $(OSDOBJ)/modules/sync \ |
| 92 | 92 | $(OSDOBJ)/modules/lib \ |
| 93 | 93 | $(OSDOBJ)/modules/midi \ |
| 94 | $(OSDOBJ)/modules/font \ | |
| 95 | 94 | |
| 96 | 95 | ifdef USE_QTDEBUG |
| 97 | 96 | OBJDIRS += $(OSDOBJ)/modules/debugger/qt |
| r243192 | r243193 | |
| 313 | 312 | |
| 314 | 313 | ifeq ($(CROSS_BUILD),1) |
| 315 | 314 | LDFLAGS += -static |
| 316 | endif | |
| 315 | endif | |
| 317 | 316 | |
| 318 | 317 | # TODO: needs to use $(CC) |
| 319 | 318 | TEST_GCC := $(shell gcc --version) |
| r243192 | r243193 | |
| 349 | 348 | $(WINOBJ)/strconv.o \ |
| 350 | 349 | $(WINOBJ)/windir.o \ |
| 351 | 350 | $(WINOBJ)/winfile.o \ |
| 351 | $(WINOBJ)/winmisc.o \ | |
| 352 | 352 | $(OSDOBJ)/modules/sync/sync_windows.o \ |
| 353 | 353 | $(WINOBJ)/winutf8.o \ |
| 354 | 354 | $(WINOBJ)/winutil.o \ |
| r243192 | r243193 | |
| 356 | 356 | $(WINOBJ)/winsocket.o \ |
| 357 | 357 | $(OSDOBJ)/modules/sync/work_osd.o \ |
| 358 | 358 | $(OSDOBJ)/modules/lib/osdlib_win32.o \ |
| 359 | $(OSDOBJ)/modules/osdmodule.o \ | |
| 360 | 359 | $(WINOBJ)/winptty.o \ |
| 361 | 360 | |
| 362 | 361 | |
| r243192 | r243193 | |
| 373 | 372 | $(WINOBJ)/drawnone.o \ |
| 374 | 373 | $(WINOBJ)/input.o \ |
| 375 | 374 | $(WINOBJ)/output.o \ |
| 376 | $(OSDOBJ)/modules/sound/js_sound.o \ | |
| 377 | $(OSDOBJ)/modules/sound/direct_sound.o \ | |
| 378 | $(OSDOBJ)/modules/sound/sdl_sound.o \ | |
| 379 | $(OSDOBJ)/modules/sound/none.o \ | |
| 375 | $(OSDOBJ)/modules/sound/direct_sound.o \ | |
| 380 | 376 | $(WINOBJ)/video.o \ |
| 381 | 377 | $(WINOBJ)/window.o \ |
| 382 | 378 | $(WINOBJ)/winmenu.o \ |
| 383 | 379 | $(WINOBJ)/winmain.o \ |
| 384 | 380 | $(OSDOBJ)/modules/midi/portmidi.o \ |
| 385 | 381 | $(OSDOBJ)/modules/lib/osdobj_common.o \ |
| 386 | $(OSDOBJ)/modules/font/font_sdl.o \ | |
| 387 | $(OSDOBJ)/modules/font/font_windows.o \ | |
| 388 | $(OSDOBJ)/modules/font/font_osx.o \ | |
| 389 | $(OSDOBJ)/modules/font/font_none.o \ | |
| 390 | 382 | |
| 391 | 383 | ifdef USE_SDL |
| 392 | 384 | OSDOBJS += \ |
| r243192 | r243193 | |
| 407 | 399 | |
| 408 | 400 | # add debug-specific files |
| 409 | 401 | OSDOBJS += \ |
| 410 | $(OSDOBJ)/modules/debugger/debugwin.o \ | |
| 411 | $(OSDOBJ)/modules/debugger/debugint.o \ | |
| 412 | $(OSDOBJ)/modules/debugger/debugqt.o \ | |
| 413 | $(OSDOBJ)/modules/debugger/none.o \ | |
| 402 | $(OSDOBJ)/modules/debugger/debugwin.o | |
| 414 | 403 | |
| 415 | 404 | # add a stub resource file |
| 416 | 405 | RESFILE = $(WINOBJ)/mame.res |
| r243192 | r243193 | |
| 423 | 412 | QT_LIBS := -L$(shell qmake -query QT_INSTALL_LIBS) |
| 424 | 413 | LIBS += $(QT_LIBS) -lqtmain -lQtGui4 -lQtCore4 |
| 425 | 414 | INCPATH += -I$(QT_INSTALL_HEADERS)/QtCore -I$(QT_INSTALL_HEADERS)/QtGui -I$(QT_INSTALL_HEADERS) |
| 415 | CFLAGS += -DUSE_QTDEBUG | |
| 426 | 416 | |
| 427 | 417 | MOC = @moc |
| 428 | 418 | $(OSDOBJ)/%.moc.c: $(OSDSRC)/%.h |
| 429 | 419 | $(MOC) $(INCPATH) $(DEFS) $< -o $@ |
| 430 | 420 | |
| 431 | 421 | OSDOBJS += \ |
| 422 | $(OSDOBJ)/modules/debugger/debugqt.o \ | |
| 432 | 423 | $(OSDOBJ)/modules/debugger/qt/debugqtview.o \ |
| 433 | 424 | $(OSDOBJ)/modules/debugger/qt/debugqtwindow.o \ |
| 434 | 425 | $(OSDOBJ)/modules/debugger/qt/debugqtlogwindow.o \ |
| r243192 | r243193 | |
|---|---|---|
| 383 | 383 | |
| 384 | 384 | |
| 385 | 385 | //============================================================ |
| 386 | // osd_uchar_from_osdchar | |
| 387 | //============================================================ | |
| 388 | ||
| 389 | int osd_uchar_from_osdchar(UINT32 *uchar, const char *osdchar, size_t count) | |
| 390 | { | |
| 391 | WCHAR wch; | |
| 392 | ||
| 393 | count = MIN(count, IsDBCSLeadByte(*osdchar) ? 2 : 1); | |
| 394 | if (MultiByteToWideChar(CP_ACP, 0, osdchar, (DWORD)count, &wch, 1) != 0) | |
| 395 | *uchar = wch; | |
| 396 | else | |
| 397 | *uchar = 0; | |
| 398 | return (int) count; | |
| 399 | } | |
| 400 | ||
| 401 | ||
| 402 | //============================================================ | |
| 386 | 403 | // create_path_recursive |
| 387 | 404 | //============================================================ |
| 388 | 405 |
| r243192 | r243193 | |
|---|---|---|
| 39 | 39 | #include "debugger.h" |
| 40 | 40 | #include "winfile.h" |
| 41 | 41 | |
| 42 | #include "modules/sound/direct_sound.h" | |
| 43 | #if (USE_SDL) | |
| 44 | #include "modules/sound/sdl_sound.h" | |
| 45 | #endif | |
| 46 | ||
| 47 | #include "modules/debugger/debugwin.h" | |
| 48 | ||
| 49 | #if (USE_QTDEBUG) | |
| 50 | #include "modules/debugger/debugqt.h" | |
| 51 | #endif | |
| 42 | 52 | #define DEBUG_SLOW_LOCKS 0 |
| 43 | 53 | |
| 54 | ||
| 44 | 55 | //************************************************************************** |
| 45 | 56 | // MACROS |
| 46 | 57 | //************************************************************************** |
| r243192 | r243193 | |
| 530 | 541 | } |
| 531 | 542 | |
| 532 | 543 | //============================================================ |
| 544 | // sound_register | |
| 545 | //============================================================ | |
| 546 | ||
| 547 | void windows_osd_interface::sound_register() | |
| 548 | { | |
| 549 | sound_options_add("dsound", OSD_SOUND_DIRECT_SOUND); | |
| 550 | #if (USE_SDL) | |
| 551 | sound_options_add("sdl", OSD_SOUND_SDL); | |
| 552 | #endif | |
| 553 | sound_options_add("auto", OSD_SOUND_DIRECT_SOUND); // making Direct Sound audio default one | |
| 554 | } | |
| 555 | ||
| 556 | ||
| 557 | //============================================================ | |
| 558 | // debugger_register | |
| 559 | //============================================================ | |
| 560 | ||
| 561 | void windows_osd_interface::debugger_register() | |
| 562 | { | |
| 563 | debugger_options_add("windows", OSD_DEBUGGER_WINDOWS); | |
| 564 | #if (USE_QTDEBUG) | |
| 565 | debugger_options_add("qt", OSD_DEBUGGER_QT); | |
| 566 | #endif | |
| 567 | debugger_options_add("auto", OSD_DEBUGGER_WINDOWS); // making windows debugger default one | |
| 568 | } | |
| 569 | ||
| 570 | //============================================================ | |
| 533 | 571 | // init |
| 534 | 572 | //============================================================ |
| 535 | 573 | |
| r243192 | r243193 | |
| 675 | 713 | winwindow_process_events(machine(), 0, 0); |
| 676 | 714 | } |
| 677 | 715 | |
| 716 | ||
| 717 | //------------------------------------------------- | |
| 718 | // font_open - attempt to "open" a handle to the | |
| 719 | // font with the given name | |
| 720 | //------------------------------------------------- | |
| 721 | ||
| 722 | osd_font *windows_osd_interface::font_open(const char *_name, int &height) | |
| 723 | { | |
| 724 | // accept qualifiers from the name | |
| 725 | astring name(_name); | |
| 726 | if (name == "default") name = "Tahoma"; | |
| 727 | bool bold = (name.replace(0, "[B]", "") + name.replace(0, "[b]", "") > 0); | |
| 728 | bool italic = (name.replace(0, "[I]", "") + name.replace(0, "[i]", "") > 0); | |
| 729 | ||
| 730 | // build a basic LOGFONT description of what we want | |
| 731 | LOGFONT logfont; | |
| 732 | logfont.lfHeight = DEFAULT_FONT_HEIGHT; | |
| 733 | logfont.lfWidth = 0; | |
| 734 | logfont.lfEscapement = 0; | |
| 735 | logfont.lfOrientation = 0; | |
| 736 | logfont.lfWeight = bold ? FW_BOLD : FW_MEDIUM; | |
| 737 | logfont.lfItalic = italic; | |
| 738 | logfont.lfUnderline = FALSE; | |
| 739 | logfont.lfStrikeOut = FALSE; | |
| 740 | logfont.lfCharSet = ANSI_CHARSET; | |
| 741 | logfont.lfOutPrecision = OUT_DEFAULT_PRECIS; | |
| 742 | logfont.lfClipPrecision = CLIP_DEFAULT_PRECIS; | |
| 743 | logfont.lfQuality = NONANTIALIASED_QUALITY; | |
| 744 | logfont.lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE; | |
| 745 | ||
| 746 | // copy in the face name | |
| 747 | TCHAR *face = tstring_from_utf8(name); | |
| 748 | _tcsncpy(logfont.lfFaceName, face, sizeof(logfont.lfFaceName) / sizeof(TCHAR)); | |
| 749 | logfont.lfFaceName[sizeof(logfont.lfFaceName) / sizeof(TCHAR) - 1] = 0; | |
| 750 | osd_free(face); | |
| 751 | ||
| 752 | // create the font | |
| 753 | height = logfont.lfHeight; | |
| 754 | osd_font *font = reinterpret_cast<osd_font *>(CreateFontIndirect(&logfont)); | |
| 755 | if (font == NULL) | |
| 756 | return NULL; | |
| 757 | ||
| 758 | // select it into a temp DC and get the real font name | |
| 759 | HDC dummyDC = CreateCompatibleDC(NULL); | |
| 760 | HGDIOBJ oldfont = SelectObject(dummyDC, reinterpret_cast<HGDIOBJ>(font)); | |
| 761 | TCHAR realname[100]; | |
| 762 | GetTextFace(dummyDC, ARRAY_LENGTH(realname), realname); | |
| 763 | SelectObject(dummyDC, oldfont); | |
| 764 | DeleteDC(dummyDC); | |
| 765 | ||
| 766 | // if it doesn't match our request, fail | |
| 767 | char *utf = utf8_from_tstring(realname); | |
| 768 | int result = core_stricmp(utf, name); | |
| 769 | osd_free(utf); | |
| 770 | ||
| 771 | // if we didn't match, nuke our font and fall back | |
| 772 | if (result != 0) | |
| 773 | { | |
| 774 | DeleteObject(reinterpret_cast<HFONT>(font)); | |
| 775 | font = NULL; | |
| 776 | } | |
| 777 | return font; | |
| 778 | } | |
| 779 | ||
| 780 | ||
| 781 | //------------------------------------------------- | |
| 782 | // font_close - release resources associated with | |
| 783 | // a given OSD font | |
| 784 | //------------------------------------------------- | |
| 785 | ||
| 786 | void windows_osd_interface::font_close(osd_font *font) | |
| 787 | { | |
| 788 | // delete the font ojbect | |
| 789 | if (font != NULL) | |
| 790 | DeleteObject(reinterpret_cast<HFONT>(font)); | |
| 791 | } | |
| 792 | ||
| 793 | ||
| 794 | //------------------------------------------------- | |
| 795 | // font_get_bitmap - allocate and populate a | |
| 796 | // BITMAP_FORMAT_ARGB32 bitmap containing the | |
| 797 | // pixel values rgb_t(0xff,0xff,0xff,0xff) | |
| 798 | // or rgb_t(0x00,0xff,0xff,0xff) for each | |
| 799 | // pixel of a black & white font | |
| 800 | //------------------------------------------------- | |
| 801 | ||
| 802 | bool windows_osd_interface::font_get_bitmap(osd_font *font, unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs) | |
| 803 | { | |
| 804 | // create a dummy DC to work with | |
| 805 | HDC dummyDC = CreateCompatibleDC(NULL); | |
| 806 | HGDIOBJ oldfont = SelectObject(dummyDC, reinterpret_cast<HGDIOBJ>(font)); | |
| 807 | ||
| 808 | // get the text metrics | |
| 809 | TEXTMETRIC metrics = { 0 }; | |
| 810 | GetTextMetrics(dummyDC, &metrics); | |
| 811 | ||
| 812 | // get the width of this character | |
| 813 | ABC abc; | |
| 814 | if (!GetCharABCWidths(dummyDC, chnum, chnum, &abc)) | |
| 815 | { | |
| 816 | abc.abcA = 0; | |
| 817 | abc.abcC = 0; | |
| 818 | GetCharWidth32(dummyDC, chnum, chnum, reinterpret_cast<LPINT>(&abc.abcB)); | |
| 819 | } | |
| 820 | width = abc.abcA + abc.abcB + abc.abcC; | |
| 821 | ||
| 822 | // determine desired bitmap size | |
| 823 | int bmwidth = (50 + abc.abcA + abc.abcB + abc.abcC + 50 + 31) & ~31; | |
| 824 | int bmheight = 50 + metrics.tmHeight + 50; | |
| 825 | ||
| 826 | // describe the bitmap we want | |
| 827 | BYTE bitmapinfodata[sizeof(BITMAPINFOHEADER) + 2 * sizeof(RGBQUAD)] = { 0 }; | |
| 828 | BITMAPINFO &info = *reinterpret_cast<BITMAPINFO *>(bitmapinfodata); | |
| 829 | info.bmiHeader.biSize = sizeof(info.bmiHeader); | |
| 830 | info.bmiHeader.biWidth = bmwidth; | |
| 831 | info.bmiHeader.biHeight = -bmheight; | |
| 832 | info.bmiHeader.biPlanes = 1; | |
| 833 | info.bmiHeader.biBitCount = 1; | |
| 834 | info.bmiHeader.biCompression = BI_RGB; | |
| 835 | info.bmiHeader.biSizeImage = 0; | |
| 836 | info.bmiHeader.biXPelsPerMeter = GetDeviceCaps(dummyDC, HORZRES) / GetDeviceCaps(dummyDC, HORZSIZE); | |
| 837 | info.bmiHeader.biYPelsPerMeter = GetDeviceCaps(dummyDC, VERTRES) / GetDeviceCaps(dummyDC, VERTSIZE); | |
| 838 | info.bmiHeader.biClrUsed = 0; | |
| 839 | info.bmiHeader.biClrImportant = 0; | |
| 840 | RGBQUAD col1 = info.bmiColors[0]; | |
| 841 | RGBQUAD col2 = info.bmiColors[1]; | |
| 842 | col1.rgbBlue = col1.rgbGreen = col1.rgbRed = 0x00; | |
| 843 | col2.rgbBlue = col2.rgbGreen = col2.rgbRed = 0xff; | |
| 844 | ||
| 845 | // create a DIB to render to | |
| 846 | BYTE *bits; | |
| 847 | HBITMAP dib = CreateDIBSection(dummyDC, &info, DIB_RGB_COLORS, reinterpret_cast<VOID **>(&bits), NULL, 0); | |
| 848 | HGDIOBJ oldbitmap = SelectObject(dummyDC, dib); | |
| 849 | ||
| 850 | // clear the bitmap | |
| 851 | int rowbytes = bmwidth / 8; | |
| 852 | memset(bits, 0, rowbytes * bmheight); | |
| 853 | ||
| 854 | // now draw the character | |
| 855 | WCHAR tempchar = chnum; | |
| 856 | SetTextColor(dummyDC, RGB(0xff,0xff,0xff)); | |
| 857 | SetBkColor(dummyDC, RGB(0x00,0x00,0x00)); | |
| 858 | ExtTextOutW(dummyDC, 50 + abc.abcA, 50, ETO_OPAQUE, NULL, &tempchar, 1, NULL); | |
| 859 | ||
| 860 | // characters are expected to be full-height | |
| 861 | rectangle actbounds; | |
| 862 | actbounds.min_y = 50; | |
| 863 | actbounds.max_y = 50 + metrics.tmHeight - 1; | |
| 864 | ||
| 865 | // determine the actual left of the character | |
| 866 | for (actbounds.min_x = 0; actbounds.min_x < rowbytes; actbounds.min_x++) | |
| 867 | { | |
| 868 | BYTE *offs = bits + actbounds.min_x; | |
| 869 | UINT8 summary = 0; | |
| 870 | for (int y = 0; y < bmheight; y++) | |
| 871 | summary |= offs[y * rowbytes]; | |
| 872 | if (summary != 0) | |
| 873 | { | |
| 874 | actbounds.min_x *= 8; | |
| 875 | if (!(summary & 0x80)) actbounds.min_x++; | |
| 876 | if (!(summary & 0xc0)) actbounds.min_x++; | |
| 877 | if (!(summary & 0xe0)) actbounds.min_x++; | |
| 878 | if (!(summary & 0xf0)) actbounds.min_x++; | |
| 879 | if (!(summary & 0xf8)) actbounds.min_x++; | |
| 880 | if (!(summary & 0xfc)) actbounds.min_x++; | |
| 881 | if (!(summary & 0xfe)) actbounds.min_x++; | |
| 882 | break; | |
| 883 | } | |
| 884 | } | |
| 885 | ||
| 886 | // determine the actual right of the character | |
| 887 | for (actbounds.max_x = rowbytes - 1; actbounds.max_x >= 0; actbounds.max_x--) | |
| 888 | { | |
| 889 | BYTE *offs = bits + actbounds.max_x; | |
| 890 | UINT8 summary = 0; | |
| 891 | for (int y = 0; y < bmheight; y++) | |
| 892 | summary |= offs[y * rowbytes]; | |
| 893 | if (summary != 0) | |
| 894 | { | |
| 895 | actbounds.max_x *= 8; | |
| 896 | if (summary & 0x7f) actbounds.max_x++; | |
| 897 | if (summary & 0x3f) actbounds.max_x++; | |
| 898 | if (summary & 0x1f) actbounds.max_x++; | |
| 899 | if (summary & 0x0f) actbounds.max_x++; | |
| 900 | if (summary & 0x07) actbounds.max_x++; | |
| 901 | if (summary & 0x03) actbounds.max_x++; | |
| 902 | if (summary & 0x01) actbounds.max_x++; | |
| 903 | break; | |
| 904 | } | |
| 905 | } | |
| 906 | ||
| 907 | // allocate a new bitmap | |
| 908 | if (actbounds.max_x >= actbounds.min_x && actbounds.max_y >= actbounds.min_y) | |
| 909 | { | |
| 910 | bitmap.allocate(actbounds.max_x + 1 - actbounds.min_x, actbounds.max_y + 1 - actbounds.min_y); | |
| 911 | ||
| 912 | // copy the bits into it | |
| 913 | for (int y = 0; y < bitmap.height(); y++) | |
| 914 | { | |
| 915 | UINT32 *dstrow = &bitmap.pix32(y); | |
| 916 | UINT8 *srcrow = &bits[(y + actbounds.min_y) * rowbytes]; | |
| 917 | for (int x = 0; x < bitmap.width(); x++) | |
| 918 | { | |
| 919 | int effx = x + actbounds.min_x; | |
| 920 | dstrow[x] = ((srcrow[effx / 8] << (effx % 8)) & 0x80) ? rgb_t(0xff,0xff,0xff,0xff) : rgb_t(0x00,0xff,0xff,0xff); | |
| 921 | } | |
| 922 | } | |
| 923 | ||
| 924 | // set the final offset values | |
| 925 | xoffs = actbounds.min_x - (50 + abc.abcA); | |
| 926 | yoffs = actbounds.max_y - (50 + metrics.tmAscent); | |
| 927 | } | |
| 928 | ||
| 929 | // de-select the font and release the DC | |
| 930 | SelectObject(dummyDC, oldbitmap); | |
| 931 | DeleteObject(dib); | |
| 932 | SelectObject(dummyDC, oldfont); | |
| 933 | DeleteDC(dummyDC); | |
| 934 | return bitmap.valid(); | |
| 935 | } | |
| 936 | ||
| 937 | ||
| 678 | 938 | //============================================================ |
| 679 | 939 | // winmain_dump_stack |
| 680 | 940 | //============================================================ |
| r243192 | r243193 | |
|---|---|---|
| 252 | 252 | // input overridables |
| 253 | 253 | virtual void customize_input_type_list(simple_list<input_type_entry> &typelist); |
| 254 | 254 | |
| 255 | // font overridables | |
| 256 | virtual osd_font *font_open(const char *name, int &height); | |
| 257 | virtual void font_close(osd_font *font); | |
| 258 | virtual bool font_get_bitmap(osd_font *font, unicode_char chnum, bitmap_argb32 &bitmap, INT32 &width, INT32 &xoffs, INT32 &yoffs); | |
| 259 | ||
| 255 | 260 | virtual void video_register(); |
| 261 | virtual void sound_register(); | |
| 262 | virtual void debugger_register(); | |
| 256 | 263 | |
| 257 | 264 | virtual bool video_init(); |
| 258 | 265 | virtual bool window_init(); |
| r0 | r243193 | |
|---|---|---|
| 1 | // license:BSD-3-Clause | |
| 2 | // copyright-holders:Aaron Giles | |
| 3 | //============================================================ | |
| 4 | // | |
| 5 | // winmisc.c - Win32 OSD core miscellaneous functions | |
| 6 | // | |
| 7 | //============================================================ | |
| 8 | ||
| 9 | // standard windows headers | |
| 10 | #define WIN32_LEAN_AND_MEAN | |
| 11 | #include <windows.h> | |
| 12 | #include <tchar.h> | |
| 13 | ||
| 14 | // MAME headers | |
| 15 | #include "osdcore.h" | |
| 16 | ||
| 17 | // MAMEOS headers | |
| 18 | #include "winutf8.h" | |
| 19 | #include "strconv.h" | |
| 20 | #include "strconv.h" | |
| 21 | ||
| 22 | ||
| 23 | //============================================================ | |
| 24 | // GLOBAL VARIABLES | |
| 25 | //============================================================ | |
| 26 | ||
| 27 | void (*s_debugger_stack_crawler)() = NULL; | |
| 28 | ||
| 29 | ||
| 30 | //============================================================ | |
| 31 | // osd_alloc_executable | |
| 32 | //============================================================ | |
| 33 | ||
| 34 | void *osd_alloc_executable(size_t size) | |
| 35 | { | |
| 36 | return VirtualAlloc(NULL, size, MEM_COMMIT, PAGE_EXECUTE_READWRITE); | |
| 37 | } | |
| 38 | ||
| 39 | ||
| 40 | //============================================================ | |
| 41 | // osd_free_executable | |
| 42 | //============================================================ | |
| 43 | ||
| 44 | void osd_free_executable(void *ptr, size_t size) | |
| 45 | { | |
| 46 | VirtualFree(ptr, 0, MEM_RELEASE); | |
| 47 | } | |
| 48 | ||
| 49 | ||
| 50 | //============================================================ | |
| 51 | // osd_break_into_debugger | |
| 52 | //============================================================ | |
| 53 | ||
| 54 | void osd_break_into_debugger(const char *message) | |
| 55 | { | |
| 56 | if (IsDebuggerPresent()) | |
| 57 | { | |
| 58 | win_output_debug_string_utf8(message); | |
| 59 | DebugBreak(); | |
| 60 | } | |
| 61 | else if (s_debugger_stack_crawler != NULL) | |
| 62 | (*s_debugger_stack_crawler)(); | |
| 63 | } |
| r243192 | r243193 | |
|---|---|---|
| 1702 | 1702 | report_error(1, "Invalid size string"); |
| 1703 | 1703 | } |
| 1704 | 1704 | } |
| 1705 | ||
| 1705 | ||
| 1706 | 1706 | // process compression |
| 1707 | 1707 | chd_codec_type compression[4]; |
| 1708 | 1708 | memcpy(compression, s_default_hd_compression, sizeof(compression)); |
| r243192 | r243193 | |
| 1757 | 1757 | if (sscanf(metadata, HARD_DISK_METADATA_FORMAT, &cylinders, &heads, §ors, §or_size) != 4) |
| 1758 | 1758 | report_error(1, "Error parsing hard disk metadata in parent CHD"); |
| 1759 | 1759 | } |
| 1760 | ||
| 1760 | ||
| 1761 | 1761 | // validate the size |
| 1762 | 1762 | if (filesize % sector_size != 0) |
| 1763 | 1763 | report_error(1, "Data size is not divisible by sector size %d", sector_size); |
| r243192 | r243193 | |
|---|---|---|
| 18 | 18 | #include "netlist/nl_base.h" |
| 19 | 19 | #include "netlist/nl_setup.h" |
| 20 | 20 | #include "netlist/nl_parser.h" |
| 21 | #include "netlist/nl_factory.h" | |
| 22 | 21 | #include "netlist/nl_util.h" |
| 23 | #include "netlist/devices/net_lib.h" | |
| 24 | 22 | #include "options.h" |
| 25 | 23 | |
| 26 | 24 | /*************************************************************************** |
| 27 | * MAME COMPATIBILITY ... | |
| 28 | * | |
| 29 | * These are needed if we link without libutil | |
| 30 | ***************************************************************************/ | |
| 25 | MAME COMPATIBILITY ... | |
| 26 | ***************************************************************************/ | |
| 31 | 27 | |
| 32 | 28 | #if 0 |
| 33 | 29 | void ATTR_PRINTF(1,2) osd_printf_warning(const char *format, ...) |
| r243192 | r243193 | |
| 39 | 35 | vprintf(format, argptr); |
| 40 | 36 | va_end(argptr); |
| 41 | 37 | } |
| 38 | #endif | |
| 42 | 39 | |
| 43 | 40 | void *malloc_file_line(size_t size, const char *file, int line) |
| 44 | 41 | { |
| r243192 | r243193 | |
| 75 | 72 | src_type.name(), dst_type.name()); |
| 76 | 73 | throw; |
| 77 | 74 | } |
| 78 | #endif | |
| 79 | 75 | |
| 80 | 76 | struct options_entry oplist[] = |
| 81 | 77 | { |
| r243192 | r243193 | |
| 87 | 83 | { NULL } |
| 88 | 84 | }; |
| 89 | 85 | |
| 90 | NETLIST_START(dummy) | |
| 91 | /* Standard stuff */ | |
| 92 | ||
| 93 | CLOCK(clk, 1000) // 1000 Hz | |
| 94 | SOLVER(Solver, 48000) | |
| 95 | ||
| 96 | NETLIST_END() | |
| 97 | ||
| 98 | 86 | /*************************************************************************** |
| 99 | 87 | CORE IMPLEMENTATION |
| 100 | 88 | ***************************************************************************/ |
| r243192 | r243193 | |
| 172 | 160 | nl_util::pstring_list ll = nl_util::split(m_logs, ":"); |
| 173 | 161 | for (int i=0; i < ll.count(); i++) |
| 174 | 162 | { |
| 163 | netlist_device_t *nc = m_setup->factory().new_device_by_classname("nld_log", *m_setup); | |
| 175 | 164 | pstring name = "log_" + ll[i]; |
| 176 | | |
| 165 | m_setup->register_dev(nc, name); | |
| 177 | 166 | m_setup->register_link(name + ".I", ll[i]); |
| 178 | 167 | } |
| 179 | 168 | } |
| r243192 | r243193 | |
| 241 | 230 | nt.init(); |
| 242 | 231 | const netlist_factory_t::list_t &list = nt.setup().factory().list(); |
| 243 | 232 | |
| 244 | netlist_sources_t sources; | |
| 245 | ||
| 246 | sources.add(netlist_source_t("dummy", &netlist_dummy)); | |
| 247 | sources.parse(nt.setup(),"dummy"); | |
| 248 | ||
| 249 | 233 | nt.setup().start_devices(); |
| 250 | 234 | nt.setup().resolve_inputs(); |
| 251 | 235 |
| r243192 | r243193 | |
|---|---|---|
| 8 | 8 | |
| 9 | 9 | ***************************************************************************/ |
| 10 | 10 | |
| 11 | #define BARE_BUILD_VERSION "0.15 | |
| 11 | #define BARE_BUILD_VERSION "0.157" | |
| 12 | 12 | |
| 13 | 13 | extern const char bare_build_version[]; |
| 14 | 14 | extern const char build_version[]; |
| https://github.com/mamedev/mame/commit/68c4c457464278b6b43716251793f70c25cdd8a5 |
| Previous | 199869 Revisions | Next |