| Previous | 199869 Revisions | Next |
| r34120 Wednesday 31st December, 2014 at 06:53:27 UTC by Miodrag Milanović |
|---|
| Cleanups and version bump |
| [hash] | adam_cass.xml adam_flop.xml apollo_ctape.xml archimedes.xml gamate.xml mtx_cass.xml n64.xml neogeo.xml nes.xml pico.xml sms.xml vz_cass.xml |
| [src] | version.c |
| [src/emu] | luaengine.c machine.c rendlay.c rendlay.h |
| [src/emu/bus/centronics] | epson_lx810l.c |
| [src/emu/bus/ieee488] | c8050fdc.c |
| [src/emu/bus/isa] | cga.c sc499.h |
| [src/emu/bus/sega8] | rom.c rom.h |
| [src/emu/cpu] | cpu.mak |
| [src/emu/cpu/arc] | arc.c arcdasm.c |
| [src/emu/cpu/arcompact] | arcompact.c arcompact.h arcompact_common.c arcompact_execute.c arcompactdasm.c arcompactdasm_dispatch.c arcompactdasm_dispatch.h arcompactdasm_ops.c arcompactdasm_ops.h |
| [src/emu/cpu/h8] | h8_timer16.c |
| [src/emu/cpu/m68000] | m68kcpu.c m68kdasm.c |
| [src/emu/cpu/pps4] | pps4.c pps4.h pps4dasm.c |
| [src/emu/cpu/sh2] | sh2comn.c |
| [src/emu/cpu/tms0980] | tms0980.c tms0980.h |
| [src/emu/machine] | am9517a.c e05a30.c i6300esb.c i82875p.h r10696.c r10696.h r10788.c r10788.h ra17xx.c ra17xx.h smpc.c steppers.c steppers.h |
| [src/emu/sound] | tms5110.c |
| [src/emu/video] | 315_5124.c stvvdp2.c tea1002.c |
| [src/lib/formats] | dcp_dsk.c dip_dsk.c fdd_dsk.c nfd_dsk.c victor9k_dsk.c |
| [src/mame] | mame.lst |
| [src/mame/drivers] | 5clown.c atvtrack.c barata.c bfm_sc1.c bfm_sc2.c bfm_sc4.c bfm_sc4h.c bwidow.c cps1.c cultures.c dreamwld.c ecoinfr.c f-32.c galpani2.c gts1.c gundealr.c igs009.c jpmimpct.c lindbergh.c maygay1b.c mjkjidai.c mpu3.c mpu4hw.c namcops2.c relief.c renegade.c sbrkout.c snowbros.c taito_f3.c tigeroad.c viper.c wallc.c yunsun16.c |
| [src/mame/includes] | asteroid.h bionicc.h galaxold.h renegade.h yunsun16.h zac2650.h zaccaria.h |
| [src/mame/machine] | atarigen.c |
| [src/mame/video] | chihiro.c galpani2.c segaic16.c tigeroad.c tigeroad_spr.c zac2650.c |
| [src/mess] | mess.mak |
| [src/mess/drivers] | amaztron.c bitgraph.c cnsector.c comp4.c ec184x.c excali64.c gamate.c hp16500.c hp9k_3xx.c intv.c leapster.c mathmagi.c mc1502.c megadriv.c merlin.c ngen.c simon.c starwbc.c stopthie.c tandy12.c ticalc1x.c tispeak.c trs80.c unk3403.c victor9k.c vt240.c |
| [src/mess/includes] | victor9k.h |
| [src/mess/layout] | starwbc.lay |
| [src/mess/machine] | gamecom.c ngen_kb.c sms.c victor9k_fdc.c victor9kb.c |
| [src/mess/video] | apple2.c maria.c |
| [src/osd/modules/debugger/qt] | debugqtdeviceswindow.c debugqtdeviceswindow.h |
| [src/osd/sdl] | input.c video.h window.c window.h |
| r242631 | r242632 | |
|---|---|---|
| 968 | 968 | </software> |
| 969 | 969 | |
| 970 | 970 | <!-- |
| 971 | <software name="macadam"> | |
| 972 | <description>MacADAM (Fra)</description> | |
| 973 | <year>1984</year> | |
| 974 | <publisher>CBS Loisors - Coleco of France</publisher> | |
| 971 | <software name="macadam"> | |
| 972 | <description>MacADAM (Fra)</description> | |
| 973 | <year>1984</year> | |
| 974 | <publisher>CBS Loisors - Coleco of France</publisher> | |
| 975 | 975 | |
| 976 | <part name="cass1" interface="adam_cass"> | |
| 977 | <dataarea name="cass" size="262144"> | |
| 978 | <rom name="macadam (1984) (cbs loisors - coleco of france).ddp" size="262144" crc="2fe95d33" sha1="e27e3515644c2fcd28b94b1aed69ae0b2cb76afc" offset="0" /> | |
| 979 | </dataarea> | |
| 980 | </part> | |
| 981 | </software> | |
| 976 | <part name="cass1" interface="adam_cass"> | |
| 977 | <dataarea name="cass" size="262144"> | |
| 978 | <rom name="macadam (1984) (cbs loisors - coleco of france).ddp" size="262144" crc="2fe95d33" sha1="e27e3515644c2fcd28b94b1aed69ae0b2cb76afc" offset="0" /> | |
| 979 | </dataarea> | |
| 980 | </part> | |
| 981 | </software> | |
| 982 | 982 | |
| 983 | <software name="macadama" cloneof="macadam"> | |
| 984 | <description>MacADAM (Fra, Alt)</description> | |
| 985 | <year>1984</year> | |
| 986 | <publisher>CBS Loisors - Coleco of France</publisher> | |
| 983 | <software name="macadama" cloneof="macadam"> | |
| 984 | <description>MacADAM (Fra, Alt)</description> | |
| 985 | <year>1984</year> | |
| 986 | <publisher>CBS Loisors - Coleco of France</publisher> | |
| 987 | 987 | |
| 988 | <part name="cass1" interface="adam_cass"> | |
| 989 | <dataarea name="cass" size="262144"> | |
| 990 | <rom name="macadam (1984) (cbs loisors - coleco of france) [a1].ddp" size="262144" crc="5288e332" sha1="4c1de35afefc356db7303f8f584946bbf0f7c528" offset="0" /> | |
| 991 | </dataarea> | |
| 992 | </part> | |
| 993 | </software> | |
| 988 | <part name="cass1" interface="adam_cass"> | |
| 989 | <dataarea name="cass" size="262144"> | |
| 990 | <rom name="macadam (1984) (cbs loisors - coleco of france) [a1].ddp" size="262144" crc="5288e332" sha1="4c1de35afefc356db7303f8f584946bbf0f7c528" offset="0" /> | |
| 991 | </dataarea> | |
| 992 | </part> | |
| 993 | </software> | |
| 994 | 994 | --> |
| 995 | 995 | |
| 996 | 996 |
| r242631 | r242632 | |
|---|---|---|
| 2 | 2 | <!DOCTYPE softwarelist SYSTEM "softwarelist.dtd"> |
| 3 | 3 | <softwarelist name="adam_flop" description="Coleco ADAM diskettes"> |
| 4 | 4 | |
| 5 | <!-- | |
| 5 | <!-- | |
| 6 | 6 | Thanks to SacNews.net for their very comprehensive software database! |
| 7 | ||
| 7 | ||
| 8 | 8 | TODO: |
| 9 | Add rest of images outside of TOSEC/SacNews databases | |
| 10 | Proper testing for correct info? (current info is just copy-pasted from filenames) | |
| 9 | Add rest of images outside of TOSEC/SacNews databases | |
| 10 | Proper testing for correct info? (current info is just copy-pasted from filenames) | |
| 11 | 11 | --> |
| 12 | ||
| 12 | ||
| 13 | 13 | <!-- EOS Drivers --> |
| 14 | 14 | |
| 15 | 15 | <software name="homeauto"> |
| r242631 | r242632 | |
| 841 | 841 | <dataarea name="flop" size="163840"> |
| 842 | 842 | <rom name="world geography (1985) (a-ware educational software) [a1].dsk" size="163840" crc="c7d26848" sha1="c9581253ac1de95bbb45092bf3aeaa932f4006d7" offset="0" /> |
| 843 | 843 | </dataarea> |
| 844 | </part> | |
| 844 | </part> | |
| 845 | 845 | </software> |
| 846 | 846 | |
| 847 | 847 | <!-- EOS Games --> |
| 848 | ||
| 848 | ||
| 849 | 849 | <software name="2010"> |
| 850 | 850 | <description>2010 - The Text Adventure Game</description> |
| 851 | 851 | <year>1984</year> |
| r242631 | r242632 | |
| 857 | 857 | </dataarea> |
| 858 | 858 | </part> |
| 859 | 859 | </software> |
| 860 | ||
| 860 | ||
| 861 | 861 | <software name="2010a" cloneof="2010"> |
| 862 | 862 | <description>2010 - The Text Adventure Game (Alt)</description> |
| 863 | 863 | <year>1984</year> |
| r242631 | r242632 | |
| 1083 | 1083 | <dataarea name="flop" size="163840"> |
| 1084 | 1084 | <rom name="adventure pack i (1984) (victory software) [a1].dsk" size="163840" crc="1754bbf4" sha1="a38a4ab0689917e66b3b6dda874f5a4f9ab9415a" offset="0" /> |
| 1085 | 1085 | </dataarea> |
| 1086 | </part> | |
| 1086 | </part> | |
| 1087 | 1087 | </software> |
| 1088 | 1088 | |
| 1089 | 1089 | <software name="advpak2v"> |
| r242631 | r242632 | |
| 2409 | 2409 | </part> |
| 2410 | 2410 | </software> |
| 2411 | 2411 | |
| 2412 | <!-- From NIAD's blog: | |
| 2412 | <!-- From NIAD's blog: | |
| 2413 | 2413 | Jeopardy for the ADAM Computer is in fact a finshed product which was copyrighted 1984, but for whatever reason (probably |
| 2414 | completed just prior to Coleco's announcement in Jan. '85 that they were abandoning the ColecoVision and ADAM), Coleco | |
| 2415 | decided not to release it commercially. They instead made it available to ADAM Users Groups circa 1985/1986 to share with | |
| 2416 | the ADAM Community with the requirement that all copyright information would be removed from the program. Because of | |
| 2417 | this requirement by Coleco, you will see multiple versions of Jeopardy available for download that have been hacked to | |
| 2418 | change two title screens. This hacking actually eliminated the first title screen and then replaced the copyright information on | |
| 2414 | completed just prior to Coleco's announcement in Jan. '85 that they were abandoning the ColecoVision and ADAM), Coleco | |
| 2415 | decided not to release it commercially. They instead made it available to ADAM Users Groups circa 1985/1986 to share with | |
| 2416 | the ADAM Community with the requirement that all copyright information would be removed from the program. Because of | |
| 2417 | this requirement by Coleco, you will see multiple versions of Jeopardy available for download that have been hacked to | |
| 2418 | change two title screens. This hacking actually eliminated the first title screen and then replaced the copyright information on | |
| 2419 | 2419 | the second. |
| 2420 | When the original Jeopardy program was copied from data pack (256K max size) to disk (160K max size) a portion of the | |
| 2421 | program that contained game play data/questions was lost to the ages. This disk version which floated around for a while | |
| 2422 | would eventually crash due to the missing data, but this was later patched by Walters Software Co.'s Jim Walters to recycle to | |
| 2420 | When the original Jeopardy program was copied from data pack (256K max size) to disk (160K max size) a portion of the | |
| 2421 | program that contained game play data/questions was lost to the ages. This disk version which floated around for a while | |
| 2422 | would eventually crash due to the missing data, but this was later patched by Walters Software Co.'s Jim Walters to recycle to | |
| 2423 | 2423 | the beginning of the questions. |
| 2424 | 2424 | |
| 2425 | In 1992, a member of NIAD had the tremendous fortune to come in contact with a former Coleco employee who was looking | |
| 2426 | to sell off his entire lot of ADAM gear... a number of never before seen hardware and software protos included. In this lot was | |
| 2427 | [...] a 2-disk version of Jeopardy. I have not tested this 2-disk version thoroughly, but it does seem to work properly and | |
| 2428 | should be the version that you use as more than likely it is the complete version that would have been released for | |
| 2429 | commercial sale. | |
| 2425 | In 1992, a member of NIAD had the tremendous fortune to come in contact with a former Coleco employee who was looking | |
| 2426 | to sell off his entire lot of ADAM gear... a number of never before seen hardware and software protos included. In this lot was | |
| 2427 | [...] a 2-disk version of Jeopardy. I have not tested this 2-disk version thoroughly, but it does seem to work properly and | |
| 2428 | should be the version that you use as more than likely it is the complete version that would have been released for | |
| 2429 | commercial sale. | |
| 2430 | 2430 | --> |
| 2431 | 2431 | |
| 2432 | 2432 | <software name="jeopardy"> |
| r242631 | r242632 | |
| 3195 | 3195 | <dataarea name="flop" size="163840"> |
| 3196 | 3196 | <rom name="robothief (1991) (steve pitman software) [a1].dsk" size="163840" crc="8df50a33" sha1="69fde2a68c6c22ae268a209bc9054f6e7206c541" offset="0" /> |
| 3197 | 3197 | </dataarea> |
| 3198 | </part> | |
| 3198 | </part> | |
| 3199 | 3199 | </software> |
| 3200 | 3200 | |
| 3201 | 3201 | <software name="rubychal"> |
| r242631 | r242632 | |
| 3450 | 3450 | </part> |
| 3451 | 3451 | </software> |
| 3452 | 3452 | |
| 3453 | <!-- From NIAD's blog: | |
| 3454 | The original prototype/demo/unreleased version as was obtained from Epyx was indeed buggy, but this mainly dealt with the | |
| 3455 | inability to get it working on a disk, it was originally supplied on data pack, the save feature was a mess and there were a | |
| 3456 | number of menu (especially at the start of the game) that were messed up. A programmer by the name of Joe Waters spent | |
| 3457 | considerable time fixing these issues or most of them to get it to the state we now know. He actually lived in Albuquerque and | |
| 3458 | released software for the ADAM under the Federation Software label and did the Temple hack and some others under the | |
| 3453 | <!-- From NIAD's blog: | |
| 3454 | The original prototype/demo/unreleased version as was obtained from Epyx was indeed buggy, but this mainly dealt with the | |
| 3455 | inability to get it working on a disk, it was originally supplied on data pack, the save feature was a mess and there were a | |
| 3456 | number of menu (especially at the start of the game) that were messed up. A programmer by the name of Joe Waters spent | |
| 3457 | considerable time fixing these issues or most of them to get it to the state we now know. He actually lived in Albuquerque and | |
| 3458 | released software for the ADAM under the Federation Software label and did the Temple hack and some others under the | |
| 3459 | 3459 | Falcon Federation Hack Group (or something like that) label. |
| 3460 | 3460 | --> |
| 3461 | 3461 | <software name="apshai"> |
| r242631 | r242632 | |
| 4000 | 4000 | </software> |
| 4001 | 4001 | |
| 4002 | 4002 | <!-- EOS Graphics Design --> |
| 4003 | ||
| 4003 | ||
| 4004 | 4004 | <software name="adamgfx"> |
| 4005 | 4005 | <description>ADAM Graphics</description> |
| 4006 | 4006 | <year>199?</year> |
| r242631 | r242632 | |
| 5421 | 5421 | </software> |
| 5422 | 5422 | |
| 5423 | 5423 | <!-- EOS Productivity --> |
| 5424 | ||
| 5424 | ||
| 5425 | 5425 | <software name="atgradeb"> |
| 5426 | 5426 | <description>A-Tech Gradebook</description> |
| 5427 | 5427 | <year>198?</year> |
| r242631 | r242632 | |
| 5433 | 5433 | </dataarea> |
| 5434 | 5434 | </part> |
| 5435 | 5435 | </software> |
| 5436 | ||
| 5436 | ||
| 5437 | 5437 | <software name="atgradeba" cloneof="atgradeb"> |
| 5438 | 5438 | <description>A-Tech Gradebook (Alt)</description> |
| 5439 | 5439 | <year>198?</year> |
| r242631 | r242632 | |
| 5467 | 5467 | <dataarea name="flop" size="163840"> |
| 5468 | 5468 | <rom name="adam agenda - the personal schedule keeper (198x) (jeff harris) [a1].dsk" size="163840" crc="057fd444" sha1="21b76438a43a4e19a1b996789f2073cf25654a19" offset="0" /> |
| 5469 | 5469 | </dataarea> |
| 5470 | </part> | |
| 5470 | </part> | |
| 5471 | 5471 | </software> |
| 5472 | 5472 | |
| 5473 | 5473 | <software name="fbanalyz"> |
| r242631 | r242632 | |
| 7231 | 7231 | |
| 7232 | 7232 | |
| 7233 | 7233 | <!-- EOS Programming --> |
| 7234 | ||
| 7234 | ||
| 7235 | 7235 | <software name="adambas"> |
| 7236 | 7236 | <description>ADAM Basic (v1.6)</description> |
| 7237 | 7237 | <year>198?</year> |
| r242631 | r242632 | |
| 7842 | 7842 | </dataarea> |
| 7843 | 7843 | </part> |
| 7844 | 7844 | </software> |
| 7845 | ||
| 7845 | ||
| 7846 | 7846 | <software name="smartlog"> |
| 7847 | 7847 | <description>SmartLOGO</description> |
| 7848 | 7848 | <year>1984</year> |
| r242631 | r242632 | |
| 7854 | 7854 | </dataarea> |
| 7855 | 7855 | </part> |
| 7856 | 7856 | </software> |
| 7857 | ||
| 7857 | ||
| 7858 | 7858 | <software name="smartloga" cloneof="smartlog"> |
| 7859 | 7859 | <description>SmartLOGO (Alt)</description> |
| 7860 | 7860 | <year>1984</year> |
| r242631 | r242632 | |
| 7866 | 7866 | </dataarea> |
| 7867 | 7867 | </part> |
| 7868 | 7868 | </software> |
| 7869 | ||
| 7869 | ||
| 7870 | 7870 | <software name="smartlogb" cloneof="smartlog"> |
| 7871 | 7871 | <description>SmartLOGO (Alt 2)</description> |
| 7872 | 7872 | <year>1984</year> |
| r242631 | r242632 | |
| 8015 | 8015 | </dataarea> |
| 8016 | 8016 | </part> |
| 8017 | 8017 | </software> |
| 8018 | ||
| 8018 | ||
| 8019 | 8019 | <software name="anetdata"> |
| 8020 | 8020 | <description>A-Net ADAM BBS - Data Files</description> |
| 8021 | 8021 | <year>1990</year> |
| r242631 | r242632 | |
| 9816 | 9816 | <dataarea name="flop" size="163840"> |
| 9817 | 9817 | <rom name="turbodisk v1.0 (1987) (digital express inc.) [a1].dsk" size="163840" crc="bf60a7bb" sha1="ca04851345a882589f1b8d97b11df1643ad4e947" offset="0" /> |
| 9818 | 9818 | </dataarea> |
| 9819 | </part> | |
| 9819 | </part> | |
| 9820 | 9820 | </software> |
| 9821 | 9821 | |
| 9822 | 9822 | <software name="turbload"> |
| r242631 | r242632 | |
| 9936 | 9936 | <dataarea name="flop" size="163840"> |
| 9937 | 9937 | <rom name="xrampak i (1987) (digital express inc.) [a1].dsk" size="163840" crc="dc40400b" sha1="aeebdcf76d6fd369fe1720b0a57a48089ac8e050" offset="0" /> |
| 9938 | 9938 | </dataarea> |
| 9939 | </part> | |
| 9939 | </part> | |
| 9940 | 9940 | </software> |
| 9941 | 9941 | |
| 9942 | 9942 | <!-- EOS Public Domain - ADAMLand --> |
| r242631 | r242632 | |
| 9966 | 9966 | </software> |
| 9967 | 9967 | |
| 9968 | 9968 | <!-- EOS Public Domain - ADAM Users Group --> |
| 9969 | ||
| 9969 | ||
| 9970 | 9970 | <software name="augutils"> |
| 9971 | 9971 | <description>A.U.G. - Utilities</description> |
| 9972 | 9972 | <year>198?</year> |
| r242631 | r242632 | |
| 12328 | 12328 | </software> |
| 12329 | 12329 | |
| 12330 | 12330 | <!-- EOS Public Domain - Nibbles & Bits --> |
| 12331 | ||
| 12331 | ||
| 12332 | 12332 | <software name="nbbas01"> |
| 12333 | 12333 | <description>N&B - Basic Vol. #01</description> |
| 12334 | 12334 | <year>198?</year> |
| r242631 | r242632 | |
| 13582 | 13582 | </software> |
| 13583 | 13583 | |
| 13584 | 13584 | <!-- EOS Public Domain - Puget Sound ADAM Network --> |
| 13585 | ||
| 13585 | ||
| 13586 | 13586 | <software name="psanutil"> |
| 13587 | 13587 | <description>P.S.A.N. - Utilities</description> |
| 13588 | 13588 | <year>198?</year> |
| r242631 | r242632 | |
| 13807 | 13807 | </software> |
| 13808 | 13808 | |
| 13809 | 13809 | <!-- CP/M Drivers --> |
| 13810 | ||
| 13810 | ||
| 13811 | 13811 | <software name="evecpm"> |
| 13812 | 13812 | <description>EVE CP/M Utilities</description> |
| 13813 | 13813 | <year>198?</year> |
| r242631 | r242632 | |
| 13846 | 13846 | |
| 13847 | 13847 | <!-- CP/M Games --> |
| 13848 | 13848 | |
| 13849 | <!-- This is a collection of Scott Adams' adventures --> | |
| 13849 | <!-- This is a collection of Scott Adams' adventures --> | |
| 13850 | 13850 | <software name="adventur"> |
| 13851 | 13851 | <description>Adventure (Scott Adams)</description> |
| 13852 | 13852 | <year>198?</year> |
| r242631 | r242632 | |
| 14269 | 14269 | </software> |
| 14270 | 14270 | |
| 14271 | 14271 | <!-- CP/M Public Domain - Misc --> |
| 14272 | ||
| 14272 | ||
| 14273 | 14273 | <software name="cpmpd01"> |
| 14274 | 14274 | <description>CP-M 2.2 or T-DOS P.D. Vol. #01</description> |
| 14275 | 14275 | <year>198?</year> |
| r242631 | r242632 | |
| 14331 | 14331 | </software> |
| 14332 | 14332 | |
| 14333 | 14333 | <!-- CP/M Public Domain - Northern Illiana ADAM User's Group --> |
| 14334 | ||
| 14334 | ||
| 14335 | 14335 | <software name="cndv01"> |
| 14336 | 14336 | <description>N.I.A.D. - CP/M CNDV #01</description> |
| 14337 | 14337 | <year>198?</year> |
| r242631 | r242632 | |
| 15111 | 15111 | </software> |
| 15112 | 15112 | |
| 15113 | 15113 | <!-- CP/M PrintMaster Artwork --> |
| 15114 | ||
| 15114 | ||
| 15115 | 15115 | <software name="printm01"> |
| 15116 | 15116 | <description>PrintMaster Artwork - ADAMGR01</description> |
| 15117 | 15117 | <year>198?</year> |
| r242631 | r242632 | |
| 15869 | 15869 | </software> |
| 15870 | 15870 | |
| 15871 | 15871 | <!-- CP/M Productivity --> |
| 15872 | ||
| 15872 | ||
| 15873 | 15873 | <software name="abovepls"> |
| 15874 | 15874 | <description>Above Plus</description> |
| 15875 | 15875 | <year>198?</year> |
| r242631 | r242632 | |
| 16046 | 16046 | </software> |
| 16047 | 16047 | |
| 16048 | 16048 | <!-- CP/M Programming --> |
| 16049 | ||
| 16049 | ||
| 16050 | 16050 | <software name="dazzstar"> |
| 16051 | 16051 | <description>DazzleStar Disassembler</description> |
| 16052 | 16052 | <year>1986</year> |
| r242631 | r242632 | |
| 16194 | 16194 | </software> |
| 16195 | 16195 | |
| 16196 | 16196 | <!-- CP/M Utilities --> |
| 16197 | ||
| 16197 | ||
| 16198 | 16198 | <software name="1kutils"> |
| 16199 | 16199 | <description>1K Utilities</description> |
| 16200 | 16200 | <year>198?</year> |
| r242631 | r242632 | |
| 16256 | 16256 | </software> |
| 16257 | 16257 | |
| 16258 | 16258 | <!-- ADAM News Network --> |
| 16259 | ||
| 16259 | ||
| 16260 | 16260 | <software name="ann9103"> |
| 16261 | 16261 | <description>ANN Disk - 1991-03 - E.O.S. Files</description> |
| 16262 | 16262 | <year>1991</year> |
| r242631 | r242632 | |
|---|---|---|
| 3 | 3 | |
| 4 | 4 | <!-- Domain/OS Known Undumped Versions (from http://www.hpmuseum.net/exhibit.php?swc=24) |
| 5 | 5 | |
| 6 | Domain/OS SR10.3 (1990) Product Number 018847 + 018848 | |
| 7 | Domain/OS Quarterly PSK Q3-91 SR10.3 (1991) Product Number 19437 + 19439 | |
| 6 | Domain/OS SR10.3 (1990) Product Number 018847 + 018848 | |
| 7 | Domain/OS Quarterly PSK Q3-91 SR10.3 (1991) Product Number 19437 + 19439 | |
| 8 | 8 | |
| 9 | 9 | --> |
| 10 | 10 |
| r242631 | r242632 | |
|---|---|---|
| 786 | 786 | <dataarea name="flop" size="819200"> |
| 787 | 787 | <rom name="enigma (1993)(archimedes world)[a].adf" size="819200" crc="9277d658" sha1="2bdd2d1f53ee5f359f12adb8b20e915d12978de0" offset="0" /> |
| 788 | 788 | </dataarea> |
| 789 | </part> | |
| 789 | </part> | |
| 790 | 790 | </software> |
| 791 | 791 | |
| 792 | 792 | <software name="enigmab" cloneof="enigma" supported="no"> |
| r242631 | r242632 | |
| 1075 | 1075 | <dataarea name="flop" size="819200"> |
| 1076 | 1076 | <rom name="mad professor mariarti (1990)(krisalis)[a].adf" size="819200" crc="020e0e93" sha1="e64f832705c6923edcec7e85df4cceafe30b817e" offset="0" /> |
| 1077 | 1077 | </dataarea> |
| 1078 | </part> | |
| 1078 | </part> | |
| 1079 | 1079 | </software> |
| 1080 | 1080 | |
| 1081 | 1081 | <software name="mariartib" cloneof="mariarti" supported="no"> |
| r242631 | r242632 | |
| 1504 | 1504 | <dataarea name="flop" size="819200"> |
| 1505 | 1505 | <rom name="super pool (1991)(fourth dimension)[a].adf" size="819200" crc="8fa28978" sha1="10d451076f38ab48e4b9bd754fdcb4c634935c36" offset="0" /> |
| 1506 | 1506 | </dataarea> |
| 1507 | </part> | |
| 1507 | </part> | |
| 1508 | 1508 | </software> |
| 1509 | 1509 | |
| 1510 | 1510 | <software name="suprpoolb" cloneof="suprpool" supported="no"> |
| r242631 | r242632 | |
| 1769 | 1769 | </dataarea> |
| 1770 | 1770 | </part> |
| 1771 | 1771 | </software> |
| 1772 | ||
| 1773 | 1772 | |
| 1773 | ||
| 1774 | 1774 | <!-- Other disks to sort (homebrew?!?) --> |
| 1775 | 1775 | |
| 1776 | 1776 | <software name="3dtanks" supported="no"> |
| r242631 | r242632 | |
| 2001 | 2001 | <dataarea name="flop" size="819200"> |
| 2002 | 2002 | <rom name="hacker, the v3.05 (1993)(doggysoft)[a].adf" size="819200" crc="c6a88514" sha1="b02d6495f6a9a1099cb06cac7d0e0d1756f175a0" offset="0" /> |
| 2003 | 2003 | </dataarea> |
| 2004 | </part> | |
| 2004 | </part> | |
| 2005 | 2005 | </software> |
| 2006 | 2006 | |
| 2007 | 2007 | <software name="hackerb" cloneof="hacker" supported="no"> |
| r242631 | r242632 | |
| 2213 | 2213 | <dataarea name="flop" size="820224"> |
| 2214 | 2214 | <rom name="acorn archimedes risc os application suite v1.00 (19xx)(acorn)(disk 2 of 2)[req risc os].adf" size="820224" crc="d5fdf2ca" sha1="bfc96eff8cab5b61f6db82dd135dd95b32f40d4f" offset="0" /> |
| 2215 | 2215 | </dataarea> |
| 2216 | </part> | |
| 2216 | </part> | |
| 2217 | 2217 | </software> |
| 2218 | 2218 | |
| 2219 | 2219 | <software name="riscappsa" cloneof="riscapps" supported="no"> |
| r242631 | r242632 | |
|---|---|---|
| 1 | 1 | <?xml version="1.0"?> |
| 2 | 2 | <!DOCTYPE softwarelist SYSTEM "softwarelist.dtd"> |
| 3 | 3 | |
| 4 | <!-- | |
| 4 | <!-- | |
| 5 | 5 | Undumped carts, based on Wikipedia list |
| 6 | 6 | C1010 - Bump N' Run (Unreleased?) |
| 7 | 7 | C1016 - Volcano Panic |
| r242631 | r242632 | |
|---|---|---|
| 3 | 3 | |
| 4 | 4 | <softwarelist name="mtx_cass" description="Memotech MTX cassettes"> |
| 5 | 5 | |
| 6 | <!-- | |
| 6 | <!-- | |
| 7 | 7 | TODO: find out why the driver does not recognize the program on the tapes... |
| 8 | 8 | --> |
| 9 | 9 |
| r242631 | r242632 | |
|---|---|---|
| 3109 | 3109 | <!-- |
| 3110 | 3110 | Note from marshallh about the dongle present in the Rare proto/demo above |
| 3111 | 3111 | "The dongle is a pass-through, except that there is an Altera |
| 3112 | MAX7000 series CPLD intercepting the AD16 bus. This lets | |
| 3113 | all normal bus transactions through, but in the special case | |
| 3112 | MAX7000 series CPLD intercepting the AD16 bus. This lets | |
| 3113 | all normal bus transactions through, but in the special case | |
| 3114 | 3114 | mentioned below, takes control of the bus and gives its own data." |
| 3115 | 3115 | |
| 3116 | 3116 | We currently don't emulate this, and thus we include also versions where the dongle checks have been |
| r242631 | r242632 | |
|---|---|---|
| 438 | 438 | <dataarea name="mcu" size="0x2000"> |
| 439 | 439 | <!-- Hitachi HD6301V1 MCU --> |
| 440 | 440 | <rom offset="0x000000" size="0x02000" name="rhcom.bin" crc="e5cd6306" sha1="f6bbb8ae562804d67e137290c765c3589fa334c0" /> |
| 441 | ||
| 441 | <!-- dumped from a prototype with external ROM, not 100% confirmed as being the same on a final, or other games (lbowling, trally) --> | |
| 442 | 442 | </dataarea> |
| 443 | 443 | <dataarea name="fixed" size="0x040000"> |
| 444 | 444 | <rom offset="0x000000" size="0x020000" name="006-s1.s1" crc="eb5189f0" sha1="0239c342ea62e73140a2306052f226226461a478" /> |
| r242631 | r242632 | |
| 491 | 491 | <dataarea name="mcu" size="0x2000"> |
| 492 | 492 | <!-- Hitachi HD6301V1 MCU --> |
| 493 | 493 | <rom offset="0x000000" size="0x02000" name="rhcom.bin" crc="e5cd6306" sha1="f6bbb8ae562804d67e137290c765c3589fa334c0" /> |
| 494 | ||
| 494 | <!-- dumped from a prototype with external ROM, not 100% confirmed as being the same on a final, or other games (lbowling, trally) --> | |
| 495 | 495 | </dataarea> |
| 496 | 496 | <dataarea name="fixed" size="0x040000"> |
| 497 | 497 | <rom offset="0x000000" size="0x020000" name="006-s1.s1" crc="eb5189f0" sha1="0239c342ea62e73140a2306052f226226461a478" /> |
| r242631 | r242632 | |
|---|---|---|
| 76632 | 76632 | <year>19??</year> |
| 76633 | 76633 | <publisher><pirate></publisher> |
| 76634 | 76634 | <part name="cart" interface="nes_cart"> |
| 76635 | <feature name="slot" value="bmc_hik300" /> | |
| 76635 | <feature name="slot" value="bmc_hik300" /> <!-- mapper says 217 but it's not gc6in1 either! --> | |
| 76636 | 76636 | <dataarea name="chr" size="65536"> |
| 76637 | 76637 | <rom name="500-in-1 (anim splash, no rev, alt mapper)[p1][!].chr" size="65536" crc="25bdd64a" sha1="1f95eaf20fec9058b6917aa47dbdcec4b7a5b87d" offset="00000" status="baddump" /> |
| 76638 | 76638 | </dataarea> |
| r242631 | r242632 | |
| 76647 | 76647 | <year>19??</year> |
| 76648 | 76648 | <publisher><pirate></publisher> |
| 76649 | 76649 | <part name="cart" interface="nes_cart"> |
| 76650 | <feature name="slot" value="bmc_hik300" /> | |
| 76650 | <feature name="slot" value="bmc_hik300" /> <!-- mapper says 217 but it's not gc6in1 either! --> | |
| 76651 | 76651 | <dataarea name="chr" size="65536"> |
| 76652 | 76652 | <rom name="500-in-1 (static splash, no rev, alt mapper)[p1][!].chr" size="65536" crc="e7dacb8a" sha1="ece1b9c7fd8be955a1df6c8505533b4fac194eeb" offset="00000" status="baddump" /> |
| 76653 | 76653 | </dataarea> |
| r242631 | r242632 | |
| 77576 | 77576 | <year>19??</year> |
| 77577 | 77577 | <publisher><pirate></publisher> |
| 77578 | 77578 | <part name="cart" interface="nes_cart"> |
| 77579 | <feature name="slot" value="bmc_hik300" /> | |
| 77579 | <feature name="slot" value="bmc_hik300" /> <!-- mapper says 217 but it's not gc6in1 either! --> | |
| 77580 | 77580 | <dataarea name="chr" size="65536"> |
| 77581 | 77581 | <rom name="9999999-in-1 (static splash, no rev, alt mapper)[p1][!].chr" size="65536" crc="25bdd64a" sha1="1f95eaf20fec9058b6917aa47dbdcec4b7a5b87d" offset="00000" status="baddump" /> |
| 77582 | 77582 | </dataarea> |
| r242631 | r242632 | |
|---|---|---|
| 736 | 736 | <publisher>Samsung</publisher> |
| 737 | 737 | <info name="serial" value="T-102021-08 ~ PICO-9507S"/> |
| 738 | 738 | <part name="cart" interface="pico_cart"> |
| 739 | <feature name="pcb" value="??" /> | |
| 739 | <feature name="pcb" value="??" /> <!-- non-Sega PCB, probably by Samsung --> | |
| 740 | 740 | <feature name="ic1" value="PICO-9507S" /> |
| 741 | 741 | <dataarea name="rom" size="524288"> |
| 742 | 742 | <rom name="pico-9507s.ic1" size="524288" crc="042520ce" sha1="5dd748a1bdfc661d0b96f6a1d26babc6a0ae7f2d" offset="000000" loadflag="load16_word_swap" /> |
| r242631 | r242632 | |
|---|---|---|
| 868 | 868 | </software> |
| 869 | 869 | |
| 870 | 870 | <!-- |
| 871 | The labelling of Hi-Com multigame carts is arbitrary. The boxes appears to what was intended as unique product number | |
| 872 | but boxes are typically mixed up and patched with stickers added to change game titles (on both boxes and cartridges) | |
| 873 | making the product number rather unreliable AND realistically we may never find out the correct numbers. | |
| 871 | The labelling of Hi-Com multigame carts is arbitrary. The boxes appears to what was intended as unique product number | |
| 872 | but boxes are typically mixed up and patched with stickers added to change game titles (on both boxes and cartridges) | |
| 873 | making the product number rather unreliable AND realistically we may never find out the correct numbers. | |
| 874 | 874 | --> |
| 875 | 875 | <software name="hicom3a"> |
| 876 | 876 | <description>The Best Game Collection - Hang On + Pit Pot + Spy vs Spy (Kor)</description> |
| r242631 | r242632 | |
|---|---|---|
| 5 | 5 | |
| 6 | 6 | List of known tape releases by Dick Smith in Australia: |
| 7 | 7 | |
| 8 | X-7274 Attack of the Killer Tomatoes | |
| 9 | X-7231 Match Box | |
| 10 | X-7232 Poker | |
| 11 | X-7233 Hangman | |
| 12 | X-7234 Slot Machine/Knock Off/Russian Roulette | |
| 13 | X-7235 Blackjack | |
| 14 | X-7236 Circus (*) | |
| 15 | X-7237 Biorhythm/Pair Matching/Calendar | |
| 16 | X-7238 Horse Race | |
| 17 | X-7239 Invaders (*) | |
| 18 | X-7240 Dynasty Derby | |
| 19 | X-7241 Learjet | |
| 20 | X-7242 Ghost Hunter (*) | |
| 21 | X-7243 Hoppy (*) | |
| 22 | X-7244 Super Snake | |
| 23 | X-7245 Knights and Dragons | |
| 24 | X-7247 Star Blaster (*) | |
| 25 | X-7248 VZ-Asteroids | |
| 26 | X-7249 Air Traffic Controller | |
| 27 | X-7250 Lunar Lander | |
| 28 | X-7251 Statistics 1 | |
| 29 | X-7252 Statistics 2 | |
| 30 | X-7253 Matrix | |
| 31 | X-7254 Tennis Lesson/Golf Lesson | |
| 32 | X-7255 Introduction to BASIC | |
| 33 | X-7256 Elementary Geometry | |
| 34 | X-7257 Speed Reading | |
| 35 | X-7258 Typing Teacher | |
| 36 | X-7259 Mailing List | |
| 37 | X-7261 Portfolio Management | |
| 38 | X-7262 Discounted Cash Flow Analysis | |
| 39 | X-7263 Financial Ratio Analysis | |
| 40 | X-7264 Tennis (*) | |
| 41 | X-7265 Checkers | |
| 42 | X-7266 Planet Patrol (*) | |
| 43 | X-7268 Ladder Challenge (*) | |
| 44 | X-7270 Panik (*) | |
| 45 | X-7271 Othello | |
| 46 | X-7272 Dracula's Castle | |
| 47 | X-7273 Backgammon | |
| 48 | X-7275 VZ Chess (*) | |
| 49 | X-7276 Music Writer | |
| 50 | X-7278 Disassembler | |
| 51 | X-7279 Duel | |
| 52 | X-7280 Hex Utilities | |
| 53 | X-7281 Word Processor | |
| 54 | X-7282 Editor Assembler | |
| 55 | X-7285 Spell'O'Matic 1 & 2 | |
| 56 | X-7286 Spell'O'Matic 3 & 4 | |
| 57 | X-7287 Flashword 1 & 2 | |
| 58 | X-7288 Flashword 3 & 4 | |
| 59 | X-7289 Metric Spycatcher | |
| 60 | X-7290 Whizkid Spycatcher | |
| 61 | X-7330 Sprite Generator | |
| 62 | X-7331 Formula One | |
| 63 | X-7332 Galaxon (*) | |
| 64 | X-7333 Dawn Patrol (*) | |
| 65 | X-7339 Space RAM | |
| 66 | X-7342 Crash | |
| 67 | X-7344 Maze of Argon | |
| 68 | X-7345 Word Matching | |
| 8 | X-7274 Attack of the Killer Tomatoes | |
| 9 | X-7231 Match Box | |
| 10 | X-7232 Poker | |
| 11 | X-7233 Hangman | |
| 12 | X-7234 Slot Machine/Knock Off/Russian Roulette | |
| 13 | X-7235 Blackjack | |
| 14 | X-7236 Circus (*) | |
| 15 | X-7237 Biorhythm/Pair Matching/Calendar | |
| 16 | X-7238 Horse Race | |
| 17 | X-7239 Invaders (*) | |
| 18 | X-7240 Dynasty Derby | |
| 19 | X-7241 Learjet | |
| 20 | X-7242 Ghost Hunter (*) | |
| 21 | X-7243 Hoppy (*) | |
| 22 | X-7244 Super Snake | |
| 23 | X-7245 Knights and Dragons | |
| 24 | X-7247 Star Blaster (*) | |
| 25 | X-7248 VZ-Asteroids | |
| 26 | X-7249 Air Traffic Controller | |
| 27 | X-7250 Lunar Lander | |
| 28 | X-7251 Statistics 1 | |
| 29 | X-7252 Statistics 2 | |
| 30 | X-7253 Matrix | |
| 31 | X-7254 Tennis Lesson/Golf Lesson | |
| 32 | X-7255 Introduction to BASIC | |
| 33 | X-7256 Elementary Geometry | |
| 34 | X-7257 Speed Reading | |
| 35 | X-7258 Typing Teacher | |
| 36 | X-7259 Mailing List | |
| 37 | X-7261 Portfolio Management | |
| 38 | X-7262 Discounted Cash Flow Analysis | |
| 39 | X-7263 Financial Ratio Analysis | |
| 40 | X-7264 Tennis (*) | |
| 41 | X-7265 Checkers | |
| 42 | X-7266 Planet Patrol (*) | |
| 43 | X-7268 Ladder Challenge (*) | |
| 44 | X-7270 Panik (*) | |
| 45 | X-7271 Othello | |
| 46 | X-7272 Dracula's Castle | |
| 47 | X-7273 Backgammon | |
| 48 | X-7275 VZ Chess (*) | |
| 49 | X-7276 Music Writer | |
| 50 | X-7278 Disassembler | |
| 51 | X-7279 Duel | |
| 52 | X-7280 Hex Utilities | |
| 53 | X-7281 Word Processor | |
| 54 | X-7282 Editor Assembler | |
| 55 | X-7285 Spell'O'Matic 1 & 2 | |
| 56 | X-7286 Spell'O'Matic 3 & 4 | |
| 57 | X-7287 Flashword 1 & 2 | |
| 58 | X-7288 Flashword 3 & 4 | |
| 59 | X-7289 Metric Spycatcher | |
| 60 | X-7290 Whizkid Spycatcher | |
| 61 | X-7330 Sprite Generator | |
| 62 | X-7331 Formula One | |
| 63 | X-7332 Galaxon (*) | |
| 64 | X-7333 Dawn Patrol (*) | |
| 65 | X-7339 Space RAM | |
| 66 | X-7342 Crash | |
| 67 | X-7344 Maze of Argon | |
| 68 | X-7345 Word Matching | |
| 69 | 69 | |
| 70 | 70 | * = dumped |
| 71 | 71 |
| r242631 | r242632 | |
|---|---|---|
| 176 | 176 | MCFG_STEPPER_END_INDEX(24) |
| 177 | 177 | MCFG_STEPPER_INDEX_PATTERN(0x00) |
| 178 | 178 | MCFG_STEPPER_INIT_PHASE(2) |
| 179 | ||
| 179 | ||
| 180 | 180 | MACHINE_CONFIG_END |
| 181 | 181 | |
| 182 | 182 | //------------------------------------------------- |
| r242631 | r242632 | |
| 345 | 345 | |
| 346 | 346 | void epson_lx810l_t::device_start() |
| 347 | 347 | { |
| 348 | ||
| 349 | 348 | } |
| 350 | 349 | |
| 351 | 350 |
| r242631 | r242632 | |
|---|---|---|
| 20 | 20 | #define LOG 1 |
| 21 | 21 | |
| 22 | 22 | #define GCR_DECODE(_e, _i) \ |
| 23 | ||
| 23 | ((BIT(_e, 6) << 7) | (BIT(_i, 7) << 6) | (_e & 0x33) | (BIT(_e, 2) << 3) | (_i & 0x04)) | |
| 24 | 24 | |
| 25 | 25 | #define GCR_ENCODE(_e, _i) \ |
| 26 | ||
| 26 | ((_e & 0xc0) << 2 | (_i & 0x80) | (_e & 0x3c) << 1 | (_i & 0x04) | (_e & 0x03)) | |
| 27 | 27 | |
| 28 | 28 | |
| 29 | 29 |
| r242631 | r242632 | |
|---|---|---|
| 365 | 365 | astring tempstring; |
| 366 | 366 | m_chr_gen_base = memregion(subtag(tempstring, "gfx1"))->base(); |
| 367 | 367 | m_chr_gen = m_chr_gen_base + m_chr_gen_offset[1]; |
| 368 | ||
| 368 | ||
| 369 | 369 | save_item(NAME(m_framecnt)); |
| 370 | 370 | save_item(NAME(m_mode_control)); |
| 371 | 371 | save_item(NAME(m_color_select)); |
| r242631 | r242632 | |
| 374 | 374 | save_item(NAME(m_vsync)); |
| 375 | 375 | save_item(NAME(m_hsync)); |
| 376 | 376 | save_item(NAME(m_vram)); |
| 377 | save_item(NAME(m_plantronics)); | |
| 377 | save_item(NAME(m_plantronics)); | |
| 378 | 378 | } |
| 379 | 379 | |
| 380 | 380 |
| r242631 | r242632 | |
|---|---|---|
| 28 | 28 | public: |
| 29 | 29 | // construction/destruction |
| 30 | 30 | sc499_ctape_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 31 | ||
| 31 | ||
| 32 | 32 | // image-level overrides |
| 33 | 33 | virtual bool call_load(); |
| 34 | 34 | virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) { return load_software(swlist, swname, start_entry); } |
| 35 | 35 | virtual void call_unload(); |
| 36 | 36 | virtual iodevice_t image_type() const { return IO_MAGTAPE; } |
| 37 | ||
| 37 | ||
| 38 | 38 | virtual bool is_readable() const { return 1; } |
| 39 | 39 | virtual bool is_writeable() const { return 1; } |
| 40 | 40 | virtual bool is_creatable() const { return 1; } |
| r242631 | r242632 | |
|---|---|---|
| 899 | 899 | |
| 900 | 900 | |
| 901 | 901 | /*------------------------------------------------- |
| 902 | ||
| 902 | ||
| 903 | 903 | Hi-Com X-in-1 cart, uses writes to 0xffff to |
| 904 | 904 | change program bank in 0x0000-0x7fff |
| 905 | ||
| 905 | ||
| 906 | 906 | -------------------------------------------------*/ |
| 907 | 907 | |
| 908 | 908 | READ8_MEMBER(sega8_hicom_device::read_cart) |
| 909 | 909 | { |
| 910 | 910 | if (offset >= 0x8000) |
| 911 | 911 | return m_rom[offset & 0x3fff]; |
| 912 | ||
| 912 | ||
| 913 | 913 | return m_rom[(m_rom_bank_base * 0x8000) + offset]; |
| 914 | 914 | } |
| 915 | 915 |
| r242631 | r242632 | |
|---|---|---|
| 318 | 318 | public: |
| 319 | 319 | // construction/destruction |
| 320 | 320 | sega8_hicom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 321 | ||
| 321 | ||
| 322 | 322 | // device-level overrides |
| 323 | 323 | virtual void device_start() { save_item(NAME(m_rom_bank_base)); } |
| 324 | ||
| 324 | ||
| 325 | 325 | virtual void late_bank_setup(); |
| 326 | ||
| 326 | ||
| 327 | 327 | // reading and writing |
| 328 | 328 | virtual DECLARE_READ8_MEMBER(read_cart); |
| 329 | 329 | virtual DECLARE_WRITE8_MEMBER(write_cart) {} |
| 330 | 330 | virtual DECLARE_WRITE8_MEMBER(write_mapper); |
| 331 | ||
| 331 | ||
| 332 | 332 | protected: |
| 333 | 333 | UINT8 m_rom_bank_base; |
| 334 | 334 | }; |
| r242631 | r242632 | |
|---|---|---|
| 99 | 99 | |
| 100 | 100 | void arc_device::execute_set_input(int irqline, int state) |
| 101 | 101 | { |
| 102 | ||
| 103 | 102 | } |
| 104 | 103 | |
| 105 | 104 |
| r242631 | r242632 | |
|---|---|---|
| 68 | 68 | /* 03 */ "PL", // (aka P - Positive) |
| 69 | 69 | /* 04 */ "MI", // (aka N - Negative) |
| 70 | 70 | /* 05 */ "CS", // (aka C, LO - Carry set / Lower than) (unsigned) |
| 71 | /* 06 */ "CC", // (aka CC, NC, HS - Carry Clear / Higher or Same) (unsigned) | |
| 71 | /* 06 */ "CC", // (aka CC, NC, HS - Carry Clear / Higher or Same) (unsigned) | |
| 72 | 72 | /* 07 */ "VS", // (aka V - Overflow set) |
| 73 | 73 | /* 08 */ "VC", // (aka NV - Overflow clear) |
| 74 | 74 | /* 09 */ "GT", // ( - Greater than) (signed) |
| r242631 | r242632 | |
| 204 | 204 | case 0x05: // BL |
| 205 | 205 | print("%s(%s)(%s) %08x", basic[opcode], conditions[ARC_CONDITION], delaytype[ARC_BRANCH_DELAY], (ARC_BRANCH_ADDR<<2)+pc+4); |
| 206 | 206 | break; |
| 207 | ||
| 207 | ||
| 208 | 208 | case 0x08: // ADD |
| 209 | 209 | // todo, short / long immediate formats |
| 210 | 210 | print("%s %s , %s , %s (%08x)", basic[opcode], regnames[ARC_REGOP_DEST], regnames[ARC_REGOP_OP1], regnames[ARC_REGOP_OP2], op &~ 0xfffffe00); |
| r242631 | r242632 | |
|---|---|---|
| 164 | 164 | |
| 165 | 165 | |
| 166 | 166 | /*****************************************************************************/ |
| 167 | ||
| 168 | 167 | |
| 168 | ||
| 169 | 169 | void arcompact_device::execute_set_input(int irqline, int state) |
| 170 | 170 | { |
| 171 | ||
| 172 | 171 | } |
| r242631 | r242632 | |
|---|---|---|
| 21 | 21 | ARCOMPACT_RETTYPE arcompact_handle##name##_p11(OPS_32) \ |
| 22 | 22 | { \ |
| 23 | 23 | int M = (op & 0x00000020) >> 5; \ |
| 24 | | |
| 24 | \ | |
| 25 | 25 | switch (M) \ |
| 26 | 26 | { \ |
| 27 | 27 | case 0x00: return arcompact_handle##name##_p11_m0(PARAMS); \ |
| 28 | 28 | case 0x01: return arcompact_handle##name##_p11_m1(PARAMS); \ |
| 29 | 29 | } \ |
| 30 | | |
| 30 | \ | |
| 31 | 31 | return 0; \ |
| 32 | }; \ | |
| 33 | ||
| 32 | }; | |
| 34 | 33 | #define ARCOMPACT_HANDLER04_TYPE(name) \ |
| 35 | 34 | ARCOMPACT_RETTYPE arcompact_handle##name(OPS_32) \ |
| 36 | 35 | { \ |
| r242631 | r242632 | |
| 45 | 44 | } \ |
| 46 | 45 | \ |
| 47 | 46 | return 0; \ |
| 48 | }; | |
| 47 | }; | |
| 49 | 48 | |
| 50 | ||
| 51 | 49 | #define ARCOMPACT_HANDLER04_TYPE_PM(name) \ |
| 52 | 50 | ARCOMPACT_RETTYPE arcompact_handle##name##_p00(OPS_32); \ |
| 53 | 51 | ARCOMPACT_RETTYPE arcompact_handle##name##_p01(OPS_32); \ |
| r242631 | r242632 | |
| 55 | 53 | ARCOMPACT_RETTYPE arcompact_handle##name##_p11_m0(OPS_32); \ |
| 56 | 54 | ARCOMPACT_RETTYPE arcompact_handle##name##_p11_m1(OPS_32); \ |
| 57 | 55 | ARCOMPACT_HANDLER04_P11_TYPE(name); \ |
| 58 | ARCOMPACT_HANDLER04_TYPE(name); | |
| 56 | ARCOMPACT_HANDLER04_TYPE(name); | |
| 59 | 57 | |
| 60 | ||
| 61 | 58 | class arcompact_device : public cpu_device |
| 62 | 59 | { |
| 63 | 60 | public: |
| r242631 | r242632 | |
| 146 | 143 | ARCOMPACT_RETTYPE arcompact_handle01_01_01_0f(OPS_32); |
| 147 | 144 | ARCOMPACT_RETTYPE arcompact_handle02(OPS_32); |
| 148 | 145 | ARCOMPACT_RETTYPE arcompact_handle03(OPS_32); |
| 149 | // | |
| 146 | // ARCOMPACT_RETTYPE arcompact_handle04_00(OPS_32); | |
| 150 | 147 | ARCOMPACT_RETTYPE arcompact_handle04_01(OPS_32); |
| 151 | // | |
| 148 | // ARCOMPACT_RETTYPE arcompact_handle04_02(OPS_32); | |
| 152 | 149 | ARCOMPACT_RETTYPE arcompact_handle04_03(OPS_32); |
| 153 | // ARCOMPACT_RETTYPE arcompact_handle04_04(OPS_32); | |
| 154 | // ARCOMPACT_RETTYPE arcompact_handle04_05(OPS_32); | |
| 155 | // ARCOMPACT_RETTYPE arcompact_handle04_06(OPS_32); | |
| 156 | // ARCOMPACT_RETTYPE arcompact_handle04_07(OPS_32); | |
| 150 | // ARCOMPACT_RETTYPE arcompact_handle04_04(OPS_32); | |
| 151 | // ARCOMPACT_RETTYPE arcompact_handle04_05(OPS_32); | |
| 152 | // ARCOMPACT_RETTYPE arcompact_handle04_06(OPS_32); | |
| 153 | // ARCOMPACT_RETTYPE arcompact_handle04_07(OPS_32); | |
| 157 | 154 | ARCOMPACT_RETTYPE arcompact_handle04_08(OPS_32); |
| 158 | 155 | ARCOMPACT_RETTYPE arcompact_handle04_09(OPS_32); |
| 159 | // | |
| 156 | // ARCOMPACT_RETTYPE arcompact_handle04_0a(OPS_32); | |
| 160 | 157 | ARCOMPACT_RETTYPE arcompact_handle04_0b(OPS_32); |
| 161 | 158 | ARCOMPACT_RETTYPE arcompact_handle04_0c(OPS_32); |
| 162 | 159 | ARCOMPACT_RETTYPE arcompact_handle04_0d(OPS_32); |
| 163 | // ARCOMPACT_RETTYPE arcompact_handle04_0e(OPS_32); | |
| 164 | // ARCOMPACT_RETTYPE arcompact_handle04_0f(OPS_32); | |
| 160 | // ARCOMPACT_RETTYPE arcompact_handle04_0e(OPS_32); | |
| 161 | // ARCOMPACT_RETTYPE arcompact_handle04_0f(OPS_32); | |
| 165 | 162 | ARCOMPACT_RETTYPE arcompact_handle04_10(OPS_32); |
| 166 | 163 | ARCOMPACT_RETTYPE arcompact_handle04_11(OPS_32); |
| 167 | 164 | ARCOMPACT_RETTYPE arcompact_handle04_12(OPS_32); |
| 168 | // ARCOMPACT_RETTYPE arcompact_handle04_13(OPS_32); | |
| 169 | // ARCOMPACT_RETTYPE arcompact_handle04_14(OPS_32); | |
| 170 | // ARCOMPACT_RETTYPE arcompact_handle04_15(OPS_32); | |
| 171 | // ARCOMPACT_RETTYPE arcompact_handle04_16(OPS_32); | |
| 172 | // ARCOMPACT_RETTYPE arcompact_handle04_17(OPS_32); | |
| 173 | // ARCOMPACT_RETTYPE arcompact_handle04_18(OPS_32); | |
| 174 | // ARCOMPACT_RETTYPE arcompact_handle04_19(OPS_32); | |
| 165 | // ARCOMPACT_RETTYPE arcompact_handle04_13(OPS_32); | |
| 166 | // ARCOMPACT_RETTYPE arcompact_handle04_14(OPS_32); | |
| 167 | // ARCOMPACT_RETTYPE arcompact_handle04_15(OPS_32); | |
| 168 | // ARCOMPACT_RETTYPE arcompact_handle04_16(OPS_32); | |
| 169 | // ARCOMPACT_RETTYPE arcompact_handle04_17(OPS_32); | |
| 170 | // ARCOMPACT_RETTYPE arcompact_handle04_18(OPS_32); | |
| 171 | // ARCOMPACT_RETTYPE arcompact_handle04_19(OPS_32); | |
| 175 | 172 | ARCOMPACT_RETTYPE arcompact_handle04_1a(OPS_32); |
| 176 | 173 | ARCOMPACT_RETTYPE arcompact_handle04_1b(OPS_32); |
| 177 | 174 | ARCOMPACT_RETTYPE arcompact_handle04_1c(OPS_32); |
| 178 | 175 | ARCOMPACT_RETTYPE arcompact_handle04_1d(OPS_32); |
| 179 | // | |
| 176 | // ARCOMPACT_RETTYPE arcompact_handle04_20(OPS_32); | |
| 180 | 177 | ARCOMPACT_RETTYPE arcompact_handle04_21(OPS_32); |
| 181 | 178 | ARCOMPACT_RETTYPE arcompact_handle04_22(OPS_32); |
| 182 | 179 | ARCOMPACT_RETTYPE arcompact_handle04_23(OPS_32); |
| 183 | 180 | ARCOMPACT_RETTYPE arcompact_handle04_28(OPS_32); |
| 184 | 181 | ARCOMPACT_RETTYPE arcompact_handle04_29(OPS_32); |
| 185 | 182 | ARCOMPACT_RETTYPE arcompact_handle04_2a(OPS_32); |
| 186 | // | |
| 183 | // ARCOMPACT_RETTYPE arcompact_handle04_2b(OPS_32); | |
| 187 | 184 | ARCOMPACT_RETTYPE arcompact_handle04_2f_00(OPS_32); |
| 188 | 185 | ARCOMPACT_RETTYPE arcompact_handle04_2f_01(OPS_32); |
| 189 | // | |
| 186 | // ARCOMPACT_RETTYPE arcompact_handle04_2f_02(OPS_32); | |
| 190 | 187 | ARCOMPACT_RETTYPE arcompact_handle04_2f_03(OPS_32); |
| 191 | 188 | ARCOMPACT_RETTYPE arcompact_handle04_2f_04(OPS_32); |
| 192 | 189 | ARCOMPACT_RETTYPE arcompact_handle04_2f_05(OPS_32); |
| 193 | 190 | ARCOMPACT_RETTYPE arcompact_handle04_2f_06(OPS_32); |
| 194 | // ARCOMPACT_RETTYPE arcompact_handle04_2f_07(OPS_32); | |
| 195 | // ARCOMPACT_RETTYPE arcompact_handle04_2f_08(OPS_32); | |
| 191 | // ARCOMPACT_RETTYPE arcompact_handle04_2f_07(OPS_32); | |
| 192 | // ARCOMPACT_RETTYPE arcompact_handle04_2f_08(OPS_32); | |
| 196 | 193 | ARCOMPACT_RETTYPE arcompact_handle04_2f_09(OPS_32); |
| 197 | 194 | ARCOMPACT_RETTYPE arcompact_handle04_2f_0a(OPS_32); |
| 198 | 195 | ARCOMPACT_RETTYPE arcompact_handle04_2f_0b(OPS_32); |
| r242631 | r242632 | |
| 779 | 776 | ARCOMPACT_HANDLER04_TYPE_PM(04_14); |
| 780 | 777 | ARCOMPACT_HANDLER04_TYPE_PM(04_15); |
| 781 | 778 | ARCOMPACT_HANDLER04_TYPE_PM(04_16); |
| 782 | ARCOMPACT_HANDLER04_TYPE_PM(04_17); | |
| 779 | ARCOMPACT_HANDLER04_TYPE_PM(04_17); | |
| 783 | 780 | ARCOMPACT_HANDLER04_TYPE_PM(04_18); |
| 784 | ARCOMPACT_HANDLER04_TYPE_PM(04_19); | |
| 781 | ARCOMPACT_HANDLER04_TYPE_PM(04_19); | |
| 785 | 782 | ARCOMPACT_HANDLER04_TYPE_PM(04_20); |
| 786 | 783 | ARCOMPACT_HANDLER04_TYPE_PM(04_2b); |
| 787 | 784 | |
| r242631 | r242632 | |
| 811 | 808 | inline UINT32 READ32(UINT32 address) { return m_program->read_dword(address << 2); } |
| 812 | 809 | inline void WRITE32(UINT32 address, UINT32 data) { m_program->write_dword(address << 2, data); } |
| 813 | 810 | inline UINT16 READ16(UINT32 address) { return m_program->read_word(address << 1); } |
| 814 | inline void WRITE16(UINT32 address, UINT16 data){ | |
| 811 | inline void WRITE16(UINT32 address, UINT16 data){ m_program->write_word(address << 1, data); } | |
| 815 | 812 | inline UINT8 READ8(UINT32 address) { return m_program->read_byte(address << 0); } |
| 816 | inline void WRITE8(UINT32 address, UINT8 data){ m_program->write_byte(address << 0, data); } | |
| 817 | ||
| 813 | inline void WRITE8(UINT32 address, UINT8 data){ m_program->write_byte(address << 0, data); } | |
| 814 | ||
| 818 | 815 | inline UINT64 READAUX(UINT64 address) { return m_io->read_dword(address *4); } |
| 819 | 816 | inline void WRITEAUX(UINT64 address, UINT32 data) { m_io->write_dword(address *4, data); } |
| 820 | 817 | |
| r242631 | r242632 | |
| 827 | 824 | int m_delaylinks; |
| 828 | 825 | UINT32 m_delayjump; |
| 829 | 826 | |
| 830 | // | |
| 827 | // f e d c| b a 9 8| 7 6 5 4| 3 2 1 0 | |
| 831 | 828 | // - - - L| Z N C V| U DE AE A2|A1 E2 E1 H |
| 832 | 829 | UINT32 m_status32; |
| 833 | 830 | |
| r242631 | r242632 | |
| 862 | 859 | #define STATUS32_CHECK_Z (m_status32 & Z_ZERO_FLAG) |
| 863 | 860 | |
| 864 | 861 | // Condition 0x0c (LE) |
| 865 | #define CONDITION_LE ((STATUS32_CHECK_Z) || (STATUS32_CHECK_N && !STATUS32_CHECK_V) || (!STATUS32_CHECK_N && STATUS32_CHECK_V)) // Z or (N and /V) or (/N and V) | |
| 862 | #define CONDITION_LE ((STATUS32_CHECK_Z) || (STATUS32_CHECK_N && !STATUS32_CHECK_V) || (!STATUS32_CHECK_N && STATUS32_CHECK_V)) // Z or (N and /V) or (/N and V) | |
| 866 | 863 | #define CONDITION_EQ (STATUS32_CHECK_Z) |
| 867 | 864 | #define CONDITION_CS (STATUS32_CHECK_C) |
| 868 | 865 | #define CONDITION_LT ((STATUS32_CHECK_N && !STATUS32_CHECK_V) || (!STATUS32_CHECK_N && STATUS32_CHECK_V)) |
| r242631 | r242632 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | \*********************************/ |
| 6 | 6 | |
| 7 | // condition codes (basic ones are the same as arc | |
| 7 | // condition codes (basic ones are the same as arc | |
| 8 | 8 | const char *conditions[0x20] = |
| 9 | 9 | { |
| 10 | 10 | /* 00 */ "AL", // (aka RA - Always) |
| r242631 | r242632 | |
| 13 | 13 | /* 03 */ "PL", // (aka P - Positive) |
| 14 | 14 | /* 04 */ "MI", // (aka N - Negative) |
| 15 | 15 | /* 05 */ "CS", // (aka C, LO - Carry set / Lower than) (unsigned) |
| 16 | /* 06 */ "CC", // (aka CC, NC, HS - Carry Clear / Higher or Same) (unsigned) | |
| 16 | /* 06 */ "CC", // (aka CC, NC, HS - Carry Clear / Higher or Same) (unsigned) | |
| 17 | 17 | /* 07 */ "VS", // (aka V - Overflow set) |
| 18 | 18 | /* 08 */ "VC", // (aka NV - Overflow clear) |
| 19 | 19 | /* 09 */ "GT", // ( - Greater than) (signed) |
| r242631 | r242632 | |
| 44 | 44 | #define UNUSED_REG "unusedreg" |
| 45 | 45 | |
| 46 | 46 | #define AUX_UNUSED_16 \ |
| 47 | /* 0xxx0 */ UNUSED_REG, | |
| 47 | /* 0xxx0 */ UNUSED_REG, /* 0xxx1 */ UNUSED_REG, /* 0xxx2 */ UNUSED_REG, /* 0xxx3 */ UNUSED_REG, /* 0xxx4 */ UNUSED_REG, /* 0xxx5 */ UNUSED_REG, /* 0xxx6 */ UNUSED_REG, /* 0xxx7 */ UNUSED_REG, /* 0xxx8 */ UNUSED_REG, /* 0xxx9 */ UNUSED_REG, /* 0xxxa */ UNUSED_REG, /* 0xxxb */ UNUSED_REG, /* 0xxxc */ UNUSED_REG, /* 0xxxd */ UNUSED_REG, /* 0xxxe */ UNUSED_REG, /* 0xxxf */ UNUSED_REG, | |
| 48 | 48 | |
| 49 | 49 | // the Auxiliary Register set is actually a 2^32 dword address space (so 16 GB / 34-bit) |
| 50 | 50 | // this table just allows us to improve the debugger display for some of the common core / internal ones |
| r242631 | r242632 | |
| 125 | 125 | AUX_UNUSED_16 /* 0x090 - 0x09f */ |
| 126 | 126 | AUX_UNUSED_16 /* 0x0a0 - 0x0af */ |
| 127 | 127 | AUX_UNUSED_16 /* 0x0b0 - 0x0bf */ |
| 128 | | |
| 128 | // build configuration registers 0x0c0 - 0x0ff | |
| 129 | 129 | /* 0x0c0 */ "RESERVED AUX 0xc0",/* 0x0c1 */ "RESERVED AUX 0xc1",/* 0x0c2 */ "RESERVED AUX 0xc2",/* 0x0c3 */ "RESERVED AUX 0xc3",/* 0x0c4 */ "RESERVED AUX 0xc4",/* 0x0c5 */ "RESERVED AUX 0xc5",/* 0x0c6 */ "RESERVED AUX 0xc6",/* 0x0c7 */ "RESERVED AUX 0xc7",/* 0x0c8 */ "RESERVED AUX 0xc8",/* 0x0c9 */ "RESERVED AUX 0xc9",/* 0x0ca */ "RESERVED AUX 0xca",/* 0x0cb */ "RESERVED AUX 0xcb",/* 0x0cc */ "RESERVED AUX 0xcc",/* 0x0cd */ "RESERVED AUX 0xcd",/* 0x0ce */ "RESERVED AUX 0xce",/* 0x0cf */ "RESERVED AUX 0xcf", |
| 130 | 130 | /* 0x0d0 */ "RESERVED AUX 0xd0",/* 0x0d1 */ "RESERVED AUX 0xd1",/* 0x0d2 */ "RESERVED AUX 0xd2",/* 0x0d3 */ "RESERVED AUX 0xd3",/* 0x0d4 */ "RESERVED AUX 0xd4",/* 0x0d5 */ "RESERVED AUX 0xd5",/* 0x0d6 */ "RESERVED AUX 0xd6",/* 0x0d7 */ "RESERVED AUX 0xd7",/* 0x0d8 */ "RESERVED AUX 0xd8",/* 0x0d9 */ "RESERVED AUX 0xd9",/* 0x0da */ "RESERVED AUX 0xda",/* 0x0db */ "RESERVED AUX 0xdb",/* 0x0dc */ "RESERVED AUX 0xdc",/* 0x0dd */ "RESERVED AUX 0xdd",/* 0x0de */ "RESERVED AUX 0xde",/* 0x0df */ "RESERVED AUX 0xdf", |
| 131 | 131 | /* 0x0e0 */ "RESERVED AUX 0xe0",/* 0x0e1 */ "RESERVED AUX 0xe1",/* 0x0e2 */ "RESERVED AUX 0xe2",/* 0x0e3 */ "RESERVED AUX 0xe3",/* 0x0e4 */ "RESERVED AUX 0xe4",/* 0x0e5 */ "RESERVED AUX 0xe5",/* 0x0e6 */ "RESERVED AUX 0xe6",/* 0x0e7 */ "RESERVED AUX 0xe7",/* 0x0e8 */ "RESERVED AUX 0xe8",/* 0x0e9 */ "RESERVED AUX 0xe9",/* 0x0ea */ "RESERVED AUX 0xea",/* 0x0eb */ "RESERVED AUX 0xeb",/* 0x0ec */ "RESERVED AUX 0xec",/* 0x0ed */ "RESERVED AUX 0xed",/* 0x0ee */ "RESERVED AUX 0xee",/* 0x0ef */ "RESERVED AUX 0xef", |
| r242631 | r242632 | |
| 371 | 371 | /* 37 */ "r55(ext)", |
| 372 | 372 | /* 38 */ "r56(ext)", |
| 373 | 373 | /* 39 */ "r57(M-LO)", // MLO (result registers for optional multply functions) |
| 374 | /* 3a */ "r58(M-MID)", // MMID | |
| 375 | /* 3b */ "r59(M-HI)", // MHI | |
| 374 | /* 3a */ "r58(M-MID)", // MMID | |
| 375 | /* 3b */ "r59(M-HI)", // MHI | |
| 376 | 376 | /* 3c */ "r60(LP_COUNT)", |
| 377 | 377 | /* 3d */ "r61(reserved)", |
| 378 | 378 | /* 3e */ "r62(LIMM)", // use Long Immediate Data instead of register |
| r242631 | r242632 | |
| 523 | 523 | /* 3e */ "0x3e", |
| 524 | 524 | /* 3f */ "0x3f", |
| 525 | 525 | }; |
| 526 |
| r242631 | r242632 | |
|---|---|---|
| 19 | 19 | { |
| 20 | 20 | debugger_instruction_hook(this, m_pc); |
| 21 | 21 | |
| 22 | // | |
| 22 | // printf("new pc %04x\n", m_pc); | |
| 23 | 23 | |
| 24 | 24 | if (m_delayactive) |
| 25 | 25 | { |
| r242631 | r242632 | |
| 56 | 56 | #define GET_01_01_01_BRANCH_ADDR \ |
| 57 | 57 | INT32 address = (op & 0x00fe0000) >> 17; \ |
| 58 | 58 | address |= ((op & 0x00008000) >> 15) << 7; \ |
| 59 | if (address & 0x80) address = -0x80 + (address & 0x7f); | |
| 59 | if (address & 0x80) address = -0x80 + (address & 0x7f); | |
| 60 | 60 | |
| 61 | ||
| 62 | 61 | #define GROUP_0e_GET_h \ |
| 63 | 62 | h = ((op & 0x0007) << 3); \ |
| 64 | h |= ((op & 0x00e0) >> 5); \ | |
| 65 | ||
| 63 | h |= ((op & 0x00e0) >> 5); | |
| 66 | 64 | #define COMMON32_GET_breg \ |
| 67 | 65 | int b_temp = (op & 0x07000000) >> 24; \ |
| 68 | 66 | int B_temp = (op & 0x00007000) >> 12; \ |
| 69 | int breg = b_temp | (B_temp << 3); \ | |
| 70 | ||
| 67 | int breg = b_temp | (B_temp << 3); | |
| 71 | 68 | #define COMMON32_GET_creg \ |
| 72 | int creg = (op & 0x00000fc0) >> 6; \ | |
| 73 | ||
| 69 | int creg = (op & 0x00000fc0) >> 6; | |
| 74 | 70 | #define COMMON32_GET_u6 \ |
| 75 | int u = (op & 0x00000fc0) >> 6; \ | |
| 76 | ||
| 71 | int u = (op & 0x00000fc0) >> 6; | |
| 77 | 72 | #define COMMON32_GET_areg \ |
| 78 | int areg = (op & 0x0000003f) >> 0; \ | |
| 79 | ||
| 73 | int areg = (op & 0x0000003f) >> 0; | |
| 80 | 74 | #define COMMON32_GET_areg_reserved \ |
| 81 | int ares = (op & 0x0000003f) >> 0; \ | |
| 82 | ||
| 75 | int ares = (op & 0x0000003f) >> 0; | |
| 83 | 76 | #define COMMON32_GET_F \ |
| 84 | int F = (op & 0x00008000) >> 15; \ | |
| 85 | ||
| 77 | int F = (op & 0x00008000) >> 15; | |
| 86 | 78 | #define COMMON32_GET_p \ |
| 87 | int p = (op & 0x00c00000) >> 22; | |
| 79 | int p = (op & 0x00c00000) >> 22; | |
| 88 | 80 | |
| 89 | ||
| 90 | 81 | #define COMMON32_GET_s12 \ |
| 91 | 82 | int S_temp = (op & 0x0000003f) >> 0; \ |
| 92 | 83 | int s_temp = (op & 0x00000fc0) >> 6; \ |
| 93 | 84 | INT32 S = s_temp | (S_temp<<6); \ |
| 94 | if (S & 0x800) S = -0x800 + (S&0x7ff); /* sign extend */ \ | |
| 95 | ||
| 85 | if (S & 0x800) S = -0x800 + (S&0x7ff); /* sign extend */ | |
| 96 | 86 | #define COMMON32_GET_CONDITION \ |
| 97 | 87 | UINT8 condition = op & 0x0000001f; |
| 98 | 88 | |
| 99 | 89 | |
| 100 | 90 | #define COMMON16_GET_breg \ |
| 101 | breg = ((op & 0x0700) >>8); \ | |
| 102 | ||
| 91 | breg = ((op & 0x0700) >>8); | |
| 103 | 92 | #define COMMON16_GET_creg \ |
| 104 | creg = ((op & 0x00e0) >>5); \ | |
| 105 | ||
| 93 | creg = ((op & 0x00e0) >>5); | |
| 106 | 94 | #define COMMON16_GET_areg \ |
| 107 | areg = ((op & 0x0007) >>0); \ | |
| 108 | ||
| 95 | areg = ((op & 0x0007) >>0); | |
| 109 | 96 | #define COMMON16_GET_u3 \ |
| 110 | u = ((op & 0x0007) >>0); \ | |
| 111 | ||
| 97 | u = ((op & 0x0007) >>0); | |
| 112 | 98 | #define COMMON16_GET_u5 \ |
| 113 | u = ((op & 0x001f) >>0); \ | |
| 114 | ||
| 99 | u = ((op & 0x001f) >>0); | |
| 115 | 100 | #define COMMON16_GET_u8 \ |
| 116 | u = ((op & 0x00ff) >>0); \ | |
| 117 | ||
| 101 | u = ((op & 0x00ff) >>0); | |
| 118 | 102 | #define COMMON16_GET_u7 \ |
| 119 | u = ((op & 0x007f) >>0); \ | |
| 120 | ||
| 103 | u = ((op & 0x007f) >>0); | |
| 121 | 104 | #define COMMON16_GET_s9 \ |
| 122 | s = ((op & 0x01ff) >>0); \ | |
| 123 | ||
| 105 | s = ((op & 0x01ff) >>0); | |
| 124 | 106 | // registers used in 16-bit opcodes hae a limited range |
| 125 | 107 | // and can only address registers r0-r3 and r12-r15 |
| 126 | 108 | |
| 127 | 109 | #define REG_16BIT_RANGE(_reg_) \ |
| 128 | if (_reg_>3) _reg_+= 8; | |
| 110 | if (_reg_>3) _reg_+= 8; | |
| 129 | 111 | |
| 130 | ||
| 131 | 112 | #define GET_LIMM_32 \ |
| 132 | 113 | limm = (READ16((m_pc + 4) >> 1) << 16); \ |
| 133 | limm |= READ16((m_pc + 6) >> 1); \ | |
| 134 | ||
| 114 | limm |= READ16((m_pc + 6) >> 1); | |
| 135 | 115 | #define GET_LIMM_16 \ |
| 136 | 116 | limm = (READ16((m_pc + 2) >> 1) << 16); \ |
| 137 | limm |= READ16((m_pc + 4) >> 1); | |
| 117 | limm |= READ16((m_pc + 4) >> 1); | |
| 138 | 118 | |
| 139 | ||
| 140 | 119 | #define PC_ALIGNED32 \ |
| 141 | 120 | (m_pc&0xfffffffc) |
| 142 | 121 | |
| r242631 | r242632 | |
| 178 | 157 | case 0x1f: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 179 | 158 | } |
| 180 | 159 | |
| 181 | | |
| 160 | return -1; | |
| 182 | 161 | |
| 183 | 162 | } |
| 184 | 163 | |
| r242631 | r242632 | |
| 194 | 173 | |
| 195 | 174 | switch (instruction) // 32-bit instructions (with optional extra dword for immediate data) |
| 196 | 175 | { |
| 197 | case 0x00: return arcompact_handle00(PARAMS); // Bcc | |
| 198 | case 0x01: return arcompact_handle01(PARAMS); // BLcc/BRcc | |
| 199 | case 0x02: return arcompact_handle02(PARAMS); // LD r+o | |
| 200 | case 0x03: return arcompact_handle03(PARAMS); // ST r+o | |
| 201 | case 0x04: return arcompact_handle04(PARAMS); // op a,b,c (basecase) | |
| 202 | case 0x05: return arcompact_handle05(PARAMS); // op a,b,c (05 ARC ext) | |
| 203 | case 0x06: return arcompact_handle06(PARAMS); // op a,b,c (06 ARC ext) | |
| 204 | case 0x07: return arcompact_handle07(PARAMS); // op a,b,c (07 User ext) | |
| 205 | case 0x08: return arcompact_handle08(PARAMS); // op a,b,c (08 User ext) | |
| 206 | case 0x09: return arcompact_handle09(PARAMS); // op a,b,c (09 Market ext) | |
| 207 | case 0x0a: return arcompact_handle0a(PARAMS); // op a,b,c (0a Market ext) | |
| 208 | case 0x0b: return arcompact_handle0b(PARAMS); // op a,b,c (0b Market ext) | |
| 176 | case 0x00: return arcompact_handle00(PARAMS); // Bcc | |
| 177 | case 0x01: return arcompact_handle01(PARAMS); // BLcc/BRcc | |
| 178 | case 0x02: return arcompact_handle02(PARAMS); // LD r+o | |
| 179 | case 0x03: return arcompact_handle03(PARAMS); // ST r+o | |
| 180 | case 0x04: return arcompact_handle04(PARAMS); // op a,b,c (basecase) | |
| 181 | case 0x05: return arcompact_handle05(PARAMS); // op a,b,c (05 ARC ext) | |
| 182 | case 0x06: return arcompact_handle06(PARAMS); // op a,b,c (06 ARC ext) | |
| 183 | case 0x07: return arcompact_handle07(PARAMS); // op a,b,c (07 User ext) | |
| 184 | case 0x08: return arcompact_handle08(PARAMS); // op a,b,c (08 User ext) | |
| 185 | case 0x09: return arcompact_handle09(PARAMS); // op a,b,c (09 Market ext) | |
| 186 | case 0x0a: return arcompact_handle0a(PARAMS); // op a,b,c (0a Market ext) | |
| 187 | case 0x0b: return arcompact_handle0b(PARAMS); // op a,b,c (0b Market ext) | |
| 209 | 188 | } |
| 210 | 189 | } |
| 211 | 190 | else |
| 212 | 191 | { |
| 213 | 192 | switch (instruction) // 16-bit instructions |
| 214 | 193 | { |
| 215 | case 0x0c: return arcompact_handle0c(PARAMS); // Load/Add reg-reg | |
| 216 | case 0x0d: return arcompact_handle0d(PARAMS); // Add/Sub/Shft imm | |
| 217 | case 0x0e: return arcompact_handle0e(PARAMS); // Mov/Cmp/Add | |
| 218 | case 0x0f: return arcompact_handle0f(PARAMS); // op_S b,b,c (single 16-bit ops) | |
| 219 | case 0x10: return arcompact_handle10(PARAMS); // LD_S | |
| 220 | case 0x11: return arcompact_handle11(PARAMS); // LDB_S | |
| 221 | case 0x12: return arcompact_handle12(PARAMS); // LDW_S | |
| 222 | case 0x13: return arcompact_handle13(PARAMS); // LSW_S.X | |
| 223 | case 0x14: return arcompact_handle14(PARAMS); // ST_S | |
| 224 | case 0x15: return arcompact_handle15(PARAMS); // STB_S | |
| 225 | case 0x16: return arcompact_handle16(PARAMS); // STW_S | |
| 226 | case 0x17: return arcompact_handle17(PARAMS); // Shift/Sub/Bit | |
| 227 | case 0x18: return arcompact_handle18(PARAMS); // Stack Instr | |
| 228 | case 0x19: return arcompact_handle19(PARAMS); // GP Instr | |
| 229 | case 0x1a: return arcompact_handle1a(PARAMS); // PCL Instr | |
| 230 | case 0x1b: return arcompact_handle1b(PARAMS); // MOV_S | |
| 231 | case 0x1c: return arcompact_handle1c(PARAMS); // ADD_S/CMP_S | |
| 232 | case 0x1d: return arcompact_handle1d(PARAMS); // BRcc_S | |
| 233 | case 0x1e: return arcompact_handle1e(PARAMS); // Bcc_S | |
| 234 | case 0x1f: return arcompact_handle1f(PARAMS); // BL_S | |
| 194 | case 0x0c: return arcompact_handle0c(PARAMS); // Load/Add reg-reg | |
| 195 | case 0x0d: return arcompact_handle0d(PARAMS); // Add/Sub/Shft imm | |
| 196 | case 0x0e: return arcompact_handle0e(PARAMS); // Mov/Cmp/Add | |
| 197 | case 0x0f: return arcompact_handle0f(PARAMS); // op_S b,b,c (single 16-bit ops) | |
| 198 | case 0x10: return arcompact_handle10(PARAMS); // LD_S | |
| 199 | case 0x11: return arcompact_handle11(PARAMS); // LDB_S | |
| 200 | case 0x12: return arcompact_handle12(PARAMS); // LDW_S | |
| 201 | case 0x13: return arcompact_handle13(PARAMS); // LSW_S.X | |
| 202 | case 0x14: return arcompact_handle14(PARAMS); // ST_S | |
| 203 | case 0x15: return arcompact_handle15(PARAMS); // STB_S | |
| 204 | case 0x16: return arcompact_handle16(PARAMS); // STW_S | |
| 205 | case 0x17: return arcompact_handle17(PARAMS); // Shift/Sub/Bit | |
| 206 | case 0x18: return arcompact_handle18(PARAMS); // Stack Instr | |
| 207 | case 0x19: return arcompact_handle19(PARAMS); // GP Instr | |
| 208 | case 0x1a: return arcompact_handle1a(PARAMS); // PCL Instr | |
| 209 | case 0x1b: return arcompact_handle1b(PARAMS); // MOV_S | |
| 210 | case 0x1c: return arcompact_handle1c(PARAMS); // ADD_S/CMP_S | |
| 211 | case 0x1d: return arcompact_handle1d(PARAMS); // BRcc_S | |
| 212 | case 0x1e: return arcompact_handle1e(PARAMS); // Bcc_S | |
| 213 | case 0x1f: return arcompact_handle1f(PARAMS); // BL_S | |
| 235 | 214 | } |
| 236 | 215 | } |
| 237 | 216 | |
| r242631 | r242632 | |
| 501 | 480 | |
| 502 | 481 | switch (subinstr2) |
| 503 | 482 | { |
| 504 | case 0x00: return arcompact_handle05_2f_00(PARAMS); // SWAP | |
| 505 | case 0x01: return arcompact_handle05_2f_01(PARAMS); // NORM | |
| 483 | case 0x00: return arcompact_handle05_2f_00(PARAMS); // SWAP | |
| 484 | case 0x01: return arcompact_handle05_2f_01(PARAMS); // NORM | |
| 506 | 485 | case 0x02: return arcompact_handle05_2f_02(PARAMS); // SAT16 |
| 507 | case 0x03: return arcompact_handle05_2f_03(PARAMS); // RND16 | |
| 508 | case 0x04: return arcompact_handle05_2f_04(PARAMS); // ABSSW | |
| 509 | case 0x05: return arcompact_handle05_2f_05(PARAMS); // ABSS | |
| 510 | case 0x06: return arcompact_handle05_2f_06(PARAMS); // NEGSW | |
| 511 | case 0x07: return arcompact_handle05_2f_07(PARAMS); // NEGS | |
| 512 | case 0x08: return arcompact_handle05_2f_08(PARAMS); // NORMW | |
| 486 | case 0x03: return arcompact_handle05_2f_03(PARAMS); // RND16 | |
| 487 | case 0x04: return arcompact_handle05_2f_04(PARAMS); // ABSSW | |
| 488 | case 0x05: return arcompact_handle05_2f_05(PARAMS); // ABSS | |
| 489 | case 0x06: return arcompact_handle05_2f_06(PARAMS); // NEGSW | |
| 490 | case 0x07: return arcompact_handle05_2f_07(PARAMS); // NEGS | |
| 491 | case 0x08: return arcompact_handle05_2f_08(PARAMS); // NORMW | |
| 513 | 492 | case 0x09: return arcompact_handle05_2f_09(PARAMS); // illegal |
| 514 | 493 | case 0x0a: return arcompact_handle05_2f_0a(PARAMS); // illegal |
| 515 | 494 | case 0x0b: return arcompact_handle05_2f_0b(PARAMS); // illegal |
| r242631 | r242632 | |
| 935 | 914 | |
| 936 | 915 | switch (subinstr) |
| 937 | 916 | { |
| 938 | case 0x00: return arcompact_handle17_00(PARAMS); // ASL_S | |
| 939 | case 0x01: return arcompact_handle17_01(PARAMS); // LSR_S | |
| 917 | case 0x00: return arcompact_handle17_00(PARAMS); // ASL_S | |
| 918 | case 0x01: return arcompact_handle17_01(PARAMS); // LSR_S | |
| 940 | 919 | case 0x02: return arcompact_handle17_02(PARAMS); // ASR_S |
| 941 | case 0x03: return arcompact_handle17_03(PARAMS); // SUB_S | |
| 942 | case 0x04: return arcompact_handle17_04(PARAMS); // BSET_S | |
| 943 | case 0x05: return arcompact_handle17_05(PARAMS); // BCLR_S | |
| 944 | case 0x06: return arcompact_handle17_06(PARAMS); // BMSK_S | |
| 920 | case 0x03: return arcompact_handle17_03(PARAMS); // SUB_S | |
| 921 | case 0x04: return arcompact_handle17_04(PARAMS); // BSET_S | |
| 922 | case 0x05: return arcompact_handle17_05(PARAMS); // BCLR_S | |
| 923 | case 0x06: return arcompact_handle17_06(PARAMS); // BMSK_S | |
| 945 | 924 | case 0x07: return arcompact_handle17_07(PARAMS); // BTST_S |
| 946 | 925 | } |
| 947 | 926 | |
| r242631 | r242632 | |
| 967 | 946 | return 0; |
| 968 | 947 | } |
| 969 | 948 | |
| 970 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle18_05(OPS_16) | |
| 949 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle18_05(OPS_16) | |
| 971 | 950 | { |
| 972 | 951 | UINT8 subinstr2 = (op & 0x0700) >> 8; |
| 973 | 952 | |
| r242631 | r242632 | |
| 975 | 954 | { |
| 976 | 955 | case 0x00: return arcompact_handle18_05_00(PARAMS); // ADD_S (SP) |
| 977 | 956 | case 0x01: return arcompact_handle18_05_01(PARAMS); // SUB_S (SP) |
| 978 | case 0x02: return arcompact_handle18_05_02(PARAMS); // <illegal 0x18_05_02> | |
| 957 | case 0x02: return arcompact_handle18_05_02(PARAMS); // <illegal 0x18_05_02> | |
| 979 | 958 | case 0x03: return arcompact_handle18_05_03(PARAMS); // <illegal 0x18_05_03> |
| 980 | 959 | case 0x04: return arcompact_handle18_05_04(PARAMS); // <illegal 0x18_05_04> |
| 981 | 960 | case 0x05: return arcompact_handle18_05_05(PARAMS); // <illegal 0x18_05_05> |
| r242631 | r242632 | |
| 986 | 965 | return 0; |
| 987 | 966 | } |
| 988 | 967 | |
| 989 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle18_06(OPS_16) | |
| 968 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle18_06(OPS_16) | |
| 990 | 969 | { |
| 991 | 970 | UINT8 subinstr2 = (op & 0x001f) >> 0; |
| 992 | 971 | |
| r242631 | r242632 | |
| 1029 | 1008 | return 0; |
| 1030 | 1009 | } |
| 1031 | 1010 | |
| 1032 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle18_07(OPS_16) | |
| 1011 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle18_07(OPS_16) | |
| 1033 | 1012 | { |
| 1034 | 1013 | UINT8 subinstr2 = (op & 0x001f) >> 0; |
| 1035 | 1014 | |
| r242631 | r242632 | |
| 1135 | 1114 | switch (subinstr2) |
| 1136 | 1115 | { |
| 1137 | 1116 | case 0x00: return arcompact_handle1e_03_00(PARAMS); // BGT_S |
| 1138 | case 0x01: return arcompact_handle1e_03_01(PARAMS); // BGE_S | |
| 1117 | case 0x01: return arcompact_handle1e_03_01(PARAMS); // BGE_S | |
| 1139 | 1118 | case 0x02: return arcompact_handle1e_03_02(PARAMS); // BLT_S |
| 1140 | 1119 | case 0x03: return arcompact_handle1e_03_03(PARAMS); // BLE_S |
| 1141 | 1120 | case 0x04: return arcompact_handle1e_03_04(PARAMS); // BHI_S |
| 1142 | 1121 | case 0x05: return arcompact_handle1e_03_05(PARAMS); // BHS_S |
| 1143 | 1122 | case 0x06: return arcompact_handle1e_03_06(PARAMS); // BLO_S |
| 1144 | case 0x07: return arcompact_handle1e_03_07(PARAMS); // BLS_S | |
| 1123 | case 0x07: return arcompact_handle1e_03_07(PARAMS); // BLS_S | |
| 1145 | 1124 | } |
| 1146 | 1125 | |
| 1147 | 1126 | return 0; |
| r242631 | r242632 | |
| 1177 | 1156 | } |
| 1178 | 1157 | else |
| 1179 | 1158 | { |
| 1180 | // | |
| 1159 | // m_regs[REG_BLINK] = m_pc + (size >> 0); // don't link | |
| 1181 | 1160 | return realaddress; |
| 1182 | 1161 | } |
| 1183 | 1162 | |
| r242631 | r242632 | |
| 1194 | 1173 | address |= ((op & 0x0000000f) >> 0) << 20; |
| 1195 | 1174 | if (address & 0x800000) address = -0x800000 + (address & 0x7fffff); |
| 1196 | 1175 | int n = (op & 0x00000020) >> 5; op &= ~0x00000020; |
| 1197 | // | |
| 1176 | // int res = (op & 0x00000010) >> 4; op &= ~0x00000010; // should be set to 0 | |
| 1198 | 1177 | |
| 1199 | 1178 | UINT32 realaddress = PC_ALIGNED32 + (address * 2); |
| 1200 | 1179 | |
| r242631 | r242632 | |
| 1206 | 1185 | } |
| 1207 | 1186 | else |
| 1208 | 1187 | { |
| 1209 | // | |
| 1188 | // m_regs[REG_BLINK] = m_pc + (size >> 0); // don't link | |
| 1210 | 1189 | return realaddress; |
| 1211 | 1190 | } |
| 1212 | 1191 | |
| r242631 | r242632 | |
| 1234 | 1213 | INT32 address = (op & 0x07fc0000) >> 17; |
| 1235 | 1214 | address |= ((op & 0x0000ffc0) >> 6) << 10; |
| 1236 | 1215 | address |= ((op & 0x0000000f) >> 0) << 20; |
| 1237 | if (address & 0x800000) address = -0x800000 + (address&0x7fffff); | |
| 1216 | if (address & 0x800000) address = -0x800000 + (address&0x7fffff); | |
| 1238 | 1217 | int n = (op & 0x00000020) >> 5; op &= ~0x00000020; |
| 1239 | // | |
| 1218 | // int res = (op & 0x00000010) >> 4; op &= ~0x00000010; | |
| 1240 | 1219 | |
| 1241 | 1220 | UINT32 realaddress = PC_ALIGNED32 + (address * 2); |
| 1242 | 1221 | |
| r242631 | r242632 | |
| 1271 | 1250 | |
| 1272 | 1251 | if ((breg != LIMM_REG) && (creg != LIMM_REG)) |
| 1273 | 1252 | { |
| 1274 | ||
| 1275 | 1253 | } |
| 1276 | 1254 | else |
| 1277 | 1255 | { |
| r242631 | r242632 | |
| 1305 | 1283 | UINT32 limm; \ |
| 1306 | 1284 | GET_LIMM_32; \ |
| 1307 | 1285 | size = 8; \ |
| 1308 | ||
| 1286 | \ | |
| 1309 | 1287 | if (breg == LIMM_REG) \ |
| 1310 | 1288 | b = limm; \ |
| 1311 | 1289 | else \ |
| 1312 | 1290 | b = m_regs[breg]; \ |
| 1313 | ||
| 1291 | \ | |
| 1314 | 1292 | if (creg == LIMM_REG) \ |
| 1315 | 1293 | c = limm; \ |
| 1316 | 1294 | else \ |
| 1317 | 1295 | c = m_regs[creg]; \ |
| 1318 | } \ | |
| 1319 | ||
| 1296 | } | |
| 1320 | 1297 | #define BR_TAKEJUMP \ |
| 1321 | 1298 | /* take jump */ \ |
| 1322 | 1299 | UINT32 realaddress = PC_ALIGNED32 + (address * 2); \ |
| 1323 | | |
| 1300 | \ | |
| 1324 | 1301 | if (n) \ |
| 1325 | 1302 | { \ |
| 1326 | 1303 | m_delayactive = 1; \ |
| r242631 | r242632 | |
| 1330 | 1307 | else \ |
| 1331 | 1308 | { \ |
| 1332 | 1309 | return realaddress; \ |
| 1333 | } | |
| 1310 | } | |
| 1334 | 1311 | |
| 1335 | 1312 | |
| 1336 | ||
| 1337 | 1313 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle01_01_00_00(OPS_32) // register - register BREQ |
| 1338 | 1314 | { |
| 1339 | 1315 | BR_REGREG_SETUP |
| r242631 | r242632 | |
| 1343 | 1319 | { |
| 1344 | 1320 | BR_TAKEJUMP |
| 1345 | 1321 | } |
| 1346 | ||
| 1322 | ||
| 1347 | 1323 | return m_pc + (size>>0); |
| 1348 | 1324 | } |
| 1349 | 1325 | |
| r242631 | r242632 | |
| 1356 | 1332 | { |
| 1357 | 1333 | BR_TAKEJUMP |
| 1358 | 1334 | } |
| 1359 | ||
| 1335 | ||
| 1360 | 1336 | return m_pc + (size>>0); |
| 1361 | 1337 | } |
| 1362 | 1338 | |
| r242631 | r242632 | |
| 1369 | 1345 | { |
| 1370 | 1346 | BR_TAKEJUMP |
| 1371 | 1347 | } |
| 1372 | ||
| 1348 | ||
| 1373 | 1349 | return m_pc + (size>>0); |
| 1374 | 1350 | |
| 1375 | 1351 | } |
| 1376 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle01_01_00_03(OPS_32) // register - register BRGE | |
| 1352 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle01_01_00_03(OPS_32) // register - register BRGE | |
| 1377 | 1353 | { |
| 1378 | 1354 | BR_REGREG_SETUP |
| 1379 | ||
| 1355 | ||
| 1380 | 1356 | // BRGE (signed operation) |
| 1381 | 1357 | if ((INT32)b >= (INT32)c) |
| 1382 | 1358 | { |
| 1383 | 1359 | BR_TAKEJUMP |
| 1384 | 1360 | } |
| 1385 | ||
| 1361 | ||
| 1386 | 1362 | return m_pc + (size>>0); |
| 1387 | 1363 | } |
| 1388 | 1364 | |
| r242631 | r242632 | |
| 1395 | 1371 | { |
| 1396 | 1372 | BR_TAKEJUMP |
| 1397 | 1373 | } |
| 1398 | ||
| 1374 | ||
| 1399 | 1375 | return m_pc + (size>>0); |
| 1400 | 1376 | } |
| 1401 | 1377 | |
| r242631 | r242632 | |
| 1409 | 1385 | { |
| 1410 | 1386 | BR_TAKEJUMP |
| 1411 | 1387 | } |
| 1412 | ||
| 1388 | ||
| 1413 | 1389 | return m_pc + (size>>0); |
| 1414 | 1390 | } |
| 1415 | 1391 | |
| r242631 | r242632 | |
| 1443 | 1419 | GET_LIMM_32; \ |
| 1444 | 1420 | size = 8; \ |
| 1445 | 1421 | b = limm; \ |
| 1446 | } | |
| 1422 | } | |
| 1447 | 1423 | |
| 1448 | ||
| 1449 | 1424 | // register -immediate cases |
| 1450 | 1425 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle01_01_01_00(OPS_32) // BREQ reg-imm |
| 1451 | 1426 | { |
| 1452 | 1427 | BR_REGIMM_SETUP |
| 1453 | ||
| 1428 | ||
| 1454 | 1429 | // BREQ |
| 1455 | 1430 | if (b == c) |
| 1456 | 1431 | { |
| 1457 | 1432 | BR_TAKEJUMP |
| 1458 | 1433 | } |
| 1459 | ||
| 1434 | ||
| 1460 | 1435 | return m_pc + (size>>0); |
| 1461 | 1436 | } |
| 1462 | 1437 | |
| 1463 | 1438 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle01_01_01_01(OPS_32) // BRNE reg-imm |
| 1464 | 1439 | { |
| 1465 | 1440 | BR_REGIMM_SETUP |
| 1466 | ||
| 1441 | ||
| 1467 | 1442 | // BRNE |
| 1468 | 1443 | if (b != c) |
| 1469 | 1444 | { |
| 1470 | 1445 | BR_TAKEJUMP |
| 1471 | 1446 | } |
| 1472 | ||
| 1447 | ||
| 1473 | 1448 | return m_pc + (size>>0); |
| 1474 | 1449 | } |
| 1475 | 1450 | |
| r242631 | r242632 | |
| 1478 | 1453 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle01_01_01_02(OPS_32) // BRLT reg-imm |
| 1479 | 1454 | { |
| 1480 | 1455 | BR_REGIMM_SETUP |
| 1481 | ||
| 1456 | ||
| 1482 | 1457 | // BRLT (signed operation) |
| 1483 | 1458 | if ((INT32)b < (INT32)c) |
| 1484 | 1459 | { |
| 1485 | 1460 | BR_TAKEJUMP |
| 1486 | 1461 | } |
| 1487 | ||
| 1462 | ||
| 1488 | 1463 | return m_pc + (size>>0); |
| 1489 | 1464 | |
| 1490 | 1465 | } |
| 1491 | 1466 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle01_01_01_03(OPS_32) |
| 1492 | 1467 | { |
| 1493 | 1468 | BR_REGIMM_SETUP |
| 1494 | ||
| 1469 | ||
| 1495 | 1470 | // BRGE (signed operation) |
| 1496 | 1471 | if ((INT32)b >= (INT32)c) |
| 1497 | 1472 | { |
| 1498 | 1473 | BR_TAKEJUMP |
| 1499 | 1474 | } |
| 1500 | ||
| 1475 | ||
| 1501 | 1476 | return m_pc + (size>>0); |
| 1502 | 1477 | } |
| 1503 | 1478 | |
| r242631 | r242632 | |
| 1510 | 1485 | { |
| 1511 | 1486 | BR_TAKEJUMP |
| 1512 | 1487 | } |
| 1513 | ||
| 1488 | ||
| 1514 | 1489 | return m_pc + (size>>0); |
| 1515 | 1490 | |
| 1516 | 1491 | } |
| r242631 | r242632 | |
| 1524 | 1499 | { |
| 1525 | 1500 | BR_TAKEJUMP |
| 1526 | 1501 | } |
| 1527 | ||
| 1502 | ||
| 1528 | 1503 | return m_pc + (size>>0); |
| 1529 | 1504 | } |
| 1530 | 1505 | |
| r242631 | r242632 | |
| 1547 | 1522 | int X = (op & 0x00000040) >> 6; //op &= ~0x00000040; |
| 1548 | 1523 | int Z = (op & 0x00000180) >> 7; //op &= ~0x00000180; |
| 1549 | 1524 | int a = (op & 0x00000600) >> 9; //op &= ~0x00000600; |
| 1550 | // | |
| 1525 | // int D = (op & 0x00000800) >> 11;// op &= ~0x00000800; // we don't use the data cache currently | |
| 1551 | 1526 | |
| 1552 | 1527 | UINT32 address = m_regs[breg]; |
| 1553 | 1528 | |
| r242631 | r242632 | |
| 1635 | 1610 | { |
| 1636 | 1611 | int size = 4; |
| 1637 | 1612 | UINT32 limm = 0; |
| 1638 | int got_limm = 0; | |
| 1613 | int got_limm = 0; | |
| 1639 | 1614 | int S = (op & 0x00008000) >> 15; |
| 1640 | 1615 | int s = (op & 0x00ff0000) >> 16; |
| 1641 | 1616 | if (S) s = -0x100 + s; |
| 1642 | 1617 | |
| 1643 | 1618 | COMMON32_GET_breg; |
| 1644 | 1619 | COMMON32_GET_creg; |
| 1645 | ||
| 1646 | // int R = (op & 0x00000001) >> 0; // bit 0 is reserved | |
| 1647 | int Z = (op & 0x00000006) >> 1; | |
| 1648 | int a = (op & 0x00000018) >> 3; | |
| 1649 | // int D = (op & 0x00000020) >> 5; // we don't use the data cache currently | |
| 1650 | 1620 | |
| 1621 | // int R = (op & 0x00000001) >> 0; // bit 0 is reserved | |
| 1622 | int Z = (op & 0x00000006) >> 1; | |
| 1623 | int a = (op & 0x00000018) >> 3; | |
| 1624 | // int D = (op & 0x00000020) >> 5; // we don't use the data cache currently | |
| 1651 | 1625 | |
| 1626 | ||
| 1652 | 1627 | UINT32 address = m_regs[breg]; |
| 1653 | 1628 | |
| 1654 | 1629 | if (breg == LIMM_REG) |
| r242631 | r242632 | |
| 1738 | 1713 | |
| 1739 | 1714 | COMMON32_GET_p; |
| 1740 | 1715 | COMMON32_GET_breg; |
| 1741 | ||
| 1716 | ||
| 1742 | 1717 | if (!b_reserved) |
| 1743 | 1718 | { |
| 1744 | 1719 | if (breg == LIMM_REG) |
| r242631 | r242632 | |
| 1813 | 1788 | |
| 1814 | 1789 | #include "cpu/arcompact/arcompact.inc" |
| 1815 | 1790 | |
| 1816 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_01(OPS_32) | |
| 1817 | { | |
| 1791 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_01(OPS_32) | |
| 1792 | { | |
| 1818 | 1793 | return arcompact_handle04_helper(PARAMS, opcodes_04[0x01], /*"ADC"*/ 0,0); |
| 1819 | 1794 | } |
| 1820 | 1795 | |
| 1821 | 1796 | |
| 1822 | 1797 | |
| 1823 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_03(OPS_32) | |
| 1798 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_03(OPS_32) | |
| 1824 | 1799 | { |
| 1825 | 1800 | return arcompact_handle04_helper(PARAMS, opcodes_04[0x03], /*"SBC"*/ 0,0); |
| 1826 | 1801 | } |
| 1827 | 1802 | |
| 1828 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_08(OPS_32) | |
| 1803 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_08(OPS_32) | |
| 1829 | 1804 | { |
| 1830 | 1805 | return arcompact_handle04_helper(PARAMS, opcodes_04[0x08], /*"MAX"*/ 0,0); |
| 1831 | 1806 | } |
| 1832 | 1807 | |
| 1833 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_09(OPS_32) | |
| 1808 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_09(OPS_32) | |
| 1834 | 1809 | { |
| 1835 | 1810 | return arcompact_handle04_helper(PARAMS, opcodes_04[0x09], /*"MIN"*/ 0,0); |
| 1836 | 1811 | } |
| r242631 | r242632 | |
| 1848 | 1823 | } |
| 1849 | 1824 | |
| 1850 | 1825 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_0d(OPS_32) |
| 1851 | { | |
| 1826 | { | |
| 1852 | 1827 | return arcompact_handle04_helper(PARAMS, opcodes_04[0x0d], /*"RCMP"*/ 1,0); |
| 1853 | 1828 | } |
| 1854 | 1829 | |
| 1855 | 1830 | |
| 1856 | 1831 | |
| 1857 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_10(OPS_32) | |
| 1858 | { | |
| 1832 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_10(OPS_32) | |
| 1833 | { | |
| 1859 | 1834 | return arcompact_handle04_helper(PARAMS, opcodes_04[0x10], /*"BCLR"*/ 0,0); |
| 1860 | 1835 | } |
| 1861 | 1836 | |
| 1862 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_11(OPS_32) | |
| 1863 | { | |
| 1837 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_11(OPS_32) | |
| 1838 | { | |
| 1864 | 1839 | return arcompact_handle04_helper(PARAMS, opcodes_04[0x11], /*"BTST"*/ 0,0); |
| 1865 | 1840 | } |
| 1866 | 1841 | |
| 1867 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_12(OPS_32) | |
| 1868 | { | |
| 1842 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_12(OPS_32) | |
| 1843 | { | |
| 1869 | 1844 | return arcompact_handle04_helper(PARAMS, opcodes_04[0x12], /*"BXOR"*/ 0,0); |
| 1870 | 1845 | } |
| 1871 | 1846 | |
| r242631 | r242632 | |
| 1874 | 1849 | |
| 1875 | 1850 | |
| 1876 | 1851 | |
| 1877 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_1a(OPS_32) | |
| 1878 | { | |
| 1852 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_1a(OPS_32) | |
| 1853 | { | |
| 1879 | 1854 | return arcompact_handle04_helper(PARAMS, opcodes_04[0x1a], /*"MPY"*/ 0,0); |
| 1880 | 1855 | } // * |
| 1881 | 1856 | |
| 1882 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_1b(OPS_32) | |
| 1883 | { | |
| 1857 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_1b(OPS_32) | |
| 1858 | { | |
| 1884 | 1859 | return arcompact_handle04_helper(PARAMS, opcodes_04[0x1b], /*"MPYH"*/ 0,0); |
| 1885 | 1860 | } // * |
| 1886 | 1861 | |
| 1887 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_1c(OPS_32) | |
| 1888 | { | |
| 1862 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_1c(OPS_32) | |
| 1863 | { | |
| 1889 | 1864 | return arcompact_handle04_helper(PARAMS, opcodes_04[0x1c], /*"MPYHU"*/ 0,0); |
| 1890 | 1865 | } // * |
| 1891 | 1866 | |
| 1892 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_1d(OPS_32) | |
| 1893 | { | |
| 1867 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_1d(OPS_32) | |
| 1868 | { | |
| 1894 | 1869 | return arcompact_handle04_helper(PARAMS, opcodes_04[0x1d], /*"MPYU"*/ 0,0); |
| 1895 | 1870 | } // * |
| 1896 | 1871 | |
| r242631 | r242632 | |
| 1903 | 1878 | COMMON32_GET_creg |
| 1904 | 1879 | COMMON32_GET_F |
| 1905 | 1880 | |
| 1906 | if (creg == LIMM_REG) | |
| 1881 | if (creg == LIMM_REG) | |
| 1907 | 1882 | { |
| 1908 | 1883 | // opcode iiii i--- ppII IIII F--- CCCC CC-- ---- |
| 1909 | 1884 | // J limm 0010 0RRR 0010 0000 0RRR 1111 10RR RRRR [LIMM] (creg = LIMM) |
| r242631 | r242632 | |
| 1945 | 1920 | } |
| 1946 | 1921 | else |
| 1947 | 1922 | { |
| 1948 | ||
| 1949 | 1923 | return m_regs[creg]; |
| 1950 | 1924 | } |
| 1951 | 1925 | } |
| r242631 | r242632 | |
| 2003 | 1977 | // opcode iiii i--- ppII IIII F--- cccc ccmq qqqq |
| 2004 | 1978 | // Jcc [c] 0010 0RRR 1110 0000 0RRR CCCC CC0Q QQQQ |
| 2005 | 1979 | // no conditional links to ILINK1, ILINK2? |
| 2006 | ||
| 1980 | ||
| 2007 | 1981 | c = m_regs[creg]; |
| 2008 | 1982 | } |
| 2009 | 1983 | |
| r242631 | r242632 | |
| 2026 | 2000 | } |
| 2027 | 2001 | |
| 2028 | 2002 | if (F) |
| 2029 | { | |
| 2003 | { | |
| 2030 | 2004 | // if F is set then the destination MUST be ILINK1 or ILINK2 |
| 2031 | 2005 | |
| 2032 | 2006 | if ((creg == REG_ILINK1) || (creg == REG_ILINK1)) |
| r242631 | r242632 | |
| 2037 | 2011 | { |
| 2038 | 2012 | arcompact_fatal ("fatal arcompact_handle04_20_p11_m0 J %08x (F set but not ILINK1 or ILINK2 used as dst)", op); |
| 2039 | 2013 | |
| 2040 | } | |
| 2014 | } | |
| 2041 | 2015 | } |
| 2042 | 2016 | |
| 2043 | 2017 | |
| r242631 | r242632 | |
| 2076 | 2050 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_28(OPS_32) // LPcc (loop setup) |
| 2077 | 2051 | { |
| 2078 | 2052 | int size = 4; |
| 2079 | // | |
| 2053 | // COMMON32_GET_breg; // breg is reserved | |
| 2080 | 2054 | COMMON32_GET_p; |
| 2081 | 2055 | |
| 2082 | 2056 | if (p == 0x00) |
| r242631 | r242632 | |
| 2099 | 2073 | COMMON32_GET_u6 |
| 2100 | 2074 | COMMON32_GET_CONDITION |
| 2101 | 2075 | //arcompact_fatal("Lp conditional %s not supported %d", conditions[condition], u); |
| 2102 | ||
| 2076 | ||
| 2103 | 2077 | // if the loop condition fails then just jump to after the end of the loop, don't set any registers |
| 2104 | 2078 | if (!check_condition(condition)) |
| 2105 | 2079 | { |
| r242631 | r242632 | |
| 2124 | 2098 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2a(OPS_32) // Load FROM Auxiliary register TO register |
| 2125 | 2099 | { |
| 2126 | 2100 | int size = 4; |
| 2127 | // | |
| 2101 | // UINT32 limm = 0; | |
| 2128 | 2102 | int got_limm = 0; |
| 2129 | 2103 | |
| 2130 | 2104 | COMMON32_GET_p; |
| r242631 | r242632 | |
| 2132 | 2106 | |
| 2133 | 2107 | if (p == 0) |
| 2134 | 2108 | { |
| 2135 | ||
| 2136 | 2109 | COMMON32_GET_creg |
| 2137 | 2110 | |
| 2138 | 2111 | if (creg == LIMM_REG) |
| r242631 | r242632 | |
| 2142 | 2115 | //GET_LIMM_32; |
| 2143 | 2116 | size = 8; |
| 2144 | 2117 | } |
| 2145 | ||
| 2118 | ||
| 2146 | 2119 | } |
| 2147 | 2120 | else |
| 2148 | 2121 | { |
| r242631 | r242632 | |
| 2176 | 2149 | |
| 2177 | 2150 | COMMON32_GET_p; |
| 2178 | 2151 | //COMMON32_GET_breg; |
| 2179 | ||
| 2152 | ||
| 2180 | 2153 | if (p == 0) |
| 2181 | 2154 | { |
| 2182 | 2155 | COMMON32_GET_creg |
| r242631 | r242632 | |
| 2185 | 2158 | { |
| 2186 | 2159 | //UINT32 limm; |
| 2187 | 2160 | //GET_LIMM_32; |
| 2188 | size = 8; | |
| 2161 | size = 8; | |
| 2189 | 2162 | } |
| 2190 | 2163 | else |
| 2191 | 2164 | { |
| r242631 | r242632 | |
| 2265 | 2238 | } |
| 2266 | 2239 | else |
| 2267 | 2240 | { |
| 2268 | } | |
| 2241 | } | |
| 2269 | 2242 | |
| 2270 | 2243 | arcompact_log("unimplemented LD %08x (type 04_3x)", op); |
| 2271 | 2244 | return m_pc + (size>>0); |
| r242631 | r242632 | |
| 2313 | 2286 | |
| 2314 | 2287 | COMMON32_GET_p; |
| 2315 | 2288 | //COMMON32_GET_breg; |
| 2316 | ||
| 2289 | ||
| 2317 | 2290 | if (p == 0) |
| 2318 | 2291 | { |
| 2319 | 2292 | COMMON32_GET_creg |
| r242631 | r242632 | |
| 2322 | 2295 | { |
| 2323 | 2296 | //UINT32 limm; |
| 2324 | 2297 | //GET_LIMM_32; |
| 2325 | size = 8; | |
| 2298 | size = 8; | |
| 2326 | 2299 | |
| 2327 | 2300 | } |
| 2328 | 2301 | else |
| r242631 | r242632 | |
| 2454 | 2427 | int size = 2; |
| 2455 | 2428 | |
| 2456 | 2429 | GROUP_0e_GET_h; |
| 2457 | ||
| 2430 | ||
| 2458 | 2431 | if (h == LIMM_REG) |
| 2459 | 2432 | { |
| 2460 | 2433 | //UINT32 limm; |
| r242631 | r242632 | |
| 2463 | 2436 | } |
| 2464 | 2437 | else |
| 2465 | 2438 | { |
| 2466 | ||
| 2467 | 2439 | } |
| 2468 | 2440 | |
| 2469 | 2441 | arcompact_log("unimplemented %s %04x (0x0e_0x group)", optext, op); |
| r242631 | r242632 | |
| 2480 | 2452 | GROUP_0e_GET_h; |
| 2481 | 2453 | COMMON16_GET_breg; |
| 2482 | 2454 | REG_16BIT_RANGE(breg); |
| 2483 | ||
| 2455 | ||
| 2484 | 2456 | if (h == LIMM_REG) |
| 2485 | 2457 | { |
| 2486 | 2458 | UINT32 limm; |
| r242631 | r242632 | |
| 2499 | 2471 | } |
| 2500 | 2472 | |
| 2501 | 2473 | // 16-bit MOV with extended register range |
| 2502 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0e_01(OPS_16) // MOV_S b <- h | |
| 2474 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0e_01(OPS_16) // MOV_S b <- h | |
| 2503 | 2475 | { |
| 2504 | 2476 | int h,breg; |
| 2505 | 2477 | int size = 2; |
| r242631 | r242632 | |
| 2507 | 2479 | GROUP_0e_GET_h; |
| 2508 | 2480 | COMMON16_GET_breg; |
| 2509 | 2481 | REG_16BIT_RANGE(breg); |
| 2510 | ||
| 2482 | ||
| 2511 | 2483 | if (h == LIMM_REG) |
| 2512 | 2484 | { |
| 2513 | 2485 | // opcode iiii ibbb hhhI Ihhh |
| r242631 | r242632 | |
| 2543 | 2515 | GROUP_0e_GET_h; |
| 2544 | 2516 | COMMON16_GET_breg; |
| 2545 | 2517 | REG_16BIT_RANGE(breg); |
| 2546 | ||
| 2518 | ||
| 2547 | 2519 | if (h == LIMM_REG) // no result.. |
| 2548 | 2520 | { |
| 2549 | ||
| 2550 | 2521 | } |
| 2551 | 2522 | |
| 2552 | 2523 | m_regs[h] = m_regs[breg]; |
| r242631 | r242632 | |
| 2573 | 2544 | |
| 2574 | 2545 | COMMON16_GET_breg; |
| 2575 | 2546 | REG_16BIT_RANGE(breg); |
| 2576 | ||
| 2547 | ||
| 2577 | 2548 | m_regs[REG_BLINK] = m_pc + (2 >> 0); |
| 2578 | ||
| 2549 | ||
| 2579 | 2550 | return m_regs[breg]; |
| 2580 | 2551 | } |
| 2581 | 2552 | |
| r242631 | r242632 | |
| 2586 | 2557 | |
| 2587 | 2558 | COMMON16_GET_breg; |
| 2588 | 2559 | REG_16BIT_RANGE(breg); |
| 2589 | ||
| 2560 | ||
| 2590 | 2561 | m_delayactive = 1; |
| 2591 | 2562 | m_delayjump = m_regs[breg]; |
| 2592 | 2563 | m_delaylinks = 1; |
| 2593 | ||
| 2564 | ||
| 2594 | 2565 | return m_pc + (2 >> 0); |
| 2595 | 2566 | } |
| 2596 | 2567 | |
| r242631 | r242632 | |
| 2616 | 2587 | m_delayactive = 1; |
| 2617 | 2588 | m_delayjump = m_regs[REG_BLINK]; |
| 2618 | 2589 | m_delaylinks = 0; |
| 2619 | ||
| 2590 | ||
| 2620 | 2591 | return m_pc + (2 >> 0); |
| 2621 | 2592 | } |
| 2622 | 2593 | |
| r242631 | r242632 | |
| 2679 | 2650 | |
| 2680 | 2651 | |
| 2681 | 2652 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle10(OPS_16) |
| 2682 | { // LD_S c, [b, u7] | |
| 2653 | { // LD_S c, [b, u7] | |
| 2683 | 2654 | int breg, creg, u; |
| 2684 | 2655 | |
| 2685 | 2656 | COMMON16_GET_breg; |
| r242631 | r242632 | |
| 2697 | 2668 | |
| 2698 | 2669 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle11(OPS_16) |
| 2699 | 2670 | { |
| 2700 | ||
| 2671 | // LDB_S c, [b, u5] | |
| 2701 | 2672 | int breg, creg, u; |
| 2702 | 2673 | |
| 2703 | 2674 | COMMON16_GET_breg; |
| r242631 | r242632 | |
| 2707 | 2678 | REG_16BIT_RANGE(breg); |
| 2708 | 2679 | REG_16BIT_RANGE(creg); |
| 2709 | 2680 | |
| 2710 | // | |
| 2681 | // u <<= 0; // check | |
| 2711 | 2682 | m_regs[creg] = READ8((m_regs[breg] + u) >> 0); |
| 2712 | 2683 | |
| 2713 | 2684 | return m_pc + (2 >> 0); |
| r242631 | r242632 | |
| 2715 | 2686 | |
| 2716 | 2687 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle12(OPS_16) |
| 2717 | 2688 | { |
| 2718 | ||
| 2689 | // LDB_W c, [b, u6] | |
| 2719 | 2690 | int breg, creg, u; |
| 2720 | 2691 | |
| 2721 | 2692 | COMMON16_GET_breg; |
| r242631 | r242632 | |
| 2765 | 2736 | REG_16BIT_RANGE(breg); |
| 2766 | 2737 | REG_16BIT_RANGE(creg); |
| 2767 | 2738 | |
| 2768 | // | |
| 2739 | // u <<= 0; | |
| 2769 | 2740 | |
| 2770 | 2741 | WRITE8((m_regs[breg] + u) >> 0, m_regs[creg]); |
| 2771 | 2742 | |
| r242631 | r242632 | |
| 2833 | 2804 | return m_pc + (2 >> 0); |
| 2834 | 2805 | } |
| 2835 | 2806 | |
| 2836 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle18_01(OPS_16) | |
| 2807 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle18_01(OPS_16) | |
| 2837 | 2808 | { |
| 2838 | 2809 | return arcompact_handle18_0x_helper(PARAMS, "LDB_S (SP)", 0); |
| 2839 | 2810 | } |
| r242631 | r242632 | |
| 2855 | 2826 | return m_pc + (2 >> 0); |
| 2856 | 2827 | } |
| 2857 | 2828 | |
| 2858 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle18_03(OPS_16) | |
| 2829 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle18_03(OPS_16) | |
| 2859 | 2830 | { |
| 2860 | 2831 | return arcompact_handle18_0x_helper(PARAMS, "STB_S (SP)", 1); |
| 2861 | 2832 | } |
| r242631 | r242632 | |
| 2896 | 2867 | return m_pc + (2 >> 0); |
| 2897 | 2868 | } |
| 2898 | 2869 | |
| 2899 | // op bits remaining for 0x18_06_xx subgroups 0x0700 | |
| 2870 | // op bits remaining for 0x18_06_xx subgroups 0x0700 | |
| 2900 | 2871 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle18_06_01(OPS_16) // POP_S b |
| 2901 | 2872 | { |
| 2902 | 2873 | int breg; |
| 2903 | 2874 | COMMON16_GET_breg; |
| 2904 | 2875 | REG_16BIT_RANGE(breg); |
| 2905 | ||
| 2876 | ||
| 2906 | 2877 | m_regs[breg] = READ32(m_regs[REG_SP] >> 2); |
| 2907 | 2878 | m_regs[REG_SP] += 4; |
| 2908 | 2879 | |
| r242631 | r242632 | |
| 2918 | 2889 | return m_pc + (2 >> 0); |
| 2919 | 2890 | } |
| 2920 | 2891 | |
| 2921 | // op bits remaining for 0x18_07_xx subgroups 0x0700 | |
| 2892 | // op bits remaining for 0x18_07_xx subgroups 0x0700 | |
| 2922 | 2893 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle18_07_01(OPS_16) // PUSH_S b |
| 2923 | 2894 | { |
| 2924 | 2895 | int breg; |
| 2925 | 2896 | COMMON16_GET_breg; |
| 2926 | 2897 | REG_16BIT_RANGE(breg); |
| 2927 | ||
| 2898 | ||
| 2928 | 2899 | m_regs[REG_SP] -= 4; |
| 2929 | ||
| 2900 | ||
| 2930 | 2901 | WRITE32(m_regs[REG_SP] >> 2, m_regs[breg]); |
| 2931 | 2902 | |
| 2932 | 2903 | return m_pc + (2 >> 0); |
| r242631 | r242632 | |
| 2938 | 2909 | // breg bits are reserved |
| 2939 | 2910 | |
| 2940 | 2911 | m_regs[REG_SP] -= 4; |
| 2941 | ||
| 2912 | ||
| 2942 | 2913 | WRITE32(m_regs[REG_SP] >> 2, m_regs[REG_BLINK]); |
| 2943 | 2914 | |
| 2944 | 2915 | return m_pc + (2 >> 0); |
| r242631 | r242632 | |
| 3058 | 3029 | |
| 3059 | 3030 | if (!m_regs[breg]) |
| 3060 | 3031 | { |
| 3061 | int s = (op & 0x007f) >> 0; | |
| 3032 | int s = (op & 0x007f) >> 0; op &= ~0x007f; | |
| 3062 | 3033 | if (s & 0x40) s = -0x40 + (s & 0x3f); |
| 3063 | 3034 | UINT32 realaddress = PC_ALIGNED32 + (s * 2); |
| 3064 | 3035 | //m_regs[REG_BLINK] = m_pc + (2 >> 0); // don't link |
| r242631 | r242632 | |
| 3077 | 3048 | |
| 3078 | 3049 | if (m_regs[breg]) |
| 3079 | 3050 | { |
| 3080 | int s = (op & 0x007f) >> 0; | |
| 3051 | int s = (op & 0x007f) >> 0; op &= ~0x007f; | |
| 3081 | 3052 | if (s & 0x40) s = -0x40 + (s & 0x3f); |
| 3082 | 3053 | UINT32 realaddress = PC_ALIGNED32 + (s * 2); |
| 3083 | 3054 | //m_regs[REG_BLINK] = m_pc + (2 >> 0); // don't link |
| r242631 | r242632 | |
| 3098 | 3069 | |
| 3099 | 3070 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle1e_00(OPS_16) // B_S s10 (branch always) |
| 3100 | 3071 | { |
| 3101 | int s = (op & 0x01ff) >> 0; | |
| 3072 | int s = (op & 0x01ff) >> 0; op &= ~0x01ff; | |
| 3102 | 3073 | if (s & 0x100) s = -0x100 + (s & 0xff); |
| 3103 | 3074 | UINT32 realaddress = PC_ALIGNED32 + (s * 2); |
| 3104 | 3075 | //m_regs[REG_BLINK] = m_pc + (2 >> 0); // don't link |
| r242631 | r242632 | |
| 3109 | 3080 | { |
| 3110 | 3081 | if (STATUS32_CHECK_Z) |
| 3111 | 3082 | { |
| 3112 | int s = (op & 0x01ff) >> 0; | |
| 3083 | int s = (op & 0x01ff) >> 0; op &= ~0x01ff; | |
| 3113 | 3084 | if (s & 0x100) s = -0x100 + (s & 0xff); |
| 3114 | 3085 | UINT32 realaddress = PC_ALIGNED32 + (s * 2); |
| 3115 | 3086 | //m_regs[REG_BLINK] = m_pc + (2 >> 0); // don't link |
| r242631 | r242632 | |
| 3123 | 3094 | { |
| 3124 | 3095 | if (!STATUS32_CHECK_Z) |
| 3125 | 3096 | { |
| 3126 | int s = (op & 0x01ff) >> 0; | |
| 3097 | int s = (op & 0x01ff) >> 0; op &= ~0x01ff; | |
| 3127 | 3098 | if (s & 0x100) s = -0x100 + (s & 0xff); |
| 3128 | 3099 | UINT32 realaddress = PC_ALIGNED32 + (s * 2); |
| 3129 | 3100 | //m_regs[REG_BLINK] = m_pc + (2 >> 0); // don't link |
| r242631 | r242632 | |
| 3146 | 3117 | { |
| 3147 | 3118 | if (CONDITION_LT) |
| 3148 | 3119 | { |
| 3149 | int s = (op & 0x003f) >> 0; | |
| 3120 | int s = (op & 0x003f) >> 0; op &= ~0x003f; | |
| 3150 | 3121 | if (s & 0x020) s = -0x20 + (s & 0x1f); |
| 3151 | 3122 | UINT32 realaddress = PC_ALIGNED32 + (s * 2); |
| 3152 | 3123 | //m_regs[REG_BLINK] = m_pc + (2 >> 0); // don't link |
| r242631 | r242632 | |
| 3160 | 3131 | { |
| 3161 | 3132 | if (CONDITION_LE) |
| 3162 | 3133 | { |
| 3163 | int s = (op & 0x003f) >> 0; | |
| 3134 | int s = (op & 0x003f) >> 0; op &= ~0x003f; | |
| 3164 | 3135 | if (s & 0x020) s = -0x20 + (s & 0x1f); |
| 3165 | 3136 | UINT32 realaddress = PC_ALIGNED32 + (s * 2); |
| 3166 | 3137 | //m_regs[REG_BLINK] = m_pc + (2 >> 0); // don't link |
| r242631 | r242632 | |
| 3177 | 3148 | |
| 3178 | 3149 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle1f(OPS_16) // BL_S s13 |
| 3179 | 3150 | { |
| 3180 | int s = (op & 0x07ff) >> 0; | |
| 3151 | int s = (op & 0x07ff) >> 0; op &= ~0x07ff; | |
| 3181 | 3152 | if (s & 0x400) s = -0x400 + (s & 0x3ff); |
| 3182 | 3153 | |
| 3183 | 3154 | UINT32 realaddress = PC_ALIGNED32 + (s * 4); |
| r242631 | r242632 | |
| 3600 | 3571 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle18_07_1d(OPS_16) { arcompact_fatal("<illegal 0x18_07_1d> (%04x)", op); return m_pc + (2 >> 0);} |
| 3601 | 3572 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle18_07_1e(OPS_16) { arcompact_fatal("<illegal 0x18_07_1e> (%04x)", op); return m_pc + (2 >> 0);} |
| 3602 | 3573 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle18_07_1f(OPS_16) { arcompact_fatal("<illegal 0x18_07_1f> (%04x)", op); return m_pc + (2 >> 0);} |
| 3603 | ||
| 3604 | ||
| 3605 |
| r242631 | r242632 | |
|---|---|---|
| 41 | 41 | |
| 42 | 42 | switch (instruction) // 32-bit instructions (with optional extra dword for immediate data) |
| 43 | 43 | { |
| 44 | case 0x00: size = arcompact_handle00_dasm(DASM_PARAMS); break; // Bcc | |
| 45 | case 0x01: size = arcompact_handle01_dasm(DASM_PARAMS); break; // BLcc/BRcc | |
| 46 | case 0x02: size = arcompact_handle02_dasm(DASM_PARAMS); break; // LD r+o | |
| 47 | case 0x03: size = arcompact_handle03_dasm(DASM_PARAMS); break; // ST r+o | |
| 48 | case 0x04: size = arcompact_handle04_dasm(DASM_PARAMS); break; // op a,b,c (basecase) | |
| 49 | case 0x05: size = arcompact_handle05_dasm(DASM_PARAMS); break; // op a,b,c (05 ARC ext) | |
| 50 | case 0x06: size = arcompact_handle06_dasm(DASM_PARAMS); break; // op a,b,c (06 ARC ext) | |
| 51 | case 0x07: size = arcompact_handle07_dasm(DASM_PARAMS); break; // op a,b,c (07 User ext) | |
| 52 | case 0x08: size = arcompact_handle08_dasm(DASM_PARAMS); break; // op a,b,c (08 User ext) | |
| 53 | case 0x09: size = arcompact_handle09_dasm(DASM_PARAMS); break; // op a,b,c (09 Market ext) | |
| 54 | case 0x0a: size = arcompact_handle0a_dasm(DASM_PARAMS); break; // op a,b,c (0a Market ext) | |
| 55 | case 0x0b: size = arcompact_handle0b_dasm(DASM_PARAMS); break; // op a,b,c (0b Market ext) | |
| 44 | case 0x00: size = arcompact_handle00_dasm(DASM_PARAMS); break; // Bcc | |
| 45 | case 0x01: size = arcompact_handle01_dasm(DASM_PARAMS); break; // BLcc/BRcc | |
| 46 | case 0x02: size = arcompact_handle02_dasm(DASM_PARAMS); break; // LD r+o | |
| 47 | case 0x03: size = arcompact_handle03_dasm(DASM_PARAMS); break; // ST r+o | |
| 48 | case 0x04: size = arcompact_handle04_dasm(DASM_PARAMS); break; // op a,b,c (basecase) | |
| 49 | case 0x05: size = arcompact_handle05_dasm(DASM_PARAMS); break; // op a,b,c (05 ARC ext) | |
| 50 | case 0x06: size = arcompact_handle06_dasm(DASM_PARAMS); break; // op a,b,c (06 ARC ext) | |
| 51 | case 0x07: size = arcompact_handle07_dasm(DASM_PARAMS); break; // op a,b,c (07 User ext) | |
| 52 | case 0x08: size = arcompact_handle08_dasm(DASM_PARAMS); break; // op a,b,c (08 User ext) | |
| 53 | case 0x09: size = arcompact_handle09_dasm(DASM_PARAMS); break; // op a,b,c (09 Market ext) | |
| 54 | case 0x0a: size = arcompact_handle0a_dasm(DASM_PARAMS); break; // op a,b,c (0a Market ext) | |
| 55 | case 0x0b: size = arcompact_handle0b_dasm(DASM_PARAMS); break; // op a,b,c (0b Market ext) | |
| 56 | 56 | } |
| 57 | 57 | } |
| 58 | 58 | else |
| 59 | { | |
| 59 | { | |
| 60 | 60 | size = 2; |
| 61 | 61 | op &= ~0xf800; |
| 62 | 62 | |
| 63 | 63 | |
| 64 | 64 | switch (instruction) // 16-bit instructions |
| 65 | 65 | { |
| 66 | case 0x0c: size = arcompact_handle0c_dasm(DASM_PARAMS); break; // Load/Add reg-reg | |
| 67 | case 0x0d: size = arcompact_handle0d_dasm(DASM_PARAMS); break; // Add/Sub/Shft imm | |
| 68 | case 0x0e: size = arcompact_handle0e_dasm(DASM_PARAMS); break; // Mov/Cmp/Add | |
| 69 | case 0x0f: size = arcompact_handle0f_dasm(DASM_PARAMS); break; // op_S b,b,c (single 16-bit ops) | |
| 70 | case 0x10: size = arcompact_handle10_dasm(DASM_PARAMS); break; // LD_S | |
| 71 | case 0x11: size = arcompact_handle11_dasm(DASM_PARAMS); break; // LDB_S | |
| 72 | case 0x12: size = arcompact_handle12_dasm(DASM_PARAMS); break; // LDW_S | |
| 73 | case 0x13: size = arcompact_handle13_dasm(DASM_PARAMS); break; // LSW_S.X | |
| 74 | case 0x14: size = arcompact_handle14_dasm(DASM_PARAMS); break; // ST_S | |
| 75 | case 0x15: size = arcompact_handle15_dasm(DASM_PARAMS); break; // STB_S | |
| 76 | case 0x16: size = arcompact_handle16_dasm(DASM_PARAMS); break; // STW_S | |
| 77 | case 0x17: size = arcompact_handle17_dasm(DASM_PARAMS); break; // Shift/Sub/Bit | |
| 78 | case 0x18: size = arcompact_handle18_dasm(DASM_PARAMS); break; // Stack Instr | |
| 79 | case 0x19: size = arcompact_handle19_dasm(DASM_PARAMS); break; // GP Instr | |
| 80 | case 0x1a: size = arcompact_handle1a_dasm(DASM_PARAMS); break; // PCL Instr | |
| 81 | case 0x1b: size = arcompact_handle1b_dasm(DASM_PARAMS); break; // MOV_S | |
| 82 | case 0x1c: size = arcompact_handle1c_dasm(DASM_PARAMS); break; // ADD_S/CMP_S | |
| 83 | case 0x1d: size = arcompact_handle1d_dasm(DASM_PARAMS); break; // BRcc_S | |
| 84 | case 0x1e: size = arcompact_handle1e_dasm(DASM_PARAMS); break; // Bcc_S | |
| 85 | case 0x1f: size = arcompact_handle1f_dasm(DASM_PARAMS); break; // BL_S | |
| 66 | case 0x0c: size = arcompact_handle0c_dasm(DASM_PARAMS); break; // Load/Add reg-reg | |
| 67 | case 0x0d: size = arcompact_handle0d_dasm(DASM_PARAMS); break; // Add/Sub/Shft imm | |
| 68 | case 0x0e: size = arcompact_handle0e_dasm(DASM_PARAMS); break; // Mov/Cmp/Add | |
| 69 | case 0x0f: size = arcompact_handle0f_dasm(DASM_PARAMS); break; // op_S b,b,c (single 16-bit ops) | |
| 70 | case 0x10: size = arcompact_handle10_dasm(DASM_PARAMS); break; // LD_S | |
| 71 | case 0x11: size = arcompact_handle11_dasm(DASM_PARAMS); break; // LDB_S | |
| 72 | case 0x12: size = arcompact_handle12_dasm(DASM_PARAMS); break; // LDW_S | |
| 73 | case 0x13: size = arcompact_handle13_dasm(DASM_PARAMS); break; // LSW_S.X | |
| 74 | case 0x14: size = arcompact_handle14_dasm(DASM_PARAMS); break; // ST_S | |
| 75 | case 0x15: size = arcompact_handle15_dasm(DASM_PARAMS); break; // STB_S | |
| 76 | case 0x16: size = arcompact_handle16_dasm(DASM_PARAMS); break; // STW_S | |
| 77 | case 0x17: size = arcompact_handle17_dasm(DASM_PARAMS); break; // Shift/Sub/Bit | |
| 78 | case 0x18: size = arcompact_handle18_dasm(DASM_PARAMS); break; // Stack Instr | |
| 79 | case 0x19: size = arcompact_handle19_dasm(DASM_PARAMS); break; // GP Instr | |
| 80 | case 0x1a: size = arcompact_handle1a_dasm(DASM_PARAMS); break; // PCL Instr | |
| 81 | case 0x1b: size = arcompact_handle1b_dasm(DASM_PARAMS); break; // MOV_S | |
| 82 | case 0x1c: size = arcompact_handle1c_dasm(DASM_PARAMS); break; // ADD_S/CMP_S | |
| 83 | case 0x1d: size = arcompact_handle1d_dasm(DASM_PARAMS); break; // BRcc_S | |
| 84 | case 0x1e: size = arcompact_handle1e_dasm(DASM_PARAMS); break; // Bcc_S | |
| 85 | case 0x1f: size = arcompact_handle1f_dasm(DASM_PARAMS); break; // BL_S | |
| 86 | 86 | } |
| 87 | 87 | } |
| 88 | 88 |
| r242631 | r242632 | |
|---|---|---|
| 141 | 141 | // 00100 bbb 00 iiiiii F BBB CCCCCC A AAAAA General Operations *UN*Conditional Register to Register |
| 142 | 142 | // 00100 bbb 01 iiiiii F BBB UUUUUU A AAAAA General Operations *UN*Conditional Register (Unsigned 6-bit IMM) |
| 143 | 143 | // 00100 bbb 10 iiiiii F BBB ssssss S SSSSS General Operations *UN*Conditional Register (Signed 12-bit IMM) |
| 144 | ||
| 145 | // 00100 bbb 11 iiiiii F BBB CCCCCC 0 QQQQQ General Operations Conditional Register | |
| 146 | // 00100 bbb 11 iiiiii F BBB UUUUUU 1 QQQQQ General Operations Conditional Register (Unsigned 6-bit IMM) | |
| 144 | ||
| 145 | // 00100 bbb 11 iiiiii F BBB CCCCCC 0 QQQQQ General Operations Conditional Register | |
| 146 | // 00100 bbb 11 iiiiii F BBB UUUUUU 1 QQQQQ General Operations Conditional Register (Unsigned 6-bit IMM) | |
| 147 | 147 | UINT8 subinstr = (op & 0x003f0000) >> 16; |
| 148 | 148 | op &= ~0x003f0000; |
| 149 | 149 | |
| r242631 | r242632 | |
| 304 | 304 | |
| 305 | 305 | switch (subinstr2) |
| 306 | 306 | { |
| 307 | case 0x00: size = arcompact_handle05_2f_00_dasm(DASM_PARAMS); break; // SWAP | |
| 308 | case 0x01: size = arcompact_handle05_2f_01_dasm(DASM_PARAMS); break; // NORM | |
| 307 | case 0x00: size = arcompact_handle05_2f_00_dasm(DASM_PARAMS); break; // SWAP | |
| 308 | case 0x01: size = arcompact_handle05_2f_01_dasm(DASM_PARAMS); break; // NORM | |
| 309 | 309 | case 0x02: size = arcompact_handle05_2f_02_dasm(DASM_PARAMS); break; // SAT16 |
| 310 | case 0x03: size = arcompact_handle05_2f_03_dasm(DASM_PARAMS); break; // RND16 | |
| 311 | case 0x04: size = arcompact_handle05_2f_04_dasm(DASM_PARAMS); break; // ABSSW | |
| 312 | case 0x05: size = arcompact_handle05_2f_05_dasm(DASM_PARAMS); break; // ABSS | |
| 313 | case 0x06: size = arcompact_handle05_2f_06_dasm(DASM_PARAMS); break; // NEGSW | |
| 314 | case 0x07: size = arcompact_handle05_2f_07_dasm(DASM_PARAMS); break; // NEGS | |
| 315 | case 0x08: size = arcompact_handle05_2f_08_dasm(DASM_PARAMS); break; // NORMW | |
| 310 | case 0x03: size = arcompact_handle05_2f_03_dasm(DASM_PARAMS); break; // RND16 | |
| 311 | case 0x04: size = arcompact_handle05_2f_04_dasm(DASM_PARAMS); break; // ABSSW | |
| 312 | case 0x05: size = arcompact_handle05_2f_05_dasm(DASM_PARAMS); break; // ABSS | |
| 313 | case 0x06: size = arcompact_handle05_2f_06_dasm(DASM_PARAMS); break; // NEGSW | |
| 314 | case 0x07: size = arcompact_handle05_2f_07_dasm(DASM_PARAMS); break; // NEGS | |
| 315 | case 0x08: size = arcompact_handle05_2f_08_dasm(DASM_PARAMS); break; // NORMW | |
| 316 | 316 | case 0x09: size = arcompact_handle05_2f_09_dasm(DASM_PARAMS); break; // illegal |
| 317 | 317 | case 0x0a: size = arcompact_handle05_2f_0a_dasm(DASM_PARAMS); break; // illegal |
| 318 | 318 | case 0x0b: size = arcompact_handle05_2f_0b_dasm(DASM_PARAMS); break; // illegal |
| r242631 | r242632 | |
| 759 | 759 | |
| 760 | 760 | switch (subinstr) |
| 761 | 761 | { |
| 762 | case 0x00: size = arcompact_handle17_00_dasm(DASM_PARAMS); break; // ASL_S | |
| 763 | case 0x01: size = arcompact_handle17_01_dasm(DASM_PARAMS); break; // LSR_S | |
| 762 | case 0x00: size = arcompact_handle17_00_dasm(DASM_PARAMS); break; // ASL_S | |
| 763 | case 0x01: size = arcompact_handle17_01_dasm(DASM_PARAMS); break; // LSR_S | |
| 764 | 764 | case 0x02: size = arcompact_handle17_02_dasm(DASM_PARAMS); break; // ASR_S |
| 765 | case 0x03: size = arcompact_handle17_03_dasm(DASM_PARAMS); break; // SUB_S | |
| 766 | case 0x04: size = arcompact_handle17_04_dasm(DASM_PARAMS); break; // BSET_S | |
| 767 | case 0x05: size = arcompact_handle17_05_dasm(DASM_PARAMS); break; // BCLR_S | |
| 768 | case 0x06: size = arcompact_handle17_06_dasm(DASM_PARAMS); break; // BMSK_S | |
| 765 | case 0x03: size = arcompact_handle17_03_dasm(DASM_PARAMS); break; // SUB_S | |
| 766 | case 0x04: size = arcompact_handle17_04_dasm(DASM_PARAMS); break; // BSET_S | |
| 767 | case 0x05: size = arcompact_handle17_05_dasm(DASM_PARAMS); break; // BCLR_S | |
| 768 | case 0x06: size = arcompact_handle17_06_dasm(DASM_PARAMS); break; // BMSK_S | |
| 769 | 769 | case 0x07: size = arcompact_handle17_07_dasm(DASM_PARAMS); break; // BTST_S |
| 770 | 770 | } |
| 771 | 771 | |
| r242631 | r242632 | |
| 795 | 795 | return size; |
| 796 | 796 | } |
| 797 | 797 | |
| 798 | int arcompact_handle18_05_dasm(DASM_OPS_16) | |
| 798 | int arcompact_handle18_05_dasm(DASM_OPS_16) | |
| 799 | 799 | { |
| 800 | 800 | int size = 2; |
| 801 | 801 | UINT8 subinstr2 = (op & 0x0700) >> 8; |
| r242631 | r242632 | |
| 805 | 805 | { |
| 806 | 806 | case 0x00: size = arcompact_handle18_05_00_dasm(DASM_PARAMS); break; // ADD_S (SP) |
| 807 | 807 | case 0x01: size = arcompact_handle18_05_01_dasm(DASM_PARAMS); break; // SUB_S (SP) |
| 808 | case 0x02: size = arcompact_handle18_05_02_dasm(DASM_PARAMS); break; // <illegal 0x18_05_02> | |
| 808 | case 0x02: size = arcompact_handle18_05_02_dasm(DASM_PARAMS); break; // <illegal 0x18_05_02> | |
| 809 | 809 | case 0x03: size = arcompact_handle18_05_03_dasm(DASM_PARAMS); break; // <illegal 0x18_05_03> |
| 810 | 810 | case 0x04: size = arcompact_handle18_05_04_dasm(DASM_PARAMS); break; // <illegal 0x18_05_04> |
| 811 | 811 | case 0x05: size = arcompact_handle18_05_05_dasm(DASM_PARAMS); break; // <illegal 0x18_05_05> |
| r242631 | r242632 | |
| 816 | 816 | return size; |
| 817 | 817 | } |
| 818 | 818 | |
| 819 | int arcompact_handle18_06_dasm(DASM_OPS_16) | |
| 819 | int arcompact_handle18_06_dasm(DASM_OPS_16) | |
| 820 | 820 | { |
| 821 | 821 | int size = 2; |
| 822 | 822 | UINT8 subinstr2 = (op & 0x001f) >> 0; |
| r242631 | r242632 | |
| 861 | 861 | return size; |
| 862 | 862 | } |
| 863 | 863 | |
| 864 | int arcompact_handle18_07_dasm(DASM_OPS_16) | |
| 864 | int arcompact_handle18_07_dasm(DASM_OPS_16) | |
| 865 | 865 | { |
| 866 | 866 | int size = 2; |
| 867 | 867 | UINT8 subinstr2 = (op & 0x001f) >> 0; |
| r242631 | r242632 | |
| 968 | 968 | |
| 969 | 969 | int arcompact_handle1e_03_dasm(DASM_OPS_16) |
| 970 | 970 | { |
| 971 | ||
| 972 | 971 | int size = 2; |
| 973 | 972 | UINT8 subinstr2 = (op & 0x01c0) >> 6; |
| 974 | 973 | op &= ~0x01c0; |
| r242631 | r242632 | |
| 976 | 975 | switch (subinstr2) |
| 977 | 976 | { |
| 978 | 977 | case 0x00: size = arcompact_handle1e_03_00_dasm(DASM_PARAMS); break; // BGT_S |
| 979 | case 0x01: size = arcompact_handle1e_03_01_dasm(DASM_PARAMS); break; // BGE_S | |
| 978 | case 0x01: size = arcompact_handle1e_03_01_dasm(DASM_PARAMS); break; // BGE_S | |
| 980 | 979 | case 0x02: size = arcompact_handle1e_03_02_dasm(DASM_PARAMS); break; // BLT_S |
| 981 | 980 | case 0x03: size = arcompact_handle1e_03_03_dasm(DASM_PARAMS); break; // BLE_S |
| 982 | 981 | case 0x04: size = arcompact_handle1e_03_04_dasm(DASM_PARAMS); break; // BHI_S |
| 983 | 982 | case 0x05: size = arcompact_handle1e_03_05_dasm(DASM_PARAMS); break; // BHS_S |
| 984 | 983 | case 0x06: size = arcompact_handle1e_03_06_dasm(DASM_PARAMS); break; // BLO_S |
| 985 | case 0x07: size = arcompact_handle1e_03_07_dasm(DASM_PARAMS); break; // BLS_S | |
| 984 | case 0x07: size = arcompact_handle1e_03_07_dasm(DASM_PARAMS); break; // BLS_S | |
| 986 | 985 | } |
| 987 | 986 | return size; |
| 988 | 987 |
| r242631 | r242632 | |
|---|---|---|
| 12 | 12 | |
| 13 | 13 | #define GET_LIMM_32 \ |
| 14 | 14 | limm = oprom[6] | (oprom[7] << 8); \ |
| 15 | limm |= (oprom[4] << 16) | (oprom[5] << 24); | |
| 15 | limm |= (oprom[4] << 16) | (oprom[5] << 24); | |
| 16 | 16 | |
| 17 | 17 | |
| 18 | ||
| 19 | 18 | int arcompact_handle00_dasm(DASM_OPS_32); |
| 20 | 19 | int arcompact_handle01_dasm(DASM_OPS_32); |
| 21 | 20 | int arcompact_handle01_00_dasm(DASM_OPS_32); |
| r242631 | r242632 | |
|---|---|---|
| 31 | 31 | |
| 32 | 32 | #define GROUP_0e_GET_h \ |
| 33 | 33 | h = ((op & 0x0007) << 3); \ |
| 34 | h |= ((op & 0x00e0) >> 5); \ | |
| 35 | op &= ~0x00e7; \ | |
| 36 | ||
| 34 | h |= ((op & 0x00e0) >> 5); \ | |
| 35 | op &= ~0x00e7; | |
| 37 | 36 | #define COMMON32_GET_breg \ |
| 38 | 37 | int b_temp = (op & 0x07000000) >> 24; op &= ~0x07000000; \ |
| 39 | 38 | int B_temp = (op & 0x00007000) >> 12; op &= ~0x00007000; \ |
| 40 | int breg = b_temp | (B_temp << 3); \ | |
| 41 | ||
| 39 | int breg = b_temp | (B_temp << 3); | |
| 42 | 40 | #define COMMON32_GET_creg \ |
| 43 | int creg = (op & 0x00000fc0) >> 6; op &= ~0x00000fc0; \ | |
| 44 | ||
| 41 | int creg = (op & 0x00000fc0) >> 6; op &= ~0x00000fc0; | |
| 45 | 42 | #define COMMON32_GET_u6 \ |
| 46 | int u = (op & 0x00000fc0) >> 6; op &= ~0x00000fc0; \ | |
| 47 | ||
| 43 | int u = (op & 0x00000fc0) >> 6; op &= ~0x00000fc0; | |
| 48 | 44 | #define COMMON32_GET_areg \ |
| 49 | int areg = (op & 0x0000003f) >> 0; op &= ~0x0000003f; \ | |
| 50 | ||
| 45 | int areg = (op & 0x0000003f) >> 0; op &= ~0x0000003f; | |
| 51 | 46 | #define COMMON32_GET_areg_reserved \ |
| 52 | int ares = (op & 0x0000003f) >> 0; op &= ~0x0000003f; \ | |
| 53 | ||
| 47 | int ares = (op & 0x0000003f) >> 0; op &= ~0x0000003f; | |
| 54 | 48 | #define COMMON32_GET_F \ |
| 55 | int F = (op & 0x00008000) >> 15; op &= ~0x00008000; \ | |
| 56 | ||
| 49 | int F = (op & 0x00008000) >> 15; op &= ~0x00008000; | |
| 57 | 50 | #define COMMON32_GET_p \ |
| 58 | int p = (op & 0x00c00000) >> 22; op &= ~0x00c00000; | |
| 51 | int p = (op & 0x00c00000) >> 22; op &= ~0x00c00000; | |
| 59 | 52 | |
| 60 | ||
| 61 | 53 | #define COMMON32_GET_s12 \ |
| 62 | 54 | int S_temp = (op & 0x0000003f) >> 0; op &= ~0x0000003f; \ |
| 63 | 55 | int s_temp = (op & 0x00000fc0) >> 6; op &= ~0x00000fc0; \ |
| 64 | int S = s_temp | (S_temp<<6); \ | |
| 65 | ||
| 56 | int S = s_temp | (S_temp<<6); | |
| 66 | 57 | #define COMMON32_GET_CONDITION \ |
| 67 | 58 | UINT8 condition = op & 0x0000001f; op &= ~0x0000001f; |
| 68 | 59 | |
| 69 | 60 | |
| 70 | 61 | #define COMMON16_GET_breg \ |
| 71 | 62 | breg = ((op & 0x0700) >>8); \ |
| 72 | op &= ~0x0700; \ | |
| 73 | ||
| 63 | op &= ~0x0700; | |
| 74 | 64 | #define COMMON16_GET_creg \ |
| 75 | 65 | creg = ((op & 0x00e0) >>5); \ |
| 76 | op &= ~0x00e0; \ | |
| 77 | ||
| 66 | op &= ~0x00e0; | |
| 78 | 67 | #define COMMON16_GET_areg \ |
| 79 | 68 | areg = ((op & 0x0007) >>0); \ |
| 80 | op &= ~0x0007; \ | |
| 81 | ||
| 69 | op &= ~0x0007; | |
| 82 | 70 | #define COMMON16_GET_u3 \ |
| 83 | 71 | u = ((op & 0x0007) >>0); \ |
| 84 | op &= ~0x0007; \ | |
| 85 | ||
| 72 | op &= ~0x0007; | |
| 86 | 73 | #define COMMON16_GET_u5 \ |
| 87 | 74 | u = ((op & 0x001f) >>0); \ |
| 88 | op &= ~0x001f; \ | |
| 89 | ||
| 75 | op &= ~0x001f; | |
| 90 | 76 | #define COMMON16_GET_u8 \ |
| 91 | 77 | u = ((op & 0x00ff) >>0); \ |
| 92 | op &= ~0x00ff; \ | |
| 93 | ||
| 78 | op &= ~0x00ff; | |
| 94 | 79 | #define COMMON16_GET_u7 \ |
| 95 | 80 | u = ((op & 0x007f) >>0); \ |
| 96 | op &= ~0x007f; \ | |
| 97 | ||
| 81 | op &= ~0x007f; | |
| 98 | 82 | #define COMMON16_GET_s9 \ |
| 99 | 83 | s = ((op & 0x01ff) >>0); \ |
| 100 | op &= ~0x01ff; \ | |
| 101 | ||
| 84 | op &= ~0x01ff; | |
| 102 | 85 | // registers used in 16-bit opcodes hae a limited range |
| 103 | 86 | // and can only address registers r0-r3 and r12-r15 |
| 104 | 87 | |
| 105 | 88 | #define REG_16BIT_RANGE(_reg_) \ |
| 106 | if (_reg_>3) _reg_+= 8; | |
| 89 | if (_reg_>3) _reg_+= 8; | |
| 107 | 90 | |
| 108 | ||
| 109 | 91 | // this is as messed up as the rest of the 16-bit alignment in LE mode... |
| 110 | 92 | |
| 111 | 93 | #define GET_LIMM \ |
| 112 | 94 | limm = oprom[4] | (oprom[5] << 8); \ |
| 113 | limm |= (oprom[2] << 16) | (oprom[3] << 24); \ | |
| 114 | ||
| 95 | limm |= (oprom[2] << 16) | (oprom[3] << 24); | |
| 115 | 96 | #define PC_ALIGNED32 \ |
| 116 | 97 | (pc&0xfffffffc) |
| 117 | 98 | |
| r242631 | r242632 | |
| 163 | 144 | // 00001 sssssssss 00 SSSSSSSSSS N QQQQQ |
| 164 | 145 | INT32 address = (op & 0x07fc0000) >> 17; |
| 165 | 146 | address |= ((op & 0x0000ffc0) >> 6) << 10; |
| 166 | if (address & 0x800000) address = -0x800000 + (address&0x7fffff); | |
| 147 | if (address & 0x800000) address = -0x800000 + (address&0x7fffff); | |
| 167 | 148 | int n = (op & 0x00000020) >> 5; op &= ~0x00000020; |
| 168 | 149 | |
| 169 | 150 | COMMON32_GET_CONDITION |
| r242631 | r242632 | |
| 180 | 161 | INT32 address = (op & 0x07fc0000) >> 17; |
| 181 | 162 | address |= ((op & 0x0000ffc0) >> 6) << 10; |
| 182 | 163 | address |= ((op & 0x0000000f) >> 0) << 20; |
| 183 | if (address & 0x800000) address = -0x800000 + (address&0x7fffff); | |
| 164 | if (address & 0x800000) address = -0x800000 + (address&0x7fffff); | |
| 184 | 165 | int n = (op & 0x00000020) >> 5; op &= ~0x00000020; |
| 185 | 166 | int res = (op & 0x00000010) >> 4; op &= ~0x00000010; |
| 186 | 167 | |
| r242631 | r242632 | |
| 265 | 246 | op &= ~0x07007fe0; |
| 266 | 247 | |
| 267 | 248 | print("%s%s %s, 0x%02x %08x (%08x)", optext, delaybit[n], regnames[breg], u, PC_ALIGNED32 + (address * 2), op & ~0xf8fe800f); |
| 268 | ||
| 249 | ||
| 269 | 250 | return size; |
| 270 | 251 | } |
| 271 | 252 | |
| r242631 | r242632 | |
| 327 | 308 | { |
| 328 | 309 | int size = 4; |
| 329 | 310 | UINT32 limm = 0; |
| 330 | int got_limm = 0; | |
| 311 | int got_limm = 0; | |
| 331 | 312 | // bitpos |
| 332 | 313 | // 1111 1111 1111 1111 0000 0000 0000 0000 |
| 333 | 314 | // fedc ba98 7654 3210 fedc ba98 7654 3210 |
| r242631 | r242632 | |
| 401 | 382 | |
| 402 | 383 | output += sprintf(output, "%s", optext); |
| 403 | 384 | output += sprintf(output, "%s", flagbit[F]); |
| 404 | // | |
| 385 | // output += sprintf( output, " p(%d)", p); | |
| 405 | 386 | |
| 406 | 387 | |
| 407 | 388 | if ((!b_reserved) && (breg == LIMM_REG)) |
| r242631 | r242632 | |
| 429 | 410 | } |
| 430 | 411 | else if (ignore_dst == 1) // certain opcode types ignore the 'a' field entirely, it should be set to 0. |
| 431 | 412 | { |
| 432 | | |
| 413 | if (areg) output += sprintf(output, " <reserved %d> <-", areg); | |
| 433 | 414 | } |
| 434 | 415 | else if (ignore_dst == 2) // for multiply operations areg should always be set to LIMM |
| 435 | 416 | { |
| r242631 | r242632 | |
| 464 | 445 | // 0010 0bbb 01ii iiii FBBB uuuu uuAA AAAA |
| 465 | 446 | int size = 4; |
| 466 | 447 | UINT32 limm = 0; |
| 467 | // | |
| 448 | // int got_limm = 0; | |
| 468 | 449 | |
| 469 | 450 | COMMON32_GET_breg; |
| 470 | 451 | COMMON32_GET_F; |
| r242631 | r242632 | |
| 473 | 454 | |
| 474 | 455 | output += sprintf(output, "%s", optext); |
| 475 | 456 | output += sprintf(output, "%s", flagbit[F]); |
| 476 | // | |
| 457 | // output += sprintf( output, " p(%d)", p); | |
| 477 | 458 | |
| 478 | 459 | |
| 479 | 460 | if ((!b_reserved) && (breg == LIMM_REG)) |
| 480 | 461 | { |
| 481 | 462 | GET_LIMM_32; |
| 482 | 463 | size = 8; |
| 483 | // | |
| 464 | // got_limm = 1; | |
| 484 | 465 | } |
| 485 | 466 | |
| 486 | 467 | // areg can be LIMM too, but in that case LIMM indicates 'no destination' rather than an actual LIMM value following |
| r242631 | r242632 | |
| 492 | 473 | } |
| 493 | 474 | else if (ignore_dst == 1) // certain opcode types ignore the 'a' field entirely, it should be set to 0. |
| 494 | 475 | { |
| 495 | | |
| 476 | if (areg) output += sprintf(output, " <reserved %d> <-", areg); | |
| 496 | 477 | } |
| 497 | 478 | else if (ignore_dst == 2) // for multiply operations areg should always be set to LIMM |
| 498 | 479 | { |
| r242631 | r242632 | |
| 530 | 511 | |
| 531 | 512 | output += sprintf(output, "%s", optext); |
| 532 | 513 | output += sprintf(output, "%s", flagbit[F]); |
| 533 | // | |
| 514 | // output += sprintf( output, " p(%d)", p); | |
| 534 | 515 | |
| 535 | 516 | |
| 536 | 517 | if (!b_reserved) |
| r242631 | r242632 | |
| 570 | 551 | |
| 571 | 552 | output += sprintf(output, "%s", optext); |
| 572 | 553 | output += sprintf(output, "%s", flagbit[F]); |
| 573 | // | |
| 554 | // output += sprintf( output, " p(%d)", p); | |
| 574 | 555 | |
| 575 | 556 | if (!b_reserved) |
| 576 | 557 | { |
| r242631 | r242632 | |
| 594 | 575 | |
| 595 | 576 | |
| 596 | 577 | output += sprintf(output, " Cond<%s> ", conditions[condition]); |
| 597 | ||
| 598 | 578 | |
| 579 | ||
| 599 | 580 | if (creg == LIMM_REG) |
| 600 | 581 | { |
| 601 | 582 | if (!got_limm) |
| r242631 | r242632 | |
| 626 | 607 | |
| 627 | 608 | output += sprintf(output, "%s", optext); |
| 628 | 609 | output += sprintf(output, "%s", flagbit[F]); |
| 629 | // | |
| 610 | // output += sprintf( output, " p(%d)", p); | |
| 630 | 611 | |
| 631 | 612 | if (!b_reserved) |
| 632 | 613 | { |
| r242631 | r242632 | |
| 685 | 666 | return 0; |
| 686 | 667 | } |
| 687 | 668 | |
| 688 | int arcompact_handle04_00_dasm(DASM_OPS_32) | |
| 669 | int arcompact_handle04_00_dasm(DASM_OPS_32) | |
| 689 | 670 | { |
| 690 | 671 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "ADD", 0,0); |
| 691 | 672 | } |
| 692 | 673 | |
| 693 | int arcompact_handle04_01_dasm(DASM_OPS_32) | |
| 694 | { | |
| 674 | int arcompact_handle04_01_dasm(DASM_OPS_32) | |
| 675 | { | |
| 695 | 676 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "ADC", 0,0); |
| 696 | 677 | } |
| 697 | 678 | |
| 698 | int arcompact_handle04_02_dasm(DASM_OPS_32) | |
| 699 | { | |
| 679 | int arcompact_handle04_02_dasm(DASM_OPS_32) | |
| 680 | { | |
| 700 | 681 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "SUB", 0,0); |
| 701 | 682 | } |
| 702 | 683 | |
| 703 | int arcompact_handle04_03_dasm(DASM_OPS_32) | |
| 684 | int arcompact_handle04_03_dasm(DASM_OPS_32) | |
| 704 | 685 | { |
| 705 | 686 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "SBC", 0,0); |
| 706 | 687 | } |
| 707 | 688 | |
| 708 | int arcompact_handle04_04_dasm(DASM_OPS_32) | |
| 689 | int arcompact_handle04_04_dasm(DASM_OPS_32) | |
| 709 | 690 | { |
| 710 | 691 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "AND", 0,0); |
| 711 | 692 | } |
| 712 | 693 | |
| 713 | int arcompact_handle04_05_dasm(DASM_OPS_32) | |
| 694 | int arcompact_handle04_05_dasm(DASM_OPS_32) | |
| 714 | 695 | { |
| 715 | 696 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "OR", 0,0); |
| 716 | 697 | } |
| 717 | 698 | |
| 718 | int arcompact_handle04_06_dasm(DASM_OPS_32) | |
| 699 | int arcompact_handle04_06_dasm(DASM_OPS_32) | |
| 719 | 700 | { |
| 720 | 701 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "BIC", 0,0); |
| 721 | 702 | } |
| 722 | 703 | |
| 723 | int arcompact_handle04_07_dasm(DASM_OPS_32) | |
| 704 | int arcompact_handle04_07_dasm(DASM_OPS_32) | |
| 724 | 705 | { |
| 725 | 706 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "XOR", 0,0); |
| 726 | 707 | } |
| 727 | 708 | |
| 728 | int arcompact_handle04_08_dasm(DASM_OPS_32) | |
| 709 | int arcompact_handle04_08_dasm(DASM_OPS_32) | |
| 729 | 710 | { |
| 730 | 711 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "MAX", 0,0); |
| 731 | 712 | } |
| 732 | 713 | |
| 733 | int arcompact_handle04_09_dasm(DASM_OPS_32) | |
| 714 | int arcompact_handle04_09_dasm(DASM_OPS_32) | |
| 734 | 715 | { |
| 735 | 716 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "MIN", 0,0); |
| 736 | 717 | } |
| r242631 | r242632 | |
| 752 | 733 | } |
| 753 | 734 | |
| 754 | 735 | int arcompact_handle04_0d_dasm(DASM_OPS_32) |
| 755 | { | |
| 736 | { | |
| 756 | 737 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "RCMP", 1,0); |
| 757 | 738 | } |
| 758 | 739 | |
| 759 | 740 | int arcompact_handle04_0e_dasm(DASM_OPS_32) |
| 760 | { | |
| 741 | { | |
| 761 | 742 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "RSUB", 0,0); |
| 762 | 743 | } |
| 763 | 744 | |
| 764 | int arcompact_handle04_0f_dasm(DASM_OPS_32) | |
| 765 | { | |
| 745 | int arcompact_handle04_0f_dasm(DASM_OPS_32) | |
| 746 | { | |
| 766 | 747 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "BSET", 0,0); |
| 767 | 748 | } |
| 768 | 749 | |
| 769 | int arcompact_handle04_10_dasm(DASM_OPS_32) | |
| 770 | { | |
| 750 | int arcompact_handle04_10_dasm(DASM_OPS_32) | |
| 751 | { | |
| 771 | 752 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "BCLR", 0,0); |
| 772 | 753 | } |
| 773 | 754 | |
| 774 | int arcompact_handle04_11_dasm(DASM_OPS_32) | |
| 775 | { | |
| 755 | int arcompact_handle04_11_dasm(DASM_OPS_32) | |
| 756 | { | |
| 776 | 757 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "BTST", 0,0); |
| 777 | 758 | } |
| 778 | 759 | |
| 779 | int arcompact_handle04_12_dasm(DASM_OPS_32) | |
| 780 | { | |
| 760 | int arcompact_handle04_12_dasm(DASM_OPS_32) | |
| 761 | { | |
| 781 | 762 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "BXOR", 0,0); |
| 782 | 763 | } |
| 783 | 764 | |
| 784 | int arcompact_handle04_13_dasm(DASM_OPS_32) | |
| 785 | { | |
| 765 | int arcompact_handle04_13_dasm(DASM_OPS_32) | |
| 766 | { | |
| 786 | 767 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "BMSK", 0,0); |
| 787 | 768 | } |
| 788 | 769 | |
| 789 | int arcompact_handle04_14_dasm(DASM_OPS_32) | |
| 790 | { | |
| 770 | int arcompact_handle04_14_dasm(DASM_OPS_32) | |
| 771 | { | |
| 791 | 772 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "ADD1", 0,0); |
| 792 | 773 | } |
| 793 | 774 | |
| 794 | int arcompact_handle04_15_dasm(DASM_OPS_32) | |
| 795 | { | |
| 775 | int arcompact_handle04_15_dasm(DASM_OPS_32) | |
| 776 | { | |
| 796 | 777 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "ADD2", 0,0); |
| 797 | 778 | } |
| 798 | 779 | |
| 799 | int arcompact_handle04_16_dasm(DASM_OPS_32) | |
| 800 | { | |
| 780 | int arcompact_handle04_16_dasm(DASM_OPS_32) | |
| 781 | { | |
| 801 | 782 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "ADD3", 0,0); |
| 802 | 783 | } |
| 803 | 784 | |
| 804 | int arcompact_handle04_17_dasm(DASM_OPS_32) | |
| 805 | { | |
| 785 | int arcompact_handle04_17_dasm(DASM_OPS_32) | |
| 786 | { | |
| 806 | 787 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "SUB1", 0,0); |
| 807 | 788 | } |
| 808 | 789 | |
| 809 | int arcompact_handle04_18_dasm(DASM_OPS_32) | |
| 810 | { | |
| 790 | int arcompact_handle04_18_dasm(DASM_OPS_32) | |
| 791 | { | |
| 811 | 792 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "SUB2", 0,0); |
| 812 | 793 | } |
| 813 | 794 | |
| 814 | int arcompact_handle04_19_dasm(DASM_OPS_32) | |
| 815 | { | |
| 795 | int arcompact_handle04_19_dasm(DASM_OPS_32) | |
| 796 | { | |
| 816 | 797 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "SUB3", 0,0); |
| 817 | 798 | } |
| 818 | 799 | |
| 819 | int arcompact_handle04_1a_dasm(DASM_OPS_32) | |
| 820 | { | |
| 800 | int arcompact_handle04_1a_dasm(DASM_OPS_32) | |
| 801 | { | |
| 821 | 802 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "MPY", 0,0); |
| 822 | 803 | } // * |
| 823 | 804 | |
| 824 | int arcompact_handle04_1b_dasm(DASM_OPS_32) | |
| 825 | { | |
| 805 | int arcompact_handle04_1b_dasm(DASM_OPS_32) | |
| 806 | { | |
| 826 | 807 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "MPYH", 0,0); |
| 827 | 808 | } // * |
| 828 | 809 | |
| 829 | int arcompact_handle04_1c_dasm(DASM_OPS_32) | |
| 830 | { | |
| 810 | int arcompact_handle04_1c_dasm(DASM_OPS_32) | |
| 811 | { | |
| 831 | 812 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "MPYHU", 0,0); |
| 832 | 813 | } // * |
| 833 | 814 | |
| 834 | int arcompact_handle04_1d_dasm(DASM_OPS_32) | |
| 835 | { | |
| 815 | int arcompact_handle04_1d_dasm(DASM_OPS_32) | |
| 816 | { | |
| 836 | 817 | return arcompact_handle04_helper_dasm(DASM_PARAMS, "MPYU", 0,0); |
| 837 | 818 | } // * |
| 838 | 819 | |
| r242631 | r242632 | |
| 890 | 871 | output += sprintf(output, "LP<%s> (start %08x, end %08x)", conditions[condition], pc + 4, PC_ALIGNED32 + u*2); |
| 891 | 872 | |
| 892 | 873 | int unused = (op & 0x00000020)>>5; |
| 893 | if (unused==0) | |
| 874 | if (unused==0) output += sprintf(output, "(unused bit not set)"); | |
| 894 | 875 | |
| 895 | 876 | } |
| 896 | 877 | |
| r242631 | r242632 | |
| 908 | 889 | output += sprintf( output, "[%03x]", auxreg); \ |
| 909 | 890 | } \ |
| 910 | 891 | else \ |
| 911 | output += sprintf( output, "[%03x]", auxreg); \ | |
| 912 | ||
| 892 | output += sprintf( output, "[%03x]", auxreg); | |
| 913 | 893 | int arcompact_handle04_2a_dasm(DASM_OPS_32) // Load FROM Auxiliary register TO register |
| 914 | 894 | { |
| 915 | ||
| 916 | 895 | // pp F |
| 917 | 896 | // 0010 0bbb 0010 1010 0BBB CCCC CCRR RRRR |
| 918 | 897 | // 0010 0bbb 0010 1010 0BBB 1111 10RR RRRR |
| r242631 | r242632 | |
| 930 | 909 | |
| 931 | 910 | output += sprintf( output, "LR"); |
| 932 | 911 | if (F) output += sprintf( output, ".<F set, illegal>"); |
| 933 | // output += sprintf( output, " p(%d)", p); | |
| 934 | ||
| 935 | ||
| 912 | // output += sprintf( output, " p(%d)", p); | |
| 936 | 913 | |
| 914 | ||
| 915 | ||
| 937 | 916 | if (breg == LIMM_REG) |
| 938 | 917 | { |
| 939 | 918 | output += sprintf( output, "<no dest>" ); // illegal encoding? |
| r242631 | r242632 | |
| 947 | 926 | |
| 948 | 927 | if (p == 0) |
| 949 | 928 | { |
| 950 | ||
| 951 | 929 | COMMON32_GET_creg |
| 952 | 930 | COMMON32_GET_areg_reserved |
| 953 | 931 | |
| r242631 | r242632 | |
| 960 | 938 | } |
| 961 | 939 | |
| 962 | 940 | output += sprintf( output, "(%08x) ", limm ); |
| 963 | ||
| 941 | ||
| 964 | 942 | } |
| 965 | 943 | else |
| 966 | 944 | { |
| r242631 | r242632 | |
| 976 | 954 | |
| 977 | 955 | int auxreg = u; |
| 978 | 956 | PRINT_AUX_REGNAME |
| 979 | ||
| 957 | ||
| 980 | 958 | if (ares) output += sprintf( output, "reserved(%02x) ", ares ); |
| 981 | 959 | } |
| 982 | 960 | else if (p == 2) |
| r242631 | r242632 | |
| 996 | 974 | } |
| 997 | 975 | |
| 998 | 976 | int arcompact_handle04_2b_dasm(DASM_OPS_32) // Store TO Auxiliary register FROM register |
| 999 | { | |
| 977 | { | |
| 1000 | 978 | // code at ~ 40073DFE in leapster bios is manually setting up a loop this way |
| 1001 | 979 | // rather than using the lPcc opcode |
| 1002 | 980 | |
| r242631 | r242632 | |
| 1010 | 988 | |
| 1011 | 989 | output += sprintf( output, "SR"); |
| 1012 | 990 | if (F) output += sprintf( output, ".<F set, illegal>"); |
| 1013 | // output += sprintf( output, " p(%d)", p); | |
| 1014 | ||
| 1015 | ||
| 991 | // output += sprintf( output, " p(%d)", p); | |
| 1016 | 992 | |
| 993 | ||
| 994 | ||
| 1017 | 995 | if (breg == LIMM_REG) |
| 1018 | 996 | { |
| 1019 | 997 | GET_LIMM_32; |
| r242631 | r242632 | |
| 1031 | 1009 | |
| 1032 | 1010 | if (p == 0) |
| 1033 | 1011 | { |
| 1034 | ||
| 1035 | 1012 | COMMON32_GET_creg |
| 1036 | 1013 | COMMON32_GET_areg_reserved |
| 1037 | 1014 | |
| r242631 | r242632 | |
| 1095 | 1072 | |
| 1096 | 1073 | int arcompact_handle04_2f_helper_dasm(DASM_OPS_32, const char* optext) |
| 1097 | 1074 | { |
| 1098 | // | |
| 1075 | // | |
| 1099 | 1076 | // 0010 0bbb pp10 1111 FBBB CCCC CCII IIII |
| 1100 | 1077 | int size = 4; |
| 1101 | 1078 | |
| r242631 | r242632 | |
| 1105 | 1082 | |
| 1106 | 1083 | output += sprintf( output, "%s", optext); |
| 1107 | 1084 | output += sprintf( output, "%s", flagbit[F]); |
| 1108 | // output += sprintf( output, " p(%d)", p); | |
| 1109 | ||
| 1085 | // output += sprintf( output, " p(%d)", p); | |
| 1086 | ||
| 1110 | 1087 | if (breg == LIMM_REG) |
| 1111 | 1088 | { |
| 1112 | 1089 | output += sprintf(output, " <no dst>, "); |
| r242631 | r242632 | |
| 1125 | 1102 | { |
| 1126 | 1103 | UINT32 limm; |
| 1127 | 1104 | GET_LIMM_32; |
| 1128 | size = 8; | |
| 1105 | size = 8; | |
| 1129 | 1106 | output += sprintf( output, "(%08x) ", limm ); |
| 1130 | 1107 | |
| 1131 | 1108 | } |
| r242631 | r242632 | |
| 1232 | 1209 | else |
| 1233 | 1210 | { |
| 1234 | 1211 | output += sprintf( output, "%s]", regnames[creg]); |
| 1235 | } | |
| 1212 | } | |
| 1236 | 1213 | |
| 1237 | 1214 | |
| 1238 | 1215 | return size; |
| 1239 | ||
| 1240 | 1216 | |
| 1241 | 1217 | |
| 1218 | ||
| 1242 | 1219 | } |
| 1243 | 1220 | |
| 1244 | 1221 | int arcompact_handle04_30_dasm(DASM_OPS_32) { return arcompact_handle04_3x_helper_dasm(DASM_PARAMS,0,0); } |
| r242631 | r242632 | |
| 1279 | 1256 | |
| 1280 | 1257 | int arcompact_handle05_2f_0x_helper_dasm(DASM_OPS_32, const char* optext) |
| 1281 | 1258 | { |
| 1282 | // | |
| 1259 | // | |
| 1283 | 1260 | // 0010 1bbb pp10 1111 FBBB CCCC CCII IIII when pp == 0x00 |
| 1284 | 1261 | // or |
| 1285 | 1262 | // 0010 1bbb pp10 1111 FBBB UUUU UUII IIII when pp == 0x01 |
| r242631 | r242632 | |
| 1293 | 1270 | |
| 1294 | 1271 | output += sprintf( output, "%s", optext); |
| 1295 | 1272 | output += sprintf( output, "%s", flagbit[F]); |
| 1296 | // output += sprintf( output, " p(%d)", p); | |
| 1297 | ||
| 1298 | ||
| 1273 | // output += sprintf( output, " p(%d)", p); | |
| 1274 | ||
| 1275 | ||
| 1299 | 1276 | output += sprintf(output, " %s, ", regnames[breg]); |
| 1300 | 1277 | |
| 1301 | 1278 | if (p == 0) |
| r242631 | r242632 | |
| 1306 | 1283 | { |
| 1307 | 1284 | UINT32 limm; |
| 1308 | 1285 | GET_LIMM_32; |
| 1309 | size = 8; | |
| 1286 | size = 8; | |
| 1310 | 1287 | output += sprintf( output, "(%08x) ", limm ); |
| 1311 | 1288 | |
| 1312 | 1289 | } |
| r242631 | r242632 | |
| 1469 | 1446 | GROUP_0e_GET_h; |
| 1470 | 1447 | COMMON16_GET_breg; |
| 1471 | 1448 | REG_16BIT_RANGE(breg); |
| 1472 | ||
| 1449 | ||
| 1473 | 1450 | if (h == LIMM_REG) |
| 1474 | 1451 | { |
| 1475 | 1452 | UINT32 limm; |
| r242631 | r242632 | |
| 1517 | 1494 | |
| 1518 | 1495 | COMMON16_GET_breg; |
| 1519 | 1496 | REG_16BIT_RANGE(breg); |
| 1520 | ||
| 1497 | ||
| 1521 | 1498 | print("%s %s", optext, regnames[breg]); |
| 1522 | 1499 | |
| 1523 | 1500 | return 2; |
| r242631 | r242632 | |
| 1724 | 1701 | } |
| 1725 | 1702 | |
| 1726 | 1703 | |
| 1727 | // op bits remaining for 0x18_xx subgroups 0x071f | |
| 1704 | // op bits remaining for 0x18_xx subgroups 0x071f | |
| 1728 | 1705 | |
| 1729 | 1706 | int arcompact_handle18_0x_helper_dasm(DASM_OPS_16, const char* optext, int st, int format) |
| 1730 | 1707 | { |
| r242631 | r242632 | |
| 1746 | 1723 | return 2; |
| 1747 | 1724 | } |
| 1748 | 1725 | |
| 1749 | int arcompact_handle18_00_dasm(DASM_OPS_16) | |
| 1726 | int arcompact_handle18_00_dasm(DASM_OPS_16) | |
| 1750 | 1727 | { |
| 1751 | 1728 | return arcompact_handle18_0x_helper_dasm(DASM_PARAMS, "LD_S", 0,0); |
| 1752 | 1729 | } |
| 1753 | 1730 | |
| 1754 | int arcompact_handle18_01_dasm(DASM_OPS_16) | |
| 1731 | int arcompact_handle18_01_dasm(DASM_OPS_16) | |
| 1755 | 1732 | { |
| 1756 | 1733 | return arcompact_handle18_0x_helper_dasm(DASM_PARAMS, "LDB_S", 0,0); |
| 1757 | 1734 | } |
| 1758 | 1735 | |
| 1759 | int arcompact_handle18_02_dasm(DASM_OPS_16) | |
| 1736 | int arcompact_handle18_02_dasm(DASM_OPS_16) | |
| 1760 | 1737 | { |
| 1761 | 1738 | return arcompact_handle18_0x_helper_dasm(DASM_PARAMS, "ST_S", 1,0); |
| 1762 | 1739 | } |
| 1763 | 1740 | |
| 1764 | int arcompact_handle18_03_dasm(DASM_OPS_16) | |
| 1741 | int arcompact_handle18_03_dasm(DASM_OPS_16) | |
| 1765 | 1742 | { |
| 1766 | 1743 | return arcompact_handle18_0x_helper_dasm(DASM_PARAMS, "STB_S", 1,0); |
| 1767 | 1744 | } |
| 1768 | 1745 | |
| 1769 | int arcompact_handle18_04_dasm(DASM_OPS_16) | |
| 1746 | int arcompact_handle18_04_dasm(DASM_OPS_16) | |
| 1770 | 1747 | { |
| 1771 | 1748 | return arcompact_handle18_0x_helper_dasm(DASM_PARAMS, "ADD_S", 1,1); // check format |
| 1772 | 1749 | } |
| r242631 | r242632 | |
| 1791 | 1768 | return 2; |
| 1792 | 1769 | } |
| 1793 | 1770 | |
| 1794 | // op bits remaining for 0x18_06_xx subgroups 0x0700 | |
| 1795 | int arcompact_handle18_06_01_dasm(DASM_OPS_16) | |
| 1771 | // op bits remaining for 0x18_06_xx subgroups 0x0700 | |
| 1772 | int arcompact_handle18_06_01_dasm(DASM_OPS_16) | |
| 1796 | 1773 | { |
| 1797 | 1774 | int breg; |
| 1798 | 1775 | COMMON16_GET_breg |
| r242631 | r242632 | |
| 1803 | 1780 | return 2; |
| 1804 | 1781 | } |
| 1805 | 1782 | |
| 1806 | int arcompact_handle18_06_11_dasm(DASM_OPS_16) | |
| 1783 | int arcompact_handle18_06_11_dasm(DASM_OPS_16) | |
| 1807 | 1784 | { |
| 1808 | 1785 | int res = (op & 0x0700) >> 8; |
| 1809 | 1786 | op &= ~0x0700; // all bits now used |
| r242631 | r242632 | |
| 1816 | 1793 | return 2; |
| 1817 | 1794 | } |
| 1818 | 1795 | |
| 1819 | // op bits remaining for 0x18_07_xx subgroups 0x0700 | |
| 1820 | int arcompact_handle18_07_01_dasm(DASM_OPS_16) | |
| 1796 | // op bits remaining for 0x18_07_xx subgroups 0x0700 | |
| 1797 | int arcompact_handle18_07_01_dasm(DASM_OPS_16) | |
| 1821 | 1798 | { |
| 1822 | 1799 | int breg; |
| 1823 | 1800 | COMMON16_GET_breg |
| r242631 | r242632 | |
| 1829 | 1806 | } |
| 1830 | 1807 | |
| 1831 | 1808 | |
| 1832 | int arcompact_handle18_07_11_dasm(DASM_OPS_16) | |
| 1809 | int arcompact_handle18_07_11_dasm(DASM_OPS_16) | |
| 1833 | 1810 | { |
| 1834 | 1811 | int res = (op & 0x0700) >> 8; |
| 1835 | 1812 | op &= ~0x0700; // all bits now used |
| r242631 | r242632 | |
| 1921 | 1898 | COMMON16_GET_breg; |
| 1922 | 1899 | REG_16BIT_RANGE(breg); |
| 1923 | 1900 | |
| 1924 | int s = (op & 0x007f) >> 0; | |
| 1901 | int s = (op & 0x007f) >> 0; op &= ~0x007f; | |
| 1925 | 1902 | if (s & 0x40) s = -0x40 + (s & 0x3f); |
| 1926 | 1903 | |
| 1927 | 1904 | print("%s %s, 0 to 0x%08x", optext, regnames[breg], PC_ALIGNED32 + s*2); |
| r242631 | r242632 | |
| 1935 | 1912 | |
| 1936 | 1913 | int arcompact_handle1e_0x_helper_dasm(DASM_OPS_16, const char* optext) |
| 1937 | 1914 | { |
| 1938 | int s = (op & 0x01ff) >> 0; | |
| 1915 | int s = (op & 0x01ff) >> 0; op &= ~0x01ff; | |
| 1939 | 1916 | if (s & 0x100) s = -0x100 + (s & 0xff); |
| 1940 | 1917 | |
| 1941 | 1918 | print("%s %08x", optext, PC_ALIGNED32 + s*2); |
| r242631 | r242632 | |
| 1950 | 1927 | |
| 1951 | 1928 | int arcompact_handle1e_03_0x_helper_dasm(DASM_OPS_16, const char* optext) |
| 1952 | 1929 | { |
| 1953 | int s = (op & 0x003f) >> 0; | |
| 1930 | int s = (op & 0x003f) >> 0; op &= ~0x003f; | |
| 1954 | 1931 | if (s & 0x020) s = -0x20 + (s & 0x1f); |
| 1955 | 1932 | |
| 1956 | 1933 | print("%s %08x", optext, PC_ALIGNED32 + s*2); |
| r242631 | r242632 | |
| 1968 | 1945 | |
| 1969 | 1946 | int arcompact_handle1f_dasm(DASM_OPS_16) |
| 1970 | 1947 | { |
| 1971 | int s = (op & 0x07ff) >> 0; | |
| 1948 | int s = (op & 0x07ff) >> 0; op &= ~0x07ff; | |
| 1972 | 1949 | if (s & 0x400) s = -0x400 + (s & 0x3ff); |
| 1973 | 1950 | |
| 1974 | 1951 | print("BL_S %08x", PC_ALIGNED32 + (s*4)); |
| r242631 | r242632 | |
| 2389 | 2366 | int arcompact_handle18_07_1d_dasm(DASM_OPS_16) { print("<illegal 0x18_07_1d> (%04x)", op); return 2;} |
| 2390 | 2367 | int arcompact_handle18_07_1e_dasm(DASM_OPS_16) { print("<illegal 0x18_07_1e> (%04x)", op); return 2;} |
| 2391 | 2368 | int arcompact_handle18_07_1f_dasm(DASM_OPS_16) { print("<illegal 0x18_07_1f> (%04x)", op); return 2;} |
| 2392 |
| r242631 | r242632 | |
|---|---|---|
| 15 | 15 | |
| 16 | 16 | #define GET_LIMM_32 \ |
| 17 | 17 | limm = oprom[6] | (oprom[7] << 8); \ |
| 18 | limm |= (oprom[4] << 16) | (oprom[5] << 24); | |
| 18 | limm |= (oprom[4] << 16) | (oprom[5] << 24); | |
| 19 | 19 | |
| 20 | ||
| 21 | 20 | int arcompact_handle00_00_dasm(DASM_OPS_32); |
| 22 | 21 | int arcompact_handle00_01_dasm(DASM_OPS_32); |
| 23 | 22 | int arcompact_handle01_00_00dasm(DASM_OPS_32); |
| r242631 | r242632 | |
| 367 | 366 | int arcompact_handle04_2f_3f_3b_dasm(DASM_OPS_32); |
| 368 | 367 | int arcompact_handle04_2f_3f_3c_dasm(DASM_OPS_32); |
| 369 | 368 | int arcompact_handle04_2f_3f_3d_dasm(DASM_OPS_32); |
| 370 | int arcompact_handle04_2f_3f_3e_dasm(DASM_OPS_32); | |
| 369 | int arcompact_handle04_2f_3f_3e_dasm(DASM_OPS_32); | |
| 371 | 370 | int arcompact_handle04_2f_3f_3f_dasm(DASM_OPS_32); |
| 372 | 371 | |
| 373 | 372 | int arcompact_handle05_2f_00_dasm(DASM_OPS_32); |
| r242631 | r242632 | |
| 632 | 631 | int arcompact_handle18_07_16_dasm(DASM_OPS_16); |
| 633 | 632 | int arcompact_handle18_07_17_dasm(DASM_OPS_16); |
| 634 | 633 | int arcompact_handle18_07_18_dasm(DASM_OPS_16); |
| 635 | int arcompact_handle18_07_19_dasm(DASM_OPS_16); | |
| 634 | int arcompact_handle18_07_19_dasm(DASM_OPS_16); | |
| 636 | 635 | int arcompact_handle18_07_1a_dasm(DASM_OPS_16); |
| 637 | 636 | int arcompact_handle18_07_1b_dasm(DASM_OPS_16); |
| 638 | 637 | int arcompact_handle18_07_1c_dasm(DASM_OPS_16); |
| r242631 | r242632 | |
|---|---|---|
| 129 | 129 | $(CPUOBJ)/arcompact/arcompact.inc: $(CPUSRC)/arcompact/arcompact_make.py |
| 130 | 130 | @echo Generating arcompact source .inc files... |
| 131 | 131 | $(PYTHON) $(CPUSRC)/arcompact/arcompact_make.py $@ |
| 132 | ||
| 132 | ||
| 133 | 133 | #------------------------------------------------- |
| 134 | 134 | # Acorn ARM series |
| 135 | 135 | # |
| r242631 | r242632 | |
|---|---|---|
| 347 | 347 | sprintf(tm, "%d", i); |
| 348 | 348 | timer_channel[i] = subdevice<h8_timer16_channel_device>(tm); |
| 349 | 349 | } |
| 350 | ||
| 350 | ||
| 351 | 351 | save_item(NAME(tstr)); |
| 352 | 352 | } |
| 353 | 353 |
| r242631 | r242632 | |
|---|---|---|
| 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); |
| r242631 | r242632 | |
|---|---|---|
| 1728 | 1728 | |
| 1729 | 1729 | switch (g_cpu_ir & 0x7) |
| 1730 | 1730 | { |
| 1731 | case 2: | |
| 1731 | case 2: // word operand | |
| 1732 | 1732 | w3 = read_imm_16(); |
| 1733 | 1733 | sprintf(g_dasm_str, "ftrap%s.w $%04x", g_cpcc[w2 & 0x3f], w3); |
| 1734 | 1734 | break; |
| 1735 | 1735 | |
| 1736 | case 3: | |
| 1736 | case 3: // long word operand | |
| 1737 | 1737 | l2 = read_imm_32(); |
| 1738 | 1738 | sprintf(g_dasm_str, "ftrap%s.l $%08x", g_cpcc[w2 & 0x3f], l2); |
| 1739 | 1739 | break; |
| r242631 | r242632 | |
|---|---|---|
| 71 | 71 | const device_type PPS4 = &device_creator<pps4_device>; |
| 72 | 72 | |
| 73 | 73 | pps4_device::pps4_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 74 | : cpu_device(mconfig, PPS4, "PPS4", tag, owner, clock, "pps4", __FILE__ ) | |
| 75 | , m_program_config("program", ENDIANNESS_LITTLE, 8, 12) | |
| 76 | , m_data_config("data", ENDIANNESS_LITTLE, 8, 12) // 4bit RAM | |
| 77 | , m_io_config("io", ENDIANNESS_LITTLE, 8, 8) // 4bit IO | |
| 74 | : cpu_device(mconfig, PPS4, "PPS4", tag, owner, clock, "pps4", __FILE__ ) | |
| 75 | , m_program_config("program", ENDIANNESS_LITTLE, 8, 12) | |
| 76 | , m_data_config("data", ENDIANNESS_LITTLE, 8, 12) // 4bit RAM | |
| 77 | , m_io_config("io", ENDIANNESS_LITTLE, 8, 8) // 4bit IO | |
| 78 | 78 | { |
| 79 | 79 | } |
| 80 | 80 | |
| r242631 | r242632 | |
| 84 | 84 | */ |
| 85 | 85 | UINT8 pps4_device::M() |
| 86 | 86 | { |
| 87 | UINT8 ret = m_data->read_byte(m_B & ~m_SAG); | |
| 88 | m_SAG = 0; | |
| 89 | return ret; | |
| 87 | UINT8 ret = m_data->read_byte(m_B & ~m_SAG); | |
| 88 | m_SAG = 0; | |
| 89 | return ret; | |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | |
| r242631 | r242632 | |
| 96 | 96 | */ |
| 97 | 97 | void pps4_device::W(UINT8 data) |
| 98 | 98 | { |
| 99 | m_data->write_byte(m_B & ~m_SAG, data); | |
| 100 | m_SAG = 0; | |
| 99 | m_data->write_byte(m_B & ~m_SAG, data); | |
| 100 | m_SAG = 0; | |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | offs_t pps4_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) |
| 104 | 104 | { |
| 105 | extern CPU_DISASSEMBLE( pps4 ); | |
| 106 | return CPU_DISASSEMBLE_NAME(pps4)(this, buffer, pc, oprom, opram, options); | |
| 105 | extern CPU_DISASSEMBLE( pps4 ); | |
| 106 | return CPU_DISASSEMBLE_NAME(pps4)(this, buffer, pc, oprom, opram, options); | |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | /** |
| r242631 | r242632 | |
| 115 | 115 | */ |
| 116 | 116 | inline UINT8 pps4_device::ROP() |
| 117 | 117 | { |
| 118 | const UINT8 op = m_direct->read_decrypted_byte(m_P & 0xFFF); | |
| 119 | m_Ip = m_I1; // save previous opcode | |
| 120 | m_P = (m_P + 1) & 0xFFF; | |
| 121 | m_icount -= 1; | |
| 122 | return op; | |
| 118 | const UINT8 op = m_direct->read_decrypted_byte(m_P & 0xFFF); | |
| 119 | m_Ip = m_I1; // save previous opcode | |
| 120 | m_P = (m_P + 1) & 0xFFF; | |
| 121 | m_icount -= 1; | |
| 122 | return op; | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | /** |
| r242631 | r242632 | |
| 131 | 131 | */ |
| 132 | 132 | inline UINT8 pps4_device::ARG() |
| 133 | 133 | { |
| 134 | const UINT8 arg = m_direct->read_raw_byte(m_P & 0xFFF); | |
| 135 | m_P = (m_P + 1) & 0xFFF; | |
| 136 | m_icount -= 1; | |
| 137 | return arg; | |
| 134 | const UINT8 arg = m_direct->read_raw_byte(m_P & 0xFFF); | |
| 135 | m_P = (m_P + 1) & 0xFFF; | |
| 136 | m_icount -= 1; | |
| 137 | return arg; | |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | /** |
| r242631 | r242632 | |
| 173 | 173 | */ |
| 174 | 174 | void pps4_device::iAD() |
| 175 | 175 | { |
| 176 | m_A = m_A + M(); | |
| 177 | m_C = (m_A >> 4) & 1; | |
| 178 | m_A = m_A & 15; | |
| 176 | m_A = m_A + M(); | |
| 177 | m_C = (m_A >> 4) & 1; | |
| 178 | m_A = m_A & 15; | |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | /** |
| r242631 | r242632 | |
| 193 | 193 | */ |
| 194 | 194 | void pps4_device::iADC() |
| 195 | 195 | { |
| 196 | m_A = m_A + M() + m_C; | |
| 197 | m_C = m_A >> 4; | |
| 198 | m_A = m_A & 15; | |
| 196 | m_A = m_A + M() + m_C; | |
| 197 | m_C = m_A >> 4; | |
| 198 | m_A = m_A & 15; | |
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | /** |
| r242631 | r242632 | |
| 214 | 214 | */ |
| 215 | 215 | void pps4_device::iADSK() |
| 216 | 216 | { |
| 217 | m_A = m_A + M(); | |
| 218 | m_C = m_A >> 4; | |
| 219 | m_Skip = m_C; | |
| 220 | m_A = m_A & 15; | |
| 217 | m_A = m_A + M(); | |
| 218 | m_C = m_A >> 4; | |
| 219 | m_Skip = m_C; | |
| 220 | m_A = m_A & 15; | |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | 223 | /** |
| r242631 | r242632 | |
| 236 | 236 | */ |
| 237 | 237 | void pps4_device::iADCSK() |
| 238 | 238 | { |
| 239 | m_A = m_A + M() + m_C; | |
| 240 | m_C = m_A >> 4; | |
| 241 | m_Skip = m_C; | |
| 242 | m_A = m_A & 15; | |
| 239 | m_A = m_A + M() + m_C; | |
| 240 | m_C = m_A >> 4; | |
| 241 | m_Skip = m_C; | |
| 242 | m_A = m_A & 15; | |
| 243 | 243 | } |
| 244 | 244 | |
| 245 | 245 | /** |
| r242631 | r242632 | |
| 265 | 265 | */ |
| 266 | 266 | void pps4_device::iADI() |
| 267 | 267 | { |
| 268 | const UINT8 imm = ~m_I1 & 15; | |
| 269 | m_A = m_A + imm; | |
| 270 | m_Skip = (m_A >> 4) & 1; | |
| 271 | m_A = m_A & 15; | |
| 268 | const UINT8 imm = ~m_I1 & 15; | |
| 269 | m_A = m_A + imm; | |
| 270 | m_Skip = (m_A >> 4) & 1; | |
| 271 | m_A = m_A & 15; | |
| 272 | 272 | } |
| 273 | 273 | |
| 274 | 274 | /** |
| r242631 | r242632 | |
| 288 | 288 | */ |
| 289 | 289 | void pps4_device::iDC() |
| 290 | 290 | { |
| 291 | ||
| 291 | m_A = m_A + 10; | |
| 292 | 292 | } |
| 293 | 293 | |
| 294 | 294 | /** |
| r242631 | r242632 | |
| 307 | 307 | */ |
| 308 | 308 | void pps4_device::iAND() |
| 309 | 309 | { |
| 310 | ||
| 310 | m_A = m_A & M(); | |
| 311 | 311 | } |
| 312 | 312 | |
| 313 | 313 | /** |
| r242631 | r242632 | |
| 326 | 326 | */ |
| 327 | 327 | void pps4_device::iOR() |
| 328 | 328 | { |
| 329 | ||
| 329 | m_A = m_A | M(); | |
| 330 | 330 | } |
| 331 | 331 | |
| 332 | 332 | /** |
| r242631 | r242632 | |
| 346 | 346 | */ |
| 347 | 347 | void pps4_device::iEOR() |
| 348 | 348 | { |
| 349 | ||
| 349 | m_A = m_A ^ M(); | |
| 350 | 350 | } |
| 351 | 351 | |
| 352 | 352 | /** |
| r242631 | r242632 | |
| 364 | 364 | */ |
| 365 | 365 | void pps4_device::iCOMP() |
| 366 | 366 | { |
| 367 | ||
| 367 | m_A = m_A ^ 15; | |
| 368 | 368 | } |
| 369 | 369 | |
| 370 | 370 | /** |
| r242631 | r242632 | |
| 381 | 381 | */ |
| 382 | 382 | void pps4_device::iSC() |
| 383 | 383 | { |
| 384 | ||
| 384 | m_C = 1; | |
| 385 | 385 | } |
| 386 | 386 | |
| 387 | 387 | /** |
| r242631 | r242632 | |
| 398 | 398 | */ |
| 399 | 399 | void pps4_device::iRC() |
| 400 | 400 | { |
| 401 | ||
| 401 | m_C = 0; | |
| 402 | 402 | } |
| 403 | 403 | |
| 404 | 404 | /** |
| r242631 | r242632 | |
| 415 | 415 | */ |
| 416 | 416 | void pps4_device::iSF1() |
| 417 | 417 | { |
| 418 | ||
| 418 | m_FF1 = 1; | |
| 419 | 419 | } |
| 420 | 420 | |
| 421 | 421 | /** |
| r242631 | r242632 | |
| 432 | 432 | */ |
| 433 | 433 | void pps4_device::iRF1() |
| 434 | 434 | { |
| 435 | ||
| 435 | m_FF1 = 0; | |
| 436 | 436 | } |
| 437 | 437 | |
| 438 | 438 | /** |
| r242631 | r242632 | |
| 449 | 449 | */ |
| 450 | 450 | void pps4_device::iSF2() |
| 451 | 451 | { |
| 452 | ||
| 452 | m_FF2 = 1; | |
| 453 | 453 | } |
| 454 | 454 | |
| 455 | 455 | /** |
| r242631 | r242632 | |
| 466 | 466 | */ |
| 467 | 467 | void pps4_device::iRF2() |
| 468 | 468 | { |
| 469 | ||
| 469 | m_FF2 = 0; | |
| 470 | 470 | } |
| 471 | 471 | |
| 472 | 472 | /** |
| r242631 | r242632 | |
| 490 | 490 | */ |
| 491 | 491 | void pps4_device::iLD() |
| 492 | 492 | { |
| 493 | const UINT16 i3c = ~m_I1 & 7; | |
| 494 | m_A = M(); | |
| 495 | m_B = m_B ^ (i3c << 4); | |
| 493 | const UINT16 i3c = ~m_I1 & 7; | |
| 494 | m_A = M(); | |
| 495 | m_B = m_B ^ (i3c << 4); | |
| 496 | 496 | } |
| 497 | 497 | |
| 498 | 498 | /** |
| r242631 | r242632 | |
| 513 | 513 | */ |
| 514 | 514 | void pps4_device::iEX() |
| 515 | 515 | { |
| 516 | const UINT16 i3c = ~m_I1 & 7; | |
| 517 | const UINT8 mem = M(); | |
| 518 | W(m_A); | |
| 519 | m_A = mem; | |
| 520 | m_B = m_B ^ (i3c << 4); | |
| 516 | const UINT16 i3c = ~m_I1 & 7; | |
| 517 | const UINT8 mem = M(); | |
| 518 | W(m_A); | |
| 519 | m_A = mem; | |
| 520 | m_B = m_B ^ (i3c << 4); | |
| 521 | 521 | } |
| 522 | 522 | |
| 523 | 523 | /** |
| r242631 | r242632 | |
| 542 | 542 | */ |
| 543 | 543 | void pps4_device::iEXD() |
| 544 | 544 | { |
| 545 | const UINT8 i3c = ~m_I1 & 7; | |
| 546 | const UINT8 mem = M(); | |
| 547 | UINT8 bl = m_B & 15; | |
| 548 | W(m_A); | |
| 549 | m_A = mem; | |
| 550 | m_B = m_B ^ (i3c << 4); | |
| 551 | // if decrement BL wraps to 1111b | |
| 552 | if (0 == bl) { | |
| 553 | bl = 15; | |
| 554 | m_Skip = 1; | |
| 555 | } else { | |
| 556 | bl = bl - 1; | |
| 557 | } | |
| 558 | m_B = (m_B & ~15) | bl; | |
| 545 | const UINT8 i3c = ~m_I1 & 7; | |
| 546 | const UINT8 mem = M(); | |
| 547 | UINT8 bl = m_B & 15; | |
| 548 | W(m_A); | |
| 549 | m_A = mem; | |
| 550 | m_B = m_B ^ (i3c << 4); | |
| 551 | // if decrement BL wraps to 1111b | |
| 552 | if (0 == bl) { | |
| 553 | bl = 15; | |
| 554 | m_Skip = 1; | |
| 555 | } else { | |
| 556 | bl = bl - 1; | |
| 557 | } | |
| 558 | m_B = (m_B & ~15) | bl; | |
| 559 | 559 | } |
| 560 | 560 | |
| 561 | 561 | /** |
| r242631 | r242632 | |
| 579 | 579 | */ |
| 580 | 580 | void pps4_device::iLDI() |
| 581 | 581 | { |
| 582 | // previous LDI instruction? | |
| 583 | if (0x70 == (m_Ip & 0xf0)) { | |
| 584 | LOG(("%s: skip prev:%02x op:%02x\n", __FUNCTION__, m_Ip, m_I1)); | |
| 585 | return; | |
| 586 | } | |
| 587 | m_A = ~m_I1 & 15; | |
| 582 | // previous LDI instruction? | |
| 583 | if (0x70 == (m_Ip & 0xf0)) { | |
| 584 | LOG(("%s: skip prev:%02x op:%02x\n", __FUNCTION__, m_Ip, m_I1)); | |
| 585 | return; | |
| 586 | } | |
| 587 | m_A = ~m_I1 & 15; | |
| 588 | 588 | } |
| 589 | 589 | |
| 590 | 590 | /** |
| r242631 | r242632 | |
| 602 | 602 | */ |
| 603 | 603 | void pps4_device::iLAX() |
| 604 | 604 | { |
| 605 | ||
| 605 | m_A = m_X; | |
| 606 | 606 | } |
| 607 | 607 | |
| 608 | 608 | /** |
| r242631 | r242632 | |
| 620 | 620 | */ |
| 621 | 621 | void pps4_device::iLXA() |
| 622 | 622 | { |
| 623 | ||
| 623 | m_X = m_A; | |
| 624 | 624 | } |
| 625 | 625 | |
| 626 | 626 | /** |
| r242631 | r242632 | |
| 638 | 638 | */ |
| 639 | 639 | void pps4_device::iLABL() |
| 640 | 640 | { |
| 641 | ||
| 641 | m_A = m_B & 15; | |
| 642 | 642 | } |
| 643 | 643 | |
| 644 | 644 | /** |
| r242631 | r242632 | |
| 656 | 656 | */ |
| 657 | 657 | void pps4_device::iLBMX() |
| 658 | 658 | { |
| 659 | ||
| 659 | m_B = (m_B & ~(15 << 4)) | (m_X << 4); | |
| 660 | 660 | } |
| 661 | 661 | |
| 662 | 662 | /** |
| r242631 | r242632 | |
| 676 | 676 | */ |
| 677 | 677 | void pps4_device::iLBUA() |
| 678 | 678 | { |
| 679 | m_B = (m_B & ~(15 << 8)) | (m_A << 8); | |
| 680 | m_A = M(); | |
| 679 | m_B = (m_B & ~(15 << 8)) | (m_A << 8); | |
| 680 | m_A = M(); | |
| 681 | 681 | } |
| 682 | 682 | |
| 683 | 683 | /** |
| r242631 | r242632 | |
| 695 | 695 | */ |
| 696 | 696 | void pps4_device::iXABL() |
| 697 | 697 | { |
| 698 | // swap A and BL | |
| 699 | UINT8 bl = m_B & 15; | |
| 700 | m_B = (m_B & ~15) | m_A; | |
| 701 | m_A = bl; | |
| 698 | // swap A and BL | |
| 699 | UINT8 bl = m_B & 15; | |
| 700 | m_B = (m_B & ~15) | m_A; | |
| 701 | m_A = bl; | |
| 702 | 702 | } |
| 703 | 703 | |
| 704 | 704 | /** |
| r242631 | r242632 | |
| 716 | 716 | */ |
| 717 | 717 | void pps4_device::iXBMX() |
| 718 | 718 | { |
| 719 | // swap X and BM | |
| 720 | const UINT8 bm = (m_B >> 4) & 15; | |
| 721 | m_B = (m_B & ~(15 << 4)) | (m_X << 4); | |
| 722 | m_X = bm; | |
| 719 | // swap X and BM | |
| 720 | const UINT8 bm = (m_B >> 4) & 15; | |
| 721 | m_B = (m_B & ~(15 << 4)) | (m_X << 4); | |
| 722 | m_X = bm; | |
| 723 | 723 | } |
| 724 | 724 | |
| 725 | 725 | /** |
| r242631 | r242632 | |
| 737 | 737 | */ |
| 738 | 738 | void pps4_device::iXAX() |
| 739 | 739 | { |
| 740 | // swap A and X | |
| 741 | m_A ^= m_X; | |
| 742 | m_X ^= m_A; | |
| 743 | m_A ^= m_X; | |
| 740 | // swap A and X | |
| 741 | m_A ^= m_X; | |
| 742 | m_X ^= m_A; | |
| 743 | m_A ^= m_X; | |
| 744 | 744 | } |
| 745 | 745 | |
| 746 | 746 | /** |
| r242631 | r242632 | |
| 758 | 758 | */ |
| 759 | 759 | void pps4_device::iXS() |
| 760 | 760 | { |
| 761 | // swap SA and SB | |
| 762 | m_SA ^= m_SB; | |
| 763 | m_SB ^= m_SA; | |
| 764 | m_SA ^= m_SB; | |
| 761 | // swap SA and SB | |
| 762 | m_SA ^= m_SB; | |
| 763 | m_SB ^= m_SA; | |
| 764 | m_SA ^= m_SB; | |
| 765 | 765 | } |
| 766 | 766 | |
| 767 | 767 | /** |
| r242631 | r242632 | |
| 786 | 786 | */ |
| 787 | 787 | void pps4_device::iCYS() |
| 788 | 788 | { |
| 789 | const UINT16 sa = (m_SA >> 4) | (m_A << 8); | |
| 790 | m_A = m_SA & 15; | |
| 791 | m_SA = sa; | |
| 789 | const UINT16 sa = (m_SA >> 4) | (m_A << 8); | |
| 790 | m_A = m_SA & 15; | |
| 791 | m_SA = sa; | |
| 792 | 792 | } |
| 793 | 793 | |
| 794 | 794 | /** |
| r242631 | r242632 | |
| 826 | 826 | */ |
| 827 | 827 | void pps4_device::iLB() |
| 828 | 828 | { |
| 829 | // previous LB or LBL instruction? | |
| 830 | if (0xc0 == (m_Ip & 0xf0) || 0x00 == m_Ip) { | |
| 831 | LOG(("%s: skip prev:%02x op:%02x\n", __FUNCTION__, m_Ip, m_I1)); | |
| 832 | return; | |
| 833 | } | |
| 834 | m_SB = m_SA; | |
| 835 | m_SA = (m_P + 1) & 0xFFF; | |
| 836 | m_P = (3 << 6) | (m_I1 & 15); | |
| 837 | m_B = ~ARG() & 255; | |
| 838 | m_P = m_SA; | |
| 839 | // swap SA and SB | |
| 840 | m_SA ^= m_SB; | |
| 841 | m_SB ^= m_SA; | |
| 842 | m_SA ^= m_SB; | |
| 829 | // previous LB or LBL instruction? | |
| 830 | if (0xc0 == (m_Ip & 0xf0) || 0x00 == m_Ip) { | |
| 831 | LOG(("%s: skip prev:%02x op:%02x\n", __FUNCTION__, m_Ip, m_I1)); | |
| 832 | return; | |
| 833 | } | |
| 834 | m_SB = m_SA; | |
| 835 | m_SA = (m_P + 1) & 0xFFF; | |
| 836 | m_P = (3 << 6) | (m_I1 & 15); | |
| 837 | m_B = ~ARG() & 255; | |
| 838 | m_P = m_SA; | |
| 839 | // swap SA and SB | |
| 840 | m_SA ^= m_SB; | |
| 841 | m_SB ^= m_SA; | |
| 842 | m_SA ^= m_SB; | |
| 843 | 843 | } |
| 844 | 844 | |
| 845 | 845 | /** |
| r242631 | r242632 | |
| 867 | 867 | */ |
| 868 | 868 | void pps4_device::iLBL() |
| 869 | 869 | { |
| 870 | m_I2 = ARG(); | |
| 871 | // previous LB or LBL instruction? | |
| 872 | if (0xc0 == (m_Ip & 0xf0) || 0x00 == m_Ip) { | |
| 873 | LOG(("%s: skip prev:%02x op:%02x\n", __FUNCTION__, m_Ip, m_I1)); | |
| 874 | return; | |
| 875 | } | |
| 876 | m_B = ~m_I2 & 255; // Note: immediate is 1's complement | |
| 870 | m_I2 = ARG(); | |
| 871 | // previous LB or LBL instruction? | |
| 872 | if (0xc0 == (m_Ip & 0xf0) || 0x00 == m_Ip) { | |
| 873 | LOG(("%s: skip prev:%02x op:%02x\n", __FUNCTION__, m_Ip, m_I1)); | |
| 874 | return; | |
| 875 | } | |
| 876 | m_B = ~m_I2 & 255; // Note: immediate is 1's complement | |
| 877 | 877 | } |
| 878 | 878 | |
| 879 | 879 | /** |
| r242631 | r242632 | |
| 893 | 893 | */ |
| 894 | 894 | void pps4_device::iINCB() |
| 895 | 895 | { |
| 896 | UINT8 bl = m_B & 15; | |
| 897 | bl = (bl + 1) & 15; | |
| 898 | if (0 == bl) { | |
| 899 | LOG(("%s: skip BL=%x\n", __FUNCTION__, bl)); | |
| 900 | m_Skip = 1; | |
| 901 | } | |
| 902 | m_B = (m_B & ~15) | bl; | |
| 896 | UINT8 bl = m_B & 15; | |
| 897 | bl = (bl + 1) & 15; | |
| 898 | if (0 == bl) { | |
| 899 | LOG(("%s: skip BL=%x\n", __FUNCTION__, bl)); | |
| 900 | m_Skip = 1; | |
| 901 | } | |
| 902 | m_B = (m_B & ~15) | bl; | |
| 903 | 903 | } |
| 904 | 904 | |
| 905 | 905 | /** |
| r242631 | r242632 | |
| 919 | 919 | */ |
| 920 | 920 | void pps4_device::iDECB() |
| 921 | 921 | { |
| 922 | UINT8 bl = m_B & 15; | |
| 923 | bl = (bl - 1) & 15; | |
| 924 | if (15 == bl) { | |
| 925 | LOG(("%s: skip BL=%x\n", __FUNCTION__, bl)); | |
| 926 | m_Skip = 1; | |
| 927 | } | |
| 928 | m_B = (m_B & ~15) | bl; | |
| 922 | UINT8 bl = m_B & 15; | |
| 923 | bl = (bl - 1) & 15; | |
| 924 | if (15 == bl) { | |
| 925 | LOG(("%s: skip BL=%x\n", __FUNCTION__, bl)); | |
| 926 | m_Skip = 1; | |
| 927 | } | |
| 928 | m_B = (m_B & ~15) | bl; | |
| 929 | 929 | } |
| 930 | 930 | |
| 931 | 931 | /** |
| r242631 | r242632 | |
| 945 | 945 | */ |
| 946 | 946 | void pps4_device::iT() |
| 947 | 947 | { |
| 948 | const UINT16 p = (m_P & ~63) | (m_I1 & 63); | |
| 949 | LOG(("%s: P=%03x I=%02x -> P=%03x\n", __FUNCTION__, m_P, m_I1, p)); | |
| 950 | m_P = p; | |
| 948 | const UINT16 p = (m_P & ~63) | (m_I1 & 63); | |
| 949 | LOG(("%s: P=%03x I=%02x -> P=%03x\n", __FUNCTION__, m_P, m_I1, p)); | |
| 950 | m_P = p; | |
| 951 | 951 | } |
| 952 | 952 | |
| 953 | 953 | /** |
| r242631 | r242632 | |
| 977 | 977 | */ |
| 978 | 978 | void pps4_device::iTM() |
| 979 | 979 | { |
| 980 | m_SB = m_SA; | |
| 981 | m_SA = m_P; | |
| 982 | m_P = (3 << 6) | (m_I1 & 63); | |
| 983 | m_I2 = ARG(); | |
| 984 | m_P = (1 << 8) | m_I2; | |
| 980 | m_SB = m_SA; | |
| 981 | m_SA = m_P; | |
| 982 | m_P = (3 << 6) | (m_I1 & 63); | |
| 983 | m_I2 = ARG(); | |
| 984 | m_P = (1 << 8) | m_I2; | |
| 985 | 985 | } |
| 986 | 986 | |
| 987 | 987 | /** |
| r242631 | r242632 | |
| 1003 | 1003 | */ |
| 1004 | 1004 | void pps4_device::iTL() |
| 1005 | 1005 | { |
| 1006 | m_I2 = ARG(); | |
| 1007 | m_P = ((m_I1 & 15) << 8) | m_I2; | |
| 1006 | m_I2 = ARG(); | |
| 1007 | m_P = ((m_I1 & 15) << 8) | m_I2; | |
| 1008 | 1008 | } |
| 1009 | 1009 | |
| 1010 | 1010 | /** |
| r242631 | r242632 | |
| 1028 | 1028 | */ |
| 1029 | 1029 | void pps4_device::iTML() |
| 1030 | 1030 | { |
| 1031 | m_I2 = ARG(); | |
| 1032 | m_SB = m_SA; | |
| 1033 | m_SA = m_P; | |
| 1034 | m_P = ((m_I1 & 15) << 8) | m_I2; | |
| 1031 | m_I2 = ARG(); | |
| 1032 | m_SB = m_SA; | |
| 1033 | m_SA = m_P; | |
| 1034 | m_P = ((m_I1 & 15) << 8) | m_I2; | |
| 1035 | 1035 | } |
| 1036 | 1036 | |
| 1037 | 1037 | /** |
| r242631 | r242632 | |
| 1048 | 1048 | */ |
| 1049 | 1049 | void pps4_device::iSKC() |
| 1050 | 1050 | { |
| 1051 | ||
| 1051 | m_Skip = m_C; | |
| 1052 | 1052 | } |
| 1053 | 1053 | |
| 1054 | 1054 | /** |
| r242631 | r242632 | |
| 1065 | 1065 | */ |
| 1066 | 1066 | void pps4_device::iSKZ() |
| 1067 | 1067 | { |
| 1068 | ||
| 1068 | m_Skip = (0 == m_A) ? 1 : 0; | |
| 1069 | 1069 | } |
| 1070 | 1070 | |
| 1071 | 1071 | /** |
| r242631 | r242632 | |
| 1084 | 1084 | */ |
| 1085 | 1085 | void pps4_device::iSKBI() |
| 1086 | 1086 | { |
| 1087 | const UINT8 i4 = m_I1 & 15; | |
| 1088 | const UINT8 bl = m_B & 15; | |
| 1089 | m_Skip = bl == i4 ? 1 : 0; | |
| 1087 | const UINT8 i4 = m_I1 & 15; | |
| 1088 | const UINT8 bl = m_B & 15; | |
| 1089 | m_Skip = bl == i4 ? 1 : 0; | |
| 1090 | 1090 | } |
| 1091 | 1091 | |
| 1092 | 1092 | /** |
| r242631 | r242632 | |
| 1101 | 1101 | */ |
| 1102 | 1102 | void pps4_device::iSKF1() |
| 1103 | 1103 | { |
| 1104 | ||
| 1104 | m_Skip = m_FF1; | |
| 1105 | 1105 | } |
| 1106 | 1106 | |
| 1107 | 1107 | /** |
| r242631 | r242632 | |
| 1116 | 1116 | */ |
| 1117 | 1117 | void pps4_device::iSKF2() |
| 1118 | 1118 | { |
| 1119 | ||
| 1119 | m_Skip = m_FF2; | |
| 1120 | 1120 | } |
| 1121 | 1121 | |
| 1122 | 1122 | /** |
| r242631 | r242632 | |
| 1135 | 1135 | */ |
| 1136 | 1136 | void pps4_device::iRTN() |
| 1137 | 1137 | { |
| 1138 | m_P = m_SA & 0xFFF; | |
| 1139 | // swap SA and SB | |
| 1140 | m_SA ^= m_SB; | |
| 1141 | m_SB ^= m_SA; | |
| 1142 | m_SA ^= m_SB; | |
| 1138 | m_P = m_SA & 0xFFF; | |
| 1139 | // swap SA and SB | |
| 1140 | m_SA ^= m_SB; | |
| 1141 | m_SB ^= m_SA; | |
| 1142 | m_SA ^= m_SB; | |
| 1143 | 1143 | } |
| 1144 | 1144 | |
| 1145 | 1145 | /** |
| r242631 | r242632 | |
| 1158 | 1158 | */ |
| 1159 | 1159 | void pps4_device::iRTNSK() |
| 1160 | 1160 | { |
| 1161 | m_P = m_SA & 0xFFF; | |
| 1162 | // swap SA and SB | |
| 1163 | m_SA ^= m_SB; | |
| 1164 | m_SB ^= m_SA; | |
| 1165 | m_SA ^= m_SB; | |
| 1166 | m_Skip = 1; // next opcode is ignored | |
| 1161 | m_P = m_SA & 0xFFF; | |
| 1162 | // swap SA and SB | |
| 1163 | m_SA ^= m_SB; | |
| 1164 | m_SB ^= m_SA; | |
| 1165 | m_SA ^= m_SB; | |
| 1166 | m_Skip = 1; // next opcode is ignored | |
| 1167 | 1167 | } |
| 1168 | 1168 | |
| 1169 | 1169 | /** |
| r242631 | r242632 | |
| 1195 | 1195 | */ |
| 1196 | 1196 | void pps4_device::iIOL() |
| 1197 | 1197 | { |
| 1198 | UINT8 ac = ((m_B & 15) << 4) | (~m_A & 15); | |
| 1199 | m_I2 = ARG(); | |
| 1200 | m_io->write_byte(m_I2, ac); | |
| 1201 | LOG(("%s: port:%02x <- %x\n", __FUNCTION__, m_I2, ac)); | |
| 1202 | ac = m_io->read_byte(m_I2) & 15; | |
| 1203 | LOG(("%s: port:%02x -> %x\n", __FUNCTION__, m_I2, ac)); | |
| 1204 | m_A = ~ac & 15; | |
| 1198 | UINT8 ac = ((m_B & 15) << 4) | (~m_A & 15); | |
| 1199 | m_I2 = ARG(); | |
| 1200 | m_io->write_byte(m_I2, ac); | |
| 1201 | LOG(("%s: port:%02x <- %x\n", __FUNCTION__, m_I2, ac)); | |
| 1202 | ac = m_io->read_byte(m_I2) & 15; | |
| 1203 | LOG(("%s: port:%02x -> %x\n", __FUNCTION__, m_I2, ac)); | |
| 1204 | m_A = ~ac & 15; | |
| 1205 | 1205 | } |
| 1206 | 1206 | |
| 1207 | 1207 | /** |
| r242631 | r242632 | |
| 1219 | 1219 | */ |
| 1220 | 1220 | void pps4_device::iDIA() |
| 1221 | 1221 | { |
| 1222 | ||
| 1222 | m_A = m_io->read_byte(PPS4_PORT_A) & 15; | |
| 1223 | 1223 | } |
| 1224 | 1224 | |
| 1225 | 1225 | /** |
| r242631 | r242632 | |
| 1237 | 1237 | */ |
| 1238 | 1238 | void pps4_device::iDIB() |
| 1239 | 1239 | { |
| 1240 | ||
| 1240 | m_A = m_io->read_byte(PPS4_PORT_B) & 15; | |
| 1241 | 1241 | } |
| 1242 | 1242 | |
| 1243 | 1243 | /** |
| r242631 | r242632 | |
| 1255 | 1255 | */ |
| 1256 | 1256 | void pps4_device::iDOA() |
| 1257 | 1257 | { |
| 1258 | ||
| 1258 | m_io->write_byte(PPS4_PORT_A, m_A); | |
| 1259 | 1259 | } |
| 1260 | 1260 | |
| 1261 | 1261 | /** |
| r242631 | r242632 | |
| 1277 | 1277 | */ |
| 1278 | 1278 | void pps4_device::iSAG() |
| 1279 | 1279 | { |
| 1280 | // mask bits 12:5 on next memory access | |
| 1281 | m_SAG = 0xff0; | |
| 1280 | // mask bits 12:5 on next memory access | |
| 1281 | m_SAG = 0xff0; | |
| 1282 | 1282 | } |
| 1283 | 1283 | |
| 1284 | 1284 | /*************************************************************************** |
| r242631 | r242632 | |
| 1286 | 1286 | ***************************************************************************/ |
| 1287 | 1287 | void pps4_device::execute_one() |
| 1288 | 1288 | { |
| 1289 | m_I1 = ROP(); | |
| 1290 | if (m_Skip) { | |
| 1291 | m_Skip = 0; | |
| 1292 | LOG(("%s: skip op:%02x\n", __FUNCTION__, m_I1)); | |
| 1293 | return; | |
| 1294 | } | |
| 1295 | switch (m_I1) { | |
| 1296 | case 0x00: | |
| 1297 | iLBL(); | |
| 1298 | break; | |
| 1299 | case 0x01: | |
| 1300 | iTML(); | |
| 1301 | break; | |
| 1302 | case 0x02: | |
| 1303 | iTML(); | |
| 1304 | break; | |
| 1305 | case 0x03: | |
| 1306 | iTML(); | |
| 1307 | break; | |
| 1308 | case 0x04: | |
| 1309 | iLBUA(); | |
| 1310 | break; | |
| 1311 | case 0x05: | |
| 1312 | iRTN(); | |
| 1313 | break; | |
| 1314 | case 0x06: | |
| 1315 | iXS(); | |
| 1316 | break; | |
| 1317 | case 0x07: | |
| 1318 | iRTNSK(); | |
| 1319 | break; | |
| 1320 | case 0x08: | |
| 1321 | iADCSK(); | |
| 1322 | break; | |
| 1323 | case 0x09: | |
| 1324 | iADSK(); | |
| 1325 | break; | |
| 1326 | case 0x0a: | |
| 1327 | iADC(); | |
| 1328 | break; | |
| 1329 | case 0x0b: | |
| 1330 | iAD(); | |
| 1331 | break; | |
| 1332 | case 0x0c: | |
| 1333 | iEOR(); | |
| 1334 | break; | |
| 1335 | case 0x0d: | |
| 1336 | iAND(); | |
| 1337 | break; | |
| 1338 | case 0x0e: | |
| 1339 | iCOMP(); | |
| 1340 | break; | |
| 1341 | case 0x0f: | |
| 1342 | iOR(); | |
| 1343 | break; | |
| 1289 | m_I1 = ROP(); | |
| 1290 | if (m_Skip) { | |
| 1291 | m_Skip = 0; | |
| 1292 | LOG(("%s: skip op:%02x\n", __FUNCTION__, m_I1)); | |
| 1293 | return; | |
| 1294 | } | |
| 1295 | switch (m_I1) { | |
| 1296 | case 0x00: | |
| 1297 | iLBL(); | |
| 1298 | break; | |
| 1299 | case 0x01: | |
| 1300 | iTML(); | |
| 1301 | break; | |
| 1302 | case 0x02: | |
| 1303 | iTML(); | |
| 1304 | break; | |
| 1305 | case 0x03: | |
| 1306 | iTML(); | |
| 1307 | break; | |
| 1308 | case 0x04: | |
| 1309 | iLBUA(); | |
| 1310 | break; | |
| 1311 | case 0x05: | |
| 1312 | iRTN(); | |
| 1313 | break; | |
| 1314 | case 0x06: | |
| 1315 | iXS(); | |
| 1316 | break; | |
| 1317 | case 0x07: | |
| 1318 | iRTNSK(); | |
| 1319 | break; | |
| 1320 | case 0x08: | |
| 1321 | iADCSK(); | |
| 1322 | break; | |
| 1323 | case 0x09: | |
| 1324 | iADSK(); | |
| 1325 | break; | |
| 1326 | case 0x0a: | |
| 1327 | iADC(); | |
| 1328 | break; | |
| 1329 | case 0x0b: | |
| 1330 | iAD(); | |
| 1331 | break; | |
| 1332 | case 0x0c: | |
| 1333 | iEOR(); | |
| 1334 | break; | |
| 1335 | case 0x0d: | |
| 1336 | iAND(); | |
| 1337 | break; | |
| 1338 | case 0x0e: | |
| 1339 | iCOMP(); | |
| 1340 | break; | |
| 1341 | case 0x0f: | |
| 1342 | iOR(); | |
| 1343 | break; | |
| 1344 | 1344 | |
| 1345 | case 0x10: | |
| 1346 | iLBMX(); | |
| 1347 | break; | |
| 1348 | case 0x11: | |
| 1349 | iLABL(); | |
| 1350 | break; | |
| 1351 | case 0x12: | |
| 1352 | iLAX(); | |
| 1353 | break; | |
| 1354 | case 0x13: | |
| 1355 | iSAG(); | |
| 1356 | break; | |
| 1357 | case 0x14: | |
| 1358 | iSKF2(); | |
| 1359 | break; | |
| 1360 | case 0x15: | |
| 1361 | iSKC(); | |
| 1362 | break; | |
| 1363 | case 0x16: | |
| 1364 | iSKF1(); | |
| 1365 | break; | |
| 1366 | case 0x17: | |
| 1367 | iINCB(); | |
| 1368 | break; | |
| 1369 | case 0x18: | |
| 1370 | iXBMX(); | |
| 1371 | break; | |
| 1372 | case 0x19: | |
| 1373 | iXABL(); | |
| 1374 | break; | |
| 1375 | case 0x1a: | |
| 1376 | iXAX(); | |
| 1377 | break; | |
| 1378 | case 0x1b: | |
| 1379 | iLXA(); | |
| 1380 | break; | |
| 1381 | case 0x1c: | |
| 1382 | iIOL(); | |
| 1383 | break; | |
| 1384 | case 0x1d: | |
| 1385 | iDOA(); | |
| 1386 | break; | |
| 1387 | case 0x1e: | |
| 1388 | iSKZ(); | |
| 1389 | break; | |
| 1390 | case 0x1f: | |
| 1391 | iDECB(); | |
| 1392 | break; | |
| 1345 | case 0x10: | |
| 1346 | iLBMX(); | |
| 1347 | break; | |
| 1348 | case 0x11: | |
| 1349 | iLABL(); | |
| 1350 | break; | |
| 1351 | case 0x12: | |
| 1352 | iLAX(); | |
| 1353 | break; | |
| 1354 | case 0x13: | |
| 1355 | iSAG(); | |
| 1356 | break; | |
| 1357 | case 0x14: | |
| 1358 | iSKF2(); | |
| 1359 | break; | |
| 1360 | case 0x15: | |
| 1361 | iSKC(); | |
| 1362 | break; | |
| 1363 | case 0x16: | |
| 1364 | iSKF1(); | |
| 1365 | break; | |
| 1366 | case 0x17: | |
| 1367 | iINCB(); | |
| 1368 | break; | |
| 1369 | case 0x18: | |
| 1370 | iXBMX(); | |
| 1371 | break; | |
| 1372 | case 0x19: | |
| 1373 | iXABL(); | |
| 1374 | break; | |
| 1375 | case 0x1a: | |
| 1376 | iXAX(); | |
| 1377 | break; | |
| 1378 | case 0x1b: | |
| 1379 | iLXA(); | |
| 1380 | break; | |
| 1381 | case 0x1c: | |
| 1382 | iIOL(); | |
| 1383 | break; | |
| 1384 | case 0x1d: | |
| 1385 | iDOA(); | |
| 1386 | break; | |
| 1387 | case 0x1e: | |
| 1388 | iSKZ(); | |
| 1389 | break; | |
| 1390 | case 0x1f: | |
| 1391 | iDECB(); | |
| 1392 | break; | |
| 1393 | 1393 | |
| 1394 | case 0x20: | |
| 1395 | iSC(); | |
| 1396 | break; | |
| 1397 | case 0x21: | |
| 1398 | iSF2(); | |
| 1399 | break; | |
| 1400 | case 0x22: | |
| 1401 | iSF1(); | |
| 1402 | break; | |
| 1403 | case 0x23: | |
| 1404 | iDIB(); | |
| 1405 | break; | |
| 1406 | case 0x24: | |
| 1407 | iRC(); | |
| 1408 | break; | |
| 1409 | case 0x25: | |
| 1410 | iRF2(); | |
| 1411 | break; | |
| 1412 | case 0x26: | |
| 1413 | iRF1(); | |
| 1414 | break; | |
| 1415 | case 0x27: | |
| 1416 | iDIA(); | |
| 1417 | break; | |
| 1394 | case 0x20: | |
| 1395 | iSC(); | |
| 1396 | break; | |
| 1397 | case 0x21: | |
| 1398 | iSF2(); | |
| 1399 | break; | |
| 1400 | case 0x22: | |
| 1401 | iSF1(); | |
| 1402 | break; | |
| 1403 | case 0x23: | |
| 1404 | iDIB(); | |
| 1405 | break; | |
| 1406 | case 0x24: | |
| 1407 | iRC(); | |
| 1408 | break; | |
| 1409 | case 0x25: | |
| 1410 | iRF2(); | |
| 1411 | break; | |
| 1412 | case 0x26: | |
| 1413 | iRF1(); | |
| 1414 | break; | |
| 1415 | case 0x27: | |
| 1416 | iDIA(); | |
| 1417 | break; | |
| 1418 | 1418 | |
| 1419 | case 0x28: case 0x29: case 0x2a: case 0x2b: | |
| 1420 | case 0x2c: case 0x2d: case 0x2e: case 0x2f: | |
| 1421 | iEXD(); | |
| 1422 | break; | |
| 1419 | case 0x28: case 0x29: case 0x2a: case 0x2b: | |
| 1420 | case 0x2c: case 0x2d: case 0x2e: case 0x2f: | |
| 1421 | iEXD(); | |
| 1422 | break; | |
| 1423 | 1423 | |
| 1424 | case 0x30: case 0x31: case 0x32: case 0x33: | |
| 1425 | case 0x34: case 0x35: case 0x36: case 0x37: | |
| 1426 | iLD(); | |
| 1427 | break; | |
| 1424 | case 0x30: case 0x31: case 0x32: case 0x33: | |
| 1425 | case 0x34: case 0x35: case 0x36: case 0x37: | |
| 1426 | iLD(); | |
| 1427 | break; | |
| 1428 | 1428 | |
| 1429 | case 0x38: case 0x39: case 0x3a: case 0x3b: | |
| 1430 | case 0x3c: case 0x3d: case 0x3e: case 0x3f: | |
| 1431 | iEX(); | |
| 1432 | break; | |
| 1429 | case 0x38: case 0x39: case 0x3a: case 0x3b: | |
| 1430 | case 0x3c: case 0x3d: case 0x3e: case 0x3f: | |
| 1431 | iEX(); | |
| 1432 | break; | |
| 1433 | 1433 | |
| 1434 | case 0x40: case 0x41: case 0x42: case 0x43: | |
| 1435 | case 0x44: case 0x45: case 0x46: case 0x47: | |
| 1436 | case 0x48: case 0x49: case 0x4a: case 0x4b: | |
| 1437 | case 0x4c: case 0x4d: case 0x4e: case 0x4f: | |
| 1438 | iSKBI(); | |
| 1439 | break; | |
| 1434 | case 0x40: case 0x41: case 0x42: case 0x43: | |
| 1435 | case 0x44: case 0x45: case 0x46: case 0x47: | |
| 1436 | case 0x48: case 0x49: case 0x4a: case 0x4b: | |
| 1437 | case 0x4c: case 0x4d: case 0x4e: case 0x4f: | |
| 1438 | iSKBI(); | |
| 1439 | break; | |
| 1440 | 1440 | |
| 1441 | case 0x50: case 0x51: case 0x52: case 0x53: | |
| 1442 | case 0x54: case 0x55: case 0x56: case 0x57: | |
| 1443 | case 0x58: case 0x59: case 0x5a: case 0x5b: | |
| 1444 | case 0x5c: case 0x5d: case 0x5e: case 0x5f: | |
| 1445 | iTL(); | |
| 1446 | break; | |
| 1441 | case 0x50: case 0x51: case 0x52: case 0x53: | |
| 1442 | case 0x54: case 0x55: case 0x56: case 0x57: | |
| 1443 | case 0x58: case 0x59: case 0x5a: case 0x5b: | |
| 1444 | case 0x5c: case 0x5d: case 0x5e: case 0x5f: | |
| 1445 | iTL(); | |
| 1446 | break; | |
| 1447 | 1447 | |
| 1448 | case 0x65: | |
| 1449 | iDC(); | |
| 1450 | break; | |
| 1448 | case 0x65: | |
| 1449 | iDC(); | |
| 1450 | break; | |
| 1451 | 1451 | |
| 1452 | case 0x60: case 0x61: case 0x62: case 0x63: | |
| 1453 | case 0x64: case 0x66: case 0x67: | |
| 1454 | case 0x68: case 0x69: case 0x6a: case 0x6b: | |
| 1455 | case 0x6c: case 0x6d: case 0x6e: | |
| 1456 | iADI(); | |
| 1457 | break; | |
| 1452 | case 0x60: case 0x61: case 0x62: case 0x63: | |
| 1453 | case 0x64: case 0x66: case 0x67: | |
| 1454 | case 0x68: case 0x69: case 0x6a: case 0x6b: | |
| 1455 | case 0x6c: case 0x6d: case 0x6e: | |
| 1456 | iADI(); | |
| 1457 | break; | |
| 1458 | 1458 | |
| 1459 | case 0x6f: | |
| 1460 | iCYS(); | |
| 1461 | break; | |
| 1459 | case 0x6f: | |
| 1460 | iCYS(); | |
| 1461 | break; | |
| 1462 | 1462 | |
| 1463 | case 0x70: case 0x71: case 0x72: case 0x73: | |
| 1464 | case 0x74: case 0x75: case 0x76: case 0x77: | |
| 1465 | case 0x78: case 0x79: case 0x7a: case 0x7b: | |
| 1466 | case 0x7c: case 0x7d: case 0x7e: case 0x7f: | |
| 1467 | iLDI(); | |
| 1468 | break; | |
| 1463 | case 0x70: case 0x71: case 0x72: case 0x73: | |
| 1464 | case 0x74: case 0x75: case 0x76: case 0x77: | |
| 1465 | case 0x78: case 0x79: case 0x7a: case 0x7b: | |
| 1466 | case 0x7c: case 0x7d: case 0x7e: case 0x7f: | |
| 1467 | iLDI(); | |
| 1468 | break; | |
| 1469 | 1469 | |
| 1470 | case 0x80: case 0x81: case 0x82: case 0x83: | |
| 1471 | case 0x84: case 0x85: case 0x86: case 0x87: | |
| 1472 | case 0x88: case 0x89: case 0x8a: case 0x8b: | |
| 1473 | case 0x8c: case 0x8d: case 0x8e: case 0x8f: | |
| 1474 | case 0x90: case 0x91: case 0x92: case 0x93: | |
| 1475 | case 0x94: case 0x95: case 0x96: case 0x97: | |
| 1476 | case 0x98: case 0x99: case 0x9a: case 0x9b: | |
| 1477 | case 0x9c: case 0x9d: case 0x9e: case 0x9f: | |
| 1478 | case 0xa0: case 0xa1: case 0xa2: case 0xa3: | |
| 1479 | case 0xa4: case 0xa5: case 0xa6: case 0xa7: | |
| 1480 | case 0xa8: case 0xa9: case 0xaa: case 0xab: | |
| 1481 | case 0xac: case 0xad: case 0xae: case 0xaf: | |
| 1482 | case 0xb0: case 0xb1: case 0xb2: case 0xb3: | |
| 1483 | case 0xb4: case 0xb5: case 0xb6: case 0xb7: | |
| 1484 | case 0xb8: case 0xb9: case 0xba: case 0xbb: | |
| 1485 | case 0xbc: case 0xbd: case 0xbe: case 0xbf: | |
| 1486 | iT(); | |
| 1487 | break; | |
| 1470 | case 0x80: case 0x81: case 0x82: case 0x83: | |
| 1471 | case 0x84: case 0x85: case 0x86: case 0x87: | |
| 1472 | case 0x88: case 0x89: case 0x8a: case 0x8b: | |
| 1473 | case 0x8c: case 0x8d: case 0x8e: case 0x8f: | |
| 1474 | case 0x90: case 0x91: case 0x92: case 0x93: | |
| 1475 | case 0x94: case 0x95: case 0x96: case 0x97: | |
| 1476 | case 0x98: case 0x99: case 0x9a: case 0x9b: | |
| 1477 | case 0x9c: case 0x9d: case 0x9e: case 0x9f: | |
| 1478 | case 0xa0: case 0xa1: case 0xa2: case 0xa3: | |
| 1479 | case 0xa4: case 0xa5: case 0xa6: case 0xa7: | |
| 1480 | case 0xa8: case 0xa9: case 0xaa: case 0xab: | |
| 1481 | case 0xac: case 0xad: case 0xae: case 0xaf: | |
| 1482 | case 0xb0: case 0xb1: case 0xb2: case 0xb3: | |
| 1483 | case 0xb4: case 0xb5: case 0xb6: case 0xb7: | |
| 1484 | case 0xb8: case 0xb9: case 0xba: case 0xbb: | |
| 1485 | case 0xbc: case 0xbd: case 0xbe: case 0xbf: | |
| 1486 | iT(); | |
| 1487 | break; | |
| 1488 | 1488 | |
| 1489 | 1489 | |
| 1490 | case 0xc0: case 0xc1: case 0xc2: case 0xc3: | |
| 1491 | case 0xc4: case 0xc5: case 0xc6: case 0xc7: | |
| 1492 | case 0xc8: case 0xc9: case 0xca: case 0xcb: | |
| 1493 | case 0xcc: case 0xcd: case 0xce: case 0xcf: | |
| 1494 | iLB(); | |
| 1495 | break; | |
| 1490 | case 0xc0: case 0xc1: case 0xc2: case 0xc3: | |
| 1491 | case 0xc4: case 0xc5: case 0xc6: case 0xc7: | |
| 1492 | case 0xc8: case 0xc9: case 0xca: case 0xcb: | |
| 1493 | case 0xcc: case 0xcd: case 0xce: case 0xcf: | |
| 1494 | iLB(); | |
| 1495 | break; | |
| 1496 | 1496 | |
| 1497 | default: | |
| 1498 | iTM(); | |
| 1499 | } | |
| 1497 | default: | |
| 1498 | iTM(); | |
| 1499 | } | |
| 1500 | 1500 | } |
| 1501 | 1501 | |
| 1502 | 1502 | void pps4_device::execute_run() |
| 1503 | 1503 | { |
| 1504 | do | |
| 1505 | { | |
| 1506 | debugger_instruction_hook(this, m_P); | |
| 1507 | execute_one(); | |
| 1504 | do | |
| 1505 | { | |
| 1506 | debugger_instruction_hook(this, m_P); | |
| 1507 | execute_one(); | |
| 1508 | 1508 | |
| 1509 | ||
| 1509 | } while (m_icount > 0); | |
| 1510 | 1510 | } |
| 1511 | 1511 | |
| 1512 | 1512 | /*************************************************************************** |
| r242631 | r242632 | |
| 1515 | 1515 | |
| 1516 | 1516 | void pps4_device::device_start() |
| 1517 | 1517 | { |
| 1518 | m_program = &space(AS_PROGRAM); | |
| 1519 | m_direct = &m_program->direct(); | |
| 1520 | m_data = &space(AS_DATA); | |
| 1521 | m_io = &space(AS_IO); | |
| 1518 | m_program = &space(AS_PROGRAM); | |
| 1519 | m_direct = &m_program->direct(); | |
| 1520 | m_data = &space(AS_DATA); | |
| 1521 | m_io = &space(AS_IO); | |
| 1522 | 1522 | |
| 1523 | save_item(NAME(m_A)); | |
| 1524 | save_item(NAME(m_X)); | |
| 1525 | save_item(NAME(m_P)); | |
| 1526 | save_item(NAME(m_SA)); | |
| 1527 | save_item(NAME(m_SB)); | |
| 1528 | save_item(NAME(m_Skip)); | |
| 1529 | save_item(NAME(m_SAG)); | |
| 1530 | save_item(NAME(m_B)); | |
| 1531 | save_item(NAME(m_C)); | |
| 1532 | save_item(NAME(m_FF1)); | |
| 1533 | save_item(NAME(m_FF2)); | |
| 1534 | save_item(NAME(m_I1)); | |
| 1535 | save_item(NAME(m_I2)); | |
| 1536 | save_item(NAME(m_Ip)); | |
| 1523 | save_item(NAME(m_A)); | |
| 1524 | save_item(NAME(m_X)); | |
| 1525 | save_item(NAME(m_P)); | |
| 1526 | save_item(NAME(m_SA)); | |
| 1527 | save_item(NAME(m_SB)); | |
| 1528 | save_item(NAME(m_Skip)); | |
| 1529 | save_item(NAME(m_SAG)); | |
| 1530 | save_item(NAME(m_B)); | |
| 1531 | save_item(NAME(m_C)); | |
| 1532 | save_item(NAME(m_FF1)); | |
| 1533 | save_item(NAME(m_FF2)); | |
| 1534 | save_item(NAME(m_I1)); | |
| 1535 | save_item(NAME(m_I2)); | |
| 1536 | save_item(NAME(m_Ip)); | |
| 1537 | 1537 | |
| 1538 | state_add( PPS4_PC, "PC", m_P ).mask(0xFFF).formatstr("%03X"); | |
| 1539 | state_add( PPS4_A, "A", m_A ).formatstr("%01X"); | |
| 1540 | state_add( PPS4_X, "X", m_X ).formatstr("%01X"); | |
| 1541 | state_add( PPS4_SA, "SA", m_SA ).formatstr("%03X"); | |
| 1542 | state_add( PPS4_SB, "SB", m_SB ).formatstr("%03X"); | |
| 1543 | state_add( PPS4_Skip, "Skip", m_Skip ).formatstr("%01X"); | |
| 1544 | state_add( PPS4_SAG, "SAG", m_SAG ).formatstr("%03X"); | |
| 1545 | state_add( PPS4_B, "B", m_B ).formatstr("%03X"); | |
| 1546 | state_add( PPS4_I1, "I1", m_I1 ).formatstr("%02X").noshow(); | |
| 1547 | state_add( PPS4_I2, "I2", m_I2 ).formatstr("%02X").noshow(); | |
| 1548 | state_add( PPS4_Ip, "Ip", m_Ip ).formatstr("%02X").noshow(); | |
| 1549 | state_add( STATE_GENPC, "GENPC", m_P ).noshow(); | |
| 1550 | state_add( STATE_GENFLAGS, "GENFLAGS", m_C).formatstr("%3s").noshow(); | |
| 1538 | state_add( PPS4_PC, "PC", m_P ).mask(0xFFF).formatstr("%03X"); | |
| 1539 | state_add( PPS4_A, "A", m_A ).formatstr("%01X"); | |
| 1540 | state_add( PPS4_X, "X", m_X ).formatstr("%01X"); | |
| 1541 | state_add( PPS4_SA, "SA", m_SA ).formatstr("%03X"); | |
| 1542 | state_add( PPS4_SB, "SB", m_SB ).formatstr("%03X"); | |
| 1543 | state_add( PPS4_Skip, "Skip", m_Skip ).formatstr("%01X"); | |
| 1544 | state_add( PPS4_SAG, "SAG", m_SAG ).formatstr("%03X"); | |
| 1545 | state_add( PPS4_B, "B", m_B ).formatstr("%03X"); | |
| 1546 | state_add( PPS4_I1, "I1", m_I1 ).formatstr("%02X").noshow(); | |
| 1547 | state_add( PPS4_I2, "I2", m_I2 ).formatstr("%02X").noshow(); | |
| 1548 | state_add( PPS4_Ip, "Ip", m_Ip ).formatstr("%02X").noshow(); | |
| 1549 | state_add( STATE_GENPC, "GENPC", m_P ).noshow(); | |
| 1550 | state_add( STATE_GENFLAGS, "GENFLAGS", m_C).formatstr("%3s").noshow(); | |
| 1551 | 1551 | |
| 1552 | ||
| 1552 | m_icountptr = &m_icount; | |
| 1553 | 1553 | } |
| 1554 | 1554 | |
| 1555 | 1555 | void pps4_device::state_string_export(const device_state_entry &entry, astring &string) |
| 1556 | 1556 | { |
| 1557 | switch (entry.index()) | |
| 1558 | { | |
| 1559 | case STATE_GENFLAGS: | |
| 1560 | string.printf("%c%c%c", | |
| 1561 | m_C ? 'C':'.', | |
| 1562 | m_FF1 ? '1':'.', | |
| 1563 | m_FF2 ? '2':'.'); | |
| 1564 | break; | |
| 1565 | } | |
| 1557 | switch (entry.index()) | |
| 1558 | { | |
| 1559 | case STATE_GENFLAGS: | |
| 1560 | string.printf("%c%c%c", | |
| 1561 | m_C ? 'C':'.', | |
| 1562 | m_FF1 ? '1':'.', | |
| 1563 | m_FF2 ? '2':'.'); | |
| 1564 | break; | |
| 1565 | } | |
| 1566 | 1566 | } |
| 1567 | 1567 | |
| 1568 | 1568 | /*************************************************************************** |
| r242631 | r242632 | |
| 1571 | 1571 | |
| 1572 | 1572 | void pps4_device::device_reset() |
| 1573 | 1573 | { |
| 1574 | m_A = 0; // Accumulator A(4:1) | |
| 1575 | m_X = 0; // X register X(4:1) | |
| 1576 | m_P = 0; // program counter P(12:1) | |
| 1577 | m_SA = 0; // Shift register SA(12:1) | |
| 1578 | m_SB = 0; // Shift register SB(12:1) | |
| 1579 | m_SAG = 0; // Special address generation mask | |
| 1580 | m_B = 0; // B address register B(12:1) (BL, BM and BU) | |
| 1581 | m_C = 0; // Carry flip-flop | |
| 1582 | m_FF1 = 0; // Flip-flop 1 | |
| 1583 | m_FF2 = 0; // Flip-flop 2 | |
| 1584 | m_I1 = 0; // Most recent instruction I(8:1) | |
| 1585 | m_I2 = 0; // Most recent parameter I2(8:1) | |
| 1586 | m_Ip = 0; // Previous instruction I(8:1) | |
| 1574 | m_A = 0; // Accumulator A(4:1) | |
| 1575 | m_X = 0; // X register X(4:1) | |
| 1576 | m_P = 0; // program counter P(12:1) | |
| 1577 | m_SA = 0; // Shift register SA(12:1) | |
| 1578 | m_SB = 0; // Shift register SB(12:1) | |
| 1579 | m_SAG = 0; // Special address generation mask | |
| 1580 | m_B = 0; // B address register B(12:1) (BL, BM and BU) | |
| 1581 | m_C = 0; // Carry flip-flop | |
| 1582 | m_FF1 = 0; // Flip-flop 1 | |
| 1583 | m_FF2 = 0; // Flip-flop 2 | |
| 1584 | m_I1 = 0; // Most recent instruction I(8:1) | |
| 1585 | m_I2 = 0; // Most recent parameter I2(8:1) | |
| 1586 | m_Ip = 0; // Previous instruction I(8:1) | |
| 1587 | 1587 | } |
| r242631 | r242632 | |
|---|---|---|
| 9 | 9 | ***************************************************************************/ |
| 10 | 10 | enum |
| 11 | 11 | { |
| 12 | PPS4_PC, | |
| 13 | PPS4_A, | |
| 14 | PPS4_X, | |
| 15 | PPS4_SA, | |
| 16 | PPS4_SB, | |
| 17 | PPS4_B, | |
| 18 | PPS4_Skip, | |
| 19 | PPS4_SAG, | |
| 20 | PPS4_I1, | |
| 21 | PPS4_I2, | |
| 22 | PPS4_Ip, | |
| 23 | PPS4_GENPC = STATE_GENPC, | |
| 24 | PPS4_GENSP = STATE_GENSP, | |
| 25 | PPS4_GENPCBASE = STATE_GENPCBASE, | |
| 26 | PPS4_PORT_A = 256, | |
| 27 | PPS4_PORT_B = 257 | |
| 12 | PPS4_PC, | |
| 13 | PPS4_A, | |
| 14 | PPS4_X, | |
| 15 | PPS4_SA, | |
| 16 | PPS4_SB, | |
| 17 | PPS4_B, | |
| 18 | PPS4_Skip, | |
| 19 | PPS4_SAG, | |
| 20 | PPS4_I1, | |
| 21 | PPS4_I2, | |
| 22 | PPS4_Ip, | |
| 23 | PPS4_GENPC = STATE_GENPC, | |
| 24 | PPS4_GENSP = STATE_GENSP, | |
| 25 | PPS4_GENPCBASE = STATE_GENPCBASE, | |
| 26 | PPS4_PORT_A = 256, | |
| 27 | PPS4_PORT_B = 257 | |
| 28 | 28 | }; |
| 29 | 29 | |
| 30 | 30 | /*************************************************************************** |
| r242631 | r242632 | |
| 40 | 40 | class pps4_device : public cpu_device |
| 41 | 41 | { |
| 42 | 42 | public: |
| 43 | // construction/destruction | |
| 44 | pps4_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 43 | // construction/destruction | |
| 44 | pps4_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 45 | 45 | |
| 46 | 46 | protected: |
| 47 | // device-level overrides | |
| 48 | virtual void device_start(); | |
| 49 | virtual void device_reset(); | |
| 47 | // device-level overrides | |
| 48 | virtual void device_start(); | |
| 49 | virtual void device_reset(); | |
| 50 | 50 | |
| 51 | // device_execute_interface overrides | |
| 52 | virtual UINT32 execute_min_cycles() const { return 1; } | |
| 53 | virtual UINT32 execute_max_cycles() const { return 3; } | |
| 54 | virtual UINT32 execute_input_lines() const { return 0; } | |
| 55 | virtual UINT32 execute_default_irq_vector() const { return 0; } | |
| 56 | virtual void execute_run(); | |
| 51 | // device_execute_interface overrides | |
| 52 | virtual UINT32 execute_min_cycles() const { return 1; } | |
| 53 | virtual UINT32 execute_max_cycles() const { return 3; } | |
| 54 | virtual UINT32 execute_input_lines() const { return 0; } | |
| 55 | virtual UINT32 execute_default_irq_vector() const { return 0; } | |
| 56 | virtual void execute_run(); | |
| 57 | 57 | |
| 58 | // device_memory_interface overrides | |
| 59 | virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const | |
| 60 | { | |
| 61 | return (spacenum == AS_PROGRAM) ? &m_program_config : ( (spacenum == AS_IO) ? &m_io_config : ( (spacenum == AS_DATA) ? &m_data_config : NULL ) ); | |
| 62 | } | |
| 58 | // device_memory_interface overrides | |
| 59 | virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const | |
| 60 | { | |
| 61 | return (spacenum == AS_PROGRAM) ? &m_program_config : ( (spacenum == AS_IO) ? &m_io_config : ( (spacenum == AS_DATA) ? &m_data_config : NULL ) ); | |
| 62 | } | |
| 63 | 63 | |
| 64 | // device_state_interface overrides | |
| 65 | void state_string_export(const device_state_entry &entry, astring &string); | |
| 64 | // device_state_interface overrides | |
| 65 | void state_string_export(const device_state_entry &entry, astring &string); | |
| 66 | 66 | |
| 67 | // device_disasm_interface overrides | |
| 68 | virtual UINT32 disasm_min_opcode_bytes() const { return 1; } | |
| 69 | virtual UINT32 disasm_max_opcode_bytes() const { return 2; } | |
| 70 | virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options); | |
| 67 | // device_disasm_interface overrides | |
| 68 | virtual UINT32 disasm_min_opcode_bytes() const { return 1; } | |
| 69 | virtual UINT32 disasm_max_opcode_bytes() const { return 2; } | |
| 70 | virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options); | |
| 71 | 71 | |
| 72 | 72 | private: |
| 73 | address_space_config m_program_config; | |
| 74 | address_space_config m_data_config; | |
| 75 | address_space_config m_io_config; | |
| 73 | address_space_config m_program_config; | |
| 74 | address_space_config m_data_config; | |
| 75 | address_space_config m_io_config; | |
| 76 | 76 | |
| 77 | address_space *m_program; | |
| 78 | direct_read_data *m_direct; | |
| 79 | address_space *m_data; | |
| 80 | address_space *m_io; | |
| 81 | int m_icount; | |
| 77 | address_space *m_program; | |
| 78 | direct_read_data *m_direct; | |
| 79 | address_space *m_data; | |
| 80 | address_space *m_io; | |
| 81 | int m_icount; | |
| 82 | 82 | |
| 83 | UINT8 m_A; //!< Accumulator A(4:1) | |
| 84 | UINT8 m_X; //!< X register X(4:1) | |
| 85 | UINT16 m_P; //!< program counter P(12:1) | |
| 86 | UINT16 m_SA; //!< Shift register SA(12:1) | |
| 87 | UINT16 m_SB; //!< Shift register SB(12:1) | |
| 88 | UINT8 m_Skip; //!< Skip next instruction | |
| 89 | UINT16 m_SAG; //!< Special address generation mask | |
| 90 | UINT16 m_B; //!< B register B(12:1) (BL, BM and BH) | |
| 91 | UINT8 m_C; //!< Carry flip-flop | |
| 92 | UINT8 m_FF1; //!< Flip-flop 1 | |
| 93 | UINT8 m_FF2; //!< Flip-flop 2 | |
| 94 | UINT8 m_I1; //!< Most recent instruction I(8:1) | |
| 95 | UINT8 m_I2; //!< Most recent parameter I2(8:1) | |
| 96 | UINT8 m_Ip; //!< Previous instruction I(8:1) | |
| 83 | UINT8 m_A; //!< Accumulator A(4:1) | |
| 84 | UINT8 m_X; //!< X register X(4:1) | |
| 85 | UINT16 m_P; //!< program counter P(12:1) | |
| 86 | UINT16 m_SA; //!< Shift register SA(12:1) | |
| 87 | UINT16 m_SB; //!< Shift register SB(12:1) | |
| 88 | UINT8 m_Skip; //!< Skip next instruction | |
| 89 | UINT16 m_SAG; //!< Special address generation mask | |
| 90 | UINT16 m_B; //!< B register B(12:1) (BL, BM and BH) | |
| 91 | UINT8 m_C; //!< Carry flip-flop | |
| 92 | UINT8 m_FF1; //!< Flip-flop 1 | |
| 93 | UINT8 m_FF2; //!< Flip-flop 2 | |
| 94 | UINT8 m_I1; //!< Most recent instruction I(8:1) | |
| 95 | UINT8 m_I2; //!< Most recent parameter I2(8:1) | |
| 96 | UINT8 m_Ip; //!< Previous instruction I(8:1) | |
| 97 | 97 | |
| 98 | //! return the contents of B register (made of BU, BM and BL) | |
| 99 | inline UINT16 B() const; | |
| 98 | //! return the contents of B register (made of BU, BM and BL) | |
| 99 | inline UINT16 B() const; | |
| 100 | 100 | |
| 101 | //! return memory at address B(12:1) | |
| 102 | inline UINT8 M(); | |
| 101 | //! return memory at address B(12:1) | |
| 102 | inline UINT8 M(); | |
| 103 | 103 | |
| 104 | //! write to memory at address B(12:1) | |
| 105 | inline void W(UINT8 data); | |
| 104 | //! write to memory at address B(12:1) | |
| 105 | inline void W(UINT8 data); | |
| 106 | 106 | |
| 107 | //! return the next opcode (also in m_I) | |
| 108 | inline UINT8 ROP(); | |
| 107 | //! return the next opcode (also in m_I) | |
| 108 | inline UINT8 ROP(); | |
| 109 | 109 | |
| 110 | //! return the next argument (also in m_I2) | |
| 111 | inline UINT8 ARG(); | |
| 110 | //! return the next argument (also in m_I2) | |
| 111 | inline UINT8 ARG(); | |
| 112 | 112 | |
| 113 | void iAD(); //!< Add | |
| 114 | void iADC(); //!< Add with carry-in | |
| 115 | void iADSK(); //!< Add and skip on carry-out | |
| 116 | void iADCSK(); //!< Add with carry-in and skip on carry-out | |
| 117 | void iADI(); //!< Add immediate | |
| 118 | void iDC(); //!< Decimal correction | |
| 119 | void iAND(); //!< Logical AND | |
| 120 | void iOR(); //!< Logical OR | |
| 121 | void iEOR(); //!< Logical Exclusive-OR | |
| 122 | void iCOMP(); //!< Complement | |
| 123 | void iSC(); //!< Set Carry flip-flop | |
| 124 | void iRC(); //!< Reset Carry flip-flop | |
| 125 | void iSF1(); //!< Set FF1 | |
| 126 | void iRF1(); //!< Reset FF1 | |
| 127 | void iSF2(); //!< Set FF2 | |
| 128 | void iRF2(); //!< Reset FF2 | |
| 129 | void iLD(); //!< Load accumulator from memory | |
| 130 | void iEX(); //!< Exchange accumulator and memory | |
| 131 | void iEXD(); //!< Exchange accumulator and memory and decrement BL | |
| 132 | void iLDI(); //!< Load accumulator immediate | |
| 133 | void iLAX(); //!< Load accumulator from X register | |
| 134 | void iLXA(); //!< Load X register from accumulator | |
| 135 | void iLABL(); //!< Load accumulator with BL | |
| 136 | void iLBMX(); //!< Load BM with X | |
| 137 | void iLBUA(); //!< Load BU with A | |
| 138 | void iXABL(); //!< Exchange accumulator and BL | |
| 139 | void iXBMX(); //!< Exchange BM and X registers | |
| 140 | void iXAX(); //!< Exchange accumulator and X | |
| 141 | void iXS(); //!< Eychange SA and SB registers | |
| 142 | void iCYS(); //!< Cycle SA register and accumulaor | |
| 143 | void iLB(); //!< Load B indirect | |
| 144 | void iLBL(); //!< Load B long | |
| 145 | void iINCB(); //!< Increment BL | |
| 146 | void iDECB(); //!< Decrement BL | |
| 147 | void iT(); //!< Transfer | |
| 148 | void iTM(); //!< Transfer and mark indirect | |
| 149 | void iTL(); //!< Transfer long | |
| 150 | void iTML(); //!< Transfer and mark long | |
| 151 | void iSKC(); //!< Skip on carry flip-flop | |
| 152 | void iSKZ(); //!< Skip on accumulator zero | |
| 153 | void iSKBI(); //!< Skip if BL equal to immediate | |
| 154 | void iSKF1(); //!< Skip if FF1 equals 1 | |
| 155 | void iSKF2(); //!< Skip if FF2 equals 1 | |
| 156 | void iRTN(); //!< Return | |
| 157 | void iRTNSK(); //!< Return and skip | |
| 158 | void iIOL(); //!< Input/Output long | |
| 159 | void iDIA(); //!< Discrete input group A | |
| 160 | void iDIB(); //!< Discrete input group B | |
| 161 | void iDOA(); //!< Discrete output group A | |
| 162 | void iSAG(); //!< Special address generation | |
| 113 | void iAD(); //!< Add | |
| 114 | void iADC(); //!< Add with carry-in | |
| 115 | void iADSK(); //!< Add and skip on carry-out | |
| 116 | void iADCSK(); //!< Add with carry-in and skip on carry-out | |
| 117 | void iADI(); //!< Add immediate | |
| 118 | void iDC(); //!< Decimal correction | |
| 119 | void iAND(); //!< Logical AND | |
| 120 | void iOR(); //!< Logical OR | |
| 121 | void iEOR(); //!< Logical Exclusive-OR | |
| 122 | void iCOMP(); //!< Complement | |
| 123 | void iSC(); //!< Set Carry flip-flop | |
| 124 | void iRC(); //!< Reset Carry flip-flop | |
| 125 | void iSF1(); //!< Set FF1 | |
| 126 | void iRF1(); //!< Reset FF1 | |
| 127 | void iSF2(); //!< Set FF2 | |
| 128 | void iRF2(); //!< Reset FF2 | |
| 129 | void iLD(); //!< Load accumulator from memory | |
| 130 | void iEX(); //!< Exchange accumulator and memory | |
| 131 | void iEXD(); //!< Exchange accumulator and memory and decrement BL | |
| 132 | void iLDI(); //!< Load accumulator immediate | |
| 133 | void iLAX(); //!< Load accumulator from X register | |
| 134 | void iLXA(); //!< Load X register from accumulator | |
| 135 | void iLABL(); //!< Load accumulator with BL | |
| 136 | void iLBMX(); //!< Load BM with X | |
| 137 | void iLBUA(); //!< Load BU with A | |
| 138 | void iXABL(); //!< Exchange accumulator and BL | |
| 139 | void iXBMX(); //!< Exchange BM and X registers | |
| 140 | void iXAX(); //!< Exchange accumulator and X | |
| 141 | void iXS(); //!< Eychange SA and SB registers | |
| 142 | void iCYS(); //!< Cycle SA register and accumulaor | |
| 143 | void iLB(); //!< Load B indirect | |
| 144 | void iLBL(); //!< Load B long | |
| 145 | void iINCB(); //!< Increment BL | |
| 146 | void iDECB(); //!< Decrement BL | |
| 147 | void iT(); //!< Transfer | |
| 148 | void iTM(); //!< Transfer and mark indirect | |
| 149 | void iTL(); //!< Transfer long | |
| 150 | void iTML(); //!< Transfer and mark long | |
| 151 | void iSKC(); //!< Skip on carry flip-flop | |
| 152 | void iSKZ(); //!< Skip on accumulator zero | |
| 153 | void iSKBI(); //!< Skip if BL equal to immediate | |
| 154 | void iSKF1(); //!< Skip if FF1 equals 1 | |
| 155 | void iSKF2(); //!< Skip if FF2 equals 1 | |
| 156 | void iRTN(); //!< Return | |
| 157 | void iRTNSK(); //!< Return and skip | |
| 158 | void iIOL(); //!< Input/Output long | |
| 159 | void iDIA(); //!< Discrete input group A | |
| 160 | void iDIB(); //!< Discrete input group B | |
| 161 | void iDOA(); //!< Discrete output group A | |
| 162 | void iSAG(); //!< Special address generation | |
| 163 | 163 | |
| 164 | ||
| 164 | void execute_one(); //!< execute one instruction | |
| 165 | 165 | }; |
| 166 | 166 | |
| 167 | 167 | #endif // __PPS4_H__ |
| r242631 | r242632 | |
|---|---|---|
| 16 | 16 | #define ARG(A) opram[(A) - PC] |
| 17 | 17 | |
| 18 | 18 | typedef enum pps4_token_e { |
| 19 | t_AD, t_ADC, t_ADSK, t_ADCSK, t_ADI, | |
| 20 | t_DC, t_AND, t_OR, t_EOR, t_COMP, | |
| 21 | t_SC, t_RC, t_SF1, t_RF1, t_SF2, | |
| 22 | t_RF2, t_LD, t_EX, t_EXD, t_LDI, | |
| 23 | t_LAX, t_LXA, t_LABL, t_LBMX, t_LBUA, | |
| 24 | t_XABL, t_XBMX, t_XAX, t_XS, t_CYS, | |
| 25 | t_LB, t_LBL, t_INCB, t_DECB, t_T, | |
| 26 | t_TM, t_TL, t_TML, t_SKC, t_SKZ, | |
| 27 | t_SKBI, t_SKF1, t_SKF2, t_RTN, t_RTNSK, | |
| 28 | t_IOL, t_DIA, t_DIB, t_DOA, t_SAG, | |
| 29 | t_COUNT, | |
| 30 | t_MASK = (1 << 6) - 1, | |
| 31 | t_I3c = 1 << 6, /* immediate 3 bit constant, complemented */ | |
| 32 | t_I4 = 1 << 7, /* immediate 4 bit constant */ | |
| 33 | t_I4c = 1 << 8, /* immediate 4 bit constant, complemented */ | |
| 34 | t_I4p = 1 << 9, /* immediate 4 bit offset into page 3 */ | |
| 35 | t_I6p = 1 << 10, /* immediate 6 bit constant; address in current page */ | |
| 36 | t_I6i = 1 << 11, /* immediate 6 bit indirect page 3 offset (16 ... 63) + followed by page 1 address */ | |
| 37 | t_I8 = 1 << 12, /* immediate 8 bit constant (I/O port number) */ | |
| 38 | t_I8c = 1 << 13, /* immediate 8 bit constant inverted */ | |
| 39 | t_OVER = 1 << 14, /* Debugger step over (CALL) */ | |
| 40 | t_OUT = 1 << 15 /* Debugger step out (RETURN) */ | |
| 19 | t_AD, t_ADC, t_ADSK, t_ADCSK, t_ADI, | |
| 20 | t_DC, t_AND, t_OR, t_EOR, t_COMP, | |
| 21 | t_SC, t_RC, t_SF1, t_RF1, t_SF2, | |
| 22 | t_RF2, t_LD, t_EX, t_EXD, t_LDI, | |
| 23 | t_LAX, t_LXA, t_LABL, t_LBMX, t_LBUA, | |
| 24 | t_XABL, t_XBMX, t_XAX, t_XS, t_CYS, | |
| 25 | t_LB, t_LBL, t_INCB, t_DECB, t_T, | |
| 26 | t_TM, t_TL, t_TML, t_SKC, t_SKZ, | |
| 27 | t_SKBI, t_SKF1, t_SKF2, t_RTN, t_RTNSK, | |
| 28 | t_IOL, t_DIA, t_DIB, t_DOA, t_SAG, | |
| 29 | t_COUNT, | |
| 30 | t_MASK = (1 << 6) - 1, | |
| 31 | t_I3c = 1 << 6, /* immediate 3 bit constant, complemented */ | |
| 32 | t_I4 = 1 << 7, /* immediate 4 bit constant */ | |
| 33 | t_I4c = 1 << 8, /* immediate 4 bit constant, complemented */ | |
| 34 | t_I4p = 1 << 9, /* immediate 4 bit offset into page 3 */ | |
| 35 | t_I6p = 1 << 10, /* immediate 6 bit constant; address in current page */ | |
| 36 | t_I6i = 1 << 11, /* immediate 6 bit indirect page 3 offset (16 ... 63) + followed by page 1 address */ | |
| 37 | t_I8 = 1 << 12, /* immediate 8 bit constant (I/O port number) */ | |
| 38 | t_I8c = 1 << 13, /* immediate 8 bit constant inverted */ | |
| 39 | t_OVER = 1 << 14, /* Debugger step over (CALL) */ | |
| 40 | t_OUT = 1 << 15 /* Debugger step out (RETURN) */ | |
| 41 | 41 | } pps4_token_e; |
| 42 | 42 | |
| 43 | 43 | static const char *token_str[t_COUNT] = { |
| 44 | "ad", /* add */ | |
| 45 | "adc", /* add with carry-in */ | |
| 46 | "adsk", /* add and skip on carry-out */ | |
| 47 | "adcsk", /* add with carry-in and skip on carry-out */ | |
| 48 | "adi", /* add immediate */ | |
| 49 | "dc", /* decimal correction */ | |
| 50 | "and", /* logical and */ | |
| 51 | "or", /* logical or */ | |
| 52 | "eor", /* logical exclusive-orf */ | |
| 53 | "comp", /* complement */ | |
| 54 | "sc", /* set C flip-flop */ | |
| 55 | "rc", /* reset C flip-flop */ | |
| 56 | "sf1", /* set FF1 flip-flop */ | |
| 57 | "rf1", /* reset FF1 flip-flop */ | |
| 58 | "sf2", /* set FF2 flip-flop */ | |
| 59 | "rf2", /* reset FF2 flip-flop */ | |
| 60 | "ld", /* load accumulator from memory */ | |
| 61 | "ex", /* exchange accumulator and memory */ | |
| 62 | "exd", /* exchange accumulator and memory and decrement BL */ | |
| 63 | "ldi", /* load accumulator immediate */ | |
| 64 | "lax", /* load accumulator from X register */ | |
| 65 | "lxa", /* load X register from accumulator */ | |
| 66 | "labl", /* load accumulator with BL */ | |
| 67 | "lbmx", /* load BM with X */ | |
| 68 | "lbua", /* load BU with A */ | |
| 69 | "xabl", /* exchange accumulator and BL */ | |
| 70 | "xbmx", /* exchange BM and X */ | |
| 71 | "xax", /* exchange accumulator and X */ | |
| 72 | "xs", /* exchange SA and SB */ | |
| 73 | "cys", /* cycle SA register and accumulator */ | |
| 74 | "lb", /* load B indirect */ | |
| 75 | "lbl", /* load B long */ | |
| 76 | "incb", /* increment BL */ | |
| 77 | "decb", /* decrement BL */ | |
| 78 | "t", /* transfer */ | |
| 79 | "tm", /* transfer and mark indirect */ | |
| 80 | "tl", /* transfer long */ | |
| 81 | "tml", /* transfer and mark long */ | |
| 82 | "skc", /* skip on C flip-flop equals 1 */ | |
| 83 | "skz", /* skip on accumulator zero */ | |
| 84 | "skbi", /* skip on BL equal to immediate */ | |
| 85 | "skf1", /* skip on FF1 flip-flop equals 1 */ | |
| 86 | "skf2", /* skip on FF2 flip-flop equals 1 */ | |
| 87 | "rtn", /* return */ | |
| 88 | "rtnsk", /* return and skip */ | |
| 89 | "iol", /* input/output long */ | |
| 90 | "dia", /* discrete input group A */ | |
| 91 | "dib", /* discrete input group B */ | |
| 92 | "doa", /* discrete output */ | |
| 93 | "sag" /* special address generation */ | |
| 44 | "ad", /* add */ | |
| 45 | "adc", /* add with carry-in */ | |
| 46 | "adsk", /* add and skip on carry-out */ | |
| 47 | "adcsk", /* add with carry-in and skip on carry-out */ | |
| 48 | "adi", /* add immediate */ | |
| 49 | "dc", /* decimal correction */ | |
| 50 | "and", /* logical and */ | |
| 51 | "or", /* logical or */ | |
| 52 | "eor", /* logical exclusive-orf */ | |
| 53 | "comp", /* complement */ | |
| 54 | "sc", /* set C flip-flop */ | |
| 55 | "rc", /* reset C flip-flop */ | |
| 56 | "sf1", /* set FF1 flip-flop */ | |
| 57 | "rf1", /* reset FF1 flip-flop */ | |
| 58 | "sf2", /* set FF2 flip-flop */ | |
| 59 | "rf2", /* reset FF2 flip-flop */ | |
| 60 | "ld", /* load accumulator from memory */ | |
| 61 | "ex", /* exchange accumulator and memory */ | |
| 62 | "exd", /* exchange accumulator and memory and decrement BL */ | |
| 63 | "ldi", /* load accumulator immediate */ | |
| 64 | "lax", /* load accumulator from X register */ | |
| 65 | "lxa", /* load X register from accumulator */ | |
| 66 | "labl", /* load accumulator with BL */ | |
| 67 | "lbmx", /* load BM with X */ | |
| 68 | "lbua", /* load BU with A */ | |
| 69 | "xabl", /* exchange accumulator and BL */ | |
| 70 | "xbmx", /* exchange BM and X */ | |
| 71 | "xax", /* exchange accumulator and X */ | |
| 72 | "xs", /* exchange SA and SB */ | |
| 73 | "cys", /* cycle SA register and accumulator */ | |
| 74 | "lb", /* load B indirect */ | |
| 75 | "lbl", /* load B long */ | |
| 76 | "incb", /* increment BL */ | |
| 77 | "decb", /* decrement BL */ | |
| 78 | "t", /* transfer */ | |
| 79 | "tm", /* transfer and mark indirect */ | |
| 80 | "tl", /* transfer long */ | |
| 81 | "tml", /* transfer and mark long */ | |
| 82 | "skc", /* skip on C flip-flop equals 1 */ | |
| 83 | "skz", /* skip on accumulator zero */ | |
| 84 | "skbi", /* skip on BL equal to immediate */ | |
| 85 | "skf1", /* skip on FF1 flip-flop equals 1 */ | |
| 86 | "skf2", /* skip on FF2 flip-flop equals 1 */ | |
| 87 | "rtn", /* return */ | |
| 88 | "rtnsk", /* return and skip */ | |
| 89 | "iol", /* input/output long */ | |
| 90 | "dia", /* discrete input group A */ | |
| 91 | "dib", /* discrete input group B */ | |
| 92 | "doa", /* discrete output */ | |
| 93 | "sag" /* special address generation */ | |
| 94 | 94 | }; |
| 95 | 95 | |
| 96 | 96 | static const UINT16 table[] = { |
| r242631 | r242632 | |
| 369 | 369 | |
| 370 | 370 | CPU_DISASSEMBLE( pps4 ) |
| 371 | 371 | { |
| 372 | UINT32 flags = 0; | |
| 373 | unsigned PC = pc; | |
| 374 | UINT8 op = OP(pc++); | |
| 375 | UINT32 tok = table[op]; | |
| 376 | char *dst = 0; | |
| 372 | UINT32 flags = 0; | |
| 373 | unsigned PC = pc; | |
| 374 | UINT8 op = OP(pc++); | |
| 375 | UINT32 tok = table[op]; | |
| 376 | char *dst = 0; | |
| 377 | 377 | |
| 378 | if (0 == (tok & t_MASK)) { | |
| 379 | sprintf(buffer, "%s", token_str[tok & t_MASK]); | |
| 380 | } else { | |
| 381 | dst = buffer + sprintf(buffer, "%-7s", token_str[tok & t_MASK]); | |
| 382 | } | |
| 378 | if (0 == (tok & t_MASK)) { | |
| 379 | sprintf(buffer, "%s", token_str[tok & t_MASK]); | |
| 380 | } else { | |
| 381 | dst = buffer + sprintf(buffer, "%-7s", token_str[tok & t_MASK]); | |
| 382 | } | |
| 383 | 383 | |
| 384 | if (tok & t_I3c) { | |
| 385 | // 3 bit immediate, complemented | |
| 386 | UINT8 i = ~op & 7; | |
| 387 | if (0 != i) // only print if non-zero | |
| 388 | dst += sprintf(dst, "%x", i); | |
| 389 | } | |
| 384 | if (tok & t_I3c) { | |
| 385 | // 3 bit immediate, complemented | |
| 386 | UINT8 i = ~op & 7; | |
| 387 | if (0 != i) // only print if non-zero | |
| 388 | dst += sprintf(dst, "%x", i); | |
| 389 | } | |
| 390 | 390 | |
| 391 | if (tok & t_I4) { | |
| 392 | // 4 bit immediate | |
| 393 | UINT8 i = op & 15; | |
| 394 | dst += sprintf(dst, "%x", i); | |
| 395 | } | |
| 391 | if (tok & t_I4) { | |
| 392 | // 4 bit immediate | |
| 393 | UINT8 i = op & 15; | |
| 394 | dst += sprintf(dst, "%x", i); | |
| 395 | } | |
| 396 | 396 | |
| 397 | if (tok & t_I4c) { | |
| 398 | // 4 bit immediate, complemented | |
| 399 | UINT8 i = ~op & 15; | |
| 400 | dst += sprintf(dst, "%x", i); | |
| 401 | } | |
| 397 | if (tok & t_I4c) { | |
| 398 | // 4 bit immediate, complemented | |
| 399 | UINT8 i = ~op & 15; | |
| 400 | dst += sprintf(dst, "%x", i); | |
| 401 | } | |
| 402 | 402 | |
| 403 | if (tok & t_I4p) { | |
| 404 | // 4 bit immediate offset into page 3 | |
| 405 | UINT8 i = op & 15; | |
| 406 | dst += sprintf(dst, "[%x]", 0x0c0 | i); | |
| 407 | } | |
| 403 | if (tok & t_I4p) { | |
| 404 | // 4 bit immediate offset into page 3 | |
| 405 | UINT8 i = op & 15; | |
| 406 | dst += sprintf(dst, "[%x]", 0x0c0 | i); | |
| 407 | } | |
| 408 | 408 | |
| 409 | if (tok & t_I6p) { | |
| 410 | // 6 bit immediate offset into current page | |
| 411 | UINT8 i = op & 63; | |
| 412 | dst += sprintf(dst, "%x", (PC & ~63) | i); | |
| 413 | } | |
| 409 | if (tok & t_I6p) { | |
| 410 | // 6 bit immediate offset into current page | |
| 411 | UINT8 i = op & 63; | |
| 412 | dst += sprintf(dst, "%x", (PC & ~63) | i); | |
| 413 | } | |
| 414 | 414 | |
| 415 | if (tok & t_I6i) { | |
| 416 | // 6 bit immediate offset into page 3 | |
| 417 | UINT16 i6p3 = (3 << 6) | (op & 63); | |
| 418 | // 8 bit absolute offset at 0x0100 | |
| 419 | UINT16 addr = (1 << 8) | 0; // ROM[ip3] can't be reached!? | |
| 420 | (void)addr; // avoid unused variable warning | |
| 421 | dst += sprintf(dst, "[%x]", i6p3); | |
| 422 | } | |
| 415 | if (tok & t_I6i) { | |
| 416 | // 6 bit immediate offset into page 3 | |
| 417 | UINT16 i6p3 = (3 << 6) | (op & 63); | |
| 418 | // 8 bit absolute offset at 0x0100 | |
| 419 | UINT16 addr = (1 << 8) | 0; // ROM[ip3] can't be reached!? | |
| 420 | (void)addr; // avoid unused variable warning | |
| 421 | dst += sprintf(dst, "[%x]", i6p3); | |
| 422 | } | |
| 423 | 423 | |
| 424 | if (tok & t_I8) { | |
| 425 | // 8 bit immediate I/O port address | |
| 426 | UINT8 arg = ARG(pc++); | |
| 427 | dst += sprintf(dst, "%02x", arg); | |
| 428 | } | |
| 424 | if (tok & t_I8) { | |
| 425 | // 8 bit immediate I/O port address | |
| 426 | UINT8 arg = ARG(pc++); | |
| 427 | dst += sprintf(dst, "%02x", arg); | |
| 428 | } | |
| 429 | 429 | |
| 430 | if (tok & t_I8c) { | |
| 431 | // 8 bit immediate offset into page | |
| 432 | UINT16 arg = ~ARG(pc++) & 255; | |
| 433 | dst += sprintf(dst, "%02x", arg); | |
| 434 | } | |
| 430 | if (tok & t_I8c) { | |
| 431 | // 8 bit immediate offset into page | |
| 432 | UINT16 arg = ~ARG(pc++) & 255; | |
| 433 | dst += sprintf(dst, "%02x", arg); | |
| 434 | } | |
| 435 | 435 | |
| 436 | if (tok & t_OVER) // TL or TML | |
| 437 | flags |= DASMFLAG_STEP_OVER; | |
| 436 | if (tok & t_OVER) // TL or TML | |
| 437 | flags |= DASMFLAG_STEP_OVER; | |
| 438 | 438 | |
| 439 | if (tok & t_OUT) // RTN or RTNSK | |
| 440 | flags |= DASMFLAG_STEP_OUT; | |
| 439 | if (tok & t_OUT) // RTN or RTNSK | |
| 440 | flags |= DASMFLAG_STEP_OUT; | |
| 441 | 441 | |
| 442 | ||
| 442 | return (pc - PC) | flags | DASMFLAG_SUPPORTED; | |
| 443 | 443 | } |
| r242631 | r242632 | |
|---|---|---|
| 699 | 699 | case 0x00: |
| 700 | 700 | break; |
| 701 | 701 | case 0x01: |
| 702 | // | |
| 702 | // return m_m[1] | 0; // bit31 is TDRE: Trasmit Data Register Empty. Forcing it to be '1' breaks Saturn ... | |
| 703 | 703 | return m_m[1] | (0x84 << 24); // ... but this is actually needed to make EGWord on SS to boot? |
| 704 | 704 | |
| 705 | 705 | case 0x04: // TIER, FTCSR, FRC |
| r242631 | r242632 | |
|---|---|---|
| 250 | 250 | |
| 251 | 251 | |
| 252 | 252 | static MACHINE_CONFIG_FRAGMENT(tms1000) |
| 253 | ||
| 253 | ||
| 254 | 254 | // microinstructions PLA, output PLA |
| 255 | 255 | MCFG_PLA_ADD("mpla", 8, 16, 30) |
| 256 | 256 | MCFG_PLA_FILEFORMAT(PLA_FMT_BERKELEY) |
| r242631 | r242632 | |
| 374 | 374 | m_r_mask = (1 << m_r_pins) - 1; |
| 375 | 375 | m_pc_mask = (1 << m_pc_bits) - 1; |
| 376 | 376 | m_x_mask = (1 << m_x_bits) - 1; |
| 377 | ||
| 377 | ||
| 378 | 378 | // zerofill |
| 379 | 379 | m_pc = 0; |
| 380 | 380 | m_sr = 0; |
| r242631 | r242632 | |
| 401 | 401 | m_clatch = 0; |
| 402 | 402 | m_add = 0; |
| 403 | 403 | m_bl = 0; |
| 404 | ||
| 404 | ||
| 405 | 405 | m_ram_in = 0; |
| 406 | 406 | m_dam_in = 0; |
| 407 | 407 | m_ram_out = 0; |
| r242631 | r242632 | |
| 484 | 484 | m_o_latch_low = 0; |
| 485 | 485 | m_o_latch = 0; |
| 486 | 486 | m_o_latch_prev = 0; |
| 487 | ||
| 487 | ||
| 488 | 488 | // register for savestates |
| 489 | 489 | save_item(NAME(m_r_prev)); |
| 490 | 490 | save_item(NAME(m_chipsel)); |
| r242631 | r242632 | |
| 535 | 535 | { |
| 536 | 536 | // common reset |
| 537 | 537 | tms1xxx_cpu_device::device_reset(); |
| 538 | ||
| 538 | ||
| 539 | 539 | // pre-decode instructionset |
| 540 | 540 | m_fixed_decode.resize_and_clear(0x100); |
| 541 | 541 | m_micro_decode.resize_and_clear(0x100); |
| 542 | ||
| 542 | ||
| 543 | 543 | for (int op = 0; op < 0x100; op++) |
| 544 | 544 | { |
| 545 | 545 | // _____ _____ ______ _____ ______ _____ _____ _____ _____ |
| 546 | 546 | const UINT32 md[16] = { M_STSL, M_AUTY, M_AUTA, M_CIN, M_C8, M_NE, M_CKN, M_15TN, M_MTN, M_NATN, M_ATN, M_MTP, M_YTP, M_CKP, M_CKM, M_STO }; |
| 547 | 547 | UINT16 mask = m_mpla->read(op); |
| 548 | 548 | mask ^= 0x3fc8; // invert active-negative |
| 549 | ||
| 549 | ||
| 550 | 550 | for (int bit = 0; bit < 16; bit++) |
| 551 | 551 | if (mask & (1 << bit)) |
| 552 | 552 | m_micro_decode[op] |= md[bit]; |
| r242631 | r242632 | |
| 559 | 559 | m_fixed_decode[0x0c] = F_RSTR; |
| 560 | 560 | m_fixed_decode[0x0d] = F_SETR; |
| 561 | 561 | m_fixed_decode[0x0f] = F_RETN; |
| 562 | ||
| 562 | ||
| 563 | 563 | for (int i = 0x10; i < 0x20; i++) m_fixed_decode[i] = F_LDP; |
| 564 | 564 | for (int i = 0x30; i < 0x34; i++) m_fixed_decode[i] = F_SBIT; |
| 565 | 565 | for (int i = 0x34; i < 0x38; i++) m_fixed_decode[i] = F_RBIT; |
| r242631 | r242632 | |
| 572 | 572 | void tms1100_cpu_device::device_reset() |
| 573 | 573 | { |
| 574 | 574 | tms1000_cpu_device::device_reset(); |
| 575 | ||
| 575 | ||
| 576 | 576 | // small differences in 00-3f area |
| 577 | 577 | m_fixed_decode[0x00] = 0; |
| 578 | 578 | m_fixed_decode[0x09] = F_COMX8; // ! |
| r242631 | r242632 | |
| 597 | 597 | // upper half of the opcodes is always branch/call |
| 598 | 598 | if (op & 0x80) |
| 599 | 599 | m_fixed_decode[op] = (op & 0x40) ? F_CALL: F_BR; |
| 600 | ||
| 600 | ||
| 601 | 601 | // 5 output bits select a microinstruction index |
| 602 | 602 | UINT32 imask = m_ipla->read(op); |
| 603 | 603 | UINT8 msel = imask & 0x1f; |
| 604 | ||
| 604 | ||
| 605 | 605 | // but if (from bottom to top) term 1 is active and output bit 5 is 0, R2,R4-R7 directly select a microinstruction index |
| 606 | 606 | if (imask & 0x40 && (imask & 0x20) == 0) |
| 607 | 607 | msel = (op & 0xf) | (op >> 1 & 0x10); |
| 608 | ||
| 608 | ||
| 609 | 609 | msel = BITSWAP8(msel,7,6,5,0,1,2,3,4); // lines are reversed |
| 610 | 610 | UINT32 mmask = m_mpla->read(msel); |
| 611 | 611 | mmask ^= 0x09fe; // invert active-negative |
| 612 | ||
| 612 | ||
| 613 | 613 | // _____ _____ _____ _____ ______ _____ ______ _____ _____ |
| 614 | 614 | const UINT32 md[15] = { M_CKM, M_CKP, M_YTP, M_MTP, M_ATN, M_NATN, M_MTN, M_15TN, M_CKN, M_NE, M_C8, M_CIN, M_AUTA, M_AUTY, M_STO }; |
| 615 | 615 | |
| 616 | 616 | for (int bit = 0; bit < 15; bit++) |
| 617 | 617 | if (mmask & (1 << bit)) |
| 618 | 618 | m_micro_decode[op] |= md[bit]; |
| 619 | ||
| 619 | ||
| 620 | 620 | // the other ipla terms each select a fixed instruction |
| 621 | 621 | const UINT32 id[8] = { F_LDP, F_TDO, F_COMX, F_LDX, F_SBIT, F_RBIT, F_SETR, F_RETN }; |
| 622 | ||
| 622 | ||
| 623 | 623 | for (int bit = 0; bit < 8; bit++) |
| 624 | 624 | if (imask & (0x80 << bit)) |
| 625 | 625 | m_fixed_decode[op] |= id[bit]; |
| r242631 | r242632 | |
| 630 | 630 | UINT32 tms0980_cpu_device::decode_micro(UINT8 sel) |
| 631 | 631 | { |
| 632 | 632 | UINT32 decode = 0; |
| 633 | ||
| 633 | ||
| 634 | 634 | sel = BITSWAP8(sel,7,6,0,1,2,3,4,5); // lines are reversed |
| 635 | 635 | UINT32 mask = m_mpla->read(sel); |
| 636 | 636 | mask ^= 0x43fc3; // invert active-negative |
| 637 | ||
| 637 | ||
| 638 | 638 | // M_RSTR is specific to TMS02x0, it redirects to F_RSTR |
| 639 | 639 | // M_UNK1 is specific to TMS0270, unknown yet |
| 640 | 640 | // _______ ______ _____ _____ _____ _____ ______ _____ ______ _____ _____ |
| 641 | 641 | const UINT32 md[22] = { M_NDMTP, M_DMTP, M_AUTY, M_AUTA, M_CKM, M_SSE, M_CKP, M_YTP, M_MTP, M_ATN, M_NATN, M_MTN, M_15TN, M_CKN, M_NE, M_C8, M_SSS, M_CME, M_CIN, M_STO, M_RSTR, M_UNK1 }; |
| 642 | ||
| 642 | ||
| 643 | 643 | for (int bit = 0; bit < 22 && bit < m_mpla->outputs(); bit++) |
| 644 | 644 | if (mask & (1 << bit)) |
| 645 | 645 | decode |= md[bit]; |
| 646 | ||
| 646 | ||
| 647 | 647 | return decode; |
| 648 | 648 | } |
| 649 | 649 | |
| r242631 | r242632 | |
| 651 | 651 | { |
| 652 | 652 | // common reset |
| 653 | 653 | tms1xxx_cpu_device::device_reset(); |
| 654 | ||
| 654 | ||
| 655 | 655 | // pre-decode instructionset |
| 656 | 656 | m_fixed_decode.resize_and_clear(0x200); |
| 657 | 657 | m_micro_decode.resize_and_clear(0x200); |
| r242631 | r242632 | |
| 661 | 661 | // upper half of the opcodes is always branch/call |
| 662 | 662 | if (op & 0x100) |
| 663 | 663 | m_fixed_decode[op] = (op & 0x80) ? F_CALL: F_BR; |
| 664 | ||
| 664 | ||
| 665 | 665 | UINT32 imask = m_ipla->read(op); |
| 666 | 666 | |
| 667 | 667 | // 6 output bits select a microinstruction index |
| 668 | 668 | m_micro_decode[op] = decode_micro(imask & 0x3f); |
| 669 | ||
| 669 | ||
| 670 | 670 | // the other ipla terms each select a fixed instruction |
| 671 | 671 | const UINT32 id[15] = { F_LDP, F_SBL, F_OFF, F_RBIT, F_SAL, F_XDA, F_REAC, F_SETR, F_RETN, F_SBIT, F_TDO, F_COMX8, F_COMX, F_LDX, F_SEAC }; |
| 672 | ||
| 672 | ||
| 673 | 673 | for (int bit = 0; bit < 15; bit++) |
| 674 | 674 | if (imask & (0x80 << bit)) |
| 675 | 675 | m_fixed_decode[op] |= id[bit]; |
| 676 | 676 | } |
| 677 | ||
| 677 | ||
| 678 | 678 | // like on TMS0970, one of the terms directly select a microinstruction index (via R4-R8), |
| 679 | 679 | // but it can't be pre-determined when it's active |
| 680 | 680 | m_micro_direct.resize_and_clear(0x40); |
| r242631 | r242632 | |
| 710 | 710 | fb = 1; |
| 711 | 711 | else if (m_pc == m_pc_mask) |
| 712 | 712 | fb = 0; |
| 713 | ||
| 713 | ||
| 714 | 714 | m_pc = (m_pc << 1 | fb) & m_pc_mask; |
| 715 | 715 | } |
| 716 | 716 | |
| r242631 | r242632 | |
| 731 | 731 | debugger_instruction_hook(this, m_rom_address << 1); |
| 732 | 732 | m_opcode = m_program->read_word(m_rom_address << 1) & 0x1ff; |
| 733 | 733 | m_c4 = BITSWAP8(m_opcode,7,6,5,4,0,1,2,3) & 0xf; // opcode operand is bitswapped for most opcodes |
| 734 | ||
| 734 | ||
| 735 | 735 | m_fixed = m_fixed_decode[m_opcode]; |
| 736 | ||
| 736 | ||
| 737 | 737 | // if ipla term 0 is active, R4-R8 directly select a microinstruction index when R0 or R0^BL is 0 |
| 738 | 738 | int r0 = m_opcode >> 8 & 1; |
| 739 | 739 | if (m_ipla->read(m_opcode) & 0x40 && !((r0 & m_bl) ^ r0)) |
| r242631 | r242632 | |
| 747 | 747 | void tms0270_cpu_device::read_opcode() |
| 748 | 748 | { |
| 749 | 749 | tms0980_cpu_device::read_opcode(); |
| 750 | ||
| 750 | ||
| 751 | 751 | // RSTR is on the mpla |
| 752 | 752 | if (m_micro & M_RSTR) |
| 753 | 753 | m_fixed |= F_RSTR; |
| r242631 | r242632 | |
| 780 | 780 | // R13: power off, trigger on falling edge |
| 781 | 781 | if ((m_r_prev >> 13 & 1) && !(m_r >> 13 & 1)) |
| 782 | 782 | m_power_off(1); |
| 783 | ||
| 783 | ||
| 784 | 784 | // R11: TMS5100 CTL port direction (0=read from TMS5100, 1=write to TMS5100) |
| 785 | 785 | m_ctl_dir = m_r >> 11 & 1; |
| 786 | 786 | |
| 787 | 787 | // R12: chip select (off=display via OPLA, on=TMS5100 via ACC/CKB) |
| 788 | 788 | m_chipsel = m_r >> 12 & 1; |
| 789 | ||
| 789 | ||
| 790 | 790 | if (m_chipsel) |
| 791 | 791 | { |
| 792 | 792 | // ACC via SEG B,C,D,G: TMS5100 CTL pins |
| r242631 | r242632 | |
| 812 | 812 | m_o_latch_prev = m_o_latch; |
| 813 | 813 | } |
| 814 | 814 | } |
| 815 | ||
| 815 | ||
| 816 | 816 | // standard R-output |
| 817 | 817 | if (m_r != m_r_prev) |
| 818 | 818 | { |
| r242631 | r242632 | |
| 860 | 860 | case 0x30: case 0x38: |
| 861 | 861 | m_cki_bus = 1 << (m_c4 >> 2) ^ 0xf; |
| 862 | 862 | break; |
| 863 | ||
| 863 | ||
| 864 | 864 | // 01XXXXXX: constant |
| 865 | 865 | case 0x00: // R2,3,4 are NANDed with eachother, and then ORed with R1, making 00000XXX valid too |
| 866 | 866 | case 0x40: case 0x48: case 0x50: case 0x58: case 0x60: case 0x68: case 0x70: case 0x78: |
| r242631 | r242632 | |
| 886 | 886 | case 0x020: case 0x0a0: |
| 887 | 887 | m_cki_bus = 1 << (m_c4 >> 2) ^ 0xf; |
| 888 | 888 | break; |
| 889 | ||
| 889 | ||
| 890 | 890 | // 0X1XXXXXX: constant |
| 891 | 891 | case 0x040: case 0x048: case 0x050: case 0x058: case 0x060: case 0x068: case 0x070: case 0x078: |
| 892 | 892 | case 0x0c0: case 0x0c8: case 0x0d0: case 0x0d8: case 0x0e0: case 0x0e8: case 0x0f0: case 0x0f8: |
| r242631 | r242632 | |
| 1080 | 1080 | m_o_latch_low = m_a; |
| 1081 | 1081 | else |
| 1082 | 1082 | m_o_latch = m_o_latch_low | (m_a << 4 & 0x30); |
| 1083 | ||
| 1083 | ||
| 1084 | 1084 | // write to output is done in dynamic_output |
| 1085 | 1085 | } |
| 1086 | 1086 | |
| r242631 | r242632 | |
| 1111 | 1111 | if (m_status) |
| 1112 | 1112 | { |
| 1113 | 1113 | UINT8 new_pc = m_opcode & m_pc_mask; |
| 1114 | ||
| 1114 | ||
| 1115 | 1115 | // BR: conditional branch |
| 1116 | 1116 | if (m_fixed & F_BR) |
| 1117 | 1117 | { |
| r242631 | r242632 | |
| 1120 | 1120 | m_ca = m_cb; |
| 1121 | 1121 | m_pc = new_pc; |
| 1122 | 1122 | } |
| 1123 | ||
| 1123 | ||
| 1124 | 1124 | // CALL: conditional call |
| 1125 | 1125 | if (m_fixed & F_CALL) |
| 1126 | 1126 | { |
| r242631 | r242632 | |
| 1166 | 1166 | case 1: |
| 1167 | 1167 | // fetch: rom address 2/2 |
| 1168 | 1168 | m_rom_address = (m_ca << (m_pc_bits+4)) | (m_pa << m_pc_bits) | m_pc; |
| 1169 | ||
| 1169 | ||
| 1170 | 1170 | // execute: update alu inputs |
| 1171 | 1171 | // N inputs |
| 1172 | 1172 | if (m_micro & M_15TN) m_n |= 0xf; |
| r242631 | r242632 | |
| 1233 | 1233 | if (m_fixed & F_SAL) op_sal(); |
| 1234 | 1234 | if (m_fixed & F_SBL) op_sbl(); |
| 1235 | 1235 | if (m_fixed & F_XDA) op_xda(); |
| 1236 | ||
| 1236 | ||
| 1237 | 1237 | // after fixed opcode handling: store status, write ram |
| 1238 | 1238 | m_status = status; |
| 1239 | 1239 | if (m_ram_out != -1) |
| r242631 | r242632 | |
|---|---|---|
| 77 | 77 | template<class _Object> static devcb_base &set_write_r_callback(device_t &device, _Object object) { return downcast<tms1xxx_cpu_device &>(device).m_write_r.set_callback(object); } |
| 78 | 78 | template<class _Object> static devcb_base &set_power_off_callback(device_t &device, _Object object) { return downcast<tms1xxx_cpu_device &>(device).m_power_off.set_callback(object); } |
| 79 | 79 | static void set_output_pla(device_t &device, const UINT16 *output_pla) { downcast<tms1xxx_cpu_device &>(device).c_output_pla = output_pla; } |
| 80 | ||
| 80 | ||
| 81 | 81 | protected: |
| 82 | 82 | // device-level overrides |
| 83 | 83 | virtual void device_start(); |
| r242631 | r242632 | |
| 184 | 184 | devcb_write16 m_write_o; |
| 185 | 185 | devcb_write16 m_write_r; |
| 186 | 186 | devcb_write_line m_power_off; |
| 187 | ||
| 187 | ||
| 188 | 188 | UINT32 m_o_mask; |
| 189 | 189 | UINT32 m_r_mask; |
| 190 | 190 | UINT32 m_k_mask; |
| r242631 | r242632 | |
| 239 | 239 | virtual void device_reset(); |
| 240 | 240 | |
| 241 | 241 | virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options); |
| 242 | ||
| 242 | ||
| 243 | 243 | virtual void op_setr(); |
| 244 | 244 | virtual void op_rstr(); |
| 245 | 245 | }; |
| r242631 | r242632 | |
| 263 | 263 | virtual machine_config_constructor device_mconfig_additions() const; |
| 264 | 264 | |
| 265 | 265 | virtual void write_o_output(UINT8 index); |
| 266 | ||
| 266 | ||
| 267 | 267 | virtual void op_setr(); |
| 268 | 268 | virtual void op_tdo(); |
| 269 | 269 | }; |
| r242631 | r242632 | |
| 284 | 284 | virtual UINT32 disasm_min_opcode_bytes() const { return 2; } |
| 285 | 285 | virtual UINT32 disasm_max_opcode_bytes() const { return 2; } |
| 286 | 286 | virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options); |
| 287 | ||
| 287 | ||
| 288 | 288 | virtual UINT8 read_k_input(); |
| 289 | 289 | virtual void set_cki_bus(); |
| 290 | 290 | virtual void read_opcode(); |
| 291 | ||
| 291 | ||
| 292 | 292 | virtual void op_comx(); |
| 293 | 293 | |
| 294 | 294 | UINT32 decode_micro(UINT8 sel); |
| r242631 | r242632 | |
| 299 | 299 | { |
| 300 | 300 | public: |
| 301 | 301 | tms0270_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 302 | ||
| 302 | ||
| 303 | 303 | // static configuration helpers |
| 304 | 304 | template<class _Object> static devcb_base &set_read_ctl_callback(device_t &device, _Object object) { return downcast<tms0270_cpu_device &>(device).m_read_ctl.set_callback(object); } |
| 305 | 305 | template<class _Object> static devcb_base &set_write_ctl_callback(device_t &device, _Object object) { return downcast<tms0270_cpu_device &>(device).m_write_ctl.set_callback(object); } |
| r242631 | r242632 | |
| 316 | 316 | virtual UINT8 read_k_input(); |
| 317 | 317 | virtual void dynamic_output(); |
| 318 | 318 | virtual void read_opcode(); |
| 319 | ||
| 319 | ||
| 320 | 320 | virtual void op_setr(); |
| 321 | 321 | virtual void op_rstr(); |
| 322 | 322 | virtual void op_tdo(); |
| r242631 | r242632 | |
|---|---|---|
| 348 | 348 | luabridge::LuaRef devs_table = luabridge::LuaRef::newTable(L); |
| 349 | 349 | |
| 350 | 350 | device_t *root = &(m->root_device()); |
| 351 | ||
| 351 | devs_table = devtree_dfs(root, devs_table); | |
| 352 | 352 | |
| 353 | 353 | return devs_table; |
| 354 | 354 | } |
| r242631 | r242632 | |
|---|---|---|
| 255 | 255 | primary_screen->register_vblank_callback(vblank_state_delegate(FUNC(running_machine::watchdog_vblank), this)); |
| 256 | 256 | save().save_item(NAME(m_watchdog_enabled)); |
| 257 | 257 | save().save_item(NAME(m_watchdog_counter)); |
| 258 | ||
| 258 | ||
| 259 | 259 | // save the random seed or save states might be broken in drivers that use the rand() method |
| 260 | 260 | save().save_item(NAME(m_rand_seed)); |
| 261 | ||
| 261 | ||
| 262 | 262 | // initialize image devices |
| 263 | 263 | image_init(*this); |
| 264 | 264 | m_tilemap.reset(global_alloc(tilemap_manager(*this))); |
| r242631 | r242632 | |
|---|---|---|
| 523 | 523 | save_item(NAME(m_status)); |
| 524 | 524 | save_item(NAME(m_temp)); |
| 525 | 525 | save_item(NAME(m_request)); |
| 526 | ||
| 526 | ||
| 527 | 527 | for (int i = 0; i < 4; i++) |
| 528 | 528 | { |
| 529 | 529 | save_item(NAME(m_channel[i].m_address), i); |
| r242631 | r242632 | |
|---|---|---|
| 151 | 151 | WRITE_LINE_MEMBER( e05a30_device::centronics_input_strobe ) |
| 152 | 152 | { |
| 153 | 153 | if (m_centronics_strobe == TRUE && state == FALSE && !m_centronics_busy) { |
| 154 | ||
| 155 | 154 | m_centronics_data_latch = m_centronics_data; |
| 156 | 155 | |
| 157 | 156 | m_centronics_data_latched = TRUE; |
| r242631 | r242632 | |
|---|---|---|
| 83 | 83 | AM_RANGE(0x00ec, 0x00ef) AM_WRITE8( nop_w, 0x0000ff00) // Non-existing, used for delays by the bios/os |
| 84 | 84 | ADDRESS_MAP_END |
| 85 | 85 | |
| 86 | ||
| 86 | ||
| 87 | 87 | i6300esb_lpc_device::i6300esb_lpc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 88 | 88 | : pci_device(mconfig, I6300ESB_LPC, "i6300ESB southbridge ISA/LPC bridge", tag, owner, clock, "i6300esb_lpc", __FILE__), |
| 89 | acpi(*this, "acpi"), | |
| 90 | rtc (*this, "rtc"), | |
| 91 | pit (*this, "pit") | |
| 89 | acpi(*this, "acpi"), | |
| 90 | rtc (*this, "rtc"), | |
| 91 | pit (*this, "pit") | |
| 92 | 92 | { |
| 93 | 93 | } |
| 94 | 94 |
| r242631 | r242632 | |
|---|---|---|
| 107 | 107 | public: |
| 108 | 108 | i82875p_overflow_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 109 | 109 | |
| 110 | ||
| 110 | ||
| 111 | 111 | DECLARE_READ8_MEMBER (dram_row_boundary_r); |
| 112 | 112 | DECLARE_WRITE8_MEMBER (dram_row_boundary_w); |
| 113 | 113 | DECLARE_READ8_MEMBER (dram_row_attribute_r); |
| r242631 | r242632 | |
|---|---|---|
| 34 | 34 | #include "emu.h" |
| 35 | 35 | #include "machine/r10696.h" |
| 36 | 36 | |
| 37 | #define | |
| 37 | #define VERBOSE 1 | |
| 38 | 38 | #if VERBOSE |
| 39 | 39 | #define LOG(x) logerror x |
| 40 | 40 | #else |
| r242631 | r242632 | |
| 50 | 50 | const device_type R10696 = &device_creator<r10696_device>; |
| 51 | 51 | |
| 52 | 52 | r10696_device::r10696_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 53 | : device_t(mconfig, R10696, "Rockwell 10696", tag, owner, clock, "r10696", __FILE__), | |
| 54 | m_io_a(0), m_io_b(0), m_io_c(0), | |
| 55 | m_iord(*this), m_iowr(*this) | |
| 53 | : device_t(mconfig, R10696, "Rockwell 10696", tag, owner, clock, "r10696", __FILE__), | |
| 54 | m_io_a(0), m_io_b(0), m_io_c(0), | |
| 55 | m_iord(*this), m_iowr(*this) | |
| 56 | 56 | { |
| 57 | 57 | } |
| 58 | 58 | |
| r242631 | r242632 | |
| 61 | 61 | */ |
| 62 | 62 | void r10696_device::device_start() |
| 63 | 63 | { |
| 64 | m_iord.resolve(); | |
| 65 | m_iowr.resolve(); | |
| 64 | m_iord.resolve(); | |
| 65 | m_iowr.resolve(); | |
| 66 | 66 | |
| 67 | save_item(NAME(m_io_a)); | |
| 68 | save_item(NAME(m_io_b)); | |
| 69 | save_item(NAME(m_io_c)); | |
| 67 | save_item(NAME(m_io_a)); | |
| 68 | save_item(NAME(m_io_b)); | |
| 69 | save_item(NAME(m_io_c)); | |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | /** |
| r242631 | r242632 | |
| 87 | 87 | |
| 88 | 88 | WRITE8_MEMBER( r10696_device::io_w ) |
| 89 | 89 | { |
| 90 | assert(offset < 16); | |
| 91 | const UINT8 io_a = m_io_a; | |
| 92 | const UINT8 io_b = m_io_b; | |
| 93 | const UINT8 io_c = m_io_c; | |
| 94 | switch (offset) | |
| 95 | { | |
| 96 | case 0x0A: // Read Group A | |
| 97 | case 0x09: // Read Group B | |
| 98 | case 0x03: // Read Group C | |
| 99 | case 0x00: // Read Groups A | B | C | |
| 100 | case 0x01: // Read Groups B | C | |
| 101 | case 0x02: // Read Groups A | C | |
| 102 | case 0x08: // Read Groups A | B | |
| 103 | break; | |
| 90 | assert(offset < 16); | |
| 91 | const UINT8 io_a = m_io_a; | |
| 92 | const UINT8 io_b = m_io_b; | |
| 93 | const UINT8 io_c = m_io_c; | |
| 94 | switch (offset) | |
| 95 | { | |
| 96 | case 0x0A: // Read Group A | |
| 97 | case 0x09: // Read Group B | |
| 98 | case 0x03: // Read Group C | |
| 99 | case 0x00: // Read Groups A | B | C | |
| 100 | case 0x01: // Read Groups B | C | |
| 101 | case 0x02: // Read Groups A | C | |
| 102 | case 0x08: // Read Groups A | B | |
| 103 | break; | |
| 104 | 104 | |
| 105 | case 0x0E: // Set Group A | |
| 106 | m_io_a = data & 0x0f; | |
| 107 | break; | |
| 108 | case 0x0D: // Set Group B | |
| 109 | m_io_b = data & 0x0f; | |
| 110 | break; | |
| 111 | case 0x07: // Set Group C | |
| 112 | m_io_c = data & 0x0f; | |
| 113 | break; | |
| 114 | case 0x04: // Set Groups A, B and C | |
| 115 | m_io_a = m_io_b = m_io_c = data & 0x0f; | |
| 116 | break; | |
| 117 | case 0x05: // Set Groups B and C | |
| 118 | m_io_b = m_io_c = data & 0x0f; | |
| 119 | break; | |
| 120 | case 0x06: // Set Groups A and C | |
| 121 | m_io_a = m_io_c = data & 0x0f; | |
| 122 | break; | |
| 123 | case 0x0C: // Set Groups A and B | |
| 124 | m_io_a = m_io_b = data & 0x0f; | |
| 125 | break; | |
| 126 | } | |
| 127 | if (io_a != m_io_a) | |
| 128 | m_iowr(0, m_io_a, 0x0f); | |
| 129 | if (io_b != m_io_b) | |
| 130 | m_iowr(1, m_io_b, 0x0f); | |
| 131 | if (io_c != m_io_c) | |
| 132 | m_iowr(2, m_io_c, 0x0f); | |
| 105 | case 0x0E: // Set Group A | |
| 106 | m_io_a = data & 0x0f; | |
| 107 | break; | |
| 108 | case 0x0D: // Set Group B | |
| 109 | m_io_b = data & 0x0f; | |
| 110 | break; | |
| 111 | case 0x07: // Set Group C | |
| 112 | m_io_c = data & 0x0f; | |
| 113 | break; | |
| 114 | case 0x04: // Set Groups A, B and C | |
| 115 | m_io_a = m_io_b = m_io_c = data & 0x0f; | |
| 116 | break; | |
| 117 | case 0x05: // Set Groups B and C | |
| 118 | m_io_b = m_io_c = data & 0x0f; | |
| 119 | break; | |
| 120 | case 0x06: // Set Groups A and C | |
| 121 | m_io_a = m_io_c = data & 0x0f; | |
| 122 | break; | |
| 123 | case 0x0C: // Set Groups A and B | |
| 124 | m_io_a = m_io_b = data & 0x0f; | |
| 125 | break; | |
| 126 | } | |
| 127 | if (io_a != m_io_a) | |
| 128 | m_iowr(0, m_io_a, 0x0f); | |
| 129 | if (io_b != m_io_b) | |
| 130 | m_iowr(1, m_io_b, 0x0f); | |
| 131 | if (io_c != m_io_c) | |
| 132 | m_iowr(2, m_io_c, 0x0f); | |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | |
| 136 | 136 | READ8_MEMBER( r10696_device::io_r ) |
| 137 | 137 | { |
| 138 | assert(offset < 16); | |
| 139 | UINT8 io_a, io_b, io_c; | |
| 140 | UINT8 data = 0xf; | |
| 141 | switch (offset) | |
| 142 | { | |
| 143 | case 0x0A: // Read Group A | |
| 144 | io_a = m_iord(0); | |
| 145 | data = io_a & 0x0f; | |
| 146 | break; | |
| 147 | case 0x09: // Read Group B | |
| 148 | io_b = m_iord(1); | |
| 149 | data = io_b & 0x0f; | |
| 150 | break; | |
| 151 | case 0x03: // Read Group C | |
| 152 | io_c = m_iord(2); | |
| 153 | data = io_c & 0x0f; | |
| 154 | break; | |
| 155 | case 0x00: // Read Groups A | B | C | |
| 156 | io_a = m_iord(0); | |
| 157 | io_b = m_iord(1); | |
| 158 | io_c = m_iord(2); | |
| 159 | data = (io_a | io_b | io_a) & 0x0f; | |
| 160 | break; | |
| 161 | case 0x01: // Read Groups B | C | |
| 162 | io_b = m_iord(1); | |
| 163 | io_c = m_iord(2); | |
| 164 | data = (io_b | io_c) & 0x0f; | |
| 165 | break; | |
| 166 | case 0x02: // Read Groups A | C | |
| 167 | io_a = m_iord(0); | |
| 168 | io_c = m_iord(2); | |
| 169 | data = (io_a | io_c) & 0x0f; | |
| 170 | break; | |
| 171 | case 0x08: // Read Groups A | B | |
| 172 | io_a = m_iord(0); | |
| 173 | io_b = m_iord(1); | |
| 174 | data = (io_a | io_b) & 0x0f; | |
| 175 | break; | |
| 138 | assert(offset < 16); | |
| 139 | UINT8 io_a, io_b, io_c; | |
| 140 | UINT8 data = 0xf; | |
| 141 | switch (offset) | |
| 142 | { | |
| 143 | case 0x0A: // Read Group A | |
| 144 | io_a = m_iord(0); | |
| 145 | data = io_a & 0x0f; | |
| 146 | break; | |
| 147 | case 0x09: // Read Group B | |
| 148 | io_b = m_iord(1); | |
| 149 | data = io_b & 0x0f; | |
| 150 | break; | |
| 151 | case 0x03: // Read Group C | |
| 152 | io_c = m_iord(2); | |
| 153 | data = io_c & 0x0f; | |
| 154 | break; | |
| 155 | case 0x00: // Read Groups A | B | C | |
| 156 | io_a = m_iord(0); | |
| 157 | io_b = m_iord(1); | |
| 158 | io_c = m_iord(2); | |
| 159 | data = (io_a | io_b | io_a) & 0x0f; | |
| 160 | break; | |
| 161 | case 0x01: // Read Groups B | C | |
| 162 | io_b = m_iord(1); | |
| 163 | io_c = m_iord(2); | |
| 164 | data = (io_b | io_c) & 0x0f; | |
| 165 | break; | |
| 166 | case 0x02: // Read Groups A | C | |
| 167 | io_a = m_iord(0); | |
| 168 | io_c = m_iord(2); | |
| 169 | data = (io_a | io_c) & 0x0f; | |
| 170 | break; | |
| 171 | case 0x08: // Read Groups A | B | |
| 172 | io_a = m_iord(0); | |
| 173 | io_b = m_iord(1); | |
| 174 | data = (io_a | io_b) & 0x0f; | |
| 175 | break; | |
| 176 | 176 | |
| 177 | case 0x0E: // Set Group A | |
| 178 | case 0x0D: // Set Group B | |
| 179 | case 0x07: // Set Group C | |
| 180 | case 0x04: // Set Groups A, B and C | |
| 181 | case 0x05: // Set Groups B and C | |
| 182 | case 0x06: // Set Groups A and C | |
| 183 | case 0x0C: // Set Groups A and B | |
| 184 | break; | |
| 185 | } | |
| 186 | return data; | |
| 177 | case 0x0E: // Set Group A | |
| 178 | case 0x0D: // Set Group B | |
| 179 | case 0x07: // Set Group C | |
| 180 | case 0x04: // Set Groups A, B and C | |
| 181 | case 0x05: // Set Groups B and C | |
| 182 | case 0x06: // Set Groups A and C | |
| 183 | case 0x0C: // Set Groups A and B | |
| 184 | break; | |
| 185 | } | |
| 186 | return data; | |
| 187 | 187 | } |
| r242631 | r242632 | |
|---|---|---|
| 24 | 24 | |
| 25 | 25 | /* Set the read and write group (4-bit; nibble) delegates */ |
| 26 | 26 | #define MCFG_R10696_IO(_devcb_rd,_devcb_wr) \ |
| 27 | r10696_device::set_iord(*device, DEVCB_##_devcb_rd); \ | |
| 28 | r10696_device::set_iowr(*device, DEVCB_##_devcb_wr); | |
| 27 | r10696_device::set_iord(*device, DEVCB_##_devcb_rd); \ | |
| 28 | r10696_device::set_iowr(*device, DEVCB_##_devcb_wr); | |
| 29 | 29 | |
| 30 | 30 | class r10696_device : public device_t |
| 31 | 31 | { |
| 32 | 32 | public: |
| 33 | r10696_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 34 | ~r10696_device() {} | |
| 33 | r10696_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 34 | ~r10696_device() {} | |
| 35 | 35 | |
| 36 | DECLARE_READ8_MEMBER ( io_r ); | |
| 37 | DECLARE_WRITE8_MEMBER( io_w ); | |
| 36 | DECLARE_READ8_MEMBER ( io_r ); | |
| 37 | DECLARE_WRITE8_MEMBER( io_w ); | |
| 38 | 38 | |
| 39 | template<class _Object> static devcb_base &set_iord(device_t &device, _Object object) { return downcast<r10696_device &>(device).m_iord.set_callback(object); } | |
| 40 | template<class _Object> static devcb_base &set_iowr(device_t &device, _Object object) { return downcast<r10696_device &>(device).m_iowr.set_callback(object); } | |
| 39 | template<class _Object> static devcb_base &set_iord(device_t &device, _Object object) { return downcast<r10696_device &>(device).m_iord.set_callback(object); } | |
| 40 | template<class _Object> static devcb_base &set_iowr(device_t &device, _Object object) { return downcast<r10696_device &>(device).m_iowr.set_callback(object); } | |
| 41 | 41 | protected: |
| 42 | // device-level overrides | |
| 43 | virtual void device_start(); | |
| 44 | virtual void device_reset(); | |
| 42 | // device-level overrides | |
| 43 | virtual void device_start(); | |
| 44 | virtual void device_reset(); | |
| 45 | 45 | |
| 46 | 46 | private: |
| 47 | UINT8 m_io_a; //!< input/output flip-flops group A | |
| 48 | UINT8 m_io_b; //!< input/output flip-flops group B | |
| 49 | UINT8 m_io_c; //!< input/output flip-flops group C | |
| 50 | devcb_read8 m_iord; //!< input line (read, offset = group, data = 4 bits) | |
| 51 | devcb_write8 m_iowr; //!< output line (write, offset = group, data = 4 bits) | |
| 47 | UINT8 m_io_a; //!< input/output flip-flops group A | |
| 48 | UINT8 m_io_b; //!< input/output flip-flops group B | |
| 49 | UINT8 m_io_c; //!< input/output flip-flops group C | |
| 50 | devcb_read8 m_iord; //!< input line (read, offset = group, data = 4 bits) | |
| 51 | devcb_write8 m_iowr; //!< output line (write, offset = group, data = 4 bits) | |
| 52 | 52 | }; |
| 53 | 53 | |
| 54 | 54 | extern const device_type R10696; |
| r242631 | r242632 | |
|---|---|---|
| 41 | 41 | #include "emu.h" |
| 42 | 42 | #include "machine/r10788.h" |
| 43 | 43 | |
| 44 | #define | |
| 44 | #define VERBOSE 0 | |
| 45 | 45 | #if VERBOSE |
| 46 | 46 | #define LOG(x) logerror x |
| 47 | 47 | #else |
| r242631 | r242632 | |
| 57 | 57 | const device_type R10788 = &device_creator<r10788_device>; |
| 58 | 58 | |
| 59 | 59 | r10788_device::r10788_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 60 | : device_t(mconfig, R10788, "Rockwell 10788", tag, owner, clock, "r10788", __FILE__), | |
| 61 | m_ktr(0), m_kts(0), m_kla(0), m_klb(0), m_mask_a(15), m_mask_b(15), m_ker(0), | |
| 62 | m_io_counter(0), m_scan_counter(0), | |
| 63 | m_display(*this) | |
| 60 | : device_t(mconfig, R10788, "Rockwell 10788", tag, owner, clock, "r10788", __FILE__), | |
| 61 | m_ktr(0), m_kts(0), m_kla(0), m_klb(0), m_mask_a(15), m_mask_b(15), m_ker(0), | |
| 62 | m_io_counter(0), m_scan_counter(0), | |
| 63 | m_display(*this) | |
| 64 | 64 | { |
| 65 | 65 | } |
| 66 | 66 | |
| r242631 | r242632 | |
| 69 | 69 | */ |
| 70 | 70 | void r10788_device::device_start() |
| 71 | 71 | { |
| 72 | ||
| 72 | m_display.resolve(); | |
| 73 | 73 | |
| 74 | save_item(NAME(m_reg)); | |
| 75 | save_item(NAME(m_ktr)); | |
| 76 | save_item(NAME(m_kts)); | |
| 77 | save_item(NAME(m_kla)); | |
| 78 | save_item(NAME(m_klb)); | |
| 79 | save_item(NAME(m_mask_a)); | |
| 80 | save_item(NAME(m_mask_b)); | |
| 81 | save_item(NAME(m_ker)); | |
| 82 | save_item(NAME(m_io_counter)); | |
| 83 | save_item(NAME(m_scan_counter)); | |
| 74 | save_item(NAME(m_reg)); | |
| 75 | save_item(NAME(m_ktr)); | |
| 76 | save_item(NAME(m_kts)); | |
| 77 | save_item(NAME(m_kla)); | |
| 78 | save_item(NAME(m_klb)); | |
| 79 | save_item(NAME(m_mask_a)); | |
| 80 | save_item(NAME(m_mask_b)); | |
| 81 | save_item(NAME(m_ker)); | |
| 82 | save_item(NAME(m_io_counter)); | |
| 83 | save_item(NAME(m_scan_counter)); | |
| 84 | 84 | |
| 85 | m_timer = timer_alloc(TIMER_DISPLAY); | |
| 86 | // recurring timer every 36 cycles | |
| 87 | m_timer->adjust(clocks_to_attotime(36), 0, clocks_to_attotime(36)); | |
| 85 | m_timer = timer_alloc(TIMER_DISPLAY); | |
| 86 | // recurring timer every 36 cycles | |
| 87 | m_timer->adjust(clocks_to_attotime(36), 0, clocks_to_attotime(36)); | |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | /** |
| r242631 | r242632 | |
| 93 | 93 | void r10788_device::device_reset() |
| 94 | 94 | { |
| 95 | 95 | memset(m_reg, 0x00, sizeof(m_reg)); |
| 96 | m_ktr = 0; | |
| 97 | m_kts = 0; | |
| 98 | m_kla = 0; | |
| 99 | m_klb = 0; | |
| 100 | m_mask_a = 15; | |
| 101 | m_mask_b = 15; | |
| 102 | m_ker = 0; | |
| 103 | m_scan_counter = 0; | |
| 96 | m_ktr = 0; | |
| 97 | m_kts = 0; | |
| 98 | m_kla = 0; | |
| 99 | m_klb = 0; | |
| 100 | m_mask_a = 15; | |
| 101 | m_mask_b = 15; | |
| 102 | m_ker = 0; | |
| 103 | m_scan_counter = 0; | |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | |
| r242631 | r242632 | |
| 113 | 113 | */ |
| 114 | 114 | void r10788_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) |
| 115 | 115 | { |
| 116 | UINT8 data; | |
| 117 | switch (id) | |
| 118 | { | |
| 119 | case TIMER_DISPLAY: | |
| 120 | data = (m_reg[0][m_scan_counter] & m_mask_a) + | |
| 121 | 16 * (m_reg[1][m_scan_counter] & m_mask_b); | |
| 122 | LOG(("%s: scan counter:%2d data:%02x\n", __FUNCTION__, m_scan_counter, data)); | |
| 123 | m_display(m_scan_counter, data, 0xff); | |
| 124 | break; | |
| 125 | default: | |
| 126 | LOG(("%s: invalid timer id:%d\n", __FUNCTION__, id)); | |
| 127 | } | |
| 128 | m_scan_counter = (m_scan_counter + 1) % 16; | |
| 116 | UINT8 data; | |
| 117 | switch (id) | |
| 118 | { | |
| 119 | case TIMER_DISPLAY: | |
| 120 | data = (m_reg[0][m_scan_counter] & m_mask_a) + | |
| 121 | 16 * (m_reg[1][m_scan_counter] & m_mask_b); | |
| 122 | LOG(("%s: scan counter:%2d data:%02x\n", __FUNCTION__, m_scan_counter, data)); | |
| 123 | m_display(m_scan_counter, data, 0xff); | |
| 124 | break; | |
| 125 | default: | |
| 126 | LOG(("%s: invalid timer id:%d\n", __FUNCTION__, id)); | |
| 127 | } | |
| 128 | m_scan_counter = (m_scan_counter + 1) % 16; | |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | /************************************* |
| r242631 | r242632 | |
| 142 | 142 | |
| 143 | 143 | WRITE8_MEMBER( r10788_device::io_w ) |
| 144 | 144 | { |
| 145 | assert(offset < 16); | |
| 146 | switch (offset) | |
| 147 | { | |
| 148 | case KTR: // Transfer Keyboard Return | |
| 149 | LOG(("%s: KTR data:%02x\n", __FUNCTION__, data)); | |
| 150 | m_ktr = data; | |
| 151 | break; | |
| 152 | case KTS: // Transfer Keyboard Strobe | |
| 153 | LOG(("%s: KTS data:%02x\n", __FUNCTION__, data)); | |
| 154 | m_kts = data; | |
| 155 | break; | |
| 156 | case KLA: // Load Display Register A | |
| 157 | LOG(("%s: KLA [%2d] data:%02x\n", __FUNCTION__, m_io_counter, data)); | |
| 158 | m_kla = data; | |
| 159 | m_reg[0][m_io_counter] = m_kla; | |
| 160 | break; | |
| 161 | case KLB: // Load Display Register B | |
| 162 | LOG(("%s: KLB [%2d] data:%02x\n", __FUNCTION__, m_io_counter, data)); | |
| 163 | m_klb = data; | |
| 164 | m_reg[1][m_io_counter] = m_kla; | |
| 165 | break; | |
| 166 | case KDN: // Turn On Display | |
| 167 | LOG(("%s: KDN data:%02x\n", __FUNCTION__, data)); | |
| 168 | m_mask_a = 15; | |
| 169 | m_mask_b = 15; | |
| 170 | break; | |
| 171 | case KAF: // Turn Off A | |
| 172 | LOG(("%s: KAF data:%02x\n", __FUNCTION__, data)); | |
| 173 | m_mask_a = 0; | |
| 174 | m_mask_b &= ~3; | |
| 175 | break; | |
| 176 | case KBF: // Turn Off B | |
| 177 | LOG(("%s: KBF data:%02x\n", __FUNCTION__, data)); | |
| 178 | m_mask_b &= ~12; | |
| 179 | break; | |
| 180 | case KER: // Reset Keyboard Error | |
| 181 | LOG(("%s: KER data:%02x\n", __FUNCTION__, data)); | |
| 182 | m_ker = 10; | |
| 183 | break; | |
| 184 | } | |
| 145 | assert(offset < 16); | |
| 146 | switch (offset) | |
| 147 | { | |
| 148 | case KTR: // Transfer Keyboard Return | |
| 149 | LOG(("%s: KTR data:%02x\n", __FUNCTION__, data)); | |
| 150 | m_ktr = data; | |
| 151 | break; | |
| 152 | case KTS: // Transfer Keyboard Strobe | |
| 153 | LOG(("%s: KTS data:%02x\n", __FUNCTION__, data)); | |
| 154 | m_kts = data; | |
| 155 | break; | |
| 156 | case KLA: // Load Display Register A | |
| 157 | LOG(("%s: KLA [%2d] data:%02x\n", __FUNCTION__, m_io_counter, data)); | |
| 158 | m_kla = data; | |
| 159 | m_reg[0][m_io_counter] = m_kla; | |
| 160 | break; | |
| 161 | case KLB: // Load Display Register B | |
| 162 | LOG(("%s: KLB [%2d] data:%02x\n", __FUNCTION__, m_io_counter, data)); | |
| 163 | m_klb = data; | |
| 164 | m_reg[1][m_io_counter] = m_kla; | |
| 165 | break; | |
| 166 | case KDN: // Turn On Display | |
| 167 | LOG(("%s: KDN data:%02x\n", __FUNCTION__, data)); | |
| 168 | m_mask_a = 15; | |
| 169 | m_mask_b = 15; | |
| 170 | break; | |
| 171 | case KAF: // Turn Off A | |
| 172 | LOG(("%s: KAF data:%02x\n", __FUNCTION__, data)); | |
| 173 | m_mask_a = 0; | |
| 174 | m_mask_b &= ~3; | |
| 175 | break; | |
| 176 | case KBF: // Turn Off B | |
| 177 | LOG(("%s: KBF data:%02x\n", __FUNCTION__, data)); | |
| 178 | m_mask_b &= ~12; | |
| 179 | break; | |
| 180 | case KER: // Reset Keyboard Error | |
| 181 | LOG(("%s: KER data:%02x\n", __FUNCTION__, data)); | |
| 182 | m_ker = 10; | |
| 183 | break; | |
| 184 | } | |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | |
| 188 | 188 | READ8_MEMBER( r10788_device::io_r ) |
| 189 | 189 | { |
| 190 | assert(offset < 16); | |
| 191 | UINT8 data = 0xf; | |
| 192 | switch (offset) | |
| 193 | { | |
| 194 | case KTR: // Transfer Keyboard Return | |
| 195 | data = m_ktr; | |
| 196 | LOG(("%s: KTR data:%02x\n", __FUNCTION__, data)); | |
| 197 | break; | |
| 198 | case KTS: // Transfer Keyboard Strobe | |
| 199 | data = m_kts; | |
| 200 | LOG(("%s: KTS data:%02x\n", __FUNCTION__, data)); | |
| 201 | break; | |
| 202 | case KLA: // Load Display Register A | |
| 203 | m_kla = m_reg[0][m_io_counter]; | |
| 204 | data = m_kla; | |
| 205 | LOG(("%s: KLA [%2d] data:%02x\n", __FUNCTION__, m_io_counter, data)); | |
| 206 | break; | |
| 207 | case KLB: // Load Display Register B | |
| 208 | m_klb = m_reg[1][m_io_counter]; | |
| 209 | data = m_klb; | |
| 210 | LOG(("%s: KLB [%2d] data:%02x\n", __FUNCTION__, m_io_counter, data)); | |
| 211 | // FIXME: does it automagically increment at KLB write? | |
| 212 | m_io_counter = (m_io_counter + 1) % 16; | |
| 213 | break; | |
| 214 | case KDN: // Turn On Display | |
| 215 | LOG(("%s: KDN data:%02x\n", __FUNCTION__, data)); | |
| 216 | break; | |
| 217 | case KAF: // Turn Off A | |
| 218 | LOG(("%s: KAF data:%02x\n", __FUNCTION__, data)); | |
| 219 | break; | |
| 220 | case KBF: // Turn Off B | |
| 221 | LOG(("%s: KBF data:%02x\n", __FUNCTION__, data)); | |
| 222 | break; | |
| 223 | case KER: // Reset Keyboard Error | |
| 224 | LOG(("%s: KER data:%02x\n", __FUNCTION__, data)); | |
| 225 | break; | |
| 226 | } | |
| 227 | return data; | |
| 190 | assert(offset < 16); | |
| 191 | UINT8 data = 0xf; | |
| 192 | switch (offset) | |
| 193 | { | |
| 194 | case KTR: // Transfer Keyboard Return | |
| 195 | data = m_ktr; | |
| 196 | LOG(("%s: KTR data:%02x\n", __FUNCTION__, data)); | |
| 197 | break; | |
| 198 | case KTS: // Transfer Keyboard Strobe | |
| 199 | data = m_kts; | |
| 200 | LOG(("%s: KTS data:%02x\n", __FUNCTION__, data)); | |
| 201 | break; | |
| 202 | case KLA: // Load Display Register A | |
| 203 | m_kla = m_reg[0][m_io_counter]; | |
| 204 | data = m_kla; | |
| 205 | LOG(("%s: KLA [%2d] data:%02x\n", __FUNCTION__, m_io_counter, data)); | |
| 206 | break; | |
| 207 | case KLB: // Load Display Register B | |
| 208 | m_klb = m_reg[1][m_io_counter]; | |
| 209 | data = m_klb; | |
| 210 | LOG(("%s: KLB [%2d] data:%02x\n", __FUNCTION__, m_io_counter, data)); | |
| 211 | // FIXME: does it automagically increment at KLB write? | |
| 212 | m_io_counter = (m_io_counter + 1) % 16; | |
| 213 | break; | |
| 214 | case KDN: // Turn On Display | |
| 215 | LOG(("%s: KDN data:%02x\n", __FUNCTION__, data)); | |
| 216 | break; | |
| 217 | case KAF: // Turn Off A | |
| 218 | LOG(("%s: KAF data:%02x\n", __FUNCTION__, data)); | |
| 219 | break; | |
| 220 | case KBF: // Turn Off B | |
| 221 | LOG(("%s: KBF data:%02x\n", __FUNCTION__, data)); | |
| 222 | break; | |
| 223 | case KER: // Reset Keyboard Error | |
| 224 | LOG(("%s: KER data:%02x\n", __FUNCTION__, data)); | |
| 225 | break; | |
| 226 | } | |
| 227 | return data; | |
| 228 | 228 | } |
| r242631 | r242632 | |
|---|---|---|
| 23 | 23 | |
| 24 | 24 | /* Set the writer used to update a display digit */ |
| 25 | 25 | #define MCFG_R10788_UPDATE(_devcb) \ |
| 26 | ||
| 26 | r10788_device::set_update(*device, DEVCB_##_devcb); | |
| 27 | 27 | |
| 28 | 28 | class r10788_device : public device_t |
| 29 | 29 | { |
| 30 | 30 | public: |
| 31 | r10788_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 32 | ~r10788_device() {} | |
| 31 | r10788_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 32 | ~r10788_device() {} | |
| 33 | 33 | |
| 34 | enum { | |
| 35 | KTR = 0xc, //!< Transfer Keyboard Return | |
| 36 | KTS = 0xa, //!< Transfer Keyboard Strobe | |
| 37 | KLA = 0xe, //!< Load Display Register A | |
| 38 | KLB = 0xd, //!< Load Display Register B | |
| 39 | KDN = 0x3, //!< Turn On Display | |
| 40 | KAF = 0xb, //!< Turn Off A | |
| 41 | KBF = 0x7, //!< Turn Off B | |
| 42 | KER = 0x6 //!< Reset Keyboard Error | |
| 43 | }; | |
| 34 | enum { | |
| 35 | KTR = 0xc, //!< Transfer Keyboard Return | |
| 36 | KTS = 0xa, //!< Transfer Keyboard Strobe | |
| 37 | KLA = 0xe, //!< Load Display Register A | |
| 38 | KLB = 0xd, //!< Load Display Register B | |
| 39 | KDN = 0x3, //!< Turn On Display | |
| 40 | KAF = 0xb, //!< Turn Off A | |
| 41 | KBF = 0x7, //!< Turn Off B | |
| 42 | KER = 0x6 //!< Reset Keyboard Error | |
| 43 | }; | |
| 44 | 44 | |
| 45 | DECLARE_READ8_MEMBER ( io_r ); | |
| 46 | DECLARE_WRITE8_MEMBER( io_w ); | |
| 45 | DECLARE_READ8_MEMBER ( io_r ); | |
| 46 | DECLARE_WRITE8_MEMBER( io_w ); | |
| 47 | 47 | |
| 48 | ||
| 48 | template<class _Object> static devcb_base &set_update(device_t &device, _Object object) { return downcast<r10788_device &>(device).m_display.set_callback(object); } | |
| 49 | 49 | protected: |
| 50 | // device-level overrides | |
| 51 | virtual void device_start(); | |
| 52 | virtual void device_reset(); | |
| 53 | virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); | |
| 50 | // device-level overrides | |
| 51 | virtual void device_start(); | |
| 52 | virtual void device_reset(); | |
| 53 | virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); | |
| 54 | 54 | |
| 55 | 55 | private: |
| 56 | ||
| 56 | static const device_timer_id TIMER_DISPLAY = 0; | |
| 57 | 57 | |
| 58 | UINT8 m_reg[2][16]; //!< display registers | |
| 59 | UINT8 m_ktr; //!< transfer keyboard return value | |
| 60 | UINT8 m_kts; //!< transfer keyboard strobe value | |
| 61 | UINT8 m_kla; //!< display register A value | |
| 62 | UINT8 m_klb; //!< display register B value | |
| 63 | UINT8 m_mask_a; //!< display enable bits for A | |
| 64 | UINT8 m_mask_b; //!< display enable bits for B | |
| 65 | UINT8 m_ker; //!< keyboard error value | |
| 66 | int m_io_counter; //!< current I/O register index | |
| 67 | int m_scan_counter; //!< current display scan | |
| 68 | devcb_write8 m_display; //!< display updater | |
| 69 | emu_timer* m_timer; //!< timer running at clock / 18 / 36 | |
| 58 | UINT8 m_reg[2][16]; //!< display registers | |
| 59 | UINT8 m_ktr; //!< transfer keyboard return value | |
| 60 | UINT8 m_kts; //!< transfer keyboard strobe value | |
| 61 | UINT8 m_kla; //!< display register A value | |
| 62 | UINT8 m_klb; //!< display register B value | |
| 63 | UINT8 m_mask_a; //!< display enable bits for A | |
| 64 | UINT8 m_mask_b; //!< display enable bits for B | |
| 65 | UINT8 m_ker; //!< keyboard error value | |
| 66 | int m_io_counter; //!< current I/O register index | |
| 67 | int m_scan_counter; //!< current display scan | |
| 68 | devcb_write8 m_display; //!< display updater | |
| 69 | emu_timer* m_timer; //!< timer running at clock / 18 / 36 | |
| 70 | 70 | }; |
| 71 | 71 | |
| 72 | 72 | extern const device_type R10788; |
| r242631 | r242632 | |
|---|---|---|
| 40 | 40 | #include "emu.h" |
| 41 | 41 | #include "machine/ra17xx.h" |
| 42 | 42 | |
| 43 | #define | |
| 43 | #define VERBOSE 1 | |
| 44 | 44 | #if VERBOSE |
| 45 | 45 | #define LOG(x) logerror x |
| 46 | 46 | #else |
| r242631 | r242632 | |
| 56 | 56 | const device_type RA17XX = &device_creator<ra17xx_device>; |
| 57 | 57 | |
| 58 | 58 | ra17xx_device::ra17xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 59 | : device_t(mconfig, RA17XX, "Rockwell A17XX", tag, owner, clock, "ra17xx", __FILE__), | |
| 60 | m_enable(false), | |
| 61 | m_iord(*this), | |
| 62 | m_iowr(*this) | |
| 59 | : device_t(mconfig, RA17XX, "Rockwell A17XX", tag, owner, clock, "ra17xx", __FILE__), | |
| 60 | m_enable(false), | |
| 61 | m_iord(*this), | |
| 62 | m_iowr(*this) | |
| 63 | 63 | { |
| 64 | 64 | } |
| 65 | 65 | |
| r242631 | r242632 | |
| 68 | 68 | */ |
| 69 | 69 | void ra17xx_device::device_start() |
| 70 | 70 | { |
| 71 | m_iord.resolve(); | |
| 72 | m_iowr.resolve(); | |
| 71 | m_iord.resolve(); | |
| 72 | m_iowr.resolve(); | |
| 73 | 73 | |
| 74 | ||
| 74 | save_item(NAME(m_line)); | |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | /** |
| r242631 | r242632 | |
| 79 | 79 | */ |
| 80 | 80 | void ra17xx_device::device_reset() |
| 81 | 81 | { |
| 82 | ||
| 82 | memset(m_line, 0, sizeof(m_line)); | |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | |
| r242631 | r242632 | |
| 97 | 97 | |
| 98 | 98 | WRITE8_MEMBER( ra17xx_device::io_w ) |
| 99 | 99 | { |
| 100 | assert(offset < 16); | |
| 101 | m_bl = (data >> 4) & 15; // BL on the data bus most significant bits | |
| 102 | if (offset & 1) { | |
| 103 | // SOS command | |
| 104 | if (data & (1 << 3)) { | |
| 105 | m_line[m_bl] = 1; // enable output | |
| 100 | assert(offset < 16); | |
| 101 | m_bl = (data >> 4) & 15; // BL on the data bus most significant bits | |
| 102 | if (offset & 1) { | |
| 103 | // SOS command | |
| 104 | if (data & (1 << 3)) { | |
| 105 | m_line[m_bl] = 1; // enable output | |
| 106 | 106 | // if (m_enable) |
| 107 | m_iowr(m_bl, 1, 1); | |
| 108 | } else { | |
| 109 | m_line[m_bl] = 0; // disable output | |
| 107 | m_iowr(m_bl, 1, 1); | |
| 108 | } else { | |
| 109 | m_line[m_bl] = 0; // disable output | |
| 110 | 110 | // if (m_enable) |
| 111 | m_iowr(m_bl, 0, 1); | |
| 112 | } | |
| 113 | } else { | |
| 114 | // SES command | |
| 115 | if (data & (1 << 3)) { | |
| 116 | // enable all outputs | |
| 117 | m_enable = true; | |
| 118 | for (int i = 0; i < 16; i++) | |
| 119 | m_iowr(i, m_line[i], 1); | |
| 120 | } else { | |
| 121 | // disable all outputs | |
| 122 | m_enable = false; | |
| 123 | } | |
| 124 | } | |
| 111 | m_iowr(m_bl, 0, 1); | |
| 112 | } | |
| 113 | } else { | |
| 114 | // SES command | |
| 115 | if (data & (1 << 3)) { | |
| 116 | // enable all outputs | |
| 117 | m_enable = true; | |
| 118 | for (int i = 0; i < 16; i++) | |
| 119 | m_iowr(i, m_line[i], 1); | |
| 120 | } else { | |
| 121 | // disable all outputs | |
| 122 | m_enable = false; | |
| 123 | } | |
| 124 | } | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | |
| 128 | 128 | READ8_MEMBER( ra17xx_device::io_r ) |
| 129 | 129 | { |
| 130 | assert(offset < 16); | |
| 131 | return (m_iord(m_bl) & 1) ? 0x0f : 0x07; | |
| 130 | assert(offset < 16); | |
| 131 | return (m_iord(m_bl) & 1) ? 0x0f : 0x07; | |
| 132 | 132 | } |
| r242631 | r242632 | |
|---|---|---|
| 23 | 23 | |
| 24 | 24 | /* Set the read line handler */ |
| 25 | 25 | #define MCFG_RA17XX_READ(_devcb) \ |
| 26 | ra17xx_device::set_iord(*device, DEVCB_##_devcb); \ | |
| 27 | ||
| 26 | ra17xx_device::set_iord(*device, DEVCB_##_devcb); | |
| 28 | 27 | /* Set the write line handler */ |
| 29 | 28 | #define MCFG_RA17XX_WRITE(_devcb) \ |
| 30 | ra17xx_device::set_iowr(*device, DEVCB_##_devcb); \ | |
| 31 | ||
| 29 | ra17xx_device::set_iowr(*device, DEVCB_##_devcb); | |
| 32 | 30 | class ra17xx_device : public device_t |
| 33 | 31 | { |
| 34 | 32 | public: |
| 35 | ra17xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 36 | ~ra17xx_device() {} | |
| 33 | ra17xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 34 | ~ra17xx_device() {} | |
| 37 | 35 | |
| 38 | DECLARE_READ8_MEMBER ( io_r ); | |
| 39 | DECLARE_WRITE8_MEMBER( io_w ); | |
| 36 | DECLARE_READ8_MEMBER ( io_r ); | |
| 37 | DECLARE_WRITE8_MEMBER( io_w ); | |
| 40 | 38 | |
| 41 | template<class _Object> static devcb_base &set_iord(device_t &device, _Object object) { return downcast<ra17xx_device &>(device).m_iord.set_callback(object); } | |
| 42 | template<class _Object> static devcb_base &set_iowr(device_t &device, _Object object) { return downcast<ra17xx_device &>(device).m_iowr.set_callback(object); } | |
| 39 | template<class _Object> static devcb_base &set_iord(device_t &device, _Object object) { return downcast<ra17xx_device &>(device).m_iord.set_callback(object); } | |
| 40 | template<class _Object> static devcb_base &set_iowr(device_t &device, _Object object) { return downcast<ra17xx_device &>(device).m_iowr.set_callback(object); } | |
| 43 | 41 | protected: |
| 44 | // device-level overrides | |
| 45 | virtual void device_start(); | |
| 46 | virtual void device_reset(); | |
| 42 | // device-level overrides | |
| 43 | virtual void device_start(); | |
| 44 | virtual void device_reset(); | |
| 47 | 45 | |
| 48 | 46 | private: |
| 49 | UINT8 m_line[16]; //!< input/output flip-flops for 16 I/O lines | |
| 50 | UINT8 m_bl; //!< value of BL during the most recent output | |
| 51 | bool m_enable; //!< true if outputs are enabled | |
| 52 | devcb_read8 m_iord; //!< input line (read, offset = line, data = 0/1) | |
| 53 | devcb_write8 m_iowr; //!< output line (write, offset = line, data = 0/1) | |
| 47 | UINT8 m_line[16]; //!< input/output flip-flops for 16 I/O lines | |
| 48 | UINT8 m_bl; //!< value of BL during the most recent output | |
| 49 | bool m_enable; //!< true if outputs are enabled | |
| 50 | devcb_read8 m_iord; //!< input line (read, offset = line, data = 0/1) | |
| 51 | devcb_write8 m_iowr; //!< output line (write, offset = line, data = 0/1) | |
| 54 | 52 | }; |
| 55 | 53 | |
| 56 | 54 | extern const device_type RA17XX; |
| r242631 | r242632 | |
|---|---|---|
| 393 | 393 | void saturn_state::smpc_keyboard(UINT8 pad_num, UINT8 offset) |
| 394 | 394 | { |
| 395 | 395 | UINT16 game_key; |
| 396 | ||
| 396 | ||
| 397 | 397 | game_key = 0xffff; |
| 398 | 398 | |
| 399 | 399 | game_key ^= ((ioport("KEYS_1")->read() & 0x80) << 8); // right |
| r242631 | r242632 | |
| 415 | 415 | m_smpc.OREG[2+pad_num*offset] = game_key>>8; // game buttons, TODO |
| 416 | 416 | m_smpc.OREG[3+pad_num*offset] = game_key & 0xff; |
| 417 | 417 | /* |
| 418 | Keyboard Status hook-up | |
| 419 | TODO: how shift key actually works? EGWord uses it in order to switch between hiragana and katakana modes. | |
| 418 | Keyboard Status hook-up | |
| 419 | TODO: how shift key actually works? EGWord uses it in order to switch between hiragana and katakana modes. | |
| 420 | 420 | x--- ---- 0 |
| 421 | 421 | -x-- ---- caps lock |
| 422 | 422 | --x- ---- num lock |
| r242631 | r242632 | |
|---|---|---|
| 46 | 46 | m_optic_cb(*this) |
| 47 | 47 | { |
| 48 | 48 | m_max_steps=(48*2); |
| 49 | } | |
| 49 | } | |
| 50 | 50 | /////////////////////////////////////////////////////////////////////////// |
| 51 | 51 | |
| 52 | 52 | void stepper_device::update_optic() |
| r242631 | r242632 | |
|---|---|---|
| 31 | 31 | |
| 32 | 32 | #define MCFG_STEPPER_ADD(_tag)\ |
| 33 | 33 | MCFG_DEVICE_ADD(_tag, STEPPER, 0) |
| 34 | ||
| 34 | ||
| 35 | 35 | #define MCFG_STEPPER_REEL_TYPE(_data) \ |
| 36 | 36 | stepper_device::set_reel_type(*device, _data); |
| 37 | 37 | |
| 38 | 38 | /* total size of reel (in half steps) */ |
| 39 | 39 | #define MCFG_STEPPER_MAX_STEPS(_write) \ |
| 40 | stepper_device::set_max_steps(*device, _write); | |
| 41 | ||
| 40 | stepper_device::set_max_steps(*device, _write); | |
| 41 | ||
| 42 | 42 | /* start position of index (in half steps) */ |
| 43 | 43 | #define MCFG_STEPPER_START_INDEX(_write) \ |
| 44 | stepper_device::set_start_index(*device, _write); | |
| 44 | stepper_device::set_start_index(*device, _write); | |
| 45 | 45 | |
| 46 | /* end position of index (in half steps) */ | |
| 46 | /* end position of index (in half steps) */ | |
| 47 | 47 | #define MCFG_STEPPER_END_INDEX(_write) \ |
| 48 | stepper_device::set_end_index(*device, _write); | |
| 48 | stepper_device::set_end_index(*device, _write); | |
| 49 | 49 | |
| 50 | /* end position of index (in half steps) */ | |
| 50 | /* end position of index (in half steps) */ | |
| 51 | 51 | #define MCFG_STEPPER_INDEX_PATTERN(_write) \ |
| 52 | stepper_device::set_index_pattern(*device, _write); | |
| 53 | ||
| 52 | stepper_device::set_index_pattern(*device, _write); | |
| 53 | ||
| 54 | 54 | /* Phase at 0, for opto linkage */ |
| 55 | 55 | #define MCFG_STEPPER_INIT_PHASE(_write) \ |
| 56 | stepper_device::set_init_phase(*device, _write); | |
| 56 | stepper_device::set_init_phase(*device, _write); | |
| 57 | 57 | |
| 58 | 58 | #define MCFG_STARPOINT_48STEP_ADD(_tag)\ |
| 59 | 59 | MCFG_STEPPER_ADD(_tag)\ |
| r242631 | r242632 | |
| 103 | 103 | |
| 104 | 104 | template<class _Object> static devcb_base &set_optic_handler(device_t &device, _Object object) { return downcast<stepper_device &>(device).m_optic_cb.set_callback(object); } |
| 105 | 105 | |
| 106 | static void set_reel_type(device_t &device, UINT8 type) | |
| 107 | { | |
| 108 | downcast<stepper_device &>(device).m_type = type; | |
| 106 | static void set_reel_type(device_t &device, UINT8 type) | |
| 107 | { | |
| 108 | downcast<stepper_device &>(device).m_type = type; | |
| 109 | 109 | switch ( type ) |
| 110 | 110 | { default: |
| 111 | 111 | case STARPOINT_48STEP_REEL: /* STARPOINT RMxxx */ |
| r242631 | r242632 | |
| 127 | 127 | case ECOIN_200STEP_REEL : |
| 128 | 128 | downcast<stepper_device &>(device).m_max_steps = (200*2); |
| 129 | 129 | break; |
| 130 | } | |
| 130 | } | |
| 131 | 131 | } |
| 132 | 132 | static void set_max_steps(device_t &device, INT16 steps) { downcast<stepper_device &>(device).m_max_steps = steps; } |
| 133 | 133 | static void set_start_index(device_t &device, INT16 index) { downcast<stepper_device &>(device).m_index_start = index; } |
| 134 | static void set_end_index(device_t &device, INT16 index) { downcast<stepper_device &>(device).m_index_end = index; } | |
| 135 | static void set_index_pattern(device_t &device, INT16 index) { downcast<stepper_device &>(device).m_index_patt = index; } | |
| 136 | static void set_init_phase(device_t &device, UINT8 phase) | |
| 134 | static void set_end_index(device_t &device, INT16 index) { downcast<stepper_device &>(device).m_index_end = index; } | |
| 135 | static void set_index_pattern(device_t &device, INT16 index) { downcast<stepper_device &>(device).m_index_patt = index; } | |
| 136 | static void set_init_phase(device_t &device, UINT8 phase) | |
| 137 | 137 | { |
| 138 | downcast<stepper_device &>(device).m_initphase = phase; | |
| 139 | downcast<stepper_device &>(device).m_phase = phase; | |
| 140 | downcast<stepper_device &>(device).m_old_phase = phase; | |
| 138 | downcast<stepper_device &>(device).m_initphase = phase; | |
| 139 | downcast<stepper_device &>(device).m_phase = phase; | |
| 140 | downcast<stepper_device &>(device).m_old_phase = phase; | |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | /* update a motor */ |
| r242631 | r242632 | |
|---|---|---|
| 94 | 94 | |
| 95 | 95 | enum |
| 96 | 96 | { |
| 97 | LINE_CAP_NONE = 0, | |
| 98 | LINE_CAP_START = 1, | |
| 99 | LINE_CAP_END = 2 | |
| 97 | LINE_CAP_NONE = 0, | |
| 98 | LINE_CAP_START = 1, | |
| 99 | LINE_CAP_END = 2 | |
| 100 | 100 | }; |
| 101 | 101 | |
| 102 | 102 | |
| r242631 | r242632 | |
| 120 | 120 | |
| 121 | 121 | inline int gcd(int a, int b) |
| 122 | 122 | { |
| 123 | while (b != 0) | |
| 124 | { | |
| 125 | int t = b; | |
| 126 | b = a % b; | |
| 127 | a = t; | |
| 128 | } | |
| 129 | return a; | |
| 123 | while (b != 0) | |
| 124 | { | |
| 125 | int t = b; | |
| 126 | b = a % b; | |
| 127 | a = t; | |
| 128 | } | |
| 129 | return a; | |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | |
| r242631 | r242632 | |
| 137 | 137 | |
| 138 | 138 | inline void reduce_fraction(int &num, int &den) |
| 139 | 139 | { |
| 140 | // search the greatest common divisor | |
| 141 | int div = gcd(num, den); | |
| 140 | // search the greatest common divisor | |
| 141 | int div = gcd(num, den); | |
| 142 | 142 | |
| 143 | // reduce the fraction if a common divisor has been found | |
| 144 | if (div > 1) | |
| 145 | { | |
| 146 | num /= div; | |
| 147 | den /= div; | |
| 148 | } | |
| 143 | // reduce the fraction if a common divisor has been found | |
| 144 | if (div > 1) | |
| 145 | { | |
| 146 | num /= div; | |
| 147 | den /= div; | |
| 148 | } | |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | |
| r242631 | r242632 | |
| 161 | 161 | |
| 162 | 162 | static int get_variable_value(running_machine &machine, const char *string, char **outputptr) |
| 163 | 163 | { |
| 164 | ||
| 164 | char temp[100]; | |
| 165 | 165 | |
| 166 | // screen 0 parameters | |
| 167 | screen_device_iterator iter(machine.root_device()); | |
| 168 | int scrnum = 0; | |
| 169 | for (const screen_device *device = iter.first(); device != NULL; device = iter.next(), scrnum++) | |
| 170 | { | |
| 171 | // native X aspect factor | |
| 172 | sprintf(temp, "~scr%dnativexaspect~", scrnum); | |
| 173 | if (!strncmp(string, temp, strlen(temp))) | |
| 174 | { | |
| 175 | int num = device->visible_area().width(); | |
| 176 | int den = device->visible_area().height(); | |
| 177 | reduce_fraction(num, den); | |
| 178 | *outputptr += sprintf(*outputptr, "%d", num); | |
| 179 | return strlen(temp); | |
| 180 | } | |
| 166 | // screen 0 parameters | |
| 167 | screen_device_iterator iter(machine.root_device()); | |
| 168 | int scrnum = 0; | |
| 169 | for (const screen_device *device = iter.first(); device != NULL; device = iter.next(), scrnum++) | |
| 170 | { | |
| 171 | // native X aspect factor | |
| 172 | sprintf(temp, "~scr%dnativexaspect~", scrnum); | |
| 173 | if (!strncmp(string, temp, strlen(temp))) | |
| 174 | { | |
| 175 | int num = device->visible_area().width(); | |
| 176 | int den = device->visible_area().height(); | |
| 177 | reduce_fraction(num, den); | |
| 178 | *outputptr += sprintf(*outputptr, "%d", num); | |
| 179 | return strlen(temp); | |
| 180 | } | |
| 181 | 181 | |
| 182 | // native Y aspect factor | |
| 183 | sprintf(temp, "~scr%dnativeyaspect~", scrnum); | |
| 184 | if (!strncmp(string, temp, strlen(temp))) | |
| 185 | { | |
| 186 | int num = device->visible_area().width(); | |
| 187 | int den = device->visible_area().height(); | |
| 188 | reduce_fraction(num, den); | |
| 189 | *outputptr += sprintf(*outputptr, "%d", den); | |
| 190 | return strlen(temp); | |
| 191 | } | |
| 182 | // native Y aspect factor | |
| 183 | sprintf(temp, "~scr%dnativeyaspect~", scrnum); | |
| 184 | if (!strncmp(string, temp, strlen(temp))) | |
| 185 | { | |
| 186 | int num = device->visible_area().width(); | |
| 187 | int den = device->visible_area().height(); | |
| 188 | reduce_fraction(num, den); | |
| 189 | *outputptr += sprintf(*outputptr, "%d", den); | |
| 190 | return strlen(temp); | |
| 191 | } | |
| 192 | 192 | |
| 193 | // native width | |
| 194 | sprintf(temp, "~scr%dwidth~", scrnum); | |
| 195 | if (!strncmp(string, temp, strlen(temp))) | |
| 196 | { | |
| 197 | *outputptr += sprintf(*outputptr, "%d", device->visible_area().width()); | |
| 198 | return strlen(temp); | |
| 199 | } | |
| 193 | // native width | |
| 194 | sprintf(temp, "~scr%dwidth~", scrnum); | |
| 195 | if (!strncmp(string, temp, strlen(temp))) | |
| 196 | { | |
| 197 | *outputptr += sprintf(*outputptr, "%d", device->visible_area().width()); | |
| 198 | return strlen(temp); | |
| 199 | } | |
| 200 | 200 | |
| 201 | // native height | |
| 202 | sprintf(temp, "~scr%dheight~", scrnum); | |
| 203 | if (!strncmp(string, temp, strlen(temp))) | |
| 204 | { | |
| 205 | *outputptr += sprintf(*outputptr, "%d", device->visible_area().height()); | |
| 206 | return strlen(temp); | |
| 207 | } | |
| 208 | } | |
| 201 | // native height | |
| 202 | sprintf(temp, "~scr%dheight~", scrnum); | |
| 203 | if (!strncmp(string, temp, strlen(temp))) | |
| 204 | { | |
| 205 | *outputptr += sprintf(*outputptr, "%d", device->visible_area().height()); | |
| 206 | return strlen(temp); | |
| 207 | } | |
| 208 | } | |
| 209 | 209 | |
| 210 | // default: copy the first character and continue | |
| 211 | **outputptr = *string; | |
| 212 | *outputptr += 1; | |
| 213 | return 1; | |
| 210 | // default: copy the first character and continue | |
| 211 | **outputptr = *string; | |
| 212 | *outputptr += 1; | |
| 213 | return 1; | |
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | |
| r242631 | r242632 | |
| 222 | 222 | |
| 223 | 223 | static const char *xml_get_attribute_string_with_subst(running_machine &machine, xml_data_node &node, const char *attribute, const char *defvalue) |
| 224 | 224 | { |
| 225 | const char *str = xml_get_attribute_string(&node, attribute, NULL); | |
| 226 | static char buffer[1000]; | |
| 225 | const char *str = xml_get_attribute_string(&node, attribute, NULL); | |
| 226 | static char buffer[1000]; | |
| 227 | 227 | |
| 228 | // if nothing, just return the default | |
| 229 | if (str == NULL) | |
| 230 | return defvalue; | |
| 228 | // if nothing, just return the default | |
| 229 | if (str == NULL) | |
| 230 | return defvalue; | |
| 231 | 231 | |
| 232 | // if no tildes, don't worry | |
| 233 | if (strchr(str, '~') == NULL) | |
| 234 | return str; | |
| 232 | // if no tildes, don't worry | |
| 233 | if (strchr(str, '~') == NULL) | |
| 234 | return str; | |
| 235 | 235 | |
| 236 | // make a copy of the string, doing substitutions along the way | |
| 237 | const char *s; | |
| 238 | char *d; | |
| 239 | for (s = str, d = buffer; *s != 0; ) | |
| 240 | { | |
| 241 | // if not a variable, just copy | |
| 242 | if (*s != '~') | |
| 243 | *d++ = *s++; | |
| 236 | // make a copy of the string, doing substitutions along the way | |
| 237 | const char *s; | |
| 238 | char *d; | |
| 239 | for (s = str, d = buffer; *s != 0; ) | |
| 240 | { | |
| 241 | // if not a variable, just copy | |
| 242 | if (*s != '~') | |
| 243 | *d++ = *s++; | |
| 244 | 244 | |
| 245 | // extract the variable | |
| 246 | else | |
| 247 | s += get_variable_value(machine, s, &d); | |
| 248 | } | |
| 249 | *d = 0; | |
| 250 | return buffer; | |
| 245 | // extract the variable | |
| 246 | else | |
| 247 | s += get_variable_value(machine, s, &d); | |
| 248 | } | |
| 249 | *d = 0; | |
| 250 | return buffer; | |
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | |
| r242631 | r242632 | |
| 259 | 259 | |
| 260 | 260 | static int xml_get_attribute_int_with_subst(running_machine &machine, xml_data_node &node, const char *attribute, int defvalue) |
| 261 | 261 | { |
| 262 | const char *string = xml_get_attribute_string_with_subst(machine, node, attribute, NULL); | |
| 263 | int value; | |
| 262 | const char *string = xml_get_attribute_string_with_subst(machine, node, attribute, NULL); | |
| 263 | int value; | |
| 264 | 264 | |
| 265 | if (string == NULL) | |
| 266 | return defvalue; | |
| 267 | if (string[0] == '$') | |
| 268 | return (sscanf(&string[1], "%X", &value) == 1) ? value : defvalue; | |
| 269 | if (string[0] == '0' && string[1] == 'x') | |
| 270 | return (sscanf(&string[2], "%X", &value) == 1) ? value : defvalue; | |
| 271 | if (string[0] == '#') | |
| 272 | return (sscanf(&string[1], "%d", &value) == 1) ? value : defvalue; | |
| 273 | return (sscanf(&string[0], "%d", &value) == 1) ? value : defvalue; | |
| 265 | if (string == NULL) | |
| 266 | return defvalue; | |
| 267 | if (string[0] == '$') | |
| 268 | return (sscanf(&string[1], "%X", &value) == 1) ? value : defvalue; | |
| 269 | if (string[0] == '0' && string[1] == 'x') | |
| 270 | return (sscanf(&string[2], "%X", &value) == 1) ? value : defvalue; | |
| 271 | if (string[0] == '#') | |
| 272 | return (sscanf(&string[1], "%d", &value) == 1) ? value : defvalue; | |
| 273 | return (sscanf(&string[0], "%d", &value) == 1) ? value : defvalue; | |
| 274 | 274 | } |
| 275 | 275 | |
| 276 | 276 | |
| r242631 | r242632 | |
| 282 | 282 | |
| 283 | 283 | static float xml_get_attribute_float_with_subst(running_machine &machine, xml_data_node &node, const char *attribute, float defvalue) |
| 284 | 284 | { |
| 285 | const char *string = xml_get_attribute_string_with_subst(machine, node, attribute, NULL); | |
| 286 | float value; | |
| 285 | const char *string = xml_get_attribute_string_with_subst(machine, node, attribute, NULL); | |
| 286 | float value; | |
| 287 | 287 | |
| 288 | if (string == NULL || sscanf(string, "%f", &value) != 1) | |
| 289 | return defvalue; | |
| 290 | return value; | |
| 288 | if (string == NULL || sscanf(string, "%f", &value) != 1) | |
| 289 | return defvalue; | |
| 290 | return value; | |
| 291 | 291 | } |
| 292 | 292 | |
| 293 | 293 | |
| r242631 | r242632 | |
| 297 | 297 | |
| 298 | 298 | void parse_bounds(running_machine &machine, xml_data_node *boundsnode, render_bounds &bounds) |
| 299 | 299 | { |
| 300 | // skip if nothing | |
| 301 | if (boundsnode == NULL) | |
| 302 | { | |
| 303 | bounds.x0 = bounds.y0 = 0.0f; | |
| 304 | bounds.x1 = bounds.y1 = 1.0f; | |
| 305 | return; | |
| 306 | } | |
| 300 | // skip if nothing | |
| 301 | if (boundsnode == NULL) | |
| 302 | { | |
| 303 | bounds.x0 = bounds.y0 = 0.0f; | |
| 304 | bounds.x1 = bounds.y1 = 1.0f; | |
| 305 | return; | |
| 306 | } | |
| 307 | 307 | |
| 308 | // parse out the data | |
| 309 | if (xml_get_attribute(boundsnode, "left") != NULL) | |
| 310 | { | |
| 311 | // left/right/top/bottom format | |
| 312 | bounds.x0 = xml_get_attribute_float_with_subst(machine, *boundsnode, "left", 0.0f); | |
| 313 | bounds.x1 = xml_get_attribute_float_with_subst(machine, *boundsnode, "right", 1.0f); | |
| 314 | bounds.y0 = xml_get_attribute_float_with_subst(machine, *boundsnode, "top", 0.0f); | |
| 315 | bounds.y1 = xml_get_attribute_float_with_subst(machine, *boundsnode, "bottom", 1.0f); | |
| 316 | } | |
| 317 | else if (xml_get_attribute(boundsnode, "x") != NULL) | |
| 318 | { | |
| 319 | // x/y/width/height format | |
| 320 | bounds.x0 = xml_get_attribute_float_with_subst(machine, *boundsnode, "x", 0.0f); | |
| 321 | bounds.x1 = bounds.x0 + xml_get_attribute_float_with_subst(machine, *boundsnode, "width", 1.0f); | |
| 322 | bounds.y0 = xml_get_attribute_float_with_subst(machine, *boundsnode, "y", 0.0f); | |
| 323 | bounds.y1 = bounds.y0 + xml_get_attribute_float_with_subst(machine, *boundsnode, "height", 1.0f); | |
| 324 | } | |
| 325 | else | |
| 326 | throw emu_fatalerror("Illegal bounds value in XML"); | |
| 308 | // parse out the data | |
| 309 | if (xml_get_attribute(boundsnode, "left") != NULL) | |
| 310 | { | |
| 311 | // left/right/top/bottom format | |
| 312 | bounds.x0 = xml_get_attribute_float_with_subst(machine, *boundsnode, "left", 0.0f); | |
| 313 | bounds.x1 = xml_get_attribute_float_with_subst(machine, *boundsnode, "right", 1.0f); | |
| 314 | bounds.y0 = xml_get_attribute_float_with_subst(machine, *boundsnode, "top", 0.0f); | |
| 315 | bounds.y1 = xml_get_attribute_float_with_subst(machine, *boundsnode, "bottom", 1.0f); | |
| 316 | } | |
| 317 | else if (xml_get_attribute(boundsnode, "x") != NULL) | |
| 318 | { | |
| 319 | // x/y/width/height format | |
| 320 | bounds.x0 = xml_get_attribute_float_with_subst(machine, *boundsnode, "x", 0.0f); | |
| 321 | bounds.x1 = bounds.x0 + xml_get_attribute_float_with_subst(machine, *boundsnode, "width", 1.0f); | |
| 322 | bounds.y0 = xml_get_attribute_float_with_subst(machine, *boundsnode, "y", 0.0f); | |
| 323 | bounds.y1 = bounds.y0 + xml_get_attribute_float_with_subst(machine, *boundsnode, "height", 1.0f); | |
| 324 | } | |
| 325 | else | |
| 326 | throw emu_fatalerror("Illegal bounds value in XML"); | |
| 327 | 327 | |
| 328 | // check for errors | |
| 329 | if (bounds.x0 > bounds.x1 || bounds.y0 > bounds.y1) | |
| 330 | throw emu_fatalerror("Illegal bounds value in XML: (%f-%f)-(%f-%f)", bounds.x0, bounds.x1, bounds.y0, bounds.y1); | |
| 328 | // check for errors | |
| 329 | if (bounds.x0 > bounds.x1 || bounds.y0 > bounds.y1) | |
| 330 | throw emu_fatalerror("Illegal bounds value in XML: (%f-%f)-(%f-%f)", bounds.x0, bounds.x1, bounds.y0, bounds.y1); | |
| 331 | 331 | } |
| 332 | 332 | |
| 333 | 333 | |
| r242631 | r242632 | |
| 337 | 337 | |
| 338 | 338 | void parse_color(running_machine &machine, xml_data_node *colornode, render_color &color) |
| 339 | 339 | { |
| 340 | // skip if nothing | |
| 341 | if (colornode == NULL) | |
| 342 | { | |
| 343 | color.r = color.g = color.b = color.a = 1.0f; | |
| 344 | return; | |
| 345 | } | |
| 340 | // skip if nothing | |
| 341 | if (colornode == NULL) | |
| 342 | { | |
| 343 | color.r = color.g = color.b = color.a = 1.0f; | |
| 344 | return; | |
| 345 | } | |
| 346 | 346 | |
| 347 | // parse out the data | |
| 348 | color.r = xml_get_attribute_float_with_subst(machine, *colornode, "red", 1.0); | |
| 349 | color.g = xml_get_attribute_float_with_subst(machine, *colornode, "green", 1.0); | |
| 350 | color.b = xml_get_attribute_float_with_subst(machine, *colornode, "blue", 1.0); | |
| 351 | color.a = xml_get_attribute_float_with_subst(machine, *colornode, "alpha", 1.0); | |
| 347 | // parse out the data | |
| 348 | color.r = xml_get_attribute_float_with_subst(machine, *colornode, "red", 1.0); | |
| 349 | color.g = xml_get_attribute_float_with_subst(machine, *colornode, "green", 1.0); | |
| 350 | color.b = xml_get_attribute_float_with_subst(machine, *colornode, "blue", 1.0); | |
| 351 | color.a = xml_get_attribute_float_with_subst(machine, *colornode, "alpha", 1.0); | |
| 352 | 352 | |
| 353 | // check for errors | |
| 354 | if (color.r < 0.0 || color.r > 1.0 || color.g < 0.0 || color.g > 1.0 || | |
| 355 | color.b < 0.0 || color.b > 1.0 || color.a < 0.0 || color.a > 1.0) | |
| 356 | throw emu_fatalerror("Illegal ARGB color value in XML: %f,%f,%f,%f", color.r, color.g, color.b, color.a); | |
| 353 | // check for errors | |
| 354 | if (color.r < 0.0 || color.r > 1.0 || color.g < 0.0 || color.g > 1.0 || | |
| 355 | color.b < 0.0 || color.b > 1.0 || color.a < 0.0 || color.a > 1.0) | |
| 356 | throw emu_fatalerror("Illegal ARGB color value in XML: %f,%f,%f,%f", color.r, color.g, color.b, color.a); | |
| 357 | 357 | } |
| 358 | 358 | |
| 359 | 359 | |
| r242631 | r242632 | |
| 364 | 364 | |
| 365 | 365 | static void parse_orientation(running_machine &machine, xml_data_node *orientnode, int &orientation) |
| 366 | 366 | { |
| 367 | // skip if nothing | |
| 368 | if (orientnode == NULL) | |
| 369 | { | |
| 370 | orientation = ROT0; | |
| 371 | return; | |
| 372 | } | |
| 367 | // skip if nothing | |
| 368 | if (orientnode == NULL) | |
| 369 | { | |
| 370 | orientation = ROT0; | |
| 371 | return; | |
| 372 | } | |
| 373 | 373 | |
| 374 | // parse out the data | |
| 375 | int rotate = xml_get_attribute_int_with_subst(machine, *orientnode, "rotate", 0); | |
| 376 | switch (rotate) | |
| 377 | { | |
| 378 | case 0: orientation = ROT0; break; | |
| 379 | case 90: orientation = ROT90; break; | |
| 380 | case 180: orientation = ROT180; break; | |
| 381 | case 270: orientation = ROT270; break; | |
| 382 | default: throw emu_fatalerror("Invalid rotation in XML orientation node: %d", rotate); | |
| 383 | } | |
| 384 | if (strcmp("yes", xml_get_attribute_string_with_subst(machine, *orientnode, "swapxy", "no")) == 0) | |
| 385 | orientation ^= ORIENTATION_SWAP_XY; | |
| 386 | if (strcmp("yes", xml_get_attribute_string_with_subst(machine, *orientnode, "flipx", "no")) == 0) | |
| 387 | orientation ^= ORIENTATION_FLIP_X; | |
| 388 | if (strcmp("yes", xml_get_attribute_string_with_subst(machine, *orientnode, "flipy", "no")) == 0) | |
| 389 | orientation ^= ORIENTATION_FLIP_Y; | |
| 374 | // parse out the data | |
| 375 | int rotate = xml_get_attribute_int_with_subst(machine, *orientnode, "rotate", 0); | |
| 376 | switch (rotate) | |
| 377 | { | |
| 378 | case 0: orientation = ROT0; break; | |
| 379 | case 90: orientation = ROT90; break; | |
| 380 | case 180: orientation = ROT180; break; | |
| 381 | case 270: orientation = ROT270; break; | |
| 382 | default: throw emu_fatalerror("Invalid rotation in XML orientation node: %d", rotate); | |
| 383 | } | |
| 384 | if (strcmp("yes", xml_get_attribute_string_with_subst(machine, *orientnode, "swapxy", "no")) == 0) | |
| 385 | orientation ^= ORIENTATION_SWAP_XY; | |
| 386 | if (strcmp("yes", xml_get_attribute_string_with_subst(machine, *orientnode, "flipx", "no")) == 0) | |
| 387 | orientation ^= ORIENTATION_FLIP_X; | |
| 388 | if (strcmp("yes", xml_get_attribute_string_with_subst(machine, *orientnode, "flipy", "no")) == 0) | |
| 389 | orientation ^= ORIENTATION_FLIP_Y; | |
| 390 | 390 | } |
| 391 | 391 | |
| 392 | 392 | |
| r242631 | r242632 | |
| 400 | 400 | //------------------------------------------------- |
| 401 | 401 | |
| 402 | 402 | layout_element::layout_element(running_machine &machine, xml_data_node &elemnode, const char *dirname) |
| 403 | : m_next(NULL), | |
| 404 | m_machine(machine), | |
| 405 | m_defstate(0), | |
| 406 | m_maxstate(0) | |
| 403 | : m_next(NULL), | |
| 404 | m_machine(machine), | |
| 405 | m_defstate(0), | |
| 406 | m_maxstate(0) | |
| 407 | 407 | { |
| 408 | // extract the name | |
| 409 | const char *name = xml_get_attribute_string_with_subst(machine, elemnode, "name", NULL); | |
| 410 | if (name == NULL) | |
| 411 | throw emu_fatalerror("All layout elements must have a name!\n"); | |
| 412 | m_name = name; | |
| 408 | // extract the name | |
| 409 | const char *name = xml_get_attribute_string_with_subst(machine, elemnode, "name", NULL); | |
| 410 | if (name == NULL) | |
| 411 | throw emu_fatalerror("All layout elements must have a name!\n"); | |
| 412 | m_name = name; | |
| 413 | 413 | |
| 414 | // get the default state | |
| 415 | m_defstate = xml_get_attribute_int_with_subst(machine, elemnode, "defstate", -1); | |
| 414 | // get the default state | |
| 415 | m_defstate = xml_get_attribute_int_with_subst(machine, elemnode, "defstate", -1); | |
| 416 | 416 | |
| 417 | // parse components in order | |
| 418 | bool first = true; | |
| 419 | render_bounds bounds = { 0 }; | |
| 420 | for (xml_data_node *compnode = elemnode.child; compnode != NULL; compnode = compnode->next) | |
| 421 | { | |
| 422 | // allocate a new component | |
| 423 | component &newcomp = m_complist.append(*global_alloc(component(machine, *compnode, dirname))); | |
| 417 | // parse components in order | |
| 418 | bool first = true; | |
| 419 | render_bounds bounds = { 0 }; | |
| 420 | for (xml_data_node *compnode = elemnode.child; compnode != NULL; compnode = compnode->next) | |
| 421 | { | |
| 422 | // allocate a new component | |
| 423 | component &newcomp = m_complist.append(*global_alloc(component(machine, *compnode, dirname))); | |
| 424 | 424 | |
| 425 | // accumulate bounds | |
| 426 | if (first) | |
| 427 | bounds = newcomp.m_bounds; | |
| 428 | else | |
| 429 | union_render_bounds(&bounds, &newcomp.m_bounds); | |
| 430 | first = false; | |
| 425 | // accumulate bounds | |
| 426 | if (first) | |
| 427 | bounds = newcomp.m_bounds; | |
| 428 | else | |
| 429 | union_render_bounds(&bounds, &newcomp.m_bounds); | |
| 430 | first = false; | |
| 431 | 431 | |
| 432 | // determine the maximum state | |
| 433 | if (newcomp.m_state > m_maxstate) | |
| 434 | m_maxstate = newcomp.m_state; | |
| 435 | if (newcomp.m_type == component::CTYPE_LED7SEG || newcomp.m_type == component::CTYPE_LED8SEG_GTS1) | |
| 436 | m_maxstate = 255; | |
| 437 | if (newcomp.m_type == component::CTYPE_LED14SEG) | |
| 438 | m_maxstate = 16383; | |
| 439 | if (newcomp.m_type == component::CTYPE_LED14SEGSC || newcomp.m_type == component::CTYPE_LED16SEG) | |
| 440 | m_maxstate = 65535; | |
| 441 | if (newcomp.m_type == component::CTYPE_LED16SEGSC) | |
| 442 | m_maxstate = 262143; | |
| 443 | if (newcomp.m_type == component::CTYPE_DOTMATRIX) | |
| 444 | m_maxstate = 255; | |
| 445 | if (newcomp.m_type == component::CTYPE_DOTMATRIX5DOT) | |
| 446 | m_maxstate = 31; | |
| 447 | if (newcomp.m_type == component::CTYPE_DOTMATRIXDOT) | |
| 448 | m_maxstate = 1; | |
| 449 | if (newcomp.m_type == component::CTYPE_SIMPLECOUNTER) | |
| 450 | m_maxstate = xml_get_attribute_int_with_subst(machine, *compnode, "maxstate", 999); | |
| 451 | if (newcomp.m_type == component::CTYPE_REEL) | |
| 452 | m_maxstate = 65536; | |
| 453 | } | |
| 432 | // determine the maximum state | |
| 433 | if (newcomp.m_state > m_maxstate) | |
| 434 | m_maxstate = newcomp.m_state; | |
| 435 | if (newcomp.m_type == component::CTYPE_LED7SEG || newcomp.m_type == component::CTYPE_LED8SEG_GTS1) | |
| 436 | m_maxstate = 255; | |
| 437 | if (newcomp.m_type == component::CTYPE_LED14SEG) | |
| 438 | m_maxstate = 16383; | |
| 439 | if (newcomp.m_type == component::CTYPE_LED14SEGSC || newcomp.m_type == component::CTYPE_LED16SEG) | |
| 440 | m_maxstate = 65535; | |
| 441 | if (newcomp.m_type == component::CTYPE_LED16SEGSC) | |
| 442 | m_maxstate = 262143; | |
| 443 | if (newcomp.m_type == component::CTYPE_DOTMATRIX) | |
| 444 | m_maxstate = 255; | |
| 445 | if (newcomp.m_type == component::CTYPE_DOTMATRIX5DOT) | |
| 446 | m_maxstate = 31; | |
| 447 | if (newcomp.m_type == component::CTYPE_DOTMATRIXDOT) | |
| 448 | m_maxstate = 1; | |
| 449 | if (newcomp.m_type == component::CTYPE_SIMPLECOUNTER) | |
| 450 | m_maxstate = xml_get_attribute_int_with_subst(machine, *compnode, "maxstate", 999); | |
| 451 | if (newcomp.m_type == component::CTYPE_REEL) | |
| 452 | m_maxstate = 65536; | |
| 453 | } | |
| 454 | 454 | |
| 455 | if (m_complist.first() != NULL) | |
| 456 | { | |
| 457 | // determine the scale/offset for normalization | |
| 458 | float xoffs = bounds.x0; | |
| 459 | float yoffs = bounds.y0; | |
| 460 | float xscale = 1.0f / (bounds.x1 - bounds.x0); | |
| 461 | float yscale = 1.0f / (bounds.y1 - bounds.y0); | |
| 455 | if (m_complist.first() != NULL) | |
| 456 | { | |
| 457 | // determine the scale/offset for normalization | |
| 458 | float xoffs = bounds.x0; | |
| 459 | float yoffs = bounds.y0; | |
| 460 | float xscale = 1.0f / (bounds.x1 - bounds.x0); | |
| 461 | float yscale = 1.0f / (bounds.y1 - bounds.y0); | |
| 462 | 462 | |
| 463 | // normalize all the component bounds | |
| 464 | for (component *curcomp = m_complist.first(); curcomp != NULL; curcomp = curcomp->next()) | |
| 465 | { | |
| 466 | curcomp->m_bounds.x0 = (curcomp->m_bounds.x0 - xoffs) * xscale; | |
| 467 | curcomp->m_bounds.x1 = (curcomp->m_bounds.x1 - xoffs) * xscale; | |
| 468 | curcomp->m_bounds.y0 = (curcomp->m_bounds.y0 - yoffs) * yscale; | |
| 469 | curcomp->m_bounds.y1 = (curcomp->m_bounds.y1 - yoffs) * yscale; | |
| 470 | } | |
| 471 | } | |
| 463 | // normalize all the component bounds | |
| 464 | for (component *curcomp = m_complist.first(); curcomp != NULL; curcomp = curcomp->next()) | |
| 465 | { | |
| 466 | curcomp->m_bounds.x0 = (curcomp->m_bounds.x0 - xoffs) * xscale; | |
| 467 | curcomp->m_bounds.x1 = (curcomp->m_bounds.x1 - xoffs) * xscale; | |
| 468 | curcomp->m_bounds.y0 = (curcomp->m_bounds.y0 - yoffs) * yscale; | |
| 469 | curcomp->m_bounds.y1 = (curcomp->m_bounds.y1 - yoffs) * yscale; | |
| 470 | } | |
| 471 | } | |
| 472 | 472 | |
| 473 | // allocate an array of element textures for the states | |
| 474 | m_elemtex.resize(m_maxstate + 1); | |
| 473 | // allocate an array of element textures for the states | |
| 474 | m_elemtex.resize(m_maxstate + 1); | |
| 475 | 475 | } |
| 476 | 476 | |
| 477 | 477 | |
| r242631 | r242632 | |
| 492 | 492 | |
| 493 | 493 | render_texture *layout_element::state_texture(int state) |
| 494 | 494 | { |
| 495 | assert(state <= m_maxstate); | |
| 496 | if (m_elemtex[state].m_texture == NULL) | |
| 497 | { | |
| 498 | m_elemtex[state].m_element = this; | |
| 499 | m_elemtex[state].m_state = state; | |
| 500 | m_elemtex[state].m_texture = machine().render().texture_alloc(element_scale, &m_elemtex[state]); | |
| 501 | } | |
| 502 | return m_elemtex[state].m_texture; | |
| 495 | assert(state <= m_maxstate); | |
| 496 | if (m_elemtex[state].m_texture == NULL) | |
| 497 | { | |
| 498 | m_elemtex[state].m_element = this; | |
| 499 | m_elemtex[state].m_state = state; | |
| 500 | m_elemtex[state].m_texture = machine().render().texture_alloc(element_scale, &m_elemtex[state]); | |
| 501 | } | |
| 502 | return m_elemtex[state].m_texture; | |
| 503 | 503 | } |
| 504 | 504 | |
| 505 | 505 | |
| r242631 | r242632 | |
| 511 | 511 | |
| 512 | 512 | void layout_element::element_scale(bitmap_argb32 &dest, bitmap_argb32 &source, const rectangle &sbounds, void *param) |
| 513 | 513 | { |
| 514 | ||
| 514 | texture *elemtex = (texture *)param; | |
| 515 | 515 | |
| 516 | // iterate over components that are part of the current state | |
| 517 | for (component *curcomp = elemtex->m_element->m_complist.first(); curcomp != NULL; curcomp = curcomp->next()) | |
| 518 | if (curcomp->m_state == -1 || curcomp->m_state == elemtex->m_state) | |
| 519 | { | |
| 520 | // get the local scaled bounds | |
| 521 | rectangle bounds; | |
| 522 | bounds.min_x = render_round_nearest(curcomp->bounds().x0 * dest.width()); | |
| 523 | bounds.min_y = render_round_nearest(curcomp->bounds().y0 * dest.height()); | |
| 524 | bounds.max_x = render_round_nearest(curcomp->bounds().x1 * dest.width()); | |
| 525 | bounds.max_y = render_round_nearest(curcomp->bounds().y1 * dest.height()); | |
| 526 | bounds &= dest.cliprect(); | |
| 516 | // iterate over components that are part of the current state | |
| 517 | for (component *curcomp = elemtex->m_element->m_complist.first(); curcomp != NULL; curcomp = curcomp->next()) | |
| 518 | if (curcomp->m_state == -1 || curcomp->m_state == elemtex->m_state) | |
| 519 | { | |
| 520 | // get the local scaled bounds | |
| 521 | rectangle bounds; | |
| 522 | bounds.min_x = render_round_nearest(curcomp->bounds().x0 * dest.width()); | |
| 523 | bounds.min_y = render_round_nearest(curcomp->bounds().y0 * dest.height()); | |
| 524 | bounds.max_x = render_round_nearest(curcomp->bounds().x1 * dest.width()); | |
| 525 | bounds.max_y = render_round_nearest(curcomp->bounds().y1 * dest.height()); | |
| 526 | bounds &= dest.cliprect(); | |
| 527 | 527 | |
| 528 | // based on the component type, add to the texture | |
| 529 | curcomp->draw(elemtex->m_element->machine(), dest, bounds, elemtex->m_state); | |
| 530 | } | |
| 528 | // based on the component type, add to the texture | |
| 529 | curcomp->draw(elemtex->m_element->machine(), dest, bounds, elemtex->m_state); | |
| 530 | } | |
| 531 | 531 | } |
| 532 | 532 | |
| 533 | 533 | |
| r242631 | r242632 | |
| 540 | 540 | //------------------------------------------------- |
| 541 | 541 | |
| 542 | 542 | layout_element::texture::texture() |
| 543 | : m_element(NULL), | |
| 544 | m_texture(NULL), | |
| 545 | m_state(0) | |
| 543 | : m_element(NULL), | |
| 544 | m_texture(NULL), | |
| 545 | m_state(0) | |
| 546 | 546 | { |
| 547 | 547 | } |
| 548 | 548 | |
| r242631 | r242632 | |
| 553 | 553 | |
| 554 | 554 | layout_element::texture::~texture() |
| 555 | 555 | { |
| 556 | if (m_element != NULL) | |
| 557 | m_element->machine().render().texture_free(m_texture); | |
| 556 | if (m_element != NULL) | |
| 557 | m_element->machine().render().texture_free(m_texture); | |
| 558 | 558 | } |
| 559 | 559 | |
| 560 | 560 | |
| r242631 | r242632 | |
| 568 | 568 | //------------------------------------------------- |
| 569 | 569 | |
| 570 | 570 | layout_element::component::component(running_machine &machine, xml_data_node &compnode, const char *dirname) |
| 571 | : m_next(NULL), | |
| 572 | m_type(CTYPE_INVALID), | |
| 573 | m_state(0) | |
| 571 | : m_next(NULL), | |
| 572 | m_type(CTYPE_INVALID), | |
| 573 | m_state(0) | |
| 574 | 574 | { |
| 575 | for (int i=0;i<MAX_BITMAPS;i++) | |
| 576 | m_hasalpha[i] = false; | |
| 575 | for (int i=0;i<MAX_BITMAPS;i++) | |
| 576 | m_hasalpha[i] = false; | |
| 577 | 577 | |
| 578 | // fetch common data | |
| 579 | m_state = xml_get_attribute_int_with_subst(machine, compnode, "state", -1); | |
| 580 | parse_bounds(machine, xml_get_sibling(compnode.child, "bounds"), m_bounds); | |
| 581 | parse_color(machine, xml_get_sibling(compnode.child, "color"), m_color); | |
| 578 | // fetch common data | |
| 579 | m_state = xml_get_attribute_int_with_subst(machine, compnode, "state", -1); | |
| 580 | parse_bounds(machine, xml_get_sibling(compnode.child, "bounds"), m_bounds); | |
| 581 | parse_color(machine, xml_get_sibling(compnode.child, "color"), m_color); | |
| 582 | 582 | |
| 583 | // image nodes | |
| 584 | if (strcmp(compnode.name, "image") == 0) | |
| 585 | { | |
| 586 | m_type = CTYPE_IMAGE; | |
| 587 | if (dirname != NULL) | |
| 588 | m_dirname = dirname; | |
| 589 | m_imagefile[0] = xml_get_attribute_string_with_subst(machine, compnode, "file", ""); | |
| 590 | m_alphafile[0] = xml_get_attribute_string_with_subst(machine, compnode, "alphafile", ""); | |
| 591 | m_file[0].reset(global_alloc(emu_file(machine.options().art_path(), OPEN_FLAG_READ))); | |
| 592 | } | |
| 583 | // image nodes | |
| 584 | if (strcmp(compnode.name, "image") == 0) | |
| 585 | { | |
| 586 | m_type = CTYPE_IMAGE; | |
| 587 | if (dirname != NULL) | |
| 588 | m_dirname = dirname; | |
| 589 | m_imagefile[0] = xml_get_attribute_string_with_subst(machine, compnode, "file", ""); | |
| 590 | m_alphafile[0] = xml_get_attribute_string_with_subst(machine, compnode, "alphafile", ""); | |
| 591 | m_file[0].reset(global_alloc(emu_file(machine.options().art_path(), OPEN_FLAG_READ))); | |
| 592 | } | |
| 593 | 593 | |
| 594 | // text nodes | |
| 595 | else if (strcmp(compnode.name, "text") == 0) | |
| 596 | { | |
| 597 | m_type = CTYPE_TEXT; | |
| 598 | m_string = xml_get_attribute_string_with_subst(machine, compnode, "string", ""); | |
| 599 | m_textalign = xml_get_attribute_int_with_subst(machine, compnode, "align", 0); | |
| 600 | } | |
| 594 | // text nodes | |
| 595 | else if (strcmp(compnode.name, "text") == 0) | |
| 596 | { | |
| 597 | m_type = CTYPE_TEXT; | |
| 598 | m_string = xml_get_attribute_string_with_subst(machine, compnode, "string", ""); | |
| 599 | m_textalign = xml_get_attribute_int_with_subst(machine, compnode, "align", 0); | |
| 600 | } | |
| 601 | 601 | |
| 602 | // dotmatrix nodes | |
| 603 | else if (strcmp(compnode.name, "dotmatrix") == 0) | |
| 604 | { | |
| 605 | m_type = CTYPE_DOTMATRIX; | |
| 606 | } | |
| 607 | else if (strcmp(compnode.name, "dotmatrix5dot") == 0) | |
| 608 | { | |
| 609 | m_type = CTYPE_DOTMATRIX5DOT; | |
| 610 | } | |
| 611 | else if (strcmp(compnode.name, "dotmatrixdot") == 0) | |
| 612 | { | |
| 613 | m_type = CTYPE_DOTMATRIXDOT; | |
| 614 | } | |
| 602 | // dotmatrix nodes | |
| 603 | else if (strcmp(compnode.name, "dotmatrix") == 0) | |
| 604 | { | |
| 605 | m_type = CTYPE_DOTMATRIX; | |
| 606 | } | |
| 607 | else if (strcmp(compnode.name, "dotmatrix5dot") == 0) | |
| 608 | { | |
| 609 | m_type = CTYPE_DOTMATRIX5DOT; | |
| 610 | } | |
| 611 | else if (strcmp(compnode.name, "dotmatrixdot") == 0) | |
| 612 | { | |
| 613 | m_type = CTYPE_DOTMATRIXDOT; | |
| 614 | } | |
| 615 | 615 | |
| 616 | // simplecounter nodes | |
| 617 | else if (strcmp(compnode.name, "simplecounter") == 0) | |
| 618 | { | |
| 619 | m_type = CTYPE_SIMPLECOUNTER; | |
| 620 | m_digits = xml_get_attribute_int_with_subst(machine, compnode, "digits", 2); | |
| 621 | m_textalign = xml_get_attribute_int_with_subst(machine, compnode, "align", 0); | |
| 622 | } | |
| 616 | // simplecounter nodes | |
| 617 | else if (strcmp(compnode.name, "simplecounter") == 0) | |
| 618 | { | |
| 619 | m_type = CTYPE_SIMPLECOUNTER; | |
| 620 | m_digits = xml_get_attribute_int_with_subst(machine, compnode, "digits", 2); | |
| 621 | m_textalign = xml_get_attribute_int_with_subst(machine, compnode, "align", 0); | |
| 622 | } | |
| 623 | 623 | |
| 624 | // fruit machine reels | |
| 625 | else if (strcmp(compnode.name, "reel") == 0) | |
| 626 | { | |
| 627 | m_type = CTYPE_REEL; | |
| 624 | // fruit machine reels | |
| 625 | else if (strcmp(compnode.name, "reel") == 0) | |
| 626 | { | |
| 627 | m_type = CTYPE_REEL; | |
| 628 | 628 | |
| 629 | ||
| 629 | astring symbollist = xml_get_attribute_string_with_subst(machine, compnode, "symbollist", "0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15"); | |
| 630 | 630 | |
| 631 | // split out position names from string and figure out our number of symbols | |
| 632 | int location = -1; | |
| 633 | m_numstops = 0; | |
| 634 | location=symbollist.find(0,","); | |
| 635 | while (location!=-1) | |
| 636 | { | |
| 637 | m_stopnames[m_numstops] = symbollist; | |
| 638 | m_stopnames[m_numstops].substr(0, location); | |
| 639 | symbollist.substr(location+1, symbollist.len()-(location-1)); | |
| 640 | m_numstops++; | |
| 641 | location=symbollist.find(0,","); | |
| 642 | } | |
| 643 | m_stopnames[m_numstops++] = symbollist; | |
| 631 | // split out position names from string and figure out our number of symbols | |
| 632 | int location = -1; | |
| 633 | m_numstops = 0; | |
| 634 | location=symbollist.find(0,","); | |
| 635 | while (location!=-1) | |
| 636 | { | |
| 637 | m_stopnames[m_numstops] = symbollist; | |
| 638 | m_stopnames[m_numstops].substr(0, location); | |
| 639 | symbollist.substr(location+1, symbollist.len()-(location-1)); | |
| 640 | m_numstops++; | |
| 641 | location=symbollist.find(0,","); | |
| 642 | } | |
| 643 | m_stopnames[m_numstops++] = symbollist; | |
| 644 | 644 | |
| 645 | // careful, dirname is NULL if we're coming from internal layout, and our string assignment doesn't like that | |
| 646 | if (dirname != NULL) | |
| 647 | m_dirname = dirname; | |
| 645 | // careful, dirname is NULL if we're coming from internal layout, and our string assignment doesn't like that | |
| 646 | if (dirname != NULL) | |
| 647 | m_dirname = dirname; | |
| 648 | 648 | |
| 649 | for (int i=0;i<m_numstops;i++) | |
| 650 | { | |
| 651 | location=m_stopnames[i].find(0,":"); | |
| 652 | if (location!=-1) | |
| 653 | { | |
| 654 | m_imagefile[i] = m_stopnames[i]; | |
| 655 | m_stopnames[i].substr(0, location); | |
| 656 | m_imagefile[i].substr(location+1, m_imagefile[i].len()-(location-1)); | |
| 649 | for (int i=0;i<m_numstops;i++) | |
| 650 | { | |
| 651 | location=m_stopnames[i].find(0,":"); | |
| 652 | if (location!=-1) | |
| 653 | { | |
| 654 | m_imagefile[i] = m_stopnames[i]; | |
| 655 | m_stopnames[i].substr(0, location); | |
| 656 | m_imagefile[i].substr(location+1, m_imagefile[i].len()-(location-1)); | |
| 657 | 657 | |
| 658 | //m_alphafile[i] = | |
| 659 | m_file[i].reset(global_alloc(emu_file(machine.options().art_path(), OPEN_FLAG_READ))); | |
| 660 | } | |
| 661 | else | |
| 662 | { | |
| 663 | //m_imagefile[i] = 0; | |
| 664 | //m_alphafile[i] = 0; | |
| 665 | m_file[i].reset(); | |
| 666 | } | |
| 667 | } | |
| 658 | //m_alphafile[i] = | |
| 659 | m_file[i].reset(global_alloc(emu_file(machine.options().art_path(), OPEN_FLAG_READ))); | |
| 660 | } | |
| 661 | else | |
| 662 | { | |
| 663 | //m_imagefile[i] = 0; | |
| 664 | //m_alphafile[i] = 0; | |
| 665 | m_file[i].reset(); | |
| 666 | } | |
| 667 | } | |
| 668 | 668 | |
| 669 | m_stateoffset = xml_get_attribute_int_with_subst(machine, compnode, "stateoffset", 0); | |
| 670 | m_numsymbolsvisible = xml_get_attribute_int_with_subst(machine, compnode, "numsymbolsvisible", 3); | |
| 671 | m_reelreversed = xml_get_attribute_int_with_subst(machine, compnode, "reelreversed", 0); | |
| 672 | m_beltreel = xml_get_attribute_int_with_subst(machine, compnode, "beltreel", 0); | |
| 669 | m_stateoffset = xml_get_attribute_int_with_subst(machine, compnode, "stateoffset", 0); | |
| 670 | m_numsymbolsvisible = xml_get_attribute_int_with_subst(machine, compnode, "numsymbolsvisible", 3); | |
| 671 | m_reelreversed = xml_get_attribute_int_with_subst(machine, compnode, "reelreversed", 0); | |
| 672 | m_beltreel = xml_get_attribute_int_with_subst(machine, compnode, "beltreel", 0); | |
| 673 | 673 | |
| 674 | ||
| 674 | } | |
| 675 | 675 | |
| 676 | // led7seg nodes | |
| 677 | else if (strcmp(compnode.name, "led7seg") == 0) | |
| 678 | m_type = CTYPE_LED7SEG; | |
| 676 | // led7seg nodes | |
| 677 | else if (strcmp(compnode.name, "led7seg") == 0) | |
| 678 | m_type = CTYPE_LED7SEG; | |
| 679 | 679 | |
| 680 | // led8seg_gts1 nodes | |
| 681 | else if (strcmp(compnode.name, "led8seg_gts1") == 0) | |
| 682 | m_type = CTYPE_LED8SEG_GTS1; | |
| 680 | // led8seg_gts1 nodes | |
| 681 | else if (strcmp(compnode.name, "led8seg_gts1") == 0) | |
| 682 | m_type = CTYPE_LED8SEG_GTS1; | |
| 683 | 683 | |
| 684 | // led14seg nodes | |
| 685 | else if (strcmp(compnode.name, "led14seg") == 0) | |
| 686 | m_type = CTYPE_LED14SEG; | |
| 684 | // led14seg nodes | |
| 685 | else if (strcmp(compnode.name, "led14seg") == 0) | |
| 686 | m_type = CTYPE_LED14SEG; | |
| 687 | 687 | |
| 688 | // led14segsc nodes | |
| 689 | else if (strcmp(compnode.name, "led14segsc") == 0) | |
| 690 | m_type = CTYPE_LED14SEGSC; | |
| 688 | // led14segsc nodes | |
| 689 | else if (strcmp(compnode.name, "led14segsc") == 0) | |
| 690 | m_type = CTYPE_LED14SEGSC; | |
| 691 | 691 | |
| 692 | // led16seg nodes | |
| 693 | else if (strcmp(compnode.name, "led16seg") == 0) | |
| 694 | m_type = CTYPE_LED16SEG; | |
| 692 | // led16seg nodes | |
| 693 | else if (strcmp(compnode.name, "led16seg") == 0) | |
| 694 | m_type = CTYPE_LED16SEG; | |
| 695 | 695 | |
| 696 | // led16segsc nodes | |
| 697 | else if (strcmp(compnode.name, "led16segsc") == 0) | |
| 698 | m_type = CTYPE_LED16SEGSC; | |
| 696 | // led16segsc nodes | |
| 697 | else if (strcmp(compnode.name, "led16segsc") == 0) | |
| 698 | m_type = CTYPE_LED16SEGSC; | |
| 699 | 699 | |
| 700 | // rect nodes | |
| 701 | else if (strcmp(compnode.name, "rect") == 0) | |
| 702 | m_type = CTYPE_RECT; | |
| 700 | // rect nodes | |
| 701 | else if (strcmp(compnode.name, "rect") == 0) | |
| 702 | m_type = CTYPE_RECT; | |
| 703 | 703 | |
| 704 | // disk nodes | |
| 705 | else if (strcmp(compnode.name, "disk") == 0) | |
| 706 | m_type = CTYPE_DISK; | |
| 704 | // disk nodes | |
| 705 | else if (strcmp(compnode.name, "disk") == 0) | |
| 706 | m_type = CTYPE_DISK; | |
| 707 | 707 | |
| 708 | // error otherwise | |
| 709 | else | |
| 710 | throw emu_fatalerror("Unknown element component: %s", compnode.name); | |
| 708 | // error otherwise | |
| 709 | else | |
| 710 | throw emu_fatalerror("Unknown element component: %s", compnode.name); | |
| 711 | 711 | } |
| 712 | 712 | |
| 713 | 713 | |
| r242631 | r242632 | |
| 726 | 726 | |
| 727 | 727 | void layout_element::component::draw(running_machine &machine, bitmap_argb32 &dest, const rectangle &bounds, int state) |
| 728 | 728 | { |
| 729 | switch (m_type) | |
| 730 | { | |
| 731 | case CTYPE_IMAGE: | |
| 732 | if (!m_bitmap[0].valid()) | |
| 733 | load_bitmap(); | |
| 734 | { | |
| 735 | bitmap_argb32 destsub(dest, bounds); | |
| 736 | render_resample_argb_bitmap_hq(destsub, m_bitmap[0], m_color); | |
| 737 | } | |
| 738 | break; | |
| 729 | switch (m_type) | |
| 730 | { | |
| 731 | case CTYPE_IMAGE: | |
| 732 | if (!m_bitmap[0].valid()) | |
| 733 | load_bitmap(); | |
| 734 | { | |
| 735 | bitmap_argb32 destsub(dest, bounds); | |
| 736 | render_resample_argb_bitmap_hq(destsub, m_bitmap[0], m_color); | |
| 737 | } | |
| 738 | break; | |
| 739 | 739 | |
| 740 | case CTYPE_RECT: | |
| 741 | draw_rect(dest, bounds); | |
| 742 | break; | |
| 740 | case CTYPE_RECT: | |
| 741 | draw_rect(dest, bounds); | |
| 742 | break; | |
| 743 | 743 | |
| 744 | case CTYPE_DISK: | |
| 745 | draw_disk(dest, bounds); | |
| 746 | break; | |
| 744 | case CTYPE_DISK: | |
| 745 | draw_disk(dest, bounds); | |
| 746 | break; | |
| 747 | 747 | |
| 748 | case CTYPE_TEXT: | |
| 749 | draw_text(machine, dest, bounds); | |
| 750 | break; | |
| 748 | case CTYPE_TEXT: | |
| 749 | draw_text(machine, dest, bounds); | |
| 750 | break; | |
| 751 | 751 | |
| 752 | case CTYPE_LED7SEG: | |
| 753 | draw_led7seg(dest, bounds, state); | |
| 754 | break; | |
| 752 | case CTYPE_LED7SEG: | |
| 753 | draw_led7seg(dest, bounds, state); | |
| 754 | break; | |
| 755 | 755 | |
| 756 | case CTYPE_LED8SEG_GTS1: | |
| 757 | draw_led8seg_gts1(dest, bounds, state); | |
| 758 | break; | |
| 756 | case CTYPE_LED8SEG_GTS1: | |
| 757 | draw_led8seg_gts1(dest, bounds, state); | |
| 758 | break; | |
| 759 | 759 | |
| 760 | case CTYPE_LED14SEG: | |
| 761 | draw_led14seg(dest, bounds, state); | |
| 762 | break; | |
| 760 | case CTYPE_LED14SEG: | |
| 761 | draw_led14seg(dest, bounds, state); | |
| 762 | break; | |
| 763 | 763 | |
| 764 | case CTYPE_LED16SEG: | |
| 765 | draw_led16seg(dest, bounds, state); | |
| 766 | break; | |
| 764 | case CTYPE_LED16SEG: | |
| 765 | draw_led16seg(dest, bounds, state); | |
| 766 | break; | |
| 767 | 767 | |
| 768 | case CTYPE_LED14SEGSC: | |
| 769 | draw_led14segsc(dest, bounds, state); | |
| 770 | break; | |
| 768 | case CTYPE_LED14SEGSC: | |
| 769 | draw_led14segsc(dest, bounds, state); | |
| 770 | break; | |
| 771 | 771 | |
| 772 | case CTYPE_LED16SEGSC: | |
| 773 | draw_led16segsc(dest, bounds, state); | |
| 774 | break; | |
| 772 | case CTYPE_LED16SEGSC: | |
| 773 | draw_led16segsc(dest, bounds, state); | |
| 774 | break; | |
| 775 | 775 | |
| 776 | case CTYPE_DOTMATRIX: | |
| 777 | draw_dotmatrix(8, dest, bounds, state); | |
| 778 | break; | |
| 776 | case CTYPE_DOTMATRIX: | |
| 777 | draw_dotmatrix(8, dest, bounds, state); | |
| 778 | break; | |
| 779 | 779 | |
| 780 | case CTYPE_DOTMATRIX5DOT: | |
| 781 | draw_dotmatrix(5, dest, bounds, state); | |
| 782 | break; | |
| 780 | case CTYPE_DOTMATRIX5DOT: | |
| 781 | draw_dotmatrix(5, dest, bounds, state); | |
| 782 | break; | |
| 783 | 783 | |
| 784 | case CTYPE_DOTMATRIXDOT: | |
| 785 | draw_dotmatrix(1, dest, bounds, state); | |
| 786 | break; | |
| 784 | case CTYPE_DOTMATRIXDOT: | |
| 785 | draw_dotmatrix(1, dest, bounds, state); | |
| 786 | break; | |
| 787 | 787 | |
| 788 | case CTYPE_SIMPLECOUNTER: | |
| 789 | draw_simplecounter(machine, dest, bounds, state); | |
| 790 | break; | |
| 788 | case CTYPE_SIMPLECOUNTER: | |
| 789 | draw_simplecounter(machine, dest, bounds, state); | |
| 790 | break; | |
| 791 | 791 | |
| 792 | case CTYPE_REEL: | |
| 793 | draw_reel(machine, dest, bounds, state); | |
| 794 | break; | |
| 792 | case CTYPE_REEL: | |
| 793 | draw_reel(machine, dest, bounds, state); | |
| 794 | break; | |
| 795 | 795 | |
| 796 | default: | |
| 797 | throw emu_fatalerror("Unknown component type requested draw()"); | |
| 798 | } | |
| 796 | default: | |
| 797 | throw emu_fatalerror("Unknown component type requested draw()"); | |
| 798 | } | |
| 799 | 799 | } |
| 800 | 800 | |
| 801 | 801 | |
| r242631 | r242632 | |
| 806 | 806 | |
| 807 | 807 | void layout_element::component::draw_rect(bitmap_argb32 &dest, const rectangle &bounds) |
| 808 | 808 | { |
| 809 | // compute premultiplied colors | |
| 810 | UINT32 r = m_color.r * m_color.a * 255.0; | |
| 811 | UINT32 g = m_color.g * m_color.a * 255.0; | |
| 812 | UINT32 b = m_color.b * m_color.a * 255.0; | |
| 813 | UINT32 inva = (1.0f - m_color.a) * 255.0; | |
| 809 | // compute premultiplied colors | |
| 810 | UINT32 r = m_color.r * m_color.a * 255.0; | |
| 811 | UINT32 g = m_color.g * m_color.a * 255.0; | |
| 812 | UINT32 b = m_color.b * m_color.a * 255.0; | |
| 813 | UINT32 inva = (1.0f - m_color.a) * 255.0; | |
| 814 | 814 | |
| 815 | // iterate over X and Y | |
| 816 | for (UINT32 y = bounds.min_y; y <= bounds.max_y; y++) | |
| 817 | { | |
| 818 | for (UINT32 x = bounds.min_x; x <= bounds.max_x; x++) | |
| 819 | { | |
| 820 | UINT32 finalr = r; | |
| 821 | UINT32 finalg = g; | |
| 822 | UINT32 finalb = b; | |
| 815 | // iterate over X and Y | |
| 816 | for (UINT32 y = bounds.min_y; y <= bounds.max_y; y++) | |
| 817 | { | |
| 818 | for (UINT32 x = bounds.min_x; x <= bounds.max_x; x++) | |
| 819 | { | |
| 820 | UINT32 finalr = r; | |
| 821 | UINT32 finalg = g; | |
| 822 | UINT32 finalb = b; | |
| 823 | 823 | |
| 824 | // if we're translucent, add in the destination pixel contribution | |
| 825 | if (inva > 0) | |
| 826 | { | |
| 827 | rgb_t dpix = dest.pix32(y, x); | |
| 828 | finalr += (dpix.r() * inva) >> 8; | |
| 829 | finalg += (dpix.g() * inva) >> 8; | |
| 830 | finalb += (dpix.b() * inva) >> 8; | |
| 831 | } | |
| 824 | // if we're translucent, add in the destination pixel contribution | |
| 825 | if (inva > 0) | |
| 826 | { | |
| 827 | rgb_t dpix = dest.pix32(y, x); | |
| 828 | finalr += (dpix.r() * inva) >> 8; | |
| 829 | finalg += (dpix.g() * inva) >> 8; | |
| 830 | finalb += (dpix.b() * inva) >> 8; | |
| 831 | } | |
| 832 | 832 | |
| 833 | // store the target pixel, dividing the RGBA values by the overall scale factor | |
| 834 | dest.pix32(y, x) = rgb_t(finalr, finalg, finalb); | |
| 835 | } | |
| 836 | } | |
| 833 | // store the target pixel, dividing the RGBA values by the overall scale factor | |
| 834 | dest.pix32(y, x) = rgb_t(finalr, finalg, finalb); | |
| 835 | } | |
| 836 | } | |
| 837 | 837 | } |
| 838 | 838 | |
| 839 | 839 | |
| r242631 | r242632 | |
| 844 | 844 | |
| 845 | 845 | void layout_element::component::draw_disk(bitmap_argb32 &dest, const rectangle &bounds) |
| 846 | 846 | { |
| 847 | // compute premultiplied colors | |
| 848 | UINT32 r = m_color.r * m_color.a * 255.0; | |
| 849 | UINT32 g = m_color.g * m_color.a * 255.0; | |
| 850 | UINT32 b = m_color.b * m_color.a * 255.0; | |
| 851 | UINT32 inva = (1.0f - m_color.a) * 255.0; | |
| 847 | // compute premultiplied colors | |
| 848 | UINT32 r = m_color.r * m_color.a * 255.0; | |
| 849 | UINT32 g = m_color.g * m_color.a * 255.0; | |
| 850 | UINT32 b = m_color.b * m_color.a * 255.0; | |
| 851 | UINT32 inva = (1.0f - m_color.a) * 255.0; | |
| 852 | 852 | |
| 853 | // find the center | |
| 854 | float xcenter = float(bounds.xcenter()); | |
| 855 | float ycenter = float(bounds.ycenter()); | |
| 856 | float xradius = float(bounds.width()) * 0.5f; | |
| 857 | float yradius = float(bounds.height()) * 0.5f; | |
| 858 | float ooyradius2 = 1.0f / (yradius * yradius); | |
| 853 | // find the center | |
| 854 | float xcenter = float(bounds.xcenter()); | |
| 855 | float ycenter = float(bounds.ycenter()); | |
| 856 | float xradius = float(bounds.width()) * 0.5f; | |
| 857 | float yradius = float(bounds.height()) * 0.5f; | |
| 858 | float ooyradius2 = 1.0f / (yradius * yradius); | |
| 859 | 859 | |
| 860 | // iterate over y | |
| 861 | for (UINT32 y = bounds.min_y; y <= bounds.max_y; y++) | |
| 862 | { | |
| 863 | float ycoord = ycenter - ((float)y + 0.5f); | |
| 864 | float xval = xradius * sqrt(1.0f - (ycoord * ycoord) * ooyradius2); | |
| 860 | // iterate over y | |
| 861 | for (UINT32 y = bounds.min_y; y <= bounds.max_y; y++) | |
| 862 | { | |
| 863 | float ycoord = ycenter - ((float)y + 0.5f); | |
| 864 | float xval = xradius * sqrt(1.0f - (ycoord * ycoord) * ooyradius2); | |
| 865 | 865 | |
| 866 | // compute left/right coordinates | |
| 867 | INT32 left = (INT32)(xcenter - xval + 0.5f); | |
| 868 | INT32 right = (INT32)(xcenter + xval + 0.5f); | |
| 866 | // compute left/right coordinates | |
| 867 | INT32 left = (INT32)(xcenter - xval + 0.5f); | |
| 868 | INT32 right = (INT32)(xcenter + xval + 0.5f); | |
| 869 | 869 | |
| 870 | // draw this scanline | |
| 871 | for (UINT32 x = left; x < right; x++) | |
| 872 | { | |
| 873 | UINT32 finalr = r; | |
| 874 | UINT32 finalg = g; | |
| 875 | UINT32 finalb = b; | |
| 870 | // draw this scanline | |
| 871 | for (UINT32 x = left; x < right; x++) | |
| 872 | { | |
| 873 | UINT32 finalr = r; | |
| 874 | UINT32 finalg = g; | |
| 875 | UINT32 finalb = b; | |
| 876 | 876 | |
| 877 | // if we're translucent, add in the destination pixel contribution | |
| 878 | if (inva > 0) | |
| 879 | { | |
| 880 | rgb_t dpix = dest.pix32(y, x); | |
| 881 | finalr += (dpix.r() * inva) >> 8; | |
| 882 | finalg += (dpix.g() * inva) >> 8; | |
| 883 | finalb += (dpix.b() * inva) >> 8; | |
| 884 | } | |
| 877 | // if we're translucent, add in the destination pixel contribution | |
| 878 | if (inva > 0) | |
| 879 | { | |
| 880 | rgb_t dpix = dest.pix32(y, x); | |
| 881 | finalr += (dpix.r() * inva) >> 8; | |
| 882 | finalg += (dpix.g() * inva) >> 8; | |
| 883 | finalb += (dpix.b() * inva) >> 8; | |
| 884 | } | |
| 885 | 885 | |
| 886 | // store the target pixel, dividing the RGBA values by the overall scale factor | |
| 887 | dest.pix32(y, x) = rgb_t(finalr, finalg, finalb); | |
| 888 | } | |
| 889 | } | |
| 886 | // store the target pixel, dividing the RGBA values by the overall scale factor | |
| 887 | dest.pix32(y, x) = rgb_t(finalr, finalg, finalb); | |
| 888 | } | |
| 889 | } | |
| 890 | 890 | } |
| 891 | 891 | |
| 892 | 892 | |
| r242631 | r242632 | |
| 896 | 896 | |
| 897 | 897 | void layout_element::component::draw_text(running_machine &machine, bitmap_argb32 &dest, const rectangle &bounds) |
| 898 | 898 | { |
| 899 | // compute premultiplied colors | |
| 900 | UINT32 r = m_color.r * 255.0; | |
| 901 | UINT32 g = m_color.g * 255.0; | |
| 902 | UINT32 b = m_color.b * 255.0; | |
| 903 | UINT32 a = m_color.a * 255.0; | |
| 899 | // compute premultiplied colors | |
| 900 | UINT32 r = m_color.r * 255.0; | |
| 901 | UINT32 g = m_color.g * 255.0; | |
| 902 | UINT32 b = m_color.b * 255.0; | |
| 903 | UINT32 a = m_color.a * 255.0; | |
| 904 | 904 | |
| 905 | // get the width of the string | |
| 906 | render_font *font = machine.render().font_alloc("default"); | |
| 907 | float aspect = 1.0f; | |
| 908 | INT32 width; | |
| 905 | // get the width of the string | |
| 906 | render_font *font = machine.render().font_alloc("default"); | |
| 907 | float aspect = 1.0f; | |
| 908 | INT32 width; | |
| 909 | 909 | |
| 910 | 910 | |
| 911 | while (1) | |
| 912 | { | |
| 913 | width = font->string_width(bounds.height(), aspect, m_string); | |
| 914 | if (width < bounds.width()) | |
| 915 | break; | |
| 916 | aspect *= 0.9f; | |
| 917 | } | |
| 911 | while (1) | |
| 912 | { | |
| 913 | width = font->string_width(bounds.height(), aspect, m_string); | |
| 914 | if (width < bounds.width()) | |
| 915 | break; | |
| 916 | aspect *= 0.9f; | |
| 917 | } | |
| 918 | 918 | |
| 919 | 919 | |
| 920 | // get alignment | |
| 921 | INT32 curx; | |
| 922 | switch (m_textalign) | |
| 923 | { | |
| 924 | // left | |
| 925 | case 1: | |
| 926 | curx = bounds.min_x; | |
| 927 | break; | |
| 920 | // get alignment | |
| 921 | INT32 curx; | |
| 922 | switch (m_textalign) | |
| 923 | { | |
| 924 | // left | |
| 925 | case 1: | |
| 926 | curx = bounds.min_x; | |
| 927 | break; | |
| 928 | 928 | |
| 929 | // right | |
| 930 | case 2: | |
| 931 | curx = bounds.max_x - width; | |
| 932 | break; | |
| 929 | // right | |
| 930 | case 2: | |
| 931 | curx = bounds.max_x - width; | |
| 932 | break; | |
| 933 | 933 | |
| 934 | // default to center | |
| 935 | default: | |
| 936 | curx = bounds.min_x + (bounds.width() - width) / 2; | |
| 937 | break; | |
| 938 | } | |
| 934 | // default to center | |
| 935 | default: | |
| 936 | curx = bounds.min_x + (bounds.width() - width) / 2; | |
| 937 | break; | |
| 938 | } | |
| 939 | 939 | |
| 940 | // allocate a temporary bitmap | |
| 941 | bitmap_argb32 tempbitmap(dest.width(), dest.height()); | |
| 940 | // allocate a temporary bitmap | |
| 941 | bitmap_argb32 tempbitmap(dest.width(), dest.height()); | |
| 942 | 942 | |
| 943 | // loop over characters | |
| 944 | for (const char *s = m_string; *s != 0; s++) | |
| 945 | { | |
| 946 | // get the font bitmap | |
| 947 | rectangle chbounds; | |
| 948 | font->get_scaled_bitmap_and_bounds(tempbitmap, bounds.height(), aspect, *s, chbounds); | |
| 943 | // loop over characters | |
| 944 | for (const char *s = m_string; *s != 0; s++) | |
| 945 | { | |
| 946 | // get the font bitmap | |
| 947 | rectangle chbounds; | |
| 948 | font->get_scaled_bitmap_and_bounds(tempbitmap, bounds.height(), aspect, *s, chbounds); | |
| 949 | 949 | |
| 950 | // copy the data into the target | |
| 951 | for (int y = 0; y < chbounds.height(); y++) | |
| 952 | { | |
| 953 | int effy = bounds.min_y + y; | |
| 954 | if (effy >= bounds.min_y && effy <= bounds.max_y) | |
| 955 | { | |
| 956 | UINT32 *src = &tempbitmap.pix32(y); | |
| 957 | UINT32 *d = &dest.pix32(effy); | |
| 958 | for (int x = 0; x < chbounds.width(); x++) | |
| 959 | { | |
| 960 | int effx = curx + x + chbounds.min_x; | |
| 961 | if (effx >= bounds.min_x && effx <= bounds.max_x) | |
| 962 | { | |
| 963 | UINT32 spix = rgb_t(src[x]).a(); | |
| 964 | if (spix != 0) | |
| 965 | { | |
| 966 | rgb_t dpix = d[effx]; | |
| 967 | UINT32 ta = (a * (spix + 1)) >> 8; | |
| 968 | UINT32 tr = (r * ta + dpix.r() * (0x100 - ta)) >> 8; | |
| 969 | UINT32 tg = (g * ta + dpix.g() * (0x100 - ta)) >> 8; | |
| 970 | UINT32 tb = (b * ta + dpix.b() * (0x100 - ta)) >> 8; | |
| 971 | d[effx] = rgb_t(tr, tg, tb); | |
| 972 | } | |
| 973 | } | |
| 974 | } | |
| 975 | } | |
| 976 | } | |
| 950 | // copy the data into the target | |
| 951 | for (int y = 0; y < chbounds.height(); y++) | |
| 952 | { | |
| 953 | int effy = bounds.min_y + y; | |
| 954 | if (effy >= bounds.min_y && effy <= bounds.max_y) | |
| 955 | { | |
| 956 | UINT32 *src = &tempbitmap.pix32(y); | |
| 957 | UINT32 *d = &dest.pix32(effy); | |
| 958 | for (int x = 0; x < chbounds.width(); x++) | |
| 959 | { | |
| 960 | int effx = curx + x + chbounds.min_x; | |
| 961 | if (effx >= bounds.min_x && effx <= bounds.max_x) | |
| 962 | { | |
| 963 | UINT32 spix = rgb_t(src[x]).a(); | |
| 964 | if (spix != 0) | |
| 965 | { | |
| 966 | rgb_t dpix = d[effx]; | |
| 967 | UINT32 ta = (a * (spix + 1)) >> 8; | |
| 968 | UINT32 tr = (r * ta + dpix.r() * (0x100 - ta)) >> 8; | |
| 969 | UINT32 tg = (g * ta + dpix.g() * (0x100 - ta)) >> 8; | |
| 970 | UINT32 tb = (b * ta + dpix.b() * (0x100 - ta)) >> 8; | |
| 971 | d[effx] = rgb_t(tr, tg, tb); | |
| 972 | } | |
| 973 | } | |
| 974 | } | |
| 975 | } | |
| 976 | } | |
| 977 | 977 | |
| 978 | // advance in the X direction | |
| 979 | curx += font->char_width(bounds.height(), aspect, *s); | |
| 980 | } | |
| 978 | // advance in the X direction | |
| 979 | curx += font->char_width(bounds.height(), aspect, *s); | |
| 980 | } | |
| 981 | 981 | |
| 982 | // free the temporary bitmap and font | |
| 983 | machine.render().font_free(font); | |
| 982 | // free the temporary bitmap and font | |
| 983 | machine.render().font_free(font); | |
| 984 | 984 | } |
| 985 | 985 | |
| 986 | 986 | void layout_element::component::draw_simplecounter(running_machine &machine, bitmap_argb32 &dest, const rectangle &bounds, int state) |
| 987 | 987 | { |
| 988 | char temp[256]; | |
| 989 | sprintf(temp, "%0*d", m_digits, state); | |
| 990 | m_string = astring(temp); | |
| 991 | draw_text(machine, dest, bounds); | |
| 988 | char temp[256]; | |
| 989 | sprintf(temp, "%0*d", m_digits, state); | |
| 990 | m_string = astring(temp); | |
| 991 | draw_text(machine, dest, bounds); | |
| 992 | 992 | } |
| 993 | 993 | |
| 994 | 994 | /* state is a normalized value between 0 and 65536 so that we don't need to worry about how many motor steps here or in the .lay, only the number of symbols */ |
| 995 | 995 | void layout_element::component::draw_reel(running_machine &machine, bitmap_argb32 &dest, const rectangle &bounds, int state) |
| 996 | 996 | { |
| 997 | if (m_beltreel) | |
| 998 | { | |
| 999 | draw_beltreel(machine,dest,bounds,state); | |
| 1000 | } | |
| 1001 | else | |
| 1002 | { | |
| 1003 | const int max_state_used = 0x10000; | |
| 997 | if (m_beltreel) | |
| 998 | { | |
| 999 | draw_beltreel(machine,dest,bounds,state); | |
| 1000 | } | |
| 1001 | else | |
| 1002 | { | |
| 1003 | const int max_state_used = 0x10000; | |
| 1004 | 1004 | |
| 1005 | // shift the reels a bit based on this param, allows fine tuning | |
| 1006 | int use_state = (state + m_stateoffset) % max_state_used; | |
| 1005 | // shift the reels a bit based on this param, allows fine tuning | |
| 1006 | int use_state = (state + m_stateoffset) % max_state_used; | |
| 1007 | 1007 | |
| 1008 | // compute premultiplied colors | |
| 1009 | UINT32 r = m_color.r * 255.0; | |
| 1010 | UINT32 g = m_color.g * 255.0; | |
| 1011 | UINT32 b = m_color.b * 255.0; | |
| 1012 | UINT32 a = m_color.a * 255.0; | |
| 1008 | // compute premultiplied colors | |
| 1009 | UINT32 r = m_color.r * 255.0; | |
| 1010 | UINT32 g = m_color.g * 255.0; | |
| 1011 | UINT32 b = m_color.b * 255.0; | |
| 1012 | UINT32 a = m_color.a * 255.0; | |
| 1013 | 1013 | |
| 1014 | // get the width of the string | |
| 1015 | render_font *font = machine.render().font_alloc("default"); | |
| 1016 | float aspect = 1.0f; | |
| 1017 | INT32 width; | |
| 1014 | // get the width of the string | |
| 1015 | render_font *font = machine.render().font_alloc("default"); | |
| 1016 | float aspect = 1.0f; | |
| 1017 | INT32 width; | |
| 1018 | 1018 | |
| 1019 | 1019 | |
| 1020 | int curry = 0; | |
| 1021 | int num_shown = m_numsymbolsvisible; | |
| 1020 | int curry = 0; | |
| 1021 | int num_shown = m_numsymbolsvisible; | |
| 1022 | 1022 | |
| 1023 | ||
| 1023 | int ourheight = bounds.height(); | |
| 1024 | 1024 | |
| 1025 | for (int fruit = 0;fruit<m_numstops;fruit++) | |
| 1026 | { | |
| 1027 | int basey; | |
| 1025 | for (int fruit = 0;fruit<m_numstops;fruit++) | |
| 1026 | { | |
| 1027 | int basey; | |
| 1028 | 1028 | |
| 1029 | if (m_reelreversed==1) | |
| 1030 | { | |
| 1031 | basey = bounds.min_y + ((use_state)*(ourheight/num_shown)/(max_state_used/m_numstops)) + curry; | |
| 1032 | } | |
| 1033 | else | |
| 1034 | { | |
| 1035 | basey = bounds.min_y - ((use_state)*(ourheight/num_shown)/(max_state_used/m_numstops)) + curry; | |
| 1036 | } | |
| 1029 | if (m_reelreversed==1) | |
| 1030 | { | |
| 1031 | basey = bounds.min_y + ((use_state)*(ourheight/num_shown)/(max_state_used/m_numstops)) + curry; | |
| 1032 | } | |
| 1033 | else | |
| 1034 | { | |
| 1035 | basey = bounds.min_y - ((use_state)*(ourheight/num_shown)/(max_state_used/m_numstops)) + curry; | |
| 1036 | } | |
| 1037 | 1037 | |
| 1038 | // wrap around... | |
| 1039 | if (basey < bounds.min_y) | |
| 1040 | basey += ((max_state_used)*(ourheight/num_shown)/(max_state_used/m_numstops)); | |
| 1041 | if (basey > bounds.max_y) | |
| 1042 | basey -= ((max_state_used)*(ourheight/num_shown)/(max_state_used/m_numstops)); | |
| 1038 | // wrap around... | |
| 1039 | if (basey < bounds.min_y) | |
| 1040 | basey += ((max_state_used)*(ourheight/num_shown)/(max_state_used/m_numstops)); | |
| 1041 | if (basey > bounds.max_y) | |
| 1042 | basey -= ((max_state_used)*(ourheight/num_shown)/(max_state_used/m_numstops)); | |
| 1043 | 1043 | |
| 1044 | ||
| 1044 | int endpos = basey+ourheight/num_shown; | |
| 1045 | 1045 | |
| 1046 | // only render the symbol / text if it's atually in view because the code is SLOW | |
| 1047 | if ((endpos >= bounds.min_y) && (basey <= bounds.max_y)) | |
| 1048 | { | |
| 1049 | while (1) | |
| 1050 | { | |
| 1051 | width = font->string_width(ourheight/num_shown, aspect, m_stopnames[fruit]); | |
| 1052 | if (width < bounds.width()) | |
| 1053 | break; | |
| 1054 | aspect *= 0.9f; | |
| 1055 | } | |
| 1046 | // only render the symbol / text if it's atually in view because the code is SLOW | |
| 1047 | if ((endpos >= bounds.min_y) && (basey <= bounds.max_y)) | |
| 1048 | { | |
| 1049 | while (1) | |
| 1050 | { | |
| 1051 | width = font->string_width(ourheight/num_shown, aspect, m_stopnames[fruit]); | |
| 1052 | if (width < bounds.width()) | |
| 1053 | break; | |
| 1054 | aspect *= 0.9f; | |
| 1055 | } | |
| 1056 | 1056 | |
| 1057 | INT32 curx; | |
| 1058 | curx = bounds.min_x + (bounds.width() - width) / 2; | |
| 1057 | INT32 curx; | |
| 1058 | curx = bounds.min_x + (bounds.width() - width) / 2; | |
| 1059 | 1059 | |
| 1060 | if (m_file[fruit]) | |
| 1061 | if (!m_bitmap[fruit].valid()) | |
| 1062 | load_reel_bitmap(fruit); | |
| 1060 | if (m_file[fruit]) | |
| 1061 | if (!m_bitmap[fruit].valid()) | |
| 1062 | load_reel_bitmap(fruit); | |
| 1063 | 1063 | |
| 1064 | if (m_file[fruit]) // render gfx | |
| 1065 | { | |
| 1066 | bitmap_argb32 tempbitmap2(dest.width(), ourheight/num_shown); | |
| 1064 | if (m_file[fruit]) // render gfx | |
| 1065 | { | |
| 1066 | bitmap_argb32 tempbitmap2(dest.width(), ourheight/num_shown); | |
| 1067 | 1067 | |
| 1068 | if (m_bitmap[fruit].valid()) | |
| 1069 | { | |
| 1070 | render_resample_argb_bitmap_hq(tempbitmap2, m_bitmap[fruit], m_color); | |
| 1068 | if (m_bitmap[fruit].valid()) | |
| 1069 | { | |
| 1070 | render_resample_argb_bitmap_hq(tempbitmap2, m_bitmap[fruit], m_color); | |
| 1071 | 1071 | |
| 1072 | for (int y = 0; y < ourheight/num_shown; y++) | |
| 1073 | { | |
| 1074 | int effy = basey + y; | |
| 1072 | for (int y = 0; y < ourheight/num_shown; y++) | |
| 1073 | { | |
| 1074 | int effy = basey + y; | |
| 1075 | 1075 | |
| 1076 | if (effy >= bounds.min_y && effy <= bounds.max_y) | |
| 1077 | { | |
| 1078 | UINT32 *src = &tempbitmap2.pix32(y); | |
| 1079 | UINT32 *d = &dest.pix32(effy); | |
| 1080 | for (int x = 0; x < dest.width(); x++) | |
| 1081 | { | |
| 1082 | int effx = x; | |
| 1083 | if (effx >= bounds.min_x && effx <= bounds.max_x) | |
| 1084 | { | |
| 1085 | UINT32 spix = rgb_t(src[x]).a(); | |
| 1086 | if (spix != 0) | |
| 1087 | { | |
| 1088 | d[effx] = src[x]; | |
| 1089 | } | |
| 1090 | } | |
| 1091 | } | |
| 1092 | } | |
| 1076 | if (effy >= bounds.min_y && effy <= bounds.max_y) | |
| 1077 | { | |
| 1078 | UINT32 *src = &tempbitmap2.pix32(y); | |
| 1079 | UINT32 *d = &dest.pix32(effy); | |
| 1080 | for (int x = 0; x < dest.width(); x++) | |
| 1081 | { | |
| 1082 | int effx = x; | |
| 1083 | if (effx >= bounds.min_x && effx <= bounds.max_x) | |
| 1084 | { | |
| 1085 | UINT32 spix = rgb_t(src[x]).a(); | |
| 1086 | if (spix != 0) | |
| 1087 | { | |
| 1088 | d[effx] = src[x]; | |
| 1089 | } | |
| 1090 | } | |
| 1091 | } | |
| 1092 | } | |
| 1093 | 1093 | |
| 1094 | } | |
| 1095 | } | |
| 1096 | } | |
| 1097 | else // render text (fallback) | |
| 1098 | { | |
| 1099 | // allocate a temporary bitmap | |
| 1100 | bitmap_argb32 tempbitmap(dest.width(), dest.height()); | |
| 1094 | } | |
| 1095 | } | |
| 1096 | } | |
| 1097 | else // render text (fallback) | |
| 1098 | { | |
| 1099 | // allocate a temporary bitmap | |
| 1100 | bitmap_argb32 tempbitmap(dest.width(), dest.height()); | |
| 1101 | 1101 | |
| 1102 | // loop over characters | |
| 1103 | for (const char *s = m_stopnames[fruit]; *s != 0; s++) | |
| 1104 | { | |
| 1105 | // get the font bitmap | |
| 1106 | rectangle chbounds; | |
| 1107 | font->get_scaled_bitmap_and_bounds(tempbitmap, ourheight/num_shown, aspect, *s, chbounds); | |
| 1102 | // loop over characters | |
| 1103 | for (const char *s = m_stopnames[fruit]; *s != 0; s++) | |
| 1104 | { | |
| 1105 | // get the font bitmap | |
| 1106 | rectangle chbounds; | |
| 1107 | font->get_scaled_bitmap_and_bounds(tempbitmap, ourheight/num_shown, aspect, *s, chbounds); | |
| 1108 | 1108 | |
| 1109 | // copy the data into the target | |
| 1110 | for (int y = 0; y < chbounds.height(); y++) | |
| 1111 | { | |
| 1112 | int effy = basey + y; | |
| 1109 | // copy the data into the target | |
| 1110 | for (int y = 0; y < chbounds.height(); y++) | |
| 1111 | { | |
| 1112 | int effy = basey + y; | |
| 1113 | 1113 | |
| 1114 | if (effy >= bounds.min_y && effy <= bounds.max_y) | |
| 1115 | { | |
| 1116 | UINT32 *src = &tempbitmap.pix32(y); | |
| 1117 | UINT32 *d = &dest.pix32(effy); | |
| 1118 | for (int x = 0; x < chbounds.width(); x++) | |
| 1119 | { | |
| 1120 | int effx = curx + x + chbounds.min_x; | |
| 1121 | if (effx >= bounds.min_x && effx <= bounds.max_x) | |
| 1122 | { | |
| 1123 | UINT32 spix = rgb_t(src[x]).a(); | |
| 1124 | if (spix != 0) | |
| 1125 | { | |
| 1126 | rgb_t dpix = d[effx]; | |
| 1127 | UINT32 ta = (a * (spix + 1)) >> 8; | |
| 1128 | UINT32 tr = (r * ta + dpix.r() * (0x100 - ta)) >> 8; | |
| 1129 | UINT32 tg = (g * ta + dpix.g() * (0x100 - ta)) >> 8; | |
| 1130 | UINT32 tb = (b * ta + dpix.b() * (0x100 - ta)) >> 8; | |
| 1131 | d[effx] = rgb_t(tr, tg, tb); | |
| 1132 | } | |
| 1133 | } | |
| 1134 | } | |
| 1135 | } | |
| 1136 | } | |
| 1114 | if (effy >= bounds.min_y && effy <= bounds.max_y) | |
| 1115 | { | |
| 1116 | UINT32 *src = &tempbitmap.pix32(y); | |
| 1117 | UINT32 *d = &dest.pix32(effy); | |
| 1118 | for (int x = 0; x < chbounds.width(); x++) | |
| 1119 | { | |
| 1120 | int effx = curx + x + chbounds.min_x; | |
| 1121 | if (effx >= bounds.min_x && effx <= bounds.max_x) | |
| 1122 | { | |
| 1123 | UINT32 spix = rgb_t(src[x]).a(); | |
| 1124 | if (spix != 0) | |
| 1125 | { | |
| 1126 | rgb_t dpix = d[effx]; | |
| 1127 | UINT32 ta = (a * (spix + 1)) >> 8; | |
| 1128 | UINT32 tr = (r * ta + dpix.r() * (0x100 - ta)) >> 8; | |
| 1129 | UINT32 tg = (g * ta + dpix.g() * (0x100 - ta)) >> 8; | |
| 1130 | UINT32 tb = (b * ta + dpix.b() * (0x100 - ta)) >> 8; | |
| 1131 | d[effx] = rgb_t(tr, tg, tb); | |
| 1132 | } | |
| 1133 | } | |
| 1134 | } | |
| 1135 | } | |
| 1136 | } | |
| 1137 | 1137 | |
| 1138 | // advance in the X direction | |
| 1139 | curx += font->char_width(ourheight/num_shown, aspect, *s); | |
| 1138 | // advance in the X direction | |
| 1139 | curx += font->char_width(ourheight/num_shown, aspect, *s); | |
| 1140 | 1140 | |
| 1141 | ||
| 1141 | } | |
| 1142 | 1142 | |
| 1143 | } | |
| 1144 | } | |
| 1143 | } | |
| 1144 | } | |
| 1145 | 1145 | |
| 1146 | curry += ourheight/num_shown; | |
| 1147 | } | |
| 1148 | // free the temporary bitmap and font | |
| 1149 | machine.render().font_free(font); | |
| 1150 | } | |
| 1146 | curry += ourheight/num_shown; | |
| 1147 | } | |
| 1148 | // free the temporary bitmap and font | |
| 1149 | machine.render().font_free(font); | |
| 1150 | } | |
| 1151 | 1151 | } |
| 1152 | 1152 | |
| 1153 | 1153 | |
| 1154 | 1154 | void layout_element::component::draw_beltreel(running_machine &machine, bitmap_argb32 &dest, const rectangle &bounds, int state) |
| 1155 | 1155 | { |
| 1156 | ||
| 1156 | const int max_state_used = 0x10000; | |
| 1157 | 1157 | |
| 1158 | // shift the reels a bit based on this param, allows fine tuning | |
| 1159 | int use_state = (state + m_stateoffset) % max_state_used; | |
| 1158 | // shift the reels a bit based on this param, allows fine tuning | |
| 1159 | int use_state = (state + m_stateoffset) % max_state_used; | |
| 1160 | 1160 | |
| 1161 | // compute premultiplied colors | |
| 1162 | UINT32 r = m_color.r * 255.0; | |
| 1163 | UINT32 g = m_color.g * 255.0; | |
| 1164 | UINT32 b = m_color.b * 255.0; | |
| 1165 | UINT32 a = m_color.a * 255.0; | |
| 1161 | // compute premultiplied colors | |
| 1162 | UINT32 r = m_color.r * 255.0; | |
| 1163 | UINT32 g = m_color.g * 255.0; | |
| 1164 | UINT32 b = m_color.b * 255.0; | |
| 1165 | UINT32 a = m_color.a * 255.0; | |
| 1166 | 1166 | |
| 1167 | // get the width of the string | |
| 1168 | render_font *font = machine.render().font_alloc("default"); | |
| 1169 | float aspect = 1.0f; | |
| 1170 | INT32 width; | |
| 1171 | int currx = 0; | |
| 1172 | int num_shown = m_numsymbolsvisible; | |
| 1167 | // get the width of the string | |
| 1168 | render_font *font = machine.render().font_alloc("default"); | |
| 1169 | float aspect = 1.0f; | |
| 1170 | INT32 width; | |
| 1171 | int currx = 0; | |
| 1172 | int num_shown = m_numsymbolsvisible; | |
| 1173 | 1173 | |
| 1174 | ||
| 1174 | int ourwidth = bounds.width(); | |
| 1175 | 1175 | |
| 1176 | for (int fruit = 0;fruit<m_numstops;fruit++) | |
| 1177 | { | |
| 1178 | int basex; | |
| 1179 | if (m_reelreversed==1) | |
| 1180 | { | |
| 1181 | basex = bounds.min_x + ((use_state)*(ourwidth/num_shown)/(max_state_used/m_numstops)) + currx; | |
| 1182 | } | |
| 1183 | else | |
| 1184 | { | |
| 1185 | basex = bounds.min_x - ((use_state)*(ourwidth/num_shown)/(max_state_used/m_numstops)) + currx; | |
| 1186 | } | |
| 1176 | for (int fruit = 0;fruit<m_numstops;fruit++) | |
| 1177 | { | |
| 1178 | int basex; | |
| 1179 | if (m_reelreversed==1) | |
| 1180 | { | |
| 1181 | basex = bounds.min_x + ((use_state)*(ourwidth/num_shown)/(max_state_used/m_numstops)) + currx; | |
| 1182 | } | |
| 1183 | else | |
| 1184 | { | |
| 1185 | basex = bounds.min_x - ((use_state)*(ourwidth/num_shown)/(max_state_used/m_numstops)) + currx; | |
| 1186 | } | |
| 1187 | 1187 | |
| 1188 | // wrap around... | |
| 1189 | if (basex < bounds.min_x) | |
| 1190 | basex += ((max_state_used)*(ourwidth/num_shown)/(max_state_used/m_numstops)); | |
| 1191 | if (basex > bounds.max_x) | |
| 1192 | basex -= ((max_state_used)*(ourwidth/num_shown)/(max_state_used/m_numstops)); | |
| 1188 | // wrap around... | |
| 1189 | if (basex < bounds.min_x) | |
| 1190 | basex += ((max_state_used)*(ourwidth/num_shown)/(max_state_used/m_numstops)); | |
| 1191 | if (basex > bounds.max_x) | |
| 1192 | basex -= ((max_state_used)*(ourwidth/num_shown)/(max_state_used/m_numstops)); | |
| 1193 | 1193 | |
| 1194 | ||
| 1194 | int endpos = basex+(ourwidth/num_shown); | |
| 1195 | 1195 | |
| 1196 | // only render the symbol / text if it's atually in view because the code is SLOW | |
| 1197 | if ((endpos >= bounds.min_x) && (basex <= bounds.max_x)) | |
| 1198 | { | |
| 1199 | while (1) | |
| 1200 | { | |
| 1201 | width = font->string_width(dest.height(), aspect, m_stopnames[fruit]); | |
| 1202 | if (width < bounds.width()) | |
| 1203 | break; | |
| 1204 | aspect *= 0.9f; | |
| 1205 | } | |
| 1196 | // only render the symbol / text if it's atually in view because the code is SLOW | |
| 1197 | if ((endpos >= bounds.min_x) && (basex <= bounds.max_x)) | |
| 1198 | { | |
| 1199 | while (1) | |
| 1200 | { | |
| 1201 | width = font->string_width(dest.height(), aspect, m_stopnames[fruit]); | |
| 1202 | if (width < bounds.width()) | |
| 1203 | break; | |
| 1204 | aspect *= 0.9f; | |
| 1205 | } | |
| 1206 | 1206 | |
| 1207 | INT32 curx; | |
| 1208 | curx = bounds.min_x; | |
| 1207 | INT32 curx; | |
| 1208 | curx = bounds.min_x; | |
| 1209 | 1209 | |
| 1210 | if (m_file[fruit]) | |
| 1211 | if (!m_bitmap[fruit].valid()) | |
| 1212 | load_reel_bitmap(fruit); | |
| 1210 | if (m_file[fruit]) | |
| 1211 | if (!m_bitmap[fruit].valid()) | |
| 1212 | load_reel_bitmap(fruit); | |
| 1213 | 1213 | |
| 1214 | if (m_file[fruit]) // render gfx | |
| 1215 | { | |
| 1216 | bitmap_argb32 tempbitmap2(ourwidth/num_shown, dest.height()); | |
| 1214 | if (m_file[fruit]) // render gfx | |
| 1215 | { | |
| 1216 | bitmap_argb32 tempbitmap2(ourwidth/num_shown, dest.height()); | |
| 1217 | 1217 | |
| 1218 | if (m_bitmap[fruit].valid()) | |
| 1219 | { | |
| 1220 | render_resample_argb_bitmap_hq(tempbitmap2, m_bitmap[fruit], m_color); | |
| 1218 | if (m_bitmap[fruit].valid()) | |
| 1219 | { | |
| 1220 | render_resample_argb_bitmap_hq(tempbitmap2, m_bitmap[fruit], m_color); | |
| 1221 | 1221 | |
| 1222 | for (int y = 0; y < dest.height(); y++) | |
| 1223 | { | |
| 1224 | int effy = y; | |
| 1222 | for (int y = 0; y < dest.height(); y++) | |
| 1223 | { | |
| 1224 | int effy = y; | |
| 1225 | 1225 | |
| 1226 | if (effy >= bounds.min_y && effy <= bounds.max_y) | |
| 1227 | { | |
| 1228 | UINT32 *src = &tempbitmap2.pix32(y); | |
| 1229 | UINT32 *d = &dest.pix32(effy); | |
| 1230 | for (int x = 0; x < ourwidth/num_shown; x++) | |
| 1231 | { | |
| 1232 | int effx = basex + x; | |
| 1233 | if (effx >= bounds.min_x && effx <= bounds.max_x) | |
| 1234 | { | |
| 1235 | UINT32 spix = rgb_t(src[x]).a(); | |
| 1236 | if (spix != 0) | |
| 1237 | { | |
| 1238 | d[effx] = src[x]; | |
| 1239 | } | |
| 1240 | } | |
| 1241 | } | |
| 1242 | } | |
| 1226 | if (effy >= bounds.min_y && effy <= bounds.max_y) | |
| 1227 | { | |
| 1228 | UINT32 *src = &tempbitmap2.pix32(y); | |
| 1229 | UINT32 *d = &dest.pix32(effy); | |
| 1230 | for (int x = 0; x < ourwidth/num_shown; x++) | |
| 1231 | { | |
| 1232 | int effx = basex + x; | |
| 1233 | if (effx >= bounds.min_x && effx <= bounds.max_x) | |
| 1234 | { | |
| 1235 | UINT32 spix = rgb_t(src[x]).a(); | |
| 1236 | if (spix != 0) | |
| 1237 | { | |
| 1238 | d[effx] = src[x]; | |
| 1239 | } | |
| 1240 | } | |
| 1241 | } | |
| 1242 | } | |
| 1243 | 1243 | |
| 1244 | } | |
| 1245 | } | |
| 1246 | } | |
| 1247 | else // render text (fallback) | |
| 1248 | { | |
| 1249 | // allocate a temporary bitmap | |
| 1250 | bitmap_argb32 tempbitmap(dest.width(), dest.height()); | |
| 1244 | } | |
| 1245 | } | |
| 1246 | } | |
| 1247 | else // render text (fallback) | |
| 1248 | { | |
| 1249 | // allocate a temporary bitmap | |
| 1250 | bitmap_argb32 tempbitmap(dest.width(), dest.height()); | |
| 1251 | 1251 | |
| 1252 | // loop over characters | |
| 1253 | for (const char *s = m_stopnames[fruit]; *s != 0; s++) | |
| 1254 | { | |
| 1255 | // get the font bitmap | |
| 1256 | rectangle chbounds; | |
| 1257 | font->get_scaled_bitmap_and_bounds(tempbitmap, dest.height(), aspect, *s, chbounds); | |
| 1252 | // loop over characters | |
| 1253 | for (const char *s = m_stopnames[fruit]; *s != 0; s++) | |
| 1254 | { | |
| 1255 | // get the font bitmap | |
| 1256 | rectangle chbounds; | |
| 1257 | font->get_scaled_bitmap_and_bounds(tempbitmap, dest.height(), aspect, *s, chbounds); | |
| 1258 | 1258 | |
| 1259 | // copy the data into the target | |
| 1260 | for (int y = 0; y < chbounds.height(); y++) | |
| 1261 | { | |
| 1262 | int effy = y; | |
| 1259 | // copy the data into the target | |
| 1260 | for (int y = 0; y < chbounds.height(); y++) | |
| 1261 | { | |
| 1262 | int effy = y; | |
| 1263 | 1263 | |
| 1264 | if (effy >= bounds.min_y && effy <= bounds.max_y) | |
| 1265 | { | |
| 1266 | UINT32 *src = &tempbitmap.pix32(y); | |
| 1267 | UINT32 *d = &dest.pix32(effy); | |
| 1268 | for (int x = 0; x < chbounds.width(); x++) | |
| 1269 | { | |
| 1270 | int effx = basex + curx + x; | |
| 1271 | if (effx >= bounds.min_x && effx <= bounds.max_x) | |
| 1272 | { | |
| 1273 | UINT32 spix = rgb_t(src[x]).a(); | |
| 1274 | if (spix != 0) | |
| 1275 | { | |
| 1276 | rgb_t dpix = d[effx]; | |
| 1277 | UINT32 ta = (a * (spix + 1)) >> 8; | |
| 1278 | UINT32 tr = (r * ta + dpix.r() * (0x100 - ta)) >> 8; | |
| 1279 | UINT32 tg = (g * ta + dpix.g() * (0x100 - ta)) >> 8; | |
| 1280 | UINT32 tb = (b * ta + dpix.b() * (0x100 - ta)) >> 8; | |
| 1281 | d[effx] = rgb_t(tr, tg, tb); | |
| 1282 | } | |
| 1283 | } | |
| 1284 | } | |
| 1285 | } | |
| 1286 | } | |
| 1264 | if (effy >= bounds.min_y && effy <= bounds.max_y) | |
| 1265 | { | |
| 1266 | UINT32 *src = &tempbitmap.pix32(y); | |
| 1267 | UINT32 *d = &dest.pix32(effy); | |
| 1268 | for (int x = 0; x < chbounds.width(); x++) | |
| 1269 | { | |
| 1270 | int effx = basex + curx + x; | |
| 1271 | if (effx >= bounds.min_x && effx <= bounds.max_x) | |
| 1272 | { | |
| 1273 | UINT32 spix = rgb_t(src[x]).a(); | |
| 1274 | if (spix != 0) | |
| 1275 | { | |
| 1276 | rgb_t dpix = d[effx]; | |
| 1277 | UINT32 ta = (a * (spix + 1)) >> 8; | |
| 1278 | UINT32 tr = (r * ta + dpix.r() * (0x100 - ta)) >> 8; | |
| 1279 | UINT32 tg = (g * ta + dpix.g() * (0x100 - ta)) >> 8; | |
| 1280 | UINT32 tb = (b * ta + dpix.b() * (0x100 - ta)) >> 8; | |
| 1281 | d[effx] = rgb_t(tr, tg, tb); | |
| 1282 | } | |
| 1283 | } | |
| 1284 | } | |
| 1285 | } | |
| 1286 | } | |
| 1287 | 1287 | |
| 1288 | // advance in the X direction | |
| 1289 | curx += font->char_width(dest.height(), aspect, *s); | |
| 1288 | // advance in the X direction | |
| 1289 | curx += font->char_width(dest.height(), aspect, *s); | |
| 1290 | 1290 | |
| 1291 | ||
| 1291 | } | |
| 1292 | 1292 | |
| 1293 | } | |
| 1294 | } | |
| 1293 | } | |
| 1294 | } | |
| 1295 | 1295 | |
| 1296 | currx += ourwidth/num_shown; | |
| 1297 | } | |
| 1296 | currx += ourwidth/num_shown; | |
| 1297 | } | |
| 1298 | 1298 | |
| 1299 | // free the temporary bitmap and font | |
| 1300 | machine.render().font_free(font); | |
| 1299 | // free the temporary bitmap and font | |
| 1300 | machine.render().font_free(font); | |
| 1301 | 1301 | } |
| 1302 | 1302 | |
| 1303 | 1303 | |
| r242631 | r242632 | |
| 1308 | 1308 | |
| 1309 | 1309 | void layout_element::component::load_bitmap() |
| 1310 | 1310 | { |
| 1311 | // load the basic bitmap | |
| 1312 | assert(m_file[0] != NULL); | |
| 1313 | m_hasalpha[0] = render_load_png(m_bitmap[0], *m_file[0], m_dirname, m_imagefile[0]); | |
| 1311 | // load the basic bitmap | |
| 1312 | assert(m_file[0] != NULL); | |
| 1313 | m_hasalpha[0] = render_load_png(m_bitmap[0], *m_file[0], m_dirname, m_imagefile[0]); | |
| 1314 | 1314 | |
| 1315 | // load the alpha bitmap if specified | |
| 1316 | if (m_bitmap[0].valid() && m_alphafile[0]) | |
| 1317 | render_load_png(m_bitmap[0], *m_file[0], m_dirname, m_alphafile[0], true); | |
| 1315 | // load the alpha bitmap if specified | |
| 1316 | if (m_bitmap[0].valid() && m_alphafile[0]) | |
| 1317 | render_load_png(m_bitmap[0], *m_file[0], m_dirname, m_alphafile[0], true); | |
| 1318 | 1318 | |
| 1319 | // if we can't load the bitmap, allocate a dummy one and report an error | |
| 1320 | if (!m_bitmap[0].valid()) | |
| 1321 | { | |
| 1322 | // draw some stripes in the bitmap | |
| 1323 | m_bitmap[0].allocate(100, 100); | |
| 1324 | m_bitmap[0].fill(0); | |
| 1325 | for (int step = 0; step < 100; step += 25) | |
| 1326 | for (int line = 0; line < 100; line++) | |
| 1327 | m_bitmap[0].pix32((step + line) % 100, line % 100) = rgb_t(0xff,0xff,0xff,0xff); | |
| 1319 | // if we can't load the bitmap, allocate a dummy one and report an error | |
| 1320 | if (!m_bitmap[0].valid()) | |
| 1321 | { | |
| 1322 | // draw some stripes in the bitmap | |
| 1323 | m_bitmap[0].allocate(100, 100); | |
| 1324 | m_bitmap[0].fill(0); | |
| 1325 | for (int step = 0; step < 100; step += 25) | |
| 1326 | for (int line = 0; line < 100; line++) | |
| 1327 | m_bitmap[0].pix32((step + line) % 100, line % 100) = rgb_t(0xff,0xff,0xff,0xff); | |
| 1328 | 1328 | |
| 1329 | // log an error | |
| 1330 | if (!m_alphafile[0]) | |
| 1331 | osd_printf_warning("Unable to load component bitmap '%s'\n", m_imagefile[0].cstr()); | |
| 1332 | else | |
| 1333 | osd_printf_warning("Unable to load component bitmap '%s'/'%s'\n", m_imagefile[0].cstr(), m_alphafile[0].cstr()); | |
| 1334 | } | |
| 1329 | // log an error | |
| 1330 | if (!m_alphafile[0]) | |
| 1331 | osd_printf_warning("Unable to load component bitmap '%s'\n", m_imagefile[0].cstr()); | |
| 1332 | else | |
| 1333 | osd_printf_warning("Unable to load component bitmap '%s'/'%s'\n", m_imagefile[0].cstr(), m_alphafile[0].cstr()); | |
| 1334 | } | |
| 1335 | 1335 | } |
| 1336 | 1336 | |
| 1337 | 1337 | |
| 1338 | 1338 | void layout_element::component::load_reel_bitmap(int number) |
| 1339 | 1339 | { |
| 1340 | // load the basic bitmap | |
| 1341 | assert(m_file != NULL); | |
| 1342 | /*m_hasalpha[number] = */ render_load_png(m_bitmap[number], *m_file[number], m_dirname, m_imagefile[number]); | |
| 1340 | // load the basic bitmap | |
| 1341 | assert(m_file != NULL); | |
| 1342 | /*m_hasalpha[number] = */ render_load_png(m_bitmap[number], *m_file[number], m_dirname, m_imagefile[number]); | |
| 1343 | 1343 | |
| 1344 | // load the alpha bitmap if specified | |
| 1345 | //if (m_bitmap[number].valid() && m_alphafile[number]) | |
| 1346 | // render_load_png(m_bitmap[number], *m_file[number], m_dirname, m_alphafile[number], true); | |
| 1344 | // load the alpha bitmap if specified | |
| 1345 | //if (m_bitmap[number].valid() && m_alphafile[number]) | |
| 1346 | // render_load_png(m_bitmap[number], *m_file[number], m_dirname, m_alphafile[number], true); | |
| 1347 | 1347 | |
| 1348 | // if we can't load the bitmap just use text rendering | |
| 1349 | if (!m_bitmap[number].valid()) | |
| 1350 | { | |
| 1351 | // fallback to text rendering | |
| 1352 | m_file[number].reset(); | |
| 1353 | } | |
| 1348 | // if we can't load the bitmap just use text rendering | |
| 1349 | if (!m_bitmap[number].valid()) | |
| 1350 | { | |
| 1351 | // fallback to text rendering | |
| 1352 | m_file[number].reset(); | |
| 1353 | } | |
| 1354 | 1354 | |
| 1355 | 1355 | } |
| 1356 | 1356 | |
| r242631 | r242632 | |
| 1362 | 1362 | |
| 1363 | 1363 | void layout_element::component::draw_led7seg(bitmap_argb32 &dest, const rectangle &bounds, int pattern) |
| 1364 | 1364 | { |
| 1365 | const rgb_t onpen = rgb_t(0xff,0xff,0xff,0xff); | |
| 1366 | const rgb_t offpen = rgb_t(0xff,0x20,0x20,0x20); | |
| 1365 | const rgb_t onpen = rgb_t(0xff,0xff,0xff,0xff); | |
| 1366 | const rgb_t offpen = rgb_t(0xff,0x20,0x20,0x20); | |
| 1367 | 1367 | |
| 1368 | // sizes for computation | |
| 1369 | int bmwidth = 250; | |
| 1370 | int bmheight = 400; | |
| 1371 | int segwidth = 40; | |
| 1372 | int skewwidth = 40; | |
| 1368 | // sizes for computation | |
| 1369 | int bmwidth = 250; | |
| 1370 | int bmheight = 400; | |
| 1371 | int segwidth = 40; | |
| 1372 | int skewwidth = 40; | |
| 1373 | 1373 | |
| 1374 | // allocate a temporary bitmap for drawing | |
| 1375 | bitmap_argb32 tempbitmap(bmwidth + skewwidth, bmheight); | |
| 1376 | tempbitmap.fill(rgb_t(0xff,0x00,0x00,0x00)); | |
| 1374 | // allocate a temporary bitmap for drawing | |
| 1375 | bitmap_argb32 tempbitmap(bmwidth + skewwidth, bmheight); | |
| 1376 | tempbitmap.fill(rgb_t(0xff,0x00,0x00,0x00)); | |
| 1377 | 1377 | |
| 1378 | // top bar | |
| 1379 | draw_segment_horizontal(tempbitmap, 0 + 2*segwidth/3, bmwidth - 2*segwidth/3, 0 + segwidth/2, segwidth, (pattern & (1 << 0)) ? onpen : offpen); | |
| 1378 | // top bar | |
| 1379 | draw_segment_horizontal(tempbitmap, 0 + 2*segwidth/3, bmwidth - 2*segwidth/3, 0 + segwidth/2, segwidth, (pattern & (1 << 0)) ? onpen : offpen); | |
| 1380 | 1380 | |
| 1381 | // top-right bar | |
| 1382 | draw_segment_vertical(tempbitmap, 0 + 2*segwidth/3, bmheight/2 - segwidth/3, bmwidth - segwidth/2, segwidth, (pattern & (1 << 1)) ? onpen : offpen); | |
| 1381 | // top-right bar | |
| 1382 | draw_segment_vertical(tempbitmap, 0 + 2*segwidth/3, bmheight/2 - segwidth/3, bmwidth - segwidth/2, segwidth, (pattern & (1 << 1)) ? onpen : offpen); | |
| 1383 | 1383 | |
| 1384 | // bottom-right bar | |
| 1385 | draw_segment_vertical(tempbitmap, bmheight/2 + segwidth/3, bmheight - 2*segwidth/3, bmwidth - segwidth/2, segwidth, (pattern & (1 << 2)) ? onpen : offpen); | |
| 1384 | // bottom-right bar | |
| 1385 | draw_segment_vertical(tempbitmap, bmheight/2 + segwidth/3, bmheight - 2*segwidth/3, bmwidth - segwidth/2, segwidth, (pattern & (1 << 2)) ? onpen : offpen); | |
| 1386 | 1386 | |
| 1387 | // bottom bar | |
| 1388 | draw_segment_horizontal(tempbitmap, 0 + 2*segwidth/3, bmwidth - 2*segwidth/3, bmheight - segwidth/2, segwidth, (pattern & (1 << 3)) ? onpen : offpen); | |
| 1387 | // bottom bar | |
| 1388 | draw_segment_horizontal(tempbitmap, 0 + 2*segwidth/3, bmwidth - 2*segwidth/3, bmheight - segwidth/2, segwidth, (pattern & (1 << 3)) ? onpen : offpen); | |
| 1389 | 1389 | |
| 1390 | // bottom-left bar | |
| 1391 | draw_segment_vertical(tempbitmap, bmheight/2 + segwidth/3, bmheight - 2*segwidth/3, 0 + segwidth/2, segwidth, (pattern & (1 << 4)) ? onpen : offpen); | |
| 1390 | // bottom-left bar | |
| 1391 | draw_segment_vertical(tempbitmap, bmheight/2 + segwidth/3, bmheight - 2*segwidth/3, 0 + segwidth/2, segwidth, (pattern & (1 << 4)) ? onpen : offpen); | |
| 1392 | 1392 | |
| 1393 | // top-left bar | |
| 1394 | draw_segment_vertical(tempbitmap, 0 + 2*segwidth/3, bmheight/2 - segwidth/3, 0 + segwidth/2, segwidth, (pattern & (1 << 5)) ? onpen : offpen); | |
| 1393 | // top-left bar | |
| 1394 | draw_segment_vertical(tempbitmap, 0 + 2*segwidth/3, bmheight/2 - segwidth/3, 0 + segwidth/2, segwidth, (pattern & (1 << 5)) ? onpen : offpen); | |
| 1395 | 1395 | |
| 1396 | // middle bar | |
| 1397 | draw_segment_horizontal(tempbitmap, 0 + 2*segwidth/3, bmwidth - 2*segwidth/3, bmheight/2, segwidth, (pattern & (1 << 6)) ? onpen : offpen); | |
| 1396 | // middle bar | |
| 1397 | draw_segment_horizontal(tempbitmap, 0 + 2*segwidth/3, bmwidth - 2*segwidth/3, bmheight/2, segwidth, (pattern & (1 << 6)) ? onpen : offpen); | |
| 1398 | 1398 | |
| 1399 | // apply skew | |
| 1400 | apply_skew(tempbitmap, 40); | |
| 1399 | // apply skew | |
| 1400 | apply_skew(tempbitmap, 40); | |
| 1401 | 1401 | |
| 1402 | // decimal point | |
| 1403 | draw_segment_decimal(tempbitmap, bmwidth + segwidth/2, bmheight - segwidth/2, segwidth, (pattern & (1 << 7)) ? onpen : offpen); | |
| 1402 | // decimal point | |
| 1403 | draw_segment_decimal(tempbitmap, bmwidth + segwidth/2, bmheight - segwidth/2, segwidth, (pattern & (1 << 7)) ? onpen : offpen); | |
| 1404 | 1404 | |
| 1405 | // resample to the target size | |
| 1406 | render_resample_argb_bitmap_hq(dest, tempbitmap, m_color); | |
| 1405 | // resample to the target size | |
| 1406 | render_resample_argb_bitmap_hq(dest, tempbitmap, m_color); | |
| 1407 | 1407 | } |
| 1408 | 1408 | |
| 1409 | 1409 | |
| r242631 | r242632 | |
| 1413 | 1413 | |
| 1414 | 1414 | void layout_element::component::draw_led8seg_gts1(bitmap_argb32 &dest, const rectangle &bounds, int pattern) |
| 1415 | 1415 | { |
| 1416 | const rgb_t onpen = rgb_t(0xff,0xff,0xff,0xff); | |
| 1417 | const rgb_t offpen = rgb_t(0xff,0x20,0x20,0x20); | |
| 1418 | const rgb_t backpen = rgb_t(0xff,0x00,0x00,0x00); | |
| 1416 | const rgb_t onpen = rgb_t(0xff,0xff,0xff,0xff); | |
| 1417 | const rgb_t offpen = rgb_t(0xff,0x20,0x20,0x20); | |
| 1418 | const rgb_t backpen = rgb_t(0xff,0x00,0x00,0x00); | |
| 1419 | 1419 | |
| 1420 | // sizes for computation | |
| 1421 | int bmwidth = 250; | |
| 1422 | int bmheight = 400; | |
| 1423 | int segwidth = 40; | |
| 1424 | int skewwidth = 40; | |
| 1420 | // sizes for computation | |
| 1421 | int bmwidth = 250; | |
| 1422 | int bmheight = 400; | |
| 1423 | int segwidth = 40; | |
| 1424 | int skewwidth = 40; | |
| 1425 | 1425 | |
| 1426 | // allocate a temporary bitmap for drawing | |
| 1427 | bitmap_argb32 tempbitmap(bmwidth + skewwidth, bmheight); | |
| 1428 | tempbitmap.fill(backpen); | |
| 1426 | // allocate a temporary bitmap for drawing | |
| 1427 | bitmap_argb32 tempbitmap(bmwidth + skewwidth, bmheight); | |
| 1428 | tempbitmap.fill(backpen); | |
| 1429 | 1429 | |
| 1430 | // top bar | |
| 1431 | draw_segment_horizontal(tempbitmap, 0 + 2*segwidth/3, bmwidth - 2*segwidth/3, 0 + segwidth/2, segwidth, (pattern & (1 << 0)) ? onpen : offpen); | |
| 1430 | // top bar | |
| 1431 | draw_segment_horizontal(tempbitmap, 0 + 2*segwidth/3, bmwidth - 2*segwidth/3, 0 + segwidth/2, segwidth, (pattern & (1 << 0)) ? onpen : offpen); | |
| 1432 | 1432 | |
| 1433 | // top-right bar | |
| 1434 | draw_segment_vertical(tempbitmap, 0 + 2*segwidth/3, bmheight/2 - segwidth/3, bmwidth - segwidth/2, segwidth, (pattern & (1 << 1)) ? onpen : offpen); | |
| 1433 | // top-right bar | |
| 1434 | draw_segment_vertical(tempbitmap, 0 + 2*segwidth/3, bmheight/2 - segwidth/3, bmwidth - segwidth/2, segwidth, (pattern & (1 << 1)) ? onpen : offpen); | |
| 1435 | 1435 | |
| 1436 | // bottom-right bar | |
| 1437 | draw_segment_vertical(tempbitmap, bmheight/2 + segwidth/3, bmheight - 2*segwidth/3, bmwidth - segwidth/2, segwidth, (pattern & (1 << 2)) ? onpen : offpen); | |
| 1436 | // bottom-right bar | |
| 1437 | draw_segment_vertical(tempbitmap, bmheight/2 + segwidth/3, bmheight - 2*segwidth/3, bmwidth - segwidth/2, segwidth, (pattern & (1 << 2)) ? onpen : offpen); | |
| 1438 | 1438 | |
| 1439 | // bottom bar | |
| 1440 | draw_segment_horizontal(tempbitmap, 0 + 2*segwidth/3, bmwidth - 2*segwidth/3, bmheight - segwidth/2, segwidth, (pattern & (1 << 3)) ? onpen : offpen); | |
| 1439 | // bottom bar | |
| 1440 | draw_segment_horizontal(tempbitmap, 0 + 2*segwidth/3, bmwidth - 2*segwidth/3, bmheight - segwidth/2, segwidth, (pattern & (1 << 3)) ? onpen : offpen); | |
| 1441 | 1441 | |
| 1442 | // bottom-left bar | |
| 1443 | draw_segment_vertical(tempbitmap, bmheight/2 + segwidth/3, bmheight - 2*segwidth/3, 0 + segwidth/2, segwidth, (pattern & (1 << 4)) ? onpen : offpen); | |
| 1442 | // bottom-left bar | |
| 1443 | draw_segment_vertical(tempbitmap, bmheight/2 + segwidth/3, bmheight - 2*segwidth/3, 0 + segwidth/2, segwidth, (pattern & (1 << 4)) ? onpen : offpen); | |
| 1444 | 1444 | |
| 1445 | // top-left bar | |
| 1446 | draw_segment_vertical(tempbitmap, 0 + 2*segwidth/3, bmheight/2 - segwidth/3, 0 + segwidth/2, segwidth, (pattern & (1 << 5)) ? onpen : offpen); | |
| 1445 | // top-left bar | |
| 1446 | draw_segment_vertical(tempbitmap, 0 + 2*segwidth/3, bmheight/2 - segwidth/3, 0 + segwidth/2, segwidth, (pattern & (1 << 5)) ? onpen : offpen); | |
| 1447 | 1447 | |
| 1448 | // horizontal bars | |
| 1449 | draw_segment_horizontal(tempbitmap, 0 + 2*segwidth/3, 2*bmwidth/3 - 2*segwidth/3, bmheight/2, segwidth, (pattern & (1 << 6)) ? onpen : offpen); | |
| 1450 | draw_segment_horizontal(tempbitmap, 0 + 2*segwidth/3 + bmwidth/2, bmwidth - 2*segwidth/3, bmheight/2, segwidth, (pattern & (1 << 6)) ? onpen : offpen); | |
| 1448 | // horizontal bars | |
| 1449 | draw_segment_horizontal(tempbitmap, 0 + 2*segwidth/3, 2*bmwidth/3 - 2*segwidth/3, bmheight/2, segwidth, (pattern & (1 << 6)) ? onpen : offpen); | |
| 1450 | draw_segment_horizontal(tempbitmap, 0 + 2*segwidth/3 + bmwidth/2, bmwidth - 2*segwidth/3, bmheight/2, segwidth, (pattern & (1 << 6)) ? onpen : offpen); | |
| 1451 | 1451 | |
| 1452 | // vertical bars | |
| 1453 | draw_segment_vertical(tempbitmap, 0 + segwidth/3 - 8, bmheight/2 - segwidth/3 + 2, 2*bmwidth/3 - segwidth/2 - 4, segwidth + 8, backpen); | |
| 1454 | draw_segment_vertical(tempbitmap, 0 + segwidth/3, bmheight/2 - segwidth/3, 2*bmwidth/3 - segwidth/2 - 4, segwidth, (pattern & (1 << 7)) ? onpen : offpen); | |
| 1452 | // vertical bars | |
| 1453 | draw_segment_vertical(tempbitmap, 0 + segwidth/3 - 8, bmheight/2 - segwidth/3 + 2, 2*bmwidth/3 - segwidth/2 - 4, segwidth + 8, backpen); | |
| 1454 | draw_segment_vertical(tempbitmap, 0 + segwidth/3, bmheight/2 - segwidth/3, 2*bmwidth/3 - segwidth/2 - 4, segwidth, (pattern & (1 << 7)) ? onpen : offpen); | |
| 1455 | 1455 | |
| 1456 | draw_segment_vertical(tempbitmap, bmheight/2 + segwidth/3 - 2, bmheight - segwidth/3 + 8, 2*bmwidth/3 - segwidth/2 - 4, segwidth + 8, backpen); | |
| 1457 | draw_segment_vertical(tempbitmap, bmheight/2 + segwidth/3, bmheight - segwidth/3, 2*bmwidth/3 - segwidth/2 - 4, segwidth, (pattern & (1 << 7)) ? onpen : offpen); | |
| 1456 | draw_segment_vertical(tempbitmap, bmheight/2 + segwidth/3 - 2, bmheight - segwidth/3 + 8, 2*bmwidth/3 - segwidth/2 - 4, segwidth + 8, backpen); | |
| 1457 | draw_segment_vertical(tempbitmap, bmheight/2 + segwidth/3, bmheight - segwidth/3, 2*bmwidth/3 - segwidth/2 - 4, segwidth, (pattern & (1 << 7)) ? onpen : offpen); | |
| 1458 | 1458 | |
| 1459 | // apply skew | |
| 1460 | apply_skew(tempbitmap, 40); | |
| 1459 | // apply skew | |
| 1460 | apply_skew(tempbitmap, 40); | |
| 1461 | 1461 | |
| 1462 | // resample to the target size | |
| 1463 | render_resample_argb_bitmap_hq(dest, tempbitmap, m_color); | |
| 1462 | // resample to the target size | |
| 1463 | render_resample_argb_bitmap_hq(dest, tempbitmap, m_color); | |
| 1464 | 1464 | } |
| 1465 | 1465 | |
| 1466 | 1466 | |
| r242631 | r242632 | |
| 1470 | 1470 | |
| 1471 | 1471 | void layout_element::component::draw_led14seg(bitmap_argb32 &dest, const rectangle &bounds, int pattern) |
| 1472 | 1472 | { |
| 1473 | const rgb_t onpen = rgb_t(0xff, 0xff, 0xff, 0xff); | |
| 1474 | const rgb_t offpen = rgb_t(0xff, 0x20, 0x20, 0x20); | |
| 1473 | const rgb_t onpen = rgb_t(0xff, 0xff, 0xff, 0xff); | |
| 1474 | const rgb_t offpen = rgb_t(0xff, 0x20, 0x20, 0x20); | |
| 1475 | 1475 | |
| 1476 | // sizes for computation | |
| 1477 | int bmwidth = 250; | |
| 1478 | int bmheight = 400; | |
| 1479 | int segwidth = 40; | |
| 1480 | int skewwidth = 40; | |
| 1476 | // sizes for computation | |
| 1477 | int bmwidth = 250; | |
| 1478 | int bmheight = 400; | |
| 1479 | int segwidth = 40; | |
| 1480 | int skewwidth = 40; | |
| 1481 | 1481 | |
| 1482 | // allocate a temporary bitmap for drawing | |
| 1483 | bitmap_argb32 tempbitmap(bmwidth + skewwidth, bmheight); | |
| 1484 | tempbitmap.fill(rgb_t(0xff, 0x00, 0x00, 0x00)); | |
| 1482 | // allocate a temporary bitmap for drawing | |
| 1483 | bitmap_argb32 tempbitmap(bmwidth + skewwidth, bmheight); | |
| 1484 | tempbitmap.fill(rgb_t(0xff, 0x00, 0x00, 0x00)); | |
| 1485 | 1485 | |
| 1486 | // top bar | |
| 1487 | draw_segment_horizontal(tempbitmap, | |
| 1488 | 0 + 2*segwidth/3, bmwidth - 2*segwidth/3, 0 + segwidth/2, | |
| 1489 | segwidth, (pattern & (1 << 0)) ? onpen : offpen); | |
| 1486 | // top bar | |
| 1487 | draw_segment_horizontal(tempbitmap, | |
| 1488 | 0 + 2*segwidth/3, bmwidth - 2*segwidth/3, 0 + segwidth/2, | |
| 1489 | segwidth, (pattern & (1 << 0)) ? onpen : offpen); | |
| 1490 | 1490 | |
| 1491 | // right-top bar | |
| 1492 | draw_segment_vertical(tempbitmap, | |
| 1493 | 0 + 2*segwidth/3, bmheight/2 - segwidth/3, bmwidth - segwidth/2, | |
| 1494 | segwidth, (pattern & (1 << 1)) ? onpen : offpen); | |
| 1491 | // right-top bar | |
| 1492 | draw_segment_vertical(tempbitmap, | |
| 1493 | 0 + 2*segwidth/3, bmheight/2 - segwidth/3, bmwidth - segwidth/2, | |
| 1494 | segwidth, (pattern & (1 << 1)) ? onpen : offpen); | |
| 1495 | 1495 | |
| 1496 | // right-bottom bar | |
| 1497 | draw_segment_vertical(tempbitmap, | |
| 1498 | bmheight/2 + segwidth/3, bmheight - 2*segwidth/3, bmwidth - segwidth/2, | |
| 1499 | segwidth, (pattern & (1 << 2)) ? onpen : offpen); | |
| 1496 | // right-bottom bar | |
| 1497 | draw_segment_vertical(tempbitmap, | |
| 1498 | bmheight/2 + segwidth/3, bmheight - 2*segwidth/3, bmwidth - segwidth/2, | |
| 1499 | segwidth, (pattern & (1 << 2)) ? onpen : offpen); | |
| 1500 | 1500 | |
| 1501 | // bottom bar | |
| 1502 | draw_segment_horizontal(tempbitmap, | |
| 1503 | 0 + 2*segwidth/3, bmwidth - 2*segwidth/3, bmheight - segwidth/2, | |
| 1504 | segwidth, (pattern & (1 << 3)) ? onpen : offpen); | |
| 1501 | // bottom bar | |
| 1502 | draw_segment_horizontal(tempbitmap, | |
| 1503 | 0 + 2*segwidth/3, bmwidth - 2*segwidth/3, bmheight - segwidth/2, | |
| 1504 | segwidth, (pattern & (1 << 3)) ? onpen : offpen); | |
| 1505 | 1505 | |
| 1506 | // left-bottom bar | |
| 1507 | draw_segment_vertical(tempbitmap, | |
| 1508 | bmheight/2 + segwidth/3, bmheight - 2*segwidth/3, 0 + segwidth/2, | |
| 1509 | segwidth, (pattern & (1 << 4)) ? onpen : offpen); | |
| 1506 | // left-bottom bar | |
| 1507 | draw_segment_vertical(tempbitmap, | |
| 1508 | bmheight/2 + segwidth/3, bmheight - 2*segwidth/3, 0 + segwidth/2, | |
| 1509 | segwidth, (pattern & (1 << 4)) ? onpen : offpen); | |
| 1510 | 1510 | |
| 1511 | // left-top bar | |
| 1512 | draw_segment_vertical(tempbitmap, | |
| 1513 | 0 + 2*segwidth/3, bmheight/2 - segwidth/3, 0 + segwidth/2, | |
| 1514 | segwidth, (pattern & (1 << 5)) ? onpen : offpen); | |
| 1511 | // left-top bar | |
| 1512 | draw_segment_vertical(tempbitmap, | |
| 1513 | 0 + 2*segwidth/3, bmheight/2 - segwidth/3, 0 + segwidth/2, | |
| 1514 | segwidth, (pattern & (1 << 5)) ? onpen : offpen); | |
| 1515 | 1515 | |
| 1516 | // horizontal-middle-left bar | |
| 1517 | draw_segment_horizontal_caps(tempbitmap, | |
| 1518 | 0 + 2*segwidth/3, bmwidth/2 - segwidth/10, bmheight/2, | |
| 1519 | segwidth, LINE_CAP_START, (pattern & (1 << 6)) ? onpen : offpen); | |
| 1516 | // horizontal-middle-left bar | |
| 1517 | draw_segment_horizontal_caps(tempbitmap, | |
| 1518 | 0 + 2*segwidth/3, bmwidth/2 - segwidth/10, bmheight/2, | |
| 1519 | segwidth, LINE_CAP_START, (pattern & (1 << 6)) ? onpen : offpen); | |
| 1520 | 1520 | |
| 1521 | // horizontal-middle-right bar | |
| 1522 | draw_segment_horizontal_caps(tempbitmap, | |
| 1523 | 0 + bmwidth/2 + segwidth/10, bmwidth - 2*segwidth/3, bmheight/2, | |
| 1524 | segwidth, LINE_CAP_END, (pattern & (1 << 7)) ? onpen : offpen); | |
| 1521 | // horizontal-middle-right bar | |
| 1522 | draw_segment_horizontal_caps(tempbitmap, | |
| 1523 | 0 + bmwidth/2 + segwidth/10, bmwidth - 2*segwidth/3, bmheight/2, | |
| 1524 | segwidth, LINE_CAP_END, (pattern & (1 << 7)) ? onpen : offpen); | |
| 1525 | 1525 | |
| 1526 | // vertical-middle-top bar | |
| 1527 | draw_segment_vertical_caps(tempbitmap, | |
| 1528 | 0 + segwidth + segwidth/3, bmheight/2 - segwidth/2 - segwidth/3, bmwidth/2, | |
| 1529 | segwidth, LINE_CAP_NONE, (pattern & (1 << 8)) ? onpen : offpen); | |
| 1526 | // vertical-middle-top bar | |
| 1527 | draw_segment_vertical_caps(tempbitmap, | |
| 1528 | 0 + segwidth + segwidth/3, bmheight/2 - segwidth/2 - segwidth/3, bmwidth/2, | |
| 1529 | segwidth, LINE_CAP_NONE, (pattern & (1 << 8)) ? onpen : offpen); | |
| 1530 | 1530 | |
| 1531 | // vertical-middle-bottom bar | |
| 1532 | draw_segment_vertical_caps(tempbitmap, | |
| 1533 | bmheight/2 + segwidth/2 + segwidth/3, bmheight - segwidth - segwidth/3, bmwidth/2, | |
| 1534 | segwidth, LINE_CAP_NONE, (pattern & (1 << 9)) ? onpen : offpen); | |
| 1531 | // vertical-middle-bottom bar | |
| 1532 | draw_segment_vertical_caps(tempbitmap, | |
| 1533 | bmheight/2 + segwidth/2 + segwidth/3, bmheight - segwidth - segwidth/3, bmwidth/2, | |
| 1534 | segwidth, LINE_CAP_NONE, (pattern & (1 << 9)) ? onpen : offpen); | |
| 1535 | 1535 | |
| 1536 | // diagonal-left-bottom bar | |
| 1537 | draw_segment_diagonal_1(tempbitmap, | |
| 1538 | 0 + segwidth + segwidth/5, bmwidth/2 - segwidth/2 - segwidth/5, | |
| 1539 | bmheight/2 + segwidth/2 + segwidth/3, bmheight - segwidth - segwidth/3, | |
| 1540 | segwidth, (pattern & (1 << 10)) ? onpen : offpen); | |
| 1536 | // diagonal-left-bottom bar | |
| 1537 | draw_segment_diagonal_1(tempbitmap, | |
| 1538 | 0 + segwidth + segwidth/5, bmwidth/2 - segwidth/2 - segwidth/5, | |
| 1539 | bmheight/2 + segwidth/2 + segwidth/3, bmheight - segwidth - segwidth/3, | |
| 1540 | segwidth, (pattern & (1 << 10)) ? onpen : offpen); | |
| 1541 | 1541 | |
| 1542 | // diagonal-left-top bar | |
| 1543 | draw_segment_diagonal_2(tempbitmap, | |
| 1544 | 0 + segwidth + segwidth/5, bmwidth/2 - segwidth/2 - segwidth/5, | |
| 1545 | 0 + segwidth + segwidth/3, bmheight/2 - segwidth/2 - segwidth/3, | |
| 1546 | segwidth, (pattern & (1 << 11)) ? onpen : offpen); | |
| 1542 | // diagonal-left-top bar | |
| 1543 | draw_segment_diagonal_2(tempbitmap, | |
| 1544 | 0 + segwidth + segwidth/5, bmwidth/2 - segwidth/2 - segwidth/5, | |
| 1545 | 0 + segwidth + segwidth/3, bmheight/2 - segwidth/2 - segwidth/3, | |
| 1546 | segwidth, (pattern & (1 << 11)) ? onpen : offpen); | |
| 1547 | 1547 | |
| 1548 | // diagonal-right-top bar | |
| 1549 | draw_segment_diagonal_1(tempbitmap, | |
| 1550 | bmwidth/2 + segwidth/2 + segwidth/5, bmwidth - segwidth - segwidth/5, | |
| 1551 | 0 + segwidth + segwidth/3, bmheight/2 - segwidth/2 - segwidth/3, | |
| 1552 | segwidth, (pattern & (1 << 12)) ? onpen : offpen); | |
| 1548 | // diagonal-right-top bar | |
| 1549 | draw_segment_diagonal_1(tempbitmap, | |
| 1550 | bmwidth/2 + segwidth/2 + segwidth/5, bmwidth - segwidth - segwidth/5, | |
| 1551 | 0 + segwidth + segwidth/3, bmheight/2 - segwidth/2 - segwidth/3, | |
| 1552 | segwidth, (pattern & (1 << 12)) ? onpen : offpen); | |
| 1553 | 1553 | |
| 1554 | // diagonal-right-bottom bar | |
| 1555 | draw_segment_diagonal_2(tempbitmap, | |
| 1556 | bmwidth/2 + segwidth/2 + segwidth/5, bmwidth - segwidth - segwidth/5, | |
| 1557 | bmheight/2 + segwidth/2 + segwidth/3, bmheight - segwidth - segwidth/3, | |
| 1558 | segwidth, (pattern & (1 << 13)) ? onpen : offpen); | |
| 1554 | // diagonal-right-bottom bar | |
| 1555 | draw_segment_diagonal_2(tempbitmap, | |
| 1556 | bmwidth/2 + segwidth/2 + segwidth/5, bmwidth - segwidth - segwidth/5, | |
| 1557 | bmheight/2 + segwidth/2 + segwidth/3, bmheight - segwidth - segwidth/3, | |
| 1558 | segwidth, (pattern & (1 << 13)) ? onpen : offpen); | |
| 1559 | 1559 | |
| 1560 | // apply skew | |
| 1561 | apply_skew(tempbitmap, 40); | |
| 1560 | // apply skew | |
| 1561 | apply_skew(tempbitmap, 40); | |
| 1562 | 1562 | |
| 1563 | // resample to the target size | |
| 1564 | render_resample_argb_bitmap_hq(dest, tempbitmap, m_color); | |
| 1563 | // resample to the target size | |
| 1564 | render_resample_argb_bitmap_hq(dest, tempbitmap, m_color); | |
| 1565 | 1565 | } |
| 1566 | 1566 | |
| 1567 | 1567 | |
| r242631 | r242632 | |
| 1572 | 1572 | |
| 1573 | 1573 | void layout_element::component::draw_led14segsc(bitmap_argb32 &dest, const rectangle &bounds, int pattern) |
| 1574 | 1574 | { |
| 1575 | const rgb_t onpen = rgb_t(0xff, 0xff, 0xff, 0xff); | |
| 1576 | const rgb_t offpen = rgb_t(0xff, 0x20, 0x20, 0x20); | |
| 1575 | const rgb_t onpen = rgb_t(0xff, 0xff, 0xff, 0xff); | |
| 1576 | const rgb_t offpen = rgb_t(0xff, 0x20, 0x20, 0x20); | |
| 1577 | 1577 | |
| 1578 | // sizes for computation | |
| 1579 | int bmwidth = 250; | |
| 1580 | int bmheight = 400; | |
| 1581 | int segwidth = 40; | |
| 1582 | int skewwidth = 40; | |
| 1578 | // sizes for computation | |
| 1579 | int bmwidth = 250; | |
| 1580 | int bmheight = 400; | |
| 1581 | int segwidth = 40; | |
| 1582 | int skewwidth = 40; | |
| 1583 | 1583 | |
| 1584 | // allocate a temporary bitmap for drawing, adding some extra space for the tail | |
| 1585 | bitmap_argb32 tempbitmap(bmwidth + skewwidth, bmheight + segwidth); | |
| 1586 | tempbitmap.fill(rgb_t(0xff, 0x00, 0x00, 0x00)); | |
| 1584 | // allocate a temporary bitmap for drawing, adding some extra space for the tail | |
| 1585 | bitmap_argb32 tempbitmap(bmwidth + skewwidth, bmheight + segwidth); | |
| 1586 | tempbitmap.fill(rgb_t(0xff, 0x00, 0x00, 0x00)); | |
| 1587 | 1587 | |
| 1588 | // top bar | |
| 1589 | draw_segment_horizontal(tempbitmap, | |
| 1590 | 0 + 2*segwidth/3, bmwidth - 2*segwidth/3, 0 + segwidth/2, | |
| 1591 | segwidth, (pattern & (1 << 0)) ? onpen : offpen); | |
| 1588 | // top bar | |
| 1589 | draw_segment_horizontal(tempbitmap, | |
| 1590 | 0 + 2*segwidth/3, bmwidth - 2*segwidth/3, 0 + segwidth/2, | |
| 1591 | segwidth, (pattern & (1 << 0)) ? onpen : offpen); | |
| 1592 | 1592 | |
| 1593 | // right-top bar | |
| 1594 | draw_segment_vertical(tempbitmap, | |
| 1595 | 0 + 2*segwidth/3, bmheight/2 - segwidth/3, bmwidth - segwidth/2, | |
| 1596 | segwidth, (pattern & (1 << 1)) ? onpen : offpen); | |
| 1593 | // right-top bar | |
| 1594 | draw_segment_vertical(tempbitmap, | |
| 1595 | 0 + 2*segwidth/3, bmheight/2 - segwidth/3, bmwidth - segwidth/2, | |
| 1596 | segwidth, (pattern & (1 << 1)) ? onpen : offpen); | |
| 1597 | 1597 | |
| 1598 | // right-bottom bar | |
| 1599 | draw_segment_vertical(tempbitmap, | |
| 1600 | bmheight/2 + segwidth/3, bmheight - 2*segwidth/3, bmwidth - segwidth/2, | |
| 1601 | segwidth, (pattern & (1 << 2)) ? onpen : offpen); | |
| 1598 | // right-bottom bar | |
| 1599 | draw_segment_vertical(tempbitmap, | |
| 1600 | bmheight/2 + segwidth/3, bmheight - 2*segwidth/3, bmwidth - segwidth/2, | |
| 1601 | segwidth, (pattern & (1 << 2)) ? onpen : offpen); | |
| 1602 | 1602 | |
| 1603 | // bottom bar | |
| 1604 | draw_segment_horizontal(tempbitmap, | |
| 1605 | 0 + 2*segwidth/3, bmwidth - 2*segwidth/3, bmheight - segwidth/2, | |
| 1606 | segwidth, (pattern & (1 << 3)) ? onpen : offpen); | |
| 1603 | // bottom bar | |
| 1604 | draw_segment_horizontal(tempbitmap, | |
| 1605 | 0 + 2*segwidth/3, bmwidth - 2*segwidth/3, bmheight - segwidth/2, | |
| 1606 | segwidth, (pattern & (1 << 3)) ? onpen : offpen); | |
| 1607 | 1607 | |
| 1608 | // left-bottom bar | |
| 1609 | draw_segment_vertical(tempbitmap, | |
| 1610 | bmheight/2 + segwidth/3, bmheight - 2*segwidth/3, 0 + segwidth/2, | |
| 1611 | segwidth, (pattern & (1 << 4)) ? onpen : offpen); | |
| 1608 | // left-bottom bar | |
| 1609 | draw_segment_vertical(tempbitmap, | |
| 1610 | bmheight/2 + segwidth/3, bmheight - 2*segwidth/3, 0 + segwidth/2, | |
| 1611 | segwidth, (pattern & (1 << 4)) ? onpen : offpen); | |
| 1612 | 1612 | |
| 1613 | // left-top bar | |
| 1614 | draw_segment_vertical(tempbitmap, | |
| 1615 | 0 + 2*segwidth/3, bmheight/2 - segwidth/3, 0 + segwidth/2, | |
| 1616 | segwidth, (pattern & (1 << 5)) ? onpen : offpen); | |
| 1613 | // left-top bar | |
| 1614 | draw_segment_vertical(tempbitmap, | |
| 1615 | 0 + 2*segwidth/3, bmheight/2 - segwidth/3, 0 + segwidth/2, | |
| 1616 | segwidth, (pattern & (1 << 5)) ? onpen : offpen); | |
| 1617 | 1617 | |
| 1618 | // horizontal-middle-left bar | |
| 1619 | draw_segment_horizontal_caps(tempbitmap, | |
| 1620 | 0 + 2*segwidth/3, bmwidth/2 - segwidth/10, bmheight/2, | |
| 1621 | segwidth, LINE_CAP_START, (pattern & (1 << 6)) ? onpen : offpen); | |
| 1618 | // horizontal-middle-left bar | |
| 1619 | draw_segment_horizontal_caps(tempbitmap, | |
| 1620 | 0 + 2*segwidth/3, bmwidth/2 - segwidth/10, bmheight/2, | |
| 1621 | segwidth, LINE_CAP_START, (pattern & (1 << 6)) ? onpen : offpen); | |
| 1622 | 1622 | |
| 1623 | // horizontal-middle-right bar | |
| 1624 | draw_segment_horizontal_caps(tempbitmap, | |
| 1625 | 0 + bmwidth/2 + segwidth/10, bmwidth - 2*segwidth/3, bmheight/2, | |
| 1626 | segwidth, LINE_CAP_END, (pattern & (1 << 7)) ? onpen : offpen); | |
| 1623 | // horizontal-middle-right bar | |
| 1624 | draw_segment_horizontal_caps(tempbitmap, | |
| 1625 | 0 + bmwidth/2 + segwidth/10, bmwidth - 2*segwidth/3, bmheight/2, | |
| 1626 | segwidth, LINE_CAP_END, (pattern & (1 << 7)) ? onpen : offpen); | |
| 1627 | 1627 | |
| 1628 | // vertical-middle-top bar | |
| 1629 | draw_segment_vertical_caps(tempbitmap, | |
| 1630 | 0 + segwidth + segwidth/3, bmheight/2 - segwidth/2 - segwidth/3, bmwidth/2, | |
| 1631 | segwidth, LINE_CAP_NONE, (pattern & (1 << 8)) ? onpen : offpen); | |
| 1628 | // vertical-middle-top bar | |
| 1629 | draw_segment_vertical_caps(tempbitmap, | |
| 1630 | 0 + segwidth + segwidth/3, bmheight/2 - segwidth/2 - segwidth/3, bmwidth/2, | |
| 1631 | segwidth, LINE_CAP_NONE, (pattern & (1 << 8)) ? onpen : offpen); | |
| 1632 | 1632 | |
| 1633 | // vertical-middle-bottom bar | |
| 1634 | draw_segment_vertical_caps(tempbitmap, | |
| 1635 | bmheight/2 + segwidth/2 + segwidth/3, bmheight - segwidth - segwidth/3, bmwidth/2, | |
| 1636 | segwidth, LINE_CAP_NONE, (pattern & (1 << 9)) ? onpen : offpen); | |
| 1633 | // vertical-middle-bottom bar | |
| 1634 | draw_segment_vertical_caps(tempbitmap, | |
| 1635 | bmheight/2 + segwidth/2 + segwidth/3, bmheight - segwidth - segwidth/3, bmwidth/2, | |
| 1636 | segwidth, LINE_CAP_NONE, (pattern & (1 << 9)) ? onpen : offpen); | |
| 1637 | 1637 | |
| 1638 | // diagonal-left-bottom bar | |
| 1639 | draw_segment_diagonal_1(tempbitmap, | |
| 1640 | 0 + segwidth + segwidth/5, bmwidth/2 - segwidth/2 - segwidth/5, | |
| 1641 | bmheight/2 + segwidth/2 + segwidth/3, bmheight - segwidth - segwidth/3, | |
| 1642 | segwidth, (pattern & (1 << 10)) ? onpen : offpen); | |
| 1638 | // diagonal-left-bottom bar | |
| 1639 | draw_segment_diagonal_1(tempbitmap, | |
| 1640 | 0 + segwidth + segwidth/5, bmwidth/2 - segwidth/2 - segwidth/5, | |
| 1641 | bmheight/2 + segwidth/2 + segwidth/3, bmheight - segwidth - segwidth/3, | |
| 1642 | segwidth, (pattern & (1 << 10)) ? onpen : offpen); | |
| 1643 | 1643 | |
| 1644 | // diagonal-left-top bar | |
| 1645 | draw_segment_diagonal_2(tempbitmap, | |
| 1646 | 0 + segwidth + segwidth/5, bmwidth/2 - segwidth/2 - segwidth/5, | |
| 1647 | 0 + segwidth + segwidth/3, bmheight/2 - segwidth/2 - segwidth/3, | |
| 1648 | segwidth, (pattern & (1 << 11)) ? onpen : offpen); | |
| 1644 | // diagonal-left-top bar | |
| 1645 | draw_segment_diagonal_2(tempbitmap, | |
| 1646 | 0 + segwidth + segwidth/5, bmwidth/2 - segwidth/2 - segwidth/5, | |
| 1647 | 0 + segwidth + segwidth/3, bmheight/2 - segwidth/2 - segwidth/3, | |
| 1648 | segwidth, (pattern & (1 << 11)) ? onpen : offpen); | |
| 1649 | 1649 | |
| 1650 | // diagonal-right-top bar | |
| 1651 | draw_segment_diagonal_1(tempbitmap, | |
| 1652 | bmwidth/2 + segwidth/2 + segwidth/5, bmwidth - segwidth - segwidth/5, | |
| 1653 | 0 + segwidth + segwidth/3, bmheight/2 - segwidth/2 - segwidth/3, | |
| 1654 | segwidth, (pattern & (1 << 12)) ? onpen : offpen); | |
| 1650 | // diagonal-right-top bar | |
| 1651 | draw_segment_diagonal_1(tempbitmap, | |
| 1652 | bmwidth/2 + segwidth/2 + segwidth/5, bmwidth - segwidth - segwidth/5, | |
| 1653 | 0 + segwidth + segwidth/3, bmheight/2 - segwidth/2 - segwidth/3, | |
| 1654 | segwidth, (pattern & (1 << 12)) ? onpen : offpen); | |
| 1655 | 1655 | |
| 1656 | // diagonal-right-bottom bar | |
| 1657 | draw_segment_diagonal_2(tempbitmap, | |
| 1658 | bmwidth/2 + segwidth/2 + segwidth/5, bmwidth - segwidth - segwidth/5, | |
| 1659 | bmheight/2 + segwidth/2 + segwidth/3, bmheight - segwidth - segwidth/3, | |
| 1660 | segwidth, (pattern & (1 << 13)) ? onpen : offpen); | |
| 1656 | // diagonal-right-bottom bar | |
| 1657 | draw_segment_diagonal_2(tempbitmap, | |
| 1658 | bmwidth/2 + segwidth/2 + segwidth/5, bmwidth - segwidth - segwidth/5, | |
| 1659 | bmheight/2 + segwidth/2 + segwidth/3, bmheight - segwidth - segwidth/3, | |
| 1660 | segwidth, (pattern & (1 << 13)) ? onpen : offpen); | |
| 1661 | 1661 | |
| 1662 | // apply skew | |
| 1663 | apply_skew(tempbitmap, 40); | |
| 1662 | // apply skew | |
| 1663 | apply_skew(tempbitmap, 40); | |
| 1664 | 1664 | |
| 1665 | // comma tail | |
| 1666 | draw_segment_diagonal_1(tempbitmap, | |
| 1667 | bmwidth - (segwidth/2), bmwidth + segwidth, | |
| 1668 | bmheight - (segwidth), bmheight + segwidth*1.5, | |
| 1669 | segwidth/2, (pattern & (1 << 15)) ? onpen : offpen); | |
| 1665 | // comma tail | |
| 1666 | draw_segment_diagonal_1(tempbitmap, | |
| 1667 | bmwidth - (segwidth/2), bmwidth + segwidth, | |
| 1668 | bmheight - (segwidth), bmheight + segwidth*1.5, | |
| 1669 | segwidth/2, (pattern & (1 << 15)) ? onpen : offpen); | |
| 1670 | 1670 | |
| 1671 | // decimal point | |
| 1672 | draw_segment_decimal(tempbitmap, bmwidth + segwidth/2, bmheight - segwidth/2, segwidth, (pattern & (1 << 14)) ? onpen : offpen); | |
| 1671 | // decimal point | |
| 1672 | draw_segment_decimal(tempbitmap, bmwidth + segwidth/2, bmheight - segwidth/2, segwidth, (pattern & (1 << 14)) ? onpen : offpen); | |
| 1673 | 1673 | |
| 1674 | // resample to the target size | |
| 1675 | render_resample_argb_bitmap_hq(dest, tempbitmap, m_color); | |
| 1674 | // resample to the target size | |
| 1675 | render_resample_argb_bitmap_hq(dest, tempbitmap, m_color); | |
| 1676 | 1676 | } |
| 1677 | 1677 | |
| 1678 | 1678 | |
| r242631 | r242632 | |
| 1682 | 1682 | |
| 1683 | 1683 | void layout_element::component::draw_led16seg(bitmap_argb32 &dest, const rectangle &bounds, int pattern) |
| 1684 | 1684 | { |
| 1685 | const rgb_t onpen = rgb_t(0xff, 0xff, 0xff, 0xff); | |
| 1686 | const rgb_t offpen = rgb_t(0xff, 0x20, 0x20, 0x20); | |
| 1685 | const rgb_t onpen = rgb_t(0xff, 0xff, 0xff, 0xff); | |
| 1686 | const rgb_t offpen = rgb_t(0xff, 0x20, 0x20, 0x20); | |
| 1687 | 1687 | |
| 1688 | // sizes for computation | |
| 1689 | int bmwidth = 250; | |
| 1690 | int bmheight = 400; | |
| 1691 | int segwidth = 40; | |
| 1692 | int skewwidth = 40; | |
| 1688 | // sizes for computation | |
| 1689 | int bmwidth = 250; | |
| 1690 | int bmheight = 400; | |
| 1691 | int segwidth = 40; | |
| 1692 | int skewwidth = 40; | |
| 1693 | 1693 | |
| 1694 | // allocate a temporary bitmap for drawing | |
| 1695 | bitmap_argb32 tempbitmap(bmwidth + skewwidth, bmheight); | |
| 1696 | tempbitmap.fill(rgb_t(0xff, 0x00, 0x00, 0x00)); | |
| 1694 | // allocate a temporary bitmap for drawing | |
| 1695 | bitmap_argb32 tempbitmap(bmwidth + skewwidth, bmheight); | |
| 1696 | tempbitmap.fill(rgb_t(0xff, 0x00, 0x00, 0x00)); | |
| 1697 | 1697 | |
| 1698 | // top-left bar | |
| 1699 | draw_segment_horizontal_caps(tempbitmap, | |
| 1700 | 0 + 2*segwidth/3, bmwidth/2 - segwidth/10, 0 + segwidth/2, | |
| 1701 | segwidth, LINE_CAP_START, (pattern & (1 << 0)) ? onpen : offpen); | |
| 1698 | // top-left bar | |
| 1699 | draw_segment_horizontal_caps(tempbitmap, | |
| 1700 | 0 + 2*segwidth/3, bmwidth/2 - segwidth/10, 0 + segwidth/2, | |
| 1701 | segwidth, LINE_CAP_START, (pattern & (1 << 0)) ? onpen : offpen); | |
| 1702 | 1702 | |
| 1703 | // top-right bar | |
| 1704 | draw_segment_horizontal_caps(tempbitmap, | |
| 1705 | 0 + bmwidth/2 + segwidth/10, bmwidth - 2*segwidth/3, 0 + segwidth/2, | |
| 1706 | segwidth, LINE_CAP_END, (pattern & (1 << 1)) ? onpen : offpen); | |
| 1703 | // top-right bar | |
| 1704 | draw_segment_horizontal_caps(tempbitmap, | |
| 1705 | 0 + bmwidth/2 + segwidth/10, bmwidth - 2*segwidth/3, 0 + segwidth/2, | |
| 1706 | segwidth, LINE_CAP_END, (pattern & (1 << 1)) ? onpen : offpen); | |
| 1707 | 1707 | |
| 1708 | // right-top bar | |
| 1709 | draw_segment_vertical(tempbitmap, | |
| 1710 | 0 + 2*segwidth/3, bmheight/2 - segwidth/3, bmwidth - segwidth/2, | |
| 1711 | segwidth, (pattern & (1 << 2)) ? onpen : offpen); | |
| 1708 | // right-top bar | |
| 1709 | draw_segment_vertical(tempbitmap, | |
| 1710 | 0 + 2*segwidth/3, bmheight/2 - segwidth/3, bmwidth - segwidth/2, | |
| 1711 | segwidth, (pattern & (1 << 2)) ? onpen : offpen); | |
| 1712 | 1712 | |
| 1713 | // right-bottom bar | |
| 1714 | draw_segment_vertical(tempbitmap, | |
| 1715 | bmheight/2 + segwidth/3, bmheight - 2*segwidth/3, bmwidth - segwidth/2, | |
| 1716 | segwidth, (pattern & (1 << 3)) ? onpen : offpen); | |
| 1713 | // right-bottom bar | |
| 1714 | draw_segment_vertical(tempbitmap, | |
| 1715 | bmheight/2 + segwidth/3, bmheight - 2*segwidth/3, bmwidth - segwidth/2, | |
| 1716 | segwidth, (pattern & (1 << 3)) ? onpen : offpen); | |
| 1717 | 1717 | |
| 1718 | // bottom-right bar | |
| 1719 | draw_segment_horizontal_caps(tempbitmap, | |
| 1720 | 0 + bmwidth/2 + segwidth/10, bmwidth - 2*segwidth/3, bmheight - segwidth/2, | |
| 1721 | segwidth, LINE_CAP_END, (pattern & (1 << 4)) ? onpen : offpen); | |
| 1718 | // bottom-right bar | |
| 1719 | draw_segment_horizontal_caps(tempbitmap, | |
| 1720 | 0 + bmwidth/2 + segwidth/10, bmwidth - 2*segwidth/3, bmheight - segwidth/2, | |
| 1721 | segwidth, LINE_CAP_END, (pattern & (1 << 4)) ? onpen : offpen); | |
| 1722 | 1722 | |
| 1723 | // bottom-left bar | |
| 1724 | draw_segment_horizontal_caps(tempbitmap, | |
| 1725 | 0 + 2*segwidth/3, bmwidth/2 - segwidth/10, bmheight - segwidth/2, | |
| 1726 | segwidth, LINE_CAP_START, (pattern & (1 << 5)) ? onpen : offpen); | |
| 1723 | // bottom-left bar | |
| 1724 | draw_segment_horizontal_caps(tempbitmap, | |
| 1725 | 0 + 2*segwidth/3, bmwidth/2 - segwidth/10, bmheight - segwidth/2, | |
| 1726 | segwidth, LINE_CAP_START, (pattern & (1 << 5)) ? onpen : offpen); | |
| 1727 | 1727 | |
| 1728 | // left-bottom bar | |
| 1729 | draw_segment_vertical(tempbitmap, | |
| 1730 | bmheight/2 + segwidth/3, bmheight - 2*segwidth/3, 0 + segwidth/2, | |
| 1731 | segwidth, (pattern & (1 << 6)) ? onpen : offpen); | |
| 1728 | // left-bottom bar | |
| 1729 | draw_segment_vertical(tempbitmap, | |
| 1730 | bmheight/2 + segwidth/3, bmheight - 2*segwidth/3, 0 + segwidth/2, | |
| 1731 | segwidth, (pattern & (1 << 6)) ? onpen : offpen); | |
| 1732 | 1732 | |
| 1733 | // left-top bar | |
| 1734 | draw_segment_vertical(tempbitmap, | |
| 1735 | 0 + 2*segwidth/3, bmheight/2 - segwidth/3, 0 + segwidth/2, | |
| 1736 | segwidth, (pattern & (1 << 7)) ? onpen : offpen); | |
| 1733 | // left-top bar | |
| 1734 | draw_segment_vertical(tempbitmap, | |
| 1735 | 0 + 2*segwidth/3, bmheight/2 - segwidth/3, 0 + segwidth/2, | |
| 1736 | segwidth, (pattern & (1 << 7)) ? onpen : offpen); | |
| 1737 | 1737 | |
| 1738 | // horizontal-middle-left bar | |
| 1739 | draw_segment_horizontal_caps(tempbitmap, | |
| 1740 | 0 + 2*segwidth/3, bmwidth/2 - segwidth/10, bmheight/2, | |
| 1741 | segwidth, LINE_CAP_START, (pattern & (1 << 8)) ? onpen : offpen); | |
| 1738 | // horizontal-middle-left bar | |
| 1739 | draw_segment_horizontal_caps(tempbitmap, | |
| 1740 | 0 + 2*segwidth/3, bmwidth/2 - segwidth/10, bmheight/2, | |
| 1741 | segwidth, LINE_CAP_START, (pattern & (1 << 8)) ? onpen : offpen); | |
| 1742 | 1742 | |
| 1743 | // horizontal-middle-right bar | |
| 1744 | draw_segment_horizontal_caps(tempbitmap, | |
| 1745 | 0 + bmwidth/2 + segwidth/10, bmwidth - 2*segwidth/3, bmheight/2, | |
| 1746 | segwidth, LINE_CAP_END, (pattern & (1 << 9)) ? onpen : offpen); | |
| 1743 | // horizontal-middle-right bar | |
| 1744 | draw_segment_horizontal_caps(tempbitmap, | |
| 1745 | 0 + bmwidth/2 + segwidth/10, bmwidth - 2*segwidth/3, bmheight/2, | |
| 1746 | segwidth, LINE_CAP_END, (pattern & (1 << 9)) ? onpen : offpen); | |
| 1747 | 1747 | |
| 1748 | // vertical-middle-top bar | |
| 1749 | draw_segment_vertical_caps(tempbitmap, | |
| 1750 | 0 + segwidth + segwidth/3, bmheight/2 - segwidth/2 - segwidth/3, bmwidth/2, | |
| 1751 | segwidth, LINE_CAP_NONE, (pattern & (1 << 10)) ? onpen : offpen); | |
| 1748 | // vertical-middle-top bar | |
| 1749 | draw_segment_vertical_caps(tempbitmap, | |
| 1750 | 0 + segwidth + segwidth/3, bmheight/2 - segwidth/2 - segwidth/3, bmwidth/2, | |
| 1751 | segwidth, LINE_CAP_NONE, (pattern & (1 << 10)) ? onpen : offpen); | |
| 1752 | 1752 | |
| 1753 | // vertical-middle-bottom bar | |
| 1754 | draw_segment_vertical_caps(tempbitmap, | |
| 1755 | bmheight/2 + segwidth/2 + segwidth/3, bmheight - segwidth - segwidth/3, bmwidth/2, | |
| 1756 | segwidth, LINE_CAP_NONE, (pattern & (1 << 11)) ? onpen : offpen); | |
| 1753 | // vertical-middle-bottom bar | |
| 1754 | draw_segment_vertical_caps(tempbitmap, | |
| 1755 | bmheight/2 + segwidth/2 + segwidth/3, bmheight - segwidth - segwidth/3, bmwidth/2, | |
| 1756 | segwidth, LINE_CAP_NONE, (pattern & (1 << 11)) ? onpen : offpen); | |
| 1757 | 1757 | |
| 1758 | // diagonal-left-bottom bar | |
| 1759 | draw_segment_diagonal_1(tempbitmap, | |
| 1760 | 0 + segwidth + segwidth/5, bmwidth/2 - segwidth/2 - segwidth/5, | |
| 1761 | bmheight/2 + segwidth/2 + segwidth/3, bmheight - segwidth - segwidth/3, | |
| 1762 | segwidth, (pattern & (1 << 12)) ? onpen : offpen); | |
| 1758 | // diagonal-left-bottom bar | |
| 1759 | draw_segment_diagonal_1(tempbitmap, | |
| 1760 | 0 + segwidth + segwidth/5, bmwidth/2 - segwidth/2 - segwidth/5, | |
| 1761 | bmheight/2 + segwidth/2 + segwidth/3, bmheight - segwidth - segwidth/3, | |
| 1762 | segwidth, (pattern & (1 << 12)) ? onpen : offpen); | |
| 1763 | 1763 | |
| 1764 | // diagonal-left-top bar | |
| 1765 | draw_segment_diagonal_2(tempbitmap, | |
| 1766 | 0 + segwidth + segwidth/5, bmwidth/2 - segwidth/2 - segwidth/5, | |
| 1767 | 0 + segwidth + segwidth/3, bmheight/2 - segwidth/2 - segwidth/3, | |
| 1768 | segwidth, (pattern & (1 << 13)) ? onpen : offpen); | |
| 1764 | // diagonal-left-top bar | |
| 1765 | draw_segment_diagonal_2(tempbitmap, | |
| 1766 | 0 + segwidth + segwidth/5, bmwidth/2 - segwidth/2 - segwidth/5, | |
| 1767 | 0 + segwidth + segwidth/3, bmheight/2 - segwidth/2 - segwidth/3, | |
| 1768 | segwidth, (pattern & (1 << 13)) ? onpen : offpen); | |
| 1769 | 1769 | |
| 1770 | // diagonal-right-top bar | |
| 1771 | draw_segment_diagonal_1(tempbitmap, | |
| 1772 | bmwidth/2 + segwidth/2 + segwidth/5, bmwidth - segwidth - segwidth/5, | |
| 1773 | 0 + segwidth + segwidth/3, bmheight/2 - segwidth/2 - segwidth/3, | |
| 1774 | segwidth, (pattern & (1 << 14)) ? onpen : offpen); | |
| 1770 | // diagonal-right-top bar | |
| 1771 | draw_segment_diagonal_1(tempbitmap, | |
| 1772 | bmwidth/2 + segwidth/2 + segwidth/5, bmwidth - segwidth - segwidth/5, | |
| 1773 | 0 + segwidth + segwidth/3, bmheight/2 - segwidth/2 - segwidth/3, | |
| 1774 | segwidth, (pattern & (1 << 14)) ? onpen : offpen); | |
| 1775 | 1775 | |
| 1776 | // diagonal-right-bottom bar | |
| 1777 | draw_segment_diagonal_2(tempbitmap, | |
| 1778 | bmwidth/2 + segwidth/2 + segwidth/5, bmwidth - segwidth - segwidth/5, | |
| 1779 | bmheight/2 + segwidth/2 + segwidth/3, bmheight - segwidth - segwidth/3, | |
| 1780 | segwidth, (pattern & (1 << 15)) ? onpen : offpen); | |
| 1776 | // diagonal-right-bottom bar | |
| 1777 | draw_segment_diagonal_2(tempbitmap, | |
| 1778 | bmwidth/2 + segwidth/2 + segwidth/5, bmwidth - segwidth - segwidth/5, | |
| 1779 | bmheight/2 + segwidth/2 + segwidth/3, bmheight - segwidth - segwidth/3, | |
| 1780 | segwidth, (pattern & (1 << 15)) ? onpen : offpen); | |
| 1781 | 1781 | |
| 1782 | // apply skew | |
| 1783 | apply_skew(tempbitmap, 40); | |
| 1782 | // apply skew | |
| 1783 | apply_skew(tempbitmap, 40); | |
| 1784 | 1784 | |
| 1785 | // resample to the target size | |
| 1786 | render_resample_argb_bitmap_hq(dest, tempbitmap, m_color); | |
| 1785 | // resample to the target size | |
| 1786 | render_resample_argb_bitmap_hq(dest, tempbitmap, m_color); | |
| 1787 | 1787 | } |
| 1788 | 1788 | |
| 1789 | 1789 | |
| r242631 | r242632 | |
| 1794 | 1794 | |
| 1795 | 1795 | void layout_element::component::draw_led16segsc(bitmap_argb32 &dest, const rectangle &bounds, int pattern) |
| 1796 | 1796 | { |
| 1797 | const rgb_t onpen = rgb_t(0xff, 0xff, 0xff, 0xff); | |
| 1798 | const rgb_t offpen = rgb_t(0xff, 0x20, 0x20, 0x20); | |
| 1797 | const rgb_t onpen = rgb_t(0xff, 0xff, 0xff, 0xff); | |
| 1798 | const rgb_t offpen = rgb_t(0xff, 0x20, 0x20, 0x20); | |
| 1799 | 1799 | |
| 1800 | // sizes for computation | |
| 1801 | int bmwidth = 250; | |
| 1802 | int bmheight = 400; | |
| 1803 | int segwidth = 40; | |
| 1804 | int skewwidth = 40; | |
| 1800 | // sizes for computation | |
| 1801 | int bmwidth = 250; | |
| 1802 | int bmheight = 400; | |
| 1803 | int segwidth = 40; | |
| 1804 | int skewwidth = 40; | |
| 1805 | 1805 | |
| 1806 | // allocate a temporary bitmap for drawing | |
| 1807 | bitmap_argb32 tempbitmap(bmwidth + skewwidth, bmheight + segwidth); | |
| 1808 | tempbitmap.fill(rgb_t(0xff, 0x00, 0x00, 0x00)); | |
| 1806 | // allocate a temporary bitmap for drawing | |
| 1807 | bitmap_argb32 tempbitmap(bmwidth + skewwidth, bmheight + segwidth); | |
| 1808 | tempbitmap.fill(rgb_t(0xff, 0x00, 0x00, 0x00)); | |
| 1809 | 1809 | |
| 1810 | // top-left bar | |
| 1811 | draw_segment_horizontal_caps(tempbitmap, | |
| 1812 | 0 + 2*segwidth/3, bmwidth/2 - segwidth/10, 0 + segwidth/2, | |
| 1813 | segwidth, LINE_CAP_START, (pattern & (1 << 0)) ? onpen : offpen); | |
| 1810 | // top-left bar | |
| 1811 | draw_segment_horizontal_caps(tempbitmap, | |
| 1812 | 0 + 2*segwidth/3, bmwidth/2 - segwidth/10, 0 + segwidth/2, | |
| 1813 | segwidth, LINE_CAP_START, (pattern & (1 << 0)) ? onpen : offpen); | |
| 1814 | 1814 | |
| 1815 | // top-right bar | |
| 1816 | draw_segment_horizontal_caps(tempbitmap, | |
| 1817 | 0 + bmwidth/2 + segwidth/10, bmwidth - 2*segwidth/3, 0 + segwidth/2, | |
| 1818 | segwidth, LINE_CAP_END, (pattern & (1 << 1)) ? onpen : offpen); | |
| 1815 | // top-right bar | |
| 1816 | draw_segment_horizontal_caps(tempbitmap, | |
| 1817 | 0 + bmwidth/2 + segwidth/10, bmwidth - 2*segwidth/3, 0 + segwidth/2, | |
| 1818 | segwidth, LINE_CAP_END, (pattern & (1 << 1)) ? onpen : offpen); | |
| 1819 | 1819 | |
| 1820 | // right-top bar | |
| 1821 | draw_segment_vertical(tempbitmap, | |
| 1822 | 0 + 2*segwidth/3, bmheight/2 - segwidth/3, bmwidth - segwidth/2, | |
| 1823 | segwidth, (pattern & (1 << 2)) ? onpen : offpen); | |
| 1820 | // right-top bar | |
| 1821 | draw_segment_vertical(tempbitmap, | |
| 1822 | 0 + 2*segwidth/3, bmheight/2 - segwidth/3, bmwidth - segwidth/2, | |
| 1823 | segwidth, (pattern & (1 << 2)) ? onpen : offpen); | |
| 1824 | 1824 | |
| 1825 | // right-bottom bar | |
| 1826 | draw_segment_vertical(tempbitmap, | |
| 1827 | bmheight/2 + segwidth/3, bmheight - 2*segwidth/3, bmwidth - segwidth/2, | |
| 1828 | segwidth, (pattern & (1 << 3)) ? onpen : offpen); | |
| 1825 | // right-bottom bar | |
| 1826 | draw_segment_vertical(tempbitmap, | |
| 1827 | bmheight/2 + segwidth/3, bmheight - 2*segwidth/3, bmwidth - segwidth/2, | |
| 1828 | segwidth, (pattern & (1 << 3)) ? onpen : offpen); | |
| 1829 | 1829 | |
| 1830 | // bottom-right bar | |
| 1831 | draw_segment_horizontal_caps(tempbitmap, | |
| 1832 | 0 + bmwidth/2 + segwidth/10, bmwidth - 2*segwidth/3, bmheight - segwidth/2, | |
| 1833 | segwidth, LINE_CAP_END, (pattern & (1 << 4)) ? onpen : offpen); | |
| 1830 | // bottom-right bar | |
| 1831 | draw_segment_horizontal_caps(tempbitmap, | |
| 1832 | 0 + bmwidth/2 + segwidth/10, bmwidth - 2*segwidth/3, bmheight - segwidth/2, | |
| 1833 | segwidth, LINE_CAP_END, (pattern & (1 << 4)) ? onpen : offpen); | |
| 1834 | 1834 | |
| 1835 | // bottom-left bar | |
| 1836 | draw_segment_horizontal_caps(tempbitmap, | |
| 1837 | 0 + 2*segwidth/3, bmwidth/2 - segwidth/10, bmheight - segwidth/2, | |
| 1838 | segwidth, LINE_CAP_START, (pattern & (1 << 5)) ? onpen : offpen); | |
| 1835 | // bottom-left bar | |
| 1836 | draw_segment_horizontal_caps(tempbitmap, | |
| 1837 | 0 + 2*segwidth/3, bmwidth/2 - segwidth/10, bmheight - segwidth/2, | |
| 1838 | segwidth, LINE_CAP_START, (pattern & (1 << 5)) ? onpen : offpen); | |
| 1839 | 1839 | |
| 1840 | // left-bottom bar | |
| 1841 | draw_segment_vertical(tempbitmap, | |
| 1842 | bmheight/2 + segwidth/3, bmheight - 2*segwidth/3, 0 + segwidth/2, | |
| 1843 | segwidth, (pattern & (1 << 6)) ? onpen : offpen); | |
| 1840 | // left-bottom bar | |
| 1841 | draw_segment_vertical(tempbitmap, | |
| 1842 | bmheight/2 + segwidth/3, bmheight - 2*segwidth/3, 0 + segwidth/2, | |
| 1843 | segwidth, (pattern & (1 << 6)) ? onpen : offpen); | |
| 1844 | 1844 | |
| 1845 | // left-top bar | |
| 1846 | draw_segment_vertical(tempbitmap, | |
| 1847 | 0 + 2*segwidth/3, bmheight/2 - segwidth/3, 0 + segwidth/2, | |
| 1848 | segwidth, (pattern & (1 << 7)) ? onpen : offpen); | |
| 1845 | // left-top bar | |
| 1846 | draw_segment_vertical(tempbitmap, | |
| 1847 | 0 + 2*segwidth/3, bmheight/2 - segwidth/3, 0 + segwidth/2, | |
| 1848 | segwidth, (pattern & (1 << 7)) ? onpen : offpen); | |
| 1849 | 1849 | |
| 1850 | // horizontal-middle-left bar | |
| 1851 | draw_segment_horizontal_caps(tempbitmap, | |
| 1852 | 0 + 2*segwidth/3, bmwidth/2 - segwidth/10, bmheight/2, | |
| 1853 | segwidth, LINE_CAP_START, (pattern & (1 << 8)) ? onpen : offpen); | |
| 1850 | // horizontal-middle-left bar | |
| 1851 | draw_segment_horizontal_caps(tempbitmap, | |
| 1852 | 0 + 2*segwidth/3, bmwidth/2 - segwidth/10, bmheight/2, | |
| 1853 | segwidth, LINE_CAP_START, (pattern & (1 << 8)) ? onpen : offpen); | |
| 1854 | 1854 | |
| 1855 | // horizontal-middle-right bar | |
| 1856 | draw_segment_horizontal_caps(tempbitmap, | |
| 1857 | 0 + bmwidth/2 + segwidth/10, bmwidth - 2*segwidth/3, bmheight/2, | |
| 1858 | segwidth, LINE_CAP_END, (pattern & (1 << 9)) ? onpen : offpen); | |
| 1855 | // horizontal-middle-right bar | |
| 1856 | draw_segment_horizontal_caps(tempbitmap, | |
| 1857 | 0 + bmwidth/2 + segwidth/10, bmwidth - 2*segwidth/3, bmheight/2, | |
| 1858 | segwidth, LINE_CAP_END, (pattern & (1 << 9)) ? onpen : offpen); | |
| 1859 | 1859 | |
| 1860 | // vertical-middle-top bar | |
| 1861 | draw_segment_vertical_caps(tempbitmap, | |
| 1862 | 0 + segwidth + segwidth/3, bmheight/2 - segwidth/2 - segwidth/3, bmwidth/2, | |
| 1863 | segwidth, LINE_CAP_NONE, (pattern & (1 << 10)) ? onpen : offpen); | |
| 1860 | // vertical-middle-top bar | |
| 1861 | draw_segment_vertical_caps(tempbitmap, | |
| 1862 | 0 + segwidth + segwidth/3, bmheight/2 - segwidth/2 - segwidth/3, bmwidth/2, | |
| 1863 | segwidth, LINE_CAP_NONE, (pattern & (1 << 10)) ? onpen : offpen); | |
| 1864 | 1864 | |
| 1865 | // vertical-middle-bottom bar | |
| 1866 | draw_segment_vertical_caps(tempbitmap, | |
| 1867 | bmheight/2 + segwidth/2 + segwidth/3, bmheight - segwidth - segwidth/3, bmwidth/2, | |
| 1868 | segwidth, LINE_CAP_NONE, (pattern & (1 << 11)) ? onpen : offpen); | |
| 1865 | // vertical-middle-bottom bar | |
| 1866 | draw_segment_vertical_caps(tempbitmap, | |
| 1867 | bmheight/2 + segwidth/2 + segwidth/3, bmheight - segwidth - segwidth/3, bmwidth/2, | |
| 1868 | segwidth, LINE_CAP_NONE, (pattern & (1 << 11)) ? onpen : offpen); | |
| 1869 | 1869 | |
| 1870 | // diagonal-left-bottom bar | |
| 1871 | draw_segment_diagonal_1(tempbitmap, | |
| 1872 | 0 + segwidth + segwidth/5, bmwidth/2 - segwidth/2 - segwidth/5, | |
| 1873 | bmheight/2 + segwidth/2 + segwidth/3, bmheight - segwidth - segwidth/3, | |
| 1874 | segwidth, (pattern & (1 << 12)) ? onpen : offpen); | |
| 1870 | // diagonal-left-bottom bar | |
| 1871 | draw_segment_diagonal_1(tempbitmap, | |
| 1872 | 0 + segwidth + segwidth/5, bmwidth/2 - segwidth/2 - segwidth/5, | |
| 1873 | bmheight/2 + segwidth/2 + segwidth/3, bmheight - segwidth - segwidth/3, | |
| 1874 | segwidth, (pattern & (1 << 12)) ? onpen : offpen); | |
| 1875 | 1875 | |
| 1876 | // diagonal-left-top bar | |
| 1877 | draw_segment_diagonal_2(tempbitmap, | |
| 1878 | 0 + segwidth + segwidth/5, bmwidth/2 - segwidth/2 - segwidth/5, | |
| 1879 | 0 + segwidth + segwidth/3, bmheight/2 - segwidth/2 - segwidth/3, | |
| 1880 | segwidth, (pattern & (1 << 13)) ? onpen : offpen); | |
| 1876 | // diagonal-left-top bar | |
| 1877 | draw_segment_diagonal_2(tempbitmap, | |
| 1878 | 0 + segwidth + segwidth/5, bmwidth/2 - segwidth/2 - segwidth/5, | |
| 1879 | 0 + segwidth + segwidth/3, bmheight/2 - segwidth/2 - segwidth/3, | |
| 1880 | segwidth, (pattern & (1 << 13)) ? onpen : offpen); | |
| 1881 | 1881 | |
| 1882 | // diagonal-right-top bar | |
| 1883 | draw_segment_diagonal_1(tempbitmap, | |
| 1884 | bmwidth/2 + segwidth/2 + segwidth/5, bmwidth - segwidth - segwidth/5, | |
| 1885 | 0 + segwidth + segwidth/3, bmheight/2 - segwidth/2 - segwidth/3, | |
| 1886 | segwidth, (pattern & (1 << 14)) ? onpen : offpen); | |
| 1882 | // diagonal-right-top bar | |
| 1883 | draw_segment_diagonal_1(tempbitmap, | |
| 1884 | bmwidth/2 + segwidth/2 + segwidth/5, bmwidth - segwidth - segwidth/5, | |
| 1885 | 0 + segwidth + segwidth/3, bmheight/2 - segwidth/2 - segwidth/3, | |
| 1886 | segwidth, (pattern & (1 << 14)) ? onpen : offpen); | |
| 1887 | 1887 | |
| 1888 | // diagonal-right-bottom bar | |
| 1889 | draw_segment_diagonal_2(tempbitmap, | |
| 1890 | bmwidth/2 + segwidth/2 + segwidth/5, bmwidth - segwidth - segwidth/5, | |
| 1891 | bmheight/2 + segwidth/2 + segwidth/3, bmheight - segwidth - segwidth/3, | |
| 1892 | segwidth, (pattern & (1 << 15)) ? onpen : offpen); | |
| 1888 | // diagonal-right-bottom bar | |
| 1889 | draw_segment_diagonal_2(tempbitmap, | |
| 1890 | bmwidth/2 + segwidth/2 + segwidth/5, bmwidth - segwidth - segwidth/5, | |
| 1891 | bmheight/2 + segwidth/2 + segwidth/3, bmheight - segwidth - segwidth/3, | |
| 1892 | segwidth, (pattern & (1 << 15)) ? onpen : offpen); | |
| 1893 | 1893 | |
| 1894 | // comma tail | |
| 1895 | draw_segment_diagonal_1(tempbitmap, | |
| 1896 | bmwidth - (segwidth/2), bmwidth + segwidth, | |
| 1897 | bmheight - (segwidth), bmheight + segwidth*1.5, | |
| 1898 | segwidth/2, (pattern & (1 << 17)) ? onpen : offpen); | |
| 1894 | // comma tail | |
| 1895 | draw_segment_diagonal_1(tempbitmap, | |
| 1896 | bmwidth - (segwidth/2), bmwidth + segwidth, | |
| 1897 | bmheight - (segwidth), bmheight + segwidth*1.5, | |
| 1898 | segwidth/2, (pattern & (1 << 17)) ? onpen : offpen); | |
| 1899 | 1899 | |
| 1900 | // decimal point (draw last for priority) | |
| 1901 | draw_segment_decimal(tempbitmap, bmwidth + segwidth/2, bmheight - segwidth/2, segwidth, (pattern & (1 << 16)) ? onpen : offpen); | |
| 1900 | // decimal point (draw last for priority) | |
| 1901 | draw_segment_decimal(tempbitmap, bmwidth + segwidth/2, bmheight - segwidth/2, segwidth, (pattern & (1 << 16)) ? onpen : offpen); | |
| 1902 | 1902 | |
| 1903 | // apply skew | |
| 1904 | apply_skew(tempbitmap, 40); | |
| 1903 | // apply skew | |
| 1904 | apply_skew(tempbitmap, 40); | |
| 1905 | 1905 | |
| 1906 | // resample to the target size | |
| 1907 | render_resample_argb_bitmap_hq(dest, tempbitmap, m_color); | |
| 1906 | // resample to the target size | |
| 1907 | render_resample_argb_bitmap_hq(dest, tempbitmap, m_color); | |
| 1908 | 1908 | } |
| 1909 | 1909 | |
| 1910 | 1910 | |
| r242631 | r242632 | |
| 1915 | 1915 | |
| 1916 | 1916 | void layout_element::component::draw_dotmatrix(int dots, bitmap_argb32 &dest, const rectangle &bounds, int pattern) |
| 1917 | 1917 | { |
| 1918 | const rgb_t onpen = rgb_t(0xff, 0xff, 0xff, 0xff); | |
| 1919 | const rgb_t offpen = rgb_t(0xff, 0x20, 0x20, 0x20); | |
| 1918 | const rgb_t onpen = rgb_t(0xff, 0xff, 0xff, 0xff); | |
| 1919 | const rgb_t offpen = rgb_t(0xff, 0x20, 0x20, 0x20); | |
| 1920 | 1920 | |
| 1921 | // sizes for computation | |
| 1922 | int bmheight = 300; | |
| 1923 | int dotwidth = 250; | |
| 1921 | // sizes for computation | |
| 1922 | int bmheight = 300; | |
| 1923 | int dotwidth = 250; | |
| 1924 | 1924 | |
| 1925 | // allocate a temporary bitmap for drawing | |
| 1926 | bitmap_argb32 tempbitmap(dotwidth*dots, bmheight); | |
| 1927 | tempbitmap.fill(rgb_t(0xff, 0x00, 0x00, 0x00)); | |
| 1925 | // allocate a temporary bitmap for drawing | |
| 1926 | bitmap_argb32 tempbitmap(dotwidth*dots, bmheight); | |
| 1927 | tempbitmap.fill(rgb_t(0xff, 0x00, 0x00, 0x00)); | |
| 1928 | 1928 | |
| 1929 | for (int i = 0; i < dots; i++) | |
| 1930 | draw_segment_decimal(tempbitmap, ((dotwidth/2 )+ (i * dotwidth)), bmheight/2, dotwidth, (pattern & (1 << i))?onpen:offpen); | |
| 1929 | for (int i = 0; i < dots; i++) | |
| 1930 | draw_segment_decimal(tempbitmap, ((dotwidth/2 )+ (i * dotwidth)), bmheight/2, dotwidth, (pattern & (1 << i))?onpen:offpen); | |
| 1931 | 1931 | |
| 1932 | // resample to the target size | |
| 1933 | render_resample_argb_bitmap_hq(dest, tempbitmap, m_color); | |
| 1932 | // resample to the target size | |
| 1933 | render_resample_argb_bitmap_hq(dest, tempbitmap, m_color); | |
| 1934 | 1934 | } |
| 1935 | 1935 | |
| 1936 | 1936 | |
| r242631 | r242632 | |
| 1942 | 1942 | |
| 1943 | 1943 | void layout_element::component::draw_segment_horizontal_caps(bitmap_argb32 &dest, int minx, int maxx, int midy, int width, int caps, rgb_t color) |
| 1944 | 1944 | { |
| 1945 | // loop over the width of the segment | |
| 1946 | for (int y = 0; y < width / 2; y++) | |
| 1947 | { | |
| 1948 | UINT32 *d0 = &dest.pix32(midy - y); | |
| 1949 | UINT32 *d1 = &dest.pix32(midy + y); | |
| 1950 | int ty = (y < width / 8) ? width / 8 : y; | |
| 1945 | // loop over the width of the segment | |
| 1946 | for (int y = 0; y < width / 2; y++) | |
| 1947 | { | |
| 1948 | UINT32 *d0 = &dest.pix32(midy - y); | |
| 1949 | UINT32 *d1 = &dest.pix32(midy + y); | |
| 1950 | int ty = (y < width / 8) ? width / 8 : y; | |
| 1951 | 1951 | |
| 1952 | // loop over the length of the segment | |
| 1953 | for (int x = minx + ((caps & LINE_CAP_START) ? ty : 0); x < maxx - ((caps & LINE_CAP_END) ? ty : 0); x++) | |
| 1954 | d0[x] = d1[x] = color; | |
| 1955 | } | |
| 1952 | // loop over the length of the segment | |
| 1953 | for (int x = minx + ((caps & LINE_CAP_START) ? ty : 0); x < maxx - ((caps & LINE_CAP_END) ? ty : 0); x++) | |
| 1954 | d0[x] = d1[x] = color; | |
| 1955 | } | |
| 1956 | 1956 | } |
| 1957 | 1957 | |
| 1958 | 1958 | |
| r242631 | r242632 | |
| 1963 | 1963 | |
| 1964 | 1964 | void layout_element::component::draw_segment_horizontal(bitmap_argb32 &dest, int minx, int maxx, int midy, int width, rgb_t color) |
| 1965 | 1965 | { |
| 1966 | ||
| 1966 | draw_segment_horizontal_caps(dest, minx, maxx, midy, width, LINE_CAP_START | LINE_CAP_END, color); | |
| 1967 | 1967 | } |
| 1968 | 1968 | |
| 1969 | 1969 | |
| r242631 | r242632 | |
| 1975 | 1975 | |
| 1976 | 1976 | void layout_element::component::draw_segment_vertical_caps(bitmap_argb32 &dest, int miny, int maxy, int midx, int width, int caps, rgb_t color) |
| 1977 | 1977 | { |
| 1978 | // loop over the width of the segment | |
| 1979 | for (int x = 0; x < width / 2; x++) | |
| 1980 | { | |
| 1981 | UINT32 *d0 = &dest.pix32(0, midx - x); | |
| 1982 | UINT32 *d1 = &dest.pix32(0, midx + x); | |
| 1983 | int tx = (x < width / 8) ? width / 8 : x; | |
| 1978 | // loop over the width of the segment | |
| 1979 | for (int x = 0; x < width / 2; x++) | |
| 1980 | { | |
| 1981 | UINT32 *d0 = &dest.pix32(0, midx - x); | |
| 1982 | UINT32 *d1 = &dest.pix32(0, midx + x); | |
| 1983 | int tx = (x < width / 8) ? width / 8 : x; | |
| 1984 | 1984 | |
| 1985 | // loop over the length of the segment | |
| 1986 | for (int y = miny + ((caps & LINE_CAP_START) ? tx : 0); y < maxy - ((caps & LINE_CAP_END) ? tx : 0); y++) | |
| 1987 | d0[y * dest.rowpixels()] = d1[y * dest.rowpixels()] = color; | |
| 1988 | } | |
| 1985 | // loop over the length of the segment | |
| 1986 | for (int y = miny + ((caps & LINE_CAP_START) ? tx : 0); y < maxy - ((caps & LINE_CAP_END) ? tx : 0); y++) | |
| 1987 | d0[y * dest.rowpixels()] = d1[y * dest.rowpixels()] = color; | |
| 1988 | } | |
| 1989 | 1989 | } |
| 1990 | 1990 | |
| 1991 | 1991 | |
| r242631 | r242632 | |
| 1996 | 1996 | |
| 1997 | 1997 | void layout_element::component::draw_segment_vertical(bitmap_argb32 &dest, int miny, int maxy, int midx, int width, rgb_t color) |
| 1998 | 1998 | { |
| 1999 | ||
| 1999 | draw_segment_vertical_caps(dest, miny, maxy, midx, width, LINE_CAP_START | LINE_CAP_END, color); | |
| 2000 | 2000 | } |
| 2001 | 2001 | |
| 2002 | 2002 | |
| r242631 | r242632 | |
| 2007 | 2007 | |
| 2008 | 2008 | void layout_element::component::draw_segment_diagonal_1(bitmap_argb32 &dest, int minx, int maxx, int miny, int maxy, int width, rgb_t color) |
| 2009 | 2009 | { |
| 2010 | // compute parameters | |
| 2011 | width *= 1.5; | |
| 2012 | float ratio = (maxy - miny - width) / (float)(maxx - minx); | |
| 2010 | // compute parameters | |
| 2011 | width *= 1.5; | |
| 2012 | float ratio = (maxy - miny - width) / (float)(maxx - minx); | |
| 2013 | 2013 | |
| 2014 | // draw line | |
| 2015 | for (int x = minx; x < maxx; x++) | |
| 2016 | if (x >= 0 && x < dest.width()) | |
| 2017 | { | |
| 2018 | UINT32 *d = &dest.pix32(0, x); | |
| 2019 | int step = (x - minx) * ratio; | |
| 2014 | // draw line | |
| 2015 | for (int x = minx; x < maxx; x++) | |
| 2016 | if (x >= 0 && x < dest.width()) | |
| 2017 | { | |
| 2018 | UINT32 *d = &dest.pix32(0, x); | |
| 2019 | int step = (x - minx) * ratio; | |
| 2020 | 2020 | |
| 2021 | for (int y = maxy - width - step; y < maxy - step; y++) | |
| 2022 | if (y >= 0 && y < dest.height()) | |
| 2023 | d[y * dest.rowpixels()] = color; | |
| 2024 | } | |
| 2021 | for (int y = maxy - width - step; y < maxy - step; y++) | |
| 2022 | if (y >= 0 && y < dest.height()) | |
| 2023 | d[y * dest.rowpixels()] = color; | |
| 2024 | } | |
| 2025 | 2025 | } |
| 2026 | 2026 | |
| 2027 | 2027 | |
| r242631 | r242632 | |
| 2032 | 2032 | |
| 2033 | 2033 | void layout_element::component::draw_segment_diagonal_2(bitmap_argb32 &dest, int minx, int maxx, int miny, int maxy, int width, rgb_t color) |
| 2034 | 2034 | { |
| 2035 | // compute parameters | |
| 2036 | width *= 1.5; | |
| 2037 | float ratio = (maxy - miny - width) / (float)(maxx - minx); | |
| 2035 | // compute parameters | |
| 2036 | width *= 1.5; | |
| 2037 | float ratio = (maxy - miny - width) / (float)(maxx - minx); | |
| 2038 | 2038 | |
| 2039 | // draw line | |
| 2040 | for (int x = minx; x < maxx; x++) | |
| 2041 | if (x >= 0 && x < dest.width()) | |
| 2042 | { | |
| 2043 | UINT32 *d = &dest.pix32(0, x); | |
| 2044 | int step = (x - minx) * ratio; | |
| 2039 | // draw line | |
| 2040 | for (int x = minx; x < maxx; x++) | |
| 2041 | if (x >= 0 && x < dest.width()) | |
| 2042 | { | |
| 2043 | UINT32 *d = &dest.pix32(0, x); | |
| 2044 | int step = (x - minx) * ratio; | |
| 2045 | 2045 | |
| 2046 | for (int y = miny + step; y < miny + step + width; y++) | |
| 2047 | if (y >= 0 && y < dest.height()) | |
| 2048 | d[y * dest.rowpixels()] = color; | |
| 2049 | } | |
| 2046 | for (int y = miny + step; y < miny + step + width; y++) | |
| 2047 | if (y >= 0 && y < dest.height()) | |
| 2048 | d[y * dest.rowpixels()] = color; | |
| 2049 | } | |
| 2050 | 2050 | } |
| 2051 | 2051 | |
| 2052 | 2052 | |
| r242631 | r242632 | |
| 2056 | 2056 | |
| 2057 | 2057 | void layout_element::component::draw_segment_decimal(bitmap_argb32 &dest, int midx, int midy, int width, rgb_t color) |
| 2058 | 2058 | { |
| 2059 | // compute parameters | |
| 2060 | width /= 2; | |
| 2061 | float ooradius2 = 1.0f / (float)(width * width); | |
| 2059 | // compute parameters | |
| 2060 | width /= 2; | |
| 2061 | float ooradius2 = 1.0f / (float)(width * width); | |
| 2062 | 2062 | |
| 2063 | // iterate over y | |
| 2064 | for (UINT32 y = 0; y <= width; y++) | |
| 2065 | { | |
| 2066 | UINT32 *d0 = &dest.pix32(midy - y); | |
| 2067 | UINT32 *d1 = &dest.pix32(midy + y); | |
| 2068 | float xval = width * sqrt(1.0f - (float)(y * y) * ooradius2); | |
| 2069 | INT32 left, right; | |
| 2063 | // iterate over y | |
| 2064 | for (UINT32 y = 0; y <= width; y++) | |
| 2065 | { | |
| 2066 | UINT32 *d0 = &dest.pix32(midy - y); | |
| 2067 | UINT32 *d1 = &dest.pix32(midy + y); | |
| 2068 | float xval = width * sqrt(1.0f - (float)(y * y) * ooradius2); | |
| 2069 | INT32 left, right; | |
| 2070 | 2070 | |
| 2071 | // compute left/right coordinates | |
| 2072 | left = midx - (INT32)(xval + 0.5f); | |
| 2073 | right = midx + (INT32)(xval + 0.5f); | |
| 2071 | // compute left/right coordinates | |
| 2072 | left = midx - (INT32)(xval + 0.5f); | |
| 2073 | right = midx + (INT32)(xval + 0.5f); | |
| 2074 | 2074 | |
| 2075 | // draw this scanline | |
| 2076 | for (UINT32 x = left; x < right; x++) | |
| 2077 | d0[x] = d1[x] = color; | |
| 2078 | } | |
| 2075 | // draw this scanline | |
| 2076 | for (UINT32 x = left; x < right; x++) | |
| 2077 | d0[x] = d1[x] = color; | |
| 2078 | } | |
| 2079 | 2079 | } |
| 2080 | 2080 | |
| 2081 | 2081 | |
| r242631 | r242632 | |
| 2085 | 2085 | |
| 2086 | 2086 | void layout_element::component::draw_segment_comma(bitmap_argb32 &dest, int minx, int maxx, int miny, int maxy, int width, rgb_t color) |
| 2087 | 2087 | { |
| 2088 | // compute parameters | |
| 2089 | width *= 1.5; | |
| 2090 | float ratio = (maxy - miny - width) / (float)(maxx - minx); | |
| 2088 | // compute parameters | |
| 2089 | width *= 1.5; | |
| 2090 | float ratio = (maxy - miny - width) / (float)(maxx - minx); | |
| 2091 | 2091 | |
| 2092 | // draw line | |
| 2093 | for (int x = minx; x < maxx; x++) | |
| 2094 | { | |
| 2095 | UINT32 *d = &dest.pix32(0, x); | |
| 2096 | int step = (x - minx) * ratio; | |
| 2092 | // draw line | |
| 2093 | for (int x = minx; x < maxx; x++) | |
| 2094 | { | |
| 2095 | UINT32 *d = &dest.pix32(0, x); | |
| 2096 | int step = (x - minx) * ratio; | |
| 2097 | 2097 | |
| 2098 | for (int y = maxy; y < maxy - width - step; y--) | |
| 2099 | d[y * dest.rowpixels()] = color; | |
| 2100 | } | |
| 2098 | for (int y = maxy; y < maxy - width - step; y--) | |
| 2099 | d[y * dest.rowpixels()] = color; | |
| 2100 | } | |
| 2101 | 2101 | } |
| 2102 | 2102 | |
| 2103 | 2103 | |
| r242631 | r242632 | |
| 2107 | 2107 | |
| 2108 | 2108 | void layout_element::component::apply_skew(bitmap_argb32 &dest, int skewwidth) |
| 2109 | 2109 | { |
| 2110 | for (int y = 0; y < dest.height(); y++) | |
| 2111 | { | |
| 2112 | UINT32 *destrow = &dest.pix32(y); | |
| 2113 | int offs = skewwidth * (dest.height() - y) / dest.height(); | |
| 2114 | for (int x = dest.width() - skewwidth - 1; x >= 0; x--) | |
| 2115 | destrow[x + offs] = destrow[x]; | |
| 2116 | for (int x = 0; x < offs; x++) | |
| 2117 | destrow[x] = 0; | |
| 2118 | } | |
| 2110 | for (int y = 0; y < dest.height(); y++) | |
| 2111 | { | |
| 2112 | UINT32 *destrow = &dest.pix32(y); | |
| 2113 | int offs = skewwidth * (dest.height() - y) / dest.height(); | |
| 2114 | for (int x = dest.width() - skewwidth - 1; x >= 0; x--) | |
| 2115 | destrow[x + offs] = destrow[x]; | |
| 2116 | for (int x = 0; x < offs; x++) | |
| 2117 | destrow[x] = 0; | |
| 2118 | } | |
| 2119 | 2119 | } |
| 2120 | 2120 | |
| 2121 | 2121 | |
| r242631 | r242632 | |
| 2129 | 2129 | //------------------------------------------------- |
| 2130 | 2130 | |
| 2131 | 2131 | layout_view::layout_view(running_machine &machine, xml_data_node &viewnode, simple_list<layout_element> &elemlist) |
| 2132 | : m_next(NULL), | |
| 2133 | m_aspect(1.0f), | |
| 2134 | m_scraspect(1.0f) | |
| 2132 | : m_next(NULL), | |
| 2133 | m_aspect(1.0f), | |
| 2134 | m_scraspect(1.0f) | |
| 2135 | 2135 | { |
| 2136 | // allocate a copy of the name | |
| 2137 | m_name = xml_get_attribute_string_with_subst(machine, viewnode, "name", ""); | |
| 2136 | // allocate a copy of the name | |
| 2137 | m_name = xml_get_attribute_string_with_subst(machine, viewnode, "name", ""); | |
| 2138 | 2138 | |
| 2139 | // if we have a bounds item, load it | |
| 2140 | xml_data_node *boundsnode = xml_get_sibling(viewnode.child, "bounds"); | |
| 2141 | m_expbounds.x0 = m_expbounds.y0 = m_expbounds.x1 = m_expbounds.y1 = 0; | |
| 2142 | if (boundsnode != NULL) | |
| 2143 | parse_bounds(machine, xml_get_sibling(boundsnode, "bounds"), m_expbounds); | |
| 2139 | // if we have a bounds item, load it | |
| 2140 | xml_data_node *boundsnode = xml_get_sibling(viewnode.child, "bounds"); | |
| 2141 | m_expbounds.x0 = m_expbounds.y0 = m_expbounds.x1 = m_expbounds.y1 = 0; | |
| 2142 | if (boundsnode != NULL) | |
| 2143 | parse_bounds(machine, xml_get_sibling(boundsnode, "bounds"), m_expbounds); | |
| 2144 | 2144 | |
| 2145 | // load backdrop items | |
| 2146 | for (xml_data_node *itemnode = xml_get_sibling(viewnode.child, "backdrop"); itemnode != NULL; itemnode = xml_get_sibling(itemnode->next, "backdrop")) | |
| 2147 | m_backdrop_list.append(*global_alloc(item(machine, *itemnode, elemlist))); | |
| 2145 | // load backdrop items | |
| 2146 | for (xml_data_node *itemnode = xml_get_sibling(viewnode.child, "backdrop"); itemnode != NULL; itemnode = xml_get_sibling(itemnode->next, "backdrop")) | |
| 2147 | m_backdrop_list.append(*global_alloc(item(machine, *itemnode, elemlist))); | |
| 2148 | 2148 | |
| 2149 | // load screen items | |
| 2150 | for (xml_data_node *itemnode = xml_get_sibling(viewnode.child, "screen"); itemnode != NULL; itemnode = xml_get_sibling(itemnode->next, "screen")) | |
| 2151 | m_screen_list.append(*global_alloc(item(machine, *itemnode, elemlist))); | |
| 2149 | // load screen items | |
| 2150 | for (xml_data_node *itemnode = xml_get_sibling(viewnode.child, "screen"); itemnode != NULL; itemnode = xml_get_sibling(itemnode->next, "screen")) | |
| 2151 | m_screen_list.append(*global_alloc(item(machine, *itemnode, elemlist))); | |
| 2152 | 2152 | |
| 2153 | // load overlay items | |
| 2154 | for (xml_data_node *itemnode = xml_get_sibling(viewnode.child, "overlay"); itemnode != NULL; itemnode = xml_get_sibling(itemnode->next, "overlay")) | |
| 2155 | m_overlay_list.append(*global_alloc(item(machine, *itemnode, elemlist))); | |
| 2153 | // load overlay items | |
| 2154 | for (xml_data_node *itemnode = xml_get_sibling(viewnode.child, "overlay"); itemnode != NULL; itemnode = xml_get_sibling(itemnode->next, "overlay")) | |
| 2155 | m_overlay_list.append(*global_alloc(item(machine, *itemnode, elemlist))); | |
| 2156 | 2156 | |
| 2157 | // load bezel items | |
| 2158 | for (xml_data_node *itemnode = xml_get_sibling(viewnode.child, "bezel"); itemnode != NULL; itemnode = xml_get_sibling(itemnode->next, "bezel")) | |
| 2159 | m_bezel_list.append(*global_alloc(item(machine, *itemnode, elemlist))); | |
| 2157 | // load bezel items | |
| 2158 | for (xml_data_node *itemnode = xml_get_sibling(viewnode.child, "bezel"); itemnode != NULL; itemnode = xml_get_sibling(itemnode->next, "bezel")) | |
| 2159 | m_bezel_list.append(*global_alloc(item(machine, *itemnode, elemlist))); | |
| 2160 | 2160 | |
| 2161 | // load cpanel items | |
| 2162 | for (xml_data_node *itemnode = xml_get_sibling(viewnode.child, "cpanel"); itemnode != NULL; itemnode = xml_get_sibling(itemnode->next, "cpanel")) | |
| 2163 | m_cpanel_list.append(*global_alloc(item(machine, *itemnode, elemlist))); | |
| 2161 | // load cpanel items | |
| 2162 | for (xml_data_node *itemnode = xml_get_sibling(viewnode.child, "cpanel"); itemnode != NULL; itemnode = xml_get_sibling(itemnode->next, "cpanel")) | |
| 2163 | m_cpanel_list.append(*global_alloc(item(machine, *itemnode, elemlist))); | |
| 2164 | 2164 | |
| 2165 | // load marquee items | |
| 2166 | for (xml_data_node *itemnode = xml_get_sibling(viewnode.child, "marquee"); itemnode != NULL; itemnode = xml_get_sibling(itemnode->next, "marquee")) | |
| 2167 | m_marquee_list.append(*global_alloc(item(machine, *itemnode, elemlist))); | |
| 2165 | // load marquee items | |
| 2166 | for (xml_data_node *itemnode = xml_get_sibling(viewnode.child, "marquee"); itemnode != NULL; itemnode = xml_get_sibling(itemnode->next, "marquee")) | |
| 2167 | m_marquee_list.append(*global_alloc(item(machine, *itemnode, elemlist))); | |
| 2168 | 2168 | |
| 2169 | // recompute the data for the view based on a default layer config | |
| 2170 | recompute(render_layer_config()); | |
| 2169 | // recompute the data for the view based on a default layer config | |
| 2170 | recompute(render_layer_config()); | |
| 2171 | 2171 | } |
| 2172 | 2172 | |
| 2173 | 2173 | |
| r242631 | r242632 | |
| 2187 | 2187 | |
| 2188 | 2188 | layout_view::item *layout_view::first_item(item_layer layer) const |
| 2189 | 2189 | { |
| 2190 | switch (layer) | |
| 2191 | { | |
| 2192 | case ITEM_LAYER_BACKDROP: return m_backdrop_list.first(); | |
| 2193 | case ITEM_LAYER_SCREEN: return m_screen_list.first(); | |
| 2194 | case ITEM_LAYER_OVERLAY: return m_overlay_list.first(); | |
| 2195 | case ITEM_LAYER_BEZEL: return m_bezel_list.first(); | |
| 2196 | case ITEM_LAYER_CPANEL: return m_cpanel_list.first(); | |
| 2197 | case ITEM_LAYER_MARQUEE: return m_marquee_list.first(); | |
| 2198 | default: return NULL; | |
| 2199 | } | |
| 2190 | switch (layer) | |
| 2191 | { | |
| 2192 | case ITEM_LAYER_BACKDROP: return m_backdrop_list.first(); | |
| 2193 | case ITEM_LAYER_SCREEN: return m_screen_list.first(); | |
| 2194 | case ITEM_LAYER_OVERLAY: return m_overlay_list.first(); | |
| 2195 | case ITEM_LAYER_BEZEL: return m_bezel_list.first(); | |
| 2196 | case ITEM_LAYER_CPANEL: return m_cpanel_list.first(); | |
| 2197 | case ITEM_LAYER_MARQUEE: return m_marquee_list.first(); | |
| 2198 | default: return NULL; | |
| 2199 | } | |
| 2200 | 2200 | } |
| 2201 | 2201 | |
| 2202 | 2202 | |
| r242631 | r242632 | |
| 2207 | 2207 | |
| 2208 | 2208 | void layout_view::recompute(render_layer_config layerconfig) |
| 2209 | 2209 | { |
| 2210 | // reset the bounds | |
| 2211 | m_bounds.x0 = m_bounds.y0 = m_bounds.x1 = m_bounds.y1 = 0.0f; | |
| 2212 | m_scrbounds.x0 = m_scrbounds.y0 = m_scrbounds.x1 = m_scrbounds.y1 = 0.0f; | |
| 2213 | m_screens.reset(); | |
| 2210 | // reset the bounds | |
| 2211 | m_bounds.x0 = m_bounds.y0 = m_bounds.x1 = m_bounds.y1 = 0.0f; | |
| 2212 | m_scrbounds.x0 = m_scrbounds.y0 = m_scrbounds.x1 = m_scrbounds.y1 = 0.0f; | |
| 2213 | m_screens.reset(); | |
| 2214 | 2214 | |
| 2215 | // loop over all layers | |
| 2216 | bool first = true; | |
| 2217 | bool scrfirst = true; | |
| 2218 | for (item_layer layer = ITEM_LAYER_FIRST; layer < ITEM_LAYER_MAX; layer++) | |
| 2219 | { | |
| 2220 | // determine if this layer should be visible | |
| 2221 | switch (layer) | |
| 2222 | { | |
| 2223 | case ITEM_LAYER_BACKDROP: m_layenabled[layer] = layerconfig.backdrops_enabled(); break; | |
| 2224 | case ITEM_LAYER_OVERLAY: m_layenabled[layer] = layerconfig.overlays_enabled(); break; | |
| 2225 | case ITEM_LAYER_BEZEL: m_layenabled[layer] = layerconfig.bezels_enabled(); break; | |
| 2226 | case ITEM_LAYER_CPANEL: m_layenabled[layer] = layerconfig.cpanels_enabled(); break; | |
| 2227 | case ITEM_LAYER_MARQUEE: m_layenabled[layer] = layerconfig.marquees_enabled(); break; | |
| 2228 | default: m_layenabled[layer] = true; break; | |
| 2229 | } | |
| 2215 | // loop over all layers | |
| 2216 | bool first = true; | |
| 2217 | bool scrfirst = true; | |
| 2218 | for (item_layer layer = ITEM_LAYER_FIRST; layer < ITEM_LAYER_MAX; layer++) | |
| 2219 | { | |
| 2220 | // determine if this layer should be visible | |
| 2221 | switch (layer) | |
| 2222 | { | |
| 2223 | case ITEM_LAYER_BACKDROP: m_layenabled[layer] = layerconfig.backdrops_enabled(); break; | |
| 2224 | case ITEM_LAYER_OVERLAY: m_layenabled[layer] = layerconfig.overlays_enabled(); break; | |
| 2225 | case ITEM_LAYER_BEZEL: m_layenabled[layer] = layerconfig.bezels_enabled(); break; | |
| 2226 | case ITEM_LAYER_CPANEL: m_layenabled[layer] = layerconfig.cpanels_enabled(); break; | |
| 2227 | case ITEM_LAYER_MARQUEE: m_layenabled[layer] = layerconfig.marquees_enabled(); break; | |
| 2228 | default: m_layenabled[layer] = true; break; | |
| 2229 | } | |
| 2230 | 2230 | |
| 2231 | // only do it if requested | |
| 2232 | if (m_layenabled[layer]) | |
| 2233 | for (item *curitem = first_item(layer); curitem != NULL; curitem = curitem->next()) | |
| 2234 | { | |
| 2235 | // accumulate bounds | |
| 2236 | if (first) | |
| 2237 | m_bounds = curitem->m_rawbounds; | |
| 2238 | else | |
| 2239 | union_render_bounds(&m_bounds, &curitem->m_rawbounds); | |
| 2240 | first = false; | |
| 2231 | // only do it if requested | |
| 2232 | if (m_layenabled[layer]) | |
| 2233 | for (item *curitem = first_item(layer); curitem != NULL; curitem = curitem->next()) | |
| 2234 | { | |
| 2235 | // accumulate bounds | |
| 2236 | if (first) | |
| 2237 | m_bounds = curitem->m_rawbounds; | |
| 2238 | else | |
| 2239 | union_render_bounds(&m_bounds, &curitem->m_rawbounds); | |
| 2240 | first = false; | |
| 2241 | 2241 | |
| 2242 | // accumulate screen bounds | |
| 2243 | if (curitem->m_screen != NULL) | |
| 2244 | { | |
| 2245 | if (scrfirst) | |
| 2246 | m_scrbounds = curitem->m_rawbounds; | |
| 2247 | else | |
| 2248 | union_render_bounds(&m_scrbounds, &curitem->m_rawbounds); | |
| 2249 | scrfirst = false; | |
| 2242 | // accumulate screen bounds | |
| 2243 | if (curitem->m_screen != NULL) | |
| 2244 | { | |
| 2245 | if (scrfirst) | |
| 2246 | m_scrbounds = curitem->m_rawbounds; | |
| 2247 | else | |
| 2248 | union_render_bounds(&m_scrbounds, &curitem->m_rawbounds); | |
| 2249 | scrfirst = false; | |
| 2250 | 2250 | |
| 2251 | // accumulate the screens in use while we're scanning | |
| 2252 | m_screens.add(*curitem->m_screen); | |
| 2253 | } | |
| 2254 | } | |
| 2255 | } | |
| 2251 | // accumulate the screens in use while we're scanning | |
| 2252 | m_screens.add(*curitem->m_screen); | |
| 2253 | } | |
| 2254 | } | |
| 2255 | } | |
| 2256 | 2256 | |
| 2257 | // if we have an explicit bounds, override it | |
| 2258 | if (m_expbounds.x1 > m_expbounds.x0) | |
| 2259 | m_bounds = m_expbounds; | |
| 2257 | // if we have an explicit bounds, override it | |
| 2258 | if (m_expbounds.x1 > m_expbounds.x0) | |
| 2259 | m_bounds = m_expbounds; | |
| 2260 | 2260 | |
| 2261 | // if we're handling things normally, the target bounds are (0,0)-(1,1) | |
| 2262 | render_bounds target_bounds; | |
| 2263 | if (!layerconfig.zoom_to_screen() || m_screens.count() == 0) | |
| 2264 | { | |
| 2265 | // compute the aspect ratio of the view | |
| 2266 | m_aspect = (m_bounds.x1 - m_bounds.x0) / (m_bounds.y1 - m_bounds.y0); | |
| 2261 | // if we're handling things normally, the target bounds are (0,0)-(1,1) | |
| 2262 | render_bounds target_bounds; | |
| 2263 | if (!layerconfig.zoom_to_screen() || m_screens.count() == 0) | |
| 2264 | { | |
| 2265 | // compute the aspect ratio of the view | |
| 2266 | m_aspect = (m_bounds.x1 - m_bounds.x0) / (m_bounds.y1 - m_bounds.y0); | |
| 2267 | 2267 | |
| 2268 | target_bounds.x0 = target_bounds.y0 = 0.0f; | |
| 2269 | target_bounds.x1 = target_bounds.y1 = 1.0f; | |
| 2270 | } | |
| 2268 | target_bounds.x0 = target_bounds.y0 = 0.0f; | |
| 2269 | target_bounds.x1 = target_bounds.y1 = 1.0f; | |
| 2270 | } | |
| 2271 | 2271 | |
| 2272 | // if we're cropping, we want the screen area to fill (0,0)-(1,1) | |
| 2273 | else | |
| 2274 | { | |
| 2275 | // compute the aspect ratio of the screen | |
| 2276 | m_scraspect = (m_scrbounds.x1 - m_scrbounds.x0) / (m_scrbounds.y1 - m_scrbounds.y0); | |
| 2272 | // if we're cropping, we want the screen area to fill (0,0)-(1,1) | |
| 2273 | else | |
| 2274 | { | |
| 2275 | // compute the aspect ratio of the screen | |
| 2276 | m_scraspect = (m_scrbounds.x1 - m_scrbounds.x0) / (m_scrbounds.y1 - m_scrbounds.y0); | |
| 2277 | 2277 | |
| 2278 | float targwidth = (m_bounds.x1 - m_bounds.x0) / (m_scrbounds.x1 - m_scrbounds.x0); | |
| 2279 | float targheight = (m_bounds.y1 - m_bounds.y0) / (m_scrbounds.y1 - m_scrbounds.y0); | |
| 2280 | target_bounds.x0 = (m_bounds.x0 - m_scrbounds.x0) / (m_bounds.x1 - m_bounds.x0) * targwidth; | |
| 2281 | target_bounds.y0 = (m_bounds.y0 - m_scrbounds.y0) / (m_bounds.y1 - m_bounds.y0) * targheight; | |
| 2282 | target_bounds.x1 = target_bounds.x0 + targwidth; | |
| 2283 | target_bounds.y1 = target_bounds.y0 + targheight; | |
| 2284 | } | |
| 2278 | float targwidth = (m_bounds.x1 - m_bounds.x0) / (m_scrbounds.x1 - m_scrbounds.x0); | |
| 2279 | float targheight = (m_bounds.y1 - m_bounds.y0) / (m_scrbounds.y1 - m_scrbounds.y0); | |
| 2280 | target_bounds.x0 = (m_bounds.x0 - m_scrbounds.x0) / (m_bounds.x1 - m_bounds.x0) * targwidth; | |
| 2281 | target_bounds.y0 = (m_bounds.y0 - m_scrbounds.y0) / (m_bounds.y1 - m_bounds.y0) * targheight; | |
| 2282 | target_bounds.x1 = target_bounds.x0 + targwidth; | |
| 2283 | target_bounds.y1 = target_bounds.y0 + targheight; | |
| 2284 | } | |
| 2285 | 2285 | |
| 2286 | // determine the scale/offset for normalization | |
| 2287 | float xoffs = m_bounds.x0; | |
| 2288 | float yoffs = m_bounds.y0; | |
| 2289 | float xscale = (target_bounds.x1 - target_bounds.x0) / (m_bounds.x1 - m_bounds.x0); | |
| 2290 | float yscale = (target_bounds.y1 - target_bounds.y0) / (m_bounds.y1 - m_bounds.y0); | |
| 2286 | // determine the scale/offset for normalization | |
| 2287 | float xoffs = m_bounds.x0; | |
| 2288 | float yoffs = m_bounds.y0; | |
| 2289 | float xscale = (target_bounds.x1 - target_bounds.x0) / (m_bounds.x1 - m_bounds.x0); | |
| 2290 | float yscale = (target_bounds.y1 - target_bounds.y0) / (m_bounds.y1 - m_bounds.y0); | |
| 2291 | 2291 | |
| 2292 | // normalize all the item bounds | |
| 2293 | for (item_layer layer = ITEM_LAYER_FIRST; layer < ITEM_LAYER_MAX; layer++) | |
| 2294 | for (item *curitem = first_item(layer); curitem != NULL; curitem = curitem->next()) | |
| 2295 | { | |
| 2296 | curitem->m_bounds.x0 = target_bounds.x0 + (curitem->m_rawbounds.x0 - xoffs) * xscale; | |
| 2297 | curitem->m_bounds.x1 = target_bounds.x0 + (curitem->m_rawbounds.x1 - xoffs) * xscale; | |
| 2298 | curitem->m_bounds.y0 = target_bounds.y0 + (curitem->m_rawbounds.y0 - yoffs) * yscale; | |
| 2299 | curitem->m_bounds.y1 = target_bounds.y0 + (curitem->m_rawbounds.y1 - yoffs) * yscale; | |
| 2300 | } | |
| 2292 | // normalize all the item bounds | |
| 2293 | for (item_layer layer = ITEM_LAYER_FIRST; layer < ITEM_LAYER_MAX; layer++) | |
| 2294 | for (item *curitem = first_item(layer); curitem != NULL; curitem = curitem->next()) | |
| 2295 | { | |
| 2296 | curitem->m_bounds.x0 = target_bounds.x0 + (curitem->m_rawbounds.x0 - xoffs) * xscale; | |
| 2297 | curitem->m_bounds.x1 = target_bounds.x0 + (curitem->m_rawbounds.x1 - xoffs) * xscale; | |
| 2298 | curitem->m_bounds.y0 = target_bounds.y0 + (curitem->m_rawbounds.y0 - yoffs) * yscale; | |
| 2299 | curitem->m_bounds.y1 = target_bounds.y0 + (curitem->m_rawbounds.y1 - yoffs) * yscale; | |
| 2300 | } | |
| 2301 | 2301 | } |
| 2302 | 2302 | |
| 2303 | 2303 | |
| r242631 | r242632 | |
| 2311 | 2311 | //------------------------------------------------- |
| 2312 | 2312 | |
| 2313 | 2313 | layout_view::item::item(running_machine &machine, xml_data_node &itemnode, simple_list<layout_element> &elemlist) |
| 2314 | : m_next(NULL), | |
| 2315 | m_element(NULL), | |
| 2316 | m_input_mask(0), | |
| 2317 | m_screen(NULL), | |
| 2318 | m_orientation(ROT0) | |
| 2314 | : m_next(NULL), | |
| 2315 | m_element(NULL), | |
| 2316 | m_input_mask(0), | |
| 2317 | m_screen(NULL), | |
| 2318 | m_orientation(ROT0) | |
| 2319 | 2319 | { |
| 2320 | // allocate a copy of the output name | |
| 2321 | m_output_name = xml_get_attribute_string_with_subst(machine, itemnode, "name", ""); | |
| 2320 | // allocate a copy of the output name | |
| 2321 | m_output_name = xml_get_attribute_string_with_subst(machine, itemnode, "name", ""); | |
| 2322 | 2322 | |
| 2323 | // allocate a copy of the input tag | |
| 2324 | m_input_tag = xml_get_attribute_string_with_subst(machine, itemnode, "inputtag", ""); | |
| 2323 | // allocate a copy of the input tag | |
| 2324 | m_input_tag = xml_get_attribute_string_with_subst(machine, itemnode, "inputtag", ""); | |
| 2325 | 2325 | |
| 2326 | // find the associated element | |
| 2327 | const char *name = xml_get_attribute_string_with_subst(machine, itemnode, "element", NULL); | |
| 2328 | if (name != NULL) | |
| 2329 | { | |
| 2330 | // search the list of elements for a match | |
| 2331 | for (m_element = elemlist.first(); m_element != NULL; m_element = m_element->next()) | |
| 2332 | if (strcmp(name, m_element->name()) == 0) | |
| 2333 | break; | |
| 2326 | // find the associated element | |
| 2327 | const char *name = xml_get_attribute_string_with_subst(machine, itemnode, "element", NULL); | |
| 2328 | if (name != NULL) | |
| 2329 | { | |
| 2330 | // search the list of elements for a match | |
| 2331 | for (m_element = elemlist.first(); m_element != NULL; m_element = m_element->next()) | |
| 2332 | if (strcmp(name, m_element->name()) == 0) | |
| 2333 | break; | |
| 2334 | 2334 | |
| 2335 | // error if not found | |
| 2336 | if (m_element == NULL) | |
| 2337 | throw emu_fatalerror("Unable to find layout element %s", name); | |
| 2338 | } | |
| 2335 | // error if not found | |
| 2336 | if (m_element == NULL) | |
| 2337 | throw emu_fatalerror("Unable to find layout element %s", name); | |
| 2338 | } | |
| 2339 | 2339 | |
| 2340 | // fetch common data | |
| 2341 | int index = xml_get_attribute_int_with_subst(machine, itemnode, "index", -1); | |
| 2342 | if (index != -1) | |
| 2343 | { | |
| 2344 | screen_device_iterator iter(machine.root_device()); | |
| 2345 | m_screen = iter.byindex(index); | |
| 2346 | } | |
| 2347 | m_input_mask = xml_get_attribute_int_with_subst(machine, itemnode, "inputmask", 0); | |
| 2348 | if (m_output_name[0] != 0 && m_element != NULL) | |
| 2349 | output_set_value(m_output_name, m_element->default_state()); | |
| 2350 | parse_bounds(machine, xml_get_sibling(itemnode.child, "bounds"), m_rawbounds); | |
| 2351 | parse_color(machine, xml_get_sibling(itemnode.child, "color"), m_color); | |
| 2352 | parse_orientation(machine, xml_get_sibling(itemnode.child, "orientation"), m_orientation); | |
| 2340 | // fetch common data | |
| 2341 | int index = xml_get_attribute_int_with_subst(machine, itemnode, "index", -1); | |
| 2342 | if (index != -1) | |
| 2343 | { | |
| 2344 | screen_device_iterator iter(machine.root_device()); | |
| 2345 | m_screen = iter.byindex(index); | |
| 2346 | } | |
| 2347 | m_input_mask = xml_get_attribute_int_with_subst(machine, itemnode, "inputmask", 0); | |
| 2348 | if (m_output_name[0] != 0 && m_element != NULL) | |
| 2349 | output_set_value(m_output_name, m_element->default_state()); | |
| 2350 | parse_bounds(machine, xml_get_sibling(itemnode.child, "bounds"), m_rawbounds); | |
| 2351 | parse_color(machine, xml_get_sibling(itemnode.child, "color"), m_color); | |
| 2352 | parse_orientation(machine, xml_get_sibling(itemnode.child, "orientation"), m_orientation); | |
| 2353 | 2353 | |
| 2354 | // sanity checks | |
| 2355 | if (strcmp(itemnode.name, "screen") == 0) | |
| 2356 | { | |
| 2357 | if (m_screen == NULL) | |
| 2358 | throw emu_fatalerror("Layout references invalid screen index %d", index); | |
| 2359 | } | |
| 2360 | else | |
| 2361 | { | |
| 2362 | if (m_element == NULL) | |
| 2363 | throw emu_fatalerror("Layout item of type %s require an element tag", itemnode.name); | |
| 2364 | } | |
| 2354 | // sanity checks | |
| 2355 | if (strcmp(itemnode.name, "screen") == 0) | |
| 2356 | { | |
| 2357 | if (m_screen == NULL) | |
| 2358 | throw emu_fatalerror("Layout references invalid screen index %d", index); | |
| 2359 | } | |
| 2360 | else | |
| 2361 | { | |
| 2362 | if (m_element == NULL) | |
| 2363 | throw emu_fatalerror("Layout item of type %s require an element tag", itemnode.name); | |
| 2364 | } | |
| 2365 | 2365 | } |
| 2366 | 2366 | |
| 2367 | 2367 | |
| r242631 | r242632 | |
| 2381 | 2381 | |
| 2382 | 2382 | render_container *layout_view::item::screen_container(running_machine &machine) const |
| 2383 | 2383 | { |
| 2384 | ||
| 2384 | return (m_screen != NULL) ? &m_screen->container() : NULL; | |
| 2385 | 2385 | } |
| 2386 | 2386 | |
| 2387 | 2387 | //------------------------------------------------- |
| r242631 | r242632 | |
| 2390 | 2390 | |
| 2391 | 2391 | int layout_view::item::state() const |
| 2392 | 2392 | { |
| 2393 | ||
| 2393 | int state = 0; | |
| 2394 | 2394 | |
| 2395 | ||
| 2395 | assert(m_element != NULL); | |
| 2396 | 2396 | |
| 2397 | // if configured to an output, fetch the output value | |
| 2398 | if (m_output_name[0] != 0) | |
| 2399 | state = output_get_value(m_output_name); | |
| 2397 | // if configured to an output, fetch the output value | |
| 2398 | if (m_output_name[0] != 0) | |
| 2399 | state = output_get_value(m_output_name); | |
| 2400 | 2400 | |
| 2401 | // if configured to an input, fetch the input value | |
| 2402 | else if (m_input_tag[0] != 0) | |
| 2403 | { | |
| 2404 | ioport_port *port = m_element->machine().root_device().ioport(m_input_tag); | |
| 2405 | if (port != NULL) | |
| 2406 | { | |
| 2407 | ioport_field *field = port->field(m_input_mask); | |
| 2408 | if (field != NULL) | |
| 2409 | state = ((port->read() ^ field->defvalue()) & m_input_mask) ? 1 : 0; | |
| 2410 | } | |
| 2411 | } | |
| 2412 | return state; | |
| 2401 | // if configured to an input, fetch the input value | |
| 2402 | else if (m_input_tag[0] != 0) | |
| 2403 | { | |
| 2404 | ioport_port *port = m_element->machine().root_device().ioport(m_input_tag); | |
| 2405 | if (port != NULL) | |
| 2406 | { | |
| 2407 | ioport_field *field = port->field(m_input_mask); | |
| 2408 | if (field != NULL) | |
| 2409 | state = ((port->read() ^ field->defvalue()) & m_input_mask) ? 1 : 0; | |
| 2410 | } | |
| 2411 | } | |
| 2412 | return state; | |
| 2413 | 2413 | } |
| 2414 | 2414 | |
| 2415 | 2415 | |
| r242631 | r242632 | |
| 2423 | 2423 | //------------------------------------------------- |
| 2424 | 2424 | |
| 2425 | 2425 | layout_file::layout_file(running_machine &machine, xml_data_node &rootnode, const char *dirname) |
| 2426 | ||
| 2426 | : m_next(NULL) | |
| 2427 | 2427 | { |
| 2428 | // find the layout node | |
| 2429 | xml_data_node *mamelayoutnode = xml_get_sibling(rootnode.child, "mamelayout"); | |
| 2430 | if (mamelayoutnode == NULL) | |
| 2431 | throw emu_fatalerror("Invalid XML file: missing mamelayout node"); | |
| 2428 | // find the layout node | |
| 2429 | xml_data_node *mamelayoutnode = xml_get_sibling(rootnode.child, "mamelayout"); | |
| 2430 | if (mamelayoutnode == NULL) | |
| 2431 | throw emu_fatalerror("Invalid XML file: missing mamelayout node"); | |
| 2432 | 2432 | |
| 2433 | // validate the config data version | |
| 2434 | int version = xml_get_attribute_int(mamelayoutnode, "version", 0); | |
| 2435 | if (version != LAYOUT_VERSION) | |
| 2436 | throw emu_fatalerror("Invalid XML file: unsupported version"); | |
| 2433 | // validate the config data version | |
| 2434 | int version = xml_get_attribute_int(mamelayoutnode, "version", 0); | |
| 2435 | if (version != LAYOUT_VERSION) | |
| 2436 | throw emu_fatalerror("Invalid XML file: unsupported version"); | |
| 2437 | 2437 | |
| 2438 | // parse all the elements | |
| 2439 | for (xml_data_node *elemnode = xml_get_sibling(mamelayoutnode->child, "element"); elemnode != NULL; elemnode = xml_get_sibling(elemnode->next, "element")) | |
| 2440 | m_elemlist.append(*global_alloc(layout_element(machine, *elemnode, dirname))); | |
| 2438 | // parse all the elements | |
| 2439 | for (xml_data_node *elemnode = xml_get_sibling(mamelayoutnode->child, "element"); elemnode != NULL; elemnode = xml_get_sibling(elemnode->next, "element")) | |
| 2440 | m_elemlist.append(*global_alloc(layout_element(machine, *elemnode, dirname))); | |
| 2441 | 2441 | |
| 2442 | // parse all the views | |
| 2443 | for (xml_data_node *viewnode = xml_get_sibling(mamelayoutnode->child, "view"); viewnode != NULL; viewnode = xml_get_sibling(viewnode->next, "view")) | |
| 2444 | m_viewlist.append(*global_alloc(layout_view(machine, *viewnode, m_elemlist))); | |
| 2442 | // parse all the views | |
| 2443 | for (xml_data_node *viewnode = xml_get_sibling(mamelayoutnode->child, "view"); viewnode != NULL; viewnode = xml_get_sibling(viewnode->next, "view")) | |
| 2444 | m_viewlist.append(*global_alloc(layout_view(machine, *viewnode, m_elemlist))); | |
| 2445 | 2445 | } |
| 2446 | 2446 | |
| 2447 | 2447 |
| r242631 | r242632 | |
|---|---|---|
| 20 | 20 | |
| 21 | 21 | enum item_layer |
| 22 | 22 | { |
| 23 | ITEM_LAYER_FIRST = 0, | |
| 24 | ITEM_LAYER_BACKDROP = ITEM_LAYER_FIRST, | |
| 25 | ITEM_LAYER_SCREEN, | |
| 26 | ITEM_LAYER_OVERLAY, | |
| 27 | ITEM_LAYER_BEZEL, | |
| 28 | ITEM_LAYER_CPANEL, | |
| 29 | ITEM_LAYER_MARQUEE, | |
| 30 | ITEM_LAYER_MAX | |
| 23 | ITEM_LAYER_FIRST = 0, | |
| 24 | ITEM_LAYER_BACKDROP = ITEM_LAYER_FIRST, | |
| 25 | ITEM_LAYER_SCREEN, | |
| 26 | ITEM_LAYER_OVERLAY, | |
| 27 | ITEM_LAYER_BEZEL, | |
| 28 | ITEM_LAYER_CPANEL, | |
| 29 | ITEM_LAYER_MARQUEE, | |
| 30 | ITEM_LAYER_MAX | |
| 31 | 31 | }; |
| 32 | 32 | DECLARE_ENUM_OPERATORS(item_layer); |
| 33 | 33 | |
| r242631 | r242632 | |
| 43 | 43 | // a layout_element is a single named element, which may have multiple components |
| 44 | 44 | class layout_element |
| 45 | 45 | { |
| 46 | ||
| 46 | friend class simple_list<layout_element>; | |
| 47 | 47 | |
| 48 | 48 | public: |
| 49 | // construction/destruction | |
| 50 | layout_element(running_machine &machine, xml_data_node &elemnode, const char *dirname); | |
| 51 | virtual ~layout_element(); | |
| 49 | // construction/destruction | |
| 50 | layout_element(running_machine &machine, xml_data_node &elemnode, const char *dirname); | |
| 51 | virtual ~layout_element(); | |
| 52 | 52 | |
| 53 | // getters | |
| 54 | layout_element *next() const { return m_next; } | |
| 55 | const char *name() const { return m_name; } | |
| 56 | running_machine &machine() const { return m_machine; } | |
| 57 | int default_state() const { return m_defstate; } | |
| 58 | int maxstate() const { return m_maxstate; } | |
| 59 | render_texture *state_texture(int state); | |
| 53 | // getters | |
| 54 | layout_element *next() const { return m_next; } | |
| 55 | const char *name() const { return m_name; } | |
| 56 | running_machine &machine() const { return m_machine; } | |
| 57 | int default_state() const { return m_defstate; } | |
| 58 | int maxstate() const { return m_maxstate; } | |
| 59 | render_texture *state_texture(int state); | |
| 60 | 60 | |
| 61 | 61 | private: |
| 62 | // a component represents an image, rectangle, or disk in an element | |
| 63 | class component | |
| 64 | { | |
| 65 | friend class layout_element; | |
| 66 | friend class simple_list<component>; | |
| 62 | // a component represents an image, rectangle, or disk in an element | |
| 63 | class component | |
| 64 | { | |
| 65 | friend class layout_element; | |
| 66 | friend class simple_list<component>; | |
| 67 | 67 | |
| 68 | public: | |
| 69 | // construction/destruction | |
| 70 | component(running_machine &machine, xml_data_node &compnode, const char *dirname); | |
| 71 | ~component(); | |
| 68 | public: | |
| 69 | // construction/destruction | |
| 70 | component(running_machine &machine, xml_data_node &compnode, const char *dirname); | |
| 71 | ~component(); | |
| 72 | 72 | |
| 73 | // getters | |
| 74 | component *next() const { return m_next; } | |
| 75 | const render_bounds &bounds() const { return m_bounds; } | |
| 73 | // getters | |
| 74 | component *next() const { return m_next; } | |
| 75 | const render_bounds &bounds() const { return m_bounds; } | |
| 76 | 76 | |
| 77 | // operations | |
| 78 | void draw(running_machine &machine, bitmap_argb32 &dest, const rectangle &bounds, int state); | |
| 77 | // operations | |
| 78 | void draw(running_machine &machine, bitmap_argb32 &dest, const rectangle &bounds, int state); | |
| 79 | 79 | |
| 80 | private: | |
| 81 | // component types | |
| 82 | enum component_type | |
| 83 | { | |
| 84 | CTYPE_INVALID = 0, | |
| 85 | CTYPE_IMAGE, | |
| 86 | CTYPE_RECT, | |
| 87 | CTYPE_DISK, | |
| 88 | CTYPE_TEXT, | |
| 89 | CTYPE_LED7SEG, | |
| 90 | CTYPE_LED8SEG_GTS1, | |
| 91 | CTYPE_LED14SEG, | |
| 92 | CTYPE_LED16SEG, | |
| 93 | CTYPE_LED14SEGSC, | |
| 94 | CTYPE_LED16SEGSC, | |
| 95 | CTYPE_DOTMATRIX, | |
| 96 | CTYPE_DOTMATRIX5DOT, | |
| 97 | CTYPE_DOTMATRIXDOT, | |
| 98 | CTYPE_SIMPLECOUNTER, | |
| 99 | CTYPE_REEL, | |
| 100 | CTYPE_MAX | |
| 101 | }; | |
| 80 | private: | |
| 81 | // component types | |
| 82 | enum component_type | |
| 83 | { | |
| 84 | CTYPE_INVALID = 0, | |
| 85 | CTYPE_IMAGE, | |
| 86 | CTYPE_RECT, | |
| 87 | CTYPE_DISK, | |
| 88 | CTYPE_TEXT, | |
| 89 | CTYPE_LED7SEG, | |
| 90 | CTYPE_LED8SEG_GTS1, | |
| 91 | CTYPE_LED14SEG, | |
| 92 | CTYPE_LED16SEG, | |
| 93 | CTYPE_LED14SEGSC, | |
| 94 | CTYPE_LED16SEGSC, | |
| 95 | CTYPE_DOTMATRIX, | |
| 96 | CTYPE_DOTMATRIX5DOT, | |
| 97 | CTYPE_DOTMATRIXDOT, | |
| 98 | CTYPE_SIMPLECOUNTER, | |
| 99 | CTYPE_REEL, | |
| 100 | CTYPE_MAX | |
| 101 | }; | |
| 102 | 102 | |
| 103 | // helpers | |
| 104 | void draw_rect(bitmap_argb32 &dest, const rectangle &bounds); | |
| 105 | void draw_disk(bitmap_argb32 &dest, const rectangle &bounds); | |
| 106 | void draw_text(running_machine &machine, bitmap_argb32 &dest, const rectangle &bounds); | |
| 107 | void draw_simplecounter(running_machine &machine, bitmap_argb32 &dest, const rectangle &bounds, int state); | |
| 108 | void draw_reel(running_machine &machine, bitmap_argb32 &dest, const rectangle &bounds, int state); | |
| 109 | void draw_beltreel(running_machine &machine, bitmap_argb32 &dest, const rectangle &bounds, int state); | |
| 110 | void load_bitmap(); | |
| 111 | void load_reel_bitmap(int number); | |
| 112 | void draw_led7seg(bitmap_argb32 &dest, const rectangle &bounds, int pattern); | |
| 113 | void draw_led8seg_gts1(bitmap_argb32 &dest, const rectangle &bounds, int pattern); | |
| 114 | void draw_led14seg(bitmap_argb32 &dest, const rectangle &bounds, int pattern); | |
| 115 | void draw_led14segsc(bitmap_argb32 &dest, const rectangle &bounds, int pattern); | |
| 116 | void draw_led16seg(bitmap_argb32 &dest, const rectangle &bounds, int pattern); | |
| 117 | void draw_led16segsc(bitmap_argb32 &dest, const rectangle &bounds, int pattern); | |
| 118 | void draw_dotmatrix(int dots,bitmap_argb32 &dest, const rectangle &bounds, int pattern); | |
| 119 | void draw_segment_horizontal_caps(bitmap_argb32 &dest, int minx, int maxx, int midy, int width, int caps, rgb_t color); | |
| 120 | void draw_segment_horizontal(bitmap_argb32 &dest, int minx, int maxx, int midy, int width, rgb_t color); | |
| 121 | void draw_segment_vertical_caps(bitmap_argb32 &dest, int miny, int maxy, int midx, int width, int caps, rgb_t color); | |
| 122 | void draw_segment_vertical(bitmap_argb32 &dest, int miny, int maxy, int midx, int width, rgb_t color); | |
| 123 | void draw_segment_diagonal_1(bitmap_argb32 &dest, int minx, int maxx, int miny, int maxy, int width, rgb_t color); | |
| 124 | void draw_segment_diagonal_2(bitmap_argb32 &dest, int minx, int maxx, int miny, int maxy, int width, rgb_t color); | |
| 125 | void draw_segment_decimal(bitmap_argb32 &dest, int midx, int midy, int width, rgb_t color); | |
| 126 | void draw_segment_comma(bitmap_argb32 &dest, int minx, int maxx, int miny, int maxy, int width, rgb_t color); | |
| 127 | void apply_skew(bitmap_argb32 &dest, int skewwidth); | |
| 103 | // helpers | |
| 104 | void draw_rect(bitmap_argb32 &dest, const rectangle &bounds); | |
| 105 | void draw_disk(bitmap_argb32 &dest, const rectangle &bounds); | |
| 106 | void draw_text(running_machine &machine, bitmap_argb32 &dest, const rectangle &bounds); | |
| 107 | void draw_simplecounter(running_machine &machine, bitmap_argb32 &dest, const rectangle &bounds, int state); | |
| 108 | void draw_reel(running_machine &machine, bitmap_argb32 &dest, const rectangle &bounds, int state); | |
| 109 | void draw_beltreel(running_machine &machine, bitmap_argb32 &dest, const rectangle &bounds, int state); | |
| 110 | void load_bitmap(); | |
| 111 | void load_reel_bitmap(int number); | |
| 112 | void draw_led7seg(bitmap_argb32 &dest, const rectangle &bounds, int pattern); | |
| 113 | void draw_led8seg_gts1(bitmap_argb32 &dest, const rectangle &bounds, int pattern); | |
| 114 | void draw_led14seg(bitmap_argb32 &dest, const rectangle &bounds, int pattern); | |
| 115 | void draw_led14segsc(bitmap_argb32 &dest, const rectangle &bounds, int pattern); | |
| 116 | void draw_led16seg(bitmap_argb32 &dest, const rectangle &bounds, int pattern); | |
| 117 | void draw_led16segsc(bitmap_argb32 &dest, const rectangle &bounds, int pattern); | |
| 118 | void draw_dotmatrix(int dots,bitmap_argb32 &dest, const rectangle &bounds, int pattern); | |
| 119 | void draw_segment_horizontal_caps(bitmap_argb32 &dest, int minx, int maxx, int midy, int width, int caps, rgb_t color); | |
| 120 | void draw_segment_horizontal(bitmap_argb32 &dest, int minx, int maxx, int midy, int width, rgb_t color); | |
| 121 | void draw_segment_vertical_caps(bitmap_argb32 &dest, int miny, int maxy, int midx, int width, int caps, rgb_t color); | |
| 122 | void draw_segment_vertical(bitmap_argb32 &dest, int miny, int maxy, int midx, int width, rgb_t color); | |
| 123 | void draw_segment_diagonal_1(bitmap_argb32 &dest, int minx, int maxx, int miny, int maxy, int width, rgb_t color); | |
| 124 | void draw_segment_diagonal_2(bitmap_argb32 &dest, int minx, int maxx, int miny, int maxy, int width, rgb_t color); | |
| 125 | void draw_segment_decimal(bitmap_argb32 &dest, int midx, int midy, int width, rgb_t color); | |
| 126 | void draw_segment_comma(bitmap_argb32 &dest, int minx, int maxx, int miny, int maxy, int width, rgb_t color); | |
| 127 | void apply_skew(bitmap_argb32 &dest, int skewwidth); | |
| 128 | 128 | |
| 129 | ||
| 129 | #define MAX_BITMAPS 32 | |
| 130 | 130 | |
| 131 | // internal state | |
| 132 | component * m_next; // link to next component | |
| 133 | component_type m_type; // type of component | |
| 134 | int m_state; // state where this component is visible (-1 means all states) | |
| 135 | render_bounds m_bounds; // bounds of the element | |
| 136 | render_color m_color; // color of the element | |
| 137 | astring m_string; // string for text components | |
| 138 | int m_digits; // number of digits for simple counters | |
| 139 | int m_textalign; // text alignment to box | |
| 140 | bitmap_argb32 m_bitmap[MAX_BITMAPS]; // source bitmap for images | |
| 141 | astring m_dirname; // directory name of image file (for lazy loading) | |
| 142 | auto_pointer<emu_file> m_file[MAX_BITMAPS]; // file object for reading image/alpha files | |
| 143 | astring m_imagefile[MAX_BITMAPS]; // name of the image file (for lazy loading) | |
| 144 | astring m_alphafile[MAX_BITMAPS]; // name of the alpha file (for lazy loading) | |
| 145 | bool m_hasalpha[MAX_BITMAPS]; // is there any alpha component present? | |
| 131 | // internal state | |
| 132 | component * m_next; // link to next component | |
| 133 | component_type m_type; // type of component | |
| 134 | int m_state; // state where this component is visible (-1 means all states) | |
| 135 | render_bounds m_bounds; // bounds of the element | |
| 136 | render_color m_color; // color of the element | |
| 137 | astring m_string; // string for text components | |
| 138 | int m_digits; // number of digits for simple counters | |
| 139 | int m_textalign; // text alignment to box | |
| 140 | bitmap_argb32 m_bitmap[MAX_BITMAPS]; // source bitmap for images | |
| 141 | astring m_dirname; // directory name of image file (for lazy loading) | |
| 142 | auto_pointer<emu_file> m_file[MAX_BITMAPS]; // file object for reading image/alpha files | |
| 143 | astring m_imagefile[MAX_BITMAPS]; // name of the image file (for lazy loading) | |
| 144 | astring m_alphafile[MAX_BITMAPS]; // name of the alpha file (for lazy loading) | |
| 145 | bool m_hasalpha[MAX_BITMAPS]; // is there any alpha component present? | |
| 146 | 146 | |
| 147 | // stuff for fruit machine reels | |
| 148 | // basically made up of multiple text strings / gfx | |
| 149 | int m_numstops; | |
| 150 | astring m_stopnames[MAX_BITMAPS]; | |
| 151 | int m_stateoffset; | |
| 152 | int m_reelreversed; | |
| 153 | int m_numsymbolsvisible; | |
| 154 | int m_beltreel; | |
| 155 | }; | |
| 147 | // stuff for fruit machine reels | |
| 148 | // basically made up of multiple text strings / gfx | |
| 149 | int m_numstops; | |
| 150 | astring m_stopnames[MAX_BITMAPS]; | |
| 151 | int m_stateoffset; | |
| 152 | int m_reelreversed; | |
| 153 | int m_numsymbolsvisible; | |
| 154 | int m_beltreel; | |
| 155 | }; | |
| 156 | 156 | |
| 157 | // a texture encapsulates a texture for a given element in a given state | |
| 158 | class texture | |
| 159 | { | |
| 160 | public: | |
| 161 | texture(); | |
| 162 | ~texture(); | |
| 157 | // a texture encapsulates a texture for a given element in a given state | |
| 158 | class texture | |
| 159 | { | |
| 160 | public: | |
| 161 | texture(); | |
| 162 | ~texture(); | |
| 163 | 163 | |
| 164 | layout_element * m_element; // pointer back to the element | |
| 165 | render_texture * m_texture; // texture for this state | |
| 166 | int m_state; // associated state number | |
| 167 | }; | |
| 164 | layout_element * m_element; // pointer back to the element | |
| 165 | render_texture * m_texture; // texture for this state | |
| 166 | int m_state; // associated state number | |
| 167 | }; | |
| 168 | 168 | |
| 169 | // internal helpers | |
| 170 | static void element_scale(bitmap_argb32 &dest, bitmap_argb32 &source, const rectangle &sbounds, void *param); | |
| 169 | // internal helpers | |
| 170 | static void element_scale(bitmap_argb32 &dest, bitmap_argb32 &source, const rectangle &sbounds, void *param); | |
| 171 | 171 | |
| 172 | // internal state | |
| 173 | layout_element * m_next; // link to next element | |
| 174 | running_machine & m_machine; // reference to the owning machine | |
| 175 | astring m_name; // name of this element | |
| 176 | simple_list<component> m_complist; // list of components | |
| 177 | int m_defstate; // default state of this element | |
| 178 | int m_maxstate; // maximum state value for all components | |
| 179 | dynamic_array<texture> m_elemtex; // array of element textures used for managing the scaled bitmaps | |
| 172 | // internal state | |
| 173 | layout_element * m_next; // link to next element | |
| 174 | running_machine & m_machine; // reference to the owning machine | |
| 175 | astring m_name; // name of this element | |
| 176 | simple_list<component> m_complist; // list of components | |
| 177 | int m_defstate; // default state of this element | |
| 178 | int m_maxstate; // maximum state value for all components | |
| 179 | dynamic_array<texture> m_elemtex; // array of element textures used for managing the scaled bitmaps | |
| 180 | 180 | }; |
| 181 | 181 | |
| 182 | 182 | |
| r242631 | r242632 | |
| 185 | 185 | // a layout_view encapsulates a named list of items |
| 186 | 186 | class layout_view |
| 187 | 187 | { |
| 188 | ||
| 188 | friend class simple_list<layout_view>; | |
| 189 | 189 | |
| 190 | 190 | public: |
| 191 | // an item is a single backdrop, screen, overlay, bezel, cpanel, or marquee item | |
| 192 | class item | |
| 193 | { | |
| 194 | friend class layout_view; | |
| 195 | friend class simple_list<item>; | |
| 191 | // an item is a single backdrop, screen, overlay, bezel, cpanel, or marquee item | |
| 192 | class item | |
| 193 | { | |
| 194 | friend class layout_view; | |
| 195 | friend class simple_list<item>; | |
| 196 | 196 | |
| 197 | public: | |
| 198 | // construction/destruction | |
| 199 | item(running_machine &machine, xml_data_node &itemnode, simple_list<layout_element> &elemlist); | |
| 200 | virtual ~item(); | |
| 197 | public: | |
| 198 | // construction/destruction | |
| 199 | item(running_machine &machine, xml_data_node &itemnode, simple_list<layout_element> &elemlist); | |
| 200 | virtual ~item(); | |
| 201 | 201 | |
| 202 | // getters | |
| 203 | item *next() const { return m_next; } | |
| 204 | layout_element *element() const { return m_element; } | |
| 205 | screen_device *screen() { return m_screen; } | |
| 206 | const render_bounds &bounds() const { return m_bounds; } | |
| 207 | const render_color &color() const { return m_color; } | |
| 208 | int orientation() const { return m_orientation; } | |
| 209 | render_container *screen_container(running_machine &machine) const; | |
| 210 | bool has_input() const { return bool(m_input_tag); } | |
| 211 | const char *input_tag_and_mask(ioport_value &mask) const { mask = m_input_mask; return m_input_tag; } | |
| 202 | // getters | |
| 203 | item *next() const { return m_next; } | |
| 204 | layout_element *element() const { return m_element; } | |
| 205 | screen_device *screen() { return m_screen; } | |
| 206 | const render_bounds &bounds() const { return m_bounds; } | |
| 207 | const render_color &color() const { return m_color; } | |
| 208 | int orientation() const { return m_orientation; } | |
| 209 | render_container *screen_container(running_machine &machine) const; | |
| 210 | bool has_input() const { return bool(m_input_tag); } | |
| 211 | const char *input_tag_and_mask(ioport_value &mask) const { mask = m_input_mask; return m_input_tag; } | |
| 212 | 212 | |
| 213 | // fetch state based on configured source | |
| 214 | int state() const; | |
| 213 | // fetch state based on configured source | |
| 214 | int state() const; | |
| 215 | 215 | |
| 216 | private: | |
| 217 | // internal state | |
| 218 | item * m_next; // link to next item | |
| 219 | layout_element * m_element; // pointer to the associated element (non-screens only) | |
| 220 | astring m_output_name; // name of this item | |
| 221 | astring m_input_tag; // input tag of this item | |
| 222 | ioport_value m_input_mask; // input mask of this item | |
| 223 | screen_device * m_screen; // pointer to screen | |
| 224 | int m_orientation; // orientation of this item | |
| 225 | render_bounds m_bounds; // bounds of the item | |
| 226 | render_bounds m_rawbounds; // raw (original) bounds of the item | |
| 227 | render_color m_color; // color of the item | |
| 228 | }; | |
| 216 | private: | |
| 217 | // internal state | |
| 218 | item * m_next; // link to next item | |
| 219 | layout_element * m_element; // pointer to the associated element (non-screens only) | |
| 220 | astring m_output_name; // name of this item | |
| 221 | astring m_input_tag; // input tag of this item | |
| 222 | ioport_value m_input_mask; // input mask of this item | |
| 223 | screen_device * m_screen; // pointer to screen | |
| 224 | int m_orientation; // orientation of this item | |
| 225 | render_bounds m_bounds; // bounds of the item | |
| 226 | render_bounds m_rawbounds; // raw (original) bounds of the item | |
| 227 | render_color m_color; // color of the item | |
| 228 | }; | |
| 229 | 229 | |
| 230 | // construction/destruction | |
| 231 | layout_view(running_machine &machine, xml_data_node &viewnode, simple_list<layout_element> &elemlist); | |
| 232 | virtual ~layout_view(); | |
| 230 | // construction/destruction | |
| 231 | layout_view(running_machine &machine, xml_data_node &viewnode, simple_list<layout_element> &elemlist); | |
| 232 | virtual ~layout_view(); | |
| 233 | 233 | |
| 234 | // getters | |
| 235 | layout_view *next() const { return m_next; } | |
| 236 | item *first_item(item_layer layer) const; | |
| 237 | const char *name() const { return m_name; } | |
| 238 | const render_screen_list &screens() const { return m_screens; } | |
| 239 | bool layer_enabled(item_layer layer) const { return m_layenabled[layer]; } | |
| 234 | // getters | |
| 235 | layout_view *next() const { return m_next; } | |
| 236 | item *first_item(item_layer layer) const; | |
| 237 | const char *name() const { return m_name; } | |
| 238 | const render_screen_list &screens() const { return m_screens; } | |
| 239 | bool layer_enabled(item_layer layer) const { return m_layenabled[layer]; } | |
| 240 | 240 | |
| 241 | // | |
| 242 | bool has_art() const { return (m_backdrop_list.count() + m_overlay_list.count() + m_bezel_list.count() + m_cpanel_list.count() + m_marquee_list.count() != 0); } | |
| 243 | float effective_aspect(render_layer_config config) const { return (config.zoom_to_screen() && m_screens.count() != 0) ? m_scraspect : m_aspect; } | |
| 241 | // | |
| 242 | bool has_art() const { return (m_backdrop_list.count() + m_overlay_list.count() + m_bezel_list.count() + m_cpanel_list.count() + m_marquee_list.count() != 0); } | |
| 243 | float effective_aspect(render_layer_config config) const { return (config.zoom_to_screen() && m_screens.count() != 0) ? m_scraspect : m_aspect; } | |
| 244 | 244 | |
| 245 | // operations | |
| 246 | void recompute(render_layer_config layerconfig); | |
| 245 | // operations | |
| 246 | void recompute(render_layer_config layerconfig); | |
| 247 | 247 | |
| 248 | 248 | private: |
| 249 | // internal state | |
| 250 | layout_view * m_next; // pointer to next layout in the list | |
| 251 | astring m_name; // name of the layout | |
| 252 | float m_aspect; // X/Y of the layout | |
| 253 | float m_scraspect; // X/Y of the screen areas | |
| 254 | render_screen_list m_screens; // list of active screens | |
| 255 | render_bounds m_bounds; // computed bounds of the view | |
| 256 | render_bounds m_scrbounds; // computed bounds of the screens within the view | |
| 257 | render_bounds m_expbounds; // explicit bounds of the view | |
| 258 | bool m_layenabled[ITEM_LAYER_MAX]; // is this layer enabled? | |
| 259 | simple_list<item> m_backdrop_list; // list of backdrop items | |
| 260 | simple_list<item> m_screen_list; // list of screen items | |
| 261 | simple_list<item> m_overlay_list; // list of overlay items | |
| 262 | simple_list<item> m_bezel_list; // list of bezel items | |
| 263 | simple_list<item> m_cpanel_list; // list of marquee items | |
| 264 | simple_list<item> m_marquee_list; // list of marquee items | |
| 249 | // internal state | |
| 250 | layout_view * m_next; // pointer to next layout in the list | |
| 251 | astring m_name; // name of the layout | |
| 252 | float m_aspect; // X/Y of the layout | |
| 253 | float m_scraspect; // X/Y of the screen areas | |
| 254 | render_screen_list m_screens; // list of active screens | |
| 255 | render_bounds m_bounds; // computed bounds of the view | |
| 256 | render_bounds m_scrbounds; // computed bounds of the screens within the view | |
| 257 | render_bounds m_expbounds; // explicit bounds of the view | |
| 258 | bool m_layenabled[ITEM_LAYER_MAX]; // is this layer enabled? | |
| 259 | simple_list<item> m_backdrop_list; // list of backdrop items | |
| 260 | simple_list<item> m_screen_list; // list of screen items | |
| 261 | simple_list<item> m_overlay_list; // list of overlay items | |
| 262 | simple_list<item> m_bezel_list; // list of bezel items | |
| 263 | simple_list<item> m_cpanel_list; // list of marquee items | |
| 264 | simple_list<item> m_marquee_list; // list of marquee items | |
| 265 | 265 | }; |
| 266 | 266 | |
| 267 | 267 | |
| r242631 | r242632 | |
| 270 | 270 | // a layout_file consists of a list of elements and a list of views |
| 271 | 271 | class layout_file |
| 272 | 272 | { |
| 273 | ||
| 273 | friend class simple_list<layout_file>; | |
| 274 | 274 | |
| 275 | 275 | public: |
| 276 | // construction/destruction | |
| 277 | layout_file(running_machine &machine, xml_data_node &rootnode, const char *dirname); | |
| 278 | virtual ~layout_file(); | |
| 276 | // construction/destruction | |
| 277 | layout_file(running_machine &machine, xml_data_node &rootnode, const char *dirname); | |
| 278 | virtual ~layout_file(); | |
| 279 | 279 | |
| 280 | // getters | |
| 281 | layout_file *next() const { return m_next; } | |
| 282 | layout_element *first_element() const { return m_elemlist.first(); } | |
| 283 | layout_view *first_view() const { return m_viewlist.first(); } | |
| 280 | // getters | |
| 281 | layout_file *next() const { return m_next; } | |
| 282 | layout_element *first_element() const { return m_elemlist.first(); } | |
| 283 | layout_view *first_view() const { return m_viewlist.first(); } | |
| 284 | 284 | |
| 285 | 285 | private: |
| 286 | // internal state | |
| 287 | layout_file * m_next; // pointer to the next file in the list | |
| 288 | simple_list<layout_element> m_elemlist; // list of shared layout elements | |
| 289 | simple_list<layout_view> m_viewlist; // list of views | |
| 286 | // internal state | |
| 287 | layout_file * m_next; // pointer to the next file in the list | |
| 288 | simple_list<layout_element> m_elemlist; // list of shared layout elements | |
| 289 | simple_list<layout_view> m_viewlist; // list of views | |
| 290 | 290 | }; |
| 291 | 291 | |
| 292 | 292 |
| r242631 | r242632 | |
|---|---|---|
| 1056 | 1056 | else if (m_state == CTL_STATE_OUTPUT) |
| 1057 | 1057 | { |
| 1058 | 1058 | if (DEBUG_5110) logerror("Status read while outputting buffer (buffer=%2d)\n", m_CTL_buffer); |
| 1059 | return (m_CTL_buffer); | |
| 1059 | return (m_CTL_buffer); | |
| 1060 | 1060 | } |
| 1061 | 1061 | else // we're reading with the bus in input mode! just return the last thing written to the bus |
| 1062 | 1062 | { |
| r242631 | r242632 | |
| 1150 | 1150 | /****************************************************************************** |
| 1151 | 1151 | |
| 1152 | 1152 | tms5110_set_frequency -- adjusts the playback frequency |
| 1153 | TODO: kill this function; we should be adjusting the tms51xx device clock itself, | |
| 1154 | not setting it here! | |
| 1153 | TODO: kill this function; we should be adjusting the tms51xx device clock itself, | |
| 1154 | not setting it here! | |
| 1155 | 1155 | |
| 1156 | 1156 | ******************************************************************************/ |
| 1157 | 1157 |
| r242631 | r242632 | |
|---|---|---|
| 1420 | 1420 | } |
| 1421 | 1421 | while (++x < 208); |
| 1422 | 1422 | } |
| 1423 | ||
| 1423 | ||
| 1424 | 1424 | /* border on right side of the GG active screen */ |
| 1425 | 1425 | do |
| 1426 | 1426 | { |
| r242631 | r242632 | |
|---|---|---|
| 5725 | 5725 | m_vdp2_regs[offset] = (STV_VDP2_VRAMSZ << 15) | |
| 5726 | 5726 | ((0 << 0) & 0xf); // VDP2 version |
| 5727 | 5727 | |
| 5728 | /* Games basically r/w the entire VDP2 register area when this is tripped. (example: Silhouette Mirage) | |
| 5728 | /* Games basically r/w the entire VDP2 register area when this is tripped. (example: Silhouette Mirage) | |
| 5729 | 5729 | Disable log for the time being. */ |
| 5730 | 5730 | //if(!space.debugger_access()) |
| 5731 | // | |
| 5731 | // printf("Warning: VDP2 version read\n"); | |
| 5732 | 5732 | break; |
| 5733 | 5733 | } |
| 5734 | 5734 |
| r242631 | r242632 | |
|---|---|---|
| 18 | 18 | |
| 19 | 19 | const float tea1002_device::m_luminance[] = |
| 20 | 20 | { |
| 21 | | |
| 21 | 0, 22.5, 44, 66.5, 8.5, 31, 52.5, 100, // INV = 0 | |
| 22 | 22 | 75, 52.5, 31, 8.5, 66.5, 44, 22.5, 0 // INV = 1 |
| 23 | 23 | }; |
| 24 | 24 |
| r242631 | r242632 | |
|---|---|---|
| 7 | 7 | PC98 DCP & DCU disk images |
| 8 | 8 | |
| 9 | 9 | 0xA2 header, followed by track data |
| 10 | ||
| 10 | header[0] - disk format | |
| 11 | 11 | header[1-0xA1] - track map (1=track used, 0=track unused/unformatted) |
| 12 | header[0xA2] - all tracks used? | |
| 12 | header[0xA2] - all tracks used? | |
| 13 | 13 | (there seems to be a diff in its usage between DCP and DCU) |
| 14 | 14 | |
| 15 | TODO: | |
| 15 | TODO: | |
| 16 | 16 | - add support for track map. images available for tests were all |
| 17 | 17 | of type 0x01, with all 154 tracks present. combined with pete_j |
| 18 | 18 | reporting some images have faulty track map, we need some more |
| 19 | 19 | test cases to properly handle these disks! |
| 20 | ||
| 20 | ||
| 21 | 21 | *********************************************************************/ |
| 22 | 22 | |
| 23 | 23 | #include "emu.h" |
| r242631 | r242632 | |
| 52 | 52 | io_generic_read(io, h, 0, 0xa2); |
| 53 | 53 | |
| 54 | 54 | // First byte is the disk format (see below in load() for details) |
| 55 | switch (h[0]) | |
| 55 | switch (h[0]) | |
| 56 | 56 | { |
| 57 | 57 | case 0x01: |
| 58 | 58 | default: |
| r242631 | r242632 | |
| 99 | 99 | if (h[i]) |
| 100 | 100 | count_tracks++; |
| 101 | 101 | |
| 102 | // in theory track map should be enough (former check), but some images have it wrong! | |
| 102 | // in theory track map should be enough (former check), but some images have it wrong! | |
| 103 | 103 | // hence, if this check fails, we also allow for images with all tracks and wrong track map |
| 104 | 104 | if (size - 0xa2 == (heads * count_tracks * spt * bps) || size - 0xa2 == (heads * tracks * spt * bps)) |
| 105 | 105 | return 100; |
| r242631 | r242632 | |
| 107 | 107 | // for disk type 0x11 the head 0 track 0 has 26 sectors of half width, so we need to compensate calculation |
| 108 | 108 | if (is_hdb && (size - 0xa2 + (0x80 * 26) == (heads * count_tracks * spt * bps) || size - 0xa2 + (0x80 * 26) == (heads * tracks * spt * bps))) |
| 109 | 109 | return 100; |
| 110 | ||
| 110 | ||
| 111 | 111 | return 0; |
| 112 | 112 | } |
| 113 | 113 | |
| r242631 | r242632 | |
| 116 | 116 | UINT8 h[0xa2]; |
| 117 | 117 | int heads, tracks, spt, bps; |
| 118 | 118 | bool is_hdb = false; |
| 119 | ||
| 119 | ||
| 120 | 120 | io_generic_read(io, h, 0, 0xa2); |
| 121 | ||
| 121 | ||
| 122 | 122 | // First byte is the disk format: |
| 123 | switch (h[0]) | |
| 123 | switch (h[0]) | |
| 124 | 124 | { |
| 125 | 125 | case 0x01: |
| 126 | 126 | default: |
| r242631 | r242632 | |
| 212 | 212 | if (!is_hdb) |
| 213 | 213 | { |
| 214 | 214 | for (int track = 0; track < tracks; track++) |
| 215 | for (int head = 0; head < heads; head++) | |
| 215 | for (int head = 0; head < heads; head++) | |
| 216 | 216 | { |
| 217 | 217 | io_generic_read(io, sect_data, 0xa2 + bps * spt * (track * heads + head), bps * spt); |
| 218 | ||
| 219 | for (int i = 0; i < spt; i++) | |
| 218 | ||
| 219 | for (int i = 0; i < spt; i++) | |
| 220 | 220 | { |
| 221 | 221 | sects[i].track = track; |
| 222 | 222 | sects[i].head = head; |
| r242631 | r242632 | |
| 227 | 227 | sects[i].bad_crc = false; |
| 228 | 228 | sects[i].data = sect_data + i * bps; |
| 229 | 229 | } |
| 230 | ||
| 230 | ||
| 231 | 231 | build_pc_track_mfm(track, head, image, cell_count, spt, sects, calc_default_pc_gap3_size(form_factor, bps)); |
| 232 | 232 | } |
| 233 | 233 | } |
| 234 | else | |
| 234 | else // FIXME: the code below is untested, because no image was found... there might be some silly mistake in the disk geometry! | |
| 235 | 235 | { |
| 236 | 236 | // Read Head 0 Track 0 is FM with 26 sectors of 128bytes instead of 256 |
| 237 | 237 | io_generic_read(io, sect_data, 0xa2, 128 * spt); |
| 238 | ||
| 239 | for (int i = 0; i < spt; i++) | |
| 238 | ||
| 239 | for (int i = 0; i < spt; i++) | |
| 240 | 240 | { |
| 241 | 241 | sects[i].track = 0; |
| 242 | 242 | sects[i].head = 0; |
| r242631 | r242632 | |
| 247 | 247 | sects[i].bad_crc = false; |
| 248 | 248 | sects[i].data = sect_data + i * 128; |
| 249 | 249 | } |
| 250 | ||
| 250 | ||
| 251 | 251 | build_pc_track_fm(0, 0, image, cell_count, spt, sects, calc_default_pc_gap3_size(form_factor, 128)); |
| 252 | ||
| 252 | ||
| 253 | 253 | // Read Head 1 Track 0 is MFM with 26 sectors of 256bytes |
| 254 | 254 | io_generic_read(io, sect_data, 0xa2 + 128 * spt, bps * spt); |
| 255 | ||
| 256 | for (int i = 0; i < spt; i++) | |
| 255 | ||
| 256 | for (int i = 0; i < spt; i++) | |
| 257 | 257 | { |
| 258 | 258 | sects[i].track = 0; |
| 259 | 259 | sects[i].head = 1; |
| r242631 | r242632 | |
| 264 | 264 | sects[i].bad_crc = false; |
| 265 | 265 | sects[i].data = sect_data + i * bps; |
| 266 | 266 | } |
| 267 | ||
| 267 | ||
| 268 | 268 | build_pc_track_mfm(0, 1, image, cell_count, spt, sects, calc_default_pc_gap3_size(form_factor, bps)); |
| 269 | ||
| 269 | ||
| 270 | 270 | // Read other tracks as usual |
| 271 | 271 | UINT32 data_offs = 0xa2 + (26 * 0x80) + (26 * 0x100); |
| 272 | 272 | for (int track = 1; track < tracks; track++) |
| 273 | for (int head = 0; head < heads; head++) | |
| 273 | for (int head = 0; head < heads; head++) | |
| 274 | 274 | { |
| 275 | 275 | io_generic_read(io, sect_data, data_offs + bps * spt * ((track - 1) * heads + head), bps * spt); |
| 276 | ||
| 277 | for (int i = 0; i < spt; i++) | |
| 276 | ||
| 277 | for (int i = 0; i < spt; i++) | |
| 278 | 278 | { |
| 279 | 279 | sects[i].track = track; |
| 280 | 280 | sects[i].head = head; |
| r242631 | r242632 | |
| 285 | 285 | sects[i].bad_crc = false; |
| 286 | 286 | sects[i].data = sect_data + i * bps; |
| 287 | 287 | } |
| 288 | ||
| 288 | ||
| 289 | 289 | build_pc_track_mfm(track, head, image, cell_count, spt, sects, calc_default_pc_gap3_size(form_factor, bps)); |
| 290 | 290 | } |
| 291 | 291 | } |
| 292 | ||
| 292 | ||
| 293 | 293 | return true; |
| 294 | 294 | } |
| 295 | 295 |
| r242631 | r242632 | |
|---|---|---|
| 5 | 5 | formats/dip_dsk.h |
| 6 | 6 | |
| 7 | 7 | PC98 DIP disk images |
| 8 | ||
| 8 | ||
| 9 | 9 | 0x100 header, followed by track data |
| 10 | 10 | |
| 11 | 11 | TODO: |
| 12 | - Investigate header structure | |
| 12 | - Investigate header structure | |
| 13 | 13 | - can this format be used to support different disc types? |
| 14 | 14 | |
| 15 | 15 | *********************************************************************/ |
| r242631 | r242632 | |
| 56 | 56 | tracks = 77; |
| 57 | 57 | spt = 8; |
| 58 | 58 | bps = 1024; |
| 59 | ||
| 59 | ||
| 60 | 60 | int cell_count = form_factor == floppy_image::FF_35 ? 200000 : 166666; |
| 61 | ||
| 61 | ||
| 62 | 62 | int ssize; |
| 63 | 63 | for (ssize = 0; (128 << ssize) < bps; ssize++); |
| 64 | ||
| 64 | ||
| 65 | 65 | desc_pc_sector sects[256]; |
| 66 | 66 | UINT8 sect_data[65536]; |
| 67 | ||
| 67 | ||
| 68 | 68 | for (int track = 0; track < tracks; track++) |
| 69 | for (int head = 0; head < heads; head++) | |
| 69 | for (int head = 0; head < heads; head++) | |
| 70 | 70 | { |
| 71 | 71 | io_generic_read(io, sect_data, 0x100 + bps * spt * (track * heads + head), bps * spt); |
| 72 | ||
| 73 | for (int i = 0; i < spt; i++) | |
| 72 | ||
| 73 | for (int i = 0; i < spt; i++) | |
| 74 | 74 | { |
| 75 | 75 | sects[i].track = track; |
| 76 | 76 | sects[i].head = head; |
| r242631 | r242632 | |
| 81 | 81 | sects[i].bad_crc = false; |
| 82 | 82 | sects[i].data = sect_data + i * bps; |
| 83 | 83 | } |
| 84 | ||
| 84 | ||
| 85 | 85 | build_pc_track_mfm(track, head, image, cell_count, spt, sects, calc_default_pc_gap3_size(form_factor, bps)); |
| 86 | 86 | } |
| 87 | 87 |
| r242631 | r242632 | |
|---|---|---|
| 5 | 5 | formats/fdd_dsk.h |
| 6 | 6 | |
| 7 | 7 | PC98 FDD disk images |
| 8 | ||
| 8 | ||
| 9 | 9 | 0xC3FC header, followed by track data |
| 10 | 10 | Sector map starts at offset 0xDC, with 12bytes for each sector |
| 11 | 11 | |
| r242631 | r242632 | |
| 15 | 15 | - 0x2 = sector number |
| 16 | 16 | - 0x3 = sector size (128 << this byte) |
| 17 | 17 | - 0x4 = fill byte. if it's not 0xff, then this sector in the original |
| 18 | disk consisted of this single value repeated for the whole | |
| 19 | sector size, and the sector is skipped in the .fdd file. | |
| 20 | if it's 0xff, then this sector is wholly contained in the .fdd | |
| 18 | disk consisted of this single value repeated for the whole | |
| 19 | sector size, and the sector is skipped in the .fdd file. | |
| 20 | if it's 0xff, then this sector is wholly contained in the .fdd | |
| 21 | 21 | file |
| 22 | 22 | - 0x5 = ?? |
| 23 | 23 | - 0x6 = ?? |
| 24 | 24 | - 0x7 = ?? |
| 25 | 25 | - 0x8-0x0b = absolute offset of the data for this sector, or 0xfffffff |
| 26 | if the sector was skipped in the .fdd (and it has to be | |
| 26 | if the sector was skipped in the .fdd (and it has to be | |
| 27 | 27 | filled with the value at 0x4) |
| 28 | 28 | |
| 29 | 29 | TODO: |
| r242631 | r242632 | |
| 55 | 55 | |
| 56 | 56 | int fdd_format::identify(io_generic *io, UINT32 form_factor) |
| 57 | 57 | { |
| 58 | UINT8 h[7]; | |
| 58 | UINT8 h[7]; | |
| 59 | 59 | io_generic_read(io, h, 0, 7); |
| 60 | ||
| 60 | ||
| 61 | 61 | if (strncmp((const char *)h, "VFD1.0", 6) == 0) |
| 62 | 62 | return 100; |
| 63 | ||
| 63 | ||
| 64 | 64 | return 0; |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | bool fdd_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) |
| 68 | 68 | { |
| 69 | UINT8 hsec[0x0c]; | |
| 70 | ||
| 69 | UINT8 hsec[0x0c]; | |
| 70 | ||
| 71 | 71 | // sector map |
| 72 | 72 | UINT8 num_secs[160]; |
| 73 | 73 | UINT8 tracks[160 * 26]; |
| r242631 | r242632 | |
| 76 | 76 | UINT8 fill_vals[160 * 26]; |
| 77 | 77 | UINT32 sec_offs[160 * 26]; |
| 78 | 78 | UINT8 sec_sizes[160 * 26]; |
| 79 | ||
| 79 | ||
| 80 | 80 | int pos = 0xdc; |
| 81 | ||
| 81 | ||
| 82 | 82 | for (int track = 0; track < 160; track++) |
| 83 | 83 | { |
| 84 | 84 | int curr_num_sec = 0, curr_track_size = 0; |
| r242631 | r242632 | |
| 87 | 87 | // read sector map for this sector |
| 88 | 88 | io_generic_read(io, hsec, pos, 0x0c); |
| 89 | 89 | pos += 0x0c; |
| 90 | ||
| 91 | if (hsec[0] == 0xff) // unformatted/unused sector | |
| 90 | ||
| 91 | if (hsec[0] == 0xff) // unformatted/unused sector | |
| 92 | 92 | continue; |
| 93 | ||
| 93 | ||
| 94 | 94 | tracks[(track * 26) + sect] = hsec[0]; |
| 95 | 95 | heads[(track * 26) + sect] = hsec[1]; |
| 96 | 96 | secs[(track * 26) + sect] = hsec[2]; |
| r242631 | r242632 | |
| 110 | 110 | int cur_sec_map = 0, sector_size; |
| 111 | 111 | |
| 112 | 112 | for (int track = 0; track < 160; track++) |
| 113 | { | |
| 113 | { | |
| 114 | 114 | int cur_pos = 0; |
| 115 | for (int i = 0; i < num_secs[track]; i++) | |
| 115 | for (int i = 0; i < num_secs[track]; i++) | |
| 116 | 116 | { |
| 117 | 117 | cur_sec_map = track * 26 + i; |
| 118 | 118 | sector_size = 128 << sec_sizes[cur_sec_map]; |
| r242631 | r242632 | |
| 121 | 121 | memset(sect_data + cur_pos, fill_vals[cur_sec_map], sector_size); |
| 122 | 122 | else |
| 123 | 123 | io_generic_read(io, sect_data + cur_pos, sec_offs[cur_sec_map], sector_size); |
| 124 | ||
| 124 | ||
| 125 | 125 | sects[i].track = tracks[cur_sec_map]; |
| 126 | 126 | sects[i].head = heads[cur_sec_map]; |
| 127 | 127 | sects[i].sector = secs[cur_sec_map]; |
| r242631 | r242632 | |
| 135 | 135 | |
| 136 | 136 | build_pc_track_mfm(track / 2, track % 2, image, cell_count, num_secs[track], sects, calc_default_pc_gap3_size(form_factor, (128 << sec_sizes[track * 26]))); |
| 137 | 137 | } |
| 138 | ||
| 138 | ||
| 139 | 139 | return true; |
| 140 | 140 | } |
| 141 | 141 |
| r242631 | r242632 | |
|---|---|---|
| 30 | 30 | 0xA = PDA (disk type) |
| 31 | 31 | 0xB-0xF = reserved and equal to 0x00 (possibly available for future format extensions?) |
| 32 | 32 | |
| 33 | ||
| 34 | Revision 1 | |
| 33 | ||
| 34 | Revision 1 | |
| 35 | 35 | ========== |
| 36 | ||
| 36 | ||
| 37 | 37 | header structure (variable length > 0x120, header length = DWORD at 0x110) |
| 38 | 38 | 0x000-0x11F = same as Rev. 0 format |
| 39 | ||
| 39 | 0x120-0x3AF = 164 DWORDs containing, for each track, the absolute position of the sector maps | |
| 40 | 40 | for sectors of the track. for unformatted/unused tracks 0 is used |
| 41 | 41 | 0x3B0-0x3B3 = absolute position of addintional info in the header, if any |
| 42 | 42 | 0x3B4-0x3BF = reserved |
| 43 | 0x120-EOHeader = sector map + special data for each track: | |
| 43 | 0x120-EOHeader = sector map + special data for each track: | |
| 44 | 44 | first 0x10 of each track = #sectors (WORD), #extra data (WORD), reserved 0xc bytes zeroed |
| 45 | 45 | then 0x10 for each sector of this track and 0x10 for each extra data chunk |
| 46 | 46 | |
| 47 | 47 | sector map structure |
| 48 | ||
| 48 | 0x0 = track number | |
| 49 | 49 | 0x1 = head |
| 50 | 50 | 0x2 = sector number |
| 51 | 51 | 0x3 = sector size (in 128byte chunks) |
| r242631 | r242632 | |
| 74 | 74 | - add support for DDAM in Rev. 0 (need an image which set it in some sector) |
| 75 | 75 | - investigate the READ DATA bytes of sector headers |
| 76 | 76 | - investigate RETRY DATA chunks |
| 77 | ||
| 77 | ||
| 78 | 78 | *********************************************************************/ |
| 79 | 79 | |
| 80 | 80 | #include "emu.h" |
| r242631 | r242632 | |
| 101 | 101 | |
| 102 | 102 | int nfd_format::identify(io_generic *io, UINT32 form_factor) |
| 103 | 103 | { |
| 104 | UINT8 h[16]; | |
| 104 | UINT8 h[16]; | |
| 105 | 105 | io_generic_read(io, h, 0, 16); |
| 106 | ||
| 106 | ||
| 107 | 107 | if (strncmp((const char *)h, "T98FDDIMAGE.R0", 14) == 0 || strncmp((const char *)h, "T98FDDIMAGE.R1", 14) == 0) |
| 108 | 108 | return 100; |
| 109 | 109 | |
| r242631 | r242632 | |
| 113 | 113 | bool nfd_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) |
| 114 | 114 | { |
| 115 | 115 | UINT64 size = io_generic_size(io); |
| 116 | UINT8 h[0x120], hsec[0x10]; | |
| 116 | UINT8 h[0x120], hsec[0x10]; | |
| 117 | 117 | io_generic_read(io, h, 0, 0x120); |
| 118 | 118 | int format_version = !strncmp((const char *)h, "T98FDDIMAGE.R0", 14) ? 0 : 1; |
| 119 | 119 | |
| r242631 | r242632 | |
| 156 | 156 | for (int sect = 0; sect < num_secs[track]; sect++) |
| 157 | 157 | { |
| 158 | 158 | io_generic_read(io, hsec, secmap_addr, 0x10); |
| 159 | ||
| 159 | ||
| 160 | 160 | if (track == 0 && sect == 0) |
| 161 | disk_type = hsec[0xb]; | |
| 161 | disk_type = hsec[0xb]; // can this change across the disk? I don't think so... | |
| 162 | 162 | secmap_addr += 0x10; |
| 163 | ||
| 163 | ||
| 164 | 164 | tracks[(track * 26) + sect] = hsec[0]; |
| 165 | 165 | heads[(track * 26) + sect] = hsec[1]; |
| 166 | 166 | secs[(track * 26) + sect] = hsec[2]; |
| 167 | 167 | sec_sizes[(track * 26) + sect] = hsec[3]; |
| 168 | 168 | mfm[(track * 26) + sect] = hsec[4]; |
| 169 | ||
| 169 | ||
| 170 | 170 | curr_track_size += (128 << hsec[3]); |
| 171 | 171 | } |
| 172 | 172 | |
| r242631 | r242632 | |
| 174 | 174 | { |
| 175 | 175 | for (int sect = 0; sect < num_specials[track]; sect++) |
| 176 | 176 | { |
| 177 | io_generic_read(io, hsec, secmap_addr, 0x10); | |
| 177 | io_generic_read(io, hsec, secmap_addr, 0x10); | |
| 178 | 178 | secmap_addr += 0x10; |
| 179 | 179 | curr_track_size += (hsec[9] + 1) * LITTLE_ENDIANIZE_INT32(*(UINT32 *)(hsec + 0x0a)); |
| 180 | 180 | } |
| r242631 | r242632 | |
| 200 | 200 | io_generic_read(io, hsec, pos, 0x10); |
| 201 | 201 | |
| 202 | 202 | if (track == 0 && sect == 0) |
| 203 | disk_type = hsec[0xa]; | |
| 203 | disk_type = hsec[0xa]; // can this change across the disk? I don't think so... | |
| 204 | 204 | pos += 0x10; |
| 205 | ||
| 206 | if (hsec[0] == 0xff) // unformatted/unused sector | |
| 205 | ||
| 206 | if (hsec[0] == 0xff) // unformatted/unused sector | |
| 207 | 207 | continue; |
| 208 | ||
| 208 | ||
| 209 | 209 | tracks[(track * 26) + sect] = hsec[0]; |
| 210 | 210 | heads[(track * 26) + sect] = hsec[1]; |
| 211 | 211 | secs[(track * 26) + sect] = hsec[2]; |
| 212 | 212 | sec_sizes[(track * 26) + sect] = hsec[3]; |
| 213 | 213 | mfm[(track * 26) + sect] = hsec[4]; |
| 214 | ||
| 214 | ||
| 215 | 215 | curr_track_size += (128 << hsec[3]); |
| 216 | 216 | curr_num_sec++; |
| 217 | 217 | } |
| r242631 | r242632 | |
| 226 | 226 | |
| 227 | 227 | switch (disk_type) |
| 228 | 228 | { |
| 229 | case 0x10: | |
| 229 | case 0x10: // 640K disk, 2DD | |
| 230 | 230 | image->set_variant(floppy_image::DSDD); |
| 231 | 231 | break; |
| 232 | //case 0x30: // 1.44M disk, ?? (no images found) | |
| 233 | // break; | |
| 234 | case 0x90: // 1.2M disk, 2HD | |
| 232 | //case 0x30: // 1.44M disk, ?? (no images found) | |
| 233 | // break; | |
| 234 | case 0x90: // 1.2M disk, 2HD | |
| 235 | 235 | default: |
| 236 | 236 | image->set_variant(floppy_image::DSHD); |
| 237 | 237 | break; |
| r242631 | r242632 | |
| 246 | 246 | { |
| 247 | 247 | io_generic_read(io, sect_data, pos, track_sizes[track]); |
| 248 | 248 | |
| 249 | for (int i = 0; i < num_secs[track]; i++) | |
| 249 | for (int i = 0; i < num_secs[track]; i++) | |
| 250 | 250 | { |
| 251 | 251 | cur_sec_map = track * 26 + i; |
| 252 | 252 | sector_size = 128 << sec_sizes[cur_sec_map]; |
| r242631 | r242632 | |
| 261 | 261 | } |
| 262 | 262 | pos += track_sizes[track]; |
| 263 | 263 | |
| 264 | // notice that the operation below might fail if sectors of the same track have variable sec_sizes, | |
| 264 | // notice that the operation below might fail if sectors of the same track have variable sec_sizes, | |
| 265 | 265 | // because the gap3 calculation would account correctly only for the first sector... |
| 266 | 266 | // examined images had constant sec_sizes in the each track, so probably this is not an issue |
| 267 | 267 | if (mfm[track * 26]) |
| r242631 | r242632 | |
| 269 | 269 | else |
| 270 | 270 | build_pc_track_fm(track / 2, track % 2, image, cell_count, num_secs[track], sects, calc_default_pc_gap3_size(form_factor, (128 << sec_sizes[track * 26]))); |
| 271 | 271 | } |
| 272 | ||
| 272 | ||
| 273 | 273 | return true; |
| 274 | 274 | } |
| 275 | 275 |
| r242631 | r242632 | |
|---|---|---|
| 40 | 40 | cell 2.13 usec |
| 41 | 41 | |
| 42 | 42 | |
| 43 | Boot Disc Label Format | |
| 44 | Track 0 Sector 0 | |
| 43 | Boot Disc Label Format | |
| 44 | Track 0 Sector 0 | |
| 45 | 45 | |
| 46 | Byte | |
| 47 | Offset Name Description | |
| 46 | Byte | |
| 47 | Offset Name Description | |
| 48 | 48 | |
| 49 | 0 System disc ID literally, ff,00h for a system | |
| 50 | disc | |
| 49 | 0 System disc ID literally, ff,00h for a system | |
| 50 | disc | |
| 51 | 51 | |
| 52 | 2 Load address paragraph to load booted | |
| 53 | program at. If zero then boot | |
| 54 | loads in high memory. | |
| 52 | 2 Load address paragraph to load booted | |
| 53 | program at. If zero then boot | |
| 54 | loads in high memory. | |
| 55 | 55 | |
| 56 | ||
| 56 | 4 Length paragraph count to load. | |
| 57 | 57 | |
| 58 | 6 Entry offset I.P. value for transfer of | |
| 59 | control. | |
| 58 | 6 Entry offset I.P. value for transfer of | |
| 59 | control. | |
| 60 | 60 | |
| 61 | 8 Entry segment C.S. value for transfer of | |
| 62 | control. | |
| 61 | 8 Entry segment C.S. value for transfer of | |
| 62 | control. | |
| 63 | 63 | |
| 64 | ||
| 64 | 10 I.D. disc identifier. | |
| 65 | 65 | |
| 66 | 18 Part number system identifier - displayed | |
| 67 | by early versions of boot. | |
| 66 | 18 Part number system identifier - displayed | |
| 67 | by early versions of boot. | |
| 68 | 68 | |
| 69 | ||
| 69 | 26 Sector size byte count for sectors. | |
| 70 | 70 | |
| 71 | 28 Data start first data sector on disc | |
| 72 | (absolute sectors). | |
| 71 | 28 Data start first data sector on disc | |
| 72 | (absolute sectors). | |
| 73 | 73 | |
| 74 | 30 Boot start first absolute sector of | |
| 75 | program for boot to load at | |
| 76 | 'load address' for 'length' | |
| 77 | paragraphs. | |
| 74 | 30 Boot start first absolute sector of | |
| 75 | program for boot to load at | |
| 76 | 'load address' for 'length' | |
| 77 | paragraphs. | |
| 78 | 78 | |
| 79 | 32 Flags indicators: | |
| 80 | bit meaning | |
| 81 | 15-12 interleave factor | |
| 82 | (0-15) | |
| 83 | 0 0=single sided | |
| 84 | 1=double sided | |
| 79 | 32 Flags indicators: | |
| 80 | bit meaning | |
| 81 | 15-12 interleave factor | |
| 82 | (0-15) | |
| 83 | 0 0=single sided | |
| 84 | 1=double sided | |
| 85 | 85 | |
| 86 | 34 Disc type 00 = CP/M | |
| 87 | 01 = MS-DOS | |
| 86 | 34 Disc type 00 = CP/M | |
| 87 | 01 = MS-DOS | |
| 88 | 88 | |
| 89 | ||
| 89 | 35 Reserved | |
| 90 | 90 | |
| 91 | 38 Speed table information for speed control | |
| 92 | proc. | |
| 91 | 38 Speed table information for speed control | |
| 92 | proc. | |
| 93 | 93 | |
| 94 | ||
| 94 | 56 Zone table high track for each zone. | |
| 95 | 95 | |
| 96 | 71 Sector/track sectors per track for each | |
| 97 | zone. | |
| 96 | 71 Sector/track sectors per track for each | |
| 97 | zone. | |
| 98 | 98 | */ |
| 99 | 99 | |
| 100 | 100 | #include "emu.h" |
| r242631 | r242632 | |
|---|---|---|
| 471 | 471 | required_device<ay8910_device> m_ay8910; |
| 472 | 472 | required_device<gfxdecode_device> m_gfxdecode; |
| 473 | 473 | required_device<palette_device> m_palette; |
| 474 | ||
| 474 | ||
| 475 | 475 | required_shared_ptr<UINT8> m_videoram; |
| 476 | 476 | required_shared_ptr<UINT8> m_colorram; |
| 477 | ||
| 477 | ||
| 478 | 478 | UINT8 m_main_latch_d800; |
| 479 | 479 | UINT8 m_snd_latch_0800; |
| 480 | 480 | UINT8 m_snd_latch_0a02; |
| 481 | 481 | UINT8 m_ay8910_addr; |
| 482 | 482 | tilemap_t *m_bg_tilemap; |
| 483 | 483 | int m_mux_data; |
| 484 | ||
| 484 | ||
| 485 | 485 | DECLARE_WRITE8_MEMBER(fclown_videoram_w); |
| 486 | 486 | DECLARE_WRITE8_MEMBER(fclown_colorram_w); |
| 487 | 487 | DECLARE_WRITE8_MEMBER(cpu_c048_w); |
| r242631 | r242632 | |
| 505 | 505 | }; |
| 506 | 506 | |
| 507 | 507 | void _5clown_state::machine_start() |
| 508 | { | |
| 508 | { | |
| 509 | 509 | m_main_latch_d800 = m_snd_latch_0800 = m_snd_latch_0a02 = m_ay8910_addr = m_mux_data = 0; |
| 510 | ||
| 510 | ||
| 511 | 511 | save_item(NAME(m_main_latch_d800)); |
| 512 | 512 | save_item(NAME(m_snd_latch_0800)); |
| 513 | 513 | save_item(NAME(m_snd_latch_0a02)); |
| r242631 | r242632 | |
|---|---|---|
| 409 | 409 | |
| 410 | 410 | void smashdrv_state::machine_start() |
| 411 | 411 | { |
| 412 | ||
| 413 | 412 | } |
| 414 | 413 | |
| 415 | 414 | void smashdrv_state::machine_reset() |
| r242631 | r242632 | |
| 423 | 422 | static ADDRESS_MAP_START( atvtrack_main_map, AS_PROGRAM, 64, atvtrack_state ) |
| 424 | 423 | AM_RANGE(0x00000000, 0x000003ff) AM_RAM AM_SHARE("sharedmem") |
| 425 | 424 | AM_RANGE(0x00020000, 0x00020007) AM_READWRITE(control_r, control_w) // control registers |
| 426 | // | |
| 425 | // AM_RANGE(0x00020040, 0x0002007f) // audio DAC buffer | |
| 427 | 426 | AM_RANGE(0x14000000, 0x14000007) AM_READWRITE(area2_r, area2_w) // data |
| 428 | 427 | AM_RANGE(0x14100000, 0x14100007) AM_READWRITE(area3_r, area3_w) // command |
| 429 | 428 | AM_RANGE(0x14200000, 0x14200007) AM_READWRITE(area4_r, area4_w) // address |
| r242631 | r242632 | |
| 585 | 584 | ROM_LOAD("prg.ic23", 0x0000000, 0x0400000, CRC(5cc6d3ac) SHA1(0c8426774212d891796b59c95b8c70f64db5b67a) ) |
| 586 | 585 | |
| 587 | 586 | ROM_REGION( 0x4000000, "maincpu", ROMREGION_ERASEFF) |
| 588 | ROM_LOAD32_WORD("sdra.ic15", 0x00000000, 0x01000000, CRC(cf702287) SHA1(84cd83c339831deff15fe5fcc353e0b596667500) ) | |
| 589 | ROM_LOAD32_WORD("sdrb.ic14", 0x00000002, 0x01000000, CRC(39b76f0e) SHA1(529943b6075925e5f72c6e966796e04b2c33686c) ) | |
| 590 | ROM_LOAD32_WORD("sdrc.ic20", 0x02000000, 0x01000000, CRC(c9021dd7) SHA1(1d08aab433614810af858a0fc5d7f03c7b782237) ) | |
| 587 | ROM_LOAD32_WORD("sdra.ic15", 0x00000000, 0x01000000, CRC(cf702287) SHA1(84cd83c339831deff15fe5fcc353e0b596667500) ) | |
| 588 | ROM_LOAD32_WORD("sdrb.ic14", 0x00000002, 0x01000000, CRC(39b76f0e) SHA1(529943b6075925e5f72c6e966796e04b2c33686c) ) | |
| 589 | ROM_LOAD32_WORD("sdrc.ic20", 0x02000000, 0x01000000, CRC(c9021dd7) SHA1(1d08aab433614810af858a0fc5d7f03c7b782237) ) | |
| 591 | 590 | // ic21 unpopulated |
| 592 | 591 | ROM_END |
| 593 | 592 |
| r242631 | r242632 | |
|---|---|---|
| 2 | 2 | // copyright-holders:FelipeSanches |
| 3 | 3 | /************************************************************************* |
| 4 | 4 | |
| 5 | ||
| 5 | barata.c | |
| 6 | 6 | |
| 7 | ||
| 7 | "Dona Barata" | |
| 8 | 8 | |
| 9 | Brazilian "whack-a-mole"-style game themed after stepping on cockroaches. | |
| 10 | The name "Dona Barata" means "Lady Cockroach" in brazilian portuguese. | |
| 9 | Brazilian "whack-a-mole"-style game themed after stepping on cockroaches. | |
| 10 | The name "Dona Barata" means "Lady Cockroach" in brazilian portuguese. | |
| 11 | 11 | |
| 12 | Manufactured by Matic: http://maticplay.com.br/ | |
| 13 | This driver still only emulates an early prototype of the game. | |
| 14 | Propper dumps of the actual released game is still lacking. | |
| 15 | Photos on the web make us believe that there are at least 2 official | |
| 12 | Manufactured by Matic: http://maticplay.com.br/ | |
| 13 | This driver still only emulates an early prototype of the game. | |
| 14 | Propper dumps of the actual released game is still lacking. | |
| 15 | Photos on the web make us believe that there are at least 2 official | |
| 16 | 16 | releases of this game. |
| 17 | 17 | |
| 18 | http://www.maticplay.com.br/equipamentos.php?equipamento=dona-barata | |
| 19 | http://www.valedosduendes.com.br/site/wp-content/uploads/2012/02/barata_1.jpg | |
| 18 | http://www.maticplay.com.br/equipamentos.php?equipamento=dona-barata | |
| 19 | http://www.valedosduendes.com.br/site/wp-content/uploads/2012/02/barata_1.jpg | |
| 20 | 20 | |
| 21 | 21 | Driver by Felipe Sanches <juca@members.fsf.org> |
| 22 | 22 | |
| 23 | 23 | ************************************************************************** |
| 24 | 24 | |
| 25 | ||
| 25 | TO-DO: | |
| 26 | 26 | |
| 27 | * at the moment, the portbits for the rows are still a guess | |
| 28 | * as we don't have access to actual PCBs, the CPU clock frequency is a guess | |
| 29 | (but maybe it can be infered by analysing the 1ms delay routine used) | |
| 30 | * we don't have sound samples or background music dumps | |
| 31 | (i.e. we lack dumps of all of the sound memory) | |
| 32 | * we don't have ROM dumps of the official releases of the game | |
| 33 | * it would be nice to add photographic artwork to improve the layout | |
| 27 | * at the moment, the portbits for the rows are still a guess | |
| 28 | * as we don't have access to actual PCBs, the CPU clock frequency is a guess | |
| 29 | (but maybe it can be infered by analysing the 1ms delay routine used) | |
| 30 | * we don't have sound samples or background music dumps | |
| 31 | (i.e. we lack dumps of all of the sound memory) | |
| 32 | * we don't have ROM dumps of the official releases of the game | |
| 33 | * it would be nice to add photographic artwork to improve the layout | |
| 34 | 34 | |
| 35 | 35 | **************************************************************************/ |
| 36 | 36 | |
| r242631 | r242632 | |
| 138 | 138 | return segment; |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | #define FPGA_PLAY_BGM 0 | |
| 142 | #define FPGA_STOP_BGM 1 | |
| 143 | #define FPGA_PLAY_SAMPLE 2 | |
| 144 | #define FPGA_LAMP 3 | |
| 145 | #define FPGA_COUNTER 4 | |
| 146 | #define FPGA_WAITING_FOR_NEW_CMD 5 | |
| 141 | #define FPGA_PLAY_BGM 0 | |
| 142 | #define FPGA_STOP_BGM 1 | |
| 143 | #define FPGA_PLAY_SAMPLE 2 | |
| 144 | #define FPGA_LAMP 3 | |
| 145 | #define FPGA_COUNTER 4 | |
| 146 | #define FPGA_WAITING_FOR_NEW_CMD 5 | |
| 147 | 147 | |
| 148 | 148 | const char* mode_strings[] = { |
| 149 | 149 | "Play background music", |
| r242631 | r242632 | |
| 193 | 193 | lamp_index = lamp_data & 0x0F; |
| 194 | 194 | |
| 195 | 195 | if (erase_all){ |
| 196 | // | |
| 196 | // logerror("LED: ERASE ALL\n"); | |
| 197 | 197 | for (int i=0; i<16; i++){ |
| 198 | 198 | output_set_led_value(i, 1); |
| 199 | 199 | } |
| r242631 | r242632 | |
| 329 | 329 | /************************* |
| 330 | 330 | * Game Drivers * |
| 331 | 331 | *************************/ |
| 332 | GAME( 2002, barata, 0, barata, barata, driver_device, 0, ROT0, "Eletro Matic Equipamentos Eletromec | |
| 332 | GAME( 2002, barata, 0, barata, barata, driver_device, 0, ROT0, "Eletro Matic Equipamentos Eletromec??nicos", "Dona Barata (early prototype)", GAME_IMPERFECT_GRAPHICS ) |
| r242631 | r242632 | |
|---|---|---|
| 178 | 178 | DECLARE_READ8_MEMBER(nec_r); |
| 179 | 179 | DECLARE_WRITE8_MEMBER(nec_reset_w); |
| 180 | 180 | DECLARE_WRITE8_MEMBER(nec_latch_w); |
| 181 | ||
| 181 | ||
| 182 | 182 | void save_state(); |
| 183 | 183 | |
| 184 | 184 | DECLARE_DRIVER_INIT(toppoker); |
| r242631 | r242632 | |
|---|---|---|
| 3613 | 3613 | |
| 3614 | 3614 | /* video hardware */ |
| 3615 | 3615 | MCFG_DEFAULT_LAYOUT(layout_sc2_vfd) |
| 3616 | ||
| 3616 | ||
| 3617 | 3617 | MCFG_DEVICE_ADD("reel0", STEPPER, 0) |
| 3618 | 3618 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(bfm_sc2_state, reel0_optic_cb)) |
| 3619 | 3619 | MCFG_DEVICE_ADD("reel1", STEPPER, 0) |
| r242631 | r242632 | |
| 3621 | 3621 | MCFG_DEVICE_ADD("reel2", STEPPER, 0) |
| 3622 | 3622 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(bfm_sc2_state, reel2_optic_cb)) |
| 3623 | 3623 | MCFG_DEVICE_ADD("reel3", STEPPER, 0) |
| 3624 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(bfm_sc2_state, reel3_optic_cb)) | |
| 3624 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(bfm_sc2_state, reel3_optic_cb)) | |
| 3625 | 3625 | MCFG_DEVICE_ADD("reel4", STEPPER, 0) |
| 3626 | 3626 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(bfm_sc2_state, reel4_optic_cb)) |
| 3627 | 3627 | MCFG_DEVICE_ADD("reel5", STEPPER, 0) |
| r242631 | r242632 | |
| 3663 | 3663 | MCFG_CPU_ADD("matrix", M6809, 2000000 ) /* matrix board 6809 CPU at 2 Mhz ?? I don't know the exact freq.*/ |
| 3664 | 3664 | MCFG_CPU_PROGRAM_MAP(bfm_dm01_memmap) |
| 3665 | 3665 | MCFG_CPU_PERIODIC_INT_DRIVER(bfm_sc2_state, nmi_line_assert, 1500 ) /* generate 1500 NMI's per second ?? what is the exact freq?? */ |
| 3666 | ||
| 3666 | ||
| 3667 | 3667 | MCFG_DEVICE_ADD("reel0", STEPPER, 0) |
| 3668 | 3668 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(bfm_sc2_state, reel0_optic_cb)) |
| 3669 | 3669 | MCFG_DEVICE_ADD("reel1", STEPPER, 0) |
| r242631 | r242632 | |
| 3671 | 3671 | MCFG_DEVICE_ADD("reel2", STEPPER, 0) |
| 3672 | 3672 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(bfm_sc2_state, reel2_optic_cb)) |
| 3673 | 3673 | MCFG_DEVICE_ADD("reel3", STEPPER, 0) |
| 3674 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(bfm_sc2_state, reel3_optic_cb)) | |
| 3674 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(bfm_sc2_state, reel3_optic_cb)) | |
| 3675 | 3675 | MCFG_DEVICE_ADD("reel4", STEPPER, 0) |
| 3676 | 3676 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(bfm_sc2_state, reel4_optic_cb)) |
| 3677 | 3677 | MCFG_DEVICE_ADD("reel5", STEPPER, 0) |
| r242631 | r242632 | |
|---|---|---|
| 28317 | 28317 | GAMEL( 200?, sc4pacclb ,sc4paccl, sc4_5reel, sc4paccl, sc4_state, sc4paccl, ROT0, "Mazooma","Pac Man Club (PR2018, CPAC) (Mazooma) (Scorpion 4) (set 3)", GAME_NOT_WORKING | GAME_CLICKABLE_ARTWORK, layout_bfm_sc4 ) |
| 28318 | 28318 | GAMEL( 200?, sc4pacclc ,sc4paccl, sc4_5reel, sc4paccl, sc4_state, sc4paccl, ROT0, "Mazooma","Pac Man Club (PR2018, CPAC) (Mazooma) (Scorpion 4) (set 4)", GAME_NOT_WORKING | GAME_CLICKABLE_ARTWORK, layout_bfm_sc4 ) |
| 28319 | 28319 | |
| 28320 | ||
| 28320 | ||
| 28321 | 28321 | // REEL 4 ERR 24 (what type should be here??) |
| 28322 | 28322 | |
| 28323 | 28323 | DRIVER_INIT_MEMBER(sc4_state,sc4pmani) |
| r242631 | r242632 | |
|---|---|---|
| 522 | 522 | m_reel1->update( data &0x0f); |
| 523 | 523 | awp_draw_reel("reel1", m_reel1); |
| 524 | 524 | } |
| 525 | ||
| 526 | if (m_reel2) | |
| 525 | ||
| 526 | if (m_reel2) | |
| 527 | 527 | { |
| 528 | 528 | m_reel2->update((data>>4)&0x0f); |
| 529 | 529 | awp_draw_reel("reel2", m_reel2); |
| r242631 | r242632 | |
| 651 | 651 | m_reel5->update( data &0x0f); |
| 652 | 652 | awp_draw_reel("reel5", m_reel5); |
| 653 | 653 | } |
| 654 | ||
| 655 | if (m_reel6) | |
| 654 | ||
| 655 | if (m_reel6) | |
| 656 | 656 | { |
| 657 | 657 | m_reel6->update((data>>4)&0x0f); |
| 658 | 658 | awp_draw_reel("reel6", m_reel6); |
| r242631 | r242632 | |
| 712 | 712 | MCFG_YMZ280B_IRQ_HANDLER(WRITELINE(sc4_state, bfm_sc4_irqhandler)) |
| 713 | 713 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 714 | 714 | MACHINE_CONFIG_END |
| 715 | ||
| 715 | ||
| 716 | 716 | //Standard 6 reels all connected |
| 717 | 717 | MACHINE_CONFIG_START( sc4, sc4_state ) |
| 718 | 718 | MCFG_FRAGMENT_ADD(sc4_common) |
| 719 | ||
| 719 | ||
| 720 | 720 | MCFG_STARPOINT_RM20_48STEP_ADD("reel1") |
| 721 | 721 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel1_optic_cb)) |
| 722 | 722 | MCFG_STARPOINT_RM20_48STEP_ADD("reel2") |
| r242631 | r242632 | |
| 734 | 734 | //Standard 3 reels |
| 735 | 735 | MACHINE_CONFIG_START( sc4_3reel, sc4_state ) |
| 736 | 736 | MCFG_FRAGMENT_ADD(sc4_common) |
| 737 | ||
| 737 | ||
| 738 | 738 | MCFG_STARPOINT_RM20_48STEP_ADD("reel1") |
| 739 | 739 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel1_optic_cb)) |
| 740 | 740 | MCFG_STARPOINT_RM20_48STEP_ADD("reel2") |
| 741 | 741 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel2_optic_cb)) |
| 742 | 742 | MCFG_STARPOINT_RM20_48STEP_ADD("reel3") |
| 743 | 743 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel3_optic_cb)) |
| 744 | ||
| 744 | ||
| 745 | 745 | MACHINE_CONFIG_END |
| 746 | 746 | |
| 747 | 747 | //Standard 4 reels |
| 748 | 748 | MACHINE_CONFIG_START( sc4_4reel, sc4_state ) |
| 749 | 749 | MCFG_FRAGMENT_ADD(sc4_common) |
| 750 | ||
| 750 | ||
| 751 | 751 | MCFG_STARPOINT_RM20_48STEP_ADD("reel1") |
| 752 | 752 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel1_optic_cb)) |
| 753 | 753 | MCFG_STARPOINT_RM20_48STEP_ADD("reel2") |
| r242631 | r242632 | |
| 762 | 762 | MACHINE_CONFIG_START( sc4_4reel_alt, sc4_state ) |
| 763 | 763 | |
| 764 | 764 | MCFG_FRAGMENT_ADD(sc4_common) |
| 765 | ||
| 765 | ||
| 766 | 766 | MCFG_STARPOINT_RM20_48STEP_ADD("reel1") |
| 767 | 767 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel1_optic_cb)) |
| 768 | 768 | MCFG_STARPOINT_RM20_48STEP_ADD("reel2") |
| 769 | 769 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel2_optic_cb)) |
| 770 | 770 | MCFG_STARPOINT_RM20_48STEP_ADD("reel3") |
| 771 | 771 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel3_optic_cb)) |
| 772 | ||
| 772 | ||
| 773 | 773 | MCFG_STARPOINT_RM20_48STEP_ADD("reel5") |
| 774 | 774 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel5_optic_cb)) |
| 775 | 775 | MACHINE_CONFIG_END |
| r242631 | r242632 | |
| 778 | 778 | //Standard 5 reels |
| 779 | 779 | MACHINE_CONFIG_START( sc4_5reel, sc4_state ) |
| 780 | 780 | MCFG_FRAGMENT_ADD(sc4_common) |
| 781 | ||
| 781 | ||
| 782 | 782 | MCFG_STARPOINT_RM20_48STEP_ADD("reel1") |
| 783 | 783 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel1_optic_cb)) |
| 784 | 784 | MCFG_STARPOINT_RM20_48STEP_ADD("reel2") |
| r242631 | r242632 | |
| 794 | 794 | //5 reels, with RL4 skipped |
| 795 | 795 | MACHINE_CONFIG_START( sc4_5reel_alt, sc4_state ) |
| 796 | 796 | MCFG_FRAGMENT_ADD(sc4_common) |
| 797 | ||
| 797 | ||
| 798 | 798 | MCFG_STARPOINT_RM20_48STEP_ADD("reel1") |
| 799 | 799 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel1_optic_cb)) |
| 800 | 800 | MCFG_STARPOINT_RM20_48STEP_ADD("reel2") |
| 801 | 801 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel2_optic_cb)) |
| 802 | 802 | MCFG_STARPOINT_RM20_48STEP_ADD("reel3") |
| 803 | 803 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel3_optic_cb)) |
| 804 | ||
| 804 | ||
| 805 | 805 | MCFG_STARPOINT_RM20_48STEP_ADD("reel5") |
| 806 | 806 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel5_optic_cb)) |
| 807 | 807 | MCFG_STARPOINT_RM20_48STEP_ADD("reel6") |
| 808 | 808 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel6_optic_cb)) |
| 809 | ||
| 809 | ||
| 810 | 810 | MACHINE_CONFIG_END |
| 811 | 811 | |
| 812 | 812 | //6 reels, last 200 steps |
| 813 | 813 | MACHINE_CONFIG_START( sc4_200_std, sc4_state ) |
| 814 | 814 | |
| 815 | 815 | MCFG_FRAGMENT_ADD(sc4_common) |
| 816 | ||
| 816 | ||
| 817 | 817 | MCFG_STARPOINT_RM20_48STEP_ADD("reel1") |
| 818 | 818 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel1_optic_cb)) |
| 819 | 819 | MCFG_STARPOINT_RM20_48STEP_ADD("reel2") |
| r242631 | r242632 | |
| 823 | 823 | MCFG_STARPOINT_RM20_48STEP_ADD("reel4") |
| 824 | 824 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel4_optic_cb)) |
| 825 | 825 | MCFG_STARPOINT_RM20_48STEP_ADD("reel5") |
| 826 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel5_optic_cb)) | |
| 826 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel5_optic_cb)) | |
| 827 | 827 | MCFG_STARPOINT_200STEP_ADD("reel6") |
| 828 | 828 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel6_optic_cb)) |
| 829 | 829 | MACHINE_CONFIG_END |
| r242631 | r242632 | |
| 831 | 831 | //6 reels, last 200 steps |
| 832 | 832 | MACHINE_CONFIG_START( sc4_200_alt, sc4_state ) |
| 833 | 833 | MCFG_FRAGMENT_ADD(sc4_common) |
| 834 | ||
| 834 | ||
| 835 | 835 | MCFG_STARPOINT_RM20_48STEP_ADD("reel1") |
| 836 | 836 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel1_optic_cb)) |
| 837 | 837 | MCFG_STARPOINT_RM20_48STEP_ADD("reel2") |
| r242631 | r242632 | |
| 841 | 841 | MCFG_STARPOINT_200STEP_ADD("reel4") |
| 842 | 842 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel4_optic_cb)) |
| 843 | 843 | MCFG_STARPOINT_200STEP_ADD("reel5") |
| 844 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel5_optic_cb)) | |
| 844 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel5_optic_cb)) | |
| 845 | 845 | MCFG_STARPOINT_RM20_48STEP_ADD("reel6") |
| 846 | 846 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel6_optic_cb)) |
| 847 | 847 | MACHINE_CONFIG_END |
| r242631 | r242632 | |
| 849 | 849 | //6 reels, RL4 200 steps |
| 850 | 850 | MACHINE_CONFIG_START( sc4_200_alta, sc4_state ) |
| 851 | 851 | MCFG_FRAGMENT_ADD(sc4_common) |
| 852 | ||
| 852 | ||
| 853 | 853 | MCFG_STARPOINT_RM20_48STEP_ADD("reel1") |
| 854 | 854 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel1_optic_cb)) |
| 855 | 855 | MCFG_STARPOINT_RM20_48STEP_ADD("reel2") |
| r242631 | r242632 | |
| 859 | 859 | MCFG_STARPOINT_RM20_48STEP_ADD("reel4") |
| 860 | 860 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel4_optic_cb)) |
| 861 | 861 | MCFG_STARPOINT_200STEP_ADD("reel5") |
| 862 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel5_optic_cb)) | |
| 862 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel5_optic_cb)) | |
| 863 | 863 | MCFG_STARPOINT_RM20_48STEP_ADD("reel6") |
| 864 | 864 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel6_optic_cb)) |
| 865 | 865 | MACHINE_CONFIG_END |
| r242631 | r242632 | |
| 867 | 867 | //6 reels, 3 48 step, 3 200 step |
| 868 | 868 | MACHINE_CONFIG_START( sc4_200_altb, sc4_state ) |
| 869 | 869 | MCFG_FRAGMENT_ADD(sc4_common) |
| 870 | ||
| 870 | ||
| 871 | 871 | MCFG_STARPOINT_200STEP_ADD("reel1") |
| 872 | 872 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel1_optic_cb)) |
| 873 | 873 | MCFG_STARPOINT_200STEP_ADD("reel2") |
| r242631 | r242632 | |
| 877 | 877 | MCFG_STARPOINT_RM20_48STEP_ADD("reel4") |
| 878 | 878 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel4_optic_cb)) |
| 879 | 879 | MCFG_STARPOINT_RM20_48STEP_ADD("reel5") |
| 880 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel5_optic_cb)) | |
| 880 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel5_optic_cb)) | |
| 881 | 881 | MCFG_STARPOINT_RM20_48STEP_ADD("reel6") |
| 882 | 882 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel6_optic_cb)) |
| 883 | 883 | MACHINE_CONFIG_END |
| r242631 | r242632 | |
| 885 | 885 | //5 reels, last one 200 steps |
| 886 | 886 | MACHINE_CONFIG_START( sc4_200_5r, sc4_state ) |
| 887 | 887 | MCFG_FRAGMENT_ADD(sc4_common) |
| 888 | ||
| 888 | ||
| 889 | 889 | MCFG_STARPOINT_RM20_48STEP_ADD("reel1") |
| 890 | 890 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel1_optic_cb)) |
| 891 | 891 | MCFG_STARPOINT_RM20_48STEP_ADD("reel2") |
| r242631 | r242632 | |
| 893 | 893 | MCFG_STARPOINT_RM20_48STEP_ADD("reel3") |
| 894 | 894 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel3_optic_cb)) |
| 895 | 895 | MCFG_STARPOINT_RM20_48STEP_ADD("reel4") |
| 896 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel4_optic_cb)) | |
| 896 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel4_optic_cb)) | |
| 897 | 897 | MCFG_STARPOINT_200STEP_ADD("reel5") |
| 898 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel5_optic_cb)) | |
| 898 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel5_optic_cb)) | |
| 899 | 899 | MACHINE_CONFIG_END |
| 900 | 900 | |
| 901 | 901 | |
| r242631 | r242632 | |
| 903 | 903 | //5 reels, last one 200 steps, RL4 skipped |
| 904 | 904 | MACHINE_CONFIG_START( sc4_200_5ra, sc4_state ) |
| 905 | 905 | MCFG_FRAGMENT_ADD(sc4_common) |
| 906 | ||
| 906 | ||
| 907 | 907 | MCFG_STARPOINT_RM20_48STEP_ADD("reel1") |
| 908 | 908 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel1_optic_cb)) |
| 909 | 909 | MCFG_STARPOINT_RM20_48STEP_ADD("reel2") |
| 910 | 910 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel2_optic_cb)) |
| 911 | 911 | MCFG_STARPOINT_RM20_48STEP_ADD("reel3") |
| 912 | 912 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel3_optic_cb)) |
| 913 | ||
| 913 | ||
| 914 | 914 | MCFG_STARPOINT_RM20_48STEP_ADD("reel5") |
| 915 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel5_optic_cb)) | |
| 915 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel5_optic_cb)) | |
| 916 | 916 | MCFG_STARPOINT_200STEP_ADD("reel6") |
| 917 | 917 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel6_optic_cb)) |
| 918 | 918 | MACHINE_CONFIG_END |
| r242631 | r242632 | |
| 920 | 920 | //5 reels, last one 200 steps, RL5 skipped |
| 921 | 921 | MACHINE_CONFIG_START( sc4_200_5rb, sc4_state ) |
| 922 | 922 | MCFG_FRAGMENT_ADD(sc4_common) |
| 923 | ||
| 923 | ||
| 924 | 924 | MCFG_STARPOINT_RM20_48STEP_ADD("reel1") |
| 925 | 925 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel1_optic_cb)) |
| 926 | 926 | MCFG_STARPOINT_RM20_48STEP_ADD("reel2") |
| r242631 | r242632 | |
| 937 | 937 | //5 reels, RL5 200 steps, RL4 skipped |
| 938 | 938 | MACHINE_CONFIG_START( sc4_200_5rc, sc4_state ) |
| 939 | 939 | MCFG_FRAGMENT_ADD(sc4_common) |
| 940 | ||
| 940 | ||
| 941 | 941 | MCFG_STARPOINT_RM20_48STEP_ADD("reel1") |
| 942 | 942 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel1_optic_cb)) |
| 943 | 943 | MCFG_STARPOINT_RM20_48STEP_ADD("reel2") |
| 944 | 944 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel2_optic_cb)) |
| 945 | 945 | MCFG_STARPOINT_RM20_48STEP_ADD("reel3") |
| 946 | 946 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel3_optic_cb)) |
| 947 | ||
| 947 | ||
| 948 | 948 | MCFG_STARPOINT_200STEP_ADD("reel5") |
| 949 | 949 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel5_optic_cb)) |
| 950 | 950 | MCFG_STARPOINT_RM20_48STEP_ADD("reel6") |
| 951 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel6_optic_cb)) | |
| 951 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel6_optic_cb)) | |
| 952 | 952 | MACHINE_CONFIG_END |
| 953 | 953 | |
| 954 | 954 | //4 reels, last one 200 steps |
| 955 | 955 | MACHINE_CONFIG_START( sc4_200_4r, sc4_state ) |
| 956 | 956 | MCFG_FRAGMENT_ADD(sc4_common) |
| 957 | ||
| 957 | ||
| 958 | 958 | MCFG_STARPOINT_RM20_48STEP_ADD("reel1") |
| 959 | 959 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel1_optic_cb)) |
| 960 | 960 | MCFG_STARPOINT_RM20_48STEP_ADD("reel2") |
| r242631 | r242632 | |
| 962 | 962 | MCFG_STARPOINT_RM20_48STEP_ADD("reel3") |
| 963 | 963 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel3_optic_cb)) |
| 964 | 964 | MCFG_STARPOINT_200STEP_ADD("reel4") |
| 965 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel4_optic_cb)) | |
| 965 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel4_optic_cb)) | |
| 966 | 966 | MACHINE_CONFIG_END |
| 967 | 967 | |
| 968 | 968 | //4 reels, last one 200 steps, RL4 skipped |
| 969 | 969 | MACHINE_CONFIG_START( sc4_200_4ra, sc4_state ) |
| 970 | 970 | MCFG_FRAGMENT_ADD(sc4_common) |
| 971 | ||
| 971 | ||
| 972 | 972 | MCFG_STARPOINT_RM20_48STEP_ADD("reel1") |
| 973 | 973 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel1_optic_cb)) |
| 974 | 974 | MCFG_STARPOINT_RM20_48STEP_ADD("reel2") |
| r242631 | r242632 | |
| 984 | 984 | //4 reels, last one 200 steps, RL4,5 skipped |
| 985 | 985 | MACHINE_CONFIG_START( sc4_200_4rb, sc4_state ) |
| 986 | 986 | MCFG_FRAGMENT_ADD(sc4_common) |
| 987 | ||
| 987 | ||
| 988 | 988 | MCFG_STARPOINT_RM20_48STEP_ADD("reel1") |
| 989 | 989 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel1_optic_cb)) |
| 990 | 990 | MCFG_STARPOINT_RM20_48STEP_ADD("reel2") |
| 991 | 991 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel2_optic_cb)) |
| 992 | 992 | MCFG_STARPOINT_RM20_48STEP_ADD("reel3") |
| 993 | 993 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel3_optic_cb)) |
| 994 | ||
| 994 | ||
| 995 | 995 | MCFG_STARPOINT_200STEP_ADD("reel6") |
| 996 | 996 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel6_optic_cb)) |
| 997 | 997 | MACHINE_CONFIG_END |
| 998 | 998 | |
| 999 | 999 | MACHINE_CONFIG_START( sc4_4reel_200, sc4_state ) |
| 1000 | 1000 | MCFG_FRAGMENT_ADD(sc4_common) |
| 1001 | ||
| 1001 | ||
| 1002 | 1002 | MCFG_STARPOINT_200STEP_ADD("reel1") |
| 1003 | 1003 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel1_optic_cb)) |
| 1004 | 1004 | MCFG_STARPOINT_200STEP_ADD("reel2") |
| r242631 | r242632 | |
| 1006 | 1006 | MCFG_STARPOINT_200STEP_ADD("reel3") |
| 1007 | 1007 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel3_optic_cb)) |
| 1008 | 1008 | MCFG_STARPOINT_200STEP_ADD("reel4") |
| 1009 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel4_optic_cb)) | |
| 1009 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel4_optic_cb)) | |
| 1010 | 1010 | MACHINE_CONFIG_END |
| 1011 | 1011 | |
| 1012 | 1012 | MACHINE_CONFIG_START( sc4_3reel_200, sc4_state ) |
| 1013 | 1013 | MCFG_FRAGMENT_ADD(sc4_common) |
| 1014 | ||
| 1014 | ||
| 1015 | 1015 | MCFG_STARPOINT_200STEP_ADD("reel1") |
| 1016 | 1016 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel1_optic_cb)) |
| 1017 | 1017 | MCFG_STARPOINT_200STEP_ADD("reel2") |
| r242631 | r242632 | |
| 1023 | 1023 | MACHINE_CONFIG_START( sc4_3reel_200_48, sc4_state ) |
| 1024 | 1024 | |
| 1025 | 1025 | MCFG_FRAGMENT_ADD(sc4_common) |
| 1026 | ||
| 1026 | ||
| 1027 | 1027 | MCFG_STARPOINT_200STEP_ADD("reel1") |
| 1028 | 1028 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel1_optic_cb)) |
| 1029 | 1029 | MCFG_STARPOINT_200STEP_ADD("reel2") |
| r242631 | r242632 | |
| 1031 | 1031 | MCFG_STARPOINT_200STEP_ADD("reel3") |
| 1032 | 1032 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel3_optic_cb)) |
| 1033 | 1033 | MCFG_STARPOINT_48STEP_ADD("reel4") |
| 1034 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel4_optic_cb)) | |
| 1034 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel4_optic_cb)) | |
| 1035 | 1035 | MACHINE_CONFIG_END |
| 1036 | 1036 | |
| 1037 | 1037 | MACHINE_CONFIG_START( sc4_no_reels, sc4_state ) |
| r242631 | r242632 | |
| 1047 | 1047 | |
| 1048 | 1048 | MACHINE_CONFIG_START( sc4_adder4, sc4_adder4_state ) |
| 1049 | 1049 | MCFG_FRAGMENT_ADD(sc4_common) |
| 1050 | ||
| 1050 | ||
| 1051 | 1051 | MCFG_CPU_ADD("adder4", M68340, 25175000) // 68340 (CPU32 core) |
| 1052 | 1052 | MCFG_CPU_PROGRAM_MAP(sc4_adder4_map) |
| 1053 | 1053 | |
| r242631 | r242632 | |
| 1066 | 1066 | MCFG_CPU_PERIODIC_INT_DRIVER(sc4_state, nmi_line_assert, 1500 ) /* generate 1500 NMI's per second ?? what is the exact freq?? */ |
| 1067 | 1067 | |
| 1068 | 1068 | MCFG_MACHINE_START_OVERRIDE(sc4_state, sc4 ) |
| 1069 | ||
| 1069 | ||
| 1070 | 1070 | MCFG_STARPOINT_RM20_48STEP_ADD("reel1") |
| 1071 | 1071 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(sc4_state, reel1_optic_cb)) |
| 1072 | 1072 | MCFG_STARPOINT_RM20_48STEP_ADD("reel2") |
| r242631 | r242632 | |
|---|---|---|
| 393 | 393 | AM_RANGE(0x0900, 0x0907) AM_READ(spacduel_IN3_r) /* IN1 */ |
| 394 | 394 | AM_RANGE(0x0905, 0x0906) AM_WRITENOP /* ignore? */ |
| 395 | 395 | AM_RANGE(0x0a00, 0x0a00) AM_DEVREAD("earom", atari_vg_earom_device, read) |
| 396 | ||
| 396 | AM_RANGE(0x0c00, 0x0c00) AM_WRITE(spacduel_coin_counter_w) /* coin out */ | |
| 397 | 397 | AM_RANGE(0x0c80, 0x0c80) AM_DEVWRITE("avg", avg_device, go_w) |
| 398 | 398 | AM_RANGE(0x0d00, 0x0d00) AM_WRITENOP /* watchdog clear */ |
| 399 | 399 | AM_RANGE(0x0d80, 0x0d80) AM_DEVWRITE("avg", avg_device, reset_w) |
| r242631 | r242632 | |
|---|---|---|
| 11532 | 11532 | m_maincpu->space(AS_PROGRAM).install_read_handler(0xf18000, 0xf19fff, read16_delegate(FUNC(cps_state::dinohunt_sound_r), this)); |
| 11533 | 11533 | m_maincpu->space(AS_PROGRAM).install_read_port(0xfc0000, 0xfc0001, "IN2"); ; |
| 11534 | 11534 | // the ym2151 doesn't seem to be used. Is it actually on the PCB? |
| 11535 | ||
| 11535 | ||
| 11536 | 11536 | DRIVER_INIT_CALL(cps1); |
| 11537 | 11537 | } |
| 11538 | 11538 |
| r242631 | r242632 | |
|---|---|---|
| 185 | 185 | ADDRESS_MAP_END |
| 186 | 186 | |
| 187 | 187 | static ADDRESS_MAP_START( vrambank_map, AS_PROGRAM, 8, cultures_state ) |
| 188 | AM_RANGE(0x0000, 0x3fff) AM_RAM_WRITE(bg0_videoram_w) AM_SHARE("bg0_videoram") | |
| 188 | AM_RANGE(0x0000, 0x3fff) AM_RAM_WRITE(bg0_videoram_w) AM_SHARE("bg0_videoram") | |
| 189 | 189 | AM_RANGE(0x4000, 0x6fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") |
| 190 | 190 | ADDRESS_MAP_END |
| 191 | 191 |
| r242631 | r242632 | |
|---|---|---|
| 383 | 383 | |
| 384 | 384 | READ32_MEMBER(dreamwld_state::dreamwld_protdata_r) |
| 385 | 385 | { |
| 386 | // | |
| 386 | // static int count = 0; | |
| 387 | 387 | |
| 388 | 388 | UINT8 *protdata = memregion("user1")->base(); |
| 389 | 389 | size_t protsize = memregion("user1")->bytes(); |
| 390 | 390 | UINT8 dat = protdata[(m_protindex++) % protsize]; |
| 391 | 391 | |
| 392 | // printf("protection read %04x %02x\n", count, dat); | |
| 393 | // count++; | |
| 392 | // printf("protection read %04x %02x\n", count, dat); | |
| 393 | // count++; | |
| 394 | 394 | |
| 395 | 395 | // real hw returns 00 after end of data, I haven't checked if it's possible to overflow the read counter |
| 396 | 396 | // and read out the internal rom. |
| r242631 | r242632 | |
| 614 | 614 | PORT_START("DSW") |
| 615 | 615 | PORT_DIPUNUSED_DIPLOC( 0x0001, IP_ACTIVE_LOW, "SW2:1" ) /* As listed in service mode, but tested */ |
| 616 | 616 | PORT_DIPUNUSED_DIPLOC( 0x0002, IP_ACTIVE_LOW, "SW2:2" ) /* These might have some use, requires investigation of code */ |
| 617 | PORT_DIPUNUSED_DIPLOC( 0x0004, IP_ACTIVE_LOW, "SW2:3" ) | |
| 618 | PORT_DIPUNUSED_DIPLOC( 0x0008, IP_ACTIVE_LOW, "SW2:4" ) | |
| 619 | PORT_DIPUNUSED_DIPLOC( 0x0010, IP_ACTIVE_LOW, "SW2:5" ) | |
| 620 | PORT_DIPNAME( 0x0060, 0x0060, "Ticket Payout" ) PORT_DIPLOCATION("SW2:6,7") | |
| 621 | PORT_DIPSETTING( 0x0000, DEF_STR( No ) ) | |
| 622 | PORT_DIPSETTING( 0x0020, "Little" ) | |
| 623 | PORT_DIPSETTING( 0x0060, DEF_STR( Normal ) ) | |
| 624 | PORT_DIPSETTING( 0x0040, "Much" ) | |
| 625 | PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW2:8") | |
| 626 | PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) | |
| 627 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 628 | PORT_DIPNAME( 0x0100, 0x0000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:1") /* Has no effect?? */ | |
| 629 | PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) | |
| 630 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 631 | PORT_DIPNAME( 0x0e00, 0x0e00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:2,3,4") | |
| 632 | PORT_DIPSETTING( 0x0000, DEF_STR( 5C_1C ) ) | |
| 633 | PORT_DIPSETTING( 0x0200, DEF_STR( 4C_1C ) ) | |
| 634 | PORT_DIPSETTING( 0x0400, DEF_STR( 3C_1C ) ) | |
| 635 | PORT_DIPSETTING( 0x0600, DEF_STR( 2C_1C ) ) | |
| 636 | PORT_DIPSETTING( 0x0e00, DEF_STR( 1C_1C ) ) | |
| 637 | PORT_DIPSETTING( 0x0a00, DEF_STR( 2C_3C ) ) | |
| 638 | PORT_DIPSETTING( 0x0c00, DEF_STR( 1C_2C ) ) | |
| 639 | PORT_DIPSETTING( 0x0800, DEF_STR( 1C_3C ) ) | |
| 640 | PORT_DIPNAME( 0x7000, 0x7000, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:5,6,7") | |
| 641 | PORT_DIPSETTING( 0x2000, "Level 1" ) | |
| 642 | PORT_DIPSETTING( 0x1000, "Level 2" ) | |
| 643 | PORT_DIPSETTING( 0x0000, "Level 3" ) | |
| 644 | PORT_DIPSETTING( 0x7000, "Level 4" ) | |
| 645 | PORT_DIPSETTING( 0x6000, "Level 5" ) | |
| 646 | PORT_DIPSETTING( 0x5000, "Level 6" ) | |
| 647 | PORT_DIPSETTING( 0x4000, "Level 7" ) | |
| 648 | PORT_DIPSETTING( 0x3000, "Level 8" ) | |
| 649 | PORT_SERVICE_DIPLOC( 0x8000, IP_ACTIVE_LOW, "SW1:8" ) | |
| 617 | PORT_DIPUNUSED_DIPLOC( 0x0004, IP_ACTIVE_LOW, "SW2:3" ) | |
| 618 | PORT_DIPUNUSED_DIPLOC( 0x0008, IP_ACTIVE_LOW, "SW2:4" ) | |
| 619 | PORT_DIPUNUSED_DIPLOC( 0x0010, IP_ACTIVE_LOW, "SW2:5" ) | |
| 620 | PORT_DIPNAME( 0x0060, 0x0060, "Ticket Payout" ) PORT_DIPLOCATION("SW2:6,7") | |
| 621 | PORT_DIPSETTING( 0x0000, DEF_STR( No ) ) | |
| 622 | PORT_DIPSETTING( 0x0020, "Little" ) | |
| 623 | PORT_DIPSETTING( 0x0060, DEF_STR( Normal ) ) | |
| 624 | PORT_DIPSETTING( 0x0040, "Much" ) | |
| 625 | PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW2:8") | |
| 626 | PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) | |
| 627 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 628 | PORT_DIPNAME( 0x0100, 0x0000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:1") /* Has no effect?? */ | |
| 629 | PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) | |
| 630 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 631 | PORT_DIPNAME( 0x0e00, 0x0e00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:2,3,4") | |
| 632 | PORT_DIPSETTING( 0x0000, DEF_STR( 5C_1C ) ) | |
| 633 | PORT_DIPSETTING( 0x0200, DEF_STR( 4C_1C ) ) | |
| 634 | PORT_DIPSETTING( 0x0400, DEF_STR( 3C_1C ) ) | |
| 635 | PORT_DIPSETTING( 0x0600, DEF_STR( 2C_1C ) ) | |
| 636 | PORT_DIPSETTING( 0x0e00, DEF_STR( 1C_1C ) ) | |
| 637 | PORT_DIPSETTING( 0x0a00, DEF_STR( 2C_3C ) ) | |
| 638 | PORT_DIPSETTING( 0x0c00, DEF_STR( 1C_2C ) ) | |
| 639 | PORT_DIPSETTING( 0x0800, DEF_STR( 1C_3C ) ) | |
| 640 | PORT_DIPNAME( 0x7000, 0x7000, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:5,6,7") | |
| 641 | PORT_DIPSETTING( 0x2000, "Level 1" ) | |
| 642 | PORT_DIPSETTING( 0x1000, "Level 2" ) | |
| 643 | PORT_DIPSETTING( 0x0000, "Level 3" ) | |
| 644 | PORT_DIPSETTING( 0x7000, "Level 4" ) | |
| 645 | PORT_DIPSETTING( 0x6000, "Level 5" ) | |
| 646 | PORT_DIPSETTING( 0x5000, "Level 6" ) | |
| 647 | PORT_DIPSETTING( 0x4000, "Level 7" ) | |
| 648 | PORT_DIPSETTING( 0x3000, "Level 8" ) | |
| 649 | PORT_SERVICE_DIPLOC( 0x8000, IP_ACTIVE_LOW, "SW1:8" ) | |
| 650 | 650 | INPUT_PORTS_END |
| 651 | 651 | |
| 652 | 652 | |
| r242631 | r242632 | |
| 1073 | 1073 | GAME( 1997, baryon, 0, baryon, baryon, driver_device, 0, ROT270, "SemiCom", "Baryon - Future Assault (set 1)", GAME_SUPPORTS_SAVE ) |
| 1074 | 1074 | GAME( 1997, baryona, baryon, baryon, baryon, driver_device, 0, ROT270, "SemiCom", "Baryon - Future Assault (set 2)", GAME_SUPPORTS_SAVE ) |
| 1075 | 1075 | GAME( 1998, cutefght, 0, dreamwld, cutefght, driver_device, 0, ROT0, "SemiCom", "Cute Fighter", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_GRAPHICS ) // wrong linescroll? |
| 1076 | GAME( 1999, rolcrush, 0, baryon, rolcrush, driver_device, 0, ROT0, "Trust / SemiCom", "Rolling Crush (version 1.07.E - 1999/02/11)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_GRAPHICS ) // wrong | |
| 1076 | GAME( 1999, rolcrush, 0, baryon, rolcrush, driver_device, 0, ROT0, "Trust / SemiCom", "Rolling Crush (version 1.07.E - 1999/02/11)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_GRAPHICS ) // wrong | |
| 1077 | 1077 | GAME( 2000, dreamwld, 0, dreamwld, dreamwld, driver_device, 0, ROT0, "SemiCom", "Dream World", GAME_SUPPORTS_SAVE ) |
| r242631 | r242632 | |
|---|---|---|
| 786 | 786 | MCFG_ECOIN_200STEP_ADD("reel2") |
| 787 | 787 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(ecoinfr_state, reel2_optic_cb)) |
| 788 | 788 | MCFG_ECOIN_200STEP_ADD("reel3") |
| 789 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(ecoinfr_state, reel3_optic_cb)) | |
| 789 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(ecoinfr_state, reel3_optic_cb)) | |
| 790 | 790 | MACHINE_CONFIG_END |
| 791 | 791 | |
| 792 | 792 |
| r242631 | r242632 | |
|---|---|---|
| 27 | 27 | |
| 28 | 28 | /* devices */ |
| 29 | 29 | required_device<e132xn_device> m_maincpu; |
| 30 | ||
| 30 | ||
| 31 | 31 | /* memory pointers */ |
| 32 | 32 | required_shared_ptr<UINT32> m_videoram; |
| 33 | ||
| 33 | ||
| 34 | 34 | DECLARE_READ32_MEMBER(f32_input_port_1_r); |
| 35 | 35 | UINT32 screen_update_mosaicf2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 36 | 36 | }; |
| r242631 | r242632 | |
|---|---|---|
| 71 | 71 | PISCES - NEC uPD78324 series MCU with 32k internal rom. Clock 13.500MHz [27/2] on pins 51 & 52 |
| 72 | 72 | VSync - 59.1856Hz |
| 73 | 73 | HSync - 15.625kHz |
| 74 | ||
| 74 | ||
| 75 | 75 | (TODO: VTOTAL = 264, HTOTAL = 432, pixel clock 27 MHz / 4) |
| 76 | ||
| 76 | ||
| 77 | 77 | ***************************************************************************/ |
| 78 | 78 | |
| 79 | 79 | #include "emu.h" |
| r242631 | r242632 | |
| 346 | 346 | AM_RANGE(0x300000, 0x301fff) AM_RAM // ? |
| 347 | 347 | AM_RANGE(0x302000, 0x303fff) AM_RAM AM_SHARE("spriteram") // Sprites |
| 348 | 348 | AM_RANGE(0x304000, 0x30401f) AM_DEVREADWRITE("kan_spr", kaneko16_sprite_device, kaneko16_sprites_regs_r, kaneko16_sprites_regs_w) |
| 349 | // AM_RANGE(0x308000, 0x308001) AM_WRITENOP // ? 0 at startup | |
| 350 | // AM_RANGE(0x30c000, 0x30c001) AM_WRITENOP // ? hblank effect ? | |
| 349 | // AM_RANGE(0x308000, 0x308001) AM_WRITENOP // ? 0 at startup | |
| 350 | // AM_RANGE(0x30c000, 0x30c001) AM_WRITENOP // ? hblank effect ? | |
| 351 | 351 | AM_RANGE(0x310000, 0x3101ff) AM_RAM_DEVWRITE("bg8palette", palette_device, write) AM_SHARE("bg8palette") // ? |
| 352 | 352 | AM_RANGE(0x314000, 0x314001) AM_WRITENOP // ? flip backgrounds ? |
| 353 | 353 | AM_RANGE(0x318000, 0x318001) AM_READWRITE(galpani2_eeprom_r, galpani2_eeprom_w) // EEPROM |
| 354 | 354 | AM_RANGE(0x380000, 0x387fff) AM_RAM // Palette? |
| 355 | 355 | AM_RANGE(0x388000, 0x38ffff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") // Palette |
| 356 | // | |
| 356 | // AM_RANGE(0x390000, 0x3901ff) AM_WRITENOP // ? at startup of service mode | |
| 357 | 357 | |
| 358 | 358 | AM_RANGE(0x400000, 0x43ffff) AM_RAM AM_SHARE("bg8.0") // Background 0 |
| 359 | 359 | AM_RANGE(0x440000, 0x440001) AM_RAM AM_SHARE("bg8_scrollx.0") // Background 0 Scroll X |
| 360 | 360 | AM_RANGE(0x480000, 0x480001) AM_RAM AM_SHARE("bg8_scrolly.0") // Background 0 Scroll Y |
| 361 | // | |
| 361 | // AM_RANGE(0x4c0000, 0x4c0001) AM_WRITENOP // ? 0 at startup only | |
| 362 | 362 | AM_RANGE(0x500000, 0x53ffff) AM_RAM AM_SHARE("bg8.1") // Background 1 |
| 363 | 363 | AM_RANGE(0x540000, 0x540001) AM_RAM AM_SHARE("bg8_scrollx.1") // Background 1 Scroll X |
| 364 | 364 | AM_RANGE(0x580000, 0x580001) AM_RAM AM_SHARE("bg8_scrolly.1") // Background 1 Scroll Y |
| 365 | // | |
| 365 | // AM_RANGE(0x5c0000, 0x5c0001) AM_WRITENOP // ? 0 at startup only | |
| 366 | 366 | |
| 367 | 367 | AM_RANGE(0x540572, 0x540573) AM_READNOP // ? galpani2 at F0A4 |
| 368 | 368 | AM_RANGE(0x54057a, 0x54057b) AM_READNOP // ? galpani2 at F148 |
| r242631 | r242632 | |
| 411 | 411 | AM_RANGE(0x000000, 0x03ffff) AM_ROM // ROM |
| 412 | 412 | AM_RANGE(0x100000, 0x13ffff) AM_RAM AM_SHARE("ram2") // Work RAM |
| 413 | 413 | AM_RANGE(0x400000, 0x5fffff) AM_RAM AM_SHARE("bg15") // bg15 |
| 414 | // AM_RANGE(0x600000, 0x600001) AM_NOP // ? 0 at startup only | |
| 415 | // AM_RANGE(0x640000, 0x640001) AM_WRITENOP // ? 0 at startup only | |
| 416 | // AM_RANGE(0x680000, 0x680001) AM_WRITENOP // ? 0 at startup only | |
| 417 | // AM_RANGE(0x6c0000, 0x6c0001) AM_WRITENOP // ? 0 at startup only | |
| 414 | // AM_RANGE(0x600000, 0x600001) AM_NOP // ? 0 at startup only | |
| 415 | // AM_RANGE(0x640000, 0x640001) AM_WRITENOP // ? 0 at startup only | |
| 416 | // AM_RANGE(0x680000, 0x680001) AM_WRITENOP // ? 0 at startup only | |
| 417 | // AM_RANGE(0x6c0000, 0x6c0001) AM_WRITENOP // ? 0 at startup only | |
| 418 | 418 | AM_RANGE(0x700000, 0x700001) AM_NOP // Watchdog |
| 419 | 419 | // AM_RANGE(0x740000, 0x740001) AM_WRITENOP // ? Reset mcu |
| 420 | 420 | AM_RANGE(0x780000, 0x780001) AM_WRITE8(galpani2_mcu_nmi2_w, 0x00ff) // ? 0 -> 1 -> 0 (lev 5) |
| r242631 | r242632 | |
| 520 | 520 | PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) |
| 521 | 521 | PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 522 | 522 | PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 523 | ||
| 523 | PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_SERVICE2 ) // this button is used in gp2se as an alt way to bring up the service menu, booting with it held down breaks the game tho! | |
| 524 | 524 | PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_TILT ) |
| 525 | 525 | PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 526 | 526 |
| r242631 | r242632 | |
|---|---|---|
| 84 | 84 | class gts1_state : public genpin_class |
| 85 | 85 | { |
| 86 | 86 | public: |
| 87 | gts1_state(const machine_config &mconfig, device_type type, const char *tag) | |
| 88 | : genpin_class(mconfig, type, tag) | |
| 89 | , m_maincpu(*this, "maincpu") | |
| 90 | , m_switches(*this, "X") | |
| 91 | { } | |
| 87 | gts1_state(const machine_config &mconfig, device_type type, const char *tag) | |
| 88 | : genpin_class(mconfig, type, tag) | |
| 89 | , m_maincpu(*this, "maincpu") | |
| 90 | , m_switches(*this, "X") | |
| 91 | { } | |
| 92 | 92 | |
| 93 | ||
| 93 | DECLARE_DRIVER_INIT(gts1); | |
| 94 | 94 | |
| 95 | DECLARE_READ8_MEMBER (gts1_solenoid_r); | |
| 96 | DECLARE_WRITE8_MEMBER(gts1_solenoid_w); | |
| 97 | DECLARE_READ8_MEMBER (gts1_switches_r); | |
| 98 | DECLARE_WRITE8_MEMBER(gts1_switches_w); | |
| 99 | DECLARE_WRITE8_MEMBER(gts1_display_w); | |
| 100 | DECLARE_READ8_MEMBER (gts1_lamp_apm_r); | |
| 101 | DECLARE_WRITE8_MEMBER(gts1_lamp_apm_w); | |
| 102 | DECLARE_READ8_MEMBER (gts1_nvram_r); | |
| 103 | DECLARE_WRITE8_MEMBER(gts1_nvram_w); | |
| 104 | DECLARE_READ8_MEMBER (gts1_io_r); | |
| 105 | DECLARE_WRITE8_MEMBER(gts1_io_w); | |
| 106 | DECLARE_READ8_MEMBER (gts1_pa_r); | |
| 107 | DECLARE_WRITE8_MEMBER(gts1_pa_w); | |
| 108 | DECLARE_WRITE8_MEMBER(gts1_pb_w); | |
| 95 | DECLARE_READ8_MEMBER (gts1_solenoid_r); | |
| 96 | DECLARE_WRITE8_MEMBER(gts1_solenoid_w); | |
| 97 | DECLARE_READ8_MEMBER (gts1_switches_r); | |
| 98 | DECLARE_WRITE8_MEMBER(gts1_switches_w); | |
| 99 | DECLARE_WRITE8_MEMBER(gts1_display_w); | |
| 100 | DECLARE_READ8_MEMBER (gts1_lamp_apm_r); | |
| 101 | DECLARE_WRITE8_MEMBER(gts1_lamp_apm_w); | |
| 102 | DECLARE_READ8_MEMBER (gts1_nvram_r); | |
| 103 | DECLARE_WRITE8_MEMBER(gts1_nvram_w); | |
| 104 | DECLARE_READ8_MEMBER (gts1_io_r); | |
| 105 | DECLARE_WRITE8_MEMBER(gts1_io_w); | |
| 106 | DECLARE_READ8_MEMBER (gts1_pa_r); | |
| 107 | DECLARE_WRITE8_MEMBER(gts1_pa_w); | |
| 108 | DECLARE_WRITE8_MEMBER(gts1_pb_w); | |
| 109 | 109 | private: |
| 110 | virtual void machine_reset(); | |
| 111 | required_device<cpu_device> m_maincpu; | |
| 112 | required_ioport_array<5> m_switches; | |
| 113 | UINT8 m_strobe; //!< switches strobe lines (5 lower bits used) | |
| 114 | UINT8 m_nvram_addr; //!< NVRAM address | |
| 115 | bool m_nvram_e2; //!< NVRWAM enable (E2 line) | |
| 116 | bool m_nvram_wr; //!< NVRWAM write (W/R line) | |
| 117 | UINT16 m_6351_addr; //!< ROM MM6351 address (12 bits) | |
| 118 | UINT16 m_z30_out; //!< 4-to-16 decoder outputs | |
| 110 | virtual void machine_reset(); | |
| 111 | required_device<cpu_device> m_maincpu; | |
| 112 | required_ioport_array<5> m_switches; | |
| 113 | UINT8 m_strobe; //!< switches strobe lines (5 lower bits used) | |
| 114 | UINT8 m_nvram_addr; //!< NVRAM address | |
| 115 | bool m_nvram_e2; //!< NVRWAM enable (E2 line) | |
| 116 | bool m_nvram_wr; //!< NVRWAM write (W/R line) | |
| 117 | UINT16 m_6351_addr; //!< ROM MM6351 address (12 bits) | |
| 118 | UINT16 m_z30_out; //!< 4-to-16 decoder outputs | |
| 119 | 119 | }; |
| 120 | 120 | |
| 121 | 121 | static ADDRESS_MAP_START( gts1_map, AS_PROGRAM, 8, gts1_state ) |
| 122 | ||
| 122 | AM_RANGE(0x0000, 0x0fff) AM_ROM | |
| 123 | 123 | ADDRESS_MAP_END |
| 124 | 124 | |
| 125 | 125 | static ADDRESS_MAP_START( gts1_data, AS_DATA, 8, gts1_state ) |
| 126 | AM_RANGE(0x0000, 0x00ff) AM_RAM | |
| 127 | AM_RANGE(0x0100, 0x01ff) AM_RAM AM_SHARE("nvram") | |
| 126 | AM_RANGE(0x0000, 0x00ff) AM_RAM | |
| 127 | AM_RANGE(0x0100, 0x01ff) AM_RAM AM_SHARE("nvram") | |
| 128 | 128 | ADDRESS_MAP_END |
| 129 | 129 | |
| 130 | 130 | static ADDRESS_MAP_START( gts1_io, AS_IO, 8, gts1_state ) |
| 131 | AM_RANGE(0x0020, 0x002f) AM_DEVREADWRITE ( "u4", ra17xx_device, io_r, io_w ) // (U4) solenoid | |
| 132 | AM_RANGE(0x0030, 0x003f) AM_DEVREADWRITE ( "u3", r10696_device, io_r, io_w ) // (U3) solenoid + dips | |
| 133 | AM_RANGE(0x0040, 0x004f) AM_DEVREADWRITE ( "u5", ra17xx_device, io_r, io_w ) // (U5) switch matrix | |
| 134 | AM_RANGE(0x0060, 0x006f) AM_DEVREADWRITE ( "u2", r10696_device, io_r, io_w ) // (U2) NVRAM io chip | |
| 135 | AM_RANGE(0x00d0, 0x00df) AM_DEVREADWRITE ( "u6", r10788_device, io_r, io_w ) // (U6) display chip | |
| 136 | AM_RANGE(0x0000, 0x00ff) AM_READ ( gts1_io_r ) AM_WRITE( gts1_io_w ) // catch undecoded I/O accesss | |
| 137 | AM_RANGE(0x0100, 0x0100) AM_READ ( gts1_pa_r ) AM_WRITE( gts1_pa_w ) // CPU I/O port A (input/output) | |
| 138 | AM_RANGE(0x0101, 0x0101) AM_WRITE( gts1_pb_w ) // CPU I/O port B (output only) | |
| 131 | AM_RANGE(0x0020, 0x002f) AM_DEVREADWRITE ( "u4", ra17xx_device, io_r, io_w ) // (U4) solenoid | |
| 132 | AM_RANGE(0x0030, 0x003f) AM_DEVREADWRITE ( "u3", r10696_device, io_r, io_w ) // (U3) solenoid + dips | |
| 133 | AM_RANGE(0x0040, 0x004f) AM_DEVREADWRITE ( "u5", ra17xx_device, io_r, io_w ) // (U5) switch matrix | |
| 134 | AM_RANGE(0x0060, 0x006f) AM_DEVREADWRITE ( "u2", r10696_device, io_r, io_w ) // (U2) NVRAM io chip | |
| 135 | AM_RANGE(0x00d0, 0x00df) AM_DEVREADWRITE ( "u6", r10788_device, io_r, io_w ) // (U6) display chip | |
| 136 | AM_RANGE(0x0000, 0x00ff) AM_READ ( gts1_io_r ) AM_WRITE( gts1_io_w ) // catch undecoded I/O accesss | |
| 137 | AM_RANGE(0x0100, 0x0100) AM_READ ( gts1_pa_r ) AM_WRITE( gts1_pa_w ) // CPU I/O port A (input/output) | |
| 138 | AM_RANGE(0x0101, 0x0101) AM_WRITE( gts1_pb_w ) // CPU I/O port B (output only) | |
| 139 | 139 | ADDRESS_MAP_END |
| 140 | 140 | |
| 141 | 141 | static INPUT_PORTS_START( gts1_dips ) |
| 142 | PORT_START("DSW0") | |
| 143 | PORT_DIPNAME( 0x01, 0x00, "S01") | |
| 144 | PORT_DIPSETTING( 0x00, DEF_STR( Off )) | |
| 145 | PORT_DIPSETTING( 0x01, DEF_STR( On )) | |
| 146 | PORT_DIPNAME( 0x02, 0x00, "S02") | |
| 147 | PORT_DIPSETTING( 0x00, DEF_STR( Off )) | |
| 148 | PORT_DIPSETTING( 0x02, DEF_STR( On )) | |
| 149 | PORT_DIPNAME( 0x04, 0x00, "S03") | |
| 150 | PORT_DIPSETTING( 0x00, DEF_STR( Off )) | |
| 151 | PORT_DIPSETTING( 0x04, DEF_STR( On )) | |
| 152 | PORT_DIPNAME( 0x08, 0x00, "S04") | |
| 153 | PORT_DIPSETTING( 0x00, DEF_STR( Off )) | |
| 154 | PORT_DIPSETTING( 0x08, DEF_STR( On )) | |
| 155 | PORT_DIPNAME( 0x10, 0x00, "S05") | |
| 156 | PORT_DIPSETTING( 0x00, DEF_STR( Off )) | |
| 157 | PORT_DIPSETTING( 0x10, DEF_STR( On )) | |
| 158 | PORT_DIPNAME( 0x20, 0x20, "S06") | |
| 159 | PORT_DIPSETTING( 0x00, DEF_STR( No )) | |
| 160 | PORT_DIPSETTING( 0x20, DEF_STR( Yes )) | |
| 161 | PORT_DIPNAME( 0x40, 0x40, "S07") | |
| 162 | PORT_DIPSETTING( 0x00, DEF_STR( No )) | |
| 163 | PORT_DIPSETTING( 0x40, DEF_STR( Yes )) | |
| 164 | PORT_DIPNAME( 0x80, 0x80, "S08") | |
| 165 | PORT_DIPSETTING( 0x00, DEF_STR( No )) | |
| 166 | PORT_DIPSETTING( 0x80, DEF_STR( Yes )) | |
| 142 | PORT_START("DSW0") | |
| 143 | PORT_DIPNAME( 0x01, 0x00, "S01") | |
| 144 | PORT_DIPSETTING( 0x00, DEF_STR( Off )) | |
| 145 | PORT_DIPSETTING( 0x01, DEF_STR( On )) | |
| 146 | PORT_DIPNAME( 0x02, 0x00, "S02") | |
| 147 | PORT_DIPSETTING( 0x00, DEF_STR( Off )) | |
| 148 | PORT_DIPSETTING( 0x02, DEF_STR( On )) | |
| 149 | PORT_DIPNAME( 0x04, 0x00, "S03") | |
| 150 | PORT_DIPSETTING( 0x00, DEF_STR( Off )) | |
| 151 | PORT_DIPSETTING( 0x04, DEF_STR( On )) | |
| 152 | PORT_DIPNAME( 0x08, 0x00, "S04") | |
| 153 | PORT_DIPSETTING( 0x00, DEF_STR( Off )) | |
| 154 | PORT_DIPSETTING( 0x08, DEF_STR( On )) | |
| 155 | PORT_DIPNAME( 0x10, 0x00, "S05") | |
| 156 | PORT_DIPSETTING( 0x00, DEF_STR( Off )) | |
| 157 | PORT_DIPSETTING( 0x10, DEF_STR( On )) | |
| 158 | PORT_DIPNAME( 0x20, 0x20, "S06") | |
| 159 | PORT_DIPSETTING( 0x00, DEF_STR( No )) | |
| 160 | PORT_DIPSETTING( 0x20, DEF_STR( Yes )) | |
| 161 | PORT_DIPNAME( 0x40, 0x40, "S07") | |
| 162 | PORT_DIPSETTING( 0x00, DEF_STR( No )) | |
| 163 | PORT_DIPSETTING( 0x40, DEF_STR( Yes )) | |
| 164 | PORT_DIPNAME( 0x80, 0x80, "S08") | |
| 165 | PORT_DIPSETTING( 0x00, DEF_STR( No )) | |
| 166 | PORT_DIPSETTING( 0x80, DEF_STR( Yes )) | |
| 167 | 167 | |
| 168 | PORT_START("DSW1") | |
| 169 | PORT_DIPNAME( 0x01, 0x00, "S09") | |
| 170 | PORT_DIPSETTING( 0x00, DEF_STR( Off )) | |
| 171 | PORT_DIPSETTING( 0x01, DEF_STR( On )) | |
| 172 | PORT_DIPNAME( 0x02, 0x00, "S10") | |
| 173 | PORT_DIPSETTING( 0x00, DEF_STR( Off )) | |
| 174 | PORT_DIPSETTING( 0x02, DEF_STR( On )) | |
| 175 | PORT_DIPNAME( 0x04, 0x00, "S11") | |
| 176 | PORT_DIPSETTING( 0x00, DEF_STR( Off )) | |
| 177 | PORT_DIPSETTING( 0x04, DEF_STR( On )) | |
| 178 | PORT_DIPNAME( 0x08, 0x00, "S12") | |
| 179 | PORT_DIPSETTING( 0x00, DEF_STR( Off )) | |
| 180 | PORT_DIPSETTING( 0x08, DEF_STR( On )) | |
| 181 | PORT_DIPNAME( 0x10, 0x00, "S13") | |
| 182 | PORT_DIPSETTING( 0x00, DEF_STR( Off )) | |
| 183 | PORT_DIPSETTING( 0x10, DEF_STR( On )) | |
| 184 | PORT_DIPNAME( 0x20, 0x00, "S14") | |
| 185 | PORT_DIPSETTING( 0x00, DEF_STR( Yes )) | |
| 186 | PORT_DIPSETTING( 0x20, DEF_STR( No )) | |
| 187 | PORT_DIPNAME( 0x40, 0x40, "S15") | |
| 188 | PORT_DIPSETTING( 0x00, DEF_STR( No )) | |
| 189 | PORT_DIPSETTING( 0x40, DEF_STR( Yes )) | |
| 190 | PORT_DIPNAME( 0x80, 0x00, "S16") | |
| 191 | PORT_DIPSETTING( 0x00, DEF_STR( No )) | |
| 192 | PORT_DIPSETTING( 0x80, DEF_STR( Yes )) | |
| 168 | PORT_START("DSW1") | |
| 169 | PORT_DIPNAME( 0x01, 0x00, "S09") | |
| 170 | PORT_DIPSETTING( 0x00, DEF_STR( Off )) | |
| 171 | PORT_DIPSETTING( 0x01, DEF_STR( On )) | |
| 172 | PORT_DIPNAME( 0x02, 0x00, "S10") | |
| 173 | PORT_DIPSETTING( 0x00, DEF_STR( Off )) | |
| 174 | PORT_DIPSETTING( 0x02, DEF_STR( On )) | |
| 175 | PORT_DIPNAME( 0x04, 0x00, "S11") | |
| 176 | PORT_DIPSETTING( 0x00, DEF_STR( Off )) | |
| 177 | PORT_DIPSETTING( 0x04, DEF_STR( On )) | |
| 178 | PORT_DIPNAME( 0x08, 0x00, "S12") | |
| 179 | PORT_DIPSETTING( 0x00, DEF_STR( Off )) | |
| 180 | PORT_DIPSETTING( 0x08, DEF_STR( On )) | |
| 181 | PORT_DIPNAME( 0x10, 0x00, "S13") | |
| 182 | PORT_DIPSETTING( 0x00, DEF_STR( Off )) | |
| 183 | PORT_DIPSETTING( 0x10, DEF_STR( On )) | |
| 184 | PORT_DIPNAME( 0x20, 0x00, "S14") | |
| 185 | PORT_DIPSETTING( 0x00, DEF_STR( Yes )) | |
| 186 | PORT_DIPSETTING( 0x20, DEF_STR( No )) | |
| 187 | PORT_DIPNAME( 0x40, 0x40, "S15") | |
| 188 | PORT_DIPSETTING( 0x00, DEF_STR( No )) | |
| 189 | PORT_DIPSETTING( 0x40, DEF_STR( Yes )) | |
| 190 | PORT_DIPNAME( 0x80, 0x00, "S16") | |
| 191 | PORT_DIPSETTING( 0x00, DEF_STR( No )) | |
| 192 | PORT_DIPSETTING( 0x80, DEF_STR( Yes )) | |
| 193 | 193 | |
| 194 | PORT_START("DSW2") | |
| 195 | PORT_DIPNAME( 0x01, 0x00, "S17") | |
| 196 | PORT_DIPSETTING( 0x00, DEF_STR( Off )) | |
| 197 | PORT_DIPSETTING( 0x01, DEF_STR( On )) | |
| 198 | PORT_DIPNAME( 0x02, 0x00, "S18") | |
| 199 | PORT_DIPSETTING( 0x00, DEF_STR( Off )) | |
| 200 | PORT_DIPSETTING( 0x02, DEF_STR( On )) | |
| 201 | PORT_DIPNAME( 0x04, 0x00, "S19") | |
| 202 | PORT_DIPSETTING( 0x00, DEF_STR( Off )) | |
| 203 | PORT_DIPSETTING( 0x04, DEF_STR( On )) | |
| 204 | PORT_DIPNAME( 0x08, 0x00, "S20") | |
| 205 | PORT_DIPSETTING( 0x00, DEF_STR( Off )) | |
| 206 | PORT_DIPSETTING( 0x08, DEF_STR( On )) | |
| 207 | PORT_DIPNAME( 0x10, 0x00, "S21") | |
| 208 | PORT_DIPSETTING( 0x00, DEF_STR( Off )) | |
| 209 | PORT_DIPSETTING( 0x10, DEF_STR( On )) | |
| 210 | PORT_DIPNAME( 0x20, 0x00, "S22") | |
| 211 | PORT_DIPSETTING( 0x00, DEF_STR( Off )) | |
| 212 | PORT_DIPSETTING( 0x20, DEF_STR( On )) | |
| 213 | PORT_DIPNAME( 0x40, 0x00, "S23") | |
| 214 | PORT_DIPSETTING( 0x00, DEF_STR( Off )) | |
| 215 | PORT_DIPSETTING( 0x40, DEF_STR( On )) | |
| 216 | PORT_DIPNAME( 0x80, 0x00, "S24") | |
| 217 | PORT_DIPSETTING( 0x00, DEF_STR( Off )) | |
| 218 | PORT_DIPSETTING( 0x80, DEF_STR( On )) | |
| 194 | PORT_START("DSW2") | |
| 195 | PORT_DIPNAME( 0x01, 0x00, "S17") | |
| 196 | PORT_DIPSETTING( 0x00, DEF_STR( Off )) | |
| 197 | PORT_DIPSETTING( 0x01, DEF_STR( On )) | |
| 198 | PORT_DIPNAME( 0x02, 0x00, "S18") | |
| 199 | PORT_DIPSETTING( 0x00, DEF_STR( Off )) | |
| 200 | PORT_DIPSETTING( 0x02, DEF_STR( On )) | |
| 201 | PORT_DIPNAME( 0x04, 0x00, "S19") | |
| 202 | PORT_DIPSETTING( 0x00, DEF_STR( Off )) | |
| 203 | PORT_DIPSETTING( 0x04, DEF_STR( On )) | |
| 204 | PORT_DIPNAME( 0x08, 0x00, "S20") | |
| 205 | PORT_DIPSETTING( 0x00, DEF_STR( Off )) | |
| 206 | PORT_DIPSETTING( 0x08, DEF_STR( On )) | |
| 207 | PORT_DIPNAME( 0x10, 0x00, "S21") | |
| 208 | PORT_DIPSETTING( 0x00, DEF_STR( Off )) | |
| 209 | PORT_DIPSETTING( 0x10, DEF_STR( On )) | |
| 210 | PORT_DIPNAME( 0x20, 0x00, "S22") | |
| 211 | PORT_DIPSETTING( 0x00, DEF_STR( Off )) | |
| 212 | PORT_DIPSETTING( 0x20, DEF_STR( On )) | |
| 213 | PORT_DIPNAME( 0x40, 0x00, "S23") | |
| 214 | PORT_DIPSETTING( 0x00, DEF_STR( Off )) | |
| 215 | PORT_DIPSETTING( 0x40, DEF_STR( On )) | |
| 216 | PORT_DIPNAME( 0x80, 0x00, "S24") | |
| 217 | PORT_DIPSETTING( 0x00, DEF_STR( Off )) | |
| 218 | PORT_DIPSETTING( 0x80, DEF_STR( On )) | |
| 219 | 219 | INPUT_PORTS_END |
| 220 | 220 | |
| 221 | 221 | static INPUT_PORTS_START( gts1_switches ) |
| 222 | PORT_START("X.0") | |
| 223 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) | |
| 224 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) | |
| 225 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) | |
| 226 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) | |
| 227 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) | |
| 228 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) | |
| 229 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) | |
| 230 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) | |
| 231 | PORT_START("X.1") | |
| 232 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) | |
| 233 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) | |
| 234 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) | |
| 235 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) | |
| 236 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) | |
| 237 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) | |
| 238 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) | |
| 239 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) | |
| 240 | PORT_START("X.2") | |
| 241 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) | |
| 242 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) | |
| 243 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) | |
| 244 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) | |
| 245 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) | |
| 246 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) | |
| 247 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) | |
| 248 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) | |
| 249 | PORT_START("X.3") | |
| 250 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) | |
| 251 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) | |
| 252 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) | |
| 253 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) | |
| 254 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) | |
| 255 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) | |
| 256 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) | |
| 257 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) | |
| 258 | PORT_START("X.4") | |
| 259 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) | |
| 260 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) | |
| 261 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) | |
| 262 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) | |
| 263 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) | |
| 264 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) | |
| 265 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) | |
| 266 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) | |
| 222 | PORT_START("X.0") | |
| 223 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) | |
| 224 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) | |
| 225 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) | |
| 226 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) | |
| 227 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) | |
| 228 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) | |
| 229 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) | |
| 230 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) | |
| 231 | PORT_START("X.1") | |
| 232 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) | |
| 233 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) | |
| 234 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) | |
| 235 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) | |
| 236 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) | |
| 237 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) | |
| 238 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) | |
| 239 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) | |
| 240 | PORT_START("X.2") | |
| 241 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) | |
| 242 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) | |
| 243 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) | |
| 244 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) | |
| 245 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) | |
| 246 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) | |
| 247 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) | |
| 248 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) | |
| 249 | PORT_START("X.3") | |
| 250 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) | |
| 251 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) | |
| 252 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) | |
| 253 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) | |
| 254 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) | |
| 255 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) | |
| 256 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) | |
| 257 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) | |
| 258 | PORT_START("X.4") | |
| 259 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) | |
| 260 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) | |
| 261 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) | |
| 262 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) | |
| 263 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) | |
| 264 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) | |
| 265 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) | |
| 266 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) | |
| 267 | 267 | INPUT_PORTS_END |
| 268 | 268 | |
| 269 | 269 | static INPUT_PORTS_START( gts1 ) |
| 270 | ||
| 270 | PORT_INCLUDE( gts1_dips ) | |
| 271 | 271 | |
| 272 | ||
| 272 | PORT_INCLUDE( gts1_switches ) | |
| 273 | 273 | INPUT_PORTS_END |
| 274 | 274 | |
| 275 | 275 | static INPUT_PORTS_START( jokrpokr ) |
| 276 | ||
| 276 | PORT_INCLUDE( gts1_dips ) | |
| 277 | 277 | |
| 278 | PORT_START("X.0") | |
| 279 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("PLAY/TEST") | |
| 280 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("POP/BUMBER") | |
| 281 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("EXTRA BALL TARGET") | |
| 282 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("SPECIAL ROLLOVER") | |
| 283 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("10 POINT CONTACTS") | |
| 284 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("\"A\" DROP TARGET (red)") | |
| 285 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) | |
| 286 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) | |
| 278 | PORT_START("X.0") | |
| 279 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("PLAY/TEST") | |
| 280 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("POP/BUMBER") | |
| 281 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("EXTRA BALL TARGET") | |
| 282 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("SPECIAL ROLLOVER") | |
| 283 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("10 POINT CONTACTS") | |
| 284 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("\"A\" DROP TARGET (red)") | |
| 285 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) | |
| 286 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) | |
| 287 | 287 | |
| 288 | PORT_START("X.1") | |
| 289 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("#1 COIN CHUTE") | |
| 290 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("\"A\" ROLLOVER") | |
| 291 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("\"10\" DROP TARGET") | |
| 292 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("\"Q\" DROP TARGET (red)") | |
| 293 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("\"K\" DROP TARGET (black)") | |
| 294 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("\"A\" DROP TARGET (black)") | |
| 295 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) | |
| 296 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) | |
| 288 | PORT_START("X.1") | |
| 289 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("#1 COIN CHUTE") | |
| 290 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("\"A\" ROLLOVER") | |
| 291 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("\"10\" DROP TARGET") | |
| 292 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("\"Q\" DROP TARGET (red)") | |
| 293 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("\"K\" DROP TARGET (black)") | |
| 294 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("\"A\" DROP TARGET (black)") | |
| 295 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) | |
| 296 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) | |
| 297 | 297 | |
| 298 | PORT_START("X.2") | |
| 299 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("#2 COIN CHUTE") | |
| 300 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("\"B\" ROLLOVER") | |
| 301 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("\"J\" DROP TARGET (black)") | |
| 302 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("\"O\" DROP TARGET (black)") | |
| 303 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("\"K\" DROP TARGET") | |
| 304 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("JOKER DROP TARGET") | |
| 305 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) | |
| 306 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) | |
| 298 | PORT_START("X.2") | |
| 299 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("#2 COIN CHUTE") | |
| 300 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("\"B\" ROLLOVER") | |
| 301 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("\"J\" DROP TARGET (black)") | |
| 302 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("\"O\" DROP TARGET (black)") | |
| 303 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("\"K\" DROP TARGET") | |
| 304 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("JOKER DROP TARGET") | |
| 305 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) | |
| 306 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) | |
| 307 | 307 | |
| 308 | PORT_START("X.3") | |
| 309 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("REPLAY BUTTON") | |
| 310 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("\"C\" ROLLOVER") | |
| 311 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("\"J\" DROP TARGET (red)") | |
| 312 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("\"O\" DROP TARGET (red)") | |
| 313 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("\"K\" DROP TARGET") | |
| 314 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("\"A\" DROP TARGET (red)") | |
| 315 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) | |
| 316 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) | |
| 308 | PORT_START("X.3") | |
| 309 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("REPLAY BUTTON") | |
| 310 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("\"C\" ROLLOVER") | |
| 311 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("\"J\" DROP TARGET (red)") | |
| 312 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("\"O\" DROP TARGET (red)") | |
| 313 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("\"K\" DROP TARGET") | |
| 314 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("\"A\" DROP TARGET (red)") | |
| 315 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) | |
| 316 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) | |
| 317 | 317 | |
| 318 | PORT_START("X.4") | |
| 319 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("TILT PANEL") | |
| 320 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) | |
| 321 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) | |
| 322 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) | |
| 323 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("\"K\" DROP TARGET") | |
| 324 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("\"A\" DROP TARGET (red)") | |
| 325 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) | |
| 326 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) | |
| 318 | PORT_START("X.4") | |
| 319 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("TILT PANEL") | |
| 320 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) | |
| 321 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) | |
| 322 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) | |
| 323 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("\"K\" DROP TARGET") | |
| 324 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("\"A\" DROP TARGET (red)") | |
| 325 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) | |
| 326 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) | |
| 327 | 327 | INPUT_PORTS_END |
| 328 | 328 | |
| 329 | 329 | void gts1_state::machine_reset() |
| 330 | 330 | { |
| 331 | m_strobe = 0; | |
| 332 | m_nvram_addr = 0; | |
| 333 | m_nvram_e2 = false; | |
| 334 | m_nvram_wr = false; | |
| 335 | m_6351_addr = 0; | |
| 336 | m_z30_out = 0; | |
| 331 | m_strobe = 0; | |
| 332 | m_nvram_addr = 0; | |
| 333 | m_nvram_e2 = false; | |
| 334 | m_nvram_wr = false; | |
| 335 | m_6351_addr = 0; | |
| 336 | m_z30_out = 0; | |
| 337 | 337 | } |
| 338 | 338 | |
| 339 | 339 | DRIVER_INIT_MEMBER(gts1_state,gts1) |
| r242631 | r242632 | |
| 342 | 342 | |
| 343 | 343 | READ8_MEMBER (gts1_state::gts1_solenoid_r) |
| 344 | 344 | { |
| 345 | UINT8 data = 0; | |
| 346 | LOG(("%s: solenoid[%02x] -> %x\n", __FUNCTION__, offset, data)); | |
| 347 | return data; | |
| 345 | UINT8 data = 0; | |
| 346 | LOG(("%s: solenoid[%02x] -> %x\n", __FUNCTION__, offset, data)); | |
| 347 | return data; | |
| 348 | 348 | } |
| 349 | 349 | |
| 350 | 350 | WRITE8_MEMBER(gts1_state::gts1_solenoid_w) |
| 351 | 351 | { |
| 352 | switch (offset) | |
| 353 | { | |
| 354 | case 0: | |
| 355 | LOG(("%s: outhole <- %x\n", __FUNCTION__, data)); | |
| 356 | break; | |
| 357 | case 1: | |
| 358 | LOG(("%s: knocker <- %x\n", __FUNCTION__, data)); | |
| 359 | break; | |
| 360 | case 2: | |
| 361 | LOG(("%s: tens chime <- %x\n", __FUNCTION__, data)); | |
| 362 | break; | |
| 363 | case 3: | |
| 364 | LOG(("%s: hundreds chime <- %x\n", __FUNCTION__, data)); | |
| 365 | break; | |
| 366 | case 4: | |
| 367 | LOG(("%s: thousands chime <- %x\n", __FUNCTION__, data)); | |
| 368 | break; | |
| 369 | case 5: | |
| 370 | LOG(("%s: no. 6 <- %x\n", __FUNCTION__, data)); | |
| 371 | break; | |
| 372 | case 6: | |
| 373 | LOG(("%s: no. 7 <- %x\n", __FUNCTION__, data)); | |
| 374 | break; | |
| 375 | case 7: | |
| 376 | LOG(("%s: no. 8 <- %x\n", __FUNCTION__, data)); | |
| 377 | break; | |
| 378 | case 8: case 9: case 10: case 11: | |
| 379 | LOG(("%s: not used [%x] <- %x\n", __FUNCTION__, offset, data)); | |
| 380 | break; | |
| 381 | case 12: // spare | |
| 382 | LOG(("%s: spare [%x] <- %x\n", __FUNCTION__, offset, data)); | |
| 383 | break; | |
| 384 | case 13: // RAM control E2 | |
| 385 | LOG(("%s: RAM control E2 <- %x\n", __FUNCTION__, data)); | |
| 386 | m_nvram_e2 = (data & 1) ? true : false; | |
| 387 | break; | |
| 388 | case 14: // RAM control W/R | |
| 389 | LOG(("%s: RAM control W/R <- %x\n", __FUNCTION__, data)); | |
| 390 | break; | |
| 391 | m_nvram_wr = (data & 1) ? true : false; | |
| 392 | case 15: // spare | |
| 393 | LOG(("%s: spare [%x] <- %x\n", __FUNCTION__, offset, data)); | |
| 394 | break; | |
| 395 | } | |
| 352 | switch (offset) | |
| 353 | { | |
| 354 | case 0: | |
| 355 | LOG(("%s: outhole <- %x\n", __FUNCTION__, data)); | |
| 356 | break; | |
| 357 | case 1: | |
| 358 | LOG(("%s: knocker <- %x\n", __FUNCTION__, data)); | |
| 359 | break; | |
| 360 | case 2: | |
| 361 | LOG(("%s: tens chime <- %x\n", __FUNCTION__, data)); | |
| 362 | break; | |
| 363 | case 3: | |
| 364 | LOG(("%s: hundreds chime <- %x\n", __FUNCTION__, data)); | |
| 365 | break; | |
| 366 | case 4: | |
| 367 | LOG(("%s: thousands chime <- %x\n", __FUNCTION__, data)); | |
| 368 | break; | |
| 369 | case 5: | |
| 370 | LOG(("%s: no. 6 <- %x\n", __FUNCTION__, data)); | |
| 371 | break; | |
| 372 | case 6: | |
| 373 | LOG(("%s: no. 7 <- %x\n", __FUNCTION__, data)); | |
| 374 | break; | |
| 375 | case 7: | |
| 376 | LOG(("%s: no. 8 <- %x\n", __FUNCTION__, data)); | |
| 377 | break; | |
| 378 | case 8: case 9: case 10: case 11: | |
| 379 | LOG(("%s: not used [%x] <- %x\n", __FUNCTION__, offset, data)); | |
| 380 | break; | |
| 381 | case 12: // spare | |
| 382 | LOG(("%s: spare [%x] <- %x\n", __FUNCTION__, offset, data)); | |
| 383 | break; | |
| 384 | case 13: // RAM control E2 | |
| 385 | LOG(("%s: RAM control E2 <- %x\n", __FUNCTION__, data)); | |
| 386 | m_nvram_e2 = (data & 1) ? true : false; | |
| 387 | break; | |
| 388 | case 14: // RAM control W/R | |
| 389 | LOG(("%s: RAM control W/R <- %x\n", __FUNCTION__, data)); | |
| 390 | break; | |
| 391 | m_nvram_wr = (data & 1) ? true : false; | |
| 392 | case 15: // spare | |
| 393 | LOG(("%s: spare [%x] <- %x\n", __FUNCTION__, offset, data)); | |
| 394 | break; | |
| 395 | } | |
| 396 | 396 | } |
| 397 | 397 | |
| 398 | 398 | READ8_MEMBER (gts1_state::gts1_switches_r) |
| 399 | 399 | { |
| 400 | UINT8 data = 1; | |
| 401 | if (offset >= 8 && offset < 16) { | |
| 402 | const int bit = offset - 8; | |
| 403 | for (int i = 0; i < 5; i++) { | |
| 404 | if (m_strobe & (1 << i)) { | |
| 405 | data &= BIT(m_switches[i]->read(), bit); | |
| 406 | } | |
| 407 | } | |
| 408 | } | |
| 409 | LOG(("%s: switches[%x,%x] -> %x\n", __FUNCTION__, m_strobe, offset, data)); | |
| 410 | return data; | |
| 400 | UINT8 data = 1; | |
| 401 | if (offset >= 8 && offset < 16) { | |
| 402 | const int bit = offset - 8; | |
| 403 | for (int i = 0; i < 5; i++) { | |
| 404 | if (m_strobe & (1 << i)) { | |
| 405 | data &= BIT(m_switches[i]->read(), bit); | |
| 406 | } | |
| 407 | } | |
| 408 | } | |
| 409 | LOG(("%s: switches[%x,%x] -> %x\n", __FUNCTION__, m_strobe, offset, data)); | |
| 410 | return data; | |
| 411 | 411 | } |
| 412 | 412 | |
| 413 | 413 | WRITE8_MEMBER(gts1_state::gts1_switches_w) |
| 414 | 414 | { |
| 415 | LOG(("%s: switches[%x] <- %x\n", __FUNCTION__, offset, data)); | |
| 416 | if (offset < 5) { | |
| 417 | // outputs O-0 to O-4 are the 5 strobe lines | |
| 418 | m_strobe = (m_strobe & ~(1 << offset)) | ((data & 1) << offset); | |
| 419 | } | |
| 415 | LOG(("%s: switches[%x] <- %x\n", __FUNCTION__, offset, data)); | |
| 416 | if (offset < 5) { | |
| 417 | // outputs O-0 to O-4 are the 5 strobe lines | |
| 418 | m_strobe = (m_strobe & ~(1 << offset)) | ((data & 1) << offset); | |
| 419 | } | |
| 420 | 420 | } |
| 421 | 421 | |
| 422 | 422 | /** |
| r242631 | r242632 | |
| 426 | 426 | */ |
| 427 | 427 | WRITE8_MEMBER(gts1_state::gts1_display_w) |
| 428 | 428 | { |
| 429 | /* | |
| 430 | * The 7448 is modified to be disabled through RI/RBO | |
| 431 | * when the input is 0001, and in this case the extra | |
| 432 | * output H is generated instead. | |
| 433 | */ | |
| 429 | /* | |
| 430 | * The 7448 is modified to be disabled through RI/RBO | |
| 431 | * when the input is 0001, and in this case the extra | |
| 432 | * output H is generated instead. | |
| 433 | */ | |
| 434 | 434 | #define _a (1 << 0) |
| 435 | 435 | #define _b (1 << 1) |
| 436 | 436 | #define _c (1 << 2) |
| r242631 | r242632 | |
| 439 | 439 | #define _f (1 << 5) |
| 440 | 440 | #define _g (1 << 6) |
| 441 | 441 | #define _h (1 << 7) |
| 442 | static const UINT8 ttl7448_mod[16] = { | |
| 443 | /* 0 */ _a | _b | _c | _d | _e | _f, | |
| 444 | /* 1 */ _h, | |
| 445 | /* 2 */ _a | _b | _d | _e | _g, | |
| 446 | /* 3 */ _a | _b | _c | _d | _g, | |
| 447 | /* 4 */ _b | _c | _f | _g, | |
| 448 | /* 5 */ _a | _c | _d | _f | _g, | |
| 449 | /* 6 */ _a | _c | _d | _e | _f | _g, | |
| 450 | /* 7 */ _a | _b | _c, | |
| 451 | /* 8 */ _a | _b | _c | _d | _e | _f | _g, | |
| 452 | /* 9 */ _a | _b | _c | _d | _f | _g, | |
| 453 | /* a */ _d | _e | _g, | |
| 454 | /* b */ _c | _d | _g, | |
| 455 | /* c */ _b | _f | _g, | |
| 456 | /* d */ _a | _d | _f | _g, | |
| 457 | /* e */ _d | _e | _f | _g, | |
| 458 | /* f */ 0 | |
| 459 | }; | |
| 460 | UINT8 a = ttl7448_mod[(data >> 0) & 15]; | |
| 461 | UINT8 b = ttl7448_mod[(data >> 4) & 15]; | |
| 462 | // LOG(("%s: offset:%d data:%02x a:%02x b:%02x\n", __FUNCTION__, offset, data, a, b)); | |
| 463 | if ((offset % 8) < 7) { | |
| 464 | output_set_indexed_value("digit8_", offset, a); | |
| 465 | output_set_indexed_value("digit8_", offset + 16, b); | |
| 466 | } else { | |
| 467 | /* | |
| 468 | * For the 4 7-seg displays the segment h is turned back into | |
| 469 | * segments b and c to display the 7-seg "1". | |
| 470 | */ | |
| 471 | if (a & _h) | |
| 472 | a = _b | _c; | |
| 473 | if (b & _h) | |
| 474 | b = _b | _c; | |
| 475 | output_set_indexed_value("digit7_", offset, a); | |
| 476 | // FIXME: there is nothing on outputs 22, 23, 30 and 31? | |
| 477 | output_set_indexed_value("digit7_", offset + 16, b); | |
| 478 | } | |
| 442 | static const UINT8 ttl7448_mod[16] = { | |
| 443 | /* 0 */ _a | _b | _c | _d | _e | _f, | |
| 444 | /* 1 */ _h, | |
| 445 | /* 2 */ _a | _b | _d | _e | _g, | |
| 446 | /* 3 */ _a | _b | _c | _d | _g, | |
| 447 | /* 4 */ _b | _c | _f | _g, | |
| 448 | /* 5 */ _a | _c | _d | _f | _g, | |
| 449 | /* 6 */ _a | _c | _d | _e | _f | _g, | |
| 450 | /* 7 */ _a | _b | _c, | |
| 451 | /* 8 */ _a | _b | _c | _d | _e | _f | _g, | |
| 452 | /* 9 */ _a | _b | _c | _d | _f | _g, | |
| 453 | /* a */ _d | _e | _g, | |
| 454 | /* b */ _c | _d | _g, | |
| 455 | /* c */ _b | _f | _g, | |
| 456 | /* d */ _a | _d | _f | _g, | |
| 457 | /* e */ _d | _e | _f | _g, | |
| 458 | /* f */ 0 | |
| 459 | }; | |
| 460 | UINT8 a = ttl7448_mod[(data >> 0) & 15]; | |
| 461 | UINT8 b = ttl7448_mod[(data >> 4) & 15]; | |
| 462 | // LOG(("%s: offset:%d data:%02x a:%02x b:%02x\n", __FUNCTION__, offset, data, a, b)); | |
| 463 | if ((offset % 8) < 7) { | |
| 464 | output_set_indexed_value("digit8_", offset, a); | |
| 465 | output_set_indexed_value("digit8_", offset + 16, b); | |
| 466 | } else { | |
| 467 | /* | |
| 468 | * For the 4 7-seg displays the segment h is turned back into | |
| 469 | * segments b and c to display the 7-seg "1". | |
| 470 | */ | |
| 471 | if (a & _h) | |
| 472 | a = _b | _c; | |
| 473 | if (b & _h) | |
| 474 | b = _b | _c; | |
| 475 | output_set_indexed_value("digit7_", offset, a); | |
| 476 | // FIXME: there is nothing on outputs 22, 23, 30 and 31? | |
| 477 | output_set_indexed_value("digit7_", offset + 16, b); | |
| 478 | } | |
| 479 | 479 | #undef _a |
| 480 | 480 | #undef _b |
| 481 | 481 | #undef _c |
| r242631 | r242632 | |
| 493 | 493 | */ |
| 494 | 494 | READ8_MEMBER (gts1_state::gts1_nvram_r) |
| 495 | 495 | { |
| 496 | UINT8 data = 0x0f; | |
| 497 | switch (offset) | |
| 498 | { | |
| 499 | case 0: // group A | |
| 500 | // FIXME: Schematics says TO Z5 | |
| 501 | if (!m_nvram_wr && m_nvram_e2) { | |
| 502 | UINT8* nvram = memregion("nvram")->base(); | |
| 503 | assert(nvram != NULL); | |
| 504 | data = nvram[m_nvram_addr]; | |
| 505 | LOG(("%s: nvram[%02x] -> %x\n", __FUNCTION__, m_nvram_addr, data)); | |
| 506 | } | |
| 507 | break; | |
| 508 | case 1: // group B | |
| 509 | case 2: // group C | |
| 510 | // Schematics says: SPARES | |
| 511 | break; | |
| 512 | } | |
| 513 | return data; | |
| 496 | UINT8 data = 0x0f; | |
| 497 | switch (offset) | |
| 498 | { | |
| 499 | case 0: // group A | |
| 500 | // FIXME: Schematics says TO Z5 | |
| 501 | if (!m_nvram_wr && m_nvram_e2) { | |
| 502 | UINT8* nvram = memregion("nvram")->base(); | |
| 503 | assert(nvram != NULL); | |
| 504 | data = nvram[m_nvram_addr]; | |
| 505 | LOG(("%s: nvram[%02x] -> %x\n", __FUNCTION__, m_nvram_addr, data)); | |
| 506 | } | |
| 507 | break; | |
| 508 | case 1: // group B | |
| 509 | case 2: // group C | |
| 510 | // Schematics says: SPARES | |
| 511 | break; | |
| 512 | } | |
| 513 | return data; | |
| 514 | 514 | } |
| 515 | 515 | |
| 516 | 516 | /** |
| r242631 | r242632 | |
| 520 | 520 | */ |
| 521 | 521 | WRITE8_MEMBER(gts1_state::gts1_nvram_w) |
| 522 | 522 | { |
| 523 | switch (offset) | |
| 524 | { | |
| 525 | case 0: // group A - address lines 3:0 | |
| 526 | m_nvram_addr = (m_nvram_addr & ~15) | (data & 15); | |
| 527 | break; | |
| 528 | case 1: // group B - address lines 7:4 | |
| 529 | m_nvram_addr = (m_nvram_addr & ~(15 << 4)) | ((data & 15) << 4); | |
| 530 | break; | |
| 531 | case 2: // group C - data bits 3:0 of NVRAM | |
| 532 | if (m_nvram_wr && m_nvram_e2) { | |
| 533 | LOG(("%s: nvram[%02x] <- %x\n", __FUNCTION__, m_nvram_addr, data & 15)); | |
| 534 | UINT8* nvram = memregion("nvram")->base(); | |
| 535 | assert(nvram != NULL); | |
| 536 | nvram[m_nvram_addr] = data & 15; | |
| 537 | } | |
| 538 | break; | |
| 539 | } | |
| 523 | switch (offset) | |
| 524 | { | |
| 525 | case 0: // group A - address lines 3:0 | |
| 526 | m_nvram_addr = (m_nvram_addr & ~15) | (data & 15); | |
| 527 | break; | |
| 528 | case 1: // group B - address lines 7:4 | |
| 529 | m_nvram_addr = (m_nvram_addr & ~(15 << 4)) | ((data & 15) << 4); | |
| 530 | break; | |
| 531 | case 2: // group C - data bits 3:0 of NVRAM | |
| 532 | if (m_nvram_wr && m_nvram_e2) { | |
| 533 | LOG(("%s: nvram[%02x] <- %x\n", __FUNCTION__, m_nvram_addr, data & 15)); | |
| 534 | UINT8* nvram = memregion("nvram")->base(); | |
| 535 | assert(nvram != NULL); | |
| 536 | nvram[m_nvram_addr] = data & 15; | |
| 537 | } | |
| 538 | break; | |
| 539 | } | |
| 540 | 540 | } |
| 541 | 541 | |
| 542 | 542 | /** |
| r242631 | r242632 | |
| 546 | 546 | */ |
| 547 | 547 | READ8_MEMBER (gts1_state::gts1_lamp_apm_r) |
| 548 | 548 | { |
| 549 | UINT8 data = 0x0f; | |
| 550 | switch (offset) { | |
| 551 | case 0: // group A switches S01-S04, S09-S12, S17-S20 | |
| 552 | if (m_z30_out & 1) { | |
| 553 | UINT8 dsw0 = ioport("DSW0")->read(); | |
| 554 | if (0 == BIT(dsw0,0)) // S01 | |
| 555 | data &= ~(1 << 3); | |
| 556 | if (0 == BIT(dsw0,1)) // S02 | |
| 557 | data &= ~(1 << 2); | |
| 558 | if (0 == BIT(dsw0,2)) // S03 | |
| 559 | data &= ~(1 << 1); | |
| 560 | if (0 == BIT(dsw0,3)) // S04 | |
| 561 | data &= ~(1 << 0); | |
| 562 | } | |
| 563 | if (m_z30_out & 2) { | |
| 564 | UINT8 dsw1 = ioport("DSW1")->read(); | |
| 565 | if (0 == BIT(dsw1,0)) // S09 | |
| 566 | data &= ~(1 << 0); | |
| 567 | if (0 == BIT(dsw1,1)) // S10 | |
| 568 | data &= ~(1 << 1); | |
| 569 | if (0 == BIT(dsw1,2)) // S11 | |
| 570 | data &= ~(1 << 2); | |
| 571 | if (0 == BIT(dsw1,3)) // S12 | |
| 572 | data &= ~(1 << 3); | |
| 573 | } | |
| 574 | if (m_z30_out & 4) { | |
| 575 | UINT8 dsw2 = ioport("DSW2")->read(); | |
| 576 | if (0 == BIT(dsw2,0)) // S17 | |
| 577 | data &= ~(1 << 0); | |
| 578 | if (0 == BIT(dsw2,1)) // S18 | |
| 579 | data &= ~(1 << 1); | |
| 580 | if (0 == BIT(dsw2,2)) // S19 | |
| 581 | data &= ~(1 << 2); | |
| 582 | if (0 == BIT(dsw2,3)) // S20 | |
| 583 | data &= ~(1 << 3); | |
| 584 | } | |
| 585 | break; | |
| 586 | case 1: // group B switches S05-S08, S09-S12, S17-S20 | |
| 587 | if (m_z30_out & 1) { | |
| 588 | UINT8 dsw0 = ioport("DSW0")->read(); | |
| 589 | if (0 == BIT(dsw0,4)) // S05 | |
| 590 | data &= ~(1 << 3); | |
| 591 | if (0 == BIT(dsw0,5)) // S06 | |
| 592 | data &= ~(1 << 2); | |
| 593 | if (0 == BIT(dsw0,6)) // S07 | |
| 594 | data &= ~(1 << 1); | |
| 595 | if (0 == BIT(dsw0,7)) // S08 | |
| 596 | data &= ~(1 << 0); | |
| 597 | } | |
| 598 | if (m_z30_out & 2) { | |
| 599 | UINT8 dsw1 = ioport("DSW1")->read(); | |
| 600 | if (0 == BIT(dsw1,4)) // S13 | |
| 601 | data &= ~(1 << 0); | |
| 602 | if (0 == BIT(dsw1,5)) // S14 | |
| 603 | data &= ~(1 << 1); | |
| 604 | if (0 == BIT(dsw1,6)) // S15 | |
| 605 | data &= ~(1 << 2); | |
| 606 | if (0 == BIT(dsw1,7)) // S16 | |
| 607 | data &= ~(1 << 3); | |
| 608 | } | |
| 609 | if (m_z30_out & 4) { | |
| 610 | UINT8 dsw2 = ioport("DSW2")->read(); | |
| 611 | if (0 == BIT(dsw2,4)) // S21 | |
| 612 | data &= ~(1 << 0); | |
| 613 | if (0 == BIT(dsw2,5)) // S22 | |
| 614 | data &= ~(1 << 1); | |
| 615 | if (0 == BIT(dsw2,6)) // S23 | |
| 616 | data &= ~(1 << 2); | |
| 617 | if (0 == BIT(dsw2,7)) // S24 | |
| 618 | data &= ~(1 << 3); | |
| 619 | } | |
| 620 | break; | |
| 621 | case 2: // TODO: connect | |
| 622 | // IN-9 (unused?) | |
| 623 | // IN-10 (reset sw25) | |
| 624 | // IN-11 (outhole sw) | |
| 625 | // IN-12 (slam sw) | |
| 626 | break; | |
| 627 | } | |
| 628 | return data; | |
| 549 | UINT8 data = 0x0f; | |
| 550 | switch (offset) { | |
| 551 | case 0: // group A switches S01-S04, S09-S12, S17-S20 | |
| 552 | if (m_z30_out & 1) { | |
| 553 | UINT8 dsw0 = ioport("DSW0")->read(); | |
| 554 | if (0 == BIT(dsw0,0)) // S01 | |
| 555 | data &= ~(1 << 3); | |
| 556 | if (0 == BIT(dsw0,1)) // S02 | |
| 557 | data &= ~(1 << 2); | |
| 558 | if (0 == BIT(dsw0,2)) // S03 | |
| 559 | data &= ~(1 << 1); | |
| 560 | if (0 == BIT(dsw0,3)) // S04 | |
| 561 | data &= ~(1 << 0); | |
| 562 | } | |
| 563 | if (m_z30_out & 2) { | |
| 564 | UINT8 dsw1 = ioport("DSW1")->read(); | |
| 565 | if (0 == BIT(dsw1,0)) // S09 | |
| 566 | data &= ~(1 << 0); | |
| 567 | if (0 == BIT(dsw1,1)) // S10 | |
| 568 | data &= ~(1 << 1); | |
| 569 | if (0 == BIT(dsw1,2)) // S11 | |
| 570 | data &= ~(1 << 2); | |
| 571 | if (0 == BIT(dsw1,3)) // S12 | |
| 572 | data &= ~(1 << 3); | |
| 573 | } | |
| 574 | if (m_z30_out & 4) { | |
| 575 | UINT8 dsw2 = ioport("DSW2")->read(); | |
| 576 | if (0 == BIT(dsw2,0)) // S17 | |
| 577 | data &= ~(1 << 0); | |
| 578 | if (0 == BIT(dsw2,1)) // S18 | |
| 579 | data &= ~(1 << 1); | |
| 580 | if (0 == BIT(dsw2,2)) // S19 | |
| 581 | data &= ~(1 << 2); | |
| 582 | if (0 == BIT(dsw2,3)) // S20 | |
| 583 | data &= ~(1 << 3); | |
| 584 | } | |
| 585 | break; | |
| 586 | case 1: // group B switches S05-S08, S09-S12, S17-S20 | |
| 587 | if (m_z30_out & 1) { | |
| 588 | UINT8 dsw0 = ioport("DSW0")->read(); | |
| 589 | if (0 == BIT(dsw0,4)) // S05 | |
| 590 | data &= ~(1 << 3); | |
| 591 | if (0 == BIT(dsw0,5)) // S06 | |
| 592 | data &= ~(1 << 2); | |
| 593 | if (0 == BIT(dsw0,6)) // S07 | |
| 594 | data &= ~(1 << 1); | |
| 595 | if (0 == BIT(dsw0,7)) // S08 | |
| 596 | data &= ~(1 << 0); | |
| 597 | } | |
| 598 | if (m_z30_out & 2) { | |
| 599 | UINT8 dsw1 = ioport("DSW1")->read(); | |
| 600 | if (0 == BIT(dsw1,4)) // S13 | |
| 601 | data &= ~(1 << 0); | |
| 602 | if (0 == BIT(dsw1,5)) // S14 | |
| 603 | data &= ~(1 << 1); | |
| 604 | if (0 == BIT(dsw1,6)) // S15 | |
| 605 | data &= ~(1 << 2); | |
| 606 | if (0 == BIT(dsw1,7)) // S16 | |
| 607 | data &= ~(1 << 3); | |
| 608 | } | |
| 609 | if (m_z30_out & 4) { | |
| 610 | UINT8 dsw2 = ioport("DSW2")->read(); | |
| 611 | if (0 == BIT(dsw2,4)) // S21 | |
| 612 | data &= ~(1 << 0); | |
| 613 | if (0 == BIT(dsw2,5)) // S22 | |
| 614 | data &= ~(1 << 1); | |
| 615 | if (0 == BIT(dsw2,6)) // S23 | |
| 616 | data &= ~(1 << 2); | |
| 617 | if (0 == BIT(dsw2,7)) // S24 | |
| 618 | data &= ~(1 << 3); | |
| 619 | } | |
| 620 | break; | |
| 621 | case 2: // TODO: connect | |
| 622 | // IN-9 (unused?) | |
| 623 | // IN-10 (reset sw25) | |
| 624 | // IN-11 (outhole sw) | |
| 625 | // IN-12 (slam sw) | |
| 626 | break; | |
| 627 | } | |
| 628 | return data; | |
| 629 | 629 | } |
| 630 | 630 | |
| 631 | 631 | /** |
| r242631 | r242632 | |
| 635 | 635 | */ |
| 636 | 636 | WRITE8_MEMBER(gts1_state::gts1_lamp_apm_w) |
| 637 | 637 | { |
| 638 | switch (offset) { | |
| 639 | case 0: // LD1-LD4 on jumper J5 | |
| 640 | break; | |
| 641 | case 1: // Z30 1-of-16 decoder | |
| 642 | m_z30_out = 1 << (data & 15); | |
| 643 | break; | |
| 644 | case 2: // O9: PGOL PROM A8, O10: PGOL PROM A9 | |
| 645 | m_6351_addr = (m_6351_addr & ~(3 << 8)) | ((data & 3) << 8); | |
| 646 | // O11 and O12 are unused(?) | |
| 647 | break; | |
| 648 | } | |
| 638 | switch (offset) { | |
| 639 | case 0: // LD1-LD4 on jumper J5 | |
| 640 | break; | |
| 641 | case 1: // Z30 1-of-16 decoder | |
| 642 | m_z30_out = 1 << (data & 15); | |
| 643 | break; | |
| 644 | case 2: // O9: PGOL PROM A8, O10: PGOL PROM A9 | |
| 645 | m_6351_addr = (m_6351_addr & ~(3 << 8)) | ((data & 3) << 8); | |
| 646 | // O11 and O12 are unused(?) | |
| 647 | break; | |
| 648 | } | |
| 649 | 649 | } |
| 650 | 650 | |
| 651 | 651 | READ8_MEMBER (gts1_state::gts1_io_r) |
| 652 | 652 | { |
| 653 | const UINT8 data = 0x0f; | |
| 654 | LOG(("%s: unmapped io[%02x] -> %x\n", __FUNCTION__, offset, data)); | |
| 655 | return data; | |
| 653 | const UINT8 data = 0x0f; | |
| 654 | LOG(("%s: unmapped io[%02x] -> %x\n", __FUNCTION__, offset, data)); | |
| 655 | return data; | |
| 656 | 656 | } |
| 657 | 657 | |
| 658 | 658 | WRITE8_MEMBER(gts1_state::gts1_io_w) |
| 659 | 659 | { |
| 660 | ||
| 660 | LOG(("%s: unmapped io[%02x] <- %x\n", __FUNCTION__, offset, data)); | |
| 661 | 661 | } |
| 662 | 662 | |
| 663 | 663 | READ8_MEMBER (gts1_state::gts1_pa_r) |
| 664 | 664 | { |
| 665 | // return ROM nibble | |
| 666 | UINT8 *ROM = memregion("maincpu")->base(); | |
| 667 | UINT8 data = ROM[0x2000 + m_6351_addr] & 0x0f; | |
| 668 | LOG(("%s: ROM[%03x]:%02x\n", __FUNCTION__, m_6351_addr, data)); | |
| 669 | return data; | |
| 665 | // return ROM nibble | |
| 666 | UINT8 *ROM = memregion("maincpu")->base(); | |
| 667 | UINT8 data = ROM[0x2000 + m_6351_addr] & 0x0f; | |
| 668 | LOG(("%s: ROM[%03x]:%02x\n", __FUNCTION__, m_6351_addr, data)); | |
| 669 | return data; | |
| 670 | 670 | } |
| 671 | 671 | |
| 672 | 672 | WRITE8_MEMBER(gts1_state::gts1_pa_w) |
| 673 | 673 | { |
| 674 | // write address lines 7-4 | |
| 675 | m_6351_addr = (m_6351_addr & 0x0f) | ((data & 0x0f) << 4); | |
| 676 | LOG(("%s: ROM hi:%x addr:%02x\n", __FUNCTION__, data & 0x0f, m_6351_addr)); | |
| 674 | // write address lines 7-4 | |
| 675 | m_6351_addr = (m_6351_addr & 0x0f) | ((data & 0x0f) << 4); | |
| 676 | LOG(("%s: ROM hi:%x addr:%02x\n", __FUNCTION__, data & 0x0f, m_6351_addr)); | |
| 677 | 677 | } |
| 678 | 678 | |
| 679 | 679 | WRITE8_MEMBER(gts1_state::gts1_pb_w) |
| 680 | 680 | { |
| 681 | // write address lines 3-0 | |
| 682 | m_6351_addr = (m_6351_addr & 0xf0) | (data & 0x0f); | |
| 683 | LOG(("%s: ROM lo:%x addr:%02x\n", __FUNCTION__, data & 0x0f, m_6351_addr)); | |
| 681 | // write address lines 3-0 | |
| 682 | m_6351_addr = (m_6351_addr & 0xf0) | (data & 0x0f); | |
| 683 | LOG(("%s: ROM lo:%x addr:%02x\n", __FUNCTION__, data & 0x0f, m_6351_addr)); | |
| 684 | 684 | } |
| 685 | 685 | |
| 686 | 686 | |
| 687 | 687 | static MACHINE_CONFIG_START( gts1, gts1_state ) |
| 688 | /* basic machine hardware */ | |
| 689 | MCFG_CPU_ADD("maincpu", PPS4, XTAL_3_579545MHz / 18) // divided in the CPU | |
| 690 | MCFG_CPU_PROGRAM_MAP(gts1_map) | |
| 691 | MCFG_CPU_DATA_MAP(gts1_data) | |
| 692 | MCFG_CPU_IO_MAP(gts1_io) | |
| 688 | /* basic machine hardware */ | |
| 689 | MCFG_CPU_ADD("maincpu", PPS4, XTAL_3_579545MHz / 18) // divided in the CPU | |
| 690 | MCFG_CPU_PROGRAM_MAP(gts1_map) | |
| 691 | MCFG_CPU_DATA_MAP(gts1_data) | |
| 692 | MCFG_CPU_IO_MAP(gts1_io) | |
| 693 | 693 | |
| 694 | ||
| 694 | MCFG_NVRAM_ADD_0FILL("nvram") | |
| 695 | 695 | |
| 696 | /* A1753CE 2048 x 8 ROM (000-7ff), 128 x 4 RAM (00-7f) and 16 I/O lines (20 ... 2f) */ | |
| 697 | MCFG_DEVICE_ADD( "u5", RA17XX, 0 ) | |
| 698 | MCFG_RA17XX_READ ( READ8 (gts1_state,gts1_switches_r) ) | |
| 699 | MCFG_RA17XX_WRITE( WRITE8(gts1_state,gts1_switches_w) ) | |
| 696 | /* A1753CE 2048 x 8 ROM (000-7ff), 128 x 4 RAM (00-7f) and 16 I/O lines (20 ... 2f) */ | |
| 697 | MCFG_DEVICE_ADD( "u5", RA17XX, 0 ) | |
| 698 | MCFG_RA17XX_READ ( READ8 (gts1_state,gts1_switches_r) ) | |
| 699 | MCFG_RA17XX_WRITE( WRITE8(gts1_state,gts1_switches_w) ) | |
| 700 | 700 | |
| 701 | /* A1752CF 2048 x 8 ROM (800-fff), 128 x 4 RAM (80-ff) and 16 I/O lines (40 ... 4f) */ | |
| 702 | MCFG_DEVICE_ADD( "u4", RA17XX, 0 ) | |
| 703 | MCFG_RA17XX_READ ( READ8 (gts1_state,gts1_solenoid_r) ) | |
| 704 | MCFG_RA17XX_WRITE( WRITE8(gts1_state,gts1_solenoid_w) ) | |
| 701 | /* A1752CF 2048 x 8 ROM (800-fff), 128 x 4 RAM (80-ff) and 16 I/O lines (40 ... 4f) */ | |
| 702 | MCFG_DEVICE_ADD( "u4", RA17XX, 0 ) | |
| 703 | MCFG_RA17XX_READ ( READ8 (gts1_state,gts1_solenoid_r) ) | |
| 704 | MCFG_RA17XX_WRITE( WRITE8(gts1_state,gts1_solenoid_w) ) | |
| 705 | 705 | |
| 706 | /* 10696 General Purpose Input/Output */ | |
| 707 | MCFG_DEVICE_ADD( "u2", R10696, 0 ) | |
| 708 | MCFG_R10696_IO( READ8 (gts1_state,gts1_nvram_r), | |
| 709 | WRITE8(gts1_state,gts1_nvram_w) ) | |
| 706 | /* 10696 General Purpose Input/Output */ | |
| 707 | MCFG_DEVICE_ADD( "u2", R10696, 0 ) | |
| 708 | MCFG_R10696_IO( READ8 (gts1_state,gts1_nvram_r), | |
| 709 | WRITE8(gts1_state,gts1_nvram_w) ) | |
| 710 | 710 | |
| 711 | /* 10696 General Purpose Input/Output */ | |
| 712 | MCFG_DEVICE_ADD( "u3", R10696, 0 ) | |
| 713 | MCFG_R10696_IO( READ8 (gts1_state,gts1_lamp_apm_r), | |
| 714 | WRITE8(gts1_state,gts1_lamp_apm_w) ) | |
| 711 | /* 10696 General Purpose Input/Output */ | |
| 712 | MCFG_DEVICE_ADD( "u3", R10696, 0 ) | |
| 713 | MCFG_R10696_IO( READ8 (gts1_state,gts1_lamp_apm_r), | |
| 714 | WRITE8(gts1_state,gts1_lamp_apm_w) ) | |
| 715 | 715 | |
| 716 | /* 10788 General Purpose Display and Keyboard */ | |
| 717 | MCFG_DEVICE_ADD( "u6", R10788, XTAL_3_579545MHz / 18 ) // divided in the circuit | |
| 718 | MCFG_R10788_UPDATE( WRITE8(gts1_state,gts1_display_w) ) | |
| 716 | /* 10788 General Purpose Display and Keyboard */ | |
| 717 | MCFG_DEVICE_ADD( "u6", R10788, XTAL_3_579545MHz / 18 ) // divided in the circuit | |
| 718 | MCFG_R10788_UPDATE( WRITE8(gts1_state,gts1_display_w) ) | |
| 719 | 719 | |
| 720 | /* Video */ | |
| 721 | MCFG_DEFAULT_LAYOUT( layout_gts1 ) | |
| 720 | /* Video */ | |
| 721 | MCFG_DEFAULT_LAYOUT( layout_gts1 ) | |
| 722 | 722 | |
| 723 | /* Sound */ | |
| 724 | MCFG_FRAGMENT_ADD( genpin_audio ) | |
| 723 | /* Sound */ | |
| 724 | MCFG_FRAGMENT_ADD( genpin_audio ) | |
| 725 | 725 | MACHINE_CONFIG_END |
| 726 | 726 | |
| 727 | 727 | |
| 728 | 728 | ROM_START( gts1 ) |
| 729 | ROM_REGION( 0x10000, "maincpu", 0 ) | |
| 730 | ROM_LOAD("u5_cf.bin", 0x0000, 0x0800, CRC(e0d4b405) SHA1(17aadd79c0dcbb336aadd5d203bc6ca866492345)) | |
| 731 | ROM_LOAD("u4_ce.bin", 0x0800, 0x0800, CRC(4cd312dd) SHA1(31245daa9972ef8652caee69986585bb8239e86e)) | |
| 729 | ROM_REGION( 0x10000, "maincpu", 0 ) | |
| 730 | ROM_LOAD("u5_cf.bin", 0x0000, 0x0800, CRC(e0d4b405) SHA1(17aadd79c0dcbb336aadd5d203bc6ca866492345)) | |
| 731 | ROM_LOAD("u4_ce.bin", 0x0800, 0x0800, CRC(4cd312dd) SHA1(31245daa9972ef8652caee69986585bb8239e86e)) | |
| 732 | 732 | ROM_END |
| 733 | 733 | |
| 734 | 734 | ROM_START( gts1s ) |
| 735 | ROM_REGION( 0x10000, "maincpu", 0 ) | |
| 736 | ROM_LOAD("u5_cf.bin", 0x0000, 0x0800, CRC(e0d4b405) SHA1(17aadd79c0dcbb336aadd5d203bc6ca866492345)) | |
| 737 | ROM_LOAD("u4_ce.bin", 0x0800, 0x0800, CRC(4cd312dd) SHA1(31245daa9972ef8652caee69986585bb8239e86e)) | |
| 735 | ROM_REGION( 0x10000, "maincpu", 0 ) | |
| 736 | ROM_LOAD("u5_cf.bin", 0x0000, 0x0800, CRC(e0d4b405) SHA1(17aadd79c0dcbb336aadd5d203bc6ca866492345)) | |
| 737 | ROM_LOAD("u4_ce.bin", 0x0800, 0x0800, CRC(4cd312dd) SHA1(31245daa9972ef8652caee69986585bb8239e86e)) | |
| 738 | 738 | ROM_END |
| 739 | 739 | |
| 740 | 740 | /*------------------------------------------------------------------- |
| 741 | 741 | / Asteroid Annie and the Aliens (12/1980) #442 |
| 742 | 742 | /-------------------------------------------------------------------*/ |
| 743 | 743 | ROM_START(astannie) |
| 744 | ROM_REGION(0x10000, "maincpu", 0) | |
| 745 | ROM_LOAD("u5_cf.bin", 0x0000, 0x0800, CRC(e0d4b405) SHA1(17aadd79c0dcbb336aadd5d203bc6ca866492345)) | |
| 746 | ROM_LOAD("u4_ce.bin", 0x0800, 0x0800, CRC(4cd312dd) SHA1(31245daa9972ef8652caee69986585bb8239e86e)) | |
| 747 | ROM_LOAD("442.cpu", 0x2000, 0x0400, CRC(579521e0) SHA1(b1b19473e1ca3373955ee96104b87f586c4c311c)) | |
| 748 | ROM_REGION(0x10000, "cpu2", 0) | |
| 749 | ROM_LOAD("442.snd", 0x0400, 0x0400, CRC(c70195b4) SHA1(ff06197f07111d6a4b8942dcfe8d2279bda6f281)) | |
| 750 | ROM_RELOAD( 0x0800, 0x0400) | |
| 751 | ROM_LOAD("6530sys1.bin", 0x0c00, 0x0400, CRC(b7831321) SHA1(c94f4bee97854d0373653a6867016e27d3fc1340)) | |
| 752 | ROM_RELOAD( 0xfc00, 0x0400) | |
| 744 | ROM_REGION(0x10000, "maincpu", 0) | |
| 745 | ROM_LOAD("u5_cf.bin", 0x0000, 0x0800, CRC(e0d4b405) SHA1(17aadd79c0dcbb336aadd5d203bc6ca866492345)) | |
| 746 | ROM_LOAD("u4_ce.bin", 0x0800, 0x0800, CRC(4cd312dd) SHA1(31245daa9972ef8652caee69986585bb8239e86e)) | |
| 747 | ROM_LOAD("442.cpu", 0x2000, 0x0400, CRC(579521e0) SHA1(b1b19473e1ca3373955ee96104b87f586c4c311c)) | |
| 748 | ROM_REGION(0x10000, "cpu2", 0) | |
| 749 | ROM_LOAD("442.snd", 0x0400, 0x0400, CRC(c70195b4) SHA1(ff06197f07111d6a4b8942dcfe8d2279bda6f281)) | |
| 750 | ROM_RELOAD( 0x0800, 0x0400) | |
| 751 | ROM_LOAD("6530sys1.bin", 0x0c00, 0x0400, CRC(b7831321) SHA1(c94f4bee97854d0373653a6867016e27d3fc1340)) | |
| 752 | ROM_RELOAD( 0xfc00, 0x0400) | |
| 753 | 753 | ROM_END |
| 754 | 754 | |
| 755 | 755 | /*------------------------------------------------------------------- |
| 756 | 756 | / Buck Rogers (01/1980) #437 |
| 757 | 757 | /-------------------------------------------------------------------*/ |
| 758 | 758 | ROM_START(buckrgrs) |
| 759 | ROM_REGION(0x10000, "maincpu", 0) | |
| 760 | ROM_LOAD("u5_cf.bin", 0x0000, 0x0800, CRC(e0d4b405) SHA1(17aadd79c0dcbb336aadd5d203bc6ca866492345)) | |
| 761 | ROM_LOAD("u4_ce.bin", 0x0800, 0x0800, CRC(4cd312dd) SHA1(31245daa9972ef8652caee69986585bb8239e86e)) | |
| 762 | ROM_LOAD("437.cpu", 0x2000, 0x0400, CRC(e57d9278) SHA1(dfc4ebff1e14b9a074468671a8e5ac7948d5b352)) | |
| 763 | ROM_REGION(0x10000, "cpu2", 0) | |
| 764 | ROM_LOAD("437.snd", 0x0400, 0x0400, CRC(732b5a27) SHA1(7860ea54e75152246c3ac3205122d750b243b40c)) | |
| 765 | ROM_RELOAD( 0x0800, 0x0400) | |
| 766 | ROM_LOAD("6530sys1.bin", 0x0c00, 0x0400, CRC(b7831321) SHA1(c94f4bee97854d0373653a6867016e27d3fc1340)) | |
| 767 | ROM_RELOAD( 0xfc00, 0x0400) | |
| 759 | ROM_REGION(0x10000, "maincpu", 0) | |
| 760 | ROM_LOAD("u5_cf.bin", 0x0000, 0x0800, CRC(e0d4b405) SHA1(17aadd79c0dcbb336aadd5d203bc6ca866492345)) | |
| 761 | ROM_LOAD("u4_ce.bin", 0x0800, 0x0800, CRC(4cd312dd) SHA1(31245daa9972ef8652caee69986585bb8239e86e)) | |
| 762 | ROM_LOAD("437.cpu", 0x2000, 0x0400, CRC(e57d9278) SHA1(dfc4ebff1e14b9a074468671a8e5ac7948d5b352)) | |
| 763 | ROM_REGION(0x10000, "cpu2", 0) | |
| 764 | ROM_LOAD("437.snd", 0x0400, 0x0400, CRC(732b5a27) SHA1(7860ea54e75152246c3ac3205122d750b243b40c)) | |
| 765 | ROM_RELOAD( 0x0800, 0x0400) | |
| 766 | ROM_LOAD("6530sys1.bin", 0x0c00, 0x0400, CRC(b7831321) SHA1(c94f4bee97854d0373653a6867016e27d3fc1340)) | |
| 767 | ROM_RELOAD( 0xfc00, 0x0400) | |
| 768 | 768 | ROM_END |
| 769 | 769 | |
| 770 | 770 | /*------------------------------------------------------------------- |
| 771 | 771 | / Charlie's Angels (11/1978) #425 |
| 772 | 772 | /-------------------------------------------------------------------*/ |
| 773 | 773 | ROM_START(charlies) |
| 774 | ROM_REGION(0x10000, "maincpu", 0) | |
| 775 | ROM_LOAD("u5_cf.bin", 0x0000, 0x0800, CRC(e0d4b405) SHA1(17aadd79c0dcbb336aadd5d203bc6ca866492345)) | |
| 776 | ROM_LOAD("u4_ce.bin", 0x0800, 0x0800, CRC(4cd312dd) SHA1(31245daa9972ef8652caee69986585bb8239e86e)) | |
| 777 | ROM_LOAD("425.cpu", 0x2000, 0x0400, CRC(928b4279) SHA1(51096d45e880d6a8263eaeaa0cdab0f61ad2f58d)) | |
| 774 | ROM_REGION(0x10000, "maincpu", 0) | |
| 775 | ROM_LOAD("u5_cf.bin", 0x0000, 0x0800, CRC(e0d4b405) SHA1(17aadd79c0dcbb336aadd5d203bc6ca866492345)) | |
| 776 | ROM_LOAD("u4_ce.bin", 0x0800, 0x0800, CRC(4cd312dd) SHA1(31245daa9972ef8652caee69986585bb8239e86e)) | |
| 777 | ROM_LOAD("425.cpu", 0x2000, 0x0400, CRC(928b4279) SHA1(51096d45e880d6a8263eaeaa0cdab0f61ad2f58d)) | |
| 778 | 778 | ROM_END |
| 779 | 779 | /*------------------------------------------------------------------- |
| 780 | 780 | / Cleopatra (11/1977) #409 |
| 781 | 781 | /-------------------------------------------------------------------*/ |
| 782 | 782 | ROM_START(cleoptra) |
| 783 | ROM_REGION(0x10000, "maincpu", 0) | |
| 784 | ROM_LOAD("u5_cf.bin", 0x0000, 0x0800, CRC(e0d4b405) SHA1(17aadd79c0dcbb336aadd5d203bc6ca866492345)) | |
| 785 | ROM_LOAD("u4_ce.bin", 0x0800, 0x0800, CRC(4cd312dd) SHA1(31245daa9972ef8652caee69986585bb8239e86e)) | |
| 786 | ROM_LOAD("409.cpu", 0x2000, 0x0400, CRC(8063ff71) SHA1(205f09f067bf79544d2ce2a48d23259901f935dd)) | |
| 783 | ROM_REGION(0x10000, "maincpu", 0) | |
| 784 | ROM_LOAD("u5_cf.bin", 0x0000, 0x0800, CRC(e0d4b405) SHA1(17aadd79c0dcbb336aadd5d203bc6ca866492345)) | |
| 785 | ROM_LOAD("u4_ce.bin", 0x0800, 0x0800, CRC(4cd312dd) SHA1(31245daa9972ef8652caee69986585bb8239e86e)) | |
| 786 | ROM_LOAD("409.cpu", 0x2000, 0x0400, CRC(8063ff71) SHA1(205f09f067bf79544d2ce2a48d23259901f935dd)) | |
| 787 | 787 | ROM_END |
| 788 | 788 | |
| 789 | 789 | /*------------------------------------------------------------------- |
| 790 | 790 | / Close Encounters of the Third Kind (10/1978) #424 |
| 791 | 791 | /-------------------------------------------------------------------*/ |
| 792 | 792 | ROM_START(closeenc) |
| 793 | ROM_REGION(0x10000, "maincpu", 0) | |
| 794 | ROM_LOAD("u5_cf.bin", 0x0000, 0x0800, CRC(e0d4b405) SHA1(17aadd79c0dcbb336aadd5d203bc6ca866492345)) | |
| 795 | ROM_LOAD("u4_ce.bin", 0x0800, 0x0800, CRC(4cd312dd) SHA1(31245daa9972ef8652caee69986585bb8239e86e)) | |
| 796 | ROM_LOAD("424.cpu", 0x2000, 0x0400, CRC(a7a5dd13) SHA1(223c67b9484baa719c91de52b363ff22813db160)) | |
| 793 | ROM_REGION(0x10000, "maincpu", 0) | |
| 794 | ROM_LOAD("u5_cf.bin", 0x0000, 0x0800, CRC(e0d4b405) SHA1(17aadd79c0dcbb336aadd5d203bc6ca866492345)) | |
| 795 | ROM_LOAD("u4_ce.bin", 0x0800, 0x0800, CRC(4cd312dd) SHA1(31245daa9972ef8652caee69986585bb8239e86e)) | |
| 796 | ROM_LOAD("424.cpu", 0x2000, 0x0400, CRC(a7a5dd13) SHA1(223c67b9484baa719c91de52b363ff22813db160)) | |
| 797 | 797 | ROM_END |
| 798 | 798 | |
| 799 | 799 | /*------------------------------------------------------------------- |
| 800 | 800 | / Count-Down (05/1979) #422 |
| 801 | 801 | /-------------------------------------------------------------------*/ |
| 802 | 802 | ROM_START(countdwn) |
| 803 | ROM_REGION(0x10000, "maincpu", 0) | |
| 804 | ROM_LOAD("u5_cf.bin", 0x0000, 0x0800, CRC(e0d4b405) SHA1(17aadd79c0dcbb336aadd5d203bc6ca866492345)) | |
| 805 | ROM_LOAD("u4_ce.bin", 0x0800, 0x0800, CRC(4cd312dd) SHA1(31245daa9972ef8652caee69986585bb8239e86e)) | |
| 806 | ROM_LOAD("422.cpu", 0x2000, 0x0400, CRC(51bc2df0) SHA1(d4b555d106c6b4e420b0fcd1df8871f869476c22)) | |
| 803 | ROM_REGION(0x10000, "maincpu", 0) | |
| 804 | ROM_LOAD("u5_cf.bin", 0x0000, 0x0800, CRC(e0d4b405) SHA1(17aadd79c0dcbb336aadd5d203bc6ca866492345)) | |
| 805 | ROM_LOAD("u4_ce.bin", 0x0800, 0x0800, CRC(4cd312dd) SHA1(31245daa9972ef8652caee69986585bb8239e86e)) | |
| 806 | ROM_LOAD("422.cpu", 0x2000, 0x0400, CRC(51bc2df0) SHA1(d4b555d106c6b4e420b0fcd1df8871f869476c22)) | |
| 807 | 807 | ROM_END |
| 808 | 808 | |
| 809 | 809 | /*------------------------------------------------------------------- |
| 810 | 810 | / Dragon (10/1978) #419 |
| 811 | 811 | /-------------------------------------------------------------------*/ |
| 812 | 812 | ROM_START(dragon) |
| 813 | ROM_REGION(0x10000, "maincpu", 0) | |
| 814 | ROM_LOAD("u5_cf.bin", 0x0000, 0x0800, CRC(e0d4b405) SHA1(17aadd79c0dcbb336aadd5d203bc6ca866492345)) | |
| 815 | ROM_LOAD("u4_ce.bin", 0x0800, 0x0800, CRC(4cd312dd) SHA1(31245daa9972ef8652caee69986585bb8239e86e)) | |
| 816 | ROM_LOAD("419.cpu", 0x2000, 0x0400, CRC(018d9b3a) SHA1(da37ef5017c71bc41bdb1f30d3fd7ac3b7e1ee7e)) | |
| 813 | ROM_REGION(0x10000, "maincpu", 0) | |
| 814 | ROM_LOAD("u5_cf.bin", 0x0000, 0x0800, CRC(e0d4b405) SHA1(17aadd79c0dcbb336aadd5d203bc6ca866492345)) | |
| 815 | ROM_LOAD("u4_ce.bin", 0x0800, 0x0800, CRC(4cd312dd) SHA1(31245daa9972ef8652caee69986585bb8239e86e)) | |
| 816 | ROM_LOAD("419.cpu", 0x2000, 0x0400, CRC(018d9b3a) SHA1(da37ef5017c71bc41bdb1f30d3fd7ac3b7e1ee7e)) | |
| 817 | 817 | ROM_END |
| 818 | 818 | |
| 819 | 819 | /*------------------------------------------------------------------- |
| 820 | 820 | / Genie (11/1979) #435 |
| 821 | 821 | /-------------------------------------------------------------------*/ |
| 822 | 822 | ROM_START(geniep) |
| 823 | ROM_REGION(0x10000, "maincpu", 0) | |
| 824 | ROM_LOAD("u5_cf.bin", 0x0000, 0x0800, CRC(e0d4b405) SHA1(17aadd79c0dcbb336aadd5d203bc6ca866492345)) | |
| 825 | ROM_LOAD("u4_ce.bin", 0x0800, 0x0800, CRC(4cd312dd) SHA1(31245daa9972ef8652caee69986585bb8239e86e)) | |
| 826 | ROM_LOAD("435.cpu", 0x2000, 0x0400, CRC(7749fd92) SHA1(9cd3e799842392e3939877bf295759c27f199e58)) | |
| 827 | ROM_REGION(0x10000, "cpu2", 0) | |
| 828 | ROM_LOAD("435.snd", 0x0400, 0x0400, CRC(4a98ceed) SHA1(f1d7548e03107033c39953ee04b043b5301dbb47)) | |
| 829 | ROM_RELOAD( 0x0800, 0x0400) | |
| 830 | ROM_LOAD("6530sys1.bin", 0x0c00, 0x0400, CRC(b7831321) SHA1(c94f4bee97854d0373653a6867016e27d3fc1340)) | |
| 831 | ROM_RELOAD( 0xfc00, 0x0400) | |
| 823 | ROM_REGION(0x10000, "maincpu", 0) | |
| 824 | ROM_LOAD("u5_cf.bin", 0x0000, 0x0800, CRC(e0d4b405) SHA1(17aadd79c0dcbb336aadd5d203bc6ca866492345)) | |
| 825 | ROM_LOAD("u4_ce.bin", 0x0800, 0x0800, CRC(4cd312dd) SHA1(31245daa9972ef8652caee69986585bb8239e86e)) | |
| 826 | ROM_LOAD("435.cpu", 0x2000, 0x0400, CRC(7749fd92) SHA1(9cd3e799842392e3939877bf295759c27f199e58)) | |
| 827 | ROM_REGION(0x10000, "cpu2", 0) | |
| 828 | ROM_LOAD("435.snd", 0x0400, 0x0400, CRC(4a98ceed) SHA1(f1d7548e03107033c39953ee04b043b5301dbb47)) | |
| 829 | ROM_RELOAD( 0x0800, 0x0400) | |
| 830 | ROM_LOAD("6530sys1.bin", 0x0c00, 0x0400, CRC(b7831321) SHA1(c94f4bee97854d0373653a6867016e27d3fc1340)) | |
| 831 | ROM_RELOAD( 0xfc00, 0x0400) | |
| 832 | 832 | ROM_END |
| 833 | 833 | |
| 834 | 834 | /*------------------------------------------------------------------- |
| 835 | 835 | / Joker Poker (08/1978) #417 |
| 836 | 836 | /-------------------------------------------------------------------*/ |
| 837 | 837 | ROM_START(jokrpokr) |
| 838 | ROM_REGION(0x10000, "maincpu", 0) | |
| 839 | ROM_LOAD("u5_cf.bin", 0x0000, 0x0800, CRC(e0d4b405) SHA1(17aadd79c0dcbb336aadd5d203bc6ca866492345)) | |
| 840 | ROM_LOAD("u4_ce.bin", 0x0800, 0x0800, CRC(4cd312dd) SHA1(31245daa9972ef8652caee69986585bb8239e86e)) | |
| 841 | ROM_LOAD("417.cpu", 0x2000, 0x0400, CRC(33dade08) SHA1(23b8dbd7b6c84b806fc0d2da95478235cbf9f80a)) | |
| 838 | ROM_REGION(0x10000, "maincpu", 0) | |
| 839 | ROM_LOAD("u5_cf.bin", 0x0000, 0x0800, CRC(e0d4b405) SHA1(17aadd79c0dcbb336aadd5d203bc6ca866492345)) | |
| 840 | ROM_LOAD("u4_ce.bin", 0x0800, 0x0800, CRC(4cd312dd) SHA1(31245daa9972ef8652caee69986585bb8239e86e)) | |
| 841 | ROM_LOAD("417.cpu", 0x2000, 0x0400, CRC(33dade08) SHA1(23b8dbd7b6c84b806fc0d2da95478235cbf9f80a)) | |
| 842 | 842 | ROM_END |
| 843 | 843 | |
| 844 | 844 | /*------------------------------------------------------------------- |
| r242631 | r242632 | |
| 848 | 848 | / L'Hexagone (04/1986) |
| 849 | 849 | /-------------------------------------------------------------------*/ |
| 850 | 850 | ROM_START(hexagone) |
| 851 | ROM_REGION(0x10000, "maincpu", 0) | |
| 852 | ROM_LOAD("u5_cf.bin", 0x0000, 0x0800, CRC(e0d4b405) SHA1(17aadd79c0dcbb336aadd5d203bc6ca866492345)) | |
| 853 | ROM_LOAD("u4_ce.bin", 0x0800, 0x0800, CRC(4cd312dd) SHA1(31245daa9972ef8652caee69986585bb8239e86e)) | |
| 854 | ROM_LOAD("435.cpu", 0x2000, 0x0400, CRC(7749fd92) SHA1(9cd3e799842392e3939877bf295759c27f199e58)) | |
| 855 | ROM_REGION(0x10000, "cpu2", 0) | |
| 856 | ROM_LOAD("hexagone.bin", 0, 0x4000, CRC(002b5464) SHA1(e2d971c4e85b4fb6580c2d3945c9946ea0cebc2e)) | |
| 851 | ROM_REGION(0x10000, "maincpu", 0) | |
| 852 | ROM_LOAD("u5_cf.bin", 0x0000, 0x0800, CRC(e0d4b405) SHA1(17aadd79c0dcbb336aadd5d203bc6ca866492345)) | |
| 853 | ROM_LOAD("u4_ce.bin", 0x0800, 0x0800, CRC(4cd312dd) SHA1(31245daa9972ef8652caee69986585bb8239e86e)) | |
| 854 | ROM_LOAD("435.cpu", 0x2000, 0x0400, CRC(7749fd92) SHA1(9cd3e799842392e3939877bf295759c27f199e58)) | |
| 855 | ROM_REGION(0x10000, "cpu2", 0) | |
| 856 | ROM_LOAD("hexagone.bin", 0, 0x4000, CRC(002b5464) SHA1(e2d971c4e85b4fb6580c2d3945c9946ea0cebc2e)) | |
| 857 | 857 | ROM_END |
| 858 | 858 | /*------------------------------------------------------------------- |
| 859 | 859 | / Movie |
| r242631 | r242632 | |
| 863 | 863 | / Pinball Pool (08/1979) #427 |
| 864 | 864 | /-------------------------------------------------------------------*/ |
| 865 | 865 | ROM_START(pinpool) |
| 866 | ROM_REGION(0x10000, "maincpu", 0) | |
| 867 | ROM_LOAD("u5_cf.bin", 0x0000, 0x0800, CRC(e0d4b405) SHA1(17aadd79c0dcbb336aadd5d203bc6ca866492345)) | |
| 868 | ROM_LOAD("u4_ce.bin", 0x0800, 0x0800, CRC(4cd312dd) SHA1(31245daa9972ef8652caee69986585bb8239e86e)) | |
| 869 | ROM_LOAD("427.cpu", 0x2000, 0x0400, CRC(c496393d) SHA1(e91d9596aacdb4277fa200a3f8f9da099c278f32)) | |
| 866 | ROM_REGION(0x10000, "maincpu", 0) | |
| 867 | ROM_LOAD("u5_cf.bin", 0x0000, 0x0800, CRC(e0d4b405) SHA1(17aadd79c0dcbb336aadd5d203bc6ca866492345)) | |
| 868 | ROM_LOAD("u4_ce.bin", 0x0800, 0x0800, CRC(4cd312dd) SHA1(31245daa9972ef8652caee69986585bb8239e86e)) | |
| 869 | ROM_LOAD("427.cpu", 0x2000, 0x0400, CRC(c496393d) SHA1(e91d9596aacdb4277fa200a3f8f9da099c278f32)) | |
| 870 | 870 | ROM_END |
| 871 | 871 | |
| 872 | 872 | /*------------------------------------------------------------------- |
| 873 | 873 | / Roller Disco (02/1980) #440 |
| 874 | 874 | /-------------------------------------------------------------------*/ |
| 875 | 875 | ROM_START(roldisco) |
| 876 | ROM_REGION(0x10000, "maincpu", 0) | |
| 877 | ROM_LOAD("u5_cf.bin", 0x0000, 0x0800, CRC(e0d4b405) SHA1(17aadd79c0dcbb336aadd5d203bc6ca866492345)) | |
| 878 | ROM_LOAD("u4_ce.bin", 0x0800, 0x0800, CRC(4cd312dd) SHA1(31245daa9972ef8652caee69986585bb8239e86e)) | |
| 879 | ROM_LOAD("440.cpu", 0x2000, 0x0400, CRC(bc50631f) SHA1(6aa3124d09fc4e369d087a5ad6dd1737ace55e41)) | |
| 880 | ROM_REGION(0x10000, "cpu2", 0) | |
| 881 | ROM_LOAD("440.snd", 0x0400, 0x0400, CRC(4a0a05ae) SHA1(88f21b5638494d8e78dc0b6b7d69873b76b5f75d)) | |
| 882 | ROM_RELOAD( 0x0800, 0x0400) | |
| 883 | ROM_LOAD("6530sys1.bin", 0x0c00, 0x0400, CRC(b7831321) SHA1(c94f4bee97854d0373653a6867016e27d3fc1340)) | |
| 884 | ROM_RELOAD( 0xfc00, 0x0400) | |
| 876 | ROM_REGION(0x10000, "maincpu", 0) | |
| 877 | ROM_LOAD("u5_cf.bin", 0x0000, 0x0800, CRC(e0d4b405) SHA1(17aadd79c0dcbb336aadd5d203bc6ca866492345)) | |
| 878 | ROM_LOAD("u4_ce.bin", 0x0800, 0x0800, CRC(4cd312dd) SHA1(31245daa9972ef8652caee69986585bb8239e86e)) | |
| 879 | ROM_LOAD("440.cpu", 0x2000, 0x0400, CRC(bc50631f) SHA1(6aa3124d09fc4e369d087a5ad6dd1737ace55e41)) | |
| 880 | ROM_REGION(0x10000, "cpu2", 0) | |
| 881 | ROM_LOAD("440.snd", 0x0400, 0x0400, CRC(4a0a05ae) SHA1(88f21b5638494d8e78dc0b6b7d69873b76b5f75d)) | |
| 882 | ROM_RELOAD( 0x0800, 0x0400) | |
| 883 | ROM_LOAD("6530sys1.bin", 0x0c00, 0x0400, CRC(b7831321) SHA1(c94f4bee97854d0373653a6867016e27d3fc1340)) | |
| 884 | ROM_RELOAD( 0xfc00, 0x0400) | |
| 885 | 885 | ROM_END |
| 886 | 886 | |
| 887 | 887 | /*------------------------------------------------------------------- |
| r242631 | r242632 | |
| 892 | 892 | / Sinbad (05/1978) #412 |
| 893 | 893 | /-------------------------------------------------------------------*/ |
| 894 | 894 | ROM_START(sinbad) |
| 895 | ROM_REGION(0x10000, "maincpu", 0) | |
| 896 | ROM_LOAD("u5_cf.bin", 0x0000, 0x0800, CRC(e0d4b405) SHA1(17aadd79c0dcbb336aadd5d203bc6ca866492345)) | |
| 897 | ROM_LOAD("u4_ce.bin", 0x0800, 0x0800, CRC(4cd312dd) SHA1(31245daa9972ef8652caee69986585bb8239e86e)) | |
| 898 | ROM_LOAD("412.cpu", 0x2000, 0x0400, CRC(84a86b83) SHA1(f331f2ffd7d1b279b4ffbb939aa8649e723f5fac)) | |
| 895 | ROM_REGION(0x10000, "maincpu", 0) | |
| 896 | ROM_LOAD("u5_cf.bin", 0x0000, 0x0800, CRC(e0d4b405) SHA1(17aadd79c0dcbb336aadd5d203bc6ca866492345)) | |
| 897 | ROM_LOAD("u4_ce.bin", 0x0800, 0x0800, CRC(4cd312dd) SHA1(31245daa9972ef8652caee69986585bb8239e86e)) | |
| 898 | ROM_LOAD("412.cpu", 0x2000, 0x0400, CRC(84a86b83) SHA1(f331f2ffd7d1b279b4ffbb939aa8649e723f5fac)) | |
| 899 | 899 | ROM_END |
| 900 | 900 | |
| 901 | 901 | ROM_START(sinbadn) |
| 902 | ROM_REGION(0x10000, "maincpu", 0) | |
| 903 | ROM_LOAD("u5_cf.bin", 0x0000, 0x0800, CRC(e0d4b405) SHA1(17aadd79c0dcbb336aadd5d203bc6ca866492345)) | |
| 904 | ROM_LOAD("u4_ce.bin", 0x0800, 0x0800, CRC(4cd312dd) SHA1(31245daa9972ef8652caee69986585bb8239e86e)) | |
| 905 | ROM_LOAD("412no1.cpu", 0x2000, 0x0400, CRC(f5373f5f) SHA1(027840501416ff01b2adf07188c7d667adf3ad5f)) | |
| 902 | ROM_REGION(0x10000, "maincpu", 0) | |
| 903 | ROM_LOAD("u5_cf.bin", 0x0000, 0x0800, CRC(e0d4b405) SHA1(17aadd79c0dcbb336aadd5d203bc6ca866492345)) | |
| 904 | ROM_LOAD("u4_ce.bin", 0x0800, 0x0800, CRC(4cd312dd) SHA1(31245daa9972ef8652caee69986585bb8239e86e)) | |
| 905 | ROM_LOAD("412no1.cpu", 0x2000, 0x0400, CRC(f5373f5f) SHA1(027840501416ff01b2adf07188c7d667adf3ad5f)) | |
| 906 | 906 | ROM_END |
| 907 | 907 | |
| 908 | 908 | /*------------------------------------------------------------------- |
| r242631 | r242632 | |
| 913 | 913 | / Solar Ride (02/1979) #421 |
| 914 | 914 | /-------------------------------------------------------------------*/ |
| 915 | 915 | ROM_START(solaride) |
| 916 | ROM_REGION(0x10000, "maincpu", 0) | |
| 917 | ROM_LOAD("u5_cf.bin", 0x0000, 0x0800, CRC(e0d4b405) SHA1(17aadd79c0dcbb336aadd5d203bc6ca866492345)) | |
| 918 | ROM_LOAD("u4_ce.bin", 0x0800, 0x0800, CRC(4cd312dd) SHA1(31245daa9972ef8652caee69986585bb8239e86e)) | |
| 919 | ROM_LOAD("421.cpu", 0x2000, 0x0400, CRC(6b5c5da6) SHA1(a09b7009473be53586f53f48b7bfed9a0c5ecd55)) | |
| 916 | ROM_REGION(0x10000, "maincpu", 0) | |
| 917 | ROM_LOAD("u5_cf.bin", 0x0000, 0x0800, CRC(e0d4b405) SHA1(17aadd79c0dcbb336aadd5d203bc6ca866492345)) | |
| 918 | ROM_LOAD("u4_ce.bin", 0x0800, 0x0800, CRC(4cd312dd) SHA1(31245daa9972ef8652caee69986585bb8239e86e)) | |
| 919 | ROM_LOAD("421.cpu", 0x2000, 0x0400, CRC(6b5c5da6) SHA1(a09b7009473be53586f53f48b7bfed9a0c5ecd55)) | |
| 920 | 920 | ROM_END |
| 921 | 921 | |
| 922 | 922 | /*------------------------------------------------------------------- |
| 923 | 923 | / The Incredible Hulk (10/1979) #433 |
| 924 | 924 | /-------------------------------------------------------------------*/ |
| 925 | 925 | ROM_START(hulk) |
| 926 | ROM_REGION(0x10000, "maincpu", 0) | |
| 927 | ROM_LOAD("u5_cf.bin", 0x0000, 0x0800, CRC(e0d4b405) SHA1(17aadd79c0dcbb336aadd5d203bc6ca866492345)) | |
| 928 | ROM_LOAD("u4_ce.bin", 0x0800, 0x0800, CRC(4cd312dd) SHA1(31245daa9972ef8652caee69986585bb8239e86e)) | |
| 929 | ROM_LOAD("433.cpu", 0x2000, 0x0400, CRC(c05d2b52) SHA1(393fe063b029246317c90ee384db95a84d61dbb7)) | |
| 930 | ROM_REGION(0x10000, "cpu2", 0) | |
| 931 | ROM_LOAD("433.snd", 0x0400, 0x0400, CRC(20cd1dff) SHA1(93e7c47ff7051c3c0dc9f8f95aa33ba094e7cf25)) | |
| 932 | ROM_RELOAD( 0x0800, 0x0400) | |
| 933 | ROM_LOAD("6530sys1.bin", 0x0c00, 0x0400, CRC(b7831321) SHA1(c94f4bee97854d0373653a6867016e27d3fc1340)) | |
| 934 | ROM_RELOAD( 0xfc00, 0x0400) | |
| 926 | ROM_REGION(0x10000, "maincpu", 0) | |
| 927 | ROM_LOAD("u5_cf.bin", 0x0000, 0x0800, CRC(e0d4b405) SHA1(17aadd79c0dcbb336aadd5d203bc6ca866492345)) | |
| 928 | ROM_LOAD("u4_ce.bin", 0x0800, 0x0800, CRC(4cd312dd) SHA1(31245daa9972ef8652caee69986585bb8239e86e)) | |
| 929 | ROM_LOAD("433.cpu", 0x2000, 0x0400, CRC(c05d2b52) SHA1(393fe063b029246317c90ee384db95a84d61dbb7)) | |
| 930 | ROM_REGION(0x10000, "cpu2", 0) | |
| 931 | ROM_LOAD("433.snd", 0x0400, 0x0400, CRC(20cd1dff) SHA1(93e7c47ff7051c3c0dc9f8f95aa33ba094e7cf25)) | |
| 932 | ROM_RELOAD( 0x0800, 0x0400) | |
| 933 | ROM_LOAD("6530sys1.bin", 0x0c00, 0x0400, CRC(b7831321) SHA1(c94f4bee97854d0373653a6867016e27d3fc1340)) | |
| 934 | ROM_RELOAD( 0xfc00, 0x0400) | |
| 935 | 935 | ROM_END |
| 936 | 936 | |
| 937 | 937 | /*------------------------------------------------------------------- |
| 938 | 938 | / Torch (02/1980) #438 |
| 939 | 939 | /-------------------------------------------------------------------*/ |
| 940 | 940 | ROM_START(torch) |
| 941 | ROM_REGION(0x10000, "maincpu", 0) | |
| 942 | ROM_LOAD("u5_cf.bin", 0x0000, 0x0800, CRC(e0d4b405) SHA1(17aadd79c0dcbb336aadd5d203bc6ca866492345)) | |
| 943 | ROM_LOAD("u4_ce.bin", 0x0800, 0x0800, CRC(4cd312dd) SHA1(31245daa9972ef8652caee69986585bb8239e86e)) | |
| 944 | ROM_LOAD("438.cpu", 0x2000, 0x0400, CRC(2d396a64) SHA1(38a1862771500faa471071db08dfbadc6e8759e8)) | |
| 945 | ROM_REGION(0x10000, "cpu2", 0) | |
| 946 | ROM_LOAD("438.snd", 0x0400, 0x0400, CRC(a9619b48) SHA1(1906bc1b059bf31082e3b4546f5a30159479ad3c)) | |
| 947 | ROM_RELOAD( 0x0800, 0x0400) | |
| 948 | ROM_LOAD("6530sys1.bin", 0x0c00, 0x0400, CRC(b7831321) SHA1(c94f4bee97854d0373653a6867016e27d3fc1340)) | |
| 949 | ROM_RELOAD( 0xfc00, 0x0400) | |
| 941 | ROM_REGION(0x10000, "maincpu", 0) | |
| 942 | ROM_LOAD("u5_cf.bin", 0x0000, 0x0800, CRC(e0d4b405) SHA1(17aadd79c0dcbb336aadd5d203bc6ca866492345)) | |
| 943 | ROM_LOAD("u4_ce.bin", 0x0800, 0x0800, CRC(4cd312dd) SHA1(31245daa9972ef8652caee69986585bb8239e86e)) | |
| 944 | ROM_LOAD("438.cpu", 0x2000, 0x0400, CRC(2d396a64) SHA1(38a1862771500faa471071db08dfbadc6e8759e8)) | |
| 945 | ROM_REGION(0x10000, "cpu2", 0) | |
| 946 | ROM_LOAD("438.snd", 0x0400, 0x0400, CRC(a9619b48) SHA1(1906bc1b059bf31082e3b4546f5a30159479ad3c)) | |
| 947 | ROM_RELOAD( 0x0800, 0x0400) | |
| 948 | ROM_LOAD("6530sys1.bin", 0x0c00, 0x0400, CRC(b7831321) SHA1(c94f4bee97854d0373653a6867016e27d3fc1340)) | |
| 949 | ROM_RELOAD( 0xfc00, 0x0400) | |
| 950 | 950 | ROM_END |
| 951 | 951 | |
| 952 | 952 | /*------------------------------------------------------------------- |
| 953 | 953 | / Totem (10/1979) #429 |
| 954 | 954 | /-------------------------------------------------------------------*/ |
| 955 | 955 | ROM_START(totem) |
| 956 | ROM_REGION(0x10000, "maincpu", 0) | |
| 957 | ROM_LOAD("u5_cf.bin", 0x0000, 0x0800, CRC(e0d4b405) SHA1(17aadd79c0dcbb336aadd5d203bc6ca866492345)) | |
| 958 | ROM_LOAD("u4_ce.bin", 0x0800, 0x0800, CRC(4cd312dd) SHA1(31245daa9972ef8652caee69986585bb8239e86e)) | |
| 959 | ROM_LOAD("429.cpu", 0x2000, 0x0400, CRC(7885a384) SHA1(1770662af7d48ad8297097a9877c5c497119978d)) | |
| 960 | ROM_REGION(0x10000, "cpu2", 0) | |
| 961 | ROM_LOAD("429.snd", 0x0400, 0x0400, CRC(5d1b7ed4) SHA1(4a584f880e907fb21da78f3b3a0617f20599688f)) | |
| 962 | ROM_RELOAD( 0x0800, 0x0400) | |
| 963 | ROM_LOAD("6530sys1.bin", 0x0c00, 0x0400, CRC(b7831321) SHA1(c94f4bee97854d0373653a6867016e27d3fc1340)) | |
| 964 | ROM_RELOAD( 0xfc00, 0x0400) | |
| 956 | ROM_REGION(0x10000, "maincpu", 0) | |
| 957 | ROM_LOAD("u5_cf.bin", 0x0000, 0x0800, CRC(e0d4b405) SHA1(17aadd79c0dcbb336aadd5d203bc6ca866492345)) | |
| 958 | ROM_LOAD("u4_ce.bin", 0x0800, 0x0800, CRC(4cd312dd) SHA1(31245daa9972ef8652caee69986585bb8239e86e)) | |
| 959 | ROM_LOAD("429.cpu", 0x2000, 0x0400, CRC(7885a384) SHA1(1770662af7d48ad8297097a9877c5c497119978d)) | |
| 960 | ROM_REGION(0x10000, "cpu2", 0) | |
| 961 | ROM_LOAD("429.snd", 0x0400, 0x0400, CRC(5d1b7ed4) SHA1(4a584f880e907fb21da78f3b3a0617f20599688f)) | |
| 962 | ROM_RELOAD( 0x0800, 0x0400) | |
| 963 | ROM_LOAD("6530sys1.bin", 0x0c00, 0x0400, CRC(b7831321) SHA1(c94f4bee97854d0373653a6867016e27d3fc1340)) | |
| 964 | ROM_RELOAD( 0xfc00, 0x0400) | |
| 965 | 965 | ROM_END |
| 966 | 966 | |
| 967 | 967 | /*------------------------------------------------------------------- |
| 968 | 968 | / System 1 Test prom |
| 969 | 969 | /-------------------------------------------------------------------*/ |
| 970 | 970 | ROM_START(sys1test) |
| 971 | ROM_REGION(0x10000, "maincpu", 0) | |
| 972 | ROM_LOAD("u5_cf.bin", 0x0000, 0x0800, CRC(e0d4b405) SHA1(17aadd79c0dcbb336aadd5d203bc6ca866492345)) | |
| 973 | ROM_LOAD("u4_ce.bin", 0x0800, 0x0800, CRC(4cd312dd) SHA1(31245daa9972ef8652caee69986585bb8239e86e)) | |
| 974 | ROM_LOAD("test.cpu", 0x2000, 0x0400, CRC(8b0704bb) SHA1(5f0eb8d5af867b815b6012c9d078927398efe6d8)) | |
| 971 | ROM_REGION(0x10000, "maincpu", 0) | |
| 972 | ROM_LOAD("u5_cf.bin", 0x0000, 0x0800, CRC(e0d4b405) SHA1(17aadd79c0dcbb336aadd5d203bc6ca866492345)) | |
| 973 | ROM_LOAD("u4_ce.bin", 0x0800, 0x0800, CRC(4cd312dd) SHA1(31245daa9972ef8652caee69986585bb8239e86e)) | |
| 974 | ROM_LOAD("test.cpu", 0x2000, 0x0400, CRC(8b0704bb) SHA1(5f0eb8d5af867b815b6012c9d078927398efe6d8)) | |
| 975 | 975 | ROM_END |
| 976 | 976 | |
| 977 | 977 |
| r242631 | r242632 | |
|---|---|---|
| 495 | 495 | |
| 496 | 496 | static MACHINE_CONFIG_DERIVED( yamyam, gundealr ) |
| 497 | 497 | |
| 498 | MCFG_TIMER_DRIVER_ADD_PERIODIC("mcusim", gundealr_state, yamyam_mcu_sim, attotime::from_hz(6000000/60)) | |
| 498 | MCFG_TIMER_DRIVER_ADD_PERIODIC("mcusim", gundealr_state, yamyam_mcu_sim, attotime::from_hz(6000000/60)) /* 6mhz confirmed */ | |
| 499 | 499 | MACHINE_CONFIG_END |
| 500 | 500 | |
| 501 | 501 |
| r242631 | r242632 | |
|---|---|---|
| 510 | 510 | |
| 511 | 511 | static INPUT_PORTS_START( jingbell ) |
| 512 | 512 | PORT_START("DSW1") |
| 513 | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) | |
| 513 | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("DSW1:1") | |
| 514 | 514 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 515 | 515 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 516 | PORT_DIPNAME( 0x02, 0x00, "W-Up Bonus" ) | |
| 516 | PORT_DIPNAME( 0x02, 0x00, "W-Up Bonus" ) PORT_DIPLOCATION("DSW1:2") | |
| 517 | 517 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) |
| 518 | 518 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 519 | PORT_DIPNAME( 0x04, 0x04, "Min Bet" ) | |
| 519 | PORT_DIPNAME( 0x04, 0x04, "Min Bet" ) PORT_DIPLOCATION("DSW1:3") | |
| 520 | 520 | PORT_DIPSETTING( 0x04, "1" ) |
| 521 | 521 | PORT_DIPSETTING( 0x00, "8" ) |
| 522 | PORT_DIPNAME( 0x08, 0x08, "Spin Speed" ) | |
| 522 | PORT_DIPNAME( 0x08, 0x08, "Spin Speed" ) PORT_DIPLOCATION("DSW1:4") | |
| 523 | 523 | PORT_DIPSETTING( 0x08, "Slow" ) |
| 524 | 524 | PORT_DIPSETTING( 0x00, "Quick" ) |
| 525 | PORT_DIPNAME( 0x10, 0x00, "Strip Girl" ) | |
| 525 | PORT_DIPNAME( 0x10, 0x00, "Strip Girl" ) PORT_DIPLOCATION("DSW1:5") | |
| 526 | 526 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 527 | 527 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 528 | PORT_DIPNAME( 0x20, 0x20, "Payout Mode" ) | |
| 528 | PORT_DIPNAME( 0x20, 0x20, "Payout Mode" ) PORT_DIPLOCATION("DSW1:6") | |
| 529 | 529 | PORT_DIPSETTING( 0x20, DEF_STR( Normal ) ) |
| 530 | 530 | PORT_DIPSETTING( 0x00, "Auto" ) |
| 531 | PORT_DIPNAME( 0xc0, 0xc0, "Player's Panel" ) | |
| 531 | PORT_DIPNAME( 0xc0, 0xc0, "Player's Panel" ) PORT_DIPLOCATION("DSW1:7,8") | |
| 532 | 532 | PORT_DIPSETTING( 0x00, "Type A" ) |
| 533 | 533 | PORT_DIPSETTING( 0xc0, "Type A" ) |
| 534 | 534 | PORT_DIPSETTING( 0x80, "Type B" ) |
| 535 | 535 | PORT_DIPSETTING( 0x40, "Type C" ) |
| 536 | 536 | |
| 537 | 537 | PORT_START("DSW2") |
| 538 | PORT_DIPNAME( 0x07, 0x07, "Main Game Rate (%)" ) | |
| 538 | PORT_DIPNAME( 0x07, 0x07, "Main Game Rate (%)" ) PORT_DIPLOCATION("DSW2:1,2,3") | |
| 539 | 539 | PORT_DIPSETTING( 0x07, "55" ) |
| 540 | 540 | PORT_DIPSETTING( 0x06, "60" ) |
| 541 | 541 | PORT_DIPSETTING( 0x05, "65" ) |
| r242631 | r242632 | |
| 544 | 544 | PORT_DIPSETTING( 0x02, "80" ) |
| 545 | 545 | PORT_DIPSETTING( 0x01, "85" ) |
| 546 | 546 | PORT_DIPSETTING( 0x00, "90" ) |
| 547 | PORT_DIPNAME( 0x38, 0x38, "W-Up Chance (%)" ) | |
| 547 | PORT_DIPNAME( 0x38, 0x38, "W-Up Chance (%)" ) PORT_DIPLOCATION("DSW2:4,5,6") | |
| 548 | 548 | PORT_DIPSETTING( 0x38, "93" ) |
| 549 | 549 | PORT_DIPSETTING( 0x30, "94" ) |
| 550 | 550 | PORT_DIPSETTING( 0x28, "95" ) |
| r242631 | r242632 | |
| 553 | 553 | PORT_DIPSETTING( 0x10, "98" ) |
| 554 | 554 | PORT_DIPSETTING( 0x08, "99" ) |
| 555 | 555 | PORT_DIPSETTING( 0x00, "100" ) |
| 556 | PORT_DIPNAME( 0xc0, 0xc0, "Key In Limit" ) | |
| 556 | PORT_DIPNAME( 0xc0, 0xc0, "Key In Limit" ) PORT_DIPLOCATION("DSW2:7,8") | |
| 557 | 557 | PORT_DIPSETTING( 0xc0, "1k" ) |
| 558 | 558 | PORT_DIPSETTING( 0x80, "3k" ) |
| 559 | 559 | PORT_DIPSETTING( 0x40, "5k" ) |
| 560 | 560 | PORT_DIPSETTING( 0x00, "10k" ) |
| 561 | 561 | |
| 562 | 562 | PORT_START("DSW3") |
| 563 | PORT_DIPNAME( 0x07, 0x07, "Key In Rate" ) | |
| 563 | PORT_DIPNAME( 0x07, 0x07, "Key In Rate" ) PORT_DIPLOCATION("DSW3:1,2,3") | |
| 564 | 564 | PORT_DIPSETTING( 0x07, "1" ) |
| 565 | 565 | PORT_DIPSETTING( 0x06, "5" ) |
| 566 | 566 | PORT_DIPSETTING( 0x05, "10" ) |
| r242631 | r242632 | |
| 569 | 569 | PORT_DIPSETTING( 0x02, "100" ) |
| 570 | 570 | PORT_DIPSETTING( 0x01, "200" ) |
| 571 | 571 | PORT_DIPSETTING( 0x00, "500" ) |
| 572 | PORT_DIPNAME( 0x38, 0x38, "Coin 1 Rate" ) | |
| 572 | PORT_DIPNAME( 0x38, 0x38, "Coin 1 Rate" ) PORT_DIPLOCATION("DSW3:4,5,6") | |
| 573 | 573 | PORT_DIPSETTING( 0x38, "1" ) |
| 574 | 574 | PORT_DIPSETTING( 0x30, "2" ) |
| 575 | 575 | PORT_DIPSETTING( 0x28, "5" ) |
| r242631 | r242632 | |
| 578 | 578 | PORT_DIPSETTING( 0x10, "25" ) |
| 579 | 579 | PORT_DIPSETTING( 0x08, "50" ) |
| 580 | 580 | PORT_DIPSETTING( 0x00, "100" ) |
| 581 | PORT_DIPNAME( 0xc0, 0xc0, "System Limit" ) | |
| 581 | PORT_DIPNAME( 0xc0, 0xc0, "System Limit" ) PORT_DIPLOCATION("DSW3:7,8") | |
| 582 | 582 | PORT_DIPSETTING( 0xc0, "5k" ) |
| 583 | 583 | PORT_DIPSETTING( 0x80, "10k" ) |
| 584 | 584 | PORT_DIPSETTING( 0x40, "30k" ) |
| 585 | 585 | PORT_DIPSETTING( 0x00, "Unlimited" ) |
| 586 | 586 | |
| 587 | 587 | PORT_START("DSW4") |
| 588 | PORT_DIPNAME( 0x01, 0x01, "Min Play For Fever" ) | |
| 588 | PORT_DIPNAME( 0x01, 0x01, "Min Play For Fever" ) PORT_DIPLOCATION("DSW4:1") | |
| 589 | 589 | PORT_DIPSETTING( 0x01, "8" ) |
| 590 | 590 | PORT_DIPSETTING( 0x00, "16" ) |
| 591 | PORT_DIPNAME( 0x02, 0x02, "Max Bet" ) | |
| 591 | PORT_DIPNAME( 0x02, 0x02, "Max Bet" ) PORT_DIPLOCATION("DSW4:2") | |
| 592 | 592 | PORT_DIPSETTING( 0x02, "16" ) |
| 593 | 593 | PORT_DIPSETTING( 0x00, "32" ) |
| 594 | PORT_DIPNAME( 0x1c, 0x1c, "Coin 2 Rate" ) | |
| 594 | PORT_DIPNAME( 0x1c, 0x1c, "Coin 2 Rate" ) PORT_DIPLOCATION("DSW4:3,4,5") | |
| 595 | 595 | PORT_DIPSETTING( 0x1c, "1" ) |
| 596 | 596 | PORT_DIPSETTING( 0x18, "2" ) |
| 597 | 597 | PORT_DIPSETTING( 0x14, "5" ) |
| r242631 | r242632 | |
| 600 | 600 | PORT_DIPSETTING( 0x08, "40" ) |
| 601 | 601 | PORT_DIPSETTING( 0x04, "50" ) |
| 602 | 602 | PORT_DIPSETTING( 0x00, "100" ) |
| 603 | PORT_DIPNAME( 0x60, 0x60, "Key Out Rate" ) | |
| 603 | PORT_DIPNAME( 0x60, 0x60, "Key Out Rate" ) PORT_DIPLOCATION("DSW4:6,7") | |
| 604 | 604 | PORT_DIPSETTING( 0x60, "1" ) |
| 605 | 605 | PORT_DIPSETTING( 0x40, "10" ) |
| 606 | 606 | PORT_DIPSETTING( 0x20, "50" ) |
| 607 | 607 | PORT_DIPSETTING( 0x00, "100" ) |
| 608 | PORT_DIPNAME( 0x80, 0x80, "Play Line" ) | |
| 608 | PORT_DIPNAME( 0x80, 0x80, "Play Line" ) PORT_DIPLOCATION("DSW4:8") | |
| 609 | 609 | PORT_DIPSETTING( 0x80, "8" ) |
| 610 | 610 | PORT_DIPSETTING( 0x00, "16" ) |
| 611 | 611 | |
| 612 | // These are from the manual for v201us - DSW1-DSW4 match but DSW5 doesn't seem to match or actuallly do anything | |
| 612 | // These are from the manual for v201us - DSW1-DSW4 match but DSW5 doesn't seem to match or actuallly do anything | |
| 613 | 613 | PORT_START("DSW5") |
| 614 | PORT_DIPNAME( 0x03, 0x00, "Maximum Play" ) | |
| 614 | PORT_DIPNAME( 0x03, 0x00, "Maximum Play" ) PORT_DIPLOCATION("DSW5:1,2") | |
| 615 | 615 | PORT_DIPSETTING( 0x00, "64" ) |
| 616 | 616 | PORT_DIPSETTING( 0x01, "32" ) |
| 617 | 617 | PORT_DIPSETTING( 0x02, "16" ) |
| 618 | 618 | PORT_DIPSETTING( 0x03, "8" ) |
| 619 | PORT_DIPNAME( 0x04, 0x04, "Skill Stop" ) | |
| 619 | PORT_DIPNAME( 0x04, 0x04, "Skill Stop" ) PORT_DIPLOCATION("DSW5:3") | |
| 620 | 620 | PORT_DIPSETTING( 0x04, "On" ) |
| 621 | 621 | PORT_DIPSETTING( 0x00, "Off" ) |
| 622 | PORT_DIPNAME( 0x08, 0x00, "Hands Count" ) | |
| 622 | PORT_DIPNAME( 0x08, 0x00, "Hands Count" ) PORT_DIPLOCATION("DSW5:4") | |
| 623 | 623 | PORT_DIPSETTING( 0x08, "No" ) |
| 624 | 624 | PORT_DIPSETTING( 0x00, "Yes" ) |
| 625 | PORT_DIPNAME( 0x30, 0x00, "Hands Coin Rate" ) | |
| 625 | PORT_DIPNAME( 0x30, 0x00, "Hands Coin Rate" ) PORT_DIPLOCATION("DSW5:5,6") | |
| 626 | 626 | PORT_DIPSETTING( 0x00, "25" ) |
| 627 | 627 | PORT_DIPSETTING( 0x20, "10" ) |
| 628 | 628 | PORT_DIPSETTING( 0x10, "5" ) |
| 629 | 629 | PORT_DIPSETTING( 0x30, "1" ) |
| 630 | PORT_DIPNAME( 0x40, 0x40, "Hands Coin Value" ) | |
| 630 | PORT_DIPNAME( 0x40, 0x40, "Hands Coin Value" ) PORT_DIPLOCATION("DSW5:7") | |
| 631 | 631 | PORT_DIPSETTING( 0x00, "40" ) |
| 632 | 632 | PORT_DIPSETTING( 0x40, "20" ) |
| 633 | PORT_DIPNAME( 0x80, 0x80, "Unused" ) | |
| 633 | PORT_DIPNAME( 0x80, 0x80, "Unused" ) PORT_DIPLOCATION("DSW5:8") | |
| 634 | 634 | PORT_DIPSETTING( 0x00, "On" ) |
| 635 | 635 | PORT_DIPSETTING( 0x80, "Off" ) |
| 636 | 636 |
| r242631 | r242632 | |
|---|---|---|
| 1324 | 1324 | MCFG_SOUND_ADD("upd",UPD7759, UPD7759_STANDARD_CLOCK) |
| 1325 | 1325 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 1326 | 1326 | MCFG_DEFAULT_LAYOUT(layout_jpmimpct) |
| 1327 | ||
| 1327 | ||
| 1328 | 1328 | MCFG_STARPOINT_48STEP_ADD("reel0") |
| 1329 | 1329 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(jpmimpct_state, reel0_optic_cb)) |
| 1330 | 1330 | MCFG_STARPOINT_48STEP_ADD("reel1") |
| r242631 | r242632 | |
| 1337 | 1337 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(jpmimpct_state, reel4_optic_cb)) |
| 1338 | 1338 | MCFG_STARPOINT_48STEP_ADD("reel5") |
| 1339 | 1339 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(jpmimpct_state, reel5_optic_cb)) |
| 1340 | ||
| 1340 | ||
| 1341 | 1341 | MACHINE_CONFIG_END |
| 1342 | 1342 | |
| 1343 | 1343 |
| r242631 | r242632 | |
|---|---|---|
| 114 | 114 | WCC Football Intercontinental Clubs 2008-2009 ? ? ? |
| 115 | 115 | WCC Football Intercontinental Clubs 2009-2010 ? ? ? |
| 116 | 116 | |
| 117 | * denotes these DVDs are archived. | |
| 118 | ^ denotes these PICs are archived. | |
| 117 | * denotes these DVDs are archived. | |
| 118 | ^ denotes these PICs are archived. | |
| 119 | 119 | This list is not necessarily correct or complete. |
| 120 | 120 | Corrections and additions to the above are welcome. |
| 121 | 121 | |
| r242631 | r242632 | |
| 386 | 386 | ROM_LOAD("fpr-24370b.ic6", 0x000000, 0x400000, CRC(c3b021a4) SHA1(1b6938a50fe0e4ae813864649eb103838c399ac0)) \ |
| 387 | 387 | \ |
| 388 | 388 | ROM_REGION32_LE(0x10000, ":pci:01.0:00.0", 0) /* Geforce bios extension (custom for the card) */ \ |
| 389 | ROM_LOAD("vid_bios.u504", 0x00000, 0x10000, CRC(f78d14d7) SHA1(f129787e487984edd23bf344f2e9500c85052275)) \ | |
| 390 | ||
| 389 | ROM_LOAD("vid_bios.u504", 0x00000, 0x10000, CRC(f78d14d7) SHA1(f129787e487984edd23bf344f2e9500c85052275)) | |
| 391 | 390 | ROM_START(lindbios) |
| 392 | 391 | LINDBERGH_BIOS |
| 393 | 392 | ROM_END |
| r242631 | r242632 | |
|---|---|---|
| 628 | 628 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(maygay1b_state, reel4_optic_cb)) |
| 629 | 629 | MCFG_STARPOINT_48STEP_ADD("reel5") |
| 630 | 630 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(maygay1b_state, reel5_optic_cb)) |
| 631 | ||
| 631 | ||
| 632 | 632 | MCFG_NVRAM_ADD_0FILL("nvram") |
| 633 | 633 | |
| 634 | 634 | MCFG_DEFAULT_LAYOUT(layout_maygay1b) |
| r242631 | r242632 | |
|---|---|---|
| 282 | 282 | void mjkjidai_state::machine_start() |
| 283 | 283 | { |
| 284 | 284 | membank("bank1")->configure_entries(0, 4, memregion("maincpu")->base() + 0x8000, 0x4000); |
| 285 | ||
| 285 | ||
| 286 | 286 | save_item(NAME(m_adpcm_pos)); |
| 287 | 287 | save_item(NAME(m_adpcm_end)); |
| 288 | 288 | save_item(NAME(m_keyb)); |
| r242631 | r242632 | |
|---|---|---|
| 801 | 801 | MCFG_STEPPER_END_INDEX(3)\ |
| 802 | 802 | MCFG_STEPPER_INDEX_PATTERN(0x00)\ |
| 803 | 803 | MCFG_STEPPER_INIT_PHASE(2) |
| 804 | ||
| 804 | ||
| 805 | 805 | static MACHINE_CONFIG_START( mpu3base, mpu3_state ) |
| 806 | 806 | MCFG_CPU_ADD("maincpu", M6808, MPU3_MASTER_CLOCK)///4) |
| 807 | 807 | MCFG_CPU_PROGRAM_MAP(mpu3_basemap) |
| r242631 | r242632 | |
|---|---|---|
| 2477 | 2477 | MCFG_STEPPER_END_INDEX(3)\ |
| 2478 | 2478 | MCFG_STEPPER_INDEX_PATTERN(0x00)\ |
| 2479 | 2479 | MCFG_STEPPER_INIT_PHASE(2) |
| 2480 | ||
| 2480 | ||
| 2481 | 2481 | #define MCFG_MPU4_TYPE2_REEL_ADD(_tag)\ |
| 2482 | 2482 | MCFG_STEPPER_ADD(_tag)\ |
| 2483 | 2483 | MCFG_STEPPER_REEL_TYPE(BARCREST_48STEP_REEL)\ |
| r242631 | r242632 | |
| 2501 | 2501 | MCFG_STEPPER_END_INDEX(3)\ |
| 2502 | 2502 | MCFG_STEPPER_INDEX_PATTERN(0x00)\ |
| 2503 | 2503 | MCFG_STEPPER_INIT_PHASE(2) |
| 2504 | ||
| 2505 | 2504 | |
| 2505 | ||
| 2506 | 2506 | MACHINE_CONFIG_FRAGMENT( mpu4_std_4reel ) |
| 2507 | 2507 | MCFG_MPU4_STD_REEL_ADD("reel0") |
| 2508 | 2508 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu4_state, reel0_optic_cb)) |
| r242631 | r242632 | |
| 2511 | 2511 | MCFG_MPU4_STD_REEL_ADD("reel2") |
| 2512 | 2512 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu4_state, reel2_optic_cb)) |
| 2513 | 2513 | MCFG_MPU4_STD_REEL_ADD("reel3") |
| 2514 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu4_state, reel3_optic_cb)) | |
| 2515 | MACHINE_CONFIG_END | |
| 2514 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu4_state, reel3_optic_cb)) | |
| 2515 | MACHINE_CONFIG_END | |
| 2516 | 2516 | |
| 2517 | 2517 | MACHINE_CONFIG_FRAGMENT( mpu4_std_5reel ) |
| 2518 | 2518 | MCFG_MPU4_STD_REEL_ADD("reel0") |
| r242631 | r242632 | |
| 2522 | 2522 | MCFG_MPU4_STD_REEL_ADD("reel2") |
| 2523 | 2523 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu4_state, reel2_optic_cb)) |
| 2524 | 2524 | MCFG_MPU4_STD_REEL_ADD("reel3") |
| 2525 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu4_state, reel3_optic_cb)) | |
| 2525 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu4_state, reel3_optic_cb)) | |
| 2526 | 2526 | MCFG_MPU4_STD_REEL_ADD("reel4") |
| 2527 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu4_state, reel4_optic_cb)) | |
| 2528 | MACHINE_CONFIG_END | |
| 2527 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu4_state, reel4_optic_cb)) | |
| 2528 | MACHINE_CONFIG_END | |
| 2529 | 2529 | |
| 2530 | 2530 | MACHINE_CONFIG_FRAGMENT( mpu4_std_6reel ) |
| 2531 | 2531 | MCFG_MPU4_STD_REEL_ADD("reel0") |
| r242631 | r242632 | |
| 2535 | 2535 | MCFG_MPU4_STD_REEL_ADD("reel2") |
| 2536 | 2536 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu4_state, reel2_optic_cb)) |
| 2537 | 2537 | MCFG_MPU4_STD_REEL_ADD("reel3") |
| 2538 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu4_state, reel3_optic_cb)) | |
| 2538 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu4_state, reel3_optic_cb)) | |
| 2539 | 2539 | MCFG_MPU4_STD_REEL_ADD("reel4") |
| 2540 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu4_state, reel4_optic_cb)) | |
| 2540 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu4_state, reel4_optic_cb)) | |
| 2541 | 2541 | MCFG_MPU4_STD_REEL_ADD("reel5") |
| 2542 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu4_state, reel4_optic_cb)) | |
| 2543 | MACHINE_CONFIG_END | |
| 2542 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu4_state, reel4_optic_cb)) | |
| 2543 | MACHINE_CONFIG_END | |
| 2544 | 2544 | |
| 2545 | 2545 | MACHINE_CONFIG_FRAGMENT( mpu4_type2_6reel ) |
| 2546 | 2546 | MCFG_MPU4_TYPE2_REEL_ADD("reel0") |
| r242631 | r242632 | |
| 2550 | 2550 | MCFG_MPU4_TYPE2_REEL_ADD("reel2") |
| 2551 | 2551 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu4_state, reel2_optic_cb)) |
| 2552 | 2552 | MCFG_MPU4_TYPE2_REEL_ADD("reel3") |
| 2553 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu4_state, reel3_optic_cb)) | |
| 2553 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu4_state, reel3_optic_cb)) | |
| 2554 | 2554 | MCFG_MPU4_TYPE2_REEL_ADD("reel4") |
| 2555 | 2555 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu4_state, reel4_optic_cb)) |
| 2556 | 2556 | MCFG_MPU4_TYPE2_REEL_ADD("reel5") |
| 2557 | 2557 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu4_state, reel5_optic_cb)) |
| 2558 | MACHINE_CONFIG_END | |
| 2558 | MACHINE_CONFIG_END | |
| 2559 | 2559 | |
| 2560 | 2560 | |
| 2561 | 2561 | MACHINE_CONFIG_FRAGMENT( mpu4_bwb_5reel ) |
| r242631 | r242632 | |
| 2566 | 2566 | MCFG_MPU4_BWB_REEL_ADD("reel2") |
| 2567 | 2567 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu4_state, reel2_optic_cb)) |
| 2568 | 2568 | MCFG_MPU4_BWB_REEL_ADD("reel3") |
| 2569 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu4_state, reel3_optic_cb)) | |
| 2569 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu4_state, reel3_optic_cb)) | |
| 2570 | 2570 | MCFG_MPU4_BWB_REEL_ADD("reel4") |
| 2571 | 2571 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu4_state, reel4_optic_cb)) |
| 2572 | MACHINE_CONFIG_END | |
| 2573 | ||
| 2572 | MACHINE_CONFIG_END | |
| 2573 | ||
| 2574 | 2574 | MACHINE_CONFIG_FRAGMENT( mpu4_alt_7reel ) |
| 2575 | 2575 | MCFG_MPU4_TYPE3_REEL_ADD("reel0") |
| 2576 | 2576 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu4_state, reel0_optic_cb)) |
| r242631 | r242632 | |
| 2579 | 2579 | MCFG_MPU4_TYPE3_REEL_ADD("reel2") |
| 2580 | 2580 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu4_state, reel2_optic_cb)) |
| 2581 | 2581 | MCFG_MPU4_TYPE3_REEL_ADD("reel3") |
| 2582 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu4_state, reel3_optic_cb)) | |
| 2582 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu4_state, reel3_optic_cb)) | |
| 2583 | 2583 | MCFG_MPU4_TYPE3_REEL_ADD("reel4") |
| 2584 | 2584 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu4_state, reel4_optic_cb)) |
| 2585 | 2585 | MCFG_MPU4_TYPE3_REEL_ADD("reel5") |
| r242631 | r242632 | |
| 2587 | 2587 | MCFG_MPU4_TYPE3_REEL_ADD("reel6") |
| 2588 | 2588 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu4_state, reel6_optic_cb)) |
| 2589 | 2589 | MCFG_MPU4_TYPE3_REEL_ADD("reel7") |
| 2590 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu4_state, reel7_optic_cb)) | |
| 2591 | MACHINE_CONFIG_END | |
| 2590 | MCFG_STEPPER_OPTIC_CALLBACK(WRITELINE(mpu4_state, reel7_optic_cb)) | |
| 2591 | MACHINE_CONFIG_END | |
| 2592 | 2592 | |
| 2593 | 2593 | MACHINE_CONFIG_FRAGMENT( mpu4_common ) |
| 2594 | 2594 | MCFG_TIMER_DRIVER_ADD_PERIODIC("50hz", mpu4_state, gen_50hz, attotime::from_hz(100)) |
| r242631 | r242632 | |
| 2654 | 2654 | MCFG_PIA_CB2_HANDLER(WRITELINE(mpu4_state, pia_ic8_cb2_w)) |
| 2655 | 2655 | MCFG_PIA_IRQA_HANDLER(WRITELINE(mpu4_state, cpu0_irq)) |
| 2656 | 2656 | MCFG_PIA_IRQB_HANDLER(WRITELINE(mpu4_state, cpu0_irq)) |
| 2657 | ||
| 2657 | ||
| 2658 | 2658 | MACHINE_CONFIG_END |
| 2659 | 2659 | |
| 2660 | 2660 | MACHINE_CONFIG_FRAGMENT( mpu4_common2 ) |
| r242631 | r242632 | |
| 2727 | 2727 | |
| 2728 | 2728 | MCFG_FRAGMENT_ADD(mpu4_common2) |
| 2729 | 2729 | MCFG_FRAGMENT_ADD(mpu4_std_6reel) |
| 2730 | ||
| 2730 | ||
| 2731 | 2731 | MCFG_SOUND_ADD("msm6376", OKIM6376, 128000) //16KHz sample Can also be 85430 at 10.5KHz and 64000 at 8KHz |
| 2732 | 2732 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) |
| 2733 | 2733 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) |
| r242631 | r242632 | |
| 2749 | 2749 | |
| 2750 | 2750 | MCFG_FRAGMENT_ADD(mpu4_common2) |
| 2751 | 2751 | MCFG_FRAGMENT_ADD(mpu4_std_5reel) |
| 2752 | ||
| 2752 | ||
| 2753 | 2753 | MCFG_SOUND_ADD("msm6376", OKIM6376, 128000) //16KHz sample Can also be 85430 at 10.5KHz and 64000 at 8KHz |
| 2754 | 2754 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) |
| 2755 | 2755 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) |
| r242631 | r242632 | |
| 2759 | 2759 | MCFG_MACHINE_START_OVERRIDE(mpu4_state,mpu4bwb) |
| 2760 | 2760 | MCFG_FRAGMENT_ADD(mpu4_common2) |
| 2761 | 2761 | MCFG_FRAGMENT_ADD(mpu4_bwb_5reel) |
| 2762 | ||
| 2762 | ||
| 2763 | 2763 | MCFG_SOUND_ADD("msm6376", OKIM6376, 128000) //16KHz sample Can also be 85430 at 10.5KHz and 64000 at 8KHz |
| 2764 | 2764 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) |
| 2765 | 2765 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) |
| r242631 | r242632 | |
|---|---|---|
| 325 | 325 | // only known System Super 256 game; if more surface the BIOS should be moved out like 246/256 |
| 326 | 326 | ROM_START( timecrs4 ) |
| 327 | 327 | ROM_REGION(0x200000, "bios", 0) |
| 328 | ROM_LOAD( "r27v1602f.8g", 0x000000, 0x200000, CRC(b2a8eeb6) SHA1(bc4fb4e1e53adbd92385f1726bd69663ff870f1e) ) | |
| 328 | ROM_LOAD( "r27v1602f.8g", 0x000000, 0x200000, CRC(b2a8eeb6) SHA1(bc4fb4e1e53adbd92385f1726bd69663ff870f1e) ) | |
| 329 | 329 | |
| 330 | 330 | ROM_REGION(0x840000, "key", ROMREGION_ERASE00) |
| 331 | ROM_LOAD( "tsf1002-na-a.ic002", 0x000000, 0x800000, CRC(406183a4) SHA1(dd6afaa4808254b277c5969d071f1dd0019633a0) ) | |
| 332 | ROM_LOAD( "tsf1002-na-a_spr.ic002", 0x800000, 0x040000, CRC(e7339b66) SHA1(99a2fd5528daf11a7ea548d9de804f899a2a9c6b) ) | |
| 331 | ROM_LOAD( "tsf1002-na-a.ic002", 0x000000, 0x800000, CRC(406183a4) SHA1(dd6afaa4808254b277c5969d071f1dd0019633a0) ) | |
| 332 | ROM_LOAD( "tsf1002-na-a_spr.ic002", 0x800000, 0x040000, CRC(e7339b66) SHA1(99a2fd5528daf11a7ea548d9de804f899a2a9c6b) ) | |
| 333 | 333 | |
| 334 | DISK_REGION("dvd") | |
| 334 | DISK_REGION("dvd") // HDD for this game | |
| 335 | 335 | DISK_IMAGE_READONLY( "tsf1-ha", 0, SHA1(8ba7eec0d1add2192a115b295a32265c8d084aea) ) |
| 336 | 336 | ROM_END |
| 337 | 337 | |
| r242631 | r242632 | |
| 411 | 411 | SYSTEM256_BIOS |
| 412 | 412 | |
| 413 | 413 | ROM_REGION(0x840000, "key", ROMREGION_ERASE00) |
| 414 | ROM_LOAD( "ted1vera.ic002", 0x000000, 0x800000, CRC(491521d1) SHA1(9c27836445690bc083c6f274a4b1a499d5677830) ) | |
| 415 | ROM_LOAD( "ted1vera_spr.ic002", 0x800000, 0x040000, CRC(a9e1e92b) SHA1(3843d0fea2f12f14f83d0a04430bb9b01cfdef07) ) | |
| 414 | ROM_LOAD( "ted1vera.ic002", 0x000000, 0x800000, CRC(491521d1) SHA1(9c27836445690bc083c6f274a4b1a499d5677830) ) | |
| 415 | ROM_LOAD( "ted1vera_spr.ic002", 0x800000, 0x040000, CRC(a9e1e92b) SHA1(3843d0fea2f12f14f83d0a04430bb9b01cfdef07) ) | |
| 416 | 416 | |
| 417 | 417 | DISK_REGION("dvd") |
| 418 | 418 | DISK_IMAGE_READONLY( "ted1dvd0b", 0, SHA1(5940cc628a1555763ef2055e518f840f9a44d123) ) |
| r242631 | r242632 | |
| 435 | 435 | SYSTEM246_BIOS |
| 436 | 436 | |
| 437 | 437 | ROM_REGION(0x840000, "key", ROMREGION_ERASE00) |
| 438 | ROM_LOAD( "pr21vera.ic002", 0x000000, 0x800000, CRC(36634ad2) SHA1(e365a79220202640e5bc80bbd8a329012f22f9c4) ) | |
| 439 | ROM_LOAD( "pr21vera_spr.ic002", 0x000000, 0x040000, CRC(4e81ef24) SHA1(7b7b9d9a0193bcaccb1578cae9dde37fc456e6f8) ) | |
| 438 | ROM_LOAD( "pr21vera.ic002", 0x000000, 0x800000, CRC(36634ad2) SHA1(e365a79220202640e5bc80bbd8a329012f22f9c4) ) | |
| 439 | ROM_LOAD( "pr21vera_spr.ic002", 0x000000, 0x040000, CRC(4e81ef24) SHA1(7b7b9d9a0193bcaccb1578cae9dde37fc456e6f8) ) | |
| 440 | 440 | |
| 441 | 441 | DISK_REGION("dvd") |
| 442 | 442 | DISK_IMAGE_READONLY( "pr21dvd0", 0, SHA1(6bad5c25996bbe68da71199fbe8377b51fe78d81) ) |
| r242631 | r242632 | |
| 513 | 513 | SYSTEM246_BIOS |
| 514 | 514 | |
| 515 | 515 | ROM_REGION(0x840000, "key", ROMREGION_ERASE00) |
| 516 | ROM_LOAD( "rrv2vera.ic002", 0x000000, 0x800000, CRC(4666f6b5) SHA1(974ed4f6c5869ecf879c0d3540db6ea576225c04) ) | |
| 517 | ROM_LOAD( "rrv2vera_spr.ic002", 0x800000, 0x040000, CRC(8d98ef04) SHA1(3f33046a8283b918226301fcf5538729be84bfbe) ) | |
| 516 | ROM_LOAD( "rrv2vera.ic002", 0x000000, 0x800000, CRC(4666f6b5) SHA1(974ed4f6c5869ecf879c0d3540db6ea576225c04) ) | |
| 517 | ROM_LOAD( "rrv2vera_spr.ic002", 0x800000, 0x040000, CRC(8d98ef04) SHA1(3f33046a8283b918226301fcf5538729be84bfbe) ) | |
| 518 | 518 | |
| 519 | 519 | ROM_REGION(0x4010, "jvsio", 0) // Namco "FCA" JVS I/O board PIC16F84 code (see namcos23.c for FCA details) |
| 520 | 520 | ROM_LOAD( "fcap11.ic2", 0x000000, 0x004010, CRC(1b2592ce) SHA1(a1a487361053af564f6ec67e545413e370a3b38c) ) |
| r242631 | r242632 | |
| 579 | 579 | SYSTEM246_BIOS |
| 580 | 580 | |
| 581 | 581 | ROM_REGION(0x840000, "key", ROMREGION_ERASE00) |
| 582 | ROM_LOAD( "qg1vera.ic002", 0x000000, 0x800000, CRC(650d55fa) SHA1(cf1210bc1f2d48c298ed19e3c6a1e5e564840e47) ) | |
| 583 | ROM_LOAD( "qg1vera_spr.ic002", 0x800000, 0x040000, CRC(d9715f53) SHA1(e45f0eef5b82b2e1afb054a137aced0344ddbd71) ) | |
| 582 | ROM_LOAD( "qg1vera.ic002", 0x000000, 0x800000, CRC(650d55fa) SHA1(cf1210bc1f2d48c298ed19e3c6a1e5e564840e47) ) | |
| 583 | ROM_LOAD( "qg1vera_spr.ic002", 0x800000, 0x040000, CRC(d9715f53) SHA1(e45f0eef5b82b2e1afb054a137aced0344ddbd71) ) | |
| 584 | 584 | |
| 585 | 585 | DISK_REGION("dvd") |
| 586 | 586 | DISK_IMAGE_READONLY( "qg1", 0, SHA1(80fe5cb325c7cfa439d66e9d264337c01559d0e5) ) |
| r242631 | r242632 | |
| 614 | 614 | SYSTEM256_BIOS |
| 615 | 615 | |
| 616 | 616 | ROM_REGION(0x840000, "key", ROMREGION_ERASE00) |
| 617 | ROM_LOAD( "gvs1vera.ic002", 0x000000, 0x800000, CRC(b938b96d) SHA1(e79bc7f8c234d51d1b6a34be88f34abc8205a370) ) | |
| 618 | ROM_LOAD( "gvs1vera_spr.ic002", 0x800000, 0x040000, CRC(f2d65d54) SHA1(297726098c3723e38cbaf3a3150a4a027a9c2124) ) | |
| 617 | ROM_LOAD( "gvs1vera.ic002", 0x000000, 0x800000, CRC(b938b96d) SHA1(e79bc7f8c234d51d1b6a34be88f34abc8205a370) ) | |
| 618 | ROM_LOAD( "gvs1vera_spr.ic002", 0x800000, 0x040000, CRC(f2d65d54) SHA1(297726098c3723e38cbaf3a3150a4a027a9c2124) ) | |
| 619 | 619 | |
| 620 | 620 | DISK_REGION("dvd") |
| 621 | 621 | DISK_IMAGE_READONLY( "gvs1dvd0b", 0, SHA1(3cf9ade5495982fcb8e106e7be4067429530f864) ) |
| r242631 | r242632 | |
| 703 | 703 | |
| 704 | 704 | // System Super 256 |
| 705 | 705 | GAME(2006, timecrs4, sys256, system256, system246, driver_device, 0, ROT0, "Namco", "Time Crisis 4", GAME_IS_SKELETON) |
| 706 |
| r242631 | r242632 | |
|---|---|---|
| 106 | 106 | |
| 107 | 107 | static ADDRESS_MAP_START( oki_map, AS_0, 8, relief_state ) |
| 108 | 108 | AM_RANGE(0x00000, 0x1ffff) AM_ROMBANK("okibank") |
| 109 | AM_RANGE(0x20000, 0x3ffff) AM_ROM | |
| 109 | AM_RANGE(0x20000, 0x3ffff) AM_ROM | |
| 110 | 110 | ADDRESS_MAP_END |
| 111 | 111 | |
| 112 | 112 | |
| r242631 | r242632 | |
| 431 | 431 | } |
| 432 | 432 | |
| 433 | 433 | |
| 434 | ||
| 435 | 434 | |
| 435 | ||
| 436 | 436 | /************************************* |
| 437 | 437 | * |
| 438 | 438 | * Game driver(s) |
| r242631 | r242632 | |
|---|---|---|
| 131 | 131 | // (chip select for an unpopulated fourth ROM?) |
| 132 | 132 | switch (data & 0x1c) |
| 133 | 133 | { |
| 134 | case 0x18: m_adpcm_pos = 0 * 0x8000 * 2; break; // 110 -> ic33 | |
| 135 | case 0x14: m_adpcm_pos = 1 * 0x8000 * 2; break; // 101 -> ic32 | |
| 136 | case 0x0c: m_adpcm_pos = 2 * 0x8000 * 2; break; // 011 -> ic31 | |
| 137 | default: m_adpcm_pos = m_adpcm_end = 0; return; // doesn't happen | |
| 134 | case 0x18: m_adpcm_pos = 0 * 0x8000 * 2; break; // 110 -> ic33 | |
| 135 | case 0x14: m_adpcm_pos = 1 * 0x8000 * 2; break; // 101 -> ic32 | |
| 136 | case 0x0c: m_adpcm_pos = 2 * 0x8000 * 2; break; // 011 -> ic31 | |
| 137 | default: m_adpcm_pos = m_adpcm_end = 0; return; // doesn't happen | |
| 138 | 138 | } |
| 139 | 139 | // bits 0-1 are a13-a14 |
| 140 | 140 | m_adpcm_pos |= (data & 0x03) * 0x2000 * 2; |
| r242631 | r242632 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | Games supported: |
| 8 | 8 | * Super Breakout |
| 9 | * Super Breakout (Canyon and Vertical Breakout, prototype) | |
| 10 | * Super Breakout (Cocktail, prototype) | |
| 9 | * Super Breakout (Canyon and Vertical Breakout, prototype) | |
| 10 | * Super Breakout (Cocktail, prototype) | |
| 11 | 11 | |
| 12 | 12 | Known issues: |
| 13 | 13 | * none at this time |
| r242631 | r242632 | |
| 529 | 529 | |
| 530 | 530 | PORT_MODIFY("SELECT") |
| 531 | 531 | PORT_CONFNAME(0x80, 0x00, "Game Select" ) |
| 532 | PORT_CONFSETTING( 0x00, | |
| 532 | PORT_CONFSETTING( 0x00, DEF_STR( Off ) ) | |
| 533 | 533 | PORT_CONFSETTING( 0x80, DEF_STR( On ) ) |
| 534 | 534 | INPUT_PORTS_END |
| 535 | 535 |
| r242631 | r242632 | |
|---|---|---|
| 1401 | 1401 | PORT_DIPUNUSED_DIPLOC( 0x0020, 0x0000, "SW1:6" ) |
| 1402 | 1402 | PORT_DIPUNUSED_DIPLOC( 0x0040, 0x0000, "SW1:7" ) |
| 1403 | 1403 | PORT_SERVICE_DIPLOC( 0x0080, IP_ACTIVE_LOW, "SW1:8" ) |
| 1404 | PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("Button 4 / Stand / Stop / Drop / Full Bet / Take") PORT_CODE(KEYCODE_V) | |
| 1405 | PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Button 1 / High") PORT_CODE(KEYCODE_Z) | |
| 1406 | PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Button 2 / Low") PORT_CODE(KEYCODE_X) | |
| 1407 | PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Button 3 / Hit / Go / Double Up") PORT_CODE(KEYCODE_C) | |
| 1404 | PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("Button 4 / Stand / Stop / Drop / Full Bet / Take") PORT_CODE(KEYCODE_V) | |
| 1405 | PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Button 1 / High") PORT_CODE(KEYCODE_Z) | |
| 1406 | PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Button 2 / Low") PORT_CODE(KEYCODE_X) | |
| 1407 | PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Button 3 / Hit / Go / Double Up") PORT_CODE(KEYCODE_C) | |
| 1408 | 1408 | PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 1409 | PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("Button 6 / Bet / Raise") PORT_CODE(KEYCODE_N) | |
| 1409 | PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("Button 6 / Bet / Raise") PORT_CODE(KEYCODE_N) | |
| 1410 | 1410 | PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 1411 | 1411 | PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 1412 | 1412 | |
| r242631 | r242632 | |
| 1429 | 1429 | PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 1430 | 1430 | |
| 1431 | 1431 | PORT_START("SYSTEM") |
| 1432 | PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("Button 5 / Start / Double / Call / Check") PORT_CODE(KEYCODE_B) // Double != Double Up | |
| 1432 | PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("Button 5 / Start / Double / Call / Check") PORT_CODE(KEYCODE_B) // Double != Double Up | |
| 1433 | 1433 | PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 1434 | 1434 | PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_COIN1 ) |
| 1435 | 1435 | PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_COIN2 ) |
| r242631 | r242632 | |
|---|---|---|
| 3143 | 3143 | ROM_LOAD16_BYTE("e29-04.ic39", 0x800000, 0x200000, CRC(d1f42457) SHA1(2c77be6365deb5ef215da0c66da23b415623bdb1) ) // D2 C8 C9 CA |
| 3144 | 3144 | ROM_LOAD16_BYTE("e29-05.ic41", 0xc00000, 0x200000, CRC(e33c1234) SHA1(84c336ed6fd8723e824889fe7b52c284be659e62) ) // CB CC -std- |
| 3145 | 3145 | |
| 3146 | ROM_REGION(0x034a, "pals", 0) | |
| 3147 | ROM_LOAD("d77-12.ic48.bin", 0x0000, 0x0001, NO_DUMP) /* PALCE16V8Q-15PC/4 */ | |
| 3148 | ROM_LOAD("d77-14.ic21.bin", 0x0001, 0x0001, NO_DUMP) /* PALCE16V8Q-15PC/4 */ | |
| 3149 | ROM_LOAD("d77-11.ic37.bin", 0x0002, 0x0001, NO_DUMP) /* PALCE16V8Q-15PC/4 */ | |
| 3150 | ROM_LOAD("d77-09.ic14.bin", 0x0003, 0x0001, NO_DUMP) /* PAL16L8ACN */ | |
| 3151 | ROM_LOAD("d77-10.ic28.bin", 0x0004, 0x0001, NO_DUMP) /* PAL16L8ACN */ | |
| 3146 | ROM_REGION(0x034a, "pals", 0) | |
| 3147 | ROM_LOAD("d77-12.ic48.bin", 0x0000, 0x0001, NO_DUMP) /* PALCE16V8Q-15PC/4 */ | |
| 3148 | ROM_LOAD("d77-14.ic21.bin", 0x0001, 0x0001, NO_DUMP) /* PALCE16V8Q-15PC/4 */ | |
| 3149 | ROM_LOAD("d77-11.ic37.bin", 0x0002, 0x0001, NO_DUMP) /* PALCE16V8Q-15PC/4 */ | |
| 3150 | ROM_LOAD("d77-09.ic14.bin", 0x0003, 0x0001, NO_DUMP) /* PAL16L8ACN */ | |
| 3151 | ROM_LOAD("d77-10.ic28.bin", 0x0004, 0x0001, NO_DUMP) /* PAL16L8ACN */ | |
| 3152 | 3152 | ROM_END |
| 3153 | 3153 | |
| 3154 | 3154 | ROM_START( arkretrn ) |
| r242631 | r242632 | |
|---|---|---|
| 619 | 619 | MCFG_SCREEN_PALETTE("palette") |
| 620 | 620 | |
| 621 | 621 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", tigeroad) |
| 622 | ||
| 622 | ||
| 623 | 623 | MCFG_DEVICE_ADD("spritegen", TIGEROAD_SPRITE, 0) |
| 624 | 624 | |
| 625 | 625 | MCFG_PALETTE_ADD("palette", 1024) |
| r242631 | r242632 | |
|---|---|---|
| 80 | 80 | DS2430 - Dallas DS2430 256-bits 1-Wire EEPROM. Has 256 bits x8 EEPROM (32 bytes), 64 bits x8 (8 bytes) |
| 81 | 81 | one-time programmable application register and unique factory-lasered and tested 64-bit |
| 82 | 82 | registration number (8-bit family code + 48-bit serial number + 8-bit CRC) (TO-92 @ U37) |
| 83 | The OTP application register on the common DS2430 and the Police 911 2 DS2430 are not programmed | |
| 84 | (application register reads all 0xFF and the status register reads back 0xFF), so it's probably safe | |
| 83 | The OTP application register on the common DS2430 and the Police 911 2 DS2430 are not programmed | |
| 84 | (application register reads all 0xFF and the status register reads back 0xFF), so it's probably safe | |
| 85 | 85 | to assume they're not used on any of them. |
| 86 | 86 | It appears the DS2430 is not protected from reading and the unique silicon serial number is |
| 87 | 87 | included in the 40 byte dump. This serial number is used as a check to verify the NVRAM and DS2430. |
| 88 | 88 | In the Police 911 2 NVRAM dump the serial number of the DS2430 is located at 0x002A and 0x1026 |
| 89 | 89 | If the serial number in the NVRAM and DS2430 match then they are paired and the game accepts the NVRAM. |
| 90 | 90 | If they don't match the game requires an external DS2430 (i.e. dongle) and flags the NVRAM as 'BAD' |
| 91 | The serial number is not present in the CF card (2 different Police 911 2 cards of the same version | |
| 91 | The serial number is not present in the CF card (2 different Police 911 2 cards of the same version | |
| 92 | 92 | were dumped and matched). |
| 93 | When the lasered ROM is read from the DS2430, it comes out from LSB to MSB (family code, LSB of | |
| 93 | When the lasered ROM is read from the DS2430, it comes out from LSB to MSB (family code, LSB of | |
| 94 | 94 | S/N->MSB of S/N, CRC) |
| 95 | 95 | For Police 911 2 that is 0x14 0xB2 0xB7 0x4A 0x00 0x00 0x00 0x83 |
| 96 | 96 | Family code=0x14 |
| r242631 | r242632 | |
| 104 | 104 | It may be possible to hand craft a DS2430 for a dongle-protected version of a game simply by using |
| 105 | 105 | one of the existing DS2430 dumps and adjusting the serial number found in a dump of the NVRAM to pair them |
| 106 | 106 | or adjusting the serial number in the NVRAM to match the serial number found in one of the dumped DS2430s. |
| 107 | This Police 911 2 board was upgraded from Police 911 by plugging in the dongle and changing the CF card. | |
| 108 | The NVRAM had previously died and the board was dead. Normally for a Viper game that is fatal. Using | |
| 109 | the NVRAM from Police 911 allowed it to boot and then the NVRAM upgraded itself with some additional | |
| 107 | This Police 911 2 board was upgraded from Police 911 by plugging in the dongle and changing the CF card. | |
| 108 | The NVRAM had previously died and the board was dead. Normally for a Viper game that is fatal. Using | |
| 109 | the NVRAM from Police 911 allowed it to boot and then the NVRAM upgraded itself with some additional | |
| 110 | 110 | data (the original data remained untouched). This means the dongle does more than just protect the game. |
| 111 | Another interesting fact about this upgrade is it has been discovered that the PCB can write to the | |
| 112 | external DS2430 in the dongle. This has been proven because the serial number of the DS2430 soldered | |
| 111 | Another interesting fact about this upgrade is it has been discovered that the PCB can write to the | |
| 112 | external DS2430 in the dongle. This has been proven because the serial number of the DS2430 soldered | |
| 113 | 113 | on the PCB is present in the EEPROM area of the Police 911 2 DS2430. |
| 114 | 114 | Here is a dump of the DS2430 from Police 911. Note the EEPROM area is empty and the serial number (from 0x20 onwards) |
| 115 | 115 | is present in the above Police 911 2 DS2430 dump at locations 0x11, 0x10 and 0x0F |
| r242631 | r242632 | |
| 117 | 117 | 00000010h FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF |
| 118 | 118 | 00000020h 14 A9 30 74 00 00 00 E7 |
| 119 | 119 | This proves that the EEPROM area in the DS2430 is unused by an unprotected game and in fact the on-board |
| 120 | DS2430 is completely unused by an unprotected game. That is why any unprotected game will work on any | |
| 120 | DS2430 is completely unused by an unprotected game. That is why any unprotected game will work on any | |
| 121 | 121 | Viper PCB regardless of the on-board DS2430 serial number. |
| 122 | The existing DS2430 'common' dump used in the unprotected games was actually from a (dongle-protected) | |
| 122 | The existing DS2430 'common' dump used in the unprotected games was actually from a (dongle-protected) | |
| 123 | 123 | Mahjong Fight Club PCB but that PCB was used to test and run all of the unprotected Viper games. |
| 124 | 124 | M48T58Y - ST Microelectronics M48T58Y Timekeeper RAM (DIP28 @ U39). When this dies (after 10 year lifespan) |
| 125 | 125 | the game will complain with error RTC BAD then reset. The data inside the RTC can not be hand created |
| 126 | 126 | (yet) so to revive the PCB the correct RTC data must be re-programmed to a new RTC and replaced |
| 127 | 127 | on the PCB. |
| 128 | 128 | Regarding the RTC and protection-related checks.... |
| 129 | "RTC OK" checks 0x0000->0x0945 (i.e. I can clear the contents after 0x0945 and the game will still | |
| 129 | "RTC OK" checks 0x0000->0x0945 (i.e. I can clear the contents after 0x0945 and the game will still | |
| 130 | 130 | happily boot). The NVRAM contents are split into chunks, each of which are checksummed. It is a 16-bit checksum, |
| 131 | computed by summing two consecutive bytes as a 16-bit integer, where the final sum must add up to 0xFFFF (mod | |
| 132 | 65536). The last two bytes in the chunk are used to make the value 0xFFFF. There doesn't appear to be a | |
| 133 | complete checksum over all the chunks (I can pick and choose chunks from various NVRAMs, as long as each chunk | |
| 131 | computed by summing two consecutive bytes as a 16-bit integer, where the final sum must add up to 0xFFFF (mod | |
| 132 | 65536). The last two bytes in the chunk are used to make the value 0xFFFF. There doesn't appear to be a | |
| 133 | complete checksum over all the chunks (I can pick and choose chunks from various NVRAMs, as long as each chunk | |
| 134 | 134 | checksum checks out). The important chunks for booting are the first two. |
| 135 | The first chunk goes from 0x0000-0x000F. This seems to be a game/region identifier, and doesn't like its | |
| 136 | contents changed (I didn't try changing every byte, but several of the bytes would throw RTC errors, even with a | |
| 137 | fixed checksum). I'd guess that the CF verifies this value, since it's different for every game (i.e. Mocap | |
| 135 | The first chunk goes from 0x0000-0x000F. This seems to be a game/region identifier, and doesn't like its | |
| 136 | contents changed (I didn't try changing every byte, but several of the bytes would throw RTC errors, even with a | |
| 137 | fixed checksum). I'd guess that the CF verifies this value, since it's different for every game (i.e. Mocap | |
| 138 | 138 | Boxing NVRAM would have a correct checksum, but shouldn't pass Police 911 checks). |
| 139 | The second chunk goes from 0x0010-0x0079. This seems to be a board identifier. This has (optionally) | |
| 140 | several fields, each of which are 20 bytes long. I'm unsure of the first 6 bytes, the following 6 | |
| 141 | bytes are the DS2430A S/N, and the last 8 bytes are a game/region/dongle identifier. If running | |
| 142 | without a dongle, only the first 20 byte field is present. With a dongle, a second 20 byte field will | |
| 143 | be present. Moving this second field into the place of the first field (and fixing the checksum) | |
| 144 | doesn't work, and the second field will be ignored if the first field is valid for the game (and in | |
| 145 | which case the dongle will be ignored). For example, Police 911 will boot with a valid first field, | |
| 146 | with or without the second field, and with or without the dongle plugged in. If you have both fields, | |
| 147 | and leave the dongle plugged in, you can switch between Police 911 and Police 911/2 by simply swapping | |
| 139 | The second chunk goes from 0x0010-0x0079. This seems to be a board identifier. This has (optionally) | |
| 140 | several fields, each of which are 20 bytes long. I'm unsure of the first 6 bytes, the following 6 | |
| 141 | bytes are the DS2430A S/N, and the last 8 bytes are a game/region/dongle identifier. If running | |
| 142 | without a dongle, only the first 20 byte field is present. With a dongle, a second 20 byte field will | |
| 143 | be present. Moving this second field into the place of the first field (and fixing the checksum) | |
| 144 | doesn't work, and the second field will be ignored if the first field is valid for the game (and in | |
| 145 | which case the dongle will be ignored). For example, Police 911 will boot with a valid first field, | |
| 146 | with or without the second field, and with or without the dongle plugged in. If you have both fields, | |
| 147 | and leave the dongle plugged in, you can switch between Police 911 and Police 911/2 by simply swapping | |
| 148 | 148 | CF cards. |
| 149 | 149 | 29F002 - Fujitsu 29F002 256k x8 EEPROM stamped '941B01' (PLCC44 @ U25). Earlier revision stamped '941A01' |
| 150 | 150 | CN4/CN5 - RCA-type network connection jacks |
| r242631 | r242632 | |
| 244 | 244 | CN2/CN3 - Video output connector to external monitors |
| 245 | 245 | CN4/CN5 - Multi-pin IDC connectors joining to main board CN15/CN16 |
| 246 | 246 | |
| 247 | An additional control PCB is used for Mocap Golf for the golf club sensor. It contains a ROMless MCU, an EPROM and | |
| 247 | An additional control PCB is used for Mocap Golf for the golf club sensor. It contains a ROMless MCU, an EPROM and | |
| 248 | 248 | some other components. It will be documented at a later date. |
| 249 | 249 | |
| 250 | 250 | */ |
| r242631 | r242632 | |
|---|---|---|
| 64 | 64 | |
| 65 | 65 | required_device<cpu_device> m_maincpu; |
| 66 | 66 | required_device<gfxdecode_device> m_gfxdecode; |
| 67 | ||
| 67 | ||
| 68 | 68 | required_shared_ptr<UINT8> m_videoram; |
| 69 | ||
| 69 | ||
| 70 | 70 | tilemap_t *m_bg_tilemap; |
| 71 | ||
| 71 | ||
| 72 | 72 | DECLARE_WRITE8_MEMBER(wallc_videoram_w); |
| 73 | 73 | DECLARE_WRITE8_MEMBER(wallc_coin_counter_w); |
| 74 | 74 | DECLARE_DRIVER_INIT(wallc); |
| r242631 | r242632 | |
|---|---|---|
| 634 | 634 | MCFG_CPU_ADD("maincpu", M68000, XTAL_16MHz) |
| 635 | 635 | MCFG_CPU_PROGRAM_MAP(main_map) |
| 636 | 636 | MCFG_CPU_VBLANK_INT_DRIVER("screen", yunsun16_state, irq2_line_hold) |
| 637 | ||
| 637 | ||
| 638 | 638 | MCFG_MACHINE_START_OVERRIDE(yunsun16_state, shocking) |
| 639 | 639 | MCFG_MACHINE_RESET_OVERRIDE(yunsun16_state, shocking) |
| 640 | 640 | |
| r242631 | r242632 | |
| 876 | 876 | |
| 877 | 877 | ROM_REGION( 0x080000, "oki", 0 ) /* Samples */ |
| 878 | 878 | ROM_LOAD( "u131.bin", 0x000000, 0x080000, CRC(bcf7aa12) SHA1(f7bf5258396ed0eb7e85eccf250c6d0a333a4d61) ) |
| 879 | ||
| 879 | ||
| 880 | 880 | ROM_END |
| 881 | 881 | |
| 882 | 882 | /*************************************************************************** |
| r242631 | r242632 | |
| 905 | 905 | |
| 906 | 906 | ROM_REGION( 0x080000, "oki", 0 ) /* Samples */ |
| 907 | 907 | ROM_LOAD( "yunsun16.131", 0x000000, 0x080000, CRC(d0a1bb8c) SHA1(10f33521bd6031ed73ee5c7be1382165925aa8f8) ) |
| 908 | ||
| 908 | ||
| 909 | 909 | ROM_END |
| 910 | 910 | |
| 911 | 911 | ROM_START( shockingk ) |
| r242631 | r242632 | |
| 928 | 928 | |
| 929 | 929 | ROM_REGION( 0x080000, "oki", 0 ) /* Samples */ |
| 930 | 930 | ROM_LOAD( "yunsun16.131", 0x000000, 0x080000, CRC(d0a1bb8c) SHA1(10f33521bd6031ed73ee5c7be1382165925aa8f8) ) |
| 931 | ||
| 931 | ||
| 932 | 932 | ROM_END |
| 933 | 933 | |
| 934 | 934 | |
| r242631 | r242632 | |
| 960 | 960 | |
| 961 | 961 | ROM_REGION( 0x080000, "oki", 0 ) /* Samples */ |
| 962 | 962 | ROM_LOAD( "bk_u131", 0x000000, 0x080000, CRC(22cc5732) SHA1(38aefa4e543ea54e004eee428ee087121eb20905) ) |
| 963 | ||
| 963 | ||
| 964 | 964 | ROM_END |
| 965 | 965 | |
| 966 | 966 | ROM_START( bombkicka ) // marked 'Bomb Kick 98' |
| r242631 | r242632 | |
| 983 | 983 | |
| 984 | 984 | ROM_REGION( 0x080000, "oki", 0 ) /* Samples */ |
| 985 | 985 | ROM_LOAD( "bk_u131", 0x000000, 0x080000, CRC(22cc5732) SHA1(38aefa4e543ea54e004eee428ee087121eb20905) ) |
| 986 | ||
| 986 | ||
| 987 | 987 | ROM_END |
| 988 | 988 | |
| 989 | 989 | /*************************************************************************** |
| r242631 | r242632 | |
|---|---|---|
| 43 | 43 | DECLARE_WRITE8_MEMBER(asteroid_noise_reset_w); |
| 44 | 44 | DECLARE_WRITE8_MEMBER(llander_snd_reset_w); |
| 45 | 45 | DECLARE_WRITE8_MEMBER(llander_sounds_w); |
| 46 | ||
| 46 | ||
| 47 | 47 | DECLARE_CUSTOM_INPUT_MEMBER(clock_r); |
| 48 | ||
| 48 | ||
| 49 | 49 | INTERRUPT_GEN_MEMBER(asteroid_interrupt); |
| 50 | 50 | INTERRUPT_GEN_MEMBER(asterock_interrupt); |
| 51 | 51 | INTERRUPT_GEN_MEMBER(llander_interrupt); |
| 52 | ||
| 52 | ||
| 53 | 53 | DECLARE_DRIVER_INIT(asterock); |
| 54 | 54 | DECLARE_DRIVER_INIT(asteroidb); |
| 55 | 55 |
| r242631 | r242632 | |
|---|---|---|
| 20 | 20 | m_maincpu(*this, "maincpu"), |
| 21 | 21 | m_gfxdecode(*this, "gfxdecode"), |
| 22 | 22 | m_palette(*this, "palette"), |
| 23 | m_spritegen(*this, "spritegen") | |
| 23 | m_spritegen(*this, "spritegen") | |
| 24 | 24 | { } |
| 25 | 25 | |
| 26 | 26 | /* memory pointers */ |
| r242631 | r242632 | |
|---|---|---|
| 52 | 52 | required_device<gfxdecode_device> m_gfxdecode; |
| 53 | 53 | required_device<screen_device> m_screen; |
| 54 | 54 | required_device<palette_device> m_palette; |
| 55 | ||
| 55 | ||
| 56 | 56 | /* memory pointers */ |
| 57 | 57 | required_shared_ptr<UINT8> m_videoram; |
| 58 | 58 | required_shared_ptr<UINT8> m_spriteram; |
| r242631 | r242632 | |
| 74 | 74 | UINT8 m_color_mask; |
| 75 | 75 | tilemap_t *m_dambustr_tilemap2; |
| 76 | 76 | UINT8 *m_dambustr_videoram2; |
| 77 | ||
| 77 | ||
| 78 | 78 | void (galaxold_state::*m_modify_charcode)(UINT16 *code, UINT8 x); /* function to call to do character banking */ |
| 79 | 79 | void (galaxold_state::*m_modify_spritecode)(UINT8 *spriteram, int*, int*, int*, int); /* function to call to do sprite banking */ |
| 80 | 80 | void (galaxold_state::*m_modify_color)(UINT8 *color); /* function to call to do modify how the color codes map to the PROM */ |
| r242631 | r242632 | |
| 147 | 147 | DECLARE_WRITE8_MEMBER(dambustr_bg_split_line_w); |
| 148 | 148 | DECLARE_WRITE8_MEMBER(dambustr_bg_color_w); |
| 149 | 149 | DECLARE_WRITE_LINE_MEMBER(galaxold_7474_9m_2_q_callback); |
| 150 | DECLARE_WRITE_LINE_MEMBER(galaxold_7474_9m_1_callback); | |
| 151 | ||
| 150 | DECLARE_WRITE_LINE_MEMBER(galaxold_7474_9m_1_callback); | |
| 151 | ||
| 152 | 152 | DECLARE_CUSTOM_INPUT_MEMBER(_4in1_fake_port_r); |
| 153 | 153 | DECLARE_CUSTOM_INPUT_MEMBER(vpool_lives_r); |
| 154 | 154 | DECLARE_CUSTOM_INPUT_MEMBER(ckongg_coinage_r); |
| 155 | 155 | DECLARE_CUSTOM_INPUT_MEMBER(dkongjrm_coinage_r); |
| 156 | ||
| 156 | ||
| 157 | 157 | DECLARE_DRIVER_INIT(bullsdrtg); |
| 158 | 158 | DECLARE_DRIVER_INIT(ladybugg); |
| 159 | 159 | DECLARE_DRIVER_INIT(4in1); |
| 160 | 160 | DECLARE_DRIVER_INIT(guttangt); |
| 161 | 161 | DECLARE_DRIVER_INIT(ckonggx); |
| 162 | ||
| 162 | ||
| 163 | 163 | TILE_GET_INFO_MEMBER(drivfrcg_get_tile_info); |
| 164 | 164 | TILE_GET_INFO_MEMBER(racknrol_get_tile_info); |
| 165 | 165 | TILE_GET_INFO_MEMBER(dambustr_get_tile_info2); |
| 166 | 166 | TILE_GET_INFO_MEMBER(get_tile_info); |
| 167 | 167 | TILE_GET_INFO_MEMBER(rockclim_get_tile_info); |
| 168 | 168 | TILE_GET_INFO_MEMBER(harem_get_tile_info); |
| 169 | ||
| 169 | ||
| 170 | 170 | DECLARE_MACHINE_RESET(galaxold); |
| 171 | 171 | DECLARE_MACHINE_RESET(devilfsg); |
| 172 | 172 | DECLARE_MACHINE_RESET(hunchbkg); |
| 173 | ||
| 173 | ||
| 174 | 174 | DECLARE_PALETTE_INIT(galaxold); |
| 175 | 175 | DECLARE_PALETTE_INIT(rockclim); |
| 176 | 176 | DECLARE_PALETTE_INIT(scrambold); |
| r242631 | r242632 | |
| 181 | 181 | DECLARE_PALETTE_INIT(mariner); |
| 182 | 182 | DECLARE_PALETTE_INIT(dambustr); |
| 183 | 183 | DECLARE_PALETTE_INIT(turtles); |
| 184 | ||
| 184 | ||
| 185 | 185 | DECLARE_VIDEO_START(galaxold); |
| 186 | 186 | DECLARE_VIDEO_START(drivfrcg); |
| 187 | 187 | DECLARE_VIDEO_START(racknrol); |
| r242631 | r242632 | |
| 206 | 206 | DECLARE_VIDEO_START(dambustr); |
| 207 | 207 | DECLARE_VIDEO_START(harem); |
| 208 | 208 | DECLARE_VIDEO_START(bagmanmc); |
| 209 | ||
| 209 | ||
| 210 | 210 | UINT32 screen_update_galaxold(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 211 | 211 | UINT32 screen_update_dambustr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 212 | ||
| 212 | ||
| 213 | 213 | INTERRUPT_GEN_MEMBER(hunchbks_vh_interrupt); |
| 214 | 214 | TIMER_CALLBACK_MEMBER(stars_blink_callback); |
| 215 | 215 | TIMER_CALLBACK_MEMBER(stars_scroll_callback); |
| 216 | 216 | TIMER_DEVICE_CALLBACK_MEMBER(galaxold_interrupt_timer); |
| 217 | 217 | IRQ_CALLBACK_MEMBER(hunchbkg_irq_callback); |
| 218 | ||
| 218 | ||
| 219 | 219 | void state_save_register(); |
| 220 | 220 | void video_start_common(); |
| 221 | 221 | void pisces_modify_spritecode(UINT8 *spriteram, int *code, int *flipx, int *flipy, int offs); |
| r242631 | r242632 | |
|---|---|---|
| 84 | 84 | DECLARE_WRITE8_MEMBER(adpcm_addr_w); |
| 85 | 85 | DECLARE_WRITE8_MEMBER(adpcm_stop_w); |
| 86 | 86 | DECLARE_WRITE_LINE_MEMBER(adpcm_int); |
| 87 | ||
| 87 | ||
| 88 | 88 | DECLARE_DRIVER_INIT(kuniokun); |
| 89 | 89 | DECLARE_DRIVER_INIT(kuniokunb); |
| 90 | 90 | DECLARE_DRIVER_INIT(renegade); |
| r242631 | r242632 | |
|---|---|---|
| 27 | 27 | required_device<gfxdecode_device> m_gfxdecode; |
| 28 | 28 | required_device<screen_device> m_screen; |
| 29 | 29 | required_device<palette_device> m_palette; |
| 30 | ||
| 30 | ||
| 31 | 31 | /* memory pointers */ |
| 32 | 32 | required_shared_ptr<UINT16> m_vram_0; |
| 33 | 33 | required_shared_ptr<UINT16> m_vram_1; |
| r242631 | r242632 | |
|---|---|---|
| 19 | 19 | required_device<gfxdecode_device> m_gfxdecode; |
| 20 | 20 | required_device<screen_device> m_screen; |
| 21 | 21 | required_device<palette_device> m_palette; |
| 22 | ||
| 22 | ||
| 23 | 23 | /* memory pointers */ |
| 24 | 24 | required_shared_ptr<UINT8> m_videoram; |
| 25 | 25 | required_shared_ptr<UINT8> m_s2636_0_ram; |
| r242631 | r242632 | |
| 29 | 29 | int m_CollisionBackground; |
| 30 | 30 | int m_CollisionSprite; |
| 31 | 31 | tilemap_t *m_bg_tilemap; |
| 32 | ||
| 32 | ||
| 33 | 33 | DECLARE_WRITE8_MEMBER(tinvader_sound_w); |
| 34 | 34 | DECLARE_WRITE8_MEMBER(tinvader_videoram_w); |
| 35 | 35 | DECLARE_READ8_MEMBER(zac_s2636_r); |
| r242631 | r242632 | |
|---|---|---|
| 20 | 20 | m_spriteram(*this, "spriteram"), |
| 21 | 21 | m_spriteram2(*this, "spriteram2"), |
| 22 | 22 | m_dsw_port(*this, "DSW") { } |
| 23 | ||
| 24 | ||
| 25 | ||
| 23 | ||
| 24 | ||
| 25 | ||
| 26 | 26 | /* devices */ |
| 27 | 27 | required_device<cpu_device> m_maincpu; |
| 28 | 28 | required_device<cpu_device> m_audio2; |
| r242631 | r242632 | |
| 32 | 32 | required_device<tms5220_device> m_tms; |
| 33 | 33 | required_device<gfxdecode_device> m_gfxdecode; |
| 34 | 34 | required_device<palette_device> m_palette; |
| 35 | ||
| 35 | ||
| 36 | 36 | /* memory pointers */ |
| 37 | 37 | required_shared_ptr<UINT8> m_videoram; |
| 38 | 38 | required_shared_ptr<UINT8> m_attributesram; |
| 39 | 39 | required_shared_ptr<UINT8> m_spriteram; |
| 40 | 40 | required_shared_ptr<UINT8> m_spriteram2; |
| 41 | ||
| 41 | ||
| 42 | 42 | required_ioport_array<3> m_dsw_port; |
| 43 | 43 | |
| 44 | 44 | int m_dsw_sel; |
| r242631 | r242632 | |
| 49 | 49 | int m_toggle; |
| 50 | 50 | tilemap_t *m_bg_tilemap; |
| 51 | 51 | UINT8 m_nmi_mask; |
| 52 | ||
| 52 | ||
| 53 | 53 | DECLARE_READ8_MEMBER(dsw_r); |
| 54 | 54 | DECLARE_WRITE8_MEMBER(sound_command_w); |
| 55 | 55 | DECLARE_WRITE8_MEMBER(sound1_command_w); |
| r242631 | r242632 | |
|---|---|---|
| 1199 | 1199 | { |
| 1200 | 1200 | if (!m_slapstic_device) |
| 1201 | 1201 | fatalerror("Slapstic device is missing?\n"); |
| 1202 | ||
| 1202 | ||
| 1203 | 1203 | slapstic_update_bank(m_slapstic_device->slapstic_bank()); |
| 1204 | 1204 | } |
| 1205 | 1205 | } |
| r242631 | r242632 | |
|---|---|---|
| 4642 | 4642 | wrestwar // (c) 1989 (8751) |
| 4643 | 4643 | wrestwar2 // (c) 1989 (FD1094, decrypted) |
| 4644 | 4644 | wrestwar1 // (c) 1989 (FD1094, decrypted) |
| 4645 | fantzoneta | |
| 4645 | fantzoneta // (c) 2008 Sega / M2 (bootleg conversion) | |
| 4646 | 4646 | |
| 4647 | 4647 | // System 16C |
| 4648 | 4648 | fantzn2x // (c) 2008 Sega / M2 |
| r242631 | r242632 | |
| 6861 | 6861 | sprint4a // 008716 1977/12 [6502] |
| 6862 | 6862 | nitedrvr // 006321 1976/10 [6502] |
| 6863 | 6863 | dominos // 007305 1977/01 [6502] |
| 6864 | dominos4 // 007754-007765 | |
| 6864 | dominos4 // 007754-007765 ??????? [6502] | |
| 6865 | 6865 | triplhnt // 008422-008791 1977/04 [6800] |
| 6866 | 6866 | sprint8 // ?????? 1977/05 [6800] |
| 6867 | 6867 | sprint8a // ?????? 1977/05 [6800] |
| r242631 | r242632 | |
| 6891 | 6891 | sbrkoutct // 034555-034559 proto ???? [6502] |
| 6892 | 6892 | atarifb // 033xxx 1978/10 [6502] |
| 6893 | 6893 | atarifb1 // 033xxx 1978/10 [6502] |
| 6894 | atarifb2 | |
| 6894 | atarifb2 // 035330-035350 ??? [6502] | |
| 6895 | 6895 | orbit // 033689-033702 1978/11 [6800] |
| 6896 | 6896 | boxer // ?????? prototype 1978 [6502] |
| 6897 | 6897 | wolfpack // ?????? prototype [6502] |
| r242631 | r242632 | |
| 9245 | 9245 | wiseguy // (c) 1990 Dooyong |
| 9246 | 9246 | lastday // (c) 1990 Dooyong |
| 9247 | 9247 | lastdaya // (c) 1990 Dooyong |
| 9248 | ddaydoo | |
| 9248 | ddaydoo // (c) 1990 Dooyong | |
| 9249 | 9249 | gulfstrm // (c) 1991 Dooyong |
| 9250 | 9250 | gulfstrma // (c) 1991 Dooyong |
| 9251 | 9251 | gulfstrmb // (c) 1991 Dooyong |
| r242631 | r242632 | |
| 10374 | 10374 | rundeep // (c) 1988 Cream (bootleg?) |
| 10375 | 10375 | wallc // (c) 1984 Midcoin |
| 10376 | 10376 | wallca // (c) 1984 Midcoin |
| 10377 | brkblast | |
| 10377 | brkblast // bootleg (Fadesa) | |
| 10378 | 10378 | sidampkr // |
| 10379 | 10379 | wink // (c) 1985 Midcoin |
| 10380 | 10380 | winka // (c) 1985 Midcoin |
| r242631 | r242632 | |
|---|---|---|
| 546 | 546 | } |
| 547 | 547 | } |
| 548 | 548 | if ((d->OutputWriteMask != 0) && (d->MultiplexerControl == 0)) { |
| 549 | //o[1] = 1; | |
| 549 | //o[1] = 1; | |
| 550 | 550 | if (d->OutputSelect) { // assign to output |
| 551 | 551 | int wm = d->OutputWriteMask; |
| 552 | 552 | for (p1 = 0; p1 < 4; p1++) { |
| r242631 | r242632 | |
| 737 | 737 | t_out[2] = par_in[p1_A + 2] * par_in[p2_B + 2]; |
| 738 | 738 | t_out[3] = par_in[p1_A + 3] * par_in[p2_B + 3]; |
| 739 | 739 | break; |
| 740 | case 3: // "ADD" | |
| 740 | case 3: // "ADD" | |
| 741 | 741 | t_out[0] = par_in[p1_A + 0] + par_in[p3_C + 0]; |
| 742 | 742 | t_out[1] = par_in[p1_A + 1] + par_in[p3_C + 1]; |
| 743 | 743 | t_out[2] = par_in[p1_A + 2] + par_in[p3_C + 2]; |
| 744 | 744 | t_out[3] = par_in[p1_A + 3] + par_in[p3_C + 3]; |
| 745 | 745 | break; |
| 746 | case 4: // "MAD" | |
| 746 | case 4: // "MAD" | |
| 747 | 747 | t_out[0] = par_in[p1_A + 0] * par_in[p2_B + 0] + par_in[p3_C + 0]; |
| 748 | 748 | t_out[1] = par_in[p1_A + 1] * par_in[p2_B + 1] + par_in[p3_C + 1]; |
| 749 | 749 | t_out[2] = par_in[p1_A + 2] * par_in[p2_B + 2] + par_in[p3_C + 2]; |
| 750 | 750 | t_out[3] = par_in[p1_A + 3] * par_in[p2_B + 3] + par_in[p3_C + 3]; |
| 751 | 751 | break; |
| 752 | case 5: // "DP3" | |
| 752 | case 5: // "DP3" | |
| 753 | 753 | t_out[0] = par_in[p1_A + 0] * par_in[p2_B + 0] + par_in[p1_A + 1] * par_in[p2_B + 1] + par_in[p1_A + 2] * par_in[p2_B + 2]; |
| 754 | 754 | t_out[1] = t_out[2] = t_out[3] = t_out[0]; |
| 755 | 755 | break; |
| 756 | case 6: // "DPH" | |
| 756 | case 6: // "DPH" | |
| 757 | 757 | t_out[0] = par_in[p1_A + 0] * par_in[p2_B + 0] + par_in[p1_A + 1] * par_in[p2_B + 1] + par_in[p1_A + 2] * par_in[p2_B + 2] + par_in[p2_B + 3]; |
| 758 | 758 | t_out[1] = t_out[2] = t_out[3] = t_out[0]; |
| 759 | 759 | break; |
| 760 | case 7: // "DP4" | |
| 760 | case 7: // "DP4" | |
| 761 | 761 | t_out[0] = par_in[p1_A + 0] * par_in[p2_B + 0] + par_in[p1_A + 1] * par_in[p2_B + 1] + par_in[p1_A + 2] * par_in[p2_B + 2] + par_in[p1_A + 3] * par_in[p2_B + 3]; |
| 762 | 762 | t_out[1] = t_out[2] = t_out[3] = t_out[0]; |
| 763 | 763 | break; |
| 764 | case 8: // "DST" | |
| 764 | case 8: // "DST" | |
| 765 | 765 | t_out[0] = 1.0; |
| 766 | 766 | t_out[1] = par_in[p1_A + 1] * par_in[p2_B + 1]; |
| 767 | 767 | t_out[2] = par_in[p1_A + 2]; |
| 768 | 768 | t_out[3] = par_in[p2_B + 3]; |
| 769 | 769 | break; |
| 770 | case 9: // "MIN" | |
| 770 | case 9: // "MIN" | |
| 771 | 771 | t_out[0] = fmin(par_in[p1_A + 0], par_in[p2_B + 0]); |
| 772 | 772 | t_out[1] = fmin(par_in[p1_A + 1], par_in[p2_B + 1]); |
| 773 | 773 | t_out[2] = fmin(par_in[p1_A + 2], par_in[p2_B + 2]); |
| 774 | 774 | t_out[3] = fmin(par_in[p1_A + 3], par_in[p2_B + 3]); |
| 775 | 775 | break; |
| 776 | case 10: // "MAX" | |
| 776 | case 10: // "MAX" | |
| 777 | 777 | t_out[0] = fmax(par_in[p1_A + 0], par_in[p2_B + 0]); |
| 778 | 778 | t_out[1] = fmax(par_in[p1_A + 1], par_in[p2_B + 1]); |
| 779 | 779 | t_out[2] = fmax(par_in[p1_A + 2], par_in[p2_B + 2]); |
| 780 | 780 | t_out[3] = fmax(par_in[p1_A + 3], par_in[p2_B + 3]); |
| 781 | 781 | break; |
| 782 | case 11: // "SLT" | |
| 782 | case 11: // "SLT" | |
| 783 | 783 | t_out[0] = (par_in[p1_A + 0] < par_in[p2_B + 0]) ? 1.0 : 0; |
| 784 | 784 | t_out[1] = (par_in[p1_A + 1] < par_in[p2_B + 1]) ? 1.0 : 0; |
| 785 | 785 | t_out[2] = (par_in[p1_A + 2] < par_in[p2_B + 2]) ? 1.0 : 0; |
| 786 | 786 | t_out[3] = (par_in[p1_A + 3] < par_in[p2_B + 3]) ? 1.0 : 0; |
| 787 | 787 | break; |
| 788 | case 12: // "SGE" | |
| 788 | case 12: // "SGE" | |
| 789 | 789 | t_out[0] = (par_in[p1_A + 0] >= par_in[p2_B + 0]) ? 1.0 : 0; |
| 790 | 790 | t_out[1] = (par_in[p1_A + 1] >= par_in[p2_B + 1]) ? 1.0 : 0; |
| 791 | 791 | t_out[2] = (par_in[p1_A + 2] >= par_in[p2_B + 2]) ? 1.0 : 0; |
| r242631 | r242632 | |
| 817 | 817 | t_out[2] = par_in[p3_C + 2]; |
| 818 | 818 | t_out[3] = par_in[p3_C + 3]; |
| 819 | 819 | break; |
| 820 | case 2: | |
| 820 | case 2: // "RCP" | |
| 821 | 821 | t_out[0] = t_out[1] = t_out[2] = t_out[3] = 1.0 / par_in[p3_C + 0]; |
| 822 | 822 | break; |
| 823 | case 3: | |
| 823 | case 3: // "RCC" | |
| 824 | 824 | t_out[0] = t_out[1] = t_out[2] = t_out[3] = 1.0 / par_in[p3_C + 0]; // ? |
| 825 | 825 | break; |
| 826 | case 4: // "RSQ" | |
| 826 | case 4: // "RSQ" | |
| 827 | 827 | t_out[0] = t_out[1] = t_out[2] = t_out[3] = 1.0 / sqrt(abs(par_in[p3_C + 0])); |
| 828 | 828 | break; |
| 829 | case 5: // "EXP" | |
| 829 | case 5: // "EXP" | |
| 830 | 830 | t_out[0] = pow(2, floor(par_in[p3_C + 0])); |
| 831 | 831 | t_out[1] = par_in[p3_C + 0] - floor(par_in[p3_C + 0]); |
| 832 | 832 | t.f = pow(2, par_in[p3_C + 0]); |
| r242631 | r242632 | |
| 834 | 834 | t_out[2] = t.f; |
| 835 | 835 | t_out[3] = 1.0; |
| 836 | 836 | break; |
| 837 | case 6: // "LOG" | |
| 837 | case 6: // "LOG" | |
| 838 | 838 | t_out[1] = frexp(par_in[p3_C + 0], &e)*2.0; // frexp gives mantissa as 0.5....1 |
| 839 | 839 | t_out[0] = e - 1; |
| 840 | 840 | t.f = log2(abs(par_in[p3_C + 0])); |
| r242631 | r242632 | |
| 958 | 958 | { |
| 959 | 959 | int xx1,yy1,xx2,yy2; |
| 960 | 960 | |
| 961 | xx1=x1; | |
| 962 | xx2=x2; | |
| 963 | yy1=y1; | |
| 964 | yy2=y2; | |
| 965 | if (xx1 == xx2) { | |
| 966 | if (yy1 > yy2) { | |
| 967 | int t=yy1; | |
| 968 | yy1=yy2; | |
| 969 | yy2=t; | |
| 970 | } | |
| 971 | for (int y=yy1;y <= yy2;y++) | |
| 972 | *((UINT32 *)bmp.raw_pixptr(y,xx1))= -1; | |
| 973 | } else if (yy1 == yy2) { | |
| 974 | if (xx1 > xx2) { | |
| 975 | int t=xx1; | |
| 976 | xx1=xx2; | |
| 977 | xx2=t; | |
| 978 | } | |
| 979 | for (int x=xx1;x <= xx2;x++) | |
| 980 | *((UINT32 *)bmp.raw_pixptr(yy1,x))= -1; | |
| 981 | } | |
| 961 | xx1=x1; | |
| 962 | xx2=x2; | |
| 963 | yy1=y1; | |
| 964 | yy2=y2; | |
| 965 | if (xx1 == xx2) { | |
| 966 | if (yy1 > yy2) { | |
| 967 | int t=yy1; | |
| 968 | yy1=yy2; | |
| 969 | yy2=t; | |
| 970 | } | |
| 971 | for (int y=yy1;y <= yy2;y++) | |
| 972 | *((UINT32 *)bmp.raw_pixptr(y,xx1))= -1; | |
| 973 | } else if (yy1 == yy2) { | |
| 974 | if (xx1 > xx2) { | |
| 975 | int t=xx1; | |
| 976 | xx1=xx2; | |
| 977 | xx2=t; | |
| 978 | } | |
| 979 | for (int x=xx1;x <= xx2;x++) | |
| 980 | *((UINT32 *)bmp.raw_pixptr(yy1,x))= -1; | |
| 981 | } | |
| 982 | 982 | }*/ |
| 983 | 983 | |
| 984 | 984 | inline UINT32 convert_a4r4g4b4_a8r8g8b8(UINT32 a4r4g4b4) |
| r242631 | r242632 | |
|---|---|---|
| 115 | 115 | void galpani2_state::copybg15(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) |
| 116 | 116 | { |
| 117 | 117 | UINT16* ram = m_bg15 + 0x40000/2; |
| 118 | ||
| 118 | ||
| 119 | 119 | //int x = 0; |
| 120 | 120 | //int y = 0; |
| 121 | 121 |
| r242631 | r242632 | |
|---|---|---|
| 1126 | 1126 | info->tilemaps[pagenum]->set_scrolldx(0, 22); |
| 1127 | 1127 | info->tilemaps[pagenum]->set_scrolldy(0, 38); |
| 1128 | 1128 | } |
| 1129 | ||
| 1129 | ||
| 1130 | 1130 | save_item(NAME(info->flip), which); |
| 1131 | 1131 | save_item(NAME(info->rowscroll), which); |
| 1132 | 1132 | save_item(NAME(info->colscroll), which); |
| r242631 | r242632 | |
|---|---|---|
| 122 | 122 | m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 2); |
| 123 | 123 | return 0; |
| 124 | 124 | } |
| 125 |
| r242631 | r242632 | |
|---|---|---|
| 1 | 1 | /* |
| 2 | 2 | |
| 3 | ||
| 3 | very simple sprite scheme, used by some Capcom games and hardware cloned from them | |
| 4 | 4 | |
| 5 | bionicc.c | |
| 6 | tigeroad.c | |
| 7 | supduck.c | |
| 5 | bionicc.c | |
| 6 | tigeroad.c | |
| 7 | supduck.c | |
| 8 | 8 | |
| 9 | it is unknown if this is handled by a custom chip, or simple logic. | |
| 10 | y positions are inverted in Bionic Commando, but it seems otherwise the same as | |
| 11 | Tiger Road | |
| 9 | it is unknown if this is handled by a custom chip, or simple logic. | |
| 10 | y positions are inverted in Bionic Commando, but it seems otherwise the same as | |
| 11 | Tiger Road | |
| 12 | 12 | |
| 13 | 13 | */ |
| 14 | 14 | |
| r242631 | r242632 | |
| 39 | 39 | 4 words per sprite |
| 40 | 40 | |
| 41 | 41 | 0 ---- ---t tttt tttt = tile number |
| 42 | ||
| 42 | ||
| 43 | 43 | 1 ---- ---- --cc cc-- = colour |
| 44 | 44 | 1 ---- ---- ---- --x- = flip x |
| 45 | 45 | 1 ---- ---- ---- ---y = flip y |
| r242631 | r242632 | |
|---|---|---|
| 125 | 125 | |
| 126 | 126 | m_gfxdecode->gfx(1)->set_source(m_s2636_0_ram); |
| 127 | 127 | m_gfxdecode->gfx(2)->set_source(m_s2636_0_ram); |
| 128 | ||
| 128 | ||
| 129 | 129 | save_item(NAME(m_bitmap)); |
| 130 | 130 | save_item(NAME(m_spritebitmap)); |
| 131 | 131 | save_item(NAME(m_CollisionBackground)); |
| r242631 | r242632 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | Coleco Amaze-A-Tron |
| 6 | 6 | * TMS1100 MCU, labeled MP3405(die label too) |
| 7 | ||
| 7 | ||
| 8 | 8 | This is an electronic board game with a selection of 8 maze games, |
| 9 | 9 | most of them for 2 players. A 5x5 playing grid and four markers are |
| 10 | 10 | required to play. Refer to the official manual for more information. |
| r242631 | r242632 | |
| 42 | 42 | DECLARE_READ8_MEMBER(read_k); |
| 43 | 43 | DECLARE_WRITE16_MEMBER(write_o); |
| 44 | 44 | DECLARE_WRITE16_MEMBER(write_r); |
| 45 | ||
| 45 | ||
| 46 | 46 | void leds_update(); |
| 47 | ||
| 47 | ||
| 48 | 48 | virtual void machine_start(); |
| 49 | 49 | }; |
| 50 | 50 | |
| r242631 | r242632 | |
| 85 | 85 | // R6,R7: lamps |
| 86 | 86 | output_set_lamp_value(0, data >> 6 & 1); |
| 87 | 87 | output_set_lamp_value(1, data >> 7 & 1); |
| 88 | ||
| 88 | ||
| 89 | 89 | // R8,R9: select digit |
| 90 | 90 | m_r = data; |
| 91 | 91 | leds_update(); |
| 92 | ||
| 92 | ||
| 93 | 93 | // R10: speaker out |
| 94 | 94 | m_speaker->level_w(data >> 10 & 1); |
| 95 | 95 | } |
| r242631 | r242632 | |
| 166 | 166 | { |
| 167 | 167 | m_r = 0; |
| 168 | 168 | m_o = 0; |
| 169 | ||
| 169 | ||
| 170 | 170 | save_item(NAME(m_r)); |
| 171 | 171 | save_item(NAME(m_o)); |
| 172 | 172 | } |
| r242631 | r242632 | |
|---|---|---|
| 165 | 165 | static ADDRESS_MAP_START(bitgrapha_mem, AS_PROGRAM, 16, bitgraph_state) |
| 166 | 166 | ADDRESS_MAP_UNMAP_HIGH |
| 167 | 167 | AM_RANGE(0x000000, 0x007fff) AM_ROM |
| 168 | AM_RANGE(0x010000, 0x010001) AM_DEVREADWRITE8(ACIA0_TAG, acia6850_device, data_r, data_w, 0xff00) | |
| 168 | AM_RANGE(0x010000, 0x010001) AM_DEVREADWRITE8(ACIA0_TAG, acia6850_device, data_r, data_w, 0xff00) // HOST | |
| 169 | 169 | AM_RANGE(0x010002, 0x010003) AM_DEVREADWRITE8(ACIA0_TAG, acia6850_device, status_r, control_w, 0xff00) |
| 170 | AM_RANGE(0x010008, 0x010009) AM_DEVREADWRITE8(ACIA1_TAG, acia6850_device, data_r, data_w, 0x00ff) | |
| 170 | AM_RANGE(0x010008, 0x010009) AM_DEVREADWRITE8(ACIA1_TAG, acia6850_device, data_r, data_w, 0x00ff) // KEYBOARD | |
| 171 | 171 | AM_RANGE(0x01000a, 0x01000b) AM_DEVREADWRITE8(ACIA1_TAG, acia6850_device, status_r, control_w, 0x00ff) |
| 172 | AM_RANGE(0x010010, 0x010011) AM_DEVREADWRITE8(ACIA2_TAG, acia6850_device, data_r, data_w, 0x00ff) | |
| 172 | AM_RANGE(0x010010, 0x010011) AM_DEVREADWRITE8(ACIA2_TAG, acia6850_device, data_r, data_w, 0x00ff) // DEBUGGER | |
| 173 | 173 | AM_RANGE(0x010012, 0x010013) AM_DEVREADWRITE8(ACIA2_TAG, acia6850_device, status_r, control_w, 0x00ff) |
| 174 | AM_RANGE(0x010018, 0x010019) AM_DEVREADWRITE8(ACIA3_TAG, acia6850_device, data_r, data_w, 0x00ff) | |
| 174 | AM_RANGE(0x010018, 0x010019) AM_DEVREADWRITE8(ACIA3_TAG, acia6850_device, data_r, data_w, 0x00ff) // POINTER | |
| 175 | 175 | AM_RANGE(0x01001a, 0x01001b) AM_DEVREADWRITE8(ACIA3_TAG, acia6850_device, status_r, control_w, 0x00ff) |
| 176 | 176 | AM_RANGE(0x010020, 0x010027) AM_READWRITE8(adlc_r, adlc_w, 0xff00) |
| 177 | AM_RANGE(0x010028, 0x01002f) AM_READWRITE8(pia_r, pia_w, 0xff00) | |
| 177 | AM_RANGE(0x010028, 0x01002f) AM_READWRITE8(pia_r, pia_w, 0xff00) // EAROM, PSG | |
| 178 | 178 | AM_RANGE(0x010030, 0x010031) AM_WRITE(baud_write) |
| 179 | 179 | AM_RANGE(0x3e0000, 0x3fffff) AM_RAM |
| 180 | 180 | ADDRESS_MAP_END |
| r242631 | r242632 | |
| 182 | 182 | static ADDRESS_MAP_START(bitgraphb_mem, AS_PROGRAM, 16, bitgraph_state) |
| 183 | 183 | ADDRESS_MAP_UNMAP_HIGH |
| 184 | 184 | AM_RANGE(0x000000, 0x007fff) AM_ROM |
| 185 | AM_RANGE(0x010000, 0x010001) AM_DEVREADWRITE8(ACIA0_TAG, acia6850_device, data_r, data_w, 0xff00) | |
| 185 | AM_RANGE(0x010000, 0x010001) AM_DEVREADWRITE8(ACIA0_TAG, acia6850_device, data_r, data_w, 0xff00) // HOST | |
| 186 | 186 | AM_RANGE(0x010002, 0x010003) AM_DEVREADWRITE8(ACIA0_TAG, acia6850_device, status_r, control_w, 0xff00) |
| 187 | AM_RANGE(0x010008, 0x010009) AM_DEVREADWRITE8(ACIA1_TAG, acia6850_device, data_r, data_w, 0x00ff) | |
| 187 | AM_RANGE(0x010008, 0x010009) AM_DEVREADWRITE8(ACIA1_TAG, acia6850_device, data_r, data_w, 0x00ff) // KEYBOARD | |
| 188 | 188 | AM_RANGE(0x01000a, 0x01000b) AM_DEVREADWRITE8(ACIA1_TAG, acia6850_device, status_r, control_w, 0x00ff) |
| 189 | AM_RANGE(0x010010, 0x010011) AM_DEVREADWRITE8(ACIA2_TAG, acia6850_device, data_r, data_w, 0x00ff) | |
| 189 | AM_RANGE(0x010010, 0x010011) AM_DEVREADWRITE8(ACIA2_TAG, acia6850_device, data_r, data_w, 0x00ff) // DEBUGGER | |
| 190 | 190 | AM_RANGE(0x010012, 0x010013) AM_DEVREADWRITE8(ACIA2_TAG, acia6850_device, status_r, control_w, 0x00ff) |
| 191 | 191 | AM_RANGE(0x01001a, 0x01001b) AM_WRITE8(misccr_write, 0x00ff) |
| 192 | 192 | AM_RANGE(0x010020, 0x010027) AM_READWRITE8(adlc_r, adlc_w, 0xff00) |
| 193 | AM_RANGE(0x010028, 0x01002f) AM_READWRITE8(pia_r, pia_w, 0xff00) | |
| 193 | AM_RANGE(0x010028, 0x01002f) AM_READWRITE8(pia_r, pia_w, 0xff00) // EAROM, PSG | |
| 194 | 194 | AM_RANGE(0x010030, 0x010031) AM_WRITE(baud_write) |
| 195 | // AM_RANGE(0x010030, 0x010037) AM_READ8(ppu_read, 0x00ff) | |
| 196 | // AM_RANGE(0x010038, 0x01003f) AM_WRITE8(ppu_write, 0x00ff) | |
| 195 | // AM_RANGE(0x010030, 0x010037) AM_READ8(ppu_read, 0x00ff) | |
| 196 | // AM_RANGE(0x010038, 0x01003f) AM_WRITE8(ppu_write, 0x00ff) | |
| 197 | 197 | AM_RANGE(0x380000, 0x3fffff) AM_RAM |
| 198 | 198 | ADDRESS_MAP_END |
| 199 | 199 | |
| r242631 | r242632 | |
| 257 | 257 | m_pia_b = data; |
| 258 | 258 | |
| 259 | 259 | switch (m_pia_b & 0x03) { |
| 260 | case 2: m_psg->data_w(space, 0, m_pia_a); break; | |
| 261 | case 3: m_psg->address_w(space, 0, m_pia_a); break; | |
| 260 | case 2: m_psg->data_w(space, 0, m_pia_a); break; | |
| 261 | case 3: m_psg->address_w(space, 0, m_pia_a); break; | |
| 262 | 262 | } |
| 263 | 263 | |
| 264 | 264 | if (BIT(m_pia_b, 3)) { |
| r242631 | r242632 | |
| 302 | 302 | WRITE16_MEMBER(bitgraph_state::baud_write) |
| 303 | 303 | { |
| 304 | 304 | DBG_LOG(1,"Baud", ("%04X\n", data)); |
| 305 | m_dbrgb->str_w(data & 15); // 2 DBG | |
| 306 | m_dbrga->stt_w((data >> 4) & 15); // 1 KBD | |
| 307 | m_dbrgb->stt_w((data >> 8) & 15); // 3 PNT | |
| 308 | m_dbrga->str_w((data >> 12) & 15); // 0 HOST | |
| 305 | m_dbrgb->str_w(data & 15); // 2 DBG | |
| 306 | m_dbrga->stt_w((data >> 4) & 15); // 1 KBD | |
| 307 | m_dbrgb->stt_w((data >> 8) & 15); // 3 PNT | |
| 308 | m_dbrga->str_w((data >> 12) & 15); // 0 HOST | |
| 309 | 309 | } |
| 310 | 310 | |
| 311 | 311 | WRITE_LINE_MEMBER(bitgraph_state::com8116_a_fr_w) |
| r242631 | r242632 | |
| 398 | 398 | |
| 399 | 399 | #ifdef UNUSED_FUNCTION |
| 400 | 400 | static ADDRESS_MAP_START(ppu_io, AS_IO, 8, bitgraph_state) |
| 401 | // AM_RANGE(0x00, 0x00) AM_READ(ppu_irq) | |
| 402 | // AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) | |
| 403 | // AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_READ(ppu_t0_r) | |
| 401 | // AM_RANGE(0x00, 0x00) AM_READ(ppu_irq) | |
| 402 | // AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) | |
| 403 | // AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_READ(ppu_t0_r) | |
| 404 | 404 | AM_RANGE(MCS48_PORT_PROG, MCS48_PORT_PROG) AM_DEVWRITE("i8243", i8243_device, i8243_prog_w) |
| 405 | 405 | ADDRESS_MAP_END |
| 406 | 406 | #endif |
| 407 | 407 | |
| 408 | 408 | /* |
| 409 | p4 O: Centronics data 3..0 | |
| 410 | p5 O: Centronics data 7..4 | |
| 411 | p6 O: Centronics control | |
| 412 | p7 I: Centronics status | |
| 409 | p4 O: Centronics data 3..0 | |
| 410 | p5 O: Centronics data 7..4 | |
| 411 | p6 O: Centronics control | |
| 412 | p7 I: Centronics status | |
| 413 | 413 | */ |
| 414 | 414 | WRITE8_MEMBER(bitgraph_state::ppu_i8243_w) |
| 415 | 415 | { |
| r242631 | r242632 | |
| 572 | 572 | MCFG_CPU_PROGRAM_MAP(bitgraphb_mem) |
| 573 | 573 | |
| 574 | 574 | MCFG_FRAGMENT_ADD(bg_motherboard) |
| 575 | // | |
| 575 | // MCFG_FRAGMENT_ADD(bg_ppu) | |
| 576 | 576 | |
| 577 | 577 | MCFG_DEVICE_ADD("system_clock", CLOCK, 1040) |
| 578 | 578 | MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(bitgraph_state, system_clock_write)) |
| r242631 | r242632 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | Parker Brothers Code Name: Sector |
| 6 | 6 | * MP0905BNL ZA0379 (die labeled 0970F-05B) |
| 7 | ||
| 7 | ||
| 8 | 8 | This is a tabletop submarine pursuit game. A grid board and small toy |
| 9 | 9 | boats are used to remember your locations (a Paint app should be ok too). |
| 10 | 10 | Refer to the official manual for more information, it is not a simple game. |
| r242631 | r242632 | |
| 69 | 69 | void cnsector_state::leds_update() |
| 70 | 70 | { |
| 71 | 71 | UINT16 active_state[0x10]; |
| 72 | ||
| 72 | ||
| 73 | 73 | for (int i = 0; i < 0x10; i++) |
| 74 | 74 | { |
| 75 | 75 | active_state[i] = 0; |
| 76 | ||
| 76 | ||
| 77 | 77 | for (int j = 0; j < 0x10; j++) |
| 78 | 78 | { |
| 79 | 79 | int di = j << 4 | i; |
| 80 | ||
| 80 | ||
| 81 | 81 | // turn on powered leds |
| 82 | 82 | if (m_leds_state[i] >> j & 1) |
| 83 | 83 | m_leds_decay[di] = LEDS_DECAY_TIME; |
| 84 | ||
| 84 | ||
| 85 | 85 | // determine active state |
| 86 | 86 | int ds = (m_leds_decay[di] != 0) ? 1 : 0; |
| 87 | 87 | active_state[i] |= (ds << j); |
| 88 | 88 | } |
| 89 | 89 | } |
| 90 | ||
| 90 | ||
| 91 | 91 | // on difference, send to output |
| 92 | 92 | for (int i = 0; i < 0x10; i++) |
| 93 | 93 | if (m_leds_cache[i] != active_state[i]) |
| 94 | 94 | output_set_digit_value(i, active_state[i]); |
| 95 | ||
| 95 | ||
| 96 | 96 | memcpy(m_leds_cache, active_state, sizeof(m_leds_cache)); |
| 97 | 97 | } |
| 98 | 98 | |
| r242631 | r242632 | |
| 102 | 102 | for (int i = 0; i < 0x100; i++) |
| 103 | 103 | if (!(m_leds_state[i & 0xf] >> (i>>4) & 1) && m_leds_decay[i]) |
| 104 | 104 | m_leds_decay[i]--; |
| 105 | ||
| 105 | ||
| 106 | 106 | leds_update(); |
| 107 | 107 | } |
| 108 | 108 | |
| r242631 | r242632 | |
| 122 | 122 | for (int i = 0; i < 5; i++) |
| 123 | 123 | if (m_o >> i & 1) |
| 124 | 124 | k |= m_button_matrix[i]->read(); |
| 125 | ||
| 125 | ||
| 126 | 126 | return k; |
| 127 | 127 | } |
| 128 | 128 | |
| r242631 | r242632 | |
| 201 | 201 | memset(m_leds_decay, 0, sizeof(m_leds_decay)); |
| 202 | 202 | |
| 203 | 203 | m_o = 0; |
| 204 | ||
| 204 | ||
| 205 | 205 | // register for savestates |
| 206 | 206 | save_item(NAME(m_leds_state)); |
| 207 | 207 | save_item(NAME(m_leds_cache)); |
| r242631 | r242632 | |
| 218 | 218 | MCFG_TMS1XXX_READ_K_CB(READ8(cnsector_state, read_k)) |
| 219 | 219 | MCFG_TMS1XXX_WRITE_O_CB(WRITE16(cnsector_state, write_o)) |
| 220 | 220 | MCFG_TMS1XXX_WRITE_R_CB(WRITE16(cnsector_state, write_r)) |
| 221 | ||
| 221 | ||
| 222 | 222 | MCFG_TIMER_DRIVER_ADD_PERIODIC("leds_decay", cnsector_state, leds_decay_tick, attotime::from_msec(10)) |
| 223 | 223 | |
| 224 | 224 | MCFG_DEFAULT_LAYOUT(layout_cnsector) |
| r242631 | r242632 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | Milton Bradley Comp IV |
| 6 | 6 | * TMC0904NL CP0904A (die labeled 4A0970D-04A) |
| 7 | ||
| 7 | ||
| 8 | 8 | This is small tabletop Mastermind game; a code-breaking game where the player |
| 9 | 9 | needs to find out the correct sequence of colours (numbers in our case). |
| 10 | 10 | It is known as Logic 5 in Europe, and as Pythaligoras in Japan. |
| 11 | ||
| 11 | ||
| 12 | 12 | Press the R key to start, followed by a set of unique numbers and E. |
| 13 | 13 | Refer to the official manual for more information. |
| 14 | 14 | |
| r242631 | r242632 | |
| 74 | 74 | // turn on powered leds |
| 75 | 75 | if (m_leds_state >> i & 1) |
| 76 | 76 | m_leds_decay[i] = LEDS_DECAY_TIME; |
| 77 | ||
| 77 | ||
| 78 | 78 | // send to output |
| 79 | 79 | output_set_lamp_value(i, (m_leds_decay[i] != 0) ? 1 : 0); |
| 80 | 80 | } |
| r242631 | r242632 | |
| 86 | 86 | for (int i = 0; i < 0x10; i++) |
| 87 | 87 | if (!(m_leds_state >> i & 1) && m_leds_decay[i]) |
| 88 | 88 | m_leds_decay[i]--; |
| 89 | ||
| 89 | ||
| 90 | 90 | leds_update(); |
| 91 | 91 | } |
| 92 | 92 | |
| r242631 | r242632 | |
| 106 | 106 | for (int i = 0; i < 3; i++) |
| 107 | 107 | if (m_o >> (i+1) & 1) |
| 108 | 108 | k |= m_button_matrix[i]->read(); |
| 109 | ||
| 109 | ||
| 110 | 110 | return k; |
| 111 | 111 | } |
| 112 | 112 | |
| r242631 | r242632 | |
| 173 | 173 | memset(m_leds_decay, 0, sizeof(m_leds_decay)); |
| 174 | 174 | |
| 175 | 175 | m_o = 0; |
| 176 | ||
| 176 | ||
| 177 | 177 | // register for savestates |
| 178 | 178 | save_item(NAME(m_leds_state)); |
| 179 | 179 | save_item(NAME(m_leds_decay)); |
| r242631 | r242632 | |
| 189 | 189 | MCFG_TMS1XXX_READ_K_CB(READ8(comp4_state, read_k)) |
| 190 | 190 | MCFG_TMS1XXX_WRITE_O_CB(WRITE16(comp4_state, write_o)) |
| 191 | 191 | MCFG_TMS1XXX_WRITE_R_CB(WRITE16(comp4_state, write_r)) |
| 192 | ||
| 192 | ||
| 193 | 193 | MCFG_TIMER_DRIVER_ADD_PERIODIC("leds_decay", comp4_state, leds_decay_tick, attotime::from_msec(10)) |
| 194 | 194 | |
| 195 | 195 | MCFG_DEFAULT_LAYOUT(layout_comp4) |
| r242631 | r242632 | |
|---|---|---|
| 202 | 202 | |
| 203 | 203 | static ADDRESS_MAP_START( ec1847_io, AS_IO, 8, ec184x_state ) |
| 204 | 204 | ADDRESS_MAP_UNMAP_HIGH |
| 205 | // | |
| 205 | // AM_RANGE(0x0210, 0x021f) AM_RAM // internal (non-standard?) bus extender | |
| 206 | 206 | ADDRESS_MAP_END |
| 207 | 207 | |
| 208 | 208 |
| r242631 | r242632 | |
|---|---|---|
| 101 | 101 | DECLARE_WRITE8_MEMBER(motor_w); |
| 102 | 102 | DECLARE_MACHINE_RESET(excali64); |
| 103 | 103 | required_device<palette_device> m_palette; |
| 104 | ||
| 104 | ||
| 105 | 105 | private: |
| 106 | 106 | const UINT8 *m_p_chargen; |
| 107 | 107 | UINT8 *m_p_videoram; |
| r242631 | r242632 | |
| 585 | 585 | } |
| 586 | 586 | else |
| 587 | 587 | gfx = m_p_chargen[(chr<<4) | ra]; // normal character |
| 588 | ||
| 588 | ||
| 589 | 589 | gfx ^= (x == cursor_x) ? 0xff : 0; |
| 590 | 590 | |
| 591 | 591 | /* Display a scanline of a character */ |
| r242631 | r242632 | |
|---|---|---|
| 2 | 2 | PeT mess@utanet.at 2007, 2014 |
| 3 | 3 | Peter Wilhelmsen peter.wilhelmsen@gmail.com |
| 4 | 4 | Morten Shearman Kirkegaard morten+gamate@afdelingp.dk |
| 5 | Juan F | |
| 5 | Juan F??lix Mateos vectrex@hackermesh.org | |
| 6 | 6 | ******************************************************************************/ |
| 7 | 7 | |
| 8 | 8 | #include "emu.h" |
| r242631 | r242632 | |
| 18 | 18 | : driver_device(mconfig, type, tag) |
| 19 | 19 | , m_maincpu(*this, "maincpu") |
| 20 | 20 | , m_cart(*this, "cartslot") |
| 21 | // | |
| 21 | // , m_gfxdecode(*this, "gfxdecode") | |
| 22 | 22 | , m_io_joy(*this, "JOY") |
| 23 | 23 | , m_palette(*this, "palette") |
| 24 | 24 | , m_bios(*this, "bios") |
| r242631 | r242632 | |
| 47 | 47 | |
| 48 | 48 | struct |
| 49 | 49 | { |
| 50 | UINT8 reg[8]; | |
| 51 | struct { | |
| 52 | bool write; | |
| 53 | bool page2; // else page1 | |
| 50 | UINT8 reg[8]; | |
| 51 | struct { | |
| 52 | bool write; | |
| 53 | bool page2; // else page1 | |
| 54 | 54 | UINT8 ypos, xpos/*tennis*/; |
| 55 | UINT8 data[2][0x100][0x20]; | |
| 56 | } bitmap; | |
| 57 | UINT8 x, y; | |
| 55 | UINT8 data[2][0x100][0x20]; | |
| 56 | } bitmap; | |
| 57 | UINT8 x, y; | |
| 58 | 58 | bool y_increment; |
| 59 | 59 | } video; |
| 60 | 60 | |
| r242631 | r242632 | |
| 68 | 68 | |
| 69 | 69 | required_device<cpu_device> m_maincpu; |
| 70 | 70 | required_device<generic_slot_device> m_cart; |
| 71 | // | |
| 71 | // required_device<gfxdecode_device> m_gfxdecode; | |
| 72 | 72 | required_ioport m_io_joy; |
| 73 | 73 | required_device<palette_device> m_palette; |
| 74 | 74 | required_shared_ptr<UINT8> m_bios; |
| r242631 | r242632 | |
| 113 | 113 | |
| 114 | 114 | WRITE8_MEMBER( gamate_state::gamate_video_w ) |
| 115 | 115 | { |
| 116 | video.reg[offset]=data; | |
| 117 | switch (offset) { | |
| 118 | case 1: video.bitmap.write=data&0xc0; // more addressing mode | |
| 116 | video.reg[offset]=data; | |
| 117 | switch (offset) { | |
| 118 | case 1: video.bitmap.write=data&0xc0; // more addressing mode | |
| 119 | 119 | video.y_increment=data&0x40; |
| 120 | 120 | break; |
| 121 | 121 | case 2: video.bitmap.xpos=data;break; // at least 7 bits |
| 122 | 122 | case 3: video.bitmap.ypos=data;break; // at least 7 bits |
| 123 | case 4: video.bitmap.page2=data&0x80;video.x=data&0x7f;break; | |
| 124 | case 5: video.y=data;break; | |
| 125 | case 7: | |
| 126 | if (video.bitmap.write) { | |
| 127 | if (video.x<ARRAY_LENGTH(video.bitmap.data[0][0]) /*&& video.y<ARRAY_LENGTH(video.bitmap.data[0])*/) | |
| 128 | video.bitmap.data[video.bitmap.page2][video.y][video.x]=data; | |
| 129 | else | |
| 130 | logerror("%.6f %04x video bitmap x %x invalid\n",machine().time().as_double(), m_maincpu->pc(), video.x); | |
| 131 | } else { | |
| 132 | video.bitmap.data[0][video.y][video.x&(ARRAY_LENGTH(video.bitmap.data[0][0])-1)]=data; | |
| 133 | } | |
| 134 | if (video.y_increment) video.y++; | |
| 123 | case 4: video.bitmap.page2=data&0x80;video.x=data&0x7f;break; | |
| 124 | case 5: video.y=data;break; | |
| 125 | case 7: | |
| 126 | if (video.bitmap.write) { | |
| 127 | if (video.x<ARRAY_LENGTH(video.bitmap.data[0][0]) /*&& video.y<ARRAY_LENGTH(video.bitmap.data[0])*/) | |
| 128 | video.bitmap.data[video.bitmap.page2][video.y][video.x]=data; | |
| 129 | else | |
| 130 | logerror("%.6f %04x video bitmap x %x invalid\n",machine().time().as_double(), m_maincpu->pc(), video.x); | |
| 131 | } else { | |
| 132 | video.bitmap.data[0][video.y][video.x&(ARRAY_LENGTH(video.bitmap.data[0][0])-1)]=data; | |
| 133 | } | |
| 134 | if (video.y_increment) video.y++; | |
| 135 | 135 | else video.x++; |
| 136 | ||
| 136 | } | |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | WRITE8_MEMBER( gamate_state::cart_bankswitchmulti_w ) |
| r242631 | r242632 | |
| 149 | 149 | READ8_MEMBER( gamate_state::gamate_video_r ) |
| 150 | 150 | { |
| 151 | 151 | if (offset!=6) return 0; |
| 152 | UINT8 data=0; | |
| 153 | if (video.bitmap.write) { | |
| 154 | if (video.x<ARRAY_LENGTH(video.bitmap.data[0][0]) /*&& video.y<ARRAY_LENGTH(video.bitmap.data[0])*/) | |
| 155 | data=video.bitmap.data[video.bitmap.page2][video.y][video.x]; | |
| 156 | else | |
| 157 | logerror("%.6f video bitmap x %x invalid\n",machine().time().as_double(),video.x); | |
| 158 | } else { | |
| 159 | data=video.bitmap.data[0][video.y][video.x&(ARRAY_LENGTH(video.bitmap.data[0][0])-1)]; | |
| 160 | } | |
| 161 | if (m_maincpu->pc()<0xf000) | |
| 162 | logerror("%.6f video read %04x %02x\n",machine().time().as_double(),offset, data); | |
| 163 | return data; | |
| 152 | UINT8 data=0; | |
| 153 | if (video.bitmap.write) { | |
| 154 | if (video.x<ARRAY_LENGTH(video.bitmap.data[0][0]) /*&& video.y<ARRAY_LENGTH(video.bitmap.data[0])*/) | |
| 155 | data=video.bitmap.data[video.bitmap.page2][video.y][video.x]; | |
| 156 | else | |
| 157 | logerror("%.6f video bitmap x %x invalid\n",machine().time().as_double(),video.x); | |
| 158 | } else { | |
| 159 | data=video.bitmap.data[0][video.y][video.x&(ARRAY_LENGTH(video.bitmap.data[0][0])-1)]; | |
| 160 | } | |
| 161 | if (m_maincpu->pc()<0xf000) | |
| 162 | logerror("%.6f video read %04x %02x\n",machine().time().as_double(),offset, data); | |
| 163 | return data; | |
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | WRITE8_MEMBER( gamate_state::gamate_audio_w ) |
| 167 | 167 | { |
| 168 | ||
| 168 | logerror("%.6f %04x audio write %04x %02x\n",machine().time().as_double(),m_maincpu->pc(),offset,data); | |
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | READ8_MEMBER( gamate_state::gamate_audio_r ) |
| 172 | 172 | { |
| 173 | ||
| 173 | logerror("%.6f %04x audio read %04x \n",machine().time().as_double(),m_maincpu->pc(),offset); | |
| 174 | 174 | return 0; |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | |
| 178 | 178 | READ8_MEMBER( gamate_state::gamate_pad_r ) |
| 179 | 179 | { |
| 180 | UINT8 data=m_io_joy->read(); | |
| 181 | return data; | |
| 180 | UINT8 data=m_io_joy->read(); | |
| 181 | return data; | |
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | static ADDRESS_MAP_START( gamate_mem, AS_PROGRAM, 8, gamate_state ) |
| 185 | AM_RANGE(0x0000, 0x03ff) AM_RAM | |
| 186 | AM_RANGE(0x4000, 0x400d) AM_READWRITE(gamate_audio_r, gamate_audio_w) | |
| 187 | AM_RANGE(0x4400, 0x4400) AM_READ(gamate_pad_r) | |
| 188 | AM_RANGE(0x5000, 0x5007) AM_READWRITE(gamate_video_r, gamate_video_w) | |
| 189 | AM_RANGE(0x5a00, 0x5a00) AM_READ(protection_r) | |
| 185 | AM_RANGE(0x0000, 0x03ff) AM_RAM | |
| 186 | AM_RANGE(0x4000, 0x400d) AM_READWRITE(gamate_audio_r, gamate_audio_w) | |
| 187 | AM_RANGE(0x4400, 0x4400) AM_READ(gamate_pad_r) | |
| 188 | AM_RANGE(0x5000, 0x5007) AM_READWRITE(gamate_video_r, gamate_video_w) | |
| 189 | AM_RANGE(0x5a00, 0x5a00) AM_READ(protection_r) | |
| 190 | 190 | |
| 191 | AM_RANGE(0x6000, 0x9fff) AM_READ_BANK("bankmulti") | |
| 192 | AM_RANGE(0xa000, 0xdfff) AM_READ_BANK("bank") | |
| 191 | AM_RANGE(0x6000, 0x9fff) AM_READ_BANK("bankmulti") | |
| 192 | AM_RANGE(0xa000, 0xdfff) AM_READ_BANK("bank") | |
| 193 | 193 | |
| 194 | 194 | AM_RANGE(0x6000, 0x6002) AM_READWRITE(gamate_cart_protection_r, gamate_cart_protection_w) |
| 195 | // | |
| 195 | // AM_RANGE(0x6000, 0xdfff) AM_READWRITE(gamate_cart_r, gamate_cart_w) | |
| 196 | 196 | AM_RANGE(0x8000, 0x8000) AM_WRITE(cart_bankswitchmulti_w) |
| 197 | 197 | AM_RANGE(0xc000, 0xc000) AM_WRITE(cart_bankswitch_w) |
| 198 | 198 | |
| 199 | ||
| 199 | AM_RANGE(0xf000, 0xffff) AM_ROM AM_SHARE("bios") | |
| 200 | 200 | ADDRESS_MAP_END |
| 201 | 201 | |
| 202 | 202 | |
| r242631 | r242632 | |
| 215 | 215 | #ifdef UNUSED_CODE |
| 216 | 216 | static const struct gfx_layout gamate_charlayout = |
| 217 | 217 | { |
| 218 | 4, /* width of object */ | |
| 219 | 1, /* height of object */ | |
| 220 | 256,/* 256 characters */ | |
| 221 | 2, /* bits per pixel */ | |
| 222 | { 0,1 }, /* no bitplanes */ | |
| 223 | /* x offsets */ | |
| 224 | { 0,2,4,6 }, | |
| 225 | /* y offsets */ | |
| 226 | { 0 }, | |
| 227 | 8*1 /* size of 1 object in bits */ | |
| 218 | 4, /* width of object */ | |
| 219 | 1, /* height of object */ | |
| 220 | 256,/* 256 characters */ | |
| 221 | 2, /* bits per pixel */ | |
| 222 | { 0,1 }, /* no bitplanes */ | |
| 223 | /* x offsets */ | |
| 224 | { 0,2,4,6 }, | |
| 225 | /* y offsets */ | |
| 226 | { 0 }, | |
| 227 | 8*1 /* size of 1 object in bits */ | |
| 228 | 228 | }; |
| 229 | 229 | |
| 230 | 230 | static const unsigned short gamate_palette[4] = |
| r242631 | r242632 | |
| 233 | 233 | }; |
| 234 | 234 | |
| 235 | 235 | static GFXDECODE_START( gamate_charlayout ) |
| 236 | ||
| 236 | GFXDECODE_ENTRY( "gfx1", 0x0000, gamate_charlayout, 0, 0x100 ) | |
| 237 | 237 | GFXDECODE_END |
| 238 | 238 | #endif |
| 239 | 239 | |
| 240 | 240 | /* palette in red, green, blue tribles */ |
| 241 | 241 | static const unsigned char gamate_colors[4][3] = |
| 242 | 242 | { |
| 243 | { 255,255,255 }, | |
| 244 | { 0xa0, 0xa0, 0xa0 }, | |
| 245 | { 0x60, 0x60, 0x60 }, | |
| 246 | { 0, 0, 0 } | |
| 243 | { 255,255,255 }, | |
| 244 | { 0xa0, 0xa0, 0xa0 }, | |
| 245 | { 0x60, 0x60, 0x60 }, | |
| 246 | { 0, 0, 0 } | |
| 247 | 247 | }; |
| 248 | 248 | |
| 249 | 249 | PALETTE_INIT_MEMBER(gamate_state, gamate) |
| r242631 | r242632 | |
| 274 | 274 | |
| 275 | 275 | UINT32 gamate_state::screen_update_gamate(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 276 | 276 | { |
| 277 | int x, y, j; | |
| 278 | for (y=0;y<152;y++) { | |
| 279 | for (x=-(video.bitmap.xpos&7), j=0;x<160;x+=8, j++) { | |
| 280 | UINT8 d1=video.bitmap.data[0][(y+video.bitmap.ypos)&0xff][(j+video.bitmap.xpos/8)&0x1f]; | |
| 281 | UINT8 d2=video.bitmap.data[1][(y+video.bitmap.ypos)&0xff][(j+video.bitmap.xpos/8)&0x1f]; | |
| 282 | BlitPlane(&bitmap.pix16(y, x+4), d1, d2); | |
| 283 | BlitPlane(&bitmap.pix16(y, x), d1>>4, d2>>4); | |
| 284 | } | |
| 285 | } | |
| 286 | return 0; | |
| 277 | int x, y, j; | |
| 278 | for (y=0;y<152;y++) { | |
| 279 | for (x=-(video.bitmap.xpos&7), j=0;x<160;x+=8, j++) { | |
| 280 | UINT8 d1=video.bitmap.data[0][(y+video.bitmap.ypos)&0xff][(j+video.bitmap.xpos/8)&0x1f]; | |
| 281 | UINT8 d2=video.bitmap.data[1][(y+video.bitmap.ypos)&0xff][(j+video.bitmap.xpos/8)&0x1f]; | |
| 282 | BlitPlane(&bitmap.pix16(y, x+4), d1, d2); | |
| 283 | BlitPlane(&bitmap.pix16(y, x), d1>>4, d2>>4); | |
| 284 | } | |
| 285 | } | |
| 286 | return 0; | |
| 287 | 287 | } |
| 288 | 288 | |
| 289 | 289 | DRIVER_INIT_MEMBER(gamate_state,gamate) |
| 290 | 290 | { |
| 291 | 291 | memset(&video, 0, sizeof(video));/* memset(m_ram, 0, sizeof(m_ram));*/ |
| 292 | UINT8 *gfx=memregion("gfx1")->base(); | |
| 292 | UINT8 *gfx=memregion("gfx1")->base(); for (int i=0; i<256; i++) gfx[i]=i; | |
| 293 | 293 | timer1 = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gamate_state::gamate_timer),this)); |
| 294 | 294 | timer2 = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gamate_state::gamate_timer2),this)); |
| 295 | 295 | } |
| r242631 | r242632 | |
| 298 | 298 | void gamate_state::machine_start() |
| 299 | 299 | { |
| 300 | 300 | if (m_cart->exists()) { |
| 301 | // | |
| 301 | // m_maincpu->space(AS_PROGRAM).install_read_handler(0x6000, 0x6000, READ8_DELEGATE(gamate_state, gamate_cart_protection_r)); | |
| 302 | 302 | membank("bankmulti")->set_base(m_cart->get_rom_base()); |
| 303 | 303 | membank("bank")->set_base(m_cart->get_rom_base()+0x4000); // bankswitched games in reality no offset |
| 304 | 304 | } |
| r242631 | r242632 | |
| 355 | 355 | MCFG_SCREEN_UPDATE_DRIVER(gamate_state, screen_update_gamate) |
| 356 | 356 | MCFG_SCREEN_PALETTE("palette") |
| 357 | 357 | |
| 358 | // | |
| 358 | // MCFG_GFXDECODE_ADD("gfxdecode", "palette", gamate ) | |
| 359 | 359 | MCFG_PALETTE_ADD("palette", ARRAY_LENGTH(gamate_colors)) |
| 360 | // | |
| 360 | // MCFG_PALETTE_INDIRECT_ENTRIES(4) | |
| 361 | 361 | MCFG_PALETTE_INIT_OWNER(gamate_state, gamate) |
| 362 | 362 | MCFG_DEFAULT_LAYOUT(layout_lcd) |
| 363 | 363 | |
| r242631 | r242632 | |
| 371 | 371 | ROM_START(gamate) |
| 372 | 372 | ROM_REGION(0x10000,"maincpu", 0) |
| 373 | 373 | ROM_LOAD("gamate_bios_umc.bin", 0xf000, 0x1000, CRC(07090415) SHA1(ea449dc607601f9a68d855ad6ab53800d2e99297) ) |
| 374 | ||
| 374 | ROM_REGION(0x100,"gfx1", ROMREGION_ERASEFF) | |
| 375 | 375 | ROM_END |
| 376 | 376 | |
| 377 | 377 | |
| 378 | 378 | /* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME */ |
| 379 | 379 | CONS( 19??, gamate, 0, 0, gamate, gamate, gamate_state, gamate, "Bit Corp", "Gamate", GAME_NO_SOUND) |
| 380 | ||
| 381 |
| r242631 | r242632 | |
|---|---|---|
| 1 | 1 | /*************************************************************************** |
| 2 | ||
| 3 | Hewlett-Packard HP16500b Logic Analyzer | |
| 4 | 2 | |
| 3 | Hewlett-Packard HP16500b Logic Analyzer | |
| 4 | ||
| 5 | 5 | MC68EC030 @ 25 MHz |
| 6 | 6 | |
| 7 | 7 | WD37C65C floppy controller (NEC765 type) |
| r242631 | r242632 | |
| 16 | 16 | IRQ 5 = 814a |
| 17 | 17 | IRQ 6 = 35c8 (jump 840120) |
| 18 | 18 | IRQ 7 = 35d4 (jump 840120) |
| 19 | ||
| 19 | ||
| 20 | 20 | ****************************************************************************/ |
| 21 | 21 | |
| 22 | 22 | #include "emu.h" |
| r242631 | r242632 | |
| 28 | 28 | hp16500_state(const machine_config &mconfig, device_type type, const char *tag) |
| 29 | 29 | : driver_device(mconfig, type, tag), |
| 30 | 30 | m_maincpu(*this, "maincpu") |
| 31 | | |
| 31 | { } | |
| 32 | 32 | |
| 33 | 33 | virtual void video_start(); |
| 34 | 34 | UINT32 screen_update_hp16500(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
| r242631 | r242632 | |
| 55 | 55 | |
| 56 | 56 | READ32_MEMBER(hp16500_state::vbl_state_r) |
| 57 | 57 | { |
| 58 | return 0x03000000; | |
| 58 | return 0x03000000; // bit 0 set means the interrupt handler advances the pSOS tick counter. | |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | WRITE32_MEMBER(hp16500_state::vbl_ack_w) |
| r242631 | r242632 | |
| 71 | 71 | AM_RANGE(0x00203000, 0x00203003) AM_WRITE(vbl_ack_w) |
| 72 | 72 | AM_RANGE(0x00209800, 0x00209803) AM_READ(vbl_state_r) |
| 73 | 73 | |
| 74 | AM_RANGE(0x0020b800, 0x0020b8ff) AM_RAM | |
| 74 | AM_RANGE(0x0020b800, 0x0020b8ff) AM_RAM // system ram test is really strange. | |
| 75 | 75 | |
| 76 | 76 | AM_RANGE(0x00600000, 0x0061ffff) AM_WRITE16(vram_w, 0xffffffff) |
| 77 | 77 | AM_RANGE(0x00600000, 0x0067ffff) AM_READ8 (vram_r, 0x00ff00ff) |
| r242631 | r242632 | |
| 201 | 201 | ROM_END |
| 202 | 202 | |
| 203 | 203 | COMP( 1994, hp16500b, 0, 0, hp16500, hp16500, driver_device, 0, "Hewlett Packard", "HP 16500b", GAME_NOT_WORKING|GAME_NO_SOUND) |
| 204 |
| r242631 | r242632 | |
|---|---|---|
| 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: |
| 8 | ||
| 8 | ||
| 9 | 9 | 320: |
| 10 | 10 | MC68020 CPU @ 16.67 MHz |
| 11 | 11 | HP custom MMU |
| 12 | 12 | MC68881 FPU |
| 13 | ||
| 13 | ||
| 14 | 14 | 330: |
| 15 | MC68020 CPU @ 16.67 MHz | |
| 16 | MC68851 MMU | |
| 17 | MC68881 FPU | |
| 18 | ||
| 15 | MC68020 CPU @ 16.67 MHz | |
| 16 | MC68851 MMU | |
| 17 | MC68881 FPU | |
| 18 | ||
| 19 | 19 | All models have an MC6840 PIT on IRQ6 clocked at 250 kHz. |
| 20 | ||
| 20 | ||
| 21 | 21 | TODO: |
| 22 | 22 | BBCADDR 0x420000 |
| 23 | 23 | RTC_DATA: 0x420001 |
| r242631 | r242632 | |
| 27 | 27 | KBDNMIST: 0x478005 |
| 28 | 28 | DMA: 0x500000 |
| 29 | 29 | FRAMEBUF: 0x560000 |
| 30 | ||
| 30 | ||
| 31 | 31 | 6840: 0x5F8001/3/5/7/9, IRQ 6 |
| 32 | ||
| 32 | ||
| 33 | 33 | ****************************************************************************/ |
| 34 | 34 | |
| 35 | 35 | #include "emu.h" |
| r242631 | r242632 | |
| 88 | 88 | |
| 89 | 89 | // shared mappings for all 9000/3xx systems |
| 90 | 90 | static ADDRESS_MAP_START(hp9k3xx_common, AS_PROGRAM, 32, hp9k3xx_state) |
| 91 | AM_RANGE(0x00000000, 0x0001ffff) AM_ROM AM_REGION("maincpu",0) AM_WRITENOP | |
| 91 | AM_RANGE(0x00000000, 0x0001ffff) AM_ROM AM_REGION("maincpu",0) AM_WRITENOP // writes to 1fffc are the LED | |
| 92 | 92 | |
| 93 | AM_RANGE(0x00200000, 0x002fffff) AM_RAM AM_SHARE("vram") // 98544 mono framebuffer | |
| 94 | AM_RANGE(0x00560000, 0x00563fff) AM_ROM AM_REGION("graphics", 0x0000) // 98544 mono ROM | |
| 93 | AM_RANGE(0x00200000, 0x002fffff) AM_RAM AM_SHARE("vram") // 98544 mono framebuffer | |
| 94 | AM_RANGE(0x00560000, 0x00563fff) AM_ROM AM_REGION("graphics", 0x0000) // 98544 mono ROM | |
| 95 | 95 | |
| 96 | AM_RANGE(0x00510000, 0x00510003) AM_READWRITE(buserror_r, buserror_w) // no "Alpha display" | |
| 97 | AM_RANGE(0x00538000, 0x00538003) AM_READWRITE(buserror_r, buserror_w) // no "Graphics" | |
| 98 | AM_RANGE(0x005c0000, 0x005c0003) AM_READWRITE(buserror_r, buserror_w) // no add-on FP coprocessor | |
| 96 | AM_RANGE(0x00510000, 0x00510003) AM_READWRITE(buserror_r, buserror_w) // no "Alpha display" | |
| 97 | AM_RANGE(0x00538000, 0x00538003) AM_READWRITE(buserror_r, buserror_w) // no "Graphics" | |
| 98 | AM_RANGE(0x005c0000, 0x005c0003) AM_READWRITE(buserror_r, buserror_w) // no add-on FP coprocessor | |
| 99 | 99 | AM_RANGE(0x005f8000, 0x005f800f) AM_DEVREADWRITE8(PTM6840_TAG, ptm6840_device, read, write, 0x00ff00ff) |
| 100 | 100 | ADDRESS_MAP_END |
| 101 | 101 | |
| r242631 | r242632 | |
| 148 | 148 | MCFG_CPU_PROGRAM_MAP(hp9k320_map) |
| 149 | 149 | |
| 150 | 150 | MCFG_DEVICE_ADD(PTM6840_TAG, PTM6840, 0) |
| 151 | MCFG_PTM6840_INTERNAL_CLOCK(250000.0f) | |
| 151 | MCFG_PTM6840_INTERNAL_CLOCK(250000.0f) // from oscillator module next to the 6840 | |
| 152 | 152 | MCFG_PTM6840_EXTERNAL_CLOCKS(250000.0f, 250000.0f, 250000.0f) |
| 153 | 153 | |
| 154 | 154 | MCFG_SCREEN_ADD( "screen", RASTER) |
| r242631 | r242632 | |
| 164 | 164 | MCFG_CPU_PROGRAM_MAP(hp9k330_map) |
| 165 | 165 | |
| 166 | 166 | MCFG_DEVICE_ADD(PTM6840_TAG, PTM6840, 0) |
| 167 | MCFG_PTM6840_INTERNAL_CLOCK(250000.0f) | |
| 167 | MCFG_PTM6840_INTERNAL_CLOCK(250000.0f) // from oscillator module next to the 6840 | |
| 168 | 168 | MCFG_PTM6840_EXTERNAL_CLOCKS(250000.0f, 250000.0f, 250000.0f) |
| 169 | 169 | |
| 170 | 170 | MCFG_SCREEN_ADD( "screen", RASTER) |
| r242631 | r242632 | |
| 176 | 176 | |
| 177 | 177 | ROM_START( hp9k320 ) |
| 178 | 178 | ROM_REGION( 0x20000, MAINCPU_TAG, 0 ) |
| 179 | ROM_LOAD16_BYTE( "5061-6538.bin", 0x000001, 0x004000, CRC(d6aafeb1) SHA1(88c6b0b2f504303cbbac0c496c26b85458ac5d63) ) | |
| 180 | ROM_LOAD16_BYTE( "5061-6539.bin", 0x000000, 0x004000, CRC(a7ff104c) SHA1(c640fe68314654716bd41b04c6a7f4e560036c7e) ) | |
| 181 | ROM_LOAD16_BYTE( "5061-6540.bin", 0x008001, 0x004000, CRC(4f6796d6) SHA1(fd254897ac1afb8628f40ea93213f60a082c8d36) ) | |
| 182 | ROM_LOAD16_BYTE( "5061-6541.bin", 0x008000, 0x004000, CRC(39d32998) SHA1(6de1bda75187b0878c03c074942b807cf2924f0e) ) | |
| 179 | ROM_LOAD16_BYTE( "5061-6538.bin", 0x000001, 0x004000, CRC(d6aafeb1) SHA1(88c6b0b2f504303cbbac0c496c26b85458ac5d63) ) | |
| 180 | ROM_LOAD16_BYTE( "5061-6539.bin", 0x000000, 0x004000, CRC(a7ff104c) SHA1(c640fe68314654716bd41b04c6a7f4e560036c7e) ) | |
| 181 | ROM_LOAD16_BYTE( "5061-6540.bin", 0x008001, 0x004000, CRC(4f6796d6) SHA1(fd254897ac1afb8628f40ea93213f60a082c8d36) ) | |
| 182 | ROM_LOAD16_BYTE( "5061-6541.bin", 0x008000, 0x004000, CRC(39d32998) SHA1(6de1bda75187b0878c03c074942b807cf2924f0e) ) | |
| 183 | 183 | |
| 184 | 184 | ROM_REGION( 0x4000, "graphics", ROMREGION_ERASEFF | ROMREGION_BE | ROMREGION_32BIT ) |
| 185 | 185 | ROM_LOAD16_BYTE( "98544_1818-1999.bin", 0x000001, 0x002000, CRC(8c7d6480) SHA1(d2bcfd39452c38bc652df39f84c7041cfdf6bd51) ) |
| r242631 | r242632 | |
| 187 | 187 | |
| 188 | 188 | ROM_START( hp9k330 ) |
| 189 | 189 | ROM_REGION( 0x20000, MAINCPU_TAG, 0 ) |
| 190 | ROM_LOAD16_BYTE( "1818-4416.bin", 0x000000, 0x010000, CRC(cd71e85e) SHA1(3e83a80682f733417fdc3720410e45a2cfdcf869) ) | |
| 191 | ROM_LOAD16_BYTE( "1818-4417.bin", 0x000001, 0x010000, CRC(374d49db) SHA1(a12cbf6c151e2f421da4571000b5dffa3ef403b3) ) | |
| 190 | ROM_LOAD16_BYTE( "1818-4416.bin", 0x000000, 0x010000, CRC(cd71e85e) SHA1(3e83a80682f733417fdc3720410e45a2cfdcf869) ) | |
| 191 | ROM_LOAD16_BYTE( "1818-4417.bin", 0x000001, 0x010000, CRC(374d49db) SHA1(a12cbf6c151e2f421da4571000b5dffa3ef403b3) ) | |
| 192 | 192 | |
| 193 | 193 | ROM_REGION( 0x4000, "graphics", ROMREGION_ERASEFF | ROMREGION_BE | ROMREGION_32BIT ) |
| 194 | 194 | ROM_LOAD16_BYTE( "98544_1818-1999.bin", 0x000001, 0x002000, CRC(8c7d6480) SHA1(d2bcfd39452c38bc652df39f84c7041cfdf6bd51) ) |
| r242631 | r242632 | |
|---|---|---|
| 682 | 682 | |
| 683 | 683 | TI 8S030N 1149-0360 0360.U58 32x8 Timing prom? |
| 684 | 684 | TI 8S030N 1149-0370 0370.U74 32x8 Timing prom? |
| 685 | ||
| 685 | ||
| 686 | 686 | GI RO-3-9502-024 024.U60 2Kx10 Mask ROM+Addr Decoder, CP1600 code |
| 687 | 687 | GI 9316B-4D72 4D72.U62 2Kx8 Mask ROM, CP1600 code (upper) |
| 688 | 688 | GI 9316B-4D71 4D71.U63 2Kx8 Mask ROM, CP1600 code (lower) |
| r242631 | r242632 | |
| 691 | 691 | Main board also includes: |
| 692 | 692 | |
| 693 | 693 | 2 2114 DRAMS 1Kx4 Character memory |
| 694 | 10 MM5290J DRAMS 16Kx10 CP1600 memory? | |
| 694 | 10 MM5290J DRAMS 16Kx10 CP1600 memory? | |
| 695 | 695 | 1 6502 |
| 696 | 696 | 1 Mystery 40-pin chip (under heat sink) |
| 697 | 697 | (actually a SMC CRT5027 aka TI TMS9927 CRT controller) |
| r242631 | r242632 | |
| 715 | 715 | |
| 716 | 716 | ROM_REGION(0x0100,"proms",0) |
| 717 | 717 | ROM_LOAD( "0360.u58", 0x00, 0x20, CRC(1295528a) SHA1(b35e598891f1185e02cbacb4811d2334357abd79)) |
| 718 | ROM_LOAD( "0370.u74", 0x20, 0x20, CRC(19da5096) SHA1(76af50e4fd29649fc4837120c245321a8fc84cd3)) | |
| 718 | ROM_LOAD( "0370.u74", 0x20, 0x20, CRC(19da5096) SHA1(76af50e4fd29649fc4837120c245321a8fc84cd3)) | |
| 719 | 719 | ROM_END |
| 720 | 720 | |
| 721 | 721 | DRIVER_INIT_MEMBER(intv_state,intv) |
| r242631 | r242632 | |
|---|---|---|
| 283 | 283 | static ADDRESS_MAP_START( leapster_map, AS_PROGRAM, 32, leapster_state ) |
| 284 | 284 | AM_RANGE(0x00000000, 0x001fffff) AM_ROM AM_MIRROR(0x40000000) // pointers in the bios region seem to be to the 40xxxxxx region, either we mirror there or something (real bios?) is acutally missing |
| 285 | 285 | AM_RANGE(0x0180D800, 0x0180D803) AM_READ(leapster_random_r) |
| 286 | AM_RANGE(0x03000000, 0x030007ff) AM_RAM // puts stack here, writes a pointer @ 0x03000000 on startup | |
| 286 | AM_RANGE(0x03000000, 0x030007ff) AM_RAM // puts stack here, writes a pointer @ 0x03000000 on startup | |
| 287 | 287 | AM_RANGE(0x3c000000, 0x3c1fffff) AM_RAM // really ram, or has our code execution gone wrong? |
| 288 | // | |
| 288 | // AM_RANGE(0x80000000, 0x807fffff) AM_ROMBANK("cartrom") // game ROM pointers are all to the 80xxxxxx region, so I assume it maps here - installed if a cart is present | |
| 289 | 289 | ADDRESS_MAP_END |
| 290 | 290 | |
| 291 | 291 | static MACHINE_CONFIG_START( leapster, leapster_state ) |
| r242631 | r242632 | |
| 323 | 323 | |
| 324 | 324 | DRIVER_INIT_MEMBER(leapster_state,leapster) |
| 325 | 325 | { |
| 326 | ||
| 327 | 326 | } |
| 328 | 327 | |
| 329 | 328 | CONS(2003, leapster, 0, 0, leapster, leapster, leapster_state, leapster, "LeapFrog", "Leapster (Germany)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_IS_SKELETON ) |
| r242631 | r242632 | |
|---|---|---|
| 6 | 6 | * TMS1100 MP1030 - MCU |
| 7 | 7 | * 2 x DS8870N - Hex LED Digit Driver |
| 8 | 8 | * 2 x DS8861N - MOS-to-LED 5-Segment Driver |
| 9 | ||
| 9 | ||
| 10 | 10 | This is a tabletop educational calculator. It came with plastic overlays |
| 11 | 11 | for playing different kind of games. Refer to the manual on how to use it. |
| 12 | 12 | In short, to start from scratch, press [SEL]. By default the device is in |
| 13 | 13 | calculator teaching mode. If [SEL] is followed with 1-6 and then [NXT], |
| 14 | 14 | one of the games is started. |
| 15 | ||
| 15 | ||
| 16 | 16 | 1) Number Machine |
| 17 | 17 | 2) Countin' On |
| 18 | 18 | 3) Walk The Plank |
| r242631 | r242632 | |
| 24 | 24 | TODO: |
| 25 | 25 | - some of the led symbols are probably wrong, output PLA is unknown |
| 26 | 26 | - microinstructions PLA is not verified |
| 27 | ||
| 27 | ||
| 28 | 28 | ***************************************************************************/ |
| 29 | 29 | |
| 30 | 30 | #include "emu.h" |
| r242631 | r242632 | |
| 102 | 102 | if (i >= 8) |
| 103 | 103 | for (int j = 0; j < 8; j++) |
| 104 | 104 | output_set_lamp_value(i*10 + j, m_o >> j & 1); |
| 105 | ||
| 105 | ||
| 106 | 106 | // R0-R7: 7seg leds |
| 107 | 107 | else |
| 108 | 108 | output_set_digit_value(i, m_o >> 1 & 0x7f); |
| r242631 | r242632 | |
|---|---|---|
| 51 | 51 | key |= ioport("Y10")->read(); |
| 52 | 52 | key |= ioport("Y11")->read(); |
| 53 | 53 | key |= ioport("Y12")->read(); |
| 54 | // DBG_LOG(1,"mc1502_k_s_c",("= %02X (%d) %s\n", key, m_kbd.pulsing, | |
| 55 | // (key || m_kbd.pulsing) ? " will IRQ" : "")); | |
| 54 | // DBG_LOG(1,"mc1502_k_s_c",("= %02X (%d) %s\n", key, m_kbd.pulsing, | |
| 55 | // (key || m_kbd.pulsing) ? " will IRQ" : "")); | |
| 56 | 56 | |
| 57 | 57 | /* |
| 58 | 58 | If a key is pressed and we're not pulsing yet, start pulsing the IRQ1; |
| r242631 | r242632 | |
| 73 | 73 | |
| 74 | 74 | WRITE8_MEMBER(mc1502_state::mc1502_ppi_portb_w) |
| 75 | 75 | { |
| 76 | // | |
| 76 | // DBG_LOG(2,"mc1502_ppi_portb_w",("( %02X )\n", data)); | |
| 77 | 77 | m_ppi_portb = data; |
| 78 | 78 | m_pit8253->write_gate2(BIT(data, 0)); |
| 79 | 79 | mc1502_speaker_set_spkrdata(BIT(data, 1)); |
| r242631 | r242632 | |
| 87 | 87 | // bit 3: i8251 SYNDET pin triggers NMI (default = 1 = no) |
| 88 | 88 | WRITE8_MEMBER(mc1502_state::mc1502_ppi_portc_w) |
| 89 | 89 | { |
| 90 | // | |
| 90 | // DBG_LOG(2,"mc1502_ppi_portc_w",("( %02X )\n", data)); | |
| 91 | 91 | m_ppi_portc = data & 15; |
| 92 | 92 | } |
| 93 | 93 | |
| r242631 | r242632 | |
| 104 | 104 | data = ( data & ~0x20 ) | ( m_pit_out2 ? 0x20 : 0x00 ); |
| 105 | 105 | data = ( data & ~0x10 ) | ( (BIT(m_ppi_portb, 1) && m_pit_out2) ? 0x10 : 0x00 ); |
| 106 | 106 | |
| 107 | // DBG_LOG(2,"mc1502_ppi_portc_r",("= %02X (tap_val %f t2out %d) at %s\n", | |
| 108 | // data, tap_val, m_pit_out2, machine().describe_context())); | |
| 107 | // DBG_LOG(2,"mc1502_ppi_portc_r",("= %02X (tap_val %f t2out %d) at %s\n", | |
| 108 | // data, tap_val, m_pit_out2, machine().describe_context())); | |
| 109 | 109 | return data; |
| 110 | 110 | } |
| 111 | 111 | |
| r242631 | r242632 | |
| 126 | 126 | if (m_kbd.mask & 0x0400) { key |= ioport("Y11")->read(); } |
| 127 | 127 | if (m_kbd.mask & 0x0800) { key |= ioport("Y12")->read(); } |
| 128 | 128 | key ^= 0xff; |
| 129 | // | |
| 129 | // DBG_LOG(2,"mc1502_kppi_porta_r",("= %02X\n", key)); | |
| 130 | 130 | return key; |
| 131 | 131 | } |
| 132 | 132 | |
| r242631 | r242632 | |
| 138 | 138 | m_kbd.mask |= 1 << 11; |
| 139 | 139 | else |
| 140 | 140 | m_kbd.mask &= ~(1 << 11); |
| 141 | // | |
| 141 | // DBG_LOG(2,"mc1502_kppi_portb_w",("( %02X -> %04X )\n", data, m_kbd.mask)); | |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | WRITE8_MEMBER(mc1502_state::mc1502_kppi_portc_w) |
| 145 | 145 | { |
| 146 | 146 | m_kbd.mask &= ~(7 << 8); |
| 147 | 147 | m_kbd.mask |= ((data ^ 7) & 7) << 8; |
| 148 | // | |
| 148 | // DBG_LOG(2,"mc1502_kppi_portc_w",("( %02X -> %04X )\n", data, m_kbd.mask)); | |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | WRITE_LINE_MEMBER(mc1502_state::mc1502_i8251_syndet) |
| r242631 | r242632 | |
|---|---|---|
| 769 | 769 | |
| 770 | 770 | ROM_START( megacdj ) |
| 771 | 771 | ROM_REGION16_BE( 0x400000, "maincpu", ROMREGION_ERASE00 ) |
| 772 | ROM_DEFAULT_BIOS("v100g") | |
| 772 | ROM_DEFAULT_BIOS("v100g") // this seems the only revision where the cursor in CD menu works, allowing to boot games | |
| 773 | 773 | /* Confirmed by ElBarto */ |
| 774 | 774 | ROM_SYSTEM_BIOS(0, "v100s", "v1.00S") |
| 775 | 775 | ROMX_LOAD( "mpr-14088h.bin", 0x000000, 0x020000, CRC(3773d5aa) SHA1(bbf729a1aaa1667b783749299e1ad932aaf5f253), ROM_BIOS(1) | ROM_GROUPWORD | ROM_REVERSE) |
| r242631 | r242632 | |
| 782 | 782 | /* Confirmed by ElBarto */ |
| 783 | 783 | ROM_SYSTEM_BIOS(3, "v100o", "v1.00O") |
| 784 | 784 | ROMX_LOAD( "epr-14088d.bin", 0x000000, 0x020000, CRC(dfa95ee9) SHA1(e13666c76fa0a2e94e2f651b26b0fd625bf55f07), ROM_BIOS(4) | ROM_GROUPWORD | ROM_REVERSE) |
| 785 | ROM_SYSTEM_BIOS(4, "v100p", "v1.00P") | |
| 785 | ROM_SYSTEM_BIOS(4, "v100p", "v1.00P") // CRC: e2e70bc8 when byteswapped | |
| 786 | 786 | ROMX_LOAD( "epr-14088e.bin", 0x000000, 0x020000, CRC(9d2da8f2) SHA1(4846f448160059a7da0215a5df12ca160f26dd69), ROM_BIOS(5) ) |
| 787 | 787 | ROM_END |
| 788 | 788 |
| r242631 | r242632 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | Parker Bros Merlin handheld computer game |
| 6 | 6 | * TMS1100NLL MP3404A-N2 (has internal ROM) |
| 7 | ||
| 7 | ||
| 8 | 8 | To start a game, press NEW GAME, followed by a number: |
| 9 | 9 | 1: Tic-Tac-Toe |
| 10 | 10 | 2: Music Machine |
| r242631 | r242632 | |
| 12 | 12 | 4: Blackjack 13 |
| 13 | 13 | 5: Magic Square |
| 14 | 14 | 6: Mindbender |
| 15 | ||
| 15 | ||
| 16 | 16 | Refer to the official manual for more information on the games. |
| 17 | ||
| 18 | ||
| 17 | ||
| 18 | ||
| 19 | 19 | Other handhelds assumed to be on similar hardware: |
| 20 | 20 | - Dr. Smith - by Tomy, released in Japan (basically a white version of Merlin, |
| 21 | 21 | let's assume for now that the ROM contents is identical) |
| 22 | 22 | - Master Merlin |
| 23 | ||
| 23 | ||
| 24 | 24 | Another sequel, called Split Second, looks like different hardware. |
| 25 | 25 | |
| 26 | 26 | |
| r242631 | r242632 | |
| 75 | 75 | READ8_MEMBER(merlin_state::read_k) |
| 76 | 76 | { |
| 77 | 77 | UINT8 k = 0; |
| 78 | ||
| 78 | ||
| 79 | 79 | // read selected button rows |
| 80 | 80 | for (int i = 0; i < 4; i++) |
| 81 | 81 | if (m_o >> i & 1) |
| r242631 | r242632 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | 10-11-14 - Skeleton driver |
| 6 | 6 | |
| 7 | Interrupts based on patents: | |
| 8 | level 1 - SIO | |
| 9 | level 3 - timer (from PIT, presumably channel 0? Patent says "channel 3") | |
| 10 | level 4 - "interrupt detector" - keyboard, printer, RTC | |
| 11 | level 7 - floppy/hard disk | |
| 7 | Interrupts based on patents: | |
| 8 | level 1 - SIO | |
| 9 | level 3 - timer (from PIT, presumably channel 0? Patent says "channel 3") | |
| 10 | level 4 - "interrupt detector" - keyboard, printer, RTC | |
| 11 | level 7 - floppy/hard disk | |
| 12 | 12 | |
| 13 | DMA channels: | |
| 14 | channel 0 - communications (RS-232) | |
| 15 | channel 1 - X-Bus expansion modules (except disk and graphics) | |
| 16 | channel 2 - graphics? | |
| 17 | channel 3 - hard disk | |
| 18 | ||
| 13 | DMA channels: | |
| 14 | channel 0 - communications (RS-232) | |
| 15 | channel 1 - X-Bus expansion modules (except disk and graphics) | |
| 16 | channel 2 - graphics? | |
| 17 | channel 3 - hard disk | |
| 18 | ||
| 19 | 19 | To get to "menu mode", press Space quickly after reset (might need good timing) |
| 20 | 20 | The bootstrap ROM version number is displayed, along with "B,D,L,M,P,T:" |
| 21 | 21 | You can press one of these keys for the following tests: |
| r242631 | r242632 | |
| 33 | 33 | T: Type of Operating System |
| 34 | 34 | Gives an "OS:" prompt, at which you can enter the number of the system image to |
| 35 | 35 | load at the master workstation. |
| 36 | ||
| 36 | ||
| 37 | 37 | Panel Debugger: |
| 38 | 38 | - Open/Modify RAM |
| 39 | 39 | Enter an address (seg:off) followed by a forward-slash, the contents of this word will |
| 40 | 40 | appear, you can enter a value to set it to, or just press Next (default: Enter) to leave |
| 41 | it as is. It will then go on to the next word. Pressing Return (scan code unknown | |
| 41 | it as is. It will then go on to the next word. Pressing Return (scan code unknown | |
| 42 | 42 | currently) will return to the debugger prompt. |
| 43 | 43 | - Open/Modify Register |
| 44 | 44 | Enter the register only, and the contents will appear, you can leave it or alter it (you |
| 45 | 45 | must enter all digits (eg: 0A03 if you're modifying DX) then press Return. |
| 46 | 46 | - I/O to or from a port |
| 47 | Input: Address (segment is ignored, and not required) followed by I, a byte is read from | |
| 47 | Input: Address (segment is ignored, and not required) followed by I, a byte is read from | |
| 48 | 48 | the port defined by the offset, and the byte is displayed. |
| 49 | 49 | Output: Address followed by O, you are now prompted with an '='. Enter the byte to send |
| 50 | 50 | to the port, and press Return. |
| r242631 | r242632 | |
| 52 | 52 | Enter an address (seg:off) followed by H. Sets a haltpoint at the specified address. Does |
| 53 | 53 | not work for ROM addresses. Only one allowed at a time. Haltpoint info is stored at |
| 54 | 54 | 0000:01F0. Uses a software interrupt (INT 7C), rather than INT 3. |
| 55 | ||
| 55 | ||
| 56 | 56 | To start or continue from the current address, enter P. |
| 57 | 57 | To start from a specific address, enter the address (seg:off) followed by a G. |
| 58 | 58 | */ |
| r242631 | r242632 | |
| 624 | 624 | MCFG_I8251_TXD_HANDLER(DEVWRITELINE("keyboard", rs232_port_device, write_txd)) |
| 625 | 625 | MCFG_RS232_PORT_ADD("keyboard", keyboard, "ngen") |
| 626 | 626 | MCFG_RS232_RXD_HANDLER(DEVWRITELINE("videouart", i8251_device, write_rxd)) |
| 627 | ||
| 627 | ||
| 628 | 628 | MCFG_DEVICE_ADD("refresh_clock", CLOCK, 19200*16) // should be 19530Hz |
| 629 | 629 | MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(ngen_state,timer_clk_out)) |
| 630 | 630 | |
| r242631 | r242632 | |
| 662 | 662 | ROM_REGION( 0x2000, "bios", 0) |
| 663 | 663 | ROM_LOAD16_BYTE( "72-00414_80186_cpu.bin", 0x000000, 0x001000, CRC(e1387a03) SHA1(ddca4eba67fbf8b731a8009c14f6b40edcbc3279) ) // bootstrap ROM v8.4 |
| 664 | 664 | ROM_LOAD16_BYTE( "72-00415_80186_cpu.bin", 0x000001, 0x001000, CRC(a6dde7d9) SHA1(b4d15c1bce31460ab5b92ff43a68c15ac5485816) ) |
| 665 | ||
| 665 | ||
| 666 | 666 | ROM_REGION( 0x1000, "disk", 0) |
| 667 | 667 | ROM_LOAD( "72-00422_10mb_disk.bin", 0x000000, 0x001000, CRC(f5b046b6) SHA1(b303c6f6aa40504016de9826879bc316e44389aa) ) |
| 668 | ||
| 668 | ||
| 669 | 669 | ROM_REGION( 0x20, "disk_prom", 0) |
| 670 | 670 | ROM_LOAD( "72-00422_10mb_disk_15d.bin", 0x000000, 0x000020, CRC(121ee494) SHA1(9a8d3c336cc7378a71f9d48c99f88515eb236fbf) ) |
| 671 | 671 | ROM_END |
| r242631 | r242632 | |
|---|---|---|
| 3 | 3 | /*************************************************************************** |
| 4 | 4 | |
| 5 | 5 | Milton Bradley Simon |
| 6 | ||
| 6 | ||
| 7 | 7 | Revision A hardware: |
| 8 | 8 | * TMS1000 (has internal ROM), DS75494 lamp driver |
| 9 | ||
| 9 | ||
| 10 | 10 | Newer revisions have a smaller 16-pin MB4850 chip instead of the TMS1000. |
| 11 | 11 | This one has been decapped too, but we couldn't find an internal ROM. |
| 12 | 12 | It is possibly a cost-reduced custom ASIC specifically for Simon. |
| 13 | ||
| 13 | ||
| 14 | 14 | Other games assumed to be on similar hardware: |
| 15 | 15 | - Pocket Simon, but there's a chance it only exists with MB4850 chip |
| 16 | 16 | - Super Simon (TMS1100) |
| r242631 | r242632 | |
| 61 | 61 | READ8_MEMBER(simon_state::read_k) |
| 62 | 62 | { |
| 63 | 63 | UINT8 k = 0; |
| 64 | ||
| 64 | ||
| 65 | 65 | // read selected button rows |
| 66 | 66 | for (int i = 0; i < 4; i++) |
| 67 | 67 | { |
| r242631 | r242632 | |
| 82 | 82 | // R7 -> 75494 IN2 -> blue lamp |
| 83 | 83 | for (int i = 0; i < 4; i++) |
| 84 | 84 | output_set_lamp_value(i, data >> (4 + i) & 1); |
| 85 | ||
| 85 | ||
| 86 | 86 | // R8 -> 75494 IN0 -> speaker |
| 87 | 87 | m_speaker->level_w(data >> 8 & 1); |
| 88 | 88 |
| r242631 | r242632 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | Kenner Star Wars - Electronic Battle Command |
| 6 | 6 | * TMS1100 MCU, labeled MP3438A |
| 7 | ||
| 7 | ||
| 8 | 8 | This is a small tabletop space-dogfighting game. To start the game, |
| 9 | 9 | press BASIC/INTER/ADV and enter P#(number of players), then |
| 10 | 10 | START TURN. Refer to the official manual for more information. |
| r242631 | r242632 | |
| 46 | 46 | DECLARE_READ8_MEMBER(read_k); |
| 47 | 47 | DECLARE_WRITE16_MEMBER(write_o); |
| 48 | 48 | DECLARE_WRITE16_MEMBER(write_r); |
| 49 | ||
| 49 | ||
| 50 | 50 | TIMER_DEVICE_CALLBACK_MEMBER(leds_decay_tick); |
| 51 | 51 | void leds_update(); |
| 52 | 52 | void prepare_and_update(); |
| r242631 | r242632 | |
| 71 | 71 | void starwbc_state::leds_update() |
| 72 | 72 | { |
| 73 | 73 | UINT16 active_state[0x10]; |
| 74 | ||
| 74 | ||
| 75 | 75 | for (int i = 0; i < 0x10; i++) |
| 76 | 76 | { |
| 77 | 77 | active_state[i] = 0; |
| 78 | ||
| 78 | ||
| 79 | 79 | for (int j = 0; j < 0x10; j++) |
| 80 | 80 | { |
| 81 | 81 | int di = j << 4 | i; |
| 82 | ||
| 82 | ||
| 83 | 83 | // turn on powered leds |
| 84 | 84 | if (m_leds_state[i] >> j & 1) |
| 85 | 85 | m_leds_decay[di] = LEDS_DECAY_TIME; |
| 86 | ||
| 86 | ||
| 87 | 87 | // determine active state |
| 88 | 88 | int ds = (m_leds_decay[di] != 0) ? 1 : 0; |
| 89 | 89 | active_state[i] |= (ds << j); |
| 90 | 90 | } |
| 91 | 91 | } |
| 92 | ||
| 92 | ||
| 93 | 93 | // on difference, send to output |
| 94 | 94 | for (int i = 0; i < 0x10; i++) |
| 95 | 95 | if (m_leds_cache[i] != active_state[i]) |
| 96 | 96 | { |
| 97 | 97 | output_set_digit_value(i, active_state[i]); |
| 98 | ||
| 98 | ||
| 99 | 99 | for (int j = 0; j < 8; j++) |
| 100 | 100 | output_set_lamp_value(i*10 + j, active_state[i] >> j & 1); |
| 101 | 101 | } |
| 102 | ||
| 102 | ||
| 103 | 103 | memcpy(m_leds_cache, active_state, sizeof(m_leds_cache)); |
| 104 | 104 | } |
| 105 | 105 | |
| r242631 | r242632 | |
| 109 | 109 | for (int i = 0; i < 0x100; i++) |
| 110 | 110 | if (!(m_leds_state[i & 0xf] >> (i>>4) & 1) && m_leds_decay[i]) |
| 111 | 111 | m_leds_decay[i]--; |
| 112 | ||
| 112 | ||
| 113 | 113 | leds_update(); |
| 114 | 114 | } |
| 115 | 115 | |
| r242631 | r242632 | |
| 117 | 117 | { |
| 118 | 118 | UINT8 o = (m_o << 4 & 0xf0) | (m_o >> 4 & 0x0f); |
| 119 | 119 | const UINT8 mask[5] = { 0x30, 0xff, 0xff, 0x7f, 0x7f }; |
| 120 | ||
| 120 | ||
| 121 | 121 | // R0,R2,R4,R6,R8 |
| 122 | 122 | for (int i = 0; i < 5; i++) |
| 123 | 123 | m_leds_state[i*2] = (m_r >> (i*2) & 1) ? (o & mask[i]) : 0; |
| r242631 | r242632 | |
| 155 | 155 | // R0,R1,R3,R5,R7: input mux |
| 156 | 156 | // R9: piezo speaker |
| 157 | 157 | m_speaker->level_w(data >> 9 & 1); |
| 158 | ||
| 158 | ||
| 159 | 159 | m_r = data; |
| 160 | 160 | prepare_and_update(); |
| 161 | 161 | } |
| r242631 | r242632 | |
| 233 | 233 | |
| 234 | 234 | m_r = 0; |
| 235 | 235 | m_o = 0; |
| 236 | ||
| 236 | ||
| 237 | 237 | // register for savestates |
| 238 | 238 | save_item(NAME(m_leds_state)); |
| 239 | 239 | save_item(NAME(m_leds_cache)); |
| r242631 | r242632 | |
| 253 | 253 | MCFG_TMS1XXX_WRITE_R_CB(WRITE16(starwbc_state, write_r)) |
| 254 | 254 | |
| 255 | 255 | MCFG_TIMER_DRIVER_ADD_PERIODIC("leds_decay", starwbc_state, leds_decay_tick, attotime::from_msec(10)) |
| 256 | ||
| 256 | ||
| 257 | 257 | MCFG_DEFAULT_LAYOUT(layout_starwbc) |
| 258 | 258 | |
| 259 | 259 | /* no video! */ |
| r242631 | r242632 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | Parker Brothers Stop Thief |
| 6 | 6 | * TMS0980NLL MP6101B (die labeled 0980B-01A) |
| 7 | ||
| 7 | ||
| 8 | 8 | Stop Thief is actually a board game, the electronic device emulated here |
| 9 | 9 | (called Electronic Crime Scanner) is an accessory. To start a game, press |
| 10 | 10 | the ON button. Otherwise, it is in test-mode where you can hear all sounds. |
| r242631 | r242632 | |
| 78 | 78 | void stopthief_state::leds_update() |
| 79 | 79 | { |
| 80 | 80 | UINT16 active_state[0x10]; |
| 81 | ||
| 81 | ||
| 82 | 82 | for (int i = 0; i < 0x10; i++) |
| 83 | 83 | { |
| 84 | 84 | active_state[i] = 0; |
| 85 | ||
| 85 | ||
| 86 | 86 | for (int j = 0; j < 0x10; j++) |
| 87 | 87 | { |
| 88 | 88 | int di = j << 4 | i; |
| 89 | ||
| 89 | ||
| 90 | 90 | // turn on powered leds |
| 91 | 91 | if (m_leds_state[i] >> j & 1) |
| 92 | 92 | m_leds_decay[di] = LEDS_DECAY_TIME; |
| 93 | ||
| 93 | ||
| 94 | 94 | // determine active state |
| 95 | 95 | int ds = (m_power_on && m_leds_decay[di] != 0) ? 1 : 0; |
| 96 | 96 | active_state[i] |= (ds << j); |
| 97 | 97 | } |
| 98 | 98 | } |
| 99 | ||
| 99 | ||
| 100 | 100 | // on difference, send to output |
| 101 | 101 | for (int i = 0; i < 0x10; i++) |
| 102 | 102 | if (m_leds_cache[i] != active_state[i]) |
| 103 | 103 | output_set_digit_value(i, active_state[i]); |
| 104 | ||
| 104 | ||
| 105 | 105 | memcpy(m_leds_cache, active_state, sizeof(m_leds_cache)); |
| 106 | 106 | } |
| 107 | 107 | |
| r242631 | r242632 | |
| 111 | 111 | for (int i = 0; i < 0x100; i++) |
| 112 | 112 | if (!(m_leds_state[i & 0xf] >> (i>>4) & 1) && m_leds_decay[i]) |
| 113 | 113 | m_leds_decay[i]--; |
| 114 | ||
| 114 | ||
| 115 | 115 | leds_update(); |
| 116 | 116 | } |
| 117 | 117 | |
| r242631 | r242632 | |
| 145 | 145 | UINT8 o = BITSWAP8(m_o,3,5,2,1,4,0,6,7) & 0x7f; |
| 146 | 146 | for (int i = 0; i < 3; i++) |
| 147 | 147 | m_leds_state[i] = (data >> i & 1) ? o : 0; |
| 148 | ||
| 148 | ||
| 149 | 149 | leds_update(); |
| 150 | ||
| 150 | ||
| 151 | 151 | // R3-R8: speaker on |
| 152 | 152 | m_speaker->level_w((data & 0x1f8 && m_o & 8) ? 1 : 0); |
| 153 | 153 | } |
| r242631 | r242632 | |
| 261 | 261 | MCFG_TMS1XXX_POWER_OFF_CB(WRITELINE(stopthief_state, auto_power_off)) |
| 262 | 262 | |
| 263 | 263 | MCFG_TIMER_DRIVER_ADD_PERIODIC("leds_decay", stopthief_state, leds_decay_tick, attotime::from_msec(10)) |
| 264 | ||
| 264 | ||
| 265 | 265 | MCFG_DEFAULT_LAYOUT(layout_stopthie) |
| 266 | 266 | |
| 267 | 267 | /* no video! */ |
| r242631 | r242632 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | Tandy Radio Shack Computerized Arcade (1981, 1982, 1995) |
| 6 | 6 | * TMS1100 CD7282SL |
| 7 | ||
| 7 | ||
| 8 | 8 | This handheld contains 12 minigames. It looks and plays like "Fabulous Fred" |
| 9 | 9 | by the Japanese company Mego Corp. in 1980, which in turn is a mix of Merlin |
| 10 | 10 | and Simon. Unlike Merlin and Simon, spin-offs like these were not successful. |
| 11 | 11 | There were releases with and without the prefix "Tandy-12", I don't know |
| 12 | 12 | which name was more common. Also not worth noting is that it needed five |
| 13 | 13 | batteries; 4 C-cells and a 9-volt. |
| 14 | ||
| 14 | ||
| 15 | 15 | Some of the games require accessories included with the toy (eg. the Baseball |
| 16 | 16 | game is played with a board representing the playing field). To start a game, |
| 17 | 17 | hold the [SELECT] button, then press [START] when the game button lights up. |
| 18 | 18 | As always, refer to the official manual for more information. |
| 19 | ||
| 19 | ||
| 20 | 20 | See below at the input defs for a list of the games. |
| 21 | 21 | |
| 22 | ||
| 22 | ||
| 23 | 23 | TODO: |
| 24 | 24 | - output PLA is not verified |
| 25 | 25 | - microinstructions PLA is not verified |
| r242631 | r242632 | |
| 70 | 70 | READ8_MEMBER(tandy12_state::read_k) |
| 71 | 71 | { |
| 72 | 72 | UINT8 k = 0; |
| 73 | ||
| 73 | ||
| 74 | 74 | // read selected button rows |
| 75 | 75 | for (int i = 0; i < 5; i++) |
| 76 | 76 | if (m_r >> (i+5) & 1) |
| r242631 | r242632 | |
| 114 | 114 | |
| 115 | 115 | [purple]1 [blue]5 [l-green]9 |
| 116 | 116 | ORGAN TAG-IT TREASURE HUNT |
| 117 | ||
| 117 | ||
| 118 | 118 | [l-orange]2 [turquoise]6 [red]10 |
| 119 | 119 | SONG WRITER ROULETTE COMPETE |
| 120 | ||
| 120 | ||
| 121 | 121 | [pink]3 [yellow]7 [violet]11 |
| 122 | 122 | REPEAT BASEBALL FIRE AWAY |
| 123 | 123 | |
| r242631 | r242632 | |
| 180 | 180 | // these are certain |
| 181 | 181 | 0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, |
| 182 | 182 | 0x80, 0x00, 0x00, 0x00, 0x00, |
| 183 | ||
| 183 | ||
| 184 | 184 | // rest is unused? |
| 185 | 185 | 0x00, 0x00, 0x00, |
| 186 | 186 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| r242631 | r242632 | |
|---|---|---|
| 3 | 3 | /*************************************************************************** |
| 4 | 4 | |
| 5 | 5 | Texas Instruments TMS1xxx/0970/0980 handheld calculators (mostly single-chip) |
| 6 | ||
| 6 | ||
| 7 | 7 | Refer to their official manuals on how to use them. |
| 8 | 8 | |
| 9 | ||
| 9 | ||
| 10 | 10 | TODO: |
| 11 | 11 | - MCU clocks are unknown |
| 12 | 12 | |
| r242631 | r242632 | |
| 85 | 85 | void ticalc1x_state::leds_update() |
| 86 | 86 | { |
| 87 | 87 | UINT16 active_state[0x10]; |
| 88 | ||
| 88 | ||
| 89 | 89 | for (int i = 0; i < 0x10; i++) |
| 90 | 90 | { |
| 91 | 91 | active_state[i] = 0; |
| 92 | ||
| 92 | ||
| 93 | 93 | for (int j = 0; j < 0x10; j++) |
| 94 | 94 | { |
| 95 | 95 | int di = j << 4 | i; |
| 96 | ||
| 96 | ||
| 97 | 97 | // turn on powered leds |
| 98 | 98 | if (m_leds_state[i] >> j & 1) |
| 99 | 99 | m_leds_decay[di] = LEDS_DECAY_TIME; |
| 100 | ||
| 100 | ||
| 101 | 101 | // determine active state |
| 102 | 102 | int ds = (m_power_on && m_leds_decay[di] != 0) ? 1 : 0; |
| 103 | 103 | active_state[i] |= (ds << j); |
| 104 | 104 | } |
| 105 | 105 | } |
| 106 | ||
| 106 | ||
| 107 | 107 | // on difference, send to output |
| 108 | 108 | for (int i = 0; i < 0x10; i++) |
| 109 | 109 | if (m_leds_cache[i] != active_state[i]) |
| 110 | 110 | { |
| 111 | 111 | output_set_digit_value(i, active_state[i]); |
| 112 | ||
| 112 | ||
| 113 | 113 | for (int j = 0; j < 8; j++) |
| 114 | 114 | output_set_lamp_value(i*10 + j, active_state[i] >> j & 1); |
| 115 | 115 | } |
| r242631 | r242632 | |
| 123 | 123 | for (int i = 0; i < 0x100; i++) |
| 124 | 124 | if (!(m_leds_state[i & 0xf] >> (i>>4) & 1) && m_leds_decay[i]) |
| 125 | 125 | m_leds_decay[i]--; |
| 126 | ||
| 126 | ||
| 127 | 127 | leds_update(); |
| 128 | 128 | } |
| 129 | 129 | |
| r242631 | r242632 | |
| 143 | 143 | for (int i = 0; i < 11; i++) |
| 144 | 144 | if (m_r >> i & 1) |
| 145 | 145 | m_leds_state[i] = m_o; |
| 146 | ||
| 146 | ||
| 147 | 147 | // exponent sign (not 100% sure this is correct) |
| 148 | 148 | m_leds_state[11] = (m_leds_state[0] | m_leds_state[1]) ? 0x40 : 0; |
| 149 | 149 | |
| r242631 | r242632 | |
| 169 | 169 | // R0-R10: input mux |
| 170 | 170 | // R0-R10: select digit (right-to-left) |
| 171 | 171 | m_r = data; |
| 172 | ||
| 172 | ||
| 173 | 173 | tisr16_leds_update(); |
| 174 | 174 | } |
| 175 | 175 | |
| r242631 | r242632 | |
| 233 | 233 | // note: 3rd digit is custom(not 7seg), for math symbols |
| 234 | 234 | for (int i = 0; i < 9; i++) |
| 235 | 235 | m_leds_state[i] = (data >> i & 1) ? m_o : 0; |
| 236 | ||
| 236 | ||
| 237 | 237 | // 6th digit only has A and G for = |
| 238 | 238 | m_leds_state[3] &= 0x41; |
| 239 | 239 | |
| r242631 | r242632 | |
| 272 | 272 | UINT8 o = BITSWAP8(m_o,7,5,2,1,4,0,6,3); |
| 273 | 273 | for (int i = 0; i < 9; i++) |
| 274 | 274 | m_leds_state[i] = (data >> i & 1) ? o : 0; |
| 275 | ||
| 275 | ||
| 276 | 276 | // 1st digit only has segments B,F,G,DP |
| 277 | 277 | m_leds_state[0] &= 0xe2; |
| 278 | 278 |
| r242631 | r242632 | |
|---|---|---|
| 3 | 3 | /*************************************************************************** |
| 4 | 4 | |
| 5 | 5 | Texas Instruments Speak & Spell hardware |
| 6 | ||
| 6 | ||
| 7 | 7 | (still need to write notes here..) |
| 8 | ||
| 8 | ||
| 9 | 9 | Other stuff on similar hardware: |
| 10 | 10 | - Language Tutor/Translator |
| 11 | 11 | - Touch & Tell, but it runs on a TMS1100! |
| r242631 | r242632 | |
| 134 | 134 | // schedule delayed filament-off |
| 135 | 135 | m_filoff_timer->adjust(attotime::from_msec(FILOFF_DECAY_TIME)); |
| 136 | 136 | } |
| 137 | ||
| 137 | ||
| 138 | 138 | // update digit state |
| 139 | 139 | for (int i = 0; i < 9; i++) |
| 140 | 140 | if (m_r >> i & 1) |
| r242631 | r242632 | |
| 145 | 145 | { |
| 146 | 146 | // standard led14seg |
| 147 | 147 | output_set_digit_value(i, m_filament_on ? m_digit_state[i] & 0x3fff : 0); |
| 148 | ||
| 148 | ||
| 149 | 149 | // DP(display point) and AP(apostrophe) segments as lamps |
| 150 | 150 | output_set_lamp_value(i*10 + 0, m_digit_state[i] >> 14 & m_filament_on); |
| 151 | 151 | output_set_lamp_value(i*10 + 1, m_digit_state[i] >> 15 & m_filament_on); |
| r242631 | r242632 | |
| 233 | 233 | INPUT_CHANGED_MEMBER(tispeak_state::power_button) |
| 234 | 234 | { |
| 235 | 235 | int on = (int)(FPTR)param; |
| 236 | ||
| 236 | ||
| 237 | 237 | if (on && !m_power_on) |
| 238 | 238 | { |
| 239 | 239 | m_power_on = 1; |
| r242631 | r242632 | |
| 391 | 391 | save_item(NAME(m_o)); |
| 392 | 392 | save_item(NAME(m_filament_on)); |
| 393 | 393 | save_item(NAME(m_power_on)); |
| 394 | ||
| 394 | ||
| 395 | 395 | // init cartridge |
| 396 | 396 | if (m_cart != NULL && m_cart->exists()) |
| 397 | 397 | { |
| r242631 | r242632 | |
| 442 | 442 | /* basic machine hardware */ |
| 443 | 443 | MCFG_CPU_MODIFY("maincpu") |
| 444 | 444 | MCFG_TMS1XXX_WRITE_O_CB(WRITE16(tispeak_state, snspell_write_o)) |
| 445 | ||
| 445 | ||
| 446 | 446 | /* cartridge */ |
| 447 | 447 | MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "snspell") |
| 448 | 448 | MCFG_GENERIC_EXTENSIONS("vsm") |
| r242631 | r242632 | |
|---|---|---|
| 5 | 5 | |
| 6 | 6 | 0000-2fff ROM R D0-D7 |
| 7 | 7 | 3000-37ff ROM on Model III R D0-D7 |
| 8 | ||
| 8 | unused on Model I | |
| 9 | 9 | 37de UART status R/W D0-D7 |
| 10 | 10 | 37df UART data R/W D0-D7 |
| 11 | 11 | 37e0 interrupt latch address (lnw80 = for the realtime clock) |
| r242631 | r242632 | |
| 16 | 16 | 37e5 select disk drive 2 W |
| 17 | 17 | 37e7 select disk drive 3 W |
| 18 | 18 | 37e0-37e3 floppy motor W D0-D3 |
| 19 | ||
| 19 | or floppy head select W D3 | |
| 20 | 20 | 37e8 send a byte to printer W D0-D7 |
| 21 | 21 | 37e8 read printer status R D7 |
| 22 | 22 | 37ec-37ef FDC WD179x R/W D0-D7 |
| r242631 | r242632 | |
| 42 | 42 | Due to the above, the only working emulated UART is for the Model 3. |
| 43 | 43 | |
| 44 | 44 | Cassette baud rates: Model I level I - 250 baud |
| 45 | Model I level II and all clones - 500 baud | |
| 46 | Model III/4 - 500 and 1500 baud selectable at boot time | |
| 47 | - When it says "Cass?" press L for 500 baud, or Enter otherwise. | |
| 48 | LNW-80 - 500 baud @1.77MHz and 1000 baud @4MHz. | |
| 45 | Model I level II and all clones - 500 baud | |
| 46 | Model III/4 - 500 and 1500 baud selectable at boot time | |
| 47 | - When it says "Cass?" press L for 500 baud, or Enter otherwise. | |
| 48 | LNW-80 - 500 baud @1.77MHz and 1000 baud @4MHz. | |
| 49 | 49 | |
| 50 | 50 | I/O ports |
| 51 | 51 | FF: |
| r242631 | r242632 | |
| 92 | 92 | - 80-8F hires graphics (optional) |
| 93 | 93 | |
| 94 | 94 | About the ht1080z - This was made for schools in Hungary. Each comes with a BASIC extension roms |
| 95 | which activated Hungarian features. To activate - start emulation - enter SYSTEM | |
| 96 | Enter /12288 and the extensions will be installed and you are returned to READY. | |
| 97 | The ht1080z is identical to the System 80, apart from the character rom. | |
| 98 | The ht1080z2 has a modified extension rom and character generator. | |
| 95 | which activated Hungarian features. To activate - start emulation - enter SYSTEM | |
| 96 | Enter /12288 and the extensions will be installed and you are returned to READY. | |
| 97 | The ht1080z is identical to the System 80, apart from the character rom. | |
| 98 | The ht1080z2 has a modified extension rom and character generator. | |
| 99 | 99 | |
| 100 | 100 | About the RTC - The time is incremented while ever the cursor is flashing. It is stored in a series |
| 101 | of bytes in the computer's work area. The bytes are in a certain order, this is: | |
| 102 | seconds, minutes, hours, year, day, month. On a model 1, the seconds are stored at | |
| 103 | 0x4041, while on the model 4 it is 0x4217. A reboot always sets the time to zero. | |
| 101 | of bytes in the computer's work area. The bytes are in a certain order, this is: | |
| 102 | seconds, minutes, hours, year, day, month. On a model 1, the seconds are stored at | |
| 103 | 0x4041, while on the model 4 it is 0x4217. A reboot always sets the time to zero. | |
| 104 | 104 | |
| 105 | 105 | Model 4 memory organisation - |
| 106 | Mode 0: ROM=0-37E7 and 37EA-3FFF; Printer=37E8-37E9; Keyboard=3800-3BFF; Video=3C00-3FFF | |
| 107 | Mode 1: Keyboard and Video as above; 0-3FFF read=ROM and write=RAM | |
| 108 | Mode 2: Keyboard=F400-F7FF; Video=F800-FFFF; the rest is RAM | |
| 109 | Mode 3: All RAM | |
| 110 | In the "maincpu" memory map, the first 64k is given to the ROM, keyboard, printer and video, | |
| 111 | while the second 64k is RAM that is switched in as needed. The area from 4800-FFFF | |
| 112 | is considered a "black hole", any writes to there will disappear. | |
| 113 | The video is organised as 2 banks of 0x400 bytes, except in Mode 2 where it becomes contiguous. | |
| 106 | Mode 0: ROM=0-37E7 and 37EA-3FFF; Printer=37E8-37E9; Keyboard=3800-3BFF; Video=3C00-3FFF | |
| 107 | Mode 1: Keyboard and Video as above; 0-3FFF read=ROM and write=RAM | |
| 108 | Mode 2: Keyboard=F400-F7FF; Video=F800-FFFF; the rest is RAM | |
| 109 | Mode 3: All RAM | |
| 110 | In the "maincpu" memory map, the first 64k is given to the ROM, keyboard, printer and video, | |
| 111 | while the second 64k is RAM that is switched in as needed. The area from 4800-FFFF | |
| 112 | is considered a "black hole", any writes to there will disappear. | |
| 113 | The video is organised as 2 banks of 0x400 bytes, except in Mode 2 where it becomes contiguous. | |
| 114 | 114 | |
| 115 | 115 | Model 4P - is the same as Model 4 except: |
| 116 | - ROM is only 0000-0FFF, while 1000-37FF is given over to RAM | |
| 117 | - There is no cassette support in hardware. | |
| 116 | - ROM is only 0000-0FFF, while 1000-37FF is given over to RAM | |
| 117 | - There is no cassette support in hardware. | |
| 118 | 118 | |
| 119 | 119 | *************************************************************************** |
| 120 | 120 |
| r242631 | r242632 | |
|---|---|---|
| 3 | 3 | /*************************************************************************** |
| 4 | 4 | |
| 5 | 5 | TMS1100NLL MP3403 DBS 7836 SINGAPORE some game board with 7-segs. |
| 6 | ||
| 6 | ||
| 7 | 7 | What old electronic game is this? |
| 8 | ||
| 8 | ||
| 9 | 9 | some clues: |
| 10 | 10 | - it's from 1978 |
| 11 | 11 | - Merlin is MP3404, Amaze-A-Tron is MP3405, this one is MP3403 |
| 12 | 12 | - it plays some short jingles (you need to be lucky with button mashing), |
| 13 | 13 | jingles feel like maybe a horse racing game |
| 14 | ||
| 14 | ||
| 15 | 15 | ***************************************************************************/ |
| 16 | 16 | |
| 17 | 17 | #include "emu.h" |
| r242631 | r242632 | |
| 42 | 42 | DECLARE_READ8_MEMBER(read_k); |
| 43 | 43 | DECLARE_WRITE16_MEMBER(write_o); |
| 44 | 44 | DECLARE_WRITE16_MEMBER(write_r); |
| 45 | ||
| 45 | ||
| 46 | 46 | void leds_update(); |
| 47 | ||
| 47 | ||
| 48 | 48 | virtual void machine_start(); |
| 49 | 49 | }; |
| 50 | 50 | |
| r242631 | r242632 | |
| 73 | 73 | sprintf(dig, "\n %X %c %02X",i, (m_r >> i & 1) ? 'X' : '_', leds[i]); |
| 74 | 74 | strcat(msg, dig); |
| 75 | 75 | } |
| 76 | ||
| 76 | ||
| 77 | 77 | popmessage("%s", msg); |
| 78 | 78 | } |
| 79 | 79 | |
| r242631 | r242632 | |
| 87 | 87 | if (m_r >> (i + 4) & 1) |
| 88 | 88 | k |= m_button_matrix[i]->read(); |
| 89 | 89 | } |
| 90 | ||
| 90 | ||
| 91 | 91 | return k; |
| 92 | 92 | } |
| 93 | 93 | |
| r242631 | r242632 | |
| 97 | 97 | // R10: maybe a switch or other button row? |
| 98 | 98 | // R9: speaker out |
| 99 | 99 | m_speaker->level_w(data >> 9 & 1); |
| 100 | ||
| 100 | ||
| 101 | 101 | // others: ? |
| 102 | 102 | m_r = data; |
| 103 | 103 | leds_update(); |
| r242631 | r242632 | |
| 156 | 156 | { |
| 157 | 157 | m_r = 0; |
| 158 | 158 | m_o = 0; |
| 159 | ||
| 159 | ||
| 160 | 160 | save_item(NAME(m_r)); |
| 161 | 161 | save_item(NAME(m_o)); |
| 162 | 162 | } |
| r242631 | r242632 | |
|---|---|---|
| 14 | 14 | TODO: |
| 15 | 15 | |
| 16 | 16 | - keyboard |
| 17 | - expansion bus | |
| 18 | - Z80 card | |
| 19 | - Winchester DMA card (Xebec S1410 + Tandon TM502/TM603SE) | |
| 20 | - RAM cards | |
| 21 | - clock cards | |
| 17 | - expansion bus | |
| 18 | - Z80 card | |
| 19 | - Winchester DMA card (Xebec S1410 + Tandon TM502/TM603SE) | |
| 20 | - RAM cards | |
| 21 | - clock cards | |
| 22 | 22 | - floppy 8048 |
| 23 | 23 | - hires graphics |
| 24 | 24 | - brightness/contrast |
| r242631 | r242632 | |
|---|---|---|
| 205 | 205 | MCFG_T11_INITIAL_MODE(5 << 13) |
| 206 | 206 | |
| 207 | 207 | /* |
| 208 | MCFG_CPU_ADD("charcpu", I8085A, XTAL_16MHz / 4) | |
| 209 | MCFG_CPU_PROGRAM_MAP(vt240_char_mem) | |
| 210 | MCFG_CPU_IO_MAP(vt240_char_io) | |
| 211 | MCFG_CPU_VBLANK_INT_DRIVER("screen", vt240_state, vt240_irq) | |
| 208 | MCFG_CPU_ADD("charcpu", I8085A, XTAL_16MHz / 4) | |
| 209 | MCFG_CPU_PROGRAM_MAP(vt240_char_mem) | |
| 210 | MCFG_CPU_IO_MAP(vt240_char_io) | |
| 211 | MCFG_CPU_VBLANK_INT_DRIVER("screen", vt240_state, vt240_irq) | |
| 212 | 212 | */ |
| 213 | 213 | |
| 214 | 214 | MCFG_SCREEN_ADD("screen", RASTER) |
| r242631 | r242632 | |
| 216 | 216 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ |
| 217 | 217 | MCFG_SCREEN_SIZE(640, 480) |
| 218 | 218 | MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1) |
| 219 | // | |
| 219 | // MCFG_VIDEO_START_OVERRIDE(vt240_state,vt240) | |
| 220 | 220 | MCFG_SCREEN_UPDATE_DEVICE("upd7220", upd7220_device, screen_update) |
| 221 | 221 | MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette") |
| 222 | 222 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", vt240) |
| r242631 | r242632 | |
| 226 | 226 | MCFG_UPD7220_DRAW_TEXT_CALLBACK_OWNER(vt240_state, hgdc_draw_text) |
| 227 | 227 | |
| 228 | 228 | MCFG_MC68681_ADD("duart", XTAL_3_6864MHz) /* 2681 duart (not 68681!) */ |
| 229 | // | |
| 229 | // MCFG_MC68681_IRQ_CALLBACK(WRITELINE(dectalk_state, dectalk_duart_irq_handler)) | |
| 230 | 230 | MCFG_MC68681_A_TX_CALLBACK(DEVWRITELINE("rs232", rs232_port_device, write_txd)) |
| 231 | // MCFG_MC68681_B_TX_CALLBACK(WRITELINE(dectalk_state, dectalk_duart_txa)) | |
| 232 | // MCFG_MC68681_INPORT_CALLBACK(READ8(dectalk_state, dectalk_duart_input)) | |
| 233 | // MCFG_MC68681_OUTPORT_CALLBACK(WRITE8(dectalk_state, dectalk_duart_output)) | |
| 234 | // MCFG_I8251_DTR_HANDLER(DEVWRITELINE("rs232", rs232_port_device, write_dtr)) | |
| 235 | // MCFG_I8251_RTS_HANDLER(DEVWRITELINE("rs232", rs232_port_device, write_rts)) | |
| 231 | // MCFG_MC68681_B_TX_CALLBACK(WRITELINE(dectalk_state, dectalk_duart_txa)) | |
| 232 | // MCFG_MC68681_INPORT_CALLBACK(READ8(dectalk_state, dectalk_duart_input)) | |
| 233 | // MCFG_MC68681_OUTPORT_CALLBACK(WRITE8(dectalk_state, dectalk_duart_output)) | |
| 234 | // MCFG_I8251_DTR_HANDLER(DEVWRITELINE("rs232", rs232_port_device, write_dtr)) | |
| 235 | // MCFG_I8251_RTS_HANDLER(DEVWRITELINE("rs232", rs232_port_device, write_rts)) | |
| 236 | 236 | |
| 237 | 237 | MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, "null_modem") |
| 238 | 238 | MCFG_RS232_RXD_HANDLER(DEVWRITELINE("duart", mc68681_device, rx_a_w)) |
| 239 | // | |
| 239 | // MCFG_RS232_DSR_HANDLER(DEVWRITELINE("duart", mc68681_device, ipX_w)) | |
| 240 | 240 | MACHINE_CONFIG_END |
| 241 | 241 | |
| 242 | 242 | static MACHINE_CONFIG_START( mc7105, vt240_state ) |
| r242631 | r242632 | |
| 244 | 244 | |
| 245 | 245 | // serial connection to MS7004 keyboard |
| 246 | 246 | MCFG_DEVICE_ADD("i8251", I8251, 0) |
| 247 | // | |
| 247 | // MCFG_I8251_RXRDY_HANDLER(DEVWRITELINE("pic8259", pic8259_device, ir1_w)) | |
| 248 | 248 | |
| 249 | 249 | MCFG_DEVICE_ADD("ms7004", MS7004, 0) |
| 250 | 250 | MCFG_MS7004_TX_HANDLER(DEVWRITELINE("i8251", i8251_device, write_rxd)) |
| r242631 | r242632 | |
|---|---|---|
| 48 | 48 | #define RS232_A_TAG "rs232a" |
| 49 | 49 | #define RS232_B_TAG "rs232b" |
| 50 | 50 | #define SCREEN_TAG "screen" |
| 51 | #define KB_TAG | |
| 51 | #define KB_TAG "kb" | |
| 52 | 52 | #define FDC_TAG "fdc" |
| 53 | 53 | |
| 54 | 54 | class victor9k_state : public driver_device |
| r242631 | r242632 | |
|---|---|---|
| 50 | 50 | |
| 51 | 51 | <view name="Internal Layout"> |
| 52 | 52 | <bounds left="0" right="165" top="0" bottom="105" /> |
| 53 | ||
| 53 | ||
| 54 | 54 | <bezel element="static_yellow"><bounds x="3" y="17" width="10" height="83" /></bezel> |
| 55 | 55 | <bezel element="static_black"><bounds x="4" y="18" width="8" height="81" /></bezel> |
| 56 | 56 | |
| r242631 | r242632 | |
| 75 | 75 | <bezel element="text_3"><bounds x="64.5" y="4" width="8" height="8" /></bezel> |
| 76 | 76 | <bezel element="text_4"><bounds x="84.5" y="4" width="8" height="8" /></bezel> |
| 77 | 77 | |
| 78 | ||
| 78 | ||
| 79 | 79 | <!-- lamp matrix --> |
| 80 | ||
| 80 | ||
| 81 | 81 | <bezel element="static_gray"><bounds x="17" y="17" width="83" height="83" /></bezel> |
| 82 | 82 | |
| 83 | 83 | <bezel name="lamp20" element="lamp"><bounds x="20" y="20" width="17" height="17" /></bezel> |
| r242631 | r242632 | |
|---|---|---|
| 500 | 500 | UINT16 dest_addr = m_dma.dest_current & m_dma.dest_mask; |
| 501 | 501 | UINT8 dest_adj = (3 - (m_dma.dest_x_current & 3)) << 1; |
| 502 | 502 | UINT8 src_adj = (3 - (m_dma.source_x_current & 3)) << 1; |
| 503 | ||
| 503 | ||
| 504 | 504 | /* handle DMA for 1 pixel */ |
| 505 | 505 | // Get new pixel |
| 506 | 506 | UINT8 source_pixel = (m_dma.source_bank[src_addr] >> src_adj) & 3; |
| r242631 | r242632 | |
|---|---|---|
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | const device_type NGEN_KEYBOARD = &device_creator<ngen_keyboard_device>; |
| 219 |
| r242631 | r242632 | |
|---|---|---|
| 1299 | 1299 | /* Do horizontal scaling */ |
| 1300 | 1300 | for (int plot_x = plot_min_x; plot_x <= plot_max_x;) |
| 1301 | 1301 | { |
| 1302 | ||
| 1302 | for (int j = (plot_x - plot_x_group); j <= MIN(1, plot_max_x - plot_x_group); j++) | |
| 1303 | 1303 | { |
| 1304 | 1304 | if (sms_x + j >= vdp_bitmap.cliprect().min_x && sms_x + j + 1 <= vdp_bitmap.cliprect().max_x) |
| 1305 | 1305 | { |
| r242631 | r242632 | |
| 1366 | 1366 | rgb_t c4 = line4[plot_x]; |
| 1367 | 1367 | p_bitmap[plot_x] = |
| 1368 | 1368 | rgb_t( ( c1.r() / 6 + c2.r() / 3 + c3.r() / 3 + c4.r() / 6 ), |
| 1369 | ( c1.g() / 6 + c2.g() / 3 + c3.g() / 3 + c4.g() / 6 ), | |
| 1370 | ( c1.b() / 6 + c2.b() / 3 + c3.b() / 3 + c4.b() / 6 ) ); | |
| 1369 | ( c1.g() / 6 + c2.g() / 3 + c3.g() / 3 + c4.g() / 6 ), | |
| 1370 | ( c1.b() / 6 + c2.b() / 3 + c3.b() / 3 + c4.b() / 6 ) ); | |
| 1371 | 1371 | } |
| 1372 | 1372 | } |
| 1373 | 1373 | } |
| r242631 | r242632 | |
|---|---|---|
| 11 | 11 | |
| 12 | 12 | /* |
| 13 | 13 | |
| 14 | ||
| 14 | value error description | |
| 15 | 15 | |
| 16 | 01 no sync pulse detected | |
| 17 | 02 no header track | |
| 18 | 03 checksum error in header | |
| 19 | 04 not right track | |
| 20 | 05 not right sector | |
| 21 | 06 not a data block | |
| 22 | 07 data checksum error | |
| 23 | 08 sync too long | |
| 24 | 99 not a system disc | |
| 16 | 01 no sync pulse detected | |
| 17 | 02 no header track | |
| 18 | 03 checksum error in header | |
| 19 | 04 not right track | |
| 20 | 05 not right sector | |
| 21 | 06 not a data block | |
| 22 | 07 data checksum error | |
| 23 | 08 sync too long | |
| 24 | 99 not a system disc | |
| 25 | 25 | |
| 26 | 11 Noise on sync | |
| 27 | FF No sync (bad or unformatted disk) | |
| 26 | 11 Noise on sync | |
| 27 | FF No sync (bad or unformatted disk) | |
| 28 | 28 | |
| 29 | 29 | */ |
| 30 | 30 | |
| r242631 | r242632 | |
| 32 | 32 | |
| 33 | 33 | TODO: |
| 34 | 34 | |
| 35 | - communication error with SCP after loading boot sector | |
| 36 | - bp ff1a8 | |
| 37 | - patch ff1ab=c3 | |
| 35 | - communication error with SCP after loading boot sector | |
| 36 | - bp ff1a8 | |
| 37 | - patch ff1ab=c3 | |
| 38 | 38 | - single/double sided jumper |
| 39 | 39 | - header sync length unknown (6 is too short) |
| 40 | 40 | - 8048 spindle speed control |
| r242631 | r242632 | |
| 60 | 60 | |
| 61 | 61 | // this is exactly the same decode/encode as used in the Commodore 4040/8050 series drives |
| 62 | 62 | #define GCR_DECODE(_e, _i) \ |
| 63 | ||
| 63 | ((BIT(_e, 6) << 7) | (BIT(_i, 7) << 6) | (_e & 0x33) | (BIT(_e, 2) << 3) | (_i & 0x04)) | |
| 64 | 64 | |
| 65 | 65 | // E7 E6 I7 E5 E4 E3 E2 I2 E1 E0 |
| 66 | 66 | #define GCR_ENCODE(_e, _i) \ |
| 67 | ||
| 67 | ((_e & 0xc0) << 2 | (_i & 0x80) | (_e & 0x3c) << 1 | (_i & 0x04) | (_e & 0x03)) | |
| 68 | 68 | |
| 69 | 69 | // Tandon TM-100 spindle @ 300RPM, measured TACH 12VAC 256Hz |
| 70 | 70 | // TACH = RPM / 60 * SPINDLE RATIO * MOTOR POLES |
| 71 | 71 | // 256 = 300 / 60 * 6.4 * 8 |
| 72 | #define SPINDLE_RATIO 6.4 | |
| 73 | #define MOTOR_POLES 8 | |
| 72 | #define SPINDLE_RATIO 6.4 | |
| 73 | #define MOTOR_POLES 8 | |
| 74 | 74 | |
| 75 | 75 | // TODO wrong values here! motor speed is controlled by an LM2917, with help from the spindle TACH and a DAC0808 whose value is set by the SCP 8048 |
| 76 | 76 | const int victor_9000_fdc_t::rpm[] = { 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 254, 255, 257, 259, 260, 262, 264, 266, 267, 269, 271, 273, 275, 276, 278, 280, 282, 284, 286, 288, 290, 291, 293, 295, 297, 299, 301, 303, 305, 307, 309, 311, 313, 315, 318, 320, 322, 324, 326, 328, 330, 333, 335, 337, 339, 342, 344, 346, 348, 351, 353, 355, 358, 360, 362, 365, 367, 370, 372, 375, 377, 380, 382, 385, 387, 390, 392, 395, 398, 400, 403, 406, 408, 411, 414, 416, 419, 422, 425, 428, 430, 433, 436, 439, 442, 445, 448, 451, 454, 457, 460, 463, 466, 469, 472, 475, 478, 482, 485, 488, 491, 494, 498, 501, 504, 508, 511, 514, 518, 521, 525, 528, 532, 535, 539, 542, 546, 550, 553, 557, 561, 564, 568, 572, 576, 579, 583, 587, 591, 595, 599, 603, 607, 611, 615, 619, 623, 627, 631, 636, 640, 644, 648, 653, 657, 661, 666, 670, 674, 679, 683, 688, 693, 697, 702, 706, 711, 716, 721, 725, 730, 735, 740, 745, 750, 755, 760, 765, 770, 775, 780, 785, 790, 796, 801, 806, 812, 817, 822, 828, 833, 839, 844, 850, 856, 861, 867, 873, 878, 884 }; |
| r242631 | r242632 | |
|---|---|---|
| 347 | 347 | |
| 348 | 348 | #define I8021_TAG "z3" |
| 349 | 349 | |
| 350 | #define LOG | |
| 350 | #define LOG 0 | |
| 351 | 351 | |
| 352 | 352 | |
| 353 | 353 | |
| r242631 | r242632 | |
| 433 | 433 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("W") PORT_CODE(KEYCODE_W) PORT_CHAR('w') PORT_CHAR('W') // S36 |
| 434 | 434 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("A") PORT_CODE(KEYCODE_A) PORT_CHAR('a') PORT_CHAR('A') // S56 |
| 435 | 435 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("S") PORT_CODE(KEYCODE_S) PORT_CHAR('s') PORT_CHAR('S') // S57 |
| 436 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("UNUSED S75") // unused // S75 | |
| 436 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("UNUSED S75") // unused // S75 | |
| 437 | 437 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Z") PORT_CODE(KEYCODE_Z) PORT_CHAR('z') PORT_CHAR('Z') // S76 |
| 438 | 438 | |
| 439 | 439 | PORT_START("Y2") |
| r242631 | r242632 | |
|---|---|---|
| 1302 | 1302 | $(MESS_DRIVERS)/hp49gp.o \ |
| 1303 | 1303 | $(MESS_DRIVERS)/hp9845.o \ |
| 1304 | 1304 | $(MESS_DRIVERS)/hp9k.o \ |
| 1305 | $(MESS_DRIVERS)/hp9k_3xx.o | |
| 1305 | $(MESS_DRIVERS)/hp9k_3xx.o \ | |
| 1306 | 1306 | |
| 1307 | 1307 | |
| 1308 | 1308 | $(MESSOBJ)/hec2hrp.a: \ |
| r242631 | r242632 | |
|---|---|---|
| 1209 | 1209 | } |
| 1210 | 1210 | else |
| 1211 | 1211 | { |
| 1212 | artifact_map_ptr = &m_hires_artifact_map[((vram_row[col + 1] & 0x80) >> 7) * 16]; | |
| 1212 | artifact_map_ptr = &m_hires_artifact_map[((vram_row[col + 1] & 0x80) >> 7) * 16]; | |
| 1213 | 1213 | } |
| 1214 | 1214 | for (b = 0; b < 7; b++) |
| 1215 | 1215 | { |
| r242631 | r242632 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | |
| 6 | 6 | - some history: |
| 7 | 2014-12-01 Mike Saarna, Robert Tuccitto Implemented "colorburst kill" bit | |
| 8 | of the MARIA CTRL register. | |
| 7 | 2014-12-01 Mike Saarna, Robert Tuccitto Implemented "colorburst kill" bit | |
| 8 | of the MARIA CTRL register. | |
| 9 | 9 | 2014-10-05 Mike Saarna, Robert Tuccitto Last Line DMA value corrected |
| 10 | 10 | to 6. GCC and Atari docs both show a difference between |
| 11 | 11 | Other Line and Last Line as +6 at the lowest part of the |
| r242631 | r242632 | |
|---|---|---|
| 14 | 14 | |
| 15 | 15 | QVariant DevicesWindowModel::data(const QModelIndex &index, int role) const |
| 16 | 16 | { |
| 17 | if(!index.isValid() || role != Qt::DisplayRole) | |
| 18 | return QVariant(); | |
| 17 | if(!index.isValid() || role != Qt::DisplayRole) | |
| 18 | return QVariant(); | |
| 19 | 19 | |
| 20 | 20 | device_t *dev = static_cast<device_t *>(index.internalPointer()); |
| 21 | 21 | switch(index.column()) { |
| r242631 | r242632 | |
| 43 | 43 | |
| 44 | 44 | QModelIndex DevicesWindowModel::index(int row, int column, const QModelIndex &parent) const |
| 45 | 45 | { |
| 46 | if(!hasIndex(row, column, parent)) | |
| 47 | return QModelIndex(); | |
| 46 | if(!hasIndex(row, column, parent)) | |
| 47 | return QModelIndex(); | |
| 48 | 48 | |
| 49 | 49 | device_t *target = NULL; |
| 50 | 50 | |
| r242631 | r242632 | |
| 67 | 67 | |
| 68 | 68 | QModelIndex DevicesWindowModel::parent(const QModelIndex &index) const |
| 69 | 69 | { |
| 70 | if(!index.isValid()) | |
| 71 | return QModelIndex(); | |
| 70 | if(!index.isValid()) | |
| 71 | return QModelIndex(); | |
| 72 | 72 | |
| 73 | ||
| 73 | device_t *dchild = static_cast<device_t *>(index.internalPointer()); | |
| 74 | 74 | device_t *dparent = dchild->owner(); |
| 75 | 75 | |
| 76 | 76 | if(!dparent) |
| r242631 | r242632 | |
| 82 | 82 | for(device_t *child = dpp->first_subdevice(); child && child != dparent; child = child->next()) |
| 83 | 83 | row++; |
| 84 | 84 | } |
| 85 | ||
| 85 | return createIndex(row, 0, dparent); | |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | int DevicesWindowModel::rowCount(const QModelIndex &parent) const |
| 89 | 89 | { |
| 90 | 90 | if(!parent.isValid()) |
| 91 | 91 | return 1; |
| 92 | ||
| 92 | ||
| 93 | 93 | device_t *dparent = static_cast<device_t *>(parent.internalPointer()); |
| 94 | 94 | int count = 0; |
| 95 | 95 | for(device_t *child = dparent->first_subdevice(); child; child = child->next()) |
| r242631 | r242632 | |
| 157 | 157 | void DevicesWindowQtConfig::buildFromQWidget(QWidget* widget) |
| 158 | 158 | { |
| 159 | 159 | WindowQtConfig::buildFromQWidget(widget); |
| 160 | // | |
| 160 | // DevicesWindow* window = dynamic_cast<DevicesWindow*>(widget); | |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | |
| 164 | 164 | void DevicesWindowQtConfig::applyToQWidget(QWidget* widget) |
| 165 | 165 | { |
| 166 | 166 | WindowQtConfig::applyToQWidget(widget); |
| 167 | // | |
| 167 | // DevicesWindow* window = dynamic_cast<DevicesWindow*>(widget); | |
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 |
| r242631 | r242632 | |
|---|---|---|
| 23 | 23 | QVariant headerData(int section, Qt::Orientation orientation, |
| 24 | 24 | int role = Qt::DisplayRole) const; |
| 25 | 25 | QModelIndex index(int row, int column, |
| 26 | | |
| 26 | const QModelIndex &parent = QModelIndex()) const; | |
| 27 | 27 | QModelIndex parent(const QModelIndex &index) const; |
| 28 | 28 | int rowCount(const QModelIndex &parent = QModelIndex()) const; |
| 29 | 29 | int columnCount(const QModelIndex &parent = QModelIndex()) const; |
| 30 | ||
| 30 | ||
| 31 | 31 | private: |
| 32 | 32 | running_machine *m_machine; |
| 33 | 33 | }; |
| r242631 | r242632 | |
| 44 | 44 | virtual ~DevicesWindow(); |
| 45 | 45 | |
| 46 | 46 | public slots: |
| 47 | void currentRowChanged(const QModelIndex ¤t, const QModelIndex &previous); | |
| 48 | void activated(const QModelIndex &index); | |
| 47 | void currentRowChanged(const QModelIndex ¤t, const QModelIndex &previous); | |
| 48 | void activated(const QModelIndex &index); | |
| 49 | 49 | |
| 50 | 50 | private: |
| 51 | 51 | QTreeView *m_devices_view; |
| r242631 | r242632 | |
|---|---|---|
| 1941 | 1941 | machine.schedule_exit(); |
| 1942 | 1942 | break; |
| 1943 | 1943 | case SDL_VIDEORESIZE: |
| 1944 | | |
| 1944 | sdl_window_list->window_resize(event.resize.w, event.resize.h); | |
| 1945 | 1945 | break; |
| 1946 | 1946 | #else |
| 1947 | 1947 | case SDL_TEXTINPUT: |
| r242631 | r242632 | |
|---|---|---|
| 70 | 70 | float aspect; // computed/configured aspect ratio of the physical device |
| 71 | 71 | int center_width; // width of first physical screen for centering |
| 72 | 72 | int center_height; // height of first physical screen for centering |
| 73 | int | |
| 73 | int monitor_x; // X position of this monitor in virtual desktop space (SDL virtual space has them all horizontally stacked, not real geometry) | |
| 74 | 74 | }; |
| 75 | 75 | |
| 76 | 76 |
| r242631 | r242632 | |
|---|---|---|
| 101 | 101 | static sdl_draw_info draw; |
| 102 | 102 | |
| 103 | 103 | struct worker_param { |
| 104 | worker_param() | |
| 105 | : m_window(NULL), m_list(NULL), m_machine(NULL), m_resize_new_width(0), m_resize_new_height(0) | |
| 106 | { | |
| 107 | } | |
| 108 | worker_param(running_machine &amachine, sdl_window_info *awindow) | |
| 109 | : m_window(awindow), m_list(NULL), m_machine(&amachine), m_resize_new_width(0), m_resize_new_height(0) | |
| 110 | { | |
| 111 | } | |
| 112 | worker_param(running_machine &amachine, sdl_window_info *awindow, render_primitive_list *alist) | |
| 113 | : m_window(awindow), m_list(alist), m_machine(&amachine), m_resize_new_width(0), m_resize_new_height(0) | |
| 114 | { | |
| 115 | } | |
| 116 | worker_param(sdl_window_info *awindow, int anew_width, int anew_height) | |
| 117 | : m_window(awindow), m_list(NULL), m_machine(NULL), m_resize_new_width(anew_width), m_resize_new_height(anew_height) | |
| 118 | { | |
| 119 | } | |
| 120 | worker_param(sdl_window_info *awindow) | |
| 121 | : m_window(awindow), m_list(NULL), m_machine(NULL), m_resize_new_width(0), m_resize_new_height(0) | |
| 122 | { | |
| 123 | } | |
| 104 | worker_param() | |
| 105 | : m_window(NULL), m_list(NULL), m_machine(NULL), m_resize_new_width(0), m_resize_new_height(0) | |
| 106 | { | |
| 107 | } | |
| 108 | worker_param(running_machine &amachine, sdl_window_info *awindow) | |
| 109 | : m_window(awindow), m_list(NULL), m_machine(&amachine), m_resize_new_width(0), m_resize_new_height(0) | |
| 110 | { | |
| 111 | } | |
| 112 | worker_param(running_machine &amachine, sdl_window_info *awindow, render_primitive_list *alist) | |
| 113 | : m_window(awindow), m_list(alist), m_machine(&amachine), m_resize_new_width(0), m_resize_new_height(0) | |
| 114 | { | |
| 115 | } | |
| 116 | worker_param(sdl_window_info *awindow, int anew_width, int anew_height) | |
| 117 | : m_window(awindow), m_list(NULL), m_machine(NULL), m_resize_new_width(anew_width), m_resize_new_height(anew_height) | |
| 118 | { | |
| 119 | } | |
| 120 | worker_param(sdl_window_info *awindow) | |
| 121 | : m_window(awindow), m_list(NULL), m_machine(NULL), m_resize_new_width(0), m_resize_new_height(0) | |
| 122 | { | |
| 123 | } | |
| 124 | 124 | running_machine &machine() const { assert(m_machine != NULL); return *m_machine; } |
| 125 | 125 | sdl_window_info *window() const { assert(m_window != NULL); return m_window; } |
| 126 | ||
| 126 | render_primitive_list *list() const { return m_list; } | |
| 127 | 127 | int new_width() const { return m_resize_new_width; } |
| 128 | int new_height() const { return m_resize_new_height; } | |
| 129 | // FIXME: only needed for window set-up which returns an error. | |
| 130 | void set_window(sdl_window_info *window) { m_window = window; } | |
| 128 | int new_height() const { return m_resize_new_height; } | |
| 129 | // FIXME: only needed for window set-up which returns an error. | |
| 130 | void set_window(sdl_window_info *window) { m_window = window; } | |
| 131 | 131 | private: |
| 132 | 132 | sdl_window_info *m_window; |
| 133 | 133 | render_primitive_list *m_list; |
| r242631 | r242632 | |
| 170 | 170 | |
| 171 | 171 | INLINE void execute_sync(osd_work_callback callback, const worker_param &wp) |
| 172 | 172 | { |
| 173 | worker_param *wp_temp = (worker_param *) osd_malloc(sizeof(worker_param)); | |
| 174 | *wp_temp = wp; | |
| 173 | worker_param *wp_temp = (worker_param *) osd_malloc(sizeof(worker_param)); | |
| 174 | *wp_temp = wp; | |
| 175 | 175 | |
| 176 | ||
| 176 | callback((void *) wp_temp, 0); | |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | |
| r242631 | r242632 | |
| 307 | 307 | |
| 308 | 308 | void sdl_osd_interface::window_exit() |
| 309 | 309 | { |
| 310 | ||
| 310 | worker_param wp_dummy; | |
| 311 | 311 | |
| 312 | 312 | ASSERT_MAIN_THREAD(); |
| 313 | 313 | |
| r242631 | r242632 | |
| 319 | 319 | sdl_window_info *temp = sdl_window_list; |
| 320 | 320 | sdl_window_list = temp->next; |
| 321 | 321 | temp->video_window_destroy(machine()); |
| 322 | // free the window itself | |
| 323 | global_free(temp); | |
| 322 | // free the window itself | |
| 323 | global_free(temp); | |
| 324 | 324 | } |
| 325 | 325 | |
| 326 | 326 | // if we're multithreaded, clean up the window thread |
| r242631 | r242632 | |
| 495 | 495 | execute_async_wait(&sdlwindow_clear_surface_wt, worker_param(this)); |
| 496 | 496 | } |
| 497 | 497 | else |
| 498 | | |
| 498 | execute_sync(&sdlwindow_clear_surface_wt, worker_param(this)); | |
| 499 | 499 | } |
| 500 | 500 | |
| 501 | 501 | |
| r242631 | r242632 | |
| 651 | 651 | |
| 652 | 652 | static OSDWORK_CALLBACK( sdlwindow_update_cursor_state_wt ) |
| 653 | 653 | { |
| 654 | worker_param * wp = (worker_param *) param; | |
| 655 | //sdl_window_info * window = wp->window; | |
| 654 | worker_param * wp = (worker_param *) param; | |
| 655 | //sdl_window_info * window = wp->window; | |
| 656 | 656 | |
| 657 | ||
| 657 | sdlwindow_update_cursor_state(wp->machine(), wp->window()); | |
| 658 | 658 | |
| 659 | ||
| 659 | return NULL; | |
| 660 | 660 | } |
| 661 | 661 | |
| 662 | 662 | |
| r242631 | r242632 | |
| 725 | 725 | |
| 726 | 726 | error: |
| 727 | 727 | window->video_window_destroy(machine); |
| 728 | // free the window itself | |
| 729 | global_free(window); | |
| 728 | // free the window itself | |
| 729 | global_free(window); | |
| 730 | 730 | return 1; |
| 731 | 731 | } |
| 732 | 732 | |
| r242631 | r242632 | |
| 946 | 946 | // adjust the cursor state |
| 947 | 947 | //sdlwindow_update_cursor_state(machine, window); |
| 948 | 948 | |
| 949 | ||
| 949 | execute_async(&sdlwindow_update_cursor_state_wt, worker_param(machine, this)); | |
| 950 | 950 | |
| 951 | 951 | // if we're visible and running and not in the middle of a resize, draw |
| 952 | 952 | if (target != NULL) |
| r242631 | r242632 | |
| 979 | 979 | |
| 980 | 980 | if (osd_event_wait(rendered_event, event_wait_ticks)) |
| 981 | 981 | { |
| 982 | ||
| 982 | // ensure the target bounds are up-to-date, and then get the primitives | |
| 983 | 983 | render_primitive_list *primlist = &get_primitives(this); |
| 984 | 984 | |
| 985 | 985 | // and redraw now |
| r242631 | r242632 | |
| 1038 | 1038 | |
| 1039 | 1039 | // if we're allowed to switch resolutions, override with something better |
| 1040 | 1040 | if (video_config.switchres) |
| 1041 | | |
| 1041 | window->pick_best_mode(&tempwidth, &tempheight); | |
| 1042 | 1042 | } |
| 1043 | 1043 | else if (window->windowed_width) |
| 1044 | 1044 | { |
| r242631 | r242632 | |
|---|---|---|
| 34 | 34 | |
| 35 | 35 | struct sdl_window_info |
| 36 | 36 | { |
| 37 | ||
| 38 | sdl_window_info(running_machine *a_machine, sdl_monitor_info *a_monitor, | |
| 39 | int index, const sdl_window_config *config) | |
| 40 | : next(NULL), m_minwidth(0), m_minheight(0), | |
| 41 | startmaximized(0), | |
| 42 | rendered_event(0), target(0), primlist(NULL), dxdata(NULL), | |
| 43 | width(0), height(0), blitwidth(0), blitheight(0), | |
| 44 | start_viewscreen(0), | |
| 37 | sdl_window_info(running_machine *a_machine, sdl_monitor_info *a_monitor, | |
| 38 | int index, const sdl_window_config *config) | |
| 39 | : next(NULL), m_minwidth(0), m_minheight(0), | |
| 40 | startmaximized(0), | |
| 41 | rendered_event(0), target(0), primlist(NULL), dxdata(NULL), | |
| 42 | width(0), height(0), blitwidth(0), blitheight(0), | |
| 43 | start_viewscreen(0), | |
| 45 | 44 | #if (SDLMAME_SDL2) |
| 46 | sdl_window(NULL), | |
| 47 | resize_width(0), | |
| 48 | resize_height(0), | |
| 49 | last_resize(0), | |
| 45 | sdl_window(NULL), | |
| 46 | resize_width(0), | |
| 47 | resize_height(0), | |
| 48 | last_resize(0), | |
| 50 | 49 | #else |
| 51 | ||
| 50 | screen_width(0), screen_height(0), | |
| 52 | 51 | #endif |
| 53 | m_machine(a_machine), m_monitor(a_monitor), m_fullscreen(0), m_index(0) | |
| 54 | { | |
| 55 | m_maxwidth = config->width; | |
| 56 | m_maxheight = config->height; | |
| 57 | depth = config->depth; | |
| 58 | refresh = config->refresh; | |
| 59 | m_index = index; | |
| 52 | m_machine(a_machine), m_monitor(a_monitor), m_fullscreen(0), m_index(0) | |
| 53 | { | |
| 54 | m_maxwidth = config->width; | |
| 55 | m_maxheight = config->height; | |
| 56 | depth = config->depth; | |
| 57 | refresh = config->refresh; | |
| 58 | m_index = index; | |
| 60 | 59 | |
| 61 | //FIXME: these should be per_window in config-> or even better a bit set | |
| 62 | m_fullscreen = !video_config.windowed; | |
| 63 | prescale = video_config.prescale; | |
| 60 | //FIXME: these should be per_window in config-> or even better a bit set | |
| 61 | m_fullscreen = !video_config.windowed; | |
| 62 | prescale = video_config.prescale; | |
| 64 | 63 | |
| 65 | if (!m_fullscreen) | |
| 66 | { | |
| 67 | windowed_width = config->width; | |
| 68 | windowed_height = config->height; | |
| 69 | } | |
| 70 | } | |
| 64 | if (!m_fullscreen) | |
| 65 | { | |
| 66 | windowed_width = config->width; | |
| 67 | windowed_height = config->height; | |
| 68 | } | |
| 69 | } | |
| 71 | 70 | |
| 72 | void video_window_update(running_machine &machine); | |
| 73 | void blit_surface_size(int window_width, int window_height); | |
| 74 | void toggle_full_screen(running_machine &machine); | |
| 75 | void modify_prescale(running_machine &machine, int dir); | |
| 76 | void window_resize(INT32 width, INT32 height); | |
| 77 | void window_clear(); | |
| 71 | void video_window_update(running_machine &machine); | |
| 72 | void blit_surface_size(int window_width, int window_height); | |
| 73 | void toggle_full_screen(running_machine &machine); | |
| 74 | void modify_prescale(running_machine &machine, int dir); | |
| 75 | void window_resize(INT32 width, INT32 height); | |
| 76 | void window_clear(); | |
| 78 | 77 | |
| 79 | void video_window_destroy(running_machine &machine); | |
| 80 | void pick_best_mode(int *fswidth, int *fsheight); | |
| 81 | void get_min_bounds(int *window_width, int *window_height, int constrain); | |
| 82 | void get_max_bounds(int *window_width, int *window_height, int constrain); | |
| 78 | void video_window_destroy(running_machine &machine); | |
| 79 | void pick_best_mode(int *fswidth, int *fsheight); | |
| 80 | void get_min_bounds(int *window_width, int *window_height, int constrain); | |
| 81 | void get_max_bounds(int *window_width, int *window_height, int constrain); | |
| 83 | 82 | |
| 84 | ||
| 83 | // Pointer to next window | |
| 85 | 84 | sdl_window_info * next; |
| 86 | 85 | |
| 87 | 86 | running_machine &machine() const { assert(m_machine != NULL); return *m_machine; } |
| 88 | 87 | sdl_monitor_info *monitor() const { return m_monitor; } |
| 89 | int fullscreen() const { return m_fullscreen; } | |
| 90 | int index() const { return m_index; } | |
| 88 | int fullscreen() const { return m_fullscreen; } | |
| 89 | int index() const { return m_index; } | |
| 91 | 90 | |
| 92 | ||
| 91 | void set_fullscreen(int afullscreen) { m_fullscreen = afullscreen; } | |
| 93 | 92 | |
| 94 | 93 | // Draw Callbacks |
| 95 | 94 | int (*create)(sdl_window_info *window, int width, int height); |
| r242631 | r242632 | |
| 149 | 148 | private: |
| 150 | 149 | void constrain_to_aspect_ratio(int *window_width, int *window_height, int adjustment); |
| 151 | 150 | |
| 152 | // Pointer to machine | |
| 153 | running_machine * m_machine; | |
| 154 | // monitor info | |
| 155 | sdl_monitor_info * m_monitor; | |
| 156 | int m_fullscreen; | |
| 157 | int m_index; | |
| 151 | // Pointer to machine | |
| 152 | running_machine * m_machine; | |
| 153 | // monitor info | |
| 154 | sdl_monitor_info * m_monitor; | |
| 155 | int m_fullscreen; | |
| 156 | int m_index; | |
| 158 | 157 | |
| 159 | 158 | }; |
| 160 | 159 |
| r242631 | r242632 | |
|---|---|---|
| 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/e6f78d5ed281850d9e8b391c049b8bf696e140bf |
| Previous | 199869 Revisions | Next |